diff --git a/.gitignore b/.gitignore index 1962e925fd..22d232fe90 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,11 @@ *.o *.obj +*.o_flt +*.o_dbl +*.o_ldbl +*.obj_flt +*.obj_dbl +*.obj_ldbl *.a *.so *.out.* @@ -18,9 +24,11 @@ config.status Makefile.config HYPRE_config.h autom4te.cache +*.TVD.v4breakpoints* src/TAGS hypre/ -install/ +build*/ +install*/ AUTOTEST/*.dir out/ .vscode @@ -52,18 +60,25 @@ 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/ij_mp src/test/sstruct src/test/sstruct.exe -src/test/sstruct_fac -src/test/sstruct_fac.exe +src/test/sstructmat +src/test/sstructmat.exe src/test/struct src/test/struct.exe +src/test/structmat +src/test/structmat.exe src/test/struct_migrate src/test/struct_migrate.exe +src/test/test_mp +src/test/test_mp_pcg +src/test/test_mp_pcg_3d src/test/zboxloop src/test/zboxloop.exe +src/test/test_mp +src/test/test_mp_pcg +src/test/test_mp_pcg_3d src/examples/ex[0-9] src/examples/ex[0-9].exe src/examples/ex1[0-8] diff --git a/AUTOTEST/check-double.sh b/AUTOTEST/check-double.sh index 86123092a1..862add9fc5 100755 --- a/AUTOTEST/check-double.sh +++ b/AUTOTEST/check-double.sh @@ -35,7 +35,12 @@ find . -type f -print | egrep '[.]*[.](c|cc|cpp|cxx|C|h|hpp|hxx|H)$' | egrep -v '/docs' | egrep -v '/examples' | egrep -v '/FEI_mv' | - egrep -v '/hypre/include' > check-double.files + egrep -v '/hypre/include' | + egrep -v '/test/ij_mp.c' | + egrep -v '/test/struct_mp.c' | + egrep -v '/test/test_mp.c' | + egrep -v '/test/test_mp_pcg.c' | + egrep -v '/test/test_mp_pcg_3d.c' > check-double.files egrep '(^|[^[:alnum:]_-]+)double([^[:alnum:]_-]+|$)' `cat check-double.files` >&2 diff --git a/AUTOTEST/check-headers.filters b/AUTOTEST/check-headers.filters index ded74f6e8b..5f711f5992 100644 --- a/AUTOTEST/check-headers.filters +++ b/AUTOTEST/check-headers.filters @@ -1,7 +1,7 @@ mpicc mpif77 -include/fortran_matrix.h -include/multivector.h -include/interpreter.h -include/temp_multivector.h +include/_hypre_fortran_matrix.h +include/_hypre_lobpcg_multivector.h +include/_hypre_lobpcg_interpreter.h +include/_hypre_lobpcg_temp_multivector.h fatal: No names found, cannot describe anything. diff --git a/AUTOTEST/check-int.sh b/AUTOTEST/check-int.sh index 2d3b249351..e1bd349c78 100755 --- a/AUTOTEST/check-int.sh +++ b/AUTOTEST/check-int.sh @@ -35,7 +35,12 @@ find . -type f -print | egrep '[.]*[.](c|cc|cpp|cxx|C|h|hpp|hxx|H)$' | egrep -v '/docs' | egrep -v '/examples' | egrep -v '/FEI_mv' | - egrep -v '/hypre/include' > check-int.files + egrep -v '/hypre/include' | + egrep -v '/test/ij_mp.c' | + egrep -v '/test/struct_mp.c' | + egrep -v '/test/test_mp.c' | + egrep -v '/test/test_mp_pcg.c' | + egrep -v '/test/test_mp_pcg_3d.c' > check-int.files egrep '(^|[^[:alnum:]_]+)int([^[:alnum:]_]+|$)' `cat check-int.files` >&2 diff --git a/AUTOTEST/check-license.filters b/AUTOTEST/check-license.filters index de18d6a2c0..e43b97be8a 100644 --- a/AUTOTEST/check-license.filters +++ b/AUTOTEST/check-license.filters @@ -4,8 +4,6 @@ ./AUTOTEST/.*.log ./AUTOTEST/runtests-.* ./src/test/struct_migrate -./src/test/maxwell_unscaled -./src/test/sstruct_fac ./src/test/ams_driver ./src/test/zboxloop ./src/test/ij diff --git a/AUTOTEST/check-license.sh b/AUTOTEST/check-license.sh index bc2e9e8738..b006fd51d4 100755 --- a/AUTOTEST/check-license.sh +++ b/AUTOTEST/check-license.sh @@ -42,7 +42,10 @@ 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/.*functions[.]saved$' | + egrep -v '[.]/src/.*mup[.](exclude|fixed|functions|methods)$' | egrep -v '[.]/src/examples/docs' | + egrep -v '[.]/src/docs/wiki-dev' | egrep -v '[.]/src/test/TEST_.*' > check-license.files # Add these file back to the list @@ -89,4 +92,5 @@ rm -f check-license.remove check-license.files ### Next check for files that should not have the license, but do # blas and lapack '.c' files should not have an LLNL license -egrep -lR "$LicStr" ./src/blas ./src/lapack | egrep '[.]/src/(blas|lapack)/.*[.]c' >&2 +egrep -lR "$LicStr" ./src/blas ./src/lapack | egrep '[.]/src/(blas|lapack)/.*[.]c' | + egrep -v 'mup.*[.]c' >&2 diff --git a/AUTOTEST/check-mem.sh b/AUTOTEST/check-mem.sh index 7f1c9662f6..b330656193 100755 --- a/AUTOTEST/check-mem.sh +++ b/AUTOTEST/check-mem.sh @@ -39,7 +39,12 @@ find . -type f -print | egrep '[.]*[.](c|cc|cpp|cxx|C|h|hpp|hxx|H)$' | 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 -v '/utilities/device_utils.c' | + egrep -v '/test/ij_mp.c' | + egrep -v '/test/struct_mp.c' | + egrep -v '/test/test_mp.c' | + egrep -v '/test/test_mp_pcg.c' | + egrep -v '/test/test_mp_pcg_3d.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/AUTOTEST/check-mpi.sh b/AUTOTEST/check-mpi.sh index 0a96c85ee6..8446ca54c0 100755 --- a/AUTOTEST/check-mpi.sh +++ b/AUTOTEST/check-mpi.sh @@ -35,7 +35,12 @@ find . -type f -print | egrep '[.]*[.](c|cc|cpp|cxx|C|h|hpp|hxx|H)$' | egrep -v '/docs' | egrep -v '/examples' | egrep -v '/FEI_mv' | - egrep -v '/hypre/include' > check-mpi.files + egrep -v '/hypre/include' | + egrep -v '/test/ij_mp.c' | + egrep -v '/test/struct_mp.c' | + egrep -v '/test/test_mp.c' | + egrep -v '/test/test_mp_pcg.c' | + egrep -v '/test/test_mp_pcg_3d.c' > check-mpi.files egrep '(^|[^[:alnum:]_]+)MPI_' `cat check-mpi.files` | egrep -v 'MPI_Comm([^_]|$)' >&2 diff --git a/AUTOTEST/cmake.filters b/AUTOTEST/cmake.filters index 7e55edf789..0616852b01 100644 --- a/AUTOTEST/cmake.filters +++ b/AUTOTEST/cmake.filters @@ -1,3 +1,11 @@ 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. +CMake Warning at config/cmake/HYPRE_SetupGPUToolkit.cmake:97 (message): + =============================================================== + + Umpire is explicitly disabled while building hypre for GPUs. + This is not recommended for performance reasons! + Enable it with -DHYPRE_ENABLE_UMPIRE=ON. +Call Stack (most recent call first): + CMakeLists.txt:400 (include) diff --git a/AUTOTEST/cmake.sh b/AUTOTEST/cmake.sh index ce1d66feca..18d775b875 100755 --- a/AUTOTEST/cmake.sh +++ b/AUTOTEST/cmake.sh @@ -6,7 +6,7 @@ testname=`basename $0 .sh` -drivers="ij sstruct struct ams_driver maxwell_unscaled sstruct_fac struct_migrate ij_assembly" +drivers="ij sstruct struct ams_driver struct_migrate ij_assembly" # Echo usage information case $1 in diff --git a/AUTOTEST/configure.filters b/AUTOTEST/configure.filters index be5d0e217f..1cc8e9d156 100644 --- a/AUTOTEST/configure.filters +++ b/AUTOTEST/configure.filters @@ -1,2 +1,7 @@ fatal: No names found, cannot describe anything. WARNING: unknown Fortran name-mangling scheme +configure: WARNING: *************************************************************** +configure: WARNING: Umpire is explicitly disabled while building hypre for GPUs. +configure: WARNING: This is not recommended for performance reasons! +configure: WARNING: Enable it with --with-umpire. +configure: WARNING: *************************************************************** diff --git a/AUTOTEST/machine-lassen.sh b/AUTOTEST/machine-lassen.sh index 50476cd1da..b8cca0abf0 100755 --- a/AUTOTEST/machine-lassen.sh +++ b/AUTOTEST/machine-lassen.sh @@ -55,56 +55,56 @@ module -q load cuda module -q load xl # CUDA with UM in debug mode [ij, ams, struct, sstruct] -co="--with-cuda --enable-unified-memory --enable-persistent --enable-debug --with-gpu-arch=70 --with-memory-tracker --with-extra-CFLAGS=\\'-qsuppress=1500-029\\' --with-extra-CXXFLAGS=\\'-qsuppress=1500-029\\'" +co="--with-cuda --with-cxxstandard=11 --without-umpire --enable-unified-memory --enable-persistent --enable-debug --with-gpu-arch=70 --with-memory-tracker --with-extra-CFLAGS=\\'-qsuppress=1500-029\\' --with-extra-CXXFLAGS=\\'-qsuppress=1500-029\\'" ro="-ij-gpu -ams -struct -sstruct -rt -mpibind -save ${save} -rtol ${rtol} -atol ${atol}" eo="-gpu -rt -mpibind -save ${save} -rtol ${rtol} -atol ${atol}" ./test.sh basic.sh $src_dir -co: $co -mo: $mo -ro: $ro -eo: $eo ./renametest.sh basic $output_dir/basic-cuda-um -# CUDA with UM in debug mode [ij, ams, struct, sstruct] -co="--with-cuda --enable-unified-memory --enable-persistent --enable-debug --with-print-errors --with-gpu-arch=70 --with-memory-tracker --with-extra-CFLAGS=\\'-qsuppress=1500-029\\' --with-extra-CXXFLAGS=\\'-qsuppress=1500-029\\'" +# CUDA with UM in debug mode with print errors [error] +co="--with-cuda --with-cxxstandard=11 --without-umpire --enable-unified-memory --enable-persistent --enable-debug --with-print-errors --with-gpu-arch=70 --with-memory-tracker --with-extra-CFLAGS=\\'-qsuppress=1500-029\\' --with-extra-CXXFLAGS=\\'-qsuppress=1500-029\\'" ro="-error -rt -mpibind -save ${save} -rtol ${rtol} -atol ${atol}" ./test.sh basic.sh $src_dir -co: $co -mo: $mo -ro: $ro ./renametest.sh basic $output_dir/basic-cuda-um-with-errors # CUDA with UM and mixed-int -co="--with-cuda --enable-unified-memory --enable-mixedint --enable-debug --with-gpu-arch=70 --with-extra-CFLAGS=\\'-qsuppress=1500-029\\' --with-extra-CXXFLAGS=\\'-qsuppress=1500-029\\'" +co="--with-cuda --with-cxxstandard=11 --without-umpire --enable-unified-memory --enable-mixedint --enable-debug --with-gpu-arch=70 --with-extra-CFLAGS=\\'-qsuppress=1500-029\\' --with-extra-CXXFLAGS=\\'-qsuppress=1500-029\\'" ro="-ij-mixed -ams -struct -sstruct-mixed -rt -mpibind -save ${save} -rtol ${rtol} -atol ${atol}" ./test.sh basic.sh $src_dir -co: $co -mo: $mo -ro: $ro ./renametest.sh basic $output_dir/basic-cuda-um-mixedint # CUDA with UM with shared library -co="--with-cuda --enable-unified-memory --with-openmp --enable-hopscotch --enable-shared --with-gpu-arch=70 --with-extra-CFLAGS=\\'-qsuppress=1500-029\\' --with-extra-CXXFLAGS=\\'-qsuppress=1500-029\\'" +co="--with-cuda --with-cxxstandard=11 --without-umpire --enable-unified-memory --with-openmp --enable-hopscotch --enable-shared --with-gpu-arch=70 --with-extra-CFLAGS=\\'-qsuppress=1500-029\\' --with-extra-CXXFLAGS=\\'-qsuppress=1500-029\\'" ro="-gpumemcheck -rt -mpibind -cudamemcheck -save ${save}" ./test.sh basic.sh $src_dir -co: $co -mo: $mo -ro: $ro ./renametest.sh basic $output_dir/basic-cuda-um-shared # CUDA with UM and single precision -co="--with-cuda --enable-unified-memory --enable-single --enable-cusolver --enable-debug --with-gpu-arch=70 --with-extra-CFLAGS=\\'-qsuppress=1500-029\\' --with-extra-CXXFLAGS=\\'-qsuppress=1500-029\\'" +co="--with-cuda --with-cxxstandard=11 --without-umpire --enable-unified-memory --enable-single --enable-cusolver --enable-debug --with-gpu-arch=70 --with-extra-CFLAGS=\\'-qsuppress=1500-029\\' --with-extra-CXXFLAGS=\\'-qsuppress=1500-029\\'" ro="-single -rt -mpibind -save ${save}" ./test.sh basic.sh $src_dir -co: $co -mo: $mo -ro: ${ro} ./renametest.sh basic $output_dir/basic-cuda-um-single # CUDA with UM without MPI [no run] -#co="--with-cuda --enable-unified-memory --without-MPI --with-gpu-arch=70 --with-extra-CXXFLAGS=\\'-qsuppress=1500-029\\'" +#co="--with-cuda --with-cxxstandard=11 --without-umpire --enable-unified-memory --without-MPI --with-gpu-arch=70 --with-extra-CXXFLAGS=\\'-qsuppress=1500-029\\'" #./test.sh basic.sh $src_dir -co: $co -mo: $mo #./renametest.sh basic $output_dir/basic-cuda-um-without-MPI # CUDA without UM with device memory pool [struct] -co="--with-cuda --enable-device-memory-pool --with-gpu-arch=70 --with-extra-CFLAGS=\\'-qsuppress=1500-029\\' --with-extra-CXXFLAGS=\\'-qsuppress=1500-029\\'" +co="--with-cuda --with-cxxstandard=11 --without-umpire --enable-device-memory-pool --with-gpu-arch=70 --with-extra-CFLAGS=\\'-qsuppress=1500-029\\' --with-extra-CXXFLAGS=\\'-qsuppress=1500-029\\'" ro="-struct -rt -mpibind -save ${save}" ./test.sh basic.sh $src_dir -co: $co -mo: $mo -ro: $ro ./renametest.sh basic $output_dir/basic-cuda-nonum # CUDA without UM with umpire [benchmark] UMPIRE_DIR=/usr/workspace/hypre/ext-libs/Umpire/install_umpire-2025.03.0_nvcc11.2-sm_70-xl2023.06.28-cuda-11.2.0-gcc-8.3.1 -co="--with-cuda --with-gpu-arch=70 --with-umpire --with-umpire-include=${UMPIRE_DIR}/include --with-umpire-lib-dirs=${UMPIRE_DIR}/lib --with-umpire-libs=\\'camp umpire\\' --with-extra-CFLAGS=\\'-qsuppress=1500-029\\' --with-extra-CXXFLAGS=\\'-qsuppress=1500-029\\'" +co="--with-cuda --with-cxxstandard=11 --with-gpu-arch=70 --with-umpire --with-umpire-include=${UMPIRE_DIR}/include --with-umpire-lib-dirs=${UMPIRE_DIR}/lib --with-umpire-libs=\\'camp umpire\\' --with-extra-CFLAGS=\\'-qsuppress=1500-029\\' --with-extra-CXXFLAGS=\\'-qsuppress=1500-029\\'" ro="-bench -rt -mpibind -save ${save}" ./test.sh basic.sh $src_dir -co: $co -mo: $mo -ro: $ro ./renametest.sh basic $output_dir/basic-cuda-bench # run on CPU -co="--with-cuda --with-test-using-host --with-memory-tracker --enable-debug --with-gpu-arch=70" +co="--with-cuda --with-cxxstandard=11 --without-umpire --with-test-using-host --with-memory-tracker --enable-debug --with-gpu-arch=70" ro="-ij-noilu -ams -struct -sstruct -rt -mpibind -save lassen_cpu" ./test.sh basic.sh $src_dir -co: $co -mo: $mo -ro: $ro ./renametest.sh basic $output_dir/basic-cuda-cpu @@ -133,17 +133,17 @@ module list cmake/3.22 |& grep "None found" mo="-j" # CUDA with UM + CMake -co="-DCMAKE_C_COMPILER=$(which xlc) -DCMAKE_CXX_COMPILER=$(which xlc++) -DCMAKE_CUDA_COMPILER=$(which nvcc) -DMPI_C_COMPILER=$(which mpicc) -DMPI_CXX_COMPILER=$(which mpicxx) -DHYPRE_ENABLE_CUDA=ON -DHYPRE_ENABLE_UNIFIED_MEMORY=ON -DCMAKE_BUILD_TYPE=Debug -DHYPRE_ENABLE_PERSISTENT_COMM=ON -DHYPRE_ENABLE_DEVICE_POOL=ON -DHYPRE_WITH_EXTRA_CFLAGS="\'"-qsuppress=1500-029"\'" -DHYPRE_WITH_EXTRA_CXXFLAGS="\'"-qsuppress=1500-029"\'" -DCMAKE_CUDA_ARCHITECTURES=70" +co="-DCMAKE_C_COMPILER=$(which xlc) -DCMAKE_CXX_COMPILER=$(which xlc++) -DCMAKE_CUDA_COMPILER=$(which nvcc) -DMPI_C_COMPILER=$(which mpicc) -DMPI_CXX_COMPILER=$(which mpicxx) -DCMAKE_CXX_STANDARD=11 -DHYPRE_ENABLE_CUDA=ON -DHYPRE_ENABLE_UMPIRE=OFF -DHYPRE_ENABLE_UNIFIED_MEMORY=ON -DCMAKE_BUILD_TYPE=Debug -DHYPRE_ENABLE_PERSISTENT_COMM=ON -DHYPRE_ENABLE_DEVICE_POOL=ON -DHYPRE_WITH_EXTRA_CFLAGS="\'"-qsuppress=1500-029"\'" -DHYPRE_WITH_EXTRA_CXXFLAGS="\'"-qsuppress=1500-029"\'" -DCMAKE_CUDA_ARCHITECTURES=70" ./test.sh cmake.sh $root_dir -co: $co -mo: $mo ./renametest.sh cmake $output_dir/cmake-cuda-um-ij # CUDA with UM [shared library] + CMake -co="-DCMAKE_C_COMPILER=$(which xlc) -DCMAKE_CXX_COMPILER=$(which xlc++) -DCMAKE_CUDA_COMPILER=$(which nvcc) -DMPI_C_COMPILER=$(which mpicc) -DMPI_CXX_COMPILER=$(which mpicxx) -DHYPRE_ENABLE_CUDA=ON -DHYPRE_ENABLE_UNIFIED_MEMORY=ON -DCMAKE_BUILD_TYPE=Debug -DHYPRE_ENABLE_OPENMP=ON -DHYPRE_ENABLE_HOPSCOTCH=ON -DBUILD_SHARED_LIBS=ON -DHYPRE_WITH_EXTRA_CFLAGS="\'"-qsuppress=1500-029"\'" -DHYPRE_WITH_EXTRA_CXXFLAGS="\'"-qsuppress=1500-029 "\'" -DCMAKE_CUDA_ARCHITECTURES=70" +co="-DCMAKE_C_COMPILER=$(which xlc) -DCMAKE_CXX_COMPILER=$(which xlc++) -DCMAKE_CUDA_COMPILER=$(which nvcc) -DMPI_C_COMPILER=$(which mpicc) -DMPI_CXX_COMPILER=$(which mpicxx) -DCMAKE_CXX_STANDARD=11 -DHYPRE_ENABLE_CUDA=ON -DHYPRE_ENABLE_UMPIRE=OFF -DHYPRE_ENABLE_UNIFIED_MEMORY=ON -DCMAKE_BUILD_TYPE=Debug -DHYPRE_ENABLE_OPENMP=ON -DHYPRE_ENABLE_HOPSCOTCH=ON -DBUILD_SHARED_LIBS=ON -DHYPRE_WITH_EXTRA_CFLAGS="\'"-qsuppress=1500-029"\'" -DHYPRE_WITH_EXTRA_CXXFLAGS="\'"-qsuppress=1500-029 "\'" -DCMAKE_CUDA_ARCHITECTURES=70" ./test.sh cmake.sh $root_dir -co: $co -mo: $mo ./renametest.sh cmake $output_dir/cmake-cuda-um-shared # CUDA w.o UM + CMake -co="-DCMAKE_C_COMPILER=$(which xlc) -DCMAKE_CXX_COMPILER=$(which xlc++) -DCMAKE_CUDA_COMPILER=$(which nvcc) -DMPI_C_COMPILER=$(which mpicc) -DMPI_CXX_COMPILER=$(which mpicxx) -DHYPRE_ENABLE_CUDA=ON -DCMAKE_BUILD_TYPE=Debug -DHYPRE_WITH_EXTRA_CFLAGS="\'"-qsuppress=1500-029"\'" -DHYPRE_WITH_EXTRA_CXXFLAGS="\'"-qsuppress=1500-029"\'" -DCMAKE_CUDA_ARCHITECTURES=70" +co="-DCMAKE_C_COMPILER=$(which xlc) -DCMAKE_CXX_COMPILER=$(which xlc++) -DCMAKE_CUDA_COMPILER=$(which nvcc) -DMPI_C_COMPILER=$(which mpicc) -DMPI_CXX_COMPILER=$(which mpicxx) -DCMAKE_CXX_STANDARD=11 -DHYPRE_ENABLE_CUDA=ON -DHYPRE_ENABLE_UMPIRE=OFF -DCMAKE_BUILD_TYPE=Debug -DHYPRE_WITH_EXTRA_CFLAGS="\'"-qsuppress=1500-029"\'" -DHYPRE_WITH_EXTRA_CXXFLAGS="\'"-qsuppress=1500-029"\'" -DCMAKE_CUDA_ARCHITECTURES=70" ./test.sh cmake.sh $root_dir -co: $co -mo: $mo ./renametest.sh cmake $output_dir/cmake-cuda-nonum-struct @@ -160,7 +160,7 @@ mo="-j test" module -q load gcc/8.3.1 module -q load cuda/12.0 module list cuda/12.0 |& grep "None found" -co="--with-cuda --enable-unified-memory --enable-thrust-nosync --enable-debug --with-gpu-arch=70 CC=mpicc CXX=mpicxx" +co="--with-cuda --with-cxxstandard=11 --without-umpire --enable-unified-memory --enable-thrust-nosync --enable-debug --with-gpu-arch=70 CC=mpicc CXX=mpicxx" ro="-ij-gpu -ams -struct -sstruct -rt -mpibind -save ${save} -rtol ${rtol} -atol ${atol}" ./test.sh basic.sh $src_dir -co: $co -mo: $mo -ro: $ro ./renametest.sh basic $output_dir/basic-cuda12_0 diff --git a/AUTOTEST/machine-tioga.sh b/AUTOTEST/machine-tioga.sh index 38402a89e7..4d0d178853 100755 --- a/AUTOTEST/machine-tioga.sh +++ b/AUTOTEST/machine-tioga.sh @@ -53,18 +53,18 @@ save="tioga" module -q load rocm/6.2.1 # HIP without UM [benchmark, struct, ams] -co="--with-hip --with-MPI-include=${MPICH_DIR}/include --with-MPI-lib-dirs=${MPICH_DIR}/lib --with-MPI-libs=mpi --with-gpu-arch='gfx90a' CC=cc CXX=CC" +co="--with-hip --without-umpire --with-MPI-include=${MPICH_DIR}/include --with-MPI-lib-dirs=${MPICH_DIR}/lib --with-MPI-libs=mpi --with-gpu-arch='gfx90a' CC=cc CXX=CC" ro="-ams -bench -struct -rt -save ${save}" ./test.sh basic.sh $src_dir -co: $co -mo: $mo -ro: $ro ./renametest.sh basic $output_dir/basic-hip-nonum #HIP with UM and single precision [no run] -co="--with-hip --enable-unified-memory --enable-single --enable-debug --with-MPI-include=${MPICH_DIR}/include --with-MPI-lib-dirs=${MPICH_DIR}/lib --with-MPI-libs=mpi --with-gpu-arch='gfx90a' CC=cc CXX=CC" +co="--with-hip --without-umpire --enable-unified-memory --enable-single --enable-debug --with-MPI-include=${MPICH_DIR}/include --with-MPI-lib-dirs=${MPICH_DIR}/lib --with-MPI-libs=mpi --with-gpu-arch='gfx90a' CC=cc CXX=CC" ./test.sh basic.sh $src_dir -co: $co -mo: $mo ./renametest.sh basic $output_dir/basic-hip-um-single # run on CPU -co="--with-hip --with-test-using-host --with-memory-tracker --enable-debug --with-MPI-include=${MPICH_DIR}/include --with-MPI-lib-dirs=${MPICH_DIR}/lib --with-MPI-libs=mpi --with-gpu-arch='gfx90a' CC=cc CXX=CC" +co="--with-hip --without-umpire --with-test-using-host --with-memory-tracker --enable-debug --with-MPI-include=${MPICH_DIR}/include --with-MPI-lib-dirs=${MPICH_DIR}/lib --with-MPI-libs=mpi --with-gpu-arch='gfx90a' CC=cc CXX=CC" ro="-ij-noilu -ams -struct -sstruct -rt -D HYPRE_NO_SAVED" ./test.sh basic.sh $src_dir -co: $co -mo: $mo -ro: $ro ./renametest.sh basic $output_dir/basic-hip-cpu @@ -79,17 +79,17 @@ module -q load cmake/3.24.2 mo="-j all check" # HIP without UM + CMake (no full run, but with basic "make check") -co="-DCMAKE_C_COMPILER=cc -DCMAKE_CXX_COMPILER=CC -DMPI_C_COMPILER=cc -DMPI_CXX_COMPILER=CC -DHYPRE_ENABLE_HIP=ON -DCMAKE_HIP_ARCHITECTURES=gfx90a -DCMAKE_BUILD_TYPE=Debug -DHYPRE_BUILD_TESTS=ON" +co="-DCMAKE_C_COMPILER=cc -DCMAKE_CXX_COMPILER=CC -DMPI_C_COMPILER=cc -DMPI_CXX_COMPILER=CC -DHYPRE_ENABLE_HIP=ON -DHYPRE_ENABLE_UMPIRE=OFF -DCMAKE_HIP_ARCHITECTURES=gfx90a -DCMAKE_BUILD_TYPE=Debug -DHYPRE_BUILD_TESTS=ON" ./test.sh cmake.sh $root_dir -co: $co -mo: $mo ./renametest.sh cmake $output_dir/cmake-hip-nonum # HIP without UM + Single precision + CMake (no full run, but with basic "make check") -co="-DBUILD_SHARED_LIBS=ON -DCMAKE_C_COMPILER=cc -DCMAKE_CXX_COMPILER=CC -DMPI_C_COMPILER=cc -DMPI_CXX_COMPILER=CC -DHYPRE_ENABLE_HIP=ON -DCMAKE_HIP_ARCHITECTURES=gfx90a -DHYPRE_ENABLE_SINGLE=ON -DCMAKE_BUILD_TYPE=Debug -DHYPRE_BUILD_TESTS=ON" +co="-DBUILD_SHARED_LIBS=ON -DCMAKE_C_COMPILER=cc -DCMAKE_CXX_COMPILER=CC -DMPI_C_COMPILER=cc -DMPI_CXX_COMPILER=CC -DHYPRE_ENABLE_HIP=ON -DHYPRE_ENABLE_UMPIRE=OFF -DCMAKE_HIP_ARCHITECTURES=gfx90a -DHYPRE_ENABLE_SINGLE=ON -DCMAKE_BUILD_TYPE=Debug -DHYPRE_BUILD_TESTS=ON" ./test.sh cmake.sh $root_dir -co: $co -mo: $mo ./renametest.sh cmake $output_dir/cmake-hip-nonum-single # HIP with UM + Shared library + CMake (no full run, but with basic "make check") -co="-DBUILD_SHARED_LIBS=ON -DCMAKE_C_COMPILER=cc -DCMAKE_CXX_COMPILER=CC -DMPI_C_COMPILER=cc -DMPI_CXX_COMPILER=CC -DHYPRE_ENABLE_HIP=ON -DCMAKE_HIP_ARCHITECTURES=gfx90a -DHYPRE_ENABLE_UNIFIED_MEMORY=ON -DCMAKE_BUILD_TYPE=Debug -DHYPRE_BUILD_TESTS=ON" +co="-DBUILD_SHARED_LIBS=ON -DCMAKE_C_COMPILER=cc -DCMAKE_CXX_COMPILER=CC -DMPI_C_COMPILER=cc -DMPI_CXX_COMPILER=CC -DHYPRE_ENABLE_HIP=ON -DHYPRE_ENABLE_UMPIRE=OFF -DCMAKE_HIP_ARCHITECTURES=gfx90a -DHYPRE_ENABLE_UNIFIED_MEMORY=ON -DCMAKE_BUILD_TYPE=Debug -DHYPRE_BUILD_TESTS=ON" ./test.sh cmake.sh $root_dir -co: $co -mo: $mo ./renametest.sh cmake $output_dir/cmake-hip-um-shared diff --git a/AUTOTEST/machine-tux-valgrind.sh b/AUTOTEST/machine-tux-valgrind.sh new file mode 100755 index 0000000000..46b2333e6a --- /dev/null +++ b/AUTOTEST/machine-tux-valgrind.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) + +testname=`basename $0 .sh` + +# Echo usage information +case $1 in + -h|-help) + cat <&2 +done diff --git a/AUTOTEST/machine-tux.sh b/AUTOTEST/machine-tux.sh index ed08800e69..6ae95d628a 100755 --- a/AUTOTEST/machine-tux.sh +++ b/AUTOTEST/machine-tux.sh @@ -40,7 +40,6 @@ shift # Organizing the tests from "fast" to "slow" # Check license header info -#( cd $src_dir; make distclean ) ./test.sh check-license.sh $src_dir/.. mv -f check-license.??? $output_dir @@ -62,7 +61,7 @@ mv -f check-case.??? $output_dir # Basic build and run tests mo="-j test" -ro="-ams -ij -sstruct -struct -lobpcg" +ro="-ams -ij -sstruct -sstructmat -struct -structmat -lobpcg" eo="" co="" @@ -114,7 +113,7 @@ mv basic.tmp basic.err ./renametest.sh basic $output_dir/basic--enable-complex co="--with-openmp" -RO="-ams -ij -sstruct -struct -lobpcg -rt -D HYPRE_NO_SAVED -nthreads 2" +RO="-ams -ij -sstruct -sstructmat -struct -structmat -lobpcg -rt -D HYPRE_NO_SAVED -nthreads 2" ./test.sh basic.sh $src_dir -co: $co -mo: $mo -ro: $RO ./renametest.sh basic $output_dir/basic--with-openmp @@ -139,18 +138,23 @@ co="--enable-bigint --enable-debug" ./test.sh basic.sh $src_dir -co: $co -mo: $mo -ro: $ro -eo: -bigint ./renametest.sh basic $output_dir/basic--enable-bigint +co="--enable-debug --enable-mixed-precision" +./test.sh basic.sh $src_dir -co: $co -mo: $mo -ro: $ro +./renametest.sh basic $output_dir/basic--mixed-precision + co="--enable-mixedint --enable-debug" RO="-ams -ij-mixed -sstruct-mixed -struct -lobpcg-mixed" ./test.sh basic.sh $src_dir -co: $co -mo: $mo -ro: $RO ./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 -error -rt -valgrind -./renametest.sh basic $output_dir/basic--valgrind +# RDF: This is currently in 'machine-tux-valgrind.sh'. +# co="--enable-debug --with-print-errors" +# ./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 mo="-j" -ro="-ams -ij -sstruct -struct -lobpcg" +ro="-ams -ij -sstruct -sstructmat -struct -structmat -lobpcg" eo="" co="" @@ -181,6 +185,10 @@ co="-DHYPRE_BIGINT=ON" ./test.sh cmake.sh $root_dir -co: $co -mo: $mo -ro: $ro ./renametest.sh cmake $output_dir/cmake-bigint +co="-DCMAKE_BUILD_TYPE=Debug -DHYPRE_ENABLE_MIXED_PRECISION=ON" +./test.sh cmake.sh $root_dir -co: $co -mo: $mo +./renametest.sh cmake $output_dir/cmake-mixed-precision + # cmake build doesn't currently support maxdim # cmake build doesn't currently support complex diff --git a/AUTOTEST/run.sh b/AUTOTEST/run.sh index f7c54456d1..5bec9d6d7d 100755 --- a/AUTOTEST/run.sh +++ b/AUTOTEST/run.sh @@ -15,7 +15,7 @@ case $1 in $0 [-h] {src_dir} [options] [-rt ] where: {src_dir} is the hypre source directory - - run (test = ams, fac, ij, sstruct, struct) + - run (test = ams, ij, sstruct, struct) -all run all tests (default behavior) -h|-help prints this usage information and exits @@ -51,7 +51,7 @@ done # If no tests were specified, run all tests if [ "$tests" = "" ]; then - tests="-ams -fac -ij -sstruct -struct" + tests="-ams -ij -sstruct -struct" fi # Setup diff --git a/AUTOTEST/runtests-fac b/AUTOTEST/runtests-fac deleted file mode 100644 index 1aa9c9e889..0000000000 --- a/AUTOTEST/runtests-fac +++ /dev/null @@ -1,2 +0,0 @@ -TEST_fac/*.sh - diff --git a/AUTOTEST/runtests-ij-gpu b/AUTOTEST/runtests-ij-gpu index 6326bb249a..286b158f7f 100644 --- a/AUTOTEST/runtests-ij-gpu +++ b/AUTOTEST/runtests-ij-gpu @@ -1 +1,2 @@ -TEST_ij/[^f]*.sh +TEST_ij/[^m]*.sh +TEST_ij/matrix.sh diff --git a/AUTOTEST/runtests-sstruct-recmat b/AUTOTEST/runtests-sstruct-recmat new file mode 100644 index 0000000000..de6fd837a9 --- /dev/null +++ b/AUTOTEST/runtests-sstruct-recmat @@ -0,0 +1,22 @@ +TEST_sstruct/addtovalues.sh +TEST_sstruct/amr2d.sh +TEST_sstruct/amr3d.sh +TEST_sstruct/cube.sh +TEST_sstruct/cycred.sh +TEST_sstruct/default2d.sh +TEST_sstruct/default3d.sh +TEST_sstruct/emptyProc.sh +TEST_sstruct/io.sh +TEST_sstruct/maxwell.sh +TEST_sstruct/miller.sh +TEST_sstruct/neighborpart.sh +TEST_sstruct/neumann.sh +TEST_sstruct/nonmixedint.sh +TEST_sstruct/periodic.sh +TEST_sstruct/sharedpart.sh +TEST_sstruct/solvers.sh +TEST_sstruct/sstruct_struct.sh +TEST_sstruct/symm.sh +TEST_sstruct/versioncheck.sh +TEST_sstruct/wide.sh +TEST_sstruct/zcube.sh diff --git a/AUTOTEST/runtests-sstructmat b/AUTOTEST/runtests-sstructmat new file mode 100644 index 0000000000..583cf3e01c --- /dev/null +++ b/AUTOTEST/runtests-sstructmat @@ -0,0 +1,2 @@ +TEST_sstructmat/*.sh + diff --git a/AUTOTEST/runtests-structmat b/AUTOTEST/runtests-structmat new file mode 100644 index 0000000000..04e710b357 --- /dev/null +++ b/AUTOTEST/runtests-structmat @@ -0,0 +1 @@ +TEST_structmat/*.sh diff --git a/CHANGELOG b/CHANGELOG index a6e149b783..a0f5867bc4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -7,6 +7,28 @@ # This file chronicles user-level changes, beginning with the most recent. # ============================================================================= +Version 3.0.0 released 2025/09/26 + +- Major rewrite of the semi-structured code (Struct and SStruct) + * Extended matrices to be rectangular (not just square as before) + * Added support for rectangular Matvec and Matmat + * Generalized support for matrices with constant coefficients + * Added a new semi-structured algebraic multigrid solver (SSAMG) that takes + advantage of structure and builds on the PFMG and BoomerAMG solvers +- Added new mixed precision functionality + * Provides support to switch between precisions at runtime + * Provides mixed-precision preconditioned Krylov solvers (lower-order + preconditioning of higher-order Krylov method) +- API changes: + * HYPRE_StructVectorSetValues, HYPRE_StructVectorAddToValues + * Removed SStruct solvers FAC and Maxwell + * Removed Struct solver MSG +- Added support for tagged residual norms (allows norms on subsets of values) +- Added support for block scaling of IJ matrices and vectors +- Various bug fixes + +#==================================== + Version 2.33.0 released 2025/04/03 - Added verbosity control to error printing diff --git a/INSTALL.md b/INSTALL.md index bb13edb6a2..49cc2ad898 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -52,7 +52,7 @@ configuration options on different platforms. It does not actually build the code, but generates input for other "native" build systems such as Make (Unix platforms) or Visual Studio (Windows). Here are the basic steps: -1. First, ensure that CMake version 3.13.0 or later is installed on the system. +1. First, ensure that CMake version 3.21.0 or later is installed on the system. 2. To build the library, run CMake on the top-level HYPRE source directory to generate files appropriate for the native build system. To prevent writing @@ -83,11 +83,31 @@ appropriate, then reconfigure/generate: - Windows VS: Change options, then click on 'Configure' then 'Generate'. +Complete Build Instructions +=========================== -ABI Compatibility -================= +For the latest, complete instructions (Autotools, CMake, GPU/Spack options, build +targets, etc.), please refer to the User Manual on Read the Docs: -The hypre team currently does nothing to ensure application binary interface -(ABI) compatibility. As a result, all releases (major, minor, or patch) should -be treated as incompatible. +- [Documentation home](https://hypre.readthedocs.io/en/latest) +- [General Information -- Building the library (Autotools and CMake)](https://hypre.readthedocs.io/en/latest/ch-misc.html#building-the-library) +- [Build System Options](https://hypre.readthedocs.io/en/latest/ch-misc.html#build-system-options) +- [GPU Build Options](https://hypre.readthedocs.io/en/latest/ch-misc.html#gpu-build-options) +ABI Compatibility Policy +======================== + +HYPRE versions follow the X.Y.Z scheme. + +- Patch releases (Z) are intended to be ABI-compatible within the same major and minor version (X.Y). +- Major (X) and minor (Y) releases may introduce ABI changes and should not be assumed compatible. + +Examples: +- Likely compatible: 2.22.0 ↔ 2.22.1 (same X.Y, patch-level updates). +- Not necessarily compatible: + - 2.31.z ↔ 2.32.z (minor version differs) + - 2.y.z ↔ 3.y.z (major version differs) + +Recommendations: +- If distributing binaries or building plugins, pin to an exact X.Y and allow any Z. +- When upgrading across X or Y, plan to rebuild and revalidate dependent binaries. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 765c490e9e..1f629b7e86 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -19,9 +19,9 @@ if(POLICY CMP0104) endif() # The version number. -set(HYPRE_VERSION 2.33.0) -set(HYPRE_NUMBER 23300) -set(HYPRE_DATE 2025/04/03) +set(HYPRE_VERSION 3.0.0) +set(HYPRE_NUMBER 30000) +set(HYPRE_DATE 2025/09/26) set(HYPRE_TIME 00:00:00) set(HYPRE_BUGS https://github.com/hypre-space/hypre/issues) set(HYPRE_SRCDIR "${PROJECT_SOURCE_DIR}") @@ -138,6 +138,7 @@ set_hypre_option(BASE HYPRE_ENABLE_MIXEDINT "Use long long int for H set_hypre_option(BASE HYPRE_ENABLE_SINGLE "Use float for HYPRE_Real" OFF) set_hypre_option(BASE HYPRE_ENABLE_LONG_DOUBLE "Use long double for HYPRE_Real" OFF) set_hypre_option(BASE HYPRE_ENABLE_COMPLEX "Use complex values" OFF) +set_hypre_option(BASE HYPRE_ENABLE_MIXED_PRECISION "Enable mixed precision support" OFF) set_hypre_option(BASE HYPRE_ENABLE_HYPRE_BLAS "Use internal BLAS library" ON) set_hypre_option(BASE HYPRE_ENABLE_HYPRE_LAPACK "Use internal LAPACK library" ON) set_hypre_option(BASE HYPRE_ENABLE_PERSISTENT_COMM "Use persistent communication" OFF) @@ -162,7 +163,7 @@ set_hypre_option(GPU HYPRE_ENABLE_SYCL "Use SYCL" OFF) set_hypre_option(GPU HYPRE_ENABLE_GPU_AWARE_MPI "Use device aware MPI support" OFF) set_hypre_option(GPU HYPRE_ENABLE_UNIFIED_MEMORY "Use unified memory for allocating the memory" OFF) set_hypre_option(GPU HYPRE_ENABLE_DEVICE_MALLOC_ASYNC "Use device async malloc" OFF) -set_hypre_option(GPU HYPRE_ENABLE_THRUST_ASYNC "Use Thrust par_nosync policy" OFF) +set_hypre_option(GPU HYPRE_ENABLE_THRUST_NOSYNC "Use Thrust par_nosync policy" OFF) set_hypre_option(GPU HYPRE_ENABLE_GPU_PROFILING "Use NVTX on CUDA or rocTX on HIP" OFF) # CUDA options set_hypre_option(CUDA HYPRE_ENABLE_CUDA_STREAMS "Use CUDA streams" ON) @@ -229,6 +230,7 @@ set_internal_hypre_option("" MIXEDINT) set_internal_hypre_option("" SINGLE) set_internal_hypre_option("" LONG_DOUBLE) set_internal_hypre_option("" COMPLEX) +set_internal_hypre_option("" MIXED_PRECISION) set_internal_hypre_option("" TEST_USING_HOST) set_internal_hypre_option("" PRINT_ERRORS) set_internal_hypre_option(USING HYPRE_BLAS) @@ -236,7 +238,8 @@ set_internal_hypre_option(USING HYPRE_LAPACK) set_internal_hypre_option(USING MEMORY_TRACKER) set_internal_hypre_option(USING HOPSCOTCH) set_internal_hypre_option(USING GPU_AWARE_MPI) -set_internal_hypre_option(USING GPU_STREAMS) +set_internal_hypre_option(USING CUDA_STREAMS) +set_internal_hypre_option(USING THRUST_NOSYNC) set_internal_hypre_option(USING DEVICE_POOL) set_internal_hypre_option(USING OPENMP) set_internal_hypre_option(USING CUDA) @@ -283,8 +286,8 @@ if (HYPRE_ENABLE_STRICT_CHECKING) set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "" FORCE) if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") target_compile_options(${PROJECT_NAME} PRIVATE - $<$:-O0 -Wall -Wextra -pedantic -Wfloat-conversion -fsingle-precision-constant -Werror> - $<$:-Wall -Wshadow -fno-implicit-templates -Woverloaded-virtual -ansi -pedantic>) + $<$:-O0 -Wall -Wextra -pedantic -Wfloat-conversion -fsingle-precision-constant -Werror -Werror=vla> + $<$:-Wall -Wextra -Wshadow -fno-implicit-templates -Woverloaded-virtual -ansi -pedantic -Werror=vla>) elseif(CMAKE_C_COMPILER_ID MATCHES "Intel") target_compile_options(${PROJECT_NAME} PRIVATE @@ -407,10 +410,11 @@ if (NOT HYPRE_WITH_EXTRA_CFLAGS STREQUAL "") $<$:${HYPRE_WITH_EXTRA_CFLAGS_LIST}>) endif () -# Set output directory for the library +# Set versions and output directories for the library +math(EXPR HYPRE_SOVERSION "${HYPRE_VERSION_MAJOR} * 100 + ${HYPRE_VERSION_MINOR}") set_target_properties(${PROJECT_NAME} PROPERTIES VERSION "${HYPRE_VERSION}" - SOVERSION "${HYPRE_VERSION_MAJOR}${HYPRE_VERSION_MINOR}" + SOVERSION "${HYPRE_SOVERSION}" ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" @@ -430,13 +434,13 @@ set(HYPRE_NEEDS_CXX OFF CACHE INTERNAL "Flag to indicate if C++ is needed for TP # Setup third-party libraries (TPLs) setup_fei() -setup_tpl_or_internal(blas) -setup_tpl_or_internal(lapack) +setup_tpl(umpire) setup_tpl(superlu) setup_tpl(dsuperlu) setup_tpl(magma) setup_tpl(caliper) -setup_tpl(umpire) +setup_tpl_or_internal(blas) +setup_tpl_or_internal(lapack) # Some TPLs need C++ to be enabled (GPU already enables C++ by default) if(HYPRE_NEEDS_CXX AND NOT HYPRE_USING_GPU) diff --git a/src/FEI_mv/femli/driver_matrix.cxx b/src/FEI_mv/femli/driver_matrix.cxx index 043f059aba..55f682257d 100644 --- a/src/FEI_mv/femli/driver_matrix.cxx +++ b/src/FEI_mv/femli/driver_matrix.cxx @@ -15,7 +15,7 @@ #include "mli_matrix.h" #include "mli_matrix_misc.h" #include "IJ_mv.h" -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #include "parcsr_mv.h" #include "parcsr_ls.h" #include diff --git a/src/FEI_mv/femli/mli_amgsa_calib.cxx b/src/FEI_mv/femli/mli_amgsa_calib.cxx index b1831347a9..82b00febf3 100644 --- a/src/FEI_mv/femli/mli_amgsa_calib.cxx +++ b/src/FEI_mv/femli/mli_amgsa_calib.cxx @@ -25,7 +25,7 @@ #include "HYPRE.h" #include "_hypre_utilities.h" #include "HYPRE_IJ_mv.h" -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #include "_hypre_parcsr_mv.h" #include "mli_method_amgsa.h" diff --git a/src/FEI_mv/femli/mli_amgsa_coarsen1.cxx b/src/FEI_mv/femli/mli_amgsa_coarsen1.cxx index 8d14e4308f..a4c3dd3e0a 100644 --- a/src/FEI_mv/femli/mli_amgsa_coarsen1.cxx +++ b/src/FEI_mv/femli/mli_amgsa_coarsen1.cxx @@ -18,7 +18,7 @@ #include "HYPRE.h" #include "_hypre_utilities.h" #include "HYPRE_IJ_mv.h" -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #include "_hypre_parcsr_mv.h" #include "mli_vector.h" diff --git a/src/FEI_mv/femli/mli_amgsa_dd_fedata.cxx b/src/FEI_mv/femli/mli_amgsa_dd_fedata.cxx index 7739af9517..02f246c75e 100644 --- a/src/FEI_mv/femli/mli_amgsa_dd_fedata.cxx +++ b/src/FEI_mv/femli/mli_amgsa_dd_fedata.cxx @@ -22,7 +22,7 @@ #include "HYPRE.h" #include "_hypre_utilities.h" #include "HYPRE_IJ_mv.h" -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #include "_hypre_parcsr_mv.h" // ********************************************************************* diff --git a/src/FEI_mv/femli/mli_amgsa_dd_sfei.cxx b/src/FEI_mv/femli/mli_amgsa_dd_sfei.cxx index bbe9aec37e..2a399efd89 100644 --- a/src/FEI_mv/femli/mli_amgsa_dd_sfei.cxx +++ b/src/FEI_mv/femli/mli_amgsa_dd_sfei.cxx @@ -24,7 +24,7 @@ #include "HYPRE.h" #include "_hypre_utilities.h" #include "HYPRE_IJ_mv.h" -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #include "_hypre_parcsr_mv.h" #define mabs(x) ((x) > 0 ? x : -(x)) diff --git a/src/FEI_mv/femli/mli_amgsa_elem.cxx b/src/FEI_mv/femli/mli_amgsa_elem.cxx index 9e1445e373..e8b9d34089 100644 --- a/src/FEI_mv/femli/mli_amgsa_elem.cxx +++ b/src/FEI_mv/femli/mli_amgsa_elem.cxx @@ -18,7 +18,7 @@ #include "HYPRE.h" #include "_hypre_utilities.h" #include "HYPRE_IJ_mv.h" -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #include "_hypre_parcsr_mv.h" #include "mli_method_amgsa.h" diff --git a/src/FEI_mv/femli/mli_method_amgsa.cxx b/src/FEI_mv/femli/mli_method_amgsa.cxx index 9ad3b87fd2..d66d760fb3 100644 --- a/src/FEI_mv/femli/mli_method_amgsa.cxx +++ b/src/FEI_mv/femli/mli_method_amgsa.cxx @@ -1687,10 +1687,10 @@ int MLI_Method_AMGSA::copy( MLI_Method *new_obj ) extern "C" { #endif -#include "lobpcg.h" +#include "_hypre_lobpcg.h" #include "IJ_mv.h" #include "_hypre_parcsr_mv.h" -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #include "_hypre_parcsr_ls.h" HYPRE_Solver lobHYPRESolver; HYPRE_ParCSRMatrix lobHYPREA; diff --git a/src/FEI_mv/femli/mli_solver.cxx b/src/FEI_mv/femli/mli_solver.cxx index 57d65dcad6..3c4f2ae511 100644 --- a/src/FEI_mv/femli/mli_solver.cxx +++ b/src/FEI_mv/femli/mli_solver.cxx @@ -19,7 +19,7 @@ #include #include "_hypre_parcsr_mv.h" -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #include "mli_solver.h" #include "mli_solver_jacobi.h" #include "mli_solver_bjacobi.h" diff --git a/src/FEI_mv/femli/mli_utils.c b/src/FEI_mv/femli/mli_utils.c index 1956d4f82a..abc1bb657c 100644 --- a/src/FEI_mv/femli/mli_utils.c +++ b/src/FEI_mv/femli/mli_utils.c @@ -569,7 +569,7 @@ int MLI_Utils_ComputeExtremeRitzValues(hypre_ParCSRMatrix *A, double *ritz, } hypre_TFree(alphaArray, HYPRE_MEMORY_HOST); hypre_TFree(rnormArray, HYPRE_MEMORY_HOST); - for (i = 0; i <= maxIter; i++) + for (i = 0; i <= maxIter; i++) hypre_TFree(Tmat[i], HYPRE_MEMORY_HOST); hypre_TFree(Tmat, HYPRE_MEMORY_HOST); hypre_TFree(srdiag, HYPRE_MEMORY_HOST); @@ -1134,7 +1134,7 @@ int MLI_Utils_QR(double *qArray, double *rArray, int nrows, int ncols) * workLen = suggest 5*(m+n) *--------------------------------------------------------------------------*/ -#include "fortran.h" +#include "_hypre_fortran.h" int MLI_Utils_SVD(double *uArray, double *sArray, double *vtArray, double *workArray, int m, int n, int workLen) @@ -1410,7 +1410,7 @@ int MLI_Utils_ComputeLowEnergyLanczos(hypre_ParCSRMatrix *A, } hypre_TFree(alphaArray, HYPRE_MEMORY_HOST); hypre_TFree(rnormArray, HYPRE_MEMORY_HOST); - for (i = 0; i <= maxIter; i++) + for (i = 0; i <= maxIter; i++) hypre_TFree(Tmat[i], HYPRE_MEMORY_HOST); hypre_TFree(Tmat, HYPRE_MEMORY_HOST); return 0; @@ -2984,4 +2984,3 @@ int MLI_Utils_DenseMatvec( double **Amat, int ndim, double *x, double *Ax ) } return 0; } - diff --git a/src/FEI_mv/femli/mli_utils.h b/src/FEI_mv/femli/mli_utils.h index 16b2db3882..2812ed6cc6 100644 --- a/src/FEI_mv/femli/mli_utils.h +++ b/src/FEI_mv/femli/mli_utils.h @@ -17,7 +17,7 @@ #include #include "_hypre_utilities.h" #include "_hypre_parcsr_mv.h" -#include "krylov.h" +#include "_hypre_krylov.h" #include "_hypre_parcsr_ls.h" typedef struct MLI_Function_Struct MLI_Function; #include "cmli.h" diff --git a/src/IJ_mv/CMakeLists.txt b/src/IJ_mv/CMakeLists.txt index 7449654aec..0f35e4fd77 100644 --- a/src/IJ_mv/CMakeLists.txt +++ b/src/IJ_mv/CMakeLists.txt @@ -4,15 +4,22 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) set(HDRS - aux_parcsr_matrix.h - aux_par_vector.h HYPRE_IJ_mv.h _hypre_IJ_mv.h - IJ_matrix.h - IJ_vector.h ) -set(SRCS +# Add MUP headers when mixed precision is enabled +if(HYPRE_ENABLE_MIXED_PRECISION) + list(APPEND HDRS + HYPRE_IJ_mv_mup.h + _hypre_IJ_mv_mup.h + _hypre_IJ_mv_mup_def.h + _hypre_IJ_mv_mup_undef.h + ) +endif() + +# Regular sources +set(REGULAR_SRCS aux_parcsr_matrix.c aux_par_vector.c F90_HYPRE_IJMatrix.c @@ -29,11 +36,20 @@ set(SRCS IJVector_parcsr_device.c ) -target_sources(${PROJECT_NAME} - PRIVATE ${SRCS} - ${HDRS} +# Mixed precision sources +set(MUP_SRCS + mup_fixed.c + mup_functions.c + mup_pre.c ) +if(HYPRE_ENABLE_MIXED_PRECISION) + setup_mixed_precision_compilation("IJ_mv" SRCS "${REGULAR_SRCS}") + target_sources(${PROJECT_NAME} PRIVATE ${MUP_SRCS} ${HDRS}) +else() + target_sources(${PROJECT_NAME} PRIVATE ${REGULAR_SRCS} ${HDRS}) +endif() + if (HYPRE_USING_GPU) set(GPU_SRCS IJMatrix_parcsr_device.c diff --git a/src/IJ_mv/F90_HYPRE_IJMatrix.c b/src/IJ_mv/F90_HYPRE_IJMatrix.c index f0c14efb6e..05c39a68ae 100644 --- a/src/IJ_mv/F90_HYPRE_IJMatrix.c +++ b/src/IJ_mv/F90_HYPRE_IJMatrix.c @@ -11,8 +11,8 @@ * *****************************************************************************/ -#include "./_hypre_IJ_mv.h" -#include "fortran.h" +#include "_hypre_IJ_mv.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/IJ_mv/F90_HYPRE_IJVector.c b/src/IJ_mv/F90_HYPRE_IJVector.c index 856b9ca498..78fb2ac6f2 100644 --- a/src/IJ_mv/F90_HYPRE_IJVector.c +++ b/src/IJ_mv/F90_HYPRE_IJVector.c @@ -11,8 +11,8 @@ * *****************************************************************************/ -#include "./_hypre_IJ_mv.h" -#include "fortran.h" +#include "_hypre_IJ_mv.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/IJ_mv/F90_IJMatrix.c b/src/IJ_mv/F90_IJMatrix.c index a5a098a47b..aa5662fe78 100644 --- a/src/IJ_mv/F90_IJMatrix.c +++ b/src/IJ_mv/F90_IJMatrix.c @@ -11,8 +11,8 @@ * *****************************************************************************/ -#include "./_hypre_IJ_mv.h" -#include "fortran.h" +#include "_hypre_IJ_mv.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/IJ_mv/HYPRE_IJMatrix.c b/src/IJ_mv/HYPRE_IJMatrix.c index 98389c005b..d8ad2c7757 100644 --- a/src/IJ_mv/HYPRE_IJMatrix.c +++ b/src/IJ_mv/HYPRE_IJMatrix.c @@ -214,43 +214,32 @@ HYPRE_IJMatrixInitialize( HYPRE_IJMatrix matrix ) { hypre_IJMatrix *ijmatrix = (hypre_IJMatrix *) matrix; - if (!ijmatrix) + if (!ijmatrix || hypre_IJMatrixObjectType(ijmatrix) != HYPRE_PARCSR) { hypre_error_in_arg(1); return hypre_error_flag; } - if ( hypre_IJMatrixObjectType(ijmatrix) == HYPRE_PARCSR ) - { - hypre_IJMatrixInitializeParCSR( ijmatrix ) ; - } - else - { - hypre_error_in_arg(1); - } + hypre_IJMatrixInitializeParCSR( ijmatrix ) ; return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + HYPRE_Int HYPRE_IJMatrixInitialize_v2( HYPRE_IJMatrix matrix, HYPRE_MemoryLocation memory_location ) { hypre_IJMatrix *ijmatrix = (hypre_IJMatrix *) matrix; - if (!ijmatrix) + if (!ijmatrix || hypre_IJMatrixObjectType(ijmatrix) != HYPRE_PARCSR) { hypre_error_in_arg(1); return hypre_error_flag; } - if ( hypre_IJMatrixObjectType(ijmatrix) == HYPRE_PARCSR ) - { - hypre_IJMatrixInitializeParCSR_v2( ijmatrix, memory_location ) ; - } - else - { - hypre_error_in_arg(1); - } + hypre_IJMatrixInitializeParCSR_v2( ijmatrix, memory_location ) ; return hypre_error_flag; } @@ -275,73 +264,6 @@ HYPRE_IJMatrixSetPrintLevel( HYPRE_IJMatrix matrix, return hypre_error_flag; } -/*-------------------------------------------------------------------------- - * This is a helper routine to compute a prefix sum of integer values. - * - * The current implementation is okay for modest numbers of threads. - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_PrefixSumInt(HYPRE_Int nvals, - HYPRE_Int *vals, - HYPRE_Int *sums) -{ - HYPRE_Int j, nthreads, bsize; - - nthreads = hypre_NumThreads(); - bsize = (nvals + nthreads - 1) / nthreads; /* This distributes the remainder */ - - if (nvals < nthreads || bsize == 1) - { - sums[0] = 0; - for (j = 1; j < nvals; j++) - { - sums[j] += sums[j - 1] + vals[j - 1]; - } - } - else - { - - /* Compute preliminary partial sums (in parallel) within each interval */ -#ifdef HYPRE_USING_OPENMP - #pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE -#endif - for (j = 0; j < nvals; j += bsize) - { - HYPRE_Int i, n = hypre_min((j + bsize), nvals); - - sums[j] = 0; - for (i = j + 1; i < n; i++) - { - sums[i] = sums[i - 1] + vals[i - 1]; - } - } - - /* Compute final partial sums (in serial) for the first entry of every interval */ - for (j = bsize; j < nvals; j += bsize) - { - sums[j] = sums[j - bsize] + sums[j - 1] + vals[j - 1]; - } - - /* Compute final partial sums (in parallel) for the remaining entries */ -#ifdef HYPRE_USING_OPENMP - #pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE -#endif - for (j = bsize; j < nvals; j += bsize) - { - HYPRE_Int i, n = hypre_min((j + bsize), nvals); - - for (i = j + 1; i < n; i++) - { - sums[i] += sums[j]; - } - } - } - - return hypre_error_flag; -} - - /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -360,7 +282,7 @@ HYPRE_IJMatrixSetValues( HYPRE_IJMatrix matrix, return hypre_error_flag; } - if (!ijmatrix) + if (!ijmatrix || hypre_IJMatrixObjectType(ijmatrix) != HYPRE_PARCSR) { hypre_error_in_arg(1); return hypre_error_flag; @@ -392,12 +314,6 @@ HYPRE_IJMatrixSetValues( HYPRE_IJMatrix matrix, return hypre_error_flag; } - if ( hypre_IJMatrixObjectType(ijmatrix) != HYPRE_PARCSR ) - { - hypre_error_in_arg(1); - return hypre_error_flag; - } - HYPRE_IJMatrixSetValues2(matrix, nrows, ncols, rows, NULL, cols, values); return hypre_error_flag; @@ -421,7 +337,7 @@ HYPRE_IJMatrixSetValues2( HYPRE_IJMatrix matrix, return hypre_error_flag; } - if (!ijmatrix) + if (!ijmatrix || hypre_IJMatrixObjectType(ijmatrix) != HYPRE_PARCSR) { hypre_error_in_arg(1); return hypre_error_flag; @@ -459,19 +375,13 @@ HYPRE_IJMatrixSetValues2( HYPRE_IJMatrix matrix, return hypre_error_flag; } - if ( hypre_IJMatrixObjectType(ijmatrix) != HYPRE_PARCSR ) - { - hypre_error_in_arg(1); - return hypre_error_flag; - } - #if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_IJMatrixMemoryLocation(matrix) ); if (exec == HYPRE_EXEC_DEVICE) { - hypre_IJMatrixSetAddValuesParCSRDevice(ijmatrix, nrows, ncols, rows, row_indexes, cols, values, - "set"); + hypre_IJMatrixSetAddValuesParCSRDevice(ijmatrix, nrows, ncols, rows, + row_indexes, cols, values, "set"); } else #endif @@ -522,25 +432,19 @@ HYPRE_IJMatrixSetValues2( HYPRE_IJMatrix matrix, /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ + HYPRE_Int HYPRE_IJMatrixSetConstantValues( HYPRE_IJMatrix matrix, HYPRE_Complex value) { hypre_IJMatrix *ijmatrix = (hypre_IJMatrix *) matrix; - if (!ijmatrix) + if (!ijmatrix || hypre_IJMatrixObjectType(ijmatrix) != HYPRE_PARCSR) { hypre_error_in_arg(1); return hypre_error_flag; } - if ( hypre_IJMatrixObjectType(ijmatrix) == HYPRE_PARCSR ) - { - return ( hypre_IJMatrixSetConstantValuesParCSR( ijmatrix, value)); - } - else - { - hypre_error_in_arg(1); - } + hypre_IJMatrixSetConstantValuesParCSR(ijmatrix, value); return hypre_error_flag; } @@ -563,7 +467,7 @@ HYPRE_IJMatrixAddToValues( HYPRE_IJMatrix matrix, return hypre_error_flag; } - if (!ijmatrix) + if (!ijmatrix || hypre_IJMatrixObjectType(ijmatrix) != HYPRE_PARCSR) { hypre_error_in_arg(1); return hypre_error_flag; @@ -601,12 +505,6 @@ HYPRE_IJMatrixAddToValues( HYPRE_IJMatrix matrix, return hypre_error_flag; } - if ( hypre_IJMatrixObjectType(ijmatrix) != HYPRE_PARCSR ) - { - hypre_error_in_arg(1); - return hypre_error_flag; - } - HYPRE_IJMatrixAddToValues2(matrix, nrows, ncols, rows, NULL, cols, values); return hypre_error_flag; @@ -631,7 +529,7 @@ HYPRE_IJMatrixAddToValues2( HYPRE_IJMatrix matrix, return hypre_error_flag; } - if (!ijmatrix) + if (!ijmatrix || hypre_IJMatrixObjectType(ijmatrix) != HYPRE_PARCSR) { hypre_error_in_arg(1); return hypre_error_flag; @@ -669,19 +567,13 @@ HYPRE_IJMatrixAddToValues2( HYPRE_IJMatrix matrix, return hypre_error_flag; } - if ( hypre_IJMatrixObjectType(ijmatrix) != HYPRE_PARCSR ) - { - hypre_error_in_arg(1); - return hypre_error_flag; - } - #if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_IJMatrixMemoryLocation(matrix) ); if (exec == HYPRE_EXEC_DEVICE) { - hypre_IJMatrixSetAddValuesParCSRDevice(ijmatrix, nrows, ncols, rows, row_indexes, cols, values, - "add"); + hypre_IJMatrixSetAddValuesParCSRDevice(ijmatrix, nrows, ncols, rows, + row_indexes, cols, values, "add"); } else #endif @@ -707,11 +599,13 @@ HYPRE_IJMatrixAddToValues2( HYPRE_IJMatrix matrix, if (hypre_IJMatrixOMPFlag(ijmatrix)) { - hypre_IJMatrixAddToValuesOMPParCSR(ijmatrix, nrows, ncols_tmp, rows, row_indexes_tmp, cols, values); + hypre_IJMatrixAddToValuesOMPParCSR(ijmatrix, nrows, ncols_tmp, rows, + row_indexes_tmp, cols, values); } else { - hypre_IJMatrixAddToValuesParCSR(ijmatrix, nrows, ncols_tmp, rows, row_indexes_tmp, cols, values); + hypre_IJMatrixAddToValuesParCSR(ijmatrix, nrows, ncols_tmp, rows, + row_indexes_tmp, cols, values); } if (!ncols) @@ -738,30 +632,23 @@ HYPRE_IJMatrixAssemble( HYPRE_IJMatrix matrix ) { hypre_IJMatrix *ijmatrix = (hypre_IJMatrix *) matrix; - if (!ijmatrix) + if (!ijmatrix || hypre_IJMatrixObjectType(ijmatrix) != HYPRE_PARCSR) { hypre_error_in_arg(1); return hypre_error_flag; } - if (hypre_IJMatrixObjectType(ijmatrix) == HYPRE_PARCSR) - { #if defined(HYPRE_USING_GPU) - HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(hypre_IJMatrixMemoryLocation(matrix)); + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(hypre_IJMatrixMemoryLocation(matrix)); - if (exec == HYPRE_EXEC_DEVICE) - { - hypre_IJMatrixAssembleParCSRDevice(ijmatrix); - } - else -#endif - { - hypre_IJMatrixAssembleParCSR(ijmatrix); - } + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_IJMatrixAssembleParCSRDevice(ijmatrix); } else +#endif { - hypre_error_in_arg(1); + hypre_IJMatrixAssembleParCSR(ijmatrix); } HYPRE_PRINT_MEMORY_USAGE(hypre_IJMatrixComm(ijmatrix)); @@ -785,7 +672,7 @@ HYPRE_IJMatrixGetRowCounts( HYPRE_IJMatrix matrix, return hypre_error_flag; } - if (!ijmatrix) + if (!ijmatrix || hypre_IJMatrixObjectType(ijmatrix) != HYPRE_PARCSR) { hypre_error_in_arg(1); return hypre_error_flag; @@ -809,14 +696,7 @@ HYPRE_IJMatrixGetRowCounts( HYPRE_IJMatrix matrix, return hypre_error_flag; } - if ( hypre_IJMatrixObjectType(ijmatrix) == HYPRE_PARCSR ) - { - hypre_IJMatrixGetRowCountsParCSR( ijmatrix, nrows, rows, ncols ); - } - else - { - hypre_error_in_arg(1); - } + hypre_IJMatrixGetRowCountsParCSR( ijmatrix, nrows, rows, ncols ); return hypre_error_flag; } @@ -839,48 +719,40 @@ HYPRE_IJMatrixGetValues( HYPRE_IJMatrix matrix, return hypre_error_flag; } - if (!ijmatrix) + if (!ijmatrix || hypre_IJMatrixObjectType(ijmatrix) != HYPRE_PARCSR) { hypre_error_in_arg(1); return hypre_error_flag; } - if (!ncols) - { - hypre_error_in_arg(3); - return hypre_error_flag; - } - if (!rows) { hypre_error_in_arg(4); return hypre_error_flag; } - if (!cols) - { - hypre_error_in_arg(5); - return hypre_error_flag; - } - if (!values) { hypre_error_in_arg(6); return hypre_error_flag; } - if ( hypre_IJMatrixObjectType(ijmatrix) == HYPRE_PARCSR ) +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_IJMatrixMemoryLocation(matrix) ); + + if (exec == HYPRE_EXEC_DEVICE) { - hypre_IJMatrixGetValuesParCSR( ijmatrix, nrows, ncols, - rows, NULL, cols, values, 0 ); + hypre_IJMatrixGetValuesParCSRDevice(ijmatrix, nrows, ncols, rows, + NULL, cols, values, 0); } else +#endif { - hypre_error_in_arg(1); + hypre_IJMatrixGetValuesParCSR(ijmatrix, nrows, ncols, rows, + NULL, cols, values, 0); } return hypre_error_flag; - } /*-------------------------------------------------------------------------- @@ -902,7 +774,7 @@ HYPRE_IJMatrixGetValues2( HYPRE_IJMatrix matrix, return hypre_error_flag; } - if (!ijmatrix) + if (!ijmatrix || hypre_IJMatrixObjectType(ijmatrix) != HYPRE_PARCSR) { hypre_error_in_arg(1); return hypre_error_flag; @@ -920,12 +792,6 @@ HYPRE_IJMatrixGetValues2( HYPRE_IJMatrix matrix, return hypre_error_flag; } - if (!cols) - { - hypre_error_in_arg(5); - return hypre_error_flag; - } - if (!values) { hypre_error_in_arg(6); @@ -937,24 +803,17 @@ HYPRE_IJMatrixGetValues2( HYPRE_IJMatrix matrix, if (exec == HYPRE_EXEC_DEVICE) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC, "HYPRE_IJMatrixGetValues not implemented for GPUs!"); + hypre_IJMatrixGetValuesParCSRDevice(ijmatrix, nrows, ncols, rows, + row_indexes, cols, values, 0); } else #endif { - if ( hypre_IJMatrixObjectType(ijmatrix) == HYPRE_PARCSR ) - { - hypre_IJMatrixGetValuesParCSR( ijmatrix, nrows, ncols, - rows, row_indexes, cols, values, 0 ); - } - else - { - hypre_error_in_arg(1); - } + hypre_IJMatrixGetValuesParCSR(ijmatrix, nrows, ncols, rows, + row_indexes, cols, values, 0); } return hypre_error_flag; - } /*-------------------------------------------------------------------------- @@ -976,7 +835,7 @@ HYPRE_IJMatrixGetValuesAndZeroOut( HYPRE_IJMatrix matrix, return hypre_error_flag; } - if (!ijmatrix) + if (!ijmatrix || hypre_IJMatrixObjectType(ijmatrix) != HYPRE_PARCSR) { hypre_error_in_arg(1); return hypre_error_flag; @@ -1011,34 +870,17 @@ HYPRE_IJMatrixGetValuesAndZeroOut( HYPRE_IJMatrix matrix, if (exec == HYPRE_EXEC_DEVICE) { - /* TODO: add device implementation */ - hypre_error_w_msg(HYPRE_ERROR_GENERIC, - "HYPRE_IJMatrixGetValuesAndZeroOut not implemented for GPUs!"); - - if ( hypre_IJMatrixObjectType(ijmatrix) == HYPRE_PARCSR ) - { - hypre_IJMatrixMigrateParCSR(ijmatrix, HYPRE_MEMORY_HOST); - hypre_IJMatrixGetValuesParCSR(ijmatrix, nrows, ncols, - rows, row_indexes, cols, values, 1); - hypre_IJMatrixMigrateParCSR(ijmatrix, HYPRE_MEMORY_DEVICE); - } + hypre_IJMatrixGetValuesParCSRDevice(ijmatrix, nrows, ncols, rows, + row_indexes, cols, values, 1); } else #endif { - if ( hypre_IJMatrixObjectType(ijmatrix) == HYPRE_PARCSR ) - { - hypre_IJMatrixGetValuesParCSR( ijmatrix, nrows, ncols, - rows, row_indexes, cols, values, 1 ); - } - else - { - hypre_error_in_arg(1); - } + hypre_IJMatrixGetValuesParCSR(ijmatrix, nrows, ncols, rows, + row_indexes, cols, values, 1); } return hypre_error_flag; - } /*-------------------------------------------------------------------------- @@ -1122,7 +964,7 @@ HYPRE_IJMatrixGetGlobalInfo( HYPRE_IJMatrix matrix, { hypre_IJMatrix *ijmatrix = (hypre_IJMatrix *) matrix; - if (!ijmatrix) + if (!ijmatrix || hypre_IJMatrixObjectType(ijmatrix) != HYPRE_PARCSR) { hypre_error_in_arg(1); return hypre_error_flag; @@ -1131,25 +973,17 @@ HYPRE_IJMatrixGetGlobalInfo( HYPRE_IJMatrix matrix, *global_num_rows = hypre_IJMatrixGlobalNumRows(ijmatrix); *global_num_cols = hypre_IJMatrixGlobalNumCols(ijmatrix); - if (hypre_IJMatrixObjectType(ijmatrix) == HYPRE_PARCSR) - { - hypre_ParCSRMatrix *par_matrix = (hypre_ParCSRMatrix *) hypre_IJMatrixObject(ijmatrix); + hypre_ParCSRMatrix *par_matrix = (hypre_ParCSRMatrix *) hypre_IJMatrixObject(ijmatrix); - if (!par_matrix) - { - hypre_error_in_arg(1); - return hypre_error_flag; - } - - hypre_ParCSRMatrixSetNumNonzeros(par_matrix); - *global_num_nonzeros = hypre_ParCSRMatrixNumNonzeros(par_matrix); - } - else + if (!par_matrix) { hypre_error_in_arg(1); return hypre_error_flag; } + hypre_ParCSRMatrixSetNumNonzeros(par_matrix); + *global_num_nonzeros = hypre_ParCSRMatrixNumNonzeros(par_matrix); + return hypre_error_flag; } @@ -1192,20 +1026,13 @@ HYPRE_IJMatrixSetRowSizes( HYPRE_IJMatrix matrix, { hypre_IJMatrix *ijmatrix = (hypre_IJMatrix *) matrix; - if (!ijmatrix) + if (!ijmatrix || hypre_IJMatrixObjectType(ijmatrix) != HYPRE_PARCSR) { hypre_error_in_arg(1); return hypre_error_flag; } - if ( hypre_IJMatrixObjectType(ijmatrix) == HYPRE_PARCSR ) - { - return ( hypre_IJMatrixSetRowSizesParCSR( ijmatrix, sizes ) ); - } - else - { - hypre_error_in_arg(1); - } + hypre_IJMatrixSetRowSizesParCSR(ijmatrix, sizes); return hypre_error_flag; } @@ -1221,20 +1048,14 @@ HYPRE_IJMatrixSetDiagOffdSizes( HYPRE_IJMatrix matrix, { hypre_IJMatrix *ijmatrix = (hypre_IJMatrix *) matrix; - if (!ijmatrix) + if (!ijmatrix || hypre_IJMatrixObjectType(ijmatrix) != HYPRE_PARCSR) { hypre_error_in_arg(1); return hypre_error_flag; } - if ( hypre_IJMatrixObjectType(ijmatrix) == HYPRE_PARCSR ) - { - hypre_IJMatrixSetDiagOffdSizesParCSR( ijmatrix, diag_sizes, offdiag_sizes ); - } - else - { - hypre_error_in_arg(1); - } + hypre_IJMatrixSetDiagOffdSizesParCSR( ijmatrix, diag_sizes, offdiag_sizes ); + return hypre_error_flag; } @@ -1248,21 +1069,13 @@ HYPRE_IJMatrixSetMaxOffProcElmts( HYPRE_IJMatrix matrix, { hypre_IJMatrix *ijmatrix = (hypre_IJMatrix *) matrix; - if (!ijmatrix) + if (!ijmatrix || hypre_IJMatrixObjectType(ijmatrix) != HYPRE_PARCSR) { hypre_error_in_arg(1); return hypre_error_flag; } - if ( hypre_IJMatrixObjectType(ijmatrix) == HYPRE_PARCSR ) - { - return ( hypre_IJMatrixSetMaxOffProcElmtsParCSR(ijmatrix, - max_off_proc_elmts) ); - } - else - { - hypre_error_in_arg(1); - } + hypre_IJMatrixSetMaxOffProcElmtsParCSR(ijmatrix,max_off_proc_elmts); return hypre_error_flag; } @@ -1276,21 +1089,13 @@ HYPRE_IJMatrixSetInitAllocation(hypre_IJMatrix *matrix, { hypre_IJMatrix *ijmatrix = (hypre_IJMatrix *) matrix; - if (!ijmatrix) + if (!ijmatrix || hypre_IJMatrixObjectType(ijmatrix) != HYPRE_PARCSR) { hypre_error_in_arg(1); return hypre_error_flag; } - if ( hypre_IJMatrixObjectType(ijmatrix) == HYPRE_PARCSR ) - { - return ( hypre_IJMatrixSetInitAllocationParCSR(ijmatrix, - factor) ); - } - else - { - hypre_error_in_arg(1); - } + hypre_IJMatrixSetInitAllocationParCSR(ijmatrix, factor); return hypre_error_flag; } @@ -1304,21 +1109,13 @@ HYPRE_IJMatrixSetEarlyAssemble(hypre_IJMatrix *matrix, { hypre_IJMatrix *ijmatrix = (hypre_IJMatrix *) matrix; - if (!ijmatrix) + if (!ijmatrix || hypre_IJMatrixObjectType(ijmatrix) != HYPRE_PARCSR) { hypre_error_in_arg(1); return hypre_error_flag; } - if ( hypre_IJMatrixObjectType(ijmatrix) == HYPRE_PARCSR ) - { - return ( hypre_IJMatrixSetEarlyAssembleParCSR(ijmatrix, - early_assemble) ); - } - else - { - hypre_error_in_arg(1); - } + hypre_IJMatrixSetEarlyAssembleParCSR(ijmatrix, early_assemble); return hypre_error_flag; } @@ -1332,21 +1129,13 @@ HYPRE_IJMatrixSetGrowFactor(hypre_IJMatrix *matrix, { hypre_IJMatrix *ijmatrix = (hypre_IJMatrix *) matrix; - if (!ijmatrix) + if (!ijmatrix || hypre_IJMatrixObjectType(ijmatrix) != HYPRE_PARCSR) { hypre_error_in_arg(1); return hypre_error_flag; } - if ( hypre_IJMatrixObjectType(ijmatrix) == HYPRE_PARCSR ) - { - return ( hypre_IJMatrixSetGrowFactorParCSR(ijmatrix, - factor) ); - } - else - { - hypre_error_in_arg(1); - } + hypre_IJMatrixSetGrowFactorParCSR(ijmatrix, factor); return hypre_error_flag; } @@ -1414,13 +1203,7 @@ HYPRE_IJMatrixPrint( HYPRE_IJMatrix matrix, { void *object; - if (!matrix) - { - hypre_error_in_arg(1); - return hypre_error_flag; - } - - if ( (hypre_IJMatrixObjectType(matrix) != HYPRE_PARCSR) ) + if (!matrix || hypre_IJMatrixObjectType(matrix) != HYPRE_PARCSR) { hypre_error_in_arg(1); return hypre_error_flag; @@ -1442,13 +1225,7 @@ HYPRE_IJMatrixPrintBinary( HYPRE_IJMatrix matrix, { void *object; - if (!matrix) - { - hypre_error_in_arg(1); - return hypre_error_flag; - } - - if ( (hypre_IJMatrixObjectType(matrix) != HYPRE_PARCSR) ) + if (!matrix || hypre_IJMatrixObjectType(matrix) != HYPRE_PARCSR) { hypre_error_in_arg(1); return hypre_error_flag; @@ -1545,20 +1322,13 @@ HYPRE_IJMatrixNorm( HYPRE_IJMatrix matrix, { hypre_IJMatrix *ijmatrix = (hypre_IJMatrix *) matrix; - if (!ijmatrix) + if (!ijmatrix || hypre_IJMatrixObjectType(ijmatrix) != HYPRE_PARCSR) { hypre_error_in_arg(1); return hypre_error_flag; } - if (hypre_IJMatrixObjectType(ijmatrix) == HYPRE_PARCSR) - { - hypre_IJMatrixNormParCSR(ijmatrix, norm); - } - else - { - hypre_error_in_arg(1); - } + hypre_IJMatrixNormParCSR(ijmatrix, norm); return hypre_error_flag; } @@ -1655,21 +1425,13 @@ HYPRE_IJMatrixMigrate(HYPRE_IJMatrix matrix, { hypre_IJMatrix *ijmatrix = (hypre_IJMatrix *) matrix; - if (!ijmatrix) + if (!ijmatrix || hypre_IJMatrixObjectType(ijmatrix) != HYPRE_PARCSR) { hypre_error_in_arg(1); return hypre_error_flag; } - /* Only implemented for ParCSR matrices */ - if (hypre_IJMatrixObjectType(ijmatrix) == HYPRE_PARCSR) - { - hypre_IJMatrixMigrateParCSR(ijmatrix, memory_location); - } - else - { - hypre_error_in_arg(1); - } + hypre_IJMatrixMigrateParCSR(ijmatrix, memory_location); return hypre_error_flag; } diff --git a/src/IJ_mv/HYPRE_IJ_mv.h b/src/IJ_mv/HYPRE_IJ_mv.h index 9701c00e04..96d65c6eee 100644 --- a/src/IJ_mv/HYPRE_IJ_mv.h +++ b/src/IJ_mv/HYPRE_IJ_mv.h @@ -11,6 +11,10 @@ #include "HYPRE_config.h" #include "HYPRE_utilities.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_IJ_mv_mup_def.h" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -19,7 +23,7 @@ extern "C" { *--------------------------------------------------------------------------*/ /** - * @defgroup IJSystemInterface IJ System Interface + * @defgroup IJInterface IJ System Interface * * A linear-algebraic conceptual interface. This interface represents a * linear-algebraic conceptual view of a linear system. The 'I' and 'J' in the @@ -462,6 +466,8 @@ HYPRE_Int HYPRE_IJMatrixReadBinary(const char *filename, HYPRE_Int HYPRE_IJMatrixMigrate(HYPRE_IJMatrix matrix, HYPRE_MemoryLocation memory_location); +HYPRE_Int HYPRE_IJMatrixPartialClone ( HYPRE_IJMatrix matrix_in, HYPRE_IJMatrix *matrix_out ); + /**@}*/ /*-------------------------------------------------------------------------- @@ -739,10 +745,25 @@ HYPRE_Int HYPRE_IJVectorMigrate(HYPRE_IJVector vector, HYPRE_MemoryLocation memory_location); /**@}*/ + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + /**@}*/ #ifdef __cplusplus } #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_IJ_mv_mup_undef.h" +#include "HYPRE_IJ_mv_mup.h" +#endif +#endif + #endif diff --git a/src/IJ_mv/HYPRE_IJ_mv_mup.h b/src/IJ_mv/HYPRE_IJ_mv_mup.h new file mode 100644 index 0000000000..2f991cb873 --- /dev/null +++ b/src/IJ_mv/HYPRE_IJ_mv_mup.h @@ -0,0 +1,821 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#ifndef HYPRE_IJ_MV_MUP_HEADER +#define HYPRE_IJ_MV_MUP_HEADER + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (HYPRE_MIXED_PRECISION) + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_IJMatrixAdd_flt( hypre_float alpha, HYPRE_IJMatrix matrix_A, hypre_float beta, HYPRE_IJMatrix matrix_B, HYPRE_IJMatrix *matrix_C ); +HYPRE_Int +HYPRE_IJMatrixAdd_dbl( hypre_double alpha, HYPRE_IJMatrix matrix_A, hypre_double beta, HYPRE_IJMatrix matrix_B, HYPRE_IJMatrix *matrix_C ); +HYPRE_Int +HYPRE_IJMatrixAdd_long_dbl( hypre_long_double alpha, HYPRE_IJMatrix matrix_A, hypre_long_double beta, HYPRE_IJMatrix matrix_B, HYPRE_IJMatrix *matrix_C ); +HYPRE_Int +HYPRE_IJMatrixAdd( hypre_long_double alpha, HYPRE_IJMatrix matrix_A, hypre_long_double beta, HYPRE_IJMatrix matrix_B, HYPRE_IJMatrix *matrix_C ); + +HYPRE_Int +HYPRE_IJMatrixAddToValues_flt( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_BigInt *cols, const hypre_float *values ); +HYPRE_Int +HYPRE_IJMatrixAddToValues_dbl( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_BigInt *cols, const hypre_double *values ); +HYPRE_Int +HYPRE_IJMatrixAddToValues_long_dbl( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_BigInt *cols, const hypre_long_double *values ); +HYPRE_Int +HYPRE_IJMatrixAddToValues( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_BigInt *cols, const void *values ); + +HYPRE_Int +HYPRE_IJMatrixAddToValues2_flt( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const hypre_float *values ); +HYPRE_Int +HYPRE_IJMatrixAddToValues2_dbl( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const hypre_double *values ); +HYPRE_Int +HYPRE_IJMatrixAddToValues2_long_dbl( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const hypre_long_double *values ); +HYPRE_Int +HYPRE_IJMatrixAddToValues2( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const void *values ); + +HYPRE_Int +HYPRE_IJMatrixAssemble_flt( HYPRE_IJMatrix matrix ); +HYPRE_Int +HYPRE_IJMatrixAssemble_dbl( HYPRE_IJMatrix matrix ); +HYPRE_Int +HYPRE_IJMatrixAssemble_long_dbl( HYPRE_IJMatrix matrix ); +HYPRE_Int +HYPRE_IJMatrixAssemble( HYPRE_IJMatrix matrix ); + +HYPRE_Int +HYPRE_IJMatrixCreate_flt( MPI_Comm comm, HYPRE_BigInt ilower, HYPRE_BigInt iupper, HYPRE_BigInt jlower, HYPRE_BigInt jupper, HYPRE_IJMatrix *matrix ); +HYPRE_Int +HYPRE_IJMatrixCreate_dbl( MPI_Comm comm, HYPRE_BigInt ilower, HYPRE_BigInt iupper, HYPRE_BigInt jlower, HYPRE_BigInt jupper, HYPRE_IJMatrix *matrix ); +HYPRE_Int +HYPRE_IJMatrixCreate_long_dbl( MPI_Comm comm, HYPRE_BigInt ilower, HYPRE_BigInt iupper, HYPRE_BigInt jlower, HYPRE_BigInt jupper, HYPRE_IJMatrix *matrix ); +HYPRE_Int +HYPRE_IJMatrixCreate( MPI_Comm comm, HYPRE_BigInt ilower, HYPRE_BigInt iupper, HYPRE_BigInt jlower, HYPRE_BigInt jupper, HYPRE_IJMatrix *matrix ); + +HYPRE_Int +HYPRE_IJMatrixDestroy_flt( HYPRE_IJMatrix matrix ); +HYPRE_Int +HYPRE_IJMatrixDestroy_dbl( HYPRE_IJMatrix matrix ); +HYPRE_Int +HYPRE_IJMatrixDestroy_long_dbl( HYPRE_IJMatrix matrix ); +HYPRE_Int +HYPRE_IJMatrixDestroy( HYPRE_IJMatrix matrix ); + +HYPRE_Int +HYPRE_IJMatrixGetGlobalInfo_flt( HYPRE_IJMatrix matrix, HYPRE_BigInt *global_num_rows, HYPRE_BigInt *global_num_cols, HYPRE_BigInt *global_num_nonzeros ); +HYPRE_Int +HYPRE_IJMatrixGetGlobalInfo_dbl( HYPRE_IJMatrix matrix, HYPRE_BigInt *global_num_rows, HYPRE_BigInt *global_num_cols, HYPRE_BigInt *global_num_nonzeros ); +HYPRE_Int +HYPRE_IJMatrixGetGlobalInfo_long_dbl( HYPRE_IJMatrix matrix, HYPRE_BigInt *global_num_rows, HYPRE_BigInt *global_num_cols, HYPRE_BigInt *global_num_nonzeros ); +HYPRE_Int +HYPRE_IJMatrixGetGlobalInfo( HYPRE_IJMatrix matrix, HYPRE_BigInt *global_num_rows, HYPRE_BigInt *global_num_cols, HYPRE_BigInt *global_num_nonzeros ); + +HYPRE_Int +HYPRE_IJMatrixGetLocalRange_flt( HYPRE_IJMatrix matrix, HYPRE_BigInt *ilower, HYPRE_BigInt *iupper, HYPRE_BigInt *jlower, HYPRE_BigInt *jupper ); +HYPRE_Int +HYPRE_IJMatrixGetLocalRange_dbl( HYPRE_IJMatrix matrix, HYPRE_BigInt *ilower, HYPRE_BigInt *iupper, HYPRE_BigInt *jlower, HYPRE_BigInt *jupper ); +HYPRE_Int +HYPRE_IJMatrixGetLocalRange_long_dbl( HYPRE_IJMatrix matrix, HYPRE_BigInt *ilower, HYPRE_BigInt *iupper, HYPRE_BigInt *jlower, HYPRE_BigInt *jupper ); +HYPRE_Int +HYPRE_IJMatrixGetLocalRange( HYPRE_IJMatrix matrix, HYPRE_BigInt *ilower, HYPRE_BigInt *iupper, HYPRE_BigInt *jlower, HYPRE_BigInt *jupper ); + +HYPRE_Int +HYPRE_IJMatrixGetObject_flt( HYPRE_IJMatrix matrix, void **object ); +HYPRE_Int +HYPRE_IJMatrixGetObject_dbl( HYPRE_IJMatrix matrix, void **object ); +HYPRE_Int +HYPRE_IJMatrixGetObject_long_dbl( HYPRE_IJMatrix matrix, void **object ); +HYPRE_Int +HYPRE_IJMatrixGetObject( HYPRE_IJMatrix matrix, void **object ); + +HYPRE_Int +HYPRE_IJMatrixGetObjectType_flt( HYPRE_IJMatrix matrix, HYPRE_Int *type ); +HYPRE_Int +HYPRE_IJMatrixGetObjectType_dbl( HYPRE_IJMatrix matrix, HYPRE_Int *type ); +HYPRE_Int +HYPRE_IJMatrixGetObjectType_long_dbl( HYPRE_IJMatrix matrix, HYPRE_Int *type ); +HYPRE_Int +HYPRE_IJMatrixGetObjectType( HYPRE_IJMatrix matrix, HYPRE_Int *type ); + +HYPRE_Int +HYPRE_IJMatrixGetRowCounts_flt( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_BigInt *rows, HYPRE_Int *ncols ); +HYPRE_Int +HYPRE_IJMatrixGetRowCounts_dbl( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_BigInt *rows, HYPRE_Int *ncols ); +HYPRE_Int +HYPRE_IJMatrixGetRowCounts_long_dbl( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_BigInt *rows, HYPRE_Int *ncols ); +HYPRE_Int +HYPRE_IJMatrixGetRowCounts( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_BigInt *rows, HYPRE_Int *ncols ); + +HYPRE_Int +HYPRE_IJMatrixGetValues_flt( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, HYPRE_BigInt *rows, HYPRE_BigInt *cols, hypre_float *values ); +HYPRE_Int +HYPRE_IJMatrixGetValues_dbl( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, HYPRE_BigInt *rows, HYPRE_BigInt *cols, hypre_double *values ); +HYPRE_Int +HYPRE_IJMatrixGetValues_long_dbl( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, HYPRE_BigInt *rows, HYPRE_BigInt *cols, hypre_long_double *values ); +HYPRE_Int +HYPRE_IJMatrixGetValues( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, HYPRE_BigInt *rows, HYPRE_BigInt *cols, void *values ); + +HYPRE_Int +HYPRE_IJMatrixGetValues2_flt( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, HYPRE_BigInt *rows, HYPRE_Int *row_indexes, HYPRE_BigInt *cols, hypre_float *values ); +HYPRE_Int +HYPRE_IJMatrixGetValues2_dbl( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, HYPRE_BigInt *rows, HYPRE_Int *row_indexes, HYPRE_BigInt *cols, hypre_double *values ); +HYPRE_Int +HYPRE_IJMatrixGetValues2_long_dbl( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, HYPRE_BigInt *rows, HYPRE_Int *row_indexes, HYPRE_BigInt *cols, hypre_long_double *values ); +HYPRE_Int +HYPRE_IJMatrixGetValues2( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, HYPRE_BigInt *rows, HYPRE_Int *row_indexes, HYPRE_BigInt *cols, void *values ); + +HYPRE_Int +HYPRE_IJMatrixGetValuesAndZeroOut_flt( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, HYPRE_BigInt *rows, HYPRE_Int *row_indexes, HYPRE_BigInt *cols, hypre_float *values ); +HYPRE_Int +HYPRE_IJMatrixGetValuesAndZeroOut_dbl( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, HYPRE_BigInt *rows, HYPRE_Int *row_indexes, HYPRE_BigInt *cols, hypre_double *values ); +HYPRE_Int +HYPRE_IJMatrixGetValuesAndZeroOut_long_dbl( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, HYPRE_BigInt *rows, HYPRE_Int *row_indexes, HYPRE_BigInt *cols, hypre_long_double *values ); +HYPRE_Int +HYPRE_IJMatrixGetValuesAndZeroOut( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, HYPRE_BigInt *rows, HYPRE_Int *row_indexes, HYPRE_BigInt *cols, void *values ); + +HYPRE_Int +HYPRE_IJMatrixInitialize_flt( HYPRE_IJMatrix matrix ); +HYPRE_Int +HYPRE_IJMatrixInitialize_dbl( HYPRE_IJMatrix matrix ); +HYPRE_Int +HYPRE_IJMatrixInitialize_long_dbl( HYPRE_IJMatrix matrix ); +HYPRE_Int +HYPRE_IJMatrixInitialize( HYPRE_IJMatrix matrix ); + +HYPRE_Int +HYPRE_IJMatrixInitialize_v2_flt( HYPRE_IJMatrix matrix, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +HYPRE_IJMatrixInitialize_v2_dbl( HYPRE_IJMatrix matrix, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +HYPRE_IJMatrixInitialize_v2_long_dbl( HYPRE_IJMatrix matrix, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +HYPRE_IJMatrixInitialize_v2( HYPRE_IJMatrix matrix, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +HYPRE_IJMatrixMigrate_flt( HYPRE_IJMatrix matrix, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +HYPRE_IJMatrixMigrate_dbl( HYPRE_IJMatrix matrix, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +HYPRE_IJMatrixMigrate_long_dbl( HYPRE_IJMatrix matrix, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +HYPRE_IJMatrixMigrate( HYPRE_IJMatrix matrix, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +HYPRE_IJMatrixNorm_flt( HYPRE_IJMatrix matrix, hypre_float *norm ); +HYPRE_Int +HYPRE_IJMatrixNorm_dbl( HYPRE_IJMatrix matrix, hypre_double *norm ); +HYPRE_Int +HYPRE_IJMatrixNorm_long_dbl( HYPRE_IJMatrix matrix, hypre_long_double *norm ); +HYPRE_Int +HYPRE_IJMatrixNorm( HYPRE_IJMatrix matrix, void *norm ); + +HYPRE_Int +HYPRE_IJMatrixPartialClone_flt( HYPRE_IJMatrix matrix_in, HYPRE_IJMatrix *matrix_out ); +HYPRE_Int +HYPRE_IJMatrixPartialClone_dbl( HYPRE_IJMatrix matrix_in, HYPRE_IJMatrix *matrix_out ); +HYPRE_Int +HYPRE_IJMatrixPartialClone_long_dbl( HYPRE_IJMatrix matrix_in, HYPRE_IJMatrix *matrix_out ); +HYPRE_Int +HYPRE_IJMatrixPartialClone( HYPRE_IJMatrix matrix_in, HYPRE_IJMatrix *matrix_out ); + +HYPRE_Int +HYPRE_IJMatrixPrint_flt( HYPRE_IJMatrix matrix, const char *filename ); +HYPRE_Int +HYPRE_IJMatrixPrint_dbl( HYPRE_IJMatrix matrix, const char *filename ); +HYPRE_Int +HYPRE_IJMatrixPrint_long_dbl( HYPRE_IJMatrix matrix, const char *filename ); +HYPRE_Int +HYPRE_IJMatrixPrint( HYPRE_IJMatrix matrix, const char *filename ); + +HYPRE_Int +HYPRE_IJMatrixPrintBinary_flt( HYPRE_IJMatrix matrix, const char *filename ); +HYPRE_Int +HYPRE_IJMatrixPrintBinary_dbl( HYPRE_IJMatrix matrix, const char *filename ); +HYPRE_Int +HYPRE_IJMatrixPrintBinary_long_dbl( HYPRE_IJMatrix matrix, const char *filename ); +HYPRE_Int +HYPRE_IJMatrixPrintBinary( HYPRE_IJMatrix matrix, const char *filename ); + +HYPRE_Int +HYPRE_IJMatrixRead_flt( const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJMatrix *matrix ); +HYPRE_Int +HYPRE_IJMatrixRead_dbl( const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJMatrix *matrix ); +HYPRE_Int +HYPRE_IJMatrixRead_long_dbl( const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJMatrix *matrix ); +HYPRE_Int +HYPRE_IJMatrixRead( const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJMatrix *matrix ); + +HYPRE_Int +HYPRE_IJMatrixReadBinary_flt( const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJMatrix *matrix_ptr ); +HYPRE_Int +HYPRE_IJMatrixReadBinary_dbl( const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJMatrix *matrix_ptr ); +HYPRE_Int +HYPRE_IJMatrixReadBinary_long_dbl( const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJMatrix *matrix_ptr ); +HYPRE_Int +HYPRE_IJMatrixReadBinary( const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJMatrix *matrix_ptr ); + +HYPRE_Int +HYPRE_IJMatrixReadMM_flt( const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJMatrix *matrix ); +HYPRE_Int +HYPRE_IJMatrixReadMM_dbl( const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJMatrix *matrix ); +HYPRE_Int +HYPRE_IJMatrixReadMM_long_dbl( const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJMatrix *matrix ); +HYPRE_Int +HYPRE_IJMatrixReadMM( const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJMatrix *matrix ); + +HYPRE_Int +HYPRE_IJMatrixSetConstantValues_flt( HYPRE_IJMatrix matrix, hypre_float value ); +HYPRE_Int +HYPRE_IJMatrixSetConstantValues_dbl( HYPRE_IJMatrix matrix, hypre_double value ); +HYPRE_Int +HYPRE_IJMatrixSetConstantValues_long_dbl( HYPRE_IJMatrix matrix, hypre_long_double value ); +HYPRE_Int +HYPRE_IJMatrixSetConstantValues( HYPRE_IJMatrix matrix, hypre_long_double value ); + +HYPRE_Int +HYPRE_IJMatrixSetDiagOffdSizes_flt( HYPRE_IJMatrix matrix, const HYPRE_Int *diag_sizes, const HYPRE_Int *offdiag_sizes ); +HYPRE_Int +HYPRE_IJMatrixSetDiagOffdSizes_dbl( HYPRE_IJMatrix matrix, const HYPRE_Int *diag_sizes, const HYPRE_Int *offdiag_sizes ); +HYPRE_Int +HYPRE_IJMatrixSetDiagOffdSizes_long_dbl( HYPRE_IJMatrix matrix, const HYPRE_Int *diag_sizes, const HYPRE_Int *offdiag_sizes ); +HYPRE_Int +HYPRE_IJMatrixSetDiagOffdSizes( HYPRE_IJMatrix matrix, const HYPRE_Int *diag_sizes, const HYPRE_Int *offdiag_sizes ); + +HYPRE_Int +HYPRE_IJMatrixSetEarlyAssemble_flt( HYPRE_IJMatrix matrix, HYPRE_Int early_assemble ); +HYPRE_Int +HYPRE_IJMatrixSetEarlyAssemble_dbl( HYPRE_IJMatrix matrix, HYPRE_Int early_assemble ); +HYPRE_Int +HYPRE_IJMatrixSetEarlyAssemble_long_dbl( HYPRE_IJMatrix matrix, HYPRE_Int early_assemble ); +HYPRE_Int +HYPRE_IJMatrixSetEarlyAssemble( HYPRE_IJMatrix matrix, HYPRE_Int early_assemble ); + +HYPRE_Int +HYPRE_IJMatrixSetGrowFactor_flt( HYPRE_IJMatrix matrix, hypre_float factor ); +HYPRE_Int +HYPRE_IJMatrixSetGrowFactor_dbl( HYPRE_IJMatrix matrix, hypre_double factor ); +HYPRE_Int +HYPRE_IJMatrixSetGrowFactor_long_dbl( HYPRE_IJMatrix matrix, hypre_long_double factor ); +HYPRE_Int +HYPRE_IJMatrixSetGrowFactor( HYPRE_IJMatrix matrix, hypre_long_double factor ); + +HYPRE_Int +HYPRE_IJMatrixSetInitAllocation_flt( HYPRE_IJMatrix matrix, HYPRE_Int factor ); +HYPRE_Int +HYPRE_IJMatrixSetInitAllocation_dbl( HYPRE_IJMatrix matrix, HYPRE_Int factor ); +HYPRE_Int +HYPRE_IJMatrixSetInitAllocation_long_dbl( HYPRE_IJMatrix matrix, HYPRE_Int factor ); +HYPRE_Int +HYPRE_IJMatrixSetInitAllocation( HYPRE_IJMatrix matrix, HYPRE_Int factor ); + +HYPRE_Int +HYPRE_IJMatrixSetMaxOffProcElmts_flt( HYPRE_IJMatrix matrix, HYPRE_Int max_off_proc_elmts ); +HYPRE_Int +HYPRE_IJMatrixSetMaxOffProcElmts_dbl( HYPRE_IJMatrix matrix, HYPRE_Int max_off_proc_elmts ); +HYPRE_Int +HYPRE_IJMatrixSetMaxOffProcElmts_long_dbl( HYPRE_IJMatrix matrix, HYPRE_Int max_off_proc_elmts ); +HYPRE_Int +HYPRE_IJMatrixSetMaxOffProcElmts( HYPRE_IJMatrix matrix, HYPRE_Int max_off_proc_elmts ); + +HYPRE_Int +HYPRE_IJMatrixSetOMPFlag_flt( HYPRE_IJMatrix matrix, HYPRE_Int omp_flag ); +HYPRE_Int +HYPRE_IJMatrixSetOMPFlag_dbl( HYPRE_IJMatrix matrix, HYPRE_Int omp_flag ); +HYPRE_Int +HYPRE_IJMatrixSetOMPFlag_long_dbl( HYPRE_IJMatrix matrix, HYPRE_Int omp_flag ); +HYPRE_Int +HYPRE_IJMatrixSetOMPFlag( HYPRE_IJMatrix matrix, HYPRE_Int omp_flag ); + +HYPRE_Int +HYPRE_IJMatrixSetObjectType_flt( HYPRE_IJMatrix matrix, HYPRE_Int type ); +HYPRE_Int +HYPRE_IJMatrixSetObjectType_dbl( HYPRE_IJMatrix matrix, HYPRE_Int type ); +HYPRE_Int +HYPRE_IJMatrixSetObjectType_long_dbl( HYPRE_IJMatrix matrix, HYPRE_Int type ); +HYPRE_Int +HYPRE_IJMatrixSetObjectType( HYPRE_IJMatrix matrix, HYPRE_Int type ); + +HYPRE_Int +HYPRE_IJMatrixSetPrintLevel_flt( HYPRE_IJMatrix matrix, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_IJMatrixSetPrintLevel_dbl( HYPRE_IJMatrix matrix, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_IJMatrixSetPrintLevel_long_dbl( HYPRE_IJMatrix matrix, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_IJMatrixSetPrintLevel( HYPRE_IJMatrix matrix, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_IJMatrixSetRowSizes_flt( HYPRE_IJMatrix matrix, const HYPRE_Int *sizes ); +HYPRE_Int +HYPRE_IJMatrixSetRowSizes_dbl( HYPRE_IJMatrix matrix, const HYPRE_Int *sizes ); +HYPRE_Int +HYPRE_IJMatrixSetRowSizes_long_dbl( HYPRE_IJMatrix matrix, const HYPRE_Int *sizes ); +HYPRE_Int +HYPRE_IJMatrixSetRowSizes( HYPRE_IJMatrix matrix, const HYPRE_Int *sizes ); + +HYPRE_Int +HYPRE_IJMatrixSetValues_flt( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_BigInt *cols, const hypre_float *values ); +HYPRE_Int +HYPRE_IJMatrixSetValues_dbl( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_BigInt *cols, const hypre_double *values ); +HYPRE_Int +HYPRE_IJMatrixSetValues_long_dbl( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_BigInt *cols, const hypre_long_double *values ); +HYPRE_Int +HYPRE_IJMatrixSetValues( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_BigInt *cols, const void *values ); + +HYPRE_Int +HYPRE_IJMatrixSetValues2_flt( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const hypre_float *values ); +HYPRE_Int +HYPRE_IJMatrixSetValues2_dbl( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const hypre_double *values ); +HYPRE_Int +HYPRE_IJMatrixSetValues2_long_dbl( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const hypre_long_double *values ); +HYPRE_Int +HYPRE_IJMatrixSetValues2( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const void *values ); + +HYPRE_Int +HYPRE_IJMatrixTranspose_flt( HYPRE_IJMatrix matrix_A, HYPRE_IJMatrix *matrix_AT ); +HYPRE_Int +HYPRE_IJMatrixTranspose_dbl( HYPRE_IJMatrix matrix_A, HYPRE_IJMatrix *matrix_AT ); +HYPRE_Int +HYPRE_IJMatrixTranspose_long_dbl( HYPRE_IJMatrix matrix_A, HYPRE_IJMatrix *matrix_AT ); +HYPRE_Int +HYPRE_IJMatrixTranspose( HYPRE_IJMatrix matrix_A, HYPRE_IJMatrix *matrix_AT ); + +HYPRE_Int +HYPRE_IJVectorAddToValues_flt( HYPRE_IJVector vector, HYPRE_Int nvalues, const HYPRE_BigInt *indices, const hypre_float *values ); +HYPRE_Int +HYPRE_IJVectorAddToValues_dbl( HYPRE_IJVector vector, HYPRE_Int nvalues, const HYPRE_BigInt *indices, const hypre_double *values ); +HYPRE_Int +HYPRE_IJVectorAddToValues_long_dbl( HYPRE_IJVector vector, HYPRE_Int nvalues, const HYPRE_BigInt *indices, const hypre_long_double *values ); +HYPRE_Int +HYPRE_IJVectorAddToValues( HYPRE_IJVector vector, HYPRE_Int nvalues, const HYPRE_BigInt *indices, const void *values ); + +HYPRE_Int +HYPRE_IJVectorAssemble_flt( HYPRE_IJVector vector ); +HYPRE_Int +HYPRE_IJVectorAssemble_dbl( HYPRE_IJVector vector ); +HYPRE_Int +HYPRE_IJVectorAssemble_long_dbl( HYPRE_IJVector vector ); +HYPRE_Int +HYPRE_IJVectorAssemble( HYPRE_IJVector vector ); + +HYPRE_Int +HYPRE_IJVectorCreate_flt( MPI_Comm comm, HYPRE_BigInt jlower, HYPRE_BigInt jupper, HYPRE_IJVector *vector ); +HYPRE_Int +HYPRE_IJVectorCreate_dbl( MPI_Comm comm, HYPRE_BigInt jlower, HYPRE_BigInt jupper, HYPRE_IJVector *vector ); +HYPRE_Int +HYPRE_IJVectorCreate_long_dbl( MPI_Comm comm, HYPRE_BigInt jlower, HYPRE_BigInt jupper, HYPRE_IJVector *vector ); +HYPRE_Int +HYPRE_IJVectorCreate( MPI_Comm comm, HYPRE_BigInt jlower, HYPRE_BigInt jupper, HYPRE_IJVector *vector ); + +HYPRE_Int +HYPRE_IJVectorDestroy_flt( HYPRE_IJVector vector ); +HYPRE_Int +HYPRE_IJVectorDestroy_dbl( HYPRE_IJVector vector ); +HYPRE_Int +HYPRE_IJVectorDestroy_long_dbl( HYPRE_IJVector vector ); +HYPRE_Int +HYPRE_IJVectorDestroy( HYPRE_IJVector vector ); + +HYPRE_Int +HYPRE_IJVectorGetLocalRange_flt( HYPRE_IJVector vector, HYPRE_BigInt *jlower, HYPRE_BigInt *jupper ); +HYPRE_Int +HYPRE_IJVectorGetLocalRange_dbl( HYPRE_IJVector vector, HYPRE_BigInt *jlower, HYPRE_BigInt *jupper ); +HYPRE_Int +HYPRE_IJVectorGetLocalRange_long_dbl( HYPRE_IJVector vector, HYPRE_BigInt *jlower, HYPRE_BigInt *jupper ); +HYPRE_Int +HYPRE_IJVectorGetLocalRange( HYPRE_IJVector vector, HYPRE_BigInt *jlower, HYPRE_BigInt *jupper ); + +HYPRE_Int +HYPRE_IJVectorGetObject_flt( HYPRE_IJVector vector, void **object ); +HYPRE_Int +HYPRE_IJVectorGetObject_dbl( HYPRE_IJVector vector, void **object ); +HYPRE_Int +HYPRE_IJVectorGetObject_long_dbl( HYPRE_IJVector vector, void **object ); +HYPRE_Int +HYPRE_IJVectorGetObject( HYPRE_IJVector vector, void **object ); + +HYPRE_Int +HYPRE_IJVectorGetObjectType_flt( HYPRE_IJVector vector, HYPRE_Int *type ); +HYPRE_Int +HYPRE_IJVectorGetObjectType_dbl( HYPRE_IJVector vector, HYPRE_Int *type ); +HYPRE_Int +HYPRE_IJVectorGetObjectType_long_dbl( HYPRE_IJVector vector, HYPRE_Int *type ); +HYPRE_Int +HYPRE_IJVectorGetObjectType( HYPRE_IJVector vector, HYPRE_Int *type ); + +HYPRE_Int +HYPRE_IJVectorGetValues_flt( HYPRE_IJVector vector, HYPRE_Int nvalues, const HYPRE_BigInt *indices, hypre_float *values ); +HYPRE_Int +HYPRE_IJVectorGetValues_dbl( HYPRE_IJVector vector, HYPRE_Int nvalues, const HYPRE_BigInt *indices, hypre_double *values ); +HYPRE_Int +HYPRE_IJVectorGetValues_long_dbl( HYPRE_IJVector vector, HYPRE_Int nvalues, const HYPRE_BigInt *indices, hypre_long_double *values ); +HYPRE_Int +HYPRE_IJVectorGetValues( HYPRE_IJVector vector, HYPRE_Int nvalues, const HYPRE_BigInt *indices, void *values ); + +HYPRE_Int +HYPRE_IJVectorInitialize_flt( HYPRE_IJVector vector ); +HYPRE_Int +HYPRE_IJVectorInitialize_dbl( HYPRE_IJVector vector ); +HYPRE_Int +HYPRE_IJVectorInitialize_long_dbl( HYPRE_IJVector vector ); +HYPRE_Int +HYPRE_IJVectorInitialize( HYPRE_IJVector vector ); + +HYPRE_Int +HYPRE_IJVectorInitializeShell_flt( HYPRE_IJVector vector ); +HYPRE_Int +HYPRE_IJVectorInitializeShell_dbl( HYPRE_IJVector vector ); +HYPRE_Int +HYPRE_IJVectorInitializeShell_long_dbl( HYPRE_IJVector vector ); +HYPRE_Int +HYPRE_IJVectorInitializeShell( HYPRE_IJVector vector ); + +HYPRE_Int +HYPRE_IJVectorInitialize_v2_flt( HYPRE_IJVector vector, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +HYPRE_IJVectorInitialize_v2_dbl( HYPRE_IJVector vector, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +HYPRE_IJVectorInitialize_v2_long_dbl( HYPRE_IJVector vector, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +HYPRE_IJVectorInitialize_v2( HYPRE_IJVector vector, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +HYPRE_IJVectorInnerProd_flt( HYPRE_IJVector x, HYPRE_IJVector y, hypre_float *prod ); +HYPRE_Int +HYPRE_IJVectorInnerProd_dbl( HYPRE_IJVector x, HYPRE_IJVector y, hypre_double *prod ); +HYPRE_Int +HYPRE_IJVectorInnerProd_long_dbl( HYPRE_IJVector x, HYPRE_IJVector y, hypre_long_double *prod ); +HYPRE_Int +HYPRE_IJVectorInnerProd( HYPRE_IJVector x, HYPRE_IJVector y, void *prod ); + +HYPRE_Int +HYPRE_IJVectorMigrate_flt( HYPRE_IJVector vector, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +HYPRE_IJVectorMigrate_dbl( HYPRE_IJVector vector, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +HYPRE_IJVectorMigrate_long_dbl( HYPRE_IJVector vector, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +HYPRE_IJVectorMigrate( HYPRE_IJVector vector, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +HYPRE_IJVectorPrint_flt( HYPRE_IJVector vector, const char *filename ); +HYPRE_Int +HYPRE_IJVectorPrint_dbl( HYPRE_IJVector vector, const char *filename ); +HYPRE_Int +HYPRE_IJVectorPrint_long_dbl( HYPRE_IJVector vector, const char *filename ); +HYPRE_Int +HYPRE_IJVectorPrint( HYPRE_IJVector vector, const char *filename ); + +HYPRE_Int +HYPRE_IJVectorPrintBinary_flt( HYPRE_IJVector vector, const char *filename ); +HYPRE_Int +HYPRE_IJVectorPrintBinary_dbl( HYPRE_IJVector vector, const char *filename ); +HYPRE_Int +HYPRE_IJVectorPrintBinary_long_dbl( HYPRE_IJVector vector, const char *filename ); +HYPRE_Int +HYPRE_IJVectorPrintBinary( HYPRE_IJVector vector, const char *filename ); + +HYPRE_Int +HYPRE_IJVectorRead_flt( const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJVector *vector ); +HYPRE_Int +HYPRE_IJVectorRead_dbl( const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJVector *vector ); +HYPRE_Int +HYPRE_IJVectorRead_long_dbl( const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJVector *vector ); +HYPRE_Int +HYPRE_IJVectorRead( const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJVector *vector ); + +HYPRE_Int +HYPRE_IJVectorReadBinary_flt( const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJVector *vector ); +HYPRE_Int +HYPRE_IJVectorReadBinary_dbl( const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJVector *vector ); +HYPRE_Int +HYPRE_IJVectorReadBinary_long_dbl( const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJVector *vector ); +HYPRE_Int +HYPRE_IJVectorReadBinary( const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJVector *vector ); + +HYPRE_Int +HYPRE_IJVectorSetComponent_flt( HYPRE_IJVector vector, HYPRE_Int component ); +HYPRE_Int +HYPRE_IJVectorSetComponent_dbl( HYPRE_IJVector vector, HYPRE_Int component ); +HYPRE_Int +HYPRE_IJVectorSetComponent_long_dbl( HYPRE_IJVector vector, HYPRE_Int component ); +HYPRE_Int +HYPRE_IJVectorSetComponent( HYPRE_IJVector vector, HYPRE_Int component ); + +HYPRE_Int +HYPRE_IJVectorSetConstantValues_flt( HYPRE_IJVector vector, hypre_float value ); +HYPRE_Int +HYPRE_IJVectorSetConstantValues_dbl( HYPRE_IJVector vector, hypre_double value ); +HYPRE_Int +HYPRE_IJVectorSetConstantValues_long_dbl( HYPRE_IJVector vector, hypre_long_double value ); +HYPRE_Int +HYPRE_IJVectorSetConstantValues( HYPRE_IJVector vector, hypre_long_double value ); + +HYPRE_Int +HYPRE_IJVectorSetData_flt( HYPRE_IJVector vector, hypre_float *data ); +HYPRE_Int +HYPRE_IJVectorSetData_dbl( HYPRE_IJVector vector, hypre_double *data ); +HYPRE_Int +HYPRE_IJVectorSetData_long_dbl( HYPRE_IJVector vector, hypre_long_double *data ); +HYPRE_Int +HYPRE_IJVectorSetData( HYPRE_IJVector vector, void *data ); + +HYPRE_Int +HYPRE_IJVectorSetMaxOffProcElmts_flt( HYPRE_IJVector vector, HYPRE_Int max_off_proc_elmts ); +HYPRE_Int +HYPRE_IJVectorSetMaxOffProcElmts_dbl( HYPRE_IJVector vector, HYPRE_Int max_off_proc_elmts ); +HYPRE_Int +HYPRE_IJVectorSetMaxOffProcElmts_long_dbl( HYPRE_IJVector vector, HYPRE_Int max_off_proc_elmts ); +HYPRE_Int +HYPRE_IJVectorSetMaxOffProcElmts( HYPRE_IJVector vector, HYPRE_Int max_off_proc_elmts ); + +HYPRE_Int +HYPRE_IJVectorSetNumComponents_flt( HYPRE_IJVector vector, HYPRE_Int num_components ); +HYPRE_Int +HYPRE_IJVectorSetNumComponents_dbl( HYPRE_IJVector vector, HYPRE_Int num_components ); +HYPRE_Int +HYPRE_IJVectorSetNumComponents_long_dbl( HYPRE_IJVector vector, HYPRE_Int num_components ); +HYPRE_Int +HYPRE_IJVectorSetNumComponents( HYPRE_IJVector vector, HYPRE_Int num_components ); + +HYPRE_Int +HYPRE_IJVectorSetObjectType_flt( HYPRE_IJVector vector, HYPRE_Int type ); +HYPRE_Int +HYPRE_IJVectorSetObjectType_dbl( HYPRE_IJVector vector, HYPRE_Int type ); +HYPRE_Int +HYPRE_IJVectorSetObjectType_long_dbl( HYPRE_IJVector vector, HYPRE_Int type ); +HYPRE_Int +HYPRE_IJVectorSetObjectType( HYPRE_IJVector vector, HYPRE_Int type ); + +HYPRE_Int +HYPRE_IJVectorSetPrintLevel_flt( HYPRE_IJVector vector, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_IJVectorSetPrintLevel_dbl( HYPRE_IJVector vector, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_IJVectorSetPrintLevel_long_dbl( HYPRE_IJVector vector, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_IJVectorSetPrintLevel( HYPRE_IJVector vector, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_IJVectorSetTags_flt( HYPRE_IJVector vector, HYPRE_Int owns_tags, HYPRE_Int num_tags, HYPRE_Int *tags ); +HYPRE_Int +HYPRE_IJVectorSetTags_dbl( HYPRE_IJVector vector, HYPRE_Int owns_tags, HYPRE_Int num_tags, HYPRE_Int *tags ); +HYPRE_Int +HYPRE_IJVectorSetTags_long_dbl( HYPRE_IJVector vector, HYPRE_Int owns_tags, HYPRE_Int num_tags, HYPRE_Int *tags ); +HYPRE_Int +HYPRE_IJVectorSetTags( HYPRE_IJVector vector, HYPRE_Int owns_tags, HYPRE_Int num_tags, HYPRE_Int *tags ); + +HYPRE_Int +HYPRE_IJVectorSetValues_flt( HYPRE_IJVector vector, HYPRE_Int nvalues, const HYPRE_BigInt *indices, const hypre_float *values ); +HYPRE_Int +HYPRE_IJVectorSetValues_dbl( HYPRE_IJVector vector, HYPRE_Int nvalues, const HYPRE_BigInt *indices, const hypre_double *values ); +HYPRE_Int +HYPRE_IJVectorSetValues_long_dbl( HYPRE_IJVector vector, HYPRE_Int nvalues, const HYPRE_BigInt *indices, const hypre_long_double *values ); +HYPRE_Int +HYPRE_IJVectorSetValues( HYPRE_IJVector vector, HYPRE_Int nvalues, const HYPRE_BigInt *indices, const void *values ); + +HYPRE_Int +HYPRE_IJVectorUpdateValues_flt( HYPRE_IJVector vector, HYPRE_Int nvalues, const HYPRE_BigInt *indices, const hypre_float *values, HYPRE_Int action ); +HYPRE_Int +HYPRE_IJVectorUpdateValues_dbl( HYPRE_IJVector vector, HYPRE_Int nvalues, const HYPRE_BigInt *indices, const hypre_double *values, HYPRE_Int action ); +HYPRE_Int +HYPRE_IJVectorUpdateValues_long_dbl( HYPRE_IJVector vector, HYPRE_Int nvalues, const HYPRE_BigInt *indices, const hypre_long_double *values, HYPRE_Int action ); +HYPRE_Int +HYPRE_IJVectorUpdateValues( HYPRE_IJVector vector, HYPRE_Int nvalues, const HYPRE_BigInt *indices, const void *values, HYPRE_Int action ); + + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_IJMatrixAdd_pre( HYPRE_Precision precision, hypre_long_double alpha, HYPRE_IJMatrix matrix_A, hypre_long_double beta, HYPRE_IJMatrix matrix_B, HYPRE_IJMatrix *matrix_C ); + +HYPRE_Int +HYPRE_IJMatrixAddToValues_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_BigInt *cols, const void *values ); + +HYPRE_Int +HYPRE_IJMatrixAddToValues2_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const void *values ); + +HYPRE_Int +HYPRE_IJMatrixAssemble_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix ); + +HYPRE_Int +HYPRE_IJMatrixCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_BigInt ilower, HYPRE_BigInt iupper, HYPRE_BigInt jlower, HYPRE_BigInt jupper, HYPRE_IJMatrix *matrix ); + +HYPRE_Int +HYPRE_IJMatrixDestroy_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix ); + +HYPRE_Int +HYPRE_IJMatrixGetGlobalInfo_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_BigInt *global_num_rows, HYPRE_BigInt *global_num_cols, HYPRE_BigInt *global_num_nonzeros ); + +HYPRE_Int +HYPRE_IJMatrixGetLocalRange_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_BigInt *ilower, HYPRE_BigInt *iupper, HYPRE_BigInt *jlower, HYPRE_BigInt *jupper ); + +HYPRE_Int +HYPRE_IJMatrixGetObject_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, void **object ); + +HYPRE_Int +HYPRE_IJMatrixGetObjectType_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_Int *type ); + +HYPRE_Int +HYPRE_IJMatrixGetRowCounts_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_BigInt *rows, HYPRE_Int *ncols ); + +HYPRE_Int +HYPRE_IJMatrixGetValues_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, HYPRE_BigInt *rows, HYPRE_BigInt *cols, void *values ); + +HYPRE_Int +HYPRE_IJMatrixGetValues2_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, HYPRE_BigInt *rows, HYPRE_Int *row_indexes, HYPRE_BigInt *cols, void *values ); + +HYPRE_Int +HYPRE_IJMatrixGetValuesAndZeroOut_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, HYPRE_BigInt *rows, HYPRE_Int *row_indexes, HYPRE_BigInt *cols, void *values ); + +HYPRE_Int +HYPRE_IJMatrixInitialize_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix ); + +HYPRE_Int +HYPRE_IJMatrixInitialize_v2_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +HYPRE_IJMatrixMigrate_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +HYPRE_IJMatrixNorm_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, void *norm ); + +HYPRE_Int +HYPRE_IJMatrixPartialClone_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix_in, HYPRE_IJMatrix *matrix_out ); + +HYPRE_Int +HYPRE_IJMatrixPrint_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, const char *filename ); + +HYPRE_Int +HYPRE_IJMatrixPrintBinary_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, const char *filename ); + +HYPRE_Int +HYPRE_IJMatrixRead_pre( HYPRE_Precision precision, const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJMatrix *matrix ); + +HYPRE_Int +HYPRE_IJMatrixReadBinary_pre( HYPRE_Precision precision, const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJMatrix *matrix_ptr ); + +HYPRE_Int +HYPRE_IJMatrixReadMM_pre( HYPRE_Precision precision, const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJMatrix *matrix ); + +HYPRE_Int +HYPRE_IJMatrixSetConstantValues_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, hypre_long_double value ); + +HYPRE_Int +HYPRE_IJMatrixSetDiagOffdSizes_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, const HYPRE_Int *diag_sizes, const HYPRE_Int *offdiag_sizes ); + +HYPRE_Int +HYPRE_IJMatrixSetEarlyAssemble_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_Int early_assemble ); + +HYPRE_Int +HYPRE_IJMatrixSetGrowFactor_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, hypre_long_double factor ); + +HYPRE_Int +HYPRE_IJMatrixSetInitAllocation_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_Int factor ); + +HYPRE_Int +HYPRE_IJMatrixSetMaxOffProcElmts_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_Int max_off_proc_elmts ); + +HYPRE_Int +HYPRE_IJMatrixSetOMPFlag_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_Int omp_flag ); + +HYPRE_Int +HYPRE_IJMatrixSetObjectType_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_Int type ); + +HYPRE_Int +HYPRE_IJMatrixSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_IJMatrixSetRowSizes_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, const HYPRE_Int *sizes ); + +HYPRE_Int +HYPRE_IJMatrixSetValues_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_BigInt *cols, const void *values ); + +HYPRE_Int +HYPRE_IJMatrixSetValues2_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const void *values ); + +HYPRE_Int +HYPRE_IJMatrixTranspose_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix_A, HYPRE_IJMatrix *matrix_AT ); + +HYPRE_Int +HYPRE_IJVectorAddToValues_pre( HYPRE_Precision precision, HYPRE_IJVector vector, HYPRE_Int nvalues, const HYPRE_BigInt *indices, const void *values ); + +HYPRE_Int +HYPRE_IJVectorAssemble_pre( HYPRE_Precision precision, HYPRE_IJVector vector ); + +HYPRE_Int +HYPRE_IJVectorCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_BigInt jlower, HYPRE_BigInt jupper, HYPRE_IJVector *vector ); + +HYPRE_Int +HYPRE_IJVectorDestroy_pre( HYPRE_Precision precision, HYPRE_IJVector vector ); + +HYPRE_Int +HYPRE_IJVectorGetLocalRange_pre( HYPRE_Precision precision, HYPRE_IJVector vector, HYPRE_BigInt *jlower, HYPRE_BigInt *jupper ); + +HYPRE_Int +HYPRE_IJVectorGetObject_pre( HYPRE_Precision precision, HYPRE_IJVector vector, void **object ); + +HYPRE_Int +HYPRE_IJVectorGetObjectType_pre( HYPRE_Precision precision, HYPRE_IJVector vector, HYPRE_Int *type ); + +HYPRE_Int +HYPRE_IJVectorGetValues_pre( HYPRE_Precision precision, HYPRE_IJVector vector, HYPRE_Int nvalues, const HYPRE_BigInt *indices, void *values ); + +HYPRE_Int +HYPRE_IJVectorInitialize_pre( HYPRE_Precision precision, HYPRE_IJVector vector ); + +HYPRE_Int +HYPRE_IJVectorInitializeShell_pre( HYPRE_Precision precision, HYPRE_IJVector vector ); + +HYPRE_Int +HYPRE_IJVectorInitialize_v2_pre( HYPRE_Precision precision, HYPRE_IJVector vector, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +HYPRE_IJVectorInnerProd_pre( HYPRE_Precision precision, HYPRE_IJVector x, HYPRE_IJVector y, void *prod ); + +HYPRE_Int +HYPRE_IJVectorMigrate_pre( HYPRE_Precision precision, HYPRE_IJVector vector, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +HYPRE_IJVectorPrint_pre( HYPRE_Precision precision, HYPRE_IJVector vector, const char *filename ); + +HYPRE_Int +HYPRE_IJVectorPrintBinary_pre( HYPRE_Precision precision, HYPRE_IJVector vector, const char *filename ); + +HYPRE_Int +HYPRE_IJVectorRead_pre( HYPRE_Precision precision, const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJVector *vector ); + +HYPRE_Int +HYPRE_IJVectorReadBinary_pre( HYPRE_Precision precision, const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJVector *vector ); + +HYPRE_Int +HYPRE_IJVectorSetComponent_pre( HYPRE_Precision precision, HYPRE_IJVector vector, HYPRE_Int component ); + +HYPRE_Int +HYPRE_IJVectorSetConstantValues_pre( HYPRE_Precision precision, HYPRE_IJVector vector, hypre_long_double value ); + +HYPRE_Int +HYPRE_IJVectorSetData_pre( HYPRE_Precision precision, HYPRE_IJVector vector, void *data ); + +HYPRE_Int +HYPRE_IJVectorSetMaxOffProcElmts_pre( HYPRE_Precision precision, HYPRE_IJVector vector, HYPRE_Int max_off_proc_elmts ); + +HYPRE_Int +HYPRE_IJVectorSetNumComponents_pre( HYPRE_Precision precision, HYPRE_IJVector vector, HYPRE_Int num_components ); + +HYPRE_Int +HYPRE_IJVectorSetObjectType_pre( HYPRE_Precision precision, HYPRE_IJVector vector, HYPRE_Int type ); + +HYPRE_Int +HYPRE_IJVectorSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_IJVector vector, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_IJVectorSetTags_pre( HYPRE_Precision precision, HYPRE_IJVector vector, HYPRE_Int owns_tags, HYPRE_Int num_tags, HYPRE_Int *tags ); + +HYPRE_Int +HYPRE_IJVectorSetValues_pre( HYPRE_Precision precision, HYPRE_IJVector vector, HYPRE_Int nvalues, const HYPRE_BigInt *indices, const void *values ); + +HYPRE_Int +HYPRE_IJVectorUpdateValues_pre( HYPRE_Precision precision, HYPRE_IJVector vector, HYPRE_Int nvalues, const HYPRE_BigInt *indices, const void *values, HYPRE_Int action ); + + +#endif + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/src/IJ_mv/IJMatrix.c b/src/IJ_mv/IJMatrix.c index 8d3c77d0e7..0f9d3b646b 100644 --- a/src/IJ_mv/IJMatrix.c +++ b/src/IJ_mv/IJMatrix.c @@ -90,9 +90,7 @@ hypre_IJMatrixSetObject( HYPRE_IJMatrix matrix, if (hypre_IJMatrixObject(ijmatrix) != NULL) { - /*hypre_printf("Referencing a new IJMatrix object can orphan an old -- "); - hypre_printf("hypre_IJMatrixSetObject\n");*/ - hypre_error(HYPRE_ERROR_GENERIC); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Referencing a new IJMatrix can orphan an old\n"); return hypre_error_flag; } diff --git a/src/IJ_mv/IJMatrix_parcsr.c b/src/IJ_mv/IJMatrix_parcsr.c index 24edb706c9..a6117f4be3 100644 --- a/src/IJ_mv/IJMatrix_parcsr.c +++ b/src/IJ_mv/IJMatrix_parcsr.c @@ -577,7 +577,7 @@ hypre_IJMatrixGetValuesParCSR( hypre_IJMatrix *matrix, counter[0] = 0; for (i = 0; i < nrows; i++) { - counter[i + 1] = counter[i] + ncols[i]; + counter[i + 1] = counter[i] + ((ncols) ? ncols[i] : 1); } indx = 0; @@ -597,7 +597,7 @@ hypre_IJMatrixGetValuesParCSR( hypre_IJMatrix *matrix, hypre_printf ("Error! Not enough memory! HYPRE_IJMatrixGetValues\n"); } } - if (ncols[i] < row_size) + if (ncols && ncols[i] < row_size) { warning = 1; } @@ -629,7 +629,7 @@ hypre_IJMatrixGetValuesParCSR( hypre_IJMatrix *matrix, } } } - if (warning) + if (warning && ncols) { for (i = 0; i < nrows; i++) { @@ -648,7 +648,7 @@ hypre_IJMatrixGetValuesParCSR( hypre_IJMatrix *matrix, for (ii = 0; ii < nrows; ii++) { row = rows[ii]; - n = ncols[ii]; + n = (ncols) ? ncols[ii] : 1; if (n == 0) /* empty row */ { continue; diff --git a/src/IJ_mv/IJMatrix_parcsr_device.c b/src/IJ_mv/IJMatrix_parcsr_device.c index f26b5a2261..4d40d7cf73 100644 --- a/src/IJ_mv/IJMatrix_parcsr_device.c +++ b/src/IJ_mv/IJMatrix_parcsr_device.c @@ -297,30 +297,26 @@ hypre_IJMatrixSetAddValuesParCSRDevice( hypre_IJMatrix *matrix, return hypre_error_flag; } -#if defined(HYPRE_USING_SYCL) +template struct hypre_IJMatrixAssembleFunctor { - template - auto operator()(const Tuple1& x, const Tuple2& y ) const - { - return Tuple1( hypre_max(std::get<0>(x), std::get<0>(y)), - std::get<1>(x) + std::get<1>(y) ); - } -}; +#if defined(HYPRE_USING_SYCL) + typedef std::tuple Tuple; #else -template -struct hypre_IJMatrixAssembleFunctor : public - thrust::binary_function< thrust::tuple, thrust::tuple, thrust::tuple > -{ typedef thrust::tuple Tuple; +#endif - __device__ Tuple operator()(const Tuple& x, const Tuple& y ) + __device__ Tuple operator()(const Tuple& x, const Tuple& y ) const { - return thrust::make_tuple( hypre_max(thrust::get<0>(x), thrust::get<0>(y)), - thrust::get<1>(x) + thrust::get<1>(y) ); +#if defined(HYPRE_USING_SYCL) + using namespace std; +#else + using namespace thrust; +#endif + return make_tuple( hypre_max(get<0>(x), get<0>(y)), + get<1>(x) + get<1>(y) ); } }; -#endif /* This helper routine is used in hypre_IJMatrixAssembleParCSRDevice on on-proc entries: * 1. sort (X0, A0) with key (I0, J0) @@ -392,7 +388,7 @@ hypre_IJMatrixAssembleSortAndReduce1(HYPRE_Int *Nptr, oneapi::dpl::make_zip_iterator(I, J), /* keys_output */ oneapi::dpl::make_zip_iterator(X, A), /* values_output */ std::equal_to< std::tuple >(), /* binary_pred */ - hypre_IJMatrixAssembleFunctor() /* binary_op */); + hypre_IJMatrixAssembleFunctor() /* binary_op */); *Nptr = std::get<0>(new_end.first.base()) - I; #else @@ -406,7 +402,7 @@ hypre_IJMatrixAssembleSortAndReduce1(HYPRE_Int *Nptr, thrust::equal_to< thrust::tuple >(), thrust::maximum() ); - HYPRE_THRUST_CALL(replace_if, A0, A0 + N0, X, thrust::identity(), 0.0); + HYPRE_THRUST_CALL(replace_if, A0, A0 + N0, X, HYPRE_THRUST_IDENTITY(char), 0.0); auto new_end = HYPRE_THRUST_CALL( reduce_by_key, @@ -434,43 +430,37 @@ hypre_IJMatrixAssembleSortAndReduce1(HYPRE_Int *Nptr, return hypre_error_flag; } -#if defined(HYPRE_USING_SYCL) +template struct hypre_IJMatrixAssembleFunctor2 { - template - __device__ auto operator()(const Tuple1& x, const Tuple2& y) const - { - const char tx = std::get<0>(x); - const char ty = std::get<0>(y); - const HYPRE_Complex vx = std::get<1>(x); - const HYPRE_Complex vy = std::get<1>(y); - const HYPRE_Complex vz = tx == 0 && ty == 0 ? vx + vy : tx ? vx : vy; - return Tuple1(char(0), vz); - } -}; +#if defined(HYPRE_USING_SYCL) + typedef std::tuple Tuple; #else -template -struct hypre_IJMatrixAssembleFunctor2 : public - thrust::binary_function< thrust::tuple, thrust::tuple, thrust::tuple > -{ typedef thrust::tuple Tuple; +#endif - __device__ Tuple operator()(const Tuple& x, const Tuple& y) + __device__ Tuple operator()(const Tuple& x, const Tuple& y) const { - const char tx = thrust::get<0>(x); - const char ty = thrust::get<0>(y); - const HYPRE_Complex vx = thrust::get<1>(x); - const HYPRE_Complex vy = thrust::get<1>(y); +#if defined(HYPRE_USING_SYCL) + using namespace std; +#else + using namespace thrust; +#endif + const char tx = get<0>(x); + const char ty = get<0>(y); + const HYPRE_Complex vx = get<1>(x); + const HYPRE_Complex vy = get<1>(y); const HYPRE_Complex vz = tx == 0 && ty == 0 ? vx + vy : tx ? vx : vy; - return thrust::make_tuple(0, vz); + return make_tuple(0, vz); } }; -#endif -/* This helper routine is for combining new entries with existing CSR. +/*-------------------------------------------------------------------------- + * This helper routine is for combining new entries with existing CSR. * Opt = 2 for diag part to keep diagonal first - = 0 for offd part - */ + * = 0 for offd part + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_IJMatrixAssembleSortAndReduce2(HYPRE_Int *Nptr, HYPRE_Int **Iptr, @@ -500,7 +490,7 @@ hypre_IJMatrixAssembleSortAndReduce2(HYPRE_Int *Nptr, oneapi::dpl::make_zip_iterator(I, J), /* keys_output */ oneapi::dpl::make_zip_iterator(X, A), /* values_output */ std::equal_to< std::tuple >(), /* binary_pred */ - hypre_IJMatrixAssembleFunctor2() /* binary_op */); + hypre_IJMatrixAssembleFunctor2() /* binary_op */); HYPRE_Int N = std::get<0>(new_end.first.base()) - I; #else @@ -534,7 +524,8 @@ hypre_IJMatrixAssembleSortAndReduce2(HYPRE_Int *Nptr, return hypre_error_flag; } -/* This is used on off-proc entries before sending them to other procs +/*-------------------------------------------------------------------------- + * This is used on off-proc entries before sending them to other procs * 1. StableSort * 2. Zero out all prior to the last set (including the set itself), since off-proc set is not allowed * 3. Reduce A (sum) by key (I, J). @@ -544,7 +535,8 @@ hypre_IJMatrixAssembleSortAndReduce2(HYPRE_Int *Nptr, * Content of X0 is destroyed * Note: * No need to reduce X, since all should be add - */ + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_IJMatrixAssembleSortAndReduce3(HYPRE_Int N0, HYPRE_BigInt *I0, @@ -597,7 +589,7 @@ hypre_IJMatrixAssembleSortAndReduce3(HYPRE_Int N0, thrust::equal_to< thrust::tuple >(), thrust::maximum() ); - HYPRE_THRUST_CALL(replace_if, A0, A0 + N0, X0, thrust::identity(), 0.0); + HYPRE_THRUST_CALL(replace_if, A0, A0 + N0, X0, HYPRE_THRUST_IDENTITY(char), 0.0); auto new_end = HYPRE_THRUST_CALL( reduce_by_key, @@ -628,7 +620,7 @@ hypre_IJMatrixAssembleSortAndReduce3(HYPRE_Int N0, thrust::make_zip_iterator(thrust::make_tuple(I + Nt, J + Nt, A + Nt)), A, thrust::make_zip_iterator(thrust::make_tuple(I0, J0, A0)), - thrust::identity() ); + HYPRE_THRUST_IDENTITY(HYPRE_Complex) ); *N1 = thrust::get<0>(new_end2.get_iterator_tuple()) - I0; #endif @@ -642,6 +634,9 @@ hypre_IJMatrixAssembleSortAndReduce3(HYPRE_Int N0, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_IJMatrixAssembleCommunicate(hypre_IJMatrix *matrix) { @@ -714,7 +709,7 @@ hypre_IJMatrixAssembleCommunicate(hypre_IJMatrix *matrix) is_on_proc, /* stencil */ thrust::make_zip_iterator(thrust::make_tuple(off_proc_i, off_proc_j, off_proc_data, off_proc_sora)), /* result */ - thrust::not1(thrust::identity()) ); + HYPRE_THRUST_NOT(HYPRE_THRUST_IDENTITY(char)) ); hypre_assert(thrust::get<0>(new_end1.get_iterator_tuple()) - off_proc_i == nelms_off); @@ -726,7 +721,7 @@ hypre_IJMatrixAssembleCommunicate(hypre_IJMatrix *matrix) thrust::make_zip_iterator(thrust::make_tuple(stack_i + nelms, stack_j + nelms, stack_data + nelms, stack_sora + nelms)), /* last */ is_on_proc, /* stencil */ - thrust::not1(thrust::identity()) ); + HYPRE_THRUST_NOT(HYPRE_THRUST_IDENTITY(char)) ); hypre_assert(thrust::get<0>(new_end2.get_iterator_tuple()) - stack_i == nelms_on); #endif @@ -752,6 +747,9 @@ hypre_IJMatrixAssembleCommunicate(hypre_IJMatrix *matrix) return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_IJMatrixAssembleCompressDevice(hypre_IJMatrix *matrix, HYPRE_Int reduce_stack_size) @@ -800,6 +798,9 @@ hypre_IJMatrixAssembleCompressDevice(hypre_IJMatrix *matrix, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_IJMatrixAssembleParCSRDevice(hypre_IJMatrix *matrix) { @@ -1060,6 +1061,11 @@ hypre_IJMatrixAssembleParCSRDevice(hypre_IJMatrix *matrix) hypre_TFree(col_map_offd_new, HYPRE_MEMORY_DEVICE); } /* if (nelms) */ + /* Generate nonzero rows in the diag and offd matrices */ + hypre_CSRMatrixSetRownnz(hypre_ParCSRMatrixDiag(par_matrix)); + hypre_CSRMatrixSetRownnz(hypre_ParCSRMatrixOffd(par_matrix)); + + /* Finalize */ hypre_IJMatrixAssembleFlag(matrix) = 1; hypre_AuxParCSRMatrixDestroy(aux_matrix); hypre_IJMatrixTranslator(matrix) = NULL; @@ -1067,6 +1073,9 @@ hypre_IJMatrixAssembleParCSRDevice(hypre_IJMatrix *matrix) return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_IJMatrixSetConstantValuesParCSRDevice( hypre_IJMatrix *matrix, HYPRE_Complex value ) @@ -1085,4 +1094,269 @@ hypre_IJMatrixSetConstantValuesParCSRDevice( hypre_IJMatrix *matrix, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +struct hypreFunctor_IJMatrixGetValues +{ + HYPRE_BigInt row_start_, row_end_; + HYPRE_BigInt col_start_, col_end_ ; + const HYPRE_Int *diag_i_, *diag_j_; + HYPRE_Complex *diag_a_; + const HYPRE_Int *offd_i_, *offd_j_; + HYPRE_Complex *offd_a_; + const HYPRE_BigInt *col_map_offd_; + const HYPRE_BigInt *rows_, *cols_; + HYPRE_Complex *values_; + HYPRE_Int zero_out_; + + __host__ __device__ + hypreFunctor_IJMatrixGetValues(HYPRE_BigInt row_start, HYPRE_BigInt row_end, + HYPRE_BigInt col_start, HYPRE_BigInt col_end, + const HYPRE_Int *diag_i, const HYPRE_Int *diag_j, + HYPRE_Complex *diag_a, + const HYPRE_Int *offd_i, const HYPRE_Int *offd_j, + HYPRE_Complex *offd_a, + const HYPRE_BigInt *col_map_offd, + const HYPRE_BigInt *rows, + const HYPRE_BigInt *cols, + HYPRE_Complex *values, HYPRE_Int zero_out) + : row_start_(row_start), row_end_(row_end), col_start_(col_start), col_end_(col_end), + diag_i_(diag_i), diag_j_(diag_j), diag_a_(diag_a), + offd_i_(offd_i), offd_j_(offd_j), offd_a_(offd_a), + col_map_offd_(col_map_offd), rows_(rows), cols_(cols), + values_(values), zero_out_(zero_out) {} + + __device__ void operator()(HYPRE_Int k) const + { + HYPRE_BigInt g_row = rows_[k]; + HYPRE_BigInt g_col = cols_[k]; + + if (g_row >= row_start_ && g_row < row_end_) + { + HYPRE_Int l_row = g_row - row_start_; + if (g_col >= col_start_ && g_col < col_end_) + { + HYPRE_Int l_col = g_col - col_start_; + const HYPRE_Int *p_begin = diag_j_ + diag_i_[l_row]; + const HYPRE_Int *p_end = diag_j_ + diag_i_[l_row + 1]; + const HYPRE_Int *p_found = p_end; + if (p_begin != p_end) + { + /* Device assembly puts diag first and sorts remaining columns in increasing order */ + if (*p_begin == l_col) + { + p_found = p_begin; + } + else + { +#if defined(HYPRE_USING_SYCL) + p_found = std::lower_bound(p_begin + 1, p_end, l_col); +#else + p_found = thrust::lower_bound(thrust::seq, p_begin + 1, p_end, l_col); +#endif + } + } + if (p_found < p_end && *p_found == l_col) + { + HYPRE_Int offset = p_found - diag_j_; + values_[k] = diag_a_[offset]; + if (zero_out_) { diag_a_[offset] = 0.0; } + } + } + else + { + for (HYPRE_Int j = offd_i_[l_row]; j < offd_i_[l_row + 1]; j++) + { + if (col_map_offd_[offd_j_[j]] == g_col) + { + values_[k] = offd_a_[j]; + if (zero_out_) { offd_a_[j] = 0.0; } + break; + } + } + } + } + } +}; + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJMatrixGetValuesParCSRDevice( hypre_IJMatrix *matrix, + HYPRE_Int nrows, + HYPRE_Int *ncols, + HYPRE_BigInt *rows, + HYPRE_Int *row_indexes, + HYPRE_BigInt *cols, + HYPRE_Complex *values, + HYPRE_Int zero_out) +{ + hypre_ParCSRMatrix *par_matrix = (hypre_ParCSRMatrix *) hypre_IJMatrixObject(matrix); + hypre_CSRMatrix *diag = hypre_ParCSRMatrixDiag(par_matrix); + hypre_CSRMatrix *offd = hypre_ParCSRMatrixOffd(par_matrix); + + HYPRE_BigInt row_start = hypre_IJMatrixRowPartitioning(matrix)[0]; + HYPRE_BigInt row_end = hypre_IJMatrixRowPartitioning(matrix)[1]; + HYPRE_BigInt col_start = hypre_IJMatrixColPartitioning(matrix)[0]; + HYPRE_BigInt col_end = hypre_IJMatrixColPartitioning(matrix)[1]; + + HYPRE_Int *diag_i = hypre_CSRMatrixI(diag); + HYPRE_Int *diag_j = hypre_CSRMatrixJ(diag); + HYPRE_Complex *diag_data = hypre_CSRMatrixData(diag); + HYPRE_Int *offd_i = hypre_CSRMatrixI(offd); + HYPRE_Int *offd_j = hypre_CSRMatrixJ(offd); + HYPRE_Complex *offd_data = hypre_CSRMatrixData(offd); + + hypre_ParCSRMatrix *h_parcsr; + HYPRE_IJMatrix h_matrix; + HYPRE_Int *h_ncols; + HYPRE_BigInt *extended_rows; + HYPRE_BigInt *h_rows, *h_cols; + HYPRE_BigInt *col_map_offd = NULL; + HYPRE_Complex *h_values; + HYPRE_Int i, num_nonzeros; + + HYPRE_Int *d_row_indexes = row_indexes; + HYPRE_Int *temp_row_indexes = NULL; + HYPRE_Int num_get_rows; + + hypre_GpuProfilingPushRange("IJMatrixGetValuesParCSR"); + + if (nrows > 0) + { + if (!d_row_indexes) + { + temp_row_indexes = hypre_TAlloc(HYPRE_Int, nrows + 1, HYPRE_MEMORY_DEVICE); + if (ncols) + { + hypre_TMemcpy(temp_row_indexes, ncols, HYPRE_Int, nrows, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_DEVICE); + hypre_Memset(temp_row_indexes + nrows, 0, sizeof(HYPRE_Int), HYPRE_MEMORY_DEVICE); + hypreDevice_IntegerExclusiveScan(nrows + 1, temp_row_indexes); + } + else + { +#if defined(HYPRE_USING_SYCL) + hypreSycl_sequence(temp_row_indexes, temp_row_indexes + nrows + 1, 0); +#else + HYPRE_THRUST_CALL(sequence, temp_row_indexes, temp_row_indexes + nrows + 1, 0); +#endif + } + d_row_indexes = temp_row_indexes; + } + + hypre_TMemcpy(&num_nonzeros, d_row_indexes + nrows, HYPRE_Int, 1, + HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + extended_rows = hypre_TAlloc(HYPRE_BigInt, num_nonzeros, HYPRE_MEMORY_DEVICE); + +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + HYPRE_THRUST_CALL(for_each, + thrust::make_counting_iterator(0), + thrust::make_counting_iterator(nrows), + [ = ] __device__ (HYPRE_Int i) + { + for (HYPRE_Int j = d_row_indexes[i]; j < d_row_indexes[i + 1]; j++) + { + extended_rows[j] = rows[i]; + } + }); +#elif defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL(for_each, + oneapi::dpl::counting_iterator(0), + oneapi::dpl::counting_iterator(nrows), + [ = ] (HYPRE_Int i) + { + for (HYPRE_Int j = d_row_indexes[i]; j < d_row_indexes[i + 1]; j++) + { + extended_rows[j] = rows[i]; + } + }); +#endif + + hypreDevice_ComplexFilln(values, num_nonzeros, 0.0); + + hypre_ParCSRMatrixCopyColMapOffdToDevice(par_matrix); + col_map_offd = hypre_ParCSRMatrixDeviceColMapOffd(par_matrix); + +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + HYPRE_THRUST_CALL(for_each, + thrust::make_counting_iterator(0), + thrust::make_counting_iterator(num_nonzeros), + hypreFunctor_IJMatrixGetValues(row_start, row_end, + col_start, col_end, + diag_i, diag_j, diag_data, + offd_i, offd_j, offd_data, + col_map_offd, extended_rows, + cols, values, zero_out)); +#elif defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL(for_each, + oneapi::dpl::counting_iterator(0), + oneapi::dpl::counting_iterator(num_nonzeros), + hypreFunctor_IJMatrixGetValues(row_start, row_end, + col_start, col_end, + diag_i, diag_j, diag_data, + offd_i, offd_j, offd_data, + col_map_offd, extended_rows, + cols, values, zero_out)); +#endif + + hypre_TFree(extended_rows, HYPRE_MEMORY_DEVICE); + hypre_TFree(temp_row_indexes, HYPRE_MEMORY_DEVICE); + } + else if (ncols) + { + /* The host implementation for this case is inherently serial. + Fallback to host by copying data. */ + num_get_rows = -nrows; + + h_parcsr = hypre_ParCSRMatrixClone_v2(par_matrix, 1, HYPRE_MEMORY_HOST ); + HYPRE_IJMatrixPartialClone(matrix, &h_matrix); + hypre_IJMatrixObject(h_matrix) = h_parcsr; + + h_ncols = hypre_TAlloc(HYPRE_Int, num_get_rows, HYPRE_MEMORY_HOST); + h_rows = hypre_TAlloc(HYPRE_BigInt, num_get_rows, HYPRE_MEMORY_HOST); + hypre_TMemcpy(h_ncols, ncols, HYPRE_Int, num_get_rows, + HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + hypre_TMemcpy(h_rows, rows, HYPRE_BigInt, num_get_rows, + HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + + for (i = 0, num_nonzeros = 0; i < num_get_rows; i++) + { + num_nonzeros += h_ncols[i]; + } + + h_cols = hypre_TAlloc(HYPRE_BigInt, num_nonzeros, HYPRE_MEMORY_HOST); + h_values = hypre_TAlloc(HYPRE_Complex, num_nonzeros, HYPRE_MEMORY_HOST); + + hypre_IJMatrixGetValuesParCSR(h_matrix, nrows, h_ncols, h_rows, NULL, + h_cols, h_values, zero_out); + + hypre_TMemcpy(ncols, h_ncols, HYPRE_Int, num_get_rows, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + hypre_TMemcpy(cols, h_cols, HYPRE_BigInt, num_nonzeros, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + hypre_TMemcpy(values, h_values, HYPRE_Complex, num_nonzeros, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + + if (zero_out) + { + /* If data was zeroed out on host, we need to copy the modified matrix back to device */ + hypre_ParCSRMatrixDestroy(par_matrix); + hypre_IJMatrixObject(matrix) = hypre_ParCSRMatrixClone_v2(h_parcsr, 1, HYPRE_MEMORY_DEVICE); + } + + hypre_TFree(h_ncols, HYPRE_MEMORY_HOST); + hypre_TFree(h_rows, HYPRE_MEMORY_HOST); + hypre_TFree(h_cols, HYPRE_MEMORY_HOST); + hypre_TFree(h_values, HYPRE_MEMORY_HOST); + HYPRE_IJMatrixDestroy(h_matrix); + } + + hypre_GpuProfilingPopRange(); + + return hypre_error_flag; +} + #endif diff --git a/src/IJ_mv/IJVector_parcsr_device.c b/src/IJ_mv/IJVector_parcsr_device.c index 92a38079b7..2f106c3907 100644 --- a/src/IJ_mv/IJVector_parcsr_device.c +++ b/src/IJ_mv/IJVector_parcsr_device.c @@ -21,30 +21,27 @@ * hypre_IJVectorAssembleFunctor *--------------------------------------------------------------------*/ -#if defined(HYPRE_USING_SYCL) +template struct hypre_IJVectorAssembleFunctor { - template - auto operator()(const Tuple1& x, const Tuple2& y ) const - { - return Tuple1( hypre_max(std::get<0>(x), std::get<0>(y)), - std::get<1>(x) + std::get<1>(y) ); - } -}; + +#if defined(HYPRE_USING_SYCL) + typedef std::tuple Tuple; #else -template -struct hypre_IJVectorAssembleFunctor : public - thrust::binary_function< thrust::tuple, thrust::tuple, thrust::tuple > -{ typedef thrust::tuple Tuple; +#endif - __device__ Tuple operator() (const Tuple& x, const Tuple& y ) + __device__ Tuple operator() (const Tuple& x, const Tuple& y ) const { - return thrust::make_tuple( hypre_max(thrust::get<0>(x), thrust::get<0>(y)), - thrust::get<1>(x) + thrust::get<1>(y) ); +#if defined(HYPRE_USING_SYCL) + using namespace std; +#else + using namespace thrust; +#endif + return make_tuple( hypre_max(get<0>(x), get<0>(y)), + get<1>(x) + get<1>(y) ); } }; -#endif /*-------------------------------------------------------------------- * hypre_IJVectorAssembleSortAndReduce1 @@ -109,7 +106,7 @@ hypre_IJVectorAssembleSortAndReduce1( HYPRE_Int N0, I, /* keys_output */ oneapi::dpl::make_zip_iterator(X, A), /* values_output */ std::equal_to(), /* binary_pred */ - hypre_IJVectorAssembleFunctor() /* binary_op */); + hypre_IJVectorAssembleFunctor() /* binary_op */); #else HYPRE_THRUST_CALL( exclusive_scan_by_key, @@ -123,7 +120,7 @@ hypre_IJVectorAssembleSortAndReduce1( HYPRE_Int N0, thrust::equal_to(), thrust::maximum() ); - HYPRE_THRUST_CALL(replace_if, A0, A0 + N0, X, thrust::identity(), 0.0); + HYPRE_THRUST_CALL(replace_if, A0, A0 + N0, X, HYPRE_THRUST_IDENTITY(char), 0.0); auto new_end = HYPRE_THRUST_CALL( reduce_by_key, @@ -205,7 +202,7 @@ hypre_IJVectorAssembleSortAndReduce3( HYPRE_Int N0, thrust::equal_to(), thrust::maximum() ); - HYPRE_THRUST_CALL(replace_if, A0, A0 + N0, X0, thrust::identity(), 0.0); + HYPRE_THRUST_CALL(replace_if, A0, A0 + N0, X0, HYPRE_THRUST_IDENTITY(char), 0.0); auto new_end = HYPRE_THRUST_CALL( reduce_by_key, @@ -235,7 +232,7 @@ hypre_IJVectorAssembleSortAndReduce3( HYPRE_Int N0, thrust::make_zip_iterator(thrust::make_tuple(I, A)) + Nt, A, thrust::make_zip_iterator(thrust::make_tuple(I0, A0)), - thrust::identity() ); + HYPRE_THRUST_IDENTITY(HYPRE_Complex) ); *N1 = thrust::get<0>(new_end2.get_iterator_tuple()) - I0; #endif @@ -491,7 +488,7 @@ hypre_IJVectorAssembleParDevice(hypre_IJVector *vector) is_on_proc, /* stencil */ thrust::make_zip_iterator(thrust::make_tuple(off_proc_i, off_proc_data, off_proc_sora)), /* result */ - HYPRE_THRUST_NOT(thrust::identity()) ); + HYPRE_THRUST_NOT(HYPRE_THRUST_IDENTITY(char)) ); hypre_assert(thrust::get<0>(new_end1.get_iterator_tuple()) - off_proc_i == nelms_off); @@ -503,7 +500,7 @@ hypre_IJVectorAssembleParDevice(hypre_IJVector *vector) thrust::make_zip_iterator(thrust::make_tuple(stack_i + nelms, stack_data + nelms, stack_sora + nelms)), /* last */ is_on_proc, /* stencil */ - HYPRE_THRUST_NOT(thrust::identity()) ); + HYPRE_THRUST_NOT(HYPRE_THRUST_IDENTITY(char)) ); hypre_assert(thrust::get<0>(new_end2.get_iterator_tuple()) - stack_i == nelms_on); #endif diff --git a/src/IJ_mv/Makefile b/src/IJ_mv/Makefile index d2f0e68094..7d7a0ca2f8 100644 --- a/src/IJ_mv/Makefile +++ b/src/IJ_mv/Makefile @@ -48,10 +48,31 @@ CUFILES =\ IJMatrix_parcsr_device.c\ IJVector_parcsr_device.c +# Mixed precision files +MP_FILES = \ + mup_fixed.c\ + mup_functions.c\ + mup_pre.c + COBJS = ${FILES:.c=.o} CUOBJS = ${CUFILES:.c=.obj} OBJS = ${COBJS} ${CUOBJS} +ifeq (${MP_BUILD}, 1) + +COBJS_single = ${FILES:.c=.o_flt} +COBJS_double = ${FILES:.c=.o_dbl} +COBJS_longdouble = ${FILES:.c=.o_ldbl} +CUOBJS_single = ${CUFILES:.c=.obj_flt} +CUOBJS_double = ${CUFILES:.c=.obj_dbl} +CUOBJS_longdouble = ${CUFILES:.c=.obj_ldbl} +MP_COBJS = ${MP_FILES:.c=.o} + +OBJS = ${COBJS_single} ${COBJS_double} ${COBJS_longdouble} ${MP_COBJS} +OBJS += ${CUOBJS_single} ${CUOBJS_double} ${CUOBJS_longdouble} + +endif + SONAME = libHYPRE_IJ_mv-${HYPRE_RELEASE_VERSION}${HYPRE_LIB_SUFFIX} ################################################################## @@ -60,16 +81,18 @@ SONAME = libHYPRE_IJ_mv-${HYPRE_RELEASE_VERSION}${HYPRE_LIB_SUFFIX} all: libHYPRE_IJ_mv${HYPRE_LIB_SUFFIX} cp -fR $(srcdir)/HYPRE_*.h $(HYPRE_BUILD_DIR)/include - cp -fR $(srcdir)/_hypre_IJ_mv.h $(HYPRE_BUILD_DIR)/include + cp -fR $(srcdir)/_hypre_*.h $(HYPRE_BUILD_DIR)/include # cp -fR libHYPRE* $(HYPRE_BUILD_DIR)/lib install: libHYPRE_IJ_mv${HYPRE_LIB_SUFFIX} cp -fR $(srcdir)/HYPRE_*.h $(HYPRE_INC_INSTALL) - cp -fR $(srcdir)/_hypre_IJ_mv.h $(HYPRE_INC_INSTALL) + cp -fR $(srcdir)/_hypre_*.h $(HYPRE_INC_INSTALL) # cp -fR libHYPRE* $(HYPRE_LIB_INSTALL) clean: rm -f *.o *.obj libHYPRE* + rm -f *.o_flt *.o_dbl *.o_ldbl + rm -f *.obj_flt *.obj_dbl *.obj_ldbl rm -rf pchdir tca.map *inslog* distclean: clean diff --git a/src/IJ_mv/_hypre_IJ_mv.h b/src/IJ_mv/_hypre_IJ_mv.h index fc110dcf82..841d342fbc 100644 --- a/src/IJ_mv/_hypre_IJ_mv.h +++ b/src/IJ_mv/_hypre_IJ_mv.h @@ -9,6 +9,10 @@ #include "HYPRE_IJ_mv.h" #include "HYPRE.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_IJ_mv_mup_def.h" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -454,9 +458,6 @@ HYPRE_Int hypre_IJMatrixGetValuesParCSR ( hypre_IJMatrix *matrix, HYPRE_Int nrow HYPRE_Int hypre_IJMatrixSetValuesParCSR ( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const HYPRE_Complex *values ); -HYPRE_Int hypre_IJMatrixSetAddValuesParCSRDevice ( hypre_IJMatrix *matrix, HYPRE_Int nrows, - HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, - const HYPRE_Complex *values, const char *action ); HYPRE_Int hypre_IJMatrixSetConstantValuesParCSR ( hypre_IJMatrix *matrix, HYPRE_Complex value ); HYPRE_Int hypre_IJMatrixAddToValuesParCSR ( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, @@ -481,15 +482,25 @@ HYPRE_Int hypre_IJMatrixSetValuesOMPParCSR ( hypre_IJMatrix *matrix, HYPRE_Int n HYPRE_Int hypre_IJMatrixAddToValuesOMPParCSR ( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const HYPRE_Complex *values ); -HYPRE_Int hypre_IJMatrixAssembleParCSRDevice(hypre_IJMatrix *matrix); HYPRE_Int hypre_IJMatrixInitializeParCSR_v2(hypre_IJMatrix *matrix, HYPRE_MemoryLocation memory_location); -HYPRE_Int hypre_IJMatrixSetConstantValuesParCSRDevice( hypre_IJMatrix *matrix, - HYPRE_Complex value ); HYPRE_Int hypre_IJMatrixMigrateParCSR(hypre_IJMatrix *matrix, HYPRE_MemoryLocation memory_location); HYPRE_Int hypre_IJMatrixAssembleCommunicate(hypre_IJMatrix *matrix); + +/* IJMatrix_parcsr_device.c */ +HYPRE_Int hypre_IJMatrixSetConstantValuesParCSRDevice( hypre_IJMatrix *matrix, + HYPRE_Complex value ); +HYPRE_Int hypre_IJMatrixSetAddValuesParCSRDevice ( hypre_IJMatrix *matrix, HYPRE_Int nrows, + HYPRE_Int *ncols, const HYPRE_BigInt *rows, + const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, + const HYPRE_Complex *values, const char *action ); +HYPRE_Int hypre_IJMatrixGetValuesParCSRDevice( hypre_IJMatrix *matrix, HYPRE_Int nrows, + HYPRE_Int *ncols, HYPRE_BigInt *rows, + HYPRE_Int *row_indexes, HYPRE_BigInt *cols, + HYPRE_Complex *values, HYPRE_Int zero_out ); HYPRE_Int hypre_IJMatrixAssembleCompressDevice(hypre_IJMatrix *matrix, HYPRE_Int reduce_stack_size); +HYPRE_Int hypre_IJMatrixAssembleParCSRDevice(hypre_IJMatrix *matrix); /* IJMatrix_petsc.c */ HYPRE_Int hypre_IJMatrixSetLocalSizePETSc ( hypre_IJMatrix *matrix, HYPRE_Int local_m, @@ -547,86 +558,31 @@ HYPRE_Int hypre_IJVectorGetValuesPar ( hypre_IJVector *vector, HYPRE_Int num_val HYPRE_Int hypre_IJVectorAssembleOffProcValsPar ( hypre_IJVector *vector, HYPRE_Int max_off_proc_elmts, HYPRE_Int current_num_elmts, HYPRE_MemoryLocation memory_location, HYPRE_BigInt *off_proc_i, HYPRE_Complex *off_proc_data ); +HYPRE_Int hypre_IJVectorMigrateParCSR(hypre_IJVector *vector, HYPRE_MemoryLocation memory_location); + +/* IJVector_parcsr_device.c */ HYPRE_Int hypre_IJVectorSetAddValuesParDevice(hypre_IJVector *vector, HYPRE_Int num_values, const HYPRE_BigInt *indices, const HYPRE_Complex *values, const char *action); HYPRE_Int hypre_IJVectorAssembleParDevice(hypre_IJVector *vector); HYPRE_Int hypre_IJVectorUpdateValuesDevice( hypre_IJVector *vector, HYPRE_Int num_values, const HYPRE_BigInt *indices, const HYPRE_Complex *values, HYPRE_Int action); -HYPRE_Int hypre_IJVectorMigrateParCSR(hypre_IJVector *vector, HYPRE_MemoryLocation memory_location); -/* HYPRE_IJMatrix.c */ -HYPRE_Int HYPRE_IJMatrixCreate ( MPI_Comm comm, HYPRE_BigInt ilower, HYPRE_BigInt iupper, - HYPRE_BigInt jlower, HYPRE_BigInt jupper, HYPRE_IJMatrix *matrix ); -HYPRE_Int HYPRE_IJMatrixPartialClone ( HYPRE_IJMatrix matrix_in, HYPRE_IJMatrix *matrix_out ); -HYPRE_Int HYPRE_IJMatrixDestroy ( HYPRE_IJMatrix matrix ); -HYPRE_Int HYPRE_IJMatrixInitialize ( HYPRE_IJMatrix matrix ); -HYPRE_Int HYPRE_IJMatrixSetPrintLevel ( HYPRE_IJMatrix matrix, HYPRE_Int print_level ); -HYPRE_Int HYPRE_IJMatrixSetValues ( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, - const HYPRE_BigInt *rows, const HYPRE_BigInt *cols, const HYPRE_Complex *values ); -HYPRE_Int HYPRE_IJMatrixSetConstantValues ( HYPRE_IJMatrix matrix, HYPRE_Complex value ); -HYPRE_Int HYPRE_IJMatrixAddToValues ( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, - const HYPRE_BigInt *rows, const HYPRE_BigInt *cols, const HYPRE_Complex *values ); -HYPRE_Int HYPRE_IJMatrixAssemble ( HYPRE_IJMatrix matrix ); -HYPRE_Int HYPRE_IJMatrixGetRowCounts ( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_BigInt *rows, - HYPRE_Int *ncols ); -HYPRE_Int HYPRE_IJMatrixGetValues ( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, - HYPRE_BigInt *rows, HYPRE_BigInt *cols, HYPRE_Complex *values ); -HYPRE_Int HYPRE_IJMatrixSetObjectType ( HYPRE_IJMatrix matrix, HYPRE_Int type ); -HYPRE_Int HYPRE_IJMatrixGetObjectType ( HYPRE_IJMatrix matrix, HYPRE_Int *type ); -HYPRE_Int HYPRE_IJMatrixGetLocalRange ( HYPRE_IJMatrix matrix, HYPRE_BigInt *ilower, - HYPRE_BigInt *iupper, HYPRE_BigInt *jlower, HYPRE_BigInt *jupper ); -HYPRE_Int HYPRE_IJMatrixGetObject ( HYPRE_IJMatrix matrix, void **object ); -HYPRE_Int HYPRE_IJMatrixSetRowSizes ( HYPRE_IJMatrix matrix, const HYPRE_Int *sizes ); -HYPRE_Int HYPRE_IJMatrixSetDiagOffdSizes ( HYPRE_IJMatrix matrix, const HYPRE_Int *diag_sizes, - const HYPRE_Int *offdiag_sizes ); -HYPRE_Int HYPRE_IJMatrixSetMaxOffProcElmts ( HYPRE_IJMatrix matrix, HYPRE_Int max_off_proc_elmts ); -HYPRE_Int HYPRE_IJMatrixRead ( const char *filename, MPI_Comm comm, HYPRE_Int type, - HYPRE_IJMatrix *matrix_ptr ); -HYPRE_Int HYPRE_IJMatrixReadBinary ( const char *filename, MPI_Comm comm, HYPRE_Int type, - HYPRE_IJMatrix *matrix_ptr ); -HYPRE_Int HYPRE_IJMatrixReadMM( const char *filename, MPI_Comm comm, HYPRE_Int type, - HYPRE_IJMatrix *matrix_ptr ); -HYPRE_Int HYPRE_IJMatrixPrint ( HYPRE_IJMatrix matrix, const char *filename ); -HYPRE_Int HYPRE_IJMatrixPrintBinary ( HYPRE_IJMatrix matrix, const char *filename ); -HYPRE_Int HYPRE_IJMatrixSetOMPFlag ( HYPRE_IJMatrix matrix, HYPRE_Int omp_flag ); -HYPRE_Int HYPRE_IJMatrixTranspose ( HYPRE_IJMatrix matrix_A, HYPRE_IJMatrix *matrix_AT ); -HYPRE_Int HYPRE_IJMatrixNorm ( HYPRE_IJMatrix matrix, HYPRE_Real *norm ); -HYPRE_Int HYPRE_IJMatrixAdd ( HYPRE_Complex alpha, HYPRE_IJMatrix matrix_A, HYPRE_Complex beta, - HYPRE_IJMatrix matrix_B, HYPRE_IJMatrix *matrix_C ); - -/* HYPRE_IJVector.c */ -HYPRE_Int HYPRE_IJVectorCreate ( MPI_Comm comm, HYPRE_BigInt jlower, HYPRE_BigInt jupper, - HYPRE_IJVector *vector ); -HYPRE_Int HYPRE_IJVectorSetNumComponents ( HYPRE_IJVector vector, HYPRE_Int num_components ); -HYPRE_Int HYPRE_IJVectorSetComponent ( HYPRE_IJVector vector, HYPRE_Int component ); -HYPRE_Int HYPRE_IJVectorDestroy ( HYPRE_IJVector vector ); -HYPRE_Int HYPRE_IJVectorInitialize ( HYPRE_IJVector vector ); -HYPRE_Int HYPRE_IJVectorSetPrintLevel ( HYPRE_IJVector vector, HYPRE_Int print_level ); -HYPRE_Int HYPRE_IJVectorSetValues ( HYPRE_IJVector vector, HYPRE_Int nvalues, - const HYPRE_BigInt *indices, const HYPRE_Complex *values ); -HYPRE_Int HYPRE_IJVectorSetConstantValues ( HYPRE_IJVector vector, HYPRE_Complex value ); -HYPRE_Int HYPRE_IJVectorAddToValues ( HYPRE_IJVector vector, HYPRE_Int nvalues, - const HYPRE_BigInt *indices, const HYPRE_Complex *values ); -HYPRE_Int HYPRE_IJVectorAssemble ( HYPRE_IJVector vector ); -HYPRE_Int HYPRE_IJVectorGetValues ( HYPRE_IJVector vector, HYPRE_Int nvalues, - const HYPRE_BigInt *indices, HYPRE_Complex *values ); -HYPRE_Int HYPRE_IJVectorSetMaxOffProcElmts ( HYPRE_IJVector vector, HYPRE_Int max_off_proc_elmts ); -HYPRE_Int HYPRE_IJVectorSetObjectType ( HYPRE_IJVector vector, HYPRE_Int type ); -HYPRE_Int HYPRE_IJVectorGetObjectType ( HYPRE_IJVector vector, HYPRE_Int *type ); -HYPRE_Int HYPRE_IJVectorGetLocalRange ( HYPRE_IJVector vector, HYPRE_BigInt *jlower, - HYPRE_BigInt *jupper ); -HYPRE_Int HYPRE_IJVectorGetObject ( HYPRE_IJVector vector, void **object ); -HYPRE_Int HYPRE_IJVectorRead ( const char *filename, MPI_Comm comm, HYPRE_Int type, - HYPRE_IJVector *vector_ptr ); -HYPRE_Int HYPRE_IJVectorReadBinary ( const char *filename, MPI_Comm comm, HYPRE_Int type, - HYPRE_IJVector *vector_ptr ); -HYPRE_Int HYPRE_IJVectorPrint ( HYPRE_IJVector vector, const char *filename ); -HYPRE_Int HYPRE_IJVectorPrintBinary ( HYPRE_IJVector vector, const char *filename ); -HYPRE_Int HYPRE_IJVectorInnerProd ( HYPRE_IJVector x, HYPRE_IJVector y, HYPRE_Real *prod ); + #ifdef __cplusplus } #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_IJ_mv_mup_undef.h" +#include "_hypre_IJ_mv_mup.h" +#endif +#endif + #endif diff --git a/src/IJ_mv/_hypre_IJ_mv_mup.h b/src/IJ_mv/_hypre_IJ_mv_mup.h new file mode 100644 index 0000000000..accdaa9363 --- /dev/null +++ b/src/IJ_mv/_hypre_IJ_mv_mup.h @@ -0,0 +1,480 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#ifndef hypre_IJ_MV_MUP_HEADER +#define hypre_IJ_MV_MUP_HEADER + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (HYPRE_MIXED_PRECISION) + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +hypre_AuxParCSRMatrixCreate_flt( hypre_AuxParCSRMatrix **aux_matrix, HYPRE_Int local_num_rows, HYPRE_Int local_num_cols, HYPRE_Int *sizes ); +HYPRE_Int +hypre_AuxParCSRMatrixCreate_dbl( hypre_AuxParCSRMatrix **aux_matrix, HYPRE_Int local_num_rows, HYPRE_Int local_num_cols, HYPRE_Int *sizes ); +HYPRE_Int +hypre_AuxParCSRMatrixCreate_long_dbl( hypre_AuxParCSRMatrix **aux_matrix, HYPRE_Int local_num_rows, HYPRE_Int local_num_cols, HYPRE_Int *sizes ); + +HYPRE_Int +hypre_AuxParCSRMatrixDestroy_flt( hypre_AuxParCSRMatrix *matrix ); +HYPRE_Int +hypre_AuxParCSRMatrixDestroy_dbl( hypre_AuxParCSRMatrix *matrix ); +HYPRE_Int +hypre_AuxParCSRMatrixDestroy_long_dbl( hypre_AuxParCSRMatrix *matrix ); + +HYPRE_Int +hypre_AuxParCSRMatrixInitialize_flt( hypre_AuxParCSRMatrix *matrix ); +HYPRE_Int +hypre_AuxParCSRMatrixInitialize_dbl( hypre_AuxParCSRMatrix *matrix ); +HYPRE_Int +hypre_AuxParCSRMatrixInitialize_long_dbl( hypre_AuxParCSRMatrix *matrix ); + +HYPRE_Int +hypre_AuxParCSRMatrixInitialize_v2_flt( hypre_AuxParCSRMatrix *matrix, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_AuxParCSRMatrixInitialize_v2_dbl( hypre_AuxParCSRMatrix *matrix, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_AuxParCSRMatrixInitialize_v2_long_dbl( hypre_AuxParCSRMatrix *matrix, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +hypre_AuxParCSRMatrixSetRownnz_flt( hypre_AuxParCSRMatrix *matrix ); +HYPRE_Int +hypre_AuxParCSRMatrixSetRownnz_dbl( hypre_AuxParCSRMatrix *matrix ); +HYPRE_Int +hypre_AuxParCSRMatrixSetRownnz_long_dbl( hypre_AuxParCSRMatrix *matrix ); + +HYPRE_Int +hypre_AuxParVectorCreate_flt( hypre_AuxParVector **aux_vector ); +HYPRE_Int +hypre_AuxParVectorCreate_dbl( hypre_AuxParVector **aux_vector ); +HYPRE_Int +hypre_AuxParVectorCreate_long_dbl( hypre_AuxParVector **aux_vector ); + +HYPRE_Int +hypre_AuxParVectorDestroy_flt( hypre_AuxParVector *vector ); +HYPRE_Int +hypre_AuxParVectorDestroy_dbl( hypre_AuxParVector *vector ); +HYPRE_Int +hypre_AuxParVectorDestroy_long_dbl( hypre_AuxParVector *vector ); + +HYPRE_Int +hypre_AuxParVectorInitialize_v2_flt( hypre_AuxParVector *vector, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_AuxParVectorInitialize_v2_dbl( hypre_AuxParVector *vector, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_AuxParVectorInitialize_v2_long_dbl( hypre_AuxParVector *vector, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +hypre_FillResponseIJOffProcVals_flt( 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_FillResponseIJOffProcVals_dbl( 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_FillResponseIJOffProcVals_long_dbl( 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_FindProc_flt( HYPRE_BigInt *list, HYPRE_BigInt value, HYPRE_Int list_length ); +HYPRE_Int +hypre_FindProc_dbl( HYPRE_BigInt *list, HYPRE_BigInt value, HYPRE_Int list_length ); +HYPRE_Int +hypre_FindProc_long_dbl( HYPRE_BigInt *list, HYPRE_BigInt value, HYPRE_Int list_length ); + +HYPRE_Int +hypre_IJMatrixAddParCSR_flt( hypre_float alpha, hypre_IJMatrix *matrix_A, hypre_float beta, hypre_IJMatrix *matrix_B, hypre_IJMatrix *matrix_C ); +HYPRE_Int +hypre_IJMatrixAddParCSR_dbl( hypre_double alpha, hypre_IJMatrix *matrix_A, hypre_double beta, hypre_IJMatrix *matrix_B, hypre_IJMatrix *matrix_C ); +HYPRE_Int +hypre_IJMatrixAddParCSR_long_dbl( hypre_long_double alpha, hypre_IJMatrix *matrix_A, hypre_long_double beta, hypre_IJMatrix *matrix_B, hypre_IJMatrix *matrix_C ); + +HYPRE_Int +hypre_IJMatrixAddToValuesOMPParCSR_flt( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const hypre_float *values ); +HYPRE_Int +hypre_IJMatrixAddToValuesOMPParCSR_dbl( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const hypre_double *values ); +HYPRE_Int +hypre_IJMatrixAddToValuesOMPParCSR_long_dbl( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const hypre_long_double *values ); + +HYPRE_Int +hypre_IJMatrixAddToValuesParCSR_flt( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const hypre_float *values ); +HYPRE_Int +hypre_IJMatrixAddToValuesParCSR_dbl( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const hypre_double *values ); +HYPRE_Int +hypre_IJMatrixAddToValuesParCSR_long_dbl( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const hypre_long_double *values ); + +HYPRE_Int +hypre_IJMatrixAssembleOffProcValsParCSR_flt( hypre_IJMatrix *matrix, HYPRE_Int off_proc_i_indx, HYPRE_Int max_off_proc_elmts, HYPRE_Int current_num_elmts, HYPRE_MemoryLocation memory_location, HYPRE_BigInt *off_proc_i, HYPRE_BigInt *off_proc_j, hypre_float *off_proc_data ); +HYPRE_Int +hypre_IJMatrixAssembleOffProcValsParCSR_dbl( hypre_IJMatrix *matrix, HYPRE_Int off_proc_i_indx, HYPRE_Int max_off_proc_elmts, HYPRE_Int current_num_elmts, HYPRE_MemoryLocation memory_location, HYPRE_BigInt *off_proc_i, HYPRE_BigInt *off_proc_j, hypre_double *off_proc_data ); +HYPRE_Int +hypre_IJMatrixAssembleOffProcValsParCSR_long_dbl( hypre_IJMatrix *matrix, HYPRE_Int off_proc_i_indx, HYPRE_Int max_off_proc_elmts, HYPRE_Int current_num_elmts, HYPRE_MemoryLocation memory_location, HYPRE_BigInt *off_proc_i, HYPRE_BigInt *off_proc_j, hypre_long_double *off_proc_data ); + +HYPRE_Int +hypre_IJMatrixAssembleParCSR_flt( hypre_IJMatrix *matrix ); +HYPRE_Int +hypre_IJMatrixAssembleParCSR_dbl( hypre_IJMatrix *matrix ); +HYPRE_Int +hypre_IJMatrixAssembleParCSR_long_dbl( hypre_IJMatrix *matrix ); + +HYPRE_Int +hypre_IJMatrixCreateAssumedPartition_flt( hypre_IJMatrix *matrix ); +HYPRE_Int +hypre_IJMatrixCreateAssumedPartition_dbl( hypre_IJMatrix *matrix ); +HYPRE_Int +hypre_IJMatrixCreateAssumedPartition_long_dbl( hypre_IJMatrix *matrix ); + +HYPRE_Int +hypre_IJMatrixCreateParCSR_flt( hypre_IJMatrix *matrix ); +HYPRE_Int +hypre_IJMatrixCreateParCSR_dbl( hypre_IJMatrix *matrix ); +HYPRE_Int +hypre_IJMatrixCreateParCSR_long_dbl( hypre_IJMatrix *matrix ); + +HYPRE_Int +hypre_IJMatrixDestroyParCSR_flt( hypre_IJMatrix *matrix ); +HYPRE_Int +hypre_IJMatrixDestroyParCSR_dbl( hypre_IJMatrix *matrix ); +HYPRE_Int +hypre_IJMatrixDestroyParCSR_long_dbl( hypre_IJMatrix *matrix ); + +HYPRE_Int +hypre_IJMatrixGetColPartitioning_flt( HYPRE_IJMatrix matrix, HYPRE_BigInt **col_partitioning ); +HYPRE_Int +hypre_IJMatrixGetColPartitioning_dbl( HYPRE_IJMatrix matrix, HYPRE_BigInt **col_partitioning ); +HYPRE_Int +hypre_IJMatrixGetColPartitioning_long_dbl( HYPRE_IJMatrix matrix, HYPRE_BigInt **col_partitioning ); + +HYPRE_Int +hypre_IJMatrixGetRowCountsParCSR_flt( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_BigInt *rows, HYPRE_Int *ncols ); +HYPRE_Int +hypre_IJMatrixGetRowCountsParCSR_dbl( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_BigInt *rows, HYPRE_Int *ncols ); +HYPRE_Int +hypre_IJMatrixGetRowCountsParCSR_long_dbl( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_BigInt *rows, HYPRE_Int *ncols ); + +HYPRE_Int +hypre_IJMatrixGetRowPartitioning_flt( HYPRE_IJMatrix matrix, HYPRE_BigInt **row_partitioning ); +HYPRE_Int +hypre_IJMatrixGetRowPartitioning_dbl( HYPRE_IJMatrix matrix, HYPRE_BigInt **row_partitioning ); +HYPRE_Int +hypre_IJMatrixGetRowPartitioning_long_dbl( HYPRE_IJMatrix matrix, HYPRE_BigInt **row_partitioning ); + +HYPRE_Int +hypre_IJMatrixGetValuesParCSR_flt( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, HYPRE_BigInt *rows, HYPRE_Int *row_indexes, HYPRE_BigInt *cols, hypre_float *values, HYPRE_Int zero_out ); +HYPRE_Int +hypre_IJMatrixGetValuesParCSR_dbl( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, HYPRE_BigInt *rows, HYPRE_Int *row_indexes, HYPRE_BigInt *cols, hypre_double *values, HYPRE_Int zero_out ); +HYPRE_Int +hypre_IJMatrixGetValuesParCSR_long_dbl( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, HYPRE_BigInt *rows, HYPRE_Int *row_indexes, HYPRE_BigInt *cols, hypre_long_double *values, HYPRE_Int zero_out ); + +HYPRE_Int +hypre_IJMatrixInitializeParCSR_flt( hypre_IJMatrix *matrix ); +HYPRE_Int +hypre_IJMatrixInitializeParCSR_dbl( hypre_IJMatrix *matrix ); +HYPRE_Int +hypre_IJMatrixInitializeParCSR_long_dbl( hypre_IJMatrix *matrix ); + +HYPRE_Int +hypre_IJMatrixInitializeParCSR_v2_flt( hypre_IJMatrix *matrix, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_IJMatrixInitializeParCSR_v2_dbl( hypre_IJMatrix *matrix, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_IJMatrixInitializeParCSR_v2_long_dbl( hypre_IJMatrix *matrix, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +hypre_IJMatrixMigrateParCSR_flt( hypre_IJMatrix *matrix, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_IJMatrixMigrateParCSR_dbl( hypre_IJMatrix *matrix, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_IJMatrixMigrateParCSR_long_dbl( hypre_IJMatrix *matrix, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +hypre_IJMatrixNormParCSR_flt( hypre_IJMatrix *matrix, hypre_float *norm ); +HYPRE_Int +hypre_IJMatrixNormParCSR_dbl( hypre_IJMatrix *matrix, hypre_double *norm ); +HYPRE_Int +hypre_IJMatrixNormParCSR_long_dbl( hypre_IJMatrix *matrix, hypre_long_double *norm ); + +HYPRE_Int +hypre_IJMatrixRead_flt( const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJMatrix *matrix_ptr, HYPRE_Int is_mm ); +HYPRE_Int +hypre_IJMatrixRead_dbl( const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJMatrix *matrix_ptr, HYPRE_Int is_mm ); +HYPRE_Int +hypre_IJMatrixRead_long_dbl( const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJMatrix *matrix_ptr, HYPRE_Int is_mm ); + +HYPRE_Int +hypre_IJMatrixReadBinary_flt( const char *prefixname, MPI_Comm comm, HYPRE_Int type, HYPRE_IJMatrix *matrix_ptr ); +HYPRE_Int +hypre_IJMatrixReadBinary_dbl( const char *prefixname, MPI_Comm comm, HYPRE_Int type, HYPRE_IJMatrix *matrix_ptr ); +HYPRE_Int +hypre_IJMatrixReadBinary_long_dbl( const char *prefixname, MPI_Comm comm, HYPRE_Int type, HYPRE_IJMatrix *matrix_ptr ); + +HYPRE_Int +hypre_IJMatrixSetConstantValuesParCSR_flt( hypre_IJMatrix *matrix, hypre_float value ); +HYPRE_Int +hypre_IJMatrixSetConstantValuesParCSR_dbl( hypre_IJMatrix *matrix, hypre_double value ); +HYPRE_Int +hypre_IJMatrixSetConstantValuesParCSR_long_dbl( hypre_IJMatrix *matrix, hypre_long_double value ); + +HYPRE_Int +hypre_IJMatrixSetDiagOffdSizesParCSR_flt( hypre_IJMatrix *matrix, const HYPRE_Int *diag_sizes, const HYPRE_Int *offdiag_sizes ); +HYPRE_Int +hypre_IJMatrixSetDiagOffdSizesParCSR_dbl( hypre_IJMatrix *matrix, const HYPRE_Int *diag_sizes, const HYPRE_Int *offdiag_sizes ); +HYPRE_Int +hypre_IJMatrixSetDiagOffdSizesParCSR_long_dbl( hypre_IJMatrix *matrix, const HYPRE_Int *diag_sizes, const HYPRE_Int *offdiag_sizes ); + +HYPRE_Int +hypre_IJMatrixSetEarlyAssembleParCSR_flt( hypre_IJMatrix *matrix, HYPRE_Int early_assemble ); +HYPRE_Int +hypre_IJMatrixSetEarlyAssembleParCSR_dbl( hypre_IJMatrix *matrix, HYPRE_Int early_assemble ); +HYPRE_Int +hypre_IJMatrixSetEarlyAssembleParCSR_long_dbl( hypre_IJMatrix *matrix, HYPRE_Int early_assemble ); + +HYPRE_Int +hypre_IJMatrixSetGrowFactorParCSR_flt( hypre_IJMatrix *matrix, hypre_float factor ); +HYPRE_Int +hypre_IJMatrixSetGrowFactorParCSR_dbl( hypre_IJMatrix *matrix, hypre_double factor ); +HYPRE_Int +hypre_IJMatrixSetGrowFactorParCSR_long_dbl( hypre_IJMatrix *matrix, hypre_long_double factor ); + +HYPRE_Int +hypre_IJMatrixSetInitAllocationParCSR_flt( hypre_IJMatrix *matrix, HYPRE_Int factor ); +HYPRE_Int +hypre_IJMatrixSetInitAllocationParCSR_dbl( hypre_IJMatrix *matrix, HYPRE_Int factor ); +HYPRE_Int +hypre_IJMatrixSetInitAllocationParCSR_long_dbl( hypre_IJMatrix *matrix, HYPRE_Int factor ); + +HYPRE_Int +hypre_IJMatrixSetMaxOffProcElmtsParCSR_flt( hypre_IJMatrix *matrix, HYPRE_Int max_off_proc_elmts ); +HYPRE_Int +hypre_IJMatrixSetMaxOffProcElmtsParCSR_dbl( hypre_IJMatrix *matrix, HYPRE_Int max_off_proc_elmts ); +HYPRE_Int +hypre_IJMatrixSetMaxOffProcElmtsParCSR_long_dbl( hypre_IJMatrix *matrix, HYPRE_Int max_off_proc_elmts ); + +HYPRE_Int +hypre_IJMatrixSetObject_flt( HYPRE_IJMatrix matrix, void *object ); +HYPRE_Int +hypre_IJMatrixSetObject_dbl( HYPRE_IJMatrix matrix, void *object ); +HYPRE_Int +hypre_IJMatrixSetObject_long_dbl( HYPRE_IJMatrix matrix, void *object ); + +HYPRE_Int +hypre_IJMatrixSetRowSizesParCSR_flt( hypre_IJMatrix *matrix, const HYPRE_Int *sizes ); +HYPRE_Int +hypre_IJMatrixSetRowSizesParCSR_dbl( hypre_IJMatrix *matrix, const HYPRE_Int *sizes ); +HYPRE_Int +hypre_IJMatrixSetRowSizesParCSR_long_dbl( hypre_IJMatrix *matrix, const HYPRE_Int *sizes ); + +HYPRE_Int +hypre_IJMatrixSetValuesOMPParCSR_flt( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const hypre_float *values ); +HYPRE_Int +hypre_IJMatrixSetValuesOMPParCSR_dbl( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const hypre_double *values ); +HYPRE_Int +hypre_IJMatrixSetValuesOMPParCSR_long_dbl( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const hypre_long_double *values ); + +HYPRE_Int +hypre_IJMatrixSetValuesParCSR_flt( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const hypre_float *values ); +HYPRE_Int +hypre_IJMatrixSetValuesParCSR_dbl( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const hypre_double *values ); +HYPRE_Int +hypre_IJMatrixSetValuesParCSR_long_dbl( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const hypre_long_double *values ); + +HYPRE_Int +hypre_IJMatrixTransposeParCSR_flt( hypre_IJMatrix *matrix_A, hypre_IJMatrix *matrix_AT ); +HYPRE_Int +hypre_IJMatrixTransposeParCSR_dbl( hypre_IJMatrix *matrix_A, hypre_IJMatrix *matrix_AT ); +HYPRE_Int +hypre_IJMatrixTransposeParCSR_long_dbl( hypre_IJMatrix *matrix_A, hypre_IJMatrix *matrix_AT ); + +HYPRE_Int +hypre_IJVectorAddToValuesPar_flt( hypre_IJVector *vector, HYPRE_Int num_values, const HYPRE_BigInt *indices, const hypre_float *values ); +HYPRE_Int +hypre_IJVectorAddToValuesPar_dbl( hypre_IJVector *vector, HYPRE_Int num_values, const HYPRE_BigInt *indices, const hypre_double *values ); +HYPRE_Int +hypre_IJVectorAddToValuesPar_long_dbl( hypre_IJVector *vector, HYPRE_Int num_values, const HYPRE_BigInt *indices, const hypre_long_double *values ); + +HYPRE_Int +hypre_IJVectorAssembleOffProcValsPar_flt( hypre_IJVector *vector, HYPRE_Int max_off_proc_elmts, HYPRE_Int current_num_elmts, HYPRE_MemoryLocation memory_location, HYPRE_BigInt *off_proc_i, hypre_float *off_proc_data ); +HYPRE_Int +hypre_IJVectorAssembleOffProcValsPar_dbl( hypre_IJVector *vector, HYPRE_Int max_off_proc_elmts, HYPRE_Int current_num_elmts, HYPRE_MemoryLocation memory_location, HYPRE_BigInt *off_proc_i, hypre_double *off_proc_data ); +HYPRE_Int +hypre_IJVectorAssembleOffProcValsPar_long_dbl( hypre_IJVector *vector, HYPRE_Int max_off_proc_elmts, HYPRE_Int current_num_elmts, HYPRE_MemoryLocation memory_location, HYPRE_BigInt *off_proc_i, hypre_long_double *off_proc_data ); + +HYPRE_Int +hypre_IJVectorAssemblePar_flt( hypre_IJVector *vector ); +HYPRE_Int +hypre_IJVectorAssemblePar_dbl( hypre_IJVector *vector ); +HYPRE_Int +hypre_IJVectorAssemblePar_long_dbl( hypre_IJVector *vector ); + +HYPRE_Int +hypre_IJVectorCreateAssumedPartition_flt( hypre_IJVector *vector ); +HYPRE_Int +hypre_IJVectorCreateAssumedPartition_dbl( hypre_IJVector *vector ); +HYPRE_Int +hypre_IJVectorCreateAssumedPartition_long_dbl( hypre_IJVector *vector ); + +HYPRE_Int +hypre_IJVectorCreatePar_flt( hypre_IJVector *vector, HYPRE_BigInt *IJpartitioning ); +HYPRE_Int +hypre_IJVectorCreatePar_dbl( hypre_IJVector *vector, HYPRE_BigInt *IJpartitioning ); +HYPRE_Int +hypre_IJVectorCreatePar_long_dbl( hypre_IJVector *vector, HYPRE_BigInt *IJpartitioning ); + +HYPRE_Int +hypre_IJVectorDestroyPar_flt( hypre_IJVector *vector ); +HYPRE_Int +hypre_IJVectorDestroyPar_dbl( hypre_IJVector *vector ); +HYPRE_Int +hypre_IJVectorDestroyPar_long_dbl( hypre_IJVector *vector ); + +HYPRE_Int +hypre_IJVectorDistribute_flt( HYPRE_IJVector vector, const HYPRE_Int *vec_starts ); +HYPRE_Int +hypre_IJVectorDistribute_dbl( HYPRE_IJVector vector, const HYPRE_Int *vec_starts ); +HYPRE_Int +hypre_IJVectorDistribute_long_dbl( HYPRE_IJVector vector, const HYPRE_Int *vec_starts ); + +HYPRE_Int +hypre_IJVectorDistributePar_flt( hypre_IJVector *vector, const HYPRE_Int *vec_starts ); +HYPRE_Int +hypre_IJVectorDistributePar_dbl( hypre_IJVector *vector, const HYPRE_Int *vec_starts ); +HYPRE_Int +hypre_IJVectorDistributePar_long_dbl( hypre_IJVector *vector, const HYPRE_Int *vec_starts ); + +HYPRE_Int +hypre_IJVectorGetValuesPar_flt( hypre_IJVector *vector, HYPRE_Int num_values, const HYPRE_BigInt *indices, hypre_float *values ); +HYPRE_Int +hypre_IJVectorGetValuesPar_dbl( hypre_IJVector *vector, HYPRE_Int num_values, const HYPRE_BigInt *indices, hypre_double *values ); +HYPRE_Int +hypre_IJVectorGetValuesPar_long_dbl( hypre_IJVector *vector, HYPRE_Int num_values, const HYPRE_BigInt *indices, hypre_long_double *values ); + +HYPRE_Int +hypre_IJVectorInitializePar_flt( hypre_IJVector *vector ); +HYPRE_Int +hypre_IJVectorInitializePar_dbl( hypre_IJVector *vector ); +HYPRE_Int +hypre_IJVectorInitializePar_long_dbl( hypre_IJVector *vector ); + +HYPRE_Int +hypre_IJVectorInitializeParShell_flt( hypre_IJVector *vector ); +HYPRE_Int +hypre_IJVectorInitializeParShell_dbl( hypre_IJVector *vector ); +HYPRE_Int +hypre_IJVectorInitializeParShell_long_dbl( hypre_IJVector *vector ); + +HYPRE_Int +hypre_IJVectorInitializePar_v2_flt( hypre_IJVector *vector, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_IJVectorInitializePar_v2_dbl( hypre_IJVector *vector, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_IJVectorInitializePar_v2_long_dbl( hypre_IJVector *vector, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +hypre_IJVectorMigrateParCSR_flt( hypre_IJVector *vector, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_IJVectorMigrateParCSR_dbl( hypre_IJVector *vector, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_IJVectorMigrateParCSR_long_dbl( hypre_IJVector *vector, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +hypre_IJVectorReadBinary_flt( MPI_Comm comm, const char *filename, HYPRE_Int type, HYPRE_IJVector *vector_ptr ); +HYPRE_Int +hypre_IJVectorReadBinary_dbl( MPI_Comm comm, const char *filename, HYPRE_Int type, HYPRE_IJVector *vector_ptr ); +HYPRE_Int +hypre_IJVectorReadBinary_long_dbl( MPI_Comm comm, const char *filename, HYPRE_Int type, HYPRE_IJVector *vector_ptr ); + +HYPRE_Int +hypre_IJVectorSetComponentPar_flt( hypre_IJVector *vector, HYPRE_Int component ); +HYPRE_Int +hypre_IJVectorSetComponentPar_dbl( hypre_IJVector *vector, HYPRE_Int component ); +HYPRE_Int +hypre_IJVectorSetComponentPar_long_dbl( hypre_IJVector *vector, HYPRE_Int component ); + +HYPRE_Int +hypre_IJVectorSetConstantValuesPar_flt( hypre_IJVector *vector, hypre_float value ); +HYPRE_Int +hypre_IJVectorSetConstantValuesPar_dbl( hypre_IJVector *vector, hypre_double value ); +HYPRE_Int +hypre_IJVectorSetConstantValuesPar_long_dbl( hypre_IJVector *vector, hypre_long_double value ); + +HYPRE_Int +hypre_IJVectorSetMaxOffProcElmtsPar_flt( hypre_IJVector *vector, HYPRE_Int max_off_proc_elmts ); +HYPRE_Int +hypre_IJVectorSetMaxOffProcElmtsPar_dbl( hypre_IJVector *vector, HYPRE_Int max_off_proc_elmts ); +HYPRE_Int +hypre_IJVectorSetMaxOffProcElmtsPar_long_dbl( hypre_IJVector *vector, HYPRE_Int max_off_proc_elmts ); + +HYPRE_Int +hypre_IJVectorSetParData_flt( hypre_IJVector *vector, hypre_float *data ); +HYPRE_Int +hypre_IJVectorSetParData_dbl( hypre_IJVector *vector, hypre_double *data ); +HYPRE_Int +hypre_IJVectorSetParData_long_dbl( hypre_IJVector *vector, hypre_long_double *data ); + +HYPRE_Int +hypre_IJVectorSetTagsPar_flt( hypre_IJVector *vector, HYPRE_Int owns_tags, HYPRE_Int num_tags, HYPRE_Int *tags ); +HYPRE_Int +hypre_IJVectorSetTagsPar_dbl( hypre_IJVector *vector, HYPRE_Int owns_tags, HYPRE_Int num_tags, HYPRE_Int *tags ); +HYPRE_Int +hypre_IJVectorSetTagsPar_long_dbl( hypre_IJVector *vector, HYPRE_Int owns_tags, HYPRE_Int num_tags, HYPRE_Int *tags ); + +HYPRE_Int +hypre_IJVectorSetValuesPar_flt( hypre_IJVector *vector, HYPRE_Int num_values, const HYPRE_BigInt *indices, const hypre_float *values ); +HYPRE_Int +hypre_IJVectorSetValuesPar_dbl( hypre_IJVector *vector, HYPRE_Int num_values, const HYPRE_BigInt *indices, const hypre_double *values ); +HYPRE_Int +hypre_IJVectorSetValuesPar_long_dbl( hypre_IJVector *vector, HYPRE_Int num_values, const HYPRE_BigInt *indices, const hypre_long_double *values ); + +HYPRE_Int +hypre_IJVectorZeroValues_flt( HYPRE_IJVector vector ); +HYPRE_Int +hypre_IJVectorZeroValues_dbl( HYPRE_IJVector vector ); +HYPRE_Int +hypre_IJVectorZeroValues_long_dbl( HYPRE_IJVector vector ); + +HYPRE_Int +hypre_IJVectorZeroValuesPar_flt( hypre_IJVector *vector ); +HYPRE_Int +hypre_IJVectorZeroValuesPar_dbl( hypre_IJVector *vector ); +HYPRE_Int +hypre_IJVectorZeroValuesPar_long_dbl( hypre_IJVector *vector ); + + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + + + +#endif + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/src/IJ_mv/_hypre_IJ_mv_mup_def.h b/src/IJ_mv/_hypre_IJ_mv_mup_def.h new file mode 100644 index 0000000000..9cbfa154ac --- /dev/null +++ b/src/IJ_mv/_hypre_IJ_mv_mup_def.h @@ -0,0 +1,184 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#ifndef hypre_IJ_MV_MUP_DEF_HEADER +#define hypre_IJ_MV_MUP_DEF_HEADER + +#include "_hypre_mup_def.h" + +#define HYPRE_IJMatrixAdd HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixAdd ) +#define HYPRE_IJMatrixAddToValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixAddToValues ) +#define HYPRE_IJMatrixAddToValues2 HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixAddToValues2 ) +#define HYPRE_IJMatrixAssemble HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixAssemble ) +#define HYPRE_IJMatrixCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixCreate ) +#define HYPRE_IJMatrixDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixDestroy ) +#define HYPRE_IJMatrixGetGlobalInfo HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixGetGlobalInfo ) +#define HYPRE_IJMatrixGetLocalRange HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixGetLocalRange ) +#define HYPRE_IJMatrixGetObject HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixGetObject ) +#define HYPRE_IJMatrixGetObjectType HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixGetObjectType ) +#define HYPRE_IJMatrixGetRowCounts HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixGetRowCounts ) +#define HYPRE_IJMatrixGetValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixGetValues ) +#define HYPRE_IJMatrixGetValues2 HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixGetValues2 ) +#define HYPRE_IJMatrixGetValuesAndZeroOut HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixGetValuesAndZeroOut ) +#define HYPRE_IJMatrixInitialize HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixInitialize ) +#define HYPRE_IJMatrixInitialize_v2 HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixInitialize_v2 ) +#define HYPRE_IJMatrixMigrate HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixMigrate ) +#define HYPRE_IJMatrixNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixNorm ) +#define HYPRE_IJMatrixPartialClone HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixPartialClone ) +#define HYPRE_IJMatrixPrint HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixPrint ) +#define HYPRE_IJMatrixPrintBinary HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixPrintBinary ) +#define HYPRE_IJMatrixRead HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixRead ) +#define HYPRE_IJMatrixReadBinary HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixReadBinary ) +#define HYPRE_IJMatrixReadMM HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixReadMM ) +#define HYPRE_IJMatrixSetConstantValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixSetConstantValues ) +#define HYPRE_IJMatrixSetDiagOffdSizes HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixSetDiagOffdSizes ) +#define HYPRE_IJMatrixSetEarlyAssemble HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixSetEarlyAssemble ) +#define HYPRE_IJMatrixSetGrowFactor HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixSetGrowFactor ) +#define HYPRE_IJMatrixSetInitAllocation HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixSetInitAllocation ) +#define HYPRE_IJMatrixSetMaxOffProcElmts HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixSetMaxOffProcElmts ) +#define HYPRE_IJMatrixSetOMPFlag HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixSetOMPFlag ) +#define HYPRE_IJMatrixSetObjectType HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixSetObjectType ) +#define HYPRE_IJMatrixSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixSetPrintLevel ) +#define HYPRE_IJMatrixSetRowSizes HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixSetRowSizes ) +#define HYPRE_IJMatrixSetValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixSetValues ) +#define HYPRE_IJMatrixSetValues2 HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixSetValues2 ) +#define HYPRE_IJMatrixTranspose HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJMatrixTranspose ) +#define HYPRE_IJVectorAddToValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJVectorAddToValues ) +#define HYPRE_IJVectorAssemble HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJVectorAssemble ) +#define HYPRE_IJVectorCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJVectorCreate ) +#define HYPRE_IJVectorDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJVectorDestroy ) +#define HYPRE_IJVectorGetLocalRange HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJVectorGetLocalRange ) +#define HYPRE_IJVectorGetObject HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJVectorGetObject ) +#define HYPRE_IJVectorGetObjectType HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJVectorGetObjectType ) +#define HYPRE_IJVectorGetValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJVectorGetValues ) +#define HYPRE_IJVectorInitialize HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJVectorInitialize ) +#define HYPRE_IJVectorInitializeShell HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJVectorInitializeShell ) +#define HYPRE_IJVectorInitialize_v2 HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJVectorInitialize_v2 ) +#define HYPRE_IJVectorInnerProd HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJVectorInnerProd ) +#define HYPRE_IJVectorMigrate HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJVectorMigrate ) +#define HYPRE_IJVectorPrint HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJVectorPrint ) +#define HYPRE_IJVectorPrintBinary HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJVectorPrintBinary ) +#define HYPRE_IJVectorRead HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJVectorRead ) +#define HYPRE_IJVectorReadBinary HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJVectorReadBinary ) +#define HYPRE_IJVectorSetComponent HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJVectorSetComponent ) +#define HYPRE_IJVectorSetConstantValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJVectorSetConstantValues ) +#define HYPRE_IJVectorSetData HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJVectorSetData ) +#define HYPRE_IJVectorSetMaxOffProcElmts HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJVectorSetMaxOffProcElmts ) +#define HYPRE_IJVectorSetNumComponents HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJVectorSetNumComponents ) +#define HYPRE_IJVectorSetObjectType HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJVectorSetObjectType ) +#define HYPRE_IJVectorSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJVectorSetPrintLevel ) +#define HYPRE_IJVectorSetTags HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJVectorSetTags ) +#define HYPRE_IJVectorSetValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJVectorSetValues ) +#define HYPRE_IJVectorUpdateValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_IJVectorUpdateValues ) +#define hypre_AuxParCSRMatrixCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_AuxParCSRMatrixCreate ) +#define hypre_AuxParCSRMatrixDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_AuxParCSRMatrixDestroy ) +#define hypre_AuxParCSRMatrixInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_AuxParCSRMatrixInitialize ) +#define hypre_AuxParCSRMatrixInitialize_v2 HYPRE_FIXEDPRECISION_FUNC ( hypre_AuxParCSRMatrixInitialize_v2 ) +#define hypre_AuxParCSRMatrixSetRownnz HYPRE_FIXEDPRECISION_FUNC ( hypre_AuxParCSRMatrixSetRownnz ) +#define hypre_AuxParVectorCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_AuxParVectorCreate ) +#define hypre_AuxParVectorDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_AuxParVectorDestroy ) +#define hypre_AuxParVectorInitialize_v2 HYPRE_FIXEDPRECISION_FUNC ( hypre_AuxParVectorInitialize_v2 ) +#define hypre_FillResponseIJOffProcVals HYPRE_FIXEDPRECISION_FUNC ( hypre_FillResponseIJOffProcVals ) +#define hypre_FindProc HYPRE_FIXEDPRECISION_FUNC ( hypre_FindProc ) +#define hypre_IJMatrixAddParCSR HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixAddParCSR ) +#define hypre_IJMatrixAddToValuesOMPParCSR HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixAddToValuesOMPParCSR ) +#define hypre_IJMatrixAddToValuesParCSR HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixAddToValuesParCSR ) +#define hypre_IJMatrixAssembleOffProcValsParCSR HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixAssembleOffProcValsParCSR ) +#define hypre_IJMatrixAssembleParCSR HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixAssembleParCSR ) +#define hypre_IJMatrixCreateAssumedPartition HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixCreateAssumedPartition ) +#define hypre_IJMatrixCreateParCSR HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixCreateParCSR ) +#define hypre_IJMatrixDestroyParCSR HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixDestroyParCSR ) +#define hypre_IJMatrixGetColPartitioning HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixGetColPartitioning ) +#define hypre_IJMatrixGetRowCountsParCSR HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixGetRowCountsParCSR ) +#define hypre_IJMatrixGetRowPartitioning HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixGetRowPartitioning ) +#define hypre_IJMatrixGetValuesParCSR HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixGetValuesParCSR ) +#define hypre_IJMatrixInitializeParCSR HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixInitializeParCSR ) +#define hypre_IJMatrixInitializeParCSR_v2 HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixInitializeParCSR_v2 ) +#define hypre_IJMatrixMigrateParCSR HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixMigrateParCSR ) +#define hypre_IJMatrixNormParCSR HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixNormParCSR ) +#define hypre_IJMatrixRead HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixRead ) +#define hypre_IJMatrixReadBinary HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixReadBinary ) +#define hypre_IJMatrixSetConstantValuesParCSR HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixSetConstantValuesParCSR ) +#define hypre_IJMatrixSetConstantValuesParCSRHost HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixSetConstantValuesParCSRHost ) +#define hypre_IJMatrixSetDiagOffdSizesParCSR HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixSetDiagOffdSizesParCSR ) +#define hypre_IJMatrixSetEarlyAssembleParCSR HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixSetEarlyAssembleParCSR ) +#define hypre_IJMatrixSetGrowFactorParCSR HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixSetGrowFactorParCSR ) +#define hypre_IJMatrixSetInitAllocationParCSR HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixSetInitAllocationParCSR ) +#define hypre_IJMatrixSetMaxOffProcElmtsParCSR HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixSetMaxOffProcElmtsParCSR ) +#define hypre_IJMatrixSetMaxOnProcElmtsParCSR HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixSetMaxOnProcElmtsParCSR ) +#define hypre_IJMatrixSetObject HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixSetObject ) +#define hypre_IJMatrixSetRowSizesParCSR HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixSetRowSizesParCSR ) +#define hypre_IJMatrixSetValuesOMPParCSR HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixSetValuesOMPParCSR ) +#define hypre_IJMatrixSetValuesParCSR HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixSetValuesParCSR ) +#define hypre_IJMatrixTransposeParCSR HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixTransposeParCSR ) +#define hypre_IJVectorAddToValuesPar HYPRE_FIXEDPRECISION_FUNC ( hypre_IJVectorAddToValuesPar ) +#define hypre_IJVectorAssembleOffProcValsPar HYPRE_FIXEDPRECISION_FUNC ( hypre_IJVectorAssembleOffProcValsPar ) +#define hypre_IJVectorAssemblePar HYPRE_FIXEDPRECISION_FUNC ( hypre_IJVectorAssemblePar ) +#define hypre_IJVectorCreateAssumedPartition HYPRE_FIXEDPRECISION_FUNC ( hypre_IJVectorCreateAssumedPartition ) +#define hypre_IJVectorCreatePar HYPRE_FIXEDPRECISION_FUNC ( hypre_IJVectorCreatePar ) +#define hypre_IJVectorDestroyPar HYPRE_FIXEDPRECISION_FUNC ( hypre_IJVectorDestroyPar ) +#define hypre_IJVectorDistribute HYPRE_FIXEDPRECISION_FUNC ( hypre_IJVectorDistribute ) +#define hypre_IJVectorDistributePar HYPRE_FIXEDPRECISION_FUNC ( hypre_IJVectorDistributePar ) +#define hypre_IJVectorGetValuesPar HYPRE_FIXEDPRECISION_FUNC ( hypre_IJVectorGetValuesPar ) +#define hypre_IJVectorInitializePar HYPRE_FIXEDPRECISION_FUNC ( hypre_IJVectorInitializePar ) +#define hypre_IJVectorInitializeParShell HYPRE_FIXEDPRECISION_FUNC ( hypre_IJVectorInitializeParShell ) +#define hypre_IJVectorInitializePar_v2 HYPRE_FIXEDPRECISION_FUNC ( hypre_IJVectorInitializePar_v2 ) +#define hypre_IJVectorMigrateParCSR HYPRE_FIXEDPRECISION_FUNC ( hypre_IJVectorMigrateParCSR ) +#define hypre_IJVectorReadBinary HYPRE_FIXEDPRECISION_FUNC ( hypre_IJVectorReadBinary ) +#define hypre_IJVectorSetComponentPar HYPRE_FIXEDPRECISION_FUNC ( hypre_IJVectorSetComponentPar ) +#define hypre_IJVectorSetConstantValuesPar HYPRE_FIXEDPRECISION_FUNC ( hypre_IJVectorSetConstantValuesPar ) +#define hypre_IJVectorSetMaxOffProcElmtsPar HYPRE_FIXEDPRECISION_FUNC ( hypre_IJVectorSetMaxOffProcElmtsPar ) +#define hypre_IJVectorSetParData HYPRE_FIXEDPRECISION_FUNC ( hypre_IJVectorSetParData ) +#define hypre_IJVectorSetTagsPar HYPRE_FIXEDPRECISION_FUNC ( hypre_IJVectorSetTagsPar ) +#define hypre_IJVectorSetValuesPar HYPRE_FIXEDPRECISION_FUNC ( hypre_IJVectorSetValuesPar ) +#define hypre_IJVectorZeroValues HYPRE_FIXEDPRECISION_FUNC ( hypre_IJVectorZeroValues ) +#define hypre_IJVectorZeroValuesPar HYPRE_FIXEDPRECISION_FUNC ( hypre_IJVectorZeroValuesPar ) +#define hypre_ijmatrixaddtovalues HYPRE_FIXEDPRECISION_FUNC ( hypre_ijmatrixaddtovalues ) +#define hypre_ijmatrixassemble HYPRE_FIXEDPRECISION_FUNC ( hypre_ijmatrixassemble ) +#define hypre_ijmatrixcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_ijmatrixcreate ) +#define hypre_ijmatrixdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_ijmatrixdestroy ) +#define hypre_ijmatrixgetglobalinfo HYPRE_FIXEDPRECISION_FUNC ( hypre_ijmatrixgetglobalinfo ) +#define hypre_ijmatrixgetlocalrange HYPRE_FIXEDPRECISION_FUNC ( hypre_ijmatrixgetlocalrange ) +#define hypre_ijmatrixgetobject HYPRE_FIXEDPRECISION_FUNC ( hypre_ijmatrixgetobject ) +#define hypre_ijmatrixgetobjecttype HYPRE_FIXEDPRECISION_FUNC ( hypre_ijmatrixgetobjecttype ) +#define hypre_ijmatrixgetrowcounts HYPRE_FIXEDPRECISION_FUNC ( hypre_ijmatrixgetrowcounts ) +#define hypre_ijmatrixgetvalues HYPRE_FIXEDPRECISION_FUNC ( hypre_ijmatrixgetvalues ) +#define hypre_ijmatrixinitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_ijmatrixinitialize ) +#define hypre_ijmatrixinitialize_v2 HYPRE_FIXEDPRECISION_FUNC ( hypre_ijmatrixinitialize_v2 ) +#define hypre_ijmatrixmigrate HYPRE_FIXEDPRECISION_FUNC ( hypre_ijmatrixmigrate ) +#define hypre_ijmatrixprint HYPRE_FIXEDPRECISION_FUNC ( hypre_ijmatrixprint ) +#define hypre_ijmatrixread HYPRE_FIXEDPRECISION_FUNC ( hypre_ijmatrixread ) +#define hypre_ijmatrixsetconstantvalues HYPRE_FIXEDPRECISION_FUNC ( hypre_ijmatrixsetconstantvalues ) +#define hypre_ijmatrixsetdiagoffdsizes HYPRE_FIXEDPRECISION_FUNC ( hypre_ijmatrixsetdiagoffdsizes ) +#define hypre_ijmatrixsetmaxoffprocelmt HYPRE_FIXEDPRECISION_FUNC ( hypre_ijmatrixsetmaxoffprocelmt ) +#define hypre_ijmatrixsetobject HYPRE_FIXEDPRECISION_FUNC ( hypre_ijmatrixsetobject ) +#define hypre_ijmatrixsetobjecttype HYPRE_FIXEDPRECISION_FUNC ( hypre_ijmatrixsetobjecttype ) +#define hypre_ijmatrixsetrowsizes HYPRE_FIXEDPRECISION_FUNC ( hypre_ijmatrixsetrowsizes ) +#define hypre_ijmatrixsetvalues HYPRE_FIXEDPRECISION_FUNC ( hypre_ijmatrixsetvalues ) +#define hypre_ijvectoraddtovalues HYPRE_FIXEDPRECISION_FUNC ( hypre_ijvectoraddtovalues ) +#define hypre_ijvectorassemble HYPRE_FIXEDPRECISION_FUNC ( hypre_ijvectorassemble ) +#define hypre_ijvectorcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_ijvectorcreate ) +#define hypre_ijvectordestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_ijvectordestroy ) +#define hypre_ijvectorgetlocalrange HYPRE_FIXEDPRECISION_FUNC ( hypre_ijvectorgetlocalrange ) +#define hypre_ijvectorgetobject HYPRE_FIXEDPRECISION_FUNC ( hypre_ijvectorgetobject ) +#define hypre_ijvectorgetobjecttype HYPRE_FIXEDPRECISION_FUNC ( hypre_ijvectorgetobjecttype ) +#define hypre_ijvectorgetvalues HYPRE_FIXEDPRECISION_FUNC ( hypre_ijvectorgetvalues ) +#define hypre_ijvectorinitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_ijvectorinitialize ) +#define hypre_ijvectorinitialize_v2 HYPRE_FIXEDPRECISION_FUNC ( hypre_ijvectorinitialize_v2 ) +#define hypre_ijvectormigrate HYPRE_FIXEDPRECISION_FUNC ( hypre_ijvectormigrate ) +#define hypre_ijvectorprint HYPRE_FIXEDPRECISION_FUNC ( hypre_ijvectorprint ) +#define hypre_ijvectorread HYPRE_FIXEDPRECISION_FUNC ( hypre_ijvectorread ) +#define hypre_ijvectorsetmaxoffprocelmt HYPRE_FIXEDPRECISION_FUNC ( hypre_ijvectorsetmaxoffprocelmt ) +#define hypre_ijvectorsetobjecttype HYPRE_FIXEDPRECISION_FUNC ( hypre_ijvectorsetobjecttype ) +#define hypre_ijvectorsetvalues HYPRE_FIXEDPRECISION_FUNC ( hypre_ijvectorsetvalues ) + +#endif diff --git a/src/IJ_mv/_hypre_IJ_mv_mup_undef.h b/src/IJ_mv/_hypre_IJ_mv_mup_undef.h new file mode 100644 index 0000000000..e123a57762 --- /dev/null +++ b/src/IJ_mv/_hypre_IJ_mv_mup_undef.h @@ -0,0 +1,179 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#undef hypre_IJ_MV_MUP_DEF_HEADER + +#undef HYPRE_IJMatrixAdd +#undef HYPRE_IJMatrixAddToValues +#undef HYPRE_IJMatrixAddToValues2 +#undef HYPRE_IJMatrixAssemble +#undef HYPRE_IJMatrixCreate +#undef HYPRE_IJMatrixDestroy +#undef HYPRE_IJMatrixGetGlobalInfo +#undef HYPRE_IJMatrixGetLocalRange +#undef HYPRE_IJMatrixGetObject +#undef HYPRE_IJMatrixGetObjectType +#undef HYPRE_IJMatrixGetRowCounts +#undef HYPRE_IJMatrixGetValues +#undef HYPRE_IJMatrixGetValues2 +#undef HYPRE_IJMatrixGetValuesAndZeroOut +#undef HYPRE_IJMatrixInitialize +#undef HYPRE_IJMatrixInitialize_v2 +#undef HYPRE_IJMatrixMigrate +#undef HYPRE_IJMatrixNorm +#undef HYPRE_IJMatrixPartialClone +#undef HYPRE_IJMatrixPrint +#undef HYPRE_IJMatrixPrintBinary +#undef HYPRE_IJMatrixRead +#undef HYPRE_IJMatrixReadBinary +#undef HYPRE_IJMatrixReadMM +#undef HYPRE_IJMatrixSetConstantValues +#undef HYPRE_IJMatrixSetDiagOffdSizes +#undef HYPRE_IJMatrixSetEarlyAssemble +#undef HYPRE_IJMatrixSetGrowFactor +#undef HYPRE_IJMatrixSetInitAllocation +#undef HYPRE_IJMatrixSetMaxOffProcElmts +#undef HYPRE_IJMatrixSetOMPFlag +#undef HYPRE_IJMatrixSetObjectType +#undef HYPRE_IJMatrixSetPrintLevel +#undef HYPRE_IJMatrixSetRowSizes +#undef HYPRE_IJMatrixSetValues +#undef HYPRE_IJMatrixSetValues2 +#undef HYPRE_IJMatrixTranspose +#undef HYPRE_IJVectorAddToValues +#undef HYPRE_IJVectorAssemble +#undef HYPRE_IJVectorCreate +#undef HYPRE_IJVectorDestroy +#undef HYPRE_IJVectorGetLocalRange +#undef HYPRE_IJVectorGetObject +#undef HYPRE_IJVectorGetObjectType +#undef HYPRE_IJVectorGetValues +#undef HYPRE_IJVectorInitialize +#undef HYPRE_IJVectorInitializeShell +#undef HYPRE_IJVectorInitialize_v2 +#undef HYPRE_IJVectorInnerProd +#undef HYPRE_IJVectorMigrate +#undef HYPRE_IJVectorPrint +#undef HYPRE_IJVectorPrintBinary +#undef HYPRE_IJVectorRead +#undef HYPRE_IJVectorReadBinary +#undef HYPRE_IJVectorSetComponent +#undef HYPRE_IJVectorSetConstantValues +#undef HYPRE_IJVectorSetData +#undef HYPRE_IJVectorSetMaxOffProcElmts +#undef HYPRE_IJVectorSetNumComponents +#undef HYPRE_IJVectorSetObjectType +#undef HYPRE_IJVectorSetPrintLevel +#undef HYPRE_IJVectorSetTags +#undef HYPRE_IJVectorSetValues +#undef HYPRE_IJVectorUpdateValues +#undef hypre_AuxParCSRMatrixCreate +#undef hypre_AuxParCSRMatrixDestroy +#undef hypre_AuxParCSRMatrixInitialize +#undef hypre_AuxParCSRMatrixInitialize_v2 +#undef hypre_AuxParCSRMatrixSetRownnz +#undef hypre_AuxParVectorCreate +#undef hypre_AuxParVectorDestroy +#undef hypre_AuxParVectorInitialize_v2 +#undef hypre_FillResponseIJOffProcVals +#undef hypre_FindProc +#undef hypre_IJMatrixAddParCSR +#undef hypre_IJMatrixAddToValuesOMPParCSR +#undef hypre_IJMatrixAddToValuesParCSR +#undef hypre_IJMatrixAssembleOffProcValsParCSR +#undef hypre_IJMatrixAssembleParCSR +#undef hypre_IJMatrixCreateAssumedPartition +#undef hypre_IJMatrixCreateParCSR +#undef hypre_IJMatrixDestroyParCSR +#undef hypre_IJMatrixGetColPartitioning +#undef hypre_IJMatrixGetRowCountsParCSR +#undef hypre_IJMatrixGetRowPartitioning +#undef hypre_IJMatrixGetValuesParCSR +#undef hypre_IJMatrixInitializeParCSR +#undef hypre_IJMatrixInitializeParCSR_v2 +#undef hypre_IJMatrixMigrateParCSR +#undef hypre_IJMatrixNormParCSR +#undef hypre_IJMatrixRead +#undef hypre_IJMatrixReadBinary +#undef hypre_IJMatrixSetConstantValuesParCSR +#undef hypre_IJMatrixSetConstantValuesParCSRHost +#undef hypre_IJMatrixSetDiagOffdSizesParCSR +#undef hypre_IJMatrixSetEarlyAssembleParCSR +#undef hypre_IJMatrixSetGrowFactorParCSR +#undef hypre_IJMatrixSetInitAllocationParCSR +#undef hypre_IJMatrixSetMaxOffProcElmtsParCSR +#undef hypre_IJMatrixSetMaxOnProcElmtsParCSR +#undef hypre_IJMatrixSetObject +#undef hypre_IJMatrixSetRowSizesParCSR +#undef hypre_IJMatrixSetValuesOMPParCSR +#undef hypre_IJMatrixSetValuesParCSR +#undef hypre_IJMatrixTransposeParCSR +#undef hypre_IJVectorAddToValuesPar +#undef hypre_IJVectorAssembleOffProcValsPar +#undef hypre_IJVectorAssemblePar +#undef hypre_IJVectorCreateAssumedPartition +#undef hypre_IJVectorCreatePar +#undef hypre_IJVectorDestroyPar +#undef hypre_IJVectorDistribute +#undef hypre_IJVectorDistributePar +#undef hypre_IJVectorGetValuesPar +#undef hypre_IJVectorInitializePar +#undef hypre_IJVectorInitializeParShell +#undef hypre_IJVectorInitializePar_v2 +#undef hypre_IJVectorMigrateParCSR +#undef hypre_IJVectorReadBinary +#undef hypre_IJVectorSetComponentPar +#undef hypre_IJVectorSetConstantValuesPar +#undef hypre_IJVectorSetMaxOffProcElmtsPar +#undef hypre_IJVectorSetParData +#undef hypre_IJVectorSetTagsPar +#undef hypre_IJVectorSetValuesPar +#undef hypre_IJVectorZeroValues +#undef hypre_IJVectorZeroValuesPar +#undef hypre_ijmatrixaddtovalues +#undef hypre_ijmatrixassemble +#undef hypre_ijmatrixcreate +#undef hypre_ijmatrixdestroy +#undef hypre_ijmatrixgetglobalinfo +#undef hypre_ijmatrixgetlocalrange +#undef hypre_ijmatrixgetobject +#undef hypre_ijmatrixgetobjecttype +#undef hypre_ijmatrixgetrowcounts +#undef hypre_ijmatrixgetvalues +#undef hypre_ijmatrixinitialize +#undef hypre_ijmatrixinitialize_v2 +#undef hypre_ijmatrixmigrate +#undef hypre_ijmatrixprint +#undef hypre_ijmatrixread +#undef hypre_ijmatrixsetconstantvalues +#undef hypre_ijmatrixsetdiagoffdsizes +#undef hypre_ijmatrixsetmaxoffprocelmt +#undef hypre_ijmatrixsetobject +#undef hypre_ijmatrixsetobjecttype +#undef hypre_ijmatrixsetrowsizes +#undef hypre_ijmatrixsetvalues +#undef hypre_ijvectoraddtovalues +#undef hypre_ijvectorassemble +#undef hypre_ijvectorcreate +#undef hypre_ijvectordestroy +#undef hypre_ijvectorgetlocalrange +#undef hypre_ijvectorgetobject +#undef hypre_ijvectorgetobjecttype +#undef hypre_ijvectorgetvalues +#undef hypre_ijvectorinitialize +#undef hypre_ijvectorinitialize_v2 +#undef hypre_ijvectormigrate +#undef hypre_ijvectorprint +#undef hypre_ijvectorread +#undef hypre_ijvectorsetmaxoffprocelmt +#undef hypre_ijvectorsetobjecttype +#undef hypre_ijvectorsetvalues diff --git a/src/IJ_mv/headers b/src/IJ_mv/headers index 7e3457612a..450f0a0ef9 100755 --- a/src/IJ_mv/headers +++ b/src/IJ_mv/headers @@ -22,6 +22,10 @@ cat > $INTERNAL_HEADER <<@ #include "HYPRE_IJ_mv.h" #include "HYPRE.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_IJ_mv_mup_def.h" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -52,6 +56,17 @@ cat >> $INTERNAL_HEADER <<@ } #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_IJ_mv_mup_undef.h" +#include "_hypre_IJ_mv_mup.h" +#endif +#endif + #endif @ diff --git a/src/IJ_mv/mup.fixed b/src/IJ_mv/mup.fixed new file mode 100644 index 0000000000..3064f1cbd1 --- /dev/null +++ b/src/IJ_mv/mup.fixed @@ -0,0 +1,101 @@ +hypre_AuxParCSRMatrixCreate +hypre_AuxParCSRMatrixDestroy +hypre_AuxParCSRMatrixInitialize +hypre_AuxParCSRMatrixInitialize_v2 +hypre_AuxParCSRMatrixSetRownnz +hypre_AuxParVectorCreate +hypre_AuxParVectorDestroy +hypre_AuxParVectorInitialize_v2 +hypre_FillResponseIJOffProcVals +hypre_FindProc +hypre_IJMatrixAddParCSR +hypre_IJMatrixAddToValuesOMPParCSR +hypre_IJMatrixAddToValuesParCSR +hypre_IJMatrixAssembleOffProcValsParCSR +hypre_IJMatrixAssembleParCSR +hypre_IJMatrixCreateAssumedPartition +hypre_IJMatrixCreateParCSR +hypre_IJMatrixDestroyParCSR +hypre_IJMatrixGetColPartitioning +hypre_IJMatrixGetRowCountsParCSR +hypre_IJMatrixGetRowPartitioning +hypre_IJMatrixGetValuesParCSR +hypre_IJMatrixInitializeParCSR +hypre_IJMatrixInitializeParCSR_v2 +hypre_IJMatrixMigrateParCSR +hypre_IJMatrixNormParCSR +hypre_IJMatrixRead +hypre_IJMatrixReadBinary +hypre_IJMatrixSetConstantValuesParCSR +hypre_IJMatrixSetConstantValuesParCSRHost +hypre_IJMatrixSetDiagOffdSizesParCSR +hypre_IJMatrixSetEarlyAssembleParCSR +hypre_IJMatrixSetGrowFactorParCSR +hypre_IJMatrixSetInitAllocationParCSR +hypre_IJMatrixSetMaxOffProcElmtsParCSR +hypre_IJMatrixSetMaxOnProcElmtsParCSR +hypre_IJMatrixSetObject +hypre_IJMatrixSetRowSizesParCSR +hypre_IJMatrixSetValuesOMPParCSR +hypre_IJMatrixSetValuesParCSR +hypre_IJMatrixTransposeParCSR +hypre_IJVectorAddToValuesPar +hypre_IJVectorAssembleOffProcValsPar +hypre_IJVectorAssemblePar +hypre_IJVectorCreateAssumedPartition +hypre_IJVectorCreatePar +hypre_IJVectorDestroyPar +hypre_IJVectorDistribute +hypre_IJVectorDistributePar +hypre_IJVectorGetValuesPar +hypre_IJVectorInitializePar +hypre_IJVectorInitializeParShell +hypre_IJVectorInitializePar_v2 +hypre_IJVectorMigrateParCSR +hypre_IJVectorReadBinary +hypre_IJVectorSetComponentPar +hypre_IJVectorSetConstantValuesPar +hypre_IJVectorSetMaxOffProcElmtsPar +hypre_IJVectorSetParData +hypre_IJVectorSetTagsPar +hypre_IJVectorSetValuesPar +hypre_IJVectorZeroValues +hypre_IJVectorZeroValuesPar +hypre_ijmatrixaddtovalues +hypre_ijmatrixassemble +hypre_ijmatrixcreate +hypre_ijmatrixdestroy +hypre_ijmatrixgetglobalinfo +hypre_ijmatrixgetlocalrange +hypre_ijmatrixgetobject +hypre_ijmatrixgetobjecttype +hypre_ijmatrixgetrowcounts +hypre_ijmatrixgetvalues +hypre_ijmatrixinitialize +hypre_ijmatrixinitialize_v2 +hypre_ijmatrixmigrate +hypre_ijmatrixprint +hypre_ijmatrixread +hypre_ijmatrixsetconstantvalues +hypre_ijmatrixsetdiagoffdsizes +hypre_ijmatrixsetmaxoffprocelmt +hypre_ijmatrixsetobject +hypre_ijmatrixsetobjecttype +hypre_ijmatrixsetrowsizes +hypre_ijmatrixsetvalues +hypre_ijvectoraddtovalues +hypre_ijvectorassemble +hypre_ijvectorcreate +hypre_ijvectordestroy +hypre_ijvectorgetlocalrange +hypre_ijvectorgetobject +hypre_ijvectorgetobjecttype +hypre_ijvectorgetvalues +hypre_ijvectorinitialize +hypre_ijvectorinitialize_v2 +hypre_ijvectormigrate +hypre_ijvectorprint +hypre_ijvectorread +hypre_ijvectorsetmaxoffprocelmt +hypre_ijvectorsetobjecttype +hypre_ijvectorsetvalues diff --git a/src/IJ_mv/mup.functions b/src/IJ_mv/mup.functions new file mode 100644 index 0000000000..127cd04a16 --- /dev/null +++ b/src/IJ_mv/mup.functions @@ -0,0 +1,64 @@ +HYPRE_IJMatrixAdd +HYPRE_IJMatrixAddToValues +HYPRE_IJMatrixAddToValues2 +HYPRE_IJMatrixAssemble +HYPRE_IJMatrixCreate +HYPRE_IJMatrixDestroy +HYPRE_IJMatrixGetGlobalInfo +HYPRE_IJMatrixGetLocalRange +HYPRE_IJMatrixGetObject +HYPRE_IJMatrixGetObjectType +HYPRE_IJMatrixGetRowCounts +HYPRE_IJMatrixGetValues +HYPRE_IJMatrixGetValues2 +HYPRE_IJMatrixGetValuesAndZeroOut +HYPRE_IJMatrixInitialize +HYPRE_IJMatrixInitialize_v2 +HYPRE_IJMatrixMigrate +HYPRE_IJMatrixNorm +HYPRE_IJMatrixPartialClone +HYPRE_IJMatrixPrint +HYPRE_IJMatrixPrintBinary +HYPRE_IJMatrixRead +HYPRE_IJMatrixReadBinary +HYPRE_IJMatrixReadMM +HYPRE_IJMatrixSetConstantValues +HYPRE_IJMatrixSetDiagOffdSizes +HYPRE_IJMatrixSetEarlyAssemble +HYPRE_IJMatrixSetGrowFactor +HYPRE_IJMatrixSetInitAllocation +HYPRE_IJMatrixSetMaxOffProcElmts +HYPRE_IJMatrixSetOMPFlag +HYPRE_IJMatrixSetObjectType +HYPRE_IJMatrixSetPrintLevel +HYPRE_IJMatrixSetRowSizes +HYPRE_IJMatrixSetValues +HYPRE_IJMatrixSetValues2 +HYPRE_IJMatrixTranspose +HYPRE_IJVectorAddToValues +HYPRE_IJVectorAssemble +HYPRE_IJVectorCreate +HYPRE_IJVectorDestroy +HYPRE_IJVectorGetLocalRange +HYPRE_IJVectorGetObject +HYPRE_IJVectorGetObjectType +HYPRE_IJVectorGetValues +HYPRE_IJVectorInitialize +HYPRE_IJVectorInitializeShell +HYPRE_IJVectorInitialize_v2 +HYPRE_IJVectorInnerProd +HYPRE_IJVectorMigrate +HYPRE_IJVectorPrint +HYPRE_IJVectorPrintBinary +HYPRE_IJVectorRead +HYPRE_IJVectorReadBinary +HYPRE_IJVectorSetComponent +HYPRE_IJVectorSetConstantValues +HYPRE_IJVectorSetData +HYPRE_IJVectorSetMaxOffProcElmts +HYPRE_IJVectorSetNumComponents +HYPRE_IJVectorSetObjectType +HYPRE_IJVectorSetPrintLevel +HYPRE_IJVectorSetTags +HYPRE_IJVectorSetValues +HYPRE_IJVectorUpdateValues diff --git a/src/IJ_mv/mup.methods b/src/IJ_mv/mup.methods new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/IJ_mv/mup_code b/src/IJ_mv/mup_code new file mode 100755 index 0000000000..0bea118d82 --- /dev/null +++ b/src/IJ_mv/mup_code @@ -0,0 +1,7 @@ +#!/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) + +../config/gen_code.sh HYPRE_IJ_mv.h _hypre_IJ_mv.h mup diff --git a/src/IJ_mv/mup_fixed.c b/src/IJ_mv/mup_fixed.c new file mode 100644 index 0000000000..8eeecc3c57 --- /dev/null +++ b/src/IJ_mv/mup_fixed.c @@ -0,0 +1,507 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_IJ_mv.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +hypre_AuxParCSRMatrixCreate( hypre_AuxParCSRMatrix **aux_matrix, HYPRE_Int local_num_rows, HYPRE_Int local_num_cols, HYPRE_Int *sizes ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AuxParCSRMatrixCreate)( aux_matrix, local_num_rows, local_num_cols, sizes ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AuxParCSRMatrixDestroy( hypre_AuxParCSRMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AuxParCSRMatrixDestroy)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AuxParCSRMatrixInitialize( hypre_AuxParCSRMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AuxParCSRMatrixInitialize)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AuxParCSRMatrixInitialize_v2( hypre_AuxParCSRMatrix *matrix, HYPRE_MemoryLocation memory_location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AuxParCSRMatrixInitialize_v2)( matrix, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AuxParCSRMatrixSetRownnz( hypre_AuxParCSRMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AuxParCSRMatrixSetRownnz)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AuxParVectorCreate( hypre_AuxParVector **aux_vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AuxParVectorCreate)( aux_vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AuxParVectorDestroy( hypre_AuxParVector *vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AuxParVectorDestroy)( vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AuxParVectorInitialize_v2( hypre_AuxParVector *vector, HYPRE_MemoryLocation memory_location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AuxParVectorInitialize_v2)( vector, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FillResponseIJOffProcVals( 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FillResponseIJOffProcVals)( p_recv_contact_buf, contact_size, contact_proc, ro, comm, p_send_response_buf, response_message_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FindProc( HYPRE_BigInt *list, HYPRE_BigInt value, HYPRE_Int list_length ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FindProc)( list, value, list_length ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJMatrixAddParCSR( HYPRE_Complex alpha, hypre_IJMatrix *matrix_A, HYPRE_Complex beta, hypre_IJMatrix *matrix_B, hypre_IJMatrix *matrix_C ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJMatrixAddParCSR)( alpha, matrix_A, beta, matrix_B, matrix_C ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJMatrixAddToValuesOMPParCSR( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const HYPRE_Complex *values ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJMatrixAddToValuesOMPParCSR)( matrix, nrows, ncols, rows, row_indexes, cols, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJMatrixAddToValuesParCSR( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const HYPRE_Complex *values ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJMatrixAddToValuesParCSR)( matrix, nrows, ncols, rows, row_indexes, cols, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJMatrixAssembleOffProcValsParCSR( hypre_IJMatrix *matrix, HYPRE_Int off_proc_i_indx, HYPRE_Int max_off_proc_elmts, HYPRE_Int current_num_elmts, HYPRE_MemoryLocation memory_location, HYPRE_BigInt *off_proc_i, HYPRE_BigInt *off_proc_j, HYPRE_Complex *off_proc_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJMatrixAssembleOffProcValsParCSR)( matrix, off_proc_i_indx, max_off_proc_elmts, current_num_elmts, memory_location, off_proc_i, off_proc_j, off_proc_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJMatrixAssembleParCSR( hypre_IJMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJMatrixAssembleParCSR)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJMatrixCreateAssumedPartition( hypre_IJMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJMatrixCreateAssumedPartition)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJMatrixCreateParCSR( hypre_IJMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJMatrixCreateParCSR)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJMatrixDestroyParCSR( hypre_IJMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJMatrixDestroyParCSR)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJMatrixGetColPartitioning( HYPRE_IJMatrix matrix, HYPRE_BigInt **col_partitioning ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJMatrixGetColPartitioning)( matrix, col_partitioning ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJMatrixGetRowCountsParCSR( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_BigInt *rows, HYPRE_Int *ncols ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJMatrixGetRowCountsParCSR)( matrix, nrows, rows, ncols ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJMatrixGetRowPartitioning( HYPRE_IJMatrix matrix, HYPRE_BigInt **row_partitioning ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJMatrixGetRowPartitioning)( matrix, row_partitioning ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJMatrixGetValuesParCSR( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, HYPRE_BigInt *rows, HYPRE_Int *row_indexes, HYPRE_BigInt *cols, HYPRE_Complex *values, HYPRE_Int zero_out ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJMatrixGetValuesParCSR)( matrix, nrows, ncols, rows, row_indexes, cols, values, zero_out ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJMatrixInitializeParCSR( hypre_IJMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJMatrixInitializeParCSR)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJMatrixInitializeParCSR_v2( hypre_IJMatrix *matrix, HYPRE_MemoryLocation memory_location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJMatrixInitializeParCSR_v2)( matrix, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJMatrixMigrateParCSR( hypre_IJMatrix *matrix, HYPRE_MemoryLocation memory_location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJMatrixMigrateParCSR)( matrix, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJMatrixNormParCSR( hypre_IJMatrix *matrix, HYPRE_Real *norm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJMatrixNormParCSR)( matrix, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJMatrixRead( const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJMatrix *matrix_ptr, HYPRE_Int is_mm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJMatrixRead)( filename, comm, type, matrix_ptr, is_mm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJMatrixReadBinary( const char *prefixname, MPI_Comm comm, HYPRE_Int type, HYPRE_IJMatrix *matrix_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJMatrixReadBinary)( prefixname, comm, type, matrix_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJMatrixSetConstantValuesParCSR( hypre_IJMatrix *matrix, HYPRE_Complex value ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJMatrixSetConstantValuesParCSR)( matrix, value ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJMatrixSetDiagOffdSizesParCSR( hypre_IJMatrix *matrix, const HYPRE_Int *diag_sizes, const HYPRE_Int *offdiag_sizes ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJMatrixSetDiagOffdSizesParCSR)( matrix, diag_sizes, offdiag_sizes ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJMatrixSetEarlyAssembleParCSR( hypre_IJMatrix *matrix, HYPRE_Int early_assemble ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJMatrixSetEarlyAssembleParCSR)( matrix, early_assemble ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJMatrixSetGrowFactorParCSR( hypre_IJMatrix *matrix, HYPRE_Real factor ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJMatrixSetGrowFactorParCSR)( matrix, factor ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJMatrixSetInitAllocationParCSR( hypre_IJMatrix *matrix, HYPRE_Int factor ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJMatrixSetInitAllocationParCSR)( matrix, factor ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJMatrixSetMaxOffProcElmtsParCSR( hypre_IJMatrix *matrix, HYPRE_Int max_off_proc_elmts ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJMatrixSetMaxOffProcElmtsParCSR)( matrix, max_off_proc_elmts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJMatrixSetObject( HYPRE_IJMatrix matrix, void *object ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJMatrixSetObject)( matrix, object ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJMatrixSetRowSizesParCSR( hypre_IJMatrix *matrix, const HYPRE_Int *sizes ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJMatrixSetRowSizesParCSR)( matrix, sizes ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJMatrixSetValuesOMPParCSR( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const HYPRE_Complex *values ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJMatrixSetValuesOMPParCSR)( matrix, nrows, ncols, rows, row_indexes, cols, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJMatrixSetValuesParCSR( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const HYPRE_Complex *values ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJMatrixSetValuesParCSR)( matrix, nrows, ncols, rows, row_indexes, cols, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJMatrixTransposeParCSR( hypre_IJMatrix *matrix_A, hypre_IJMatrix *matrix_AT ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJMatrixTransposeParCSR)( matrix_A, matrix_AT ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJVectorAddToValuesPar( hypre_IJVector *vector, HYPRE_Int num_values, const HYPRE_BigInt *indices, const HYPRE_Complex *values ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJVectorAddToValuesPar)( vector, num_values, indices, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJVectorAssembleOffProcValsPar( hypre_IJVector *vector, HYPRE_Int max_off_proc_elmts, HYPRE_Int current_num_elmts, HYPRE_MemoryLocation memory_location, HYPRE_BigInt *off_proc_i, HYPRE_Complex *off_proc_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJVectorAssembleOffProcValsPar)( vector, max_off_proc_elmts, current_num_elmts, memory_location, off_proc_i, off_proc_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJVectorAssemblePar( hypre_IJVector *vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJVectorAssemblePar)( vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJVectorCreateAssumedPartition( hypre_IJVector *vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJVectorCreateAssumedPartition)( vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJVectorCreatePar( hypre_IJVector *vector, HYPRE_BigInt *IJpartitioning ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJVectorCreatePar)( vector, IJpartitioning ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJVectorDestroyPar( hypre_IJVector *vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJVectorDestroyPar)( vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJVectorDistribute( HYPRE_IJVector vector, const HYPRE_Int *vec_starts ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJVectorDistribute)( vector, vec_starts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJVectorDistributePar( hypre_IJVector *vector, const HYPRE_Int *vec_starts ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJVectorDistributePar)( vector, vec_starts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJVectorGetValuesPar( hypre_IJVector *vector, HYPRE_Int num_values, const HYPRE_BigInt *indices, HYPRE_Complex *values ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJVectorGetValuesPar)( vector, num_values, indices, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJVectorInitializePar( hypre_IJVector *vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJVectorInitializePar)( vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJVectorInitializeParShell( hypre_IJVector *vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJVectorInitializeParShell)( vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJVectorInitializePar_v2( hypre_IJVector *vector, HYPRE_MemoryLocation memory_location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJVectorInitializePar_v2)( vector, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJVectorMigrateParCSR( hypre_IJVector *vector, HYPRE_MemoryLocation memory_location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJVectorMigrateParCSR)( vector, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJVectorReadBinary( MPI_Comm comm, const char *filename, HYPRE_Int type, HYPRE_IJVector *vector_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJVectorReadBinary)( comm, filename, type, vector_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJVectorSetComponentPar( hypre_IJVector *vector, HYPRE_Int component ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJVectorSetComponentPar)( vector, component ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJVectorSetConstantValuesPar( hypre_IJVector *vector, HYPRE_Complex value ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJVectorSetConstantValuesPar)( vector, value ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJVectorSetMaxOffProcElmtsPar( hypre_IJVector *vector, HYPRE_Int max_off_proc_elmts ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJVectorSetMaxOffProcElmtsPar)( vector, max_off_proc_elmts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJVectorSetParData( hypre_IJVector *vector, HYPRE_Complex *data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJVectorSetParData)( vector, data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJVectorSetTagsPar( hypre_IJVector *vector, HYPRE_Int owns_tags, HYPRE_Int num_tags, HYPRE_Int *tags ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJVectorSetTagsPar)( vector, owns_tags, num_tags, tags ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJVectorSetValuesPar( hypre_IJVector *vector, HYPRE_Int num_values, const HYPRE_BigInt *indices, const HYPRE_Complex *values ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJVectorSetValuesPar)( vector, num_values, indices, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJVectorZeroValues( HYPRE_IJVector vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJVectorZeroValues)( vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IJVectorZeroValuesPar( hypre_IJVector *vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IJVectorZeroValuesPar)( vector ); +} + + +#endif + diff --git a/src/IJ_mv/mup_functions.c b/src/IJ_mv/mup_functions.c new file mode 100644 index 0000000000..e7a7aa5e81 --- /dev/null +++ b/src/IJ_mv/mup_functions.c @@ -0,0 +1,595 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_IJ_mv.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_IJMatrixAdd( hypre_long_double alpha, HYPRE_IJMatrix matrix_A, hypre_long_double beta, HYPRE_IJMatrix matrix_B, HYPRE_IJMatrix *matrix_C ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixAdd_pre( precision, alpha, matrix_A, beta, matrix_B, matrix_C ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixAddToValues( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_BigInt *cols, const void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixAddToValues_pre( precision, matrix, nrows, ncols, rows, cols, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixAddToValues2( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixAddToValues2_pre( precision, matrix, nrows, ncols, rows, row_indexes, cols, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixAssemble( HYPRE_IJMatrix matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixAssemble_pre( precision, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixCreate( MPI_Comm comm, HYPRE_BigInt ilower, HYPRE_BigInt iupper, HYPRE_BigInt jlower, HYPRE_BigInt jupper, HYPRE_IJMatrix *matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixCreate_pre( precision, comm, ilower, iupper, jlower, jupper, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixDestroy( HYPRE_IJMatrix matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixDestroy_pre( precision, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixGetGlobalInfo( HYPRE_IJMatrix matrix, HYPRE_BigInt *global_num_rows, HYPRE_BigInt *global_num_cols, HYPRE_BigInt *global_num_nonzeros ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixGetGlobalInfo_pre( precision, matrix, global_num_rows, global_num_cols, global_num_nonzeros ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixGetLocalRange( HYPRE_IJMatrix matrix, HYPRE_BigInt *ilower, HYPRE_BigInt *iupper, HYPRE_BigInt *jlower, HYPRE_BigInt *jupper ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixGetLocalRange_pre( precision, matrix, ilower, iupper, jlower, jupper ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixGetObject( HYPRE_IJMatrix matrix, void **object ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixGetObject_pre( precision, matrix, object ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixGetObjectType( HYPRE_IJMatrix matrix, HYPRE_Int *type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixGetObjectType_pre( precision, matrix, type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixGetRowCounts( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_BigInt *rows, HYPRE_Int *ncols ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixGetRowCounts_pre( precision, matrix, nrows, rows, ncols ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixGetValues( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, HYPRE_BigInt *rows, HYPRE_BigInt *cols, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixGetValues_pre( precision, matrix, nrows, ncols, rows, cols, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixGetValues2( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, HYPRE_BigInt *rows, HYPRE_Int *row_indexes, HYPRE_BigInt *cols, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixGetValues2_pre( precision, matrix, nrows, ncols, rows, row_indexes, cols, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixGetValuesAndZeroOut( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, HYPRE_BigInt *rows, HYPRE_Int *row_indexes, HYPRE_BigInt *cols, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixGetValuesAndZeroOut_pre( precision, matrix, nrows, ncols, rows, row_indexes, cols, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixInitialize( HYPRE_IJMatrix matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixInitialize_pre( precision, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixInitialize_v2( HYPRE_IJMatrix matrix, HYPRE_MemoryLocation memory_location ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixInitialize_v2_pre( precision, matrix, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixMigrate( HYPRE_IJMatrix matrix, HYPRE_MemoryLocation memory_location ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixMigrate_pre( precision, matrix, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixNorm( HYPRE_IJMatrix matrix, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixNorm_pre( precision, matrix, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixPartialClone( HYPRE_IJMatrix matrix_in, HYPRE_IJMatrix *matrix_out ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixPartialClone_pre( precision, matrix_in, matrix_out ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixPrint( HYPRE_IJMatrix matrix, const char *filename ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixPrint_pre( precision, matrix, filename ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixPrintBinary( HYPRE_IJMatrix matrix, const char *filename ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixPrintBinary_pre( precision, matrix, filename ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixRead( const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJMatrix *matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixRead_pre( precision, filename, comm, type, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixReadBinary( const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJMatrix *matrix_ptr ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixReadBinary_pre( precision, filename, comm, type, matrix_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixReadMM( const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJMatrix *matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixReadMM_pre( precision, filename, comm, type, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixSetConstantValues( HYPRE_IJMatrix matrix, hypre_long_double value ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixSetConstantValues_pre( precision, matrix, value ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixSetDiagOffdSizes( HYPRE_IJMatrix matrix, const HYPRE_Int *diag_sizes, const HYPRE_Int *offdiag_sizes ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixSetDiagOffdSizes_pre( precision, matrix, diag_sizes, offdiag_sizes ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixSetEarlyAssemble( HYPRE_IJMatrix matrix, HYPRE_Int early_assemble ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixSetEarlyAssemble_pre( precision, matrix, early_assemble ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixSetGrowFactor( HYPRE_IJMatrix matrix, hypre_long_double factor ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixSetGrowFactor_pre( precision, matrix, factor ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixSetInitAllocation( HYPRE_IJMatrix matrix, HYPRE_Int factor ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixSetInitAllocation_pre( precision, matrix, factor ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixSetMaxOffProcElmts( HYPRE_IJMatrix matrix, HYPRE_Int max_off_proc_elmts ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixSetMaxOffProcElmts_pre( precision, matrix, max_off_proc_elmts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixSetOMPFlag( HYPRE_IJMatrix matrix, HYPRE_Int omp_flag ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixSetOMPFlag_pre( precision, matrix, omp_flag ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixSetObjectType( HYPRE_IJMatrix matrix, HYPRE_Int type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixSetObjectType_pre( precision, matrix, type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixSetPrintLevel( HYPRE_IJMatrix matrix, HYPRE_Int print_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixSetPrintLevel_pre( precision, matrix, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixSetRowSizes( HYPRE_IJMatrix matrix, const HYPRE_Int *sizes ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixSetRowSizes_pre( precision, matrix, sizes ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixSetValues( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_BigInt *cols, const void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixSetValues_pre( precision, matrix, nrows, ncols, rows, cols, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixSetValues2( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixSetValues2_pre( precision, matrix, nrows, ncols, rows, row_indexes, cols, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixTranspose( HYPRE_IJMatrix matrix_A, HYPRE_IJMatrix *matrix_AT ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJMatrixTranspose_pre( precision, matrix_A, matrix_AT ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorAddToValues( HYPRE_IJVector vector, HYPRE_Int nvalues, const HYPRE_BigInt *indices, const void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJVectorAddToValues_pre( precision, vector, nvalues, indices, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorAssemble( HYPRE_IJVector vector ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJVectorAssemble_pre( precision, vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorCreate( MPI_Comm comm, HYPRE_BigInt jlower, HYPRE_BigInt jupper, HYPRE_IJVector *vector ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJVectorCreate_pre( precision, comm, jlower, jupper, vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorDestroy( HYPRE_IJVector vector ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJVectorDestroy_pre( precision, vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorGetLocalRange( HYPRE_IJVector vector, HYPRE_BigInt *jlower, HYPRE_BigInt *jupper ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJVectorGetLocalRange_pre( precision, vector, jlower, jupper ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorGetObject( HYPRE_IJVector vector, void **object ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJVectorGetObject_pre( precision, vector, object ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorGetObjectType( HYPRE_IJVector vector, HYPRE_Int *type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJVectorGetObjectType_pre( precision, vector, type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorGetValues( HYPRE_IJVector vector, HYPRE_Int nvalues, const HYPRE_BigInt *indices, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJVectorGetValues_pre( precision, vector, nvalues, indices, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorInitialize( HYPRE_IJVector vector ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJVectorInitialize_pre( precision, vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorInitializeShell( HYPRE_IJVector vector ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJVectorInitializeShell_pre( precision, vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorInitialize_v2( HYPRE_IJVector vector, HYPRE_MemoryLocation memory_location ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJVectorInitialize_v2_pre( precision, vector, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorInnerProd( HYPRE_IJVector x, HYPRE_IJVector y, void *prod ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJVectorInnerProd_pre( precision, x, y, prod ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorMigrate( HYPRE_IJVector vector, HYPRE_MemoryLocation memory_location ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJVectorMigrate_pre( precision, vector, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorPrint( HYPRE_IJVector vector, const char *filename ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJVectorPrint_pre( precision, vector, filename ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorPrintBinary( HYPRE_IJVector vector, const char *filename ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJVectorPrintBinary_pre( precision, vector, filename ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorRead( const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJVector *vector ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJVectorRead_pre( precision, filename, comm, type, vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorReadBinary( const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJVector *vector ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJVectorReadBinary_pre( precision, filename, comm, type, vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorSetComponent( HYPRE_IJVector vector, HYPRE_Int component ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJVectorSetComponent_pre( precision, vector, component ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorSetConstantValues( HYPRE_IJVector vector, hypre_long_double value ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJVectorSetConstantValues_pre( precision, vector, value ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorSetData( HYPRE_IJVector vector, void *data ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJVectorSetData_pre( precision, vector, data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorSetMaxOffProcElmts( HYPRE_IJVector vector, HYPRE_Int max_off_proc_elmts ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJVectorSetMaxOffProcElmts_pre( precision, vector, max_off_proc_elmts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorSetNumComponents( HYPRE_IJVector vector, HYPRE_Int num_components ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJVectorSetNumComponents_pre( precision, vector, num_components ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorSetObjectType( HYPRE_IJVector vector, HYPRE_Int type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJVectorSetObjectType_pre( precision, vector, type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorSetPrintLevel( HYPRE_IJVector vector, HYPRE_Int print_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJVectorSetPrintLevel_pre( precision, vector, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorSetTags( HYPRE_IJVector vector, HYPRE_Int owns_tags, HYPRE_Int num_tags, HYPRE_Int *tags ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJVectorSetTags_pre( precision, vector, owns_tags, num_tags, tags ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorSetValues( HYPRE_IJVector vector, HYPRE_Int nvalues, const HYPRE_BigInt *indices, const void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJVectorSetValues_pre( precision, vector, nvalues, indices, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorUpdateValues( HYPRE_IJVector vector, HYPRE_Int nvalues, const HYPRE_BigInt *indices, const void *values, HYPRE_Int action ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_IJVectorUpdateValues_pre( precision, vector, nvalues, indices, values, action ); +} + + + +#endif + diff --git a/src/IJ_mv/mup_pre.c b/src/IJ_mv/mup_pre.c new file mode 100644 index 0000000000..6b86fc8fc1 --- /dev/null +++ b/src/IJ_mv/mup_pre.c @@ -0,0 +1,1171 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_IJ_mv.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_IJMatrixAdd_pre( HYPRE_Precision precision, hypre_long_double alpha, HYPRE_IJMatrix matrix_A, hypre_long_double beta, HYPRE_IJMatrix matrix_B, HYPRE_IJMatrix *matrix_C ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixAdd_flt( alpha, matrix_A, beta, matrix_B, matrix_C ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixAdd_dbl( alpha, matrix_A, beta, matrix_B, matrix_C ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixAdd_long_dbl( alpha, matrix_A, beta, matrix_B, matrix_C ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixAddToValues_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_BigInt *cols, const void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixAddToValues_flt( matrix, nrows, ncols, rows, cols, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixAddToValues_dbl( matrix, nrows, ncols, rows, cols, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixAddToValues_long_dbl( matrix, nrows, ncols, rows, cols, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixAddToValues2_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixAddToValues2_flt( matrix, nrows, ncols, rows, row_indexes, cols, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixAddToValues2_dbl( matrix, nrows, ncols, rows, row_indexes, cols, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixAddToValues2_long_dbl( matrix, nrows, ncols, rows, row_indexes, cols, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixAssemble_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixAssemble_flt( matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixAssemble_dbl( matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixAssemble_long_dbl( matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_BigInt ilower, HYPRE_BigInt iupper, HYPRE_BigInt jlower, HYPRE_BigInt jupper, HYPRE_IJMatrix *matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixCreate_flt( comm, ilower, iupper, jlower, jupper, matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixCreate_dbl( comm, ilower, iupper, jlower, jupper, matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixCreate_long_dbl( comm, ilower, iupper, jlower, jupper, matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixDestroy_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixDestroy_flt( matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixDestroy_dbl( matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixDestroy_long_dbl( matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixGetGlobalInfo_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_BigInt *global_num_rows, HYPRE_BigInt *global_num_cols, HYPRE_BigInt *global_num_nonzeros ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixGetGlobalInfo_flt( matrix, global_num_rows, global_num_cols, global_num_nonzeros ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixGetGlobalInfo_dbl( matrix, global_num_rows, global_num_cols, global_num_nonzeros ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixGetGlobalInfo_long_dbl( matrix, global_num_rows, global_num_cols, global_num_nonzeros ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixGetLocalRange_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_BigInt *ilower, HYPRE_BigInt *iupper, HYPRE_BigInt *jlower, HYPRE_BigInt *jupper ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixGetLocalRange_flt( matrix, ilower, iupper, jlower, jupper ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixGetLocalRange_dbl( matrix, ilower, iupper, jlower, jupper ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixGetLocalRange_long_dbl( matrix, ilower, iupper, jlower, jupper ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixGetObject_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, void **object ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixGetObject_flt( matrix, object ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixGetObject_dbl( matrix, object ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixGetObject_long_dbl( matrix, object ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixGetObjectType_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_Int *type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixGetObjectType_flt( matrix, type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixGetObjectType_dbl( matrix, type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixGetObjectType_long_dbl( matrix, type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixGetRowCounts_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_BigInt *rows, HYPRE_Int *ncols ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixGetRowCounts_flt( matrix, nrows, rows, ncols ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixGetRowCounts_dbl( matrix, nrows, rows, ncols ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixGetRowCounts_long_dbl( matrix, nrows, rows, ncols ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixGetValues_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, HYPRE_BigInt *rows, HYPRE_BigInt *cols, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixGetValues_flt( matrix, nrows, ncols, rows, cols, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixGetValues_dbl( matrix, nrows, ncols, rows, cols, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixGetValues_long_dbl( matrix, nrows, ncols, rows, cols, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixGetValues2_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, HYPRE_BigInt *rows, HYPRE_Int *row_indexes, HYPRE_BigInt *cols, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixGetValues2_flt( matrix, nrows, ncols, rows, row_indexes, cols, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixGetValues2_dbl( matrix, nrows, ncols, rows, row_indexes, cols, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixGetValues2_long_dbl( matrix, nrows, ncols, rows, row_indexes, cols, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixGetValuesAndZeroOut_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, HYPRE_BigInt *rows, HYPRE_Int *row_indexes, HYPRE_BigInt *cols, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixGetValuesAndZeroOut_flt( matrix, nrows, ncols, rows, row_indexes, cols, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixGetValuesAndZeroOut_dbl( matrix, nrows, ncols, rows, row_indexes, cols, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixGetValuesAndZeroOut_long_dbl( matrix, nrows, ncols, rows, row_indexes, cols, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixInitialize_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixInitialize_flt( matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixInitialize_dbl( matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixInitialize_long_dbl( matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixInitialize_v2_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_MemoryLocation memory_location ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixInitialize_v2_flt( matrix, memory_location ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixInitialize_v2_dbl( matrix, memory_location ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixInitialize_v2_long_dbl( matrix, memory_location ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixMigrate_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_MemoryLocation memory_location ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixMigrate_flt( matrix, memory_location ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixMigrate_dbl( matrix, memory_location ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixMigrate_long_dbl( matrix, memory_location ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixNorm_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixNorm_flt( matrix, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixNorm_dbl( matrix, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixNorm_long_dbl( matrix, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixPartialClone_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix_in, HYPRE_IJMatrix *matrix_out ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixPartialClone_flt( matrix_in, matrix_out ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixPartialClone_dbl( matrix_in, matrix_out ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixPartialClone_long_dbl( matrix_in, matrix_out ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixPrint_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, const char *filename ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixPrint_flt( matrix, filename ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixPrint_dbl( matrix, filename ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixPrint_long_dbl( matrix, filename ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixPrintBinary_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, const char *filename ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixPrintBinary_flt( matrix, filename ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixPrintBinary_dbl( matrix, filename ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixPrintBinary_long_dbl( matrix, filename ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixRead_pre( HYPRE_Precision precision, const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJMatrix *matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixRead_flt( filename, comm, type, matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixRead_dbl( filename, comm, type, matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixRead_long_dbl( filename, comm, type, matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixReadBinary_pre( HYPRE_Precision precision, const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJMatrix *matrix_ptr ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixReadBinary_flt( filename, comm, type, matrix_ptr ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixReadBinary_dbl( filename, comm, type, matrix_ptr ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixReadBinary_long_dbl( filename, comm, type, matrix_ptr ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixReadMM_pre( HYPRE_Precision precision, const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJMatrix *matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixReadMM_flt( filename, comm, type, matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixReadMM_dbl( filename, comm, type, matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixReadMM_long_dbl( filename, comm, type, matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixSetConstantValues_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, hypre_long_double value ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixSetConstantValues_flt( matrix, value ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixSetConstantValues_dbl( matrix, value ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixSetConstantValues_long_dbl( matrix, value ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixSetDiagOffdSizes_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, const HYPRE_Int *diag_sizes, const HYPRE_Int *offdiag_sizes ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixSetDiagOffdSizes_flt( matrix, diag_sizes, offdiag_sizes ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixSetDiagOffdSizes_dbl( matrix, diag_sizes, offdiag_sizes ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixSetDiagOffdSizes_long_dbl( matrix, diag_sizes, offdiag_sizes ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixSetEarlyAssemble_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_Int early_assemble ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixSetEarlyAssemble_flt( matrix, early_assemble ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixSetEarlyAssemble_dbl( matrix, early_assemble ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixSetEarlyAssemble_long_dbl( matrix, early_assemble ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixSetGrowFactor_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, hypre_long_double factor ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixSetGrowFactor_flt( matrix, factor ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixSetGrowFactor_dbl( matrix, factor ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixSetGrowFactor_long_dbl( matrix, factor ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixSetInitAllocation_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_Int factor ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixSetInitAllocation_flt( matrix, factor ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixSetInitAllocation_dbl( matrix, factor ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixSetInitAllocation_long_dbl( matrix, factor ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixSetMaxOffProcElmts_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_Int max_off_proc_elmts ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixSetMaxOffProcElmts_flt( matrix, max_off_proc_elmts ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixSetMaxOffProcElmts_dbl( matrix, max_off_proc_elmts ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixSetMaxOffProcElmts_long_dbl( matrix, max_off_proc_elmts ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixSetOMPFlag_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_Int omp_flag ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixSetOMPFlag_flt( matrix, omp_flag ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixSetOMPFlag_dbl( matrix, omp_flag ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixSetOMPFlag_long_dbl( matrix, omp_flag ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixSetObjectType_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_Int type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixSetObjectType_flt( matrix, type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixSetObjectType_dbl( matrix, type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixSetObjectType_long_dbl( matrix, type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_Int print_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixSetPrintLevel_flt( matrix, print_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixSetPrintLevel_dbl( matrix, print_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixSetPrintLevel_long_dbl( matrix, print_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixSetRowSizes_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, const HYPRE_Int *sizes ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixSetRowSizes_flt( matrix, sizes ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixSetRowSizes_dbl( matrix, sizes ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixSetRowSizes_long_dbl( matrix, sizes ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixSetValues_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_BigInt *cols, const void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixSetValues_flt( matrix, nrows, ncols, rows, cols, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixSetValues_dbl( matrix, nrows, ncols, rows, cols, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixSetValues_long_dbl( matrix, nrows, ncols, rows, cols, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixSetValues2_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixSetValues2_flt( matrix, nrows, ncols, rows, row_indexes, cols, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixSetValues2_dbl( matrix, nrows, ncols, rows, row_indexes, cols, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixSetValues2_long_dbl( matrix, nrows, ncols, rows, row_indexes, cols, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJMatrixTranspose_pre( HYPRE_Precision precision, HYPRE_IJMatrix matrix_A, HYPRE_IJMatrix *matrix_AT ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJMatrixTranspose_flt( matrix_A, matrix_AT ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJMatrixTranspose_dbl( matrix_A, matrix_AT ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJMatrixTranspose_long_dbl( matrix_A, matrix_AT ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorAddToValues_pre( HYPRE_Precision precision, HYPRE_IJVector vector, HYPRE_Int nvalues, const HYPRE_BigInt *indices, const void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJVectorAddToValues_flt( vector, nvalues, indices, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJVectorAddToValues_dbl( vector, nvalues, indices, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJVectorAddToValues_long_dbl( vector, nvalues, indices, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorAssemble_pre( HYPRE_Precision precision, HYPRE_IJVector vector ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJVectorAssemble_flt( vector ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJVectorAssemble_dbl( vector ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJVectorAssemble_long_dbl( vector ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_BigInt jlower, HYPRE_BigInt jupper, HYPRE_IJVector *vector ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJVectorCreate_flt( comm, jlower, jupper, vector ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJVectorCreate_dbl( comm, jlower, jupper, vector ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJVectorCreate_long_dbl( comm, jlower, jupper, vector ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorDestroy_pre( HYPRE_Precision precision, HYPRE_IJVector vector ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJVectorDestroy_flt( vector ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJVectorDestroy_dbl( vector ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJVectorDestroy_long_dbl( vector ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorGetLocalRange_pre( HYPRE_Precision precision, HYPRE_IJVector vector, HYPRE_BigInt *jlower, HYPRE_BigInt *jupper ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJVectorGetLocalRange_flt( vector, jlower, jupper ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJVectorGetLocalRange_dbl( vector, jlower, jupper ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJVectorGetLocalRange_long_dbl( vector, jlower, jupper ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorGetObject_pre( HYPRE_Precision precision, HYPRE_IJVector vector, void **object ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJVectorGetObject_flt( vector, object ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJVectorGetObject_dbl( vector, object ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJVectorGetObject_long_dbl( vector, object ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorGetObjectType_pre( HYPRE_Precision precision, HYPRE_IJVector vector, HYPRE_Int *type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJVectorGetObjectType_flt( vector, type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJVectorGetObjectType_dbl( vector, type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJVectorGetObjectType_long_dbl( vector, type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorGetValues_pre( HYPRE_Precision precision, HYPRE_IJVector vector, HYPRE_Int nvalues, const HYPRE_BigInt *indices, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJVectorGetValues_flt( vector, nvalues, indices, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJVectorGetValues_dbl( vector, nvalues, indices, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJVectorGetValues_long_dbl( vector, nvalues, indices, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorInitialize_pre( HYPRE_Precision precision, HYPRE_IJVector vector ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJVectorInitialize_flt( vector ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJVectorInitialize_dbl( vector ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJVectorInitialize_long_dbl( vector ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorInitializeShell_pre( HYPRE_Precision precision, HYPRE_IJVector vector ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJVectorInitializeShell_flt( vector ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJVectorInitializeShell_dbl( vector ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJVectorInitializeShell_long_dbl( vector ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorInitialize_v2_pre( HYPRE_Precision precision, HYPRE_IJVector vector, HYPRE_MemoryLocation memory_location ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJVectorInitialize_v2_flt( vector, memory_location ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJVectorInitialize_v2_dbl( vector, memory_location ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJVectorInitialize_v2_long_dbl( vector, memory_location ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorInnerProd_pre( HYPRE_Precision precision, HYPRE_IJVector x, HYPRE_IJVector y, void *prod ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJVectorInnerProd_flt( x, y, prod ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJVectorInnerProd_dbl( x, y, prod ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJVectorInnerProd_long_dbl( x, y, prod ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorMigrate_pre( HYPRE_Precision precision, HYPRE_IJVector vector, HYPRE_MemoryLocation memory_location ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJVectorMigrate_flt( vector, memory_location ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJVectorMigrate_dbl( vector, memory_location ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJVectorMigrate_long_dbl( vector, memory_location ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorPrint_pre( HYPRE_Precision precision, HYPRE_IJVector vector, const char *filename ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJVectorPrint_flt( vector, filename ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJVectorPrint_dbl( vector, filename ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJVectorPrint_long_dbl( vector, filename ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorPrintBinary_pre( HYPRE_Precision precision, HYPRE_IJVector vector, const char *filename ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJVectorPrintBinary_flt( vector, filename ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJVectorPrintBinary_dbl( vector, filename ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJVectorPrintBinary_long_dbl( vector, filename ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorRead_pre( HYPRE_Precision precision, const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJVector *vector ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJVectorRead_flt( filename, comm, type, vector ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJVectorRead_dbl( filename, comm, type, vector ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJVectorRead_long_dbl( filename, comm, type, vector ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorReadBinary_pre( HYPRE_Precision precision, const char *filename, MPI_Comm comm, HYPRE_Int type, HYPRE_IJVector *vector ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJVectorReadBinary_flt( filename, comm, type, vector ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJVectorReadBinary_dbl( filename, comm, type, vector ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJVectorReadBinary_long_dbl( filename, comm, type, vector ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorSetComponent_pre( HYPRE_Precision precision, HYPRE_IJVector vector, HYPRE_Int component ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJVectorSetComponent_flt( vector, component ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJVectorSetComponent_dbl( vector, component ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJVectorSetComponent_long_dbl( vector, component ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorSetConstantValues_pre( HYPRE_Precision precision, HYPRE_IJVector vector, hypre_long_double value ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJVectorSetConstantValues_flt( vector, value ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJVectorSetConstantValues_dbl( vector, value ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJVectorSetConstantValues_long_dbl( vector, value ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorSetData_pre( HYPRE_Precision precision, HYPRE_IJVector vector, void *data ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJVectorSetData_flt( vector, data ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJVectorSetData_dbl( vector, data ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJVectorSetData_long_dbl( vector, data ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorSetMaxOffProcElmts_pre( HYPRE_Precision precision, HYPRE_IJVector vector, HYPRE_Int max_off_proc_elmts ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJVectorSetMaxOffProcElmts_flt( vector, max_off_proc_elmts ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJVectorSetMaxOffProcElmts_dbl( vector, max_off_proc_elmts ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJVectorSetMaxOffProcElmts_long_dbl( vector, max_off_proc_elmts ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorSetNumComponents_pre( HYPRE_Precision precision, HYPRE_IJVector vector, HYPRE_Int num_components ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJVectorSetNumComponents_flt( vector, num_components ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJVectorSetNumComponents_dbl( vector, num_components ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJVectorSetNumComponents_long_dbl( vector, num_components ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorSetObjectType_pre( HYPRE_Precision precision, HYPRE_IJVector vector, HYPRE_Int type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJVectorSetObjectType_flt( vector, type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJVectorSetObjectType_dbl( vector, type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJVectorSetObjectType_long_dbl( vector, type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_IJVector vector, HYPRE_Int print_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJVectorSetPrintLevel_flt( vector, print_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJVectorSetPrintLevel_dbl( vector, print_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJVectorSetPrintLevel_long_dbl( vector, print_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorSetTags_pre( HYPRE_Precision precision, HYPRE_IJVector vector, HYPRE_Int owns_tags, HYPRE_Int num_tags, HYPRE_Int *tags ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJVectorSetTags_flt( vector, owns_tags, num_tags, tags ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJVectorSetTags_dbl( vector, owns_tags, num_tags, tags ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJVectorSetTags_long_dbl( vector, owns_tags, num_tags, tags ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorSetValues_pre( HYPRE_Precision precision, HYPRE_IJVector vector, HYPRE_Int nvalues, const HYPRE_BigInt *indices, const void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJVectorSetValues_flt( vector, nvalues, indices, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJVectorSetValues_dbl( vector, nvalues, indices, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJVectorSetValues_long_dbl( vector, nvalues, indices, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_IJVectorUpdateValues_pre( HYPRE_Precision precision, HYPRE_IJVector vector, HYPRE_Int nvalues, const HYPRE_BigInt *indices, const void *values, HYPRE_Int action ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_IJVectorUpdateValues_flt( vector, nvalues, indices, values, action ); + case HYPRE_REAL_DOUBLE: + return HYPRE_IJVectorUpdateValues_dbl( vector, nvalues, indices, values, action ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_IJVectorUpdateValues_long_dbl( vector, nvalues, indices, values, action ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + + + +#endif + diff --git a/src/IJ_mv/protos.h b/src/IJ_mv/protos.h index a206e45c17..68cc118624 100644 --- a/src/IJ_mv/protos.h +++ b/src/IJ_mv/protos.h @@ -82,9 +82,6 @@ HYPRE_Int hypre_IJMatrixGetValuesParCSR ( hypre_IJMatrix *matrix, HYPRE_Int nrow HYPRE_Int hypre_IJMatrixSetValuesParCSR ( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const HYPRE_Complex *values ); -HYPRE_Int hypre_IJMatrixSetAddValuesParCSRDevice ( hypre_IJMatrix *matrix, HYPRE_Int nrows, - HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, - const HYPRE_Complex *values, const char *action ); HYPRE_Int hypre_IJMatrixSetConstantValuesParCSR ( hypre_IJMatrix *matrix, HYPRE_Complex value ); HYPRE_Int hypre_IJMatrixAddToValuesParCSR ( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, @@ -109,15 +106,25 @@ HYPRE_Int hypre_IJMatrixSetValuesOMPParCSR ( hypre_IJMatrix *matrix, HYPRE_Int n HYPRE_Int hypre_IJMatrixAddToValuesOMPParCSR ( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const HYPRE_Complex *values ); -HYPRE_Int hypre_IJMatrixAssembleParCSRDevice(hypre_IJMatrix *matrix); HYPRE_Int hypre_IJMatrixInitializeParCSR_v2(hypre_IJMatrix *matrix, HYPRE_MemoryLocation memory_location); -HYPRE_Int hypre_IJMatrixSetConstantValuesParCSRDevice( hypre_IJMatrix *matrix, - HYPRE_Complex value ); HYPRE_Int hypre_IJMatrixMigrateParCSR(hypre_IJMatrix *matrix, HYPRE_MemoryLocation memory_location); HYPRE_Int hypre_IJMatrixAssembleCommunicate(hypre_IJMatrix *matrix); + +/* IJMatrix_parcsr_device.c */ +HYPRE_Int hypre_IJMatrixSetConstantValuesParCSRDevice( hypre_IJMatrix *matrix, + HYPRE_Complex value ); +HYPRE_Int hypre_IJMatrixSetAddValuesParCSRDevice ( hypre_IJMatrix *matrix, HYPRE_Int nrows, + HYPRE_Int *ncols, const HYPRE_BigInt *rows, + const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, + const HYPRE_Complex *values, const char *action ); +HYPRE_Int hypre_IJMatrixGetValuesParCSRDevice( hypre_IJMatrix *matrix, HYPRE_Int nrows, + HYPRE_Int *ncols, HYPRE_BigInt *rows, + HYPRE_Int *row_indexes, HYPRE_BigInt *cols, + HYPRE_Complex *values, HYPRE_Int zero_out ); HYPRE_Int hypre_IJMatrixAssembleCompressDevice(hypre_IJMatrix *matrix, HYPRE_Int reduce_stack_size); +HYPRE_Int hypre_IJMatrixAssembleParCSRDevice(hypre_IJMatrix *matrix); /* IJMatrix_petsc.c */ HYPRE_Int hypre_IJMatrixSetLocalSizePETSc ( hypre_IJMatrix *matrix, HYPRE_Int local_m, @@ -175,79 +182,13 @@ HYPRE_Int hypre_IJVectorGetValuesPar ( hypre_IJVector *vector, HYPRE_Int num_val HYPRE_Int hypre_IJVectorAssembleOffProcValsPar ( hypre_IJVector *vector, HYPRE_Int max_off_proc_elmts, HYPRE_Int current_num_elmts, HYPRE_MemoryLocation memory_location, HYPRE_BigInt *off_proc_i, HYPRE_Complex *off_proc_data ); +HYPRE_Int hypre_IJVectorMigrateParCSR(hypre_IJVector *vector, HYPRE_MemoryLocation memory_location); + +/* IJVector_parcsr_device.c */ HYPRE_Int hypre_IJVectorSetAddValuesParDevice(hypre_IJVector *vector, HYPRE_Int num_values, const HYPRE_BigInt *indices, const HYPRE_Complex *values, const char *action); HYPRE_Int hypre_IJVectorAssembleParDevice(hypre_IJVector *vector); HYPRE_Int hypre_IJVectorUpdateValuesDevice( hypre_IJVector *vector, HYPRE_Int num_values, const HYPRE_BigInt *indices, const HYPRE_Complex *values, HYPRE_Int action); -HYPRE_Int hypre_IJVectorMigrateParCSR(hypre_IJVector *vector, HYPRE_MemoryLocation memory_location); -/* HYPRE_IJMatrix.c */ -HYPRE_Int HYPRE_IJMatrixCreate ( MPI_Comm comm, HYPRE_BigInt ilower, HYPRE_BigInt iupper, - HYPRE_BigInt jlower, HYPRE_BigInt jupper, HYPRE_IJMatrix *matrix ); -HYPRE_Int HYPRE_IJMatrixPartialClone ( HYPRE_IJMatrix matrix_in, HYPRE_IJMatrix *matrix_out ); -HYPRE_Int HYPRE_IJMatrixDestroy ( HYPRE_IJMatrix matrix ); -HYPRE_Int HYPRE_IJMatrixInitialize ( HYPRE_IJMatrix matrix ); -HYPRE_Int HYPRE_IJMatrixSetPrintLevel ( HYPRE_IJMatrix matrix, HYPRE_Int print_level ); -HYPRE_Int HYPRE_IJMatrixSetValues ( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, - const HYPRE_BigInt *rows, const HYPRE_BigInt *cols, const HYPRE_Complex *values ); -HYPRE_Int HYPRE_IJMatrixSetConstantValues ( HYPRE_IJMatrix matrix, HYPRE_Complex value ); -HYPRE_Int HYPRE_IJMatrixAddToValues ( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, - const HYPRE_BigInt *rows, const HYPRE_BigInt *cols, const HYPRE_Complex *values ); -HYPRE_Int HYPRE_IJMatrixAssemble ( HYPRE_IJMatrix matrix ); -HYPRE_Int HYPRE_IJMatrixGetRowCounts ( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_BigInt *rows, - HYPRE_Int *ncols ); -HYPRE_Int HYPRE_IJMatrixGetValues ( HYPRE_IJMatrix matrix, HYPRE_Int nrows, HYPRE_Int *ncols, - HYPRE_BigInt *rows, HYPRE_BigInt *cols, HYPRE_Complex *values ); -HYPRE_Int HYPRE_IJMatrixSetObjectType ( HYPRE_IJMatrix matrix, HYPRE_Int type ); -HYPRE_Int HYPRE_IJMatrixGetObjectType ( HYPRE_IJMatrix matrix, HYPRE_Int *type ); -HYPRE_Int HYPRE_IJMatrixGetLocalRange ( HYPRE_IJMatrix matrix, HYPRE_BigInt *ilower, - HYPRE_BigInt *iupper, HYPRE_BigInt *jlower, HYPRE_BigInt *jupper ); -HYPRE_Int HYPRE_IJMatrixGetObject ( HYPRE_IJMatrix matrix, void **object ); -HYPRE_Int HYPRE_IJMatrixSetRowSizes ( HYPRE_IJMatrix matrix, const HYPRE_Int *sizes ); -HYPRE_Int HYPRE_IJMatrixSetDiagOffdSizes ( HYPRE_IJMatrix matrix, const HYPRE_Int *diag_sizes, - const HYPRE_Int *offdiag_sizes ); -HYPRE_Int HYPRE_IJMatrixSetMaxOffProcElmts ( HYPRE_IJMatrix matrix, HYPRE_Int max_off_proc_elmts ); -HYPRE_Int HYPRE_IJMatrixRead ( const char *filename, MPI_Comm comm, HYPRE_Int type, - HYPRE_IJMatrix *matrix_ptr ); -HYPRE_Int HYPRE_IJMatrixReadBinary ( const char *filename, MPI_Comm comm, HYPRE_Int type, - HYPRE_IJMatrix *matrix_ptr ); -HYPRE_Int HYPRE_IJMatrixReadMM( const char *filename, MPI_Comm comm, HYPRE_Int type, - HYPRE_IJMatrix *matrix_ptr ); -HYPRE_Int HYPRE_IJMatrixPrint ( HYPRE_IJMatrix matrix, const char *filename ); -HYPRE_Int HYPRE_IJMatrixPrintBinary ( HYPRE_IJMatrix matrix, const char *filename ); -HYPRE_Int HYPRE_IJMatrixSetOMPFlag ( HYPRE_IJMatrix matrix, HYPRE_Int omp_flag ); -HYPRE_Int HYPRE_IJMatrixTranspose ( HYPRE_IJMatrix matrix_A, HYPRE_IJMatrix *matrix_AT ); -HYPRE_Int HYPRE_IJMatrixNorm ( HYPRE_IJMatrix matrix, HYPRE_Real *norm ); -HYPRE_Int HYPRE_IJMatrixAdd ( HYPRE_Complex alpha, HYPRE_IJMatrix matrix_A, HYPRE_Complex beta, - HYPRE_IJMatrix matrix_B, HYPRE_IJMatrix *matrix_C ); -/* HYPRE_IJVector.c */ -HYPRE_Int HYPRE_IJVectorCreate ( MPI_Comm comm, HYPRE_BigInt jlower, HYPRE_BigInt jupper, - HYPRE_IJVector *vector ); -HYPRE_Int HYPRE_IJVectorSetNumComponents ( HYPRE_IJVector vector, HYPRE_Int num_components ); -HYPRE_Int HYPRE_IJVectorSetComponent ( HYPRE_IJVector vector, HYPRE_Int component ); -HYPRE_Int HYPRE_IJVectorDestroy ( HYPRE_IJVector vector ); -HYPRE_Int HYPRE_IJVectorInitialize ( HYPRE_IJVector vector ); -HYPRE_Int HYPRE_IJVectorSetPrintLevel ( HYPRE_IJVector vector, HYPRE_Int print_level ); -HYPRE_Int HYPRE_IJVectorSetValues ( HYPRE_IJVector vector, HYPRE_Int nvalues, - const HYPRE_BigInt *indices, const HYPRE_Complex *values ); -HYPRE_Int HYPRE_IJVectorSetConstantValues ( HYPRE_IJVector vector, HYPRE_Complex value ); -HYPRE_Int HYPRE_IJVectorAddToValues ( HYPRE_IJVector vector, HYPRE_Int nvalues, - const HYPRE_BigInt *indices, const HYPRE_Complex *values ); -HYPRE_Int HYPRE_IJVectorAssemble ( HYPRE_IJVector vector ); -HYPRE_Int HYPRE_IJVectorGetValues ( HYPRE_IJVector vector, HYPRE_Int nvalues, - const HYPRE_BigInt *indices, HYPRE_Complex *values ); -HYPRE_Int HYPRE_IJVectorSetMaxOffProcElmts ( HYPRE_IJVector vector, HYPRE_Int max_off_proc_elmts ); -HYPRE_Int HYPRE_IJVectorSetObjectType ( HYPRE_IJVector vector, HYPRE_Int type ); -HYPRE_Int HYPRE_IJVectorGetObjectType ( HYPRE_IJVector vector, HYPRE_Int *type ); -HYPRE_Int HYPRE_IJVectorGetLocalRange ( HYPRE_IJVector vector, HYPRE_BigInt *jlower, - HYPRE_BigInt *jupper ); -HYPRE_Int HYPRE_IJVectorGetObject ( HYPRE_IJVector vector, void **object ); -HYPRE_Int HYPRE_IJVectorRead ( const char *filename, MPI_Comm comm, HYPRE_Int type, - HYPRE_IJVector *vector_ptr ); -HYPRE_Int HYPRE_IJVectorReadBinary ( const char *filename, MPI_Comm comm, HYPRE_Int type, - HYPRE_IJVector *vector_ptr ); -HYPRE_Int HYPRE_IJVectorPrint ( HYPRE_IJVector vector, const char *filename ); -HYPRE_Int HYPRE_IJVectorPrintBinary ( HYPRE_IJVector vector, const char *filename ); -HYPRE_Int HYPRE_IJVectorInnerProd ( HYPRE_IJVector x, HYPRE_IJVector y, HYPRE_Real *prod ); diff --git a/src/Makefile b/src/Makefile index fc83055ec8..9bbdb8f242 100644 --- a/src/Makefile +++ b/src/Makefile @@ -132,6 +132,10 @@ help: @echo " runs etags to create tags table" @echo " file is named TAGS and is saved in current directory" @echo " " + @echo "tagsnomup:" + @echo " ignores auto-generated mup files and runs etags" + @echo " file is named TAGS and is saved in current directory" + @echo " " @echo "test:" @echo " depends on the all target to be completed" @echo " removes existing temporary installation sub-directory" @@ -245,5 +249,11 @@ distclean: rm -rf ./HYPRE_config.h tags: - find . -name "*.c" -o -name "*.C" -o -name "*.h" -o \ + @find . -name "*.c" -o -name "*.C" -o -name "*.h" -o \ -name "*.c??" -o -name "*.h??" -o -name "*.f" | etags - + +tagsnomup: + @find . \( -name "*.c" -o -name "*.C" -o -name "*.h" -o \ + -name "*.c??" -o -name "*.h??" -o -name "*.f" \) -type f \ + | grep -vE 'mup_|mup.h' \ + | etags - diff --git a/src/blas/CMakeLists.txt b/src/blas/CMakeLists.txt index 04dc5da10e..1f0a8c7153 100644 --- a/src/blas/CMakeLists.txt +++ b/src/blas/CMakeLists.txt @@ -9,7 +9,8 @@ set(HDRS hypre_blas.h ) -set(SRCS +# Regular sources +set(REGULAR_SRCS dasum.c daxpy.c dcopy.c @@ -36,11 +37,12 @@ set(SRCS xerbla.c ) -target_sources(${PROJECT_NAME} - PRIVATE ${SRCS} - ${HDRS} -) +if (HYPRE_ENABLE_MIXED_PRECISION) + setup_mixed_precision_compilation("blas" SRCS "${REGULAR_SRCS}") + target_sources(${PROJECT_NAME} PRIVATE ${HDRS}) +else() + target_sources(${PROJECT_NAME} PRIVATE ${REGULAR_SRCS} ${HDRS}) +endif() convert_filenames_to_full_paths(HDRS) set(HYPRE_HEADERS ${HYPRE_HEADERS} ${HDRS} PARENT_SCOPE) - diff --git a/src/blas/Makefile b/src/blas/Makefile index 76f8ac29ad..3e4f5ee707 100644 --- a/src/blas/Makefile +++ b/src/blas/Makefile @@ -12,8 +12,11 @@ include ../config/Makefile.config C_COMPILE_FLAGS = ${INCLUDES} -I.. -I../utilities -BLAS_HEADERS = f2c.h hypre_blas.h -BLAS_FILES = \ +HEADERS =\ + f2c.h\ + hypre_blas.h + +FILES =\ dasum.c\ daxpy.c\ dcopy.c\ @@ -39,19 +42,40 @@ BLAS_FILES = \ lsame.c\ xerbla.c -OBJS = ${BLAS_FILES:.c=.o} +# Mixed precision files +MP_FILES = \ + mup_fixed.c\ + mup_functions.c\ + mup_pre.c + +OBJS = ${FILES:.c=.o} + +ifeq (${MP_BUILD}, 1) + +COBJS_single = ${FILES:.c=.o_flt} +COBJS_double = ${FILES:.c=.o_dbl} +COBJS_longdouble = ${FILES:.c=.o_ldbl} +MP_COBJS = ${MP_FILES:.c=.o} + +OBJS = ${COBJS_single} ${COBJS_double} ${COBJS_longdouble} ${MP_COBJS} + +endif ################################################################## # Targets ################################################################## all: ${OBJS} + cp -fR $(srcdir)/_hypre_blas.h $(HYPRE_BUILD_DIR)/include + cp -fR $(srcdir)/_hypre_*.h $(HYPRE_BUILD_DIR)/include install: all cp -fR $(srcdir)/_hypre_blas.h $(HYPRE_INC_INSTALL) + cp -fR $(srcdir)/_hypre_*.h $(HYPRE_INC_INSTALL) clean: rm -rf *.o + rm -f *.o_flt *.o_dbl *.o_ldbl distclean: clean @@ -59,4 +83,4 @@ distclean: clean # Rules ################################################################## -${OBJS}: ${BLAS_HEADERS} +${OBJS}: ${HEADERS} diff --git a/src/blas/_hypre_blas.h b/src/blas/_hypre_blas.h index 04aa431a79..db235ad2dc 100644 --- a/src/blas/_hypre_blas.h +++ b/src/blas/_hypre_blas.h @@ -15,10 +15,14 @@ #define HYPRE_BLAS_H #include "_hypre_utilities.h" -#include "fortran.h" +#include "_hypre_fortran.h" #include +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_blas_mup_def.h" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -148,4 +152,15 @@ HYPRE_Int hypre_idamax ( HYPRE_Int *n , HYPRE_Real *dx , HYPRE_Int *incx ); } #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_blas_mup_undef.h" +#include "_hypre_blas_mup.h" +#endif +#endif + #endif diff --git a/src/blas/_hypre_blas_mup.h b/src/blas/_hypre_blas_mup.h new file mode 100644 index 0000000000..ce0cd56754 --- /dev/null +++ b/src/blas/_hypre_blas_mup.h @@ -0,0 +1,200 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#ifndef hypre_BLAS_MUP_HEADER +#define hypre_BLAS_MUP_HEADER + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (HYPRE_MIXED_PRECISION) + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Real +hypre_dasum_flt( HYPRE_Int *n, hypre_float *dx, HYPRE_Int *incx ); +HYPRE_Real +hypre_dasum_dbl( HYPRE_Int *n, hypre_double *dx, HYPRE_Int *incx ); +HYPRE_Real +hypre_dasum_long_dbl( HYPRE_Int *n, hypre_long_double *dx, HYPRE_Int *incx ); + +HYPRE_Int +hypre_daxpy_flt( HYPRE_Int *n, hypre_float *da, hypre_float *dx, HYPRE_Int *incx, hypre_float *dy, HYPRE_Int *incy ); +HYPRE_Int +hypre_daxpy_dbl( HYPRE_Int *n, hypre_double *da, hypre_double *dx, HYPRE_Int *incx, hypre_double *dy, HYPRE_Int *incy ); +HYPRE_Int +hypre_daxpy_long_dbl( HYPRE_Int *n, hypre_long_double *da, hypre_long_double *dx, HYPRE_Int *incx, hypre_long_double *dy, HYPRE_Int *incy ); + +HYPRE_Int +hypre_dcopy_flt( HYPRE_Int *n, hypre_float *dx, HYPRE_Int *incx, hypre_float *dy, HYPRE_Int *incy ); +HYPRE_Int +hypre_dcopy_dbl( HYPRE_Int *n, hypre_double *dx, HYPRE_Int *incx, hypre_double *dy, HYPRE_Int *incy ); +HYPRE_Int +hypre_dcopy_long_dbl( HYPRE_Int *n, hypre_long_double *dx, HYPRE_Int *incx, hypre_long_double *dy, HYPRE_Int *incy ); + +HYPRE_Real +hypre_ddot_flt( HYPRE_Int *n, hypre_float *dx, HYPRE_Int *incx, hypre_float *dy, HYPRE_Int *incy ); +HYPRE_Real +hypre_ddot_dbl( HYPRE_Int *n, hypre_double *dx, HYPRE_Int *incx, hypre_double *dy, HYPRE_Int *incy ); +HYPRE_Real +hypre_ddot_long_dbl( HYPRE_Int *n, hypre_long_double *dx, HYPRE_Int *incx, hypre_long_double *dy, HYPRE_Int *incy ); + +HYPRE_Int +hypre_dgemm_flt( const char *transa, const char *transb, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_float *alpha, hypre_float *a, HYPRE_Int *lda, hypre_float *b, HYPRE_Int *ldb, hypre_float *beta, hypre_float *c, HYPRE_Int *ldc ); +HYPRE_Int +hypre_dgemm_dbl( const char *transa, const char *transb, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_double *alpha, hypre_double *a, HYPRE_Int *lda, hypre_double *b, HYPRE_Int *ldb, hypre_double *beta, hypre_double *c, HYPRE_Int *ldc ); +HYPRE_Int +hypre_dgemm_long_dbl( const char *transa, const char *transb, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_long_double *alpha, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *b, HYPRE_Int *ldb, hypre_long_double *beta, hypre_long_double *c, HYPRE_Int *ldc ); + +HYPRE_Int +hypre_dgemv_flt( const char *trans, HYPRE_Int *m, HYPRE_Int *n, hypre_float *alpha, hypre_float *a, HYPRE_Int *lda, hypre_float *x, HYPRE_Int *incx, hypre_float *beta, hypre_float *y, HYPRE_Int *incy ); +HYPRE_Int +hypre_dgemv_dbl( const char *trans, HYPRE_Int *m, HYPRE_Int *n, hypre_double *alpha, hypre_double *a, HYPRE_Int *lda, hypre_double *x, HYPRE_Int *incx, hypre_double *beta, hypre_double *y, HYPRE_Int *incy ); +HYPRE_Int +hypre_dgemv_long_dbl( const char *trans, HYPRE_Int *m, HYPRE_Int *n, hypre_long_double *alpha, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *x, HYPRE_Int *incx, hypre_long_double *beta, hypre_long_double *y, HYPRE_Int *incy ); + +HYPRE_Int +hypre_dger_flt( HYPRE_Int *m, HYPRE_Int *n, hypre_float *alpha, hypre_float *x, HYPRE_Int *incx, hypre_float *y, HYPRE_Int *incy, hypre_float *a, HYPRE_Int *lda ); +HYPRE_Int +hypre_dger_dbl( HYPRE_Int *m, HYPRE_Int *n, hypre_double *alpha, hypre_double *x, HYPRE_Int *incx, hypre_double *y, HYPRE_Int *incy, hypre_double *a, HYPRE_Int *lda ); +HYPRE_Int +hypre_dger_long_dbl( HYPRE_Int *m, HYPRE_Int *n, hypre_long_double *alpha, hypre_long_double *x, HYPRE_Int *incx, hypre_long_double *y, HYPRE_Int *incy, hypre_long_double *a, HYPRE_Int *lda ); + +HYPRE_Real +hypre_dnrm2_flt( HYPRE_Int *n, hypre_float *dx, HYPRE_Int *incx ); +HYPRE_Real +hypre_dnrm2_dbl( HYPRE_Int *n, hypre_double *dx, HYPRE_Int *incx ); +HYPRE_Real +hypre_dnrm2_long_dbl( HYPRE_Int *n, hypre_long_double *dx, HYPRE_Int *incx ); + +HYPRE_Int +hypre_drot_flt( HYPRE_Int *n, hypre_float *dx, HYPRE_Int *incx, hypre_float *dy, HYPRE_Int *incy, hypre_float *c, hypre_float *s ); +HYPRE_Int +hypre_drot_dbl( HYPRE_Int *n, hypre_double *dx, HYPRE_Int *incx, hypre_double *dy, HYPRE_Int *incy, hypre_double *c, hypre_double *s ); +HYPRE_Int +hypre_drot_long_dbl( HYPRE_Int *n, hypre_long_double *dx, HYPRE_Int *incx, hypre_long_double *dy, HYPRE_Int *incy, hypre_long_double *c, hypre_long_double *s ); + +HYPRE_Int +hypre_dscal_flt( HYPRE_Int *n, hypre_float *da, hypre_float *dx, HYPRE_Int *incx ); +HYPRE_Int +hypre_dscal_dbl( HYPRE_Int *n, hypre_double *da, hypre_double *dx, HYPRE_Int *incx ); +HYPRE_Int +hypre_dscal_long_dbl( HYPRE_Int *n, hypre_long_double *da, hypre_long_double *dx, HYPRE_Int *incx ); + +HYPRE_Int +hypre_dswap_flt( HYPRE_Int *n, hypre_float *dx, HYPRE_Int *incx, hypre_float *dy, HYPRE_Int *incy ); +HYPRE_Int +hypre_dswap_dbl( HYPRE_Int *n, hypre_double *dx, HYPRE_Int *incx, hypre_double *dy, HYPRE_Int *incy ); +HYPRE_Int +hypre_dswap_long_dbl( HYPRE_Int *n, hypre_long_double *dx, HYPRE_Int *incx, hypre_long_double *dy, HYPRE_Int *incy ); + +HYPRE_Int +hypre_dsymm_flt( const char *side, const char *uplo, HYPRE_Int *m, HYPRE_Int *n, hypre_float *alpha, hypre_float *a, HYPRE_Int *lda, hypre_float *b, HYPRE_Int *ldb, hypre_float *beta, hypre_float *c__, HYPRE_Int *ldc ); +HYPRE_Int +hypre_dsymm_dbl( const char *side, const char *uplo, HYPRE_Int *m, HYPRE_Int *n, hypre_double *alpha, hypre_double *a, HYPRE_Int *lda, hypre_double *b, HYPRE_Int *ldb, hypre_double *beta, hypre_double *c__, HYPRE_Int *ldc ); +HYPRE_Int +hypre_dsymm_long_dbl( const char *side, const char *uplo, HYPRE_Int *m, HYPRE_Int *n, hypre_long_double *alpha, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *b, HYPRE_Int *ldb, hypre_long_double *beta, hypre_long_double *c__, HYPRE_Int *ldc ); + +HYPRE_Int +hypre_dsymv_flt( const char *uplo, HYPRE_Int *n, hypre_float *alpha, hypre_float *a, HYPRE_Int *lda, hypre_float *x, HYPRE_Int *incx, hypre_float *beta, hypre_float *y, HYPRE_Int *incy ); +HYPRE_Int +hypre_dsymv_dbl( const char *uplo, HYPRE_Int *n, hypre_double *alpha, hypre_double *a, HYPRE_Int *lda, hypre_double *x, HYPRE_Int *incx, hypre_double *beta, hypre_double *y, HYPRE_Int *incy ); +HYPRE_Int +hypre_dsymv_long_dbl( const char *uplo, HYPRE_Int *n, hypre_long_double *alpha, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *x, HYPRE_Int *incx, hypre_long_double *beta, hypre_long_double *y, HYPRE_Int *incy ); + +HYPRE_Int +hypre_dsyr2_flt( const char *uplo, HYPRE_Int *n, hypre_float *alpha, hypre_float *x, HYPRE_Int *incx, hypre_float *y, HYPRE_Int *incy, hypre_float *a, HYPRE_Int *lda ); +HYPRE_Int +hypre_dsyr2_dbl( const char *uplo, HYPRE_Int *n, hypre_double *alpha, hypre_double *x, HYPRE_Int *incx, hypre_double *y, HYPRE_Int *incy, hypre_double *a, HYPRE_Int *lda ); +HYPRE_Int +hypre_dsyr2_long_dbl( const char *uplo, HYPRE_Int *n, hypre_long_double *alpha, hypre_long_double *x, HYPRE_Int *incx, hypre_long_double *y, HYPRE_Int *incy, hypre_long_double *a, HYPRE_Int *lda ); + +HYPRE_Int +hypre_dsyr2k_flt( const char *uplo, const char *trans, HYPRE_Int *n, HYPRE_Int *k, hypre_float *alpha, hypre_float *a, HYPRE_Int *lda, hypre_float *b, HYPRE_Int *ldb, hypre_float *beta, hypre_float *c__, HYPRE_Int *ldc ); +HYPRE_Int +hypre_dsyr2k_dbl( const char *uplo, const char *trans, HYPRE_Int *n, HYPRE_Int *k, hypre_double *alpha, hypre_double *a, HYPRE_Int *lda, hypre_double *b, HYPRE_Int *ldb, hypre_double *beta, hypre_double *c__, HYPRE_Int *ldc ); +HYPRE_Int +hypre_dsyr2k_long_dbl( const char *uplo, const char *trans, HYPRE_Int *n, HYPRE_Int *k, hypre_long_double *alpha, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *b, HYPRE_Int *ldb, hypre_long_double *beta, hypre_long_double *c__, HYPRE_Int *ldc ); + +HYPRE_Int +hypre_dsyrk_flt( const char *uplo, const char *trans, HYPRE_Int *n, HYPRE_Int *k, hypre_float *alpha, hypre_float *a, HYPRE_Int *lda, hypre_float *beta, hypre_float *c, HYPRE_Int *ldc ); +HYPRE_Int +hypre_dsyrk_dbl( const char *uplo, const char *trans, HYPRE_Int *n, HYPRE_Int *k, hypre_double *alpha, hypre_double *a, HYPRE_Int *lda, hypre_double *beta, hypre_double *c, HYPRE_Int *ldc ); +HYPRE_Int +hypre_dsyrk_long_dbl( const char *uplo, const char *trans, HYPRE_Int *n, HYPRE_Int *k, hypre_long_double *alpha, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *beta, hypre_long_double *c, HYPRE_Int *ldc ); + +HYPRE_Int +hypre_dtrmm_flt( const char *side, const char *uplo, const char *transa, const char *diag, HYPRE_Int *m, HYPRE_Int *n, hypre_float *alpha, hypre_float *a, HYPRE_Int *lda, hypre_float *b, HYPRE_Int *ldb ); +HYPRE_Int +hypre_dtrmm_dbl( const char *side, const char *uplo, const char *transa, const char *diag, HYPRE_Int *m, HYPRE_Int *n, hypre_double *alpha, hypre_double *a, HYPRE_Int *lda, hypre_double *b, HYPRE_Int *ldb ); +HYPRE_Int +hypre_dtrmm_long_dbl( const char *side, const char *uplo, const char *transa, const char *diag, HYPRE_Int *m, HYPRE_Int *n, hypre_long_double *alpha, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *b, HYPRE_Int *ldb ); + +HYPRE_Int +hypre_dtrmv_flt( const char *uplo, const char *trans, const char *diag, HYPRE_Int *n, hypre_float *a, HYPRE_Int *lda, hypre_float *x, HYPRE_Int *incx ); +HYPRE_Int +hypre_dtrmv_dbl( const char *uplo, const char *trans, const char *diag, HYPRE_Int *n, hypre_double *a, HYPRE_Int *lda, hypre_double *x, HYPRE_Int *incx ); +HYPRE_Int +hypre_dtrmv_long_dbl( const char *uplo, const char *trans, const char *diag, HYPRE_Int *n, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *x, HYPRE_Int *incx ); + +HYPRE_Int +hypre_dtrsm_flt( const char *side, const char *uplo, const char *transa, const char *diag, HYPRE_Int *m, HYPRE_Int *n, hypre_float *alpha, hypre_float *a, HYPRE_Int *lda, hypre_float *b, HYPRE_Int *ldb ); +HYPRE_Int +hypre_dtrsm_dbl( const char *side, const char *uplo, const char *transa, const char *diag, HYPRE_Int *m, HYPRE_Int *n, hypre_double *alpha, hypre_double *a, HYPRE_Int *lda, hypre_double *b, HYPRE_Int *ldb ); +HYPRE_Int +hypre_dtrsm_long_dbl( const char *side, const char *uplo, const char *transa, const char *diag, HYPRE_Int *m, HYPRE_Int *n, hypre_long_double *alpha, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *b, HYPRE_Int *ldb ); + +HYPRE_Int +hypre_dtrsv_flt( const char *uplo, const char *trans, const char *diag, HYPRE_Int *n, hypre_float *a, HYPRE_Int *lda, hypre_float *x, HYPRE_Int *incx ); +HYPRE_Int +hypre_dtrsv_dbl( const char *uplo, const char *trans, const char *diag, HYPRE_Int *n, hypre_double *a, HYPRE_Int *lda, hypre_double *x, HYPRE_Int *incx ); +HYPRE_Int +hypre_dtrsv_long_dbl( const char *uplo, const char *trans, const char *diag, HYPRE_Int *n, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *x, HYPRE_Int *incx ); + +HYPRE_Int +hypre_idamax_flt( HYPRE_Int *n, hypre_float *dx, HYPRE_Int *incx ); +HYPRE_Int +hypre_idamax_dbl( HYPRE_Int *n, hypre_double *dx, HYPRE_Int *incx ); +HYPRE_Int +hypre_idamax_long_dbl( HYPRE_Int *n, hypre_long_double *dx, HYPRE_Int *incx ); + + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + + + +#endif + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/src/blas/_hypre_blas_mup_def.h b/src/blas/_hypre_blas_mup_def.h new file mode 100644 index 0000000000..7c7a4d82c2 --- /dev/null +++ b/src/blas/_hypre_blas_mup_def.h @@ -0,0 +1,49 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#ifndef hypre_BLAS_MUP_DEF_HEADER +#define hypre_BLAS_MUP_DEF_HEADER + +#include "_hypre_mup_def.h" + +#define hypre_blas_lsame HYPRE_FIXEDPRECISION_FUNC ( hypre_blas_lsame ) +#define hypre_blas_xerbla HYPRE_FIXEDPRECISION_FUNC ( hypre_blas_xerbla ) +#define hypre_d_lg10 HYPRE_FIXEDPRECISION_FUNC ( hypre_d_lg10 ) +#define hypre_d_sign HYPRE_FIXEDPRECISION_FUNC ( hypre_d_sign ) +#define hypre_dasum HYPRE_FIXEDPRECISION_FUNC ( hypre_dasum ) +#define hypre_daxpy HYPRE_FIXEDPRECISION_FUNC ( hypre_daxpy ) +#define hypre_dcopy HYPRE_FIXEDPRECISION_FUNC ( hypre_dcopy ) +#define hypre_ddot HYPRE_FIXEDPRECISION_FUNC ( hypre_ddot ) +#define hypre_dgemm HYPRE_FIXEDPRECISION_FUNC ( hypre_dgemm ) +#define hypre_dgemv HYPRE_FIXEDPRECISION_FUNC ( hypre_dgemv ) +#define hypre_dger HYPRE_FIXEDPRECISION_FUNC ( hypre_dger ) +#define hypre_dnrm2 HYPRE_FIXEDPRECISION_FUNC ( hypre_dnrm2 ) +#define hypre_drot HYPRE_FIXEDPRECISION_FUNC ( hypre_drot ) +#define hypre_dscal HYPRE_FIXEDPRECISION_FUNC ( hypre_dscal ) +#define hypre_dswap HYPRE_FIXEDPRECISION_FUNC ( hypre_dswap ) +#define hypre_dsymm HYPRE_FIXEDPRECISION_FUNC ( hypre_dsymm ) +#define hypre_dsymv HYPRE_FIXEDPRECISION_FUNC ( hypre_dsymv ) +#define hypre_dsyr2 HYPRE_FIXEDPRECISION_FUNC ( hypre_dsyr2 ) +#define hypre_dsyr2k HYPRE_FIXEDPRECISION_FUNC ( hypre_dsyr2k ) +#define hypre_dsyrk HYPRE_FIXEDPRECISION_FUNC ( hypre_dsyrk ) +#define hypre_dtrmm HYPRE_FIXEDPRECISION_FUNC ( hypre_dtrmm ) +#define hypre_dtrmv HYPRE_FIXEDPRECISION_FUNC ( hypre_dtrmv ) +#define hypre_dtrsm HYPRE_FIXEDPRECISION_FUNC ( hypre_dtrsm ) +#define hypre_dtrsv HYPRE_FIXEDPRECISION_FUNC ( hypre_dtrsv ) +#define hypre_idamax HYPRE_FIXEDPRECISION_FUNC ( hypre_idamax ) +#define hypre_pow_dd HYPRE_FIXEDPRECISION_FUNC ( hypre_pow_dd ) +#define hypre_pow_di HYPRE_FIXEDPRECISION_FUNC ( hypre_pow_di ) +#define hypre_s_cat HYPRE_FIXEDPRECISION_FUNC ( hypre_s_cat ) +#define hypre_s_cmp HYPRE_FIXEDPRECISION_FUNC ( hypre_s_cmp ) +#define hypre_s_copy HYPRE_FIXEDPRECISION_FUNC ( hypre_s_copy ) + +#endif diff --git a/src/blas/_hypre_blas_mup_undef.h b/src/blas/_hypre_blas_mup_undef.h new file mode 100644 index 0000000000..892e0627d4 --- /dev/null +++ b/src/blas/_hypre_blas_mup_undef.h @@ -0,0 +1,44 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#undef hypre_BLAS_MUP_DEF_HEADER + +#undef hypre_blas_lsame +#undef hypre_blas_xerbla +#undef hypre_d_lg10 +#undef hypre_d_sign +#undef hypre_dasum +#undef hypre_daxpy +#undef hypre_dcopy +#undef hypre_ddot +#undef hypre_dgemm +#undef hypre_dgemv +#undef hypre_dger +#undef hypre_dnrm2 +#undef hypre_drot +#undef hypre_dscal +#undef hypre_dswap +#undef hypre_dsymm +#undef hypre_dsymv +#undef hypre_dsyr2 +#undef hypre_dsyr2k +#undef hypre_dsyrk +#undef hypre_dtrmm +#undef hypre_dtrmv +#undef hypre_dtrsm +#undef hypre_dtrsv +#undef hypre_idamax +#undef hypre_pow_dd +#undef hypre_pow_di +#undef hypre_s_cat +#undef hypre_s_cmp +#undef hypre_s_copy diff --git a/src/blas/hypre_blas.h b/src/blas/hypre_blas.h index 61604c9d19..0be878e1e4 100644 --- a/src/blas/hypre_blas.h +++ b/src/blas/hypre_blas.h @@ -11,6 +11,11 @@ * This header renames the functions in BLAS to avoid conflicts *--------------------------------------------------------------------------*/ +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_blas_mup_def.h" +#endif + + /* blas */ #define dasum_ hypre_dasum #define daxpy_ hypre_daxpy diff --git a/src/blas/mup.fixed b/src/blas/mup.fixed new file mode 100644 index 0000000000..4d7dbeb8bf --- /dev/null +++ b/src/blas/mup.fixed @@ -0,0 +1,30 @@ +hypre_blas_lsame +hypre_blas_xerbla +hypre_d_lg10 +hypre_d_sign +hypre_dasum +hypre_daxpy +hypre_dcopy +hypre_ddot +hypre_dgemm +hypre_dgemv +hypre_dger +hypre_dnrm2 +hypre_drot +hypre_dscal +hypre_dswap +hypre_dsymm +hypre_dsymv +hypre_dsyr2 +hypre_dsyr2k +hypre_dsyrk +hypre_dtrmm +hypre_dtrmv +hypre_dtrsm +hypre_dtrsv +hypre_idamax +hypre_pow_dd +hypre_pow_di +hypre_s_cat +hypre_s_cmp +hypre_s_copy diff --git a/src/blas/mup.functions b/src/blas/mup.functions new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/blas/mup.methods b/src/blas/mup.methods new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/blas/mup_code b/src/blas/mup_code new file mode 100755 index 0000000000..db1ff3734a --- /dev/null +++ b/src/blas/mup_code @@ -0,0 +1,11 @@ +#!/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) + +touch mup_fake_ext.h + +../config/gen_code.sh mup_fake_ext.h _hypre_blas.h mup + +rm -f mup_fake_ext.h mup_fake_ext_mup.h diff --git a/src/blas/mup_fixed.c b/src/blas/mup_fixed.c new file mode 100644 index 0000000000..24531cf3e5 --- /dev/null +++ b/src/blas/mup_fixed.c @@ -0,0 +1,187 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_blas.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Real +hypre_dasum( HYPRE_Int *n, HYPRE_Real *dx, HYPRE_Int *incx ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dasum)( n, dx, incx ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_daxpy( HYPRE_Int *n, HYPRE_Real *da, HYPRE_Real *dx, HYPRE_Int *incx, HYPRE_Real *dy, HYPRE_Int *incy ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_daxpy)( n, da, dx, incx, dy, incy ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dcopy( HYPRE_Int *n, HYPRE_Real *dx, HYPRE_Int *incx, HYPRE_Real *dy, HYPRE_Int *incy ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dcopy)( n, dx, incx, dy, incy ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +hypre_ddot( HYPRE_Int *n, HYPRE_Real *dx, HYPRE_Int *incx, HYPRE_Real *dy, HYPRE_Int *incy ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ddot)( n, dx, incx, dy, incy ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dgemm( const char *transa, const char *transb, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, HYPRE_Real *alpha, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *b, HYPRE_Int *ldb, HYPRE_Real *beta, HYPRE_Real *c, HYPRE_Int *ldc ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dgemm)( transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dgemv( const char *trans, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Real *alpha, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *x, HYPRE_Int *incx, HYPRE_Real *beta, HYPRE_Real *y, HYPRE_Int *incy ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dgemv)( trans, m, n, alpha, a, lda, x, incx, beta, y, incy ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dger( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Real *alpha, HYPRE_Real *x, HYPRE_Int *incx, HYPRE_Real *y, HYPRE_Int *incy, HYPRE_Real *a, HYPRE_Int *lda ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dger)( m, n, alpha, x, incx, y, incy, a, lda ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +hypre_dnrm2( HYPRE_Int *n, HYPRE_Real *dx, HYPRE_Int *incx ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dnrm2)( n, dx, incx ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_drot( HYPRE_Int *n, HYPRE_Real *dx, HYPRE_Int *incx, HYPRE_Real *dy, HYPRE_Int *incy, HYPRE_Real *c, HYPRE_Real *s ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_drot)( n, dx, incx, dy, incy, c, s ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dscal( HYPRE_Int *n, HYPRE_Real *da, HYPRE_Real *dx, HYPRE_Int *incx ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dscal)( n, da, dx, incx ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dswap( HYPRE_Int *n, HYPRE_Real *dx, HYPRE_Int *incx, HYPRE_Real *dy, HYPRE_Int *incy ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dswap)( n, dx, incx, dy, incy ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dsymm( const char *side, const char *uplo, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Real *alpha, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *b, HYPRE_Int *ldb, HYPRE_Real *beta, HYPRE_Real *c__, HYPRE_Int *ldc ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dsymm)( side, uplo, m, n, alpha, a, lda, b, ldb, beta, c__, ldc ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dsymv( const char *uplo, HYPRE_Int *n, HYPRE_Real *alpha, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *x, HYPRE_Int *incx, HYPRE_Real *beta, HYPRE_Real *y, HYPRE_Int *incy ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dsymv)( uplo, n, alpha, a, lda, x, incx, beta, y, incy ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dsyr2( const char *uplo, HYPRE_Int *n, HYPRE_Real *alpha, HYPRE_Real *x, HYPRE_Int *incx, HYPRE_Real *y, HYPRE_Int *incy, HYPRE_Real *a, HYPRE_Int *lda ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dsyr2)( uplo, n, alpha, x, incx, y, incy, a, lda ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dsyr2k( const char *uplo, const char *trans, HYPRE_Int *n, HYPRE_Int *k, HYPRE_Real *alpha, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *b, HYPRE_Int *ldb, HYPRE_Real *beta, HYPRE_Real *c__, HYPRE_Int *ldc ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dsyr2k)( uplo, trans, n, k, alpha, a, lda, b, ldb, beta, c__, ldc ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dsyrk( const char *uplo, const char *trans, HYPRE_Int *n, HYPRE_Int *k, HYPRE_Real *alpha, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *beta, HYPRE_Real *c, HYPRE_Int *ldc ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dsyrk)( uplo, trans, n, k, alpha, a, lda, beta, c, ldc ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dtrmm( const char *side, const char *uplo, const char *transa, const char *diag, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Real *alpha, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *b, HYPRE_Int *ldb ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dtrmm)( side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dtrmv( const char *uplo, const char *trans, const char *diag, HYPRE_Int *n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *x, HYPRE_Int *incx ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dtrmv)( uplo, trans, diag, n, a, lda, x, incx ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dtrsm( const char *side, const char *uplo, const char *transa, const char *diag, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Real *alpha, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *b, HYPRE_Int *ldb ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dtrsm)( side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dtrsv( const char *uplo, const char *trans, const char *diag, HYPRE_Int *n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *x, HYPRE_Int *incx ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dtrsv)( uplo, trans, diag, n, a, lda, x, incx ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_idamax( HYPRE_Int *n, HYPRE_Real *dx, HYPRE_Int *incx ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_idamax)( n, dx, incx ); +} + + +#endif + diff --git a/src/sstruct_ls/sstruct_sharedDOFComm.h b/src/blas/mup_functions.c similarity index 71% rename from src/sstruct_ls/sstruct_sharedDOFComm.h rename to src/blas/mup_functions.c index 3863107074..26a2775c53 100644 --- a/src/sstruct_ls/sstruct_sharedDOFComm.h +++ b/src/blas/mup_functions.c @@ -1,3 +1,10 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_blas.h" + +#ifdef HYPRE_MIXED_PRECISION + /****************************************************************************** * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. @@ -5,13 +12,8 @@ * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ -typedef struct -{ - HYPRE_BigInt row; - HYPRE_Int ncols; - HYPRE_BigInt *cols; - HYPRE_Real *data; -} hypre_MaxwellOffProcRow; + +#endif diff --git a/src/sstruct_ls/maxwell_PTopology.h b/src/blas/mup_pre.c similarity index 63% rename from src/sstruct_ls/maxwell_PTopology.h rename to src/blas/mup_pre.c index 33e2d4ca64..26a2775c53 100644 --- a/src/sstruct_ls/maxwell_PTopology.h +++ b/src/blas/mup_pre.c @@ -1,3 +1,10 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_blas.h" + +#ifdef HYPRE_MIXED_PRECISION + /****************************************************************************** * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. @@ -5,14 +12,8 @@ * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ -typedef struct -{ - hypre_IJMatrix *Face_iedge; - hypre_IJMatrix *Element_iedge; - hypre_IJMatrix *Edge_iedge; - hypre_IJMatrix *Element_Face; - hypre_IJMatrix *Element_Edge; -} hypre_PTopology; + +#endif diff --git a/src/config/HYPREConfig.cmake.in b/src/config/HYPREConfig.cmake.in index 44c48027e9..07e7b9ebf5 100644 --- a/src/config/HYPREConfig.cmake.in +++ b/src/config/HYPREConfig.cmake.in @@ -25,6 +25,7 @@ set(HYPRE_ENABLE_MIXEDINT @HYPRE_ENABLE_MIXEDINT@) set(HYPRE_ENABLE_SINGLE @HYPRE_ENABLE_SINGLE@) set(HYPRE_ENABLE_LONG_DOUBLE @HYPRE_ENABLE_LONG_DOUBLE@) set(HYPRE_ENABLE_COMPLEX @HYPRE_ENABLE_COMPLEX@) +set(HYPRE_ENABLE_MIXED_PRECISION @HYPRE_ENABLE_MIXED_PRECISION@) set(HYPRE_ENABLE_HYPRE_BLAS @HYPRE_ENABLE_HYPRE_BLAS@) set(HYPRE_ENABLE_HYPRE_LAPACK @HYPRE_ENABLE_HYPRE_LAPACK@) set(HYPRE_ENABLE_PERSISTENT_COMM @HYPRE_ENABLE_PERSISTENT_COMM@) @@ -43,7 +44,7 @@ set(HYPRE_ENABLE_UNIFIED_MEMORY @HYPRE_ENABLE_UNIFIED_MEMORY@) set(HYPRE_ENABLE_CUDA_STREAMS @HYPRE_ENABLE_CUDA_STREAMS@) set(HYPRE_ENABLE_DEVICE_POOL @HYPRE_ENABLE_DEVICE_POOL@) set(HYPRE_ENABLE_DEVICE_MALLOC_ASYNC @HYPRE_ENABLE_DEVICE_MALLOC_ASYNC@) -set(HYPRE_ENABLE_THRUST_ASYNC @HYPRE_ENABLE_THRUST_ASYNC@) +set(HYPRE_ENABLE_THRUST_NOSYNC @HYPRE_ENABLE_THRUST_NOSYNC@) set(HYPRE_ENABLE_CUSPARSE @HYPRE_ENABLE_CUSPARSE@) set(HYPRE_ENABLE_CUBLAS @HYPRE_ENABLE_CUBLAS@) set(HYPRE_ENABLE_CURAND @HYPRE_ENABLE_CURAND@) diff --git a/src/config/HYPRE_config.h.cmake.in b/src/config/HYPRE_config.h.cmake.in index 1cec66669c..5cd92afde4 100644 --- a/src/config/HYPRE_config.h.cmake.in +++ b/src/config/HYPRE_config.h.cmake.in @@ -23,6 +23,9 @@ /* Use long long int for HYPRE_BigInt and HYPRE_Int*/ #cmakedefine HYPRE_BIGINT 1 +/* Use mixed-precision for HYPRE_Real type */ +#cmakedefine HYPRE_MIXED_PRECISION 1 + /* Use single precision values for HYPRE_Real */ #cmakedefine HYPRE_SINGLE 1 @@ -36,7 +39,7 @@ #cmakedefine HYPRE_USING_DEVICE_MALLOC_ASYNC 1 /* Use Thrust par_nosync policy */ -#cmakedefine HYPRE_ENABLE_THRUST_ASYNC 1 +#cmakedefine HYPRE_ENABLE_THRUST_NOSYNC 1 /* Use GPU-aware MPI */ #cmakedefine HYPRE_USING_GPU_AWARE_MPI 1 diff --git a/src/config/HYPRE_config.h.in b/src/config/HYPRE_config.h.in index d286d8ba20..3de044d0c1 100644 --- a/src/config/HYPRE_config.h.in +++ b/src/config/HYPRE_config.h.in @@ -118,6 +118,9 @@ /* Define to 1 if using long long int for HYPRE_BigInt */ #undef HYPRE_MIXEDINT +/* Define to 1 if using mixed-precision for HYPRE_Real type */ +#undef HYPRE_MIXED_PRECISION + /* Print HYPRE errors */ #undef HYPRE_PRINT_ERRORS diff --git a/src/config/Makefile.config.in b/src/config/Makefile.config.in index 1bb6b7e919..54fffad5b7 100644 --- a/src/config/Makefile.config.in +++ b/src/config/Makefile.config.in @@ -34,7 +34,7 @@ HYPRE_INC_INSTALL = @HYPRE_INCINSTALL@ HYPRE_LIB_SUFFIX = @HYPRE_LIBSUFFIX@ .SUFFIXES: -.SUFFIXES: .o .obj .f .c .C .cxx .cc +.SUFFIXES: .o .obj .f .c .C .cxx .cc .o_flt .o_dbl .o_ldbl .obj_flt .obj_dbl .obj_ldbl FC = @FC@ FFLAGS = @FFLAGS@ @FCFLAGS@ $(FC_COMPILE_FLAGS) @@ -66,6 +66,33 @@ else $(CUCC) $(CUFLAGS) -c $< -o $@ endif +# START Mixed precision build rules + +.c.o_flt: + ${CC} ${CFLAGS} -DMP_BUILD_SINGLE=1 -c $< -o $@ +.c.o_dbl: + ${CC} ${CFLAGS} -DMP_BUILD_DOUBLE=1 -c $< -o $@ +.c.o_ldbl: + ${CC} ${CFLAGS} -DMP_BUILD_LONGDOUBLE=1 -c $< -o $@ + +ifeq ($(CUCC), ) +.c.obj_flt: + ${CC} ${CFLAGS} -DMP_BUILD_SINGLE=1 -c $< -o $@ +.c.obj_dbl: + ${CC} ${CFLAGS} -DMP_BUILD_DOUBLE=1 -c $< -o $@ +.c.obj_ldbl: + ${CC} ${CFLAGS} -DMP_BUILD_LONGDOUBLE=1 -c $< -o $@ +else +.c.obj_flt: + ${CUCC} ${CUFLAGS} -DMP_BUILD_SINGLE=1 -c $< -o $@ +.c.obj_dbl: + ${CUCC} ${CUFLAGS} -DMP_BUILD_DOUBLE=1 -c $< -o $@ +.c.obj_ldbl: + ${CUCC} ${CUFLAGS} -DMP_BUILD_LONGDOUBLE=1 -c $< -o $@ +endif + +# END Mixed precision build rules + LINK_FC = @LINK_FC@ LINK_CC = @LINK_CC@ LINK_CXX = @LINK_CXX@ @@ -78,6 +105,8 @@ SHARED_BUILD_FLAG = @SHARED_BUILD_FLAG@ SHARED_SET_SONAME = @SHARED_SET_SONAME@ SHARED_OPTIONS = @SHARED_OPTIONS@ +MP_BUILD = @MP_BUILD@ + BUILD_PYTHON = @BUILD_PYTHON@ PYTHON = @PYTHON@ diff --git a/src/config/astyle-apply.sh b/src/config/astyle-apply.sh index ef2a559ef0..8c6c63138a 100755 --- a/src/config/astyle-apply.sh +++ b/src/config/astyle-apply.sh @@ -54,6 +54,8 @@ find . -type f -print | egrep '[.]*[.](c|cc|cpp|cxx|C|h|hpp|hxx|H)$' | egrep -v '/blas' | egrep -v '/lapack' | egrep -v '/distributed' | + egrep -v '/mup' | + egrep -v '_mup[.]h' | egrep -v '/hypre/include' | egrep -v '/HYPREf[.]h' | egrep -v '/utilities/HYPRE_error_f[.]h' | diff --git a/src/config/cmake/HYPRE_CMakeUtilities.cmake b/src/config/cmake/HYPRE_CMakeUtilities.cmake index a57564e425..43a059d162 100644 --- a/src/config/cmake/HYPRE_CMakeUtilities.cmake +++ b/src/config/cmake/HYPRE_CMakeUtilities.cmake @@ -5,6 +5,13 @@ # Function to set hypre build options function(set_hypre_option category name description default_value) + # Detect if the user explicitly set this option via -D on the command line + if(DEFINED CACHE{${name}}) + set(HYPRE_USER_SET_${name} ON CACHE INTERNAL "User explicitly set ${name}") + else() + set(HYPRE_USER_SET_${name} OFF CACHE INTERNAL "User explicitly set ${name}") + endif() + option(${name} "${description}" ${default_value}) if (${category} STREQUAL "CUDA" OR ${category} STREQUAL "HIP" OR ${category} STREQUAL "SYCL") if (HYPRE_ENABLE_${category} STREQUAL "ON") @@ -30,13 +37,13 @@ endfunction() function(setup_git_version_info HYPRE_GIT_DIR) set(GIT_VERSION_FOUND FALSE PARENT_SCOPE) if (EXISTS "${HYPRE_GIT_DIR}") - execute_process(COMMAND git -C ${HYPRE_GIT_DIR} describe --match v* --long --abbrev=9 + execute_process(COMMAND git -C ${HYPRE_GIT_DIR} describe --match v* --long --abbrev=9 --always OUTPUT_VARIABLE develop_string OUTPUT_STRIP_TRAILING_WHITESPACE RESULT_VARIABLE git_result) if (git_result EQUAL 0) set(GIT_VERSION_FOUND TRUE PARENT_SCOPE) - execute_process(COMMAND git -C ${HYPRE_GIT_DIR} describe --match v* --abbrev=0 + execute_process(COMMAND git -C ${HYPRE_GIT_DIR} describe --match v* --abbrev=0 --always OUTPUT_VARIABLE develop_lastag OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND git -C ${HYPRE_GIT_DIR} rev-list --count ${develop_lastag}..HEAD @@ -271,6 +278,7 @@ function(setup_tpl LIBNAME) if(EXISTS ${lib}) message(STATUS "${LIBNAME_UPPER} library found: ${lib}") get_filename_component(LIB_DIR "${lib}" DIRECTORY) + set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY BUILD_RPATH "${LIB_DIR}") set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY INSTALL_RPATH "${LIB_DIR}") else() message(WARNING "${LIBNAME_UPPER} library not found at specified path: ${lib}") @@ -280,8 +288,8 @@ function(setup_tpl LIBNAME) target_link_libraries(${PROJECT_NAME} PUBLIC ${TPL_${LIBNAME_UPPER}_LIBRARIES}) target_include_directories(${PROJECT_NAME} PUBLIC ${TPL_${LIBNAME_UPPER}_INCLUDE_DIRS}) else() - # Use find_package - find_package(${LIBNAME} REQUIRED CONFIG) + # Use find_package (prefer CONFIG). Provide clearer error for libraries when missing. + find_package(${LIBNAME} CONFIG) if(${LIBNAME}_FOUND) list(APPEND HYPRE_DEPENDENCY_DIRS "${${LIBNAME}_ROOT}") set(HYPRE_DEPENDENCY_DIRS "${HYPRE_DEPENDENCY_DIRS}" CACHE INTERNAL "" FORCE) @@ -300,7 +308,11 @@ function(setup_tpl LIBNAME) message(FATAL_ERROR "${LIBNAME} target not found. Please check your ${LIBNAME} installation") endif() else() - message(FATAL_ERROR "${LIBNAME_UPPER} target not found. Please check your ${LIBNAME_UPPER} installation") + if(${LIBNAME_UPPER} STREQUAL "UMPIRE") + message(FATAL_ERROR "\n===============================================================\nUmpire has been enabled for GPU builds to improve performance; However, it could not be found by CMake.\nEnsure Umpire provides a CMake package config so find_package(umpire) succeeds via ONE of the following:\n -Dumpire_ROOT=\"/path-to-umpire-install\" or\n -Dumpire_DIR=\"/path-to-umpire-install/lib/cmake/umpire/\".\nOr provide both options below:\n -DTPL_UMPIRE_INCLUDE_DIRS=\"/path-to-umpire-install/include\"\n -DTPL_UMPIRE_LIBRARIES=\"/path-to-umpire-install/lib/libumpire.so;...\"\nTo opt out (strongly not recommended), set -DHYPRE_ENABLE_UMPIRE=OFF.\n===============================================================") + else() + message(FATAL_ERROR "${LIBNAME_UPPER} target not found. Please check your ${LIBNAME_UPPER} installation") + endif() endif() # Display library info @@ -402,74 +414,104 @@ function(add_hypre_subdirectories DIRS) endforeach() endfunction() -# A function to add each executable in the list to the build with the -# correct flags, includes, and linkage. -function(add_hypre_executables EXE_SRCS) - # Add one executable per cpp file - foreach(SRC_FILE IN LISTS ${EXE_SRCS}) - get_filename_component(SRC_FILENAME ${SRC_FILE} NAME) +# A function to add an executable to the build with the correct flags, includes, and linkage. +function(add_hypre_executable SRC_FILE DEP_SRC_FILE) + get_filename_component(SRC_FILENAME ${SRC_FILE} NAME) + if (DEP_SRC_FILE) + get_filename_component(DEP_SRC_FILENAME ${DEP_SRC_FILE} NAME) + endif () - # If CUDA is enabled, tag source files to be compiled with nvcc. - if (HYPRE_USING_CUDA) - set_source_files_properties(${SRC_FILENAME} PROPERTIES LANGUAGE CUDA) + # If CUDA is enabled, tag source files to be compiled with nvcc. + if (HYPRE_USING_CUDA) + set_source_files_properties(${SRC_FILENAME} PROPERTIES LANGUAGE CUDA) + if (DEP_SRC_FILE) + set_source_files_properties(${DEP_SRC_FILENAME} PROPERTIES LANGUAGE CUDA) endif () + endif () - # If HIP is enabled, tag source files to be compiled with hipcc/clang - if (HYPRE_USING_HIP) - set_source_files_properties(${SRC_FILENAME} PROPERTIES LANGUAGE HIP) + # If HIP is enabled, tag source files to be compiled with hipcc/clang + if (HYPRE_USING_HIP) + set_source_files_properties(${SRC_FILENAME} PROPERTIES LANGUAGE HIP) + if (DEP_SRC_FILE) + set_source_files_properties(${DEP_SRC_FILENAME} PROPERTIES LANGUAGE HIP) endif () + endif () - # If SYCL is enabled, tag source files to be compiled with dpcpp. - if (HYPRE_USING_SYCL) - set_source_files_properties(${SRC_FILENAME} PROPERTIES LANGUAGE CXX) + # If SYCL is enabled, tag source files to be compiled with dpcpp. + if (HYPRE_USING_SYCL) + set_source_files_properties(${SRC_FILENAME} PROPERTIES LANGUAGE CXX) + if (DEP_SRC_FILE) + set_source_files_properties(${DEP_SRC_FILENAME} PROPERTIES LANGUAGE CXX) endif () + endif () - # Get executable name - string(REPLACE ".c" "" EXE_NAME ${SRC_FILENAME}) + # Get executable name + string(REPLACE ".c" "" EXE_NAME ${SRC_FILENAME}) - # Add the executable + # Add the executable, including DEP_SRC_FILE if provided + if (DEP_SRC_FILE) + add_executable(${EXE_NAME} ${SRC_FILE} ${DEP_SRC_FILE}) + else () add_executable(${EXE_NAME} ${SRC_FILE}) + endif () - # Link with HYPRE and inherit its compile properties - target_link_libraries(${EXE_NAME} PUBLIC HYPRE) + # Link with HYPRE and inherit its compile properties + target_link_libraries(${EXE_NAME} PUBLIC HYPRE) - # For Unix systems, also link with math library - if (UNIX) - target_link_libraries(${EXE_NAME} PUBLIC m) - endif () + # For Unix systems, also link with math library + if (UNIX) + target_link_libraries(${EXE_NAME} PUBLIC m) + endif () - # Explicitly specify the linker - if ((HYPRE_USING_CUDA AND NOT HYPRE_ENABLE_LTO) OR HYPRE_USING_HIP OR HYPRE_USING_SYCL) - set_target_properties(${EXE_NAME} PROPERTIES LINKER_LANGUAGE CXX) - endif () + # Explicitly specify the linker + if ((HYPRE_USING_CUDA AND NOT HYPRE_ENABLE_LTO) OR HYPRE_USING_HIP OR HYPRE_USING_SYCL) + set_target_properties(${EXE_NAME} PROPERTIES LINKER_LANGUAGE CXX) + endif () - # Turn on LTO if requested - if (HYPRE_ENABLE_LTO) - set_target_properties(${EXE_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE) - endif () + # Turn on LTO if requested + if (HYPRE_ENABLE_LTO) + set_target_properties(${EXE_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE) + endif () - # Inherit compile definitions and options from HYPRE target - get_target_property(HYPRE_COMPILE_OPTS HYPRE COMPILE_OPTIONS) - #message(STATUS "${EXE_NAME}: ${HYPRE_COMPILE_OPTS}") - if (HYPRE_COMPILE_OPTS) - if (HYPRE_USING_CUDA OR HYPRE_USING_HIP OR HYPRE_USING_SYCL) - get_language_flags("${HYPRE_COMPILE_OPTS}" CXX_OPTS "CXX") - target_compile_options(${EXE_NAME} PRIVATE $<$:${CXX_OPTS}>) - #message(STATUS "Added CXX compile options: ${CXX_OPTS} to ${EXE_NAME}") - else () - get_language_flags("${HYPRE_COMPILE_OPTS}" C_OPTS "C") - target_compile_options(${EXE_NAME} PRIVATE $<$:${C_OPTS}>) - #message(STATUS "Added C compile options: ${C_OPTS} to ${EXE_NAME}") - endif () + # Inherit compile definitions and options from HYPRE target + get_target_property(HYPRE_COMPILE_OPTS HYPRE COMPILE_OPTIONS) + if (HYPRE_COMPILE_OPTS) + if (HYPRE_USING_CUDA OR HYPRE_USING_HIP OR HYPRE_USING_SYCL) + get_language_flags("${HYPRE_COMPILE_OPTS}" CXX_OPTS "CXX") + target_compile_options(${EXE_NAME} PRIVATE $<$:${CXX_OPTS}>) + else () + get_language_flags("${HYPRE_COMPILE_OPTS}" C_OPTS "C") + target_compile_options(${EXE_NAME} PRIVATE $<$:${C_OPTS}>) endif () + endif () - # Copy executable to original source directory - add_custom_command(TARGET ${EXE_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_CURRENT_SOURCE_DIR} - COMMENT "Copied ${EXE_NAME} to ${CMAKE_CURRENT_SOURCE_DIR}" - ) - endforeach (SRC_FILE) -endfunction () + # Copy executable to original source directory + add_custom_command(TARGET ${EXE_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_CURRENT_SOURCE_DIR} + COMMENT "Copied ${EXE_NAME} to ${CMAKE_CURRENT_SOURCE_DIR}" + ) +endfunction() + +# Function to process a list of executable source files +function(add_hypre_executables EXE_SRCS) + # Support both usage styles: + # - add_hypre_executables(EXAMPLE_SRCS) -> variable name + # - add_hypre_executables("${TEST_SRCS}") -> expanded list content + set(_HYPRE_EXE_SRC_LIST) + if(EXE_SRCS MATCHES "\\.(c|cc|cxx|cpp|cu|cuf|f|f90)(;|$)") + list(APPEND _HYPRE_EXE_SRC_LIST ${EXE_SRCS}) + else() + if(DEFINED ${EXE_SRCS}) + list(APPEND _HYPRE_EXE_SRC_LIST ${${EXE_SRCS}}) + else() + list(APPEND _HYPRE_EXE_SRC_LIST ${EXE_SRCS}) + endif() + endif() + + foreach(SRC_FILE IN LISTS _HYPRE_EXE_SRC_LIST) + add_hypre_executable(${SRC_FILE} "") + endforeach() +endfunction() # Function to add a tags target if etags is found function(add_hypre_target_tags) @@ -496,15 +538,43 @@ endfunction() # Function to add a distclean target function(add_hypre_target_distclean) + set(DISTCLEAN_SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/DistcleanScript.cmake") + + file(WRITE ${DISTCLEAN_SCRIPT} " + # Remove everything in the build directory except .git, .gitignore, and this script + file(GLOB build_items RELATIVE \"${CMAKE_BINARY_DIR}\" \"${CMAKE_BINARY_DIR}/*\") + foreach(item \${build_items}) + if(NOT item STREQUAL \".git\" AND + NOT item STREQUAL \".gitignore\" AND + NOT item STREQUAL \"${CMAKE_MATCH_1}\") + if(NOT \"${DISTCLEAN_SCRIPT}\" STREQUAL \"${CMAKE_BINARY_DIR}/\${item}\") + file(REMOVE_RECURSE \"${CMAKE_BINARY_DIR}/\${item}\") + endif() + endif() + endforeach() + + # Remove build artifacts in the source tree + set(patterns + \"*.o\" \"*.mod\" \"*~\" + \"test/*.out*\" \"test/*.err*\" + \"examples/ex[0-9]\" \"examples/ex1[0-9]\" + \"test/ij\" \"test/struct\" \"test/structmat\" + \"test/sstruct\" \"test/ams_driver\" + \"test/struct_migrate\" \"test/ij_assembly\" + ) + foreach(pat \${patterns}) + file(GLOB_RECURSE matches RELATIVE \"${CMAKE_SOURCE_DIR}\" \"${CMAKE_SOURCE_DIR}/\${pat}\") + foreach(m \${matches}) + file(REMOVE_RECURSE \"${CMAKE_SOURCE_DIR}/\${m}\") + endforeach() + endforeach() + + # Remove the script itself + file(REMOVE \"${DISTCLEAN_SCRIPT}\") + ") + add_custom_target(distclean - COMMAND find ${CMAKE_BINARY_DIR} -mindepth 1 -delete - COMMAND find ${CMAKE_SOURCE_DIR} -name "*.o" -type f -delete - COMMAND find ${CMAKE_SOURCE_DIR} -name "*.mod" -type f -delete - COMMAND find ${CMAKE_SOURCE_DIR} -name "*~" -type f -delete - COMMAND find ${CMAKE_SOURCE_DIR}/test -name "*.out*" -type f -delete - COMMAND find ${CMAKE_SOURCE_DIR}/test -name "*.err*" -type f -delete - COMMAND find ${CMAKE_SOURCE_DIR}/examples -type f -name "ex[0-9]" -name "ex[10-19]" -delete - COMMAND find ${CMAKE_SOURCE_DIR}/test -type f -name "ij|struct|sstruct|ams_driver|maxwell_unscalled|struct_migrate|sstruct_fac|ij_assembly" -delete + COMMAND ${CMAKE_COMMAND} -P ${DISTCLEAN_SCRIPT} WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMENT "Removing all build artifacts and generated files" VERBATIM @@ -588,3 +658,62 @@ function(print_option_status) message(STATUS "") endfunction() + +# Macro for setting up mixed precision compilation (must be defined before subdirectories) +macro(setup_mixed_precision_compilation module_name) + set(options "") + set(oneValueArgs "") + set(multiValueArgs SRCS) + cmake_parse_arguments(REGULAR "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + if(NOT REGULAR_SRCS) + message(FATAL_ERROR "SRCS argument is required for setup_mixed_precision_compilation") + endif() + + # Create object libraries for each precision + add_library(${module_name}_flt OBJECT ${REGULAR_SRCS}) + add_library(${module_name}_dbl OBJECT ${REGULAR_SRCS}) + add_library(${module_name}_ldbl OBJECT ${REGULAR_SRCS}) + + # Set precision-specific compile definitions + target_compile_definitions(${module_name}_flt PRIVATE MP_BUILD_SINGLE=1) + target_compile_definitions(${module_name}_dbl PRIVATE MP_BUILD_DOUBLE=1) + target_compile_definitions(${module_name}_ldbl PRIVATE MP_BUILD_LONGDOUBLE=1) + + # Set include directories and link libraries for all precision variants + foreach(precision IN ITEMS flt dbl ldbl) + target_include_directories(${module_name}_${precision} PRIVATE + ${CMAKE_SOURCE_DIR} + ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/utilities + ${CMAKE_SOURCE_DIR}/blas + ${CMAKE_SOURCE_DIR}/lapack + ${CMAKE_SOURCE_DIR}/seq_mv + ${CMAKE_SOURCE_DIR}/seq_block_mv + ${CMAKE_SOURCE_DIR}/parcsr_mv + ${CMAKE_SOURCE_DIR}/parcsr_block_mv + ${CMAKE_SOURCE_DIR}/parcsr_ls + ${CMAKE_SOURCE_DIR}/IJ_mv + ${CMAKE_SOURCE_DIR}/krylov + ${CMAKE_SOURCE_DIR}/struct_mv + ${CMAKE_SOURCE_DIR}/sstruct_mv + ${CMAKE_SOURCE_DIR}/struct_ls + ${CMAKE_SOURCE_DIR}/sstruct_ls + ${CMAKE_SOURCE_DIR}/distributed_matrix + ${CMAKE_SOURCE_DIR}/matrix_matrix + ${CMAKE_SOURCE_DIR}/multivector + ) + # Link to MPI if it's enabled + if(HYPRE_ENABLE_MPI) + target_link_libraries(${module_name}_${precision} PRIVATE MPI::MPI_C) + endif() + endforeach() + + # Add the precision object files to the main target + target_sources(${PROJECT_NAME} PRIVATE + $ + $ + $ + ) +endmacro() diff --git a/src/config/cmake/HYPRE_SetupCUDAToolkit.cmake b/src/config/cmake/HYPRE_SetupCUDAToolkit.cmake index d5df8306d3..63641110e3 100644 --- a/src/config/cmake/HYPRE_SetupCUDAToolkit.cmake +++ b/src/config/cmake/HYPRE_SetupCUDAToolkit.cmake @@ -60,13 +60,13 @@ endif() include(CheckLanguage) check_language(CUDA) if(DEFINED CMAKE_CUDA_COMPILER) - enable_language(CUDA) + enable_language(CUDA) else() message(FATAL_ERROR "CUDA language not found. Please check your CUDA installation.") endif() # Find the CUDA Toolkit -find_package(CUDAToolkit REQUIRED) +find_package(CUDAToolkit REQUIRED ${CUDA_DIR}) # Add a dummy cuda target if it doesn't exist (avoid error when building with BLT dependencies) if(NOT TARGET cuda) @@ -74,7 +74,9 @@ if(NOT TARGET cuda) endif() # Detection CUDA architecture if not given by the user -if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES OR CMAKE_CUDA_ARCHITECTURES STREQUAL "52") +if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES OR + CMAKE_CUDA_ARCHITECTURES MATCHES "^[ \t\r\n]*$" OR + CMAKE_CUDA_ARCHITECTURES STREQUAL "52") # CMake's default message(STATUS "Detecting CUDA GPU architectures using nvidia-smi...") # Platform-specific NVIDIA smi command @@ -138,8 +140,7 @@ else() # Remove duplicates from the pre-set CMAKE_CUDA_ARCHITECTURES string(REPLACE "," ";" CUDA_ARCH_LIST "${CMAKE_CUDA_ARCHITECTURES}") list(REMOVE_DUPLICATES CUDA_ARCH_LIST) - string(REPLACE ";" "," CUDA_ARCH_STR "${CUDA_ARCH_LIST}") - set(CMAKE_CUDA_ARCHITECTURES "${CUDA_ARCH_STR}" CACHE STRING "Detected CUDA architectures" FORCE) + set(CMAKE_CUDA_ARCHITECTURES "${CUDA_ARCH_LIST}" CACHE STRING "Detected CUDA architectures" FORCE) message(STATUS "CMAKE_CUDA_ARCHITECTURES is already set to: ${CMAKE_CUDA_ARCHITECTURES}") endif() @@ -160,7 +161,7 @@ endif() # Check for Thrust headers find_path(THRUST_INCLUDE_DIR thrust/version.h - HINTS ${CUDAToolkit_INCLUDE_DIRS} ${CUDAToolkit_INCLUDE_DIRS}/cuda-thrust + HINTS ${CUDAToolkit_INCLUDE_DIRS} ${CUDAToolkit_INCLUDE_DIRS}/cccl ${CUDAToolkit_INCLUDE_DIRS}/cuda-thrust PATH_SUFFIXES thrust NO_DEFAULT_PATH ) @@ -208,21 +209,14 @@ endfunction() # Handle CUDA libraries list(APPEND CUDA_LIBS CUDA::cudart) # Add cudart first since other CUDA libraries may depend on it find_and_add_cuda_library(cusparse HYPRE_ENABLE_CUSPARSE) -find_and_add_cuda_library(curand HYPRE_ENABLE_CURAND) -find_and_add_cuda_library(cublas HYPRE_ENABLE_CUBLAS) +find_and_add_cuda_library(curand HYPRE_ENABLE_CURAND) +find_and_add_cuda_library(cublas HYPRE_ENABLE_CUBLAS) find_and_add_cuda_library(cublasLt HYPRE_ENABLE_CUBLAS) find_and_add_cuda_library(cusolver HYPRE_ENABLE_CUSOLVER) -# Handle GPU Profiling with nvToolsExt +# Handle GPU Profiling with nvtx3 if(HYPRE_ENABLE_GPU_PROFILING) - find_library(NVTX_LIBRARY nvToolsExt HINTS ${CUDA_TOOLKIT_ROOT_DIR} PATH_SUFFIXES lib64 lib) - if(NVTX_LIBRARY) - message(STATUS "Found NVTX library") - set(HYPRE_USING_NVTX ON CACHE BOOL "" FORCE) - list(APPEND CUDA_LIBS ${NVTX_LIBRARY}) - else() - message(FATAL_ERROR "NVTX library not found! Make sure CUDA is installed correctly.") - endif() + set(HYPRE_USING_NVTX ON CACHE BOOL "" FORCE) endif() # Add CUDA Toolkit include directories to the target diff --git a/src/config/cmake/HYPRE_SetupGPUToolkit.cmake b/src/config/cmake/HYPRE_SetupGPUToolkit.cmake index 2016214be6..6b07736c7a 100644 --- a/src/config/cmake/HYPRE_SetupGPUToolkit.cmake +++ b/src/config/cmake/HYPRE_SetupGPUToolkit.cmake @@ -6,21 +6,10 @@ # Enable CXX language enable_language(CXX) set(CMAKE_CXX_STANDARD_REQUIRED ON) -if(HYPRE_ENABLE_SYCL) - # We enforce the use of Intel's oneAPI DPC++/C++ Compiler - if(NOT CMAKE_CXX_COMPILER MATCHES "dpcpp|icpx") - message(FATAL_ERROR "SYCL requires DPC++ or Intel C++ compiler") - endif() - # Enforce C++17 at least for SYCL - if(NOT DEFINED CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD LESS 17) - set(CMAKE_CXX_STANDARD 17) - endif() -else() - # Enforce C++14 at least for CUDA and HIP - if(NOT DEFINED CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD LESS 14) - set(CMAKE_CXX_STANDARD 14) - endif() +# Use C++17 by default if not given by users +if(NOT DEFINED CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 17) endif() # Set C++ standard for HYPRE @@ -89,3 +78,26 @@ elseif(HYPRE_ENABLE_SYCL) else() message(FATAL_ERROR "Neither CUDA nor HIP nor SYCL is enabled. Please enable one of them.") endif() + +# Checks involving Umpire for CUDA/HIP +if (NOT HYPRE_ENABLE_SYCL AND + NOT HYPRE_ENABLE_UMPIRE AND + NOT HYPRE_USER_SET_HYPRE_ENABLE_UMPIRE) + # Auto-enable Umpire if the user didn't do it explicitly + set(HYPRE_ENABLE_UMPIRE ON CACHE BOOL "" FORCE) + set(HYPRE_USING_UMPIRE ON CACHE INTERNAL "") + set(HYPRE_USING_UMPIRE_DEVICE ON CACHE INTERNAL "") + set(HYPRE_USING_UMPIRE_UM ON CACHE INTERNAL "") + message(STATUS "Enabling Umpire automatically for GPU-enabled build due to performance and allocator features. Set -DHYPRE_ENABLE_UMPIRE=OFF to opt out.") + +elseif(NOT HYPRE_ENABLE_SYCL AND + NOT HYPRE_ENABLE_UMPIRE AND + HYPRE_USER_SET_HYPRE_ENABLE_UMPIRE) + # If user explicitly disables Umpire while enabling GPU, warn strongly but respect it + message(WARNING +"=============================================================== + Umpire is explicitly disabled while building hypre for GPUs. + This is not recommended for performance reasons! + Enable it with -DHYPRE_ENABLE_UMPIRE=ON. +===============================================================") +endif() diff --git a/src/config/cmake/HYPRE_SetupHIPToolkit.cmake b/src/config/cmake/HYPRE_SetupHIPToolkit.cmake index 656b5c8f5e..8529afdb9f 100644 --- a/src/config/cmake/HYPRE_SetupHIPToolkit.cmake +++ b/src/config/cmake/HYPRE_SetupHIPToolkit.cmake @@ -106,6 +106,72 @@ else() endif() set_property(TARGET ${PROJECT_NAME} PROPERTY HIP_ARCHITECTURES "${CMAKE_HIP_ARCHITECTURES}") +# Check if user specified either WARP_SIZE or WAVEFRONT_SIZE +if(DEFINED HYPRE_WAVEFRONT_SIZE) + set(HYPRE_WARP_SIZE ${HYPRE_WAVEFRONT_SIZE} CACHE STRING "GPU warp size") + message(STATUS "Using user-specified wavefront size: ${HYPRE_WAVEFRONT_SIZE}") + +elseif(NOT DEFINED HYPRE_WARP_SIZE) + # Auto-detect warp size based on gpu arch if not specified + set(FOUND_OLD_GFX_CARD FALSE) + set(DETECTED_ARCHITECTURES "") # To collect and report all detected architectures + + # CMAKE_HIP_ARCHITECTURES typically contains a semicolon-separated list (e.g., "gfx90a;gfx1100") + if(DEFINED CMAKE_HIP_ARCHITECTURES AND NOT "${CMAKE_HIP_ARCHITECTURES}" STREQUAL "") + foreach(ARCH_ITEM IN LISTS CMAKE_HIP_ARCHITECTURES) + # Only process if we haven't already found an old GFX card + if(NOT FOUND_OLD_GFX_CARD) + # Extract the numeric part from the GFX architecture string (e.g., "gfx90a" -> "90a") + # Note: CMAKE_HIP_ARCHITECTURES usually contains only the ID, not "gfx" prefix, + # but regex is robust if it does. + string(REGEX MATCH "gfx?([0-9a-fA-F]+)" _dummy "${ARCH_ITEM}") + set(GFX_ID_STR "${CMAKE_MATCH_1}") # e.g., "90a", "1100" + + # Extract only the leading numeric part for comparison + # (e.g., "90a" -> "90", "1100" -> "1100") + string(REGEX REPLACE "[^0-9]" "" GFX_BASE_ID_STR "${GFX_ID_STR}") + + set(CURRENT_GFX_ID_INT 0) + if(GFX_BASE_ID_STR MATCHES "^[0-9]+$") + # Remove leading zeros to ensure correct integer comparison (e.g., "0900" -> "900") + string(REGEX REPLACE "^0+" "" GFX_ID_STR_NO_LEADING_ZERO "${GFX_BASE_ID_STR}") + if(NOT GFX_ID_STR_NO_LEADING_ZERO EQUAL "") + set(CURRENT_GFX_ID_INT "${GFX_ID_STR_NO_LEADING_ZERO}") + endif() + endif() + + list(APPEND DETECTED_ARCHITECTURES "gfx${GFX_ID_STR}") # Add full GFX string to list for reporting + message(STATUS "Processing CMAKE_HIP_ARCHITECTURES entry: ${ARCH_ITEM} -> Numeric base: ${CURRENT_GFX_ID_INT}") + + # If any detected GFX card has a numeric ID less than 1000 + if(CURRENT_GFX_ID_INT LESS 1000) + set(FOUND_OLD_GFX_CARD TRUE) + endif() + endif() + endforeach() + + # Set the final HYPRE_WARP_SIZE based on the flag + if(FOUND_OLD_GFX_CARD) + set(HYPRE_WARP_SIZE 64 CACHE STRING "GPU wavefront size (detected at least one GFX < 1000)") + message(STATUS "HYPRE_WARP_SIZE set to 64 for architectures: ${DETECTED_ARCHITECTURES}") + else() + # Only reached here if all detected GFX cards are 1000 or greater + set(HYPRE_WARP_SIZE 32 CACHE STRING "GPU wavefront size (all detected GFX >= 1000)") + message(STATUS "HYPRE_WARP_SIZE set to 32 for architectures: ${DETECTED_ARCHITECTURES}") + endif() + + else() + message(FATAL_ERROR "CMAKE_HIP_ARCHITECTURES not found or empty!") + endif() + +else() + message(STATUS "Using user-specified wavefront size: ${HYPRE_WARP_SIZE}") +endif() + +# Set WAVEFRONT_SIZE to match WARP_SIZE for consistency +set(HYPRE_WAVEFRONT_SIZE ${HYPRE_WARP_SIZE} CACHE STRING "GPU wavefront size (alias for WARP_SIZE)") +mark_as_advanced(HYPRE_WAVEFRONT_SIZE) + # Collection of ROCm optional libraries set(ROCM_LIBS "") @@ -211,43 +277,6 @@ if (HYPRE_ENABLE_LTO AND NOT MSVC) ) endif () -# Check if user specified either WARP_SIZE or WAVEFRONT_SIZE -if(DEFINED HYPRE_WAVEFRONT_SIZE) - set(HYPRE_WARP_SIZE ${HYPRE_WAVEFRONT_SIZE} CACHE STRING "GPU warp size") - message(STATUS "Using user-specified wavefront size: ${HYPRE_WAVEFRONT_SIZE}") - -elseif(NOT DEFINED HYPRE_WARP_SIZE) - # Auto-detect if neither is specified - execute_process( - COMMAND rocm-smi --showproductname - OUTPUT_VARIABLE GPU_PRODUCT_NAME - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_QUIET - RESULT_VARIABLE ROCM_SMI_RESULT - ) - - if(ROCM_SMI_RESULT EQUAL 0) - string(TOUPPER "${GPU_PRODUCT_NAME}" GPU_PRODUCT_NAME) - - if(GPU_PRODUCT_NAME MATCHES "MI[0-9]") - set(HYPRE_WARP_SIZE 64 CACHE STRING "GPU wavefront size (CDNA architecture)") - message(STATUS "Detected CDNA architecture, setting wavefront size to 64") - else() - set(HYPRE_WARP_SIZE 32 CACHE STRING "GPU wavefront size (RDNA/default architecture)") - message(STATUS "Detected RDNA architecture, setting wavefront size to 32") - endif() - else() - set(HYPRE_WARP_SIZE 64 CACHE STRING "GPU warp size (default)") - message(STATUS "Could not detect GPU architecture, defaulting to wavefront size 64") - endif() -else() - message(STATUS "Using user-specified wavefront size: ${HYPRE_WARP_SIZE}") -endif() - -# Set WAVEFRONT_SIZE to match WARP_SIZE for consistency -set(HYPRE_WAVEFRONT_SIZE ${HYPRE_WARP_SIZE} CACHE STRING "GPU wavefront size (alias for WARP_SIZE)") -mark_as_advanced(HYPRE_WAVEFRONT_SIZE) - # Print HIP info if (DEFINED hip_VERSION) message(STATUS "HIP version: ${hip_VERSION}") diff --git a/src/config/configure.in b/src/config/configure.in index a87dd0af4c..5d5e35bea6 100644 --- a/src/config/configure.in +++ b/src/config/configure.in @@ -48,9 +48,9 @@ dnl * Set package information so it only has to be modified in one place dnl ********************************************************************* m4_define([M4_HYPRE_NAME], [hypre]) -m4_define([M4_HYPRE_VERSION], [2.33.0]) -m4_define([M4_HYPRE_NUMBER], [23300]) -m4_define([M4_HYPRE_DATE], [2025/04/03]) +m4_define([M4_HYPRE_VERSION], [3.0.0]) +m4_define([M4_HYPRE_NUMBER], [30000]) +m4_define([M4_HYPRE_DATE], [2025/09/26]) m4_define([M4_HYPRE_TIME], [00:00:00]) m4_define([M4_HYPRE_BUGS], [https://github.com/hypre-space/hypre/issues]) m4_define([M4_HYPRE_SRCDIR], [`pwd`]) @@ -184,6 +184,11 @@ hypre_using_umpire_host=no hypre_using_umpire_device=no hypre_using_umpire_um=no hypre_using_umpire_pinned=no +hypre_user_disabled_umpire=no +hypre_user_gave_umpire_inc=no +hypre_user_gave_umpire_lib=no +hypre_user_gave_umpire_lib_dirs=no +hypre_user_gave_umpire_libs=no hypre_warp_size=32 hypre_using_caliper=no @@ -197,7 +202,7 @@ hypre_using_memory_tracker=no hypre_test_using_host=no -hypre_cxxstd=11 +hypre_cxxstd=17 dnl ********************************************************************* dnl * Initialize hypre-MAGMA variables @@ -363,6 +368,26 @@ then AC_DEFINE(HYPRE_COMPLEX, 1, [Define to 1 if using complex values]) fi +dnl *** Mixed-precision support build option +AC_ARG_ENABLE(mixed-precision, +AS_HELP_STRING([--enable-mixed-precision], + [Enable mixed-precision build (default is NO).]), +[case "${enableval}" in + yes) hypre_using_fei=no + hypre_using_mixed_precision=yes ;; + no) hypre_using_mixed_precision=no ;; + *) AC_MSG_ERROR([Bad value ${enableval} for --enable-mixed-precision]) ;; + esac], +[hypre_using_mixed_precision=no] +) +dnl MP_BUILD=0 +if test "$hypre_using_mixed_precision" = "yes" +then + AC_DEFINE(HYPRE_MIXED_PRECISION, 1, [Define to 1 if using mixed-precision for HYPRE_Real type]) + MP_BUILD=1 + AC_SUBST(MP_BUILD) +fi + AC_ARG_ENABLE(maxdim, AS_HELP_STRING([--enable-maxdim=MAXDIM], [Change max dimension size to MAXDIM (default is 3). @@ -678,9 +703,8 @@ AS_HELP_STRING([--with-strict-checking], CFLAGS="" elif test "x$GCC" = "xyes" || test "x$CC" = "xgcc"; then FFLAGS="-g -Wall" - CFLAGS="-g -Wall -std=gnu99 -pedantic -Wfloat-conversion -fsingle-precision-constant" - CXXFLAGS="-g -Wall -Wshadow -fno-implicit-templates" - CXXFLAGS="$CXXFLAGS -Woverloaded-virtual -ansi -pedantic" + CFLAGS="-g -Wall -std=gnu99 -pedantic -Wfloat-conversion -fsingle-precision-constant -Werror=vla" + CXXFLAGS="-g -Wall -Wshadow -fno-implicit-templates -Woverloaded-virtual -ansi -pedantic -Werror=vla" elif test "x$CC" = "xicc"; then FFLAGS="-g -Wall" CFLAGS="-g -Xc -Wall -x c" @@ -1547,9 +1571,10 @@ AC_ARG_WITH(umpire, AS_HELP_STRING([--with-umpire], [Use Umpire Allocator for device and unified memory (default is NO).]), [case "${withval}" in - yes) hypre_using_umpire_device=yes + yes) hypre_using_umpire=yes + hypre_using_umpire_device=yes hypre_using_umpire_um=yes ;; - no) ;; + no) hypre_user_disabled_umpire=yes ;; *) ;; esac], [] @@ -1563,7 +1588,7 @@ AS_HELP_STRING([--with-umpire-include=DIR], [for umpire_dir in $withval; do HYPRE_UMPIRE_INCLUDE="-I$umpire_dir $HYPRE_UMPIRE_INCLUDE" done; -] +hypre_user_gave_umpire_inc=yes] ) AC_ARG_WITH(umpire-lib, @@ -1573,7 +1598,7 @@ AS_HELP_STRING([--with-umpire-lib=LIBS], [for umpire_lib in $withval; do HYPRE_UMPIRE_LIB="$umpire_lib $HYPRE_UMPIRE_LIB" done; -] + hypre_user_gave_umpire_lib=yes] ) AC_ARG_WITH(umpire-libs, @@ -1584,7 +1609,7 @@ AS_HELP_STRING([--with-umpire-libs=LIBS], [for umpire_lib in $withval; do HYPRE_UMPIRE_LIB="-l$umpire_lib $HYPRE_UMPIRE_LIB" done; -] + hypre_user_gave_umpire_libs=yes] ) AC_ARG_WITH(umpire-lib-dirs, @@ -1596,8 +1621,9 @@ AS_HELP_STRING([--with-umpire-lib-dirs=DIRS], must be used together.]), [for umpire_lib_dir in $withval; do HYPRE_UMPIRE_LIB_DIR="-L$umpire_lib_dir $HYPRE_UMPIRE_LIB_DIR" + HYPRE_UMPIRE_RPATH="${HYPRE_UMPIRE_RPATH} -Wl,-rpath,${umpire_lib_dir}" done; -] + hypre_user_gave_umpire_lib_dirs=yes] ) dnl ***** MAGMA @@ -2411,30 +2437,36 @@ then then # Check for CDNA vs RDNA architecture AC_MSG_CHECKING([for GPU architecture using rocm-smi]) - gfx_versions=$(rocm-smi --showproductname 2>/dev/null | grep 'gfx' | awk '{print $NF}' | tr '\n' ' ') - rocm_smi_cmd=$(rocm-smi --showproductname) + rocm_smi_cmd=$(rocm-smi --showproductname 2>/dev/null) rocm_smi_status=$? + gfx_versions=$(echo "$rocm_smi_cmd" | grep 'gfx' | awk '{print $NF}' | tr '\n' ' ') if test $rocm_smi_status -eq 0 then - cdna_found=no - for gfx_version in $gfx_versions - do - case "$gfx_version" in - gfx9*) - cdna_found=yes - break - ;; - esac - done - - if test "$cdna_found" = "yes" + if test -z "$gfx_versions" then hypre_warp_size=64 - AC_MSG_RESULT([CDNA detected ($gfx_versions), setting warp size to 64]) + AC_MSG_RESULT([no gfx version found in rocm-smi output, defaulting to warp size 64]) else - hypre_warp_size=32 - AC_MSG_RESULT([RDNA detected ($gfx_versions), setting warp size to 32]) + cdna_found=no + for gfx_version in $gfx_versions + do + case "$gfx_version" in + gfx9* ) + cdna_found=yes + break + ;; + esac + done + + if test "$cdna_found" = "yes" + then + hypre_warp_size=64 + AC_MSG_RESULT([CDNA detected ( $gfx_versions), setting warp size to 64]) + else + hypre_warp_size=32 + AC_MSG_RESULT([RDNA detected ( $gfx_versions), setting warp size to 32]) + fi fi else hypre_warp_size=64 @@ -2496,6 +2528,34 @@ then dnl CFLAGS=${CXXFLAGS} fi +dnl ********************************************************************* +dnl * Auto-enable Umpire for GPU backends (before AC_DEFINEs) +dnl ********************************************************************* +if test "x$hypre_user_disabled_umpire" != "xyes" +then + if test "x$hypre_using_umpire" != "xyes" + then + if test "x$hypre_using_cuda" = "xyes" || test "x$hypre_using_hip" = "xyes" + then + hypre_using_umpire=yes + AC_MSG_NOTICE([Enabling Umpire automatically for GPU build (CUDA/HIP) for performance and allocator features. Use --without-umpire to opt out.]) + fi + fi +fi + +dnl Warn if Umpire explicitly disabled while using a GPU backend +if test "x$hypre_user_disabled_umpire" = "xyes" +then + if test "x$hypre_using_cuda" = "xyes" || test "x$hypre_using_hip" = "xyes" + then + AC_MSG_WARN([***************************************************************]) + AC_MSG_WARN([ Umpire is explicitly disabled while building hypre for GPUs.]) + AC_MSG_WARN([ This is not recommended for performance reasons!]) + AC_MSG_WARN([ Enable it with --with-umpire.]) + AC_MSG_WARN([***************************************************************]) + fi +fi + dnl ********************************************************************* dnl * Set umpire options dnl ********************************************************************* @@ -2526,6 +2586,28 @@ fi if test "x$hypre_using_umpire" = "xyes" then AC_DEFINE(HYPRE_USING_UMPIRE, 1, [Define to 1 if using UMPIRE]) + if test "x$HYPRE_UMPIRE_RPATH" != "x" + then + LDFLAGS="${LDFLAGS} ${HYPRE_UMPIRE_RPATH}" + AC_MSG_NOTICE([Adding Umpire rpath to LDFLAGS: ${HYPRE_UMPIRE_RPATH}]) + fi + if test "$hypre_user_gave_umpire_inc" != "yes" || \ + test "$hypre_user_gave_umpire_lib" != "yes" && test "$hypre_user_gave_umpire_libs" != "yes" || \ + test "$hypre_user_gave_umpire_lib_dirs" != "yes" + then + AC_MSG_ERROR([ +=============================================================== +Umpire has been enabled for GPU builds to improve performance. +However, Umpire include and/or library paths were not provided. + +Provide the following flags as appropriate: + --with-umpire-include="/path-to-umpire-install/include" + --with-umpire-lib-dirs="/path-to-umpire-install/lib" + --with-umpire-libs="umpire" or --with-umpire-lib="-lumpire" + +To opt out (not recommended), configure with --without-umpire. +===============================================================]) + fi fi dnl ********************************************************************* @@ -2673,7 +2755,7 @@ AS_IF([test x"$hypre_using_hip" == x"yes"], dnl interprets as C and therefore invokes the C compiler rather than the HIP part dnl of clang. Put HIPCXXFLAGS at the end so the user can override from dnl from the configure line. - HIPCXXFLAGS="-x hip -fPIE -std=c++14 ${HIPCXXFLAGS}" + HIPCXXFLAGS="-x hip -fPIE -std=c++${hypre_cxxstd} ${HIPCXXFLAGS}" dnl If not in debug mode, at least -O2, but the user can override with dnl with HIPCXXFLAGS on the configure line. If in debug mode, -O0 -Wall @@ -2763,6 +2845,7 @@ AS_IF([test x"$hypre_using_sycl" == x"yes"], else SYCLFLAGS="-O3 ${SYCLFLAGS}" fi + LDFLAGS+=" -fsycl -fsycl-device-code-split=per_kernel -Wl,--no-relax" dnl AOT compilation for specific devices @@ -2779,7 +2862,7 @@ AS_IF([test x"$hypre_using_sycl" == x"yes"], if test "$hypre_using_shared" = "yes" then SYCLFLAGS="${SHARED_COMPILE_FLAG} ${SYCLFLAGS}" - BUILD_CC_SHARED="\${CUCC} ${SHARED_BUILD_FLAG}" + BUILD_CC_SHARED="${CUCC} ${SHARED_BUILD_FLAG}" fi dnl (Ab)Use CUFLAGS to capture SYCL compilation flags @@ -3102,6 +3185,11 @@ dnl ********************************************************************* AC_SUBST(DSUPERLU_INCLUDE) AC_SUBST(DSUPERLU_LIBS) +dnl ********************************************************************* +dnl * Mixed precision build +dnl ********************************************************************* +dnl AC_SUBST(MP_BUILD) + dnl ********************************************************************* dnl * ar & ranlib substitution dnl ********************************************************************* diff --git a/src/config/gen_code.sh b/src/config/gen_code.sh new file mode 100755 index 0000000000..18e3809432 --- /dev/null +++ b/src/config/gen_code.sh @@ -0,0 +1,302 @@ +#!/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) + +# Generate multiprecision code +# +# The script takes an external header file, an internal header file, and an +# output file prefix, then generates various C files and header files. +# +# The generated files begin with the prefix name and contain code corresponding +# to the functions listed in mup.fixed, mup.functions, and mup.methods (methods +# are not fully implemented yet - see NOTE below). +# +# Usage: +# Example: HYPRE_krylov.h _hypre_krylov.h mup + +scriptdir=`dirname $0` + +EXTH=$1 +INTH=$2 +OUTP=$3 + +#### NOTE: Add mup.methods to this later. +#### +#### It should be easy to just add it to the loops below, but some up-front +#### preprocessing will be necessary to move existing implementation code out of +#### the way temporarily to prevent overwriting existing code. Developers will +#### then need to do a manual merge. The header files can be generated fully +#### automatically as below. + +############################################################################ +# Make sure the function list files are sorted (list capital letters first) +############################################################################ + +for i in fixed functions methods +do + (export LC_COLLATE=C; sort mup.${i} | uniq) > mup.${i}.tmp + mv mup.${i}.tmp mup.${i} +done + +############################################################################ +# Generate def/undef header files +############################################################################ + +extp=${EXTH%.*} # extract the prefix from the external header +intp=${INTH%.*} # extract the prefix from the internal header + +# strip off leading 'HYPRE_' or '_hypre_' and convert to uppercase +extname=`echo $extp | sed -e 's/HYPRE_//g' -e 's/_hypre_//g' | awk '{print toupper($0)}'` +intname=`echo $intp | sed -e 's/HYPRE_//g' -e 's/_hypre_//g' | awk '{print toupper($0)}'` + +#=========================================================================== +# Create def header file +#=========================================================================== + +MUP_HEADER=${intp}_mup_def.h + +cat > $MUP_HEADER <<@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use $0 to generate) ***/ + +@ + +# Generate copyright header +$scriptdir/write_header.sh >> $MUP_HEADER + +cat >> $MUP_HEADER <<@ +/* Header file for transforming multiprecision functions names */ + +#ifndef hypre_${intname}_MUP_DEF_HEADER +#define hypre_${intname}_MUP_DEF_HEADER + +#include "_hypre_mup_def.h" + +@ + +cat>> $MUP_HEADER <<@ +$( +cat mup.functions mup.methods | while read -r func_name +do + echo "#define $func_name HYPRE_MULTIPRECISION_FUNC ( $func_name )" +done +cat mup.fixed | while read -r func_name +do + echo "#define $func_name HYPRE_FIXEDPRECISION_FUNC ( $func_name )" +done +) + +#endif +@ + +#=========================================================================== +# Exit if we only need the def header file +#=========================================================================== + +if [ "${OUTP}" = "onlydef" ] +then + exit +fi + +#=========================================================================== +# Create undef header file +#=========================================================================== + +MUP_HEADER=${intp}_mup_undef.h + +cat > $MUP_HEADER <<@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use $0 to generate) ***/ + +@ + +# Generate copyright header +$scriptdir/write_header.sh >> $MUP_HEADER + +cat >> $MUP_HEADER <<@ +/* Header file for transforming multiprecision functions names */ + +#undef hypre_${intname}_MUP_DEF_HEADER + +@ + +cat>> $MUP_HEADER <<@ +$( +cat mup.functions mup.methods mup.fixed | while read -r func_name +do + echo "#undef $func_name" +done +) +@ + +############################################################################ +# Create temporary files and initial code +############################################################################ + +# Create file with list of MUP functions and methods +cat mup.functions mup.methods > mup.pre + +# Create prototype information files +for i in fixed functions +do + $scriptdir/gen_proto_info.sh mup.${i} ${EXTH} > ${OUTP}.${i}.ext.proto + $scriptdir/gen_proto_info.sh mup.${i} ${INTH} > ${OUTP}.${i}.int.proto +done +cat ${OUTP}.functions.ext.proto > ${OUTP}.pre.ext.proto +cat ${OUTP}.functions.int.proto > ${OUTP}.pre.int.proto + +# Create C implementation files and header files +for i in fixed functions pre +do + $scriptdir/gen_${i}_code.sh ${OUTP}.${i}.ext.proto ${OUTP}_${i}_ext + $scriptdir/gen_${i}_code.sh ${OUTP}.${i}.int.proto ${OUTP}_${i}_int +done + +############################################################################ +# Finalize code +############################################################################ + +for i in fixed functions pre +do + +#======================================== +# generate implementation file +#======================================== + +FOUT=${OUTP}_${i}.c + +cat > $FOUT <<@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use $0 to generate) ***/ + +#include "$INTH" + +#ifdef HYPRE_MIXED_PRECISION + +@ + +$scriptdir/write_header.sh >> $FOUT +cat ${OUTP}_${i}_ext.c ${OUTP}_${i}_int.c >> $FOUT + +cat >> $FOUT <<@ + +#endif + +@ + +#======================================== +# add header info to the prototype files +#======================================== + +FOUT=${OUTP}_${i}_ext.h +cat > $FOUT.tmp <<@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use $0 to generate) ***/ + +@ +$scriptdir/write_header.sh >> $FOUT.tmp +cat $FOUT >> $FOUT.tmp +mv $FOUT.tmp $FOUT + +FOUT=${OUTP}_${i}_int.h +cat > $FOUT.tmp <<@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use $0 to generate) ***/ + +@ +$scriptdir/write_header.sh >> $FOUT.tmp +cat $FOUT >> $FOUT.tmp +mv $FOUT.tmp $FOUT + +done + +############################################################################ +# Remove temporary files +############################################################################ + +rm -f mup.pre +rm -f ${OUTP}.*.proto +rm -f ${OUTP}_*_ext.c +rm -f ${OUTP}_*_int.c + +############################################################################ +# Generate header files +############################################################################ + +#=========================================================================== +# Create external header file +#=========================================================================== + +MUP_HEADER=${extp}_mup.h + +cat > $MUP_HEADER <<@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use $0 to generate) ***/ + +#ifndef HYPRE_${extname}_MUP_HEADER +#define HYPRE_${extname}_MUP_HEADER + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (HYPRE_MIXED_PRECISION) +@ + +cat ${OUTP}_fixed_ext.h >> $MUP_HEADER +cat ${OUTP}_functions_ext.h >> $MUP_HEADER +cat ${OUTP}_pre_ext.h >> $MUP_HEADER + +cat >> $MUP_HEADER <<@ + +#endif + +#ifdef __cplusplus +} +#endif + +#endif + +@ + +rm -f ${OUTP}_fixed_ext.h ${OUTP}_functions_ext.h ${OUTP}_pre_ext.h + +#=========================================================================== +# Create internal header file +#=========================================================================== + +MUP_HEADER=${intp}_mup.h + +cat > $MUP_HEADER <<@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use $0 to generate) ***/ + +#ifndef hypre_${intname}_MUP_HEADER +#define hypre_${intname}_MUP_HEADER + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (HYPRE_MIXED_PRECISION) +@ + +cat ${OUTP}_fixed_int.h >> $MUP_HEADER +cat ${OUTP}_functions_int.h >> $MUP_HEADER +cat ${OUTP}_pre_int.h >> $MUP_HEADER + +cat >> $MUP_HEADER <<@ + +#endif + +#ifdef __cplusplus +} +#endif + +#endif + +@ + +rm -f ${OUTP}_fixed_int.h ${OUTP}_functions_int.h ${OUTP}_pre_int.h diff --git a/src/config/gen_fixed_code.sh b/src/config/gen_fixed_code.sh new file mode 100755 index 0000000000..7544f2def8 --- /dev/null +++ b/src/config/gen_fixed_code.sh @@ -0,0 +1,95 @@ +#!/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) + +# Generate code for fixed precision functions +# +# The script takes a prototype info file (generated by 'gen_proto_info.sh') and +# an output file prefix, then generates files prefix.c and prefix.h containing +# function implementations and prototypes for each line of prototype info. +# +# NOTE: Currently only header file information is generated (e.g., prefix.h). +# +# Usage: +# Example: mup.fixed.ext.proto mup_fixed_ext + +scriptdir=`dirname $0` + +PFILE=$1 +OUTC="$2.c" +OUTH="$2.h" + +echo "" > $OUTC +echo "" > $OUTH + +# loop over lines and generate code for each function +awk -v filename="$PFILE" -v outc="$OUTC" -v outh="$OUTH" 'BEGIN { + FS=" , " + # Read the prototype info file + while (getline < filename) + { + fret = $1 + fdef = $2 + tab = " " + p_str = "" + s_str = "" + for(i=3; i<=NF; i++) + { + argall = sprintf("%s", $i) + # Find the last legal C token in the argument (should not start with numbers) + # This helps to address arguments like const double foo[3] + laststart = 1; + lastlength = 0; + while ( match(substr($i, laststart + lastlength), /[a-zA-Z_][a-zA-Z0-9_]*/) ) + { + laststart = laststart + lastlength + RSTART - 1 + lastlength = RLENGTH + } + argvar = substr($i, laststart, lastlength) + sub(/^[[:blank:]]*/, "", argall); sub(/[[:blank:]]*$/, "", argall) + sub(/^[[:blank:]]*/, "", argvar); sub(/[[:blank:]]*$/, "", argvar) + p_str = sprintf("%s %s", p_str, argall) + s_str = sprintf("%s %s", s_str, argvar) + if(i> outh + print fret"\n"fdef"_dbl("arg_dbl");" >> outh + print fret"\n"fdef"_long_dbl("arg_long_dbl");\n" >> outh + + # Put fixed implementation code here if needed + print "/*--------------------------------------------------------------------------*/\n" >> outc + print fret"\n"fdef"("arg_mup")" >> outc + print "{" >> outc + print tab "return HYPRE_CURRENTPRECISION_FUNC("fdef")("s_str");" >> outc + print "}\n" >> outc + } + close(filename) +}' diff --git a/src/config/gen_functions_code.sh b/src/config/gen_functions_code.sh new file mode 100755 index 0000000000..90b7ad4d6e --- /dev/null +++ b/src/config/gen_functions_code.sh @@ -0,0 +1,97 @@ +#!/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) + +# Generate code for multiprecision functions +# +# The script takes a prototype info file (generated by 'gen_proto_info.sh') and +# an output file prefix, then generates files prefix.c and prefix.h containing +# function implementations and prototypes for each line of prototype info. +# +# Usage: +# Example: mup.functions.ext.proto mup_functions_ext + +scriptdir=`dirname $0` + +PFILE=$1 +OUTC="$2.c" +OUTH="$2.h" + +echo "" > $OUTC +echo "" > $OUTH + +# loop over lines and generate code for each function +awk -v filename="$PFILE" -v outc="$OUTC" -v outh="$OUTH" 'BEGIN { + FS=" , " + # Read the prototype info file + while (getline < filename) + { + fret = $1 + fdef = $2 + tab = " " + p_str = "" + s_str = "" + for(i=3; i<=NF; i++) + { + argall = sprintf("%s", $i) + # Find the last legal C token in the argument (should not start with numbers) + # This helps to address arguments like const double foo[3] + laststart = 1; + lastlength = 0; + while ( match(substr($i, laststart + lastlength), /[a-zA-Z_][a-zA-Z0-9_]*/) ) + { + laststart = laststart + lastlength + RSTART - 1 + lastlength = RLENGTH + } + argvar = substr($i, laststart, lastlength) + sub(/^[[:blank:]]*/, "", argall); sub(/[[:blank:]]*$/, "", argall) + sub(/^[[:blank:]]*/, "", argvar); sub(/[[:blank:]]*$/, "", argvar) + p_str = sprintf("%s %s", p_str, argall) + s_str = sprintf("%s %s", s_str, argvar) + if(i> outh + print fret"\n"fdef"_dbl("arg_dbl");" >> outh + print fret"\n"fdef"_long_dbl("arg_long_dbl");" >> outh + print fret"\n"fdef"("arg_mup");\n" >> outh + + print "/*--------------------------------------------------------------------------*/\n" >> outc + print fret"\n"fdef"("arg_mup")" >> outc + print "{" >> outc + print tab "HYPRE_Precision precision = hypre_GlobalPrecision();" >> outc + print tab "return "fdef"_pre("s_str");" >> outc + print "}\n" >> outc + } + close(filename) +}' diff --git a/src/config/gen_pre_code.sh b/src/config/gen_pre_code.sh new file mode 100755 index 0000000000..724da28bed --- /dev/null +++ b/src/config/gen_pre_code.sh @@ -0,0 +1,104 @@ +#!/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) + +# Generate code for multiprecision _pre functions +# +# The script takes a prototype info file (generated by 'gen_proto_info.sh') and +# an output file prefix, then generates files prefix.c and prefix.h containing +# function implementations and prototypes for each line of prototype info. +# +# Usage: +# Example: mup.pre.ext.proto mup_pre_ext + +scriptdir=`dirname $0` + +PFILE=$1 +OUTC="$2.c" +OUTH="$2.h" + +echo "" > $OUTC +echo "" > $OUTH + +# loop over lines and generate code for each function +awk -v filename="$PFILE" -v outc="$OUTC" -v outh="$OUTH" 'BEGIN { + FS=" , " + # Read the prototype info file + while (getline < filename) + { + fret = $1 + fdef = $2 + tab = " " + p_str = "" + s_str = "" + for(i=3; i<=NF; i++) + { + argall = sprintf("%s", $i) + # Find the last legal C token in the argument (should not start with numbers) + # This helps to address arguments like const double foo[3] + laststart = 1; + lastlength = 0; + while ( match(substr($i, laststart + lastlength), /[a-zA-Z_][a-zA-Z0-9_]*/) ) + { + laststart = laststart + lastlength + RSTART - 1 + lastlength = RLENGTH + } + argvar = substr($i, laststart, lastlength) + sub(/^[[:blank:]]*/, "", argall); sub(/[[:blank:]]*$/, "", argall) + sub(/^[[:blank:]]*/, "", argvar); sub(/[[:blank:]]*$/, "", argvar) + p_str = sprintf("%s %s", p_str, argall) + s_str = sprintf("%s %s", s_str, argvar) + if(i> outh + + print "/*--------------------------------------------------------------------------*/\n" >> outc + print fret"\n"fdef"_pre("arg_pre")" >> outc + print "{" >> outc + print tab "switch (precision)" >> outc + print tab "{" >> outc + print tab tab "case HYPRE_REAL_SINGLE:" >> outc + print tab tab tab "return "fdef"_flt("s_str");" >> outc + print tab tab "case HYPRE_REAL_DOUBLE:" >> outc + print tab tab tab "return "fdef"_dbl("s_str");" >> outc + print tab tab "case HYPRE_REAL_LONGDOUBLE:" >> outc + print tab tab tab "return "fdef"_long_dbl("s_str");" >> outc + print tab tab "default:" >> outc + if(fret == "void") + { + print tab tab tab "hypre_error_w_msg(HYPRE_ERROR_GENERIC, \"Unknown solver precision\");" >> outc + } + else + { + print tab tab tab "{ "fret" value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, \"Unknown solver precision\"); return value; }" >> outc + } + print tab "}" >> outc + print "}\n" >> outc + } + close(filename) +}' diff --git a/src/config/gen_proto_info.sh b/src/config/gen_proto_info.sh new file mode 100755 index 0000000000..f9aefbfe3d --- /dev/null +++ b/src/config/gen_proto_info.sh @@ -0,0 +1,59 @@ +#!/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) + +# Extract function prototype information in a format needed by code generation scripts. +# +# The script takes a file containing a list of functions and parses the input +# header file to generate the prototype information. +# +# Usage:
+# Example: mup_pre HYPRE_krylov.h > mup_pre.proto +# +# Each output line corresponds to one function prototype and consists of fields +# separated by commas as follows: +# +# field 1 = function return type +# field 2 = function name +# field 3 ... = function prototype arguments +# +# The script should work for any prototype that doesn't contain parentheses as +# data types (e.g., pointers to functions). + +scriptdir=`dirname $0` + +FFILE=$1 +HFILE=$2 + +# Create a temp header file where each line ends in a semicolon to ensure +# that function prototypes appear on a single line. First insert EOL after +# every semicolon, then remove EOL on all lines without a semicolon. +sed 's/\;/\;\n/g' $HFILE | awk '{if ($0 ~ /[;]/) {print} else {printf "%s ", $0}}' > $HFILE.tmp + +# Match and print the prototype for each function, then strip away extra space, +# parentheses, and commas. Also strip away ' , void ' at the end of a line to +# make it easy to handle functions with no arguments, i.e., Foo(void). +cat $FFILE | while read -r FNAME +do + awk -v fname=$FNAME ' + BEGIN { pattern = ("(const)?[[:blank:]]*[a-zA-Z0-9_]+[[:blank:]*]+" fname "[[:blank:]]*[(][^)]*[)][[:blank:]]*[;]$") } + { + # The first call to match speeds things up a bit + if ( match($0, fname) ){ + if ( match($0, pattern) ) + { + proto = substr($0, RSTART, RLENGTH) + sub(/^[[:blank:]]*/, "", proto); + match(proto, (fname ".*$")) + print substr(proto, 1, RSTART-1) , "," substr(proto, RSTART, RLENGTH) + }} + + }' $HFILE.tmp | + sed -e 's/;//g' -e 's/(/,/g' -e 's/)/ /g' -e 's/,/ , /g' -e 's/[[:blank:]][[:blank:]]*/ /g' | + sed -e 's/ , void $//' +done + +# Clean up temporary files +rm -f $HFILE.tmp diff --git a/src/config/generate_function_list.sh b/src/config/generate_function_list.sh new file mode 100755 index 0000000000..f99cabf4e6 --- /dev/null +++ b/src/config/generate_function_list.sh @@ -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) + +# Print the defined function names in the object files of the current directory. +# +# The script uses 'nm' and searches for functions labeled with 'T', i.e., +# symbol is in the text (code) section and is globally visible. + +# This prevents unmatched patterns from expanding (e.g., when there are no .obj files) +shopt -s nullglob + +# Use awk to avoid issues with spacing +nm -P *.o *.obj | awk '$2 == "T" {print $1}' | sed -e 's/^_//' -e 's/_$//' diff --git a/src/config/mup_check_dir.sh b/src/config/mup_check_dir.sh new file mode 100755 index 0000000000..3d8a95cd87 --- /dev/null +++ b/src/config/mup_check_dir.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) + +# Check that current multiprecision functions are up to date. The script will +# create three files: +# +# mup_check.old - contains the original function list +# mup_check.new - contains the newly generated list +# mup_check.err - the difference between the old/new files +# +# NOTE: Must be run on symbols generated from the non-multiprecision build. + +scriptdir=`dirname $0` + +# Check if terminal supports colors +if [ -t 1 ]; then + # Use colors + RED='\033[0;31m' + GREEN='\033[0;32m' + NC='\033[0m' # No Color +else + # Plain text + RED='' + GREEN='' + NC='' +fi + +export LC_COLLATE=C # sort by listing capital letters first + +cat mup.fixed mup.functions mup.methods | sort | uniq > mup_check.old +$scriptdir/generate_function_list.sh | sort | uniq > mup_check.new + +# Remove functions listed in mup.exclude (if it exists) +if [ -e mup.exclude ]; then + egrep -v -f mup.exclude mup_check.new > mup_check.new.tmp + mv mup_check.new.tmp mup_check.new +fi + +diff -wc mup_check.old mup_check.new > mup_check.err + +SZ=`ls -l mup_check.err | awk '{print $5}'` +if [ "$SZ" != 0 ]; then + echo -ne "${RED}UPDATE${NC} - see $(pwd)/mup_check.err\n" +else + echo -ne "${GREEN}OK${NC}\n" +fi diff --git a/src/config/version.sh b/src/config/version.sh index e708393e4e..362c0c1e04 100755 --- a/src/config/version.sh +++ b/src/config/version.sh @@ -4,8 +4,8 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -hypre_version="2.33.0" -hypre_reldate="2025/04/03" +hypre_version="3.0.0" +hypre_reldate="2025/09/26" hypre_major=`echo $hypre_version | cut -d. -f 1` hypre_minor=`echo $hypre_version | cut -d. -f 2` diff --git a/src/config/write_header.sh b/src/config/write_header.sh new file mode 100755 index 0000000000..fe9bc9c486 --- /dev/null +++ b/src/config/write_header.sh @@ -0,0 +1,18 @@ +#!/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) + +# Write hypre copyright header to stdout +# Usage: write_header.sh + +cat <<@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +@ diff --git a/src/configure b/src/configure index 70d4b64d4d..e5833b0565 100755 --- a/src/configure +++ b/src/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.in Id. # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for hypre 2.33.0. +# Generated by GNU Autoconf 2.71 for hypre 3.0.0. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, @@ -612,8 +612,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='hypre' PACKAGE_TARNAME='hypre' -PACKAGE_VERSION='2.33.0' -PACKAGE_STRING='hypre 2.33.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='hypre 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -744,6 +744,7 @@ CUFLAGS CUCC HYPRE_CUDA_SM CUDA_HOME +MP_BUILD host_os host_vendor host_cpu @@ -808,6 +809,7 @@ enable_bigint enable_single enable_longdouble enable_complex +enable_mixed_precision enable_maxdim enable_persistent enable_hopscotch @@ -1474,7 +1476,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.33.0 to adapt to many kinds of systems. +\`configure' configures hypre 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1540,7 +1542,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of hypre 2.33.0:";; + short | recursive ) echo "Configuration of hypre 3.0.0:";; esac cat <<\_ACEOF @@ -1558,6 +1560,8 @@ Optional Features: --enable-single Use single precision values (default is NO). --enable-longdouble Use long double precision values (default is NO). --enable-complex Use complex values (default is NO). + --enable-mixed-precision + Enable mixed-precision build (default is NO). --enable-maxdim=MAXDIM Change max dimension size to MAXDIM (default is 3). Currently must be at least 3. --enable-persistent Uses persistent communication (default is NO). @@ -1908,7 +1912,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -hypre configure 2.33.0 +hypre configure 3.0.0 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -2253,7 +2257,7 @@ 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.33.0, which was +It was created by hypre $as_me 3.0.0, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3234,9 +3238,9 @@ ac_config_headers="$ac_config_headers HYPRE_config.h:config/HYPRE_config.h.in" HYPRE_NAME="hypre" -HYPRE_VERSION="2.33.0" -HYPRE_NUMBER=23300 -HYPRE_DATE="2025/04/03" +HYPRE_VERSION="3.0.0" +HYPRE_NUMBER=30000 +HYPRE_DATE="2025/09/26" HYPRE_TIME="00:00:00" HYPRE_BUGS="https://github.com/hypre-space/hypre/issues" HYPRE_SRCDIR="`pwd`" @@ -3361,6 +3365,11 @@ hypre_using_umpire_host=no hypre_using_umpire_device=no hypre_using_umpire_um=no hypre_using_umpire_pinned=no +hypre_user_disabled_umpire=no +hypre_user_gave_umpire_inc=no +hypre_user_gave_umpire_lib=no +hypre_user_gave_umpire_lib_dirs=no +hypre_user_gave_umpire_libs=no hypre_warp_size=32 hypre_using_caliper=no @@ -3374,7 +3383,7 @@ hypre_using_memory_tracker=no hypre_test_using_host=no -hypre_cxxstd=11 +hypre_cxxstd=17 hypre_using_magma=no hypre_user_gave_magma_inc=no @@ -3627,6 +3636,29 @@ printf "%s\n" "#define HYPRE_COMPLEX 1" >>confdefs.h fi +# Check whether --enable-mixed-precision was given. +if test ${enable_mixed_precision+y} +then : + enableval=$enable_mixed_precision; case "${enableval}" in + yes) hypre_using_fei=no + hypre_using_mixed_precision=yes ;; + no) hypre_using_mixed_precision=no ;; + *) as_fn_error $? "Bad value ${enableval} for --enable-mixed-precision" "$LINENO" 5 ;; + esac +else $as_nop + hypre_using_mixed_precision=no + +fi + +if test "$hypre_using_mixed_precision" = "yes" +then + +printf "%s\n" "#define HYPRE_MIXED_PRECISION 1" >>confdefs.h + + MP_BUILD=1 + +fi + # Check whether --enable-maxdim was given. if test ${enable_maxdim+y} then : @@ -4013,9 +4045,8 @@ test -n "$CC" || CC="""" CFLAGS="" elif test "x$GCC" = "xyes" || test "x$CC" = "xgcc"; then FFLAGS="-g -Wall" - CFLAGS="-g -Wall -std=gnu99 -pedantic -Wfloat-conversion -fsingle-precision-constant" - CXXFLAGS="-g -Wall -Wshadow -fno-implicit-templates" - CXXFLAGS="$CXXFLAGS -Woverloaded-virtual -ansi -pedantic" + CFLAGS="-g -Wall -std=gnu99 -pedantic -Wfloat-conversion -fsingle-precision-constant -Werror=vla" + CXXFLAGS="-g -Wall -Wshadow -fno-implicit-templates -Woverloaded-virtual -ansi -pedantic -Werror=vla" elif test "x$CC" = "xicc"; then FFLAGS="-g -Wall" CFLAGS="-g -Xc -Wall -x c" @@ -5100,9 +5131,10 @@ fi if test ${with_umpire+y} then : withval=$with_umpire; case "${withval}" in - yes) hypre_using_umpire_device=yes + yes) hypre_using_umpire=yes + hypre_using_umpire_device=yes hypre_using_umpire_um=yes ;; - no) ;; + no) hypre_user_disabled_umpire=yes ;; *) ;; esac fi @@ -5115,7 +5147,7 @@ then : withval=$with_umpire_include; for umpire_dir in $withval; do HYPRE_UMPIRE_INCLUDE="-I$umpire_dir $HYPRE_UMPIRE_INCLUDE" done; - +hypre_user_gave_umpire_inc=yes fi @@ -5127,7 +5159,7 @@ then : withval=$with_umpire_lib; for umpire_lib in $withval; do HYPRE_UMPIRE_LIB="$umpire_lib $HYPRE_UMPIRE_LIB" done; - + hypre_user_gave_umpire_lib=yes fi @@ -5139,7 +5171,7 @@ then : withval=$with_umpire_libs; for umpire_lib in $withval; do HYPRE_UMPIRE_LIB="-l$umpire_lib $HYPRE_UMPIRE_LIB" done; - + hypre_user_gave_umpire_libs=yes fi @@ -5150,8 +5182,9 @@ 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" + HYPRE_UMPIRE_RPATH="${HYPRE_UMPIRE_RPATH} -Wl,-rpath,${umpire_lib_dir}" done; - + hypre_user_gave_umpire_lib_dirs=yes fi @@ -10628,32 +10661,39 @@ then # Check for CDNA vs RDNA architecture { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GPU architecture using rocm-smi" >&5 printf %s "checking for GPU architecture using rocm-smi... " >&6; } - gfx_versions=$(rocm-smi --showproductname 2>/dev/null | grep 'gfx' | awk '{print $NF}' | tr '\n' ' ') - rocm_smi_cmd=$(rocm-smi --showproductname) + rocm_smi_cmd=$(rocm-smi --showproductname 2>/dev/null) rocm_smi_status=$? + gfx_versions=$(echo "$rocm_smi_cmd" | grep 'gfx' | awk '{print $NF}' | tr '\n' ' ') if test $rocm_smi_status -eq 0 then - cdna_found=no - for gfx_version in $gfx_versions - do - case "$gfx_version" in - gfx9*) - cdna_found=yes - break - ;; - esac - done - - if test "$cdna_found" = "yes" + if test -z "$gfx_versions" then hypre_warp_size=64 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: CDNA detected ($gfx_versions), setting warp size to 64" >&5 -printf "%s\n" "CDNA detected ($gfx_versions), setting warp size to 64" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no gfx version found in rocm-smi output, defaulting to warp size 64" >&5 +printf "%s\n" "no gfx version found in rocm-smi output, defaulting to warp size 64" >&6; } else - hypre_warp_size=32 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: RDNA detected ($gfx_versions), setting warp size to 32" >&5 -printf "%s\n" "RDNA detected ($gfx_versions), setting warp size to 32" >&6; } + cdna_found=no + for gfx_version in $gfx_versions + do + case "$gfx_version" in + gfx9* ) + cdna_found=yes + break + ;; + esac + done + + if test "$cdna_found" = "yes" + then + hypre_warp_size=64 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: CDNA detected ( $gfx_versions), setting warp size to 64" >&5 +printf "%s\n" "CDNA detected ( $gfx_versions), setting warp size to 64" >&6; } + else + hypre_warp_size=32 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: RDNA detected ( $gfx_versions), setting warp size to 32" >&5 +printf "%s\n" "RDNA detected ( $gfx_versions), setting warp size to 32" >&6; } + fi fi else hypre_warp_size=64 @@ -10712,6 +10752,36 @@ printf "%s\n" "#define HYPRE_USING_KOKKOS 1" >>confdefs.h LINK_CC=${LINK_CXX} fi +if test "x$hypre_user_disabled_umpire" != "xyes" +then + if test "x$hypre_using_umpire" != "xyes" + then + if test "x$hypre_using_cuda" = "xyes" || test "x$hypre_using_hip" = "xyes" + then + hypre_using_umpire=yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Enabling Umpire automatically for GPU build (CUDA/HIP) for performance and allocator features. Use --without-umpire to opt out." >&5 +printf "%s\n" "$as_me: Enabling Umpire automatically for GPU build (CUDA/HIP) for performance and allocator features. Use --without-umpire to opt out." >&6;} + fi + fi +fi + +if test "x$hypre_user_disabled_umpire" = "xyes" +then + if test "x$hypre_using_cuda" = "xyes" || test "x$hypre_using_hip" = "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: Umpire is explicitly disabled while building hypre for GPUs." >&5 +printf "%s\n" "$as_me: WARNING: Umpire is explicitly disabled while building hypre for GPUs." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: This is not recommended for performance reasons!" >&5 +printf "%s\n" "$as_me: WARNING: This is not recommended for performance reasons!" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Enable it with --with-umpire." >&5 +printf "%s\n" "$as_me: WARNING: Enable it with --with-umpire." >&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_umpire_host" = "xyes" then hypre_using_umpire=yes @@ -10749,6 +10819,29 @@ then printf "%s\n" "#define HYPRE_USING_UMPIRE 1" >>confdefs.h + if test "x$HYPRE_UMPIRE_RPATH" != "x" + then + LDFLAGS="${LDFLAGS} ${HYPRE_UMPIRE_RPATH}" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Adding Umpire rpath to LDFLAGS: ${HYPRE_UMPIRE_RPATH}" >&5 +printf "%s\n" "$as_me: Adding Umpire rpath to LDFLAGS: ${HYPRE_UMPIRE_RPATH}" >&6;} + fi + if test "$hypre_user_gave_umpire_inc" != "yes" || \ + test "$hypre_user_gave_umpire_lib" != "yes" && test "$hypre_user_gave_umpire_libs" != "yes" || \ + test "$hypre_user_gave_umpire_lib_dirs" != "yes" + then + as_fn_error $? " +=============================================================== +Umpire has been enabled for GPU builds to improve performance. +However, Umpire include and/or library paths were not provided. + +Provide the following flags as appropriate: + --with-umpire-include=\"/path-to-umpire-install/include\" + --with-umpire-lib-dirs=\"/path-to-umpire-install/lib\" + --with-umpire-libs=\"umpire\" or --with-umpire-lib=\"-lumpire\" + +To opt out (not recommended), configure with --without-umpire. +===============================================================" "$LINENO" 5 + fi fi if test "$hypre_using_cuda" = "yes" @@ -10893,7 +10986,7 @@ printf "%s\n" "#define HYPRE_USING_HIP 1" >>confdefs.h HYPRE_CUDA_GENCODE="`echo ${HYPRE_CUDA_GENCODE}|sed 's/,$//'`" fi - HIPCXXFLAGS="-x hip -fPIE -std=c++14 ${HIPCXXFLAGS}" + HIPCXXFLAGS="-x hip -fPIE -std=c++${hypre_cxxstd} ${HIPCXXFLAGS}" if test x"$hypre_using_debug" == x"yes" then : @@ -10994,6 +11087,7 @@ printf "%s\n" "#define HYPRE_USING_SYCL 1" >>confdefs.h else SYCLFLAGS="-O3 ${SYCLFLAGS}" fi + LDFLAGS+=" -fsycl -fsycl-device-code-split=per_kernel -Wl,--no-relax" if test "x${HYPRE_SYCL_TARGET}" != "x" @@ -11008,7 +11102,7 @@ printf "%s\n" "#define HYPRE_USING_SYCL 1" >>confdefs.h if test "$hypre_using_shared" = "yes" then SYCLFLAGS="${SHARED_COMPILE_FLAG} ${SYCLFLAGS}" - BUILD_CC_SHARED="\${CUCC} ${SHARED_BUILD_FLAG}" + BUILD_CC_SHARED="${CUCC} ${SHARED_BUILD_FLAG}" fi if test "$hypre_user_chose_cuflags" = "no" @@ -11413,6 +11507,7 @@ printf "%s\n" "#define HYPRE_LINUX 1" >>confdefs.h + ac_config_files="$ac_config_files config/Makefile.config" @@ -11917,7 +12012,7 @@ 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.33.0, which was +This file was extended by hypre $as_me 3.0.0, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -11981,7 +12076,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -hypre config.status 2.33.0 +hypre config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" @@ -12690,3 +12785,4 @@ 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/src/distributed_ls/Euclid/CMakeLists.txt b/src/distributed_ls/Euclid/CMakeLists.txt index 134d9ac44f..46d18e1020 100644 --- a/src/distributed_ls/Euclid/CMakeLists.txt +++ b/src/distributed_ls/Euclid/CMakeLists.txt @@ -3,7 +3,40 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -set(SRCS +set(HDRS + blas_dh.h + euclid_common.h + euclid_config.h + Euclid_dh.h + ExternalRows_dh.h + Factor_dh.h + getRow_dh.h + guards_dh.h + Hash_dh.h + Hash_i_dh.h + ilu_dh.h + io_dh.h + krylov_dh.h + macros_dh.h + Mat_dh.h + mat_dh_private.h + MatGenFD.h + Mem_dh.h + Numbering_dh.h + Parser_dh.h + shellSort_dh.h + sig_dh.h + SortedList_dh.h + SortedSet_dh.h + SubdomainGraph_dh.h + TimeLog_dh.h + Timer_dh.h + Vec_dh.h + _hypre_Euclid.h +) + +# Sources that need multi-precision compilation (FILES from Makefile) +set(MUP_SRCS blas_dh.c Euclid_apply.c Euclid_dh.c @@ -34,6 +67,13 @@ set(SRCS Vec_dh.c ) -target_sources(${PROJECT_NAME} - PRIVATE ${SRCS} +# Sources that don't need multi-precision compilation (none for Euclid) +set(REGULAR_SRCS ) + +if(HYPRE_ENABLE_MIXED_PRECISION) + setup_mixed_precision_compilation("Euclid" SRCS "${MUP_SRCS}") + target_sources(${PROJECT_NAME} PRIVATE ${REGULAR_SRCS} ${HDRS}) +else() + target_sources(${PROJECT_NAME} PRIVATE ${MUP_SRCS} ${REGULAR_SRCS} ${HDRS}) +endif() diff --git a/src/distributed_ls/Euclid/Makefile b/src/distributed_ls/Euclid/Makefile index 4c424b7b4a..0f61a9ea55 100644 --- a/src/distributed_ls/Euclid/Makefile +++ b/src/distributed_ls/Euclid/Makefile @@ -80,6 +80,16 @@ FILES =\ OBJS = ${FILES:.c=.o} +ifeq (${MP_BUILD}, 1) + +COBJS_single = ${FILES:.c=.o_flt} +COBJS_double = ${FILES:.c=.o_dbl} +COBJS_longdouble = ${FILES:.c=.o_ldbl} + +OBJS = ${COBJS_single} ${COBJS_double} ${COBJS_longdouble} + +endif + SONAME = libHYPRE_Euclid-${HYPRE_RELEASE_VERSION}${HYPRE_LIB_SUFFIX} ################################################################## @@ -94,6 +104,7 @@ install: libHYPRE_Euclid${HYPRE_LIB_SUFFIX} clean: rm -f *.o libHYPRE* + rm -f *.o_flt *.o_dbl *.o_ldbl rm -rf pchdir tca.map *inslog* distclean: clean diff --git a/src/distributed_ls/Euclid/_hypre_Euclid.h b/src/distributed_ls/Euclid/_hypre_Euclid.h index 6566d503d2..de32367760 100644 --- a/src/distributed_ls/Euclid/_hypre_Euclid.h +++ b/src/distributed_ls/Euclid/_hypre_Euclid.h @@ -15,6 +15,10 @@ #include "HYPRE_distributed_matrix_mv.h" #include "_hypre_utilities.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_Euclid_mup_def.h" +#endif + #elif defined(PETSC_MODE) #include "petsc_config.h" #endif diff --git a/src/distributed_ls/Euclid/_hypre_Euclid_mup_def.h b/src/distributed_ls/Euclid/_hypre_Euclid_mup_def.h new file mode 100644 index 0000000000..68ac56dbea --- /dev/null +++ b/src/distributed_ls/Euclid/_hypre_Euclid_mup_def.h @@ -0,0 +1,245 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#ifndef hypre_EUCLID_MUP_DEF_HEADER +#define hypre_EUCLID_MUP_DEF_HEADER + +#include "_hypre_mup_def.h" + +#define Axpy HYPRE_FIXEDPRECISION_FUNC ( Axpy ) +#define CopyVec HYPRE_FIXEDPRECISION_FUNC ( CopyVec ) +#define Error_dhEndFunc HYPRE_FIXEDPRECISION_FUNC ( Error_dhEndFunc ) +#define Error_dhStartFunc HYPRE_FIXEDPRECISION_FUNC ( Error_dhStartFunc ) +#define EuclidFinalize HYPRE_FIXEDPRECISION_FUNC ( EuclidFinalize ) +#define EuclidGetDimensions HYPRE_FIXEDPRECISION_FUNC ( EuclidGetDimensions ) +#define EuclidGetRow HYPRE_FIXEDPRECISION_FUNC ( EuclidGetRow ) +#define EuclidInitialize HYPRE_FIXEDPRECISION_FUNC ( EuclidInitialize ) +#define EuclidIsInitialized HYPRE_FIXEDPRECISION_FUNC ( EuclidIsInitialized ) +#define EuclidRestoreRow HYPRE_FIXEDPRECISION_FUNC ( EuclidRestoreRow ) +#define Euclid_dhApply HYPRE_FIXEDPRECISION_FUNC ( Euclid_dhApply ) +#define Euclid_dhCreate HYPRE_FIXEDPRECISION_FUNC ( Euclid_dhCreate ) +#define Euclid_dhDestroy HYPRE_FIXEDPRECISION_FUNC ( Euclid_dhDestroy ) +#define Euclid_dhInputHypreMat HYPRE_FIXEDPRECISION_FUNC ( Euclid_dhInputHypreMat ) +#define Euclid_dhPrintHypreReport HYPRE_FIXEDPRECISION_FUNC ( Euclid_dhPrintHypreReport ) +#define Euclid_dhPrintScaling HYPRE_FIXEDPRECISION_FUNC ( Euclid_dhPrintScaling ) +#define Euclid_dhPrintStats HYPRE_FIXEDPRECISION_FUNC ( Euclid_dhPrintStats ) +#define Euclid_dhPrintStatsShort HYPRE_FIXEDPRECISION_FUNC ( Euclid_dhPrintStatsShort ) +#define Euclid_dhPrintStatsShorter HYPRE_FIXEDPRECISION_FUNC ( Euclid_dhPrintStatsShorter ) +#define Euclid_dhPrintTestData HYPRE_FIXEDPRECISION_FUNC ( Euclid_dhPrintTestData ) +#define Euclid_dhSetup HYPRE_FIXEDPRECISION_FUNC ( Euclid_dhSetup ) +#define Euclid_dhSolve HYPRE_FIXEDPRECISION_FUNC ( Euclid_dhSolve ) +#define ExternalRows_dhCreate HYPRE_FIXEDPRECISION_FUNC ( ExternalRows_dhCreate ) +#define ExternalRows_dhDestroy HYPRE_FIXEDPRECISION_FUNC ( ExternalRows_dhDestroy ) +#define ExternalRows_dhGetRow HYPRE_FIXEDPRECISION_FUNC ( ExternalRows_dhGetRow ) +#define ExternalRows_dhInit HYPRE_FIXEDPRECISION_FUNC ( ExternalRows_dhInit ) +#define ExternalRows_dhRecvRows HYPRE_FIXEDPRECISION_FUNC ( ExternalRows_dhRecvRows ) +#define ExternalRows_dhSendRows HYPRE_FIXEDPRECISION_FUNC ( ExternalRows_dhSendRows ) +#define Factor_dhCondEst HYPRE_FIXEDPRECISION_FUNC ( Factor_dhCondEst ) +#define Factor_dhCreate HYPRE_FIXEDPRECISION_FUNC ( Factor_dhCreate ) +#define Factor_dhDestroy HYPRE_FIXEDPRECISION_FUNC ( Factor_dhDestroy ) +#define Factor_dhInit HYPRE_FIXEDPRECISION_FUNC ( Factor_dhInit ) +#define Factor_dhMaxPivotInverse HYPRE_FIXEDPRECISION_FUNC ( Factor_dhMaxPivotInverse ) +#define Factor_dhMaxValue HYPRE_FIXEDPRECISION_FUNC ( Factor_dhMaxValue ) +#define Factor_dhPrintDiags HYPRE_FIXEDPRECISION_FUNC ( Factor_dhPrintDiags ) +#define Factor_dhPrintGraph HYPRE_FIXEDPRECISION_FUNC ( Factor_dhPrintGraph ) +#define Factor_dhPrintRows HYPRE_FIXEDPRECISION_FUNC ( Factor_dhPrintRows ) +#define Factor_dhPrintTriples HYPRE_FIXEDPRECISION_FUNC ( Factor_dhPrintTriples ) +#define Factor_dhReadNz HYPRE_FIXEDPRECISION_FUNC ( Factor_dhReadNz ) +#define Factor_dhReallocate HYPRE_FIXEDPRECISION_FUNC ( Factor_dhReallocate ) +#define Factor_dhSolve HYPRE_FIXEDPRECISION_FUNC ( Factor_dhSolve ) +#define Factor_dhSolveSeq HYPRE_FIXEDPRECISION_FUNC ( Factor_dhSolveSeq ) +#define Factor_dhSolveSetup HYPRE_FIXEDPRECISION_FUNC ( Factor_dhSolveSetup ) +#define Factor_dhTranspose HYPRE_FIXEDPRECISION_FUNC ( Factor_dhTranspose ) +#define Factor_dh_junk HYPRE_FIXEDPRECISION_FUNC ( Factor_dh_junk ) +#define Hash_dhCreate HYPRE_FIXEDPRECISION_FUNC ( Hash_dhCreate ) +#define Hash_dhDestroy HYPRE_FIXEDPRECISION_FUNC ( Hash_dhDestroy ) +#define Hash_dhInsert HYPRE_FIXEDPRECISION_FUNC ( Hash_dhInsert ) +#define Hash_dhLookup HYPRE_FIXEDPRECISION_FUNC ( Hash_dhLookup ) +#define Hash_dhPrint HYPRE_FIXEDPRECISION_FUNC ( Hash_dhPrint ) +#define Hash_dhReset HYPRE_FIXEDPRECISION_FUNC ( Hash_dhReset ) +#define Hash_i_dhCreate HYPRE_FIXEDPRECISION_FUNC ( Hash_i_dhCreate ) +#define Hash_i_dhDestroy HYPRE_FIXEDPRECISION_FUNC ( Hash_i_dhDestroy ) +#define Hash_i_dhInsert HYPRE_FIXEDPRECISION_FUNC ( Hash_i_dhInsert ) +#define Hash_i_dhLookup HYPRE_FIXEDPRECISION_FUNC ( Hash_i_dhLookup ) +#define Hash_i_dhReset HYPRE_FIXEDPRECISION_FUNC ( Hash_i_dhReset ) +#define InnerProd HYPRE_FIXEDPRECISION_FUNC ( InnerProd ) +#define MatGenFD_Create HYPRE_FIXEDPRECISION_FUNC ( MatGenFD_Create ) +#define MatGenFD_Destroy HYPRE_FIXEDPRECISION_FUNC ( MatGenFD_Destroy ) +#define MatGenFD_Run HYPRE_FIXEDPRECISION_FUNC ( MatGenFD_Run ) +#define Mat_dhCreate HYPRE_FIXEDPRECISION_FUNC ( Mat_dhCreate ) +#define Mat_dhDestroy HYPRE_FIXEDPRECISION_FUNC ( Mat_dhDestroy ) +#define Mat_dhFixDiags HYPRE_FIXEDPRECISION_FUNC ( Mat_dhFixDiags ) +#define Mat_dhGetRow HYPRE_FIXEDPRECISION_FUNC ( Mat_dhGetRow ) +#define Mat_dhMakeStructurallySymmetric HYPRE_FIXEDPRECISION_FUNC ( Mat_dhMakeStructurallySymmetric ) +#define Mat_dhMatVec HYPRE_FIXEDPRECISION_FUNC ( Mat_dhMatVec ) +#define Mat_dhMatVecSetdown HYPRE_FIXEDPRECISION_FUNC ( Mat_dhMatVecSetdown ) +#define Mat_dhMatVecSetup HYPRE_FIXEDPRECISION_FUNC ( Mat_dhMatVecSetup ) +#define Mat_dhMatVec_omp HYPRE_FIXEDPRECISION_FUNC ( Mat_dhMatVec_omp ) +#define Mat_dhMatVec_uni HYPRE_FIXEDPRECISION_FUNC ( Mat_dhMatVec_uni ) +#define Mat_dhMatVec_uni_omp HYPRE_FIXEDPRECISION_FUNC ( Mat_dhMatVec_uni_omp ) +#define Mat_dhPartition HYPRE_FIXEDPRECISION_FUNC ( Mat_dhPartition ) +#define Mat_dhPermute HYPRE_FIXEDPRECISION_FUNC ( Mat_dhPermute ) +#define Mat_dhPrintBIN HYPRE_FIXEDPRECISION_FUNC ( Mat_dhPrintBIN ) +#define Mat_dhPrintCSR HYPRE_FIXEDPRECISION_FUNC ( Mat_dhPrintCSR ) +#define Mat_dhPrintDiags HYPRE_FIXEDPRECISION_FUNC ( Mat_dhPrintDiags ) +#define Mat_dhPrintGraph HYPRE_FIXEDPRECISION_FUNC ( Mat_dhPrintGraph ) +#define Mat_dhPrintRows HYPRE_FIXEDPRECISION_FUNC ( Mat_dhPrintRows ) +#define Mat_dhPrintTriples HYPRE_FIXEDPRECISION_FUNC ( Mat_dhPrintTriples ) +#define Mat_dhReadBIN HYPRE_FIXEDPRECISION_FUNC ( Mat_dhReadBIN ) +#define Mat_dhReadCSR HYPRE_FIXEDPRECISION_FUNC ( Mat_dhReadCSR ) +#define Mat_dhReadNz HYPRE_FIXEDPRECISION_FUNC ( Mat_dhReadNz ) +#define Mat_dhReadTriples HYPRE_FIXEDPRECISION_FUNC ( Mat_dhReadTriples ) +#define Mat_dhReduceTiming HYPRE_FIXEDPRECISION_FUNC ( Mat_dhReduceTiming ) +#define Mat_dhRestoreRow HYPRE_FIXEDPRECISION_FUNC ( Mat_dhRestoreRow ) +#define Mat_dhRowPermute HYPRE_FIXEDPRECISION_FUNC ( Mat_dhRowPermute ) +#define Mat_dhTranspose HYPRE_FIXEDPRECISION_FUNC ( Mat_dhTranspose ) +#define Mat_dhZeroTiming HYPRE_FIXEDPRECISION_FUNC ( Mat_dhZeroTiming ) +#define Mem_dhCreate HYPRE_FIXEDPRECISION_FUNC ( Mem_dhCreate ) +#define Mem_dhDestroy HYPRE_FIXEDPRECISION_FUNC ( Mem_dhDestroy ) +#define Mem_dhFree HYPRE_FIXEDPRECISION_FUNC ( Mem_dhFree ) +#define Mem_dhMalloc HYPRE_FIXEDPRECISION_FUNC ( Mem_dhMalloc ) +#define Mem_dhPrint HYPRE_FIXEDPRECISION_FUNC ( Mem_dhPrint ) +#define Norm2 HYPRE_FIXEDPRECISION_FUNC ( Norm2 ) +#define Numbering_dhCreate HYPRE_FIXEDPRECISION_FUNC ( Numbering_dhCreate ) +#define Numbering_dhDestroy HYPRE_FIXEDPRECISION_FUNC ( Numbering_dhDestroy ) +#define Numbering_dhGlobalToLocal HYPRE_FIXEDPRECISION_FUNC ( Numbering_dhGlobalToLocal ) +#define Numbering_dhSetup HYPRE_FIXEDPRECISION_FUNC ( Numbering_dhSetup ) +#define Parser_dhCreate HYPRE_FIXEDPRECISION_FUNC ( Parser_dhCreate ) +#define Parser_dhDestroy HYPRE_FIXEDPRECISION_FUNC ( Parser_dhDestroy ) +#define Parser_dhHasSwitch HYPRE_FIXEDPRECISION_FUNC ( Parser_dhHasSwitch ) +#define Parser_dhInit HYPRE_FIXEDPRECISION_FUNC ( Parser_dhInit ) +#define Parser_dhInsert HYPRE_FIXEDPRECISION_FUNC ( Parser_dhInsert ) +#define Parser_dhPrint HYPRE_FIXEDPRECISION_FUNC ( Parser_dhPrint ) +#define Parser_dhReadDouble HYPRE_FIXEDPRECISION_FUNC ( Parser_dhReadDouble ) +#define Parser_dhReadInt HYPRE_FIXEDPRECISION_FUNC ( Parser_dhReadInt ) +#define Parser_dhReadString HYPRE_FIXEDPRECISION_FUNC ( Parser_dhReadString ) +#define Parser_dhUpdateFromFile HYPRE_FIXEDPRECISION_FUNC ( Parser_dhUpdateFromFile ) +#define PrintMatUsingGetRow HYPRE_FIXEDPRECISION_FUNC ( PrintMatUsingGetRow ) +#define ScaleVec HYPRE_FIXEDPRECISION_FUNC ( ScaleVec ) +#define SortedList_dhCreate HYPRE_FIXEDPRECISION_FUNC ( SortedList_dhCreate ) +#define SortedList_dhDestroy HYPRE_FIXEDPRECISION_FUNC ( SortedList_dhDestroy ) +#define SortedList_dhEnforceConstraint HYPRE_FIXEDPRECISION_FUNC ( SortedList_dhEnforceConstraint ) +#define SortedList_dhFind HYPRE_FIXEDPRECISION_FUNC ( SortedList_dhFind ) +#define SortedList_dhGetSmallest HYPRE_FIXEDPRECISION_FUNC ( SortedList_dhGetSmallest ) +#define SortedList_dhGetSmallestLowerTri HYPRE_FIXEDPRECISION_FUNC ( SortedList_dhGetSmallestLowerTri ) +#define SortedList_dhInit HYPRE_FIXEDPRECISION_FUNC ( SortedList_dhInit ) +#define SortedList_dhInsert HYPRE_FIXEDPRECISION_FUNC ( SortedList_dhInsert ) +#define SortedList_dhInsertOrUpdate HYPRE_FIXEDPRECISION_FUNC ( SortedList_dhInsertOrUpdate ) +#define SortedList_dhPermuteAndInsert HYPRE_FIXEDPRECISION_FUNC ( SortedList_dhPermuteAndInsert ) +#define SortedList_dhReadCount HYPRE_FIXEDPRECISION_FUNC ( SortedList_dhReadCount ) +#define SortedList_dhReset HYPRE_FIXEDPRECISION_FUNC ( SortedList_dhReset ) +#define SortedList_dhResetGetSmallest HYPRE_FIXEDPRECISION_FUNC ( SortedList_dhResetGetSmallest ) +#define SortedSet_dhCreate HYPRE_FIXEDPRECISION_FUNC ( SortedSet_dhCreate ) +#define SortedSet_dhDestroy HYPRE_FIXEDPRECISION_FUNC ( SortedSet_dhDestroy ) +#define SortedSet_dhGetList HYPRE_FIXEDPRECISION_FUNC ( SortedSet_dhGetList ) +#define SortedSet_dhInsert HYPRE_FIXEDPRECISION_FUNC ( SortedSet_dhInsert ) +#define SubdomainGraph_dhCreate HYPRE_FIXEDPRECISION_FUNC ( SubdomainGraph_dhCreate ) +#define SubdomainGraph_dhDestroy HYPRE_FIXEDPRECISION_FUNC ( SubdomainGraph_dhDestroy ) +#define SubdomainGraph_dhDump HYPRE_FIXEDPRECISION_FUNC ( SubdomainGraph_dhDump ) +#define SubdomainGraph_dhExchangePerms HYPRE_FIXEDPRECISION_FUNC ( SubdomainGraph_dhExchangePerms ) +#define SubdomainGraph_dhFindOwner HYPRE_FIXEDPRECISION_FUNC ( SubdomainGraph_dhFindOwner ) +#define SubdomainGraph_dhInit HYPRE_FIXEDPRECISION_FUNC ( SubdomainGraph_dhInit ) +#define SubdomainGraph_dhPrintRatios HYPRE_FIXEDPRECISION_FUNC ( SubdomainGraph_dhPrintRatios ) +#define SubdomainGraph_dhPrintStats HYPRE_FIXEDPRECISION_FUNC ( SubdomainGraph_dhPrintStats ) +#define SubdomainGraph_dhPrintStatsLong HYPRE_FIXEDPRECISION_FUNC ( SubdomainGraph_dhPrintStatsLong ) +#define SubdomainGraph_dhPrintSubdomainGraph HYPRE_FIXEDPRECISION_FUNC ( SubdomainGraph_dhPrintSubdomainGraph ) +#define TimeLog_dhCreate HYPRE_FIXEDPRECISION_FUNC ( TimeLog_dhCreate ) +#define TimeLog_dhDestroy HYPRE_FIXEDPRECISION_FUNC ( TimeLog_dhDestroy ) +#define TimeLog_dhMark HYPRE_FIXEDPRECISION_FUNC ( TimeLog_dhMark ) +#define TimeLog_dhPrint HYPRE_FIXEDPRECISION_FUNC ( TimeLog_dhPrint ) +#define TimeLog_dhReset HYPRE_FIXEDPRECISION_FUNC ( TimeLog_dhReset ) +#define TimeLog_dhStart HYPRE_FIXEDPRECISION_FUNC ( TimeLog_dhStart ) +#define TimeLog_dhStop HYPRE_FIXEDPRECISION_FUNC ( TimeLog_dhStop ) +#define Timer_dhCreate HYPRE_FIXEDPRECISION_FUNC ( Timer_dhCreate ) +#define Timer_dhDestroy HYPRE_FIXEDPRECISION_FUNC ( Timer_dhDestroy ) +#define Timer_dhReadCPU HYPRE_FIXEDPRECISION_FUNC ( Timer_dhReadCPU ) +#define Timer_dhReadUsage HYPRE_FIXEDPRECISION_FUNC ( Timer_dhReadUsage ) +#define Timer_dhReadWall HYPRE_FIXEDPRECISION_FUNC ( Timer_dhReadWall ) +#define Timer_dhStart HYPRE_FIXEDPRECISION_FUNC ( Timer_dhStart ) +#define Timer_dhStop HYPRE_FIXEDPRECISION_FUNC ( Timer_dhStop ) +#define Vec_dhCopy HYPRE_FIXEDPRECISION_FUNC ( Vec_dhCopy ) +#define Vec_dhCreate HYPRE_FIXEDPRECISION_FUNC ( Vec_dhCreate ) +#define Vec_dhDestroy HYPRE_FIXEDPRECISION_FUNC ( Vec_dhDestroy ) +#define Vec_dhDuplicate HYPRE_FIXEDPRECISION_FUNC ( Vec_dhDuplicate ) +#define Vec_dhInit HYPRE_FIXEDPRECISION_FUNC ( Vec_dhInit ) +#define Vec_dhPrint HYPRE_FIXEDPRECISION_FUNC ( Vec_dhPrint ) +#define Vec_dhPrintBIN HYPRE_FIXEDPRECISION_FUNC ( Vec_dhPrintBIN ) +#define Vec_dhRead HYPRE_FIXEDPRECISION_FUNC ( Vec_dhRead ) +#define Vec_dhReadBIN HYPRE_FIXEDPRECISION_FUNC ( Vec_dhReadBIN ) +#define Vec_dhSet HYPRE_FIXEDPRECISION_FUNC ( Vec_dhSet ) +#define Vec_dhSetRand HYPRE_FIXEDPRECISION_FUNC ( Vec_dhSetRand ) +#define bicgstab_euclid HYPRE_FIXEDPRECISION_FUNC ( bicgstab_euclid ) +#define boxThreeD HYPRE_FIXEDPRECISION_FUNC ( boxThreeD ) +#define box_1 HYPRE_FIXEDPRECISION_FUNC ( box_1 ) +#define box_2 HYPRE_FIXEDPRECISION_FUNC ( box_2 ) +#define build_adj_lists_private HYPRE_FIXEDPRECISION_FUNC ( build_adj_lists_private ) +#define cg_euclid HYPRE_FIXEDPRECISION_FUNC ( cg_euclid ) +#define closeFile_dh HYPRE_FIXEDPRECISION_FUNC ( closeFile_dh ) +#define closeLogfile_dh HYPRE_FIXEDPRECISION_FUNC ( closeLogfile_dh ) +#define compute_scaling_private HYPRE_FIXEDPRECISION_FUNC ( compute_scaling_private ) +#define create_nat_ordering_private HYPRE_FIXEDPRECISION_FUNC ( create_nat_ordering_private ) +#define delete_private HYPRE_FIXEDPRECISION_FUNC ( delete_private ) +#define destroy_nat_ordering_private HYPRE_FIXEDPRECISION_FUNC ( destroy_nat_ordering_private ) +#define dh_EndFunc HYPRE_FIXEDPRECISION_FUNC ( dh_EndFunc ) +#define dh_StartFunc HYPRE_FIXEDPRECISION_FUNC ( dh_StartFunc ) +#define e2_xy HYPRE_FIXEDPRECISION_FUNC ( e2_xy ) +#define echoInvocation_dh HYPRE_FIXEDPRECISION_FUNC ( echoInvocation_dh ) +#define fix_diags_private HYPRE_FIXEDPRECISION_FUNC ( fix_diags_private ) +#define fprintf_dh HYPRE_FIXEDPRECISION_FUNC ( fprintf_dh ) +#define iluk_mpi_bj HYPRE_FIXEDPRECISION_FUNC ( iluk_mpi_bj ) +#define iluk_mpi_pilu HYPRE_FIXEDPRECISION_FUNC ( iluk_mpi_pilu ) +#define iluk_seq HYPRE_FIXEDPRECISION_FUNC ( iluk_seq ) +#define iluk_seq_block HYPRE_FIXEDPRECISION_FUNC ( iluk_seq_block ) +#define ilut_row_private HYPRE_FIXEDPRECISION_FUNC ( ilut_row_private ) +#define ilut_seq HYPRE_FIXEDPRECISION_FUNC ( ilut_seq ) +#define insert_diags_private HYPRE_FIXEDPRECISION_FUNC ( insert_diags_private ) +#define insert_missing_diags_private HYPRE_FIXEDPRECISION_FUNC ( insert_missing_diags_private ) +#define invert_perm HYPRE_FIXEDPRECISION_FUNC ( invert_perm ) +#define io_dh_print_ebin_mat_private HYPRE_FIXEDPRECISION_FUNC ( io_dh_print_ebin_mat_private ) +#define io_dh_print_ebin_vec_private HYPRE_FIXEDPRECISION_FUNC ( io_dh_print_ebin_vec_private ) +#define io_dh_read_ebin_mat_private HYPRE_FIXEDPRECISION_FUNC ( io_dh_read_ebin_mat_private ) +#define io_dh_read_ebin_vec_private HYPRE_FIXEDPRECISION_FUNC ( io_dh_read_ebin_vec_private ) +#define konstant HYPRE_FIXEDPRECISION_FUNC ( konstant ) +#define make_full_private HYPRE_FIXEDPRECISION_FUNC ( make_full_private ) +#define make_symmetric_private HYPRE_FIXEDPRECISION_FUNC ( make_symmetric_private ) +#define mat_dh_print_csr_private HYPRE_FIXEDPRECISION_FUNC ( mat_dh_print_csr_private ) +#define mat_dh_print_graph_private HYPRE_FIXEDPRECISION_FUNC ( mat_dh_print_graph_private ) +#define mat_dh_read_csr_private HYPRE_FIXEDPRECISION_FUNC ( mat_dh_read_csr_private ) +#define mat_dh_read_triples_private HYPRE_FIXEDPRECISION_FUNC ( mat_dh_read_triples_private ) +#define mat_dh_transpose_private HYPRE_FIXEDPRECISION_FUNC ( mat_dh_transpose_private ) +#define mat_dh_transpose_reuse_private HYPRE_FIXEDPRECISION_FUNC ( mat_dh_transpose_reuse_private ) +#define mat_find_owner HYPRE_FIXEDPRECISION_FUNC ( mat_find_owner ) +#define mat_partition_private HYPRE_FIXEDPRECISION_FUNC ( mat_partition_private ) +#define matvec_euclid_seq HYPRE_FIXEDPRECISION_FUNC ( matvec_euclid_seq ) +#define openFile_dh HYPRE_FIXEDPRECISION_FUNC ( openFile_dh ) +#define openLogfile_dh HYPRE_FIXEDPRECISION_FUNC ( openLogfile_dh ) +#define partition_and_distribute_metis_private HYPRE_FIXEDPRECISION_FUNC ( partition_and_distribute_metis_private ) +#define partition_and_distribute_private HYPRE_FIXEDPRECISION_FUNC ( partition_and_distribute_private ) +#define printErrorMsg HYPRE_FIXEDPRECISION_FUNC ( printErrorMsg ) +#define printFunctionStack HYPRE_FIXEDPRECISION_FUNC ( printFunctionStack ) +#define printf_dh HYPRE_FIXEDPRECISION_FUNC ( printf_dh ) +#define profileMat HYPRE_FIXEDPRECISION_FUNC ( profileMat ) +#define readMat HYPRE_FIXEDPRECISION_FUNC ( readMat ) +#define readMat_par HYPRE_FIXEDPRECISION_FUNC ( readMat_par ) +#define readVec HYPRE_FIXEDPRECISION_FUNC ( readVec ) +#define rownum HYPRE_FIXEDPRECISION_FUNC ( rownum ) +#define setError_dh HYPRE_FIXEDPRECISION_FUNC ( setError_dh ) +#define setInfo_dh HYPRE_FIXEDPRECISION_FUNC ( setInfo_dh ) +#define shellSort_float HYPRE_FIXEDPRECISION_FUNC ( shellSort_float ) +#define shellSort_int HYPRE_FIXEDPRECISION_FUNC ( shellSort_int ) +#define sigHandler_dh HYPRE_FIXEDPRECISION_FUNC ( sigHandler_dh ) +#define sigRegister_dh HYPRE_FIXEDPRECISION_FUNC ( sigRegister_dh ) +#define symbolic_row_private HYPRE_FIXEDPRECISION_FUNC ( symbolic_row_private ) +#define writeMat HYPRE_FIXEDPRECISION_FUNC ( writeMat ) +#define writeVec HYPRE_FIXEDPRECISION_FUNC ( writeVec ) + +#endif diff --git a/src/distributed_ls/Euclid/globalObjects.c b/src/distributed_ls/Euclid/globalObjects.c index c92a5c5c6b..d7f7e4c5fe 100644 --- a/src/distributed_ls/Euclid/globalObjects.c +++ b/src/distributed_ls/Euclid/globalObjects.c @@ -17,6 +17,8 @@ /* #include "TimeLog_dh.h" */ extern void sigRegister_dh(void); /* use sig_dh.h if not for euclid_signals_len */ +/* guard definition of global variables to avoid linker errors for multiprecision build */ +#if defined (hypre_DEFINE_GLOBAL) /*------------------------------------------------------------------------- * Globally scoped variables, flags, and objects *-------------------------------------------------------------------------*/ @@ -47,6 +49,7 @@ bool logFuncsToFile = false; bool ignoreMe = true; HYPRE_Int ref_counter = 0; +#endif /*------------------------------------------------------------------------- * End of global definitions. diff --git a/src/distributed_ls/Euclid/headers b/src/distributed_ls/Euclid/headers index 38b3959606..673e8bfe2a 100755 --- a/src/distributed_ls/Euclid/headers +++ b/src/distributed_ls/Euclid/headers @@ -28,6 +28,10 @@ cat > $INTERNAL_HEADER <<@ #include "HYPRE_distributed_matrix_mv.h" #include "_hypre_utilities.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_Euclid_mup_def.h" +#endif + #elif defined(PETSC_MODE) #include "petsc_config.h" #endif diff --git a/src/distributed_ls/Euclid/mup.fixed b/src/distributed_ls/Euclid/mup.fixed new file mode 100644 index 0000000000..731798d5e9 --- /dev/null +++ b/src/distributed_ls/Euclid/mup.fixed @@ -0,0 +1,226 @@ +Axpy +CopyVec +Error_dhEndFunc +Error_dhStartFunc +EuclidFinalize +EuclidGetDimensions +EuclidGetRow +EuclidInitialize +EuclidIsInitialized +EuclidRestoreRow +Euclid_dhApply +Euclid_dhCreate +Euclid_dhDestroy +Euclid_dhInputHypreMat +Euclid_dhPrintHypreReport +Euclid_dhPrintScaling +Euclid_dhPrintStats +Euclid_dhPrintStatsShort +Euclid_dhPrintStatsShorter +Euclid_dhPrintTestData +Euclid_dhSetup +Euclid_dhSolve +ExternalRows_dhCreate +ExternalRows_dhDestroy +ExternalRows_dhGetRow +ExternalRows_dhInit +ExternalRows_dhRecvRows +ExternalRows_dhSendRows +Factor_dhCondEst +Factor_dhCreate +Factor_dhDestroy +Factor_dhInit +Factor_dhMaxPivotInverse +Factor_dhMaxValue +Factor_dhPrintDiags +Factor_dhPrintGraph +Factor_dhPrintRows +Factor_dhPrintTriples +Factor_dhReadNz +Factor_dhReallocate +Factor_dhSolve +Factor_dhSolveSeq +Factor_dhSolveSetup +Factor_dhTranspose +Factor_dh_junk +Hash_dhCreate +Hash_dhDestroy +Hash_dhInsert +Hash_dhLookup +Hash_dhPrint +Hash_dhReset +Hash_i_dhCreate +Hash_i_dhDestroy +Hash_i_dhInsert +Hash_i_dhLookup +Hash_i_dhReset +InnerProd +MatGenFD_Create +MatGenFD_Destroy +MatGenFD_Run +Mat_dhCreate +Mat_dhDestroy +Mat_dhFixDiags +Mat_dhGetRow +Mat_dhMakeStructurallySymmetric +Mat_dhMatVec +Mat_dhMatVecSetdown +Mat_dhMatVecSetup +Mat_dhMatVec_omp +Mat_dhMatVec_uni +Mat_dhMatVec_uni_omp +Mat_dhPartition +Mat_dhPermute +Mat_dhPrintBIN +Mat_dhPrintCSR +Mat_dhPrintDiags +Mat_dhPrintGraph +Mat_dhPrintRows +Mat_dhPrintTriples +Mat_dhReadBIN +Mat_dhReadCSR +Mat_dhReadNz +Mat_dhReadTriples +Mat_dhReduceTiming +Mat_dhRestoreRow +Mat_dhRowPermute +Mat_dhTranspose +Mat_dhZeroTiming +Mem_dhCreate +Mem_dhDestroy +Mem_dhFree +Mem_dhMalloc +Mem_dhPrint +Norm2 +Numbering_dhCreate +Numbering_dhDestroy +Numbering_dhGlobalToLocal +Numbering_dhSetup +Parser_dhCreate +Parser_dhDestroy +Parser_dhHasSwitch +Parser_dhInit +Parser_dhInsert +Parser_dhPrint +Parser_dhReadDouble +Parser_dhReadInt +Parser_dhReadString +Parser_dhUpdateFromFile +PrintMatUsingGetRow +ScaleVec +SortedList_dhCreate +SortedList_dhDestroy +SortedList_dhEnforceConstraint +SortedList_dhFind +SortedList_dhGetSmallest +SortedList_dhGetSmallestLowerTri +SortedList_dhInit +SortedList_dhInsert +SortedList_dhInsertOrUpdate +SortedList_dhPermuteAndInsert +SortedList_dhReadCount +SortedList_dhReset +SortedList_dhResetGetSmallest +SortedSet_dhCreate +SortedSet_dhDestroy +SortedSet_dhGetList +SortedSet_dhInsert +SubdomainGraph_dhCreate +SubdomainGraph_dhDestroy +SubdomainGraph_dhDump +SubdomainGraph_dhExchangePerms +SubdomainGraph_dhFindOwner +SubdomainGraph_dhInit +SubdomainGraph_dhPrintRatios +SubdomainGraph_dhPrintStats +SubdomainGraph_dhPrintStatsLong +SubdomainGraph_dhPrintSubdomainGraph +TimeLog_dhCreate +TimeLog_dhDestroy +TimeLog_dhMark +TimeLog_dhPrint +TimeLog_dhReset +TimeLog_dhStart +TimeLog_dhStop +Timer_dhCreate +Timer_dhDestroy +Timer_dhReadCPU +Timer_dhReadUsage +Timer_dhReadWall +Timer_dhStart +Timer_dhStop +Vec_dhCopy +Vec_dhCreate +Vec_dhDestroy +Vec_dhDuplicate +Vec_dhInit +Vec_dhPrint +Vec_dhPrintBIN +Vec_dhRead +Vec_dhReadBIN +Vec_dhSet +Vec_dhSetRand +bicgstab_euclid +boxThreeD +box_1 +box_2 +build_adj_lists_private +cg_euclid +closeFile_dh +closeLogfile_dh +compute_scaling_private +create_nat_ordering_private +delete_private +destroy_nat_ordering_private +dh_EndFunc +dh_StartFunc +e2_xy +echoInvocation_dh +fix_diags_private +fprintf_dh +iluk_mpi_bj +iluk_mpi_pilu +iluk_seq +iluk_seq_block +ilut_row_private +ilut_seq +insert_diags_private +insert_missing_diags_private +invert_perm +io_dh_print_ebin_mat_private +io_dh_print_ebin_vec_private +io_dh_read_ebin_mat_private +io_dh_read_ebin_vec_private +konstant +make_full_private +make_symmetric_private +mat_dh_print_csr_private +mat_dh_print_graph_private +mat_dh_read_csr_private +mat_dh_read_triples_private +mat_dh_transpose_private +mat_dh_transpose_reuse_private +mat_find_owner +mat_partition_private +matvec_euclid_seq +openFile_dh +openLogfile_dh +partition_and_distribute_metis_private +partition_and_distribute_private +printErrorMsg +printFunctionStack +printf_dh +profileMat +readMat +readMat_par +readVec +rownum +setError_dh +setInfo_dh +shellSort_float +shellSort_int +sigHandler_dh +sigRegister_dh +symbolic_row_private +writeMat +writeVec diff --git a/src/distributed_ls/Euclid/mup.functions b/src/distributed_ls/Euclid/mup.functions new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/distributed_ls/Euclid/mup.methods b/src/distributed_ls/Euclid/mup.methods new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/distributed_ls/Euclid/mup_code b/src/distributed_ls/Euclid/mup_code new file mode 100755 index 0000000000..a4e5cc7e73 --- /dev/null +++ b/src/distributed_ls/Euclid/mup_code @@ -0,0 +1,11 @@ +#!/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) + +touch mup_fake_ext.h + +../../config/gen_code.sh mup_fake_ext.h _hypre_Euclid.h onlydef + +rm -f mup_fake_ext.h diff --git a/src/distributed_ls/Euclid/sig_dh.c b/src/distributed_ls/Euclid/sig_dh.c index 1841061efa..eafd584251 100644 --- a/src/distributed_ls/Euclid/sig_dh.c +++ b/src/distributed_ls/Euclid/sig_dh.c @@ -24,11 +24,11 @@ extern void sigHandler_dh(hypre_int sig); list of signals the Euclid will handle */ #ifdef WIN32 -hypre_int euclid_signals_len = 2; -hypre_int euclid_signals[] = { SIGSEGV, SIGFPE }; +static hypre_int euclid_signals_len = 2; +static hypre_int euclid_signals[] = { SIGSEGV, SIGFPE }; #else -hypre_int euclid_signals_len = 3; -hypre_int euclid_signals[] = { SIGSEGV, SIGFPE, SIGBUS }; +static hypre_int euclid_signals_len = 3; +static hypre_int euclid_signals[] = { SIGSEGV, SIGFPE, SIGBUS }; #endif /* diff --git a/src/distributed_ls/Euclid/sig_dh.h b/src/distributed_ls/Euclid/sig_dh.h index ba10f69cd8..3b6c5cd282 100644 --- a/src/distributed_ls/Euclid/sig_dh.h +++ b/src/distributed_ls/Euclid/sig_dh.h @@ -17,6 +17,7 @@ extern void sigHandler_dh(hypre_int sig); /* list of signals the Euclid will handle */ +/* #ifdef WIN32 hypre_int euclid_signals_len = 2; hypre_int euclid_signals[] = { SIGSEGV, SIGFPE }; @@ -24,7 +25,7 @@ hypre_int euclid_signals[] = { SIGSEGV, SIGFPE }; hypre_int euclid_signals_len = 3; hypre_int euclid_signals[] = { SIGSEGV, SIGFPE, SIGBUS }; #endif - +*/ /* signal names and explanatory messages */ diff --git a/src/distributed_ls/ParaSails/CMakeLists.txt b/src/distributed_ls/ParaSails/CMakeLists.txt index 585adefb38..71d363db40 100644 --- a/src/distributed_ls/ParaSails/CMakeLists.txt +++ b/src/distributed_ls/ParaSails/CMakeLists.txt @@ -3,7 +3,25 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -set(SRCS +set(HDRS + _hypre_ParaSails.h + Common.h + ConjGrad.h + DiagScale.h + Hash.h + LoadBal.h + Matrix.h + Mem.h + Numbering.h + OrderStat.h + ParaSails.h + PrunedRows.h + RowPatt.h + StoredRows.h +) + +# Sources that need multi-precision compilation (FILES from Makefile) +set(MUP_SRCS ConjGrad.c DiagScale.c FGmres.c @@ -20,6 +38,9 @@ set(SRCS StoredRows.c ) -target_sources(${PROJECT_NAME} - PRIVATE ${SRCS} -) +if(HYPRE_ENABLE_MIXED_PRECISION) + setup_mixed_precision_compilation("ParaSails" SRCS "${MUP_SRCS}") + target_sources(${PROJECT_NAME} PRIVATE ${HDRS}) +else() + target_sources(${PROJECT_NAME} PRIVATE ${MUP_SRCS} ${HDRS}) +endif() diff --git a/src/distributed_ls/ParaSails/Common.h b/src/distributed_ls/ParaSails/Common.h index 6958ddc61d..5b66445529 100644 --- a/src/distributed_ls/ParaSails/Common.h +++ b/src/distributed_ls/ParaSails/Common.h @@ -17,7 +17,7 @@ #if 1 /* HYPRE */ #include "HYPRE_config.h" #include "_hypre_utilities.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef HYPRE_USING_ESSL #define ESSL #endif diff --git a/src/distributed_ls/ParaSails/ConjGrad.h b/src/distributed_ls/ParaSails/ConjGrad.h index 990f84c97d..f2978997fa 100644 --- a/src/distributed_ls/ParaSails/ConjGrad.h +++ b/src/distributed_ls/ParaSails/ConjGrad.h @@ -14,6 +14,10 @@ #ifndef _CONJGRAD_H #define _CONJGRAD_H +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_ParaSails_mup_def.h" +#endif + void PCG_ParaSails(Matrix *mat, ParaSails *ps, HYPRE_Real *b, HYPRE_Real *x, HYPRE_Real tol, HYPRE_Int max_iter); void FGMRES_ParaSails(Matrix *mat, ParaSails *ps, HYPRE_Real *b, HYPRE_Real *x, diff --git a/src/distributed_ls/ParaSails/DiagScale.h b/src/distributed_ls/ParaSails/DiagScale.h index da7d7a1b4d..a671c60310 100644 --- a/src/distributed_ls/ParaSails/DiagScale.h +++ b/src/distributed_ls/ParaSails/DiagScale.h @@ -16,6 +16,10 @@ #include "Matrix.h" #include "Numbering.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_ParaSails_mup_def.h" +#endif + #ifndef _DIAGSCALE_H #define _DIAGSCALE_H diff --git a/src/distributed_ls/ParaSails/Hash.h b/src/distributed_ls/ParaSails/Hash.h index 116f494d55..4c80ad5523 100644 --- a/src/distributed_ls/ParaSails/Hash.h +++ b/src/distributed_ls/ParaSails/Hash.h @@ -12,6 +12,9 @@ *****************************************************************************/ #include +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_ParaSails_mup_def.h" +#endif #ifndef _HASH_H #define _HASH_H diff --git a/src/distributed_ls/ParaSails/LoadBal.h b/src/distributed_ls/ParaSails/LoadBal.h index 066ba0be80..259abf7c5d 100644 --- a/src/distributed_ls/ParaSails/LoadBal.h +++ b/src/distributed_ls/ParaSails/LoadBal.h @@ -11,6 +11,10 @@ * *****************************************************************************/ +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_ParaSails_mup_def.h" +#endif + #ifndef _LOADBAL_H #define _LOADBAL_H diff --git a/src/distributed_ls/ParaSails/Makefile b/src/distributed_ls/ParaSails/Makefile index e56452cde1..7dd2c6f417 100644 --- a/src/distributed_ls/ParaSails/Makefile +++ b/src/distributed_ls/ParaSails/Makefile @@ -18,11 +18,11 @@ C_COMPILE_FLAGS = \ ${CINCLUDES} HEADERS =\ + _hypre_ParaSails.h\ Common.h\ ConjGrad.h\ DiagScale.h\ Hash.h\ - hypre_ParaSails.h\ LoadBal.h\ Matrix.h\ Mem.h\ @@ -51,6 +51,16 @@ FILES =\ OBJS = ${FILES:.c=.o} +ifeq (${MP_BUILD}, 1) + +COBJS_single = ${FILES:.c=.o_flt} +COBJS_double = ${FILES:.c=.o_dbl} +COBJS_longdouble = ${FILES:.c=.o_ldbl} + +OBJS = ${COBJS_single} ${COBJS_double} ${COBJS_longdouble} + +endif + SONAME = libHYPRE_ParaSails-${HYPRE_RELEASE_VERSION}${HYPRE_LIB_SUFFIX} ################################################################## @@ -65,6 +75,7 @@ install: libHYPRE_ParaSails${HYPRE_LIB_SUFFIX} clean: rm -f *.o libHYPRE* + rm -f *.o_flt *.o_dbl *.o_ldbl rm -rf pchdir tca.map *inslog* distclean: clean diff --git a/src/distributed_ls/ParaSails/Matrix.h b/src/distributed_ls/ParaSails/Matrix.h index c754be09be..0851824d63 100644 --- a/src/distributed_ls/ParaSails/Matrix.h +++ b/src/distributed_ls/ParaSails/Matrix.h @@ -15,6 +15,10 @@ #include "Common.h" #include "Mem.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_ParaSails_mup_def.h" +#endif + #ifndef _MATRIX_H #define _MATRIX_H diff --git a/src/distributed_ls/ParaSails/Mem.h b/src/distributed_ls/ParaSails/Mem.h index 2092ae1556..7306315917 100644 --- a/src/distributed_ls/ParaSails/Mem.h +++ b/src/distributed_ls/ParaSails/Mem.h @@ -13,6 +13,10 @@ #include +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_ParaSails_mup_def.h" +#endif + #ifndef _MEM_H #define _MEM_H diff --git a/src/distributed_ls/ParaSails/Numbering.h b/src/distributed_ls/ParaSails/Numbering.h index 1ed2317edc..956e23faee 100644 --- a/src/distributed_ls/ParaSails/Numbering.h +++ b/src/distributed_ls/ParaSails/Numbering.h @@ -16,6 +16,10 @@ #include "Matrix.h" #include "Hash.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_ParaSails_mup_def.h" +#endif + #ifndef _NUMBERING_H #define _NUMBERING_H diff --git a/src/distributed_ls/ParaSails/OrderStat.h b/src/distributed_ls/ParaSails/OrderStat.h index b1703b5c1f..ddd3fc2f7c 100644 --- a/src/distributed_ls/ParaSails/OrderStat.h +++ b/src/distributed_ls/ParaSails/OrderStat.h @@ -16,6 +16,10 @@ #include "_hypre_utilities.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_ParaSails_mup_def.h" +#endif + HYPRE_Real randomized_select(HYPRE_Real *a, HYPRE_Int p, HYPRE_Int r, HYPRE_Int i); void hypre_shell_sort(const HYPRE_Int n, HYPRE_Int x[]); diff --git a/src/distributed_ls/ParaSails/ParaSails.h b/src/distributed_ls/ParaSails/ParaSails.h index 79911eca89..0eef9968be 100644 --- a/src/distributed_ls/ParaSails/ParaSails.h +++ b/src/distributed_ls/ParaSails/ParaSails.h @@ -18,6 +18,10 @@ #include "RowPatt.h" #include "LoadBal.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_ParaSails_mup_def.h" +#endif + #ifndef _PARASAILS_H #define _PARASAILS_H diff --git a/src/distributed_ls/ParaSails/PrunedRows.h b/src/distributed_ls/ParaSails/PrunedRows.h index b6b8447e05..113411a6be 100644 --- a/src/distributed_ls/ParaSails/PrunedRows.h +++ b/src/distributed_ls/ParaSails/PrunedRows.h @@ -15,6 +15,10 @@ #include "Mem.h" #include "DiagScale.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_ParaSails_mup_def.h" +#endif + #ifndef _PRUNEDROWS_H #define _PRUNEDROWS_H diff --git a/src/distributed_ls/ParaSails/RowPatt.h b/src/distributed_ls/ParaSails/RowPatt.h index 6793c90dc4..08cec15915 100644 --- a/src/distributed_ls/ParaSails/RowPatt.h +++ b/src/distributed_ls/ParaSails/RowPatt.h @@ -13,6 +13,10 @@ #include +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_ParaSails_mup_def.h" +#endif + #ifndef _ROWPATT_H #define _ROWPATT_H diff --git a/src/distributed_ls/ParaSails/StoredRows.h b/src/distributed_ls/ParaSails/StoredRows.h index 2de6dcf902..5ca2d0cebf 100644 --- a/src/distributed_ls/ParaSails/StoredRows.h +++ b/src/distributed_ls/ParaSails/StoredRows.h @@ -15,6 +15,10 @@ #include "Mem.h" #include "Matrix.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_ParaSails_mup_def.h" +#endif + #ifndef _STOREDROWS_H #define _STOREDROWS_H diff --git a/src/distributed_ls/ParaSails/hypre_ParaSails.h b/src/distributed_ls/ParaSails/_hypre_ParaSails.h similarity index 87% rename from src/distributed_ls/ParaSails/hypre_ParaSails.h rename to src/distributed_ls/ParaSails/_hypre_ParaSails.h index 892acfedf5..d97a183c43 100644 --- a/src/distributed_ls/ParaSails/hypre_ParaSails.h +++ b/src/distributed_ls/ParaSails/_hypre_ParaSails.h @@ -11,9 +11,20 @@ * *****************************************************************************/ +#ifndef hypre_PARASAILS_HEADER +#define hypre_PARASAILS_HEADER + #include "HYPRE_distributed_matrix_protos.h" #include "../../IJ_mv/HYPRE_IJ_mv.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_ParaSails_mup_def.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + typedef void *hypre_ParaSails; HYPRE_Int hypre_ParaSailsCreate(MPI_Comm comm, hypre_ParaSails *obj); @@ -30,3 +41,10 @@ HYPRE_Int hypre_ParaSailsSetupValues(hypre_ParaSails obj, HYPRE_Int hypre_ParaSailsApply(hypre_ParaSails ps, HYPRE_Real *u, HYPRE_Real *v); HYPRE_Int hypre_ParaSailsApplyTrans(hypre_ParaSails ps, HYPRE_Real *u, HYPRE_Real *v); HYPRE_Int hypre_ParaSailsBuildIJMatrix(hypre_ParaSails obj, HYPRE_IJMatrix *pij_A); + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/src/distributed_ls/ParaSails/_hypre_ParaSails_mup_def.h b/src/distributed_ls/ParaSails/_hypre_ParaSails_mup_def.h new file mode 100644 index 0000000000..8baaf24b97 --- /dev/null +++ b/src/distributed_ls/ParaSails/_hypre_ParaSails_mup_def.h @@ -0,0 +1,99 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#ifndef hypre_PARASAILS_MUP_DEF_HEADER +#define hypre_PARASAILS_MUP_DEF_HEADER + +#include "_hypre_mup_def.h" + +#define DiagScaleCreate HYPRE_FIXEDPRECISION_FUNC ( DiagScaleCreate ) +#define DiagScaleDestroy HYPRE_FIXEDPRECISION_FUNC ( DiagScaleDestroy ) +#define DiagScaleGet HYPRE_FIXEDPRECISION_FUNC ( DiagScaleGet ) +#define FGMRES_ParaSails HYPRE_FIXEDPRECISION_FUNC ( FGMRES_ParaSails ) +#define FindNumReplies HYPRE_FIXEDPRECISION_FUNC ( FindNumReplies ) +#define HashCreate HYPRE_FIXEDPRECISION_FUNC ( HashCreate ) +#define HashDestroy HYPRE_FIXEDPRECISION_FUNC ( HashDestroy ) +#define HashInsert HYPRE_FIXEDPRECISION_FUNC ( HashInsert ) +#define HashLookup HYPRE_FIXEDPRECISION_FUNC ( HashLookup ) +#define HashPrint HYPRE_FIXEDPRECISION_FUNC ( HashPrint ) +#define HashRehash HYPRE_FIXEDPRECISION_FUNC ( HashRehash ) +#define HashReset HYPRE_FIXEDPRECISION_FUNC ( HashReset ) +#define LoadBalDonate HYPRE_FIXEDPRECISION_FUNC ( LoadBalDonate ) +#define LoadBalDonorRecv HYPRE_FIXEDPRECISION_FUNC ( LoadBalDonorRecv ) +#define LoadBalDonorSend HYPRE_FIXEDPRECISION_FUNC ( LoadBalDonorSend ) +#define LoadBalInit HYPRE_FIXEDPRECISION_FUNC ( LoadBalInit ) +#define LoadBalRecipRecv HYPRE_FIXEDPRECISION_FUNC ( LoadBalRecipRecv ) +#define LoadBalRecipSend HYPRE_FIXEDPRECISION_FUNC ( LoadBalRecipSend ) +#define LoadBalReturn HYPRE_FIXEDPRECISION_FUNC ( LoadBalReturn ) +#define MatrixComplete HYPRE_FIXEDPRECISION_FUNC ( MatrixComplete ) +#define MatrixCreate HYPRE_FIXEDPRECISION_FUNC ( MatrixCreate ) +#define MatrixCreateLocal HYPRE_FIXEDPRECISION_FUNC ( MatrixCreateLocal ) +#define MatrixDestroy HYPRE_FIXEDPRECISION_FUNC ( MatrixDestroy ) +#define MatrixGetRow HYPRE_FIXEDPRECISION_FUNC ( MatrixGetRow ) +#define MatrixMatvec HYPRE_FIXEDPRECISION_FUNC ( MatrixMatvec ) +#define MatrixMatvecSerial HYPRE_FIXEDPRECISION_FUNC ( MatrixMatvecSerial ) +#define MatrixMatvecTrans HYPRE_FIXEDPRECISION_FUNC ( MatrixMatvecTrans ) +#define MatrixNnz HYPRE_FIXEDPRECISION_FUNC ( MatrixNnz ) +#define MatrixPrint HYPRE_FIXEDPRECISION_FUNC ( MatrixPrint ) +#define MatrixRead HYPRE_FIXEDPRECISION_FUNC ( MatrixRead ) +#define MatrixRowPe HYPRE_FIXEDPRECISION_FUNC ( MatrixRowPe ) +#define MatrixSetRow HYPRE_FIXEDPRECISION_FUNC ( MatrixSetRow ) +#define MemAlloc HYPRE_FIXEDPRECISION_FUNC ( MemAlloc ) +#define MemCreate HYPRE_FIXEDPRECISION_FUNC ( MemCreate ) +#define MemDestroy HYPRE_FIXEDPRECISION_FUNC ( MemDestroy ) +#define MemStat HYPRE_FIXEDPRECISION_FUNC ( MemStat ) +#define NumberingCreate HYPRE_FIXEDPRECISION_FUNC ( NumberingCreate ) +#define NumberingCreateCopy HYPRE_FIXEDPRECISION_FUNC ( NumberingCreateCopy ) +#define NumberingDestroy HYPRE_FIXEDPRECISION_FUNC ( NumberingDestroy ) +#define NumberingGlobalToLocal HYPRE_FIXEDPRECISION_FUNC ( NumberingGlobalToLocal ) +#define NumberingLocalToGlobal HYPRE_FIXEDPRECISION_FUNC ( NumberingLocalToGlobal ) +#define PCG_ParaSails HYPRE_FIXEDPRECISION_FUNC ( PCG_ParaSails ) +#define ParaSailsApply HYPRE_FIXEDPRECISION_FUNC ( ParaSailsApply ) +#define ParaSailsApplyTrans HYPRE_FIXEDPRECISION_FUNC ( ParaSailsApplyTrans ) +#define ParaSailsCreate HYPRE_FIXEDPRECISION_FUNC ( ParaSailsCreate ) +#define ParaSailsDestroy HYPRE_FIXEDPRECISION_FUNC ( ParaSailsDestroy ) +#define ParaSailsSetupPattern HYPRE_FIXEDPRECISION_FUNC ( ParaSailsSetupPattern ) +#define ParaSailsSetupPatternExt HYPRE_FIXEDPRECISION_FUNC ( ParaSailsSetupPatternExt ) +#define ParaSailsSetupValues HYPRE_FIXEDPRECISION_FUNC ( ParaSailsSetupValues ) +#define ParaSailsStatsPattern HYPRE_FIXEDPRECISION_FUNC ( ParaSailsStatsPattern ) +#define ParaSailsStatsValues HYPRE_FIXEDPRECISION_FUNC ( ParaSailsStatsValues ) +#define PrunedRowsAlloc HYPRE_FIXEDPRECISION_FUNC ( PrunedRowsAlloc ) +#define PrunedRowsCreate HYPRE_FIXEDPRECISION_FUNC ( PrunedRowsCreate ) +#define PrunedRowsDestroy HYPRE_FIXEDPRECISION_FUNC ( PrunedRowsDestroy ) +#define PrunedRowsGet HYPRE_FIXEDPRECISION_FUNC ( PrunedRowsGet ) +#define PrunedRowsPut HYPRE_FIXEDPRECISION_FUNC ( PrunedRowsPut ) +#define RhsRead HYPRE_FIXEDPRECISION_FUNC ( RhsRead ) +#define RowPattCreate HYPRE_FIXEDPRECISION_FUNC ( RowPattCreate ) +#define RowPattDestroy HYPRE_FIXEDPRECISION_FUNC ( RowPattDestroy ) +#define RowPattGet HYPRE_FIXEDPRECISION_FUNC ( RowPattGet ) +#define RowPattMerge HYPRE_FIXEDPRECISION_FUNC ( RowPattMerge ) +#define RowPattMergeExt HYPRE_FIXEDPRECISION_FUNC ( RowPattMergeExt ) +#define RowPattPrevLevel HYPRE_FIXEDPRECISION_FUNC ( RowPattPrevLevel ) +#define RowPattReset HYPRE_FIXEDPRECISION_FUNC ( RowPattReset ) +#define StoredRowsAllocInd HYPRE_FIXEDPRECISION_FUNC ( StoredRowsAllocInd ) +#define StoredRowsAllocVal HYPRE_FIXEDPRECISION_FUNC ( StoredRowsAllocVal ) +#define StoredRowsCreate HYPRE_FIXEDPRECISION_FUNC ( StoredRowsCreate ) +#define StoredRowsDestroy HYPRE_FIXEDPRECISION_FUNC ( StoredRowsDestroy ) +#define StoredRowsGet HYPRE_FIXEDPRECISION_FUNC ( StoredRowsGet ) +#define StoredRowsPut HYPRE_FIXEDPRECISION_FUNC ( StoredRowsPut ) +#define hypre_ParaSailsApply HYPRE_FIXEDPRECISION_FUNC ( hypre_ParaSailsApply ) +#define hypre_ParaSailsApplyTrans HYPRE_FIXEDPRECISION_FUNC ( hypre_ParaSailsApplyTrans ) +#define hypre_ParaSailsBuildIJMatrix HYPRE_FIXEDPRECISION_FUNC ( hypre_ParaSailsBuildIJMatrix ) +#define hypre_ParaSailsCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_ParaSailsCreate ) +#define hypre_ParaSailsDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_ParaSailsDestroy ) +#define hypre_ParaSailsSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_ParaSailsSetup ) +#define hypre_ParaSailsSetupPattern HYPRE_FIXEDPRECISION_FUNC ( hypre_ParaSailsSetupPattern ) +#define hypre_ParaSailsSetupValues HYPRE_FIXEDPRECISION_FUNC ( hypre_ParaSailsSetupValues ) +#define hypre_shell_sort HYPRE_FIXEDPRECISION_FUNC ( hypre_shell_sort ) +#define randomized_select HYPRE_FIXEDPRECISION_FUNC ( randomized_select ) + +#endif diff --git a/src/distributed_ls/ParaSails/hypre_ParaSails.c b/src/distributed_ls/ParaSails/hypre_ParaSails.c index 6c72c67815..4df29fea08 100644 --- a/src/distributed_ls/ParaSails/hypre_ParaSails.c +++ b/src/distributed_ls/ParaSails/hypre_ParaSails.c @@ -14,7 +14,7 @@ #include "Common.h" #include "HYPRE_distributed_matrix_types.h" #include "HYPRE_distributed_matrix_protos.h" -#include "hypre_ParaSails.h" +#include "_hypre_ParaSails.h" #include "Matrix.h" #include "ParaSails.h" diff --git a/src/distributed_ls/ParaSails/mup.fixed b/src/distributed_ls/ParaSails/mup.fixed new file mode 100644 index 0000000000..b4e133e1a1 --- /dev/null +++ b/src/distributed_ls/ParaSails/mup.fixed @@ -0,0 +1,80 @@ +DiagScaleCreate +DiagScaleDestroy +DiagScaleGet +FGMRES_ParaSails +FindNumReplies +HashCreate +HashDestroy +HashInsert +HashLookup +HashPrint +HashRehash +HashReset +LoadBalDonate +LoadBalDonorRecv +LoadBalDonorSend +LoadBalInit +LoadBalRecipRecv +LoadBalRecipSend +LoadBalReturn +MatrixComplete +MatrixCreate +MatrixCreateLocal +MatrixDestroy +MatrixGetRow +MatrixMatvec +MatrixMatvecSerial +MatrixMatvecTrans +MatrixNnz +MatrixPrint +MatrixRead +MatrixRowPe +MatrixSetRow +MemAlloc +MemCreate +MemDestroy +MemStat +NumberingCreate +NumberingCreateCopy +NumberingDestroy +NumberingGlobalToLocal +NumberingLocalToGlobal +PCG_ParaSails +ParaSailsApply +ParaSailsApplyTrans +ParaSailsCreate +ParaSailsDestroy +ParaSailsSetupPattern +ParaSailsSetupPatternExt +ParaSailsSetupValues +ParaSailsStatsPattern +ParaSailsStatsValues +PrunedRowsAlloc +PrunedRowsCreate +PrunedRowsDestroy +PrunedRowsGet +PrunedRowsPut +RhsRead +RowPattCreate +RowPattDestroy +RowPattGet +RowPattMerge +RowPattMergeExt +RowPattPrevLevel +RowPattReset +StoredRowsAllocInd +StoredRowsAllocVal +StoredRowsCreate +StoredRowsDestroy +StoredRowsGet +StoredRowsPut +hypre_ParaSailsApply +hypre_ParaSailsApplyTrans +hypre_ParaSailsBuildIJMatrix +hypre_ParaSailsCreate +hypre_ParaSailsDestroy +hypre_ParaSailsSetup +hypre_ParaSailsSetupPattern +hypre_ParaSailsSetupValues +hypre_shell_sort +randomized_select diff --git a/src/distributed_ls/ParaSails/mup.functions b/src/distributed_ls/ParaSails/mup.functions new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/distributed_ls/ParaSails/mup.methods b/src/distributed_ls/ParaSails/mup.methods new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/distributed_ls/ParaSails/mup_code b/src/distributed_ls/ParaSails/mup_code new file mode 100755 index 0000000000..76125f283f --- /dev/null +++ b/src/distributed_ls/ParaSails/mup_code @@ -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) + +touch mup_fake_ext.h +cat *.h > mup_fake_int.h + +../../config/gen_code.sh mup_fake_ext.h mup_fake_int.h onlydef + +rm -f mup_fake_ext.h +rm -f mup_fake_int.h + +# Replace MUP_FAKE_INT +sed 's/MUP_FAKE_INT/PARASAILS/' mup_fake_int_mup_def.h > _hypre_ParaSails_mup_def.h +rm mup_fake_int_mup_def.h diff --git a/src/distributed_ls/pilut/CMakeLists.txt b/src/distributed_ls/pilut/CMakeLists.txt index af9bb4202e..8a391f28b2 100644 --- a/src/distributed_ls/pilut/CMakeLists.txt +++ b/src/distributed_ls/pilut/CMakeLists.txt @@ -3,12 +3,8 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -set(PILUT_HDRS - HYPRE_DistributedMatrixPilutSolver_protos.h - HYPRE_DistributedMatrixPilutSolver_types.h -) - -set(PILUT_SRCS +# Sources that need multi-precision compilation (FILES from Makefile) +set(MUP_SRCS comm.c debug.c distributed_qsort.c @@ -23,10 +19,13 @@ set(PILUT_SRCS util.c ) -target_sources(${PROJECT_NAME} - PRIVATE ${PILUT_SRCS} - ${PILUT_HDRS} +# Sources that don't need multi-precision compilation (none for pilut) +set(REGULAR_SRCS ) -convert_filenames_to_full_paths(PILUT_HDRS) -set(HDRS ${HDRS} ${PILUT_HDRS} PARENT_SCOPE) +if(HYPRE_ENABLE_MIXED_PRECISION) + setup_mixed_precision_compilation("pilut" SRCS "${MUP_SRCS}") + target_sources(${PROJECT_NAME} PRIVATE ${REGULAR_SRCS}) +else() + target_sources(${PROJECT_NAME} PRIVATE ${MUP_SRCS} ${REGULAR_SRCS}) +endif() diff --git a/src/distributed_ls/pilut/HYPRE_DistributedMatrixPilutSolver_protos.h b/src/distributed_ls/pilut/HYPRE_DistributedMatrixPilutSolver_protos.h index 29810a0af5..ae6bf04837 100644 --- a/src/distributed_ls/pilut/HYPRE_DistributedMatrixPilutSolver_protos.h +++ b/src/distributed_ls/pilut/HYPRE_DistributedMatrixPilutSolver_protos.h @@ -5,6 +5,10 @@ * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_pilut_mup_def.h" +#endif + /* HYPRE_DistributedMatrixPilutSolver.c */ HYPRE_Int HYPRE_NewDistributedMatrixPilutSolver (MPI_Comm comm , HYPRE_DistributedMatrix matrix, HYPRE_DistributedMatrixPilutSolver *solver ); HYPRE_Int HYPRE_FreeDistributedMatrixPilutSolver (HYPRE_DistributedMatrixPilutSolver in_ptr ); diff --git a/src/distributed_ls/pilut/Makefile b/src/distributed_ls/pilut/Makefile index dc13c30d73..1ecd7bf12a 100644 --- a/src/distributed_ls/pilut/Makefile +++ b/src/distributed_ls/pilut/Makefile @@ -42,6 +42,16 @@ FILES =\ OBJS = ${FILES:.c=.o} +ifeq (${MP_BUILD}, 1) + +COBJS_single = ${FILES:.c=.o_flt} +COBJS_double = ${FILES:.c=.o_dbl} +COBJS_longdouble = ${FILES:.c=.o_ldbl} + +OBJS = ${COBJS_single} ${COBJS_double} ${COBJS_longdouble} + +endif + SONAME = libHYPRE_DistributedMatrixPilutSolver-${HYPRE_RELEASE_VERSION}${HYPRE_LIB_SUFFIX} ################################################################## @@ -49,15 +59,14 @@ SONAME = libHYPRE_DistributedMatrixPilutSolver-${HYPRE_RELEASE_VERSION}${HYPRE_L ################################################################## all: libHYPRE_DistributedMatrixPilutSolver${HYPRE_LIB_SUFFIX} - cp -fR $(srcdir)/HYPRE_*.h $(HYPRE_BUILD_DIR)/include # cp -fR libHYPRE* $(HYPRE_BUILD_DIR)/lib install: libHYPRE_DistributedMatrixPilutSolver${HYPRE_LIB_SUFFIX} - cp -fR $(srcdir)/HYPRE_*.h $(HYPRE_INC_INSTALL) # cp -fR libHYPRE* $(HYPRE_LIB_INSTALL) clean: rm -f *.o libHYPRE* + rm -f *.o_flt *.o_dbl *.o_ldbl rm -rf pchdir tca.map *inslog* distclean: clean diff --git a/src/distributed_ls/pilut/_hypre_pilut_mup_def.h b/src/distributed_ls/pilut/_hypre_pilut_mup_def.h new file mode 100644 index 0000000000..78f4f6b1ce --- /dev/null +++ b/src/distributed_ls/pilut/_hypre_pilut_mup_def.h @@ -0,0 +1,91 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#ifndef hypre_PILUT_MUP_DEF_HEADER +#define hypre_PILUT_MUP_DEF_HEADER + +#include "_hypre_mup_def.h" + +#define HYPRE_DistributedMatrixPilutSolverGetMatrix HYPRE_FIXEDPRECISION_FUNC ( HYPRE_DistributedMatrixPilutSolverGetMatrix ) +#define HYPRE_DistributedMatrixPilutSolverInitialize HYPRE_FIXEDPRECISION_FUNC ( HYPRE_DistributedMatrixPilutSolverInitialize ) +#define HYPRE_DistributedMatrixPilutSolverSetDropTolerance HYPRE_FIXEDPRECISION_FUNC ( HYPRE_DistributedMatrixPilutSolverSetDropTolerance ) +#define HYPRE_DistributedMatrixPilutSolverSetFactorRowSize HYPRE_FIXEDPRECISION_FUNC ( HYPRE_DistributedMatrixPilutSolverSetFactorRowSize ) +#define HYPRE_DistributedMatrixPilutSolverSetLogging HYPRE_FIXEDPRECISION_FUNC ( HYPRE_DistributedMatrixPilutSolverSetLogging ) +#define HYPRE_DistributedMatrixPilutSolverSetMatrix HYPRE_FIXEDPRECISION_FUNC ( HYPRE_DistributedMatrixPilutSolverSetMatrix ) +#define HYPRE_DistributedMatrixPilutSolverSetMaxIts HYPRE_FIXEDPRECISION_FUNC ( HYPRE_DistributedMatrixPilutSolverSetMaxIts ) +#define HYPRE_DistributedMatrixPilutSolverSetNumLocalRow HYPRE_FIXEDPRECISION_FUNC ( HYPRE_DistributedMatrixPilutSolverSetNumLocalRow ) +#define HYPRE_DistributedMatrixPilutSolverSetup HYPRE_FIXEDPRECISION_FUNC ( HYPRE_DistributedMatrixPilutSolverSetup ) +#define HYPRE_DistributedMatrixPilutSolverSolve HYPRE_FIXEDPRECISION_FUNC ( HYPRE_DistributedMatrixPilutSolverSolve ) +#define HYPRE_FreeDistributedMatrixPilutSolver HYPRE_FIXEDPRECISION_FUNC ( HYPRE_FreeDistributedMatrixPilutSolver ) +#define HYPRE_NewDistributedMatrixPilutSolver HYPRE_FIXEDPRECISION_FUNC ( HYPRE_NewDistributedMatrixPilutSolver ) +#define hypre_CheckBounds HYPRE_FIXEDPRECISION_FUNC ( hypre_CheckBounds ) +#define hypre_ComputeAdd2Nrms HYPRE_FIXEDPRECISION_FUNC ( hypre_ComputeAdd2Nrms ) +#define hypre_ComputeCommInfo HYPRE_FIXEDPRECISION_FUNC ( hypre_ComputeCommInfo ) +#define hypre_ComputeRmat HYPRE_FIXEDPRECISION_FUNC ( hypre_ComputeRmat ) +#define hypre_EraseMap HYPRE_FIXEDPRECISION_FUNC ( hypre_EraseMap ) +#define hypre_ExchangeStructuralUnions HYPRE_FIXEDPRECISION_FUNC ( hypre_ExchangeStructuralUnions ) +#define hypre_ExtractMinLR HYPRE_FIXEDPRECISION_FUNC ( hypre_ExtractMinLR ) +#define hypre_FP_Checksum HYPRE_FIXEDPRECISION_FUNC ( hypre_FP_Checksum ) +#define hypre_FactorLocal HYPRE_FIXEDPRECISION_FUNC ( hypre_FactorLocal ) +#define hypre_FindStructuralUnion HYPRE_FIXEDPRECISION_FUNC ( hypre_FindStructuralUnion ) +#define hypre_FormDU HYPRE_FIXEDPRECISION_FUNC ( hypre_FormDU ) +#define hypre_FormNRmat HYPRE_FIXEDPRECISION_FUNC ( hypre_FormNRmat ) +#define hypre_GlobalSEMax HYPRE_FIXEDPRECISION_FUNC ( hypre_GlobalSEMax ) +#define hypre_GlobalSESum HYPRE_FIXEDPRECISION_FUNC ( hypre_GlobalSESum ) +#define hypre_GlobalSESumDouble HYPRE_FIXEDPRECISION_FUNC ( hypre_GlobalSESumDouble ) +#define hypre_IDX_Checksum HYPRE_FIXEDPRECISION_FUNC ( hypre_IDX_Checksum ) +#define hypre_ILUT HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUT ) +#define hypre_INT_Checksum HYPRE_FIXEDPRECISION_FUNC ( hypre_INT_Checksum ) +#define hypre_Idx2PE HYPRE_FIXEDPRECISION_FUNC ( hypre_Idx2PE ) +#define hypre_LDUSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_LDUSolve ) +#define hypre_LDU_Checksum HYPRE_FIXEDPRECISION_FUNC ( hypre_LDU_Checksum ) +#define hypre_ParILUT HYPRE_FIXEDPRECISION_FUNC ( hypre_ParILUT ) +#define hypre_ParINIT HYPRE_FIXEDPRECISION_FUNC ( hypre_ParINIT ) +#define hypre_PrintLine HYPRE_FIXEDPRECISION_FUNC ( hypre_PrintLine ) +#define hypre_PrintVector HYPRE_FIXEDPRECISION_FUNC ( hypre_PrintVector ) +#define hypre_RMat_Checksum HYPRE_FIXEDPRECISION_FUNC ( hypre_RMat_Checksum ) +#define hypre_SecondDrop HYPRE_FIXEDPRECISION_FUNC ( hypre_SecondDrop ) +#define hypre_SecondDropSmall HYPRE_FIXEDPRECISION_FUNC ( hypre_SecondDropSmall ) +#define hypre_SecondDropUpdate HYPRE_FIXEDPRECISION_FUNC ( hypre_SecondDropUpdate ) +#define hypre_SelectInterior HYPRE_FIXEDPRECISION_FUNC ( hypre_SelectInterior ) +#define hypre_SelectSet HYPRE_FIXEDPRECISION_FUNC ( hypre_SelectSet ) +#define hypre_SendFactoredRows HYPRE_FIXEDPRECISION_FUNC ( hypre_SendFactoredRows ) +#define hypre_SeperateLU_byDIAG HYPRE_FIXEDPRECISION_FUNC ( hypre_SeperateLU_byDIAG ) +#define hypre_SeperateLU_byMIS HYPRE_FIXEDPRECISION_FUNC ( hypre_SeperateLU_byMIS ) +#define hypre_SerILUT HYPRE_FIXEDPRECISION_FUNC ( hypre_SerILUT ) +#define hypre_SetUpFactor HYPRE_FIXEDPRECISION_FUNC ( hypre_SetUpFactor ) +#define hypre_SetUpLUFactor HYPRE_FIXEDPRECISION_FUNC ( hypre_SetUpLUFactor ) +#define hypre_UpdateL HYPRE_FIXEDPRECISION_FUNC ( hypre_UpdateL ) +#define hypre_errexit HYPRE_FIXEDPRECISION_FUNC ( hypre_errexit ) +#define hypre_fp_malloc HYPRE_FIXEDPRECISION_FUNC ( hypre_fp_malloc ) +#define hypre_fp_malloc_init HYPRE_FIXEDPRECISION_FUNC ( hypre_fp_malloc_init ) +#define hypre_idx_malloc HYPRE_FIXEDPRECISION_FUNC ( hypre_idx_malloc ) +#define hypre_idx_malloc_init HYPRE_FIXEDPRECISION_FUNC ( hypre_idx_malloc_init ) +#define hypre_memcpy_fp HYPRE_FIXEDPRECISION_FUNC ( hypre_memcpy_fp ) +#define hypre_memcpy_idx HYPRE_FIXEDPRECISION_FUNC ( hypre_memcpy_idx ) +#define hypre_memcpy_int HYPRE_FIXEDPRECISION_FUNC ( hypre_memcpy_int ) +#define hypre_my_abort HYPRE_FIXEDPRECISION_FUNC ( hypre_my_abort ) +#define hypre_mymalloc HYPRE_FIXEDPRECISION_FUNC ( hypre_mymalloc ) +#define hypre_p_daxbyz HYPRE_FIXEDPRECISION_FUNC ( hypre_p_daxbyz ) +#define hypre_p_daxpy HYPRE_FIXEDPRECISION_FUNC ( hypre_p_daxpy ) +#define hypre_p_daxy HYPRE_FIXEDPRECISION_FUNC ( hypre_p_daxy ) +#define hypre_p_ddot HYPRE_FIXEDPRECISION_FUNC ( hypre_p_ddot ) +#define hypre_p_dnrm2 HYPRE_FIXEDPRECISION_FUNC ( hypre_p_dnrm2 ) +#define hypre_p_vprintf HYPRE_FIXEDPRECISION_FUNC ( hypre_p_vprintf ) +#define hypre_sasum HYPRE_FIXEDPRECISION_FUNC ( hypre_sasum ) +#define hypre_sdecsort HYPRE_FIXEDPRECISION_FUNC ( hypre_sdecsort ) +#define hypre_sdecsort_fast HYPRE_FIXEDPRECISION_FUNC ( hypre_sdecsort_fast ) +#define hypre_sincsort HYPRE_FIXEDPRECISION_FUNC ( hypre_sincsort ) +#define hypre_sincsort_fast HYPRE_FIXEDPRECISION_FUNC ( hypre_sincsort_fast ) +#define hypre_tex_qsort HYPRE_FIXEDPRECISION_FUNC ( hypre_tex_qsort ) + +#endif diff --git a/src/distributed_ls/pilut/comm.c b/src/distributed_ls/pilut/comm.c index cca3302ccb..1e0208d881 100644 --- a/src/distributed_ls/pilut/comm.c +++ b/src/distributed_ls/pilut/comm.c @@ -39,18 +39,6 @@ HYPRE_Int hypre_GlobalSEMax(HYPRE_Int value, MPI_Comm hypre_MPI_Context ) return max; } - -/************************************************************************* -* This function computes the max of a single element -**************************************************************************/ -HYPRE_Int hypre_GlobalSEMin(HYPRE_Int value, MPI_Comm hypre_MPI_Context) -{ - HYPRE_Int min; - hypre_MPI_Allreduce( &value, &min, 1, HYPRE_MPI_INT, hypre_MPI_MIN, hypre_MPI_Context ); - - return min; -} - /************************************************************************* * This function computes the max of a single element **************************************************************************/ @@ -63,28 +51,6 @@ HYPRE_Int hypre_GlobalSESum(HYPRE_Int value, MPI_Comm hypre_MPI_Context) return sum; } -/************************************************************************* -* This function computes the max of a single element -**************************************************************************/ -HYPRE_Real hypre_GlobalSEMaxDouble(HYPRE_Real value, MPI_Comm hypre_MPI_Context) -{ - HYPRE_Real max; - hypre_MPI_Allreduce( &value, &max, 1, hypre_MPI_REAL, hypre_MPI_MAX, hypre_MPI_Context ); - - return max; -} - -/************************************************************************* -* This function computes the max of a single element -**************************************************************************/ -HYPRE_Real hypre_GlobalSEMinDouble(HYPRE_Real value, MPI_Comm hypre_MPI_Context) -{ - HYPRE_Real min; - hypre_MPI_Allreduce( &value, &min, 1, hypre_MPI_REAL, hypre_MPI_MIN, hypre_MPI_Context ); - - return min; -} - /************************************************************************* * This function computes the max of a single element **************************************************************************/ diff --git a/src/distributed_ls/pilut/distributed_qsort.c b/src/distributed_ls/pilut/distributed_qsort.c index 26da4c8457..5c41d4cc54 100644 --- a/src/distributed_ls/pilut/distributed_qsort.c +++ b/src/distributed_ls/pilut/distributed_qsort.c @@ -21,7 +21,7 @@ */ #include /* only for type declarations */ -#include "_hypre_utilities.h" +#include "DistributedMatrixPilutSolver.h" #define THRESH 4 /* threshold for insertion */ #define MTHRESH 6 /* threshold for median */ diff --git a/src/distributed_ls/pilut/ilu.h b/src/distributed_ls/pilut/ilu.h index d925afcb9f..b2e8654c54 100644 --- a/src/distributed_ls/pilut/ilu.h +++ b/src/distributed_ls/pilut/ilu.h @@ -33,6 +33,9 @@ #include "struct.h" #include "const.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_pilut_mup_def.h" +#endif #endif diff --git a/src/distributed_ls/pilut/internal_protos.h b/src/distributed_ls/pilut/internal_protos.h index 83f113054f..3f8aac7e0c 100644 --- a/src/distributed_ls/pilut/internal_protos.h +++ b/src/distributed_ls/pilut/internal_protos.h @@ -5,6 +5,10 @@ * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_pilut_mup_def.h" +#endif + /* HYPRE_DistributedMatrixPilutSolver.c */ HYPRE_Int HYPRE_NewDistributedMatrixPilutSolver( MPI_Comm comm , HYPRE_DistributedMatrix matrix , HYPRE_DistributedMatrixPilutSolver *new_solver ); HYPRE_Int HYPRE_FreeDistributedMatrixPilutSolver( HYPRE_DistributedMatrixPilutSolver in_ptr ); @@ -20,10 +24,7 @@ HYPRE_Int HYPRE_DistributedMatrixPilutSolverSolve( HYPRE_DistributedMatrixPilutS /* comm.c */ HYPRE_Int hypre_GlobalSEMax( HYPRE_Int value , MPI_Comm hypre_MPI_Context ); -HYPRE_Int hypre_GlobalSEMin( HYPRE_Int value , MPI_Comm hypre_MPI_Context ); HYPRE_Int hypre_GlobalSESum( HYPRE_Int value , MPI_Comm hypre_MPI_Context ); -HYPRE_Real hypre_GlobalSEMaxDouble( HYPRE_Real value , MPI_Comm hypre_MPI_Context ); -HYPRE_Real hypre_GlobalSEMinDouble( HYPRE_Real value , MPI_Comm hypre_MPI_Context ); HYPRE_Real hypre_GlobalSESumDouble( HYPRE_Real value , MPI_Comm hypre_MPI_Context ); /* debug.c */ @@ -101,13 +102,6 @@ void hypre_SetUpFactor( DataDistType *ddist , FactorMatType *ldu , HYPRE_Int max /* util.c */ HYPRE_Int hypre_ExtractMinLR( hypre_PilutSolverGlobals *globals ); -void hypre_IdxIncSort( HYPRE_Int n , HYPRE_Int *idx , HYPRE_Real *val ); -void hypre_ValDecSort( HYPRE_Int n , HYPRE_Int *idx , HYPRE_Real *val ); -HYPRE_Int hypre_CompactIdx( HYPRE_Int n , HYPRE_Int *idx , HYPRE_Real *val ); -void hypre_PrintIdxVal( HYPRE_Int n , HYPRE_Int *idx , HYPRE_Real *val ); -HYPRE_Int hypre_DecKeyValueCmp( const void *v1 , const void *v2 ); -void hypre_SortKeyValueNodesDec( KeyValueType *nodes , HYPRE_Int n ); HYPRE_Int hypre_sasum( HYPRE_Int n , HYPRE_Int *x ); void hypre_sincsort( HYPRE_Int n , HYPRE_Int *a ); void hypre_sdecsort( HYPRE_Int n , HYPRE_Int *a ); - diff --git a/src/distributed_ls/pilut/mup.fixed b/src/distributed_ls/pilut/mup.fixed new file mode 100644 index 0000000000..6cbac5bfd1 --- /dev/null +++ b/src/distributed_ls/pilut/mup.fixed @@ -0,0 +1,72 @@ +HYPRE_DistributedMatrixPilutSolverGetMatrix +HYPRE_DistributedMatrixPilutSolverInitialize +HYPRE_DistributedMatrixPilutSolverSetDropTolerance +HYPRE_DistributedMatrixPilutSolverSetFactorRowSize +HYPRE_DistributedMatrixPilutSolverSetLogging +HYPRE_DistributedMatrixPilutSolverSetMatrix +HYPRE_DistributedMatrixPilutSolverSetMaxIts +HYPRE_DistributedMatrixPilutSolverSetNumLocalRow +HYPRE_DistributedMatrixPilutSolverSetup +HYPRE_DistributedMatrixPilutSolverSolve +HYPRE_FreeDistributedMatrixPilutSolver +HYPRE_NewDistributedMatrixPilutSolver +hypre_CheckBounds +hypre_ComputeAdd2Nrms +hypre_ComputeCommInfo +hypre_ComputeRmat +hypre_EraseMap +hypre_ExchangeStructuralUnions +hypre_ExtractMinLR +hypre_FP_Checksum +hypre_FactorLocal +hypre_FindStructuralUnion +hypre_FormDU +hypre_FormNRmat +hypre_GlobalSEMax +hypre_GlobalSESum +hypre_GlobalSESumDouble +hypre_IDX_Checksum +hypre_ILUT +hypre_INT_Checksum +hypre_Idx2PE +hypre_LDUSolve +hypre_LDU_Checksum +hypre_ParILUT +hypre_ParINIT +hypre_PrintLine +hypre_PrintVector +hypre_RMat_Checksum +hypre_SecondDrop +hypre_SecondDropSmall +hypre_SecondDropUpdate +hypre_SelectInterior +hypre_SelectSet +hypre_SendFactoredRows +hypre_SeperateLU_byDIAG +hypre_SeperateLU_byMIS +hypre_SerILUT +hypre_SetUpFactor +hypre_SetUpLUFactor +hypre_UpdateL +hypre_errexit +hypre_fp_malloc +hypre_fp_malloc_init +hypre_idx_malloc +hypre_idx_malloc_init +hypre_memcpy_fp +hypre_memcpy_idx +hypre_memcpy_int +hypre_my_abort +hypre_mymalloc +hypre_p_daxbyz +hypre_p_daxpy +hypre_p_daxy +hypre_p_ddot +hypre_p_dnrm2 +hypre_p_vprintf +hypre_sasum +hypre_sdecsort +hypre_sdecsort_fast +hypre_sincsort +hypre_sincsort_fast +hypre_tex_qsort diff --git a/src/distributed_ls/pilut/mup.functions b/src/distributed_ls/pilut/mup.functions new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/distributed_ls/pilut/mup.methods b/src/distributed_ls/pilut/mup.methods new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/distributed_ls/pilut/mup_code b/src/distributed_ls/pilut/mup_code new file mode 100755 index 0000000000..47c44c1401 --- /dev/null +++ b/src/distributed_ls/pilut/mup_code @@ -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) + +touch mup_fake_ext.h +cat internal_protos.h > mup_fake_int.h + +../../config/gen_code.sh mup_fake_ext.h mup_fake_int.h onlydef + +rm -f mup_fake_ext.h +rm -f mup_fake_int.h + +# Replace MUP_FAKE_INT +sed 's/MUP_FAKE_INT/PILUT/' mup_fake_int_mup_def.h > _hypre_pilut_mup_def.h +rm -f mup_fake_int_mup_def.h diff --git a/src/distributed_ls/pilut/util.c b/src/distributed_ls/pilut/util.c index 3fb15aad97..90e7ba3d5b 100644 --- a/src/distributed_ls/pilut/util.c +++ b/src/distributed_ls/pilut/util.c @@ -35,137 +35,13 @@ HYPRE_Int hypre_ExtractMinLR( hypre_PilutSolverGlobals *globals ) /* Remove it */ lastlr-- ; - if (j < lastlr) + if (j < lastlr) hypre_lr[j] = hypre_lr[lastlr]; return i; } -/************************************************************************* -* This function sort an (idx,val) array in increasing idx values -**************************************************************************/ -void hypre_IdxIncSort(HYPRE_Int n, HYPRE_Int *idx, HYPRE_Real *val) -{ - HYPRE_Int i, j, min; - HYPRE_Real tmpval; - HYPRE_Int tmpidx; - - for (i=0; i hypre_abs(val[max])) - max = j; - } - - if (max != i) { - SWAP(idx[i], idx[max], tmpidx); - SWAP(val[i], val[max], tmpval); - } - } -} - - - - - -/************************************************************************* -* This function takes an (idx, val) array and compacts it so that every -* entry with idx[] = -1, gets removed. It returns the new count -**************************************************************************/ -HYPRE_Int hypre_CompactIdx(HYPRE_Int n, HYPRE_Int *idx, HYPRE_Real *val) -{ - HYPRE_Int i, j; - - j = n-1; - for (i=0; i i && idx[j] == -1) - j--; - if (j > i) { - idx[i] = idx[j]; - val[i] = val[j]; - j--; - } - else { - n = i; - break; - } - } - if (i == j) { - n = i+1; - break; - } - } - - return n; -} - -/************************************************************************* -* This function prints an (idx, val) pair -**************************************************************************/ -void hypre_PrintIdxVal(HYPRE_Int n, HYPRE_Int *idx, HYPRE_Real *val) -{ - HYPRE_Int i; - - hypre_printf("%3d ", n); - for (i=0; ikey - n1->key; - -} - - -/************************************************************************* -* This function sorts an array of type KeyValueType in increasing order -**************************************************************************/ -void hypre_SortKeyValueNodesDec(KeyValueType *nodes, HYPRE_Int n) -{ - hypre_tex_qsort((char *)nodes, (size_t)n, (size_t)sizeof(KeyValueType), (HYPRE_Int (*) (char*,char*))hypre_DecKeyValueCmp); -} - - /************************************************************************* * This function sums the entries in an array **************************************************************************/ @@ -210,7 +86,3 @@ void hypre_sdecsort(HYPRE_Int n, HYPRE_Int *a) { hypre_tex_qsort((char *)a, (size_t)n, (size_t)sizeof(HYPRE_Int),(HYPRE_Int (*) (char*,char*)) decshort); } - - - - diff --git a/src/distributed_matrix/CMakeLists.txt b/src/distributed_matrix/CMakeLists.txt index e6bc7d11ea..851fa16c91 100644 --- a/src/distributed_matrix/CMakeLists.txt +++ b/src/distributed_matrix/CMakeLists.txt @@ -3,25 +3,30 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -set(HDRS - distributed_matrix.h - HYPRE_distributed_matrix_mv.h - HYPRE_distributed_matrix_protos.h - HYPRE_distributed_matrix_types.h -) +set(HDRS "") + +# Add MUP headers +if(HYPRE_ENABLE_MIXED_PRECISION) + list(APPEND HDRS + _hypre_distributed_matrix_mup_def.h + ) +endif() -set(SRCS +# Regular sources +set(REGULAR_SRCS distributed_matrix.c distributed_matrix_ISIS.c - distributed_matrix_parcsr.c distributed_matrix_PETSc.c + distributed_matrix_parcsr.c HYPRE_distributed_matrix.c ) -target_sources(${PROJECT_NAME} - PRIVATE ${SRCS} - ${HDRS} -) +if(HYPRE_ENABLE_MIXED_PRECISION) + setup_mixed_precision_compilation("distributed_matrix" SRCS "${REGULAR_SRCS}") + target_sources(${PROJECT_NAME} PRIVATE ${HDRS}) +else() + target_sources(${PROJECT_NAME} PRIVATE ${REGULAR_SRCS} ${HDRS}) +endif() convert_filenames_to_full_paths(HDRS) set(HYPRE_HEADERS ${HYPRE_HEADERS} ${HDRS} PARENT_SCOPE) diff --git a/src/distributed_matrix/HYPRE_distributed_matrix_mv.h b/src/distributed_matrix/HYPRE_distributed_matrix_mv.h index bca2f96857..df7573570e 100644 --- a/src/distributed_matrix/HYPRE_distributed_matrix_mv.h +++ b/src/distributed_matrix/HYPRE_distributed_matrix_mv.h @@ -17,6 +17,10 @@ typedef void *HYPRE_DistributedMatrix; +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_distributed_matrix_mup_def.h" +#endif + /* HYPRE_distributed_matrix.c */ HYPRE_Int HYPRE_DistributedMatrixCreate (MPI_Comm context, HYPRE_DistributedMatrix *matrix ); HYPRE_Int HYPRE_DistributedMatrixDestroy (HYPRE_DistributedMatrix matrix ); diff --git a/src/distributed_matrix/Makefile b/src/distributed_matrix/Makefile index 7a16d60f10..294f63750d 100644 --- a/src/distributed_matrix/Makefile +++ b/src/distributed_matrix/Makefile @@ -32,6 +32,16 @@ FILES =\ OBJS = ${FILES:.c=.o} +ifeq (${MP_BUILD}, 1) + +COBJS_single = ${FILES:.c=.o_flt} +COBJS_double = ${FILES:.c=.o_dbl} +COBJS_longdouble = ${FILES:.c=.o_ldbl} + +OBJS = ${COBJS_single} ${COBJS_double} ${COBJS_longdouble} + +endif + SONAME = libHYPRE_DistributedMatrix-${HYPRE_RELEASE_VERSION}${HYPRE_LIB_SUFFIX} ################################################################## @@ -39,15 +49,14 @@ SONAME = libHYPRE_DistributedMatrix-${HYPRE_RELEASE_VERSION}${HYPRE_LIB_SUFFIX} ################################################################## all: libHYPRE_DistributedMatrix${HYPRE_LIB_SUFFIX} - cp -fR $(srcdir)/distributed_matrix.h $(HYPRE_BUILD_DIR)/include # cp -fR libHYPRE* $(HYPRE_BUILD_DIR)/lib install: libHYPRE_DistributedMatrix${HYPRE_LIB_SUFFIX} - cp -fR $(srcdir)/distributed_matrix.h $(HYPRE_INC_INSTALL) # cp -fR libHYPRE* $(HYPRE_LIB_INSTALL) clean: rm -f *.o libHYPRE* + rm -f *.o_flt *.o_dbl *.o_ldbl rm -rf pchdir tca.map *inslog* distclean: clean diff --git a/src/distributed_matrix/_hypre_distributed_matrix_mup_def.h b/src/distributed_matrix/_hypre_distributed_matrix_mup_def.h new file mode 100644 index 0000000000..888e262ca8 --- /dev/null +++ b/src/distributed_matrix/_hypre_distributed_matrix_mup_def.h @@ -0,0 +1,73 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#ifndef hypre_DISTRIBUTED_MATRIX_MUP_DEF_HEADER +#define hypre_DISTRIBUTED_MATRIX_MUP_DEF_HEADER + +#include "_hypre_mup_def.h" + +#define HYPRE_DistributedMatrixAssemble HYPRE_FIXEDPRECISION_FUNC ( HYPRE_DistributedMatrixAssemble ) +#define HYPRE_DistributedMatrixCreate HYPRE_FIXEDPRECISION_FUNC ( HYPRE_DistributedMatrixCreate ) +#define HYPRE_DistributedMatrixDestroy HYPRE_FIXEDPRECISION_FUNC ( HYPRE_DistributedMatrixDestroy ) +#define HYPRE_DistributedMatrixGetAuxiliaryData HYPRE_FIXEDPRECISION_FUNC ( HYPRE_DistributedMatrixGetAuxiliaryData ) +#define HYPRE_DistributedMatrixGetContext HYPRE_FIXEDPRECISION_FUNC ( HYPRE_DistributedMatrixGetContext ) +#define HYPRE_DistributedMatrixGetDims HYPRE_FIXEDPRECISION_FUNC ( HYPRE_DistributedMatrixGetDims ) +#define HYPRE_DistributedMatrixGetLocalRange HYPRE_FIXEDPRECISION_FUNC ( HYPRE_DistributedMatrixGetLocalRange ) +#define HYPRE_DistributedMatrixGetLocalStorage HYPRE_FIXEDPRECISION_FUNC ( HYPRE_DistributedMatrixGetLocalStorage ) +#define HYPRE_DistributedMatrixGetLocalStorageType HYPRE_FIXEDPRECISION_FUNC ( HYPRE_DistributedMatrixGetLocalStorageType ) +#define HYPRE_DistributedMatrixGetRow HYPRE_FIXEDPRECISION_FUNC ( HYPRE_DistributedMatrixGetRow ) +#define HYPRE_DistributedMatrixGetTranslator HYPRE_FIXEDPRECISION_FUNC ( HYPRE_DistributedMatrixGetTranslator ) +#define HYPRE_DistributedMatrixInitialize HYPRE_FIXEDPRECISION_FUNC ( HYPRE_DistributedMatrixInitialize ) +#define HYPRE_DistributedMatrixLimitedDestroy HYPRE_FIXEDPRECISION_FUNC ( HYPRE_DistributedMatrixLimitedDestroy ) +#define HYPRE_DistributedMatrixPrint HYPRE_FIXEDPRECISION_FUNC ( HYPRE_DistributedMatrixPrint ) +#define HYPRE_DistributedMatrixRestoreRow HYPRE_FIXEDPRECISION_FUNC ( HYPRE_DistributedMatrixRestoreRow ) +#define HYPRE_DistributedMatrixSetAuxiliaryData HYPRE_FIXEDPRECISION_FUNC ( HYPRE_DistributedMatrixSetAuxiliaryData ) +#define HYPRE_DistributedMatrixSetDims HYPRE_FIXEDPRECISION_FUNC ( HYPRE_DistributedMatrixSetDims ) +#define HYPRE_DistributedMatrixSetLocalStorage HYPRE_FIXEDPRECISION_FUNC ( HYPRE_DistributedMatrixSetLocalStorage ) +#define HYPRE_DistributedMatrixSetLocalStorageType HYPRE_FIXEDPRECISION_FUNC ( HYPRE_DistributedMatrixSetLocalStorageType ) +#define HYPRE_DistributedMatrixSetTranslator HYPRE_FIXEDPRECISION_FUNC ( HYPRE_DistributedMatrixSetTranslator ) +#define hypre_DistributedMatrixAssemble HYPRE_FIXEDPRECISION_FUNC ( hypre_DistributedMatrixAssemble ) +#define hypre_DistributedMatrixCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_DistributedMatrixCreate ) +#define hypre_DistributedMatrixDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_DistributedMatrixDestroy ) +#define hypre_DistributedMatrixDestroyPETSc HYPRE_FIXEDPRECISION_FUNC ( hypre_DistributedMatrixDestroyPETSc ) +#define hypre_DistributedMatrixDestroyParCSR HYPRE_FIXEDPRECISION_FUNC ( hypre_DistributedMatrixDestroyParCSR ) +#define hypre_DistributedMatrixGetAuxiliaryData HYPRE_FIXEDPRECISION_FUNC ( hypre_DistributedMatrixGetAuxiliaryData ) +#define hypre_DistributedMatrixGetLocalRange HYPRE_FIXEDPRECISION_FUNC ( hypre_DistributedMatrixGetLocalRange ) +#define hypre_DistributedMatrixGetLocalRangePETSc HYPRE_FIXEDPRECISION_FUNC ( hypre_DistributedMatrixGetLocalRangePETSc ) +#define hypre_DistributedMatrixGetLocalRangeParCSR HYPRE_FIXEDPRECISION_FUNC ( hypre_DistributedMatrixGetLocalRangeParCSR ) +#define hypre_DistributedMatrixGetLocalStorage HYPRE_FIXEDPRECISION_FUNC ( hypre_DistributedMatrixGetLocalStorage ) +#define hypre_DistributedMatrixGetLocalStorageType HYPRE_FIXEDPRECISION_FUNC ( hypre_DistributedMatrixGetLocalStorageType ) +#define hypre_DistributedMatrixGetRow HYPRE_FIXEDPRECISION_FUNC ( hypre_DistributedMatrixGetRow ) +#define hypre_DistributedMatrixGetRowPETSc HYPRE_FIXEDPRECISION_FUNC ( hypre_DistributedMatrixGetRowPETSc ) +#define hypre_DistributedMatrixGetRowParCSR HYPRE_FIXEDPRECISION_FUNC ( hypre_DistributedMatrixGetRowParCSR ) +#define hypre_DistributedMatrixGetTranslator HYPRE_FIXEDPRECISION_FUNC ( hypre_DistributedMatrixGetTranslator ) +#define hypre_DistributedMatrixInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_DistributedMatrixInitialize ) +#define hypre_DistributedMatrixInitializeParCSR HYPRE_FIXEDPRECISION_FUNC ( hypre_DistributedMatrixInitializeParCSR ) +#define hypre_DistributedMatrixLimitedDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_DistributedMatrixLimitedDestroy ) +#define hypre_DistributedMatrixPrint HYPRE_FIXEDPRECISION_FUNC ( hypre_DistributedMatrixPrint ) +#define hypre_DistributedMatrixPrintPETSc HYPRE_FIXEDPRECISION_FUNC ( hypre_DistributedMatrixPrintPETSc ) +#define hypre_DistributedMatrixPrintParCSR HYPRE_FIXEDPRECISION_FUNC ( hypre_DistributedMatrixPrintParCSR ) +#define hypre_DistributedMatrixRestoreRow HYPRE_FIXEDPRECISION_FUNC ( hypre_DistributedMatrixRestoreRow ) +#define hypre_DistributedMatrixRestoreRowPETSc HYPRE_FIXEDPRECISION_FUNC ( hypre_DistributedMatrixRestoreRowPETSc ) +#define hypre_DistributedMatrixRestoreRowParCSR HYPRE_FIXEDPRECISION_FUNC ( hypre_DistributedMatrixRestoreRowParCSR ) +#define hypre_DistributedMatrixSetAuxiliaryData HYPRE_FIXEDPRECISION_FUNC ( hypre_DistributedMatrixSetAuxiliaryData ) +#define hypre_DistributedMatrixSetLocalStorage HYPRE_FIXEDPRECISION_FUNC ( hypre_DistributedMatrixSetLocalStorage ) +#define hypre_DistributedMatrixSetLocalStorageType HYPRE_FIXEDPRECISION_FUNC ( hypre_DistributedMatrixSetLocalStorageType ) +#define hypre_DistributedMatrixSetTranslator HYPRE_FIXEDPRECISION_FUNC ( hypre_DistributedMatrixSetTranslator ) +#define hypre_FreeDistributedMatrixISIS HYPRE_FIXEDPRECISION_FUNC ( hypre_FreeDistributedMatrixISIS ) +#define hypre_GetDistributedMatrixLocalRangeISIS HYPRE_FIXEDPRECISION_FUNC ( hypre_GetDistributedMatrixLocalRangeISIS ) +#define hypre_GetDistributedMatrixRowISIS HYPRE_FIXEDPRECISION_FUNC ( hypre_GetDistributedMatrixRowISIS ) +#define hypre_InitializeDistributedMatrixISIS HYPRE_FIXEDPRECISION_FUNC ( hypre_InitializeDistributedMatrixISIS ) +#define hypre_PrintDistributedMatrixISIS HYPRE_FIXEDPRECISION_FUNC ( hypre_PrintDistributedMatrixISIS ) +#define hypre_RestoreDistributedMatrixRowISIS HYPRE_FIXEDPRECISION_FUNC ( hypre_RestoreDistributedMatrixRowISIS ) + +#endif diff --git a/src/distributed_matrix/internal_protos.h b/src/distributed_matrix/internal_protos.h index 2ec5e20d99..09e2c6117f 100644 --- a/src/distributed_matrix/internal_protos.h +++ b/src/distributed_matrix/internal_protos.h @@ -5,6 +5,10 @@ * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_distributed_matrix_mup_def.h" +#endif + /* HYPRE_distributed_matrix.c */ HYPRE_Int HYPRE_DistributedMatrixCreate (MPI_Comm context, HYPRE_DistributedMatrix *matrix ); HYPRE_Int HYPRE_DistributedMatrixDestroy (HYPRE_DistributedMatrix matrix ); diff --git a/src/distributed_matrix/mup.fixed b/src/distributed_matrix/mup.fixed new file mode 100644 index 0000000000..b0323cb144 --- /dev/null +++ b/src/distributed_matrix/mup.fixed @@ -0,0 +1,54 @@ +HYPRE_DistributedMatrixAssemble +HYPRE_DistributedMatrixCreate +HYPRE_DistributedMatrixDestroy +HYPRE_DistributedMatrixGetAuxiliaryData +HYPRE_DistributedMatrixGetContext +HYPRE_DistributedMatrixGetDims +HYPRE_DistributedMatrixGetLocalRange +HYPRE_DistributedMatrixGetLocalStorage +HYPRE_DistributedMatrixGetLocalStorageType +HYPRE_DistributedMatrixGetRow +HYPRE_DistributedMatrixGetTranslator +HYPRE_DistributedMatrixInitialize +HYPRE_DistributedMatrixLimitedDestroy +HYPRE_DistributedMatrixPrint +HYPRE_DistributedMatrixRestoreRow +HYPRE_DistributedMatrixSetAuxiliaryData +HYPRE_DistributedMatrixSetDims +HYPRE_DistributedMatrixSetLocalStorage +HYPRE_DistributedMatrixSetLocalStorageType +HYPRE_DistributedMatrixSetTranslator +hypre_DistributedMatrixAssemble +hypre_DistributedMatrixCreate +hypre_DistributedMatrixDestroy +hypre_DistributedMatrixDestroyPETSc +hypre_DistributedMatrixDestroyParCSR +hypre_DistributedMatrixGetAuxiliaryData +hypre_DistributedMatrixGetLocalRange +hypre_DistributedMatrixGetLocalRangePETSc +hypre_DistributedMatrixGetLocalRangeParCSR +hypre_DistributedMatrixGetLocalStorage +hypre_DistributedMatrixGetLocalStorageType +hypre_DistributedMatrixGetRow +hypre_DistributedMatrixGetRowPETSc +hypre_DistributedMatrixGetRowParCSR +hypre_DistributedMatrixGetTranslator +hypre_DistributedMatrixInitialize +hypre_DistributedMatrixInitializeParCSR +hypre_DistributedMatrixLimitedDestroy +hypre_DistributedMatrixPrint +hypre_DistributedMatrixPrintPETSc +hypre_DistributedMatrixPrintParCSR +hypre_DistributedMatrixRestoreRow +hypre_DistributedMatrixRestoreRowPETSc +hypre_DistributedMatrixRestoreRowParCSR +hypre_DistributedMatrixSetAuxiliaryData +hypre_DistributedMatrixSetLocalStorage +hypre_DistributedMatrixSetLocalStorageType +hypre_DistributedMatrixSetTranslator +hypre_FreeDistributedMatrixISIS +hypre_GetDistributedMatrixLocalRangeISIS +hypre_GetDistributedMatrixRowISIS +hypre_InitializeDistributedMatrixISIS +hypre_PrintDistributedMatrixISIS +hypre_RestoreDistributedMatrixRowISIS diff --git a/src/distributed_matrix/mup.functions b/src/distributed_matrix/mup.functions new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/distributed_matrix/mup.methods b/src/distributed_matrix/mup.methods new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/distributed_matrix/mup_code b/src/distributed_matrix/mup_code new file mode 100755 index 0000000000..eeb5d360ec --- /dev/null +++ b/src/distributed_matrix/mup_code @@ -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) + +touch mup_fake_ext.h +cat internal_protos.h > mup_fake_int.h + +../config/gen_code.sh mup_fake_ext.h mup_fake_int.h onlydef + +rm -f mup_fake_ext.h +rm -f mup_fake_int.h + +# Replace MUP_FAKE_INT +sed 's/MUP_FAKE_INT/DISTRIBUTED_MATRIX/' mup_fake_int_mup_def.h > _hypre_distributed_matrix_mup_def.h +rm -f mup_fake_int_mup_def.h diff --git a/src/docs/Makefile b/src/docs/Makefile index c3cfa6e0b8..4c3ba259a4 100644 --- a/src/docs/Makefile +++ b/src/docs/Makefile @@ -43,10 +43,15 @@ distclean: clean # Rules ################################################################## +# Original target with PDF manual (the svg images are an issue) +# usr: ref +# @cd usr-manual; make html; make latexpdf +# @mv usr-manual/_build/html usr-manual-html +# @mv usr-manual/_build/latex/hypre.pdf usr-manual.pdf + usr: ref - @cd usr-manual; make html; make latexpdf + @cd usr-manual; make html @mv usr-manual/_build/html usr-manual-html - @mv usr-manual/_build/latex/hypre.pdf usr-manual.pdf ref: @cd ref-manual; make diff --git a/src/docs/ref-manual/conf.doxygen b/src/docs/ref-manual/conf.doxygen index bb9e811687..0718e0780f 100644 --- a/src/docs/ref-manual/conf.doxygen +++ b/src/docs/ref-manual/conf.doxygen @@ -48,7 +48,7 @@ PROJECT_NAME = hypre # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 2.33.0 +PROJECT_NUMBER = 3.0.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -902,11 +902,13 @@ INPUT = \ ../../struct_mv/HYPRE_struct_mv.h \ ../../sstruct_mv/HYPRE_sstruct_mv.h \ ../../IJ_mv/HYPRE_IJ_mv.h \ +../../parcsr_mv/HYPRE_parcsr_mv.h \ ../../struct_ls/HYPRE_struct_ls.h \ ../../sstruct_ls/HYPRE_sstruct_ls.h \ ../../parcsr_ls/HYPRE_parcsr_ls.h \ ../../krylov/HYPRE_krylov.h \ -../../krylov/HYPRE_lobpcg.h +../../krylov/HYPRE_lobpcg.h \ +../../utilities/HYPRE_utilities.h # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses diff --git a/src/docs/usr-manual/api-int-ij.rst b/src/docs/usr-manual/api-int-ij.rst index b2e32730be..52baa6237c 100644 --- a/src/docs/usr-manual/api-int-ij.rst +++ b/src/docs/usr-manual/api-int-ij.rst @@ -4,11 +4,11 @@ SPDX-License-Identifier: (Apache-2.0 OR MIT) -.. _sec-IJ-System-Interface: +.. _sec-IJ-Interface: IJ System Interface ============================================================================== -.. doxygengroup:: IJSystemInterface +.. doxygengroup:: IJInterface :project: hypre diff --git a/src/docs/usr-manual/api-int-parcsr.rst b/src/docs/usr-manual/api-int-parcsr.rst new file mode 100644 index 0000000000..09d7a90c74 --- /dev/null +++ b/src/docs/usr-manual/api-int-parcsr.rst @@ -0,0 +1,14 @@ +.. Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + HYPRE Project Developers. See the top-level COPYRIGHT file for details. + + SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +.. _sec-ParCSR-Interface: + +ParCSR Object Interface +============================================================================== + +.. doxygengroup:: ParCSRInterface + :project: hypre + diff --git a/src/docs/usr-manual/api-int-sstruct.rst b/src/docs/usr-manual/api-int-sstruct.rst index 35d1bd4dd6..7de5190d8e 100644 --- a/src/docs/usr-manual/api-int-sstruct.rst +++ b/src/docs/usr-manual/api-int-sstruct.rst @@ -4,11 +4,11 @@ SPDX-License-Identifier: (Apache-2.0 OR MIT) -.. _sec-SStruct-System-Interface: +.. _sec-SStruct-Interface: -SStruct System Interface +SStruct System and Object Interface ============================================================================== -.. doxygengroup:: SStructSystemInterface +.. doxygengroup:: SStructInterface :project: hypre diff --git a/src/docs/usr-manual/api-int-struct.rst b/src/docs/usr-manual/api-int-struct.rst index a877ec5af1..cd23306a07 100644 --- a/src/docs/usr-manual/api-int-struct.rst +++ b/src/docs/usr-manual/api-int-struct.rst @@ -4,11 +4,11 @@ SPDX-License-Identifier: (Apache-2.0 OR MIT) -.. _sec-Struct-System-Interface: +.. _sec-Struct-Interface: -Struct System Interface +Struct System and Object Interface ============================================================================== -.. doxygengroup:: StructSystemInterface +.. doxygengroup:: StructInterface :project: hypre diff --git a/src/docs/usr-manual/api-utilities.rst b/src/docs/usr-manual/api-utilities.rst new file mode 100644 index 0000000000..a4034d6c8d --- /dev/null +++ b/src/docs/usr-manual/api-utilities.rst @@ -0,0 +1,14 @@ +.. Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + HYPRE Project Developers. See the top-level COPYRIGHT file for details. + + SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +.. _sec-Utilities: + +Utilities +============================================================================== + +.. doxygengroup:: Utilities + :project: hypre + diff --git a/src/docs/usr-manual/ch-api.rst b/src/docs/usr-manual/ch-api.rst index eb98a0f946..4e59fe1e13 100644 --- a/src/docs/usr-manual/ch-api.rst +++ b/src/docs/usr-manual/ch-api.rst @@ -16,11 +16,13 @@ API api-int-struct api-int-sstruct api-int-ij + api-int-parcsr api-sol-struct api-sol-sstruct api-sol-parcsr api-sol-krylov api-sol-eigen + api-utilities .. Add blank lines to help with navigation pane formatting | diff --git a/src/docs/usr-manual/ch-fei.rst b/src/docs/usr-manual/ch-fei.rst deleted file mode 100644 index 1f683a4a0b..0000000000 --- a/src/docs/usr-manual/ch-fei.rst +++ /dev/null @@ -1,180 +0,0 @@ -.. Copyright (c) 1998 Lawrence Livermore National Security, LLC and other - HYPRE Project Developers. See the top-level COPYRIGHT file for details. - - SPDX-License-Identifier: (Apache-2.0 OR MIT) - - -.. _ch-FEI: - -****************************************************************************** -Finite Element Interface -****************************************************************************** - -.. 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. - -Introduction -============================================================================== - -Many application codes use unstructured finite element meshes. This section -describes an interface for finite element problems, called the FEI, which is -supported in hypre. - -.. figure:: figSquareHole.* - :align: center - - Example of an unstructured mesh. - -FEI refers to a specific interface for black-box finite element solvers, -originally developed in Sandia National Lab, see [ClEA1999]_. It differs from -the rest of the conceptual interfaces in hypre in two important aspects: it is -written in C++, and it does not separate the construction of the linear system -matrix from the solution process. A complete description of Sandia's FEI -implementation can be obtained by contacting Alan Williams at Sandia -(william@sandia.gov). A simplified version of the FEI has been implemented at -LLNL and is included in hypre. More details about this implementation can be -found in the header files of the ``FEI_mv/fei-base`` and ``FEI_mv/fei-hypre`` -directories. - - -A Brief Description of the Finite Element Interface -============================================================================== - -Typically, finite element codes contain data structures storing element -connectivities, element stiffness matrices, element loads, boundary conditions, -nodal coordinates, etc. One of the purposes of the FEI is to assemble the -global linear system in parallel based on such local element data. We -illustrate this in the rest of the section and refer to example 10 (in the -``examples`` directory) for more implementation details. - -In hypre, one creates an instance of the FEI as follows: - -.. code-block:: c++ - - LLNL_FEI_Impl *feiPtr = new LLNL_FEI_Impl(mpiComm); - -Here ``mpiComm`` is an MPI communicator (e.g. ``MPI\_COMM\_WORLD``). If -Sandia's FEI package is to be used, one needs to define a hypre solver object -first: - -.. code-block:: c++ - - LinearSystemCore *solver = HYPRE_base_create(mpiComm); - FEI_Implementation *feiPtr = FEI_Implementation(solver,mpiComm,rank); - -where ``rank`` is the number of the master processor (used only to identify -which processor will produce the screen outputs). The ``LinearSystemCore`` -class is the part of the FEI that interfaces with the linear solver library. It -will be discussed later in Sections :ref:`LSI_solvers` and :ref:`LSI_install`. - -Local finite element information is passed to the FEI using several methods of -the ``feiPtr`` object. The first entity to be submitted is the *field* -information. A *field* has an identifier called ``fieldID`` and a rank or -``fieldSize`` (number of degree of freedom). For example, a discretization of -the Navier Stokes equations in 3D can consist of velocity vector having -:math:`3` degrees of freedom in every node (vertex) of the mesh and a scalar -pressure variable, which is constant over each element. If these are the only -variables, and if we assign ``fieldID`` :math:`7` and :math:`8` to them, -respectively, then the finite element field information can be set up by - -.. code-block:: c++ - - nFields = 2; /* number of unknown fields */ - fieldID = new int[nFields]; /* field identifiers */ - fieldSize = new int[nFields]; /* vector dimension of each field */ - - /* velocity (a 3D vector) */ - fieldID[0] = 7; - fieldSize[0] = 3; - - /* pressure (a scalar function) */ - fieldID[1] = 8; - fieldSize[1] = 1; - - feiPtr -> initFields(nFields, fieldSize, fieldID); - -Once the field information has been established, we are ready to initialize an -element block. An element block is characterized by the block identifier, the -number of elements, the number of nodes per element, the nodal fields and the -element fields (fields that have been defined previously). Suppose we use -:math:`1000` hexahedral elements in the element block :math:`0`, the setup -consists of - -.. code-block:: c++ - - elemBlkID = 0; /* identifier for a block of elements */ - nElems = 1000; /* number of elements in the block */ - elemNNodes = 8; /* number of nodes per element */ - - /* nodal-based field for the velocity */ - nodeNFields = 1; - nodeFieldIDs = new[nodeNFields]; - nodeFieldIDs[0] = fieldID[0]; - - /* element-based field for the pressure */ - elemNFields = 1; - elemFieldIDs = new[elemNFields]; - elemFieldIDs[0] = fieldID[1]; - - feiPtr -> initElemBlock(elemBlkID, nElems, elemNNodes, nodeNFields, - nodeFieldIDs, elemNFields, elemFieldIDs, 0); - -The last argument above specifies how the dependent variables are arranged in -the element matrices. A value of :math:`0` indicates that each variable is to be -arranged in a separate block (as opposed to interleaving). - -In a parallel environment, each processor has one or more element blocks. -Unless the element blocks are all disjoint, some of them share a common set of -nodes on the subdomain boundaries. To facilitate setting up interprocessor -communications, shared nodes between subdomains on different processors are to -be identified and sent to the FEI. Hence, each node in the whole domain is -assigned a unique global identifier. The shared node list on each processor -contains a subset of the global node list corresponding to the local nodes that -are shared with the other processors. The syntax for setting up the shared -nodes is - -.. code-block:: c++ - - feiPtr -> initSharedNodes(nShared, sharedIDs, sharedLengs, sharedProcs); - -This completes the initialization phase, and a completion signal is sent to the -FEI via - -.. code-block:: c++ - - feiPtr -> initComplete(); - -Next, we begin the *load* phase. The first entity for loading is the nodal -boundary conditions. Here we need to specify the number of boundary equations -and the boundary values given by ``alpha``, ``beta``, and ``gamma``. Depending -on whether the boundary conditions are Dirichlet, Neumann, or mixed, the three -values should be passed into the FEI accordingly. - -.. code-block:: c++ - - feiPtr -> loadNodeBCs(nBCs, BCEqn, fieldID, alpha, beta, gamma); - -The element stiffness matrices are to be loaded in the next step. We need to -specify the element number :math:`i`, the element block to which element -:math:`i` belongs, the element connectivity information, the element load, and -the element matrix format. The element connectivity specifies a set of :math:`8` -node global IDs (for hexahedral elements), and the element load is the load or -force for each degree of freedom. The element format specifies how the -equations are arranged (similar to the interleaving scheme mentioned above). -The calling sequence for loading element stiffness matrices is - -.. code-block:: c++ - - for (i = 0; i < nElems; i++) - feiPtr -> sumInElem(elemBlkID, elemID, elemConn[i], elemStiff[i], - elemLoads[i], elemFormat); - -To complete the assembling of the global stiffness matrix and the corresponding -right hand side, a signal is sent to the FEI via - -.. code-block:: c++ - - feiPtr -> loadComplete(); diff --git a/src/docs/usr-manual/ch-intro.rst b/src/docs/usr-manual/ch-intro.rst index d14568fc75..21c648515e 100644 --- a/src/docs/usr-manual/ch-intro.rst +++ b/src/docs/usr-manual/ch-intro.rst @@ -73,8 +73,7 @@ most systems, however, hypre can be built by simply typing ``configure`` followed by ``make``, or by using CMake [CMakeWeb]_. **Interfaces in multiple languages provide greater flexibility for -applications:** hypre is written in C (with the exception of the FEI interface, -which is written in C++) and provides an interface for Fortran users. +applications:** hypre is written in C and provides an interface for Fortran users. .. _more-info: @@ -165,7 +164,7 @@ terms of elements and element stiffness matrices. Finally, the right-most interface is the standard linear-algebraic (matrix rows/columns) way of viewing the linear problem. -The hypre library currently supports four conceptual interfaces, and typically +The hypre library currently supports three conceptual interfaces, and typically the appropriate choice for a given problem is fairly obvious, e.g. a structured-grid interface is clearly inappropriate for an unstructured-grid application. @@ -183,13 +182,6 @@ application. grids. This interface supports multiple unknowns per cell. See Chapter :ref:`ch-SStruct` for details. -* **Finite Element Interface (FEI):** This is appropriate for users who form - their linear systems from a finite element discretization. The interface - mirrors typical finite element data structures, including element stiffness - matrices. Though this interface is provided in hypre, its definition was - determined elsewhere (please send email to Alan Williams william@sandia.gov - for more information). See Chapter :ref:`ch-FEI` for details. - * **Linear-Algebraic System Interface (IJ):** This is the traditional linear-algebraic interface. It can be used as a last resort by users for whom the other grid-based interfaces are not appropriate. It requires more work on diff --git a/src/docs/usr-manual/ch-misc.rst b/src/docs/usr-manual/ch-misc.rst index 2cfec7601a..44bec7cf7d 100644 --- a/src/docs/usr-manual/ch-misc.rst +++ b/src/docs/usr-manual/ch-misc.rst @@ -351,6 +351,7 @@ when building for GPUs are: 1. Only one GPU backend can be enabled at a time (CUDA, HIP, or SYCL) 2. Some features like full support for 64-bit integers (`BigInt`) are not available 3. Memory management options (device vs unified memory) affect solver availability +4. Umpire is implicitly enabled by default when building with CUDA or HIP support The table below lists the available GPU-specific build options for both autotools and CMake build systems. @@ -454,26 +455,29 @@ build systems. - ``--enable-onemklrand`` - ``-DHYPRE_ENABLE_ONEMKLRAND=ON`` * - | Umpire Support - | (default is off) + | (default is on for **CUDA/HIP**) - ``--with-umpire`` - ``-DHYPRE_ENABLE_UMPIRE=ON`` * - | Umpire Unified Memory - | (default is off) + | (default is on for **CUDA/HIP**) - ``--with-umpire-um`` - ``-DHYPRE_ENABLE_UMPIRE_UM=ON`` * - | Umpire Device Memory - | (default is off) + | (default is on for **CUDA/HIP**) - ``--with-umpire-device`` - ``-DHYPRE_ENABLE_UMPIRE_DEVICE=ON`` -.. warning:: +.. note:: - Allocations and deallocations of GPU memory can be slow. Memory pooling is a - common approach to reduce such overhead and improve performance. We recommend using - [Umpire]_ for memory management, which provides robust pooling capabilities for both - device and unified memory. For Umpire support, the Umpire library must be installed - and properly configured. See the note in the previous section for more details on - how to specify the installation path for dependency libraries. + Allocations and deallocations of GPU memory can be slow. Memory pooling is a common + approach to reduce such overhead and improve performance. For better performance, + [Umpire]_ is enabled by default for CUDA and HIP builds and provides robust pooling + capabilities for both device and unified memory. + + For SYCL builds, Umpire remains optional and must be enabled explicitly. + + For Umpire support, the Umpire library must be installed and properly configured. See + :ref:`umpire_build` for instructions on building Umpire from source. .. note:: @@ -484,6 +488,58 @@ build systems. See :ref:`ch-boomeramg-gpu` for details. Some solver options for BoomerAMG require unified (managed) memory. +.. _umpire_build: + +Building Umpire +^^^^^^^^^^^^^^^ + +If Umpire is not already available on your system, you can build it using +`Spack `_ or manually from source. To build from source, +follow these steps: + +.. code-block:: bash + + git clone https://github.com/LLNL/Umpire.git + cd Umpire + git submodule update --init + + cmake -S . -B build \ + -DUMPIRE_ENABLE_C=ON \ + -DUMPIRE_ENABLE_TOOLS=OFF \ + -DENABLE_CUDA=${ENABLE_CUDA} \ + -DENABLE_HIP=${ENABLE_HIP} \ + -DENABLE_SYCL=${ENABLE_SYCL} \ + -DENABLE_BENCHMARKS=OFF \ + -DENABLE_EXAMPLES=OFF \ + -DENABLE_DOCS=OFF \ + -DENABLE_TESTS=OFF \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_LIBDIR=/path-to-umpire-install/lib \ + -DCMAKE_INSTALL_PREFIX=/path-to-umpire-install + + cmake --build build -j + cmake --install build + +Enable either CUDA, HIP, or SYCL by setting the corresponding flag to ``ON`` and +the others to ``OFF``. + +After completion, make sure to add the installation path to your environment +or provide it to hypre at configure time. For example: + +.. code-block:: bash + + ./configure --with-umpire-include=/path-to-umpire-install/include \ + --with-umpire-lib-dirs=/path-to-umpire-install/lib \ + --with-umpire-libs="camp umpire" \ + +or with CMake: + +.. code-block:: bash + + cmake -DHYPRE_ENABLE_UMPIRE=ON \ + -Dumpire_DIR=/path-to-umpire-install/lib/cmake/umpire \ + ../src + Make Targets ===================== @@ -799,55 +855,6 @@ effectively, please include: - Problem size and scaling information - Hardware configuration details -.. _LSI_install: - -Using HYPRE in External FEI Implementations -============================================================================== - -.. 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. - -To set up hypre for use in external, e.g. Sandia's, FEI implementations one -needs to follow the following steps: - -#. obtain the hypre and Sandia's FEI source codes, -#. compile Sandia's FEI (fei-2.5.0) to create the ``fei_base`` library. -#. compile hypre - - * unpack the archive and go into the ``src`` directory - * do a ``configure`` with the ``--with-fei-inc-dir`` option set to the FEI - include directory plus other compile options - * compile with ``make install`` to create the ``HYPRE_LSI`` library in - ``hypre/lib``. - -#. call the FEI functions in your application code (as shown in Chapters - :ref:`ch-FEI` and :ref:`ch-Solvers`) - - * include ``cfei-hypre.h`` in your file - * include ``FEI_Implementation.h`` in your file - -#. Modify your ``Makefile`` - - * include hypre's ``include`` and ``lib`` directories in the search paths. - * Link with ``-lfei_base -lHYPRE_LSI``. Note that the order in which the - libraries are listed may be important. - -Building an application executable often requires linking with many different -software packages, and many software packages use some LAPACK and/or BLAS -functions. In order to alleviate the problem of multiply defined functions at -link time, it is recommended that all software libraries are stripped of all -LAPACK and BLAS function definitions. These LAPACK and BLAS functions should -then be resolved at link time by linking with the system LAPACK and BLAS -libraries (e.g. dxml on DEC cluster). Both hypre and SuperLU were built with -this in mind. However, some other software library files needed may have the -BLAS functions defined in them. To avoid the problem of multiply defined -functions, it is recommended that the offending library files be stripped of the -BLAS functions. - - Calling HYPRE from Other Languages ============================================================================== diff --git a/src/docs/usr-manual/ch-mprecision.rst b/src/docs/usr-manual/ch-mprecision.rst new file mode 100644 index 0000000000..0f477ea4e0 --- /dev/null +++ b/src/docs/usr-manual/ch-mprecision.rst @@ -0,0 +1,70 @@ +.. Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + HYPRE Project Developers. See the top-level COPYRIGHT file for details. + + SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +.. _ch-MPrecision: + +****************************************************************************** +Mixed Precision +****************************************************************************** + +The hypre library has provided compile-time multi-precision support for many +years. For example, the autotools option ``--enable-single`` or the CMake +option ``-DHYPRE_SINGLE=ON`` will produce a single precision library. + +Starting in hypre version 3.0, multiple precision and mixed precision support +are provided at runtime. To turn this on, use + +- ``--enable-mixed-precision`` (autotools) +- ``-DHYPRE_ENABLE_MIXED_PRECISION=ON`` (CMake) + +With the above, users can compile, link, and run as before without changes to +their code. To access runtime precision, there are several levels of support +that can be used, outlined in the following sections. For clarity, a generic +name ``Foo`` is used to represent a function in hypre, e.g., ``HYPRE_PCGSolve``. + + +.. _sec-MP-Fixed: + +Calling functions with fixed precision +============================================================================== + +For every function ``Foo`` in hypre, the following fixed-precision versions are +also available, + +- ``Foo_flt`` +- ``Foo_dbl`` +- ``Foo_long_dbl`` + +where the precision of each function is determined by the C compiler and the +respective C types ``float``, ``double``, and ``long double``. The prototypes +for these functions are exactly the same as for ``Foo``, but with real-valued +arguments like ``HYPRE_Real`` mapping to the specific C types (and precisions) +indicated above. + + +.. _sec-MP-Multiple: + +Calling functions with multiple precisions +============================================================================== + +Every user-API function ``Foo`` in hypre (any function beginning with the upper +case ``HYPRE_`` prefix) is also available in the mixed-precision configuration +of the library, but its precision is determined by a global runtime precision +that can be set by calling + +.. code-block:: c + + HYPRE_Int HYPRE_SetGlobalPrecision(HYPRE_Precision precision) + +where ``precision`` is either ``HYPRE_REAL_SINGLE``, ``HYPRE_REAL_DOUBLE``, or +``HYPRE_REAL_LONGDOUBLE``. Real-valued arguments for ``Foo`` have different +types from the functions described in Section :ref:`sec-MP-Fixed` because they +have to support all three precisions, but calling ``Foo`` in practice is much +the same. Specifically, real arrays such as ``HYPRE_Real *`` become ``void *``, +and real values such as ``HYPRE_Real`` become ``long double``. This prototyping +enables multiple-precision functionality, although strong type checking at +compile time is lost. + diff --git a/src/docs/usr-manual/ch-references.rst b/src/docs/usr-manual/ch-references.rst index bf18b8d0f2..2153dd6c38 100644 --- a/src/docs/usr-manual/ch-references.rst +++ b/src/docs/usr-manual/ch-references.rst @@ -50,10 +50,6 @@ approximate inverse preconditioners. *SIAM J. Sci. Comput.*, 21:1804--1822, 2000. -.. [ClEA1999] R. L. Clay et al. An annotated reference guide to the Finite - Element Interface (FEI) specification, Version 1.0. Technical Report - SAND99-8229, Sandia National Laboratories, Livermore, CA, 1999. - .. [CMakeWeb] CMake, a cross-platform open-source build system. `http://www.cmake.org/ `_. @@ -150,9 +146,6 @@ Preconditioning. *ACM T. Math. Software*, 41(2):1–-26, 2015. `https://doi.org/10.1145/2629475 `_. -.. [JoLe2006] J. Jones and B. Lee. A multigrid method for variable coefficient - maxwell's equations. *SIAM J. Sci. Comput.*, 27:1689--1708, 2006. - .. [McCo1989] S. F. McCormick. *Multilevel Adaptive Methods for Partial Differential Equations*, volume 6 of *Frontiers in Applied Mathematics*. SIAM Books, Philadelphia, 1989. @@ -174,6 +167,9 @@ partial differential equations with highly discontinuous and anisotropic coefficients. *SIAM J. Sci. Comput.*, 20(1):228--242, 1998. +.. [MaFaYa23] V. A. P. Magri, R. Falgout and U. M. Yang. A new semistructured + algebraic multigrid method. *SIAM J. Sci. Comput.*, 45(3):S439-S460, 2023. + .. [Stue1999] K. Stüben. Algebraic multigrid (AMG): an introduction with applications. In U. Trottenberg, C. Oosterlee, and A. Schüller, editors, *Multigrid*. Academic Press, 2001. diff --git a/src/docs/usr-manual/ch-solvers.rst b/src/docs/usr-manual/ch-solvers.rst index c8c1abfd7c..9116c0b152 100644 --- a/src/docs/usr-manual/ch-solvers.rst +++ b/src/docs/usr-manual/ch-solvers.rst @@ -13,46 +13,42 @@ Solvers and Preconditioners There are several solvers available in hypre via different conceptual interfaces: - =========== ======= ======= ======= ======= + =========== ======= ======= ======= :math:`\;` System Interfaces - ----------- ---------------------------------- - Solvers Struct SStruct FEI IJ - =========== ======= ======= ======= ======= + ----------- ------------------------- + Solvers Struct SStruct IJ + =========== ======= ======= ======= Jacobi X X SMG X X PFMG X X Split X SysPFMG X - FAC X - Maxwell X - BoomerAMG X X X - AMS X X X - ADS X X X - MLI X X X - MGR X - FSAI X - ParaSails X X X - ILU X - Euclid X X X - PILUT X X X - PCG X X X X - GMRES X X X X - FlexGMRES X X X X - LGMRES X X X - BiCGSTAB X X X X - Hybrid X X X X - LOBPCG X X X - =========== ======= ======= ======= ======= - -Note that there are a few additional solvers and preconditioners not mentioned -in the table that can be used only through the FEI interface and are described -in Paragraph 6.14. The procedure for setup and use of solvers and -preconditioners is largely the same. We will refer to them both as solvers in -the sequel except when noted. In normal usage, the preconditioner is chosen and -constructed before the solver, and then handed to the solver as part of the -solver's setup. In the following, we assume the most common usage pattern in -which a single linear system is set up and then solved with a single righthand -side. We comment later on considerations for other usage patterns. + SSAMG X + BoomerAMG X X + AMS X X + ADS X X + MGR X + FSAI X + ParaSails X X + ILU X + Euclid X X + PILUT X X + PCG X X X + GMRES X X X + FlexGMRES X X X + LGMRES X X X + BiCGSTAB X X X + Hybrid X X X + LOBPCG X X X + =========== ======= ======= ======= + +The procedure for setup and use of solvers and preconditioners is largely the +same. We will refer to them both as solvers in the sequel except when noted. +In normal usage, the preconditioner is chosen and constructed before the solver, +and then handed to the solver as part of the solver's setup. In the following, +we assume the most common usage pattern in which a single linear system is set +up and then solved with a single righthand side. We comment later on +considerations for other usage patterns. **Setup:** @@ -145,13 +141,11 @@ be found in Chapter :ref:`ch-API`. solvers-smg-pfmg solvers-split - solvers-fac - solvers-maxwell + solvers-ssamg solvers-hybrid solvers-boomeramg solvers-ams solvers-ads - solvers-mli solvers-mgr solvers-fsai solvers-parasails @@ -159,4 +153,3 @@ be found in Chapter :ref:`ch-API`. solvers-euclid solvers-pilut solvers-lobpcg - solvers-fei diff --git a/src/docs/usr-manual/ch-struct.rst b/src/docs/usr-manual/ch-struct.rst index ef598fd385..1cee69af30 100644 --- a/src/docs/usr-manual/ch-struct.rst +++ b/src/docs/usr-manual/ch-struct.rst @@ -15,9 +15,8 @@ structured-grid applications, users should use the ``Struct`` interface described in this chapter. This interface will also provide access (this is not yet supported) to solvers in hypre that were designed for unstructured-grid applications and sparse linear systems in general. These additional solvers are -usually provided via the unstructured-grid interface (``FEI``) or the -linear-algebraic interface (``IJ``) described in Chapters :ref:`ch-FEI` and -:ref:`ch-IJ`. +usually provided via the linear-algebraic interface (``IJ``) described in +Chapter :ref:`ch-IJ`. :numref:`fig-struct-example` gives an example of the type of grid currently supported by the ``Struct`` interface. The interface uses a finite-difference diff --git a/src/docs/usr-manual/conf.py b/src/docs/usr-manual/conf.py index 7a16e36239..f8e45d7436 100644 --- a/src/docs/usr-manual/conf.py +++ b/src/docs/usr-manual/conf.py @@ -70,9 +70,9 @@ # built documents. # # The short X.Y version. -version = '2.33.0' +version = '3.0.0' # The full version, including alpha/beta/rc tags. -release = '2.33.0' +release = '3.0.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -80,7 +80,7 @@ # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: -today = 'April 03, 2025' +today = 'September 26, 2025' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' diff --git a/src/docs/usr-manual/index.rst b/src/docs/usr-manual/index.rst index 914c19588d..680efc815a 100644 --- a/src/docs/usr-manual/index.rst +++ b/src/docs/usr-manual/index.rst @@ -19,9 +19,9 @@ Documentation for hypre ch-intro ch-struct ch-sstruct - ch-fei ch-ij ch-solvers + ch-mprecision ch-misc ch-references diff --git a/src/docs/usr-manual/solvers-fac.rst b/src/docs/usr-manual/solvers-fac.rst deleted file mode 100644 index d3f26338c5..0000000000 --- a/src/docs/usr-manual/solvers-fac.rst +++ /dev/null @@ -1,71 +0,0 @@ -.. Copyright (c) 1998 Lawrence Livermore National Security, LLC and other - HYPRE Project Developers. See the top-level COPYRIGHT file for details. - - SPDX-License-Identifier: (Apache-2.0 OR MIT) - - -FAC -============================================================================== - -FAC is a parallel fast adaptive composite grid solver for finite volume, -cell-centred discretizations of smooth diffusion coefficient problems. To be -precise, it is a FACx algorithm since the patch solves consist of only -relaxation sweeps. For details of the basic overall algorithms, see [McCo1989]_. -Algorithmic particularities include formation of non-Galerkin coarse-grid -operators (i.e., coarse-grid operators underlying refinement patches are -automatically generated) and non-stored linear/constant -interpolation/restriction operators. Implementation particularities include a -processor redistribution of the generated coarse-grid operators so that -intra-level communication between adaptive mesh refinement (AMR) levels during -the solve phase is kept to a minimum. This redistribution is hidden from the -user. - -The user input is essentially a linear system describing the *composite* -operator, and the refinement factors between the AMR levels. To form this -composite linear system, the AMR grid is described using semi-structured grid -parts. Each AMR level grid corresponds to a separate part so that this level -grid is simply a collection of boxes, all with the same refinement factor, i.e., -it is a struct grid. However, several restrictions are imposed on the patch -(box) refinements. First, a refinement box must cover all underlying coarse -cells- i.e., refinement of a partial coarse cell is not permitted. Also, the -refined/coarse indices must follow a mapping: with :math:`[r_1,r_2,r_3]` -denoting the refinement factor and :math:`[a_1,a_2,a_3] \times [b_1,b_2,b_3]` -denoting the coarse subbox to be refined, the mapping to the refined patch is - -.. math:: - - [r_1*a_1,r_2*a_2,r_3*a_3] \times [r_1*b_1+ r_1-1, r_2*b_2+ r_2-1,r_3*b_3+ r_3-1]. - -With the AMR grid constructed under these restrictions, the composite matrix can -be formed. Since the AMR levels correspond to semi-structured grid parts, the -composite matrix is a semi-structured matrix consisting of structured components -within each part, and unstructured components describing the -coarse-to-fine/fine-to-coarse connections. The structured and unstructured -components can be set using stencils and the ``HYPRE_SStructGraphAddEntries`` -routine, respectively. The matrix coefficients can be filled after setting -these non-zero patterns. Between each pair of successive AMR levels, the coarse -matrix underlying the refinement patch must be the identity and the -corresponding rows of the rhs must be zero. These can performed using routines -``HYPRE_SStructFACZeroCFSten`` (to zero off the stencil values reaching from -coarse boxes into refinement boxes), ``HYPRE_SStructFACZeroFCSten`` (to zero off -the stencil values reaching from refinement boxes into coarse boxes), -``HYPRE_SStructFACZeroAMRMatrixData`` (to set the identity at coarse grid points -underlying a refinement patch), and ``HYPRE_SStructFACZeroAMRVectorData`` (to -zero off a vector at coarse grid points underlying a refinement patch). These -routines can simplify the user's matrix setup. For example, consider two -successive AMR levels with the coarser level consisting of one box and the finer -level consisting of a collection of boxes. Rather than distinguishly setting the -stencil values and the identity in the appropriate locations, the user can set -the stencil values on the whole coarse grid using the -``HYPRE_SStructMatrixSetBoxValues`` routine and then zero off the appropriate -values using the above zeroing routines. - -The coarse matrix underlying these patches are algebraically generated by -operator-collapsing the refinement patch operator and the fine-to-coarse -coefficients (this is why stencil values reaching out of a part must be -zeroed). This matrix is re-distributed so that each processor has all of its -coarse-grid operator. - -To solve the coarsest AMR level, a PFMG V cycle is used. Note that a minimum of -two AMR levels are needed for this solver. - diff --git a/src/docs/usr-manual/solvers-fei.rst b/src/docs/usr-manual/solvers-fei.rst deleted file mode 100644 index 51e0035f0a..0000000000 --- a/src/docs/usr-manual/solvers-fei.rst +++ /dev/null @@ -1,205 +0,0 @@ -.. Copyright (c) 1998 Lawrence Livermore National Security, LLC and other - HYPRE Project Developers. See the top-level COPYRIGHT file for details. - - SPDX-License-Identifier: (Apache-2.0 OR MIT) - - -.. _LSI_solvers: - -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 -external FEI is employed, the user needs to link with hypre's implementation of -the ``LinearSystemCore`` class, as described in Section :ref:`LSI_install`. - -Solver parameters are specified as an array of strings, and a complete list of -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. - -Finally, the solution can be retrieved by the following function call: - -.. code-block:: c++ - - feiPtr -> getBlockNodeSolution(elemBlkID, nNodes, nodeIDList, - solnOffsets, solnValues); - -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 ------------------------------------------------------------------------------- - -While most of the solvers from the previous sections are available through the -FEI interface, there are number of additional solvers and preconditioners that -are accessible only through the FEI. These solvers are briefly described in -this section (see also the reference manual). - -Sequential and Parallel Solvers -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -hypre currently has many iterative solvers. There is also internally a version -of the sequential ``SuperLU`` direct solver (developed at U.C. Berkeley) -suitable to small problems (may be up to the size of :math:`10000`). In the -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), - -Parallel Preconditioners -^^^^^^^^^^^^^^^^^^^^^^^^ - -The performance of the Krylov solvers can be improved by clever selection of -preconditioners. Besides those mentioned previously in this chapter, the -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``), -#. least-squares polynomial preconditioner, -#. :math:`2 \times 2` block preconditioner, and -#. :math:`2 \times 2` Uzawa preconditioner. - -Some of these preconditioners can be tuned by a number of internal parameters -modifiable by users. A description of these parameters is given in the reference -manual. - -Matrix Reduction -^^^^^^^^^^^^^^^^ - -For some structural mechanics problems with multi-point constraints the -discretization matrix is indefinite (eigenvalues lie in both sides of the -imaginary axis). Indefinite matrices are much more difficult to solve than -definite matrices. Methods have been developed to reduce these indefinite -matrices to definite matrices. Two matrix reduction algorithms have been -implemented in hypre, as presented in the following subsections. - -Schur Complement Reduction -^^^^^^^^^^^^^^^^^^^^^^^^^^ -The incoming linear system of equations is assumed to be in the form: - -.. math:: - - \left[ - \begin{array}{cc} - D & B \\ - B^T & 0 - \end{array} - \right] - \left[ - \begin{array}{c} - x_1 \\ - x_2 - \end{array} - \right] - = - \left[ - \begin{array}{c} - b_1 \\ - b_2 - \end{array} - \right] - -where :math:`D` is a diagonal matrix. After Schur complement reduction is -applied, the resulting linear system becomes - -.. math:: - - B^T D^{-1} B x_2 = b_2 - B^T D^{-1} b_1. - -Slide Surface Reduction -^^^^^^^^^^^^^^^^^^^^^^^ - -With the presence of slide surfaces, the matrix is in the same form as in the -case of Schur complement reduction. Here :math:`A` represents the relationship -between the master, slave, and other degrees of freedom. The matrix block -:math:`[B^T 0]` corresponds to the constraint equations. The goal of reduction -is to eliminate the constraints. As proposed by Manteuffel, the trick is to -re-order the system into a :math:`3 \times 3` block matrix. - -.. math:: - - \left[ - \begin{array}{ccc} - A_{11} & A_{12} & N \\ - A_{21} & A_{22} & D \\ - N_{T} & D & 0 \\ - \end{array} - \right] - = - \left[ - \begin{array}{ccc} - A_{11} & \hat{A}_{12} \\ - \hat{A}_{21} & \hat{A}_{22}. - \end{array} - \right] - -The reduced system has the form : - -.. math:: - - (A_{11} - \hat{A}_{21} \hat{A}_{22}^{-1} \hat{A}_{12}) x_1 = - b_1 - \hat{A}_{21} \hat{A}_{22}^{-1} b_2, - -which is symmetric positive definite (SPD) if the original matrix is PD. In -addition, :math:`\hat{A}_{22}^{-1}` is easy to compute. - -There are three slide surface reduction algorithms in hypre. The first follows -the matrix formulation in this section. The second is similar except that it -replaces the eliminated slave equations with identity rows so that the degree of -freedom at each node is preserved. This is essential for certain block -algorithms such as the smoothed aggregation multilevel preconditioners. The -third is similar to the second except that it is more general and can be applied -to problems with intersecting slide surfaces (sequential only for intersecting -slide surfaces). - -Other Features -^^^^^^^^^^^^^^ - -To improve the efficiency of the hypre solvers, a few other features have been -incorporated. We list a few of these features below : - -#. Preconditioner reuse - For multiple linear solves with matrices that are - slightly perturbed from each other, oftentimes the use of the same - preconditioners can save preconditioner setup times but suffer little - convergence rate degradation. -#. Projection methods - For multiple solves that use the same matrix, previous - solution vectors can sometimes be used to give a better initial guess for - subsequent solves. Two projection schemes have been implemented in hypre - - A-conjugate projection (for SPD matrices) and minimal residual projection - (for both SPD and non-SPD matrices). -#. The sparsity pattern of the matrix is in general not destroyed after it has - been loaded to an hypre matrix. But if the matrix is not to be reused, an - option is provided to clean up this pattern matrix to conserve memory usage. diff --git a/src/docs/usr-manual/solvers-maxwell.rst b/src/docs/usr-manual/solvers-maxwell.rst deleted file mode 100644 index 9713ae9ca6..0000000000 --- a/src/docs/usr-manual/solvers-maxwell.rst +++ /dev/null @@ -1,90 +0,0 @@ -.. Copyright (c) 1998 Lawrence Livermore National Security, LLC and other - HYPRE Project Developers. See the top-level COPYRIGHT file for details. - - SPDX-License-Identifier: (Apache-2.0 OR MIT) - - -Maxwell -============================================================================== - -Maxwell is a parallel solver for edge finite element discretization of the -curl-curl formulation of the Maxwell equation - -.. math:: - - \nabla \times \alpha \nabla \times E + \beta E= f, \beta> 0 - -on semi-structured grids. Details of the algorithm can be found in [JoLe2006]_. -The solver can be viewed as an operator-dependent multiple-coarsening algorithm -for the Helmholtz decomposition of the error correction. Input to this solver -consist of only the linear system and a gradient operator. In fact, if the -orientation of the edge elements conforms to a lexicographical ordering of the -nodes of the grid, then the gradient operator can be generated with the routine -``HYPRE_MaxwellGrad``: at grid points :math:`(i,j,k)` and :math:`(i-1,j,k),` the -produced gradient operator takes values :math:`1` and :math:`-1` respectively, -which is the correct gradient operator for the appropriate edge -orientation. Since the gradient operator is normalized (i.e., :math:`h` -independent) the edge finite element must also be normalized in the -discretization. - -This solver is currently developed for perfectly conducting boundary condition -(Dirichlet). Hence, the rows and columns of the matrix that corresponding to the -grid boundary must be set to the identity or zeroed off. This can be achieved -with the routines ``HYPRE_SStructMaxwellPhysBdy`` and -``HYPRE_SStructMaxwellEliminateRowsCols``. The former identifies the ranks of -the rows that are located on the grid boundary, and the latter adjusts the -boundary rows and cols. As usual, the rhs of the linear system must also be -zeroed off at the boundary rows. This can be done using -``HYPRE_SStructMaxwellZeroVector``. - -With the adjusted linear system and a gradient operator, the user can form the -Maxwell multigrid solver using several different edge interpolation schemes. For -problems with smooth coefficients, the natural Nedelec interpolation operator -can be used. This is formed by calling ``HYPRE_SStructMaxwellSetConstantCoef`` -with the flag :math:`>0` before setting up the solver, otherwise the default -edge interpolation is an operator-collapsing/element-agglomeration scheme. This -is suitable for variable coefficients. Also, before setting up the solver, the -user must pass the gradient operator, whether user or ``HYPRE_MaxwellGrad`` -generated, with ``HYPRE_SStructMaxwellSetGrad``. After these preliminary calls, -the Maxwell solver can be setup by calling ``HYPRE_SStructMaxwellSetup``. - -There are two solver cycling schemes that can be used to solve the linear -system. To describe these, one needs to consider the augmented system operator - -.. math:: - - \bf{A}= \left [ - \begin{array}{ll} - A_{ee} & A_{en} \\ - A_{ne} & A_{nn} - \end{array} - \right ], - -where :math:`A_{ee}` is the stiffness matrix corresponding to the above -curl-curl formulation, :math:`A_{nn}` is the nodal Poisson operator created by -taking the Galerkin product of :math:`A_{ee}` and the gradient operator, and -:math:`A_{ne}` and :math:`A_{en}` are the nodal-edge coupling operators (see -[JoLe2006]_). The algorithm for this Maxwell solver is based on forming a -multigrid hierarchy to this augmented system using the block-diagonal -interpolation operator - -.. math:: - - \bf{P}= \left[ \begin{array}{ll} - P_e & 0 \\ - 0 & P_n - \end{array} - \right], - -where :math:`P_e` and :math:`P_n` are respectively the edge and nodal -interpolation operators determined individually from :math:`A_{ee}` and -:math:`A_{nn}.` Taking a Galerkin product between :math:`\bf{A}` and -:math:`\bf{P}` produces the next coarse augmented operator, which also has the -nodal-edge coupling operators. Applying this procedure recursively produces -nodal-edge coupling operators at all levels. Now, the first solver cycling -scheme, ``HYPRE_SStructMaxwellSolve``, keeps these coupling operators on all -levels of the V-cycle. The second, cheaper scheme, -``HYPRE_SStructMaxwellSolve2``, keeps the coupling operators only on the finest -level, i.e., separate edge and nodal V-cycles that couple only on the finest -level. - diff --git a/src/docs/usr-manual/solvers-mli.rst b/src/docs/usr-manual/solvers-mli.rst deleted file mode 100644 index 60872c4a21..0000000000 --- a/src/docs/usr-manual/solvers-mli.rst +++ /dev/null @@ -1,54 +0,0 @@ -.. Copyright (c) 1998 Lawrence Livermore National Security, LLC and other - HYPRE Project Developers. See the top-level COPYRIGHT file for details. - - SPDX-License-Identifier: (Apache-2.0 OR MIT) - - -The MLI Package -============================================================================== - -MLI is an object-oriented module that implements the class of algebraic -multigrid algorithms based on Vanek and Brezina's smoothed aggregation method -[VaMB1996]_, [VaBM2001]_. There are two main algorithms in this module - the -original smoothed aggregation algorithm and the modified version that uses the -finite element substructure matrices to construct the prolongation operators. -As such, the later algorithm can only be used in the finite element context via -the finite element interface. In addition, the nodal coordinates obtained via -the finite element interface can be used to construct a better prolongation -operator than the pure translation modes. - -Below is an example on how to set up MLI as a preconditioner for conjugate -gradient. - -.. code-block:: c - - HYPRE_LSI_MLICreate(MPI_COMM_WORLD, &pcg_precond); - - HYPRE_LSI_MLISetParams(pcg_precond, "MLI strengthThreshold 0.08"); - ... - - HYPRE_PCGSetPrecond(pcg_solver, - (HYPRE_PtrToSolverFcn) HYPRE_LSI_MLISolve, - (HYPRE_PtrToSolverFcn) HYPRE_LSI_MLISetup, - pcg_precond); - -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/src/docs/usr-manual/solvers-ssamg.rst b/src/docs/usr-manual/solvers-ssamg.rst new file mode 100644 index 0000000000..5092cbac72 --- /dev/null +++ b/src/docs/usr-manual/solvers-ssamg.rst @@ -0,0 +1,127 @@ +.. Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + HYPRE Project Developers. See the top-level COPYRIGHT file for details. + + SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +SSAMG +============================================================================== + +SSAMG is a semi-structured algebraic multigrid solver designed for problems +defined through hypre's SStruct interface [MaFaYa23]_. It targets applications +with grids composed of multiple logically rectangular parts (e.g., block-structured, +overset, and structured adaptive mesh refinement grids) and supports coupling +between parts. The system matrix is naturally viewed as + +.. math:: + + A = S + U, + +where ``S`` represents structured, stencil-based intra-part couplings and ``U`` +captures unstructured inter-part couplings. + +SSAMG builds a multilevel hierarchy algebraically, combining structured, +directional coarsening within each part with algebraic treatment of couplings +across parts. Compared to fully unstructured AMG, SSAMG exploits regularity for +performance while allowing more general problem structure than strictly +structured methods like PFMG. + +.. note:: + SSAMG currently targets single-type variables on each part. Support for + multiple variables per part is limited. + +Configuration options +------------------------------------------------------------------------------ + +Below is a summary of configuration routines. See the reference manual for full +details and defaults. + +- ``HYPRE_SStructSSAMGSetTol``: Convergence tolerance on the relative residual. +- ``HYPRE_SStructSSAMGSetMaxIter``: Maximum number of SSAMG iterations. +- ``HYPRE_SStructSSAMGSetMaxLevels``: Limit the multigrid hierarchy depth. +- ``HYPRE_SStructSSAMGSetRelChange``: Require relative change of iterates to be + small in addition to the residual criterion. +- ``HYPRE_SStructSSAMGSetZeroGuess`` / ``SetNonZeroGuess``: Specify initial + guess semantics. +- ``HYPRE_SStructSSAMGSetInterpType``: Interpolation choice within parts: + + - ``-1``: Structured interpolation only (default) + - ``0``: Structured plus classical modified unstructured interpolation + +- ``HYPRE_SStructSSAMGSetRelaxType``: Smoother selection: + + - ``0``: Jacobi + - ``1``: Weighted Jacobi (default) + - ``2``: L1-Jacobi + - ``10``: Red/Black Gauss–Seidel (symmetric RB/BR) + +- ``HYPRE_SStructSSAMGSetRelaxWeight``: Jacobi weight (used by Jacobi variants). +- ``HYPRE_SStructSSAMGSetNumPreRelax`` / ``SetNumPostRelax``: Number of sweeps + before/after coarse correction on each level. +- ``HYPRE_SStructSSAMGSetNumCoarseRelax``: Number of sweeps on the coarsest + level (when not delegating to BoomerAMG). +- ``HYPRE_SStructSSAMGSetSkipRelax``: Enable skip-relax on levels whose + coarsening directions repeat those from previous cycles (useful for isotropic + problems). +- ``HYPRE_SStructSSAMGSetCoarseSolverType``: Coarse solver selection: + + - ``0``: Weighted Jacobi (default) + - ``1``: BoomerAMG (hybrid hierarchy on coarse levels) + +- ``HYPRE_SStructSSAMGSetDxyz``: Provide a per-part grid-spacing metric used to + guide coarsening direction choices. +- ``HYPRE_SStructSSAMGSetMaxCoarseSize``: Limit the maximum coarse problem size + (set to zero to disable). +- ``HYPRE_SStructSSAMGSetLogging``: Enable internal logging. +- ``HYPRE_SStructSSAMGSetPrintLevel`` / ``SetPrintFreq``: Control verbosity and + output frequency. +- ``HYPRE_SStructSSAMGGetNumIterations`` / ``GetFinalRelativeResidualNorm``: + Retrieve iteration count and final relative residual norm. + + +Algorithm notes +------------------------------------------------------------------------------ + +- **Per-part semi-coarsening**: Each part selects a dominant coupling direction + (heuristically related to an effective grid spacing metric) and coarsens by a + factor of two in that direction. This adapts to anisotropy that varies across + parts. +- **Structured interpolation**: Prolongation is constructed within each part + from the structured component of the operator and uses the transpose as + restriction. This limits stencil growth and captures heterogeneity. +- **Hybrid coarse solve**: Delegating coarse levels to BoomerAMG can reduce the + overall number of levels in the multigrid hierarchy while retaining efficiency + on fine levels. + + +Minimal C example +------------------------------------------------------------------------------ + +The snippet below shows how to create and configure an SSAMG solver and solves +a problem with an assembled SStruct matrix ``A`` and vectors ``b``, +``x``. Only solver creation and configuration are shown. For better robustness, +we recommend using SSAMG as a preconditioner for a Krylov solver. + +.. code-block:: c + + HYPRE_SStructSolver ssamg; + HYPRE_SStructSSAMGCreate(MPI_COMM_WORLD, &ssamg); + + HYPRE_SStructSSAMGSetTol(ssamg, 1e-8); + HYPRE_SStructSSAMGSetMaxIter(ssamg, 50); + HYPRE_SStructSSAMGSetInterpType(ssamg, -1); /* Structured-only interpolation */ + HYPRE_SStructSSAMGSetRelaxType(ssamg, 1); /* Weighted Jacobi */ + HYPRE_SStructSSAMGSetNumPreRelax(ssamg, 1); + HYPRE_SStructSSAMGSetNumPostRelax(ssamg, 1); + HYPRE_SStructSSAMGSetSkipRelax(ssamg, 1); /* Skip relaxation on certain levels */ + HYPRE_SStructSSAMGSetCoarseSolverType(ssamg, 1); /* Switch to BoomerAMG on coarse level */ + + HYPRE_SStructSSAMGSetup(ssamg, A, b, x); + HYPRE_SStructSSAMGSolve(ssamg, A, b, x); + + HYPRE_Int iters; HYPRE_Real relres; + HYPRE_SStructSSAMGGetNumIterations(ssamg, &iters); + HYPRE_SStructSSAMGGetFinalRelativeResidualNorm(ssamg, &relres); + + HYPRE_SStructSSAMGDestroy(ssamg); + diff --git a/src/docs/wiki-dev/Mixed-Precision.md b/src/docs/wiki-dev/Mixed-Precision.md new file mode 100644 index 0000000000..07185cb0cb --- /dev/null +++ b/src/docs/wiki-dev/Mixed-Precision.md @@ -0,0 +1,71 @@ +This document gives information on mixed precision development in hypre. + +## General information + +Terminology: +* Multiprecision - a solver, function, or feature that uses different precisions individually. +* Mixed precision - a solver, function, or feature that uses different precisions simultaneously. + +The mixed precision support in hypre is primarily intended to: +* provide multiple precisions at runtime, and +* provide faster and more memory efficient mixed-precision solvers. + +Features of mixed precision library configuration include: +* Existing user code runs as before without requiring modification. +* All compile-time precisions are available at runtime. +* Precision can be set globally at runtime and requires only minimal changes to existing user code (to manage real-valued data). +* Precision can be assigned to objects (e.g., matrices) which in turn determines the precision of related methods (e.g., Matvec). [Future feature] +* Additional mixed precision solvers are available. + +### Basic structure + +Each directory in hypre contains a number of files devoted to multiprecision and mixed precision. Most of the files either begin with `mup` or have `mup` in their names. Since header file names should begin with either `HYPRE_` or `_hypre_`, the header files associated with multiprecision have names such as `HYPRE_utilities_mup.h` or `_hypre_utilities_mup.h`. Most of the multiprecision files in each directory are automatically generated to keep code development and maintenance to a minimum. + +With only a few exceptions, every function `Foo` in hypre is provided in multiple precisions. This is achieved by compiling the library three times to generate the symbols `Foo_flt`, `Foo_dbl`, and `Foo_long_dbl`, plus a smaller fourth compile of auto-generated wrapper implementations of `Foo`. These wrapper versions of `Foo` either default to a fixed precision determined at compile time or branch to a precision determined at runtime. + +Each function must be listed in one of three files: +- `mup.fixed` - `Foo` has fixed compile-time precision (configured by the user) +- `mup.functions` - `Foo` has precision determined by the global runtime precision +- `mup.methods` - `Foo` has precision determined by its object(s) precision(s) [Future feature] + +There is an optional file called `mup.exclude` that can be used for functions that should only be compiled once. The only use of this currently is in `utilities`, and it requires special treatment at build time for the files that implement the listed functions. + +The following table shows the symbols generated by each of the four compiles for a function `Foo` in one of the above files (the `MP_BUILD_*` variables are used in both the autotools and CMake builds to indicate the precision of the compile). + +| Build Type / Function List | mup.fixed | mup.functions | mup.methods | +|----------------------------|---------------|---------------|---------------| +| MP_BUILD_SINGLE | Foo_flt | Foo_flt | Foo_flt | +| MP_BUILD_DOUBLE | Foo_dbl | Foo_dbl | Foo_dbl | +| MP_BUILD_LONGDOUBLE | Foo_long_dbl | Foo_long_dbl | Foo_long_dbl | +| No MP (standard compile) | Foo | Foo, Foo_pre | Foo, Foo_pre | + +For `mup.functions` and `mup.methods`, the `Foo` function calls `Foo_pre` together with a precision argument. Developers may call `Foo_pre` directly when writing mixed precision code. + +## Workflow for developers + +A high-level summary of the developer workflow is as follows, with additional details given below: +- Implement code as before. +- Run `mup_check` from the `src` directory and update function lists. +- Run `mup_code` from the `src` directory to generate multiprecision code. +- Compile and debug with mixed precision configured. +- Run `mup_clean` from the `src` directory to remove miscellaneous files. +- Commit code, including updated and newly generated multiprecision code. + +### Updating function lists + +Developers should implement, compile, and debug code as before. If any new functions are implemented, developers should run the following script from the `src` directory: +``` +mup_check +``` +This script will compile the code, extract all function names from the library file, and compare it to the existing `mup.*` function lists. If functions need to be adjusted in these lists, the script will indicate that an `UPDATE` is needed. Otherwise, it will indicate `OK`. Use the appropriate `mup_check.err` file to see what needs to be added or deleted. + +Functions should appear in only one of the `mup.*` function lists. The current guidance is to put all external user API functions (e.g., `HYPRE_Foo`) in either `mup.functions` or `mup.methods` [future feature], and put all other functions in `mup.fixed`. When writing mixed-precision code, developers may move functions from `mup.fixed` to either `mup.functions` or `mup.methods` [future feature] as needed (e.g., to make use of internal `hypre_Foo_pre` routines in mixed-precision AMG). + +### Generating new multiprecision code + +If any function lists are updated or any prototypes changed, it will be necessary to run the following script from the `src` directory: +``` +mup_code +``` +This top-level script calls individual `mup_code` scripts in each subdirectory to generate code in the files `mup_*.c` and to generate header information (e.g., prototypes and macros) in the files `HYPRE_*mup.h` and `_hypre_*mup*.h`. The individual `mup_code` scripts call additional scripts in the `src/config` directory, and they are tailored to each individual directory. In particular, some directories such as `ParaSails` do not require any wrapper code generation because user interfaces are provided by way of other directories such as `parcsr_ls`. Here, only certain header files are auto-generated. + diff --git a/src/examples/ex1.c b/src/examples/ex1.c index 4014768d06..68e1bc101b 100644 --- a/src/examples/ex1.c +++ b/src/examples/ex1.c @@ -146,7 +146,7 @@ int main (int argc, char *argv[]) /* Assign each of the 5 stencil entries */ for (entry = 0; entry < 5; entry++) { - HYPRE_StructStencilSetElement(stencil, entry, offsets[entry]); + HYPRE_StructStencilSetEntry(stencil, entry, offsets[entry]); } } } diff --git a/src/examples/ex17.c b/src/examples/ex17.c index 1ed86bbd59..06ad0e4283 100644 --- a/src/examples/ex17.c +++ b/src/examples/ex17.c @@ -166,13 +166,13 @@ int main (int argc, char *argv[]) { offset[d] = 0; } - HYPRE_StructStencilSetElement(stencil, entry++, offset); + HYPRE_StructStencilSetEntry(stencil, entry++, offset); for (d = 0; d < NDIM; d++) { offset[d] = -1; - HYPRE_StructStencilSetElement(stencil, entry++, offset); + HYPRE_StructStencilSetEntry(stencil, entry++, offset); offset[d] = 1; - HYPRE_StructStencilSetElement(stencil, entry++, offset); + HYPRE_StructStencilSetEntry(stencil, entry++, offset); offset[d] = 0; } } diff --git a/src/examples/ex2.c b/src/examples/ex2.c index 3e80377cad..99002f831e 100644 --- a/src/examples/ex2.c +++ b/src/examples/ex2.c @@ -167,7 +167,7 @@ int main (int argc, char *argv[]) /* Assign each of the 5 stencil entries */ for (entry = 0; entry < 5; entry++) { - HYPRE_StructStencilSetElement(stencil, entry, offsets[entry]); + HYPRE_StructStencilSetEntry(stencil, entry, offsets[entry]); } } } diff --git a/src/examples/ex3.c b/src/examples/ex3.c index 9b4596bc1f..866a394b8d 100644 --- a/src/examples/ex3.c +++ b/src/examples/ex3.c @@ -200,7 +200,7 @@ int main (int argc, char *argv[]) for (entry = 0; entry < 5; entry++) { - HYPRE_StructStencilSetElement(stencil, entry, offsets[entry]); + HYPRE_StructStencilSetEntry(stencil, entry, offsets[entry]); } } } diff --git a/src/examples/ex4.c b/src/examples/ex4.c index 202f0278bd..ef22961c50 100644 --- a/src/examples/ex4.c +++ b/src/examples/ex4.c @@ -445,7 +445,7 @@ int main (int argc, char *argv[]) /* Assign stencil entries */ for (i = 0; i < 5; i++) { - HYPRE_StructStencilSetElement(stencil, i, offsets[i]); + HYPRE_StructStencilSetEntry(stencil, i, offsets[i]); } } else /* Symmetric storage */ @@ -459,7 +459,7 @@ int main (int argc, char *argv[]) /* Assign stencil entries */ for (i = 0; i < 3; i++) { - HYPRE_StructStencilSetElement(stencil, i, offsets[i]); + HYPRE_StructStencilSetEntry(stencil, i, offsets[i]); } } diff --git a/src/examples/ex91.c b/src/examples/ex91.c new file mode 100644 index 0000000000..a989cd3f5c --- /dev/null +++ b/src/examples/ex91.c @@ -0,0 +1,1461 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 17 + + Interface: SStructured interface (SStruct) + + Compile with: make ex17 + + Sample run: mpirun -np 16 ex17 -n 40 -r 2 -solver 1 + + To see options: ex17 -help + + Description: + + This example uses the sstruct interface to solve a 2D + Laplacian problem on a cell-centered grid with two refined + regions. The discretization is based on a standard 5-point + finite difference scheme and illustrates the use of the + SStructGridSetAMR routines to define interpolation at ghost + cells to build the linear system. The grid is as follows: + + + ************************************************* + * | | | (N,N)* + * | | | * + * | | | * + * | | | * + * | | | * + *-----------|-----------*************-----------* + * | * | * * + * | * | * * + * | *-----|-----* * + * | * | * * + * | * | * * + *************************************-----------* + * | | | * ^ | * + * | | | * | | * + *-----|-----|-----|-----*<--part 1 | * + * | | | * | * + * | | | * | * + *-----|-----|-----|-----*-----------|-----------* + * | | | * | * + * | | | * | * + *-----|-----|-----|-----* | part 0 * + * | | | * | * + *(1,1)| | | * | * + ************************************************* + + The grid is constructed from two parts. Part 0 is the coarse + level and consists of one global box of size N x N. Part 1 + is a refinement of part 0 by factor r (pictured above is r=2) + and consists of a global box of size r*(N/2) x r*(N/2) and a + second box of size r*(N/4) x r*(N/4) . The value of N is + given by N=(4*s)*M, where s is an input parameter and M is + based on the number of processors (see below). + + The discretization is given by the standard 4,-1 stencil on + part 0 and the same stencil scaled by r^2 on part 1. The + coupling between parts is determined by interpolation and + restriction operators, P and R, through the Petrov-Galerkin + product, RAP. These operators are set up through a reference + coarse-fine interpolation template, followed by fix-ups at + certain grid locations. The index spaces on the two parts + are aligned such that cell (1,1) on the fine level is in the + lower-left corner of cell (1,1) on the coarse level. The + boundary conditions are zero Dirichlet conditions. + + The grid is parallelized by distributing each of the three + main grid boxes on an M x M process grid, so the number of + processes specified must be a perfect square. The solvers + available are various ParCSR solvers, including BoomerAMG. +*/ + +#include +#include "_hypre_utilities.h" +#include "HYPRE_krylov.h" +#include "HYPRE_sstruct_ls.h" + +#ifdef M_PI +#define PI M_PI +#else +#define PI 3.14159265358979 +#endif + +#include "vis.c" + +#define RMAX 10 + +/* Macro to evaluate a function F in the grid point (i,j) */ +#define Eval(F,i,j,ilo) (F( (ilo[0]+(i))*h, (ilo[1]+(j))*h )) + +int optionK, optionB, optionC, optionU0, optionF; + +/* Diffusion coefficient */ +double K(double x, double y) +{ + switch (optionK) + { + case 0: + return 1.0; + case 1: + return x * x + exp(y); + case 2: + 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) + { + return 10.0; + } + else + { + return 1.0; + } + default: + return 1.0; + } +} + +/* Convection vector, first component */ +double B1(double x, double y) +{ + switch (optionB) + { + case 0: + return 0.0; + case 1: + return -0.1; + case 2: + return 0.25; + case 3: + return 1.0; + default: + return 0.0; + } +} + +/* Convection vector, second component */ +double B2(double x, double y) +{ + switch (optionB) + { + case 0: + return 0.0; + case 1: + return 0.1; + case 2: + return -0.25; + case 3: + return 1.0; + default: + return 0.0; + } +} + +/* Reaction coefficient */ +double C(double x, double y) +{ + switch (optionC) + { + case 0: + return 0.0; + case 1: + return 10.0; + case 2: + return 100.0; + default: + return 0.0; + } +} + +/* Boundary condition */ +double U0(double x, double y) +{ + switch (optionU0) + { + case 0: + return 0.0; + case 1: + return (x + y) / 100; + case 2: + return (sin(5 * PI * x) + sin(5 * PI * y)) / 1000; + default: + return 0.0; + } +} + +/* Right-hand side */ +double F(double x, double y) +{ + switch (optionF) + { + case 0: + return 1.0; + case 1: + return 0.0; + case 2: + 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)) + { + return -1.0; + } + else + { + return 1.0; + } + case 4: + 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; + } +} + +int main (int argc, char *argv[]) +{ + int i, j, k; + + int myid, num_procs; + + int s, M, pi, pj; + double h, h2; + int *ilower, *iupper; + int ilower0[2], iupper0[2]; + int ilower1[2], iupper1[2]; + int ilower2[2], iupper2[2]; + + int solver_id; + int npre, npost; + int rap, relax, skip, sym; + int time_index; + + int object_type; + + int num_iterations; + double final_res_norm; + + int vis; + + HYPRE_SStructGrid grid; + HYPRE_SStructStencil stencil; + HYPRE_SStructGraph graph; + HYPRE_SStructMatrix A; + HYPRE_SStructVector b; + HYPRE_SStructVector x; + + /* We are using struct solvers for this example */ + HYPRE_StructSolver solver; + HYPRE_StructSolver precond; + + /* Initialize MPI */ + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &myid); + MPI_Comm_size(MPI_COMM_WORLD, &num_procs); + + /* Set default parameters */ + s = 10; + r = 2; + solver_id = 1; + npre = 1; + npost = 1; + + vis = 0; + + optionK = 0; + optionB = 0; + optionC = 0; + optionU0 = 0; + optionF = 0; + + /* Parse command line */ + { + int arg_index = 0; + int print_usage = 0; + + while (arg_index < argc) + { + if ( strcmp(argv[arg_index], "-s") == 0 ) + { + arg_index++; + s = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-K") == 0 ) + { + arg_index++; + optionK = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-B") == 0 ) + { + arg_index++; + optionB = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-C") == 0 ) + { + arg_index++; + optionC = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-U0") == 0 ) + { + arg_index++; + optionU0 = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-F") == 0 ) + { + arg_index++; + optionF = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-solver") == 0 ) + { + arg_index++; + solver_id = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-v") == 0 ) + { + arg_index++; + npre = atoi(argv[arg_index++]); + npost = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-rap") == 0 ) + { + arg_index++; + rap = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-relax") == 0 ) + { + arg_index++; + relax = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-skip") == 0 ) + { + arg_index++; + skip = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-sym") == 0 ) + { + arg_index++; + sym = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-vis") == 0 ) + { + arg_index++; + vis = 1; + } + else if ( strcmp(argv[arg_index], "-help") == 0 ) + { + print_usage = 1; + break; + } + else + { + arg_index++; + } + } + + if ((print_usage) && (myid == 0)) + { + printf("\n"); + printf("Usage: %s []\n", argv[0]); + printf("\n"); + printf(" -s : scale factor for base grid (default 10)\n"); + printf(" -K : diffusion coefficient choice (default 0)\n"); + printf(" -B : convection vector choice (default 0)\n"); + printf(" -C : reaction coefficient choice (default 0)\n"); + printf(" -U0 : boundary condition choice (default 0)\n"); + printf(" -F : right-hand side choice (default 0) \n"); + printf(" -solver : solver ID\n"); + printf(" 0 - SMG \n"); + printf(" 1 - PFMG\n"); + printf(" 10 - CG with SMG precond (default)\n"); + printf(" 11 - CG with PFMG precond\n"); + printf(" 17 - CG with 2-step Jacobi\n"); + printf(" 18 - CG with diagonal scaling\n"); + printf(" 19 - CG\n"); + printf(" 30 - GMRES with SMG precond\n"); + printf(" 31 - GMRES with PFMG precond\n"); + printf(" 37 - GMRES with 2-step Jacobi\n"); + printf(" 38 - GMRES with diagonal scaling\n"); + printf(" 39 - GMRES\n"); + printf(" -v : number of pre and post relaxations\n"); + printf(" -rap : coarse grid operator type\n"); + printf(" 0 - Galerkin (default)\n"); + printf(" 1 - non-Galerkin ParFlow operators\n"); + printf(" 2 - Galerkin, general operators\n"); + printf(" -relax : relaxation type\n"); + printf(" 0 - Jacobi\n"); + printf(" 1 - Weighted Jacobi (default)\n"); + printf(" 2 - R/B Gauss-Seidel\n"); + printf(" 3 - R/B Gauss-Seidel (nonsymmetric)\n"); + printf(" -skip : skip levels in PFMG (0 or 1)\n"); + printf(" -sym : symmetric storage (1) or not (0)\n"); + printf(" -vis : save solution for GLVis visualization\n"); + printf("\n"); + } + + if (print_usage) + { + MPI_Finalize(); + return (0); + } + } + + /* Figure out the processor grid (M x M). The local problem size is based on + s and r, while pi and pj indicate position in the processor grid. */ + M = sqrt(num_procs); + n0 = 4 * s; /* size of box0 is n0 x n0 */ + n1 = 2 * s * r; /* size of box1 is n1 x n1 */ + n2 = 1 * s * r; /* size of box2 is n2 x n2 */ + h0 = 1.0 / (n0 * M); /* grid spacing on part 0 */ + h1 = h0 / r; /* grid spacing on part 1 */ + pj = myid / M; + pi = myid - pj * M; + offi0 = pi * n0; /* offset for i index of box0 */ + offj0 = pj * n0; /* offset for j index of box0 */ + offi1 = pi * n1; /* offset for i index of box1 */ + offj1 = pj * n1; /* offset for j index of box1 */ + offi2 = pi * n2; /* offset for i index of box2 */ + offj2 = pj * n2; /* offset for j index of box2 */ + + nmax = ((n0 < n1) ? n0 : n1); /* max box size */ + + /* 1. Set up a 2D grid */ + { + int ndim = 2; + int nparts = 2; + int nvars = 1; + int ilower0[2] = {offi0 + 1, offj0 + 1 }; + int iupper0[2] = {offi0 + n0, offj0 + n0}; + int ilower1[2] = {offi1 + 1, offj1 + 1 }; + int iupper1[2] = {offi1 + n1, offj1 + n1}; + int ilower2[2] = {offi2 + 1, offj2 + 1 }; + int iupper2[2] = {offi2 + n2, offj2 + n2}; + int coarse_part = 0; + int fine_part = 1; + int var = 0; + int i; + + /* Create an empty 2D grid object */ + HYPRE_SStructGridCreate(MPI_COMM_WORLD, ndim, nparts, &grid); + + /* Set the object type for the system. See GetAMRObjects() below. */ + object_type = HYPRE_PARCSR; + HYPRE_SStructGridSetObjectType(grid, object_type); + + /* Add the box on the coarse grid part 0 */ + HYPRE_SStructGridSetExtents(grid, coarse_part, ilower0, iupper0); + + /* Add the boxes on the fine grid part 1 */ + HYPRE_SStructGridSetExtents(grid, fine_part, ilower1, iupper1); + HYPRE_SStructGridSetExtents(grid, fine_part, ilower2, iupper2); + + /* Set the variable type for each part */ + { + HYPRE_SStructVariable vartypes[1] = {HYPRE_SSTRUCT_VARIABLE_CELL}; + + for (i = 0; i < nparts; i++) + { + HYPRE_SStructGridSetVariables(grid, i, nvars, vartypes); + } + } + + /* Declare fine part 1 to be a refinement of coarse part 0 with a given + * refinement factor (rfactors) and index alignment */ + { + int coarse_index[2] = {1, 1}; + int fine_index[2] = {1, 1}; + int rfactors[2] = {r, r}; + + HYPRE_SStructGridSetAMRPart(grid, coarse_part, fine_part, + coarse_index, fine_index, rfactors); + } + + /* Define interpolation and restriction on the reference coarse-fine + * template and fix up interpolation at certain specific grid locations. + * For interpolation, use bilinear between both coarse and fine real + * variables. For restriction, decouple fine slave variables from all + * real variables (injection). */ + { + int row, nvalues, vars[4], cf[4], indexes[8]; + double values[4]; + int edge; + double v1[RMAX][2], s; + + /* Set linear interpolation values and indexes in 1D. + * + * Examples: + * r=2: v1 = [3/4,1/4,0] [3/4,0,1/4] + * r=3: v1 = [2/3,1/3,0] [1,0,0] [2/3,0,1/3] + * r=4: v1 = [5/8,3/8,0] [7/8,1/8,0] [7/8,0,1/8] [5/8,0,3/8] + * r=5: v1 = [3/5,2/5,0] [4/5,1/5,0] [1,0,0] [4/5,0,1/5] [3/5,0,2/5] + */ + + for (i = 0; i < r / 2; i++) + { + j = r - 1 - i; + s = (r + 1 + 2 * i) / (2 * r); + v1[i][0] = s; v1[i][1] = 1 - s; v1[i][2] = 0; + v1[j][0] = s; v1[j][1] = 0; v1[j][2] = 1 - s; + } + if (r % 2) /* odd case - set middle values */ + { + i = r / 2; + v1[i][0] = 1; v1[i][1] = 0; v1[i][2] = 0; + } + + /* Set up interpolation in the reference coarse-fine template. */ + vars[0] = 0; cf[0] = 0; /* coarse */ + vars[1] = 0; cf[1] = 0; /* coarse */ + vars[2] = 0; cf[2] = 0; /* coarse */ + for (i = 0; i < r; i++) + { + vars[3 + i] = 0; cf[3 + i] = 1; /* fine */ + } + t = 2 / (r + 1); + for (edge = 0; edge < 4; edge++) + { + cvalues[0] = 0; + cvalues[1] = 0; + cvalues[2] = 0; + for (i = 0; i < r; i++) + { + values[0] = t * v1[i][0]; + values[1] = t * v1[i][1]; + values[2] = t * v1[i][2]; + values[3] = (1 - t); + switch (edge) + { + case 0: /* west edge */ + index[0] = -1; index[1] = i; + indexes[0] = -1; indexes[1] = 0; /* coarse */ + indexes[2] = -1; indexes[3] = -1; /* coarse */ + indexes[4] = -1; indexes[5] = 1; /* coarse */ + indexes[6] = 0; indexes[7] = i; /* fine */ + cindex[0] = -1; cindex[1] = 0; + break; + case 1: /* east edge */ + index[0] = r; index[1] = i; + indexes[0] = 1; indexes[1] = 0; /* coarse */ + indexes[2] = 1; indexes[3] = -1; /* coarse */ + indexes[4] = 1; indexes[5] = 1; /* coarse */ + indexes[6] = r; indexes[7] = i; /* fine */ + cindex[0] = 1; cindex[1] = 0; + break; + case 2: /* south edge */ + index[0] = i; index[1] = -1; + indexes[0] = 0; indexes[1] = -1; /* coarse */ + indexes[2] = -1; indexes[3] = -1; /* coarse */ + indexes[4] = 1; indexes[5] = -1; /* coarse */ + indexes[6] = i; indexes[7] = 0; /* fine */ + cindex[0] = 0; cindex[1] = -1; + break; + case 3: /* north edge */ + index[0] = i; index[1] = r; + indexes[0] = 0; indexes[1] = 1; /* coarse */ + indexes[2] = -1; indexes[3] = 1; /* coarse */ + indexes[4] = 1; indexes[5] = 1; /* coarse */ + indexes[6] = i; indexes[7] = r; /* fine */ + cindex[0] = 0; cindex[1] = 1; + break; + } + cvalues[0] += values[0]; + cvalues[1] += values[1]; + cvalues[2] += values[2]; + cvalues[3 + i] = values[3]; + cindexes[0] = indexes[0]; cindexes[1] = indexes[1]; + cindexes[2] = indexes[2]; cindexes[3] = indexes[3]; + cindexes[4] = indexes[4]; cindexes[5] = indexes[5]; + cindexes[6 + 2 * i] = indexes[6]; cindexes[7 + 2 * i] = indexes[7]; + + nvalues = 4; + HYPRE_SStructGridSetAMRRefInterp( + grid, coarse_part, 1, var, index, + nvalues, vars, cf, indexes, values); + nvalues = 0; + HYPRE_SStructGridSetAMRRefRestrictT( + grid, coarse_part, 1, var, index, + nvalues, vars, cf, indexes, values); + } + nvalues = 3 + r; + HYPRE_SStructGridSetAMRRefInterp( + grid, coarse_part, 0, var, cindex, + nvalues, vars, cf, cindexes, cvalues); + } + +#if 0 + /* Fix up interpolation at certain grid locations (later) */ + HYPRE_SStructGridSetAMRInterp( + grid, coarse_part, coarse_index, 1, var, index, + nvalues, vars, cf, indexes, values); +#endif + } + +#if 0 + HYPRE_SStructGetAMRObjects(HYPRE_SStructMatrix matrix, + HYPRE_SStructVector rhs, + void **matrix_object, + void **rhs_object); +#endif + + /* This is a collective call finalizing the grid assembly. + The grid is now ``ready to be used'' */ + HYPRE_SStructGridAssemble(grid); + } + + /* 2. Define the discretization stencil */ + { + int ndim = 2; + int var = 0; + + /* Define the geometry of the stencil */ + int offsets[5][2] = {{0, 0}, {-1, 0}, {1, 0}, {0, -1}, {0, 1}}; + + /* Create an empty 2D, 5-pt stencil object */ + HYPRE_SStructStencilCreate(ndim, 5, &stencil); + + /* Assign stencil entries */ + for (i = 0; i < 5; i++) + { + HYPRE_SStructStencilSetEntry(stencil, i, offsets[i], var); + } + } + + /* 3. Set up the Graph - this determines the non-zero structure + of the matrix */ + { + int var = 0; + int part = 0; + + /* Create the graph object */ + HYPRE_SStructGraphCreate(MPI_COMM_WORLD, grid, &graph); + + /* 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)*/ + HYPRE_SStructGraphSetStencil(graph, part, var, stencil); + + /* Assemble the graph */ + HYPRE_SStructGraphAssemble(graph); + } + + /* 4. Set up SStruct Vectors for b and x */ + { + double *values; + int var = 0; + + /* Create an empty vector object */ + HYPRE_SStructVectorCreate(MPI_COMM_WORLD, grid, &b); + HYPRE_SStructVectorCreate(MPI_COMM_WORLD, grid, &x); + + /* Indicate that the vector coefficients are ready to be set */ + HYPRE_SStructVectorInitialize(b); + HYPRE_SStructVectorInitialize(x); + + values = calloc((nmax * nmax), sizeof(double)); + + for (bi = 0; bi < 3; bi++) + { + part = bpart[bi]; + ilower = bilower[bi]; + iupper = biupper[bi]; + h2 = bh[bi]; + n = iupper - ilower + 1; + + /* 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, ilower); + } + HYPRE_SStructVectorSetBoxValues(b, part, ilower, iupper, var, values); + + /* Set x = 0 */ + for (i = 0; i < (n * n); i ++) + { + values[i] = 0.0; + } + HYPRE_SStructVectorSetBoxValues(x, part, ilower, iupper, var, values); + } + + free(values); + + /* Assembling is postponed since the vectors will be further modified */ + } + + /* 4. Set up a SStruct Matrix */ + { + int stencil_indices[5] = {0, 1, 2, 3, 4}; /* labels correspond to offsets */ + double *values; + int var = 0; + + /* Create an empty matrix object */ + HYPRE_SStructMatrixCreate(MPI_COMM_WORLD, graph, &A); + + /* Use symmetric storage? The function below is for symmetric stencil entries + (use HYPRE_SStructMatrixSetNSSymmetric for non-stencil entries) */ + HYPRE_SStructMatrixSetSymmetric(A, part, var, var, sym); + + /* Indicate that the matrix coefficients are ready to be set */ + HYPRE_SStructMatrixInitialize(A); + + values = calloc(5 * (n * n), sizeof(double)); + + /* Set the stencil values in the interior. Here we set the values + at every node. We will modify the boundary nodes later. */ + for (bi = 0; bi < 3; bi++) + { + part = bpart[bi]; + ilower = bilower[bi]; + iupper = biupper[bi]; + h2 = bh[bi]; + n = iupper - ilower + 1; + + /* 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) + { + values[k + 1] = - Eval(K, i - 0.5, j, ilower) - Eval(B1, i - 0.5, j, ilower); + + values[k + 2] = - Eval(K, i + 0.5, j, ilower) + Eval(B1, i + 0.5, j, ilower); + + values[k + 3] = - Eval(K, i, j - 0.5, ilower) - Eval(B2, i, j - 0.5, ilower); + + values[k + 4] = - Eval(K, i, j + 0.5, ilower) + Eval(B2, i, j + 0.5, ilower); + + values[k] = h2 * Eval(C, i, j, ilower) + + Eval(K, i - 0.5, j, ilower) + Eval(K, i + 0.5, j, ilower) + + Eval(K, i, j - 0.5, ilower) + Eval(K, i, j + 0.5, ilower) + - Eval(B1, i - 0.5, j, ilower) + Eval(B1, i + 0.5, j, ilower) + - Eval(B2, i, j - 0.5, ilower) + Eval(B2, i, j + 0.5, ilower); + } + + HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, var, + 5, stencil_indices, values); + } + + free(values); + } + + /* 5. Set the boundary conditions, while eliminating the coefficients + reaching ouside of the domain boundary. We must modify the matrix + stencil and the corresponding rhs entries. */ + { + int bc_ilower[2]; + int bc_iupper[2]; + + int stencil_indices[5] = {0, 1, 2, 3, 4}; + double *values, *bvalues; + + int nentries; + + /* We have one part and one variable. */ + int part = 0; + int var = 0; + + nentries = 5; + + values = calloc(nentries * n, sizeof(double)); + bvalues = 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) + { + values[i] = 1.0; + for (j = 1; j < nentries; j++) + { + values[i + j] = 0.0; + } + } + + /* Processors at y = 0 */ + if (pj == 0) + { + bc_ilower[0] = pi * n; + bc_ilower[1] = pj * n; + + bc_iupper[0] = bc_ilower[0] + n - 1; + bc_iupper[1] = bc_ilower[1]; + + /* Modify the matrix */ + HYPRE_SStructMatrixSetBoxValues(A, part, bc_ilower, bc_iupper, + var, nentries, + stencil_indices, values); + + /* Put the boundary conditions in b */ + for (i = 0; i < n; i++) + { + bvalues[i] = bcEval(U0, i, 0); + } + + HYPRE_SStructVectorSetBoxValues(b, part, bc_ilower, + bc_iupper, var, bvalues); + } + + /* Processors at y = 1 */ + if (pj == N - 1) + { + bc_ilower[0] = pi * n; + bc_ilower[1] = pj * n + n - 1; + + bc_iupper[0] = bc_ilower[0] + n - 1; + bc_iupper[1] = bc_ilower[1]; + + /* Modify the matrix */ + HYPRE_SStructMatrixSetBoxValues(A, part, bc_ilower, bc_iupper, + var, nentries, + stencil_indices, values); + + /* Put the boundary conditions in b */ + for (i = 0; i < n; i++) + { + bvalues[i] = bcEval(U0, i, 0); + } + + HYPRE_SStructVectorSetBoxValues(b, part, bc_ilower, bc_iupper, var, bvalues); + } + + /* Processors at x = 0 */ + if (pi == 0) + { + bc_ilower[0] = pi * n; + bc_ilower[1] = pj * n; + + bc_iupper[0] = bc_ilower[0]; + bc_iupper[1] = bc_ilower[1] + n - 1; + + /* Modify the matrix */ + HYPRE_SStructMatrixSetBoxValues(A, part, bc_ilower, bc_iupper, + var, nentries, + stencil_indices, values); + + /* Put the boundary conditions in b */ + for (j = 0; j < n; j++) + { + bvalues[j] = bcEval(U0, 0, j); + } + + HYPRE_SStructVectorSetBoxValues(b, part, bc_ilower, bc_iupper, + var, bvalues); + } + + /* Processors at x = 1 */ + if (pi == N - 1) + { + 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; + + /* Modify the matrix */ + HYPRE_SStructMatrixSetBoxValues(A, part, bc_ilower, bc_iupper, + var, nentries, + stencil_indices, values); + + /* Put the boundary conditions in b */ + for (j = 0; j < n; j++) + { + bvalues[j] = bcEval(U0, 0, j); + } + + HYPRE_SStructVectorSetBoxValues(b, part, bc_ilower, bc_iupper, + var, bvalues); + } + + /* Recall that the system we are solving is: + [A_ii 0; 0 I] [x_i ; x_b] = [b_i - A_ib u_0; u_0]. + This requires removing the connections between the interior + and boundary nodes that we have set up when we set the + 5pt stencil at each node. We adjust for removing + these connections by appropriately modifying the rhs. + For the symm ordering scheme, just do the top and right + boundary */ + + /* Processors at y = 0, neighbors of boundary nodes */ + if (pj == 0) + { + bc_ilower[0] = pi * n; + bc_ilower[1] = pj * 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; + } + + HYPRE_SStructMatrixSetBoxValues(A, part, bc_ilower, bc_iupper, + var, 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)); + } + + if (pi == 0) + { + bvalues[0] = 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) */ + HYPRE_SStructVectorAddToBoxValues(b, part, bc_ilower, bc_iupper, + var, bvalues); + } + + /* Processors at x = 0, neighbors of boundary nodes */ + if (pi == 0) + { + 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; + + stencil_indices[0] = 1; + + /* Modify the matrix */ + for (j = 0; j < n; j++) + { + bvalues[j] = 0.0; + } + + HYPRE_SStructMatrixSetBoxValues(A, part, bc_ilower, bc_iupper, + var, 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)); + } + + if (pj == 0) + { + bvalues[0] = 0.0; + } + + if (pj == N - 1) + { + bvalues[n - 1] = 0.0; + } + + HYPRE_SStructVectorAddToBoxValues(b, part, bc_ilower, bc_iupper, var, bvalues); + } + + /* Processors at y = 1, neighbors of boundary nodes */ + if (pj == N - 1) + { + bc_ilower[0] = pi * n; + bc_ilower[1] = pj * n + (n - 1) - 1; + + bc_iupper[0] = bc_ilower[0] + n - 1; + bc_iupper[1] = bc_ilower[1]; + + stencil_indices[0] = 4; + + /* Modify the matrix */ + for (i = 0; i < n; i++) + { + bvalues[i] = 0.0; + } + + HYPRE_SStructMatrixSetBoxValues(A, part, bc_ilower, bc_iupper, var, 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)); + } + + if (pi == 0) + { + bvalues[0] = 0.0; + } + + if (pi == N - 1) + { + bvalues[n - 1] = 0.0; + } + + HYPRE_SStructVectorAddToBoxValues(b, part, bc_ilower, bc_iupper, + var, bvalues); + } + + /* Processors at x = 1, neighbors of boundary nodes */ + if (pi == N - 1) + { + 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; + + stencil_indices[0] = 2; + + /* Modify the matrix */ + for (j = 0; j < n; j++) + { + bvalues[j] = 0.0; + } + + HYPRE_SStructMatrixSetBoxValues(A, part, bc_ilower, bc_iupper, + var, 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)); + } + + if (pj == 0) + { + bvalues[0] = 0.0; + } + + if (pj == N - 1) + { + bvalues[n - 1] = 0.0; + } + + HYPRE_SStructVectorAddToBoxValues(b, part, bc_ilower, bc_iupper, var, bvalues); + } + + free(values); + free(bvalues); + } + + /* Finalize the vector and matrix assembly */ + HYPRE_SStructMatrixAssemble(A); + HYPRE_SStructVectorAssemble(b); + HYPRE_SStructVectorAssemble(x); + + /* 6. Set up and use a solver */ + { + HYPRE_StructMatrix sA; + HYPRE_StructVector sb; + HYPRE_StructVector sx; + + /* 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 */ + + HYPRE_SStructMatrixGetObject(A, (void **) &sA); + HYPRE_SStructVectorGetObject(b, (void **) &sb); + HYPRE_SStructVectorGetObject(x, (void **) &sx); + + if (solver_id == 0) /* SMG */ + { + /* Start timing */ + time_index = hypre_InitializeTiming("SMG Setup"); + hypre_BeginTiming(time_index); + + /* Options and setup */ + HYPRE_StructSMGCreate(MPI_COMM_WORLD, &solver); + HYPRE_StructSMGSetMemoryUse(solver, 0); + HYPRE_StructSMGSetMaxIter(solver, 50); + HYPRE_StructSMGSetTol(solver, 1.0e-06); + HYPRE_StructSMGSetRelChange(solver, 0); + HYPRE_StructSMGSetNumPreRelax(solver, npre); + HYPRE_StructSMGSetNumPostRelax(solver, npost); + HYPRE_StructSMGSetPrintLevel(solver, 1); + HYPRE_StructSMGSetLogging(solver, 1); + HYPRE_StructSMGSetup(solver, sA, sb, sx); + + /* Finalize current timing */ + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + /* Start timing again */ + time_index = hypre_InitializeTiming("SMG Solve"); + hypre_BeginTiming(time_index); + + /* Solve */ + HYPRE_StructSMGSolve(solver, sA, sb, sx); + hypre_EndTiming(time_index); + /* Finalize current timing */ + + hypre_PrintTiming("Solve phase times", MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + /* Get info and release memory */ + HYPRE_StructSMGGetNumIterations(solver, &num_iterations); + HYPRE_StructSMGGetFinalRelativeResidualNorm(solver, &final_res_norm); + HYPRE_StructSMGDestroy(solver); + } + + if (solver_id == 1) /* PFMG */ + { + /* Start timing */ + time_index = hypre_InitializeTiming("PFMG Setup"); + hypre_BeginTiming(time_index); + + /* Options and setup */ + HYPRE_StructPFMGCreate(MPI_COMM_WORLD, &solver); + HYPRE_StructPFMGSetMaxIter(solver, 50); + HYPRE_StructPFMGSetTol(solver, 1.0e-06); + HYPRE_StructPFMGSetRelChange(solver, 0); + HYPRE_StructPFMGSetRAPType(solver, rap); + HYPRE_StructPFMGSetRelaxType(solver, relax); + HYPRE_StructPFMGSetNumPreRelax(solver, npre); + HYPRE_StructPFMGSetNumPostRelax(solver, npost); + HYPRE_StructPFMGSetSkipRelax(solver, skip); + HYPRE_StructPFMGSetPrintLevel(solver, 1); + HYPRE_StructPFMGSetLogging(solver, 1); + HYPRE_StructPFMGSetup(solver, sA, sb, sx); + + /* Finalize current timing */ + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + /* Start timing again */ + time_index = hypre_InitializeTiming("PFMG Solve"); + hypre_BeginTiming(time_index); + + /* Solve */ + HYPRE_StructPFMGSolve(solver, sA, sb, sx); + + /* Finalize current timing */ + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + /* Get info and release memory */ + HYPRE_StructPFMGGetNumIterations(solver, &num_iterations); + HYPRE_StructPFMGGetFinalRelativeResidualNorm(solver, &final_res_norm); + HYPRE_StructPFMGDestroy(solver); + } + + /* Preconditioned CG */ + if ((solver_id > 9) && (solver_id < 20)) + { + time_index = hypre_InitializeTiming("PCG Setup"); + hypre_BeginTiming(time_index); + + HYPRE_StructPCGCreate(MPI_COMM_WORLD, &solver); + HYPRE_StructPCGSetMaxIter(solver, 200 ); + HYPRE_StructPCGSetTol(solver, 1.0e-06 ); + HYPRE_StructPCGSetTwoNorm(solver, 1 ); + HYPRE_StructPCGSetRelChange(solver, 0 ); + HYPRE_StructPCGSetPrintLevel(solver, 2 ); + + if (solver_id == 10) + { + /* use symmetric SMG as preconditioner */ + HYPRE_StructSMGCreate(MPI_COMM_WORLD, &precond); + HYPRE_StructSMGSetMemoryUse(precond, 0); + HYPRE_StructSMGSetMaxIter(precond, 1); + HYPRE_StructSMGSetTol(precond, 0.0); + HYPRE_StructSMGSetZeroGuess(precond); + HYPRE_StructSMGSetNumPreRelax(precond, npre); + HYPRE_StructSMGSetNumPostRelax(precond, npost); + HYPRE_StructSMGSetPrintLevel(precond, 0); + HYPRE_StructSMGSetLogging(precond, 0); + HYPRE_StructPCGSetPrecond(solver, + HYPRE_StructSMGSolve, + HYPRE_StructSMGSetup, + precond); + } + + else if (solver_id == 11) + { + /* use symmetric PFMG as preconditioner */ + HYPRE_StructPFMGCreate(MPI_COMM_WORLD, &precond); + HYPRE_StructPFMGSetMaxIter(precond, 1); + HYPRE_StructPFMGSetTol(precond, 0.0); + HYPRE_StructPFMGSetZeroGuess(precond); + HYPRE_StructPFMGSetRAPType(precond, rap); + HYPRE_StructPFMGSetRelaxType(precond, relax); + HYPRE_StructPFMGSetNumPreRelax(precond, npre); + HYPRE_StructPFMGSetNumPostRelax(precond, npost); + HYPRE_StructPFMGSetSkipRelax(precond, skip); + HYPRE_StructPFMGSetPrintLevel(precond, 0); + HYPRE_StructPFMGSetLogging(precond, 0); + HYPRE_StructPCGSetPrecond(solver, + HYPRE_StructPFMGSolve, + HYPRE_StructPFMGSetup, + precond); + } + + else if (solver_id == 17) + { + /* use two-step Jacobi as preconditioner */ + HYPRE_StructJacobiCreate(MPI_COMM_WORLD, &precond); + HYPRE_StructJacobiSetMaxIter(precond, 2); + HYPRE_StructJacobiSetTol(precond, 0.0); + HYPRE_StructJacobiSetZeroGuess(precond); + HYPRE_StructPCGSetPrecond( solver, + HYPRE_StructJacobiSolve, + HYPRE_StructJacobiSetup, + precond); + } + + else if (solver_id == 18) + { + /* use diagonal scaling as preconditioner */ + precond = NULL; + HYPRE_StructPCGSetPrecond(solver, + HYPRE_StructDiagScale, + HYPRE_StructDiagScaleSetup, + precond); + } + + /* PCG Setup */ + HYPRE_StructPCGSetup(solver, sA, sb, sx ); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + time_index = hypre_InitializeTiming("PCG Solve"); + hypre_BeginTiming(time_index); + + /* PCG Solve */ + HYPRE_StructPCGSolve(solver, sA, sb, sx); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + /* Get info and release memory */ + HYPRE_StructPCGGetNumIterations( solver, &num_iterations ); + HYPRE_StructPCGGetFinalRelativeResidualNorm( solver, &final_res_norm ); + HYPRE_StructPCGDestroy(solver); + + if (solver_id == 10) + { + HYPRE_StructSMGDestroy(precond); + } + else if (solver_id == 11 ) + { + HYPRE_StructPFMGDestroy(precond); + } + else if (solver_id == 17) + { + HYPRE_StructJacobiDestroy(precond); + } + } + + /* Preconditioned GMRES */ + if ((solver_id > 29) && (solver_id < 40)) + { + time_index = hypre_InitializeTiming("GMRES Setup"); + hypre_BeginTiming(time_index); + + HYPRE_StructGMRESCreate(MPI_COMM_WORLD, &solver); + + /* Note that GMRES can be used with all the interfaces - not + just the struct. So here we demonstrate the + more generic GMRES interface functions. Since we have chosen + a struct solver then we must type cast to the more generic + HYPRE_Solver when setting options with these generic functions. + Note that one could declare the solver to be + type HYPRE_Solver, and then the casting would not be necessary.*/ + + HYPRE_GMRESSetMaxIter((HYPRE_Solver) solver, 500 ); + 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 ); + + if (solver_id == 30) + { + /* use symmetric SMG as preconditioner */ + HYPRE_StructSMGCreate(MPI_COMM_WORLD, &precond); + HYPRE_StructSMGSetMemoryUse(precond, 0); + HYPRE_StructSMGSetMaxIter(precond, 1); + HYPRE_StructSMGSetTol(precond, 0.0); + HYPRE_StructSMGSetZeroGuess(precond); + HYPRE_StructSMGSetNumPreRelax(precond, npre); + HYPRE_StructSMGSetNumPostRelax(precond, npost); + HYPRE_StructSMGSetPrintLevel(precond, 0); + HYPRE_StructSMGSetLogging(precond, 0); + HYPRE_StructGMRESSetPrecond(solver, + HYPRE_StructSMGSolve, + HYPRE_StructSMGSetup, + precond); + } + + else if (solver_id == 31) + { + /* use symmetric PFMG as preconditioner */ + HYPRE_StructPFMGCreate(MPI_COMM_WORLD, &precond); + HYPRE_StructPFMGSetMaxIter(precond, 1); + HYPRE_StructPFMGSetTol(precond, 0.0); + HYPRE_StructPFMGSetZeroGuess(precond); + HYPRE_StructPFMGSetRAPType(precond, rap); + HYPRE_StructPFMGSetRelaxType(precond, relax); + HYPRE_StructPFMGSetNumPreRelax(precond, npre); + HYPRE_StructPFMGSetNumPostRelax(precond, npost); + HYPRE_StructPFMGSetSkipRelax(precond, skip); + HYPRE_StructPFMGSetPrintLevel(precond, 0); + HYPRE_StructPFMGSetLogging(precond, 0); + HYPRE_StructGMRESSetPrecond( solver, + HYPRE_StructPFMGSolve, + HYPRE_StructPFMGSetup, + precond); + } + + else if (solver_id == 37) + { + /* use two-step Jacobi as preconditioner */ + HYPRE_StructJacobiCreate(MPI_COMM_WORLD, &precond); + HYPRE_StructJacobiSetMaxIter(precond, 2); + HYPRE_StructJacobiSetTol(precond, 0.0); + HYPRE_StructJacobiSetZeroGuess(precond); + HYPRE_StructGMRESSetPrecond( solver, + HYPRE_StructJacobiSolve, + HYPRE_StructJacobiSetup, + precond); + } + + else if (solver_id == 38) + { + /* use diagonal scaling as preconditioner */ + precond = NULL; + HYPRE_StructGMRESSetPrecond( solver, + HYPRE_StructDiagScale, + HYPRE_StructDiagScaleSetup, + precond); + } + + /* GMRES Setup */ + HYPRE_StructGMRESSetup(solver, sA, sb, sx ); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + time_index = hypre_InitializeTiming("GMRES Solve"); + hypre_BeginTiming(time_index); + + /* GMRES Solve */ + HYPRE_StructGMRESSolve(solver, sA, sb, sx); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + /* Get info and release memory */ + HYPRE_StructGMRESGetNumIterations(solver, &num_iterations); + HYPRE_StructGMRESGetFinalRelativeResidualNorm(solver, &final_res_norm); + HYPRE_StructGMRESDestroy(solver); + + if (solver_id == 30) + { + HYPRE_StructSMGDestroy(precond); + } + else if (solver_id == 31) + { + HYPRE_StructPFMGDestroy(precond); + } + else if (solver_id == 37) + { + HYPRE_StructJacobiDestroy(precond); + } + } + + } + + /* Save the solution for GLVis visualization, see vis/glvis-ex7.sh */ + if (vis) + { + FILE *file; + char filename[255]; + + int part = 0, var = 0; + int nvalues = n * n; + double *values = calloc(nvalues, sizeof(double)); + + /* get all local data (including a local copy of the shared values) */ + HYPRE_SStructVectorGetBoxValues(x, part, ilower, iupper, + var, values); + + sprintf(filename, "%s.%06d", "vis/ex7.sol", myid); + if ((file = fopen(filename, "w")) == NULL) + { + printf("Error: can't open output file %s\n", filename); + MPI_Finalize(); + exit(1); + } + + /* save solution with global unknown numbers */ + 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++]); + } + + fflush(file); + fclose(file); + free(values); + + /* save global finite element mesh */ + if (myid == 0) + { + GLVis_PrintGlobalSquareMesh("vis/ex7.mesh", N * n - 1); + } + } + + if (myid == 0) + { + printf("\n"); + printf("Iterations = %d\n", num_iterations); + printf("Final Relative Residual Norm = %e\n", final_res_norm); + printf("\n"); + } + + /* Free memory */ + HYPRE_SStructGridDestroy(grid); + HYPRE_SStructStencilDestroy(stencil); + HYPRE_SStructGraphDestroy(graph); + HYPRE_SStructMatrixDestroy(A); + HYPRE_SStructVectorDestroy(b); + HYPRE_SStructVectorDestroy(x); + + /* Finalize MPI */ + MPI_Finalize(); + + return (0); +} diff --git a/src/examples/ex92.c b/src/examples/ex92.c new file mode 100644 index 0000000000..16cc3bad16 --- /dev/null +++ b/src/examples/ex92.c @@ -0,0 +1,1096 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 15 + + Interface: Semi-Structured interface (SStruct) + + Compile with: make ex15 + + Sample run: mpirun -np 8 ex15 -n 10 + + To see options: ex15 -help + + Description: + + This code solves a 3D electromagnetic diffusion (definite + curl-curl) problem using the lowest order Nedelec, or "edge" + finite element discretization on a uniform hexahedral meshing + of the unit cube with a refinement region of factor r in the + first octant of the mesh. The right-hand-side corresponds to + a unit vector force and we use uniform zero Dirichlet + boundary conditions. The overall problem reads: curl alpha + curl E + beta E = 1, with E x n = 0 on the boundary, where + alpha and beta are piecewise-constant material coefficients. + + The grid is constructed from two parts with a global coarse + grid of size N x N x N on part 0 and a global fine grid of + size R x R x R on part 1. Each part is distributed across an + M x M x M processor grid, hence the number of processors + specified should be a perfect cube. The value of N is given + by N=(2*s)*M, where s is an input parameter, and R=r*(N/2) is + the size of the refined octant. The index spaces on the two + parts are aligned such that cell (1,1) on the fine level is + in the lower-left corner of cell (1,1) on the coarse level. + + This example code is mainly meant as an illustration of using + the Auxiliary-space Maxwell Solver (AMS) through the SStruct + interface on an AMR mesh. We recommend viewing Example 15 + before viewing this example. */ + +#include +#include "_hypre_utilities.h" +#include "HYPRE_sstruct_mv.h" +#include "HYPRE_sstruct_ls.h" +#include "_hypre_parcsr_ls.h" +#include "HYPRE.h" + +#include "vis.c" + +int optionAlpha, optionBeta; + +/* Curl-curl coefficient alpha = mu^{-1} */ +double alpha(double x, double y, double z) +{ + switch (optionAlpha) + { + case 0: /* uniform coefficient */ + return 1.0; + case 1: /* smooth coefficient */ + 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)) + { + 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) + { + return 1.0; + } + else + { + return 1.0e-6; + } + case 4: /* random coefficient */ + return hypre_Rand(); + default: + return 1.0; + } +} + +/* Mass coefficient beta = sigma */ +double beta(double x, double y, double z) +{ + switch (optionBeta) + { + case 0: /* uniform coefficient */ + return 1.0; + case 1: /* smooth coefficient */ + 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)) + { + 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) + { + return 1.0; + } + else + { + return 1.0e-6; + } + case 4: /* random coefficient */ + return hypre_Rand(); + default: + return 1.0; + } +} + +/* + This routine computes the lowest order Nedelec, or "edge" finite element + stiffness matrix and load vector on a cube of size h. The 12 edges {e_i} + are numbered in terms of the vertices as follows: + + [7]------[6] + /| /| e_0 = 01, e_1 = 12, e_2 = 32, e_3 = 03, + / | / | e_4 = 45, e_5 = 56, e_6 = 76, e_7 = 47, + [4]------[5] | e_8 = 04, e_9 = 15, e_10 = 26, e_11 = 37. + | [3]----|-[2] + | / | / The edges are oriented from first to the + |/ |/ second vertex, e.g. e_0 is from [0] to [1]. + [0]------[1] + + We allow for different scaling of the curl-curl and the mass parts of the + matrix with coefficients alpha and beta respectively: + + S_ij = alpha (curl phi_i,curl phi_j) + beta (phi_i, phi_j). + + The load vector corresponding to a right-hand side of {1,1,1} is + + F_j = (1,phi_j) = h^2/4. +*/ +void ComputeFEMND1(double S[12][12], double F[12], index[3], double h) +{ + int i, j; + + double h2_4 = h * h / 4; + + double x = index[0] * h - h / 2; + double y = index[1] * h - h / 2; + double z = index[2] * h - h / 2; + + 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; + S[ 0][ 6] = -cS2 + cM1; S[ 0][ 7] = -cS1; S[ 0][ 8] = -cS2; + S[ 0][ 9] = cS2; S[ 0][10] = cS1; S[ 0][11] = -cS1; + + S[ 1][ 1] = cS4 + cM4; S[ 1][ 2] = -cS2; S[ 1][ 3] = -cS1 + cM2; + S[ 1][ 4] = cS1; S[ 1][ 5] = -cS1 + cM2; S[ 1][ 6] = -cS1; + S[ 1][ 7] = -cS2 + cM1; S[ 1][ 8] = -cS1; S[ 1][ 9] = -cS2; + S[ 1][10] = cS2; S[ 1][11] = cS1; + + S[ 2][ 2] = cS4 + cM4; S[ 2][ 3] = cS2; S[ 2][ 4] = -cS2 + cM1; + S[ 2][ 5] = -cS1; S[ 2][ 6] = -cS1 + cM2; S[ 2][ 7] = cS1; + S[ 2][ 8] = -cS1; S[ 2][ 9] = cS1; S[ 2][10] = cS2; + S[ 2][11] = -cS2; + + S[ 3][ 3] = cS4 + cM4; S[ 3][ 4] = -cS1; S[ 3][ 5] = -cS2 + cM1; + S[ 3][ 6] = cS1; S[ 3][ 7] = -cS1 + cM2; S[ 3][ 8] = -cS2; + S[ 3][ 9] = -cS1; S[ 3][10] = cS1; S[ 3][11] = cS2; + + S[ 4][ 4] = cS4 + cM4; S[ 4][ 5] = cS2; S[ 4][ 6] = -cS1 + cM2; + S[ 4][ 7] = -cS2; S[ 4][ 8] = cS2; S[ 4][ 9] = -cS2; + S[ 4][10] = -cS1; S[ 4][11] = cS1; + + S[ 5][ 5] = cS4 + cM4; S[ 5][ 6] = -cS2; S[ 5][ 7] = -cS1 + cM2; + S[ 5][ 8] = cS1; S[ 5][ 9] = cS2; S[ 5][10] = -cS2; + S[ 5][11] = -cS1; + + S[ 6][ 6] = cS4 + cM4; S[ 6][ 7] = cS2; S[ 6][ 8] = cS1; + S[ 6][ 9] = -cS1; S[ 6][10] = -cS2; S[ 6][11] = cS2; + + S[ 7][ 7] = cS4 + cM4; S[ 7][ 8] = cS2; S[ 7][ 9] = cS1; + S[ 7][10] = -cS1; S[ 7][11] = -cS2; + + S[ 8][ 8] = cS4 + cM4; S[ 8][ 9] = -cS1 + cM2; S[ 8][10] = -cS2 + cM1; + S[ 8][11] = -cS1 + cM2; + + S[ 9][ 9] = cS4 + cM4; S[ 9][10] = -cS1 + cM2; S[ 9][11] = -cS2 + cM1; + + S[10][10] = cS4 + cM4; S[10][11] = -cS1 + cM2; + + S[11][11] = cS4 + cM4; + + /* 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; + } +} + + +/* Set Dirichlet boundary conditions for a set of edges */ +void SetDirBC(double S[12][12], double F[12], int n_edges, int *bc_edges) +{ + int ii, jj; + for (ii = 0; ii < n_edges; 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; + } +} + + +int main (int argc, char *argv[]) +{ + int myid, num_procs; + int n, N, pi, pj, pk; + double h; + int vis; + + double tol, theta; + int maxit, cycle_type; + int rlx_type, rlx_sweeps, rlx_weight, rlx_omega; + int amg_coarsen_type, amg_agg_levels, amg_rlx_type; + int amg_interp_type, amg_Pmax; + int singular_problem ; + + int time_index; + + HYPRE_SStructGrid edge_grid; + HYPRE_SStructGraph A_graph; + HYPRE_SStructMatrix A; + HYPRE_SStructVector b; + HYPRE_SStructVector x; + HYPRE_SStructGrid node_grid; + HYPRE_SStructGraph G_graph; + HYPRE_SStructStencil G_stencil[3]; + HYPRE_SStructMatrix G; + HYPRE_SStructVector xcoord, ycoord, zcoord; + + HYPRE_Solver solver, precond; + + /* Initialize MPI */ + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &myid); + MPI_Comm_size(MPI_COMM_WORLD, &num_procs); + + /* Set default parameters */ + s = 5; + vis = 0; + optionAlpha = 0; + optionBeta = 0; + maxit = 100; + tol = 1e-6; + cycle_type = 13; + rlx_type = 2; + rlx_sweeps = 1; + rlx_weight = 1.0; + rlx_omega = 1.0; + amg_coarsen_type = 10; + amg_agg_levels = 1; + amg_rlx_type = 6; + theta = 0.25; + amg_interp_type = 6; + amg_Pmax = 4; + singular_problem = 0; + + /* Parse command line */ + { + int arg_index = 0; + int print_usage = 0; + + while (arg_index < argc) + { + if ( strcmp(argv[arg_index], "-s") == 0 ) + { + arg_index++; + s = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-a") == 0 ) + { + arg_index++; + optionAlpha = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-b") == 0 ) + { + arg_index++; + optionBeta = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-vis") == 0 ) + { + arg_index++; + vis = 1; + } + else if ( strcmp(argv[arg_index], "-maxit") == 0 ) + { + arg_index++; + maxit = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-tol") == 0 ) + { + arg_index++; + tol = atof(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-type") == 0 ) + { + arg_index++; + cycle_type = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-rlx") == 0 ) + { + arg_index++; + rlx_type = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-rlxn") == 0 ) + { + arg_index++; + rlx_sweeps = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-rlxw") == 0 ) + { + arg_index++; + rlx_weight = atof(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-rlxo") == 0 ) + { + arg_index++; + rlx_omega = atof(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-ctype") == 0 ) + { + arg_index++; + amg_coarsen_type = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-amgrlx") == 0 ) + { + arg_index++; + amg_rlx_type = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-agg") == 0 ) + { + arg_index++; + amg_agg_levels = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-itype") == 0 ) + { + arg_index++; + amg_interp_type = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-pmax") == 0 ) + { + arg_index++; + amg_Pmax = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-sing") == 0 ) + { + arg_index++; + singular_problem = 1; + } + else if ( strcmp(argv[arg_index], "-theta") == 0 ) + { + arg_index++; + theta = atof(argv[arg_index++]); + } + + else if ( strcmp(argv[arg_index], "-help") == 0 ) + { + print_usage = 1; + break; + } + else + { + arg_index++; + } + } + + if ((print_usage) && (myid == 0)) + { + printf("\n"); + printf("Usage: %s []\n", argv[0]); + printf("\n"); + printf(" -s : scale factor for base grid (default: 5)\n"); + printf(" -a : curl-curl coefficient choice (default: 0)\n"); + printf(" -b : mass coefficient choice (default: 0)\n"); + printf(" -vis : save the solution for GLVis visualization\n"); + printf("\n"); + printf("PCG-AMS solver options: \n"); + printf(" -maxit : maximum number of iterations (100) \n"); + printf(" -tol : convergence tolerance (1e-6) \n"); + printf(" -type : 3-level cycle type (0-8, 11-14) \n"); + printf(" -theta : BoomerAMG threshold (0.25) \n"); + printf(" -ctype : BoomerAMG coarsening type \n"); + printf(" -agg : Levels of BoomerAMG agg. coarsening \n"); + printf(" -amgrlx : BoomerAMG relaxation type \n"); + printf(" -itype : BoomerAMG interpolation type \n"); + printf(" -pmax : BoomerAMG interpolation truncation \n"); + printf(" -rlx : relaxation type \n"); + printf(" -rlxn : number of relaxation sweeps \n"); + printf(" -rlxw : damping parameter (usually <=1) \n"); + printf(" -rlxo : SOR parameter (usually in (0,2)) \n"); + printf(" -sing : curl-curl only (singular) problem \n"); + printf("\n"); + printf("\n"); + } + + if (print_usage) + { + MPI_Finalize(); + return (0); + } + } + + /* Figure out the processor grid (M x M x M). The local problem size is + based on s and r, while pi, pj and pk indicate the position in the + processor grid. */ + M = pow(num_procs, 1.0 / 3.0) + 0.5; + if (num_procs != M * M * M) + { + if (myid == 0) printf("Can't run on %d processors, try %d.\n", + num_procs, M * M * M); + MPI_Finalize(); + exit(1); + } + n0 = 2 * s; /* size of box0 is n0 x n0 x n0 */ + n1 = r * s; /* size of box1 is n1 x n1 x n1 */ + h0 = 1.0 / (M * n0); /* grid spacing on part 0 */ + h1 = h0 / r; /* grid spacing on part 1 */ + pk = myid / (M * M); + pj = myid / M - pk * M; + pi = myid - pj * M - pk * M * M; + + /* Start timing */ + time_index = hypre_InitializeTiming("SStruct Setup"); + hypre_BeginTiming(time_index); + + { + int ndim = 3; + int nparts = 2; + int nboxes = 2; + int bpart[2] = {0, 1}; + int bilo[2][3] = {{pi*n0 + 1, pj*n0 + 1, pk*n0 + 1}, + {pi*n1 + 1, pj*n1 + 1, pk*n1 + 1} + }; + int biup[2][3] = {{pi*n0 + n0, pj*n0 + n0, pk*n0 + n0}, + {pi*n1 + n1, pj*n1 + n1, pk*n1 + n1} + }; + int bbndlo[2][3] = {{1, 1, 1}, {1, 1, 1}}; + int bbndup[2][3] = {{M * n0, M * n0, M * n0}, {M*n0 * r, M*n0 * r, M*n0 * r}}; + + double bh[2] = {h0, h1}; + + /* 1. Set up the edge and nodal grids. Note that we do this + simultaneously to make sure that they have the same extents. */ + + /* Create empty 3D grid objects */ + HYPRE_SStructGridCreate(MPI_COMM_WORLD, ndim, nparts, &node_grid); + HYPRE_SStructGridCreate(MPI_COMM_WORLD, ndim, nparts, &edge_grid); + + object_type = HYPRE_PARCSR; + HYPRE_SStructGridSetObjectType(node_grid, object_type); + HYPRE_SStructGridSetObjectType(edge_grid, object_type); + + /* Set the extents of the grid - each processor sets its grid boxes. */ + for (i = 0; i < nboxes; i++) + { + HYPRE_SStructGridSetExtents(node_grid, bpart[i], bilo[i], biup[i]); + HYPRE_SStructGridSetExtents(edge_grid, bpart[i], bilo[i], biup[i]); + } + + /* Set the variable type and number of variables on each grid. */ + { + int nnodevars = 1; + int nedgevars = 3; + HYPRE_SStructVariable nodevars[1] = {HYPRE_SSTRUCT_VARIABLE_NODE}; + HYPRE_SStructVariable edgevars[3] = {HYPRE_SSTRUCT_VARIABLE_XEDGE, + HYPRE_SSTRUCT_VARIABLE_YEDGE, + HYPRE_SSTRUCT_VARIABLE_ZEDGE + }; + + for (part = 0; part < nparts; part++) + { + HYPRE_SStructGridSetVariables(node_grid, part, nnodevars, nodevars); + HYPRE_SStructGridSetVariables(edge_grid, part, nedgevars, edgevars); + } + } + + /* Declare fine part 1 to be a refinement of coarse part 0 with a given + * refinement factor (rfactors) and index alignment */ + { + int coarse_part = bpart[0]; + int fine_part = bpart[1]; + int coarse_index[3] = {1, 1, 1}; + int fine_index[3] = {1, 1, 1}; + int rfactors[3] = {r, r, r}; + + HYPRE_SStructGridSetAMRPart(grid, coarse_part, fine_part, + coarse_index, fine_index, rfactors); + } + + /* Now the grids are ready to be used */ + HYPRE_SStructGridAssemble(node_grid); + HYPRE_SStructGridAssemble(edge_grid); + + /* 2. Create the finite element stiffness matrix A and load vector b. */ + + /* Set the ordering of the variables in the finite element problem. This + 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] */ + + for (part = 0; part < nparts; part++) + { + HYPRE_SStructGridSetFEMOrdering(edge_grid, part, ordering); + } + } + + /* Set up the Graph - determines the nonzero structure of the matrix. */ + { + /* Create the graph object */ + HYPRE_SStructGraphCreate(MPI_COMM_WORLD, edge_grid, &A_graph); + + /* Indicate that this problem uses finite element stiffness matrices and + load vectors, instead of stencils. */ + for (part = 0; part < nparts; part++) + { + HYPRE_SStructGraphSetFEM(A_graph, part); + } + + /* The edge finite element matrix is full, so there is no need to call the + HYPRE_SStructGraphSetFEMSparsity() function. */ + + /* Assemble the graph */ + HYPRE_SStructGraphAssemble(A_graph); + } + + /* Set up the SStruct Matrix and right-hand side vector */ + { + /* Create the matrix object */ + HYPRE_SStructMatrixCreate(MPI_COMM_WORLD, A_graph, &A); + /* Indicate that the matrix coefficients are ready to be set */ + HYPRE_SStructMatrixInitialize(A); + + /* Create an empty vector object */ + HYPRE_SStructVectorCreate(MPI_COMM_WORLD, edge_grid, &b); + /* Indicate that the vector coefficients are ready to be set */ + HYPRE_SStructVectorInitialize(b); + } + + /* Set the matrix and vector entries by finite element assembly */ + { + /* local stiffness matrix and load vector */ + double S[12][12], F[12]; + int index[3]; + + for (i = 0; i < nboxes; i++) + { + for (index[0] = bilo[i][0]; index[0] <= biup[i][0]; index[0]++) + for (index[1] = bilo[i][1]; index[1] <= biup[i][1]; index[1]++) + for (index[2] = bilo[i][2]; index[2] <= biup[i][2]; index[2]++) + { + /* Compute the FEM matrix and r.h.s. for cell index with + coefficients evaluated at the cell center. */ + ComputeFEMND1(S, F, index, bh[i]); + + /* Eliminate boundary conditions on x = 0 */ + if (index[0] == bbndlo[i][0]) + { + int bc_edges[4] = { 3, 11, 7, 8 }; + SetDirBC(S, F, 4, bc_edges); + } + /* Eliminate boundary conditions on y = 0 */ + if (index[1] == bbndlo[i][1]) + { + int bc_edges[4] = { 0, 9, 4, 8 }; + SetDirBC(S, F, 4, bc_edges); + } + /* Eliminate boundary conditions on z = 0 */ + if (index[2] == bbndlo[i][2]) + { + int bc_edges[4] = { 0, 1, 2, 3 }; + SetDirBC(S, F, 4, bc_edges); + } + /* Eliminate boundary conditions on x = 1 */ + if (index[0] == bbndup[i][0]) + { + int bc_edges[4] = { 1, 10, 5, 9 }; + SetDirBC(S, F, 4, bc_edges); + } + /* Eliminate boundary conditions on y = 1 */ + if (index[1] == bbndup[i][1]) + { + int bc_edges[4] = { 2, 10, 6, 11 }; + SetDirBC(S, F, 4, bc_edges); + } + /* Eliminate boundary conditions on z = 1 */ + if (index[2] == bbndup[i][2]) + { + int bc_edges[4] = { 4, 5, 6, 7 }; + SetDirBC(S, F, 4, bc_edges); + } + + /* Assemble the matrix */ + HYPRE_SStructMatrixAddFEMValues(A, part, index, &S[0][0]); + + /* Assemble the vector */ + HYPRE_SStructVectorAddFEMValues(b, part, index, F); + } + } + } + + /* Collective calls finalizing the matrix and vector assembly */ + HYPRE_SStructMatrixAssemble(A); + HYPRE_SStructVectorAssemble(b); + + /* 3. Create the discrete gradient matrix G, which is needed in AMS. */ + { + int stencil_size = 2; + + /* Define the discretization stencil relating the edges and nodes of the + grid. */ + { + int ndim = 3; + int entry; + 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] */ + + HYPRE_SStructStencilCreate(ndim, stencil_size, &G_stencil[0]); + HYPRE_SStructStencilCreate(ndim, stencil_size, &G_stencil[1]); + HYPRE_SStructStencilCreate(ndim, stencil_size, &G_stencil[2]); + + for (entry = 0; entry < stencil_size; entry++) + { + HYPRE_SStructStencilSetEntry(G_stencil[0], entry, Gx_offsets[entry], var); + HYPRE_SStructStencilSetEntry(G_stencil[1], entry, Gy_offsets[entry], var); + HYPRE_SStructStencilSetEntry(G_stencil[2], entry, Gz_offsets[entry], var); + } + } + } + + /* Set up the Graph - determines the nonzero structure of the matrix. */ + { + int nvars = 3; + int var; /* the edge variables */ + + /* Create the discrete gradient graph object */ + HYPRE_SStructGraphCreate(MPI_COMM_WORLD, edge_grid, &G_graph); + + /* Since the discrete gradient relates edge and nodal variables (it is a + rectangular matrix), we have to specify the domain (column) grid. */ + HYPRE_SStructGraphSetDomainGrid(G_graph, node_grid); + + /* 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); + } + + /* Set up the SStruct Matrix */ + { + /* Create the matrix object */ + HYPRE_SStructMatrixCreate(MPI_COMM_WORLD, G_graph, &G); + /* Indicate that the matrix coefficients are ready to be set */ + HYPRE_SStructMatrixInitialize(G); + } + + /* Set the discrete gradient values, assuming a "natural" orientation of + the edges (i.e. one in agreement with the coordinate directions). */ + { + int i; + int nedges = n * (n + 1) * (n + 1); + double *values; + int stencil_indices[2] = {0, 1}; /* the nodes of each edge */ + + values = 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; + } + + /* 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}; + HYPRE_SStructMatrixSetBoxValues(G, part, ilower, iupper, var, + stencil_size, stencil_indices, + values); + } + /* 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}; + HYPRE_SStructMatrixSetBoxValues(G, part, ilower, iupper, var, + stencil_size, stencil_indices, + values); + } + /* 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}; + HYPRE_SStructMatrixSetBoxValues(G, part, ilower, iupper, var, + stencil_size, stencil_indices, + values); + } + + free(values); + } + + /* Finalize the matrix assembly */ + HYPRE_SStructMatrixAssemble(G); + } + + /* 4. Create the vectors of nodal coordinates xcoord, ycoord and zcoord, + which are needed in AMS. */ + { + int i, j, k; + int part = 0; + int var = 0; /* the node variable */ + int index[3]; + double xval, yval, zval; + + /* Create empty vector objects */ + HYPRE_SStructVectorCreate(MPI_COMM_WORLD, node_grid, &xcoord); + HYPRE_SStructVectorCreate(MPI_COMM_WORLD, node_grid, &ycoord); + HYPRE_SStructVectorCreate(MPI_COMM_WORLD, node_grid, &zcoord); + /* Indicate that the vector coefficients are ready to be set */ + HYPRE_SStructVectorInitialize(xcoord); + HYPRE_SStructVectorInitialize(ycoord); + HYPRE_SStructVectorInitialize(zcoord); + + /* Compute and set the coordinates of the nodes */ + for (i = 0; i <= n; i++) + 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; + + 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); + HYPRE_SStructVectorSetValues(zcoord, part, index, var, &zval); + } + + /* Finalize the vector assembly */ + HYPRE_SStructVectorAssemble(xcoord); + HYPRE_SStructVectorAssemble(ycoord); + HYPRE_SStructVectorAssemble(zcoord); + } + + /* 5. Set up a SStruct Vector for the solution vector x */ + { + int part = 0; + int nvalues = n * (n + 1) * (n + 1); + double *values; + + values = calloc(nvalues, sizeof(double)); + + /* Create an empty vector object */ + HYPRE_SStructVectorCreate(MPI_COMM_WORLD, edge_grid, &x); + /* Indicate that the vector coefficients are ready to be set */ + HYPRE_SStructVectorInitialize(x); + + /* 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}; + 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}; + 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}; + HYPRE_SStructVectorSetBoxValues(x, part, ilower, iupper, var, values); + } + + free(values); + + /* Finalize the vector assembly */ + HYPRE_SStructVectorAssemble(x); + } + + /* Finalize current timing */ + hypre_EndTiming(time_index); + hypre_PrintTiming("SStruct phase times", MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + /* 6. Set up and call the PCG-AMS solver (Solver options can be found in the + Reference Manual.) */ + { + double final_res_norm; + int its; + + HYPRE_ParCSRMatrix par_A; + HYPRE_ParVector par_b; + HYPRE_ParVector par_x; + + HYPRE_ParCSRMatrix par_G; + HYPRE_ParVector par_xcoord; + HYPRE_ParVector par_ycoord; + HYPRE_ParVector par_zcoord; + + /* Extract the ParCSR objects needed in the solver */ + HYPRE_SStructMatrixGetObject(A, (void **) &par_A); + HYPRE_SStructVectorGetObject(b, (void **) &par_b); + HYPRE_SStructVectorGetObject(x, (void **) &par_x); + HYPRE_SStructMatrixGetObject(G, (void **) &par_G); + HYPRE_SStructVectorGetObject(xcoord, (void **) &par_xcoord); + HYPRE_SStructVectorGetObject(ycoord, (void **) &par_ycoord); + HYPRE_SStructVectorGetObject(zcoord, (void **) &par_zcoord); + + if (myid == 0) + printf("Problem size: %d\n\n", + hypre_ParCSRMatrixGlobalNumRows((hypre_ParCSRMatrix*)par_A)); + + /* Start timing */ + time_index = hypre_InitializeTiming("AMS Setup"); + hypre_BeginTiming(time_index); + + /* Create solver */ + HYPRE_ParCSRPCGCreate(MPI_COMM_WORLD, &solver); + + /* Set some parameters (See Reference Manual for more parameters) */ + HYPRE_PCGSetMaxIter(solver, maxit); /* max iterations */ + HYPRE_PCGSetTol(solver, tol); /* conv. tolerance */ + HYPRE_PCGSetTwoNorm(solver, 0); /* use the two norm as the stopping criteria */ + HYPRE_PCGSetPrintLevel(solver, 2); /* print solve info */ + HYPRE_PCGSetLogging(solver, 1); /* needed to get run info later */ + + /* Create AMS preconditioner */ + HYPRE_AMSCreate(&precond); + + /* Set AMS parameters */ + HYPRE_AMSSetMaxIter(precond, 1); + HYPRE_AMSSetTol(precond, 0.0); + HYPRE_AMSSetCycleType(precond, cycle_type); + HYPRE_AMSSetPrintLevel(precond, 1); + + /* Set discrete gradient */ + HYPRE_AMSSetDiscreteGradient(precond, par_G); + + /* Set vertex coordinates */ + HYPRE_AMSSetCoordinateVectors(precond, + par_xcoord, par_ycoord, par_zcoord); + + 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); + + /* Set the PCG preconditioner */ + HYPRE_PCGSetPrecond(solver, + (HYPRE_PtrToSolverFcn) HYPRE_AMSSolve, + (HYPRE_PtrToSolverFcn) HYPRE_AMSSetup, + precond); + + /* Call the setup */ + HYPRE_ParCSRPCGSetup(solver, par_A, par_b, par_x); + + /* Finalize current timing */ + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + /* Start timing again */ + time_index = hypre_InitializeTiming("AMS Solve"); + hypre_BeginTiming(time_index); + + /* Call the solve */ + HYPRE_ParCSRPCGSolve(solver, par_A, par_b, par_x); + + /* Finalize current timing */ + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + /* Get some info */ + HYPRE_PCGGetNumIterations(solver, &its); + HYPRE_PCGGetFinalRelativeResidualNorm(solver, &final_res_norm); + + /* Clean up */ + HYPRE_AMSDestroy(precond); + HYPRE_ParCSRPCGDestroy(solver); + + /* Gather the solution vector */ + HYPRE_SStructVectorGather(x); + + /* Save the solution for GLVis visualization, see vis/glvis-ex15.sh */ + if (vis) + { + FILE *file; + char filename[255]; + + int part = 0; + int nvalues = n * (n + 1) * (n + 1); + double *xvalues, *yvalues, *zvalues; + + xvalues = calloc(nvalues, sizeof(double)); + yvalues = calloc(nvalues, sizeof(double)); + zvalues = calloc(nvalues, sizeof(double)); + + /* 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}; + 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}; + 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}; + HYPRE_SStructVectorGetBoxValues(x, part, ilower, iupper, + var, zvalues); + } + + sprintf(filename, "%s.%06d", "vis/ex15.sol", myid); + if ((file = fopen(filename, "w")) == NULL) + { + printf("Error: can't open output file %s\n", filename); + MPI_Finalize(); + exit(1); + } + + /* Finite element space header */ + fprintf(file, "FiniteElementSpace\n"); + fprintf(file, "FiniteElementCollection: Local_Hex_ND1\n"); + fprintf(file, "VDim: 1\n"); + fprintf(file, "Ordering: 0\n\n"); + + /* Save solution with replicated shared data, i.e., element by element, + using the same numbering as the local finite element unknowns. */ + { + 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 */ + /* Loop over the cells while updating the above offsets */ + for (k = 0; k < n; k++) + { + for (j = 0; j < n; j++) + { + for (i = 0; i < n; i++) + { + fprintf(file, + "%.14e\n%.14e\n%.14e\n%.14e\n" + "%.14e\n%.14e\n%.14e\n%.14e\n" + "%.14e\n%.14e\n%.14e\n%.14e\n", + xvalues[oi[0]], yvalues[oj[1]], xvalues[oi[1]], yvalues[oj[0]], + 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++) { oj[s]++, ok[s]++; } + } + for (s = 0; s < 4; s++) { oi[s] += n, ok[s] += n + 1; } + } + } + + fflush(file); + fclose(file); + free(xvalues); + free(yvalues); + free(zvalues); + + /* Save local finite element mesh */ + GLVis_PrintLocalCubicMesh("vis/ex15.mesh", n, n, n, h, + pi * h * n, pj * h * n, pk * h * n, myid); + + /* Additional visualization data */ + if (myid == 0) + { + sprintf(filename, "%s", "vis/ex15.data"); + file = fopen(filename, "w"); + fprintf(file, "np %d\n", num_procs); + fflush(file); + fclose(file); + } + } + + if (myid == 0) + { + printf("\n"); + printf("Iterations = %d\n", its); + printf("Final Relative Residual Norm = %g\n", final_res_norm); + printf("\n"); + } + } + + /* Free memory */ + HYPRE_SStructGridDestroy(edge_grid); + HYPRE_SStructGraphDestroy(A_graph); + HYPRE_SStructMatrixDestroy(A); + HYPRE_SStructVectorDestroy(b); + HYPRE_SStructVectorDestroy(x); + HYPRE_SStructGridDestroy(node_grid); + HYPRE_SStructGraphDestroy(G_graph); + HYPRE_SStructStencilDestroy(G_stencil[0]); + HYPRE_SStructStencilDestroy(G_stencil[1]); + HYPRE_SStructStencilDestroy(G_stencil[2]); + HYPRE_SStructMatrixDestroy(G); + HYPRE_SStructVectorDestroy(xcoord); + HYPRE_SStructVectorDestroy(ycoord); + HYPRE_SStructVectorDestroy(zcoord); + + /* Finalize MPI */ + MPI_Finalize(); + + return 0; +} diff --git a/src/krylov/CMakeLists.txt b/src/krylov/CMakeLists.txt index f1506709e7..7caf62b51e 100644 --- a/src/krylov/CMakeLists.txt +++ b/src/krylov/CMakeLists.txt @@ -6,12 +6,24 @@ set(HDRS HYPRE_krylov.h HYPRE_lobpcg.h - HYPRE_MatvecFunctions.h - krylov.h - lobpcg.h + _hypre_krylov.h + _hypre_lobpcg.h ) -set(SRCS +# Add MUP headers when mixed precision is enabled +if(HYPRE_ENABLE_MIXED_PRECISION) + list(APPEND HDRS + HYPRE_krylov_mup.h + HYPRE_lobpcg_mup.h + _hypre_krylov_mup.h + _hypre_lobpcg_mup.h + _hypre_krylov_mup_def.h + _hypre_krylov_mup_undef.h + ) +endif() + +# Regular sources +set(REGULAR_SRCS bicgstab.c cgnr.c cogmres.c @@ -30,10 +42,22 @@ set(SRCS lobpcg.c ) -target_sources(${PROJECT_NAME} - PRIVATE ${SRCS} - ${HDRS} +# Mixed precision sources +set(MUP_SRCS + mup_fixed.c + mup_functions.c + mup_pre.c + mup_lobpcg_fixed.c + mup_lobpcg_functions.c + mup_lobpcg_pre.c ) +if(HYPRE_ENABLE_MIXED_PRECISION) + setup_mixed_precision_compilation("krylov" SRCS "${REGULAR_SRCS}") + target_sources(${PROJECT_NAME} PRIVATE ${MUP_SRCS} ${HDRS}) +else() + target_sources(${PROJECT_NAME} PRIVATE ${REGULAR_SRCS} ${HDRS}) +endif() + convert_filenames_to_full_paths(HDRS) set(HYPRE_HEADERS ${HYPRE_HEADERS} ${HDRS} PARENT_SCOPE) diff --git a/src/krylov/HYPRE_MatvecFunctions.h b/src/krylov/HYPRE_MatvecFunctions.h deleted file mode 100644 index 47ca7f38e8..0000000000 --- a/src/krylov/HYPRE_MatvecFunctions.h +++ /dev/null @@ -1,25 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_MATVEC_FUNCTIONS -#define HYPRE_MATVEC_FUNCTIONS - -typedef struct -{ - 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 ); - - void* (*MatMultiVecCreate) ( void *A, void *x ); - HYPRE_Int (*MatMultiVec) ( void *data, HYPRE_Complex alpha, void *A, - void *x, HYPRE_Complex beta, void *y ); - HYPRE_Int (*MatMultiVecDestroy) ( void *data ); - -} HYPRE_MatvecFunctions; - -#endif diff --git a/src/krylov/HYPRE_bicgstab.c b/src/krylov/HYPRE_bicgstab.c index 923271fc86..b4b70a10dc 100644 --- a/src/krylov/HYPRE_bicgstab.c +++ b/src/krylov/HYPRE_bicgstab.c @@ -10,7 +10,8 @@ * HYPRE_BiCGSTAB interface * *****************************************************************************/ -#include "krylov.h" + +#include "_hypre_krylov.h" /*-------------------------------------------------------------------------- * HYPRE_BiCGSTABCreate does not exist. Call the appropriate function which @@ -145,6 +146,31 @@ HYPRE_BiCGSTABGetPrecond( HYPRE_Solver solver, (HYPRE_Solver *) precond_data_ptr ) ); } +/*-------------------------------------------------------------------------- + * HYPRE_BiCGSTABSetPrecondMatrix + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABSetPrecondMatrix( HYPRE_Solver solver, + HYPRE_Matrix precond_matrix) +{ + return ( hypre_BiCGSTABSetPrecondMatrix( (void *) solver, + (void *) precond_matrix) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_BiCGSTABetPrecondMatrix + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABGetPrecondMatrix( HYPRE_Solver solver, + HYPRE_Matrix *precond_matrix_ptr ) +{ + return ( hypre_BiCGSTABGetPrecondMatrix( (void *) solver, + (HYPRE_Matrix *) precond_matrix_ptr ) ); +} + + /*-------------------------------------------------------------------------- * HYPRE_BiCGSTABSetLogging *--------------------------------------------------------------------------*/ diff --git a/src/krylov/HYPRE_cgnr.c b/src/krylov/HYPRE_cgnr.c index 01b51daae6..6b56c4905b 100644 --- a/src/krylov/HYPRE_cgnr.c +++ b/src/krylov/HYPRE_cgnr.c @@ -10,7 +10,8 @@ * HYPRE_CGNR interface * *****************************************************************************/ -#include "krylov.h" + +#include "_hypre_krylov.h" /*-------------------------------------------------------------------------- * HYPRE_CGNRCreate does not exist. Call the appropriate function which diff --git a/src/krylov/HYPRE_cogmres.c b/src/krylov/HYPRE_cogmres.c index 149a4f9f15..0d9b89cdb6 100644 --- a/src/krylov/HYPRE_cogmres.c +++ b/src/krylov/HYPRE_cogmres.c @@ -10,7 +10,8 @@ * HYPRE_COGMRES interface * *****************************************************************************/ -#include "krylov.h" + +#include "_hypre_krylov.h" /*-------------------------------------------------------------------------- * HYPRE_COGMRESDestroy @@ -308,8 +309,7 @@ HYPRE_Int HYPRE_COGMRESGetResidual( HYPRE_Solver solver, void *residual ) *--------------------------------------------------------------------------*/ -HYPRE_Int HYPRE_COGMRESSetModifyPC( HYPRE_Solver solver, - HYPRE_Int (*modify_pc)(HYPRE_Solver, HYPRE_Int, HYPRE_Real) ) +HYPRE_Int HYPRE_COGMRESSetModifyPC(HYPRE_Solver solver, HYPRE_PtrToModifyPCFcn modify_pc) { return hypre_COGMRESSetModifyPC( (void *) solver, (HYPRE_Int(*)(void*, HYPRE_Int, HYPRE_Real))modify_pc); diff --git a/src/krylov/HYPRE_flexgmres.c b/src/krylov/HYPRE_flexgmres.c index f0299f1f48..338644c31f 100644 --- a/src/krylov/HYPRE_flexgmres.c +++ b/src/krylov/HYPRE_flexgmres.c @@ -10,7 +10,8 @@ * HYPRE_FlexGMRES interface * *****************************************************************************/ -#include "krylov.h" + +#include "_hypre_krylov.h" /*-------------------------------------------------------------------------- * HYPRE_FlexGMRESDestroy diff --git a/src/krylov/HYPRE_gmres.c b/src/krylov/HYPRE_gmres.c index c596c638c9..fa190547be 100644 --- a/src/krylov/HYPRE_gmres.c +++ b/src/krylov/HYPRE_gmres.c @@ -10,7 +10,8 @@ * HYPRE_GMRES interface * *****************************************************************************/ -#include "krylov.h" + +#include "_hypre_krylov.h" /*-------------------------------------------------------------------------- * HYPRE_GMRESDestroy @@ -257,6 +258,30 @@ HYPRE_GMRESGetPrecond( HYPRE_Solver solver, (HYPRE_Solver *) precond_data_ptr ) ); } +/*-------------------------------------------------------------------------- + * HYPRE_GMRESSetPrecondMatrix + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSetPrecondMatrix( HYPRE_Solver solver, + HYPRE_Matrix precond_matrix) +{ + return ( hypre_GMRESSetPrecondMatrix( (void *) solver, + (void *) precond_matrix) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_GMRESGetPrecondMatrix + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetPrecondMatrix( HYPRE_Solver solver, + HYPRE_Matrix *precond_matrix_ptr ) +{ + return ( hypre_GMRESGetPrecondMatrix( (void *) solver, + (HYPRE_Matrix *) precond_matrix_ptr ) ); +} + /*-------------------------------------------------------------------------- * HYPRE_GMRESSetPrintLevel, HYPRE_GMRESGetPrintLevel *--------------------------------------------------------------------------*/ diff --git a/src/krylov/HYPRE_krylov.h b/src/krylov/HYPRE_krylov.h index 8c9ce53e9a..25fc126691 100644 --- a/src/krylov/HYPRE_krylov.h +++ b/src/krylov/HYPRE_krylov.h @@ -10,6 +10,10 @@ #include "HYPRE_utilities.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_krylov_mup_def.h" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -37,13 +41,10 @@ extern "C" { * @{ **/ -#ifndef HYPRE_MODIFYPC -#define HYPRE_MODIFYPC typedef HYPRE_Int (*HYPRE_PtrToModifyPCFcn)(HYPRE_Solver, HYPRE_Int, HYPRE_Real); -#endif /**@}*/ /*-------------------------------------------------------------------------- @@ -171,6 +172,10 @@ HYPRE_Int HYPRE_PCGSetPrecond(HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver); +/** + **/ +HYPRE_Int HYPRE_PCGSetPrecondMatrix ( HYPRE_Solver solver, HYPRE_Matrix precond_matrix ); + /** * (Optional) Set the preconditioner to use in a generic fashion. * This function does not require explicit input of the setup and solve pointers @@ -268,10 +273,14 @@ HYPRE_Int HYPRE_PCGGetFlex(HYPRE_Solver solver, HYPRE_Int HYPRE_PCGGetPrecond(HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr); +/** + **/ +HYPRE_Int HYPRE_PCGGetPrecondMatrix ( HYPRE_Solver solver, HYPRE_Matrix *precond_matrix_ptr ); + /** **/ HYPRE_Int HYPRE_PCGGetLogging(HYPRE_Solver solver, - HYPRE_Int *level); + HYPRE_Int *logging); /** **/ @@ -383,6 +392,10 @@ HYPRE_Int HYPRE_GMRESSetPrecond(HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver); +/** + **/ +HYPRE_Int HYPRE_GMRESSetPrecondMatrix ( HYPRE_Solver solver, HYPRE_Matrix precond_matrix ); + /** * (Optional) Set the amount of logging to do. **/ @@ -490,6 +503,10 @@ HYPRE_Int HYPRE_GMRESGetRelChange(HYPRE_Solver solver, HYPRE_Int HYPRE_GMRESGetPrecond(HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr); +/** + **/ +HYPRE_Int HYPRE_GMRESGetPrecondMatrix ( HYPRE_Solver solver, HYPRE_Matrix *precond_matrix_ptr ); + /** **/ HYPRE_Int HYPRE_GMRESGetLogging(HYPRE_Solver solver, @@ -1128,6 +1145,10 @@ HYPRE_Int HYPRE_BiCGSTABSetPrecond(HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver); +/** + **/ +HYPRE_Int HYPRE_BiCGSTABSetPrecondMatrix ( HYPRE_Solver solver, HYPRE_Matrix precond_matrix ); + /** * (Optional) Set the amount of logging to do. **/ @@ -1163,6 +1184,10 @@ HYPRE_Int HYPRE_BiCGSTABGetResidual(HYPRE_Solver solver, HYPRE_Int HYPRE_BiCGSTABGetPrecond(HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr); +/** + **/ +HYPRE_Int HYPRE_BiCGSTABGetPrecondMatrix ( HYPRE_Solver solver, HYPRE_Matrix *precond_matrix_ptr ); + /**@}*/ /*-------------------------------------------------------------------------- @@ -1285,4 +1310,15 @@ HYPRE_Int HYPRE_CGNRGetPrecond(HYPRE_Solver solver, } #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_krylov_mup_undef.h" +#include "HYPRE_krylov_mup.h" +#endif +#endif + #endif diff --git a/src/krylov/HYPRE_krylov_mup.h b/src/krylov/HYPRE_krylov_mup.h new file mode 100644 index 0000000000..facd612a29 --- /dev/null +++ b/src/krylov/HYPRE_krylov_mup.h @@ -0,0 +1,2201 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#ifndef HYPRE_KRYLOV_MUP_HEADER +#define HYPRE_KRYLOV_MUP_HEADER + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (HYPRE_MIXED_PRECISION) + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_BiCGSTABDestroy_flt( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_BiCGSTABDestroy_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_BiCGSTABDestroy_long_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_BiCGSTABDestroy( HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_BiCGSTABGetFinalRelativeResidualNorm_flt( HYPRE_Solver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_BiCGSTABGetFinalRelativeResidualNorm_dbl( HYPRE_Solver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_BiCGSTABGetFinalRelativeResidualNorm_long_dbl( HYPRE_Solver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_BiCGSTABGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *norm ); + +HYPRE_Int +HYPRE_BiCGSTABGetNumIterations_flt( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_BiCGSTABGetNumIterations_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_BiCGSTABGetNumIterations_long_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_BiCGSTABGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_BiCGSTABGetPrecond_flt( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +HYPRE_BiCGSTABGetPrecond_dbl( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +HYPRE_BiCGSTABGetPrecond_long_dbl( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +HYPRE_BiCGSTABGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); + +HYPRE_Int +HYPRE_BiCGSTABGetPrecondMatrix_flt( HYPRE_Solver solver, HYPRE_Matrix *precond_matrix_ptr ); +HYPRE_Int +HYPRE_BiCGSTABGetPrecondMatrix_dbl( HYPRE_Solver solver, HYPRE_Matrix *precond_matrix_ptr ); +HYPRE_Int +HYPRE_BiCGSTABGetPrecondMatrix_long_dbl( HYPRE_Solver solver, HYPRE_Matrix *precond_matrix_ptr ); +HYPRE_Int +HYPRE_BiCGSTABGetPrecondMatrix( HYPRE_Solver solver, HYPRE_Matrix *precond_matrix_ptr ); + +HYPRE_Int +HYPRE_BiCGSTABGetResidual_flt( HYPRE_Solver solver, void *residual ); +HYPRE_Int +HYPRE_BiCGSTABGetResidual_dbl( HYPRE_Solver solver, void *residual ); +HYPRE_Int +HYPRE_BiCGSTABGetResidual_long_dbl( HYPRE_Solver solver, void *residual ); +HYPRE_Int +HYPRE_BiCGSTABGetResidual( HYPRE_Solver solver, void *residual ); + +HYPRE_Int +HYPRE_BiCGSTABSetAbsoluteTol_flt( HYPRE_Solver solver, hypre_float a_tol ); +HYPRE_Int +HYPRE_BiCGSTABSetAbsoluteTol_dbl( HYPRE_Solver solver, hypre_double a_tol ); +HYPRE_Int +HYPRE_BiCGSTABSetAbsoluteTol_long_dbl( HYPRE_Solver solver, hypre_long_double a_tol ); +HYPRE_Int +HYPRE_BiCGSTABSetAbsoluteTol( HYPRE_Solver solver, hypre_long_double a_tol ); + +HYPRE_Int +HYPRE_BiCGSTABSetConvergenceFactorTol_flt( HYPRE_Solver solver, hypre_float cf_tol ); +HYPRE_Int +HYPRE_BiCGSTABSetConvergenceFactorTol_dbl( HYPRE_Solver solver, hypre_double cf_tol ); +HYPRE_Int +HYPRE_BiCGSTABSetConvergenceFactorTol_long_dbl( HYPRE_Solver solver, hypre_long_double cf_tol ); +HYPRE_Int +HYPRE_BiCGSTABSetConvergenceFactorTol( HYPRE_Solver solver, hypre_long_double cf_tol ); + +HYPRE_Int +HYPRE_BiCGSTABSetLogging_flt( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_BiCGSTABSetLogging_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_BiCGSTABSetLogging_long_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_BiCGSTABSetLogging( HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_BiCGSTABSetMaxIter_flt( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_BiCGSTABSetMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_BiCGSTABSetMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_BiCGSTABSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_BiCGSTABSetMinIter_flt( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_BiCGSTABSetMinIter_dbl( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_BiCGSTABSetMinIter_long_dbl( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_BiCGSTABSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_BiCGSTABSetPrecond_flt( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_BiCGSTABSetPrecond_dbl( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_BiCGSTABSetPrecond_long_dbl( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_BiCGSTABSetPrecond( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_BiCGSTABSetPrecondMatrix_flt( HYPRE_Solver solver, HYPRE_Matrix precond_matrix ); +HYPRE_Int +HYPRE_BiCGSTABSetPrecondMatrix_dbl( HYPRE_Solver solver, HYPRE_Matrix precond_matrix ); +HYPRE_Int +HYPRE_BiCGSTABSetPrecondMatrix_long_dbl( HYPRE_Solver solver, HYPRE_Matrix precond_matrix ); +HYPRE_Int +HYPRE_BiCGSTABSetPrecondMatrix( HYPRE_Solver solver, HYPRE_Matrix precond_matrix ); + +HYPRE_Int +HYPRE_BiCGSTABSetPrintLevel_flt( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_BiCGSTABSetPrintLevel_dbl( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_BiCGSTABSetPrintLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_BiCGSTABSetPrintLevel( HYPRE_Solver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_BiCGSTABSetStopCrit_flt( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_BiCGSTABSetStopCrit_dbl( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_BiCGSTABSetStopCrit_long_dbl( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_BiCGSTABSetStopCrit( HYPRE_Solver solver, HYPRE_Int stop_crit ); + +HYPRE_Int +HYPRE_BiCGSTABSetTol_flt( HYPRE_Solver solver, hypre_float tol ); +HYPRE_Int +HYPRE_BiCGSTABSetTol_dbl( HYPRE_Solver solver, hypre_double tol ); +HYPRE_Int +HYPRE_BiCGSTABSetTol_long_dbl( HYPRE_Solver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_BiCGSTABSetTol( HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_BiCGSTABSetup_flt( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_BiCGSTABSetup_dbl( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_BiCGSTABSetup_long_dbl( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_BiCGSTABSetup( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); + +HYPRE_Int +HYPRE_BiCGSTABSolve_flt( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_BiCGSTABSolve_dbl( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_BiCGSTABSolve_long_dbl( 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_CGNRDestroy_flt( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_CGNRDestroy_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_CGNRDestroy_long_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_CGNRDestroy( HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_CGNRGetFinalRelativeResidualNorm_flt( HYPRE_Solver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_CGNRGetFinalRelativeResidualNorm_dbl( HYPRE_Solver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_CGNRGetFinalRelativeResidualNorm_long_dbl( HYPRE_Solver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_CGNRGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *norm ); + +HYPRE_Int +HYPRE_CGNRGetNumIterations_flt( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_CGNRGetNumIterations_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_CGNRGetNumIterations_long_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_CGNRGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_CGNRGetPrecond_flt( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +HYPRE_CGNRGetPrecond_dbl( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +HYPRE_CGNRGetPrecond_long_dbl( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +HYPRE_CGNRGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); + +HYPRE_Int +HYPRE_CGNRSetLogging_flt( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_CGNRSetLogging_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_CGNRSetLogging_long_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_CGNRSetLogging( HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_CGNRSetMaxIter_flt( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_CGNRSetMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_CGNRSetMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_CGNRSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_CGNRSetMinIter_flt( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_CGNRSetMinIter_dbl( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_CGNRSetMinIter_long_dbl( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_CGNRSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_CGNRSetPrecond_flt( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precondT, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_CGNRSetPrecond_dbl( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precondT, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_CGNRSetPrecond_long_dbl( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precondT, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_CGNRSetPrecond( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precondT, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_CGNRSetStopCrit_flt( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_CGNRSetStopCrit_dbl( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_CGNRSetStopCrit_long_dbl( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_CGNRSetStopCrit( HYPRE_Solver solver, HYPRE_Int stop_crit ); + +HYPRE_Int +HYPRE_CGNRSetTol_flt( HYPRE_Solver solver, hypre_float tol ); +HYPRE_Int +HYPRE_CGNRSetTol_dbl( HYPRE_Solver solver, hypre_double tol ); +HYPRE_Int +HYPRE_CGNRSetTol_long_dbl( HYPRE_Solver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_CGNRSetTol( HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_CGNRSetup_flt( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_CGNRSetup_dbl( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_CGNRSetup_long_dbl( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_CGNRSetup( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); + +HYPRE_Int +HYPRE_CGNRSolve_flt( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_CGNRSolve_dbl( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_CGNRSolve_long_dbl( 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_COGMRESGetCGS_flt( HYPRE_Solver solver, HYPRE_Int *cgs ); +HYPRE_Int +HYPRE_COGMRESGetCGS_dbl( HYPRE_Solver solver, HYPRE_Int *cgs ); +HYPRE_Int +HYPRE_COGMRESGetCGS_long_dbl( HYPRE_Solver solver, HYPRE_Int *cgs ); +HYPRE_Int +HYPRE_COGMRESGetCGS( HYPRE_Solver solver, HYPRE_Int *cgs ); + +HYPRE_Int +HYPRE_COGMRESGetConverged_flt( HYPRE_Solver solver, HYPRE_Int *converged ); +HYPRE_Int +HYPRE_COGMRESGetConverged_dbl( HYPRE_Solver solver, HYPRE_Int *converged ); +HYPRE_Int +HYPRE_COGMRESGetConverged_long_dbl( HYPRE_Solver solver, HYPRE_Int *converged ); +HYPRE_Int +HYPRE_COGMRESGetConverged( HYPRE_Solver solver, HYPRE_Int *converged ); + +HYPRE_Int +HYPRE_COGMRESGetConvergenceFactorTol_flt( HYPRE_Solver solver, hypre_float *cf_tol ); +HYPRE_Int +HYPRE_COGMRESGetConvergenceFactorTol_dbl( HYPRE_Solver solver, hypre_double *cf_tol ); +HYPRE_Int +HYPRE_COGMRESGetConvergenceFactorTol_long_dbl( HYPRE_Solver solver, hypre_long_double *cf_tol ); +HYPRE_Int +HYPRE_COGMRESGetConvergenceFactorTol( HYPRE_Solver solver, void *cf_tol ); + +HYPRE_Int +HYPRE_COGMRESGetFinalRelativeResidualNorm_flt( HYPRE_Solver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_COGMRESGetFinalRelativeResidualNorm_dbl( HYPRE_Solver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_COGMRESGetFinalRelativeResidualNorm_long_dbl( HYPRE_Solver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_COGMRESGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *norm ); + +HYPRE_Int +HYPRE_COGMRESGetKDim_flt( HYPRE_Solver solver, HYPRE_Int *k_dim ); +HYPRE_Int +HYPRE_COGMRESGetKDim_dbl( HYPRE_Solver solver, HYPRE_Int *k_dim ); +HYPRE_Int +HYPRE_COGMRESGetKDim_long_dbl( HYPRE_Solver solver, HYPRE_Int *k_dim ); +HYPRE_Int +HYPRE_COGMRESGetKDim( HYPRE_Solver solver, HYPRE_Int *k_dim ); + +HYPRE_Int +HYPRE_COGMRESGetLogging_flt( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int +HYPRE_COGMRESGetLogging_dbl( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int +HYPRE_COGMRESGetLogging_long_dbl( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int +HYPRE_COGMRESGetLogging( HYPRE_Solver solver, HYPRE_Int *level ); + +HYPRE_Int +HYPRE_COGMRESGetMaxIter_flt( HYPRE_Solver solver, HYPRE_Int *max_iter ); +HYPRE_Int +HYPRE_COGMRESGetMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int *max_iter ); +HYPRE_Int +HYPRE_COGMRESGetMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int *max_iter ); +HYPRE_Int +HYPRE_COGMRESGetMaxIter( HYPRE_Solver solver, HYPRE_Int *max_iter ); + +HYPRE_Int +HYPRE_COGMRESGetMinIter_flt( HYPRE_Solver solver, HYPRE_Int *min_iter ); +HYPRE_Int +HYPRE_COGMRESGetMinIter_dbl( HYPRE_Solver solver, HYPRE_Int *min_iter ); +HYPRE_Int +HYPRE_COGMRESGetMinIter_long_dbl( HYPRE_Solver solver, HYPRE_Int *min_iter ); +HYPRE_Int +HYPRE_COGMRESGetMinIter( HYPRE_Solver solver, HYPRE_Int *min_iter ); + +HYPRE_Int +HYPRE_COGMRESGetNumIterations_flt( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_COGMRESGetNumIterations_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_COGMRESGetNumIterations_long_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_COGMRESGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_COGMRESGetPrecond_flt( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +HYPRE_COGMRESGetPrecond_dbl( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +HYPRE_COGMRESGetPrecond_long_dbl( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +HYPRE_COGMRESGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); + +HYPRE_Int +HYPRE_COGMRESGetPrintLevel_flt( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int +HYPRE_COGMRESGetPrintLevel_dbl( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int +HYPRE_COGMRESGetPrintLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int +HYPRE_COGMRESGetPrintLevel( HYPRE_Solver solver, HYPRE_Int *level ); + +HYPRE_Int +HYPRE_COGMRESGetResidual_flt( HYPRE_Solver solver, void *residual ); +HYPRE_Int +HYPRE_COGMRESGetResidual_dbl( HYPRE_Solver solver, void *residual ); +HYPRE_Int +HYPRE_COGMRESGetResidual_long_dbl( HYPRE_Solver solver, void *residual ); +HYPRE_Int +HYPRE_COGMRESGetResidual( HYPRE_Solver solver, void *residual ); + +HYPRE_Int +HYPRE_COGMRESGetTol_flt( HYPRE_Solver solver, hypre_float *tol ); +HYPRE_Int +HYPRE_COGMRESGetTol_dbl( HYPRE_Solver solver, hypre_double *tol ); +HYPRE_Int +HYPRE_COGMRESGetTol_long_dbl( HYPRE_Solver solver, hypre_long_double *tol ); +HYPRE_Int +HYPRE_COGMRESGetTol( HYPRE_Solver solver, void *tol ); + +HYPRE_Int +HYPRE_COGMRESGetUnroll_flt( HYPRE_Solver solver, HYPRE_Int *unroll ); +HYPRE_Int +HYPRE_COGMRESGetUnroll_dbl( HYPRE_Solver solver, HYPRE_Int *unroll ); +HYPRE_Int +HYPRE_COGMRESGetUnroll_long_dbl( HYPRE_Solver solver, HYPRE_Int *unroll ); +HYPRE_Int +HYPRE_COGMRESGetUnroll( HYPRE_Solver solver, HYPRE_Int *unroll ); + +HYPRE_Int +HYPRE_COGMRESSetAbsoluteTol_flt( HYPRE_Solver solver, hypre_float a_tol ); +HYPRE_Int +HYPRE_COGMRESSetAbsoluteTol_dbl( HYPRE_Solver solver, hypre_double a_tol ); +HYPRE_Int +HYPRE_COGMRESSetAbsoluteTol_long_dbl( HYPRE_Solver solver, hypre_long_double a_tol ); +HYPRE_Int +HYPRE_COGMRESSetAbsoluteTol( HYPRE_Solver solver, hypre_long_double a_tol ); + +HYPRE_Int +HYPRE_COGMRESSetCGS_flt( HYPRE_Solver solver, HYPRE_Int cgs ); +HYPRE_Int +HYPRE_COGMRESSetCGS_dbl( HYPRE_Solver solver, HYPRE_Int cgs ); +HYPRE_Int +HYPRE_COGMRESSetCGS_long_dbl( HYPRE_Solver solver, HYPRE_Int cgs ); +HYPRE_Int +HYPRE_COGMRESSetCGS( HYPRE_Solver solver, HYPRE_Int cgs ); + +HYPRE_Int +HYPRE_COGMRESSetConvergenceFactorTol_flt( HYPRE_Solver solver, hypre_float cf_tol ); +HYPRE_Int +HYPRE_COGMRESSetConvergenceFactorTol_dbl( HYPRE_Solver solver, hypre_double cf_tol ); +HYPRE_Int +HYPRE_COGMRESSetConvergenceFactorTol_long_dbl( HYPRE_Solver solver, hypre_long_double cf_tol ); +HYPRE_Int +HYPRE_COGMRESSetConvergenceFactorTol( HYPRE_Solver solver, hypre_long_double cf_tol ); + +HYPRE_Int +HYPRE_COGMRESSetKDim_flt( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_COGMRESSetKDim_dbl( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_COGMRESSetKDim_long_dbl( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_COGMRESSetKDim( HYPRE_Solver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_COGMRESSetLogging_flt( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_COGMRESSetLogging_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_COGMRESSetLogging_long_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_COGMRESSetLogging( HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_COGMRESSetMaxIter_flt( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_COGMRESSetMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_COGMRESSetMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_COGMRESSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_COGMRESSetMinIter_flt( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_COGMRESSetMinIter_dbl( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_COGMRESSetMinIter_long_dbl( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_COGMRESSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_COGMRESSetModifyPC_flt( HYPRE_Solver solver, HYPRE_PtrToModifyPCFcn modify_pc ); +HYPRE_Int +HYPRE_COGMRESSetModifyPC_dbl( HYPRE_Solver solver, HYPRE_PtrToModifyPCFcn modify_pc ); +HYPRE_Int +HYPRE_COGMRESSetModifyPC_long_dbl( HYPRE_Solver solver, HYPRE_PtrToModifyPCFcn modify_pc ); +HYPRE_Int +HYPRE_COGMRESSetModifyPC( HYPRE_Solver solver, HYPRE_PtrToModifyPCFcn modify_pc ); + +HYPRE_Int +HYPRE_COGMRESSetPrecond_flt( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_COGMRESSetPrecond_dbl( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_COGMRESSetPrecond_long_dbl( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_COGMRESSetPrecond( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_COGMRESSetPrintLevel_flt( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_COGMRESSetPrintLevel_dbl( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_COGMRESSetPrintLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_COGMRESSetPrintLevel( HYPRE_Solver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_COGMRESSetTol_flt( HYPRE_Solver solver, hypre_float tol ); +HYPRE_Int +HYPRE_COGMRESSetTol_dbl( HYPRE_Solver solver, hypre_double tol ); +HYPRE_Int +HYPRE_COGMRESSetTol_long_dbl( HYPRE_Solver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_COGMRESSetTol( HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_COGMRESSetUnroll_flt( HYPRE_Solver solver, HYPRE_Int unroll ); +HYPRE_Int +HYPRE_COGMRESSetUnroll_dbl( HYPRE_Solver solver, HYPRE_Int unroll ); +HYPRE_Int +HYPRE_COGMRESSetUnroll_long_dbl( HYPRE_Solver solver, HYPRE_Int unroll ); +HYPRE_Int +HYPRE_COGMRESSetUnroll( HYPRE_Solver solver, HYPRE_Int unroll ); + +HYPRE_Int +HYPRE_COGMRESSetup_flt( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_COGMRESSetup_dbl( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_COGMRESSetup_long_dbl( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_COGMRESSetup( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); + +HYPRE_Int +HYPRE_COGMRESSolve_flt( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_COGMRESSolve_dbl( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_COGMRESSolve_long_dbl( 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_FlexGMRESGetConverged_flt( HYPRE_Solver solver, HYPRE_Int *converged ); +HYPRE_Int +HYPRE_FlexGMRESGetConverged_dbl( HYPRE_Solver solver, HYPRE_Int *converged ); +HYPRE_Int +HYPRE_FlexGMRESGetConverged_long_dbl( HYPRE_Solver solver, HYPRE_Int *converged ); +HYPRE_Int +HYPRE_FlexGMRESGetConverged( HYPRE_Solver solver, HYPRE_Int *converged ); + +HYPRE_Int +HYPRE_FlexGMRESGetConvergenceFactorTol_flt( HYPRE_Solver solver, hypre_float *cf_tol ); +HYPRE_Int +HYPRE_FlexGMRESGetConvergenceFactorTol_dbl( HYPRE_Solver solver, hypre_double *cf_tol ); +HYPRE_Int +HYPRE_FlexGMRESGetConvergenceFactorTol_long_dbl( HYPRE_Solver solver, hypre_long_double *cf_tol ); +HYPRE_Int +HYPRE_FlexGMRESGetConvergenceFactorTol( HYPRE_Solver solver, void *cf_tol ); + +HYPRE_Int +HYPRE_FlexGMRESGetFinalRelativeResidualNorm_flt( HYPRE_Solver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_FlexGMRESGetFinalRelativeResidualNorm_dbl( HYPRE_Solver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_FlexGMRESGetFinalRelativeResidualNorm_long_dbl( HYPRE_Solver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_FlexGMRESGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *norm ); + +HYPRE_Int +HYPRE_FlexGMRESGetKDim_flt( HYPRE_Solver solver, HYPRE_Int *k_dim ); +HYPRE_Int +HYPRE_FlexGMRESGetKDim_dbl( HYPRE_Solver solver, HYPRE_Int *k_dim ); +HYPRE_Int +HYPRE_FlexGMRESGetKDim_long_dbl( HYPRE_Solver solver, HYPRE_Int *k_dim ); +HYPRE_Int +HYPRE_FlexGMRESGetKDim( HYPRE_Solver solver, HYPRE_Int *k_dim ); + +HYPRE_Int +HYPRE_FlexGMRESGetLogging_flt( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int +HYPRE_FlexGMRESGetLogging_dbl( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int +HYPRE_FlexGMRESGetLogging_long_dbl( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int +HYPRE_FlexGMRESGetLogging( HYPRE_Solver solver, HYPRE_Int *level ); + +HYPRE_Int +HYPRE_FlexGMRESGetMaxIter_flt( HYPRE_Solver solver, HYPRE_Int *max_iter ); +HYPRE_Int +HYPRE_FlexGMRESGetMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int *max_iter ); +HYPRE_Int +HYPRE_FlexGMRESGetMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int *max_iter ); +HYPRE_Int +HYPRE_FlexGMRESGetMaxIter( HYPRE_Solver solver, HYPRE_Int *max_iter ); + +HYPRE_Int +HYPRE_FlexGMRESGetMinIter_flt( HYPRE_Solver solver, HYPRE_Int *min_iter ); +HYPRE_Int +HYPRE_FlexGMRESGetMinIter_dbl( HYPRE_Solver solver, HYPRE_Int *min_iter ); +HYPRE_Int +HYPRE_FlexGMRESGetMinIter_long_dbl( HYPRE_Solver solver, HYPRE_Int *min_iter ); +HYPRE_Int +HYPRE_FlexGMRESGetMinIter( HYPRE_Solver solver, HYPRE_Int *min_iter ); + +HYPRE_Int +HYPRE_FlexGMRESGetNumIterations_flt( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_FlexGMRESGetNumIterations_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_FlexGMRESGetNumIterations_long_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_FlexGMRESGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_FlexGMRESGetPrecond_flt( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +HYPRE_FlexGMRESGetPrecond_dbl( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +HYPRE_FlexGMRESGetPrecond_long_dbl( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +HYPRE_FlexGMRESGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); + +HYPRE_Int +HYPRE_FlexGMRESGetPrintLevel_flt( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int +HYPRE_FlexGMRESGetPrintLevel_dbl( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int +HYPRE_FlexGMRESGetPrintLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int +HYPRE_FlexGMRESGetPrintLevel( HYPRE_Solver solver, HYPRE_Int *level ); + +HYPRE_Int +HYPRE_FlexGMRESGetResidual_flt( HYPRE_Solver solver, void *residual ); +HYPRE_Int +HYPRE_FlexGMRESGetResidual_dbl( HYPRE_Solver solver, void *residual ); +HYPRE_Int +HYPRE_FlexGMRESGetResidual_long_dbl( HYPRE_Solver solver, void *residual ); +HYPRE_Int +HYPRE_FlexGMRESGetResidual( HYPRE_Solver solver, void *residual ); + +HYPRE_Int +HYPRE_FlexGMRESGetTol_flt( HYPRE_Solver solver, hypre_float *tol ); +HYPRE_Int +HYPRE_FlexGMRESGetTol_dbl( HYPRE_Solver solver, hypre_double *tol ); +HYPRE_Int +HYPRE_FlexGMRESGetTol_long_dbl( HYPRE_Solver solver, hypre_long_double *tol ); +HYPRE_Int +HYPRE_FlexGMRESGetTol( HYPRE_Solver solver, void *tol ); + +HYPRE_Int +HYPRE_FlexGMRESSetAbsoluteTol_flt( HYPRE_Solver solver, hypre_float a_tol ); +HYPRE_Int +HYPRE_FlexGMRESSetAbsoluteTol_dbl( HYPRE_Solver solver, hypre_double a_tol ); +HYPRE_Int +HYPRE_FlexGMRESSetAbsoluteTol_long_dbl( HYPRE_Solver solver, hypre_long_double a_tol ); +HYPRE_Int +HYPRE_FlexGMRESSetAbsoluteTol( HYPRE_Solver solver, hypre_long_double a_tol ); + +HYPRE_Int +HYPRE_FlexGMRESSetConvergenceFactorTol_flt( HYPRE_Solver solver, hypre_float cf_tol ); +HYPRE_Int +HYPRE_FlexGMRESSetConvergenceFactorTol_dbl( HYPRE_Solver solver, hypre_double cf_tol ); +HYPRE_Int +HYPRE_FlexGMRESSetConvergenceFactorTol_long_dbl( HYPRE_Solver solver, hypre_long_double cf_tol ); +HYPRE_Int +HYPRE_FlexGMRESSetConvergenceFactorTol( HYPRE_Solver solver, hypre_long_double cf_tol ); + +HYPRE_Int +HYPRE_FlexGMRESSetKDim_flt( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_FlexGMRESSetKDim_dbl( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_FlexGMRESSetKDim_long_dbl( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_FlexGMRESSetKDim( HYPRE_Solver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_FlexGMRESSetLogging_flt( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_FlexGMRESSetLogging_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_FlexGMRESSetLogging_long_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_FlexGMRESSetLogging( HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_FlexGMRESSetMaxIter_flt( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_FlexGMRESSetMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_FlexGMRESSetMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_FlexGMRESSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_FlexGMRESSetMinIter_flt( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_FlexGMRESSetMinIter_dbl( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_FlexGMRESSetMinIter_long_dbl( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_FlexGMRESSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_FlexGMRESSetModifyPC_flt( HYPRE_Solver solver, HYPRE_PtrToModifyPCFcn modify_pc ); +HYPRE_Int +HYPRE_FlexGMRESSetModifyPC_dbl( HYPRE_Solver solver, HYPRE_PtrToModifyPCFcn modify_pc ); +HYPRE_Int +HYPRE_FlexGMRESSetModifyPC_long_dbl( HYPRE_Solver solver, HYPRE_PtrToModifyPCFcn modify_pc ); +HYPRE_Int +HYPRE_FlexGMRESSetModifyPC( HYPRE_Solver solver, HYPRE_PtrToModifyPCFcn modify_pc ); + +HYPRE_Int +HYPRE_FlexGMRESSetPrecond_flt( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_FlexGMRESSetPrecond_dbl( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_FlexGMRESSetPrecond_long_dbl( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_FlexGMRESSetPrecond( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_FlexGMRESSetPrintLevel_flt( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_FlexGMRESSetPrintLevel_dbl( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_FlexGMRESSetPrintLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_FlexGMRESSetPrintLevel( HYPRE_Solver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_FlexGMRESSetTol_flt( HYPRE_Solver solver, hypre_float tol ); +HYPRE_Int +HYPRE_FlexGMRESSetTol_dbl( HYPRE_Solver solver, hypre_double tol ); +HYPRE_Int +HYPRE_FlexGMRESSetTol_long_dbl( HYPRE_Solver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_FlexGMRESSetTol( HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_FlexGMRESSetup_flt( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_FlexGMRESSetup_dbl( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_FlexGMRESSetup_long_dbl( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_FlexGMRESSetup( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); + +HYPRE_Int +HYPRE_FlexGMRESSolve_flt( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_FlexGMRESSolve_dbl( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_FlexGMRESSolve_long_dbl( 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_GMRESGetAbsoluteTol_flt( HYPRE_Solver solver, hypre_float *tol ); +HYPRE_Int +HYPRE_GMRESGetAbsoluteTol_dbl( HYPRE_Solver solver, hypre_double *tol ); +HYPRE_Int +HYPRE_GMRESGetAbsoluteTol_long_dbl( HYPRE_Solver solver, hypre_long_double *tol ); +HYPRE_Int +HYPRE_GMRESGetAbsoluteTol( HYPRE_Solver solver, void *tol ); + +HYPRE_Int +HYPRE_GMRESGetConverged_flt( HYPRE_Solver solver, HYPRE_Int *converged ); +HYPRE_Int +HYPRE_GMRESGetConverged_dbl( HYPRE_Solver solver, HYPRE_Int *converged ); +HYPRE_Int +HYPRE_GMRESGetConverged_long_dbl( HYPRE_Solver solver, HYPRE_Int *converged ); +HYPRE_Int +HYPRE_GMRESGetConverged( HYPRE_Solver solver, HYPRE_Int *converged ); + +HYPRE_Int +HYPRE_GMRESGetConvergenceFactorTol_flt( HYPRE_Solver solver, hypre_float *cf_tol ); +HYPRE_Int +HYPRE_GMRESGetConvergenceFactorTol_dbl( HYPRE_Solver solver, hypre_double *cf_tol ); +HYPRE_Int +HYPRE_GMRESGetConvergenceFactorTol_long_dbl( HYPRE_Solver solver, hypre_long_double *cf_tol ); +HYPRE_Int +HYPRE_GMRESGetConvergenceFactorTol( HYPRE_Solver solver, void *cf_tol ); + +HYPRE_Int +HYPRE_GMRESGetFinalRelativeResidualNorm_flt( HYPRE_Solver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_GMRESGetFinalRelativeResidualNorm_dbl( HYPRE_Solver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_GMRESGetFinalRelativeResidualNorm_long_dbl( HYPRE_Solver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_GMRESGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *norm ); + +HYPRE_Int +HYPRE_GMRESGetKDim_flt( HYPRE_Solver solver, HYPRE_Int *k_dim ); +HYPRE_Int +HYPRE_GMRESGetKDim_dbl( HYPRE_Solver solver, HYPRE_Int *k_dim ); +HYPRE_Int +HYPRE_GMRESGetKDim_long_dbl( HYPRE_Solver solver, HYPRE_Int *k_dim ); +HYPRE_Int +HYPRE_GMRESGetKDim( HYPRE_Solver solver, HYPRE_Int *k_dim ); + +HYPRE_Int +HYPRE_GMRESGetLogging_flt( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int +HYPRE_GMRESGetLogging_dbl( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int +HYPRE_GMRESGetLogging_long_dbl( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int +HYPRE_GMRESGetLogging( HYPRE_Solver solver, HYPRE_Int *level ); + +HYPRE_Int +HYPRE_GMRESGetMaxIter_flt( HYPRE_Solver solver, HYPRE_Int *max_iter ); +HYPRE_Int +HYPRE_GMRESGetMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int *max_iter ); +HYPRE_Int +HYPRE_GMRESGetMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int *max_iter ); +HYPRE_Int +HYPRE_GMRESGetMaxIter( HYPRE_Solver solver, HYPRE_Int *max_iter ); + +HYPRE_Int +HYPRE_GMRESGetMinIter_flt( HYPRE_Solver solver, HYPRE_Int *min_iter ); +HYPRE_Int +HYPRE_GMRESGetMinIter_dbl( HYPRE_Solver solver, HYPRE_Int *min_iter ); +HYPRE_Int +HYPRE_GMRESGetMinIter_long_dbl( HYPRE_Solver solver, HYPRE_Int *min_iter ); +HYPRE_Int +HYPRE_GMRESGetMinIter( HYPRE_Solver solver, HYPRE_Int *min_iter ); + +HYPRE_Int +HYPRE_GMRESGetNumIterations_flt( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_GMRESGetNumIterations_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_GMRESGetNumIterations_long_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_GMRESGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_GMRESGetPrecond_flt( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +HYPRE_GMRESGetPrecond_dbl( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +HYPRE_GMRESGetPrecond_long_dbl( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +HYPRE_GMRESGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); + +HYPRE_Int +HYPRE_GMRESGetPrecondMatrix_flt( HYPRE_Solver solver, HYPRE_Matrix *precond_matrix_ptr ); +HYPRE_Int +HYPRE_GMRESGetPrecondMatrix_dbl( HYPRE_Solver solver, HYPRE_Matrix *precond_matrix_ptr ); +HYPRE_Int +HYPRE_GMRESGetPrecondMatrix_long_dbl( HYPRE_Solver solver, HYPRE_Matrix *precond_matrix_ptr ); +HYPRE_Int +HYPRE_GMRESGetPrecondMatrix( HYPRE_Solver solver, HYPRE_Matrix *precond_matrix_ptr ); + +HYPRE_Int +HYPRE_GMRESGetPrintLevel_flt( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int +HYPRE_GMRESGetPrintLevel_dbl( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int +HYPRE_GMRESGetPrintLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int +HYPRE_GMRESGetPrintLevel( HYPRE_Solver solver, HYPRE_Int *level ); + +HYPRE_Int +HYPRE_GMRESGetRefSolution_flt( HYPRE_Solver solver, HYPRE_Vector *xref ); +HYPRE_Int +HYPRE_GMRESGetRefSolution_dbl( HYPRE_Solver solver, HYPRE_Vector *xref ); +HYPRE_Int +HYPRE_GMRESGetRefSolution_long_dbl( HYPRE_Solver solver, HYPRE_Vector *xref ); +HYPRE_Int +HYPRE_GMRESGetRefSolution( HYPRE_Solver solver, HYPRE_Vector *xref ); + +HYPRE_Int +HYPRE_GMRESGetRelChange_flt( HYPRE_Solver solver, HYPRE_Int *rel_change ); +HYPRE_Int +HYPRE_GMRESGetRelChange_dbl( HYPRE_Solver solver, HYPRE_Int *rel_change ); +HYPRE_Int +HYPRE_GMRESGetRelChange_long_dbl( HYPRE_Solver solver, HYPRE_Int *rel_change ); +HYPRE_Int +HYPRE_GMRESGetRelChange( HYPRE_Solver solver, HYPRE_Int *rel_change ); + +HYPRE_Int +HYPRE_GMRESGetResidual_flt( HYPRE_Solver solver, void *residual ); +HYPRE_Int +HYPRE_GMRESGetResidual_dbl( HYPRE_Solver solver, void *residual ); +HYPRE_Int +HYPRE_GMRESGetResidual_long_dbl( HYPRE_Solver solver, void *residual ); +HYPRE_Int +HYPRE_GMRESGetResidual( HYPRE_Solver solver, void *residual ); + +HYPRE_Int +HYPRE_GMRESGetSkipRealResidualCheck_flt( HYPRE_Solver solver, HYPRE_Int *skip_real_r_check ); +HYPRE_Int +HYPRE_GMRESGetSkipRealResidualCheck_dbl( HYPRE_Solver solver, HYPRE_Int *skip_real_r_check ); +HYPRE_Int +HYPRE_GMRESGetSkipRealResidualCheck_long_dbl( 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_GMRESGetStopCrit_flt( HYPRE_Solver solver, HYPRE_Int *stop_crit ); +HYPRE_Int +HYPRE_GMRESGetStopCrit_dbl( HYPRE_Solver solver, HYPRE_Int *stop_crit ); +HYPRE_Int +HYPRE_GMRESGetStopCrit_long_dbl( HYPRE_Solver solver, HYPRE_Int *stop_crit ); +HYPRE_Int +HYPRE_GMRESGetStopCrit( HYPRE_Solver solver, HYPRE_Int *stop_crit ); + +HYPRE_Int +HYPRE_GMRESGetTol_flt( HYPRE_Solver solver, hypre_float *tol ); +HYPRE_Int +HYPRE_GMRESGetTol_dbl( HYPRE_Solver solver, hypre_double *tol ); +HYPRE_Int +HYPRE_GMRESGetTol_long_dbl( HYPRE_Solver solver, hypre_long_double *tol ); +HYPRE_Int +HYPRE_GMRESGetTol( HYPRE_Solver solver, void *tol ); + +HYPRE_Int +HYPRE_GMRESSetAbsoluteTol_flt( HYPRE_Solver solver, hypre_float a_tol ); +HYPRE_Int +HYPRE_GMRESSetAbsoluteTol_dbl( HYPRE_Solver solver, hypre_double a_tol ); +HYPRE_Int +HYPRE_GMRESSetAbsoluteTol_long_dbl( HYPRE_Solver solver, hypre_long_double a_tol ); +HYPRE_Int +HYPRE_GMRESSetAbsoluteTol( HYPRE_Solver solver, hypre_long_double a_tol ); + +HYPRE_Int +HYPRE_GMRESSetConvergenceFactorTol_flt( HYPRE_Solver solver, hypre_float cf_tol ); +HYPRE_Int +HYPRE_GMRESSetConvergenceFactorTol_dbl( HYPRE_Solver solver, hypre_double cf_tol ); +HYPRE_Int +HYPRE_GMRESSetConvergenceFactorTol_long_dbl( HYPRE_Solver solver, hypre_long_double cf_tol ); +HYPRE_Int +HYPRE_GMRESSetConvergenceFactorTol( HYPRE_Solver solver, hypre_long_double cf_tol ); + +HYPRE_Int +HYPRE_GMRESSetKDim_flt( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_GMRESSetKDim_dbl( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_GMRESSetKDim_long_dbl( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_GMRESSetKDim( HYPRE_Solver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_GMRESSetLogging_flt( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_GMRESSetLogging_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_GMRESSetLogging_long_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_GMRESSetLogging( HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_GMRESSetMaxIter_flt( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_GMRESSetMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_GMRESSetMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_GMRESSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_GMRESSetMinIter_flt( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_GMRESSetMinIter_dbl( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_GMRESSetMinIter_long_dbl( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_GMRESSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_GMRESSetPrecond_flt( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_GMRESSetPrecond_dbl( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_GMRESSetPrecond_long_dbl( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_GMRESSetPrecond( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_GMRESSetPrecondMatrix_flt( HYPRE_Solver solver, HYPRE_Matrix precond_matrix ); +HYPRE_Int +HYPRE_GMRESSetPrecondMatrix_dbl( HYPRE_Solver solver, HYPRE_Matrix precond_matrix ); +HYPRE_Int +HYPRE_GMRESSetPrecondMatrix_long_dbl( HYPRE_Solver solver, HYPRE_Matrix precond_matrix ); +HYPRE_Int +HYPRE_GMRESSetPrecondMatrix( HYPRE_Solver solver, HYPRE_Matrix precond_matrix ); + +HYPRE_Int +HYPRE_GMRESSetPrintLevel_flt( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_GMRESSetPrintLevel_dbl( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_GMRESSetPrintLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_GMRESSetPrintLevel( HYPRE_Solver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_GMRESSetRefSolution_flt( HYPRE_Solver solver, HYPRE_Vector xref ); +HYPRE_Int +HYPRE_GMRESSetRefSolution_dbl( HYPRE_Solver solver, HYPRE_Vector xref ); +HYPRE_Int +HYPRE_GMRESSetRefSolution_long_dbl( HYPRE_Solver solver, HYPRE_Vector xref ); +HYPRE_Int +HYPRE_GMRESSetRefSolution( HYPRE_Solver solver, HYPRE_Vector xref ); + +HYPRE_Int +HYPRE_GMRESSetRelChange_flt( HYPRE_Solver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_GMRESSetRelChange_dbl( HYPRE_Solver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_GMRESSetRelChange_long_dbl( HYPRE_Solver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_GMRESSetRelChange( HYPRE_Solver solver, HYPRE_Int rel_change ); + +HYPRE_Int +HYPRE_GMRESSetSkipRealResidualCheck_flt( HYPRE_Solver solver, HYPRE_Int skip_real_r_check ); +HYPRE_Int +HYPRE_GMRESSetSkipRealResidualCheck_dbl( HYPRE_Solver solver, HYPRE_Int skip_real_r_check ); +HYPRE_Int +HYPRE_GMRESSetSkipRealResidualCheck_long_dbl( HYPRE_Solver solver, HYPRE_Int skip_real_r_check ); +HYPRE_Int +HYPRE_GMRESSetSkipRealResidualCheck( HYPRE_Solver solver, HYPRE_Int skip_real_r_check ); + +HYPRE_Int +HYPRE_GMRESSetStopCrit_flt( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_GMRESSetStopCrit_dbl( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_GMRESSetStopCrit_long_dbl( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_GMRESSetStopCrit( HYPRE_Solver solver, HYPRE_Int stop_crit ); + +HYPRE_Int +HYPRE_GMRESSetTol_flt( HYPRE_Solver solver, hypre_float tol ); +HYPRE_Int +HYPRE_GMRESSetTol_dbl( HYPRE_Solver solver, hypre_double tol ); +HYPRE_Int +HYPRE_GMRESSetTol_long_dbl( HYPRE_Solver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_GMRESSetTol( HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_GMRESSetup_flt( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_GMRESSetup_dbl( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_GMRESSetup_long_dbl( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_GMRESSetup( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); + +HYPRE_Int +HYPRE_GMRESSolve_flt( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_GMRESSolve_dbl( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_GMRESSolve_long_dbl( 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_LGMRESGetAugDim_flt( HYPRE_Solver solver, HYPRE_Int *k_dim ); +HYPRE_Int +HYPRE_LGMRESGetAugDim_dbl( HYPRE_Solver solver, HYPRE_Int *k_dim ); +HYPRE_Int +HYPRE_LGMRESGetAugDim_long_dbl( HYPRE_Solver solver, HYPRE_Int *k_dim ); +HYPRE_Int +HYPRE_LGMRESGetAugDim( HYPRE_Solver solver, HYPRE_Int *k_dim ); + +HYPRE_Int +HYPRE_LGMRESGetConverged_flt( HYPRE_Solver solver, HYPRE_Int *converged ); +HYPRE_Int +HYPRE_LGMRESGetConverged_dbl( HYPRE_Solver solver, HYPRE_Int *converged ); +HYPRE_Int +HYPRE_LGMRESGetConverged_long_dbl( HYPRE_Solver solver, HYPRE_Int *converged ); +HYPRE_Int +HYPRE_LGMRESGetConverged( HYPRE_Solver solver, HYPRE_Int *converged ); + +HYPRE_Int +HYPRE_LGMRESGetConvergenceFactorTol_flt( HYPRE_Solver solver, hypre_float *cf_tol ); +HYPRE_Int +HYPRE_LGMRESGetConvergenceFactorTol_dbl( HYPRE_Solver solver, hypre_double *cf_tol ); +HYPRE_Int +HYPRE_LGMRESGetConvergenceFactorTol_long_dbl( HYPRE_Solver solver, hypre_long_double *cf_tol ); +HYPRE_Int +HYPRE_LGMRESGetConvergenceFactorTol( HYPRE_Solver solver, void *cf_tol ); + +HYPRE_Int +HYPRE_LGMRESGetFinalRelativeResidualNorm_flt( HYPRE_Solver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_LGMRESGetFinalRelativeResidualNorm_dbl( HYPRE_Solver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_LGMRESGetFinalRelativeResidualNorm_long_dbl( HYPRE_Solver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_LGMRESGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *norm ); + +HYPRE_Int +HYPRE_LGMRESGetKDim_flt( HYPRE_Solver solver, HYPRE_Int *k_dim ); +HYPRE_Int +HYPRE_LGMRESGetKDim_dbl( HYPRE_Solver solver, HYPRE_Int *k_dim ); +HYPRE_Int +HYPRE_LGMRESGetKDim_long_dbl( HYPRE_Solver solver, HYPRE_Int *k_dim ); +HYPRE_Int +HYPRE_LGMRESGetKDim( HYPRE_Solver solver, HYPRE_Int *k_dim ); + +HYPRE_Int +HYPRE_LGMRESGetLogging_flt( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int +HYPRE_LGMRESGetLogging_dbl( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int +HYPRE_LGMRESGetLogging_long_dbl( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int +HYPRE_LGMRESGetLogging( HYPRE_Solver solver, HYPRE_Int *level ); + +HYPRE_Int +HYPRE_LGMRESGetMaxIter_flt( HYPRE_Solver solver, HYPRE_Int *max_iter ); +HYPRE_Int +HYPRE_LGMRESGetMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int *max_iter ); +HYPRE_Int +HYPRE_LGMRESGetMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int *max_iter ); +HYPRE_Int +HYPRE_LGMRESGetMaxIter( HYPRE_Solver solver, HYPRE_Int *max_iter ); + +HYPRE_Int +HYPRE_LGMRESGetMinIter_flt( HYPRE_Solver solver, HYPRE_Int *min_iter ); +HYPRE_Int +HYPRE_LGMRESGetMinIter_dbl( HYPRE_Solver solver, HYPRE_Int *min_iter ); +HYPRE_Int +HYPRE_LGMRESGetMinIter_long_dbl( HYPRE_Solver solver, HYPRE_Int *min_iter ); +HYPRE_Int +HYPRE_LGMRESGetMinIter( HYPRE_Solver solver, HYPRE_Int *min_iter ); + +HYPRE_Int +HYPRE_LGMRESGetNumIterations_flt( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_LGMRESGetNumIterations_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_LGMRESGetNumIterations_long_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_LGMRESGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_LGMRESGetPrecond_flt( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +HYPRE_LGMRESGetPrecond_dbl( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +HYPRE_LGMRESGetPrecond_long_dbl( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +HYPRE_LGMRESGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); + +HYPRE_Int +HYPRE_LGMRESGetPrintLevel_flt( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int +HYPRE_LGMRESGetPrintLevel_dbl( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int +HYPRE_LGMRESGetPrintLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int +HYPRE_LGMRESGetPrintLevel( HYPRE_Solver solver, HYPRE_Int *level ); + +HYPRE_Int +HYPRE_LGMRESGetResidual_flt( HYPRE_Solver solver, void *residual ); +HYPRE_Int +HYPRE_LGMRESGetResidual_dbl( HYPRE_Solver solver, void *residual ); +HYPRE_Int +HYPRE_LGMRESGetResidual_long_dbl( HYPRE_Solver solver, void *residual ); +HYPRE_Int +HYPRE_LGMRESGetResidual( HYPRE_Solver solver, void *residual ); + +HYPRE_Int +HYPRE_LGMRESGetTol_flt( HYPRE_Solver solver, hypre_float *tol ); +HYPRE_Int +HYPRE_LGMRESGetTol_dbl( HYPRE_Solver solver, hypre_double *tol ); +HYPRE_Int +HYPRE_LGMRESGetTol_long_dbl( HYPRE_Solver solver, hypre_long_double *tol ); +HYPRE_Int +HYPRE_LGMRESGetTol( HYPRE_Solver solver, void *tol ); + +HYPRE_Int +HYPRE_LGMRESSetAbsoluteTol_flt( HYPRE_Solver solver, hypre_float a_tol ); +HYPRE_Int +HYPRE_LGMRESSetAbsoluteTol_dbl( HYPRE_Solver solver, hypre_double a_tol ); +HYPRE_Int +HYPRE_LGMRESSetAbsoluteTol_long_dbl( HYPRE_Solver solver, hypre_long_double a_tol ); +HYPRE_Int +HYPRE_LGMRESSetAbsoluteTol( HYPRE_Solver solver, hypre_long_double a_tol ); + +HYPRE_Int +HYPRE_LGMRESSetAugDim_flt( HYPRE_Solver solver, HYPRE_Int aug_dim ); +HYPRE_Int +HYPRE_LGMRESSetAugDim_dbl( HYPRE_Solver solver, HYPRE_Int aug_dim ); +HYPRE_Int +HYPRE_LGMRESSetAugDim_long_dbl( HYPRE_Solver solver, HYPRE_Int aug_dim ); +HYPRE_Int +HYPRE_LGMRESSetAugDim( HYPRE_Solver solver, HYPRE_Int aug_dim ); + +HYPRE_Int +HYPRE_LGMRESSetConvergenceFactorTol_flt( HYPRE_Solver solver, hypre_float cf_tol ); +HYPRE_Int +HYPRE_LGMRESSetConvergenceFactorTol_dbl( HYPRE_Solver solver, hypre_double cf_tol ); +HYPRE_Int +HYPRE_LGMRESSetConvergenceFactorTol_long_dbl( HYPRE_Solver solver, hypre_long_double cf_tol ); +HYPRE_Int +HYPRE_LGMRESSetConvergenceFactorTol( HYPRE_Solver solver, hypre_long_double cf_tol ); + +HYPRE_Int +HYPRE_LGMRESSetKDim_flt( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_LGMRESSetKDim_dbl( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_LGMRESSetKDim_long_dbl( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_LGMRESSetKDim( HYPRE_Solver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_LGMRESSetLogging_flt( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_LGMRESSetLogging_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_LGMRESSetLogging_long_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_LGMRESSetLogging( HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_LGMRESSetMaxIter_flt( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_LGMRESSetMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_LGMRESSetMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_LGMRESSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_LGMRESSetMinIter_flt( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_LGMRESSetMinIter_dbl( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_LGMRESSetMinIter_long_dbl( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_LGMRESSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_LGMRESSetPrecond_flt( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_LGMRESSetPrecond_dbl( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_LGMRESSetPrecond_long_dbl( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_LGMRESSetPrecond( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_LGMRESSetPrintLevel_flt( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_LGMRESSetPrintLevel_dbl( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_LGMRESSetPrintLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_LGMRESSetPrintLevel( HYPRE_Solver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_LGMRESSetTol_flt( HYPRE_Solver solver, hypre_float tol ); +HYPRE_Int +HYPRE_LGMRESSetTol_dbl( HYPRE_Solver solver, hypre_double tol ); +HYPRE_Int +HYPRE_LGMRESSetTol_long_dbl( HYPRE_Solver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_LGMRESSetTol( HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_LGMRESSetup_flt( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_LGMRESSetup_dbl( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_LGMRESSetup_long_dbl( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_LGMRESSetup( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); + +HYPRE_Int +HYPRE_LGMRESSolve_flt( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_LGMRESSolve_dbl( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_LGMRESSolve_long_dbl( 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_PCGGetAbsoluteTolFactor_flt( HYPRE_Solver solver, hypre_float *abstolf ); +HYPRE_Int +HYPRE_PCGGetAbsoluteTolFactor_dbl( HYPRE_Solver solver, hypre_double *abstolf ); +HYPRE_Int +HYPRE_PCGGetAbsoluteTolFactor_long_dbl( HYPRE_Solver solver, hypre_long_double *abstolf ); +HYPRE_Int +HYPRE_PCGGetAbsoluteTolFactor( HYPRE_Solver solver, void *abstolf ); + +HYPRE_Int +HYPRE_PCGGetConverged_flt( HYPRE_Solver solver, HYPRE_Int *converged ); +HYPRE_Int +HYPRE_PCGGetConverged_dbl( HYPRE_Solver solver, HYPRE_Int *converged ); +HYPRE_Int +HYPRE_PCGGetConverged_long_dbl( HYPRE_Solver solver, HYPRE_Int *converged ); +HYPRE_Int +HYPRE_PCGGetConverged( HYPRE_Solver solver, HYPRE_Int *converged ); + +HYPRE_Int +HYPRE_PCGGetConvergenceFactorTol_flt( HYPRE_Solver solver, hypre_float *cf_tol ); +HYPRE_Int +HYPRE_PCGGetConvergenceFactorTol_dbl( HYPRE_Solver solver, hypre_double *cf_tol ); +HYPRE_Int +HYPRE_PCGGetConvergenceFactorTol_long_dbl( HYPRE_Solver solver, hypre_long_double *cf_tol ); +HYPRE_Int +HYPRE_PCGGetConvergenceFactorTol( HYPRE_Solver solver, void *cf_tol ); + +HYPRE_Int +HYPRE_PCGGetFinalRelativeResidualNorm_flt( HYPRE_Solver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_PCGGetFinalRelativeResidualNorm_dbl( HYPRE_Solver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_PCGGetFinalRelativeResidualNorm_long_dbl( HYPRE_Solver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_PCGGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *norm ); + +HYPRE_Int +HYPRE_PCGGetFlex_flt( HYPRE_Solver solver, HYPRE_Int *flex ); +HYPRE_Int +HYPRE_PCGGetFlex_dbl( HYPRE_Solver solver, HYPRE_Int *flex ); +HYPRE_Int +HYPRE_PCGGetFlex_long_dbl( HYPRE_Solver solver, HYPRE_Int *flex ); +HYPRE_Int +HYPRE_PCGGetFlex( HYPRE_Solver solver, HYPRE_Int *flex ); + +HYPRE_Int +HYPRE_PCGGetLogging_flt( HYPRE_Solver solver, HYPRE_Int *logging ); +HYPRE_Int +HYPRE_PCGGetLogging_dbl( HYPRE_Solver solver, HYPRE_Int *logging ); +HYPRE_Int +HYPRE_PCGGetLogging_long_dbl( HYPRE_Solver solver, HYPRE_Int *logging ); +HYPRE_Int +HYPRE_PCGGetLogging( HYPRE_Solver solver, HYPRE_Int *logging ); + +HYPRE_Int +HYPRE_PCGGetMaxIter_flt( HYPRE_Solver solver, HYPRE_Int *max_iter ); +HYPRE_Int +HYPRE_PCGGetMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int *max_iter ); +HYPRE_Int +HYPRE_PCGGetMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int *max_iter ); +HYPRE_Int +HYPRE_PCGGetMaxIter( HYPRE_Solver solver, HYPRE_Int *max_iter ); + +HYPRE_Int +HYPRE_PCGGetNumIterations_flt( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_PCGGetNumIterations_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_PCGGetNumIterations_long_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_PCGGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_PCGGetPrecond_flt( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +HYPRE_PCGGetPrecond_dbl( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +HYPRE_PCGGetPrecond_long_dbl( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +HYPRE_PCGGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); + +HYPRE_Int +HYPRE_PCGGetPrecondMatrix_flt( HYPRE_Solver solver, HYPRE_Matrix *precond_matrix_ptr ); +HYPRE_Int +HYPRE_PCGGetPrecondMatrix_dbl( HYPRE_Solver solver, HYPRE_Matrix *precond_matrix_ptr ); +HYPRE_Int +HYPRE_PCGGetPrecondMatrix_long_dbl( HYPRE_Solver solver, HYPRE_Matrix *precond_matrix_ptr ); +HYPRE_Int +HYPRE_PCGGetPrecondMatrix( HYPRE_Solver solver, HYPRE_Matrix *precond_matrix_ptr ); + +HYPRE_Int +HYPRE_PCGGetPrintLevel_flt( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int +HYPRE_PCGGetPrintLevel_dbl( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int +HYPRE_PCGGetPrintLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int *level ); +HYPRE_Int +HYPRE_PCGGetPrintLevel( HYPRE_Solver solver, HYPRE_Int *level ); + +HYPRE_Int +HYPRE_PCGGetRelChange_flt( HYPRE_Solver solver, HYPRE_Int *rel_change ); +HYPRE_Int +HYPRE_PCGGetRelChange_dbl( HYPRE_Solver solver, HYPRE_Int *rel_change ); +HYPRE_Int +HYPRE_PCGGetRelChange_long_dbl( HYPRE_Solver solver, HYPRE_Int *rel_change ); +HYPRE_Int +HYPRE_PCGGetRelChange( HYPRE_Solver solver, HYPRE_Int *rel_change ); + +HYPRE_Int +HYPRE_PCGGetResidual_flt( HYPRE_Solver solver, void *residual ); +HYPRE_Int +HYPRE_PCGGetResidual_dbl( HYPRE_Solver solver, void *residual ); +HYPRE_Int +HYPRE_PCGGetResidual_long_dbl( HYPRE_Solver solver, void *residual ); +HYPRE_Int +HYPRE_PCGGetResidual( HYPRE_Solver solver, void *residual ); + +HYPRE_Int +HYPRE_PCGGetResidualTol_flt( HYPRE_Solver solver, hypre_float *rtol ); +HYPRE_Int +HYPRE_PCGGetResidualTol_dbl( HYPRE_Solver solver, hypre_double *rtol ); +HYPRE_Int +HYPRE_PCGGetResidualTol_long_dbl( HYPRE_Solver solver, hypre_long_double *rtol ); +HYPRE_Int +HYPRE_PCGGetResidualTol( HYPRE_Solver solver, void *rtol ); + +HYPRE_Int +HYPRE_PCGGetSkipBreak_flt( HYPRE_Solver solver, HYPRE_Int *skip_break ); +HYPRE_Int +HYPRE_PCGGetSkipBreak_dbl( HYPRE_Solver solver, HYPRE_Int *skip_break ); +HYPRE_Int +HYPRE_PCGGetSkipBreak_long_dbl( HYPRE_Solver solver, HYPRE_Int *skip_break ); +HYPRE_Int +HYPRE_PCGGetSkipBreak( HYPRE_Solver solver, HYPRE_Int *skip_break ); + +HYPRE_Int +HYPRE_PCGGetStopCrit_flt( HYPRE_Solver solver, HYPRE_Int *stop_crit ); +HYPRE_Int +HYPRE_PCGGetStopCrit_dbl( HYPRE_Solver solver, HYPRE_Int *stop_crit ); +HYPRE_Int +HYPRE_PCGGetStopCrit_long_dbl( HYPRE_Solver solver, HYPRE_Int *stop_crit ); +HYPRE_Int +HYPRE_PCGGetStopCrit( HYPRE_Solver solver, HYPRE_Int *stop_crit ); + +HYPRE_Int +HYPRE_PCGGetTol_flt( HYPRE_Solver solver, hypre_float *tol ); +HYPRE_Int +HYPRE_PCGGetTol_dbl( HYPRE_Solver solver, hypre_double *tol ); +HYPRE_Int +HYPRE_PCGGetTol_long_dbl( HYPRE_Solver solver, hypre_long_double *tol ); +HYPRE_Int +HYPRE_PCGGetTol( HYPRE_Solver solver, void *tol ); + +HYPRE_Int +HYPRE_PCGGetTwoNorm_flt( HYPRE_Solver solver, HYPRE_Int *two_norm ); +HYPRE_Int +HYPRE_PCGGetTwoNorm_dbl( HYPRE_Solver solver, HYPRE_Int *two_norm ); +HYPRE_Int +HYPRE_PCGGetTwoNorm_long_dbl( HYPRE_Solver solver, HYPRE_Int *two_norm ); +HYPRE_Int +HYPRE_PCGGetTwoNorm( HYPRE_Solver solver, HYPRE_Int *two_norm ); + +HYPRE_Int +HYPRE_PCGSetAbsoluteTol_flt( HYPRE_Solver solver, hypre_float a_tol ); +HYPRE_Int +HYPRE_PCGSetAbsoluteTol_dbl( HYPRE_Solver solver, hypre_double a_tol ); +HYPRE_Int +HYPRE_PCGSetAbsoluteTol_long_dbl( HYPRE_Solver solver, hypre_long_double a_tol ); +HYPRE_Int +HYPRE_PCGSetAbsoluteTol( HYPRE_Solver solver, hypre_long_double a_tol ); + +HYPRE_Int +HYPRE_PCGSetAbsoluteTolFactor_flt( HYPRE_Solver solver, hypre_float abstolf ); +HYPRE_Int +HYPRE_PCGSetAbsoluteTolFactor_dbl( HYPRE_Solver solver, hypre_double abstolf ); +HYPRE_Int +HYPRE_PCGSetAbsoluteTolFactor_long_dbl( HYPRE_Solver solver, hypre_long_double abstolf ); +HYPRE_Int +HYPRE_PCGSetAbsoluteTolFactor( HYPRE_Solver solver, hypre_long_double abstolf ); + +HYPRE_Int +HYPRE_PCGSetConvergenceFactorTol_flt( HYPRE_Solver solver, hypre_float cf_tol ); +HYPRE_Int +HYPRE_PCGSetConvergenceFactorTol_dbl( HYPRE_Solver solver, hypre_double cf_tol ); +HYPRE_Int +HYPRE_PCGSetConvergenceFactorTol_long_dbl( HYPRE_Solver solver, hypre_long_double cf_tol ); +HYPRE_Int +HYPRE_PCGSetConvergenceFactorTol( HYPRE_Solver solver, hypre_long_double cf_tol ); + +HYPRE_Int +HYPRE_PCGSetFlex_flt( HYPRE_Solver solver, HYPRE_Int flex ); +HYPRE_Int +HYPRE_PCGSetFlex_dbl( HYPRE_Solver solver, HYPRE_Int flex ); +HYPRE_Int +HYPRE_PCGSetFlex_long_dbl( HYPRE_Solver solver, HYPRE_Int flex ); +HYPRE_Int +HYPRE_PCGSetFlex( HYPRE_Solver solver, HYPRE_Int flex ); + +HYPRE_Int +HYPRE_PCGSetLogging_flt( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_PCGSetLogging_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_PCGSetLogging_long_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_PCGSetLogging( HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_PCGSetMaxIter_flt( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_PCGSetMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_PCGSetMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_PCGSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_PCGSetPrecond_flt( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_PCGSetPrecond_dbl( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_PCGSetPrecond_long_dbl( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_PCGSetPrecond( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_PCGSetPrecondMatrix_flt( HYPRE_Solver solver, HYPRE_Matrix precond_matrix ); +HYPRE_Int +HYPRE_PCGSetPrecondMatrix_dbl( HYPRE_Solver solver, HYPRE_Matrix precond_matrix ); +HYPRE_Int +HYPRE_PCGSetPrecondMatrix_long_dbl( HYPRE_Solver solver, HYPRE_Matrix precond_matrix ); +HYPRE_Int +HYPRE_PCGSetPrecondMatrix( HYPRE_Solver solver, HYPRE_Matrix precond_matrix ); + +HYPRE_Int +HYPRE_PCGSetPreconditioner_flt( HYPRE_Solver solver, HYPRE_Solver precond ); +HYPRE_Int +HYPRE_PCGSetPreconditioner_dbl( HYPRE_Solver solver, HYPRE_Solver precond ); +HYPRE_Int +HYPRE_PCGSetPreconditioner_long_dbl( HYPRE_Solver solver, HYPRE_Solver precond ); +HYPRE_Int +HYPRE_PCGSetPreconditioner( HYPRE_Solver solver, HYPRE_Solver precond ); + +HYPRE_Int +HYPRE_PCGSetPrintLevel_flt( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_PCGSetPrintLevel_dbl( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_PCGSetPrintLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_PCGSetPrintLevel( HYPRE_Solver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_PCGSetRecomputeResidual_flt( HYPRE_Solver solver, HYPRE_Int recompute_residual ); +HYPRE_Int +HYPRE_PCGSetRecomputeResidual_dbl( HYPRE_Solver solver, HYPRE_Int recompute_residual ); +HYPRE_Int +HYPRE_PCGSetRecomputeResidual_long_dbl( HYPRE_Solver solver, HYPRE_Int recompute_residual ); +HYPRE_Int +HYPRE_PCGSetRecomputeResidual( HYPRE_Solver solver, HYPRE_Int recompute_residual ); + +HYPRE_Int +HYPRE_PCGSetRecomputeResidualP_flt( HYPRE_Solver solver, HYPRE_Int recompute_residual_p ); +HYPRE_Int +HYPRE_PCGSetRecomputeResidualP_dbl( HYPRE_Solver solver, HYPRE_Int recompute_residual_p ); +HYPRE_Int +HYPRE_PCGSetRecomputeResidualP_long_dbl( HYPRE_Solver solver, HYPRE_Int recompute_residual_p ); +HYPRE_Int +HYPRE_PCGSetRecomputeResidualP( HYPRE_Solver solver, HYPRE_Int recompute_residual_p ); + +HYPRE_Int +HYPRE_PCGSetRelChange_flt( HYPRE_Solver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_PCGSetRelChange_dbl( HYPRE_Solver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_PCGSetRelChange_long_dbl( HYPRE_Solver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_PCGSetRelChange( HYPRE_Solver solver, HYPRE_Int rel_change ); + +HYPRE_Int +HYPRE_PCGSetResidualTol_flt( HYPRE_Solver solver, hypre_float rtol ); +HYPRE_Int +HYPRE_PCGSetResidualTol_dbl( HYPRE_Solver solver, hypre_double rtol ); +HYPRE_Int +HYPRE_PCGSetResidualTol_long_dbl( HYPRE_Solver solver, hypre_long_double rtol ); +HYPRE_Int +HYPRE_PCGSetResidualTol( HYPRE_Solver solver, hypre_long_double rtol ); + +HYPRE_Int +HYPRE_PCGSetSkipBreak_flt( HYPRE_Solver solver, HYPRE_Int skip_break ); +HYPRE_Int +HYPRE_PCGSetSkipBreak_dbl( HYPRE_Solver solver, HYPRE_Int skip_break ); +HYPRE_Int +HYPRE_PCGSetSkipBreak_long_dbl( HYPRE_Solver solver, HYPRE_Int skip_break ); +HYPRE_Int +HYPRE_PCGSetSkipBreak( HYPRE_Solver solver, HYPRE_Int skip_break ); + +HYPRE_Int +HYPRE_PCGSetStopCrit_flt( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_PCGSetStopCrit_dbl( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_PCGSetStopCrit_long_dbl( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_PCGSetStopCrit( HYPRE_Solver solver, HYPRE_Int stop_crit ); + +HYPRE_Int +HYPRE_PCGSetTol_flt( HYPRE_Solver solver, hypre_float tol ); +HYPRE_Int +HYPRE_PCGSetTol_dbl( HYPRE_Solver solver, hypre_double tol ); +HYPRE_Int +HYPRE_PCGSetTol_long_dbl( HYPRE_Solver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_PCGSetTol( HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_PCGSetTwoNorm_flt( HYPRE_Solver solver, HYPRE_Int two_norm ); +HYPRE_Int +HYPRE_PCGSetTwoNorm_dbl( HYPRE_Solver solver, HYPRE_Int two_norm ); +HYPRE_Int +HYPRE_PCGSetTwoNorm_long_dbl( HYPRE_Solver solver, HYPRE_Int two_norm ); +HYPRE_Int +HYPRE_PCGSetTwoNorm( HYPRE_Solver solver, HYPRE_Int two_norm ); + +HYPRE_Int +HYPRE_PCGSetup_flt( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_PCGSetup_dbl( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_PCGSetup_long_dbl( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_PCGSetup( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); + +HYPRE_Int +HYPRE_PCGSolve_flt( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_PCGSolve_dbl( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_PCGSolve_long_dbl( 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 ); + + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_BiCGSTABDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_BiCGSTABGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *norm ); + +HYPRE_Int +HYPRE_BiCGSTABGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_BiCGSTABGetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); + +HYPRE_Int +HYPRE_BiCGSTABGetPrecondMatrix_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix *precond_matrix_ptr ); + +HYPRE_Int +HYPRE_BiCGSTABGetResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *residual ); + +HYPRE_Int +HYPRE_BiCGSTABSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double a_tol ); + +HYPRE_Int +HYPRE_BiCGSTABSetConvergenceFactorTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double cf_tol ); + +HYPRE_Int +HYPRE_BiCGSTABSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_BiCGSTABSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_BiCGSTABSetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_BiCGSTABSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_BiCGSTABSetPrecondMatrix_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix precond_matrix ); + +HYPRE_Int +HYPRE_BiCGSTABSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_BiCGSTABSetStopCrit_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int stop_crit ); + +HYPRE_Int +HYPRE_BiCGSTABSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_BiCGSTABSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); + +HYPRE_Int +HYPRE_BiCGSTABSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); + +HYPRE_Int +HYPRE_CGNRDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_CGNRGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *norm ); + +HYPRE_Int +HYPRE_CGNRGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_CGNRGetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); + +HYPRE_Int +HYPRE_CGNRSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_CGNRSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_CGNRSetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_CGNRSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precondT, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_CGNRSetStopCrit_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int stop_crit ); + +HYPRE_Int +HYPRE_CGNRSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_CGNRSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); + +HYPRE_Int +HYPRE_CGNRSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); + +HYPRE_Int +HYPRE_COGMRESGetCGS_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *cgs ); + +HYPRE_Int +HYPRE_COGMRESGetConverged_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *converged ); + +HYPRE_Int +HYPRE_COGMRESGetConvergenceFactorTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *cf_tol ); + +HYPRE_Int +HYPRE_COGMRESGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *norm ); + +HYPRE_Int +HYPRE_COGMRESGetKDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *k_dim ); + +HYPRE_Int +HYPRE_COGMRESGetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *level ); + +HYPRE_Int +HYPRE_COGMRESGetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *max_iter ); + +HYPRE_Int +HYPRE_COGMRESGetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *min_iter ); + +HYPRE_Int +HYPRE_COGMRESGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_COGMRESGetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); + +HYPRE_Int +HYPRE_COGMRESGetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *level ); + +HYPRE_Int +HYPRE_COGMRESGetResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *residual ); + +HYPRE_Int +HYPRE_COGMRESGetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *tol ); + +HYPRE_Int +HYPRE_COGMRESGetUnroll_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *unroll ); + +HYPRE_Int +HYPRE_COGMRESSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double a_tol ); + +HYPRE_Int +HYPRE_COGMRESSetCGS_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int cgs ); + +HYPRE_Int +HYPRE_COGMRESSetConvergenceFactorTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double cf_tol ); + +HYPRE_Int +HYPRE_COGMRESSetKDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_COGMRESSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_COGMRESSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_COGMRESSetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_COGMRESSetModifyPC_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToModifyPCFcn modify_pc ); + +HYPRE_Int +HYPRE_COGMRESSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_COGMRESSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_COGMRESSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_COGMRESSetUnroll_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int unroll ); + +HYPRE_Int +HYPRE_COGMRESSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); + +HYPRE_Int +HYPRE_COGMRESSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); + +HYPRE_Int +HYPRE_FlexGMRESGetConverged_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *converged ); + +HYPRE_Int +HYPRE_FlexGMRESGetConvergenceFactorTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *cf_tol ); + +HYPRE_Int +HYPRE_FlexGMRESGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *norm ); + +HYPRE_Int +HYPRE_FlexGMRESGetKDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *k_dim ); + +HYPRE_Int +HYPRE_FlexGMRESGetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *level ); + +HYPRE_Int +HYPRE_FlexGMRESGetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *max_iter ); + +HYPRE_Int +HYPRE_FlexGMRESGetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *min_iter ); + +HYPRE_Int +HYPRE_FlexGMRESGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_FlexGMRESGetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); + +HYPRE_Int +HYPRE_FlexGMRESGetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *level ); + +HYPRE_Int +HYPRE_FlexGMRESGetResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *residual ); + +HYPRE_Int +HYPRE_FlexGMRESGetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *tol ); + +HYPRE_Int +HYPRE_FlexGMRESSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double a_tol ); + +HYPRE_Int +HYPRE_FlexGMRESSetConvergenceFactorTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double cf_tol ); + +HYPRE_Int +HYPRE_FlexGMRESSetKDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_FlexGMRESSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_FlexGMRESSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_FlexGMRESSetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_FlexGMRESSetModifyPC_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToModifyPCFcn modify_pc ); + +HYPRE_Int +HYPRE_FlexGMRESSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_FlexGMRESSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_FlexGMRESSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_FlexGMRESSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); + +HYPRE_Int +HYPRE_FlexGMRESSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); + +HYPRE_Int +HYPRE_GMRESGetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *tol ); + +HYPRE_Int +HYPRE_GMRESGetConverged_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *converged ); + +HYPRE_Int +HYPRE_GMRESGetConvergenceFactorTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *cf_tol ); + +HYPRE_Int +HYPRE_GMRESGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *norm ); + +HYPRE_Int +HYPRE_GMRESGetKDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *k_dim ); + +HYPRE_Int +HYPRE_GMRESGetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *level ); + +HYPRE_Int +HYPRE_GMRESGetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *max_iter ); + +HYPRE_Int +HYPRE_GMRESGetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *min_iter ); + +HYPRE_Int +HYPRE_GMRESGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_GMRESGetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); + +HYPRE_Int +HYPRE_GMRESGetPrecondMatrix_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix *precond_matrix_ptr ); + +HYPRE_Int +HYPRE_GMRESGetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *level ); + +HYPRE_Int +HYPRE_GMRESGetRefSolution_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Vector *xref ); + +HYPRE_Int +HYPRE_GMRESGetRelChange_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *rel_change ); + +HYPRE_Int +HYPRE_GMRESGetResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *residual ); + +HYPRE_Int +HYPRE_GMRESGetSkipRealResidualCheck_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *skip_real_r_check ); + +HYPRE_Int +HYPRE_GMRESGetStopCrit_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *stop_crit ); + +HYPRE_Int +HYPRE_GMRESGetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *tol ); + +HYPRE_Int +HYPRE_GMRESSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double a_tol ); + +HYPRE_Int +HYPRE_GMRESSetConvergenceFactorTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double cf_tol ); + +HYPRE_Int +HYPRE_GMRESSetKDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_GMRESSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_GMRESSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_GMRESSetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_GMRESSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_GMRESSetPrecondMatrix_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix precond_matrix ); + +HYPRE_Int +HYPRE_GMRESSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_GMRESSetRefSolution_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Vector xref ); + +HYPRE_Int +HYPRE_GMRESSetRelChange_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int rel_change ); + +HYPRE_Int +HYPRE_GMRESSetSkipRealResidualCheck_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int skip_real_r_check ); + +HYPRE_Int +HYPRE_GMRESSetStopCrit_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int stop_crit ); + +HYPRE_Int +HYPRE_GMRESSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_GMRESSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); + +HYPRE_Int +HYPRE_GMRESSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); + +HYPRE_Int +HYPRE_LGMRESGetAugDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *k_dim ); + +HYPRE_Int +HYPRE_LGMRESGetConverged_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *converged ); + +HYPRE_Int +HYPRE_LGMRESGetConvergenceFactorTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *cf_tol ); + +HYPRE_Int +HYPRE_LGMRESGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *norm ); + +HYPRE_Int +HYPRE_LGMRESGetKDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *k_dim ); + +HYPRE_Int +HYPRE_LGMRESGetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *level ); + +HYPRE_Int +HYPRE_LGMRESGetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *max_iter ); + +HYPRE_Int +HYPRE_LGMRESGetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *min_iter ); + +HYPRE_Int +HYPRE_LGMRESGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_LGMRESGetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); + +HYPRE_Int +HYPRE_LGMRESGetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *level ); + +HYPRE_Int +HYPRE_LGMRESGetResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *residual ); + +HYPRE_Int +HYPRE_LGMRESGetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *tol ); + +HYPRE_Int +HYPRE_LGMRESSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double a_tol ); + +HYPRE_Int +HYPRE_LGMRESSetAugDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int aug_dim ); + +HYPRE_Int +HYPRE_LGMRESSetConvergenceFactorTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double cf_tol ); + +HYPRE_Int +HYPRE_LGMRESSetKDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_LGMRESSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_LGMRESSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_LGMRESSetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_LGMRESSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_LGMRESSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_LGMRESSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_LGMRESSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); + +HYPRE_Int +HYPRE_LGMRESSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); + +HYPRE_Int +HYPRE_PCGGetAbsoluteTolFactor_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *abstolf ); + +HYPRE_Int +HYPRE_PCGGetConverged_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *converged ); + +HYPRE_Int +HYPRE_PCGGetConvergenceFactorTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *cf_tol ); + +HYPRE_Int +HYPRE_PCGGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *norm ); + +HYPRE_Int +HYPRE_PCGGetFlex_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *flex ); + +HYPRE_Int +HYPRE_PCGGetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *logging ); + +HYPRE_Int +HYPRE_PCGGetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *max_iter ); + +HYPRE_Int +HYPRE_PCGGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_PCGGetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); + +HYPRE_Int +HYPRE_PCGGetPrecondMatrix_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix *precond_matrix_ptr ); + +HYPRE_Int +HYPRE_PCGGetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *level ); + +HYPRE_Int +HYPRE_PCGGetRelChange_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *rel_change ); + +HYPRE_Int +HYPRE_PCGGetResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *residual ); + +HYPRE_Int +HYPRE_PCGGetResidualTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *rtol ); + +HYPRE_Int +HYPRE_PCGGetSkipBreak_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *skip_break ); + +HYPRE_Int +HYPRE_PCGGetStopCrit_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *stop_crit ); + +HYPRE_Int +HYPRE_PCGGetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *tol ); + +HYPRE_Int +HYPRE_PCGGetTwoNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *two_norm ); + +HYPRE_Int +HYPRE_PCGSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double a_tol ); + +HYPRE_Int +HYPRE_PCGSetAbsoluteTolFactor_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double abstolf ); + +HYPRE_Int +HYPRE_PCGSetConvergenceFactorTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double cf_tol ); + +HYPRE_Int +HYPRE_PCGSetFlex_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int flex ); + +HYPRE_Int +HYPRE_PCGSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_PCGSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_PCGSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_PCGSetPrecondMatrix_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix precond_matrix ); + +HYPRE_Int +HYPRE_PCGSetPreconditioner_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver precond ); + +HYPRE_Int +HYPRE_PCGSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_PCGSetRecomputeResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int recompute_residual ); + +HYPRE_Int +HYPRE_PCGSetRecomputeResidualP_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int recompute_residual_p ); + +HYPRE_Int +HYPRE_PCGSetRelChange_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int rel_change ); + +HYPRE_Int +HYPRE_PCGSetResidualTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double rtol ); + +HYPRE_Int +HYPRE_PCGSetSkipBreak_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int skip_break ); + +HYPRE_Int +HYPRE_PCGSetStopCrit_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int stop_crit ); + +HYPRE_Int +HYPRE_PCGSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_PCGSetTwoNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int two_norm ); + +HYPRE_Int +HYPRE_PCGSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); + +HYPRE_Int +HYPRE_PCGSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); + + +#endif + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/src/krylov/HYPRE_lgmres.c b/src/krylov/HYPRE_lgmres.c index 89baf31ecb..a703956319 100644 --- a/src/krylov/HYPRE_lgmres.c +++ b/src/krylov/HYPRE_lgmres.c @@ -10,7 +10,8 @@ * HYPRE_LGMRES interface * *****************************************************************************/ -#include "krylov.h" + +#include "_hypre_krylov.h" /*-------------------------------------------------------------------------- * HYPRE_LGMRESDestroy diff --git a/src/krylov/HYPRE_lobpcg.c b/src/krylov/HYPRE_lobpcg.c index 870cdde309..69b9abff39 100644 --- a/src/krylov/HYPRE_lobpcg.c +++ b/src/krylov/HYPRE_lobpcg.c @@ -12,493 +12,11 @@ *****************************************************************************/ #include "_hypre_utilities.h" - #include "HYPRE_config.h" #include "HYPRE_lobpcg.h" -#include "lobpcg.h" - -#include "interpreter.h" -#include "HYPRE_MatvecFunctions.h" - -#include "_hypre_lapack.h" - -typedef struct -{ - HYPRE_Int (*Precond)(void*, void*, void*, void*); - HYPRE_Int (*PrecondSetup)(void*, void*, void*, void*); - -} hypre_LOBPCGPrecond; - -typedef struct -{ - lobpcg_Tolerance tolerance; - HYPRE_Int maxIterations; - HYPRE_Int verbosityLevel; - HYPRE_Int precondUsageMode; - HYPRE_Int iterationNumber; - utilities_FortranMatrix* eigenvaluesHistory; - utilities_FortranMatrix* residualNorms; - utilities_FortranMatrix* residualNormsHistory; - -} lobpcg_Data; - -#define lobpcg_tolerance(data) ((data).tolerance) -#define lobpcg_absoluteTolerance(data) ((data).tolerance.absolute) -#define lobpcg_relativeTolerance(data) ((data).tolerance.relative) -#define lobpcg_maxIterations(data) ((data).maxIterations) -#define lobpcg_verbosityLevel(data) ((data).verbosityLevel) -#define lobpcg_precondUsageMode(data) ((data).precondUsageMode) -#define lobpcg_iterationNumber(data) ((data).iterationNumber) -#define lobpcg_eigenvaluesHistory(data) ((data).eigenvaluesHistory) -#define lobpcg_residualNorms(data) ((data).residualNorms) -#define lobpcg_residualNormsHistory(data) ((data).residualNormsHistory) - -typedef struct -{ - - lobpcg_Data lobpcgData; - - mv_InterfaceInterpreter* interpreter; - - void* A; - void* matvecData; - void* precondData; - - void* B; - void* matvecDataB; - void* T; - void* matvecDataT; - - hypre_LOBPCGPrecond precondFunctions; - - HYPRE_MatvecFunctions* matvecFunctions; - -} 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) -{ - 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) -{ - hypre_dpotrf(uplo, n, a, lda, info); - return 0; -} - - -HYPRE_Int -lobpcg_initialize( lobpcg_Data* data ) -{ - (data->tolerance).absolute = 1.0e-06; - (data->tolerance).relative = 1.0e-06; - (data->maxIterations) = 500; - (data->precondUsageMode) = 0; - (data->verbosityLevel) = 0; - (data->eigenvaluesHistory) = utilities_FortranMatrixCreate(); - (data->residualNorms) = utilities_FortranMatrixCreate(); - (data->residualNormsHistory) = utilities_FortranMatrixCreate(); - - return 0; -} - -HYPRE_Int -lobpcg_clean( lobpcg_Data* data ) -{ - utilities_FortranMatrixDestroy( data->eigenvaluesHistory ); - utilities_FortranMatrixDestroy( data->residualNorms ); - utilities_FortranMatrixDestroy( data->residualNormsHistory ); - - return 0; -} - -HYPRE_Int -hypre_LOBPCGDestroy( void *pcg_vdata ) -{ - hypre_LOBPCGData *pcg_data = (hypre_LOBPCGData*)pcg_vdata; - - if (pcg_data) - { - HYPRE_MatvecFunctions * mv = pcg_data->matvecFunctions; - if ( pcg_data->matvecData != NULL ) - { - (*(mv->MatvecDestroy))(pcg_data->matvecData); - pcg_data->matvecData = NULL; - } - if ( pcg_data->matvecDataB != NULL ) - { - (*(mv->MatvecDestroy))(pcg_data->matvecDataB); - pcg_data->matvecDataB = 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); - } - - return hypre_error_flag; -} - -HYPRE_Int -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; - 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 ( 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; -} - -HYPRE_Int -hypre_LOBPCGSetupB( void *pcg_vdata, void *B, void *x ) -{ - hypre_LOBPCGData *pcg_data = (hypre_LOBPCGData*)pcg_vdata; - HYPRE_MatvecFunctions * mv = pcg_data->matvecFunctions; - - (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; -} - -HYPRE_Int -hypre_LOBPCGSetupT( void *pcg_vdata, void *T, void *x ) -{ - hypre_LOBPCGData *pcg_data = (hypre_LOBPCGData*)pcg_vdata; - HYPRE_MatvecFunctions * mv = pcg_data->matvecFunctions; - - (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; -} - -HYPRE_Int -hypre_LOBPCGSetTol( void* pcg_vdata, HYPRE_Real tol ) -{ - 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; - - 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; - - 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; - - lobpcg_precondUsageMode(pcg_data->lobpcgData) = mode; - - return hypre_error_flag; -} - -HYPRE_Int -hypre_LOBPCGGetPrecond( void *pcg_vdata, - HYPRE_Solver *precond_data_ptr ) -{ - hypre_LOBPCGData* pcg_data = (hypre_LOBPCGData*)pcg_vdata; - - *precond_data_ptr = (HYPRE_Solver)(pcg_data -> precondData); - - return hypre_error_flag; -} - -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_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; -} - -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; -} - -void -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; - - if ( precond == NULL ) - { - (*(ii->CopyVector))(x, y); - return; - } - - if ( lobpcg_precondUsageMode(data->lobpcgData) == 0 ) - { - (*(ii->ClearVector))(y); - } - else - { - (*(ii->CopyVector))(x, y); - } - - if ( data->T == NULL ) - { - precond(data->precondData, data->A, x, y); - } - else - { - precond(data->precondData, data->T, x, y); - } -} - -void -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); - - (*(mv->Matvec))(matvec_data, 1.0, pcg_data->A, x, 0.0, y); -} - -void -hypre_LOBPCGOperatorB( void *pcg_vdata, void* x, void* y ) -{ - hypre_LOBPCGData* pcg_data = (hypre_LOBPCGData*)pcg_vdata; - mv_InterfaceInterpreter* ii = pcg_data->interpreter; - HYPRE_MatvecFunctions * mv = pcg_data->matvecFunctions; - void* matvec_data = (pcg_data -> matvecDataB); - - if ( pcg_data->B == NULL ) - { - (*(ii->CopyVector))(x, y); - - /* a test */ - /* - (*(ii->ScaleVector))(2.0, y); - */ - - return; - } - - (*(mv->Matvec))(matvec_data, 1.0, pcg_data->B, x, 0.0, y); -} - -void -hypre_LOBPCGMultiPreconditioner( void *data, void * x, void* y ) -{ - hypre_LOBPCGData *pcg_data = (hypre_LOBPCGData*)data; - mv_InterfaceInterpreter* ii = pcg_data->interpreter; - - ii->Eval( hypre_LOBPCGPreconditioner, data, x, y ); -} - -void -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 ); -} - -void -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_LOBPCGData* data = (hypre_LOBPCGData*)vdata; - 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* ); - - HYPRE_Int maxit = lobpcg_maxIterations(data->lobpcgData); - HYPRE_Int verb = lobpcg_verbosityLevel(data->lobpcgData); - - HYPRE_Int n = mv_MultiVectorWidth( vec ); - lobpcg_BLASLAPACKFunctions blap_fn; - - utilities_FortranMatrix* lambdaHistory; - utilities_FortranMatrix* residuals; - utilities_FortranMatrix* residualsHistory; - - 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 ); - - 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, - vdata, operatorB, - vdata, prec, - con, - blap_fn, - lobpcg_tolerance(data->lobpcgData), maxit, verb, - &(lobpcg_iterationNumber(data->lobpcgData)), - val, - utilities_FortranMatrixValues(lambdaHistory), - utilities_FortranMatrixGlobalHeight(lambdaHistory), - utilities_FortranMatrixValues(residuals), - utilities_FortranMatrixValues(residualsHistory), - utilities_FortranMatrixGlobalHeight(residualsHistory) - ); - - return hypre_error_flag; -} - -utilities_FortranMatrix* -hypre_LOBPCGResidualNorms( void *vdata ) -{ - hypre_LOBPCGData *data = (hypre_LOBPCGData*)vdata; - return (lobpcg_residualNorms(data->lobpcgData)); -} - -utilities_FortranMatrix* -hypre_LOBPCGResidualNormsHistory( void *vdata ) -{ - hypre_LOBPCGData *data = (hypre_LOBPCGData*)vdata; - return (lobpcg_residualNormsHistory(data->lobpcgData)); -} - -utilities_FortranMatrix* -hypre_LOBPCGEigenvaluesHistory( void *vdata ) -{ - hypre_LOBPCGData *data = (hypre_LOBPCGData*)vdata; - return (lobpcg_eigenvaluesHistory(data->lobpcgData)); -} - -HYPRE_Int -hypre_LOBPCGIterations( void* vdata ) -{ - hypre_LOBPCGData *data = (hypre_LOBPCGData*)vdata; - return (lobpcg_iterationNumber(data->lobpcgData)); -} - +#include "_hypre_lobpcg.h" +#include "_hypre_lobpcg_interpreter.h" HYPRE_Int HYPRE_LOBPCGCreate( mv_InterfaceInterpreter* ii, HYPRE_MatvecFunctions* mv, @@ -641,16 +159,3 @@ HYPRE_LOBPCGIterations( HYPRE_Solver solver ) { return ( hypre_LOBPCGIterations( (void*)solver ) ); } - -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 ) ); -} - diff --git a/src/krylov/HYPRE_lobpcg.h b/src/krylov/HYPRE_lobpcg.h index fd70c3bdd3..85cbeba645 100644 --- a/src/krylov/HYPRE_lobpcg.h +++ b/src/krylov/HYPRE_lobpcg.h @@ -5,21 +5,38 @@ * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ -#ifndef hypre_LOBPCG_SOLVER -#define hypre_LOBPCG_SOLVER +#ifndef HYPRE_LOBPCG_HEADER +#define HYPRE_LOBPCG_HEADER #include "HYPRE_krylov.h" -#include "fortran_matrix.h" -#include "multivector.h" -#include "interpreter.h" -#include "temp_multivector.h" -#include "HYPRE_MatvecFunctions.h" +#include "_hypre_fortran_matrix.h" +#include "_hypre_lobpcg_multivector.h" +#include "_hypre_lobpcg_interpreter.h" +#include "_hypre_lobpcg_temp_multivector.h" + +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_krylov_mup_def.h" +#endif #ifdef __cplusplus extern "C" { #endif +typedef struct +{ + 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 ); + + void* (*MatMultiVecCreate) ( void *A, void *x ); + HYPRE_Int (*MatMultiVec) ( void *data, HYPRE_Complex alpha, void *A, + void *x, HYPRE_Complex beta, void *y ); + HYPRE_Int (*MatMultiVecDestroy) ( void *data ); + +} HYPRE_MatvecFunctions; + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -155,14 +172,6 @@ HYPRE_LOBPCGEigenvaluesHistory(HYPRE_Solver solver); /* Returns the number of iterations performed by LOBPCG */ HYPRE_Int HYPRE_LOBPCGIterations(HYPRE_Solver solver); -void hypre_LOBPCGMultiOperatorB(void *data, - void *x, - void *y); - -void lobpcg_MultiVectorByMultiVector(mv_MultiVectorPtr x, - mv_MultiVectorPtr y, - utilities_FortranMatrix *xy); - /**@}*/ /*-------------------------------------------------------------------------- @@ -174,4 +183,15 @@ void lobpcg_MultiVectorByMultiVector(mv_MultiVectorPtr x, } #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_krylov_mup_undef.h" +#include "HYPRE_lobpcg_mup.h" +#endif +#endif + #endif diff --git a/src/krylov/HYPRE_lobpcg_mup.h b/src/krylov/HYPRE_lobpcg_mup.h new file mode 100644 index 0000000000..e53c076cd6 --- /dev/null +++ b/src/krylov/HYPRE_lobpcg_mup.h @@ -0,0 +1,257 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#ifndef HYPRE_LOBPCG_MUP_HEADER +#define HYPRE_LOBPCG_MUP_HEADER + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (HYPRE_MIXED_PRECISION) + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_LOBPCGCreate_flt( mv_InterfaceInterpreter *interpreter, HYPRE_MatvecFunctions *mvfunctions, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_LOBPCGCreate_dbl( mv_InterfaceInterpreter *interpreter, HYPRE_MatvecFunctions *mvfunctions, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_LOBPCGCreate_long_dbl( mv_InterfaceInterpreter *interpreter, HYPRE_MatvecFunctions *mvfunctions, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_LOBPCGCreate( mv_InterfaceInterpreter *interpreter, HYPRE_MatvecFunctions *mvfunctions, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_LOBPCGDestroy_flt( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_LOBPCGDestroy_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_LOBPCGDestroy_long_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_LOBPCGDestroy( HYPRE_Solver solver ); + +utilities_FortranMatrix* +HYPRE_LOBPCGEigenvaluesHistory_flt( HYPRE_Solver solver ); +utilities_FortranMatrix* +HYPRE_LOBPCGEigenvaluesHistory_dbl( HYPRE_Solver solver ); +utilities_FortranMatrix* +HYPRE_LOBPCGEigenvaluesHistory_long_dbl( HYPRE_Solver solver ); +utilities_FortranMatrix* +HYPRE_LOBPCGEigenvaluesHistory( HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_LOBPCGGetPrecond_flt( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +HYPRE_LOBPCGGetPrecond_dbl( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +HYPRE_LOBPCGGetPrecond_long_dbl( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +HYPRE_LOBPCGGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); + +HYPRE_Int +HYPRE_LOBPCGIterations_flt( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_LOBPCGIterations_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_LOBPCGIterations_long_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_LOBPCGIterations( HYPRE_Solver solver ); + +utilities_FortranMatrix* +HYPRE_LOBPCGResidualNorms_flt( HYPRE_Solver solver ); +utilities_FortranMatrix* +HYPRE_LOBPCGResidualNorms_dbl( HYPRE_Solver solver ); +utilities_FortranMatrix* +HYPRE_LOBPCGResidualNorms_long_dbl( HYPRE_Solver solver ); +utilities_FortranMatrix* +HYPRE_LOBPCGResidualNorms( HYPRE_Solver solver ); + +utilities_FortranMatrix* +HYPRE_LOBPCGResidualNormsHistory_flt( HYPRE_Solver solver ); +utilities_FortranMatrix* +HYPRE_LOBPCGResidualNormsHistory_dbl( HYPRE_Solver solver ); +utilities_FortranMatrix* +HYPRE_LOBPCGResidualNormsHistory_long_dbl( HYPRE_Solver solver ); +utilities_FortranMatrix* +HYPRE_LOBPCGResidualNormsHistory( HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_LOBPCGSetMaxIter_flt( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_LOBPCGSetMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_LOBPCGSetMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_LOBPCGSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_LOBPCGSetPrecond_flt( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_LOBPCGSetPrecond_dbl( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_LOBPCGSetPrecond_long_dbl( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_LOBPCGSetPrecond( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_LOBPCGSetPrecondUsageMode_flt( HYPRE_Solver solver, HYPRE_Int mode ); +HYPRE_Int +HYPRE_LOBPCGSetPrecondUsageMode_dbl( HYPRE_Solver solver, HYPRE_Int mode ); +HYPRE_Int +HYPRE_LOBPCGSetPrecondUsageMode_long_dbl( HYPRE_Solver solver, HYPRE_Int mode ); +HYPRE_Int +HYPRE_LOBPCGSetPrecondUsageMode( HYPRE_Solver solver, HYPRE_Int mode ); + +HYPRE_Int +HYPRE_LOBPCGSetPrintLevel_flt( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_LOBPCGSetPrintLevel_dbl( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_LOBPCGSetPrintLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_LOBPCGSetPrintLevel( HYPRE_Solver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_LOBPCGSetRTol_flt( HYPRE_Solver solver, hypre_float tol ); +HYPRE_Int +HYPRE_LOBPCGSetRTol_dbl( HYPRE_Solver solver, hypre_double tol ); +HYPRE_Int +HYPRE_LOBPCGSetRTol_long_dbl( HYPRE_Solver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_LOBPCGSetRTol( HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_LOBPCGSetTol_flt( HYPRE_Solver solver, hypre_float tol ); +HYPRE_Int +HYPRE_LOBPCGSetTol_dbl( HYPRE_Solver solver, hypre_double tol ); +HYPRE_Int +HYPRE_LOBPCGSetTol_long_dbl( HYPRE_Solver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_LOBPCGSetTol( HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_LOBPCGSetup_flt( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_LOBPCGSetup_dbl( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_LOBPCGSetup_long_dbl( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); +HYPRE_Int +HYPRE_LOBPCGSetup( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); + +HYPRE_Int +HYPRE_LOBPCGSetupB_flt( HYPRE_Solver solver, HYPRE_Matrix B, HYPRE_Vector x ); +HYPRE_Int +HYPRE_LOBPCGSetupB_dbl( HYPRE_Solver solver, HYPRE_Matrix B, HYPRE_Vector x ); +HYPRE_Int +HYPRE_LOBPCGSetupB_long_dbl( HYPRE_Solver solver, HYPRE_Matrix B, HYPRE_Vector x ); +HYPRE_Int +HYPRE_LOBPCGSetupB( HYPRE_Solver solver, HYPRE_Matrix B, HYPRE_Vector x ); + +HYPRE_Int +HYPRE_LOBPCGSetupT_flt( HYPRE_Solver solver, HYPRE_Matrix T, HYPRE_Vector x ); +HYPRE_Int +HYPRE_LOBPCGSetupT_dbl( HYPRE_Solver solver, HYPRE_Matrix T, HYPRE_Vector x ); +HYPRE_Int +HYPRE_LOBPCGSetupT_long_dbl( HYPRE_Solver solver, HYPRE_Matrix T, HYPRE_Vector x ); +HYPRE_Int +HYPRE_LOBPCGSetupT( HYPRE_Solver solver, HYPRE_Matrix T, HYPRE_Vector x ); + +HYPRE_Int +HYPRE_LOBPCGSolve_flt( HYPRE_Solver solver, mv_MultiVectorPtr y, mv_MultiVectorPtr x, hypre_float *lambda ); +HYPRE_Int +HYPRE_LOBPCGSolve_dbl( HYPRE_Solver solver, mv_MultiVectorPtr y, mv_MultiVectorPtr x, hypre_double *lambda ); +HYPRE_Int +HYPRE_LOBPCGSolve_long_dbl( HYPRE_Solver solver, mv_MultiVectorPtr y, mv_MultiVectorPtr x, hypre_long_double *lambda ); +HYPRE_Int +HYPRE_LOBPCGSolve( HYPRE_Solver solver, mv_MultiVectorPtr y, mv_MultiVectorPtr x, void *lambda ); + + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_LOBPCGCreate_pre( HYPRE_Precision precision, mv_InterfaceInterpreter *interpreter, HYPRE_MatvecFunctions *mvfunctions, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_LOBPCGDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ); + +utilities_FortranMatrix* +HYPRE_LOBPCGEigenvaluesHistory_pre( HYPRE_Precision precision, HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_LOBPCGGetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ); + +HYPRE_Int +HYPRE_LOBPCGIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver ); + +utilities_FortranMatrix* +HYPRE_LOBPCGResidualNorms_pre( HYPRE_Precision precision, HYPRE_Solver solver ); + +utilities_FortranMatrix* +HYPRE_LOBPCGResidualNormsHistory_pre( HYPRE_Precision precision, HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_LOBPCGSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_LOBPCGSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_LOBPCGSetPrecondUsageMode_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int mode ); + +HYPRE_Int +HYPRE_LOBPCGSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_LOBPCGSetRTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_LOBPCGSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_LOBPCGSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ); + +HYPRE_Int +HYPRE_LOBPCGSetupB_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix B, HYPRE_Vector x ); + +HYPRE_Int +HYPRE_LOBPCGSetupT_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix T, HYPRE_Vector x ); + +HYPRE_Int +HYPRE_LOBPCGSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, mv_MultiVectorPtr y, mv_MultiVectorPtr x, void *lambda ); + + +#endif + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/src/krylov/HYPRE_pcg.c b/src/krylov/HYPRE_pcg.c index 02b7e4b166..52310213f9 100644 --- a/src/krylov/HYPRE_pcg.c +++ b/src/krylov/HYPRE_pcg.c @@ -11,7 +11,7 @@ * *****************************************************************************/ -#include "krylov.h" +#include "_hypre_krylov.h" /*-------------------------------------------------------------------------- * HYPRE_PCGCreate: Call class-specific function, e.g. HYPRE_ParCSRPCGCreate @@ -322,6 +322,30 @@ HYPRE_PCGGetPrecond( HYPRE_Solver solver, (HYPRE_Solver *) precond_data_ptr ) ); } +/*-------------------------------------------------------------------------- + * HYPRE_PCGSetPrecondMatrix + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetPrecondMatrix( HYPRE_Solver solver, + HYPRE_Matrix precond_matrix) +{ + return ( hypre_PCGSetPrecondMatrix( (void *) solver, + (void *) precond_matrix) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_PCGetPrecondMatrix + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetPrecondMatrix( HYPRE_Solver solver, + HYPRE_Matrix *precond_matrix_ptr ) +{ + return ( hypre_PCGGetPrecondMatrix( (void *) solver, + (HYPRE_Matrix *) precond_matrix_ptr ) ); +} + /*-------------------------------------------------------------------------- * HYPRE_PCGSetLogging, HYPRE_PCGGetLogging * SetLogging sets both the print and log level, for backwards compatibility. diff --git a/src/krylov/Makefile b/src/krylov/Makefile index d0847e21a0..5116580e2d 100644 --- a/src/krylov/Makefile +++ b/src/krylov/Makefile @@ -6,7 +6,7 @@ include ../config/Makefile.config CINCLUDES = ${INCLUDES} ${MPIINCLUDE} - + C_COMPILE_FLAGS = \ -I..\ -I$(srcdir)/..\ @@ -18,7 +18,8 @@ C_COMPILE_FLAGS = \ HEADERS =\ HYPRE_krylov.h\ - krylov.h\ + _hypre_krylov.h\ + _hypre_lobpcg.h\ bicgstab.h\ cgnr.h\ gmres.h\ @@ -26,9 +27,7 @@ HEADERS =\ flexgmres.h\ lgmres.h\ pcg.h\ - HYPRE_lobpcg.h\ - HYPRE_MatvecFunctions.h\ - lobpcg.h + HYPRE_lobpcg.h FILES =\ bicgstab.c\ @@ -37,6 +36,8 @@ FILES =\ cogmres.c\ flexgmres.c\ lgmres.c\ + pcg.c\ + lobpcg.c\ HYPRE_bicgstab.c\ HYPRE_cgnr.c\ HYPRE_gmres.c\ @@ -44,11 +45,30 @@ FILES =\ HYPRE_lgmres.c\ HYPRE_flexgmres.c\ HYPRE_pcg.c\ - pcg.c\ - HYPRE_lobpcg.c\ - lobpcg.c + HYPRE_lobpcg.c + +# Mixed precision files +MP_FILES = \ + mup_fixed.c\ + mup_functions.c\ + mup_pre.c\ + mup_lobpcg_fixed.c\ + mup_lobpcg_functions.c\ + mup_lobpcg_pre.c + +COBJS = ${FILES:.c=.o} +OBJS = ${COBJS} + +ifeq (${MP_BUILD}, 1) + +COBJS_single = ${FILES:.c=.o_flt} +COBJS_double = ${FILES:.c=.o_dbl} +COBJS_longdouble = ${FILES:.c=.o_ldbl} +MP_COBJS = ${MP_FILES:.c=.o} + +OBJS = ${COBJS_single} ${COBJS_double} ${COBJS_longdouble} ${MP_COBJS} -OBJS = ${FILES:.c=.o} +endif SONAME = libHYPRE_krylov-${HYPRE_RELEASE_VERSION}${HYPRE_LIB_SUFFIX} @@ -58,18 +78,17 @@ SONAME = libHYPRE_krylov-${HYPRE_RELEASE_VERSION}${HYPRE_LIB_SUFFIX} all: libHYPRE_krylov${HYPRE_LIB_SUFFIX} cp -fR $(srcdir)/HYPRE_*.h $(HYPRE_BUILD_DIR)/include - cp -fR $(srcdir)/krylov.h $(HYPRE_BUILD_DIR)/include - cp -fR $(srcdir)/lobpcg.h $(HYPRE_BUILD_DIR)/include + cp -fR $(srcdir)/_hypre_*.h $(HYPRE_BUILD_DIR)/include # cp -fR libHYPRE* $(HYPRE_BUILD_DIR)/lib install: all cp -fR $(srcdir)/HYPRE_*.h $(HYPRE_INC_INSTALL) - cp -fR $(srcdir)/krylov.h $(HYPRE_INC_INSTALL) - cp -fR $(srcdir)/lobpcg.h $(HYPRE_INC_INSTALL) + cp -fR $(srcdir)/_hypre_*.h $(HYPRE_INC_INSTALL) # cp -fR libHYPRE* $(HYPRE_LIB_INSTALL) clean: rm -f *.o libHYPRE* + rm -f *.o_flt *.o_dbl *.o_ldbl rm -rf pchdir tca.map *inslog* distclean: clean diff --git a/src/krylov/_hypre_krylov.h b/src/krylov/_hypre_krylov.h new file mode 100644 index 0000000000..b6c7cc47c0 --- /dev/null +++ b/src/krylov/_hypre_krylov.h @@ -0,0 +1,1494 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use 'headers' to generate) ***/ + +#ifndef hypre_KRYLOV_HEADER +#define hypre_KRYLOV_HEADER + +#include +#include +#include + +#include "HYPRE_krylov.h" +#include "_hypre_utilities.h" + +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_krylov_mup_def.h" +#endif + +#define hypre_CTAllocF(type, count, funcs, location) \ + ( (type *)(*(funcs->CAlloc))((size_t)(count), (size_t)sizeof(type), location) ) + +#define hypre_TFreeF( ptr, funcs ) ( (*(funcs->Free))((void *)ptr), ptr = NULL ) + +#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_KRYLOV_SOLVER_PTRS_HEADER +#define hypre_KRYLOV_SOLVER_PTRS_HEADER + +typedef void * (*hypre_KrylovPtrToCAlloc) (size_t count, size_t elt_size, + HYPRE_MemoryLocation location); +typedef HYPRE_Int (*hypre_KrylovPtrToFree) (void *ptr); +typedef HYPRE_Int (*hypre_KrylovPtrToCommInfo) (void *A, HYPRE_Int *my_id, + HYPRE_Int *num_procs); +typedef void * (*hypre_KrylovPtrToCreateVector) (void *vector); +typedef void * (*hypre_KrylovPtrToCreateVectorArray) (HYPRE_Int size, void *vectors); +typedef HYPRE_Int (*hypre_KrylovPtrToDestroyVector) (void *vector); +typedef void * (*hypre_KrylovPtrToMatvecCreate) (void *A, void *x); +typedef HYPRE_Int (*hypre_KrylovPtrToMatvec) (void *matvec_data, HYPRE_Complex alpha, + void *A, void *x, + HYPRE_Complex beta, void *y); +typedef HYPRE_Int (*hypre_KrylovPtrToMatvecT) (void *matvec_data, HYPRE_Complex alpha, + void *A, void *x, + HYPRE_Complex beta, void *y); +typedef HYPRE_Int (*hypre_KrylovPtrToMatvecDestroy) (void *matvec_data); +typedef HYPRE_Real (*hypre_KrylovPtrToInnerProd) (void *x, void *y); +typedef HYPRE_Int (*hypre_KrylovPtrToInnerProdTagged) (void *x, void *y, HYPRE_Int *num_tags_ptr, + HYPRE_Complex **iprod_ptr ); +typedef HYPRE_Int (*hypre_KrylovPtrToCopyVector) (void *x, void *y); +typedef HYPRE_Int (*hypre_KrylovPtrToClearVector) (void *x); +typedef HYPRE_Int (*hypre_KrylovPtrToScaleVector) (HYPRE_Complex alpha, void *x); +typedef HYPRE_Int (*hypre_KrylovPtrToAxpy) (HYPRE_Complex alpha, void *x, void *y); +typedef HYPRE_Int (*hypre_KrylovPtrToPrecondSetup) (void *vdata, void *A, void *b, void *x); +typedef HYPRE_Int (*hypre_KrylovPtrToPrecond) (void *vdata, void *A, void *b, void *x); +typedef HYPRE_Int (*hypre_KrylovPtrToPrecondT) (void *vdata, void *A, void *b, void *x); +typedef HYPRE_Int (*hypre_KrylovPtrToMassInnerProd) (void *x, void **p, HYPRE_Int k, + HYPRE_Int unroll, void *result); +typedef HYPRE_Int (*hypre_KrylovPtrToMassDotpTwo) (void *x, void *y, void **p, HYPRE_Int k, + HYPRE_Int unroll, void *result_x, + void *result_y); +typedef HYPRE_Int (*hypre_KrylovPtrToMassAxpy) (HYPRE_Complex *alpha, void **x, + void *y, HYPRE_Int k, HYPRE_Int unroll); +typedef HYPRE_Int (*hypre_KrylovPtrToModifyPC) (void *precond_data, HYPRE_Int iteration, + HYPRE_Real rel_residual_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) + ******************************************************************************/ + +/****************************************************************************** + * + * 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 ... + **/ + +typedef struct +{ + hypre_KrylovPtrToCreateVector CreateVector; + hypre_KrylovPtrToDestroyVector DestroyVector; + hypre_KrylovPtrToMatvecCreate MatvecCreate; + hypre_KrylovPtrToMatvec Matvec; + hypre_KrylovPtrToMatvecDestroy MatvecDestroy; + hypre_KrylovPtrToInnerProd InnerProd; + hypre_KrylovPtrToCopyVector CopyVector; + hypre_KrylovPtrToClearVector ClearVector; + hypre_KrylovPtrToScaleVector ScaleVector; + hypre_KrylovPtrToAxpy Axpy; + hypre_KrylovPtrToCommInfo CommInfo; + hypre_KrylovPtrToPrecond precond; + hypre_KrylovPtrToPrecondSetup precond_setup; + +} 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; + void *precond_Mat; + + 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" { +#endif + +/** + * @name generic BiCGSTAB Solver + * + * Description... + **/ +/*@{*/ + +/** + * Description... + * + * @param param [IN] ... + **/ + +hypre_BiCGSTABFunctions * +hypre_BiCGSTABFunctionsCreate( + hypre_KrylovPtrToCreateVector CreateVector, + hypre_KrylovPtrToDestroyVector DestroyVector, + hypre_KrylovPtrToMatvecCreate MatvecCreate, + hypre_KrylovPtrToMatvec Matvec, + hypre_KrylovPtrToMatvecDestroy MatvecDestroy, + hypre_KrylovPtrToInnerProd InnerProd, + hypre_KrylovPtrToCopyVector CopyVector, + hypre_KrylovPtrToClearVector ClearVector, + hypre_KrylovPtrToScaleVector ScaleVector, + hypre_KrylovPtrToAxpy Axpy, + hypre_KrylovPtrToCommInfo CommInfo, + hypre_KrylovPtrToPrecond Precond, + hypre_KrylovPtrToPrecondSetup PrecondSetup +); + +/** + * Description... + * + * @param param [IN] ... + **/ + +#ifdef __cplusplus +} +#endif + +#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) + ******************************************************************************/ + +/****************************************************************************** + * + * 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_KrylovPtrToCommInfo CommInfo; + hypre_KrylovPtrToCreateVector CreateVector; + hypre_KrylovPtrToDestroyVector DestroyVector; + hypre_KrylovPtrToMatvecCreate MatvecCreate; + hypre_KrylovPtrToMatvec Matvec; + hypre_KrylovPtrToMatvecT MatvecT; + hypre_KrylovPtrToMatvecDestroy MatvecDestroy; + hypre_KrylovPtrToInnerProd InnerProd; + hypre_KrylovPtrToCopyVector CopyVector; + hypre_KrylovPtrToClearVector ClearVector; + hypre_KrylovPtrToScaleVector ScaleVector; + hypre_KrylovPtrToAxpy Axpy; + hypre_KrylovPtrToPrecondSetup precond_setup; + hypre_KrylovPtrToPrecond precond; + hypre_KrylovPtrToPrecondT precondT; + +} 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" { +#endif + +/** + * @name generic CGNR Solver + * + * Description... + **/ +/*@{*/ + +/** + * Description... + * + * @param param [IN] ... + **/ +hypre_CGNRFunctions * +hypre_CGNRFunctionsCreate( + hypre_KrylovPtrToCommInfo CommInfo, + hypre_KrylovPtrToCreateVector CreateVector, + hypre_KrylovPtrToDestroyVector DestroyVector, + hypre_KrylovPtrToMatvecCreate MatvecCreate, + hypre_KrylovPtrToMatvec Matvec, + hypre_KrylovPtrToMatvecT MatvecT, + hypre_KrylovPtrToMatvecDestroy MatvecDestroy, + hypre_KrylovPtrToInnerProd InnerProd, + hypre_KrylovPtrToCopyVector CopyVector, + hypre_KrylovPtrToClearVector ClearVector, + hypre_KrylovPtrToScaleVector ScaleVector, + hypre_KrylovPtrToAxpy Axpy, + hypre_KrylovPtrToPrecondSetup PrecondSetup, + hypre_KrylovPtrToPrecond Precond, + hypre_KrylovPtrToPrecondT PrecondT +); + +/** + * Description... + * + * @param param [IN] ... + **/ + +#ifdef __cplusplus +} +#endif + +#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) + ******************************************************************************/ + +/****************************************************************************** + * + * 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 +{ + hypre_KrylovPtrToCAlloc CAlloc; + hypre_KrylovPtrToFree Free; + hypre_KrylovPtrToCommInfo CommInfo; + hypre_KrylovPtrToCreateVector CreateVector; + hypre_KrylovPtrToCreateVectorArray CreateVectorArray; + hypre_KrylovPtrToDestroyVector DestroyVector; + hypre_KrylovPtrToMatvecCreate MatvecCreate; + hypre_KrylovPtrToMatvec Matvec; + hypre_KrylovPtrToMatvecDestroy MatvecDestroy; + hypre_KrylovPtrToInnerProdTagged InnerProd; + hypre_KrylovPtrToCopyVector CopyVector; + hypre_KrylovPtrToClearVector ClearVector; + hypre_KrylovPtrToScaleVector ScaleVector; + hypre_KrylovPtrToAxpy Axpy; + hypre_KrylovPtrToPrecond precond; + hypre_KrylovPtrToPrecondSetup precond_setup; + +} 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 *w_3; + void **p; + void *xref; /* reference solution for error computation */ + + void *matvec_data; + void *precond_data; + void *precond_Mat; + + 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; + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @name generic GMRES Solver + * + * Description... + **/ +/*@{*/ + +/** + * Description... + * + * @param param [IN] ... + **/ + +hypre_GMRESFunctions * +hypre_GMRESFunctionsCreate( + hypre_KrylovPtrToCAlloc CAlloc, + hypre_KrylovPtrToFree Free, + hypre_KrylovPtrToCommInfo CommInfo, + hypre_KrylovPtrToCreateVector CreateVector, + hypre_KrylovPtrToCreateVectorArray CreateVectorArray, + hypre_KrylovPtrToDestroyVector DestroyVector, + hypre_KrylovPtrToMatvecCreate MatvecCreate, + hypre_KrylovPtrToMatvec Matvec, + hypre_KrylovPtrToMatvecDestroy MatvecDestroy, + hypre_KrylovPtrToInnerProdTagged InnerProd, + hypre_KrylovPtrToCopyVector CopyVector, + hypre_KrylovPtrToClearVector ClearVector, + hypre_KrylovPtrToScaleVector ScaleVector, + hypre_KrylovPtrToAxpy Axpy, + hypre_KrylovPtrToPrecond Precond, + hypre_KrylovPtrToPrecondSetup PrecondSetup +); + +/** + * Description... + * + * @param param [IN] ... + **/ + +#ifdef __cplusplus +} +#endif +#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) + ******************************************************************************/ + +/****************************************************************************** + * + * COGMRES cogmres + * + *****************************************************************************/ + +#ifndef hypre_KRYLOV_COGMRES_HEADER +#define hypre_KRYLOV_COGMRES_HEADER + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +/** + * @name Generic COGMRES Interface + * + * A general description of the interface goes here... + * + * @memo A generic COGMRES linear solver interface + **/ +/*@{*/ + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +/*-------------------------------------------------------------------------- + * hypre_COGMRESData and hypre_COGMRESFunctions + *--------------------------------------------------------------------------*/ + +/** + * @name COGMRES structs + * + * Description... + **/ +/*@{*/ + +/** + * The {\tt hypre\_COGMRESFunctions} object ... + **/ + +typedef struct +{ + hypre_KrylovPtrToCAlloc CAlloc; + hypre_KrylovPtrToFree Free; + hypre_KrylovPtrToCommInfo CommInfo; + hypre_KrylovPtrToCreateVector CreateVector; + hypre_KrylovPtrToCreateVectorArray CreateVectorArray; + hypre_KrylovPtrToDestroyVector DestroyVector; + hypre_KrylovPtrToMatvecCreate MatvecCreate; + hypre_KrylovPtrToMatvec Matvec; + hypre_KrylovPtrToMatvecDestroy MatvecDestroy; + hypre_KrylovPtrToInnerProd InnerProd; + hypre_KrylovPtrToMassInnerProd MassInnerProd; + hypre_KrylovPtrToMassDotpTwo MassDotpTwo; + hypre_KrylovPtrToCopyVector CopyVector; + hypre_KrylovPtrToClearVector ClearVector; + hypre_KrylovPtrToScaleVector ScaleVector; + hypre_KrylovPtrToAxpy Axpy; + hypre_KrylovPtrToMassAxpy MassAxpy; + hypre_KrylovPtrToPrecond precond; + hypre_KrylovPtrToPrecondSetup precond_setup; + hypre_KrylovPtrToModifyPC modify_pc; + +} hypre_COGMRESFunctions; + +/** + * The {\tt hypre\_COGMRESData} 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" { +#endif + +/** + * @name generic COGMRES Solver + * + * Description... + **/ +/*@{*/ + +/** + * Description... + * + * @param param [IN] ... + **/ + +hypre_COGMRESFunctions * +hypre_COGMRESFunctionsCreate( + hypre_KrylovPtrToCAlloc CAlloc, + hypre_KrylovPtrToFree Free, + hypre_KrylovPtrToCommInfo CommInfo, + hypre_KrylovPtrToCreateVector CreateVector, + hypre_KrylovPtrToCreateVectorArray CreateVectorArray, + hypre_KrylovPtrToDestroyVector DestroyVector, + hypre_KrylovPtrToMatvecCreate MatvecCreate, + hypre_KrylovPtrToMatvec Matvec, + hypre_KrylovPtrToMatvecDestroy MatvecDestroy, + hypre_KrylovPtrToInnerProd InnerProd, + hypre_KrylovPtrToMassInnerProd MassInnerProd, + hypre_KrylovPtrToMassDotpTwo MassDotpTwo, + hypre_KrylovPtrToCopyVector CopyVector, + hypre_KrylovPtrToClearVector ClearVector, + hypre_KrylovPtrToScaleVector ScaleVector, + hypre_KrylovPtrToAxpy Axpy, + hypre_KrylovPtrToMassAxpy MassAxpy, + hypre_KrylovPtrToPrecondSetup PrecondSetup, + hypre_KrylovPtrToPrecond Precond +); + +/** + * Description... + * + * @param param [IN] ... + **/ + +#ifdef __cplusplus +} +#endif +#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) + ******************************************************************************/ + +/****************************************************************************** + * + * 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 +{ + hypre_KrylovPtrToCAlloc CAlloc; + hypre_KrylovPtrToFree Free; + hypre_KrylovPtrToCommInfo CommInfo; + hypre_KrylovPtrToCreateVector CreateVector; + hypre_KrylovPtrToCreateVectorArray CreateVectorArray; + hypre_KrylovPtrToDestroyVector DestroyVector; + hypre_KrylovPtrToMatvecCreate MatvecCreate; + hypre_KrylovPtrToMatvec Matvec; + hypre_KrylovPtrToMatvecDestroy MatvecDestroy; + hypre_KrylovPtrToInnerProd InnerProd; + hypre_KrylovPtrToCopyVector CopyVector; + hypre_KrylovPtrToClearVector ClearVector; + hypre_KrylovPtrToScaleVector ScaleVector; + hypre_KrylovPtrToAxpy Axpy; + hypre_KrylovPtrToPrecond precond; + hypre_KrylovPtrToPrecondSetup precond_setup; + +} 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" { +#endif + +/** + * @name generic LGMRES Solver + * + * Description... + **/ +/*@{*/ + +/** + * Description... + * + * @param param [IN] ... + **/ + +hypre_LGMRESFunctions * +hypre_LGMRESFunctionsCreate( + hypre_KrylovPtrToCAlloc CAlloc, + hypre_KrylovPtrToFree Free, + hypre_KrylovPtrToCommInfo CommInfo, + hypre_KrylovPtrToCreateVector CreateVector, + hypre_KrylovPtrToCreateVectorArray CreateVectorArray, + hypre_KrylovPtrToDestroyVector DestroyVector, + hypre_KrylovPtrToMatvecCreate MatvecCreate, + hypre_KrylovPtrToMatvec Matvec, + hypre_KrylovPtrToMatvecDestroy MatvecDestroy, + hypre_KrylovPtrToInnerProd InnerProd, + hypre_KrylovPtrToCopyVector CopyVector, + hypre_KrylovPtrToClearVector ClearVector, + hypre_KrylovPtrToScaleVector ScaleVector, + hypre_KrylovPtrToAxpy Axpy, + hypre_KrylovPtrToPrecondSetup PrecondSetup, + hypre_KrylovPtrToPrecond Precond +); + +/** + * Description... + * + * @param param [IN] ... + **/ + +#ifdef __cplusplus +} +#endif +#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) + ******************************************************************************/ + +/****************************************************************************** + * + * 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 +{ + hypre_KrylovPtrToCAlloc CAlloc; + hypre_KrylovPtrToFree Free; + hypre_KrylovPtrToCommInfo CommInfo; + hypre_KrylovPtrToCreateVector CreateVector; + hypre_KrylovPtrToCreateVectorArray CreateVectorArray; + hypre_KrylovPtrToDestroyVector DestroyVector; + hypre_KrylovPtrToMatvecCreate MatvecCreate; + hypre_KrylovPtrToMatvec Matvec; + hypre_KrylovPtrToMatvecDestroy MatvecDestroy; + hypre_KrylovPtrToInnerProd InnerProd; + hypre_KrylovPtrToCopyVector CopyVector; + hypre_KrylovPtrToClearVector ClearVector; + hypre_KrylovPtrToScaleVector ScaleVector; + hypre_KrylovPtrToAxpy Axpy; + hypre_KrylovPtrToPrecond precond; + hypre_KrylovPtrToPrecondSetup precond_setup; + hypre_KrylovPtrToModifyPC modify_pc; + +} 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" { +#endif + +/** + * @name generic FlexGMRES Solver + * + * Description... + **/ +/*@{*/ + +/** + * Description... + * + * @param param [IN] ... + **/ + +hypre_FlexGMRESFunctions * +hypre_FlexGMRESFunctionsCreate( + hypre_KrylovPtrToCAlloc CAlloc, + hypre_KrylovPtrToFree Free, + hypre_KrylovPtrToCommInfo CommInfo, + hypre_KrylovPtrToCreateVector CreateVector, + hypre_KrylovPtrToCreateVectorArray CreateVectorArray, + hypre_KrylovPtrToDestroyVector DestroyVector, + hypre_KrylovPtrToMatvecCreate MatvecCreate, + hypre_KrylovPtrToMatvec Matvec, + hypre_KrylovPtrToMatvecDestroy MatvecDestroy, + hypre_KrylovPtrToInnerProd InnerProd, + hypre_KrylovPtrToCopyVector CopyVector, + hypre_KrylovPtrToClearVector ClearVector, + hypre_KrylovPtrToScaleVector ScaleVector, + hypre_KrylovPtrToAxpy Axpy, + hypre_KrylovPtrToPrecondSetup PrecondSetup, + hypre_KrylovPtrToPrecond Precond +); + +/** + * Description... + * + * @param param [IN] ... + **/ + +#ifdef __cplusplus +} +#endif +#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) + ******************************************************************************/ + +/****************************************************************************** + * + * 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 +{ + hypre_KrylovPtrToCAlloc CAlloc; + hypre_KrylovPtrToFree Free; + hypre_KrylovPtrToCommInfo CommInfo; + hypre_KrylovPtrToCreateVector CreateVector; + hypre_KrylovPtrToDestroyVector DestroyVector; + hypre_KrylovPtrToMatvecCreate MatvecCreate; + hypre_KrylovPtrToMatvec Matvec; + hypre_KrylovPtrToMatvecDestroy MatvecDestroy; + hypre_KrylovPtrToInnerProd InnerProd; + hypre_KrylovPtrToCopyVector CopyVector; + hypre_KrylovPtrToClearVector ClearVector; + hypre_KrylovPtrToScaleVector ScaleVector; + hypre_KrylovPtrToAxpy Axpy; + hypre_KrylovPtrToPrecond precond; + hypre_KrylovPtrToPrecondSetup precond_setup; + +} 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; + void *precond_Mat; + + hypre_PCGFunctions * functions; + + /* 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_PCGData; + +#define hypre_PCGDataOwnsMatvecData(pcgdata) ((pcgdata) -> owns_matvec_data) +#define hypre_PCGDataHybrid(pcgdata) ((pcgdata) -> hybrid) + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @name generic PCG Solver + * + * Description... + **/ +/*@{*/ + +/** + * Description... + * + * @param param [IN] ... + **/ + +hypre_PCGFunctions * +hypre_PCGFunctionsCreate( + hypre_KrylovPtrToCAlloc CAlloc, + hypre_KrylovPtrToFree Free, + hypre_KrylovPtrToCommInfo CommInfo, + hypre_KrylovPtrToCreateVector CreateVector, + hypre_KrylovPtrToDestroyVector DestroyVector, + hypre_KrylovPtrToMatvecCreate MatvecCreate, + hypre_KrylovPtrToMatvec Matvec, + hypre_KrylovPtrToMatvecDestroy MatvecDestroy, + hypre_KrylovPtrToInnerProd InnerProd, + hypre_KrylovPtrToCopyVector CopyVector, + hypre_KrylovPtrToClearVector ClearVector, + hypre_KrylovPtrToScaleVector ScaleVector, + hypre_KrylovPtrToAxpy Axpy, + hypre_KrylovPtrToPrecondSetup PrecondSetup, + hypre_KrylovPtrToPrecond Precond +); + +/** + * Description... + * + * @param param [IN] ... + **/ + +#ifdef __cplusplus +} +#endif + +#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) + ******************************************************************************/ + +/* 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_KrylovPtrToPrecond precond, + hypre_KrylovPtrToPrecondSetup precond_setup, + void *precond_data ); +HYPRE_Int hypre_BiCGSTABGetPrecond ( void *bicgstab_vdata, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int hypre_BiCGSTABSetPrecondMatrix( void *bicgstab_vdata, void *precond_matrix ); +HYPRE_Int hypre_BiCGSTABGetPrecondMatrix( void *bicgstab_vdata, + HYPRE_Matrix *precond_matrix_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_KrylovPtrToPrecond precond, + hypre_KrylovPtrToPrecondT precondT, + hypre_KrylovPtrToPrecondSetup precond_setup, + 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_KrylovPtrToPrecond precond, + hypre_KrylovPtrToPrecondSetup precond_setup, + void *precond_data ); +HYPRE_Int hypre_GMRESGetPrecond ( void *gmres_vdata, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int hypre_GMRESSetPrecondMatrix ( void *gmres_vdata, void *precond_matrix ); +HYPRE_Int hypre_GMRESGetPrecondMatrix ( void *gmres_vdata, HYPRE_Matrix *precond_matrix_ptr ); +HYPRE_Int hypre_GMRESSetRefSolution ( void *gmres_vdata, void *xref ); +HYPRE_Int hypre_GMRESGetRefSolution ( void *gmres_vdata, void **xref ); +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_KrylovPtrToPrecond precond, + hypre_KrylovPtrToPrecondSetup precond_setup, + 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 *cogmres_vdata, hypre_KrylovPtrToModifyPC modify_pc ); + +/* 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_KrylovPtrToPrecond precond, + hypre_KrylovPtrToPrecondSetup precond_setup, + 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_KrylovPtrToModifyPC modify_pc ); +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_KrylovPtrToPrecond precond, + hypre_KrylovPtrToPrecondSetup precond_setup, + 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 ); + +/* 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_PCGGetPrecondMatrix( void *pcg_vdata, HYPRE_Matrix *precond_matrix_ptr ); +HYPRE_Int +hypre_PCGSetPrecond ( void *pcg_vdata, + hypre_KrylovPtrToPrecond precond, + hypre_KrylovPtrToPrecondSetup precond_setup, + void *precond_data ); +HYPRE_Int hypre_PCGSetPrecondMatrix( void *pcg_vdata, void *precond_matrix ); +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 + +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_krylov_mup_undef.h" +#include "_hypre_krylov_mup.h" +#endif +#endif + +#endif + diff --git a/src/krylov/_hypre_krylov_mup.h b/src/krylov/_hypre_krylov_mup.h new file mode 100644 index 0000000000..15cb6a9abd --- /dev/null +++ b/src/krylov/_hypre_krylov_mup.h @@ -0,0 +1,1579 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#ifndef hypre_KRYLOV_MUP_HEADER +#define hypre_KRYLOV_MUP_HEADER + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (HYPRE_MIXED_PRECISION) + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + + +void * +hypre_BiCGSTABCreate_flt( hypre_BiCGSTABFunctions *bicgstab_functions ); +void * +hypre_BiCGSTABCreate_dbl( hypre_BiCGSTABFunctions *bicgstab_functions ); +void * +hypre_BiCGSTABCreate_long_dbl( hypre_BiCGSTABFunctions *bicgstab_functions ); + +HYPRE_Int +hypre_BiCGSTABDestroy_flt( void *bicgstab_vdata ); +HYPRE_Int +hypre_BiCGSTABDestroy_dbl( void *bicgstab_vdata ); +HYPRE_Int +hypre_BiCGSTABDestroy_long_dbl( void *bicgstab_vdata ); + +hypre_BiCGSTABFunctions * +hypre_BiCGSTABFunctionsCreate_flt( hypre_KrylovPtrToCreateVector CreateVector, hypre_KrylovPtrToDestroyVector DestroyVector, hypre_KrylovPtrToMatvecCreate MatvecCreate, hypre_KrylovPtrToMatvec Matvec, hypre_KrylovPtrToMatvecDestroy MatvecDestroy, hypre_KrylovPtrToInnerProd InnerProd, hypre_KrylovPtrToCopyVector CopyVector, hypre_KrylovPtrToClearVector ClearVector, hypre_KrylovPtrToScaleVector ScaleVector, hypre_KrylovPtrToAxpy Axpy, hypre_KrylovPtrToCommInfo CommInfo, hypre_KrylovPtrToPrecond Precond, hypre_KrylovPtrToPrecondSetup PrecondSetup ); +hypre_BiCGSTABFunctions * +hypre_BiCGSTABFunctionsCreate_dbl( hypre_KrylovPtrToCreateVector CreateVector, hypre_KrylovPtrToDestroyVector DestroyVector, hypre_KrylovPtrToMatvecCreate MatvecCreate, hypre_KrylovPtrToMatvec Matvec, hypre_KrylovPtrToMatvecDestroy MatvecDestroy, hypre_KrylovPtrToInnerProd InnerProd, hypre_KrylovPtrToCopyVector CopyVector, hypre_KrylovPtrToClearVector ClearVector, hypre_KrylovPtrToScaleVector ScaleVector, hypre_KrylovPtrToAxpy Axpy, hypre_KrylovPtrToCommInfo CommInfo, hypre_KrylovPtrToPrecond Precond, hypre_KrylovPtrToPrecondSetup PrecondSetup ); +hypre_BiCGSTABFunctions * +hypre_BiCGSTABFunctionsCreate_long_dbl( hypre_KrylovPtrToCreateVector CreateVector, hypre_KrylovPtrToDestroyVector DestroyVector, hypre_KrylovPtrToMatvecCreate MatvecCreate, hypre_KrylovPtrToMatvec Matvec, hypre_KrylovPtrToMatvecDestroy MatvecDestroy, hypre_KrylovPtrToInnerProd InnerProd, hypre_KrylovPtrToCopyVector CopyVector, hypre_KrylovPtrToClearVector ClearVector, hypre_KrylovPtrToScaleVector ScaleVector, hypre_KrylovPtrToAxpy Axpy, hypre_KrylovPtrToCommInfo CommInfo, hypre_KrylovPtrToPrecond Precond, hypre_KrylovPtrToPrecondSetup PrecondSetup ); + +HYPRE_Int +hypre_BiCGSTABGetConverged_flt( void *bicgstab_vdata, HYPRE_Int *converged ); +HYPRE_Int +hypre_BiCGSTABGetConverged_dbl( void *bicgstab_vdata, HYPRE_Int *converged ); +HYPRE_Int +hypre_BiCGSTABGetConverged_long_dbl( void *bicgstab_vdata, HYPRE_Int *converged ); + +HYPRE_Int +hypre_BiCGSTABGetFinalRelativeResidualNorm_flt( void *bicgstab_vdata, hypre_float *relative_residual_norm ); +HYPRE_Int +hypre_BiCGSTABGetFinalRelativeResidualNorm_dbl( void *bicgstab_vdata, hypre_double *relative_residual_norm ); +HYPRE_Int +hypre_BiCGSTABGetFinalRelativeResidualNorm_long_dbl( void *bicgstab_vdata, hypre_long_double *relative_residual_norm ); + +HYPRE_Int +hypre_BiCGSTABGetNumIterations_flt( void *bicgstab_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_BiCGSTABGetNumIterations_dbl( void *bicgstab_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_BiCGSTABGetNumIterations_long_dbl( void *bicgstab_vdata, HYPRE_Int *num_iterations ); + +HYPRE_Int +hypre_BiCGSTABGetPrecond_flt( void *bicgstab_vdata, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +hypre_BiCGSTABGetPrecond_dbl( void *bicgstab_vdata, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +hypre_BiCGSTABGetPrecond_long_dbl( void *bicgstab_vdata, HYPRE_Solver *precond_data_ptr ); + +HYPRE_Int +hypre_BiCGSTABGetPrecondMatrix_flt( void *bicgstab_vdata, HYPRE_Matrix *precond_matrix_ptr ); +HYPRE_Int +hypre_BiCGSTABGetPrecondMatrix_dbl( void *bicgstab_vdata, HYPRE_Matrix *precond_matrix_ptr ); +HYPRE_Int +hypre_BiCGSTABGetPrecondMatrix_long_dbl( void *bicgstab_vdata, HYPRE_Matrix *precond_matrix_ptr ); + +HYPRE_Int +hypre_BiCGSTABGetResidual_flt( void *bicgstab_vdata, void **residual ); +HYPRE_Int +hypre_BiCGSTABGetResidual_dbl( void *bicgstab_vdata, void **residual ); +HYPRE_Int +hypre_BiCGSTABGetResidual_long_dbl( void *bicgstab_vdata, void **residual ); + +HYPRE_Int +hypre_BiCGSTABSetAbsoluteTol_flt( void *bicgstab_vdata, hypre_float a_tol ); +HYPRE_Int +hypre_BiCGSTABSetAbsoluteTol_dbl( void *bicgstab_vdata, hypre_double a_tol ); +HYPRE_Int +hypre_BiCGSTABSetAbsoluteTol_long_dbl( void *bicgstab_vdata, hypre_long_double a_tol ); + +HYPRE_Int +hypre_BiCGSTABSetConvergenceFactorTol_flt( void *bicgstab_vdata, hypre_float cf_tol ); +HYPRE_Int +hypre_BiCGSTABSetConvergenceFactorTol_dbl( void *bicgstab_vdata, hypre_double cf_tol ); +HYPRE_Int +hypre_BiCGSTABSetConvergenceFactorTol_long_dbl( void *bicgstab_vdata, hypre_long_double cf_tol ); + +HYPRE_Int +hypre_BiCGSTABSetHybrid_flt( void *bicgstab_vdata, HYPRE_Int logging ); +HYPRE_Int +hypre_BiCGSTABSetHybrid_dbl( void *bicgstab_vdata, HYPRE_Int logging ); +HYPRE_Int +hypre_BiCGSTABSetHybrid_long_dbl( void *bicgstab_vdata, HYPRE_Int logging ); + +HYPRE_Int +hypre_BiCGSTABSetLogging_flt( void *bicgstab_vdata, HYPRE_Int logging ); +HYPRE_Int +hypre_BiCGSTABSetLogging_dbl( void *bicgstab_vdata, HYPRE_Int logging ); +HYPRE_Int +hypre_BiCGSTABSetLogging_long_dbl( void *bicgstab_vdata, HYPRE_Int logging ); + +HYPRE_Int +hypre_BiCGSTABSetMaxIter_flt( void *bicgstab_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_BiCGSTABSetMaxIter_dbl( void *bicgstab_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_BiCGSTABSetMaxIter_long_dbl( void *bicgstab_vdata, HYPRE_Int max_iter ); + +HYPRE_Int +hypre_BiCGSTABSetMinIter_flt( void *bicgstab_vdata, HYPRE_Int min_iter ); +HYPRE_Int +hypre_BiCGSTABSetMinIter_dbl( void *bicgstab_vdata, HYPRE_Int min_iter ); +HYPRE_Int +hypre_BiCGSTABSetMinIter_long_dbl( void *bicgstab_vdata, HYPRE_Int min_iter ); + +HYPRE_Int +hypre_BiCGSTABSetPrecond_flt( void *bicgstab_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ); +HYPRE_Int +hypre_BiCGSTABSetPrecond_dbl( void *bicgstab_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ); +HYPRE_Int +hypre_BiCGSTABSetPrecond_long_dbl( void *bicgstab_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ); + +HYPRE_Int +hypre_BiCGSTABSetPrecondMatrix_flt( void *bicgstab_vdata, void *precond_matrix ); +HYPRE_Int +hypre_BiCGSTABSetPrecondMatrix_dbl( void *bicgstab_vdata, void *precond_matrix ); +HYPRE_Int +hypre_BiCGSTABSetPrecondMatrix_long_dbl( void *bicgstab_vdata, void *precond_matrix ); + +HYPRE_Int +hypre_BiCGSTABSetPrintLevel_flt( void *bicgstab_vdata, HYPRE_Int print_level ); +HYPRE_Int +hypre_BiCGSTABSetPrintLevel_dbl( void *bicgstab_vdata, HYPRE_Int print_level ); +HYPRE_Int +hypre_BiCGSTABSetPrintLevel_long_dbl( void *bicgstab_vdata, HYPRE_Int print_level ); + +HYPRE_Int +hypre_BiCGSTABSetStopCrit_flt( void *bicgstab_vdata, HYPRE_Int stop_crit ); +HYPRE_Int +hypre_BiCGSTABSetStopCrit_dbl( void *bicgstab_vdata, HYPRE_Int stop_crit ); +HYPRE_Int +hypre_BiCGSTABSetStopCrit_long_dbl( void *bicgstab_vdata, HYPRE_Int stop_crit ); + +HYPRE_Int +hypre_BiCGSTABSetTol_flt( void *bicgstab_vdata, hypre_float tol ); +HYPRE_Int +hypre_BiCGSTABSetTol_dbl( void *bicgstab_vdata, hypre_double tol ); +HYPRE_Int +hypre_BiCGSTABSetTol_long_dbl( void *bicgstab_vdata, hypre_long_double tol ); + +HYPRE_Int +hypre_BiCGSTABSetup_flt( void *bicgstab_vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_BiCGSTABSetup_dbl( void *bicgstab_vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_BiCGSTABSetup_long_dbl( void *bicgstab_vdata, void *A, void *b, void *x ); + +HYPRE_Int +hypre_BiCGSTABSolve_flt( void *bicgstab_vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_BiCGSTABSolve_dbl( void *bicgstab_vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_BiCGSTABSolve_long_dbl( void *bicgstab_vdata, void *A, void *b, void *x ); + +void * +hypre_CGNRCreate_flt( hypre_CGNRFunctions *cgnr_functions ); +void * +hypre_CGNRCreate_dbl( hypre_CGNRFunctions *cgnr_functions ); +void * +hypre_CGNRCreate_long_dbl( hypre_CGNRFunctions *cgnr_functions ); + +HYPRE_Int +hypre_CGNRDestroy_flt( void *cgnr_vdata ); +HYPRE_Int +hypre_CGNRDestroy_dbl( void *cgnr_vdata ); +HYPRE_Int +hypre_CGNRDestroy_long_dbl( void *cgnr_vdata ); + +hypre_CGNRFunctions * +hypre_CGNRFunctionsCreate_flt( hypre_KrylovPtrToCommInfo CommInfo, hypre_KrylovPtrToCreateVector CreateVector, hypre_KrylovPtrToDestroyVector DestroyVector, hypre_KrylovPtrToMatvecCreate MatvecCreate, hypre_KrylovPtrToMatvec Matvec, hypre_KrylovPtrToMatvecT MatvecT, hypre_KrylovPtrToMatvecDestroy MatvecDestroy, hypre_KrylovPtrToInnerProd InnerProd, hypre_KrylovPtrToCopyVector CopyVector, hypre_KrylovPtrToClearVector ClearVector, hypre_KrylovPtrToScaleVector ScaleVector, hypre_KrylovPtrToAxpy Axpy, hypre_KrylovPtrToPrecondSetup PrecondSetup, hypre_KrylovPtrToPrecond Precond, hypre_KrylovPtrToPrecondT PrecondT ); +hypre_CGNRFunctions * +hypre_CGNRFunctionsCreate_dbl( hypre_KrylovPtrToCommInfo CommInfo, hypre_KrylovPtrToCreateVector CreateVector, hypre_KrylovPtrToDestroyVector DestroyVector, hypre_KrylovPtrToMatvecCreate MatvecCreate, hypre_KrylovPtrToMatvec Matvec, hypre_KrylovPtrToMatvecT MatvecT, hypre_KrylovPtrToMatvecDestroy MatvecDestroy, hypre_KrylovPtrToInnerProd InnerProd, hypre_KrylovPtrToCopyVector CopyVector, hypre_KrylovPtrToClearVector ClearVector, hypre_KrylovPtrToScaleVector ScaleVector, hypre_KrylovPtrToAxpy Axpy, hypre_KrylovPtrToPrecondSetup PrecondSetup, hypre_KrylovPtrToPrecond Precond, hypre_KrylovPtrToPrecondT PrecondT ); +hypre_CGNRFunctions * +hypre_CGNRFunctionsCreate_long_dbl( hypre_KrylovPtrToCommInfo CommInfo, hypre_KrylovPtrToCreateVector CreateVector, hypre_KrylovPtrToDestroyVector DestroyVector, hypre_KrylovPtrToMatvecCreate MatvecCreate, hypre_KrylovPtrToMatvec Matvec, hypre_KrylovPtrToMatvecT MatvecT, hypre_KrylovPtrToMatvecDestroy MatvecDestroy, hypre_KrylovPtrToInnerProd InnerProd, hypre_KrylovPtrToCopyVector CopyVector, hypre_KrylovPtrToClearVector ClearVector, hypre_KrylovPtrToScaleVector ScaleVector, hypre_KrylovPtrToAxpy Axpy, hypre_KrylovPtrToPrecondSetup PrecondSetup, hypre_KrylovPtrToPrecond Precond, hypre_KrylovPtrToPrecondT PrecondT ); + +HYPRE_Int +hypre_CGNRGetFinalRelativeResidualNorm_flt( void *cgnr_vdata, hypre_float *relative_residual_norm ); +HYPRE_Int +hypre_CGNRGetFinalRelativeResidualNorm_dbl( void *cgnr_vdata, hypre_double *relative_residual_norm ); +HYPRE_Int +hypre_CGNRGetFinalRelativeResidualNorm_long_dbl( void *cgnr_vdata, hypre_long_double *relative_residual_norm ); + +HYPRE_Int +hypre_CGNRGetNumIterations_flt( void *cgnr_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_CGNRGetNumIterations_dbl( void *cgnr_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_CGNRGetNumIterations_long_dbl( void *cgnr_vdata, HYPRE_Int *num_iterations ); + +HYPRE_Int +hypre_CGNRGetPrecond_flt( void *cgnr_vdata, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +hypre_CGNRGetPrecond_dbl( void *cgnr_vdata, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +hypre_CGNRGetPrecond_long_dbl( void *cgnr_vdata, HYPRE_Solver *precond_data_ptr ); + +HYPRE_Int +hypre_CGNRSetLogging_flt( void *cgnr_vdata, HYPRE_Int logging ); +HYPRE_Int +hypre_CGNRSetLogging_dbl( void *cgnr_vdata, HYPRE_Int logging ); +HYPRE_Int +hypre_CGNRSetLogging_long_dbl( void *cgnr_vdata, HYPRE_Int logging ); + +HYPRE_Int +hypre_CGNRSetMaxIter_flt( void *cgnr_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_CGNRSetMaxIter_dbl( void *cgnr_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_CGNRSetMaxIter_long_dbl( void *cgnr_vdata, HYPRE_Int max_iter ); + +HYPRE_Int +hypre_CGNRSetMinIter_flt( void *cgnr_vdata, HYPRE_Int min_iter ); +HYPRE_Int +hypre_CGNRSetMinIter_dbl( void *cgnr_vdata, HYPRE_Int min_iter ); +HYPRE_Int +hypre_CGNRSetMinIter_long_dbl( void *cgnr_vdata, HYPRE_Int min_iter ); + +HYPRE_Int +hypre_CGNRSetPrecond_flt( void *cgnr_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondT precondT, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ); +HYPRE_Int +hypre_CGNRSetPrecond_dbl( void *cgnr_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondT precondT, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ); +HYPRE_Int +hypre_CGNRSetPrecond_long_dbl( void *cgnr_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondT precondT, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ); + +HYPRE_Int +hypre_CGNRSetStopCrit_flt( void *cgnr_vdata, HYPRE_Int stop_crit ); +HYPRE_Int +hypre_CGNRSetStopCrit_dbl( void *cgnr_vdata, HYPRE_Int stop_crit ); +HYPRE_Int +hypre_CGNRSetStopCrit_long_dbl( void *cgnr_vdata, HYPRE_Int stop_crit ); + +HYPRE_Int +hypre_CGNRSetTol_flt( void *cgnr_vdata, hypre_float tol ); +HYPRE_Int +hypre_CGNRSetTol_dbl( void *cgnr_vdata, hypre_double tol ); +HYPRE_Int +hypre_CGNRSetTol_long_dbl( void *cgnr_vdata, hypre_long_double tol ); + +HYPRE_Int +hypre_CGNRSetup_flt( void *cgnr_vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_CGNRSetup_dbl( void *cgnr_vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_CGNRSetup_long_dbl( void *cgnr_vdata, void *A, void *b, void *x ); + +HYPRE_Int +hypre_CGNRSolve_flt( void *cgnr_vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_CGNRSolve_dbl( void *cgnr_vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_CGNRSolve_long_dbl( void *cgnr_vdata, void *A, void *b, void *x ); + +void * +hypre_COGMRESCreate_flt( hypre_COGMRESFunctions *gmres_functions ); +void * +hypre_COGMRESCreate_dbl( hypre_COGMRESFunctions *gmres_functions ); +void * +hypre_COGMRESCreate_long_dbl( hypre_COGMRESFunctions *gmres_functions ); + +HYPRE_Int +hypre_COGMRESDestroy_flt( void *gmres_vdata ); +HYPRE_Int +hypre_COGMRESDestroy_dbl( void *gmres_vdata ); +HYPRE_Int +hypre_COGMRESDestroy_long_dbl( void *gmres_vdata ); + +hypre_COGMRESFunctions * +hypre_COGMRESFunctionsCreate_flt( hypre_KrylovPtrToCAlloc CAlloc, hypre_KrylovPtrToFree Free, hypre_KrylovPtrToCommInfo CommInfo, hypre_KrylovPtrToCreateVector CreateVector, hypre_KrylovPtrToCreateVectorArray CreateVectorArray, hypre_KrylovPtrToDestroyVector DestroyVector, hypre_KrylovPtrToMatvecCreate MatvecCreate, hypre_KrylovPtrToMatvec Matvec, hypre_KrylovPtrToMatvecDestroy MatvecDestroy, hypre_KrylovPtrToInnerProd InnerProd, hypre_KrylovPtrToMassInnerProd MassInnerProd, hypre_KrylovPtrToMassDotpTwo MassDotpTwo, hypre_KrylovPtrToCopyVector CopyVector, hypre_KrylovPtrToClearVector ClearVector, hypre_KrylovPtrToScaleVector ScaleVector, hypre_KrylovPtrToAxpy Axpy, hypre_KrylovPtrToMassAxpy MassAxpy, hypre_KrylovPtrToPrecondSetup PrecondSetup, hypre_KrylovPtrToPrecond Precond ); +hypre_COGMRESFunctions * +hypre_COGMRESFunctionsCreate_dbl( hypre_KrylovPtrToCAlloc CAlloc, hypre_KrylovPtrToFree Free, hypre_KrylovPtrToCommInfo CommInfo, hypre_KrylovPtrToCreateVector CreateVector, hypre_KrylovPtrToCreateVectorArray CreateVectorArray, hypre_KrylovPtrToDestroyVector DestroyVector, hypre_KrylovPtrToMatvecCreate MatvecCreate, hypre_KrylovPtrToMatvec Matvec, hypre_KrylovPtrToMatvecDestroy MatvecDestroy, hypre_KrylovPtrToInnerProd InnerProd, hypre_KrylovPtrToMassInnerProd MassInnerProd, hypre_KrylovPtrToMassDotpTwo MassDotpTwo, hypre_KrylovPtrToCopyVector CopyVector, hypre_KrylovPtrToClearVector ClearVector, hypre_KrylovPtrToScaleVector ScaleVector, hypre_KrylovPtrToAxpy Axpy, hypre_KrylovPtrToMassAxpy MassAxpy, hypre_KrylovPtrToPrecondSetup PrecondSetup, hypre_KrylovPtrToPrecond Precond ); +hypre_COGMRESFunctions * +hypre_COGMRESFunctionsCreate_long_dbl( hypre_KrylovPtrToCAlloc CAlloc, hypre_KrylovPtrToFree Free, hypre_KrylovPtrToCommInfo CommInfo, hypre_KrylovPtrToCreateVector CreateVector, hypre_KrylovPtrToCreateVectorArray CreateVectorArray, hypre_KrylovPtrToDestroyVector DestroyVector, hypre_KrylovPtrToMatvecCreate MatvecCreate, hypre_KrylovPtrToMatvec Matvec, hypre_KrylovPtrToMatvecDestroy MatvecDestroy, hypre_KrylovPtrToInnerProd InnerProd, hypre_KrylovPtrToMassInnerProd MassInnerProd, hypre_KrylovPtrToMassDotpTwo MassDotpTwo, hypre_KrylovPtrToCopyVector CopyVector, hypre_KrylovPtrToClearVector ClearVector, hypre_KrylovPtrToScaleVector ScaleVector, hypre_KrylovPtrToAxpy Axpy, hypre_KrylovPtrToMassAxpy MassAxpy, hypre_KrylovPtrToPrecondSetup PrecondSetup, hypre_KrylovPtrToPrecond Precond ); + +HYPRE_Int +hypre_COGMRESGetAbsoluteTol_flt( void *gmres_vdata, hypre_float *a_tol ); +HYPRE_Int +hypre_COGMRESGetAbsoluteTol_dbl( void *gmres_vdata, hypre_double *a_tol ); +HYPRE_Int +hypre_COGMRESGetAbsoluteTol_long_dbl( void *gmres_vdata, hypre_long_double *a_tol ); + +HYPRE_Int +hypre_COGMRESGetCGS_flt( void *gmres_vdata, HYPRE_Int *cgs ); +HYPRE_Int +hypre_COGMRESGetCGS_dbl( void *gmres_vdata, HYPRE_Int *cgs ); +HYPRE_Int +hypre_COGMRESGetCGS_long_dbl( void *gmres_vdata, HYPRE_Int *cgs ); + +HYPRE_Int +hypre_COGMRESGetConverged_flt( void *gmres_vdata, HYPRE_Int *converged ); +HYPRE_Int +hypre_COGMRESGetConverged_dbl( void *gmres_vdata, HYPRE_Int *converged ); +HYPRE_Int +hypre_COGMRESGetConverged_long_dbl( void *gmres_vdata, HYPRE_Int *converged ); + +HYPRE_Int +hypre_COGMRESGetConvergenceFactorTol_flt( void *gmres_vdata, hypre_float *cf_tol ); +HYPRE_Int +hypre_COGMRESGetConvergenceFactorTol_dbl( void *gmres_vdata, hypre_double *cf_tol ); +HYPRE_Int +hypre_COGMRESGetConvergenceFactorTol_long_dbl( void *gmres_vdata, hypre_long_double *cf_tol ); + +HYPRE_Int +hypre_COGMRESGetFinalRelativeResidualNorm_flt( void *gmres_vdata, hypre_float *relative_residual_norm ); +HYPRE_Int +hypre_COGMRESGetFinalRelativeResidualNorm_dbl( void *gmres_vdata, hypre_double *relative_residual_norm ); +HYPRE_Int +hypre_COGMRESGetFinalRelativeResidualNorm_long_dbl( void *gmres_vdata, hypre_long_double *relative_residual_norm ); + +HYPRE_Int +hypre_COGMRESGetKDim_flt( void *gmres_vdata, HYPRE_Int *k_dim ); +HYPRE_Int +hypre_COGMRESGetKDim_dbl( void *gmres_vdata, HYPRE_Int *k_dim ); +HYPRE_Int +hypre_COGMRESGetKDim_long_dbl( void *gmres_vdata, HYPRE_Int *k_dim ); + +HYPRE_Int +hypre_COGMRESGetLogging_flt( void *gmres_vdata, HYPRE_Int *level ); +HYPRE_Int +hypre_COGMRESGetLogging_dbl( void *gmres_vdata, HYPRE_Int *level ); +HYPRE_Int +hypre_COGMRESGetLogging_long_dbl( void *gmres_vdata, HYPRE_Int *level ); + +HYPRE_Int +hypre_COGMRESGetMaxIter_flt( void *gmres_vdata, HYPRE_Int *max_iter ); +HYPRE_Int +hypre_COGMRESGetMaxIter_dbl( void *gmres_vdata, HYPRE_Int *max_iter ); +HYPRE_Int +hypre_COGMRESGetMaxIter_long_dbl( void *gmres_vdata, HYPRE_Int *max_iter ); + +HYPRE_Int +hypre_COGMRESGetMinIter_flt( void *gmres_vdata, HYPRE_Int *min_iter ); +HYPRE_Int +hypre_COGMRESGetMinIter_dbl( void *gmres_vdata, HYPRE_Int *min_iter ); +HYPRE_Int +hypre_COGMRESGetMinIter_long_dbl( void *gmres_vdata, HYPRE_Int *min_iter ); + +HYPRE_Int +hypre_COGMRESGetNumIterations_flt( void *gmres_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_COGMRESGetNumIterations_dbl( void *gmres_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_COGMRESGetNumIterations_long_dbl( void *gmres_vdata, HYPRE_Int *num_iterations ); + +HYPRE_Int +hypre_COGMRESGetPrecond_flt( void *gmres_vdata, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +hypre_COGMRESGetPrecond_dbl( void *gmres_vdata, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +hypre_COGMRESGetPrecond_long_dbl( void *gmres_vdata, HYPRE_Solver *precond_data_ptr ); + +HYPRE_Int +hypre_COGMRESGetPrintLevel_flt( void *gmres_vdata, HYPRE_Int *level ); +HYPRE_Int +hypre_COGMRESGetPrintLevel_dbl( void *gmres_vdata, HYPRE_Int *level ); +HYPRE_Int +hypre_COGMRESGetPrintLevel_long_dbl( void *gmres_vdata, HYPRE_Int *level ); + +HYPRE_Int +hypre_COGMRESGetRelChange_flt( void *gmres_vdata, HYPRE_Int *rel_change ); +HYPRE_Int +hypre_COGMRESGetRelChange_dbl( void *gmres_vdata, HYPRE_Int *rel_change ); +HYPRE_Int +hypre_COGMRESGetRelChange_long_dbl( void *gmres_vdata, HYPRE_Int *rel_change ); + +HYPRE_Int +hypre_COGMRESGetResidual_flt( void *gmres_vdata, void **residual ); +HYPRE_Int +hypre_COGMRESGetResidual_dbl( void *gmres_vdata, void **residual ); +HYPRE_Int +hypre_COGMRESGetResidual_long_dbl( void *gmres_vdata, void **residual ); + +HYPRE_Int +hypre_COGMRESGetSkipRealResidualCheck_flt( void *gmres_vdata, HYPRE_Int *skip_real_r_check ); +HYPRE_Int +hypre_COGMRESGetSkipRealResidualCheck_dbl( void *gmres_vdata, HYPRE_Int *skip_real_r_check ); +HYPRE_Int +hypre_COGMRESGetSkipRealResidualCheck_long_dbl( void *gmres_vdata, HYPRE_Int *skip_real_r_check ); + +HYPRE_Int +hypre_COGMRESGetTol_flt( void *gmres_vdata, hypre_float *tol ); +HYPRE_Int +hypre_COGMRESGetTol_dbl( void *gmres_vdata, hypre_double *tol ); +HYPRE_Int +hypre_COGMRESGetTol_long_dbl( void *gmres_vdata, hypre_long_double *tol ); + +HYPRE_Int +hypre_COGMRESGetUnroll_flt( void *gmres_vdata, HYPRE_Int *unroll ); +HYPRE_Int +hypre_COGMRESGetUnroll_dbl( void *gmres_vdata, HYPRE_Int *unroll ); +HYPRE_Int +hypre_COGMRESGetUnroll_long_dbl( void *gmres_vdata, HYPRE_Int *unroll ); + +HYPRE_Int +hypre_COGMRESSetAbsoluteTol_flt( void *gmres_vdata, hypre_float a_tol ); +HYPRE_Int +hypre_COGMRESSetAbsoluteTol_dbl( void *gmres_vdata, hypre_double a_tol ); +HYPRE_Int +hypre_COGMRESSetAbsoluteTol_long_dbl( void *gmres_vdata, hypre_long_double a_tol ); + +HYPRE_Int +hypre_COGMRESSetCGS_flt( void *gmres_vdata, HYPRE_Int cgs ); +HYPRE_Int +hypre_COGMRESSetCGS_dbl( void *gmres_vdata, HYPRE_Int cgs ); +HYPRE_Int +hypre_COGMRESSetCGS_long_dbl( void *gmres_vdata, HYPRE_Int cgs ); + +HYPRE_Int +hypre_COGMRESSetConvergenceFactorTol_flt( void *gmres_vdata, hypre_float cf_tol ); +HYPRE_Int +hypre_COGMRESSetConvergenceFactorTol_dbl( void *gmres_vdata, hypre_double cf_tol ); +HYPRE_Int +hypre_COGMRESSetConvergenceFactorTol_long_dbl( void *gmres_vdata, hypre_long_double cf_tol ); + +HYPRE_Int +hypre_COGMRESSetKDim_flt( void *gmres_vdata, HYPRE_Int k_dim ); +HYPRE_Int +hypre_COGMRESSetKDim_dbl( void *gmres_vdata, HYPRE_Int k_dim ); +HYPRE_Int +hypre_COGMRESSetKDim_long_dbl( void *gmres_vdata, HYPRE_Int k_dim ); + +HYPRE_Int +hypre_COGMRESSetLogging_flt( void *gmres_vdata, HYPRE_Int level ); +HYPRE_Int +hypre_COGMRESSetLogging_dbl( void *gmres_vdata, HYPRE_Int level ); +HYPRE_Int +hypre_COGMRESSetLogging_long_dbl( void *gmres_vdata, HYPRE_Int level ); + +HYPRE_Int +hypre_COGMRESSetMaxIter_flt( void *gmres_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_COGMRESSetMaxIter_dbl( void *gmres_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_COGMRESSetMaxIter_long_dbl( void *gmres_vdata, HYPRE_Int max_iter ); + +HYPRE_Int +hypre_COGMRESSetMinIter_flt( void *gmres_vdata, HYPRE_Int min_iter ); +HYPRE_Int +hypre_COGMRESSetMinIter_dbl( void *gmres_vdata, HYPRE_Int min_iter ); +HYPRE_Int +hypre_COGMRESSetMinIter_long_dbl( void *gmres_vdata, HYPRE_Int min_iter ); + +HYPRE_Int +hypre_COGMRESSetModifyPC_flt( void *cogmres_vdata, hypre_KrylovPtrToModifyPC modify_pc ); +HYPRE_Int +hypre_COGMRESSetModifyPC_dbl( void *cogmres_vdata, hypre_KrylovPtrToModifyPC modify_pc ); +HYPRE_Int +hypre_COGMRESSetModifyPC_long_dbl( void *cogmres_vdata, hypre_KrylovPtrToModifyPC modify_pc ); + +HYPRE_Int +hypre_COGMRESSetPrecond_flt( void *gmres_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ); +HYPRE_Int +hypre_COGMRESSetPrecond_dbl( void *gmres_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ); +HYPRE_Int +hypre_COGMRESSetPrecond_long_dbl( void *gmres_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ); + +HYPRE_Int +hypre_COGMRESSetPrintLevel_flt( void *gmres_vdata, HYPRE_Int level ); +HYPRE_Int +hypre_COGMRESSetPrintLevel_dbl( void *gmres_vdata, HYPRE_Int level ); +HYPRE_Int +hypre_COGMRESSetPrintLevel_long_dbl( void *gmres_vdata, HYPRE_Int level ); + +HYPRE_Int +hypre_COGMRESSetRelChange_flt( void *gmres_vdata, HYPRE_Int rel_change ); +HYPRE_Int +hypre_COGMRESSetRelChange_dbl( void *gmres_vdata, HYPRE_Int rel_change ); +HYPRE_Int +hypre_COGMRESSetRelChange_long_dbl( void *gmres_vdata, HYPRE_Int rel_change ); + +HYPRE_Int +hypre_COGMRESSetSkipRealResidualCheck_flt( void *gmres_vdata, HYPRE_Int skip_real_r_check ); +HYPRE_Int +hypre_COGMRESSetSkipRealResidualCheck_dbl( void *gmres_vdata, HYPRE_Int skip_real_r_check ); +HYPRE_Int +hypre_COGMRESSetSkipRealResidualCheck_long_dbl( void *gmres_vdata, HYPRE_Int skip_real_r_check ); + +HYPRE_Int +hypre_COGMRESSetTol_flt( void *gmres_vdata, hypre_float tol ); +HYPRE_Int +hypre_COGMRESSetTol_dbl( void *gmres_vdata, hypre_double tol ); +HYPRE_Int +hypre_COGMRESSetTol_long_dbl( void *gmres_vdata, hypre_long_double tol ); + +HYPRE_Int +hypre_COGMRESSetUnroll_flt( void *gmres_vdata, HYPRE_Int unroll ); +HYPRE_Int +hypre_COGMRESSetUnroll_dbl( void *gmres_vdata, HYPRE_Int unroll ); +HYPRE_Int +hypre_COGMRESSetUnroll_long_dbl( void *gmres_vdata, HYPRE_Int unroll ); + +HYPRE_Int +hypre_COGMRESSetup_flt( void *gmres_vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_COGMRESSetup_dbl( void *gmres_vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_COGMRESSetup_long_dbl( void *gmres_vdata, void *A, void *b, void *x ); + +HYPRE_Int +hypre_COGMRESSolve_flt( void *gmres_vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_COGMRESSolve_dbl( void *gmres_vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_COGMRESSolve_long_dbl( void *gmres_vdata, void *A, void *b, void *x ); + +void * +hypre_FlexGMRESCreate_flt( hypre_FlexGMRESFunctions *fgmres_functions ); +void * +hypre_FlexGMRESCreate_dbl( hypre_FlexGMRESFunctions *fgmres_functions ); +void * +hypre_FlexGMRESCreate_long_dbl( hypre_FlexGMRESFunctions *fgmres_functions ); + +HYPRE_Int +hypre_FlexGMRESDestroy_flt( void *fgmres_vdata ); +HYPRE_Int +hypre_FlexGMRESDestroy_dbl( void *fgmres_vdata ); +HYPRE_Int +hypre_FlexGMRESDestroy_long_dbl( void *fgmres_vdata ); + +hypre_FlexGMRESFunctions * +hypre_FlexGMRESFunctionsCreate_flt( hypre_KrylovPtrToCAlloc CAlloc, hypre_KrylovPtrToFree Free, hypre_KrylovPtrToCommInfo CommInfo, hypre_KrylovPtrToCreateVector CreateVector, hypre_KrylovPtrToCreateVectorArray CreateVectorArray, hypre_KrylovPtrToDestroyVector DestroyVector, hypre_KrylovPtrToMatvecCreate MatvecCreate, hypre_KrylovPtrToMatvec Matvec, hypre_KrylovPtrToMatvecDestroy MatvecDestroy, hypre_KrylovPtrToInnerProd InnerProd, hypre_KrylovPtrToCopyVector CopyVector, hypre_KrylovPtrToClearVector ClearVector, hypre_KrylovPtrToScaleVector ScaleVector, hypre_KrylovPtrToAxpy Axpy, hypre_KrylovPtrToPrecondSetup PrecondSetup, hypre_KrylovPtrToPrecond Precond ); +hypre_FlexGMRESFunctions * +hypre_FlexGMRESFunctionsCreate_dbl( hypre_KrylovPtrToCAlloc CAlloc, hypre_KrylovPtrToFree Free, hypre_KrylovPtrToCommInfo CommInfo, hypre_KrylovPtrToCreateVector CreateVector, hypre_KrylovPtrToCreateVectorArray CreateVectorArray, hypre_KrylovPtrToDestroyVector DestroyVector, hypre_KrylovPtrToMatvecCreate MatvecCreate, hypre_KrylovPtrToMatvec Matvec, hypre_KrylovPtrToMatvecDestroy MatvecDestroy, hypre_KrylovPtrToInnerProd InnerProd, hypre_KrylovPtrToCopyVector CopyVector, hypre_KrylovPtrToClearVector ClearVector, hypre_KrylovPtrToScaleVector ScaleVector, hypre_KrylovPtrToAxpy Axpy, hypre_KrylovPtrToPrecondSetup PrecondSetup, hypre_KrylovPtrToPrecond Precond ); +hypre_FlexGMRESFunctions * +hypre_FlexGMRESFunctionsCreate_long_dbl( hypre_KrylovPtrToCAlloc CAlloc, hypre_KrylovPtrToFree Free, hypre_KrylovPtrToCommInfo CommInfo, hypre_KrylovPtrToCreateVector CreateVector, hypre_KrylovPtrToCreateVectorArray CreateVectorArray, hypre_KrylovPtrToDestroyVector DestroyVector, hypre_KrylovPtrToMatvecCreate MatvecCreate, hypre_KrylovPtrToMatvec Matvec, hypre_KrylovPtrToMatvecDestroy MatvecDestroy, hypre_KrylovPtrToInnerProd InnerProd, hypre_KrylovPtrToCopyVector CopyVector, hypre_KrylovPtrToClearVector ClearVector, hypre_KrylovPtrToScaleVector ScaleVector, hypre_KrylovPtrToAxpy Axpy, hypre_KrylovPtrToPrecondSetup PrecondSetup, hypre_KrylovPtrToPrecond Precond ); + +HYPRE_Int +hypre_FlexGMRESGetAbsoluteTol_flt( void *fgmres_vdata, hypre_float *a_tol ); +HYPRE_Int +hypre_FlexGMRESGetAbsoluteTol_dbl( void *fgmres_vdata, hypre_double *a_tol ); +HYPRE_Int +hypre_FlexGMRESGetAbsoluteTol_long_dbl( void *fgmres_vdata, hypre_long_double *a_tol ); + +HYPRE_Int +hypre_FlexGMRESGetConverged_flt( void *fgmres_vdata, HYPRE_Int *converged ); +HYPRE_Int +hypre_FlexGMRESGetConverged_dbl( void *fgmres_vdata, HYPRE_Int *converged ); +HYPRE_Int +hypre_FlexGMRESGetConverged_long_dbl( void *fgmres_vdata, HYPRE_Int *converged ); + +HYPRE_Int +hypre_FlexGMRESGetConvergenceFactorTol_flt( void *fgmres_vdata, hypre_float *cf_tol ); +HYPRE_Int +hypre_FlexGMRESGetConvergenceFactorTol_dbl( void *fgmres_vdata, hypre_double *cf_tol ); +HYPRE_Int +hypre_FlexGMRESGetConvergenceFactorTol_long_dbl( void *fgmres_vdata, hypre_long_double *cf_tol ); + +HYPRE_Int +hypre_FlexGMRESGetFinalRelativeResidualNorm_flt( void *fgmres_vdata, hypre_float *relative_residual_norm ); +HYPRE_Int +hypre_FlexGMRESGetFinalRelativeResidualNorm_dbl( void *fgmres_vdata, hypre_double *relative_residual_norm ); +HYPRE_Int +hypre_FlexGMRESGetFinalRelativeResidualNorm_long_dbl( void *fgmres_vdata, hypre_long_double *relative_residual_norm ); + +HYPRE_Int +hypre_FlexGMRESGetKDim_flt( void *fgmres_vdata, HYPRE_Int *k_dim ); +HYPRE_Int +hypre_FlexGMRESGetKDim_dbl( void *fgmres_vdata, HYPRE_Int *k_dim ); +HYPRE_Int +hypre_FlexGMRESGetKDim_long_dbl( void *fgmres_vdata, HYPRE_Int *k_dim ); + +HYPRE_Int +hypre_FlexGMRESGetLogging_flt( void *fgmres_vdata, HYPRE_Int *level ); +HYPRE_Int +hypre_FlexGMRESGetLogging_dbl( void *fgmres_vdata, HYPRE_Int *level ); +HYPRE_Int +hypre_FlexGMRESGetLogging_long_dbl( void *fgmres_vdata, HYPRE_Int *level ); + +HYPRE_Int +hypre_FlexGMRESGetMaxIter_flt( void *fgmres_vdata, HYPRE_Int *max_iter ); +HYPRE_Int +hypre_FlexGMRESGetMaxIter_dbl( void *fgmres_vdata, HYPRE_Int *max_iter ); +HYPRE_Int +hypre_FlexGMRESGetMaxIter_long_dbl( void *fgmres_vdata, HYPRE_Int *max_iter ); + +HYPRE_Int +hypre_FlexGMRESGetMinIter_flt( void *fgmres_vdata, HYPRE_Int *min_iter ); +HYPRE_Int +hypre_FlexGMRESGetMinIter_dbl( void *fgmres_vdata, HYPRE_Int *min_iter ); +HYPRE_Int +hypre_FlexGMRESGetMinIter_long_dbl( void *fgmres_vdata, HYPRE_Int *min_iter ); + +HYPRE_Int +hypre_FlexGMRESGetNumIterations_flt( void *fgmres_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_FlexGMRESGetNumIterations_dbl( void *fgmres_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_FlexGMRESGetNumIterations_long_dbl( void *fgmres_vdata, HYPRE_Int *num_iterations ); + +HYPRE_Int +hypre_FlexGMRESGetPrecond_flt( void *fgmres_vdata, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +hypre_FlexGMRESGetPrecond_dbl( void *fgmres_vdata, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +hypre_FlexGMRESGetPrecond_long_dbl( void *fgmres_vdata, HYPRE_Solver *precond_data_ptr ); + +HYPRE_Int +hypre_FlexGMRESGetPrintLevel_flt( void *fgmres_vdata, HYPRE_Int *level ); +HYPRE_Int +hypre_FlexGMRESGetPrintLevel_dbl( void *fgmres_vdata, HYPRE_Int *level ); +HYPRE_Int +hypre_FlexGMRESGetPrintLevel_long_dbl( void *fgmres_vdata, HYPRE_Int *level ); + +HYPRE_Int +hypre_FlexGMRESGetResidual_flt( void *fgmres_vdata, void **residual ); +HYPRE_Int +hypre_FlexGMRESGetResidual_dbl( void *fgmres_vdata, void **residual ); +HYPRE_Int +hypre_FlexGMRESGetResidual_long_dbl( void *fgmres_vdata, void **residual ); + +HYPRE_Int +hypre_FlexGMRESGetStopCrit_flt( void *fgmres_vdata, HYPRE_Int *stop_crit ); +HYPRE_Int +hypre_FlexGMRESGetStopCrit_dbl( void *fgmres_vdata, HYPRE_Int *stop_crit ); +HYPRE_Int +hypre_FlexGMRESGetStopCrit_long_dbl( void *fgmres_vdata, HYPRE_Int *stop_crit ); + +HYPRE_Int +hypre_FlexGMRESGetTol_flt( void *fgmres_vdata, hypre_float *tol ); +HYPRE_Int +hypre_FlexGMRESGetTol_dbl( void *fgmres_vdata, hypre_double *tol ); +HYPRE_Int +hypre_FlexGMRESGetTol_long_dbl( void *fgmres_vdata, hypre_long_double *tol ); + +HYPRE_Int +hypre_FlexGMRESModifyPCDefault_flt( void *precond_data, HYPRE_Int iteration, hypre_float rel_residual_norm ); +HYPRE_Int +hypre_FlexGMRESModifyPCDefault_dbl( void *precond_data, HYPRE_Int iteration, hypre_double rel_residual_norm ); +HYPRE_Int +hypre_FlexGMRESModifyPCDefault_long_dbl( void *precond_data, HYPRE_Int iteration, hypre_long_double rel_residual_norm ); + +HYPRE_Int +hypre_FlexGMRESSetAbsoluteTol_flt( void *fgmres_vdata, hypre_float a_tol ); +HYPRE_Int +hypre_FlexGMRESSetAbsoluteTol_dbl( void *fgmres_vdata, hypre_double a_tol ); +HYPRE_Int +hypre_FlexGMRESSetAbsoluteTol_long_dbl( void *fgmres_vdata, hypre_long_double a_tol ); + +HYPRE_Int +hypre_FlexGMRESSetConvergenceFactorTol_flt( void *fgmres_vdata, hypre_float cf_tol ); +HYPRE_Int +hypre_FlexGMRESSetConvergenceFactorTol_dbl( void *fgmres_vdata, hypre_double cf_tol ); +HYPRE_Int +hypre_FlexGMRESSetConvergenceFactorTol_long_dbl( void *fgmres_vdata, hypre_long_double cf_tol ); + +HYPRE_Int +hypre_FlexGMRESSetKDim_flt( void *fgmres_vdata, HYPRE_Int k_dim ); +HYPRE_Int +hypre_FlexGMRESSetKDim_dbl( void *fgmres_vdata, HYPRE_Int k_dim ); +HYPRE_Int +hypre_FlexGMRESSetKDim_long_dbl( void *fgmres_vdata, HYPRE_Int k_dim ); + +HYPRE_Int +hypre_FlexGMRESSetLogging_flt( void *fgmres_vdata, HYPRE_Int level ); +HYPRE_Int +hypre_FlexGMRESSetLogging_dbl( void *fgmres_vdata, HYPRE_Int level ); +HYPRE_Int +hypre_FlexGMRESSetLogging_long_dbl( void *fgmres_vdata, HYPRE_Int level ); + +HYPRE_Int +hypre_FlexGMRESSetMaxIter_flt( void *fgmres_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_FlexGMRESSetMaxIter_dbl( void *fgmres_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_FlexGMRESSetMaxIter_long_dbl( void *fgmres_vdata, HYPRE_Int max_iter ); + +HYPRE_Int +hypre_FlexGMRESSetMinIter_flt( void *fgmres_vdata, HYPRE_Int min_iter ); +HYPRE_Int +hypre_FlexGMRESSetMinIter_dbl( void *fgmres_vdata, HYPRE_Int min_iter ); +HYPRE_Int +hypre_FlexGMRESSetMinIter_long_dbl( void *fgmres_vdata, HYPRE_Int min_iter ); + +HYPRE_Int +hypre_FlexGMRESSetModifyPC_flt( void *fgmres_vdata, hypre_KrylovPtrToModifyPC modify_pc ); +HYPRE_Int +hypre_FlexGMRESSetModifyPC_dbl( void *fgmres_vdata, hypre_KrylovPtrToModifyPC modify_pc ); +HYPRE_Int +hypre_FlexGMRESSetModifyPC_long_dbl( void *fgmres_vdata, hypre_KrylovPtrToModifyPC modify_pc ); + +HYPRE_Int +hypre_FlexGMRESSetPrecond_flt( void *fgmres_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ); +HYPRE_Int +hypre_FlexGMRESSetPrecond_dbl( void *fgmres_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ); +HYPRE_Int +hypre_FlexGMRESSetPrecond_long_dbl( void *fgmres_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ); + +HYPRE_Int +hypre_FlexGMRESSetPrintLevel_flt( void *fgmres_vdata, HYPRE_Int level ); +HYPRE_Int +hypre_FlexGMRESSetPrintLevel_dbl( void *fgmres_vdata, HYPRE_Int level ); +HYPRE_Int +hypre_FlexGMRESSetPrintLevel_long_dbl( void *fgmres_vdata, HYPRE_Int level ); + +HYPRE_Int +hypre_FlexGMRESSetStopCrit_flt( void *fgmres_vdata, HYPRE_Int stop_crit ); +HYPRE_Int +hypre_FlexGMRESSetStopCrit_dbl( void *fgmres_vdata, HYPRE_Int stop_crit ); +HYPRE_Int +hypre_FlexGMRESSetStopCrit_long_dbl( void *fgmres_vdata, HYPRE_Int stop_crit ); + +HYPRE_Int +hypre_FlexGMRESSetTol_flt( void *fgmres_vdata, hypre_float tol ); +HYPRE_Int +hypre_FlexGMRESSetTol_dbl( void *fgmres_vdata, hypre_double tol ); +HYPRE_Int +hypre_FlexGMRESSetTol_long_dbl( void *fgmres_vdata, hypre_long_double tol ); + +HYPRE_Int +hypre_FlexGMRESSetup_flt( void *fgmres_vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_FlexGMRESSetup_dbl( void *fgmres_vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_FlexGMRESSetup_long_dbl( void *fgmres_vdata, void *A, void *b, void *x ); + +HYPRE_Int +hypre_FlexGMRESSolve_flt( void *fgmres_vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_FlexGMRESSolve_dbl( void *fgmres_vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_FlexGMRESSolve_long_dbl( void *fgmres_vdata, void *A, void *b, void *x ); + +void * +hypre_GMRESCreate_flt( hypre_GMRESFunctions *gmres_functions ); +void * +hypre_GMRESCreate_dbl( hypre_GMRESFunctions *gmres_functions ); +void * +hypre_GMRESCreate_long_dbl( hypre_GMRESFunctions *gmres_functions ); + +HYPRE_Int +hypre_GMRESDestroy_flt( void *gmres_vdata ); +HYPRE_Int +hypre_GMRESDestroy_dbl( void *gmres_vdata ); +HYPRE_Int +hypre_GMRESDestroy_long_dbl( void *gmres_vdata ); + +hypre_GMRESFunctions * +hypre_GMRESFunctionsCreate_flt( hypre_KrylovPtrToCAlloc CAlloc, hypre_KrylovPtrToFree Free, hypre_KrylovPtrToCommInfo CommInfo, hypre_KrylovPtrToCreateVector CreateVector, hypre_KrylovPtrToCreateVectorArray CreateVectorArray, hypre_KrylovPtrToDestroyVector DestroyVector, hypre_KrylovPtrToMatvecCreate MatvecCreate, hypre_KrylovPtrToMatvec Matvec, hypre_KrylovPtrToMatvecDestroy MatvecDestroy, hypre_KrylovPtrToInnerProdTagged InnerProd, hypre_KrylovPtrToCopyVector CopyVector, hypre_KrylovPtrToClearVector ClearVector, hypre_KrylovPtrToScaleVector ScaleVector, hypre_KrylovPtrToAxpy Axpy, hypre_KrylovPtrToPrecond Precond, hypre_KrylovPtrToPrecondSetup PrecondSetup ); +hypre_GMRESFunctions * +hypre_GMRESFunctionsCreate_dbl( hypre_KrylovPtrToCAlloc CAlloc, hypre_KrylovPtrToFree Free, hypre_KrylovPtrToCommInfo CommInfo, hypre_KrylovPtrToCreateVector CreateVector, hypre_KrylovPtrToCreateVectorArray CreateVectorArray, hypre_KrylovPtrToDestroyVector DestroyVector, hypre_KrylovPtrToMatvecCreate MatvecCreate, hypre_KrylovPtrToMatvec Matvec, hypre_KrylovPtrToMatvecDestroy MatvecDestroy, hypre_KrylovPtrToInnerProdTagged InnerProd, hypre_KrylovPtrToCopyVector CopyVector, hypre_KrylovPtrToClearVector ClearVector, hypre_KrylovPtrToScaleVector ScaleVector, hypre_KrylovPtrToAxpy Axpy, hypre_KrylovPtrToPrecond Precond, hypre_KrylovPtrToPrecondSetup PrecondSetup ); +hypre_GMRESFunctions * +hypre_GMRESFunctionsCreate_long_dbl( hypre_KrylovPtrToCAlloc CAlloc, hypre_KrylovPtrToFree Free, hypre_KrylovPtrToCommInfo CommInfo, hypre_KrylovPtrToCreateVector CreateVector, hypre_KrylovPtrToCreateVectorArray CreateVectorArray, hypre_KrylovPtrToDestroyVector DestroyVector, hypre_KrylovPtrToMatvecCreate MatvecCreate, hypre_KrylovPtrToMatvec Matvec, hypre_KrylovPtrToMatvecDestroy MatvecDestroy, hypre_KrylovPtrToInnerProdTagged InnerProd, hypre_KrylovPtrToCopyVector CopyVector, hypre_KrylovPtrToClearVector ClearVector, hypre_KrylovPtrToScaleVector ScaleVector, hypre_KrylovPtrToAxpy Axpy, hypre_KrylovPtrToPrecond Precond, hypre_KrylovPtrToPrecondSetup PrecondSetup ); + +HYPRE_Int +hypre_GMRESGetAbsoluteTol_flt( void *gmres_vdata, hypre_float *a_tol ); +HYPRE_Int +hypre_GMRESGetAbsoluteTol_dbl( void *gmres_vdata, hypre_double *a_tol ); +HYPRE_Int +hypre_GMRESGetAbsoluteTol_long_dbl( void *gmres_vdata, hypre_long_double *a_tol ); + +HYPRE_Int +hypre_GMRESGetConverged_flt( void *gmres_vdata, HYPRE_Int *converged ); +HYPRE_Int +hypre_GMRESGetConverged_dbl( void *gmres_vdata, HYPRE_Int *converged ); +HYPRE_Int +hypre_GMRESGetConverged_long_dbl( void *gmres_vdata, HYPRE_Int *converged ); + +HYPRE_Int +hypre_GMRESGetConvergenceFactorTol_flt( void *gmres_vdata, hypre_float *cf_tol ); +HYPRE_Int +hypre_GMRESGetConvergenceFactorTol_dbl( void *gmres_vdata, hypre_double *cf_tol ); +HYPRE_Int +hypre_GMRESGetConvergenceFactorTol_long_dbl( void *gmres_vdata, hypre_long_double *cf_tol ); + +HYPRE_Int +hypre_GMRESGetFinalRelativeResidualNorm_flt( void *gmres_vdata, hypre_float *relative_residual_norm ); +HYPRE_Int +hypre_GMRESGetFinalRelativeResidualNorm_dbl( void *gmres_vdata, hypre_double *relative_residual_norm ); +HYPRE_Int +hypre_GMRESGetFinalRelativeResidualNorm_long_dbl( void *gmres_vdata, hypre_long_double *relative_residual_norm ); + +HYPRE_Int +hypre_GMRESGetKDim_flt( void *gmres_vdata, HYPRE_Int *k_dim ); +HYPRE_Int +hypre_GMRESGetKDim_dbl( void *gmres_vdata, HYPRE_Int *k_dim ); +HYPRE_Int +hypre_GMRESGetKDim_long_dbl( void *gmres_vdata, HYPRE_Int *k_dim ); + +HYPRE_Int +hypre_GMRESGetLogging_flt( void *gmres_vdata, HYPRE_Int *level ); +HYPRE_Int +hypre_GMRESGetLogging_dbl( void *gmres_vdata, HYPRE_Int *level ); +HYPRE_Int +hypre_GMRESGetLogging_long_dbl( void *gmres_vdata, HYPRE_Int *level ); + +HYPRE_Int +hypre_GMRESGetMaxIter_flt( void *gmres_vdata, HYPRE_Int *max_iter ); +HYPRE_Int +hypre_GMRESGetMaxIter_dbl( void *gmres_vdata, HYPRE_Int *max_iter ); +HYPRE_Int +hypre_GMRESGetMaxIter_long_dbl( void *gmres_vdata, HYPRE_Int *max_iter ); + +HYPRE_Int +hypre_GMRESGetMinIter_flt( void *gmres_vdata, HYPRE_Int *min_iter ); +HYPRE_Int +hypre_GMRESGetMinIter_dbl( void *gmres_vdata, HYPRE_Int *min_iter ); +HYPRE_Int +hypre_GMRESGetMinIter_long_dbl( void *gmres_vdata, HYPRE_Int *min_iter ); + +HYPRE_Int +hypre_GMRESGetNumIterations_flt( void *gmres_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_GMRESGetNumIterations_dbl( void *gmres_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_GMRESGetNumIterations_long_dbl( void *gmres_vdata, HYPRE_Int *num_iterations ); + +HYPRE_Int +hypre_GMRESGetPrecond_flt( void *gmres_vdata, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +hypre_GMRESGetPrecond_dbl( void *gmres_vdata, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +hypre_GMRESGetPrecond_long_dbl( void *gmres_vdata, HYPRE_Solver *precond_data_ptr ); + +HYPRE_Int +hypre_GMRESGetPrecondMatrix_flt( void *gmres_vdata, HYPRE_Matrix *precond_matrix_ptr ); +HYPRE_Int +hypre_GMRESGetPrecondMatrix_dbl( void *gmres_vdata, HYPRE_Matrix *precond_matrix_ptr ); +HYPRE_Int +hypre_GMRESGetPrecondMatrix_long_dbl( void *gmres_vdata, HYPRE_Matrix *precond_matrix_ptr ); + +HYPRE_Int +hypre_GMRESGetPrintLevel_flt( void *gmres_vdata, HYPRE_Int *level ); +HYPRE_Int +hypre_GMRESGetPrintLevel_dbl( void *gmres_vdata, HYPRE_Int *level ); +HYPRE_Int +hypre_GMRESGetPrintLevel_long_dbl( void *gmres_vdata, HYPRE_Int *level ); + +HYPRE_Int +hypre_GMRESGetRefSolution_flt( void *gmres_vdata, void **xref ); +HYPRE_Int +hypre_GMRESGetRefSolution_dbl( void *gmres_vdata, void **xref ); +HYPRE_Int +hypre_GMRESGetRefSolution_long_dbl( void *gmres_vdata, void **xref ); + +HYPRE_Int +hypre_GMRESGetRelChange_flt( void *gmres_vdata, HYPRE_Int *rel_change ); +HYPRE_Int +hypre_GMRESGetRelChange_dbl( void *gmres_vdata, HYPRE_Int *rel_change ); +HYPRE_Int +hypre_GMRESGetRelChange_long_dbl( void *gmres_vdata, HYPRE_Int *rel_change ); + +HYPRE_Int +hypre_GMRESGetResidual_flt( void *gmres_vdata, void **residual ); +HYPRE_Int +hypre_GMRESGetResidual_dbl( void *gmres_vdata, void **residual ); +HYPRE_Int +hypre_GMRESGetResidual_long_dbl( void *gmres_vdata, void **residual ); + +HYPRE_Int +hypre_GMRESGetSkipRealResidualCheck_flt( void *gmres_vdata, HYPRE_Int *skip_real_r_check ); +HYPRE_Int +hypre_GMRESGetSkipRealResidualCheck_dbl( void *gmres_vdata, HYPRE_Int *skip_real_r_check ); +HYPRE_Int +hypre_GMRESGetSkipRealResidualCheck_long_dbl( void *gmres_vdata, HYPRE_Int *skip_real_r_check ); + +HYPRE_Int +hypre_GMRESGetStopCrit_flt( void *gmres_vdata, HYPRE_Int *stop_crit ); +HYPRE_Int +hypre_GMRESGetStopCrit_dbl( void *gmres_vdata, HYPRE_Int *stop_crit ); +HYPRE_Int +hypre_GMRESGetStopCrit_long_dbl( void *gmres_vdata, HYPRE_Int *stop_crit ); + +HYPRE_Int +hypre_GMRESGetTol_flt( void *gmres_vdata, hypre_float *tol ); +HYPRE_Int +hypre_GMRESGetTol_dbl( void *gmres_vdata, hypre_double *tol ); +HYPRE_Int +hypre_GMRESGetTol_long_dbl( void *gmres_vdata, hypre_long_double *tol ); + +HYPRE_Int +hypre_GMRESSetAbsoluteTol_flt( void *gmres_vdata, hypre_float a_tol ); +HYPRE_Int +hypre_GMRESSetAbsoluteTol_dbl( void *gmres_vdata, hypre_double a_tol ); +HYPRE_Int +hypre_GMRESSetAbsoluteTol_long_dbl( void *gmres_vdata, hypre_long_double a_tol ); + +HYPRE_Int +hypre_GMRESSetConvergenceFactorTol_flt( void *gmres_vdata, hypre_float cf_tol ); +HYPRE_Int +hypre_GMRESSetConvergenceFactorTol_dbl( void *gmres_vdata, hypre_double cf_tol ); +HYPRE_Int +hypre_GMRESSetConvergenceFactorTol_long_dbl( void *gmres_vdata, hypre_long_double cf_tol ); + +HYPRE_Int +hypre_GMRESSetHybrid_flt( void *gmres_vdata, HYPRE_Int level ); +HYPRE_Int +hypre_GMRESSetHybrid_dbl( void *gmres_vdata, HYPRE_Int level ); +HYPRE_Int +hypre_GMRESSetHybrid_long_dbl( void *gmres_vdata, HYPRE_Int level ); + +HYPRE_Int +hypre_GMRESSetKDim_flt( void *gmres_vdata, HYPRE_Int k_dim ); +HYPRE_Int +hypre_GMRESSetKDim_dbl( void *gmres_vdata, HYPRE_Int k_dim ); +HYPRE_Int +hypre_GMRESSetKDim_long_dbl( void *gmres_vdata, HYPRE_Int k_dim ); + +HYPRE_Int +hypre_GMRESSetLogging_flt( void *gmres_vdata, HYPRE_Int level ); +HYPRE_Int +hypre_GMRESSetLogging_dbl( void *gmres_vdata, HYPRE_Int level ); +HYPRE_Int +hypre_GMRESSetLogging_long_dbl( void *gmres_vdata, HYPRE_Int level ); + +HYPRE_Int +hypre_GMRESSetMaxIter_flt( void *gmres_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_GMRESSetMaxIter_dbl( void *gmres_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_GMRESSetMaxIter_long_dbl( void *gmres_vdata, HYPRE_Int max_iter ); + +HYPRE_Int +hypre_GMRESSetMinIter_flt( void *gmres_vdata, HYPRE_Int min_iter ); +HYPRE_Int +hypre_GMRESSetMinIter_dbl( void *gmres_vdata, HYPRE_Int min_iter ); +HYPRE_Int +hypre_GMRESSetMinIter_long_dbl( void *gmres_vdata, HYPRE_Int min_iter ); + +HYPRE_Int +hypre_GMRESSetPrecond_flt( void *gmres_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ); +HYPRE_Int +hypre_GMRESSetPrecond_dbl( void *gmres_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ); +HYPRE_Int +hypre_GMRESSetPrecond_long_dbl( void *gmres_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ); + +HYPRE_Int +hypre_GMRESSetPrecondMatrix_flt( void *gmres_vdata, void *precond_matrix ); +HYPRE_Int +hypre_GMRESSetPrecondMatrix_dbl( void *gmres_vdata, void *precond_matrix ); +HYPRE_Int +hypre_GMRESSetPrecondMatrix_long_dbl( void *gmres_vdata, void *precond_matrix ); + +HYPRE_Int +hypre_GMRESSetPrintLevel_flt( void *gmres_vdata, HYPRE_Int level ); +HYPRE_Int +hypre_GMRESSetPrintLevel_dbl( void *gmres_vdata, HYPRE_Int level ); +HYPRE_Int +hypre_GMRESSetPrintLevel_long_dbl( void *gmres_vdata, HYPRE_Int level ); + +HYPRE_Int +hypre_GMRESSetRefSolution_flt( void *gmres_vdata, void *xref ); +HYPRE_Int +hypre_GMRESSetRefSolution_dbl( void *gmres_vdata, void *xref ); +HYPRE_Int +hypre_GMRESSetRefSolution_long_dbl( void *gmres_vdata, void *xref ); + +HYPRE_Int +hypre_GMRESSetRelChange_flt( void *gmres_vdata, HYPRE_Int rel_change ); +HYPRE_Int +hypre_GMRESSetRelChange_dbl( void *gmres_vdata, HYPRE_Int rel_change ); +HYPRE_Int +hypre_GMRESSetRelChange_long_dbl( void *gmres_vdata, HYPRE_Int rel_change ); + +HYPRE_Int +hypre_GMRESSetSkipRealResidualCheck_flt( void *gmres_vdata, HYPRE_Int skip_real_r_check ); +HYPRE_Int +hypre_GMRESSetSkipRealResidualCheck_dbl( void *gmres_vdata, HYPRE_Int skip_real_r_check ); +HYPRE_Int +hypre_GMRESSetSkipRealResidualCheck_long_dbl( void *gmres_vdata, HYPRE_Int skip_real_r_check ); + +HYPRE_Int +hypre_GMRESSetStopCrit_flt( void *gmres_vdata, HYPRE_Int stop_crit ); +HYPRE_Int +hypre_GMRESSetStopCrit_dbl( void *gmres_vdata, HYPRE_Int stop_crit ); +HYPRE_Int +hypre_GMRESSetStopCrit_long_dbl( void *gmres_vdata, HYPRE_Int stop_crit ); + +HYPRE_Int +hypre_GMRESSetTol_flt( void *gmres_vdata, hypre_float tol ); +HYPRE_Int +hypre_GMRESSetTol_dbl( void *gmres_vdata, hypre_double tol ); +HYPRE_Int +hypre_GMRESSetTol_long_dbl( void *gmres_vdata, hypre_long_double tol ); + +HYPRE_Int +hypre_GMRESSetup_flt( void *gmres_vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_GMRESSetup_dbl( void *gmres_vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_GMRESSetup_long_dbl( void *gmres_vdata, void *A, void *b, void *x ); + +HYPRE_Int +hypre_GMRESSolve_flt( void *gmres_vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_GMRESSolve_dbl( void *gmres_vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_GMRESSolve_long_dbl( void *gmres_vdata, void *A, void *b, void *x ); + +void * +hypre_LGMRESCreate_flt( hypre_LGMRESFunctions *lgmres_functions ); +void * +hypre_LGMRESCreate_dbl( hypre_LGMRESFunctions *lgmres_functions ); +void * +hypre_LGMRESCreate_long_dbl( hypre_LGMRESFunctions *lgmres_functions ); + +HYPRE_Int +hypre_LGMRESDestroy_flt( void *lgmres_vdata ); +HYPRE_Int +hypre_LGMRESDestroy_dbl( void *lgmres_vdata ); +HYPRE_Int +hypre_LGMRESDestroy_long_dbl( void *lgmres_vdata ); + +hypre_LGMRESFunctions * +hypre_LGMRESFunctionsCreate_flt( hypre_KrylovPtrToCAlloc CAlloc, hypre_KrylovPtrToFree Free, hypre_KrylovPtrToCommInfo CommInfo, hypre_KrylovPtrToCreateVector CreateVector, hypre_KrylovPtrToCreateVectorArray CreateVectorArray, hypre_KrylovPtrToDestroyVector DestroyVector, hypre_KrylovPtrToMatvecCreate MatvecCreate, hypre_KrylovPtrToMatvec Matvec, hypre_KrylovPtrToMatvecDestroy MatvecDestroy, hypre_KrylovPtrToInnerProd InnerProd, hypre_KrylovPtrToCopyVector CopyVector, hypre_KrylovPtrToClearVector ClearVector, hypre_KrylovPtrToScaleVector ScaleVector, hypre_KrylovPtrToAxpy Axpy, hypre_KrylovPtrToPrecondSetup PrecondSetup, hypre_KrylovPtrToPrecond Precond ); +hypre_LGMRESFunctions * +hypre_LGMRESFunctionsCreate_dbl( hypre_KrylovPtrToCAlloc CAlloc, hypre_KrylovPtrToFree Free, hypre_KrylovPtrToCommInfo CommInfo, hypre_KrylovPtrToCreateVector CreateVector, hypre_KrylovPtrToCreateVectorArray CreateVectorArray, hypre_KrylovPtrToDestroyVector DestroyVector, hypre_KrylovPtrToMatvecCreate MatvecCreate, hypre_KrylovPtrToMatvec Matvec, hypre_KrylovPtrToMatvecDestroy MatvecDestroy, hypre_KrylovPtrToInnerProd InnerProd, hypre_KrylovPtrToCopyVector CopyVector, hypre_KrylovPtrToClearVector ClearVector, hypre_KrylovPtrToScaleVector ScaleVector, hypre_KrylovPtrToAxpy Axpy, hypre_KrylovPtrToPrecondSetup PrecondSetup, hypre_KrylovPtrToPrecond Precond ); +hypre_LGMRESFunctions * +hypre_LGMRESFunctionsCreate_long_dbl( hypre_KrylovPtrToCAlloc CAlloc, hypre_KrylovPtrToFree Free, hypre_KrylovPtrToCommInfo CommInfo, hypre_KrylovPtrToCreateVector CreateVector, hypre_KrylovPtrToCreateVectorArray CreateVectorArray, hypre_KrylovPtrToDestroyVector DestroyVector, hypre_KrylovPtrToMatvecCreate MatvecCreate, hypre_KrylovPtrToMatvec Matvec, hypre_KrylovPtrToMatvecDestroy MatvecDestroy, hypre_KrylovPtrToInnerProd InnerProd, hypre_KrylovPtrToCopyVector CopyVector, hypre_KrylovPtrToClearVector ClearVector, hypre_KrylovPtrToScaleVector ScaleVector, hypre_KrylovPtrToAxpy Axpy, hypre_KrylovPtrToPrecondSetup PrecondSetup, hypre_KrylovPtrToPrecond Precond ); + +HYPRE_Int +hypre_LGMRESGetAbsoluteTol_flt( void *lgmres_vdata, hypre_float *a_tol ); +HYPRE_Int +hypre_LGMRESGetAbsoluteTol_dbl( void *lgmres_vdata, hypre_double *a_tol ); +HYPRE_Int +hypre_LGMRESGetAbsoluteTol_long_dbl( void *lgmres_vdata, hypre_long_double *a_tol ); + +HYPRE_Int +hypre_LGMRESGetAugDim_flt( void *lgmres_vdata, HYPRE_Int *aug_dim ); +HYPRE_Int +hypre_LGMRESGetAugDim_dbl( void *lgmres_vdata, HYPRE_Int *aug_dim ); +HYPRE_Int +hypre_LGMRESGetAugDim_long_dbl( void *lgmres_vdata, HYPRE_Int *aug_dim ); + +HYPRE_Int +hypre_LGMRESGetConverged_flt( void *lgmres_vdata, HYPRE_Int *converged ); +HYPRE_Int +hypre_LGMRESGetConverged_dbl( void *lgmres_vdata, HYPRE_Int *converged ); +HYPRE_Int +hypre_LGMRESGetConverged_long_dbl( void *lgmres_vdata, HYPRE_Int *converged ); + +HYPRE_Int +hypre_LGMRESGetConvergenceFactorTol_flt( void *lgmres_vdata, hypre_float *cf_tol ); +HYPRE_Int +hypre_LGMRESGetConvergenceFactorTol_dbl( void *lgmres_vdata, hypre_double *cf_tol ); +HYPRE_Int +hypre_LGMRESGetConvergenceFactorTol_long_dbl( void *lgmres_vdata, hypre_long_double *cf_tol ); + +HYPRE_Int +hypre_LGMRESGetFinalRelativeResidualNorm_flt( void *lgmres_vdata, hypre_float *relative_residual_norm ); +HYPRE_Int +hypre_LGMRESGetFinalRelativeResidualNorm_dbl( void *lgmres_vdata, hypre_double *relative_residual_norm ); +HYPRE_Int +hypre_LGMRESGetFinalRelativeResidualNorm_long_dbl( void *lgmres_vdata, hypre_long_double *relative_residual_norm ); + +HYPRE_Int +hypre_LGMRESGetKDim_flt( void *lgmres_vdata, HYPRE_Int *k_dim ); +HYPRE_Int +hypre_LGMRESGetKDim_dbl( void *lgmres_vdata, HYPRE_Int *k_dim ); +HYPRE_Int +hypre_LGMRESGetKDim_long_dbl( void *lgmres_vdata, HYPRE_Int *k_dim ); + +HYPRE_Int +hypre_LGMRESGetLogging_flt( void *lgmres_vdata, HYPRE_Int *level ); +HYPRE_Int +hypre_LGMRESGetLogging_dbl( void *lgmres_vdata, HYPRE_Int *level ); +HYPRE_Int +hypre_LGMRESGetLogging_long_dbl( void *lgmres_vdata, HYPRE_Int *level ); + +HYPRE_Int +hypre_LGMRESGetMaxIter_flt( void *lgmres_vdata, HYPRE_Int *max_iter ); +HYPRE_Int +hypre_LGMRESGetMaxIter_dbl( void *lgmres_vdata, HYPRE_Int *max_iter ); +HYPRE_Int +hypre_LGMRESGetMaxIter_long_dbl( void *lgmres_vdata, HYPRE_Int *max_iter ); + +HYPRE_Int +hypre_LGMRESGetMinIter_flt( void *lgmres_vdata, HYPRE_Int *min_iter ); +HYPRE_Int +hypre_LGMRESGetMinIter_dbl( void *lgmres_vdata, HYPRE_Int *min_iter ); +HYPRE_Int +hypre_LGMRESGetMinIter_long_dbl( void *lgmres_vdata, HYPRE_Int *min_iter ); + +HYPRE_Int +hypre_LGMRESGetNumIterations_flt( void *lgmres_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_LGMRESGetNumIterations_dbl( void *lgmres_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_LGMRESGetNumIterations_long_dbl( void *lgmres_vdata, HYPRE_Int *num_iterations ); + +HYPRE_Int +hypre_LGMRESGetPrecond_flt( void *lgmres_vdata, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +hypre_LGMRESGetPrecond_dbl( void *lgmres_vdata, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +hypre_LGMRESGetPrecond_long_dbl( void *lgmres_vdata, HYPRE_Solver *precond_data_ptr ); + +HYPRE_Int +hypre_LGMRESGetPrintLevel_flt( void *lgmres_vdata, HYPRE_Int *level ); +HYPRE_Int +hypre_LGMRESGetPrintLevel_dbl( void *lgmres_vdata, HYPRE_Int *level ); +HYPRE_Int +hypre_LGMRESGetPrintLevel_long_dbl( void *lgmres_vdata, HYPRE_Int *level ); + +HYPRE_Int +hypre_LGMRESGetResidual_flt( void *lgmres_vdata, void **residual ); +HYPRE_Int +hypre_LGMRESGetResidual_dbl( void *lgmres_vdata, void **residual ); +HYPRE_Int +hypre_LGMRESGetResidual_long_dbl( void *lgmres_vdata, void **residual ); + +HYPRE_Int +hypre_LGMRESGetStopCrit_flt( void *lgmres_vdata, HYPRE_Int *stop_crit ); +HYPRE_Int +hypre_LGMRESGetStopCrit_dbl( void *lgmres_vdata, HYPRE_Int *stop_crit ); +HYPRE_Int +hypre_LGMRESGetStopCrit_long_dbl( void *lgmres_vdata, HYPRE_Int *stop_crit ); + +HYPRE_Int +hypre_LGMRESGetTol_flt( void *lgmres_vdata, hypre_float *tol ); +HYPRE_Int +hypre_LGMRESGetTol_dbl( void *lgmres_vdata, hypre_double *tol ); +HYPRE_Int +hypre_LGMRESGetTol_long_dbl( void *lgmres_vdata, hypre_long_double *tol ); + +HYPRE_Int +hypre_LGMRESSetAbsoluteTol_flt( void *lgmres_vdata, hypre_float a_tol ); +HYPRE_Int +hypre_LGMRESSetAbsoluteTol_dbl( void *lgmres_vdata, hypre_double a_tol ); +HYPRE_Int +hypre_LGMRESSetAbsoluteTol_long_dbl( void *lgmres_vdata, hypre_long_double a_tol ); + +HYPRE_Int +hypre_LGMRESSetAugDim_flt( void *lgmres_vdata, HYPRE_Int aug_dim ); +HYPRE_Int +hypre_LGMRESSetAugDim_dbl( void *lgmres_vdata, HYPRE_Int aug_dim ); +HYPRE_Int +hypre_LGMRESSetAugDim_long_dbl( void *lgmres_vdata, HYPRE_Int aug_dim ); + +HYPRE_Int +hypre_LGMRESSetConvergenceFactorTol_flt( void *lgmres_vdata, hypre_float cf_tol ); +HYPRE_Int +hypre_LGMRESSetConvergenceFactorTol_dbl( void *lgmres_vdata, hypre_double cf_tol ); +HYPRE_Int +hypre_LGMRESSetConvergenceFactorTol_long_dbl( void *lgmres_vdata, hypre_long_double cf_tol ); + +HYPRE_Int +hypre_LGMRESSetKDim_flt( void *lgmres_vdata, HYPRE_Int k_dim ); +HYPRE_Int +hypre_LGMRESSetKDim_dbl( void *lgmres_vdata, HYPRE_Int k_dim ); +HYPRE_Int +hypre_LGMRESSetKDim_long_dbl( void *lgmres_vdata, HYPRE_Int k_dim ); + +HYPRE_Int +hypre_LGMRESSetLogging_flt( void *lgmres_vdata, HYPRE_Int level ); +HYPRE_Int +hypre_LGMRESSetLogging_dbl( void *lgmres_vdata, HYPRE_Int level ); +HYPRE_Int +hypre_LGMRESSetLogging_long_dbl( void *lgmres_vdata, HYPRE_Int level ); + +HYPRE_Int +hypre_LGMRESSetMaxIter_flt( void *lgmres_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_LGMRESSetMaxIter_dbl( void *lgmres_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_LGMRESSetMaxIter_long_dbl( void *lgmres_vdata, HYPRE_Int max_iter ); + +HYPRE_Int +hypre_LGMRESSetMinIter_flt( void *lgmres_vdata, HYPRE_Int min_iter ); +HYPRE_Int +hypre_LGMRESSetMinIter_dbl( void *lgmres_vdata, HYPRE_Int min_iter ); +HYPRE_Int +hypre_LGMRESSetMinIter_long_dbl( void *lgmres_vdata, HYPRE_Int min_iter ); + +HYPRE_Int +hypre_LGMRESSetPrecond_flt( void *lgmres_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ); +HYPRE_Int +hypre_LGMRESSetPrecond_dbl( void *lgmres_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ); +HYPRE_Int +hypre_LGMRESSetPrecond_long_dbl( void *lgmres_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ); + +HYPRE_Int +hypre_LGMRESSetPrintLevel_flt( void *lgmres_vdata, HYPRE_Int level ); +HYPRE_Int +hypre_LGMRESSetPrintLevel_dbl( void *lgmres_vdata, HYPRE_Int level ); +HYPRE_Int +hypre_LGMRESSetPrintLevel_long_dbl( void *lgmres_vdata, HYPRE_Int level ); + +HYPRE_Int +hypre_LGMRESSetStopCrit_flt( void *lgmres_vdata, HYPRE_Int stop_crit ); +HYPRE_Int +hypre_LGMRESSetStopCrit_dbl( void *lgmres_vdata, HYPRE_Int stop_crit ); +HYPRE_Int +hypre_LGMRESSetStopCrit_long_dbl( void *lgmres_vdata, HYPRE_Int stop_crit ); + +HYPRE_Int +hypre_LGMRESSetTol_flt( void *lgmres_vdata, hypre_float tol ); +HYPRE_Int +hypre_LGMRESSetTol_dbl( void *lgmres_vdata, hypre_double tol ); +HYPRE_Int +hypre_LGMRESSetTol_long_dbl( void *lgmres_vdata, hypre_long_double tol ); + +HYPRE_Int +hypre_LGMRESSetup_flt( void *lgmres_vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_LGMRESSetup_dbl( void *lgmres_vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_LGMRESSetup_long_dbl( void *lgmres_vdata, void *A, void *b, void *x ); + +HYPRE_Int +hypre_LGMRESSolve_flt( void *lgmres_vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_LGMRESSolve_dbl( void *lgmres_vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_LGMRESSolve_long_dbl( void *lgmres_vdata, void *A, void *b, void *x ); + +void * +hypre_PCGCreate_flt( hypre_PCGFunctions *pcg_functions ); +void * +hypre_PCGCreate_dbl( hypre_PCGFunctions *pcg_functions ); +void * +hypre_PCGCreate_long_dbl( hypre_PCGFunctions *pcg_functions ); + +HYPRE_Int +hypre_PCGDestroy_flt( void *pcg_vdata ); +HYPRE_Int +hypre_PCGDestroy_dbl( void *pcg_vdata ); +HYPRE_Int +hypre_PCGDestroy_long_dbl( void *pcg_vdata ); + +hypre_PCGFunctions * +hypre_PCGFunctionsCreate_flt( hypre_KrylovPtrToCAlloc CAlloc, hypre_KrylovPtrToFree Free, hypre_KrylovPtrToCommInfo CommInfo, hypre_KrylovPtrToCreateVector CreateVector, hypre_KrylovPtrToDestroyVector DestroyVector, hypre_KrylovPtrToMatvecCreate MatvecCreate, hypre_KrylovPtrToMatvec Matvec, hypre_KrylovPtrToMatvecDestroy MatvecDestroy, hypre_KrylovPtrToInnerProd InnerProd, hypre_KrylovPtrToCopyVector CopyVector, hypre_KrylovPtrToClearVector ClearVector, hypre_KrylovPtrToScaleVector ScaleVector, hypre_KrylovPtrToAxpy Axpy, hypre_KrylovPtrToPrecondSetup PrecondSetup, hypre_KrylovPtrToPrecond Precond ); +hypre_PCGFunctions * +hypre_PCGFunctionsCreate_dbl( hypre_KrylovPtrToCAlloc CAlloc, hypre_KrylovPtrToFree Free, hypre_KrylovPtrToCommInfo CommInfo, hypre_KrylovPtrToCreateVector CreateVector, hypre_KrylovPtrToDestroyVector DestroyVector, hypre_KrylovPtrToMatvecCreate MatvecCreate, hypre_KrylovPtrToMatvec Matvec, hypre_KrylovPtrToMatvecDestroy MatvecDestroy, hypre_KrylovPtrToInnerProd InnerProd, hypre_KrylovPtrToCopyVector CopyVector, hypre_KrylovPtrToClearVector ClearVector, hypre_KrylovPtrToScaleVector ScaleVector, hypre_KrylovPtrToAxpy Axpy, hypre_KrylovPtrToPrecondSetup PrecondSetup, hypre_KrylovPtrToPrecond Precond ); +hypre_PCGFunctions * +hypre_PCGFunctionsCreate_long_dbl( hypre_KrylovPtrToCAlloc CAlloc, hypre_KrylovPtrToFree Free, hypre_KrylovPtrToCommInfo CommInfo, hypre_KrylovPtrToCreateVector CreateVector, hypre_KrylovPtrToDestroyVector DestroyVector, hypre_KrylovPtrToMatvecCreate MatvecCreate, hypre_KrylovPtrToMatvec Matvec, hypre_KrylovPtrToMatvecDestroy MatvecDestroy, hypre_KrylovPtrToInnerProd InnerProd, hypre_KrylovPtrToCopyVector CopyVector, hypre_KrylovPtrToClearVector ClearVector, hypre_KrylovPtrToScaleVector ScaleVector, hypre_KrylovPtrToAxpy Axpy, hypre_KrylovPtrToPrecondSetup PrecondSetup, hypre_KrylovPtrToPrecond Precond ); + +HYPRE_Int +hypre_PCGGetAbsoluteTol_flt( void *pcg_vdata, hypre_float *a_tol ); +HYPRE_Int +hypre_PCGGetAbsoluteTol_dbl( void *pcg_vdata, hypre_double *a_tol ); +HYPRE_Int +hypre_PCGGetAbsoluteTol_long_dbl( void *pcg_vdata, hypre_long_double *a_tol ); + +HYPRE_Int +hypre_PCGGetAbsoluteTolFactor_flt( void *pcg_vdata, hypre_float *atolf ); +HYPRE_Int +hypre_PCGGetAbsoluteTolFactor_dbl( void *pcg_vdata, hypre_double *atolf ); +HYPRE_Int +hypre_PCGGetAbsoluteTolFactor_long_dbl( void *pcg_vdata, hypre_long_double *atolf ); + +HYPRE_Int +hypre_PCGGetConverged_flt( void *pcg_vdata, HYPRE_Int *converged ); +HYPRE_Int +hypre_PCGGetConverged_dbl( void *pcg_vdata, HYPRE_Int *converged ); +HYPRE_Int +hypre_PCGGetConverged_long_dbl( void *pcg_vdata, HYPRE_Int *converged ); + +HYPRE_Int +hypre_PCGGetConvergenceFactorTol_flt( void *pcg_vdata, hypre_float *cf_tol ); +HYPRE_Int +hypre_PCGGetConvergenceFactorTol_dbl( void *pcg_vdata, hypre_double *cf_tol ); +HYPRE_Int +hypre_PCGGetConvergenceFactorTol_long_dbl( void *pcg_vdata, hypre_long_double *cf_tol ); + +HYPRE_Int +hypre_PCGGetFinalRelativeResidualNorm_flt( void *pcg_vdata, hypre_float *relative_residual_norm ); +HYPRE_Int +hypre_PCGGetFinalRelativeResidualNorm_dbl( void *pcg_vdata, hypre_double *relative_residual_norm ); +HYPRE_Int +hypre_PCGGetFinalRelativeResidualNorm_long_dbl( void *pcg_vdata, hypre_long_double *relative_residual_norm ); + +HYPRE_Int +hypre_PCGGetFlex_flt( void *pcg_vdata, HYPRE_Int *flex ); +HYPRE_Int +hypre_PCGGetFlex_dbl( void *pcg_vdata, HYPRE_Int *flex ); +HYPRE_Int +hypre_PCGGetFlex_long_dbl( void *pcg_vdata, HYPRE_Int *flex ); + +HYPRE_Int +hypre_PCGGetLogging_flt( void *pcg_vdata, HYPRE_Int *level ); +HYPRE_Int +hypre_PCGGetLogging_dbl( void *pcg_vdata, HYPRE_Int *level ); +HYPRE_Int +hypre_PCGGetLogging_long_dbl( void *pcg_vdata, HYPRE_Int *level ); + +HYPRE_Int +hypre_PCGGetMaxIter_flt( void *pcg_vdata, HYPRE_Int *max_iter ); +HYPRE_Int +hypre_PCGGetMaxIter_dbl( void *pcg_vdata, HYPRE_Int *max_iter ); +HYPRE_Int +hypre_PCGGetMaxIter_long_dbl( void *pcg_vdata, HYPRE_Int *max_iter ); + +HYPRE_Int +hypre_PCGGetNumIterations_flt( void *pcg_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_PCGGetNumIterations_dbl( void *pcg_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_PCGGetNumIterations_long_dbl( void *pcg_vdata, HYPRE_Int *num_iterations ); + +HYPRE_Int +hypre_PCGGetPrecond_flt( void *pcg_vdata, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +hypre_PCGGetPrecond_dbl( void *pcg_vdata, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +hypre_PCGGetPrecond_long_dbl( void *pcg_vdata, HYPRE_Solver *precond_data_ptr ); + +HYPRE_Int +hypre_PCGGetPrecondMatrix_flt( void *pcg_vdata, HYPRE_Matrix *precond_matrix_ptr ); +HYPRE_Int +hypre_PCGGetPrecondMatrix_dbl( void *pcg_vdata, HYPRE_Matrix *precond_matrix_ptr ); +HYPRE_Int +hypre_PCGGetPrecondMatrix_long_dbl( void *pcg_vdata, HYPRE_Matrix *precond_matrix_ptr ); + +HYPRE_Int +hypre_PCGGetPrintLevel_flt( void *pcg_vdata, HYPRE_Int *level ); +HYPRE_Int +hypre_PCGGetPrintLevel_dbl( void *pcg_vdata, HYPRE_Int *level ); +HYPRE_Int +hypre_PCGGetPrintLevel_long_dbl( void *pcg_vdata, HYPRE_Int *level ); + +HYPRE_Int +hypre_PCGGetRecomputeResidual_flt( void *pcg_vdata, HYPRE_Int *recompute_residual ); +HYPRE_Int +hypre_PCGGetRecomputeResidual_dbl( void *pcg_vdata, HYPRE_Int *recompute_residual ); +HYPRE_Int +hypre_PCGGetRecomputeResidual_long_dbl( void *pcg_vdata, HYPRE_Int *recompute_residual ); + +HYPRE_Int +hypre_PCGGetRecomputeResidualP_flt( void *pcg_vdata, HYPRE_Int *recompute_residual_p ); +HYPRE_Int +hypre_PCGGetRecomputeResidualP_dbl( void *pcg_vdata, HYPRE_Int *recompute_residual_p ); +HYPRE_Int +hypre_PCGGetRecomputeResidualP_long_dbl( void *pcg_vdata, HYPRE_Int *recompute_residual_p ); + +HYPRE_Int +hypre_PCGGetRelChange_flt( void *pcg_vdata, HYPRE_Int *rel_change ); +HYPRE_Int +hypre_PCGGetRelChange_dbl( void *pcg_vdata, HYPRE_Int *rel_change ); +HYPRE_Int +hypre_PCGGetRelChange_long_dbl( void *pcg_vdata, HYPRE_Int *rel_change ); + +HYPRE_Int +hypre_PCGGetResidual_flt( void *pcg_vdata, void **residual ); +HYPRE_Int +hypre_PCGGetResidual_dbl( void *pcg_vdata, void **residual ); +HYPRE_Int +hypre_PCGGetResidual_long_dbl( void *pcg_vdata, void **residual ); + +HYPRE_Int +hypre_PCGGetResidualTol_flt( void *pcg_vdata, hypre_float *rtol ); +HYPRE_Int +hypre_PCGGetResidualTol_dbl( void *pcg_vdata, hypre_double *rtol ); +HYPRE_Int +hypre_PCGGetResidualTol_long_dbl( void *pcg_vdata, hypre_long_double *rtol ); + +HYPRE_Int +hypre_PCGGetSkipBreak_flt( void *pcg_vdata, HYPRE_Int *skip_break ); +HYPRE_Int +hypre_PCGGetSkipBreak_dbl( void *pcg_vdata, HYPRE_Int *skip_break ); +HYPRE_Int +hypre_PCGGetSkipBreak_long_dbl( void *pcg_vdata, HYPRE_Int *skip_break ); + +HYPRE_Int +hypre_PCGGetStopCrit_flt( void *pcg_vdata, HYPRE_Int *stop_crit ); +HYPRE_Int +hypre_PCGGetStopCrit_dbl( void *pcg_vdata, HYPRE_Int *stop_crit ); +HYPRE_Int +hypre_PCGGetStopCrit_long_dbl( void *pcg_vdata, HYPRE_Int *stop_crit ); + +HYPRE_Int +hypre_PCGGetTol_flt( void *pcg_vdata, hypre_float *tol ); +HYPRE_Int +hypre_PCGGetTol_dbl( void *pcg_vdata, hypre_double *tol ); +HYPRE_Int +hypre_PCGGetTol_long_dbl( void *pcg_vdata, hypre_long_double *tol ); + +HYPRE_Int +hypre_PCGGetTwoNorm_flt( void *pcg_vdata, HYPRE_Int *two_norm ); +HYPRE_Int +hypre_PCGGetTwoNorm_dbl( void *pcg_vdata, HYPRE_Int *two_norm ); +HYPRE_Int +hypre_PCGGetTwoNorm_long_dbl( void *pcg_vdata, HYPRE_Int *two_norm ); + +HYPRE_Int +hypre_PCGPrintLogging_flt( void *pcg_vdata, HYPRE_Int myid ); +HYPRE_Int +hypre_PCGPrintLogging_dbl( void *pcg_vdata, HYPRE_Int myid ); +HYPRE_Int +hypre_PCGPrintLogging_long_dbl( void *pcg_vdata, HYPRE_Int myid ); + +HYPRE_Int +hypre_PCGSetAbsoluteTol_flt( void *pcg_vdata, hypre_float a_tol ); +HYPRE_Int +hypre_PCGSetAbsoluteTol_dbl( void *pcg_vdata, hypre_double a_tol ); +HYPRE_Int +hypre_PCGSetAbsoluteTol_long_dbl( void *pcg_vdata, hypre_long_double a_tol ); + +HYPRE_Int +hypre_PCGSetAbsoluteTolFactor_flt( void *pcg_vdata, hypre_float atolf ); +HYPRE_Int +hypre_PCGSetAbsoluteTolFactor_dbl( void *pcg_vdata, hypre_double atolf ); +HYPRE_Int +hypre_PCGSetAbsoluteTolFactor_long_dbl( void *pcg_vdata, hypre_long_double atolf ); + +HYPRE_Int +hypre_PCGSetConvergenceFactorTol_flt( void *pcg_vdata, hypre_float cf_tol ); +HYPRE_Int +hypre_PCGSetConvergenceFactorTol_dbl( void *pcg_vdata, hypre_double cf_tol ); +HYPRE_Int +hypre_PCGSetConvergenceFactorTol_long_dbl( void *pcg_vdata, hypre_long_double cf_tol ); + +HYPRE_Int +hypre_PCGSetFlex_flt( void *pcg_vdata, HYPRE_Int flex ); +HYPRE_Int +hypre_PCGSetFlex_dbl( void *pcg_vdata, HYPRE_Int flex ); +HYPRE_Int +hypre_PCGSetFlex_long_dbl( void *pcg_vdata, HYPRE_Int flex ); + +HYPRE_Int +hypre_PCGSetHybrid_flt( void *pcg_vdata, HYPRE_Int level ); +HYPRE_Int +hypre_PCGSetHybrid_dbl( void *pcg_vdata, HYPRE_Int level ); +HYPRE_Int +hypre_PCGSetHybrid_long_dbl( void *pcg_vdata, HYPRE_Int level ); + +HYPRE_Int +hypre_PCGSetLogging_flt( void *pcg_vdata, HYPRE_Int level ); +HYPRE_Int +hypre_PCGSetLogging_dbl( void *pcg_vdata, HYPRE_Int level ); +HYPRE_Int +hypre_PCGSetLogging_long_dbl( void *pcg_vdata, HYPRE_Int level ); + +HYPRE_Int +hypre_PCGSetMaxIter_flt( void *pcg_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_PCGSetMaxIter_dbl( void *pcg_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_PCGSetMaxIter_long_dbl( void *pcg_vdata, HYPRE_Int max_iter ); + +HYPRE_Int +hypre_PCGSetPrecond_flt( void *pcg_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ); +HYPRE_Int +hypre_PCGSetPrecond_dbl( void *pcg_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ); +HYPRE_Int +hypre_PCGSetPrecond_long_dbl( void *pcg_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ); + +HYPRE_Int +hypre_PCGSetPrecondMatrix_flt( void *pcg_vdata, void *precond_matrix ); +HYPRE_Int +hypre_PCGSetPrecondMatrix_dbl( void *pcg_vdata, void *precond_matrix ); +HYPRE_Int +hypre_PCGSetPrecondMatrix_long_dbl( void *pcg_vdata, void *precond_matrix ); + +HYPRE_Int +hypre_PCGSetPreconditioner_flt( void *pcg_vdata, void *precond_data ); +HYPRE_Int +hypre_PCGSetPreconditioner_dbl( void *pcg_vdata, void *precond_data ); +HYPRE_Int +hypre_PCGSetPreconditioner_long_dbl( void *pcg_vdata, void *precond_data ); + +HYPRE_Int +hypre_PCGSetPrintLevel_flt( void *pcg_vdata, HYPRE_Int level ); +HYPRE_Int +hypre_PCGSetPrintLevel_dbl( void *pcg_vdata, HYPRE_Int level ); +HYPRE_Int +hypre_PCGSetPrintLevel_long_dbl( void *pcg_vdata, HYPRE_Int level ); + +HYPRE_Int +hypre_PCGSetRecomputeResidual_flt( void *pcg_vdata, HYPRE_Int recompute_residual ); +HYPRE_Int +hypre_PCGSetRecomputeResidual_dbl( void *pcg_vdata, HYPRE_Int recompute_residual ); +HYPRE_Int +hypre_PCGSetRecomputeResidual_long_dbl( void *pcg_vdata, HYPRE_Int recompute_residual ); + +HYPRE_Int +hypre_PCGSetRecomputeResidualP_flt( void *pcg_vdata, HYPRE_Int recompute_residual_p ); +HYPRE_Int +hypre_PCGSetRecomputeResidualP_dbl( void *pcg_vdata, HYPRE_Int recompute_residual_p ); +HYPRE_Int +hypre_PCGSetRecomputeResidualP_long_dbl( void *pcg_vdata, HYPRE_Int recompute_residual_p ); + +HYPRE_Int +hypre_PCGSetRelChange_flt( void *pcg_vdata, HYPRE_Int rel_change ); +HYPRE_Int +hypre_PCGSetRelChange_dbl( void *pcg_vdata, HYPRE_Int rel_change ); +HYPRE_Int +hypre_PCGSetRelChange_long_dbl( void *pcg_vdata, HYPRE_Int rel_change ); + +HYPRE_Int +hypre_PCGSetResidualTol_flt( void *pcg_vdata, hypre_float rtol ); +HYPRE_Int +hypre_PCGSetResidualTol_dbl( void *pcg_vdata, hypre_double rtol ); +HYPRE_Int +hypre_PCGSetResidualTol_long_dbl( void *pcg_vdata, hypre_long_double rtol ); + +HYPRE_Int +hypre_PCGSetSkipBreak_flt( void *pcg_vdata, HYPRE_Int skip_break ); +HYPRE_Int +hypre_PCGSetSkipBreak_dbl( void *pcg_vdata, HYPRE_Int skip_break ); +HYPRE_Int +hypre_PCGSetSkipBreak_long_dbl( void *pcg_vdata, HYPRE_Int skip_break ); + +HYPRE_Int +hypre_PCGSetStopCrit_flt( void *pcg_vdata, HYPRE_Int stop_crit ); +HYPRE_Int +hypre_PCGSetStopCrit_dbl( void *pcg_vdata, HYPRE_Int stop_crit ); +HYPRE_Int +hypre_PCGSetStopCrit_long_dbl( void *pcg_vdata, HYPRE_Int stop_crit ); + +HYPRE_Int +hypre_PCGSetTol_flt( void *pcg_vdata, hypre_float tol ); +HYPRE_Int +hypre_PCGSetTol_dbl( void *pcg_vdata, hypre_double tol ); +HYPRE_Int +hypre_PCGSetTol_long_dbl( void *pcg_vdata, hypre_long_double tol ); + +HYPRE_Int +hypre_PCGSetTwoNorm_flt( void *pcg_vdata, HYPRE_Int two_norm ); +HYPRE_Int +hypre_PCGSetTwoNorm_dbl( void *pcg_vdata, HYPRE_Int two_norm ); +HYPRE_Int +hypre_PCGSetTwoNorm_long_dbl( void *pcg_vdata, HYPRE_Int two_norm ); + +HYPRE_Int +hypre_PCGSetup_flt( void *pcg_vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_PCGSetup_dbl( void *pcg_vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_PCGSetup_long_dbl( void *pcg_vdata, void *A, void *b, void *x ); + +HYPRE_Int +hypre_PCGSolve_flt( void *pcg_vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_PCGSolve_dbl( void *pcg_vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_PCGSolve_long_dbl( void *pcg_vdata, void *A, void *b, void *x ); + + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + + + +#endif + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/src/krylov/_hypre_krylov_mup_def.h b/src/krylov/_hypre_krylov_mup_def.h new file mode 100644 index 0000000000..5b67cf2a2e --- /dev/null +++ b/src/krylov/_hypre_krylov_mup_def.h @@ -0,0 +1,465 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#ifndef hypre_KRYLOV_MUP_DEF_HEADER +#define hypre_KRYLOV_MUP_DEF_HEADER + +#include "_hypre_mup_def.h" + +#define HYPRE_BiCGSTABDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_BiCGSTABDestroy ) +#define HYPRE_BiCGSTABGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_BiCGSTABGetFinalRelativeResidualNorm ) +#define HYPRE_BiCGSTABGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_BiCGSTABGetNumIterations ) +#define HYPRE_BiCGSTABGetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_BiCGSTABGetPrecond ) +#define HYPRE_BiCGSTABGetPrecondMatrix HYPRE_MULTIPRECISION_FUNC ( HYPRE_BiCGSTABGetPrecondMatrix ) +#define HYPRE_BiCGSTABGetResidual HYPRE_MULTIPRECISION_FUNC ( HYPRE_BiCGSTABGetResidual ) +#define HYPRE_BiCGSTABSetAbsoluteTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_BiCGSTABSetAbsoluteTol ) +#define HYPRE_BiCGSTABSetConvergenceFactorTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_BiCGSTABSetConvergenceFactorTol ) +#define HYPRE_BiCGSTABSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_BiCGSTABSetLogging ) +#define HYPRE_BiCGSTABSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_BiCGSTABSetMaxIter ) +#define HYPRE_BiCGSTABSetMinIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_BiCGSTABSetMinIter ) +#define HYPRE_BiCGSTABSetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_BiCGSTABSetPrecond ) +#define HYPRE_BiCGSTABSetPrecondMatrix HYPRE_MULTIPRECISION_FUNC ( HYPRE_BiCGSTABSetPrecondMatrix ) +#define HYPRE_BiCGSTABSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_BiCGSTABSetPrintLevel ) +#define HYPRE_BiCGSTABSetStopCrit HYPRE_MULTIPRECISION_FUNC ( HYPRE_BiCGSTABSetStopCrit ) +#define HYPRE_BiCGSTABSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_BiCGSTABSetTol ) +#define HYPRE_BiCGSTABSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_BiCGSTABSetup ) +#define HYPRE_BiCGSTABSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_BiCGSTABSolve ) +#define HYPRE_CGNRDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_CGNRDestroy ) +#define HYPRE_CGNRGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_CGNRGetFinalRelativeResidualNorm ) +#define HYPRE_CGNRGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_CGNRGetNumIterations ) +#define HYPRE_CGNRGetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_CGNRGetPrecond ) +#define HYPRE_CGNRSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_CGNRSetLogging ) +#define HYPRE_CGNRSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_CGNRSetMaxIter ) +#define HYPRE_CGNRSetMinIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_CGNRSetMinIter ) +#define HYPRE_CGNRSetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_CGNRSetPrecond ) +#define HYPRE_CGNRSetStopCrit HYPRE_MULTIPRECISION_FUNC ( HYPRE_CGNRSetStopCrit ) +#define HYPRE_CGNRSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_CGNRSetTol ) +#define HYPRE_CGNRSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_CGNRSetup ) +#define HYPRE_CGNRSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_CGNRSolve ) +#define HYPRE_COGMRESGetAbsoluteTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_COGMRESGetAbsoluteTol ) +#define HYPRE_COGMRESGetCGS HYPRE_MULTIPRECISION_FUNC ( HYPRE_COGMRESGetCGS ) +#define HYPRE_COGMRESGetConverged HYPRE_MULTIPRECISION_FUNC ( HYPRE_COGMRESGetConverged ) +#define HYPRE_COGMRESGetConvergenceFactorTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_COGMRESGetConvergenceFactorTol ) +#define HYPRE_COGMRESGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_COGMRESGetFinalRelativeResidualNorm ) +#define HYPRE_COGMRESGetKDim HYPRE_MULTIPRECISION_FUNC ( HYPRE_COGMRESGetKDim ) +#define HYPRE_COGMRESGetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_COGMRESGetLogging ) +#define HYPRE_COGMRESGetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_COGMRESGetMaxIter ) +#define HYPRE_COGMRESGetMinIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_COGMRESGetMinIter ) +#define HYPRE_COGMRESGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_COGMRESGetNumIterations ) +#define HYPRE_COGMRESGetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_COGMRESGetPrecond ) +#define HYPRE_COGMRESGetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_COGMRESGetPrintLevel ) +#define HYPRE_COGMRESGetResidual HYPRE_MULTIPRECISION_FUNC ( HYPRE_COGMRESGetResidual ) +#define HYPRE_COGMRESGetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_COGMRESGetTol ) +#define HYPRE_COGMRESGetUnroll HYPRE_MULTIPRECISION_FUNC ( HYPRE_COGMRESGetUnroll ) +#define HYPRE_COGMRESSetAbsoluteTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_COGMRESSetAbsoluteTol ) +#define HYPRE_COGMRESSetCGS HYPRE_MULTIPRECISION_FUNC ( HYPRE_COGMRESSetCGS ) +#define HYPRE_COGMRESSetConvergenceFactorTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_COGMRESSetConvergenceFactorTol ) +#define HYPRE_COGMRESSetKDim HYPRE_MULTIPRECISION_FUNC ( HYPRE_COGMRESSetKDim ) +#define HYPRE_COGMRESSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_COGMRESSetLogging ) +#define HYPRE_COGMRESSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_COGMRESSetMaxIter ) +#define HYPRE_COGMRESSetMinIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_COGMRESSetMinIter ) +#define HYPRE_COGMRESSetModifyPC HYPRE_MULTIPRECISION_FUNC ( HYPRE_COGMRESSetModifyPC ) +#define HYPRE_COGMRESSetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_COGMRESSetPrecond ) +#define HYPRE_COGMRESSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_COGMRESSetPrintLevel ) +#define HYPRE_COGMRESSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_COGMRESSetTol ) +#define HYPRE_COGMRESSetUnroll HYPRE_MULTIPRECISION_FUNC ( HYPRE_COGMRESSetUnroll ) +#define HYPRE_COGMRESSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_COGMRESSetup ) +#define HYPRE_COGMRESSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_COGMRESSolve ) +#define HYPRE_FlexGMRESGetAbsoluteTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_FlexGMRESGetAbsoluteTol ) +#define HYPRE_FlexGMRESGetConverged HYPRE_MULTIPRECISION_FUNC ( HYPRE_FlexGMRESGetConverged ) +#define HYPRE_FlexGMRESGetConvergenceFactorTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_FlexGMRESGetConvergenceFactorTol ) +#define HYPRE_FlexGMRESGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_FlexGMRESGetFinalRelativeResidualNorm ) +#define HYPRE_FlexGMRESGetKDim HYPRE_MULTIPRECISION_FUNC ( HYPRE_FlexGMRESGetKDim ) +#define HYPRE_FlexGMRESGetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_FlexGMRESGetLogging ) +#define HYPRE_FlexGMRESGetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_FlexGMRESGetMaxIter ) +#define HYPRE_FlexGMRESGetMinIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_FlexGMRESGetMinIter ) +#define HYPRE_FlexGMRESGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_FlexGMRESGetNumIterations ) +#define HYPRE_FlexGMRESGetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_FlexGMRESGetPrecond ) +#define HYPRE_FlexGMRESGetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_FlexGMRESGetPrintLevel ) +#define HYPRE_FlexGMRESGetResidual HYPRE_MULTIPRECISION_FUNC ( HYPRE_FlexGMRESGetResidual ) +#define HYPRE_FlexGMRESGetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_FlexGMRESGetTol ) +#define HYPRE_FlexGMRESSetAbsoluteTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_FlexGMRESSetAbsoluteTol ) +#define HYPRE_FlexGMRESSetConvergenceFactorTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_FlexGMRESSetConvergenceFactorTol ) +#define HYPRE_FlexGMRESSetKDim HYPRE_MULTIPRECISION_FUNC ( HYPRE_FlexGMRESSetKDim ) +#define HYPRE_FlexGMRESSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_FlexGMRESSetLogging ) +#define HYPRE_FlexGMRESSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_FlexGMRESSetMaxIter ) +#define HYPRE_FlexGMRESSetMinIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_FlexGMRESSetMinIter ) +#define HYPRE_FlexGMRESSetModifyPC HYPRE_MULTIPRECISION_FUNC ( HYPRE_FlexGMRESSetModifyPC ) +#define HYPRE_FlexGMRESSetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_FlexGMRESSetPrecond ) +#define HYPRE_FlexGMRESSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_FlexGMRESSetPrintLevel ) +#define HYPRE_FlexGMRESSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_FlexGMRESSetTol ) +#define HYPRE_FlexGMRESSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_FlexGMRESSetup ) +#define HYPRE_FlexGMRESSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_FlexGMRESSolve ) +#define HYPRE_GMRESGetAbsoluteTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESGetAbsoluteTol ) +#define HYPRE_GMRESGetConverged HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESGetConverged ) +#define HYPRE_GMRESGetConvergenceFactorTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESGetConvergenceFactorTol ) +#define HYPRE_GMRESGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESGetFinalRelativeResidualNorm ) +#define HYPRE_GMRESGetKDim HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESGetKDim ) +#define HYPRE_GMRESGetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESGetLogging ) +#define HYPRE_GMRESGetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESGetMaxIter ) +#define HYPRE_GMRESGetMinIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESGetMinIter ) +#define HYPRE_GMRESGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESGetNumIterations ) +#define HYPRE_GMRESGetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESGetPrecond ) +#define HYPRE_GMRESGetPrecondMatrix HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESGetPrecondMatrix ) +#define HYPRE_GMRESGetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESGetPrintLevel ) +#define HYPRE_GMRESGetRefSolution HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESGetRefSolution ) +#define HYPRE_GMRESGetRelChange HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESGetRelChange ) +#define HYPRE_GMRESGetResidual HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESGetResidual ) +#define HYPRE_GMRESGetSkipRealResidualCheck HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESGetSkipRealResidualCheck ) +#define HYPRE_GMRESGetStopCrit HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESGetStopCrit ) +#define HYPRE_GMRESGetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESGetTol ) +#define HYPRE_GMRESSetAbsoluteTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESSetAbsoluteTol ) +#define HYPRE_GMRESSetConvergenceFactorTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESSetConvergenceFactorTol ) +#define HYPRE_GMRESSetKDim HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESSetKDim ) +#define HYPRE_GMRESSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESSetLogging ) +#define HYPRE_GMRESSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESSetMaxIter ) +#define HYPRE_GMRESSetMinIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESSetMinIter ) +#define HYPRE_GMRESSetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESSetPrecond ) +#define HYPRE_GMRESSetPrecondMatrix HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESSetPrecondMatrix ) +#define HYPRE_GMRESSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESSetPrintLevel ) +#define HYPRE_GMRESSetRefSolution HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESSetRefSolution ) +#define HYPRE_GMRESSetRelChange HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESSetRelChange ) +#define HYPRE_GMRESSetSkipRealResidualCheck HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESSetSkipRealResidualCheck ) +#define HYPRE_GMRESSetStopCrit HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESSetStopCrit ) +#define HYPRE_GMRESSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESSetTol ) +#define HYPRE_GMRESSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESSetup ) +#define HYPRE_GMRESSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_GMRESSolve ) +#define HYPRE_LGMRESGetAbsoluteTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_LGMRESGetAbsoluteTol ) +#define HYPRE_LGMRESGetAugDim HYPRE_MULTIPRECISION_FUNC ( HYPRE_LGMRESGetAugDim ) +#define HYPRE_LGMRESGetConverged HYPRE_MULTIPRECISION_FUNC ( HYPRE_LGMRESGetConverged ) +#define HYPRE_LGMRESGetConvergenceFactorTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_LGMRESGetConvergenceFactorTol ) +#define HYPRE_LGMRESGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_LGMRESGetFinalRelativeResidualNorm ) +#define HYPRE_LGMRESGetKDim HYPRE_MULTIPRECISION_FUNC ( HYPRE_LGMRESGetKDim ) +#define HYPRE_LGMRESGetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_LGMRESGetLogging ) +#define HYPRE_LGMRESGetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_LGMRESGetMaxIter ) +#define HYPRE_LGMRESGetMinIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_LGMRESGetMinIter ) +#define HYPRE_LGMRESGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_LGMRESGetNumIterations ) +#define HYPRE_LGMRESGetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_LGMRESGetPrecond ) +#define HYPRE_LGMRESGetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_LGMRESGetPrintLevel ) +#define HYPRE_LGMRESGetResidual HYPRE_MULTIPRECISION_FUNC ( HYPRE_LGMRESGetResidual ) +#define HYPRE_LGMRESGetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_LGMRESGetTol ) +#define HYPRE_LGMRESSetAbsoluteTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_LGMRESSetAbsoluteTol ) +#define HYPRE_LGMRESSetAugDim HYPRE_MULTIPRECISION_FUNC ( HYPRE_LGMRESSetAugDim ) +#define HYPRE_LGMRESSetConvergenceFactorTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_LGMRESSetConvergenceFactorTol ) +#define HYPRE_LGMRESSetKDim HYPRE_MULTIPRECISION_FUNC ( HYPRE_LGMRESSetKDim ) +#define HYPRE_LGMRESSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_LGMRESSetLogging ) +#define HYPRE_LGMRESSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_LGMRESSetMaxIter ) +#define HYPRE_LGMRESSetMinIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_LGMRESSetMinIter ) +#define HYPRE_LGMRESSetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_LGMRESSetPrecond ) +#define HYPRE_LGMRESSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_LGMRESSetPrintLevel ) +#define HYPRE_LGMRESSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_LGMRESSetTol ) +#define HYPRE_LGMRESSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_LGMRESSetup ) +#define HYPRE_LGMRESSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_LGMRESSolve ) +#define HYPRE_LOBPCGCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_LOBPCGCreate ) +#define HYPRE_LOBPCGDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_LOBPCGDestroy ) +#define HYPRE_LOBPCGEigenvaluesHistory HYPRE_MULTIPRECISION_FUNC ( HYPRE_LOBPCGEigenvaluesHistory ) +#define HYPRE_LOBPCGGetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_LOBPCGGetPrecond ) +#define HYPRE_LOBPCGIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_LOBPCGIterations ) +#define HYPRE_LOBPCGResidualNorms HYPRE_MULTIPRECISION_FUNC ( HYPRE_LOBPCGResidualNorms ) +#define HYPRE_LOBPCGResidualNormsHistory HYPRE_MULTIPRECISION_FUNC ( HYPRE_LOBPCGResidualNormsHistory ) +#define HYPRE_LOBPCGSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_LOBPCGSetMaxIter ) +#define HYPRE_LOBPCGSetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_LOBPCGSetPrecond ) +#define HYPRE_LOBPCGSetPrecondUsageMode HYPRE_MULTIPRECISION_FUNC ( HYPRE_LOBPCGSetPrecondUsageMode ) +#define HYPRE_LOBPCGSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_LOBPCGSetPrintLevel ) +#define HYPRE_LOBPCGSetRTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_LOBPCGSetRTol ) +#define HYPRE_LOBPCGSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_LOBPCGSetTol ) +#define HYPRE_LOBPCGSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_LOBPCGSetup ) +#define HYPRE_LOBPCGSetupB HYPRE_MULTIPRECISION_FUNC ( HYPRE_LOBPCGSetupB ) +#define HYPRE_LOBPCGSetupT HYPRE_MULTIPRECISION_FUNC ( HYPRE_LOBPCGSetupT ) +#define HYPRE_LOBPCGSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_LOBPCGSolve ) +#define HYPRE_PCGGetAbsoluteTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGGetAbsoluteTol ) +#define HYPRE_PCGGetAbsoluteTolFactor HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGGetAbsoluteTolFactor ) +#define HYPRE_PCGGetConverged HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGGetConverged ) +#define HYPRE_PCGGetConvergenceFactorTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGGetConvergenceFactorTol ) +#define HYPRE_PCGGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGGetFinalRelativeResidualNorm ) +#define HYPRE_PCGGetFlex HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGGetFlex ) +#define HYPRE_PCGGetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGGetLogging ) +#define HYPRE_PCGGetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGGetMaxIter ) +#define HYPRE_PCGGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGGetNumIterations ) +#define HYPRE_PCGGetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGGetPrecond ) +#define HYPRE_PCGGetPrecondMatrix HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGGetPrecondMatrix ) +#define HYPRE_PCGGetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGGetPrintLevel ) +#define HYPRE_PCGGetRecomputeResidual HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGGetRecomputeResidual ) +#define HYPRE_PCGGetRecomputeResidualP HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGGetRecomputeResidualP ) +#define HYPRE_PCGGetRelChange HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGGetRelChange ) +#define HYPRE_PCGGetResidual HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGGetResidual ) +#define HYPRE_PCGGetResidualTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGGetResidualTol ) +#define HYPRE_PCGGetSkipBreak HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGGetSkipBreak ) +#define HYPRE_PCGGetStopCrit HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGGetStopCrit ) +#define HYPRE_PCGGetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGGetTol ) +#define HYPRE_PCGGetTwoNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGGetTwoNorm ) +#define HYPRE_PCGSetAbsoluteTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGSetAbsoluteTol ) +#define HYPRE_PCGSetAbsoluteTolFactor HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGSetAbsoluteTolFactor ) +#define HYPRE_PCGSetConvergenceFactorTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGSetConvergenceFactorTol ) +#define HYPRE_PCGSetFlex HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGSetFlex ) +#define HYPRE_PCGSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGSetLogging ) +#define HYPRE_PCGSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGSetMaxIter ) +#define HYPRE_PCGSetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGSetPrecond ) +#define HYPRE_PCGSetPrecondMatrix HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGSetPrecondMatrix ) +#define HYPRE_PCGSetPreconditioner HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGSetPreconditioner ) +#define HYPRE_PCGSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGSetPrintLevel ) +#define HYPRE_PCGSetRecomputeResidual HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGSetRecomputeResidual ) +#define HYPRE_PCGSetRecomputeResidualP HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGSetRecomputeResidualP ) +#define HYPRE_PCGSetRelChange HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGSetRelChange ) +#define HYPRE_PCGSetResidualTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGSetResidualTol ) +#define HYPRE_PCGSetSkipBreak HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGSetSkipBreak ) +#define HYPRE_PCGSetStopCrit HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGSetStopCrit ) +#define HYPRE_PCGSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGSetTol ) +#define HYPRE_PCGSetTwoNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGSetTwoNorm ) +#define HYPRE_PCGSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGSetup ) +#define HYPRE_PCGSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_PCGSolve ) +#define hypre_BiCGSTABCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_BiCGSTABCreate ) +#define hypre_BiCGSTABDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_BiCGSTABDestroy ) +#define hypre_BiCGSTABFunctionsCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_BiCGSTABFunctionsCreate ) +#define hypre_BiCGSTABGetConverged HYPRE_FIXEDPRECISION_FUNC ( hypre_BiCGSTABGetConverged ) +#define hypre_BiCGSTABGetFinalRelativeResidualNorm HYPRE_FIXEDPRECISION_FUNC ( hypre_BiCGSTABGetFinalRelativeResidualNorm ) +#define hypre_BiCGSTABGetNumIterations HYPRE_FIXEDPRECISION_FUNC ( hypre_BiCGSTABGetNumIterations ) +#define hypre_BiCGSTABGetPrecond HYPRE_FIXEDPRECISION_FUNC ( hypre_BiCGSTABGetPrecond ) +#define hypre_BiCGSTABGetPrecondMatrix HYPRE_FIXEDPRECISION_FUNC ( hypre_BiCGSTABGetPrecondMatrix ) +#define hypre_BiCGSTABGetResidual HYPRE_FIXEDPRECISION_FUNC ( hypre_BiCGSTABGetResidual ) +#define hypre_BiCGSTABSetAbsoluteTol HYPRE_FIXEDPRECISION_FUNC ( hypre_BiCGSTABSetAbsoluteTol ) +#define hypre_BiCGSTABSetConvergenceFactorTol HYPRE_FIXEDPRECISION_FUNC ( hypre_BiCGSTABSetConvergenceFactorTol ) +#define hypre_BiCGSTABSetHybrid HYPRE_FIXEDPRECISION_FUNC ( hypre_BiCGSTABSetHybrid ) +#define hypre_BiCGSTABSetLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_BiCGSTABSetLogging ) +#define hypre_BiCGSTABSetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_BiCGSTABSetMaxIter ) +#define hypre_BiCGSTABSetMinIter HYPRE_FIXEDPRECISION_FUNC ( hypre_BiCGSTABSetMinIter ) +#define hypre_BiCGSTABSetPrecond HYPRE_FIXEDPRECISION_FUNC ( hypre_BiCGSTABSetPrecond ) +#define hypre_BiCGSTABSetPrecondMatrix HYPRE_FIXEDPRECISION_FUNC ( hypre_BiCGSTABSetPrecondMatrix ) +#define hypre_BiCGSTABSetPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_BiCGSTABSetPrintLevel ) +#define hypre_BiCGSTABSetStopCrit HYPRE_FIXEDPRECISION_FUNC ( hypre_BiCGSTABSetStopCrit ) +#define hypre_BiCGSTABSetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_BiCGSTABSetTol ) +#define hypre_BiCGSTABSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_BiCGSTABSetup ) +#define hypre_BiCGSTABSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_BiCGSTABSolve ) +#define hypre_CGNRCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_CGNRCreate ) +#define hypre_CGNRDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_CGNRDestroy ) +#define hypre_CGNRFunctionsCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_CGNRFunctionsCreate ) +#define hypre_CGNRGetFinalRelativeResidualNorm HYPRE_FIXEDPRECISION_FUNC ( hypre_CGNRGetFinalRelativeResidualNorm ) +#define hypre_CGNRGetNumIterations HYPRE_FIXEDPRECISION_FUNC ( hypre_CGNRGetNumIterations ) +#define hypre_CGNRGetPrecond HYPRE_FIXEDPRECISION_FUNC ( hypre_CGNRGetPrecond ) +#define hypre_CGNRSetLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_CGNRSetLogging ) +#define hypre_CGNRSetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_CGNRSetMaxIter ) +#define hypre_CGNRSetMinIter HYPRE_FIXEDPRECISION_FUNC ( hypre_CGNRSetMinIter ) +#define hypre_CGNRSetPrecond HYPRE_FIXEDPRECISION_FUNC ( hypre_CGNRSetPrecond ) +#define hypre_CGNRSetStopCrit HYPRE_FIXEDPRECISION_FUNC ( hypre_CGNRSetStopCrit ) +#define hypre_CGNRSetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_CGNRSetTol ) +#define hypre_CGNRSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_CGNRSetup ) +#define hypre_CGNRSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_CGNRSolve ) +#define hypre_COGMRESCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESCreate ) +#define hypre_COGMRESDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESDestroy ) +#define hypre_COGMRESFunctionsCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESFunctionsCreate ) +#define hypre_COGMRESGetAbsoluteTol HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESGetAbsoluteTol ) +#define hypre_COGMRESGetCGS HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESGetCGS ) +#define hypre_COGMRESGetConverged HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESGetConverged ) +#define hypre_COGMRESGetConvergenceFactorTol HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESGetConvergenceFactorTol ) +#define hypre_COGMRESGetFinalRelativeResidualNorm HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESGetFinalRelativeResidualNorm ) +#define hypre_COGMRESGetKDim HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESGetKDim ) +#define hypre_COGMRESGetLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESGetLogging ) +#define hypre_COGMRESGetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESGetMaxIter ) +#define hypre_COGMRESGetMinIter HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESGetMinIter ) +#define hypre_COGMRESGetNumIterations HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESGetNumIterations ) +#define hypre_COGMRESGetPrecond HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESGetPrecond ) +#define hypre_COGMRESGetPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESGetPrintLevel ) +#define hypre_COGMRESGetRelChange HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESGetRelChange ) +#define hypre_COGMRESGetResidual HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESGetResidual ) +#define hypre_COGMRESGetSkipRealResidualCheck HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESGetSkipRealResidualCheck ) +#define hypre_COGMRESGetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESGetTol ) +#define hypre_COGMRESGetUnroll HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESGetUnroll ) +#define hypre_COGMRESSetAbsoluteTol HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESSetAbsoluteTol ) +#define hypre_COGMRESSetCGS HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESSetCGS ) +#define hypre_COGMRESSetConvergenceFactorTol HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESSetConvergenceFactorTol ) +#define hypre_COGMRESSetKDim HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESSetKDim ) +#define hypre_COGMRESSetLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESSetLogging ) +#define hypre_COGMRESSetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESSetMaxIter ) +#define hypre_COGMRESSetMinIter HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESSetMinIter ) +#define hypre_COGMRESSetModifyPC HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESSetModifyPC ) +#define hypre_COGMRESSetPrecond HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESSetPrecond ) +#define hypre_COGMRESSetPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESSetPrintLevel ) +#define hypre_COGMRESSetRelChange HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESSetRelChange ) +#define hypre_COGMRESSetSkipRealResidualCheck HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESSetSkipRealResidualCheck ) +#define hypre_COGMRESSetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESSetTol ) +#define hypre_COGMRESSetUnroll HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESSetUnroll ) +#define hypre_COGMRESSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESSetup ) +#define hypre_COGMRESSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_COGMRESSolve ) +#define hypre_FlexGMRESCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_FlexGMRESCreate ) +#define hypre_FlexGMRESDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_FlexGMRESDestroy ) +#define hypre_FlexGMRESFunctionsCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_FlexGMRESFunctionsCreate ) +#define hypre_FlexGMRESGetAbsoluteTol HYPRE_FIXEDPRECISION_FUNC ( hypre_FlexGMRESGetAbsoluteTol ) +#define hypre_FlexGMRESGetConverged HYPRE_FIXEDPRECISION_FUNC ( hypre_FlexGMRESGetConverged ) +#define hypre_FlexGMRESGetConvergenceFactorTol HYPRE_FIXEDPRECISION_FUNC ( hypre_FlexGMRESGetConvergenceFactorTol ) +#define hypre_FlexGMRESGetFinalRelativeResidualNorm HYPRE_FIXEDPRECISION_FUNC ( hypre_FlexGMRESGetFinalRelativeResidualNorm ) +#define hypre_FlexGMRESGetKDim HYPRE_FIXEDPRECISION_FUNC ( hypre_FlexGMRESGetKDim ) +#define hypre_FlexGMRESGetLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_FlexGMRESGetLogging ) +#define hypre_FlexGMRESGetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_FlexGMRESGetMaxIter ) +#define hypre_FlexGMRESGetMinIter HYPRE_FIXEDPRECISION_FUNC ( hypre_FlexGMRESGetMinIter ) +#define hypre_FlexGMRESGetNumIterations HYPRE_FIXEDPRECISION_FUNC ( hypre_FlexGMRESGetNumIterations ) +#define hypre_FlexGMRESGetPrecond HYPRE_FIXEDPRECISION_FUNC ( hypre_FlexGMRESGetPrecond ) +#define hypre_FlexGMRESGetPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_FlexGMRESGetPrintLevel ) +#define hypre_FlexGMRESGetResidual HYPRE_FIXEDPRECISION_FUNC ( hypre_FlexGMRESGetResidual ) +#define hypre_FlexGMRESGetStopCrit HYPRE_FIXEDPRECISION_FUNC ( hypre_FlexGMRESGetStopCrit ) +#define hypre_FlexGMRESGetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_FlexGMRESGetTol ) +#define hypre_FlexGMRESModifyPCDefault HYPRE_FIXEDPRECISION_FUNC ( hypre_FlexGMRESModifyPCDefault ) +#define hypre_FlexGMRESSetAbsoluteTol HYPRE_FIXEDPRECISION_FUNC ( hypre_FlexGMRESSetAbsoluteTol ) +#define hypre_FlexGMRESSetConvergenceFactorTol HYPRE_FIXEDPRECISION_FUNC ( hypre_FlexGMRESSetConvergenceFactorTol ) +#define hypre_FlexGMRESSetKDim HYPRE_FIXEDPRECISION_FUNC ( hypre_FlexGMRESSetKDim ) +#define hypre_FlexGMRESSetLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_FlexGMRESSetLogging ) +#define hypre_FlexGMRESSetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_FlexGMRESSetMaxIter ) +#define hypre_FlexGMRESSetMinIter HYPRE_FIXEDPRECISION_FUNC ( hypre_FlexGMRESSetMinIter ) +#define hypre_FlexGMRESSetModifyPC HYPRE_FIXEDPRECISION_FUNC ( hypre_FlexGMRESSetModifyPC ) +#define hypre_FlexGMRESSetPrecond HYPRE_FIXEDPRECISION_FUNC ( hypre_FlexGMRESSetPrecond ) +#define hypre_FlexGMRESSetPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_FlexGMRESSetPrintLevel ) +#define hypre_FlexGMRESSetStopCrit HYPRE_FIXEDPRECISION_FUNC ( hypre_FlexGMRESSetStopCrit ) +#define hypre_FlexGMRESSetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_FlexGMRESSetTol ) +#define hypre_FlexGMRESSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_FlexGMRESSetup ) +#define hypre_FlexGMRESSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_FlexGMRESSolve ) +#define hypre_GMRESCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESCreate ) +#define hypre_GMRESDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESDestroy ) +#define hypre_GMRESFunctionsCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESFunctionsCreate ) +#define hypre_GMRESGetAbsoluteTol HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESGetAbsoluteTol ) +#define hypre_GMRESGetConverged HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESGetConverged ) +#define hypre_GMRESGetConvergenceFactorTol HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESGetConvergenceFactorTol ) +#define hypre_GMRESGetFinalRelativeResidualNorm HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESGetFinalRelativeResidualNorm ) +#define hypre_GMRESGetKDim HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESGetKDim ) +#define hypre_GMRESGetLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESGetLogging ) +#define hypre_GMRESGetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESGetMaxIter ) +#define hypre_GMRESGetMinIter HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESGetMinIter ) +#define hypre_GMRESGetNumIterations HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESGetNumIterations ) +#define hypre_GMRESGetPrecond HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESGetPrecond ) +#define hypre_GMRESGetPrecondMatrix HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESGetPrecondMatrix ) +#define hypre_GMRESGetPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESGetPrintLevel ) +#define hypre_GMRESGetRefSolution HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESGetRefSolution ) +#define hypre_GMRESGetRelChange HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESGetRelChange ) +#define hypre_GMRESGetResidual HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESGetResidual ) +#define hypre_GMRESGetSkipRealResidualCheck HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESGetSkipRealResidualCheck ) +#define hypre_GMRESGetStopCrit HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESGetStopCrit ) +#define hypre_GMRESGetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESGetTol ) +#define hypre_GMRESSetAbsoluteTol HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESSetAbsoluteTol ) +#define hypre_GMRESSetConvergenceFactorTol HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESSetConvergenceFactorTol ) +#define hypre_GMRESSetHybrid HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESSetHybrid ) +#define hypre_GMRESSetKDim HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESSetKDim ) +#define hypre_GMRESSetLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESSetLogging ) +#define hypre_GMRESSetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESSetMaxIter ) +#define hypre_GMRESSetMinIter HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESSetMinIter ) +#define hypre_GMRESSetPrecond HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESSetPrecond ) +#define hypre_GMRESSetPrecondMatrix HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESSetPrecondMatrix ) +#define hypre_GMRESSetPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESSetPrintLevel ) +#define hypre_GMRESSetRefSolution HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESSetRefSolution ) +#define hypre_GMRESSetRelChange HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESSetRelChange ) +#define hypre_GMRESSetSkipRealResidualCheck HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESSetSkipRealResidualCheck ) +#define hypre_GMRESSetStopCrit HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESSetStopCrit ) +#define hypre_GMRESSetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESSetTol ) +#define hypre_GMRESSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESSetup ) +#define hypre_GMRESSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_GMRESSolve ) +#define hypre_LGMRESCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_LGMRESCreate ) +#define hypre_LGMRESDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_LGMRESDestroy ) +#define hypre_LGMRESFunctionsCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_LGMRESFunctionsCreate ) +#define hypre_LGMRESGetAbsoluteTol HYPRE_FIXEDPRECISION_FUNC ( hypre_LGMRESGetAbsoluteTol ) +#define hypre_LGMRESGetAugDim HYPRE_FIXEDPRECISION_FUNC ( hypre_LGMRESGetAugDim ) +#define hypre_LGMRESGetConverged HYPRE_FIXEDPRECISION_FUNC ( hypre_LGMRESGetConverged ) +#define hypre_LGMRESGetConvergenceFactorTol HYPRE_FIXEDPRECISION_FUNC ( hypre_LGMRESGetConvergenceFactorTol ) +#define hypre_LGMRESGetFinalRelativeResidualNorm HYPRE_FIXEDPRECISION_FUNC ( hypre_LGMRESGetFinalRelativeResidualNorm ) +#define hypre_LGMRESGetKDim HYPRE_FIXEDPRECISION_FUNC ( hypre_LGMRESGetKDim ) +#define hypre_LGMRESGetLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_LGMRESGetLogging ) +#define hypre_LGMRESGetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_LGMRESGetMaxIter ) +#define hypre_LGMRESGetMinIter HYPRE_FIXEDPRECISION_FUNC ( hypre_LGMRESGetMinIter ) +#define hypre_LGMRESGetNumIterations HYPRE_FIXEDPRECISION_FUNC ( hypre_LGMRESGetNumIterations ) +#define hypre_LGMRESGetPrecond HYPRE_FIXEDPRECISION_FUNC ( hypre_LGMRESGetPrecond ) +#define hypre_LGMRESGetPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_LGMRESGetPrintLevel ) +#define hypre_LGMRESGetResidual HYPRE_FIXEDPRECISION_FUNC ( hypre_LGMRESGetResidual ) +#define hypre_LGMRESGetStopCrit HYPRE_FIXEDPRECISION_FUNC ( hypre_LGMRESGetStopCrit ) +#define hypre_LGMRESGetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_LGMRESGetTol ) +#define hypre_LGMRESSetAbsoluteTol HYPRE_FIXEDPRECISION_FUNC ( hypre_LGMRESSetAbsoluteTol ) +#define hypre_LGMRESSetAugDim HYPRE_FIXEDPRECISION_FUNC ( hypre_LGMRESSetAugDim ) +#define hypre_LGMRESSetConvergenceFactorTol HYPRE_FIXEDPRECISION_FUNC ( hypre_LGMRESSetConvergenceFactorTol ) +#define hypre_LGMRESSetKDim HYPRE_FIXEDPRECISION_FUNC ( hypre_LGMRESSetKDim ) +#define hypre_LGMRESSetLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_LGMRESSetLogging ) +#define hypre_LGMRESSetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_LGMRESSetMaxIter ) +#define hypre_LGMRESSetMinIter HYPRE_FIXEDPRECISION_FUNC ( hypre_LGMRESSetMinIter ) +#define hypre_LGMRESSetPrecond HYPRE_FIXEDPRECISION_FUNC ( hypre_LGMRESSetPrecond ) +#define hypre_LGMRESSetPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_LGMRESSetPrintLevel ) +#define hypre_LGMRESSetStopCrit HYPRE_FIXEDPRECISION_FUNC ( hypre_LGMRESSetStopCrit ) +#define hypre_LGMRESSetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_LGMRESSetTol ) +#define hypre_LGMRESSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_LGMRESSetup ) +#define hypre_LGMRESSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_LGMRESSolve ) +#define hypre_LOBPCGDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_LOBPCGDestroy ) +#define hypre_LOBPCGEigenvaluesHistory HYPRE_FIXEDPRECISION_FUNC ( hypre_LOBPCGEigenvaluesHistory ) +#define hypre_LOBPCGGetPrecond HYPRE_FIXEDPRECISION_FUNC ( hypre_LOBPCGGetPrecond ) +#define hypre_LOBPCGIterations HYPRE_FIXEDPRECISION_FUNC ( hypre_LOBPCGIterations ) +#define hypre_LOBPCGMultiOperatorA HYPRE_FIXEDPRECISION_FUNC ( hypre_LOBPCGMultiOperatorA ) +#define hypre_LOBPCGMultiOperatorB HYPRE_FIXEDPRECISION_FUNC ( hypre_LOBPCGMultiOperatorB ) +#define hypre_LOBPCGMultiPreconditioner HYPRE_FIXEDPRECISION_FUNC ( hypre_LOBPCGMultiPreconditioner ) +#define hypre_LOBPCGOperatorA HYPRE_FIXEDPRECISION_FUNC ( hypre_LOBPCGOperatorA ) +#define hypre_LOBPCGOperatorB HYPRE_FIXEDPRECISION_FUNC ( hypre_LOBPCGOperatorB ) +#define hypre_LOBPCGPreconditioner HYPRE_FIXEDPRECISION_FUNC ( hypre_LOBPCGPreconditioner ) +#define hypre_LOBPCGResidualNorms HYPRE_FIXEDPRECISION_FUNC ( hypre_LOBPCGResidualNorms ) +#define hypre_LOBPCGResidualNormsHistory HYPRE_FIXEDPRECISION_FUNC ( hypre_LOBPCGResidualNormsHistory ) +#define hypre_LOBPCGSetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_LOBPCGSetMaxIter ) +#define hypre_LOBPCGSetPrecond HYPRE_FIXEDPRECISION_FUNC ( hypre_LOBPCGSetPrecond ) +#define hypre_LOBPCGSetPrecondUsageMode HYPRE_FIXEDPRECISION_FUNC ( hypre_LOBPCGSetPrecondUsageMode ) +#define hypre_LOBPCGSetPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_LOBPCGSetPrintLevel ) +#define hypre_LOBPCGSetRTol HYPRE_FIXEDPRECISION_FUNC ( hypre_LOBPCGSetRTol ) +#define hypre_LOBPCGSetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_LOBPCGSetTol ) +#define hypre_LOBPCGSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_LOBPCGSetup ) +#define hypre_LOBPCGSetupB HYPRE_FIXEDPRECISION_FUNC ( hypre_LOBPCGSetupB ) +#define hypre_LOBPCGSetupT HYPRE_FIXEDPRECISION_FUNC ( hypre_LOBPCGSetupT ) +#define hypre_LOBPCGSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_LOBPCGSolve ) +#define hypre_PCGCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGCreate ) +#define hypre_PCGDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGDestroy ) +#define hypre_PCGFunctionsCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGFunctionsCreate ) +#define hypre_PCGGetAbsoluteTol HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGGetAbsoluteTol ) +#define hypre_PCGGetAbsoluteTolFactor HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGGetAbsoluteTolFactor ) +#define hypre_PCGGetConverged HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGGetConverged ) +#define hypre_PCGGetConvergenceFactorTol HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGGetConvergenceFactorTol ) +#define hypre_PCGGetFinalRelativeResidualNorm HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGGetFinalRelativeResidualNorm ) +#define hypre_PCGGetFlex HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGGetFlex ) +#define hypre_PCGGetLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGGetLogging ) +#define hypre_PCGGetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGGetMaxIter ) +#define hypre_PCGGetNumIterations HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGGetNumIterations ) +#define hypre_PCGGetPrecond HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGGetPrecond ) +#define hypre_PCGGetPrecondMatrix HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGGetPrecondMatrix ) +#define hypre_PCGGetPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGGetPrintLevel ) +#define hypre_PCGGetRecomputeResidual HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGGetRecomputeResidual ) +#define hypre_PCGGetRecomputeResidualP HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGGetRecomputeResidualP ) +#define hypre_PCGGetRelChange HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGGetRelChange ) +#define hypre_PCGGetResidual HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGGetResidual ) +#define hypre_PCGGetResidualTol HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGGetResidualTol ) +#define hypre_PCGGetSkipBreak HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGGetSkipBreak ) +#define hypre_PCGGetStopCrit HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGGetStopCrit ) +#define hypre_PCGGetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGGetTol ) +#define hypre_PCGGetTwoNorm HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGGetTwoNorm ) +#define hypre_PCGPrintLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGPrintLogging ) +#define hypre_PCGSetAbsoluteTol HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGSetAbsoluteTol ) +#define hypre_PCGSetAbsoluteTolFactor HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGSetAbsoluteTolFactor ) +#define hypre_PCGSetConvergenceFactorTol HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGSetConvergenceFactorTol ) +#define hypre_PCGSetFlex HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGSetFlex ) +#define hypre_PCGSetHybrid HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGSetHybrid ) +#define hypre_PCGSetLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGSetLogging ) +#define hypre_PCGSetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGSetMaxIter ) +#define hypre_PCGSetPrecond HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGSetPrecond ) +#define hypre_PCGSetPrecondMatrix HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGSetPrecondMatrix ) +#define hypre_PCGSetPreconditioner HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGSetPreconditioner ) +#define hypre_PCGSetPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGSetPrintLevel ) +#define hypre_PCGSetRecomputeResidual HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGSetRecomputeResidual ) +#define hypre_PCGSetRecomputeResidualP HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGSetRecomputeResidualP ) +#define hypre_PCGSetRelChange HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGSetRelChange ) +#define hypre_PCGSetResidualTol HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGSetResidualTol ) +#define hypre_PCGSetSkipBreak HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGSetSkipBreak ) +#define hypre_PCGSetStopCrit HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGSetStopCrit ) +#define hypre_PCGSetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGSetTol ) +#define hypre_PCGSetTwoNorm HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGSetTwoNorm ) +#define hypre_PCGSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGSetup ) +#define hypre_PCGSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_PCGSolve ) +#define lobpcg_MultiVectorByMultiVector HYPRE_FIXEDPRECISION_FUNC ( lobpcg_MultiVectorByMultiVector ) +#define lobpcg_clean HYPRE_FIXEDPRECISION_FUNC ( lobpcg_clean ) +#define lobpcg_initialize HYPRE_FIXEDPRECISION_FUNC ( lobpcg_initialize ) +#define lobpcg_solve HYPRE_FIXEDPRECISION_FUNC ( lobpcg_solve ) + +#endif diff --git a/src/krylov/_hypre_krylov_mup_undef.h b/src/krylov/_hypre_krylov_mup_undef.h new file mode 100644 index 0000000000..02973a02a3 --- /dev/null +++ b/src/krylov/_hypre_krylov_mup_undef.h @@ -0,0 +1,460 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#undef hypre_KRYLOV_MUP_DEF_HEADER + +#undef HYPRE_BiCGSTABDestroy +#undef HYPRE_BiCGSTABGetFinalRelativeResidualNorm +#undef HYPRE_BiCGSTABGetNumIterations +#undef HYPRE_BiCGSTABGetPrecond +#undef HYPRE_BiCGSTABGetPrecondMatrix +#undef HYPRE_BiCGSTABGetResidual +#undef HYPRE_BiCGSTABSetAbsoluteTol +#undef HYPRE_BiCGSTABSetConvergenceFactorTol +#undef HYPRE_BiCGSTABSetLogging +#undef HYPRE_BiCGSTABSetMaxIter +#undef HYPRE_BiCGSTABSetMinIter +#undef HYPRE_BiCGSTABSetPrecond +#undef HYPRE_BiCGSTABSetPrecondMatrix +#undef HYPRE_BiCGSTABSetPrintLevel +#undef HYPRE_BiCGSTABSetStopCrit +#undef HYPRE_BiCGSTABSetTol +#undef HYPRE_BiCGSTABSetup +#undef HYPRE_BiCGSTABSolve +#undef HYPRE_CGNRDestroy +#undef HYPRE_CGNRGetFinalRelativeResidualNorm +#undef HYPRE_CGNRGetNumIterations +#undef HYPRE_CGNRGetPrecond +#undef HYPRE_CGNRSetLogging +#undef HYPRE_CGNRSetMaxIter +#undef HYPRE_CGNRSetMinIter +#undef HYPRE_CGNRSetPrecond +#undef HYPRE_CGNRSetStopCrit +#undef HYPRE_CGNRSetTol +#undef HYPRE_CGNRSetup +#undef HYPRE_CGNRSolve +#undef HYPRE_COGMRESGetAbsoluteTol +#undef HYPRE_COGMRESGetCGS +#undef HYPRE_COGMRESGetConverged +#undef HYPRE_COGMRESGetConvergenceFactorTol +#undef HYPRE_COGMRESGetFinalRelativeResidualNorm +#undef HYPRE_COGMRESGetKDim +#undef HYPRE_COGMRESGetLogging +#undef HYPRE_COGMRESGetMaxIter +#undef HYPRE_COGMRESGetMinIter +#undef HYPRE_COGMRESGetNumIterations +#undef HYPRE_COGMRESGetPrecond +#undef HYPRE_COGMRESGetPrintLevel +#undef HYPRE_COGMRESGetResidual +#undef HYPRE_COGMRESGetTol +#undef HYPRE_COGMRESGetUnroll +#undef HYPRE_COGMRESSetAbsoluteTol +#undef HYPRE_COGMRESSetCGS +#undef HYPRE_COGMRESSetConvergenceFactorTol +#undef HYPRE_COGMRESSetKDim +#undef HYPRE_COGMRESSetLogging +#undef HYPRE_COGMRESSetMaxIter +#undef HYPRE_COGMRESSetMinIter +#undef HYPRE_COGMRESSetModifyPC +#undef HYPRE_COGMRESSetPrecond +#undef HYPRE_COGMRESSetPrintLevel +#undef HYPRE_COGMRESSetTol +#undef HYPRE_COGMRESSetUnroll +#undef HYPRE_COGMRESSetup +#undef HYPRE_COGMRESSolve +#undef HYPRE_FlexGMRESGetAbsoluteTol +#undef HYPRE_FlexGMRESGetConverged +#undef HYPRE_FlexGMRESGetConvergenceFactorTol +#undef HYPRE_FlexGMRESGetFinalRelativeResidualNorm +#undef HYPRE_FlexGMRESGetKDim +#undef HYPRE_FlexGMRESGetLogging +#undef HYPRE_FlexGMRESGetMaxIter +#undef HYPRE_FlexGMRESGetMinIter +#undef HYPRE_FlexGMRESGetNumIterations +#undef HYPRE_FlexGMRESGetPrecond +#undef HYPRE_FlexGMRESGetPrintLevel +#undef HYPRE_FlexGMRESGetResidual +#undef HYPRE_FlexGMRESGetTol +#undef HYPRE_FlexGMRESSetAbsoluteTol +#undef HYPRE_FlexGMRESSetConvergenceFactorTol +#undef HYPRE_FlexGMRESSetKDim +#undef HYPRE_FlexGMRESSetLogging +#undef HYPRE_FlexGMRESSetMaxIter +#undef HYPRE_FlexGMRESSetMinIter +#undef HYPRE_FlexGMRESSetModifyPC +#undef HYPRE_FlexGMRESSetPrecond +#undef HYPRE_FlexGMRESSetPrintLevel +#undef HYPRE_FlexGMRESSetTol +#undef HYPRE_FlexGMRESSetup +#undef HYPRE_FlexGMRESSolve +#undef HYPRE_GMRESGetAbsoluteTol +#undef HYPRE_GMRESGetConverged +#undef HYPRE_GMRESGetConvergenceFactorTol +#undef HYPRE_GMRESGetFinalRelativeResidualNorm +#undef HYPRE_GMRESGetKDim +#undef HYPRE_GMRESGetLogging +#undef HYPRE_GMRESGetMaxIter +#undef HYPRE_GMRESGetMinIter +#undef HYPRE_GMRESGetNumIterations +#undef HYPRE_GMRESGetPrecond +#undef HYPRE_GMRESGetPrecondMatrix +#undef HYPRE_GMRESGetPrintLevel +#undef HYPRE_GMRESGetRefSolution +#undef HYPRE_GMRESGetRelChange +#undef HYPRE_GMRESGetResidual +#undef HYPRE_GMRESGetSkipRealResidualCheck +#undef HYPRE_GMRESGetStopCrit +#undef HYPRE_GMRESGetTol +#undef HYPRE_GMRESSetAbsoluteTol +#undef HYPRE_GMRESSetConvergenceFactorTol +#undef HYPRE_GMRESSetKDim +#undef HYPRE_GMRESSetLogging +#undef HYPRE_GMRESSetMaxIter +#undef HYPRE_GMRESSetMinIter +#undef HYPRE_GMRESSetPrecond +#undef HYPRE_GMRESSetPrecondMatrix +#undef HYPRE_GMRESSetPrintLevel +#undef HYPRE_GMRESSetRefSolution +#undef HYPRE_GMRESSetRelChange +#undef HYPRE_GMRESSetSkipRealResidualCheck +#undef HYPRE_GMRESSetStopCrit +#undef HYPRE_GMRESSetTol +#undef HYPRE_GMRESSetup +#undef HYPRE_GMRESSolve +#undef HYPRE_LGMRESGetAbsoluteTol +#undef HYPRE_LGMRESGetAugDim +#undef HYPRE_LGMRESGetConverged +#undef HYPRE_LGMRESGetConvergenceFactorTol +#undef HYPRE_LGMRESGetFinalRelativeResidualNorm +#undef HYPRE_LGMRESGetKDim +#undef HYPRE_LGMRESGetLogging +#undef HYPRE_LGMRESGetMaxIter +#undef HYPRE_LGMRESGetMinIter +#undef HYPRE_LGMRESGetNumIterations +#undef HYPRE_LGMRESGetPrecond +#undef HYPRE_LGMRESGetPrintLevel +#undef HYPRE_LGMRESGetResidual +#undef HYPRE_LGMRESGetTol +#undef HYPRE_LGMRESSetAbsoluteTol +#undef HYPRE_LGMRESSetAugDim +#undef HYPRE_LGMRESSetConvergenceFactorTol +#undef HYPRE_LGMRESSetKDim +#undef HYPRE_LGMRESSetLogging +#undef HYPRE_LGMRESSetMaxIter +#undef HYPRE_LGMRESSetMinIter +#undef HYPRE_LGMRESSetPrecond +#undef HYPRE_LGMRESSetPrintLevel +#undef HYPRE_LGMRESSetTol +#undef HYPRE_LGMRESSetup +#undef HYPRE_LGMRESSolve +#undef HYPRE_LOBPCGCreate +#undef HYPRE_LOBPCGDestroy +#undef HYPRE_LOBPCGEigenvaluesHistory +#undef HYPRE_LOBPCGGetPrecond +#undef HYPRE_LOBPCGIterations +#undef HYPRE_LOBPCGResidualNorms +#undef HYPRE_LOBPCGResidualNormsHistory +#undef HYPRE_LOBPCGSetMaxIter +#undef HYPRE_LOBPCGSetPrecond +#undef HYPRE_LOBPCGSetPrecondUsageMode +#undef HYPRE_LOBPCGSetPrintLevel +#undef HYPRE_LOBPCGSetRTol +#undef HYPRE_LOBPCGSetTol +#undef HYPRE_LOBPCGSetup +#undef HYPRE_LOBPCGSetupB +#undef HYPRE_LOBPCGSetupT +#undef HYPRE_LOBPCGSolve +#undef HYPRE_PCGGetAbsoluteTol +#undef HYPRE_PCGGetAbsoluteTolFactor +#undef HYPRE_PCGGetConverged +#undef HYPRE_PCGGetConvergenceFactorTol +#undef HYPRE_PCGGetFinalRelativeResidualNorm +#undef HYPRE_PCGGetFlex +#undef HYPRE_PCGGetLogging +#undef HYPRE_PCGGetMaxIter +#undef HYPRE_PCGGetNumIterations +#undef HYPRE_PCGGetPrecond +#undef HYPRE_PCGGetPrecondMatrix +#undef HYPRE_PCGGetPrintLevel +#undef HYPRE_PCGGetRecomputeResidual +#undef HYPRE_PCGGetRecomputeResidualP +#undef HYPRE_PCGGetRelChange +#undef HYPRE_PCGGetResidual +#undef HYPRE_PCGGetResidualTol +#undef HYPRE_PCGGetSkipBreak +#undef HYPRE_PCGGetStopCrit +#undef HYPRE_PCGGetTol +#undef HYPRE_PCGGetTwoNorm +#undef HYPRE_PCGSetAbsoluteTol +#undef HYPRE_PCGSetAbsoluteTolFactor +#undef HYPRE_PCGSetConvergenceFactorTol +#undef HYPRE_PCGSetFlex +#undef HYPRE_PCGSetLogging +#undef HYPRE_PCGSetMaxIter +#undef HYPRE_PCGSetPrecond +#undef HYPRE_PCGSetPrecondMatrix +#undef HYPRE_PCGSetPreconditioner +#undef HYPRE_PCGSetPrintLevel +#undef HYPRE_PCGSetRecomputeResidual +#undef HYPRE_PCGSetRecomputeResidualP +#undef HYPRE_PCGSetRelChange +#undef HYPRE_PCGSetResidualTol +#undef HYPRE_PCGSetSkipBreak +#undef HYPRE_PCGSetStopCrit +#undef HYPRE_PCGSetTol +#undef HYPRE_PCGSetTwoNorm +#undef HYPRE_PCGSetup +#undef HYPRE_PCGSolve +#undef hypre_BiCGSTABCreate +#undef hypre_BiCGSTABDestroy +#undef hypre_BiCGSTABFunctionsCreate +#undef hypre_BiCGSTABGetConverged +#undef hypre_BiCGSTABGetFinalRelativeResidualNorm +#undef hypre_BiCGSTABGetNumIterations +#undef hypre_BiCGSTABGetPrecond +#undef hypre_BiCGSTABGetPrecondMatrix +#undef hypre_BiCGSTABGetResidual +#undef hypre_BiCGSTABSetAbsoluteTol +#undef hypre_BiCGSTABSetConvergenceFactorTol +#undef hypre_BiCGSTABSetHybrid +#undef hypre_BiCGSTABSetLogging +#undef hypre_BiCGSTABSetMaxIter +#undef hypre_BiCGSTABSetMinIter +#undef hypre_BiCGSTABSetPrecond +#undef hypre_BiCGSTABSetPrecondMatrix +#undef hypre_BiCGSTABSetPrintLevel +#undef hypre_BiCGSTABSetStopCrit +#undef hypre_BiCGSTABSetTol +#undef hypre_BiCGSTABSetup +#undef hypre_BiCGSTABSolve +#undef hypre_CGNRCreate +#undef hypre_CGNRDestroy +#undef hypre_CGNRFunctionsCreate +#undef hypre_CGNRGetFinalRelativeResidualNorm +#undef hypre_CGNRGetNumIterations +#undef hypre_CGNRGetPrecond +#undef hypre_CGNRSetLogging +#undef hypre_CGNRSetMaxIter +#undef hypre_CGNRSetMinIter +#undef hypre_CGNRSetPrecond +#undef hypre_CGNRSetStopCrit +#undef hypre_CGNRSetTol +#undef hypre_CGNRSetup +#undef hypre_CGNRSolve +#undef hypre_COGMRESCreate +#undef hypre_COGMRESDestroy +#undef hypre_COGMRESFunctionsCreate +#undef hypre_COGMRESGetAbsoluteTol +#undef hypre_COGMRESGetCGS +#undef hypre_COGMRESGetConverged +#undef hypre_COGMRESGetConvergenceFactorTol +#undef hypre_COGMRESGetFinalRelativeResidualNorm +#undef hypre_COGMRESGetKDim +#undef hypre_COGMRESGetLogging +#undef hypre_COGMRESGetMaxIter +#undef hypre_COGMRESGetMinIter +#undef hypre_COGMRESGetNumIterations +#undef hypre_COGMRESGetPrecond +#undef hypre_COGMRESGetPrintLevel +#undef hypre_COGMRESGetRelChange +#undef hypre_COGMRESGetResidual +#undef hypre_COGMRESGetSkipRealResidualCheck +#undef hypre_COGMRESGetTol +#undef hypre_COGMRESGetUnroll +#undef hypre_COGMRESSetAbsoluteTol +#undef hypre_COGMRESSetCGS +#undef hypre_COGMRESSetConvergenceFactorTol +#undef hypre_COGMRESSetKDim +#undef hypre_COGMRESSetLogging +#undef hypre_COGMRESSetMaxIter +#undef hypre_COGMRESSetMinIter +#undef hypre_COGMRESSetModifyPC +#undef hypre_COGMRESSetPrecond +#undef hypre_COGMRESSetPrintLevel +#undef hypre_COGMRESSetRelChange +#undef hypre_COGMRESSetSkipRealResidualCheck +#undef hypre_COGMRESSetTol +#undef hypre_COGMRESSetUnroll +#undef hypre_COGMRESSetup +#undef hypre_COGMRESSolve +#undef hypre_FlexGMRESCreate +#undef hypre_FlexGMRESDestroy +#undef hypre_FlexGMRESFunctionsCreate +#undef hypre_FlexGMRESGetAbsoluteTol +#undef hypre_FlexGMRESGetConverged +#undef hypre_FlexGMRESGetConvergenceFactorTol +#undef hypre_FlexGMRESGetFinalRelativeResidualNorm +#undef hypre_FlexGMRESGetKDim +#undef hypre_FlexGMRESGetLogging +#undef hypre_FlexGMRESGetMaxIter +#undef hypre_FlexGMRESGetMinIter +#undef hypre_FlexGMRESGetNumIterations +#undef hypre_FlexGMRESGetPrecond +#undef hypre_FlexGMRESGetPrintLevel +#undef hypre_FlexGMRESGetResidual +#undef hypre_FlexGMRESGetStopCrit +#undef hypre_FlexGMRESGetTol +#undef hypre_FlexGMRESModifyPCDefault +#undef hypre_FlexGMRESSetAbsoluteTol +#undef hypre_FlexGMRESSetConvergenceFactorTol +#undef hypre_FlexGMRESSetKDim +#undef hypre_FlexGMRESSetLogging +#undef hypre_FlexGMRESSetMaxIter +#undef hypre_FlexGMRESSetMinIter +#undef hypre_FlexGMRESSetModifyPC +#undef hypre_FlexGMRESSetPrecond +#undef hypre_FlexGMRESSetPrintLevel +#undef hypre_FlexGMRESSetStopCrit +#undef hypre_FlexGMRESSetTol +#undef hypre_FlexGMRESSetup +#undef hypre_FlexGMRESSolve +#undef hypre_GMRESCreate +#undef hypre_GMRESDestroy +#undef hypre_GMRESFunctionsCreate +#undef hypre_GMRESGetAbsoluteTol +#undef hypre_GMRESGetConverged +#undef hypre_GMRESGetConvergenceFactorTol +#undef hypre_GMRESGetFinalRelativeResidualNorm +#undef hypre_GMRESGetKDim +#undef hypre_GMRESGetLogging +#undef hypre_GMRESGetMaxIter +#undef hypre_GMRESGetMinIter +#undef hypre_GMRESGetNumIterations +#undef hypre_GMRESGetPrecond +#undef hypre_GMRESGetPrecondMatrix +#undef hypre_GMRESGetPrintLevel +#undef hypre_GMRESGetRefSolution +#undef hypre_GMRESGetRelChange +#undef hypre_GMRESGetResidual +#undef hypre_GMRESGetSkipRealResidualCheck +#undef hypre_GMRESGetStopCrit +#undef hypre_GMRESGetTol +#undef hypre_GMRESSetAbsoluteTol +#undef hypre_GMRESSetConvergenceFactorTol +#undef hypre_GMRESSetHybrid +#undef hypre_GMRESSetKDim +#undef hypre_GMRESSetLogging +#undef hypre_GMRESSetMaxIter +#undef hypre_GMRESSetMinIter +#undef hypre_GMRESSetPrecond +#undef hypre_GMRESSetPrecondMatrix +#undef hypre_GMRESSetPrintLevel +#undef hypre_GMRESSetRefSolution +#undef hypre_GMRESSetRelChange +#undef hypre_GMRESSetSkipRealResidualCheck +#undef hypre_GMRESSetStopCrit +#undef hypre_GMRESSetTol +#undef hypre_GMRESSetup +#undef hypre_GMRESSolve +#undef hypre_LGMRESCreate +#undef hypre_LGMRESDestroy +#undef hypre_LGMRESFunctionsCreate +#undef hypre_LGMRESGetAbsoluteTol +#undef hypre_LGMRESGetAugDim +#undef hypre_LGMRESGetConverged +#undef hypre_LGMRESGetConvergenceFactorTol +#undef hypre_LGMRESGetFinalRelativeResidualNorm +#undef hypre_LGMRESGetKDim +#undef hypre_LGMRESGetLogging +#undef hypre_LGMRESGetMaxIter +#undef hypre_LGMRESGetMinIter +#undef hypre_LGMRESGetNumIterations +#undef hypre_LGMRESGetPrecond +#undef hypre_LGMRESGetPrintLevel +#undef hypre_LGMRESGetResidual +#undef hypre_LGMRESGetStopCrit +#undef hypre_LGMRESGetTol +#undef hypre_LGMRESSetAbsoluteTol +#undef hypre_LGMRESSetAugDim +#undef hypre_LGMRESSetConvergenceFactorTol +#undef hypre_LGMRESSetKDim +#undef hypre_LGMRESSetLogging +#undef hypre_LGMRESSetMaxIter +#undef hypre_LGMRESSetMinIter +#undef hypre_LGMRESSetPrecond +#undef hypre_LGMRESSetPrintLevel +#undef hypre_LGMRESSetStopCrit +#undef hypre_LGMRESSetTol +#undef hypre_LGMRESSetup +#undef hypre_LGMRESSolve +#undef hypre_LOBPCGDestroy +#undef hypre_LOBPCGEigenvaluesHistory +#undef hypre_LOBPCGGetPrecond +#undef hypre_LOBPCGIterations +#undef hypre_LOBPCGMultiOperatorA +#undef hypre_LOBPCGMultiOperatorB +#undef hypre_LOBPCGMultiPreconditioner +#undef hypre_LOBPCGOperatorA +#undef hypre_LOBPCGOperatorB +#undef hypre_LOBPCGPreconditioner +#undef hypre_LOBPCGResidualNorms +#undef hypre_LOBPCGResidualNormsHistory +#undef hypre_LOBPCGSetMaxIter +#undef hypre_LOBPCGSetPrecond +#undef hypre_LOBPCGSetPrecondUsageMode +#undef hypre_LOBPCGSetPrintLevel +#undef hypre_LOBPCGSetRTol +#undef hypre_LOBPCGSetTol +#undef hypre_LOBPCGSetup +#undef hypre_LOBPCGSetupB +#undef hypre_LOBPCGSetupT +#undef hypre_LOBPCGSolve +#undef hypre_PCGCreate +#undef hypre_PCGDestroy +#undef hypre_PCGFunctionsCreate +#undef hypre_PCGGetAbsoluteTol +#undef hypre_PCGGetAbsoluteTolFactor +#undef hypre_PCGGetConverged +#undef hypre_PCGGetConvergenceFactorTol +#undef hypre_PCGGetFinalRelativeResidualNorm +#undef hypre_PCGGetFlex +#undef hypre_PCGGetLogging +#undef hypre_PCGGetMaxIter +#undef hypre_PCGGetNumIterations +#undef hypre_PCGGetPrecond +#undef hypre_PCGGetPrecondMatrix +#undef hypre_PCGGetPrintLevel +#undef hypre_PCGGetRecomputeResidual +#undef hypre_PCGGetRecomputeResidualP +#undef hypre_PCGGetRelChange +#undef hypre_PCGGetResidual +#undef hypre_PCGGetResidualTol +#undef hypre_PCGGetSkipBreak +#undef hypre_PCGGetStopCrit +#undef hypre_PCGGetTol +#undef hypre_PCGGetTwoNorm +#undef hypre_PCGPrintLogging +#undef hypre_PCGSetAbsoluteTol +#undef hypre_PCGSetAbsoluteTolFactor +#undef hypre_PCGSetConvergenceFactorTol +#undef hypre_PCGSetFlex +#undef hypre_PCGSetHybrid +#undef hypre_PCGSetLogging +#undef hypre_PCGSetMaxIter +#undef hypre_PCGSetPrecond +#undef hypre_PCGSetPrecondMatrix +#undef hypre_PCGSetPreconditioner +#undef hypre_PCGSetPrintLevel +#undef hypre_PCGSetRecomputeResidual +#undef hypre_PCGSetRecomputeResidualP +#undef hypre_PCGSetRelChange +#undef hypre_PCGSetResidualTol +#undef hypre_PCGSetSkipBreak +#undef hypre_PCGSetStopCrit +#undef hypre_PCGSetTol +#undef hypre_PCGSetTwoNorm +#undef hypre_PCGSetup +#undef hypre_PCGSolve +#undef lobpcg_MultiVectorByMultiVector +#undef lobpcg_clean +#undef lobpcg_initialize +#undef lobpcg_solve diff --git a/src/krylov/_hypre_lobpcg.h b/src/krylov/_hypre_lobpcg.h new file mode 100644 index 0000000000..31de8b3d51 --- /dev/null +++ b/src/krylov/_hypre_lobpcg.h @@ -0,0 +1,199 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_LOBPCG_HEADER +#define hypre_LOBPCG_HEADER + +#include "_hypre_lobpcg_multivector.h" +#include "_hypre_fortran_matrix.h" +#include "HYPRE_krylov.h" +#include "HYPRE_lobpcg.h" +#include "_hypre_krylov.h" +#include "_hypre_utilities.h" + +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_krylov_mup_def.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define PROBLEM_SIZE_TOO_SMALL 1 +#define WRONG_BLOCK_SIZE 2 +#define WRONG_CONSTRAINTS 3 +#define REQUESTED_ACCURACY_NOT_ACHIEVED -1 + +typedef void (*lobpcg_operator) (void *ptr1, void *ptr2, void *ptr3); + +typedef struct +{ + + HYPRE_Real absolute; + HYPRE_Real relative; + +} lobpcg_Tolerance; + +typedef struct +{ + HYPRE_Int (*Precond)(void*, void*, void*, void*); + HYPRE_Int (*PrecondSetup)(void*, void*, void*, void*); + +} hypre_LOBPCGPrecond; + +typedef struct +{ + lobpcg_Tolerance tolerance; + HYPRE_Int maxIterations; + HYPRE_Int verbosityLevel; + HYPRE_Int precondUsageMode; + HYPRE_Int iterationNumber; + utilities_FortranMatrix* eigenvaluesHistory; + utilities_FortranMatrix* residualNorms; + utilities_FortranMatrix* residualNormsHistory; + +} lobpcg_Data; + +#define lobpcg_tolerance(data) ((data).tolerance) +#define lobpcg_absoluteTolerance(data) ((data).tolerance.absolute) +#define lobpcg_relativeTolerance(data) ((data).tolerance.relative) +#define lobpcg_maxIterations(data) ((data).maxIterations) +#define lobpcg_verbosityLevel(data) ((data).verbosityLevel) +#define lobpcg_precondUsageMode(data) ((data).precondUsageMode) +#define lobpcg_iterationNumber(data) ((data).iterationNumber) +#define lobpcg_eigenvaluesHistory(data) ((data).eigenvaluesHistory) +#define lobpcg_residualNorms(data) ((data).residualNorms) +#define lobpcg_residualNormsHistory(data) ((data).residualNormsHistory) + +typedef struct +{ + + lobpcg_Data lobpcgData; + + mv_InterfaceInterpreter* interpreter; + + void* A; + void* matvecData; + void* precondData; + + void* B; + void* matvecDataB; + void* T; + void* matvecDataT; + + hypre_LOBPCGPrecond precondFunctions; + + HYPRE_MatvecFunctions* matvecFunctions; + +} hypre_LOBPCGData; + +typedef struct +{ + + /* 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); + 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); + +} lobpcg_BLASLAPACKFunctions; + +HYPRE_Int +lobpcg_solve( mv_MultiVectorPtr blockVectorX, + void* operatorAData, + lobpcg_operator operatorA, + void* operatorBData, + lobpcg_operator operatorB, + void* operatorTData, + lobpcg_operator operatorT, + mv_MultiVectorPtr blockVectorY, + lobpcg_BLASLAPACKFunctions blap_fn, + lobpcg_Tolerance tolerance, + HYPRE_Int maxIterations, + HYPRE_Int verbosityLevel, + HYPRE_Int* iterationNumber, + HYPRE_Real * lambda_values, + HYPRE_Real * lambdaHistory_values, + HYPRE_BigInt lambdaHistory_gh, + HYPRE_Real * residualNorms_values, + HYPRE_Real * residualNormsHistory_values, + HYPRE_BigInt residualNormsHistory_gh + ); + +HYPRE_Int +lobpcg_initialize( lobpcg_Data* data ); +HYPRE_Int +lobpcg_clean( lobpcg_Data* data ); +HYPRE_Int +hypre_LOBPCGDestroy( void *pcg_vdata ); +HYPRE_Int +hypre_LOBPCGSetup( void *pcg_vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_LOBPCGSetupB( void *pcg_vdata, void *B, void *x ); +HYPRE_Int +hypre_LOBPCGSetupT( void *pcg_vdata, void *T, void *x ); +HYPRE_Int +hypre_LOBPCGSetTol( void* pcg_vdata, HYPRE_Real tol ); +HYPRE_Int +hypre_LOBPCGSetRTol( void* pcg_vdata, HYPRE_Real tol ); +HYPRE_Int +hypre_LOBPCGSetMaxIter( void* pcg_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_LOBPCGSetPrecondUsageMode( void* pcg_vdata, HYPRE_Int mode ); +HYPRE_Int +hypre_LOBPCGGetPrecond( void *pcg_vdata, + HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +hypre_LOBPCGSetPrecond( void *pcg_vdata, + hypre_KrylovPtrToPrecond precond, + hypre_KrylovPtrToPrecondSetup precond_setup, + void *precond_data ); +HYPRE_Int +hypre_LOBPCGSetPrintLevel( void *pcg_vdata, HYPRE_Int level ); +void +hypre_LOBPCGPreconditioner( void *vdata, void* x, void* y ); +void +hypre_LOBPCGOperatorA( void *pcg_vdata, void* x, void* y ); +void +hypre_LOBPCGOperatorB( void *pcg_vdata, void* x, void* y ); +void +hypre_LOBPCGMultiPreconditioner( void *data, void * x, void* y ); +void +hypre_LOBPCGMultiOperatorA( void *data, void * x, void* y ); +void +hypre_LOBPCGMultiOperatorB( void *data, void * x, void* y ); +HYPRE_Int +hypre_LOBPCGSolve( void *vdata, + mv_MultiVectorPtr con, + mv_MultiVectorPtr vec, + HYPRE_Real* val ); +utilities_FortranMatrix* +hypre_LOBPCGResidualNorms( void *vdata ); +utilities_FortranMatrix* +hypre_LOBPCGResidualNormsHistory( void *vdata ); +utilities_FortranMatrix* +hypre_LOBPCGEigenvaluesHistory( void *vdata ); +HYPRE_Int +hypre_LOBPCGIterations( void* vdata ); +void lobpcg_MultiVectorByMultiVector(mv_MultiVectorPtr x, + mv_MultiVectorPtr y, + utilities_FortranMatrix *xy); + +#ifdef __cplusplus +} +#endif + +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_krylov_mup_undef.h" +#include "_hypre_lobpcg_mup.h" +#ifdef hypre_MP_BUILD +#include "_hypre_krylov_mup_def.h" +#endif +#endif + +#endif diff --git a/src/krylov/_hypre_lobpcg_mup.h b/src/krylov/_hypre_lobpcg_mup.h new file mode 100644 index 0000000000..4a7ae30054 --- /dev/null +++ b/src/krylov/_hypre_lobpcg_mup.h @@ -0,0 +1,235 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#ifndef hypre_LOBPCG_MUP_HEADER +#define hypre_LOBPCG_MUP_HEADER + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (HYPRE_MIXED_PRECISION) + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +hypre_LOBPCGDestroy_flt( void *pcg_vdata ); +HYPRE_Int +hypre_LOBPCGDestroy_dbl( void *pcg_vdata ); +HYPRE_Int +hypre_LOBPCGDestroy_long_dbl( void *pcg_vdata ); + +utilities_FortranMatrix* +hypre_LOBPCGEigenvaluesHistory_flt( void *vdata ); +utilities_FortranMatrix* +hypre_LOBPCGEigenvaluesHistory_dbl( void *vdata ); +utilities_FortranMatrix* +hypre_LOBPCGEigenvaluesHistory_long_dbl( void *vdata ); + +HYPRE_Int +hypre_LOBPCGGetPrecond_flt( void *pcg_vdata, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +hypre_LOBPCGGetPrecond_dbl( void *pcg_vdata, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int +hypre_LOBPCGGetPrecond_long_dbl( void *pcg_vdata, HYPRE_Solver *precond_data_ptr ); + +HYPRE_Int +hypre_LOBPCGIterations_flt( void* vdata ); +HYPRE_Int +hypre_LOBPCGIterations_dbl( void* vdata ); +HYPRE_Int +hypre_LOBPCGIterations_long_dbl( void* vdata ); + +void +hypre_LOBPCGMultiOperatorA_flt( void *data, void * x, void* y ); +void +hypre_LOBPCGMultiOperatorA_dbl( void *data, void * x, void* y ); +void +hypre_LOBPCGMultiOperatorA_long_dbl( void *data, void * x, void* y ); + +void +hypre_LOBPCGMultiOperatorB_flt( void *data, void * x, void* y ); +void +hypre_LOBPCGMultiOperatorB_dbl( void *data, void * x, void* y ); +void +hypre_LOBPCGMultiOperatorB_long_dbl( void *data, void * x, void* y ); + +void +hypre_LOBPCGMultiPreconditioner_flt( void *data, void * x, void* y ); +void +hypre_LOBPCGMultiPreconditioner_dbl( void *data, void * x, void* y ); +void +hypre_LOBPCGMultiPreconditioner_long_dbl( void *data, void * x, void* y ); + +void +hypre_LOBPCGOperatorA_flt( void *pcg_vdata, void* x, void* y ); +void +hypre_LOBPCGOperatorA_dbl( void *pcg_vdata, void* x, void* y ); +void +hypre_LOBPCGOperatorA_long_dbl( void *pcg_vdata, void* x, void* y ); + +void +hypre_LOBPCGOperatorB_flt( void *pcg_vdata, void* x, void* y ); +void +hypre_LOBPCGOperatorB_dbl( void *pcg_vdata, void* x, void* y ); +void +hypre_LOBPCGOperatorB_long_dbl( void *pcg_vdata, void* x, void* y ); + +void +hypre_LOBPCGPreconditioner_flt( void *vdata, void* x, void* y ); +void +hypre_LOBPCGPreconditioner_dbl( void *vdata, void* x, void* y ); +void +hypre_LOBPCGPreconditioner_long_dbl( void *vdata, void* x, void* y ); + +utilities_FortranMatrix* +hypre_LOBPCGResidualNorms_flt( void *vdata ); +utilities_FortranMatrix* +hypre_LOBPCGResidualNorms_dbl( void *vdata ); +utilities_FortranMatrix* +hypre_LOBPCGResidualNorms_long_dbl( void *vdata ); + +utilities_FortranMatrix* +hypre_LOBPCGResidualNormsHistory_flt( void *vdata ); +utilities_FortranMatrix* +hypre_LOBPCGResidualNormsHistory_dbl( void *vdata ); +utilities_FortranMatrix* +hypre_LOBPCGResidualNormsHistory_long_dbl( void *vdata ); + +HYPRE_Int +hypre_LOBPCGSetMaxIter_flt( void* pcg_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_LOBPCGSetMaxIter_dbl( void* pcg_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_LOBPCGSetMaxIter_long_dbl( void* pcg_vdata, HYPRE_Int max_iter ); + +HYPRE_Int +hypre_LOBPCGSetPrecond_flt( void *pcg_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ); +HYPRE_Int +hypre_LOBPCGSetPrecond_dbl( void *pcg_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ); +HYPRE_Int +hypre_LOBPCGSetPrecond_long_dbl( void *pcg_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ); + +HYPRE_Int +hypre_LOBPCGSetPrecondUsageMode_flt( void* pcg_vdata, HYPRE_Int mode ); +HYPRE_Int +hypre_LOBPCGSetPrecondUsageMode_dbl( void* pcg_vdata, HYPRE_Int mode ); +HYPRE_Int +hypre_LOBPCGSetPrecondUsageMode_long_dbl( void* pcg_vdata, HYPRE_Int mode ); + +HYPRE_Int +hypre_LOBPCGSetPrintLevel_flt( void *pcg_vdata, HYPRE_Int level ); +HYPRE_Int +hypre_LOBPCGSetPrintLevel_dbl( void *pcg_vdata, HYPRE_Int level ); +HYPRE_Int +hypre_LOBPCGSetPrintLevel_long_dbl( void *pcg_vdata, HYPRE_Int level ); + +HYPRE_Int +hypre_LOBPCGSetRTol_flt( void* pcg_vdata, hypre_float tol ); +HYPRE_Int +hypre_LOBPCGSetRTol_dbl( void* pcg_vdata, hypre_double tol ); +HYPRE_Int +hypre_LOBPCGSetRTol_long_dbl( void* pcg_vdata, hypre_long_double tol ); + +HYPRE_Int +hypre_LOBPCGSetTol_flt( void* pcg_vdata, hypre_float tol ); +HYPRE_Int +hypre_LOBPCGSetTol_dbl( void* pcg_vdata, hypre_double tol ); +HYPRE_Int +hypre_LOBPCGSetTol_long_dbl( void* pcg_vdata, hypre_long_double tol ); + +HYPRE_Int +hypre_LOBPCGSetup_flt( void *pcg_vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_LOBPCGSetup_dbl( void *pcg_vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_LOBPCGSetup_long_dbl( void *pcg_vdata, void *A, void *b, void *x ); + +HYPRE_Int +hypre_LOBPCGSetupB_flt( void *pcg_vdata, void *B, void *x ); +HYPRE_Int +hypre_LOBPCGSetupB_dbl( void *pcg_vdata, void *B, void *x ); +HYPRE_Int +hypre_LOBPCGSetupB_long_dbl( void *pcg_vdata, void *B, void *x ); + +HYPRE_Int +hypre_LOBPCGSetupT_flt( void *pcg_vdata, void *T, void *x ); +HYPRE_Int +hypre_LOBPCGSetupT_dbl( void *pcg_vdata, void *T, void *x ); +HYPRE_Int +hypre_LOBPCGSetupT_long_dbl( void *pcg_vdata, void *T, void *x ); + +HYPRE_Int +hypre_LOBPCGSolve_flt( void *vdata, mv_MultiVectorPtr con, mv_MultiVectorPtr vec, hypre_float* val ); +HYPRE_Int +hypre_LOBPCGSolve_dbl( void *vdata, mv_MultiVectorPtr con, mv_MultiVectorPtr vec, hypre_double* val ); +HYPRE_Int +hypre_LOBPCGSolve_long_dbl( void *vdata, mv_MultiVectorPtr con, mv_MultiVectorPtr vec, hypre_long_double* val ); + +void +lobpcg_MultiVectorByMultiVector_flt( mv_MultiVectorPtr x, mv_MultiVectorPtr y, utilities_FortranMatrix *xy ); +void +lobpcg_MultiVectorByMultiVector_dbl( mv_MultiVectorPtr x, mv_MultiVectorPtr y, utilities_FortranMatrix *xy ); +void +lobpcg_MultiVectorByMultiVector_long_dbl( mv_MultiVectorPtr x, mv_MultiVectorPtr y, utilities_FortranMatrix *xy ); + +HYPRE_Int +lobpcg_clean_flt( lobpcg_Data* data ); +HYPRE_Int +lobpcg_clean_dbl( lobpcg_Data* data ); +HYPRE_Int +lobpcg_clean_long_dbl( lobpcg_Data* data ); + +HYPRE_Int +lobpcg_initialize_flt( lobpcg_Data* data ); +HYPRE_Int +lobpcg_initialize_dbl( lobpcg_Data* data ); +HYPRE_Int +lobpcg_initialize_long_dbl( lobpcg_Data* data ); + +HYPRE_Int +lobpcg_solve_flt( mv_MultiVectorPtr blockVectorX, void* operatorAData, lobpcg_operator operatorA, void* operatorBData, lobpcg_operator operatorB, void* operatorTData, lobpcg_operator operatorT, mv_MultiVectorPtr blockVectorY, lobpcg_BLASLAPACKFunctions blap_fn, lobpcg_Tolerance tolerance, HYPRE_Int maxIterations, HYPRE_Int verbosityLevel, HYPRE_Int* iterationNumber, hypre_float * lambda_values, hypre_float * lambdaHistory_values, HYPRE_BigInt lambdaHistory_gh, hypre_float * residualNorms_values, hypre_float * residualNormsHistory_values, HYPRE_BigInt residualNormsHistory_gh ); +HYPRE_Int +lobpcg_solve_dbl( mv_MultiVectorPtr blockVectorX, void* operatorAData, lobpcg_operator operatorA, void* operatorBData, lobpcg_operator operatorB, void* operatorTData, lobpcg_operator operatorT, mv_MultiVectorPtr blockVectorY, lobpcg_BLASLAPACKFunctions blap_fn, lobpcg_Tolerance tolerance, HYPRE_Int maxIterations, HYPRE_Int verbosityLevel, HYPRE_Int* iterationNumber, hypre_double * lambda_values, hypre_double * lambdaHistory_values, HYPRE_BigInt lambdaHistory_gh, hypre_double * residualNorms_values, hypre_double * residualNormsHistory_values, HYPRE_BigInt residualNormsHistory_gh ); +HYPRE_Int +lobpcg_solve_long_dbl( mv_MultiVectorPtr blockVectorX, void* operatorAData, lobpcg_operator operatorA, void* operatorBData, lobpcg_operator operatorB, void* operatorTData, lobpcg_operator operatorT, mv_MultiVectorPtr blockVectorY, lobpcg_BLASLAPACKFunctions blap_fn, lobpcg_Tolerance tolerance, HYPRE_Int maxIterations, HYPRE_Int verbosityLevel, HYPRE_Int* iterationNumber, hypre_long_double * lambda_values, hypre_long_double * lambdaHistory_values, HYPRE_BigInt lambdaHistory_gh, hypre_long_double * residualNorms_values, hypre_long_double * residualNormsHistory_values, HYPRE_BigInt residualNormsHistory_gh ); + + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + + + +#endif + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/src/krylov/bicgstab.c b/src/krylov/bicgstab.c index 8a62fc94b0..6cf04d801d 100644 --- a/src/krylov/bicgstab.c +++ b/src/krylov/bicgstab.c @@ -11,7 +11,7 @@ * *****************************************************************************/ -#include "krylov.h" +#include "_hypre_krylov.h" #include "_hypre_utilities.h" /*-------------------------------------------------------------------------- @@ -79,6 +79,7 @@ hypre_BiCGSTABCreate( hypre_BiCGSTABFunctions * bicgstab_functions ) (bicgstab_data -> stop_crit) = 0; /* rel. residual norm */ (bicgstab_data -> a_tol) = 0.0; (bicgstab_data -> precond_data) = NULL; + (bicgstab_data -> precond_Mat) = NULL; (bicgstab_data -> logging) = 0; (bicgstab_data -> print_level) = 0; (bicgstab_data -> hybrid) = 0; @@ -151,9 +152,17 @@ hypre_BiCGSTABSetup( void *bicgstab_vdata, HYPRE_Int (*precond_setup)(void*, void*, void*, void*) = (bicgstab_functions -> precond_setup); void *precond_data = (bicgstab_data -> precond_data); + void *precond_Mat = (bicgstab_data -> precond_Mat); HYPRE_ANNOTATE_FUNC_BEGIN; + //set preconditioning matrix + if ((bicgstab_data -> precond_Mat) == NULL) + { + (bicgstab_data -> precond_Mat) = A; + precond_Mat = (bicgstab_data -> precond_Mat) ; + } + (bicgstab_data -> A) = A; /*-------------------------------------------------- @@ -191,7 +200,7 @@ hypre_BiCGSTABSetup( void *bicgstab_vdata, (bicgstab_data -> matvec_data) = (*(bicgstab_functions->MatvecCreate))(A, x); - precond_setup(precond_data, A, b, x); + precond_setup(precond_data, precond_Mat, b, x); /*----------------------------------------------------- * Allocate space for log info @@ -231,12 +240,12 @@ hypre_BiCGSTABSolve(void *bicgstab_vdata, 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 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); void *matvec_data = (bicgstab_data -> matvec_data); HYPRE_Real a_tol = (bicgstab_data -> a_tol); @@ -251,6 +260,8 @@ hypre_BiCGSTABSolve(void *bicgstab_vdata, HYPRE_Int (*precond)(void*, void*, void*, void*) = (bicgstab_functions -> precond); HYPRE_Int *precond_data = (HYPRE_Int*)(bicgstab_data -> precond_data); + // preconditioning matrix + void *precond_Mat = (bicgstab_data -> precond_Mat) ; /* logging variables */ HYPRE_Int logging = (bicgstab_data -> logging); @@ -450,7 +461,7 @@ hypre_BiCGSTABSolve(void *bicgstab_vdata, iter++; (*(bicgstab_functions->ClearVector))(v); - precond(precond_data, A, p, v); + precond(precond_data, precond_Mat, 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) @@ -467,7 +478,7 @@ hypre_BiCGSTABSolve(void *bicgstab_vdata, (*(bicgstab_functions->Axpy))(alpha, v, x); (*(bicgstab_functions->Axpy))(-alpha, q, r); (*(bicgstab_functions->ClearVector))(v); - precond(precond_data, A, r, v); + precond(precond_data, precond_Mat, 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); @@ -702,6 +713,30 @@ hypre_BiCGSTABGetPrecond( void *bicgstab_vdata, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_BiCGSTABSetPrecondMatrix + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BiCGSTABSetPrecondMatrix( void *bicgstab_vdata, void *precond_matrix ) +{ + hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; + (bicgstab_data -> precond_Mat) = precond_matrix; + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_BiCGSTABGetPrecondMatrix + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BiCGSTABGetPrecondMatrix( void *bicgstab_vdata, HYPRE_Matrix *precond_matrix_ptr ) +{ + hypre_BiCGSTABData *bicgstab_data = (hypre_BiCGSTABData *)bicgstab_vdata; + *precond_matrix_ptr = (HYPRE_Matrix)(bicgstab_data -> precond_Mat) ; + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- * hypre_BiCGSTABSetLogging *--------------------------------------------------------------------------*/ diff --git a/src/krylov/bicgstab.h b/src/krylov/bicgstab.h index 4b0c07ce07..a161acc747 100644 --- a/src/krylov/bicgstab.h +++ b/src/krylov/bicgstab.h @@ -46,44 +46,21 @@ * The {\tt hypre\_BiCGSTABSFunctions} object ... **/ -/* functions in pcg_struct.c which aren't used here: -char *hypre_ParKrylovCAlloc( HYPRE_Int count , HYPRE_Int elt_size ); -HYPRE_Int hypre_ParKrylovFree( char *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_KrylovPtrToCreateVector CreateVector; + hypre_KrylovPtrToDestroyVector DestroyVector; + hypre_KrylovPtrToMatvecCreate MatvecCreate; + hypre_KrylovPtrToMatvec Matvec; + hypre_KrylovPtrToMatvecDestroy MatvecDestroy; + hypre_KrylovPtrToInnerProd InnerProd; + hypre_KrylovPtrToCopyVector CopyVector; + hypre_KrylovPtrToClearVector ClearVector; + hypre_KrylovPtrToScaleVector ScaleVector; + hypre_KrylovPtrToAxpy Axpy; + hypre_KrylovPtrToCommInfo CommInfo; + hypre_KrylovPtrToPrecond precond; + hypre_KrylovPtrToPrecondSetup precond_setup; } hypre_BiCGSTABFunctions; @@ -98,10 +75,10 @@ typedef struct 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; + HYPRE_Real tol; + HYPRE_Real cf_tol; + HYPRE_Real rel_residual_norm; + HYPRE_Real a_tol; void *A; @@ -113,7 +90,8 @@ typedef struct void *q; void *matvec_data; - void *precond_data; + void *precond_data; + void *precond_Mat; hypre_BiCGSTABFunctions * functions; @@ -128,6 +106,8 @@ typedef struct } hypre_BiCGSTABData; +#define hypre_BiCGSTABDataHybrid(pcgdata) ((pcgdata) -> hybrid) + #ifdef __cplusplus extern "C" { #endif @@ -147,21 +127,19 @@ extern "C" { 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 ) + hypre_KrylovPtrToCreateVector CreateVector, + hypre_KrylovPtrToDestroyVector DestroyVector, + hypre_KrylovPtrToMatvecCreate MatvecCreate, + hypre_KrylovPtrToMatvec Matvec, + hypre_KrylovPtrToMatvecDestroy MatvecDestroy, + hypre_KrylovPtrToInnerProd InnerProd, + hypre_KrylovPtrToCopyVector CopyVector, + hypre_KrylovPtrToClearVector ClearVector, + hypre_KrylovPtrToScaleVector ScaleVector, + hypre_KrylovPtrToAxpy Axpy, + hypre_KrylovPtrToCommInfo CommInfo, + hypre_KrylovPtrToPrecond Precond, + hypre_KrylovPtrToPrecondSetup PrecondSetup ); /** @@ -170,10 +148,6 @@ hypre_BiCGSTABFunctionsCreate( * @param param [IN] ... **/ -void * -hypre_BiCGSTABCreate( hypre_BiCGSTABFunctions * bicgstab_functions ); - - #ifdef __cplusplus } #endif diff --git a/src/krylov/cgnr.c b/src/krylov/cgnr.c index c54ade2299..599fed2e66 100644 --- a/src/krylov/cgnr.c +++ b/src/krylov/cgnr.c @@ -11,7 +11,7 @@ * *****************************************************************************/ -#include "krylov.h" +#include "_hypre_krylov.h" #include "_hypre_utilities.h" /*-------------------------------------------------------------------------- diff --git a/src/krylov/cgnr.h b/src/krylov/cgnr.h index a7c124e3c0..b9583df15d 100644 --- a/src/krylov/cgnr.h +++ b/src/krylov/cgnr.h @@ -48,24 +48,21 @@ 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_KrylovPtrToCommInfo CommInfo; + hypre_KrylovPtrToCreateVector CreateVector; + hypre_KrylovPtrToDestroyVector DestroyVector; + hypre_KrylovPtrToMatvecCreate MatvecCreate; + hypre_KrylovPtrToMatvec Matvec; + hypre_KrylovPtrToMatvecT MatvecT; + hypre_KrylovPtrToMatvecDestroy MatvecDestroy; + hypre_KrylovPtrToInnerProd InnerProd; + hypre_KrylovPtrToCopyVector CopyVector; + hypre_KrylovPtrToClearVector ClearVector; + hypre_KrylovPtrToScaleVector ScaleVector; + hypre_KrylovPtrToAxpy Axpy; + hypre_KrylovPtrToPrecondSetup precond_setup; + hypre_KrylovPtrToPrecond precond; + hypre_KrylovPtrToPrecondT precondT; } hypre_CGNRFunctions; @@ -120,24 +117,21 @@ extern "C" { **/ 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 ) + hypre_KrylovPtrToCommInfo CommInfo, + hypre_KrylovPtrToCreateVector CreateVector, + hypre_KrylovPtrToDestroyVector DestroyVector, + hypre_KrylovPtrToMatvecCreate MatvecCreate, + hypre_KrylovPtrToMatvec Matvec, + hypre_KrylovPtrToMatvecT MatvecT, + hypre_KrylovPtrToMatvecDestroy MatvecDestroy, + hypre_KrylovPtrToInnerProd InnerProd, + hypre_KrylovPtrToCopyVector CopyVector, + hypre_KrylovPtrToClearVector ClearVector, + hypre_KrylovPtrToScaleVector ScaleVector, + hypre_KrylovPtrToAxpy Axpy, + hypre_KrylovPtrToPrecondSetup PrecondSetup, + hypre_KrylovPtrToPrecond Precond, + hypre_KrylovPtrToPrecondT PrecondT ); /** @@ -146,9 +140,6 @@ hypre_CGNRFunctionsCreate( * @param param [IN] ... **/ -void * -hypre_CGNRCreate( hypre_CGNRFunctions *cgnr_functions ); - #ifdef __cplusplus } #endif diff --git a/src/krylov/cogmres.c b/src/krylov/cogmres.c index 334bd20375..19dbe73239 100644 --- a/src/krylov/cogmres.c +++ b/src/krylov/cogmres.c @@ -11,7 +11,7 @@ * *****************************************************************************/ -#include "krylov.h" +#include "_hypre_krylov.h" #include "_hypre_utilities.h" /*-------------------------------------------------------------------------- diff --git a/src/krylov/cogmres.h b/src/krylov/cogmres.h index d939379b2a..0183b85ade 100644 --- a/src/krylov/cogmres.h +++ b/src/krylov/cogmres.h @@ -7,7 +7,7 @@ /****************************************************************************** * - * COGMRES gmres + * COGMRES cogmres * *****************************************************************************/ @@ -46,31 +46,26 @@ typedef struct { - void * (*CAlloc) ( size_t count, size_t elt_size ); - 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, 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 (*precond) (); - HYPRE_Int (*precond_setup) (); - - HYPRE_Int (*modify_pc)(void *precond_data, HYPRE_Int iteration, HYPRE_Real rel_residual_norm ); + hypre_KrylovPtrToCAlloc CAlloc; + hypre_KrylovPtrToFree Free; + hypre_KrylovPtrToCommInfo CommInfo; + hypre_KrylovPtrToCreateVector CreateVector; + hypre_KrylovPtrToCreateVectorArray CreateVectorArray; + hypre_KrylovPtrToDestroyVector DestroyVector; + hypre_KrylovPtrToMatvecCreate MatvecCreate; + hypre_KrylovPtrToMatvec Matvec; + hypre_KrylovPtrToMatvecDestroy MatvecDestroy; + hypre_KrylovPtrToInnerProd InnerProd; + hypre_KrylovPtrToMassInnerProd MassInnerProd; + hypre_KrylovPtrToMassDotpTwo MassDotpTwo; + hypre_KrylovPtrToCopyVector CopyVector; + hypre_KrylovPtrToClearVector ClearVector; + hypre_KrylovPtrToScaleVector ScaleVector; + hypre_KrylovPtrToAxpy Axpy; + hypre_KrylovPtrToMassAxpy MassAxpy; + hypre_KrylovPtrToPrecond precond; + hypre_KrylovPtrToPrecondSetup precond_setup; + hypre_KrylovPtrToModifyPC modify_pc; } hypre_COGMRESFunctions; @@ -87,6 +82,7 @@ typedef struct 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; @@ -133,29 +129,25 @@ extern "C" { hypre_COGMRESFunctions * hypre_COGMRESFunctionsCreate( - void * (*CAlloc) ( size_t count, size_t elt_size ), - 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 ) + hypre_KrylovPtrToCAlloc CAlloc, + hypre_KrylovPtrToFree Free, + hypre_KrylovPtrToCommInfo CommInfo, + hypre_KrylovPtrToCreateVector CreateVector, + hypre_KrylovPtrToCreateVectorArray CreateVectorArray, + hypre_KrylovPtrToDestroyVector DestroyVector, + hypre_KrylovPtrToMatvecCreate MatvecCreate, + hypre_KrylovPtrToMatvec Matvec, + hypre_KrylovPtrToMatvecDestroy MatvecDestroy, + hypre_KrylovPtrToInnerProd InnerProd, + hypre_KrylovPtrToMassInnerProd MassInnerProd, + hypre_KrylovPtrToMassDotpTwo MassDotpTwo, + hypre_KrylovPtrToCopyVector CopyVector, + hypre_KrylovPtrToClearVector ClearVector, + hypre_KrylovPtrToScaleVector ScaleVector, + hypre_KrylovPtrToAxpy Axpy, + hypre_KrylovPtrToMassAxpy MassAxpy, + hypre_KrylovPtrToPrecondSetup PrecondSetup, + hypre_KrylovPtrToPrecond Precond ); /** @@ -164,9 +156,6 @@ hypre_COGMRESFunctionsCreate( * @param param [IN] ... **/ -void * -hypre_COGMRESCreate( hypre_COGMRESFunctions *gmres_functions ); - #ifdef __cplusplus } #endif diff --git a/src/krylov/flexgmres.c b/src/krylov/flexgmres.c index 8a369da71b..92135527ca 100644 --- a/src/krylov/flexgmres.c +++ b/src/krylov/flexgmres.c @@ -11,7 +11,7 @@ * *****************************************************************************/ -#include "krylov.h" +#include "_hypre_krylov.h" #include "_hypre_utilities.h" /*-------------------------------------------------------------------------- diff --git a/src/krylov/flexgmres.h b/src/krylov/flexgmres.h index f4d10759e7..362541e810 100644 --- a/src/krylov/flexgmres.h +++ b/src/krylov/flexgmres.h @@ -45,27 +45,23 @@ typedef struct { - void * (*CAlloc) ( size_t count, size_t elt_size ); - 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_KrylovPtrToCAlloc CAlloc; + hypre_KrylovPtrToFree Free; + hypre_KrylovPtrToCommInfo CommInfo; + hypre_KrylovPtrToCreateVector CreateVector; + hypre_KrylovPtrToCreateVectorArray CreateVectorArray; + hypre_KrylovPtrToDestroyVector DestroyVector; + hypre_KrylovPtrToMatvecCreate MatvecCreate; + hypre_KrylovPtrToMatvec Matvec; + hypre_KrylovPtrToMatvecDestroy MatvecDestroy; + hypre_KrylovPtrToInnerProd InnerProd; + hypre_KrylovPtrToCopyVector CopyVector; + hypre_KrylovPtrToClearVector ClearVector; + hypre_KrylovPtrToScaleVector ScaleVector; + hypre_KrylovPtrToAxpy Axpy; + hypre_KrylovPtrToPrecond precond; + hypre_KrylovPtrToPrecondSetup precond_setup; + hypre_KrylovPtrToModifyPC modify_pc; } hypre_FlexGMRESFunctions; @@ -128,24 +124,22 @@ extern "C" { hypre_FlexGMRESFunctions * hypre_FlexGMRESFunctionsCreate( - void * (*CAlloc) ( size_t count, size_t elt_size ), - 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 ) + hypre_KrylovPtrToCAlloc CAlloc, + hypre_KrylovPtrToFree Free, + hypre_KrylovPtrToCommInfo CommInfo, + hypre_KrylovPtrToCreateVector CreateVector, + hypre_KrylovPtrToCreateVectorArray CreateVectorArray, + hypre_KrylovPtrToDestroyVector DestroyVector, + hypre_KrylovPtrToMatvecCreate MatvecCreate, + hypre_KrylovPtrToMatvec Matvec, + hypre_KrylovPtrToMatvecDestroy MatvecDestroy, + hypre_KrylovPtrToInnerProd InnerProd, + hypre_KrylovPtrToCopyVector CopyVector, + hypre_KrylovPtrToClearVector ClearVector, + hypre_KrylovPtrToScaleVector ScaleVector, + hypre_KrylovPtrToAxpy Axpy, + hypre_KrylovPtrToPrecondSetup PrecondSetup, + hypre_KrylovPtrToPrecond Precond ); /** @@ -154,9 +148,6 @@ hypre_FlexGMRESFunctionsCreate( * @param param [IN] ... **/ -void * -hypre_FlexGMRESCreate( hypre_FlexGMRESFunctions *fgmres_functions ); - #ifdef __cplusplus } #endif diff --git a/src/krylov/gmres.c b/src/krylov/gmres.c index fe7a286e68..9840ac8463 100644 --- a/src/krylov/gmres.c +++ b/src/krylov/gmres.c @@ -11,7 +11,7 @@ * *****************************************************************************/ -#include "krylov.h" +#include "_hypre_krylov.h" #include "_hypre_utilities.h" /*-------------------------------------------------------------------------- @@ -93,6 +93,7 @@ hypre_GMRESCreate( hypre_GMRESFunctions *gmres_functions ) (gmres_data -> converged) = 0; (gmres_data -> hybrid) = 0; (gmres_data -> precond_data) = NULL; + (gmres_data -> precond_Mat) = NULL; (gmres_data -> print_level) = 0; (gmres_data -> logging) = 0; (gmres_data -> p) = NULL; @@ -191,18 +192,26 @@ hypre_GMRESSetup( void *gmres_vdata, HYPRE_Int k_dim = (gmres_data -> k_dim); HYPRE_Int max_iter = (gmres_data -> max_iter); void *precond_data = (gmres_data -> precond_data); + void *precond_Mat = (gmres_data -> precond_Mat); HYPRE_Int rel_change = (gmres_data -> rel_change); HYPRE_Int (*precond_setup)(void*, void*, void*, void*) = (gmres_functions->precond_setup); HYPRE_ANNOTATE_FUNC_BEGIN; + //set preconditioning matrix + if ((gmres_data -> precond_Mat) == NULL) + { + (gmres_data -> precond_Mat) = A; + precond_Mat = (gmres_data -> precond_Mat) ; + } + (gmres_data -> A) = A; /*-------------------------------------------------- * The arguments for NewVector are important to * maintain consistency between the setup and - * compute phases of matvec and the preconditioner. + * ecompute phases of matvec and the preconditioner. *--------------------------------------------------*/ if ((gmres_data -> p) == NULL) @@ -242,7 +251,7 @@ hypre_GMRESSetup( void *gmres_vdata, (gmres_data -> matvec_data) = (*(gmres_functions->MatvecCreate))(A, x); } - precond_setup(precond_data, A, b, x); + precond_setup(precond_data, precond_Mat, b, x); /*----------------------------------------------------- * Allocate space for log info @@ -306,7 +315,9 @@ hypre_GMRESSolve(void *gmres_vdata, void **p = (gmres_data -> p); HYPRE_Int (*precond)(void*, void*, void*, void*) = (gmres_functions -> precond); - HYPRE_Int *precond_data = (HYPRE_Int*) (gmres_data -> precond_data); + void *precond_data = (gmres_data -> precond_data); + // preconditioning matrix + void *precond_Mat = (gmres_data -> precond_Mat) ; HYPRE_Int print_level = (gmres_data -> print_level); HYPRE_Int logging = (gmres_data -> logging); @@ -668,7 +679,7 @@ hypre_GMRESSolve(void *gmres_vdata, i++; iter++; (*(gmres_functions->ClearVector))(r); - precond(precond_data, A, p[i - 1], r); + precond(precond_data, precond_Mat, p[i - 1], r); (*(gmres_functions->Matvec))(matvec_data, 1.0, A, r, 0.0, p[i]); /* modified Gram_Schmidt */ @@ -893,7 +904,7 @@ hypre_GMRESSolve(void *gmres_vdata, } (*(gmres_functions->ClearVector))(r); /* find correction (in r) */ - precond(precond_data, A, w, r); + precond(precond_data, precond_Mat, w, r); /* copy current solution (x) to w (don't want to over-write x)*/ (*(gmres_functions->CopyVector))(x, w); @@ -937,7 +948,7 @@ hypre_GMRESSolve(void *gmres_vdata, (*(gmres_functions->Axpy))(rs_2[i - 1], p[i - 1], w); (*(gmres_functions->ClearVector))(r); /* apply the preconditioner */ - precond(precond_data, A, w, r); + precond(precond_data, precond_Mat, w, r); /* now r contains x_i - x_i-1 */ } /* find the norm of x_i - x_i-1 */ @@ -993,7 +1004,7 @@ hypre_GMRESSolve(void *gmres_vdata, (*(gmres_functions->ClearVector))(r); /* find correction (in r) */ - precond(precond_data, A, w, r); + precond(precond_data, precond_Mat, w, r); /* update current solution x (in x) */ (*(gmres_functions->Axpy))(1.0, r, x); @@ -1034,7 +1045,7 @@ hypre_GMRESSolve(void *gmres_vdata, (*(gmres_functions->Axpy))(rs[i - 1], p[i - 1], w); (*(gmres_functions->ClearVector))(r); /* apply the preconditioner */ - precond(precond_data, A, w, r); + precond(precond_data, precond_Mat, w, r); /* find the norm of x_i - x_i-1 */ (*(gmres_functions->InnerProd))(r, r, &num_tags, &iprod); w_norm = hypre_sqrt(iprod[0]); @@ -1187,7 +1198,6 @@ hypre_GMRESSolve(void *gmres_vdata, return hypre_error_flag; } - /*-------------------------------------------------------------------------- * hypre_GMRESSetKDim, hypre_GMRESGetKDim *--------------------------------------------------------------------------*/ @@ -1216,7 +1226,6 @@ hypre_GMRESGetKDim( void *gmres_vdata, return hypre_error_flag; } - /*-------------------------------------------------------------------------- * hypre_GMRESSetTol, hypre_GMRESGetTol *--------------------------------------------------------------------------*/ @@ -1410,7 +1419,7 @@ hypre_GMRESGetSkipRealResidualCheck( void *gmres_vdata, } /*-------------------------------------------------------------------------- - * hypre_GMRESSetStopCrit, hypre_GMRESGetStopCrit + * hypre_GMRESSetStopCrit, hypre_GMRESGetStopCrit * * OBSOLETE *--------------------------------------------------------------------------*/ @@ -1476,6 +1485,30 @@ hypre_GMRESGetPrecond( void *gmres_vdata, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_GMRESSetPrecondMatrix + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESSetPrecondMatrix( void *gmres_vdata, void *precond_matrix ) +{ + hypre_GMRESData *gmres_data = (hypre_GMRESData *)gmres_vdata; + (gmres_data -> precond_Mat) = precond_matrix; + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_GMRESGetPrecondMatrix + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESGetPrecondMatrix( void *gmres_vdata, HYPRE_Matrix *precond_matrix_ptr ) +{ + hypre_GMRESData *gmres_data = (hypre_GMRESData *)gmres_vdata; + *precond_matrix_ptr = (HYPRE_Matrix)(gmres_data -> precond_Mat) ; + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- * hypre_GMRESSetPrintLevel, hypre_GMRESGetPrintLevel *--------------------------------------------------------------------------*/ diff --git a/src/krylov/gmres.h b/src/krylov/gmres.h index 41381d4e6a..a5f22dc320 100644 --- a/src/krylov/gmres.h +++ b/src/krylov/gmres.h @@ -48,26 +48,22 @@ typedef struct { - void * (*CAlloc) ( size_t count, size_t elt_size ); - 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_Int (*InnerProd) ( void *x, void *y, HYPRE_Int *num_tags_ptr, - HYPRE_Complex **iprod_ptr ); - 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) (); - HYPRE_Int (*precond_setup) (); + hypre_KrylovPtrToCAlloc CAlloc; + hypre_KrylovPtrToFree Free; + hypre_KrylovPtrToCommInfo CommInfo; + hypre_KrylovPtrToCreateVector CreateVector; + hypre_KrylovPtrToCreateVectorArray CreateVectorArray; + hypre_KrylovPtrToDestroyVector DestroyVector; + hypre_KrylovPtrToMatvecCreate MatvecCreate; + hypre_KrylovPtrToMatvec Matvec; + hypre_KrylovPtrToMatvecDestroy MatvecDestroy; + hypre_KrylovPtrToInnerProdTagged InnerProd; + hypre_KrylovPtrToCopyVector CopyVector; + hypre_KrylovPtrToClearVector ClearVector; + hypre_KrylovPtrToScaleVector ScaleVector; + hypre_KrylovPtrToAxpy Axpy; + hypre_KrylovPtrToPrecond precond; + hypre_KrylovPtrToPrecondSetup precond_setup; } hypre_GMRESFunctions; @@ -100,6 +96,7 @@ typedef struct void *matvec_data; void *precond_data; + void *precond_Mat; hypre_GMRESFunctions * functions; @@ -132,25 +129,22 @@ extern "C" { hypre_GMRESFunctions * hypre_GMRESFunctionsCreate( - void * (*CAlloc) ( size_t count, size_t elt_size ), - 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_Int (*InnerProd) ( void *x, void *y, HYPRE_Int *num_tags_ptr, - HYPRE_Complex **iprod_ptr ), - 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_KrylovPtrToCAlloc CAlloc, + hypre_KrylovPtrToFree Free, + hypre_KrylovPtrToCommInfo CommInfo, + hypre_KrylovPtrToCreateVector CreateVector, + hypre_KrylovPtrToCreateVectorArray CreateVectorArray, + hypre_KrylovPtrToDestroyVector DestroyVector, + hypre_KrylovPtrToMatvecCreate MatvecCreate, + hypre_KrylovPtrToMatvec Matvec, + hypre_KrylovPtrToMatvecDestroy MatvecDestroy, + hypre_KrylovPtrToInnerProdTagged InnerProd, + hypre_KrylovPtrToCopyVector CopyVector, + hypre_KrylovPtrToClearVector ClearVector, + hypre_KrylovPtrToScaleVector ScaleVector, + hypre_KrylovPtrToAxpy Axpy, + hypre_KrylovPtrToPrecond Precond, + hypre_KrylovPtrToPrecondSetup PrecondSetup ); /** @@ -159,9 +153,6 @@ hypre_GMRESFunctionsCreate( * @param param [IN] ... **/ -void * -hypre_GMRESCreate( hypre_GMRESFunctions *gmres_functions ); - #ifdef __cplusplus } #endif diff --git a/src/krylov/headers b/src/krylov/headers new file mode 100755 index 0000000000..1f5efa1f8e --- /dev/null +++ b/src/krylov/headers @@ -0,0 +1,82 @@ +#!/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_krylov.h + +#=========================================================================== +# Include guards and other includes +#=========================================================================== + +cat > $INTERNAL_HEADER <<@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use 'headers' to generate) ***/ + +#ifndef hypre_KRYLOV_HEADER +#define hypre_KRYLOV_HEADER + +#include +#include +#include + +#include "HYPRE_krylov.h" +#include "_hypre_utilities.h" + +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_krylov_mup_def.h" +#endif + +#define hypre_CTAllocF(type, count, funcs, location) \\ + ( (type *)(*(funcs->CAlloc))((size_t)(count), (size_t)sizeof(type), location) ) + +#define hypre_TFreeF( ptr, funcs ) ( (*(funcs->Free))((void *)ptr), ptr = NULL ) + +#ifdef __cplusplus +extern "C" { +#endif + +@ + +#=========================================================================== +# Structures and prototypes +#=========================================================================== + +cat krylov_solver_ptrs.h >> $INTERNAL_HEADER +cat bicgstab.h >> $INTERNAL_HEADER +cat cgnr.h >> $INTERNAL_HEADER +cat gmres.h >> $INTERNAL_HEADER +cat cogmres.h >> $INTERNAL_HEADER +cat lgmres.h >> $INTERNAL_HEADER +cat flexgmres.h >> $INTERNAL_HEADER +cat pcg.h >> $INTERNAL_HEADER +cat protos.h >> $INTERNAL_HEADER + +#../utilities/protos [!F]*.c >> $INTERNAL_HEADER + +#=========================================================================== +# Include guards +#=========================================================================== + +cat >> $INTERNAL_HEADER <<@ + +#ifdef __cplusplus +} +#endif + +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_krylov_mup_undef.h" +#include "_hypre_krylov_mup.h" +#endif +#endif + +#endif + +@ + diff --git a/src/krylov/krylov.h b/src/krylov/krylov.h deleted file mode 100644 index bb711370ef..0000000000 --- a/src/krylov/krylov.h +++ /dev/null @@ -1,1672 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_krylov.h" - -#ifndef hypre_KRYLOV_HEADER -#define hypre_KRYLOV_HEADER - -#include -#include -#include - -#include "_hypre_utilities.h" - -#define hypre_CTAllocF(type, count, funcs, location) \ - ( (type *)(*(funcs->CAlloc))((size_t)(count), (size_t)sizeof(type), location) ) - -#define hypre_TFreeF( ptr, funcs ) ( (*(funcs->Free))((void *)ptr), ptr = NULL ) - -#ifdef __cplusplus -extern "C" { -#endif - -/****************************************************************************** - * - * 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; - -#define hypre_BiCGSTABDataHybrid(pcgdata) ((pcgdata) -> hybrid) - -#ifdef __cplusplus -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 ); - -#ifdef __cplusplus -} -#endif - -#endif - -/****************************************************************************** - * - * 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; - - -#ifdef __cplusplus -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 ); - -#ifdef __cplusplus -} -#endif - -#endif - -/****************************************************************************** - * - * 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_Int (*InnerProd) ( void *x, void *y, HYPRE_Int *num_tags_ptr, - HYPRE_Complex **iprod_ptr ); - 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 *w_3; - void **p; - void *xref; /* reference solution for error computation */ - - 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" { -#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_Int (*InnerProd) ( void *x, void *y, HYPRE_Int *num_tags_ptr, - HYPRE_Complex **iprod_ptr ), - 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 - * - *****************************************************************************/ - -#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; - -#ifdef __cplusplus -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 ); - -#ifdef __cplusplus -} -#endif -#endif - - - -/***********end of KS code *********/ - - - -/****************************************************************************** - * - * 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; - -#ifdef __cplusplus -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 ); - -#ifdef __cplusplus -} -#endif -#endif - -/****************************************************************************** - * - * 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; - -#ifdef __cplusplus -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 ); - -#ifdef __cplusplus -} -#endif -#endif - -/****************************************************************************** - * - * 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; - 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_PCGFunctions * functions; - - /* 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_PCGData; - -#define hypre_PCGDataOwnsMatvecData(pcgdata) ((pcgdata) -> owns_matvec_data) -#define hypre_PCGDataHybrid(pcgdata) ((pcgdata) -> hybrid) - -#ifdef __cplusplus -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 ); - -#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_GMRESSetRefSolution ( void *gmres_vdata, void *xref ); -HYPRE_Int hypre_GMRESGetRefSolution ( void *gmres_vdata, void **xref ); -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/src/krylov/krylov_solver_ptrs.h b/src/krylov/krylov_solver_ptrs.h new file mode 100644 index 0000000000..e1be73c867 --- /dev/null +++ b/src/krylov/krylov_solver_ptrs.h @@ -0,0 +1,47 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_KRYLOV_SOLVER_PTRS_HEADER +#define hypre_KRYLOV_SOLVER_PTRS_HEADER + +typedef void * (*hypre_KrylovPtrToCAlloc) (size_t count, size_t elt_size, + HYPRE_MemoryLocation location); +typedef HYPRE_Int (*hypre_KrylovPtrToFree) (void *ptr); +typedef HYPRE_Int (*hypre_KrylovPtrToCommInfo) (void *A, HYPRE_Int *my_id, + HYPRE_Int *num_procs); +typedef void * (*hypre_KrylovPtrToCreateVector) (void *vector); +typedef void * (*hypre_KrylovPtrToCreateVectorArray) (HYPRE_Int size, void *vectors); +typedef HYPRE_Int (*hypre_KrylovPtrToDestroyVector) (void *vector); +typedef void * (*hypre_KrylovPtrToMatvecCreate) (void *A, void *x); +typedef HYPRE_Int (*hypre_KrylovPtrToMatvec) (void *matvec_data, HYPRE_Complex alpha, + void *A, void *x, + HYPRE_Complex beta, void *y); +typedef HYPRE_Int (*hypre_KrylovPtrToMatvecT) (void *matvec_data, HYPRE_Complex alpha, + void *A, void *x, + HYPRE_Complex beta, void *y); +typedef HYPRE_Int (*hypre_KrylovPtrToMatvecDestroy) (void *matvec_data); +typedef HYPRE_Real (*hypre_KrylovPtrToInnerProd) (void *x, void *y); +typedef HYPRE_Int (*hypre_KrylovPtrToInnerProdTagged) (void *x, void *y, HYPRE_Int *num_tags_ptr, + HYPRE_Complex **iprod_ptr ); +typedef HYPRE_Int (*hypre_KrylovPtrToCopyVector) (void *x, void *y); +typedef HYPRE_Int (*hypre_KrylovPtrToClearVector) (void *x); +typedef HYPRE_Int (*hypre_KrylovPtrToScaleVector) (HYPRE_Complex alpha, void *x); +typedef HYPRE_Int (*hypre_KrylovPtrToAxpy) (HYPRE_Complex alpha, void *x, void *y); +typedef HYPRE_Int (*hypre_KrylovPtrToPrecondSetup) (void *vdata, void *A, void *b, void *x); +typedef HYPRE_Int (*hypre_KrylovPtrToPrecond) (void *vdata, void *A, void *b, void *x); +typedef HYPRE_Int (*hypre_KrylovPtrToPrecondT) (void *vdata, void *A, void *b, void *x); +typedef HYPRE_Int (*hypre_KrylovPtrToMassInnerProd) (void *x, void **p, HYPRE_Int k, + HYPRE_Int unroll, void *result); +typedef HYPRE_Int (*hypre_KrylovPtrToMassDotpTwo) (void *x, void *y, void **p, HYPRE_Int k, + HYPRE_Int unroll, void *result_x, + void *result_y); +typedef HYPRE_Int (*hypre_KrylovPtrToMassAxpy) (HYPRE_Complex *alpha, void **x, + void *y, HYPRE_Int k, HYPRE_Int unroll); +typedef HYPRE_Int (*hypre_KrylovPtrToModifyPC) (void *precond_data, HYPRE_Int iteration, + HYPRE_Real rel_residual_norm ); + +#endif diff --git a/src/krylov/lgmres.c b/src/krylov/lgmres.c index 96e4b2434b..3be6963cdb 100644 --- a/src/krylov/lgmres.c +++ b/src/krylov/lgmres.c @@ -11,7 +11,7 @@ * *****************************************************************************/ -#include "krylov.h" +#include "_hypre_krylov.h" #include "_hypre_utilities.h" /*-------------------------------------------------------------------------- diff --git a/src/krylov/lgmres.h b/src/krylov/lgmres.h index 610e78383c..0197a8ee42 100644 --- a/src/krylov/lgmres.h +++ b/src/krylov/lgmres.h @@ -45,25 +45,22 @@ typedef struct { - void * (*CAlloc) ( size_t count, size_t elt_size ); - 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) (); - HYPRE_Int (*precond_setup) (); + hypre_KrylovPtrToCAlloc CAlloc; + hypre_KrylovPtrToFree Free; + hypre_KrylovPtrToCommInfo CommInfo; + hypre_KrylovPtrToCreateVector CreateVector; + hypre_KrylovPtrToCreateVectorArray CreateVectorArray; + hypre_KrylovPtrToDestroyVector DestroyVector; + hypre_KrylovPtrToMatvecCreate MatvecCreate; + hypre_KrylovPtrToMatvec Matvec; + hypre_KrylovPtrToMatvecDestroy MatvecDestroy; + hypre_KrylovPtrToInnerProd InnerProd; + hypre_KrylovPtrToCopyVector CopyVector; + hypre_KrylovPtrToClearVector ClearVector; + hypre_KrylovPtrToScaleVector ScaleVector; + hypre_KrylovPtrToAxpy Axpy; + hypre_KrylovPtrToPrecond precond; + hypre_KrylovPtrToPrecondSetup precond_setup; } hypre_LGMRESFunctions; @@ -132,24 +129,22 @@ extern "C" { hypre_LGMRESFunctions * hypre_LGMRESFunctionsCreate( - void * (*CAlloc) ( size_t count, size_t elt_size ), - 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 ) + hypre_KrylovPtrToCAlloc CAlloc, + hypre_KrylovPtrToFree Free, + hypre_KrylovPtrToCommInfo CommInfo, + hypre_KrylovPtrToCreateVector CreateVector, + hypre_KrylovPtrToCreateVectorArray CreateVectorArray, + hypre_KrylovPtrToDestroyVector DestroyVector, + hypre_KrylovPtrToMatvecCreate MatvecCreate, + hypre_KrylovPtrToMatvec Matvec, + hypre_KrylovPtrToMatvecDestroy MatvecDestroy, + hypre_KrylovPtrToInnerProd InnerProd, + hypre_KrylovPtrToCopyVector CopyVector, + hypre_KrylovPtrToClearVector ClearVector, + hypre_KrylovPtrToScaleVector ScaleVector, + hypre_KrylovPtrToAxpy Axpy, + hypre_KrylovPtrToPrecondSetup PrecondSetup, + hypre_KrylovPtrToPrecond Precond ); /** @@ -158,9 +153,6 @@ hypre_LGMRESFunctionsCreate( * @param param [IN] ... **/ -void * -hypre_LGMRESCreate( hypre_LGMRESFunctions *lgmres_functions ); - #ifdef __cplusplus } #endif diff --git a/src/krylov/lobpcg.c b/src/krylov/lobpcg.c index 5b5f807ab0..a68c3bfd30 100644 --- a/src/krylov/lobpcg.c +++ b/src/krylov/lobpcg.c @@ -16,9 +16,23 @@ #include #include -#include "lobpcg.h" -#include "fortran_matrix.h" -#include "multivector.h" +#include "_hypre_lobpcg.h" +#include "_hypre_lapack.h" + +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) +{ + 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) +{ + hypre_dpotrf(uplo, n, a, lda, info); + return 0; +} static HYPRE_Int lobpcg_chol( utilities_FortranMatrix* a, @@ -83,21 +97,6 @@ lobpcg_solveGEVP( } - -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 ) ); -} - static void lobpcg_MultiVectorByMatrix( mv_MultiVectorPtr x, @@ -1081,3 +1080,424 @@ lobpcg_solve( mv_MultiVectorPtr blockVectorX, return exitFlag; } + +HYPRE_Int +lobpcg_initialize( lobpcg_Data* data ) +{ + (data->tolerance).absolute = 1.0e-06; + (data->tolerance).relative = 1.0e-06; + (data->maxIterations) = 500; + (data->precondUsageMode) = 0; + (data->verbosityLevel) = 0; + (data->eigenvaluesHistory) = utilities_FortranMatrixCreate(); + (data->residualNorms) = utilities_FortranMatrixCreate(); + (data->residualNormsHistory) = utilities_FortranMatrixCreate(); + + return 0; +} + +HYPRE_Int +lobpcg_clean( lobpcg_Data* data ) +{ + utilities_FortranMatrixDestroy( data->eigenvaluesHistory ); + utilities_FortranMatrixDestroy( data->residualNorms ); + utilities_FortranMatrixDestroy( data->residualNormsHistory ); + + return 0; +} + +HYPRE_Int +hypre_LOBPCGDestroy( void *pcg_vdata ) +{ + hypre_LOBPCGData *pcg_data = (hypre_LOBPCGData*)pcg_vdata; + + if (pcg_data) + { + HYPRE_MatvecFunctions * mv = pcg_data->matvecFunctions; + if ( pcg_data->matvecData != NULL ) + { + (*(mv->MatvecDestroy))(pcg_data->matvecData); + pcg_data->matvecData = NULL; + } + if ( pcg_data->matvecDataB != NULL ) + { + (*(mv->MatvecDestroy))(pcg_data->matvecDataB); + pcg_data->matvecDataB = 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); + } + + return hypre_error_flag; +} + +HYPRE_Int +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; + 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 ( 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; +} + +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 ) ); +} + +HYPRE_Int +hypre_LOBPCGSetupB( void *pcg_vdata, void *B, void *x ) +{ + hypre_LOBPCGData *pcg_data = (hypre_LOBPCGData*)pcg_vdata; + HYPRE_MatvecFunctions * mv = pcg_data->matvecFunctions; + + (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; +} + +HYPRE_Int +hypre_LOBPCGSetupT( void *pcg_vdata, void *T, void *x ) +{ + hypre_LOBPCGData *pcg_data = (hypre_LOBPCGData*)pcg_vdata; + HYPRE_MatvecFunctions * mv = pcg_data->matvecFunctions; + + (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; +} + +HYPRE_Int +hypre_LOBPCGSetTol( void* pcg_vdata, HYPRE_Real tol ) +{ + 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; + + 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; + + 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; + + lobpcg_precondUsageMode(pcg_data->lobpcgData) = mode; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_LOBPCGGetPrecond( void *pcg_vdata, + HYPRE_Solver *precond_data_ptr ) +{ + hypre_LOBPCGData* pcg_data = (hypre_LOBPCGData*)pcg_vdata; + + *precond_data_ptr = (HYPRE_Solver)(pcg_data -> precondData); + + return hypre_error_flag; +} + +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_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; +} + +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; +} + +void +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; + + if ( precond == NULL ) + { + (*(ii->CopyVector))(x, y); + return; + } + + if ( lobpcg_precondUsageMode(data->lobpcgData) == 0 ) + { + (*(ii->ClearVector))(y); + } + else + { + (*(ii->CopyVector))(x, y); + } + + if ( data->T == NULL ) + { + precond(data->precondData, data->A, x, y); + } + else + { + precond(data->precondData, data->T, x, y); + } +} + +void +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); + + (*(mv->Matvec))(matvec_data, 1.0, pcg_data->A, x, 0.0, y); +} + +void +hypre_LOBPCGOperatorB( void *pcg_vdata, void* x, void* y ) +{ + hypre_LOBPCGData* pcg_data = (hypre_LOBPCGData*)pcg_vdata; + mv_InterfaceInterpreter* ii = pcg_data->interpreter; + HYPRE_MatvecFunctions * mv = pcg_data->matvecFunctions; + void* matvec_data = (pcg_data -> matvecDataB); + + if ( pcg_data->B == NULL ) + { + (*(ii->CopyVector))(x, y); + + /* a test */ + /* + (*(ii->ScaleVector))(2.0, y); + */ + + return; + } + + (*(mv->Matvec))(matvec_data, 1.0, pcg_data->B, x, 0.0, y); +} + +void +hypre_LOBPCGMultiPreconditioner( void *data, void * x, void* y ) +{ + hypre_LOBPCGData *pcg_data = (hypre_LOBPCGData*)data; + mv_InterfaceInterpreter* ii = pcg_data->interpreter; + + ii->Eval( hypre_LOBPCGPreconditioner, data, x, y ); +} + +void +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 ); +} + +void +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_LOBPCGData* data = (hypre_LOBPCGData*)vdata; + 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* ); + + HYPRE_Int maxit = lobpcg_maxIterations(data->lobpcgData); + HYPRE_Int verb = lobpcg_verbosityLevel(data->lobpcgData); + + HYPRE_Int n = mv_MultiVectorWidth( vec ); + lobpcg_BLASLAPACKFunctions blap_fn; + + utilities_FortranMatrix* lambdaHistory; + utilities_FortranMatrix* residuals; + utilities_FortranMatrix* residualsHistory; + + 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 ); + + 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, + vdata, operatorB, + vdata, prec, + con, + blap_fn, + lobpcg_tolerance(data->lobpcgData), maxit, verb, + &(lobpcg_iterationNumber(data->lobpcgData)), + val, + utilities_FortranMatrixValues(lambdaHistory), + utilities_FortranMatrixGlobalHeight(lambdaHistory), + utilities_FortranMatrixValues(residuals), + utilities_FortranMatrixValues(residualsHistory), + utilities_FortranMatrixGlobalHeight(residualsHistory) + ); + + return hypre_error_flag; +} + +utilities_FortranMatrix* +hypre_LOBPCGResidualNorms( void *vdata ) +{ + hypre_LOBPCGData *data = (hypre_LOBPCGData*)vdata; + return (lobpcg_residualNorms(data->lobpcgData)); +} + +utilities_FortranMatrix* +hypre_LOBPCGResidualNormsHistory( void *vdata ) +{ + hypre_LOBPCGData *data = (hypre_LOBPCGData*)vdata; + return (lobpcg_residualNormsHistory(data->lobpcgData)); +} + +utilities_FortranMatrix* +hypre_LOBPCGEigenvaluesHistory( void *vdata ) +{ + hypre_LOBPCGData *data = (hypre_LOBPCGData*)vdata; + return (lobpcg_eigenvaluesHistory(data->lobpcgData)); +} + +HYPRE_Int +hypre_LOBPCGIterations( void* vdata ) +{ + hypre_LOBPCGData *data = (hypre_LOBPCGData*)vdata; + return (lobpcg_iterationNumber(data->lobpcgData)); +} diff --git a/src/krylov/lobpcg.h b/src/krylov/lobpcg.h deleted file mode 100644 index 74fba25619..0000000000 --- a/src/krylov/lobpcg.h +++ /dev/null @@ -1,90 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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 "multivector.h" -#include "_hypre_utilities.h" - -#ifndef LOCALLY_OPTIMAL_BLOCK_PRECONDITIONED_CONJUGATE_GRADIENTS -#define LOCALLY_OPTIMAL_BLOCK_PRECONDITIONED_CONJUGATE_GRADIENTS - -#ifdef __cplusplus -extern "C" { -#endif - -#define PROBLEM_SIZE_TOO_SMALL 1 -#define WRONG_BLOCK_SIZE 2 -#define WRONG_CONSTRAINTS 3 -#define REQUESTED_ACCURACY_NOT_ACHIEVED -1 - -typedef struct -{ - - HYPRE_Real absolute; - HYPRE_Real relative; - -} lobpcg_Tolerance; - -typedef struct -{ - - /* 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); - 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); - -} 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, - lobpcg_BLASLAPACKFunctions blap_fn, - 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" */ - 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 */ - HYPRE_Real * lambdaHistory_values, - - /* 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 */ - 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, - - /* global height of the matrix (stored in fotran-style) specified by previous argument */ - HYPRE_BigInt residualNormsHistory_gh - - ); - -#ifdef __cplusplus -} -#endif - -#endif /* LOCALLY_OPTIMAL_BLOCK_PRECONDITIONED_CONJUGATE_GRADIENTS */ diff --git a/src/krylov/mup.fixed b/src/krylov/mup.fixed new file mode 100644 index 0000000000..1e73848577 --- /dev/null +++ b/src/krylov/mup.fixed @@ -0,0 +1,244 @@ +hypre_BiCGSTABCreate +hypre_BiCGSTABDestroy +hypre_BiCGSTABFunctionsCreate +hypre_BiCGSTABGetConverged +hypre_BiCGSTABGetFinalRelativeResidualNorm +hypre_BiCGSTABGetNumIterations +hypre_BiCGSTABGetPrecond +hypre_BiCGSTABGetPrecondMatrix +hypre_BiCGSTABGetResidual +hypre_BiCGSTABSetAbsoluteTol +hypre_BiCGSTABSetConvergenceFactorTol +hypre_BiCGSTABSetHybrid +hypre_BiCGSTABSetLogging +hypre_BiCGSTABSetMaxIter +hypre_BiCGSTABSetMinIter +hypre_BiCGSTABSetPrecond +hypre_BiCGSTABSetPrecondMatrix +hypre_BiCGSTABSetPrintLevel +hypre_BiCGSTABSetStopCrit +hypre_BiCGSTABSetTol +hypre_BiCGSTABSetup +hypre_BiCGSTABSolve +hypre_CGNRCreate +hypre_CGNRDestroy +hypre_CGNRFunctionsCreate +hypre_CGNRGetFinalRelativeResidualNorm +hypre_CGNRGetNumIterations +hypre_CGNRGetPrecond +hypre_CGNRSetLogging +hypre_CGNRSetMaxIter +hypre_CGNRSetMinIter +hypre_CGNRSetPrecond +hypre_CGNRSetStopCrit +hypre_CGNRSetTol +hypre_CGNRSetup +hypre_CGNRSolve +hypre_COGMRESCreate +hypre_COGMRESDestroy +hypre_COGMRESFunctionsCreate +hypre_COGMRESGetAbsoluteTol +hypre_COGMRESGetCGS +hypre_COGMRESGetConverged +hypre_COGMRESGetConvergenceFactorTol +hypre_COGMRESGetFinalRelativeResidualNorm +hypre_COGMRESGetKDim +hypre_COGMRESGetLogging +hypre_COGMRESGetMaxIter +hypre_COGMRESGetMinIter +hypre_COGMRESGetNumIterations +hypre_COGMRESGetPrecond +hypre_COGMRESGetPrintLevel +hypre_COGMRESGetRelChange +hypre_COGMRESGetResidual +hypre_COGMRESGetSkipRealResidualCheck +hypre_COGMRESGetTol +hypre_COGMRESGetUnroll +hypre_COGMRESSetAbsoluteTol +hypre_COGMRESSetCGS +hypre_COGMRESSetConvergenceFactorTol +hypre_COGMRESSetKDim +hypre_COGMRESSetLogging +hypre_COGMRESSetMaxIter +hypre_COGMRESSetMinIter +hypre_COGMRESSetModifyPC +hypre_COGMRESSetPrecond +hypre_COGMRESSetPrintLevel +hypre_COGMRESSetRelChange +hypre_COGMRESSetSkipRealResidualCheck +hypre_COGMRESSetTol +hypre_COGMRESSetUnroll +hypre_COGMRESSetup +hypre_COGMRESSolve +hypre_FlexGMRESCreate +hypre_FlexGMRESDestroy +hypre_FlexGMRESFunctionsCreate +hypre_FlexGMRESGetAbsoluteTol +hypre_FlexGMRESGetConverged +hypre_FlexGMRESGetConvergenceFactorTol +hypre_FlexGMRESGetFinalRelativeResidualNorm +hypre_FlexGMRESGetKDim +hypre_FlexGMRESGetLogging +hypre_FlexGMRESGetMaxIter +hypre_FlexGMRESGetMinIter +hypre_FlexGMRESGetNumIterations +hypre_FlexGMRESGetPrecond +hypre_FlexGMRESGetPrintLevel +hypre_FlexGMRESGetResidual +hypre_FlexGMRESGetStopCrit +hypre_FlexGMRESGetTol +hypre_FlexGMRESModifyPCDefault +hypre_FlexGMRESSetAbsoluteTol +hypre_FlexGMRESSetConvergenceFactorTol +hypre_FlexGMRESSetKDim +hypre_FlexGMRESSetLogging +hypre_FlexGMRESSetMaxIter +hypre_FlexGMRESSetMinIter +hypre_FlexGMRESSetModifyPC +hypre_FlexGMRESSetPrecond +hypre_FlexGMRESSetPrintLevel +hypre_FlexGMRESSetStopCrit +hypre_FlexGMRESSetTol +hypre_FlexGMRESSetup +hypre_FlexGMRESSolve +hypre_GMRESCreate +hypre_GMRESDestroy +hypre_GMRESFunctionsCreate +hypre_GMRESGetAbsoluteTol +hypre_GMRESGetConverged +hypre_GMRESGetConvergenceFactorTol +hypre_GMRESGetFinalRelativeResidualNorm +hypre_GMRESGetKDim +hypre_GMRESGetLogging +hypre_GMRESGetMaxIter +hypre_GMRESGetMinIter +hypre_GMRESGetNumIterations +hypre_GMRESGetPrecond +hypre_GMRESGetPrecondMatrix +hypre_GMRESGetPrintLevel +hypre_GMRESGetRefSolution +hypre_GMRESGetRelChange +hypre_GMRESGetResidual +hypre_GMRESGetSkipRealResidualCheck +hypre_GMRESGetStopCrit +hypre_GMRESGetTol +hypre_GMRESSetAbsoluteTol +hypre_GMRESSetConvergenceFactorTol +hypre_GMRESSetHybrid +hypre_GMRESSetKDim +hypre_GMRESSetLogging +hypre_GMRESSetMaxIter +hypre_GMRESSetMinIter +hypre_GMRESSetPrecond +hypre_GMRESSetPrecondMatrix +hypre_GMRESSetPrintLevel +hypre_GMRESSetRefSolution +hypre_GMRESSetRelChange +hypre_GMRESSetSkipRealResidualCheck +hypre_GMRESSetStopCrit +hypre_GMRESSetTol +hypre_GMRESSetup +hypre_GMRESSolve +hypre_LGMRESCreate +hypre_LGMRESDestroy +hypre_LGMRESFunctionsCreate +hypre_LGMRESGetAbsoluteTol +hypre_LGMRESGetAugDim +hypre_LGMRESGetConverged +hypre_LGMRESGetConvergenceFactorTol +hypre_LGMRESGetFinalRelativeResidualNorm +hypre_LGMRESGetKDim +hypre_LGMRESGetLogging +hypre_LGMRESGetMaxIter +hypre_LGMRESGetMinIter +hypre_LGMRESGetNumIterations +hypre_LGMRESGetPrecond +hypre_LGMRESGetPrintLevel +hypre_LGMRESGetResidual +hypre_LGMRESGetStopCrit +hypre_LGMRESGetTol +hypre_LGMRESSetAbsoluteTol +hypre_LGMRESSetAugDim +hypre_LGMRESSetConvergenceFactorTol +hypre_LGMRESSetKDim +hypre_LGMRESSetLogging +hypre_LGMRESSetMaxIter +hypre_LGMRESSetMinIter +hypre_LGMRESSetPrecond +hypre_LGMRESSetPrintLevel +hypre_LGMRESSetStopCrit +hypre_LGMRESSetTol +hypre_LGMRESSetup +hypre_LGMRESSolve +hypre_LOBPCGDestroy +hypre_LOBPCGEigenvaluesHistory +hypre_LOBPCGGetPrecond +hypre_LOBPCGIterations +hypre_LOBPCGMultiOperatorA +hypre_LOBPCGMultiOperatorB +hypre_LOBPCGMultiPreconditioner +hypre_LOBPCGOperatorA +hypre_LOBPCGOperatorB +hypre_LOBPCGPreconditioner +hypre_LOBPCGResidualNorms +hypre_LOBPCGResidualNormsHistory +hypre_LOBPCGSetMaxIter +hypre_LOBPCGSetPrecond +hypre_LOBPCGSetPrecondUsageMode +hypre_LOBPCGSetPrintLevel +hypre_LOBPCGSetRTol +hypre_LOBPCGSetTol +hypre_LOBPCGSetup +hypre_LOBPCGSetupB +hypre_LOBPCGSetupT +hypre_LOBPCGSolve +hypre_PCGCreate +hypre_PCGDestroy +hypre_PCGFunctionsCreate +hypre_PCGGetAbsoluteTol +hypre_PCGGetAbsoluteTolFactor +hypre_PCGGetConverged +hypre_PCGGetConvergenceFactorTol +hypre_PCGGetFinalRelativeResidualNorm +hypre_PCGGetFlex +hypre_PCGGetLogging +hypre_PCGGetMaxIter +hypre_PCGGetNumIterations +hypre_PCGGetPrecond +hypre_PCGGetPrecondMatrix +hypre_PCGGetPrintLevel +hypre_PCGGetRecomputeResidual +hypre_PCGGetRecomputeResidualP +hypre_PCGGetRelChange +hypre_PCGGetResidual +hypre_PCGGetResidualTol +hypre_PCGGetSkipBreak +hypre_PCGGetStopCrit +hypre_PCGGetTol +hypre_PCGGetTwoNorm +hypre_PCGPrintLogging +hypre_PCGSetAbsoluteTol +hypre_PCGSetAbsoluteTolFactor +hypre_PCGSetConvergenceFactorTol +hypre_PCGSetFlex +hypre_PCGSetHybrid +hypre_PCGSetLogging +hypre_PCGSetMaxIter +hypre_PCGSetPrecond +hypre_PCGSetPrecondMatrix +hypre_PCGSetPreconditioner +hypre_PCGSetPrintLevel +hypre_PCGSetRecomputeResidual +hypre_PCGSetRecomputeResidualP +hypre_PCGSetRelChange +hypre_PCGSetResidualTol +hypre_PCGSetSkipBreak +hypre_PCGSetStopCrit +hypre_PCGSetTol +hypre_PCGSetTwoNorm +hypre_PCGSetup +hypre_PCGSolve +lobpcg_MultiVectorByMultiVector +lobpcg_clean +lobpcg_initialize +lobpcg_solve diff --git a/src/krylov/mup.functions b/src/krylov/mup.functions new file mode 100644 index 0000000000..816b145fdf --- /dev/null +++ b/src/krylov/mup.functions @@ -0,0 +1,202 @@ +HYPRE_BiCGSTABDestroy +HYPRE_BiCGSTABGetFinalRelativeResidualNorm +HYPRE_BiCGSTABGetNumIterations +HYPRE_BiCGSTABGetPrecond +HYPRE_BiCGSTABGetPrecondMatrix +HYPRE_BiCGSTABGetResidual +HYPRE_BiCGSTABSetAbsoluteTol +HYPRE_BiCGSTABSetConvergenceFactorTol +HYPRE_BiCGSTABSetLogging +HYPRE_BiCGSTABSetMaxIter +HYPRE_BiCGSTABSetMinIter +HYPRE_BiCGSTABSetPrecond +HYPRE_BiCGSTABSetPrecondMatrix +HYPRE_BiCGSTABSetPrintLevel +HYPRE_BiCGSTABSetStopCrit +HYPRE_BiCGSTABSetTol +HYPRE_BiCGSTABSetup +HYPRE_BiCGSTABSolve +HYPRE_CGNRDestroy +HYPRE_CGNRGetFinalRelativeResidualNorm +HYPRE_CGNRGetNumIterations +HYPRE_CGNRGetPrecond +HYPRE_CGNRSetLogging +HYPRE_CGNRSetMaxIter +HYPRE_CGNRSetMinIter +HYPRE_CGNRSetPrecond +HYPRE_CGNRSetStopCrit +HYPRE_CGNRSetTol +HYPRE_CGNRSetup +HYPRE_CGNRSolve +HYPRE_COGMRESGetAbsoluteTol +HYPRE_COGMRESGetCGS +HYPRE_COGMRESGetConverged +HYPRE_COGMRESGetConvergenceFactorTol +HYPRE_COGMRESGetFinalRelativeResidualNorm +HYPRE_COGMRESGetKDim +HYPRE_COGMRESGetLogging +HYPRE_COGMRESGetMaxIter +HYPRE_COGMRESGetMinIter +HYPRE_COGMRESGetNumIterations +HYPRE_COGMRESGetPrecond +HYPRE_COGMRESGetPrintLevel +HYPRE_COGMRESGetResidual +HYPRE_COGMRESGetTol +HYPRE_COGMRESGetUnroll +HYPRE_COGMRESSetAbsoluteTol +HYPRE_COGMRESSetCGS +HYPRE_COGMRESSetConvergenceFactorTol +HYPRE_COGMRESSetKDim +HYPRE_COGMRESSetLogging +HYPRE_COGMRESSetMaxIter +HYPRE_COGMRESSetMinIter +HYPRE_COGMRESSetModifyPC +HYPRE_COGMRESSetPrecond +HYPRE_COGMRESSetPrintLevel +HYPRE_COGMRESSetTol +HYPRE_COGMRESSetUnroll +HYPRE_COGMRESSetup +HYPRE_COGMRESSolve +HYPRE_FlexGMRESGetAbsoluteTol +HYPRE_FlexGMRESGetConverged +HYPRE_FlexGMRESGetConvergenceFactorTol +HYPRE_FlexGMRESGetFinalRelativeResidualNorm +HYPRE_FlexGMRESGetKDim +HYPRE_FlexGMRESGetLogging +HYPRE_FlexGMRESGetMaxIter +HYPRE_FlexGMRESGetMinIter +HYPRE_FlexGMRESGetNumIterations +HYPRE_FlexGMRESGetPrecond +HYPRE_FlexGMRESGetPrintLevel +HYPRE_FlexGMRESGetResidual +HYPRE_FlexGMRESGetTol +HYPRE_FlexGMRESSetAbsoluteTol +HYPRE_FlexGMRESSetConvergenceFactorTol +HYPRE_FlexGMRESSetKDim +HYPRE_FlexGMRESSetLogging +HYPRE_FlexGMRESSetMaxIter +HYPRE_FlexGMRESSetMinIter +HYPRE_FlexGMRESSetModifyPC +HYPRE_FlexGMRESSetPrecond +HYPRE_FlexGMRESSetPrintLevel +HYPRE_FlexGMRESSetTol +HYPRE_FlexGMRESSetup +HYPRE_FlexGMRESSolve +HYPRE_GMRESGetAbsoluteTol +HYPRE_GMRESGetConverged +HYPRE_GMRESGetConvergenceFactorTol +HYPRE_GMRESGetFinalRelativeResidualNorm +HYPRE_GMRESGetKDim +HYPRE_GMRESGetLogging +HYPRE_GMRESGetMaxIter +HYPRE_GMRESGetMinIter +HYPRE_GMRESGetNumIterations +HYPRE_GMRESGetPrecond +HYPRE_GMRESGetPrecondMatrix +HYPRE_GMRESGetPrintLevel +HYPRE_GMRESGetRefSolution +HYPRE_GMRESGetRelChange +HYPRE_GMRESGetResidual +HYPRE_GMRESGetSkipRealResidualCheck +HYPRE_GMRESGetStopCrit +HYPRE_GMRESGetTol +HYPRE_GMRESSetAbsoluteTol +HYPRE_GMRESSetConvergenceFactorTol +HYPRE_GMRESSetKDim +HYPRE_GMRESSetLogging +HYPRE_GMRESSetMaxIter +HYPRE_GMRESSetMinIter +HYPRE_GMRESSetPrecond +HYPRE_GMRESSetPrecondMatrix +HYPRE_GMRESSetPrintLevel +HYPRE_GMRESSetRefSolution +HYPRE_GMRESSetRelChange +HYPRE_GMRESSetSkipRealResidualCheck +HYPRE_GMRESSetStopCrit +HYPRE_GMRESSetTol +HYPRE_GMRESSetup +HYPRE_GMRESSolve +HYPRE_LGMRESGetAbsoluteTol +HYPRE_LGMRESGetAugDim +HYPRE_LGMRESGetConverged +HYPRE_LGMRESGetConvergenceFactorTol +HYPRE_LGMRESGetFinalRelativeResidualNorm +HYPRE_LGMRESGetKDim +HYPRE_LGMRESGetLogging +HYPRE_LGMRESGetMaxIter +HYPRE_LGMRESGetMinIter +HYPRE_LGMRESGetNumIterations +HYPRE_LGMRESGetPrecond +HYPRE_LGMRESGetPrintLevel +HYPRE_LGMRESGetResidual +HYPRE_LGMRESGetTol +HYPRE_LGMRESSetAbsoluteTol +HYPRE_LGMRESSetAugDim +HYPRE_LGMRESSetConvergenceFactorTol +HYPRE_LGMRESSetKDim +HYPRE_LGMRESSetLogging +HYPRE_LGMRESSetMaxIter +HYPRE_LGMRESSetMinIter +HYPRE_LGMRESSetPrecond +HYPRE_LGMRESSetPrintLevel +HYPRE_LGMRESSetTol +HYPRE_LGMRESSetup +HYPRE_LGMRESSolve +HYPRE_LOBPCGCreate +HYPRE_LOBPCGDestroy +HYPRE_LOBPCGEigenvaluesHistory +HYPRE_LOBPCGGetPrecond +HYPRE_LOBPCGIterations +HYPRE_LOBPCGResidualNorms +HYPRE_LOBPCGResidualNormsHistory +HYPRE_LOBPCGSetMaxIter +HYPRE_LOBPCGSetPrecond +HYPRE_LOBPCGSetPrecondUsageMode +HYPRE_LOBPCGSetPrintLevel +HYPRE_LOBPCGSetRTol +HYPRE_LOBPCGSetTol +HYPRE_LOBPCGSetup +HYPRE_LOBPCGSetupB +HYPRE_LOBPCGSetupT +HYPRE_LOBPCGSolve +HYPRE_PCGGetAbsoluteTol +HYPRE_PCGGetAbsoluteTolFactor +HYPRE_PCGGetConverged +HYPRE_PCGGetConvergenceFactorTol +HYPRE_PCGGetFinalRelativeResidualNorm +HYPRE_PCGGetFlex +HYPRE_PCGGetLogging +HYPRE_PCGGetMaxIter +HYPRE_PCGGetNumIterations +HYPRE_PCGGetPrecond +HYPRE_PCGGetPrecondMatrix +HYPRE_PCGGetPrintLevel +HYPRE_PCGGetRecomputeResidual +HYPRE_PCGGetRecomputeResidualP +HYPRE_PCGGetRelChange +HYPRE_PCGGetResidual +HYPRE_PCGGetResidualTol +HYPRE_PCGGetSkipBreak +HYPRE_PCGGetStopCrit +HYPRE_PCGGetTol +HYPRE_PCGGetTwoNorm +HYPRE_PCGSetAbsoluteTol +HYPRE_PCGSetAbsoluteTolFactor +HYPRE_PCGSetConvergenceFactorTol +HYPRE_PCGSetFlex +HYPRE_PCGSetLogging +HYPRE_PCGSetMaxIter +HYPRE_PCGSetPrecond +HYPRE_PCGSetPrecondMatrix +HYPRE_PCGSetPreconditioner +HYPRE_PCGSetPrintLevel +HYPRE_PCGSetRecomputeResidual +HYPRE_PCGSetRecomputeResidualP +HYPRE_PCGSetRelChange +HYPRE_PCGSetResidualTol +HYPRE_PCGSetSkipBreak +HYPRE_PCGSetStopCrit +HYPRE_PCGSetTol +HYPRE_PCGSetTwoNorm +HYPRE_PCGSetup +HYPRE_PCGSolve diff --git a/src/krylov/mup.methods b/src/krylov/mup.methods new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/krylov/mup_code b/src/krylov/mup_code new file mode 100755 index 0000000000..1f4659268d --- /dev/null +++ b/src/krylov/mup_code @@ -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) + +../config/gen_code.sh HYPRE_krylov.h _hypre_krylov.h mup +../config/gen_code.sh HYPRE_lobpcg.h _hypre_lobpcg.h mup_lobpcg + +# remove duplicate files +rm -f _hypre_lobpcg_mup_def.h +rm -f _hypre_lobpcg_mup_undef.h diff --git a/src/krylov/mup_fixed.c b/src/krylov/mup_fixed.c new file mode 100644 index 0000000000..c4bc74a5b3 --- /dev/null +++ b/src/krylov/mup_fixed.c @@ -0,0 +1,1763 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_krylov.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + + + +/*--------------------------------------------------------------------------*/ + +void * +hypre_BiCGSTABCreate( hypre_BiCGSTABFunctions *bicgstab_functions ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BiCGSTABCreate)( bicgstab_functions ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BiCGSTABDestroy( void *bicgstab_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BiCGSTABDestroy)( bicgstab_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_BiCGSTABFunctions * +hypre_BiCGSTABFunctionsCreate( hypre_KrylovPtrToCreateVector CreateVector, hypre_KrylovPtrToDestroyVector DestroyVector, hypre_KrylovPtrToMatvecCreate MatvecCreate, hypre_KrylovPtrToMatvec Matvec, hypre_KrylovPtrToMatvecDestroy MatvecDestroy, hypre_KrylovPtrToInnerProd InnerProd, hypre_KrylovPtrToCopyVector CopyVector, hypre_KrylovPtrToClearVector ClearVector, hypre_KrylovPtrToScaleVector ScaleVector, hypre_KrylovPtrToAxpy Axpy, hypre_KrylovPtrToCommInfo CommInfo, hypre_KrylovPtrToPrecond Precond, hypre_KrylovPtrToPrecondSetup PrecondSetup ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BiCGSTABFunctionsCreate)( CreateVector, DestroyVector, MatvecCreate, Matvec, MatvecDestroy, InnerProd, CopyVector, ClearVector, ScaleVector, Axpy, CommInfo, Precond, PrecondSetup ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BiCGSTABGetConverged( void *bicgstab_vdata, HYPRE_Int *converged ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BiCGSTABGetConverged)( bicgstab_vdata, converged ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BiCGSTABGetFinalRelativeResidualNorm( void *bicgstab_vdata, HYPRE_Real *relative_residual_norm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BiCGSTABGetFinalRelativeResidualNorm)( bicgstab_vdata, relative_residual_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BiCGSTABGetNumIterations( void *bicgstab_vdata, HYPRE_Int *num_iterations ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BiCGSTABGetNumIterations)( bicgstab_vdata, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BiCGSTABGetPrecond( void *bicgstab_vdata, HYPRE_Solver *precond_data_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BiCGSTABGetPrecond)( bicgstab_vdata, precond_data_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BiCGSTABGetPrecondMatrix( void *bicgstab_vdata, HYPRE_Matrix *precond_matrix_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BiCGSTABGetPrecondMatrix)( bicgstab_vdata, precond_matrix_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BiCGSTABGetResidual( void *bicgstab_vdata, void **residual ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BiCGSTABGetResidual)( bicgstab_vdata, residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BiCGSTABSetAbsoluteTol( void *bicgstab_vdata, HYPRE_Real a_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BiCGSTABSetAbsoluteTol)( bicgstab_vdata, a_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BiCGSTABSetConvergenceFactorTol( void *bicgstab_vdata, HYPRE_Real cf_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BiCGSTABSetConvergenceFactorTol)( bicgstab_vdata, cf_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BiCGSTABSetHybrid( void *bicgstab_vdata, HYPRE_Int logging ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BiCGSTABSetHybrid)( bicgstab_vdata, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BiCGSTABSetLogging( void *bicgstab_vdata, HYPRE_Int logging ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BiCGSTABSetLogging)( bicgstab_vdata, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BiCGSTABSetMaxIter( void *bicgstab_vdata, HYPRE_Int max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BiCGSTABSetMaxIter)( bicgstab_vdata, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BiCGSTABSetMinIter( void *bicgstab_vdata, HYPRE_Int min_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BiCGSTABSetMinIter)( bicgstab_vdata, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BiCGSTABSetPrecond( void *bicgstab_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BiCGSTABSetPrecond)( bicgstab_vdata, precond, precond_setup, precond_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BiCGSTABSetPrecondMatrix( void *bicgstab_vdata, void *precond_matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BiCGSTABSetPrecondMatrix)( bicgstab_vdata, precond_matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BiCGSTABSetPrintLevel( void *bicgstab_vdata, HYPRE_Int print_level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BiCGSTABSetPrintLevel)( bicgstab_vdata, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BiCGSTABSetStopCrit( void *bicgstab_vdata, HYPRE_Int stop_crit ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BiCGSTABSetStopCrit)( bicgstab_vdata, stop_crit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BiCGSTABSetTol( void *bicgstab_vdata, HYPRE_Real tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BiCGSTABSetTol)( bicgstab_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BiCGSTABSetup( void *bicgstab_vdata, void *A, void *b, void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BiCGSTABSetup)( bicgstab_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BiCGSTABSolve( void *bicgstab_vdata, void *A, void *b, void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BiCGSTABSolve)( bicgstab_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_CGNRCreate( hypre_CGNRFunctions *cgnr_functions ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CGNRCreate)( cgnr_functions ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CGNRDestroy( void *cgnr_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CGNRDestroy)( cgnr_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_CGNRFunctions * +hypre_CGNRFunctionsCreate( hypre_KrylovPtrToCommInfo CommInfo, hypre_KrylovPtrToCreateVector CreateVector, hypre_KrylovPtrToDestroyVector DestroyVector, hypre_KrylovPtrToMatvecCreate MatvecCreate, hypre_KrylovPtrToMatvec Matvec, hypre_KrylovPtrToMatvecT MatvecT, hypre_KrylovPtrToMatvecDestroy MatvecDestroy, hypre_KrylovPtrToInnerProd InnerProd, hypre_KrylovPtrToCopyVector CopyVector, hypre_KrylovPtrToClearVector ClearVector, hypre_KrylovPtrToScaleVector ScaleVector, hypre_KrylovPtrToAxpy Axpy, hypre_KrylovPtrToPrecondSetup PrecondSetup, hypre_KrylovPtrToPrecond Precond, hypre_KrylovPtrToPrecondT PrecondT ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CGNRFunctionsCreate)( CommInfo, CreateVector, DestroyVector, MatvecCreate, Matvec, MatvecT, MatvecDestroy, InnerProd, CopyVector, ClearVector, ScaleVector, Axpy, PrecondSetup, Precond, PrecondT ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CGNRGetFinalRelativeResidualNorm( void *cgnr_vdata, HYPRE_Real *relative_residual_norm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CGNRGetFinalRelativeResidualNorm)( cgnr_vdata, relative_residual_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CGNRGetNumIterations( void *cgnr_vdata, HYPRE_Int *num_iterations ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CGNRGetNumIterations)( cgnr_vdata, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CGNRGetPrecond( void *cgnr_vdata, HYPRE_Solver *precond_data_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CGNRGetPrecond)( cgnr_vdata, precond_data_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CGNRSetLogging( void *cgnr_vdata, HYPRE_Int logging ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CGNRSetLogging)( cgnr_vdata, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CGNRSetMaxIter( void *cgnr_vdata, HYPRE_Int max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CGNRSetMaxIter)( cgnr_vdata, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CGNRSetMinIter( void *cgnr_vdata, HYPRE_Int min_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CGNRSetMinIter)( cgnr_vdata, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CGNRSetPrecond( void *cgnr_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondT precondT, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CGNRSetPrecond)( cgnr_vdata, precond, precondT, precond_setup, precond_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CGNRSetStopCrit( void *cgnr_vdata, HYPRE_Int stop_crit ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CGNRSetStopCrit)( cgnr_vdata, stop_crit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CGNRSetTol( void *cgnr_vdata, HYPRE_Real tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CGNRSetTol)( cgnr_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CGNRSetup( void *cgnr_vdata, void *A, void *b, void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CGNRSetup)( cgnr_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CGNRSolve( void *cgnr_vdata, void *A, void *b, void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CGNRSolve)( cgnr_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_COGMRESCreate( hypre_COGMRESFunctions *gmres_functions ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESCreate)( gmres_functions ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESDestroy( void *gmres_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESDestroy)( gmres_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_COGMRESFunctions * +hypre_COGMRESFunctionsCreate( hypre_KrylovPtrToCAlloc CAlloc, hypre_KrylovPtrToFree Free, hypre_KrylovPtrToCommInfo CommInfo, hypre_KrylovPtrToCreateVector CreateVector, hypre_KrylovPtrToCreateVectorArray CreateVectorArray, hypre_KrylovPtrToDestroyVector DestroyVector, hypre_KrylovPtrToMatvecCreate MatvecCreate, hypre_KrylovPtrToMatvec Matvec, hypre_KrylovPtrToMatvecDestroy MatvecDestroy, hypre_KrylovPtrToInnerProd InnerProd, hypre_KrylovPtrToMassInnerProd MassInnerProd, hypre_KrylovPtrToMassDotpTwo MassDotpTwo, hypre_KrylovPtrToCopyVector CopyVector, hypre_KrylovPtrToClearVector ClearVector, hypre_KrylovPtrToScaleVector ScaleVector, hypre_KrylovPtrToAxpy Axpy, hypre_KrylovPtrToMassAxpy MassAxpy, hypre_KrylovPtrToPrecondSetup PrecondSetup, hypre_KrylovPtrToPrecond Precond ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESFunctionsCreate)( CAlloc, Free, CommInfo, CreateVector, CreateVectorArray, DestroyVector, MatvecCreate, Matvec, MatvecDestroy, InnerProd, MassInnerProd, MassDotpTwo, CopyVector, ClearVector, ScaleVector, Axpy, MassAxpy, PrecondSetup, Precond ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESGetAbsoluteTol( void *gmres_vdata, HYPRE_Real *a_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESGetAbsoluteTol)( gmres_vdata, a_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESGetCGS( void *gmres_vdata, HYPRE_Int *cgs ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESGetCGS)( gmres_vdata, cgs ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESGetConverged( void *gmres_vdata, HYPRE_Int *converged ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESGetConverged)( gmres_vdata, converged ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESGetConvergenceFactorTol( void *gmres_vdata, HYPRE_Real *cf_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESGetConvergenceFactorTol)( gmres_vdata, cf_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESGetFinalRelativeResidualNorm( void *gmres_vdata, HYPRE_Real *relative_residual_norm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESGetFinalRelativeResidualNorm)( gmres_vdata, relative_residual_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESGetKDim( void *gmres_vdata, HYPRE_Int *k_dim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESGetKDim)( gmres_vdata, k_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESGetLogging( void *gmres_vdata, HYPRE_Int *level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESGetLogging)( gmres_vdata, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESGetMaxIter( void *gmres_vdata, HYPRE_Int *max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESGetMaxIter)( gmres_vdata, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESGetMinIter( void *gmres_vdata, HYPRE_Int *min_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESGetMinIter)( gmres_vdata, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESGetNumIterations( void *gmres_vdata, HYPRE_Int *num_iterations ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESGetNumIterations)( gmres_vdata, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESGetPrecond( void *gmres_vdata, HYPRE_Solver *precond_data_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESGetPrecond)( gmres_vdata, precond_data_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESGetPrintLevel( void *gmres_vdata, HYPRE_Int *level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESGetPrintLevel)( gmres_vdata, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESGetRelChange( void *gmres_vdata, HYPRE_Int *rel_change ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESGetRelChange)( gmres_vdata, rel_change ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESGetResidual( void *gmres_vdata, void **residual ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESGetResidual)( gmres_vdata, residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESGetSkipRealResidualCheck( void *gmres_vdata, HYPRE_Int *skip_real_r_check ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESGetSkipRealResidualCheck)( gmres_vdata, skip_real_r_check ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESGetTol( void *gmres_vdata, HYPRE_Real *tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESGetTol)( gmres_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESGetUnroll( void *gmres_vdata, HYPRE_Int *unroll ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESGetUnroll)( gmres_vdata, unroll ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESSetAbsoluteTol( void *gmres_vdata, HYPRE_Real a_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESSetAbsoluteTol)( gmres_vdata, a_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESSetCGS( void *gmres_vdata, HYPRE_Int cgs ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESSetCGS)( gmres_vdata, cgs ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESSetConvergenceFactorTol( void *gmres_vdata, HYPRE_Real cf_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESSetConvergenceFactorTol)( gmres_vdata, cf_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESSetKDim( void *gmres_vdata, HYPRE_Int k_dim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESSetKDim)( gmres_vdata, k_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESSetLogging( void *gmres_vdata, HYPRE_Int level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESSetLogging)( gmres_vdata, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESSetMaxIter( void *gmres_vdata, HYPRE_Int max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESSetMaxIter)( gmres_vdata, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESSetMinIter( void *gmres_vdata, HYPRE_Int min_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESSetMinIter)( gmres_vdata, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESSetModifyPC( void *cogmres_vdata, hypre_KrylovPtrToModifyPC modify_pc ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESSetModifyPC)( cogmres_vdata, modify_pc ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESSetPrecond( void *gmres_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESSetPrecond)( gmres_vdata, precond, precond_setup, precond_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESSetPrintLevel( void *gmres_vdata, HYPRE_Int level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESSetPrintLevel)( gmres_vdata, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESSetRelChange( void *gmres_vdata, HYPRE_Int rel_change ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESSetRelChange)( gmres_vdata, rel_change ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESSetSkipRealResidualCheck( void *gmres_vdata, HYPRE_Int skip_real_r_check ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESSetSkipRealResidualCheck)( gmres_vdata, skip_real_r_check ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESSetTol( void *gmres_vdata, HYPRE_Real tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESSetTol)( gmres_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESSetUnroll( void *gmres_vdata, HYPRE_Int unroll ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESSetUnroll)( gmres_vdata, unroll ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESSetup( void *gmres_vdata, void *A, void *b, void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESSetup)( gmres_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_COGMRESSolve( void *gmres_vdata, void *A, void *b, void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_COGMRESSolve)( gmres_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_FlexGMRESCreate( hypre_FlexGMRESFunctions *fgmres_functions ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FlexGMRESCreate)( fgmres_functions ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FlexGMRESDestroy( void *fgmres_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FlexGMRESDestroy)( fgmres_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_FlexGMRESFunctions * +hypre_FlexGMRESFunctionsCreate( hypre_KrylovPtrToCAlloc CAlloc, hypre_KrylovPtrToFree Free, hypre_KrylovPtrToCommInfo CommInfo, hypre_KrylovPtrToCreateVector CreateVector, hypre_KrylovPtrToCreateVectorArray CreateVectorArray, hypre_KrylovPtrToDestroyVector DestroyVector, hypre_KrylovPtrToMatvecCreate MatvecCreate, hypre_KrylovPtrToMatvec Matvec, hypre_KrylovPtrToMatvecDestroy MatvecDestroy, hypre_KrylovPtrToInnerProd InnerProd, hypre_KrylovPtrToCopyVector CopyVector, hypre_KrylovPtrToClearVector ClearVector, hypre_KrylovPtrToScaleVector ScaleVector, hypre_KrylovPtrToAxpy Axpy, hypre_KrylovPtrToPrecondSetup PrecondSetup, hypre_KrylovPtrToPrecond Precond ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FlexGMRESFunctionsCreate)( CAlloc, Free, CommInfo, CreateVector, CreateVectorArray, DestroyVector, MatvecCreate, Matvec, MatvecDestroy, InnerProd, CopyVector, ClearVector, ScaleVector, Axpy, PrecondSetup, Precond ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FlexGMRESGetAbsoluteTol( void *fgmres_vdata, HYPRE_Real *a_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FlexGMRESGetAbsoluteTol)( fgmres_vdata, a_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FlexGMRESGetConverged( void *fgmres_vdata, HYPRE_Int *converged ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FlexGMRESGetConverged)( fgmres_vdata, converged ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FlexGMRESGetConvergenceFactorTol( void *fgmres_vdata, HYPRE_Real *cf_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FlexGMRESGetConvergenceFactorTol)( fgmres_vdata, cf_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FlexGMRESGetFinalRelativeResidualNorm( void *fgmres_vdata, HYPRE_Real *relative_residual_norm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FlexGMRESGetFinalRelativeResidualNorm)( fgmres_vdata, relative_residual_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FlexGMRESGetKDim( void *fgmres_vdata, HYPRE_Int *k_dim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FlexGMRESGetKDim)( fgmres_vdata, k_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FlexGMRESGetLogging( void *fgmres_vdata, HYPRE_Int *level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FlexGMRESGetLogging)( fgmres_vdata, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FlexGMRESGetMaxIter( void *fgmres_vdata, HYPRE_Int *max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FlexGMRESGetMaxIter)( fgmres_vdata, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FlexGMRESGetMinIter( void *fgmres_vdata, HYPRE_Int *min_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FlexGMRESGetMinIter)( fgmres_vdata, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FlexGMRESGetNumIterations( void *fgmres_vdata, HYPRE_Int *num_iterations ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FlexGMRESGetNumIterations)( fgmres_vdata, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FlexGMRESGetPrecond( void *fgmres_vdata, HYPRE_Solver *precond_data_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FlexGMRESGetPrecond)( fgmres_vdata, precond_data_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FlexGMRESGetPrintLevel( void *fgmres_vdata, HYPRE_Int *level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FlexGMRESGetPrintLevel)( fgmres_vdata, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FlexGMRESGetResidual( void *fgmres_vdata, void **residual ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FlexGMRESGetResidual)( fgmres_vdata, residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FlexGMRESGetStopCrit( void *fgmres_vdata, HYPRE_Int *stop_crit ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FlexGMRESGetStopCrit)( fgmres_vdata, stop_crit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FlexGMRESGetTol( void *fgmres_vdata, HYPRE_Real *tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FlexGMRESGetTol)( fgmres_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FlexGMRESModifyPCDefault( void *precond_data, HYPRE_Int iteration, HYPRE_Real rel_residual_norm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FlexGMRESModifyPCDefault)( precond_data, iteration, rel_residual_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FlexGMRESSetAbsoluteTol( void *fgmres_vdata, HYPRE_Real a_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FlexGMRESSetAbsoluteTol)( fgmres_vdata, a_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FlexGMRESSetConvergenceFactorTol( void *fgmres_vdata, HYPRE_Real cf_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FlexGMRESSetConvergenceFactorTol)( fgmres_vdata, cf_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FlexGMRESSetKDim( void *fgmres_vdata, HYPRE_Int k_dim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FlexGMRESSetKDim)( fgmres_vdata, k_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FlexGMRESSetLogging( void *fgmres_vdata, HYPRE_Int level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FlexGMRESSetLogging)( fgmres_vdata, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FlexGMRESSetMaxIter( void *fgmres_vdata, HYPRE_Int max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FlexGMRESSetMaxIter)( fgmres_vdata, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FlexGMRESSetMinIter( void *fgmres_vdata, HYPRE_Int min_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FlexGMRESSetMinIter)( fgmres_vdata, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FlexGMRESSetModifyPC( void *fgmres_vdata, hypre_KrylovPtrToModifyPC modify_pc ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FlexGMRESSetModifyPC)( fgmres_vdata, modify_pc ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FlexGMRESSetPrecond( void *fgmres_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FlexGMRESSetPrecond)( fgmres_vdata, precond, precond_setup, precond_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FlexGMRESSetPrintLevel( void *fgmres_vdata, HYPRE_Int level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FlexGMRESSetPrintLevel)( fgmres_vdata, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FlexGMRESSetStopCrit( void *fgmres_vdata, HYPRE_Int stop_crit ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FlexGMRESSetStopCrit)( fgmres_vdata, stop_crit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FlexGMRESSetTol( void *fgmres_vdata, HYPRE_Real tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FlexGMRESSetTol)( fgmres_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FlexGMRESSetup( void *fgmres_vdata, void *A, void *b, void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FlexGMRESSetup)( fgmres_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FlexGMRESSolve( void *fgmres_vdata, void *A, void *b, void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FlexGMRESSolve)( fgmres_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_GMRESCreate( hypre_GMRESFunctions *gmres_functions ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESCreate)( gmres_functions ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESDestroy( void *gmres_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESDestroy)( gmres_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_GMRESFunctions * +hypre_GMRESFunctionsCreate( hypre_KrylovPtrToCAlloc CAlloc, hypre_KrylovPtrToFree Free, hypre_KrylovPtrToCommInfo CommInfo, hypre_KrylovPtrToCreateVector CreateVector, hypre_KrylovPtrToCreateVectorArray CreateVectorArray, hypre_KrylovPtrToDestroyVector DestroyVector, hypre_KrylovPtrToMatvecCreate MatvecCreate, hypre_KrylovPtrToMatvec Matvec, hypre_KrylovPtrToMatvecDestroy MatvecDestroy, hypre_KrylovPtrToInnerProdTagged InnerProd, hypre_KrylovPtrToCopyVector CopyVector, hypre_KrylovPtrToClearVector ClearVector, hypre_KrylovPtrToScaleVector ScaleVector, hypre_KrylovPtrToAxpy Axpy, hypre_KrylovPtrToPrecond Precond, hypre_KrylovPtrToPrecondSetup PrecondSetup ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESFunctionsCreate)( CAlloc, Free, CommInfo, CreateVector, CreateVectorArray, DestroyVector, MatvecCreate, Matvec, MatvecDestroy, InnerProd, CopyVector, ClearVector, ScaleVector, Axpy, Precond, PrecondSetup ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESGetAbsoluteTol( void *gmres_vdata, HYPRE_Real *a_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESGetAbsoluteTol)( gmres_vdata, a_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESGetConverged( void *gmres_vdata, HYPRE_Int *converged ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESGetConverged)( gmres_vdata, converged ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESGetConvergenceFactorTol( void *gmres_vdata, HYPRE_Real *cf_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESGetConvergenceFactorTol)( gmres_vdata, cf_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESGetFinalRelativeResidualNorm( void *gmres_vdata, HYPRE_Real *relative_residual_norm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESGetFinalRelativeResidualNorm)( gmres_vdata, relative_residual_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESGetKDim( void *gmres_vdata, HYPRE_Int *k_dim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESGetKDim)( gmres_vdata, k_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESGetLogging( void *gmres_vdata, HYPRE_Int *level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESGetLogging)( gmres_vdata, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESGetMaxIter( void *gmres_vdata, HYPRE_Int *max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESGetMaxIter)( gmres_vdata, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESGetMinIter( void *gmres_vdata, HYPRE_Int *min_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESGetMinIter)( gmres_vdata, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESGetNumIterations( void *gmres_vdata, HYPRE_Int *num_iterations ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESGetNumIterations)( gmres_vdata, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESGetPrecond( void *gmres_vdata, HYPRE_Solver *precond_data_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESGetPrecond)( gmres_vdata, precond_data_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESGetPrecondMatrix( void *gmres_vdata, HYPRE_Matrix *precond_matrix_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESGetPrecondMatrix)( gmres_vdata, precond_matrix_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESGetPrintLevel( void *gmres_vdata, HYPRE_Int *level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESGetPrintLevel)( gmres_vdata, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESGetRefSolution( void *gmres_vdata, void **xref ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESGetRefSolution)( gmres_vdata, xref ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESGetRelChange( void *gmres_vdata, HYPRE_Int *rel_change ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESGetRelChange)( gmres_vdata, rel_change ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESGetResidual( void *gmres_vdata, void **residual ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESGetResidual)( gmres_vdata, residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESGetSkipRealResidualCheck( void *gmres_vdata, HYPRE_Int *skip_real_r_check ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESGetSkipRealResidualCheck)( gmres_vdata, skip_real_r_check ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESGetStopCrit( void *gmres_vdata, HYPRE_Int *stop_crit ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESGetStopCrit)( gmres_vdata, stop_crit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESGetTol( void *gmres_vdata, HYPRE_Real *tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESGetTol)( gmres_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESSetAbsoluteTol( void *gmres_vdata, HYPRE_Real a_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESSetAbsoluteTol)( gmres_vdata, a_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESSetConvergenceFactorTol( void *gmres_vdata, HYPRE_Real cf_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESSetConvergenceFactorTol)( gmres_vdata, cf_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESSetHybrid( void *gmres_vdata, HYPRE_Int level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESSetHybrid)( gmres_vdata, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESSetKDim( void *gmres_vdata, HYPRE_Int k_dim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESSetKDim)( gmres_vdata, k_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESSetLogging( void *gmres_vdata, HYPRE_Int level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESSetLogging)( gmres_vdata, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESSetMaxIter( void *gmres_vdata, HYPRE_Int max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESSetMaxIter)( gmres_vdata, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESSetMinIter( void *gmres_vdata, HYPRE_Int min_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESSetMinIter)( gmres_vdata, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESSetPrecond( void *gmres_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESSetPrecond)( gmres_vdata, precond, precond_setup, precond_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESSetPrecondMatrix( void *gmres_vdata, void *precond_matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESSetPrecondMatrix)( gmres_vdata, precond_matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESSetPrintLevel( void *gmres_vdata, HYPRE_Int level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESSetPrintLevel)( gmres_vdata, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESSetRefSolution( void *gmres_vdata, void *xref ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESSetRefSolution)( gmres_vdata, xref ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESSetRelChange( void *gmres_vdata, HYPRE_Int rel_change ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESSetRelChange)( gmres_vdata, rel_change ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESSetSkipRealResidualCheck( void *gmres_vdata, HYPRE_Int skip_real_r_check ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESSetSkipRealResidualCheck)( gmres_vdata, skip_real_r_check ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESSetStopCrit( void *gmres_vdata, HYPRE_Int stop_crit ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESSetStopCrit)( gmres_vdata, stop_crit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESSetTol( void *gmres_vdata, HYPRE_Real tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESSetTol)( gmres_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESSetup( void *gmres_vdata, void *A, void *b, void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESSetup)( gmres_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GMRESSolve( void *gmres_vdata, void *A, void *b, void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GMRESSolve)( gmres_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_LGMRESCreate( hypre_LGMRESFunctions *lgmres_functions ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LGMRESCreate)( lgmres_functions ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LGMRESDestroy( void *lgmres_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LGMRESDestroy)( lgmres_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_LGMRESFunctions * +hypre_LGMRESFunctionsCreate( hypre_KrylovPtrToCAlloc CAlloc, hypre_KrylovPtrToFree Free, hypre_KrylovPtrToCommInfo CommInfo, hypre_KrylovPtrToCreateVector CreateVector, hypre_KrylovPtrToCreateVectorArray CreateVectorArray, hypre_KrylovPtrToDestroyVector DestroyVector, hypre_KrylovPtrToMatvecCreate MatvecCreate, hypre_KrylovPtrToMatvec Matvec, hypre_KrylovPtrToMatvecDestroy MatvecDestroy, hypre_KrylovPtrToInnerProd InnerProd, hypre_KrylovPtrToCopyVector CopyVector, hypre_KrylovPtrToClearVector ClearVector, hypre_KrylovPtrToScaleVector ScaleVector, hypre_KrylovPtrToAxpy Axpy, hypre_KrylovPtrToPrecondSetup PrecondSetup, hypre_KrylovPtrToPrecond Precond ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LGMRESFunctionsCreate)( CAlloc, Free, CommInfo, CreateVector, CreateVectorArray, DestroyVector, MatvecCreate, Matvec, MatvecDestroy, InnerProd, CopyVector, ClearVector, ScaleVector, Axpy, PrecondSetup, Precond ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LGMRESGetAbsoluteTol( void *lgmres_vdata, HYPRE_Real *a_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LGMRESGetAbsoluteTol)( lgmres_vdata, a_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LGMRESGetAugDim( void *lgmres_vdata, HYPRE_Int *aug_dim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LGMRESGetAugDim)( lgmres_vdata, aug_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LGMRESGetConverged( void *lgmres_vdata, HYPRE_Int *converged ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LGMRESGetConverged)( lgmres_vdata, converged ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LGMRESGetConvergenceFactorTol( void *lgmres_vdata, HYPRE_Real *cf_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LGMRESGetConvergenceFactorTol)( lgmres_vdata, cf_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LGMRESGetFinalRelativeResidualNorm( void *lgmres_vdata, HYPRE_Real *relative_residual_norm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LGMRESGetFinalRelativeResidualNorm)( lgmres_vdata, relative_residual_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LGMRESGetKDim( void *lgmres_vdata, HYPRE_Int *k_dim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LGMRESGetKDim)( lgmres_vdata, k_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LGMRESGetLogging( void *lgmres_vdata, HYPRE_Int *level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LGMRESGetLogging)( lgmres_vdata, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LGMRESGetMaxIter( void *lgmres_vdata, HYPRE_Int *max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LGMRESGetMaxIter)( lgmres_vdata, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LGMRESGetMinIter( void *lgmres_vdata, HYPRE_Int *min_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LGMRESGetMinIter)( lgmres_vdata, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LGMRESGetNumIterations( void *lgmres_vdata, HYPRE_Int *num_iterations ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LGMRESGetNumIterations)( lgmres_vdata, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LGMRESGetPrecond( void *lgmres_vdata, HYPRE_Solver *precond_data_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LGMRESGetPrecond)( lgmres_vdata, precond_data_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LGMRESGetPrintLevel( void *lgmres_vdata, HYPRE_Int *level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LGMRESGetPrintLevel)( lgmres_vdata, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LGMRESGetResidual( void *lgmres_vdata, void **residual ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LGMRESGetResidual)( lgmres_vdata, residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LGMRESGetStopCrit( void *lgmres_vdata, HYPRE_Int *stop_crit ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LGMRESGetStopCrit)( lgmres_vdata, stop_crit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LGMRESGetTol( void *lgmres_vdata, HYPRE_Real *tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LGMRESGetTol)( lgmres_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LGMRESSetAbsoluteTol( void *lgmres_vdata, HYPRE_Real a_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LGMRESSetAbsoluteTol)( lgmres_vdata, a_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LGMRESSetAugDim( void *lgmres_vdata, HYPRE_Int aug_dim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LGMRESSetAugDim)( lgmres_vdata, aug_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LGMRESSetConvergenceFactorTol( void *lgmres_vdata, HYPRE_Real cf_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LGMRESSetConvergenceFactorTol)( lgmres_vdata, cf_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LGMRESSetKDim( void *lgmres_vdata, HYPRE_Int k_dim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LGMRESSetKDim)( lgmres_vdata, k_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LGMRESSetLogging( void *lgmres_vdata, HYPRE_Int level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LGMRESSetLogging)( lgmres_vdata, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LGMRESSetMaxIter( void *lgmres_vdata, HYPRE_Int max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LGMRESSetMaxIter)( lgmres_vdata, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LGMRESSetMinIter( void *lgmres_vdata, HYPRE_Int min_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LGMRESSetMinIter)( lgmres_vdata, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LGMRESSetPrecond( void *lgmres_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LGMRESSetPrecond)( lgmres_vdata, precond, precond_setup, precond_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LGMRESSetPrintLevel( void *lgmres_vdata, HYPRE_Int level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LGMRESSetPrintLevel)( lgmres_vdata, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LGMRESSetStopCrit( void *lgmres_vdata, HYPRE_Int stop_crit ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LGMRESSetStopCrit)( lgmres_vdata, stop_crit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LGMRESSetTol( void *lgmres_vdata, HYPRE_Real tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LGMRESSetTol)( lgmres_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LGMRESSetup( void *lgmres_vdata, void *A, void *b, void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LGMRESSetup)( lgmres_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LGMRESSolve( void *lgmres_vdata, void *A, void *b, void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LGMRESSolve)( lgmres_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_PCGCreate( hypre_PCGFunctions *pcg_functions ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGCreate)( pcg_functions ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGDestroy( void *pcg_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGDestroy)( pcg_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_PCGFunctions * +hypre_PCGFunctionsCreate( hypre_KrylovPtrToCAlloc CAlloc, hypre_KrylovPtrToFree Free, hypre_KrylovPtrToCommInfo CommInfo, hypre_KrylovPtrToCreateVector CreateVector, hypre_KrylovPtrToDestroyVector DestroyVector, hypre_KrylovPtrToMatvecCreate MatvecCreate, hypre_KrylovPtrToMatvec Matvec, hypre_KrylovPtrToMatvecDestroy MatvecDestroy, hypre_KrylovPtrToInnerProd InnerProd, hypre_KrylovPtrToCopyVector CopyVector, hypre_KrylovPtrToClearVector ClearVector, hypre_KrylovPtrToScaleVector ScaleVector, hypre_KrylovPtrToAxpy Axpy, hypre_KrylovPtrToPrecondSetup PrecondSetup, hypre_KrylovPtrToPrecond Precond ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGFunctionsCreate)( CAlloc, Free, CommInfo, CreateVector, DestroyVector, MatvecCreate, Matvec, MatvecDestroy, InnerProd, CopyVector, ClearVector, ScaleVector, Axpy, PrecondSetup, Precond ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGGetAbsoluteTol( void *pcg_vdata, HYPRE_Real *a_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGGetAbsoluteTol)( pcg_vdata, a_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGGetAbsoluteTolFactor( void *pcg_vdata, HYPRE_Real *atolf ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGGetAbsoluteTolFactor)( pcg_vdata, atolf ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGGetConverged( void *pcg_vdata, HYPRE_Int *converged ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGGetConverged)( pcg_vdata, converged ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGGetConvergenceFactorTol( void *pcg_vdata, HYPRE_Real *cf_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGGetConvergenceFactorTol)( pcg_vdata, cf_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGGetFinalRelativeResidualNorm( void *pcg_vdata, HYPRE_Real *relative_residual_norm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGGetFinalRelativeResidualNorm)( pcg_vdata, relative_residual_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGGetFlex( void *pcg_vdata, HYPRE_Int *flex ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGGetFlex)( pcg_vdata, flex ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGGetLogging( void *pcg_vdata, HYPRE_Int *level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGGetLogging)( pcg_vdata, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGGetMaxIter( void *pcg_vdata, HYPRE_Int *max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGGetMaxIter)( pcg_vdata, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGGetNumIterations( void *pcg_vdata, HYPRE_Int *num_iterations ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGGetNumIterations)( pcg_vdata, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGGetPrecond( void *pcg_vdata, HYPRE_Solver *precond_data_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGGetPrecond)( pcg_vdata, precond_data_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGGetPrecondMatrix( void *pcg_vdata, HYPRE_Matrix *precond_matrix_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGGetPrecondMatrix)( pcg_vdata, precond_matrix_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGGetPrintLevel( void *pcg_vdata, HYPRE_Int *level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGGetPrintLevel)( pcg_vdata, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGGetRecomputeResidual( void *pcg_vdata, HYPRE_Int *recompute_residual ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGGetRecomputeResidual)( pcg_vdata, recompute_residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGGetRecomputeResidualP( void *pcg_vdata, HYPRE_Int *recompute_residual_p ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGGetRecomputeResidualP)( pcg_vdata, recompute_residual_p ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGGetRelChange( void *pcg_vdata, HYPRE_Int *rel_change ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGGetRelChange)( pcg_vdata, rel_change ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGGetResidual( void *pcg_vdata, void **residual ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGGetResidual)( pcg_vdata, residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGGetResidualTol( void *pcg_vdata, HYPRE_Real *rtol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGGetResidualTol)( pcg_vdata, rtol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGGetSkipBreak( void *pcg_vdata, HYPRE_Int *skip_break ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGGetSkipBreak)( pcg_vdata, skip_break ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGGetStopCrit( void *pcg_vdata, HYPRE_Int *stop_crit ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGGetStopCrit)( pcg_vdata, stop_crit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGGetTol( void *pcg_vdata, HYPRE_Real *tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGGetTol)( pcg_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGGetTwoNorm( void *pcg_vdata, HYPRE_Int *two_norm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGGetTwoNorm)( pcg_vdata, two_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGPrintLogging( void *pcg_vdata, HYPRE_Int myid ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGPrintLogging)( pcg_vdata, myid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGSetAbsoluteTol( void *pcg_vdata, HYPRE_Real a_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGSetAbsoluteTol)( pcg_vdata, a_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGSetAbsoluteTolFactor( void *pcg_vdata, HYPRE_Real atolf ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGSetAbsoluteTolFactor)( pcg_vdata, atolf ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGSetConvergenceFactorTol( void *pcg_vdata, HYPRE_Real cf_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGSetConvergenceFactorTol)( pcg_vdata, cf_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGSetFlex( void *pcg_vdata, HYPRE_Int flex ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGSetFlex)( pcg_vdata, flex ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGSetHybrid( void *pcg_vdata, HYPRE_Int level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGSetHybrid)( pcg_vdata, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGSetLogging( void *pcg_vdata, HYPRE_Int level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGSetLogging)( pcg_vdata, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGSetMaxIter( void *pcg_vdata, HYPRE_Int max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGSetMaxIter)( pcg_vdata, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGSetPrecond( void *pcg_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGSetPrecond)( pcg_vdata, precond, precond_setup, precond_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGSetPrecondMatrix( void *pcg_vdata, void *precond_matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGSetPrecondMatrix)( pcg_vdata, precond_matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGSetPreconditioner( void *pcg_vdata, void *precond_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGSetPreconditioner)( pcg_vdata, precond_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGSetPrintLevel( void *pcg_vdata, HYPRE_Int level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGSetPrintLevel)( pcg_vdata, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGSetRecomputeResidual( void *pcg_vdata, HYPRE_Int recompute_residual ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGSetRecomputeResidual)( pcg_vdata, recompute_residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGSetRecomputeResidualP( void *pcg_vdata, HYPRE_Int recompute_residual_p ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGSetRecomputeResidualP)( pcg_vdata, recompute_residual_p ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGSetRelChange( void *pcg_vdata, HYPRE_Int rel_change ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGSetRelChange)( pcg_vdata, rel_change ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGSetResidualTol( void *pcg_vdata, HYPRE_Real rtol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGSetResidualTol)( pcg_vdata, rtol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGSetSkipBreak( void *pcg_vdata, HYPRE_Int skip_break ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGSetSkipBreak)( pcg_vdata, skip_break ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGSetStopCrit( void *pcg_vdata, HYPRE_Int stop_crit ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGSetStopCrit)( pcg_vdata, stop_crit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGSetTol( void *pcg_vdata, HYPRE_Real tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGSetTol)( pcg_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGSetTwoNorm( void *pcg_vdata, HYPRE_Int two_norm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGSetTwoNorm)( pcg_vdata, two_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGSetup( void *pcg_vdata, void *A, void *b, void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGSetup)( pcg_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGSolve( void *pcg_vdata, void *A, void *b, void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PCGSolve)( pcg_vdata, A, b, x ); +} + + +#endif + diff --git a/src/krylov/mup_functions.c b/src/krylov/mup_functions.c new file mode 100644 index 0000000000..89bf6fc4b4 --- /dev/null +++ b/src/krylov/mup_functions.c @@ -0,0 +1,1630 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_krylov.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_BiCGSTABDestroy( HYPRE_Solver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BiCGSTABDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BiCGSTABGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BiCGSTABGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BiCGSTABGetPrecond_pre( precision, solver, precond_data_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABGetPrecondMatrix( HYPRE_Solver solver, HYPRE_Matrix *precond_matrix_ptr ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BiCGSTABGetPrecondMatrix_pre( precision, solver, precond_matrix_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABGetResidual( HYPRE_Solver solver, void *residual ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BiCGSTABGetResidual_pre( precision, solver, residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABSetAbsoluteTol( HYPRE_Solver solver, hypre_long_double a_tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BiCGSTABSetAbsoluteTol_pre( precision, solver, a_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABSetConvergenceFactorTol( HYPRE_Solver solver, hypre_long_double cf_tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BiCGSTABSetConvergenceFactorTol_pre( precision, solver, cf_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABSetLogging( HYPRE_Solver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BiCGSTABSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BiCGSTABSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BiCGSTABSetMinIter_pre( precision, solver, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABSetPrecond( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BiCGSTABSetPrecond_pre( precision, solver, precond, precond_setup, precond_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABSetPrecondMatrix( HYPRE_Solver solver, HYPRE_Matrix precond_matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BiCGSTABSetPrecondMatrix_pre( precision, solver, precond_matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABSetPrintLevel( HYPRE_Solver solver, HYPRE_Int level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BiCGSTABSetPrintLevel_pre( precision, solver, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABSetStopCrit( HYPRE_Solver solver, HYPRE_Int stop_crit ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BiCGSTABSetStopCrit_pre( precision, solver, stop_crit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABSetTol( HYPRE_Solver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BiCGSTABSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABSetup( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BiCGSTABSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABSolve( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BiCGSTABSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CGNRDestroy( HYPRE_Solver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_CGNRDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CGNRGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_CGNRGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CGNRGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_CGNRGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CGNRGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_CGNRGetPrecond_pre( precision, solver, precond_data_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CGNRSetLogging( HYPRE_Solver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_CGNRSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CGNRSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_CGNRSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CGNRSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_CGNRSetMinIter_pre( precision, solver, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CGNRSetPrecond( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precondT, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_CGNRSetPrecond_pre( precision, solver, precond, precondT, precond_setup, precond_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CGNRSetStopCrit( HYPRE_Solver solver, HYPRE_Int stop_crit ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_CGNRSetStopCrit_pre( precision, solver, stop_crit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CGNRSetTol( HYPRE_Solver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_CGNRSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CGNRSetup( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_CGNRSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CGNRSolve( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_CGNRSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESGetCGS( HYPRE_Solver solver, HYPRE_Int *cgs ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_COGMRESGetCGS_pre( precision, solver, cgs ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESGetConverged( HYPRE_Solver solver, HYPRE_Int *converged ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_COGMRESGetConverged_pre( precision, solver, converged ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESGetConvergenceFactorTol( HYPRE_Solver solver, void *cf_tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_COGMRESGetConvergenceFactorTol_pre( precision, solver, cf_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_COGMRESGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESGetKDim( HYPRE_Solver solver, HYPRE_Int *k_dim ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_COGMRESGetKDim_pre( precision, solver, k_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESGetLogging( HYPRE_Solver solver, HYPRE_Int *level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_COGMRESGetLogging_pre( precision, solver, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESGetMaxIter( HYPRE_Solver solver, HYPRE_Int *max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_COGMRESGetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESGetMinIter( HYPRE_Solver solver, HYPRE_Int *min_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_COGMRESGetMinIter_pre( precision, solver, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_COGMRESGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_COGMRESGetPrecond_pre( precision, solver, precond_data_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESGetPrintLevel( HYPRE_Solver solver, HYPRE_Int *level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_COGMRESGetPrintLevel_pre( precision, solver, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESGetResidual( HYPRE_Solver solver, void *residual ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_COGMRESGetResidual_pre( precision, solver, residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESGetTol( HYPRE_Solver solver, void *tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_COGMRESGetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESGetUnroll( HYPRE_Solver solver, HYPRE_Int *unroll ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_COGMRESGetUnroll_pre( precision, solver, unroll ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESSetAbsoluteTol( HYPRE_Solver solver, hypre_long_double a_tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_COGMRESSetAbsoluteTol_pre( precision, solver, a_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESSetCGS( HYPRE_Solver solver, HYPRE_Int cgs ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_COGMRESSetCGS_pre( precision, solver, cgs ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESSetConvergenceFactorTol( HYPRE_Solver solver, hypre_long_double cf_tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_COGMRESSetConvergenceFactorTol_pre( precision, solver, cf_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESSetKDim( HYPRE_Solver solver, HYPRE_Int k_dim ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_COGMRESSetKDim_pre( precision, solver, k_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESSetLogging( HYPRE_Solver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_COGMRESSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_COGMRESSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_COGMRESSetMinIter_pre( precision, solver, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESSetModifyPC( HYPRE_Solver solver, HYPRE_PtrToModifyPCFcn modify_pc ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_COGMRESSetModifyPC_pre( precision, solver, modify_pc ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESSetPrecond( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_COGMRESSetPrecond_pre( precision, solver, precond, precond_setup, precond_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESSetPrintLevel( HYPRE_Solver solver, HYPRE_Int level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_COGMRESSetPrintLevel_pre( precision, solver, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESSetTol( HYPRE_Solver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_COGMRESSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESSetUnroll( HYPRE_Solver solver, HYPRE_Int unroll ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_COGMRESSetUnroll_pre( precision, solver, unroll ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESSetup( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_COGMRESSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESSolve( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_COGMRESSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESGetConverged( HYPRE_Solver solver, HYPRE_Int *converged ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FlexGMRESGetConverged_pre( precision, solver, converged ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESGetConvergenceFactorTol( HYPRE_Solver solver, void *cf_tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FlexGMRESGetConvergenceFactorTol_pre( precision, solver, cf_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FlexGMRESGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESGetKDim( HYPRE_Solver solver, HYPRE_Int *k_dim ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FlexGMRESGetKDim_pre( precision, solver, k_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESGetLogging( HYPRE_Solver solver, HYPRE_Int *level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FlexGMRESGetLogging_pre( precision, solver, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESGetMaxIter( HYPRE_Solver solver, HYPRE_Int *max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FlexGMRESGetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESGetMinIter( HYPRE_Solver solver, HYPRE_Int *min_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FlexGMRESGetMinIter_pre( precision, solver, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FlexGMRESGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FlexGMRESGetPrecond_pre( precision, solver, precond_data_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESGetPrintLevel( HYPRE_Solver solver, HYPRE_Int *level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FlexGMRESGetPrintLevel_pre( precision, solver, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESGetResidual( HYPRE_Solver solver, void *residual ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FlexGMRESGetResidual_pre( precision, solver, residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESGetTol( HYPRE_Solver solver, void *tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FlexGMRESGetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESSetAbsoluteTol( HYPRE_Solver solver, hypre_long_double a_tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FlexGMRESSetAbsoluteTol_pre( precision, solver, a_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESSetConvergenceFactorTol( HYPRE_Solver solver, hypre_long_double cf_tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FlexGMRESSetConvergenceFactorTol_pre( precision, solver, cf_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESSetKDim( HYPRE_Solver solver, HYPRE_Int k_dim ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FlexGMRESSetKDim_pre( precision, solver, k_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESSetLogging( HYPRE_Solver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FlexGMRESSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FlexGMRESSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FlexGMRESSetMinIter_pre( precision, solver, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESSetModifyPC( HYPRE_Solver solver, HYPRE_PtrToModifyPCFcn modify_pc ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FlexGMRESSetModifyPC_pre( precision, solver, modify_pc ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESSetPrecond( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FlexGMRESSetPrecond_pre( precision, solver, precond, precond_setup, precond_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESSetPrintLevel( HYPRE_Solver solver, HYPRE_Int level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FlexGMRESSetPrintLevel_pre( precision, solver, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESSetTol( HYPRE_Solver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FlexGMRESSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESSetup( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FlexGMRESSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESSolve( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FlexGMRESSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetAbsoluteTol( HYPRE_Solver solver, void *tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESGetAbsoluteTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetConverged( HYPRE_Solver solver, HYPRE_Int *converged ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESGetConverged_pre( precision, solver, converged ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetConvergenceFactorTol( HYPRE_Solver solver, void *cf_tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESGetConvergenceFactorTol_pre( precision, solver, cf_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetKDim( HYPRE_Solver solver, HYPRE_Int *k_dim ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESGetKDim_pre( precision, solver, k_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetLogging( HYPRE_Solver solver, HYPRE_Int *level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESGetLogging_pre( precision, solver, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetMaxIter( HYPRE_Solver solver, HYPRE_Int *max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESGetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetMinIter( HYPRE_Solver solver, HYPRE_Int *min_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESGetMinIter_pre( precision, solver, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESGetPrecond_pre( precision, solver, precond_data_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetPrecondMatrix( HYPRE_Solver solver, HYPRE_Matrix *precond_matrix_ptr ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESGetPrecondMatrix_pre( precision, solver, precond_matrix_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetPrintLevel( HYPRE_Solver solver, HYPRE_Int *level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESGetPrintLevel_pre( precision, solver, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetRefSolution( HYPRE_Solver solver, HYPRE_Vector *xref ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESGetRefSolution_pre( precision, solver, xref ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetRelChange( HYPRE_Solver solver, HYPRE_Int *rel_change ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESGetRelChange_pre( precision, solver, rel_change ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetResidual( HYPRE_Solver solver, void *residual ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESGetResidual_pre( precision, solver, residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetSkipRealResidualCheck( HYPRE_Solver solver, HYPRE_Int *skip_real_r_check ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESGetSkipRealResidualCheck_pre( precision, solver, skip_real_r_check ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetStopCrit( HYPRE_Solver solver, HYPRE_Int *stop_crit ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESGetStopCrit_pre( precision, solver, stop_crit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetTol( HYPRE_Solver solver, void *tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESGetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSetAbsoluteTol( HYPRE_Solver solver, hypre_long_double a_tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESSetAbsoluteTol_pre( precision, solver, a_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSetConvergenceFactorTol( HYPRE_Solver solver, hypre_long_double cf_tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESSetConvergenceFactorTol_pre( precision, solver, cf_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSetKDim( HYPRE_Solver solver, HYPRE_Int k_dim ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESSetKDim_pre( precision, solver, k_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSetLogging( HYPRE_Solver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESSetMinIter_pre( precision, solver, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSetPrecond( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESSetPrecond_pre( precision, solver, precond, precond_setup, precond_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSetPrecondMatrix( HYPRE_Solver solver, HYPRE_Matrix precond_matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESSetPrecondMatrix_pre( precision, solver, precond_matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSetPrintLevel( HYPRE_Solver solver, HYPRE_Int level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESSetPrintLevel_pre( precision, solver, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSetRefSolution( HYPRE_Solver solver, HYPRE_Vector xref ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESSetRefSolution_pre( precision, solver, xref ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSetRelChange( HYPRE_Solver solver, HYPRE_Int rel_change ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESSetRelChange_pre( precision, solver, rel_change ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSetSkipRealResidualCheck( HYPRE_Solver solver, HYPRE_Int skip_real_r_check ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESSetSkipRealResidualCheck_pre( precision, solver, skip_real_r_check ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSetStopCrit( HYPRE_Solver solver, HYPRE_Int stop_crit ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESSetStopCrit_pre( precision, solver, stop_crit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSetTol( HYPRE_Solver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSetup( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSolve( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GMRESSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESGetAugDim( HYPRE_Solver solver, HYPRE_Int *k_dim ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LGMRESGetAugDim_pre( precision, solver, k_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESGetConverged( HYPRE_Solver solver, HYPRE_Int *converged ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LGMRESGetConverged_pre( precision, solver, converged ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESGetConvergenceFactorTol( HYPRE_Solver solver, void *cf_tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LGMRESGetConvergenceFactorTol_pre( precision, solver, cf_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LGMRESGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESGetKDim( HYPRE_Solver solver, HYPRE_Int *k_dim ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LGMRESGetKDim_pre( precision, solver, k_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESGetLogging( HYPRE_Solver solver, HYPRE_Int *level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LGMRESGetLogging_pre( precision, solver, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESGetMaxIter( HYPRE_Solver solver, HYPRE_Int *max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LGMRESGetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESGetMinIter( HYPRE_Solver solver, HYPRE_Int *min_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LGMRESGetMinIter_pre( precision, solver, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LGMRESGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LGMRESGetPrecond_pre( precision, solver, precond_data_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESGetPrintLevel( HYPRE_Solver solver, HYPRE_Int *level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LGMRESGetPrintLevel_pre( precision, solver, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESGetResidual( HYPRE_Solver solver, void *residual ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LGMRESGetResidual_pre( precision, solver, residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESGetTol( HYPRE_Solver solver, void *tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LGMRESGetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESSetAbsoluteTol( HYPRE_Solver solver, hypre_long_double a_tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LGMRESSetAbsoluteTol_pre( precision, solver, a_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESSetAugDim( HYPRE_Solver solver, HYPRE_Int aug_dim ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LGMRESSetAugDim_pre( precision, solver, aug_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESSetConvergenceFactorTol( HYPRE_Solver solver, hypre_long_double cf_tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LGMRESSetConvergenceFactorTol_pre( precision, solver, cf_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESSetKDim( HYPRE_Solver solver, HYPRE_Int k_dim ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LGMRESSetKDim_pre( precision, solver, k_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESSetLogging( HYPRE_Solver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LGMRESSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LGMRESSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LGMRESSetMinIter_pre( precision, solver, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESSetPrecond( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LGMRESSetPrecond_pre( precision, solver, precond, precond_setup, precond_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESSetPrintLevel( HYPRE_Solver solver, HYPRE_Int level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LGMRESSetPrintLevel_pre( precision, solver, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESSetTol( HYPRE_Solver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LGMRESSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESSetup( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LGMRESSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESSolve( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LGMRESSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetAbsoluteTolFactor( HYPRE_Solver solver, void *abstolf ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGGetAbsoluteTolFactor_pre( precision, solver, abstolf ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetConverged( HYPRE_Solver solver, HYPRE_Int *converged ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGGetConverged_pre( precision, solver, converged ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetConvergenceFactorTol( HYPRE_Solver solver, void *cf_tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGGetConvergenceFactorTol_pre( precision, solver, cf_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetFlex( HYPRE_Solver solver, HYPRE_Int *flex ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGGetFlex_pre( precision, solver, flex ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetLogging( HYPRE_Solver solver, HYPRE_Int *logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGGetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetMaxIter( HYPRE_Solver solver, HYPRE_Int *max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGGetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGGetPrecond_pre( precision, solver, precond_data_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetPrecondMatrix( HYPRE_Solver solver, HYPRE_Matrix *precond_matrix_ptr ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGGetPrecondMatrix_pre( precision, solver, precond_matrix_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetPrintLevel( HYPRE_Solver solver, HYPRE_Int *level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGGetPrintLevel_pre( precision, solver, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetRelChange( HYPRE_Solver solver, HYPRE_Int *rel_change ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGGetRelChange_pre( precision, solver, rel_change ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetResidual( HYPRE_Solver solver, void *residual ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGGetResidual_pre( precision, solver, residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetResidualTol( HYPRE_Solver solver, void *rtol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGGetResidualTol_pre( precision, solver, rtol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetSkipBreak( HYPRE_Solver solver, HYPRE_Int *skip_break ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGGetSkipBreak_pre( precision, solver, skip_break ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetStopCrit( HYPRE_Solver solver, HYPRE_Int *stop_crit ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGGetStopCrit_pre( precision, solver, stop_crit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetTol( HYPRE_Solver solver, void *tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGGetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetTwoNorm( HYPRE_Solver solver, HYPRE_Int *two_norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGGetTwoNorm_pre( precision, solver, two_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetAbsoluteTol( HYPRE_Solver solver, hypre_long_double a_tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGSetAbsoluteTol_pre( precision, solver, a_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetAbsoluteTolFactor( HYPRE_Solver solver, hypre_long_double abstolf ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGSetAbsoluteTolFactor_pre( precision, solver, abstolf ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetConvergenceFactorTol( HYPRE_Solver solver, hypre_long_double cf_tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGSetConvergenceFactorTol_pre( precision, solver, cf_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetFlex( HYPRE_Solver solver, HYPRE_Int flex ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGSetFlex_pre( precision, solver, flex ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetLogging( HYPRE_Solver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetPrecond( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGSetPrecond_pre( precision, solver, precond, precond_setup, precond_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetPrecondMatrix( HYPRE_Solver solver, HYPRE_Matrix precond_matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGSetPrecondMatrix_pre( precision, solver, precond_matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetPreconditioner( HYPRE_Solver solver, HYPRE_Solver precond ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGSetPreconditioner_pre( precision, solver, precond ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetPrintLevel( HYPRE_Solver solver, HYPRE_Int level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGSetPrintLevel_pre( precision, solver, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetRecomputeResidual( HYPRE_Solver solver, HYPRE_Int recompute_residual ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGSetRecomputeResidual_pre( precision, solver, recompute_residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetRecomputeResidualP( HYPRE_Solver solver, HYPRE_Int recompute_residual_p ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGSetRecomputeResidualP_pre( precision, solver, recompute_residual_p ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetRelChange( HYPRE_Solver solver, HYPRE_Int rel_change ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGSetRelChange_pre( precision, solver, rel_change ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetResidualTol( HYPRE_Solver solver, hypre_long_double rtol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGSetResidualTol_pre( precision, solver, rtol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetSkipBreak( HYPRE_Solver solver, HYPRE_Int skip_break ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGSetSkipBreak_pre( precision, solver, skip_break ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetStopCrit( HYPRE_Solver solver, HYPRE_Int stop_crit ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGSetStopCrit_pre( precision, solver, stop_crit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetTol( HYPRE_Solver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetTwoNorm( HYPRE_Solver solver, HYPRE_Int two_norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGSetTwoNorm_pre( precision, solver, two_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetup( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSolve( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PCGSolve_pre( precision, solver, A, b, x ); +} + + + +#endif + diff --git a/src/krylov/mup_lobpcg_fixed.c b/src/krylov/mup_lobpcg_fixed.c new file mode 100644 index 0000000000..50a54de9f3 --- /dev/null +++ b/src/krylov/mup_lobpcg_fixed.c @@ -0,0 +1,227 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_lobpcg.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +hypre_LOBPCGDestroy( void *pcg_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LOBPCGDestroy)( pcg_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +utilities_FortranMatrix* +hypre_LOBPCGEigenvaluesHistory( void *vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LOBPCGEigenvaluesHistory)( vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LOBPCGGetPrecond( void *pcg_vdata, HYPRE_Solver *precond_data_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LOBPCGGetPrecond)( pcg_vdata, precond_data_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LOBPCGIterations( void* vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LOBPCGIterations)( vdata ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_LOBPCGMultiOperatorA( void *data, void * x, void* y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LOBPCGMultiOperatorA)( data, x, y ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_LOBPCGMultiOperatorB( void *data, void * x, void* y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LOBPCGMultiOperatorB)( data, x, y ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_LOBPCGMultiPreconditioner( void *data, void * x, void* y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LOBPCGMultiPreconditioner)( data, x, y ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_LOBPCGOperatorA( void *pcg_vdata, void* x, void* y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LOBPCGOperatorA)( pcg_vdata, x, y ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_LOBPCGOperatorB( void *pcg_vdata, void* x, void* y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LOBPCGOperatorB)( pcg_vdata, x, y ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_LOBPCGPreconditioner( void *vdata, void* x, void* y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LOBPCGPreconditioner)( vdata, x, y ); +} + +/*--------------------------------------------------------------------------*/ + +utilities_FortranMatrix* +hypre_LOBPCGResidualNorms( void *vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LOBPCGResidualNorms)( vdata ); +} + +/*--------------------------------------------------------------------------*/ + +utilities_FortranMatrix* +hypre_LOBPCGResidualNormsHistory( void *vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LOBPCGResidualNormsHistory)( vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LOBPCGSetMaxIter( void* pcg_vdata, HYPRE_Int max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LOBPCGSetMaxIter)( pcg_vdata, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LOBPCGSetPrecond( void *pcg_vdata, hypre_KrylovPtrToPrecond precond, hypre_KrylovPtrToPrecondSetup precond_setup, void *precond_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LOBPCGSetPrecond)( pcg_vdata, precond, precond_setup, precond_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LOBPCGSetPrecondUsageMode( void* pcg_vdata, HYPRE_Int mode ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LOBPCGSetPrecondUsageMode)( pcg_vdata, mode ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LOBPCGSetPrintLevel( void *pcg_vdata, HYPRE_Int level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LOBPCGSetPrintLevel)( pcg_vdata, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LOBPCGSetRTol( void* pcg_vdata, HYPRE_Real tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LOBPCGSetRTol)( pcg_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LOBPCGSetTol( void* pcg_vdata, HYPRE_Real tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LOBPCGSetTol)( pcg_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LOBPCGSetup( void *pcg_vdata, void *A, void *b, void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LOBPCGSetup)( pcg_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LOBPCGSetupB( void *pcg_vdata, void *B, void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LOBPCGSetupB)( pcg_vdata, B, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LOBPCGSetupT( void *pcg_vdata, void *T, void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LOBPCGSetupT)( pcg_vdata, T, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LOBPCGSolve( void *vdata, mv_MultiVectorPtr con, mv_MultiVectorPtr vec, HYPRE_Real* val ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LOBPCGSolve)( vdata, con, vec, val ); +} + +/*--------------------------------------------------------------------------*/ + +void +lobpcg_MultiVectorByMultiVector( mv_MultiVectorPtr x, mv_MultiVectorPtr y, utilities_FortranMatrix *xy ) +{ + return HYPRE_CURRENTPRECISION_FUNC(lobpcg_MultiVectorByMultiVector)( x, y, xy ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +lobpcg_clean( lobpcg_Data* data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(lobpcg_clean)( data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +lobpcg_initialize( lobpcg_Data* data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(lobpcg_initialize)( data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +lobpcg_solve( mv_MultiVectorPtr blockVectorX, void* operatorAData, lobpcg_operator operatorA, void* operatorBData, lobpcg_operator operatorB, void* operatorTData, lobpcg_operator operatorT, mv_MultiVectorPtr blockVectorY, lobpcg_BLASLAPACKFunctions blap_fn, lobpcg_Tolerance tolerance, HYPRE_Int maxIterations, HYPRE_Int verbosityLevel, HYPRE_Int* iterationNumber, HYPRE_Real * lambda_values, HYPRE_Real * lambdaHistory_values, HYPRE_BigInt lambdaHistory_gh, HYPRE_Real * residualNorms_values, HYPRE_Real * residualNormsHistory_values, HYPRE_BigInt residualNormsHistory_gh ) +{ + return HYPRE_CURRENTPRECISION_FUNC(lobpcg_solve)( blockVectorX, operatorAData, operatorA, operatorBData, operatorB, operatorTData, operatorT, blockVectorY, blap_fn, tolerance, maxIterations, verbosityLevel, iterationNumber, lambda_values, lambdaHistory_values, lambdaHistory_gh, residualNorms_values, residualNormsHistory_values, residualNormsHistory_gh ); +} + + +#endif + diff --git a/src/krylov/mup_lobpcg_functions.c b/src/krylov/mup_lobpcg_functions.c new file mode 100644 index 0000000000..34328e19c5 --- /dev/null +++ b/src/krylov/mup_lobpcg_functions.c @@ -0,0 +1,172 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_lobpcg.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_LOBPCGCreate( mv_InterfaceInterpreter *interpreter, HYPRE_MatvecFunctions *mvfunctions, HYPRE_Solver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LOBPCGCreate_pre( precision, interpreter, mvfunctions, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LOBPCGDestroy( HYPRE_Solver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LOBPCGDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +utilities_FortranMatrix* +HYPRE_LOBPCGEigenvaluesHistory( HYPRE_Solver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LOBPCGEigenvaluesHistory_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LOBPCGGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LOBPCGGetPrecond_pre( precision, solver, precond_data_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LOBPCGIterations( HYPRE_Solver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LOBPCGIterations_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +utilities_FortranMatrix* +HYPRE_LOBPCGResidualNorms( HYPRE_Solver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LOBPCGResidualNorms_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +utilities_FortranMatrix* +HYPRE_LOBPCGResidualNormsHistory( HYPRE_Solver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LOBPCGResidualNormsHistory_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LOBPCGSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LOBPCGSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LOBPCGSetPrecond( HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LOBPCGSetPrecond_pre( precision, solver, precond, precond_setup, precond_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LOBPCGSetPrecondUsageMode( HYPRE_Solver solver, HYPRE_Int mode ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LOBPCGSetPrecondUsageMode_pre( precision, solver, mode ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LOBPCGSetPrintLevel( HYPRE_Solver solver, HYPRE_Int level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LOBPCGSetPrintLevel_pre( precision, solver, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LOBPCGSetRTol( HYPRE_Solver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LOBPCGSetRTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LOBPCGSetTol( HYPRE_Solver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LOBPCGSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LOBPCGSetup( HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LOBPCGSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LOBPCGSetupB( HYPRE_Solver solver, HYPRE_Matrix B, HYPRE_Vector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LOBPCGSetupB_pre( precision, solver, B, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LOBPCGSetupT( HYPRE_Solver solver, HYPRE_Matrix T, HYPRE_Vector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LOBPCGSetupT_pre( precision, solver, T, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LOBPCGSolve( HYPRE_Solver solver, mv_MultiVectorPtr y, mv_MultiVectorPtr x, void *lambda ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_LOBPCGSolve_pre( precision, solver, y, x, lambda ); +} + + + +#endif + diff --git a/src/krylov/mup_lobpcg_pre.c b/src/krylov/mup_lobpcg_pre.c new file mode 100644 index 0000000000..60fa1d2dec --- /dev/null +++ b/src/krylov/mup_lobpcg_pre.c @@ -0,0 +1,325 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_lobpcg.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_LOBPCGCreate_pre( HYPRE_Precision precision, mv_InterfaceInterpreter *interpreter, HYPRE_MatvecFunctions *mvfunctions, HYPRE_Solver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LOBPCGCreate_flt( interpreter, mvfunctions, solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LOBPCGCreate_dbl( interpreter, mvfunctions, solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LOBPCGCreate_long_dbl( interpreter, mvfunctions, solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LOBPCGDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LOBPCGDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LOBPCGDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LOBPCGDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +utilities_FortranMatrix* +HYPRE_LOBPCGEigenvaluesHistory_pre( HYPRE_Precision precision, HYPRE_Solver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LOBPCGEigenvaluesHistory_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LOBPCGEigenvaluesHistory_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LOBPCGEigenvaluesHistory_long_dbl( solver ); + default: + { utilities_FortranMatrix* value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LOBPCGGetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LOBPCGGetPrecond_flt( solver, precond_data_ptr ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LOBPCGGetPrecond_dbl( solver, precond_data_ptr ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LOBPCGGetPrecond_long_dbl( solver, precond_data_ptr ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LOBPCGIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LOBPCGIterations_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LOBPCGIterations_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LOBPCGIterations_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +utilities_FortranMatrix* +HYPRE_LOBPCGResidualNorms_pre( HYPRE_Precision precision, HYPRE_Solver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LOBPCGResidualNorms_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LOBPCGResidualNorms_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LOBPCGResidualNorms_long_dbl( solver ); + default: + { utilities_FortranMatrix* value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +utilities_FortranMatrix* +HYPRE_LOBPCGResidualNormsHistory_pre( HYPRE_Precision precision, HYPRE_Solver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LOBPCGResidualNormsHistory_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LOBPCGResidualNormsHistory_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LOBPCGResidualNormsHistory_long_dbl( solver ); + default: + { utilities_FortranMatrix* value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LOBPCGSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LOBPCGSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LOBPCGSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LOBPCGSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LOBPCGSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LOBPCGSetPrecond_flt( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LOBPCGSetPrecond_dbl( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LOBPCGSetPrecond_long_dbl( solver, precond, precond_setup, precond_solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LOBPCGSetPrecondUsageMode_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int mode ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LOBPCGSetPrecondUsageMode_flt( solver, mode ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LOBPCGSetPrecondUsageMode_dbl( solver, mode ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LOBPCGSetPrecondUsageMode_long_dbl( solver, mode ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LOBPCGSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LOBPCGSetPrintLevel_flt( solver, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LOBPCGSetPrintLevel_dbl( solver, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LOBPCGSetPrintLevel_long_dbl( solver, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LOBPCGSetRTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LOBPCGSetRTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LOBPCGSetRTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LOBPCGSetRTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LOBPCGSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LOBPCGSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LOBPCGSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LOBPCGSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LOBPCGSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LOBPCGSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LOBPCGSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LOBPCGSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LOBPCGSetupB_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix B, HYPRE_Vector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LOBPCGSetupB_flt( solver, B, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LOBPCGSetupB_dbl( solver, B, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LOBPCGSetupB_long_dbl( solver, B, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LOBPCGSetupT_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix T, HYPRE_Vector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LOBPCGSetupT_flt( solver, T, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LOBPCGSetupT_dbl( solver, T, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LOBPCGSetupT_long_dbl( solver, T, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LOBPCGSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, mv_MultiVectorPtr y, mv_MultiVectorPtr x, void *lambda ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LOBPCGSolve_flt( solver, y, x, lambda ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LOBPCGSolve_dbl( solver, y, x, lambda ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LOBPCGSolve_long_dbl( solver, y, x, lambda ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + + + +#endif + diff --git a/src/krylov/mup_pre.c b/src/krylov/mup_pre.c new file mode 100644 index 0000000000..844917c1e0 --- /dev/null +++ b/src/krylov/mup_pre.c @@ -0,0 +1,3241 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_krylov.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_BiCGSTABDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BiCGSTABDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BiCGSTABDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BiCGSTABDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BiCGSTABGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BiCGSTABGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BiCGSTABGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BiCGSTABGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BiCGSTABGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BiCGSTABGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABGetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BiCGSTABGetPrecond_flt( solver, precond_data_ptr ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BiCGSTABGetPrecond_dbl( solver, precond_data_ptr ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BiCGSTABGetPrecond_long_dbl( solver, precond_data_ptr ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABGetPrecondMatrix_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix *precond_matrix_ptr ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BiCGSTABGetPrecondMatrix_flt( solver, precond_matrix_ptr ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BiCGSTABGetPrecondMatrix_dbl( solver, precond_matrix_ptr ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BiCGSTABGetPrecondMatrix_long_dbl( solver, precond_matrix_ptr ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABGetResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *residual ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BiCGSTABGetResidual_flt( solver, residual ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BiCGSTABGetResidual_dbl( solver, residual ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BiCGSTABGetResidual_long_dbl( solver, residual ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double a_tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BiCGSTABSetAbsoluteTol_flt( solver, a_tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BiCGSTABSetAbsoluteTol_dbl( solver, a_tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BiCGSTABSetAbsoluteTol_long_dbl( solver, a_tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABSetConvergenceFactorTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double cf_tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BiCGSTABSetConvergenceFactorTol_flt( solver, cf_tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BiCGSTABSetConvergenceFactorTol_dbl( solver, cf_tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BiCGSTABSetConvergenceFactorTol_long_dbl( solver, cf_tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BiCGSTABSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BiCGSTABSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BiCGSTABSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BiCGSTABSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BiCGSTABSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BiCGSTABSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABSetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int min_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BiCGSTABSetMinIter_flt( solver, min_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BiCGSTABSetMinIter_dbl( solver, min_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BiCGSTABSetMinIter_long_dbl( solver, min_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BiCGSTABSetPrecond_flt( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BiCGSTABSetPrecond_dbl( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BiCGSTABSetPrecond_long_dbl( solver, precond, precond_setup, precond_solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABSetPrecondMatrix_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix precond_matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BiCGSTABSetPrecondMatrix_flt( solver, precond_matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BiCGSTABSetPrecondMatrix_dbl( solver, precond_matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BiCGSTABSetPrecondMatrix_long_dbl( solver, precond_matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BiCGSTABSetPrintLevel_flt( solver, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BiCGSTABSetPrintLevel_dbl( solver, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BiCGSTABSetPrintLevel_long_dbl( solver, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABSetStopCrit_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int stop_crit ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BiCGSTABSetStopCrit_flt( solver, stop_crit ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BiCGSTABSetStopCrit_dbl( solver, stop_crit ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BiCGSTABSetStopCrit_long_dbl( solver, stop_crit ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BiCGSTABSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BiCGSTABSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BiCGSTABSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BiCGSTABSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BiCGSTABSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BiCGSTABSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BiCGSTABSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BiCGSTABSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BiCGSTABSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BiCGSTABSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CGNRDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_CGNRDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_CGNRDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_CGNRDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CGNRGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_CGNRGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_CGNRGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_CGNRGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CGNRGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_CGNRGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_CGNRGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_CGNRGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CGNRGetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_CGNRGetPrecond_flt( solver, precond_data_ptr ); + case HYPRE_REAL_DOUBLE: + return HYPRE_CGNRGetPrecond_dbl( solver, precond_data_ptr ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_CGNRGetPrecond_long_dbl( solver, precond_data_ptr ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CGNRSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_CGNRSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_CGNRSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_CGNRSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CGNRSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_CGNRSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_CGNRSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_CGNRSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CGNRSetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int min_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_CGNRSetMinIter_flt( solver, min_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_CGNRSetMinIter_dbl( solver, min_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_CGNRSetMinIter_long_dbl( solver, min_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CGNRSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precondT, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_CGNRSetPrecond_flt( solver, precond, precondT, precond_setup, precond_solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_CGNRSetPrecond_dbl( solver, precond, precondT, precond_setup, precond_solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_CGNRSetPrecond_long_dbl( solver, precond, precondT, precond_setup, precond_solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CGNRSetStopCrit_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int stop_crit ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_CGNRSetStopCrit_flt( solver, stop_crit ); + case HYPRE_REAL_DOUBLE: + return HYPRE_CGNRSetStopCrit_dbl( solver, stop_crit ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_CGNRSetStopCrit_long_dbl( solver, stop_crit ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CGNRSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_CGNRSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_CGNRSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_CGNRSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CGNRSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_CGNRSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_CGNRSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_CGNRSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CGNRSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_CGNRSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_CGNRSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_CGNRSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESGetCGS_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *cgs ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_COGMRESGetCGS_flt( solver, cgs ); + case HYPRE_REAL_DOUBLE: + return HYPRE_COGMRESGetCGS_dbl( solver, cgs ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_COGMRESGetCGS_long_dbl( solver, cgs ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESGetConverged_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *converged ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_COGMRESGetConverged_flt( solver, converged ); + case HYPRE_REAL_DOUBLE: + return HYPRE_COGMRESGetConverged_dbl( solver, converged ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_COGMRESGetConverged_long_dbl( solver, converged ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESGetConvergenceFactorTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *cf_tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_COGMRESGetConvergenceFactorTol_flt( solver, cf_tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_COGMRESGetConvergenceFactorTol_dbl( solver, cf_tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_COGMRESGetConvergenceFactorTol_long_dbl( solver, cf_tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_COGMRESGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_COGMRESGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_COGMRESGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESGetKDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *k_dim ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_COGMRESGetKDim_flt( solver, k_dim ); + case HYPRE_REAL_DOUBLE: + return HYPRE_COGMRESGetKDim_dbl( solver, k_dim ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_COGMRESGetKDim_long_dbl( solver, k_dim ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESGetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_COGMRESGetLogging_flt( solver, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_COGMRESGetLogging_dbl( solver, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_COGMRESGetLogging_long_dbl( solver, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESGetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_COGMRESGetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_COGMRESGetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_COGMRESGetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESGetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *min_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_COGMRESGetMinIter_flt( solver, min_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_COGMRESGetMinIter_dbl( solver, min_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_COGMRESGetMinIter_long_dbl( solver, min_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_COGMRESGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_COGMRESGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_COGMRESGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESGetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_COGMRESGetPrecond_flt( solver, precond_data_ptr ); + case HYPRE_REAL_DOUBLE: + return HYPRE_COGMRESGetPrecond_dbl( solver, precond_data_ptr ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_COGMRESGetPrecond_long_dbl( solver, precond_data_ptr ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESGetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_COGMRESGetPrintLevel_flt( solver, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_COGMRESGetPrintLevel_dbl( solver, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_COGMRESGetPrintLevel_long_dbl( solver, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESGetResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *residual ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_COGMRESGetResidual_flt( solver, residual ); + case HYPRE_REAL_DOUBLE: + return HYPRE_COGMRESGetResidual_dbl( solver, residual ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_COGMRESGetResidual_long_dbl( solver, residual ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESGetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_COGMRESGetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_COGMRESGetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_COGMRESGetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESGetUnroll_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *unroll ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_COGMRESGetUnroll_flt( solver, unroll ); + case HYPRE_REAL_DOUBLE: + return HYPRE_COGMRESGetUnroll_dbl( solver, unroll ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_COGMRESGetUnroll_long_dbl( solver, unroll ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double a_tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_COGMRESSetAbsoluteTol_flt( solver, a_tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_COGMRESSetAbsoluteTol_dbl( solver, a_tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_COGMRESSetAbsoluteTol_long_dbl( solver, a_tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESSetCGS_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int cgs ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_COGMRESSetCGS_flt( solver, cgs ); + case HYPRE_REAL_DOUBLE: + return HYPRE_COGMRESSetCGS_dbl( solver, cgs ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_COGMRESSetCGS_long_dbl( solver, cgs ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESSetConvergenceFactorTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double cf_tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_COGMRESSetConvergenceFactorTol_flt( solver, cf_tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_COGMRESSetConvergenceFactorTol_dbl( solver, cf_tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_COGMRESSetConvergenceFactorTol_long_dbl( solver, cf_tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESSetKDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int k_dim ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_COGMRESSetKDim_flt( solver, k_dim ); + case HYPRE_REAL_DOUBLE: + return HYPRE_COGMRESSetKDim_dbl( solver, k_dim ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_COGMRESSetKDim_long_dbl( solver, k_dim ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_COGMRESSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_COGMRESSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_COGMRESSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_COGMRESSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_COGMRESSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_COGMRESSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESSetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int min_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_COGMRESSetMinIter_flt( solver, min_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_COGMRESSetMinIter_dbl( solver, min_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_COGMRESSetMinIter_long_dbl( solver, min_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESSetModifyPC_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToModifyPCFcn modify_pc ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_COGMRESSetModifyPC_flt( solver, modify_pc ); + case HYPRE_REAL_DOUBLE: + return HYPRE_COGMRESSetModifyPC_dbl( solver, modify_pc ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_COGMRESSetModifyPC_long_dbl( solver, modify_pc ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_COGMRESSetPrecond_flt( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_COGMRESSetPrecond_dbl( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_COGMRESSetPrecond_long_dbl( solver, precond, precond_setup, precond_solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_COGMRESSetPrintLevel_flt( solver, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_COGMRESSetPrintLevel_dbl( solver, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_COGMRESSetPrintLevel_long_dbl( solver, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_COGMRESSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_COGMRESSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_COGMRESSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESSetUnroll_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int unroll ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_COGMRESSetUnroll_flt( solver, unroll ); + case HYPRE_REAL_DOUBLE: + return HYPRE_COGMRESSetUnroll_dbl( solver, unroll ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_COGMRESSetUnroll_long_dbl( solver, unroll ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_COGMRESSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_COGMRESSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_COGMRESSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_COGMRESSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_COGMRESSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_COGMRESSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_COGMRESSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESGetConverged_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *converged ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FlexGMRESGetConverged_flt( solver, converged ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FlexGMRESGetConverged_dbl( solver, converged ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FlexGMRESGetConverged_long_dbl( solver, converged ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESGetConvergenceFactorTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *cf_tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FlexGMRESGetConvergenceFactorTol_flt( solver, cf_tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FlexGMRESGetConvergenceFactorTol_dbl( solver, cf_tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FlexGMRESGetConvergenceFactorTol_long_dbl( solver, cf_tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FlexGMRESGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FlexGMRESGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FlexGMRESGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESGetKDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *k_dim ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FlexGMRESGetKDim_flt( solver, k_dim ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FlexGMRESGetKDim_dbl( solver, k_dim ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FlexGMRESGetKDim_long_dbl( solver, k_dim ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESGetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FlexGMRESGetLogging_flt( solver, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FlexGMRESGetLogging_dbl( solver, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FlexGMRESGetLogging_long_dbl( solver, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESGetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FlexGMRESGetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FlexGMRESGetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FlexGMRESGetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESGetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *min_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FlexGMRESGetMinIter_flt( solver, min_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FlexGMRESGetMinIter_dbl( solver, min_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FlexGMRESGetMinIter_long_dbl( solver, min_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FlexGMRESGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FlexGMRESGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FlexGMRESGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESGetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FlexGMRESGetPrecond_flt( solver, precond_data_ptr ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FlexGMRESGetPrecond_dbl( solver, precond_data_ptr ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FlexGMRESGetPrecond_long_dbl( solver, precond_data_ptr ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESGetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FlexGMRESGetPrintLevel_flt( solver, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FlexGMRESGetPrintLevel_dbl( solver, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FlexGMRESGetPrintLevel_long_dbl( solver, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESGetResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *residual ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FlexGMRESGetResidual_flt( solver, residual ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FlexGMRESGetResidual_dbl( solver, residual ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FlexGMRESGetResidual_long_dbl( solver, residual ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESGetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FlexGMRESGetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FlexGMRESGetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FlexGMRESGetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double a_tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FlexGMRESSetAbsoluteTol_flt( solver, a_tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FlexGMRESSetAbsoluteTol_dbl( solver, a_tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FlexGMRESSetAbsoluteTol_long_dbl( solver, a_tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESSetConvergenceFactorTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double cf_tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FlexGMRESSetConvergenceFactorTol_flt( solver, cf_tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FlexGMRESSetConvergenceFactorTol_dbl( solver, cf_tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FlexGMRESSetConvergenceFactorTol_long_dbl( solver, cf_tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESSetKDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int k_dim ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FlexGMRESSetKDim_flt( solver, k_dim ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FlexGMRESSetKDim_dbl( solver, k_dim ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FlexGMRESSetKDim_long_dbl( solver, k_dim ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FlexGMRESSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FlexGMRESSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FlexGMRESSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FlexGMRESSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FlexGMRESSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FlexGMRESSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESSetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int min_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FlexGMRESSetMinIter_flt( solver, min_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FlexGMRESSetMinIter_dbl( solver, min_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FlexGMRESSetMinIter_long_dbl( solver, min_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESSetModifyPC_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToModifyPCFcn modify_pc ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FlexGMRESSetModifyPC_flt( solver, modify_pc ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FlexGMRESSetModifyPC_dbl( solver, modify_pc ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FlexGMRESSetModifyPC_long_dbl( solver, modify_pc ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FlexGMRESSetPrecond_flt( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FlexGMRESSetPrecond_dbl( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FlexGMRESSetPrecond_long_dbl( solver, precond, precond_setup, precond_solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FlexGMRESSetPrintLevel_flt( solver, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FlexGMRESSetPrintLevel_dbl( solver, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FlexGMRESSetPrintLevel_long_dbl( solver, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FlexGMRESSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FlexGMRESSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FlexGMRESSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FlexGMRESSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FlexGMRESSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FlexGMRESSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FlexGMRESSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FlexGMRESSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FlexGMRESSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FlexGMRESSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESGetAbsoluteTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESGetAbsoluteTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESGetAbsoluteTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetConverged_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *converged ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESGetConverged_flt( solver, converged ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESGetConverged_dbl( solver, converged ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESGetConverged_long_dbl( solver, converged ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetConvergenceFactorTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *cf_tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESGetConvergenceFactorTol_flt( solver, cf_tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESGetConvergenceFactorTol_dbl( solver, cf_tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESGetConvergenceFactorTol_long_dbl( solver, cf_tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetKDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *k_dim ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESGetKDim_flt( solver, k_dim ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESGetKDim_dbl( solver, k_dim ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESGetKDim_long_dbl( solver, k_dim ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESGetLogging_flt( solver, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESGetLogging_dbl( solver, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESGetLogging_long_dbl( solver, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESGetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESGetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESGetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *min_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESGetMinIter_flt( solver, min_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESGetMinIter_dbl( solver, min_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESGetMinIter_long_dbl( solver, min_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESGetPrecond_flt( solver, precond_data_ptr ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESGetPrecond_dbl( solver, precond_data_ptr ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESGetPrecond_long_dbl( solver, precond_data_ptr ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetPrecondMatrix_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix *precond_matrix_ptr ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESGetPrecondMatrix_flt( solver, precond_matrix_ptr ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESGetPrecondMatrix_dbl( solver, precond_matrix_ptr ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESGetPrecondMatrix_long_dbl( solver, precond_matrix_ptr ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESGetPrintLevel_flt( solver, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESGetPrintLevel_dbl( solver, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESGetPrintLevel_long_dbl( solver, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetRefSolution_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Vector *xref ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESGetRefSolution_flt( solver, xref ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESGetRefSolution_dbl( solver, xref ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESGetRefSolution_long_dbl( solver, xref ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetRelChange_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *rel_change ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESGetRelChange_flt( solver, rel_change ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESGetRelChange_dbl( solver, rel_change ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESGetRelChange_long_dbl( solver, rel_change ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *residual ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESGetResidual_flt( solver, residual ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESGetResidual_dbl( solver, residual ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESGetResidual_long_dbl( solver, residual ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetSkipRealResidualCheck_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *skip_real_r_check ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESGetSkipRealResidualCheck_flt( solver, skip_real_r_check ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESGetSkipRealResidualCheck_dbl( solver, skip_real_r_check ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESGetSkipRealResidualCheck_long_dbl( solver, skip_real_r_check ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetStopCrit_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *stop_crit ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESGetStopCrit_flt( solver, stop_crit ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESGetStopCrit_dbl( solver, stop_crit ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESGetStopCrit_long_dbl( solver, stop_crit ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESGetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESGetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESGetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESGetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double a_tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESSetAbsoluteTol_flt( solver, a_tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESSetAbsoluteTol_dbl( solver, a_tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESSetAbsoluteTol_long_dbl( solver, a_tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSetConvergenceFactorTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double cf_tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESSetConvergenceFactorTol_flt( solver, cf_tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESSetConvergenceFactorTol_dbl( solver, cf_tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESSetConvergenceFactorTol_long_dbl( solver, cf_tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSetKDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int k_dim ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESSetKDim_flt( solver, k_dim ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESSetKDim_dbl( solver, k_dim ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESSetKDim_long_dbl( solver, k_dim ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int min_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESSetMinIter_flt( solver, min_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESSetMinIter_dbl( solver, min_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESSetMinIter_long_dbl( solver, min_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESSetPrecond_flt( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESSetPrecond_dbl( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESSetPrecond_long_dbl( solver, precond, precond_setup, precond_solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSetPrecondMatrix_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix precond_matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESSetPrecondMatrix_flt( solver, precond_matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESSetPrecondMatrix_dbl( solver, precond_matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESSetPrecondMatrix_long_dbl( solver, precond_matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESSetPrintLevel_flt( solver, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESSetPrintLevel_dbl( solver, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESSetPrintLevel_long_dbl( solver, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSetRefSolution_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Vector xref ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESSetRefSolution_flt( solver, xref ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESSetRefSolution_dbl( solver, xref ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESSetRefSolution_long_dbl( solver, xref ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSetRelChange_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int rel_change ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESSetRelChange_flt( solver, rel_change ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESSetRelChange_dbl( solver, rel_change ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESSetRelChange_long_dbl( solver, rel_change ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSetSkipRealResidualCheck_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int skip_real_r_check ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESSetSkipRealResidualCheck_flt( solver, skip_real_r_check ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESSetSkipRealResidualCheck_dbl( solver, skip_real_r_check ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESSetSkipRealResidualCheck_long_dbl( solver, skip_real_r_check ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSetStopCrit_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int stop_crit ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESSetStopCrit_flt( solver, stop_crit ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESSetStopCrit_dbl( solver, stop_crit ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESSetStopCrit_long_dbl( solver, stop_crit ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GMRESSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GMRESSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GMRESSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GMRESSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESGetAugDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *k_dim ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LGMRESGetAugDim_flt( solver, k_dim ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LGMRESGetAugDim_dbl( solver, k_dim ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LGMRESGetAugDim_long_dbl( solver, k_dim ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESGetConverged_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *converged ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LGMRESGetConverged_flt( solver, converged ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LGMRESGetConverged_dbl( solver, converged ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LGMRESGetConverged_long_dbl( solver, converged ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESGetConvergenceFactorTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *cf_tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LGMRESGetConvergenceFactorTol_flt( solver, cf_tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LGMRESGetConvergenceFactorTol_dbl( solver, cf_tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LGMRESGetConvergenceFactorTol_long_dbl( solver, cf_tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LGMRESGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LGMRESGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LGMRESGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESGetKDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *k_dim ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LGMRESGetKDim_flt( solver, k_dim ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LGMRESGetKDim_dbl( solver, k_dim ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LGMRESGetKDim_long_dbl( solver, k_dim ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESGetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LGMRESGetLogging_flt( solver, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LGMRESGetLogging_dbl( solver, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LGMRESGetLogging_long_dbl( solver, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESGetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LGMRESGetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LGMRESGetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LGMRESGetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESGetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *min_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LGMRESGetMinIter_flt( solver, min_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LGMRESGetMinIter_dbl( solver, min_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LGMRESGetMinIter_long_dbl( solver, min_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LGMRESGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LGMRESGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LGMRESGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESGetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LGMRESGetPrecond_flt( solver, precond_data_ptr ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LGMRESGetPrecond_dbl( solver, precond_data_ptr ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LGMRESGetPrecond_long_dbl( solver, precond_data_ptr ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESGetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LGMRESGetPrintLevel_flt( solver, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LGMRESGetPrintLevel_dbl( solver, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LGMRESGetPrintLevel_long_dbl( solver, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESGetResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *residual ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LGMRESGetResidual_flt( solver, residual ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LGMRESGetResidual_dbl( solver, residual ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LGMRESGetResidual_long_dbl( solver, residual ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESGetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LGMRESGetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LGMRESGetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LGMRESGetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double a_tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LGMRESSetAbsoluteTol_flt( solver, a_tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LGMRESSetAbsoluteTol_dbl( solver, a_tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LGMRESSetAbsoluteTol_long_dbl( solver, a_tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESSetAugDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int aug_dim ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LGMRESSetAugDim_flt( solver, aug_dim ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LGMRESSetAugDim_dbl( solver, aug_dim ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LGMRESSetAugDim_long_dbl( solver, aug_dim ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESSetConvergenceFactorTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double cf_tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LGMRESSetConvergenceFactorTol_flt( solver, cf_tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LGMRESSetConvergenceFactorTol_dbl( solver, cf_tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LGMRESSetConvergenceFactorTol_long_dbl( solver, cf_tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESSetKDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int k_dim ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LGMRESSetKDim_flt( solver, k_dim ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LGMRESSetKDim_dbl( solver, k_dim ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LGMRESSetKDim_long_dbl( solver, k_dim ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LGMRESSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LGMRESSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LGMRESSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LGMRESSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LGMRESSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LGMRESSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESSetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int min_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LGMRESSetMinIter_flt( solver, min_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LGMRESSetMinIter_dbl( solver, min_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LGMRESSetMinIter_long_dbl( solver, min_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LGMRESSetPrecond_flt( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LGMRESSetPrecond_dbl( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LGMRESSetPrecond_long_dbl( solver, precond, precond_setup, precond_solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LGMRESSetPrintLevel_flt( solver, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LGMRESSetPrintLevel_dbl( solver, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LGMRESSetPrintLevel_long_dbl( solver, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LGMRESSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LGMRESSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LGMRESSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LGMRESSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LGMRESSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LGMRESSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_LGMRESSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_LGMRESSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_LGMRESSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_LGMRESSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetAbsoluteTolFactor_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *abstolf ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGGetAbsoluteTolFactor_flt( solver, abstolf ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGGetAbsoluteTolFactor_dbl( solver, abstolf ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGGetAbsoluteTolFactor_long_dbl( solver, abstolf ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetConverged_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *converged ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGGetConverged_flt( solver, converged ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGGetConverged_dbl( solver, converged ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGGetConverged_long_dbl( solver, converged ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetConvergenceFactorTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *cf_tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGGetConvergenceFactorTol_flt( solver, cf_tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGGetConvergenceFactorTol_dbl( solver, cf_tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGGetConvergenceFactorTol_long_dbl( solver, cf_tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetFlex_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *flex ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGGetFlex_flt( solver, flex ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGGetFlex_dbl( solver, flex ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGGetFlex_long_dbl( solver, flex ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGGetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGGetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGGetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGGetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGGetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGGetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *precond_data_ptr ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGGetPrecond_flt( solver, precond_data_ptr ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGGetPrecond_dbl( solver, precond_data_ptr ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGGetPrecond_long_dbl( solver, precond_data_ptr ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetPrecondMatrix_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix *precond_matrix_ptr ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGGetPrecondMatrix_flt( solver, precond_matrix_ptr ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGGetPrecondMatrix_dbl( solver, precond_matrix_ptr ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGGetPrecondMatrix_long_dbl( solver, precond_matrix_ptr ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGGetPrintLevel_flt( solver, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGGetPrintLevel_dbl( solver, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGGetPrintLevel_long_dbl( solver, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetRelChange_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *rel_change ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGGetRelChange_flt( solver, rel_change ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGGetRelChange_dbl( solver, rel_change ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGGetRelChange_long_dbl( solver, rel_change ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *residual ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGGetResidual_flt( solver, residual ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGGetResidual_dbl( solver, residual ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGGetResidual_long_dbl( solver, residual ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetResidualTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *rtol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGGetResidualTol_flt( solver, rtol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGGetResidualTol_dbl( solver, rtol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGGetResidualTol_long_dbl( solver, rtol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetSkipBreak_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *skip_break ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGGetSkipBreak_flt( solver, skip_break ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGGetSkipBreak_dbl( solver, skip_break ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGGetSkipBreak_long_dbl( solver, skip_break ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetStopCrit_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *stop_crit ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGGetStopCrit_flt( solver, stop_crit ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGGetStopCrit_dbl( solver, stop_crit ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGGetStopCrit_long_dbl( solver, stop_crit ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGGetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGGetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGGetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGGetTwoNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *two_norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGGetTwoNorm_flt( solver, two_norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGGetTwoNorm_dbl( solver, two_norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGGetTwoNorm_long_dbl( solver, two_norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double a_tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGSetAbsoluteTol_flt( solver, a_tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGSetAbsoluteTol_dbl( solver, a_tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGSetAbsoluteTol_long_dbl( solver, a_tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetAbsoluteTolFactor_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double abstolf ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGSetAbsoluteTolFactor_flt( solver, abstolf ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGSetAbsoluteTolFactor_dbl( solver, abstolf ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGSetAbsoluteTolFactor_long_dbl( solver, abstolf ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetConvergenceFactorTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double cf_tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGSetConvergenceFactorTol_flt( solver, cf_tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGSetConvergenceFactorTol_dbl( solver, cf_tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGSetConvergenceFactorTol_long_dbl( solver, cf_tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetFlex_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int flex ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGSetFlex_flt( solver, flex ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGSetFlex_dbl( solver, flex ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGSetFlex_long_dbl( solver, flex ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGSetPrecond_flt( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGSetPrecond_dbl( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGSetPrecond_long_dbl( solver, precond, precond_setup, precond_solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetPrecondMatrix_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix precond_matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGSetPrecondMatrix_flt( solver, precond_matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGSetPrecondMatrix_dbl( solver, precond_matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGSetPrecondMatrix_long_dbl( solver, precond_matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetPreconditioner_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver precond ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGSetPreconditioner_flt( solver, precond ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGSetPreconditioner_dbl( solver, precond ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGSetPreconditioner_long_dbl( solver, precond ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGSetPrintLevel_flt( solver, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGSetPrintLevel_dbl( solver, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGSetPrintLevel_long_dbl( solver, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetRecomputeResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int recompute_residual ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGSetRecomputeResidual_flt( solver, recompute_residual ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGSetRecomputeResidual_dbl( solver, recompute_residual ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGSetRecomputeResidual_long_dbl( solver, recompute_residual ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetRecomputeResidualP_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int recompute_residual_p ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGSetRecomputeResidualP_flt( solver, recompute_residual_p ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGSetRecomputeResidualP_dbl( solver, recompute_residual_p ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGSetRecomputeResidualP_long_dbl( solver, recompute_residual_p ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetRelChange_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int rel_change ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGSetRelChange_flt( solver, rel_change ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGSetRelChange_dbl( solver, rel_change ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGSetRelChange_long_dbl( solver, rel_change ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetResidualTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double rtol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGSetResidualTol_flt( solver, rtol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGSetResidualTol_dbl( solver, rtol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGSetResidualTol_long_dbl( solver, rtol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetSkipBreak_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int skip_break ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGSetSkipBreak_flt( solver, skip_break ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGSetSkipBreak_dbl( solver, skip_break ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGSetSkipBreak_long_dbl( solver, skip_break ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetStopCrit_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int stop_crit ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGSetStopCrit_flt( solver, stop_crit ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGSetStopCrit_dbl( solver, stop_crit ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGSetStopCrit_long_dbl( solver, stop_crit ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetTwoNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int two_norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGSetTwoNorm_flt( solver, two_norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGSetTwoNorm_dbl( solver, two_norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGSetTwoNorm_long_dbl( solver, two_norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PCGSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PCGSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PCGSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PCGSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + + + +#endif + diff --git a/src/krylov/pcg.c b/src/krylov/pcg.c index 7a121c7df5..e0e7e56084 100644 --- a/src/krylov/pcg.c +++ b/src/krylov/pcg.c @@ -20,7 +20,7 @@ version iterates with a special stopping criterion */ -#include "krylov.h" +#include "_hypre_krylov.h" #include "_hypre_utilities.h" /*-------------------------------------------------------------------------- @@ -105,6 +105,7 @@ hypre_PCGCreate( hypre_PCGFunctions *pcg_functions ) (pcg_data -> owns_matvec_data ) = 1; (pcg_data -> matvec_data) = NULL; (pcg_data -> precond_data) = NULL; + (pcg_data -> precond_Mat) = NULL; (pcg_data -> print_level) = 0; (pcg_data -> logging) = 0; (pcg_data -> norms) = NULL; @@ -206,17 +207,26 @@ hypre_PCGSetup( void *pcg_vdata, void *b, void *x ) { - 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 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_PCGData *pcg_data = (hypre_PCGData *)pcg_vdata; + hypre_PCGFunctions *pcg_functions = (pcg_data->functions); + HYPRE_Int max_iter = (pcg_data -> max_iter); + 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); + void *precond_Mat = (pcg_data -> precond_Mat); HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("PCG-Setup"); + + //set preconditioning matrix + if ((pcg_data -> precond_Mat) == NULL) + { + (pcg_data -> precond_Mat) = A; + precond_Mat = (pcg_data -> precond_Mat) ; + } (pcg_data -> A) = A; @@ -268,7 +278,7 @@ hypre_PCGSetup( void *pcg_vdata, (pcg_data -> v) = (*(pcg_functions->CreateVector))(b); } - precond_setup(precond_data, A, b, x); + precond_setup(precond_data, precond_Mat, b, x); /*----------------------------------------------------- * Allocate space for log info @@ -291,6 +301,7 @@ hypre_PCGSetup( void *pcg_vdata, pcg_functions, HYPRE_MEMORY_HOST ); } + hypre_GpuProfilingPopRange(); HYPRE_ANNOTATE_FUNC_END; return hypre_error_flag; @@ -353,6 +364,8 @@ hypre_PCGSolve( void *pcg_vdata, void *matvec_data = (pcg_data -> matvec_data); HYPRE_Int (*precond)(void*, void*, void*, void*) = (pcg_functions -> precond); void *precond_data = (pcg_data -> precond_data); + // preconditioning matrix + void *precond_Mat = (pcg_data -> precond_Mat) ; HYPRE_Int print_level = (pcg_data -> print_level); HYPRE_Int logging = (pcg_data -> logging); HYPRE_Real *norms = (pcg_data -> norms); @@ -380,6 +393,7 @@ hypre_PCGSolve( void *pcg_vdata, HYPRE_Int my_id, num_procs; HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("PCG-Solve"); (pcg_data -> converged) = 0; @@ -412,7 +426,7 @@ hypre_PCGSolve( void *pcg_vdata, { /* bi_prod = */ (*(pcg_functions->ClearVector))(p); - precond(precond_data, A, b, p); + precond(precond_data, precond_Mat, b, p); bi_prod = (*(pcg_functions->InnerProd))(p, b); if (print_level > 1 && my_id == 0) { @@ -439,6 +453,8 @@ hypre_PCGSolve( void *pcg_vdata, hypre_printf("ERROR detected by Hypre ... END\n\n\n"); } hypre_error(HYPRE_ERROR_GENERIC); + + hypre_GpuProfilingPopRange(); HYPRE_ANNOTATE_FUNC_END; return hypre_error_flag; @@ -478,6 +494,7 @@ hypre_PCGSolve( void *pcg_vdata, norms[0] = 0.0; rel_norms[i] = 0.0; } + hypre_GpuProfilingPopRange(); HYPRE_ANNOTATE_FUNC_END; return hypre_error_flag; @@ -493,7 +510,7 @@ hypre_PCGSolve( void *pcg_vdata, //hypre_ParVectorUpdateHost(r); /* p = C*r */ (*(pcg_functions->ClearVector))(p); - precond(precond_data, A, r, p); + precond(precond_data, precond_Mat, r, p); /* gamma = = */ gamma = (*(pcg_functions->InnerProd))(r, p); @@ -517,6 +534,7 @@ hypre_PCGSolve( void *pcg_vdata, hypre_printf("ERROR detected by Hypre ... END\n\n\n"); } hypre_error(HYPRE_ERROR_GENERIC); + hypre_GpuProfilingPopRange(); HYPRE_ANNOTATE_FUNC_END; return hypre_error_flag; @@ -679,7 +697,7 @@ hypre_PCGSolve( void *pcg_vdata, HYPRE_Real r2ob2; /* v = C*s = C*(r_old-r_new) */ (*(pcg_functions->ClearVector))(v); - precond(precond_data, A, s, v); + precond(precond_data, precond_Mat, s, v); /* */ r2ob2 = (*(pcg_functions->InnerProd))(s, v) / bi_prod; if ( r2ob2 < rtol * rtol ) @@ -713,7 +731,7 @@ hypre_PCGSolve( void *pcg_vdata, /* s = C*r */ (*(pcg_functions->ClearVector))(s); - precond(precond_data, A, r, s); + precond(precond_data, precond_Mat, r, s); /* gamma = */ gamma = (*(pcg_functions->InnerProd))(r, s); @@ -819,7 +837,7 @@ hypre_PCGSolve( void *pcg_vdata, { /* s = C*r */ (*(pcg_functions->ClearVector))(s); - precond(precond_data, A, r, s); + precond(precond_data, precond_Mat, r, s); /* iprod = gamma = */ i_prod = (*(pcg_functions->InnerProd))(r, s); gamma = i_prod; @@ -1002,6 +1020,7 @@ hypre_PCGSolve( void *pcg_vdata, (pcg_data -> rel_residual_norm) = 0.0; } + hypre_GpuProfilingPopRange(); HYPRE_ANNOTATE_FUNC_END; return hypre_error_flag; @@ -1392,6 +1411,30 @@ hypre_PCGSetPrecond( void *pcg_vdata, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * hypre_PCGSetPrecondMatrix + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGSetPrecondMatrix( void *pcg_vdata, void *precond_matrix ) +{ + hypre_PCGData *pcg_data = (hypre_PCGData *)pcg_vdata; + (pcg_data -> precond_Mat) = precond_matrix; + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_PCGGetPrecondMatrix + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PCGGetPrecondMatrix( void *pcg_vdata, HYPRE_Matrix *precond_matrix_ptr ) +{ + hypre_PCGData *pcg_data = (hypre_PCGData *)pcg_vdata; + *precond_matrix_ptr = (HYPRE_Matrix)(pcg_data -> precond_Mat) ; + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- * hypre_PCGSetPreconditioner *--------------------------------------------------------------------------*/ @@ -1414,6 +1457,7 @@ hypre_PCGSetPreconditioner(void *pcg_vdata, return hypre_error_flag; } + /*-------------------------------------------------------------------------- * hypre_PCGSetPrintLevel, hypre_PCGGetPrintLevel *--------------------------------------------------------------------------*/ diff --git a/src/krylov/pcg.h b/src/krylov/pcg.h index e94932071b..26c7e2ab33 100644 --- a/src/krylov/pcg.h +++ b/src/krylov/pcg.h @@ -48,24 +48,21 @@ typedef struct { - void * (*CAlloc) ( size_t count, size_t elt_size ); - 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)(); - HYPRE_Int (*precond_setup)(); + hypre_KrylovPtrToCAlloc CAlloc; + hypre_KrylovPtrToFree Free; + hypre_KrylovPtrToCommInfo CommInfo; + hypre_KrylovPtrToCreateVector CreateVector; + hypre_KrylovPtrToDestroyVector DestroyVector; + hypre_KrylovPtrToMatvecCreate MatvecCreate; + hypre_KrylovPtrToMatvec Matvec; + hypre_KrylovPtrToMatvecDestroy MatvecDestroy; + hypre_KrylovPtrToInnerProd InnerProd; + hypre_KrylovPtrToCopyVector CopyVector; + hypre_KrylovPtrToClearVector ClearVector; + hypre_KrylovPtrToScaleVector ScaleVector; + hypre_KrylovPtrToAxpy Axpy; + hypre_KrylovPtrToPrecond precond; + hypre_KrylovPtrToPrecondSetup precond_setup; } hypre_PCGFunctions; @@ -74,36 +71,35 @@ typedef struct **/ /* - 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) + 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. - - skip_break means that cg will not stop for very small alpha and gamma. default: 0 -*/ + - 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 { @@ -128,12 +124,13 @@ typedef struct 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 */ + 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; + void *precond_Mat; hypre_PCGFunctions * functions; @@ -149,6 +146,7 @@ typedef struct } hypre_PCGData; #define hypre_PCGDataOwnsMatvecData(pcgdata) ((pcgdata) -> owns_matvec_data) +#define hypre_PCGDataHybrid(pcgdata) ((pcgdata) -> hybrid) #ifdef __cplusplus extern "C" { @@ -169,23 +167,21 @@ extern "C" { hypre_PCGFunctions * hypre_PCGFunctionsCreate( - void * (*CAlloc) ( size_t count, size_t elt_size ), - 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 ) + hypre_KrylovPtrToCAlloc CAlloc, + hypre_KrylovPtrToFree Free, + hypre_KrylovPtrToCommInfo CommInfo, + hypre_KrylovPtrToCreateVector CreateVector, + hypre_KrylovPtrToDestroyVector DestroyVector, + hypre_KrylovPtrToMatvecCreate MatvecCreate, + hypre_KrylovPtrToMatvec Matvec, + hypre_KrylovPtrToMatvecDestroy MatvecDestroy, + hypre_KrylovPtrToInnerProd InnerProd, + hypre_KrylovPtrToCopyVector CopyVector, + hypre_KrylovPtrToClearVector ClearVector, + hypre_KrylovPtrToScaleVector ScaleVector, + hypre_KrylovPtrToAxpy Axpy, + hypre_KrylovPtrToPrecondSetup PrecondSetup, + hypre_KrylovPtrToPrecond Precond ); /** @@ -194,9 +190,6 @@ hypre_PCGFunctionsCreate( * @param param [IN] ... **/ -void * -hypre_PCGCreate( hypre_PCGFunctions *pcg_functions ); - #ifdef __cplusplus } #endif diff --git a/src/krylov/protos.h b/src/krylov/protos.h new file mode 100644 index 0000000000..8559b53c32 --- /dev/null +++ b/src/krylov/protos.h @@ -0,0 +1,270 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/* 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_KrylovPtrToPrecond precond, + hypre_KrylovPtrToPrecondSetup precond_setup, + void *precond_data ); +HYPRE_Int hypre_BiCGSTABGetPrecond ( void *bicgstab_vdata, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int hypre_BiCGSTABSetPrecondMatrix( void *bicgstab_vdata, void *precond_matrix ); +HYPRE_Int hypre_BiCGSTABGetPrecondMatrix( void *bicgstab_vdata, + HYPRE_Matrix *precond_matrix_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_KrylovPtrToPrecond precond, + hypre_KrylovPtrToPrecondT precondT, + hypre_KrylovPtrToPrecondSetup precond_setup, + 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_KrylovPtrToPrecond precond, + hypre_KrylovPtrToPrecondSetup precond_setup, + void *precond_data ); +HYPRE_Int hypre_GMRESGetPrecond ( void *gmres_vdata, HYPRE_Solver *precond_data_ptr ); +HYPRE_Int hypre_GMRESSetPrecondMatrix ( void *gmres_vdata, void *precond_matrix ); +HYPRE_Int hypre_GMRESGetPrecondMatrix ( void *gmres_vdata, HYPRE_Matrix *precond_matrix_ptr ); +HYPRE_Int hypre_GMRESSetRefSolution ( void *gmres_vdata, void *xref ); +HYPRE_Int hypre_GMRESGetRefSolution ( void *gmres_vdata, void **xref ); +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_KrylovPtrToPrecond precond, + hypre_KrylovPtrToPrecondSetup precond_setup, + 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 *cogmres_vdata, hypre_KrylovPtrToModifyPC modify_pc ); + +/* 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_KrylovPtrToPrecond precond, + hypre_KrylovPtrToPrecondSetup precond_setup, + 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_KrylovPtrToModifyPC modify_pc ); +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_KrylovPtrToPrecond precond, + hypre_KrylovPtrToPrecondSetup precond_setup, + 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 ); + +/* 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_PCGGetPrecondMatrix( void *pcg_vdata, HYPRE_Matrix *precond_matrix_ptr ); +HYPRE_Int +hypre_PCGSetPrecond ( void *pcg_vdata, + hypre_KrylovPtrToPrecond precond, + hypre_KrylovPtrToPrecondSetup precond_setup, + void *precond_data ); +HYPRE_Int hypre_PCGSetPrecondMatrix( void *pcg_vdata, void *precond_matrix ); +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 ); + diff --git a/src/lapack/CMakeLists.txt b/src/lapack/CMakeLists.txt index f08f563364..1412595b40 100644 --- a/src/lapack/CMakeLists.txt +++ b/src/lapack/CMakeLists.txt @@ -7,7 +7,8 @@ set(HDRS _hypre_lapack.h ) -set(SRCS +# Regular sources +set(REGULAR_SRCS dbdsqr.c dgebd2.c dgebrd.c @@ -83,17 +84,19 @@ set(SRCS xerbla.c ) -# Turn optimization off for this file +# Turn optimization off for dlamch.c if (MSVC) set_source_files_properties (dlamch.c PROPERTIES COMPILE_FLAGS /Od) else () set_source_files_properties (dlamch.c PROPERTIES COMPILE_FLAGS -O0) endif () -target_sources(${PROJECT_NAME} - PRIVATE ${SRCS} - ${HDRS} -) +if (HYPRE_ENABLE_MIXED_PRECISION) + setup_mixed_precision_compilation("lapack" SRCS "${REGULAR_SRCS}") + target_sources(${PROJECT_NAME} PRIVATE ${HDRS}) +else() + target_sources(${PROJECT_NAME} PRIVATE ${REGULAR_SRCS} ${HDRS}) +endif() convert_filenames_to_full_paths(HDRS) set(HYPRE_HEADERS ${HYPRE_HEADERS} ${HDRS} PARENT_SCOPE) diff --git a/src/lapack/Makefile b/src/lapack/Makefile index 12f9c1113e..70f61ec16c 100644 --- a/src/lapack/Makefile +++ b/src/lapack/Makefile @@ -9,8 +9,11 @@ include ../config/Makefile.config C_COMPILE_FLAGS = ${INCLUDES} -I.. -I../blas -I../utilities -LAPACK_HEADERS = f2c.h hypre_lapack.h -LAPACK_FILES = \ +HEADERS =\ + f2c.h\ + hypre_lapack.h + +FILES =\ dbdsqr.c\ dgebd2.c\ dgebrd.c\ @@ -29,6 +32,7 @@ LAPACK_FILES = \ dlacpy.c\ dlae2.c\ dlaev2.c\ + dlamch.c\ dlange.c\ dlanst.c\ dlansy.c\ @@ -84,19 +88,40 @@ LAPACK_FILES = \ lsame.c\ xerbla.c -OBJS = ${LAPACK_FILES:.c=.o} +# Mixed precision files +MP_FILES = \ + mup_fixed.c\ + mup_functions.c\ + mup_pre.c + +OBJS = ${FILES:.c=.o} + +ifeq (${MP_BUILD}, 1) + +COBJS_single = ${FILES:.c=.o_flt} +COBJS_double = ${FILES:.c=.o_dbl} +COBJS_longdouble = ${FILES:.c=.o_ldbl} +MP_COBJS = ${MP_FILES:.c=.o} + +OBJS = ${COBJS_single} ${COBJS_double} ${COBJS_longdouble} ${MP_COBJS} + +endif ################################################################# # Targets ################################################################# -all: ${OBJS} dlamch.o +all: ${OBJS} + cp -fR $(srcdir)/_hypre_lapack.h $(HYPRE_BUILD_DIR)/include + cp -fR $(srcdir)/_hypre_*.h $(HYPRE_BUILD_DIR)/include install: all cp -fR $(srcdir)/_hypre_lapack.h $(HYPRE_INC_INSTALL) + cp -fR $(srcdir)/_hypre_*.h $(HYPRE_INC_INSTALL) clean: rm -rf *.o + rm -f *.o_flt *.o_dbl *.o_ldbl distclean: clean @@ -104,8 +129,4 @@ distclean: clean # Rules ################################################################# -# compile without optimization -dlamch.o : dlamch.c ${LAPACK_HEADERS} - ${CC} ${CFLAGS} -c dlamch.c - -${OBJS}: ${LAPACK_HEADERS} +${OBJS}: ${HEADERS} diff --git a/src/lapack/_hypre_lapack.h b/src/lapack/_hypre_lapack.h index 12932a68e5..e663843d38 100644 --- a/src/lapack/_hypre_lapack.h +++ b/src/lapack/_hypre_lapack.h @@ -15,7 +15,11 @@ #define HYPRE_LAPACK_H #include "_hypre_utilities.h" -#include "fortran.h" +#include "_hypre_fortran.h" + +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_lapack_mup_def.h" +#endif #ifdef __cplusplus extern "C" { @@ -207,4 +211,15 @@ HYPRE_Int hypre_dtrtri (const char *uplo, const char *diag, HYPRE_Int *n, HYPRE_ } #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_lapack_mup_undef.h" +#include "_hypre_lapack_mup.h" +#endif +#endif + #endif diff --git a/src/lapack/_hypre_lapack_mup.h b/src/lapack/_hypre_lapack_mup.h new file mode 100644 index 0000000000..bebd85a9aa --- /dev/null +++ b/src/lapack/_hypre_lapack_mup.h @@ -0,0 +1,347 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#ifndef hypre_LAPACK_MUP_HEADER +#define hypre_LAPACK_MUP_HEADER + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (HYPRE_MIXED_PRECISION) + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +hypre_dbdsqr_flt( const char *uplo, HYPRE_Int *n, HYPRE_Int *ncvt, HYPRE_Int *nru, HYPRE_Int *ncc, hypre_float *d__, hypre_float *e, hypre_float *vt, HYPRE_Int *ldvt, hypre_float *u, HYPRE_Int *ldu, hypre_float *c__, HYPRE_Int *ldc, hypre_float *work, HYPRE_Int *info ); +HYPRE_Int +hypre_dbdsqr_dbl( const char *uplo, HYPRE_Int *n, HYPRE_Int *ncvt, HYPRE_Int *nru, HYPRE_Int *ncc, hypre_double *d__, hypre_double *e, hypre_double *vt, HYPRE_Int *ldvt, hypre_double *u, HYPRE_Int *ldu, hypre_double *c__, HYPRE_Int *ldc, hypre_double *work, HYPRE_Int *info ); +HYPRE_Int +hypre_dbdsqr_long_dbl( const char *uplo, HYPRE_Int *n, HYPRE_Int *ncvt, HYPRE_Int *nru, HYPRE_Int *ncc, hypre_long_double *d__, hypre_long_double *e, hypre_long_double *vt, HYPRE_Int *ldvt, hypre_long_double *u, HYPRE_Int *ldu, hypre_long_double *c__, HYPRE_Int *ldc, hypre_long_double *work, HYPRE_Int *info ); + +HYPRE_Int +hypre_dgebd2_flt( HYPRE_Int *m, HYPRE_Int *n, hypre_float *a, HYPRE_Int *lda, hypre_float *d__, hypre_float *e, hypre_float *tauq, hypre_float *taup, hypre_float *work, HYPRE_Int *info ); +HYPRE_Int +hypre_dgebd2_dbl( HYPRE_Int *m, HYPRE_Int *n, hypre_double *a, HYPRE_Int *lda, hypre_double *d__, hypre_double *e, hypre_double *tauq, hypre_double *taup, hypre_double *work, HYPRE_Int *info ); +HYPRE_Int +hypre_dgebd2_long_dbl( HYPRE_Int *m, HYPRE_Int *n, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *d__, hypre_long_double *e, hypre_long_double *tauq, hypre_long_double *taup, hypre_long_double *work, HYPRE_Int *info ); + +HYPRE_Int +hypre_dgebrd_flt( HYPRE_Int *m, HYPRE_Int *n, hypre_float *a, HYPRE_Int *lda, hypre_float *d__, hypre_float *e, hypre_float *tauq, hypre_float *taup, hypre_float *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dgebrd_dbl( HYPRE_Int *m, HYPRE_Int *n, hypre_double *a, HYPRE_Int *lda, hypre_double *d__, hypre_double *e, hypre_double *tauq, hypre_double *taup, hypre_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dgebrd_long_dbl( HYPRE_Int *m, HYPRE_Int *n, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *d__, hypre_long_double *e, hypre_long_double *tauq, hypre_long_double *taup, hypre_long_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); + +HYPRE_Int +hypre_dgelq2_flt( HYPRE_Int *m, HYPRE_Int *n, hypre_float *a, HYPRE_Int *lda, hypre_float *tau, hypre_float *work, HYPRE_Int *info ); +HYPRE_Int +hypre_dgelq2_dbl( HYPRE_Int *m, HYPRE_Int *n, hypre_double *a, HYPRE_Int *lda, hypre_double *tau, hypre_double *work, HYPRE_Int *info ); +HYPRE_Int +hypre_dgelq2_long_dbl( HYPRE_Int *m, HYPRE_Int *n, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *tau, hypre_long_double *work, HYPRE_Int *info ); + +HYPRE_Int +hypre_dgelqf_flt( HYPRE_Int *m, HYPRE_Int *n, hypre_float *a, HYPRE_Int *lda, hypre_float *tau, hypre_float *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dgelqf_dbl( HYPRE_Int *m, HYPRE_Int *n, hypre_double *a, HYPRE_Int *lda, hypre_double *tau, hypre_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dgelqf_long_dbl( HYPRE_Int *m, HYPRE_Int *n, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *tau, hypre_long_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); + +HYPRE_Int +hypre_dgels_flt( char *trans, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *nrhs, hypre_float *a, HYPRE_Int *lda, hypre_float *b, HYPRE_Int *ldb, hypre_float *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dgels_dbl( char *trans, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *nrhs, hypre_double *a, HYPRE_Int *lda, hypre_double *b, HYPRE_Int *ldb, hypre_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dgels_long_dbl( char *trans, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *nrhs, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *b, HYPRE_Int *ldb, hypre_long_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); + +HYPRE_Int +hypre_dgeqr2_flt( HYPRE_Int *m, HYPRE_Int *n, hypre_float *a, HYPRE_Int *lda, hypre_float *tau, hypre_float *work, HYPRE_Int *info ); +HYPRE_Int +hypre_dgeqr2_dbl( HYPRE_Int *m, HYPRE_Int *n, hypre_double *a, HYPRE_Int *lda, hypre_double *tau, hypre_double *work, HYPRE_Int *info ); +HYPRE_Int +hypre_dgeqr2_long_dbl( HYPRE_Int *m, HYPRE_Int *n, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *tau, hypre_long_double *work, HYPRE_Int *info ); + +HYPRE_Int +hypre_dgeqrf_flt( HYPRE_Int *m, HYPRE_Int *n, hypre_float *a, HYPRE_Int *lda, hypre_float *tau, hypre_float *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dgeqrf_dbl( HYPRE_Int *m, HYPRE_Int *n, hypre_double *a, HYPRE_Int *lda, hypre_double *tau, hypre_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dgeqrf_long_dbl( HYPRE_Int *m, HYPRE_Int *n, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *tau, hypre_long_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); + +HYPRE_Int +hypre_dgesvd_flt( char *jobu, char *jobvt, HYPRE_Int *m, HYPRE_Int *n, hypre_float *a, HYPRE_Int *lda, hypre_float *s, hypre_float *u, HYPRE_Int *ldu, hypre_float *vt, HYPRE_Int *ldvt, hypre_float *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dgesvd_dbl( char *jobu, char *jobvt, HYPRE_Int *m, HYPRE_Int *n, hypre_double *a, HYPRE_Int *lda, hypre_double *s, hypre_double *u, HYPRE_Int *ldu, hypre_double *vt, HYPRE_Int *ldvt, hypre_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dgesvd_long_dbl( char *jobu, char *jobvt, HYPRE_Int *m, HYPRE_Int *n, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *s, hypre_long_double *u, HYPRE_Int *ldu, hypre_long_double *vt, HYPRE_Int *ldvt, hypre_long_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); + +HYPRE_Int +hypre_dgetf2_flt( HYPRE_Int *m, HYPRE_Int *n, hypre_float *a, HYPRE_Int *lda, HYPRE_Int *ipiv, HYPRE_Int *info ); +HYPRE_Int +hypre_dgetf2_dbl( HYPRE_Int *m, HYPRE_Int *n, hypre_double *a, HYPRE_Int *lda, HYPRE_Int *ipiv, HYPRE_Int *info ); +HYPRE_Int +hypre_dgetf2_long_dbl( HYPRE_Int *m, HYPRE_Int *n, hypre_long_double *a, HYPRE_Int *lda, HYPRE_Int *ipiv, HYPRE_Int *info ); + +HYPRE_Int +hypre_dgetrf_flt( HYPRE_Int *m, HYPRE_Int *n, hypre_float *a, HYPRE_Int *lda, HYPRE_Int *ipiv, HYPRE_Int *info ); +HYPRE_Int +hypre_dgetrf_dbl( HYPRE_Int *m, HYPRE_Int *n, hypre_double *a, HYPRE_Int *lda, HYPRE_Int *ipiv, HYPRE_Int *info ); +HYPRE_Int +hypre_dgetrf_long_dbl( HYPRE_Int *m, HYPRE_Int *n, hypre_long_double *a, HYPRE_Int *lda, HYPRE_Int *ipiv, HYPRE_Int *info ); + +HYPRE_Int +hypre_dgetri_flt( HYPRE_Int *n, hypre_float *a, HYPRE_Int *lda, HYPRE_Int *ipiv, hypre_float *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dgetri_dbl( HYPRE_Int *n, hypre_double *a, HYPRE_Int *lda, HYPRE_Int *ipiv, hypre_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dgetri_long_dbl( HYPRE_Int *n, hypre_long_double *a, HYPRE_Int *lda, HYPRE_Int *ipiv, hypre_long_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); + +HYPRE_Int +hypre_dgetrs_flt( const char *trans, HYPRE_Int *n, HYPRE_Int *nrhs, hypre_float *a, HYPRE_Int *lda, HYPRE_Int *ipiv, hypre_float *b, HYPRE_Int *ldb, HYPRE_Int *info ); +HYPRE_Int +hypre_dgetrs_dbl( const char *trans, HYPRE_Int *n, HYPRE_Int *nrhs, hypre_double *a, HYPRE_Int *lda, HYPRE_Int *ipiv, hypre_double *b, HYPRE_Int *ldb, HYPRE_Int *info ); +HYPRE_Int +hypre_dgetrs_long_dbl( const char *trans, HYPRE_Int *n, HYPRE_Int *nrhs, hypre_long_double *a, HYPRE_Int *lda, HYPRE_Int *ipiv, hypre_long_double *b, HYPRE_Int *ldb, HYPRE_Int *info ); + +HYPRE_Int +hypre_dlasq1_flt( HYPRE_Int *n, hypre_float *d__, hypre_float *e, hypre_float *work, HYPRE_Int *info ); +HYPRE_Int +hypre_dlasq1_dbl( HYPRE_Int *n, hypre_double *d__, hypre_double *e, hypre_double *work, HYPRE_Int *info ); +HYPRE_Int +hypre_dlasq1_long_dbl( HYPRE_Int *n, hypre_long_double *d__, hypre_long_double *e, hypre_long_double *work, HYPRE_Int *info ); + +HYPRE_Int +hypre_dlasq2_flt( HYPRE_Int *n, hypre_float *z__, HYPRE_Int *info ); +HYPRE_Int +hypre_dlasq2_dbl( HYPRE_Int *n, hypre_double *z__, HYPRE_Int *info ); +HYPRE_Int +hypre_dlasq2_long_dbl( HYPRE_Int *n, hypre_long_double *z__, HYPRE_Int *info ); + +HYPRE_Int +hypre_dlasrt_flt( const char *id, HYPRE_Int *n, hypre_float *d__, HYPRE_Int *info ); +HYPRE_Int +hypre_dlasrt_dbl( const char *id, HYPRE_Int *n, hypre_double *d__, HYPRE_Int *info ); +HYPRE_Int +hypre_dlasrt_long_dbl( const char *id, HYPRE_Int *n, hypre_long_double *d__, HYPRE_Int *info ); + +HYPRE_Int +hypre_dorg2l_flt( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_float *a, HYPRE_Int *lda, hypre_float *tau, hypre_float *work, HYPRE_Int *info ); +HYPRE_Int +hypre_dorg2l_dbl( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_double *a, HYPRE_Int *lda, hypre_double *tau, hypre_double *work, HYPRE_Int *info ); +HYPRE_Int +hypre_dorg2l_long_dbl( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *tau, hypre_long_double *work, HYPRE_Int *info ); + +HYPRE_Int +hypre_dorg2r_flt( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_float *a, HYPRE_Int *lda, hypre_float *tau, hypre_float *work, HYPRE_Int *info ); +HYPRE_Int +hypre_dorg2r_dbl( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_double *a, HYPRE_Int *lda, hypre_double *tau, hypre_double *work, HYPRE_Int *info ); +HYPRE_Int +hypre_dorg2r_long_dbl( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *tau, hypre_long_double *work, HYPRE_Int *info ); + +HYPRE_Int +hypre_dorgbr_flt( const char *vect, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_float *a, HYPRE_Int *lda, hypre_float *tau, hypre_float *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dorgbr_dbl( const char *vect, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_double *a, HYPRE_Int *lda, hypre_double *tau, hypre_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dorgbr_long_dbl( const char *vect, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *tau, hypre_long_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); + +HYPRE_Int +hypre_dorgl2_flt( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_float *a, HYPRE_Int *lda, hypre_float *tau, hypre_float *work, HYPRE_Int *info ); +HYPRE_Int +hypre_dorgl2_dbl( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_double *a, HYPRE_Int *lda, hypre_double *tau, hypre_double *work, HYPRE_Int *info ); +HYPRE_Int +hypre_dorgl2_long_dbl( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *tau, hypre_long_double *work, HYPRE_Int *info ); + +HYPRE_Int +hypre_dorglq_flt( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_float *a, HYPRE_Int *lda, hypre_float *tau, hypre_float *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dorglq_dbl( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_double *a, HYPRE_Int *lda, hypre_double *tau, hypre_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dorglq_long_dbl( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *tau, hypre_long_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); + +HYPRE_Int +hypre_dorgql_flt( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_float *a, HYPRE_Int *lda, hypre_float *tau, hypre_float *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dorgql_dbl( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_double *a, HYPRE_Int *lda, hypre_double *tau, hypre_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dorgql_long_dbl( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *tau, hypre_long_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); + +HYPRE_Int +hypre_dorgqr_flt( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_float *a, HYPRE_Int *lda, hypre_float *tau, hypre_float *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dorgqr_dbl( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_double *a, HYPRE_Int *lda, hypre_double *tau, hypre_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dorgqr_long_dbl( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *tau, hypre_long_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); + +HYPRE_Int +hypre_dorgtr_flt( const char *uplo, HYPRE_Int *n, hypre_float *a, HYPRE_Int *lda, hypre_float *tau, hypre_float *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dorgtr_dbl( const char *uplo, HYPRE_Int *n, hypre_double *a, HYPRE_Int *lda, hypre_double *tau, hypre_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dorgtr_long_dbl( const char *uplo, HYPRE_Int *n, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *tau, hypre_long_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); + +HYPRE_Int +hypre_dorm2r_flt( const char *side, const char *trans, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_float *a, HYPRE_Int *lda, hypre_float *tau, hypre_float *c__, HYPRE_Int *ldc, hypre_float *work, HYPRE_Int *info ); +HYPRE_Int +hypre_dorm2r_dbl( const char *side, const char *trans, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_double *a, HYPRE_Int *lda, hypre_double *tau, hypre_double *c__, HYPRE_Int *ldc, hypre_double *work, HYPRE_Int *info ); +HYPRE_Int +hypre_dorm2r_long_dbl( const char *side, const char *trans, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *tau, hypre_long_double *c__, HYPRE_Int *ldc, hypre_long_double *work, HYPRE_Int *info ); + +HYPRE_Int +hypre_dormbr_flt( const char *vect, const char *side, const char *trans, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_float *a, HYPRE_Int *lda, hypre_float *tau, hypre_float *c__, HYPRE_Int *ldc, hypre_float *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dormbr_dbl( const char *vect, const char *side, const char *trans, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_double *a, HYPRE_Int *lda, hypre_double *tau, hypre_double *c__, HYPRE_Int *ldc, hypre_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dormbr_long_dbl( const char *vect, const char *side, const char *trans, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *tau, hypre_long_double *c__, HYPRE_Int *ldc, hypre_long_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); + +HYPRE_Int +hypre_dorml2_flt( const char *side, const char *trans, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_float *a, HYPRE_Int *lda, hypre_float *tau, hypre_float *c__, HYPRE_Int *ldc, hypre_float *work, HYPRE_Int *info ); +HYPRE_Int +hypre_dorml2_dbl( const char *side, const char *trans, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_double *a, HYPRE_Int *lda, hypre_double *tau, hypre_double *c__, HYPRE_Int *ldc, hypre_double *work, HYPRE_Int *info ); +HYPRE_Int +hypre_dorml2_long_dbl( const char *side, const char *trans, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *tau, hypre_long_double *c__, HYPRE_Int *ldc, hypre_long_double *work, HYPRE_Int *info ); + +HYPRE_Int +hypre_dormlq_flt( const char *side, const char *trans, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_float *a, HYPRE_Int *lda, hypre_float *tau, hypre_float *c__, HYPRE_Int *ldc, hypre_float *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dormlq_dbl( const char *side, const char *trans, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_double *a, HYPRE_Int *lda, hypre_double *tau, hypre_double *c__, HYPRE_Int *ldc, hypre_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dormlq_long_dbl( const char *side, const char *trans, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *tau, hypre_long_double *c__, HYPRE_Int *ldc, hypre_long_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); + +HYPRE_Int +hypre_dormqr_flt( const char *side, const char *trans, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_float *a, HYPRE_Int *lda, hypre_float *tau, hypre_float *c__, HYPRE_Int *ldc, hypre_float *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dormqr_dbl( const char *side, const char *trans, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_double *a, HYPRE_Int *lda, hypre_double *tau, hypre_double *c__, HYPRE_Int *ldc, hypre_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dormqr_long_dbl( const char *side, const char *trans, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *tau, hypre_long_double *c__, HYPRE_Int *ldc, hypre_long_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); + +HYPRE_Int +hypre_dpotf2_flt( const char *uplo, HYPRE_Int *n, hypre_float *a, HYPRE_Int *lda, HYPRE_Int *info ); +HYPRE_Int +hypre_dpotf2_dbl( const char *uplo, HYPRE_Int *n, hypre_double *a, HYPRE_Int *lda, HYPRE_Int *info ); +HYPRE_Int +hypre_dpotf2_long_dbl( const char *uplo, HYPRE_Int *n, hypre_long_double *a, HYPRE_Int *lda, HYPRE_Int *info ); + +HYPRE_Int +hypre_dpotrf_flt( const char *uplo, HYPRE_Int *n, hypre_float *a, HYPRE_Int *lda, HYPRE_Int *info ); +HYPRE_Int +hypre_dpotrf_dbl( const char *uplo, HYPRE_Int *n, hypre_double *a, HYPRE_Int *lda, HYPRE_Int *info ); +HYPRE_Int +hypre_dpotrf_long_dbl( const char *uplo, HYPRE_Int *n, hypre_long_double *a, HYPRE_Int *lda, HYPRE_Int *info ); + +HYPRE_Int +hypre_dpotrs_flt( char *uplo, HYPRE_Int *n, HYPRE_Int *nrhs, hypre_float *a, HYPRE_Int *lda, hypre_float *b, HYPRE_Int *ldb, HYPRE_Int *info ); +HYPRE_Int +hypre_dpotrs_dbl( char *uplo, HYPRE_Int *n, HYPRE_Int *nrhs, hypre_double *a, HYPRE_Int *lda, hypre_double *b, HYPRE_Int *ldb, HYPRE_Int *info ); +HYPRE_Int +hypre_dpotrs_long_dbl( char *uplo, HYPRE_Int *n, HYPRE_Int *nrhs, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *b, HYPRE_Int *ldb, HYPRE_Int *info ); + +HYPRE_Int +hypre_dsteqr_flt( const char *compz, HYPRE_Int *n, hypre_float *d__, hypre_float *e, hypre_float *z__, HYPRE_Int *ldz, hypre_float *work, HYPRE_Int *info ); +HYPRE_Int +hypre_dsteqr_dbl( const char *compz, HYPRE_Int *n, hypre_double *d__, hypre_double *e, hypre_double *z__, HYPRE_Int *ldz, hypre_double *work, HYPRE_Int *info ); +HYPRE_Int +hypre_dsteqr_long_dbl( const char *compz, HYPRE_Int *n, hypre_long_double *d__, hypre_long_double *e, hypre_long_double *z__, HYPRE_Int *ldz, hypre_long_double *work, HYPRE_Int *info ); + +HYPRE_Int +hypre_dsterf_flt( HYPRE_Int *n, hypre_float *d__, hypre_float *e, HYPRE_Int *info ); +HYPRE_Int +hypre_dsterf_dbl( HYPRE_Int *n, hypre_double *d__, hypre_double *e, HYPRE_Int *info ); +HYPRE_Int +hypre_dsterf_long_dbl( HYPRE_Int *n, hypre_long_double *d__, hypre_long_double *e, HYPRE_Int *info ); + +HYPRE_Int +hypre_dsyev_flt( const char *jobz, const char *uplo, HYPRE_Int *n, hypre_float *a, HYPRE_Int *lda, hypre_float *w, hypre_float *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dsyev_dbl( const char *jobz, const char *uplo, HYPRE_Int *n, hypre_double *a, HYPRE_Int *lda, hypre_double *w, hypre_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dsyev_long_dbl( const char *jobz, const char *uplo, HYPRE_Int *n, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *w, hypre_long_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); + +HYPRE_Int +hypre_dsygs2_flt( HYPRE_Int *itype, const char *uplo, HYPRE_Int *n, hypre_float *a, HYPRE_Int *lda, hypre_float *b, HYPRE_Int *ldb, HYPRE_Int *info ); +HYPRE_Int +hypre_dsygs2_dbl( HYPRE_Int *itype, const char *uplo, HYPRE_Int *n, hypre_double *a, HYPRE_Int *lda, hypre_double *b, HYPRE_Int *ldb, HYPRE_Int *info ); +HYPRE_Int +hypre_dsygs2_long_dbl( HYPRE_Int *itype, const char *uplo, HYPRE_Int *n, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *b, HYPRE_Int *ldb, HYPRE_Int *info ); + +HYPRE_Int +hypre_dsygst_flt( HYPRE_Int *itype, const char *uplo, HYPRE_Int *n, hypre_float *a, HYPRE_Int *lda, hypre_float *b, HYPRE_Int *ldb, HYPRE_Int *info ); +HYPRE_Int +hypre_dsygst_dbl( HYPRE_Int *itype, const char *uplo, HYPRE_Int *n, hypre_double *a, HYPRE_Int *lda, hypre_double *b, HYPRE_Int *ldb, HYPRE_Int *info ); +HYPRE_Int +hypre_dsygst_long_dbl( HYPRE_Int *itype, const char *uplo, HYPRE_Int *n, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *b, HYPRE_Int *ldb, HYPRE_Int *info ); + +HYPRE_Int +hypre_dsygv_flt( HYPRE_Int *itype, char *jobz, char *uplo, HYPRE_Int *n, hypre_float *a, HYPRE_Int *lda, hypre_float *b, HYPRE_Int *ldb, hypre_float *w, hypre_float *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dsygv_dbl( HYPRE_Int *itype, char *jobz, char *uplo, HYPRE_Int *n, hypre_double *a, HYPRE_Int *lda, hypre_double *b, HYPRE_Int *ldb, hypre_double *w, hypre_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dsygv_long_dbl( HYPRE_Int *itype, char *jobz, char *uplo, HYPRE_Int *n, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *b, HYPRE_Int *ldb, hypre_long_double *w, hypre_long_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); + +HYPRE_Int +hypre_dsytd2_flt( const char *uplo, HYPRE_Int *n, hypre_float *a, HYPRE_Int *lda, hypre_float *d__, hypre_float *e, hypre_float *tau, HYPRE_Int *info ); +HYPRE_Int +hypre_dsytd2_dbl( const char *uplo, HYPRE_Int *n, hypre_double *a, HYPRE_Int *lda, hypre_double *d__, hypre_double *e, hypre_double *tau, HYPRE_Int *info ); +HYPRE_Int +hypre_dsytd2_long_dbl( const char *uplo, HYPRE_Int *n, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *d__, hypre_long_double *e, hypre_long_double *tau, HYPRE_Int *info ); + +HYPRE_Int +hypre_dsytrd_flt( const char *uplo, HYPRE_Int *n, hypre_float *a, HYPRE_Int *lda, hypre_float *d__, hypre_float *e, hypre_float *tau, hypre_float *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dsytrd_dbl( const char *uplo, HYPRE_Int *n, hypre_double *a, HYPRE_Int *lda, hypre_double *d__, hypre_double *e, hypre_double *tau, hypre_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); +HYPRE_Int +hypre_dsytrd_long_dbl( const char *uplo, HYPRE_Int *n, hypre_long_double *a, HYPRE_Int *lda, hypre_long_double *d__, hypre_long_double *e, hypre_long_double *tau, hypre_long_double *work, HYPRE_Int *lwork, HYPRE_Int *info ); + +HYPRE_Int +hypre_dtrti2_flt( const char *uplo, const char *diag, HYPRE_Int *n, hypre_float *a, HYPRE_Int *lda, HYPRE_Int *info ); +HYPRE_Int +hypre_dtrti2_dbl( const char *uplo, const char *diag, HYPRE_Int *n, hypre_double *a, HYPRE_Int *lda, HYPRE_Int *info ); +HYPRE_Int +hypre_dtrti2_long_dbl( const char *uplo, const char *diag, HYPRE_Int *n, hypre_long_double *a, HYPRE_Int *lda, HYPRE_Int *info ); + +HYPRE_Int +hypre_dtrtri_flt( const char *uplo, const char *diag, HYPRE_Int *n, hypre_float *a, HYPRE_Int *lda, HYPRE_Int *info ); +HYPRE_Int +hypre_dtrtri_dbl( const char *uplo, const char *diag, HYPRE_Int *n, hypre_double *a, HYPRE_Int *lda, HYPRE_Int *info ); +HYPRE_Int +hypre_dtrtri_long_dbl( const char *uplo, const char *diag, HYPRE_Int *n, hypre_long_double *a, HYPRE_Int *lda, HYPRE_Int *info ); + + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + + + +#endif + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/src/lapack/_hypre_lapack_mup_def.h b/src/lapack/_hypre_lapack_mup_def.h new file mode 100644 index 0000000000..11a47e9588 --- /dev/null +++ b/src/lapack/_hypre_lapack_mup_def.h @@ -0,0 +1,97 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#ifndef hypre_LAPACK_MUP_DEF_HEADER +#define hypre_LAPACK_MUP_DEF_HEADER + +#include "_hypre_mup_def.h" + +#define hypre_dbdsqr HYPRE_FIXEDPRECISION_FUNC ( hypre_dbdsqr ) +#define hypre_dgebd2 HYPRE_FIXEDPRECISION_FUNC ( hypre_dgebd2 ) +#define hypre_dgebrd HYPRE_FIXEDPRECISION_FUNC ( hypre_dgebrd ) +#define hypre_dgelq2 HYPRE_FIXEDPRECISION_FUNC ( hypre_dgelq2 ) +#define hypre_dgelqf HYPRE_FIXEDPRECISION_FUNC ( hypre_dgelqf ) +#define hypre_dgels HYPRE_FIXEDPRECISION_FUNC ( hypre_dgels ) +#define hypre_dgeqr2 HYPRE_FIXEDPRECISION_FUNC ( hypre_dgeqr2 ) +#define hypre_dgeqrf HYPRE_FIXEDPRECISION_FUNC ( hypre_dgeqrf ) +#define hypre_dgesvd HYPRE_FIXEDPRECISION_FUNC ( hypre_dgesvd ) +#define hypre_dgetf2 HYPRE_FIXEDPRECISION_FUNC ( hypre_dgetf2 ) +#define hypre_dgetrf HYPRE_FIXEDPRECISION_FUNC ( hypre_dgetrf ) +#define hypre_dgetri HYPRE_FIXEDPRECISION_FUNC ( hypre_dgetri ) +#define hypre_dgetrs HYPRE_FIXEDPRECISION_FUNC ( hypre_dgetrs ) +#define hypre_dlabad HYPRE_FIXEDPRECISION_FUNC ( hypre_dlabad ) +#define hypre_dlabrd HYPRE_FIXEDPRECISION_FUNC ( hypre_dlabrd ) +#define hypre_dlacpy HYPRE_FIXEDPRECISION_FUNC ( hypre_dlacpy ) +#define hypre_dlae2 HYPRE_FIXEDPRECISION_FUNC ( hypre_dlae2 ) +#define hypre_dlaev2 HYPRE_FIXEDPRECISION_FUNC ( hypre_dlaev2 ) +#define hypre_dlamc1 HYPRE_FIXEDPRECISION_FUNC ( hypre_dlamc1 ) +#define hypre_dlamc2 HYPRE_FIXEDPRECISION_FUNC ( hypre_dlamc2 ) +#define hypre_dlamc3 HYPRE_FIXEDPRECISION_FUNC ( hypre_dlamc3 ) +#define hypre_dlamc4 HYPRE_FIXEDPRECISION_FUNC ( hypre_dlamc4 ) +#define hypre_dlamc5 HYPRE_FIXEDPRECISION_FUNC ( hypre_dlamc5 ) +#define hypre_dlamch HYPRE_FIXEDPRECISION_FUNC ( hypre_dlamch ) +#define hypre_dlange HYPRE_FIXEDPRECISION_FUNC ( hypre_dlange ) +#define hypre_dlanst HYPRE_FIXEDPRECISION_FUNC ( hypre_dlanst ) +#define hypre_dlansy HYPRE_FIXEDPRECISION_FUNC ( hypre_dlansy ) +#define hypre_dlapy2 HYPRE_FIXEDPRECISION_FUNC ( hypre_dlapy2 ) +#define hypre_dlarf HYPRE_FIXEDPRECISION_FUNC ( hypre_dlarf ) +#define hypre_dlarfb HYPRE_FIXEDPRECISION_FUNC ( hypre_dlarfb ) +#define hypre_dlarfg HYPRE_FIXEDPRECISION_FUNC ( hypre_dlarfg ) +#define hypre_dlarft HYPRE_FIXEDPRECISION_FUNC ( hypre_dlarft ) +#define hypre_dlartg HYPRE_FIXEDPRECISION_FUNC ( hypre_dlartg ) +#define hypre_dlas2 HYPRE_FIXEDPRECISION_FUNC ( hypre_dlas2 ) +#define hypre_dlascl HYPRE_FIXEDPRECISION_FUNC ( hypre_dlascl ) +#define hypre_dlaset HYPRE_FIXEDPRECISION_FUNC ( hypre_dlaset ) +#define hypre_dlasq1 HYPRE_FIXEDPRECISION_FUNC ( hypre_dlasq1 ) +#define hypre_dlasq2 HYPRE_FIXEDPRECISION_FUNC ( hypre_dlasq2 ) +#define hypre_dlasq3 HYPRE_FIXEDPRECISION_FUNC ( hypre_dlasq3 ) +#define hypre_dlasq4 HYPRE_FIXEDPRECISION_FUNC ( hypre_dlasq4 ) +#define hypre_dlasq5 HYPRE_FIXEDPRECISION_FUNC ( hypre_dlasq5 ) +#define hypre_dlasq6 HYPRE_FIXEDPRECISION_FUNC ( hypre_dlasq6 ) +#define hypre_dlasr HYPRE_FIXEDPRECISION_FUNC ( hypre_dlasr ) +#define hypre_dlasrt HYPRE_FIXEDPRECISION_FUNC ( hypre_dlasrt ) +#define hypre_dlassq HYPRE_FIXEDPRECISION_FUNC ( hypre_dlassq ) +#define hypre_dlasv2 HYPRE_FIXEDPRECISION_FUNC ( hypre_dlasv2 ) +#define hypre_dlaswp HYPRE_FIXEDPRECISION_FUNC ( hypre_dlaswp ) +#define hypre_dlatrd HYPRE_FIXEDPRECISION_FUNC ( hypre_dlatrd ) +#define hypre_dorg2l HYPRE_FIXEDPRECISION_FUNC ( hypre_dorg2l ) +#define hypre_dorg2r HYPRE_FIXEDPRECISION_FUNC ( hypre_dorg2r ) +#define hypre_dorgbr HYPRE_FIXEDPRECISION_FUNC ( hypre_dorgbr ) +#define hypre_dorgl2 HYPRE_FIXEDPRECISION_FUNC ( hypre_dorgl2 ) +#define hypre_dorglq HYPRE_FIXEDPRECISION_FUNC ( hypre_dorglq ) +#define hypre_dorgql HYPRE_FIXEDPRECISION_FUNC ( hypre_dorgql ) +#define hypre_dorgqr HYPRE_FIXEDPRECISION_FUNC ( hypre_dorgqr ) +#define hypre_dorgtr HYPRE_FIXEDPRECISION_FUNC ( hypre_dorgtr ) +#define hypre_dorm2r HYPRE_FIXEDPRECISION_FUNC ( hypre_dorm2r ) +#define hypre_dormbr HYPRE_FIXEDPRECISION_FUNC ( hypre_dormbr ) +#define hypre_dorml2 HYPRE_FIXEDPRECISION_FUNC ( hypre_dorml2 ) +#define hypre_dormlq HYPRE_FIXEDPRECISION_FUNC ( hypre_dormlq ) +#define hypre_dormqr HYPRE_FIXEDPRECISION_FUNC ( hypre_dormqr ) +#define hypre_dpotf2 HYPRE_FIXEDPRECISION_FUNC ( hypre_dpotf2 ) +#define hypre_dpotrf HYPRE_FIXEDPRECISION_FUNC ( hypre_dpotrf ) +#define hypre_dpotrs HYPRE_FIXEDPRECISION_FUNC ( hypre_dpotrs ) +#define hypre_dsteqr HYPRE_FIXEDPRECISION_FUNC ( hypre_dsteqr ) +#define hypre_dsterf HYPRE_FIXEDPRECISION_FUNC ( hypre_dsterf ) +#define hypre_dsyev HYPRE_FIXEDPRECISION_FUNC ( hypre_dsyev ) +#define hypre_dsygs2 HYPRE_FIXEDPRECISION_FUNC ( hypre_dsygs2 ) +#define hypre_dsygst HYPRE_FIXEDPRECISION_FUNC ( hypre_dsygst ) +#define hypre_dsygv HYPRE_FIXEDPRECISION_FUNC ( hypre_dsygv ) +#define hypre_dsytd2 HYPRE_FIXEDPRECISION_FUNC ( hypre_dsytd2 ) +#define hypre_dsytrd HYPRE_FIXEDPRECISION_FUNC ( hypre_dsytrd ) +#define hypre_dtrti2 HYPRE_FIXEDPRECISION_FUNC ( hypre_dtrti2 ) +#define hypre_dtrtri HYPRE_FIXEDPRECISION_FUNC ( hypre_dtrtri ) +#define hypre_ieeeck HYPRE_FIXEDPRECISION_FUNC ( hypre_ieeeck ) +#define hypre_ilaenv HYPRE_FIXEDPRECISION_FUNC ( hypre_ilaenv ) +#define hypre_lapack_lsame HYPRE_FIXEDPRECISION_FUNC ( hypre_lapack_lsame ) +#define hypre_lapack_xerbla HYPRE_FIXEDPRECISION_FUNC ( hypre_lapack_xerbla ) + +#endif diff --git a/src/lapack/_hypre_lapack_mup_undef.h b/src/lapack/_hypre_lapack_mup_undef.h new file mode 100644 index 0000000000..26fc4ab45d --- /dev/null +++ b/src/lapack/_hypre_lapack_mup_undef.h @@ -0,0 +1,92 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#undef hypre_LAPACK_MUP_DEF_HEADER + +#undef hypre_dbdsqr +#undef hypre_dgebd2 +#undef hypre_dgebrd +#undef hypre_dgelq2 +#undef hypre_dgelqf +#undef hypre_dgels +#undef hypre_dgeqr2 +#undef hypre_dgeqrf +#undef hypre_dgesvd +#undef hypre_dgetf2 +#undef hypre_dgetrf +#undef hypre_dgetri +#undef hypre_dgetrs +#undef hypre_dlabad +#undef hypre_dlabrd +#undef hypre_dlacpy +#undef hypre_dlae2 +#undef hypre_dlaev2 +#undef hypre_dlamc1 +#undef hypre_dlamc2 +#undef hypre_dlamc3 +#undef hypre_dlamc4 +#undef hypre_dlamc5 +#undef hypre_dlamch +#undef hypre_dlange +#undef hypre_dlanst +#undef hypre_dlansy +#undef hypre_dlapy2 +#undef hypre_dlarf +#undef hypre_dlarfb +#undef hypre_dlarfg +#undef hypre_dlarft +#undef hypre_dlartg +#undef hypre_dlas2 +#undef hypre_dlascl +#undef hypre_dlaset +#undef hypre_dlasq1 +#undef hypre_dlasq2 +#undef hypre_dlasq3 +#undef hypre_dlasq4 +#undef hypre_dlasq5 +#undef hypre_dlasq6 +#undef hypre_dlasr +#undef hypre_dlasrt +#undef hypre_dlassq +#undef hypre_dlasv2 +#undef hypre_dlaswp +#undef hypre_dlatrd +#undef hypre_dorg2l +#undef hypre_dorg2r +#undef hypre_dorgbr +#undef hypre_dorgl2 +#undef hypre_dorglq +#undef hypre_dorgql +#undef hypre_dorgqr +#undef hypre_dorgtr +#undef hypre_dorm2r +#undef hypre_dormbr +#undef hypre_dorml2 +#undef hypre_dormlq +#undef hypre_dormqr +#undef hypre_dpotf2 +#undef hypre_dpotrf +#undef hypre_dpotrs +#undef hypre_dsteqr +#undef hypre_dsterf +#undef hypre_dsyev +#undef hypre_dsygs2 +#undef hypre_dsygst +#undef hypre_dsygv +#undef hypre_dsytd2 +#undef hypre_dsytrd +#undef hypre_dtrti2 +#undef hypre_dtrtri +#undef hypre_ieeeck +#undef hypre_ilaenv +#undef hypre_lapack_lsame +#undef hypre_lapack_xerbla diff --git a/src/lapack/hypre_lapack.h b/src/lapack/hypre_lapack.h index 0fec7348dd..082d4ea9ad 100644 --- a/src/lapack/hypre_lapack.h +++ b/src/lapack/hypre_lapack.h @@ -11,6 +11,10 @@ * This header renames the functions in LAPACK to avoid conflicts *--------------------------------------------------------------------------*/ +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_lapack_mup_def.h" +#endif + /* blas */ #define dasum_ hypre_dasum #define daxpy_ hypre_daxpy diff --git a/src/lapack/mup.fixed b/src/lapack/mup.fixed new file mode 100644 index 0000000000..46be33a012 --- /dev/null +++ b/src/lapack/mup.fixed @@ -0,0 +1,78 @@ +hypre_dbdsqr +hypre_dgebd2 +hypre_dgebrd +hypre_dgelq2 +hypre_dgelqf +hypre_dgels +hypre_dgeqr2 +hypre_dgeqrf +hypre_dgesvd +hypre_dgetf2 +hypre_dgetrf +hypre_dgetri +hypre_dgetrs +hypre_dlabad +hypre_dlabrd +hypre_dlacpy +hypre_dlae2 +hypre_dlaev2 +hypre_dlamc1 +hypre_dlamc2 +hypre_dlamc3 +hypre_dlamc4 +hypre_dlamc5 +hypre_dlamch +hypre_dlange +hypre_dlanst +hypre_dlansy +hypre_dlapy2 +hypre_dlarf +hypre_dlarfb +hypre_dlarfg +hypre_dlarft +hypre_dlartg +hypre_dlas2 +hypre_dlascl +hypre_dlaset +hypre_dlasq1 +hypre_dlasq2 +hypre_dlasq3 +hypre_dlasq4 +hypre_dlasq5 +hypre_dlasq6 +hypre_dlasr +hypre_dlasrt +hypre_dlassq +hypre_dlasv2 +hypre_dlaswp +hypre_dlatrd +hypre_dorg2l +hypre_dorg2r +hypre_dorgbr +hypre_dorgl2 +hypre_dorglq +hypre_dorgql +hypre_dorgqr +hypre_dorgtr +hypre_dorm2r +hypre_dormbr +hypre_dorml2 +hypre_dormlq +hypre_dormqr +hypre_dpotf2 +hypre_dpotrf +hypre_dpotrs +hypre_dsteqr +hypre_dsterf +hypre_dsyev +hypre_dsygs2 +hypre_dsygst +hypre_dsygv +hypre_dsytd2 +hypre_dsytrd +hypre_dtrti2 +hypre_dtrtri +hypre_ieeeck +hypre_ilaenv +hypre_lapack_lsame +hypre_lapack_xerbla diff --git a/src/lapack/mup.functions b/src/lapack/mup.functions new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/lapack/mup.methods b/src/lapack/mup.methods new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/lapack/mup_code b/src/lapack/mup_code new file mode 100755 index 0000000000..8f09eb3013 --- /dev/null +++ b/src/lapack/mup_code @@ -0,0 +1,11 @@ +#!/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) + +touch mup_fake_ext.h + +../config/gen_code.sh mup_fake_ext.h _hypre_lapack.h mup + +rm -f mup_fake_ext.h mup_fake_ext_mup.h diff --git a/src/lapack/mup_fixed.c b/src/lapack/mup_fixed.c new file mode 100644 index 0000000000..6f4f79f8c4 --- /dev/null +++ b/src/lapack/mup_fixed.c @@ -0,0 +1,355 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_lapack.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +hypre_dbdsqr( const char *uplo, HYPRE_Int *n, HYPRE_Int *ncvt, HYPRE_Int *nru, HYPRE_Int *ncc, HYPRE_Real *d__, HYPRE_Real *e, HYPRE_Real *vt, HYPRE_Int *ldvt, HYPRE_Real *u, HYPRE_Int *ldu, HYPRE_Real *c__, HYPRE_Int *ldc, HYPRE_Real *work, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dbdsqr)( uplo, n, ncvt, nru, ncc, d__, e, vt, ldvt, u, ldu, c__, ldc, work, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dgebd2( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *d__, HYPRE_Real *e, HYPRE_Real *tauq, HYPRE_Real *taup, HYPRE_Real *work, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dgebd2)( m, n, a, lda, d__, e, tauq, taup, work, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dgebrd( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *d__, HYPRE_Real *e, HYPRE_Real *tauq, HYPRE_Real *taup, HYPRE_Real *work, HYPRE_Int *lwork, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dgebrd)( m, n, a, lda, d__, e, tauq, taup, work, lwork, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dgelq2( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *tau, HYPRE_Real *work, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dgelq2)( m, n, a, lda, tau, work, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dgelqf( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *tau, HYPRE_Real *work, HYPRE_Int *lwork, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dgelqf)( m, n, a, lda, tau, work, lwork, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dgels( char *trans, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *nrhs, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *b, HYPRE_Int *ldb, HYPRE_Real *work, HYPRE_Int *lwork, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dgels)( trans, m, n, nrhs, a, lda, b, ldb, work, lwork, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dgeqr2( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *tau, HYPRE_Real *work, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dgeqr2)( m, n, a, lda, tau, work, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dgeqrf( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *tau, HYPRE_Real *work, HYPRE_Int *lwork, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dgeqrf)( m, n, a, lda, tau, work, lwork, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dgesvd( char *jobu, char *jobvt, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *s, HYPRE_Real *u, HYPRE_Int *ldu, HYPRE_Real *vt, HYPRE_Int *ldvt, HYPRE_Real *work, HYPRE_Int *lwork, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dgesvd)( jobu, jobvt, m, n, a, lda, s, u, ldu, vt, ldvt, work, lwork, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dgetf2( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Int *ipiv, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dgetf2)( m, n, a, lda, ipiv, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dgetrf( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Int *ipiv, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dgetrf)( m, n, a, lda, ipiv, info ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dgetri)( n, a, lda, ipiv, work, lwork, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dgetrs( const char *trans, HYPRE_Int *n, HYPRE_Int *nrhs, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Int *ipiv, HYPRE_Real *b, HYPRE_Int *ldb, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dgetrs)( trans, n, nrhs, a, lda, ipiv, b, ldb, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dlasq1( HYPRE_Int *n, HYPRE_Real *d__, HYPRE_Real *e, HYPRE_Real *work, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dlasq1)( n, d__, e, work, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dlasq2( HYPRE_Int *n, HYPRE_Real *z__, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dlasq2)( n, z__, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dlasrt( const char *id, HYPRE_Int *n, HYPRE_Real *d__, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dlasrt)( id, n, d__, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dorg2l( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *tau, HYPRE_Real *work, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dorg2l)( m, n, k, a, lda, tau, work, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dorg2r( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *tau, HYPRE_Real *work, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dorg2r)( m, n, k, a, lda, tau, work, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dorgbr( const char *vect, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *tau, HYPRE_Real *work, HYPRE_Int *lwork, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dorgbr)( vect, m, n, k, a, lda, tau, work, lwork, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dorgl2( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *tau, HYPRE_Real *work, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dorgl2)( m, n, k, a, lda, tau, work, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dorglq( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *tau, HYPRE_Real *work, HYPRE_Int *lwork, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dorglq)( m, n, k, a, lda, tau, work, lwork, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dorgql( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *tau, HYPRE_Real *work, HYPRE_Int *lwork, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dorgql)( m, n, k, a, lda, tau, work, lwork, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dorgqr( HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *tau, HYPRE_Real *work, HYPRE_Int *lwork, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dorgqr)( m, n, k, a, lda, tau, work, lwork, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dorgtr( const char *uplo, HYPRE_Int *n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *tau, HYPRE_Real *work, HYPRE_Int *lwork, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dorgtr)( uplo, n, a, lda, tau, work, lwork, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dorm2r( const char *side, const char *trans, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *tau, HYPRE_Real *c__, HYPRE_Int *ldc, HYPRE_Real *work, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dorm2r)( side, trans, m, n, k, a, lda, tau, c__, ldc, work, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dormbr( const char *vect, const char *side, const char *trans, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *tau, HYPRE_Real *c__, HYPRE_Int *ldc, HYPRE_Real *work, HYPRE_Int *lwork, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dormbr)( vect, side, trans, m, n, k, a, lda, tau, c__, ldc, work, lwork, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dorml2( const char *side, const char *trans, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *tau, HYPRE_Real *c__, HYPRE_Int *ldc, HYPRE_Real *work, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dorml2)( side, trans, m, n, k, a, lda, tau, c__, ldc, work, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dormlq( const char *side, const char *trans, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *tau, HYPRE_Real *c__, HYPRE_Int *ldc, HYPRE_Real *work, HYPRE_Int *lwork, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dormlq)( side, trans, m, n, k, a, lda, tau, c__, ldc, work, lwork, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dormqr( const char *side, const char *trans, HYPRE_Int *m, HYPRE_Int *n, HYPRE_Int *k, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *tau, HYPRE_Real *c__, HYPRE_Int *ldc, HYPRE_Real *work, HYPRE_Int *lwork, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dormqr)( side, trans, m, n, k, a, lda, tau, c__, ldc, work, lwork, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dpotf2( const char *uplo, HYPRE_Int *n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dpotf2)( uplo, n, a, lda, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dpotrf( const char *uplo, HYPRE_Int *n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dpotrf)( uplo, n, a, lda, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dpotrs( char *uplo, HYPRE_Int *n, HYPRE_Int *nrhs, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *b, HYPRE_Int *ldb, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dpotrs)( uplo, n, nrhs, a, lda, b, ldb, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dsteqr( const char *compz, HYPRE_Int *n, HYPRE_Real *d__, HYPRE_Real *e, HYPRE_Real *z__, HYPRE_Int *ldz, HYPRE_Real *work, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dsteqr)( compz, n, d__, e, z__, ldz, work, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dsterf( HYPRE_Int *n, HYPRE_Real *d__, HYPRE_Real *e, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dsterf)( n, d__, e, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dsyev( const char *jobz, const char *uplo, HYPRE_Int *n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *w, HYPRE_Real *work, HYPRE_Int *lwork, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dsyev)( jobz, uplo, n, a, lda, w, work, lwork, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dsygs2( HYPRE_Int *itype, const char *uplo, HYPRE_Int *n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *b, HYPRE_Int *ldb, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dsygs2)( itype, uplo, n, a, lda, b, ldb, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dsygst( HYPRE_Int *itype, const char *uplo, HYPRE_Int *n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *b, HYPRE_Int *ldb, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dsygst)( itype, uplo, n, a, lda, b, ldb, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dsygv)( itype, jobz, uplo, n, a, lda, b, ldb, w, work, lwork, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dsytd2( const char *uplo, HYPRE_Int *n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *d__, HYPRE_Real *e, HYPRE_Real *tau, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dsytd2)( uplo, n, a, lda, d__, e, tau, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dsytrd( const char *uplo, HYPRE_Int *n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Real *d__, HYPRE_Real *e, HYPRE_Real *tau, HYPRE_Real *work, HYPRE_Int *lwork, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dsytrd)( uplo, n, a, lda, d__, e, tau, work, lwork, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dtrti2( const char *uplo, const char *diag, HYPRE_Int *n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dtrti2)( uplo, diag, n, a, lda, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_dtrtri( const char *uplo, const char *diag, HYPRE_Int *n, HYPRE_Real *a, HYPRE_Int *lda, HYPRE_Int *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dtrtri)( uplo, diag, n, a, lda, info ); +} + + +#endif + diff --git a/src/lapack/mup_functions.c b/src/lapack/mup_functions.c new file mode 100644 index 0000000000..368dae9007 --- /dev/null +++ b/src/lapack/mup_functions.c @@ -0,0 +1,19 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_lapack.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + + + + +#endif + diff --git a/src/lapack/mup_pre.c b/src/lapack/mup_pre.c new file mode 100644 index 0000000000..368dae9007 --- /dev/null +++ b/src/lapack/mup_pre.c @@ -0,0 +1,19 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_lapack.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + + + + +#endif + diff --git a/src/lib/Makefile b/src/lib/Makefile index b77c431b00..9249543202 100644 --- a/src/lib/Makefile +++ b/src/lib/Makefile @@ -5,8 +5,139 @@ include ../config/Makefile.config -FEIHYPREFILES = ${HYPRE_FEI_HYPRE_FILES} -FEMLIFILES = ${HYPRE_FEI_FEMLI_FILES} +# Redefine AR to allow for files with the same name (but in different directories) +AR = ar -cq + +FEIHYPREFILES = ${HYPRE_FEI_HYPRE_FILES} +FEMLIFILES = ${HYPRE_FEI_FEMLI_FILES} + +# multiprecision build +ifeq (${MP_BUILD}, 1) + +IJMVFILES = ${HYPRE_SRC_TOP_DIR}/IJ_mv/*.o +IJMVFILES += ${HYPRE_SRC_TOP_DIR}/IJ_mv/*.o_flt +IJMVFILES += ${HYPRE_SRC_TOP_DIR}/IJ_mv/*.o_dbl +IJMVFILES += ${HYPRE_SRC_TOP_DIR}/IJ_mv/*.o_ldbl +IJMVFILES += ${HYPRE_SRC_TOP_DIR}/IJ_mv/*.obj_flt +IJMVFILES += ${HYPRE_SRC_TOP_DIR}/IJ_mv/*.obj_dbl +IJMVFILES += ${HYPRE_SRC_TOP_DIR}/IJ_mv/*.obj_ldbl + +EUCLIDFILES = ${HYPRE_SRC_TOP_DIR}/distributed_ls/Euclid/*.o_flt +EUCLIDFILES += ${HYPRE_SRC_TOP_DIR}/distributed_ls/Euclid/*.o_dbl +EUCLIDFILES += ${HYPRE_SRC_TOP_DIR}/distributed_ls/Euclid/*.o_ldbl + +PARASAILSFILES = ${HYPRE_SRC_TOP_DIR}/distributed_ls/ParaSails/*.o_flt +PARASAILSFILES += ${HYPRE_SRC_TOP_DIR}/distributed_ls/ParaSails/*.o_dbl +PARASAILSFILES += ${HYPRE_SRC_TOP_DIR}/distributed_ls/ParaSails/*.o_ldbl + +PILUTFILES = ${HYPRE_SRC_TOP_DIR}/distributed_ls/pilut/*.o_flt +PILUTFILES += ${HYPRE_SRC_TOP_DIR}/distributed_ls/pilut/*.o_dbl +PILUTFILES += ${HYPRE_SRC_TOP_DIR}/distributed_ls/pilut/*.o_ldbl + +DISTMATRIXFILES = ${HYPRE_SRC_TOP_DIR}/distributed_matrix/*.o_flt +DISTMATRIXFILES += ${HYPRE_SRC_TOP_DIR}/distributed_matrix/*.o_dbl +DISTMATRIXFILES += ${HYPRE_SRC_TOP_DIR}/distributed_matrix/*.o_ldbl + +KRYLOVFILES = ${HYPRE_SRC_TOP_DIR}/krylov/*.o +KRYLOVFILES += ${HYPRE_SRC_TOP_DIR}/krylov/*.o_flt +KRYLOVFILES += ${HYPRE_SRC_TOP_DIR}/krylov/*.o_dbl +KRYLOVFILES += ${HYPRE_SRC_TOP_DIR}/krylov/*.o_ldbl + +MATMATFILES = ${HYPRE_SRC_TOP_DIR}/matrix_matrix/*.o_flt +MATMATFILES += ${HYPRE_SRC_TOP_DIR}/matrix_matrix/*.o_dbl +MATMATFILES += ${HYPRE_SRC_TOP_DIR}/matrix_matrix/*.o_ldbl + +MULTIVECFILES = ${HYPRE_SRC_TOP_DIR}/multivector/*.o +MULTIVECFILES += ${HYPRE_SRC_TOP_DIR}/multivector/*.o_flt +MULTIVECFILES += ${HYPRE_SRC_TOP_DIR}/multivector/*.o_dbl +MULTIVECFILES += ${HYPRE_SRC_TOP_DIR}/multivector/*.o_ldbl + +PARCSRLSFILES = ${HYPRE_SRC_TOP_DIR}/parcsr_ls/*.o +PARCSRLSFILES += ${HYPRE_SRC_TOP_DIR}/parcsr_ls/*.o_flt +PARCSRLSFILES += ${HYPRE_SRC_TOP_DIR}/parcsr_ls/*.o_dbl +PARCSRLSFILES += ${HYPRE_SRC_TOP_DIR}/parcsr_ls/*.o_ldbl +PARCSRLSFILES += ${HYPRE_SRC_TOP_DIR}/parcsr_ls/*.obj_flt +PARCSRLSFILES += ${HYPRE_SRC_TOP_DIR}/parcsr_ls/*.obj_dbl +PARCSRLSFILES += ${HYPRE_SRC_TOP_DIR}/parcsr_ls/*.obj_ldbl + +PARCSRMVFILES = ${HYPRE_SRC_TOP_DIR}/parcsr_mv/*.o +PARCSRMVFILES += ${HYPRE_SRC_TOP_DIR}/parcsr_mv/*.o_flt +PARCSRMVFILES += ${HYPRE_SRC_TOP_DIR}/parcsr_mv/*.o_dbl +PARCSRMVFILES += ${HYPRE_SRC_TOP_DIR}/parcsr_mv/*.o_ldbl +PARCSRMVFILES += ${HYPRE_SRC_TOP_DIR}/parcsr_mv/*.obj_flt +PARCSRMVFILES += ${HYPRE_SRC_TOP_DIR}/parcsr_mv/*.obj_dbl +PARCSRMVFILES += ${HYPRE_SRC_TOP_DIR}/parcsr_mv/*.obj_ldbl + +PARCSRBLOCKMVFILES = ${HYPRE_SRC_TOP_DIR}/parcsr_block_mv/*.o_flt +PARCSRBLOCKMVFILES += ${HYPRE_SRC_TOP_DIR}/parcsr_block_mv/*.o_dbl +PARCSRBLOCKMVFILES += ${HYPRE_SRC_TOP_DIR}/parcsr_block_mv/*.o_ldbl + +SEQMVFILES = ${HYPRE_SRC_TOP_DIR}/seq_mv/*.o +SEQMVFILES += ${HYPRE_SRC_TOP_DIR}/seq_mv/*.o_flt +SEQMVFILES += ${HYPRE_SRC_TOP_DIR}/seq_mv/*.o_dbl +SEQMVFILES += ${HYPRE_SRC_TOP_DIR}/seq_mv/*.o_ldbl +SEQMVFILES += ${HYPRE_SRC_TOP_DIR}/seq_mv/*.obj_flt +SEQMVFILES += ${HYPRE_SRC_TOP_DIR}/seq_mv/*.obj_dbl +SEQMVFILES += ${HYPRE_SRC_TOP_DIR}/seq_mv/*.obj_ldbl + +SEQBLOCKMVFILES = ${HYPRE_SRC_TOP_DIR}/seq_block_mv/*.o +SEQBLOCKMVFILES += ${HYPRE_SRC_TOP_DIR}/seq_block_mv/*.o_flt +SEQBLOCKMVFILES += ${HYPRE_SRC_TOP_DIR}/seq_block_mv/*.o_dbl +SEQBLOCKMVFILES += ${HYPRE_SRC_TOP_DIR}/seq_block_mv/*.o_ldbl + +SSTRUCTLSFILES = ${HYPRE_SRC_TOP_DIR}/sstruct_ls/*.o +SSTRUCTLSFILES += ${HYPRE_SRC_TOP_DIR}/sstruct_ls/*.o_flt +SSTRUCTLSFILES += ${HYPRE_SRC_TOP_DIR}/sstruct_ls/*.o_dbl +SSTRUCTLSFILES += ${HYPRE_SRC_TOP_DIR}/sstruct_ls/*.o_ldbl +SSTRUCTLSFILES += ${HYPRE_SRC_TOP_DIR}/sstruct_ls/*.obj_flt +SSTRUCTLSFILES += ${HYPRE_SRC_TOP_DIR}/sstruct_ls/*.obj_dbl +SSTRUCTLSFILES += ${HYPRE_SRC_TOP_DIR}/sstruct_ls/*.obj_ldbl + +SSTRUCTMVFILES = ${HYPRE_SRC_TOP_DIR}/sstruct_mv/*.o +SSTRUCTMVFILES += ${HYPRE_SRC_TOP_DIR}/sstruct_mv/*.o_flt +SSTRUCTMVFILES += ${HYPRE_SRC_TOP_DIR}/sstruct_mv/*.o_dbl +SSTRUCTMVFILES += ${HYPRE_SRC_TOP_DIR}/sstruct_mv/*.o_ldbl +SSTRUCTMVFILES += ${HYPRE_SRC_TOP_DIR}/sstruct_mv/*.obj_flt +SSTRUCTMVFILES += ${HYPRE_SRC_TOP_DIR}/sstruct_mv/*.obj_dbl +SSTRUCTMVFILES += ${HYPRE_SRC_TOP_DIR}/sstruct_mv/*.obj_ldbl + +STRUCTLSFILES = ${HYPRE_SRC_TOP_DIR}/struct_ls/*.o +STRUCTLSFILES += ${HYPRE_SRC_TOP_DIR}/struct_ls/*.o_flt +STRUCTLSFILES += ${HYPRE_SRC_TOP_DIR}/struct_ls/*.o_dbl +STRUCTLSFILES += ${HYPRE_SRC_TOP_DIR}/struct_ls/*.o_ldbl +STRUCTLSFILES += ${HYPRE_SRC_TOP_DIR}/struct_ls/*.obj_flt +STRUCTLSFILES += ${HYPRE_SRC_TOP_DIR}/struct_ls/*.obj_dbl +STRUCTLSFILES += ${HYPRE_SRC_TOP_DIR}/struct_ls/*.obj_ldbl + +STRUCTMVFILES = ${HYPRE_SRC_TOP_DIR}/struct_mv/*.o +STRUCTMVFILES += ${HYPRE_SRC_TOP_DIR}/struct_mv/*.o_flt +STRUCTMVFILES += ${HYPRE_SRC_TOP_DIR}/struct_mv/*.o_dbl +STRUCTMVFILES += ${HYPRE_SRC_TOP_DIR}/struct_mv/*.o_ldbl +STRUCTMVFILES += ${HYPRE_SRC_TOP_DIR}/struct_mv/*.obj_flt +STRUCTMVFILES += ${HYPRE_SRC_TOP_DIR}/struct_mv/*.obj_dbl +STRUCTMVFILES += ${HYPRE_SRC_TOP_DIR}/struct_mv/*.obj_ldbl + +UTILITIESFILES = ${HYPRE_SRC_TOP_DIR}/utilities/*.o +UTILITIESFILES += ${HYPRE_SRC_TOP_DIR}/utilities/*.o_flt +UTILITIESFILES += ${HYPRE_SRC_TOP_DIR}/utilities/*.o_dbl +UTILITIESFILES += ${HYPRE_SRC_TOP_DIR}/utilities/*.o_ldbl +UTILITIESFILES += ${HYPRE_SRC_TOP_DIR}/utilities/*.obj_flt +UTILITIESFILES += ${HYPRE_SRC_TOP_DIR}/utilities/*.obj_dbl +UTILITIESFILES += ${HYPRE_SRC_TOP_DIR}/utilities/*.obj_ldbl + +BLASFILES = ${HYPRE_SRC_TOP_DIR}/blas/*.o +BLASFILES += ${HYPRE_SRC_TOP_DIR}/blas/*.o_flt +BLASFILES += ${HYPRE_SRC_TOP_DIR}/blas/*.o_dbl +BLASFILES += ${HYPRE_SRC_TOP_DIR}/blas/*.o_ldbl + +LAPACKFILES = ${HYPRE_SRC_TOP_DIR}/lapack/*.o +LAPACKFILES += ${HYPRE_SRC_TOP_DIR}/lapack/*.o_flt +LAPACKFILES += ${HYPRE_SRC_TOP_DIR}/lapack/*.o_dbl +LAPACKFILES += ${HYPRE_SRC_TOP_DIR}/lapack/*.o_ldbl + +# normal build +else + IJMVFILES = ${HYPRE_SRC_TOP_DIR}/IJ_mv/*.o ${HYPRE_SRC_TOP_DIR}/IJ_mv/*.obj EUCLIDFILES = ${HYPRE_EUCLID_FILES} PARASAILSFILES = ${HYPRE_PARASAILS_FILES} @@ -28,6 +159,8 @@ UTILITIESFILES = ${HYPRE_SRC_TOP_DIR}/utilities/*.o ${HYPRE_SRC_TOP_DIR}/uti BLASFILES = ${HYPRE_SRC_TOP_DIR}/blas/*.o LAPACKFILES = ${HYPRE_SRC_TOP_DIR}/lapack/*.o +endif + FILES_HYPRE = \ $(FEIHYPREFILES)\ $(FEMLIFILES)\ diff --git a/src/matrix_matrix/CMakeLists.txt b/src/matrix_matrix/CMakeLists.txt index f47b69c76a..10edc75755 100644 --- a/src/matrix_matrix/CMakeLists.txt +++ b/src/matrix_matrix/CMakeLists.txt @@ -3,19 +3,27 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -set(HDRS - HYPRE_matrix_matrix_protos.h -) +set(HDRS "") + +# Add MUP headers +if(HYPRE_ENABLE_MIXED_PRECISION) + list(APPEND HDRS + _hypre_matrix_matrix_mup_def.h + ) +endif() -set(SRCS +# Regular sources +set(REGULAR_SRCS HYPRE_ConvertParCSRMatrixToDistributedMatrix.c HYPRE_ConvertPETScMatrixToDistributedMatrix.c ) -target_sources(${PROJECT_NAME} - PRIVATE ${SRCS} - ${HDRS} -) +if(HYPRE_ENABLE_MIXED_PRECISION) + setup_mixed_precision_compilation("matrix_matrix" SRCS "${REGULAR_SRCS}") + target_sources(${PROJECT_NAME} PRIVATE ${HDRS}) +else() + target_sources(${PROJECT_NAME} PRIVATE ${REGULAR_SRCS} ${HDRS}) +endif() convert_filenames_to_full_paths(HDRS) set(HYPRE_HEADERS ${HYPRE_HEADERS} ${HDRS} PARENT_SCOPE) diff --git a/src/matrix_matrix/HYPRE_ConvertParCSRMatrixToDistributedMatrix.c b/src/matrix_matrix/HYPRE_ConvertParCSRMatrixToDistributedMatrix.c index f16f73041a..a3ecfb7175 100644 --- a/src/matrix_matrix/HYPRE_ConvertParCSRMatrixToDistributedMatrix.c +++ b/src/matrix_matrix/HYPRE_ConvertParCSRMatrixToDistributedMatrix.c @@ -27,6 +27,9 @@ /* Matrix prototypes for ParCSR */ #include "HYPRE_parcsr_mv.h" +/* matrix_matrix protos */ +#include "HYPRE_matrix_matrix_protos.h" + /*-------------------------------------------------------------------------- * HYPRE_ConvertParCSRMatrixToDistributedMatrix *--------------------------------------------------------------------------*/ diff --git a/src/matrix_matrix/HYPRE_matrix_matrix_protos.h b/src/matrix_matrix/HYPRE_matrix_matrix_protos.h index 5cb9726618..4cbe5e2e10 100644 --- a/src/matrix_matrix/HYPRE_matrix_matrix_protos.h +++ b/src/matrix_matrix/HYPRE_matrix_matrix_protos.h @@ -7,6 +7,10 @@ #include "HYPRE_distributed_matrix_types.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_matrix_matrix_mup_def.h" +#endif + #ifdef PETSC_AVAILABLE /* HYPRE_ConvertPETScMatrixToDistributedMatrix.c */ HYPRE_Int HYPRE_ConvertPETScMatrixToDistributedMatrix (Mat PETSc_matrix, diff --git a/src/matrix_matrix/Makefile b/src/matrix_matrix/Makefile index 97263c3f48..a5fa867d2d 100644 --- a/src/matrix_matrix/Makefile +++ b/src/matrix_matrix/Makefile @@ -27,6 +27,16 @@ FILES =\ OBJS = ${FILES:.c=.o} +ifeq (${MP_BUILD}, 1) + +COBJS_single = ${FILES:.c=.o_flt} +COBJS_double = ${FILES:.c=.o_dbl} +COBJS_longdouble = ${FILES:.c=.o_ldbl} + +OBJS = ${COBJS_single} ${COBJS_double} ${COBJS_longdouble} + +endif + SONAME = libHYPRE_MatrixMatrix-${HYPRE_RELEASE_VERSION}${HYPRE_LIB_SUFFIX} ################################################################## @@ -34,15 +44,14 @@ SONAME = libHYPRE_MatrixMatrix-${HYPRE_RELEASE_VERSION}${HYPRE_LIB_SUFFIX} ################################################################## all: libHYPRE_MatrixMatrix${HYPRE_LIB_SUFFIX} - cp -fR $(srcdir)/HYPRE_*.h $(HYPRE_BUILD_DIR)/include # cp -fR libHYPRE* $(HYPRE_BUILD_DIR)/lib install: libHYPRE_MatrixMatrix${HYPRE_LIB_SUFFIX} - cp -fR $(srcdir)/HYPRE_*.h $(HYPRE_INC_INSTALL) # cp -fR libHYPRE* $(HYPRE_LIB_INSTALL) clean: rm -f *.o lib* + rm -f *.o_flt *.o_dbl *.o_ldbl rm -rf pchdir tca.map *inslog* distclean: clean diff --git a/src/matrix_matrix/_hypre_matrix_matrix_mup_def.h b/src/matrix_matrix/_hypre_matrix_matrix_mup_def.h new file mode 100644 index 0000000000..dd5360ce17 --- /dev/null +++ b/src/matrix_matrix/_hypre_matrix_matrix_mup_def.h @@ -0,0 +1,20 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#ifndef hypre_MATRIX_MATRIX_MUP_DEF_HEADER +#define hypre_MATRIX_MATRIX_MUP_DEF_HEADER + +#include "_hypre_mup_def.h" + +#define HYPRE_ConvertParCSRMatrixToDistributedMatrix HYPRE_FIXEDPRECISION_FUNC ( HYPRE_ConvertParCSRMatrixToDistributedMatrix ) + +#endif diff --git a/src/matrix_matrix/internal_protos.h b/src/matrix_matrix/internal_protos.h index 3df8943552..b46e83d61e 100644 --- a/src/matrix_matrix/internal_protos.h +++ b/src/matrix_matrix/internal_protos.h @@ -5,6 +5,10 @@ * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_matrix_matrix_mup_def.h" +#endif + /* HYPRE_ConvertPETScMatrixToDistributedMatrix.c */ HYPRE_Int HYPRE_ConvertPETScMatrixToDistributedMatrix (Mat PETSc_matrix, HYPRE_DistributedMatrix *DistributedMatrix ); diff --git a/src/matrix_matrix/mup.fixed b/src/matrix_matrix/mup.fixed new file mode 100644 index 0000000000..796364e36d --- /dev/null +++ b/src/matrix_matrix/mup.fixed @@ -0,0 +1 @@ +HYPRE_ConvertParCSRMatrixToDistributedMatrix diff --git a/src/matrix_matrix/mup.functions b/src/matrix_matrix/mup.functions new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/matrix_matrix/mup.methods b/src/matrix_matrix/mup.methods new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/matrix_matrix/mup_code b/src/matrix_matrix/mup_code new file mode 100755 index 0000000000..882db5c77d --- /dev/null +++ b/src/matrix_matrix/mup_code @@ -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) + +touch mup_fake_ext.h +cat internal_protos.h > mup_fake_int.h + +../config/gen_code.sh mup_fake_ext.h mup_fake_int.h onlydef + +rm -f mup_fake_ext.h +rm -f mup_fake_int.h + +# Replace MUP_FAKE_INT +sed 's/MUP_FAKE_INT/MATRIX_MATRIX/' mup_fake_int_mup_def.h > _hypre_matrix_matrix_mup_def.h +rm -f mup_fake_int_mup_def.h diff --git a/src/multivector/CMakeLists.txt b/src/multivector/CMakeLists.txt index ad396ed3a5..148dcefe57 100644 --- a/src/multivector/CMakeLists.txt +++ b/src/multivector/CMakeLists.txt @@ -4,25 +4,33 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) set(HDRS - csr_matmultivec.h - interpreter.h - multivector.h - par_csr_matmultivec.h - par_csr_pmvcomm.h - par_multivector.h - seq_multivector.h - temp_multivector.h + _hypre_lobpcg_interpreter.h + _hypre_lobpcg_multivector.h + _hypre_lobpcg_temp_multivector.h + _hypre_lobpcg_csr_matmultivec.h + _hypre_lobpcg_par_csr_matmultivec.h + _hypre_lobpcg_par_csr_pmvcomm.h + _hypre_lobpcg_par_multivector.h + _hypre_lobpcg_seq_multivector.h ) -set(SRCS +# Add MUP headers +if(HYPRE_ENABLE_MIXED_PRECISION) + list(APPEND HDRS + _hypre_multivector_mup_def.h + ) +endif() + +# Regular sources +set(REGULAR_SRCS multivector.c temp_multivector.c ) -target_sources(${PROJECT_NAME} - PRIVATE ${SRCS} - ${HDRS} -) +if (HYPRE_ENABLE_MIXED_PRECISION) + setup_mixed_precision_compilation("multivector" SRCS "${REGULAR_SRCS}") +endif() +target_sources(${PROJECT_NAME} PRIVATE ${REGULAR_SRCS} ${HDRS}) convert_filenames_to_full_paths(HDRS) set(HYPRE_HEADERS ${HYPRE_HEADERS} ${HDRS} PARENT_SCOPE) diff --git a/src/multivector/Makefile b/src/multivector/Makefile index 2811c2fd38..f75e7d9c84 100644 --- a/src/multivector/Makefile +++ b/src/multivector/Makefile @@ -14,14 +14,25 @@ C_COMPILE_FLAGS = \ ${CINCLUDES} HEADERS =\ - multivector.h\ - temp_multivector.h + _hypre_lobpcg_multivector.h\ + _hypre_lobpcg_temp_multivector.h FILES =\ multivector.c\ temp_multivector.c -OBJS = ${FILES:.c=.o} +COBJS = ${FILES:.c=.o} +OBJS = ${COBJS} + +ifeq (${MP_BUILD}, 1) + +COBJS_single = ${FILES:.c=.o_flt} +COBJS_double = ${FILES:.c=.o_dbl} +COBJS_longdouble = ${FILES:.c=.o_ldbl} + +OBJS = ${COBJS} ${COBJS_single} ${COBJS_double} ${COBJS_longdouble} + +endif SONAME = libHYPRE_multivector-${HYPRE_RELEASE_VERSION}${HYPRE_LIB_SUFFIX} @@ -39,6 +50,7 @@ install: libHYPRE_multivector${HYPRE_LIB_SUFFIX} clean: rm -f *.o libHYPRE* + rm -f *.o_flt *.o_dbl *.o_ldbl rm -rf pchdir tca.map *inslog* distclean: clean diff --git a/src/multivector/csr_matmultivec.h b/src/multivector/_hypre_lobpcg_csr_matmultivec.h similarity index 95% rename from src/multivector/csr_matmultivec.h rename to src/multivector/_hypre_lobpcg_csr_matmultivec.h index 92bcd54e45..cb36081023 100644 --- a/src/multivector/csr_matmultivec.h +++ b/src/multivector/_hypre_lobpcg_csr_matmultivec.h @@ -8,8 +8,8 @@ #ifndef CSR_MULTIMATVEC_H #define CSR_MULTIMATVEC_H -#include "seq_mv.h" -#include "seq_multivector.h" +#include "_hypre_seq_mv.h" +#include "_hypre_lobpcg_seq_multivector.h" #ifdef __cplusplus extern "C" { diff --git a/src/multivector/interpreter.h b/src/multivector/_hypre_lobpcg_interpreter.h similarity index 96% rename from src/multivector/interpreter.h rename to src/multivector/_hypre_lobpcg_interpreter.h index 468eeca69a..f16913161c 100644 --- a/src/multivector/interpreter.h +++ b/src/multivector/_hypre_lobpcg_interpreter.h @@ -10,6 +10,10 @@ #include "HYPRE_utilities.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_multivector_mup_def.h" +#endif + typedef struct { /* vector operations */ diff --git a/src/multivector/multivector.h b/src/multivector/_hypre_lobpcg_multivector.h similarity index 98% rename from src/multivector/multivector.h rename to src/multivector/_hypre_lobpcg_multivector.h index 7fef6af343..04f61d1768 100644 --- a/src/multivector/multivector.h +++ b/src/multivector/_hypre_lobpcg_multivector.h @@ -9,7 +9,7 @@ #define MULTIVECTOR_FUNCTION_PROTOTYPES #include "HYPRE_utilities.h" -#include "interpreter.h" +#include "_hypre_lobpcg_interpreter.h" /* abstract multivector */ typedef struct mv_MultiVector* mv_MultiVectorPtr; diff --git a/src/multivector/par_csr_matmultivec.h b/src/multivector/_hypre_lobpcg_par_csr_matmultivec.h similarity index 96% rename from src/multivector/par_csr_matmultivec.h rename to src/multivector/_hypre_lobpcg_par_csr_matmultivec.h index 74cc2c7315..d3297d9a09 100644 --- a/src/multivector/par_csr_matmultivec.h +++ b/src/multivector/_hypre_lobpcg_par_csr_matmultivec.h @@ -15,7 +15,7 @@ #define PAR_CSR_MATMULTIVEC_HEADER #include "_hypre_parcsr_mv.h" -#include "par_multivector.h" +#include "_hypre_lobpcg_par_multivector.h" #ifdef __cplusplus extern "C" { diff --git a/src/multivector/par_csr_pmvcomm.h b/src/multivector/_hypre_lobpcg_par_csr_pmvcomm.h similarity index 100% rename from src/multivector/par_csr_pmvcomm.h rename to src/multivector/_hypre_lobpcg_par_csr_pmvcomm.h diff --git a/src/multivector/par_multivector.h b/src/multivector/_hypre_lobpcg_par_multivector.h similarity index 99% rename from src/multivector/par_multivector.h rename to src/multivector/_hypre_lobpcg_par_multivector.h index 358c01eaf4..6f72c7b533 100644 --- a/src/multivector/par_multivector.h +++ b/src/multivector/_hypre_lobpcg_par_multivector.h @@ -14,7 +14,7 @@ #define hypre_PAR_MULTIVECTOR_HEADER #include "_hypre_utilities.h" -#include "seq_Multivector.h" +#include "_hypre_lobpcg_seq_multivector.h" #ifdef __cplusplus extern "C" { diff --git a/src/multivector/seq_multivector.h b/src/multivector/_hypre_lobpcg_seq_multivector.h similarity index 100% rename from src/multivector/seq_multivector.h rename to src/multivector/_hypre_lobpcg_seq_multivector.h diff --git a/src/multivector/temp_multivector.h b/src/multivector/_hypre_lobpcg_temp_multivector.h similarity index 99% rename from src/multivector/temp_multivector.h rename to src/multivector/_hypre_lobpcg_temp_multivector.h index fb2ee9e410..e0dcd84195 100644 --- a/src/multivector/temp_multivector.h +++ b/src/multivector/_hypre_lobpcg_temp_multivector.h @@ -8,7 +8,7 @@ #ifndef TEMPORARY_MULTIVECTOR_FUNCTION_PROTOTYPES #define TEMPORARY_MULTIVECTOR_FUNCTION_PROTOTYPES -#include "interpreter.h" +#include "_hypre_lobpcg_interpreter.h" typedef struct { @@ -138,4 +138,3 @@ mv_TempMultiVectorEval( void (*f)( void*, void*, void* ), void* par, #endif #endif /* MULTIVECTOR_FUNCTION_PROTOTYPES */ - diff --git a/src/multivector/_hypre_multivector_mup_def.h b/src/multivector/_hypre_multivector_mup_def.h new file mode 100644 index 0000000000..3189b7353b --- /dev/null +++ b/src/multivector/_hypre_multivector_mup_def.h @@ -0,0 +1,53 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#ifndef hypre_MULTIVECTOR_MUP_DEF_HEADER +#define hypre_MULTIVECTOR_MUP_DEF_HEADER + +#include "_hypre_mup_def.h" + +#define mv_MultiVectorAxpy HYPRE_FIXEDPRECISION_FUNC ( mv_MultiVectorAxpy ) +#define mv_MultiVectorByDiagonal HYPRE_FIXEDPRECISION_FUNC ( mv_MultiVectorByDiagonal ) +#define mv_MultiVectorByMatrix HYPRE_FIXEDPRECISION_FUNC ( mv_MultiVectorByMatrix ) +#define mv_MultiVectorByMultiVector HYPRE_FIXEDPRECISION_FUNC ( mv_MultiVectorByMultiVector ) +#define mv_MultiVectorByMultiVectorDiag HYPRE_FIXEDPRECISION_FUNC ( mv_MultiVectorByMultiVectorDiag ) +#define mv_MultiVectorClear HYPRE_FIXEDPRECISION_FUNC ( mv_MultiVectorClear ) +#define mv_MultiVectorCopy HYPRE_FIXEDPRECISION_FUNC ( mv_MultiVectorCopy ) +#define mv_MultiVectorCreateCopy HYPRE_FIXEDPRECISION_FUNC ( mv_MultiVectorCreateCopy ) +#define mv_MultiVectorCreateFromSampleVector HYPRE_FIXEDPRECISION_FUNC ( mv_MultiVectorCreateFromSampleVector ) +#define mv_MultiVectorDestroy HYPRE_FIXEDPRECISION_FUNC ( mv_MultiVectorDestroy ) +#define mv_MultiVectorEval HYPRE_FIXEDPRECISION_FUNC ( mv_MultiVectorEval ) +#define mv_MultiVectorGetData HYPRE_FIXEDPRECISION_FUNC ( mv_MultiVectorGetData ) +#define mv_MultiVectorHeight HYPRE_FIXEDPRECISION_FUNC ( mv_MultiVectorHeight ) +#define mv_MultiVectorSetMask HYPRE_FIXEDPRECISION_FUNC ( mv_MultiVectorSetMask ) +#define mv_MultiVectorSetRandom HYPRE_FIXEDPRECISION_FUNC ( mv_MultiVectorSetRandom ) +#define mv_MultiVectorWidth HYPRE_FIXEDPRECISION_FUNC ( mv_MultiVectorWidth ) +#define mv_MultiVectorWrap HYPRE_FIXEDPRECISION_FUNC ( mv_MultiVectorWrap ) +#define mv_MultiVectorXapy HYPRE_FIXEDPRECISION_FUNC ( mv_MultiVectorXapy ) +#define mv_TempMultiVectorAxpy HYPRE_FIXEDPRECISION_FUNC ( mv_TempMultiVectorAxpy ) +#define mv_TempMultiVectorByDiagonal HYPRE_FIXEDPRECISION_FUNC ( mv_TempMultiVectorByDiagonal ) +#define mv_TempMultiVectorByMatrix HYPRE_FIXEDPRECISION_FUNC ( mv_TempMultiVectorByMatrix ) +#define mv_TempMultiVectorByMultiVector HYPRE_FIXEDPRECISION_FUNC ( mv_TempMultiVectorByMultiVector ) +#define mv_TempMultiVectorByMultiVectorDiag HYPRE_FIXEDPRECISION_FUNC ( mv_TempMultiVectorByMultiVectorDiag ) +#define mv_TempMultiVectorClear HYPRE_FIXEDPRECISION_FUNC ( mv_TempMultiVectorClear ) +#define mv_TempMultiVectorCopy HYPRE_FIXEDPRECISION_FUNC ( mv_TempMultiVectorCopy ) +#define mv_TempMultiVectorCreateCopy HYPRE_FIXEDPRECISION_FUNC ( mv_TempMultiVectorCreateCopy ) +#define mv_TempMultiVectorCreateFromSampleVector HYPRE_FIXEDPRECISION_FUNC ( mv_TempMultiVectorCreateFromSampleVector ) +#define mv_TempMultiVectorDestroy HYPRE_FIXEDPRECISION_FUNC ( mv_TempMultiVectorDestroy ) +#define mv_TempMultiVectorEval HYPRE_FIXEDPRECISION_FUNC ( mv_TempMultiVectorEval ) +#define mv_TempMultiVectorHeight HYPRE_FIXEDPRECISION_FUNC ( mv_TempMultiVectorHeight ) +#define mv_TempMultiVectorSetMask HYPRE_FIXEDPRECISION_FUNC ( mv_TempMultiVectorSetMask ) +#define mv_TempMultiVectorSetRandom HYPRE_FIXEDPRECISION_FUNC ( mv_TempMultiVectorSetRandom ) +#define mv_TempMultiVectorWidth HYPRE_FIXEDPRECISION_FUNC ( mv_TempMultiVectorWidth ) +#define mv_TempMultiVectorXapy HYPRE_FIXEDPRECISION_FUNC ( mv_TempMultiVectorXapy ) + +#endif diff --git a/src/multivector/csr_matmultivec.c b/src/multivector/csr_matmultivec.c index 192d736969..2651a63208 100644 --- a/src/multivector/csr_matmultivec.c +++ b/src/multivector/csr_matmultivec.c @@ -12,8 +12,8 @@ *****************************************************************************/ #include "csr_multimatvec.h" -#include "seq_mv.h" -#include "seq_multivector.h" +#include "_hypre_seq_mv.h" +#include "_hypre_lobpcg_seq_multivector.h" /*-------------------------------------------------------------------------- * hypre_CSRMatrixMultiMatvec @@ -305,4 +305,3 @@ hypre_CSRMatrixMatMultivecT(HYPRE_Complex alpha, hypre_CSRMatrix *A, return ierr; } - diff --git a/src/multivector/multivector.c b/src/multivector/multivector.c index 94af6473d1..b7e94b60a0 100644 --- a/src/multivector/multivector.c +++ b/src/multivector/multivector.c @@ -8,7 +8,7 @@ #include #include -#include "multivector.h" +#include "_hypre_lobpcg_multivector.h" #include "_hypre_utilities.h" /* abstract multivector */ diff --git a/src/multivector/mup.fixed b/src/multivector/mup.fixed new file mode 100644 index 0000000000..2735870b93 --- /dev/null +++ b/src/multivector/mup.fixed @@ -0,0 +1,34 @@ +mv_MultiVectorAxpy +mv_MultiVectorByDiagonal +mv_MultiVectorByMatrix +mv_MultiVectorByMultiVector +mv_MultiVectorByMultiVectorDiag +mv_MultiVectorClear +mv_MultiVectorCopy +mv_MultiVectorCreateCopy +mv_MultiVectorCreateFromSampleVector +mv_MultiVectorDestroy +mv_MultiVectorEval +mv_MultiVectorGetData +mv_MultiVectorHeight +mv_MultiVectorSetMask +mv_MultiVectorSetRandom +mv_MultiVectorWidth +mv_MultiVectorWrap +mv_MultiVectorXapy +mv_TempMultiVectorAxpy +mv_TempMultiVectorByDiagonal +mv_TempMultiVectorByMatrix +mv_TempMultiVectorByMultiVector +mv_TempMultiVectorByMultiVectorDiag +mv_TempMultiVectorClear +mv_TempMultiVectorCopy +mv_TempMultiVectorCreateCopy +mv_TempMultiVectorCreateFromSampleVector +mv_TempMultiVectorDestroy +mv_TempMultiVectorEval +mv_TempMultiVectorHeight +mv_TempMultiVectorSetMask +mv_TempMultiVectorSetRandom +mv_TempMultiVectorWidth +mv_TempMultiVectorXapy diff --git a/src/multivector/mup.functions b/src/multivector/mup.functions new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/multivector/mup.methods b/src/multivector/mup.methods new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/multivector/mup_code b/src/multivector/mup_code new file mode 100755 index 0000000000..fbe10712b6 --- /dev/null +++ b/src/multivector/mup_code @@ -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) + +touch mup_fake_ext.h +cat *.h > mup_fake_int.h + +../config/gen_code.sh mup_fake_ext.h mup_fake_int.h onlydef + +rm -f mup_fake_ext.h +rm -f mup_fake_int.h + +# rename def file and header guard +sed 's/MUP_FAKE_INT/MULTIVECTOR/' mup_fake_int_mup_def.h > _hypre_multivector_mup_def.h +rm -f mup_fake_int_mup_def.h diff --git a/src/multivector/par_csr_matmultivec.c b/src/multivector/par_csr_matmultivec.c index 0d10a8c338..62df8757b1 100644 --- a/src/multivector/par_csr_matmultivec.c +++ b/src/multivector/par_csr_matmultivec.c @@ -11,14 +11,13 @@ * *****************************************************************************/ -#include "par_csr_multimatvec.h" - #include "_hypre_parcsr_mv.h" -#include "seq_multivector.h" -#include "par_multivector.h" -#include "par_csr_pmvcomm.h" -#include "csr_multimatvec.h" +#include "_hypre_lobpcg_seq_multivector.h" +#include "_hypre_lobpcg_par_multivector.h" +#include "_hypre_lobpcg_par_csr_pmvcomm.h" +#include "_hypre_lobpcg_csr_multimatvec.h" +#include "_hypre_lobpcg_par_csr_multimatvec.h" /*-------------------------------------------------------------------------- * hypre_ParCSRMatrixMultiMatvec @@ -276,4 +275,3 @@ hypre_ParCSRMatrixMultiMatVecT(HYPRE_Complex alpha, hypre_ParCSRMatrix *A, return ierr; } - diff --git a/src/multivector/par_csr_pmvcomm.c b/src/multivector/par_csr_pmvcomm.c index 75ca4bfd34..d22a555544 100644 --- a/src/multivector/par_csr_pmvcomm.c +++ b/src/multivector/par_csr_pmvcomm.c @@ -5,8 +5,7 @@ * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ -#include "par_csr_pmvcomm.h" - +#include "_hypre_lobpcg_par_csr_pmvcomm.h" #include "_hypre_parcsr_mv.h" /*==========================================================================*/ @@ -135,4 +134,3 @@ hypre_ParCSRCommMultiHandleDestroy(hypre_ParCSRCommMultiHandle *comm_handle) return ierr; } - diff --git a/src/multivector/par_multivector.c b/src/multivector/par_multivector.c index 00f6d278fb..08db9685c5 100644 --- a/src/multivector/par_multivector.c +++ b/src/multivector/par_multivector.c @@ -10,13 +10,13 @@ #include #include -#include "par_multivector.h" -#include "seq_multivector.h" +#include "_hypre_lobpcg_par_multivector.h" +#include "_hypre_lobpcg_seq_multivector.h" #include "_hypre_utilities.h" /* for temporary implementation of multivectorRead, multivectorPrint */ -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #include "_hypre_parcsr_mv.h" /*-------------------------------------------------------------------------- diff --git a/src/multivector/seq_multivector.c b/src/multivector/seq_multivector.c index 970af41885..ce8e747d1a 100644 --- a/src/multivector/seq_multivector.c +++ b/src/multivector/seq_multivector.c @@ -11,7 +11,7 @@ * *****************************************************************************/ -#include "seq_multivector.h" +#include "_hypre_lobpcg_seq_multivector.h" #include "_hypre_utilities.h" #include @@ -559,4 +559,3 @@ hypre_SeqMultivectorXapy (hypre_Multivector *x, HYPRE_BigInt rGHeight, HYPRE_Int return 0; } - diff --git a/src/multivector/temp_multivector.c b/src/multivector/temp_multivector.c index 8308cdc9f9..9908eb3ecf 100644 --- a/src/multivector/temp_multivector.c +++ b/src/multivector/temp_multivector.c @@ -8,8 +8,8 @@ #include #include -#include "temp_multivector.h" -#include "interpreter.h" +#include "_hypre_lobpcg_temp_multivector.h" +#include "_hypre_lobpcg_interpreter.h" #include "_hypre_utilities.h" static void diff --git a/src/mup_check b/src/mup_check new file mode 100755 index 0000000000..b56d1f96e2 --- /dev/null +++ b/src/mup_check @@ -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) + +## Should be run from src directory +# Loops over directories with multiprecision files and checks for changes in +# saved multiprecision function objects. +# +# NOTE: Must be run on non-multiprecision build of hypre. + +scriptpath=$PWD + +DIRS="\ + IJ_mv\ + blas\ + distributed_ls/Euclid\ + distributed_ls/ParaSails\ + distributed_ls/pilut\ + distributed_matrix\ + krylov\ + lapack\ + matrix_matrix\ + multivector\ + parcsr_block_mv\ + parcsr_ls\ + parcsr_mv\ + seq_block_mv\ + seq_mv\ + sstruct_ls\ + sstruct_mv\ + struct_ls\ + struct_mv\ + utilities\ +" + +# RDF: Need to add '--enable-hopscotch --enable-complex --with-timing' options, +# but this caused some problems for me when I tried it. Sort out later. +make distclean +./configure --enable-debug +make -s -j + +echo -e "********************" +echo -e "* FUNCTION CHECK *" +echo -e "********************\n" +for i in $DIRS +do + echo -ne "Checking $i ... " + (cd $i; $scriptpath/config/mup_check_dir.sh) +done diff --git a/src/mup_clean b/src/mup_clean new file mode 100755 index 0000000000..c999facc9c --- /dev/null +++ b/src/mup_clean @@ -0,0 +1,7 @@ +#!/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) + +rm -f `find . -name 'mup_check.*'` diff --git a/src/mup_code b/src/mup_code new file mode 100755 index 0000000000..a1d7529a95 --- /dev/null +++ b/src/mup_code @@ -0,0 +1,48 @@ +#!/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) + +# Exit immediately on any error (even in functions or pipelines), +# and print the failing command and line number for easier debugging. +set -eE -o pipefail +trap 'echo "Error at line $LINENO: $BASH_COMMAND"; exit 1' ERR + +## Should be run from src directory +# Loops over directories with multiprecision files and generates code in parallel. + +DIRS="\ + IJ_mv\ + blas\ + distributed_ls/Euclid\ + distributed_ls/ParaSails\ + distributed_ls/pilut\ + distributed_matrix\ + krylov\ + lapack\ + matrix_matrix\ + multivector\ + parcsr_block_mv\ + parcsr_ls\ + parcsr_mv\ + seq_block_mv\ + seq_mv\ + sstruct_ls\ + sstruct_mv\ + struct_ls\ + struct_mv\ + utilities\ +" + +# Function to process a single directory +process_directory() { + local dir="$1" + echo "Writing multiprecision code for $dir ..." + (cd "$dir" && ./mup_code) +} + +export -f process_directory + +# Use xargs for parallel execution with number of CPU cores (4 by default) +echo "$DIRS" | tr ' ' '\n' | xargs -P "${NPROC:-4}" -I {} bash -c 'process_directory "$1"' _ {} diff --git a/src/parcsr_block_mv/CMakeLists.txt b/src/parcsr_block_mv/CMakeLists.txt index d8e5685d40..07e2372655 100644 --- a/src/parcsr_block_mv/CMakeLists.txt +++ b/src/parcsr_block_mv/CMakeLists.txt @@ -4,11 +4,18 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) set(HDRS - par_csr_block_matrix.h - csr_block_matrix.h + _hypre_parcsr_block_mv.h ) -set(SRCS +# Add MUP headers +if(HYPRE_ENABLE_MIXED_PRECISION) + list(APPEND HDRS + _hypre_parcsr_block_mv_mup_def.h + ) +endif() + +# Regular sources +set(REGULAR_SRCS csr_block_matrix.c csr_block_matvec.c par_csr_block_matrix.c @@ -21,10 +28,12 @@ set(SRCS par_block_nodal_systems.c ) -target_sources(${PROJECT_NAME} - PRIVATE ${SRCS} - ${HDRS} -) +if(HYPRE_ENABLE_MIXED_PRECISION) + setup_mixed_precision_compilation("parcsr_block_mv" SRCS "${REGULAR_SRCS}") + target_sources(${PROJECT_NAME} PRIVATE ${HDRS}) +else() + target_sources(${PROJECT_NAME} PRIVATE ${REGULAR_SRCS} ${HDRS}) +endif() convert_filenames_to_full_paths(HDRS) set(HYPRE_HEADERS ${HYPRE_HEADERS} ${HDRS} PARENT_SCOPE) diff --git a/src/parcsr_block_mv/Makefile b/src/parcsr_block_mv/Makefile index ee0b417371..63eafcbc20 100644 --- a/src/parcsr_block_mv/Makefile +++ b/src/parcsr_block_mv/Makefile @@ -54,6 +54,16 @@ DRIVER_FILES = OBJS = ${FILES:.c=.o} DRIVER_OBJS = ${DRIVER_FILES:.c=.o} +ifeq (${MP_BUILD}, 1) + +COBJS_single = ${FILES:.c=.o_flt} +COBJS_double = ${FILES:.c=.o_dbl} +COBJS_longdouble = ${FILES:.c=.o_ldbl} + +OBJS = ${COBJS_single} ${COBJS_double} ${COBJS_longdouble} + +endif + SONAME = libHYPRE_parcsr_block_mv-${HYPRE_RELEASE_VERSION}${HYPRE_LIB_SUFFIX} ################################################################## @@ -61,8 +71,7 @@ SONAME = libHYPRE_parcsr_block_mv-${HYPRE_RELEASE_VERSION}${HYPRE_LIB_SUFFIX} ################################################################## all: libHYPRE_parcsr_block_mv${HYPRE_LIB_SUFFIX} - cp -fR $(srcdir)/par_csr_block_matrix.h $(HYPRE_BUILD_DIR)/include - cp -fR $(srcdir)/csr_block_matrix.h $(HYPRE_BUILD_DIR)/include + cp -fR $(srcdir)/_hypre_*.h $(HYPRE_BUILD_DIR)/include # cp -fR libHYPRE_* $(HYPRE_BUILD_DIR)/lib/. driver: driver.o libHYPRE_parcsr_block_mv${HYPRE_LIB_SUFFIX} @@ -90,12 +99,12 @@ driver_boolaat: driver_boolaat.o libHYPRE_parcsr_mv${HYPRE_LIB_SUFFIX} ${CC} -o driver_boolaat driver_boolaat.o ${LFLAGS} install: libHYPRE_parcsr_block_mv${HYPRE_LIB_SUFFIX} - cp -fR $(srcdir)/par_csr_block_matrix.h $(HYPRE_INC_INSTALL)/. - cp -fR $(srcdir)/csr_block_matrix.h $(HYPRE_INC_INSTALL)/. + cp -fR $(srcdir)/_hypre_*.h $(HYPRE_INC_INSTALL) # cp -fR libHYPRE_* $(HYPRE_LIB_INSTALL)/. clean: rm -rf *.o libHYPRE_* + rm -f *.o_flt *.o_dbl *.o_ldbl rm -f driver driver_matvec driver_matmul distclean: clean diff --git a/src/parcsr_block_mv/_hypre_parcsr_block_mv.h b/src/parcsr_block_mv/_hypre_parcsr_block_mv.h index 5c9ddea39e..0da74341e8 100644 --- a/src/parcsr_block_mv/_hypre_parcsr_block_mv.h +++ b/src/parcsr_block_mv/_hypre_parcsr_block_mv.h @@ -5,10 +5,491 @@ * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ +/*** DO NOT EDIT THIS FILE DIRECTLY (use 'headers' to generate) ***/ + +#ifndef hypre_PARCSR_BLOCK_MV_HEADER +#define hypre_PARCSR_BLOCK_MV_HEADER + #include #include #include -#include "csr_block_matrix.h" -#include "par_csr_block_matrix.h" -#include "_hypre_parcsr_ls.h" +#include "_hypre_utilities.h" + +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_parcsr_block_mv_mup_def.h" +#endif + +#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) + ******************************************************************************/ + +/****************************************************************************** + * + * Header info for CSR Block Matrix data structures + * + * Note: this matrix currently uses 0-based indexing. + * Note: everything is in terms of blocks (ie. num_rows is the number + * of block rows) + * + *****************************************************************************/ + +#ifndef hypre_CSR_BLOCK_MATRIX_HEADER +#define hypre_CSR_BLOCK_MATRIX_HEADER + +#include "_hypre_seq_mv.h" +#include "_hypre_utilities.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*-------------------------------------------------------------------------- + * CSR Block Matrix + *--------------------------------------------------------------------------*/ + +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_CSRBlockMatrix; + +/*-------------------------------------------------------------------------- + * Accessor functions for the CSR Block Matrix structure + *--------------------------------------------------------------------------*/ + +#define hypre_CSRBlockMatrixData(matrix) ((matrix) -> data) +#define hypre_CSRBlockMatrixI(matrix) ((matrix) -> i) +#define hypre_CSRBlockMatrixJ(matrix) ((matrix) -> j) +#define hypre_CSRBlockMatrixBigJ(matrix) ((matrix) -> big_j) +#define hypre_CSRBlockMatrixBlockSize(matrix) ((matrix) -> block_size) +#define hypre_CSRBlockMatrixNumRows(matrix) ((matrix) -> num_rows) +#define hypre_CSRBlockMatrixNumCols(matrix) ((matrix) -> num_cols) +#define hypre_CSRBlockMatrixNumNonzeros(matrix) ((matrix) -> num_nonzeros) +#define hypre_CSRBlockMatrixOwnsData(matrix) ((matrix) -> owns_data) + +/*-------------------------------------------------------------------------- + * other functions for the CSR Block Matrix structure + *--------------------------------------------------------------------------*/ + +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_CSRBlockMatrix +*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_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_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_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_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_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_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_Complex* ov, HYPRE_Int block_size); + +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); + +#ifdef __cplusplus +} +#endif +#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) + ******************************************************************************/ + +/****************************************************************************** + * + * Header info for Parallel CSR Matrix data structures + * + * Note: this matrix currently uses 0-based indexing. + * + *****************************************************************************/ + +#ifndef hypre_PAR_CSR_BLOCK_MATRIX_HEADER +#define hypre_PAR_CSR_BLOCK_MATRIX_HEADER + +#include "_hypre_utilities.h" +#include "_hypre_parcsr_mv.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*-------------------------------------------------------------------------- + * Parallel CSR Block Matrix + *--------------------------------------------------------------------------*/ + +typedef struct +{ + MPI_Comm comm; + + HYPRE_BigInt global_num_rows; + HYPRE_BigInt global_num_cols; + 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 */ + 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 */ + HYPRE_BigInt row_starts[2]; + /* row_starts[0] is start of local rows + row_starts[1] is start of next processor's rows */ + HYPRE_BigInt col_starts[2]; + /* col_starts[0] is start of local columns + col_starts[1] is start of next processor's columns */ + + hypre_ParCSRCommPkg *comm_pkg; + hypre_ParCSRCommPkg *comm_pkgT; + + /* Does the ParCSRBlockMatrix 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_Int *rowindices; + HYPRE_Complex *rowvalues; + HYPRE_Int getrowactive; + + hypre_IJAssumedPart *assumed_partition; /* only populated if no_global_partition option + is used (compile-time option)*/ +} hypre_ParCSRBlockMatrix; + +/*-------------------------------------------------------------------------- + * Accessor functions for the Parallel CSR Block Matrix structure + *--------------------------------------------------------------------------*/ + +#define hypre_ParCSRBlockMatrixComm(matrix) ((matrix)->comm) +#define hypre_ParCSRBlockMatrixGlobalNumRows(matrix) ((matrix)->global_num_rows) +#define hypre_ParCSRBlockMatrixGlobalNumCols(matrix) ((matrix)->global_num_cols) +#define hypre_ParCSRBlockMatrixFirstRowIndex(matrix) ((matrix)->first_row_index) +#define hypre_ParCSRBlockMatrixFirstColDiag(matrix) ((matrix)->first_col_diag) +#define hypre_ParCSRBlockMatrixLastRowIndex(matrix) ((matrix) -> last_row_index) +#define hypre_ParCSRBlockMatrixLastColDiag(matrix) ((matrix) -> last_col_diag) +#define hypre_ParCSRBlockMatrixBlockSize(matrix) ((matrix)->diag->block_size) +#define hypre_ParCSRBlockMatrixDiag(matrix) ((matrix) -> diag) +#define hypre_ParCSRBlockMatrixOffd(matrix) ((matrix) -> offd) +#define hypre_ParCSRBlockMatrixColMapOffd(matrix) ((matrix) -> col_map_offd) +#define hypre_ParCSRBlockMatrixRowStarts(matrix) ((matrix) -> row_starts) +#define hypre_ParCSRBlockMatrixColStarts(matrix) ((matrix) -> col_starts) +#define hypre_ParCSRBlockMatrixCommPkg(matrix) ((matrix) -> comm_pkg) +#define hypre_ParCSRBlockMatrixCommPkgT(matrix) ((matrix) -> comm_pkgT) +#define hypre_ParCSRBlockMatrixOwnsData(matrix) ((matrix) -> owns_data) +#define hypre_ParCSRBlockMatrixNumRows(matrix) \ +hypre_CSRBlockMatrixNumRows(hypre_ParCSRBlockMatrixDiag(matrix)) +#define hypre_ParCSRBlockMatrixNumCols(matrix) \ +hypre_CSRBlockMatrixNumCols(hypre_ParCSRBlockMatrixDiag(matrix)) +#define hypre_ParCSRBlockMatrixNumNonzeros(matrix) ((matrix) -> num_nonzeros) +#define hypre_ParCSRBlockMatrixDNumNonzeros(matrix) ((matrix) -> d_num_nonzeros) +#define hypre_ParCSRBlockMatrixRowindices(matrix) ((matrix) -> rowindices) +#define hypre_ParCSRBlockMatrixRowvalues(matrix) ((matrix) -> rowvalues) +#define hypre_ParCSRBlockMatrixGetrowactive(matrix) ((matrix) -> getrowactive) +#define hypre_ParCSRBlockMatrixAssumedPartition(matrix) ((matrix) -> assumed_partition) + + +hypre_CSRBlockMatrix * +hypre_ParCSRBlockMatrixExtractBExt(hypre_ParCSRBlockMatrix *B, + hypre_ParCSRBlockMatrix *A, HYPRE_Int data); + +hypre_ParCSRBlockMatrix * +hypre_ParCSRBlockMatrixCreate(MPI_Comm comm, HYPRE_Int block_size, 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_ParCSRBlockMatrixDestroy( hypre_ParCSRBlockMatrix *matrix ); + + + +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_Int +hypre_BoomerAMGBuildBlockInterpRV( 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_ParCSRBlockMatrix **P_ptr); + +HYPRE_Int +hypre_BoomerAMGBuildBlockInterpRV2( 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_ParCSRBlockMatrix **P_ptr); +HYPRE_Int +hypre_BoomerAMGBuildBlockInterpDiag( 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_Int hypre_BoomerAMGBlockInterpTruncation( hypre_ParCSRBlockMatrix *P, + HYPRE_Real trunc_factor, + HYPRE_Int max_elements); + + +HYPRE_Int +hypre_BoomerAMGBuildBlockDirInterp( 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_ParCSRBlockMatrix **P_ptr); + + +HYPRE_Int hypre_BoomerAMGBlockRelaxIF( hypre_ParCSRBlockMatrix *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_ParVector *u, + hypre_ParVector *Vtemp ); + + +HYPRE_Int hypre_BoomerAMGBlockRelax( hypre_ParCSRBlockMatrix *A, + hypre_ParVector *f, + HYPRE_Int *cf_marker, + HYPRE_Int relax_type, + HYPRE_Int relax_points, + HYPRE_Real relax_weight, + HYPRE_Real omega, + hypre_ParVector *u, + hypre_ParVector *Vtemp ); + +HYPRE_Int +hypre_GetCommPkgBlockRTFromCommPkgBlockA( hypre_ParCSRBlockMatrix *RT, + hypre_ParCSRBlockMatrix *A, + HYPRE_Int *tmp_map_offd, + HYPRE_BigInt *fine_to_coarse_offd); + + +hypre_ParCSRCommHandle * +hypre_ParCSRBlockCommHandleCreate(HYPRE_Int job, HYPRE_Int bnnz, hypre_ParCSRCommPkg *comm_pkg, + void *send_data, void *recv_data ); + + +HYPRE_Int +hypre_ParCSRBlockCommHandleDestroy(hypre_ParCSRCommHandle *comm_handle); + + + +HYPRE_Int +hypre_BlockMatvecCommPkgCreate(hypre_ParCSRBlockMatrix *A); + + +HYPRE_Int +hypre_ParCSRBlockMatrixCreateAssumedPartition( hypre_ParCSRBlockMatrix *matrix); + +HYPRE_Int +hypre_ParCSRBlockMatrixDestroyAssumedPartition(hypre_ParCSRBlockMatrix *matrix ); + + + +hypre_ParCSRMatrix * +hypre_ParCSRBlockMatrixConvertToParCSRMatrix(hypre_ParCSRBlockMatrix *matrix); + + +hypre_ParCSRBlockMatrix * +hypre_ParCSRBlockMatrixConvertFromParCSRMatrix(hypre_ParCSRMatrix *matrix, + HYPRE_Int matrix_C_block_size ); + + +HYPRE_Int +hypre_ParCSRBlockMatrixRAP(hypre_ParCSRBlockMatrix *RT, + hypre_ParCSRBlockMatrix *A, + hypre_ParCSRBlockMatrix *P, + hypre_ParCSRBlockMatrix **RAP_ptr ); + +HYPRE_Int +hypre_ParCSRBlockMatrixSetNumNonzeros( hypre_ParCSRBlockMatrix *matrix); + +HYPRE_Int +hypre_ParCSRBlockMatrixSetDNumNonzeros( hypre_ParCSRBlockMatrix *matrix); + +HYPRE_Int +hypre_BoomerAMGBlockCreateNodalA(hypre_ParCSRBlockMatrix *A, + HYPRE_Int option, HYPRE_Int diag_option, + hypre_ParCSRMatrix **AN_ptr); + +hypre_ParVector * +hypre_ParVectorCreateFromBlock(MPI_Comm comm, + HYPRE_BigInt p_global_size, + HYPRE_BigInt *p_partitioning, HYPRE_Int block_size); + +HYPRE_Int +hypre_ParCSRBlockMatrixMatvec(HYPRE_Complex alpha, hypre_ParCSRBlockMatrix *A, + hypre_ParVector *x, HYPRE_Complex beta, + hypre_ParVector *y); +HYPRE_Int +hypre_ParCSRBlockMatrixMatvecT( HYPRE_Complex alpha, + hypre_ParCSRBlockMatrix *A, + hypre_ParVector *x, + HYPRE_Complex beta, + hypre_ParVector *y); + + + + + + +void hypre_block_qsort( HYPRE_Int *v, + HYPRE_Complex *w, + HYPRE_Complex *blk_array, + HYPRE_Int block_size, + HYPRE_Int left, + HYPRE_Int right ); + + +void hypre_swap_blk( HYPRE_Complex *v, + HYPRE_Int block_size, + HYPRE_Int i, + HYPRE_Int j ); + + +#ifdef __cplusplus +} +#endif +#endif + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/src/parcsr_block_mv/_hypre_parcsr_block_mv_mup_def.h b/src/parcsr_block_mv/_hypre_parcsr_block_mv_mup_def.h new file mode 100644 index 0000000000..9c994ed633 --- /dev/null +++ b/src/parcsr_block_mv/_hypre_parcsr_block_mv_mup_def.h @@ -0,0 +1,85 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#ifndef hypre_PARCSR_BLOCK_MV_MUP_DEF_HEADER +#define hypre_PARCSR_BLOCK_MV_MUP_DEF_HEADER + +#include "_hypre_mup_def.h" + +#define gselim_piv HYPRE_FIXEDPRECISION_FUNC ( gselim_piv ) +#define hypre_BlockMatvecCommPkgCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_BlockMatvecCommPkgCreate ) +#define hypre_BoomerAMGBlockCreateNodalA HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBlockCreateNodalA ) +#define hypre_BoomerAMGBlockInterpTruncation HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBlockInterpTruncation ) +#define hypre_BoomerAMGBlockRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBlockRelax ) +#define hypre_BoomerAMGBlockRelaxIF HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBlockRelaxIF ) +#define hypre_BoomerAMGBuildBlockDirInterp HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildBlockDirInterp ) +#define hypre_BoomerAMGBuildBlockInterp HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildBlockInterp ) +#define hypre_BoomerAMGBuildBlockInterpDiag HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildBlockInterpDiag ) +#define hypre_BoomerAMGBuildBlockInterpRV HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildBlockInterpRV ) +#define hypre_BoomerAMGBuildBlockInterpRV2 HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildBlockInterpRV2 ) +#define hypre_CSRBlockMatrixBigInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixBigInitialize ) +#define hypre_CSRBlockMatrixBlockAdd HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixBlockAdd ) +#define hypre_CSRBlockMatrixBlockAddAccumulate HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixBlockAddAccumulate ) +#define hypre_CSRBlockMatrixBlockAddAccumulateDiag HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixBlockAddAccumulateDiag ) +#define hypre_CSRBlockMatrixBlockAddAccumulateDiagCheckSign HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixBlockAddAccumulateDiagCheckSign ) +#define hypre_CSRBlockMatrixBlockCopyData HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixBlockCopyData ) +#define hypre_CSRBlockMatrixBlockCopyDataDiag HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixBlockCopyDataDiag ) +#define hypre_CSRBlockMatrixBlockInvMatvec HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixBlockInvMatvec ) +#define hypre_CSRBlockMatrixBlockInvMult HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixBlockInvMult ) +#define hypre_CSRBlockMatrixBlockInvMultDiag HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixBlockInvMultDiag ) +#define hypre_CSRBlockMatrixBlockInvMultDiag2 HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixBlockInvMultDiag2 ) +#define hypre_CSRBlockMatrixBlockInvMultDiag3 HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixBlockInvMultDiag3 ) +#define hypre_CSRBlockMatrixBlockMatvec HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixBlockMatvec ) +#define hypre_CSRBlockMatrixBlockMultAdd HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixBlockMultAdd ) +#define hypre_CSRBlockMatrixBlockMultAddDiag HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixBlockMultAddDiag ) +#define hypre_CSRBlockMatrixBlockMultAddDiag2 HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixBlockMultAddDiag2 ) +#define hypre_CSRBlockMatrixBlockMultAddDiag3 HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixBlockMultAddDiag3 ) +#define hypre_CSRBlockMatrixBlockMultAddDiagCheckSign HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixBlockMultAddDiagCheckSign ) +#define hypre_CSRBlockMatrixBlockMultInv HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixBlockMultInv ) +#define hypre_CSRBlockMatrixBlockNorm HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixBlockNorm ) +#define hypre_CSRBlockMatrixBlockSetScalar HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixBlockSetScalar ) +#define hypre_CSRBlockMatrixBlockTranspose HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixBlockTranspose ) +#define hypre_CSRBlockMatrixCompress HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixCompress ) +#define hypre_CSRBlockMatrixComputeSign HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixComputeSign ) +#define hypre_CSRBlockMatrixConvertFromCSRMatrix HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixConvertFromCSRMatrix ) +#define hypre_CSRBlockMatrixConvertToCSRMatrix HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixConvertToCSRMatrix ) +#define hypre_CSRBlockMatrixCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixCreate ) +#define hypre_CSRBlockMatrixDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixDestroy ) +#define hypre_CSRBlockMatrixInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixInitialize ) +#define hypre_CSRBlockMatrixMatvec HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixMatvec ) +#define hypre_CSRBlockMatrixMatvecT HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixMatvecT ) +#define hypre_CSRBlockMatrixSetDataOwner HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixSetDataOwner ) +#define hypre_CSRBlockMatrixTranspose HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBlockMatrixTranspose ) +#define hypre_ExchangeRAPBlockData HYPRE_FIXEDPRECISION_FUNC ( hypre_ExchangeRAPBlockData ) +#define hypre_GetCommPkgBlockRTFromCommPkgBlockA HYPRE_FIXEDPRECISION_FUNC ( hypre_GetCommPkgBlockRTFromCommPkgBlockA ) +#define hypre_ParCSRBlockCommHandleCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBlockCommHandleCreate ) +#define hypre_ParCSRBlockCommHandleDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBlockCommHandleDestroy ) +#define hypre_ParCSRBlockMatrixCompress HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBlockMatrixCompress ) +#define hypre_ParCSRBlockMatrixConvertFromParCSRMatrix HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBlockMatrixConvertFromParCSRMatrix ) +#define hypre_ParCSRBlockMatrixConvertToParCSRMatrix HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBlockMatrixConvertToParCSRMatrix ) +#define hypre_ParCSRBlockMatrixCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBlockMatrixCreate ) +#define hypre_ParCSRBlockMatrixCreateAssumedPartition HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBlockMatrixCreateAssumedPartition ) +#define hypre_ParCSRBlockMatrixDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBlockMatrixDestroy ) +#define hypre_ParCSRBlockMatrixDestroyAssumedPartition HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBlockMatrixDestroyAssumedPartition ) +#define hypre_ParCSRBlockMatrixExtractBExt HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBlockMatrixExtractBExt ) +#define hypre_ParCSRBlockMatrixInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBlockMatrixInitialize ) +#define hypre_ParCSRBlockMatrixMatvec HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBlockMatrixMatvec ) +#define hypre_ParCSRBlockMatrixMatvecT HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBlockMatrixMatvecT ) +#define hypre_ParCSRBlockMatrixRAP HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBlockMatrixRAP ) +#define hypre_ParCSRBlockMatrixSetDNumNonzeros HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBlockMatrixSetDNumNonzeros ) +#define hypre_ParCSRBlockMatrixSetDataOwner HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBlockMatrixSetDataOwner ) +#define hypre_ParCSRBlockMatrixSetNumNonzeros HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBlockMatrixSetNumNonzeros ) +#define hypre_ParVectorCreateFromBlock HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorCreateFromBlock ) +#define hypre_block_qsort HYPRE_FIXEDPRECISION_FUNC ( hypre_block_qsort ) +#define hypre_swap_blk HYPRE_FIXEDPRECISION_FUNC ( hypre_swap_blk ) + +#endif diff --git a/src/parcsr_block_mv/csr_block_matrix.h b/src/parcsr_block_mv/csr_block_matrix.h index c05ba0d5ab..1ec4d00c40 100644 --- a/src/parcsr_block_mv/csr_block_matrix.h +++ b/src/parcsr_block_mv/csr_block_matrix.h @@ -18,7 +18,7 @@ #ifndef hypre_CSR_BLOCK_MATRIX_HEADER #define hypre_CSR_BLOCK_MATRIX_HEADER -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #include "_hypre_utilities.h" #ifdef __cplusplus diff --git a/src/parcsr_block_mv/csr_block_matvec.c b/src/parcsr_block_mv/csr_block_matvec.c index 84c494787a..6706df931b 100644 --- a/src/parcsr_block_mv/csr_block_matvec.c +++ b/src/parcsr_block_mv/csr_block_matvec.c @@ -11,7 +11,7 @@ * *****************************************************************************/ -#include "csr_block_matrix.h" +#include "_hypre_parcsr_block_mv.h" #include "../seq_mv/seq_mv.h" /*-------------------------------------------------------------------------- diff --git a/src/parcsr_block_mv/driver_matvec.c b/src/parcsr_block_mv/driver_matvec.c index 8e88dc6c63..215b90d18b 100644 --- a/src/parcsr_block_mv/driver_matvec.c +++ b/src/parcsr_block_mv/driver_matvec.c @@ -9,8 +9,8 @@ #include "../seq_mv/seq_mv.h" #include "../parcsr_mv/_hypre_parcsr_mv.h" #include "../parcsr_ls/_hypre_parcsr_ls.h" -#include "../krylov/krylov.h" -#include "par_csr_block_matrix.h" +#include "../krylov/_hypre_krylov.h" +#include "_hypre_parcsr_block_mv.h" extern HYPRE_Int MyBuildParLaplacian9pt(HYPRE_ParCSRMatrix *A_ptr); diff --git a/src/parcsr_block_mv/headers b/src/parcsr_block_mv/headers new file mode 100755 index 0000000000..8ebfc2d6e9 --- /dev/null +++ b/src/parcsr_block_mv/headers @@ -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) + +INTERNAL_HEADER=_hypre_parcsr_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_PARCSR_BLOCK_MV_HEADER +#define hypre_PARCSR_BLOCK_MV_HEADER + +#include +#include +#include + +#include "_hypre_utilities.h" + +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_parcsr_block_mv_mup_def.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif +@ + +cat csr_block_matrix.h >> $INTERNAL_HEADER +cat par_csr_block_matrix.h >> $INTERNAL_HEADER + +#=========================================================================== +# Include guards +#=========================================================================== + +cat >> $INTERNAL_HEADER <<@ + +#ifdef __cplusplus +} +#endif + +#endif + +@ diff --git a/src/parcsr_block_mv/mup.fixed b/src/parcsr_block_mv/mup.fixed new file mode 100644 index 0000000000..e61ebf0a3c --- /dev/null +++ b/src/parcsr_block_mv/mup.fixed @@ -0,0 +1,66 @@ +gselim_piv +hypre_BlockMatvecCommPkgCreate +hypre_BoomerAMGBlockCreateNodalA +hypre_BoomerAMGBlockInterpTruncation +hypre_BoomerAMGBlockRelax +hypre_BoomerAMGBlockRelaxIF +hypre_BoomerAMGBuildBlockDirInterp +hypre_BoomerAMGBuildBlockInterp +hypre_BoomerAMGBuildBlockInterpDiag +hypre_BoomerAMGBuildBlockInterpRV +hypre_BoomerAMGBuildBlockInterpRV2 +hypre_CSRBlockMatrixBigInitialize +hypre_CSRBlockMatrixBlockAdd +hypre_CSRBlockMatrixBlockAddAccumulate +hypre_CSRBlockMatrixBlockAddAccumulateDiag +hypre_CSRBlockMatrixBlockAddAccumulateDiagCheckSign +hypre_CSRBlockMatrixBlockCopyData +hypre_CSRBlockMatrixBlockCopyDataDiag +hypre_CSRBlockMatrixBlockInvMatvec +hypre_CSRBlockMatrixBlockInvMult +hypre_CSRBlockMatrixBlockInvMultDiag +hypre_CSRBlockMatrixBlockInvMultDiag2 +hypre_CSRBlockMatrixBlockInvMultDiag3 +hypre_CSRBlockMatrixBlockMatvec +hypre_CSRBlockMatrixBlockMultAdd +hypre_CSRBlockMatrixBlockMultAddDiag +hypre_CSRBlockMatrixBlockMultAddDiag2 +hypre_CSRBlockMatrixBlockMultAddDiag3 +hypre_CSRBlockMatrixBlockMultAddDiagCheckSign +hypre_CSRBlockMatrixBlockMultInv +hypre_CSRBlockMatrixBlockNorm +hypre_CSRBlockMatrixBlockSetScalar +hypre_CSRBlockMatrixBlockTranspose +hypre_CSRBlockMatrixCompress +hypre_CSRBlockMatrixComputeSign +hypre_CSRBlockMatrixConvertFromCSRMatrix +hypre_CSRBlockMatrixConvertToCSRMatrix +hypre_CSRBlockMatrixCreate +hypre_CSRBlockMatrixDestroy +hypre_CSRBlockMatrixInitialize +hypre_CSRBlockMatrixMatvec +hypre_CSRBlockMatrixMatvecT +hypre_CSRBlockMatrixSetDataOwner +hypre_CSRBlockMatrixTranspose +hypre_ExchangeRAPBlockData +hypre_GetCommPkgBlockRTFromCommPkgBlockA +hypre_ParCSRBlockCommHandleCreate +hypre_ParCSRBlockCommHandleDestroy +hypre_ParCSRBlockMatrixCompress +hypre_ParCSRBlockMatrixConvertFromParCSRMatrix +hypre_ParCSRBlockMatrixConvertToParCSRMatrix +hypre_ParCSRBlockMatrixCreate +hypre_ParCSRBlockMatrixCreateAssumedPartition +hypre_ParCSRBlockMatrixDestroy +hypre_ParCSRBlockMatrixDestroyAssumedPartition +hypre_ParCSRBlockMatrixExtractBExt +hypre_ParCSRBlockMatrixInitialize +hypre_ParCSRBlockMatrixMatvec +hypre_ParCSRBlockMatrixMatvecT +hypre_ParCSRBlockMatrixRAP +hypre_ParCSRBlockMatrixSetDNumNonzeros +hypre_ParCSRBlockMatrixSetDataOwner +hypre_ParCSRBlockMatrixSetNumNonzeros +hypre_ParVectorCreateFromBlock +hypre_block_qsort +hypre_swap_blk diff --git a/src/parcsr_block_mv/mup.functions b/src/parcsr_block_mv/mup.functions new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/parcsr_block_mv/mup.methods b/src/parcsr_block_mv/mup.methods new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/parcsr_block_mv/mup_code b/src/parcsr_block_mv/mup_code new file mode 100755 index 0000000000..ebcd8f4513 --- /dev/null +++ b/src/parcsr_block_mv/mup_code @@ -0,0 +1,11 @@ +#!/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) + +touch mup_fake_ext.h + +../config/gen_code.sh mup_fake_ext.h _hypre_parcsr_block_mv.h onlydef + +rm -f mup_fake_ext.h diff --git a/src/parcsr_block_mv/par_csr_block_matrix.h b/src/parcsr_block_mv/par_csr_block_matrix.h index b5acdedbe4..c29870e235 100644 --- a/src/parcsr_block_mv/par_csr_block_matrix.h +++ b/src/parcsr_block_mv/par_csr_block_matrix.h @@ -17,7 +17,6 @@ #define hypre_PAR_CSR_BLOCK_MATRIX_HEADER #include "_hypre_utilities.h" -#include "csr_block_matrix.h" #include "_hypre_parcsr_mv.h" #ifdef __cplusplus diff --git a/src/parcsr_block_mv/par_csr_block_rap.c b/src/parcsr_block_mv/par_csr_block_rap.c index 40974ade23..3ec842dc2a 100644 --- a/src/parcsr_block_mv/par_csr_block_rap.c +++ b/src/parcsr_block_mv/par_csr_block_rap.c @@ -7,7 +7,7 @@ #include #include "_hypre_utilities.h" -#include "par_csr_block_matrix.h" +#include "_hypre_parcsr_block_mv.h" #include "../parcsr_mv/_hypre_parcsr_mv.h" /*-------------------------------------------------------------------------- diff --git a/src/parcsr_ls/CMakeLists.txt b/src/parcsr_ls/CMakeLists.txt index 87148a2427..eb4ac565b7 100644 --- a/src/parcsr_ls/CMakeLists.txt +++ b/src/parcsr_ls/CMakeLists.txt @@ -8,7 +8,19 @@ set(HDRS _hypre_parcsr_ls.h ) -set(SRCS +# Add MUP headers when mixed precision is enabled +if(HYPRE_ENABLE_MIXED_PRECISION) + list(APPEND HDRS + HYPRE_parcsr_ls_mp.h + HYPRE_parcsr_ls_mup.h + _hypre_parcsr_ls_mup.h + _hypre_parcsr_ls_mup_def.h + _hypre_parcsr_ls_mup_undef.h + ) +endif() + +# Regular sources +set(REGULAR_SRCS amg_hybrid.c aux_interp.c F90_hypre_laplace.c @@ -68,21 +80,16 @@ set(SRCS par_coarsen.c par_cgc_coarsen.c par_cheby.c - par_cheby_device.c par_coarse_parms.c - par_coarse_parms_device.c par_coordinates.c par_cr.c 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 @@ -111,7 +118,6 @@ set(SRCS par_vardifconv_rs.c par_relax.c par_relax_more.c - par_relax_more_device.c par_relax_interface.c par_scaled_matnorm.c par_schwarz.c @@ -127,14 +133,14 @@ set(SRCS ame.c par_restr.c par_lr_restr.c - par_mgr.c - par_mgr_setup.c - 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_cheby_device.c + par_coarse_parms_device.c + par_fsai_device.c + par_ge_device.c + par_relax_more_device.c par_coarsen_device.c par_indepset_device.c par_interp_device.c @@ -148,13 +154,25 @@ set(SRCS par_relax_device.c par_mod_multi_interp_device.c par_mgr_device.c + par_ilu_setup_device.c + par_ilu_solve_device.c ) -target_sources(${PROJECT_NAME} - PRIVATE ${SRCS} - ${HDRS} +# Mixed precision sources +set(MUP_SRCS + mup_fixed.c + mup_functions.c + mup_pre.c + HYPRE_parcsr_ls_mp.c ) +if(HYPRE_ENABLE_MIXED_PRECISION) + setup_mixed_precision_compilation("parcsr_ls" SRCS "${REGULAR_SRCS}") + target_sources(${PROJECT_NAME} PRIVATE ${MUP_SRCS} ${HDRS}) +else() + target_sources(${PROJECT_NAME} PRIVATE ${REGULAR_SRCS} ${HDRS}) +endif() + if (HYPRE_USING_GPU) set(GPU_SRCS ams.c diff --git a/src/parcsr_ls/Common.h b/src/parcsr_ls/Common.h index 6958ddc61d..5b66445529 100644 --- a/src/parcsr_ls/Common.h +++ b/src/parcsr_ls/Common.h @@ -17,7 +17,7 @@ #if 1 /* HYPRE */ #include "HYPRE_config.h" #include "_hypre_utilities.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef HYPRE_USING_ESSL #define ESSL #endif diff --git a/src/parcsr_ls/F90_HYPRE_ams.c b/src/parcsr_ls/F90_HYPRE_ams.c index 2ede61ca34..476f965cf6 100644 --- a/src/parcsr_ls/F90_HYPRE_ams.c +++ b/src/parcsr_ls/F90_HYPRE_ams.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_parcsr_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/parcsr_ls/F90_HYPRE_parcsr_Euclid.c b/src/parcsr_ls/F90_HYPRE_parcsr_Euclid.c index 6e1ce68a15..442dbf41b3 100644 --- a/src/parcsr_ls/F90_HYPRE_parcsr_Euclid.c +++ b/src/parcsr_ls/F90_HYPRE_parcsr_Euclid.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_parcsr_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/parcsr_ls/F90_HYPRE_parcsr_ParaSails.c b/src/parcsr_ls/F90_HYPRE_parcsr_ParaSails.c index f072459a6c..451066dc73 100644 --- a/src/parcsr_ls/F90_HYPRE_parcsr_ParaSails.c +++ b/src/parcsr_ls/F90_HYPRE_parcsr_ParaSails.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_parcsr_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/parcsr_ls/F90_HYPRE_parcsr_amg.c b/src/parcsr_ls/F90_HYPRE_parcsr_amg.c index 82812091b0..db2f3e3f2d 100644 --- a/src/parcsr_ls/F90_HYPRE_parcsr_amg.c +++ b/src/parcsr_ls/F90_HYPRE_parcsr_amg.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_parcsr_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/parcsr_ls/F90_HYPRE_parcsr_bicgstab.c b/src/parcsr_ls/F90_HYPRE_parcsr_bicgstab.c index 5a13a151f4..3030003631 100644 --- a/src/parcsr_ls/F90_HYPRE_parcsr_bicgstab.c +++ b/src/parcsr_ls/F90_HYPRE_parcsr_bicgstab.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_parcsr_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/parcsr_ls/F90_HYPRE_parcsr_block.c b/src/parcsr_ls/F90_HYPRE_parcsr_block.c index c1b9ca4c62..b3d2e9bf0a 100644 --- a/src/parcsr_ls/F90_HYPRE_parcsr_block.c +++ b/src/parcsr_ls/F90_HYPRE_parcsr_block.c @@ -13,7 +13,7 @@ #include "block_tridiag.h" #include "_hypre_parcsr_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/parcsr_ls/F90_HYPRE_parcsr_cgnr.c b/src/parcsr_ls/F90_HYPRE_parcsr_cgnr.c index da69cf0d04..6274747c5c 100644 --- a/src/parcsr_ls/F90_HYPRE_parcsr_cgnr.c +++ b/src/parcsr_ls/F90_HYPRE_parcsr_cgnr.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_parcsr_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/parcsr_ls/F90_HYPRE_parcsr_cogmres.c b/src/parcsr_ls/F90_HYPRE_parcsr_cogmres.c index aed38a8fd0..4d9064019c 100644 --- a/src/parcsr_ls/F90_HYPRE_parcsr_cogmres.c +++ b/src/parcsr_ls/F90_HYPRE_parcsr_cogmres.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_parcsr_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/parcsr_ls/F90_HYPRE_parcsr_flexgmres.c b/src/parcsr_ls/F90_HYPRE_parcsr_flexgmres.c index 567f2e7f3d..9058e8e5b8 100644 --- a/src/parcsr_ls/F90_HYPRE_parcsr_flexgmres.c +++ b/src/parcsr_ls/F90_HYPRE_parcsr_flexgmres.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_parcsr_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/parcsr_ls/F90_HYPRE_parcsr_gmres.c b/src/parcsr_ls/F90_HYPRE_parcsr_gmres.c index 30be183a17..2ab4c89761 100644 --- a/src/parcsr_ls/F90_HYPRE_parcsr_gmres.c +++ b/src/parcsr_ls/F90_HYPRE_parcsr_gmres.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_parcsr_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/parcsr_ls/F90_HYPRE_parcsr_hybrid.c b/src/parcsr_ls/F90_HYPRE_parcsr_hybrid.c index e9065d4c9e..f6fb800bb8 100644 --- a/src/parcsr_ls/F90_HYPRE_parcsr_hybrid.c +++ b/src/parcsr_ls/F90_HYPRE_parcsr_hybrid.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_parcsr_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/parcsr_ls/F90_HYPRE_parcsr_ilu.c b/src/parcsr_ls/F90_HYPRE_parcsr_ilu.c index 381d513ed3..3ffdf61940 100644 --- a/src/parcsr_ls/F90_HYPRE_parcsr_ilu.c +++ b/src/parcsr_ls/F90_HYPRE_parcsr_ilu.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_parcsr_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/parcsr_ls/F90_HYPRE_parcsr_int.c b/src/parcsr_ls/F90_HYPRE_parcsr_int.c index ca76ca2fbf..90ed67f642 100644 --- a/src/parcsr_ls/F90_HYPRE_parcsr_int.c +++ b/src/parcsr_ls/F90_HYPRE_parcsr_int.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_parcsr_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/parcsr_ls/F90_HYPRE_parcsr_lgmres.c b/src/parcsr_ls/F90_HYPRE_parcsr_lgmres.c index 18f4488c20..8b9c004762 100644 --- a/src/parcsr_ls/F90_HYPRE_parcsr_lgmres.c +++ b/src/parcsr_ls/F90_HYPRE_parcsr_lgmres.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_parcsr_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/parcsr_ls/F90_HYPRE_parcsr_mgr.c b/src/parcsr_ls/F90_HYPRE_parcsr_mgr.c index b3c0dccc9b..d7df92a71c 100644 --- a/src/parcsr_ls/F90_HYPRE_parcsr_mgr.c +++ b/src/parcsr_ls/F90_HYPRE_parcsr_mgr.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_parcsr_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/parcsr_ls/F90_HYPRE_parcsr_pcg.c b/src/parcsr_ls/F90_HYPRE_parcsr_pcg.c index bce3e16f48..27c5ac31b8 100644 --- a/src/parcsr_ls/F90_HYPRE_parcsr_pcg.c +++ b/src/parcsr_ls/F90_HYPRE_parcsr_pcg.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_parcsr_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/parcsr_ls/F90_HYPRE_parcsr_pilut.c b/src/parcsr_ls/F90_HYPRE_parcsr_pilut.c index e770faf871..08b0188904 100644 --- a/src/parcsr_ls/F90_HYPRE_parcsr_pilut.c +++ b/src/parcsr_ls/F90_HYPRE_parcsr_pilut.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_parcsr_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/parcsr_ls/F90_HYPRE_parcsr_schwarz.c b/src/parcsr_ls/F90_HYPRE_parcsr_schwarz.c index c5ffe99b20..6050341428 100644 --- a/src/parcsr_ls/F90_HYPRE_parcsr_schwarz.c +++ b/src/parcsr_ls/F90_HYPRE_parcsr_schwarz.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_parcsr_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/parcsr_ls/F90_hypre_laplace.c b/src/parcsr_ls/F90_hypre_laplace.c index 4a4b0d6de0..3aabd492c8 100644 --- a/src/parcsr_ls/F90_hypre_laplace.c +++ b/src/parcsr_ls/F90_hypre_laplace.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_parcsr_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/parcsr_ls/HYPRE_parcsr_ParaSails.c b/src/parcsr_ls/HYPRE_parcsr_ParaSails.c index 8e5a30c23b..f726633272 100644 --- a/src/parcsr_ls/HYPRE_parcsr_ParaSails.c +++ b/src/parcsr_ls/HYPRE_parcsr_ParaSails.c @@ -23,7 +23,7 @@ #include "../matrix_matrix/HYPRE_matrix_matrix_protos.h" -#include "../distributed_ls/ParaSails/hypre_ParaSails.h" +#include "../distributed_ls/ParaSails/_hypre_ParaSails.h" /* these includes required for HYPRE_ParaSailsBuildIJMatrix */ #include "../IJ_mv/HYPRE_IJ_mv.h" diff --git a/src/parcsr_ls/HYPRE_parcsr_int.c b/src/parcsr_ls/HYPRE_parcsr_int.c index 2ed1266ede..4891916855 100644 --- a/src/parcsr_ls/HYPRE_parcsr_int.c +++ b/src/parcsr_ls/HYPRE_parcsr_int.c @@ -6,9 +6,8 @@ ******************************************************************************/ #include "_hypre_parcsr_ls.h" -#include "interpreter.h" -#include "HYPRE_MatvecFunctions.h" -#include "temp_multivector.h" +#include "_hypre_lobpcg_interpreter.h" +#include "_hypre_lobpcg_temp_multivector.h" HYPRE_Int hypre_ParSetRandomValues( void* v, HYPRE_Int seed ) diff --git a/src/parcsr_ls/HYPRE_parcsr_ls.h b/src/parcsr_ls/HYPRE_parcsr_ls.h index 580fc2ac23..43759ccaf0 100644 --- a/src/parcsr_ls/HYPRE_parcsr_ls.h +++ b/src/parcsr_ls/HYPRE_parcsr_ls.h @@ -14,6 +14,10 @@ #include "HYPRE_IJ_mv.h" #include "HYPRE_lobpcg.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_parcsr_ls_mup_def.h" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -48,13 +52,6 @@ typedef HYPRE_Int (*HYPRE_PtrToParSolverFcn)(HYPRE_Solver, HYPRE_ParVector, HYPRE_ParVector); -#ifndef HYPRE_MODIFYPC -#define HYPRE_MODIFYPC -typedef HYPRE_Int (*HYPRE_PtrToModifyPCFcn)(HYPRE_Solver, - HYPRE_Int, - HYPRE_Real); -#endif - /**@}*/ /*-------------------------------------------------------------------------- @@ -146,6 +143,8 @@ HYPRE_Int HYPRE_BoomerAMGGetResidual(HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGGetNumIterations(HYPRE_Solver solver, HYPRE_Int *num_iterations); +HYPRE_Int HYPRE_BoomerAMGGetCumNumIterations ( HYPRE_Solver solver, HYPRE_Int *cum_num_iterations ); + /** * Returns cumulative num of nonzeros for A and P operators **/ @@ -172,6 +171,8 @@ HYPRE_Int HYPRE_BoomerAMGGetFinalRelativeResidualNorm(HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetNumFunctions(HYPRE_Solver solver, HYPRE_Int num_functions); +HYPRE_Int HYPRE_BoomerAMGGetNumFunctions ( HYPRE_Solver solver, HYPRE_Int *num_functions ); + /** * (Optional) Sets filtering for system of PDEs (\e num_functions > 1). * @@ -189,6 +190,8 @@ HYPRE_Int HYPRE_BoomerAMGSetNumFunctions(HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetFilterFunctions(HYPRE_Solver solver, HYPRE_Int filter_functions); +HYPRE_Int HYPRE_BoomerAMGGetFilterFunctions ( HYPRE_Solver solver, HYPRE_Int *filter_functions ); + /** * (Optional) Sets the mapping that assigns the function to each variable, * if using the systems version. If no assignment is made and the number of @@ -205,6 +208,9 @@ HYPRE_Int HYPRE_BoomerAMGSetDofFunc(HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetConvergeType(HYPRE_Solver solver, HYPRE_Int type); +HYPRE_Int HYPRE_BoomerAMGGetConvergeType(HYPRE_Solver solver, + HYPRE_Int *type); + /** * (Optional) Set the convergence tolerance, if BoomerAMG is used * as a solver. If it is used as a preconditioner, it should be set to 0. @@ -213,6 +219,8 @@ HYPRE_Int HYPRE_BoomerAMGSetConvergeType(HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetTol(HYPRE_Solver solver, HYPRE_Real tol); +HYPRE_Int HYPRE_BoomerAMGGetTol ( HYPRE_Solver solver, HYPRE_Real *tol ); + /** * (Optional) Sets maximum number of iterations, if BoomerAMG is used * as a solver. If it is used as a preconditioner, it should be set to 1. @@ -221,6 +229,8 @@ HYPRE_Int HYPRE_BoomerAMGSetTol(HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetMaxIter(HYPRE_Solver solver, HYPRE_Int max_iter); +HYPRE_Int HYPRE_BoomerAMGGetMaxIter ( HYPRE_Solver solver, HYPRE_Int *max_iter ); + /** * (Optional) **/ @@ -234,6 +244,8 @@ HYPRE_Int HYPRE_BoomerAMGSetMinIter(HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetMaxCoarseSize(HYPRE_Solver solver, HYPRE_Int max_coarse_size); +HYPRE_Int HYPRE_BoomerAMGGetMaxCoarseSize ( HYPRE_Solver solver, HYPRE_Int *max_coarse_size ); + /** * (Optional) Sets minimum size of coarsest grid. * The default is 1. @@ -241,6 +253,8 @@ HYPRE_Int HYPRE_BoomerAMGSetMaxCoarseSize(HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetMinCoarseSize(HYPRE_Solver solver, HYPRE_Int min_coarse_size); +HYPRE_Int HYPRE_BoomerAMGGetMinCoarseSize ( HYPRE_Solver solver, HYPRE_Int *min_coarse_size ); + /** * (Optional) Sets maximum number of multigrid levels. * The default is 25. @@ -248,6 +262,8 @@ HYPRE_Int HYPRE_BoomerAMGSetMinCoarseSize(HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetMaxLevels(HYPRE_Solver solver, HYPRE_Int max_levels); +HYPRE_Int HYPRE_BoomerAMGGetMaxLevels ( HYPRE_Solver solver, HYPRE_Int *max_levels ); + /** * (Optional) Sets cut factor for choosing isolated points * during coarsening according to the rows' density. The default is 0. @@ -258,6 +274,9 @@ HYPRE_Int HYPRE_BoomerAMGSetMaxLevels(HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetCoarsenCutFactor(HYPRE_Solver solver, HYPRE_Int coarsen_cut_factor); +HYPRE_Int HYPRE_BoomerAMGGetCoarsenCutFactor(HYPRE_Solver solver, + HYPRE_Int *coarsen_cut_factor); + /** * (Optional) Sets AMG strength threshold. The default is 0.25. * For 2D Laplace operators, 0.25 is a good value, for 3D Laplace @@ -267,6 +286,8 @@ HYPRE_Int HYPRE_BoomerAMGSetCoarsenCutFactor(HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetStrongThreshold(HYPRE_Solver solver, HYPRE_Real strong_threshold); +HYPRE_Int HYPRE_BoomerAMGGetStrongThreshold ( HYPRE_Solver solver, HYPRE_Real *strong_threshold ); + /** * (Optional) The strong threshold for R is strong connections used * in building an approximate ideal restriction. @@ -275,6 +296,8 @@ HYPRE_Int HYPRE_BoomerAMGSetStrongThreshold(HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetStrongThresholdR(HYPRE_Solver solver, HYPRE_Real strong_threshold); +HYPRE_Int HYPRE_BoomerAMGGetStrongThresholdR ( HYPRE_Solver solver, HYPRE_Real *strong_threshold ); + /** * (Optional) The filter threshold for R is used to eliminate small entries * of the approximate ideal restriction after building it. @@ -283,6 +306,9 @@ HYPRE_Int HYPRE_BoomerAMGSetStrongThresholdR(HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetFilterThresholdR(HYPRE_Solver solver, HYPRE_Real filter_threshold); +HYPRE_Int HYPRE_BoomerAMGGetFilterThresholdR(HYPRE_Solver solver, + HYPRE_Real *filter_threshold); + /** * (Optional) Deprecated. This routine now has no effect. **/ @@ -325,6 +351,8 @@ HYPRE_Int HYPRE_BoomerAMGSetMaxRowSum(HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetCoarsenType(HYPRE_Solver solver, HYPRE_Int coarsen_type); +HYPRE_Int HYPRE_BoomerAMGGetCoarsenType ( HYPRE_Solver solver, HYPRE_Int *coarsen_type ); + /** * (Optional) Defines the non-Galerkin drop-tolerance * for sparsifying coarse grid operators and thus reducing communication. @@ -377,6 +405,9 @@ HYPRE_Int HYPRE_BoomerAMGSetNonGalerkTol (HYPRE_Solver solver, 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 ); + /** * (Optional) Defines the number of levels of aggressive coarsening. * The default is 0, i.e. no aggressive coarsening. @@ -425,11 +456,18 @@ HYPRE_Int HYPRE_BoomerAMGSetNodal(HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetNodalDiag(HYPRE_Solver solver, HYPRE_Int nodal_diag); +/** + * (Optional) Sets the number of levels on which nodal coarsening should be + * performed (nodal coarsening requires that numFunctions be set to something + * other than 1). The default is 0. + **/ +HYPRE_Int HYPRE_BoomerAMGSetNodalLevels(HYPRE_Solver solver, + HYPRE_Int nodal_levels); -/* +/** * (Optional) Sets whether to keep same sign in S for nodal > 0 * The default is 0, i.e., discard those elements. - */ + **/ HYPRE_Int HYPRE_BoomerAMGSetKeepSameSign(HYPRE_Solver solver, HYPRE_Int keep_same_sign); @@ -464,12 +502,22 @@ HYPRE_Int HYPRE_BoomerAMGSetKeepSameSign(HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetInterpType(HYPRE_Solver solver, HYPRE_Int interp_type); +/** + * (Optional) Sets the number of Jacobi interpolation improvement steps. + * Each improvement step smooths the interpolation matrix + * and generally reduces the operator complexity. The default is 0. + **/ +HYPRE_Int HYPRE_BoomerAMGSetInterpRefine(HYPRE_Solver solver, + HYPRE_Int num_refine); + /** * (Optional) Defines a truncation factor for the interpolation. The default is 0. **/ HYPRE_Int HYPRE_BoomerAMGSetTruncFactor(HYPRE_Solver solver, HYPRE_Real trunc_factor); +HYPRE_Int HYPRE_BoomerAMGGetTruncFactor ( HYPRE_Solver solver, HYPRE_Real *trunc_factor ); + /** * (Optional) Defines the maximal number of elements per row for the interpolation. * The default is 4. To turn off truncation, it needs to be set to 0. @@ -477,6 +525,8 @@ HYPRE_Int HYPRE_BoomerAMGSetTruncFactor(HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetPMaxElmts(HYPRE_Solver solver, HYPRE_Int P_max_elmts); +HYPRE_Int HYPRE_BoomerAMGGetPMaxElmts ( HYPRE_Solver solver, HYPRE_Int *P_max_elmts ); + /** * (Optional) Defines whether separation of weights is used * when defining strength for standard interpolation or @@ -555,6 +605,14 @@ HYPRE_Int HYPRE_BoomerAMGSetInterpVectors (HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetInterpVecVariant (HYPRE_Solver solver, HYPRE_Int var ); +/** + * (Optional) Controls whether to apply smoothing to the interpolation vectors + * used in GMG interpolation. Set to 1 to enable smoothing, 0 to disable. + * The default is 0. + **/ +HYPRE_Int HYPRE_BoomerAMGSetSmoothInterpVectors(HYPRE_Solver solver, + HYPRE_Int smooth_interp_vectors); + /** * (Optional) Defines the maximal elements per row for Q, the additional * columns added to the original interpolation matrix P, to reduce complexity. @@ -593,13 +651,18 @@ HYPRE_Int HYPRE_BoomerAMGSetNumSamples(HYPRE_Solver solver, **/ HYPRE_Int HYPRE_BoomerAMGSetCycleType(HYPRE_Solver solver, HYPRE_Int cycle_type); + +HYPRE_Int HYPRE_BoomerAMGGetCycleType(HYPRE_Solver solver, HYPRE_Int *cycle_type); + /** * (Optional) Specifies the use of Full multigrid cycle. * The default is 0. **/ -HYPRE_Int -HYPRE_BoomerAMGSetFCycle( HYPRE_Solver solver, - HYPRE_Int fcycle ); +HYPRE_Int HYPRE_BoomerAMGSetFCycle(HYPRE_Solver solver, + HYPRE_Int fcycle ); + +HYPRE_Int HYPRE_BoomerAMGGetFCycle(HYPRE_Solver solver, + HYPRE_Int *fcycle); /** * (Optional) Defines use of an additive V(1,1)-cycle using the @@ -613,6 +676,8 @@ HYPRE_BoomerAMGSetFCycle( HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetAdditive(HYPRE_Solver solver, HYPRE_Int addlvl); +HYPRE_Int HYPRE_BoomerAMGGetAdditive(HYPRE_Solver solver, HYPRE_Int *additive); + /** * (Optional) Defines use of an additive V(1,1)-cycle using the * mult-additive method starting at level 'addlvl'. @@ -625,6 +690,8 @@ HYPRE_Int HYPRE_BoomerAMGSetAdditive(HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetMultAdditive(HYPRE_Solver solver, HYPRE_Int addlvl); +HYPRE_Int HYPRE_BoomerAMGGetMultAdditive ( HYPRE_Solver solver, HYPRE_Int *mult_additive ); + /** * (Optional) Defines use of an additive V(1,1)-cycle using the * simplified mult-additive method starting at level 'addlvl'. @@ -637,6 +704,8 @@ HYPRE_Int HYPRE_BoomerAMGSetMultAdditive(HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetSimple(HYPRE_Solver solver, HYPRE_Int addlvl); +HYPRE_Int HYPRE_BoomerAMGGetSimple ( HYPRE_Solver solver, HYPRE_Int *simple ); + /** * (Optional) Defines last level where additive, mult-additive * or simple cycle is used. @@ -672,6 +741,22 @@ HYPRE_Int HYPRE_BoomerAMGSetMultAddPMaxElmts(HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetAddRelaxType(HYPRE_Solver solver, HYPRE_Int add_rlx_type); +/** + * (Optional) Sets the maximum number of elements per row for additive + * interpolation matrices. This controls sparsity of P in additive cycles. + * The default is 0 (no limit). + **/ +HYPRE_Int HYPRE_BoomerAMGSetAddPMaxElmts(HYPRE_Solver solver, + HYPRE_Int add_P_max_elmts); + +/** + * (Optional) Sets the truncation factor for additive interpolation. + * Elements in P smaller than (truncation factor * max element in row) + * are dropped. The default is 0.0 (no truncation). + **/ +HYPRE_Int HYPRE_BoomerAMGSetAddTruncFactor(HYPRE_Solver solver, + HYPRE_Real add_trunc_factor); + /** * (Optional) Defines the relaxation weight used for Jacobi within the * (mult)additive or simple cycle portion. @@ -688,6 +773,10 @@ HYPRE_Int HYPRE_BoomerAMGSetAddRelaxWt(HYPRE_Solver solver, **/ HYPRE_Int HYPRE_BoomerAMGSetSeqThreshold(HYPRE_Solver solver, HYPRE_Int seq_threshold); + +HYPRE_Int HYPRE_BoomerAMGGetSeqThreshold(HYPRE_Solver solver, + HYPRE_Int *seq_threshold); + /** * (Optional) operates switch for redundancy. Needs to be used with * HYPRE_BoomerAMGSetSeqThreshold. Default is 0, i.e. no redundancy. @@ -695,6 +784,9 @@ HYPRE_Int HYPRE_BoomerAMGSetSeqThreshold(HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetRedundant(HYPRE_Solver solver, HYPRE_Int redundant); +HYPRE_Int HYPRE_BoomerAMGGetRedundant(HYPRE_Solver solver, + HYPRE_Int *redundant); + /** * (Optional) Defines the number of sweeps for the fine and coarse grid, * the up and down cycle. @@ -725,6 +817,9 @@ 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 ); + /** * (Optional) Defines which smoother is used on the fine and coarse grid, * the up and down cycle. @@ -808,6 +903,9 @@ 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 ); + /** * (Optional) Defines in which order the points are relaxed. There are * the following options for \e relax_order: @@ -966,6 +1064,8 @@ HYPRE_Int HYPRE_BoomerAMGSetChebyEigEst (HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetSmoothType(HYPRE_Solver solver, HYPRE_Int smooth_type); +HYPRE_Int HYPRE_BoomerAMGGetSmoothType ( HYPRE_Solver solver, HYPRE_Int *smooth_type ); + /** * (Optional) Sets the number of levels for more complex smoothers. * The smoothers, @@ -976,6 +1076,8 @@ HYPRE_Int HYPRE_BoomerAMGSetSmoothType(HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetSmoothNumLevels(HYPRE_Solver solver, HYPRE_Int smooth_num_levels); +HYPRE_Int HYPRE_BoomerAMGGetSmoothNumLevels ( HYPRE_Solver solver, HYPRE_Int *smooth_num_levels ); + /** * (Optional) Sets the number of sweeps for more complex smoothers. * The default is 1. @@ -983,6 +1085,8 @@ HYPRE_Int HYPRE_BoomerAMGSetSmoothNumLevels(HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetSmoothNumSweeps(HYPRE_Solver solver, HYPRE_Int smooth_num_sweeps); +HYPRE_Int HYPRE_BoomerAMGGetSmoothNumSweeps ( HYPRE_Solver solver, HYPRE_Int *smooth_num_sweeps ); + /** * (Optional) Defines which variant of the Schwarz method is used. * The following options exist for \e variant: @@ -997,6 +1101,8 @@ HYPRE_Int HYPRE_BoomerAMGSetSmoothNumSweeps(HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetVariant(HYPRE_Solver solver, HYPRE_Int variant); +HYPRE_Int HYPRE_BoomerAMGGetVariant ( HYPRE_Solver solver, HYPRE_Int *variant ); + /** * (Optional) Defines the overlap for the Schwarz method. * The following options exist for overlap: @@ -1008,6 +1114,8 @@ HYPRE_Int HYPRE_BoomerAMGSetVariant(HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetOverlap(HYPRE_Solver solver, HYPRE_Int overlap); +HYPRE_Int HYPRE_BoomerAMGGetOverlap ( HYPRE_Solver solver, HYPRE_Int *overlap ); + /** * (Optional) Defines the type of domain used for the Schwarz method. * The following options exist for \e domain_type: @@ -1019,12 +1127,17 @@ HYPRE_Int HYPRE_BoomerAMGSetOverlap(HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetDomainType(HYPRE_Solver solver, HYPRE_Int domain_type); +HYPRE_Int HYPRE_BoomerAMGGetDomainType ( HYPRE_Solver solver, HYPRE_Int *domain_type ); + /** * (Optional) Defines a smoothing parameter for the additive Schwarz method. **/ HYPRE_Int HYPRE_BoomerAMGSetSchwarzRlxWeight(HYPRE_Solver solver, HYPRE_Real schwarz_rlx_weight); +HYPRE_Int HYPRE_BoomerAMGGetSchwarzRlxWeight ( HYPRE_Solver solver, + HYPRE_Real *schwarz_rlx_weight ); + /** * (Optional) Indicates that the aggregates may not be SPD for the Schwarz method. * The following options exist for \e use_nonsymm: @@ -1330,6 +1443,8 @@ HYPRE_Int HYPRE_BoomerAMGSetPrintFileName(HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetPrintLevel(HYPRE_Solver solver, HYPRE_Int print_level); +HYPRE_Int HYPRE_BoomerAMGGetPrintLevel ( HYPRE_Solver solver, HYPRE_Int *print_level ); + /** * (Optional) Requests additional computations for diagnostic and similar * data to be logged by the user. Default to 0 to do nothing. The latest @@ -1338,6 +1453,7 @@ HYPRE_Int HYPRE_BoomerAMGSetPrintLevel(HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetLogging(HYPRE_Solver solver, HYPRE_Int logging); +HYPRE_Int HYPRE_BoomerAMGGetLogging ( HYPRE_Solver solver, HYPRE_Int *logging ); /** * (Optional) @@ -1345,6 +1461,8 @@ HYPRE_Int HYPRE_BoomerAMGSetLogging(HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetDebugFlag(HYPRE_Solver solver, HYPRE_Int debug_flag); +HYPRE_Int HYPRE_BoomerAMGGetDebugFlag ( HYPRE_Solver solver, HYPRE_Int *debug_flag ); + /** * (Optional) This routine will be eliminated in the future. **/ @@ -1480,6 +1598,60 @@ HYPRE_Int HYPRE_BoomerAMGSetIsolatedFPoints(HYPRE_Solver solver, HYPRE_Int HYPRE_BoomerAMGSetSabs (HYPRE_Solver solver, HYPRE_Int Sabs ); +HYPRE_Int HYPRE_BoomerAMGGetMaxRowSum ( HYPRE_Solver solver, HYPRE_Real *max_row_sum ); + +/** + * (Optional) Switches on use of Jacobi interpolation after computing + * an original interpolation + **/ +HYPRE_Int HYPRE_BoomerAMGSetPostInterpType(HYPRE_Solver solver, + HYPRE_Int post_interp_type); + +HYPRE_Int HYPRE_BoomerAMGGetPostInterpType(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); + +HYPRE_Int HYPRE_BoomerAMGGetJacobiTruncThreshold ( 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, + HYPRE_Int IS_type); + /**@}*/ /*-------------------------------------------------------------------------- @@ -1976,20 +2148,30 @@ HYPRE_Int HYPRE_ParCSRParaSailsSetParams(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_ParCSRParaSailsSetFilter(HYPRE_Solver solver, HYPRE_Real filter); +HYPRE_Int HYPRE_ParaSailsGetFilter ( HYPRE_Solver solver, HYPRE_Real *filter ); HYPRE_Int HYPRE_ParCSRParaSailsSetSym(HYPRE_Solver solver, HYPRE_Int sym); +HYPRE_Int HYPRE_ParaSailsGetSym ( HYPRE_Solver solver, HYPRE_Int *sym ); HYPRE_Int HYPRE_ParCSRParaSailsSetLoadbal(HYPRE_Solver solver, HYPRE_Real loadbal); +HYPRE_Int HYPRE_ParaSailsGetLoadbal ( HYPRE_Solver solver, HYPRE_Real *loadbal ); HYPRE_Int HYPRE_ParCSRParaSailsSetReuse(HYPRE_Solver solver, HYPRE_Int reuse); +HYPRE_Int HYPRE_ParaSailsGetReuse ( HYPRE_Solver solver, HYPRE_Int *reuse ); HYPRE_Int HYPRE_ParCSRParaSailsSetLogging(HYPRE_Solver solver, HYPRE_Int logging); +HYPRE_Int HYPRE_ParaSailsGetLogging ( HYPRE_Solver solver, HYPRE_Int *logging ); /**@}*/ @@ -2739,6 +2921,25 @@ HYPRE_Int HYPRE_ADSGetFinalRelativeResidualNorm(HYPRE_Solver solver, /**@}*/ +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +/* 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_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 ); + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -3511,14 +3712,14 @@ HYPRE_Int HYPRE_ParCSRHybridSetCycleType(HYPRE_Solver solver, HYPRE_Int cycle_type); -/* +/** * **/ HYPRE_Int HYPRE_ParCSRHybridSetGridRelaxType(HYPRE_Solver solver, HYPRE_Int *grid_relax_type); -/* +/** * **/ HYPRE_Int @@ -4846,7 +5047,8 @@ HYPRE_ILUGetFinalRelativeResidualNorm( HYPRE_Solver solver, HYPRE_Real *res_nor *--------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------- - * Miscellaneous: These probably do not belong in the interface. + * RDF: These don't belong in the external interface but are used in various + * test drivers. They should be moved into the test directory instead. *--------------------------------------------------------------------------*/ HYPRE_ParCSRMatrix GenerateLaplacian(MPI_Comm comm, @@ -4950,51 +5152,10 @@ hypre_GenerateCoordinates(MPI_Comm comm, /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -/** - * (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, - HYPRE_Int IS_type); /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -5036,14 +5197,42 @@ HYPRE_ParCSRMultiVectorRead(MPI_Comm comm, void *ii_, const char *fileName); +HYPRE_Int HYPRE_TempParCSRSetupInterpreter ( mv_InterfaceInterpreter *i ); + /**@}*/ /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ + +/* HYPRE_parcsr_block.c RDF: Does this belong here? */ +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 ); + /**@}*/ #ifdef __cplusplus } #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_parcsr_ls_mup_undef.h" +#include "HYPRE_parcsr_ls_mup.h" +#include "HYPRE_parcsr_ls_mp.h" +#endif +#endif + #endif diff --git a/src/parcsr_ls/HYPRE_parcsr_ls_mp.c b/src/parcsr_ls/HYPRE_parcsr_ls_mp.c new file mode 100644 index 0000000000..5f9cffd452 --- /dev/null +++ b/src/parcsr_ls/HYPRE_parcsr_ls_mp.c @@ -0,0 +1,102 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_parcsr_ls mixed precision functions + * + *****************************************************************************/ + +#include "_hypre_parcsr_ls.h" + +#ifdef HYPRE_MIXED_PRECISION + +/*-------------------------------------------------------------------------- + * Mixed-precision HYPRE_BoomerAMGSetup + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetup_mp( HYPRE_Solver solver, + HYPRE_ParCSRMatrix A, + HYPRE_ParVector b, + HYPRE_ParVector x ) +{ + hypre_ParVector *btemp = NULL; + hypre_ParVector *xtemp = NULL; + + HYPRE_ParVectorCreate_flt(hypre_ParCSRMatrixComm(A), + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixRowStarts(A), + &btemp); + HYPRE_ParVectorInitialize_flt( btemp ); + HYPRE_ParVectorCreate_flt(hypre_ParCSRMatrixComm(A), + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixRowStarts(A), + &xtemp); + HYPRE_ParVectorInitialize_flt( xtemp ); + + /* copy from double-precision {b,x} to single precision {btemp,xtemp} */ + HYPRE_ParVectorCopy_mp(b, btemp); + HYPRE_ParVectorCopy_mp(x, xtemp); + + /* call setup */ + HYPRE_BoomerAMGSetup_flt( solver, A, btemp, xtemp ); + + /* copy from single precision {btemp,xtemp} to double-precision {b,x} */ + HYPRE_ParVectorCopy_mp(btemp, b); + HYPRE_ParVectorCopy_mp(xtemp, x); + + /* free data */ + HYPRE_ParVectorDestroy_flt(btemp); + HYPRE_ParVectorDestroy_flt(xtemp); + + return 0; + +} + +/*-------------------------------------------------------------------------- + * Mixed-precision HYPRE_BoomerAMGSetup + *--------------------------------------------------------------------------*/ +HYPRE_Int +HYPRE_BoomerAMGSolve_mp( HYPRE_Solver solver, + HYPRE_ParCSRMatrix A, + HYPRE_ParVector b, + HYPRE_ParVector x ) +{ + hypre_ParVector *btemp = NULL; + hypre_ParVector *xtemp = NULL; + + HYPRE_ParVectorCreate_flt(hypre_ParCSRMatrixComm(A), + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixRowStarts(A), + &btemp); + HYPRE_ParVectorInitialize_flt( btemp ); + HYPRE_ParVectorCreate_flt(hypre_ParCSRMatrixComm(A), + hypre_ParCSRMatrixGlobalNumRows(A), + hypre_ParCSRMatrixRowStarts(A), + &xtemp); + HYPRE_ParVectorInitialize_flt( xtemp ); + + /* copy from double-precision {b,x} to single precision {btemp,xtemp} */ + HYPRE_ParVectorCopy_mp(b, btemp); + HYPRE_ParVectorCopy_mp(x, xtemp); + + /* call setup */ + HYPRE_BoomerAMGSolve_flt( solver, A, btemp, xtemp ); + + /* copy from single precision {btemp,xtemp} to double-precision {b,x} */ + HYPRE_ParVectorCopy_mp(btemp, b); + HYPRE_ParVectorCopy_mp(xtemp, x); + + /* free data */ + HYPRE_ParVectorDestroy_flt(btemp); + HYPRE_ParVectorDestroy_flt(xtemp); + + return 0; +} + +#endif diff --git a/src/parcsr_ls/HYPRE_parcsr_ls_mp.h b/src/parcsr_ls/HYPRE_parcsr_ls_mp.h new file mode 100644 index 0000000000..0a89314bf6 --- /dev/null +++ b/src/parcsr_ls/HYPRE_parcsr_ls_mp.h @@ -0,0 +1,39 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/****************************************************************************** + * + * Mixed precision function protos + * + *****************************************************************************/ + +#ifndef HYPRE_PARCSR_LS_MP_HEADER +#define HYPRE_PARCSR_LS_MP_HEADER + +#ifdef HYPRE_MIXED_PRECISION + +#ifdef __cplusplus +extern "C" { +#endif + +HYPRE_Int HYPRE_BoomerAMGSetup_mp(HYPRE_Solver solver, + HYPRE_ParCSRMatrix A, + HYPRE_ParVector b, + HYPRE_ParVector x); + +HYPRE_Int HYPRE_BoomerAMGSolve_mp(HYPRE_Solver solver, + HYPRE_ParCSRMatrix A, + HYPRE_ParVector b, + HYPRE_ParVector x); + +#ifdef __cplusplus +} +#endif + +#endif + +#endif diff --git a/src/parcsr_ls/HYPRE_parcsr_ls_mup.h b/src/parcsr_ls/HYPRE_parcsr_ls_mup.h new file mode 100644 index 0000000000..1fca390f2e --- /dev/null +++ b/src/parcsr_ls/HYPRE_parcsr_ls_mup.h @@ -0,0 +1,7633 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#ifndef HYPRE_PARCSR_LS_MUP_HEADER +#define HYPRE_PARCSR_LS_MUP_HEADER + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (HYPRE_MIXED_PRECISION) + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_ParCSRMatrix +GenerateDifConv_flt( 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_float *value ); +HYPRE_ParCSRMatrix +GenerateDifConv_dbl( 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_double *value ); +HYPRE_ParCSRMatrix +GenerateDifConv_long_dbl( 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_long_double *value ); + +HYPRE_ParCSRMatrix +GenerateLaplacian_flt( 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_float *value ); +HYPRE_ParCSRMatrix +GenerateLaplacian_dbl( 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_double *value ); +HYPRE_ParCSRMatrix +GenerateLaplacian_long_dbl( 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_long_double *value ); + +HYPRE_ParCSRMatrix +GenerateLaplacian27pt_flt( 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_float *value ); +HYPRE_ParCSRMatrix +GenerateLaplacian27pt_dbl( 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_double *value ); +HYPRE_ParCSRMatrix +GenerateLaplacian27pt_long_dbl( 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_long_double *value ); + +HYPRE_ParCSRMatrix +GenerateLaplacian9pt_flt( MPI_Comm comm, HYPRE_BigInt nx, HYPRE_BigInt ny, HYPRE_Int P, HYPRE_Int Q, HYPRE_Int p, HYPRE_Int q, hypre_float *value ); +HYPRE_ParCSRMatrix +GenerateLaplacian9pt_dbl( MPI_Comm comm, HYPRE_BigInt nx, HYPRE_BigInt ny, HYPRE_Int P, HYPRE_Int Q, HYPRE_Int p, HYPRE_Int q, hypre_double *value ); +HYPRE_ParCSRMatrix +GenerateLaplacian9pt_long_dbl( MPI_Comm comm, HYPRE_BigInt nx, HYPRE_BigInt ny, HYPRE_Int P, HYPRE_Int Q, HYPRE_Int p, HYPRE_Int q, hypre_long_double *value ); + +HYPRE_ParCSRMatrix +GenerateRSVarDifConv_flt( 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_float eps, HYPRE_ParVector *rhs_ptr, HYPRE_Int type ); +HYPRE_ParCSRMatrix +GenerateRSVarDifConv_dbl( 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_double eps, HYPRE_ParVector *rhs_ptr, HYPRE_Int type ); +HYPRE_ParCSRMatrix +GenerateRSVarDifConv_long_dbl( 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_long_double eps, HYPRE_ParVector *rhs_ptr, HYPRE_Int type ); + +HYPRE_ParCSRMatrix +GenerateRotate7pt_flt( MPI_Comm comm, HYPRE_BigInt nx, HYPRE_BigInt ny, HYPRE_Int P, HYPRE_Int Q, HYPRE_Int p, HYPRE_Int q, hypre_float alpha, hypre_float eps ); +HYPRE_ParCSRMatrix +GenerateRotate7pt_dbl( MPI_Comm comm, HYPRE_BigInt nx, HYPRE_BigInt ny, HYPRE_Int P, HYPRE_Int Q, HYPRE_Int p, HYPRE_Int q, hypre_double alpha, hypre_double eps ); +HYPRE_ParCSRMatrix +GenerateRotate7pt_long_dbl( MPI_Comm comm, HYPRE_BigInt nx, HYPRE_BigInt ny, HYPRE_Int P, HYPRE_Int Q, HYPRE_Int p, HYPRE_Int q, hypre_long_double alpha, hypre_long_double eps ); + +HYPRE_ParCSRMatrix +GenerateVarDifConv_flt( 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_float eps, HYPRE_ParVector *rhs_ptr ); +HYPRE_ParCSRMatrix +GenerateVarDifConv_dbl( 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_double eps, HYPRE_ParVector *rhs_ptr ); +HYPRE_ParCSRMatrix +GenerateVarDifConv_long_dbl( 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_long_double eps, HYPRE_ParVector *rhs_ptr ); + +float* +hypre_GenerateCoordinates_flt( 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_dbl( 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_long_dbl( 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 ); + + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_ADSCreate_flt( HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ADSCreate_dbl( HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ADSCreate_long_dbl( HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ADSCreate( HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_ADSDestroy_flt( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ADSDestroy_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ADSDestroy_long_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ADSDestroy( HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_ADSGetFinalRelativeResidualNorm_flt( HYPRE_Solver solver, hypre_float *rel_resid_norm ); +HYPRE_Int +HYPRE_ADSGetFinalRelativeResidualNorm_dbl( HYPRE_Solver solver, hypre_double *rel_resid_norm ); +HYPRE_Int +HYPRE_ADSGetFinalRelativeResidualNorm_long_dbl( HYPRE_Solver solver, hypre_long_double *rel_resid_norm ); +HYPRE_Int +HYPRE_ADSGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *rel_resid_norm ); + +HYPRE_Int +HYPRE_ADSGetNumIterations_flt( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_ADSGetNumIterations_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_ADSGetNumIterations_long_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_ADSGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_ADSSetAMGOptions_flt( HYPRE_Solver solver, HYPRE_Int coarsen_type, HYPRE_Int agg_levels, HYPRE_Int relax_type, hypre_float strength_threshold, HYPRE_Int interp_type, HYPRE_Int Pmax ); +HYPRE_Int +HYPRE_ADSSetAMGOptions_dbl( HYPRE_Solver solver, HYPRE_Int coarsen_type, HYPRE_Int agg_levels, HYPRE_Int relax_type, hypre_double strength_threshold, HYPRE_Int interp_type, HYPRE_Int Pmax ); +HYPRE_Int +HYPRE_ADSSetAMGOptions_long_dbl( HYPRE_Solver solver, HYPRE_Int coarsen_type, HYPRE_Int agg_levels, HYPRE_Int relax_type, hypre_long_double 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_long_double strength_threshold, HYPRE_Int interp_type, HYPRE_Int Pmax ); + +HYPRE_Int +HYPRE_ADSSetAMSOptions_flt( HYPRE_Solver solver, HYPRE_Int cycle_type, HYPRE_Int coarsen_type, HYPRE_Int agg_levels, HYPRE_Int relax_type, hypre_float strength_threshold, HYPRE_Int interp_type, HYPRE_Int Pmax ); +HYPRE_Int +HYPRE_ADSSetAMSOptions_dbl( HYPRE_Solver solver, HYPRE_Int cycle_type, HYPRE_Int coarsen_type, HYPRE_Int agg_levels, HYPRE_Int relax_type, hypre_double strength_threshold, HYPRE_Int interp_type, HYPRE_Int Pmax ); +HYPRE_Int +HYPRE_ADSSetAMSOptions_long_dbl( HYPRE_Solver solver, HYPRE_Int cycle_type, HYPRE_Int coarsen_type, HYPRE_Int agg_levels, HYPRE_Int relax_type, hypre_long_double strength_threshold, HYPRE_Int interp_type, HYPRE_Int Pmax ); +HYPRE_Int +HYPRE_ADSSetAMSOptions( HYPRE_Solver solver, HYPRE_Int cycle_type, HYPRE_Int coarsen_type, HYPRE_Int agg_levels, HYPRE_Int relax_type, hypre_long_double strength_threshold, HYPRE_Int interp_type, HYPRE_Int Pmax ); + +HYPRE_Int +HYPRE_ADSSetChebySmoothingOptions_flt( HYPRE_Solver solver, HYPRE_Int cheby_order, hypre_float cheby_fraction ); +HYPRE_Int +HYPRE_ADSSetChebySmoothingOptions_dbl( HYPRE_Solver solver, HYPRE_Int cheby_order, hypre_double cheby_fraction ); +HYPRE_Int +HYPRE_ADSSetChebySmoothingOptions_long_dbl( HYPRE_Solver solver, HYPRE_Int cheby_order, hypre_long_double cheby_fraction ); +HYPRE_Int +HYPRE_ADSSetChebySmoothingOptions( HYPRE_Solver solver, HYPRE_Int cheby_order, hypre_long_double cheby_fraction ); + +HYPRE_Int +HYPRE_ADSSetCoordinateVectors_flt( HYPRE_Solver solver, HYPRE_ParVector x, HYPRE_ParVector y, HYPRE_ParVector z ); +HYPRE_Int +HYPRE_ADSSetCoordinateVectors_dbl( HYPRE_Solver solver, HYPRE_ParVector x, HYPRE_ParVector y, HYPRE_ParVector z ); +HYPRE_Int +HYPRE_ADSSetCoordinateVectors_long_dbl( HYPRE_Solver solver, HYPRE_ParVector x, HYPRE_ParVector y, HYPRE_ParVector z ); +HYPRE_Int +HYPRE_ADSSetCoordinateVectors( HYPRE_Solver solver, HYPRE_ParVector x, HYPRE_ParVector y, HYPRE_ParVector z ); + +HYPRE_Int +HYPRE_ADSSetCycleType_flt( HYPRE_Solver solver, HYPRE_Int cycle_type ); +HYPRE_Int +HYPRE_ADSSetCycleType_dbl( HYPRE_Solver solver, HYPRE_Int cycle_type ); +HYPRE_Int +HYPRE_ADSSetCycleType_long_dbl( HYPRE_Solver solver, HYPRE_Int cycle_type ); +HYPRE_Int +HYPRE_ADSSetCycleType( HYPRE_Solver solver, HYPRE_Int cycle_type ); + +HYPRE_Int +HYPRE_ADSSetDiscreteCurl_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix C ); +HYPRE_Int +HYPRE_ADSSetDiscreteCurl_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix C ); +HYPRE_Int +HYPRE_ADSSetDiscreteCurl_long_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix C ); +HYPRE_Int +HYPRE_ADSSetDiscreteCurl( HYPRE_Solver solver, HYPRE_ParCSRMatrix C ); + +HYPRE_Int +HYPRE_ADSSetDiscreteGradient_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix G ); +HYPRE_Int +HYPRE_ADSSetDiscreteGradient_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix G ); +HYPRE_Int +HYPRE_ADSSetDiscreteGradient_long_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix G ); +HYPRE_Int +HYPRE_ADSSetDiscreteGradient( HYPRE_Solver solver, HYPRE_ParCSRMatrix G ); + +HYPRE_Int +HYPRE_ADSSetInterpolations_flt( 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_ADSSetInterpolations_dbl( 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_ADSSetInterpolations_long_dbl( 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_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_flt( HYPRE_Solver solver, HYPRE_Int maxit ); +HYPRE_Int +HYPRE_ADSSetMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int maxit ); +HYPRE_Int +HYPRE_ADSSetMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int maxit ); +HYPRE_Int +HYPRE_ADSSetMaxIter( HYPRE_Solver solver, HYPRE_Int maxit ); + +HYPRE_Int +HYPRE_ADSSetPrintLevel_flt( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_ADSSetPrintLevel_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_ADSSetPrintLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_ADSSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_ADSSetSmoothingOptions_flt( HYPRE_Solver solver, HYPRE_Int relax_type, HYPRE_Int relax_times, hypre_float relax_weight, hypre_float omega ); +HYPRE_Int +HYPRE_ADSSetSmoothingOptions_dbl( HYPRE_Solver solver, HYPRE_Int relax_type, HYPRE_Int relax_times, hypre_double relax_weight, hypre_double omega ); +HYPRE_Int +HYPRE_ADSSetSmoothingOptions_long_dbl( HYPRE_Solver solver, HYPRE_Int relax_type, HYPRE_Int relax_times, hypre_long_double relax_weight, hypre_long_double omega ); +HYPRE_Int +HYPRE_ADSSetSmoothingOptions( HYPRE_Solver solver, HYPRE_Int relax_type, HYPRE_Int relax_times, hypre_long_double relax_weight, hypre_long_double omega ); + +HYPRE_Int +HYPRE_ADSSetTol_flt( HYPRE_Solver solver, hypre_float tol ); +HYPRE_Int +HYPRE_ADSSetTol_dbl( HYPRE_Solver solver, hypre_double tol ); +HYPRE_Int +HYPRE_ADSSetTol_long_dbl( HYPRE_Solver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_ADSSetTol( HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_ADSSetup_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ADSSetup_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ADSSetup_long_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ADSSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ADSSolve_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ADSSolve_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ADSSolve_long_dbl( 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_AMECreate_flt( HYPRE_Solver *esolver ); +HYPRE_Int +HYPRE_AMECreate_dbl( HYPRE_Solver *esolver ); +HYPRE_Int +HYPRE_AMECreate_long_dbl( HYPRE_Solver *esolver ); +HYPRE_Int +HYPRE_AMECreate( HYPRE_Solver *esolver ); + +HYPRE_Int +HYPRE_AMEDestroy_flt( HYPRE_Solver esolver ); +HYPRE_Int +HYPRE_AMEDestroy_dbl( HYPRE_Solver esolver ); +HYPRE_Int +HYPRE_AMEDestroy_long_dbl( HYPRE_Solver esolver ); +HYPRE_Int +HYPRE_AMEDestroy( HYPRE_Solver esolver ); + +HYPRE_Int +HYPRE_AMEGetEigenvalues_flt( HYPRE_Solver esolver, hypre_float **eigenvalues ); +HYPRE_Int +HYPRE_AMEGetEigenvalues_dbl( HYPRE_Solver esolver, hypre_double **eigenvalues ); +HYPRE_Int +HYPRE_AMEGetEigenvalues_long_dbl( HYPRE_Solver esolver, hypre_long_double **eigenvalues ); +HYPRE_Int +HYPRE_AMEGetEigenvalues( HYPRE_Solver esolver, void *eigenvalues ); + +HYPRE_Int +HYPRE_AMEGetEigenvectors_flt( HYPRE_Solver esolver, HYPRE_ParVector **eigenvectors ); +HYPRE_Int +HYPRE_AMEGetEigenvectors_dbl( HYPRE_Solver esolver, HYPRE_ParVector **eigenvectors ); +HYPRE_Int +HYPRE_AMEGetEigenvectors_long_dbl( HYPRE_Solver esolver, HYPRE_ParVector **eigenvectors ); +HYPRE_Int +HYPRE_AMEGetEigenvectors( HYPRE_Solver esolver, HYPRE_ParVector **eigenvectors ); + +HYPRE_Int +HYPRE_AMESetAMSSolver_flt( HYPRE_Solver esolver, HYPRE_Solver ams_solver ); +HYPRE_Int +HYPRE_AMESetAMSSolver_dbl( HYPRE_Solver esolver, HYPRE_Solver ams_solver ); +HYPRE_Int +HYPRE_AMESetAMSSolver_long_dbl( HYPRE_Solver esolver, HYPRE_Solver ams_solver ); +HYPRE_Int +HYPRE_AMESetAMSSolver( HYPRE_Solver esolver, HYPRE_Solver ams_solver ); + +HYPRE_Int +HYPRE_AMESetBlockSize_flt( HYPRE_Solver esolver, HYPRE_Int block_size ); +HYPRE_Int +HYPRE_AMESetBlockSize_dbl( HYPRE_Solver esolver, HYPRE_Int block_size ); +HYPRE_Int +HYPRE_AMESetBlockSize_long_dbl( HYPRE_Solver esolver, HYPRE_Int block_size ); +HYPRE_Int +HYPRE_AMESetBlockSize( HYPRE_Solver esolver, HYPRE_Int block_size ); + +HYPRE_Int +HYPRE_AMESetMassMatrix_flt( HYPRE_Solver esolver, HYPRE_ParCSRMatrix M ); +HYPRE_Int +HYPRE_AMESetMassMatrix_dbl( HYPRE_Solver esolver, HYPRE_ParCSRMatrix M ); +HYPRE_Int +HYPRE_AMESetMassMatrix_long_dbl( HYPRE_Solver esolver, HYPRE_ParCSRMatrix M ); +HYPRE_Int +HYPRE_AMESetMassMatrix( HYPRE_Solver esolver, HYPRE_ParCSRMatrix M ); + +HYPRE_Int +HYPRE_AMESetMaxIter_flt( HYPRE_Solver esolver, HYPRE_Int maxit ); +HYPRE_Int +HYPRE_AMESetMaxIter_dbl( HYPRE_Solver esolver, HYPRE_Int maxit ); +HYPRE_Int +HYPRE_AMESetMaxIter_long_dbl( HYPRE_Solver esolver, HYPRE_Int maxit ); +HYPRE_Int +HYPRE_AMESetMaxIter( HYPRE_Solver esolver, HYPRE_Int maxit ); + +HYPRE_Int +HYPRE_AMESetMaxPCGIter_flt( HYPRE_Solver esolver, HYPRE_Int maxit ); +HYPRE_Int +HYPRE_AMESetMaxPCGIter_dbl( HYPRE_Solver esolver, HYPRE_Int maxit ); +HYPRE_Int +HYPRE_AMESetMaxPCGIter_long_dbl( HYPRE_Solver esolver, HYPRE_Int maxit ); +HYPRE_Int +HYPRE_AMESetMaxPCGIter( HYPRE_Solver esolver, HYPRE_Int maxit ); + +HYPRE_Int +HYPRE_AMESetPrintLevel_flt( HYPRE_Solver esolver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_AMESetPrintLevel_dbl( HYPRE_Solver esolver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_AMESetPrintLevel_long_dbl( HYPRE_Solver esolver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_AMESetPrintLevel( HYPRE_Solver esolver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_AMESetRTol_flt( HYPRE_Solver esolver, hypre_float tol ); +HYPRE_Int +HYPRE_AMESetRTol_dbl( HYPRE_Solver esolver, hypre_double tol ); +HYPRE_Int +HYPRE_AMESetRTol_long_dbl( HYPRE_Solver esolver, hypre_long_double tol ); +HYPRE_Int +HYPRE_AMESetRTol( HYPRE_Solver esolver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_AMESetTol_flt( HYPRE_Solver esolver, hypre_float tol ); +HYPRE_Int +HYPRE_AMESetTol_dbl( HYPRE_Solver esolver, hypre_double tol ); +HYPRE_Int +HYPRE_AMESetTol_long_dbl( HYPRE_Solver esolver, hypre_long_double tol ); +HYPRE_Int +HYPRE_AMESetTol( HYPRE_Solver esolver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_AMESetup_flt( HYPRE_Solver esolver ); +HYPRE_Int +HYPRE_AMESetup_dbl( HYPRE_Solver esolver ); +HYPRE_Int +HYPRE_AMESetup_long_dbl( HYPRE_Solver esolver ); +HYPRE_Int +HYPRE_AMESetup( HYPRE_Solver esolver ); + +HYPRE_Int +HYPRE_AMESolve_flt( HYPRE_Solver esolver ); +HYPRE_Int +HYPRE_AMESolve_dbl( HYPRE_Solver esolver ); +HYPRE_Int +HYPRE_AMESolve_long_dbl( HYPRE_Solver esolver ); +HYPRE_Int +HYPRE_AMESolve( HYPRE_Solver esolver ); + +HYPRE_Int +HYPRE_AMSConstructDiscreteGradient_flt( HYPRE_ParCSRMatrix A, HYPRE_ParVector x_coord, HYPRE_BigInt *edge_vertex, HYPRE_Int edge_orientation, HYPRE_ParCSRMatrix *G ); +HYPRE_Int +HYPRE_AMSConstructDiscreteGradient_dbl( HYPRE_ParCSRMatrix A, HYPRE_ParVector x_coord, HYPRE_BigInt *edge_vertex, HYPRE_Int edge_orientation, HYPRE_ParCSRMatrix *G ); +HYPRE_Int +HYPRE_AMSConstructDiscreteGradient_long_dbl( HYPRE_ParCSRMatrix A, HYPRE_ParVector x_coord, HYPRE_BigInt *edge_vertex, HYPRE_Int edge_orientation, HYPRE_ParCSRMatrix *G ); +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_AMSCreate_flt( HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_AMSCreate_dbl( HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_AMSCreate_long_dbl( HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_AMSCreate( HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_AMSDestroy_flt( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_AMSDestroy_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_AMSDestroy_long_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_AMSDestroy( HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_AMSGetFinalRelativeResidualNorm_flt( HYPRE_Solver solver, hypre_float *rel_resid_norm ); +HYPRE_Int +HYPRE_AMSGetFinalRelativeResidualNorm_dbl( HYPRE_Solver solver, hypre_double *rel_resid_norm ); +HYPRE_Int +HYPRE_AMSGetFinalRelativeResidualNorm_long_dbl( HYPRE_Solver solver, hypre_long_double *rel_resid_norm ); +HYPRE_Int +HYPRE_AMSGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *rel_resid_norm ); + +HYPRE_Int +HYPRE_AMSGetNumIterations_flt( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_AMSGetNumIterations_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_AMSGetNumIterations_long_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_AMSGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_AMSProjectOutGradients_flt( HYPRE_Solver solver, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_AMSProjectOutGradients_dbl( HYPRE_Solver solver, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_AMSProjectOutGradients_long_dbl( HYPRE_Solver solver, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_AMSProjectOutGradients( HYPRE_Solver solver, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_AMSSetAlphaAMGCoarseRelaxType_flt( HYPRE_Solver solver, HYPRE_Int alpha_coarse_relax_type ); +HYPRE_Int +HYPRE_AMSSetAlphaAMGCoarseRelaxType_dbl( HYPRE_Solver solver, HYPRE_Int alpha_coarse_relax_type ); +HYPRE_Int +HYPRE_AMSSetAlphaAMGCoarseRelaxType_long_dbl( HYPRE_Solver solver, HYPRE_Int alpha_coarse_relax_type ); +HYPRE_Int +HYPRE_AMSSetAlphaAMGCoarseRelaxType( HYPRE_Solver solver, HYPRE_Int alpha_coarse_relax_type ); + +HYPRE_Int +HYPRE_AMSSetAlphaAMGOptions_flt( HYPRE_Solver solver, HYPRE_Int alpha_coarsen_type, HYPRE_Int alpha_agg_levels, HYPRE_Int alpha_relax_type, hypre_float alpha_strength_threshold, HYPRE_Int alpha_interp_type, HYPRE_Int alpha_Pmax ); +HYPRE_Int +HYPRE_AMSSetAlphaAMGOptions_dbl( HYPRE_Solver solver, HYPRE_Int alpha_coarsen_type, HYPRE_Int alpha_agg_levels, HYPRE_Int alpha_relax_type, hypre_double alpha_strength_threshold, HYPRE_Int alpha_interp_type, HYPRE_Int alpha_Pmax ); +HYPRE_Int +HYPRE_AMSSetAlphaAMGOptions_long_dbl( HYPRE_Solver solver, HYPRE_Int alpha_coarsen_type, HYPRE_Int alpha_agg_levels, HYPRE_Int alpha_relax_type, hypre_long_double alpha_strength_threshold, HYPRE_Int alpha_interp_type, HYPRE_Int alpha_Pmax ); +HYPRE_Int +HYPRE_AMSSetAlphaAMGOptions( HYPRE_Solver solver, HYPRE_Int alpha_coarsen_type, HYPRE_Int alpha_agg_levels, HYPRE_Int alpha_relax_type, hypre_long_double alpha_strength_threshold, HYPRE_Int alpha_interp_type, HYPRE_Int alpha_Pmax ); + +HYPRE_Int +HYPRE_AMSSetAlphaPoissonMatrix_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A_alpha ); +HYPRE_Int +HYPRE_AMSSetAlphaPoissonMatrix_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A_alpha ); +HYPRE_Int +HYPRE_AMSSetAlphaPoissonMatrix_long_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A_alpha ); +HYPRE_Int +HYPRE_AMSSetAlphaPoissonMatrix( HYPRE_Solver solver, HYPRE_ParCSRMatrix A_alpha ); + +HYPRE_Int +HYPRE_AMSSetBetaAMGCoarseRelaxType_flt( HYPRE_Solver solver, HYPRE_Int beta_coarse_relax_type ); +HYPRE_Int +HYPRE_AMSSetBetaAMGCoarseRelaxType_dbl( HYPRE_Solver solver, HYPRE_Int beta_coarse_relax_type ); +HYPRE_Int +HYPRE_AMSSetBetaAMGCoarseRelaxType_long_dbl( HYPRE_Solver solver, HYPRE_Int beta_coarse_relax_type ); +HYPRE_Int +HYPRE_AMSSetBetaAMGCoarseRelaxType( HYPRE_Solver solver, HYPRE_Int beta_coarse_relax_type ); + +HYPRE_Int +HYPRE_AMSSetBetaAMGOptions_flt( HYPRE_Solver solver, HYPRE_Int beta_coarsen_type, HYPRE_Int beta_agg_levels, HYPRE_Int beta_relax_type, hypre_float beta_strength_threshold, HYPRE_Int beta_interp_type, HYPRE_Int beta_Pmax ); +HYPRE_Int +HYPRE_AMSSetBetaAMGOptions_dbl( HYPRE_Solver solver, HYPRE_Int beta_coarsen_type, HYPRE_Int beta_agg_levels, HYPRE_Int beta_relax_type, hypre_double beta_strength_threshold, HYPRE_Int beta_interp_type, HYPRE_Int beta_Pmax ); +HYPRE_Int +HYPRE_AMSSetBetaAMGOptions_long_dbl( HYPRE_Solver solver, HYPRE_Int beta_coarsen_type, HYPRE_Int beta_agg_levels, HYPRE_Int beta_relax_type, hypre_long_double beta_strength_threshold, HYPRE_Int beta_interp_type, HYPRE_Int beta_Pmax ); +HYPRE_Int +HYPRE_AMSSetBetaAMGOptions( HYPRE_Solver solver, HYPRE_Int beta_coarsen_type, HYPRE_Int beta_agg_levels, HYPRE_Int beta_relax_type, hypre_long_double beta_strength_threshold, HYPRE_Int beta_interp_type, HYPRE_Int beta_Pmax ); + +HYPRE_Int +HYPRE_AMSSetBetaPoissonMatrix_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A_beta ); +HYPRE_Int +HYPRE_AMSSetBetaPoissonMatrix_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A_beta ); +HYPRE_Int +HYPRE_AMSSetBetaPoissonMatrix_long_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A_beta ); +HYPRE_Int +HYPRE_AMSSetBetaPoissonMatrix( HYPRE_Solver solver, HYPRE_ParCSRMatrix A_beta ); + +HYPRE_Int +HYPRE_AMSSetCoordinateVectors_flt( HYPRE_Solver solver, HYPRE_ParVector x, HYPRE_ParVector y, HYPRE_ParVector z ); +HYPRE_Int +HYPRE_AMSSetCoordinateVectors_dbl( HYPRE_Solver solver, HYPRE_ParVector x, HYPRE_ParVector y, HYPRE_ParVector z ); +HYPRE_Int +HYPRE_AMSSetCoordinateVectors_long_dbl( HYPRE_Solver solver, HYPRE_ParVector x, HYPRE_ParVector y, HYPRE_ParVector z ); +HYPRE_Int +HYPRE_AMSSetCoordinateVectors( HYPRE_Solver solver, HYPRE_ParVector x, HYPRE_ParVector y, HYPRE_ParVector z ); + +HYPRE_Int +HYPRE_AMSSetCycleType_flt( HYPRE_Solver solver, HYPRE_Int cycle_type ); +HYPRE_Int +HYPRE_AMSSetCycleType_dbl( HYPRE_Solver solver, HYPRE_Int cycle_type ); +HYPRE_Int +HYPRE_AMSSetCycleType_long_dbl( HYPRE_Solver solver, HYPRE_Int cycle_type ); +HYPRE_Int +HYPRE_AMSSetCycleType( HYPRE_Solver solver, HYPRE_Int cycle_type ); + +HYPRE_Int +HYPRE_AMSSetDimension_flt( HYPRE_Solver solver, HYPRE_Int dim ); +HYPRE_Int +HYPRE_AMSSetDimension_dbl( HYPRE_Solver solver, HYPRE_Int dim ); +HYPRE_Int +HYPRE_AMSSetDimension_long_dbl( HYPRE_Solver solver, HYPRE_Int dim ); +HYPRE_Int +HYPRE_AMSSetDimension( HYPRE_Solver solver, HYPRE_Int dim ); + +HYPRE_Int +HYPRE_AMSSetDiscreteGradient_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix G ); +HYPRE_Int +HYPRE_AMSSetDiscreteGradient_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix G ); +HYPRE_Int +HYPRE_AMSSetDiscreteGradient_long_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix G ); +HYPRE_Int +HYPRE_AMSSetDiscreteGradient( HYPRE_Solver solver, HYPRE_ParCSRMatrix G ); + +HYPRE_Int +HYPRE_AMSSetEdgeConstantVectors_flt( HYPRE_Solver solver, HYPRE_ParVector Gx, HYPRE_ParVector Gy, HYPRE_ParVector Gz ); +HYPRE_Int +HYPRE_AMSSetEdgeConstantVectors_dbl( HYPRE_Solver solver, HYPRE_ParVector Gx, HYPRE_ParVector Gy, HYPRE_ParVector Gz ); +HYPRE_Int +HYPRE_AMSSetEdgeConstantVectors_long_dbl( HYPRE_Solver solver, HYPRE_ParVector Gx, HYPRE_ParVector Gy, HYPRE_ParVector Gz ); +HYPRE_Int +HYPRE_AMSSetEdgeConstantVectors( HYPRE_Solver solver, HYPRE_ParVector Gx, HYPRE_ParVector Gy, HYPRE_ParVector Gz ); + +HYPRE_Int +HYPRE_AMSSetInteriorNodes_flt( HYPRE_Solver solver, HYPRE_ParVector interior_nodes ); +HYPRE_Int +HYPRE_AMSSetInteriorNodes_dbl( HYPRE_Solver solver, HYPRE_ParVector interior_nodes ); +HYPRE_Int +HYPRE_AMSSetInteriorNodes_long_dbl( HYPRE_Solver solver, HYPRE_ParVector interior_nodes ); +HYPRE_Int +HYPRE_AMSSetInteriorNodes( HYPRE_Solver solver, HYPRE_ParVector interior_nodes ); + +HYPRE_Int +HYPRE_AMSSetInterpolations_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix Pi, HYPRE_ParCSRMatrix Pix, HYPRE_ParCSRMatrix Piy, HYPRE_ParCSRMatrix Piz ); +HYPRE_Int +HYPRE_AMSSetInterpolations_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix Pi, HYPRE_ParCSRMatrix Pix, HYPRE_ParCSRMatrix Piy, HYPRE_ParCSRMatrix Piz ); +HYPRE_Int +HYPRE_AMSSetInterpolations_long_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix Pi, HYPRE_ParCSRMatrix Pix, HYPRE_ParCSRMatrix Piy, HYPRE_ParCSRMatrix Piz ); +HYPRE_Int +HYPRE_AMSSetInterpolations( HYPRE_Solver solver, HYPRE_ParCSRMatrix Pi, HYPRE_ParCSRMatrix Pix, HYPRE_ParCSRMatrix Piy, HYPRE_ParCSRMatrix Piz ); + +HYPRE_Int +HYPRE_AMSSetMaxIter_flt( HYPRE_Solver solver, HYPRE_Int maxit ); +HYPRE_Int +HYPRE_AMSSetMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int maxit ); +HYPRE_Int +HYPRE_AMSSetMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int maxit ); +HYPRE_Int +HYPRE_AMSSetMaxIter( HYPRE_Solver solver, HYPRE_Int maxit ); + +HYPRE_Int +HYPRE_AMSSetPrintLevel_flt( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_AMSSetPrintLevel_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_AMSSetPrintLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_AMSSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_AMSSetProjectionFrequency_flt( HYPRE_Solver solver, HYPRE_Int projection_frequency ); +HYPRE_Int +HYPRE_AMSSetProjectionFrequency_dbl( HYPRE_Solver solver, HYPRE_Int projection_frequency ); +HYPRE_Int +HYPRE_AMSSetProjectionFrequency_long_dbl( HYPRE_Solver solver, HYPRE_Int projection_frequency ); +HYPRE_Int +HYPRE_AMSSetProjectionFrequency( HYPRE_Solver solver, HYPRE_Int projection_frequency ); + +HYPRE_Int +HYPRE_AMSSetSmoothingOptions_flt( HYPRE_Solver solver, HYPRE_Int relax_type, HYPRE_Int relax_times, hypre_float relax_weight, hypre_float omega ); +HYPRE_Int +HYPRE_AMSSetSmoothingOptions_dbl( HYPRE_Solver solver, HYPRE_Int relax_type, HYPRE_Int relax_times, hypre_double relax_weight, hypre_double omega ); +HYPRE_Int +HYPRE_AMSSetSmoothingOptions_long_dbl( HYPRE_Solver solver, HYPRE_Int relax_type, HYPRE_Int relax_times, hypre_long_double relax_weight, hypre_long_double omega ); +HYPRE_Int +HYPRE_AMSSetSmoothingOptions( HYPRE_Solver solver, HYPRE_Int relax_type, HYPRE_Int relax_times, hypre_long_double relax_weight, hypre_long_double omega ); + +HYPRE_Int +HYPRE_AMSSetTol_flt( HYPRE_Solver solver, hypre_float tol ); +HYPRE_Int +HYPRE_AMSSetTol_dbl( HYPRE_Solver solver, hypre_double tol ); +HYPRE_Int +HYPRE_AMSSetTol_long_dbl( HYPRE_Solver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_AMSSetTol( HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_AMSSetup_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_AMSSetup_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_AMSSetup_long_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_AMSSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_AMSSolve_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_AMSSolve_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_AMSSolve_long_dbl( 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_BlockTridiagCreate_flt( HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_BlockTridiagCreate_dbl( HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_BlockTridiagCreate_long_dbl( HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_BlockTridiagCreate( HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_BlockTridiagDestroy_flt( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_BlockTridiagDestroy_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_BlockTridiagDestroy_long_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_BlockTridiagDestroy( HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_BlockTridiagSetAMGNumSweeps_flt( HYPRE_Solver solver, HYPRE_Int num_sweeps ); +HYPRE_Int +HYPRE_BlockTridiagSetAMGNumSweeps_dbl( HYPRE_Solver solver, HYPRE_Int num_sweeps ); +HYPRE_Int +HYPRE_BlockTridiagSetAMGNumSweeps_long_dbl( HYPRE_Solver solver, HYPRE_Int num_sweeps ); +HYPRE_Int +HYPRE_BlockTridiagSetAMGNumSweeps( HYPRE_Solver solver, HYPRE_Int num_sweeps ); + +HYPRE_Int +HYPRE_BlockTridiagSetAMGRelaxType_flt( HYPRE_Solver solver, HYPRE_Int relax_type ); +HYPRE_Int +HYPRE_BlockTridiagSetAMGRelaxType_dbl( HYPRE_Solver solver, HYPRE_Int relax_type ); +HYPRE_Int +HYPRE_BlockTridiagSetAMGRelaxType_long_dbl( HYPRE_Solver solver, HYPRE_Int relax_type ); +HYPRE_Int +HYPRE_BlockTridiagSetAMGRelaxType( HYPRE_Solver solver, HYPRE_Int relax_type ); + +HYPRE_Int +HYPRE_BlockTridiagSetAMGStrengthThreshold_flt( HYPRE_Solver solver, hypre_float thresh ); +HYPRE_Int +HYPRE_BlockTridiagSetAMGStrengthThreshold_dbl( HYPRE_Solver solver, hypre_double thresh ); +HYPRE_Int +HYPRE_BlockTridiagSetAMGStrengthThreshold_long_dbl( HYPRE_Solver solver, hypre_long_double thresh ); +HYPRE_Int +HYPRE_BlockTridiagSetAMGStrengthThreshold( HYPRE_Solver solver, hypre_long_double thresh ); + +HYPRE_Int +HYPRE_BlockTridiagSetIndexSet_flt( HYPRE_Solver solver, HYPRE_Int n, HYPRE_Int *inds ); +HYPRE_Int +HYPRE_BlockTridiagSetIndexSet_dbl( HYPRE_Solver solver, HYPRE_Int n, HYPRE_Int *inds ); +HYPRE_Int +HYPRE_BlockTridiagSetIndexSet_long_dbl( HYPRE_Solver solver, HYPRE_Int n, HYPRE_Int *inds ); +HYPRE_Int +HYPRE_BlockTridiagSetIndexSet( HYPRE_Solver solver, HYPRE_Int n, HYPRE_Int *inds ); + +HYPRE_Int +HYPRE_BlockTridiagSetPrintLevel_flt( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_BlockTridiagSetPrintLevel_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_BlockTridiagSetPrintLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_BlockTridiagSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_BlockTridiagSetup_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_BlockTridiagSetup_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_BlockTridiagSetup_long_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_BlockTridiagSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_BlockTridiagSolve_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_BlockTridiagSolve_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_BlockTridiagSolve_long_dbl( 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_BoomerAMGCreate_flt( HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_BoomerAMGCreate_dbl( HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_BoomerAMGCreate_long_dbl( HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_BoomerAMGCreate( HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_BoomerAMGDDCreate_flt( HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_BoomerAMGDDCreate_dbl( HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_BoomerAMGDDCreate_long_dbl( HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_BoomerAMGDDCreate( HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_BoomerAMGDDDestroy_flt( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_BoomerAMGDDDestroy_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_BoomerAMGDDDestroy_long_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_BoomerAMGDDDestroy( HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_BoomerAMGDDGetAMG_flt( HYPRE_Solver solver, HYPRE_Solver *amg_solver ); +HYPRE_Int +HYPRE_BoomerAMGDDGetAMG_dbl( HYPRE_Solver solver, HYPRE_Solver *amg_solver ); +HYPRE_Int +HYPRE_BoomerAMGDDGetAMG_long_dbl( HYPRE_Solver solver, HYPRE_Solver *amg_solver ); +HYPRE_Int +HYPRE_BoomerAMGDDGetAMG( HYPRE_Solver solver, HYPRE_Solver *amg_solver ); + +HYPRE_Int +HYPRE_BoomerAMGDDGetFinalRelativeResidualNorm_flt( HYPRE_Solver solver, hypre_float *rel_resid_norm ); +HYPRE_Int +HYPRE_BoomerAMGDDGetFinalRelativeResidualNorm_dbl( HYPRE_Solver solver, hypre_double *rel_resid_norm ); +HYPRE_Int +HYPRE_BoomerAMGDDGetFinalRelativeResidualNorm_long_dbl( HYPRE_Solver solver, hypre_long_double *rel_resid_norm ); +HYPRE_Int +HYPRE_BoomerAMGDDGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *rel_resid_norm ); + +HYPRE_Int +HYPRE_BoomerAMGDDGetNumIterations_flt( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_BoomerAMGDDGetNumIterations_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_BoomerAMGDDGetNumIterations_long_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_BoomerAMGDDGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_BoomerAMGDDSetFACCycleType_flt( HYPRE_Solver solver, HYPRE_Int amgdd_fac_cycle_type ); +HYPRE_Int +HYPRE_BoomerAMGDDSetFACCycleType_dbl( HYPRE_Solver solver, HYPRE_Int amgdd_fac_cycle_type ); +HYPRE_Int +HYPRE_BoomerAMGDDSetFACCycleType_long_dbl( HYPRE_Solver solver, HYPRE_Int amgdd_fac_cycle_type ); +HYPRE_Int +HYPRE_BoomerAMGDDSetFACCycleType( HYPRE_Solver solver, HYPRE_Int amgdd_fac_cycle_type ); + +HYPRE_Int +HYPRE_BoomerAMGDDSetFACNumCycles_flt( HYPRE_Solver solver, HYPRE_Int amgdd_fac_num_cycles ); +HYPRE_Int +HYPRE_BoomerAMGDDSetFACNumCycles_dbl( HYPRE_Solver solver, HYPRE_Int amgdd_fac_num_cycles ); +HYPRE_Int +HYPRE_BoomerAMGDDSetFACNumCycles_long_dbl( HYPRE_Solver solver, HYPRE_Int amgdd_fac_num_cycles ); +HYPRE_Int +HYPRE_BoomerAMGDDSetFACNumCycles( HYPRE_Solver solver, HYPRE_Int amgdd_fac_num_cycles ); + +HYPRE_Int +HYPRE_BoomerAMGDDSetFACNumRelax_flt( HYPRE_Solver solver, HYPRE_Int amgdd_fac_num_relax ); +HYPRE_Int +HYPRE_BoomerAMGDDSetFACNumRelax_dbl( HYPRE_Solver solver, HYPRE_Int amgdd_fac_num_relax ); +HYPRE_Int +HYPRE_BoomerAMGDDSetFACNumRelax_long_dbl( HYPRE_Solver solver, HYPRE_Int amgdd_fac_num_relax ); +HYPRE_Int +HYPRE_BoomerAMGDDSetFACNumRelax( HYPRE_Solver solver, HYPRE_Int amgdd_fac_num_relax ); + +HYPRE_Int +HYPRE_BoomerAMGDDSetFACRelaxType_flt( HYPRE_Solver solver, HYPRE_Int amgdd_fac_relax_type ); +HYPRE_Int +HYPRE_BoomerAMGDDSetFACRelaxType_dbl( HYPRE_Solver solver, HYPRE_Int amgdd_fac_relax_type ); +HYPRE_Int +HYPRE_BoomerAMGDDSetFACRelaxType_long_dbl( HYPRE_Solver solver, HYPRE_Int amgdd_fac_relax_type ); +HYPRE_Int +HYPRE_BoomerAMGDDSetFACRelaxType( HYPRE_Solver solver, HYPRE_Int amgdd_fac_relax_type ); + +HYPRE_Int +HYPRE_BoomerAMGDDSetFACRelaxWeight_flt( HYPRE_Solver solver, hypre_float amgdd_fac_relax_weight ); +HYPRE_Int +HYPRE_BoomerAMGDDSetFACRelaxWeight_dbl( HYPRE_Solver solver, hypre_double amgdd_fac_relax_weight ); +HYPRE_Int +HYPRE_BoomerAMGDDSetFACRelaxWeight_long_dbl( HYPRE_Solver solver, hypre_long_double amgdd_fac_relax_weight ); +HYPRE_Int +HYPRE_BoomerAMGDDSetFACRelaxWeight( HYPRE_Solver solver, hypre_long_double amgdd_fac_relax_weight ); + +HYPRE_Int +HYPRE_BoomerAMGDDSetNumGhostLayers_flt( HYPRE_Solver solver, HYPRE_Int num_ghost_layers ); +HYPRE_Int +HYPRE_BoomerAMGDDSetNumGhostLayers_dbl( HYPRE_Solver solver, HYPRE_Int num_ghost_layers ); +HYPRE_Int +HYPRE_BoomerAMGDDSetNumGhostLayers_long_dbl( HYPRE_Solver solver, HYPRE_Int num_ghost_layers ); +HYPRE_Int +HYPRE_BoomerAMGDDSetNumGhostLayers( HYPRE_Solver solver, HYPRE_Int num_ghost_layers ); + +HYPRE_Int +HYPRE_BoomerAMGDDSetPadding_flt( HYPRE_Solver solver, HYPRE_Int padding ); +HYPRE_Int +HYPRE_BoomerAMGDDSetPadding_dbl( HYPRE_Solver solver, HYPRE_Int padding ); +HYPRE_Int +HYPRE_BoomerAMGDDSetPadding_long_dbl( HYPRE_Solver solver, HYPRE_Int padding ); +HYPRE_Int +HYPRE_BoomerAMGDDSetPadding( HYPRE_Solver solver, HYPRE_Int padding ); + +HYPRE_Int +HYPRE_BoomerAMGDDSetStartLevel_flt( HYPRE_Solver solver, HYPRE_Int start_level ); +HYPRE_Int +HYPRE_BoomerAMGDDSetStartLevel_dbl( HYPRE_Solver solver, HYPRE_Int start_level ); +HYPRE_Int +HYPRE_BoomerAMGDDSetStartLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int start_level ); +HYPRE_Int +HYPRE_BoomerAMGDDSetStartLevel( HYPRE_Solver solver, HYPRE_Int start_level ); + +HYPRE_Int +HYPRE_BoomerAMGDDSetup_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_BoomerAMGDDSetup_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_BoomerAMGDDSetup_long_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_BoomerAMGDDSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_BoomerAMGDDSolve_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_BoomerAMGDDSolve_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_BoomerAMGDDSolve_long_dbl( 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_BoomerAMGDestroy_flt( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_BoomerAMGDestroy_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_BoomerAMGDestroy_long_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_BoomerAMGDestroy( HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_BoomerAMGGetAdditive_flt( HYPRE_Solver solver, HYPRE_Int *additive ); +HYPRE_Int +HYPRE_BoomerAMGGetAdditive_dbl( HYPRE_Solver solver, HYPRE_Int *additive ); +HYPRE_Int +HYPRE_BoomerAMGGetAdditive_long_dbl( HYPRE_Solver solver, HYPRE_Int *additive ); +HYPRE_Int +HYPRE_BoomerAMGGetAdditive( HYPRE_Solver solver, HYPRE_Int *additive ); + +HYPRE_Int +HYPRE_BoomerAMGGetCoarsenCutFactor_flt( HYPRE_Solver solver, HYPRE_Int *coarsen_cut_factor ); +HYPRE_Int +HYPRE_BoomerAMGGetCoarsenCutFactor_dbl( HYPRE_Solver solver, HYPRE_Int *coarsen_cut_factor ); +HYPRE_Int +HYPRE_BoomerAMGGetCoarsenCutFactor_long_dbl( HYPRE_Solver solver, HYPRE_Int *coarsen_cut_factor ); +HYPRE_Int +HYPRE_BoomerAMGGetCoarsenCutFactor( HYPRE_Solver solver, HYPRE_Int *coarsen_cut_factor ); + +HYPRE_Int +HYPRE_BoomerAMGGetCoarsenType_flt( HYPRE_Solver solver, HYPRE_Int *coarsen_type ); +HYPRE_Int +HYPRE_BoomerAMGGetCoarsenType_dbl( HYPRE_Solver solver, HYPRE_Int *coarsen_type ); +HYPRE_Int +HYPRE_BoomerAMGGetCoarsenType_long_dbl( HYPRE_Solver solver, HYPRE_Int *coarsen_type ); +HYPRE_Int +HYPRE_BoomerAMGGetCoarsenType( HYPRE_Solver solver, HYPRE_Int *coarsen_type ); + +HYPRE_Int +HYPRE_BoomerAMGGetConvergeType_flt( HYPRE_Solver solver, HYPRE_Int *type ); +HYPRE_Int +HYPRE_BoomerAMGGetConvergeType_dbl( HYPRE_Solver solver, HYPRE_Int *type ); +HYPRE_Int +HYPRE_BoomerAMGGetConvergeType_long_dbl( HYPRE_Solver solver, HYPRE_Int *type ); +HYPRE_Int +HYPRE_BoomerAMGGetConvergeType( HYPRE_Solver solver, HYPRE_Int *type ); + +HYPRE_Int +HYPRE_BoomerAMGGetCumNnzAP_flt( HYPRE_Solver solver, hypre_float *cum_nnz_AP ); +HYPRE_Int +HYPRE_BoomerAMGGetCumNnzAP_dbl( HYPRE_Solver solver, hypre_double *cum_nnz_AP ); +HYPRE_Int +HYPRE_BoomerAMGGetCumNnzAP_long_dbl( HYPRE_Solver solver, hypre_long_double *cum_nnz_AP ); +HYPRE_Int +HYPRE_BoomerAMGGetCumNnzAP( HYPRE_Solver solver, void *cum_nnz_AP ); + +HYPRE_Int +HYPRE_BoomerAMGGetCumNumIterations_flt( HYPRE_Solver solver, HYPRE_Int *cum_num_iterations ); +HYPRE_Int +HYPRE_BoomerAMGGetCumNumIterations_dbl( HYPRE_Solver solver, HYPRE_Int *cum_num_iterations ); +HYPRE_Int +HYPRE_BoomerAMGGetCumNumIterations_long_dbl( HYPRE_Solver solver, HYPRE_Int *cum_num_iterations ); +HYPRE_Int +HYPRE_BoomerAMGGetCumNumIterations( HYPRE_Solver solver, HYPRE_Int *cum_num_iterations ); + +HYPRE_Int +HYPRE_BoomerAMGGetCycleNumSweeps_flt( HYPRE_Solver solver, HYPRE_Int *num_sweeps, HYPRE_Int k ); +HYPRE_Int +HYPRE_BoomerAMGGetCycleNumSweeps_dbl( HYPRE_Solver solver, HYPRE_Int *num_sweeps, HYPRE_Int k ); +HYPRE_Int +HYPRE_BoomerAMGGetCycleNumSweeps_long_dbl( 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_BoomerAMGGetCycleRelaxType_flt( HYPRE_Solver solver, HYPRE_Int *relax_type, HYPRE_Int k ); +HYPRE_Int +HYPRE_BoomerAMGGetCycleRelaxType_dbl( HYPRE_Solver solver, HYPRE_Int *relax_type, HYPRE_Int k ); +HYPRE_Int +HYPRE_BoomerAMGGetCycleRelaxType_long_dbl( 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_BoomerAMGGetCycleType_flt( HYPRE_Solver solver, HYPRE_Int *cycle_type ); +HYPRE_Int +HYPRE_BoomerAMGGetCycleType_dbl( HYPRE_Solver solver, HYPRE_Int *cycle_type ); +HYPRE_Int +HYPRE_BoomerAMGGetCycleType_long_dbl( HYPRE_Solver solver, HYPRE_Int *cycle_type ); +HYPRE_Int +HYPRE_BoomerAMGGetCycleType( HYPRE_Solver solver, HYPRE_Int *cycle_type ); + +HYPRE_Int +HYPRE_BoomerAMGGetDebugFlag_flt( HYPRE_Solver solver, HYPRE_Int *debug_flag ); +HYPRE_Int +HYPRE_BoomerAMGGetDebugFlag_dbl( HYPRE_Solver solver, HYPRE_Int *debug_flag ); +HYPRE_Int +HYPRE_BoomerAMGGetDebugFlag_long_dbl( HYPRE_Solver solver, HYPRE_Int *debug_flag ); +HYPRE_Int +HYPRE_BoomerAMGGetDebugFlag( HYPRE_Solver solver, HYPRE_Int *debug_flag ); + +HYPRE_Int +HYPRE_BoomerAMGGetDomainType_flt( HYPRE_Solver solver, HYPRE_Int *domain_type ); +HYPRE_Int +HYPRE_BoomerAMGGetDomainType_dbl( HYPRE_Solver solver, HYPRE_Int *domain_type ); +HYPRE_Int +HYPRE_BoomerAMGGetDomainType_long_dbl( HYPRE_Solver solver, HYPRE_Int *domain_type ); +HYPRE_Int +HYPRE_BoomerAMGGetDomainType( HYPRE_Solver solver, HYPRE_Int *domain_type ); + +HYPRE_Int +HYPRE_BoomerAMGGetFCycle_flt( HYPRE_Solver solver, HYPRE_Int *fcycle ); +HYPRE_Int +HYPRE_BoomerAMGGetFCycle_dbl( HYPRE_Solver solver, HYPRE_Int *fcycle ); +HYPRE_Int +HYPRE_BoomerAMGGetFCycle_long_dbl( HYPRE_Solver solver, HYPRE_Int *fcycle ); +HYPRE_Int +HYPRE_BoomerAMGGetFCycle( HYPRE_Solver solver, HYPRE_Int *fcycle ); + +HYPRE_Int +HYPRE_BoomerAMGGetFilterFunctions_flt( HYPRE_Solver solver, HYPRE_Int *filter_functions ); +HYPRE_Int +HYPRE_BoomerAMGGetFilterFunctions_dbl( HYPRE_Solver solver, HYPRE_Int *filter_functions ); +HYPRE_Int +HYPRE_BoomerAMGGetFilterFunctions_long_dbl( HYPRE_Solver solver, HYPRE_Int *filter_functions ); +HYPRE_Int +HYPRE_BoomerAMGGetFilterFunctions( HYPRE_Solver solver, HYPRE_Int *filter_functions ); + +HYPRE_Int +HYPRE_BoomerAMGGetFilterThresholdR_flt( HYPRE_Solver solver, hypre_float *filter_threshold ); +HYPRE_Int +HYPRE_BoomerAMGGetFilterThresholdR_dbl( HYPRE_Solver solver, hypre_double *filter_threshold ); +HYPRE_Int +HYPRE_BoomerAMGGetFilterThresholdR_long_dbl( HYPRE_Solver solver, hypre_long_double *filter_threshold ); +HYPRE_Int +HYPRE_BoomerAMGGetFilterThresholdR( HYPRE_Solver solver, void *filter_threshold ); + +HYPRE_Int +HYPRE_BoomerAMGGetFinalRelativeResidualNorm_flt( HYPRE_Solver solver, hypre_float *rel_resid_norm ); +HYPRE_Int +HYPRE_BoomerAMGGetFinalRelativeResidualNorm_dbl( HYPRE_Solver solver, hypre_double *rel_resid_norm ); +HYPRE_Int +HYPRE_BoomerAMGGetFinalRelativeResidualNorm_long_dbl( HYPRE_Solver solver, hypre_long_double *rel_resid_norm ); +HYPRE_Int +HYPRE_BoomerAMGGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *rel_resid_norm ); + +HYPRE_Int +HYPRE_BoomerAMGGetGridHierarchy_flt( HYPRE_Solver solver, HYPRE_Int *cgrid ); +HYPRE_Int +HYPRE_BoomerAMGGetGridHierarchy_dbl( HYPRE_Solver solver, HYPRE_Int *cgrid ); +HYPRE_Int +HYPRE_BoomerAMGGetGridHierarchy_long_dbl( HYPRE_Solver solver, HYPRE_Int *cgrid ); +HYPRE_Int +HYPRE_BoomerAMGGetGridHierarchy( HYPRE_Solver solver, HYPRE_Int *cgrid ); + +HYPRE_Int +HYPRE_BoomerAMGGetJacobiTruncThreshold_flt( HYPRE_Solver solver, hypre_float *jacobi_trunc_threshold ); +HYPRE_Int +HYPRE_BoomerAMGGetJacobiTruncThreshold_dbl( HYPRE_Solver solver, hypre_double *jacobi_trunc_threshold ); +HYPRE_Int +HYPRE_BoomerAMGGetJacobiTruncThreshold_long_dbl( HYPRE_Solver solver, hypre_long_double *jacobi_trunc_threshold ); +HYPRE_Int +HYPRE_BoomerAMGGetJacobiTruncThreshold( HYPRE_Solver solver, void *jacobi_trunc_threshold ); + +HYPRE_Int +HYPRE_BoomerAMGGetLogging_flt( HYPRE_Solver solver, HYPRE_Int *logging ); +HYPRE_Int +HYPRE_BoomerAMGGetLogging_dbl( HYPRE_Solver solver, HYPRE_Int *logging ); +HYPRE_Int +HYPRE_BoomerAMGGetLogging_long_dbl( HYPRE_Solver solver, HYPRE_Int *logging ); +HYPRE_Int +HYPRE_BoomerAMGGetLogging( HYPRE_Solver solver, HYPRE_Int *logging ); + +HYPRE_Int +HYPRE_BoomerAMGGetMaxCoarseSize_flt( HYPRE_Solver solver, HYPRE_Int *max_coarse_size ); +HYPRE_Int +HYPRE_BoomerAMGGetMaxCoarseSize_dbl( HYPRE_Solver solver, HYPRE_Int *max_coarse_size ); +HYPRE_Int +HYPRE_BoomerAMGGetMaxCoarseSize_long_dbl( HYPRE_Solver solver, HYPRE_Int *max_coarse_size ); +HYPRE_Int +HYPRE_BoomerAMGGetMaxCoarseSize( HYPRE_Solver solver, HYPRE_Int *max_coarse_size ); + +HYPRE_Int +HYPRE_BoomerAMGGetMaxIter_flt( HYPRE_Solver solver, HYPRE_Int *max_iter ); +HYPRE_Int +HYPRE_BoomerAMGGetMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int *max_iter ); +HYPRE_Int +HYPRE_BoomerAMGGetMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int *max_iter ); +HYPRE_Int +HYPRE_BoomerAMGGetMaxIter( HYPRE_Solver solver, HYPRE_Int *max_iter ); + +HYPRE_Int +HYPRE_BoomerAMGGetMaxLevels_flt( HYPRE_Solver solver, HYPRE_Int *max_levels ); +HYPRE_Int +HYPRE_BoomerAMGGetMaxLevels_dbl( HYPRE_Solver solver, HYPRE_Int *max_levels ); +HYPRE_Int +HYPRE_BoomerAMGGetMaxLevels_long_dbl( HYPRE_Solver solver, HYPRE_Int *max_levels ); +HYPRE_Int +HYPRE_BoomerAMGGetMaxLevels( HYPRE_Solver solver, HYPRE_Int *max_levels ); + +HYPRE_Int +HYPRE_BoomerAMGGetMaxRowSum_flt( HYPRE_Solver solver, hypre_float *max_row_sum ); +HYPRE_Int +HYPRE_BoomerAMGGetMaxRowSum_dbl( HYPRE_Solver solver, hypre_double *max_row_sum ); +HYPRE_Int +HYPRE_BoomerAMGGetMaxRowSum_long_dbl( HYPRE_Solver solver, hypre_long_double *max_row_sum ); +HYPRE_Int +HYPRE_BoomerAMGGetMaxRowSum( HYPRE_Solver solver, void *max_row_sum ); + +HYPRE_Int +HYPRE_BoomerAMGGetMeasureType_flt( HYPRE_Solver solver, HYPRE_Int *measure_type ); +HYPRE_Int +HYPRE_BoomerAMGGetMeasureType_dbl( HYPRE_Solver solver, HYPRE_Int *measure_type ); +HYPRE_Int +HYPRE_BoomerAMGGetMeasureType_long_dbl( HYPRE_Solver solver, HYPRE_Int *measure_type ); +HYPRE_Int +HYPRE_BoomerAMGGetMeasureType( HYPRE_Solver solver, HYPRE_Int *measure_type ); + +HYPRE_Int +HYPRE_BoomerAMGGetMinCoarseSize_flt( HYPRE_Solver solver, HYPRE_Int *min_coarse_size ); +HYPRE_Int +HYPRE_BoomerAMGGetMinCoarseSize_dbl( HYPRE_Solver solver, HYPRE_Int *min_coarse_size ); +HYPRE_Int +HYPRE_BoomerAMGGetMinCoarseSize_long_dbl( HYPRE_Solver solver, HYPRE_Int *min_coarse_size ); +HYPRE_Int +HYPRE_BoomerAMGGetMinCoarseSize( HYPRE_Solver solver, HYPRE_Int *min_coarse_size ); + +HYPRE_Int +HYPRE_BoomerAMGGetMultAdditive_flt( HYPRE_Solver solver, HYPRE_Int *mult_additive ); +HYPRE_Int +HYPRE_BoomerAMGGetMultAdditive_dbl( HYPRE_Solver solver, HYPRE_Int *mult_additive ); +HYPRE_Int +HYPRE_BoomerAMGGetMultAdditive_long_dbl( HYPRE_Solver solver, HYPRE_Int *mult_additive ); +HYPRE_Int +HYPRE_BoomerAMGGetMultAdditive( HYPRE_Solver solver, HYPRE_Int *mult_additive ); + +HYPRE_Int +HYPRE_BoomerAMGGetNumFunctions_flt( HYPRE_Solver solver, HYPRE_Int *num_functions ); +HYPRE_Int +HYPRE_BoomerAMGGetNumFunctions_dbl( HYPRE_Solver solver, HYPRE_Int *num_functions ); +HYPRE_Int +HYPRE_BoomerAMGGetNumFunctions_long_dbl( HYPRE_Solver solver, HYPRE_Int *num_functions ); +HYPRE_Int +HYPRE_BoomerAMGGetNumFunctions( HYPRE_Solver solver, HYPRE_Int *num_functions ); + +HYPRE_Int +HYPRE_BoomerAMGGetNumIterations_flt( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_BoomerAMGGetNumIterations_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_BoomerAMGGetNumIterations_long_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_BoomerAMGGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_BoomerAMGGetOverlap_flt( HYPRE_Solver solver, HYPRE_Int *overlap ); +HYPRE_Int +HYPRE_BoomerAMGGetOverlap_dbl( HYPRE_Solver solver, HYPRE_Int *overlap ); +HYPRE_Int +HYPRE_BoomerAMGGetOverlap_long_dbl( HYPRE_Solver solver, HYPRE_Int *overlap ); +HYPRE_Int +HYPRE_BoomerAMGGetOverlap( HYPRE_Solver solver, HYPRE_Int *overlap ); + +HYPRE_Int +HYPRE_BoomerAMGGetPMaxElmts_flt( HYPRE_Solver solver, HYPRE_Int *P_max_elmts ); +HYPRE_Int +HYPRE_BoomerAMGGetPMaxElmts_dbl( HYPRE_Solver solver, HYPRE_Int *P_max_elmts ); +HYPRE_Int +HYPRE_BoomerAMGGetPMaxElmts_long_dbl( HYPRE_Solver solver, HYPRE_Int *P_max_elmts ); +HYPRE_Int +HYPRE_BoomerAMGGetPMaxElmts( HYPRE_Solver solver, HYPRE_Int *P_max_elmts ); + +HYPRE_Int +HYPRE_BoomerAMGGetPostInterpType_flt( HYPRE_Solver solver, HYPRE_Int *post_interp_type ); +HYPRE_Int +HYPRE_BoomerAMGGetPostInterpType_dbl( HYPRE_Solver solver, HYPRE_Int *post_interp_type ); +HYPRE_Int +HYPRE_BoomerAMGGetPostInterpType_long_dbl( HYPRE_Solver solver, HYPRE_Int *post_interp_type ); +HYPRE_Int +HYPRE_BoomerAMGGetPostInterpType( HYPRE_Solver solver, HYPRE_Int *post_interp_type ); + +HYPRE_Int +HYPRE_BoomerAMGGetPrintLevel_flt( HYPRE_Solver solver, HYPRE_Int *print_level ); +HYPRE_Int +HYPRE_BoomerAMGGetPrintLevel_dbl( HYPRE_Solver solver, HYPRE_Int *print_level ); +HYPRE_Int +HYPRE_BoomerAMGGetPrintLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int *print_level ); +HYPRE_Int +HYPRE_BoomerAMGGetPrintLevel( HYPRE_Solver solver, HYPRE_Int *print_level ); + +HYPRE_Int +HYPRE_BoomerAMGGetRedundant_flt( HYPRE_Solver solver, HYPRE_Int *redundant ); +HYPRE_Int +HYPRE_BoomerAMGGetRedundant_dbl( HYPRE_Solver solver, HYPRE_Int *redundant ); +HYPRE_Int +HYPRE_BoomerAMGGetRedundant_long_dbl( HYPRE_Solver solver, HYPRE_Int *redundant ); +HYPRE_Int +HYPRE_BoomerAMGGetRedundant( HYPRE_Solver solver, HYPRE_Int *redundant ); + +HYPRE_Int +HYPRE_BoomerAMGGetResidual_flt( HYPRE_Solver solver, HYPRE_ParVector *residual ); +HYPRE_Int +HYPRE_BoomerAMGGetResidual_dbl( HYPRE_Solver solver, HYPRE_ParVector *residual ); +HYPRE_Int +HYPRE_BoomerAMGGetResidual_long_dbl( HYPRE_Solver solver, HYPRE_ParVector *residual ); +HYPRE_Int +HYPRE_BoomerAMGGetResidual( HYPRE_Solver solver, HYPRE_ParVector *residual ); + +HYPRE_Int +HYPRE_BoomerAMGGetSchwarzRlxWeight_flt( HYPRE_Solver solver, hypre_float *schwarz_rlx_weight ); +HYPRE_Int +HYPRE_BoomerAMGGetSchwarzRlxWeight_dbl( HYPRE_Solver solver, hypre_double *schwarz_rlx_weight ); +HYPRE_Int +HYPRE_BoomerAMGGetSchwarzRlxWeight_long_dbl( HYPRE_Solver solver, hypre_long_double *schwarz_rlx_weight ); +HYPRE_Int +HYPRE_BoomerAMGGetSchwarzRlxWeight( HYPRE_Solver solver, void *schwarz_rlx_weight ); + +HYPRE_Int +HYPRE_BoomerAMGGetSeqThreshold_flt( HYPRE_Solver solver, HYPRE_Int *seq_threshold ); +HYPRE_Int +HYPRE_BoomerAMGGetSeqThreshold_dbl( HYPRE_Solver solver, HYPRE_Int *seq_threshold ); +HYPRE_Int +HYPRE_BoomerAMGGetSeqThreshold_long_dbl( HYPRE_Solver solver, HYPRE_Int *seq_threshold ); +HYPRE_Int +HYPRE_BoomerAMGGetSeqThreshold( HYPRE_Solver solver, HYPRE_Int *seq_threshold ); + +HYPRE_Int +HYPRE_BoomerAMGGetSimple_flt( HYPRE_Solver solver, HYPRE_Int *simple ); +HYPRE_Int +HYPRE_BoomerAMGGetSimple_dbl( HYPRE_Solver solver, HYPRE_Int *simple ); +HYPRE_Int +HYPRE_BoomerAMGGetSimple_long_dbl( HYPRE_Solver solver, HYPRE_Int *simple ); +HYPRE_Int +HYPRE_BoomerAMGGetSimple( HYPRE_Solver solver, HYPRE_Int *simple ); + +HYPRE_Int +HYPRE_BoomerAMGGetSmoothNumLevels_flt( HYPRE_Solver solver, HYPRE_Int *smooth_num_levels ); +HYPRE_Int +HYPRE_BoomerAMGGetSmoothNumLevels_dbl( HYPRE_Solver solver, HYPRE_Int *smooth_num_levels ); +HYPRE_Int +HYPRE_BoomerAMGGetSmoothNumLevels_long_dbl( HYPRE_Solver solver, HYPRE_Int *smooth_num_levels ); +HYPRE_Int +HYPRE_BoomerAMGGetSmoothNumLevels( HYPRE_Solver solver, HYPRE_Int *smooth_num_levels ); + +HYPRE_Int +HYPRE_BoomerAMGGetSmoothNumSweeps_flt( HYPRE_Solver solver, HYPRE_Int *smooth_num_sweeps ); +HYPRE_Int +HYPRE_BoomerAMGGetSmoothNumSweeps_dbl( HYPRE_Solver solver, HYPRE_Int *smooth_num_sweeps ); +HYPRE_Int +HYPRE_BoomerAMGGetSmoothNumSweeps_long_dbl( HYPRE_Solver solver, HYPRE_Int *smooth_num_sweeps ); +HYPRE_Int +HYPRE_BoomerAMGGetSmoothNumSweeps( HYPRE_Solver solver, HYPRE_Int *smooth_num_sweeps ); + +HYPRE_Int +HYPRE_BoomerAMGGetSmoothType_flt( HYPRE_Solver solver, HYPRE_Int *smooth_type ); +HYPRE_Int +HYPRE_BoomerAMGGetSmoothType_dbl( HYPRE_Solver solver, HYPRE_Int *smooth_type ); +HYPRE_Int +HYPRE_BoomerAMGGetSmoothType_long_dbl( HYPRE_Solver solver, HYPRE_Int *smooth_type ); +HYPRE_Int +HYPRE_BoomerAMGGetSmoothType( HYPRE_Solver solver, HYPRE_Int *smooth_type ); + +HYPRE_Int +HYPRE_BoomerAMGGetStrongThreshold_flt( HYPRE_Solver solver, hypre_float *strong_threshold ); +HYPRE_Int +HYPRE_BoomerAMGGetStrongThreshold_dbl( HYPRE_Solver solver, hypre_double *strong_threshold ); +HYPRE_Int +HYPRE_BoomerAMGGetStrongThreshold_long_dbl( HYPRE_Solver solver, hypre_long_double *strong_threshold ); +HYPRE_Int +HYPRE_BoomerAMGGetStrongThreshold( HYPRE_Solver solver, void *strong_threshold ); + +HYPRE_Int +HYPRE_BoomerAMGGetStrongThresholdR_flt( HYPRE_Solver solver, hypre_float *strong_threshold ); +HYPRE_Int +HYPRE_BoomerAMGGetStrongThresholdR_dbl( HYPRE_Solver solver, hypre_double *strong_threshold ); +HYPRE_Int +HYPRE_BoomerAMGGetStrongThresholdR_long_dbl( HYPRE_Solver solver, hypre_long_double *strong_threshold ); +HYPRE_Int +HYPRE_BoomerAMGGetStrongThresholdR( HYPRE_Solver solver, void *strong_threshold ); + +HYPRE_Int +HYPRE_BoomerAMGGetTol_flt( HYPRE_Solver solver, hypre_float *tol ); +HYPRE_Int +HYPRE_BoomerAMGGetTol_dbl( HYPRE_Solver solver, hypre_double *tol ); +HYPRE_Int +HYPRE_BoomerAMGGetTol_long_dbl( HYPRE_Solver solver, hypre_long_double *tol ); +HYPRE_Int +HYPRE_BoomerAMGGetTol( HYPRE_Solver solver, void *tol ); + +HYPRE_Int +HYPRE_BoomerAMGGetTruncFactor_flt( HYPRE_Solver solver, hypre_float *trunc_factor ); +HYPRE_Int +HYPRE_BoomerAMGGetTruncFactor_dbl( HYPRE_Solver solver, hypre_double *trunc_factor ); +HYPRE_Int +HYPRE_BoomerAMGGetTruncFactor_long_dbl( HYPRE_Solver solver, hypre_long_double *trunc_factor ); +HYPRE_Int +HYPRE_BoomerAMGGetTruncFactor( HYPRE_Solver solver, void *trunc_factor ); + +HYPRE_Int +HYPRE_BoomerAMGGetVariant_flt( HYPRE_Solver solver, HYPRE_Int *variant ); +HYPRE_Int +HYPRE_BoomerAMGGetVariant_dbl( HYPRE_Solver solver, HYPRE_Int *variant ); +HYPRE_Int +HYPRE_BoomerAMGGetVariant_long_dbl( HYPRE_Solver solver, HYPRE_Int *variant ); +HYPRE_Int +HYPRE_BoomerAMGGetVariant( HYPRE_Solver solver, HYPRE_Int *variant ); + +HYPRE_Int +HYPRE_BoomerAMGInitGridRelaxation_flt( HYPRE_Int **num_grid_sweeps_ptr, HYPRE_Int **grid_relax_type_ptr, HYPRE_Int ***grid_relax_points_ptr, HYPRE_Int coarsen_type, hypre_float **relax_weights_ptr, HYPRE_Int max_levels ); +HYPRE_Int +HYPRE_BoomerAMGInitGridRelaxation_dbl( HYPRE_Int **num_grid_sweeps_ptr, HYPRE_Int **grid_relax_type_ptr, HYPRE_Int ***grid_relax_points_ptr, HYPRE_Int coarsen_type, hypre_double **relax_weights_ptr, HYPRE_Int max_levels ); +HYPRE_Int +HYPRE_BoomerAMGInitGridRelaxation_long_dbl( HYPRE_Int **num_grid_sweeps_ptr, HYPRE_Int **grid_relax_type_ptr, HYPRE_Int ***grid_relax_points_ptr, HYPRE_Int coarsen_type, hypre_long_double **relax_weights_ptr, HYPRE_Int max_levels ); +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, void *relax_weights_ptr, HYPRE_Int max_levels ); + +HYPRE_Int +HYPRE_BoomerAMGSetADropTol_flt( HYPRE_Solver solver, hypre_float A_drop_tol ); +HYPRE_Int +HYPRE_BoomerAMGSetADropTol_dbl( HYPRE_Solver solver, hypre_double A_drop_tol ); +HYPRE_Int +HYPRE_BoomerAMGSetADropTol_long_dbl( HYPRE_Solver solver, hypre_long_double A_drop_tol ); +HYPRE_Int +HYPRE_BoomerAMGSetADropTol( HYPRE_Solver solver, hypre_long_double A_drop_tol ); + +HYPRE_Int +HYPRE_BoomerAMGSetADropType_flt( HYPRE_Solver solver, HYPRE_Int A_drop_type ); +HYPRE_Int +HYPRE_BoomerAMGSetADropType_dbl( HYPRE_Solver solver, HYPRE_Int A_drop_type ); +HYPRE_Int +HYPRE_BoomerAMGSetADropType_long_dbl( HYPRE_Solver solver, HYPRE_Int A_drop_type ); +HYPRE_Int +HYPRE_BoomerAMGSetADropType( HYPRE_Solver solver, HYPRE_Int A_drop_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetAddLastLvl_flt( HYPRE_Solver solver, HYPRE_Int add_last_lvl ); +HYPRE_Int +HYPRE_BoomerAMGSetAddLastLvl_dbl( HYPRE_Solver solver, HYPRE_Int add_last_lvl ); +HYPRE_Int +HYPRE_BoomerAMGSetAddLastLvl_long_dbl( HYPRE_Solver solver, HYPRE_Int add_last_lvl ); +HYPRE_Int +HYPRE_BoomerAMGSetAddLastLvl( HYPRE_Solver solver, HYPRE_Int add_last_lvl ); + +HYPRE_Int +HYPRE_BoomerAMGSetAddPMaxElmts_flt( HYPRE_Solver solver, HYPRE_Int add_P_max_elmts ); +HYPRE_Int +HYPRE_BoomerAMGSetAddPMaxElmts_dbl( HYPRE_Solver solver, HYPRE_Int add_P_max_elmts ); +HYPRE_Int +HYPRE_BoomerAMGSetAddPMaxElmts_long_dbl( HYPRE_Solver solver, HYPRE_Int add_P_max_elmts ); +HYPRE_Int +HYPRE_BoomerAMGSetAddPMaxElmts( HYPRE_Solver solver, HYPRE_Int add_P_max_elmts ); + +HYPRE_Int +HYPRE_BoomerAMGSetAddRelaxType_flt( HYPRE_Solver solver, HYPRE_Int add_rlx_type ); +HYPRE_Int +HYPRE_BoomerAMGSetAddRelaxType_dbl( HYPRE_Solver solver, HYPRE_Int add_rlx_type ); +HYPRE_Int +HYPRE_BoomerAMGSetAddRelaxType_long_dbl( HYPRE_Solver solver, HYPRE_Int add_rlx_type ); +HYPRE_Int +HYPRE_BoomerAMGSetAddRelaxType( HYPRE_Solver solver, HYPRE_Int add_rlx_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetAddRelaxWt_flt( HYPRE_Solver solver, hypre_float add_rlx_wt ); +HYPRE_Int +HYPRE_BoomerAMGSetAddRelaxWt_dbl( HYPRE_Solver solver, hypre_double add_rlx_wt ); +HYPRE_Int +HYPRE_BoomerAMGSetAddRelaxWt_long_dbl( HYPRE_Solver solver, hypre_long_double add_rlx_wt ); +HYPRE_Int +HYPRE_BoomerAMGSetAddRelaxWt( HYPRE_Solver solver, hypre_long_double add_rlx_wt ); + +HYPRE_Int +HYPRE_BoomerAMGSetAddTruncFactor_flt( HYPRE_Solver solver, hypre_float add_trunc_factor ); +HYPRE_Int +HYPRE_BoomerAMGSetAddTruncFactor_dbl( HYPRE_Solver solver, hypre_double add_trunc_factor ); +HYPRE_Int +HYPRE_BoomerAMGSetAddTruncFactor_long_dbl( HYPRE_Solver solver, hypre_long_double add_trunc_factor ); +HYPRE_Int +HYPRE_BoomerAMGSetAddTruncFactor( HYPRE_Solver solver, hypre_long_double add_trunc_factor ); + +HYPRE_Int +HYPRE_BoomerAMGSetAdditive_flt( HYPRE_Solver solver, HYPRE_Int addlvl ); +HYPRE_Int +HYPRE_BoomerAMGSetAdditive_dbl( HYPRE_Solver solver, HYPRE_Int addlvl ); +HYPRE_Int +HYPRE_BoomerAMGSetAdditive_long_dbl( HYPRE_Solver solver, HYPRE_Int addlvl ); +HYPRE_Int +HYPRE_BoomerAMGSetAdditive( HYPRE_Solver solver, HYPRE_Int addlvl ); + +HYPRE_Int +HYPRE_BoomerAMGSetAggInterpType_flt( HYPRE_Solver solver, HYPRE_Int agg_interp_type ); +HYPRE_Int +HYPRE_BoomerAMGSetAggInterpType_dbl( HYPRE_Solver solver, HYPRE_Int agg_interp_type ); +HYPRE_Int +HYPRE_BoomerAMGSetAggInterpType_long_dbl( HYPRE_Solver solver, HYPRE_Int agg_interp_type ); +HYPRE_Int +HYPRE_BoomerAMGSetAggInterpType( HYPRE_Solver solver, HYPRE_Int agg_interp_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetAggNumLevels_flt( HYPRE_Solver solver, HYPRE_Int agg_num_levels ); +HYPRE_Int +HYPRE_BoomerAMGSetAggNumLevels_dbl( HYPRE_Solver solver, HYPRE_Int agg_num_levels ); +HYPRE_Int +HYPRE_BoomerAMGSetAggNumLevels_long_dbl( HYPRE_Solver solver, HYPRE_Int agg_num_levels ); +HYPRE_Int +HYPRE_BoomerAMGSetAggNumLevels( HYPRE_Solver solver, HYPRE_Int agg_num_levels ); + +HYPRE_Int +HYPRE_BoomerAMGSetAggP12MaxElmts_flt( HYPRE_Solver solver, HYPRE_Int agg_P12_max_elmts ); +HYPRE_Int +HYPRE_BoomerAMGSetAggP12MaxElmts_dbl( HYPRE_Solver solver, HYPRE_Int agg_P12_max_elmts ); +HYPRE_Int +HYPRE_BoomerAMGSetAggP12MaxElmts_long_dbl( HYPRE_Solver solver, HYPRE_Int agg_P12_max_elmts ); +HYPRE_Int +HYPRE_BoomerAMGSetAggP12MaxElmts( HYPRE_Solver solver, HYPRE_Int agg_P12_max_elmts ); + +HYPRE_Int +HYPRE_BoomerAMGSetAggP12TruncFactor_flt( HYPRE_Solver solver, hypre_float agg_P12_trunc_factor ); +HYPRE_Int +HYPRE_BoomerAMGSetAggP12TruncFactor_dbl( HYPRE_Solver solver, hypre_double agg_P12_trunc_factor ); +HYPRE_Int +HYPRE_BoomerAMGSetAggP12TruncFactor_long_dbl( HYPRE_Solver solver, hypre_long_double agg_P12_trunc_factor ); +HYPRE_Int +HYPRE_BoomerAMGSetAggP12TruncFactor( HYPRE_Solver solver, hypre_long_double agg_P12_trunc_factor ); + +HYPRE_Int +HYPRE_BoomerAMGSetAggPMaxElmts_flt( HYPRE_Solver solver, HYPRE_Int agg_P_max_elmts ); +HYPRE_Int +HYPRE_BoomerAMGSetAggPMaxElmts_dbl( HYPRE_Solver solver, HYPRE_Int agg_P_max_elmts ); +HYPRE_Int +HYPRE_BoomerAMGSetAggPMaxElmts_long_dbl( HYPRE_Solver solver, HYPRE_Int agg_P_max_elmts ); +HYPRE_Int +HYPRE_BoomerAMGSetAggPMaxElmts( HYPRE_Solver solver, HYPRE_Int agg_P_max_elmts ); + +HYPRE_Int +HYPRE_BoomerAMGSetAggTruncFactor_flt( HYPRE_Solver solver, hypre_float agg_trunc_factor ); +HYPRE_Int +HYPRE_BoomerAMGSetAggTruncFactor_dbl( HYPRE_Solver solver, hypre_double agg_trunc_factor ); +HYPRE_Int +HYPRE_BoomerAMGSetAggTruncFactor_long_dbl( HYPRE_Solver solver, hypre_long_double agg_trunc_factor ); +HYPRE_Int +HYPRE_BoomerAMGSetAggTruncFactor( HYPRE_Solver solver, hypre_long_double agg_trunc_factor ); + +HYPRE_Int +HYPRE_BoomerAMGSetCGCIts_flt( HYPRE_Solver solver, HYPRE_Int its ); +HYPRE_Int +HYPRE_BoomerAMGSetCGCIts_dbl( HYPRE_Solver solver, HYPRE_Int its ); +HYPRE_Int +HYPRE_BoomerAMGSetCGCIts_long_dbl( HYPRE_Solver solver, HYPRE_Int its ); +HYPRE_Int +HYPRE_BoomerAMGSetCGCIts( HYPRE_Solver solver, HYPRE_Int its ); + +HYPRE_Int +HYPRE_BoomerAMGSetCPoints_flt( HYPRE_Solver solver, HYPRE_Int cpt_coarse_level, HYPRE_Int num_cpt_coarse, HYPRE_BigInt *cpt_coarse_index ); +HYPRE_Int +HYPRE_BoomerAMGSetCPoints_dbl( HYPRE_Solver solver, HYPRE_Int cpt_coarse_level, HYPRE_Int num_cpt_coarse, HYPRE_BigInt *cpt_coarse_index ); +HYPRE_Int +HYPRE_BoomerAMGSetCPoints_long_dbl( 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_BoomerAMGSetCRRate_flt( HYPRE_Solver solver, hypre_float CR_rate ); +HYPRE_Int +HYPRE_BoomerAMGSetCRRate_dbl( HYPRE_Solver solver, hypre_double CR_rate ); +HYPRE_Int +HYPRE_BoomerAMGSetCRRate_long_dbl( HYPRE_Solver solver, hypre_long_double CR_rate ); +HYPRE_Int +HYPRE_BoomerAMGSetCRRate( HYPRE_Solver solver, hypre_long_double CR_rate ); + +HYPRE_Int +HYPRE_BoomerAMGSetCRStrongTh_flt( HYPRE_Solver solver, hypre_float CR_strong_th ); +HYPRE_Int +HYPRE_BoomerAMGSetCRStrongTh_dbl( HYPRE_Solver solver, hypre_double CR_strong_th ); +HYPRE_Int +HYPRE_BoomerAMGSetCRStrongTh_long_dbl( HYPRE_Solver solver, hypre_long_double CR_strong_th ); +HYPRE_Int +HYPRE_BoomerAMGSetCRStrongTh( HYPRE_Solver solver, hypre_long_double CR_strong_th ); + +HYPRE_Int +HYPRE_BoomerAMGSetCRUseCG_flt( HYPRE_Solver solver, HYPRE_Int CR_use_CG ); +HYPRE_Int +HYPRE_BoomerAMGSetCRUseCG_dbl( HYPRE_Solver solver, HYPRE_Int CR_use_CG ); +HYPRE_Int +HYPRE_BoomerAMGSetCRUseCG_long_dbl( HYPRE_Solver solver, HYPRE_Int CR_use_CG ); +HYPRE_Int +HYPRE_BoomerAMGSetCRUseCG( HYPRE_Solver solver, HYPRE_Int CR_use_CG ); + +HYPRE_Int +HYPRE_BoomerAMGSetChebyEigEst_flt( HYPRE_Solver solver, HYPRE_Int eig_est ); +HYPRE_Int +HYPRE_BoomerAMGSetChebyEigEst_dbl( HYPRE_Solver solver, HYPRE_Int eig_est ); +HYPRE_Int +HYPRE_BoomerAMGSetChebyEigEst_long_dbl( HYPRE_Solver solver, HYPRE_Int eig_est ); +HYPRE_Int +HYPRE_BoomerAMGSetChebyEigEst( HYPRE_Solver solver, HYPRE_Int eig_est ); + +HYPRE_Int +HYPRE_BoomerAMGSetChebyFraction_flt( HYPRE_Solver solver, hypre_float ratio ); +HYPRE_Int +HYPRE_BoomerAMGSetChebyFraction_dbl( HYPRE_Solver solver, hypre_double ratio ); +HYPRE_Int +HYPRE_BoomerAMGSetChebyFraction_long_dbl( HYPRE_Solver solver, hypre_long_double ratio ); +HYPRE_Int +HYPRE_BoomerAMGSetChebyFraction( HYPRE_Solver solver, hypre_long_double ratio ); + +HYPRE_Int +HYPRE_BoomerAMGSetChebyOrder_flt( HYPRE_Solver solver, HYPRE_Int order ); +HYPRE_Int +HYPRE_BoomerAMGSetChebyOrder_dbl( HYPRE_Solver solver, HYPRE_Int order ); +HYPRE_Int +HYPRE_BoomerAMGSetChebyOrder_long_dbl( HYPRE_Solver solver, HYPRE_Int order ); +HYPRE_Int +HYPRE_BoomerAMGSetChebyOrder( HYPRE_Solver solver, HYPRE_Int order ); + +HYPRE_Int +HYPRE_BoomerAMGSetChebyScale_flt( HYPRE_Solver solver, HYPRE_Int scale ); +HYPRE_Int +HYPRE_BoomerAMGSetChebyScale_dbl( HYPRE_Solver solver, HYPRE_Int scale ); +HYPRE_Int +HYPRE_BoomerAMGSetChebyScale_long_dbl( HYPRE_Solver solver, HYPRE_Int scale ); +HYPRE_Int +HYPRE_BoomerAMGSetChebyScale( HYPRE_Solver solver, HYPRE_Int scale ); + +HYPRE_Int +HYPRE_BoomerAMGSetChebyVariant_flt( HYPRE_Solver solver, HYPRE_Int variant ); +HYPRE_Int +HYPRE_BoomerAMGSetChebyVariant_dbl( HYPRE_Solver solver, HYPRE_Int variant ); +HYPRE_Int +HYPRE_BoomerAMGSetChebyVariant_long_dbl( HYPRE_Solver solver, HYPRE_Int variant ); +HYPRE_Int +HYPRE_BoomerAMGSetChebyVariant( HYPRE_Solver solver, HYPRE_Int variant ); + +HYPRE_Int +HYPRE_BoomerAMGSetCoarsenCutFactor_flt( HYPRE_Solver solver, HYPRE_Int coarsen_cut_factor ); +HYPRE_Int +HYPRE_BoomerAMGSetCoarsenCutFactor_dbl( HYPRE_Solver solver, HYPRE_Int coarsen_cut_factor ); +HYPRE_Int +HYPRE_BoomerAMGSetCoarsenCutFactor_long_dbl( HYPRE_Solver solver, HYPRE_Int coarsen_cut_factor ); +HYPRE_Int +HYPRE_BoomerAMGSetCoarsenCutFactor( HYPRE_Solver solver, HYPRE_Int coarsen_cut_factor ); + +HYPRE_Int +HYPRE_BoomerAMGSetCoarsenType_flt( HYPRE_Solver solver, HYPRE_Int coarsen_type ); +HYPRE_Int +HYPRE_BoomerAMGSetCoarsenType_dbl( HYPRE_Solver solver, HYPRE_Int coarsen_type ); +HYPRE_Int +HYPRE_BoomerAMGSetCoarsenType_long_dbl( HYPRE_Solver solver, HYPRE_Int coarsen_type ); +HYPRE_Int +HYPRE_BoomerAMGSetCoarsenType( HYPRE_Solver solver, HYPRE_Int coarsen_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetConvergeType_flt( HYPRE_Solver solver, HYPRE_Int type ); +HYPRE_Int +HYPRE_BoomerAMGSetConvergeType_dbl( HYPRE_Solver solver, HYPRE_Int type ); +HYPRE_Int +HYPRE_BoomerAMGSetConvergeType_long_dbl( HYPRE_Solver solver, HYPRE_Int type ); +HYPRE_Int +HYPRE_BoomerAMGSetConvergeType( HYPRE_Solver solver, HYPRE_Int type ); + +HYPRE_Int +HYPRE_BoomerAMGSetCoordDim_flt( HYPRE_Solver solver, HYPRE_Int coorddim ); +HYPRE_Int +HYPRE_BoomerAMGSetCoordDim_dbl( HYPRE_Solver solver, HYPRE_Int coorddim ); +HYPRE_Int +HYPRE_BoomerAMGSetCoordDim_long_dbl( HYPRE_Solver solver, HYPRE_Int coorddim ); +HYPRE_Int +HYPRE_BoomerAMGSetCoordDim( HYPRE_Solver solver, HYPRE_Int coorddim ); + +HYPRE_Int +HYPRE_BoomerAMGSetCoordinates_flt( HYPRE_Solver solver, float *coordinates ); +HYPRE_Int +HYPRE_BoomerAMGSetCoordinates_dbl( HYPRE_Solver solver, float *coordinates ); +HYPRE_Int +HYPRE_BoomerAMGSetCoordinates_long_dbl( HYPRE_Solver solver, float *coordinates ); +HYPRE_Int +HYPRE_BoomerAMGSetCoordinates( HYPRE_Solver solver, float *coordinates ); + +HYPRE_Int +HYPRE_BoomerAMGSetCpointsToKeep_flt( HYPRE_Solver solver, HYPRE_Int cpt_coarse_level, HYPRE_Int num_cpt_coarse, HYPRE_BigInt *cpt_coarse_index ); +HYPRE_Int +HYPRE_BoomerAMGSetCpointsToKeep_dbl( HYPRE_Solver solver, HYPRE_Int cpt_coarse_level, HYPRE_Int num_cpt_coarse, HYPRE_BigInt *cpt_coarse_index ); +HYPRE_Int +HYPRE_BoomerAMGSetCpointsToKeep_long_dbl( HYPRE_Solver solver, HYPRE_Int cpt_coarse_level, HYPRE_Int num_cpt_coarse, HYPRE_BigInt *cpt_coarse_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_BoomerAMGSetCumNnzAP_flt( HYPRE_Solver solver, hypre_float cum_nnz_AP ); +HYPRE_Int +HYPRE_BoomerAMGSetCumNnzAP_dbl( HYPRE_Solver solver, hypre_double cum_nnz_AP ); +HYPRE_Int +HYPRE_BoomerAMGSetCumNnzAP_long_dbl( HYPRE_Solver solver, hypre_long_double cum_nnz_AP ); +HYPRE_Int +HYPRE_BoomerAMGSetCumNnzAP( HYPRE_Solver solver, hypre_long_double cum_nnz_AP ); + +HYPRE_Int +HYPRE_BoomerAMGSetCycleNumSweeps_flt( HYPRE_Solver solver, HYPRE_Int num_sweeps, HYPRE_Int k ); +HYPRE_Int +HYPRE_BoomerAMGSetCycleNumSweeps_dbl( HYPRE_Solver solver, HYPRE_Int num_sweeps, HYPRE_Int k ); +HYPRE_Int +HYPRE_BoomerAMGSetCycleNumSweeps_long_dbl( HYPRE_Solver solver, HYPRE_Int num_sweeps, HYPRE_Int k ); +HYPRE_Int +HYPRE_BoomerAMGSetCycleNumSweeps( HYPRE_Solver solver, HYPRE_Int num_sweeps, HYPRE_Int k ); + +HYPRE_Int +HYPRE_BoomerAMGSetCycleRelaxType_flt( HYPRE_Solver solver, HYPRE_Int relax_type, HYPRE_Int k ); +HYPRE_Int +HYPRE_BoomerAMGSetCycleRelaxType_dbl( HYPRE_Solver solver, HYPRE_Int relax_type, HYPRE_Int k ); +HYPRE_Int +HYPRE_BoomerAMGSetCycleRelaxType_long_dbl( HYPRE_Solver solver, HYPRE_Int relax_type, HYPRE_Int k ); +HYPRE_Int +HYPRE_BoomerAMGSetCycleRelaxType( HYPRE_Solver solver, HYPRE_Int relax_type, HYPRE_Int k ); + +HYPRE_Int +HYPRE_BoomerAMGSetCycleType_flt( HYPRE_Solver solver, HYPRE_Int cycle_type ); +HYPRE_Int +HYPRE_BoomerAMGSetCycleType_dbl( HYPRE_Solver solver, HYPRE_Int cycle_type ); +HYPRE_Int +HYPRE_BoomerAMGSetCycleType_long_dbl( HYPRE_Solver solver, HYPRE_Int cycle_type ); +HYPRE_Int +HYPRE_BoomerAMGSetCycleType( HYPRE_Solver solver, HYPRE_Int cycle_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetDebugFlag_flt( HYPRE_Solver solver, HYPRE_Int debug_flag ); +HYPRE_Int +HYPRE_BoomerAMGSetDebugFlag_dbl( HYPRE_Solver solver, HYPRE_Int debug_flag ); +HYPRE_Int +HYPRE_BoomerAMGSetDebugFlag_long_dbl( HYPRE_Solver solver, HYPRE_Int debug_flag ); +HYPRE_Int +HYPRE_BoomerAMGSetDebugFlag( HYPRE_Solver solver, HYPRE_Int debug_flag ); + +HYPRE_Int +HYPRE_BoomerAMGSetDofFunc_flt( HYPRE_Solver solver, HYPRE_Int *dof_func ); +HYPRE_Int +HYPRE_BoomerAMGSetDofFunc_dbl( HYPRE_Solver solver, HYPRE_Int *dof_func ); +HYPRE_Int +HYPRE_BoomerAMGSetDofFunc_long_dbl( HYPRE_Solver solver, HYPRE_Int *dof_func ); +HYPRE_Int +HYPRE_BoomerAMGSetDofFunc( HYPRE_Solver solver, HYPRE_Int *dof_func ); + +HYPRE_Int +HYPRE_BoomerAMGSetDomainType_flt( HYPRE_Solver solver, HYPRE_Int domain_type ); +HYPRE_Int +HYPRE_BoomerAMGSetDomainType_dbl( HYPRE_Solver solver, HYPRE_Int domain_type ); +HYPRE_Int +HYPRE_BoomerAMGSetDomainType_long_dbl( HYPRE_Solver solver, HYPRE_Int domain_type ); +HYPRE_Int +HYPRE_BoomerAMGSetDomainType( HYPRE_Solver solver, HYPRE_Int domain_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetDropTol_flt( HYPRE_Solver solver, hypre_float drop_tol ); +HYPRE_Int +HYPRE_BoomerAMGSetDropTol_dbl( HYPRE_Solver solver, hypre_double drop_tol ); +HYPRE_Int +HYPRE_BoomerAMGSetDropTol_long_dbl( HYPRE_Solver solver, hypre_long_double drop_tol ); +HYPRE_Int +HYPRE_BoomerAMGSetDropTol( HYPRE_Solver solver, hypre_long_double drop_tol ); + +HYPRE_Int +HYPRE_BoomerAMGSetEuBJ_flt( HYPRE_Solver solver, HYPRE_Int eu_bj ); +HYPRE_Int +HYPRE_BoomerAMGSetEuBJ_dbl( HYPRE_Solver solver, HYPRE_Int eu_bj ); +HYPRE_Int +HYPRE_BoomerAMGSetEuBJ_long_dbl( HYPRE_Solver solver, HYPRE_Int eu_bj ); +HYPRE_Int +HYPRE_BoomerAMGSetEuBJ( HYPRE_Solver solver, HYPRE_Int eu_bj ); + +HYPRE_Int +HYPRE_BoomerAMGSetEuLevel_flt( HYPRE_Solver solver, HYPRE_Int eu_level ); +HYPRE_Int +HYPRE_BoomerAMGSetEuLevel_dbl( HYPRE_Solver solver, HYPRE_Int eu_level ); +HYPRE_Int +HYPRE_BoomerAMGSetEuLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int eu_level ); +HYPRE_Int +HYPRE_BoomerAMGSetEuLevel( HYPRE_Solver solver, HYPRE_Int eu_level ); + +HYPRE_Int +HYPRE_BoomerAMGSetEuSparseA_flt( HYPRE_Solver solver, hypre_float eu_sparse_A ); +HYPRE_Int +HYPRE_BoomerAMGSetEuSparseA_dbl( HYPRE_Solver solver, hypre_double eu_sparse_A ); +HYPRE_Int +HYPRE_BoomerAMGSetEuSparseA_long_dbl( HYPRE_Solver solver, hypre_long_double eu_sparse_A ); +HYPRE_Int +HYPRE_BoomerAMGSetEuSparseA( HYPRE_Solver solver, hypre_long_double eu_sparse_A ); + +HYPRE_Int +HYPRE_BoomerAMGSetEuclidFile_flt( HYPRE_Solver solver, char *euclidfile ); +HYPRE_Int +HYPRE_BoomerAMGSetEuclidFile_dbl( HYPRE_Solver solver, char *euclidfile ); +HYPRE_Int +HYPRE_BoomerAMGSetEuclidFile_long_dbl( HYPRE_Solver solver, char *euclidfile ); +HYPRE_Int +HYPRE_BoomerAMGSetEuclidFile( HYPRE_Solver solver, char *euclidfile ); + +HYPRE_Int +HYPRE_BoomerAMGSetFCycle_flt( HYPRE_Solver solver, HYPRE_Int fcycle ); +HYPRE_Int +HYPRE_BoomerAMGSetFCycle_dbl( HYPRE_Solver solver, HYPRE_Int fcycle ); +HYPRE_Int +HYPRE_BoomerAMGSetFCycle_long_dbl( HYPRE_Solver solver, HYPRE_Int fcycle ); +HYPRE_Int +HYPRE_BoomerAMGSetFCycle( HYPRE_Solver solver, HYPRE_Int fcycle ); + +HYPRE_Int +HYPRE_BoomerAMGSetFPoints_flt( HYPRE_Solver solver, HYPRE_Int num_fpt, HYPRE_BigInt *fpt_index ); +HYPRE_Int +HYPRE_BoomerAMGSetFPoints_dbl( HYPRE_Solver solver, HYPRE_Int num_fpt, HYPRE_BigInt *fpt_index ); +HYPRE_Int +HYPRE_BoomerAMGSetFPoints_long_dbl( HYPRE_Solver solver, HYPRE_Int num_fpt, HYPRE_BigInt *fpt_index ); +HYPRE_Int +HYPRE_BoomerAMGSetFPoints( HYPRE_Solver solver, HYPRE_Int num_fpt, HYPRE_BigInt *fpt_index ); + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIAlgoType_flt( HYPRE_Solver solver, HYPRE_Int algo_type ); +HYPRE_Int +HYPRE_BoomerAMGSetFSAIAlgoType_dbl( HYPRE_Solver solver, HYPRE_Int algo_type ); +HYPRE_Int +HYPRE_BoomerAMGSetFSAIAlgoType_long_dbl( HYPRE_Solver solver, HYPRE_Int algo_type ); +HYPRE_Int +HYPRE_BoomerAMGSetFSAIAlgoType( HYPRE_Solver solver, HYPRE_Int algo_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIEigMaxIters_flt( HYPRE_Solver solver, HYPRE_Int eig_max_iters ); +HYPRE_Int +HYPRE_BoomerAMGSetFSAIEigMaxIters_dbl( HYPRE_Solver solver, HYPRE_Int eig_max_iters ); +HYPRE_Int +HYPRE_BoomerAMGSetFSAIEigMaxIters_long_dbl( HYPRE_Solver solver, HYPRE_Int eig_max_iters ); +HYPRE_Int +HYPRE_BoomerAMGSetFSAIEigMaxIters( HYPRE_Solver solver, HYPRE_Int eig_max_iters ); + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIKapTolerance_flt( HYPRE_Solver solver, hypre_float kap_tolerance ); +HYPRE_Int +HYPRE_BoomerAMGSetFSAIKapTolerance_dbl( HYPRE_Solver solver, hypre_double kap_tolerance ); +HYPRE_Int +HYPRE_BoomerAMGSetFSAIKapTolerance_long_dbl( HYPRE_Solver solver, hypre_long_double kap_tolerance ); +HYPRE_Int +HYPRE_BoomerAMGSetFSAIKapTolerance( HYPRE_Solver solver, hypre_long_double kap_tolerance ); + +HYPRE_Int +HYPRE_BoomerAMGSetFSAILocalSolveType_flt( HYPRE_Solver solver, HYPRE_Int local_solve_type ); +HYPRE_Int +HYPRE_BoomerAMGSetFSAILocalSolveType_dbl( HYPRE_Solver solver, HYPRE_Int local_solve_type ); +HYPRE_Int +HYPRE_BoomerAMGSetFSAILocalSolveType_long_dbl( HYPRE_Solver solver, HYPRE_Int local_solve_type ); +HYPRE_Int +HYPRE_BoomerAMGSetFSAILocalSolveType( HYPRE_Solver solver, HYPRE_Int local_solve_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIMaxNnzRow_flt( HYPRE_Solver solver, HYPRE_Int max_nnz_row ); +HYPRE_Int +HYPRE_BoomerAMGSetFSAIMaxNnzRow_dbl( HYPRE_Solver solver, HYPRE_Int max_nnz_row ); +HYPRE_Int +HYPRE_BoomerAMGSetFSAIMaxNnzRow_long_dbl( HYPRE_Solver solver, HYPRE_Int max_nnz_row ); +HYPRE_Int +HYPRE_BoomerAMGSetFSAIMaxNnzRow( HYPRE_Solver solver, HYPRE_Int max_nnz_row ); + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIMaxStepSize_flt( HYPRE_Solver solver, HYPRE_Int max_step_size ); +HYPRE_Int +HYPRE_BoomerAMGSetFSAIMaxStepSize_dbl( HYPRE_Solver solver, HYPRE_Int max_step_size ); +HYPRE_Int +HYPRE_BoomerAMGSetFSAIMaxStepSize_long_dbl( HYPRE_Solver solver, HYPRE_Int max_step_size ); +HYPRE_Int +HYPRE_BoomerAMGSetFSAIMaxStepSize( HYPRE_Solver solver, HYPRE_Int max_step_size ); + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIMaxSteps_flt( HYPRE_Solver solver, HYPRE_Int max_steps ); +HYPRE_Int +HYPRE_BoomerAMGSetFSAIMaxSteps_dbl( HYPRE_Solver solver, HYPRE_Int max_steps ); +HYPRE_Int +HYPRE_BoomerAMGSetFSAIMaxSteps_long_dbl( HYPRE_Solver solver, HYPRE_Int max_steps ); +HYPRE_Int +HYPRE_BoomerAMGSetFSAIMaxSteps( HYPRE_Solver solver, HYPRE_Int max_steps ); + +HYPRE_Int +HYPRE_BoomerAMGSetFSAINumLevels_flt( HYPRE_Solver solver, HYPRE_Int num_levels ); +HYPRE_Int +HYPRE_BoomerAMGSetFSAINumLevels_dbl( HYPRE_Solver solver, HYPRE_Int num_levels ); +HYPRE_Int +HYPRE_BoomerAMGSetFSAINumLevels_long_dbl( HYPRE_Solver solver, HYPRE_Int num_levels ); +HYPRE_Int +HYPRE_BoomerAMGSetFSAINumLevels( HYPRE_Solver solver, HYPRE_Int num_levels ); + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIThreshold_flt( HYPRE_Solver solver, hypre_float threshold ); +HYPRE_Int +HYPRE_BoomerAMGSetFSAIThreshold_dbl( HYPRE_Solver solver, hypre_double threshold ); +HYPRE_Int +HYPRE_BoomerAMGSetFSAIThreshold_long_dbl( HYPRE_Solver solver, hypre_long_double threshold ); +HYPRE_Int +HYPRE_BoomerAMGSetFSAIThreshold( HYPRE_Solver solver, hypre_long_double threshold ); + +HYPRE_Int +HYPRE_BoomerAMGSetFilter_flt( HYPRE_Solver solver, hypre_float filter ); +HYPRE_Int +HYPRE_BoomerAMGSetFilter_dbl( HYPRE_Solver solver, hypre_double filter ); +HYPRE_Int +HYPRE_BoomerAMGSetFilter_long_dbl( HYPRE_Solver solver, hypre_long_double filter ); +HYPRE_Int +HYPRE_BoomerAMGSetFilter( HYPRE_Solver solver, hypre_long_double filter ); + +HYPRE_Int +HYPRE_BoomerAMGSetFilterFunctions_flt( HYPRE_Solver solver, HYPRE_Int filter_functions ); +HYPRE_Int +HYPRE_BoomerAMGSetFilterFunctions_dbl( HYPRE_Solver solver, HYPRE_Int filter_functions ); +HYPRE_Int +HYPRE_BoomerAMGSetFilterFunctions_long_dbl( HYPRE_Solver solver, HYPRE_Int filter_functions ); +HYPRE_Int +HYPRE_BoomerAMGSetFilterFunctions( HYPRE_Solver solver, HYPRE_Int filter_functions ); + +HYPRE_Int +HYPRE_BoomerAMGSetFilterThresholdR_flt( HYPRE_Solver solver, hypre_float filter_threshold ); +HYPRE_Int +HYPRE_BoomerAMGSetFilterThresholdR_dbl( HYPRE_Solver solver, hypre_double filter_threshold ); +HYPRE_Int +HYPRE_BoomerAMGSetFilterThresholdR_long_dbl( HYPRE_Solver solver, hypre_long_double filter_threshold ); +HYPRE_Int +HYPRE_BoomerAMGSetFilterThresholdR( HYPRE_Solver solver, hypre_long_double filter_threshold ); + +HYPRE_Int +HYPRE_BoomerAMGSetGMRESSwitchR_flt( HYPRE_Solver solver, HYPRE_Int gmres_switch ); +HYPRE_Int +HYPRE_BoomerAMGSetGMRESSwitchR_dbl( HYPRE_Solver solver, HYPRE_Int gmres_switch ); +HYPRE_Int +HYPRE_BoomerAMGSetGMRESSwitchR_long_dbl( HYPRE_Solver solver, HYPRE_Int gmres_switch ); +HYPRE_Int +HYPRE_BoomerAMGSetGMRESSwitchR( HYPRE_Solver solver, HYPRE_Int gmres_switch ); + +HYPRE_Int +HYPRE_BoomerAMGSetGSMG_flt( HYPRE_Solver solver, HYPRE_Int gsmg ); +HYPRE_Int +HYPRE_BoomerAMGSetGSMG_dbl( HYPRE_Solver solver, HYPRE_Int gsmg ); +HYPRE_Int +HYPRE_BoomerAMGSetGSMG_long_dbl( HYPRE_Solver solver, HYPRE_Int gsmg ); +HYPRE_Int +HYPRE_BoomerAMGSetGSMG( HYPRE_Solver solver, HYPRE_Int gsmg ); + +HYPRE_Int +HYPRE_BoomerAMGSetGridRelaxPoints_flt( HYPRE_Solver solver, HYPRE_Int **grid_relax_points ); +HYPRE_Int +HYPRE_BoomerAMGSetGridRelaxPoints_dbl( HYPRE_Solver solver, HYPRE_Int **grid_relax_points ); +HYPRE_Int +HYPRE_BoomerAMGSetGridRelaxPoints_long_dbl( HYPRE_Solver solver, HYPRE_Int **grid_relax_points ); +HYPRE_Int +HYPRE_BoomerAMGSetGridRelaxPoints( HYPRE_Solver solver, HYPRE_Int **grid_relax_points ); + +HYPRE_Int +HYPRE_BoomerAMGSetGridRelaxType_flt( HYPRE_Solver solver, HYPRE_Int *grid_relax_type ); +HYPRE_Int +HYPRE_BoomerAMGSetGridRelaxType_dbl( HYPRE_Solver solver, HYPRE_Int *grid_relax_type ); +HYPRE_Int +HYPRE_BoomerAMGSetGridRelaxType_long_dbl( HYPRE_Solver solver, HYPRE_Int *grid_relax_type ); +HYPRE_Int +HYPRE_BoomerAMGSetGridRelaxType( HYPRE_Solver solver, HYPRE_Int *grid_relax_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetILUDroptol_flt( HYPRE_Solver solver, hypre_float ilu_droptol ); +HYPRE_Int +HYPRE_BoomerAMGSetILUDroptol_dbl( HYPRE_Solver solver, hypre_double ilu_droptol ); +HYPRE_Int +HYPRE_BoomerAMGSetILUDroptol_long_dbl( HYPRE_Solver solver, hypre_long_double ilu_droptol ); +HYPRE_Int +HYPRE_BoomerAMGSetILUDroptol( HYPRE_Solver solver, hypre_long_double ilu_droptol ); + +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupMaxIter_flt( HYPRE_Solver solver, HYPRE_Int ilu_iter_setup_max_iter ); +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int ilu_iter_setup_max_iter ); +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int ilu_iter_setup_max_iter ); +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupMaxIter( HYPRE_Solver solver, HYPRE_Int ilu_iter_setup_max_iter ); + +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupOption_flt( HYPRE_Solver solver, HYPRE_Int ilu_iter_setup_option ); +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupOption_dbl( HYPRE_Solver solver, HYPRE_Int ilu_iter_setup_option ); +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupOption_long_dbl( HYPRE_Solver solver, HYPRE_Int ilu_iter_setup_option ); +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupOption( HYPRE_Solver solver, HYPRE_Int ilu_iter_setup_option ); + +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupTolerance_flt( HYPRE_Solver solver, hypre_float ilu_iter_setup_tolerance ); +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupTolerance_dbl( HYPRE_Solver solver, hypre_double ilu_iter_setup_tolerance ); +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupTolerance_long_dbl( HYPRE_Solver solver, hypre_long_double ilu_iter_setup_tolerance ); +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupTolerance( HYPRE_Solver solver, hypre_long_double ilu_iter_setup_tolerance ); + +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupType_flt( HYPRE_Solver solver, HYPRE_Int ilu_iter_setup_type ); +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupType_dbl( HYPRE_Solver solver, HYPRE_Int ilu_iter_setup_type ); +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupType_long_dbl( HYPRE_Solver solver, HYPRE_Int ilu_iter_setup_type ); +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupType( HYPRE_Solver solver, HYPRE_Int ilu_iter_setup_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetILULevel_flt( HYPRE_Solver solver, HYPRE_Int ilu_lfil ); +HYPRE_Int +HYPRE_BoomerAMGSetILULevel_dbl( HYPRE_Solver solver, HYPRE_Int ilu_lfil ); +HYPRE_Int +HYPRE_BoomerAMGSetILULevel_long_dbl( HYPRE_Solver solver, HYPRE_Int ilu_lfil ); +HYPRE_Int +HYPRE_BoomerAMGSetILULevel( HYPRE_Solver solver, HYPRE_Int ilu_lfil ); + +HYPRE_Int +HYPRE_BoomerAMGSetILULocalReordering_flt( HYPRE_Solver solver, HYPRE_Int ilu_reordering_type ); +HYPRE_Int +HYPRE_BoomerAMGSetILULocalReordering_dbl( HYPRE_Solver solver, HYPRE_Int ilu_reordering_type ); +HYPRE_Int +HYPRE_BoomerAMGSetILULocalReordering_long_dbl( HYPRE_Solver solver, HYPRE_Int ilu_reordering_type ); +HYPRE_Int +HYPRE_BoomerAMGSetILULocalReordering( HYPRE_Solver solver, HYPRE_Int ilu_reordering_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetILULowerJacobiIters_flt( HYPRE_Solver solver, HYPRE_Int ilu_lower_jacobi_iters ); +HYPRE_Int +HYPRE_BoomerAMGSetILULowerJacobiIters_dbl( HYPRE_Solver solver, HYPRE_Int ilu_lower_jacobi_iters ); +HYPRE_Int +HYPRE_BoomerAMGSetILULowerJacobiIters_long_dbl( HYPRE_Solver solver, HYPRE_Int ilu_lower_jacobi_iters ); +HYPRE_Int +HYPRE_BoomerAMGSetILULowerJacobiIters( HYPRE_Solver solver, HYPRE_Int ilu_lower_jacobi_iters ); + +HYPRE_Int +HYPRE_BoomerAMGSetILUMaxIter_flt( HYPRE_Solver solver, HYPRE_Int ilu_max_iter ); +HYPRE_Int +HYPRE_BoomerAMGSetILUMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int ilu_max_iter ); +HYPRE_Int +HYPRE_BoomerAMGSetILUMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int ilu_max_iter ); +HYPRE_Int +HYPRE_BoomerAMGSetILUMaxIter( HYPRE_Solver solver, HYPRE_Int ilu_max_iter ); + +HYPRE_Int +HYPRE_BoomerAMGSetILUMaxRowNnz_flt( HYPRE_Solver solver, HYPRE_Int ilu_max_row_nnz ); +HYPRE_Int +HYPRE_BoomerAMGSetILUMaxRowNnz_dbl( HYPRE_Solver solver, HYPRE_Int ilu_max_row_nnz ); +HYPRE_Int +HYPRE_BoomerAMGSetILUMaxRowNnz_long_dbl( HYPRE_Solver solver, HYPRE_Int ilu_max_row_nnz ); +HYPRE_Int +HYPRE_BoomerAMGSetILUMaxRowNnz( HYPRE_Solver solver, HYPRE_Int ilu_max_row_nnz ); + +HYPRE_Int +HYPRE_BoomerAMGSetILUTriSolve_flt( HYPRE_Solver solver, HYPRE_Int ilu_tri_solve ); +HYPRE_Int +HYPRE_BoomerAMGSetILUTriSolve_dbl( HYPRE_Solver solver, HYPRE_Int ilu_tri_solve ); +HYPRE_Int +HYPRE_BoomerAMGSetILUTriSolve_long_dbl( HYPRE_Solver solver, HYPRE_Int ilu_tri_solve ); +HYPRE_Int +HYPRE_BoomerAMGSetILUTriSolve( HYPRE_Solver solver, HYPRE_Int ilu_tri_solve ); + +HYPRE_Int +HYPRE_BoomerAMGSetILUType_flt( HYPRE_Solver solver, HYPRE_Int ilu_type ); +HYPRE_Int +HYPRE_BoomerAMGSetILUType_dbl( HYPRE_Solver solver, HYPRE_Int ilu_type ); +HYPRE_Int +HYPRE_BoomerAMGSetILUType_long_dbl( HYPRE_Solver solver, HYPRE_Int ilu_type ); +HYPRE_Int +HYPRE_BoomerAMGSetILUType( HYPRE_Solver solver, HYPRE_Int ilu_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetILUUpperJacobiIters_flt( HYPRE_Solver solver, HYPRE_Int ilu_upper_jacobi_iters ); +HYPRE_Int +HYPRE_BoomerAMGSetILUUpperJacobiIters_dbl( HYPRE_Solver solver, HYPRE_Int ilu_upper_jacobi_iters ); +HYPRE_Int +HYPRE_BoomerAMGSetILUUpperJacobiIters_long_dbl( HYPRE_Solver solver, HYPRE_Int ilu_upper_jacobi_iters ); +HYPRE_Int +HYPRE_BoomerAMGSetILUUpperJacobiIters( HYPRE_Solver solver, HYPRE_Int ilu_upper_jacobi_iters ); + +HYPRE_Int +HYPRE_BoomerAMGSetISType_flt( HYPRE_Solver solver, HYPRE_Int IS_type ); +HYPRE_Int +HYPRE_BoomerAMGSetISType_dbl( HYPRE_Solver solver, HYPRE_Int IS_type ); +HYPRE_Int +HYPRE_BoomerAMGSetISType_long_dbl( HYPRE_Solver solver, HYPRE_Int IS_type ); +HYPRE_Int +HYPRE_BoomerAMGSetISType( HYPRE_Solver solver, HYPRE_Int IS_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetInterpRefine_flt( HYPRE_Solver solver, HYPRE_Int num_refine ); +HYPRE_Int +HYPRE_BoomerAMGSetInterpRefine_dbl( HYPRE_Solver solver, HYPRE_Int num_refine ); +HYPRE_Int +HYPRE_BoomerAMGSetInterpRefine_long_dbl( HYPRE_Solver solver, HYPRE_Int num_refine ); +HYPRE_Int +HYPRE_BoomerAMGSetInterpRefine( HYPRE_Solver solver, HYPRE_Int num_refine ); + +HYPRE_Int +HYPRE_BoomerAMGSetInterpType_flt( HYPRE_Solver solver, HYPRE_Int interp_type ); +HYPRE_Int +HYPRE_BoomerAMGSetInterpType_dbl( HYPRE_Solver solver, HYPRE_Int interp_type ); +HYPRE_Int +HYPRE_BoomerAMGSetInterpType_long_dbl( HYPRE_Solver solver, HYPRE_Int interp_type ); +HYPRE_Int +HYPRE_BoomerAMGSetInterpType( HYPRE_Solver solver, HYPRE_Int interp_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetInterpVecAbsQTrunc_flt( HYPRE_Solver solver, hypre_float q_trunc ); +HYPRE_Int +HYPRE_BoomerAMGSetInterpVecAbsQTrunc_dbl( HYPRE_Solver solver, hypre_double q_trunc ); +HYPRE_Int +HYPRE_BoomerAMGSetInterpVecAbsQTrunc_long_dbl( HYPRE_Solver solver, hypre_long_double q_trunc ); +HYPRE_Int +HYPRE_BoomerAMGSetInterpVecAbsQTrunc( HYPRE_Solver solver, hypre_long_double q_trunc ); + +HYPRE_Int +HYPRE_BoomerAMGSetInterpVecQMax_flt( HYPRE_Solver solver, HYPRE_Int q_max ); +HYPRE_Int +HYPRE_BoomerAMGSetInterpVecQMax_dbl( HYPRE_Solver solver, HYPRE_Int q_max ); +HYPRE_Int +HYPRE_BoomerAMGSetInterpVecQMax_long_dbl( HYPRE_Solver solver, HYPRE_Int q_max ); +HYPRE_Int +HYPRE_BoomerAMGSetInterpVecQMax( HYPRE_Solver solver, HYPRE_Int q_max ); + +HYPRE_Int +HYPRE_BoomerAMGSetInterpVecVariant_flt( HYPRE_Solver solver, HYPRE_Int var ); +HYPRE_Int +HYPRE_BoomerAMGSetInterpVecVariant_dbl( HYPRE_Solver solver, HYPRE_Int var ); +HYPRE_Int +HYPRE_BoomerAMGSetInterpVecVariant_long_dbl( HYPRE_Solver solver, HYPRE_Int var ); +HYPRE_Int +HYPRE_BoomerAMGSetInterpVecVariant( HYPRE_Solver solver, HYPRE_Int var ); + +HYPRE_Int +HYPRE_BoomerAMGSetInterpVectors_flt( HYPRE_Solver solver, HYPRE_Int num_vectors, HYPRE_ParVector *interp_vectors ); +HYPRE_Int +HYPRE_BoomerAMGSetInterpVectors_dbl( HYPRE_Solver solver, HYPRE_Int num_vectors, HYPRE_ParVector *interp_vectors ); +HYPRE_Int +HYPRE_BoomerAMGSetInterpVectors_long_dbl( HYPRE_Solver solver, HYPRE_Int num_vectors, HYPRE_ParVector *interp_vectors ); +HYPRE_Int +HYPRE_BoomerAMGSetInterpVectors( HYPRE_Solver solver, HYPRE_Int num_vectors, HYPRE_ParVector *interp_vectors ); + +HYPRE_Int +HYPRE_BoomerAMGSetIsTriangular_flt( HYPRE_Solver solver, HYPRE_Int is_triangular ); +HYPRE_Int +HYPRE_BoomerAMGSetIsTriangular_dbl( HYPRE_Solver solver, HYPRE_Int is_triangular ); +HYPRE_Int +HYPRE_BoomerAMGSetIsTriangular_long_dbl( HYPRE_Solver solver, HYPRE_Int is_triangular ); +HYPRE_Int +HYPRE_BoomerAMGSetIsTriangular( HYPRE_Solver solver, HYPRE_Int is_triangular ); + +HYPRE_Int +HYPRE_BoomerAMGSetIsolatedFPoints_flt( HYPRE_Solver solver, HYPRE_Int num_isolated_fpt, HYPRE_BigInt *isolated_fpt_index ); +HYPRE_Int +HYPRE_BoomerAMGSetIsolatedFPoints_dbl( HYPRE_Solver solver, HYPRE_Int num_isolated_fpt, HYPRE_BigInt *isolated_fpt_index ); +HYPRE_Int +HYPRE_BoomerAMGSetIsolatedFPoints_long_dbl( HYPRE_Solver solver, HYPRE_Int num_isolated_fpt, HYPRE_BigInt *isolated_fpt_index ); +HYPRE_Int +HYPRE_BoomerAMGSetIsolatedFPoints( HYPRE_Solver solver, HYPRE_Int num_isolated_fpt, HYPRE_BigInt *isolated_fpt_index ); + +HYPRE_Int +HYPRE_BoomerAMGSetJacobiTruncThreshold_flt( HYPRE_Solver solver, hypre_float jacobi_trunc_threshold ); +HYPRE_Int +HYPRE_BoomerAMGSetJacobiTruncThreshold_dbl( HYPRE_Solver solver, hypre_double jacobi_trunc_threshold ); +HYPRE_Int +HYPRE_BoomerAMGSetJacobiTruncThreshold_long_dbl( HYPRE_Solver solver, hypre_long_double jacobi_trunc_threshold ); +HYPRE_Int +HYPRE_BoomerAMGSetJacobiTruncThreshold( HYPRE_Solver solver, hypre_long_double jacobi_trunc_threshold ); + +HYPRE_Int +HYPRE_BoomerAMGSetKeepSameSign_flt( HYPRE_Solver solver, HYPRE_Int keep_same_sign ); +HYPRE_Int +HYPRE_BoomerAMGSetKeepSameSign_dbl( HYPRE_Solver solver, HYPRE_Int keep_same_sign ); +HYPRE_Int +HYPRE_BoomerAMGSetKeepSameSign_long_dbl( HYPRE_Solver solver, HYPRE_Int keep_same_sign ); +HYPRE_Int +HYPRE_BoomerAMGSetKeepSameSign( HYPRE_Solver solver, HYPRE_Int keep_same_sign ); + +HYPRE_Int +HYPRE_BoomerAMGSetKeepTranspose_flt( HYPRE_Solver solver, HYPRE_Int keepTranspose ); +HYPRE_Int +HYPRE_BoomerAMGSetKeepTranspose_dbl( HYPRE_Solver solver, HYPRE_Int keepTranspose ); +HYPRE_Int +HYPRE_BoomerAMGSetKeepTranspose_long_dbl( HYPRE_Solver solver, HYPRE_Int keepTranspose ); +HYPRE_Int +HYPRE_BoomerAMGSetKeepTranspose( HYPRE_Solver solver, HYPRE_Int keepTranspose ); + +HYPRE_Int +HYPRE_BoomerAMGSetLevel_flt( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_BoomerAMGSetLevel_dbl( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_BoomerAMGSetLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_BoomerAMGSetLevel( HYPRE_Solver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_BoomerAMGSetLevelNonGalerkinTol_flt( HYPRE_Solver solver, hypre_float nongalerkin_tol, HYPRE_Int level ); +HYPRE_Int +HYPRE_BoomerAMGSetLevelNonGalerkinTol_dbl( HYPRE_Solver solver, hypre_double nongalerkin_tol, HYPRE_Int level ); +HYPRE_Int +HYPRE_BoomerAMGSetLevelNonGalerkinTol_long_dbl( HYPRE_Solver solver, hypre_long_double nongalerkin_tol, HYPRE_Int level ); +HYPRE_Int +HYPRE_BoomerAMGSetLevelNonGalerkinTol( HYPRE_Solver solver, hypre_long_double nongalerkin_tol, HYPRE_Int level ); + +HYPRE_Int +HYPRE_BoomerAMGSetLevelOuterWt_flt( HYPRE_Solver solver, hypre_float omega, HYPRE_Int level ); +HYPRE_Int +HYPRE_BoomerAMGSetLevelOuterWt_dbl( HYPRE_Solver solver, hypre_double omega, HYPRE_Int level ); +HYPRE_Int +HYPRE_BoomerAMGSetLevelOuterWt_long_dbl( HYPRE_Solver solver, hypre_long_double omega, HYPRE_Int level ); +HYPRE_Int +HYPRE_BoomerAMGSetLevelOuterWt( HYPRE_Solver solver, hypre_long_double omega, HYPRE_Int level ); + +HYPRE_Int +HYPRE_BoomerAMGSetLevelRelaxWt_flt( HYPRE_Solver solver, hypre_float relax_weight, HYPRE_Int level ); +HYPRE_Int +HYPRE_BoomerAMGSetLevelRelaxWt_dbl( HYPRE_Solver solver, hypre_double relax_weight, HYPRE_Int level ); +HYPRE_Int +HYPRE_BoomerAMGSetLevelRelaxWt_long_dbl( HYPRE_Solver solver, hypre_long_double relax_weight, HYPRE_Int level ); +HYPRE_Int +HYPRE_BoomerAMGSetLevelRelaxWt( HYPRE_Solver solver, hypre_long_double relax_weight, HYPRE_Int level ); + +HYPRE_Int +HYPRE_BoomerAMGSetLogging_flt( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_BoomerAMGSetLogging_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_BoomerAMGSetLogging_long_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_BoomerAMGSetLogging( HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_BoomerAMGSetMaxCoarseSize_flt( HYPRE_Solver solver, HYPRE_Int max_coarse_size ); +HYPRE_Int +HYPRE_BoomerAMGSetMaxCoarseSize_dbl( HYPRE_Solver solver, HYPRE_Int max_coarse_size ); +HYPRE_Int +HYPRE_BoomerAMGSetMaxCoarseSize_long_dbl( HYPRE_Solver solver, HYPRE_Int max_coarse_size ); +HYPRE_Int +HYPRE_BoomerAMGSetMaxCoarseSize( HYPRE_Solver solver, HYPRE_Int max_coarse_size ); + +HYPRE_Int +HYPRE_BoomerAMGSetMaxIter_flt( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_BoomerAMGSetMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_BoomerAMGSetMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_BoomerAMGSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_BoomerAMGSetMaxLevels_flt( HYPRE_Solver solver, HYPRE_Int max_levels ); +HYPRE_Int +HYPRE_BoomerAMGSetMaxLevels_dbl( HYPRE_Solver solver, HYPRE_Int max_levels ); +HYPRE_Int +HYPRE_BoomerAMGSetMaxLevels_long_dbl( HYPRE_Solver solver, HYPRE_Int max_levels ); +HYPRE_Int +HYPRE_BoomerAMGSetMaxLevels( HYPRE_Solver solver, HYPRE_Int max_levels ); + +HYPRE_Int +HYPRE_BoomerAMGSetMaxNzPerRow_flt( HYPRE_Solver solver, HYPRE_Int max_nz_per_row ); +HYPRE_Int +HYPRE_BoomerAMGSetMaxNzPerRow_dbl( HYPRE_Solver solver, HYPRE_Int max_nz_per_row ); +HYPRE_Int +HYPRE_BoomerAMGSetMaxNzPerRow_long_dbl( HYPRE_Solver solver, HYPRE_Int max_nz_per_row ); +HYPRE_Int +HYPRE_BoomerAMGSetMaxNzPerRow( HYPRE_Solver solver, HYPRE_Int max_nz_per_row ); + +HYPRE_Int +HYPRE_BoomerAMGSetMaxRowSum_flt( HYPRE_Solver solver, hypre_float max_row_sum ); +HYPRE_Int +HYPRE_BoomerAMGSetMaxRowSum_dbl( HYPRE_Solver solver, hypre_double max_row_sum ); +HYPRE_Int +HYPRE_BoomerAMGSetMaxRowSum_long_dbl( HYPRE_Solver solver, hypre_long_double max_row_sum ); +HYPRE_Int +HYPRE_BoomerAMGSetMaxRowSum( HYPRE_Solver solver, hypre_long_double max_row_sum ); + +HYPRE_Int +HYPRE_BoomerAMGSetMeasureType_flt( HYPRE_Solver solver, HYPRE_Int measure_type ); +HYPRE_Int +HYPRE_BoomerAMGSetMeasureType_dbl( HYPRE_Solver solver, HYPRE_Int measure_type ); +HYPRE_Int +HYPRE_BoomerAMGSetMeasureType_long_dbl( HYPRE_Solver solver, HYPRE_Int measure_type ); +HYPRE_Int +HYPRE_BoomerAMGSetMeasureType( HYPRE_Solver solver, HYPRE_Int measure_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetMinCoarseSize_flt( HYPRE_Solver solver, HYPRE_Int min_coarse_size ); +HYPRE_Int +HYPRE_BoomerAMGSetMinCoarseSize_dbl( HYPRE_Solver solver, HYPRE_Int min_coarse_size ); +HYPRE_Int +HYPRE_BoomerAMGSetMinCoarseSize_long_dbl( HYPRE_Solver solver, HYPRE_Int min_coarse_size ); +HYPRE_Int +HYPRE_BoomerAMGSetMinCoarseSize( HYPRE_Solver solver, HYPRE_Int min_coarse_size ); + +HYPRE_Int +HYPRE_BoomerAMGSetMinIter_flt( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_BoomerAMGSetMinIter_dbl( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_BoomerAMGSetMinIter_long_dbl( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_BoomerAMGSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_BoomerAMGSetModuleRAP2_flt( HYPRE_Solver solver, HYPRE_Int mod_rap2 ); +HYPRE_Int +HYPRE_BoomerAMGSetModuleRAP2_dbl( HYPRE_Solver solver, HYPRE_Int mod_rap2 ); +HYPRE_Int +HYPRE_BoomerAMGSetModuleRAP2_long_dbl( HYPRE_Solver solver, HYPRE_Int mod_rap2 ); +HYPRE_Int +HYPRE_BoomerAMGSetModuleRAP2( HYPRE_Solver solver, HYPRE_Int mod_rap2 ); + +HYPRE_Int +HYPRE_BoomerAMGSetMultAddPMaxElmts_flt( HYPRE_Solver solver, HYPRE_Int add_P_max_elmts ); +HYPRE_Int +HYPRE_BoomerAMGSetMultAddPMaxElmts_dbl( HYPRE_Solver solver, HYPRE_Int add_P_max_elmts ); +HYPRE_Int +HYPRE_BoomerAMGSetMultAddPMaxElmts_long_dbl( 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_BoomerAMGSetMultAddTruncFactor_flt( HYPRE_Solver solver, hypre_float add_trunc_factor ); +HYPRE_Int +HYPRE_BoomerAMGSetMultAddTruncFactor_dbl( HYPRE_Solver solver, hypre_double add_trunc_factor ); +HYPRE_Int +HYPRE_BoomerAMGSetMultAddTruncFactor_long_dbl( HYPRE_Solver solver, hypre_long_double add_trunc_factor ); +HYPRE_Int +HYPRE_BoomerAMGSetMultAddTruncFactor( HYPRE_Solver solver, hypre_long_double add_trunc_factor ); + +HYPRE_Int +HYPRE_BoomerAMGSetMultAdditive_flt( HYPRE_Solver solver, HYPRE_Int addlvl ); +HYPRE_Int +HYPRE_BoomerAMGSetMultAdditive_dbl( HYPRE_Solver solver, HYPRE_Int addlvl ); +HYPRE_Int +HYPRE_BoomerAMGSetMultAdditive_long_dbl( HYPRE_Solver solver, HYPRE_Int addlvl ); +HYPRE_Int +HYPRE_BoomerAMGSetMultAdditive( HYPRE_Solver solver, HYPRE_Int addlvl ); + +HYPRE_Int +HYPRE_BoomerAMGSetNodal_flt( HYPRE_Solver solver, HYPRE_Int nodal ); +HYPRE_Int +HYPRE_BoomerAMGSetNodal_dbl( HYPRE_Solver solver, HYPRE_Int nodal ); +HYPRE_Int +HYPRE_BoomerAMGSetNodal_long_dbl( HYPRE_Solver solver, HYPRE_Int nodal ); +HYPRE_Int +HYPRE_BoomerAMGSetNodal( HYPRE_Solver solver, HYPRE_Int nodal ); + +HYPRE_Int +HYPRE_BoomerAMGSetNodalDiag_flt( HYPRE_Solver solver, HYPRE_Int nodal_diag ); +HYPRE_Int +HYPRE_BoomerAMGSetNodalDiag_dbl( HYPRE_Solver solver, HYPRE_Int nodal_diag ); +HYPRE_Int +HYPRE_BoomerAMGSetNodalDiag_long_dbl( HYPRE_Solver solver, HYPRE_Int nodal_diag ); +HYPRE_Int +HYPRE_BoomerAMGSetNodalDiag( HYPRE_Solver solver, HYPRE_Int nodal_diag ); + +HYPRE_Int +HYPRE_BoomerAMGSetNodalLevels_flt( HYPRE_Solver solver, HYPRE_Int nodal_levels ); +HYPRE_Int +HYPRE_BoomerAMGSetNodalLevels_dbl( HYPRE_Solver solver, HYPRE_Int nodal_levels ); +HYPRE_Int +HYPRE_BoomerAMGSetNodalLevels_long_dbl( HYPRE_Solver solver, HYPRE_Int nodal_levels ); +HYPRE_Int +HYPRE_BoomerAMGSetNodalLevels( HYPRE_Solver solver, HYPRE_Int nodal_levels ); + +HYPRE_Int +HYPRE_BoomerAMGSetNonGalerkTol_flt( HYPRE_Solver solver, HYPRE_Int nongalerk_num_tol, hypre_float *nongalerk_tol ); +HYPRE_Int +HYPRE_BoomerAMGSetNonGalerkTol_dbl( HYPRE_Solver solver, HYPRE_Int nongalerk_num_tol, hypre_double *nongalerk_tol ); +HYPRE_Int +HYPRE_BoomerAMGSetNonGalerkTol_long_dbl( HYPRE_Solver solver, HYPRE_Int nongalerk_num_tol, hypre_long_double *nongalerk_tol ); +HYPRE_Int +HYPRE_BoomerAMGSetNonGalerkTol( HYPRE_Solver solver, HYPRE_Int nongalerk_num_tol, void *nongalerk_tol ); + +HYPRE_Int +HYPRE_BoomerAMGSetNonGalerkinTol_flt( HYPRE_Solver solver, hypre_float nongalerkin_tol ); +HYPRE_Int +HYPRE_BoomerAMGSetNonGalerkinTol_dbl( HYPRE_Solver solver, hypre_double nongalerkin_tol ); +HYPRE_Int +HYPRE_BoomerAMGSetNonGalerkinTol_long_dbl( HYPRE_Solver solver, hypre_long_double nongalerkin_tol ); +HYPRE_Int +HYPRE_BoomerAMGSetNonGalerkinTol( HYPRE_Solver solver, hypre_long_double nongalerkin_tol ); + +HYPRE_Int +HYPRE_BoomerAMGSetNumCRRelaxSteps_flt( HYPRE_Solver solver, HYPRE_Int num_CR_relax_steps ); +HYPRE_Int +HYPRE_BoomerAMGSetNumCRRelaxSteps_dbl( HYPRE_Solver solver, HYPRE_Int num_CR_relax_steps ); +HYPRE_Int +HYPRE_BoomerAMGSetNumCRRelaxSteps_long_dbl( HYPRE_Solver solver, HYPRE_Int num_CR_relax_steps ); +HYPRE_Int +HYPRE_BoomerAMGSetNumCRRelaxSteps( HYPRE_Solver solver, HYPRE_Int num_CR_relax_steps ); + +HYPRE_Int +HYPRE_BoomerAMGSetNumFunctions_flt( HYPRE_Solver solver, HYPRE_Int num_functions ); +HYPRE_Int +HYPRE_BoomerAMGSetNumFunctions_dbl( HYPRE_Solver solver, HYPRE_Int num_functions ); +HYPRE_Int +HYPRE_BoomerAMGSetNumFunctions_long_dbl( HYPRE_Solver solver, HYPRE_Int num_functions ); +HYPRE_Int +HYPRE_BoomerAMGSetNumFunctions( HYPRE_Solver solver, HYPRE_Int num_functions ); + +HYPRE_Int +HYPRE_BoomerAMGSetNumGridSweeps_flt( HYPRE_Solver solver, HYPRE_Int *num_grid_sweeps ); +HYPRE_Int +HYPRE_BoomerAMGSetNumGridSweeps_dbl( HYPRE_Solver solver, HYPRE_Int *num_grid_sweeps ); +HYPRE_Int +HYPRE_BoomerAMGSetNumGridSweeps_long_dbl( HYPRE_Solver solver, HYPRE_Int *num_grid_sweeps ); +HYPRE_Int +HYPRE_BoomerAMGSetNumGridSweeps( HYPRE_Solver solver, HYPRE_Int *num_grid_sweeps ); + +HYPRE_Int +HYPRE_BoomerAMGSetNumPaths_flt( HYPRE_Solver solver, HYPRE_Int num_paths ); +HYPRE_Int +HYPRE_BoomerAMGSetNumPaths_dbl( HYPRE_Solver solver, HYPRE_Int num_paths ); +HYPRE_Int +HYPRE_BoomerAMGSetNumPaths_long_dbl( HYPRE_Solver solver, HYPRE_Int num_paths ); +HYPRE_Int +HYPRE_BoomerAMGSetNumPaths( HYPRE_Solver solver, HYPRE_Int num_paths ); + +HYPRE_Int +HYPRE_BoomerAMGSetNumSamples_flt( HYPRE_Solver solver, HYPRE_Int num_samples ); +HYPRE_Int +HYPRE_BoomerAMGSetNumSamples_dbl( HYPRE_Solver solver, HYPRE_Int num_samples ); +HYPRE_Int +HYPRE_BoomerAMGSetNumSamples_long_dbl( HYPRE_Solver solver, HYPRE_Int num_samples ); +HYPRE_Int +HYPRE_BoomerAMGSetNumSamples( HYPRE_Solver solver, HYPRE_Int num_samples ); + +HYPRE_Int +HYPRE_BoomerAMGSetNumSweeps_flt( HYPRE_Solver solver, HYPRE_Int num_sweeps ); +HYPRE_Int +HYPRE_BoomerAMGSetNumSweeps_dbl( HYPRE_Solver solver, HYPRE_Int num_sweeps ); +HYPRE_Int +HYPRE_BoomerAMGSetNumSweeps_long_dbl( HYPRE_Solver solver, HYPRE_Int num_sweeps ); +HYPRE_Int +HYPRE_BoomerAMGSetNumSweeps( HYPRE_Solver solver, HYPRE_Int num_sweeps ); + +HYPRE_Int +HYPRE_BoomerAMGSetOldDefault_flt( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_BoomerAMGSetOldDefault_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_BoomerAMGSetOldDefault_long_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_BoomerAMGSetOldDefault( HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_BoomerAMGSetOmega_flt( HYPRE_Solver solver, hypre_float *omega ); +HYPRE_Int +HYPRE_BoomerAMGSetOmega_dbl( HYPRE_Solver solver, hypre_double *omega ); +HYPRE_Int +HYPRE_BoomerAMGSetOmega_long_dbl( HYPRE_Solver solver, hypre_long_double *omega ); +HYPRE_Int +HYPRE_BoomerAMGSetOmega( HYPRE_Solver solver, void *omega ); + +HYPRE_Int +HYPRE_BoomerAMGSetOuterWt_flt( HYPRE_Solver solver, hypre_float omega ); +HYPRE_Int +HYPRE_BoomerAMGSetOuterWt_dbl( HYPRE_Solver solver, hypre_double omega ); +HYPRE_Int +HYPRE_BoomerAMGSetOuterWt_long_dbl( HYPRE_Solver solver, hypre_long_double omega ); +HYPRE_Int +HYPRE_BoomerAMGSetOuterWt( HYPRE_Solver solver, hypre_long_double omega ); + +HYPRE_Int +HYPRE_BoomerAMGSetOverlap_flt( HYPRE_Solver solver, HYPRE_Int overlap ); +HYPRE_Int +HYPRE_BoomerAMGSetOverlap_dbl( HYPRE_Solver solver, HYPRE_Int overlap ); +HYPRE_Int +HYPRE_BoomerAMGSetOverlap_long_dbl( HYPRE_Solver solver, HYPRE_Int overlap ); +HYPRE_Int +HYPRE_BoomerAMGSetOverlap( HYPRE_Solver solver, HYPRE_Int overlap ); + +HYPRE_Int +HYPRE_BoomerAMGSetPMaxElmts_flt( HYPRE_Solver solver, HYPRE_Int P_max_elmts ); +HYPRE_Int +HYPRE_BoomerAMGSetPMaxElmts_dbl( HYPRE_Solver solver, HYPRE_Int P_max_elmts ); +HYPRE_Int +HYPRE_BoomerAMGSetPMaxElmts_long_dbl( HYPRE_Solver solver, HYPRE_Int P_max_elmts ); +HYPRE_Int +HYPRE_BoomerAMGSetPMaxElmts( HYPRE_Solver solver, HYPRE_Int P_max_elmts ); + +HYPRE_Int +HYPRE_BoomerAMGSetPlotFileName_flt( HYPRE_Solver solver, const char *plotfilename ); +HYPRE_Int +HYPRE_BoomerAMGSetPlotFileName_dbl( HYPRE_Solver solver, const char *plotfilename ); +HYPRE_Int +HYPRE_BoomerAMGSetPlotFileName_long_dbl( HYPRE_Solver solver, const char *plotfilename ); +HYPRE_Int +HYPRE_BoomerAMGSetPlotFileName( HYPRE_Solver solver, const char *plotfilename ); + +HYPRE_Int +HYPRE_BoomerAMGSetPlotGrids_flt( HYPRE_Solver solver, HYPRE_Int plotgrids ); +HYPRE_Int +HYPRE_BoomerAMGSetPlotGrids_dbl( HYPRE_Solver solver, HYPRE_Int plotgrids ); +HYPRE_Int +HYPRE_BoomerAMGSetPlotGrids_long_dbl( HYPRE_Solver solver, HYPRE_Int plotgrids ); +HYPRE_Int +HYPRE_BoomerAMGSetPlotGrids( HYPRE_Solver solver, HYPRE_Int plotgrids ); + +HYPRE_Int +HYPRE_BoomerAMGSetPostInterpType_flt( HYPRE_Solver solver, HYPRE_Int post_interp_type ); +HYPRE_Int +HYPRE_BoomerAMGSetPostInterpType_dbl( HYPRE_Solver solver, HYPRE_Int post_interp_type ); +HYPRE_Int +HYPRE_BoomerAMGSetPostInterpType_long_dbl( HYPRE_Solver solver, HYPRE_Int post_interp_type ); +HYPRE_Int +HYPRE_BoomerAMGSetPostInterpType( HYPRE_Solver solver, HYPRE_Int post_interp_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetPrintFileName_flt( HYPRE_Solver solver, const char *print_file_name ); +HYPRE_Int +HYPRE_BoomerAMGSetPrintFileName_dbl( HYPRE_Solver solver, const char *print_file_name ); +HYPRE_Int +HYPRE_BoomerAMGSetPrintFileName_long_dbl( HYPRE_Solver solver, const char *print_file_name ); +HYPRE_Int +HYPRE_BoomerAMGSetPrintFileName( HYPRE_Solver solver, const char *print_file_name ); + +HYPRE_Int +HYPRE_BoomerAMGSetPrintLevel_flt( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_BoomerAMGSetPrintLevel_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_BoomerAMGSetPrintLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_BoomerAMGSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_BoomerAMGSetRAP2_flt( HYPRE_Solver solver, HYPRE_Int rap2 ); +HYPRE_Int +HYPRE_BoomerAMGSetRAP2_dbl( HYPRE_Solver solver, HYPRE_Int rap2 ); +HYPRE_Int +HYPRE_BoomerAMGSetRAP2_long_dbl( HYPRE_Solver solver, HYPRE_Int rap2 ); +HYPRE_Int +HYPRE_BoomerAMGSetRAP2( HYPRE_Solver solver, HYPRE_Int rap2 ); + +HYPRE_Int +HYPRE_BoomerAMGSetRedundant_flt( HYPRE_Solver solver, HYPRE_Int redundant ); +HYPRE_Int +HYPRE_BoomerAMGSetRedundant_dbl( HYPRE_Solver solver, HYPRE_Int redundant ); +HYPRE_Int +HYPRE_BoomerAMGSetRedundant_long_dbl( HYPRE_Solver solver, HYPRE_Int redundant ); +HYPRE_Int +HYPRE_BoomerAMGSetRedundant( HYPRE_Solver solver, HYPRE_Int redundant ); + +HYPRE_Int +HYPRE_BoomerAMGSetRelaxOrder_flt( HYPRE_Solver solver, HYPRE_Int relax_order ); +HYPRE_Int +HYPRE_BoomerAMGSetRelaxOrder_dbl( HYPRE_Solver solver, HYPRE_Int relax_order ); +HYPRE_Int +HYPRE_BoomerAMGSetRelaxOrder_long_dbl( HYPRE_Solver solver, HYPRE_Int relax_order ); +HYPRE_Int +HYPRE_BoomerAMGSetRelaxOrder( HYPRE_Solver solver, HYPRE_Int relax_order ); + +HYPRE_Int +HYPRE_BoomerAMGSetRelaxType_flt( HYPRE_Solver solver, HYPRE_Int relax_type ); +HYPRE_Int +HYPRE_BoomerAMGSetRelaxType_dbl( HYPRE_Solver solver, HYPRE_Int relax_type ); +HYPRE_Int +HYPRE_BoomerAMGSetRelaxType_long_dbl( HYPRE_Solver solver, HYPRE_Int relax_type ); +HYPRE_Int +HYPRE_BoomerAMGSetRelaxType( HYPRE_Solver solver, HYPRE_Int relax_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetRelaxWeight_flt( HYPRE_Solver solver, hypre_float *relax_weight ); +HYPRE_Int +HYPRE_BoomerAMGSetRelaxWeight_dbl( HYPRE_Solver solver, hypre_double *relax_weight ); +HYPRE_Int +HYPRE_BoomerAMGSetRelaxWeight_long_dbl( HYPRE_Solver solver, hypre_long_double *relax_weight ); +HYPRE_Int +HYPRE_BoomerAMGSetRelaxWeight( HYPRE_Solver solver, void *relax_weight ); + +HYPRE_Int +HYPRE_BoomerAMGSetRelaxWt_flt( HYPRE_Solver solver, hypre_float relax_weight ); +HYPRE_Int +HYPRE_BoomerAMGSetRelaxWt_dbl( HYPRE_Solver solver, hypre_double relax_weight ); +HYPRE_Int +HYPRE_BoomerAMGSetRelaxWt_long_dbl( HYPRE_Solver solver, hypre_long_double relax_weight ); +HYPRE_Int +HYPRE_BoomerAMGSetRelaxWt( HYPRE_Solver solver, hypre_long_double relax_weight ); + +HYPRE_Int +HYPRE_BoomerAMGSetRestriction_flt( HYPRE_Solver solver, HYPRE_Int restr_par ); +HYPRE_Int +HYPRE_BoomerAMGSetRestriction_dbl( HYPRE_Solver solver, HYPRE_Int restr_par ); +HYPRE_Int +HYPRE_BoomerAMGSetRestriction_long_dbl( HYPRE_Solver solver, HYPRE_Int restr_par ); +HYPRE_Int +HYPRE_BoomerAMGSetRestriction( HYPRE_Solver solver, HYPRE_Int restr_par ); + +HYPRE_Int +HYPRE_BoomerAMGSetSCommPkgSwitch_flt( HYPRE_Solver solver, hypre_float S_commpkg_switch ); +HYPRE_Int +HYPRE_BoomerAMGSetSCommPkgSwitch_dbl( HYPRE_Solver solver, hypre_double S_commpkg_switch ); +HYPRE_Int +HYPRE_BoomerAMGSetSCommPkgSwitch_long_dbl( HYPRE_Solver solver, hypre_long_double S_commpkg_switch ); +HYPRE_Int +HYPRE_BoomerAMGSetSCommPkgSwitch( HYPRE_Solver solver, hypre_long_double S_commpkg_switch ); + +HYPRE_Int +HYPRE_BoomerAMGSetSabs_flt( HYPRE_Solver solver, HYPRE_Int Sabs ); +HYPRE_Int +HYPRE_BoomerAMGSetSabs_dbl( HYPRE_Solver solver, HYPRE_Int Sabs ); +HYPRE_Int +HYPRE_BoomerAMGSetSabs_long_dbl( HYPRE_Solver solver, HYPRE_Int Sabs ); +HYPRE_Int +HYPRE_BoomerAMGSetSabs( HYPRE_Solver solver, HYPRE_Int Sabs ); + +HYPRE_Int +HYPRE_BoomerAMGSetSchwarzRlxWeight_flt( HYPRE_Solver solver, hypre_float schwarz_rlx_weight ); +HYPRE_Int +HYPRE_BoomerAMGSetSchwarzRlxWeight_dbl( HYPRE_Solver solver, hypre_double schwarz_rlx_weight ); +HYPRE_Int +HYPRE_BoomerAMGSetSchwarzRlxWeight_long_dbl( HYPRE_Solver solver, hypre_long_double schwarz_rlx_weight ); +HYPRE_Int +HYPRE_BoomerAMGSetSchwarzRlxWeight( HYPRE_Solver solver, hypre_long_double schwarz_rlx_weight ); + +HYPRE_Int +HYPRE_BoomerAMGSetSchwarzUseNonSymm_flt( HYPRE_Solver solver, HYPRE_Int use_nonsymm ); +HYPRE_Int +HYPRE_BoomerAMGSetSchwarzUseNonSymm_dbl( HYPRE_Solver solver, HYPRE_Int use_nonsymm ); +HYPRE_Int +HYPRE_BoomerAMGSetSchwarzUseNonSymm_long_dbl( HYPRE_Solver solver, HYPRE_Int use_nonsymm ); +HYPRE_Int +HYPRE_BoomerAMGSetSchwarzUseNonSymm( HYPRE_Solver solver, HYPRE_Int use_nonsymm ); + +HYPRE_Int +HYPRE_BoomerAMGSetSepWeight_flt( HYPRE_Solver solver, HYPRE_Int sep_weight ); +HYPRE_Int +HYPRE_BoomerAMGSetSepWeight_dbl( HYPRE_Solver solver, HYPRE_Int sep_weight ); +HYPRE_Int +HYPRE_BoomerAMGSetSepWeight_long_dbl( HYPRE_Solver solver, HYPRE_Int sep_weight ); +HYPRE_Int +HYPRE_BoomerAMGSetSepWeight( HYPRE_Solver solver, HYPRE_Int sep_weight ); + +HYPRE_Int +HYPRE_BoomerAMGSetSeqThreshold_flt( HYPRE_Solver solver, HYPRE_Int seq_threshold ); +HYPRE_Int +HYPRE_BoomerAMGSetSeqThreshold_dbl( HYPRE_Solver solver, HYPRE_Int seq_threshold ); +HYPRE_Int +HYPRE_BoomerAMGSetSeqThreshold_long_dbl( HYPRE_Solver solver, HYPRE_Int seq_threshold ); +HYPRE_Int +HYPRE_BoomerAMGSetSeqThreshold( HYPRE_Solver solver, HYPRE_Int seq_threshold ); + +HYPRE_Int +HYPRE_BoomerAMGSetSetupType_flt( HYPRE_Solver solver, HYPRE_Int setup_type ); +HYPRE_Int +HYPRE_BoomerAMGSetSetupType_dbl( HYPRE_Solver solver, HYPRE_Int setup_type ); +HYPRE_Int +HYPRE_BoomerAMGSetSetupType_long_dbl( HYPRE_Solver solver, HYPRE_Int setup_type ); +HYPRE_Int +HYPRE_BoomerAMGSetSetupType( HYPRE_Solver solver, HYPRE_Int setup_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetSimple_flt( HYPRE_Solver solver, HYPRE_Int addlvl ); +HYPRE_Int +HYPRE_BoomerAMGSetSimple_dbl( HYPRE_Solver solver, HYPRE_Int addlvl ); +HYPRE_Int +HYPRE_BoomerAMGSetSimple_long_dbl( HYPRE_Solver solver, HYPRE_Int addlvl ); +HYPRE_Int +HYPRE_BoomerAMGSetSimple( HYPRE_Solver solver, HYPRE_Int addlvl ); + +HYPRE_Int +HYPRE_BoomerAMGSetSmoothInterpVectors_flt( HYPRE_Solver solver, HYPRE_Int smooth_interp_vectors ); +HYPRE_Int +HYPRE_BoomerAMGSetSmoothInterpVectors_dbl( HYPRE_Solver solver, HYPRE_Int smooth_interp_vectors ); +HYPRE_Int +HYPRE_BoomerAMGSetSmoothInterpVectors_long_dbl( HYPRE_Solver solver, HYPRE_Int smooth_interp_vectors ); +HYPRE_Int +HYPRE_BoomerAMGSetSmoothInterpVectors( HYPRE_Solver solver, HYPRE_Int smooth_interp_vectors ); + +HYPRE_Int +HYPRE_BoomerAMGSetSmoothNumLevels_flt( HYPRE_Solver solver, HYPRE_Int smooth_num_levels ); +HYPRE_Int +HYPRE_BoomerAMGSetSmoothNumLevels_dbl( HYPRE_Solver solver, HYPRE_Int smooth_num_levels ); +HYPRE_Int +HYPRE_BoomerAMGSetSmoothNumLevels_long_dbl( HYPRE_Solver solver, HYPRE_Int smooth_num_levels ); +HYPRE_Int +HYPRE_BoomerAMGSetSmoothNumLevels( HYPRE_Solver solver, HYPRE_Int smooth_num_levels ); + +HYPRE_Int +HYPRE_BoomerAMGSetSmoothNumSweeps_flt( HYPRE_Solver solver, HYPRE_Int smooth_num_sweeps ); +HYPRE_Int +HYPRE_BoomerAMGSetSmoothNumSweeps_dbl( HYPRE_Solver solver, HYPRE_Int smooth_num_sweeps ); +HYPRE_Int +HYPRE_BoomerAMGSetSmoothNumSweeps_long_dbl( HYPRE_Solver solver, HYPRE_Int smooth_num_sweeps ); +HYPRE_Int +HYPRE_BoomerAMGSetSmoothNumSweeps( HYPRE_Solver solver, HYPRE_Int smooth_num_sweeps ); + +HYPRE_Int +HYPRE_BoomerAMGSetSmoothType_flt( HYPRE_Solver solver, HYPRE_Int smooth_type ); +HYPRE_Int +HYPRE_BoomerAMGSetSmoothType_dbl( HYPRE_Solver solver, HYPRE_Int smooth_type ); +HYPRE_Int +HYPRE_BoomerAMGSetSmoothType_long_dbl( HYPRE_Solver solver, HYPRE_Int smooth_type ); +HYPRE_Int +HYPRE_BoomerAMGSetSmoothType( HYPRE_Solver solver, HYPRE_Int smooth_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetStrongThreshold_flt( HYPRE_Solver solver, hypre_float strong_threshold ); +HYPRE_Int +HYPRE_BoomerAMGSetStrongThreshold_dbl( HYPRE_Solver solver, hypre_double strong_threshold ); +HYPRE_Int +HYPRE_BoomerAMGSetStrongThreshold_long_dbl( HYPRE_Solver solver, hypre_long_double strong_threshold ); +HYPRE_Int +HYPRE_BoomerAMGSetStrongThreshold( HYPRE_Solver solver, hypre_long_double strong_threshold ); + +HYPRE_Int +HYPRE_BoomerAMGSetStrongThresholdR_flt( HYPRE_Solver solver, hypre_float strong_threshold ); +HYPRE_Int +HYPRE_BoomerAMGSetStrongThresholdR_dbl( HYPRE_Solver solver, hypre_double strong_threshold ); +HYPRE_Int +HYPRE_BoomerAMGSetStrongThresholdR_long_dbl( HYPRE_Solver solver, hypre_long_double strong_threshold ); +HYPRE_Int +HYPRE_BoomerAMGSetStrongThresholdR( HYPRE_Solver solver, hypre_long_double strong_threshold ); + +HYPRE_Int +HYPRE_BoomerAMGSetSym_flt( HYPRE_Solver solver, HYPRE_Int sym ); +HYPRE_Int +HYPRE_BoomerAMGSetSym_dbl( HYPRE_Solver solver, HYPRE_Int sym ); +HYPRE_Int +HYPRE_BoomerAMGSetSym_long_dbl( HYPRE_Solver solver, HYPRE_Int sym ); +HYPRE_Int +HYPRE_BoomerAMGSetSym( HYPRE_Solver solver, HYPRE_Int sym ); + +HYPRE_Int +HYPRE_BoomerAMGSetThreshold_flt( HYPRE_Solver solver, hypre_float threshold ); +HYPRE_Int +HYPRE_BoomerAMGSetThreshold_dbl( HYPRE_Solver solver, hypre_double threshold ); +HYPRE_Int +HYPRE_BoomerAMGSetThreshold_long_dbl( HYPRE_Solver solver, hypre_long_double threshold ); +HYPRE_Int +HYPRE_BoomerAMGSetThreshold( HYPRE_Solver solver, hypre_long_double threshold ); + +HYPRE_Int +HYPRE_BoomerAMGSetTol_flt( HYPRE_Solver solver, hypre_float tol ); +HYPRE_Int +HYPRE_BoomerAMGSetTol_dbl( HYPRE_Solver solver, hypre_double tol ); +HYPRE_Int +HYPRE_BoomerAMGSetTol_long_dbl( HYPRE_Solver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_BoomerAMGSetTol( HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_BoomerAMGSetTruncFactor_flt( HYPRE_Solver solver, hypre_float trunc_factor ); +HYPRE_Int +HYPRE_BoomerAMGSetTruncFactor_dbl( HYPRE_Solver solver, hypre_double trunc_factor ); +HYPRE_Int +HYPRE_BoomerAMGSetTruncFactor_long_dbl( HYPRE_Solver solver, hypre_long_double trunc_factor ); +HYPRE_Int +HYPRE_BoomerAMGSetTruncFactor( HYPRE_Solver solver, hypre_long_double trunc_factor ); + +HYPRE_Int +HYPRE_BoomerAMGSetVariant_flt( HYPRE_Solver solver, HYPRE_Int variant ); +HYPRE_Int +HYPRE_BoomerAMGSetVariant_dbl( HYPRE_Solver solver, HYPRE_Int variant ); +HYPRE_Int +HYPRE_BoomerAMGSetVariant_long_dbl( HYPRE_Solver solver, HYPRE_Int variant ); +HYPRE_Int +HYPRE_BoomerAMGSetVariant( HYPRE_Solver solver, HYPRE_Int variant ); + +HYPRE_Int +HYPRE_BoomerAMGSetup_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_BoomerAMGSetup_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_BoomerAMGSetup_long_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_BoomerAMGSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_BoomerAMGSolve_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_BoomerAMGSolve_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_BoomerAMGSolve_long_dbl( 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_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_BoomerAMGSolveT_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_BoomerAMGSolveT_long_dbl( 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_EuclidCreate_flt( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_EuclidCreate_dbl( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_EuclidCreate_long_dbl( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_EuclidCreate( MPI_Comm comm, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_EuclidDestroy_flt( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_EuclidDestroy_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_EuclidDestroy_long_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_EuclidDestroy( HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_EuclidSetBJ_flt( HYPRE_Solver solver, HYPRE_Int bj ); +HYPRE_Int +HYPRE_EuclidSetBJ_dbl( HYPRE_Solver solver, HYPRE_Int bj ); +HYPRE_Int +HYPRE_EuclidSetBJ_long_dbl( HYPRE_Solver solver, HYPRE_Int bj ); +HYPRE_Int +HYPRE_EuclidSetBJ( HYPRE_Solver solver, HYPRE_Int bj ); + +HYPRE_Int +HYPRE_EuclidSetILUT_flt( HYPRE_Solver solver, hypre_float drop_tol ); +HYPRE_Int +HYPRE_EuclidSetILUT_dbl( HYPRE_Solver solver, hypre_double drop_tol ); +HYPRE_Int +HYPRE_EuclidSetILUT_long_dbl( HYPRE_Solver solver, hypre_long_double drop_tol ); +HYPRE_Int +HYPRE_EuclidSetILUT( HYPRE_Solver solver, hypre_long_double drop_tol ); + +HYPRE_Int +HYPRE_EuclidSetLevel_flt( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_EuclidSetLevel_dbl( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_EuclidSetLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_EuclidSetLevel( HYPRE_Solver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_EuclidSetMem_flt( HYPRE_Solver solver, HYPRE_Int eu_mem ); +HYPRE_Int +HYPRE_EuclidSetMem_dbl( HYPRE_Solver solver, HYPRE_Int eu_mem ); +HYPRE_Int +HYPRE_EuclidSetMem_long_dbl( HYPRE_Solver solver, HYPRE_Int eu_mem ); +HYPRE_Int +HYPRE_EuclidSetMem( HYPRE_Solver solver, HYPRE_Int eu_mem ); + +HYPRE_Int +HYPRE_EuclidSetParams_flt( HYPRE_Solver solver, HYPRE_Int argc, char *argv[] ); +HYPRE_Int +HYPRE_EuclidSetParams_dbl( HYPRE_Solver solver, HYPRE_Int argc, char *argv[] ); +HYPRE_Int +HYPRE_EuclidSetParams_long_dbl( HYPRE_Solver solver, HYPRE_Int argc, char *argv[] ); +HYPRE_Int +HYPRE_EuclidSetParams( HYPRE_Solver solver, HYPRE_Int argc, char *argv[] ); + +HYPRE_Int +HYPRE_EuclidSetParamsFromFile_flt( HYPRE_Solver solver, char *filename ); +HYPRE_Int +HYPRE_EuclidSetParamsFromFile_dbl( HYPRE_Solver solver, char *filename ); +HYPRE_Int +HYPRE_EuclidSetParamsFromFile_long_dbl( HYPRE_Solver solver, char *filename ); +HYPRE_Int +HYPRE_EuclidSetParamsFromFile( HYPRE_Solver solver, char *filename ); + +HYPRE_Int +HYPRE_EuclidSetRowScale_flt( HYPRE_Solver solver, HYPRE_Int row_scale ); +HYPRE_Int +HYPRE_EuclidSetRowScale_dbl( HYPRE_Solver solver, HYPRE_Int row_scale ); +HYPRE_Int +HYPRE_EuclidSetRowScale_long_dbl( HYPRE_Solver solver, HYPRE_Int row_scale ); +HYPRE_Int +HYPRE_EuclidSetRowScale( HYPRE_Solver solver, HYPRE_Int row_scale ); + +HYPRE_Int +HYPRE_EuclidSetSparseA_flt( HYPRE_Solver solver, hypre_float sparse_A ); +HYPRE_Int +HYPRE_EuclidSetSparseA_dbl( HYPRE_Solver solver, hypre_double sparse_A ); +HYPRE_Int +HYPRE_EuclidSetSparseA_long_dbl( HYPRE_Solver solver, hypre_long_double sparse_A ); +HYPRE_Int +HYPRE_EuclidSetSparseA( HYPRE_Solver solver, hypre_long_double sparse_A ); + +HYPRE_Int +HYPRE_EuclidSetStats_flt( HYPRE_Solver solver, HYPRE_Int eu_stats ); +HYPRE_Int +HYPRE_EuclidSetStats_dbl( HYPRE_Solver solver, HYPRE_Int eu_stats ); +HYPRE_Int +HYPRE_EuclidSetStats_long_dbl( HYPRE_Solver solver, HYPRE_Int eu_stats ); +HYPRE_Int +HYPRE_EuclidSetStats( HYPRE_Solver solver, HYPRE_Int eu_stats ); + +HYPRE_Int +HYPRE_EuclidSetup_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_EuclidSetup_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_EuclidSetup_long_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_EuclidSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_EuclidSolve_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_EuclidSolve_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_EuclidSolve_long_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_EuclidSolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_FSAICreate_flt( HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_FSAICreate_dbl( HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_FSAICreate_long_dbl( HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_FSAICreate( HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_FSAIDestroy_flt( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_FSAIDestroy_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_FSAIDestroy_long_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_FSAIDestroy( HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_FSAISetAlgoType_flt( HYPRE_Solver solver, HYPRE_Int algo_type ); +HYPRE_Int +HYPRE_FSAISetAlgoType_dbl( HYPRE_Solver solver, HYPRE_Int algo_type ); +HYPRE_Int +HYPRE_FSAISetAlgoType_long_dbl( HYPRE_Solver solver, HYPRE_Int algo_type ); +HYPRE_Int +HYPRE_FSAISetAlgoType( HYPRE_Solver solver, HYPRE_Int algo_type ); + +HYPRE_Int +HYPRE_FSAISetEigMaxIters_flt( HYPRE_Solver solver, HYPRE_Int eig_max_iters ); +HYPRE_Int +HYPRE_FSAISetEigMaxIters_dbl( HYPRE_Solver solver, HYPRE_Int eig_max_iters ); +HYPRE_Int +HYPRE_FSAISetEigMaxIters_long_dbl( HYPRE_Solver solver, HYPRE_Int eig_max_iters ); +HYPRE_Int +HYPRE_FSAISetEigMaxIters( HYPRE_Solver solver, HYPRE_Int eig_max_iters ); + +HYPRE_Int +HYPRE_FSAISetKapTolerance_flt( HYPRE_Solver solver, hypre_float kap_tolerance ); +HYPRE_Int +HYPRE_FSAISetKapTolerance_dbl( HYPRE_Solver solver, hypre_double kap_tolerance ); +HYPRE_Int +HYPRE_FSAISetKapTolerance_long_dbl( HYPRE_Solver solver, hypre_long_double kap_tolerance ); +HYPRE_Int +HYPRE_FSAISetKapTolerance( HYPRE_Solver solver, hypre_long_double kap_tolerance ); + +HYPRE_Int +HYPRE_FSAISetLocalSolveType_flt( HYPRE_Solver solver, HYPRE_Int local_solve_type ); +HYPRE_Int +HYPRE_FSAISetLocalSolveType_dbl( HYPRE_Solver solver, HYPRE_Int local_solve_type ); +HYPRE_Int +HYPRE_FSAISetLocalSolveType_long_dbl( HYPRE_Solver solver, HYPRE_Int local_solve_type ); +HYPRE_Int +HYPRE_FSAISetLocalSolveType( HYPRE_Solver solver, HYPRE_Int local_solve_type ); + +HYPRE_Int +HYPRE_FSAISetMaxIterations_flt( HYPRE_Solver solver, HYPRE_Int max_iterations ); +HYPRE_Int +HYPRE_FSAISetMaxIterations_dbl( HYPRE_Solver solver, HYPRE_Int max_iterations ); +HYPRE_Int +HYPRE_FSAISetMaxIterations_long_dbl( HYPRE_Solver solver, HYPRE_Int max_iterations ); +HYPRE_Int +HYPRE_FSAISetMaxIterations( HYPRE_Solver solver, HYPRE_Int max_iterations ); + +HYPRE_Int +HYPRE_FSAISetMaxNnzRow_flt( HYPRE_Solver solver, HYPRE_Int max_nnz_row ); +HYPRE_Int +HYPRE_FSAISetMaxNnzRow_dbl( HYPRE_Solver solver, HYPRE_Int max_nnz_row ); +HYPRE_Int +HYPRE_FSAISetMaxNnzRow_long_dbl( HYPRE_Solver solver, HYPRE_Int max_nnz_row ); +HYPRE_Int +HYPRE_FSAISetMaxNnzRow( HYPRE_Solver solver, HYPRE_Int max_nnz_row ); + +HYPRE_Int +HYPRE_FSAISetMaxStepSize_flt( HYPRE_Solver solver, HYPRE_Int max_step_size ); +HYPRE_Int +HYPRE_FSAISetMaxStepSize_dbl( HYPRE_Solver solver, HYPRE_Int max_step_size ); +HYPRE_Int +HYPRE_FSAISetMaxStepSize_long_dbl( HYPRE_Solver solver, HYPRE_Int max_step_size ); +HYPRE_Int +HYPRE_FSAISetMaxStepSize( HYPRE_Solver solver, HYPRE_Int max_step_size ); + +HYPRE_Int +HYPRE_FSAISetMaxSteps_flt( HYPRE_Solver solver, HYPRE_Int max_steps ); +HYPRE_Int +HYPRE_FSAISetMaxSteps_dbl( HYPRE_Solver solver, HYPRE_Int max_steps ); +HYPRE_Int +HYPRE_FSAISetMaxSteps_long_dbl( HYPRE_Solver solver, HYPRE_Int max_steps ); +HYPRE_Int +HYPRE_FSAISetMaxSteps( HYPRE_Solver solver, HYPRE_Int max_steps ); + +HYPRE_Int +HYPRE_FSAISetNumLevels_flt( HYPRE_Solver solver, HYPRE_Int num_levels ); +HYPRE_Int +HYPRE_FSAISetNumLevels_dbl( HYPRE_Solver solver, HYPRE_Int num_levels ); +HYPRE_Int +HYPRE_FSAISetNumLevels_long_dbl( HYPRE_Solver solver, HYPRE_Int num_levels ); +HYPRE_Int +HYPRE_FSAISetNumLevels( HYPRE_Solver solver, HYPRE_Int num_levels ); + +HYPRE_Int +HYPRE_FSAISetOmega_flt( HYPRE_Solver solver, hypre_float omega ); +HYPRE_Int +HYPRE_FSAISetOmega_dbl( HYPRE_Solver solver, hypre_double omega ); +HYPRE_Int +HYPRE_FSAISetOmega_long_dbl( HYPRE_Solver solver, hypre_long_double omega ); +HYPRE_Int +HYPRE_FSAISetOmega( HYPRE_Solver solver, hypre_long_double omega ); + +HYPRE_Int +HYPRE_FSAISetPrintLevel_flt( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_FSAISetPrintLevel_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_FSAISetPrintLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_FSAISetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_FSAISetThreshold_flt( HYPRE_Solver solver, hypre_float threshold ); +HYPRE_Int +HYPRE_FSAISetThreshold_dbl( HYPRE_Solver solver, hypre_double threshold ); +HYPRE_Int +HYPRE_FSAISetThreshold_long_dbl( HYPRE_Solver solver, hypre_long_double threshold ); +HYPRE_Int +HYPRE_FSAISetThreshold( HYPRE_Solver solver, hypre_long_double threshold ); + +HYPRE_Int +HYPRE_FSAISetTolerance_flt( HYPRE_Solver solver, hypre_float tolerance ); +HYPRE_Int +HYPRE_FSAISetTolerance_dbl( HYPRE_Solver solver, hypre_double tolerance ); +HYPRE_Int +HYPRE_FSAISetTolerance_long_dbl( HYPRE_Solver solver, hypre_long_double tolerance ); +HYPRE_Int +HYPRE_FSAISetTolerance( HYPRE_Solver solver, hypre_long_double tolerance ); + +HYPRE_Int +HYPRE_FSAISetZeroGuess_flt( HYPRE_Solver solver, HYPRE_Int zero_guess ); +HYPRE_Int +HYPRE_FSAISetZeroGuess_dbl( HYPRE_Solver solver, HYPRE_Int zero_guess ); +HYPRE_Int +HYPRE_FSAISetZeroGuess_long_dbl( HYPRE_Solver solver, HYPRE_Int zero_guess ); +HYPRE_Int +HYPRE_FSAISetZeroGuess( HYPRE_Solver solver, HYPRE_Int zero_guess ); + +HYPRE_Int +HYPRE_FSAISetup_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_FSAISetup_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_FSAISetup_long_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_FSAISetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_FSAISolve_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_FSAISolve_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_FSAISolve_long_dbl( 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_ILUCreate_flt( HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ILUCreate_dbl( HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ILUCreate_long_dbl( HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ILUCreate( HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_ILUDestroy_flt( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ILUDestroy_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ILUDestroy_long_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ILUDestroy( HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_ILUGetFinalRelativeResidualNorm_flt( HYPRE_Solver solver, hypre_float *res_norm ); +HYPRE_Int +HYPRE_ILUGetFinalRelativeResidualNorm_dbl( HYPRE_Solver solver, hypre_double *res_norm ); +HYPRE_Int +HYPRE_ILUGetFinalRelativeResidualNorm_long_dbl( HYPRE_Solver solver, hypre_long_double *res_norm ); +HYPRE_Int +HYPRE_ILUGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *res_norm ); + +HYPRE_Int +HYPRE_ILUGetNumIterations_flt( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_ILUGetNumIterations_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_ILUGetNumIterations_long_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_ILUGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_ILUSetDropThreshold_flt( HYPRE_Solver solver, hypre_float threshold ); +HYPRE_Int +HYPRE_ILUSetDropThreshold_dbl( HYPRE_Solver solver, hypre_double threshold ); +HYPRE_Int +HYPRE_ILUSetDropThreshold_long_dbl( HYPRE_Solver solver, hypre_long_double threshold ); +HYPRE_Int +HYPRE_ILUSetDropThreshold( HYPRE_Solver solver, hypre_long_double threshold ); + +HYPRE_Int +HYPRE_ILUSetDropThresholdArray_flt( HYPRE_Solver solver, hypre_float *threshold ); +HYPRE_Int +HYPRE_ILUSetDropThresholdArray_dbl( HYPRE_Solver solver, hypre_double *threshold ); +HYPRE_Int +HYPRE_ILUSetDropThresholdArray_long_dbl( HYPRE_Solver solver, hypre_long_double *threshold ); +HYPRE_Int +HYPRE_ILUSetDropThresholdArray( HYPRE_Solver solver, void *threshold ); + +HYPRE_Int +HYPRE_ILUSetIterativeSetupMaxIter_flt( HYPRE_Solver solver, HYPRE_Int iter_setup_max_iter ); +HYPRE_Int +HYPRE_ILUSetIterativeSetupMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int iter_setup_max_iter ); +HYPRE_Int +HYPRE_ILUSetIterativeSetupMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int iter_setup_max_iter ); +HYPRE_Int +HYPRE_ILUSetIterativeSetupMaxIter( HYPRE_Solver solver, HYPRE_Int iter_setup_max_iter ); + +HYPRE_Int +HYPRE_ILUSetIterativeSetupOption_flt( HYPRE_Solver solver, HYPRE_Int iter_setup_option ); +HYPRE_Int +HYPRE_ILUSetIterativeSetupOption_dbl( HYPRE_Solver solver, HYPRE_Int iter_setup_option ); +HYPRE_Int +HYPRE_ILUSetIterativeSetupOption_long_dbl( HYPRE_Solver solver, HYPRE_Int iter_setup_option ); +HYPRE_Int +HYPRE_ILUSetIterativeSetupOption( HYPRE_Solver solver, HYPRE_Int iter_setup_option ); + +HYPRE_Int +HYPRE_ILUSetIterativeSetupTolerance_flt( HYPRE_Solver solver, hypre_float iter_setup_tolerance ); +HYPRE_Int +HYPRE_ILUSetIterativeSetupTolerance_dbl( HYPRE_Solver solver, hypre_double iter_setup_tolerance ); +HYPRE_Int +HYPRE_ILUSetIterativeSetupTolerance_long_dbl( HYPRE_Solver solver, hypre_long_double iter_setup_tolerance ); +HYPRE_Int +HYPRE_ILUSetIterativeSetupTolerance( HYPRE_Solver solver, hypre_long_double iter_setup_tolerance ); + +HYPRE_Int +HYPRE_ILUSetIterativeSetupType_flt( HYPRE_Solver solver, HYPRE_Int iter_setup_type ); +HYPRE_Int +HYPRE_ILUSetIterativeSetupType_dbl( HYPRE_Solver solver, HYPRE_Int iter_setup_type ); +HYPRE_Int +HYPRE_ILUSetIterativeSetupType_long_dbl( HYPRE_Solver solver, HYPRE_Int iter_setup_type ); +HYPRE_Int +HYPRE_ILUSetIterativeSetupType( HYPRE_Solver solver, HYPRE_Int iter_setup_type ); + +HYPRE_Int +HYPRE_ILUSetLevelOfFill_flt( HYPRE_Solver solver, HYPRE_Int lfil ); +HYPRE_Int +HYPRE_ILUSetLevelOfFill_dbl( HYPRE_Solver solver, HYPRE_Int lfil ); +HYPRE_Int +HYPRE_ILUSetLevelOfFill_long_dbl( HYPRE_Solver solver, HYPRE_Int lfil ); +HYPRE_Int +HYPRE_ILUSetLevelOfFill( HYPRE_Solver solver, HYPRE_Int lfil ); + +HYPRE_Int +HYPRE_ILUSetLocalReordering_flt( HYPRE_Solver solver, HYPRE_Int reordering_type ); +HYPRE_Int +HYPRE_ILUSetLocalReordering_dbl( HYPRE_Solver solver, HYPRE_Int reordering_type ); +HYPRE_Int +HYPRE_ILUSetLocalReordering_long_dbl( HYPRE_Solver solver, HYPRE_Int reordering_type ); +HYPRE_Int +HYPRE_ILUSetLocalReordering( HYPRE_Solver solver, HYPRE_Int reordering_type ); + +HYPRE_Int +HYPRE_ILUSetLogging_flt( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ILUSetLogging_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ILUSetLogging_long_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ILUSetLogging( HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_ILUSetLowerJacobiIters_flt( HYPRE_Solver solver, HYPRE_Int lower_jacobi_iterations ); +HYPRE_Int +HYPRE_ILUSetLowerJacobiIters_dbl( HYPRE_Solver solver, HYPRE_Int lower_jacobi_iterations ); +HYPRE_Int +HYPRE_ILUSetLowerJacobiIters_long_dbl( HYPRE_Solver solver, HYPRE_Int lower_jacobi_iterations ); +HYPRE_Int +HYPRE_ILUSetLowerJacobiIters( HYPRE_Solver solver, HYPRE_Int lower_jacobi_iterations ); + +HYPRE_Int +HYPRE_ILUSetMaxIter_flt( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_ILUSetMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_ILUSetMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_ILUSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_ILUSetMaxNnzPerRow_flt( HYPRE_Solver solver, HYPRE_Int nzmax ); +HYPRE_Int +HYPRE_ILUSetMaxNnzPerRow_dbl( HYPRE_Solver solver, HYPRE_Int nzmax ); +HYPRE_Int +HYPRE_ILUSetMaxNnzPerRow_long_dbl( HYPRE_Solver solver, HYPRE_Int nzmax ); +HYPRE_Int +HYPRE_ILUSetMaxNnzPerRow( HYPRE_Solver solver, HYPRE_Int nzmax ); + +HYPRE_Int +HYPRE_ILUSetNSHDropThreshold_flt( HYPRE_Solver solver, hypre_float threshold ); +HYPRE_Int +HYPRE_ILUSetNSHDropThreshold_dbl( HYPRE_Solver solver, hypre_double threshold ); +HYPRE_Int +HYPRE_ILUSetNSHDropThreshold_long_dbl( HYPRE_Solver solver, hypre_long_double threshold ); +HYPRE_Int +HYPRE_ILUSetNSHDropThreshold( HYPRE_Solver solver, hypre_long_double threshold ); + +HYPRE_Int +HYPRE_ILUSetNSHDropThresholdArray_flt( HYPRE_Solver solver, hypre_float *threshold ); +HYPRE_Int +HYPRE_ILUSetNSHDropThresholdArray_dbl( HYPRE_Solver solver, hypre_double *threshold ); +HYPRE_Int +HYPRE_ILUSetNSHDropThresholdArray_long_dbl( HYPRE_Solver solver, hypre_long_double *threshold ); +HYPRE_Int +HYPRE_ILUSetNSHDropThresholdArray( HYPRE_Solver solver, void *threshold ); + +HYPRE_Int +HYPRE_ILUSetPrintLevel_flt( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_ILUSetPrintLevel_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_ILUSetPrintLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_ILUSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_ILUSetSchurMaxIter_flt( HYPRE_Solver solver, HYPRE_Int ss_max_iter ); +HYPRE_Int +HYPRE_ILUSetSchurMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int ss_max_iter ); +HYPRE_Int +HYPRE_ILUSetSchurMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int ss_max_iter ); +HYPRE_Int +HYPRE_ILUSetSchurMaxIter( HYPRE_Solver solver, HYPRE_Int ss_max_iter ); + +HYPRE_Int +HYPRE_ILUSetTol_flt( HYPRE_Solver solver, hypre_float tol ); +HYPRE_Int +HYPRE_ILUSetTol_dbl( HYPRE_Solver solver, hypre_double tol ); +HYPRE_Int +HYPRE_ILUSetTol_long_dbl( HYPRE_Solver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_ILUSetTol( HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_ILUSetTriSolve_flt( HYPRE_Solver solver, HYPRE_Int tri_solve ); +HYPRE_Int +HYPRE_ILUSetTriSolve_dbl( HYPRE_Solver solver, HYPRE_Int tri_solve ); +HYPRE_Int +HYPRE_ILUSetTriSolve_long_dbl( HYPRE_Solver solver, HYPRE_Int tri_solve ); +HYPRE_Int +HYPRE_ILUSetTriSolve( HYPRE_Solver solver, HYPRE_Int tri_solve ); + +HYPRE_Int +HYPRE_ILUSetType_flt( HYPRE_Solver solver, HYPRE_Int ilu_type ); +HYPRE_Int +HYPRE_ILUSetType_dbl( HYPRE_Solver solver, HYPRE_Int ilu_type ); +HYPRE_Int +HYPRE_ILUSetType_long_dbl( HYPRE_Solver solver, HYPRE_Int ilu_type ); +HYPRE_Int +HYPRE_ILUSetType( HYPRE_Solver solver, HYPRE_Int ilu_type ); + +HYPRE_Int +HYPRE_ILUSetUpperJacobiIters_flt( HYPRE_Solver solver, HYPRE_Int upper_jacobi_iterations ); +HYPRE_Int +HYPRE_ILUSetUpperJacobiIters_dbl( HYPRE_Solver solver, HYPRE_Int upper_jacobi_iterations ); +HYPRE_Int +HYPRE_ILUSetUpperJacobiIters_long_dbl( HYPRE_Solver solver, HYPRE_Int upper_jacobi_iterations ); +HYPRE_Int +HYPRE_ILUSetUpperJacobiIters( HYPRE_Solver solver, HYPRE_Int upper_jacobi_iterations ); + +HYPRE_Int +HYPRE_ILUSetup_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ILUSetup_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ILUSetup_long_dbl( 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 ); + +HYPRE_Int +HYPRE_ILUSolve_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ILUSolve_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ILUSolve_long_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ILUSolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_MGRBuildAff_flt( HYPRE_ParCSRMatrix A, HYPRE_Int *CF_marker, HYPRE_Int debug_flag, HYPRE_ParCSRMatrix *A_ff ); +HYPRE_Int +HYPRE_MGRBuildAff_dbl( HYPRE_ParCSRMatrix A, HYPRE_Int *CF_marker, HYPRE_Int debug_flag, HYPRE_ParCSRMatrix *A_ff ); +HYPRE_Int +HYPRE_MGRBuildAff_long_dbl( HYPRE_ParCSRMatrix A, HYPRE_Int *CF_marker, HYPRE_Int debug_flag, HYPRE_ParCSRMatrix *A_ff ); +HYPRE_Int +HYPRE_MGRBuildAff( HYPRE_ParCSRMatrix A, HYPRE_Int *CF_marker, HYPRE_Int debug_flag, HYPRE_ParCSRMatrix *A_ff ); + +HYPRE_Int +HYPRE_MGRCreate_flt( HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_MGRCreate_dbl( HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_MGRCreate_long_dbl( HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_MGRCreate( HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_MGRDestroy_flt( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_MGRDestroy_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_MGRDestroy_long_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_MGRDestroy( HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_MGRGetCoarseGridConvergenceFactor_flt( HYPRE_Solver solver, hypre_float *conv_factor ); +HYPRE_Int +HYPRE_MGRGetCoarseGridConvergenceFactor_dbl( HYPRE_Solver solver, hypre_double *conv_factor ); +HYPRE_Int +HYPRE_MGRGetCoarseGridConvergenceFactor_long_dbl( HYPRE_Solver solver, hypre_long_double *conv_factor ); +HYPRE_Int +HYPRE_MGRGetCoarseGridConvergenceFactor( HYPRE_Solver solver, void *conv_factor ); + +HYPRE_Int +HYPRE_MGRGetFinalRelativeResidualNorm_flt( HYPRE_Solver solver, hypre_float *res_norm ); +HYPRE_Int +HYPRE_MGRGetFinalRelativeResidualNorm_dbl( HYPRE_Solver solver, hypre_double *res_norm ); +HYPRE_Int +HYPRE_MGRGetFinalRelativeResidualNorm_long_dbl( HYPRE_Solver solver, hypre_long_double *res_norm ); +HYPRE_Int +HYPRE_MGRGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *res_norm ); + +HYPRE_Int +HYPRE_MGRGetNumIterations_flt( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_MGRGetNumIterations_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_MGRGetNumIterations_long_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_MGRGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_MGRSetBlockJacobiBlockSize_flt( HYPRE_Solver solver, HYPRE_Int blk_size ); +HYPRE_Int +HYPRE_MGRSetBlockJacobiBlockSize_dbl( HYPRE_Solver solver, HYPRE_Int blk_size ); +HYPRE_Int +HYPRE_MGRSetBlockJacobiBlockSize_long_dbl( HYPRE_Solver solver, HYPRE_Int blk_size ); +HYPRE_Int +HYPRE_MGRSetBlockJacobiBlockSize( HYPRE_Solver solver, HYPRE_Int blk_size ); + +HYPRE_Int +HYPRE_MGRSetBlockSize_flt( HYPRE_Solver solver, HYPRE_Int bsize ); +HYPRE_Int +HYPRE_MGRSetBlockSize_dbl( HYPRE_Solver solver, HYPRE_Int bsize ); +HYPRE_Int +HYPRE_MGRSetBlockSize_long_dbl( HYPRE_Solver solver, HYPRE_Int bsize ); +HYPRE_Int +HYPRE_MGRSetBlockSize( HYPRE_Solver solver, HYPRE_Int bsize ); + +HYPRE_Int +HYPRE_MGRSetCoarseGridMethod_flt( HYPRE_Solver solver, HYPRE_Int *cg_method ); +HYPRE_Int +HYPRE_MGRSetCoarseGridMethod_dbl( HYPRE_Solver solver, HYPRE_Int *cg_method ); +HYPRE_Int +HYPRE_MGRSetCoarseGridMethod_long_dbl( HYPRE_Solver solver, HYPRE_Int *cg_method ); +HYPRE_Int +HYPRE_MGRSetCoarseGridMethod( HYPRE_Solver solver, HYPRE_Int *cg_method ); + +HYPRE_Int +HYPRE_MGRSetCoarseGridPrintLevel_flt( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_MGRSetCoarseGridPrintLevel_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_MGRSetCoarseGridPrintLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_MGRSetCoarseGridPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_MGRSetCoarseSolver_flt( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn coarse_grid_solver_solve, HYPRE_PtrToParSolverFcn coarse_grid_solver_setup, HYPRE_Solver coarse_grid_solver ); +HYPRE_Int +HYPRE_MGRSetCoarseSolver_dbl( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn coarse_grid_solver_solve, HYPRE_PtrToParSolverFcn coarse_grid_solver_setup, HYPRE_Solver coarse_grid_solver ); +HYPRE_Int +HYPRE_MGRSetCoarseSolver_long_dbl( 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 ); + +HYPRE_Int +HYPRE_MGRSetCpointsByBlock_flt( 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 +HYPRE_MGRSetCpointsByBlock_dbl( 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 +HYPRE_MGRSetCpointsByBlock_long_dbl( 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 +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 +HYPRE_MGRSetCpointsByContiguousBlock_flt( 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 +HYPRE_MGRSetCpointsByContiguousBlock_dbl( 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 +HYPRE_MGRSetCpointsByContiguousBlock_long_dbl( 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 +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 +HYPRE_MGRSetCpointsByPointMarkerArray_flt( 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 +HYPRE_MGRSetCpointsByPointMarkerArray_dbl( 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 +HYPRE_MGRSetCpointsByPointMarkerArray_long_dbl( 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 +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 +HYPRE_MGRSetFRelaxMethod_flt( HYPRE_Solver solver, HYPRE_Int relax_method ); +HYPRE_Int +HYPRE_MGRSetFRelaxMethod_dbl( HYPRE_Solver solver, HYPRE_Int relax_method ); +HYPRE_Int +HYPRE_MGRSetFRelaxMethod_long_dbl( HYPRE_Solver solver, HYPRE_Int relax_method ); +HYPRE_Int +HYPRE_MGRSetFRelaxMethod( HYPRE_Solver solver, HYPRE_Int relax_method ); + +HYPRE_Int +HYPRE_MGRSetFSolver_flt( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn fine_grid_solver_solve, HYPRE_PtrToParSolverFcn fine_grid_solver_setup, HYPRE_Solver fsolver ); +HYPRE_Int +HYPRE_MGRSetFSolver_dbl( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn fine_grid_solver_solve, HYPRE_PtrToParSolverFcn fine_grid_solver_setup, HYPRE_Solver fsolver ); +HYPRE_Int +HYPRE_MGRSetFSolver_long_dbl( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn fine_grid_solver_solve, HYPRE_PtrToParSolverFcn fine_grid_solver_setup, HYPRE_Solver fsolver ); +HYPRE_Int +HYPRE_MGRSetFSolver( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn fine_grid_solver_solve, HYPRE_PtrToParSolverFcn fine_grid_solver_setup, HYPRE_Solver fsolver ); + +HYPRE_Int +HYPRE_MGRSetFSolverAtLevel_flt( HYPRE_Solver solver, HYPRE_Solver fsolver, HYPRE_Int level ); +HYPRE_Int +HYPRE_MGRSetFSolverAtLevel_dbl( HYPRE_Solver solver, HYPRE_Solver fsolver, HYPRE_Int level ); +HYPRE_Int +HYPRE_MGRSetFSolverAtLevel_long_dbl( HYPRE_Solver solver, HYPRE_Solver fsolver, HYPRE_Int level ); +HYPRE_Int +HYPRE_MGRSetFSolverAtLevel( HYPRE_Solver solver, HYPRE_Solver fsolver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_MGRSetFrelaxPrintLevel_flt( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_MGRSetFrelaxPrintLevel_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_MGRSetFrelaxPrintLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_MGRSetFrelaxPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_MGRSetGlobalSmoothCycle_flt( HYPRE_Solver solver, HYPRE_Int global_smooth_cycle ); +HYPRE_Int +HYPRE_MGRSetGlobalSmoothCycle_dbl( HYPRE_Solver solver, HYPRE_Int global_smooth_cycle ); +HYPRE_Int +HYPRE_MGRSetGlobalSmoothCycle_long_dbl( HYPRE_Solver solver, HYPRE_Int global_smooth_cycle ); +HYPRE_Int +HYPRE_MGRSetGlobalSmoothCycle( HYPRE_Solver solver, HYPRE_Int global_smooth_cycle ); + +HYPRE_Int +HYPRE_MGRSetGlobalSmoothType_flt( HYPRE_Solver solver, HYPRE_Int smooth_type ); +HYPRE_Int +HYPRE_MGRSetGlobalSmoothType_dbl( HYPRE_Solver solver, HYPRE_Int smooth_type ); +HYPRE_Int +HYPRE_MGRSetGlobalSmoothType_long_dbl( HYPRE_Solver solver, HYPRE_Int smooth_type ); +HYPRE_Int +HYPRE_MGRSetGlobalSmoothType( HYPRE_Solver solver, HYPRE_Int smooth_type ); + +HYPRE_Int +HYPRE_MGRSetGlobalSmootherAtLevel_flt( HYPRE_Solver solver, HYPRE_Solver smoother, HYPRE_Int level ); +HYPRE_Int +HYPRE_MGRSetGlobalSmootherAtLevel_dbl( HYPRE_Solver solver, HYPRE_Solver smoother, HYPRE_Int level ); +HYPRE_Int +HYPRE_MGRSetGlobalSmootherAtLevel_long_dbl( HYPRE_Solver solver, HYPRE_Solver smoother, HYPRE_Int level ); +HYPRE_Int +HYPRE_MGRSetGlobalSmootherAtLevel( HYPRE_Solver solver, HYPRE_Solver smoother, HYPRE_Int level ); + +HYPRE_Int +HYPRE_MGRSetInterpType_flt( HYPRE_Solver solver, HYPRE_Int interp_type ); +HYPRE_Int +HYPRE_MGRSetInterpType_dbl( HYPRE_Solver solver, HYPRE_Int interp_type ); +HYPRE_Int +HYPRE_MGRSetInterpType_long_dbl( HYPRE_Solver solver, HYPRE_Int interp_type ); +HYPRE_Int +HYPRE_MGRSetInterpType( HYPRE_Solver solver, HYPRE_Int interp_type ); + +HYPRE_Int +HYPRE_MGRSetLevelFRelaxMethod_flt( HYPRE_Solver solver, HYPRE_Int *relax_method ); +HYPRE_Int +HYPRE_MGRSetLevelFRelaxMethod_dbl( HYPRE_Solver solver, HYPRE_Int *relax_method ); +HYPRE_Int +HYPRE_MGRSetLevelFRelaxMethod_long_dbl( HYPRE_Solver solver, HYPRE_Int *relax_method ); +HYPRE_Int +HYPRE_MGRSetLevelFRelaxMethod( HYPRE_Solver solver, HYPRE_Int *relax_method ); + +HYPRE_Int +HYPRE_MGRSetLevelFRelaxNumFunctions_flt( HYPRE_Solver solver, HYPRE_Int *num_functions ); +HYPRE_Int +HYPRE_MGRSetLevelFRelaxNumFunctions_dbl( HYPRE_Solver solver, HYPRE_Int *num_functions ); +HYPRE_Int +HYPRE_MGRSetLevelFRelaxNumFunctions_long_dbl( HYPRE_Solver solver, HYPRE_Int *num_functions ); +HYPRE_Int +HYPRE_MGRSetLevelFRelaxNumFunctions( HYPRE_Solver solver, HYPRE_Int *num_functions ); + +HYPRE_Int +HYPRE_MGRSetLevelFRelaxType_flt( HYPRE_Solver solver, HYPRE_Int *relax_type ); +HYPRE_Int +HYPRE_MGRSetLevelFRelaxType_dbl( HYPRE_Solver solver, HYPRE_Int *relax_type ); +HYPRE_Int +HYPRE_MGRSetLevelFRelaxType_long_dbl( HYPRE_Solver solver, HYPRE_Int *relax_type ); +HYPRE_Int +HYPRE_MGRSetLevelFRelaxType( HYPRE_Solver solver, HYPRE_Int *relax_type ); + +HYPRE_Int +HYPRE_MGRSetLevelInterpType_flt( HYPRE_Solver solver, HYPRE_Int *interp_type ); +HYPRE_Int +HYPRE_MGRSetLevelInterpType_dbl( HYPRE_Solver solver, HYPRE_Int *interp_type ); +HYPRE_Int +HYPRE_MGRSetLevelInterpType_long_dbl( HYPRE_Solver solver, HYPRE_Int *interp_type ); +HYPRE_Int +HYPRE_MGRSetLevelInterpType( HYPRE_Solver solver, HYPRE_Int *interp_type ); + +HYPRE_Int +HYPRE_MGRSetLevelNonGalerkinMaxElmts_flt( HYPRE_Solver solver, HYPRE_Int *max_elmts ); +HYPRE_Int +HYPRE_MGRSetLevelNonGalerkinMaxElmts_dbl( HYPRE_Solver solver, HYPRE_Int *max_elmts ); +HYPRE_Int +HYPRE_MGRSetLevelNonGalerkinMaxElmts_long_dbl( HYPRE_Solver solver, HYPRE_Int *max_elmts ); +HYPRE_Int +HYPRE_MGRSetLevelNonGalerkinMaxElmts( HYPRE_Solver solver, HYPRE_Int *max_elmts ); + +HYPRE_Int +HYPRE_MGRSetLevelNumRelaxSweeps_flt( HYPRE_Solver solver, HYPRE_Int *nsweeps ); +HYPRE_Int +HYPRE_MGRSetLevelNumRelaxSweeps_dbl( HYPRE_Solver solver, HYPRE_Int *nsweeps ); +HYPRE_Int +HYPRE_MGRSetLevelNumRelaxSweeps_long_dbl( HYPRE_Solver solver, HYPRE_Int *nsweeps ); +HYPRE_Int +HYPRE_MGRSetLevelNumRelaxSweeps( HYPRE_Solver solver, HYPRE_Int *nsweeps ); + +HYPRE_Int +HYPRE_MGRSetLevelPMaxElmts_flt( HYPRE_Solver solver, HYPRE_Int *P_max_elmts ); +HYPRE_Int +HYPRE_MGRSetLevelPMaxElmts_dbl( HYPRE_Solver solver, HYPRE_Int *P_max_elmts ); +HYPRE_Int +HYPRE_MGRSetLevelPMaxElmts_long_dbl( HYPRE_Solver solver, HYPRE_Int *P_max_elmts ); +HYPRE_Int +HYPRE_MGRSetLevelPMaxElmts( HYPRE_Solver solver, HYPRE_Int *P_max_elmts ); + +HYPRE_Int +HYPRE_MGRSetLevelRestrictType_flt( HYPRE_Solver solver, HYPRE_Int *restrict_type ); +HYPRE_Int +HYPRE_MGRSetLevelRestrictType_dbl( HYPRE_Solver solver, HYPRE_Int *restrict_type ); +HYPRE_Int +HYPRE_MGRSetLevelRestrictType_long_dbl( HYPRE_Solver solver, HYPRE_Int *restrict_type ); +HYPRE_Int +HYPRE_MGRSetLevelRestrictType( HYPRE_Solver solver, HYPRE_Int *restrict_type ); + +HYPRE_Int +HYPRE_MGRSetLevelSmoothIters_flt( HYPRE_Solver solver, HYPRE_Int *smooth_iters ); +HYPRE_Int +HYPRE_MGRSetLevelSmoothIters_dbl( HYPRE_Solver solver, HYPRE_Int *smooth_iters ); +HYPRE_Int +HYPRE_MGRSetLevelSmoothIters_long_dbl( HYPRE_Solver solver, HYPRE_Int *smooth_iters ); +HYPRE_Int +HYPRE_MGRSetLevelSmoothIters( HYPRE_Solver solver, HYPRE_Int *smooth_iters ); + +HYPRE_Int +HYPRE_MGRSetLevelSmoothType_flt( HYPRE_Solver solver, HYPRE_Int *smooth_type ); +HYPRE_Int +HYPRE_MGRSetLevelSmoothType_dbl( HYPRE_Solver solver, HYPRE_Int *smooth_type ); +HYPRE_Int +HYPRE_MGRSetLevelSmoothType_long_dbl( HYPRE_Solver solver, HYPRE_Int *smooth_type ); +HYPRE_Int +HYPRE_MGRSetLevelSmoothType( HYPRE_Solver solver, HYPRE_Int *smooth_type ); + +HYPRE_Int +HYPRE_MGRSetLogging_flt( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_MGRSetLogging_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_MGRSetLogging_long_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_MGRSetLogging( HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_MGRSetMaxCoarseLevels_flt( HYPRE_Solver solver, HYPRE_Int maxlev ); +HYPRE_Int +HYPRE_MGRSetMaxCoarseLevels_dbl( HYPRE_Solver solver, HYPRE_Int maxlev ); +HYPRE_Int +HYPRE_MGRSetMaxCoarseLevels_long_dbl( HYPRE_Solver solver, HYPRE_Int maxlev ); +HYPRE_Int +HYPRE_MGRSetMaxCoarseLevels( HYPRE_Solver solver, HYPRE_Int maxlev ); + +HYPRE_Int +HYPRE_MGRSetMaxGlobalSmoothIters_flt( HYPRE_Solver solver, HYPRE_Int smooth_iter ); +HYPRE_Int +HYPRE_MGRSetMaxGlobalSmoothIters_dbl( HYPRE_Solver solver, HYPRE_Int smooth_iter ); +HYPRE_Int +HYPRE_MGRSetMaxGlobalSmoothIters_long_dbl( HYPRE_Solver solver, HYPRE_Int smooth_iter ); +HYPRE_Int +HYPRE_MGRSetMaxGlobalSmoothIters( HYPRE_Solver solver, HYPRE_Int smooth_iter ); + +HYPRE_Int +HYPRE_MGRSetMaxIter_flt( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_MGRSetMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_MGRSetMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_MGRSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_MGRSetNonCpointsToFpoints_flt( HYPRE_Solver solver, HYPRE_Int nonCptToFptFlag ); +HYPRE_Int +HYPRE_MGRSetNonCpointsToFpoints_dbl( HYPRE_Solver solver, HYPRE_Int nonCptToFptFlag ); +HYPRE_Int +HYPRE_MGRSetNonCpointsToFpoints_long_dbl( HYPRE_Solver solver, HYPRE_Int nonCptToFptFlag ); +HYPRE_Int +HYPRE_MGRSetNonCpointsToFpoints( HYPRE_Solver solver, HYPRE_Int nonCptToFptFlag ); + +HYPRE_Int +HYPRE_MGRSetNonGalerkinMaxElmts_flt( HYPRE_Solver solver, HYPRE_Int max_elmts ); +HYPRE_Int +HYPRE_MGRSetNonGalerkinMaxElmts_dbl( HYPRE_Solver solver, HYPRE_Int max_elmts ); +HYPRE_Int +HYPRE_MGRSetNonGalerkinMaxElmts_long_dbl( HYPRE_Solver solver, HYPRE_Int max_elmts ); +HYPRE_Int +HYPRE_MGRSetNonGalerkinMaxElmts( HYPRE_Solver solver, HYPRE_Int max_elmts ); + +HYPRE_Int +HYPRE_MGRSetNumInterpSweeps_flt( HYPRE_Solver solver, HYPRE_Int nsweeps ); +HYPRE_Int +HYPRE_MGRSetNumInterpSweeps_dbl( HYPRE_Solver solver, HYPRE_Int nsweeps ); +HYPRE_Int +HYPRE_MGRSetNumInterpSweeps_long_dbl( HYPRE_Solver solver, HYPRE_Int nsweeps ); +HYPRE_Int +HYPRE_MGRSetNumInterpSweeps( HYPRE_Solver solver, HYPRE_Int nsweeps ); + +HYPRE_Int +HYPRE_MGRSetNumRelaxSweeps_flt( HYPRE_Solver solver, HYPRE_Int nsweeps ); +HYPRE_Int +HYPRE_MGRSetNumRelaxSweeps_dbl( HYPRE_Solver solver, HYPRE_Int nsweeps ); +HYPRE_Int +HYPRE_MGRSetNumRelaxSweeps_long_dbl( HYPRE_Solver solver, HYPRE_Int nsweeps ); +HYPRE_Int +HYPRE_MGRSetNumRelaxSweeps( HYPRE_Solver solver, HYPRE_Int nsweeps ); + +HYPRE_Int +HYPRE_MGRSetNumRestrictSweeps_flt( HYPRE_Solver solver, HYPRE_Int nsweeps ); +HYPRE_Int +HYPRE_MGRSetNumRestrictSweeps_dbl( HYPRE_Solver solver, HYPRE_Int nsweeps ); +HYPRE_Int +HYPRE_MGRSetNumRestrictSweeps_long_dbl( HYPRE_Solver solver, HYPRE_Int nsweeps ); +HYPRE_Int +HYPRE_MGRSetNumRestrictSweeps( HYPRE_Solver solver, HYPRE_Int nsweeps ); + +HYPRE_Int +HYPRE_MGRSetPMaxElmts_flt( HYPRE_Solver solver, HYPRE_Int P_max_elmts ); +HYPRE_Int +HYPRE_MGRSetPMaxElmts_dbl( HYPRE_Solver solver, HYPRE_Int P_max_elmts ); +HYPRE_Int +HYPRE_MGRSetPMaxElmts_long_dbl( HYPRE_Solver solver, HYPRE_Int P_max_elmts ); +HYPRE_Int +HYPRE_MGRSetPMaxElmts( HYPRE_Solver solver, HYPRE_Int P_max_elmts ); + +HYPRE_Int +HYPRE_MGRSetPrintLevel_flt( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_MGRSetPrintLevel_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_MGRSetPrintLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_MGRSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_MGRSetRelaxType_flt( HYPRE_Solver solver, HYPRE_Int relax_type ); +HYPRE_Int +HYPRE_MGRSetRelaxType_dbl( HYPRE_Solver solver, HYPRE_Int relax_type ); +HYPRE_Int +HYPRE_MGRSetRelaxType_long_dbl( HYPRE_Solver solver, HYPRE_Int relax_type ); +HYPRE_Int +HYPRE_MGRSetRelaxType( HYPRE_Solver solver, HYPRE_Int relax_type ); + +HYPRE_Int +HYPRE_MGRSetReservedCoarseNodes_flt( HYPRE_Solver solver, HYPRE_Int reserved_coarse_size, HYPRE_BigInt *reserved_coarse_nodes ); +HYPRE_Int +HYPRE_MGRSetReservedCoarseNodes_dbl( HYPRE_Solver solver, HYPRE_Int reserved_coarse_size, HYPRE_BigInt *reserved_coarse_nodes ); +HYPRE_Int +HYPRE_MGRSetReservedCoarseNodes_long_dbl( HYPRE_Solver solver, HYPRE_Int reserved_coarse_size, HYPRE_BigInt *reserved_coarse_nodes ); +HYPRE_Int +HYPRE_MGRSetReservedCoarseNodes( HYPRE_Solver solver, HYPRE_Int reserved_coarse_size, HYPRE_BigInt *reserved_coarse_nodes ); + +HYPRE_Int +HYPRE_MGRSetReservedCpointsLevelToKeep_flt( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_MGRSetReservedCpointsLevelToKeep_dbl( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_MGRSetReservedCpointsLevelToKeep_long_dbl( HYPRE_Solver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_MGRSetReservedCpointsLevelToKeep( HYPRE_Solver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_MGRSetRestrictType_flt( HYPRE_Solver solver, HYPRE_Int restrict_type ); +HYPRE_Int +HYPRE_MGRSetRestrictType_dbl( HYPRE_Solver solver, HYPRE_Int restrict_type ); +HYPRE_Int +HYPRE_MGRSetRestrictType_long_dbl( HYPRE_Solver solver, HYPRE_Int restrict_type ); +HYPRE_Int +HYPRE_MGRSetRestrictType( HYPRE_Solver solver, HYPRE_Int restrict_type ); + +HYPRE_Int +HYPRE_MGRSetTol_flt( HYPRE_Solver solver, hypre_float tol ); +HYPRE_Int +HYPRE_MGRSetTol_dbl( HYPRE_Solver solver, hypre_double tol ); +HYPRE_Int +HYPRE_MGRSetTol_long_dbl( HYPRE_Solver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_MGRSetTol( HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_MGRSetTruncateCoarseGridThreshold_flt( HYPRE_Solver solver, hypre_float threshold ); +HYPRE_Int +HYPRE_MGRSetTruncateCoarseGridThreshold_dbl( HYPRE_Solver solver, hypre_double threshold ); +HYPRE_Int +HYPRE_MGRSetTruncateCoarseGridThreshold_long_dbl( HYPRE_Solver solver, hypre_long_double threshold ); +HYPRE_Int +HYPRE_MGRSetTruncateCoarseGridThreshold( HYPRE_Solver solver, hypre_long_double threshold ); + +HYPRE_Int +HYPRE_MGRSetup_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_MGRSetup_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_MGRSetup_long_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_MGRSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_MGRSolve_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_MGRSolve_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_MGRSolve_long_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_MGRSolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABCreate_flt( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABCreate_dbl( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABCreate_long_dbl( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABCreate( MPI_Comm comm, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABDestroy_flt( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABDestroy_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABDestroy_long_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABDestroy( HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABGetFinalRelativeResidualNorm_flt( HYPRE_Solver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABGetFinalRelativeResidualNorm_dbl( HYPRE_Solver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABGetFinalRelativeResidualNorm_long_dbl( HYPRE_Solver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *norm ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABGetNumIterations_flt( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABGetNumIterations_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABGetNumIterations_long_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABGetPrecond_flt( HYPRE_Solver solver, HYPRE_Solver *precond_data ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABGetPrecond_dbl( HYPRE_Solver solver, HYPRE_Solver *precond_data ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABGetPrecond_long_dbl( HYPRE_Solver solver, HYPRE_Solver *precond_data ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABGetResidual_flt( HYPRE_Solver solver, HYPRE_ParVector *residual ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABGetResidual_dbl( HYPRE_Solver solver, HYPRE_ParVector *residual ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABGetResidual_long_dbl( HYPRE_Solver solver, HYPRE_ParVector *residual ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABGetResidual( HYPRE_Solver solver, HYPRE_ParVector *residual ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetAbsoluteTol_flt( HYPRE_Solver solver, hypre_float a_tol ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetAbsoluteTol_dbl( HYPRE_Solver solver, hypre_double a_tol ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetAbsoluteTol_long_dbl( HYPRE_Solver solver, hypre_long_double a_tol ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetAbsoluteTol( HYPRE_Solver solver, hypre_long_double a_tol ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetLogging_flt( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetLogging_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetLogging_long_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetLogging( HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetMaxIter_flt( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetMinIter_flt( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetMinIter_dbl( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetMinIter_long_dbl( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetPrecond_flt( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetPrecond_dbl( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetPrecond_long_dbl( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetPrecond( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetPrintLevel_flt( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetPrintLevel_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetPrintLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetStopCrit_flt( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetStopCrit_dbl( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetStopCrit_long_dbl( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetStopCrit( HYPRE_Solver solver, HYPRE_Int stop_crit ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetTol_flt( HYPRE_Solver solver, hypre_float tol ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetTol_dbl( HYPRE_Solver solver, hypre_double tol ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetTol_long_dbl( HYPRE_Solver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetTol( HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetup_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetup_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetup_long_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSolve_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABSolve_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRBiCGSTABSolve_long_dbl( 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_ParCSRCGNRCreate_flt( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParCSRCGNRCreate_dbl( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParCSRCGNRCreate_long_dbl( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParCSRCGNRCreate( MPI_Comm comm, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_ParCSRCGNRDestroy_flt( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParCSRCGNRDestroy_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParCSRCGNRDestroy_long_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParCSRCGNRDestroy( HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_ParCSRCGNRGetFinalRelativeResidualNorm_flt( HYPRE_Solver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_ParCSRCGNRGetFinalRelativeResidualNorm_dbl( HYPRE_Solver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_ParCSRCGNRGetFinalRelativeResidualNorm_long_dbl( HYPRE_Solver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_ParCSRCGNRGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *norm ); + +HYPRE_Int +HYPRE_ParCSRCGNRGetNumIterations_flt( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_ParCSRCGNRGetNumIterations_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_ParCSRCGNRGetNumIterations_long_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_ParCSRCGNRGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_ParCSRCGNRGetPrecond_flt( HYPRE_Solver solver, HYPRE_Solver *precond_data ); +HYPRE_Int +HYPRE_ParCSRCGNRGetPrecond_dbl( HYPRE_Solver solver, HYPRE_Solver *precond_data ); +HYPRE_Int +HYPRE_ParCSRCGNRGetPrecond_long_dbl( HYPRE_Solver solver, HYPRE_Solver *precond_data ); +HYPRE_Int +HYPRE_ParCSRCGNRGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data ); + +HYPRE_Int +HYPRE_ParCSRCGNRSetLogging_flt( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParCSRCGNRSetLogging_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParCSRCGNRSetLogging_long_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParCSRCGNRSetLogging( HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_ParCSRCGNRSetMaxIter_flt( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_ParCSRCGNRSetMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_ParCSRCGNRSetMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_ParCSRCGNRSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_ParCSRCGNRSetMinIter_flt( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_ParCSRCGNRSetMinIter_dbl( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_ParCSRCGNRSetMinIter_long_dbl( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_ParCSRCGNRSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_ParCSRCGNRSetPrecond_flt( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precondT, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_ParCSRCGNRSetPrecond_dbl( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precondT, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_ParCSRCGNRSetPrecond_long_dbl( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precondT, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_ParCSRCGNRSetPrecond( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precondT, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_ParCSRCGNRSetStopCrit_flt( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_ParCSRCGNRSetStopCrit_dbl( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_ParCSRCGNRSetStopCrit_long_dbl( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_ParCSRCGNRSetStopCrit( HYPRE_Solver solver, HYPRE_Int stop_crit ); + +HYPRE_Int +HYPRE_ParCSRCGNRSetTol_flt( HYPRE_Solver solver, hypre_float tol ); +HYPRE_Int +HYPRE_ParCSRCGNRSetTol_dbl( HYPRE_Solver solver, hypre_double tol ); +HYPRE_Int +HYPRE_ParCSRCGNRSetTol_long_dbl( HYPRE_Solver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_ParCSRCGNRSetTol( HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_ParCSRCGNRSetup_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRCGNRSetup_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRCGNRSetup_long_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRCGNRSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRCGNRSolve_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRCGNRSolve_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRCGNRSolve_long_dbl( 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_ParCSRCOGMRESCreate_flt( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParCSRCOGMRESCreate_dbl( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParCSRCOGMRESCreate_long_dbl( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParCSRCOGMRESCreate( MPI_Comm comm, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESDestroy_flt( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParCSRCOGMRESDestroy_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParCSRCOGMRESDestroy_long_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParCSRCOGMRESDestroy( HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESGetFinalRelativeResidualNorm_flt( HYPRE_Solver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_ParCSRCOGMRESGetFinalRelativeResidualNorm_dbl( HYPRE_Solver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_ParCSRCOGMRESGetFinalRelativeResidualNorm_long_dbl( HYPRE_Solver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_ParCSRCOGMRESGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *norm ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESGetNumIterations_flt( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_ParCSRCOGMRESGetNumIterations_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_ParCSRCOGMRESGetNumIterations_long_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_ParCSRCOGMRESGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESGetPrecond_flt( HYPRE_Solver solver, HYPRE_Solver *precond_data ); +HYPRE_Int +HYPRE_ParCSRCOGMRESGetPrecond_dbl( HYPRE_Solver solver, HYPRE_Solver *precond_data ); +HYPRE_Int +HYPRE_ParCSRCOGMRESGetPrecond_long_dbl( HYPRE_Solver solver, HYPRE_Solver *precond_data ); +HYPRE_Int +HYPRE_ParCSRCOGMRESGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESGetResidual_flt( HYPRE_Solver solver, HYPRE_ParVector *residual ); +HYPRE_Int +HYPRE_ParCSRCOGMRESGetResidual_dbl( HYPRE_Solver solver, HYPRE_ParVector *residual ); +HYPRE_Int +HYPRE_ParCSRCOGMRESGetResidual_long_dbl( HYPRE_Solver solver, HYPRE_ParVector *residual ); +HYPRE_Int +HYPRE_ParCSRCOGMRESGetResidual( HYPRE_Solver solver, HYPRE_ParVector *residual ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetAbsoluteTol_flt( HYPRE_Solver solver, hypre_float a_tol ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetAbsoluteTol_dbl( HYPRE_Solver solver, hypre_double a_tol ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetAbsoluteTol_long_dbl( HYPRE_Solver solver, hypre_long_double a_tol ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetAbsoluteTol( HYPRE_Solver solver, hypre_long_double a_tol ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetCGS_flt( HYPRE_Solver solver, HYPRE_Int cgs ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetCGS_dbl( HYPRE_Solver solver, HYPRE_Int cgs ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetCGS_long_dbl( HYPRE_Solver solver, HYPRE_Int cgs ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetCGS( HYPRE_Solver solver, HYPRE_Int cgs ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetKDim_flt( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetKDim_dbl( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetKDim_long_dbl( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetKDim( HYPRE_Solver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetLogging_flt( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetLogging_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetLogging_long_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetLogging( HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetMaxIter_flt( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetMinIter_flt( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetMinIter_dbl( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetMinIter_long_dbl( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetPrecond_flt( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetPrecond_dbl( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetPrecond_long_dbl( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetPrecond( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetPrintLevel_flt( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetPrintLevel_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetPrintLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetTol_flt( HYPRE_Solver solver, hypre_float tol ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetTol_dbl( HYPRE_Solver solver, hypre_double tol ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetTol_long_dbl( HYPRE_Solver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetTol( HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetUnroll_flt( HYPRE_Solver solver, HYPRE_Int unroll ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetUnroll_dbl( HYPRE_Solver solver, HYPRE_Int unroll ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetUnroll_long_dbl( HYPRE_Solver solver, HYPRE_Int unroll ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetUnroll( HYPRE_Solver solver, HYPRE_Int unroll ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetup_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetup_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetup_long_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESSolve_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSolve_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRCOGMRESSolve_long_dbl( 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_ParCSRDiagScale_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix HA, HYPRE_ParVector Hy, HYPRE_ParVector Hx ); +HYPRE_Int +HYPRE_ParCSRDiagScale_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix HA, HYPRE_ParVector Hy, HYPRE_ParVector Hx ); +HYPRE_Int +HYPRE_ParCSRDiagScale_long_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix HA, HYPRE_ParVector Hy, HYPRE_ParVector Hx ); +HYPRE_Int +HYPRE_ParCSRDiagScale( HYPRE_Solver solver, HYPRE_ParCSRMatrix HA, HYPRE_ParVector Hy, HYPRE_ParVector Hx ); + +HYPRE_Int +HYPRE_ParCSRDiagScaleSetup_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector y, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRDiagScaleSetup_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector y, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRDiagScaleSetup_long_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector y, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRDiagScaleSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector y, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESCreate_flt( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESCreate_dbl( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESCreate_long_dbl( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESCreate( MPI_Comm comm, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESDestroy_flt( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESDestroy_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESDestroy_long_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESDestroy( HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESGetFinalRelativeResidualNorm_flt( HYPRE_Solver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESGetFinalRelativeResidualNorm_dbl( HYPRE_Solver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESGetFinalRelativeResidualNorm_long_dbl( HYPRE_Solver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *norm ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESGetNumIterations_flt( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESGetNumIterations_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESGetNumIterations_long_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESGetPrecond_flt( HYPRE_Solver solver, HYPRE_Solver *precond_data ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESGetPrecond_dbl( HYPRE_Solver solver, HYPRE_Solver *precond_data ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESGetPrecond_long_dbl( HYPRE_Solver solver, HYPRE_Solver *precond_data ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESGetResidual_flt( HYPRE_Solver solver, HYPRE_ParVector *residual ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESGetResidual_dbl( HYPRE_Solver solver, HYPRE_ParVector *residual ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESGetResidual_long_dbl( HYPRE_Solver solver, HYPRE_ParVector *residual ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESGetResidual( HYPRE_Solver solver, HYPRE_ParVector *residual ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetAbsoluteTol_flt( HYPRE_Solver solver, hypre_float a_tol ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetAbsoluteTol_dbl( HYPRE_Solver solver, hypre_double a_tol ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetAbsoluteTol_long_dbl( HYPRE_Solver solver, hypre_long_double a_tol ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetAbsoluteTol( HYPRE_Solver solver, hypre_long_double a_tol ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetKDim_flt( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetKDim_dbl( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetKDim_long_dbl( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetKDim( HYPRE_Solver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetLogging_flt( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetLogging_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetLogging_long_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetLogging( HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetMaxIter_flt( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetMinIter_flt( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetMinIter_dbl( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetMinIter_long_dbl( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetModifyPC_flt( HYPRE_Solver solver, HYPRE_PtrToModifyPCFcn modify_pc ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetModifyPC_dbl( HYPRE_Solver solver, HYPRE_PtrToModifyPCFcn modify_pc ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetModifyPC_long_dbl( HYPRE_Solver solver, HYPRE_PtrToModifyPCFcn modify_pc ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetModifyPC( HYPRE_Solver solver, HYPRE_PtrToModifyPCFcn modify_pc ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetPrecond_flt( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetPrecond_dbl( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetPrecond_long_dbl( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetPrecond( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetPrintLevel_flt( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetPrintLevel_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetPrintLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetTol_flt( HYPRE_Solver solver, hypre_float tol ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetTol_dbl( HYPRE_Solver solver, hypre_double tol ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetTol_long_dbl( HYPRE_Solver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetTol( HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetup_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetup_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetup_long_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSolve_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSolve_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRFlexGMRESSolve_long_dbl( 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_ParCSRGMRESCreate_flt( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParCSRGMRESCreate_dbl( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParCSRGMRESCreate_long_dbl( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParCSRGMRESCreate( MPI_Comm comm, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_ParCSRGMRESDestroy_flt( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParCSRGMRESDestroy_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParCSRGMRESDestroy_long_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParCSRGMRESDestroy( HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_ParCSRGMRESGetFinalRelativeResidualNorm_flt( HYPRE_Solver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_ParCSRGMRESGetFinalRelativeResidualNorm_dbl( HYPRE_Solver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_ParCSRGMRESGetFinalRelativeResidualNorm_long_dbl( HYPRE_Solver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_ParCSRGMRESGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *norm ); + +HYPRE_Int +HYPRE_ParCSRGMRESGetNumIterations_flt( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_ParCSRGMRESGetNumIterations_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_ParCSRGMRESGetNumIterations_long_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_ParCSRGMRESGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_ParCSRGMRESGetPrecond_flt( HYPRE_Solver solver, HYPRE_Solver *precond_data ); +HYPRE_Int +HYPRE_ParCSRGMRESGetPrecond_dbl( HYPRE_Solver solver, HYPRE_Solver *precond_data ); +HYPRE_Int +HYPRE_ParCSRGMRESGetPrecond_long_dbl( HYPRE_Solver solver, HYPRE_Solver *precond_data ); +HYPRE_Int +HYPRE_ParCSRGMRESGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data ); + +HYPRE_Int +HYPRE_ParCSRGMRESGetRefSolution_flt( HYPRE_Solver solver, HYPRE_ParVector *ref_solution ); +HYPRE_Int +HYPRE_ParCSRGMRESGetRefSolution_dbl( HYPRE_Solver solver, HYPRE_ParVector *ref_solution ); +HYPRE_Int +HYPRE_ParCSRGMRESGetRefSolution_long_dbl( HYPRE_Solver solver, HYPRE_ParVector *ref_solution ); +HYPRE_Int +HYPRE_ParCSRGMRESGetRefSolution( HYPRE_Solver solver, HYPRE_ParVector *ref_solution ); + +HYPRE_Int +HYPRE_ParCSRGMRESGetResidual_flt( HYPRE_Solver solver, HYPRE_ParVector *residual ); +HYPRE_Int +HYPRE_ParCSRGMRESGetResidual_dbl( HYPRE_Solver solver, HYPRE_ParVector *residual ); +HYPRE_Int +HYPRE_ParCSRGMRESGetResidual_long_dbl( HYPRE_Solver solver, HYPRE_ParVector *residual ); +HYPRE_Int +HYPRE_ParCSRGMRESGetResidual( HYPRE_Solver solver, HYPRE_ParVector *residual ); + +HYPRE_Int +HYPRE_ParCSRGMRESSetAbsoluteTol_flt( HYPRE_Solver solver, hypre_float a_tol ); +HYPRE_Int +HYPRE_ParCSRGMRESSetAbsoluteTol_dbl( HYPRE_Solver solver, hypre_double a_tol ); +HYPRE_Int +HYPRE_ParCSRGMRESSetAbsoluteTol_long_dbl( HYPRE_Solver solver, hypre_long_double a_tol ); +HYPRE_Int +HYPRE_ParCSRGMRESSetAbsoluteTol( HYPRE_Solver solver, hypre_long_double a_tol ); + +HYPRE_Int +HYPRE_ParCSRGMRESSetKDim_flt( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_ParCSRGMRESSetKDim_dbl( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_ParCSRGMRESSetKDim_long_dbl( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_ParCSRGMRESSetKDim( HYPRE_Solver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_ParCSRGMRESSetLogging_flt( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParCSRGMRESSetLogging_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParCSRGMRESSetLogging_long_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParCSRGMRESSetLogging( HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_ParCSRGMRESSetMaxIter_flt( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_ParCSRGMRESSetMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_ParCSRGMRESSetMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_ParCSRGMRESSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_ParCSRGMRESSetMinIter_flt( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_ParCSRGMRESSetMinIter_dbl( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_ParCSRGMRESSetMinIter_long_dbl( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_ParCSRGMRESSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_ParCSRGMRESSetPrecond_flt( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_ParCSRGMRESSetPrecond_dbl( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_ParCSRGMRESSetPrecond_long_dbl( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_ParCSRGMRESSetPrecond( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_ParCSRGMRESSetPrintLevel_flt( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_ParCSRGMRESSetPrintLevel_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_ParCSRGMRESSetPrintLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_ParCSRGMRESSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_ParCSRGMRESSetRefSolution_flt( HYPRE_Solver solver, HYPRE_ParVector ref_solution ); +HYPRE_Int +HYPRE_ParCSRGMRESSetRefSolution_dbl( HYPRE_Solver solver, HYPRE_ParVector ref_solution ); +HYPRE_Int +HYPRE_ParCSRGMRESSetRefSolution_long_dbl( HYPRE_Solver solver, HYPRE_ParVector ref_solution ); +HYPRE_Int +HYPRE_ParCSRGMRESSetRefSolution( HYPRE_Solver solver, HYPRE_ParVector ref_solution ); + +HYPRE_Int +HYPRE_ParCSRGMRESSetStopCrit_flt( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_ParCSRGMRESSetStopCrit_dbl( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_ParCSRGMRESSetStopCrit_long_dbl( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_ParCSRGMRESSetStopCrit( HYPRE_Solver solver, HYPRE_Int stop_crit ); + +HYPRE_Int +HYPRE_ParCSRGMRESSetTol_flt( HYPRE_Solver solver, hypre_float tol ); +HYPRE_Int +HYPRE_ParCSRGMRESSetTol_dbl( HYPRE_Solver solver, hypre_double tol ); +HYPRE_Int +HYPRE_ParCSRGMRESSetTol_long_dbl( HYPRE_Solver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_ParCSRGMRESSetTol( HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_ParCSRGMRESSetup_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRGMRESSetup_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRGMRESSetup_long_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRGMRESSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRGMRESSolve_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRGMRESSolve_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRGMRESSolve_long_dbl( 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_ParCSRHybridCreate_flt( HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParCSRHybridCreate_dbl( HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParCSRHybridCreate_long_dbl( HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParCSRHybridCreate( HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_ParCSRHybridDestroy_flt( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParCSRHybridDestroy_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParCSRHybridDestroy_long_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParCSRHybridDestroy( HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_ParCSRHybridGetDSCGNumIterations_flt( HYPRE_Solver solver, HYPRE_Int *dscg_num_its ); +HYPRE_Int +HYPRE_ParCSRHybridGetDSCGNumIterations_dbl( HYPRE_Solver solver, HYPRE_Int *dscg_num_its ); +HYPRE_Int +HYPRE_ParCSRHybridGetDSCGNumIterations_long_dbl( HYPRE_Solver solver, HYPRE_Int *dscg_num_its ); +HYPRE_Int +HYPRE_ParCSRHybridGetDSCGNumIterations( HYPRE_Solver solver, HYPRE_Int *dscg_num_its ); + +HYPRE_Int +HYPRE_ParCSRHybridGetFinalRelativeResidualNorm_flt( HYPRE_Solver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_ParCSRHybridGetFinalRelativeResidualNorm_dbl( HYPRE_Solver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_ParCSRHybridGetFinalRelativeResidualNorm_long_dbl( HYPRE_Solver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_ParCSRHybridGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *norm ); + +HYPRE_Int +HYPRE_ParCSRHybridGetNumIterations_flt( HYPRE_Solver solver, HYPRE_Int *num_its ); +HYPRE_Int +HYPRE_ParCSRHybridGetNumIterations_dbl( HYPRE_Solver solver, HYPRE_Int *num_its ); +HYPRE_Int +HYPRE_ParCSRHybridGetNumIterations_long_dbl( HYPRE_Solver solver, HYPRE_Int *num_its ); +HYPRE_Int +HYPRE_ParCSRHybridGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_its ); + +HYPRE_Int +HYPRE_ParCSRHybridGetPCGNumIterations_flt( HYPRE_Solver solver, HYPRE_Int *pcg_num_its ); +HYPRE_Int +HYPRE_ParCSRHybridGetPCGNumIterations_dbl( HYPRE_Solver solver, HYPRE_Int *pcg_num_its ); +HYPRE_Int +HYPRE_ParCSRHybridGetPCGNumIterations_long_dbl( HYPRE_Solver solver, HYPRE_Int *pcg_num_its ); +HYPRE_Int +HYPRE_ParCSRHybridGetPCGNumIterations( HYPRE_Solver solver, HYPRE_Int *pcg_num_its ); + +HYPRE_Int +HYPRE_ParCSRHybridGetRecomputeResidual_flt( HYPRE_Solver solver, HYPRE_Int *recompute_residual ); +HYPRE_Int +HYPRE_ParCSRHybridGetRecomputeResidual_dbl( HYPRE_Solver solver, HYPRE_Int *recompute_residual ); +HYPRE_Int +HYPRE_ParCSRHybridGetRecomputeResidual_long_dbl( HYPRE_Solver solver, HYPRE_Int *recompute_residual ); +HYPRE_Int +HYPRE_ParCSRHybridGetRecomputeResidual( HYPRE_Solver solver, HYPRE_Int *recompute_residual ); + +HYPRE_Int +HYPRE_ParCSRHybridGetRecomputeResidualP_flt( HYPRE_Solver solver, HYPRE_Int *recompute_residual_p ); +HYPRE_Int +HYPRE_ParCSRHybridGetRecomputeResidualP_dbl( HYPRE_Solver solver, HYPRE_Int *recompute_residual_p ); +HYPRE_Int +HYPRE_ParCSRHybridGetRecomputeResidualP_long_dbl( HYPRE_Solver solver, HYPRE_Int *recompute_residual_p ); +HYPRE_Int +HYPRE_ParCSRHybridGetRecomputeResidualP( HYPRE_Solver solver, HYPRE_Int *recompute_residual_p ); + +HYPRE_Int +HYPRE_ParCSRHybridGetSetupSolveTime_flt( HYPRE_Solver solver, hypre_float *time ); +HYPRE_Int +HYPRE_ParCSRHybridGetSetupSolveTime_dbl( HYPRE_Solver solver, hypre_double *time ); +HYPRE_Int +HYPRE_ParCSRHybridGetSetupSolveTime_long_dbl( HYPRE_Solver solver, hypre_long_double *time ); +HYPRE_Int +HYPRE_ParCSRHybridGetSetupSolveTime( HYPRE_Solver solver, void *time ); + +HYPRE_Int +HYPRE_ParCSRHybridSetAbsoluteTol_flt( HYPRE_Solver solver, hypre_float tol ); +HYPRE_Int +HYPRE_ParCSRHybridSetAbsoluteTol_dbl( HYPRE_Solver solver, hypre_double tol ); +HYPRE_Int +HYPRE_ParCSRHybridSetAbsoluteTol_long_dbl( HYPRE_Solver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_ParCSRHybridSetAbsoluteTol( HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_ParCSRHybridSetAggInterpType_flt( HYPRE_Solver solver, HYPRE_Int agg_interp_type ); +HYPRE_Int +HYPRE_ParCSRHybridSetAggInterpType_dbl( HYPRE_Solver solver, HYPRE_Int agg_interp_type ); +HYPRE_Int +HYPRE_ParCSRHybridSetAggInterpType_long_dbl( HYPRE_Solver solver, HYPRE_Int agg_interp_type ); +HYPRE_Int +HYPRE_ParCSRHybridSetAggInterpType( HYPRE_Solver solver, HYPRE_Int agg_interp_type ); + +HYPRE_Int +HYPRE_ParCSRHybridSetAggNumLevels_flt( HYPRE_Solver solver, HYPRE_Int agg_num_levels ); +HYPRE_Int +HYPRE_ParCSRHybridSetAggNumLevels_dbl( HYPRE_Solver solver, HYPRE_Int agg_num_levels ); +HYPRE_Int +HYPRE_ParCSRHybridSetAggNumLevels_long_dbl( HYPRE_Solver solver, HYPRE_Int agg_num_levels ); +HYPRE_Int +HYPRE_ParCSRHybridSetAggNumLevels( HYPRE_Solver solver, HYPRE_Int agg_num_levels ); + +HYPRE_Int +HYPRE_ParCSRHybridSetCoarsenType_flt( HYPRE_Solver solver, HYPRE_Int coarsen_type ); +HYPRE_Int +HYPRE_ParCSRHybridSetCoarsenType_dbl( HYPRE_Solver solver, HYPRE_Int coarsen_type ); +HYPRE_Int +HYPRE_ParCSRHybridSetCoarsenType_long_dbl( HYPRE_Solver solver, HYPRE_Int coarsen_type ); +HYPRE_Int +HYPRE_ParCSRHybridSetCoarsenType( HYPRE_Solver solver, HYPRE_Int coarsen_type ); + +HYPRE_Int +HYPRE_ParCSRHybridSetConvergenceTol_flt( HYPRE_Solver solver, hypre_float cf_tol ); +HYPRE_Int +HYPRE_ParCSRHybridSetConvergenceTol_dbl( HYPRE_Solver solver, hypre_double cf_tol ); +HYPRE_Int +HYPRE_ParCSRHybridSetConvergenceTol_long_dbl( HYPRE_Solver solver, hypre_long_double cf_tol ); +HYPRE_Int +HYPRE_ParCSRHybridSetConvergenceTol( HYPRE_Solver solver, hypre_long_double cf_tol ); + +HYPRE_Int +HYPRE_ParCSRHybridSetCycleNumSweeps_flt( HYPRE_Solver solver, HYPRE_Int num_sweeps, HYPRE_Int k ); +HYPRE_Int +HYPRE_ParCSRHybridSetCycleNumSweeps_dbl( HYPRE_Solver solver, HYPRE_Int num_sweeps, HYPRE_Int k ); +HYPRE_Int +HYPRE_ParCSRHybridSetCycleNumSweeps_long_dbl( HYPRE_Solver solver, HYPRE_Int num_sweeps, HYPRE_Int k ); +HYPRE_Int +HYPRE_ParCSRHybridSetCycleNumSweeps( HYPRE_Solver solver, HYPRE_Int num_sweeps, HYPRE_Int k ); + +HYPRE_Int +HYPRE_ParCSRHybridSetCycleRelaxType_flt( HYPRE_Solver solver, HYPRE_Int relax_type, HYPRE_Int k ); +HYPRE_Int +HYPRE_ParCSRHybridSetCycleRelaxType_dbl( HYPRE_Solver solver, HYPRE_Int relax_type, HYPRE_Int k ); +HYPRE_Int +HYPRE_ParCSRHybridSetCycleRelaxType_long_dbl( HYPRE_Solver solver, HYPRE_Int relax_type, HYPRE_Int k ); +HYPRE_Int +HYPRE_ParCSRHybridSetCycleRelaxType( HYPRE_Solver solver, HYPRE_Int relax_type, HYPRE_Int k ); + +HYPRE_Int +HYPRE_ParCSRHybridSetCycleType_flt( HYPRE_Solver solver, HYPRE_Int cycle_type ); +HYPRE_Int +HYPRE_ParCSRHybridSetCycleType_dbl( HYPRE_Solver solver, HYPRE_Int cycle_type ); +HYPRE_Int +HYPRE_ParCSRHybridSetCycleType_long_dbl( HYPRE_Solver solver, HYPRE_Int cycle_type ); +HYPRE_Int +HYPRE_ParCSRHybridSetCycleType( HYPRE_Solver solver, HYPRE_Int cycle_type ); + +HYPRE_Int +HYPRE_ParCSRHybridSetDSCGMaxIter_flt( HYPRE_Solver solver, HYPRE_Int dscg_max_its ); +HYPRE_Int +HYPRE_ParCSRHybridSetDSCGMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int dscg_max_its ); +HYPRE_Int +HYPRE_ParCSRHybridSetDSCGMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int dscg_max_its ); +HYPRE_Int +HYPRE_ParCSRHybridSetDSCGMaxIter( HYPRE_Solver solver, HYPRE_Int dscg_max_its ); + +HYPRE_Int +HYPRE_ParCSRHybridSetDofFunc_flt( HYPRE_Solver solver, HYPRE_Int *dof_func ); +HYPRE_Int +HYPRE_ParCSRHybridSetDofFunc_dbl( HYPRE_Solver solver, HYPRE_Int *dof_func ); +HYPRE_Int +HYPRE_ParCSRHybridSetDofFunc_long_dbl( HYPRE_Solver solver, HYPRE_Int *dof_func ); +HYPRE_Int +HYPRE_ParCSRHybridSetDofFunc( HYPRE_Solver solver, HYPRE_Int *dof_func ); + +HYPRE_Int +HYPRE_ParCSRHybridSetGridRelaxPoints_flt( HYPRE_Solver solver, HYPRE_Int **grid_relax_points ); +HYPRE_Int +HYPRE_ParCSRHybridSetGridRelaxPoints_dbl( HYPRE_Solver solver, HYPRE_Int **grid_relax_points ); +HYPRE_Int +HYPRE_ParCSRHybridSetGridRelaxPoints_long_dbl( HYPRE_Solver solver, HYPRE_Int **grid_relax_points ); +HYPRE_Int +HYPRE_ParCSRHybridSetGridRelaxPoints( HYPRE_Solver solver, HYPRE_Int **grid_relax_points ); + +HYPRE_Int +HYPRE_ParCSRHybridSetGridRelaxType_flt( HYPRE_Solver solver, HYPRE_Int *grid_relax_type ); +HYPRE_Int +HYPRE_ParCSRHybridSetGridRelaxType_dbl( HYPRE_Solver solver, HYPRE_Int *grid_relax_type ); +HYPRE_Int +HYPRE_ParCSRHybridSetGridRelaxType_long_dbl( HYPRE_Solver solver, HYPRE_Int *grid_relax_type ); +HYPRE_Int +HYPRE_ParCSRHybridSetGridRelaxType( HYPRE_Solver solver, HYPRE_Int *grid_relax_type ); + +HYPRE_Int +HYPRE_ParCSRHybridSetInterpType_flt( HYPRE_Solver solver, HYPRE_Int interp_type ); +HYPRE_Int +HYPRE_ParCSRHybridSetInterpType_dbl( HYPRE_Solver solver, HYPRE_Int interp_type ); +HYPRE_Int +HYPRE_ParCSRHybridSetInterpType_long_dbl( HYPRE_Solver solver, HYPRE_Int interp_type ); +HYPRE_Int +HYPRE_ParCSRHybridSetInterpType( HYPRE_Solver solver, HYPRE_Int interp_type ); + +HYPRE_Int +HYPRE_ParCSRHybridSetKDim_flt( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_ParCSRHybridSetKDim_dbl( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_ParCSRHybridSetKDim_long_dbl( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_ParCSRHybridSetKDim( HYPRE_Solver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_ParCSRHybridSetKeepTranspose_flt( HYPRE_Solver solver, HYPRE_Int keepT ); +HYPRE_Int +HYPRE_ParCSRHybridSetKeepTranspose_dbl( HYPRE_Solver solver, HYPRE_Int keepT ); +HYPRE_Int +HYPRE_ParCSRHybridSetKeepTranspose_long_dbl( HYPRE_Solver solver, HYPRE_Int keepT ); +HYPRE_Int +HYPRE_ParCSRHybridSetKeepTranspose( HYPRE_Solver solver, HYPRE_Int keepT ); + +HYPRE_Int +HYPRE_ParCSRHybridSetLevelOuterWt_flt( HYPRE_Solver solver, hypre_float outer_wt, HYPRE_Int level ); +HYPRE_Int +HYPRE_ParCSRHybridSetLevelOuterWt_dbl( HYPRE_Solver solver, hypre_double outer_wt, HYPRE_Int level ); +HYPRE_Int +HYPRE_ParCSRHybridSetLevelOuterWt_long_dbl( HYPRE_Solver solver, hypre_long_double outer_wt, HYPRE_Int level ); +HYPRE_Int +HYPRE_ParCSRHybridSetLevelOuterWt( HYPRE_Solver solver, hypre_long_double outer_wt, HYPRE_Int level ); + +HYPRE_Int +HYPRE_ParCSRHybridSetLevelRelaxWt_flt( HYPRE_Solver solver, hypre_float relax_wt, HYPRE_Int level ); +HYPRE_Int +HYPRE_ParCSRHybridSetLevelRelaxWt_dbl( HYPRE_Solver solver, hypre_double relax_wt, HYPRE_Int level ); +HYPRE_Int +HYPRE_ParCSRHybridSetLevelRelaxWt_long_dbl( HYPRE_Solver solver, hypre_long_double relax_wt, HYPRE_Int level ); +HYPRE_Int +HYPRE_ParCSRHybridSetLevelRelaxWt( HYPRE_Solver solver, hypre_long_double relax_wt, HYPRE_Int level ); + +HYPRE_Int +HYPRE_ParCSRHybridSetLogging_flt( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParCSRHybridSetLogging_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParCSRHybridSetLogging_long_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParCSRHybridSetLogging( HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_ParCSRHybridSetMaxCoarseSize_flt( HYPRE_Solver solver, HYPRE_Int max_coarse_size ); +HYPRE_Int +HYPRE_ParCSRHybridSetMaxCoarseSize_dbl( HYPRE_Solver solver, HYPRE_Int max_coarse_size ); +HYPRE_Int +HYPRE_ParCSRHybridSetMaxCoarseSize_long_dbl( HYPRE_Solver solver, HYPRE_Int max_coarse_size ); +HYPRE_Int +HYPRE_ParCSRHybridSetMaxCoarseSize( HYPRE_Solver solver, HYPRE_Int max_coarse_size ); + +HYPRE_Int +HYPRE_ParCSRHybridSetMaxLevels_flt( HYPRE_Solver solver, HYPRE_Int max_levels ); +HYPRE_Int +HYPRE_ParCSRHybridSetMaxLevels_dbl( HYPRE_Solver solver, HYPRE_Int max_levels ); +HYPRE_Int +HYPRE_ParCSRHybridSetMaxLevels_long_dbl( HYPRE_Solver solver, HYPRE_Int max_levels ); +HYPRE_Int +HYPRE_ParCSRHybridSetMaxLevels( HYPRE_Solver solver, HYPRE_Int max_levels ); + +HYPRE_Int +HYPRE_ParCSRHybridSetMaxRowSum_flt( HYPRE_Solver solver, hypre_float max_row_sum ); +HYPRE_Int +HYPRE_ParCSRHybridSetMaxRowSum_dbl( HYPRE_Solver solver, hypre_double max_row_sum ); +HYPRE_Int +HYPRE_ParCSRHybridSetMaxRowSum_long_dbl( HYPRE_Solver solver, hypre_long_double max_row_sum ); +HYPRE_Int +HYPRE_ParCSRHybridSetMaxRowSum( HYPRE_Solver solver, hypre_long_double max_row_sum ); + +HYPRE_Int +HYPRE_ParCSRHybridSetMeasureType_flt( HYPRE_Solver solver, HYPRE_Int measure_type ); +HYPRE_Int +HYPRE_ParCSRHybridSetMeasureType_dbl( HYPRE_Solver solver, HYPRE_Int measure_type ); +HYPRE_Int +HYPRE_ParCSRHybridSetMeasureType_long_dbl( HYPRE_Solver solver, HYPRE_Int measure_type ); +HYPRE_Int +HYPRE_ParCSRHybridSetMeasureType( HYPRE_Solver solver, HYPRE_Int measure_type ); + +HYPRE_Int +HYPRE_ParCSRHybridSetMinCoarseSize_flt( HYPRE_Solver solver, HYPRE_Int min_coarse_size ); +HYPRE_Int +HYPRE_ParCSRHybridSetMinCoarseSize_dbl( HYPRE_Solver solver, HYPRE_Int min_coarse_size ); +HYPRE_Int +HYPRE_ParCSRHybridSetMinCoarseSize_long_dbl( HYPRE_Solver solver, HYPRE_Int min_coarse_size ); +HYPRE_Int +HYPRE_ParCSRHybridSetMinCoarseSize( HYPRE_Solver solver, HYPRE_Int min_coarse_size ); + +HYPRE_Int +HYPRE_ParCSRHybridSetNodal_flt( HYPRE_Solver solver, HYPRE_Int nodal ); +HYPRE_Int +HYPRE_ParCSRHybridSetNodal_dbl( HYPRE_Solver solver, HYPRE_Int nodal ); +HYPRE_Int +HYPRE_ParCSRHybridSetNodal_long_dbl( HYPRE_Solver solver, HYPRE_Int nodal ); +HYPRE_Int +HYPRE_ParCSRHybridSetNodal( HYPRE_Solver solver, HYPRE_Int nodal ); + +HYPRE_Int +HYPRE_ParCSRHybridSetNonGalerkinTol_flt( HYPRE_Solver solver, HYPRE_Int num_levels, hypre_float *nongalerkin_tol ); +HYPRE_Int +HYPRE_ParCSRHybridSetNonGalerkinTol_dbl( HYPRE_Solver solver, HYPRE_Int num_levels, hypre_double *nongalerkin_tol ); +HYPRE_Int +HYPRE_ParCSRHybridSetNonGalerkinTol_long_dbl( HYPRE_Solver solver, HYPRE_Int num_levels, hypre_long_double *nongalerkin_tol ); +HYPRE_Int +HYPRE_ParCSRHybridSetNonGalerkinTol( HYPRE_Solver solver, HYPRE_Int num_levels, void *nongalerkin_tol ); + +HYPRE_Int +HYPRE_ParCSRHybridSetNumFunctions_flt( HYPRE_Solver solver, HYPRE_Int num_functions ); +HYPRE_Int +HYPRE_ParCSRHybridSetNumFunctions_dbl( HYPRE_Solver solver, HYPRE_Int num_functions ); +HYPRE_Int +HYPRE_ParCSRHybridSetNumFunctions_long_dbl( HYPRE_Solver solver, HYPRE_Int num_functions ); +HYPRE_Int +HYPRE_ParCSRHybridSetNumFunctions( HYPRE_Solver solver, HYPRE_Int num_functions ); + +HYPRE_Int +HYPRE_ParCSRHybridSetNumGridSweeps_flt( HYPRE_Solver solver, HYPRE_Int *num_grid_sweeps ); +HYPRE_Int +HYPRE_ParCSRHybridSetNumGridSweeps_dbl( HYPRE_Solver solver, HYPRE_Int *num_grid_sweeps ); +HYPRE_Int +HYPRE_ParCSRHybridSetNumGridSweeps_long_dbl( HYPRE_Solver solver, HYPRE_Int *num_grid_sweeps ); +HYPRE_Int +HYPRE_ParCSRHybridSetNumGridSweeps( HYPRE_Solver solver, HYPRE_Int *num_grid_sweeps ); + +HYPRE_Int +HYPRE_ParCSRHybridSetNumPaths_flt( HYPRE_Solver solver, HYPRE_Int num_paths ); +HYPRE_Int +HYPRE_ParCSRHybridSetNumPaths_dbl( HYPRE_Solver solver, HYPRE_Int num_paths ); +HYPRE_Int +HYPRE_ParCSRHybridSetNumPaths_long_dbl( HYPRE_Solver solver, HYPRE_Int num_paths ); +HYPRE_Int +HYPRE_ParCSRHybridSetNumPaths( HYPRE_Solver solver, HYPRE_Int num_paths ); + +HYPRE_Int +HYPRE_ParCSRHybridSetNumSweeps_flt( HYPRE_Solver solver, HYPRE_Int num_sweeps ); +HYPRE_Int +HYPRE_ParCSRHybridSetNumSweeps_dbl( HYPRE_Solver solver, HYPRE_Int num_sweeps ); +HYPRE_Int +HYPRE_ParCSRHybridSetNumSweeps_long_dbl( HYPRE_Solver solver, HYPRE_Int num_sweeps ); +HYPRE_Int +HYPRE_ParCSRHybridSetNumSweeps( HYPRE_Solver solver, HYPRE_Int num_sweeps ); + +HYPRE_Int +HYPRE_ParCSRHybridSetOmega_flt( HYPRE_Solver solver, hypre_float *omega ); +HYPRE_Int +HYPRE_ParCSRHybridSetOmega_dbl( HYPRE_Solver solver, hypre_double *omega ); +HYPRE_Int +HYPRE_ParCSRHybridSetOmega_long_dbl( HYPRE_Solver solver, hypre_long_double *omega ); +HYPRE_Int +HYPRE_ParCSRHybridSetOmega( HYPRE_Solver solver, void *omega ); + +HYPRE_Int +HYPRE_ParCSRHybridSetOuterWt_flt( HYPRE_Solver solver, hypre_float outer_wt ); +HYPRE_Int +HYPRE_ParCSRHybridSetOuterWt_dbl( HYPRE_Solver solver, hypre_double outer_wt ); +HYPRE_Int +HYPRE_ParCSRHybridSetOuterWt_long_dbl( HYPRE_Solver solver, hypre_long_double outer_wt ); +HYPRE_Int +HYPRE_ParCSRHybridSetOuterWt( HYPRE_Solver solver, hypre_long_double outer_wt ); + +HYPRE_Int +HYPRE_ParCSRHybridSetPCGMaxIter_flt( HYPRE_Solver solver, HYPRE_Int pcg_max_its ); +HYPRE_Int +HYPRE_ParCSRHybridSetPCGMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int pcg_max_its ); +HYPRE_Int +HYPRE_ParCSRHybridSetPCGMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int pcg_max_its ); +HYPRE_Int +HYPRE_ParCSRHybridSetPCGMaxIter( HYPRE_Solver solver, HYPRE_Int pcg_max_its ); + +HYPRE_Int +HYPRE_ParCSRHybridSetPMaxElmts_flt( HYPRE_Solver solver, HYPRE_Int P_max_elmts ); +HYPRE_Int +HYPRE_ParCSRHybridSetPMaxElmts_dbl( HYPRE_Solver solver, HYPRE_Int P_max_elmts ); +HYPRE_Int +HYPRE_ParCSRHybridSetPMaxElmts_long_dbl( HYPRE_Solver solver, HYPRE_Int P_max_elmts ); +HYPRE_Int +HYPRE_ParCSRHybridSetPMaxElmts( HYPRE_Solver solver, HYPRE_Int P_max_elmts ); + +HYPRE_Int +HYPRE_ParCSRHybridSetPrecond_flt( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_ParCSRHybridSetPrecond_dbl( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_ParCSRHybridSetPrecond_long_dbl( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_ParCSRHybridSetPrecond( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_ParCSRHybridSetPrintLevel_flt( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_ParCSRHybridSetPrintLevel_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_ParCSRHybridSetPrintLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_ParCSRHybridSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_ParCSRHybridSetRecomputeResidual_flt( HYPRE_Solver solver, HYPRE_Int recompute_residual ); +HYPRE_Int +HYPRE_ParCSRHybridSetRecomputeResidual_dbl( HYPRE_Solver solver, HYPRE_Int recompute_residual ); +HYPRE_Int +HYPRE_ParCSRHybridSetRecomputeResidual_long_dbl( HYPRE_Solver solver, HYPRE_Int recompute_residual ); +HYPRE_Int +HYPRE_ParCSRHybridSetRecomputeResidual( HYPRE_Solver solver, HYPRE_Int recompute_residual ); + +HYPRE_Int +HYPRE_ParCSRHybridSetRecomputeResidualP_flt( HYPRE_Solver solver, HYPRE_Int recompute_residual_p ); +HYPRE_Int +HYPRE_ParCSRHybridSetRecomputeResidualP_dbl( HYPRE_Solver solver, HYPRE_Int recompute_residual_p ); +HYPRE_Int +HYPRE_ParCSRHybridSetRecomputeResidualP_long_dbl( HYPRE_Solver solver, HYPRE_Int recompute_residual_p ); +HYPRE_Int +HYPRE_ParCSRHybridSetRecomputeResidualP( HYPRE_Solver solver, HYPRE_Int recompute_residual_p ); + +HYPRE_Int +HYPRE_ParCSRHybridSetRelChange_flt( HYPRE_Solver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_ParCSRHybridSetRelChange_dbl( HYPRE_Solver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_ParCSRHybridSetRelChange_long_dbl( HYPRE_Solver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_ParCSRHybridSetRelChange( HYPRE_Solver solver, HYPRE_Int rel_change ); + +HYPRE_Int +HYPRE_ParCSRHybridSetRelaxOrder_flt( HYPRE_Solver solver, HYPRE_Int relax_order ); +HYPRE_Int +HYPRE_ParCSRHybridSetRelaxOrder_dbl( HYPRE_Solver solver, HYPRE_Int relax_order ); +HYPRE_Int +HYPRE_ParCSRHybridSetRelaxOrder_long_dbl( HYPRE_Solver solver, HYPRE_Int relax_order ); +HYPRE_Int +HYPRE_ParCSRHybridSetRelaxOrder( HYPRE_Solver solver, HYPRE_Int relax_order ); + +HYPRE_Int +HYPRE_ParCSRHybridSetRelaxType_flt( HYPRE_Solver solver, HYPRE_Int relax_type ); +HYPRE_Int +HYPRE_ParCSRHybridSetRelaxType_dbl( HYPRE_Solver solver, HYPRE_Int relax_type ); +HYPRE_Int +HYPRE_ParCSRHybridSetRelaxType_long_dbl( HYPRE_Solver solver, HYPRE_Int relax_type ); +HYPRE_Int +HYPRE_ParCSRHybridSetRelaxType( HYPRE_Solver solver, HYPRE_Int relax_type ); + +HYPRE_Int +HYPRE_ParCSRHybridSetRelaxWeight_flt( HYPRE_Solver solver, hypre_float *relax_weight ); +HYPRE_Int +HYPRE_ParCSRHybridSetRelaxWeight_dbl( HYPRE_Solver solver, hypre_double *relax_weight ); +HYPRE_Int +HYPRE_ParCSRHybridSetRelaxWeight_long_dbl( HYPRE_Solver solver, hypre_long_double *relax_weight ); +HYPRE_Int +HYPRE_ParCSRHybridSetRelaxWeight( HYPRE_Solver solver, void *relax_weight ); + +HYPRE_Int +HYPRE_ParCSRHybridSetRelaxWt_flt( HYPRE_Solver solver, hypre_float relax_wt ); +HYPRE_Int +HYPRE_ParCSRHybridSetRelaxWt_dbl( HYPRE_Solver solver, hypre_double relax_wt ); +HYPRE_Int +HYPRE_ParCSRHybridSetRelaxWt_long_dbl( HYPRE_Solver solver, hypre_long_double relax_wt ); +HYPRE_Int +HYPRE_ParCSRHybridSetRelaxWt( HYPRE_Solver solver, hypre_long_double relax_wt ); + +HYPRE_Int +HYPRE_ParCSRHybridSetSeqThreshold_flt( HYPRE_Solver solver, HYPRE_Int seq_threshold ); +HYPRE_Int +HYPRE_ParCSRHybridSetSeqThreshold_dbl( HYPRE_Solver solver, HYPRE_Int seq_threshold ); +HYPRE_Int +HYPRE_ParCSRHybridSetSeqThreshold_long_dbl( HYPRE_Solver solver, HYPRE_Int seq_threshold ); +HYPRE_Int +HYPRE_ParCSRHybridSetSeqThreshold( HYPRE_Solver solver, HYPRE_Int seq_threshold ); + +HYPRE_Int +HYPRE_ParCSRHybridSetSetupType_flt( HYPRE_Solver solver, HYPRE_Int setup_type ); +HYPRE_Int +HYPRE_ParCSRHybridSetSetupType_dbl( HYPRE_Solver solver, HYPRE_Int setup_type ); +HYPRE_Int +HYPRE_ParCSRHybridSetSetupType_long_dbl( HYPRE_Solver solver, HYPRE_Int setup_type ); +HYPRE_Int +HYPRE_ParCSRHybridSetSetupType( HYPRE_Solver solver, HYPRE_Int setup_type ); + +HYPRE_Int +HYPRE_ParCSRHybridSetSolverType_flt( HYPRE_Solver solver, HYPRE_Int solver_type ); +HYPRE_Int +HYPRE_ParCSRHybridSetSolverType_dbl( HYPRE_Solver solver, HYPRE_Int solver_type ); +HYPRE_Int +HYPRE_ParCSRHybridSetSolverType_long_dbl( HYPRE_Solver solver, HYPRE_Int solver_type ); +HYPRE_Int +HYPRE_ParCSRHybridSetSolverType( HYPRE_Solver solver, HYPRE_Int solver_type ); + +HYPRE_Int +HYPRE_ParCSRHybridSetStopCrit_flt( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_ParCSRHybridSetStopCrit_dbl( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_ParCSRHybridSetStopCrit_long_dbl( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_ParCSRHybridSetStopCrit( HYPRE_Solver solver, HYPRE_Int stop_crit ); + +HYPRE_Int +HYPRE_ParCSRHybridSetStrongThreshold_flt( HYPRE_Solver solver, hypre_float strong_threshold ); +HYPRE_Int +HYPRE_ParCSRHybridSetStrongThreshold_dbl( HYPRE_Solver solver, hypre_double strong_threshold ); +HYPRE_Int +HYPRE_ParCSRHybridSetStrongThreshold_long_dbl( HYPRE_Solver solver, hypre_long_double strong_threshold ); +HYPRE_Int +HYPRE_ParCSRHybridSetStrongThreshold( HYPRE_Solver solver, hypre_long_double strong_threshold ); + +HYPRE_Int +HYPRE_ParCSRHybridSetTol_flt( HYPRE_Solver solver, hypre_float tol ); +HYPRE_Int +HYPRE_ParCSRHybridSetTol_dbl( HYPRE_Solver solver, hypre_double tol ); +HYPRE_Int +HYPRE_ParCSRHybridSetTol_long_dbl( HYPRE_Solver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_ParCSRHybridSetTol( HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_ParCSRHybridSetTruncFactor_flt( HYPRE_Solver solver, hypre_float trunc_factor ); +HYPRE_Int +HYPRE_ParCSRHybridSetTruncFactor_dbl( HYPRE_Solver solver, hypre_double trunc_factor ); +HYPRE_Int +HYPRE_ParCSRHybridSetTruncFactor_long_dbl( HYPRE_Solver solver, hypre_long_double trunc_factor ); +HYPRE_Int +HYPRE_ParCSRHybridSetTruncFactor( HYPRE_Solver solver, hypre_long_double trunc_factor ); + +HYPRE_Int +HYPRE_ParCSRHybridSetTwoNorm_flt( HYPRE_Solver solver, HYPRE_Int two_norm ); +HYPRE_Int +HYPRE_ParCSRHybridSetTwoNorm_dbl( HYPRE_Solver solver, HYPRE_Int two_norm ); +HYPRE_Int +HYPRE_ParCSRHybridSetTwoNorm_long_dbl( HYPRE_Solver solver, HYPRE_Int two_norm ); +HYPRE_Int +HYPRE_ParCSRHybridSetTwoNorm( HYPRE_Solver solver, HYPRE_Int two_norm ); + +HYPRE_Int +HYPRE_ParCSRHybridSetup_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRHybridSetup_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRHybridSetup_long_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRHybridSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRHybridSolve_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRHybridSolve_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRHybridSolve_long_dbl( 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_ParCSRLGMRESCreate_flt( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParCSRLGMRESCreate_dbl( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParCSRLGMRESCreate_long_dbl( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParCSRLGMRESCreate( MPI_Comm comm, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_ParCSRLGMRESDestroy_flt( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParCSRLGMRESDestroy_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParCSRLGMRESDestroy_long_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParCSRLGMRESDestroy( HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_ParCSRLGMRESGetFinalRelativeResidualNorm_flt( HYPRE_Solver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_ParCSRLGMRESGetFinalRelativeResidualNorm_dbl( HYPRE_Solver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_ParCSRLGMRESGetFinalRelativeResidualNorm_long_dbl( HYPRE_Solver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_ParCSRLGMRESGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *norm ); + +HYPRE_Int +HYPRE_ParCSRLGMRESGetNumIterations_flt( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_ParCSRLGMRESGetNumIterations_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_ParCSRLGMRESGetNumIterations_long_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_ParCSRLGMRESGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_ParCSRLGMRESGetPrecond_flt( HYPRE_Solver solver, HYPRE_Solver *precond_data ); +HYPRE_Int +HYPRE_ParCSRLGMRESGetPrecond_dbl( HYPRE_Solver solver, HYPRE_Solver *precond_data ); +HYPRE_Int +HYPRE_ParCSRLGMRESGetPrecond_long_dbl( HYPRE_Solver solver, HYPRE_Solver *precond_data ); +HYPRE_Int +HYPRE_ParCSRLGMRESGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data ); + +HYPRE_Int +HYPRE_ParCSRLGMRESGetResidual_flt( HYPRE_Solver solver, HYPRE_ParVector *residual ); +HYPRE_Int +HYPRE_ParCSRLGMRESGetResidual_dbl( HYPRE_Solver solver, HYPRE_ParVector *residual ); +HYPRE_Int +HYPRE_ParCSRLGMRESGetResidual_long_dbl( HYPRE_Solver solver, HYPRE_ParVector *residual ); +HYPRE_Int +HYPRE_ParCSRLGMRESGetResidual( HYPRE_Solver solver, HYPRE_ParVector *residual ); + +HYPRE_Int +HYPRE_ParCSRLGMRESSetAbsoluteTol_flt( HYPRE_Solver solver, hypre_float a_tol ); +HYPRE_Int +HYPRE_ParCSRLGMRESSetAbsoluteTol_dbl( HYPRE_Solver solver, hypre_double a_tol ); +HYPRE_Int +HYPRE_ParCSRLGMRESSetAbsoluteTol_long_dbl( HYPRE_Solver solver, hypre_long_double a_tol ); +HYPRE_Int +HYPRE_ParCSRLGMRESSetAbsoluteTol( HYPRE_Solver solver, hypre_long_double a_tol ); + +HYPRE_Int +HYPRE_ParCSRLGMRESSetAugDim_flt( HYPRE_Solver solver, HYPRE_Int aug_dim ); +HYPRE_Int +HYPRE_ParCSRLGMRESSetAugDim_dbl( HYPRE_Solver solver, HYPRE_Int aug_dim ); +HYPRE_Int +HYPRE_ParCSRLGMRESSetAugDim_long_dbl( HYPRE_Solver solver, HYPRE_Int aug_dim ); +HYPRE_Int +HYPRE_ParCSRLGMRESSetAugDim( HYPRE_Solver solver, HYPRE_Int aug_dim ); + +HYPRE_Int +HYPRE_ParCSRLGMRESSetKDim_flt( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_ParCSRLGMRESSetKDim_dbl( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_ParCSRLGMRESSetKDim_long_dbl( HYPRE_Solver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_ParCSRLGMRESSetKDim( HYPRE_Solver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_ParCSRLGMRESSetLogging_flt( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParCSRLGMRESSetLogging_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParCSRLGMRESSetLogging_long_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParCSRLGMRESSetLogging( HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_ParCSRLGMRESSetMaxIter_flt( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_ParCSRLGMRESSetMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_ParCSRLGMRESSetMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_ParCSRLGMRESSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_ParCSRLGMRESSetMinIter_flt( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_ParCSRLGMRESSetMinIter_dbl( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_ParCSRLGMRESSetMinIter_long_dbl( HYPRE_Solver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_ParCSRLGMRESSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_ParCSRLGMRESSetPrecond_flt( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_ParCSRLGMRESSetPrecond_dbl( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_ParCSRLGMRESSetPrecond_long_dbl( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_ParCSRLGMRESSetPrecond( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_ParCSRLGMRESSetPrintLevel_flt( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_ParCSRLGMRESSetPrintLevel_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_ParCSRLGMRESSetPrintLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_ParCSRLGMRESSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_ParCSRLGMRESSetTol_flt( HYPRE_Solver solver, hypre_float tol ); +HYPRE_Int +HYPRE_ParCSRLGMRESSetTol_dbl( HYPRE_Solver solver, hypre_double tol ); +HYPRE_Int +HYPRE_ParCSRLGMRESSetTol_long_dbl( HYPRE_Solver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_ParCSRLGMRESSetTol( HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_ParCSRLGMRESSetup_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRLGMRESSetup_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRLGMRESSetup_long_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRLGMRESSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRLGMRESSolve_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRLGMRESSolve_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRLGMRESSolve_long_dbl( 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_ParCSRMultiVectorPrint_flt( void *x_, const char *fileName ); +HYPRE_Int +HYPRE_ParCSRMultiVectorPrint_dbl( void *x_, const char *fileName ); +HYPRE_Int +HYPRE_ParCSRMultiVectorPrint_long_dbl( void *x_, const char *fileName ); +HYPRE_Int +HYPRE_ParCSRMultiVectorPrint( void *x_, const char *fileName ); + +void * +HYPRE_ParCSRMultiVectorRead_flt( MPI_Comm comm, void *ii_, const char *fileName ); +void * +HYPRE_ParCSRMultiVectorRead_dbl( MPI_Comm comm, void *ii_, const char *fileName ); +void * +HYPRE_ParCSRMultiVectorRead_long_dbl( MPI_Comm comm, void *ii_, const char *fileName ); +void * +HYPRE_ParCSRMultiVectorRead( MPI_Comm comm, void *ii_, const char *fileName ); + +HYPRE_Int +HYPRE_ParCSROnProcTriSetup_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix HA, HYPRE_ParVector Hy, HYPRE_ParVector Hx ); +HYPRE_Int +HYPRE_ParCSROnProcTriSetup_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix HA, HYPRE_ParVector Hy, HYPRE_ParVector Hx ); +HYPRE_Int +HYPRE_ParCSROnProcTriSetup_long_dbl( 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_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix HA, HYPRE_ParVector Hy, HYPRE_ParVector Hx ); +HYPRE_Int +HYPRE_ParCSROnProcTriSolve_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix HA, HYPRE_ParVector Hy, HYPRE_ParVector Hx ); +HYPRE_Int +HYPRE_ParCSROnProcTriSolve_long_dbl( 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_ParCSRPCGCreate_flt( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParCSRPCGCreate_dbl( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParCSRPCGCreate_long_dbl( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParCSRPCGCreate( MPI_Comm comm, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_ParCSRPCGDestroy_flt( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParCSRPCGDestroy_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParCSRPCGDestroy_long_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParCSRPCGDestroy( HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_ParCSRPCGGetFinalRelativeResidualNorm_flt( HYPRE_Solver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_ParCSRPCGGetFinalRelativeResidualNorm_dbl( HYPRE_Solver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_ParCSRPCGGetFinalRelativeResidualNorm_long_dbl( HYPRE_Solver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_ParCSRPCGGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *norm ); + +HYPRE_Int +HYPRE_ParCSRPCGGetNumIterations_flt( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_ParCSRPCGGetNumIterations_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_ParCSRPCGGetNumIterations_long_dbl( HYPRE_Solver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_ParCSRPCGGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_ParCSRPCGGetPrecond_flt( HYPRE_Solver solver, HYPRE_Solver *precond_data ); +HYPRE_Int +HYPRE_ParCSRPCGGetPrecond_dbl( HYPRE_Solver solver, HYPRE_Solver *precond_data ); +HYPRE_Int +HYPRE_ParCSRPCGGetPrecond_long_dbl( HYPRE_Solver solver, HYPRE_Solver *precond_data ); +HYPRE_Int +HYPRE_ParCSRPCGGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data ); + +HYPRE_Int +HYPRE_ParCSRPCGGetResidual_flt( HYPRE_Solver solver, HYPRE_ParVector *residual ); +HYPRE_Int +HYPRE_ParCSRPCGGetResidual_dbl( HYPRE_Solver solver, HYPRE_ParVector *residual ); +HYPRE_Int +HYPRE_ParCSRPCGGetResidual_long_dbl( HYPRE_Solver solver, HYPRE_ParVector *residual ); +HYPRE_Int +HYPRE_ParCSRPCGGetResidual( HYPRE_Solver solver, HYPRE_ParVector *residual ); + +HYPRE_Int +HYPRE_ParCSRPCGSetAbsoluteTol_flt( HYPRE_Solver solver, hypre_float tol ); +HYPRE_Int +HYPRE_ParCSRPCGSetAbsoluteTol_dbl( HYPRE_Solver solver, hypre_double tol ); +HYPRE_Int +HYPRE_ParCSRPCGSetAbsoluteTol_long_dbl( HYPRE_Solver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_ParCSRPCGSetAbsoluteTol( HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_ParCSRPCGSetLogging_flt( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParCSRPCGSetLogging_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParCSRPCGSetLogging_long_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParCSRPCGSetLogging( HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_ParCSRPCGSetMaxIter_flt( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_ParCSRPCGSetMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_ParCSRPCGSetMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_ParCSRPCGSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_ParCSRPCGSetPrecond_flt( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_ParCSRPCGSetPrecond_dbl( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_ParCSRPCGSetPrecond_long_dbl( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); +HYPRE_Int +HYPRE_ParCSRPCGSetPrecond( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_ParCSRPCGSetPreconditioner_flt( HYPRE_Solver solver, HYPRE_Solver precond ); +HYPRE_Int +HYPRE_ParCSRPCGSetPreconditioner_dbl( HYPRE_Solver solver, HYPRE_Solver precond ); +HYPRE_Int +HYPRE_ParCSRPCGSetPreconditioner_long_dbl( HYPRE_Solver solver, HYPRE_Solver precond ); +HYPRE_Int +HYPRE_ParCSRPCGSetPreconditioner( HYPRE_Solver solver, HYPRE_Solver precond ); + +HYPRE_Int +HYPRE_ParCSRPCGSetPrintLevel_flt( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_ParCSRPCGSetPrintLevel_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_ParCSRPCGSetPrintLevel_long_dbl( HYPRE_Solver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_ParCSRPCGSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_ParCSRPCGSetRelChange_flt( HYPRE_Solver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_ParCSRPCGSetRelChange_dbl( HYPRE_Solver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_ParCSRPCGSetRelChange_long_dbl( HYPRE_Solver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_ParCSRPCGSetRelChange( HYPRE_Solver solver, HYPRE_Int rel_change ); + +HYPRE_Int +HYPRE_ParCSRPCGSetStopCrit_flt( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_ParCSRPCGSetStopCrit_dbl( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_ParCSRPCGSetStopCrit_long_dbl( HYPRE_Solver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_ParCSRPCGSetStopCrit( HYPRE_Solver solver, HYPRE_Int stop_crit ); + +HYPRE_Int +HYPRE_ParCSRPCGSetTol_flt( HYPRE_Solver solver, hypre_float tol ); +HYPRE_Int +HYPRE_ParCSRPCGSetTol_dbl( HYPRE_Solver solver, hypre_double tol ); +HYPRE_Int +HYPRE_ParCSRPCGSetTol_long_dbl( HYPRE_Solver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_ParCSRPCGSetTol( HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_ParCSRPCGSetTwoNorm_flt( HYPRE_Solver solver, HYPRE_Int two_norm ); +HYPRE_Int +HYPRE_ParCSRPCGSetTwoNorm_dbl( HYPRE_Solver solver, HYPRE_Int two_norm ); +HYPRE_Int +HYPRE_ParCSRPCGSetTwoNorm_long_dbl( HYPRE_Solver solver, HYPRE_Int two_norm ); +HYPRE_Int +HYPRE_ParCSRPCGSetTwoNorm( HYPRE_Solver solver, HYPRE_Int two_norm ); + +HYPRE_Int +HYPRE_ParCSRPCGSetup_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRPCGSetup_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRPCGSetup_long_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRPCGSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRPCGSolve_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRPCGSolve_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRPCGSolve_long_dbl( 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_ParCSRParaSailsCreate_flt( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParCSRParaSailsCreate_dbl( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParCSRParaSailsCreate_long_dbl( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParCSRParaSailsCreate( MPI_Comm comm, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_ParCSRParaSailsDestroy_flt( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParCSRParaSailsDestroy_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParCSRParaSailsDestroy_long_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParCSRParaSailsDestroy( HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_ParCSRParaSailsSetFilter_flt( HYPRE_Solver solver, hypre_float filter ); +HYPRE_Int +HYPRE_ParCSRParaSailsSetFilter_dbl( HYPRE_Solver solver, hypre_double filter ); +HYPRE_Int +HYPRE_ParCSRParaSailsSetFilter_long_dbl( HYPRE_Solver solver, hypre_long_double filter ); +HYPRE_Int +HYPRE_ParCSRParaSailsSetFilter( HYPRE_Solver solver, hypre_long_double filter ); + +HYPRE_Int +HYPRE_ParCSRParaSailsSetLoadbal_flt( HYPRE_Solver solver, hypre_float loadbal ); +HYPRE_Int +HYPRE_ParCSRParaSailsSetLoadbal_dbl( HYPRE_Solver solver, hypre_double loadbal ); +HYPRE_Int +HYPRE_ParCSRParaSailsSetLoadbal_long_dbl( HYPRE_Solver solver, hypre_long_double loadbal ); +HYPRE_Int +HYPRE_ParCSRParaSailsSetLoadbal( HYPRE_Solver solver, hypre_long_double loadbal ); + +HYPRE_Int +HYPRE_ParCSRParaSailsSetLogging_flt( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParCSRParaSailsSetLogging_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParCSRParaSailsSetLogging_long_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParCSRParaSailsSetLogging( HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_ParCSRParaSailsSetParams_flt( HYPRE_Solver solver, hypre_float thresh, HYPRE_Int nlevels ); +HYPRE_Int +HYPRE_ParCSRParaSailsSetParams_dbl( HYPRE_Solver solver, hypre_double thresh, HYPRE_Int nlevels ); +HYPRE_Int +HYPRE_ParCSRParaSailsSetParams_long_dbl( HYPRE_Solver solver, hypre_long_double thresh, HYPRE_Int nlevels ); +HYPRE_Int +HYPRE_ParCSRParaSailsSetParams( HYPRE_Solver solver, hypre_long_double thresh, HYPRE_Int nlevels ); + +HYPRE_Int +HYPRE_ParCSRParaSailsSetReuse_flt( HYPRE_Solver solver, HYPRE_Int reuse ); +HYPRE_Int +HYPRE_ParCSRParaSailsSetReuse_dbl( HYPRE_Solver solver, HYPRE_Int reuse ); +HYPRE_Int +HYPRE_ParCSRParaSailsSetReuse_long_dbl( HYPRE_Solver solver, HYPRE_Int reuse ); +HYPRE_Int +HYPRE_ParCSRParaSailsSetReuse( HYPRE_Solver solver, HYPRE_Int reuse ); + +HYPRE_Int +HYPRE_ParCSRParaSailsSetSym_flt( HYPRE_Solver solver, HYPRE_Int sym ); +HYPRE_Int +HYPRE_ParCSRParaSailsSetSym_dbl( HYPRE_Solver solver, HYPRE_Int sym ); +HYPRE_Int +HYPRE_ParCSRParaSailsSetSym_long_dbl( HYPRE_Solver solver, HYPRE_Int sym ); +HYPRE_Int +HYPRE_ParCSRParaSailsSetSym( HYPRE_Solver solver, HYPRE_Int sym ); + +HYPRE_Int +HYPRE_ParCSRParaSailsSetup_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRParaSailsSetup_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRParaSailsSetup_long_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRParaSailsSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRParaSailsSolve_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRParaSailsSolve_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRParaSailsSolve_long_dbl( 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_ParCSRPilutCreate_flt( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParCSRPilutCreate_dbl( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParCSRPilutCreate_long_dbl( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParCSRPilutCreate( MPI_Comm comm, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_ParCSRPilutDestroy_flt( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParCSRPilutDestroy_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParCSRPilutDestroy_long_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParCSRPilutDestroy( HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_ParCSRPilutSetDropTolerance_flt( HYPRE_Solver solver, hypre_float tol ); +HYPRE_Int +HYPRE_ParCSRPilutSetDropTolerance_dbl( HYPRE_Solver solver, hypre_double tol ); +HYPRE_Int +HYPRE_ParCSRPilutSetDropTolerance_long_dbl( HYPRE_Solver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_ParCSRPilutSetDropTolerance( HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_ParCSRPilutSetFactorRowSize_flt( HYPRE_Solver solver, HYPRE_Int size ); +HYPRE_Int +HYPRE_ParCSRPilutSetFactorRowSize_dbl( HYPRE_Solver solver, HYPRE_Int size ); +HYPRE_Int +HYPRE_ParCSRPilutSetFactorRowSize_long_dbl( HYPRE_Solver solver, HYPRE_Int size ); +HYPRE_Int +HYPRE_ParCSRPilutSetFactorRowSize( HYPRE_Solver solver, HYPRE_Int size ); + +HYPRE_Int +HYPRE_ParCSRPilutSetLogging_flt( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParCSRPilutSetLogging_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParCSRPilutSetLogging_long_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParCSRPilutSetLogging( HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_ParCSRPilutSetMaxIter_flt( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_ParCSRPilutSetMaxIter_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_ParCSRPilutSetMaxIter_long_dbl( HYPRE_Solver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_ParCSRPilutSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_ParCSRPilutSetup_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRPilutSetup_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRPilutSetup_long_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRPilutSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRPilutSolve_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRPilutSolve_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParCSRPilutSolve_long_dbl( 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_ParCSRSetupInterpreter_flt( mv_InterfaceInterpreter *i ); +HYPRE_Int +HYPRE_ParCSRSetupInterpreter_dbl( mv_InterfaceInterpreter *i ); +HYPRE_Int +HYPRE_ParCSRSetupInterpreter_long_dbl( mv_InterfaceInterpreter *i ); +HYPRE_Int +HYPRE_ParCSRSetupInterpreter( mv_InterfaceInterpreter *i ); + +HYPRE_Int +HYPRE_ParCSRSetupMatvec_flt( HYPRE_MatvecFunctions *mv ); +HYPRE_Int +HYPRE_ParCSRSetupMatvec_dbl( HYPRE_MatvecFunctions *mv ); +HYPRE_Int +HYPRE_ParCSRSetupMatvec_long_dbl( HYPRE_MatvecFunctions *mv ); +HYPRE_Int +HYPRE_ParCSRSetupMatvec( HYPRE_MatvecFunctions *mv ); + +HYPRE_Int +HYPRE_ParaSailsBuildIJMatrix_flt( HYPRE_Solver solver, HYPRE_IJMatrix *pij_A ); +HYPRE_Int +HYPRE_ParaSailsBuildIJMatrix_dbl( HYPRE_Solver solver, HYPRE_IJMatrix *pij_A ); +HYPRE_Int +HYPRE_ParaSailsBuildIJMatrix_long_dbl( HYPRE_Solver solver, HYPRE_IJMatrix *pij_A ); +HYPRE_Int +HYPRE_ParaSailsBuildIJMatrix( HYPRE_Solver solver, HYPRE_IJMatrix *pij_A ); + +HYPRE_Int +HYPRE_ParaSailsCreate_flt( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParaSailsCreate_dbl( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParaSailsCreate_long_dbl( MPI_Comm comm, HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_ParaSailsCreate( MPI_Comm comm, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_ParaSailsDestroy_flt( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParaSailsDestroy_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParaSailsDestroy_long_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_ParaSailsDestroy( HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_ParaSailsGetFilter_flt( HYPRE_Solver solver, hypre_float *filter ); +HYPRE_Int +HYPRE_ParaSailsGetFilter_dbl( HYPRE_Solver solver, hypre_double *filter ); +HYPRE_Int +HYPRE_ParaSailsGetFilter_long_dbl( HYPRE_Solver solver, hypre_long_double *filter ); +HYPRE_Int +HYPRE_ParaSailsGetFilter( HYPRE_Solver solver, void *filter ); + +HYPRE_Int +HYPRE_ParaSailsGetLoadbal_flt( HYPRE_Solver solver, hypre_float *loadbal ); +HYPRE_Int +HYPRE_ParaSailsGetLoadbal_dbl( HYPRE_Solver solver, hypre_double *loadbal ); +HYPRE_Int +HYPRE_ParaSailsGetLoadbal_long_dbl( HYPRE_Solver solver, hypre_long_double *loadbal ); +HYPRE_Int +HYPRE_ParaSailsGetLoadbal( HYPRE_Solver solver, void *loadbal ); + +HYPRE_Int +HYPRE_ParaSailsGetLogging_flt( HYPRE_Solver solver, HYPRE_Int *logging ); +HYPRE_Int +HYPRE_ParaSailsGetLogging_dbl( HYPRE_Solver solver, HYPRE_Int *logging ); +HYPRE_Int +HYPRE_ParaSailsGetLogging_long_dbl( HYPRE_Solver solver, HYPRE_Int *logging ); +HYPRE_Int +HYPRE_ParaSailsGetLogging( HYPRE_Solver solver, HYPRE_Int *logging ); + +HYPRE_Int +HYPRE_ParaSailsGetNlevels_flt( HYPRE_Solver solver, HYPRE_Int *nlevels ); +HYPRE_Int +HYPRE_ParaSailsGetNlevels_dbl( HYPRE_Solver solver, HYPRE_Int *nlevels ); +HYPRE_Int +HYPRE_ParaSailsGetNlevels_long_dbl( HYPRE_Solver solver, HYPRE_Int *nlevels ); +HYPRE_Int +HYPRE_ParaSailsGetNlevels( HYPRE_Solver solver, HYPRE_Int *nlevels ); + +HYPRE_Int +HYPRE_ParaSailsGetReuse_flt( HYPRE_Solver solver, HYPRE_Int *reuse ); +HYPRE_Int +HYPRE_ParaSailsGetReuse_dbl( HYPRE_Solver solver, HYPRE_Int *reuse ); +HYPRE_Int +HYPRE_ParaSailsGetReuse_long_dbl( HYPRE_Solver solver, HYPRE_Int *reuse ); +HYPRE_Int +HYPRE_ParaSailsGetReuse( HYPRE_Solver solver, HYPRE_Int *reuse ); + +HYPRE_Int +HYPRE_ParaSailsGetSym_flt( HYPRE_Solver solver, HYPRE_Int *sym ); +HYPRE_Int +HYPRE_ParaSailsGetSym_dbl( HYPRE_Solver solver, HYPRE_Int *sym ); +HYPRE_Int +HYPRE_ParaSailsGetSym_long_dbl( HYPRE_Solver solver, HYPRE_Int *sym ); +HYPRE_Int +HYPRE_ParaSailsGetSym( HYPRE_Solver solver, HYPRE_Int *sym ); + +HYPRE_Int +HYPRE_ParaSailsGetThresh_flt( HYPRE_Solver solver, hypre_float *thresh ); +HYPRE_Int +HYPRE_ParaSailsGetThresh_dbl( HYPRE_Solver solver, hypre_double *thresh ); +HYPRE_Int +HYPRE_ParaSailsGetThresh_long_dbl( HYPRE_Solver solver, hypre_long_double *thresh ); +HYPRE_Int +HYPRE_ParaSailsGetThresh( HYPRE_Solver solver, void *thresh ); + +HYPRE_Int +HYPRE_ParaSailsSetFilter_flt( HYPRE_Solver solver, hypre_float filter ); +HYPRE_Int +HYPRE_ParaSailsSetFilter_dbl( HYPRE_Solver solver, hypre_double filter ); +HYPRE_Int +HYPRE_ParaSailsSetFilter_long_dbl( HYPRE_Solver solver, hypre_long_double filter ); +HYPRE_Int +HYPRE_ParaSailsSetFilter( HYPRE_Solver solver, hypre_long_double filter ); + +HYPRE_Int +HYPRE_ParaSailsSetLoadbal_flt( HYPRE_Solver solver, hypre_float loadbal ); +HYPRE_Int +HYPRE_ParaSailsSetLoadbal_dbl( HYPRE_Solver solver, hypre_double loadbal ); +HYPRE_Int +HYPRE_ParaSailsSetLoadbal_long_dbl( HYPRE_Solver solver, hypre_long_double loadbal ); +HYPRE_Int +HYPRE_ParaSailsSetLoadbal( HYPRE_Solver solver, hypre_long_double loadbal ); + +HYPRE_Int +HYPRE_ParaSailsSetLogging_flt( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParaSailsSetLogging_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParaSailsSetLogging_long_dbl( HYPRE_Solver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_ParaSailsSetLogging( HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_ParaSailsSetNlevels_flt( HYPRE_Solver solver, HYPRE_Int nlevels ); +HYPRE_Int +HYPRE_ParaSailsSetNlevels_dbl( HYPRE_Solver solver, HYPRE_Int nlevels ); +HYPRE_Int +HYPRE_ParaSailsSetNlevels_long_dbl( HYPRE_Solver solver, HYPRE_Int nlevels ); +HYPRE_Int +HYPRE_ParaSailsSetNlevels( HYPRE_Solver solver, HYPRE_Int nlevels ); + +HYPRE_Int +HYPRE_ParaSailsSetParams_flt( HYPRE_Solver solver, hypre_float thresh, HYPRE_Int nlevels ); +HYPRE_Int +HYPRE_ParaSailsSetParams_dbl( HYPRE_Solver solver, hypre_double thresh, HYPRE_Int nlevels ); +HYPRE_Int +HYPRE_ParaSailsSetParams_long_dbl( HYPRE_Solver solver, hypre_long_double thresh, HYPRE_Int nlevels ); +HYPRE_Int +HYPRE_ParaSailsSetParams( HYPRE_Solver solver, hypre_long_double thresh, HYPRE_Int nlevels ); + +HYPRE_Int +HYPRE_ParaSailsSetReuse_flt( HYPRE_Solver solver, HYPRE_Int reuse ); +HYPRE_Int +HYPRE_ParaSailsSetReuse_dbl( HYPRE_Solver solver, HYPRE_Int reuse ); +HYPRE_Int +HYPRE_ParaSailsSetReuse_long_dbl( HYPRE_Solver solver, HYPRE_Int reuse ); +HYPRE_Int +HYPRE_ParaSailsSetReuse( HYPRE_Solver solver, HYPRE_Int reuse ); + +HYPRE_Int +HYPRE_ParaSailsSetSym_flt( HYPRE_Solver solver, HYPRE_Int sym ); +HYPRE_Int +HYPRE_ParaSailsSetSym_dbl( HYPRE_Solver solver, HYPRE_Int sym ); +HYPRE_Int +HYPRE_ParaSailsSetSym_long_dbl( HYPRE_Solver solver, HYPRE_Int sym ); +HYPRE_Int +HYPRE_ParaSailsSetSym( HYPRE_Solver solver, HYPRE_Int sym ); + +HYPRE_Int +HYPRE_ParaSailsSetThresh_flt( HYPRE_Solver solver, hypre_float thresh ); +HYPRE_Int +HYPRE_ParaSailsSetThresh_dbl( HYPRE_Solver solver, hypre_double thresh ); +HYPRE_Int +HYPRE_ParaSailsSetThresh_long_dbl( HYPRE_Solver solver, hypre_long_double thresh ); +HYPRE_Int +HYPRE_ParaSailsSetThresh( HYPRE_Solver solver, hypre_long_double thresh ); + +HYPRE_Int +HYPRE_ParaSailsSetup_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParaSailsSetup_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParaSailsSetup_long_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParaSailsSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParaSailsSolve_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParaSailsSolve_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParaSailsSolve_long_dbl( 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_SchwarzCreate_flt( HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_SchwarzCreate_dbl( HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_SchwarzCreate_long_dbl( HYPRE_Solver *solver ); +HYPRE_Int +HYPRE_SchwarzCreate( HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_SchwarzDestroy_flt( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_SchwarzDestroy_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_SchwarzDestroy_long_dbl( HYPRE_Solver solver ); +HYPRE_Int +HYPRE_SchwarzDestroy( HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_SchwarzSetDofFunc_flt( HYPRE_Solver solver, HYPRE_Int *dof_func ); +HYPRE_Int +HYPRE_SchwarzSetDofFunc_dbl( HYPRE_Solver solver, HYPRE_Int *dof_func ); +HYPRE_Int +HYPRE_SchwarzSetDofFunc_long_dbl( HYPRE_Solver solver, HYPRE_Int *dof_func ); +HYPRE_Int +HYPRE_SchwarzSetDofFunc( HYPRE_Solver solver, HYPRE_Int *dof_func ); + +HYPRE_Int +HYPRE_SchwarzSetDomainStructure_flt( HYPRE_Solver solver, HYPRE_CSRMatrix domain_structure ); +HYPRE_Int +HYPRE_SchwarzSetDomainStructure_dbl( HYPRE_Solver solver, HYPRE_CSRMatrix domain_structure ); +HYPRE_Int +HYPRE_SchwarzSetDomainStructure_long_dbl( HYPRE_Solver solver, HYPRE_CSRMatrix domain_structure ); +HYPRE_Int +HYPRE_SchwarzSetDomainStructure( HYPRE_Solver solver, HYPRE_CSRMatrix domain_structure ); + +HYPRE_Int +HYPRE_SchwarzSetDomainType_flt( HYPRE_Solver solver, HYPRE_Int domain_type ); +HYPRE_Int +HYPRE_SchwarzSetDomainType_dbl( HYPRE_Solver solver, HYPRE_Int domain_type ); +HYPRE_Int +HYPRE_SchwarzSetDomainType_long_dbl( HYPRE_Solver solver, HYPRE_Int domain_type ); +HYPRE_Int +HYPRE_SchwarzSetDomainType( HYPRE_Solver solver, HYPRE_Int domain_type ); + +HYPRE_Int +HYPRE_SchwarzSetNonSymm_flt( HYPRE_Solver solver, HYPRE_Int use_nonsymm ); +HYPRE_Int +HYPRE_SchwarzSetNonSymm_dbl( HYPRE_Solver solver, HYPRE_Int use_nonsymm ); +HYPRE_Int +HYPRE_SchwarzSetNonSymm_long_dbl( HYPRE_Solver solver, HYPRE_Int use_nonsymm ); +HYPRE_Int +HYPRE_SchwarzSetNonSymm( HYPRE_Solver solver, HYPRE_Int use_nonsymm ); + +HYPRE_Int +HYPRE_SchwarzSetNumFunctions_flt( HYPRE_Solver solver, HYPRE_Int num_functions ); +HYPRE_Int +HYPRE_SchwarzSetNumFunctions_dbl( HYPRE_Solver solver, HYPRE_Int num_functions ); +HYPRE_Int +HYPRE_SchwarzSetNumFunctions_long_dbl( HYPRE_Solver solver, HYPRE_Int num_functions ); +HYPRE_Int +HYPRE_SchwarzSetNumFunctions( HYPRE_Solver solver, HYPRE_Int num_functions ); + +HYPRE_Int +HYPRE_SchwarzSetOverlap_flt( HYPRE_Solver solver, HYPRE_Int overlap ); +HYPRE_Int +HYPRE_SchwarzSetOverlap_dbl( HYPRE_Solver solver, HYPRE_Int overlap ); +HYPRE_Int +HYPRE_SchwarzSetOverlap_long_dbl( HYPRE_Solver solver, HYPRE_Int overlap ); +HYPRE_Int +HYPRE_SchwarzSetOverlap( HYPRE_Solver solver, HYPRE_Int overlap ); + +HYPRE_Int +HYPRE_SchwarzSetRelaxWeight_flt( HYPRE_Solver solver, hypre_float relax_weight ); +HYPRE_Int +HYPRE_SchwarzSetRelaxWeight_dbl( HYPRE_Solver solver, hypre_double relax_weight ); +HYPRE_Int +HYPRE_SchwarzSetRelaxWeight_long_dbl( HYPRE_Solver solver, hypre_long_double relax_weight ); +HYPRE_Int +HYPRE_SchwarzSetRelaxWeight( HYPRE_Solver solver, hypre_long_double relax_weight ); + +HYPRE_Int +HYPRE_SchwarzSetVariant_flt( HYPRE_Solver solver, HYPRE_Int variant ); +HYPRE_Int +HYPRE_SchwarzSetVariant_dbl( HYPRE_Solver solver, HYPRE_Int variant ); +HYPRE_Int +HYPRE_SchwarzSetVariant_long_dbl( HYPRE_Solver solver, HYPRE_Int variant ); +HYPRE_Int +HYPRE_SchwarzSetVariant( HYPRE_Solver solver, HYPRE_Int variant ); + +HYPRE_Int +HYPRE_SchwarzSetup_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_SchwarzSetup_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_SchwarzSetup_long_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_SchwarzSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_SchwarzSolve_flt( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_SchwarzSolve_dbl( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_SchwarzSolve_long_dbl( 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_TempParCSRSetupInterpreter_flt( mv_InterfaceInterpreter *i ); +HYPRE_Int +HYPRE_TempParCSRSetupInterpreter_dbl( mv_InterfaceInterpreter *i ); +HYPRE_Int +HYPRE_TempParCSRSetupInterpreter_long_dbl( mv_InterfaceInterpreter *i ); +HYPRE_Int +HYPRE_TempParCSRSetupInterpreter( mv_InterfaceInterpreter *i ); + + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_ADSCreate_pre( HYPRE_Precision precision, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_ADSDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_ADSGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *rel_resid_norm ); + +HYPRE_Int +HYPRE_ADSGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_ADSSetAMGOptions_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int coarsen_type, HYPRE_Int agg_levels, HYPRE_Int relax_type, hypre_long_double strength_threshold, HYPRE_Int interp_type, HYPRE_Int Pmax ); + +HYPRE_Int +HYPRE_ADSSetAMSOptions_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int cycle_type, HYPRE_Int coarsen_type, HYPRE_Int agg_levels, HYPRE_Int relax_type, hypre_long_double strength_threshold, HYPRE_Int interp_type, HYPRE_Int Pmax ); + +HYPRE_Int +HYPRE_ADSSetChebySmoothingOptions_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int cheby_order, hypre_long_double cheby_fraction ); + +HYPRE_Int +HYPRE_ADSSetCoordinateVectors_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParVector x, HYPRE_ParVector y, HYPRE_ParVector z ); + +HYPRE_Int +HYPRE_ADSSetCycleType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int cycle_type ); + +HYPRE_Int +HYPRE_ADSSetDiscreteCurl_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix C ); + +HYPRE_Int +HYPRE_ADSSetDiscreteGradient_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix G ); + +HYPRE_Int +HYPRE_ADSSetInterpolations_pre( HYPRE_Precision precision, 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_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int maxit ); + +HYPRE_Int +HYPRE_ADSSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_ADSSetSmoothingOptions_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int relax_type, HYPRE_Int relax_times, hypre_long_double relax_weight, hypre_long_double omega ); + +HYPRE_Int +HYPRE_ADSSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_ADSSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ADSSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_AMECreate_pre( HYPRE_Precision precision, HYPRE_Solver *esolver ); + +HYPRE_Int +HYPRE_AMEDestroy_pre( HYPRE_Precision precision, HYPRE_Solver esolver ); + +HYPRE_Int +HYPRE_AMEGetEigenvalues_pre( HYPRE_Precision precision, HYPRE_Solver esolver, void *eigenvalues ); + +HYPRE_Int +HYPRE_AMEGetEigenvectors_pre( HYPRE_Precision precision, HYPRE_Solver esolver, HYPRE_ParVector **eigenvectors ); + +HYPRE_Int +HYPRE_AMESetAMSSolver_pre( HYPRE_Precision precision, HYPRE_Solver esolver, HYPRE_Solver ams_solver ); + +HYPRE_Int +HYPRE_AMESetBlockSize_pre( HYPRE_Precision precision, HYPRE_Solver esolver, HYPRE_Int block_size ); + +HYPRE_Int +HYPRE_AMESetMassMatrix_pre( HYPRE_Precision precision, HYPRE_Solver esolver, HYPRE_ParCSRMatrix M ); + +HYPRE_Int +HYPRE_AMESetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver esolver, HYPRE_Int maxit ); + +HYPRE_Int +HYPRE_AMESetMaxPCGIter_pre( HYPRE_Precision precision, HYPRE_Solver esolver, HYPRE_Int maxit ); + +HYPRE_Int +HYPRE_AMESetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver esolver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_AMESetRTol_pre( HYPRE_Precision precision, HYPRE_Solver esolver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_AMESetTol_pre( HYPRE_Precision precision, HYPRE_Solver esolver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_AMESetup_pre( HYPRE_Precision precision, HYPRE_Solver esolver ); + +HYPRE_Int +HYPRE_AMESolve_pre( HYPRE_Precision precision, HYPRE_Solver esolver ); + +HYPRE_Int +HYPRE_AMSConstructDiscreteGradient_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix A, HYPRE_ParVector x_coord, HYPRE_BigInt *edge_vertex, HYPRE_Int edge_orientation, HYPRE_ParCSRMatrix *G ); + +HYPRE_Int +HYPRE_AMSCreate_pre( HYPRE_Precision precision, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_AMSDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_AMSGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *rel_resid_norm ); + +HYPRE_Int +HYPRE_AMSGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_AMSProjectOutGradients_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_AMSSetAlphaAMGCoarseRelaxType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int alpha_coarse_relax_type ); + +HYPRE_Int +HYPRE_AMSSetAlphaAMGOptions_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int alpha_coarsen_type, HYPRE_Int alpha_agg_levels, HYPRE_Int alpha_relax_type, hypre_long_double alpha_strength_threshold, HYPRE_Int alpha_interp_type, HYPRE_Int alpha_Pmax ); + +HYPRE_Int +HYPRE_AMSSetAlphaPoissonMatrix_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A_alpha ); + +HYPRE_Int +HYPRE_AMSSetBetaAMGCoarseRelaxType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int beta_coarse_relax_type ); + +HYPRE_Int +HYPRE_AMSSetBetaAMGOptions_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int beta_coarsen_type, HYPRE_Int beta_agg_levels, HYPRE_Int beta_relax_type, hypre_long_double beta_strength_threshold, HYPRE_Int beta_interp_type, HYPRE_Int beta_Pmax ); + +HYPRE_Int +HYPRE_AMSSetBetaPoissonMatrix_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A_beta ); + +HYPRE_Int +HYPRE_AMSSetCoordinateVectors_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParVector x, HYPRE_ParVector y, HYPRE_ParVector z ); + +HYPRE_Int +HYPRE_AMSSetCycleType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int cycle_type ); + +HYPRE_Int +HYPRE_AMSSetDimension_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int dim ); + +HYPRE_Int +HYPRE_AMSSetDiscreteGradient_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix G ); + +HYPRE_Int +HYPRE_AMSSetEdgeConstantVectors_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParVector Gx, HYPRE_ParVector Gy, HYPRE_ParVector Gz ); + +HYPRE_Int +HYPRE_AMSSetInteriorNodes_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParVector interior_nodes ); + +HYPRE_Int +HYPRE_AMSSetInterpolations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix Pi, HYPRE_ParCSRMatrix Pix, HYPRE_ParCSRMatrix Piy, HYPRE_ParCSRMatrix Piz ); + +HYPRE_Int +HYPRE_AMSSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int maxit ); + +HYPRE_Int +HYPRE_AMSSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_AMSSetProjectionFrequency_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int projection_frequency ); + +HYPRE_Int +HYPRE_AMSSetSmoothingOptions_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int relax_type, HYPRE_Int relax_times, hypre_long_double relax_weight, hypre_long_double omega ); + +HYPRE_Int +HYPRE_AMSSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_AMSSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_AMSSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_BlockTridiagCreate_pre( HYPRE_Precision precision, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_BlockTridiagDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_BlockTridiagSetAMGNumSweeps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_sweeps ); + +HYPRE_Int +HYPRE_BlockTridiagSetAMGRelaxType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int relax_type ); + +HYPRE_Int +HYPRE_BlockTridiagSetAMGStrengthThreshold_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double thresh ); + +HYPRE_Int +HYPRE_BlockTridiagSetIndexSet_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int n, HYPRE_Int *inds ); + +HYPRE_Int +HYPRE_BlockTridiagSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_BlockTridiagSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_BlockTridiagSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_BoomerAMGCreate_pre( HYPRE_Precision precision, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_BoomerAMGDDCreate_pre( HYPRE_Precision precision, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_BoomerAMGDDDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_BoomerAMGDDGetAMG_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *amg_solver ); + +HYPRE_Int +HYPRE_BoomerAMGDDGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *rel_resid_norm ); + +HYPRE_Int +HYPRE_BoomerAMGDDGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_BoomerAMGDDSetFACCycleType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int amgdd_fac_cycle_type ); + +HYPRE_Int +HYPRE_BoomerAMGDDSetFACNumCycles_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int amgdd_fac_num_cycles ); + +HYPRE_Int +HYPRE_BoomerAMGDDSetFACNumRelax_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int amgdd_fac_num_relax ); + +HYPRE_Int +HYPRE_BoomerAMGDDSetFACRelaxType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int amgdd_fac_relax_type ); + +HYPRE_Int +HYPRE_BoomerAMGDDSetFACRelaxWeight_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double amgdd_fac_relax_weight ); + +HYPRE_Int +HYPRE_BoomerAMGDDSetNumGhostLayers_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_ghost_layers ); + +HYPRE_Int +HYPRE_BoomerAMGDDSetPadding_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int padding ); + +HYPRE_Int +HYPRE_BoomerAMGDDSetStartLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int start_level ); + +HYPRE_Int +HYPRE_BoomerAMGDDSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_BoomerAMGDDSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_BoomerAMGDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_BoomerAMGGetAdditive_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *additive ); + +HYPRE_Int +HYPRE_BoomerAMGGetCoarsenCutFactor_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *coarsen_cut_factor ); + +HYPRE_Int +HYPRE_BoomerAMGGetCoarsenType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *coarsen_type ); + +HYPRE_Int +HYPRE_BoomerAMGGetConvergeType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *type ); + +HYPRE_Int +HYPRE_BoomerAMGGetCumNnzAP_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *cum_nnz_AP ); + +HYPRE_Int +HYPRE_BoomerAMGGetCumNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *cum_num_iterations ); + +HYPRE_Int +HYPRE_BoomerAMGGetCycleNumSweeps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_sweeps, HYPRE_Int k ); + +HYPRE_Int +HYPRE_BoomerAMGGetCycleRelaxType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *relax_type, HYPRE_Int k ); + +HYPRE_Int +HYPRE_BoomerAMGGetCycleType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *cycle_type ); + +HYPRE_Int +HYPRE_BoomerAMGGetDebugFlag_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *debug_flag ); + +HYPRE_Int +HYPRE_BoomerAMGGetDomainType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *domain_type ); + +HYPRE_Int +HYPRE_BoomerAMGGetFCycle_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *fcycle ); + +HYPRE_Int +HYPRE_BoomerAMGGetFilterFunctions_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *filter_functions ); + +HYPRE_Int +HYPRE_BoomerAMGGetFilterThresholdR_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *filter_threshold ); + +HYPRE_Int +HYPRE_BoomerAMGGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *rel_resid_norm ); + +HYPRE_Int +HYPRE_BoomerAMGGetGridHierarchy_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *cgrid ); + +HYPRE_Int +HYPRE_BoomerAMGGetJacobiTruncThreshold_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *jacobi_trunc_threshold ); + +HYPRE_Int +HYPRE_BoomerAMGGetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *logging ); + +HYPRE_Int +HYPRE_BoomerAMGGetMaxCoarseSize_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *max_coarse_size ); + +HYPRE_Int +HYPRE_BoomerAMGGetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *max_iter ); + +HYPRE_Int +HYPRE_BoomerAMGGetMaxLevels_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *max_levels ); + +HYPRE_Int +HYPRE_BoomerAMGGetMaxRowSum_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *max_row_sum ); + +HYPRE_Int +HYPRE_BoomerAMGGetMeasureType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *measure_type ); + +HYPRE_Int +HYPRE_BoomerAMGGetMinCoarseSize_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *min_coarse_size ); + +HYPRE_Int +HYPRE_BoomerAMGGetMultAdditive_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *mult_additive ); + +HYPRE_Int +HYPRE_BoomerAMGGetNumFunctions_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_functions ); + +HYPRE_Int +HYPRE_BoomerAMGGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_BoomerAMGGetOverlap_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *overlap ); + +HYPRE_Int +HYPRE_BoomerAMGGetPMaxElmts_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *P_max_elmts ); + +HYPRE_Int +HYPRE_BoomerAMGGetPostInterpType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *post_interp_type ); + +HYPRE_Int +HYPRE_BoomerAMGGetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *print_level ); + +HYPRE_Int +HYPRE_BoomerAMGGetRedundant_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *redundant ); + +HYPRE_Int +HYPRE_BoomerAMGGetResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParVector *residual ); + +HYPRE_Int +HYPRE_BoomerAMGGetSchwarzRlxWeight_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *schwarz_rlx_weight ); + +HYPRE_Int +HYPRE_BoomerAMGGetSeqThreshold_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *seq_threshold ); + +HYPRE_Int +HYPRE_BoomerAMGGetSimple_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *simple ); + +HYPRE_Int +HYPRE_BoomerAMGGetSmoothNumLevels_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *smooth_num_levels ); + +HYPRE_Int +HYPRE_BoomerAMGGetSmoothNumSweeps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *smooth_num_sweeps ); + +HYPRE_Int +HYPRE_BoomerAMGGetSmoothType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *smooth_type ); + +HYPRE_Int +HYPRE_BoomerAMGGetStrongThreshold_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *strong_threshold ); + +HYPRE_Int +HYPRE_BoomerAMGGetStrongThresholdR_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *strong_threshold ); + +HYPRE_Int +HYPRE_BoomerAMGGetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *tol ); + +HYPRE_Int +HYPRE_BoomerAMGGetTruncFactor_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *trunc_factor ); + +HYPRE_Int +HYPRE_BoomerAMGGetVariant_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *variant ); + +HYPRE_Int +HYPRE_BoomerAMGInitGridRelaxation_pre( HYPRE_Precision precision, HYPRE_Int **num_grid_sweeps_ptr, HYPRE_Int **grid_relax_type_ptr, HYPRE_Int ***grid_relax_points_ptr, HYPRE_Int coarsen_type, void *relax_weights_ptr, HYPRE_Int max_levels ); + +HYPRE_Int +HYPRE_BoomerAMGSetADropTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double A_drop_tol ); + +HYPRE_Int +HYPRE_BoomerAMGSetADropType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int A_drop_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetAddLastLvl_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int add_last_lvl ); + +HYPRE_Int +HYPRE_BoomerAMGSetAddPMaxElmts_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int add_P_max_elmts ); + +HYPRE_Int +HYPRE_BoomerAMGSetAddRelaxType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int add_rlx_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetAddRelaxWt_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double add_rlx_wt ); + +HYPRE_Int +HYPRE_BoomerAMGSetAddTruncFactor_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double add_trunc_factor ); + +HYPRE_Int +HYPRE_BoomerAMGSetAdditive_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int addlvl ); + +HYPRE_Int +HYPRE_BoomerAMGSetAggInterpType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int agg_interp_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetAggNumLevels_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int agg_num_levels ); + +HYPRE_Int +HYPRE_BoomerAMGSetAggP12MaxElmts_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int agg_P12_max_elmts ); + +HYPRE_Int +HYPRE_BoomerAMGSetAggP12TruncFactor_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double agg_P12_trunc_factor ); + +HYPRE_Int +HYPRE_BoomerAMGSetAggPMaxElmts_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int agg_P_max_elmts ); + +HYPRE_Int +HYPRE_BoomerAMGSetAggTruncFactor_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double agg_trunc_factor ); + +HYPRE_Int +HYPRE_BoomerAMGSetCGCIts_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int its ); + +HYPRE_Int +HYPRE_BoomerAMGSetCPoints_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int cpt_coarse_level, HYPRE_Int num_cpt_coarse, HYPRE_BigInt *cpt_coarse_index ); + +HYPRE_Int +HYPRE_BoomerAMGSetCRRate_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double CR_rate ); + +HYPRE_Int +HYPRE_BoomerAMGSetCRStrongTh_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double CR_strong_th ); + +HYPRE_Int +HYPRE_BoomerAMGSetCRUseCG_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int CR_use_CG ); + +HYPRE_Int +HYPRE_BoomerAMGSetChebyEigEst_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int eig_est ); + +HYPRE_Int +HYPRE_BoomerAMGSetChebyFraction_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double ratio ); + +HYPRE_Int +HYPRE_BoomerAMGSetChebyOrder_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int order ); + +HYPRE_Int +HYPRE_BoomerAMGSetChebyScale_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int scale ); + +HYPRE_Int +HYPRE_BoomerAMGSetChebyVariant_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int variant ); + +HYPRE_Int +HYPRE_BoomerAMGSetCoarsenCutFactor_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int coarsen_cut_factor ); + +HYPRE_Int +HYPRE_BoomerAMGSetCoarsenType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int coarsen_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetConvergeType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int type ); + +HYPRE_Int +HYPRE_BoomerAMGSetCoordDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int coorddim ); + +HYPRE_Int +HYPRE_BoomerAMGSetCoordinates_pre( HYPRE_Precision precision, HYPRE_Solver solver, float *coordinates ); + +HYPRE_Int +HYPRE_BoomerAMGSetCpointsToKeep_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int cpt_coarse_level, HYPRE_Int num_cpt_coarse, HYPRE_BigInt *cpt_coarse_index ); + +HYPRE_Int +HYPRE_BoomerAMGSetCumNnzAP_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double cum_nnz_AP ); + +HYPRE_Int +HYPRE_BoomerAMGSetCycleNumSweeps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_sweeps, HYPRE_Int k ); + +HYPRE_Int +HYPRE_BoomerAMGSetCycleRelaxType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int relax_type, HYPRE_Int k ); + +HYPRE_Int +HYPRE_BoomerAMGSetCycleType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int cycle_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetDebugFlag_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int debug_flag ); + +HYPRE_Int +HYPRE_BoomerAMGSetDofFunc_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *dof_func ); + +HYPRE_Int +HYPRE_BoomerAMGSetDomainType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int domain_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetDropTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double drop_tol ); + +HYPRE_Int +HYPRE_BoomerAMGSetEuBJ_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int eu_bj ); + +HYPRE_Int +HYPRE_BoomerAMGSetEuLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int eu_level ); + +HYPRE_Int +HYPRE_BoomerAMGSetEuSparseA_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double eu_sparse_A ); + +HYPRE_Int +HYPRE_BoomerAMGSetEuclidFile_pre( HYPRE_Precision precision, HYPRE_Solver solver, char *euclidfile ); + +HYPRE_Int +HYPRE_BoomerAMGSetFCycle_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int fcycle ); + +HYPRE_Int +HYPRE_BoomerAMGSetFPoints_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_fpt, HYPRE_BigInt *fpt_index ); + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIAlgoType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int algo_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIEigMaxIters_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int eig_max_iters ); + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIKapTolerance_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double kap_tolerance ); + +HYPRE_Int +HYPRE_BoomerAMGSetFSAILocalSolveType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int local_solve_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIMaxNnzRow_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_nnz_row ); + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIMaxStepSize_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_step_size ); + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIMaxSteps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_steps ); + +HYPRE_Int +HYPRE_BoomerAMGSetFSAINumLevels_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_levels ); + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIThreshold_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double threshold ); + +HYPRE_Int +HYPRE_BoomerAMGSetFilter_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double filter ); + +HYPRE_Int +HYPRE_BoomerAMGSetFilterFunctions_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int filter_functions ); + +HYPRE_Int +HYPRE_BoomerAMGSetFilterThresholdR_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double filter_threshold ); + +HYPRE_Int +HYPRE_BoomerAMGSetGMRESSwitchR_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int gmres_switch ); + +HYPRE_Int +HYPRE_BoomerAMGSetGSMG_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int gsmg ); + +HYPRE_Int +HYPRE_BoomerAMGSetGridRelaxPoints_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int **grid_relax_points ); + +HYPRE_Int +HYPRE_BoomerAMGSetGridRelaxType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *grid_relax_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetILUDroptol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double ilu_droptol ); + +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int ilu_iter_setup_max_iter ); + +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupOption_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int ilu_iter_setup_option ); + +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupTolerance_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double ilu_iter_setup_tolerance ); + +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int ilu_iter_setup_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetILULevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int ilu_lfil ); + +HYPRE_Int +HYPRE_BoomerAMGSetILULocalReordering_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int ilu_reordering_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetILULowerJacobiIters_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int ilu_lower_jacobi_iters ); + +HYPRE_Int +HYPRE_BoomerAMGSetILUMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int ilu_max_iter ); + +HYPRE_Int +HYPRE_BoomerAMGSetILUMaxRowNnz_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int ilu_max_row_nnz ); + +HYPRE_Int +HYPRE_BoomerAMGSetILUTriSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int ilu_tri_solve ); + +HYPRE_Int +HYPRE_BoomerAMGSetILUType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int ilu_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetILUUpperJacobiIters_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int ilu_upper_jacobi_iters ); + +HYPRE_Int +HYPRE_BoomerAMGSetISType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int IS_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetInterpRefine_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_refine ); + +HYPRE_Int +HYPRE_BoomerAMGSetInterpType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int interp_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetInterpVecAbsQTrunc_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double q_trunc ); + +HYPRE_Int +HYPRE_BoomerAMGSetInterpVecQMax_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int q_max ); + +HYPRE_Int +HYPRE_BoomerAMGSetInterpVecVariant_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int var ); + +HYPRE_Int +HYPRE_BoomerAMGSetInterpVectors_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_vectors, HYPRE_ParVector *interp_vectors ); + +HYPRE_Int +HYPRE_BoomerAMGSetIsTriangular_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int is_triangular ); + +HYPRE_Int +HYPRE_BoomerAMGSetIsolatedFPoints_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_isolated_fpt, HYPRE_BigInt *isolated_fpt_index ); + +HYPRE_Int +HYPRE_BoomerAMGSetJacobiTruncThreshold_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double jacobi_trunc_threshold ); + +HYPRE_Int +HYPRE_BoomerAMGSetKeepSameSign_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int keep_same_sign ); + +HYPRE_Int +HYPRE_BoomerAMGSetKeepTranspose_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int keepTranspose ); + +HYPRE_Int +HYPRE_BoomerAMGSetLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_BoomerAMGSetLevelNonGalerkinTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double nongalerkin_tol, HYPRE_Int level ); + +HYPRE_Int +HYPRE_BoomerAMGSetLevelOuterWt_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double omega, HYPRE_Int level ); + +HYPRE_Int +HYPRE_BoomerAMGSetLevelRelaxWt_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double relax_weight, HYPRE_Int level ); + +HYPRE_Int +HYPRE_BoomerAMGSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_BoomerAMGSetMaxCoarseSize_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_coarse_size ); + +HYPRE_Int +HYPRE_BoomerAMGSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_BoomerAMGSetMaxLevels_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_levels ); + +HYPRE_Int +HYPRE_BoomerAMGSetMaxNzPerRow_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_nz_per_row ); + +HYPRE_Int +HYPRE_BoomerAMGSetMaxRowSum_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double max_row_sum ); + +HYPRE_Int +HYPRE_BoomerAMGSetMeasureType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int measure_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetMinCoarseSize_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int min_coarse_size ); + +HYPRE_Int +HYPRE_BoomerAMGSetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_BoomerAMGSetModuleRAP2_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int mod_rap2 ); + +HYPRE_Int +HYPRE_BoomerAMGSetMultAddPMaxElmts_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int add_P_max_elmts ); + +HYPRE_Int +HYPRE_BoomerAMGSetMultAddTruncFactor_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double add_trunc_factor ); + +HYPRE_Int +HYPRE_BoomerAMGSetMultAdditive_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int addlvl ); + +HYPRE_Int +HYPRE_BoomerAMGSetNodal_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int nodal ); + +HYPRE_Int +HYPRE_BoomerAMGSetNodalDiag_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int nodal_diag ); + +HYPRE_Int +HYPRE_BoomerAMGSetNodalLevels_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int nodal_levels ); + +HYPRE_Int +HYPRE_BoomerAMGSetNonGalerkTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int nongalerk_num_tol, void *nongalerk_tol ); + +HYPRE_Int +HYPRE_BoomerAMGSetNonGalerkinTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double nongalerkin_tol ); + +HYPRE_Int +HYPRE_BoomerAMGSetNumCRRelaxSteps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_CR_relax_steps ); + +HYPRE_Int +HYPRE_BoomerAMGSetNumFunctions_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_functions ); + +HYPRE_Int +HYPRE_BoomerAMGSetNumGridSweeps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_grid_sweeps ); + +HYPRE_Int +HYPRE_BoomerAMGSetNumPaths_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_paths ); + +HYPRE_Int +HYPRE_BoomerAMGSetNumSamples_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_samples ); + +HYPRE_Int +HYPRE_BoomerAMGSetNumSweeps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_sweeps ); + +HYPRE_Int +HYPRE_BoomerAMGSetOldDefault_pre( HYPRE_Precision precision, HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_BoomerAMGSetOmega_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *omega ); + +HYPRE_Int +HYPRE_BoomerAMGSetOuterWt_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double omega ); + +HYPRE_Int +HYPRE_BoomerAMGSetOverlap_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int overlap ); + +HYPRE_Int +HYPRE_BoomerAMGSetPMaxElmts_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int P_max_elmts ); + +HYPRE_Int +HYPRE_BoomerAMGSetPlotFileName_pre( HYPRE_Precision precision, HYPRE_Solver solver, const char *plotfilename ); + +HYPRE_Int +HYPRE_BoomerAMGSetPlotGrids_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int plotgrids ); + +HYPRE_Int +HYPRE_BoomerAMGSetPostInterpType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int post_interp_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetPrintFileName_pre( HYPRE_Precision precision, HYPRE_Solver solver, const char *print_file_name ); + +HYPRE_Int +HYPRE_BoomerAMGSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_BoomerAMGSetRAP2_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int rap2 ); + +HYPRE_Int +HYPRE_BoomerAMGSetRedundant_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int redundant ); + +HYPRE_Int +HYPRE_BoomerAMGSetRelaxOrder_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int relax_order ); + +HYPRE_Int +HYPRE_BoomerAMGSetRelaxType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int relax_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetRelaxWeight_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *relax_weight ); + +HYPRE_Int +HYPRE_BoomerAMGSetRelaxWt_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double relax_weight ); + +HYPRE_Int +HYPRE_BoomerAMGSetRestriction_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int restr_par ); + +HYPRE_Int +HYPRE_BoomerAMGSetSCommPkgSwitch_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double S_commpkg_switch ); + +HYPRE_Int +HYPRE_BoomerAMGSetSabs_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int Sabs ); + +HYPRE_Int +HYPRE_BoomerAMGSetSchwarzRlxWeight_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double schwarz_rlx_weight ); + +HYPRE_Int +HYPRE_BoomerAMGSetSchwarzUseNonSymm_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int use_nonsymm ); + +HYPRE_Int +HYPRE_BoomerAMGSetSepWeight_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int sep_weight ); + +HYPRE_Int +HYPRE_BoomerAMGSetSeqThreshold_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int seq_threshold ); + +HYPRE_Int +HYPRE_BoomerAMGSetSetupType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int setup_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetSimple_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int addlvl ); + +HYPRE_Int +HYPRE_BoomerAMGSetSmoothInterpVectors_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int smooth_interp_vectors ); + +HYPRE_Int +HYPRE_BoomerAMGSetSmoothNumLevels_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int smooth_num_levels ); + +HYPRE_Int +HYPRE_BoomerAMGSetSmoothNumSweeps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int smooth_num_sweeps ); + +HYPRE_Int +HYPRE_BoomerAMGSetSmoothType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int smooth_type ); + +HYPRE_Int +HYPRE_BoomerAMGSetStrongThreshold_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double strong_threshold ); + +HYPRE_Int +HYPRE_BoomerAMGSetStrongThresholdR_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double strong_threshold ); + +HYPRE_Int +HYPRE_BoomerAMGSetSym_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int sym ); + +HYPRE_Int +HYPRE_BoomerAMGSetThreshold_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double threshold ); + +HYPRE_Int +HYPRE_BoomerAMGSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_BoomerAMGSetTruncFactor_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double trunc_factor ); + +HYPRE_Int +HYPRE_BoomerAMGSetVariant_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int variant ); + +HYPRE_Int +HYPRE_BoomerAMGSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_BoomerAMGSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_BoomerAMGSolveT_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_EuclidCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_EuclidDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_EuclidSetBJ_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int bj ); + +HYPRE_Int +HYPRE_EuclidSetILUT_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double drop_tol ); + +HYPRE_Int +HYPRE_EuclidSetLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_EuclidSetMem_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int eu_mem ); + +HYPRE_Int +HYPRE_EuclidSetParams_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int argc, char *argv[] ); + +HYPRE_Int +HYPRE_EuclidSetParamsFromFile_pre( HYPRE_Precision precision, HYPRE_Solver solver, char *filename ); + +HYPRE_Int +HYPRE_EuclidSetRowScale_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int row_scale ); + +HYPRE_Int +HYPRE_EuclidSetSparseA_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double sparse_A ); + +HYPRE_Int +HYPRE_EuclidSetStats_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int eu_stats ); + +HYPRE_Int +HYPRE_EuclidSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_EuclidSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_FSAICreate_pre( HYPRE_Precision precision, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_FSAIDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_FSAISetAlgoType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int algo_type ); + +HYPRE_Int +HYPRE_FSAISetEigMaxIters_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int eig_max_iters ); + +HYPRE_Int +HYPRE_FSAISetKapTolerance_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double kap_tolerance ); + +HYPRE_Int +HYPRE_FSAISetLocalSolveType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int local_solve_type ); + +HYPRE_Int +HYPRE_FSAISetMaxIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iterations ); + +HYPRE_Int +HYPRE_FSAISetMaxNnzRow_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_nnz_row ); + +HYPRE_Int +HYPRE_FSAISetMaxStepSize_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_step_size ); + +HYPRE_Int +HYPRE_FSAISetMaxSteps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_steps ); + +HYPRE_Int +HYPRE_FSAISetNumLevels_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_levels ); + +HYPRE_Int +HYPRE_FSAISetOmega_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double omega ); + +HYPRE_Int +HYPRE_FSAISetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_FSAISetThreshold_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double threshold ); + +HYPRE_Int +HYPRE_FSAISetTolerance_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tolerance ); + +HYPRE_Int +HYPRE_FSAISetZeroGuess_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int zero_guess ); + +HYPRE_Int +HYPRE_FSAISetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_FSAISolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ILUCreate_pre( HYPRE_Precision precision, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_ILUDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_ILUGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *res_norm ); + +HYPRE_Int +HYPRE_ILUGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_ILUSetDropThreshold_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double threshold ); + +HYPRE_Int +HYPRE_ILUSetDropThresholdArray_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *threshold ); + +HYPRE_Int +HYPRE_ILUSetIterativeSetupMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int iter_setup_max_iter ); + +HYPRE_Int +HYPRE_ILUSetIterativeSetupOption_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int iter_setup_option ); + +HYPRE_Int +HYPRE_ILUSetIterativeSetupTolerance_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double iter_setup_tolerance ); + +HYPRE_Int +HYPRE_ILUSetIterativeSetupType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int iter_setup_type ); + +HYPRE_Int +HYPRE_ILUSetLevelOfFill_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int lfil ); + +HYPRE_Int +HYPRE_ILUSetLocalReordering_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int reordering_type ); + +HYPRE_Int +HYPRE_ILUSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_ILUSetLowerJacobiIters_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int lower_jacobi_iterations ); + +HYPRE_Int +HYPRE_ILUSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_ILUSetMaxNnzPerRow_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int nzmax ); + +HYPRE_Int +HYPRE_ILUSetNSHDropThreshold_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double threshold ); + +HYPRE_Int +HYPRE_ILUSetNSHDropThresholdArray_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *threshold ); + +HYPRE_Int +HYPRE_ILUSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_ILUSetSchurMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int ss_max_iter ); + +HYPRE_Int +HYPRE_ILUSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_ILUSetTriSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int tri_solve ); + +HYPRE_Int +HYPRE_ILUSetType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int ilu_type ); + +HYPRE_Int +HYPRE_ILUSetUpperJacobiIters_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int upper_jacobi_iterations ); + +HYPRE_Int +HYPRE_ILUSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ILUSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_MGRBuildAff_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix A, HYPRE_Int *CF_marker, HYPRE_Int debug_flag, HYPRE_ParCSRMatrix *A_ff ); + +HYPRE_Int +HYPRE_MGRCreate_pre( HYPRE_Precision precision, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_MGRDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_MGRGetCoarseGridConvergenceFactor_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *conv_factor ); + +HYPRE_Int +HYPRE_MGRGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *res_norm ); + +HYPRE_Int +HYPRE_MGRGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_MGRSetBlockJacobiBlockSize_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int blk_size ); + +HYPRE_Int +HYPRE_MGRSetBlockSize_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int bsize ); + +HYPRE_Int +HYPRE_MGRSetCoarseGridMethod_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *cg_method ); + +HYPRE_Int +HYPRE_MGRSetCoarseGridPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_MGRSetCoarseSolver_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToParSolverFcn coarse_grid_solver_solve, HYPRE_PtrToParSolverFcn coarse_grid_solver_setup, HYPRE_Solver coarse_grid_solver ); + +HYPRE_Int +HYPRE_MGRSetCpointsByBlock_pre( HYPRE_Precision precision, 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 +HYPRE_MGRSetCpointsByContiguousBlock_pre( HYPRE_Precision precision, 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 +HYPRE_MGRSetCpointsByPointMarkerArray_pre( HYPRE_Precision precision, 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 +HYPRE_MGRSetFRelaxMethod_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int relax_method ); + +HYPRE_Int +HYPRE_MGRSetFSolver_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToParSolverFcn fine_grid_solver_solve, HYPRE_PtrToParSolverFcn fine_grid_solver_setup, HYPRE_Solver fsolver ); + +HYPRE_Int +HYPRE_MGRSetFSolverAtLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver fsolver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_MGRSetFrelaxPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_MGRSetGlobalSmoothCycle_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int global_smooth_cycle ); + +HYPRE_Int +HYPRE_MGRSetGlobalSmoothType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int smooth_type ); + +HYPRE_Int +HYPRE_MGRSetGlobalSmootherAtLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver smoother, HYPRE_Int level ); + +HYPRE_Int +HYPRE_MGRSetInterpType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int interp_type ); + +HYPRE_Int +HYPRE_MGRSetLevelFRelaxMethod_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *relax_method ); + +HYPRE_Int +HYPRE_MGRSetLevelFRelaxNumFunctions_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_functions ); + +HYPRE_Int +HYPRE_MGRSetLevelFRelaxType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *relax_type ); + +HYPRE_Int +HYPRE_MGRSetLevelInterpType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *interp_type ); + +HYPRE_Int +HYPRE_MGRSetLevelNonGalerkinMaxElmts_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *max_elmts ); + +HYPRE_Int +HYPRE_MGRSetLevelNumRelaxSweeps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *nsweeps ); + +HYPRE_Int +HYPRE_MGRSetLevelPMaxElmts_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *P_max_elmts ); + +HYPRE_Int +HYPRE_MGRSetLevelRestrictType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *restrict_type ); + +HYPRE_Int +HYPRE_MGRSetLevelSmoothIters_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *smooth_iters ); + +HYPRE_Int +HYPRE_MGRSetLevelSmoothType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *smooth_type ); + +HYPRE_Int +HYPRE_MGRSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_MGRSetMaxCoarseLevels_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int maxlev ); + +HYPRE_Int +HYPRE_MGRSetMaxGlobalSmoothIters_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int smooth_iter ); + +HYPRE_Int +HYPRE_MGRSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_MGRSetNonCpointsToFpoints_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int nonCptToFptFlag ); + +HYPRE_Int +HYPRE_MGRSetNonGalerkinMaxElmts_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_elmts ); + +HYPRE_Int +HYPRE_MGRSetNumInterpSweeps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int nsweeps ); + +HYPRE_Int +HYPRE_MGRSetNumRelaxSweeps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int nsweeps ); + +HYPRE_Int +HYPRE_MGRSetNumRestrictSweeps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int nsweeps ); + +HYPRE_Int +HYPRE_MGRSetPMaxElmts_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int P_max_elmts ); + +HYPRE_Int +HYPRE_MGRSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_MGRSetRelaxType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int relax_type ); + +HYPRE_Int +HYPRE_MGRSetReservedCoarseNodes_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int reserved_coarse_size, HYPRE_BigInt *reserved_coarse_nodes ); + +HYPRE_Int +HYPRE_MGRSetReservedCpointsLevelToKeep_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_MGRSetRestrictType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int restrict_type ); + +HYPRE_Int +HYPRE_MGRSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_MGRSetTruncateCoarseGridThreshold_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double threshold ); + +HYPRE_Int +HYPRE_MGRSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_MGRSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *norm ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABGetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *precond_data ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABGetResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParVector *residual ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double a_tol ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetStopCrit_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int stop_crit ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRCGNRCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_ParCSRCGNRDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_ParCSRCGNRGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *norm ); + +HYPRE_Int +HYPRE_ParCSRCGNRGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_ParCSRCGNRGetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *precond_data ); + +HYPRE_Int +HYPRE_ParCSRCGNRSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_ParCSRCGNRSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_ParCSRCGNRSetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_ParCSRCGNRSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precondT, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_ParCSRCGNRSetStopCrit_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int stop_crit ); + +HYPRE_Int +HYPRE_ParCSRCGNRSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_ParCSRCGNRSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRCGNRSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *norm ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESGetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *precond_data ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESGetResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParVector *residual ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double a_tol ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetCGS_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int cgs ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetKDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetUnroll_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int unroll ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRCOGMRESSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRDiagScale_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix HA, HYPRE_ParVector Hy, HYPRE_ParVector Hx ); + +HYPRE_Int +HYPRE_ParCSRDiagScaleSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector y, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *norm ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESGetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *precond_data ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESGetResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParVector *residual ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double a_tol ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetKDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetModifyPC_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToModifyPCFcn modify_pc ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRGMRESCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_ParCSRGMRESDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_ParCSRGMRESGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *norm ); + +HYPRE_Int +HYPRE_ParCSRGMRESGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_ParCSRGMRESGetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *precond_data ); + +HYPRE_Int +HYPRE_ParCSRGMRESGetRefSolution_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParVector *ref_solution ); + +HYPRE_Int +HYPRE_ParCSRGMRESGetResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParVector *residual ); + +HYPRE_Int +HYPRE_ParCSRGMRESSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double a_tol ); + +HYPRE_Int +HYPRE_ParCSRGMRESSetKDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_ParCSRGMRESSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_ParCSRGMRESSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_ParCSRGMRESSetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_ParCSRGMRESSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_ParCSRGMRESSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_ParCSRGMRESSetRefSolution_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParVector ref_solution ); + +HYPRE_Int +HYPRE_ParCSRGMRESSetStopCrit_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int stop_crit ); + +HYPRE_Int +HYPRE_ParCSRGMRESSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_ParCSRGMRESSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRGMRESSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRHybridCreate_pre( HYPRE_Precision precision, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_ParCSRHybridDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_ParCSRHybridGetDSCGNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *dscg_num_its ); + +HYPRE_Int +HYPRE_ParCSRHybridGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *norm ); + +HYPRE_Int +HYPRE_ParCSRHybridGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_its ); + +HYPRE_Int +HYPRE_ParCSRHybridGetPCGNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *pcg_num_its ); + +HYPRE_Int +HYPRE_ParCSRHybridGetRecomputeResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *recompute_residual ); + +HYPRE_Int +HYPRE_ParCSRHybridGetRecomputeResidualP_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *recompute_residual_p ); + +HYPRE_Int +HYPRE_ParCSRHybridGetSetupSolveTime_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *time ); + +HYPRE_Int +HYPRE_ParCSRHybridSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_ParCSRHybridSetAggInterpType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int agg_interp_type ); + +HYPRE_Int +HYPRE_ParCSRHybridSetAggNumLevels_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int agg_num_levels ); + +HYPRE_Int +HYPRE_ParCSRHybridSetCoarsenType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int coarsen_type ); + +HYPRE_Int +HYPRE_ParCSRHybridSetConvergenceTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double cf_tol ); + +HYPRE_Int +HYPRE_ParCSRHybridSetCycleNumSweeps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_sweeps, HYPRE_Int k ); + +HYPRE_Int +HYPRE_ParCSRHybridSetCycleRelaxType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int relax_type, HYPRE_Int k ); + +HYPRE_Int +HYPRE_ParCSRHybridSetCycleType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int cycle_type ); + +HYPRE_Int +HYPRE_ParCSRHybridSetDSCGMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int dscg_max_its ); + +HYPRE_Int +HYPRE_ParCSRHybridSetDofFunc_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *dof_func ); + +HYPRE_Int +HYPRE_ParCSRHybridSetGridRelaxPoints_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int **grid_relax_points ); + +HYPRE_Int +HYPRE_ParCSRHybridSetGridRelaxType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *grid_relax_type ); + +HYPRE_Int +HYPRE_ParCSRHybridSetInterpType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int interp_type ); + +HYPRE_Int +HYPRE_ParCSRHybridSetKDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_ParCSRHybridSetKeepTranspose_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int keepT ); + +HYPRE_Int +HYPRE_ParCSRHybridSetLevelOuterWt_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double outer_wt, HYPRE_Int level ); + +HYPRE_Int +HYPRE_ParCSRHybridSetLevelRelaxWt_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double relax_wt, HYPRE_Int level ); + +HYPRE_Int +HYPRE_ParCSRHybridSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_ParCSRHybridSetMaxCoarseSize_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_coarse_size ); + +HYPRE_Int +HYPRE_ParCSRHybridSetMaxLevels_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_levels ); + +HYPRE_Int +HYPRE_ParCSRHybridSetMaxRowSum_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double max_row_sum ); + +HYPRE_Int +HYPRE_ParCSRHybridSetMeasureType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int measure_type ); + +HYPRE_Int +HYPRE_ParCSRHybridSetMinCoarseSize_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int min_coarse_size ); + +HYPRE_Int +HYPRE_ParCSRHybridSetNodal_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int nodal ); + +HYPRE_Int +HYPRE_ParCSRHybridSetNonGalerkinTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_levels, void *nongalerkin_tol ); + +HYPRE_Int +HYPRE_ParCSRHybridSetNumFunctions_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_functions ); + +HYPRE_Int +HYPRE_ParCSRHybridSetNumGridSweeps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_grid_sweeps ); + +HYPRE_Int +HYPRE_ParCSRHybridSetNumPaths_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_paths ); + +HYPRE_Int +HYPRE_ParCSRHybridSetNumSweeps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_sweeps ); + +HYPRE_Int +HYPRE_ParCSRHybridSetOmega_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *omega ); + +HYPRE_Int +HYPRE_ParCSRHybridSetOuterWt_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double outer_wt ); + +HYPRE_Int +HYPRE_ParCSRHybridSetPCGMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int pcg_max_its ); + +HYPRE_Int +HYPRE_ParCSRHybridSetPMaxElmts_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int P_max_elmts ); + +HYPRE_Int +HYPRE_ParCSRHybridSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_ParCSRHybridSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_ParCSRHybridSetRecomputeResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int recompute_residual ); + +HYPRE_Int +HYPRE_ParCSRHybridSetRecomputeResidualP_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int recompute_residual_p ); + +HYPRE_Int +HYPRE_ParCSRHybridSetRelChange_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int rel_change ); + +HYPRE_Int +HYPRE_ParCSRHybridSetRelaxOrder_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int relax_order ); + +HYPRE_Int +HYPRE_ParCSRHybridSetRelaxType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int relax_type ); + +HYPRE_Int +HYPRE_ParCSRHybridSetRelaxWeight_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *relax_weight ); + +HYPRE_Int +HYPRE_ParCSRHybridSetRelaxWt_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double relax_wt ); + +HYPRE_Int +HYPRE_ParCSRHybridSetSeqThreshold_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int seq_threshold ); + +HYPRE_Int +HYPRE_ParCSRHybridSetSetupType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int setup_type ); + +HYPRE_Int +HYPRE_ParCSRHybridSetSolverType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int solver_type ); + +HYPRE_Int +HYPRE_ParCSRHybridSetStopCrit_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int stop_crit ); + +HYPRE_Int +HYPRE_ParCSRHybridSetStrongThreshold_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double strong_threshold ); + +HYPRE_Int +HYPRE_ParCSRHybridSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_ParCSRHybridSetTruncFactor_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double trunc_factor ); + +HYPRE_Int +HYPRE_ParCSRHybridSetTwoNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int two_norm ); + +HYPRE_Int +HYPRE_ParCSRHybridSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRHybridSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRLGMRESCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_ParCSRLGMRESDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_ParCSRLGMRESGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *norm ); + +HYPRE_Int +HYPRE_ParCSRLGMRESGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_ParCSRLGMRESGetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *precond_data ); + +HYPRE_Int +HYPRE_ParCSRLGMRESGetResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParVector *residual ); + +HYPRE_Int +HYPRE_ParCSRLGMRESSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double a_tol ); + +HYPRE_Int +HYPRE_ParCSRLGMRESSetAugDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int aug_dim ); + +HYPRE_Int +HYPRE_ParCSRLGMRESSetKDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_ParCSRLGMRESSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_ParCSRLGMRESSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_ParCSRLGMRESSetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_ParCSRLGMRESSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_ParCSRLGMRESSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_ParCSRLGMRESSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_ParCSRLGMRESSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRLGMRESSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRMultiVectorPrint_pre( HYPRE_Precision precision, void *x_, const char *fileName ); + +void * +HYPRE_ParCSRMultiVectorRead_pre( HYPRE_Precision precision, MPI_Comm comm, void *ii_, const char *fileName ); + +HYPRE_Int +HYPRE_ParCSROnProcTriSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix HA, HYPRE_ParVector Hy, HYPRE_ParVector Hx ); + +HYPRE_Int +HYPRE_ParCSROnProcTriSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix HA, HYPRE_ParVector Hy, HYPRE_ParVector Hx ); + +HYPRE_Int +HYPRE_ParCSRPCGCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_ParCSRPCGDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_ParCSRPCGGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *norm ); + +HYPRE_Int +HYPRE_ParCSRPCGGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_ParCSRPCGGetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *precond_data ); + +HYPRE_Int +HYPRE_ParCSRPCGGetResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParVector *residual ); + +HYPRE_Int +HYPRE_ParCSRPCGSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_ParCSRPCGSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_ParCSRPCGSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_ParCSRPCGSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ); + +HYPRE_Int +HYPRE_ParCSRPCGSetPreconditioner_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver precond ); + +HYPRE_Int +HYPRE_ParCSRPCGSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_ParCSRPCGSetRelChange_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int rel_change ); + +HYPRE_Int +HYPRE_ParCSRPCGSetStopCrit_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int stop_crit ); + +HYPRE_Int +HYPRE_ParCSRPCGSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_ParCSRPCGSetTwoNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int two_norm ); + +HYPRE_Int +HYPRE_ParCSRPCGSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRPCGSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRParaSailsCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_ParCSRParaSailsDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_ParCSRParaSailsSetFilter_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double filter ); + +HYPRE_Int +HYPRE_ParCSRParaSailsSetLoadbal_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double loadbal ); + +HYPRE_Int +HYPRE_ParCSRParaSailsSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_ParCSRParaSailsSetParams_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double thresh, HYPRE_Int nlevels ); + +HYPRE_Int +HYPRE_ParCSRParaSailsSetReuse_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int reuse ); + +HYPRE_Int +HYPRE_ParCSRParaSailsSetSym_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int sym ); + +HYPRE_Int +HYPRE_ParCSRParaSailsSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRParaSailsSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRPilutCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_ParCSRPilutDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_ParCSRPilutSetDropTolerance_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_ParCSRPilutSetFactorRowSize_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int size ); + +HYPRE_Int +HYPRE_ParCSRPilutSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_ParCSRPilutSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_ParCSRPilutSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRPilutSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParCSRSetupInterpreter_pre( HYPRE_Precision precision, mv_InterfaceInterpreter *i ); + +HYPRE_Int +HYPRE_ParCSRSetupMatvec_pre( HYPRE_Precision precision, HYPRE_MatvecFunctions *mv ); + +HYPRE_Int +HYPRE_ParaSailsBuildIJMatrix_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_IJMatrix *pij_A ); + +HYPRE_Int +HYPRE_ParaSailsCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_ParaSailsDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_ParaSailsGetFilter_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *filter ); + +HYPRE_Int +HYPRE_ParaSailsGetLoadbal_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *loadbal ); + +HYPRE_Int +HYPRE_ParaSailsGetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *logging ); + +HYPRE_Int +HYPRE_ParaSailsGetNlevels_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *nlevels ); + +HYPRE_Int +HYPRE_ParaSailsGetReuse_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *reuse ); + +HYPRE_Int +HYPRE_ParaSailsGetSym_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *sym ); + +HYPRE_Int +HYPRE_ParaSailsGetThresh_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *thresh ); + +HYPRE_Int +HYPRE_ParaSailsSetFilter_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double filter ); + +HYPRE_Int +HYPRE_ParaSailsSetLoadbal_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double loadbal ); + +HYPRE_Int +HYPRE_ParaSailsSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_ParaSailsSetNlevels_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int nlevels ); + +HYPRE_Int +HYPRE_ParaSailsSetParams_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double thresh, HYPRE_Int nlevels ); + +HYPRE_Int +HYPRE_ParaSailsSetReuse_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int reuse ); + +HYPRE_Int +HYPRE_ParaSailsSetSym_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int sym ); + +HYPRE_Int +HYPRE_ParaSailsSetThresh_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double thresh ); + +HYPRE_Int +HYPRE_ParaSailsSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParaSailsSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_SchwarzCreate_pre( HYPRE_Precision precision, HYPRE_Solver *solver ); + +HYPRE_Int +HYPRE_SchwarzDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ); + +HYPRE_Int +HYPRE_SchwarzSetDofFunc_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *dof_func ); + +HYPRE_Int +HYPRE_SchwarzSetDomainStructure_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_CSRMatrix domain_structure ); + +HYPRE_Int +HYPRE_SchwarzSetDomainType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int domain_type ); + +HYPRE_Int +HYPRE_SchwarzSetNonSymm_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int use_nonsymm ); + +HYPRE_Int +HYPRE_SchwarzSetNumFunctions_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_functions ); + +HYPRE_Int +HYPRE_SchwarzSetOverlap_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int overlap ); + +HYPRE_Int +HYPRE_SchwarzSetRelaxWeight_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double relax_weight ); + +HYPRE_Int +HYPRE_SchwarzSetVariant_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int variant ); + +HYPRE_Int +HYPRE_SchwarzSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_SchwarzSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_TempParCSRSetupInterpreter_pre( HYPRE_Precision precision, mv_InterfaceInterpreter *i ); + + +#endif + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/src/parcsr_ls/Makefile b/src/parcsr_ls/Makefile index 9eaa82ce43..178be7cdda 100644 --- a/src/parcsr_ls/Makefile +++ b/src/parcsr_ls/Makefile @@ -31,6 +31,7 @@ C_COMPILE_FLAGS =\ HEADERS =\ HYPRE_parcsr_ls.h\ + HYPRE_parcsr_ls_mp.h\ _hypre_parcsr_ls.h\ aux_interp.h\ block_tridiag.h\ @@ -181,10 +182,32 @@ CUFILES =\ par_mgr_device.c\ par_fsai_device.c +# Mixed precision files +MP_FILES = \ + mup_fixed.c\ + mup_functions.c\ + mup_pre.c\ + HYPRE_parcsr_ls_mp.c + COBJS = ${FILES:.c=.o} CUOBJS = ${CUFILES:.c=.obj} OBJS = ${COBJS} ${CUOBJS} +ifeq (${MP_BUILD}, 1) + +COBJS_single = ${FILES:.c=.o_flt} +COBJS_double = ${FILES:.c=.o_dbl} +COBJS_longdouble = ${FILES:.c=.o_ldbl} +CUOBJS_single = ${CUFILES:.c=.obj_flt} +CUOBJS_double = ${CUFILES:.c=.obj_dbl} +CUOBJS_longdouble = ${CUFILES:.c=.obj_ldbl} +MP_COBJS = ${MP_FILES:.c=.o} + +OBJS = ${COBJS_single} ${COBJS_double} ${COBJS_longdouble} ${MP_COBJS} +OBJS += ${CUOBJS_single} ${CUOBJS_double} ${CUOBJS_longdouble} + +endif + SONAME = libHYPRE_parcsr_ls-${HYPRE_RELEASE_VERSION}${HYPRE_LIB_SUFFIX} ################################################################## @@ -193,16 +216,18 @@ SONAME = libHYPRE_parcsr_ls-${HYPRE_RELEASE_VERSION}${HYPRE_LIB_SUFFIX} all: libHYPRE_parcsr_ls${HYPRE_LIB_SUFFIX} cp -fR $(srcdir)/HYPRE_*.h $(HYPRE_BUILD_DIR)/include - cp -fR $(srcdir)/_hypre_parcsr_ls.h $(HYPRE_BUILD_DIR)/include + cp -fR $(srcdir)/_hypre_*.h $(HYPRE_BUILD_DIR)/include # cp -fR libHYPRE* $(HYPRE_BUILD_DIR)/lib install: libHYPRE_parcsr_ls${HYPRE_LIB_SUFFIX} cp -fR $(srcdir)/HYPRE_*.h $(HYPRE_INC_INSTALL) - cp -fR $(srcdir)/_hypre_parcsr_ls.h $(HYPRE_INC_INSTALL) + cp -fR $(srcdir)/_hypre_*.h $(HYPRE_INC_INSTALL) # cp -fR libHYPRE* $(HYPRE_LIB_INSTALL) clean: rm -f *.o *.obj libHYPRE* + rm -f *.o_flt *.o_dbl *.o_ldbl + rm -f *.obj_flt *.obj_dbl *.obj_ldbl rm -rf pchdir tca.map *inslog* distclean: clean diff --git a/src/parcsr_ls/_hypre_parcsr_ls.h b/src/parcsr_ls/_hypre_parcsr_ls.h index ae8a0c5913..3974a49d10 100644 --- a/src/parcsr_ls/_hypre_parcsr_ls.h +++ b/src/parcsr_ls/_hypre_parcsr_ls.h @@ -7,9 +7,13 @@ #include #include "HYPRE_parcsr_ls.h" #include "_hypre_parcsr_mv.h" -#include "krylov.h" +#include "_hypre_krylov.h" #include "HYPRE_lobpcg.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_parcsr_ls_mup_def.h" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -28,7 +32,7 @@ typedef struct { HYPRE_Int prev; HYPRE_Int next; } Link; #define CUMNUMIT -#include "par_csr_block_matrix.h" +#include "_hypre_parcsr_block_mv.h" /*-------------------------------------------------------------------------- * hypre_ParAMGData @@ -1547,8 +1551,10 @@ 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_AMGHybridSetPrecond ( void *pcg_vdata, + HYPRE_Int (*solve)(void*, void*, void*, void*), + HYPRE_Int (*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 ); @@ -1689,7 +1695,6 @@ 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, @@ -1738,731 +1743,13 @@ HYPRE_Int hypre_GenerateSubComm ( MPI_Comm comm, HYPRE_Int participate, MPI_Comm 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_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_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_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_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_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_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_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_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 ); -#ifdef HYPRE_USING_DSUPERLU -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_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_parcsr_bicgstab.c */ -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_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_parcsr_cgnr.c */ -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_parcsr_Euclid.c */ -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_parcsr_flexgmres.c */ -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_parcsr_gmres.c */ -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_ParCSRGMRESSetRefSolution(HYPRE_Solver solver, HYPRE_ParVector ref_solution); -HYPRE_Int HYPRE_ParCSRGMRESGetRefSolution(HYPRE_Solver solver, HYPRE_ParVector *ref_solution); -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_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_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_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_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_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_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_parcsr_ParaSails.c */ -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_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_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_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_parcsr_pilut.c */ -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_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 ); /* par_add_cycle.c */ HYPRE_Int hypre_BoomerAMGAdditiveCycle ( void *amg_vdata ); @@ -2711,7 +1998,6 @@ HYPRE_Int hypre_BoomerAMGCoarsenCGC ( hypre_ParCSRMatrix *S, HYPRE_Int numberofg 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, @@ -2783,11 +2069,6 @@ HYPRE_Int hypre_BoomerAMGCoarseParmsDevice ( MPI_Comm comm, HYPRE_Int local_num_ HYPRE_Int hypre_BoomerAMGInitDofFuncDevice( HYPRE_Int *dof_func, HYPRE_Int local_size, HYPRE_Int offset, HYPRE_Int num_functions ); -/* par_coordinates.c */ -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, @@ -2827,11 +2108,6 @@ HYPRE_Int hypre_BoomerAMGCoarsenCR ( hypre_ParCSRMatrix *A, hypre_IntArray **CF_ 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 ); - /* 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 ); @@ -2920,23 +2196,15 @@ HYPRE_Int hypre_ParCSRMatrix_dof_func_offd ( hypre_ParCSRMatrix *A, HYPRE_Int nu 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 ); /* 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 ); /* 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 ); @@ -3291,8 +2559,6 @@ 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, @@ -3300,10 +2566,6 @@ HYPRE_Int hypre_ParCSRMaxEigEstimateDevice ( hypre_ParCSRMatrix *A, HYPRE_Int sc 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 ); - /* par_scaled_matnorm.c */ HYPRE_Int hypre_ParCSRMatrixScaledNorm ( hypre_ParCSRMatrix *A, HYPRE_Real *scnorm ); @@ -3411,9 +2673,6 @@ HYPRE_Int hypre_BoomerAMGBuildPartialExtInterp ( hypre_ParCSRMatrix *A, HYPRE_In 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 ); @@ -3425,9 +2684,6 @@ 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 ); @@ -3595,8 +2851,6 @@ HYPRE_Int hypre_MGRSetReservedCpointsLevelToKeep( void *mgr_vdata, HYPRE_Int lev 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_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, @@ -3634,16 +2888,10 @@ HYPRE_Int hypre_MGRBlockRelaxSolve( hypre_ParCSRMatrix *A, hypre_ParVector *f, 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 ); @@ -4358,5 +3606,16 @@ HYPRE_Int hypre_FSAISetupDevice( void *fsai_vdata, hypre_ParCSRMatrix *A, } #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_parcsr_ls_mup_undef.h" +#include "_hypre_parcsr_ls_mup.h" +#endif +#endif + #endif diff --git a/src/parcsr_ls/_hypre_parcsr_ls_mup.h b/src/parcsr_ls/_hypre_parcsr_ls_mup.h new file mode 100644 index 0000000000..fcd0990f5f --- /dev/null +++ b/src/parcsr_ls/_hypre_parcsr_ls_mup.h @@ -0,0 +1,6780 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#ifndef hypre_PARCSR_LS_MUP_HEADER +#define hypre_PARCSR_LS_MUP_HEADER + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (HYPRE_MIXED_PRECISION) + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_ParCSRMatrix +GenerateSysLaplacian_flt( 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_float *mtrx, hypre_float *value ); +HYPRE_ParCSRMatrix +GenerateSysLaplacian_dbl( 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_double *mtrx, hypre_double *value ); +HYPRE_ParCSRMatrix +GenerateSysLaplacian_long_dbl( 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_long_double *mtrx, hypre_long_double *value ); + +HYPRE_ParCSRMatrix +GenerateSysLaplacianVCoef_flt( 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_float *mtrx, hypre_float *value ); +HYPRE_ParCSRMatrix +GenerateSysLaplacianVCoef_dbl( 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_double *mtrx, hypre_double *value ); +HYPRE_ParCSRMatrix +GenerateSysLaplacianVCoef_long_dbl( 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_long_double *mtrx, hypre_long_double *value ); + +HYPRE_Real +afun_flt( hypre_float xx, hypre_float yy, hypre_float zz ); +HYPRE_Real +afun_dbl( hypre_double xx, hypre_double yy, hypre_double zz ); +HYPRE_Real +afun_long_dbl( hypre_long_double xx, hypre_long_double yy, hypre_long_double zz ); + +HYPRE_Real +afun_rs_flt( hypre_float xx, hypre_float yy, hypre_float zz ); +HYPRE_Real +afun_rs_dbl( hypre_double xx, hypre_double yy, hypre_double zz ); +HYPRE_Real +afun_rs_long_dbl( hypre_long_double xx, hypre_long_double yy, hypre_long_double zz ); + +void +aux_indexFromMask_flt( HYPRE_Int n, HYPRE_Int *mask, HYPRE_Int *index ); +void +aux_indexFromMask_dbl( HYPRE_Int n, HYPRE_Int *mask, HYPRE_Int *index ); +void +aux_indexFromMask_long_dbl( HYPRE_Int n, HYPRE_Int *mask, HYPRE_Int *index ); + +HYPRE_Int +aux_maskCount_flt( HYPRE_Int n, HYPRE_Int *mask ); +HYPRE_Int +aux_maskCount_dbl( HYPRE_Int n, HYPRE_Int *mask ); +HYPRE_Int +aux_maskCount_long_dbl( HYPRE_Int n, HYPRE_Int *mask ); + +HYPRE_Real +bfun_flt( hypre_float xx, hypre_float yy, hypre_float zz ); +HYPRE_Real +bfun_dbl( hypre_double xx, hypre_double yy, hypre_double zz ); +HYPRE_Real +bfun_long_dbl( hypre_long_double xx, hypre_long_double yy, hypre_long_double zz ); + +HYPRE_Real +bfun_rs_flt( hypre_float xx, hypre_float yy, hypre_float zz ); +HYPRE_Real +bfun_rs_dbl( hypre_double xx, hypre_double yy, hypre_double zz ); +HYPRE_Real +bfun_rs_long_dbl( hypre_long_double xx, hypre_long_double yy, hypre_long_double zz ); + +HYPRE_Real +bndfun_flt( hypre_float xx, hypre_float yy, hypre_float zz ); +HYPRE_Real +bndfun_dbl( hypre_double xx, hypre_double yy, hypre_double zz ); +HYPRE_Real +bndfun_long_dbl( hypre_long_double xx, hypre_long_double yy, hypre_long_double zz ); + +HYPRE_Real +bndfun_rs_flt( hypre_float xx, hypre_float yy, hypre_float zz ); +HYPRE_Real +bndfun_rs_dbl( hypre_double xx, hypre_double yy, hypre_double zz ); +HYPRE_Real +bndfun_rs_long_dbl( hypre_long_double xx, hypre_long_double yy, hypre_long_double zz ); + +HYPRE_Real +cfun_flt( hypre_float xx, hypre_float yy, hypre_float zz ); +HYPRE_Real +cfun_dbl( hypre_double xx, hypre_double yy, hypre_double zz ); +HYPRE_Real +cfun_long_dbl( hypre_long_double xx, hypre_long_double yy, hypre_long_double zz ); + +HYPRE_Real +cfun_rs_flt( hypre_float xx, hypre_float yy, hypre_float zz ); +HYPRE_Real +cfun_rs_dbl( hypre_double xx, hypre_double yy, hypre_double zz ); +HYPRE_Real +cfun_rs_long_dbl( hypre_long_double xx, hypre_long_double yy, hypre_long_double zz ); + +HYPRE_Real +dfun_flt( hypre_float xx, hypre_float yy, hypre_float zz ); +HYPRE_Real +dfun_dbl( hypre_double xx, hypre_double yy, hypre_double zz ); +HYPRE_Real +dfun_long_dbl( hypre_long_double xx, hypre_long_double yy, hypre_long_double zz ); + +HYPRE_Real +dfun_rs_flt( hypre_float xx, hypre_float yy, hypre_float zz ); +HYPRE_Real +dfun_rs_dbl( hypre_double xx, hypre_double yy, hypre_double zz ); +HYPRE_Real +dfun_rs_long_dbl( hypre_long_double xx, hypre_long_double yy, hypre_long_double zz ); + +HYPRE_Real +efun_flt( hypre_float xx, hypre_float yy, hypre_float zz ); +HYPRE_Real +efun_dbl( hypre_double xx, hypre_double yy, hypre_double zz ); +HYPRE_Real +efun_long_dbl( hypre_long_double xx, hypre_long_double yy, hypre_long_double zz ); + +HYPRE_Real +efun_rs_flt( hypre_float xx, hypre_float yy, hypre_float zz ); +HYPRE_Real +efun_rs_dbl( hypre_double xx, hypre_double yy, hypre_double zz ); +HYPRE_Real +efun_rs_long_dbl( hypre_long_double xx, hypre_long_double yy, hypre_long_double zz ); + +HYPRE_Real +ffun_flt( hypre_float xx, hypre_float yy, hypre_float zz ); +HYPRE_Real +ffun_dbl( hypre_double xx, hypre_double yy, hypre_double zz ); +HYPRE_Real +ffun_long_dbl( hypre_long_double xx, hypre_long_double yy, hypre_long_double zz ); + +HYPRE_Real +ffun_rs_flt( hypre_float xx, hypre_float yy, hypre_float zz ); +HYPRE_Real +ffun_rs_dbl( hypre_double xx, hypre_double yy, hypre_double zz ); +HYPRE_Real +ffun_rs_long_dbl( hypre_long_double xx, hypre_long_double yy, hypre_long_double zz ); + +HYPRE_Real +gfun_flt( hypre_float xx, hypre_float yy, hypre_float zz ); +HYPRE_Real +gfun_dbl( hypre_double xx, hypre_double yy, hypre_double zz ); +HYPRE_Real +gfun_long_dbl( hypre_long_double xx, hypre_long_double yy, hypre_long_double zz ); + +HYPRE_Real +gfun_rs_flt( hypre_float xx, hypre_float yy, hypre_float zz ); +HYPRE_Real +gfun_rs_dbl( hypre_double xx, hypre_double yy, hypre_double zz ); +HYPRE_Real +gfun_rs_long_dbl( hypre_long_double xx, hypre_long_double yy, hypre_long_double zz ); + +HYPRE_Int +hypre_ADSComputePi_flt( 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_ADSComputePi_dbl( 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_ADSComputePi_long_dbl( 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_flt( 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_ADSComputePixyz_dbl( 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_ADSComputePixyz_long_dbl( 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 ); + +void * +hypre_ADSCreate_flt( void ); +void * +hypre_ADSCreate_dbl( void ); +void * +hypre_ADSCreate_long_dbl( void ); + +HYPRE_Int +hypre_ADSDestroy_flt( void *solver ); +HYPRE_Int +hypre_ADSDestroy_dbl( void *solver ); +HYPRE_Int +hypre_ADSDestroy_long_dbl( void *solver ); + +HYPRE_Int +hypre_ADSGetFinalRelativeResidualNorm_flt( void *solver, hypre_float *rel_resid_norm ); +HYPRE_Int +hypre_ADSGetFinalRelativeResidualNorm_dbl( void *solver, hypre_double *rel_resid_norm ); +HYPRE_Int +hypre_ADSGetFinalRelativeResidualNorm_long_dbl( void *solver, hypre_long_double *rel_resid_norm ); + +HYPRE_Int +hypre_ADSGetNumIterations_flt( void *solver, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_ADSGetNumIterations_dbl( void *solver, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_ADSGetNumIterations_long_dbl( void *solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +hypre_ADSSetAMGOptions_flt( void *solver, HYPRE_Int B_Pi_coarsen_type, HYPRE_Int B_Pi_agg_levels, HYPRE_Int B_Pi_relax_type, hypre_float B_Pi_theta, HYPRE_Int B_Pi_interp_type, HYPRE_Int B_Pi_Pmax ); +HYPRE_Int +hypre_ADSSetAMGOptions_dbl( void *solver, HYPRE_Int B_Pi_coarsen_type, HYPRE_Int B_Pi_agg_levels, HYPRE_Int B_Pi_relax_type, hypre_double B_Pi_theta, HYPRE_Int B_Pi_interp_type, HYPRE_Int B_Pi_Pmax ); +HYPRE_Int +hypre_ADSSetAMGOptions_long_dbl( void *solver, HYPRE_Int B_Pi_coarsen_type, HYPRE_Int B_Pi_agg_levels, HYPRE_Int B_Pi_relax_type, hypre_long_double B_Pi_theta, HYPRE_Int B_Pi_interp_type, HYPRE_Int B_Pi_Pmax ); + +HYPRE_Int +hypre_ADSSetAMSOptions_flt( 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_float B_C_theta, HYPRE_Int B_C_interp_type, HYPRE_Int B_C_Pmax ); +HYPRE_Int +hypre_ADSSetAMSOptions_dbl( 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_double B_C_theta, HYPRE_Int B_C_interp_type, HYPRE_Int B_C_Pmax ); +HYPRE_Int +hypre_ADSSetAMSOptions_long_dbl( 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_long_double B_C_theta, HYPRE_Int B_C_interp_type, HYPRE_Int B_C_Pmax ); + +HYPRE_Int +hypre_ADSSetChebySmoothingOptions_flt( void *solver, HYPRE_Int A_cheby_order, hypre_float A_cheby_fraction ); +HYPRE_Int +hypre_ADSSetChebySmoothingOptions_dbl( void *solver, HYPRE_Int A_cheby_order, hypre_double A_cheby_fraction ); +HYPRE_Int +hypre_ADSSetChebySmoothingOptions_long_dbl( void *solver, HYPRE_Int A_cheby_order, hypre_long_double A_cheby_fraction ); + +HYPRE_Int +hypre_ADSSetCoordinateVectors_flt( void *solver, hypre_ParVector *x, hypre_ParVector *y, hypre_ParVector *z ); +HYPRE_Int +hypre_ADSSetCoordinateVectors_dbl( void *solver, hypre_ParVector *x, hypre_ParVector *y, hypre_ParVector *z ); +HYPRE_Int +hypre_ADSSetCoordinateVectors_long_dbl( void *solver, hypre_ParVector *x, hypre_ParVector *y, hypre_ParVector *z ); + +HYPRE_Int +hypre_ADSSetCycleType_flt( void *solver, HYPRE_Int cycle_type ); +HYPRE_Int +hypre_ADSSetCycleType_dbl( void *solver, HYPRE_Int cycle_type ); +HYPRE_Int +hypre_ADSSetCycleType_long_dbl( void *solver, HYPRE_Int cycle_type ); + +HYPRE_Int +hypre_ADSSetDiscreteCurl_flt( void *solver, hypre_ParCSRMatrix *C ); +HYPRE_Int +hypre_ADSSetDiscreteCurl_dbl( void *solver, hypre_ParCSRMatrix *C ); +HYPRE_Int +hypre_ADSSetDiscreteCurl_long_dbl( void *solver, hypre_ParCSRMatrix *C ); + +HYPRE_Int +hypre_ADSSetDiscreteGradient_flt( void *solver, hypre_ParCSRMatrix *G ); +HYPRE_Int +hypre_ADSSetDiscreteGradient_dbl( void *solver, hypre_ParCSRMatrix *G ); +HYPRE_Int +hypre_ADSSetDiscreteGradient_long_dbl( void *solver, hypre_ParCSRMatrix *G ); + +HYPRE_Int +hypre_ADSSetInterpolations_flt( 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_ADSSetInterpolations_dbl( 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_ADSSetInterpolations_long_dbl( 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_flt( void *solver, HYPRE_Int maxit ); +HYPRE_Int +hypre_ADSSetMaxIter_dbl( void *solver, HYPRE_Int maxit ); +HYPRE_Int +hypre_ADSSetMaxIter_long_dbl( void *solver, HYPRE_Int maxit ); + +HYPRE_Int +hypre_ADSSetPrintLevel_flt( void *solver, HYPRE_Int print_level ); +HYPRE_Int +hypre_ADSSetPrintLevel_dbl( void *solver, HYPRE_Int print_level ); +HYPRE_Int +hypre_ADSSetPrintLevel_long_dbl( void *solver, HYPRE_Int print_level ); + +HYPRE_Int +hypre_ADSSetSmoothingOptions_flt( void *solver, HYPRE_Int A_relax_type, HYPRE_Int A_relax_times, hypre_float A_relax_weight, hypre_float A_omega ); +HYPRE_Int +hypre_ADSSetSmoothingOptions_dbl( void *solver, HYPRE_Int A_relax_type, HYPRE_Int A_relax_times, hypre_double A_relax_weight, hypre_double A_omega ); +HYPRE_Int +hypre_ADSSetSmoothingOptions_long_dbl( void *solver, HYPRE_Int A_relax_type, HYPRE_Int A_relax_times, hypre_long_double A_relax_weight, hypre_long_double A_omega ); + +HYPRE_Int +hypre_ADSSetTol_flt( void *solver, hypre_float tol ); +HYPRE_Int +hypre_ADSSetTol_dbl( void *solver, hypre_double tol ); +HYPRE_Int +hypre_ADSSetTol_long_dbl( void *solver, hypre_long_double tol ); + +HYPRE_Int +hypre_ADSSetup_flt( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); +HYPRE_Int +hypre_ADSSetup_dbl( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); +HYPRE_Int +hypre_ADSSetup_long_dbl( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); + +HYPRE_Int +hypre_ADSSolve_flt( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); +HYPRE_Int +hypre_ADSSolve_dbl( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); +HYPRE_Int +hypre_ADSSolve_long_dbl( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); + +void * +hypre_AMECreate_flt( void ); +void * +hypre_AMECreate_dbl( void ); +void * +hypre_AMECreate_long_dbl( void ); + +HYPRE_Int +hypre_AMEDestroy_flt( void *esolver ); +HYPRE_Int +hypre_AMEDestroy_dbl( void *esolver ); +HYPRE_Int +hypre_AMEDestroy_long_dbl( void *esolver ); + +HYPRE_Int +hypre_AMEDiscrDivFreeComponent_flt( void *esolver, hypre_ParVector *b ); +HYPRE_Int +hypre_AMEDiscrDivFreeComponent_dbl( void *esolver, hypre_ParVector *b ); +HYPRE_Int +hypre_AMEDiscrDivFreeComponent_long_dbl( void *esolver, hypre_ParVector *b ); + +HYPRE_Int +hypre_AMEGetEigenvalues_flt( void *esolver, hypre_float **eigenvalues_ptr ); +HYPRE_Int +hypre_AMEGetEigenvalues_dbl( void *esolver, hypre_double **eigenvalues_ptr ); +HYPRE_Int +hypre_AMEGetEigenvalues_long_dbl( void *esolver, hypre_long_double **eigenvalues_ptr ); + +HYPRE_Int +hypre_AMEGetEigenvectors_flt( void *esolver, HYPRE_ParVector **eigenvectors_ptr ); +HYPRE_Int +hypre_AMEGetEigenvectors_dbl( void *esolver, HYPRE_ParVector **eigenvectors_ptr ); +HYPRE_Int +hypre_AMEGetEigenvectors_long_dbl( void *esolver, HYPRE_ParVector **eigenvectors_ptr ); + +void +hypre_AMEMultiOperatorA_flt( void *data, void *x, void *y ); +void +hypre_AMEMultiOperatorA_dbl( void *data, void *x, void *y ); +void +hypre_AMEMultiOperatorA_long_dbl( void *data, void *x, void *y ); + +void +hypre_AMEMultiOperatorB_flt( void *data, void *x, void *y ); +void +hypre_AMEMultiOperatorB_dbl( void *data, void *x, void *y ); +void +hypre_AMEMultiOperatorB_long_dbl( void *data, void *x, void *y ); + +void +hypre_AMEMultiOperatorM_flt( void *data, void *x, void *y ); +void +hypre_AMEMultiOperatorM_dbl( void *data, void *x, void *y ); +void +hypre_AMEMultiOperatorM_long_dbl( void *data, void *x, void *y ); + +void +hypre_AMEOperatorA_flt( void *data, void *x, void *y ); +void +hypre_AMEOperatorA_dbl( void *data, void *x, void *y ); +void +hypre_AMEOperatorA_long_dbl( void *data, void *x, void *y ); + +void +hypre_AMEOperatorB_flt( void *data, void *x, void *y ); +void +hypre_AMEOperatorB_dbl( void *data, void *x, void *y ); +void +hypre_AMEOperatorB_long_dbl( void *data, void *x, void *y ); + +void +hypre_AMEOperatorM_flt( void *data, void *x, void *y ); +void +hypre_AMEOperatorM_dbl( void *data, void *x, void *y ); +void +hypre_AMEOperatorM_long_dbl( void *data, void *x, void *y ); + +HYPRE_Int +hypre_AMESetAMSSolver_flt( void *esolver, void *ams_solver ); +HYPRE_Int +hypre_AMESetAMSSolver_dbl( void *esolver, void *ams_solver ); +HYPRE_Int +hypre_AMESetAMSSolver_long_dbl( void *esolver, void *ams_solver ); + +HYPRE_Int +hypre_AMESetBlockSize_flt( void *esolver, HYPRE_Int block_size ); +HYPRE_Int +hypre_AMESetBlockSize_dbl( void *esolver, HYPRE_Int block_size ); +HYPRE_Int +hypre_AMESetBlockSize_long_dbl( void *esolver, HYPRE_Int block_size ); + +HYPRE_Int +hypre_AMESetMassMatrix_flt( void *esolver, hypre_ParCSRMatrix *M ); +HYPRE_Int +hypre_AMESetMassMatrix_dbl( void *esolver, hypre_ParCSRMatrix *M ); +HYPRE_Int +hypre_AMESetMassMatrix_long_dbl( void *esolver, hypre_ParCSRMatrix *M ); + +HYPRE_Int +hypre_AMESetMaxIter_flt( void *esolver, HYPRE_Int maxit ); +HYPRE_Int +hypre_AMESetMaxIter_dbl( void *esolver, HYPRE_Int maxit ); +HYPRE_Int +hypre_AMESetMaxIter_long_dbl( void *esolver, HYPRE_Int maxit ); + +HYPRE_Int +hypre_AMESetMaxPCGIter_flt( void *esolver, HYPRE_Int maxit ); +HYPRE_Int +hypre_AMESetMaxPCGIter_dbl( void *esolver, HYPRE_Int maxit ); +HYPRE_Int +hypre_AMESetMaxPCGIter_long_dbl( void *esolver, HYPRE_Int maxit ); + +HYPRE_Int +hypre_AMESetPrintLevel_flt( void *esolver, HYPRE_Int print_level ); +HYPRE_Int +hypre_AMESetPrintLevel_dbl( void *esolver, HYPRE_Int print_level ); +HYPRE_Int +hypre_AMESetPrintLevel_long_dbl( void *esolver, HYPRE_Int print_level ); + +HYPRE_Int +hypre_AMESetRTol_flt( void *esolver, hypre_float tol ); +HYPRE_Int +hypre_AMESetRTol_dbl( void *esolver, hypre_double tol ); +HYPRE_Int +hypre_AMESetRTol_long_dbl( void *esolver, hypre_long_double tol ); + +HYPRE_Int +hypre_AMESetTol_flt( void *esolver, hypre_float tol ); +HYPRE_Int +hypre_AMESetTol_dbl( void *esolver, hypre_double tol ); +HYPRE_Int +hypre_AMESetTol_long_dbl( void *esolver, hypre_long_double tol ); + +HYPRE_Int +hypre_AMESetup_flt( void *esolver ); +HYPRE_Int +hypre_AMESetup_dbl( void *esolver ); +HYPRE_Int +hypre_AMESetup_long_dbl( void *esolver ); + +HYPRE_Int +hypre_AMESolve_flt( void *esolver ); +HYPRE_Int +hypre_AMESolve_dbl( void *esolver ); +HYPRE_Int +hypre_AMESolve_long_dbl( void *esolver ); + +HYPRE_Int +hypre_AMGCreateDomainDof_flt( 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_AMGCreateDomainDof_dbl( 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_AMGCreateDomainDof_long_dbl( 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_AMGDDCommPkg * +hypre_AMGDDCommPkgCreate_flt( HYPRE_Int num_levels ); +hypre_AMGDDCommPkg * +hypre_AMGDDCommPkgCreate_dbl( HYPRE_Int num_levels ); +hypre_AMGDDCommPkg * +hypre_AMGDDCommPkgCreate_long_dbl( HYPRE_Int num_levels ); + +HYPRE_Int +hypre_AMGDDCommPkgDestroy_flt( hypre_AMGDDCommPkg *compGridCommPkg ); +HYPRE_Int +hypre_AMGDDCommPkgDestroy_dbl( hypre_AMGDDCommPkg *compGridCommPkg ); +HYPRE_Int +hypre_AMGDDCommPkgDestroy_long_dbl( hypre_AMGDDCommPkg *compGridCommPkg ); + +HYPRE_Int +hypre_AMGDDCommPkgRecvLevelDestroy_flt( hypre_AMGDDCommPkg *amgddCommPkg, HYPRE_Int level, HYPRE_Int proc ); +HYPRE_Int +hypre_AMGDDCommPkgRecvLevelDestroy_dbl( hypre_AMGDDCommPkg *amgddCommPkg, HYPRE_Int level, HYPRE_Int proc ); +HYPRE_Int +hypre_AMGDDCommPkgRecvLevelDestroy_long_dbl( hypre_AMGDDCommPkg *amgddCommPkg, HYPRE_Int level, HYPRE_Int proc ); + +HYPRE_Int +hypre_AMGDDCommPkgSendLevelDestroy_flt( hypre_AMGDDCommPkg *amgddCommPkg, HYPRE_Int level, HYPRE_Int proc ); +HYPRE_Int +hypre_AMGDDCommPkgSendLevelDestroy_dbl( hypre_AMGDDCommPkg *amgddCommPkg, HYPRE_Int level, HYPRE_Int proc ); +HYPRE_Int +hypre_AMGDDCommPkgSendLevelDestroy_long_dbl( hypre_AMGDDCommPkg *amgddCommPkg, HYPRE_Int level, HYPRE_Int proc ); + +hypre_AMGDDCompGrid * +hypre_AMGDDCompGridCreate_flt( void ); +hypre_AMGDDCompGrid * +hypre_AMGDDCompGridCreate_dbl( void ); +hypre_AMGDDCompGrid * +hypre_AMGDDCompGridCreate_long_dbl( void ); + +HYPRE_Int +hypre_AMGDDCompGridDestroy_flt( hypre_AMGDDCompGrid *compGrid ); +HYPRE_Int +hypre_AMGDDCompGridDestroy_dbl( hypre_AMGDDCompGrid *compGrid ); +HYPRE_Int +hypre_AMGDDCompGridDestroy_long_dbl( hypre_AMGDDCompGrid *compGrid ); + +HYPRE_Int +hypre_AMGDDCompGridFinalize_flt( hypre_ParAMGDDData *amgdd_data ); +HYPRE_Int +hypre_AMGDDCompGridFinalize_dbl( hypre_ParAMGDDData *amgdd_data ); +HYPRE_Int +hypre_AMGDDCompGridFinalize_long_dbl( hypre_ParAMGDDData *amgdd_data ); + +HYPRE_Int +hypre_AMGDDCompGridInitialize_flt( hypre_ParAMGDDData *amgdd_data, HYPRE_Int padding, HYPRE_Int level ); +HYPRE_Int +hypre_AMGDDCompGridInitialize_dbl( hypre_ParAMGDDData *amgdd_data, HYPRE_Int padding, HYPRE_Int level ); +HYPRE_Int +hypre_AMGDDCompGridInitialize_long_dbl( hypre_ParAMGDDData *amgdd_data, HYPRE_Int padding, HYPRE_Int level ); + +hypre_AMGDDCompGridMatrix* +hypre_AMGDDCompGridMatrixCreate_flt( void ); +hypre_AMGDDCompGridMatrix* +hypre_AMGDDCompGridMatrixCreate_dbl( void ); +hypre_AMGDDCompGridMatrix* +hypre_AMGDDCompGridMatrixCreate_long_dbl( void ); + +HYPRE_Int +hypre_AMGDDCompGridMatrixDestroy_flt( hypre_AMGDDCompGridMatrix *matrix ); +HYPRE_Int +hypre_AMGDDCompGridMatrixDestroy_dbl( hypre_AMGDDCompGridMatrix *matrix ); +HYPRE_Int +hypre_AMGDDCompGridMatrixDestroy_long_dbl( hypre_AMGDDCompGridMatrix *matrix ); + +HYPRE_Int +hypre_AMGDDCompGridMatvec_flt( hypre_float alpha, hypre_AMGDDCompGridMatrix *A, hypre_AMGDDCompGridVector *x, hypre_float beta, hypre_AMGDDCompGridVector *y ); +HYPRE_Int +hypre_AMGDDCompGridMatvec_dbl( hypre_double alpha, hypre_AMGDDCompGridMatrix *A, hypre_AMGDDCompGridVector *x, hypre_double beta, hypre_AMGDDCompGridVector *y ); +HYPRE_Int +hypre_AMGDDCompGridMatvec_long_dbl( hypre_long_double alpha, hypre_AMGDDCompGridMatrix *A, hypre_AMGDDCompGridVector *x, hypre_long_double beta, hypre_AMGDDCompGridVector *y ); + +HYPRE_Int +hypre_AMGDDCompGridRealMatvec_flt( hypre_float alpha, hypre_AMGDDCompGridMatrix *A, hypre_AMGDDCompGridVector *x, hypre_float beta, hypre_AMGDDCompGridVector *y ); +HYPRE_Int +hypre_AMGDDCompGridRealMatvec_dbl( hypre_double alpha, hypre_AMGDDCompGridMatrix *A, hypre_AMGDDCompGridVector *x, hypre_double beta, hypre_AMGDDCompGridVector *y ); +HYPRE_Int +hypre_AMGDDCompGridRealMatvec_long_dbl( hypre_long_double alpha, hypre_AMGDDCompGridMatrix *A, hypre_AMGDDCompGridVector *x, hypre_long_double beta, hypre_AMGDDCompGridVector *y ); + +HYPRE_Int +hypre_AMGDDCompGridResize_flt( hypre_AMGDDCompGrid *compGrid, HYPRE_Int new_size, HYPRE_Int need_coarse_info ); +HYPRE_Int +hypre_AMGDDCompGridResize_dbl( hypre_AMGDDCompGrid *compGrid, HYPRE_Int new_size, HYPRE_Int need_coarse_info ); +HYPRE_Int +hypre_AMGDDCompGridResize_long_dbl( hypre_AMGDDCompGrid *compGrid, HYPRE_Int new_size, HYPRE_Int need_coarse_info ); + +HYPRE_Int +hypre_AMGDDCompGridSetupLocalIndices_flt( 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_AMGDDCompGridSetupLocalIndices_dbl( 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_AMGDDCompGridSetupLocalIndices_long_dbl( 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_flt( hypre_ParAMGDDData *amgdd_data ); +HYPRE_Int +hypre_AMGDDCompGridSetupLocalIndicesP_dbl( hypre_ParAMGDDData *amgdd_data ); +HYPRE_Int +hypre_AMGDDCompGridSetupLocalIndicesP_long_dbl( hypre_ParAMGDDData *amgdd_data ); + +HYPRE_Int +hypre_AMGDDCompGridSetupRelax_flt( hypre_ParAMGDDData *amgdd_data ); +HYPRE_Int +hypre_AMGDDCompGridSetupRelax_dbl( hypre_ParAMGDDData *amgdd_data ); +HYPRE_Int +hypre_AMGDDCompGridSetupRelax_long_dbl( hypre_ParAMGDDData *amgdd_data ); + +HYPRE_Int +hypre_AMGDDCompGridVectorAxpy_flt( hypre_float alpha, hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ); +HYPRE_Int +hypre_AMGDDCompGridVectorAxpy_dbl( hypre_double alpha, hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ); +HYPRE_Int +hypre_AMGDDCompGridVectorAxpy_long_dbl( hypre_long_double alpha, hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ); + +HYPRE_Int +hypre_AMGDDCompGridVectorCopy_flt( hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ); +HYPRE_Int +hypre_AMGDDCompGridVectorCopy_dbl( hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ); +HYPRE_Int +hypre_AMGDDCompGridVectorCopy_long_dbl( hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ); + +hypre_AMGDDCompGridVector* +hypre_AMGDDCompGridVectorCreate_flt( void ); +hypre_AMGDDCompGridVector* +hypre_AMGDDCompGridVectorCreate_dbl( void ); +hypre_AMGDDCompGridVector* +hypre_AMGDDCompGridVectorCreate_long_dbl( void ); + +HYPRE_Int +hypre_AMGDDCompGridVectorDestroy_flt( hypre_AMGDDCompGridVector *vector ); +HYPRE_Int +hypre_AMGDDCompGridVectorDestroy_dbl( hypre_AMGDDCompGridVector *vector ); +HYPRE_Int +hypre_AMGDDCompGridVectorDestroy_long_dbl( hypre_AMGDDCompGridVector *vector ); + +HYPRE_Int +hypre_AMGDDCompGridVectorInitialize_flt( hypre_AMGDDCompGridVector *vector, HYPRE_Int num_owned, HYPRE_Int num_nonowned, HYPRE_Int num_real ); +HYPRE_Int +hypre_AMGDDCompGridVectorInitialize_dbl( hypre_AMGDDCompGridVector *vector, HYPRE_Int num_owned, HYPRE_Int num_nonowned, HYPRE_Int num_real ); +HYPRE_Int +hypre_AMGDDCompGridVectorInitialize_long_dbl( hypre_AMGDDCompGridVector *vector, HYPRE_Int num_owned, HYPRE_Int num_nonowned, HYPRE_Int num_real ); + +HYPRE_Real +hypre_AMGDDCompGridVectorInnerProd_flt( hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ); +HYPRE_Real +hypre_AMGDDCompGridVectorInnerProd_dbl( hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ); +HYPRE_Real +hypre_AMGDDCompGridVectorInnerProd_long_dbl( hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ); + +HYPRE_Int +hypre_AMGDDCompGridVectorRealAxpy_flt( hypre_float alpha, hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ); +HYPRE_Int +hypre_AMGDDCompGridVectorRealAxpy_dbl( hypre_double alpha, hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ); +HYPRE_Int +hypre_AMGDDCompGridVectorRealAxpy_long_dbl( hypre_long_double alpha, hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ); + +HYPRE_Int +hypre_AMGDDCompGridVectorRealCopy_flt( hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ); +HYPRE_Int +hypre_AMGDDCompGridVectorRealCopy_dbl( hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ); +HYPRE_Int +hypre_AMGDDCompGridVectorRealCopy_long_dbl( hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ); + +HYPRE_Real +hypre_AMGDDCompGridVectorRealInnerProd_flt( hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ); +HYPRE_Real +hypre_AMGDDCompGridVectorRealInnerProd_dbl( hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ); +HYPRE_Real +hypre_AMGDDCompGridVectorRealInnerProd_long_dbl( hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ); + +HYPRE_Int +hypre_AMGDDCompGridVectorRealScale_flt( hypre_float alpha, hypre_AMGDDCompGridVector *x ); +HYPRE_Int +hypre_AMGDDCompGridVectorRealScale_dbl( hypre_double alpha, hypre_AMGDDCompGridVector *x ); +HYPRE_Int +hypre_AMGDDCompGridVectorRealScale_long_dbl( hypre_long_double alpha, hypre_AMGDDCompGridVector *x ); + +HYPRE_Int +hypre_AMGDDCompGridVectorRealSetConstantValues_flt( hypre_AMGDDCompGridVector *vector, hypre_float value ); +HYPRE_Int +hypre_AMGDDCompGridVectorRealSetConstantValues_dbl( hypre_AMGDDCompGridVector *vector, hypre_double value ); +HYPRE_Int +hypre_AMGDDCompGridVectorRealSetConstantValues_long_dbl( hypre_AMGDDCompGridVector *vector, hypre_long_double value ); + +HYPRE_Int +hypre_AMGDDCompGridVectorScale_flt( hypre_float alpha, hypre_AMGDDCompGridVector *x ); +HYPRE_Int +hypre_AMGDDCompGridVectorScale_dbl( hypre_double alpha, hypre_AMGDDCompGridVector *x ); +HYPRE_Int +hypre_AMGDDCompGridVectorScale_long_dbl( hypre_long_double alpha, hypre_AMGDDCompGridVector *x ); + +HYPRE_Int +hypre_AMGDDCompGridVectorSetConstantValues_flt( hypre_AMGDDCompGridVector *vector, hypre_float value ); +HYPRE_Int +hypre_AMGDDCompGridVectorSetConstantValues_dbl( hypre_AMGDDCompGridVector *vector, hypre_double value ); +HYPRE_Int +hypre_AMGDDCompGridVectorSetConstantValues_long_dbl( hypre_AMGDDCompGridVector *vector, hypre_long_double value ); + +void * +hypre_AMGHybridCreate_flt( void ); +void * +hypre_AMGHybridCreate_dbl( void ); +void * +hypre_AMGHybridCreate_long_dbl( void ); + +HYPRE_Int +hypre_AMGHybridDestroy_flt( void *AMGhybrid_vdata ); +HYPRE_Int +hypre_AMGHybridDestroy_dbl( void *AMGhybrid_vdata ); +HYPRE_Int +hypre_AMGHybridDestroy_long_dbl( void *AMGhybrid_vdata ); + +HYPRE_Int +hypre_AMGHybridGetDSCGNumIterations_flt( void *AMGhybrid_vdata, HYPRE_Int *dscg_num_its ); +HYPRE_Int +hypre_AMGHybridGetDSCGNumIterations_dbl( void *AMGhybrid_vdata, HYPRE_Int *dscg_num_its ); +HYPRE_Int +hypre_AMGHybridGetDSCGNumIterations_long_dbl( void *AMGhybrid_vdata, HYPRE_Int *dscg_num_its ); + +HYPRE_Int +hypre_AMGHybridGetFinalRelativeResidualNorm_flt( void *AMGhybrid_vdata, hypre_float *final_rel_res_norm ); +HYPRE_Int +hypre_AMGHybridGetFinalRelativeResidualNorm_dbl( void *AMGhybrid_vdata, hypre_double *final_rel_res_norm ); +HYPRE_Int +hypre_AMGHybridGetFinalRelativeResidualNorm_long_dbl( void *AMGhybrid_vdata, hypre_long_double *final_rel_res_norm ); + +HYPRE_Int +hypre_AMGHybridGetNumIterations_flt( void *AMGhybrid_vdata, HYPRE_Int *num_its ); +HYPRE_Int +hypre_AMGHybridGetNumIterations_dbl( void *AMGhybrid_vdata, HYPRE_Int *num_its ); +HYPRE_Int +hypre_AMGHybridGetNumIterations_long_dbl( void *AMGhybrid_vdata, HYPRE_Int *num_its ); + +HYPRE_Int +hypre_AMGHybridGetPCGNumIterations_flt( void *AMGhybrid_vdata, HYPRE_Int *pcg_num_its ); +HYPRE_Int +hypre_AMGHybridGetPCGNumIterations_dbl( void *AMGhybrid_vdata, HYPRE_Int *pcg_num_its ); +HYPRE_Int +hypre_AMGHybridGetPCGNumIterations_long_dbl( void *AMGhybrid_vdata, HYPRE_Int *pcg_num_its ); + +HYPRE_Int +hypre_AMGHybridGetRecomputeResidual_flt( void *AMGhybrid_vdata, HYPRE_Int *recompute_residual ); +HYPRE_Int +hypre_AMGHybridGetRecomputeResidual_dbl( void *AMGhybrid_vdata, HYPRE_Int *recompute_residual ); +HYPRE_Int +hypre_AMGHybridGetRecomputeResidual_long_dbl( void *AMGhybrid_vdata, HYPRE_Int *recompute_residual ); + +HYPRE_Int +hypre_AMGHybridGetRecomputeResidualP_flt( void *AMGhybrid_vdata, HYPRE_Int *recompute_residual_p ); +HYPRE_Int +hypre_AMGHybridGetRecomputeResidualP_dbl( void *AMGhybrid_vdata, HYPRE_Int *recompute_residual_p ); +HYPRE_Int +hypre_AMGHybridGetRecomputeResidualP_long_dbl( void *AMGhybrid_vdata, HYPRE_Int *recompute_residual_p ); + +HYPRE_Int +hypre_AMGHybridGetSetupSolveTime_flt( void *AMGhybrid_vdata, hypre_float *time ); +HYPRE_Int +hypre_AMGHybridGetSetupSolveTime_dbl( void *AMGhybrid_vdata, hypre_double *time ); +HYPRE_Int +hypre_AMGHybridGetSetupSolveTime_long_dbl( void *AMGhybrid_vdata, hypre_long_double *time ); + +HYPRE_Int +hypre_AMGHybridSetAbsoluteTol_flt( void *AMGhybrid_vdata, hypre_float a_tol ); +HYPRE_Int +hypre_AMGHybridSetAbsoluteTol_dbl( void *AMGhybrid_vdata, hypre_double a_tol ); +HYPRE_Int +hypre_AMGHybridSetAbsoluteTol_long_dbl( void *AMGhybrid_vdata, hypre_long_double a_tol ); + +HYPRE_Int +hypre_AMGHybridSetAggInterpType_flt( void *AMGhybrid_vdata, HYPRE_Int agg_interp_type ); +HYPRE_Int +hypre_AMGHybridSetAggInterpType_dbl( void *AMGhybrid_vdata, HYPRE_Int agg_interp_type ); +HYPRE_Int +hypre_AMGHybridSetAggInterpType_long_dbl( void *AMGhybrid_vdata, HYPRE_Int agg_interp_type ); + +HYPRE_Int +hypre_AMGHybridSetAggNumLevels_flt( void *AMGhybrid_vdata, HYPRE_Int agg_num_levels ); +HYPRE_Int +hypre_AMGHybridSetAggNumLevels_dbl( void *AMGhybrid_vdata, HYPRE_Int agg_num_levels ); +HYPRE_Int +hypre_AMGHybridSetAggNumLevels_long_dbl( void *AMGhybrid_vdata, HYPRE_Int agg_num_levels ); + +HYPRE_Int +hypre_AMGHybridSetCoarsenType_flt( void *AMGhybrid_vdata, HYPRE_Int coarsen_type ); +HYPRE_Int +hypre_AMGHybridSetCoarsenType_dbl( void *AMGhybrid_vdata, HYPRE_Int coarsen_type ); +HYPRE_Int +hypre_AMGHybridSetCoarsenType_long_dbl( void *AMGhybrid_vdata, HYPRE_Int coarsen_type ); + +HYPRE_Int +hypre_AMGHybridSetConvergenceTol_flt( void *AMGhybrid_vdata, hypre_float cf_tol ); +HYPRE_Int +hypre_AMGHybridSetConvergenceTol_dbl( void *AMGhybrid_vdata, hypre_double cf_tol ); +HYPRE_Int +hypre_AMGHybridSetConvergenceTol_long_dbl( void *AMGhybrid_vdata, hypre_long_double cf_tol ); + +HYPRE_Int +hypre_AMGHybridSetCycleNumSweeps_flt( void *AMGhybrid_vdata, HYPRE_Int num_sweeps, HYPRE_Int k ); +HYPRE_Int +hypre_AMGHybridSetCycleNumSweeps_dbl( void *AMGhybrid_vdata, HYPRE_Int num_sweeps, HYPRE_Int k ); +HYPRE_Int +hypre_AMGHybridSetCycleNumSweeps_long_dbl( void *AMGhybrid_vdata, HYPRE_Int num_sweeps, HYPRE_Int k ); + +HYPRE_Int +hypre_AMGHybridSetCycleRelaxType_flt( void *AMGhybrid_vdata, HYPRE_Int relax_type, HYPRE_Int k ); +HYPRE_Int +hypre_AMGHybridSetCycleRelaxType_dbl( void *AMGhybrid_vdata, HYPRE_Int relax_type, HYPRE_Int k ); +HYPRE_Int +hypre_AMGHybridSetCycleRelaxType_long_dbl( void *AMGhybrid_vdata, HYPRE_Int relax_type, HYPRE_Int k ); + +HYPRE_Int +hypre_AMGHybridSetCycleType_flt( void *AMGhybrid_vdata, HYPRE_Int cycle_type ); +HYPRE_Int +hypre_AMGHybridSetCycleType_dbl( void *AMGhybrid_vdata, HYPRE_Int cycle_type ); +HYPRE_Int +hypre_AMGHybridSetCycleType_long_dbl( void *AMGhybrid_vdata, HYPRE_Int cycle_type ); + +HYPRE_Int +hypre_AMGHybridSetDSCGMaxIter_flt( void *AMGhybrid_vdata, HYPRE_Int dscg_max_its ); +HYPRE_Int +hypre_AMGHybridSetDSCGMaxIter_dbl( void *AMGhybrid_vdata, HYPRE_Int dscg_max_its ); +HYPRE_Int +hypre_AMGHybridSetDSCGMaxIter_long_dbl( void *AMGhybrid_vdata, HYPRE_Int dscg_max_its ); + +HYPRE_Int +hypre_AMGHybridSetDofFunc_flt( void *AMGhybrid_vdata, HYPRE_Int *dof_func ); +HYPRE_Int +hypre_AMGHybridSetDofFunc_dbl( void *AMGhybrid_vdata, HYPRE_Int *dof_func ); +HYPRE_Int +hypre_AMGHybridSetDofFunc_long_dbl( void *AMGhybrid_vdata, HYPRE_Int *dof_func ); + +HYPRE_Int +hypre_AMGHybridSetGridRelaxPoints_flt( void *AMGhybrid_vdata, HYPRE_Int **grid_relax_points ); +HYPRE_Int +hypre_AMGHybridSetGridRelaxPoints_dbl( void *AMGhybrid_vdata, HYPRE_Int **grid_relax_points ); +HYPRE_Int +hypre_AMGHybridSetGridRelaxPoints_long_dbl( void *AMGhybrid_vdata, HYPRE_Int **grid_relax_points ); + +HYPRE_Int +hypre_AMGHybridSetGridRelaxType_flt( void *AMGhybrid_vdata, HYPRE_Int *grid_relax_type ); +HYPRE_Int +hypre_AMGHybridSetGridRelaxType_dbl( void *AMGhybrid_vdata, HYPRE_Int *grid_relax_type ); +HYPRE_Int +hypre_AMGHybridSetGridRelaxType_long_dbl( void *AMGhybrid_vdata, HYPRE_Int *grid_relax_type ); + +HYPRE_Int +hypre_AMGHybridSetInterpType_flt( void *AMGhybrid_vdata, HYPRE_Int interp_type ); +HYPRE_Int +hypre_AMGHybridSetInterpType_dbl( void *AMGhybrid_vdata, HYPRE_Int interp_type ); +HYPRE_Int +hypre_AMGHybridSetInterpType_long_dbl( void *AMGhybrid_vdata, HYPRE_Int interp_type ); + +HYPRE_Int +hypre_AMGHybridSetKDim_flt( void *AMGhybrid_vdata, HYPRE_Int k_dim ); +HYPRE_Int +hypre_AMGHybridSetKDim_dbl( void *AMGhybrid_vdata, HYPRE_Int k_dim ); +HYPRE_Int +hypre_AMGHybridSetKDim_long_dbl( void *AMGhybrid_vdata, HYPRE_Int k_dim ); + +HYPRE_Int +hypre_AMGHybridSetKeepTranspose_flt( void *AMGhybrid_vdata, HYPRE_Int keepT ); +HYPRE_Int +hypre_AMGHybridSetKeepTranspose_dbl( void *AMGhybrid_vdata, HYPRE_Int keepT ); +HYPRE_Int +hypre_AMGHybridSetKeepTranspose_long_dbl( void *AMGhybrid_vdata, HYPRE_Int keepT ); + +HYPRE_Int +hypre_AMGHybridSetLevelOuterWt_flt( void *AMGhybrid_vdata, hypre_float outer_wt, HYPRE_Int level ); +HYPRE_Int +hypre_AMGHybridSetLevelOuterWt_dbl( void *AMGhybrid_vdata, hypre_double outer_wt, HYPRE_Int level ); +HYPRE_Int +hypre_AMGHybridSetLevelOuterWt_long_dbl( void *AMGhybrid_vdata, hypre_long_double outer_wt, HYPRE_Int level ); + +HYPRE_Int +hypre_AMGHybridSetLevelRelaxWt_flt( void *AMGhybrid_vdata, hypre_float relax_wt, HYPRE_Int level ); +HYPRE_Int +hypre_AMGHybridSetLevelRelaxWt_dbl( void *AMGhybrid_vdata, hypre_double relax_wt, HYPRE_Int level ); +HYPRE_Int +hypre_AMGHybridSetLevelRelaxWt_long_dbl( void *AMGhybrid_vdata, hypre_long_double relax_wt, HYPRE_Int level ); + +HYPRE_Int +hypre_AMGHybridSetLogging_flt( void *AMGhybrid_vdata, HYPRE_Int logging ); +HYPRE_Int +hypre_AMGHybridSetLogging_dbl( void *AMGhybrid_vdata, HYPRE_Int logging ); +HYPRE_Int +hypre_AMGHybridSetLogging_long_dbl( void *AMGhybrid_vdata, HYPRE_Int logging ); + +HYPRE_Int +hypre_AMGHybridSetMaxCoarseSize_flt( void *AMGhybrid_vdata, HYPRE_Int max_coarse_size ); +HYPRE_Int +hypre_AMGHybridSetMaxCoarseSize_dbl( void *AMGhybrid_vdata, HYPRE_Int max_coarse_size ); +HYPRE_Int +hypre_AMGHybridSetMaxCoarseSize_long_dbl( void *AMGhybrid_vdata, HYPRE_Int max_coarse_size ); + +HYPRE_Int +hypre_AMGHybridSetMaxLevels_flt( void *AMGhybrid_vdata, HYPRE_Int max_levels ); +HYPRE_Int +hypre_AMGHybridSetMaxLevels_dbl( void *AMGhybrid_vdata, HYPRE_Int max_levels ); +HYPRE_Int +hypre_AMGHybridSetMaxLevels_long_dbl( void *AMGhybrid_vdata, HYPRE_Int max_levels ); + +HYPRE_Int +hypre_AMGHybridSetMaxRowSum_flt( void *AMGhybrid_vdata, hypre_float max_row_sum ); +HYPRE_Int +hypre_AMGHybridSetMaxRowSum_dbl( void *AMGhybrid_vdata, hypre_double max_row_sum ); +HYPRE_Int +hypre_AMGHybridSetMaxRowSum_long_dbl( void *AMGhybrid_vdata, hypre_long_double max_row_sum ); + +HYPRE_Int +hypre_AMGHybridSetMeasureType_flt( void *AMGhybrid_vdata, HYPRE_Int measure_type ); +HYPRE_Int +hypre_AMGHybridSetMeasureType_dbl( void *AMGhybrid_vdata, HYPRE_Int measure_type ); +HYPRE_Int +hypre_AMGHybridSetMeasureType_long_dbl( void *AMGhybrid_vdata, HYPRE_Int measure_type ); + +HYPRE_Int +hypre_AMGHybridSetMinCoarseSize_flt( void *AMGhybrid_vdata, HYPRE_Int min_coarse_size ); +HYPRE_Int +hypre_AMGHybridSetMinCoarseSize_dbl( void *AMGhybrid_vdata, HYPRE_Int min_coarse_size ); +HYPRE_Int +hypre_AMGHybridSetMinCoarseSize_long_dbl( void *AMGhybrid_vdata, HYPRE_Int min_coarse_size ); + +HYPRE_Int +hypre_AMGHybridSetNodal_flt( void *AMGhybrid_vdata, HYPRE_Int nodal ); +HYPRE_Int +hypre_AMGHybridSetNodal_dbl( void *AMGhybrid_vdata, HYPRE_Int nodal ); +HYPRE_Int +hypre_AMGHybridSetNodal_long_dbl( void *AMGhybrid_vdata, HYPRE_Int nodal ); + +HYPRE_Int +hypre_AMGHybridSetNonGalerkinTol_flt( void *AMGhybrid_vdata, HYPRE_Int nongalerk_num_tol, hypre_float *nongalerkin_tol ); +HYPRE_Int +hypre_AMGHybridSetNonGalerkinTol_dbl( void *AMGhybrid_vdata, HYPRE_Int nongalerk_num_tol, hypre_double *nongalerkin_tol ); +HYPRE_Int +hypre_AMGHybridSetNonGalerkinTol_long_dbl( void *AMGhybrid_vdata, HYPRE_Int nongalerk_num_tol, hypre_long_double *nongalerkin_tol ); + +HYPRE_Int +hypre_AMGHybridSetNumFunctions_flt( void *AMGhybrid_vdata, HYPRE_Int num_functions ); +HYPRE_Int +hypre_AMGHybridSetNumFunctions_dbl( void *AMGhybrid_vdata, HYPRE_Int num_functions ); +HYPRE_Int +hypre_AMGHybridSetNumFunctions_long_dbl( void *AMGhybrid_vdata, HYPRE_Int num_functions ); + +HYPRE_Int +hypre_AMGHybridSetNumGridSweeps_flt( void *AMGhybrid_vdata, HYPRE_Int *num_grid_sweeps ); +HYPRE_Int +hypre_AMGHybridSetNumGridSweeps_dbl( void *AMGhybrid_vdata, HYPRE_Int *num_grid_sweeps ); +HYPRE_Int +hypre_AMGHybridSetNumGridSweeps_long_dbl( void *AMGhybrid_vdata, HYPRE_Int *num_grid_sweeps ); + +HYPRE_Int +hypre_AMGHybridSetNumPaths_flt( void *AMGhybrid_vdata, HYPRE_Int num_paths ); +HYPRE_Int +hypre_AMGHybridSetNumPaths_dbl( void *AMGhybrid_vdata, HYPRE_Int num_paths ); +HYPRE_Int +hypre_AMGHybridSetNumPaths_long_dbl( void *AMGhybrid_vdata, HYPRE_Int num_paths ); + +HYPRE_Int +hypre_AMGHybridSetNumSweeps_flt( void *AMGhybrid_vdata, HYPRE_Int num_sweeps ); +HYPRE_Int +hypre_AMGHybridSetNumSweeps_dbl( void *AMGhybrid_vdata, HYPRE_Int num_sweeps ); +HYPRE_Int +hypre_AMGHybridSetNumSweeps_long_dbl( void *AMGhybrid_vdata, HYPRE_Int num_sweeps ); + +HYPRE_Int +hypre_AMGHybridSetOmega_flt( void *AMGhybrid_vdata, hypre_float *omega ); +HYPRE_Int +hypre_AMGHybridSetOmega_dbl( void *AMGhybrid_vdata, hypre_double *omega ); +HYPRE_Int +hypre_AMGHybridSetOmega_long_dbl( void *AMGhybrid_vdata, hypre_long_double *omega ); + +HYPRE_Int +hypre_AMGHybridSetOuterWt_flt( void *AMGhybrid_vdata, hypre_float outer_wt ); +HYPRE_Int +hypre_AMGHybridSetOuterWt_dbl( void *AMGhybrid_vdata, hypre_double outer_wt ); +HYPRE_Int +hypre_AMGHybridSetOuterWt_long_dbl( void *AMGhybrid_vdata, hypre_long_double outer_wt ); + +HYPRE_Int +hypre_AMGHybridSetPCGMaxIter_flt( void *AMGhybrid_vdata, HYPRE_Int pcg_max_its ); +HYPRE_Int +hypre_AMGHybridSetPCGMaxIter_dbl( void *AMGhybrid_vdata, HYPRE_Int pcg_max_its ); +HYPRE_Int +hypre_AMGHybridSetPCGMaxIter_long_dbl( void *AMGhybrid_vdata, HYPRE_Int pcg_max_its ); + +HYPRE_Int +hypre_AMGHybridSetPMaxElmts_flt( void *AMGhybrid_vdata, HYPRE_Int P_max_elmts ); +HYPRE_Int +hypre_AMGHybridSetPMaxElmts_dbl( void *AMGhybrid_vdata, HYPRE_Int P_max_elmts ); +HYPRE_Int +hypre_AMGHybridSetPMaxElmts_long_dbl( void *AMGhybrid_vdata, HYPRE_Int P_max_elmts ); + +HYPRE_Int +hypre_AMGHybridSetPrintLevel_flt( void *AMGhybrid_vdata, HYPRE_Int print_level ); +HYPRE_Int +hypre_AMGHybridSetPrintLevel_dbl( void *AMGhybrid_vdata, HYPRE_Int print_level ); +HYPRE_Int +hypre_AMGHybridSetPrintLevel_long_dbl( void *AMGhybrid_vdata, HYPRE_Int print_level ); + +HYPRE_Int +hypre_AMGHybridSetRecomputeResidual_flt( void *AMGhybrid_vdata, HYPRE_Int recompute_residual ); +HYPRE_Int +hypre_AMGHybridSetRecomputeResidual_dbl( void *AMGhybrid_vdata, HYPRE_Int recompute_residual ); +HYPRE_Int +hypre_AMGHybridSetRecomputeResidual_long_dbl( void *AMGhybrid_vdata, HYPRE_Int recompute_residual ); + +HYPRE_Int +hypre_AMGHybridSetRecomputeResidualP_flt( void *AMGhybrid_vdata, HYPRE_Int recompute_residual_p ); +HYPRE_Int +hypre_AMGHybridSetRecomputeResidualP_dbl( void *AMGhybrid_vdata, HYPRE_Int recompute_residual_p ); +HYPRE_Int +hypre_AMGHybridSetRecomputeResidualP_long_dbl( void *AMGhybrid_vdata, HYPRE_Int recompute_residual_p ); + +HYPRE_Int +hypre_AMGHybridSetRelChange_flt( void *AMGhybrid_vdata, HYPRE_Int rel_change ); +HYPRE_Int +hypre_AMGHybridSetRelChange_dbl( void *AMGhybrid_vdata, HYPRE_Int rel_change ); +HYPRE_Int +hypre_AMGHybridSetRelChange_long_dbl( void *AMGhybrid_vdata, HYPRE_Int rel_change ); + +HYPRE_Int +hypre_AMGHybridSetRelaxOrder_flt( void *AMGhybrid_vdata, HYPRE_Int relax_order ); +HYPRE_Int +hypre_AMGHybridSetRelaxOrder_dbl( void *AMGhybrid_vdata, HYPRE_Int relax_order ); +HYPRE_Int +hypre_AMGHybridSetRelaxOrder_long_dbl( void *AMGhybrid_vdata, HYPRE_Int relax_order ); + +HYPRE_Int +hypre_AMGHybridSetRelaxType_flt( void *AMGhybrid_vdata, HYPRE_Int relax_type ); +HYPRE_Int +hypre_AMGHybridSetRelaxType_dbl( void *AMGhybrid_vdata, HYPRE_Int relax_type ); +HYPRE_Int +hypre_AMGHybridSetRelaxType_long_dbl( void *AMGhybrid_vdata, HYPRE_Int relax_type ); + +HYPRE_Int +hypre_AMGHybridSetRelaxWeight_flt( void *AMGhybrid_vdata, hypre_float *relax_weight ); +HYPRE_Int +hypre_AMGHybridSetRelaxWeight_dbl( void *AMGhybrid_vdata, hypre_double *relax_weight ); +HYPRE_Int +hypre_AMGHybridSetRelaxWeight_long_dbl( void *AMGhybrid_vdata, hypre_long_double *relax_weight ); + +HYPRE_Int +hypre_AMGHybridSetRelaxWt_flt( void *AMGhybrid_vdata, hypre_float relax_wt ); +HYPRE_Int +hypre_AMGHybridSetRelaxWt_dbl( void *AMGhybrid_vdata, hypre_double relax_wt ); +HYPRE_Int +hypre_AMGHybridSetRelaxWt_long_dbl( void *AMGhybrid_vdata, hypre_long_double relax_wt ); + +HYPRE_Int +hypre_AMGHybridSetSeqThreshold_flt( void *AMGhybrid_vdata, HYPRE_Int seq_threshold ); +HYPRE_Int +hypre_AMGHybridSetSeqThreshold_dbl( void *AMGhybrid_vdata, HYPRE_Int seq_threshold ); +HYPRE_Int +hypre_AMGHybridSetSeqThreshold_long_dbl( void *AMGhybrid_vdata, HYPRE_Int seq_threshold ); + +HYPRE_Int +hypre_AMGHybridSetSetupType_flt( void *AMGhybrid_vdata, HYPRE_Int setup_type ); +HYPRE_Int +hypre_AMGHybridSetSetupType_dbl( void *AMGhybrid_vdata, HYPRE_Int setup_type ); +HYPRE_Int +hypre_AMGHybridSetSetupType_long_dbl( void *AMGhybrid_vdata, HYPRE_Int setup_type ); + +HYPRE_Int +hypre_AMGHybridSetSolverType_flt( void *AMGhybrid_vdata, HYPRE_Int solver_type ); +HYPRE_Int +hypre_AMGHybridSetSolverType_dbl( void *AMGhybrid_vdata, HYPRE_Int solver_type ); +HYPRE_Int +hypre_AMGHybridSetSolverType_long_dbl( void *AMGhybrid_vdata, HYPRE_Int solver_type ); + +HYPRE_Int +hypre_AMGHybridSetStopCrit_flt( void *AMGhybrid_vdata, HYPRE_Int stop_crit ); +HYPRE_Int +hypre_AMGHybridSetStopCrit_dbl( void *AMGhybrid_vdata, HYPRE_Int stop_crit ); +HYPRE_Int +hypre_AMGHybridSetStopCrit_long_dbl( void *AMGhybrid_vdata, HYPRE_Int stop_crit ); + +HYPRE_Int +hypre_AMGHybridSetStrongThreshold_flt( void *AMGhybrid_vdata, hypre_float strong_threshold ); +HYPRE_Int +hypre_AMGHybridSetStrongThreshold_dbl( void *AMGhybrid_vdata, hypre_double strong_threshold ); +HYPRE_Int +hypre_AMGHybridSetStrongThreshold_long_dbl( void *AMGhybrid_vdata, hypre_long_double strong_threshold ); + +HYPRE_Int +hypre_AMGHybridSetTol_flt( void *AMGhybrid_vdata, hypre_float tol ); +HYPRE_Int +hypre_AMGHybridSetTol_dbl( void *AMGhybrid_vdata, hypre_double tol ); +HYPRE_Int +hypre_AMGHybridSetTol_long_dbl( void *AMGhybrid_vdata, hypre_long_double tol ); + +HYPRE_Int +hypre_AMGHybridSetTruncFactor_flt( void *AMGhybrid_vdata, hypre_float trunc_factor ); +HYPRE_Int +hypre_AMGHybridSetTruncFactor_dbl( void *AMGhybrid_vdata, hypre_double trunc_factor ); +HYPRE_Int +hypre_AMGHybridSetTruncFactor_long_dbl( void *AMGhybrid_vdata, hypre_long_double trunc_factor ); + +HYPRE_Int +hypre_AMGHybridSetTwoNorm_flt( void *AMGhybrid_vdata, HYPRE_Int two_norm ); +HYPRE_Int +hypre_AMGHybridSetTwoNorm_dbl( void *AMGhybrid_vdata, HYPRE_Int two_norm ); +HYPRE_Int +hypre_AMGHybridSetTwoNorm_long_dbl( void *AMGhybrid_vdata, HYPRE_Int two_norm ); + +HYPRE_Int +hypre_AMGHybridSetup_flt( void *AMGhybrid_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); +HYPRE_Int +hypre_AMGHybridSetup_dbl( void *AMGhybrid_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); +HYPRE_Int +hypre_AMGHybridSetup_long_dbl( void *AMGhybrid_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); + +HYPRE_Int +hypre_AMGHybridSolve_flt( void *AMGhybrid_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); +HYPRE_Int +hypre_AMGHybridSolve_dbl( void *AMGhybrid_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); +HYPRE_Int +hypre_AMGHybridSolve_long_dbl( void *AMGhybrid_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); + +HYPRE_Int +hypre_AMGNodalSchwarzSmoother_flt( hypre_CSRMatrix *A, HYPRE_Int num_functions, HYPRE_Int option, hypre_CSRMatrix **domain_structure_pointer ); +HYPRE_Int +hypre_AMGNodalSchwarzSmoother_dbl( hypre_CSRMatrix *A, HYPRE_Int num_functions, HYPRE_Int option, hypre_CSRMatrix **domain_structure_pointer ); +HYPRE_Int +hypre_AMGNodalSchwarzSmoother_long_dbl( hypre_CSRMatrix *A, HYPRE_Int num_functions, HYPRE_Int option, hypre_CSRMatrix **domain_structure_pointer ); + +HYPRE_Int +hypre_AMGeAgglomerate_flt( 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_dbl( 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_long_dbl( 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_AMSComputeGPi_flt( 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_dbl( 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_long_dbl( 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_AMSComputePi_flt( 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_dbl( 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_long_dbl( 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_flt( 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_dbl( 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_long_dbl( 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_AMSConstructDiscreteGradient_flt( hypre_ParCSRMatrix *A, hypre_ParVector *x_coord, HYPRE_BigInt *edge_vertex, HYPRE_Int edge_orientation, hypre_ParCSRMatrix **G_ptr ); +HYPRE_Int +hypre_AMSConstructDiscreteGradient_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *x_coord, HYPRE_BigInt *edge_vertex, HYPRE_Int edge_orientation, hypre_ParCSRMatrix **G_ptr ); +HYPRE_Int +hypre_AMSConstructDiscreteGradient_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *x_coord, HYPRE_BigInt *edge_vertex, HYPRE_Int edge_orientation, hypre_ParCSRMatrix **G_ptr ); + +void * +hypre_AMSCreate_flt( void ); +void * +hypre_AMSCreate_dbl( void ); +void * +hypre_AMSCreate_long_dbl( void ); + +HYPRE_Int +hypre_AMSDestroy_flt( void *solver ); +HYPRE_Int +hypre_AMSDestroy_dbl( void *solver ); +HYPRE_Int +hypre_AMSDestroy_long_dbl( void *solver ); + +HYPRE_Int +hypre_AMSFEIDestroy_flt( void *solver ); +HYPRE_Int +hypre_AMSFEIDestroy_dbl( void *solver ); +HYPRE_Int +hypre_AMSFEIDestroy_long_dbl( void *solver ); + +HYPRE_Int +hypre_AMSFEISetup_flt( 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_float *vert_coord, HYPRE_Int num_edges, HYPRE_BigInt *edge_vertex ); +HYPRE_Int +hypre_AMSFEISetup_dbl( 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_double *vert_coord, HYPRE_Int num_edges, HYPRE_BigInt *edge_vertex ); +HYPRE_Int +hypre_AMSFEISetup_long_dbl( 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_long_double *vert_coord, HYPRE_Int num_edges, HYPRE_BigInt *edge_vertex ); + +HYPRE_Int +hypre_AMSGetFinalRelativeResidualNorm_flt( void *solver, hypre_float *rel_resid_norm ); +HYPRE_Int +hypre_AMSGetFinalRelativeResidualNorm_dbl( void *solver, hypre_double *rel_resid_norm ); +HYPRE_Int +hypre_AMSGetFinalRelativeResidualNorm_long_dbl( void *solver, hypre_long_double *rel_resid_norm ); + +HYPRE_Int +hypre_AMSGetNumIterations_flt( void *solver, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_AMSGetNumIterations_dbl( void *solver, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_AMSGetNumIterations_long_dbl( void *solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +hypre_AMSProjectOutGradients_flt( void *solver, hypre_ParVector *x ); +HYPRE_Int +hypre_AMSProjectOutGradients_dbl( void *solver, hypre_ParVector *x ); +HYPRE_Int +hypre_AMSProjectOutGradients_long_dbl( void *solver, hypre_ParVector *x ); + +HYPRE_Int +hypre_AMSSetAlphaAMGCoarseRelaxType_flt( void *solver, HYPRE_Int B_Pi_coarse_relax_type ); +HYPRE_Int +hypre_AMSSetAlphaAMGCoarseRelaxType_dbl( void *solver, HYPRE_Int B_Pi_coarse_relax_type ); +HYPRE_Int +hypre_AMSSetAlphaAMGCoarseRelaxType_long_dbl( void *solver, HYPRE_Int B_Pi_coarse_relax_type ); + +HYPRE_Int +hypre_AMSSetAlphaAMGOptions_flt( void *solver, HYPRE_Int B_Pi_coarsen_type, HYPRE_Int B_Pi_agg_levels, HYPRE_Int B_Pi_relax_type, hypre_float B_Pi_theta, HYPRE_Int B_Pi_interp_type, HYPRE_Int B_Pi_Pmax ); +HYPRE_Int +hypre_AMSSetAlphaAMGOptions_dbl( void *solver, HYPRE_Int B_Pi_coarsen_type, HYPRE_Int B_Pi_agg_levels, HYPRE_Int B_Pi_relax_type, hypre_double B_Pi_theta, HYPRE_Int B_Pi_interp_type, HYPRE_Int B_Pi_Pmax ); +HYPRE_Int +hypre_AMSSetAlphaAMGOptions_long_dbl( void *solver, HYPRE_Int B_Pi_coarsen_type, HYPRE_Int B_Pi_agg_levels, HYPRE_Int B_Pi_relax_type, hypre_long_double B_Pi_theta, HYPRE_Int B_Pi_interp_type, HYPRE_Int B_Pi_Pmax ); + +HYPRE_Int +hypre_AMSSetAlphaPoissonMatrix_flt( void *solver, hypre_ParCSRMatrix *A_Pi ); +HYPRE_Int +hypre_AMSSetAlphaPoissonMatrix_dbl( void *solver, hypre_ParCSRMatrix *A_Pi ); +HYPRE_Int +hypre_AMSSetAlphaPoissonMatrix_long_dbl( void *solver, hypre_ParCSRMatrix *A_Pi ); + +HYPRE_Int +hypre_AMSSetBetaAMGCoarseRelaxType_flt( void *solver, HYPRE_Int B_G_coarse_relax_type ); +HYPRE_Int +hypre_AMSSetBetaAMGCoarseRelaxType_dbl( void *solver, HYPRE_Int B_G_coarse_relax_type ); +HYPRE_Int +hypre_AMSSetBetaAMGCoarseRelaxType_long_dbl( void *solver, HYPRE_Int B_G_coarse_relax_type ); + +HYPRE_Int +hypre_AMSSetBetaAMGOptions_flt( void *solver, HYPRE_Int B_G_coarsen_type, HYPRE_Int B_G_agg_levels, HYPRE_Int B_G_relax_type, hypre_float B_G_theta, HYPRE_Int B_G_interp_type, HYPRE_Int B_G_Pmax ); +HYPRE_Int +hypre_AMSSetBetaAMGOptions_dbl( void *solver, HYPRE_Int B_G_coarsen_type, HYPRE_Int B_G_agg_levels, HYPRE_Int B_G_relax_type, hypre_double B_G_theta, HYPRE_Int B_G_interp_type, HYPRE_Int B_G_Pmax ); +HYPRE_Int +hypre_AMSSetBetaAMGOptions_long_dbl( void *solver, HYPRE_Int B_G_coarsen_type, HYPRE_Int B_G_agg_levels, HYPRE_Int B_G_relax_type, hypre_long_double B_G_theta, HYPRE_Int B_G_interp_type, HYPRE_Int B_G_Pmax ); + +HYPRE_Int +hypre_AMSSetBetaPoissonMatrix_flt( void *solver, hypre_ParCSRMatrix *A_G ); +HYPRE_Int +hypre_AMSSetBetaPoissonMatrix_dbl( void *solver, hypre_ParCSRMatrix *A_G ); +HYPRE_Int +hypre_AMSSetBetaPoissonMatrix_long_dbl( void *solver, hypre_ParCSRMatrix *A_G ); + +HYPRE_Int +hypre_AMSSetChebySmoothingOptions_flt( void *solver, HYPRE_Int A_cheby_order, hypre_float A_cheby_fraction ); +HYPRE_Int +hypre_AMSSetChebySmoothingOptions_dbl( void *solver, HYPRE_Int A_cheby_order, hypre_double A_cheby_fraction ); +HYPRE_Int +hypre_AMSSetChebySmoothingOptions_long_dbl( void *solver, HYPRE_Int A_cheby_order, hypre_long_double A_cheby_fraction ); + +HYPRE_Int +hypre_AMSSetCoordinateVectors_flt( void *solver, hypre_ParVector *x, hypre_ParVector *y, hypre_ParVector *z ); +HYPRE_Int +hypre_AMSSetCoordinateVectors_dbl( void *solver, hypre_ParVector *x, hypre_ParVector *y, hypre_ParVector *z ); +HYPRE_Int +hypre_AMSSetCoordinateVectors_long_dbl( void *solver, hypre_ParVector *x, hypre_ParVector *y, hypre_ParVector *z ); + +HYPRE_Int +hypre_AMSSetCycleType_flt( void *solver, HYPRE_Int cycle_type ); +HYPRE_Int +hypre_AMSSetCycleType_dbl( void *solver, HYPRE_Int cycle_type ); +HYPRE_Int +hypre_AMSSetCycleType_long_dbl( void *solver, HYPRE_Int cycle_type ); + +HYPRE_Int +hypre_AMSSetDimension_flt( void *solver, HYPRE_Int dim ); +HYPRE_Int +hypre_AMSSetDimension_dbl( void *solver, HYPRE_Int dim ); +HYPRE_Int +hypre_AMSSetDimension_long_dbl( void *solver, HYPRE_Int dim ); + +HYPRE_Int +hypre_AMSSetDiscreteGradient_flt( void *solver, hypre_ParCSRMatrix *G ); +HYPRE_Int +hypre_AMSSetDiscreteGradient_dbl( void *solver, hypre_ParCSRMatrix *G ); +HYPRE_Int +hypre_AMSSetDiscreteGradient_long_dbl( void *solver, hypre_ParCSRMatrix *G ); + +HYPRE_Int +hypre_AMSSetEdgeConstantVectors_flt( void *solver, hypre_ParVector *Gx, hypre_ParVector *Gy, hypre_ParVector *Gz ); +HYPRE_Int +hypre_AMSSetEdgeConstantVectors_dbl( void *solver, hypre_ParVector *Gx, hypre_ParVector *Gy, hypre_ParVector *Gz ); +HYPRE_Int +hypre_AMSSetEdgeConstantVectors_long_dbl( void *solver, hypre_ParVector *Gx, hypre_ParVector *Gy, hypre_ParVector *Gz ); + +HYPRE_Int +hypre_AMSSetInteriorNodes_flt( void *solver, hypre_ParVector *interior_nodes ); +HYPRE_Int +hypre_AMSSetInteriorNodes_dbl( void *solver, hypre_ParVector *interior_nodes ); +HYPRE_Int +hypre_AMSSetInteriorNodes_long_dbl( void *solver, hypre_ParVector *interior_nodes ); + +HYPRE_Int +hypre_AMSSetInterpolations_flt( void *solver, hypre_ParCSRMatrix *Pi, hypre_ParCSRMatrix *Pix, hypre_ParCSRMatrix *Piy, hypre_ParCSRMatrix *Piz ); +HYPRE_Int +hypre_AMSSetInterpolations_dbl( void *solver, hypre_ParCSRMatrix *Pi, hypre_ParCSRMatrix *Pix, hypre_ParCSRMatrix *Piy, hypre_ParCSRMatrix *Piz ); +HYPRE_Int +hypre_AMSSetInterpolations_long_dbl( void *solver, hypre_ParCSRMatrix *Pi, hypre_ParCSRMatrix *Pix, hypre_ParCSRMatrix *Piy, hypre_ParCSRMatrix *Piz ); + +HYPRE_Int +hypre_AMSSetMaxIter_flt( void *solver, HYPRE_Int maxit ); +HYPRE_Int +hypre_AMSSetMaxIter_dbl( void *solver, HYPRE_Int maxit ); +HYPRE_Int +hypre_AMSSetMaxIter_long_dbl( void *solver, HYPRE_Int maxit ); + +HYPRE_Int +hypre_AMSSetPrintLevel_flt( void *solver, HYPRE_Int print_level ); +HYPRE_Int +hypre_AMSSetPrintLevel_dbl( void *solver, HYPRE_Int print_level ); +HYPRE_Int +hypre_AMSSetPrintLevel_long_dbl( void *solver, HYPRE_Int print_level ); + +HYPRE_Int +hypre_AMSSetProjectionFrequency_flt( void *solver, HYPRE_Int projection_frequency ); +HYPRE_Int +hypre_AMSSetProjectionFrequency_dbl( void *solver, HYPRE_Int projection_frequency ); +HYPRE_Int +hypre_AMSSetProjectionFrequency_long_dbl( void *solver, HYPRE_Int projection_frequency ); + +HYPRE_Int +hypre_AMSSetSmoothingOptions_flt( void *solver, HYPRE_Int A_relax_type, HYPRE_Int A_relax_times, hypre_float A_relax_weight, hypre_float A_omega ); +HYPRE_Int +hypre_AMSSetSmoothingOptions_dbl( void *solver, HYPRE_Int A_relax_type, HYPRE_Int A_relax_times, hypre_double A_relax_weight, hypre_double A_omega ); +HYPRE_Int +hypre_AMSSetSmoothingOptions_long_dbl( void *solver, HYPRE_Int A_relax_type, HYPRE_Int A_relax_times, hypre_long_double A_relax_weight, hypre_long_double A_omega ); + +HYPRE_Int +hypre_AMSSetTol_flt( void *solver, hypre_float tol ); +HYPRE_Int +hypre_AMSSetTol_dbl( void *solver, hypre_double tol ); +HYPRE_Int +hypre_AMSSetTol_long_dbl( void *solver, hypre_long_double tol ); + +HYPRE_Int +hypre_AMSSetup_flt( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); +HYPRE_Int +hypre_AMSSetup_dbl( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); +HYPRE_Int +hypre_AMSSetup_long_dbl( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); + +HYPRE_Int +hypre_AMSSolve_flt( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); +HYPRE_Int +hypre_AMSSolve_dbl( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); +HYPRE_Int +hypre_AMSSolve_long_dbl( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); + +HYPRE_Int +hypre_AdSchwarzCFSolve_flt( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_rhs, hypre_CSRMatrix *domain_structure, hypre_float *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_AdSchwarzCFSolve_dbl( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_rhs, hypre_CSRMatrix *domain_structure, hypre_double *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_AdSchwarzCFSolve_long_dbl( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_rhs, hypre_CSRMatrix *domain_structure, hypre_long_double *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_AdSchwarzSolve_flt( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_rhs, hypre_CSRMatrix *domain_structure, hypre_float *scale, hypre_ParVector *par_x, hypre_ParVector *par_aux, HYPRE_Int *pivots, HYPRE_Int use_nonsymm ); +HYPRE_Int +hypre_AdSchwarzSolve_dbl( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_rhs, hypre_CSRMatrix *domain_structure, hypre_double *scale, hypre_ParVector *par_x, hypre_ParVector *par_aux, HYPRE_Int *pivots, HYPRE_Int use_nonsymm ); +HYPRE_Int +hypre_AdSchwarzSolve_long_dbl( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_rhs, hypre_CSRMatrix *domain_structure, hypre_long_double *scale, hypre_ParVector *par_x, hypre_ParVector *par_aux, HYPRE_Int *pivots, HYPRE_Int use_nonsymm ); + +HYPRE_Int +hypre_AddToPattern_flt( 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_AddToPattern_dbl( 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_AddToPattern_long_dbl( 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_AmgCGCBoundaryFix_flt( hypre_ParCSRMatrix *S, HYPRE_Int *CF_marker, HYPRE_Int *CF_marker_offd ); +HYPRE_Int +hypre_AmgCGCBoundaryFix_dbl( hypre_ParCSRMatrix *S, HYPRE_Int *CF_marker, HYPRE_Int *CF_marker_offd ); +HYPRE_Int +hypre_AmgCGCBoundaryFix_long_dbl( hypre_ParCSRMatrix *S, HYPRE_Int *CF_marker, HYPRE_Int *CF_marker_offd ); + +HYPRE_Int +hypre_AmgCGCChoose_flt( hypre_CSRMatrix *G, HYPRE_Int *vertexrange, HYPRE_Int mpisize, HYPRE_Int **coarse ); +HYPRE_Int +hypre_AmgCGCChoose_dbl( hypre_CSRMatrix *G, HYPRE_Int *vertexrange, HYPRE_Int mpisize, HYPRE_Int **coarse ); +HYPRE_Int +hypre_AmgCGCChoose_long_dbl( hypre_CSRMatrix *G, HYPRE_Int *vertexrange, HYPRE_Int mpisize, HYPRE_Int **coarse ); + +HYPRE_Int +hypre_AmgCGCGraphAssemble_flt( 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_AmgCGCGraphAssemble_dbl( 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_AmgCGCGraphAssemble_long_dbl( 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_AmgCGCPrepare_flt( 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_dbl( 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_long_dbl( 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_Bisection_flt( HYPRE_Int n, hypre_float *diag, hypre_float *offd, hypre_float y, hypre_float z, hypre_float tol, HYPRE_Int k, hypre_float *ev_ptr ); +HYPRE_Int +hypre_Bisection_dbl( HYPRE_Int n, hypre_double *diag, hypre_double *offd, hypre_double y, hypre_double z, hypre_double tol, HYPRE_Int k, hypre_double *ev_ptr ); +HYPRE_Int +hypre_Bisection_long_dbl( HYPRE_Int n, hypre_long_double *diag, hypre_long_double *offd, hypre_long_double y, hypre_long_double z, hypre_long_double tol, HYPRE_Int k, hypre_long_double *ev_ptr ); + +HYPRE_Int +hypre_BlockDiagInvLapack_flt( hypre_float *diag, HYPRE_Int N, HYPRE_Int blk_size ); +HYPRE_Int +hypre_BlockDiagInvLapack_dbl( hypre_double *diag, HYPRE_Int N, HYPRE_Int blk_size ); +HYPRE_Int +hypre_BlockDiagInvLapack_long_dbl( hypre_long_double *diag, HYPRE_Int N, HYPRE_Int blk_size ); + +void * +hypre_BlockTridiagCreate_flt( void ); +void * +hypre_BlockTridiagCreate_dbl( void ); +void * +hypre_BlockTridiagCreate_long_dbl( void ); + +HYPRE_Int +hypre_BlockTridiagDestroy_flt( void *data ); +HYPRE_Int +hypre_BlockTridiagDestroy_dbl( void *data ); +HYPRE_Int +hypre_BlockTridiagDestroy_long_dbl( void *data ); + +HYPRE_Int +hypre_BlockTridiagSetAMGNumSweeps_flt( void *data, HYPRE_Int nsweeps ); +HYPRE_Int +hypre_BlockTridiagSetAMGNumSweeps_dbl( void *data, HYPRE_Int nsweeps ); +HYPRE_Int +hypre_BlockTridiagSetAMGNumSweeps_long_dbl( void *data, HYPRE_Int nsweeps ); + +HYPRE_Int +hypre_BlockTridiagSetAMGRelaxType_flt( void *data, HYPRE_Int relax_type ); +HYPRE_Int +hypre_BlockTridiagSetAMGRelaxType_dbl( void *data, HYPRE_Int relax_type ); +HYPRE_Int +hypre_BlockTridiagSetAMGRelaxType_long_dbl( void *data, HYPRE_Int relax_type ); + +HYPRE_Int +hypre_BlockTridiagSetAMGStrengthThreshold_flt( void *data, hypre_float thresh ); +HYPRE_Int +hypre_BlockTridiagSetAMGStrengthThreshold_dbl( void *data, hypre_double thresh ); +HYPRE_Int +hypre_BlockTridiagSetAMGStrengthThreshold_long_dbl( void *data, hypre_long_double thresh ); + +HYPRE_Int +hypre_BlockTridiagSetIndexSet_flt( void *data, HYPRE_Int n, HYPRE_Int *inds ); +HYPRE_Int +hypre_BlockTridiagSetIndexSet_dbl( void *data, HYPRE_Int n, HYPRE_Int *inds ); +HYPRE_Int +hypre_BlockTridiagSetIndexSet_long_dbl( void *data, HYPRE_Int n, HYPRE_Int *inds ); + +HYPRE_Int +hypre_BlockTridiagSetPrintLevel_flt( void *data, HYPRE_Int print_level ); +HYPRE_Int +hypre_BlockTridiagSetPrintLevel_dbl( void *data, HYPRE_Int print_level ); +HYPRE_Int +hypre_BlockTridiagSetPrintLevel_long_dbl( void *data, HYPRE_Int print_level ); + +HYPRE_Int +hypre_BlockTridiagSetup_flt( void *data, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); +HYPRE_Int +hypre_BlockTridiagSetup_dbl( void *data, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); +HYPRE_Int +hypre_BlockTridiagSetup_long_dbl( void *data, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); + +HYPRE_Int +hypre_BlockTridiagSolve_flt( void *data, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); +HYPRE_Int +hypre_BlockTridiagSolve_dbl( void *data, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); +HYPRE_Int +hypre_BlockTridiagSolve_long_dbl( void *data, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); + +HYPRE_Int +hypre_BoomerAMGAdditiveCycle_flt( void *amg_vdata ); +HYPRE_Int +hypre_BoomerAMGAdditiveCycle_dbl( void *amg_vdata ); +HYPRE_Int +hypre_BoomerAMGAdditiveCycle_long_dbl( void *amg_vdata ); + +HYPRE_Int +hypre_BoomerAMGBlockSolve_flt( void *B, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); +HYPRE_Int +hypre_BoomerAMGBlockSolve_dbl( void *B, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); +HYPRE_Int +hypre_BoomerAMGBlockSolve_long_dbl( void *B, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); + +HYPRE_Int +hypre_BoomerAMGBuildCoarseOperator_flt( hypre_ParCSRMatrix *RT, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, hypre_ParCSRMatrix **RAP_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildCoarseOperator_dbl( hypre_ParCSRMatrix *RT, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, hypre_ParCSRMatrix **RAP_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildCoarseOperator_long_dbl( hypre_ParCSRMatrix *RT, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, hypre_ParCSRMatrix **RAP_ptr ); + +HYPRE_Int +hypre_BoomerAMGBuildCoarseOperatorKT_flt( hypre_ParCSRMatrix *RT, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, HYPRE_Int keepTranspose, hypre_ParCSRMatrix **RAP_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildCoarseOperatorKT_dbl( hypre_ParCSRMatrix *RT, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, HYPRE_Int keepTranspose, hypre_ParCSRMatrix **RAP_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildCoarseOperatorKT_long_dbl( hypre_ParCSRMatrix *RT, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, HYPRE_Int keepTranspose, hypre_ParCSRMatrix **RAP_ptr ); + +HYPRE_Int +hypre_BoomerAMGBuildDirInterp_flt( 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_float trunc_factor, HYPRE_Int max_elmts, HYPRE_Int interp_type, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildDirInterp_dbl( 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_double trunc_factor, HYPRE_Int max_elmts, HYPRE_Int interp_type, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildDirInterp_long_dbl( 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_long_double trunc_factor, HYPRE_Int max_elmts, HYPRE_Int interp_type, hypre_ParCSRMatrix **P_ptr ); + +HYPRE_Int +hypre_BoomerAMGBuildExtInterp_flt( 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_float trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildExtInterp_dbl( 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_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildExtInterp_long_dbl( 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_long_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); + +HYPRE_Int +hypre_BoomerAMGBuildExtPICCInterp_flt( 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_float trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildExtPICCInterp_dbl( 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_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildExtPICCInterp_long_dbl( 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_long_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); + +HYPRE_Int +hypre_BoomerAMGBuildExtPIInterp_flt( 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_float trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildExtPIInterp_dbl( 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_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildExtPIInterp_long_dbl( 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_long_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); + +HYPRE_Int +hypre_BoomerAMGBuildExtPIInterpHost_flt( 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_float trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildExtPIInterpHost_dbl( 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_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildExtPIInterpHost_long_dbl( 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_long_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); + +HYPRE_Int +hypre_BoomerAMGBuildFF1Interp_flt( 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_float trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildFF1Interp_dbl( 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_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildFF1Interp_long_dbl( 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_long_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); + +HYPRE_Int +hypre_BoomerAMGBuildFFInterp_flt( 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_float trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildFFInterp_dbl( 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_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildFFInterp_long_dbl( 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_long_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); + +HYPRE_Int +hypre_BoomerAMGBuildInterp_flt( 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_float trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildInterp_dbl( 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_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildInterp_long_dbl( 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_long_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); + +HYPRE_Int +hypre_BoomerAMGBuildInterpGSMG_flt( 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_float trunc_factor, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildInterpGSMG_dbl( 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_double trunc_factor, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildInterpGSMG_long_dbl( 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_long_double trunc_factor, hypre_ParCSRMatrix **P_ptr ); + +HYPRE_Int +hypre_BoomerAMGBuildInterpHE_flt( 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_float trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildInterpHE_dbl( 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_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildInterpHE_long_dbl( 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_long_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); + +HYPRE_Int +hypre_BoomerAMGBuildInterpLS_flt( 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_float trunc_factor, HYPRE_Int num_smooth, hypre_float *SmoothVecs, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildInterpLS_dbl( 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_double trunc_factor, HYPRE_Int num_smooth, hypre_double *SmoothVecs, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildInterpLS_long_dbl( 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_long_double trunc_factor, HYPRE_Int num_smooth, hypre_long_double *SmoothVecs, hypre_ParCSRMatrix **P_ptr ); + +HYPRE_Int +hypre_BoomerAMGBuildInterpModUnk_flt( 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_float trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildInterpModUnk_dbl( 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_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildInterpModUnk_long_dbl( 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_long_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); + +HYPRE_Int +hypre_BoomerAMGBuildInterpOnePnt_flt( 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_dbl( 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_long_dbl( 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_BoomerAMGBuildInterpOnePntHost_flt( 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_BoomerAMGBuildInterpOnePntHost_dbl( 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_BoomerAMGBuildInterpOnePntHost_long_dbl( 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_BoomerAMGBuildModExtInterp_flt( 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_float trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildModExtInterp_dbl( 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_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildModExtInterp_long_dbl( 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_long_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); + +HYPRE_Int +hypre_BoomerAMGBuildModExtPEInterp_flt( 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_float trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildModExtPEInterp_dbl( 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_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildModExtPEInterp_long_dbl( 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_long_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); + +HYPRE_Int +hypre_BoomerAMGBuildModExtPIInterp_flt( 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_float trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildModExtPIInterp_dbl( 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_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildModExtPIInterp_long_dbl( 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_long_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); + +HYPRE_Int +hypre_BoomerAMGBuildModMultipass_flt( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, hypre_float 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_BoomerAMGBuildModMultipass_dbl( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, hypre_double 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_BoomerAMGBuildModMultipass_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, hypre_long_double 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_flt( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, hypre_float 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_dbl( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, hypre_double 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_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, hypre_long_double 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_BoomerAMGBuildModPartialExtInterp_flt( 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_float trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildModPartialExtInterp_dbl( 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_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildModPartialExtInterp_long_dbl( 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_long_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); + +HYPRE_Int +hypre_BoomerAMGBuildModPartialExtInterpHost_flt( 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_float trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildModPartialExtInterpHost_dbl( 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_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildModPartialExtInterpHost_long_dbl( 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_long_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); + +HYPRE_Int +hypre_BoomerAMGBuildModPartialExtPEInterp_flt( 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_float trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildModPartialExtPEInterp_dbl( 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_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildModPartialExtPEInterp_long_dbl( 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_long_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); + +HYPRE_Int +hypre_BoomerAMGBuildModPartialExtPEInterpHost_flt( 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_float trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildModPartialExtPEInterpHost_dbl( 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_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildModPartialExtPEInterpHost_long_dbl( 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_long_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); + +HYPRE_Int +hypre_BoomerAMGBuildMultipass_flt( 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_float trunc_factor, HYPRE_Int P_max_elmts, HYPRE_Int weight_option, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildMultipass_dbl( 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_double trunc_factor, HYPRE_Int P_max_elmts, HYPRE_Int weight_option, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildMultipass_long_dbl( 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_long_double trunc_factor, HYPRE_Int P_max_elmts, HYPRE_Int weight_option, hypre_ParCSRMatrix **P_ptr ); + +HYPRE_Int +hypre_BoomerAMGBuildMultipassHost_flt( 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_float trunc_factor, HYPRE_Int P_max_elmts, HYPRE_Int weight_option, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildMultipassHost_dbl( 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_double trunc_factor, HYPRE_Int P_max_elmts, HYPRE_Int weight_option, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildMultipassHost_long_dbl( 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_long_double trunc_factor, HYPRE_Int P_max_elmts, HYPRE_Int weight_option, hypre_ParCSRMatrix **P_ptr ); + +HYPRE_Int +hypre_BoomerAMGBuildNonGalerkinCoarseOperator_flt( hypre_ParCSRMatrix **RAP_ptr, hypre_ParCSRMatrix *AP, hypre_float strong_threshold, hypre_float max_row_sum, HYPRE_Int num_functions, HYPRE_Int * dof_func_value, HYPRE_Int * CF_marker, hypre_float droptol, HYPRE_Int sym_collapse, hypre_float lump_percent, HYPRE_Int collapse_beta ); +HYPRE_Int +hypre_BoomerAMGBuildNonGalerkinCoarseOperator_dbl( hypre_ParCSRMatrix **RAP_ptr, hypre_ParCSRMatrix *AP, hypre_double strong_threshold, hypre_double max_row_sum, HYPRE_Int num_functions, HYPRE_Int * dof_func_value, HYPRE_Int * CF_marker, hypre_double droptol, HYPRE_Int sym_collapse, hypre_double lump_percent, HYPRE_Int collapse_beta ); +HYPRE_Int +hypre_BoomerAMGBuildNonGalerkinCoarseOperator_long_dbl( hypre_ParCSRMatrix **RAP_ptr, hypre_ParCSRMatrix *AP, hypre_long_double strong_threshold, hypre_long_double max_row_sum, HYPRE_Int num_functions, HYPRE_Int * dof_func_value, HYPRE_Int * CF_marker, hypre_long_double droptol, HYPRE_Int sym_collapse, hypre_long_double lump_percent, HYPRE_Int collapse_beta ); + +HYPRE_Int +hypre_BoomerAMGBuildPartialExtInterp_flt( 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_float trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildPartialExtInterp_dbl( 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_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildPartialExtInterp_long_dbl( 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_long_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); + +HYPRE_Int +hypre_BoomerAMGBuildPartialExtPIInterp_flt( 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_float trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildPartialExtPIInterp_dbl( 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_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildPartialExtPIInterp_long_dbl( 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_long_double trunc_factor, HYPRE_Int max_elmts, hypre_ParCSRMatrix **P_ptr ); + +HYPRE_Int +hypre_BoomerAMGBuildPartialStdInterp_flt( 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_float trunc_factor, HYPRE_Int max_elmts, HYPRE_Int sep_weight, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildPartialStdInterp_dbl( 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_double trunc_factor, HYPRE_Int max_elmts, HYPRE_Int sep_weight, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildPartialStdInterp_long_dbl( 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_long_double trunc_factor, HYPRE_Int max_elmts, HYPRE_Int sep_weight, hypre_ParCSRMatrix **P_ptr ); + +HYPRE_Int +hypre_BoomerAMGBuildRestrAIR_flt( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_float filter_thresholdR, HYPRE_Int debug_flag, hypre_ParCSRMatrix **R_ptr, HYPRE_Int is_triangular, HYPRE_Int gmres_switch ); +HYPRE_Int +hypre_BoomerAMGBuildRestrAIR_dbl( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_double filter_thresholdR, HYPRE_Int debug_flag, hypre_ParCSRMatrix **R_ptr, HYPRE_Int is_triangular, HYPRE_Int gmres_switch ); +HYPRE_Int +hypre_BoomerAMGBuildRestrAIR_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_long_double filter_thresholdR, HYPRE_Int debug_flag, hypre_ParCSRMatrix **R_ptr, HYPRE_Int is_triangular, HYPRE_Int gmres_switch ); + +HYPRE_Int +hypre_BoomerAMGBuildRestrDist2AIR_flt( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_float 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_BoomerAMGBuildRestrDist2AIR_dbl( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_double 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_BoomerAMGBuildRestrDist2AIR_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, hypre_ParCSRMatrix *S, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_long_double 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_flt( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int NeumannDeg, hypre_float strong_thresholdR, hypre_float filter_thresholdR, HYPRE_Int debug_flag, hypre_ParCSRMatrix **R_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildRestrNeumannAIR_dbl( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int NeumannDeg, hypre_double strong_thresholdR, hypre_double filter_thresholdR, HYPRE_Int debug_flag, hypre_ParCSRMatrix **R_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildRestrNeumannAIR_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, HYPRE_BigInt *num_cpts_global, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int NeumannDeg, hypre_long_double strong_thresholdR, hypre_long_double filter_thresholdR, HYPRE_Int debug_flag, hypre_ParCSRMatrix **R_ptr ); + +HYPRE_Int +hypre_BoomerAMGBuildStdInterp_flt( 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_float trunc_factor, HYPRE_Int max_elmts, HYPRE_Int sep_weight, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildStdInterp_dbl( 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_double trunc_factor, HYPRE_Int max_elmts, HYPRE_Int sep_weight, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_BoomerAMGBuildStdInterp_long_dbl( 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_long_double trunc_factor, HYPRE_Int max_elmts, HYPRE_Int sep_weight, hypre_ParCSRMatrix **P_ptr ); + +HYPRE_Int +hypre_BoomerAMGCGRelaxWt_flt( void *amg_vdata, HYPRE_Int level, HYPRE_Int num_cg_sweeps, hypre_float *rlx_wt_ptr ); +HYPRE_Int +hypre_BoomerAMGCGRelaxWt_dbl( void *amg_vdata, HYPRE_Int level, HYPRE_Int num_cg_sweeps, hypre_double *rlx_wt_ptr ); +HYPRE_Int +hypre_BoomerAMGCGRelaxWt_long_dbl( void *amg_vdata, HYPRE_Int level, HYPRE_Int num_cg_sweeps, hypre_long_double *rlx_wt_ptr ); + +HYPRE_Int +hypre_BoomerAMGCoarseParms_flt( 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_BoomerAMGCoarseParms_dbl( 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_BoomerAMGCoarseParms_long_dbl( 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_flt( 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_dbl( 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_long_dbl( 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_BoomerAMGCoarsen_flt( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, HYPRE_Int CF_init, HYPRE_Int debug_flag, hypre_IntArray **CF_marker_ptr ); +HYPRE_Int +hypre_BoomerAMGCoarsen_dbl( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, HYPRE_Int CF_init, HYPRE_Int debug_flag, hypre_IntArray **CF_marker_ptr ); +HYPRE_Int +hypre_BoomerAMGCoarsen_long_dbl( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, HYPRE_Int CF_init, HYPRE_Int debug_flag, hypre_IntArray **CF_marker_ptr ); + +HYPRE_Int +hypre_BoomerAMGCoarsenCGC_flt( hypre_ParCSRMatrix *S, HYPRE_Int numberofgrids, HYPRE_Int coarsen_type, HYPRE_Int *CF_marker ); +HYPRE_Int +hypre_BoomerAMGCoarsenCGC_dbl( hypre_ParCSRMatrix *S, HYPRE_Int numberofgrids, HYPRE_Int coarsen_type, HYPRE_Int *CF_marker ); +HYPRE_Int +hypre_BoomerAMGCoarsenCGC_long_dbl( hypre_ParCSRMatrix *S, HYPRE_Int numberofgrids, HYPRE_Int coarsen_type, HYPRE_Int *CF_marker ); + +HYPRE_Int +hypre_BoomerAMGCoarsenCGCb_flt( 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_BoomerAMGCoarsenCGCb_dbl( 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_BoomerAMGCoarsenCGCb_long_dbl( 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_BoomerAMGCoarsenCR_flt( 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_float relax_weight, hypre_float omega, hypre_float theta, HYPRE_Solver smoother, hypre_ParCSRMatrix *AN, HYPRE_Int useCG, hypre_ParCSRMatrix *S ); +HYPRE_Int +hypre_BoomerAMGCoarsenCR_dbl( 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_double relax_weight, hypre_double omega, hypre_double theta, HYPRE_Solver smoother, hypre_ParCSRMatrix *AN, HYPRE_Int useCG, hypre_ParCSRMatrix *S ); +HYPRE_Int +hypre_BoomerAMGCoarsenCR_long_dbl( 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_long_double relax_weight, hypre_long_double omega, hypre_long_double theta, HYPRE_Solver smoother, hypre_ParCSRMatrix *AN, HYPRE_Int useCG, hypre_ParCSRMatrix *S ); + +HYPRE_Int +hypre_BoomerAMGCoarsenCR1_flt( 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_BoomerAMGCoarsenCR1_dbl( 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_BoomerAMGCoarsenCR1_long_dbl( 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_BoomerAMGCoarsenFalgout_flt( 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_BoomerAMGCoarsenFalgout_dbl( 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_BoomerAMGCoarsenFalgout_long_dbl( 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_flt( 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_dbl( 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_long_dbl( 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_BoomerAMGCoarsenInterpVectors_flt( 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_BoomerAMGCoarsenInterpVectors_dbl( 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_BoomerAMGCoarsenInterpVectors_long_dbl( 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_BoomerAMGCoarsenPMIS_flt( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, HYPRE_Int CF_init, HYPRE_Int debug_flag, hypre_IntArray **CF_marker_ptr ); +HYPRE_Int +hypre_BoomerAMGCoarsenPMIS_dbl( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, HYPRE_Int CF_init, HYPRE_Int debug_flag, hypre_IntArray **CF_marker_ptr ); +HYPRE_Int +hypre_BoomerAMGCoarsenPMIS_long_dbl( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, HYPRE_Int CF_init, HYPRE_Int debug_flag, hypre_IntArray **CF_marker_ptr ); + +HYPRE_Int +hypre_BoomerAMGCoarsenPMISHost_flt( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, HYPRE_Int CF_init, HYPRE_Int debug_flag, hypre_IntArray **CF_marker_ptr ); +HYPRE_Int +hypre_BoomerAMGCoarsenPMISHost_dbl( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, HYPRE_Int CF_init, HYPRE_Int debug_flag, hypre_IntArray **CF_marker_ptr ); +HYPRE_Int +hypre_BoomerAMGCoarsenPMISHost_long_dbl( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, HYPRE_Int CF_init, HYPRE_Int debug_flag, hypre_IntArray **CF_marker_ptr ); + +HYPRE_Int +hypre_BoomerAMGCoarsenRuge_flt( 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_BoomerAMGCoarsenRuge_dbl( 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_BoomerAMGCoarsenRuge_long_dbl( 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_BoomerAMGCorrectCFMarker_flt( hypre_IntArray *CF_marker, hypre_IntArray *new_CF_marker ); +HYPRE_Int +hypre_BoomerAMGCorrectCFMarker_dbl( hypre_IntArray *CF_marker, hypre_IntArray *new_CF_marker ); +HYPRE_Int +hypre_BoomerAMGCorrectCFMarker_long_dbl( hypre_IntArray *CF_marker, hypre_IntArray *new_CF_marker ); + +HYPRE_Int +hypre_BoomerAMGCorrectCFMarker2_flt( hypre_IntArray *CF_marker, hypre_IntArray *new_CF_marker ); +HYPRE_Int +hypre_BoomerAMGCorrectCFMarker2_dbl( hypre_IntArray *CF_marker, hypre_IntArray *new_CF_marker ); +HYPRE_Int +hypre_BoomerAMGCorrectCFMarker2_long_dbl( hypre_IntArray *CF_marker, hypre_IntArray *new_CF_marker ); + +HYPRE_Int +hypre_BoomerAMGCorrectCFMarker2Host_flt( hypre_IntArray *CF_marker, hypre_IntArray *new_CF_marker ); +HYPRE_Int +hypre_BoomerAMGCorrectCFMarker2Host_dbl( hypre_IntArray *CF_marker, hypre_IntArray *new_CF_marker ); +HYPRE_Int +hypre_BoomerAMGCorrectCFMarker2Host_long_dbl( hypre_IntArray *CF_marker, hypre_IntArray *new_CF_marker ); + +HYPRE_Int +hypre_BoomerAMGCorrectCFMarkerHost_flt( hypre_IntArray *CF_marker, hypre_IntArray *new_CF_marker ); +HYPRE_Int +hypre_BoomerAMGCorrectCFMarkerHost_dbl( hypre_IntArray *CF_marker, hypre_IntArray *new_CF_marker ); +HYPRE_Int +hypre_BoomerAMGCorrectCFMarkerHost_long_dbl( hypre_IntArray *CF_marker, hypre_IntArray *new_CF_marker ); + +void * +hypre_BoomerAMGCreate_flt( void ); +void * +hypre_BoomerAMGCreate_dbl( void ); +void * +hypre_BoomerAMGCreate_long_dbl( void ); + +HYPRE_Int +hypre_BoomerAMGCreate2ndS_flt( hypre_ParCSRMatrix *S, HYPRE_Int *CF_marker, HYPRE_Int num_paths, HYPRE_BigInt *coarse_row_starts, hypre_ParCSRMatrix **C_ptr ); +HYPRE_Int +hypre_BoomerAMGCreate2ndS_dbl( hypre_ParCSRMatrix *S, HYPRE_Int *CF_marker, HYPRE_Int num_paths, HYPRE_BigInt *coarse_row_starts, hypre_ParCSRMatrix **C_ptr ); +HYPRE_Int +hypre_BoomerAMGCreate2ndS_long_dbl( hypre_ParCSRMatrix *S, HYPRE_Int *CF_marker, HYPRE_Int num_paths, HYPRE_BigInt *coarse_row_starts, hypre_ParCSRMatrix **C_ptr ); + +HYPRE_Int +hypre_BoomerAMGCreateNodalA_flt( 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_BoomerAMGCreateNodalA_dbl( 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_BoomerAMGCreateNodalA_long_dbl( 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_BoomerAMGCreateS_flt( hypre_ParCSRMatrix *A, hypre_float strength_threshold, hypre_float max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr ); +HYPRE_Int +hypre_BoomerAMGCreateS_dbl( hypre_ParCSRMatrix *A, hypre_double strength_threshold, hypre_double max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr ); +HYPRE_Int +hypre_BoomerAMGCreateS_long_dbl( hypre_ParCSRMatrix *A, hypre_long_double strength_threshold, hypre_long_double max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr ); + +HYPRE_Int +hypre_BoomerAMGCreateSCommPkg_flt( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *S, HYPRE_Int **col_offd_S_to_A_ptr ); +HYPRE_Int +hypre_BoomerAMGCreateSCommPkg_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *S, HYPRE_Int **col_offd_S_to_A_ptr ); +HYPRE_Int +hypre_BoomerAMGCreateSCommPkg_long_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *S, HYPRE_Int **col_offd_S_to_A_ptr ); + +HYPRE_Int +hypre_BoomerAMGCreateSFromCFMarker_flt( hypre_ParCSRMatrix *A, hypre_float strength_threshold, hypre_float 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_BoomerAMGCreateSFromCFMarker_dbl( hypre_ParCSRMatrix *A, hypre_double strength_threshold, hypre_double 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_BoomerAMGCreateSFromCFMarker_long_dbl( hypre_ParCSRMatrix *A, hypre_long_double strength_threshold, hypre_long_double 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_BoomerAMGCreateSHost_flt( hypre_ParCSRMatrix *A, hypre_float strength_threshold, hypre_float max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr ); +HYPRE_Int +hypre_BoomerAMGCreateSHost_dbl( hypre_ParCSRMatrix *A, hypre_double strength_threshold, hypre_double max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr ); +HYPRE_Int +hypre_BoomerAMGCreateSHost_long_dbl( hypre_ParCSRMatrix *A, hypre_long_double strength_threshold, hypre_long_double max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr ); + +HYPRE_Int +hypre_BoomerAMGCreateSabs_flt( hypre_ParCSRMatrix *A, hypre_float strength_threshold, hypre_float max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr ); +HYPRE_Int +hypre_BoomerAMGCreateSabs_dbl( hypre_ParCSRMatrix *A, hypre_double strength_threshold, hypre_double max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr ); +HYPRE_Int +hypre_BoomerAMGCreateSabs_long_dbl( hypre_ParCSRMatrix *A, hypre_long_double strength_threshold, hypre_long_double max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr ); + +HYPRE_Int +hypre_BoomerAMGCreateSabsHost_flt( hypre_ParCSRMatrix *A, hypre_float strength_threshold, hypre_float max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr ); +HYPRE_Int +hypre_BoomerAMGCreateSabsHost_dbl( hypre_ParCSRMatrix *A, hypre_double strength_threshold, hypre_double max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr ); +HYPRE_Int +hypre_BoomerAMGCreateSabsHost_long_dbl( hypre_ParCSRMatrix *A, hypre_long_double strength_threshold, hypre_long_double max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr ); + +HYPRE_Int +hypre_BoomerAMGCreateScalarCF_flt( 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_BoomerAMGCreateScalarCF_dbl( 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_BoomerAMGCreateScalarCF_long_dbl( 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_BoomerAMGCreateScalarCFS_flt( 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_BoomerAMGCreateScalarCFS_dbl( 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_BoomerAMGCreateScalarCFS_long_dbl( 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_BoomerAMGCreateSmoothDirs_flt( void *data, hypre_ParCSRMatrix *A, hypre_float *SmoothVecs, hypre_float thresh, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr ); +HYPRE_Int +hypre_BoomerAMGCreateSmoothDirs_dbl( void *data, hypre_ParCSRMatrix *A, hypre_double *SmoothVecs, hypre_double thresh, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr ); +HYPRE_Int +hypre_BoomerAMGCreateSmoothDirs_long_dbl( void *data, hypre_ParCSRMatrix *A, hypre_long_double *SmoothVecs, hypre_long_double thresh, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr ); + +HYPRE_Int +hypre_BoomerAMGCreateSmoothVecs_flt( void *data, hypre_ParCSRMatrix *A, HYPRE_Int num_sweeps, HYPRE_Int level, hypre_float **SmoothVecs_p ); +HYPRE_Int +hypre_BoomerAMGCreateSmoothVecs_dbl( void *data, hypre_ParCSRMatrix *A, HYPRE_Int num_sweeps, HYPRE_Int level, hypre_double **SmoothVecs_p ); +HYPRE_Int +hypre_BoomerAMGCreateSmoothVecs_long_dbl( void *data, hypre_ParCSRMatrix *A, HYPRE_Int num_sweeps, HYPRE_Int level, hypre_long_double **SmoothVecs_p ); + +HYPRE_Int +hypre_BoomerAMGCycle_flt( void *amg_vdata, hypre_ParVector **F_array, hypre_ParVector **U_array ); +HYPRE_Int +hypre_BoomerAMGCycle_dbl( void *amg_vdata, hypre_ParVector **F_array, hypre_ParVector **U_array ); +HYPRE_Int +hypre_BoomerAMGCycle_long_dbl( void *amg_vdata, hypre_ParVector **F_array, hypre_ParVector **U_array ); + +HYPRE_Int +hypre_BoomerAMGCycleT_flt( void *amg_vdata, hypre_ParVector **F_array, hypre_ParVector **U_array ); +HYPRE_Int +hypre_BoomerAMGCycleT_dbl( void *amg_vdata, hypre_ParVector **F_array, hypre_ParVector **U_array ); +HYPRE_Int +hypre_BoomerAMGCycleT_long_dbl( void *amg_vdata, hypre_ParVector **F_array, hypre_ParVector **U_array ); + +void * +hypre_BoomerAMGDDCreate_flt( void ); +void * +hypre_BoomerAMGDDCreate_dbl( void ); +void * +hypre_BoomerAMGDDCreate_long_dbl( void ); + +HYPRE_Int +hypre_BoomerAMGDDDestroy_flt( void *data ); +HYPRE_Int +hypre_BoomerAMGDDDestroy_dbl( void *data ); +HYPRE_Int +hypre_BoomerAMGDDDestroy_long_dbl( void *data ); + +HYPRE_Int +hypre_BoomerAMGDDGetAMG_flt( void *data, void **amg_solver ); +HYPRE_Int +hypre_BoomerAMGDDGetAMG_dbl( void *data, void **amg_solver ); +HYPRE_Int +hypre_BoomerAMGDDGetAMG_long_dbl( void *data, void **amg_solver ); + +HYPRE_Int +hypre_BoomerAMGDDGetFACCycleType_flt( void *data, HYPRE_Int *fac_cycle_type ); +HYPRE_Int +hypre_BoomerAMGDDGetFACCycleType_dbl( void *data, HYPRE_Int *fac_cycle_type ); +HYPRE_Int +hypre_BoomerAMGDDGetFACCycleType_long_dbl( void *data, HYPRE_Int *fac_cycle_type ); + +HYPRE_Int +hypre_BoomerAMGDDGetFACNumCycles_flt( void *data, HYPRE_Int *fac_num_cycles ); +HYPRE_Int +hypre_BoomerAMGDDGetFACNumCycles_dbl( void *data, HYPRE_Int *fac_num_cycles ); +HYPRE_Int +hypre_BoomerAMGDDGetFACNumCycles_long_dbl( void *data, HYPRE_Int *fac_num_cycles ); + +HYPRE_Int +hypre_BoomerAMGDDGetFACNumRelax_flt( void *data, HYPRE_Int *fac_num_relax ); +HYPRE_Int +hypre_BoomerAMGDDGetFACNumRelax_dbl( void *data, HYPRE_Int *fac_num_relax ); +HYPRE_Int +hypre_BoomerAMGDDGetFACNumRelax_long_dbl( void *data, HYPRE_Int *fac_num_relax ); + +HYPRE_Int +hypre_BoomerAMGDDGetFACRelaxType_flt( void *data, HYPRE_Int *fac_relax_type ); +HYPRE_Int +hypre_BoomerAMGDDGetFACRelaxType_dbl( void *data, HYPRE_Int *fac_relax_type ); +HYPRE_Int +hypre_BoomerAMGDDGetFACRelaxType_long_dbl( void *data, HYPRE_Int *fac_relax_type ); + +HYPRE_Int +hypre_BoomerAMGDDGetFACRelaxWeight_flt( void *data, hypre_float *fac_relax_weight ); +HYPRE_Int +hypre_BoomerAMGDDGetFACRelaxWeight_dbl( void *data, hypre_double *fac_relax_weight ); +HYPRE_Int +hypre_BoomerAMGDDGetFACRelaxWeight_long_dbl( void *data, hypre_long_double *fac_relax_weight ); + +HYPRE_Int +hypre_BoomerAMGDDGetNumGhostLayers_flt( void *data, HYPRE_Int *num_ghost_layers ); +HYPRE_Int +hypre_BoomerAMGDDGetNumGhostLayers_dbl( void *data, HYPRE_Int *num_ghost_layers ); +HYPRE_Int +hypre_BoomerAMGDDGetNumGhostLayers_long_dbl( void *data, HYPRE_Int *num_ghost_layers ); + +HYPRE_Int +hypre_BoomerAMGDDGetPadding_flt( void *data, HYPRE_Int *padding ); +HYPRE_Int +hypre_BoomerAMGDDGetPadding_dbl( void *data, HYPRE_Int *padding ); +HYPRE_Int +hypre_BoomerAMGDDGetPadding_long_dbl( void *data, HYPRE_Int *padding ); + +HYPRE_Int +hypre_BoomerAMGDDGetStartLevel_flt( void *data, HYPRE_Int *start_level ); +HYPRE_Int +hypre_BoomerAMGDDGetStartLevel_dbl( void *data, HYPRE_Int *start_level ); +HYPRE_Int +hypre_BoomerAMGDDGetStartLevel_long_dbl( void *data, HYPRE_Int *start_level ); + +HYPRE_Int +hypre_BoomerAMGDDSetFACCycleType_flt( void *data, HYPRE_Int fac_cycle_type ); +HYPRE_Int +hypre_BoomerAMGDDSetFACCycleType_dbl( void *data, HYPRE_Int fac_cycle_type ); +HYPRE_Int +hypre_BoomerAMGDDSetFACCycleType_long_dbl( void *data, HYPRE_Int fac_cycle_type ); + +HYPRE_Int +hypre_BoomerAMGDDSetFACNumCycles_flt( void *data, HYPRE_Int fac_num_cycles ); +HYPRE_Int +hypre_BoomerAMGDDSetFACNumCycles_dbl( void *data, HYPRE_Int fac_num_cycles ); +HYPRE_Int +hypre_BoomerAMGDDSetFACNumCycles_long_dbl( void *data, HYPRE_Int fac_num_cycles ); + +HYPRE_Int +hypre_BoomerAMGDDSetFACNumRelax_flt( void *data, HYPRE_Int fac_num_relax ); +HYPRE_Int +hypre_BoomerAMGDDSetFACNumRelax_dbl( void *data, HYPRE_Int fac_num_relax ); +HYPRE_Int +hypre_BoomerAMGDDSetFACNumRelax_long_dbl( void *data, HYPRE_Int fac_num_relax ); + +HYPRE_Int +hypre_BoomerAMGDDSetFACRelaxType_flt( void *data, HYPRE_Int fac_relax_type ); +HYPRE_Int +hypre_BoomerAMGDDSetFACRelaxType_dbl( void *data, HYPRE_Int fac_relax_type ); +HYPRE_Int +hypre_BoomerAMGDDSetFACRelaxType_long_dbl( void *data, HYPRE_Int fac_relax_type ); + +HYPRE_Int +hypre_BoomerAMGDDSetFACRelaxWeight_flt( void *data, hypre_float fac_relax_weight ); +HYPRE_Int +hypre_BoomerAMGDDSetFACRelaxWeight_dbl( void *data, hypre_double fac_relax_weight ); +HYPRE_Int +hypre_BoomerAMGDDSetFACRelaxWeight_long_dbl( void *data, hypre_long_double fac_relax_weight ); + +HYPRE_Int +hypre_BoomerAMGDDSetNumGhostLayers_flt( void *data, HYPRE_Int num_ghost_layers ); +HYPRE_Int +hypre_BoomerAMGDDSetNumGhostLayers_dbl( void *data, HYPRE_Int num_ghost_layers ); +HYPRE_Int +hypre_BoomerAMGDDSetNumGhostLayers_long_dbl( void *data, HYPRE_Int num_ghost_layers ); + +HYPRE_Int +hypre_BoomerAMGDDSetPadding_flt( void *data, HYPRE_Int padding ); +HYPRE_Int +hypre_BoomerAMGDDSetPadding_dbl( void *data, HYPRE_Int padding ); +HYPRE_Int +hypre_BoomerAMGDDSetPadding_long_dbl( void *data, HYPRE_Int padding ); + +HYPRE_Int +hypre_BoomerAMGDDSetStartLevel_flt( void *data, HYPRE_Int start_level ); +HYPRE_Int +hypre_BoomerAMGDDSetStartLevel_dbl( void *data, HYPRE_Int start_level ); +HYPRE_Int +hypre_BoomerAMGDDSetStartLevel_long_dbl( void *data, HYPRE_Int start_level ); + +HYPRE_Int +hypre_BoomerAMGDDSetup_flt( void *amgdd_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); +HYPRE_Int +hypre_BoomerAMGDDSetup_dbl( void *amgdd_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); +HYPRE_Int +hypre_BoomerAMGDDSetup_long_dbl( void *amgdd_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); + +HYPRE_Int +hypre_BoomerAMGDDSolve_flt( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); +HYPRE_Int +hypre_BoomerAMGDDSolve_dbl( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); +HYPRE_Int +hypre_BoomerAMGDDSolve_long_dbl( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); + +HYPRE_Int +hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo_flt( hypre_ParAMGDDData* amgdd_data ); +HYPRE_Int +hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo_dbl( hypre_ParAMGDDData* amgdd_data ); +HYPRE_Int +hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo_long_dbl( hypre_ParAMGDDData* amgdd_data ); + +HYPRE_Int +hypre_BoomerAMGDD_FAC_flt( void *amgdd_vdata, HYPRE_Int first_iteration ); +HYPRE_Int +hypre_BoomerAMGDD_FAC_dbl( void *amgdd_vdata, HYPRE_Int first_iteration ); +HYPRE_Int +hypre_BoomerAMGDD_FAC_long_dbl( void *amgdd_vdata, HYPRE_Int first_iteration ); + +HYPRE_Int +hypre_BoomerAMGDD_FAC_CFL1Jacobi_flt( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ); +HYPRE_Int +hypre_BoomerAMGDD_FAC_CFL1Jacobi_dbl( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ); +HYPRE_Int +hypre_BoomerAMGDD_FAC_CFL1Jacobi_long_dbl( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ); + +HYPRE_Int +hypre_BoomerAMGDD_FAC_CFL1JacobiHost_flt( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int relax_set ); +HYPRE_Int +hypre_BoomerAMGDD_FAC_CFL1JacobiHost_dbl( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int relax_set ); +HYPRE_Int +hypre_BoomerAMGDD_FAC_CFL1JacobiHost_long_dbl( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int relax_set ); + +HYPRE_Int +hypre_BoomerAMGDD_FAC_Cycle_flt( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_type, HYPRE_Int first_iteration ); +HYPRE_Int +hypre_BoomerAMGDD_FAC_Cycle_dbl( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_type, HYPRE_Int first_iteration ); +HYPRE_Int +hypre_BoomerAMGDD_FAC_Cycle_long_dbl( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_type, HYPRE_Int first_iteration ); + +HYPRE_Int +hypre_BoomerAMGDD_FAC_FCycle_flt( void *amgdd_vdata, HYPRE_Int first_iteration ); +HYPRE_Int +hypre_BoomerAMGDD_FAC_FCycle_dbl( void *amgdd_vdata, HYPRE_Int first_iteration ); +HYPRE_Int +hypre_BoomerAMGDD_FAC_FCycle_long_dbl( void *amgdd_vdata, HYPRE_Int first_iteration ); + +HYPRE_Int +hypre_BoomerAMGDD_FAC_GaussSeidel_flt( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ); +HYPRE_Int +hypre_BoomerAMGDD_FAC_GaussSeidel_dbl( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ); +HYPRE_Int +hypre_BoomerAMGDD_FAC_GaussSeidel_long_dbl( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ); + +HYPRE_Int +hypre_BoomerAMGDD_FAC_Interpolate_flt( hypre_AMGDDCompGrid *compGrid_f, hypre_AMGDDCompGrid *compGrid_c ); +HYPRE_Int +hypre_BoomerAMGDD_FAC_Interpolate_dbl( hypre_AMGDDCompGrid *compGrid_f, hypre_AMGDDCompGrid *compGrid_c ); +HYPRE_Int +hypre_BoomerAMGDD_FAC_Interpolate_long_dbl( hypre_AMGDDCompGrid *compGrid_f, hypre_AMGDDCompGrid *compGrid_c ); + +HYPRE_Int +hypre_BoomerAMGDD_FAC_Jacobi_flt( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ); +HYPRE_Int +hypre_BoomerAMGDD_FAC_Jacobi_dbl( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ); +HYPRE_Int +hypre_BoomerAMGDD_FAC_Jacobi_long_dbl( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ); + +HYPRE_Int +hypre_BoomerAMGDD_FAC_JacobiHost_flt( void *amgdd_vdata, HYPRE_Int level ); +HYPRE_Int +hypre_BoomerAMGDD_FAC_JacobiHost_dbl( void *amgdd_vdata, HYPRE_Int level ); +HYPRE_Int +hypre_BoomerAMGDD_FAC_JacobiHost_long_dbl( void *amgdd_vdata, HYPRE_Int level ); + +HYPRE_Int +hypre_BoomerAMGDD_FAC_OrderedGaussSeidel_flt( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ); +HYPRE_Int +hypre_BoomerAMGDD_FAC_OrderedGaussSeidel_dbl( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ); +HYPRE_Int +hypre_BoomerAMGDD_FAC_OrderedGaussSeidel_long_dbl( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ); + +HYPRE_Int +hypre_BoomerAMGDD_FAC_Relax_flt( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ); +HYPRE_Int +hypre_BoomerAMGDD_FAC_Relax_dbl( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ); +HYPRE_Int +hypre_BoomerAMGDD_FAC_Relax_long_dbl( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ); + +HYPRE_Int +hypre_BoomerAMGDD_FAC_Restrict_flt( hypre_AMGDDCompGrid *compGrid_f, hypre_AMGDDCompGrid *compGrid_c, HYPRE_Int first_iteration ); +HYPRE_Int +hypre_BoomerAMGDD_FAC_Restrict_dbl( hypre_AMGDDCompGrid *compGrid_f, hypre_AMGDDCompGrid *compGrid_c, HYPRE_Int first_iteration ); +HYPRE_Int +hypre_BoomerAMGDD_FAC_Restrict_long_dbl( hypre_AMGDDCompGrid *compGrid_f, hypre_AMGDDCompGrid *compGrid_c, HYPRE_Int first_iteration ); + +HYPRE_Int +hypre_BoomerAMGDD_FixUpRecvMaps_flt( hypre_AMGDDCompGrid **compGrid, hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int start_level, HYPRE_Int num_levels ); +HYPRE_Int +hypre_BoomerAMGDD_FixUpRecvMaps_dbl( hypre_AMGDDCompGrid **compGrid, hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int start_level, HYPRE_Int num_levels ); +HYPRE_Int +hypre_BoomerAMGDD_FixUpRecvMaps_long_dbl( hypre_AMGDDCompGrid **compGrid, hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int start_level, HYPRE_Int num_levels ); + +HYPRE_Int +hypre_BoomerAMGDD_MarkCoarse_flt( 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_MarkCoarse_dbl( 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_MarkCoarse_long_dbl( 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_PackRecvMapSendBuffer_flt( 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_PackRecvMapSendBuffer_dbl( 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_PackRecvMapSendBuffer_long_dbl( 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_Complex* +hypre_BoomerAMGDD_PackResidualBuffer_flt( hypre_AMGDDCompGrid **compGrid, hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int current_level, HYPRE_Int proc ); +HYPRE_Complex* +hypre_BoomerAMGDD_PackResidualBuffer_dbl( hypre_AMGDDCompGrid **compGrid, hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int current_level, HYPRE_Int proc ); +HYPRE_Complex* +hypre_BoomerAMGDD_PackResidualBuffer_long_dbl( hypre_AMGDDCompGrid **compGrid, hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int current_level, HYPRE_Int proc ); + +HYPRE_Int* +hypre_BoomerAMGDD_PackSendBuffer_flt( hypre_ParAMGDDData *amgdd_data, HYPRE_Int proc, HYPRE_Int current_level, HYPRE_Int *padding, HYPRE_Int *send_flag_buffer_size ); +HYPRE_Int* +hypre_BoomerAMGDD_PackSendBuffer_dbl( hypre_ParAMGDDData *amgdd_data, HYPRE_Int proc, HYPRE_Int current_level, HYPRE_Int *padding, HYPRE_Int *send_flag_buffer_size ); +HYPRE_Int* +hypre_BoomerAMGDD_PackSendBuffer_long_dbl( hypre_ParAMGDDData *amgdd_data, HYPRE_Int proc, HYPRE_Int current_level, HYPRE_Int *padding, HYPRE_Int *send_flag_buffer_size ); + +HYPRE_Int +hypre_BoomerAMGDD_RecursivelyBuildPsiComposite_flt( HYPRE_Int node, HYPRE_Int m, hypre_AMGDDCompGrid *compGrid, HYPRE_Int *add_flag, HYPRE_Int use_sort ); +HYPRE_Int +hypre_BoomerAMGDD_RecursivelyBuildPsiComposite_dbl( HYPRE_Int node, HYPRE_Int m, hypre_AMGDDCompGrid *compGrid, HYPRE_Int *add_flag, HYPRE_Int use_sort ); +HYPRE_Int +hypre_BoomerAMGDD_RecursivelyBuildPsiComposite_long_dbl( HYPRE_Int node, HYPRE_Int m, hypre_AMGDDCompGrid *compGrid, HYPRE_Int *add_flag, HYPRE_Int use_sort ); + +HYPRE_Int +hypre_BoomerAMGDD_ResidualCommunication_flt( hypre_ParAMGDDData *amgdd_data ); +HYPRE_Int +hypre_BoomerAMGDD_ResidualCommunication_dbl( hypre_ParAMGDDData *amgdd_data ); +HYPRE_Int +hypre_BoomerAMGDD_ResidualCommunication_long_dbl( hypre_ParAMGDDData *amgdd_data ); + +HYPRE_Int +hypre_BoomerAMGDD_SetupNearestProcessorNeighbors_flt( hypre_ParCSRMatrix *A, hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int level, HYPRE_Int *padding, HYPRE_Int num_ghost_layers ); +HYPRE_Int +hypre_BoomerAMGDD_SetupNearestProcessorNeighbors_dbl( hypre_ParCSRMatrix *A, hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int level, HYPRE_Int *padding, HYPRE_Int num_ghost_layers ); +HYPRE_Int +hypre_BoomerAMGDD_SetupNearestProcessorNeighbors_long_dbl( hypre_ParCSRMatrix *A, hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int level, HYPRE_Int *padding, HYPRE_Int num_ghost_layers ); + +HYPRE_Int +hypre_BoomerAMGDD_UnpackRecvBuffer_flt( 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_UnpackRecvBuffer_dbl( 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_UnpackRecvBuffer_long_dbl( 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_UnpackResidualBuffer_flt( hypre_float *buffer, hypre_AMGDDCompGrid **compGrid, hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int current_level, HYPRE_Int proc ); +HYPRE_Int +hypre_BoomerAMGDD_UnpackResidualBuffer_dbl( hypre_double *buffer, hypre_AMGDDCompGrid **compGrid, hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int current_level, HYPRE_Int proc ); +HYPRE_Int +hypre_BoomerAMGDD_UnpackResidualBuffer_long_dbl( hypre_long_double *buffer, hypre_AMGDDCompGrid **compGrid, hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int current_level, HYPRE_Int proc ); + +HYPRE_Int +hypre_BoomerAMGDD_UnpackSendFlagBuffer_flt( 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_UnpackSendFlagBuffer_dbl( 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_UnpackSendFlagBuffer_long_dbl( 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_BoomerAMGDestroy_flt( void *data ); +HYPRE_Int +hypre_BoomerAMGDestroy_dbl( void *data ); +HYPRE_Int +hypre_BoomerAMGDestroy_long_dbl( void *data ); + +HYPRE_Int +hypre_BoomerAMGFitVectors_flt( HYPRE_Int ip, HYPRE_Int n, HYPRE_Int num, const hypre_float *V, HYPRE_Int nc, const HYPRE_Int *ind, hypre_float *val ); +HYPRE_Int +hypre_BoomerAMGFitVectors_dbl( HYPRE_Int ip, HYPRE_Int n, HYPRE_Int num, const hypre_double *V, HYPRE_Int nc, const HYPRE_Int *ind, hypre_double *val ); +HYPRE_Int +hypre_BoomerAMGFitVectors_long_dbl( HYPRE_Int ip, HYPRE_Int n, HYPRE_Int num, const hypre_long_double *V, HYPRE_Int nc, const HYPRE_Int *ind, hypre_long_double *val ); + +HYPRE_Int +hypre_BoomerAMGGetAdditive_flt( void *data, HYPRE_Int *additive ); +HYPRE_Int +hypre_BoomerAMGGetAdditive_dbl( void *data, HYPRE_Int *additive ); +HYPRE_Int +hypre_BoomerAMGGetAdditive_long_dbl( void *data, HYPRE_Int *additive ); + +const char* +hypre_BoomerAMGGetAggProlongationName_flt( hypre_ParAMGData *amg_data ); +const char* +hypre_BoomerAMGGetAggProlongationName_dbl( hypre_ParAMGData *amg_data ); +const char* +hypre_BoomerAMGGetAggProlongationName_long_dbl( hypre_ParAMGData *amg_data ); + +HYPRE_Int +hypre_BoomerAMGGetCoarsenCutFactor_flt( void *data, HYPRE_Int *coarsen_cut_factor ); +HYPRE_Int +hypre_BoomerAMGGetCoarsenCutFactor_dbl( void *data, HYPRE_Int *coarsen_cut_factor ); +HYPRE_Int +hypre_BoomerAMGGetCoarsenCutFactor_long_dbl( void *data, HYPRE_Int *coarsen_cut_factor ); + +HYPRE_Int +hypre_BoomerAMGGetCoarsenType_flt( void *data, HYPRE_Int *coarsen_type ); +HYPRE_Int +hypre_BoomerAMGGetCoarsenType_dbl( void *data, HYPRE_Int *coarsen_type ); +HYPRE_Int +hypre_BoomerAMGGetCoarsenType_long_dbl( void *data, HYPRE_Int *coarsen_type ); + +const char* +hypre_BoomerAMGGetCoarseningName_flt( hypre_ParAMGData *amg_data ); +const char* +hypre_BoomerAMGGetCoarseningName_dbl( hypre_ParAMGData *amg_data ); +const char* +hypre_BoomerAMGGetCoarseningName_long_dbl( hypre_ParAMGData *amg_data ); + +HYPRE_Int +hypre_BoomerAMGGetConvergeType_flt( void *data, HYPRE_Int *type ); +HYPRE_Int +hypre_BoomerAMGGetConvergeType_dbl( void *data, HYPRE_Int *type ); +HYPRE_Int +hypre_BoomerAMGGetConvergeType_long_dbl( void *data, HYPRE_Int *type ); + +HYPRE_Int +hypre_BoomerAMGGetCumNnzAP_flt( void *data, hypre_float *cum_nnz_AP ); +HYPRE_Int +hypre_BoomerAMGGetCumNnzAP_dbl( void *data, hypre_double *cum_nnz_AP ); +HYPRE_Int +hypre_BoomerAMGGetCumNnzAP_long_dbl( void *data, hypre_long_double *cum_nnz_AP ); + +HYPRE_Int +hypre_BoomerAMGGetCumNumIterations_flt( void *data, HYPRE_Int *cum_num_iterations ); +HYPRE_Int +hypre_BoomerAMGGetCumNumIterations_dbl( void *data, HYPRE_Int *cum_num_iterations ); +HYPRE_Int +hypre_BoomerAMGGetCumNumIterations_long_dbl( void *data, HYPRE_Int *cum_num_iterations ); + +const char* +hypre_BoomerAMGGetCycleName_flt( hypre_ParAMGData *amg_data ); +const char* +hypre_BoomerAMGGetCycleName_dbl( hypre_ParAMGData *amg_data ); +const char* +hypre_BoomerAMGGetCycleName_long_dbl( hypre_ParAMGData *amg_data ); + +HYPRE_Int +hypre_BoomerAMGGetCycleNumSweeps_flt( void *data, HYPRE_Int *num_sweeps, HYPRE_Int k ); +HYPRE_Int +hypre_BoomerAMGGetCycleNumSweeps_dbl( void *data, HYPRE_Int *num_sweeps, HYPRE_Int k ); +HYPRE_Int +hypre_BoomerAMGGetCycleNumSweeps_long_dbl( void *data, HYPRE_Int *num_sweeps, HYPRE_Int k ); + +HYPRE_Int +hypre_BoomerAMGGetCycleRelaxType_flt( void *data, HYPRE_Int *relax_type, HYPRE_Int k ); +HYPRE_Int +hypre_BoomerAMGGetCycleRelaxType_dbl( void *data, HYPRE_Int *relax_type, HYPRE_Int k ); +HYPRE_Int +hypre_BoomerAMGGetCycleRelaxType_long_dbl( void *data, HYPRE_Int *relax_type, HYPRE_Int k ); + +HYPRE_Int +hypre_BoomerAMGGetCycleType_flt( void *data, HYPRE_Int *cycle_type ); +HYPRE_Int +hypre_BoomerAMGGetCycleType_dbl( void *data, HYPRE_Int *cycle_type ); +HYPRE_Int +hypre_BoomerAMGGetCycleType_long_dbl( void *data, HYPRE_Int *cycle_type ); + +HYPRE_Int +hypre_BoomerAMGGetDebugFlag_flt( void *data, HYPRE_Int *debug_flag ); +HYPRE_Int +hypre_BoomerAMGGetDebugFlag_dbl( void *data, HYPRE_Int *debug_flag ); +HYPRE_Int +hypre_BoomerAMGGetDebugFlag_long_dbl( void *data, HYPRE_Int *debug_flag ); + +HYPRE_Int +hypre_BoomerAMGGetDomainType_flt( void *data, HYPRE_Int *domain_type ); +HYPRE_Int +hypre_BoomerAMGGetDomainType_dbl( void *data, HYPRE_Int *domain_type ); +HYPRE_Int +hypre_BoomerAMGGetDomainType_long_dbl( void *data, HYPRE_Int *domain_type ); + +HYPRE_Int +hypre_BoomerAMGGetFCycle_flt( void *data, HYPRE_Int *fcycle ); +HYPRE_Int +hypre_BoomerAMGGetFCycle_dbl( void *data, HYPRE_Int *fcycle ); +HYPRE_Int +hypre_BoomerAMGGetFCycle_long_dbl( void *data, HYPRE_Int *fcycle ); + +HYPRE_Int +hypre_BoomerAMGGetFilterFunctions_flt( void *data, HYPRE_Int *filter_functions ); +HYPRE_Int +hypre_BoomerAMGGetFilterFunctions_dbl( void *data, HYPRE_Int *filter_functions ); +HYPRE_Int +hypre_BoomerAMGGetFilterFunctions_long_dbl( void *data, HYPRE_Int *filter_functions ); + +HYPRE_Int +hypre_BoomerAMGGetFilterThresholdR_flt( void *data, hypre_float *filter_threshold ); +HYPRE_Int +hypre_BoomerAMGGetFilterThresholdR_dbl( void *data, hypre_double *filter_threshold ); +HYPRE_Int +hypre_BoomerAMGGetFilterThresholdR_long_dbl( void *data, hypre_long_double *filter_threshold ); + +HYPRE_Int +hypre_BoomerAMGGetGridHierarchy_flt( void *data, HYPRE_Int *cgrid ); +HYPRE_Int +hypre_BoomerAMGGetGridHierarchy_dbl( void *data, HYPRE_Int *cgrid ); +HYPRE_Int +hypre_BoomerAMGGetGridHierarchy_long_dbl( void *data, HYPRE_Int *cgrid ); + +HYPRE_Int +hypre_BoomerAMGGetGridRelaxPoints_flt( void *data, HYPRE_Int ***grid_relax_points ); +HYPRE_Int +hypre_BoomerAMGGetGridRelaxPoints_dbl( void *data, HYPRE_Int ***grid_relax_points ); +HYPRE_Int +hypre_BoomerAMGGetGridRelaxPoints_long_dbl( void *data, HYPRE_Int ***grid_relax_points ); + +HYPRE_Int +hypre_BoomerAMGGetGridRelaxType_flt( void *data, HYPRE_Int **grid_relax_type ); +HYPRE_Int +hypre_BoomerAMGGetGridRelaxType_dbl( void *data, HYPRE_Int **grid_relax_type ); +HYPRE_Int +hypre_BoomerAMGGetGridRelaxType_long_dbl( void *data, HYPRE_Int **grid_relax_type ); + +HYPRE_Int +hypre_BoomerAMGGetInterpType_flt( void *data, HYPRE_Int *interp_type ); +HYPRE_Int +hypre_BoomerAMGGetInterpType_dbl( void *data, HYPRE_Int *interp_type ); +HYPRE_Int +hypre_BoomerAMGGetInterpType_long_dbl( void *data, HYPRE_Int *interp_type ); + +HYPRE_Int +hypre_BoomerAMGGetJacobiTruncThreshold_flt( void *data, hypre_float *jacobi_trunc_threshold ); +HYPRE_Int +hypre_BoomerAMGGetJacobiTruncThreshold_dbl( void *data, hypre_double *jacobi_trunc_threshold ); +HYPRE_Int +hypre_BoomerAMGGetJacobiTruncThreshold_long_dbl( void *data, hypre_long_double *jacobi_trunc_threshold ); + +HYPRE_Int +hypre_BoomerAMGGetLevelOuterWt_flt( void *data, hypre_float *omega, HYPRE_Int level ); +HYPRE_Int +hypre_BoomerAMGGetLevelOuterWt_dbl( void *data, hypre_double *omega, HYPRE_Int level ); +HYPRE_Int +hypre_BoomerAMGGetLevelOuterWt_long_dbl( void *data, hypre_long_double *omega, HYPRE_Int level ); + +HYPRE_Int +hypre_BoomerAMGGetLevelRelaxWt_flt( void *data, hypre_float *relax_weight, HYPRE_Int level ); +HYPRE_Int +hypre_BoomerAMGGetLevelRelaxWt_dbl( void *data, hypre_double *relax_weight, HYPRE_Int level ); +HYPRE_Int +hypre_BoomerAMGGetLevelRelaxWt_long_dbl( void *data, hypre_long_double *relax_weight, HYPRE_Int level ); + +HYPRE_Int +hypre_BoomerAMGGetLogging_flt( void *data, HYPRE_Int *logging ); +HYPRE_Int +hypre_BoomerAMGGetLogging_dbl( void *data, HYPRE_Int *logging ); +HYPRE_Int +hypre_BoomerAMGGetLogging_long_dbl( void *data, HYPRE_Int *logging ); + +HYPRE_Int +hypre_BoomerAMGGetMaxCoarseSize_flt( void *data, HYPRE_Int *max_coarse_size ); +HYPRE_Int +hypre_BoomerAMGGetMaxCoarseSize_dbl( void *data, HYPRE_Int *max_coarse_size ); +HYPRE_Int +hypre_BoomerAMGGetMaxCoarseSize_long_dbl( void *data, HYPRE_Int *max_coarse_size ); + +HYPRE_Int +hypre_BoomerAMGGetMaxIter_flt( void *data, HYPRE_Int *max_iter ); +HYPRE_Int +hypre_BoomerAMGGetMaxIter_dbl( void *data, HYPRE_Int *max_iter ); +HYPRE_Int +hypre_BoomerAMGGetMaxIter_long_dbl( void *data, HYPRE_Int *max_iter ); + +HYPRE_Int +hypre_BoomerAMGGetMaxLevels_flt( void *data, HYPRE_Int *max_levels ); +HYPRE_Int +hypre_BoomerAMGGetMaxLevels_dbl( void *data, HYPRE_Int *max_levels ); +HYPRE_Int +hypre_BoomerAMGGetMaxLevels_long_dbl( void *data, HYPRE_Int *max_levels ); + +HYPRE_Int +hypre_BoomerAMGGetMaxRowSum_flt( void *data, hypre_float *max_row_sum ); +HYPRE_Int +hypre_BoomerAMGGetMaxRowSum_dbl( void *data, hypre_double *max_row_sum ); +HYPRE_Int +hypre_BoomerAMGGetMaxRowSum_long_dbl( void *data, hypre_long_double *max_row_sum ); + +HYPRE_Int +hypre_BoomerAMGGetMeasureType_flt( void *data, HYPRE_Int *measure_type ); +HYPRE_Int +hypre_BoomerAMGGetMeasureType_dbl( void *data, HYPRE_Int *measure_type ); +HYPRE_Int +hypre_BoomerAMGGetMeasureType_long_dbl( void *data, HYPRE_Int *measure_type ); + +HYPRE_Int +hypre_BoomerAMGGetMinCoarseSize_flt( void *data, HYPRE_Int *min_coarse_size ); +HYPRE_Int +hypre_BoomerAMGGetMinCoarseSize_dbl( void *data, HYPRE_Int *min_coarse_size ); +HYPRE_Int +hypre_BoomerAMGGetMinCoarseSize_long_dbl( void *data, HYPRE_Int *min_coarse_size ); + +HYPRE_Int +hypre_BoomerAMGGetMinIter_flt( void *data, HYPRE_Int *min_iter ); +HYPRE_Int +hypre_BoomerAMGGetMinIter_dbl( void *data, HYPRE_Int *min_iter ); +HYPRE_Int +hypre_BoomerAMGGetMinIter_long_dbl( void *data, HYPRE_Int *min_iter ); + +HYPRE_Int +hypre_BoomerAMGGetMultAdditive_flt( void *data, HYPRE_Int *mult_additive ); +HYPRE_Int +hypre_BoomerAMGGetMultAdditive_dbl( void *data, HYPRE_Int *mult_additive ); +HYPRE_Int +hypre_BoomerAMGGetMultAdditive_long_dbl( void *data, HYPRE_Int *mult_additive ); + +HYPRE_Int +hypre_BoomerAMGGetNumFunctions_flt( void *data, HYPRE_Int *num_functions ); +HYPRE_Int +hypre_BoomerAMGGetNumFunctions_dbl( void *data, HYPRE_Int *num_functions ); +HYPRE_Int +hypre_BoomerAMGGetNumFunctions_long_dbl( void *data, HYPRE_Int *num_functions ); + +HYPRE_Int +hypre_BoomerAMGGetNumGridSweeps_flt( void *data, HYPRE_Int **num_grid_sweeps ); +HYPRE_Int +hypre_BoomerAMGGetNumGridSweeps_dbl( void *data, HYPRE_Int **num_grid_sweeps ); +HYPRE_Int +hypre_BoomerAMGGetNumGridSweeps_long_dbl( void *data, HYPRE_Int **num_grid_sweeps ); + +HYPRE_Int +hypre_BoomerAMGGetNumIterations_flt( void *data, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_BoomerAMGGetNumIterations_dbl( void *data, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_BoomerAMGGetNumIterations_long_dbl( void *data, HYPRE_Int *num_iterations ); + +HYPRE_Int +hypre_BoomerAMGGetOmega_flt( void *data, hypre_float **omega ); +HYPRE_Int +hypre_BoomerAMGGetOmega_dbl( void *data, hypre_double **omega ); +HYPRE_Int +hypre_BoomerAMGGetOmega_long_dbl( void *data, hypre_long_double **omega ); + +HYPRE_Int +hypre_BoomerAMGGetOverlap_flt( void *data, HYPRE_Int *overlap ); +HYPRE_Int +hypre_BoomerAMGGetOverlap_dbl( void *data, HYPRE_Int *overlap ); +HYPRE_Int +hypre_BoomerAMGGetOverlap_long_dbl( void *data, HYPRE_Int *overlap ); + +HYPRE_Int +hypre_BoomerAMGGetPMaxElmts_flt( void *data, HYPRE_Int *P_max_elmts ); +HYPRE_Int +hypre_BoomerAMGGetPMaxElmts_dbl( void *data, HYPRE_Int *P_max_elmts ); +HYPRE_Int +hypre_BoomerAMGGetPMaxElmts_long_dbl( void *data, HYPRE_Int *P_max_elmts ); + +HYPRE_Int +hypre_BoomerAMGGetPostInterpType_flt( void *data, HYPRE_Int *post_interp_type ); +HYPRE_Int +hypre_BoomerAMGGetPostInterpType_dbl( void *data, HYPRE_Int *post_interp_type ); +HYPRE_Int +hypre_BoomerAMGGetPostInterpType_long_dbl( void *data, HYPRE_Int *post_interp_type ); + +HYPRE_Int +hypre_BoomerAMGGetPrintFileName_flt( void *data, char **print_file_name ); +HYPRE_Int +hypre_BoomerAMGGetPrintFileName_dbl( void *data, char **print_file_name ); +HYPRE_Int +hypre_BoomerAMGGetPrintFileName_long_dbl( void *data, char **print_file_name ); + +HYPRE_Int +hypre_BoomerAMGGetPrintLevel_flt( void *data, HYPRE_Int *print_level ); +HYPRE_Int +hypre_BoomerAMGGetPrintLevel_dbl( void *data, HYPRE_Int *print_level ); +HYPRE_Int +hypre_BoomerAMGGetPrintLevel_long_dbl( void *data, HYPRE_Int *print_level ); + +const char* +hypre_BoomerAMGGetProlongationName_flt( hypre_ParAMGData *amg_data ); +const char* +hypre_BoomerAMGGetProlongationName_dbl( hypre_ParAMGData *amg_data ); +const char* +hypre_BoomerAMGGetProlongationName_long_dbl( hypre_ParAMGData *amg_data ); + +HYPRE_Int +hypre_BoomerAMGGetRedundant_flt( void *data, HYPRE_Int *redundant ); +HYPRE_Int +hypre_BoomerAMGGetRedundant_dbl( void *data, HYPRE_Int *redundant ); +HYPRE_Int +hypre_BoomerAMGGetRedundant_long_dbl( void *data, HYPRE_Int *redundant ); + +HYPRE_Int +hypre_BoomerAMGGetRelResidualNorm_flt( void *data, hypre_float *rel_resid_norm ); +HYPRE_Int +hypre_BoomerAMGGetRelResidualNorm_dbl( void *data, hypre_double *rel_resid_norm ); +HYPRE_Int +hypre_BoomerAMGGetRelResidualNorm_long_dbl( void *data, hypre_long_double *rel_resid_norm ); + +HYPRE_Int +hypre_BoomerAMGGetRelaxOrder_flt( void *data, HYPRE_Int *relax_order ); +HYPRE_Int +hypre_BoomerAMGGetRelaxOrder_dbl( void *data, HYPRE_Int *relax_order ); +HYPRE_Int +hypre_BoomerAMGGetRelaxOrder_long_dbl( void *data, HYPRE_Int *relax_order ); + +HYPRE_Int +hypre_BoomerAMGGetRelaxWeight_flt( void *data, hypre_float **relax_weight ); +HYPRE_Int +hypre_BoomerAMGGetRelaxWeight_dbl( void *data, hypre_double **relax_weight ); +HYPRE_Int +hypre_BoomerAMGGetRelaxWeight_long_dbl( void *data, hypre_long_double **relax_weight ); + +HYPRE_Int +hypre_BoomerAMGGetResidual_flt( void *data, hypre_ParVector **resid ); +HYPRE_Int +hypre_BoomerAMGGetResidual_dbl( void *data, hypre_ParVector **resid ); +HYPRE_Int +hypre_BoomerAMGGetResidual_long_dbl( void *data, hypre_ParVector **resid ); + +HYPRE_Int +hypre_BoomerAMGGetSchwarzRlxWeight_flt( void *data, hypre_float *schwarz_rlx_weight ); +HYPRE_Int +hypre_BoomerAMGGetSchwarzRlxWeight_dbl( void *data, hypre_double *schwarz_rlx_weight ); +HYPRE_Int +hypre_BoomerAMGGetSchwarzRlxWeight_long_dbl( void *data, hypre_long_double *schwarz_rlx_weight ); + +HYPRE_Int +hypre_BoomerAMGGetSeqThreshold_flt( void *data, HYPRE_Int *seq_threshold ); +HYPRE_Int +hypre_BoomerAMGGetSeqThreshold_dbl( void *data, HYPRE_Int *seq_threshold ); +HYPRE_Int +hypre_BoomerAMGGetSeqThreshold_long_dbl( void *data, HYPRE_Int *seq_threshold ); + +HYPRE_Int +hypre_BoomerAMGGetSetupType_flt( void *data, HYPRE_Int *setup_type ); +HYPRE_Int +hypre_BoomerAMGGetSetupType_dbl( void *data, HYPRE_Int *setup_type ); +HYPRE_Int +hypre_BoomerAMGGetSetupType_long_dbl( void *data, HYPRE_Int *setup_type ); + +HYPRE_Int +hypre_BoomerAMGGetSimple_flt( void *data, HYPRE_Int *simple ); +HYPRE_Int +hypre_BoomerAMGGetSimple_dbl( void *data, HYPRE_Int *simple ); +HYPRE_Int +hypre_BoomerAMGGetSimple_long_dbl( void *data, HYPRE_Int *simple ); + +HYPRE_Int +hypre_BoomerAMGGetSmoothNumLevels_flt( void *data, HYPRE_Int *smooth_num_levels ); +HYPRE_Int +hypre_BoomerAMGGetSmoothNumLevels_dbl( void *data, HYPRE_Int *smooth_num_levels ); +HYPRE_Int +hypre_BoomerAMGGetSmoothNumLevels_long_dbl( void *data, HYPRE_Int *smooth_num_levels ); + +HYPRE_Int +hypre_BoomerAMGGetSmoothNumSweeps_flt( void *data, HYPRE_Int *smooth_num_sweeps ); +HYPRE_Int +hypre_BoomerAMGGetSmoothNumSweeps_dbl( void *data, HYPRE_Int *smooth_num_sweeps ); +HYPRE_Int +hypre_BoomerAMGGetSmoothNumSweeps_long_dbl( void *data, HYPRE_Int *smooth_num_sweeps ); + +HYPRE_Int +hypre_BoomerAMGGetSmoothType_flt( void *data, HYPRE_Int *smooth_type ); +HYPRE_Int +hypre_BoomerAMGGetSmoothType_dbl( void *data, HYPRE_Int *smooth_type ); +HYPRE_Int +hypre_BoomerAMGGetSmoothType_long_dbl( void *data, HYPRE_Int *smooth_type ); + +HYPRE_Int +hypre_BoomerAMGGetStrongThreshold_flt( void *data, hypre_float *strong_threshold ); +HYPRE_Int +hypre_BoomerAMGGetStrongThreshold_dbl( void *data, hypre_double *strong_threshold ); +HYPRE_Int +hypre_BoomerAMGGetStrongThreshold_long_dbl( void *data, hypre_long_double *strong_threshold ); + +HYPRE_Int +hypre_BoomerAMGGetStrongThresholdR_flt( void *data, hypre_float *strong_threshold ); +HYPRE_Int +hypre_BoomerAMGGetStrongThresholdR_dbl( void *data, hypre_double *strong_threshold ); +HYPRE_Int +hypre_BoomerAMGGetStrongThresholdR_long_dbl( void *data, hypre_long_double *strong_threshold ); + +HYPRE_Int +hypre_BoomerAMGGetTol_flt( void *data, hypre_float *tol ); +HYPRE_Int +hypre_BoomerAMGGetTol_dbl( void *data, hypre_double *tol ); +HYPRE_Int +hypre_BoomerAMGGetTol_long_dbl( void *data, hypre_long_double *tol ); + +HYPRE_Int +hypre_BoomerAMGGetTruncFactor_flt( void *data, hypre_float *trunc_factor ); +HYPRE_Int +hypre_BoomerAMGGetTruncFactor_dbl( void *data, hypre_double *trunc_factor ); +HYPRE_Int +hypre_BoomerAMGGetTruncFactor_long_dbl( void *data, hypre_long_double *trunc_factor ); + +HYPRE_Int +hypre_BoomerAMGGetVariant_flt( void *data, HYPRE_Int *variant ); +HYPRE_Int +hypre_BoomerAMGGetVariant_dbl( void *data, HYPRE_Int *variant ); +HYPRE_Int +hypre_BoomerAMGGetVariant_long_dbl( void *data, HYPRE_Int *variant ); + +HYPRE_Int +hypre_BoomerAMGIndepHMIS_flt( hypre_ParCSRMatrix *S, HYPRE_Int measure_type, HYPRE_Int debug_flag, HYPRE_Int *CF_marker ); +HYPRE_Int +hypre_BoomerAMGIndepHMIS_dbl( hypre_ParCSRMatrix *S, HYPRE_Int measure_type, HYPRE_Int debug_flag, HYPRE_Int *CF_marker ); +HYPRE_Int +hypre_BoomerAMGIndepHMIS_long_dbl( hypre_ParCSRMatrix *S, HYPRE_Int measure_type, HYPRE_Int debug_flag, HYPRE_Int *CF_marker ); + +HYPRE_Int +hypre_BoomerAMGIndepHMISa_flt( hypre_ParCSRMatrix *S, HYPRE_Int measure_type, HYPRE_Int debug_flag, HYPRE_Int *CF_marker ); +HYPRE_Int +hypre_BoomerAMGIndepHMISa_dbl( hypre_ParCSRMatrix *S, HYPRE_Int measure_type, HYPRE_Int debug_flag, HYPRE_Int *CF_marker ); +HYPRE_Int +hypre_BoomerAMGIndepHMISa_long_dbl( hypre_ParCSRMatrix *S, HYPRE_Int measure_type, HYPRE_Int debug_flag, HYPRE_Int *CF_marker ); + +HYPRE_Int +hypre_BoomerAMGIndepPMIS_flt( hypre_ParCSRMatrix *S, HYPRE_Int CF_init, HYPRE_Int debug_flag, HYPRE_Int *CF_marker ); +HYPRE_Int +hypre_BoomerAMGIndepPMIS_dbl( hypre_ParCSRMatrix *S, HYPRE_Int CF_init, HYPRE_Int debug_flag, HYPRE_Int *CF_marker ); +HYPRE_Int +hypre_BoomerAMGIndepPMIS_long_dbl( hypre_ParCSRMatrix *S, HYPRE_Int CF_init, HYPRE_Int debug_flag, HYPRE_Int *CF_marker ); + +HYPRE_Int +hypre_BoomerAMGIndepPMISa_flt( hypre_ParCSRMatrix *S, HYPRE_Int CF_init, HYPRE_Int debug_flag, HYPRE_Int *CF_marker ); +HYPRE_Int +hypre_BoomerAMGIndepPMISa_dbl( hypre_ParCSRMatrix *S, HYPRE_Int CF_init, HYPRE_Int debug_flag, HYPRE_Int *CF_marker ); +HYPRE_Int +hypre_BoomerAMGIndepPMISa_long_dbl( hypre_ParCSRMatrix *S, HYPRE_Int CF_init, HYPRE_Int debug_flag, HYPRE_Int *CF_marker ); + +HYPRE_Int +hypre_BoomerAMGIndepRS_flt( hypre_ParCSRMatrix *S, HYPRE_Int measure_type, HYPRE_Int debug_flag, HYPRE_Int *CF_marker ); +HYPRE_Int +hypre_BoomerAMGIndepRS_dbl( hypre_ParCSRMatrix *S, HYPRE_Int measure_type, HYPRE_Int debug_flag, HYPRE_Int *CF_marker ); +HYPRE_Int +hypre_BoomerAMGIndepRS_long_dbl( hypre_ParCSRMatrix *S, HYPRE_Int measure_type, HYPRE_Int debug_flag, HYPRE_Int *CF_marker ); + +HYPRE_Int +hypre_BoomerAMGIndepRSa_flt( hypre_ParCSRMatrix *S, HYPRE_Int measure_type, HYPRE_Int debug_flag, HYPRE_Int *CF_marker ); +HYPRE_Int +hypre_BoomerAMGIndepRSa_dbl( hypre_ParCSRMatrix *S, HYPRE_Int measure_type, HYPRE_Int debug_flag, HYPRE_Int *CF_marker ); +HYPRE_Int +hypre_BoomerAMGIndepRSa_long_dbl( hypre_ParCSRMatrix *S, HYPRE_Int measure_type, HYPRE_Int debug_flag, HYPRE_Int *CF_marker ); + +HYPRE_Int +hypre_BoomerAMGIndepSet_flt( hypre_ParCSRMatrix *S, hypre_float *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_BoomerAMGIndepSet_dbl( hypre_ParCSRMatrix *S, hypre_double *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_BoomerAMGIndepSet_long_dbl( hypre_ParCSRMatrix *S, hypre_long_double *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_flt( hypre_ParCSRMatrix *S, hypre_float *measure_array, HYPRE_Int seq_rand ); +HYPRE_Int +hypre_BoomerAMGIndepSetInit_dbl( hypre_ParCSRMatrix *S, hypre_double *measure_array, HYPRE_Int seq_rand ); +HYPRE_Int +hypre_BoomerAMGIndepSetInit_long_dbl( hypre_ParCSRMatrix *S, hypre_long_double *measure_array, HYPRE_Int seq_rand ); + +HYPRE_Int +hypre_BoomerAMGInterpTruncation_flt( hypre_ParCSRMatrix *P, hypre_float trunc_factor, HYPRE_Int max_elmts ); +HYPRE_Int +hypre_BoomerAMGInterpTruncation_dbl( hypre_ParCSRMatrix *P, hypre_double trunc_factor, HYPRE_Int max_elmts ); +HYPRE_Int +hypre_BoomerAMGInterpTruncation_long_dbl( hypre_ParCSRMatrix *P, hypre_long_double trunc_factor, HYPRE_Int max_elmts ); + +void +hypre_BoomerAMGJacobiInterp_flt( 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_float truncation_threshold, hypre_float truncation_threshold_minus ); +void +hypre_BoomerAMGJacobiInterp_dbl( 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_double truncation_threshold, hypre_double truncation_threshold_minus ); +void +hypre_BoomerAMGJacobiInterp_long_dbl( 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_long_double truncation_threshold, hypre_long_double truncation_threshold_minus ); + +void +hypre_BoomerAMGJacobiInterp_1_flt( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **P, hypre_ParCSRMatrix *S, HYPRE_Int *CF_marker, HYPRE_Int level, hypre_float truncation_threshold, hypre_float truncation_threshold_minus, HYPRE_Int *dof_func, HYPRE_Int *dof_func_offd, hypre_float weight_AF ); +void +hypre_BoomerAMGJacobiInterp_1_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **P, hypre_ParCSRMatrix *S, HYPRE_Int *CF_marker, HYPRE_Int level, hypre_double truncation_threshold, hypre_double truncation_threshold_minus, HYPRE_Int *dof_func, HYPRE_Int *dof_func_offd, hypre_double weight_AF ); +void +hypre_BoomerAMGJacobiInterp_1_long_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **P, hypre_ParCSRMatrix *S, HYPRE_Int *CF_marker, HYPRE_Int level, hypre_long_double truncation_threshold, hypre_long_double truncation_threshold_minus, HYPRE_Int *dof_func, HYPRE_Int *dof_func_offd, hypre_long_double weight_AF ); + +HYPRE_Int +hypre_BoomerAMGNormalizeVecs_flt( HYPRE_Int n, HYPRE_Int num, hypre_float *V ); +HYPRE_Int +hypre_BoomerAMGNormalizeVecs_dbl( HYPRE_Int n, HYPRE_Int num, hypre_double *V ); +HYPRE_Int +hypre_BoomerAMGNormalizeVecs_long_dbl( HYPRE_Int n, HYPRE_Int num, hypre_long_double *V ); + +HYPRE_Int +hypre_BoomerAMGPrintGeneralInfo_flt( hypre_ParAMGData *amg_data, HYPRE_Int shift ); +HYPRE_Int +hypre_BoomerAMGPrintGeneralInfo_dbl( hypre_ParAMGData *amg_data, HYPRE_Int shift ); +HYPRE_Int +hypre_BoomerAMGPrintGeneralInfo_long_dbl( hypre_ParAMGData *amg_data, HYPRE_Int shift ); + +HYPRE_Int +hypre_BoomerAMGRefineInterp_flt( 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_BoomerAMGRefineInterp_dbl( 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_BoomerAMGRefineInterp_long_dbl( 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_BoomerAMGRelax_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_type, HYPRE_Int relax_points, hypre_float relax_weight, hypre_float omega, hypre_float *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); +HYPRE_Int +hypre_BoomerAMGRelax_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_type, HYPRE_Int relax_points, hypre_double relax_weight, hypre_double omega, hypre_double *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); +HYPRE_Int +hypre_BoomerAMGRelax_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_type, HYPRE_Int relax_points, hypre_long_double relax_weight, hypre_long_double omega, hypre_long_double *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int +hypre_BoomerAMGRelax0WeightedJacobi_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_float relax_weight, hypre_ParVector *u, hypre_ParVector *Vtemp ); +HYPRE_Int +hypre_BoomerAMGRelax0WeightedJacobi_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_double relax_weight, hypre_ParVector *u, hypre_ParVector *Vtemp ); +HYPRE_Int +hypre_BoomerAMGRelax0WeightedJacobi_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_long_double relax_weight, hypre_ParVector *u, hypre_ParVector *Vtemp ); + +HYPRE_Int +hypre_BoomerAMGRelax10TopoOrderedGaussSeidel_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_float relax_weight, hypre_float omega, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); +HYPRE_Int +hypre_BoomerAMGRelax10TopoOrderedGaussSeidel_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_double relax_weight, hypre_double omega, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); +HYPRE_Int +hypre_BoomerAMGRelax10TopoOrderedGaussSeidel_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_long_double relax_weight, hypre_long_double omega, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int +hypre_BoomerAMGRelax11TwoStageGaussSeidel_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_float relax_weight, hypre_float omega, hypre_float *A_diag_diag, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); +HYPRE_Int +hypre_BoomerAMGRelax11TwoStageGaussSeidel_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_double relax_weight, hypre_double omega, hypre_double *A_diag_diag, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); +HYPRE_Int +hypre_BoomerAMGRelax11TwoStageGaussSeidel_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_long_double relax_weight, hypre_long_double omega, hypre_long_double *A_diag_diag, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int +hypre_BoomerAMGRelax12TwoStageGaussSeidel_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_float relax_weight, hypre_float omega, hypre_float *A_diag_diag, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); +HYPRE_Int +hypre_BoomerAMGRelax12TwoStageGaussSeidel_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_double relax_weight, hypre_double omega, hypre_double *A_diag_diag, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); +HYPRE_Int +hypre_BoomerAMGRelax12TwoStageGaussSeidel_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_long_double relax_weight, hypre_long_double omega, hypre_long_double *A_diag_diag, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int +hypre_BoomerAMGRelax13HybridL1GaussSeidel_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_float relax_weight, hypre_float omega, hypre_float *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); +HYPRE_Int +hypre_BoomerAMGRelax13HybridL1GaussSeidel_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_double relax_weight, hypre_double omega, hypre_double *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); +HYPRE_Int +hypre_BoomerAMGRelax13HybridL1GaussSeidel_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_long_double relax_weight, hypre_long_double omega, hypre_long_double *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int +hypre_BoomerAMGRelax14HybridL1GaussSeidel_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_float relax_weight, hypre_float omega, hypre_float *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); +HYPRE_Int +hypre_BoomerAMGRelax14HybridL1GaussSeidel_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_double relax_weight, hypre_double omega, hypre_double *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); +HYPRE_Int +hypre_BoomerAMGRelax14HybridL1GaussSeidel_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_long_double relax_weight, hypre_long_double omega, hypre_long_double *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int +hypre_BoomerAMGRelax18WeightedL1Jacobi_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_float relax_weight, hypre_float *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp ); +HYPRE_Int +hypre_BoomerAMGRelax18WeightedL1Jacobi_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_double relax_weight, hypre_double *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp ); +HYPRE_Int +hypre_BoomerAMGRelax18WeightedL1Jacobi_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_long_double relax_weight, hypre_long_double *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp ); + +HYPRE_Int +hypre_BoomerAMGRelax1GaussSeidel_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_ParVector *u ); +HYPRE_Int +hypre_BoomerAMGRelax1GaussSeidel_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_ParVector *u ); +HYPRE_Int +hypre_BoomerAMGRelax1GaussSeidel_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_ParVector *u ); + +HYPRE_Int +hypre_BoomerAMGRelax2GaussSeidel_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_ParVector *u ); +HYPRE_Int +hypre_BoomerAMGRelax2GaussSeidel_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_ParVector *u ); +HYPRE_Int +hypre_BoomerAMGRelax2GaussSeidel_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_ParVector *u ); + +HYPRE_Int +hypre_BoomerAMGRelax3HybridGaussSeidel_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_float relax_weight, hypre_float omega, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); +HYPRE_Int +hypre_BoomerAMGRelax3HybridGaussSeidel_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_double relax_weight, hypre_double omega, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); +HYPRE_Int +hypre_BoomerAMGRelax3HybridGaussSeidel_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_long_double relax_weight, hypre_long_double omega, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int +hypre_BoomerAMGRelax4HybridGaussSeidel_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_float relax_weight, hypre_float omega, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); +HYPRE_Int +hypre_BoomerAMGRelax4HybridGaussSeidel_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_double relax_weight, hypre_double omega, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); +HYPRE_Int +hypre_BoomerAMGRelax4HybridGaussSeidel_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_long_double relax_weight, hypre_long_double omega, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int +hypre_BoomerAMGRelax5ChaoticHybridGaussSeidel_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_ParVector *u ); +HYPRE_Int +hypre_BoomerAMGRelax5ChaoticHybridGaussSeidel_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_ParVector *u ); +HYPRE_Int +hypre_BoomerAMGRelax5ChaoticHybridGaussSeidel_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_ParVector *u ); + +HYPRE_Int +hypre_BoomerAMGRelax6HybridSSOR_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_float relax_weight, hypre_float omega, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); +HYPRE_Int +hypre_BoomerAMGRelax6HybridSSOR_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_double relax_weight, hypre_double omega, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); +HYPRE_Int +hypre_BoomerAMGRelax6HybridSSOR_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_long_double relax_weight, hypre_long_double omega, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int +hypre_BoomerAMGRelax7Jacobi_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_float relax_weight, hypre_float *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp ); +HYPRE_Int +hypre_BoomerAMGRelax7Jacobi_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_double relax_weight, hypre_double *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp ); +HYPRE_Int +hypre_BoomerAMGRelax7Jacobi_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_long_double relax_weight, hypre_long_double *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp ); + +HYPRE_Int +hypre_BoomerAMGRelax89HybridL1SSOR_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_float relax_weight, hypre_float omega, hypre_float *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); +HYPRE_Int +hypre_BoomerAMGRelax89HybridL1SSOR_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_double relax_weight, hypre_double omega, hypre_double *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); +HYPRE_Int +hypre_BoomerAMGRelax89HybridL1SSOR_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_long_double relax_weight, hypre_long_double omega, hypre_long_double *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int +hypre_BoomerAMGRelax8HybridL1SSOR_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_float relax_weight, hypre_float omega, hypre_float *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); +HYPRE_Int +hypre_BoomerAMGRelax8HybridL1SSOR_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_double relax_weight, hypre_double omega, hypre_double *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); +HYPRE_Int +hypre_BoomerAMGRelax8HybridL1SSOR_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_long_double relax_weight, hypre_long_double omega, hypre_long_double *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int +hypre_BoomerAMGRelaxComputeL1Norms_flt( hypre_ParCSRMatrix *A, HYPRE_Int relax_type, HYPRE_Int relax_order, HYPRE_Int coarsest_lvl, hypre_IntArray *CF_marker, hypre_float **l1_norms_data_ptr ); +HYPRE_Int +hypre_BoomerAMGRelaxComputeL1Norms_dbl( hypre_ParCSRMatrix *A, HYPRE_Int relax_type, HYPRE_Int relax_order, HYPRE_Int coarsest_lvl, hypre_IntArray *CF_marker, hypre_double **l1_norms_data_ptr ); +HYPRE_Int +hypre_BoomerAMGRelaxComputeL1Norms_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int relax_type, HYPRE_Int relax_order, HYPRE_Int coarsest_lvl, hypre_IntArray *CF_marker, hypre_long_double **l1_norms_data_ptr ); + +HYPRE_Int +hypre_BoomerAMGRelaxHybridGaussSeidel_core_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_float relax_weight, hypre_float omega, hypre_float *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_BoomerAMGRelaxHybridGaussSeidel_core_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_double relax_weight, hypre_double omega, hypre_double *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_BoomerAMGRelaxHybridGaussSeidel_core_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_long_double relax_weight, hypre_long_double omega, hypre_long_double *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_BoomerAMGRelaxHybridSOR_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_float relax_weight, hypre_float omega, hypre_float *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_BoomerAMGRelaxHybridSOR_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_double relax_weight, hypre_double omega, hypre_double *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_BoomerAMGRelaxHybridSOR_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_long_double relax_weight, hypre_long_double omega, hypre_long_double *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_BoomerAMGRelaxIF_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_type, HYPRE_Int relax_order, HYPRE_Int cycle_type, hypre_float relax_weight, hypre_float omega, hypre_float *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); +HYPRE_Int +hypre_BoomerAMGRelaxIF_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_type, HYPRE_Int relax_order, HYPRE_Int cycle_type, hypre_double relax_weight, hypre_double omega, hypre_double *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); +HYPRE_Int +hypre_BoomerAMGRelaxIF_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_type, HYPRE_Int relax_order, HYPRE_Int cycle_type, hypre_long_double relax_weight, hypre_long_double omega, hypre_long_double *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_ParVector *Ztemp ); + +HYPRE_Int +hypre_BoomerAMGRelaxKaczmarz_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_float omega, hypre_float *l1_norms, hypre_ParVector *u ); +HYPRE_Int +hypre_BoomerAMGRelaxKaczmarz_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_double omega, hypre_double *l1_norms, hypre_ParVector *u ); +HYPRE_Int +hypre_BoomerAMGRelaxKaczmarz_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_long_double omega, hypre_long_double *l1_norms, hypre_ParVector *u ); + +HYPRE_Int +hypre_BoomerAMGRelaxT_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_type, HYPRE_Int relax_points, hypre_float relax_weight, hypre_ParVector *u, hypre_ParVector *Vtemp ); +HYPRE_Int +hypre_BoomerAMGRelaxT_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_type, HYPRE_Int relax_points, hypre_double relax_weight, hypre_ParVector *u, hypre_ParVector *Vtemp ); +HYPRE_Int +hypre_BoomerAMGRelaxT_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_type, HYPRE_Int relax_points, hypre_long_double relax_weight, hypre_ParVector *u, hypre_ParVector *Vtemp ); + +HYPRE_Int +hypre_BoomerAMGRelax_FCFJacobi_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, hypre_float relax_weight, hypre_ParVector *u, hypre_ParVector *Vtemp ); +HYPRE_Int +hypre_BoomerAMGRelax_FCFJacobi_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, hypre_double relax_weight, hypre_ParVector *u, hypre_ParVector *Vtemp ); +HYPRE_Int +hypre_BoomerAMGRelax_FCFJacobi_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, hypre_long_double relax_weight, hypre_ParVector *u, hypre_ParVector *Vtemp ); + +HYPRE_Int +hypre_BoomerAMGSetADropTol_flt( void *data, hypre_float A_drop_tol ); +HYPRE_Int +hypre_BoomerAMGSetADropTol_dbl( void *data, hypre_double A_drop_tol ); +HYPRE_Int +hypre_BoomerAMGSetADropTol_long_dbl( void *data, hypre_long_double A_drop_tol ); + +HYPRE_Int +hypre_BoomerAMGSetADropType_flt( void *data, HYPRE_Int A_drop_type ); +HYPRE_Int +hypre_BoomerAMGSetADropType_dbl( void *data, HYPRE_Int A_drop_type ); +HYPRE_Int +hypre_BoomerAMGSetADropType_long_dbl( void *data, HYPRE_Int A_drop_type ); + +HYPRE_Int +hypre_BoomerAMGSetAddLastLvl_flt( void *data, HYPRE_Int add_last_lvl ); +HYPRE_Int +hypre_BoomerAMGSetAddLastLvl_dbl( void *data, HYPRE_Int add_last_lvl ); +HYPRE_Int +hypre_BoomerAMGSetAddLastLvl_long_dbl( void *data, HYPRE_Int add_last_lvl ); + +HYPRE_Int +hypre_BoomerAMGSetAddRelaxType_flt( void *data, HYPRE_Int add_rlx_type ); +HYPRE_Int +hypre_BoomerAMGSetAddRelaxType_dbl( void *data, HYPRE_Int add_rlx_type ); +HYPRE_Int +hypre_BoomerAMGSetAddRelaxType_long_dbl( void *data, HYPRE_Int add_rlx_type ); + +HYPRE_Int +hypre_BoomerAMGSetAddRelaxWt_flt( void *data, hypre_float add_rlx_wt ); +HYPRE_Int +hypre_BoomerAMGSetAddRelaxWt_dbl( void *data, hypre_double add_rlx_wt ); +HYPRE_Int +hypre_BoomerAMGSetAddRelaxWt_long_dbl( void *data, hypre_long_double add_rlx_wt ); + +HYPRE_Int +hypre_BoomerAMGSetAdditive_flt( void *data, HYPRE_Int additive ); +HYPRE_Int +hypre_BoomerAMGSetAdditive_dbl( void *data, HYPRE_Int additive ); +HYPRE_Int +hypre_BoomerAMGSetAdditive_long_dbl( void *data, HYPRE_Int additive ); + +HYPRE_Int +hypre_BoomerAMGSetAggInterpType_flt( void *data, HYPRE_Int agg_interp_type ); +HYPRE_Int +hypre_BoomerAMGSetAggInterpType_dbl( void *data, HYPRE_Int agg_interp_type ); +HYPRE_Int +hypre_BoomerAMGSetAggInterpType_long_dbl( void *data, HYPRE_Int agg_interp_type ); + +HYPRE_Int +hypre_BoomerAMGSetAggNumLevels_flt( void *data, HYPRE_Int agg_num_levels ); +HYPRE_Int +hypre_BoomerAMGSetAggNumLevels_dbl( void *data, HYPRE_Int agg_num_levels ); +HYPRE_Int +hypre_BoomerAMGSetAggNumLevels_long_dbl( void *data, HYPRE_Int agg_num_levels ); + +HYPRE_Int +hypre_BoomerAMGSetAggP12MaxElmts_flt( void *data, HYPRE_Int agg_P12_max_elmts ); +HYPRE_Int +hypre_BoomerAMGSetAggP12MaxElmts_dbl( void *data, HYPRE_Int agg_P12_max_elmts ); +HYPRE_Int +hypre_BoomerAMGSetAggP12MaxElmts_long_dbl( void *data, HYPRE_Int agg_P12_max_elmts ); + +HYPRE_Int +hypre_BoomerAMGSetAggP12TruncFactor_flt( void *data, hypre_float agg_P12_trunc_factor ); +HYPRE_Int +hypre_BoomerAMGSetAggP12TruncFactor_dbl( void *data, hypre_double agg_P12_trunc_factor ); +HYPRE_Int +hypre_BoomerAMGSetAggP12TruncFactor_long_dbl( void *data, hypre_long_double agg_P12_trunc_factor ); + +HYPRE_Int +hypre_BoomerAMGSetAggPMaxElmts_flt( void *data, HYPRE_Int agg_P_max_elmts ); +HYPRE_Int +hypre_BoomerAMGSetAggPMaxElmts_dbl( void *data, HYPRE_Int agg_P_max_elmts ); +HYPRE_Int +hypre_BoomerAMGSetAggPMaxElmts_long_dbl( void *data, HYPRE_Int agg_P_max_elmts ); + +HYPRE_Int +hypre_BoomerAMGSetAggTruncFactor_flt( void *data, hypre_float agg_trunc_factor ); +HYPRE_Int +hypre_BoomerAMGSetAggTruncFactor_dbl( void *data, hypre_double agg_trunc_factor ); +HYPRE_Int +hypre_BoomerAMGSetAggTruncFactor_long_dbl( void *data, hypre_long_double agg_trunc_factor ); + +HYPRE_Int +hypre_BoomerAMGSetCGCIts_flt( void *data, HYPRE_Int its ); +HYPRE_Int +hypre_BoomerAMGSetCGCIts_dbl( void *data, HYPRE_Int its ); +HYPRE_Int +hypre_BoomerAMGSetCGCIts_long_dbl( void *data, HYPRE_Int its ); + +HYPRE_Int +hypre_BoomerAMGSetCPoints_flt( void *data, HYPRE_Int cpt_coarse_level, HYPRE_Int num_cpt_coarse, HYPRE_BigInt *cpt_coarse_index ); +HYPRE_Int +hypre_BoomerAMGSetCPoints_dbl( void *data, HYPRE_Int cpt_coarse_level, HYPRE_Int num_cpt_coarse, HYPRE_BigInt *cpt_coarse_index ); +HYPRE_Int +hypre_BoomerAMGSetCPoints_long_dbl( void *data, HYPRE_Int cpt_coarse_level, HYPRE_Int num_cpt_coarse, HYPRE_BigInt *cpt_coarse_index ); + +HYPRE_Int +hypre_BoomerAMGSetCRRate_flt( void *data, hypre_float CR_rate ); +HYPRE_Int +hypre_BoomerAMGSetCRRate_dbl( void *data, hypre_double CR_rate ); +HYPRE_Int +hypre_BoomerAMGSetCRRate_long_dbl( void *data, hypre_long_double CR_rate ); + +HYPRE_Int +hypre_BoomerAMGSetCRStrongTh_flt( void *data, hypre_float CR_strong_th ); +HYPRE_Int +hypre_BoomerAMGSetCRStrongTh_dbl( void *data, hypre_double CR_strong_th ); +HYPRE_Int +hypre_BoomerAMGSetCRStrongTh_long_dbl( void *data, hypre_long_double CR_strong_th ); + +HYPRE_Int +hypre_BoomerAMGSetCRUseCG_flt( void *data, HYPRE_Int CR_use_CG ); +HYPRE_Int +hypre_BoomerAMGSetCRUseCG_dbl( void *data, HYPRE_Int CR_use_CG ); +HYPRE_Int +hypre_BoomerAMGSetCRUseCG_long_dbl( void *data, HYPRE_Int CR_use_CG ); + +HYPRE_Int +hypre_BoomerAMGSetChebyEigEst_flt( void *data, HYPRE_Int eig_est ); +HYPRE_Int +hypre_BoomerAMGSetChebyEigEst_dbl( void *data, HYPRE_Int eig_est ); +HYPRE_Int +hypre_BoomerAMGSetChebyEigEst_long_dbl( void *data, HYPRE_Int eig_est ); + +HYPRE_Int +hypre_BoomerAMGSetChebyFraction_flt( void *data, hypre_float ratio ); +HYPRE_Int +hypre_BoomerAMGSetChebyFraction_dbl( void *data, hypre_double ratio ); +HYPRE_Int +hypre_BoomerAMGSetChebyFraction_long_dbl( void *data, hypre_long_double ratio ); + +HYPRE_Int +hypre_BoomerAMGSetChebyOrder_flt( void *data, HYPRE_Int order ); +HYPRE_Int +hypre_BoomerAMGSetChebyOrder_dbl( void *data, HYPRE_Int order ); +HYPRE_Int +hypre_BoomerAMGSetChebyOrder_long_dbl( void *data, HYPRE_Int order ); + +HYPRE_Int +hypre_BoomerAMGSetChebyScale_flt( void *data, HYPRE_Int scale ); +HYPRE_Int +hypre_BoomerAMGSetChebyScale_dbl( void *data, HYPRE_Int scale ); +HYPRE_Int +hypre_BoomerAMGSetChebyScale_long_dbl( void *data, HYPRE_Int scale ); + +HYPRE_Int +hypre_BoomerAMGSetChebyVariant_flt( void *data, HYPRE_Int variant ); +HYPRE_Int +hypre_BoomerAMGSetChebyVariant_dbl( void *data, HYPRE_Int variant ); +HYPRE_Int +hypre_BoomerAMGSetChebyVariant_long_dbl( void *data, HYPRE_Int variant ); + +HYPRE_Int +hypre_BoomerAMGSetCoarsenCutFactor_flt( void *data, HYPRE_Int coarsen_cut_factor ); +HYPRE_Int +hypre_BoomerAMGSetCoarsenCutFactor_dbl( void *data, HYPRE_Int coarsen_cut_factor ); +HYPRE_Int +hypre_BoomerAMGSetCoarsenCutFactor_long_dbl( void *data, HYPRE_Int coarsen_cut_factor ); + +HYPRE_Int +hypre_BoomerAMGSetCoarsenType_flt( void *data, HYPRE_Int coarsen_type ); +HYPRE_Int +hypre_BoomerAMGSetCoarsenType_dbl( void *data, HYPRE_Int coarsen_type ); +HYPRE_Int +hypre_BoomerAMGSetCoarsenType_long_dbl( void *data, HYPRE_Int coarsen_type ); + +HYPRE_Int +hypre_BoomerAMGSetConvergeType_flt( void *data, HYPRE_Int type ); +HYPRE_Int +hypre_BoomerAMGSetConvergeType_dbl( void *data, HYPRE_Int type ); +HYPRE_Int +hypre_BoomerAMGSetConvergeType_long_dbl( void *data, HYPRE_Int type ); + +HYPRE_Int +hypre_BoomerAMGSetCoordDim_flt( void *data, HYPRE_Int coorddim ); +HYPRE_Int +hypre_BoomerAMGSetCoordDim_dbl( void *data, HYPRE_Int coorddim ); +HYPRE_Int +hypre_BoomerAMGSetCoordDim_long_dbl( void *data, HYPRE_Int coorddim ); + +HYPRE_Int +hypre_BoomerAMGSetCoordinates_flt( void *data, float *coordinates ); +HYPRE_Int +hypre_BoomerAMGSetCoordinates_dbl( void *data, float *coordinates ); +HYPRE_Int +hypre_BoomerAMGSetCoordinates_long_dbl( void *data, float *coordinates ); + +HYPRE_Int +hypre_BoomerAMGSetCumNnzAP_flt( void *data, hypre_float cum_nnz_AP ); +HYPRE_Int +hypre_BoomerAMGSetCumNnzAP_dbl( void *data, hypre_double cum_nnz_AP ); +HYPRE_Int +hypre_BoomerAMGSetCumNnzAP_long_dbl( void *data, hypre_long_double cum_nnz_AP ); + +HYPRE_Int +hypre_BoomerAMGSetCycleNumSweeps_flt( void *data, HYPRE_Int num_sweeps, HYPRE_Int k ); +HYPRE_Int +hypre_BoomerAMGSetCycleNumSweeps_dbl( void *data, HYPRE_Int num_sweeps, HYPRE_Int k ); +HYPRE_Int +hypre_BoomerAMGSetCycleNumSweeps_long_dbl( void *data, HYPRE_Int num_sweeps, HYPRE_Int k ); + +HYPRE_Int +hypre_BoomerAMGSetCycleRelaxType_flt( void *data, HYPRE_Int relax_type, HYPRE_Int k ); +HYPRE_Int +hypre_BoomerAMGSetCycleRelaxType_dbl( void *data, HYPRE_Int relax_type, HYPRE_Int k ); +HYPRE_Int +hypre_BoomerAMGSetCycleRelaxType_long_dbl( void *data, HYPRE_Int relax_type, HYPRE_Int k ); + +HYPRE_Int +hypre_BoomerAMGSetCycleType_flt( void *data, HYPRE_Int cycle_type ); +HYPRE_Int +hypre_BoomerAMGSetCycleType_dbl( void *data, HYPRE_Int cycle_type ); +HYPRE_Int +hypre_BoomerAMGSetCycleType_long_dbl( void *data, HYPRE_Int cycle_type ); + +HYPRE_Int +hypre_BoomerAMGSetDebugFlag_flt( void *data, HYPRE_Int debug_flag ); +HYPRE_Int +hypre_BoomerAMGSetDebugFlag_dbl( void *data, HYPRE_Int debug_flag ); +HYPRE_Int +hypre_BoomerAMGSetDebugFlag_long_dbl( void *data, HYPRE_Int debug_flag ); + +HYPRE_Int +hypre_BoomerAMGSetDofFunc_flt( void *data, HYPRE_Int *dof_func ); +HYPRE_Int +hypre_BoomerAMGSetDofFunc_dbl( void *data, HYPRE_Int *dof_func ); +HYPRE_Int +hypre_BoomerAMGSetDofFunc_long_dbl( void *data, HYPRE_Int *dof_func ); + +HYPRE_Int +hypre_BoomerAMGSetDofPoint_flt( void *data, HYPRE_Int *dof_point ); +HYPRE_Int +hypre_BoomerAMGSetDofPoint_dbl( void *data, HYPRE_Int *dof_point ); +HYPRE_Int +hypre_BoomerAMGSetDofPoint_long_dbl( void *data, HYPRE_Int *dof_point ); + +HYPRE_Int +hypre_BoomerAMGSetDomainType_flt( void *data, HYPRE_Int domain_type ); +HYPRE_Int +hypre_BoomerAMGSetDomainType_dbl( void *data, HYPRE_Int domain_type ); +HYPRE_Int +hypre_BoomerAMGSetDomainType_long_dbl( void *data, HYPRE_Int domain_type ); + +HYPRE_Int +hypre_BoomerAMGSetDropTol_flt( void *data, hypre_float drop_tol ); +HYPRE_Int +hypre_BoomerAMGSetDropTol_dbl( void *data, hypre_double drop_tol ); +HYPRE_Int +hypre_BoomerAMGSetDropTol_long_dbl( void *data, hypre_long_double drop_tol ); + +HYPRE_Int +hypre_BoomerAMGSetEuBJ_flt( void *data, HYPRE_Int eu_bj ); +HYPRE_Int +hypre_BoomerAMGSetEuBJ_dbl( void *data, HYPRE_Int eu_bj ); +HYPRE_Int +hypre_BoomerAMGSetEuBJ_long_dbl( void *data, HYPRE_Int eu_bj ); + +HYPRE_Int +hypre_BoomerAMGSetEuLevel_flt( void *data, HYPRE_Int eu_level ); +HYPRE_Int +hypre_BoomerAMGSetEuLevel_dbl( void *data, HYPRE_Int eu_level ); +HYPRE_Int +hypre_BoomerAMGSetEuLevel_long_dbl( void *data, HYPRE_Int eu_level ); + +HYPRE_Int +hypre_BoomerAMGSetEuSparseA_flt( void *data, hypre_float eu_sparse_A ); +HYPRE_Int +hypre_BoomerAMGSetEuSparseA_dbl( void *data, hypre_double eu_sparse_A ); +HYPRE_Int +hypre_BoomerAMGSetEuSparseA_long_dbl( void *data, hypre_long_double eu_sparse_A ); + +HYPRE_Int +hypre_BoomerAMGSetEuclidFile_flt( void *data, char *euclidfile ); +HYPRE_Int +hypre_BoomerAMGSetEuclidFile_dbl( void *data, char *euclidfile ); +HYPRE_Int +hypre_BoomerAMGSetEuclidFile_long_dbl( void *data, char *euclidfile ); + +HYPRE_Int +hypre_BoomerAMGSetFCycle_flt( void *data, HYPRE_Int fcycle ); +HYPRE_Int +hypre_BoomerAMGSetFCycle_dbl( void *data, HYPRE_Int fcycle ); +HYPRE_Int +hypre_BoomerAMGSetFCycle_long_dbl( void *data, HYPRE_Int fcycle ); + +HYPRE_Int +hypre_BoomerAMGSetFPoints_flt( void *data, HYPRE_Int isolated, HYPRE_Int num_points, HYPRE_BigInt *indices ); +HYPRE_Int +hypre_BoomerAMGSetFPoints_dbl( void *data, HYPRE_Int isolated, HYPRE_Int num_points, HYPRE_BigInt *indices ); +HYPRE_Int +hypre_BoomerAMGSetFPoints_long_dbl( void *data, HYPRE_Int isolated, HYPRE_Int num_points, HYPRE_BigInt *indices ); + +HYPRE_Int +hypre_BoomerAMGSetFSAIAlgoType_flt( void *data, HYPRE_Int fsai_algo_type ); +HYPRE_Int +hypre_BoomerAMGSetFSAIAlgoType_dbl( void *data, HYPRE_Int fsai_algo_type ); +HYPRE_Int +hypre_BoomerAMGSetFSAIAlgoType_long_dbl( void *data, HYPRE_Int fsai_algo_type ); + +HYPRE_Int +hypre_BoomerAMGSetFSAIEigMaxIters_flt( void *data, HYPRE_Int fsai_eig_max_iters ); +HYPRE_Int +hypre_BoomerAMGSetFSAIEigMaxIters_dbl( void *data, HYPRE_Int fsai_eig_max_iters ); +HYPRE_Int +hypre_BoomerAMGSetFSAIEigMaxIters_long_dbl( void *data, HYPRE_Int fsai_eig_max_iters ); + +HYPRE_Int +hypre_BoomerAMGSetFSAIKapTolerance_flt( void *data, hypre_float fsai_kap_tolerance ); +HYPRE_Int +hypre_BoomerAMGSetFSAIKapTolerance_dbl( void *data, hypre_double fsai_kap_tolerance ); +HYPRE_Int +hypre_BoomerAMGSetFSAIKapTolerance_long_dbl( void *data, hypre_long_double fsai_kap_tolerance ); + +HYPRE_Int +hypre_BoomerAMGSetFSAILocalSolveType_flt( void *data, HYPRE_Int local_solve_type ); +HYPRE_Int +hypre_BoomerAMGSetFSAILocalSolveType_dbl( void *data, HYPRE_Int local_solve_type ); +HYPRE_Int +hypre_BoomerAMGSetFSAILocalSolveType_long_dbl( void *data, HYPRE_Int local_solve_type ); + +HYPRE_Int +hypre_BoomerAMGSetFSAIMaxNnzRow_flt( void *data, HYPRE_Int fsai_max_nnz_row ); +HYPRE_Int +hypre_BoomerAMGSetFSAIMaxNnzRow_dbl( void *data, HYPRE_Int fsai_max_nnz_row ); +HYPRE_Int +hypre_BoomerAMGSetFSAIMaxNnzRow_long_dbl( void *data, HYPRE_Int fsai_max_nnz_row ); + +HYPRE_Int +hypre_BoomerAMGSetFSAIMaxStepSize_flt( void *data, HYPRE_Int fsai_max_step_size ); +HYPRE_Int +hypre_BoomerAMGSetFSAIMaxStepSize_dbl( void *data, HYPRE_Int fsai_max_step_size ); +HYPRE_Int +hypre_BoomerAMGSetFSAIMaxStepSize_long_dbl( void *data, HYPRE_Int fsai_max_step_size ); + +HYPRE_Int +hypre_BoomerAMGSetFSAIMaxSteps_flt( void *data, HYPRE_Int fsai_max_steps ); +HYPRE_Int +hypre_BoomerAMGSetFSAIMaxSteps_dbl( void *data, HYPRE_Int fsai_max_steps ); +HYPRE_Int +hypre_BoomerAMGSetFSAIMaxSteps_long_dbl( void *data, HYPRE_Int fsai_max_steps ); + +HYPRE_Int +hypre_BoomerAMGSetFSAINumLevels_flt( void *data, HYPRE_Int fsai_num_levels ); +HYPRE_Int +hypre_BoomerAMGSetFSAINumLevels_dbl( void *data, HYPRE_Int fsai_num_levels ); +HYPRE_Int +hypre_BoomerAMGSetFSAINumLevels_long_dbl( void *data, HYPRE_Int fsai_num_levels ); + +HYPRE_Int +hypre_BoomerAMGSetFSAIThreshold_flt( void *data, hypre_float fsai_threshold ); +HYPRE_Int +hypre_BoomerAMGSetFSAIThreshold_dbl( void *data, hypre_double fsai_threshold ); +HYPRE_Int +hypre_BoomerAMGSetFSAIThreshold_long_dbl( void *data, hypre_long_double fsai_threshold ); + +HYPRE_Int +hypre_BoomerAMGSetFilter_flt( void *data, hypre_float filter ); +HYPRE_Int +hypre_BoomerAMGSetFilter_dbl( void *data, hypre_double filter ); +HYPRE_Int +hypre_BoomerAMGSetFilter_long_dbl( void *data, hypre_long_double filter ); + +HYPRE_Int +hypre_BoomerAMGSetFilterFunctions_flt( void *data, HYPRE_Int filter_functions ); +HYPRE_Int +hypre_BoomerAMGSetFilterFunctions_dbl( void *data, HYPRE_Int filter_functions ); +HYPRE_Int +hypre_BoomerAMGSetFilterFunctions_long_dbl( void *data, HYPRE_Int filter_functions ); + +HYPRE_Int +hypre_BoomerAMGSetFilterThresholdR_flt( void *data, hypre_float filter_threshold ); +HYPRE_Int +hypre_BoomerAMGSetFilterThresholdR_dbl( void *data, hypre_double filter_threshold ); +HYPRE_Int +hypre_BoomerAMGSetFilterThresholdR_long_dbl( void *data, hypre_long_double filter_threshold ); + +HYPRE_Int +hypre_BoomerAMGSetGMRESSwitchR_flt( void *data, HYPRE_Int gmres_switch ); +HYPRE_Int +hypre_BoomerAMGSetGMRESSwitchR_dbl( void *data, HYPRE_Int gmres_switch ); +HYPRE_Int +hypre_BoomerAMGSetGMRESSwitchR_long_dbl( void *data, HYPRE_Int gmres_switch ); + +HYPRE_Int +hypre_BoomerAMGSetGSMG_flt( void *data, HYPRE_Int par ); +HYPRE_Int +hypre_BoomerAMGSetGSMG_dbl( void *data, HYPRE_Int par ); +HYPRE_Int +hypre_BoomerAMGSetGSMG_long_dbl( void *data, HYPRE_Int par ); + +HYPRE_Int +hypre_BoomerAMGSetGridRelaxPoints_flt( void *data, HYPRE_Int **grid_relax_points ); +HYPRE_Int +hypre_BoomerAMGSetGridRelaxPoints_dbl( void *data, HYPRE_Int **grid_relax_points ); +HYPRE_Int +hypre_BoomerAMGSetGridRelaxPoints_long_dbl( void *data, HYPRE_Int **grid_relax_points ); + +HYPRE_Int +hypre_BoomerAMGSetGridRelaxType_flt( void *data, HYPRE_Int *grid_relax_type ); +HYPRE_Int +hypre_BoomerAMGSetGridRelaxType_dbl( void *data, HYPRE_Int *grid_relax_type ); +HYPRE_Int +hypre_BoomerAMGSetGridRelaxType_long_dbl( void *data, HYPRE_Int *grid_relax_type ); + +HYPRE_Int +hypre_BoomerAMGSetILUDroptol_flt( void *data, hypre_float ilu_droptol ); +HYPRE_Int +hypre_BoomerAMGSetILUDroptol_dbl( void *data, hypre_double ilu_droptol ); +HYPRE_Int +hypre_BoomerAMGSetILUDroptol_long_dbl( void *data, hypre_long_double ilu_droptol ); + +HYPRE_Int +hypre_BoomerAMGSetILUIterSetupMaxIter_flt( void *data, HYPRE_Int ilu_iter_setup_max_iter ); +HYPRE_Int +hypre_BoomerAMGSetILUIterSetupMaxIter_dbl( void *data, HYPRE_Int ilu_iter_setup_max_iter ); +HYPRE_Int +hypre_BoomerAMGSetILUIterSetupMaxIter_long_dbl( void *data, HYPRE_Int ilu_iter_setup_max_iter ); + +HYPRE_Int +hypre_BoomerAMGSetILUIterSetupOption_flt( void *data, HYPRE_Int ilu_iter_setup_option ); +HYPRE_Int +hypre_BoomerAMGSetILUIterSetupOption_dbl( void *data, HYPRE_Int ilu_iter_setup_option ); +HYPRE_Int +hypre_BoomerAMGSetILUIterSetupOption_long_dbl( void *data, HYPRE_Int ilu_iter_setup_option ); + +HYPRE_Int +hypre_BoomerAMGSetILUIterSetupTolerance_flt( void *data, hypre_float ilu_iter_setup_tolerance ); +HYPRE_Int +hypre_BoomerAMGSetILUIterSetupTolerance_dbl( void *data, hypre_double ilu_iter_setup_tolerance ); +HYPRE_Int +hypre_BoomerAMGSetILUIterSetupTolerance_long_dbl( void *data, hypre_long_double ilu_iter_setup_tolerance ); + +HYPRE_Int +hypre_BoomerAMGSetILUIterSetupType_flt( void *data, HYPRE_Int ilu_iter_setup_type ); +HYPRE_Int +hypre_BoomerAMGSetILUIterSetupType_dbl( void *data, HYPRE_Int ilu_iter_setup_type ); +HYPRE_Int +hypre_BoomerAMGSetILUIterSetupType_long_dbl( void *data, HYPRE_Int ilu_iter_setup_type ); + +HYPRE_Int +hypre_BoomerAMGSetILULevel_flt( void *data, HYPRE_Int ilu_lfil ); +HYPRE_Int +hypre_BoomerAMGSetILULevel_dbl( void *data, HYPRE_Int ilu_lfil ); +HYPRE_Int +hypre_BoomerAMGSetILULevel_long_dbl( void *data, HYPRE_Int ilu_lfil ); + +HYPRE_Int +hypre_BoomerAMGSetILULocalReordering_flt( void *data, HYPRE_Int ilu_reordering_type ); +HYPRE_Int +hypre_BoomerAMGSetILULocalReordering_dbl( void *data, HYPRE_Int ilu_reordering_type ); +HYPRE_Int +hypre_BoomerAMGSetILULocalReordering_long_dbl( void *data, HYPRE_Int ilu_reordering_type ); + +HYPRE_Int +hypre_BoomerAMGSetILULowerJacobiIters_flt( void *data, HYPRE_Int ilu_lower_jacobi_iters ); +HYPRE_Int +hypre_BoomerAMGSetILULowerJacobiIters_dbl( void *data, HYPRE_Int ilu_lower_jacobi_iters ); +HYPRE_Int +hypre_BoomerAMGSetILULowerJacobiIters_long_dbl( void *data, HYPRE_Int ilu_lower_jacobi_iters ); + +HYPRE_Int +hypre_BoomerAMGSetILUMaxIter_flt( void *data, HYPRE_Int ilu_max_iter ); +HYPRE_Int +hypre_BoomerAMGSetILUMaxIter_dbl( void *data, HYPRE_Int ilu_max_iter ); +HYPRE_Int +hypre_BoomerAMGSetILUMaxIter_long_dbl( void *data, HYPRE_Int ilu_max_iter ); + +HYPRE_Int +hypre_BoomerAMGSetILUMaxRowNnz_flt( void *data, HYPRE_Int ilu_max_row_nnz ); +HYPRE_Int +hypre_BoomerAMGSetILUMaxRowNnz_dbl( void *data, HYPRE_Int ilu_max_row_nnz ); +HYPRE_Int +hypre_BoomerAMGSetILUMaxRowNnz_long_dbl( void *data, HYPRE_Int ilu_max_row_nnz ); + +HYPRE_Int +hypre_BoomerAMGSetILUTriSolve_flt( void *data, HYPRE_Int ilu_tri_solve ); +HYPRE_Int +hypre_BoomerAMGSetILUTriSolve_dbl( void *data, HYPRE_Int ilu_tri_solve ); +HYPRE_Int +hypre_BoomerAMGSetILUTriSolve_long_dbl( void *data, HYPRE_Int ilu_tri_solve ); + +HYPRE_Int +hypre_BoomerAMGSetILUType_flt( void *data, HYPRE_Int ilu_type ); +HYPRE_Int +hypre_BoomerAMGSetILUType_dbl( void *data, HYPRE_Int ilu_type ); +HYPRE_Int +hypre_BoomerAMGSetILUType_long_dbl( void *data, HYPRE_Int ilu_type ); + +HYPRE_Int +hypre_BoomerAMGSetILUUpperJacobiIters_flt( void *data, HYPRE_Int ilu_upper_jacobi_iters ); +HYPRE_Int +hypre_BoomerAMGSetILUUpperJacobiIters_dbl( void *data, HYPRE_Int ilu_upper_jacobi_iters ); +HYPRE_Int +hypre_BoomerAMGSetILUUpperJacobiIters_long_dbl( void *data, HYPRE_Int ilu_upper_jacobi_iters ); + +HYPRE_Int +hypre_BoomerAMGSetISType_flt( void *data, HYPRE_Int IS_type ); +HYPRE_Int +hypre_BoomerAMGSetISType_dbl( void *data, HYPRE_Int IS_type ); +HYPRE_Int +hypre_BoomerAMGSetISType_long_dbl( void *data, HYPRE_Int IS_type ); + +HYPRE_Int +hypre_BoomerAMGSetInterpRefine_flt( void *data, HYPRE_Int num_refine ); +HYPRE_Int +hypre_BoomerAMGSetInterpRefine_dbl( void *data, HYPRE_Int num_refine ); +HYPRE_Int +hypre_BoomerAMGSetInterpRefine_long_dbl( void *data, HYPRE_Int num_refine ); + +HYPRE_Int +hypre_BoomerAMGSetInterpType_flt( void *data, HYPRE_Int interp_type ); +HYPRE_Int +hypre_BoomerAMGSetInterpType_dbl( void *data, HYPRE_Int interp_type ); +HYPRE_Int +hypre_BoomerAMGSetInterpType_long_dbl( void *data, HYPRE_Int interp_type ); + +HYPRE_Int +hypre_BoomerAMGSetInterpVecAbsQTrunc_flt( void *data, hypre_float q_trunc ); +HYPRE_Int +hypre_BoomerAMGSetInterpVecAbsQTrunc_dbl( void *data, hypre_double q_trunc ); +HYPRE_Int +hypre_BoomerAMGSetInterpVecAbsQTrunc_long_dbl( void *data, hypre_long_double q_trunc ); + +HYPRE_Int +hypre_BoomerAMGSetInterpVecFirstLevel_flt( void *data, HYPRE_Int level ); +HYPRE_Int +hypre_BoomerAMGSetInterpVecFirstLevel_dbl( void *data, HYPRE_Int level ); +HYPRE_Int +hypre_BoomerAMGSetInterpVecFirstLevel_long_dbl( void *data, HYPRE_Int level ); + +HYPRE_Int +hypre_BoomerAMGSetInterpVecQMax_flt( void *data, HYPRE_Int q_max ); +HYPRE_Int +hypre_BoomerAMGSetInterpVecQMax_dbl( void *data, HYPRE_Int q_max ); +HYPRE_Int +hypre_BoomerAMGSetInterpVecQMax_long_dbl( void *data, HYPRE_Int q_max ); + +HYPRE_Int +hypre_BoomerAMGSetInterpVecVariant_flt( void *solver, HYPRE_Int var ); +HYPRE_Int +hypre_BoomerAMGSetInterpVecVariant_dbl( void *solver, HYPRE_Int var ); +HYPRE_Int +hypre_BoomerAMGSetInterpVecVariant_long_dbl( void *solver, HYPRE_Int var ); + +HYPRE_Int +hypre_BoomerAMGSetInterpVectors_flt( void *solver, HYPRE_Int num_vectors, hypre_ParVector **interp_vectors ); +HYPRE_Int +hypre_BoomerAMGSetInterpVectors_dbl( void *solver, HYPRE_Int num_vectors, hypre_ParVector **interp_vectors ); +HYPRE_Int +hypre_BoomerAMGSetInterpVectors_long_dbl( void *solver, HYPRE_Int num_vectors, hypre_ParVector **interp_vectors ); + +HYPRE_Int +hypre_BoomerAMGSetIsTriangular_flt( void *data, HYPRE_Int is_triangular ); +HYPRE_Int +hypre_BoomerAMGSetIsTriangular_dbl( void *data, HYPRE_Int is_triangular ); +HYPRE_Int +hypre_BoomerAMGSetIsTriangular_long_dbl( void *data, HYPRE_Int is_triangular ); + +HYPRE_Int +hypre_BoomerAMGSetJacobiTruncThreshold_flt( void *data, hypre_float jacobi_trunc_threshold ); +HYPRE_Int +hypre_BoomerAMGSetJacobiTruncThreshold_dbl( void *data, hypre_double jacobi_trunc_threshold ); +HYPRE_Int +hypre_BoomerAMGSetJacobiTruncThreshold_long_dbl( void *data, hypre_long_double jacobi_trunc_threshold ); + +HYPRE_Int +hypre_BoomerAMGSetKeepSameSign_flt( void *data, HYPRE_Int keep_same_sign ); +HYPRE_Int +hypre_BoomerAMGSetKeepSameSign_dbl( void *data, HYPRE_Int keep_same_sign ); +HYPRE_Int +hypre_BoomerAMGSetKeepSameSign_long_dbl( void *data, HYPRE_Int keep_same_sign ); + +HYPRE_Int +hypre_BoomerAMGSetKeepTranspose_flt( void *data, HYPRE_Int keepTranspose ); +HYPRE_Int +hypre_BoomerAMGSetKeepTranspose_dbl( void *data, HYPRE_Int keepTranspose ); +HYPRE_Int +hypre_BoomerAMGSetKeepTranspose_long_dbl( void *data, HYPRE_Int keepTranspose ); + +HYPRE_Int +hypre_BoomerAMGSetLevel_flt( void *data, HYPRE_Int level ); +HYPRE_Int +hypre_BoomerAMGSetLevel_dbl( void *data, HYPRE_Int level ); +HYPRE_Int +hypre_BoomerAMGSetLevel_long_dbl( void *data, HYPRE_Int level ); + +HYPRE_Int +hypre_BoomerAMGSetLevelNonGalerkinTol_flt( void *data, hypre_float nongalerkin_tol, HYPRE_Int level ); +HYPRE_Int +hypre_BoomerAMGSetLevelNonGalerkinTol_dbl( void *data, hypre_double nongalerkin_tol, HYPRE_Int level ); +HYPRE_Int +hypre_BoomerAMGSetLevelNonGalerkinTol_long_dbl( void *data, hypre_long_double nongalerkin_tol, HYPRE_Int level ); + +HYPRE_Int +hypre_BoomerAMGSetLevelOuterWt_flt( void *data, hypre_float omega, HYPRE_Int level ); +HYPRE_Int +hypre_BoomerAMGSetLevelOuterWt_dbl( void *data, hypre_double omega, HYPRE_Int level ); +HYPRE_Int +hypre_BoomerAMGSetLevelOuterWt_long_dbl( void *data, hypre_long_double omega, HYPRE_Int level ); + +HYPRE_Int +hypre_BoomerAMGSetLevelRelaxWt_flt( void *data, hypre_float relax_weight, HYPRE_Int level ); +HYPRE_Int +hypre_BoomerAMGSetLevelRelaxWt_dbl( void *data, hypre_double relax_weight, HYPRE_Int level ); +HYPRE_Int +hypre_BoomerAMGSetLevelRelaxWt_long_dbl( void *data, hypre_long_double relax_weight, HYPRE_Int level ); + +HYPRE_Int +hypre_BoomerAMGSetLogging_flt( void *data, HYPRE_Int logging ); +HYPRE_Int +hypre_BoomerAMGSetLogging_dbl( void *data, HYPRE_Int logging ); +HYPRE_Int +hypre_BoomerAMGSetLogging_long_dbl( void *data, HYPRE_Int logging ); + +HYPRE_Int +hypre_BoomerAMGSetMaxCoarseSize_flt( void *data, HYPRE_Int max_coarse_size ); +HYPRE_Int +hypre_BoomerAMGSetMaxCoarseSize_dbl( void *data, HYPRE_Int max_coarse_size ); +HYPRE_Int +hypre_BoomerAMGSetMaxCoarseSize_long_dbl( void *data, HYPRE_Int max_coarse_size ); + +HYPRE_Int +hypre_BoomerAMGSetMaxIter_flt( void *data, HYPRE_Int max_iter ); +HYPRE_Int +hypre_BoomerAMGSetMaxIter_dbl( void *data, HYPRE_Int max_iter ); +HYPRE_Int +hypre_BoomerAMGSetMaxIter_long_dbl( void *data, HYPRE_Int max_iter ); + +HYPRE_Int +hypre_BoomerAMGSetMaxLevels_flt( void *data, HYPRE_Int max_levels ); +HYPRE_Int +hypre_BoomerAMGSetMaxLevels_dbl( void *data, HYPRE_Int max_levels ); +HYPRE_Int +hypre_BoomerAMGSetMaxLevels_long_dbl( void *data, HYPRE_Int max_levels ); + +HYPRE_Int +hypre_BoomerAMGSetMaxNzPerRow_flt( void *data, HYPRE_Int max_nz_per_row ); +HYPRE_Int +hypre_BoomerAMGSetMaxNzPerRow_dbl( void *data, HYPRE_Int max_nz_per_row ); +HYPRE_Int +hypre_BoomerAMGSetMaxNzPerRow_long_dbl( void *data, HYPRE_Int max_nz_per_row ); + +HYPRE_Int +hypre_BoomerAMGSetMaxRowSum_flt( void *data, hypre_float max_row_sum ); +HYPRE_Int +hypre_BoomerAMGSetMaxRowSum_dbl( void *data, hypre_double max_row_sum ); +HYPRE_Int +hypre_BoomerAMGSetMaxRowSum_long_dbl( void *data, hypre_long_double max_row_sum ); + +HYPRE_Int +hypre_BoomerAMGSetMeasureType_flt( void *data, HYPRE_Int measure_type ); +HYPRE_Int +hypre_BoomerAMGSetMeasureType_dbl( void *data, HYPRE_Int measure_type ); +HYPRE_Int +hypre_BoomerAMGSetMeasureType_long_dbl( void *data, HYPRE_Int measure_type ); + +HYPRE_Int +hypre_BoomerAMGSetMinCoarseSize_flt( void *data, HYPRE_Int min_coarse_size ); +HYPRE_Int +hypre_BoomerAMGSetMinCoarseSize_dbl( void *data, HYPRE_Int min_coarse_size ); +HYPRE_Int +hypre_BoomerAMGSetMinCoarseSize_long_dbl( void *data, HYPRE_Int min_coarse_size ); + +HYPRE_Int +hypre_BoomerAMGSetMinIter_flt( void *data, HYPRE_Int min_iter ); +HYPRE_Int +hypre_BoomerAMGSetMinIter_dbl( void *data, HYPRE_Int min_iter ); +HYPRE_Int +hypre_BoomerAMGSetMinIter_long_dbl( void *data, HYPRE_Int min_iter ); + +HYPRE_Int +hypre_BoomerAMGSetModuleRAP2_flt( void *data, HYPRE_Int mod_rap2 ); +HYPRE_Int +hypre_BoomerAMGSetModuleRAP2_dbl( void *data, HYPRE_Int mod_rap2 ); +HYPRE_Int +hypre_BoomerAMGSetModuleRAP2_long_dbl( void *data, HYPRE_Int mod_rap2 ); + +HYPRE_Int +hypre_BoomerAMGSetMultAddPMaxElmts_flt( void *data, HYPRE_Int add_P_max_elmts ); +HYPRE_Int +hypre_BoomerAMGSetMultAddPMaxElmts_dbl( void *data, HYPRE_Int add_P_max_elmts ); +HYPRE_Int +hypre_BoomerAMGSetMultAddPMaxElmts_long_dbl( void *data, HYPRE_Int add_P_max_elmts ); + +HYPRE_Int +hypre_BoomerAMGSetMultAddTruncFactor_flt( void *data, hypre_float add_trunc_factor ); +HYPRE_Int +hypre_BoomerAMGSetMultAddTruncFactor_dbl( void *data, hypre_double add_trunc_factor ); +HYPRE_Int +hypre_BoomerAMGSetMultAddTruncFactor_long_dbl( void *data, hypre_long_double add_trunc_factor ); + +HYPRE_Int +hypre_BoomerAMGSetMultAdditive_flt( void *data, HYPRE_Int mult_additive ); +HYPRE_Int +hypre_BoomerAMGSetMultAdditive_dbl( void *data, HYPRE_Int mult_additive ); +HYPRE_Int +hypre_BoomerAMGSetMultAdditive_long_dbl( void *data, HYPRE_Int mult_additive ); + +HYPRE_Int +hypre_BoomerAMGSetNodal_flt( void *data, HYPRE_Int nodal ); +HYPRE_Int +hypre_BoomerAMGSetNodal_dbl( void *data, HYPRE_Int nodal ); +HYPRE_Int +hypre_BoomerAMGSetNodal_long_dbl( void *data, HYPRE_Int nodal ); + +HYPRE_Int +hypre_BoomerAMGSetNodalDiag_flt( void *data, HYPRE_Int nodal ); +HYPRE_Int +hypre_BoomerAMGSetNodalDiag_dbl( void *data, HYPRE_Int nodal ); +HYPRE_Int +hypre_BoomerAMGSetNodalDiag_long_dbl( void *data, HYPRE_Int nodal ); + +HYPRE_Int +hypre_BoomerAMGSetNodalLevels_flt( void *data, HYPRE_Int nodal_levels ); +HYPRE_Int +hypre_BoomerAMGSetNodalLevels_dbl( void *data, HYPRE_Int nodal_levels ); +HYPRE_Int +hypre_BoomerAMGSetNodalLevels_long_dbl( void *data, HYPRE_Int nodal_levels ); + +HYPRE_Int +hypre_BoomerAMGSetNonGalerkTol_flt( void *data, HYPRE_Int nongalerk_num_tol, hypre_float *nongalerk_tol ); +HYPRE_Int +hypre_BoomerAMGSetNonGalerkTol_dbl( void *data, HYPRE_Int nongalerk_num_tol, hypre_double *nongalerk_tol ); +HYPRE_Int +hypre_BoomerAMGSetNonGalerkTol_long_dbl( void *data, HYPRE_Int nongalerk_num_tol, hypre_long_double *nongalerk_tol ); + +HYPRE_Int +hypre_BoomerAMGSetNonGalerkinTol_flt( void *data, hypre_float nongalerkin_tol ); +HYPRE_Int +hypre_BoomerAMGSetNonGalerkinTol_dbl( void *data, hypre_double nongalerkin_tol ); +HYPRE_Int +hypre_BoomerAMGSetNonGalerkinTol_long_dbl( void *data, hypre_long_double nongalerkin_tol ); + +HYPRE_Int +hypre_BoomerAMGSetNumCRRelaxSteps_flt( void *data, HYPRE_Int num_CR_relax_steps ); +HYPRE_Int +hypre_BoomerAMGSetNumCRRelaxSteps_dbl( void *data, HYPRE_Int num_CR_relax_steps ); +HYPRE_Int +hypre_BoomerAMGSetNumCRRelaxSteps_long_dbl( void *data, HYPRE_Int num_CR_relax_steps ); + +HYPRE_Int +hypre_BoomerAMGSetNumFunctions_flt( void *data, HYPRE_Int num_functions ); +HYPRE_Int +hypre_BoomerAMGSetNumFunctions_dbl( void *data, HYPRE_Int num_functions ); +HYPRE_Int +hypre_BoomerAMGSetNumFunctions_long_dbl( void *data, HYPRE_Int num_functions ); + +HYPRE_Int +hypre_BoomerAMGSetNumGridSweeps_flt( void *data, HYPRE_Int *num_grid_sweeps ); +HYPRE_Int +hypre_BoomerAMGSetNumGridSweeps_dbl( void *data, HYPRE_Int *num_grid_sweeps ); +HYPRE_Int +hypre_BoomerAMGSetNumGridSweeps_long_dbl( void *data, HYPRE_Int *num_grid_sweeps ); + +HYPRE_Int +hypre_BoomerAMGSetNumIterations_flt( void *data, HYPRE_Int num_iterations ); +HYPRE_Int +hypre_BoomerAMGSetNumIterations_dbl( void *data, HYPRE_Int num_iterations ); +HYPRE_Int +hypre_BoomerAMGSetNumIterations_long_dbl( void *data, HYPRE_Int num_iterations ); + +HYPRE_Int +hypre_BoomerAMGSetNumPaths_flt( void *data, HYPRE_Int num_paths ); +HYPRE_Int +hypre_BoomerAMGSetNumPaths_dbl( void *data, HYPRE_Int num_paths ); +HYPRE_Int +hypre_BoomerAMGSetNumPaths_long_dbl( void *data, HYPRE_Int num_paths ); + +HYPRE_Int +hypre_BoomerAMGSetNumPoints_flt( void *data, HYPRE_Int num_points ); +HYPRE_Int +hypre_BoomerAMGSetNumPoints_dbl( void *data, HYPRE_Int num_points ); +HYPRE_Int +hypre_BoomerAMGSetNumPoints_long_dbl( void *data, HYPRE_Int num_points ); + +HYPRE_Int +hypre_BoomerAMGSetNumSamples_flt( void *data, HYPRE_Int par ); +HYPRE_Int +hypre_BoomerAMGSetNumSamples_dbl( void *data, HYPRE_Int par ); +HYPRE_Int +hypre_BoomerAMGSetNumSamples_long_dbl( void *data, HYPRE_Int par ); + +HYPRE_Int +hypre_BoomerAMGSetNumSweeps_flt( void *data, HYPRE_Int num_sweeps ); +HYPRE_Int +hypre_BoomerAMGSetNumSweeps_dbl( void *data, HYPRE_Int num_sweeps ); +HYPRE_Int +hypre_BoomerAMGSetNumSweeps_long_dbl( void *data, HYPRE_Int num_sweeps ); + +HYPRE_Int +hypre_BoomerAMGSetOmega_flt( void *data, hypre_float *omega ); +HYPRE_Int +hypre_BoomerAMGSetOmega_dbl( void *data, hypre_double *omega ); +HYPRE_Int +hypre_BoomerAMGSetOmega_long_dbl( void *data, hypre_long_double *omega ); + +HYPRE_Int +hypre_BoomerAMGSetOuterWt_flt( void *data, hypre_float omega ); +HYPRE_Int +hypre_BoomerAMGSetOuterWt_dbl( void *data, hypre_double omega ); +HYPRE_Int +hypre_BoomerAMGSetOuterWt_long_dbl( void *data, hypre_long_double omega ); + +HYPRE_Int +hypre_BoomerAMGSetOverlap_flt( void *data, HYPRE_Int overlap ); +HYPRE_Int +hypre_BoomerAMGSetOverlap_dbl( void *data, HYPRE_Int overlap ); +HYPRE_Int +hypre_BoomerAMGSetOverlap_long_dbl( void *data, HYPRE_Int overlap ); + +HYPRE_Int +hypre_BoomerAMGSetPMaxElmts_flt( void *data, HYPRE_Int P_max_elmts ); +HYPRE_Int +hypre_BoomerAMGSetPMaxElmts_dbl( void *data, HYPRE_Int P_max_elmts ); +HYPRE_Int +hypre_BoomerAMGSetPMaxElmts_long_dbl( void *data, HYPRE_Int P_max_elmts ); + +HYPRE_Int +hypre_BoomerAMGSetPlotFileName_flt( void *data, const char *plot_file_name ); +HYPRE_Int +hypre_BoomerAMGSetPlotFileName_dbl( void *data, const char *plot_file_name ); +HYPRE_Int +hypre_BoomerAMGSetPlotFileName_long_dbl( void *data, const char *plot_file_name ); + +HYPRE_Int +hypre_BoomerAMGSetPlotGrids_flt( void *data, HYPRE_Int plotgrids ); +HYPRE_Int +hypre_BoomerAMGSetPlotGrids_dbl( void *data, HYPRE_Int plotgrids ); +HYPRE_Int +hypre_BoomerAMGSetPlotGrids_long_dbl( void *data, HYPRE_Int plotgrids ); + +HYPRE_Int +hypre_BoomerAMGSetPointDofMap_flt( void *data, HYPRE_Int *point_dof_map ); +HYPRE_Int +hypre_BoomerAMGSetPointDofMap_dbl( void *data, HYPRE_Int *point_dof_map ); +HYPRE_Int +hypre_BoomerAMGSetPointDofMap_long_dbl( void *data, HYPRE_Int *point_dof_map ); + +HYPRE_Int +hypre_BoomerAMGSetPostInterpType_flt( void *data, HYPRE_Int post_interp_type ); +HYPRE_Int +hypre_BoomerAMGSetPostInterpType_dbl( void *data, HYPRE_Int post_interp_type ); +HYPRE_Int +hypre_BoomerAMGSetPostInterpType_long_dbl( void *data, HYPRE_Int post_interp_type ); + +HYPRE_Int +hypre_BoomerAMGSetPrintFileName_flt( void *data, const char *print_file_name ); +HYPRE_Int +hypre_BoomerAMGSetPrintFileName_dbl( void *data, const char *print_file_name ); +HYPRE_Int +hypre_BoomerAMGSetPrintFileName_long_dbl( void *data, const char *print_file_name ); + +HYPRE_Int +hypre_BoomerAMGSetPrintLevel_flt( void *data, HYPRE_Int print_level ); +HYPRE_Int +hypre_BoomerAMGSetPrintLevel_dbl( void *data, HYPRE_Int print_level ); +HYPRE_Int +hypre_BoomerAMGSetPrintLevel_long_dbl( void *data, HYPRE_Int print_level ); + +HYPRE_Int +hypre_BoomerAMGSetRAP2_flt( void *data, HYPRE_Int rap2 ); +HYPRE_Int +hypre_BoomerAMGSetRAP2_dbl( void *data, HYPRE_Int rap2 ); +HYPRE_Int +hypre_BoomerAMGSetRAP2_long_dbl( void *data, HYPRE_Int rap2 ); + +HYPRE_Int +hypre_BoomerAMGSetRedundant_flt( void *data, HYPRE_Int redundant ); +HYPRE_Int +hypre_BoomerAMGSetRedundant_dbl( void *data, HYPRE_Int redundant ); +HYPRE_Int +hypre_BoomerAMGSetRedundant_long_dbl( void *data, HYPRE_Int redundant ); + +HYPRE_Int +hypre_BoomerAMGSetRelaxOrder_flt( void *data, HYPRE_Int relax_order ); +HYPRE_Int +hypre_BoomerAMGSetRelaxOrder_dbl( void *data, HYPRE_Int relax_order ); +HYPRE_Int +hypre_BoomerAMGSetRelaxOrder_long_dbl( void *data, HYPRE_Int relax_order ); + +HYPRE_Int +hypre_BoomerAMGSetRelaxType_flt( void *data, HYPRE_Int relax_type ); +HYPRE_Int +hypre_BoomerAMGSetRelaxType_dbl( void *data, HYPRE_Int relax_type ); +HYPRE_Int +hypre_BoomerAMGSetRelaxType_long_dbl( void *data, HYPRE_Int relax_type ); + +HYPRE_Int +hypre_BoomerAMGSetRelaxWeight_flt( void *data, hypre_float *relax_weight ); +HYPRE_Int +hypre_BoomerAMGSetRelaxWeight_dbl( void *data, hypre_double *relax_weight ); +HYPRE_Int +hypre_BoomerAMGSetRelaxWeight_long_dbl( void *data, hypre_long_double *relax_weight ); + +HYPRE_Int +hypre_BoomerAMGSetRelaxWt_flt( void *data, hypre_float relax_weight ); +HYPRE_Int +hypre_BoomerAMGSetRelaxWt_dbl( void *data, hypre_double relax_weight ); +HYPRE_Int +hypre_BoomerAMGSetRelaxWt_long_dbl( void *data, hypre_long_double relax_weight ); + +HYPRE_Int +hypre_BoomerAMGSetRestriction_flt( void *data, HYPRE_Int restr_par ); +HYPRE_Int +hypre_BoomerAMGSetRestriction_dbl( void *data, HYPRE_Int restr_par ); +HYPRE_Int +hypre_BoomerAMGSetRestriction_long_dbl( void *data, HYPRE_Int restr_par ); + +HYPRE_Int +hypre_BoomerAMGSetSabs_flt( void *data, HYPRE_Int Sabs ); +HYPRE_Int +hypre_BoomerAMGSetSabs_dbl( void *data, HYPRE_Int Sabs ); +HYPRE_Int +hypre_BoomerAMGSetSabs_long_dbl( void *data, HYPRE_Int Sabs ); + +HYPRE_Int +hypre_BoomerAMGSetSchwarzRlxWeight_flt( void *data, hypre_float schwarz_rlx_weight ); +HYPRE_Int +hypre_BoomerAMGSetSchwarzRlxWeight_dbl( void *data, hypre_double schwarz_rlx_weight ); +HYPRE_Int +hypre_BoomerAMGSetSchwarzRlxWeight_long_dbl( void *data, hypre_long_double schwarz_rlx_weight ); + +HYPRE_Int +hypre_BoomerAMGSetSchwarzUseNonSymm_flt( void *data, HYPRE_Int use_nonsymm ); +HYPRE_Int +hypre_BoomerAMGSetSchwarzUseNonSymm_dbl( void *data, HYPRE_Int use_nonsymm ); +HYPRE_Int +hypre_BoomerAMGSetSchwarzUseNonSymm_long_dbl( void *data, HYPRE_Int use_nonsymm ); + +HYPRE_Int +hypre_BoomerAMGSetSepWeight_flt( void *data, HYPRE_Int sep_weight ); +HYPRE_Int +hypre_BoomerAMGSetSepWeight_dbl( void *data, HYPRE_Int sep_weight ); +HYPRE_Int +hypre_BoomerAMGSetSepWeight_long_dbl( void *data, HYPRE_Int sep_weight ); + +HYPRE_Int +hypre_BoomerAMGSetSeqThreshold_flt( void *data, HYPRE_Int seq_threshold ); +HYPRE_Int +hypre_BoomerAMGSetSeqThreshold_dbl( void *data, HYPRE_Int seq_threshold ); +HYPRE_Int +hypre_BoomerAMGSetSeqThreshold_long_dbl( void *data, HYPRE_Int seq_threshold ); + +HYPRE_Int +hypre_BoomerAMGSetSetupType_flt( void *data, HYPRE_Int setup_type ); +HYPRE_Int +hypre_BoomerAMGSetSetupType_dbl( void *data, HYPRE_Int setup_type ); +HYPRE_Int +hypre_BoomerAMGSetSetupType_long_dbl( void *data, HYPRE_Int setup_type ); + +HYPRE_Int +hypre_BoomerAMGSetSimple_flt( void *data, HYPRE_Int simple ); +HYPRE_Int +hypre_BoomerAMGSetSimple_dbl( void *data, HYPRE_Int simple ); +HYPRE_Int +hypre_BoomerAMGSetSimple_long_dbl( void *data, HYPRE_Int simple ); + +HYPRE_Int +hypre_BoomerAMGSetSmoothInterpVectors_flt( void *solver, HYPRE_Int smooth_interp_vectors ); +HYPRE_Int +hypre_BoomerAMGSetSmoothInterpVectors_dbl( void *solver, HYPRE_Int smooth_interp_vectors ); +HYPRE_Int +hypre_BoomerAMGSetSmoothInterpVectors_long_dbl( void *solver, HYPRE_Int smooth_interp_vectors ); + +HYPRE_Int +hypre_BoomerAMGSetSmoothNumLevels_flt( void *data, HYPRE_Int smooth_num_levels ); +HYPRE_Int +hypre_BoomerAMGSetSmoothNumLevels_dbl( void *data, HYPRE_Int smooth_num_levels ); +HYPRE_Int +hypre_BoomerAMGSetSmoothNumLevels_long_dbl( void *data, HYPRE_Int smooth_num_levels ); + +HYPRE_Int +hypre_BoomerAMGSetSmoothNumSweeps_flt( void *data, HYPRE_Int smooth_num_sweeps ); +HYPRE_Int +hypre_BoomerAMGSetSmoothNumSweeps_dbl( void *data, HYPRE_Int smooth_num_sweeps ); +HYPRE_Int +hypre_BoomerAMGSetSmoothNumSweeps_long_dbl( void *data, HYPRE_Int smooth_num_sweeps ); + +HYPRE_Int +hypre_BoomerAMGSetSmoothType_flt( void *data, HYPRE_Int smooth_type ); +HYPRE_Int +hypre_BoomerAMGSetSmoothType_dbl( void *data, HYPRE_Int smooth_type ); +HYPRE_Int +hypre_BoomerAMGSetSmoothType_long_dbl( void *data, HYPRE_Int smooth_type ); + +HYPRE_Int +hypre_BoomerAMGSetStrongThreshold_flt( void *data, hypre_float strong_threshold ); +HYPRE_Int +hypre_BoomerAMGSetStrongThreshold_dbl( void *data, hypre_double strong_threshold ); +HYPRE_Int +hypre_BoomerAMGSetStrongThreshold_long_dbl( void *data, hypre_long_double strong_threshold ); + +HYPRE_Int +hypre_BoomerAMGSetStrongThresholdR_flt( void *data, hypre_float strong_threshold ); +HYPRE_Int +hypre_BoomerAMGSetStrongThresholdR_dbl( void *data, hypre_double strong_threshold ); +HYPRE_Int +hypre_BoomerAMGSetStrongThresholdR_long_dbl( void *data, hypre_long_double strong_threshold ); + +HYPRE_Int +hypre_BoomerAMGSetSym_flt( void *data, HYPRE_Int sym ); +HYPRE_Int +hypre_BoomerAMGSetSym_dbl( void *data, HYPRE_Int sym ); +HYPRE_Int +hypre_BoomerAMGSetSym_long_dbl( void *data, HYPRE_Int sym ); + +HYPRE_Int +hypre_BoomerAMGSetThreshold_flt( void *data, hypre_float thresh ); +HYPRE_Int +hypre_BoomerAMGSetThreshold_dbl( void *data, hypre_double thresh ); +HYPRE_Int +hypre_BoomerAMGSetThreshold_long_dbl( void *data, hypre_long_double thresh ); + +HYPRE_Int +hypre_BoomerAMGSetTol_flt( void *data, hypre_float tol ); +HYPRE_Int +hypre_BoomerAMGSetTol_dbl( void *data, hypre_double tol ); +HYPRE_Int +hypre_BoomerAMGSetTol_long_dbl( void *data, hypre_long_double tol ); + +HYPRE_Int +hypre_BoomerAMGSetTruncFactor_flt( void *data, hypre_float trunc_factor ); +HYPRE_Int +hypre_BoomerAMGSetTruncFactor_dbl( void *data, hypre_double trunc_factor ); +HYPRE_Int +hypre_BoomerAMGSetTruncFactor_long_dbl( void *data, hypre_long_double trunc_factor ); + +HYPRE_Int +hypre_BoomerAMGSetVariant_flt( void *data, HYPRE_Int variant ); +HYPRE_Int +hypre_BoomerAMGSetVariant_dbl( void *data, HYPRE_Int variant ); +HYPRE_Int +hypre_BoomerAMGSetVariant_long_dbl( void *data, HYPRE_Int variant ); + +HYPRE_Int +hypre_BoomerAMGSetup_flt( void *amg_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_BoomerAMGSetup_dbl( void *amg_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_BoomerAMGSetup_long_dbl( void *amg_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); + +HYPRE_Int +hypre_BoomerAMGSetupStats_flt( void *amg_vdata, hypre_ParCSRMatrix *A ); +HYPRE_Int +hypre_BoomerAMGSetupStats_dbl( void *amg_vdata, hypre_ParCSRMatrix *A ); +HYPRE_Int +hypre_BoomerAMGSetupStats_long_dbl( void *amg_vdata, hypre_ParCSRMatrix *A ); + +HYPRE_Int +hypre_BoomerAMGSmoothInterpVectors_flt( hypre_ParCSRMatrix *A, HYPRE_Int num_smooth_vecs, hypre_ParVector **smooth_vecs, HYPRE_Int smooth_steps ); +HYPRE_Int +hypre_BoomerAMGSmoothInterpVectors_dbl( hypre_ParCSRMatrix *A, HYPRE_Int num_smooth_vecs, hypre_ParVector **smooth_vecs, HYPRE_Int smooth_steps ); +HYPRE_Int +hypre_BoomerAMGSmoothInterpVectors_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int num_smooth_vecs, hypre_ParVector **smooth_vecs, HYPRE_Int smooth_steps ); + +HYPRE_Int +hypre_BoomerAMGSolve_flt( void *amg_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_BoomerAMGSolve_dbl( void *amg_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_BoomerAMGSolve_long_dbl( void *amg_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); + +HYPRE_Int +hypre_BoomerAMGSolveT_flt( void *amg_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_BoomerAMGSolveT_dbl( void *amg_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_BoomerAMGSolveT_long_dbl( void *amg_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); + +HYPRE_Int +hypre_BoomerAMGTruncandBuild_flt( hypre_ParCSRMatrix *P, hypre_float trunc_factor, HYPRE_Int max_elmts ); +HYPRE_Int +hypre_BoomerAMGTruncandBuild_dbl( hypre_ParCSRMatrix *P, hypre_double trunc_factor, HYPRE_Int max_elmts ); +HYPRE_Int +hypre_BoomerAMGTruncandBuild_long_dbl( hypre_ParCSRMatrix *P, hypre_long_double trunc_factor, HYPRE_Int max_elmts ); + +void +hypre_BoomerAMGTruncateInterp_flt( hypre_ParCSRMatrix *P, hypre_float eps, hypre_float dlt, HYPRE_Int *CF_marker ); +void +hypre_BoomerAMGTruncateInterp_dbl( hypre_ParCSRMatrix *P, hypre_double eps, hypre_double dlt, HYPRE_Int *CF_marker ); +void +hypre_BoomerAMGTruncateInterp_long_dbl( hypre_ParCSRMatrix *P, hypre_long_double eps, hypre_long_double dlt, HYPRE_Int *CF_marker ); + +HYPRE_Int +hypre_BoomerAMGWriteSolverParams_flt( void *data ); +HYPRE_Int +hypre_BoomerAMGWriteSolverParams_dbl( void *data ); +HYPRE_Int +hypre_BoomerAMGWriteSolverParams_long_dbl( void *data ); + +HYPRE_Int +hypre_BoomerAMG_GMExpandInterp_flt( 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_float abs_trunc, hypre_float *weights, HYPRE_Int q_max, HYPRE_Int *CF_marker, HYPRE_Int interp_vec_first_level ); +HYPRE_Int +hypre_BoomerAMG_GMExpandInterp_dbl( 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_double abs_trunc, hypre_double *weights, HYPRE_Int q_max, HYPRE_Int *CF_marker, HYPRE_Int interp_vec_first_level ); +HYPRE_Int +hypre_BoomerAMG_GMExpandInterp_long_dbl( 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_long_double abs_trunc, hypre_long_double *weights, HYPRE_Int q_max, HYPRE_Int *CF_marker, HYPRE_Int interp_vec_first_level ); + +HYPRE_Int +hypre_BoomerAMG_LNExpandInterp_flt( 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_float *weights, HYPRE_Int num_smooth_vecs, hypre_ParVector **smooth_vecs, hypre_float abs_trunc, HYPRE_Int q_max, HYPRE_Int interp_vec_first_level ); +HYPRE_Int +hypre_BoomerAMG_LNExpandInterp_dbl( 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_double *weights, HYPRE_Int num_smooth_vecs, hypre_ParVector **smooth_vecs, hypre_double abs_trunc, HYPRE_Int q_max, HYPRE_Int interp_vec_first_level ); +HYPRE_Int +hypre_BoomerAMG_LNExpandInterp_long_dbl( 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_long_double *weights, HYPRE_Int num_smooth_vecs, hypre_ParVector **smooth_vecs, hypre_long_double abs_trunc, HYPRE_Int q_max, HYPRE_Int interp_vec_first_level ); + +HYPRE_Int +hypre_BoomerAMG_MyCreateS_flt( hypre_ParCSRMatrix *A, hypre_float strength_threshold, hypre_float max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr ); +HYPRE_Int +hypre_BoomerAMG_MyCreateS_dbl( hypre_ParCSRMatrix *A, hypre_double strength_threshold, hypre_double max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr ); +HYPRE_Int +hypre_BoomerAMG_MyCreateS_long_dbl( hypre_ParCSRMatrix *A, hypre_long_double strength_threshold, hypre_long_double max_row_sum, HYPRE_Int num_functions, HYPRE_Int *dof_func, hypre_ParCSRMatrix **S_ptr ); + +HYPRE_Int +hypre_CSRMatrixDropInplace_flt( hypre_CSRMatrix *A, hypre_float droptol, HYPRE_Int max_row_nnz ); +HYPRE_Int +hypre_CSRMatrixDropInplace_dbl( hypre_CSRMatrix *A, hypre_double droptol, HYPRE_Int max_row_nnz ); +HYPRE_Int +hypre_CSRMatrixDropInplace_long_dbl( hypre_CSRMatrix *A, hypre_long_double droptol, HYPRE_Int max_row_nnz ); + +HYPRE_Int +hypre_CSRMatrixExtractDenseMat_flt( hypre_CSRMatrix *A, hypre_Vector *A_sub, HYPRE_Int *S_Pattern, HYPRE_Int S_nnz, HYPRE_Int *marker ); +HYPRE_Int +hypre_CSRMatrixExtractDenseMat_dbl( hypre_CSRMatrix *A, hypre_Vector *A_sub, HYPRE_Int *S_Pattern, HYPRE_Int S_nnz, HYPRE_Int *marker ); +HYPRE_Int +hypre_CSRMatrixExtractDenseMat_long_dbl( hypre_CSRMatrix *A, hypre_Vector *A_sub, HYPRE_Int *S_Pattern, HYPRE_Int S_nnz, HYPRE_Int *marker ); + +HYPRE_Int +hypre_CSRMatrixExtractDenseRow_flt( hypre_CSRMatrix *A, hypre_Vector *A_subrow, HYPRE_Int *marker, HYPRE_Int row_num ); +HYPRE_Int +hypre_CSRMatrixExtractDenseRow_dbl( hypre_CSRMatrix *A, hypre_Vector *A_subrow, HYPRE_Int *marker, HYPRE_Int row_num ); +HYPRE_Int +hypre_CSRMatrixExtractDenseRow_long_dbl( hypre_CSRMatrix *A, hypre_Vector *A_subrow, HYPRE_Int *marker, HYPRE_Int row_num ); + +HYPRE_Int +hypre_CSRMatrixNormFro_flt( hypre_CSRMatrix *A, hypre_float *norm_io ); +HYPRE_Int +hypre_CSRMatrixNormFro_dbl( hypre_CSRMatrix *A, hypre_double *norm_io ); +HYPRE_Int +hypre_CSRMatrixNormFro_long_dbl( hypre_CSRMatrix *A, hypre_long_double *norm_io ); + +HYPRE_Int +hypre_CSRMatrixResNormFro_flt( hypre_CSRMatrix *A, hypre_float *norm_io ); +HYPRE_Int +hypre_CSRMatrixResNormFro_dbl( hypre_CSRMatrix *A, hypre_double *norm_io ); +HYPRE_Int +hypre_CSRMatrixResNormFro_long_dbl( hypre_CSRMatrix *A, hypre_long_double *norm_io ); + +HYPRE_Int +hypre_CSRMatrixTrace_flt( hypre_CSRMatrix *A, hypre_float *trace_io ); +HYPRE_Int +hypre_CSRMatrixTrace_dbl( hypre_CSRMatrix *A, hypre_double *trace_io ); +HYPRE_Int +hypre_CSRMatrixTrace_long_dbl( hypre_CSRMatrix *A, hypre_long_double *trace_io ); + +hypre_ParCSRMatrix * +hypre_CreateC_flt( hypre_ParCSRMatrix *A, hypre_float w ); +hypre_ParCSRMatrix * +hypre_CreateC_dbl( hypre_ParCSRMatrix *A, hypre_double w ); +hypre_ParCSRMatrix * +hypre_CreateC_long_dbl( hypre_ParCSRMatrix *A, hypre_long_double w ); + +HYPRE_Int +hypre_CreateDinv_flt( void *amg_vdata ); +HYPRE_Int +hypre_CreateDinv_dbl( void *amg_vdata ); +HYPRE_Int +hypre_CreateDinv_long_dbl( void *amg_vdata ); + +HYPRE_Int +hypre_CreateLambda_flt( void *amg_vdata ); +HYPRE_Int +hypre_CreateLambda_dbl( void *amg_vdata ); +HYPRE_Int +hypre_CreateLambda_long_dbl( void *amg_vdata ); + +HYPRE_Int +hypre_FSAIApply_flt( void *fsai_vdata, hypre_float alpha, hypre_ParVector *b, hypre_ParVector *x ); +HYPRE_Int +hypre_FSAIApply_dbl( void *fsai_vdata, hypre_double alpha, hypre_ParVector *b, hypre_ParVector *x ); +HYPRE_Int +hypre_FSAIApply_long_dbl( void *fsai_vdata, hypre_long_double alpha, hypre_ParVector *b, hypre_ParVector *x ); + +HYPRE_Int +hypre_FSAIComputeOmega_flt( void *fsai_vdata, hypre_ParCSRMatrix *A ); +HYPRE_Int +hypre_FSAIComputeOmega_dbl( void *fsai_vdata, hypre_ParCSRMatrix *A ); +HYPRE_Int +hypre_FSAIComputeOmega_long_dbl( void *fsai_vdata, hypre_ParCSRMatrix *A ); + +void* +hypre_FSAICreate_flt( void ); +void* +hypre_FSAICreate_dbl( void ); +void* +hypre_FSAICreate_long_dbl( void ); + +HYPRE_Int +hypre_FSAIDestroy_flt( void *data ); +HYPRE_Int +hypre_FSAIDestroy_dbl( void *data ); +HYPRE_Int +hypre_FSAIDestroy_long_dbl( void *data ); + +HYPRE_Int +hypre_FSAIDumpLocalLSDense_flt( void *fsai_vdata, const char *filename, hypre_ParCSRMatrix *A ); +HYPRE_Int +hypre_FSAIDumpLocalLSDense_dbl( void *fsai_vdata, const char *filename, hypre_ParCSRMatrix *A ); +HYPRE_Int +hypre_FSAIDumpLocalLSDense_long_dbl( void *fsai_vdata, const char *filename, hypre_ParCSRMatrix *A ); + +HYPRE_Int +hypre_FSAIGetAlgoType_flt( void *data, HYPRE_Int *algo_type ); +HYPRE_Int +hypre_FSAIGetAlgoType_dbl( void *data, HYPRE_Int *algo_type ); +HYPRE_Int +hypre_FSAIGetAlgoType_long_dbl( void *data, HYPRE_Int *algo_type ); + +HYPRE_Int +hypre_FSAIGetEigMaxIters_flt( void *data, HYPRE_Int *eig_max_iters ); +HYPRE_Int +hypre_FSAIGetEigMaxIters_dbl( void *data, HYPRE_Int *eig_max_iters ); +HYPRE_Int +hypre_FSAIGetEigMaxIters_long_dbl( void *data, HYPRE_Int *eig_max_iters ); + +HYPRE_Int +hypre_FSAIGetKapTolerance_flt( void *data, hypre_float *kap_tolerance ); +HYPRE_Int +hypre_FSAIGetKapTolerance_dbl( void *data, hypre_double *kap_tolerance ); +HYPRE_Int +hypre_FSAIGetKapTolerance_long_dbl( void *data, hypre_long_double *kap_tolerance ); + +HYPRE_Int +hypre_FSAIGetLocalSolveType_flt( void *data, HYPRE_Int *local_solve_type ); +HYPRE_Int +hypre_FSAIGetLocalSolveType_dbl( void *data, HYPRE_Int *local_solve_type ); +HYPRE_Int +hypre_FSAIGetLocalSolveType_long_dbl( void *data, HYPRE_Int *local_solve_type ); + +HYPRE_Int +hypre_FSAIGetLogging_flt( void *data, HYPRE_Int *logging ); +HYPRE_Int +hypre_FSAIGetLogging_dbl( void *data, HYPRE_Int *logging ); +HYPRE_Int +hypre_FSAIGetLogging_long_dbl( void *data, HYPRE_Int *logging ); + +HYPRE_Int +hypre_FSAIGetMaxIterations_flt( void *data, HYPRE_Int *max_iterations ); +HYPRE_Int +hypre_FSAIGetMaxIterations_dbl( void *data, HYPRE_Int *max_iterations ); +HYPRE_Int +hypre_FSAIGetMaxIterations_long_dbl( void *data, HYPRE_Int *max_iterations ); + +HYPRE_Int +hypre_FSAIGetMaxNnzRow_flt( void *data, HYPRE_Int *max_nnz_row ); +HYPRE_Int +hypre_FSAIGetMaxNnzRow_dbl( void *data, HYPRE_Int *max_nnz_row ); +HYPRE_Int +hypre_FSAIGetMaxNnzRow_long_dbl( void *data, HYPRE_Int *max_nnz_row ); + +HYPRE_Int +hypre_FSAIGetMaxStepSize_flt( void *data, HYPRE_Int *max_step_size ); +HYPRE_Int +hypre_FSAIGetMaxStepSize_dbl( void *data, HYPRE_Int *max_step_size ); +HYPRE_Int +hypre_FSAIGetMaxStepSize_long_dbl( void *data, HYPRE_Int *max_step_size ); + +HYPRE_Int +hypre_FSAIGetMaxSteps_flt( void *data, HYPRE_Int *max_steps ); +HYPRE_Int +hypre_FSAIGetMaxSteps_dbl( void *data, HYPRE_Int *max_steps ); +HYPRE_Int +hypre_FSAIGetMaxSteps_long_dbl( void *data, HYPRE_Int *max_steps ); + +HYPRE_Int +hypre_FSAIGetNumIterations_flt( void *data, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_FSAIGetNumIterations_dbl( void *data, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_FSAIGetNumIterations_long_dbl( void *data, HYPRE_Int *num_iterations ); + +HYPRE_Int +hypre_FSAIGetNumLevels_flt( void *data, HYPRE_Int *num_levels ); +HYPRE_Int +hypre_FSAIGetNumLevels_dbl( void *data, HYPRE_Int *num_levels ); +HYPRE_Int +hypre_FSAIGetNumLevels_long_dbl( void *data, HYPRE_Int *num_levels ); + +HYPRE_Int +hypre_FSAIGetOmega_flt( void *data, hypre_float *omega ); +HYPRE_Int +hypre_FSAIGetOmega_dbl( void *data, hypre_double *omega ); +HYPRE_Int +hypre_FSAIGetOmega_long_dbl( void *data, hypre_long_double *omega ); + +HYPRE_Int +hypre_FSAIGetPrintLevel_flt( void *data, HYPRE_Int *print_level ); +HYPRE_Int +hypre_FSAIGetPrintLevel_dbl( void *data, HYPRE_Int *print_level ); +HYPRE_Int +hypre_FSAIGetPrintLevel_long_dbl( void *data, HYPRE_Int *print_level ); + +HYPRE_Int +hypre_FSAIGetThreshold_flt( void *data, hypre_float *threshold ); +HYPRE_Int +hypre_FSAIGetThreshold_dbl( void *data, hypre_double *threshold ); +HYPRE_Int +hypre_FSAIGetThreshold_long_dbl( void *data, hypre_long_double *threshold ); + +HYPRE_Int +hypre_FSAIGetTolerance_flt( void *data, hypre_float *tolerance ); +HYPRE_Int +hypre_FSAIGetTolerance_dbl( void *data, hypre_double *tolerance ); +HYPRE_Int +hypre_FSAIGetTolerance_long_dbl( void *data, hypre_long_double *tolerance ); + +HYPRE_Int +hypre_FSAIGetZeroGuess_flt( void *data, HYPRE_Int *zero_guess ); +HYPRE_Int +hypre_FSAIGetZeroGuess_dbl( void *data, HYPRE_Int *zero_guess ); +HYPRE_Int +hypre_FSAIGetZeroGuess_long_dbl( void *data, HYPRE_Int *zero_guess ); + +HYPRE_Int +hypre_FSAIPrintStats_flt( void *fsai_vdata, hypre_ParCSRMatrix *A ); +HYPRE_Int +hypre_FSAIPrintStats_dbl( void *fsai_vdata, hypre_ParCSRMatrix *A ); +HYPRE_Int +hypre_FSAIPrintStats_long_dbl( void *fsai_vdata, hypre_ParCSRMatrix *A ); + +HYPRE_Int +hypre_FSAISetAlgoType_flt( void *data, HYPRE_Int algo_type ); +HYPRE_Int +hypre_FSAISetAlgoType_dbl( void *data, HYPRE_Int algo_type ); +HYPRE_Int +hypre_FSAISetAlgoType_long_dbl( void *data, HYPRE_Int algo_type ); + +HYPRE_Int +hypre_FSAISetEigMaxIters_flt( void *data, HYPRE_Int eig_max_iters ); +HYPRE_Int +hypre_FSAISetEigMaxIters_dbl( void *data, HYPRE_Int eig_max_iters ); +HYPRE_Int +hypre_FSAISetEigMaxIters_long_dbl( void *data, HYPRE_Int eig_max_iters ); + +HYPRE_Int +hypre_FSAISetKapTolerance_flt( void *data, hypre_float kap_tolerance ); +HYPRE_Int +hypre_FSAISetKapTolerance_dbl( void *data, hypre_double kap_tolerance ); +HYPRE_Int +hypre_FSAISetKapTolerance_long_dbl( void *data, hypre_long_double kap_tolerance ); + +HYPRE_Int +hypre_FSAISetLocalSolveType_flt( void *data, HYPRE_Int local_solve_type ); +HYPRE_Int +hypre_FSAISetLocalSolveType_dbl( void *data, HYPRE_Int local_solve_type ); +HYPRE_Int +hypre_FSAISetLocalSolveType_long_dbl( void *data, HYPRE_Int local_solve_type ); + +HYPRE_Int +hypre_FSAISetLogging_flt( void *data, HYPRE_Int logging ); +HYPRE_Int +hypre_FSAISetLogging_dbl( void *data, HYPRE_Int logging ); +HYPRE_Int +hypre_FSAISetLogging_long_dbl( void *data, HYPRE_Int logging ); + +HYPRE_Int +hypre_FSAISetMaxIterations_flt( void *data, HYPRE_Int max_iterations ); +HYPRE_Int +hypre_FSAISetMaxIterations_dbl( void *data, HYPRE_Int max_iterations ); +HYPRE_Int +hypre_FSAISetMaxIterations_long_dbl( void *data, HYPRE_Int max_iterations ); + +HYPRE_Int +hypre_FSAISetMaxNnzRow_flt( void *data, HYPRE_Int max_nnz_row ); +HYPRE_Int +hypre_FSAISetMaxNnzRow_dbl( void *data, HYPRE_Int max_nnz_row ); +HYPRE_Int +hypre_FSAISetMaxNnzRow_long_dbl( void *data, HYPRE_Int max_nnz_row ); + +HYPRE_Int +hypre_FSAISetMaxStepSize_flt( void *data, HYPRE_Int max_step_size ); +HYPRE_Int +hypre_FSAISetMaxStepSize_dbl( void *data, HYPRE_Int max_step_size ); +HYPRE_Int +hypre_FSAISetMaxStepSize_long_dbl( void *data, HYPRE_Int max_step_size ); + +HYPRE_Int +hypre_FSAISetMaxSteps_flt( void *data, HYPRE_Int max_steps ); +HYPRE_Int +hypre_FSAISetMaxSteps_dbl( void *data, HYPRE_Int max_steps ); +HYPRE_Int +hypre_FSAISetMaxSteps_long_dbl( void *data, HYPRE_Int max_steps ); + +HYPRE_Int +hypre_FSAISetNumIterations_flt( void *data, HYPRE_Int num_iterations ); +HYPRE_Int +hypre_FSAISetNumIterations_dbl( void *data, HYPRE_Int num_iterations ); +HYPRE_Int +hypre_FSAISetNumIterations_long_dbl( void *data, HYPRE_Int num_iterations ); + +HYPRE_Int +hypre_FSAISetNumLevels_flt( void *data, HYPRE_Int num_levels ); +HYPRE_Int +hypre_FSAISetNumLevels_dbl( void *data, HYPRE_Int num_levels ); +HYPRE_Int +hypre_FSAISetNumLevels_long_dbl( void *data, HYPRE_Int num_levels ); + +HYPRE_Int +hypre_FSAISetOmega_flt( void *data, hypre_float omega ); +HYPRE_Int +hypre_FSAISetOmega_dbl( void *data, hypre_double omega ); +HYPRE_Int +hypre_FSAISetOmega_long_dbl( void *data, hypre_long_double omega ); + +HYPRE_Int +hypre_FSAISetPrintLevel_flt( void *data, HYPRE_Int print_level ); +HYPRE_Int +hypre_FSAISetPrintLevel_dbl( void *data, HYPRE_Int print_level ); +HYPRE_Int +hypre_FSAISetPrintLevel_long_dbl( void *data, HYPRE_Int print_level ); + +HYPRE_Int +hypre_FSAISetThreshold_flt( void *data, hypre_float threshold ); +HYPRE_Int +hypre_FSAISetThreshold_dbl( void *data, hypre_double threshold ); +HYPRE_Int +hypre_FSAISetThreshold_long_dbl( void *data, hypre_long_double threshold ); + +HYPRE_Int +hypre_FSAISetTolerance_flt( void *data, hypre_float tolerance ); +HYPRE_Int +hypre_FSAISetTolerance_dbl( void *data, hypre_double tolerance ); +HYPRE_Int +hypre_FSAISetTolerance_long_dbl( void *data, hypre_long_double tolerance ); + +HYPRE_Int +hypre_FSAISetZeroGuess_flt( void *data, HYPRE_Int zero_guess ); +HYPRE_Int +hypre_FSAISetZeroGuess_dbl( void *data, HYPRE_Int zero_guess ); +HYPRE_Int +hypre_FSAISetZeroGuess_long_dbl( void *data, HYPRE_Int zero_guess ); + +HYPRE_Int +hypre_FSAISetup_flt( void *fsai_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_FSAISetup_dbl( void *fsai_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_FSAISetup_long_dbl( void *fsai_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); + +HYPRE_Int +hypre_FSAISetupNative_flt( void *fsai_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_FSAISetupNative_dbl( void *fsai_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_FSAISetupNative_long_dbl( void *fsai_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); + +HYPRE_Int +hypre_FSAISetupOMPDyn_flt( void *fsai_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_FSAISetupOMPDyn_dbl( void *fsai_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_FSAISetupOMPDyn_long_dbl( void *fsai_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); + +HYPRE_Int +hypre_FSAISolve_flt( void *fsai_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); +HYPRE_Int +hypre_FSAISolve_dbl( void *fsai_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); +HYPRE_Int +hypre_FSAISolve_long_dbl( void *fsai_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ); + +HYPRE_Int +hypre_FindKapGrad_flt( 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_FindKapGrad_dbl( 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_FindKapGrad_long_dbl( 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_GaussElimSetup_flt( hypre_ParAMGData *amg_data, HYPRE_Int level, HYPRE_Int solver_type ); +HYPRE_Int +hypre_GaussElimSetup_dbl( hypre_ParAMGData *amg_data, HYPRE_Int level, HYPRE_Int solver_type ); +HYPRE_Int +hypre_GaussElimSetup_long_dbl( hypre_ParAMGData *amg_data, HYPRE_Int level, HYPRE_Int solver_type ); + +HYPRE_Int +hypre_GaussElimSolve_flt( hypre_ParAMGData *amg_data, HYPRE_Int level, HYPRE_Int solver_type ); +HYPRE_Int +hypre_GaussElimSolve_dbl( hypre_ParAMGData *amg_data, HYPRE_Int level, HYPRE_Int solver_type ); +HYPRE_Int +hypre_GaussElimSolve_long_dbl( hypre_ParAMGData *amg_data, HYPRE_Int level, HYPRE_Int solver_type ); + +HYPRE_Int +hypre_GenerateMultiPi_flt( 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_GenerateMultiPi_dbl( 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_GenerateMultiPi_long_dbl( 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_GenerateMultipassPi_flt( 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_float *row_sums, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_GenerateMultipassPi_dbl( 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_double *row_sums, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_GenerateMultipassPi_long_dbl( 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_long_double *row_sums, hypre_ParCSRMatrix **P_ptr ); + +HYPRE_Int +hypre_GenerateScale_flt( hypre_CSRMatrix *domain_structure, HYPRE_Int num_variables, hypre_float relaxation_weight, hypre_float **scale_pointer ); +HYPRE_Int +hypre_GenerateScale_dbl( hypre_CSRMatrix *domain_structure, HYPRE_Int num_variables, hypre_double relaxation_weight, hypre_double **scale_pointer ); +HYPRE_Int +hypre_GenerateScale_long_dbl( hypre_CSRMatrix *domain_structure, HYPRE_Int num_variables, hypre_long_double relaxation_weight, hypre_long_double **scale_pointer ); + +HYPRE_Int +hypre_GenerateSendMapAndCommPkg_flt( 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_GenerateSendMapAndCommPkg_dbl( 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_GenerateSendMapAndCommPkg_long_dbl( 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_GenerateSubComm_flt( MPI_Comm comm, HYPRE_Int participate, MPI_Comm *new_comm_ptr ); +HYPRE_Int +hypre_GenerateSubComm_dbl( MPI_Comm comm, HYPRE_Int participate, MPI_Comm *new_comm_ptr ); +HYPRE_Int +hypre_GenerateSubComm_long_dbl( MPI_Comm comm, HYPRE_Int participate, MPI_Comm *new_comm_ptr ); + +HYPRE_Int +hypre_GetCommPkgRTFromCommPkgA_flt( hypre_ParCSRMatrix *RT, hypre_ParCSRMatrix *A, HYPRE_Int *fine_to_coarse, HYPRE_Int *tmp_map_offd ); +HYPRE_Int +hypre_GetCommPkgRTFromCommPkgA_dbl( hypre_ParCSRMatrix *RT, hypre_ParCSRMatrix *A, HYPRE_Int *fine_to_coarse, HYPRE_Int *tmp_map_offd ); +HYPRE_Int +hypre_GetCommPkgRTFromCommPkgA_long_dbl( hypre_ParCSRMatrix *RT, hypre_ParCSRMatrix *A, HYPRE_Int *fine_to_coarse, HYPRE_Int *tmp_map_offd ); + +HYPRE_Int +hypre_GrabSubArray_flt( HYPRE_Int *indices, HYPRE_Int start, HYPRE_Int end, HYPRE_BigInt *array, HYPRE_BigInt *output ); +HYPRE_Int +hypre_GrabSubArray_dbl( HYPRE_Int *indices, HYPRE_Int start, HYPRE_Int end, HYPRE_BigInt *array, HYPRE_BigInt *output ); +HYPRE_Int +hypre_GrabSubArray_long_dbl( HYPRE_Int *indices, HYPRE_Int start, HYPRE_Int end, HYPRE_BigInt *array, HYPRE_BigInt *output ); + +HYPRE_Int +hypre_GraphAdd_flt( Link *list, HYPRE_Int *head, HYPRE_Int *tail, HYPRE_Int index, HYPRE_Int istack ); +HYPRE_Int +hypre_GraphAdd_dbl( Link *list, HYPRE_Int *head, HYPRE_Int *tail, HYPRE_Int index, HYPRE_Int istack ); +HYPRE_Int +hypre_GraphAdd_long_dbl( Link *list, HYPRE_Int *head, HYPRE_Int *tail, HYPRE_Int index, HYPRE_Int istack ); + +HYPRE_Int +hypre_GraphRemove_flt( Link *list, HYPRE_Int *head, HYPRE_Int *tail, HYPRE_Int index ); +HYPRE_Int +hypre_GraphRemove_dbl( Link *list, HYPRE_Int *head, HYPRE_Int *tail, HYPRE_Int index ); +HYPRE_Int +hypre_GraphRemove_long_dbl( Link *list, HYPRE_Int *head, HYPRE_Int *tail, HYPRE_Int index ); + +HYPRE_Int +hypre_ILUBuildRASExternalMatrix_flt( hypre_ParCSRMatrix *A, HYPRE_Int *rperm, HYPRE_Int **E_i, HYPRE_Int **E_j, hypre_float **E_data ); +HYPRE_Int +hypre_ILUBuildRASExternalMatrix_dbl( hypre_ParCSRMatrix *A, HYPRE_Int *rperm, HYPRE_Int **E_i, HYPRE_Int **E_j, hypre_double **E_data ); +HYPRE_Int +hypre_ILUBuildRASExternalMatrix_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int *rperm, HYPRE_Int **E_i, HYPRE_Int **E_j, hypre_long_double **E_data ); + +HYPRE_Int +hypre_ILUCSRMatrixInverseSelfPrecondMRGlobal_flt( hypre_CSRMatrix *matA, hypre_CSRMatrix **M, hypre_float droptol, hypre_float tol, hypre_float eps_tol, HYPRE_Int max_row_nnz, HYPRE_Int max_iter, HYPRE_Int print_level ); +HYPRE_Int +hypre_ILUCSRMatrixInverseSelfPrecondMRGlobal_dbl( hypre_CSRMatrix *matA, hypre_CSRMatrix **M, hypre_double droptol, hypre_double tol, hypre_double eps_tol, HYPRE_Int max_row_nnz, HYPRE_Int max_iter, HYPRE_Int print_level ); +HYPRE_Int +hypre_ILUCSRMatrixInverseSelfPrecondMRGlobal_long_dbl( hypre_CSRMatrix *matA, hypre_CSRMatrix **M, hypre_long_double droptol, hypre_long_double tol, hypre_long_double eps_tol, HYPRE_Int max_row_nnz, HYPRE_Int max_iter, HYPRE_Int print_level ); + +void * +hypre_ILUCreate_flt( void ); +void * +hypre_ILUCreate_dbl( void ); +void * +hypre_ILUCreate_long_dbl( void ); + +HYPRE_Int +hypre_ILUDestroy_flt( void *ilu_vdata ); +HYPRE_Int +hypre_ILUDestroy_dbl( void *ilu_vdata ); +HYPRE_Int +hypre_ILUDestroy_long_dbl( void *ilu_vdata ); + +HYPRE_Int +hypre_ILUGetFinalRelativeResidualNorm_flt( void *ilu_vdata, hypre_float *res_norm ); +HYPRE_Int +hypre_ILUGetFinalRelativeResidualNorm_dbl( void *ilu_vdata, hypre_double *res_norm ); +HYPRE_Int +hypre_ILUGetFinalRelativeResidualNorm_long_dbl( void *ilu_vdata, hypre_long_double *res_norm ); + +HYPRE_Int +hypre_ILUGetInteriorExteriorPerm_flt( hypre_ParCSRMatrix *A, HYPRE_MemoryLocation memory_location, HYPRE_Int **perm, HYPRE_Int *nLU, HYPRE_Int reordering_type ); +HYPRE_Int +hypre_ILUGetInteriorExteriorPerm_dbl( hypre_ParCSRMatrix *A, HYPRE_MemoryLocation memory_location, HYPRE_Int **perm, HYPRE_Int *nLU, HYPRE_Int reordering_type ); +HYPRE_Int +hypre_ILUGetInteriorExteriorPerm_long_dbl( hypre_ParCSRMatrix *A, HYPRE_MemoryLocation memory_location, HYPRE_Int **perm, HYPRE_Int *nLU, HYPRE_Int reordering_type ); + +HYPRE_Int +hypre_ILUGetIterativeSetupHistory_flt( void *ilu_vdata, hypre_float **iter_setup_history ); +HYPRE_Int +hypre_ILUGetIterativeSetupHistory_dbl( void *ilu_vdata, hypre_double **iter_setup_history ); +HYPRE_Int +hypre_ILUGetIterativeSetupHistory_long_dbl( void *ilu_vdata, hypre_long_double **iter_setup_history ); + +HYPRE_Int +hypre_ILUGetLocalPerm_flt( hypre_ParCSRMatrix *A, HYPRE_Int **perm_ptr, HYPRE_Int *nLU, HYPRE_Int reordering_type ); +HYPRE_Int +hypre_ILUGetLocalPerm_dbl( hypre_ParCSRMatrix *A, HYPRE_Int **perm_ptr, HYPRE_Int *nLU, HYPRE_Int reordering_type ); +HYPRE_Int +hypre_ILUGetLocalPerm_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int **perm_ptr, HYPRE_Int *nLU, HYPRE_Int reordering_type ); + +HYPRE_Int +hypre_ILUGetNumIterations_flt( void *ilu_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_ILUGetNumIterations_dbl( void *ilu_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_ILUGetNumIterations_long_dbl( void *ilu_vdata, HYPRE_Int *num_iterations ); + +HYPRE_Int +hypre_ILUGetPermddPQ_flt( hypre_ParCSRMatrix *A, HYPRE_Int **io_pperm, HYPRE_Int **io_qperm, hypre_float tol, HYPRE_Int *nB, HYPRE_Int *nI, HYPRE_Int reordering_type ); +HYPRE_Int +hypre_ILUGetPermddPQ_dbl( hypre_ParCSRMatrix *A, HYPRE_Int **io_pperm, HYPRE_Int **io_qperm, hypre_double tol, HYPRE_Int *nB, HYPRE_Int *nI, HYPRE_Int reordering_type ); +HYPRE_Int +hypre_ILUGetPermddPQ_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int **io_pperm, HYPRE_Int **io_qperm, hypre_long_double tol, HYPRE_Int *nB, HYPRE_Int *nI, HYPRE_Int reordering_type ); + +HYPRE_Int +hypre_ILUGetPermddPQPre_flt( HYPRE_Int n, HYPRE_Int nLU, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j, hypre_float *A_diag_data, hypre_float tol, HYPRE_Int *perm, HYPRE_Int *rperm, HYPRE_Int *pperm_pre, HYPRE_Int *qperm_pre, HYPRE_Int *nB ); +HYPRE_Int +hypre_ILUGetPermddPQPre_dbl( HYPRE_Int n, HYPRE_Int nLU, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j, hypre_double *A_diag_data, hypre_double tol, HYPRE_Int *perm, HYPRE_Int *rperm, HYPRE_Int *pperm_pre, HYPRE_Int *qperm_pre, HYPRE_Int *nB ); +HYPRE_Int +hypre_ILUGetPermddPQPre_long_dbl( HYPRE_Int n, HYPRE_Int nLU, HYPRE_Int *A_diag_i, HYPRE_Int *A_diag_j, hypre_long_double *A_diag_data, hypre_long_double tol, HYPRE_Int *perm, HYPRE_Int *rperm, HYPRE_Int *pperm_pre, HYPRE_Int *qperm_pre, HYPRE_Int *nB ); + +HYPRE_Int +hypre_ILULocalRCM_flt( hypre_CSRMatrix *A, HYPRE_Int start, HYPRE_Int end, HYPRE_Int **permp, HYPRE_Int **qpermp, HYPRE_Int sym ); +HYPRE_Int +hypre_ILULocalRCM_dbl( hypre_CSRMatrix *A, HYPRE_Int start, HYPRE_Int end, HYPRE_Int **permp, HYPRE_Int **qpermp, HYPRE_Int sym ); +HYPRE_Int +hypre_ILULocalRCM_long_dbl( hypre_CSRMatrix *A, HYPRE_Int start, HYPRE_Int end, HYPRE_Int **permp, HYPRE_Int **qpermp, HYPRE_Int sym ); + +HYPRE_Int +hypre_ILULocalRCMBuildFinalPerm_flt( 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_ILULocalRCMBuildFinalPerm_dbl( 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_ILULocalRCMBuildFinalPerm_long_dbl( 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_ILULocalRCMBuildLevel_flt( hypre_CSRMatrix *A, HYPRE_Int root, HYPRE_Int *marker, HYPRE_Int *level_i, HYPRE_Int *level_j, HYPRE_Int *nlevp ); +HYPRE_Int +hypre_ILULocalRCMBuildLevel_dbl( hypre_CSRMatrix *A, HYPRE_Int root, HYPRE_Int *marker, HYPRE_Int *level_i, HYPRE_Int *level_j, HYPRE_Int *nlevp ); +HYPRE_Int +hypre_ILULocalRCMBuildLevel_long_dbl( hypre_CSRMatrix *A, HYPRE_Int root, HYPRE_Int *marker, HYPRE_Int *level_i, HYPRE_Int *level_j, HYPRE_Int *nlevp ); + +HYPRE_Int +hypre_ILULocalRCMFindPPNode_flt( hypre_CSRMatrix *A, HYPRE_Int *rootp, HYPRE_Int *marker ); +HYPRE_Int +hypre_ILULocalRCMFindPPNode_dbl( hypre_CSRMatrix *A, HYPRE_Int *rootp, HYPRE_Int *marker ); +HYPRE_Int +hypre_ILULocalRCMFindPPNode_long_dbl( hypre_CSRMatrix *A, HYPRE_Int *rootp, HYPRE_Int *marker ); + +HYPRE_Int +hypre_ILULocalRCMMindegree_flt( HYPRE_Int n, HYPRE_Int *degree, HYPRE_Int *marker, HYPRE_Int *rootp ); +HYPRE_Int +hypre_ILULocalRCMMindegree_dbl( HYPRE_Int n, HYPRE_Int *degree, HYPRE_Int *marker, HYPRE_Int *rootp ); +HYPRE_Int +hypre_ILULocalRCMMindegree_long_dbl( HYPRE_Int n, HYPRE_Int *degree, HYPRE_Int *marker, HYPRE_Int *rootp ); + +HYPRE_Int +hypre_ILULocalRCMNumbering_flt( hypre_CSRMatrix *A, HYPRE_Int root, HYPRE_Int *marker, HYPRE_Int *perm, HYPRE_Int *current_nump ); +HYPRE_Int +hypre_ILULocalRCMNumbering_dbl( hypre_CSRMatrix *A, HYPRE_Int root, HYPRE_Int *marker, HYPRE_Int *perm, HYPRE_Int *current_nump ); +HYPRE_Int +hypre_ILULocalRCMNumbering_long_dbl( hypre_CSRMatrix *A, HYPRE_Int root, HYPRE_Int *marker, HYPRE_Int *perm, HYPRE_Int *current_nump ); + +HYPRE_Int +hypre_ILULocalRCMOrder_flt( hypre_CSRMatrix *A, HYPRE_Int *perm ); +HYPRE_Int +hypre_ILULocalRCMOrder_dbl( hypre_CSRMatrix *A, HYPRE_Int *perm ); +HYPRE_Int +hypre_ILULocalRCMOrder_long_dbl( hypre_CSRMatrix *A, HYPRE_Int *perm ); + +HYPRE_Int +hypre_ILULocalRCMQsort_flt( HYPRE_Int *perm, HYPRE_Int start, HYPRE_Int end, HYPRE_Int *degree ); +HYPRE_Int +hypre_ILULocalRCMQsort_dbl( HYPRE_Int *perm, HYPRE_Int start, HYPRE_Int end, HYPRE_Int *degree ); +HYPRE_Int +hypre_ILULocalRCMQsort_long_dbl( HYPRE_Int *perm, HYPRE_Int start, HYPRE_Int end, HYPRE_Int *degree ); + +HYPRE_Int +hypre_ILULocalRCMReverse_flt( HYPRE_Int *perm, HYPRE_Int start, HYPRE_Int end ); +HYPRE_Int +hypre_ILULocalRCMReverse_dbl( HYPRE_Int *perm, HYPRE_Int start, HYPRE_Int end ); +HYPRE_Int +hypre_ILULocalRCMReverse_long_dbl( HYPRE_Int *perm, HYPRE_Int start, HYPRE_Int end ); + +HYPRE_Int +hypre_ILUMaxQSplitRabsI_flt( hypre_float *arrayR, HYPRE_Int *arrayI, HYPRE_Int left, HYPRE_Int bound, HYPRE_Int right ); +HYPRE_Int +hypre_ILUMaxQSplitRabsI_dbl( hypre_double *arrayR, HYPRE_Int *arrayI, HYPRE_Int left, HYPRE_Int bound, HYPRE_Int right ); +HYPRE_Int +hypre_ILUMaxQSplitRabsI_long_dbl( hypre_long_double *arrayR, HYPRE_Int *arrayI, HYPRE_Int left, HYPRE_Int bound, HYPRE_Int right ); + +HYPRE_Int +hypre_ILUMaxRabs_flt( hypre_float *array_data, HYPRE_Int *array_j, HYPRE_Int start, HYPRE_Int end, HYPRE_Int nLU, HYPRE_Int *rperm, hypre_float *value, HYPRE_Int *index, hypre_float *l1_norm, HYPRE_Int *nnz ); +HYPRE_Int +hypre_ILUMaxRabs_dbl( hypre_double *array_data, HYPRE_Int *array_j, HYPRE_Int start, HYPRE_Int end, HYPRE_Int nLU, HYPRE_Int *rperm, hypre_double *value, HYPRE_Int *index, hypre_double *l1_norm, HYPRE_Int *nnz ); +HYPRE_Int +hypre_ILUMaxRabs_long_dbl( hypre_long_double *array_data, HYPRE_Int *array_j, HYPRE_Int start, HYPRE_Int end, HYPRE_Int nLU, HYPRE_Int *rperm, hypre_long_double *value, HYPRE_Int *index, hypre_long_double *l1_norm, HYPRE_Int *nnz ); + +HYPRE_Int +hypre_ILUMaxrHeapAddRabsI_flt( hypre_float *heap, HYPRE_Int *I1, HYPRE_Int len ); +HYPRE_Int +hypre_ILUMaxrHeapAddRabsI_dbl( hypre_double *heap, HYPRE_Int *I1, HYPRE_Int len ); +HYPRE_Int +hypre_ILUMaxrHeapAddRabsI_long_dbl( hypre_long_double *heap, HYPRE_Int *I1, HYPRE_Int len ); + +HYPRE_Int +hypre_ILUMaxrHeapRemoveRabsI_flt( hypre_float *heap, HYPRE_Int *I1, HYPRE_Int len ); +HYPRE_Int +hypre_ILUMaxrHeapRemoveRabsI_dbl( hypre_double *heap, HYPRE_Int *I1, HYPRE_Int len ); +HYPRE_Int +hypre_ILUMaxrHeapRemoveRabsI_long_dbl( hypre_long_double *heap, HYPRE_Int *I1, HYPRE_Int len ); + +HYPRE_Int +hypre_ILUMinHeapAddI_flt( HYPRE_Int *heap, HYPRE_Int len ); +HYPRE_Int +hypre_ILUMinHeapAddI_dbl( HYPRE_Int *heap, HYPRE_Int len ); +HYPRE_Int +hypre_ILUMinHeapAddI_long_dbl( HYPRE_Int *heap, HYPRE_Int len ); + +HYPRE_Int +hypre_ILUMinHeapAddIIIi_flt( HYPRE_Int *heap, HYPRE_Int *I1, HYPRE_Int *Ii1, HYPRE_Int len ); +HYPRE_Int +hypre_ILUMinHeapAddIIIi_dbl( HYPRE_Int *heap, HYPRE_Int *I1, HYPRE_Int *Ii1, HYPRE_Int len ); +HYPRE_Int +hypre_ILUMinHeapAddIIIi_long_dbl( HYPRE_Int *heap, HYPRE_Int *I1, HYPRE_Int *Ii1, HYPRE_Int len ); + +HYPRE_Int +hypre_ILUMinHeapAddIRIi_flt( HYPRE_Int *heap, hypre_float *I1, HYPRE_Int *Ii1, HYPRE_Int len ); +HYPRE_Int +hypre_ILUMinHeapAddIRIi_dbl( HYPRE_Int *heap, hypre_double *I1, HYPRE_Int *Ii1, HYPRE_Int len ); +HYPRE_Int +hypre_ILUMinHeapAddIRIi_long_dbl( HYPRE_Int *heap, hypre_long_double *I1, HYPRE_Int *Ii1, HYPRE_Int len ); + +HYPRE_Int +hypre_ILUMinHeapRemoveI_flt( HYPRE_Int *heap, HYPRE_Int len ); +HYPRE_Int +hypre_ILUMinHeapRemoveI_dbl( HYPRE_Int *heap, HYPRE_Int len ); +HYPRE_Int +hypre_ILUMinHeapRemoveI_long_dbl( HYPRE_Int *heap, HYPRE_Int len ); + +HYPRE_Int +hypre_ILUMinHeapRemoveIIIi_flt( HYPRE_Int *heap, HYPRE_Int *I1, HYPRE_Int *Ii1, HYPRE_Int len ); +HYPRE_Int +hypre_ILUMinHeapRemoveIIIi_dbl( HYPRE_Int *heap, HYPRE_Int *I1, HYPRE_Int *Ii1, HYPRE_Int len ); +HYPRE_Int +hypre_ILUMinHeapRemoveIIIi_long_dbl( HYPRE_Int *heap, HYPRE_Int *I1, HYPRE_Int *Ii1, HYPRE_Int len ); + +HYPRE_Int +hypre_ILUMinHeapRemoveIRIi_flt( HYPRE_Int *heap, hypre_float *I1, HYPRE_Int *Ii1, HYPRE_Int len ); +HYPRE_Int +hypre_ILUMinHeapRemoveIRIi_dbl( HYPRE_Int *heap, hypre_double *I1, HYPRE_Int *Ii1, HYPRE_Int len ); +HYPRE_Int +hypre_ILUMinHeapRemoveIRIi_long_dbl( HYPRE_Int *heap, hypre_long_double *I1, HYPRE_Int *Ii1, HYPRE_Int len ); + +HYPRE_Int +hypre_ILUParCSRInverseNSH_flt( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **M, hypre_float *droptol, hypre_float mr_tol, hypre_float nsh_tol, hypre_float 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_ILUParCSRInverseNSH_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **M, hypre_double *droptol, hypre_double mr_tol, hypre_double nsh_tol, hypre_double 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_ILUParCSRInverseNSH_long_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **M, hypre_long_double *droptol, hypre_long_double mr_tol, hypre_long_double nsh_tol, hypre_long_double 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_ILUSetDropThreshold_flt( void *ilu_vdata, hypre_float threshold ); +HYPRE_Int +hypre_ILUSetDropThreshold_dbl( void *ilu_vdata, hypre_double threshold ); +HYPRE_Int +hypre_ILUSetDropThreshold_long_dbl( void *ilu_vdata, hypre_long_double threshold ); + +HYPRE_Int +hypre_ILUSetDropThresholdArray_flt( void *ilu_vdata, hypre_float *threshold ); +HYPRE_Int +hypre_ILUSetDropThresholdArray_dbl( void *ilu_vdata, hypre_double *threshold ); +HYPRE_Int +hypre_ILUSetDropThresholdArray_long_dbl( void *ilu_vdata, hypre_long_double *threshold ); + +HYPRE_Int +hypre_ILUSetIterativeSetupMaxIter_flt( void *ilu_vdata, HYPRE_Int iter_setup_max_iter ); +HYPRE_Int +hypre_ILUSetIterativeSetupMaxIter_dbl( void *ilu_vdata, HYPRE_Int iter_setup_max_iter ); +HYPRE_Int +hypre_ILUSetIterativeSetupMaxIter_long_dbl( void *ilu_vdata, HYPRE_Int iter_setup_max_iter ); + +HYPRE_Int +hypre_ILUSetIterativeSetupOption_flt( void *ilu_vdata, HYPRE_Int iter_setup_option ); +HYPRE_Int +hypre_ILUSetIterativeSetupOption_dbl( void *ilu_vdata, HYPRE_Int iter_setup_option ); +HYPRE_Int +hypre_ILUSetIterativeSetupOption_long_dbl( void *ilu_vdata, HYPRE_Int iter_setup_option ); + +HYPRE_Int +hypre_ILUSetIterativeSetupTolerance_flt( void *ilu_vdata, hypre_float iter_setup_tolerance ); +HYPRE_Int +hypre_ILUSetIterativeSetupTolerance_dbl( void *ilu_vdata, hypre_double iter_setup_tolerance ); +HYPRE_Int +hypre_ILUSetIterativeSetupTolerance_long_dbl( void *ilu_vdata, hypre_long_double iter_setup_tolerance ); + +HYPRE_Int +hypre_ILUSetIterativeSetupType_flt( void *ilu_vdata, HYPRE_Int iter_setup_type ); +HYPRE_Int +hypre_ILUSetIterativeSetupType_dbl( void *ilu_vdata, HYPRE_Int iter_setup_type ); +HYPRE_Int +hypre_ILUSetIterativeSetupType_long_dbl( void *ilu_vdata, HYPRE_Int iter_setup_type ); + +HYPRE_Int +hypre_ILUSetLevelOfFill_flt( void *ilu_vdata, HYPRE_Int lfil ); +HYPRE_Int +hypre_ILUSetLevelOfFill_dbl( void *ilu_vdata, HYPRE_Int lfil ); +HYPRE_Int +hypre_ILUSetLevelOfFill_long_dbl( void *ilu_vdata, HYPRE_Int lfil ); + +HYPRE_Int +hypre_ILUSetLocalReordering_flt( void *ilu_vdata, HYPRE_Int ordering_type ); +HYPRE_Int +hypre_ILUSetLocalReordering_dbl( void *ilu_vdata, HYPRE_Int ordering_type ); +HYPRE_Int +hypre_ILUSetLocalReordering_long_dbl( void *ilu_vdata, HYPRE_Int ordering_type ); + +HYPRE_Int +hypre_ILUSetLogging_flt( void *ilu_vdata, HYPRE_Int logging ); +HYPRE_Int +hypre_ILUSetLogging_dbl( void *ilu_vdata, HYPRE_Int logging ); +HYPRE_Int +hypre_ILUSetLogging_long_dbl( void *ilu_vdata, HYPRE_Int logging ); + +HYPRE_Int +hypre_ILUSetLowerJacobiIters_flt( void *ilu_vdata, HYPRE_Int lower_jacobi_iters ); +HYPRE_Int +hypre_ILUSetLowerJacobiIters_dbl( void *ilu_vdata, HYPRE_Int lower_jacobi_iters ); +HYPRE_Int +hypre_ILUSetLowerJacobiIters_long_dbl( void *ilu_vdata, HYPRE_Int lower_jacobi_iters ); + +HYPRE_Int +hypre_ILUSetMaxIter_flt( void *ilu_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_ILUSetMaxIter_dbl( void *ilu_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_ILUSetMaxIter_long_dbl( void *ilu_vdata, HYPRE_Int max_iter ); + +HYPRE_Int +hypre_ILUSetMaxNnzPerRow_flt( void *ilu_vdata, HYPRE_Int nzmax ); +HYPRE_Int +hypre_ILUSetMaxNnzPerRow_dbl( void *ilu_vdata, HYPRE_Int nzmax ); +HYPRE_Int +hypre_ILUSetMaxNnzPerRow_long_dbl( void *ilu_vdata, HYPRE_Int nzmax ); + +HYPRE_Int +hypre_ILUSetPrintLevel_flt( void *ilu_vdata, HYPRE_Int print_level ); +HYPRE_Int +hypre_ILUSetPrintLevel_dbl( void *ilu_vdata, HYPRE_Int print_level ); +HYPRE_Int +hypre_ILUSetPrintLevel_long_dbl( void *ilu_vdata, HYPRE_Int print_level ); + +HYPRE_Int +hypre_ILUSetSchurNSHDropThreshold_flt( void *ilu_vdata, hypre_float threshold ); +HYPRE_Int +hypre_ILUSetSchurNSHDropThreshold_dbl( void *ilu_vdata, hypre_double threshold ); +HYPRE_Int +hypre_ILUSetSchurNSHDropThreshold_long_dbl( void *ilu_vdata, hypre_long_double threshold ); + +HYPRE_Int +hypre_ILUSetSchurNSHDropThresholdArray_flt( void *ilu_vdata, hypre_float *threshold ); +HYPRE_Int +hypre_ILUSetSchurNSHDropThresholdArray_dbl( void *ilu_vdata, hypre_double *threshold ); +HYPRE_Int +hypre_ILUSetSchurNSHDropThresholdArray_long_dbl( void *ilu_vdata, hypre_long_double *threshold ); + +HYPRE_Int +hypre_ILUSetSchurPrecondILUDropThreshold_flt( void *ilu_vdata, hypre_float sp_ilu_droptol ); +HYPRE_Int +hypre_ILUSetSchurPrecondILUDropThreshold_dbl( void *ilu_vdata, hypre_double sp_ilu_droptol ); +HYPRE_Int +hypre_ILUSetSchurPrecondILUDropThreshold_long_dbl( void *ilu_vdata, hypre_long_double sp_ilu_droptol ); + +HYPRE_Int +hypre_ILUSetSchurPrecondILUDropThresholdArray_flt( void *ilu_vdata, hypre_float *sp_ilu_droptol ); +HYPRE_Int +hypre_ILUSetSchurPrecondILUDropThresholdArray_dbl( void *ilu_vdata, hypre_double *sp_ilu_droptol ); +HYPRE_Int +hypre_ILUSetSchurPrecondILUDropThresholdArray_long_dbl( void *ilu_vdata, hypre_long_double *sp_ilu_droptol ); + +HYPRE_Int +hypre_ILUSetSchurPrecondILULevelOfFill_flt( void *ilu_vdata, HYPRE_Int sp_ilu_lfil ); +HYPRE_Int +hypre_ILUSetSchurPrecondILULevelOfFill_dbl( void *ilu_vdata, HYPRE_Int sp_ilu_lfil ); +HYPRE_Int +hypre_ILUSetSchurPrecondILULevelOfFill_long_dbl( void *ilu_vdata, HYPRE_Int sp_ilu_lfil ); + +HYPRE_Int +hypre_ILUSetSchurPrecondILUMaxNnzPerRow_flt( void *ilu_vdata, HYPRE_Int sp_ilu_max_row_nnz ); +HYPRE_Int +hypre_ILUSetSchurPrecondILUMaxNnzPerRow_dbl( void *ilu_vdata, HYPRE_Int sp_ilu_max_row_nnz ); +HYPRE_Int +hypre_ILUSetSchurPrecondILUMaxNnzPerRow_long_dbl( void *ilu_vdata, HYPRE_Int sp_ilu_max_row_nnz ); + +HYPRE_Int +hypre_ILUSetSchurPrecondILUType_flt( void *ilu_vdata, HYPRE_Int sp_ilu_type ); +HYPRE_Int +hypre_ILUSetSchurPrecondILUType_dbl( void *ilu_vdata, HYPRE_Int sp_ilu_type ); +HYPRE_Int +hypre_ILUSetSchurPrecondILUType_long_dbl( void *ilu_vdata, HYPRE_Int sp_ilu_type ); + +HYPRE_Int +hypre_ILUSetSchurPrecondLowerJacobiIters_flt( void *ilu_vdata, HYPRE_Int sp_lower_jacobi_iters ); +HYPRE_Int +hypre_ILUSetSchurPrecondLowerJacobiIters_dbl( void *ilu_vdata, HYPRE_Int sp_lower_jacobi_iters ); +HYPRE_Int +hypre_ILUSetSchurPrecondLowerJacobiIters_long_dbl( void *ilu_vdata, HYPRE_Int sp_lower_jacobi_iters ); + +HYPRE_Int +hypre_ILUSetSchurPrecondMaxIter_flt( void *ilu_vdata, HYPRE_Int sp_max_iter ); +HYPRE_Int +hypre_ILUSetSchurPrecondMaxIter_dbl( void *ilu_vdata, HYPRE_Int sp_max_iter ); +HYPRE_Int +hypre_ILUSetSchurPrecondMaxIter_long_dbl( void *ilu_vdata, HYPRE_Int sp_max_iter ); + +HYPRE_Int +hypre_ILUSetSchurPrecondPrintLevel_flt( void *ilu_vdata, HYPRE_Int sp_print_level ); +HYPRE_Int +hypre_ILUSetSchurPrecondPrintLevel_dbl( void *ilu_vdata, HYPRE_Int sp_print_level ); +HYPRE_Int +hypre_ILUSetSchurPrecondPrintLevel_long_dbl( void *ilu_vdata, HYPRE_Int sp_print_level ); + +HYPRE_Int +hypre_ILUSetSchurPrecondTol_flt( void *ilu_vdata, HYPRE_Int sp_tol ); +HYPRE_Int +hypre_ILUSetSchurPrecondTol_dbl( void *ilu_vdata, HYPRE_Int sp_tol ); +HYPRE_Int +hypre_ILUSetSchurPrecondTol_long_dbl( void *ilu_vdata, HYPRE_Int sp_tol ); + +HYPRE_Int +hypre_ILUSetSchurPrecondTriSolve_flt( void *ilu_vdata, HYPRE_Int sp_tri_solve ); +HYPRE_Int +hypre_ILUSetSchurPrecondTriSolve_dbl( void *ilu_vdata, HYPRE_Int sp_tri_solve ); +HYPRE_Int +hypre_ILUSetSchurPrecondTriSolve_long_dbl( void *ilu_vdata, HYPRE_Int sp_tri_solve ); + +HYPRE_Int +hypre_ILUSetSchurPrecondUpperJacobiIters_flt( void *ilu_vdata, HYPRE_Int sp_upper_jacobi_iters ); +HYPRE_Int +hypre_ILUSetSchurPrecondUpperJacobiIters_dbl( void *ilu_vdata, HYPRE_Int sp_upper_jacobi_iters ); +HYPRE_Int +hypre_ILUSetSchurPrecondUpperJacobiIters_long_dbl( void *ilu_vdata, HYPRE_Int sp_upper_jacobi_iters ); + +HYPRE_Int +hypre_ILUSetSchurSolverAbsoluteTol_flt( void *ilu_vdata, hypre_float ss_absolute_tol ); +HYPRE_Int +hypre_ILUSetSchurSolverAbsoluteTol_dbl( void *ilu_vdata, hypre_double ss_absolute_tol ); +HYPRE_Int +hypre_ILUSetSchurSolverAbsoluteTol_long_dbl( void *ilu_vdata, hypre_long_double ss_absolute_tol ); + +HYPRE_Int +hypre_ILUSetSchurSolverLogging_flt( void *ilu_vdata, HYPRE_Int ss_logging ); +HYPRE_Int +hypre_ILUSetSchurSolverLogging_dbl( void *ilu_vdata, HYPRE_Int ss_logging ); +HYPRE_Int +hypre_ILUSetSchurSolverLogging_long_dbl( void *ilu_vdata, HYPRE_Int ss_logging ); + +HYPRE_Int +hypre_ILUSetSchurSolverMaxIter_flt( void *ilu_vdata, HYPRE_Int ss_max_iter ); +HYPRE_Int +hypre_ILUSetSchurSolverMaxIter_dbl( void *ilu_vdata, HYPRE_Int ss_max_iter ); +HYPRE_Int +hypre_ILUSetSchurSolverMaxIter_long_dbl( void *ilu_vdata, HYPRE_Int ss_max_iter ); + +HYPRE_Int +hypre_ILUSetSchurSolverPrintLevel_flt( void *ilu_vdata, HYPRE_Int ss_print_level ); +HYPRE_Int +hypre_ILUSetSchurSolverPrintLevel_dbl( void *ilu_vdata, HYPRE_Int ss_print_level ); +HYPRE_Int +hypre_ILUSetSchurSolverPrintLevel_long_dbl( void *ilu_vdata, HYPRE_Int ss_print_level ); + +HYPRE_Int +hypre_ILUSetSchurSolverRelChange_flt( void *ilu_vdata, HYPRE_Int ss_rel_change ); +HYPRE_Int +hypre_ILUSetSchurSolverRelChange_dbl( void *ilu_vdata, HYPRE_Int ss_rel_change ); +HYPRE_Int +hypre_ILUSetSchurSolverRelChange_long_dbl( void *ilu_vdata, HYPRE_Int ss_rel_change ); + +HYPRE_Int +hypre_ILUSetSchurSolverTol_flt( void *ilu_vdata, hypre_float ss_tol ); +HYPRE_Int +hypre_ILUSetSchurSolverTol_dbl( void *ilu_vdata, hypre_double ss_tol ); +HYPRE_Int +hypre_ILUSetSchurSolverTol_long_dbl( void *ilu_vdata, hypre_long_double ss_tol ); + +HYPRE_Int +hypre_ILUSetTol_flt( void *ilu_vdata, hypre_float tol ); +HYPRE_Int +hypre_ILUSetTol_dbl( void *ilu_vdata, hypre_double tol ); +HYPRE_Int +hypre_ILUSetTol_long_dbl( void *ilu_vdata, hypre_long_double tol ); + +HYPRE_Int +hypre_ILUSetTriSolve_flt( void *ilu_vdata, HYPRE_Int tri_solve ); +HYPRE_Int +hypre_ILUSetTriSolve_dbl( void *ilu_vdata, HYPRE_Int tri_solve ); +HYPRE_Int +hypre_ILUSetTriSolve_long_dbl( void *ilu_vdata, HYPRE_Int tri_solve ); + +HYPRE_Int +hypre_ILUSetType_flt( void *ilu_vdata, HYPRE_Int ilu_type ); +HYPRE_Int +hypre_ILUSetType_dbl( void *ilu_vdata, HYPRE_Int ilu_type ); +HYPRE_Int +hypre_ILUSetType_long_dbl( void *ilu_vdata, HYPRE_Int ilu_type ); + +HYPRE_Int +hypre_ILUSetUpperJacobiIters_flt( void *ilu_vdata, HYPRE_Int upper_jacobi_iters ); +HYPRE_Int +hypre_ILUSetUpperJacobiIters_dbl( void *ilu_vdata, HYPRE_Int upper_jacobi_iters ); +HYPRE_Int +hypre_ILUSetUpperJacobiIters_long_dbl( void *ilu_vdata, HYPRE_Int upper_jacobi_iters ); + +HYPRE_Int +hypre_ILUSetup_flt( void *ilu_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_ILUSetup_dbl( void *ilu_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_ILUSetup_long_dbl( void *ilu_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); + +HYPRE_Int +hypre_ILUSetupILU0_flt( hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int *qperm, HYPRE_Int nLU, HYPRE_Int nI, hypre_ParCSRMatrix **Lptr, hypre_float **Dptr, hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **Sptr, HYPRE_Int **u_end ); +HYPRE_Int +hypre_ILUSetupILU0_dbl( hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int *qperm, HYPRE_Int nLU, HYPRE_Int nI, hypre_ParCSRMatrix **Lptr, hypre_double **Dptr, hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **Sptr, HYPRE_Int **u_end ); +HYPRE_Int +hypre_ILUSetupILU0_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int *qperm, HYPRE_Int nLU, HYPRE_Int nI, hypre_ParCSRMatrix **Lptr, hypre_long_double **Dptr, hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **Sptr, HYPRE_Int **u_end ); + +HYPRE_Int +hypre_ILUSetupILU0RAS_flt( hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix **Lptr, hypre_float **Dptr, hypre_ParCSRMatrix **Uptr ); +HYPRE_Int +hypre_ILUSetupILU0RAS_dbl( hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix **Lptr, hypre_double **Dptr, hypre_ParCSRMatrix **Uptr ); +HYPRE_Int +hypre_ILUSetupILU0RAS_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix **Lptr, hypre_long_double **Dptr, hypre_ParCSRMatrix **Uptr ); + +HYPRE_Int +hypre_ILUSetupILUK_flt( hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPRE_Int *qpermp, HYPRE_Int nLU, HYPRE_Int nI, hypre_ParCSRMatrix **Lptr, hypre_float **Dptr, hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **Sptr, HYPRE_Int **u_end ); +HYPRE_Int +hypre_ILUSetupILUK_dbl( hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPRE_Int *qpermp, HYPRE_Int nLU, HYPRE_Int nI, hypre_ParCSRMatrix **Lptr, hypre_double **Dptr, hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **Sptr, HYPRE_Int **u_end ); +HYPRE_Int +hypre_ILUSetupILUK_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *permp, HYPRE_Int *qpermp, HYPRE_Int nLU, HYPRE_Int nI, hypre_ParCSRMatrix **Lptr, hypre_long_double **Dptr, hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **Sptr, HYPRE_Int **u_end ); + +HYPRE_Int +hypre_ILUSetupILUKRAS_flt( hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix **Lptr, hypre_float **Dptr, hypre_ParCSRMatrix **Uptr ); +HYPRE_Int +hypre_ILUSetupILUKRAS_dbl( hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix **Lptr, hypre_double **Dptr, hypre_ParCSRMatrix **Uptr ); +HYPRE_Int +hypre_ILUSetupILUKRAS_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int lfil, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix **Lptr, hypre_long_double **Dptr, hypre_ParCSRMatrix **Uptr ); + +HYPRE_Int +hypre_ILUSetupILUKRASSymbolic_flt( 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_ILUSetupILUKRASSymbolic_dbl( 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_ILUSetupILUKRASSymbolic_long_dbl( 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_ILUSetupILUKSymbolic_flt( 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_ILUSetupILUKSymbolic_dbl( 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_ILUSetupILUKSymbolic_long_dbl( 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_flt( hypre_ParCSRMatrix *A, HYPRE_Int lfil, hypre_float *tol, HYPRE_Int *permp, HYPRE_Int *qpermp, HYPRE_Int nLU, HYPRE_Int nI, hypre_ParCSRMatrix **Lptr, hypre_float **Dptr, hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **Sptr, HYPRE_Int **u_end ); +HYPRE_Int +hypre_ILUSetupILUT_dbl( hypre_ParCSRMatrix *A, HYPRE_Int lfil, hypre_double *tol, HYPRE_Int *permp, HYPRE_Int *qpermp, HYPRE_Int nLU, HYPRE_Int nI, hypre_ParCSRMatrix **Lptr, hypre_double **Dptr, hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **Sptr, HYPRE_Int **u_end ); +HYPRE_Int +hypre_ILUSetupILUT_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int lfil, hypre_long_double *tol, HYPRE_Int *permp, HYPRE_Int *qpermp, HYPRE_Int nLU, HYPRE_Int nI, hypre_ParCSRMatrix **Lptr, hypre_long_double **Dptr, hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **Sptr, HYPRE_Int **u_end ); + +HYPRE_Int +hypre_ILUSetupILUTRAS_flt( hypre_ParCSRMatrix *A, HYPRE_Int lfil, hypre_float *tol, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix **Lptr, hypre_float **Dptr, hypre_ParCSRMatrix **Uptr ); +HYPRE_Int +hypre_ILUSetupILUTRAS_dbl( hypre_ParCSRMatrix *A, HYPRE_Int lfil, hypre_double *tol, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix **Lptr, hypre_double **Dptr, hypre_ParCSRMatrix **Uptr ); +HYPRE_Int +hypre_ILUSetupILUTRAS_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int lfil, hypre_long_double *tol, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix **Lptr, hypre_long_double **Dptr, hypre_ParCSRMatrix **Uptr ); + +HYPRE_Int +hypre_ILUSetupLDUtoCusparse_flt( hypre_ParCSRMatrix *L, hypre_float *D, hypre_ParCSRMatrix *U, hypre_ParCSRMatrix **LDUp ); +HYPRE_Int +hypre_ILUSetupLDUtoCusparse_dbl( hypre_ParCSRMatrix *L, hypre_double *D, hypre_ParCSRMatrix *U, hypre_ParCSRMatrix **LDUp ); +HYPRE_Int +hypre_ILUSetupLDUtoCusparse_long_dbl( hypre_ParCSRMatrix *L, hypre_long_double *D, hypre_ParCSRMatrix *U, hypre_ParCSRMatrix **LDUp ); + +HYPRE_Int +hypre_ILUSetupMILU0_flt( hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, HYPRE_Int nLU, HYPRE_Int nI, hypre_ParCSRMatrix **Lptr, hypre_float **Dptr, hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **Sptr, HYPRE_Int **u_end, HYPRE_Int modified ); +HYPRE_Int +hypre_ILUSetupMILU0_dbl( hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, HYPRE_Int nLU, HYPRE_Int nI, hypre_ParCSRMatrix **Lptr, hypre_double **Dptr, hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **Sptr, HYPRE_Int **u_end, HYPRE_Int modified ); +HYPRE_Int +hypre_ILUSetupMILU0_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int *permp, HYPRE_Int *qpermp, HYPRE_Int nLU, HYPRE_Int nI, hypre_ParCSRMatrix **Lptr, hypre_long_double **Dptr, hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **Sptr, HYPRE_Int **u_end, HYPRE_Int modified ); + +HYPRE_Int +hypre_ILUSetupRAPILU0_flt( hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int n, HYPRE_Int nLU, hypre_ParCSRMatrix **Lptr, hypre_float **Dptr, hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **mLptr, hypre_float **mDptr, hypre_ParCSRMatrix **mUptr, HYPRE_Int **u_end ); +HYPRE_Int +hypre_ILUSetupRAPILU0_dbl( hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int n, HYPRE_Int nLU, hypre_ParCSRMatrix **Lptr, hypre_double **Dptr, hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **mLptr, hypre_double **mDptr, hypre_ParCSRMatrix **mUptr, HYPRE_Int **u_end ); +HYPRE_Int +hypre_ILUSetupRAPILU0_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int n, HYPRE_Int nLU, hypre_ParCSRMatrix **Lptr, hypre_long_double **Dptr, hypre_ParCSRMatrix **Uptr, hypre_ParCSRMatrix **mLptr, hypre_long_double **mDptr, hypre_ParCSRMatrix **mUptr, HYPRE_Int **u_end ); + +HYPRE_Int +hypre_ILUSetupRAPILU0Device_flt( 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_ILUSetupRAPILU0Device_dbl( 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_ILUSetupRAPILU0Device_long_dbl( 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_ILUSetupRAPMILU0_flt( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **ALUp, HYPRE_Int modified ); +HYPRE_Int +hypre_ILUSetupRAPMILU0_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **ALUp, HYPRE_Int modified ); +HYPRE_Int +hypre_ILUSetupRAPMILU0_long_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **ALUp, HYPRE_Int modified ); + +HYPRE_Int +hypre_ILUSolve_flt( void *ilu_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_ILUSolve_dbl( void *ilu_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_ILUSolve_long_dbl( void *ilu_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); + +HYPRE_Int +hypre_ILUSolveLU_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix *L, hypre_float *D, hypre_ParCSRMatrix *U, hypre_ParVector *ftemp, hypre_ParVector *utemp ); +HYPRE_Int +hypre_ILUSolveLU_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix *L, hypre_double *D, hypre_ParCSRMatrix *U, hypre_ParVector *ftemp, hypre_ParVector *utemp ); +HYPRE_Int +hypre_ILUSolveLU_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix *L, hypre_long_double *D, hypre_ParCSRMatrix *U, hypre_ParVector *ftemp, hypre_ParVector *utemp ); + +HYPRE_Int +hypre_ILUSolveLUIter_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix *L, hypre_float *D, hypre_ParCSRMatrix *U, hypre_ParVector *ftemp, hypre_ParVector *utemp, HYPRE_Int lower_jacobi_iters, HYPRE_Int upper_jacobi_iters ); +HYPRE_Int +hypre_ILUSolveLUIter_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix *L, hypre_double *D, hypre_ParCSRMatrix *U, hypre_ParVector *ftemp, hypre_ParVector *utemp, HYPRE_Int lower_jacobi_iters, HYPRE_Int upper_jacobi_iters ); +HYPRE_Int +hypre_ILUSolveLUIter_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix *L, hypre_long_double *D, hypre_ParCSRMatrix *U, hypre_ParVector *ftemp, hypre_ParVector *utemp, HYPRE_Int lower_jacobi_iters, HYPRE_Int upper_jacobi_iters ); + +HYPRE_Int +hypre_ILUSolveLURAS_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, hypre_ParCSRMatrix *L, hypre_float *D, hypre_ParCSRMatrix *U, hypre_ParVector *ftemp, hypre_ParVector *utemp, hypre_float *fext, hypre_float *uext ); +HYPRE_Int +hypre_ILUSolveLURAS_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, hypre_ParCSRMatrix *L, hypre_double *D, hypre_ParCSRMatrix *U, hypre_ParVector *ftemp, hypre_ParVector *utemp, hypre_double *fext, hypre_double *uext ); +HYPRE_Int +hypre_ILUSolveLURAS_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, hypre_ParCSRMatrix *L, hypre_long_double *D, hypre_ParCSRMatrix *U, hypre_ParVector *ftemp, hypre_ParVector *utemp, hypre_long_double *fext, hypre_long_double *uext ); + +HYPRE_Int +hypre_ILUSolveRAPGMRESHost_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix *L, hypre_float *D, hypre_ParCSRMatrix *U, hypre_ParCSRMatrix *mL, hypre_float *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_ILUSolveRAPGMRESHost_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix *L, hypre_double *D, hypre_ParCSRMatrix *U, hypre_ParCSRMatrix *mL, hypre_double *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_ILUSolveRAPGMRESHost_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix *L, hypre_long_double *D, hypre_ParCSRMatrix *U, hypre_ParCSRMatrix *mL, hypre_long_double *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_ILUSolveSchurGMRES_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int *qperm, HYPRE_Int nLU, hypre_ParCSRMatrix *L, hypre_float *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_ILUSolveSchurGMRES_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int *qperm, HYPRE_Int nLU, hypre_ParCSRMatrix *L, hypre_double *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_ILUSolveSchurGMRES_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int *qperm, HYPRE_Int nLU, hypre_ParCSRMatrix *L, hypre_long_double *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_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix *L, hypre_float *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_ILUSolveSchurNSH_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix *L, hypre_double *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_ILUSolveSchurNSH_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix *L, hypre_long_double *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_ILUSortOffdColmap_flt( hypre_ParCSRMatrix *A ); +HYPRE_Int +hypre_ILUSortOffdColmap_dbl( hypre_ParCSRMatrix *A ); +HYPRE_Int +hypre_ILUSortOffdColmap_long_dbl( hypre_ParCSRMatrix *A ); + +HYPRE_Int +hypre_ILUWriteSolverParams_flt( void *ilu_vdata ); +HYPRE_Int +hypre_ILUWriteSolverParams_dbl( void *ilu_vdata ); +HYPRE_Int +hypre_ILUWriteSolverParams_long_dbl( void *ilu_vdata ); + +HYPRE_Int +hypre_IndepSetGreedy_flt( HYPRE_Int *A_i, HYPRE_Int *A_j, HYPRE_Int n, HYPRE_Int *cf ); +HYPRE_Int +hypre_IndepSetGreedy_dbl( HYPRE_Int *A_i, HYPRE_Int *A_j, HYPRE_Int n, HYPRE_Int *cf ); +HYPRE_Int +hypre_IndepSetGreedy_long_dbl( HYPRE_Int *A_i, HYPRE_Int *A_j, HYPRE_Int n, HYPRE_Int *cf ); + +HYPRE_Int +hypre_IndepSetGreedyS_flt( HYPRE_Int *A_i, HYPRE_Int *A_j, HYPRE_Int n, HYPRE_Int *cf ); +HYPRE_Int +hypre_IndepSetGreedyS_dbl( HYPRE_Int *A_i, HYPRE_Int *A_j, HYPRE_Int n, HYPRE_Int *cf ); +HYPRE_Int +hypre_IndepSetGreedyS_long_dbl( HYPRE_Int *A_i, HYPRE_Int *A_j, HYPRE_Int n, HYPRE_Int *cf ); + +HYPRE_Int +hypre_IntersectTwoArrays_flt( HYPRE_Int *x, hypre_float *x_data, HYPRE_Int x_length, HYPRE_Int *y, HYPRE_Int y_length, HYPRE_Int *z, hypre_float *output_x_data, HYPRE_Int *intersect_length ); +HYPRE_Int +hypre_IntersectTwoArrays_dbl( HYPRE_Int *x, hypre_double *x_data, HYPRE_Int x_length, HYPRE_Int *y, HYPRE_Int y_length, HYPRE_Int *z, hypre_double *output_x_data, HYPRE_Int *intersect_length ); +HYPRE_Int +hypre_IntersectTwoArrays_long_dbl( HYPRE_Int *x, hypre_long_double *x_data, HYPRE_Int x_length, HYPRE_Int *y, HYPRE_Int y_length, HYPRE_Int *z, hypre_long_double *output_x_data, HYPRE_Int *intersect_length ); + +HYPRE_Int +hypre_IntersectTwoBigArrays_flt( HYPRE_BigInt *x, hypre_float *x_data, HYPRE_Int x_length, HYPRE_BigInt *y, HYPRE_Int y_length, HYPRE_BigInt *z, hypre_float *output_x_data, HYPRE_Int *intersect_length ); +HYPRE_Int +hypre_IntersectTwoBigArrays_dbl( HYPRE_BigInt *x, hypre_double *x_data, HYPRE_Int x_length, HYPRE_BigInt *y, HYPRE_Int y_length, HYPRE_BigInt *z, hypre_double *output_x_data, HYPRE_Int *intersect_length ); +HYPRE_Int +hypre_IntersectTwoBigArrays_long_dbl( HYPRE_BigInt *x, hypre_long_double *x_data, HYPRE_Int x_length, HYPRE_BigInt *y, HYPRE_Int y_length, HYPRE_BigInt *z, hypre_long_double *output_x_data, HYPRE_Int *intersect_length ); + +HYPRE_Real +hypre_LINPACKcgpthy_flt( hypre_float *a, hypre_float *b ); +HYPRE_Real +hypre_LINPACKcgpthy_dbl( hypre_double *a, hypre_double *b ); +HYPRE_Real +hypre_LINPACKcgpthy_long_dbl( hypre_long_double *a, hypre_long_double *b ); + +HYPRE_Int +hypre_LINPACKcgtql1_flt( HYPRE_Int *n, hypre_float *d, hypre_float *e, HYPRE_Int *ierr ); +HYPRE_Int +hypre_LINPACKcgtql1_dbl( HYPRE_Int *n, hypre_double *d, hypre_double *e, HYPRE_Int *ierr ); +HYPRE_Int +hypre_LINPACKcgtql1_long_dbl( HYPRE_Int *n, hypre_long_double *d, hypre_long_double *e, HYPRE_Int *ierr ); + +HYPRE_Int +hypre_MGRAddVectorP_flt( hypre_IntArray *CF_marker, HYPRE_Int point_type, hypre_float a, hypre_ParVector *fromVector, hypre_float b, hypre_ParVector **toVector ); +HYPRE_Int +hypre_MGRAddVectorP_dbl( hypre_IntArray *CF_marker, HYPRE_Int point_type, hypre_double a, hypre_ParVector *fromVector, hypre_double b, hypre_ParVector **toVector ); +HYPRE_Int +hypre_MGRAddVectorP_long_dbl( hypre_IntArray *CF_marker, HYPRE_Int point_type, hypre_long_double a, hypre_ParVector *fromVector, hypre_long_double b, hypre_ParVector **toVector ); + +HYPRE_Int +hypre_MGRAddVectorR_flt( hypre_IntArray *CF_marker, HYPRE_Int point_type, hypre_float a, hypre_ParVector *fromVector, hypre_float b, hypre_ParVector **toVector ); +HYPRE_Int +hypre_MGRAddVectorR_dbl( hypre_IntArray *CF_marker, HYPRE_Int point_type, hypre_double a, hypre_ParVector *fromVector, hypre_double b, hypre_ParVector **toVector ); +HYPRE_Int +hypre_MGRAddVectorR_long_dbl( hypre_IntArray *CF_marker, HYPRE_Int point_type, hypre_long_double a, hypre_ParVector *fromVector, hypre_long_double b, hypre_ParVector **toVector ); + +HYPRE_Int +hypre_MGRApproximateInverse_flt( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **A_inv ); +HYPRE_Int +hypre_MGRApproximateInverse_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **A_inv ); +HYPRE_Int +hypre_MGRApproximateInverse_long_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **A_inv ); + +HYPRE_Int +hypre_MGRBlockColLumpedRestrict_flt( 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_MGRBlockColLumpedRestrict_dbl( 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_MGRBlockColLumpedRestrict_long_dbl( 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_MGRBlockRelaxSetup_flt( hypre_ParCSRMatrix *A, HYPRE_Int blk_size, hypre_float **diaginvptr ); +HYPRE_Int +hypre_MGRBlockRelaxSetup_dbl( hypre_ParCSRMatrix *A, HYPRE_Int blk_size, hypre_double **diaginvptr ); +HYPRE_Int +hypre_MGRBlockRelaxSetup_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int blk_size, hypre_long_double **diaginvptr ); + +HYPRE_Int +hypre_MGRBlockRelaxSolve_flt( 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_float *diaginv, hypre_ParVector *Vtemp ); +HYPRE_Int +hypre_MGRBlockRelaxSolve_dbl( 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_double *diaginv, hypre_ParVector *Vtemp ); +HYPRE_Int +hypre_MGRBlockRelaxSolve_long_dbl( 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_long_double *diaginv, hypre_ParVector *Vtemp ); + +HYPRE_Int +hypre_MGRBlockRelaxSolveDevice_flt( hypre_ParCSRMatrix *B, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_float relax_weight ); +HYPRE_Int +hypre_MGRBlockRelaxSolveDevice_dbl( hypre_ParCSRMatrix *B, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_double relax_weight ); +HYPRE_Int +hypre_MGRBlockRelaxSolveDevice_long_dbl( hypre_ParCSRMatrix *B, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, hypre_ParVector *Vtemp, hypre_long_double relax_weight ); + +HYPRE_Int +hypre_MGRBuildAff_flt( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, HYPRE_Int debug_flag, hypre_ParCSRMatrix **A_ff_ptr ); +HYPRE_Int +hypre_MGRBuildAff_dbl( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, HYPRE_Int debug_flag, hypre_ParCSRMatrix **A_ff_ptr ); +HYPRE_Int +hypre_MGRBuildAff_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, HYPRE_Int debug_flag, hypre_ParCSRMatrix **A_ff_ptr ); + +HYPRE_Int +hypre_MGRBuildBlockJacobiP_flt( 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_MGRBuildBlockJacobiP_dbl( 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_MGRBuildBlockJacobiP_long_dbl( 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_MGRBuildBlockJacobiWp_flt( hypre_ParCSRMatrix *A_FF, hypre_ParCSRMatrix *A_FC, HYPRE_Int blk_size, hypre_ParCSRMatrix **Wp_ptr ); +HYPRE_Int +hypre_MGRBuildBlockJacobiWp_dbl( hypre_ParCSRMatrix *A_FF, hypre_ParCSRMatrix *A_FC, HYPRE_Int blk_size, hypre_ParCSRMatrix **Wp_ptr ); +HYPRE_Int +hypre_MGRBuildBlockJacobiWp_long_dbl( hypre_ParCSRMatrix *A_FF, hypre_ParCSRMatrix *A_FC, HYPRE_Int blk_size, hypre_ParCSRMatrix **Wp_ptr ); + +HYPRE_Int +hypre_MGRBuildCoarseOperator_flt( 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 ); +HYPRE_Int +hypre_MGRBuildCoarseOperator_dbl( 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 ); +HYPRE_Int +hypre_MGRBuildCoarseOperator_long_dbl( 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 ); + +HYPRE_Int +hypre_MGRBuildInterp_flt( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *A_FF, hypre_ParCSRMatrix *A_FC, hypre_ParCSRMatrix *S, hypre_IntArray *CF_marker, HYPRE_BigInt *num_cpts_global, hypre_float 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_MGRBuildInterp_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *A_FF, hypre_ParCSRMatrix *A_FC, hypre_ParCSRMatrix *S, hypre_IntArray *CF_marker, HYPRE_BigInt *num_cpts_global, hypre_double 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_MGRBuildInterp_long_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *A_FF, hypre_ParCSRMatrix *A_FC, hypre_ParCSRMatrix *S, hypre_IntArray *CF_marker, HYPRE_BigInt *num_cpts_global, hypre_long_double 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_MGRBuildInterpApproximateInverse_flt( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, HYPRE_BigInt *num_cpts_global, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_MGRBuildInterpApproximateInverse_dbl( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, HYPRE_BigInt *num_cpts_global, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_MGRBuildInterpApproximateInverse_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, HYPRE_BigInt *num_cpts_global, hypre_ParCSRMatrix **P_ptr ); + +HYPRE_Int +hypre_MGRBuildP_flt( 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_MGRBuildP_dbl( 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_MGRBuildP_long_dbl( 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_MGRBuildPFromWp_flt( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *Wp, HYPRE_Int *CF_marker, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_MGRBuildPFromWp_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *Wp, HYPRE_Int *CF_marker, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_MGRBuildPFromWp_long_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *Wp, HYPRE_Int *CF_marker, hypre_ParCSRMatrix **P_ptr ); + +HYPRE_Int +hypre_MGRBuildPFromWpHost_flt( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *Wp, HYPRE_Int *CF_marker, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_MGRBuildPFromWpHost_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *Wp, HYPRE_Int *CF_marker, hypre_ParCSRMatrix **P_ptr ); +HYPRE_Int +hypre_MGRBuildPFromWpHost_long_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *Wp, HYPRE_Int *CF_marker, hypre_ParCSRMatrix **P_ptr ); + +HYPRE_Int +hypre_MGRBuildPHost_flt( 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_MGRBuildPHost_dbl( 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_MGRBuildPHost_long_dbl( 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_MGRBuildRFromWr_flt( 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_MGRBuildRFromWr_dbl( 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_MGRBuildRFromWr_long_dbl( 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_MGRBuildRestrict_flt( 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_float trunc_factor, HYPRE_Int max_elmts, hypre_float strong_threshold, hypre_float 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_MGRBuildRestrict_dbl( 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_double trunc_factor, HYPRE_Int max_elmts, hypre_double strong_threshold, hypre_double 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_MGRBuildRestrict_long_dbl( 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_long_double trunc_factor, HYPRE_Int max_elmts, hypre_long_double strong_threshold, hypre_long_double 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_MGRCoarseParms_flt( MPI_Comm comm, HYPRE_Int num_rows, hypre_IntArray *CF_marker, HYPRE_BigInt *row_starts_cpts, HYPRE_BigInt *row_starts_fpts ); +HYPRE_Int +hypre_MGRCoarseParms_dbl( MPI_Comm comm, HYPRE_Int num_rows, hypre_IntArray *CF_marker, HYPRE_BigInt *row_starts_cpts, HYPRE_BigInt *row_starts_fpts ); +HYPRE_Int +hypre_MGRCoarseParms_long_dbl( MPI_Comm comm, HYPRE_Int num_rows, hypre_IntArray *CF_marker, HYPRE_BigInt *row_starts_cpts, HYPRE_BigInt *row_starts_fpts ); + +HYPRE_Int +hypre_MGRCoarsen_flt( 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_MGRCoarsen_dbl( 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_MGRCoarsen_long_dbl( 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_MGRColLumpedRestrict_flt( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *A_FF, hypre_ParCSRMatrix *A_CF, hypre_IntArray *CF_marker, hypre_ParCSRMatrix **Wr_ptr, hypre_ParCSRMatrix **R_ptr ); +HYPRE_Int +hypre_MGRColLumpedRestrict_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *A_FF, hypre_ParCSRMatrix *A_CF, hypre_IntArray *CF_marker, hypre_ParCSRMatrix **Wr_ptr, hypre_ParCSRMatrix **R_ptr ); +HYPRE_Int +hypre_MGRColLumpedRestrict_long_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *A_FF, hypre_ParCSRMatrix *A_CF, hypre_IntArray *CF_marker, hypre_ParCSRMatrix **Wr_ptr, hypre_ParCSRMatrix **R_ptr ); + +void * +hypre_MGRCreate_flt( void ); +void * +hypre_MGRCreate_dbl( void ); +void * +hypre_MGRCreate_long_dbl( void ); + +void * +hypre_MGRCreateFrelaxVcycleData_flt( void ); +void * +hypre_MGRCreateFrelaxVcycleData_dbl( void ); +void * +hypre_MGRCreateFrelaxVcycleData_long_dbl( void ); + +void * +hypre_MGRCreateGSElimData_flt( void ); +void * +hypre_MGRCreateGSElimData_dbl( void ); +void * +hypre_MGRCreateGSElimData_long_dbl( void ); + +HYPRE_Int +hypre_MGRCycle_flt( void *mgr_vdata, hypre_ParVector **F_array, hypre_ParVector **U_array ); +HYPRE_Int +hypre_MGRCycle_dbl( void *mgr_vdata, hypre_ParVector **F_array, hypre_ParVector **U_array ); +HYPRE_Int +hypre_MGRCycle_long_dbl( void *mgr_vdata, hypre_ParVector **F_array, hypre_ParVector **U_array ); + +HYPRE_Int +hypre_MGRDataPrint_flt( void *mgr_vdata ); +HYPRE_Int +hypre_MGRDataPrint_dbl( void *mgr_vdata ); +HYPRE_Int +hypre_MGRDataPrint_long_dbl( void *mgr_vdata ); + +HYPRE_Int +hypre_MGRDestroy_flt( void *mgr_vdata ); +HYPRE_Int +hypre_MGRDestroy_dbl( void *mgr_vdata ); +HYPRE_Int +hypre_MGRDestroy_long_dbl( void *mgr_vdata ); + +HYPRE_Int +hypre_MGRDestroyFrelaxVcycleData_flt( void *mgr_vdata ); +HYPRE_Int +hypre_MGRDestroyFrelaxVcycleData_dbl( void *mgr_vdata ); +HYPRE_Int +hypre_MGRDestroyFrelaxVcycleData_long_dbl( void *mgr_vdata ); + +HYPRE_Int +hypre_MGRDestroyGSElimData_flt( void *mgr_vdata ); +HYPRE_Int +hypre_MGRDestroyGSElimData_dbl( void *mgr_vdata ); +HYPRE_Int +hypre_MGRDestroyGSElimData_long_dbl( void *mgr_vdata ); + +HYPRE_Int +hypre_MGRFrelaxVcycle_flt( void *mgr_vdata, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_MGRFrelaxVcycle_dbl( void *mgr_vdata, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_MGRFrelaxVcycle_long_dbl( void *mgr_vdata, hypre_ParVector *f, hypre_ParVector *u ); + +HYPRE_Int +hypre_MGRGetCoarseGridConvergenceFactor_flt( void *mgr_data, hypre_float *conv_factor ); +HYPRE_Int +hypre_MGRGetCoarseGridConvergenceFactor_dbl( void *mgr_data, hypre_double *conv_factor ); +HYPRE_Int +hypre_MGRGetCoarseGridConvergenceFactor_long_dbl( void *mgr_data, hypre_long_double *conv_factor ); + +HYPRE_Int +hypre_MGRGetFinalRelativeResidualNorm_flt( void *mgr_vdata, hypre_float *res_norm ); +HYPRE_Int +hypre_MGRGetFinalRelativeResidualNorm_dbl( void *mgr_vdata, hypre_double *res_norm ); +HYPRE_Int +hypre_MGRGetFinalRelativeResidualNorm_long_dbl( void *mgr_vdata, hypre_long_double *res_norm ); + +HYPRE_Int +hypre_MGRGetNumIterations_flt( void *mgr_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_MGRGetNumIterations_dbl( void *mgr_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_MGRGetNumIterations_long_dbl( void *mgr_vdata, HYPRE_Int *num_iterations ); + +HYPRE_Int +hypre_MGRGetSubBlock_flt( 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_MGRGetSubBlock_dbl( 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_MGRGetSubBlock_long_dbl( 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_MGRSetBlockJacobiBlockSize_flt( void *mgr_vdata, HYPRE_Int blk_size ); +HYPRE_Int +hypre_MGRSetBlockJacobiBlockSize_dbl( void *mgr_vdata, HYPRE_Int blk_size ); +HYPRE_Int +hypre_MGRSetBlockJacobiBlockSize_long_dbl( void *mgr_vdata, HYPRE_Int blk_size ); + +HYPRE_Int +hypre_MGRSetBlockSize_flt( void *mgr_vdata, HYPRE_Int bsize ); +HYPRE_Int +hypre_MGRSetBlockSize_dbl( void *mgr_vdata, HYPRE_Int bsize ); +HYPRE_Int +hypre_MGRSetBlockSize_long_dbl( void *mgr_vdata, HYPRE_Int bsize ); + +HYPRE_Int +hypre_MGRSetCoarseGridMethod_flt( void *mgr_vdata, HYPRE_Int *cg_method ); +HYPRE_Int +hypre_MGRSetCoarseGridMethod_dbl( void *mgr_vdata, HYPRE_Int *cg_method ); +HYPRE_Int +hypre_MGRSetCoarseGridMethod_long_dbl( void *mgr_vdata, HYPRE_Int *cg_method ); + +HYPRE_Int +hypre_MGRSetCoarseGridPrintLevel_flt( void *mgr_vdata, HYPRE_Int print_level ); +HYPRE_Int +hypre_MGRSetCoarseGridPrintLevel_dbl( void *mgr_vdata, HYPRE_Int print_level ); +HYPRE_Int +hypre_MGRSetCoarseGridPrintLevel_long_dbl( void *mgr_vdata, HYPRE_Int print_level ); + +HYPRE_Int +hypre_MGRSetCpointsByBlock_flt( 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_MGRSetCpointsByBlock_dbl( 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_MGRSetCpointsByBlock_long_dbl( 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_flt( 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_MGRSetCpointsByContiguousBlock_dbl( 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_MGRSetCpointsByContiguousBlock_long_dbl( 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_flt( 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_MGRSetCpointsByPointMarkerArray_dbl( 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_MGRSetCpointsByPointMarkerArray_long_dbl( 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_MGRSetFRelaxMethod_flt( void *mgr_vdata, HYPRE_Int relax_method ); +HYPRE_Int +hypre_MGRSetFRelaxMethod_dbl( void *mgr_vdata, HYPRE_Int relax_method ); +HYPRE_Int +hypre_MGRSetFRelaxMethod_long_dbl( void *mgr_vdata, HYPRE_Int relax_method ); + +HYPRE_Int +hypre_MGRSetFSolverAtLevel_flt( void *mgr_vdata, void *fsolver, HYPRE_Int level ); +HYPRE_Int +hypre_MGRSetFSolverAtLevel_dbl( void *mgr_vdata, void *fsolver, HYPRE_Int level ); +HYPRE_Int +hypre_MGRSetFSolverAtLevel_long_dbl( void *mgr_vdata, void *fsolver, HYPRE_Int level ); + +HYPRE_Int +hypre_MGRSetFrelaxPrintLevel_flt( void *mgr_vdata, HYPRE_Int print_level ); +HYPRE_Int +hypre_MGRSetFrelaxPrintLevel_dbl( void *mgr_vdata, HYPRE_Int print_level ); +HYPRE_Int +hypre_MGRSetFrelaxPrintLevel_long_dbl( void *mgr_vdata, HYPRE_Int print_level ); + +HYPRE_Int +hypre_MGRSetGlobalSmoothCycle_flt( void *mgr_vdata, HYPRE_Int global_smooth_cycle ); +HYPRE_Int +hypre_MGRSetGlobalSmoothCycle_dbl( void *mgr_vdata, HYPRE_Int global_smooth_cycle ); +HYPRE_Int +hypre_MGRSetGlobalSmoothCycle_long_dbl( void *mgr_vdata, HYPRE_Int global_smooth_cycle ); + +HYPRE_Int +hypre_MGRSetGlobalSmoothType_flt( void *mgr_vdata, HYPRE_Int iter_type ); +HYPRE_Int +hypre_MGRSetGlobalSmoothType_dbl( void *mgr_vdata, HYPRE_Int iter_type ); +HYPRE_Int +hypre_MGRSetGlobalSmoothType_long_dbl( void *mgr_vdata, HYPRE_Int iter_type ); + +HYPRE_Int +hypre_MGRSetGlobalSmootherAtLevel_flt( void *mgr_vdata, HYPRE_Solver smoother, HYPRE_Int level ); +HYPRE_Int +hypre_MGRSetGlobalSmootherAtLevel_dbl( void *mgr_vdata, HYPRE_Solver smoother, HYPRE_Int level ); +HYPRE_Int +hypre_MGRSetGlobalSmootherAtLevel_long_dbl( void *mgr_vdata, HYPRE_Solver smoother, HYPRE_Int level ); + +HYPRE_Int +hypre_MGRSetInterpType_flt( void *mgr_vdata, HYPRE_Int interpType ); +HYPRE_Int +hypre_MGRSetInterpType_dbl( void *mgr_vdata, HYPRE_Int interpType ); +HYPRE_Int +hypre_MGRSetInterpType_long_dbl( void *mgr_vdata, HYPRE_Int interpType ); + +HYPRE_Int +hypre_MGRSetLevelFRelaxMethod_flt( void *mgr_vdata, HYPRE_Int *relax_method ); +HYPRE_Int +hypre_MGRSetLevelFRelaxMethod_dbl( void *mgr_vdata, HYPRE_Int *relax_method ); +HYPRE_Int +hypre_MGRSetLevelFRelaxMethod_long_dbl( void *mgr_vdata, HYPRE_Int *relax_method ); + +HYPRE_Int +hypre_MGRSetLevelFRelaxNumFunctions_flt( void *mgr_vdata, HYPRE_Int *num_functions ); +HYPRE_Int +hypre_MGRSetLevelFRelaxNumFunctions_dbl( void *mgr_vdata, HYPRE_Int *num_functions ); +HYPRE_Int +hypre_MGRSetLevelFRelaxNumFunctions_long_dbl( void *mgr_vdata, HYPRE_Int *num_functions ); + +HYPRE_Int +hypre_MGRSetLevelFRelaxType_flt( void *mgr_vdata, HYPRE_Int *relax_type ); +HYPRE_Int +hypre_MGRSetLevelFRelaxType_dbl( void *mgr_vdata, HYPRE_Int *relax_type ); +HYPRE_Int +hypre_MGRSetLevelFRelaxType_long_dbl( void *mgr_vdata, HYPRE_Int *relax_type ); + +HYPRE_Int +hypre_MGRSetLevelInterpType_flt( void *mgr_vdata, HYPRE_Int *interpType ); +HYPRE_Int +hypre_MGRSetLevelInterpType_dbl( void *mgr_vdata, HYPRE_Int *interpType ); +HYPRE_Int +hypre_MGRSetLevelInterpType_long_dbl( void *mgr_vdata, HYPRE_Int *interpType ); + +HYPRE_Int +hypre_MGRSetLevelNonGalerkinMaxElmts_flt( void *mgr_vdata, HYPRE_Int *max_elmts ); +HYPRE_Int +hypre_MGRSetLevelNonGalerkinMaxElmts_dbl( void *mgr_vdata, HYPRE_Int *max_elmts ); +HYPRE_Int +hypre_MGRSetLevelNonGalerkinMaxElmts_long_dbl( void *mgr_vdata, HYPRE_Int *max_elmts ); + +HYPRE_Int +hypre_MGRSetLevelNumRelaxSweeps_flt( void *mgr_vdata, HYPRE_Int *nsweeps ); +HYPRE_Int +hypre_MGRSetLevelNumRelaxSweeps_dbl( void *mgr_vdata, HYPRE_Int *nsweeps ); +HYPRE_Int +hypre_MGRSetLevelNumRelaxSweeps_long_dbl( void *mgr_vdata, HYPRE_Int *nsweeps ); + +HYPRE_Int +hypre_MGRSetLevelPMaxElmts_flt( void *mgr_vdata, HYPRE_Int *P_max_elmts ); +HYPRE_Int +hypre_MGRSetLevelPMaxElmts_dbl( void *mgr_vdata, HYPRE_Int *P_max_elmts ); +HYPRE_Int +hypre_MGRSetLevelPMaxElmts_long_dbl( void *mgr_vdata, HYPRE_Int *P_max_elmts ); + +HYPRE_Int +hypre_MGRSetLevelRestrictType_flt( void *mgr_vdata, HYPRE_Int *restrictType ); +HYPRE_Int +hypre_MGRSetLevelRestrictType_dbl( void *mgr_vdata, HYPRE_Int *restrictType ); +HYPRE_Int +hypre_MGRSetLevelRestrictType_long_dbl( void *mgr_vdata, HYPRE_Int *restrictType ); + +HYPRE_Int +hypre_MGRSetLevelSmoothIters_flt( void *mgr_vdata, HYPRE_Int *level_smooth_iters ); +HYPRE_Int +hypre_MGRSetLevelSmoothIters_dbl( void *mgr_vdata, HYPRE_Int *level_smooth_iters ); +HYPRE_Int +hypre_MGRSetLevelSmoothIters_long_dbl( void *mgr_vdata, HYPRE_Int *level_smooth_iters ); + +HYPRE_Int +hypre_MGRSetLevelSmoothType_flt( void *mgr_vdata, HYPRE_Int *level_smooth_type ); +HYPRE_Int +hypre_MGRSetLevelSmoothType_dbl( void *mgr_vdata, HYPRE_Int *level_smooth_type ); +HYPRE_Int +hypre_MGRSetLevelSmoothType_long_dbl( void *mgr_vdata, HYPRE_Int *level_smooth_type ); + +HYPRE_Int +hypre_MGRSetLogging_flt( void *mgr_vdata, HYPRE_Int logging ); +HYPRE_Int +hypre_MGRSetLogging_dbl( void *mgr_vdata, HYPRE_Int logging ); +HYPRE_Int +hypre_MGRSetLogging_long_dbl( void *mgr_vdata, HYPRE_Int logging ); + +HYPRE_Int +hypre_MGRSetMaxCoarseLevels_flt( void *mgr_vdata, HYPRE_Int maxlev ); +HYPRE_Int +hypre_MGRSetMaxCoarseLevels_dbl( void *mgr_vdata, HYPRE_Int maxlev ); +HYPRE_Int +hypre_MGRSetMaxCoarseLevels_long_dbl( void *mgr_vdata, HYPRE_Int maxlev ); + +HYPRE_Int +hypre_MGRSetMaxGlobalSmoothIters_flt( void *mgr_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_MGRSetMaxGlobalSmoothIters_dbl( void *mgr_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_MGRSetMaxGlobalSmoothIters_long_dbl( void *mgr_vdata, HYPRE_Int max_iter ); + +HYPRE_Int +hypre_MGRSetMaxIter_flt( void *mgr_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_MGRSetMaxIter_dbl( void *mgr_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_MGRSetMaxIter_long_dbl( void *mgr_vdata, HYPRE_Int max_iter ); + +HYPRE_Int +hypre_MGRSetNonCpointsToFpoints_flt( void *mgr_vdata, HYPRE_Int nonCptToFptFlag ); +HYPRE_Int +hypre_MGRSetNonCpointsToFpoints_dbl( void *mgr_vdata, HYPRE_Int nonCptToFptFlag ); +HYPRE_Int +hypre_MGRSetNonCpointsToFpoints_long_dbl( void *mgr_vdata, HYPRE_Int nonCptToFptFlag ); + +HYPRE_Int +hypre_MGRSetNonGalerkinMaxElmts_flt( void *mgr_vdata, HYPRE_Int max_elmts ); +HYPRE_Int +hypre_MGRSetNonGalerkinMaxElmts_dbl( void *mgr_vdata, HYPRE_Int max_elmts ); +HYPRE_Int +hypre_MGRSetNonGalerkinMaxElmts_long_dbl( void *mgr_vdata, HYPRE_Int max_elmts ); + +HYPRE_Int +hypre_MGRSetNumInterpSweeps_flt( void *mgr_vdata, HYPRE_Int nsweeps ); +HYPRE_Int +hypre_MGRSetNumInterpSweeps_dbl( void *mgr_vdata, HYPRE_Int nsweeps ); +HYPRE_Int +hypre_MGRSetNumInterpSweeps_long_dbl( void *mgr_vdata, HYPRE_Int nsweeps ); + +HYPRE_Int +hypre_MGRSetNumRelaxSweeps_flt( void *mgr_vdata, HYPRE_Int nsweeps ); +HYPRE_Int +hypre_MGRSetNumRelaxSweeps_dbl( void *mgr_vdata, HYPRE_Int nsweeps ); +HYPRE_Int +hypre_MGRSetNumRelaxSweeps_long_dbl( void *mgr_vdata, HYPRE_Int nsweeps ); + +HYPRE_Int +hypre_MGRSetNumRestrictSweeps_flt( void *mgr_vdata, HYPRE_Int nsweeps ); +HYPRE_Int +hypre_MGRSetNumRestrictSweeps_dbl( void *mgr_vdata, HYPRE_Int nsweeps ); +HYPRE_Int +hypre_MGRSetNumRestrictSweeps_long_dbl( void *mgr_vdata, HYPRE_Int nsweeps ); + +HYPRE_Int +hypre_MGRSetPMaxElmts_flt( void *mgr_vdata, HYPRE_Int P_max_elmts ); +HYPRE_Int +hypre_MGRSetPMaxElmts_dbl( void *mgr_vdata, HYPRE_Int P_max_elmts ); +HYPRE_Int +hypre_MGRSetPMaxElmts_long_dbl( void *mgr_vdata, HYPRE_Int P_max_elmts ); + +HYPRE_Int +hypre_MGRSetPrintLevel_flt( void *mgr_vdata, HYPRE_Int print_level ); +HYPRE_Int +hypre_MGRSetPrintLevel_dbl( void *mgr_vdata, HYPRE_Int print_level ); +HYPRE_Int +hypre_MGRSetPrintLevel_long_dbl( void *mgr_vdata, HYPRE_Int print_level ); + +HYPRE_Int +hypre_MGRSetRelaxType_flt( void *mgr_vdata, HYPRE_Int relax_type ); +HYPRE_Int +hypre_MGRSetRelaxType_dbl( void *mgr_vdata, HYPRE_Int relax_type ); +HYPRE_Int +hypre_MGRSetRelaxType_long_dbl( void *mgr_vdata, HYPRE_Int relax_type ); + +HYPRE_Int +hypre_MGRSetReservedCoarseNodes_flt( void *mgr_vdata, HYPRE_Int reserved_coarse_size, HYPRE_BigInt *reserved_coarse_nodes ); +HYPRE_Int +hypre_MGRSetReservedCoarseNodes_dbl( void *mgr_vdata, HYPRE_Int reserved_coarse_size, HYPRE_BigInt *reserved_coarse_nodes ); +HYPRE_Int +hypre_MGRSetReservedCoarseNodes_long_dbl( void *mgr_vdata, HYPRE_Int reserved_coarse_size, HYPRE_BigInt *reserved_coarse_nodes ); + +HYPRE_Int +hypre_MGRSetReservedCpointsLevelToKeep_flt( void *mgr_vdata, HYPRE_Int level ); +HYPRE_Int +hypre_MGRSetReservedCpointsLevelToKeep_dbl( void *mgr_vdata, HYPRE_Int level ); +HYPRE_Int +hypre_MGRSetReservedCpointsLevelToKeep_long_dbl( void *mgr_vdata, HYPRE_Int level ); + +HYPRE_Int +hypre_MGRSetRestrictType_flt( void *mgr_vdata, HYPRE_Int restrictType ); +HYPRE_Int +hypre_MGRSetRestrictType_dbl( void *mgr_vdata, HYPRE_Int restrictType ); +HYPRE_Int +hypre_MGRSetRestrictType_long_dbl( void *mgr_vdata, HYPRE_Int restrictType ); + +HYPRE_Int +hypre_MGRSetTol_flt( void *mgr_vdata, hypre_float tol ); +HYPRE_Int +hypre_MGRSetTol_dbl( void *mgr_vdata, hypre_double tol ); +HYPRE_Int +hypre_MGRSetTol_long_dbl( void *mgr_vdata, hypre_long_double tol ); + +HYPRE_Int +hypre_MGRSetTruncateCoarseGridThreshold_flt( void *mgr_vdata, hypre_float threshold ); +HYPRE_Int +hypre_MGRSetTruncateCoarseGridThreshold_dbl( void *mgr_vdata, hypre_double threshold ); +HYPRE_Int +hypre_MGRSetTruncateCoarseGridThreshold_long_dbl( void *mgr_vdata, hypre_long_double threshold ); + +HYPRE_Int +hypre_MGRSetup_flt( void *mgr_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_MGRSetup_dbl( void *mgr_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_MGRSetup_long_dbl( void *mgr_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); + +HYPRE_Int +hypre_MGRSetupFrelaxVcycleData_flt( void *mgr_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int level ); +HYPRE_Int +hypre_MGRSetupFrelaxVcycleData_dbl( void *mgr_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int level ); +HYPRE_Int +hypre_MGRSetupFrelaxVcycleData_long_dbl( void *mgr_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int level ); + +HYPRE_Int +hypre_MGRSetupStats_flt( void *mgr_vdata ); +HYPRE_Int +hypre_MGRSetupStats_dbl( void *mgr_vdata ); +HYPRE_Int +hypre_MGRSetupStats_long_dbl( void *mgr_vdata ); + +HYPRE_Int +hypre_MGRSolve_flt( void *mgr_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_MGRSolve_dbl( void *mgr_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_MGRSolve_long_dbl( void *mgr_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); + +HYPRE_Int +hypre_MGRTruncateAcfCPR_flt( hypre_ParCSRMatrix *A_CF, hypre_ParCSRMatrix **A_CF_new_ptr ); +HYPRE_Int +hypre_MGRTruncateAcfCPR_dbl( hypre_ParCSRMatrix *A_CF, hypre_ParCSRMatrix **A_CF_new_ptr ); +HYPRE_Int +hypre_MGRTruncateAcfCPR_long_dbl( hypre_ParCSRMatrix *A_CF, hypre_ParCSRMatrix **A_CF_new_ptr ); + +HYPRE_Int +hypre_MGRTruncateAcfCPRDevice_flt( hypre_ParCSRMatrix *A_CF, hypre_ParCSRMatrix **A_CF_new_ptr ); +HYPRE_Int +hypre_MGRTruncateAcfCPRDevice_dbl( hypre_ParCSRMatrix *A_CF, hypre_ParCSRMatrix **A_CF_new_ptr ); +HYPRE_Int +hypre_MGRTruncateAcfCPRDevice_long_dbl( hypre_ParCSRMatrix *A_CF, hypre_ParCSRMatrix **A_CF_new_ptr ); + +HYPRE_Int +hypre_MPSchwarzCFFWSolve_flt( hypre_ParCSRMatrix *par_A, hypre_Vector *rhs_vector, hypre_CSRMatrix *domain_structure, hypre_ParVector *par_x, hypre_float relax_wt, hypre_Vector *aux_vector, HYPRE_Int *CF_marker, HYPRE_Int rlx_pt, HYPRE_Int *pivots, HYPRE_Int use_nonsymm ); +HYPRE_Int +hypre_MPSchwarzCFFWSolve_dbl( hypre_ParCSRMatrix *par_A, hypre_Vector *rhs_vector, hypre_CSRMatrix *domain_structure, hypre_ParVector *par_x, hypre_double relax_wt, hypre_Vector *aux_vector, HYPRE_Int *CF_marker, HYPRE_Int rlx_pt, HYPRE_Int *pivots, HYPRE_Int use_nonsymm ); +HYPRE_Int +hypre_MPSchwarzCFFWSolve_long_dbl( hypre_ParCSRMatrix *par_A, hypre_Vector *rhs_vector, hypre_CSRMatrix *domain_structure, hypre_ParVector *par_x, hypre_long_double relax_wt, hypre_Vector *aux_vector, HYPRE_Int *CF_marker, HYPRE_Int rlx_pt, HYPRE_Int *pivots, HYPRE_Int use_nonsymm ); + +HYPRE_Int +hypre_MPSchwarzCFSolve_flt( hypre_ParCSRMatrix *par_A, hypre_Vector *rhs_vector, hypre_CSRMatrix *domain_structure, hypre_ParVector *par_x, hypre_float relax_wt, hypre_Vector *aux_vector, HYPRE_Int *CF_marker, HYPRE_Int rlx_pt, HYPRE_Int *pivots, HYPRE_Int use_nonsymm ); +HYPRE_Int +hypre_MPSchwarzCFSolve_dbl( hypre_ParCSRMatrix *par_A, hypre_Vector *rhs_vector, hypre_CSRMatrix *domain_structure, hypre_ParVector *par_x, hypre_double relax_wt, hypre_Vector *aux_vector, HYPRE_Int *CF_marker, HYPRE_Int rlx_pt, HYPRE_Int *pivots, HYPRE_Int use_nonsymm ); +HYPRE_Int +hypre_MPSchwarzCFSolve_long_dbl( hypre_ParCSRMatrix *par_A, hypre_Vector *rhs_vector, hypre_CSRMatrix *domain_structure, hypre_ParVector *par_x, hypre_long_double 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_flt( hypre_ParCSRMatrix *par_A, hypre_Vector *rhs_vector, hypre_CSRMatrix *domain_structure, hypre_ParVector *par_x, hypre_float relax_wt, hypre_Vector *aux_vector, HYPRE_Int *pivots, HYPRE_Int use_nonsymm ); +HYPRE_Int +hypre_MPSchwarzFWSolve_dbl( hypre_ParCSRMatrix *par_A, hypre_Vector *rhs_vector, hypre_CSRMatrix *domain_structure, hypre_ParVector *par_x, hypre_double relax_wt, hypre_Vector *aux_vector, HYPRE_Int *pivots, HYPRE_Int use_nonsymm ); +HYPRE_Int +hypre_MPSchwarzFWSolve_long_dbl( hypre_ParCSRMatrix *par_A, hypre_Vector *rhs_vector, hypre_CSRMatrix *domain_structure, hypre_ParVector *par_x, hypre_long_double relax_wt, hypre_Vector *aux_vector, HYPRE_Int *pivots, HYPRE_Int use_nonsymm ); + +HYPRE_Int +hypre_MPSchwarzSolve_flt( hypre_ParCSRMatrix *par_A, hypre_Vector *rhs_vector, hypre_CSRMatrix *domain_structure, hypre_ParVector *par_x, hypre_float relax_wt, hypre_Vector *aux_vector, HYPRE_Int *pivots, HYPRE_Int use_nonsymm ); +HYPRE_Int +hypre_MPSchwarzSolve_dbl( hypre_ParCSRMatrix *par_A, hypre_Vector *rhs_vector, hypre_CSRMatrix *domain_structure, hypre_ParVector *par_x, hypre_double relax_wt, hypre_Vector *aux_vector, HYPRE_Int *pivots, HYPRE_Int use_nonsymm ); +HYPRE_Int +hypre_MPSchwarzSolve_long_dbl( hypre_ParCSRMatrix *par_A, hypre_Vector *rhs_vector, hypre_CSRMatrix *domain_structure, hypre_ParVector *par_x, hypre_long_double relax_wt, hypre_Vector *aux_vector, HYPRE_Int *pivots, HYPRE_Int use_nonsymm ); + +void * +hypre_NSHCreate_flt( void ); +void * +hypre_NSHCreate_dbl( void ); +void * +hypre_NSHCreate_long_dbl( void ); + +HYPRE_Int +hypre_NSHDestroy_flt( void *data ); +HYPRE_Int +hypre_NSHDestroy_dbl( void *data ); +HYPRE_Int +hypre_NSHDestroy_long_dbl( void *data ); + +HYPRE_Int +hypre_NSHSetColVersion_flt( void *nsh_vdata, HYPRE_Int mr_col_version ); +HYPRE_Int +hypre_NSHSetColVersion_dbl( void *nsh_vdata, HYPRE_Int mr_col_version ); +HYPRE_Int +hypre_NSHSetColVersion_long_dbl( void *nsh_vdata, HYPRE_Int mr_col_version ); + +HYPRE_Int +hypre_NSHSetDropThreshold_flt( void *nsh_vdata, hypre_float droptol ); +HYPRE_Int +hypre_NSHSetDropThreshold_dbl( void *nsh_vdata, hypre_double droptol ); +HYPRE_Int +hypre_NSHSetDropThreshold_long_dbl( void *nsh_vdata, hypre_long_double droptol ); + +HYPRE_Int +hypre_NSHSetDropThresholdArray_flt( void *nsh_vdata, hypre_float *droptol ); +HYPRE_Int +hypre_NSHSetDropThresholdArray_dbl( void *nsh_vdata, hypre_double *droptol ); +HYPRE_Int +hypre_NSHSetDropThresholdArray_long_dbl( void *nsh_vdata, hypre_long_double *droptol ); + +HYPRE_Int +hypre_NSHSetGlobalSolver_flt( void *nsh_vdata, HYPRE_Int global_solver ); +HYPRE_Int +hypre_NSHSetGlobalSolver_dbl( void *nsh_vdata, HYPRE_Int global_solver ); +HYPRE_Int +hypre_NSHSetGlobalSolver_long_dbl( void *nsh_vdata, HYPRE_Int global_solver ); + +HYPRE_Int +hypre_NSHSetLogging_flt( void *nsh_vdata, HYPRE_Int logging ); +HYPRE_Int +hypre_NSHSetLogging_dbl( void *nsh_vdata, HYPRE_Int logging ); +HYPRE_Int +hypre_NSHSetLogging_long_dbl( void *nsh_vdata, HYPRE_Int logging ); + +HYPRE_Int +hypre_NSHSetMRMaxIter_flt( void *nsh_vdata, HYPRE_Int mr_max_iter ); +HYPRE_Int +hypre_NSHSetMRMaxIter_dbl( void *nsh_vdata, HYPRE_Int mr_max_iter ); +HYPRE_Int +hypre_NSHSetMRMaxIter_long_dbl( void *nsh_vdata, HYPRE_Int mr_max_iter ); + +HYPRE_Int +hypre_NSHSetMRMaxRowNnz_flt( void *nsh_vdata, HYPRE_Int mr_max_row_nnz ); +HYPRE_Int +hypre_NSHSetMRMaxRowNnz_dbl( void *nsh_vdata, HYPRE_Int mr_max_row_nnz ); +HYPRE_Int +hypre_NSHSetMRMaxRowNnz_long_dbl( void *nsh_vdata, HYPRE_Int mr_max_row_nnz ); + +HYPRE_Int +hypre_NSHSetMRTol_flt( void *nsh_vdata, hypre_float mr_tol ); +HYPRE_Int +hypre_NSHSetMRTol_dbl( void *nsh_vdata, hypre_double mr_tol ); +HYPRE_Int +hypre_NSHSetMRTol_long_dbl( void *nsh_vdata, hypre_long_double mr_tol ); + +HYPRE_Int +hypre_NSHSetMaxIter_flt( void *nsh_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_NSHSetMaxIter_dbl( void *nsh_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_NSHSetMaxIter_long_dbl( void *nsh_vdata, HYPRE_Int max_iter ); + +HYPRE_Int +hypre_NSHSetNSHMaxIter_flt( void *nsh_vdata, HYPRE_Int nsh_max_iter ); +HYPRE_Int +hypre_NSHSetNSHMaxIter_dbl( void *nsh_vdata, HYPRE_Int nsh_max_iter ); +HYPRE_Int +hypre_NSHSetNSHMaxIter_long_dbl( void *nsh_vdata, HYPRE_Int nsh_max_iter ); + +HYPRE_Int +hypre_NSHSetNSHMaxRowNnz_flt( void *nsh_vdata, HYPRE_Int nsh_max_row_nnz ); +HYPRE_Int +hypre_NSHSetNSHMaxRowNnz_dbl( void *nsh_vdata, HYPRE_Int nsh_max_row_nnz ); +HYPRE_Int +hypre_NSHSetNSHMaxRowNnz_long_dbl( void *nsh_vdata, HYPRE_Int nsh_max_row_nnz ); + +HYPRE_Int +hypre_NSHSetNSHTol_flt( void *nsh_vdata, hypre_float nsh_tol ); +HYPRE_Int +hypre_NSHSetNSHTol_dbl( void *nsh_vdata, hypre_double nsh_tol ); +HYPRE_Int +hypre_NSHSetNSHTol_long_dbl( void *nsh_vdata, hypre_long_double nsh_tol ); + +HYPRE_Int +hypre_NSHSetPrintLevel_flt( void *nsh_vdata, HYPRE_Int print_level ); +HYPRE_Int +hypre_NSHSetPrintLevel_dbl( void *nsh_vdata, HYPRE_Int print_level ); +HYPRE_Int +hypre_NSHSetPrintLevel_long_dbl( void *nsh_vdata, HYPRE_Int print_level ); + +HYPRE_Int +hypre_NSHSetTol_flt( void *nsh_vdata, hypre_float tol ); +HYPRE_Int +hypre_NSHSetTol_dbl( void *nsh_vdata, hypre_double tol ); +HYPRE_Int +hypre_NSHSetTol_long_dbl( void *nsh_vdata, hypre_long_double tol ); + +HYPRE_Int +hypre_NSHSetup_flt( void *nsh_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_NSHSetup_dbl( void *nsh_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_NSHSetup_long_dbl( void *nsh_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); + +HYPRE_Int +hypre_NSHSolve_flt( void *nsh_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_NSHSolve_dbl( void *nsh_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_NSHSolve_long_dbl( void *nsh_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); + +HYPRE_Int +hypre_NSHSolveInverse_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, hypre_ParCSRMatrix *M, hypre_ParVector *ftemp, hypre_ParVector *utemp ); +HYPRE_Int +hypre_NSHSolveInverse_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, hypre_ParCSRMatrix *M, hypre_ParVector *ftemp, hypre_ParVector *utemp ); +HYPRE_Int +hypre_NSHSolveInverse_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, hypre_ParCSRMatrix *M, hypre_ParVector *ftemp, hypre_ParVector *utemp ); + +HYPRE_Int +hypre_NSHWriteSolverParams_flt( void *nsh_vdata ); +HYPRE_Int +hypre_NSHWriteSolverParams_dbl( void *nsh_vdata ); +HYPRE_Int +hypre_NSHWriteSolverParams_long_dbl( void *nsh_vdata ); + +HYPRE_Int +hypre_NonGalerkinIJBigBufferInit_flt( HYPRE_Int *ijbuf_cnt, HYPRE_Int *ijbuf_rowcounter, HYPRE_BigInt *ijbuf_numcols ); +HYPRE_Int +hypre_NonGalerkinIJBigBufferInit_dbl( HYPRE_Int *ijbuf_cnt, HYPRE_Int *ijbuf_rowcounter, HYPRE_BigInt *ijbuf_numcols ); +HYPRE_Int +hypre_NonGalerkinIJBigBufferInit_long_dbl( HYPRE_Int *ijbuf_cnt, HYPRE_Int *ijbuf_rowcounter, HYPRE_BigInt *ijbuf_numcols ); + +HYPRE_Int +hypre_NonGalerkinIJBufferCompress_flt( HYPRE_MemoryLocation memory_location, HYPRE_Int ijbuf_size, HYPRE_Int *ijbuf_cnt, HYPRE_Int *ijbuf_rowcounter, hypre_float **ijbuf_data, HYPRE_BigInt **ijbuf_cols, HYPRE_BigInt **ijbuf_rownums, HYPRE_Int **ijbuf_numcols ); +HYPRE_Int +hypre_NonGalerkinIJBufferCompress_dbl( HYPRE_MemoryLocation memory_location, HYPRE_Int ijbuf_size, HYPRE_Int *ijbuf_cnt, HYPRE_Int *ijbuf_rowcounter, hypre_double **ijbuf_data, HYPRE_BigInt **ijbuf_cols, HYPRE_BigInt **ijbuf_rownums, HYPRE_Int **ijbuf_numcols ); +HYPRE_Int +hypre_NonGalerkinIJBufferCompress_long_dbl( HYPRE_MemoryLocation memory_location, HYPRE_Int ijbuf_size, HYPRE_Int *ijbuf_cnt, HYPRE_Int *ijbuf_rowcounter, hypre_long_double **ijbuf_data, HYPRE_BigInt **ijbuf_cols, HYPRE_BigInt **ijbuf_rownums, HYPRE_Int **ijbuf_numcols ); + +HYPRE_Int +hypre_NonGalerkinIJBufferCompressRow_flt( HYPRE_Int *ijbuf_cnt, HYPRE_Int ijbuf_rowcounter, hypre_float *ijbuf_data, HYPRE_BigInt *ijbuf_cols, HYPRE_BigInt *ijbuf_rownums, HYPRE_Int *ijbuf_numcols ); +HYPRE_Int +hypre_NonGalerkinIJBufferCompressRow_dbl( HYPRE_Int *ijbuf_cnt, HYPRE_Int ijbuf_rowcounter, hypre_double *ijbuf_data, HYPRE_BigInt *ijbuf_cols, HYPRE_BigInt *ijbuf_rownums, HYPRE_Int *ijbuf_numcols ); +HYPRE_Int +hypre_NonGalerkinIJBufferCompressRow_long_dbl( HYPRE_Int *ijbuf_cnt, HYPRE_Int ijbuf_rowcounter, hypre_long_double *ijbuf_data, HYPRE_BigInt *ijbuf_cols, HYPRE_BigInt *ijbuf_rownums, HYPRE_Int *ijbuf_numcols ); + +HYPRE_Int +hypre_NonGalerkinIJBufferEmpty_flt( HYPRE_IJMatrix B, HYPRE_Int ijbuf_size, HYPRE_Int *ijbuf_cnt, HYPRE_Int ijbuf_rowcounter, hypre_float **ijbuf_data, HYPRE_BigInt **ijbuf_cols, HYPRE_BigInt **ijbuf_rownums, HYPRE_Int **ijbuf_numcols ); +HYPRE_Int +hypre_NonGalerkinIJBufferEmpty_dbl( HYPRE_IJMatrix B, HYPRE_Int ijbuf_size, HYPRE_Int *ijbuf_cnt, HYPRE_Int ijbuf_rowcounter, hypre_double **ijbuf_data, HYPRE_BigInt **ijbuf_cols, HYPRE_BigInt **ijbuf_rownums, HYPRE_Int **ijbuf_numcols ); +HYPRE_Int +hypre_NonGalerkinIJBufferEmpty_long_dbl( HYPRE_IJMatrix B, HYPRE_Int ijbuf_size, HYPRE_Int *ijbuf_cnt, HYPRE_Int ijbuf_rowcounter, hypre_long_double **ijbuf_data, HYPRE_BigInt **ijbuf_cols, HYPRE_BigInt **ijbuf_rownums, HYPRE_Int **ijbuf_numcols ); + +HYPRE_Int +hypre_NonGalerkinIJBufferInit_flt( HYPRE_Int *ijbuf_cnt, HYPRE_Int *ijbuf_rowcounter, HYPRE_Int *ijbuf_numcols ); +HYPRE_Int +hypre_NonGalerkinIJBufferInit_dbl( HYPRE_Int *ijbuf_cnt, HYPRE_Int *ijbuf_rowcounter, HYPRE_Int *ijbuf_numcols ); +HYPRE_Int +hypre_NonGalerkinIJBufferInit_long_dbl( HYPRE_Int *ijbuf_cnt, HYPRE_Int *ijbuf_rowcounter, HYPRE_Int *ijbuf_numcols ); + +HYPRE_Int +hypre_NonGalerkinIJBufferNewRow_flt( HYPRE_BigInt *ijbuf_rownums, HYPRE_Int *ijbuf_numcols, HYPRE_Int *ijbuf_rowcounter, HYPRE_BigInt new_row ); +HYPRE_Int +hypre_NonGalerkinIJBufferNewRow_dbl( HYPRE_BigInt *ijbuf_rownums, HYPRE_Int *ijbuf_numcols, HYPRE_Int *ijbuf_rowcounter, HYPRE_BigInt new_row ); +HYPRE_Int +hypre_NonGalerkinIJBufferNewRow_long_dbl( HYPRE_BigInt *ijbuf_rownums, HYPRE_Int *ijbuf_numcols, HYPRE_Int *ijbuf_rowcounter, HYPRE_BigInt new_row ); + +HYPRE_Int +hypre_NonGalerkinIJBufferWrite_flt( HYPRE_IJMatrix B, HYPRE_Int *ijbuf_cnt, HYPRE_Int ijbuf_size, HYPRE_Int *ijbuf_rowcounter, hypre_float **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_float val_to_write ); +HYPRE_Int +hypre_NonGalerkinIJBufferWrite_dbl( HYPRE_IJMatrix B, HYPRE_Int *ijbuf_cnt, HYPRE_Int ijbuf_size, HYPRE_Int *ijbuf_rowcounter, hypre_double **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_double val_to_write ); +HYPRE_Int +hypre_NonGalerkinIJBufferWrite_long_dbl( HYPRE_IJMatrix B, HYPRE_Int *ijbuf_cnt, HYPRE_Int ijbuf_size, HYPRE_Int *ijbuf_rowcounter, hypre_long_double **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_long_double val_to_write ); + +hypre_ParCSRMatrix * +hypre_NonGalerkinSparsityPattern_flt( hypre_ParCSRMatrix *R_IAP, hypre_ParCSRMatrix *RAP, HYPRE_Int * CF_marker, hypre_float droptol, HYPRE_Int sym_collapse, HYPRE_Int collapse_beta ); +hypre_ParCSRMatrix * +hypre_NonGalerkinSparsityPattern_dbl( hypre_ParCSRMatrix *R_IAP, hypre_ParCSRMatrix *RAP, HYPRE_Int * CF_marker, hypre_double droptol, HYPRE_Int sym_collapse, HYPRE_Int collapse_beta ); +hypre_ParCSRMatrix * +hypre_NonGalerkinSparsityPattern_long_dbl( hypre_ParCSRMatrix *R_IAP, hypre_ParCSRMatrix *RAP, HYPRE_Int * CF_marker, hypre_long_double droptol, HYPRE_Int sym_collapse, HYPRE_Int collapse_beta ); + +HYPRE_Int +hypre_ParAMGCreateDomainDof_flt( 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_ParAMGCreateDomainDof_dbl( 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_ParAMGCreateDomainDof_long_dbl( 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_ParAdSchwarzSolve_flt( hypre_ParCSRMatrix *A, hypre_ParVector *F, hypre_CSRMatrix *domain_structure, hypre_float *scale, hypre_ParVector *X, hypre_ParVector *Vtemp, HYPRE_Int *pivots, HYPRE_Int use_nonsymm ); +HYPRE_Int +hypre_ParAdSchwarzSolve_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *F, hypre_CSRMatrix *domain_structure, hypre_double *scale, hypre_ParVector *X, hypre_ParVector *Vtemp, HYPRE_Int *pivots, HYPRE_Int use_nonsymm ); +HYPRE_Int +hypre_ParAdSchwarzSolve_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *F, hypre_CSRMatrix *domain_structure, hypre_long_double *scale, hypre_ParVector *X, hypre_ParVector *Vtemp, HYPRE_Int *pivots, HYPRE_Int use_nonsymm ); + +HYPRE_Int +hypre_ParCSRComputeL1Norms_flt( hypre_ParCSRMatrix *A, HYPRE_Int option, HYPRE_Int *cf_marker, hypre_float **l1_norm_ptr ); +HYPRE_Int +hypre_ParCSRComputeL1Norms_dbl( hypre_ParCSRMatrix *A, HYPRE_Int option, HYPRE_Int *cf_marker, hypre_double **l1_norm_ptr ); +HYPRE_Int +hypre_ParCSRComputeL1Norms_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int option, HYPRE_Int *cf_marker, hypre_long_double **l1_norm_ptr ); + +HYPRE_Int +hypre_ParCSRComputeL1NormsThreads_flt( hypre_ParCSRMatrix *A, HYPRE_Int option, HYPRE_Int num_threads, HYPRE_Int *cf_marker, hypre_float **l1_norm_ptr ); +HYPRE_Int +hypre_ParCSRComputeL1NormsThreads_dbl( hypre_ParCSRMatrix *A, HYPRE_Int option, HYPRE_Int num_threads, HYPRE_Int *cf_marker, hypre_double **l1_norm_ptr ); +HYPRE_Int +hypre_ParCSRComputeL1NormsThreads_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int option, HYPRE_Int num_threads, HYPRE_Int *cf_marker, hypre_long_double **l1_norm_ptr ); + +HYPRE_Int +hypre_ParCSRMatrixBlockDiagMatrix_flt( 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_ParCSRMatrixBlockDiagMatrix_dbl( 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_ParCSRMatrixBlockDiagMatrix_long_dbl( 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_flt( 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_dbl( 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_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int blk_size, HYPRE_Int point_type, HYPRE_Int *CF_marker, HYPRE_Int diag_type, hypre_ParCSRMatrix **B_ptr ); + +HYPRE_Real +hypre_ParCSRMatrixChooseThresh_flt( hypre_ParCSRMatrix *S ); +HYPRE_Real +hypre_ParCSRMatrixChooseThresh_dbl( hypre_ParCSRMatrix *S ); +HYPRE_Real +hypre_ParCSRMatrixChooseThresh_long_dbl( hypre_ParCSRMatrix *S ); + +HYPRE_Int +hypre_ParCSRMatrixExtractBlockDiagHost_flt( 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_float *diag_data ); +HYPRE_Int +hypre_ParCSRMatrixExtractBlockDiagHost_dbl( 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_double *diag_data ); +HYPRE_Int +hypre_ParCSRMatrixExtractBlockDiagHost_long_dbl( 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_long_double *diag_data ); + +HYPRE_Int +hypre_ParCSRMatrixFillSmooth_flt( HYPRE_Int nsamples, hypre_float *samples, hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, HYPRE_Int num_functions, HYPRE_Int *dof_func ); +HYPRE_Int +hypre_ParCSRMatrixFillSmooth_dbl( HYPRE_Int nsamples, hypre_double *samples, hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, HYPRE_Int num_functions, HYPRE_Int *dof_func ); +HYPRE_Int +hypre_ParCSRMatrixFillSmooth_long_dbl( HYPRE_Int nsamples, hypre_long_double *samples, hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, HYPRE_Int num_functions, HYPRE_Int *dof_func ); + +HYPRE_Int +hypre_ParCSRMatrixFixZeroRows_flt( hypre_ParCSRMatrix *A ); +HYPRE_Int +hypre_ParCSRMatrixFixZeroRows_dbl( hypre_ParCSRMatrix *A ); +HYPRE_Int +hypre_ParCSRMatrixFixZeroRows_long_dbl( hypre_ParCSRMatrix *A ); + +HYPRE_Int +hypre_ParCSRMatrixNormFro_flt( hypre_ParCSRMatrix *A, hypre_float *norm_io ); +HYPRE_Int +hypre_ParCSRMatrixNormFro_dbl( hypre_ParCSRMatrix *A, hypre_double *norm_io ); +HYPRE_Int +hypre_ParCSRMatrixNormFro_long_dbl( hypre_ParCSRMatrix *A, hypre_long_double *norm_io ); + +HYPRE_Int +hypre_ParCSRMatrixResNormFro_flt( hypre_ParCSRMatrix *A, hypre_float *norm_io ); +HYPRE_Int +hypre_ParCSRMatrixResNormFro_dbl( hypre_ParCSRMatrix *A, hypre_double *norm_io ); +HYPRE_Int +hypre_ParCSRMatrixResNormFro_long_dbl( hypre_ParCSRMatrix *A, hypre_long_double *norm_io ); + +HYPRE_Int +hypre_ParCSRMatrixScaledNorm_flt( hypre_ParCSRMatrix *A, hypre_float *scnorm ); +HYPRE_Int +hypre_ParCSRMatrixScaledNorm_dbl( hypre_ParCSRMatrix *A, hypre_double *scnorm ); +HYPRE_Int +hypre_ParCSRMatrixScaledNorm_long_dbl( hypre_ParCSRMatrix *A, hypre_long_double *scnorm ); + +HYPRE_Int +hypre_ParCSRMatrixSetDiagRows_flt( hypre_ParCSRMatrix *A, hypre_float d ); +HYPRE_Int +hypre_ParCSRMatrixSetDiagRows_dbl( hypre_ParCSRMatrix *A, hypre_double d ); +HYPRE_Int +hypre_ParCSRMatrixSetDiagRows_long_dbl( hypre_ParCSRMatrix *A, hypre_long_double d ); + +HYPRE_Int +hypre_ParCSRMatrixThreshold_flt( hypre_ParCSRMatrix *A, hypre_float thresh ); +HYPRE_Int +hypre_ParCSRMatrixThreshold_dbl( hypre_ParCSRMatrix *A, hypre_double thresh ); +HYPRE_Int +hypre_ParCSRMatrixThreshold_long_dbl( hypre_ParCSRMatrix *A, hypre_long_double thresh ); + +HYPRE_Int +hypre_ParCSRMatrix_dof_func_offd_flt( hypre_ParCSRMatrix *A, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int **dof_func_offd ); +HYPRE_Int +hypre_ParCSRMatrix_dof_func_offd_dbl( hypre_ParCSRMatrix *A, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int **dof_func_offd ); +HYPRE_Int +hypre_ParCSRMatrix_dof_func_offd_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int **dof_func_offd ); + +HYPRE_Int +hypre_ParCSRMaxEigEstimate_flt( hypre_ParCSRMatrix *A, HYPRE_Int scale, hypre_float *max_eig, hypre_float *min_eig ); +HYPRE_Int +hypre_ParCSRMaxEigEstimate_dbl( hypre_ParCSRMatrix *A, HYPRE_Int scale, hypre_double *max_eig, hypre_double *min_eig ); +HYPRE_Int +hypre_ParCSRMaxEigEstimate_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int scale, hypre_long_double *max_eig, hypre_long_double *min_eig ); + +HYPRE_Int +hypre_ParCSRMaxEigEstimateCG_flt( hypre_ParCSRMatrix *A, HYPRE_Int scale, HYPRE_Int max_iter, hypre_float *max_eig, hypre_float *min_eig ); +HYPRE_Int +hypre_ParCSRMaxEigEstimateCG_dbl( hypre_ParCSRMatrix *A, HYPRE_Int scale, HYPRE_Int max_iter, hypre_double *max_eig, hypre_double *min_eig ); +HYPRE_Int +hypre_ParCSRMaxEigEstimateCG_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int scale, HYPRE_Int max_iter, hypre_long_double *max_eig, hypre_long_double *min_eig ); + +HYPRE_Int +hypre_ParCSRMaxEigEstimateCGHost_flt( hypre_ParCSRMatrix *A, HYPRE_Int scale, HYPRE_Int max_iter, hypre_float *max_eig, hypre_float *min_eig ); +HYPRE_Int +hypre_ParCSRMaxEigEstimateCGHost_dbl( hypre_ParCSRMatrix *A, HYPRE_Int scale, HYPRE_Int max_iter, hypre_double *max_eig, hypre_double *min_eig ); +HYPRE_Int +hypre_ParCSRMaxEigEstimateCGHost_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int scale, HYPRE_Int max_iter, hypre_long_double *max_eig, hypre_long_double *min_eig ); + +HYPRE_Int +hypre_ParCSRMaxEigEstimateHost_flt( hypre_ParCSRMatrix *A, HYPRE_Int scale, hypre_float *max_eig, hypre_float *min_eig ); +HYPRE_Int +hypre_ParCSRMaxEigEstimateHost_dbl( hypre_ParCSRMatrix *A, HYPRE_Int scale, hypre_double *max_eig, hypre_double *min_eig ); +HYPRE_Int +hypre_ParCSRMaxEigEstimateHost_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int scale, hypre_long_double *max_eig, hypre_long_double *min_eig ); + +HYPRE_Int +hypre_ParCSRRelax_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int relax_type, HYPRE_Int relax_times, hypre_float *l1_norms, hypre_float relax_weight, hypre_float omega, hypre_float max_eig_est, hypre_float min_eig_est, HYPRE_Int cheby_order, hypre_float cheby_fraction, hypre_ParVector *u, hypre_ParVector *v, hypre_ParVector *z ); +HYPRE_Int +hypre_ParCSRRelax_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int relax_type, HYPRE_Int relax_times, hypre_double *l1_norms, hypre_double relax_weight, hypre_double omega, hypre_double max_eig_est, hypre_double min_eig_est, HYPRE_Int cheby_order, hypre_double cheby_fraction, hypre_ParVector *u, hypre_ParVector *v, hypre_ParVector *z ); +HYPRE_Int +hypre_ParCSRRelax_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int relax_type, HYPRE_Int relax_times, hypre_long_double *l1_norms, hypre_long_double relax_weight, hypre_long_double omega, hypre_long_double max_eig_est, hypre_long_double min_eig_est, HYPRE_Int cheby_order, hypre_long_double cheby_fraction, hypre_ParVector *u, hypre_ParVector *v, hypre_ParVector *z ); + +HYPRE_Int +hypre_ParCSRRelax_CG_flt( HYPRE_Solver solver, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int num_its ); +HYPRE_Int +hypre_ParCSRRelax_CG_dbl( HYPRE_Solver solver, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int num_its ); +HYPRE_Int +hypre_ParCSRRelax_CG_long_dbl( HYPRE_Solver solver, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int num_its ); + +HYPRE_Int +hypre_ParCSRRelax_Cheby_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_float max_eig, hypre_float min_eig, hypre_float fraction, HYPRE_Int order, HYPRE_Int scale, HYPRE_Int variant, hypre_ParVector *u, hypre_ParVector *v, hypre_ParVector *r ); +HYPRE_Int +hypre_ParCSRRelax_Cheby_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_double max_eig, hypre_double min_eig, hypre_double fraction, HYPRE_Int order, HYPRE_Int scale, HYPRE_Int variant, hypre_ParVector *u, hypre_ParVector *v, hypre_ParVector *r ); +HYPRE_Int +hypre_ParCSRRelax_Cheby_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_long_double max_eig, hypre_long_double min_eig, hypre_long_double fraction, HYPRE_Int order, HYPRE_Int scale, HYPRE_Int variant, hypre_ParVector *u, hypre_ParVector *v, hypre_ParVector *r ); + +HYPRE_Int +hypre_ParCSRRelax_Cheby_Setup_flt( hypre_ParCSRMatrix *A, hypre_float max_eig, hypre_float min_eig, hypre_float fraction, HYPRE_Int order, HYPRE_Int scale, HYPRE_Int variant, hypre_float **coefs_ptr, hypre_float **ds_ptr ); +HYPRE_Int +hypre_ParCSRRelax_Cheby_Setup_dbl( hypre_ParCSRMatrix *A, hypre_double max_eig, hypre_double min_eig, hypre_double fraction, HYPRE_Int order, HYPRE_Int scale, HYPRE_Int variant, hypre_double **coefs_ptr, hypre_double **ds_ptr ); +HYPRE_Int +hypre_ParCSRRelax_Cheby_Setup_long_dbl( hypre_ParCSRMatrix *A, hypre_long_double max_eig, hypre_long_double min_eig, hypre_long_double fraction, HYPRE_Int order, HYPRE_Int scale, HYPRE_Int variant, hypre_long_double **coefs_ptr, hypre_long_double **ds_ptr ); + +HYPRE_Int +hypre_ParCSRRelax_Cheby_Solve_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_float *ds_data, hypre_float *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_Solve_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_double *ds_data, hypre_double *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_Solve_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_long_double *ds_data, hypre_long_double *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_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_float *ds_data, hypre_float *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_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_double *ds_data, hypre_double *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_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_long_double *ds_data, hypre_long_double *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_L1_Jacobi_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_float relax_weight, hypre_float *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp ); +HYPRE_Int +hypre_ParCSRRelax_L1_Jacobi_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_double relax_weight, hypre_double *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp ); +HYPRE_Int +hypre_ParCSRRelax_L1_Jacobi_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_long_double relax_weight, hypre_long_double *l1_norms, hypre_ParVector *u, hypre_ParVector *Vtemp ); + +HYPRE_Int +hypre_ParCSRSubspacePrec_flt( hypre_ParCSRMatrix *A0, HYPRE_Int A0_relax_type, HYPRE_Int A0_relax_times, hypre_float *A0_l1_norms, hypre_float A0_relax_weight, hypre_float A0_omega, hypre_float A0_max_eig_est, hypre_float A0_min_eig_est, HYPRE_Int A0_cheby_order, hypre_float 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_ParCSRSubspacePrec_dbl( hypre_ParCSRMatrix *A0, HYPRE_Int A0_relax_type, HYPRE_Int A0_relax_times, hypre_double *A0_l1_norms, hypre_double A0_relax_weight, hypre_double A0_omega, hypre_double A0_max_eig_est, hypre_double A0_min_eig_est, HYPRE_Int A0_cheby_order, hypre_double 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_ParCSRSubspacePrec_long_dbl( hypre_ParCSRMatrix *A0, HYPRE_Int A0_relax_type, HYPRE_Int A0_relax_times, hypre_long_double *A0_l1_norms, hypre_long_double A0_relax_weight, hypre_long_double A0_omega, hypre_long_double A0_max_eig_est, hypre_long_double A0_min_eig_est, HYPRE_Int A0_cheby_order, hypre_long_double 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_ParGenerateHybridScale_flt( hypre_ParCSRMatrix *A, hypre_CSRMatrix *domain_structure, hypre_CSRMatrix **A_boundary_pointer, hypre_float **scale_pointer ); +HYPRE_Int +hypre_ParGenerateHybridScale_dbl( hypre_ParCSRMatrix *A, hypre_CSRMatrix *domain_structure, hypre_CSRMatrix **A_boundary_pointer, hypre_double **scale_pointer ); +HYPRE_Int +hypre_ParGenerateHybridScale_long_dbl( hypre_ParCSRMatrix *A, hypre_CSRMatrix *domain_structure, hypre_CSRMatrix **A_boundary_pointer, hypre_long_double **scale_pointer ); + +HYPRE_Int +hypre_ParGenerateScale_flt( hypre_ParCSRMatrix *A, hypre_CSRMatrix *domain_structure, hypre_float relaxation_weight, hypre_float **scale_pointer ); +HYPRE_Int +hypre_ParGenerateScale_dbl( hypre_ParCSRMatrix *A, hypre_CSRMatrix *domain_structure, hypre_double relaxation_weight, hypre_double **scale_pointer ); +HYPRE_Int +hypre_ParGenerateScale_long_dbl( hypre_ParCSRMatrix *A, hypre_CSRMatrix *domain_structure, hypre_long_double relaxation_weight, hypre_long_double **scale_pointer ); + +HYPRE_Int +hypre_ParILUExtractEBFC_flt( hypre_CSRMatrix *A_diag, HYPRE_Int nLU, hypre_CSRMatrix **Bp, hypre_CSRMatrix **Cp, hypre_CSRMatrix **Ep, hypre_CSRMatrix **Fp ); +HYPRE_Int +hypre_ParILUExtractEBFC_dbl( hypre_CSRMatrix *A_diag, HYPRE_Int nLU, hypre_CSRMatrix **Bp, hypre_CSRMatrix **Cp, hypre_CSRMatrix **Ep, hypre_CSRMatrix **Fp ); +HYPRE_Int +hypre_ParILUExtractEBFC_long_dbl( hypre_CSRMatrix *A_diag, HYPRE_Int nLU, hypre_CSRMatrix **Bp, hypre_CSRMatrix **Cp, hypre_CSRMatrix **Ep, hypre_CSRMatrix **Fp ); + +HYPRE_Int +hypre_ParILURAPReorder_flt( hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int *rqperm, hypre_ParCSRMatrix **A_pq ); +HYPRE_Int +hypre_ParILURAPReorder_dbl( hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int *rqperm, hypre_ParCSRMatrix **A_pq ); +HYPRE_Int +hypre_ParILURAPReorder_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int *rqperm, hypre_ParCSRMatrix **A_pq ); + +HYPRE_Int +hypre_ParILURAPSchurGMRESCommInfoHost_flt( void *ilu_vdata, HYPRE_Int *my_id, HYPRE_Int *num_procs ); +HYPRE_Int +hypre_ParILURAPSchurGMRESCommInfoHost_dbl( void *ilu_vdata, HYPRE_Int *my_id, HYPRE_Int *num_procs ); +HYPRE_Int +hypre_ParILURAPSchurGMRESCommInfoHost_long_dbl( void *ilu_vdata, HYPRE_Int *my_id, HYPRE_Int *num_procs ); + +HYPRE_Int +hypre_ParILURAPSchurGMRESMatvecHost_flt( void *matvec_data, hypre_float alpha, void *ilu_vdata, void *x, hypre_float beta, void *y ); +HYPRE_Int +hypre_ParILURAPSchurGMRESMatvecHost_dbl( void *matvec_data, hypre_double alpha, void *ilu_vdata, void *x, hypre_double beta, void *y ); +HYPRE_Int +hypre_ParILURAPSchurGMRESMatvecHost_long_dbl( void *matvec_data, hypre_long_double alpha, void *ilu_vdata, void *x, hypre_long_double beta, void *y ); + +HYPRE_Int +hypre_ParILURAPSchurGMRESSolveHost_flt( void *ilu_vdata, void *ilu_vdata2, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_ParILURAPSchurGMRESSolveHost_dbl( void *ilu_vdata, void *ilu_vdata2, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_ParILURAPSchurGMRESSolveHost_long_dbl( void *ilu_vdata, void *ilu_vdata2, hypre_ParVector *f, hypre_ParVector *u ); + +HYPRE_Int +hypre_ParKrylovAxpy_flt( hypre_float alpha, void *x, void *y ); +HYPRE_Int +hypre_ParKrylovAxpy_dbl( hypre_double alpha, void *x, void *y ); +HYPRE_Int +hypre_ParKrylovAxpy_long_dbl( hypre_long_double alpha, void *x, void *y ); + +void * +hypre_ParKrylovCAlloc_flt( size_t count, size_t elt_size, HYPRE_MemoryLocation location ); +void * +hypre_ParKrylovCAlloc_dbl( size_t count, size_t elt_size, HYPRE_MemoryLocation location ); +void * +hypre_ParKrylovCAlloc_long_dbl( size_t count, size_t elt_size, HYPRE_MemoryLocation location ); + +HYPRE_Int +hypre_ParKrylovClearVector_flt( void *x ); +HYPRE_Int +hypre_ParKrylovClearVector_dbl( void *x ); +HYPRE_Int +hypre_ParKrylovClearVector_long_dbl( void *x ); + +HYPRE_Int +hypre_ParKrylovCommInfo_flt( void *A, HYPRE_Int *my_id, HYPRE_Int *num_procs ); +HYPRE_Int +hypre_ParKrylovCommInfo_dbl( void *A, HYPRE_Int *my_id, HYPRE_Int *num_procs ); +HYPRE_Int +hypre_ParKrylovCommInfo_long_dbl( void *A, HYPRE_Int *my_id, HYPRE_Int *num_procs ); + +HYPRE_Int +hypre_ParKrylovCopyVector_flt( void *x, void *y ); +HYPRE_Int +hypre_ParKrylovCopyVector_dbl( void *x, void *y ); +HYPRE_Int +hypre_ParKrylovCopyVector_long_dbl( void *x, void *y ); + +void * +hypre_ParKrylovCreateVector_flt( void *vvector ); +void * +hypre_ParKrylovCreateVector_dbl( void *vvector ); +void * +hypre_ParKrylovCreateVector_long_dbl( void *vvector ); + +void * +hypre_ParKrylovCreateVectorArray_flt( HYPRE_Int n, void *vvector ); +void * +hypre_ParKrylovCreateVectorArray_dbl( HYPRE_Int n, void *vvector ); +void * +hypre_ParKrylovCreateVectorArray_long_dbl( HYPRE_Int n, void *vvector ); + +HYPRE_Int +hypre_ParKrylovDestroyVector_flt( void *vvector ); +HYPRE_Int +hypre_ParKrylovDestroyVector_dbl( void *vvector ); +HYPRE_Int +hypre_ParKrylovDestroyVector_long_dbl( void *vvector ); + +HYPRE_Int +hypre_ParKrylovFree_flt( void *ptr ); +HYPRE_Int +hypre_ParKrylovFree_dbl( void *ptr ); +HYPRE_Int +hypre_ParKrylovFree_long_dbl( void *ptr ); + +HYPRE_Int +hypre_ParKrylovIdentity_flt( void *vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_ParKrylovIdentity_dbl( void *vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_ParKrylovIdentity_long_dbl( void *vdata, void *A, void *b, void *x ); + +HYPRE_Int +hypre_ParKrylovIdentitySetup_flt( void *vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_ParKrylovIdentitySetup_dbl( void *vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_ParKrylovIdentitySetup_long_dbl( void *vdata, void *A, void *b, void *x ); + +HYPRE_Real +hypre_ParKrylovInnerProd_flt( void *x, void *y ); +HYPRE_Real +hypre_ParKrylovInnerProd_dbl( void *x, void *y ); +HYPRE_Real +hypre_ParKrylovInnerProd_long_dbl( void *x, void *y ); + +HYPRE_Int +hypre_ParKrylovInnerProdTagged_flt( void *x, void *y, HYPRE_Int *num_tags_ptr, hypre_float **iprod_ptr ); +HYPRE_Int +hypre_ParKrylovInnerProdTagged_dbl( void *x, void *y, HYPRE_Int *num_tags_ptr, hypre_double **iprod_ptr ); +HYPRE_Int +hypre_ParKrylovInnerProdTagged_long_dbl( void *x, void *y, HYPRE_Int *num_tags_ptr, hypre_long_double **iprod_ptr ); + +HYPRE_Int +hypre_ParKrylovMassAxpy_flt( hypre_float *alpha, void **x, void *y, HYPRE_Int k, HYPRE_Int unroll ); +HYPRE_Int +hypre_ParKrylovMassAxpy_dbl( hypre_double *alpha, void **x, void *y, HYPRE_Int k, HYPRE_Int unroll ); +HYPRE_Int +hypre_ParKrylovMassAxpy_long_dbl( hypre_long_double *alpha, void **x, void *y, HYPRE_Int k, HYPRE_Int unroll ); + +HYPRE_Int +hypre_ParKrylovMassDotpTwo_flt( void *x, void *y, void **z, HYPRE_Int k, HYPRE_Int unroll, void *result_x, void *result_y ); +HYPRE_Int +hypre_ParKrylovMassDotpTwo_dbl( void *x, void *y, void **z, HYPRE_Int k, HYPRE_Int unroll, void *result_x, void *result_y ); +HYPRE_Int +hypre_ParKrylovMassDotpTwo_long_dbl( void *x, void *y, void **z, HYPRE_Int k, HYPRE_Int unroll, void *result_x, void *result_y ); + +HYPRE_Int +hypre_ParKrylovMassInnerProd_flt( void *x, void **y, HYPRE_Int k, HYPRE_Int unroll, void *result ); +HYPRE_Int +hypre_ParKrylovMassInnerProd_dbl( void *x, void **y, HYPRE_Int k, HYPRE_Int unroll, void *result ); +HYPRE_Int +hypre_ParKrylovMassInnerProd_long_dbl( void *x, void **y, HYPRE_Int k, HYPRE_Int unroll, void *result ); + +HYPRE_Int +hypre_ParKrylovMatvec_flt( void *matvec_data, hypre_float alpha, void *A, void *x, hypre_float beta, void *y ); +HYPRE_Int +hypre_ParKrylovMatvec_dbl( void *matvec_data, hypre_double alpha, void *A, void *x, hypre_double beta, void *y ); +HYPRE_Int +hypre_ParKrylovMatvec_long_dbl( void *matvec_data, hypre_long_double alpha, void *A, void *x, hypre_long_double beta, void *y ); + +void * +hypre_ParKrylovMatvecCreate_flt( void *A, void *x ); +void * +hypre_ParKrylovMatvecCreate_dbl( void *A, void *x ); +void * +hypre_ParKrylovMatvecCreate_long_dbl( void *A, void *x ); + +HYPRE_Int +hypre_ParKrylovMatvecDestroy_flt( void *matvec_data ); +HYPRE_Int +hypre_ParKrylovMatvecDestroy_dbl( void *matvec_data ); +HYPRE_Int +hypre_ParKrylovMatvecDestroy_long_dbl( void *matvec_data ); + +HYPRE_Int +hypre_ParKrylovMatvecT_flt( void *matvec_data, hypre_float alpha, void *A, void *x, hypre_float beta, void *y ); +HYPRE_Int +hypre_ParKrylovMatvecT_dbl( void *matvec_data, hypre_double alpha, void *A, void *x, hypre_double beta, void *y ); +HYPRE_Int +hypre_ParKrylovMatvecT_long_dbl( void *matvec_data, hypre_long_double alpha, void *A, void *x, hypre_long_double beta, void *y ); + +HYPRE_Int +hypre_ParKrylovScaleVector_flt( hypre_float alpha, void *x ); +HYPRE_Int +hypre_ParKrylovScaleVector_dbl( hypre_double alpha, void *x ); +HYPRE_Int +hypre_ParKrylovScaleVector_long_dbl( hypre_long_double alpha, void *x ); + +HYPRE_Int +hypre_ParMPSchwarzSolve_flt( hypre_ParCSRMatrix *par_A, hypre_CSRMatrix *A_boundary, hypre_ParVector *rhs_vector, hypre_CSRMatrix *domain_structure, hypre_ParVector *par_x, hypre_float relax_wt, hypre_float *scale, hypre_ParVector *Vtemp, HYPRE_Int *pivots, HYPRE_Int use_nonsymm ); +HYPRE_Int +hypre_ParMPSchwarzSolve_dbl( hypre_ParCSRMatrix *par_A, hypre_CSRMatrix *A_boundary, hypre_ParVector *rhs_vector, hypre_CSRMatrix *domain_structure, hypre_ParVector *par_x, hypre_double relax_wt, hypre_double *scale, hypre_ParVector *Vtemp, HYPRE_Int *pivots, HYPRE_Int use_nonsymm ); +HYPRE_Int +hypre_ParMPSchwarzSolve_long_dbl( hypre_ParCSRMatrix *par_A, hypre_CSRMatrix *A_boundary, hypre_ParVector *rhs_vector, hypre_CSRMatrix *domain_structure, hypre_ParVector *par_x, hypre_long_double relax_wt, hypre_long_double *scale, hypre_ParVector *Vtemp, HYPRE_Int *pivots, HYPRE_Int use_nonsymm ); + +HYPRE_Int +hypre_ParPrintVector_flt( void *v, const char *file ); +HYPRE_Int +hypre_ParPrintVector_dbl( void *v, const char *file ); +HYPRE_Int +hypre_ParPrintVector_long_dbl( void *v, const char *file ); + +void * +hypre_ParReadVector_flt( MPI_Comm comm, const char *file ); +void * +hypre_ParReadVector_dbl( MPI_Comm comm, const char *file ); +void * +hypre_ParReadVector_long_dbl( MPI_Comm comm, const char *file ); + +HYPRE_Int +hypre_ParSetRandomValues_flt( void *v, HYPRE_Int seed ); +HYPRE_Int +hypre_ParSetRandomValues_dbl( void *v, HYPRE_Int seed ); +HYPRE_Int +hypre_ParSetRandomValues_long_dbl( void *v, HYPRE_Int seed ); + +HYPRE_Int +hypre_ParVectorBlockGather_flt( hypre_ParVector *x, hypre_ParVector *x_ [3 ], HYPRE_Int dim ); +HYPRE_Int +hypre_ParVectorBlockGather_dbl( hypre_ParVector *x, hypre_ParVector *x_ [3 ], HYPRE_Int dim ); +HYPRE_Int +hypre_ParVectorBlockGather_long_dbl( hypre_ParVector *x, hypre_ParVector *x_ [3 ], HYPRE_Int dim ); + +HYPRE_Int +hypre_ParVectorBlockSplit_flt( hypre_ParVector *x, hypre_ParVector *x_ [3 ], HYPRE_Int dim ); +HYPRE_Int +hypre_ParVectorBlockSplit_dbl( hypre_ParVector *x, hypre_ParVector *x_ [3 ], HYPRE_Int dim ); +HYPRE_Int +hypre_ParVectorBlockSplit_long_dbl( hypre_ParVector *x, hypre_ParVector *x_ [3 ], HYPRE_Int dim ); + +hypre_ParVector * +hypre_ParVectorInDomainOf_flt( hypre_ParCSRMatrix *A ); +hypre_ParVector * +hypre_ParVectorInDomainOf_dbl( hypre_ParCSRMatrix *A ); +hypre_ParVector * +hypre_ParVectorInDomainOf_long_dbl( hypre_ParCSRMatrix *A ); + +hypre_ParVector * +hypre_ParVectorInRangeOf_flt( hypre_ParCSRMatrix *A ); +hypre_ParVector * +hypre_ParVectorInRangeOf_dbl( hypre_ParCSRMatrix *A ); +hypre_ParVector * +hypre_ParVectorInRangeOf_long_dbl( hypre_ParCSRMatrix *A ); + +HYPRE_Int +hypre_ParVectorSize_flt( void *x ); +HYPRE_Int +hypre_ParVectorSize_dbl( void *x ); +HYPRE_Int +hypre_ParVectorSize_long_dbl( void *x ); + +HYPRE_Int +hypre_SchwarzCFSolve_flt( void *schwarz_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *CF_marker, HYPRE_Int rlx_pt ); +HYPRE_Int +hypre_SchwarzCFSolve_dbl( void *schwarz_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *CF_marker, HYPRE_Int rlx_pt ); +HYPRE_Int +hypre_SchwarzCFSolve_long_dbl( void *schwarz_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *CF_marker, HYPRE_Int rlx_pt ); + +void * +hypre_SchwarzCreate_flt( void ); +void * +hypre_SchwarzCreate_dbl( void ); +void * +hypre_SchwarzCreate_long_dbl( void ); + +HYPRE_Int +hypre_SchwarzDestroy_flt( void *data ); +HYPRE_Int +hypre_SchwarzDestroy_dbl( void *data ); +HYPRE_Int +hypre_SchwarzDestroy_long_dbl( void *data ); + +HYPRE_Int +hypre_SchwarzReScale_flt( void *data, HYPRE_Int size, hypre_float value ); +HYPRE_Int +hypre_SchwarzReScale_dbl( void *data, HYPRE_Int size, hypre_double value ); +HYPRE_Int +hypre_SchwarzReScale_long_dbl( void *data, HYPRE_Int size, hypre_long_double value ); + +HYPRE_Int +hypre_SchwarzSetDofFunc_flt( void *data, HYPRE_Int *dof_func ); +HYPRE_Int +hypre_SchwarzSetDofFunc_dbl( void *data, HYPRE_Int *dof_func ); +HYPRE_Int +hypre_SchwarzSetDofFunc_long_dbl( void *data, HYPRE_Int *dof_func ); + +HYPRE_Int +hypre_SchwarzSetDomainStructure_flt( void *data, hypre_CSRMatrix *domain_structure ); +HYPRE_Int +hypre_SchwarzSetDomainStructure_dbl( void *data, hypre_CSRMatrix *domain_structure ); +HYPRE_Int +hypre_SchwarzSetDomainStructure_long_dbl( void *data, hypre_CSRMatrix *domain_structure ); + +HYPRE_Int +hypre_SchwarzSetDomainType_flt( void *data, HYPRE_Int domain_type ); +HYPRE_Int +hypre_SchwarzSetDomainType_dbl( void *data, HYPRE_Int domain_type ); +HYPRE_Int +hypre_SchwarzSetDomainType_long_dbl( void *data, HYPRE_Int domain_type ); + +HYPRE_Int +hypre_SchwarzSetNonSymm_flt( void *data, HYPRE_Int value ); +HYPRE_Int +hypre_SchwarzSetNonSymm_dbl( void *data, HYPRE_Int value ); +HYPRE_Int +hypre_SchwarzSetNonSymm_long_dbl( void *data, HYPRE_Int value ); + +HYPRE_Int +hypre_SchwarzSetNumFunctions_flt( void *data, HYPRE_Int num_functions ); +HYPRE_Int +hypre_SchwarzSetNumFunctions_dbl( void *data, HYPRE_Int num_functions ); +HYPRE_Int +hypre_SchwarzSetNumFunctions_long_dbl( void *data, HYPRE_Int num_functions ); + +HYPRE_Int +hypre_SchwarzSetOverlap_flt( void *data, HYPRE_Int overlap ); +HYPRE_Int +hypre_SchwarzSetOverlap_dbl( void *data, HYPRE_Int overlap ); +HYPRE_Int +hypre_SchwarzSetOverlap_long_dbl( void *data, HYPRE_Int overlap ); + +HYPRE_Int +hypre_SchwarzSetRelaxWeight_flt( void *data, hypre_float relax_weight ); +HYPRE_Int +hypre_SchwarzSetRelaxWeight_dbl( void *data, hypre_double relax_weight ); +HYPRE_Int +hypre_SchwarzSetRelaxWeight_long_dbl( void *data, hypre_long_double relax_weight ); + +HYPRE_Int +hypre_SchwarzSetScale_flt( void *data, hypre_float *scale ); +HYPRE_Int +hypre_SchwarzSetScale_dbl( void *data, hypre_double *scale ); +HYPRE_Int +hypre_SchwarzSetScale_long_dbl( void *data, hypre_long_double *scale ); + +HYPRE_Int +hypre_SchwarzSetVariant_flt( void *data, HYPRE_Int variant ); +HYPRE_Int +hypre_SchwarzSetVariant_dbl( void *data, HYPRE_Int variant ); +HYPRE_Int +hypre_SchwarzSetVariant_long_dbl( void *data, HYPRE_Int variant ); + +HYPRE_Int +hypre_SchwarzSetup_flt( void *schwarz_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_SchwarzSetup_dbl( void *schwarz_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_SchwarzSetup_long_dbl( void *schwarz_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); + +HYPRE_Int +hypre_SchwarzSolve_flt( void *schwarz_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_SchwarzSolve_dbl( void *schwarz_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); +HYPRE_Int +hypre_SchwarzSolve_long_dbl( void *schwarz_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ); + +HYPRE_Int +hypre_SortedCopyParCSRData_flt( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); +HYPRE_Int +hypre_SortedCopyParCSRData_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); +HYPRE_Int +hypre_SortedCopyParCSRData_long_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); + +HYPRE_Int +hypre_alt_insert_new_nodes_flt( 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_dbl( 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_long_dbl( 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_flt( 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_big_insert_new_nodes_dbl( 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_big_insert_new_nodes_long_dbl( 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_block_jacobi_solve_flt( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int blk_size, HYPRE_Int method, hypre_float *diaginv, hypre_ParVector *Vtemp ); +HYPRE_Int +hypre_block_jacobi_solve_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int blk_size, HYPRE_Int method, hypre_double *diaginv, hypre_ParVector *Vtemp ); +HYPRE_Int +hypre_block_jacobi_solve_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int blk_size, HYPRE_Int method, hypre_long_double *diaginv, hypre_ParVector *Vtemp ); + +void +hypre_build_interp_colmap_flt( hypre_ParCSRMatrix *P, HYPRE_Int full_off_procNodes, HYPRE_Int *tmp_CF_marker_offd, HYPRE_BigInt *fine_to_coarse_offd ); +void +hypre_build_interp_colmap_dbl( hypre_ParCSRMatrix *P, HYPRE_Int full_off_procNodes, HYPRE_Int *tmp_CF_marker_offd, HYPRE_BigInt *fine_to_coarse_offd ); +void +hypre_build_interp_colmap_long_dbl( hypre_ParCSRMatrix *P, HYPRE_Int full_off_procNodes, HYPRE_Int *tmp_CF_marker_offd, HYPRE_BigInt *fine_to_coarse_offd ); + +HYPRE_Int +hypre_cr_flt( HYPRE_Int *A_i, HYPRE_Int *A_j, hypre_float *A_data, HYPRE_Int n, HYPRE_Int *cf, HYPRE_Int rlx, hypre_float omega, hypre_float tg, HYPRE_Int mu ); +HYPRE_Int +hypre_cr_dbl( HYPRE_Int *A_i, HYPRE_Int *A_j, hypre_double *A_data, HYPRE_Int n, HYPRE_Int *cf, HYPRE_Int rlx, hypre_double omega, hypre_double tg, HYPRE_Int mu ); +HYPRE_Int +hypre_cr_long_dbl( HYPRE_Int *A_i, HYPRE_Int *A_j, hypre_long_double *A_data, HYPRE_Int n, HYPRE_Int *cf, HYPRE_Int rlx, hypre_long_double omega, hypre_long_double tg, HYPRE_Int mu ); + +HYPRE_Int +hypre_exchange_interp_data_flt( 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 +hypre_exchange_interp_data_dbl( 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 +hypre_exchange_interp_data_long_dbl( 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 +hypre_exchange_marker_flt( hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int *IN_marker, HYPRE_Int *OUT_marker ); +HYPRE_Int +hypre_exchange_marker_dbl( hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int *IN_marker, HYPRE_Int *OUT_marker ); +HYPRE_Int +hypre_exchange_marker_long_dbl( hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int *IN_marker, HYPRE_Int *OUT_marker ); + +HYPRE_Int +hypre_formu_flt( HYPRE_Int *cf, HYPRE_Int n, hypre_float *e1, HYPRE_Int *A_i, hypre_float rho ); +HYPRE_Int +hypre_formu_dbl( HYPRE_Int *cf, HYPRE_Int n, hypre_double *e1, HYPRE_Int *A_i, hypre_double rho ); +HYPRE_Int +hypre_formu_long_dbl( HYPRE_Int *cf, HYPRE_Int n, hypre_long_double *e1, HYPRE_Int *A_i, hypre_long_double rho ); + +HYPRE_Int +hypre_fptgscr_flt( HYPRE_Int *cf, HYPRE_Int *A_i, HYPRE_Int *A_j, hypre_float *A_data, HYPRE_Int n, hypre_float *e0, hypre_float *e1 ); +HYPRE_Int +hypre_fptgscr_dbl( HYPRE_Int *cf, HYPRE_Int *A_i, HYPRE_Int *A_j, hypre_double *A_data, HYPRE_Int n, hypre_double *e0, hypre_double *e1 ); +HYPRE_Int +hypre_fptgscr_long_dbl( HYPRE_Int *cf, HYPRE_Int *A_i, HYPRE_Int *A_j, hypre_long_double *A_data, HYPRE_Int n, hypre_long_double *e0, hypre_long_double *e1 ); + +HYPRE_Int +hypre_fptjaccr_flt( HYPRE_Int *cf, HYPRE_Int *A_i, HYPRE_Int *A_j, hypre_float *A_data, HYPRE_Int n, hypre_float *e0, hypre_float omega, hypre_float *e1 ); +HYPRE_Int +hypre_fptjaccr_dbl( HYPRE_Int *cf, HYPRE_Int *A_i, HYPRE_Int *A_j, hypre_double *A_data, HYPRE_Int n, hypre_double *e0, hypre_double omega, hypre_double *e1 ); +HYPRE_Int +hypre_fptjaccr_long_dbl( HYPRE_Int *cf, HYPRE_Int *A_i, HYPRE_Int *A_j, hypre_long_double *A_data, HYPRE_Int n, hypre_long_double *e0, hypre_long_double omega, hypre_long_double *e1 ); + +HYPRE_Int +hypre_index_of_minimum_flt( HYPRE_BigInt *data, HYPRE_Int n ); +HYPRE_Int +hypre_index_of_minimum_dbl( HYPRE_BigInt *data, HYPRE_Int n ); +HYPRE_Int +hypre_index_of_minimum_long_dbl( HYPRE_BigInt *data, HYPRE_Int n ); + +void +hypre_initialize_vecs_flt( 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 ); +void +hypre_initialize_vecs_dbl( 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 ); +void +hypre_initialize_vecs_long_dbl( 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_BigInt +hypre_map_flt( 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 +hypre_map_dbl( 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 +hypre_map_long_dbl( 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 +hypre_map2_flt( 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 +hypre_map2_dbl( 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 +hypre_map2_long_dbl( HYPRE_BigInt ix, HYPRE_BigInt iy, HYPRE_Int p, HYPRE_Int q, HYPRE_BigInt nx, HYPRE_BigInt *nx_part, HYPRE_BigInt *ny_part ); + +HYPRE_Int +hypre_matinv_flt( hypre_float *x, hypre_float *a, HYPRE_Int k ); +HYPRE_Int +hypre_matinv_dbl( hypre_double *x, hypre_double *a, HYPRE_Int k ); +HYPRE_Int +hypre_matinv_long_dbl( hypre_long_double *x, hypre_long_double *a, HYPRE_Int k ); + +void +hypre_merge_lists_flt( HYPRE_Int *list1, HYPRE_Int *list2, hypre_int *np1, hypre_MPI_Datatype *dptr ); +void +hypre_merge_lists_dbl( HYPRE_Int *list1, HYPRE_Int *list2, hypre_int *np1, hypre_MPI_Datatype *dptr ); +void +hypre_merge_lists_long_dbl( HYPRE_Int *list1, HYPRE_Int *list2, hypre_int *np1, hypre_MPI_Datatype *dptr ); + +HYPRE_Int +hypre_move_entry_flt( 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_dbl( 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_long_dbl( 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_parCorrRes_flt( hypre_ParCSRMatrix *A, hypre_ParVector *x, hypre_Vector *rhs, hypre_Vector **tmp_ptr ); +HYPRE_Int +hypre_parCorrRes_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *x, hypre_Vector *rhs, hypre_Vector **tmp_ptr ); +HYPRE_Int +hypre_parCorrRes_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector *x, hypre_Vector *rhs, hypre_Vector **tmp_ptr ); + +void +hypre_qsort2_ci_flt( hypre_float *v, HYPRE_Int *w, HYPRE_Int left, HYPRE_Int right ); +void +hypre_qsort2_ci_dbl( hypre_double *v, HYPRE_Int *w, HYPRE_Int left, HYPRE_Int right ); +void +hypre_qsort2_ci_long_dbl( hypre_long_double *v, HYPRE_Int *w, HYPRE_Int left, HYPRE_Int right ); + +HYPRE_Int +hypre_remove_entry_flt( 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_dbl( 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_long_dbl( 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_seqAMGCycle_flt( hypre_ParAMGData *amg_data, HYPRE_Int p_level, hypre_ParVector **Par_F_array, hypre_ParVector **Par_U_array ); +HYPRE_Int +hypre_seqAMGCycle_dbl( hypre_ParAMGData *amg_data, HYPRE_Int p_level, hypre_ParVector **Par_F_array, hypre_ParVector **Par_U_array ); +HYPRE_Int +hypre_seqAMGCycle_long_dbl( hypre_ParAMGData *amg_data, HYPRE_Int p_level, hypre_ParVector **Par_F_array, hypre_ParVector **Par_U_array ); + +HYPRE_Int +hypre_seqAMGSetup_flt( hypre_ParAMGData *amg_data, HYPRE_Int p_level, HYPRE_Int coarse_threshold ); +HYPRE_Int +hypre_seqAMGSetup_dbl( hypre_ParAMGData *amg_data, HYPRE_Int p_level, HYPRE_Int coarse_threshold ); +HYPRE_Int +hypre_seqAMGSetup_long_dbl( hypre_ParAMGData *amg_data, HYPRE_Int p_level, HYPRE_Int coarse_threshold ); + +HYPRE_Int +hypre_ssort_flt( HYPRE_BigInt *data, HYPRE_Int n ); +HYPRE_Int +hypre_ssort_dbl( HYPRE_BigInt *data, HYPRE_Int n ); +HYPRE_Int +hypre_ssort_long_dbl( HYPRE_BigInt *data, HYPRE_Int n ); + +void +hypre_swap2_ci_flt( hypre_float *v, HYPRE_Int *w, HYPRE_Int i, HYPRE_Int j ); +void +hypre_swap2_ci_dbl( hypre_double *v, HYPRE_Int *w, HYPRE_Int i, HYPRE_Int j ); +void +hypre_swap2_ci_long_dbl( hypre_long_double *v, HYPRE_Int *w, HYPRE_Int i, HYPRE_Int j ); + +void +hypre_swap_int_flt( HYPRE_BigInt *data, HYPRE_Int a, HYPRE_Int b ); +void +hypre_swap_int_dbl( HYPRE_BigInt *data, HYPRE_Int a, HYPRE_Int b ); +void +hypre_swap_int_long_dbl( HYPRE_BigInt *data, HYPRE_Int a, HYPRE_Int b ); + +HYPRE_Int +hypre_update_entry_flt( 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_dbl( 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_long_dbl( 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 +matrix_matrix_product_flt( 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 +matrix_matrix_product_dbl( 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 +matrix_matrix_product_long_dbl( 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_Real +rfun_flt( hypre_float xx, hypre_float yy, hypre_float zz ); +HYPRE_Real +rfun_dbl( hypre_double xx, hypre_double yy, hypre_double zz ); +HYPRE_Real +rfun_long_dbl( hypre_long_double xx, hypre_long_double yy, hypre_long_double zz ); + +HYPRE_Real +rfun_rs_flt( hypre_float xx, hypre_float yy, hypre_float zz ); +HYPRE_Real +rfun_rs_dbl( hypre_double xx, hypre_double yy, hypre_double zz ); +HYPRE_Real +rfun_rs_long_dbl( hypre_long_double xx, hypre_long_double yy, hypre_long_double zz ); + +HYPRE_Int +transpose_matrix_create_flt( 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 +transpose_matrix_create_dbl( 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 +transpose_matrix_create_long_dbl( 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 ); + + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + + + +#endif + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/src/parcsr_ls/_hypre_parcsr_ls_mup_def.h b/src/parcsr_ls/_hypre_parcsr_ls_mup_def.h new file mode 100644 index 0000000000..45caa6d997 --- /dev/null +++ b/src/parcsr_ls/_hypre_parcsr_ls_mup_def.h @@ -0,0 +1,2131 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#ifndef hypre_PARCSR_LS_MUP_DEF_HEADER +#define hypre_PARCSR_LS_MUP_DEF_HEADER + +#include "_hypre_mup_def.h" + +#define HYPRE_ADSCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_ADSCreate ) +#define HYPRE_ADSDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_ADSDestroy ) +#define HYPRE_ADSGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_ADSGetFinalRelativeResidualNorm ) +#define HYPRE_ADSGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_ADSGetNumIterations ) +#define HYPRE_ADSSetAMGOptions HYPRE_MULTIPRECISION_FUNC ( HYPRE_ADSSetAMGOptions ) +#define HYPRE_ADSSetAMSOptions HYPRE_MULTIPRECISION_FUNC ( HYPRE_ADSSetAMSOptions ) +#define HYPRE_ADSSetChebySmoothingOptions HYPRE_MULTIPRECISION_FUNC ( HYPRE_ADSSetChebySmoothingOptions ) +#define HYPRE_ADSSetCoordinateVectors HYPRE_MULTIPRECISION_FUNC ( HYPRE_ADSSetCoordinateVectors ) +#define HYPRE_ADSSetCycleType HYPRE_MULTIPRECISION_FUNC ( HYPRE_ADSSetCycleType ) +#define HYPRE_ADSSetDiscreteCurl HYPRE_MULTIPRECISION_FUNC ( HYPRE_ADSSetDiscreteCurl ) +#define HYPRE_ADSSetDiscreteGradient HYPRE_MULTIPRECISION_FUNC ( HYPRE_ADSSetDiscreteGradient ) +#define HYPRE_ADSSetInterpolations HYPRE_MULTIPRECISION_FUNC ( HYPRE_ADSSetInterpolations ) +#define HYPRE_ADSSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_ADSSetMaxIter ) +#define HYPRE_ADSSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_ADSSetPrintLevel ) +#define HYPRE_ADSSetSmoothingOptions HYPRE_MULTIPRECISION_FUNC ( HYPRE_ADSSetSmoothingOptions ) +#define HYPRE_ADSSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_ADSSetTol ) +#define HYPRE_ADSSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_ADSSetup ) +#define HYPRE_ADSSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_ADSSolve ) +#define HYPRE_AMECreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMECreate ) +#define HYPRE_AMEDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMEDestroy ) +#define HYPRE_AMEGetEigenvalues HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMEGetEigenvalues ) +#define HYPRE_AMEGetEigenvectors HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMEGetEigenvectors ) +#define HYPRE_AMESetAMSSolver HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMESetAMSSolver ) +#define HYPRE_AMESetBlockSize HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMESetBlockSize ) +#define HYPRE_AMESetMassMatrix HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMESetMassMatrix ) +#define HYPRE_AMESetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMESetMaxIter ) +#define HYPRE_AMESetMaxPCGIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMESetMaxPCGIter ) +#define HYPRE_AMESetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMESetPrintLevel ) +#define HYPRE_AMESetRTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMESetRTol ) +#define HYPRE_AMESetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMESetTol ) +#define HYPRE_AMESetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMESetup ) +#define HYPRE_AMESolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMESolve ) +#define HYPRE_AMSConstructDiscreteGradient HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMSConstructDiscreteGradient ) +#define HYPRE_AMSCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMSCreate ) +#define HYPRE_AMSDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMSDestroy ) +#define HYPRE_AMSFEIDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMSFEIDestroy ) +#define HYPRE_AMSFEISetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMSFEISetup ) +#define HYPRE_AMSGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMSGetFinalRelativeResidualNorm ) +#define HYPRE_AMSGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMSGetNumIterations ) +#define HYPRE_AMSProjectOutGradients HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMSProjectOutGradients ) +#define HYPRE_AMSSetAlphaAMGCoarseRelaxType HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMSSetAlphaAMGCoarseRelaxType ) +#define HYPRE_AMSSetAlphaAMGOptions HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMSSetAlphaAMGOptions ) +#define HYPRE_AMSSetAlphaPoissonMatrix HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMSSetAlphaPoissonMatrix ) +#define HYPRE_AMSSetBetaAMGCoarseRelaxType HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMSSetBetaAMGCoarseRelaxType ) +#define HYPRE_AMSSetBetaAMGOptions HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMSSetBetaAMGOptions ) +#define HYPRE_AMSSetBetaPoissonMatrix HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMSSetBetaPoissonMatrix ) +#define HYPRE_AMSSetChebySmoothingOptions HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMSSetChebySmoothingOptions ) +#define HYPRE_AMSSetCoordinateVectors HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMSSetCoordinateVectors ) +#define HYPRE_AMSSetCycleType HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMSSetCycleType ) +#define HYPRE_AMSSetDimension HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMSSetDimension ) +#define HYPRE_AMSSetDiscreteGradient HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMSSetDiscreteGradient ) +#define HYPRE_AMSSetEdgeConstantVectors HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMSSetEdgeConstantVectors ) +#define HYPRE_AMSSetInteriorNodes HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMSSetInteriorNodes ) +#define HYPRE_AMSSetInterpolations HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMSSetInterpolations ) +#define HYPRE_AMSSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMSSetMaxIter ) +#define HYPRE_AMSSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMSSetPrintLevel ) +#define HYPRE_AMSSetProjectionFrequency HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMSSetProjectionFrequency ) +#define HYPRE_AMSSetSmoothingOptions HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMSSetSmoothingOptions ) +#define HYPRE_AMSSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMSSetTol ) +#define HYPRE_AMSSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMSSetup ) +#define HYPRE_AMSSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_AMSSolve ) +#define HYPRE_BlockTridiagCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_BlockTridiagCreate ) +#define HYPRE_BlockTridiagDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_BlockTridiagDestroy ) +#define HYPRE_BlockTridiagSetAMGNumSweeps HYPRE_MULTIPRECISION_FUNC ( HYPRE_BlockTridiagSetAMGNumSweeps ) +#define HYPRE_BlockTridiagSetAMGRelaxType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BlockTridiagSetAMGRelaxType ) +#define HYPRE_BlockTridiagSetAMGStrengthThreshold HYPRE_MULTIPRECISION_FUNC ( HYPRE_BlockTridiagSetAMGStrengthThreshold ) +#define HYPRE_BlockTridiagSetIndexSet HYPRE_MULTIPRECISION_FUNC ( HYPRE_BlockTridiagSetIndexSet ) +#define HYPRE_BlockTridiagSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_BlockTridiagSetPrintLevel ) +#define HYPRE_BlockTridiagSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_BlockTridiagSetup ) +#define HYPRE_BlockTridiagSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_BlockTridiagSolve ) +#define HYPRE_BoomerAMGCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGCreate ) +#define HYPRE_BoomerAMGDDCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGDDCreate ) +#define HYPRE_BoomerAMGDDDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGDDDestroy ) +#define HYPRE_BoomerAMGDDGetAMG HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGDDGetAMG ) +#define HYPRE_BoomerAMGDDGetFACCycleType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGDDGetFACCycleType ) +#define HYPRE_BoomerAMGDDGetFACNumCycles HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGDDGetFACNumCycles ) +#define HYPRE_BoomerAMGDDGetFACNumRelax HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGDDGetFACNumRelax ) +#define HYPRE_BoomerAMGDDGetFACRelaxType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGDDGetFACRelaxType ) +#define HYPRE_BoomerAMGDDGetFACRelaxWeight HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGDDGetFACRelaxWeight ) +#define HYPRE_BoomerAMGDDGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGDDGetFinalRelativeResidualNorm ) +#define HYPRE_BoomerAMGDDGetNumGhostLayers HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGDDGetNumGhostLayers ) +#define HYPRE_BoomerAMGDDGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGDDGetNumIterations ) +#define HYPRE_BoomerAMGDDGetPadding HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGDDGetPadding ) +#define HYPRE_BoomerAMGDDGetStartLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGDDGetStartLevel ) +#define HYPRE_BoomerAMGDDSetFACCycleType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGDDSetFACCycleType ) +#define HYPRE_BoomerAMGDDSetFACNumCycles HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGDDSetFACNumCycles ) +#define HYPRE_BoomerAMGDDSetFACNumRelax HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGDDSetFACNumRelax ) +#define HYPRE_BoomerAMGDDSetFACRelaxType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGDDSetFACRelaxType ) +#define HYPRE_BoomerAMGDDSetFACRelaxWeight HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGDDSetFACRelaxWeight ) +#define HYPRE_BoomerAMGDDSetNumGhostLayers HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGDDSetNumGhostLayers ) +#define HYPRE_BoomerAMGDDSetPadding HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGDDSetPadding ) +#define HYPRE_BoomerAMGDDSetStartLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGDDSetStartLevel ) +#define HYPRE_BoomerAMGDDSetUserFACRelaxation HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGDDSetUserFACRelaxation ) +#define HYPRE_BoomerAMGDDSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGDDSetup ) +#define HYPRE_BoomerAMGDDSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGDDSolve ) +#define HYPRE_BoomerAMGDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGDestroy ) +#define HYPRE_BoomerAMGGetAdditive HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetAdditive ) +#define HYPRE_BoomerAMGGetCoarsenCutFactor HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetCoarsenCutFactor ) +#define HYPRE_BoomerAMGGetCoarsenType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetCoarsenType ) +#define HYPRE_BoomerAMGGetConvergeType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetConvergeType ) +#define HYPRE_BoomerAMGGetCumNnzAP HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetCumNnzAP ) +#define HYPRE_BoomerAMGGetCumNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetCumNumIterations ) +#define HYPRE_BoomerAMGGetCycleNumSweeps HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetCycleNumSweeps ) +#define HYPRE_BoomerAMGGetCycleRelaxType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetCycleRelaxType ) +#define HYPRE_BoomerAMGGetCycleType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetCycleType ) +#define HYPRE_BoomerAMGGetDebugFlag HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetDebugFlag ) +#define HYPRE_BoomerAMGGetDomainType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetDomainType ) +#define HYPRE_BoomerAMGGetFCycle HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetFCycle ) +#define HYPRE_BoomerAMGGetFilterFunctions HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetFilterFunctions ) +#define HYPRE_BoomerAMGGetFilterThresholdR HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetFilterThresholdR ) +#define HYPRE_BoomerAMGGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetFinalRelativeResidualNorm ) +#define HYPRE_BoomerAMGGetGridHierarchy HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetGridHierarchy ) +#define HYPRE_BoomerAMGGetJacobiTruncThreshold HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetJacobiTruncThreshold ) +#define HYPRE_BoomerAMGGetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetLogging ) +#define HYPRE_BoomerAMGGetMaxCoarseSize HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetMaxCoarseSize ) +#define HYPRE_BoomerAMGGetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetMaxIter ) +#define HYPRE_BoomerAMGGetMaxLevels HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetMaxLevels ) +#define HYPRE_BoomerAMGGetMaxRowSum HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetMaxRowSum ) +#define HYPRE_BoomerAMGGetMeasureType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetMeasureType ) +#define HYPRE_BoomerAMGGetMinCoarseSize HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetMinCoarseSize ) +#define HYPRE_BoomerAMGGetMultAdditive HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetMultAdditive ) +#define HYPRE_BoomerAMGGetNumFunctions HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetNumFunctions ) +#define HYPRE_BoomerAMGGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetNumIterations ) +#define HYPRE_BoomerAMGGetOverlap HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetOverlap ) +#define HYPRE_BoomerAMGGetPMaxElmts HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetPMaxElmts ) +#define HYPRE_BoomerAMGGetPostInterpType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetPostInterpType ) +#define HYPRE_BoomerAMGGetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetPrintLevel ) +#define HYPRE_BoomerAMGGetRedundant HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetRedundant ) +#define HYPRE_BoomerAMGGetResidual HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetResidual ) +#define HYPRE_BoomerAMGGetSchwarzRlxWeight HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetSchwarzRlxWeight ) +#define HYPRE_BoomerAMGGetSeqThreshold HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetSeqThreshold ) +#define HYPRE_BoomerAMGGetSimple HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetSimple ) +#define HYPRE_BoomerAMGGetSmoothNumLevels HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetSmoothNumLevels ) +#define HYPRE_BoomerAMGGetSmoothNumSweeps HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetSmoothNumSweeps ) +#define HYPRE_BoomerAMGGetSmoothType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetSmoothType ) +#define HYPRE_BoomerAMGGetStrongThreshold HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetStrongThreshold ) +#define HYPRE_BoomerAMGGetStrongThresholdR HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetStrongThresholdR ) +#define HYPRE_BoomerAMGGetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetTol ) +#define HYPRE_BoomerAMGGetTruncFactor HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetTruncFactor ) +#define HYPRE_BoomerAMGGetVariant HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGGetVariant ) +#define HYPRE_BoomerAMGInitGridRelaxation HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGInitGridRelaxation ) +#define HYPRE_BoomerAMGSetADropTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetADropTol ) +#define HYPRE_BoomerAMGSetADropType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetADropType ) +#define HYPRE_BoomerAMGSetAddLastLvl HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetAddLastLvl ) +#define HYPRE_BoomerAMGSetAddPMaxElmts HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetAddPMaxElmts ) +#define HYPRE_BoomerAMGSetAddRelaxType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetAddRelaxType ) +#define HYPRE_BoomerAMGSetAddRelaxWt HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetAddRelaxWt ) +#define HYPRE_BoomerAMGSetAddTruncFactor HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetAddTruncFactor ) +#define HYPRE_BoomerAMGSetAdditive HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetAdditive ) +#define HYPRE_BoomerAMGSetAggInterpType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetAggInterpType ) +#define HYPRE_BoomerAMGSetAggNumLevels HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetAggNumLevels ) +#define HYPRE_BoomerAMGSetAggP12MaxElmts HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetAggP12MaxElmts ) +#define HYPRE_BoomerAMGSetAggP12TruncFactor HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetAggP12TruncFactor ) +#define HYPRE_BoomerAMGSetAggPMaxElmts HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetAggPMaxElmts ) +#define HYPRE_BoomerAMGSetAggTruncFactor HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetAggTruncFactor ) +#define HYPRE_BoomerAMGSetCGCIts HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetCGCIts ) +#define HYPRE_BoomerAMGSetCPoints HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetCPoints ) +#define HYPRE_BoomerAMGSetCRRate HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetCRRate ) +#define HYPRE_BoomerAMGSetCRStrongTh HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetCRStrongTh ) +#define HYPRE_BoomerAMGSetCRUseCG HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetCRUseCG ) +#define HYPRE_BoomerAMGSetChebyEigEst HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetChebyEigEst ) +#define HYPRE_BoomerAMGSetChebyFraction HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetChebyFraction ) +#define HYPRE_BoomerAMGSetChebyOrder HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetChebyOrder ) +#define HYPRE_BoomerAMGSetChebyScale HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetChebyScale ) +#define HYPRE_BoomerAMGSetChebyVariant HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetChebyVariant ) +#define HYPRE_BoomerAMGSetCoarsenCutFactor HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetCoarsenCutFactor ) +#define HYPRE_BoomerAMGSetCoarsenType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetCoarsenType ) +#define HYPRE_BoomerAMGSetConvergeType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetConvergeType ) +#define HYPRE_BoomerAMGSetCoordDim HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetCoordDim ) +#define HYPRE_BoomerAMGSetCoordinates HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetCoordinates ) +#define HYPRE_BoomerAMGSetCpointsToKeep HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetCpointsToKeep ) +#define HYPRE_BoomerAMGSetCumNnzAP HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetCumNnzAP ) +#define HYPRE_BoomerAMGSetCycleNumSweeps HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetCycleNumSweeps ) +#define HYPRE_BoomerAMGSetCycleRelaxType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetCycleRelaxType ) +#define HYPRE_BoomerAMGSetCycleType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetCycleType ) +#define HYPRE_BoomerAMGSetDebugFlag HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetDebugFlag ) +#define HYPRE_BoomerAMGSetDofFunc HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetDofFunc ) +#define HYPRE_BoomerAMGSetDomainType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetDomainType ) +#define HYPRE_BoomerAMGSetDropTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetDropTol ) +#define HYPRE_BoomerAMGSetEuBJ HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetEuBJ ) +#define HYPRE_BoomerAMGSetEuLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetEuLevel ) +#define HYPRE_BoomerAMGSetEuSparseA HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetEuSparseA ) +#define HYPRE_BoomerAMGSetEuclidFile HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetEuclidFile ) +#define HYPRE_BoomerAMGSetFCycle HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetFCycle ) +#define HYPRE_BoomerAMGSetFPoints HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetFPoints ) +#define HYPRE_BoomerAMGSetFSAIAlgoType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetFSAIAlgoType ) +#define HYPRE_BoomerAMGSetFSAIEigMaxIters HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetFSAIEigMaxIters ) +#define HYPRE_BoomerAMGSetFSAIKapTolerance HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetFSAIKapTolerance ) +#define HYPRE_BoomerAMGSetFSAILocalSolveType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetFSAILocalSolveType ) +#define HYPRE_BoomerAMGSetFSAIMaxNnzRow HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetFSAIMaxNnzRow ) +#define HYPRE_BoomerAMGSetFSAIMaxStepSize HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetFSAIMaxStepSize ) +#define HYPRE_BoomerAMGSetFSAIMaxSteps HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetFSAIMaxSteps ) +#define HYPRE_BoomerAMGSetFSAINumLevels HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetFSAINumLevels ) +#define HYPRE_BoomerAMGSetFSAIThreshold HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetFSAIThreshold ) +#define HYPRE_BoomerAMGSetFilter HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetFilter ) +#define HYPRE_BoomerAMGSetFilterFunctions HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetFilterFunctions ) +#define HYPRE_BoomerAMGSetFilterThresholdR HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetFilterThresholdR ) +#define HYPRE_BoomerAMGSetGMRESSwitchR HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetGMRESSwitchR ) +#define HYPRE_BoomerAMGSetGSMG HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetGSMG ) +#define HYPRE_BoomerAMGSetGridRelaxPoints HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetGridRelaxPoints ) +#define HYPRE_BoomerAMGSetGridRelaxType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetGridRelaxType ) +#define HYPRE_BoomerAMGSetILUDroptol HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetILUDroptol ) +#define HYPRE_BoomerAMGSetILUIterSetupMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetILUIterSetupMaxIter ) +#define HYPRE_BoomerAMGSetILUIterSetupOption HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetILUIterSetupOption ) +#define HYPRE_BoomerAMGSetILUIterSetupTolerance HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetILUIterSetupTolerance ) +#define HYPRE_BoomerAMGSetILUIterSetupType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetILUIterSetupType ) +#define HYPRE_BoomerAMGSetILULevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetILULevel ) +#define HYPRE_BoomerAMGSetILULocalReordering HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetILULocalReordering ) +#define HYPRE_BoomerAMGSetILULowerJacobiIters HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetILULowerJacobiIters ) +#define HYPRE_BoomerAMGSetILUMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetILUMaxIter ) +#define HYPRE_BoomerAMGSetILUMaxRowNnz HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetILUMaxRowNnz ) +#define HYPRE_BoomerAMGSetILUTriSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetILUTriSolve ) +#define HYPRE_BoomerAMGSetILUType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetILUType ) +#define HYPRE_BoomerAMGSetILUUpperJacobiIters HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetILUUpperJacobiIters ) +#define HYPRE_BoomerAMGSetISType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetISType ) +#define HYPRE_BoomerAMGSetInterpRefine HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetInterpRefine ) +#define HYPRE_BoomerAMGSetInterpType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetInterpType ) +#define HYPRE_BoomerAMGSetInterpVecAbsQTrunc HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetInterpVecAbsQTrunc ) +#define HYPRE_BoomerAMGSetInterpVecFirstLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetInterpVecFirstLevel ) +#define HYPRE_BoomerAMGSetInterpVecQMax HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetInterpVecQMax ) +#define HYPRE_BoomerAMGSetInterpVecVariant HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetInterpVecVariant ) +#define HYPRE_BoomerAMGSetInterpVectors HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetInterpVectors ) +#define HYPRE_BoomerAMGSetIsTriangular HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetIsTriangular ) +#define HYPRE_BoomerAMGSetIsolatedFPoints HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetIsolatedFPoints ) +#define HYPRE_BoomerAMGSetJacobiTruncThreshold HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetJacobiTruncThreshold ) +#define HYPRE_BoomerAMGSetKeepSameSign HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetKeepSameSign ) +#define HYPRE_BoomerAMGSetKeepTranspose HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetKeepTranspose ) +#define HYPRE_BoomerAMGSetLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetLevel ) +#define HYPRE_BoomerAMGSetLevelNonGalerkinTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetLevelNonGalerkinTol ) +#define HYPRE_BoomerAMGSetLevelOuterWt HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetLevelOuterWt ) +#define HYPRE_BoomerAMGSetLevelRelaxWt HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetLevelRelaxWt ) +#define HYPRE_BoomerAMGSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetLogging ) +#define HYPRE_BoomerAMGSetMaxCoarseSize HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetMaxCoarseSize ) +#define HYPRE_BoomerAMGSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetMaxIter ) +#define HYPRE_BoomerAMGSetMaxLevels HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetMaxLevels ) +#define HYPRE_BoomerAMGSetMaxNzPerRow HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetMaxNzPerRow ) +#define HYPRE_BoomerAMGSetMaxRowSum HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetMaxRowSum ) +#define HYPRE_BoomerAMGSetMeasureType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetMeasureType ) +#define HYPRE_BoomerAMGSetMinCoarseSize HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetMinCoarseSize ) +#define HYPRE_BoomerAMGSetMinIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetMinIter ) +#define HYPRE_BoomerAMGSetModuleRAP2 HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetModuleRAP2 ) +#define HYPRE_BoomerAMGSetMultAddPMaxElmts HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetMultAddPMaxElmts ) +#define HYPRE_BoomerAMGSetMultAddTruncFactor HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetMultAddTruncFactor ) +#define HYPRE_BoomerAMGSetMultAdditive HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetMultAdditive ) +#define HYPRE_BoomerAMGSetNodal HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetNodal ) +#define HYPRE_BoomerAMGSetNodalDiag HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetNodalDiag ) +#define HYPRE_BoomerAMGSetNodalLevels HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetNodalLevels ) +#define HYPRE_BoomerAMGSetNonGalerkTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetNonGalerkTol ) +#define HYPRE_BoomerAMGSetNonGalerkinTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetNonGalerkinTol ) +#define HYPRE_BoomerAMGSetNumCRRelaxSteps HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetNumCRRelaxSteps ) +#define HYPRE_BoomerAMGSetNumFunctions HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetNumFunctions ) +#define HYPRE_BoomerAMGSetNumGridSweeps HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetNumGridSweeps ) +#define HYPRE_BoomerAMGSetNumPaths HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetNumPaths ) +#define HYPRE_BoomerAMGSetNumSamples HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetNumSamples ) +#define HYPRE_BoomerAMGSetNumSweeps HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetNumSweeps ) +#define HYPRE_BoomerAMGSetOldDefault HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetOldDefault ) +#define HYPRE_BoomerAMGSetOmega HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetOmega ) +#define HYPRE_BoomerAMGSetOuterWt HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetOuterWt ) +#define HYPRE_BoomerAMGSetOverlap HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetOverlap ) +#define HYPRE_BoomerAMGSetPMaxElmts HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetPMaxElmts ) +#define HYPRE_BoomerAMGSetPlotFileName HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetPlotFileName ) +#define HYPRE_BoomerAMGSetPlotGrids HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetPlotGrids ) +#define HYPRE_BoomerAMGSetPostInterpType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetPostInterpType ) +#define HYPRE_BoomerAMGSetPrintFileName HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetPrintFileName ) +#define HYPRE_BoomerAMGSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetPrintLevel ) +#define HYPRE_BoomerAMGSetRAP2 HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetRAP2 ) +#define HYPRE_BoomerAMGSetRedundant HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetRedundant ) +#define HYPRE_BoomerAMGSetRelaxOrder HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetRelaxOrder ) +#define HYPRE_BoomerAMGSetRelaxType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetRelaxType ) +#define HYPRE_BoomerAMGSetRelaxWeight HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetRelaxWeight ) +#define HYPRE_BoomerAMGSetRelaxWt HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetRelaxWt ) +#define HYPRE_BoomerAMGSetRestriction HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetRestriction ) +#define HYPRE_BoomerAMGSetSCommPkgSwitch HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetSCommPkgSwitch ) +#define HYPRE_BoomerAMGSetSabs HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetSabs ) +#define HYPRE_BoomerAMGSetSchwarzRlxWeight HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetSchwarzRlxWeight ) +#define HYPRE_BoomerAMGSetSchwarzUseNonSymm HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetSchwarzUseNonSymm ) +#define HYPRE_BoomerAMGSetSepWeight HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetSepWeight ) +#define HYPRE_BoomerAMGSetSeqThreshold HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetSeqThreshold ) +#define HYPRE_BoomerAMGSetSetupType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetSetupType ) +#define HYPRE_BoomerAMGSetSimple HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetSimple ) +#define HYPRE_BoomerAMGSetSmoothInterpVectors HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetSmoothInterpVectors ) +#define HYPRE_BoomerAMGSetSmoothNumLevels HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetSmoothNumLevels ) +#define HYPRE_BoomerAMGSetSmoothNumSweeps HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetSmoothNumSweeps ) +#define HYPRE_BoomerAMGSetSmoothType HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetSmoothType ) +#define HYPRE_BoomerAMGSetStrongThreshold HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetStrongThreshold ) +#define HYPRE_BoomerAMGSetStrongThresholdR HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetStrongThresholdR ) +#define HYPRE_BoomerAMGSetSym HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetSym ) +#define HYPRE_BoomerAMGSetThreshold HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetThreshold ) +#define HYPRE_BoomerAMGSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetTol ) +#define HYPRE_BoomerAMGSetTruncFactor HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetTruncFactor ) +#define HYPRE_BoomerAMGSetVariant HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetVariant ) +#define HYPRE_BoomerAMGSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSetup ) +#define HYPRE_BoomerAMGSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSolve ) +#define HYPRE_BoomerAMGSolveT HYPRE_MULTIPRECISION_FUNC ( HYPRE_BoomerAMGSolveT ) +#define HYPRE_EuclidCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_EuclidCreate ) +#define HYPRE_EuclidDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_EuclidDestroy ) +#define HYPRE_EuclidSetBJ HYPRE_MULTIPRECISION_FUNC ( HYPRE_EuclidSetBJ ) +#define HYPRE_EuclidSetILUT HYPRE_MULTIPRECISION_FUNC ( HYPRE_EuclidSetILUT ) +#define HYPRE_EuclidSetLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_EuclidSetLevel ) +#define HYPRE_EuclidSetMem HYPRE_MULTIPRECISION_FUNC ( HYPRE_EuclidSetMem ) +#define HYPRE_EuclidSetParams HYPRE_MULTIPRECISION_FUNC ( HYPRE_EuclidSetParams ) +#define HYPRE_EuclidSetParamsFromFile HYPRE_MULTIPRECISION_FUNC ( HYPRE_EuclidSetParamsFromFile ) +#define HYPRE_EuclidSetRowScale HYPRE_MULTIPRECISION_FUNC ( HYPRE_EuclidSetRowScale ) +#define HYPRE_EuclidSetSparseA HYPRE_MULTIPRECISION_FUNC ( HYPRE_EuclidSetSparseA ) +#define HYPRE_EuclidSetStats HYPRE_MULTIPRECISION_FUNC ( HYPRE_EuclidSetStats ) +#define HYPRE_EuclidSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_EuclidSetup ) +#define HYPRE_EuclidSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_EuclidSolve ) +#define HYPRE_FSAICreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAICreate ) +#define HYPRE_FSAIDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAIDestroy ) +#define HYPRE_FSAIGetAlgoType HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAIGetAlgoType ) +#define HYPRE_FSAIGetEigMaxIters HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAIGetEigMaxIters ) +#define HYPRE_FSAIGetKapTolerance HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAIGetKapTolerance ) +#define HYPRE_FSAIGetLocalSolveType HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAIGetLocalSolveType ) +#define HYPRE_FSAIGetMaxIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAIGetMaxIterations ) +#define HYPRE_FSAIGetMaxNnzRow HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAIGetMaxNnzRow ) +#define HYPRE_FSAIGetMaxStepSize HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAIGetMaxStepSize ) +#define HYPRE_FSAIGetMaxSteps HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAIGetMaxSteps ) +#define HYPRE_FSAIGetNumLevels HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAIGetNumLevels ) +#define HYPRE_FSAIGetOmega HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAIGetOmega ) +#define HYPRE_FSAIGetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAIGetPrintLevel ) +#define HYPRE_FSAIGetThreshold HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAIGetThreshold ) +#define HYPRE_FSAIGetTolerance HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAIGetTolerance ) +#define HYPRE_FSAIGetZeroGuess HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAIGetZeroGuess ) +#define HYPRE_FSAISetAlgoType HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAISetAlgoType ) +#define HYPRE_FSAISetEigMaxIters HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAISetEigMaxIters ) +#define HYPRE_FSAISetKapTolerance HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAISetKapTolerance ) +#define HYPRE_FSAISetLocalSolveType HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAISetLocalSolveType ) +#define HYPRE_FSAISetMaxIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAISetMaxIterations ) +#define HYPRE_FSAISetMaxNnzRow HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAISetMaxNnzRow ) +#define HYPRE_FSAISetMaxStepSize HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAISetMaxStepSize ) +#define HYPRE_FSAISetMaxSteps HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAISetMaxSteps ) +#define HYPRE_FSAISetNumLevels HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAISetNumLevels ) +#define HYPRE_FSAISetOmega HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAISetOmega ) +#define HYPRE_FSAISetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAISetPrintLevel ) +#define HYPRE_FSAISetThreshold HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAISetThreshold ) +#define HYPRE_FSAISetTolerance HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAISetTolerance ) +#define HYPRE_FSAISetZeroGuess HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAISetZeroGuess ) +#define HYPRE_FSAISetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAISetup ) +#define HYPRE_FSAISolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_FSAISolve ) +#define HYPRE_ILUCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_ILUCreate ) +#define HYPRE_ILUDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_ILUDestroy ) +#define HYPRE_ILUGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_ILUGetFinalRelativeResidualNorm ) +#define HYPRE_ILUGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_ILUGetNumIterations ) +#define HYPRE_ILUSetDropThreshold HYPRE_MULTIPRECISION_FUNC ( HYPRE_ILUSetDropThreshold ) +#define HYPRE_ILUSetDropThresholdArray HYPRE_MULTIPRECISION_FUNC ( HYPRE_ILUSetDropThresholdArray ) +#define HYPRE_ILUSetIterativeSetupMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_ILUSetIterativeSetupMaxIter ) +#define HYPRE_ILUSetIterativeSetupOption HYPRE_MULTIPRECISION_FUNC ( HYPRE_ILUSetIterativeSetupOption ) +#define HYPRE_ILUSetIterativeSetupTolerance HYPRE_MULTIPRECISION_FUNC ( HYPRE_ILUSetIterativeSetupTolerance ) +#define HYPRE_ILUSetIterativeSetupType HYPRE_MULTIPRECISION_FUNC ( HYPRE_ILUSetIterativeSetupType ) +#define HYPRE_ILUSetLevelOfFill HYPRE_MULTIPRECISION_FUNC ( HYPRE_ILUSetLevelOfFill ) +#define HYPRE_ILUSetLocalReordering HYPRE_MULTIPRECISION_FUNC ( HYPRE_ILUSetLocalReordering ) +#define HYPRE_ILUSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_ILUSetLogging ) +#define HYPRE_ILUSetLowerJacobiIters HYPRE_MULTIPRECISION_FUNC ( HYPRE_ILUSetLowerJacobiIters ) +#define HYPRE_ILUSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_ILUSetMaxIter ) +#define HYPRE_ILUSetMaxNnzPerRow HYPRE_MULTIPRECISION_FUNC ( HYPRE_ILUSetMaxNnzPerRow ) +#define HYPRE_ILUSetNSHDropThreshold HYPRE_MULTIPRECISION_FUNC ( HYPRE_ILUSetNSHDropThreshold ) +#define HYPRE_ILUSetNSHDropThresholdArray HYPRE_MULTIPRECISION_FUNC ( HYPRE_ILUSetNSHDropThresholdArray ) +#define HYPRE_ILUSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_ILUSetPrintLevel ) +#define HYPRE_ILUSetSchurMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_ILUSetSchurMaxIter ) +#define HYPRE_ILUSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_ILUSetTol ) +#define HYPRE_ILUSetTriSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_ILUSetTriSolve ) +#define HYPRE_ILUSetType HYPRE_MULTIPRECISION_FUNC ( HYPRE_ILUSetType ) +#define HYPRE_ILUSetUpperJacobiIters HYPRE_MULTIPRECISION_FUNC ( HYPRE_ILUSetUpperJacobiIters ) +#define HYPRE_ILUSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_ILUSetup ) +#define HYPRE_ILUSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_ILUSolve ) +#define HYPRE_MGRBuildAff HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRBuildAff ) +#define HYPRE_MGRCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRCreate ) +#define HYPRE_MGRDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRDestroy ) +#define HYPRE_MGRGetCoarseGridConvergenceFactor HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRGetCoarseGridConvergenceFactor ) +#define HYPRE_MGRGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRGetFinalRelativeResidualNorm ) +#define HYPRE_MGRGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRGetNumIterations ) +#define HYPRE_MGRSetBlockJacobiBlockSize HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetBlockJacobiBlockSize ) +#define HYPRE_MGRSetBlockSize HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetBlockSize ) +#define HYPRE_MGRSetCoarseGridMethod HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetCoarseGridMethod ) +#define HYPRE_MGRSetCoarseGridPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetCoarseGridPrintLevel ) +#define HYPRE_MGRSetCoarseSolver HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetCoarseSolver ) +#define HYPRE_MGRSetCpointsByBlock HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetCpointsByBlock ) +#define HYPRE_MGRSetCpointsByContiguousBlock HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetCpointsByContiguousBlock ) +#define HYPRE_MGRSetCpointsByPointMarkerArray HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetCpointsByPointMarkerArray ) +#define HYPRE_MGRSetFRelaxMethod HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetFRelaxMethod ) +#define HYPRE_MGRSetFSolver HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetFSolver ) +#define HYPRE_MGRSetFSolverAtLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetFSolverAtLevel ) +#define HYPRE_MGRSetFrelaxPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetFrelaxPrintLevel ) +#define HYPRE_MGRSetGlobalSmoothCycle HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetGlobalSmoothCycle ) +#define HYPRE_MGRSetGlobalSmoothType HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetGlobalSmoothType ) +#define HYPRE_MGRSetGlobalSmootherAtLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetGlobalSmootherAtLevel ) +#define HYPRE_MGRSetInterpType HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetInterpType ) +#define HYPRE_MGRSetLevelFRelaxMethod HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetLevelFRelaxMethod ) +#define HYPRE_MGRSetLevelFRelaxNumFunctions HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetLevelFRelaxNumFunctions ) +#define HYPRE_MGRSetLevelFRelaxType HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetLevelFRelaxType ) +#define HYPRE_MGRSetLevelInterpType HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetLevelInterpType ) +#define HYPRE_MGRSetLevelNonGalerkinMaxElmts HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetLevelNonGalerkinMaxElmts ) +#define HYPRE_MGRSetLevelNumRelaxSweeps HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetLevelNumRelaxSweeps ) +#define HYPRE_MGRSetLevelPMaxElmts HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetLevelPMaxElmts ) +#define HYPRE_MGRSetLevelRestrictType HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetLevelRestrictType ) +#define HYPRE_MGRSetLevelSmoothIters HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetLevelSmoothIters ) +#define HYPRE_MGRSetLevelSmoothType HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetLevelSmoothType ) +#define HYPRE_MGRSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetLogging ) +#define HYPRE_MGRSetMaxCoarseLevels HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetMaxCoarseLevels ) +#define HYPRE_MGRSetMaxGlobalSmoothIters HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetMaxGlobalSmoothIters ) +#define HYPRE_MGRSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetMaxIter ) +#define HYPRE_MGRSetNonCpointsToFpoints HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetNonCpointsToFpoints ) +#define HYPRE_MGRSetNonGalerkinMaxElmts HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetNonGalerkinMaxElmts ) +#define HYPRE_MGRSetNumInterpSweeps HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetNumInterpSweeps ) +#define HYPRE_MGRSetNumRelaxSweeps HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetNumRelaxSweeps ) +#define HYPRE_MGRSetNumRestrictSweeps HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetNumRestrictSweeps ) +#define HYPRE_MGRSetPMaxElmts HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetPMaxElmts ) +#define HYPRE_MGRSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetPrintLevel ) +#define HYPRE_MGRSetRelaxType HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetRelaxType ) +#define HYPRE_MGRSetReservedCoarseNodes HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetReservedCoarseNodes ) +#define HYPRE_MGRSetReservedCpointsLevelToKeep HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetReservedCpointsLevelToKeep ) +#define HYPRE_MGRSetRestrictType HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetRestrictType ) +#define HYPRE_MGRSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetTol ) +#define HYPRE_MGRSetTruncateCoarseGridThreshold HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetTruncateCoarseGridThreshold ) +#define HYPRE_MGRSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSetup ) +#define HYPRE_MGRSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_MGRSolve ) +#define HYPRE_ParCSRBiCGSTABCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRBiCGSTABCreate ) +#define HYPRE_ParCSRBiCGSTABDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRBiCGSTABDestroy ) +#define HYPRE_ParCSRBiCGSTABGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRBiCGSTABGetFinalRelativeResidualNorm ) +#define HYPRE_ParCSRBiCGSTABGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRBiCGSTABGetNumIterations ) +#define HYPRE_ParCSRBiCGSTABGetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRBiCGSTABGetPrecond ) +#define HYPRE_ParCSRBiCGSTABGetResidual HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRBiCGSTABGetResidual ) +#define HYPRE_ParCSRBiCGSTABSetAbsoluteTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRBiCGSTABSetAbsoluteTol ) +#define HYPRE_ParCSRBiCGSTABSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRBiCGSTABSetLogging ) +#define HYPRE_ParCSRBiCGSTABSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRBiCGSTABSetMaxIter ) +#define HYPRE_ParCSRBiCGSTABSetMinIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRBiCGSTABSetMinIter ) +#define HYPRE_ParCSRBiCGSTABSetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRBiCGSTABSetPrecond ) +#define HYPRE_ParCSRBiCGSTABSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRBiCGSTABSetPrintLevel ) +#define HYPRE_ParCSRBiCGSTABSetStopCrit HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRBiCGSTABSetStopCrit ) +#define HYPRE_ParCSRBiCGSTABSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRBiCGSTABSetTol ) +#define HYPRE_ParCSRBiCGSTABSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRBiCGSTABSetup ) +#define HYPRE_ParCSRBiCGSTABSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRBiCGSTABSolve ) +#define HYPRE_ParCSRCGNRCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRCGNRCreate ) +#define HYPRE_ParCSRCGNRDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRCGNRDestroy ) +#define HYPRE_ParCSRCGNRGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRCGNRGetFinalRelativeResidualNorm ) +#define HYPRE_ParCSRCGNRGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRCGNRGetNumIterations ) +#define HYPRE_ParCSRCGNRGetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRCGNRGetPrecond ) +#define HYPRE_ParCSRCGNRSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRCGNRSetLogging ) +#define HYPRE_ParCSRCGNRSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRCGNRSetMaxIter ) +#define HYPRE_ParCSRCGNRSetMinIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRCGNRSetMinIter ) +#define HYPRE_ParCSRCGNRSetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRCGNRSetPrecond ) +#define HYPRE_ParCSRCGNRSetStopCrit HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRCGNRSetStopCrit ) +#define HYPRE_ParCSRCGNRSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRCGNRSetTol ) +#define HYPRE_ParCSRCGNRSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRCGNRSetup ) +#define HYPRE_ParCSRCGNRSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRCGNRSolve ) +#define HYPRE_ParCSRCOGMRESCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRCOGMRESCreate ) +#define HYPRE_ParCSRCOGMRESDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRCOGMRESDestroy ) +#define HYPRE_ParCSRCOGMRESGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRCOGMRESGetFinalRelativeResidualNorm ) +#define HYPRE_ParCSRCOGMRESGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRCOGMRESGetNumIterations ) +#define HYPRE_ParCSRCOGMRESGetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRCOGMRESGetPrecond ) +#define HYPRE_ParCSRCOGMRESGetResidual HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRCOGMRESGetResidual ) +#define HYPRE_ParCSRCOGMRESSetAbsoluteTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRCOGMRESSetAbsoluteTol ) +#define HYPRE_ParCSRCOGMRESSetCGS HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRCOGMRESSetCGS ) +#define HYPRE_ParCSRCOGMRESSetKDim HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRCOGMRESSetKDim ) +#define HYPRE_ParCSRCOGMRESSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRCOGMRESSetLogging ) +#define HYPRE_ParCSRCOGMRESSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRCOGMRESSetMaxIter ) +#define HYPRE_ParCSRCOGMRESSetMinIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRCOGMRESSetMinIter ) +#define HYPRE_ParCSRCOGMRESSetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRCOGMRESSetPrecond ) +#define HYPRE_ParCSRCOGMRESSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRCOGMRESSetPrintLevel ) +#define HYPRE_ParCSRCOGMRESSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRCOGMRESSetTol ) +#define HYPRE_ParCSRCOGMRESSetUnroll HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRCOGMRESSetUnroll ) +#define HYPRE_ParCSRCOGMRESSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRCOGMRESSetup ) +#define HYPRE_ParCSRCOGMRESSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRCOGMRESSolve ) +#define HYPRE_ParCSRDiagScale HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRDiagScale ) +#define HYPRE_ParCSRDiagScaleSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRDiagScaleSetup ) +#define HYPRE_ParCSRFlexGMRESCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRFlexGMRESCreate ) +#define HYPRE_ParCSRFlexGMRESDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRFlexGMRESDestroy ) +#define HYPRE_ParCSRFlexGMRESGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRFlexGMRESGetFinalRelativeResidualNorm ) +#define HYPRE_ParCSRFlexGMRESGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRFlexGMRESGetNumIterations ) +#define HYPRE_ParCSRFlexGMRESGetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRFlexGMRESGetPrecond ) +#define HYPRE_ParCSRFlexGMRESGetResidual HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRFlexGMRESGetResidual ) +#define HYPRE_ParCSRFlexGMRESSetAbsoluteTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRFlexGMRESSetAbsoluteTol ) +#define HYPRE_ParCSRFlexGMRESSetKDim HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRFlexGMRESSetKDim ) +#define HYPRE_ParCSRFlexGMRESSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRFlexGMRESSetLogging ) +#define HYPRE_ParCSRFlexGMRESSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRFlexGMRESSetMaxIter ) +#define HYPRE_ParCSRFlexGMRESSetMinIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRFlexGMRESSetMinIter ) +#define HYPRE_ParCSRFlexGMRESSetModifyPC HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRFlexGMRESSetModifyPC ) +#define HYPRE_ParCSRFlexGMRESSetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRFlexGMRESSetPrecond ) +#define HYPRE_ParCSRFlexGMRESSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRFlexGMRESSetPrintLevel ) +#define HYPRE_ParCSRFlexGMRESSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRFlexGMRESSetTol ) +#define HYPRE_ParCSRFlexGMRESSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRFlexGMRESSetup ) +#define HYPRE_ParCSRFlexGMRESSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRFlexGMRESSolve ) +#define HYPRE_ParCSRGMRESCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRGMRESCreate ) +#define HYPRE_ParCSRGMRESDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRGMRESDestroy ) +#define HYPRE_ParCSRGMRESGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRGMRESGetFinalRelativeResidualNorm ) +#define HYPRE_ParCSRGMRESGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRGMRESGetNumIterations ) +#define HYPRE_ParCSRGMRESGetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRGMRESGetPrecond ) +#define HYPRE_ParCSRGMRESGetRefSolution HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRGMRESGetRefSolution ) +#define HYPRE_ParCSRGMRESGetResidual HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRGMRESGetResidual ) +#define HYPRE_ParCSRGMRESSetAbsoluteTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRGMRESSetAbsoluteTol ) +#define HYPRE_ParCSRGMRESSetKDim HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRGMRESSetKDim ) +#define HYPRE_ParCSRGMRESSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRGMRESSetLogging ) +#define HYPRE_ParCSRGMRESSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRGMRESSetMaxIter ) +#define HYPRE_ParCSRGMRESSetMinIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRGMRESSetMinIter ) +#define HYPRE_ParCSRGMRESSetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRGMRESSetPrecond ) +#define HYPRE_ParCSRGMRESSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRGMRESSetPrintLevel ) +#define HYPRE_ParCSRGMRESSetRefSolution HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRGMRESSetRefSolution ) +#define HYPRE_ParCSRGMRESSetStopCrit HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRGMRESSetStopCrit ) +#define HYPRE_ParCSRGMRESSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRGMRESSetTol ) +#define HYPRE_ParCSRGMRESSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRGMRESSetup ) +#define HYPRE_ParCSRGMRESSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRGMRESSolve ) +#define HYPRE_ParCSRHybridCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridCreate ) +#define HYPRE_ParCSRHybridDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridDestroy ) +#define HYPRE_ParCSRHybridGetDSCGNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridGetDSCGNumIterations ) +#define HYPRE_ParCSRHybridGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridGetFinalRelativeResidualNorm ) +#define HYPRE_ParCSRHybridGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridGetNumIterations ) +#define HYPRE_ParCSRHybridGetPCGNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridGetPCGNumIterations ) +#define HYPRE_ParCSRHybridGetRecomputeResidual HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridGetRecomputeResidual ) +#define HYPRE_ParCSRHybridGetRecomputeResidualP HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridGetRecomputeResidualP ) +#define HYPRE_ParCSRHybridGetSetupSolveTime HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridGetSetupSolveTime ) +#define HYPRE_ParCSRHybridSetAbsoluteTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetAbsoluteTol ) +#define HYPRE_ParCSRHybridSetAggInterpType HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetAggInterpType ) +#define HYPRE_ParCSRHybridSetAggNumLevels HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetAggNumLevels ) +#define HYPRE_ParCSRHybridSetCoarsenType HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetCoarsenType ) +#define HYPRE_ParCSRHybridSetConvergenceTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetConvergenceTol ) +#define HYPRE_ParCSRHybridSetCycleNumSweeps HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetCycleNumSweeps ) +#define HYPRE_ParCSRHybridSetCycleRelaxType HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetCycleRelaxType ) +#define HYPRE_ParCSRHybridSetCycleType HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetCycleType ) +#define HYPRE_ParCSRHybridSetDSCGMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetDSCGMaxIter ) +#define HYPRE_ParCSRHybridSetDofFunc HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetDofFunc ) +#define HYPRE_ParCSRHybridSetGridRelaxPoints HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetGridRelaxPoints ) +#define HYPRE_ParCSRHybridSetGridRelaxType HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetGridRelaxType ) +#define HYPRE_ParCSRHybridSetInterpType HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetInterpType ) +#define HYPRE_ParCSRHybridSetKDim HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetKDim ) +#define HYPRE_ParCSRHybridSetKeepTranspose HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetKeepTranspose ) +#define HYPRE_ParCSRHybridSetLevelOuterWt HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetLevelOuterWt ) +#define HYPRE_ParCSRHybridSetLevelRelaxWt HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetLevelRelaxWt ) +#define HYPRE_ParCSRHybridSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetLogging ) +#define HYPRE_ParCSRHybridSetMaxCoarseSize HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetMaxCoarseSize ) +#define HYPRE_ParCSRHybridSetMaxLevels HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetMaxLevels ) +#define HYPRE_ParCSRHybridSetMaxRowSum HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetMaxRowSum ) +#define HYPRE_ParCSRHybridSetMeasureType HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetMeasureType ) +#define HYPRE_ParCSRHybridSetMinCoarseSize HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetMinCoarseSize ) +#define HYPRE_ParCSRHybridSetNodal HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetNodal ) +#define HYPRE_ParCSRHybridSetNonGalerkinTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetNonGalerkinTol ) +#define HYPRE_ParCSRHybridSetNumFunctions HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetNumFunctions ) +#define HYPRE_ParCSRHybridSetNumGridSweeps HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetNumGridSweeps ) +#define HYPRE_ParCSRHybridSetNumPaths HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetNumPaths ) +#define HYPRE_ParCSRHybridSetNumSweeps HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetNumSweeps ) +#define HYPRE_ParCSRHybridSetOmega HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetOmega ) +#define HYPRE_ParCSRHybridSetOuterWt HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetOuterWt ) +#define HYPRE_ParCSRHybridSetPCGMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetPCGMaxIter ) +#define HYPRE_ParCSRHybridSetPMaxElmts HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetPMaxElmts ) +#define HYPRE_ParCSRHybridSetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetPrecond ) +#define HYPRE_ParCSRHybridSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetPrintLevel ) +#define HYPRE_ParCSRHybridSetRecomputeResidual HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetRecomputeResidual ) +#define HYPRE_ParCSRHybridSetRecomputeResidualP HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetRecomputeResidualP ) +#define HYPRE_ParCSRHybridSetRelChange HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetRelChange ) +#define HYPRE_ParCSRHybridSetRelaxOrder HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetRelaxOrder ) +#define HYPRE_ParCSRHybridSetRelaxType HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetRelaxType ) +#define HYPRE_ParCSRHybridSetRelaxWeight HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetRelaxWeight ) +#define HYPRE_ParCSRHybridSetRelaxWt HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetRelaxWt ) +#define HYPRE_ParCSRHybridSetSeqThreshold HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetSeqThreshold ) +#define HYPRE_ParCSRHybridSetSetupType HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetSetupType ) +#define HYPRE_ParCSRHybridSetSolverType HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetSolverType ) +#define HYPRE_ParCSRHybridSetStopCrit HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetStopCrit ) +#define HYPRE_ParCSRHybridSetStrongThreshold HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetStrongThreshold ) +#define HYPRE_ParCSRHybridSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetTol ) +#define HYPRE_ParCSRHybridSetTruncFactor HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetTruncFactor ) +#define HYPRE_ParCSRHybridSetTwoNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetTwoNorm ) +#define HYPRE_ParCSRHybridSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSetup ) +#define HYPRE_ParCSRHybridSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRHybridSolve ) +#define HYPRE_ParCSRLGMRESCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRLGMRESCreate ) +#define HYPRE_ParCSRLGMRESDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRLGMRESDestroy ) +#define HYPRE_ParCSRLGMRESGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRLGMRESGetFinalRelativeResidualNorm ) +#define HYPRE_ParCSRLGMRESGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRLGMRESGetNumIterations ) +#define HYPRE_ParCSRLGMRESGetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRLGMRESGetPrecond ) +#define HYPRE_ParCSRLGMRESGetResidual HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRLGMRESGetResidual ) +#define HYPRE_ParCSRLGMRESSetAbsoluteTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRLGMRESSetAbsoluteTol ) +#define HYPRE_ParCSRLGMRESSetAugDim HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRLGMRESSetAugDim ) +#define HYPRE_ParCSRLGMRESSetKDim HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRLGMRESSetKDim ) +#define HYPRE_ParCSRLGMRESSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRLGMRESSetLogging ) +#define HYPRE_ParCSRLGMRESSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRLGMRESSetMaxIter ) +#define HYPRE_ParCSRLGMRESSetMinIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRLGMRESSetMinIter ) +#define HYPRE_ParCSRLGMRESSetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRLGMRESSetPrecond ) +#define HYPRE_ParCSRLGMRESSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRLGMRESSetPrintLevel ) +#define HYPRE_ParCSRLGMRESSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRLGMRESSetTol ) +#define HYPRE_ParCSRLGMRESSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRLGMRESSetup ) +#define HYPRE_ParCSRLGMRESSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRLGMRESSolve ) +#define HYPRE_ParCSRMultiVectorPrint HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRMultiVectorPrint ) +#define HYPRE_ParCSRMultiVectorRead HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRMultiVectorRead ) +#define HYPRE_ParCSROnProcTriSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSROnProcTriSetup ) +#define HYPRE_ParCSROnProcTriSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSROnProcTriSolve ) +#define HYPRE_ParCSRPCGCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRPCGCreate ) +#define HYPRE_ParCSRPCGDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRPCGDestroy ) +#define HYPRE_ParCSRPCGGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRPCGGetFinalRelativeResidualNorm ) +#define HYPRE_ParCSRPCGGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRPCGGetNumIterations ) +#define HYPRE_ParCSRPCGGetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRPCGGetPrecond ) +#define HYPRE_ParCSRPCGGetResidual HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRPCGGetResidual ) +#define HYPRE_ParCSRPCGSetAbsoluteTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRPCGSetAbsoluteTol ) +#define HYPRE_ParCSRPCGSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRPCGSetLogging ) +#define HYPRE_ParCSRPCGSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRPCGSetMaxIter ) +#define HYPRE_ParCSRPCGSetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRPCGSetPrecond ) +#define HYPRE_ParCSRPCGSetPreconditioner HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRPCGSetPreconditioner ) +#define HYPRE_ParCSRPCGSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRPCGSetPrintLevel ) +#define HYPRE_ParCSRPCGSetRelChange HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRPCGSetRelChange ) +#define HYPRE_ParCSRPCGSetStopCrit HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRPCGSetStopCrit ) +#define HYPRE_ParCSRPCGSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRPCGSetTol ) +#define HYPRE_ParCSRPCGSetTwoNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRPCGSetTwoNorm ) +#define HYPRE_ParCSRPCGSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRPCGSetup ) +#define HYPRE_ParCSRPCGSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRPCGSolve ) +#define HYPRE_ParCSRParaSailsCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRParaSailsCreate ) +#define HYPRE_ParCSRParaSailsDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRParaSailsDestroy ) +#define HYPRE_ParCSRParaSailsGetFilter HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRParaSailsGetFilter ) +#define HYPRE_ParCSRParaSailsGetLoadbal HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRParaSailsGetLoadbal ) +#define HYPRE_ParCSRParaSailsSetFilter HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRParaSailsSetFilter ) +#define HYPRE_ParCSRParaSailsSetLoadbal HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRParaSailsSetLoadbal ) +#define HYPRE_ParCSRParaSailsSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRParaSailsSetLogging ) +#define HYPRE_ParCSRParaSailsSetParams HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRParaSailsSetParams ) +#define HYPRE_ParCSRParaSailsSetReuse HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRParaSailsSetReuse ) +#define HYPRE_ParCSRParaSailsSetSym HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRParaSailsSetSym ) +#define HYPRE_ParCSRParaSailsSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRParaSailsSetup ) +#define HYPRE_ParCSRParaSailsSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRParaSailsSolve ) +#define HYPRE_ParCSRPilutCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRPilutCreate ) +#define HYPRE_ParCSRPilutDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRPilutDestroy ) +#define HYPRE_ParCSRPilutSetDropTolerance HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRPilutSetDropTolerance ) +#define HYPRE_ParCSRPilutSetFactorRowSize HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRPilutSetFactorRowSize ) +#define HYPRE_ParCSRPilutSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRPilutSetLogging ) +#define HYPRE_ParCSRPilutSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRPilutSetMaxIter ) +#define HYPRE_ParCSRPilutSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRPilutSetup ) +#define HYPRE_ParCSRPilutSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRPilutSolve ) +#define HYPRE_ParCSRSetupInterpreter HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRSetupInterpreter ) +#define HYPRE_ParCSRSetupMatvec HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRSetupMatvec ) +#define HYPRE_ParaSailsBuildIJMatrix HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParaSailsBuildIJMatrix ) +#define HYPRE_ParaSailsCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParaSailsCreate ) +#define HYPRE_ParaSailsDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParaSailsDestroy ) +#define HYPRE_ParaSailsGetFilter HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParaSailsGetFilter ) +#define HYPRE_ParaSailsGetLoadbal HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParaSailsGetLoadbal ) +#define HYPRE_ParaSailsGetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParaSailsGetLogging ) +#define HYPRE_ParaSailsGetNlevels HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParaSailsGetNlevels ) +#define HYPRE_ParaSailsGetReuse HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParaSailsGetReuse ) +#define HYPRE_ParaSailsGetSym HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParaSailsGetSym ) +#define HYPRE_ParaSailsGetThresh HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParaSailsGetThresh ) +#define HYPRE_ParaSailsSetFilter HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParaSailsSetFilter ) +#define HYPRE_ParaSailsSetLoadbal HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParaSailsSetLoadbal ) +#define HYPRE_ParaSailsSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParaSailsSetLogging ) +#define HYPRE_ParaSailsSetNlevels HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParaSailsSetNlevels ) +#define HYPRE_ParaSailsSetParams HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParaSailsSetParams ) +#define HYPRE_ParaSailsSetReuse HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParaSailsSetReuse ) +#define HYPRE_ParaSailsSetSym HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParaSailsSetSym ) +#define HYPRE_ParaSailsSetThresh HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParaSailsSetThresh ) +#define HYPRE_ParaSailsSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParaSailsSetup ) +#define HYPRE_ParaSailsSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParaSailsSolve ) +#define HYPRE_SchwarzCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_SchwarzCreate ) +#define HYPRE_SchwarzDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_SchwarzDestroy ) +#define HYPRE_SchwarzSetDofFunc HYPRE_MULTIPRECISION_FUNC ( HYPRE_SchwarzSetDofFunc ) +#define HYPRE_SchwarzSetDomainStructure HYPRE_MULTIPRECISION_FUNC ( HYPRE_SchwarzSetDomainStructure ) +#define HYPRE_SchwarzSetDomainType HYPRE_MULTIPRECISION_FUNC ( HYPRE_SchwarzSetDomainType ) +#define HYPRE_SchwarzSetNonSymm HYPRE_MULTIPRECISION_FUNC ( HYPRE_SchwarzSetNonSymm ) +#define HYPRE_SchwarzSetNumFunctions HYPRE_MULTIPRECISION_FUNC ( HYPRE_SchwarzSetNumFunctions ) +#define HYPRE_SchwarzSetOverlap HYPRE_MULTIPRECISION_FUNC ( HYPRE_SchwarzSetOverlap ) +#define HYPRE_SchwarzSetRelaxWeight HYPRE_MULTIPRECISION_FUNC ( HYPRE_SchwarzSetRelaxWeight ) +#define HYPRE_SchwarzSetVariant HYPRE_MULTIPRECISION_FUNC ( HYPRE_SchwarzSetVariant ) +#define HYPRE_SchwarzSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_SchwarzSetup ) +#define HYPRE_SchwarzSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_SchwarzSolve ) +#define HYPRE_TempParCSRSetupInterpreter HYPRE_MULTIPRECISION_FUNC ( HYPRE_TempParCSRSetupInterpreter ) +#define GenerateDifConv HYPRE_FIXEDPRECISION_FUNC ( GenerateDifConv ) +#define GenerateLaplacian HYPRE_FIXEDPRECISION_FUNC ( GenerateLaplacian ) +#define GenerateLaplacian27pt HYPRE_FIXEDPRECISION_FUNC ( GenerateLaplacian27pt ) +#define GenerateLaplacian9pt HYPRE_FIXEDPRECISION_FUNC ( GenerateLaplacian9pt ) +#define GenerateRSVarDifConv HYPRE_FIXEDPRECISION_FUNC ( GenerateRSVarDifConv ) +#define GenerateRotate7pt HYPRE_FIXEDPRECISION_FUNC ( GenerateRotate7pt ) +#define GenerateSysLaplacian HYPRE_FIXEDPRECISION_FUNC ( GenerateSysLaplacian ) +#define GenerateSysLaplacianVCoef HYPRE_FIXEDPRECISION_FUNC ( GenerateSysLaplacianVCoef ) +#define GenerateVarDifConv HYPRE_FIXEDPRECISION_FUNC ( GenerateVarDifConv ) +#define afun HYPRE_FIXEDPRECISION_FUNC ( afun ) +#define afun_rs HYPRE_FIXEDPRECISION_FUNC ( afun_rs ) +#define aux_indexFromMask HYPRE_FIXEDPRECISION_FUNC ( aux_indexFromMask ) +#define aux_maskCount HYPRE_FIXEDPRECISION_FUNC ( aux_maskCount ) +#define bfun HYPRE_FIXEDPRECISION_FUNC ( bfun ) +#define bfun_rs HYPRE_FIXEDPRECISION_FUNC ( bfun_rs ) +#define bndfun HYPRE_FIXEDPRECISION_FUNC ( bndfun ) +#define bndfun_rs HYPRE_FIXEDPRECISION_FUNC ( bndfun_rs ) +#define cfun HYPRE_FIXEDPRECISION_FUNC ( cfun ) +#define cfun_rs HYPRE_FIXEDPRECISION_FUNC ( cfun_rs ) +#define dfun HYPRE_FIXEDPRECISION_FUNC ( dfun ) +#define dfun_rs HYPRE_FIXEDPRECISION_FUNC ( dfun_rs ) +#define efun HYPRE_FIXEDPRECISION_FUNC ( efun ) +#define efun_rs HYPRE_FIXEDPRECISION_FUNC ( efun_rs ) +#define ffun HYPRE_FIXEDPRECISION_FUNC ( ffun ) +#define ffun_rs HYPRE_FIXEDPRECISION_FUNC ( ffun_rs ) +#define gfun HYPRE_FIXEDPRECISION_FUNC ( gfun ) +#define gfun_rs HYPRE_FIXEDPRECISION_FUNC ( gfun_rs ) +#define hypre_ADSComputePi HYPRE_FIXEDPRECISION_FUNC ( hypre_ADSComputePi ) +#define hypre_ADSComputePixyz HYPRE_FIXEDPRECISION_FUNC ( hypre_ADSComputePixyz ) +#define hypre_ADSCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_ADSCreate ) +#define hypre_ADSDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_ADSDestroy ) +#define hypre_ADSGetFinalRelativeResidualNorm HYPRE_FIXEDPRECISION_FUNC ( hypre_ADSGetFinalRelativeResidualNorm ) +#define hypre_ADSGetNumIterations HYPRE_FIXEDPRECISION_FUNC ( hypre_ADSGetNumIterations ) +#define hypre_ADSSetAMGOptions HYPRE_FIXEDPRECISION_FUNC ( hypre_ADSSetAMGOptions ) +#define hypre_ADSSetAMSOptions HYPRE_FIXEDPRECISION_FUNC ( hypre_ADSSetAMSOptions ) +#define hypre_ADSSetChebySmoothingOptions HYPRE_FIXEDPRECISION_FUNC ( hypre_ADSSetChebySmoothingOptions ) +#define hypre_ADSSetCoordinateVectors HYPRE_FIXEDPRECISION_FUNC ( hypre_ADSSetCoordinateVectors ) +#define hypre_ADSSetCycleType HYPRE_FIXEDPRECISION_FUNC ( hypre_ADSSetCycleType ) +#define hypre_ADSSetDiscreteCurl HYPRE_FIXEDPRECISION_FUNC ( hypre_ADSSetDiscreteCurl ) +#define hypre_ADSSetDiscreteGradient HYPRE_FIXEDPRECISION_FUNC ( hypre_ADSSetDiscreteGradient ) +#define hypre_ADSSetInterpolations HYPRE_FIXEDPRECISION_FUNC ( hypre_ADSSetInterpolations ) +#define hypre_ADSSetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_ADSSetMaxIter ) +#define hypre_ADSSetPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_ADSSetPrintLevel ) +#define hypre_ADSSetSmoothingOptions HYPRE_FIXEDPRECISION_FUNC ( hypre_ADSSetSmoothingOptions ) +#define hypre_ADSSetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_ADSSetTol ) +#define hypre_ADSSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_ADSSetup ) +#define hypre_ADSSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_ADSSolve ) +#define hypre_AMECreate HYPRE_FIXEDPRECISION_FUNC ( hypre_AMECreate ) +#define hypre_AMEDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_AMEDestroy ) +#define hypre_AMEDiscrDivFreeComponent HYPRE_FIXEDPRECISION_FUNC ( hypre_AMEDiscrDivFreeComponent ) +#define hypre_AMEGetEigenvalues HYPRE_FIXEDPRECISION_FUNC ( hypre_AMEGetEigenvalues ) +#define hypre_AMEGetEigenvectors HYPRE_FIXEDPRECISION_FUNC ( hypre_AMEGetEigenvectors ) +#define hypre_AMEMultiOperatorA HYPRE_FIXEDPRECISION_FUNC ( hypre_AMEMultiOperatorA ) +#define hypre_AMEMultiOperatorB HYPRE_FIXEDPRECISION_FUNC ( hypre_AMEMultiOperatorB ) +#define hypre_AMEMultiOperatorM HYPRE_FIXEDPRECISION_FUNC ( hypre_AMEMultiOperatorM ) +#define hypre_AMEOperatorA HYPRE_FIXEDPRECISION_FUNC ( hypre_AMEOperatorA ) +#define hypre_AMEOperatorB HYPRE_FIXEDPRECISION_FUNC ( hypre_AMEOperatorB ) +#define hypre_AMEOperatorM HYPRE_FIXEDPRECISION_FUNC ( hypre_AMEOperatorM ) +#define hypre_AMESetAMSSolver HYPRE_FIXEDPRECISION_FUNC ( hypre_AMESetAMSSolver ) +#define hypre_AMESetBlockSize HYPRE_FIXEDPRECISION_FUNC ( hypre_AMESetBlockSize ) +#define hypre_AMESetMassMatrix HYPRE_FIXEDPRECISION_FUNC ( hypre_AMESetMassMatrix ) +#define hypre_AMESetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_AMESetMaxIter ) +#define hypre_AMESetMaxPCGIter HYPRE_FIXEDPRECISION_FUNC ( hypre_AMESetMaxPCGIter ) +#define hypre_AMESetPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_AMESetPrintLevel ) +#define hypre_AMESetRTol HYPRE_FIXEDPRECISION_FUNC ( hypre_AMESetRTol ) +#define hypre_AMESetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_AMESetTol ) +#define hypre_AMESetup HYPRE_FIXEDPRECISION_FUNC ( hypre_AMESetup ) +#define hypre_AMESolve HYPRE_FIXEDPRECISION_FUNC ( hypre_AMESolve ) +#define hypre_AMGCreateDomainDof HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGCreateDomainDof ) +#define hypre_AMGDDCommPkgCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGDDCommPkgCreate ) +#define hypre_AMGDDCommPkgDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGDDCommPkgDestroy ) +#define hypre_AMGDDCommPkgRecvLevelDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGDDCommPkgRecvLevelDestroy ) +#define hypre_AMGDDCommPkgSendLevelDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGDDCommPkgSendLevelDestroy ) +#define hypre_AMGDDCompGridCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGDDCompGridCreate ) +#define hypre_AMGDDCompGridDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGDDCompGridDestroy ) +#define hypre_AMGDDCompGridFinalize HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGDDCompGridFinalize ) +#define hypre_AMGDDCompGridInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGDDCompGridInitialize ) +#define hypre_AMGDDCompGridLocalIndexBinarySearch HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGDDCompGridLocalIndexBinarySearch ) +#define hypre_AMGDDCompGridMatrixCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGDDCompGridMatrixCreate ) +#define hypre_AMGDDCompGridMatrixDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGDDCompGridMatrixDestroy ) +#define hypre_AMGDDCompGridMatrixSetupRealMatvec HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGDDCompGridMatrixSetupRealMatvec ) +#define hypre_AMGDDCompGridMatvec HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGDDCompGridMatvec ) +#define hypre_AMGDDCompGridRealMatvec HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGDDCompGridRealMatvec ) +#define hypre_AMGDDCompGridResize HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGDDCompGridResize ) +#define hypre_AMGDDCompGridSetupLocalIndices HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGDDCompGridSetupLocalIndices ) +#define hypre_AMGDDCompGridSetupLocalIndicesP HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGDDCompGridSetupLocalIndicesP ) +#define hypre_AMGDDCompGridSetupRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGDDCompGridSetupRelax ) +#define hypre_AMGDDCompGridVectorAxpy HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGDDCompGridVectorAxpy ) +#define hypre_AMGDDCompGridVectorCopy HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGDDCompGridVectorCopy ) +#define hypre_AMGDDCompGridVectorCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGDDCompGridVectorCreate ) +#define hypre_AMGDDCompGridVectorDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGDDCompGridVectorDestroy ) +#define hypre_AMGDDCompGridVectorInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGDDCompGridVectorInitialize ) +#define hypre_AMGDDCompGridVectorInnerProd HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGDDCompGridVectorInnerProd ) +#define hypre_AMGDDCompGridVectorRealAxpy HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGDDCompGridVectorRealAxpy ) +#define hypre_AMGDDCompGridVectorRealCopy HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGDDCompGridVectorRealCopy ) +#define hypre_AMGDDCompGridVectorRealInnerProd HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGDDCompGridVectorRealInnerProd ) +#define hypre_AMGDDCompGridVectorRealScale HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGDDCompGridVectorRealScale ) +#define hypre_AMGDDCompGridVectorRealSetConstantValues HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGDDCompGridVectorRealSetConstantValues ) +#define hypre_AMGDDCompGridVectorScale HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGDDCompGridVectorScale ) +#define hypre_AMGDDCompGridVectorSetConstantValues HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGDDCompGridVectorSetConstantValues ) +#define hypre_AMGHybridCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridCreate ) +#define hypre_AMGHybridDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridDestroy ) +#define hypre_AMGHybridGetDSCGNumIterations HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridGetDSCGNumIterations ) +#define hypre_AMGHybridGetFinalRelativeResidualNorm HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridGetFinalRelativeResidualNorm ) +#define hypre_AMGHybridGetNumIterations HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridGetNumIterations ) +#define hypre_AMGHybridGetPCGNumIterations HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridGetPCGNumIterations ) +#define hypre_AMGHybridGetRecomputeResidual HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridGetRecomputeResidual ) +#define hypre_AMGHybridGetRecomputeResidualP HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridGetRecomputeResidualP ) +#define hypre_AMGHybridGetSetupSolveTime HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridGetSetupSolveTime ) +#define hypre_AMGHybridSetAbsoluteTol HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetAbsoluteTol ) +#define hypre_AMGHybridSetAggInterpType HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetAggInterpType ) +#define hypre_AMGHybridSetAggNumLevels HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetAggNumLevels ) +#define hypre_AMGHybridSetCoarsenType HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetCoarsenType ) +#define hypre_AMGHybridSetConvergenceTol HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetConvergenceTol ) +#define hypre_AMGHybridSetCycleNumSweeps HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetCycleNumSweeps ) +#define hypre_AMGHybridSetCycleRelaxType HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetCycleRelaxType ) +#define hypre_AMGHybridSetCycleType HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetCycleType ) +#define hypre_AMGHybridSetDSCGMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetDSCGMaxIter ) +#define hypre_AMGHybridSetDofFunc HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetDofFunc ) +#define hypre_AMGHybridSetGridRelaxPoints HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetGridRelaxPoints ) +#define hypre_AMGHybridSetGridRelaxType HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetGridRelaxType ) +#define hypre_AMGHybridSetInterpType HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetInterpType ) +#define hypre_AMGHybridSetKDim HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetKDim ) +#define hypre_AMGHybridSetKeepTranspose HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetKeepTranspose ) +#define hypre_AMGHybridSetLevelOuterWt HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetLevelOuterWt ) +#define hypre_AMGHybridSetLevelRelaxWt HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetLevelRelaxWt ) +#define hypre_AMGHybridSetLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetLogging ) +#define hypre_AMGHybridSetMaxCoarseSize HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetMaxCoarseSize ) +#define hypre_AMGHybridSetMaxLevels HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetMaxLevels ) +#define hypre_AMGHybridSetMaxRowSum HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetMaxRowSum ) +#define hypre_AMGHybridSetMeasureType HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetMeasureType ) +#define hypre_AMGHybridSetMinCoarseSize HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetMinCoarseSize ) +#define hypre_AMGHybridSetNodal HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetNodal ) +#define hypre_AMGHybridSetNonGalerkinTol HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetNonGalerkinTol ) +#define hypre_AMGHybridSetNumFunctions HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetNumFunctions ) +#define hypre_AMGHybridSetNumGridSweeps HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetNumGridSweeps ) +#define hypre_AMGHybridSetNumPaths HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetNumPaths ) +#define hypre_AMGHybridSetNumSweeps HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetNumSweeps ) +#define hypre_AMGHybridSetOmega HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetOmega ) +#define hypre_AMGHybridSetOuterWt HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetOuterWt ) +#define hypre_AMGHybridSetPCGMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetPCGMaxIter ) +#define hypre_AMGHybridSetPMaxElmts HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetPMaxElmts ) +#define hypre_AMGHybridSetPrecond HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetPrecond ) +#define hypre_AMGHybridSetPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetPrintLevel ) +#define hypre_AMGHybridSetRecomputeResidual HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetRecomputeResidual ) +#define hypre_AMGHybridSetRecomputeResidualP HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetRecomputeResidualP ) +#define hypre_AMGHybridSetRelChange HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetRelChange ) +#define hypre_AMGHybridSetRelaxOrder HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetRelaxOrder ) +#define hypre_AMGHybridSetRelaxType HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetRelaxType ) +#define hypre_AMGHybridSetRelaxWeight HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetRelaxWeight ) +#define hypre_AMGHybridSetRelaxWt HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetRelaxWt ) +#define hypre_AMGHybridSetSeqThreshold HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetSeqThreshold ) +#define hypre_AMGHybridSetSetupType HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetSetupType ) +#define hypre_AMGHybridSetSolverType HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetSolverType ) +#define hypre_AMGHybridSetStopCrit HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetStopCrit ) +#define hypre_AMGHybridSetStrongThreshold HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetStrongThreshold ) +#define hypre_AMGHybridSetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetTol ) +#define hypre_AMGHybridSetTruncFactor HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetTruncFactor ) +#define hypre_AMGHybridSetTwoNorm HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetTwoNorm ) +#define hypre_AMGHybridSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSetup ) +#define hypre_AMGHybridSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGHybridSolve ) +#define hypre_AMGNodalSchwarzSmoother HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGNodalSchwarzSmoother ) +#define hypre_AMGeAgglomerate HYPRE_FIXEDPRECISION_FUNC ( hypre_AMGeAgglomerate ) +#define hypre_AMSComputeGPi HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSComputeGPi ) +#define hypre_AMSComputePi HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSComputePi ) +#define hypre_AMSComputePixyz HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSComputePixyz ) +#define hypre_AMSConstructDiscreteGradient HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSConstructDiscreteGradient ) +#define hypre_AMSCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSCreate ) +#define hypre_AMSDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSDestroy ) +#define hypre_AMSFEIDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSFEIDestroy ) +#define hypre_AMSFEISetup HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSFEISetup ) +#define hypre_AMSGetFinalRelativeResidualNorm HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSGetFinalRelativeResidualNorm ) +#define hypre_AMSGetNumIterations HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSGetNumIterations ) +#define hypre_AMSProjectOutGradients HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSProjectOutGradients ) +#define hypre_AMSSetAlphaAMGCoarseRelaxType HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSSetAlphaAMGCoarseRelaxType ) +#define hypre_AMSSetAlphaAMGOptions HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSSetAlphaAMGOptions ) +#define hypre_AMSSetAlphaPoissonMatrix HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSSetAlphaPoissonMatrix ) +#define hypre_AMSSetBetaAMGCoarseRelaxType HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSSetBetaAMGCoarseRelaxType ) +#define hypre_AMSSetBetaAMGOptions HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSSetBetaAMGOptions ) +#define hypre_AMSSetBetaPoissonMatrix HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSSetBetaPoissonMatrix ) +#define hypre_AMSSetChebySmoothingOptions HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSSetChebySmoothingOptions ) +#define hypre_AMSSetCoordinateVectors HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSSetCoordinateVectors ) +#define hypre_AMSSetCycleType HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSSetCycleType ) +#define hypre_AMSSetDimension HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSSetDimension ) +#define hypre_AMSSetDiscreteGradient HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSSetDiscreteGradient ) +#define hypre_AMSSetEdgeConstantVectors HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSSetEdgeConstantVectors ) +#define hypre_AMSSetInteriorNodes HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSSetInteriorNodes ) +#define hypre_AMSSetInterpolations HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSSetInterpolations ) +#define hypre_AMSSetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSSetMaxIter ) +#define hypre_AMSSetPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSSetPrintLevel ) +#define hypre_AMSSetProjectionFrequency HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSSetProjectionFrequency ) +#define hypre_AMSSetSmoothingOptions HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSSetSmoothingOptions ) +#define hypre_AMSSetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSSetTol ) +#define hypre_AMSSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSSetup ) +#define hypre_AMSSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_AMSSolve ) +#define hypre_AdSchwarzCFSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_AdSchwarzCFSolve ) +#define hypre_AdSchwarzSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_AdSchwarzSolve ) +#define hypre_AddToPattern HYPRE_FIXEDPRECISION_FUNC ( hypre_AddToPattern ) +#define hypre_AmgCGCBoundaryFix HYPRE_FIXEDPRECISION_FUNC ( hypre_AmgCGCBoundaryFix ) +#define hypre_AmgCGCChoose HYPRE_FIXEDPRECISION_FUNC ( hypre_AmgCGCChoose ) +#define hypre_AmgCGCGraphAssemble HYPRE_FIXEDPRECISION_FUNC ( hypre_AmgCGCGraphAssemble ) +#define hypre_AmgCGCPrepare HYPRE_FIXEDPRECISION_FUNC ( hypre_AmgCGCPrepare ) +#define hypre_Bisection HYPRE_FIXEDPRECISION_FUNC ( hypre_Bisection ) +#define hypre_BlockDiagInvLapack HYPRE_FIXEDPRECISION_FUNC ( hypre_BlockDiagInvLapack ) +#define hypre_BlockTridiagCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_BlockTridiagCreate ) +#define hypre_BlockTridiagDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_BlockTridiagDestroy ) +#define hypre_BlockTridiagSetAMGNumSweeps HYPRE_FIXEDPRECISION_FUNC ( hypre_BlockTridiagSetAMGNumSweeps ) +#define hypre_BlockTridiagSetAMGRelaxType HYPRE_FIXEDPRECISION_FUNC ( hypre_BlockTridiagSetAMGRelaxType ) +#define hypre_BlockTridiagSetAMGStrengthThreshold HYPRE_FIXEDPRECISION_FUNC ( hypre_BlockTridiagSetAMGStrengthThreshold ) +#define hypre_BlockTridiagSetIndexSet HYPRE_FIXEDPRECISION_FUNC ( hypre_BlockTridiagSetIndexSet ) +#define hypre_BlockTridiagSetPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_BlockTridiagSetPrintLevel ) +#define hypre_BlockTridiagSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_BlockTridiagSetup ) +#define hypre_BlockTridiagSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_BlockTridiagSolve ) +#define hypre_BoomerAMGAdditiveCycle HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGAdditiveCycle ) +#define hypre_BoomerAMGBlockSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBlockSolve ) +#define hypre_BoomerAMGBuildCoarseOperator HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildCoarseOperator ) +#define hypre_BoomerAMGBuildCoarseOperatorKT HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildCoarseOperatorKT ) +#define hypre_BoomerAMGBuildDirInterp HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildDirInterp ) +#define hypre_BoomerAMGBuildDirInterpHost HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildDirInterpHost ) +#define hypre_BoomerAMGBuildExtInterp HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildExtInterp ) +#define hypre_BoomerAMGBuildExtInterpHost HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildExtInterpHost ) +#define hypre_BoomerAMGBuildExtPICCInterp HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildExtPICCInterp ) +#define hypre_BoomerAMGBuildExtPIInterp HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildExtPIInterp ) +#define hypre_BoomerAMGBuildExtPIInterpHost HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildExtPIInterpHost ) +#define hypre_BoomerAMGBuildFF1Interp HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildFF1Interp ) +#define hypre_BoomerAMGBuildFFInterp HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildFFInterp ) +#define hypre_BoomerAMGBuildInterp HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildInterp ) +#define hypre_BoomerAMGBuildInterpGSMG HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildInterpGSMG ) +#define hypre_BoomerAMGBuildInterpHE HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildInterpHE ) +#define hypre_BoomerAMGBuildInterpLS HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildInterpLS ) +#define hypre_BoomerAMGBuildInterpModUnk HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildInterpModUnk ) +#define hypre_BoomerAMGBuildInterpOnePnt HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildInterpOnePnt ) +#define hypre_BoomerAMGBuildInterpOnePntHost HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildInterpOnePntHost ) +#define hypre_BoomerAMGBuildModExtInterp HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildModExtInterp ) +#define hypre_BoomerAMGBuildModExtInterpHost HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildModExtInterpHost ) +#define hypre_BoomerAMGBuildModExtPEInterp HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildModExtPEInterp ) +#define hypre_BoomerAMGBuildModExtPEInterpHost HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildModExtPEInterpHost ) +#define hypre_BoomerAMGBuildModExtPIInterp HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildModExtPIInterp ) +#define hypre_BoomerAMGBuildModExtPIInterpHost HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildModExtPIInterpHost ) +#define hypre_BoomerAMGBuildModMultipass HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildModMultipass ) +#define hypre_BoomerAMGBuildModMultipassHost HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildModMultipassHost ) +#define hypre_BoomerAMGBuildModPartialExtInterp HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildModPartialExtInterp ) +#define hypre_BoomerAMGBuildModPartialExtInterpHost HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildModPartialExtInterpHost ) +#define hypre_BoomerAMGBuildModPartialExtPEInterp HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildModPartialExtPEInterp ) +#define hypre_BoomerAMGBuildModPartialExtPEInterpHost HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildModPartialExtPEInterpHost ) +#define hypre_BoomerAMGBuildMultipass HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildMultipass ) +#define hypre_BoomerAMGBuildMultipassHost HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildMultipassHost ) +#define hypre_BoomerAMGBuildNonGalerkinCoarseOperator HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildNonGalerkinCoarseOperator ) +#define hypre_BoomerAMGBuildPartialExtInterp HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildPartialExtInterp ) +#define hypre_BoomerAMGBuildPartialExtPIInterp HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildPartialExtPIInterp ) +#define hypre_BoomerAMGBuildPartialStdInterp HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildPartialStdInterp ) +#define hypre_BoomerAMGBuildRestrAIR HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildRestrAIR ) +#define hypre_BoomerAMGBuildRestrDist2AIR HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildRestrDist2AIR ) +#define hypre_BoomerAMGBuildRestrNeumannAIR HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildRestrNeumannAIR ) +#define hypre_BoomerAMGBuildRestrNeumannAIRHost HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildRestrNeumannAIRHost ) +#define hypre_BoomerAMGBuildStdInterp HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGBuildStdInterp ) +#define hypre_BoomerAMGCGRelaxWt HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCGRelaxWt ) +#define hypre_BoomerAMGCoarseParms HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCoarseParms ) +#define hypre_BoomerAMGCoarseParmsHost HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCoarseParmsHost ) +#define hypre_BoomerAMGCoarsen HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCoarsen ) +#define hypre_BoomerAMGCoarsenCGC HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCoarsenCGC ) +#define hypre_BoomerAMGCoarsenCGCb HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCoarsenCGCb ) +#define hypre_BoomerAMGCoarsenCR HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCoarsenCR ) +#define hypre_BoomerAMGCoarsenCR1 HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCoarsenCR1 ) +#define hypre_BoomerAMGCoarsenFalgout HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCoarsenFalgout ) +#define hypre_BoomerAMGCoarsenHMIS HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCoarsenHMIS ) +#define hypre_BoomerAMGCoarsenInterpVectors HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCoarsenInterpVectors ) +#define hypre_BoomerAMGCoarsenPMIS HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCoarsenPMIS ) +#define hypre_BoomerAMGCoarsenPMISHost HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCoarsenPMISHost ) +#define hypre_BoomerAMGCoarsenRuge HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCoarsenRuge ) +#define hypre_BoomerAMGCorrectCFMarker HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCorrectCFMarker ) +#define hypre_BoomerAMGCorrectCFMarker2 HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCorrectCFMarker2 ) +#define hypre_BoomerAMGCorrectCFMarker2Host HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCorrectCFMarker2Host ) +#define hypre_BoomerAMGCorrectCFMarkerHost HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCorrectCFMarkerHost ) +#define hypre_BoomerAMGCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCreate ) +#define hypre_BoomerAMGCreate2ndS HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCreate2ndS ) +#define hypre_BoomerAMGCreate2ndSHost HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCreate2ndSHost ) +#define hypre_BoomerAMGCreateNodalA HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCreateNodalA ) +#define hypre_BoomerAMGCreateS HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCreateS ) +#define hypre_BoomerAMGCreateSCommPkg HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCreateSCommPkg ) +#define hypre_BoomerAMGCreateSFromCFMarker HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCreateSFromCFMarker ) +#define hypre_BoomerAMGCreateSHost HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCreateSHost ) +#define hypre_BoomerAMGCreateSabs HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCreateSabs ) +#define hypre_BoomerAMGCreateSabsHost HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCreateSabsHost ) +#define hypre_BoomerAMGCreateScalarCF HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCreateScalarCF ) +#define hypre_BoomerAMGCreateScalarCFS HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCreateScalarCFS ) +#define hypre_BoomerAMGCreateSmoothDirs HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCreateSmoothDirs ) +#define hypre_BoomerAMGCreateSmoothVecs HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCreateSmoothVecs ) +#define hypre_BoomerAMGCycle HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCycle ) +#define hypre_BoomerAMGCycleT HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGCycleT ) +#define hypre_BoomerAMGDDCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDDCreate ) +#define hypre_BoomerAMGDDDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDDDestroy ) +#define hypre_BoomerAMGDDGetAMG HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDDGetAMG ) +#define hypre_BoomerAMGDDGetFACCycleType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDDGetFACCycleType ) +#define hypre_BoomerAMGDDGetFACNumCycles HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDDGetFACNumCycles ) +#define hypre_BoomerAMGDDGetFACNumRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDDGetFACNumRelax ) +#define hypre_BoomerAMGDDGetFACRelaxType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDDGetFACRelaxType ) +#define hypre_BoomerAMGDDGetFACRelaxWeight HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDDGetFACRelaxWeight ) +#define hypre_BoomerAMGDDGetNumGhostLayers HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDDGetNumGhostLayers ) +#define hypre_BoomerAMGDDGetPadding HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDDGetPadding ) +#define hypre_BoomerAMGDDGetStartLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDDGetStartLevel ) +#define hypre_BoomerAMGDDSetFACCycleType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDDSetFACCycleType ) +#define hypre_BoomerAMGDDSetFACNumCycles HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDDSetFACNumCycles ) +#define hypre_BoomerAMGDDSetFACNumRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDDSetFACNumRelax ) +#define hypre_BoomerAMGDDSetFACRelaxType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDDSetFACRelaxType ) +#define hypre_BoomerAMGDDSetFACRelaxWeight HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDDSetFACRelaxWeight ) +#define hypre_BoomerAMGDDSetNumGhostLayers HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDDSetNumGhostLayers ) +#define hypre_BoomerAMGDDSetPadding HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDDSetPadding ) +#define hypre_BoomerAMGDDSetStartLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDDSetStartLevel ) +#define hypre_BoomerAMGDDSetUserFACRelaxation HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDDSetUserFACRelaxation ) +#define hypre_BoomerAMGDDSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDDSetup ) +#define hypre_BoomerAMGDDSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDDSolve ) +#define hypre_BoomerAMGDD_AddFlagToSendFlag HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_AddFlagToSendFlag ) +#define hypre_BoomerAMGDD_AddToSendAndRequestDofs HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_AddToSendAndRequestDofs ) +#define hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo ) +#define hypre_BoomerAMGDD_FAC HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_FAC ) +#define hypre_BoomerAMGDD_FAC_CFL1Jacobi HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_FAC_CFL1Jacobi ) +#define hypre_BoomerAMGDD_FAC_CFL1JacobiHost HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_FAC_CFL1JacobiHost ) +#define hypre_BoomerAMGDD_FAC_Cycle HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_FAC_Cycle ) +#define hypre_BoomerAMGDD_FAC_FCycle HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_FAC_FCycle ) +#define hypre_BoomerAMGDD_FAC_GaussSeidel HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_FAC_GaussSeidel ) +#define hypre_BoomerAMGDD_FAC_Interpolate HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_FAC_Interpolate ) +#define hypre_BoomerAMGDD_FAC_Jacobi HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_FAC_Jacobi ) +#define hypre_BoomerAMGDD_FAC_JacobiHost HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_FAC_JacobiHost ) +#define hypre_BoomerAMGDD_FAC_OrderedGaussSeidel HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_FAC_OrderedGaussSeidel ) +#define hypre_BoomerAMGDD_FAC_Relax HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_FAC_Relax ) +#define hypre_BoomerAMGDD_FAC_Restrict HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_FAC_Restrict ) +#define hypre_BoomerAMGDD_FindNeighborProcessors HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_FindNeighborProcessors ) +#define hypre_BoomerAMGDD_FixUpRecvMaps HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_FixUpRecvMaps ) +#define hypre_BoomerAMGDD_GetDofRecvProc HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_GetDofRecvProc ) +#define hypre_BoomerAMGDD_LocalToGlobalIndex HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_LocalToGlobalIndex ) +#define hypre_BoomerAMGDD_MarkCoarse HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_MarkCoarse ) +#define hypre_BoomerAMGDD_PackColInd HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_PackColInd ) +#define hypre_BoomerAMGDD_PackRecvMapSendBuffer HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_PackRecvMapSendBuffer ) +#define hypre_BoomerAMGDD_PackResidualBuffer HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_PackResidualBuffer ) +#define hypre_BoomerAMGDD_PackSendBuffer HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_PackSendBuffer ) +#define hypre_BoomerAMGDD_RecursivelyBuildPsiComposite HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_RecursivelyBuildPsiComposite ) +#define hypre_BoomerAMGDD_RecursivelyFindNeighborNodes HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_RecursivelyFindNeighborNodes ) +#define hypre_BoomerAMGDD_RemoveRedundancy HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_RemoveRedundancy ) +#define hypre_BoomerAMGDD_ResidualCommunication HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_ResidualCommunication ) +#define hypre_BoomerAMGDD_SetupNearestProcessorNeighbors HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_SetupNearestProcessorNeighbors ) +#define hypre_BoomerAMGDD_SubtractLists HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_SubtractLists ) +#define hypre_BoomerAMGDD_UnpackRecvBuffer HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_UnpackRecvBuffer ) +#define hypre_BoomerAMGDD_UnpackResidualBuffer HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_UnpackResidualBuffer ) +#define hypre_BoomerAMGDD_UnpackSendFlagBuffer HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDD_UnpackSendFlagBuffer ) +#define hypre_BoomerAMGDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGDestroy ) +#define hypre_BoomerAMGFitVectors HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGFitVectors ) +#define hypre_BoomerAMGGetAdditive HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetAdditive ) +#define hypre_BoomerAMGGetAggProlongationName HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetAggProlongationName ) +#define hypre_BoomerAMGGetCoarsenCutFactor HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetCoarsenCutFactor ) +#define hypre_BoomerAMGGetCoarsenType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetCoarsenType ) +#define hypre_BoomerAMGGetCoarseningName HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetCoarseningName ) +#define hypre_BoomerAMGGetConvergeType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetConvergeType ) +#define hypre_BoomerAMGGetCumNnzAP HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetCumNnzAP ) +#define hypre_BoomerAMGGetCumNumIterations HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetCumNumIterations ) +#define hypre_BoomerAMGGetCycleName HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetCycleName ) +#define hypre_BoomerAMGGetCycleNumSweeps HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetCycleNumSweeps ) +#define hypre_BoomerAMGGetCycleRelaxType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetCycleRelaxType ) +#define hypre_BoomerAMGGetCycleType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetCycleType ) +#define hypre_BoomerAMGGetDebugFlag HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetDebugFlag ) +#define hypre_BoomerAMGGetDomainType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetDomainType ) +#define hypre_BoomerAMGGetFCycle HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetFCycle ) +#define hypre_BoomerAMGGetFilterFunctions HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetFilterFunctions ) +#define hypre_BoomerAMGGetFilterThresholdR HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetFilterThresholdR ) +#define hypre_BoomerAMGGetGridHierarchy HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetGridHierarchy ) +#define hypre_BoomerAMGGetGridRelaxPoints HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetGridRelaxPoints ) +#define hypre_BoomerAMGGetGridRelaxType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetGridRelaxType ) +#define hypre_BoomerAMGGetInterpType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetInterpType ) +#define hypre_BoomerAMGGetJacobiTruncThreshold HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetJacobiTruncThreshold ) +#define hypre_BoomerAMGGetLevelOuterWt HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetLevelOuterWt ) +#define hypre_BoomerAMGGetLevelRelaxWt HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetLevelRelaxWt ) +#define hypre_BoomerAMGGetLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetLogging ) +#define hypre_BoomerAMGGetMaxCoarseSize HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetMaxCoarseSize ) +#define hypre_BoomerAMGGetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetMaxIter ) +#define hypre_BoomerAMGGetMaxLevels HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetMaxLevels ) +#define hypre_BoomerAMGGetMaxRowSum HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetMaxRowSum ) +#define hypre_BoomerAMGGetMeasureType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetMeasureType ) +#define hypre_BoomerAMGGetMinCoarseSize HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetMinCoarseSize ) +#define hypre_BoomerAMGGetMinIter HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetMinIter ) +#define hypre_BoomerAMGGetMultAdditive HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetMultAdditive ) +#define hypre_BoomerAMGGetNumFunctions HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetNumFunctions ) +#define hypre_BoomerAMGGetNumGridSweeps HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetNumGridSweeps ) +#define hypre_BoomerAMGGetNumIterations HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetNumIterations ) +#define hypre_BoomerAMGGetOmega HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetOmega ) +#define hypre_BoomerAMGGetOverlap HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetOverlap ) +#define hypre_BoomerAMGGetPMaxElmts HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetPMaxElmts ) +#define hypre_BoomerAMGGetPostInterpType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetPostInterpType ) +#define hypre_BoomerAMGGetPrintFileName HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetPrintFileName ) +#define hypre_BoomerAMGGetPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetPrintLevel ) +#define hypre_BoomerAMGGetProlongationName HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetProlongationName ) +#define hypre_BoomerAMGGetRedundant HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetRedundant ) +#define hypre_BoomerAMGGetRelResidualNorm HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetRelResidualNorm ) +#define hypre_BoomerAMGGetRelaxOrder HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetRelaxOrder ) +#define hypre_BoomerAMGGetRelaxWeight HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetRelaxWeight ) +#define hypre_BoomerAMGGetResidual HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetResidual ) +#define hypre_BoomerAMGGetSchwarzRlxWeight HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetSchwarzRlxWeight ) +#define hypre_BoomerAMGGetSeqThreshold HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetSeqThreshold ) +#define hypre_BoomerAMGGetSetupType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetSetupType ) +#define hypre_BoomerAMGGetSimple HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetSimple ) +#define hypre_BoomerAMGGetSmoothNumLevels HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetSmoothNumLevels ) +#define hypre_BoomerAMGGetSmoothNumSweeps HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetSmoothNumSweeps ) +#define hypre_BoomerAMGGetSmoothType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetSmoothType ) +#define hypre_BoomerAMGGetStrongThreshold HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetStrongThreshold ) +#define hypre_BoomerAMGGetStrongThresholdR HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetStrongThresholdR ) +#define hypre_BoomerAMGGetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetTol ) +#define hypre_BoomerAMGGetTruncFactor HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetTruncFactor ) +#define hypre_BoomerAMGGetVariant HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGGetVariant ) +#define hypre_BoomerAMGIndepHMIS HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGIndepHMIS ) +#define hypre_BoomerAMGIndepHMISa HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGIndepHMISa ) +#define hypre_BoomerAMGIndepPMIS HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGIndepPMIS ) +#define hypre_BoomerAMGIndepPMISa HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGIndepPMISa ) +#define hypre_BoomerAMGIndepRS HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGIndepRS ) +#define hypre_BoomerAMGIndepRSa HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGIndepRSa ) +#define hypre_BoomerAMGIndepSet HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGIndepSet ) +#define hypre_BoomerAMGIndepSetInit HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGIndepSetInit ) +#define hypre_BoomerAMGInterpTruncation HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGInterpTruncation ) +#define hypre_BoomerAMGJacobiInterp HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGJacobiInterp ) +#define hypre_BoomerAMGJacobiInterp_1 HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGJacobiInterp_1 ) +#define hypre_BoomerAMGNormalizeVecs HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGNormalizeVecs ) +#define hypre_BoomerAMGPrintGeneralInfo HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGPrintGeneralInfo ) +#define hypre_BoomerAMGRefineInterp HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGRefineInterp ) +#define hypre_BoomerAMGRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGRelax ) +#define hypre_BoomerAMGRelax0WeightedJacobi HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGRelax0WeightedJacobi ) +#define hypre_BoomerAMGRelax10TopoOrderedGaussSeidel HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGRelax10TopoOrderedGaussSeidel ) +#define hypre_BoomerAMGRelax11TwoStageGaussSeidel HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGRelax11TwoStageGaussSeidel ) +#define hypre_BoomerAMGRelax12TwoStageGaussSeidel HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGRelax12TwoStageGaussSeidel ) +#define hypre_BoomerAMGRelax13HybridL1GaussSeidel HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGRelax13HybridL1GaussSeidel ) +#define hypre_BoomerAMGRelax14HybridL1GaussSeidel HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGRelax14HybridL1GaussSeidel ) +#define hypre_BoomerAMGRelax18WeightedL1Jacobi HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGRelax18WeightedL1Jacobi ) +#define hypre_BoomerAMGRelax1GaussSeidel HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGRelax1GaussSeidel ) +#define hypre_BoomerAMGRelax2GaussSeidel HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGRelax2GaussSeidel ) +#define hypre_BoomerAMGRelax3HybridGaussSeidel HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGRelax3HybridGaussSeidel ) +#define hypre_BoomerAMGRelax4HybridGaussSeidel HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGRelax4HybridGaussSeidel ) +#define hypre_BoomerAMGRelax5ChaoticHybridGaussSeidel HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGRelax5ChaoticHybridGaussSeidel ) +#define hypre_BoomerAMGRelax6HybridSSOR HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGRelax6HybridSSOR ) +#define hypre_BoomerAMGRelax7Jacobi HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGRelax7Jacobi ) +#define hypre_BoomerAMGRelax89HybridL1SSOR HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGRelax89HybridL1SSOR ) +#define hypre_BoomerAMGRelax8HybridL1SSOR HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGRelax8HybridL1SSOR ) +#define hypre_BoomerAMGRelaxComputeL1Norms HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGRelaxComputeL1Norms ) +#define hypre_BoomerAMGRelaxHybridGaussSeidel_core HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGRelaxHybridGaussSeidel_core ) +#define hypre_BoomerAMGRelaxHybridSOR HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGRelaxHybridSOR ) +#define hypre_BoomerAMGRelaxIF HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGRelaxIF ) +#define hypre_BoomerAMGRelaxKaczmarz HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGRelaxKaczmarz ) +#define hypre_BoomerAMGRelaxT HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGRelaxT ) +#define hypre_BoomerAMGRelaxTwoStageGaussSeidelHost HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGRelaxTwoStageGaussSeidelHost ) +#define hypre_BoomerAMGRelaxWeightedJacobi_core HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGRelaxWeightedJacobi_core ) +#define hypre_BoomerAMGRelax_FCFJacobi HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGRelax_FCFJacobi ) +#define hypre_BoomerAMGSetADropTol HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetADropTol ) +#define hypre_BoomerAMGSetADropType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetADropType ) +#define hypre_BoomerAMGSetAddLastLvl HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetAddLastLvl ) +#define hypre_BoomerAMGSetAddRelaxType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetAddRelaxType ) +#define hypre_BoomerAMGSetAddRelaxWt HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetAddRelaxWt ) +#define hypre_BoomerAMGSetAdditive HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetAdditive ) +#define hypre_BoomerAMGSetAggInterpType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetAggInterpType ) +#define hypre_BoomerAMGSetAggNumLevels HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetAggNumLevels ) +#define hypre_BoomerAMGSetAggP12MaxElmts HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetAggP12MaxElmts ) +#define hypre_BoomerAMGSetAggP12TruncFactor HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetAggP12TruncFactor ) +#define hypre_BoomerAMGSetAggPMaxElmts HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetAggPMaxElmts ) +#define hypre_BoomerAMGSetAggTruncFactor HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetAggTruncFactor ) +#define hypre_BoomerAMGSetCGCIts HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetCGCIts ) +#define hypre_BoomerAMGSetCPoints HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetCPoints ) +#define hypre_BoomerAMGSetCRRate HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetCRRate ) +#define hypre_BoomerAMGSetCRStrongTh HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetCRStrongTh ) +#define hypre_BoomerAMGSetCRUseCG HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetCRUseCG ) +#define hypre_BoomerAMGSetChebyEigEst HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetChebyEigEst ) +#define hypre_BoomerAMGSetChebyFraction HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetChebyFraction ) +#define hypre_BoomerAMGSetChebyOrder HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetChebyOrder ) +#define hypre_BoomerAMGSetChebyScale HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetChebyScale ) +#define hypre_BoomerAMGSetChebyVariant HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetChebyVariant ) +#define hypre_BoomerAMGSetCoarsenCutFactor HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetCoarsenCutFactor ) +#define hypre_BoomerAMGSetCoarsenType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetCoarsenType ) +#define hypre_BoomerAMGSetConvergeType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetConvergeType ) +#define hypre_BoomerAMGSetCoordDim HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetCoordDim ) +#define hypre_BoomerAMGSetCoordinates HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetCoordinates ) +#define hypre_BoomerAMGSetCumNnzAP HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetCumNnzAP ) +#define hypre_BoomerAMGSetCycleNumSweeps HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetCycleNumSweeps ) +#define hypre_BoomerAMGSetCycleRelaxType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetCycleRelaxType ) +#define hypre_BoomerAMGSetCycleType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetCycleType ) +#define hypre_BoomerAMGSetDebugFlag HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetDebugFlag ) +#define hypre_BoomerAMGSetDofFunc HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetDofFunc ) +#define hypre_BoomerAMGSetDofPoint HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetDofPoint ) +#define hypre_BoomerAMGSetDomainType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetDomainType ) +#define hypre_BoomerAMGSetDropTol HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetDropTol ) +#define hypre_BoomerAMGSetEuBJ HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetEuBJ ) +#define hypre_BoomerAMGSetEuLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetEuLevel ) +#define hypre_BoomerAMGSetEuSparseA HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetEuSparseA ) +#define hypre_BoomerAMGSetEuclidFile HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetEuclidFile ) +#define hypre_BoomerAMGSetFCycle HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetFCycle ) +#define hypre_BoomerAMGSetFPoints HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetFPoints ) +#define hypre_BoomerAMGSetFSAIAlgoType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetFSAIAlgoType ) +#define hypre_BoomerAMGSetFSAIEigMaxIters HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetFSAIEigMaxIters ) +#define hypre_BoomerAMGSetFSAIKapTolerance HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetFSAIKapTolerance ) +#define hypre_BoomerAMGSetFSAILocalSolveType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetFSAILocalSolveType ) +#define hypre_BoomerAMGSetFSAIMaxNnzRow HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetFSAIMaxNnzRow ) +#define hypre_BoomerAMGSetFSAIMaxStepSize HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetFSAIMaxStepSize ) +#define hypre_BoomerAMGSetFSAIMaxSteps HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetFSAIMaxSteps ) +#define hypre_BoomerAMGSetFSAINumLevels HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetFSAINumLevels ) +#define hypre_BoomerAMGSetFSAIThreshold HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetFSAIThreshold ) +#define hypre_BoomerAMGSetFilter HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetFilter ) +#define hypre_BoomerAMGSetFilterFunctions HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetFilterFunctions ) +#define hypre_BoomerAMGSetFilterThresholdR HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetFilterThresholdR ) +#define hypre_BoomerAMGSetGMRESSwitchR HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetGMRESSwitchR ) +#define hypre_BoomerAMGSetGSMG HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetGSMG ) +#define hypre_BoomerAMGSetGridRelaxPoints HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetGridRelaxPoints ) +#define hypre_BoomerAMGSetGridRelaxType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetGridRelaxType ) +#define hypre_BoomerAMGSetILUDroptol HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetILUDroptol ) +#define hypre_BoomerAMGSetILUIterSetupMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetILUIterSetupMaxIter ) +#define hypre_BoomerAMGSetILUIterSetupOption HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetILUIterSetupOption ) +#define hypre_BoomerAMGSetILUIterSetupTolerance HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetILUIterSetupTolerance ) +#define hypre_BoomerAMGSetILUIterSetupType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetILUIterSetupType ) +#define hypre_BoomerAMGSetILULevel HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetILULevel ) +#define hypre_BoomerAMGSetILULocalReordering HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetILULocalReordering ) +#define hypre_BoomerAMGSetILULowerJacobiIters HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetILULowerJacobiIters ) +#define hypre_BoomerAMGSetILUMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetILUMaxIter ) +#define hypre_BoomerAMGSetILUMaxRowNnz HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetILUMaxRowNnz ) +#define hypre_BoomerAMGSetILUTriSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetILUTriSolve ) +#define hypre_BoomerAMGSetILUType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetILUType ) +#define hypre_BoomerAMGSetILUUpperJacobiIters HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetILUUpperJacobiIters ) +#define hypre_BoomerAMGSetISType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetISType ) +#define hypre_BoomerAMGSetInterpRefine HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetInterpRefine ) +#define hypre_BoomerAMGSetInterpType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetInterpType ) +#define hypre_BoomerAMGSetInterpVecAbsQTrunc HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetInterpVecAbsQTrunc ) +#define hypre_BoomerAMGSetInterpVecFirstLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetInterpVecFirstLevel ) +#define hypre_BoomerAMGSetInterpVecQMax HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetInterpVecQMax ) +#define hypre_BoomerAMGSetInterpVecVariant HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetInterpVecVariant ) +#define hypre_BoomerAMGSetInterpVectors HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetInterpVectors ) +#define hypre_BoomerAMGSetIsTriangular HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetIsTriangular ) +#define hypre_BoomerAMGSetJacobiTruncThreshold HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetJacobiTruncThreshold ) +#define hypre_BoomerAMGSetKeepSameSign HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetKeepSameSign ) +#define hypre_BoomerAMGSetKeepTranspose HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetKeepTranspose ) +#define hypre_BoomerAMGSetLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetLevel ) +#define hypre_BoomerAMGSetLevelNonGalerkinTol HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetLevelNonGalerkinTol ) +#define hypre_BoomerAMGSetLevelOuterWt HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetLevelOuterWt ) +#define hypre_BoomerAMGSetLevelRelaxWt HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetLevelRelaxWt ) +#define hypre_BoomerAMGSetLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetLogging ) +#define hypre_BoomerAMGSetMaxCoarseSize HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetMaxCoarseSize ) +#define hypre_BoomerAMGSetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetMaxIter ) +#define hypre_BoomerAMGSetMaxLevels HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetMaxLevels ) +#define hypre_BoomerAMGSetMaxNzPerRow HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetMaxNzPerRow ) +#define hypre_BoomerAMGSetMaxRowSum HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetMaxRowSum ) +#define hypre_BoomerAMGSetMeasureType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetMeasureType ) +#define hypre_BoomerAMGSetMinCoarseSize HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetMinCoarseSize ) +#define hypre_BoomerAMGSetMinIter HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetMinIter ) +#define hypre_BoomerAMGSetModuleRAP2 HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetModuleRAP2 ) +#define hypre_BoomerAMGSetMultAddPMaxElmts HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetMultAddPMaxElmts ) +#define hypre_BoomerAMGSetMultAddTruncFactor HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetMultAddTruncFactor ) +#define hypre_BoomerAMGSetMultAdditive HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetMultAdditive ) +#define hypre_BoomerAMGSetNodal HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetNodal ) +#define hypre_BoomerAMGSetNodalDiag HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetNodalDiag ) +#define hypre_BoomerAMGSetNodalLevels HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetNodalLevels ) +#define hypre_BoomerAMGSetNonGalerkTol HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetNonGalerkTol ) +#define hypre_BoomerAMGSetNonGalerkinTol HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetNonGalerkinTol ) +#define hypre_BoomerAMGSetNumCRRelaxSteps HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetNumCRRelaxSteps ) +#define hypre_BoomerAMGSetNumFunctions HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetNumFunctions ) +#define hypre_BoomerAMGSetNumGridSweeps HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetNumGridSweeps ) +#define hypre_BoomerAMGSetNumIterations HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetNumIterations ) +#define hypre_BoomerAMGSetNumPaths HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetNumPaths ) +#define hypre_BoomerAMGSetNumPoints HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetNumPoints ) +#define hypre_BoomerAMGSetNumSamples HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetNumSamples ) +#define hypre_BoomerAMGSetNumSweeps HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetNumSweeps ) +#define hypre_BoomerAMGSetOmega HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetOmega ) +#define hypre_BoomerAMGSetOuterWt HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetOuterWt ) +#define hypre_BoomerAMGSetOverlap HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetOverlap ) +#define hypre_BoomerAMGSetPMaxElmts HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetPMaxElmts ) +#define hypre_BoomerAMGSetPlotFileName HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetPlotFileName ) +#define hypre_BoomerAMGSetPlotGrids HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetPlotGrids ) +#define hypre_BoomerAMGSetPointDofMap HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetPointDofMap ) +#define hypre_BoomerAMGSetPostInterpType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetPostInterpType ) +#define hypre_BoomerAMGSetPrintFileName HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetPrintFileName ) +#define hypre_BoomerAMGSetPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetPrintLevel ) +#define hypre_BoomerAMGSetRAP2 HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetRAP2 ) +#define hypre_BoomerAMGSetRedundant HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetRedundant ) +#define hypre_BoomerAMGSetRelaxOrder HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetRelaxOrder ) +#define hypre_BoomerAMGSetRelaxType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetRelaxType ) +#define hypre_BoomerAMGSetRelaxWeight HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetRelaxWeight ) +#define hypre_BoomerAMGSetRelaxWt HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetRelaxWt ) +#define hypre_BoomerAMGSetRestriction HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetRestriction ) +#define hypre_BoomerAMGSetSabs HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetSabs ) +#define hypre_BoomerAMGSetSchwarzRlxWeight HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetSchwarzRlxWeight ) +#define hypre_BoomerAMGSetSchwarzUseNonSymm HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetSchwarzUseNonSymm ) +#define hypre_BoomerAMGSetSepWeight HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetSepWeight ) +#define hypre_BoomerAMGSetSeqThreshold HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetSeqThreshold ) +#define hypre_BoomerAMGSetSetupType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetSetupType ) +#define hypre_BoomerAMGSetSimple HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetSimple ) +#define hypre_BoomerAMGSetSmoothInterpVectors HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetSmoothInterpVectors ) +#define hypre_BoomerAMGSetSmoothNumLevels HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetSmoothNumLevels ) +#define hypre_BoomerAMGSetSmoothNumSweeps HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetSmoothNumSweeps ) +#define hypre_BoomerAMGSetSmoothType HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetSmoothType ) +#define hypre_BoomerAMGSetStrongThreshold HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetStrongThreshold ) +#define hypre_BoomerAMGSetStrongThresholdR HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetStrongThresholdR ) +#define hypre_BoomerAMGSetSym HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetSym ) +#define hypre_BoomerAMGSetThreshold HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetThreshold ) +#define hypre_BoomerAMGSetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetTol ) +#define hypre_BoomerAMGSetTruncFactor HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetTruncFactor ) +#define hypre_BoomerAMGSetVariant HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetVariant ) +#define hypre_BoomerAMGSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetup ) +#define hypre_BoomerAMGSetupStats HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSetupStats ) +#define hypre_BoomerAMGSmoothInterpVectors HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSmoothInterpVectors ) +#define hypre_BoomerAMGSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSolve ) +#define hypre_BoomerAMGSolveT HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGSolveT ) +#define hypre_BoomerAMGTruncandBuild HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGTruncandBuild ) +#define hypre_BoomerAMGTruncateInterp HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGTruncateInterp ) +#define hypre_BoomerAMGWriteSolverParams HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMGWriteSolverParams ) +#define hypre_BoomerAMG_GMExpandInterp HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMG_GMExpandInterp ) +#define hypre_BoomerAMG_LNExpandInterp HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMG_LNExpandInterp ) +#define hypre_BoomerAMG_MyCreateS HYPRE_FIXEDPRECISION_FUNC ( hypre_BoomerAMG_MyCreateS ) +#define hypre_CSRMatrixDropInplace HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixDropInplace ) +#define hypre_CSRMatrixExtractDenseMat HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixExtractDenseMat ) +#define hypre_CSRMatrixExtractDenseRow HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixExtractDenseRow ) +#define hypre_CSRMatrixNormFro HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixNormFro ) +#define hypre_CSRMatrixResNormFro HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixResNormFro ) +#define hypre_CSRMatrixTrace HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixTrace ) +#define hypre_CreateC HYPRE_FIXEDPRECISION_FUNC ( hypre_CreateC ) +#define hypre_CreateDinv HYPRE_FIXEDPRECISION_FUNC ( hypre_CreateDinv ) +#define hypre_CreateLambda HYPRE_FIXEDPRECISION_FUNC ( hypre_CreateLambda ) +#define hypre_DenseSPDSystemSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_DenseSPDSystemSolve ) +#define hypre_ExtendWtoPHost HYPRE_FIXEDPRECISION_FUNC ( hypre_ExtendWtoPHost ) +#define hypre_FSAIApply HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAIApply ) +#define hypre_FSAIComputeOmega HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAIComputeOmega ) +#define hypre_FSAICreate HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAICreate ) +#define hypre_FSAIDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAIDestroy ) +#define hypre_FSAIDumpLocalLSDense HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAIDumpLocalLSDense ) +#define hypre_FSAIGetAlgoType HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAIGetAlgoType ) +#define hypre_FSAIGetEigMaxIters HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAIGetEigMaxIters ) +#define hypre_FSAIGetKapTolerance HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAIGetKapTolerance ) +#define hypre_FSAIGetLocalSolveType HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAIGetLocalSolveType ) +#define hypre_FSAIGetLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAIGetLogging ) +#define hypre_FSAIGetMaxIterations HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAIGetMaxIterations ) +#define hypre_FSAIGetMaxNnzRow HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAIGetMaxNnzRow ) +#define hypre_FSAIGetMaxStepSize HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAIGetMaxStepSize ) +#define hypre_FSAIGetMaxSteps HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAIGetMaxSteps ) +#define hypre_FSAIGetNumIterations HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAIGetNumIterations ) +#define hypre_FSAIGetNumLevels HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAIGetNumLevels ) +#define hypre_FSAIGetOmega HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAIGetOmega ) +#define hypre_FSAIGetPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAIGetPrintLevel ) +#define hypre_FSAIGetThreshold HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAIGetThreshold ) +#define hypre_FSAIGetTolerance HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAIGetTolerance ) +#define hypre_FSAIGetZeroGuess HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAIGetZeroGuess ) +#define hypre_FSAIPrintStats HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAIPrintStats ) +#define hypre_FSAISetAlgoType HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAISetAlgoType ) +#define hypre_FSAISetEigMaxIters HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAISetEigMaxIters ) +#define hypre_FSAISetKapTolerance HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAISetKapTolerance ) +#define hypre_FSAISetLocalSolveType HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAISetLocalSolveType ) +#define hypre_FSAISetLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAISetLogging ) +#define hypre_FSAISetMaxIterations HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAISetMaxIterations ) +#define hypre_FSAISetMaxNnzRow HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAISetMaxNnzRow ) +#define hypre_FSAISetMaxStepSize HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAISetMaxStepSize ) +#define hypre_FSAISetMaxSteps HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAISetMaxSteps ) +#define hypre_FSAISetNumIterations HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAISetNumIterations ) +#define hypre_FSAISetNumLevels HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAISetNumLevels ) +#define hypre_FSAISetOmega HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAISetOmega ) +#define hypre_FSAISetPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAISetPrintLevel ) +#define hypre_FSAISetThreshold HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAISetThreshold ) +#define hypre_FSAISetTolerance HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAISetTolerance ) +#define hypre_FSAISetZeroGuess HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAISetZeroGuess ) +#define hypre_FSAISetup HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAISetup ) +#define hypre_FSAISetupNative HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAISetupNative ) +#define hypre_FSAISetupOMPDyn HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAISetupOMPDyn ) +#define hypre_FSAISolve HYPRE_FIXEDPRECISION_FUNC ( hypre_FSAISolve ) +#define hypre_FindKapGrad HYPRE_FIXEDPRECISION_FUNC ( hypre_FindKapGrad ) +#define hypre_GaussElimSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_GaussElimSetup ) +#define hypre_GaussElimSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_GaussElimSolve ) +#define hypre_GenerateCoordinates HYPRE_FIXEDPRECISION_FUNC ( hypre_GenerateCoordinates ) +#define hypre_GenerateMultiPi HYPRE_FIXEDPRECISION_FUNC ( hypre_GenerateMultiPi ) +#define hypre_GenerateMultipassPi HYPRE_FIXEDPRECISION_FUNC ( hypre_GenerateMultipassPi ) +#define hypre_GenerateScale HYPRE_FIXEDPRECISION_FUNC ( hypre_GenerateScale ) +#define hypre_GenerateSendMapAndCommPkg HYPRE_FIXEDPRECISION_FUNC ( hypre_GenerateSendMapAndCommPkg ) +#define hypre_GenerateSubComm HYPRE_FIXEDPRECISION_FUNC ( hypre_GenerateSubComm ) +#define hypre_GetCommPkgRTFromCommPkgA HYPRE_FIXEDPRECISION_FUNC ( hypre_GetCommPkgRTFromCommPkgA ) +#define hypre_GrabSubArray HYPRE_FIXEDPRECISION_FUNC ( hypre_GrabSubArray ) +#define hypre_GraphAdd HYPRE_FIXEDPRECISION_FUNC ( hypre_GraphAdd ) +#define hypre_GraphRemove HYPRE_FIXEDPRECISION_FUNC ( hypre_GraphRemove ) +#define hypre_ILUBuildRASExternalMatrix HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUBuildRASExternalMatrix ) +#define hypre_ILUCSRMatrixInverseSelfPrecondMRGlobal HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUCSRMatrixInverseSelfPrecondMRGlobal ) +#define hypre_ILUCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUCreate ) +#define hypre_ILUDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUDestroy ) +#define hypre_ILUGetFinalRelativeResidualNorm HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUGetFinalRelativeResidualNorm ) +#define hypre_ILUGetInteriorExteriorPerm HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUGetInteriorExteriorPerm ) +#define hypre_ILUGetIterativeSetupHistory HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUGetIterativeSetupHistory ) +#define hypre_ILUGetLocalPerm HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUGetLocalPerm ) +#define hypre_ILUGetNumIterations HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUGetNumIterations ) +#define hypre_ILUGetPermddPQ HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUGetPermddPQ ) +#define hypre_ILUGetPermddPQPre HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUGetPermddPQPre ) +#define hypre_ILULocalRCM HYPRE_FIXEDPRECISION_FUNC ( hypre_ILULocalRCM ) +#define hypre_ILULocalRCMBuildFinalPerm HYPRE_FIXEDPRECISION_FUNC ( hypre_ILULocalRCMBuildFinalPerm ) +#define hypre_ILULocalRCMBuildLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_ILULocalRCMBuildLevel ) +#define hypre_ILULocalRCMFindPPNode HYPRE_FIXEDPRECISION_FUNC ( hypre_ILULocalRCMFindPPNode ) +#define hypre_ILULocalRCMMindegree HYPRE_FIXEDPRECISION_FUNC ( hypre_ILULocalRCMMindegree ) +#define hypre_ILULocalRCMNumbering HYPRE_FIXEDPRECISION_FUNC ( hypre_ILULocalRCMNumbering ) +#define hypre_ILULocalRCMOrder HYPRE_FIXEDPRECISION_FUNC ( hypre_ILULocalRCMOrder ) +#define hypre_ILULocalRCMQsort HYPRE_FIXEDPRECISION_FUNC ( hypre_ILULocalRCMQsort ) +#define hypre_ILULocalRCMReverse HYPRE_FIXEDPRECISION_FUNC ( hypre_ILULocalRCMReverse ) +#define hypre_ILUMaxQSplitRabsI HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUMaxQSplitRabsI ) +#define hypre_ILUMaxRabs HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUMaxRabs ) +#define hypre_ILUMaxrHeapAddRabsI HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUMaxrHeapAddRabsI ) +#define hypre_ILUMaxrHeapRemoveRabsI HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUMaxrHeapRemoveRabsI ) +#define hypre_ILUMinHeapAddI HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUMinHeapAddI ) +#define hypre_ILUMinHeapAddIIIi HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUMinHeapAddIIIi ) +#define hypre_ILUMinHeapAddIRIi HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUMinHeapAddIRIi ) +#define hypre_ILUMinHeapRemoveI HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUMinHeapRemoveI ) +#define hypre_ILUMinHeapRemoveIIIi HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUMinHeapRemoveIIIi ) +#define hypre_ILUMinHeapRemoveIRIi HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUMinHeapRemoveIRIi ) +#define hypre_ILUParCSRInverseNSH HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUParCSRInverseNSH ) +#define hypre_ILUSetDropThreshold HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetDropThreshold ) +#define hypre_ILUSetDropThresholdArray HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetDropThresholdArray ) +#define hypre_ILUSetIterativeSetupMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetIterativeSetupMaxIter ) +#define hypre_ILUSetIterativeSetupOption HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetIterativeSetupOption ) +#define hypre_ILUSetIterativeSetupTolerance HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetIterativeSetupTolerance ) +#define hypre_ILUSetIterativeSetupType HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetIterativeSetupType ) +#define hypre_ILUSetLevelOfFill HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetLevelOfFill ) +#define hypre_ILUSetLocalReordering HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetLocalReordering ) +#define hypre_ILUSetLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetLogging ) +#define hypre_ILUSetLowerJacobiIters HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetLowerJacobiIters ) +#define hypre_ILUSetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetMaxIter ) +#define hypre_ILUSetMaxNnzPerRow HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetMaxNnzPerRow ) +#define hypre_ILUSetPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetPrintLevel ) +#define hypre_ILUSetSchurNSHDropThreshold HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetSchurNSHDropThreshold ) +#define hypre_ILUSetSchurNSHDropThresholdArray HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetSchurNSHDropThresholdArray ) +#define hypre_ILUSetSchurPrecondILUDropThreshold HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetSchurPrecondILUDropThreshold ) +#define hypre_ILUSetSchurPrecondILUDropThresholdArray HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetSchurPrecondILUDropThresholdArray ) +#define hypre_ILUSetSchurPrecondILULevelOfFill HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetSchurPrecondILULevelOfFill ) +#define hypre_ILUSetSchurPrecondILUMaxNnzPerRow HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetSchurPrecondILUMaxNnzPerRow ) +#define hypre_ILUSetSchurPrecondILUType HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetSchurPrecondILUType ) +#define hypre_ILUSetSchurPrecondLowerJacobiIters HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetSchurPrecondLowerJacobiIters ) +#define hypre_ILUSetSchurPrecondMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetSchurPrecondMaxIter ) +#define hypre_ILUSetSchurPrecondPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetSchurPrecondPrintLevel ) +#define hypre_ILUSetSchurPrecondTol HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetSchurPrecondTol ) +#define hypre_ILUSetSchurPrecondTriSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetSchurPrecondTriSolve ) +#define hypre_ILUSetSchurPrecondUpperJacobiIters HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetSchurPrecondUpperJacobiIters ) +#define hypre_ILUSetSchurSolverAbsoluteTol HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetSchurSolverAbsoluteTol ) +#define hypre_ILUSetSchurSolverKDIM HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetSchurSolverKDIM ) +#define hypre_ILUSetSchurSolverLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetSchurSolverLogging ) +#define hypre_ILUSetSchurSolverMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetSchurSolverMaxIter ) +#define hypre_ILUSetSchurSolverPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetSchurSolverPrintLevel ) +#define hypre_ILUSetSchurSolverRelChange HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetSchurSolverRelChange ) +#define hypre_ILUSetSchurSolverTol HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetSchurSolverTol ) +#define hypre_ILUSetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetTol ) +#define hypre_ILUSetTriSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetTriSolve ) +#define hypre_ILUSetType HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetType ) +#define hypre_ILUSetUpperJacobiIters HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetUpperJacobiIters ) +#define hypre_ILUSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetup ) +#define hypre_ILUSetupILU0 HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetupILU0 ) +#define hypre_ILUSetupILU0RAS HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetupILU0RAS ) +#define hypre_ILUSetupILUK HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetupILUK ) +#define hypre_ILUSetupILUKRAS HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetupILUKRAS ) +#define hypre_ILUSetupILUKRASSymbolic HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetupILUKRASSymbolic ) +#define hypre_ILUSetupILUKSymbolic HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetupILUKSymbolic ) +#define hypre_ILUSetupILUT HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetupILUT ) +#define hypre_ILUSetupILUTRAS HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetupILUTRAS ) +#define hypre_ILUSetupLDUtoCusparse HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetupLDUtoCusparse ) +#define hypre_ILUSetupMILU0 HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetupMILU0 ) +#define hypre_ILUSetupRAPILU0 HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetupRAPILU0 ) +#define hypre_ILUSetupRAPILU0Device HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetupRAPILU0Device ) +#define hypre_ILUSetupRAPMILU0 HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSetupRAPMILU0 ) +#define hypre_ILUSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSolve ) +#define hypre_ILUSolveLU HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSolveLU ) +#define hypre_ILUSolveLUIter HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSolveLUIter ) +#define hypre_ILUSolveLURAS HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSolveLURAS ) +#define hypre_ILUSolveRAPGMRESHost HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSolveRAPGMRESHost ) +#define hypre_ILUSolveSchurGMRES HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSolveSchurGMRES ) +#define hypre_ILUSolveSchurNSH HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSolveSchurNSH ) +#define hypre_ILUSortOffdColmap HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUSortOffdColmap ) +#define hypre_ILUWriteSolverParams HYPRE_FIXEDPRECISION_FUNC ( hypre_ILUWriteSolverParams ) +#define hypre_IndepSetGreedy HYPRE_FIXEDPRECISION_FUNC ( hypre_IndepSetGreedy ) +#define hypre_IndepSetGreedyS HYPRE_FIXEDPRECISION_FUNC ( hypre_IndepSetGreedyS ) +#define hypre_IntersectTwoArrays HYPRE_FIXEDPRECISION_FUNC ( hypre_IntersectTwoArrays ) +#define hypre_IntersectTwoBigArrays HYPRE_FIXEDPRECISION_FUNC ( hypre_IntersectTwoBigArrays ) +#define hypre_LINPACKcgpthy HYPRE_FIXEDPRECISION_FUNC ( hypre_LINPACKcgpthy ) +#define hypre_LINPACKcgtql1 HYPRE_FIXEDPRECISION_FUNC ( hypre_LINPACKcgtql1 ) +#define hypre_MGRAddVectorP HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRAddVectorP ) +#define hypre_MGRAddVectorR HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRAddVectorR ) +#define hypre_MGRApproximateInverse HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRApproximateInverse ) +#define hypre_MGRBlockColLumpedRestrict HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRBlockColLumpedRestrict ) +#define hypre_MGRBlockRelaxSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRBlockRelaxSetup ) +#define hypre_MGRBlockRelaxSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRBlockRelaxSolve ) +#define hypre_MGRBlockRelaxSolveDevice HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRBlockRelaxSolveDevice ) +#define hypre_MGRBuildAff HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRBuildAff ) +#define hypre_MGRBuildBlockJacobiP HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRBuildBlockJacobiP ) +#define hypre_MGRBuildBlockJacobiWp HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRBuildBlockJacobiWp ) +#define hypre_MGRBuildCoarseOperator HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRBuildCoarseOperator ) +#define hypre_MGRBuildInterp HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRBuildInterp ) +#define hypre_MGRBuildInterpApproximateInverse HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRBuildInterpApproximateInverse ) +#define hypre_MGRBuildNonGalerkinCoarseOperator HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRBuildNonGalerkinCoarseOperator ) +#define hypre_MGRBuildNonGalerkinCoarseOperatorDevice HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRBuildNonGalerkinCoarseOperatorDevice ) +#define hypre_MGRBuildNonGalerkinCoarseOperatorHost HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRBuildNonGalerkinCoarseOperatorHost ) +#define hypre_MGRBuildP HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRBuildP ) +#define hypre_MGRBuildPDRS HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRBuildPDRS ) +#define hypre_MGRBuildPFromWp HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRBuildPFromWp ) +#define hypre_MGRBuildPFromWpHost HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRBuildPFromWpHost ) +#define hypre_MGRBuildPHost HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRBuildPHost ) +#define hypre_MGRBuildRFromWr HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRBuildRFromWr ) +#define hypre_MGRBuildRFromWrHost HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRBuildRFromWrHost ) +#define hypre_MGRBuildRestrict HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRBuildRestrict ) +#define hypre_MGRCoarseParms HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRCoarseParms ) +#define hypre_MGRCoarsen HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRCoarsen ) +#define hypre_MGRColLumpedRestrict HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRColLumpedRestrict ) +#define hypre_MGRCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRCreate ) +#define hypre_MGRCreateFrelaxVcycleData HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRCreateFrelaxVcycleData ) +#define hypre_MGRCreateGSElimData HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRCreateGSElimData ) +#define hypre_MGRCycle HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRCycle ) +#define hypre_MGRDataPrint HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRDataPrint ) +#define hypre_MGRDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRDestroy ) +#define hypre_MGRDestroyFrelaxVcycleData HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRDestroyFrelaxVcycleData ) +#define hypre_MGRDestroyGSElimData HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRDestroyGSElimData ) +#define hypre_MGRFrelaxVcycle HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRFrelaxVcycle ) +#define hypre_MGRGetCoarseGridConvergenceFactor HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRGetCoarseGridConvergenceFactor ) +#define hypre_MGRGetCoarseGridName HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRGetCoarseGridName ) +#define hypre_MGRGetFRelaxName HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRGetFRelaxName ) +#define hypre_MGRGetFinalRelativeResidualNorm HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRGetFinalRelativeResidualNorm ) +#define hypre_MGRGetGlobalRelaxName HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRGetGlobalRelaxName ) +#define hypre_MGRGetNumIterations HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRGetNumIterations ) +#define hypre_MGRGetProlongationName HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRGetProlongationName ) +#define hypre_MGRGetRestrictionName HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRGetRestrictionName ) +#define hypre_MGRGetSubBlock HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRGetSubBlock ) +#define hypre_MGRNonGalerkinTruncate HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRNonGalerkinTruncate ) +#define hypre_MGRPrintCoarseSystem HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRPrintCoarseSystem ) +#define hypre_MGRSetBlockJacobiBlockSize HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetBlockJacobiBlockSize ) +#define hypre_MGRSetBlockSize HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetBlockSize ) +#define hypre_MGRSetCoarseGridMethod HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetCoarseGridMethod ) +#define hypre_MGRSetCoarseGridPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetCoarseGridPrintLevel ) +#define hypre_MGRSetCoarseSolver HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetCoarseSolver ) +#define hypre_MGRSetCpointsByBlock HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetCpointsByBlock ) +#define hypre_MGRSetCpointsByContiguousBlock HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetCpointsByContiguousBlock ) +#define hypre_MGRSetCpointsByPointMarkerArray HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetCpointsByPointMarkerArray ) +#define hypre_MGRSetFRelaxMethod HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetFRelaxMethod ) +#define hypre_MGRSetFSolver HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetFSolver ) +#define hypre_MGRSetFSolverAtLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetFSolverAtLevel ) +#define hypre_MGRSetFrelaxPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetFrelaxPrintLevel ) +#define hypre_MGRSetGlobalSmoothCycle HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetGlobalSmoothCycle ) +#define hypre_MGRSetGlobalSmoothType HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetGlobalSmoothType ) +#define hypre_MGRSetGlobalSmootherAtLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetGlobalSmootherAtLevel ) +#define hypre_MGRSetInterpType HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetInterpType ) +#define hypre_MGRSetLevelFRelaxMethod HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetLevelFRelaxMethod ) +#define hypre_MGRSetLevelFRelaxNumFunctions HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetLevelFRelaxNumFunctions ) +#define hypre_MGRSetLevelFRelaxType HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetLevelFRelaxType ) +#define hypre_MGRSetLevelInterpType HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetLevelInterpType ) +#define hypre_MGRSetLevelNonGalerkinMaxElmts HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetLevelNonGalerkinMaxElmts ) +#define hypre_MGRSetLevelNumRelaxSweeps HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetLevelNumRelaxSweeps ) +#define hypre_MGRSetLevelPMaxElmts HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetLevelPMaxElmts ) +#define hypre_MGRSetLevelRestrictType HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetLevelRestrictType ) +#define hypre_MGRSetLevelSmoothIters HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetLevelSmoothIters ) +#define hypre_MGRSetLevelSmoothType HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetLevelSmoothType ) +#define hypre_MGRSetLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetLogging ) +#define hypre_MGRSetMaxCoarseLevels HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetMaxCoarseLevels ) +#define hypre_MGRSetMaxGlobalSmoothIters HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetMaxGlobalSmoothIters ) +#define hypre_MGRSetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetMaxIter ) +#define hypre_MGRSetNonCpointsToFpoints HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetNonCpointsToFpoints ) +#define hypre_MGRSetNonGalerkinMaxElmts HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetNonGalerkinMaxElmts ) +#define hypre_MGRSetNumInterpSweeps HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetNumInterpSweeps ) +#define hypre_MGRSetNumRelaxSweeps HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetNumRelaxSweeps ) +#define hypre_MGRSetNumRestrictSweeps HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetNumRestrictSweeps ) +#define hypre_MGRSetPMaxElmts HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetPMaxElmts ) +#define hypre_MGRSetPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetPrintLevel ) +#define hypre_MGRSetReductionLevelCpoints HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetReductionLevelCpoints ) +#define hypre_MGRSetRelaxType HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetRelaxType ) +#define hypre_MGRSetReservedCoarseNodes HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetReservedCoarseNodes ) +#define hypre_MGRSetReservedCpointsLevelToKeep HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetReservedCpointsLevelToKeep ) +#define hypre_MGRSetRestrictType HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetRestrictType ) +#define hypre_MGRSetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetTol ) +#define hypre_MGRSetTruncateCoarseGridThreshold HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetTruncateCoarseGridThreshold ) +#define hypre_MGRSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetup ) +#define hypre_MGRSetupFrelaxVcycleData HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetupFrelaxVcycleData ) +#define hypre_MGRSetupStats HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSetupStats ) +#define hypre_MGRSmallBlkInverse HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSmallBlkInverse ) +#define hypre_MGRSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRSolve ) +#define hypre_MGRTruncateAcfCPR HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRTruncateAcfCPR ) +#define hypre_MGRTruncateAcfCPRDevice HYPRE_FIXEDPRECISION_FUNC ( hypre_MGRTruncateAcfCPRDevice ) +#define hypre_MPSchwarzCFFWSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_MPSchwarzCFFWSolve ) +#define hypre_MPSchwarzCFSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_MPSchwarzCFSolve ) +#define hypre_MPSchwarzFWSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_MPSchwarzFWSolve ) +#define hypre_MPSchwarzSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_MPSchwarzSolve ) +#define hypre_NSHCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_NSHCreate ) +#define hypre_NSHDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_NSHDestroy ) +#define hypre_NSHSetColVersion HYPRE_FIXEDPRECISION_FUNC ( hypre_NSHSetColVersion ) +#define hypre_NSHSetDropThreshold HYPRE_FIXEDPRECISION_FUNC ( hypre_NSHSetDropThreshold ) +#define hypre_NSHSetDropThresholdArray HYPRE_FIXEDPRECISION_FUNC ( hypre_NSHSetDropThresholdArray ) +#define hypre_NSHSetGlobalSolver HYPRE_FIXEDPRECISION_FUNC ( hypre_NSHSetGlobalSolver ) +#define hypre_NSHSetLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_NSHSetLogging ) +#define hypre_NSHSetMRMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_NSHSetMRMaxIter ) +#define hypre_NSHSetMRMaxRowNnz HYPRE_FIXEDPRECISION_FUNC ( hypre_NSHSetMRMaxRowNnz ) +#define hypre_NSHSetMRTol HYPRE_FIXEDPRECISION_FUNC ( hypre_NSHSetMRTol ) +#define hypre_NSHSetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_NSHSetMaxIter ) +#define hypre_NSHSetNSHMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_NSHSetNSHMaxIter ) +#define hypre_NSHSetNSHMaxRowNnz HYPRE_FIXEDPRECISION_FUNC ( hypre_NSHSetNSHMaxRowNnz ) +#define hypre_NSHSetNSHTol HYPRE_FIXEDPRECISION_FUNC ( hypre_NSHSetNSHTol ) +#define hypre_NSHSetPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_NSHSetPrintLevel ) +#define hypre_NSHSetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_NSHSetTol ) +#define hypre_NSHSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_NSHSetup ) +#define hypre_NSHSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_NSHSolve ) +#define hypre_NSHSolveInverse HYPRE_FIXEDPRECISION_FUNC ( hypre_NSHSolveInverse ) +#define hypre_NSHWriteSolverParams HYPRE_FIXEDPRECISION_FUNC ( hypre_NSHWriteSolverParams ) +#define hypre_NonGalerkinIJBigBufferInit HYPRE_FIXEDPRECISION_FUNC ( hypre_NonGalerkinIJBigBufferInit ) +#define hypre_NonGalerkinIJBufferCompress HYPRE_FIXEDPRECISION_FUNC ( hypre_NonGalerkinIJBufferCompress ) +#define hypre_NonGalerkinIJBufferCompressRow HYPRE_FIXEDPRECISION_FUNC ( hypre_NonGalerkinIJBufferCompressRow ) +#define hypre_NonGalerkinIJBufferEmpty HYPRE_FIXEDPRECISION_FUNC ( hypre_NonGalerkinIJBufferEmpty ) +#define hypre_NonGalerkinIJBufferInit HYPRE_FIXEDPRECISION_FUNC ( hypre_NonGalerkinIJBufferInit ) +#define hypre_NonGalerkinIJBufferNewRow HYPRE_FIXEDPRECISION_FUNC ( hypre_NonGalerkinIJBufferNewRow ) +#define hypre_NonGalerkinIJBufferWrite HYPRE_FIXEDPRECISION_FUNC ( hypre_NonGalerkinIJBufferWrite ) +#define hypre_NonGalerkinSparsityPattern HYPRE_FIXEDPRECISION_FUNC ( hypre_NonGalerkinSparsityPattern ) +#define hypre_ParAMGCreateDomainDof HYPRE_FIXEDPRECISION_FUNC ( hypre_ParAMGCreateDomainDof ) +#define hypre_ParAdSchwarzSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_ParAdSchwarzSolve ) +#define hypre_ParCSRComputeL1Norms HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRComputeL1Norms ) +#define hypre_ParCSRComputeL1NormsThreads HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRComputeL1NormsThreads ) +#define hypre_ParCSRMatrixBlockDiagMatrix HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixBlockDiagMatrix ) +#define hypre_ParCSRMatrixBlockDiagMatrixHost HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixBlockDiagMatrixHost ) +#define hypre_ParCSRMatrixChooseThresh HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixChooseThresh ) +#define hypre_ParCSRMatrixExtractBlockDiagHost HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixExtractBlockDiagHost ) +#define hypre_ParCSRMatrixFillSmooth HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixFillSmooth ) +#define hypre_ParCSRMatrixFixZeroRows HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixFixZeroRows ) +#define hypre_ParCSRMatrixFixZeroRowsHost HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixFixZeroRowsHost ) +#define hypre_ParCSRMatrixNormFro HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixNormFro ) +#define hypre_ParCSRMatrixResNormFro HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixResNormFro ) +#define hypre_ParCSRMatrixScaledNorm HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixScaledNorm ) +#define hypre_ParCSRMatrixSetDiagRows HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixSetDiagRows ) +#define hypre_ParCSRMatrixThreshold HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixThreshold ) +#define hypre_ParCSRMatrix_dof_func_offd HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrix_dof_func_offd ) +#define hypre_ParCSRMaxEigEstimate HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMaxEigEstimate ) +#define hypre_ParCSRMaxEigEstimateCG HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMaxEigEstimateCG ) +#define hypre_ParCSRMaxEigEstimateCGHost HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMaxEigEstimateCGHost ) +#define hypre_ParCSRMaxEigEstimateHost HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMaxEigEstimateHost ) +#define hypre_ParCSRRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRRelax ) +#define hypre_ParCSRRelax_CG HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRRelax_CG ) +#define hypre_ParCSRRelax_Cheby HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRRelax_Cheby ) +#define hypre_ParCSRRelax_Cheby_Setup HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRRelax_Cheby_Setup ) +#define hypre_ParCSRRelax_Cheby_Solve HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRRelax_Cheby_Solve ) +#define hypre_ParCSRRelax_Cheby_SolveHost HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRRelax_Cheby_SolveHost ) +#define hypre_ParCSRRelax_L1_Jacobi HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRRelax_L1_Jacobi ) +#define hypre_ParCSRSubspacePrec HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRSubspacePrec ) +#define hypre_ParGenerateHybridScale HYPRE_FIXEDPRECISION_FUNC ( hypre_ParGenerateHybridScale ) +#define hypre_ParGenerateScale HYPRE_FIXEDPRECISION_FUNC ( hypre_ParGenerateScale ) +#define hypre_ParILUExtractEBFC HYPRE_FIXEDPRECISION_FUNC ( hypre_ParILUExtractEBFC ) +#define hypre_ParILURAPReorder HYPRE_FIXEDPRECISION_FUNC ( hypre_ParILURAPReorder ) +#define hypre_ParILURAPSchurGMRESCommInfoHost HYPRE_FIXEDPRECISION_FUNC ( hypre_ParILURAPSchurGMRESCommInfoHost ) +#define hypre_ParILURAPSchurGMRESMatvecHost HYPRE_FIXEDPRECISION_FUNC ( hypre_ParILURAPSchurGMRESMatvecHost ) +#define hypre_ParILURAPSchurGMRESSolveHost HYPRE_FIXEDPRECISION_FUNC ( hypre_ParILURAPSchurGMRESSolveHost ) +#define hypre_ParKrylovAxpy HYPRE_FIXEDPRECISION_FUNC ( hypre_ParKrylovAxpy ) +#define hypre_ParKrylovCAlloc HYPRE_FIXEDPRECISION_FUNC ( hypre_ParKrylovCAlloc ) +#define hypre_ParKrylovClearVector HYPRE_FIXEDPRECISION_FUNC ( hypre_ParKrylovClearVector ) +#define hypre_ParKrylovCommInfo HYPRE_FIXEDPRECISION_FUNC ( hypre_ParKrylovCommInfo ) +#define hypre_ParKrylovCopyVector HYPRE_FIXEDPRECISION_FUNC ( hypre_ParKrylovCopyVector ) +#define hypre_ParKrylovCreateVector HYPRE_FIXEDPRECISION_FUNC ( hypre_ParKrylovCreateVector ) +#define hypre_ParKrylovCreateVectorArray HYPRE_FIXEDPRECISION_FUNC ( hypre_ParKrylovCreateVectorArray ) +#define hypre_ParKrylovDestroyVector HYPRE_FIXEDPRECISION_FUNC ( hypre_ParKrylovDestroyVector ) +#define hypre_ParKrylovFree HYPRE_FIXEDPRECISION_FUNC ( hypre_ParKrylovFree ) +#define hypre_ParKrylovIdentity HYPRE_FIXEDPRECISION_FUNC ( hypre_ParKrylovIdentity ) +#define hypre_ParKrylovIdentitySetup HYPRE_FIXEDPRECISION_FUNC ( hypre_ParKrylovIdentitySetup ) +#define hypre_ParKrylovInnerProd HYPRE_FIXEDPRECISION_FUNC ( hypre_ParKrylovInnerProd ) +#define hypre_ParKrylovInnerProdTagged HYPRE_FIXEDPRECISION_FUNC ( hypre_ParKrylovInnerProdTagged ) +#define hypre_ParKrylovMassAxpy HYPRE_FIXEDPRECISION_FUNC ( hypre_ParKrylovMassAxpy ) +#define hypre_ParKrylovMassDotpTwo HYPRE_FIXEDPRECISION_FUNC ( hypre_ParKrylovMassDotpTwo ) +#define hypre_ParKrylovMassInnerProd HYPRE_FIXEDPRECISION_FUNC ( hypre_ParKrylovMassInnerProd ) +#define hypre_ParKrylovMatvec HYPRE_FIXEDPRECISION_FUNC ( hypre_ParKrylovMatvec ) +#define hypre_ParKrylovMatvecCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_ParKrylovMatvecCreate ) +#define hypre_ParKrylovMatvecDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_ParKrylovMatvecDestroy ) +#define hypre_ParKrylovMatvecT HYPRE_FIXEDPRECISION_FUNC ( hypre_ParKrylovMatvecT ) +#define hypre_ParKrylovScaleVector HYPRE_FIXEDPRECISION_FUNC ( hypre_ParKrylovScaleVector ) +#define hypre_ParMPSchwarzSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_ParMPSchwarzSolve ) +#define hypre_ParPrintVector HYPRE_FIXEDPRECISION_FUNC ( hypre_ParPrintVector ) +#define hypre_ParReadVector HYPRE_FIXEDPRECISION_FUNC ( hypre_ParReadVector ) +#define hypre_ParSetRandomValues HYPRE_FIXEDPRECISION_FUNC ( hypre_ParSetRandomValues ) +#define hypre_ParVectorBlockGather HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorBlockGather ) +#define hypre_ParVectorBlockSplit HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorBlockSplit ) +#define hypre_ParVectorInDomainOf HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorInDomainOf ) +#define hypre_ParVectorInRangeOf HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorInRangeOf ) +#define hypre_ParVectorSize HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorSize ) +#define hypre_PartialSelectSortCI HYPRE_FIXEDPRECISION_FUNC ( hypre_PartialSelectSortCI ) +#define hypre_SchwarzCFSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_SchwarzCFSolve ) +#define hypre_SchwarzCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_SchwarzCreate ) +#define hypre_SchwarzDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_SchwarzDestroy ) +#define hypre_SchwarzReScale HYPRE_FIXEDPRECISION_FUNC ( hypre_SchwarzReScale ) +#define hypre_SchwarzSetDofFunc HYPRE_FIXEDPRECISION_FUNC ( hypre_SchwarzSetDofFunc ) +#define hypre_SchwarzSetDomainStructure HYPRE_FIXEDPRECISION_FUNC ( hypre_SchwarzSetDomainStructure ) +#define hypre_SchwarzSetDomainType HYPRE_FIXEDPRECISION_FUNC ( hypre_SchwarzSetDomainType ) +#define hypre_SchwarzSetNonSymm HYPRE_FIXEDPRECISION_FUNC ( hypre_SchwarzSetNonSymm ) +#define hypre_SchwarzSetNumFunctions HYPRE_FIXEDPRECISION_FUNC ( hypre_SchwarzSetNumFunctions ) +#define hypre_SchwarzSetOverlap HYPRE_FIXEDPRECISION_FUNC ( hypre_SchwarzSetOverlap ) +#define hypre_SchwarzSetRelaxWeight HYPRE_FIXEDPRECISION_FUNC ( hypre_SchwarzSetRelaxWeight ) +#define hypre_SchwarzSetScale HYPRE_FIXEDPRECISION_FUNC ( hypre_SchwarzSetScale ) +#define hypre_SchwarzSetVariant HYPRE_FIXEDPRECISION_FUNC ( hypre_SchwarzSetVariant ) +#define hypre_SchwarzSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_SchwarzSetup ) +#define hypre_SchwarzSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_SchwarzSolve ) +#define hypre_SortedCopyParCSRData HYPRE_FIXEDPRECISION_FUNC ( hypre_SortedCopyParCSRData ) +#define hypre_alt_insert_new_nodes HYPRE_FIXEDPRECISION_FUNC ( hypre_alt_insert_new_nodes ) +#define hypre_amsconstructdiscretegradient HYPRE_FIXEDPRECISION_FUNC ( hypre_amsconstructdiscretegradient ) +#define hypre_amscreate HYPRE_FIXEDPRECISION_FUNC ( hypre_amscreate ) +#define hypre_amsdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_amsdestroy ) +#define hypre_amsgetfinalrelativeresidualnorm HYPRE_FIXEDPRECISION_FUNC ( hypre_amsgetfinalrelativeresidualnorm ) +#define hypre_amsgetnumiterations HYPRE_FIXEDPRECISION_FUNC ( hypre_amsgetnumiterations ) +#define hypre_amssetalphaamgoptions HYPRE_FIXEDPRECISION_FUNC ( hypre_amssetalphaamgoptions ) +#define hypre_amssetalphapoissonmatrix HYPRE_FIXEDPRECISION_FUNC ( hypre_amssetalphapoissonmatrix ) +#define hypre_amssetbetaamgoptions HYPRE_FIXEDPRECISION_FUNC ( hypre_amssetbetaamgoptions ) +#define hypre_amssetbetapoissonmatrix HYPRE_FIXEDPRECISION_FUNC ( hypre_amssetbetapoissonmatrix ) +#define hypre_amssetcoordinatevectors HYPRE_FIXEDPRECISION_FUNC ( hypre_amssetcoordinatevectors ) +#define hypre_amssetcycletype HYPRE_FIXEDPRECISION_FUNC ( hypre_amssetcycletype ) +#define hypre_amssetdimension HYPRE_FIXEDPRECISION_FUNC ( hypre_amssetdimension ) +#define hypre_amssetdiscretegradient HYPRE_FIXEDPRECISION_FUNC ( hypre_amssetdiscretegradient ) +#define hypre_amssetedgeconstantvectors HYPRE_FIXEDPRECISION_FUNC ( hypre_amssetedgeconstantvectors ) +#define hypre_amssetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_amssetmaxiter ) +#define hypre_amssetprintlevel HYPRE_FIXEDPRECISION_FUNC ( hypre_amssetprintlevel ) +#define hypre_amssetsmoothingoptions HYPRE_FIXEDPRECISION_FUNC ( hypre_amssetsmoothingoptions ) +#define hypre_amssettol HYPRE_FIXEDPRECISION_FUNC ( hypre_amssettol ) +#define hypre_amssetup HYPRE_FIXEDPRECISION_FUNC ( hypre_amssetup ) +#define hypre_amssolve HYPRE_FIXEDPRECISION_FUNC ( hypre_amssolve ) +#define hypre_big_insert_new_nodes HYPRE_FIXEDPRECISION_FUNC ( hypre_big_insert_new_nodes ) +#define hypre_blas_mat_inv HYPRE_FIXEDPRECISION_FUNC ( hypre_blas_mat_inv ) +#define hypre_blas_smat_inv_n2 HYPRE_FIXEDPRECISION_FUNC ( hypre_blas_smat_inv_n2 ) +#define hypre_blas_smat_inv_n3 HYPRE_FIXEDPRECISION_FUNC ( hypre_blas_smat_inv_n3 ) +#define hypre_blas_smat_inv_n4 HYPRE_FIXEDPRECISION_FUNC ( hypre_blas_smat_inv_n4 ) +#define hypre_block_jacobi_solve HYPRE_FIXEDPRECISION_FUNC ( hypre_block_jacobi_solve ) +#define hypre_blocktridiagcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_blocktridiagcreate ) +#define hypre_blocktridiagdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_blocktridiagdestroy ) +#define hypre_blocktridiagsetamgnumswee HYPRE_FIXEDPRECISION_FUNC ( hypre_blocktridiagsetamgnumswee ) +#define hypre_blocktridiagsetamgrelaxty HYPRE_FIXEDPRECISION_FUNC ( hypre_blocktridiagsetamgrelaxty ) +#define hypre_blocktridiagsetamgstrengt HYPRE_FIXEDPRECISION_FUNC ( hypre_blocktridiagsetamgstrengt ) +#define hypre_blocktridiagsetindexset HYPRE_FIXEDPRECISION_FUNC ( hypre_blocktridiagsetindexset ) +#define hypre_blocktridiagsetprintlevel HYPRE_FIXEDPRECISION_FUNC ( hypre_blocktridiagsetprintlevel ) +#define hypre_blocktridiagsetup HYPRE_FIXEDPRECISION_FUNC ( hypre_blocktridiagsetup ) +#define hypre_blocktridiagsolve HYPRE_FIXEDPRECISION_FUNC ( hypre_blocktridiagsolve ) +#define hypre_boomeramgcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgcreate ) +#define hypre_boomeramgdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgdestroy ) +#define hypre_boomeramgfingridrelaxatn HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgfingridrelaxatn ) +#define hypre_boomeramggetadditive HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggetadditive ) +#define hypre_boomeramggetcoarsentype HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggetcoarsentype ) +#define hypre_boomeramggetcumnumiterati HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggetcumnumiterati ) +#define hypre_boomeramggetcyclenumsweeps HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggetcyclenumsweeps ) +#define hypre_boomeramggetcyclerelaxtype HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggetcyclerelaxtype ) +#define hypre_boomeramggetcycletype HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggetcycletype ) +#define hypre_boomeramggetdebugflag HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggetdebugflag ) +#define hypre_boomeramggetdomaintype HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggetdomaintype ) +#define hypre_boomeramggetfinalreltvres HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggetfinalreltvres ) +#define hypre_boomeramggetjacobitrunc HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggetjacobitrunc ) +#define hypre_boomeramggetlogging HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggetlogging ) +#define hypre_boomeramggetmaxcoarsesize HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggetmaxcoarsesize ) +#define hypre_boomeramggetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggetmaxiter ) +#define hypre_boomeramggetmaxlevels HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggetmaxlevels ) +#define hypre_boomeramggetmaxrowsum HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggetmaxrowsum ) +#define hypre_boomeramggetmeasuretype HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggetmeasuretype ) +#define hypre_boomeramggetmincoarsesize HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggetmincoarsesize ) +#define hypre_boomeramggetmultadd HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggetmultadd ) +#define hypre_boomeramggetnumfunctions HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggetnumfunctions ) +#define hypre_boomeramggetnumiterations HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggetnumiterations ) +#define hypre_boomeramggetoverlap HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggetoverlap ) +#define hypre_boomeramggetpmaxelmts HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggetpmaxelmts ) +#define hypre_boomeramggetprintlevel HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggetprintlevel ) +#define hypre_boomeramggetresidual HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggetresidual ) +#define hypre_boomeramggetschwarzrlxwt HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggetschwarzrlxwt ) +#define hypre_boomeramggetsimple HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggetsimple ) +#define hypre_boomeramggetsmoothnumlvls HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggetsmoothnumlvls ) +#define hypre_boomeramggetsmoothnumswps HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggetsmoothnumswps ) +#define hypre_boomeramggetsmoothtype HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggetsmoothtype ) +#define hypre_boomeramggetstrongthrshld HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggetstrongthrshld ) +#define hypre_boomeramggettol HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggettol ) +#define hypre_boomeramggettruncfactor HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggettruncfactor ) +#define hypre_boomeramggetvariant HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramggetvariant ) +#define hypre_boomeramginitgridrelaxatn HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramginitgridrelaxatn ) +#define hypre_boomeramgsetadditive HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetadditive ) +#define hypre_boomeramgsetaddlastlvl HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetaddlastlvl ) +#define hypre_boomeramgsetaddrlxtype HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetaddrlxtype ) +#define hypre_boomeramgsetaddrlxwt HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetaddrlxwt ) +#define hypre_boomeramgsetagginterptype HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetagginterptype ) +#define hypre_boomeramgsetaggnumlevels HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetaggnumlevels ) +#define hypre_boomeramgsetaggp12maxelmt HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetaggp12maxelmt ) +#define hypre_boomeramgsetaggp12trfac HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetaggp12trfac ) +#define hypre_boomeramgsetaggpmaxelmts HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetaggpmaxelmts ) +#define hypre_boomeramgsetaggtrfactor HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetaggtrfactor ) +#define hypre_boomeramgsetcgcits HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetcgcits ) +#define hypre_boomeramgsetchebyeigest HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetchebyeigest ) +#define hypre_boomeramgsetchebyfract HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetchebyfract ) +#define hypre_boomeramgsetchebyorder HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetchebyorder ) +#define hypre_boomeramgsetchebyscale HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetchebyscale ) +#define hypre_boomeramgsetchebyvariant HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetchebyvariant ) +#define hypre_boomeramgsetcoarsentype HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetcoarsentype ) +#define hypre_boomeramgsetcyclenumsweeps HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetcyclenumsweeps ) +#define hypre_boomeramgsetcyclerelaxtype HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetcyclerelaxtype ) +#define hypre_boomeramgsetcycletype HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetcycletype ) +#define hypre_boomeramgsetdebugflag HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetdebugflag ) +#define hypre_boomeramgsetdoffunc HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetdoffunc ) +#define hypre_boomeramgsetdomaintype HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetdomaintype ) +#define hypre_boomeramgsetdroptol HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetdroptol ) +#define hypre_boomeramgseteubj HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgseteubj ) +#define hypre_boomeramgseteuclidfile HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgseteuclidfile ) +#define hypre_boomeramgseteulevel HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgseteulevel ) +#define hypre_boomeramgseteusparsea HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgseteusparsea ) +#define hypre_boomeramgsetfilter HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetfilter ) +#define hypre_boomeramgsetgridrelaxpnts HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetgridrelaxpnts ) +#define hypre_boomeramgsetgridrelaxtype HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetgridrelaxtype ) +#define hypre_boomeramgsetgsmg HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetgsmg ) +#define hypre_boomeramgsetinterptype HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetinterptype ) +#define hypre_boomeramgsetinterpvecqmx HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetinterpvecqmx ) +#define hypre_boomeramgsetinterpvecqtr HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetinterpvecqtr ) +#define hypre_boomeramgsetinterpvecs HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetinterpvecs ) +#define hypre_boomeramgsetinterpvecvar HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetinterpvecvar ) +#define hypre_boomeramgsetjacobitrunc HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetjacobitrunc ) +#define hypre_boomeramgsetkeeptransp HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetkeeptransp ) +#define hypre_boomeramgsetlevel HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetlevel ) +#define hypre_boomeramgsetlevelouterwt HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetlevelouterwt ) +#define hypre_boomeramgsetlevelrelaxwt HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetlevelrelaxwt ) +#define hypre_boomeramgsetlogging HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetlogging ) +#define hypre_boomeramgsetlvlnongaltol HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetlvlnongaltol ) +#define hypre_boomeramgsetmaxcoarsesize HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetmaxcoarsesize ) +#define hypre_boomeramgsetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetmaxiter ) +#define hypre_boomeramgsetmaxlevels HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetmaxlevels ) +#define hypre_boomeramgsetmaxnzperrow HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetmaxnzperrow ) +#define hypre_boomeramgsetmaxrowsum HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetmaxrowsum ) +#define hypre_boomeramgsetmeasuretype HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetmeasuretype ) +#define hypre_boomeramgsetmincoarsesize HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetmincoarsesize ) +#define hypre_boomeramgsetminiter HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetminiter ) +#define hypre_boomeramgsetmultadd HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetmultadd ) +#define hypre_boomeramgsetmultaddpmx HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetmultaddpmx ) +#define hypre_boomeramgsetmultaddtrf HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetmultaddtrf ) +#define hypre_boomeramgsetnodal HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetnodal ) +#define hypre_boomeramgsetnodaldiag HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetnodaldiag ) +#define hypre_boomeramgsetnongaltol HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetnongaltol ) +#define hypre_boomeramgsetnumfunctions HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetnumfunctions ) +#define hypre_boomeramgsetnumgridsweeps HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetnumgridsweeps ) +#define hypre_boomeramgsetnumpaths HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetnumpaths ) +#define hypre_boomeramgsetnumsamples HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetnumsamples ) +#define hypre_boomeramgsetnumsweeps HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetnumsweeps ) +#define hypre_boomeramgsetolddefault HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetolddefault ) +#define hypre_boomeramgsetouterwt HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetouterwt ) +#define hypre_boomeramgsetoverlap HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetoverlap ) +#define hypre_boomeramgsetpmaxelmts HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetpmaxelmts ) +#define hypre_boomeramgsetpostinterp HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetpostinterp ) +#define hypre_boomeramgsetprintfilename HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetprintfilename ) +#define hypre_boomeramgsetprintlevel HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetprintlevel ) +#define hypre_boomeramgsetrap2 HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetrap2 ) +#define hypre_boomeramgsetredundant HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetredundant ) +#define hypre_boomeramgsetrelaxorder HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetrelaxorder ) +#define hypre_boomeramgsetrelaxtype HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetrelaxtype ) +#define hypre_boomeramgsetrelaxweight HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetrelaxweight ) +#define hypre_boomeramgsetrelaxwt HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetrelaxwt ) +#define hypre_boomeramgsetrestriction HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetrestriction ) +#define hypre_boomeramgsetschwarznonsym HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetschwarznonsym ) +#define hypre_boomeramgsetschwarzrlxwt HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetschwarzrlxwt ) +#define hypre_boomeramgsetsepweight HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetsepweight ) +#define hypre_boomeramgsetseqthrshold HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetseqthrshold ) +#define hypre_boomeramgsetsetuptype HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetsetuptype ) +#define hypre_boomeramgsetsimple HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetsimple ) +#define hypre_boomeramgsetsmoothnumlvls HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetsmoothnumlvls ) +#define hypre_boomeramgsetsmoothnumswps HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetsmoothnumswps ) +#define hypre_boomeramgsetsmoothtype HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetsmoothtype ) +#define hypre_boomeramgsetstrongthrshld HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetstrongthrshld ) +#define hypre_boomeramgsetsym HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetsym ) +#define hypre_boomeramgsetthreshold HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetthreshold ) +#define hypre_boomeramgsettol HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsettol ) +#define hypre_boomeramgsettruncfactor HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsettruncfactor ) +#define hypre_boomeramgsetup HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetup ) +#define hypre_boomeramgsetvariant HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsetvariant ) +#define hypre_boomeramgsolve HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsolve ) +#define hypre_boomeramgsolvet HYPRE_FIXEDPRECISION_FUNC ( hypre_boomeramgsolvet ) +#define hypre_build_interp_colmap HYPRE_FIXEDPRECISION_FUNC ( hypre_build_interp_colmap ) +#define hypre_cr HYPRE_FIXEDPRECISION_FUNC ( hypre_cr ) +#define hypre_euclidcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_euclidcreate ) +#define hypre_eucliddestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_eucliddestroy ) +#define hypre_euclidsetbj HYPRE_FIXEDPRECISION_FUNC ( hypre_euclidsetbj ) +#define hypre_euclidsetilut HYPRE_FIXEDPRECISION_FUNC ( hypre_euclidsetilut ) +#define hypre_euclidsetlevel HYPRE_FIXEDPRECISION_FUNC ( hypre_euclidsetlevel ) +#define hypre_euclidsetmem HYPRE_FIXEDPRECISION_FUNC ( hypre_euclidsetmem ) +#define hypre_euclidsetparams HYPRE_FIXEDPRECISION_FUNC ( hypre_euclidsetparams ) +#define hypre_euclidsetparamsfromfile HYPRE_FIXEDPRECISION_FUNC ( hypre_euclidsetparamsfromfile ) +#define hypre_euclidsetrowscale HYPRE_FIXEDPRECISION_FUNC ( hypre_euclidsetrowscale ) +#define hypre_euclidsetsparsea HYPRE_FIXEDPRECISION_FUNC ( hypre_euclidsetsparsea ) +#define hypre_euclidsetstats HYPRE_FIXEDPRECISION_FUNC ( hypre_euclidsetstats ) +#define hypre_euclidsetup HYPRE_FIXEDPRECISION_FUNC ( hypre_euclidsetup ) +#define hypre_euclidsolve HYPRE_FIXEDPRECISION_FUNC ( hypre_euclidsolve ) +#define hypre_exchange_interp_data HYPRE_FIXEDPRECISION_FUNC ( hypre_exchange_interp_data ) +#define hypre_exchange_marker HYPRE_FIXEDPRECISION_FUNC ( hypre_exchange_marker ) +#define hypre_fgmresT HYPRE_FIXEDPRECISION_FUNC ( hypre_fgmresT ) +#define hypre_formu HYPRE_FIXEDPRECISION_FUNC ( hypre_formu ) +#define hypre_fptgscr HYPRE_FIXEDPRECISION_FUNC ( hypre_fptgscr ) +#define hypre_fptjaccr HYPRE_FIXEDPRECISION_FUNC ( hypre_fptjaccr ) +#define hypre_generatelaplacian HYPRE_FIXEDPRECISION_FUNC ( hypre_generatelaplacian ) +#define hypre_ilucreate HYPRE_FIXEDPRECISION_FUNC ( hypre_ilucreate ) +#define hypre_iludestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_iludestroy ) +#define hypre_ilugetfinalrelresnorm HYPRE_FIXEDPRECISION_FUNC ( hypre_ilugetfinalrelresnorm ) +#define hypre_ilugetnumiterations HYPRE_FIXEDPRECISION_FUNC ( hypre_ilugetnumiterations ) +#define hypre_ilusetdropthreshold HYPRE_FIXEDPRECISION_FUNC ( hypre_ilusetdropthreshold ) +#define hypre_ilusetdropthresholdarray HYPRE_FIXEDPRECISION_FUNC ( hypre_ilusetdropthresholdarray ) +#define hypre_ilusetleveloffill HYPRE_FIXEDPRECISION_FUNC ( hypre_ilusetleveloffill ) +#define hypre_ilusetlocalreordering HYPRE_FIXEDPRECISION_FUNC ( hypre_ilusetlocalreordering ) +#define hypre_ilusetlogging HYPRE_FIXEDPRECISION_FUNC ( hypre_ilusetlogging ) +#define hypre_ilusetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_ilusetmaxiter ) +#define hypre_ilusetmaxnnzperrow HYPRE_FIXEDPRECISION_FUNC ( hypre_ilusetmaxnnzperrow ) +#define hypre_ilusetnshdropthreshold HYPRE_FIXEDPRECISION_FUNC ( hypre_ilusetnshdropthreshold ) +#define hypre_ilusetprintlevel HYPRE_FIXEDPRECISION_FUNC ( hypre_ilusetprintlevel ) +#define hypre_ilusetschurmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_ilusetschurmaxiter ) +#define hypre_ilusettol HYPRE_FIXEDPRECISION_FUNC ( hypre_ilusettol ) +#define hypre_ilusettype HYPRE_FIXEDPRECISION_FUNC ( hypre_ilusettype ) +#define hypre_ilusetup HYPRE_FIXEDPRECISION_FUNC ( hypre_ilusetup ) +#define hypre_ilusolve HYPRE_FIXEDPRECISION_FUNC ( hypre_ilusolve ) +#define hypre_index_of_minimum HYPRE_FIXEDPRECISION_FUNC ( hypre_index_of_minimum ) +#define hypre_initialize_vecs HYPRE_FIXEDPRECISION_FUNC ( hypre_initialize_vecs ) +#define hypre_map HYPRE_FIXEDPRECISION_FUNC ( hypre_map ) +#define hypre_map2 HYPRE_FIXEDPRECISION_FUNC ( hypre_map2 ) +#define hypre_matinv HYPRE_FIXEDPRECISION_FUNC ( hypre_matinv ) +#define hypre_merge_lists HYPRE_FIXEDPRECISION_FUNC ( hypre_merge_lists ) +#define hypre_mgrbuildaff HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrbuildaff ) +#define hypre_mgrcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrcreate ) +#define hypre_mgrdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrdestroy ) +#define hypre_mgrgetcoarsegridconvfac HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrgetcoarsegridconvfac ) +#define hypre_mgrgetfinalrelresnorm HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrgetfinalrelresnorm ) +#define hypre_mgrgetnumiterations HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrgetnumiterations ) +#define hypre_mgrsetblocksize HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetblocksize ) +#define hypre_mgrsetcgridprintlevel HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetcgridprintlevel ) +#define hypre_mgrsetcgridthreshold HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetcgridthreshold ) +#define hypre_mgrsetcoarsegridmethod HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetcoarsegridmethod ) +#define hypre_mgrsetcoarsesolver HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetcoarsesolver ) +#define hypre_mgrsetcpointsbyblock HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetcpointsbyblock ) +#define hypre_mgrsetcptsbyctgblock HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetcptsbyctgblock ) +#define hypre_mgrsetcptsbymarkerarray HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetcptsbymarkerarray ) +#define hypre_mgrsetfrelaxmethod HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetfrelaxmethod ) +#define hypre_mgrsetfrelaxprintlevel HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetfrelaxprintlevel ) +#define hypre_mgrsetfsolver HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetfsolver ) +#define hypre_mgrsetglobalsmoothtype HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetglobalsmoothtype ) +#define hypre_mgrsetinterptype HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetinterptype ) +#define hypre_mgrsetlevelfrelaxmethod HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetlevelfrelaxmethod ) +#define hypre_mgrsetlevelfrelaxnumfunc HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetlevelfrelaxnumfunc ) +#define hypre_mgrsetlevelinterptype HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetlevelinterptype ) +#define hypre_mgrsetlevelrestricttype HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetlevelrestricttype ) +#define hypre_mgrsetlogging HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetlogging ) +#define hypre_mgrsetmaxcoarselevels HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetmaxcoarselevels ) +#define hypre_mgrsetmaxglobalsmoothit HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetmaxglobalsmoothit ) +#define hypre_mgrsetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetmaxiter ) +#define hypre_mgrsetnoncptstofpts HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetnoncptstofpts ) +#define hypre_mgrsetnuminterpsweeps HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetnuminterpsweeps ) +#define hypre_mgrsetnumrelaxsweeps HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetnumrelaxsweeps ) +#define hypre_mgrsetnumrestrictsweeps HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetnumrestrictsweeps ) +#define hypre_mgrsetpmaxelmts HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetpmaxelmts ) +#define hypre_mgrsetprintlevel HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetprintlevel ) +#define hypre_mgrsetrelaxtype HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetrelaxtype ) +#define hypre_mgrsetreservedcoarsenodes HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetreservedcoarsenodes ) +#define hypre_mgrsetreservedcptslevel HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetreservedcptslevel ) +#define hypre_mgrsetrestricttype HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetrestricttype ) +#define hypre_mgrsettol HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsettol ) +#define hypre_mgrsetup HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsetup ) +#define hypre_mgrsolve HYPRE_FIXEDPRECISION_FUNC ( hypre_mgrsolve ) +#define hypre_move_entry HYPRE_FIXEDPRECISION_FUNC ( hypre_move_entry ) +#define hypre_ordered_GS HYPRE_FIXEDPRECISION_FUNC ( hypre_ordered_GS ) +#define hypre_parCorrRes HYPRE_FIXEDPRECISION_FUNC ( hypre_parCorrRes ) +#define hypre_parasailscreate HYPRE_FIXEDPRECISION_FUNC ( hypre_parasailscreate ) +#define hypre_parasailsdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_parasailsdestroy ) +#define hypre_parasailsgetfilter HYPRE_FIXEDPRECISION_FUNC ( hypre_parasailsgetfilter ) +#define hypre_parasailsgetloadbal HYPRE_FIXEDPRECISION_FUNC ( hypre_parasailsgetloadbal ) +#define hypre_parasailsgetlogging HYPRE_FIXEDPRECISION_FUNC ( hypre_parasailsgetlogging ) +#define hypre_parasailsgetnlevels HYPRE_FIXEDPRECISION_FUNC ( hypre_parasailsgetnlevels ) +#define hypre_parasailsgetreuse HYPRE_FIXEDPRECISION_FUNC ( hypre_parasailsgetreuse ) +#define hypre_parasailsgetsym HYPRE_FIXEDPRECISION_FUNC ( hypre_parasailsgetsym ) +#define hypre_parasailsgetthresh HYPRE_FIXEDPRECISION_FUNC ( hypre_parasailsgetthresh ) +#define hypre_parasailssetfilter HYPRE_FIXEDPRECISION_FUNC ( hypre_parasailssetfilter ) +#define hypre_parasailssetloadbal HYPRE_FIXEDPRECISION_FUNC ( hypre_parasailssetloadbal ) +#define hypre_parasailssetlogging HYPRE_FIXEDPRECISION_FUNC ( hypre_parasailssetlogging ) +#define hypre_parasailssetnlevels HYPRE_FIXEDPRECISION_FUNC ( hypre_parasailssetnlevels ) +#define hypre_parasailssetparams HYPRE_FIXEDPRECISION_FUNC ( hypre_parasailssetparams ) +#define hypre_parasailssetreuse HYPRE_FIXEDPRECISION_FUNC ( hypre_parasailssetreuse ) +#define hypre_parasailssetsym HYPRE_FIXEDPRECISION_FUNC ( hypre_parasailssetsym ) +#define hypre_parasailssetthresh HYPRE_FIXEDPRECISION_FUNC ( hypre_parasailssetthresh ) +#define hypre_parasailssetup HYPRE_FIXEDPRECISION_FUNC ( hypre_parasailssetup ) +#define hypre_parasailssolve HYPRE_FIXEDPRECISION_FUNC ( hypre_parasailssolve ) +#define hypre_parcsrbicgstabcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrbicgstabcreate ) +#define hypre_parcsrbicgstabdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrbicgstabdestroy ) +#define hypre_parcsrbicgstabgetfinalrel HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrbicgstabgetfinalrel ) +#define hypre_parcsrbicgstabgetnumiter HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrbicgstabgetnumiter ) +#define hypre_parcsrbicgstabgetprecond HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrbicgstabgetprecond ) +#define hypre_parcsrbicgstabsetatol HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrbicgstabsetatol ) +#define hypre_parcsrbicgstabsetlogging HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrbicgstabsetlogging ) +#define hypre_parcsrbicgstabsetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrbicgstabsetmaxiter ) +#define hypre_parcsrbicgstabsetminiter HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrbicgstabsetminiter ) +#define hypre_parcsrbicgstabsetprecond HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrbicgstabsetprecond ) +#define hypre_parcsrbicgstabsetprintlev HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrbicgstabsetprintlev ) +#define hypre_parcsrbicgstabsetstopcrit HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrbicgstabsetstopcrit ) +#define hypre_parcsrbicgstabsettol HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrbicgstabsettol ) +#define hypre_parcsrbicgstabsetup HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrbicgstabsetup ) +#define hypre_parcsrbicgstabsolve HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrbicgstabsolve ) +#define hypre_parcsrcgnrcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrcgnrcreate ) +#define hypre_parcsrcgnrdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrcgnrdestroy ) +#define hypre_parcsrcgnrgetfinalrelativ HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrcgnrgetfinalrelativ ) +#define hypre_parcsrcgnrgetnumiteration HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrcgnrgetnumiteration ) +#define hypre_parcsrcgnrgetprecond HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrcgnrgetprecond ) +#define hypre_parcsrcgnrsetlogging HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrcgnrsetlogging ) +#define hypre_parcsrcgnrsetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrcgnrsetmaxiter ) +#define hypre_parcsrcgnrsetminiter HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrcgnrsetminiter ) +#define hypre_parcsrcgnrsetprecond HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrcgnrsetprecond ) +#define hypre_parcsrcgnrsetstopcrit HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrcgnrsetstopcrit ) +#define hypre_parcsrcgnrsettol HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrcgnrsettol ) +#define hypre_parcsrcgnrsetup HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrcgnrsetup ) +#define hypre_parcsrcgnrsolve HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrcgnrsolve ) +#define hypre_parcsrcogmrescreate HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrcogmrescreate ) +#define hypre_parcsrcogmresdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrcogmresdestroy ) +#define hypre_parcsrcogmresgetfinalrela HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrcogmresgetfinalrela ) +#define hypre_parcsrcogmresgetnumiterat HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrcogmresgetnumiterat ) +#define hypre_parcsrcogmresgetprecond HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrcogmresgetprecond ) +#define hypre_parcsrcogmressetabsolutet HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrcogmressetabsolutet ) +#define hypre_parcsrcogmressetcgs HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrcogmressetcgs ) +#define hypre_parcsrcogmressetkdim HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrcogmressetkdim ) +#define hypre_parcsrcogmressetlogging HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrcogmressetlogging ) +#define hypre_parcsrcogmressetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrcogmressetmaxiter ) +#define hypre_parcsrcogmressetminiter HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrcogmressetminiter ) +#define hypre_parcsrcogmressetprecond HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrcogmressetprecond ) +#define hypre_parcsrcogmressetprintleve HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrcogmressetprintleve ) +#define hypre_parcsrcogmressettol HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrcogmressettol ) +#define hypre_parcsrcogmressetunroll HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrcogmressetunroll ) +#define hypre_parcsrcogmressetup HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrcogmressetup ) +#define hypre_parcsrcogmressolve HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrcogmressolve ) +#define hypre_parcsrdiagscale HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrdiagscale ) +#define hypre_parcsrdiagscalesetup HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrdiagscalesetup ) +#define hypre_parcsrflexgmrescreate HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrflexgmrescreate ) +#define hypre_parcsrflexgmresdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrflexgmresdestroy ) +#define hypre_parcsrflexgmresgetfinalrelati HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrflexgmresgetfinalrelati ) +#define hypre_parcsrflexgmresgetnumiteratio HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrflexgmresgetnumiteratio ) +#define hypre_parcsrflexgmresgetprecond HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrflexgmresgetprecond ) +#define hypre_parcsrflexgmressetabsolutetol HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrflexgmressetabsolutetol ) +#define hypre_parcsrflexgmressetkdim HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrflexgmressetkdim ) +#define hypre_parcsrflexgmressetlogging HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrflexgmressetlogging ) +#define hypre_parcsrflexgmressetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrflexgmressetmaxiter ) +#define hypre_parcsrflexgmressetminiter HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrflexgmressetminiter ) +#define hypre_parcsrflexgmressetprecond HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrflexgmressetprecond ) +#define hypre_parcsrflexgmressetprintlevel HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrflexgmressetprintlevel ) +#define hypre_parcsrflexgmressettol HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrflexgmressettol ) +#define hypre_parcsrflexgmressetup HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrflexgmressetup ) +#define hypre_parcsrflexgmressolve HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrflexgmressolve ) +#define hypre_parcsrgmrescreate HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrgmrescreate ) +#define hypre_parcsrgmresdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrgmresdestroy ) +#define hypre_parcsrgmresgetfinalrelati HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrgmresgetfinalrelati ) +#define hypre_parcsrgmresgetnumiteratio HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrgmresgetnumiteratio ) +#define hypre_parcsrgmresgetprecond HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrgmresgetprecond ) +#define hypre_parcsrgmressetabsolutetol HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrgmressetabsolutetol ) +#define hypre_parcsrgmressetkdim HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrgmressetkdim ) +#define hypre_parcsrgmressetlogging HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrgmressetlogging ) +#define hypre_parcsrgmressetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrgmressetmaxiter ) +#define hypre_parcsrgmressetminiter HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrgmressetminiter ) +#define hypre_parcsrgmressetprecond HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrgmressetprecond ) +#define hypre_parcsrgmressetprintlevel HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrgmressetprintlevel ) +#define hypre_parcsrgmressetstopcrit HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrgmressetstopcrit ) +#define hypre_parcsrgmressettol HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrgmressettol ) +#define hypre_parcsrgmressetup HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrgmressetup ) +#define hypre_parcsrgmressolve HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrgmressolve ) +#define hypre_parcsrhybridcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridcreate ) +#define hypre_parcsrhybriddestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybriddestroy ) +#define hypre_parcsrhybridgetdscgnumite HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridgetdscgnumite ) +#define hypre_parcsrhybridgetfinalrelat HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridgetfinalrelat ) +#define hypre_parcsrhybridgetnumiterati HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridgetnumiterati ) +#define hypre_parcsrhybridgetpcgnumiter HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridgetpcgnumiter ) +#define hypre_parcsrhybridsetaggnumlev HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetaggnumlev ) +#define hypre_parcsrhybridsetcoarsentyp HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetcoarsentyp ) +#define hypre_parcsrhybridsetconvergenc HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetconvergenc ) +#define hypre_parcsrhybridsetcyclenumsw HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetcyclenumsw ) +#define hypre_parcsrhybridsetcyclerelax HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetcyclerelax ) +#define hypre_parcsrhybridsetcycletype HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetcycletype ) +#define hypre_parcsrhybridsetdoffunc HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetdoffunc ) +#define hypre_parcsrhybridsetdscgmaxite HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetdscgmaxite ) +#define hypre_parcsrhybridsetgridrelaxp HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetgridrelaxp ) +#define hypre_parcsrhybridsetgridrelaxt HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetgridrelaxt ) +#define hypre_parcsrhybridsetinterptyp HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetinterptyp ) +#define hypre_parcsrhybridsetkdim HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetkdim ) +#define hypre_parcsrhybridsetkeeptrans HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetkeeptrans ) +#define hypre_parcsrhybridsetlevelouter HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetlevelouter ) +#define hypre_parcsrhybridsetlevelrelax HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetlevelrelax ) +#define hypre_parcsrhybridsetlogging HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetlogging ) +#define hypre_parcsrhybridsetmaxlevels HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetmaxlevels ) +#define hypre_parcsrhybridsetmaxrowsum HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetmaxrowsum ) +#define hypre_parcsrhybridsetmeasuretyp HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetmeasuretyp ) +#define hypre_parcsrhybridsetnodal HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetnodal ) +#define hypre_parcsrhybridsetnongaltol HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetnongaltol ) +#define hypre_parcsrhybridsetnumfunc HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetnumfunc ) +#define hypre_parcsrhybridsetnumgridswe HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetnumgridswe ) +#define hypre_parcsrhybridsetnumpaths HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetnumpaths ) +#define hypre_parcsrhybridsetnumsweeps HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetnumsweeps ) +#define hypre_parcsrhybridsetomega HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetomega ) +#define hypre_parcsrhybridsetouterwt HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetouterwt ) +#define hypre_parcsrhybridsetpcgmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetpcgmaxiter ) +#define hypre_parcsrhybridsetpmaxelmts HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetpmaxelmts ) +#define hypre_parcsrhybridsetprecond HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetprecond ) +#define hypre_parcsrhybridsetprintlevel HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetprintlevel ) +#define hypre_parcsrhybridsetrelaxorder HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetrelaxorder ) +#define hypre_parcsrhybridsetrelaxtype HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetrelaxtype ) +#define hypre_parcsrhybridsetrelaxweigh HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetrelaxweigh ) +#define hypre_parcsrhybridsetrelaxwt HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetrelaxwt ) +#define hypre_parcsrhybridsetrelchange HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetrelchange ) +#define hypre_parcsrhybridsetsolvertype HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetsolvertype ) +#define hypre_parcsrhybridsetstopcrit HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetstopcrit ) +#define hypre_parcsrhybridsetstrongthre HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetstrongthre ) +#define hypre_parcsrhybridsettol HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsettol ) +#define hypre_parcsrhybridsettruncfacto HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsettruncfacto ) +#define hypre_parcsrhybridsettwonorm HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsettwonorm ) +#define hypre_parcsrhybridsetup HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsetup ) +#define hypre_parcsrhybridsolve HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrhybridsolve ) +#define hypre_parcsrlgmrescreate HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrlgmrescreate ) +#define hypre_parcsrlgmresdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrlgmresdestroy ) +#define hypre_parcsrlgmresgetfinalrelati HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrlgmresgetfinalrelati ) +#define hypre_parcsrlgmresgetnumiteratio HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrlgmresgetnumiteratio ) +#define hypre_parcsrlgmresgetprecond HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrlgmresgetprecond ) +#define hypre_parcsrlgmressetabsolutetol HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrlgmressetabsolutetol ) +#define hypre_parcsrlgmressetkdim HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrlgmressetkdim ) +#define hypre_parcsrlgmressetlogging HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrlgmressetlogging ) +#define hypre_parcsrlgmressetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrlgmressetmaxiter ) +#define hypre_parcsrlgmressetminiter HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrlgmressetminiter ) +#define hypre_parcsrlgmressetprecond HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrlgmressetprecond ) +#define hypre_parcsrlgmressetprintlevel HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrlgmressetprintlevel ) +#define hypre_parcsrlgmressettol HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrlgmressettol ) +#define hypre_parcsrlgmressetup HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrlgmressetup ) +#define hypre_parcsrlgmressolve HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrlgmressolve ) +#define hypre_parcsrmultivectorprint HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrmultivectorprint ) +#define hypre_parcsrmultivectorread HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrmultivectorread ) +#define hypre_parcsrpcgcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrpcgcreate ) +#define hypre_parcsrpcgdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrpcgdestroy ) +#define hypre_parcsrpcggetfinalrelative HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrpcggetfinalrelative ) +#define hypre_parcsrpcggetnumiterations HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrpcggetnumiterations ) +#define hypre_parcsrpcggetprecond HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrpcggetprecond ) +#define hypre_parcsrpcgsetatol HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrpcgsetatol ) +#define hypre_parcsrpcgsetlogging HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrpcgsetlogging ) +#define hypre_parcsrpcgsetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrpcgsetmaxiter ) +#define hypre_parcsrpcgsetprecond HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrpcgsetprecond ) +#define hypre_parcsrpcgsetprintlevel HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrpcgsetprintlevel ) +#define hypre_parcsrpcgsetrelchange HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrpcgsetrelchange ) +#define hypre_parcsrpcgsetstopcrit HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrpcgsetstopcrit ) +#define hypre_parcsrpcgsettol HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrpcgsettol ) +#define hypre_parcsrpcgsettwonorm HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrpcgsettwonorm ) +#define hypre_parcsrpcgsetup HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrpcgsetup ) +#define hypre_parcsrpcgsolve HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrpcgsolve ) +#define hypre_parcsrpilutcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrpilutcreate ) +#define hypre_parcsrpilutdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrpilutdestroy ) +#define hypre_parcsrpilutsetdroptoleran HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrpilutsetdroptoleran ) +#define hypre_parcsrpilutsetfacrowsize HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrpilutsetfacrowsize ) +#define hypre_parcsrpilutsetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrpilutsetmaxiter ) +#define hypre_parcsrpilutsetup HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrpilutsetup ) +#define hypre_parcsrpilutsolve HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrpilutsolve ) +#define hypre_parcsrsetupinterpreter HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrsetupinterpreter ) +#define hypre_parcsrsetupmatvec HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrsetupmatvec ) +#define hypre_parprintvector HYPRE_FIXEDPRECISION_FUNC ( hypre_parprintvector ) +#define hypre_parreadvector HYPRE_FIXEDPRECISION_FUNC ( hypre_parreadvector ) +#define hypre_parsetrandomvalues HYPRE_FIXEDPRECISION_FUNC ( hypre_parsetrandomvalues ) +#define hypre_parvectorsize HYPRE_FIXEDPRECISION_FUNC ( hypre_parvectorsize ) +#define hypre_qsort2_ci HYPRE_FIXEDPRECISION_FUNC ( hypre_qsort2_ci ) +#define hypre_remove_entry HYPRE_FIXEDPRECISION_FUNC ( hypre_remove_entry ) +#define hypre_schwarzcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_schwarzcreate ) +#define hypre_schwarzdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_schwarzdestroy ) +#define hypre_schwarzsetdoffunc HYPRE_FIXEDPRECISION_FUNC ( hypre_schwarzsetdoffunc ) +#define hypre_schwarzsetdomainstructure HYPRE_FIXEDPRECISION_FUNC ( hypre_schwarzsetdomainstructure ) +#define hypre_schwarzsetdomaintype HYPRE_FIXEDPRECISION_FUNC ( hypre_schwarzsetdomaintype ) +#define hypre_schwarzsetnumfunctions HYPRE_FIXEDPRECISION_FUNC ( hypre_schwarzsetnumfunctions ) +#define hypre_schwarzsetoverlap HYPRE_FIXEDPRECISION_FUNC ( hypre_schwarzsetoverlap ) +#define hypre_schwarzsetrelaxweight HYPRE_FIXEDPRECISION_FUNC ( hypre_schwarzsetrelaxweight ) +#define hypre_schwarzsetup HYPRE_FIXEDPRECISION_FUNC ( hypre_schwarzsetup ) +#define hypre_schwarzsetvariant HYPRE_FIXEDPRECISION_FUNC ( hypre_schwarzsetvariant ) +#define hypre_schwarzsolve HYPRE_FIXEDPRECISION_FUNC ( hypre_schwarzsolve ) +#define hypre_seqAMGCycle HYPRE_FIXEDPRECISION_FUNC ( hypre_seqAMGCycle ) +#define hypre_seqAMGSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_seqAMGSetup ) +#define hypre_ssort HYPRE_FIXEDPRECISION_FUNC ( hypre_ssort ) +#define hypre_swap2_ci HYPRE_FIXEDPRECISION_FUNC ( hypre_swap2_ci ) +#define hypre_swap_int HYPRE_FIXEDPRECISION_FUNC ( hypre_swap_int ) +#define hypre_tempparcsrsetupinterprete HYPRE_FIXEDPRECISION_FUNC ( hypre_tempparcsrsetupinterprete ) +#define hypre_update_entry HYPRE_FIXEDPRECISION_FUNC ( hypre_update_entry ) +#define matrix_matrix_product HYPRE_FIXEDPRECISION_FUNC ( matrix_matrix_product ) +#define rfun HYPRE_FIXEDPRECISION_FUNC ( rfun ) +#define rfun_rs HYPRE_FIXEDPRECISION_FUNC ( rfun_rs ) +#define transpose_matrix_create HYPRE_FIXEDPRECISION_FUNC ( transpose_matrix_create ) + +#endif diff --git a/src/parcsr_ls/_hypre_parcsr_ls_mup_undef.h b/src/parcsr_ls/_hypre_parcsr_ls_mup_undef.h new file mode 100644 index 0000000000..f2d19ec774 --- /dev/null +++ b/src/parcsr_ls/_hypre_parcsr_ls_mup_undef.h @@ -0,0 +1,2126 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#undef hypre_PARCSR_LS_MUP_DEF_HEADER + +#undef HYPRE_ADSCreate +#undef HYPRE_ADSDestroy +#undef HYPRE_ADSGetFinalRelativeResidualNorm +#undef HYPRE_ADSGetNumIterations +#undef HYPRE_ADSSetAMGOptions +#undef HYPRE_ADSSetAMSOptions +#undef HYPRE_ADSSetChebySmoothingOptions +#undef HYPRE_ADSSetCoordinateVectors +#undef HYPRE_ADSSetCycleType +#undef HYPRE_ADSSetDiscreteCurl +#undef HYPRE_ADSSetDiscreteGradient +#undef HYPRE_ADSSetInterpolations +#undef HYPRE_ADSSetMaxIter +#undef HYPRE_ADSSetPrintLevel +#undef HYPRE_ADSSetSmoothingOptions +#undef HYPRE_ADSSetTol +#undef HYPRE_ADSSetup +#undef HYPRE_ADSSolve +#undef HYPRE_AMECreate +#undef HYPRE_AMEDestroy +#undef HYPRE_AMEGetEigenvalues +#undef HYPRE_AMEGetEigenvectors +#undef HYPRE_AMESetAMSSolver +#undef HYPRE_AMESetBlockSize +#undef HYPRE_AMESetMassMatrix +#undef HYPRE_AMESetMaxIter +#undef HYPRE_AMESetMaxPCGIter +#undef HYPRE_AMESetPrintLevel +#undef HYPRE_AMESetRTol +#undef HYPRE_AMESetTol +#undef HYPRE_AMESetup +#undef HYPRE_AMESolve +#undef HYPRE_AMSConstructDiscreteGradient +#undef HYPRE_AMSCreate +#undef HYPRE_AMSDestroy +#undef HYPRE_AMSFEIDestroy +#undef HYPRE_AMSFEISetup +#undef HYPRE_AMSGetFinalRelativeResidualNorm +#undef HYPRE_AMSGetNumIterations +#undef HYPRE_AMSProjectOutGradients +#undef HYPRE_AMSSetAlphaAMGCoarseRelaxType +#undef HYPRE_AMSSetAlphaAMGOptions +#undef HYPRE_AMSSetAlphaPoissonMatrix +#undef HYPRE_AMSSetBetaAMGCoarseRelaxType +#undef HYPRE_AMSSetBetaAMGOptions +#undef HYPRE_AMSSetBetaPoissonMatrix +#undef HYPRE_AMSSetChebySmoothingOptions +#undef HYPRE_AMSSetCoordinateVectors +#undef HYPRE_AMSSetCycleType +#undef HYPRE_AMSSetDimension +#undef HYPRE_AMSSetDiscreteGradient +#undef HYPRE_AMSSetEdgeConstantVectors +#undef HYPRE_AMSSetInteriorNodes +#undef HYPRE_AMSSetInterpolations +#undef HYPRE_AMSSetMaxIter +#undef HYPRE_AMSSetPrintLevel +#undef HYPRE_AMSSetProjectionFrequency +#undef HYPRE_AMSSetSmoothingOptions +#undef HYPRE_AMSSetTol +#undef HYPRE_AMSSetup +#undef HYPRE_AMSSolve +#undef HYPRE_BlockTridiagCreate +#undef HYPRE_BlockTridiagDestroy +#undef HYPRE_BlockTridiagSetAMGNumSweeps +#undef HYPRE_BlockTridiagSetAMGRelaxType +#undef HYPRE_BlockTridiagSetAMGStrengthThreshold +#undef HYPRE_BlockTridiagSetIndexSet +#undef HYPRE_BlockTridiagSetPrintLevel +#undef HYPRE_BlockTridiagSetup +#undef HYPRE_BlockTridiagSolve +#undef HYPRE_BoomerAMGCreate +#undef HYPRE_BoomerAMGDDCreate +#undef HYPRE_BoomerAMGDDDestroy +#undef HYPRE_BoomerAMGDDGetAMG +#undef HYPRE_BoomerAMGDDGetFACCycleType +#undef HYPRE_BoomerAMGDDGetFACNumCycles +#undef HYPRE_BoomerAMGDDGetFACNumRelax +#undef HYPRE_BoomerAMGDDGetFACRelaxType +#undef HYPRE_BoomerAMGDDGetFACRelaxWeight +#undef HYPRE_BoomerAMGDDGetFinalRelativeResidualNorm +#undef HYPRE_BoomerAMGDDGetNumGhostLayers +#undef HYPRE_BoomerAMGDDGetNumIterations +#undef HYPRE_BoomerAMGDDGetPadding +#undef HYPRE_BoomerAMGDDGetStartLevel +#undef HYPRE_BoomerAMGDDSetFACCycleType +#undef HYPRE_BoomerAMGDDSetFACNumCycles +#undef HYPRE_BoomerAMGDDSetFACNumRelax +#undef HYPRE_BoomerAMGDDSetFACRelaxType +#undef HYPRE_BoomerAMGDDSetFACRelaxWeight +#undef HYPRE_BoomerAMGDDSetNumGhostLayers +#undef HYPRE_BoomerAMGDDSetPadding +#undef HYPRE_BoomerAMGDDSetStartLevel +#undef HYPRE_BoomerAMGDDSetUserFACRelaxation +#undef HYPRE_BoomerAMGDDSetup +#undef HYPRE_BoomerAMGDDSolve +#undef HYPRE_BoomerAMGDestroy +#undef HYPRE_BoomerAMGGetAdditive +#undef HYPRE_BoomerAMGGetCoarsenCutFactor +#undef HYPRE_BoomerAMGGetCoarsenType +#undef HYPRE_BoomerAMGGetConvergeType +#undef HYPRE_BoomerAMGGetCumNnzAP +#undef HYPRE_BoomerAMGGetCumNumIterations +#undef HYPRE_BoomerAMGGetCycleNumSweeps +#undef HYPRE_BoomerAMGGetCycleRelaxType +#undef HYPRE_BoomerAMGGetCycleType +#undef HYPRE_BoomerAMGGetDebugFlag +#undef HYPRE_BoomerAMGGetDomainType +#undef HYPRE_BoomerAMGGetFCycle +#undef HYPRE_BoomerAMGGetFilterFunctions +#undef HYPRE_BoomerAMGGetFilterThresholdR +#undef HYPRE_BoomerAMGGetFinalRelativeResidualNorm +#undef HYPRE_BoomerAMGGetGridHierarchy +#undef HYPRE_BoomerAMGGetJacobiTruncThreshold +#undef HYPRE_BoomerAMGGetLogging +#undef HYPRE_BoomerAMGGetMaxCoarseSize +#undef HYPRE_BoomerAMGGetMaxIter +#undef HYPRE_BoomerAMGGetMaxLevels +#undef HYPRE_BoomerAMGGetMaxRowSum +#undef HYPRE_BoomerAMGGetMeasureType +#undef HYPRE_BoomerAMGGetMinCoarseSize +#undef HYPRE_BoomerAMGGetMultAdditive +#undef HYPRE_BoomerAMGGetNumFunctions +#undef HYPRE_BoomerAMGGetNumIterations +#undef HYPRE_BoomerAMGGetOverlap +#undef HYPRE_BoomerAMGGetPMaxElmts +#undef HYPRE_BoomerAMGGetPostInterpType +#undef HYPRE_BoomerAMGGetPrintLevel +#undef HYPRE_BoomerAMGGetRedundant +#undef HYPRE_BoomerAMGGetResidual +#undef HYPRE_BoomerAMGGetSchwarzRlxWeight +#undef HYPRE_BoomerAMGGetSeqThreshold +#undef HYPRE_BoomerAMGGetSimple +#undef HYPRE_BoomerAMGGetSmoothNumLevels +#undef HYPRE_BoomerAMGGetSmoothNumSweeps +#undef HYPRE_BoomerAMGGetSmoothType +#undef HYPRE_BoomerAMGGetStrongThreshold +#undef HYPRE_BoomerAMGGetStrongThresholdR +#undef HYPRE_BoomerAMGGetTol +#undef HYPRE_BoomerAMGGetTruncFactor +#undef HYPRE_BoomerAMGGetVariant +#undef HYPRE_BoomerAMGInitGridRelaxation +#undef HYPRE_BoomerAMGSetADropTol +#undef HYPRE_BoomerAMGSetADropType +#undef HYPRE_BoomerAMGSetAddLastLvl +#undef HYPRE_BoomerAMGSetAddPMaxElmts +#undef HYPRE_BoomerAMGSetAddRelaxType +#undef HYPRE_BoomerAMGSetAddRelaxWt +#undef HYPRE_BoomerAMGSetAddTruncFactor +#undef HYPRE_BoomerAMGSetAdditive +#undef HYPRE_BoomerAMGSetAggInterpType +#undef HYPRE_BoomerAMGSetAggNumLevels +#undef HYPRE_BoomerAMGSetAggP12MaxElmts +#undef HYPRE_BoomerAMGSetAggP12TruncFactor +#undef HYPRE_BoomerAMGSetAggPMaxElmts +#undef HYPRE_BoomerAMGSetAggTruncFactor +#undef HYPRE_BoomerAMGSetCGCIts +#undef HYPRE_BoomerAMGSetCPoints +#undef HYPRE_BoomerAMGSetCRRate +#undef HYPRE_BoomerAMGSetCRStrongTh +#undef HYPRE_BoomerAMGSetCRUseCG +#undef HYPRE_BoomerAMGSetChebyEigEst +#undef HYPRE_BoomerAMGSetChebyFraction +#undef HYPRE_BoomerAMGSetChebyOrder +#undef HYPRE_BoomerAMGSetChebyScale +#undef HYPRE_BoomerAMGSetChebyVariant +#undef HYPRE_BoomerAMGSetCoarsenCutFactor +#undef HYPRE_BoomerAMGSetCoarsenType +#undef HYPRE_BoomerAMGSetConvergeType +#undef HYPRE_BoomerAMGSetCoordDim +#undef HYPRE_BoomerAMGSetCoordinates +#undef HYPRE_BoomerAMGSetCpointsToKeep +#undef HYPRE_BoomerAMGSetCumNnzAP +#undef HYPRE_BoomerAMGSetCycleNumSweeps +#undef HYPRE_BoomerAMGSetCycleRelaxType +#undef HYPRE_BoomerAMGSetCycleType +#undef HYPRE_BoomerAMGSetDebugFlag +#undef HYPRE_BoomerAMGSetDofFunc +#undef HYPRE_BoomerAMGSetDomainType +#undef HYPRE_BoomerAMGSetDropTol +#undef HYPRE_BoomerAMGSetEuBJ +#undef HYPRE_BoomerAMGSetEuLevel +#undef HYPRE_BoomerAMGSetEuSparseA +#undef HYPRE_BoomerAMGSetEuclidFile +#undef HYPRE_BoomerAMGSetFCycle +#undef HYPRE_BoomerAMGSetFPoints +#undef HYPRE_BoomerAMGSetFSAIAlgoType +#undef HYPRE_BoomerAMGSetFSAIEigMaxIters +#undef HYPRE_BoomerAMGSetFSAIKapTolerance +#undef HYPRE_BoomerAMGSetFSAILocalSolveType +#undef HYPRE_BoomerAMGSetFSAIMaxNnzRow +#undef HYPRE_BoomerAMGSetFSAIMaxStepSize +#undef HYPRE_BoomerAMGSetFSAIMaxSteps +#undef HYPRE_BoomerAMGSetFSAINumLevels +#undef HYPRE_BoomerAMGSetFSAIThreshold +#undef HYPRE_BoomerAMGSetFilter +#undef HYPRE_BoomerAMGSetFilterFunctions +#undef HYPRE_BoomerAMGSetFilterThresholdR +#undef HYPRE_BoomerAMGSetGMRESSwitchR +#undef HYPRE_BoomerAMGSetGSMG +#undef HYPRE_BoomerAMGSetGridRelaxPoints +#undef HYPRE_BoomerAMGSetGridRelaxType +#undef HYPRE_BoomerAMGSetILUDroptol +#undef HYPRE_BoomerAMGSetILUIterSetupMaxIter +#undef HYPRE_BoomerAMGSetILUIterSetupOption +#undef HYPRE_BoomerAMGSetILUIterSetupTolerance +#undef HYPRE_BoomerAMGSetILUIterSetupType +#undef HYPRE_BoomerAMGSetILULevel +#undef HYPRE_BoomerAMGSetILULocalReordering +#undef HYPRE_BoomerAMGSetILULowerJacobiIters +#undef HYPRE_BoomerAMGSetILUMaxIter +#undef HYPRE_BoomerAMGSetILUMaxRowNnz +#undef HYPRE_BoomerAMGSetILUTriSolve +#undef HYPRE_BoomerAMGSetILUType +#undef HYPRE_BoomerAMGSetILUUpperJacobiIters +#undef HYPRE_BoomerAMGSetISType +#undef HYPRE_BoomerAMGSetInterpRefine +#undef HYPRE_BoomerAMGSetInterpType +#undef HYPRE_BoomerAMGSetInterpVecAbsQTrunc +#undef HYPRE_BoomerAMGSetInterpVecFirstLevel +#undef HYPRE_BoomerAMGSetInterpVecQMax +#undef HYPRE_BoomerAMGSetInterpVecVariant +#undef HYPRE_BoomerAMGSetInterpVectors +#undef HYPRE_BoomerAMGSetIsTriangular +#undef HYPRE_BoomerAMGSetIsolatedFPoints +#undef HYPRE_BoomerAMGSetJacobiTruncThreshold +#undef HYPRE_BoomerAMGSetKeepSameSign +#undef HYPRE_BoomerAMGSetKeepTranspose +#undef HYPRE_BoomerAMGSetLevel +#undef HYPRE_BoomerAMGSetLevelNonGalerkinTol +#undef HYPRE_BoomerAMGSetLevelOuterWt +#undef HYPRE_BoomerAMGSetLevelRelaxWt +#undef HYPRE_BoomerAMGSetLogging +#undef HYPRE_BoomerAMGSetMaxCoarseSize +#undef HYPRE_BoomerAMGSetMaxIter +#undef HYPRE_BoomerAMGSetMaxLevels +#undef HYPRE_BoomerAMGSetMaxNzPerRow +#undef HYPRE_BoomerAMGSetMaxRowSum +#undef HYPRE_BoomerAMGSetMeasureType +#undef HYPRE_BoomerAMGSetMinCoarseSize +#undef HYPRE_BoomerAMGSetMinIter +#undef HYPRE_BoomerAMGSetModuleRAP2 +#undef HYPRE_BoomerAMGSetMultAddPMaxElmts +#undef HYPRE_BoomerAMGSetMultAddTruncFactor +#undef HYPRE_BoomerAMGSetMultAdditive +#undef HYPRE_BoomerAMGSetNodal +#undef HYPRE_BoomerAMGSetNodalDiag +#undef HYPRE_BoomerAMGSetNodalLevels +#undef HYPRE_BoomerAMGSetNonGalerkTol +#undef HYPRE_BoomerAMGSetNonGalerkinTol +#undef HYPRE_BoomerAMGSetNumCRRelaxSteps +#undef HYPRE_BoomerAMGSetNumFunctions +#undef HYPRE_BoomerAMGSetNumGridSweeps +#undef HYPRE_BoomerAMGSetNumPaths +#undef HYPRE_BoomerAMGSetNumSamples +#undef HYPRE_BoomerAMGSetNumSweeps +#undef HYPRE_BoomerAMGSetOldDefault +#undef HYPRE_BoomerAMGSetOmega +#undef HYPRE_BoomerAMGSetOuterWt +#undef HYPRE_BoomerAMGSetOverlap +#undef HYPRE_BoomerAMGSetPMaxElmts +#undef HYPRE_BoomerAMGSetPlotFileName +#undef HYPRE_BoomerAMGSetPlotGrids +#undef HYPRE_BoomerAMGSetPostInterpType +#undef HYPRE_BoomerAMGSetPrintFileName +#undef HYPRE_BoomerAMGSetPrintLevel +#undef HYPRE_BoomerAMGSetRAP2 +#undef HYPRE_BoomerAMGSetRedundant +#undef HYPRE_BoomerAMGSetRelaxOrder +#undef HYPRE_BoomerAMGSetRelaxType +#undef HYPRE_BoomerAMGSetRelaxWeight +#undef HYPRE_BoomerAMGSetRelaxWt +#undef HYPRE_BoomerAMGSetRestriction +#undef HYPRE_BoomerAMGSetSCommPkgSwitch +#undef HYPRE_BoomerAMGSetSabs +#undef HYPRE_BoomerAMGSetSchwarzRlxWeight +#undef HYPRE_BoomerAMGSetSchwarzUseNonSymm +#undef HYPRE_BoomerAMGSetSepWeight +#undef HYPRE_BoomerAMGSetSeqThreshold +#undef HYPRE_BoomerAMGSetSetupType +#undef HYPRE_BoomerAMGSetSimple +#undef HYPRE_BoomerAMGSetSmoothInterpVectors +#undef HYPRE_BoomerAMGSetSmoothNumLevels +#undef HYPRE_BoomerAMGSetSmoothNumSweeps +#undef HYPRE_BoomerAMGSetSmoothType +#undef HYPRE_BoomerAMGSetStrongThreshold +#undef HYPRE_BoomerAMGSetStrongThresholdR +#undef HYPRE_BoomerAMGSetSym +#undef HYPRE_BoomerAMGSetThreshold +#undef HYPRE_BoomerAMGSetTol +#undef HYPRE_BoomerAMGSetTruncFactor +#undef HYPRE_BoomerAMGSetVariant +#undef HYPRE_BoomerAMGSetup +#undef HYPRE_BoomerAMGSolve +#undef HYPRE_BoomerAMGSolveT +#undef HYPRE_EuclidCreate +#undef HYPRE_EuclidDestroy +#undef HYPRE_EuclidSetBJ +#undef HYPRE_EuclidSetILUT +#undef HYPRE_EuclidSetLevel +#undef HYPRE_EuclidSetMem +#undef HYPRE_EuclidSetParams +#undef HYPRE_EuclidSetParamsFromFile +#undef HYPRE_EuclidSetRowScale +#undef HYPRE_EuclidSetSparseA +#undef HYPRE_EuclidSetStats +#undef HYPRE_EuclidSetup +#undef HYPRE_EuclidSolve +#undef HYPRE_FSAICreate +#undef HYPRE_FSAIDestroy +#undef HYPRE_FSAIGetAlgoType +#undef HYPRE_FSAIGetEigMaxIters +#undef HYPRE_FSAIGetKapTolerance +#undef HYPRE_FSAIGetLocalSolveType +#undef HYPRE_FSAIGetMaxIterations +#undef HYPRE_FSAIGetMaxNnzRow +#undef HYPRE_FSAIGetMaxStepSize +#undef HYPRE_FSAIGetMaxSteps +#undef HYPRE_FSAIGetNumLevels +#undef HYPRE_FSAIGetOmega +#undef HYPRE_FSAIGetPrintLevel +#undef HYPRE_FSAIGetThreshold +#undef HYPRE_FSAIGetTolerance +#undef HYPRE_FSAIGetZeroGuess +#undef HYPRE_FSAISetAlgoType +#undef HYPRE_FSAISetEigMaxIters +#undef HYPRE_FSAISetKapTolerance +#undef HYPRE_FSAISetLocalSolveType +#undef HYPRE_FSAISetMaxIterations +#undef HYPRE_FSAISetMaxNnzRow +#undef HYPRE_FSAISetMaxStepSize +#undef HYPRE_FSAISetMaxSteps +#undef HYPRE_FSAISetNumLevels +#undef HYPRE_FSAISetOmega +#undef HYPRE_FSAISetPrintLevel +#undef HYPRE_FSAISetThreshold +#undef HYPRE_FSAISetTolerance +#undef HYPRE_FSAISetZeroGuess +#undef HYPRE_FSAISetup +#undef HYPRE_FSAISolve +#undef HYPRE_ILUCreate +#undef HYPRE_ILUDestroy +#undef HYPRE_ILUGetFinalRelativeResidualNorm +#undef HYPRE_ILUGetNumIterations +#undef HYPRE_ILUSetDropThreshold +#undef HYPRE_ILUSetDropThresholdArray +#undef HYPRE_ILUSetIterativeSetupMaxIter +#undef HYPRE_ILUSetIterativeSetupOption +#undef HYPRE_ILUSetIterativeSetupTolerance +#undef HYPRE_ILUSetIterativeSetupType +#undef HYPRE_ILUSetLevelOfFill +#undef HYPRE_ILUSetLocalReordering +#undef HYPRE_ILUSetLogging +#undef HYPRE_ILUSetLowerJacobiIters +#undef HYPRE_ILUSetMaxIter +#undef HYPRE_ILUSetMaxNnzPerRow +#undef HYPRE_ILUSetNSHDropThreshold +#undef HYPRE_ILUSetNSHDropThresholdArray +#undef HYPRE_ILUSetPrintLevel +#undef HYPRE_ILUSetSchurMaxIter +#undef HYPRE_ILUSetTol +#undef HYPRE_ILUSetTriSolve +#undef HYPRE_ILUSetType +#undef HYPRE_ILUSetUpperJacobiIters +#undef HYPRE_ILUSetup +#undef HYPRE_ILUSolve +#undef HYPRE_MGRBuildAff +#undef HYPRE_MGRCreate +#undef HYPRE_MGRDestroy +#undef HYPRE_MGRGetCoarseGridConvergenceFactor +#undef HYPRE_MGRGetFinalRelativeResidualNorm +#undef HYPRE_MGRGetNumIterations +#undef HYPRE_MGRSetBlockJacobiBlockSize +#undef HYPRE_MGRSetBlockSize +#undef HYPRE_MGRSetCoarseGridMethod +#undef HYPRE_MGRSetCoarseGridPrintLevel +#undef HYPRE_MGRSetCoarseSolver +#undef HYPRE_MGRSetCpointsByBlock +#undef HYPRE_MGRSetCpointsByContiguousBlock +#undef HYPRE_MGRSetCpointsByPointMarkerArray +#undef HYPRE_MGRSetFRelaxMethod +#undef HYPRE_MGRSetFSolver +#undef HYPRE_MGRSetFSolverAtLevel +#undef HYPRE_MGRSetFrelaxPrintLevel +#undef HYPRE_MGRSetGlobalSmoothCycle +#undef HYPRE_MGRSetGlobalSmoothType +#undef HYPRE_MGRSetGlobalSmootherAtLevel +#undef HYPRE_MGRSetInterpType +#undef HYPRE_MGRSetLevelFRelaxMethod +#undef HYPRE_MGRSetLevelFRelaxNumFunctions +#undef HYPRE_MGRSetLevelFRelaxType +#undef HYPRE_MGRSetLevelInterpType +#undef HYPRE_MGRSetLevelNonGalerkinMaxElmts +#undef HYPRE_MGRSetLevelNumRelaxSweeps +#undef HYPRE_MGRSetLevelPMaxElmts +#undef HYPRE_MGRSetLevelRestrictType +#undef HYPRE_MGRSetLevelSmoothIters +#undef HYPRE_MGRSetLevelSmoothType +#undef HYPRE_MGRSetLogging +#undef HYPRE_MGRSetMaxCoarseLevels +#undef HYPRE_MGRSetMaxGlobalSmoothIters +#undef HYPRE_MGRSetMaxIter +#undef HYPRE_MGRSetNonCpointsToFpoints +#undef HYPRE_MGRSetNonGalerkinMaxElmts +#undef HYPRE_MGRSetNumInterpSweeps +#undef HYPRE_MGRSetNumRelaxSweeps +#undef HYPRE_MGRSetNumRestrictSweeps +#undef HYPRE_MGRSetPMaxElmts +#undef HYPRE_MGRSetPrintLevel +#undef HYPRE_MGRSetRelaxType +#undef HYPRE_MGRSetReservedCoarseNodes +#undef HYPRE_MGRSetReservedCpointsLevelToKeep +#undef HYPRE_MGRSetRestrictType +#undef HYPRE_MGRSetTol +#undef HYPRE_MGRSetTruncateCoarseGridThreshold +#undef HYPRE_MGRSetup +#undef HYPRE_MGRSolve +#undef HYPRE_ParCSRBiCGSTABCreate +#undef HYPRE_ParCSRBiCGSTABDestroy +#undef HYPRE_ParCSRBiCGSTABGetFinalRelativeResidualNorm +#undef HYPRE_ParCSRBiCGSTABGetNumIterations +#undef HYPRE_ParCSRBiCGSTABGetPrecond +#undef HYPRE_ParCSRBiCGSTABGetResidual +#undef HYPRE_ParCSRBiCGSTABSetAbsoluteTol +#undef HYPRE_ParCSRBiCGSTABSetLogging +#undef HYPRE_ParCSRBiCGSTABSetMaxIter +#undef HYPRE_ParCSRBiCGSTABSetMinIter +#undef HYPRE_ParCSRBiCGSTABSetPrecond +#undef HYPRE_ParCSRBiCGSTABSetPrintLevel +#undef HYPRE_ParCSRBiCGSTABSetStopCrit +#undef HYPRE_ParCSRBiCGSTABSetTol +#undef HYPRE_ParCSRBiCGSTABSetup +#undef HYPRE_ParCSRBiCGSTABSolve +#undef HYPRE_ParCSRCGNRCreate +#undef HYPRE_ParCSRCGNRDestroy +#undef HYPRE_ParCSRCGNRGetFinalRelativeResidualNorm +#undef HYPRE_ParCSRCGNRGetNumIterations +#undef HYPRE_ParCSRCGNRGetPrecond +#undef HYPRE_ParCSRCGNRSetLogging +#undef HYPRE_ParCSRCGNRSetMaxIter +#undef HYPRE_ParCSRCGNRSetMinIter +#undef HYPRE_ParCSRCGNRSetPrecond +#undef HYPRE_ParCSRCGNRSetStopCrit +#undef HYPRE_ParCSRCGNRSetTol +#undef HYPRE_ParCSRCGNRSetup +#undef HYPRE_ParCSRCGNRSolve +#undef HYPRE_ParCSRCOGMRESCreate +#undef HYPRE_ParCSRCOGMRESDestroy +#undef HYPRE_ParCSRCOGMRESGetFinalRelativeResidualNorm +#undef HYPRE_ParCSRCOGMRESGetNumIterations +#undef HYPRE_ParCSRCOGMRESGetPrecond +#undef HYPRE_ParCSRCOGMRESGetResidual +#undef HYPRE_ParCSRCOGMRESSetAbsoluteTol +#undef HYPRE_ParCSRCOGMRESSetCGS +#undef HYPRE_ParCSRCOGMRESSetKDim +#undef HYPRE_ParCSRCOGMRESSetLogging +#undef HYPRE_ParCSRCOGMRESSetMaxIter +#undef HYPRE_ParCSRCOGMRESSetMinIter +#undef HYPRE_ParCSRCOGMRESSetPrecond +#undef HYPRE_ParCSRCOGMRESSetPrintLevel +#undef HYPRE_ParCSRCOGMRESSetTol +#undef HYPRE_ParCSRCOGMRESSetUnroll +#undef HYPRE_ParCSRCOGMRESSetup +#undef HYPRE_ParCSRCOGMRESSolve +#undef HYPRE_ParCSRDiagScale +#undef HYPRE_ParCSRDiagScaleSetup +#undef HYPRE_ParCSRFlexGMRESCreate +#undef HYPRE_ParCSRFlexGMRESDestroy +#undef HYPRE_ParCSRFlexGMRESGetFinalRelativeResidualNorm +#undef HYPRE_ParCSRFlexGMRESGetNumIterations +#undef HYPRE_ParCSRFlexGMRESGetPrecond +#undef HYPRE_ParCSRFlexGMRESGetResidual +#undef HYPRE_ParCSRFlexGMRESSetAbsoluteTol +#undef HYPRE_ParCSRFlexGMRESSetKDim +#undef HYPRE_ParCSRFlexGMRESSetLogging +#undef HYPRE_ParCSRFlexGMRESSetMaxIter +#undef HYPRE_ParCSRFlexGMRESSetMinIter +#undef HYPRE_ParCSRFlexGMRESSetModifyPC +#undef HYPRE_ParCSRFlexGMRESSetPrecond +#undef HYPRE_ParCSRFlexGMRESSetPrintLevel +#undef HYPRE_ParCSRFlexGMRESSetTol +#undef HYPRE_ParCSRFlexGMRESSetup +#undef HYPRE_ParCSRFlexGMRESSolve +#undef HYPRE_ParCSRGMRESCreate +#undef HYPRE_ParCSRGMRESDestroy +#undef HYPRE_ParCSRGMRESGetFinalRelativeResidualNorm +#undef HYPRE_ParCSRGMRESGetNumIterations +#undef HYPRE_ParCSRGMRESGetPrecond +#undef HYPRE_ParCSRGMRESGetRefSolution +#undef HYPRE_ParCSRGMRESGetResidual +#undef HYPRE_ParCSRGMRESSetAbsoluteTol +#undef HYPRE_ParCSRGMRESSetKDim +#undef HYPRE_ParCSRGMRESSetLogging +#undef HYPRE_ParCSRGMRESSetMaxIter +#undef HYPRE_ParCSRGMRESSetMinIter +#undef HYPRE_ParCSRGMRESSetPrecond +#undef HYPRE_ParCSRGMRESSetPrintLevel +#undef HYPRE_ParCSRGMRESSetRefSolution +#undef HYPRE_ParCSRGMRESSetStopCrit +#undef HYPRE_ParCSRGMRESSetTol +#undef HYPRE_ParCSRGMRESSetup +#undef HYPRE_ParCSRGMRESSolve +#undef HYPRE_ParCSRHybridCreate +#undef HYPRE_ParCSRHybridDestroy +#undef HYPRE_ParCSRHybridGetDSCGNumIterations +#undef HYPRE_ParCSRHybridGetFinalRelativeResidualNorm +#undef HYPRE_ParCSRHybridGetNumIterations +#undef HYPRE_ParCSRHybridGetPCGNumIterations +#undef HYPRE_ParCSRHybridGetRecomputeResidual +#undef HYPRE_ParCSRHybridGetRecomputeResidualP +#undef HYPRE_ParCSRHybridGetSetupSolveTime +#undef HYPRE_ParCSRHybridSetAbsoluteTol +#undef HYPRE_ParCSRHybridSetAggInterpType +#undef HYPRE_ParCSRHybridSetAggNumLevels +#undef HYPRE_ParCSRHybridSetCoarsenType +#undef HYPRE_ParCSRHybridSetConvergenceTol +#undef HYPRE_ParCSRHybridSetCycleNumSweeps +#undef HYPRE_ParCSRHybridSetCycleRelaxType +#undef HYPRE_ParCSRHybridSetCycleType +#undef HYPRE_ParCSRHybridSetDSCGMaxIter +#undef HYPRE_ParCSRHybridSetDofFunc +#undef HYPRE_ParCSRHybridSetGridRelaxPoints +#undef HYPRE_ParCSRHybridSetGridRelaxType +#undef HYPRE_ParCSRHybridSetInterpType +#undef HYPRE_ParCSRHybridSetKDim +#undef HYPRE_ParCSRHybridSetKeepTranspose +#undef HYPRE_ParCSRHybridSetLevelOuterWt +#undef HYPRE_ParCSRHybridSetLevelRelaxWt +#undef HYPRE_ParCSRHybridSetLogging +#undef HYPRE_ParCSRHybridSetMaxCoarseSize +#undef HYPRE_ParCSRHybridSetMaxLevels +#undef HYPRE_ParCSRHybridSetMaxRowSum +#undef HYPRE_ParCSRHybridSetMeasureType +#undef HYPRE_ParCSRHybridSetMinCoarseSize +#undef HYPRE_ParCSRHybridSetNodal +#undef HYPRE_ParCSRHybridSetNonGalerkinTol +#undef HYPRE_ParCSRHybridSetNumFunctions +#undef HYPRE_ParCSRHybridSetNumGridSweeps +#undef HYPRE_ParCSRHybridSetNumPaths +#undef HYPRE_ParCSRHybridSetNumSweeps +#undef HYPRE_ParCSRHybridSetOmega +#undef HYPRE_ParCSRHybridSetOuterWt +#undef HYPRE_ParCSRHybridSetPCGMaxIter +#undef HYPRE_ParCSRHybridSetPMaxElmts +#undef HYPRE_ParCSRHybridSetPrecond +#undef HYPRE_ParCSRHybridSetPrintLevel +#undef HYPRE_ParCSRHybridSetRecomputeResidual +#undef HYPRE_ParCSRHybridSetRecomputeResidualP +#undef HYPRE_ParCSRHybridSetRelChange +#undef HYPRE_ParCSRHybridSetRelaxOrder +#undef HYPRE_ParCSRHybridSetRelaxType +#undef HYPRE_ParCSRHybridSetRelaxWeight +#undef HYPRE_ParCSRHybridSetRelaxWt +#undef HYPRE_ParCSRHybridSetSeqThreshold +#undef HYPRE_ParCSRHybridSetSetupType +#undef HYPRE_ParCSRHybridSetSolverType +#undef HYPRE_ParCSRHybridSetStopCrit +#undef HYPRE_ParCSRHybridSetStrongThreshold +#undef HYPRE_ParCSRHybridSetTol +#undef HYPRE_ParCSRHybridSetTruncFactor +#undef HYPRE_ParCSRHybridSetTwoNorm +#undef HYPRE_ParCSRHybridSetup +#undef HYPRE_ParCSRHybridSolve +#undef HYPRE_ParCSRLGMRESCreate +#undef HYPRE_ParCSRLGMRESDestroy +#undef HYPRE_ParCSRLGMRESGetFinalRelativeResidualNorm +#undef HYPRE_ParCSRLGMRESGetNumIterations +#undef HYPRE_ParCSRLGMRESGetPrecond +#undef HYPRE_ParCSRLGMRESGetResidual +#undef HYPRE_ParCSRLGMRESSetAbsoluteTol +#undef HYPRE_ParCSRLGMRESSetAugDim +#undef HYPRE_ParCSRLGMRESSetKDim +#undef HYPRE_ParCSRLGMRESSetLogging +#undef HYPRE_ParCSRLGMRESSetMaxIter +#undef HYPRE_ParCSRLGMRESSetMinIter +#undef HYPRE_ParCSRLGMRESSetPrecond +#undef HYPRE_ParCSRLGMRESSetPrintLevel +#undef HYPRE_ParCSRLGMRESSetTol +#undef HYPRE_ParCSRLGMRESSetup +#undef HYPRE_ParCSRLGMRESSolve +#undef HYPRE_ParCSRMultiVectorPrint +#undef HYPRE_ParCSRMultiVectorRead +#undef HYPRE_ParCSROnProcTriSetup +#undef HYPRE_ParCSROnProcTriSolve +#undef HYPRE_ParCSRPCGCreate +#undef HYPRE_ParCSRPCGDestroy +#undef HYPRE_ParCSRPCGGetFinalRelativeResidualNorm +#undef HYPRE_ParCSRPCGGetNumIterations +#undef HYPRE_ParCSRPCGGetPrecond +#undef HYPRE_ParCSRPCGGetResidual +#undef HYPRE_ParCSRPCGSetAbsoluteTol +#undef HYPRE_ParCSRPCGSetLogging +#undef HYPRE_ParCSRPCGSetMaxIter +#undef HYPRE_ParCSRPCGSetPrecond +#undef HYPRE_ParCSRPCGSetPreconditioner +#undef HYPRE_ParCSRPCGSetPrintLevel +#undef HYPRE_ParCSRPCGSetRelChange +#undef HYPRE_ParCSRPCGSetStopCrit +#undef HYPRE_ParCSRPCGSetTol +#undef HYPRE_ParCSRPCGSetTwoNorm +#undef HYPRE_ParCSRPCGSetup +#undef HYPRE_ParCSRPCGSolve +#undef HYPRE_ParCSRParaSailsCreate +#undef HYPRE_ParCSRParaSailsDestroy +#undef HYPRE_ParCSRParaSailsGetFilter +#undef HYPRE_ParCSRParaSailsGetLoadbal +#undef HYPRE_ParCSRParaSailsSetFilter +#undef HYPRE_ParCSRParaSailsSetLoadbal +#undef HYPRE_ParCSRParaSailsSetLogging +#undef HYPRE_ParCSRParaSailsSetParams +#undef HYPRE_ParCSRParaSailsSetReuse +#undef HYPRE_ParCSRParaSailsSetSym +#undef HYPRE_ParCSRParaSailsSetup +#undef HYPRE_ParCSRParaSailsSolve +#undef HYPRE_ParCSRPilutCreate +#undef HYPRE_ParCSRPilutDestroy +#undef HYPRE_ParCSRPilutSetDropTolerance +#undef HYPRE_ParCSRPilutSetFactorRowSize +#undef HYPRE_ParCSRPilutSetLogging +#undef HYPRE_ParCSRPilutSetMaxIter +#undef HYPRE_ParCSRPilutSetup +#undef HYPRE_ParCSRPilutSolve +#undef HYPRE_ParCSRSetupInterpreter +#undef HYPRE_ParCSRSetupMatvec +#undef HYPRE_ParaSailsBuildIJMatrix +#undef HYPRE_ParaSailsCreate +#undef HYPRE_ParaSailsDestroy +#undef HYPRE_ParaSailsGetFilter +#undef HYPRE_ParaSailsGetLoadbal +#undef HYPRE_ParaSailsGetLogging +#undef HYPRE_ParaSailsGetNlevels +#undef HYPRE_ParaSailsGetReuse +#undef HYPRE_ParaSailsGetSym +#undef HYPRE_ParaSailsGetThresh +#undef HYPRE_ParaSailsSetFilter +#undef HYPRE_ParaSailsSetLoadbal +#undef HYPRE_ParaSailsSetLogging +#undef HYPRE_ParaSailsSetNlevels +#undef HYPRE_ParaSailsSetParams +#undef HYPRE_ParaSailsSetReuse +#undef HYPRE_ParaSailsSetSym +#undef HYPRE_ParaSailsSetThresh +#undef HYPRE_ParaSailsSetup +#undef HYPRE_ParaSailsSolve +#undef HYPRE_SchwarzCreate +#undef HYPRE_SchwarzDestroy +#undef HYPRE_SchwarzSetDofFunc +#undef HYPRE_SchwarzSetDomainStructure +#undef HYPRE_SchwarzSetDomainType +#undef HYPRE_SchwarzSetNonSymm +#undef HYPRE_SchwarzSetNumFunctions +#undef HYPRE_SchwarzSetOverlap +#undef HYPRE_SchwarzSetRelaxWeight +#undef HYPRE_SchwarzSetVariant +#undef HYPRE_SchwarzSetup +#undef HYPRE_SchwarzSolve +#undef HYPRE_TempParCSRSetupInterpreter +#undef GenerateDifConv +#undef GenerateLaplacian +#undef GenerateLaplacian27pt +#undef GenerateLaplacian9pt +#undef GenerateRSVarDifConv +#undef GenerateRotate7pt +#undef GenerateSysLaplacian +#undef GenerateSysLaplacianVCoef +#undef GenerateVarDifConv +#undef afun +#undef afun_rs +#undef aux_indexFromMask +#undef aux_maskCount +#undef bfun +#undef bfun_rs +#undef bndfun +#undef bndfun_rs +#undef cfun +#undef cfun_rs +#undef dfun +#undef dfun_rs +#undef efun +#undef efun_rs +#undef ffun +#undef ffun_rs +#undef gfun +#undef gfun_rs +#undef hypre_ADSComputePi +#undef hypre_ADSComputePixyz +#undef hypre_ADSCreate +#undef hypre_ADSDestroy +#undef hypre_ADSGetFinalRelativeResidualNorm +#undef hypre_ADSGetNumIterations +#undef hypre_ADSSetAMGOptions +#undef hypre_ADSSetAMSOptions +#undef hypre_ADSSetChebySmoothingOptions +#undef hypre_ADSSetCoordinateVectors +#undef hypre_ADSSetCycleType +#undef hypre_ADSSetDiscreteCurl +#undef hypre_ADSSetDiscreteGradient +#undef hypre_ADSSetInterpolations +#undef hypre_ADSSetMaxIter +#undef hypre_ADSSetPrintLevel +#undef hypre_ADSSetSmoothingOptions +#undef hypre_ADSSetTol +#undef hypre_ADSSetup +#undef hypre_ADSSolve +#undef hypre_AMECreate +#undef hypre_AMEDestroy +#undef hypre_AMEDiscrDivFreeComponent +#undef hypre_AMEGetEigenvalues +#undef hypre_AMEGetEigenvectors +#undef hypre_AMEMultiOperatorA +#undef hypre_AMEMultiOperatorB +#undef hypre_AMEMultiOperatorM +#undef hypre_AMEOperatorA +#undef hypre_AMEOperatorB +#undef hypre_AMEOperatorM +#undef hypre_AMESetAMSSolver +#undef hypre_AMESetBlockSize +#undef hypre_AMESetMassMatrix +#undef hypre_AMESetMaxIter +#undef hypre_AMESetMaxPCGIter +#undef hypre_AMESetPrintLevel +#undef hypre_AMESetRTol +#undef hypre_AMESetTol +#undef hypre_AMESetup +#undef hypre_AMESolve +#undef hypre_AMGCreateDomainDof +#undef hypre_AMGDDCommPkgCreate +#undef hypre_AMGDDCommPkgDestroy +#undef hypre_AMGDDCommPkgRecvLevelDestroy +#undef hypre_AMGDDCommPkgSendLevelDestroy +#undef hypre_AMGDDCompGridCreate +#undef hypre_AMGDDCompGridDestroy +#undef hypre_AMGDDCompGridFinalize +#undef hypre_AMGDDCompGridInitialize +#undef hypre_AMGDDCompGridLocalIndexBinarySearch +#undef hypre_AMGDDCompGridMatrixCreate +#undef hypre_AMGDDCompGridMatrixDestroy +#undef hypre_AMGDDCompGridMatrixSetupRealMatvec +#undef hypre_AMGDDCompGridMatvec +#undef hypre_AMGDDCompGridRealMatvec +#undef hypre_AMGDDCompGridResize +#undef hypre_AMGDDCompGridSetupLocalIndices +#undef hypre_AMGDDCompGridSetupLocalIndicesP +#undef hypre_AMGDDCompGridSetupRelax +#undef hypre_AMGDDCompGridVectorAxpy +#undef hypre_AMGDDCompGridVectorCopy +#undef hypre_AMGDDCompGridVectorCreate +#undef hypre_AMGDDCompGridVectorDestroy +#undef hypre_AMGDDCompGridVectorInitialize +#undef hypre_AMGDDCompGridVectorInnerProd +#undef hypre_AMGDDCompGridVectorRealAxpy +#undef hypre_AMGDDCompGridVectorRealCopy +#undef hypre_AMGDDCompGridVectorRealInnerProd +#undef hypre_AMGDDCompGridVectorRealScale +#undef hypre_AMGDDCompGridVectorRealSetConstantValues +#undef hypre_AMGDDCompGridVectorScale +#undef hypre_AMGDDCompGridVectorSetConstantValues +#undef hypre_AMGHybridCreate +#undef hypre_AMGHybridDestroy +#undef hypre_AMGHybridGetDSCGNumIterations +#undef hypre_AMGHybridGetFinalRelativeResidualNorm +#undef hypre_AMGHybridGetNumIterations +#undef hypre_AMGHybridGetPCGNumIterations +#undef hypre_AMGHybridGetRecomputeResidual +#undef hypre_AMGHybridGetRecomputeResidualP +#undef hypre_AMGHybridGetSetupSolveTime +#undef hypre_AMGHybridSetAbsoluteTol +#undef hypre_AMGHybridSetAggInterpType +#undef hypre_AMGHybridSetAggNumLevels +#undef hypre_AMGHybridSetCoarsenType +#undef hypre_AMGHybridSetConvergenceTol +#undef hypre_AMGHybridSetCycleNumSweeps +#undef hypre_AMGHybridSetCycleRelaxType +#undef hypre_AMGHybridSetCycleType +#undef hypre_AMGHybridSetDSCGMaxIter +#undef hypre_AMGHybridSetDofFunc +#undef hypre_AMGHybridSetGridRelaxPoints +#undef hypre_AMGHybridSetGridRelaxType +#undef hypre_AMGHybridSetInterpType +#undef hypre_AMGHybridSetKDim +#undef hypre_AMGHybridSetKeepTranspose +#undef hypre_AMGHybridSetLevelOuterWt +#undef hypre_AMGHybridSetLevelRelaxWt +#undef hypre_AMGHybridSetLogging +#undef hypre_AMGHybridSetMaxCoarseSize +#undef hypre_AMGHybridSetMaxLevels +#undef hypre_AMGHybridSetMaxRowSum +#undef hypre_AMGHybridSetMeasureType +#undef hypre_AMGHybridSetMinCoarseSize +#undef hypre_AMGHybridSetNodal +#undef hypre_AMGHybridSetNonGalerkinTol +#undef hypre_AMGHybridSetNumFunctions +#undef hypre_AMGHybridSetNumGridSweeps +#undef hypre_AMGHybridSetNumPaths +#undef hypre_AMGHybridSetNumSweeps +#undef hypre_AMGHybridSetOmega +#undef hypre_AMGHybridSetOuterWt +#undef hypre_AMGHybridSetPCGMaxIter +#undef hypre_AMGHybridSetPMaxElmts +#undef hypre_AMGHybridSetPrecond +#undef hypre_AMGHybridSetPrintLevel +#undef hypre_AMGHybridSetRecomputeResidual +#undef hypre_AMGHybridSetRecomputeResidualP +#undef hypre_AMGHybridSetRelChange +#undef hypre_AMGHybridSetRelaxOrder +#undef hypre_AMGHybridSetRelaxType +#undef hypre_AMGHybridSetRelaxWeight +#undef hypre_AMGHybridSetRelaxWt +#undef hypre_AMGHybridSetSeqThreshold +#undef hypre_AMGHybridSetSetupType +#undef hypre_AMGHybridSetSolverType +#undef hypre_AMGHybridSetStopCrit +#undef hypre_AMGHybridSetStrongThreshold +#undef hypre_AMGHybridSetTol +#undef hypre_AMGHybridSetTruncFactor +#undef hypre_AMGHybridSetTwoNorm +#undef hypre_AMGHybridSetup +#undef hypre_AMGHybridSolve +#undef hypre_AMGNodalSchwarzSmoother +#undef hypre_AMGeAgglomerate +#undef hypre_AMSComputeGPi +#undef hypre_AMSComputePi +#undef hypre_AMSComputePixyz +#undef hypre_AMSConstructDiscreteGradient +#undef hypre_AMSCreate +#undef hypre_AMSDestroy +#undef hypre_AMSFEIDestroy +#undef hypre_AMSFEISetup +#undef hypre_AMSGetFinalRelativeResidualNorm +#undef hypre_AMSGetNumIterations +#undef hypre_AMSProjectOutGradients +#undef hypre_AMSSetAlphaAMGCoarseRelaxType +#undef hypre_AMSSetAlphaAMGOptions +#undef hypre_AMSSetAlphaPoissonMatrix +#undef hypre_AMSSetBetaAMGCoarseRelaxType +#undef hypre_AMSSetBetaAMGOptions +#undef hypre_AMSSetBetaPoissonMatrix +#undef hypre_AMSSetChebySmoothingOptions +#undef hypre_AMSSetCoordinateVectors +#undef hypre_AMSSetCycleType +#undef hypre_AMSSetDimension +#undef hypre_AMSSetDiscreteGradient +#undef hypre_AMSSetEdgeConstantVectors +#undef hypre_AMSSetInteriorNodes +#undef hypre_AMSSetInterpolations +#undef hypre_AMSSetMaxIter +#undef hypre_AMSSetPrintLevel +#undef hypre_AMSSetProjectionFrequency +#undef hypre_AMSSetSmoothingOptions +#undef hypre_AMSSetTol +#undef hypre_AMSSetup +#undef hypre_AMSSolve +#undef hypre_AdSchwarzCFSolve +#undef hypre_AdSchwarzSolve +#undef hypre_AddToPattern +#undef hypre_AmgCGCBoundaryFix +#undef hypre_AmgCGCChoose +#undef hypre_AmgCGCGraphAssemble +#undef hypre_AmgCGCPrepare +#undef hypre_Bisection +#undef hypre_BlockDiagInvLapack +#undef hypre_BlockTridiagCreate +#undef hypre_BlockTridiagDestroy +#undef hypre_BlockTridiagSetAMGNumSweeps +#undef hypre_BlockTridiagSetAMGRelaxType +#undef hypre_BlockTridiagSetAMGStrengthThreshold +#undef hypre_BlockTridiagSetIndexSet +#undef hypre_BlockTridiagSetPrintLevel +#undef hypre_BlockTridiagSetup +#undef hypre_BlockTridiagSolve +#undef hypre_BoomerAMGAdditiveCycle +#undef hypre_BoomerAMGBlockSolve +#undef hypre_BoomerAMGBuildCoarseOperator +#undef hypre_BoomerAMGBuildCoarseOperatorKT +#undef hypre_BoomerAMGBuildDirInterp +#undef hypre_BoomerAMGBuildDirInterpHost +#undef hypre_BoomerAMGBuildExtInterp +#undef hypre_BoomerAMGBuildExtInterpHost +#undef hypre_BoomerAMGBuildExtPICCInterp +#undef hypre_BoomerAMGBuildExtPIInterp +#undef hypre_BoomerAMGBuildExtPIInterpHost +#undef hypre_BoomerAMGBuildFF1Interp +#undef hypre_BoomerAMGBuildFFInterp +#undef hypre_BoomerAMGBuildInterp +#undef hypre_BoomerAMGBuildInterpGSMG +#undef hypre_BoomerAMGBuildInterpHE +#undef hypre_BoomerAMGBuildInterpLS +#undef hypre_BoomerAMGBuildInterpModUnk +#undef hypre_BoomerAMGBuildInterpOnePnt +#undef hypre_BoomerAMGBuildInterpOnePntHost +#undef hypre_BoomerAMGBuildModExtInterp +#undef hypre_BoomerAMGBuildModExtInterpHost +#undef hypre_BoomerAMGBuildModExtPEInterp +#undef hypre_BoomerAMGBuildModExtPEInterpHost +#undef hypre_BoomerAMGBuildModExtPIInterp +#undef hypre_BoomerAMGBuildModExtPIInterpHost +#undef hypre_BoomerAMGBuildModMultipass +#undef hypre_BoomerAMGBuildModMultipassHost +#undef hypre_BoomerAMGBuildModPartialExtInterp +#undef hypre_BoomerAMGBuildModPartialExtInterpHost +#undef hypre_BoomerAMGBuildModPartialExtPEInterp +#undef hypre_BoomerAMGBuildModPartialExtPEInterpHost +#undef hypre_BoomerAMGBuildMultipass +#undef hypre_BoomerAMGBuildMultipassHost +#undef hypre_BoomerAMGBuildNonGalerkinCoarseOperator +#undef hypre_BoomerAMGBuildPartialExtInterp +#undef hypre_BoomerAMGBuildPartialExtPIInterp +#undef hypre_BoomerAMGBuildPartialStdInterp +#undef hypre_BoomerAMGBuildRestrAIR +#undef hypre_BoomerAMGBuildRestrDist2AIR +#undef hypre_BoomerAMGBuildRestrNeumannAIR +#undef hypre_BoomerAMGBuildRestrNeumannAIRHost +#undef hypre_BoomerAMGBuildStdInterp +#undef hypre_BoomerAMGCGRelaxWt +#undef hypre_BoomerAMGCoarseParms +#undef hypre_BoomerAMGCoarseParmsHost +#undef hypre_BoomerAMGCoarsen +#undef hypre_BoomerAMGCoarsenCGC +#undef hypre_BoomerAMGCoarsenCGCb +#undef hypre_BoomerAMGCoarsenCR +#undef hypre_BoomerAMGCoarsenCR1 +#undef hypre_BoomerAMGCoarsenFalgout +#undef hypre_BoomerAMGCoarsenHMIS +#undef hypre_BoomerAMGCoarsenInterpVectors +#undef hypre_BoomerAMGCoarsenPMIS +#undef hypre_BoomerAMGCoarsenPMISHost +#undef hypre_BoomerAMGCoarsenRuge +#undef hypre_BoomerAMGCorrectCFMarker +#undef hypre_BoomerAMGCorrectCFMarker2 +#undef hypre_BoomerAMGCorrectCFMarker2Host +#undef hypre_BoomerAMGCorrectCFMarkerHost +#undef hypre_BoomerAMGCreate +#undef hypre_BoomerAMGCreate2ndS +#undef hypre_BoomerAMGCreate2ndSHost +#undef hypre_BoomerAMGCreateNodalA +#undef hypre_BoomerAMGCreateS +#undef hypre_BoomerAMGCreateSCommPkg +#undef hypre_BoomerAMGCreateSFromCFMarker +#undef hypre_BoomerAMGCreateSHost +#undef hypre_BoomerAMGCreateSabs +#undef hypre_BoomerAMGCreateSabsHost +#undef hypre_BoomerAMGCreateScalarCF +#undef hypre_BoomerAMGCreateScalarCFS +#undef hypre_BoomerAMGCreateSmoothDirs +#undef hypre_BoomerAMGCreateSmoothVecs +#undef hypre_BoomerAMGCycle +#undef hypre_BoomerAMGCycleT +#undef hypre_BoomerAMGDDCreate +#undef hypre_BoomerAMGDDDestroy +#undef hypre_BoomerAMGDDGetAMG +#undef hypre_BoomerAMGDDGetFACCycleType +#undef hypre_BoomerAMGDDGetFACNumCycles +#undef hypre_BoomerAMGDDGetFACNumRelax +#undef hypre_BoomerAMGDDGetFACRelaxType +#undef hypre_BoomerAMGDDGetFACRelaxWeight +#undef hypre_BoomerAMGDDGetNumGhostLayers +#undef hypre_BoomerAMGDDGetPadding +#undef hypre_BoomerAMGDDGetStartLevel +#undef hypre_BoomerAMGDDSetFACCycleType +#undef hypre_BoomerAMGDDSetFACNumCycles +#undef hypre_BoomerAMGDDSetFACNumRelax +#undef hypre_BoomerAMGDDSetFACRelaxType +#undef hypre_BoomerAMGDDSetFACRelaxWeight +#undef hypre_BoomerAMGDDSetNumGhostLayers +#undef hypre_BoomerAMGDDSetPadding +#undef hypre_BoomerAMGDDSetStartLevel +#undef hypre_BoomerAMGDDSetUserFACRelaxation +#undef hypre_BoomerAMGDDSetup +#undef hypre_BoomerAMGDDSolve +#undef hypre_BoomerAMGDD_AddFlagToSendFlag +#undef hypre_BoomerAMGDD_AddToSendAndRequestDofs +#undef hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo +#undef hypre_BoomerAMGDD_FAC +#undef hypre_BoomerAMGDD_FAC_CFL1Jacobi +#undef hypre_BoomerAMGDD_FAC_CFL1JacobiHost +#undef hypre_BoomerAMGDD_FAC_Cycle +#undef hypre_BoomerAMGDD_FAC_FCycle +#undef hypre_BoomerAMGDD_FAC_GaussSeidel +#undef hypre_BoomerAMGDD_FAC_Interpolate +#undef hypre_BoomerAMGDD_FAC_Jacobi +#undef hypre_BoomerAMGDD_FAC_JacobiHost +#undef hypre_BoomerAMGDD_FAC_OrderedGaussSeidel +#undef hypre_BoomerAMGDD_FAC_Relax +#undef hypre_BoomerAMGDD_FAC_Restrict +#undef hypre_BoomerAMGDD_FindNeighborProcessors +#undef hypre_BoomerAMGDD_FixUpRecvMaps +#undef hypre_BoomerAMGDD_GetDofRecvProc +#undef hypre_BoomerAMGDD_LocalToGlobalIndex +#undef hypre_BoomerAMGDD_MarkCoarse +#undef hypre_BoomerAMGDD_PackColInd +#undef hypre_BoomerAMGDD_PackRecvMapSendBuffer +#undef hypre_BoomerAMGDD_PackResidualBuffer +#undef hypre_BoomerAMGDD_PackSendBuffer +#undef hypre_BoomerAMGDD_RecursivelyBuildPsiComposite +#undef hypre_BoomerAMGDD_RecursivelyFindNeighborNodes +#undef hypre_BoomerAMGDD_RemoveRedundancy +#undef hypre_BoomerAMGDD_ResidualCommunication +#undef hypre_BoomerAMGDD_SetupNearestProcessorNeighbors +#undef hypre_BoomerAMGDD_SubtractLists +#undef hypre_BoomerAMGDD_UnpackRecvBuffer +#undef hypre_BoomerAMGDD_UnpackResidualBuffer +#undef hypre_BoomerAMGDD_UnpackSendFlagBuffer +#undef hypre_BoomerAMGDestroy +#undef hypre_BoomerAMGFitVectors +#undef hypre_BoomerAMGGetAdditive +#undef hypre_BoomerAMGGetAggProlongationName +#undef hypre_BoomerAMGGetCoarsenCutFactor +#undef hypre_BoomerAMGGetCoarsenType +#undef hypre_BoomerAMGGetCoarseningName +#undef hypre_BoomerAMGGetConvergeType +#undef hypre_BoomerAMGGetCumNnzAP +#undef hypre_BoomerAMGGetCumNumIterations +#undef hypre_BoomerAMGGetCycleName +#undef hypre_BoomerAMGGetCycleNumSweeps +#undef hypre_BoomerAMGGetCycleRelaxType +#undef hypre_BoomerAMGGetCycleType +#undef hypre_BoomerAMGGetDebugFlag +#undef hypre_BoomerAMGGetDomainType +#undef hypre_BoomerAMGGetFCycle +#undef hypre_BoomerAMGGetFilterFunctions +#undef hypre_BoomerAMGGetFilterThresholdR +#undef hypre_BoomerAMGGetGridHierarchy +#undef hypre_BoomerAMGGetGridRelaxPoints +#undef hypre_BoomerAMGGetGridRelaxType +#undef hypre_BoomerAMGGetInterpType +#undef hypre_BoomerAMGGetJacobiTruncThreshold +#undef hypre_BoomerAMGGetLevelOuterWt +#undef hypre_BoomerAMGGetLevelRelaxWt +#undef hypre_BoomerAMGGetLogging +#undef hypre_BoomerAMGGetMaxCoarseSize +#undef hypre_BoomerAMGGetMaxIter +#undef hypre_BoomerAMGGetMaxLevels +#undef hypre_BoomerAMGGetMaxRowSum +#undef hypre_BoomerAMGGetMeasureType +#undef hypre_BoomerAMGGetMinCoarseSize +#undef hypre_BoomerAMGGetMinIter +#undef hypre_BoomerAMGGetMultAdditive +#undef hypre_BoomerAMGGetNumFunctions +#undef hypre_BoomerAMGGetNumGridSweeps +#undef hypre_BoomerAMGGetNumIterations +#undef hypre_BoomerAMGGetOmega +#undef hypre_BoomerAMGGetOverlap +#undef hypre_BoomerAMGGetPMaxElmts +#undef hypre_BoomerAMGGetPostInterpType +#undef hypre_BoomerAMGGetPrintFileName +#undef hypre_BoomerAMGGetPrintLevel +#undef hypre_BoomerAMGGetProlongationName +#undef hypre_BoomerAMGGetRedundant +#undef hypre_BoomerAMGGetRelResidualNorm +#undef hypre_BoomerAMGGetRelaxOrder +#undef hypre_BoomerAMGGetRelaxWeight +#undef hypre_BoomerAMGGetResidual +#undef hypre_BoomerAMGGetSchwarzRlxWeight +#undef hypre_BoomerAMGGetSeqThreshold +#undef hypre_BoomerAMGGetSetupType +#undef hypre_BoomerAMGGetSimple +#undef hypre_BoomerAMGGetSmoothNumLevels +#undef hypre_BoomerAMGGetSmoothNumSweeps +#undef hypre_BoomerAMGGetSmoothType +#undef hypre_BoomerAMGGetStrongThreshold +#undef hypre_BoomerAMGGetStrongThresholdR +#undef hypre_BoomerAMGGetTol +#undef hypre_BoomerAMGGetTruncFactor +#undef hypre_BoomerAMGGetVariant +#undef hypre_BoomerAMGIndepHMIS +#undef hypre_BoomerAMGIndepHMISa +#undef hypre_BoomerAMGIndepPMIS +#undef hypre_BoomerAMGIndepPMISa +#undef hypre_BoomerAMGIndepRS +#undef hypre_BoomerAMGIndepRSa +#undef hypre_BoomerAMGIndepSet +#undef hypre_BoomerAMGIndepSetInit +#undef hypre_BoomerAMGInterpTruncation +#undef hypre_BoomerAMGJacobiInterp +#undef hypre_BoomerAMGJacobiInterp_1 +#undef hypre_BoomerAMGNormalizeVecs +#undef hypre_BoomerAMGPrintGeneralInfo +#undef hypre_BoomerAMGRefineInterp +#undef hypre_BoomerAMGRelax +#undef hypre_BoomerAMGRelax0WeightedJacobi +#undef hypre_BoomerAMGRelax10TopoOrderedGaussSeidel +#undef hypre_BoomerAMGRelax11TwoStageGaussSeidel +#undef hypre_BoomerAMGRelax12TwoStageGaussSeidel +#undef hypre_BoomerAMGRelax13HybridL1GaussSeidel +#undef hypre_BoomerAMGRelax14HybridL1GaussSeidel +#undef hypre_BoomerAMGRelax18WeightedL1Jacobi +#undef hypre_BoomerAMGRelax1GaussSeidel +#undef hypre_BoomerAMGRelax2GaussSeidel +#undef hypre_BoomerAMGRelax3HybridGaussSeidel +#undef hypre_BoomerAMGRelax4HybridGaussSeidel +#undef hypre_BoomerAMGRelax5ChaoticHybridGaussSeidel +#undef hypre_BoomerAMGRelax6HybridSSOR +#undef hypre_BoomerAMGRelax7Jacobi +#undef hypre_BoomerAMGRelax89HybridL1SSOR +#undef hypre_BoomerAMGRelax8HybridL1SSOR +#undef hypre_BoomerAMGRelaxComputeL1Norms +#undef hypre_BoomerAMGRelaxHybridGaussSeidel_core +#undef hypre_BoomerAMGRelaxHybridSOR +#undef hypre_BoomerAMGRelaxIF +#undef hypre_BoomerAMGRelaxKaczmarz +#undef hypre_BoomerAMGRelaxT +#undef hypre_BoomerAMGRelaxTwoStageGaussSeidelHost +#undef hypre_BoomerAMGRelaxWeightedJacobi_core +#undef hypre_BoomerAMGRelax_FCFJacobi +#undef hypre_BoomerAMGSetADropTol +#undef hypre_BoomerAMGSetADropType +#undef hypre_BoomerAMGSetAddLastLvl +#undef hypre_BoomerAMGSetAddRelaxType +#undef hypre_BoomerAMGSetAddRelaxWt +#undef hypre_BoomerAMGSetAdditive +#undef hypre_BoomerAMGSetAggInterpType +#undef hypre_BoomerAMGSetAggNumLevels +#undef hypre_BoomerAMGSetAggP12MaxElmts +#undef hypre_BoomerAMGSetAggP12TruncFactor +#undef hypre_BoomerAMGSetAggPMaxElmts +#undef hypre_BoomerAMGSetAggTruncFactor +#undef hypre_BoomerAMGSetCGCIts +#undef hypre_BoomerAMGSetCPoints +#undef hypre_BoomerAMGSetCRRate +#undef hypre_BoomerAMGSetCRStrongTh +#undef hypre_BoomerAMGSetCRUseCG +#undef hypre_BoomerAMGSetChebyEigEst +#undef hypre_BoomerAMGSetChebyFraction +#undef hypre_BoomerAMGSetChebyOrder +#undef hypre_BoomerAMGSetChebyScale +#undef hypre_BoomerAMGSetChebyVariant +#undef hypre_BoomerAMGSetCoarsenCutFactor +#undef hypre_BoomerAMGSetCoarsenType +#undef hypre_BoomerAMGSetConvergeType +#undef hypre_BoomerAMGSetCoordDim +#undef hypre_BoomerAMGSetCoordinates +#undef hypre_BoomerAMGSetCumNnzAP +#undef hypre_BoomerAMGSetCycleNumSweeps +#undef hypre_BoomerAMGSetCycleRelaxType +#undef hypre_BoomerAMGSetCycleType +#undef hypre_BoomerAMGSetDebugFlag +#undef hypre_BoomerAMGSetDofFunc +#undef hypre_BoomerAMGSetDofPoint +#undef hypre_BoomerAMGSetDomainType +#undef hypre_BoomerAMGSetDropTol +#undef hypre_BoomerAMGSetEuBJ +#undef hypre_BoomerAMGSetEuLevel +#undef hypre_BoomerAMGSetEuSparseA +#undef hypre_BoomerAMGSetEuclidFile +#undef hypre_BoomerAMGSetFCycle +#undef hypre_BoomerAMGSetFPoints +#undef hypre_BoomerAMGSetFSAIAlgoType +#undef hypre_BoomerAMGSetFSAIEigMaxIters +#undef hypre_BoomerAMGSetFSAIKapTolerance +#undef hypre_BoomerAMGSetFSAILocalSolveType +#undef hypre_BoomerAMGSetFSAIMaxNnzRow +#undef hypre_BoomerAMGSetFSAIMaxStepSize +#undef hypre_BoomerAMGSetFSAIMaxSteps +#undef hypre_BoomerAMGSetFSAINumLevels +#undef hypre_BoomerAMGSetFSAIThreshold +#undef hypre_BoomerAMGSetFilter +#undef hypre_BoomerAMGSetFilterFunctions +#undef hypre_BoomerAMGSetFilterThresholdR +#undef hypre_BoomerAMGSetGMRESSwitchR +#undef hypre_BoomerAMGSetGSMG +#undef hypre_BoomerAMGSetGridRelaxPoints +#undef hypre_BoomerAMGSetGridRelaxType +#undef hypre_BoomerAMGSetILUDroptol +#undef hypre_BoomerAMGSetILUIterSetupMaxIter +#undef hypre_BoomerAMGSetILUIterSetupOption +#undef hypre_BoomerAMGSetILUIterSetupTolerance +#undef hypre_BoomerAMGSetILUIterSetupType +#undef hypre_BoomerAMGSetILULevel +#undef hypre_BoomerAMGSetILULocalReordering +#undef hypre_BoomerAMGSetILULowerJacobiIters +#undef hypre_BoomerAMGSetILUMaxIter +#undef hypre_BoomerAMGSetILUMaxRowNnz +#undef hypre_BoomerAMGSetILUTriSolve +#undef hypre_BoomerAMGSetILUType +#undef hypre_BoomerAMGSetILUUpperJacobiIters +#undef hypre_BoomerAMGSetISType +#undef hypre_BoomerAMGSetInterpRefine +#undef hypre_BoomerAMGSetInterpType +#undef hypre_BoomerAMGSetInterpVecAbsQTrunc +#undef hypre_BoomerAMGSetInterpVecFirstLevel +#undef hypre_BoomerAMGSetInterpVecQMax +#undef hypre_BoomerAMGSetInterpVecVariant +#undef hypre_BoomerAMGSetInterpVectors +#undef hypre_BoomerAMGSetIsTriangular +#undef hypre_BoomerAMGSetJacobiTruncThreshold +#undef hypre_BoomerAMGSetKeepSameSign +#undef hypre_BoomerAMGSetKeepTranspose +#undef hypre_BoomerAMGSetLevel +#undef hypre_BoomerAMGSetLevelNonGalerkinTol +#undef hypre_BoomerAMGSetLevelOuterWt +#undef hypre_BoomerAMGSetLevelRelaxWt +#undef hypre_BoomerAMGSetLogging +#undef hypre_BoomerAMGSetMaxCoarseSize +#undef hypre_BoomerAMGSetMaxIter +#undef hypre_BoomerAMGSetMaxLevels +#undef hypre_BoomerAMGSetMaxNzPerRow +#undef hypre_BoomerAMGSetMaxRowSum +#undef hypre_BoomerAMGSetMeasureType +#undef hypre_BoomerAMGSetMinCoarseSize +#undef hypre_BoomerAMGSetMinIter +#undef hypre_BoomerAMGSetModuleRAP2 +#undef hypre_BoomerAMGSetMultAddPMaxElmts +#undef hypre_BoomerAMGSetMultAddTruncFactor +#undef hypre_BoomerAMGSetMultAdditive +#undef hypre_BoomerAMGSetNodal +#undef hypre_BoomerAMGSetNodalDiag +#undef hypre_BoomerAMGSetNodalLevels +#undef hypre_BoomerAMGSetNonGalerkTol +#undef hypre_BoomerAMGSetNonGalerkinTol +#undef hypre_BoomerAMGSetNumCRRelaxSteps +#undef hypre_BoomerAMGSetNumFunctions +#undef hypre_BoomerAMGSetNumGridSweeps +#undef hypre_BoomerAMGSetNumIterations +#undef hypre_BoomerAMGSetNumPaths +#undef hypre_BoomerAMGSetNumPoints +#undef hypre_BoomerAMGSetNumSamples +#undef hypre_BoomerAMGSetNumSweeps +#undef hypre_BoomerAMGSetOmega +#undef hypre_BoomerAMGSetOuterWt +#undef hypre_BoomerAMGSetOverlap +#undef hypre_BoomerAMGSetPMaxElmts +#undef hypre_BoomerAMGSetPlotFileName +#undef hypre_BoomerAMGSetPlotGrids +#undef hypre_BoomerAMGSetPointDofMap +#undef hypre_BoomerAMGSetPostInterpType +#undef hypre_BoomerAMGSetPrintFileName +#undef hypre_BoomerAMGSetPrintLevel +#undef hypre_BoomerAMGSetRAP2 +#undef hypre_BoomerAMGSetRedundant +#undef hypre_BoomerAMGSetRelaxOrder +#undef hypre_BoomerAMGSetRelaxType +#undef hypre_BoomerAMGSetRelaxWeight +#undef hypre_BoomerAMGSetRelaxWt +#undef hypre_BoomerAMGSetRestriction +#undef hypre_BoomerAMGSetSabs +#undef hypre_BoomerAMGSetSchwarzRlxWeight +#undef hypre_BoomerAMGSetSchwarzUseNonSymm +#undef hypre_BoomerAMGSetSepWeight +#undef hypre_BoomerAMGSetSeqThreshold +#undef hypre_BoomerAMGSetSetupType +#undef hypre_BoomerAMGSetSimple +#undef hypre_BoomerAMGSetSmoothInterpVectors +#undef hypre_BoomerAMGSetSmoothNumLevels +#undef hypre_BoomerAMGSetSmoothNumSweeps +#undef hypre_BoomerAMGSetSmoothType +#undef hypre_BoomerAMGSetStrongThreshold +#undef hypre_BoomerAMGSetStrongThresholdR +#undef hypre_BoomerAMGSetSym +#undef hypre_BoomerAMGSetThreshold +#undef hypre_BoomerAMGSetTol +#undef hypre_BoomerAMGSetTruncFactor +#undef hypre_BoomerAMGSetVariant +#undef hypre_BoomerAMGSetup +#undef hypre_BoomerAMGSetupStats +#undef hypre_BoomerAMGSmoothInterpVectors +#undef hypre_BoomerAMGSolve +#undef hypre_BoomerAMGSolveT +#undef hypre_BoomerAMGTruncandBuild +#undef hypre_BoomerAMGTruncateInterp +#undef hypre_BoomerAMGWriteSolverParams +#undef hypre_BoomerAMG_GMExpandInterp +#undef hypre_BoomerAMG_LNExpandInterp +#undef hypre_BoomerAMG_MyCreateS +#undef hypre_CSRMatrixDropInplace +#undef hypre_CSRMatrixExtractDenseMat +#undef hypre_CSRMatrixExtractDenseRow +#undef hypre_CSRMatrixNormFro +#undef hypre_CSRMatrixResNormFro +#undef hypre_CSRMatrixTrace +#undef hypre_CreateC +#undef hypre_CreateDinv +#undef hypre_CreateLambda +#undef hypre_DenseSPDSystemSolve +#undef hypre_ExtendWtoPHost +#undef hypre_FSAIApply +#undef hypre_FSAIComputeOmega +#undef hypre_FSAICreate +#undef hypre_FSAIDestroy +#undef hypre_FSAIDumpLocalLSDense +#undef hypre_FSAIGetAlgoType +#undef hypre_FSAIGetEigMaxIters +#undef hypre_FSAIGetKapTolerance +#undef hypre_FSAIGetLocalSolveType +#undef hypre_FSAIGetLogging +#undef hypre_FSAIGetMaxIterations +#undef hypre_FSAIGetMaxNnzRow +#undef hypre_FSAIGetMaxStepSize +#undef hypre_FSAIGetMaxSteps +#undef hypre_FSAIGetNumIterations +#undef hypre_FSAIGetNumLevels +#undef hypre_FSAIGetOmega +#undef hypre_FSAIGetPrintLevel +#undef hypre_FSAIGetThreshold +#undef hypre_FSAIGetTolerance +#undef hypre_FSAIGetZeroGuess +#undef hypre_FSAIPrintStats +#undef hypre_FSAISetAlgoType +#undef hypre_FSAISetEigMaxIters +#undef hypre_FSAISetKapTolerance +#undef hypre_FSAISetLocalSolveType +#undef hypre_FSAISetLogging +#undef hypre_FSAISetMaxIterations +#undef hypre_FSAISetMaxNnzRow +#undef hypre_FSAISetMaxStepSize +#undef hypre_FSAISetMaxSteps +#undef hypre_FSAISetNumIterations +#undef hypre_FSAISetNumLevels +#undef hypre_FSAISetOmega +#undef hypre_FSAISetPrintLevel +#undef hypre_FSAISetThreshold +#undef hypre_FSAISetTolerance +#undef hypre_FSAISetZeroGuess +#undef hypre_FSAISetup +#undef hypre_FSAISetupNative +#undef hypre_FSAISetupOMPDyn +#undef hypre_FSAISolve +#undef hypre_FindKapGrad +#undef hypre_GaussElimSetup +#undef hypre_GaussElimSolve +#undef hypre_GenerateCoordinates +#undef hypre_GenerateMultiPi +#undef hypre_GenerateMultipassPi +#undef hypre_GenerateScale +#undef hypre_GenerateSendMapAndCommPkg +#undef hypre_GenerateSubComm +#undef hypre_GetCommPkgRTFromCommPkgA +#undef hypre_GrabSubArray +#undef hypre_GraphAdd +#undef hypre_GraphRemove +#undef hypre_ILUBuildRASExternalMatrix +#undef hypre_ILUCSRMatrixInverseSelfPrecondMRGlobal +#undef hypre_ILUCreate +#undef hypre_ILUDestroy +#undef hypre_ILUGetFinalRelativeResidualNorm +#undef hypre_ILUGetInteriorExteriorPerm +#undef hypre_ILUGetIterativeSetupHistory +#undef hypre_ILUGetLocalPerm +#undef hypre_ILUGetNumIterations +#undef hypre_ILUGetPermddPQ +#undef hypre_ILUGetPermddPQPre +#undef hypre_ILULocalRCM +#undef hypre_ILULocalRCMBuildFinalPerm +#undef hypre_ILULocalRCMBuildLevel +#undef hypre_ILULocalRCMFindPPNode +#undef hypre_ILULocalRCMMindegree +#undef hypre_ILULocalRCMNumbering +#undef hypre_ILULocalRCMOrder +#undef hypre_ILULocalRCMQsort +#undef hypre_ILULocalRCMReverse +#undef hypre_ILUMaxQSplitRabsI +#undef hypre_ILUMaxRabs +#undef hypre_ILUMaxrHeapAddRabsI +#undef hypre_ILUMaxrHeapRemoveRabsI +#undef hypre_ILUMinHeapAddI +#undef hypre_ILUMinHeapAddIIIi +#undef hypre_ILUMinHeapAddIRIi +#undef hypre_ILUMinHeapRemoveI +#undef hypre_ILUMinHeapRemoveIIIi +#undef hypre_ILUMinHeapRemoveIRIi +#undef hypre_ILUParCSRInverseNSH +#undef hypre_ILUSetDropThreshold +#undef hypre_ILUSetDropThresholdArray +#undef hypre_ILUSetIterativeSetupMaxIter +#undef hypre_ILUSetIterativeSetupOption +#undef hypre_ILUSetIterativeSetupTolerance +#undef hypre_ILUSetIterativeSetupType +#undef hypre_ILUSetLevelOfFill +#undef hypre_ILUSetLocalReordering +#undef hypre_ILUSetLogging +#undef hypre_ILUSetLowerJacobiIters +#undef hypre_ILUSetMaxIter +#undef hypre_ILUSetMaxNnzPerRow +#undef hypre_ILUSetPrintLevel +#undef hypre_ILUSetSchurNSHDropThreshold +#undef hypre_ILUSetSchurNSHDropThresholdArray +#undef hypre_ILUSetSchurPrecondILUDropThreshold +#undef hypre_ILUSetSchurPrecondILUDropThresholdArray +#undef hypre_ILUSetSchurPrecondILULevelOfFill +#undef hypre_ILUSetSchurPrecondILUMaxNnzPerRow +#undef hypre_ILUSetSchurPrecondILUType +#undef hypre_ILUSetSchurPrecondLowerJacobiIters +#undef hypre_ILUSetSchurPrecondMaxIter +#undef hypre_ILUSetSchurPrecondPrintLevel +#undef hypre_ILUSetSchurPrecondTol +#undef hypre_ILUSetSchurPrecondTriSolve +#undef hypre_ILUSetSchurPrecondUpperJacobiIters +#undef hypre_ILUSetSchurSolverAbsoluteTol +#undef hypre_ILUSetSchurSolverKDIM +#undef hypre_ILUSetSchurSolverLogging +#undef hypre_ILUSetSchurSolverMaxIter +#undef hypre_ILUSetSchurSolverPrintLevel +#undef hypre_ILUSetSchurSolverRelChange +#undef hypre_ILUSetSchurSolverTol +#undef hypre_ILUSetTol +#undef hypre_ILUSetTriSolve +#undef hypre_ILUSetType +#undef hypre_ILUSetUpperJacobiIters +#undef hypre_ILUSetup +#undef hypre_ILUSetupILU0 +#undef hypre_ILUSetupILU0RAS +#undef hypre_ILUSetupILUK +#undef hypre_ILUSetupILUKRAS +#undef hypre_ILUSetupILUKRASSymbolic +#undef hypre_ILUSetupILUKSymbolic +#undef hypre_ILUSetupILUT +#undef hypre_ILUSetupILUTRAS +#undef hypre_ILUSetupLDUtoCusparse +#undef hypre_ILUSetupMILU0 +#undef hypre_ILUSetupRAPILU0 +#undef hypre_ILUSetupRAPILU0Device +#undef hypre_ILUSetupRAPMILU0 +#undef hypre_ILUSolve +#undef hypre_ILUSolveLU +#undef hypre_ILUSolveLUIter +#undef hypre_ILUSolveLURAS +#undef hypre_ILUSolveRAPGMRESHost +#undef hypre_ILUSolveSchurGMRES +#undef hypre_ILUSolveSchurNSH +#undef hypre_ILUSortOffdColmap +#undef hypre_ILUWriteSolverParams +#undef hypre_IndepSetGreedy +#undef hypre_IndepSetGreedyS +#undef hypre_IntersectTwoArrays +#undef hypre_IntersectTwoBigArrays +#undef hypre_LINPACKcgpthy +#undef hypre_LINPACKcgtql1 +#undef hypre_MGRAddVectorP +#undef hypre_MGRAddVectorR +#undef hypre_MGRApproximateInverse +#undef hypre_MGRBlockColLumpedRestrict +#undef hypre_MGRBlockRelaxSetup +#undef hypre_MGRBlockRelaxSolve +#undef hypre_MGRBlockRelaxSolveDevice +#undef hypre_MGRBuildAff +#undef hypre_MGRBuildBlockJacobiP +#undef hypre_MGRBuildBlockJacobiWp +#undef hypre_MGRBuildCoarseOperator +#undef hypre_MGRBuildInterp +#undef hypre_MGRBuildInterpApproximateInverse +#undef hypre_MGRBuildNonGalerkinCoarseOperator +#undef hypre_MGRBuildNonGalerkinCoarseOperatorDevice +#undef hypre_MGRBuildNonGalerkinCoarseOperatorHost +#undef hypre_MGRBuildP +#undef hypre_MGRBuildPDRS +#undef hypre_MGRBuildPFromWp +#undef hypre_MGRBuildPFromWpHost +#undef hypre_MGRBuildPHost +#undef hypre_MGRBuildRFromWr +#undef hypre_MGRBuildRFromWrHost +#undef hypre_MGRBuildRestrict +#undef hypre_MGRCoarseParms +#undef hypre_MGRCoarsen +#undef hypre_MGRColLumpedRestrict +#undef hypre_MGRCreate +#undef hypre_MGRCreateFrelaxVcycleData +#undef hypre_MGRCreateGSElimData +#undef hypre_MGRCycle +#undef hypre_MGRDataPrint +#undef hypre_MGRDestroy +#undef hypre_MGRDestroyFrelaxVcycleData +#undef hypre_MGRDestroyGSElimData +#undef hypre_MGRFrelaxVcycle +#undef hypre_MGRGetCoarseGridConvergenceFactor +#undef hypre_MGRGetCoarseGridName +#undef hypre_MGRGetFRelaxName +#undef hypre_MGRGetFinalRelativeResidualNorm +#undef hypre_MGRGetGlobalRelaxName +#undef hypre_MGRGetNumIterations +#undef hypre_MGRGetProlongationName +#undef hypre_MGRGetRestrictionName +#undef hypre_MGRGetSubBlock +#undef hypre_MGRNonGalerkinTruncate +#undef hypre_MGRPrintCoarseSystem +#undef hypre_MGRSetBlockJacobiBlockSize +#undef hypre_MGRSetBlockSize +#undef hypre_MGRSetCoarseGridMethod +#undef hypre_MGRSetCoarseGridPrintLevel +#undef hypre_MGRSetCoarseSolver +#undef hypre_MGRSetCpointsByBlock +#undef hypre_MGRSetCpointsByContiguousBlock +#undef hypre_MGRSetCpointsByPointMarkerArray +#undef hypre_MGRSetFRelaxMethod +#undef hypre_MGRSetFSolver +#undef hypre_MGRSetFSolverAtLevel +#undef hypre_MGRSetFrelaxPrintLevel +#undef hypre_MGRSetGlobalSmoothCycle +#undef hypre_MGRSetGlobalSmoothType +#undef hypre_MGRSetGlobalSmootherAtLevel +#undef hypre_MGRSetInterpType +#undef hypre_MGRSetLevelFRelaxMethod +#undef hypre_MGRSetLevelFRelaxNumFunctions +#undef hypre_MGRSetLevelFRelaxType +#undef hypre_MGRSetLevelInterpType +#undef hypre_MGRSetLevelNonGalerkinMaxElmts +#undef hypre_MGRSetLevelNumRelaxSweeps +#undef hypre_MGRSetLevelPMaxElmts +#undef hypre_MGRSetLevelRestrictType +#undef hypre_MGRSetLevelSmoothIters +#undef hypre_MGRSetLevelSmoothType +#undef hypre_MGRSetLogging +#undef hypre_MGRSetMaxCoarseLevels +#undef hypre_MGRSetMaxGlobalSmoothIters +#undef hypre_MGRSetMaxIter +#undef hypre_MGRSetNonCpointsToFpoints +#undef hypre_MGRSetNonGalerkinMaxElmts +#undef hypre_MGRSetNumInterpSweeps +#undef hypre_MGRSetNumRelaxSweeps +#undef hypre_MGRSetNumRestrictSweeps +#undef hypre_MGRSetPMaxElmts +#undef hypre_MGRSetPrintLevel +#undef hypre_MGRSetReductionLevelCpoints +#undef hypre_MGRSetRelaxType +#undef hypre_MGRSetReservedCoarseNodes +#undef hypre_MGRSetReservedCpointsLevelToKeep +#undef hypre_MGRSetRestrictType +#undef hypre_MGRSetTol +#undef hypre_MGRSetTruncateCoarseGridThreshold +#undef hypre_MGRSetup +#undef hypre_MGRSetupFrelaxVcycleData +#undef hypre_MGRSetupStats +#undef hypre_MGRSmallBlkInverse +#undef hypre_MGRSolve +#undef hypre_MGRTruncateAcfCPR +#undef hypre_MGRTruncateAcfCPRDevice +#undef hypre_MPSchwarzCFFWSolve +#undef hypre_MPSchwarzCFSolve +#undef hypre_MPSchwarzFWSolve +#undef hypre_MPSchwarzSolve +#undef hypre_NSHCreate +#undef hypre_NSHDestroy +#undef hypre_NSHSetColVersion +#undef hypre_NSHSetDropThreshold +#undef hypre_NSHSetDropThresholdArray +#undef hypre_NSHSetGlobalSolver +#undef hypre_NSHSetLogging +#undef hypre_NSHSetMRMaxIter +#undef hypre_NSHSetMRMaxRowNnz +#undef hypre_NSHSetMRTol +#undef hypre_NSHSetMaxIter +#undef hypre_NSHSetNSHMaxIter +#undef hypre_NSHSetNSHMaxRowNnz +#undef hypre_NSHSetNSHTol +#undef hypre_NSHSetPrintLevel +#undef hypre_NSHSetTol +#undef hypre_NSHSetup +#undef hypre_NSHSolve +#undef hypre_NSHSolveInverse +#undef hypre_NSHWriteSolverParams +#undef hypre_NonGalerkinIJBigBufferInit +#undef hypre_NonGalerkinIJBufferCompress +#undef hypre_NonGalerkinIJBufferCompressRow +#undef hypre_NonGalerkinIJBufferEmpty +#undef hypre_NonGalerkinIJBufferInit +#undef hypre_NonGalerkinIJBufferNewRow +#undef hypre_NonGalerkinIJBufferWrite +#undef hypre_NonGalerkinSparsityPattern +#undef hypre_ParAMGCreateDomainDof +#undef hypre_ParAdSchwarzSolve +#undef hypre_ParCSRComputeL1Norms +#undef hypre_ParCSRComputeL1NormsThreads +#undef hypre_ParCSRMatrixBlockDiagMatrix +#undef hypre_ParCSRMatrixBlockDiagMatrixHost +#undef hypre_ParCSRMatrixChooseThresh +#undef hypre_ParCSRMatrixExtractBlockDiagHost +#undef hypre_ParCSRMatrixFillSmooth +#undef hypre_ParCSRMatrixFixZeroRows +#undef hypre_ParCSRMatrixFixZeroRowsHost +#undef hypre_ParCSRMatrixNormFro +#undef hypre_ParCSRMatrixResNormFro +#undef hypre_ParCSRMatrixScaledNorm +#undef hypre_ParCSRMatrixSetDiagRows +#undef hypre_ParCSRMatrixThreshold +#undef hypre_ParCSRMatrix_dof_func_offd +#undef hypre_ParCSRMaxEigEstimate +#undef hypre_ParCSRMaxEigEstimateCG +#undef hypre_ParCSRMaxEigEstimateCGHost +#undef hypre_ParCSRMaxEigEstimateHost +#undef hypre_ParCSRRelax +#undef hypre_ParCSRRelax_CG +#undef hypre_ParCSRRelax_Cheby +#undef hypre_ParCSRRelax_Cheby_Setup +#undef hypre_ParCSRRelax_Cheby_Solve +#undef hypre_ParCSRRelax_Cheby_SolveHost +#undef hypre_ParCSRRelax_L1_Jacobi +#undef hypre_ParCSRSubspacePrec +#undef hypre_ParGenerateHybridScale +#undef hypre_ParGenerateScale +#undef hypre_ParILUExtractEBFC +#undef hypre_ParILURAPReorder +#undef hypre_ParILURAPSchurGMRESCommInfoHost +#undef hypre_ParILURAPSchurGMRESMatvecHost +#undef hypre_ParILURAPSchurGMRESSolveHost +#undef hypre_ParKrylovAxpy +#undef hypre_ParKrylovCAlloc +#undef hypre_ParKrylovClearVector +#undef hypre_ParKrylovCommInfo +#undef hypre_ParKrylovCopyVector +#undef hypre_ParKrylovCreateVector +#undef hypre_ParKrylovCreateVectorArray +#undef hypre_ParKrylovDestroyVector +#undef hypre_ParKrylovFree +#undef hypre_ParKrylovIdentity +#undef hypre_ParKrylovIdentitySetup +#undef hypre_ParKrylovInnerProd +#undef hypre_ParKrylovInnerProdTagged +#undef hypre_ParKrylovMassAxpy +#undef hypre_ParKrylovMassDotpTwo +#undef hypre_ParKrylovMassInnerProd +#undef hypre_ParKrylovMatvec +#undef hypre_ParKrylovMatvecCreate +#undef hypre_ParKrylovMatvecDestroy +#undef hypre_ParKrylovMatvecT +#undef hypre_ParKrylovScaleVector +#undef hypre_ParMPSchwarzSolve +#undef hypre_ParPrintVector +#undef hypre_ParReadVector +#undef hypre_ParSetRandomValues +#undef hypre_ParVectorBlockGather +#undef hypre_ParVectorBlockSplit +#undef hypre_ParVectorInDomainOf +#undef hypre_ParVectorInRangeOf +#undef hypre_ParVectorSize +#undef hypre_PartialSelectSortCI +#undef hypre_SchwarzCFSolve +#undef hypre_SchwarzCreate +#undef hypre_SchwarzDestroy +#undef hypre_SchwarzReScale +#undef hypre_SchwarzSetDofFunc +#undef hypre_SchwarzSetDomainStructure +#undef hypre_SchwarzSetDomainType +#undef hypre_SchwarzSetNonSymm +#undef hypre_SchwarzSetNumFunctions +#undef hypre_SchwarzSetOverlap +#undef hypre_SchwarzSetRelaxWeight +#undef hypre_SchwarzSetScale +#undef hypre_SchwarzSetVariant +#undef hypre_SchwarzSetup +#undef hypre_SchwarzSolve +#undef hypre_SortedCopyParCSRData +#undef hypre_alt_insert_new_nodes +#undef hypre_amsconstructdiscretegradient +#undef hypre_amscreate +#undef hypre_amsdestroy +#undef hypre_amsgetfinalrelativeresidualnorm +#undef hypre_amsgetnumiterations +#undef hypre_amssetalphaamgoptions +#undef hypre_amssetalphapoissonmatrix +#undef hypre_amssetbetaamgoptions +#undef hypre_amssetbetapoissonmatrix +#undef hypre_amssetcoordinatevectors +#undef hypre_amssetcycletype +#undef hypre_amssetdimension +#undef hypre_amssetdiscretegradient +#undef hypre_amssetedgeconstantvectors +#undef hypre_amssetmaxiter +#undef hypre_amssetprintlevel +#undef hypre_amssetsmoothingoptions +#undef hypre_amssettol +#undef hypre_amssetup +#undef hypre_amssolve +#undef hypre_big_insert_new_nodes +#undef hypre_blas_mat_inv +#undef hypre_blas_smat_inv_n2 +#undef hypre_blas_smat_inv_n3 +#undef hypre_blas_smat_inv_n4 +#undef hypre_block_jacobi_solve +#undef hypre_blocktridiagcreate +#undef hypre_blocktridiagdestroy +#undef hypre_blocktridiagsetamgnumswee +#undef hypre_blocktridiagsetamgrelaxty +#undef hypre_blocktridiagsetamgstrengt +#undef hypre_blocktridiagsetindexset +#undef hypre_blocktridiagsetprintlevel +#undef hypre_blocktridiagsetup +#undef hypre_blocktridiagsolve +#undef hypre_boomeramgcreate +#undef hypre_boomeramgdestroy +#undef hypre_boomeramgfingridrelaxatn +#undef hypre_boomeramggetadditive +#undef hypre_boomeramggetcoarsentype +#undef hypre_boomeramggetcumnumiterati +#undef hypre_boomeramggetcyclenumsweeps +#undef hypre_boomeramggetcyclerelaxtype +#undef hypre_boomeramggetcycletype +#undef hypre_boomeramggetdebugflag +#undef hypre_boomeramggetdomaintype +#undef hypre_boomeramggetfinalreltvres +#undef hypre_boomeramggetjacobitrunc +#undef hypre_boomeramggetlogging +#undef hypre_boomeramggetmaxcoarsesize +#undef hypre_boomeramggetmaxiter +#undef hypre_boomeramggetmaxlevels +#undef hypre_boomeramggetmaxrowsum +#undef hypre_boomeramggetmeasuretype +#undef hypre_boomeramggetmincoarsesize +#undef hypre_boomeramggetmultadd +#undef hypre_boomeramggetnumfunctions +#undef hypre_boomeramggetnumiterations +#undef hypre_boomeramggetoverlap +#undef hypre_boomeramggetpmaxelmts +#undef hypre_boomeramggetprintlevel +#undef hypre_boomeramggetresidual +#undef hypre_boomeramggetschwarzrlxwt +#undef hypre_boomeramggetsimple +#undef hypre_boomeramggetsmoothnumlvls +#undef hypre_boomeramggetsmoothnumswps +#undef hypre_boomeramggetsmoothtype +#undef hypre_boomeramggetstrongthrshld +#undef hypre_boomeramggettol +#undef hypre_boomeramggettruncfactor +#undef hypre_boomeramggetvariant +#undef hypre_boomeramginitgridrelaxatn +#undef hypre_boomeramgsetadditive +#undef hypre_boomeramgsetaddlastlvl +#undef hypre_boomeramgsetaddrlxtype +#undef hypre_boomeramgsetaddrlxwt +#undef hypre_boomeramgsetagginterptype +#undef hypre_boomeramgsetaggnumlevels +#undef hypre_boomeramgsetaggp12maxelmt +#undef hypre_boomeramgsetaggp12trfac +#undef hypre_boomeramgsetaggpmaxelmts +#undef hypre_boomeramgsetaggtrfactor +#undef hypre_boomeramgsetcgcits +#undef hypre_boomeramgsetchebyeigest +#undef hypre_boomeramgsetchebyfract +#undef hypre_boomeramgsetchebyorder +#undef hypre_boomeramgsetchebyscale +#undef hypre_boomeramgsetchebyvariant +#undef hypre_boomeramgsetcoarsentype +#undef hypre_boomeramgsetcyclenumsweeps +#undef hypre_boomeramgsetcyclerelaxtype +#undef hypre_boomeramgsetcycletype +#undef hypre_boomeramgsetdebugflag +#undef hypre_boomeramgsetdoffunc +#undef hypre_boomeramgsetdomaintype +#undef hypre_boomeramgsetdroptol +#undef hypre_boomeramgseteubj +#undef hypre_boomeramgseteuclidfile +#undef hypre_boomeramgseteulevel +#undef hypre_boomeramgseteusparsea +#undef hypre_boomeramgsetfilter +#undef hypre_boomeramgsetgridrelaxpnts +#undef hypre_boomeramgsetgridrelaxtype +#undef hypre_boomeramgsetgsmg +#undef hypre_boomeramgsetinterptype +#undef hypre_boomeramgsetinterpvecqmx +#undef hypre_boomeramgsetinterpvecqtr +#undef hypre_boomeramgsetinterpvecs +#undef hypre_boomeramgsetinterpvecvar +#undef hypre_boomeramgsetjacobitrunc +#undef hypre_boomeramgsetkeeptransp +#undef hypre_boomeramgsetlevel +#undef hypre_boomeramgsetlevelouterwt +#undef hypre_boomeramgsetlevelrelaxwt +#undef hypre_boomeramgsetlogging +#undef hypre_boomeramgsetlvlnongaltol +#undef hypre_boomeramgsetmaxcoarsesize +#undef hypre_boomeramgsetmaxiter +#undef hypre_boomeramgsetmaxlevels +#undef hypre_boomeramgsetmaxnzperrow +#undef hypre_boomeramgsetmaxrowsum +#undef hypre_boomeramgsetmeasuretype +#undef hypre_boomeramgsetmincoarsesize +#undef hypre_boomeramgsetminiter +#undef hypre_boomeramgsetmultadd +#undef hypre_boomeramgsetmultaddpmx +#undef hypre_boomeramgsetmultaddtrf +#undef hypre_boomeramgsetnodal +#undef hypre_boomeramgsetnodaldiag +#undef hypre_boomeramgsetnongaltol +#undef hypre_boomeramgsetnumfunctions +#undef hypre_boomeramgsetnumgridsweeps +#undef hypre_boomeramgsetnumpaths +#undef hypre_boomeramgsetnumsamples +#undef hypre_boomeramgsetnumsweeps +#undef hypre_boomeramgsetolddefault +#undef hypre_boomeramgsetouterwt +#undef hypre_boomeramgsetoverlap +#undef hypre_boomeramgsetpmaxelmts +#undef hypre_boomeramgsetpostinterp +#undef hypre_boomeramgsetprintfilename +#undef hypre_boomeramgsetprintlevel +#undef hypre_boomeramgsetrap2 +#undef hypre_boomeramgsetredundant +#undef hypre_boomeramgsetrelaxorder +#undef hypre_boomeramgsetrelaxtype +#undef hypre_boomeramgsetrelaxweight +#undef hypre_boomeramgsetrelaxwt +#undef hypre_boomeramgsetrestriction +#undef hypre_boomeramgsetschwarznonsym +#undef hypre_boomeramgsetschwarzrlxwt +#undef hypre_boomeramgsetsepweight +#undef hypre_boomeramgsetseqthrshold +#undef hypre_boomeramgsetsetuptype +#undef hypre_boomeramgsetsimple +#undef hypre_boomeramgsetsmoothnumlvls +#undef hypre_boomeramgsetsmoothnumswps +#undef hypre_boomeramgsetsmoothtype +#undef hypre_boomeramgsetstrongthrshld +#undef hypre_boomeramgsetsym +#undef hypre_boomeramgsetthreshold +#undef hypre_boomeramgsettol +#undef hypre_boomeramgsettruncfactor +#undef hypre_boomeramgsetup +#undef hypre_boomeramgsetvariant +#undef hypre_boomeramgsolve +#undef hypre_boomeramgsolvet +#undef hypre_build_interp_colmap +#undef hypre_cr +#undef hypre_euclidcreate +#undef hypre_eucliddestroy +#undef hypre_euclidsetbj +#undef hypre_euclidsetilut +#undef hypre_euclidsetlevel +#undef hypre_euclidsetmem +#undef hypre_euclidsetparams +#undef hypre_euclidsetparamsfromfile +#undef hypre_euclidsetrowscale +#undef hypre_euclidsetsparsea +#undef hypre_euclidsetstats +#undef hypre_euclidsetup +#undef hypre_euclidsolve +#undef hypre_exchange_interp_data +#undef hypre_exchange_marker +#undef hypre_fgmresT +#undef hypre_formu +#undef hypre_fptgscr +#undef hypre_fptjaccr +#undef hypre_generatelaplacian +#undef hypre_ilucreate +#undef hypre_iludestroy +#undef hypre_ilugetfinalrelresnorm +#undef hypre_ilugetnumiterations +#undef hypre_ilusetdropthreshold +#undef hypre_ilusetdropthresholdarray +#undef hypre_ilusetleveloffill +#undef hypre_ilusetlocalreordering +#undef hypre_ilusetlogging +#undef hypre_ilusetmaxiter +#undef hypre_ilusetmaxnnzperrow +#undef hypre_ilusetnshdropthreshold +#undef hypre_ilusetprintlevel +#undef hypre_ilusetschurmaxiter +#undef hypre_ilusettol +#undef hypre_ilusettype +#undef hypre_ilusetup +#undef hypre_ilusolve +#undef hypre_index_of_minimum +#undef hypre_initialize_vecs +#undef hypre_map +#undef hypre_map2 +#undef hypre_matinv +#undef hypre_merge_lists +#undef hypre_mgrbuildaff +#undef hypre_mgrcreate +#undef hypre_mgrdestroy +#undef hypre_mgrgetcoarsegridconvfac +#undef hypre_mgrgetfinalrelresnorm +#undef hypre_mgrgetnumiterations +#undef hypre_mgrsetblocksize +#undef hypre_mgrsetcgridprintlevel +#undef hypre_mgrsetcgridthreshold +#undef hypre_mgrsetcoarsegridmethod +#undef hypre_mgrsetcoarsesolver +#undef hypre_mgrsetcpointsbyblock +#undef hypre_mgrsetcptsbyctgblock +#undef hypre_mgrsetcptsbymarkerarray +#undef hypre_mgrsetfrelaxmethod +#undef hypre_mgrsetfrelaxprintlevel +#undef hypre_mgrsetfsolver +#undef hypre_mgrsetglobalsmoothtype +#undef hypre_mgrsetinterptype +#undef hypre_mgrsetlevelfrelaxmethod +#undef hypre_mgrsetlevelfrelaxnumfunc +#undef hypre_mgrsetlevelinterptype +#undef hypre_mgrsetlevelrestricttype +#undef hypre_mgrsetlogging +#undef hypre_mgrsetmaxcoarselevels +#undef hypre_mgrsetmaxglobalsmoothit +#undef hypre_mgrsetmaxiter +#undef hypre_mgrsetnoncptstofpts +#undef hypre_mgrsetnuminterpsweeps +#undef hypre_mgrsetnumrelaxsweeps +#undef hypre_mgrsetnumrestrictsweeps +#undef hypre_mgrsetpmaxelmts +#undef hypre_mgrsetprintlevel +#undef hypre_mgrsetrelaxtype +#undef hypre_mgrsetreservedcoarsenodes +#undef hypre_mgrsetreservedcptslevel +#undef hypre_mgrsetrestricttype +#undef hypre_mgrsettol +#undef hypre_mgrsetup +#undef hypre_mgrsolve +#undef hypre_move_entry +#undef hypre_ordered_GS +#undef hypre_parCorrRes +#undef hypre_parasailscreate +#undef hypre_parasailsdestroy +#undef hypre_parasailsgetfilter +#undef hypre_parasailsgetloadbal +#undef hypre_parasailsgetlogging +#undef hypre_parasailsgetnlevels +#undef hypre_parasailsgetreuse +#undef hypre_parasailsgetsym +#undef hypre_parasailsgetthresh +#undef hypre_parasailssetfilter +#undef hypre_parasailssetloadbal +#undef hypre_parasailssetlogging +#undef hypre_parasailssetnlevels +#undef hypre_parasailssetparams +#undef hypre_parasailssetreuse +#undef hypre_parasailssetsym +#undef hypre_parasailssetthresh +#undef hypre_parasailssetup +#undef hypre_parasailssolve +#undef hypre_parcsrbicgstabcreate +#undef hypre_parcsrbicgstabdestroy +#undef hypre_parcsrbicgstabgetfinalrel +#undef hypre_parcsrbicgstabgetnumiter +#undef hypre_parcsrbicgstabgetprecond +#undef hypre_parcsrbicgstabsetatol +#undef hypre_parcsrbicgstabsetlogging +#undef hypre_parcsrbicgstabsetmaxiter +#undef hypre_parcsrbicgstabsetminiter +#undef hypre_parcsrbicgstabsetprecond +#undef hypre_parcsrbicgstabsetprintlev +#undef hypre_parcsrbicgstabsetstopcrit +#undef hypre_parcsrbicgstabsettol +#undef hypre_parcsrbicgstabsetup +#undef hypre_parcsrbicgstabsolve +#undef hypre_parcsrcgnrcreate +#undef hypre_parcsrcgnrdestroy +#undef hypre_parcsrcgnrgetfinalrelativ +#undef hypre_parcsrcgnrgetnumiteration +#undef hypre_parcsrcgnrgetprecond +#undef hypre_parcsrcgnrsetlogging +#undef hypre_parcsrcgnrsetmaxiter +#undef hypre_parcsrcgnrsetminiter +#undef hypre_parcsrcgnrsetprecond +#undef hypre_parcsrcgnrsetstopcrit +#undef hypre_parcsrcgnrsettol +#undef hypre_parcsrcgnrsetup +#undef hypre_parcsrcgnrsolve +#undef hypre_parcsrcogmrescreate +#undef hypre_parcsrcogmresdestroy +#undef hypre_parcsrcogmresgetfinalrela +#undef hypre_parcsrcogmresgetnumiterat +#undef hypre_parcsrcogmresgetprecond +#undef hypre_parcsrcogmressetabsolutet +#undef hypre_parcsrcogmressetcgs +#undef hypre_parcsrcogmressetkdim +#undef hypre_parcsrcogmressetlogging +#undef hypre_parcsrcogmressetmaxiter +#undef hypre_parcsrcogmressetminiter +#undef hypre_parcsrcogmressetprecond +#undef hypre_parcsrcogmressetprintleve +#undef hypre_parcsrcogmressettol +#undef hypre_parcsrcogmressetunroll +#undef hypre_parcsrcogmressetup +#undef hypre_parcsrcogmressolve +#undef hypre_parcsrdiagscale +#undef hypre_parcsrdiagscalesetup +#undef hypre_parcsrflexgmrescreate +#undef hypre_parcsrflexgmresdestroy +#undef hypre_parcsrflexgmresgetfinalrelati +#undef hypre_parcsrflexgmresgetnumiteratio +#undef hypre_parcsrflexgmresgetprecond +#undef hypre_parcsrflexgmressetabsolutetol +#undef hypre_parcsrflexgmressetkdim +#undef hypre_parcsrflexgmressetlogging +#undef hypre_parcsrflexgmressetmaxiter +#undef hypre_parcsrflexgmressetminiter +#undef hypre_parcsrflexgmressetprecond +#undef hypre_parcsrflexgmressetprintlevel +#undef hypre_parcsrflexgmressettol +#undef hypre_parcsrflexgmressetup +#undef hypre_parcsrflexgmressolve +#undef hypre_parcsrgmrescreate +#undef hypre_parcsrgmresdestroy +#undef hypre_parcsrgmresgetfinalrelati +#undef hypre_parcsrgmresgetnumiteratio +#undef hypre_parcsrgmresgetprecond +#undef hypre_parcsrgmressetabsolutetol +#undef hypre_parcsrgmressetkdim +#undef hypre_parcsrgmressetlogging +#undef hypre_parcsrgmressetmaxiter +#undef hypre_parcsrgmressetminiter +#undef hypre_parcsrgmressetprecond +#undef hypre_parcsrgmressetprintlevel +#undef hypre_parcsrgmressetstopcrit +#undef hypre_parcsrgmressettol +#undef hypre_parcsrgmressetup +#undef hypre_parcsrgmressolve +#undef hypre_parcsrhybridcreate +#undef hypre_parcsrhybriddestroy +#undef hypre_parcsrhybridgetdscgnumite +#undef hypre_parcsrhybridgetfinalrelat +#undef hypre_parcsrhybridgetnumiterati +#undef hypre_parcsrhybridgetpcgnumiter +#undef hypre_parcsrhybridsetaggnumlev +#undef hypre_parcsrhybridsetcoarsentyp +#undef hypre_parcsrhybridsetconvergenc +#undef hypre_parcsrhybridsetcyclenumsw +#undef hypre_parcsrhybridsetcyclerelax +#undef hypre_parcsrhybridsetcycletype +#undef hypre_parcsrhybridsetdoffunc +#undef hypre_parcsrhybridsetdscgmaxite +#undef hypre_parcsrhybridsetgridrelaxp +#undef hypre_parcsrhybridsetgridrelaxt +#undef hypre_parcsrhybridsetinterptyp +#undef hypre_parcsrhybridsetkdim +#undef hypre_parcsrhybridsetkeeptrans +#undef hypre_parcsrhybridsetlevelouter +#undef hypre_parcsrhybridsetlevelrelax +#undef hypre_parcsrhybridsetlogging +#undef hypre_parcsrhybridsetmaxlevels +#undef hypre_parcsrhybridsetmaxrowsum +#undef hypre_parcsrhybridsetmeasuretyp +#undef hypre_parcsrhybridsetnodal +#undef hypre_parcsrhybridsetnongaltol +#undef hypre_parcsrhybridsetnumfunc +#undef hypre_parcsrhybridsetnumgridswe +#undef hypre_parcsrhybridsetnumpaths +#undef hypre_parcsrhybridsetnumsweeps +#undef hypre_parcsrhybridsetomega +#undef hypre_parcsrhybridsetouterwt +#undef hypre_parcsrhybridsetpcgmaxiter +#undef hypre_parcsrhybridsetpmaxelmts +#undef hypre_parcsrhybridsetprecond +#undef hypre_parcsrhybridsetprintlevel +#undef hypre_parcsrhybridsetrelaxorder +#undef hypre_parcsrhybridsetrelaxtype +#undef hypre_parcsrhybridsetrelaxweigh +#undef hypre_parcsrhybridsetrelaxwt +#undef hypre_parcsrhybridsetrelchange +#undef hypre_parcsrhybridsetsolvertype +#undef hypre_parcsrhybridsetstopcrit +#undef hypre_parcsrhybridsetstrongthre +#undef hypre_parcsrhybridsettol +#undef hypre_parcsrhybridsettruncfacto +#undef hypre_parcsrhybridsettwonorm +#undef hypre_parcsrhybridsetup +#undef hypre_parcsrhybridsolve +#undef hypre_parcsrlgmrescreate +#undef hypre_parcsrlgmresdestroy +#undef hypre_parcsrlgmresgetfinalrelati +#undef hypre_parcsrlgmresgetnumiteratio +#undef hypre_parcsrlgmresgetprecond +#undef hypre_parcsrlgmressetabsolutetol +#undef hypre_parcsrlgmressetkdim +#undef hypre_parcsrlgmressetlogging +#undef hypre_parcsrlgmressetmaxiter +#undef hypre_parcsrlgmressetminiter +#undef hypre_parcsrlgmressetprecond +#undef hypre_parcsrlgmressetprintlevel +#undef hypre_parcsrlgmressettol +#undef hypre_parcsrlgmressetup +#undef hypre_parcsrlgmressolve +#undef hypre_parcsrmultivectorprint +#undef hypre_parcsrmultivectorread +#undef hypre_parcsrpcgcreate +#undef hypre_parcsrpcgdestroy +#undef hypre_parcsrpcggetfinalrelative +#undef hypre_parcsrpcggetnumiterations +#undef hypre_parcsrpcggetprecond +#undef hypre_parcsrpcgsetatol +#undef hypre_parcsrpcgsetlogging +#undef hypre_parcsrpcgsetmaxiter +#undef hypre_parcsrpcgsetprecond +#undef hypre_parcsrpcgsetprintlevel +#undef hypre_parcsrpcgsetrelchange +#undef hypre_parcsrpcgsetstopcrit +#undef hypre_parcsrpcgsettol +#undef hypre_parcsrpcgsettwonorm +#undef hypre_parcsrpcgsetup +#undef hypre_parcsrpcgsolve +#undef hypre_parcsrpilutcreate +#undef hypre_parcsrpilutdestroy +#undef hypre_parcsrpilutsetdroptoleran +#undef hypre_parcsrpilutsetfacrowsize +#undef hypre_parcsrpilutsetmaxiter +#undef hypre_parcsrpilutsetup +#undef hypre_parcsrpilutsolve +#undef hypre_parcsrsetupinterpreter +#undef hypre_parcsrsetupmatvec +#undef hypre_parprintvector +#undef hypre_parreadvector +#undef hypre_parsetrandomvalues +#undef hypre_parvectorsize +#undef hypre_qsort2_ci +#undef hypre_remove_entry +#undef hypre_schwarzcreate +#undef hypre_schwarzdestroy +#undef hypre_schwarzsetdoffunc +#undef hypre_schwarzsetdomainstructure +#undef hypre_schwarzsetdomaintype +#undef hypre_schwarzsetnumfunctions +#undef hypre_schwarzsetoverlap +#undef hypre_schwarzsetrelaxweight +#undef hypre_schwarzsetup +#undef hypre_schwarzsetvariant +#undef hypre_schwarzsolve +#undef hypre_seqAMGCycle +#undef hypre_seqAMGSetup +#undef hypre_ssort +#undef hypre_swap2_ci +#undef hypre_swap_int +#undef hypre_tempparcsrsetupinterprete +#undef hypre_update_entry +#undef matrix_matrix_product +#undef rfun +#undef rfun_rs +#undef transpose_matrix_create diff --git a/src/parcsr_ls/ads.c b/src/parcsr_ls/ads.c index b0849e3039..086f94f93a 100644 --- a/src/parcsr_ls/ads.c +++ b/src/parcsr_ls/ads.c @@ -1064,14 +1064,7 @@ HYPRE_Int hypre_ADSComputePixyz(hypre_ParCSRMatrix *A, } } - if (HYPRE_AssumedPartitionCheck()) - { - hypre_ParCSRMatrixDestroy(F2V); - } - else - { - hypre_ParCSRBooleanMatrixDestroy((hypre_ParCSRBooleanMatrix*)F2V); - } + hypre_ParCSRMatrixDestroy(F2V); } hypre_ParVectorDestroy(RT100); @@ -1213,7 +1206,7 @@ hypre_ADSSetup(void *solver, { ads_data -> A_C = hypre_ParCSRMatrixRAPKT(ads_data -> C, ads_data -> A, - ads_data -> C, 1); + ads_data -> C, 1, 1); } else #endif @@ -1326,7 +1319,7 @@ hypre_ADSSetup(void *solver, { ads_data -> A_Pix = hypre_ParCSRMatrixRAPKT(ads_data -> Pix, ads_data -> A, - ads_data -> Pix, 1); + ads_data -> Pix, 1, 1); } else #endif @@ -1351,7 +1344,7 @@ hypre_ADSSetup(void *solver, { ads_data -> A_Piy = hypre_ParCSRMatrixRAPKT(ads_data -> Piy, ads_data -> A, - ads_data -> Piy, 1); + ads_data -> Piy, 1, 1); } else #endif @@ -1376,7 +1369,7 @@ hypre_ADSSetup(void *solver, { ads_data -> A_Piz = hypre_ParCSRMatrixRAPKT(ads_data -> Piz, ads_data -> A, - ads_data -> Piz, 1); + ads_data -> Piz, 1, 1); } else #endif @@ -1430,7 +1423,7 @@ hypre_ADSSetup(void *solver, { ads_data -> A_Pi = hypre_ParCSRMatrixRAPKT(ads_data -> Pi, ads_data -> A, - ads_data -> Pi, 1); + ads_data -> Pi, 1, 1); } else #endif diff --git a/src/parcsr_ls/ame.c b/src/parcsr_ls/ame.c index fc7832aba2..74f47cb4b6 100644 --- a/src/parcsr_ls/ame.c +++ b/src/parcsr_ls/ame.c @@ -7,10 +7,10 @@ #include "_hypre_onedpl.hpp" #include "_hypre_parcsr_ls.h" -#include "float.h" +//#include "float.h" #include "ams.h" -#include "temp_multivector.h" -#include "lobpcg.h" +#include "_hypre_lobpcg_temp_multivector.h" +#include "_hypre_lobpcg.h" #include "ame.h" #include "_hypre_utilities.hpp" @@ -604,7 +604,7 @@ HYPRE_Int hypre_AMESetup(void *esolver) #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); + ame_data -> A_G = hypre_ParCSRMatrixRAPKT(ame_data -> G, ame_data -> M, ame_data -> G, 1, 1); } else #endif @@ -699,7 +699,7 @@ HYPRE_Int hypre_AMESetup(void *esolver) data, data + ne, edge_bc, - thrust::identity(), + HYPRE_THRUST_IDENTITY(HYPRE_Int), 0.0 ); #endif } @@ -707,10 +707,12 @@ HYPRE_Int hypre_AMESetup(void *esolver) #endif { for (j = 0; j < ne; j++) + { if (edge_bc[j]) { data[j] = 0.0; } + } } hypre_AMEDiscrDivFreeComponent(esolver, vi); } diff --git a/src/parcsr_ls/ams.c b/src/parcsr_ls/ams.c index d3a09e7439..35dea480fc 100644 --- a/src/parcsr_ls/ams.c +++ b/src/parcsr_ls/ams.c @@ -495,11 +495,7 @@ HYPRE_Int hypre_ParCSRMatrixFixZeroRows(hypre_ParCSRMatrix *A) *--------------------------------------------------------------------------*/ #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()(const HYPRE_Complex &x, const HYPRE_Complex &y) const @@ -507,14 +503,8 @@ struct l1_norm_op1 : public thrust::binary_function -#endif { __host__ __device__ HYPRE_Complex operator()(const HYPRE_Complex &d, const HYPRE_Complex &l) const @@ -698,14 +688,14 @@ HYPRE_Int hypre_ParCSRComputeL1Norms(hypre_ParCSRMatrix *A, hypre_CSRMatrixExtractDiagonal(A_diag, l1_norm, 0); #if defined(HYPRE_USING_GPU) - if ( exec == HYPRE_EXEC_DEVICE) + 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 ); + 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, HYPRE_THRUST_NOT(identity), 1.0 ); + HYPRE_THRUST_CALL(replace_if, l1_norm, l1_norm + num_rows, + HYPRE_THRUST_NOT(HYPRE_THRUST_IDENTITY(HYPRE_Complex)), 1.0 ); #endif } else @@ -1918,7 +1908,7 @@ hypre_AMSComputePixyz(hypre_ParCSRMatrix *A, { HYPRE_Int i, j; - 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 global_num_rows = hypre_ParCSRMatrixGlobalNumRows(G); @@ -2275,19 +2265,22 @@ hypre_AMSComputePixyz(hypre_ParCSRMatrix *A, dim3 gDim = hypre_GetDefaultDeviceGridDimension(G_offd_nrows, "warp", bDim); HYPRE_GPU_LAUNCH( hypreGPUKernel_AMSComputePixyz_copy, gDim, bDim, - G_offd_nrows, dim, G_offd_I, G_offd_data, Gx_data, Gy_data, Gz_data, + 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++) { Pix_offd_I[i] = G_offd_I[i]; Piy_offd_I[i] = G_offd_I[i]; Piz_offd_I[i] = G_offd_I[i]; } + } for (i = 0; i < G_offd_nnz; i++) { @@ -2297,12 +2290,14 @@ 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++) { *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]; } + } } for (i = 0; i < G_offd_ncols; i++) @@ -3345,7 +3340,7 @@ hypre_AMSSetup(void *solver, { ams_data -> A_G = hypre_ParCSRMatrixRAPKT(ams_data -> G, ams_data -> A, - ams_data -> G, 1); + ams_data -> G, 1, 1); } else #endif @@ -3430,7 +3425,7 @@ hypre_AMSSetup(void *solver, #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); + ams_data -> A_Pix = hypre_ParCSRMatrixRAPKT(ams_data -> Pix, ams_data -> A, ams_data -> Pix, 1, 1); } else #endif @@ -3461,7 +3456,7 @@ hypre_AMSSetup(void *solver, { ams_data -> A_Piy = hypre_ParCSRMatrixRAPKT(ams_data -> Piy, ams_data -> A, - ams_data -> Piy, 1); + ams_data -> Piy, 1, 1); } else #endif @@ -3493,7 +3488,7 @@ hypre_AMSSetup(void *solver, { ams_data -> A_Piz = hypre_ParCSRMatrixRAPKT(ams_data -> Piz, ams_data -> A, - ams_data -> Piz, 1); + ams_data -> Piz, 1, 1); } else #endif @@ -3694,7 +3689,7 @@ hypre_AMSSetup(void *solver, #if defined(HYPRE_USING_GPU) if (exec == HYPRE_EXEC_DEVICE) { - ams_data -> A_Pi = hypre_ParCSRMatrixRAPKT(ams_data -> Pi, ApGGt, ams_data -> Pi, 1); + ams_data -> A_Pi = hypre_ParCSRMatrixRAPKT(ams_data -> Pi, ApGGt, ams_data -> Pi, 1, 1); } else #endif @@ -3711,7 +3706,7 @@ hypre_AMSSetup(void *solver, #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); + ams_data -> A_Pi = hypre_ParCSRMatrixRAPKT(ams_data -> Pi, ams_data -> A, ams_data -> Pi, 1, 1); } else #endif diff --git a/src/parcsr_ls/csr_block_matrix.h b/src/parcsr_ls/csr_block_matrix.h deleted file mode 100644 index c05ba0d5ab..0000000000 --- a/src/parcsr_ls/csr_block_matrix.h +++ /dev/null @@ -1,159 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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 CSR Block Matrix data structures - * - * Note: this matrix currently uses 0-based indexing. - * Note: everything is in terms of blocks (ie. num_rows is the number - * of block rows) - * - *****************************************************************************/ - -#ifndef hypre_CSR_BLOCK_MATRIX_HEADER -#define hypre_CSR_BLOCK_MATRIX_HEADER - -#include "seq_mv.h" -#include "_hypre_utilities.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/*-------------------------------------------------------------------------- - * CSR Block Matrix - *--------------------------------------------------------------------------*/ - -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_CSRBlockMatrix; - -/*-------------------------------------------------------------------------- - * Accessor functions for the CSR Block Matrix structure - *--------------------------------------------------------------------------*/ - -#define hypre_CSRBlockMatrixData(matrix) ((matrix) -> data) -#define hypre_CSRBlockMatrixI(matrix) ((matrix) -> i) -#define hypre_CSRBlockMatrixJ(matrix) ((matrix) -> j) -#define hypre_CSRBlockMatrixBigJ(matrix) ((matrix) -> big_j) -#define hypre_CSRBlockMatrixBlockSize(matrix) ((matrix) -> block_size) -#define hypre_CSRBlockMatrixNumRows(matrix) ((matrix) -> num_rows) -#define hypre_CSRBlockMatrixNumCols(matrix) ((matrix) -> num_cols) -#define hypre_CSRBlockMatrixNumNonzeros(matrix) ((matrix) -> num_nonzeros) -#define hypre_CSRBlockMatrixOwnsData(matrix) ((matrix) -> owns_data) - -/*-------------------------------------------------------------------------- - * other functions for the CSR Block Matrix structure - *--------------------------------------------------------------------------*/ - -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_CSRBlockMatrix -*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_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_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_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_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_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_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_Complex* ov, HYPRE_Int block_size); - -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); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/src/parcsr_ls/headers b/src/parcsr_ls/headers index 4c7a5dc743..9775ada974 100755 --- a/src/parcsr_ls/headers +++ b/src/parcsr_ls/headers @@ -20,9 +20,13 @@ cat > $INTERNAL_HEADER <<@ #include #include "HYPRE_parcsr_ls.h" #include "_hypre_parcsr_mv.h" -#include "krylov.h" +#include "_hypre_krylov.h" #include "HYPRE_lobpcg.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_parcsr_ls_mup_def.h" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -31,6 +35,10 @@ typedef struct { HYPRE_Int prev; HYPRE_Int next; } Link; @ +#=========================================================================== +# Structures and prototypes +#=========================================================================== + cat par_amg.h >> $INTERNAL_HEADER cat par_amgdd_comp_grid.h >> $INTERNAL_HEADER cat par_amgdd.h >> $INTERNAL_HEADER @@ -39,10 +47,6 @@ cat ams.h >> $INTERNAL_HEADER cat par_ilu.h >> $INTERNAL_HEADER cat protos.h >> $INTERNAL_HEADER -#=========================================================================== -# Structures and prototypes -#=========================================================================== - #../utilities/protos [!F]*.c >> $INTERNAL_HEADER #=========================================================================== @@ -55,6 +59,17 @@ cat >> $INTERNAL_HEADER <<@ } #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_parcsr_ls_mup_undef.h" +#include "_hypre_parcsr_ls_mup.h" +#endif +#endif + #endif @ diff --git a/src/parcsr_ls/mup.fixed b/src/parcsr_ls/mup.fixed new file mode 100644 index 0000000000..5fa91b4d8e --- /dev/null +++ b/src/parcsr_ls/mup.fixed @@ -0,0 +1,1456 @@ +GenerateDifConv +GenerateLaplacian +GenerateLaplacian27pt +GenerateLaplacian9pt +GenerateRSVarDifConv +GenerateRotate7pt +GenerateSysLaplacian +GenerateSysLaplacianVCoef +GenerateVarDifConv +afun +afun_rs +aux_indexFromMask +aux_maskCount +bfun +bfun_rs +bndfun +bndfun_rs +cfun +cfun_rs +dfun +dfun_rs +efun +efun_rs +ffun +ffun_rs +gfun +gfun_rs +hypre_ADSComputePi +hypre_ADSComputePixyz +hypre_ADSCreate +hypre_ADSDestroy +hypre_ADSGetFinalRelativeResidualNorm +hypre_ADSGetNumIterations +hypre_ADSSetAMGOptions +hypre_ADSSetAMSOptions +hypre_ADSSetChebySmoothingOptions +hypre_ADSSetCoordinateVectors +hypre_ADSSetCycleType +hypre_ADSSetDiscreteCurl +hypre_ADSSetDiscreteGradient +hypre_ADSSetInterpolations +hypre_ADSSetMaxIter +hypre_ADSSetPrintLevel +hypre_ADSSetSmoothingOptions +hypre_ADSSetTol +hypre_ADSSetup +hypre_ADSSolve +hypre_AMECreate +hypre_AMEDestroy +hypre_AMEDiscrDivFreeComponent +hypre_AMEGetEigenvalues +hypre_AMEGetEigenvectors +hypre_AMEMultiOperatorA +hypre_AMEMultiOperatorB +hypre_AMEMultiOperatorM +hypre_AMEOperatorA +hypre_AMEOperatorB +hypre_AMEOperatorM +hypre_AMESetAMSSolver +hypre_AMESetBlockSize +hypre_AMESetMassMatrix +hypre_AMESetMaxIter +hypre_AMESetMaxPCGIter +hypre_AMESetPrintLevel +hypre_AMESetRTol +hypre_AMESetTol +hypre_AMESetup +hypre_AMESolve +hypre_AMGCreateDomainDof +hypre_AMGDDCommPkgCreate +hypre_AMGDDCommPkgDestroy +hypre_AMGDDCommPkgRecvLevelDestroy +hypre_AMGDDCommPkgSendLevelDestroy +hypre_AMGDDCompGridCreate +hypre_AMGDDCompGridDestroy +hypre_AMGDDCompGridFinalize +hypre_AMGDDCompGridInitialize +hypre_AMGDDCompGridLocalIndexBinarySearch +hypre_AMGDDCompGridMatrixCreate +hypre_AMGDDCompGridMatrixDestroy +hypre_AMGDDCompGridMatrixSetupRealMatvec +hypre_AMGDDCompGridMatvec +hypre_AMGDDCompGridRealMatvec +hypre_AMGDDCompGridResize +hypre_AMGDDCompGridSetupLocalIndices +hypre_AMGDDCompGridSetupLocalIndicesP +hypre_AMGDDCompGridSetupRelax +hypre_AMGDDCompGridVectorAxpy +hypre_AMGDDCompGridVectorCopy +hypre_AMGDDCompGridVectorCreate +hypre_AMGDDCompGridVectorDestroy +hypre_AMGDDCompGridVectorInitialize +hypre_AMGDDCompGridVectorInnerProd +hypre_AMGDDCompGridVectorRealAxpy +hypre_AMGDDCompGridVectorRealCopy +hypre_AMGDDCompGridVectorRealInnerProd +hypre_AMGDDCompGridVectorRealScale +hypre_AMGDDCompGridVectorRealSetConstantValues +hypre_AMGDDCompGridVectorScale +hypre_AMGDDCompGridVectorSetConstantValues +hypre_AMGHybridCreate +hypre_AMGHybridDestroy +hypre_AMGHybridGetDSCGNumIterations +hypre_AMGHybridGetFinalRelativeResidualNorm +hypre_AMGHybridGetNumIterations +hypre_AMGHybridGetPCGNumIterations +hypre_AMGHybridGetRecomputeResidual +hypre_AMGHybridGetRecomputeResidualP +hypre_AMGHybridGetSetupSolveTime +hypre_AMGHybridSetAbsoluteTol +hypre_AMGHybridSetAggInterpType +hypre_AMGHybridSetAggNumLevels +hypre_AMGHybridSetCoarsenType +hypre_AMGHybridSetConvergenceTol +hypre_AMGHybridSetCycleNumSweeps +hypre_AMGHybridSetCycleRelaxType +hypre_AMGHybridSetCycleType +hypre_AMGHybridSetDSCGMaxIter +hypre_AMGHybridSetDofFunc +hypre_AMGHybridSetGridRelaxPoints +hypre_AMGHybridSetGridRelaxType +hypre_AMGHybridSetInterpType +hypre_AMGHybridSetKDim +hypre_AMGHybridSetKeepTranspose +hypre_AMGHybridSetLevelOuterWt +hypre_AMGHybridSetLevelRelaxWt +hypre_AMGHybridSetLogging +hypre_AMGHybridSetMaxCoarseSize +hypre_AMGHybridSetMaxLevels +hypre_AMGHybridSetMaxRowSum +hypre_AMGHybridSetMeasureType +hypre_AMGHybridSetMinCoarseSize +hypre_AMGHybridSetNodal +hypre_AMGHybridSetNonGalerkinTol +hypre_AMGHybridSetNumFunctions +hypre_AMGHybridSetNumGridSweeps +hypre_AMGHybridSetNumPaths +hypre_AMGHybridSetNumSweeps +hypre_AMGHybridSetOmega +hypre_AMGHybridSetOuterWt +hypre_AMGHybridSetPCGMaxIter +hypre_AMGHybridSetPMaxElmts +hypre_AMGHybridSetPrecond +hypre_AMGHybridSetPrintLevel +hypre_AMGHybridSetRecomputeResidual +hypre_AMGHybridSetRecomputeResidualP +hypre_AMGHybridSetRelChange +hypre_AMGHybridSetRelaxOrder +hypre_AMGHybridSetRelaxType +hypre_AMGHybridSetRelaxWeight +hypre_AMGHybridSetRelaxWt +hypre_AMGHybridSetSeqThreshold +hypre_AMGHybridSetSetupType +hypre_AMGHybridSetSolverType +hypre_AMGHybridSetStopCrit +hypre_AMGHybridSetStrongThreshold +hypre_AMGHybridSetTol +hypre_AMGHybridSetTruncFactor +hypre_AMGHybridSetTwoNorm +hypre_AMGHybridSetup +hypre_AMGHybridSolve +hypre_AMGNodalSchwarzSmoother +hypre_AMGeAgglomerate +hypre_AMSComputeGPi +hypre_AMSComputePi +hypre_AMSComputePixyz +hypre_AMSConstructDiscreteGradient +hypre_AMSCreate +hypre_AMSDestroy +hypre_AMSFEIDestroy +hypre_AMSFEISetup +hypre_AMSGetFinalRelativeResidualNorm +hypre_AMSGetNumIterations +hypre_AMSProjectOutGradients +hypre_AMSSetAlphaAMGCoarseRelaxType +hypre_AMSSetAlphaAMGOptions +hypre_AMSSetAlphaPoissonMatrix +hypre_AMSSetBetaAMGCoarseRelaxType +hypre_AMSSetBetaAMGOptions +hypre_AMSSetBetaPoissonMatrix +hypre_AMSSetChebySmoothingOptions +hypre_AMSSetCoordinateVectors +hypre_AMSSetCycleType +hypre_AMSSetDimension +hypre_AMSSetDiscreteGradient +hypre_AMSSetEdgeConstantVectors +hypre_AMSSetInteriorNodes +hypre_AMSSetInterpolations +hypre_AMSSetMaxIter +hypre_AMSSetPrintLevel +hypre_AMSSetProjectionFrequency +hypre_AMSSetSmoothingOptions +hypre_AMSSetTol +hypre_AMSSetup +hypre_AMSSolve +hypre_AdSchwarzCFSolve +hypre_AdSchwarzSolve +hypre_AddToPattern +hypre_AmgCGCBoundaryFix +hypre_AmgCGCChoose +hypre_AmgCGCGraphAssemble +hypre_AmgCGCPrepare +hypre_Bisection +hypre_BlockDiagInvLapack +hypre_BlockTridiagCreate +hypre_BlockTridiagDestroy +hypre_BlockTridiagSetAMGNumSweeps +hypre_BlockTridiagSetAMGRelaxType +hypre_BlockTridiagSetAMGStrengthThreshold +hypre_BlockTridiagSetIndexSet +hypre_BlockTridiagSetPrintLevel +hypre_BlockTridiagSetup +hypre_BlockTridiagSolve +hypre_BoomerAMGAdditiveCycle +hypre_BoomerAMGBlockSolve +hypre_BoomerAMGBuildCoarseOperator +hypre_BoomerAMGBuildCoarseOperatorKT +hypre_BoomerAMGBuildDirInterp +hypre_BoomerAMGBuildDirInterpHost +hypre_BoomerAMGBuildExtInterp +hypre_BoomerAMGBuildExtInterpHost +hypre_BoomerAMGBuildExtPICCInterp +hypre_BoomerAMGBuildExtPIInterp +hypre_BoomerAMGBuildExtPIInterpHost +hypre_BoomerAMGBuildFF1Interp +hypre_BoomerAMGBuildFFInterp +hypre_BoomerAMGBuildInterp +hypre_BoomerAMGBuildInterpGSMG +hypre_BoomerAMGBuildInterpHE +hypre_BoomerAMGBuildInterpLS +hypre_BoomerAMGBuildInterpModUnk +hypre_BoomerAMGBuildInterpOnePnt +hypre_BoomerAMGBuildInterpOnePntHost +hypre_BoomerAMGBuildModExtInterp +hypre_BoomerAMGBuildModExtInterpHost +hypre_BoomerAMGBuildModExtPEInterp +hypre_BoomerAMGBuildModExtPEInterpHost +hypre_BoomerAMGBuildModExtPIInterp +hypre_BoomerAMGBuildModExtPIInterpHost +hypre_BoomerAMGBuildModMultipass +hypre_BoomerAMGBuildModMultipassHost +hypre_BoomerAMGBuildModPartialExtInterp +hypre_BoomerAMGBuildModPartialExtInterpHost +hypre_BoomerAMGBuildModPartialExtPEInterp +hypre_BoomerAMGBuildModPartialExtPEInterpHost +hypre_BoomerAMGBuildMultipass +hypre_BoomerAMGBuildMultipassHost +hypre_BoomerAMGBuildNonGalerkinCoarseOperator +hypre_BoomerAMGBuildPartialExtInterp +hypre_BoomerAMGBuildPartialExtPIInterp +hypre_BoomerAMGBuildPartialStdInterp +hypre_BoomerAMGBuildRestrAIR +hypre_BoomerAMGBuildRestrDist2AIR +hypre_BoomerAMGBuildRestrNeumannAIR +hypre_BoomerAMGBuildRestrNeumannAIRHost +hypre_BoomerAMGBuildStdInterp +hypre_BoomerAMGCGRelaxWt +hypre_BoomerAMGCoarseParms +hypre_BoomerAMGCoarseParmsHost +hypre_BoomerAMGCoarsen +hypre_BoomerAMGCoarsenCGC +hypre_BoomerAMGCoarsenCGCb +hypre_BoomerAMGCoarsenCR +hypre_BoomerAMGCoarsenCR1 +hypre_BoomerAMGCoarsenFalgout +hypre_BoomerAMGCoarsenHMIS +hypre_BoomerAMGCoarsenInterpVectors +hypre_BoomerAMGCoarsenPMIS +hypre_BoomerAMGCoarsenPMISHost +hypre_BoomerAMGCoarsenRuge +hypre_BoomerAMGCorrectCFMarker +hypre_BoomerAMGCorrectCFMarker2 +hypre_BoomerAMGCorrectCFMarker2Host +hypre_BoomerAMGCorrectCFMarkerHost +hypre_BoomerAMGCreate +hypre_BoomerAMGCreate2ndS +hypre_BoomerAMGCreate2ndSHost +hypre_BoomerAMGCreateNodalA +hypre_BoomerAMGCreateS +hypre_BoomerAMGCreateSCommPkg +hypre_BoomerAMGCreateSFromCFMarker +hypre_BoomerAMGCreateSHost +hypre_BoomerAMGCreateSabs +hypre_BoomerAMGCreateSabsHost +hypre_BoomerAMGCreateScalarCF +hypre_BoomerAMGCreateScalarCFS +hypre_BoomerAMGCreateSmoothDirs +hypre_BoomerAMGCreateSmoothVecs +hypre_BoomerAMGCycle +hypre_BoomerAMGCycleT +hypre_BoomerAMGDDCreate +hypre_BoomerAMGDDDestroy +hypre_BoomerAMGDDGetAMG +hypre_BoomerAMGDDGetFACCycleType +hypre_BoomerAMGDDGetFACNumCycles +hypre_BoomerAMGDDGetFACNumRelax +hypre_BoomerAMGDDGetFACRelaxType +hypre_BoomerAMGDDGetFACRelaxWeight +hypre_BoomerAMGDDGetNumGhostLayers +hypre_BoomerAMGDDGetPadding +hypre_BoomerAMGDDGetStartLevel +hypre_BoomerAMGDDSetFACCycleType +hypre_BoomerAMGDDSetFACNumCycles +hypre_BoomerAMGDDSetFACNumRelax +hypre_BoomerAMGDDSetFACRelaxType +hypre_BoomerAMGDDSetFACRelaxWeight +hypre_BoomerAMGDDSetNumGhostLayers +hypre_BoomerAMGDDSetPadding +hypre_BoomerAMGDDSetStartLevel +hypre_BoomerAMGDDSetUserFACRelaxation +hypre_BoomerAMGDDSetup +hypre_BoomerAMGDDSolve +hypre_BoomerAMGDD_AddFlagToSendFlag +hypre_BoomerAMGDD_AddToSendAndRequestDofs +hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo +hypre_BoomerAMGDD_FAC +hypre_BoomerAMGDD_FAC_CFL1Jacobi +hypre_BoomerAMGDD_FAC_CFL1JacobiHost +hypre_BoomerAMGDD_FAC_Cycle +hypre_BoomerAMGDD_FAC_FCycle +hypre_BoomerAMGDD_FAC_GaussSeidel +hypre_BoomerAMGDD_FAC_Interpolate +hypre_BoomerAMGDD_FAC_Jacobi +hypre_BoomerAMGDD_FAC_JacobiHost +hypre_BoomerAMGDD_FAC_OrderedGaussSeidel +hypre_BoomerAMGDD_FAC_Relax +hypre_BoomerAMGDD_FAC_Restrict +hypre_BoomerAMGDD_FindNeighborProcessors +hypre_BoomerAMGDD_FixUpRecvMaps +hypre_BoomerAMGDD_GetDofRecvProc +hypre_BoomerAMGDD_LocalToGlobalIndex +hypre_BoomerAMGDD_MarkCoarse +hypre_BoomerAMGDD_PackColInd +hypre_BoomerAMGDD_PackRecvMapSendBuffer +hypre_BoomerAMGDD_PackResidualBuffer +hypre_BoomerAMGDD_PackSendBuffer +hypre_BoomerAMGDD_RecursivelyBuildPsiComposite +hypre_BoomerAMGDD_RecursivelyFindNeighborNodes +hypre_BoomerAMGDD_RemoveRedundancy +hypre_BoomerAMGDD_ResidualCommunication +hypre_BoomerAMGDD_SetupNearestProcessorNeighbors +hypre_BoomerAMGDD_SubtractLists +hypre_BoomerAMGDD_UnpackRecvBuffer +hypre_BoomerAMGDD_UnpackResidualBuffer +hypre_BoomerAMGDD_UnpackSendFlagBuffer +hypre_BoomerAMGDestroy +hypre_BoomerAMGFitVectors +hypre_BoomerAMGGetAdditive +hypre_BoomerAMGGetAggProlongationName +hypre_BoomerAMGGetCoarsenCutFactor +hypre_BoomerAMGGetCoarsenType +hypre_BoomerAMGGetCoarseningName +hypre_BoomerAMGGetConvergeType +hypre_BoomerAMGGetCumNnzAP +hypre_BoomerAMGGetCumNumIterations +hypre_BoomerAMGGetCycleName +hypre_BoomerAMGGetCycleNumSweeps +hypre_BoomerAMGGetCycleRelaxType +hypre_BoomerAMGGetCycleType +hypre_BoomerAMGGetDebugFlag +hypre_BoomerAMGGetDomainType +hypre_BoomerAMGGetFCycle +hypre_BoomerAMGGetFilterFunctions +hypre_BoomerAMGGetFilterThresholdR +hypre_BoomerAMGGetGridHierarchy +hypre_BoomerAMGGetGridRelaxPoints +hypre_BoomerAMGGetGridRelaxType +hypre_BoomerAMGGetInterpType +hypre_BoomerAMGGetJacobiTruncThreshold +hypre_BoomerAMGGetLevelOuterWt +hypre_BoomerAMGGetLevelRelaxWt +hypre_BoomerAMGGetLogging +hypre_BoomerAMGGetMaxCoarseSize +hypre_BoomerAMGGetMaxIter +hypre_BoomerAMGGetMaxLevels +hypre_BoomerAMGGetMaxRowSum +hypre_BoomerAMGGetMeasureType +hypre_BoomerAMGGetMinCoarseSize +hypre_BoomerAMGGetMinIter +hypre_BoomerAMGGetMultAdditive +hypre_BoomerAMGGetNumFunctions +hypre_BoomerAMGGetNumGridSweeps +hypre_BoomerAMGGetNumIterations +hypre_BoomerAMGGetOmega +hypre_BoomerAMGGetOverlap +hypre_BoomerAMGGetPMaxElmts +hypre_BoomerAMGGetPostInterpType +hypre_BoomerAMGGetPrintFileName +hypre_BoomerAMGGetPrintLevel +hypre_BoomerAMGGetProlongationName +hypre_BoomerAMGGetRedundant +hypre_BoomerAMGGetRelResidualNorm +hypre_BoomerAMGGetRelaxOrder +hypre_BoomerAMGGetRelaxWeight +hypre_BoomerAMGGetResidual +hypre_BoomerAMGGetSchwarzRlxWeight +hypre_BoomerAMGGetSeqThreshold +hypre_BoomerAMGGetSetupType +hypre_BoomerAMGGetSimple +hypre_BoomerAMGGetSmoothNumLevels +hypre_BoomerAMGGetSmoothNumSweeps +hypre_BoomerAMGGetSmoothType +hypre_BoomerAMGGetStrongThreshold +hypre_BoomerAMGGetStrongThresholdR +hypre_BoomerAMGGetTol +hypre_BoomerAMGGetTruncFactor +hypre_BoomerAMGGetVariant +hypre_BoomerAMGIndepHMIS +hypre_BoomerAMGIndepHMISa +hypre_BoomerAMGIndepPMIS +hypre_BoomerAMGIndepPMISa +hypre_BoomerAMGIndepRS +hypre_BoomerAMGIndepRSa +hypre_BoomerAMGIndepSet +hypre_BoomerAMGIndepSetInit +hypre_BoomerAMGInterpTruncation +hypre_BoomerAMGJacobiInterp +hypre_BoomerAMGJacobiInterp_1 +hypre_BoomerAMGNormalizeVecs +hypre_BoomerAMGPrintGeneralInfo +hypre_BoomerAMGRefineInterp +hypre_BoomerAMGRelax +hypre_BoomerAMGRelax0WeightedJacobi +hypre_BoomerAMGRelax10TopoOrderedGaussSeidel +hypre_BoomerAMGRelax11TwoStageGaussSeidel +hypre_BoomerAMGRelax12TwoStageGaussSeidel +hypre_BoomerAMGRelax13HybridL1GaussSeidel +hypre_BoomerAMGRelax14HybridL1GaussSeidel +hypre_BoomerAMGRelax18WeightedL1Jacobi +hypre_BoomerAMGRelax1GaussSeidel +hypre_BoomerAMGRelax2GaussSeidel +hypre_BoomerAMGRelax3HybridGaussSeidel +hypre_BoomerAMGRelax4HybridGaussSeidel +hypre_BoomerAMGRelax5ChaoticHybridGaussSeidel +hypre_BoomerAMGRelax6HybridSSOR +hypre_BoomerAMGRelax7Jacobi +hypre_BoomerAMGRelax89HybridL1SSOR +hypre_BoomerAMGRelax8HybridL1SSOR +hypre_BoomerAMGRelaxComputeL1Norms +hypre_BoomerAMGRelaxHybridGaussSeidel_core +hypre_BoomerAMGRelaxHybridSOR +hypre_BoomerAMGRelaxIF +hypre_BoomerAMGRelaxKaczmarz +hypre_BoomerAMGRelaxT +hypre_BoomerAMGRelaxTwoStageGaussSeidelHost +hypre_BoomerAMGRelaxWeightedJacobi_core +hypre_BoomerAMGRelax_FCFJacobi +hypre_BoomerAMGSetADropTol +hypre_BoomerAMGSetADropType +hypre_BoomerAMGSetAddLastLvl +hypre_BoomerAMGSetAddRelaxType +hypre_BoomerAMGSetAddRelaxWt +hypre_BoomerAMGSetAdditive +hypre_BoomerAMGSetAggInterpType +hypre_BoomerAMGSetAggNumLevels +hypre_BoomerAMGSetAggP12MaxElmts +hypre_BoomerAMGSetAggP12TruncFactor +hypre_BoomerAMGSetAggPMaxElmts +hypre_BoomerAMGSetAggTruncFactor +hypre_BoomerAMGSetCGCIts +hypre_BoomerAMGSetCPoints +hypre_BoomerAMGSetCRRate +hypre_BoomerAMGSetCRStrongTh +hypre_BoomerAMGSetCRUseCG +hypre_BoomerAMGSetChebyEigEst +hypre_BoomerAMGSetChebyFraction +hypre_BoomerAMGSetChebyOrder +hypre_BoomerAMGSetChebyScale +hypre_BoomerAMGSetChebyVariant +hypre_BoomerAMGSetCoarsenCutFactor +hypre_BoomerAMGSetCoarsenType +hypre_BoomerAMGSetConvergeType +hypre_BoomerAMGSetCoordDim +hypre_BoomerAMGSetCoordinates +hypre_BoomerAMGSetCumNnzAP +hypre_BoomerAMGSetCycleNumSweeps +hypre_BoomerAMGSetCycleRelaxType +hypre_BoomerAMGSetCycleType +hypre_BoomerAMGSetDebugFlag +hypre_BoomerAMGSetDofFunc +hypre_BoomerAMGSetDofPoint +hypre_BoomerAMGSetDomainType +hypre_BoomerAMGSetDropTol +hypre_BoomerAMGSetEuBJ +hypre_BoomerAMGSetEuLevel +hypre_BoomerAMGSetEuSparseA +hypre_BoomerAMGSetEuclidFile +hypre_BoomerAMGSetFCycle +hypre_BoomerAMGSetFPoints +hypre_BoomerAMGSetFSAIAlgoType +hypre_BoomerAMGSetFSAIEigMaxIters +hypre_BoomerAMGSetFSAIKapTolerance +hypre_BoomerAMGSetFSAILocalSolveType +hypre_BoomerAMGSetFSAIMaxNnzRow +hypre_BoomerAMGSetFSAIMaxStepSize +hypre_BoomerAMGSetFSAIMaxSteps +hypre_BoomerAMGSetFSAINumLevels +hypre_BoomerAMGSetFSAIThreshold +hypre_BoomerAMGSetFilter +hypre_BoomerAMGSetFilterFunctions +hypre_BoomerAMGSetFilterThresholdR +hypre_BoomerAMGSetGMRESSwitchR +hypre_BoomerAMGSetGSMG +hypre_BoomerAMGSetGridRelaxPoints +hypre_BoomerAMGSetGridRelaxType +hypre_BoomerAMGSetILUDroptol +hypre_BoomerAMGSetILUIterSetupMaxIter +hypre_BoomerAMGSetILUIterSetupOption +hypre_BoomerAMGSetILUIterSetupTolerance +hypre_BoomerAMGSetILUIterSetupType +hypre_BoomerAMGSetILULevel +hypre_BoomerAMGSetILULocalReordering +hypre_BoomerAMGSetILULowerJacobiIters +hypre_BoomerAMGSetILUMaxIter +hypre_BoomerAMGSetILUMaxRowNnz +hypre_BoomerAMGSetILUTriSolve +hypre_BoomerAMGSetILUType +hypre_BoomerAMGSetILUUpperJacobiIters +hypre_BoomerAMGSetISType +hypre_BoomerAMGSetInterpRefine +hypre_BoomerAMGSetInterpType +hypre_BoomerAMGSetInterpVecAbsQTrunc +hypre_BoomerAMGSetInterpVecFirstLevel +hypre_BoomerAMGSetInterpVecQMax +hypre_BoomerAMGSetInterpVecVariant +hypre_BoomerAMGSetInterpVectors +hypre_BoomerAMGSetIsTriangular +hypre_BoomerAMGSetJacobiTruncThreshold +hypre_BoomerAMGSetKeepSameSign +hypre_BoomerAMGSetKeepTranspose +hypre_BoomerAMGSetLevel +hypre_BoomerAMGSetLevelNonGalerkinTol +hypre_BoomerAMGSetLevelOuterWt +hypre_BoomerAMGSetLevelRelaxWt +hypre_BoomerAMGSetLogging +hypre_BoomerAMGSetMaxCoarseSize +hypre_BoomerAMGSetMaxIter +hypre_BoomerAMGSetMaxLevels +hypre_BoomerAMGSetMaxNzPerRow +hypre_BoomerAMGSetMaxRowSum +hypre_BoomerAMGSetMeasureType +hypre_BoomerAMGSetMinCoarseSize +hypre_BoomerAMGSetMinIter +hypre_BoomerAMGSetModuleRAP2 +hypre_BoomerAMGSetMultAddPMaxElmts +hypre_BoomerAMGSetMultAddTruncFactor +hypre_BoomerAMGSetMultAdditive +hypre_BoomerAMGSetNodal +hypre_BoomerAMGSetNodalDiag +hypre_BoomerAMGSetNodalLevels +hypre_BoomerAMGSetNonGalerkTol +hypre_BoomerAMGSetNonGalerkinTol +hypre_BoomerAMGSetNumCRRelaxSteps +hypre_BoomerAMGSetNumFunctions +hypre_BoomerAMGSetNumGridSweeps +hypre_BoomerAMGSetNumIterations +hypre_BoomerAMGSetNumPaths +hypre_BoomerAMGSetNumPoints +hypre_BoomerAMGSetNumSamples +hypre_BoomerAMGSetNumSweeps +hypre_BoomerAMGSetOmega +hypre_BoomerAMGSetOuterWt +hypre_BoomerAMGSetOverlap +hypre_BoomerAMGSetPMaxElmts +hypre_BoomerAMGSetPlotFileName +hypre_BoomerAMGSetPlotGrids +hypre_BoomerAMGSetPointDofMap +hypre_BoomerAMGSetPostInterpType +hypre_BoomerAMGSetPrintFileName +hypre_BoomerAMGSetPrintLevel +hypre_BoomerAMGSetRAP2 +hypre_BoomerAMGSetRedundant +hypre_BoomerAMGSetRelaxOrder +hypre_BoomerAMGSetRelaxType +hypre_BoomerAMGSetRelaxWeight +hypre_BoomerAMGSetRelaxWt +hypre_BoomerAMGSetRestriction +hypre_BoomerAMGSetSabs +hypre_BoomerAMGSetSchwarzRlxWeight +hypre_BoomerAMGSetSchwarzUseNonSymm +hypre_BoomerAMGSetSepWeight +hypre_BoomerAMGSetSeqThreshold +hypre_BoomerAMGSetSetupType +hypre_BoomerAMGSetSimple +hypre_BoomerAMGSetSmoothInterpVectors +hypre_BoomerAMGSetSmoothNumLevels +hypre_BoomerAMGSetSmoothNumSweeps +hypre_BoomerAMGSetSmoothType +hypre_BoomerAMGSetStrongThreshold +hypre_BoomerAMGSetStrongThresholdR +hypre_BoomerAMGSetSym +hypre_BoomerAMGSetThreshold +hypre_BoomerAMGSetTol +hypre_BoomerAMGSetTruncFactor +hypre_BoomerAMGSetVariant +hypre_BoomerAMGSetup +hypre_BoomerAMGSetupStats +hypre_BoomerAMGSmoothInterpVectors +hypre_BoomerAMGSolve +hypre_BoomerAMGSolveT +hypre_BoomerAMGTruncandBuild +hypre_BoomerAMGTruncateInterp +hypre_BoomerAMGWriteSolverParams +hypre_BoomerAMG_GMExpandInterp +hypre_BoomerAMG_LNExpandInterp +hypre_BoomerAMG_MyCreateS +hypre_CSRMatrixDropInplace +hypre_CSRMatrixExtractDenseMat +hypre_CSRMatrixExtractDenseRow +hypre_CSRMatrixNormFro +hypre_CSRMatrixResNormFro +hypre_CSRMatrixTrace +hypre_CreateC +hypre_CreateDinv +hypre_CreateLambda +hypre_DenseSPDSystemSolve +hypre_ExtendWtoPHost +hypre_FSAIApply +hypre_FSAIComputeOmega +hypre_FSAICreate +hypre_FSAIDestroy +hypre_FSAIDumpLocalLSDense +hypre_FSAIGetAlgoType +hypre_FSAIGetEigMaxIters +hypre_FSAIGetKapTolerance +hypre_FSAIGetLocalSolveType +hypre_FSAIGetLogging +hypre_FSAIGetMaxIterations +hypre_FSAIGetMaxNnzRow +hypre_FSAIGetMaxStepSize +hypre_FSAIGetMaxSteps +hypre_FSAIGetNumIterations +hypre_FSAIGetNumLevels +hypre_FSAIGetOmega +hypre_FSAIGetPrintLevel +hypre_FSAIGetThreshold +hypre_FSAIGetTolerance +hypre_FSAIGetZeroGuess +hypre_FSAIPrintStats +hypre_FSAISetAlgoType +hypre_FSAISetEigMaxIters +hypre_FSAISetKapTolerance +hypre_FSAISetLocalSolveType +hypre_FSAISetLogging +hypre_FSAISetMaxIterations +hypre_FSAISetMaxNnzRow +hypre_FSAISetMaxStepSize +hypre_FSAISetMaxSteps +hypre_FSAISetNumIterations +hypre_FSAISetNumLevels +hypre_FSAISetOmega +hypre_FSAISetPrintLevel +hypre_FSAISetThreshold +hypre_FSAISetTolerance +hypre_FSAISetZeroGuess +hypre_FSAISetup +hypre_FSAISetupNative +hypre_FSAISetupOMPDyn +hypre_FSAISolve +hypre_FindKapGrad +hypre_GaussElimSetup +hypre_GaussElimSolve +hypre_GenerateCoordinates +hypre_GenerateMultiPi +hypre_GenerateMultipassPi +hypre_GenerateScale +hypre_GenerateSendMapAndCommPkg +hypre_GenerateSubComm +hypre_GetCommPkgRTFromCommPkgA +hypre_GrabSubArray +hypre_GraphAdd +hypre_GraphRemove +hypre_ILUBuildRASExternalMatrix +hypre_ILUCSRMatrixInverseSelfPrecondMRGlobal +hypre_ILUCreate +hypre_ILUDestroy +hypre_ILUGetFinalRelativeResidualNorm +hypre_ILUGetInteriorExteriorPerm +hypre_ILUGetIterativeSetupHistory +hypre_ILUGetLocalPerm +hypre_ILUGetNumIterations +hypre_ILUGetPermddPQ +hypre_ILUGetPermddPQPre +hypre_ILULocalRCM +hypre_ILULocalRCMBuildFinalPerm +hypre_ILULocalRCMBuildLevel +hypre_ILULocalRCMFindPPNode +hypre_ILULocalRCMMindegree +hypre_ILULocalRCMNumbering +hypre_ILULocalRCMOrder +hypre_ILULocalRCMQsort +hypre_ILULocalRCMReverse +hypre_ILUMaxQSplitRabsI +hypre_ILUMaxRabs +hypre_ILUMaxrHeapAddRabsI +hypre_ILUMaxrHeapRemoveRabsI +hypre_ILUMinHeapAddI +hypre_ILUMinHeapAddIIIi +hypre_ILUMinHeapAddIRIi +hypre_ILUMinHeapRemoveI +hypre_ILUMinHeapRemoveIIIi +hypre_ILUMinHeapRemoveIRIi +hypre_ILUParCSRInverseNSH +hypre_ILUSetDropThreshold +hypre_ILUSetDropThresholdArray +hypre_ILUSetIterativeSetupMaxIter +hypre_ILUSetIterativeSetupOption +hypre_ILUSetIterativeSetupTolerance +hypre_ILUSetIterativeSetupType +hypre_ILUSetLevelOfFill +hypre_ILUSetLocalReordering +hypre_ILUSetLogging +hypre_ILUSetLowerJacobiIters +hypre_ILUSetMaxIter +hypre_ILUSetMaxNnzPerRow +hypre_ILUSetPrintLevel +hypre_ILUSetSchurNSHDropThreshold +hypre_ILUSetSchurNSHDropThresholdArray +hypre_ILUSetSchurPrecondILUDropThreshold +hypre_ILUSetSchurPrecondILUDropThresholdArray +hypre_ILUSetSchurPrecondILULevelOfFill +hypre_ILUSetSchurPrecondILUMaxNnzPerRow +hypre_ILUSetSchurPrecondILUType +hypre_ILUSetSchurPrecondLowerJacobiIters +hypre_ILUSetSchurPrecondMaxIter +hypre_ILUSetSchurPrecondPrintLevel +hypre_ILUSetSchurPrecondTol +hypre_ILUSetSchurPrecondTriSolve +hypre_ILUSetSchurPrecondUpperJacobiIters +hypre_ILUSetSchurSolverAbsoluteTol +hypre_ILUSetSchurSolverKDIM +hypre_ILUSetSchurSolverLogging +hypre_ILUSetSchurSolverMaxIter +hypre_ILUSetSchurSolverPrintLevel +hypre_ILUSetSchurSolverRelChange +hypre_ILUSetSchurSolverTol +hypre_ILUSetTol +hypre_ILUSetTriSolve +hypre_ILUSetType +hypre_ILUSetUpperJacobiIters +hypre_ILUSetup +hypre_ILUSetupILU0 +hypre_ILUSetupILU0RAS +hypre_ILUSetupILUK +hypre_ILUSetupILUKRAS +hypre_ILUSetupILUKRASSymbolic +hypre_ILUSetupILUKSymbolic +hypre_ILUSetupILUT +hypre_ILUSetupILUTRAS +hypre_ILUSetupLDUtoCusparse +hypre_ILUSetupMILU0 +hypre_ILUSetupRAPILU0 +hypre_ILUSetupRAPILU0Device +hypre_ILUSetupRAPMILU0 +hypre_ILUSolve +hypre_ILUSolveLU +hypre_ILUSolveLUIter +hypre_ILUSolveLURAS +hypre_ILUSolveRAPGMRESHost +hypre_ILUSolveSchurGMRES +hypre_ILUSolveSchurNSH +hypre_ILUSortOffdColmap +hypre_ILUWriteSolverParams +hypre_IndepSetGreedy +hypre_IndepSetGreedyS +hypre_IntersectTwoArrays +hypre_IntersectTwoBigArrays +hypre_LINPACKcgpthy +hypre_LINPACKcgtql1 +hypre_MGRAddVectorP +hypre_MGRAddVectorR +hypre_MGRApproximateInverse +hypre_MGRBlockColLumpedRestrict +hypre_MGRBlockRelaxSetup +hypre_MGRBlockRelaxSolve +hypre_MGRBlockRelaxSolveDevice +hypre_MGRBuildAff +hypre_MGRBuildBlockJacobiP +hypre_MGRBuildBlockJacobiWp +hypre_MGRBuildCoarseOperator +hypre_MGRBuildInterp +hypre_MGRBuildInterpApproximateInverse +hypre_MGRBuildNonGalerkinCoarseOperator +hypre_MGRBuildNonGalerkinCoarseOperatorDevice +hypre_MGRBuildNonGalerkinCoarseOperatorHost +hypre_MGRBuildP +hypre_MGRBuildPDRS +hypre_MGRBuildPFromWp +hypre_MGRBuildPFromWpHost +hypre_MGRBuildPHost +hypre_MGRBuildRFromWr +hypre_MGRBuildRFromWrHost +hypre_MGRBuildRestrict +hypre_MGRCoarseParms +hypre_MGRCoarsen +hypre_MGRColLumpedRestrict +hypre_MGRCreate +hypre_MGRCreateFrelaxVcycleData +hypre_MGRCreateGSElimData +hypre_MGRCycle +hypre_MGRDataPrint +hypre_MGRDestroy +hypre_MGRDestroyFrelaxVcycleData +hypre_MGRDestroyGSElimData +hypre_MGRFrelaxVcycle +hypre_MGRGetCoarseGridConvergenceFactor +hypre_MGRGetCoarseGridName +hypre_MGRGetFRelaxName +hypre_MGRGetFinalRelativeResidualNorm +hypre_MGRGetGlobalRelaxName +hypre_MGRGetNumIterations +hypre_MGRGetProlongationName +hypre_MGRGetRestrictionName +hypre_MGRGetSubBlock +hypre_MGRNonGalerkinTruncate +hypre_MGRPrintCoarseSystem +hypre_MGRSetBlockJacobiBlockSize +hypre_MGRSetBlockSize +hypre_MGRSetCoarseGridMethod +hypre_MGRSetCoarseGridPrintLevel +hypre_MGRSetCoarseSolver +hypre_MGRSetCpointsByBlock +hypre_MGRSetCpointsByContiguousBlock +hypre_MGRSetCpointsByPointMarkerArray +hypre_MGRSetFRelaxMethod +hypre_MGRSetFSolver +hypre_MGRSetFSolverAtLevel +hypre_MGRSetFrelaxPrintLevel +hypre_MGRSetGlobalSmoothCycle +hypre_MGRSetGlobalSmoothType +hypre_MGRSetGlobalSmootherAtLevel +hypre_MGRSetInterpType +hypre_MGRSetLevelFRelaxMethod +hypre_MGRSetLevelFRelaxNumFunctions +hypre_MGRSetLevelFRelaxType +hypre_MGRSetLevelInterpType +hypre_MGRSetLevelNonGalerkinMaxElmts +hypre_MGRSetLevelNumRelaxSweeps +hypre_MGRSetLevelPMaxElmts +hypre_MGRSetLevelRestrictType +hypre_MGRSetLevelSmoothIters +hypre_MGRSetLevelSmoothType +hypre_MGRSetLogging +hypre_MGRSetMaxCoarseLevels +hypre_MGRSetMaxGlobalSmoothIters +hypre_MGRSetMaxIter +hypre_MGRSetNonCpointsToFpoints +hypre_MGRSetNonGalerkinMaxElmts +hypre_MGRSetNumInterpSweeps +hypre_MGRSetNumRelaxSweeps +hypre_MGRSetNumRestrictSweeps +hypre_MGRSetPMaxElmts +hypre_MGRSetPrintLevel +hypre_MGRSetReductionLevelCpoints +hypre_MGRSetRelaxType +hypre_MGRSetReservedCoarseNodes +hypre_MGRSetReservedCpointsLevelToKeep +hypre_MGRSetRestrictType +hypre_MGRSetTol +hypre_MGRSetTruncateCoarseGridThreshold +hypre_MGRSetup +hypre_MGRSetupFrelaxVcycleData +hypre_MGRSetupStats +hypre_MGRSmallBlkInverse +hypre_MGRSolve +hypre_MGRTruncateAcfCPR +hypre_MGRTruncateAcfCPRDevice +hypre_MPSchwarzCFFWSolve +hypre_MPSchwarzCFSolve +hypre_MPSchwarzFWSolve +hypre_MPSchwarzSolve +hypre_NSHCreate +hypre_NSHDestroy +hypre_NSHSetColVersion +hypre_NSHSetDropThreshold +hypre_NSHSetDropThresholdArray +hypre_NSHSetGlobalSolver +hypre_NSHSetLogging +hypre_NSHSetMRMaxIter +hypre_NSHSetMRMaxRowNnz +hypre_NSHSetMRTol +hypre_NSHSetMaxIter +hypre_NSHSetNSHMaxIter +hypre_NSHSetNSHMaxRowNnz +hypre_NSHSetNSHTol +hypre_NSHSetPrintLevel +hypre_NSHSetTol +hypre_NSHSetup +hypre_NSHSolve +hypre_NSHSolveInverse +hypre_NSHWriteSolverParams +hypre_NonGalerkinIJBigBufferInit +hypre_NonGalerkinIJBufferCompress +hypre_NonGalerkinIJBufferCompressRow +hypre_NonGalerkinIJBufferEmpty +hypre_NonGalerkinIJBufferInit +hypre_NonGalerkinIJBufferNewRow +hypre_NonGalerkinIJBufferWrite +hypre_NonGalerkinSparsityPattern +hypre_ParAMGCreateDomainDof +hypre_ParAdSchwarzSolve +hypre_ParCSRComputeL1Norms +hypre_ParCSRComputeL1NormsThreads +hypre_ParCSRMatrixBlockDiagMatrix +hypre_ParCSRMatrixBlockDiagMatrixHost +hypre_ParCSRMatrixChooseThresh +hypre_ParCSRMatrixExtractBlockDiagHost +hypre_ParCSRMatrixFillSmooth +hypre_ParCSRMatrixFixZeroRows +hypre_ParCSRMatrixFixZeroRowsHost +hypre_ParCSRMatrixNormFro +hypre_ParCSRMatrixResNormFro +hypre_ParCSRMatrixScaledNorm +hypre_ParCSRMatrixSetDiagRows +hypre_ParCSRMatrixThreshold +hypre_ParCSRMatrix_dof_func_offd +hypre_ParCSRMaxEigEstimate +hypre_ParCSRMaxEigEstimateCG +hypre_ParCSRMaxEigEstimateCGHost +hypre_ParCSRMaxEigEstimateHost +hypre_ParCSRRelax +hypre_ParCSRRelax_CG +hypre_ParCSRRelax_Cheby +hypre_ParCSRRelax_Cheby_Setup +hypre_ParCSRRelax_Cheby_Solve +hypre_ParCSRRelax_Cheby_SolveHost +hypre_ParCSRRelax_L1_Jacobi +hypre_ParCSRSubspacePrec +hypre_ParGenerateHybridScale +hypre_ParGenerateScale +hypre_ParILUExtractEBFC +hypre_ParILURAPReorder +hypre_ParILURAPSchurGMRESCommInfoHost +hypre_ParILURAPSchurGMRESMatvecHost +hypre_ParILURAPSchurGMRESSolveHost +hypre_ParKrylovAxpy +hypre_ParKrylovCAlloc +hypre_ParKrylovClearVector +hypre_ParKrylovCommInfo +hypre_ParKrylovCopyVector +hypre_ParKrylovCreateVector +hypre_ParKrylovCreateVectorArray +hypre_ParKrylovDestroyVector +hypre_ParKrylovFree +hypre_ParKrylovIdentity +hypre_ParKrylovIdentitySetup +hypre_ParKrylovInnerProd +hypre_ParKrylovInnerProdTagged +hypre_ParKrylovMassAxpy +hypre_ParKrylovMassDotpTwo +hypre_ParKrylovMassInnerProd +hypre_ParKrylovMatvec +hypre_ParKrylovMatvecCreate +hypre_ParKrylovMatvecDestroy +hypre_ParKrylovMatvecT +hypre_ParKrylovScaleVector +hypre_ParMPSchwarzSolve +hypre_ParPrintVector +hypre_ParReadVector +hypre_ParSetRandomValues +hypre_ParVectorBlockGather +hypre_ParVectorBlockSplit +hypre_ParVectorInDomainOf +hypre_ParVectorInRangeOf +hypre_ParVectorSize +hypre_PartialSelectSortCI +hypre_SchwarzCFSolve +hypre_SchwarzCreate +hypre_SchwarzDestroy +hypre_SchwarzReScale +hypre_SchwarzSetDofFunc +hypre_SchwarzSetDomainStructure +hypre_SchwarzSetDomainType +hypre_SchwarzSetNonSymm +hypre_SchwarzSetNumFunctions +hypre_SchwarzSetOverlap +hypre_SchwarzSetRelaxWeight +hypre_SchwarzSetScale +hypre_SchwarzSetVariant +hypre_SchwarzSetup +hypre_SchwarzSolve +hypre_SortedCopyParCSRData +hypre_alt_insert_new_nodes +hypre_amsconstructdiscretegradient +hypre_amscreate +hypre_amsdestroy +hypre_amsgetfinalrelativeresidualnorm +hypre_amsgetnumiterations +hypre_amssetalphaamgoptions +hypre_amssetalphapoissonmatrix +hypre_amssetbetaamgoptions +hypre_amssetbetapoissonmatrix +hypre_amssetcoordinatevectors +hypre_amssetcycletype +hypre_amssetdimension +hypre_amssetdiscretegradient +hypre_amssetedgeconstantvectors +hypre_amssetmaxiter +hypre_amssetprintlevel +hypre_amssetsmoothingoptions +hypre_amssettol +hypre_amssetup +hypre_amssolve +hypre_big_insert_new_nodes +hypre_blas_mat_inv +hypre_blas_smat_inv_n2 +hypre_blas_smat_inv_n3 +hypre_blas_smat_inv_n4 +hypre_block_jacobi_solve +hypre_blocktridiagcreate +hypre_blocktridiagdestroy +hypre_blocktridiagsetamgnumswee +hypre_blocktridiagsetamgrelaxty +hypre_blocktridiagsetamgstrengt +hypre_blocktridiagsetindexset +hypre_blocktridiagsetprintlevel +hypre_blocktridiagsetup +hypre_blocktridiagsolve +hypre_boomeramgcreate +hypre_boomeramgdestroy +hypre_boomeramgfingridrelaxatn +hypre_boomeramggetadditive +hypre_boomeramggetcoarsentype +hypre_boomeramggetcumnumiterati +hypre_boomeramggetcyclenumsweeps +hypre_boomeramggetcyclerelaxtype +hypre_boomeramggetcycletype +hypre_boomeramggetdebugflag +hypre_boomeramggetdomaintype +hypre_boomeramggetfinalreltvres +hypre_boomeramggetjacobitrunc +hypre_boomeramggetlogging +hypre_boomeramggetmaxcoarsesize +hypre_boomeramggetmaxiter +hypre_boomeramggetmaxlevels +hypre_boomeramggetmaxrowsum +hypre_boomeramggetmeasuretype +hypre_boomeramggetmincoarsesize +hypre_boomeramggetmultadd +hypre_boomeramggetnumfunctions +hypre_boomeramggetnumiterations +hypre_boomeramggetoverlap +hypre_boomeramggetpmaxelmts +hypre_boomeramggetprintlevel +hypre_boomeramggetresidual +hypre_boomeramggetschwarzrlxwt +hypre_boomeramggetsimple +hypre_boomeramggetsmoothnumlvls +hypre_boomeramggetsmoothnumswps +hypre_boomeramggetsmoothtype +hypre_boomeramggetstrongthrshld +hypre_boomeramggettol +hypre_boomeramggettruncfactor +hypre_boomeramggetvariant +hypre_boomeramginitgridrelaxatn +hypre_boomeramgsetadditive +hypre_boomeramgsetaddlastlvl +hypre_boomeramgsetaddrlxtype +hypre_boomeramgsetaddrlxwt +hypre_boomeramgsetagginterptype +hypre_boomeramgsetaggnumlevels +hypre_boomeramgsetaggp12maxelmt +hypre_boomeramgsetaggp12trfac +hypre_boomeramgsetaggpmaxelmts +hypre_boomeramgsetaggtrfactor +hypre_boomeramgsetcgcits +hypre_boomeramgsetchebyeigest +hypre_boomeramgsetchebyfract +hypre_boomeramgsetchebyorder +hypre_boomeramgsetchebyscale +hypre_boomeramgsetchebyvariant +hypre_boomeramgsetcoarsentype +hypre_boomeramgsetcyclenumsweeps +hypre_boomeramgsetcyclerelaxtype +hypre_boomeramgsetcycletype +hypre_boomeramgsetdebugflag +hypre_boomeramgsetdoffunc +hypre_boomeramgsetdomaintype +hypre_boomeramgsetdroptol +hypre_boomeramgseteubj +hypre_boomeramgseteuclidfile +hypre_boomeramgseteulevel +hypre_boomeramgseteusparsea +hypre_boomeramgsetfilter +hypre_boomeramgsetgridrelaxpnts +hypre_boomeramgsetgridrelaxtype +hypre_boomeramgsetgsmg +hypre_boomeramgsetinterptype +hypre_boomeramgsetinterpvecqmx +hypre_boomeramgsetinterpvecqtr +hypre_boomeramgsetinterpvecs +hypre_boomeramgsetinterpvecvar +hypre_boomeramgsetjacobitrunc +hypre_boomeramgsetkeeptransp +hypre_boomeramgsetlevel +hypre_boomeramgsetlevelouterwt +hypre_boomeramgsetlevelrelaxwt +hypre_boomeramgsetlogging +hypre_boomeramgsetlvlnongaltol +hypre_boomeramgsetmaxcoarsesize +hypre_boomeramgsetmaxiter +hypre_boomeramgsetmaxlevels +hypre_boomeramgsetmaxnzperrow +hypre_boomeramgsetmaxrowsum +hypre_boomeramgsetmeasuretype +hypre_boomeramgsetmincoarsesize +hypre_boomeramgsetminiter +hypre_boomeramgsetmultadd +hypre_boomeramgsetmultaddpmx +hypre_boomeramgsetmultaddtrf +hypre_boomeramgsetnodal +hypre_boomeramgsetnodaldiag +hypre_boomeramgsetnongaltol +hypre_boomeramgsetnumfunctions +hypre_boomeramgsetnumgridsweeps +hypre_boomeramgsetnumpaths +hypre_boomeramgsetnumsamples +hypre_boomeramgsetnumsweeps +hypre_boomeramgsetolddefault +hypre_boomeramgsetouterwt +hypre_boomeramgsetoverlap +hypre_boomeramgsetpmaxelmts +hypre_boomeramgsetpostinterp +hypre_boomeramgsetprintfilename +hypre_boomeramgsetprintlevel +hypre_boomeramgsetrap2 +hypre_boomeramgsetredundant +hypre_boomeramgsetrelaxorder +hypre_boomeramgsetrelaxtype +hypre_boomeramgsetrelaxweight +hypre_boomeramgsetrelaxwt +hypre_boomeramgsetrestriction +hypre_boomeramgsetschwarznonsym +hypre_boomeramgsetschwarzrlxwt +hypre_boomeramgsetsepweight +hypre_boomeramgsetseqthrshold +hypre_boomeramgsetsetuptype +hypre_boomeramgsetsimple +hypre_boomeramgsetsmoothnumlvls +hypre_boomeramgsetsmoothnumswps +hypre_boomeramgsetsmoothtype +hypre_boomeramgsetstrongthrshld +hypre_boomeramgsetsym +hypre_boomeramgsetthreshold +hypre_boomeramgsettol +hypre_boomeramgsettruncfactor +hypre_boomeramgsetup +hypre_boomeramgsetvariant +hypre_boomeramgsolve +hypre_boomeramgsolvet +hypre_build_interp_colmap +hypre_cr +hypre_euclidcreate +hypre_eucliddestroy +hypre_euclidsetbj +hypre_euclidsetilut +hypre_euclidsetlevel +hypre_euclidsetmem +hypre_euclidsetparams +hypre_euclidsetparamsfromfile +hypre_euclidsetrowscale +hypre_euclidsetsparsea +hypre_euclidsetstats +hypre_euclidsetup +hypre_euclidsolve +hypre_exchange_interp_data +hypre_exchange_marker +hypre_fgmresT +hypre_formu +hypre_fptgscr +hypre_fptjaccr +hypre_generatelaplacian +hypre_ilucreate +hypre_iludestroy +hypre_ilugetfinalrelresnorm +hypre_ilugetnumiterations +hypre_ilusetdropthreshold +hypre_ilusetdropthresholdarray +hypre_ilusetleveloffill +hypre_ilusetlocalreordering +hypre_ilusetlogging +hypre_ilusetmaxiter +hypre_ilusetmaxnnzperrow +hypre_ilusetnshdropthreshold +hypre_ilusetprintlevel +hypre_ilusetschurmaxiter +hypre_ilusettol +hypre_ilusettype +hypre_ilusetup +hypre_ilusolve +hypre_index_of_minimum +hypre_initialize_vecs +hypre_map +hypre_map2 +hypre_matinv +hypre_merge_lists +hypre_mgrbuildaff +hypre_mgrcreate +hypre_mgrdestroy +hypre_mgrgetcoarsegridconvfac +hypre_mgrgetfinalrelresnorm +hypre_mgrgetnumiterations +hypre_mgrsetblocksize +hypre_mgrsetcgridprintlevel +hypre_mgrsetcgridthreshold +hypre_mgrsetcoarsegridmethod +hypre_mgrsetcoarsesolver +hypre_mgrsetcpointsbyblock +hypre_mgrsetcptsbyctgblock +hypre_mgrsetcptsbymarkerarray +hypre_mgrsetfrelaxmethod +hypre_mgrsetfrelaxprintlevel +hypre_mgrsetfsolver +hypre_mgrsetglobalsmoothtype +hypre_mgrsetinterptype +hypre_mgrsetlevelfrelaxmethod +hypre_mgrsetlevelfrelaxnumfunc +hypre_mgrsetlevelinterptype +hypre_mgrsetlevelrestricttype +hypre_mgrsetlogging +hypre_mgrsetmaxcoarselevels +hypre_mgrsetmaxglobalsmoothit +hypre_mgrsetmaxiter +hypre_mgrsetnoncptstofpts +hypre_mgrsetnuminterpsweeps +hypre_mgrsetnumrelaxsweeps +hypre_mgrsetnumrestrictsweeps +hypre_mgrsetpmaxelmts +hypre_mgrsetprintlevel +hypre_mgrsetrelaxtype +hypre_mgrsetreservedcoarsenodes +hypre_mgrsetreservedcptslevel +hypre_mgrsetrestricttype +hypre_mgrsettol +hypre_mgrsetup +hypre_mgrsolve +hypre_move_entry +hypre_ordered_GS +hypre_parCorrRes +hypre_parasailscreate +hypre_parasailsdestroy +hypre_parasailsgetfilter +hypre_parasailsgetloadbal +hypre_parasailsgetlogging +hypre_parasailsgetnlevels +hypre_parasailsgetreuse +hypre_parasailsgetsym +hypre_parasailsgetthresh +hypre_parasailssetfilter +hypre_parasailssetloadbal +hypre_parasailssetlogging +hypre_parasailssetnlevels +hypre_parasailssetparams +hypre_parasailssetreuse +hypre_parasailssetsym +hypre_parasailssetthresh +hypre_parasailssetup +hypre_parasailssolve +hypre_parcsrbicgstabcreate +hypre_parcsrbicgstabdestroy +hypre_parcsrbicgstabgetfinalrel +hypre_parcsrbicgstabgetnumiter +hypre_parcsrbicgstabgetprecond +hypre_parcsrbicgstabsetatol +hypre_parcsrbicgstabsetlogging +hypre_parcsrbicgstabsetmaxiter +hypre_parcsrbicgstabsetminiter +hypre_parcsrbicgstabsetprecond +hypre_parcsrbicgstabsetprintlev +hypre_parcsrbicgstabsetstopcrit +hypre_parcsrbicgstabsettol +hypre_parcsrbicgstabsetup +hypre_parcsrbicgstabsolve +hypre_parcsrcgnrcreate +hypre_parcsrcgnrdestroy +hypre_parcsrcgnrgetfinalrelativ +hypre_parcsrcgnrgetnumiteration +hypre_parcsrcgnrgetprecond +hypre_parcsrcgnrsetlogging +hypre_parcsrcgnrsetmaxiter +hypre_parcsrcgnrsetminiter +hypre_parcsrcgnrsetprecond +hypre_parcsrcgnrsetstopcrit +hypre_parcsrcgnrsettol +hypre_parcsrcgnrsetup +hypre_parcsrcgnrsolve +hypre_parcsrcogmrescreate +hypre_parcsrcogmresdestroy +hypre_parcsrcogmresgetfinalrela +hypre_parcsrcogmresgetnumiterat +hypre_parcsrcogmresgetprecond +hypre_parcsrcogmressetabsolutet +hypre_parcsrcogmressetcgs +hypre_parcsrcogmressetkdim +hypre_parcsrcogmressetlogging +hypre_parcsrcogmressetmaxiter +hypre_parcsrcogmressetminiter +hypre_parcsrcogmressetprecond +hypre_parcsrcogmressetprintleve +hypre_parcsrcogmressettol +hypre_parcsrcogmressetunroll +hypre_parcsrcogmressetup +hypre_parcsrcogmressolve +hypre_parcsrdiagscale +hypre_parcsrdiagscalesetup +hypre_parcsrflexgmrescreate +hypre_parcsrflexgmresdestroy +hypre_parcsrflexgmresgetfinalrelati +hypre_parcsrflexgmresgetnumiteratio +hypre_parcsrflexgmresgetprecond +hypre_parcsrflexgmressetabsolutetol +hypre_parcsrflexgmressetkdim +hypre_parcsrflexgmressetlogging +hypre_parcsrflexgmressetmaxiter +hypre_parcsrflexgmressetminiter +hypre_parcsrflexgmressetprecond +hypre_parcsrflexgmressetprintlevel +hypre_parcsrflexgmressettol +hypre_parcsrflexgmressetup +hypre_parcsrflexgmressolve +hypre_parcsrgmrescreate +hypre_parcsrgmresdestroy +hypre_parcsrgmresgetfinalrelati +hypre_parcsrgmresgetnumiteratio +hypre_parcsrgmresgetprecond +hypre_parcsrgmressetabsolutetol +hypre_parcsrgmressetkdim +hypre_parcsrgmressetlogging +hypre_parcsrgmressetmaxiter +hypre_parcsrgmressetminiter +hypre_parcsrgmressetprecond +hypre_parcsrgmressetprintlevel +hypre_parcsrgmressetstopcrit +hypre_parcsrgmressettol +hypre_parcsrgmressetup +hypre_parcsrgmressolve +hypre_parcsrhybridcreate +hypre_parcsrhybriddestroy +hypre_parcsrhybridgetdscgnumite +hypre_parcsrhybridgetfinalrelat +hypre_parcsrhybridgetnumiterati +hypre_parcsrhybridgetpcgnumiter +hypre_parcsrhybridsetaggnumlev +hypre_parcsrhybridsetcoarsentyp +hypre_parcsrhybridsetconvergenc +hypre_parcsrhybridsetcyclenumsw +hypre_parcsrhybridsetcyclerelax +hypre_parcsrhybridsetcycletype +hypre_parcsrhybridsetdoffunc +hypre_parcsrhybridsetdscgmaxite +hypre_parcsrhybridsetgridrelaxp +hypre_parcsrhybridsetgridrelaxt +hypre_parcsrhybridsetinterptyp +hypre_parcsrhybridsetkdim +hypre_parcsrhybridsetkeeptrans +hypre_parcsrhybridsetlevelouter +hypre_parcsrhybridsetlevelrelax +hypre_parcsrhybridsetlogging +hypre_parcsrhybridsetmaxlevels +hypre_parcsrhybridsetmaxrowsum +hypre_parcsrhybridsetmeasuretyp +hypre_parcsrhybridsetnodal +hypre_parcsrhybridsetnongaltol +hypre_parcsrhybridsetnumfunc +hypre_parcsrhybridsetnumgridswe +hypre_parcsrhybridsetnumpaths +hypre_parcsrhybridsetnumsweeps +hypre_parcsrhybridsetomega +hypre_parcsrhybridsetouterwt +hypre_parcsrhybridsetpcgmaxiter +hypre_parcsrhybridsetpmaxelmts +hypre_parcsrhybridsetprecond +hypre_parcsrhybridsetprintlevel +hypre_parcsrhybridsetrelaxorder +hypre_parcsrhybridsetrelaxtype +hypre_parcsrhybridsetrelaxweigh +hypre_parcsrhybridsetrelaxwt +hypre_parcsrhybridsetrelchange +hypre_parcsrhybridsetsolvertype +hypre_parcsrhybridsetstopcrit +hypre_parcsrhybridsetstrongthre +hypre_parcsrhybridsettol +hypre_parcsrhybridsettruncfacto +hypre_parcsrhybridsettwonorm +hypre_parcsrhybridsetup +hypre_parcsrhybridsolve +hypre_parcsrlgmrescreate +hypre_parcsrlgmresdestroy +hypre_parcsrlgmresgetfinalrelati +hypre_parcsrlgmresgetnumiteratio +hypre_parcsrlgmresgetprecond +hypre_parcsrlgmressetabsolutetol +hypre_parcsrlgmressetkdim +hypre_parcsrlgmressetlogging +hypre_parcsrlgmressetmaxiter +hypre_parcsrlgmressetminiter +hypre_parcsrlgmressetprecond +hypre_parcsrlgmressetprintlevel +hypre_parcsrlgmressettol +hypre_parcsrlgmressetup +hypre_parcsrlgmressolve +hypre_parcsrmultivectorprint +hypre_parcsrmultivectorread +hypre_parcsrpcgcreate +hypre_parcsrpcgdestroy +hypre_parcsrpcggetfinalrelative +hypre_parcsrpcggetnumiterations +hypre_parcsrpcggetprecond +hypre_parcsrpcgsetatol +hypre_parcsrpcgsetlogging +hypre_parcsrpcgsetmaxiter +hypre_parcsrpcgsetprecond +hypre_parcsrpcgsetprintlevel +hypre_parcsrpcgsetrelchange +hypre_parcsrpcgsetstopcrit +hypre_parcsrpcgsettol +hypre_parcsrpcgsettwonorm +hypre_parcsrpcgsetup +hypre_parcsrpcgsolve +hypre_parcsrpilutcreate +hypre_parcsrpilutdestroy +hypre_parcsrpilutsetdroptoleran +hypre_parcsrpilutsetfacrowsize +hypre_parcsrpilutsetmaxiter +hypre_parcsrpilutsetup +hypre_parcsrpilutsolve +hypre_parcsrsetupinterpreter +hypre_parcsrsetupmatvec +hypre_parprintvector +hypre_parreadvector +hypre_parsetrandomvalues +hypre_parvectorsize +hypre_qsort2_ci +hypre_remove_entry +hypre_schwarzcreate +hypre_schwarzdestroy +hypre_schwarzsetdoffunc +hypre_schwarzsetdomainstructure +hypre_schwarzsetdomaintype +hypre_schwarzsetnumfunctions +hypre_schwarzsetoverlap +hypre_schwarzsetrelaxweight +hypre_schwarzsetup +hypre_schwarzsetvariant +hypre_schwarzsolve +hypre_seqAMGCycle +hypre_seqAMGSetup +hypre_ssort +hypre_swap2_ci +hypre_swap_int +hypre_tempparcsrsetupinterprete +hypre_update_entry +matrix_matrix_product +rfun +rfun_rs +transpose_matrix_create diff --git a/src/parcsr_ls/mup.functions b/src/parcsr_ls/mup.functions new file mode 100644 index 0000000000..031587eda9 --- /dev/null +++ b/src/parcsr_ls/mup.functions @@ -0,0 +1,656 @@ +HYPRE_ADSCreate +HYPRE_ADSDestroy +HYPRE_ADSGetFinalRelativeResidualNorm +HYPRE_ADSGetNumIterations +HYPRE_ADSSetAMGOptions +HYPRE_ADSSetAMSOptions +HYPRE_ADSSetChebySmoothingOptions +HYPRE_ADSSetCoordinateVectors +HYPRE_ADSSetCycleType +HYPRE_ADSSetDiscreteCurl +HYPRE_ADSSetDiscreteGradient +HYPRE_ADSSetInterpolations +HYPRE_ADSSetMaxIter +HYPRE_ADSSetPrintLevel +HYPRE_ADSSetSmoothingOptions +HYPRE_ADSSetTol +HYPRE_ADSSetup +HYPRE_ADSSolve +HYPRE_AMECreate +HYPRE_AMEDestroy +HYPRE_AMEGetEigenvalues +HYPRE_AMEGetEigenvectors +HYPRE_AMESetAMSSolver +HYPRE_AMESetBlockSize +HYPRE_AMESetMassMatrix +HYPRE_AMESetMaxIter +HYPRE_AMESetMaxPCGIter +HYPRE_AMESetPrintLevel +HYPRE_AMESetRTol +HYPRE_AMESetTol +HYPRE_AMESetup +HYPRE_AMESolve +HYPRE_AMSConstructDiscreteGradient +HYPRE_AMSCreate +HYPRE_AMSDestroy +HYPRE_AMSFEIDestroy +HYPRE_AMSFEISetup +HYPRE_AMSGetFinalRelativeResidualNorm +HYPRE_AMSGetNumIterations +HYPRE_AMSProjectOutGradients +HYPRE_AMSSetAlphaAMGCoarseRelaxType +HYPRE_AMSSetAlphaAMGOptions +HYPRE_AMSSetAlphaPoissonMatrix +HYPRE_AMSSetBetaAMGCoarseRelaxType +HYPRE_AMSSetBetaAMGOptions +HYPRE_AMSSetBetaPoissonMatrix +HYPRE_AMSSetChebySmoothingOptions +HYPRE_AMSSetCoordinateVectors +HYPRE_AMSSetCycleType +HYPRE_AMSSetDimension +HYPRE_AMSSetDiscreteGradient +HYPRE_AMSSetEdgeConstantVectors +HYPRE_AMSSetInteriorNodes +HYPRE_AMSSetInterpolations +HYPRE_AMSSetMaxIter +HYPRE_AMSSetPrintLevel +HYPRE_AMSSetProjectionFrequency +HYPRE_AMSSetSmoothingOptions +HYPRE_AMSSetTol +HYPRE_AMSSetup +HYPRE_AMSSolve +HYPRE_BlockTridiagCreate +HYPRE_BlockTridiagDestroy +HYPRE_BlockTridiagSetAMGNumSweeps +HYPRE_BlockTridiagSetAMGRelaxType +HYPRE_BlockTridiagSetAMGStrengthThreshold +HYPRE_BlockTridiagSetIndexSet +HYPRE_BlockTridiagSetPrintLevel +HYPRE_BlockTridiagSetup +HYPRE_BlockTridiagSolve +HYPRE_BoomerAMGCreate +HYPRE_BoomerAMGDDCreate +HYPRE_BoomerAMGDDDestroy +HYPRE_BoomerAMGDDGetAMG +HYPRE_BoomerAMGDDGetFACCycleType +HYPRE_BoomerAMGDDGetFACNumCycles +HYPRE_BoomerAMGDDGetFACNumRelax +HYPRE_BoomerAMGDDGetFACRelaxType +HYPRE_BoomerAMGDDGetFACRelaxWeight +HYPRE_BoomerAMGDDGetFinalRelativeResidualNorm +HYPRE_BoomerAMGDDGetNumGhostLayers +HYPRE_BoomerAMGDDGetNumIterations +HYPRE_BoomerAMGDDGetPadding +HYPRE_BoomerAMGDDGetStartLevel +HYPRE_BoomerAMGDDSetFACCycleType +HYPRE_BoomerAMGDDSetFACNumCycles +HYPRE_BoomerAMGDDSetFACNumRelax +HYPRE_BoomerAMGDDSetFACRelaxType +HYPRE_BoomerAMGDDSetFACRelaxWeight +HYPRE_BoomerAMGDDSetNumGhostLayers +HYPRE_BoomerAMGDDSetPadding +HYPRE_BoomerAMGDDSetStartLevel +HYPRE_BoomerAMGDDSetUserFACRelaxation +HYPRE_BoomerAMGDDSetup +HYPRE_BoomerAMGDDSolve +HYPRE_BoomerAMGDestroy +HYPRE_BoomerAMGGetAdditive +HYPRE_BoomerAMGGetCoarsenCutFactor +HYPRE_BoomerAMGGetCoarsenType +HYPRE_BoomerAMGGetConvergeType +HYPRE_BoomerAMGGetCumNnzAP +HYPRE_BoomerAMGGetCumNumIterations +HYPRE_BoomerAMGGetCycleNumSweeps +HYPRE_BoomerAMGGetCycleRelaxType +HYPRE_BoomerAMGGetCycleType +HYPRE_BoomerAMGGetDebugFlag +HYPRE_BoomerAMGGetDomainType +HYPRE_BoomerAMGGetFCycle +HYPRE_BoomerAMGGetFilterFunctions +HYPRE_BoomerAMGGetFilterThresholdR +HYPRE_BoomerAMGGetFinalRelativeResidualNorm +HYPRE_BoomerAMGGetGridHierarchy +HYPRE_BoomerAMGGetJacobiTruncThreshold +HYPRE_BoomerAMGGetLogging +HYPRE_BoomerAMGGetMaxCoarseSize +HYPRE_BoomerAMGGetMaxIter +HYPRE_BoomerAMGGetMaxLevels +HYPRE_BoomerAMGGetMaxRowSum +HYPRE_BoomerAMGGetMeasureType +HYPRE_BoomerAMGGetMinCoarseSize +HYPRE_BoomerAMGGetMultAdditive +HYPRE_BoomerAMGGetNumFunctions +HYPRE_BoomerAMGGetNumIterations +HYPRE_BoomerAMGGetOverlap +HYPRE_BoomerAMGGetPMaxElmts +HYPRE_BoomerAMGGetPostInterpType +HYPRE_BoomerAMGGetPrintLevel +HYPRE_BoomerAMGGetRedundant +HYPRE_BoomerAMGGetResidual +HYPRE_BoomerAMGGetSchwarzRlxWeight +HYPRE_BoomerAMGGetSeqThreshold +HYPRE_BoomerAMGGetSimple +HYPRE_BoomerAMGGetSmoothNumLevels +HYPRE_BoomerAMGGetSmoothNumSweeps +HYPRE_BoomerAMGGetSmoothType +HYPRE_BoomerAMGGetStrongThreshold +HYPRE_BoomerAMGGetStrongThresholdR +HYPRE_BoomerAMGGetTol +HYPRE_BoomerAMGGetTruncFactor +HYPRE_BoomerAMGGetVariant +HYPRE_BoomerAMGInitGridRelaxation +HYPRE_BoomerAMGSetADropTol +HYPRE_BoomerAMGSetADropType +HYPRE_BoomerAMGSetAddLastLvl +HYPRE_BoomerAMGSetAddPMaxElmts +HYPRE_BoomerAMGSetAddRelaxType +HYPRE_BoomerAMGSetAddRelaxWt +HYPRE_BoomerAMGSetAddTruncFactor +HYPRE_BoomerAMGSetAdditive +HYPRE_BoomerAMGSetAggInterpType +HYPRE_BoomerAMGSetAggNumLevels +HYPRE_BoomerAMGSetAggP12MaxElmts +HYPRE_BoomerAMGSetAggP12TruncFactor +HYPRE_BoomerAMGSetAggPMaxElmts +HYPRE_BoomerAMGSetAggTruncFactor +HYPRE_BoomerAMGSetCGCIts +HYPRE_BoomerAMGSetCPoints +HYPRE_BoomerAMGSetCRRate +HYPRE_BoomerAMGSetCRStrongTh +HYPRE_BoomerAMGSetCRUseCG +HYPRE_BoomerAMGSetChebyEigEst +HYPRE_BoomerAMGSetChebyFraction +HYPRE_BoomerAMGSetChebyOrder +HYPRE_BoomerAMGSetChebyScale +HYPRE_BoomerAMGSetChebyVariant +HYPRE_BoomerAMGSetCoarsenCutFactor +HYPRE_BoomerAMGSetCoarsenType +HYPRE_BoomerAMGSetConvergeType +HYPRE_BoomerAMGSetCoordDim +HYPRE_BoomerAMGSetCoordinates +HYPRE_BoomerAMGSetCpointsToKeep +HYPRE_BoomerAMGSetCumNnzAP +HYPRE_BoomerAMGSetCycleNumSweeps +HYPRE_BoomerAMGSetCycleRelaxType +HYPRE_BoomerAMGSetCycleType +HYPRE_BoomerAMGSetDebugFlag +HYPRE_BoomerAMGSetDofFunc +HYPRE_BoomerAMGSetDomainType +HYPRE_BoomerAMGSetDropTol +HYPRE_BoomerAMGSetEuBJ +HYPRE_BoomerAMGSetEuLevel +HYPRE_BoomerAMGSetEuSparseA +HYPRE_BoomerAMGSetEuclidFile +HYPRE_BoomerAMGSetFCycle +HYPRE_BoomerAMGSetFPoints +HYPRE_BoomerAMGSetFSAIAlgoType +HYPRE_BoomerAMGSetFSAIEigMaxIters +HYPRE_BoomerAMGSetFSAIKapTolerance +HYPRE_BoomerAMGSetFSAILocalSolveType +HYPRE_BoomerAMGSetFSAIMaxNnzRow +HYPRE_BoomerAMGSetFSAIMaxStepSize +HYPRE_BoomerAMGSetFSAIMaxSteps +HYPRE_BoomerAMGSetFSAINumLevels +HYPRE_BoomerAMGSetFSAIThreshold +HYPRE_BoomerAMGSetFilter +HYPRE_BoomerAMGSetFilterFunctions +HYPRE_BoomerAMGSetFilterThresholdR +HYPRE_BoomerAMGSetGMRESSwitchR +HYPRE_BoomerAMGSetGSMG +HYPRE_BoomerAMGSetGridRelaxPoints +HYPRE_BoomerAMGSetGridRelaxType +HYPRE_BoomerAMGSetILUDroptol +HYPRE_BoomerAMGSetILUIterSetupMaxIter +HYPRE_BoomerAMGSetILUIterSetupOption +HYPRE_BoomerAMGSetILUIterSetupTolerance +HYPRE_BoomerAMGSetILUIterSetupType +HYPRE_BoomerAMGSetILULevel +HYPRE_BoomerAMGSetILULocalReordering +HYPRE_BoomerAMGSetILULowerJacobiIters +HYPRE_BoomerAMGSetILUMaxIter +HYPRE_BoomerAMGSetILUMaxRowNnz +HYPRE_BoomerAMGSetILUTriSolve +HYPRE_BoomerAMGSetILUType +HYPRE_BoomerAMGSetILUUpperJacobiIters +HYPRE_BoomerAMGSetISType +HYPRE_BoomerAMGSetInterpRefine +HYPRE_BoomerAMGSetInterpType +HYPRE_BoomerAMGSetInterpVecAbsQTrunc +HYPRE_BoomerAMGSetInterpVecFirstLevel +HYPRE_BoomerAMGSetInterpVecQMax +HYPRE_BoomerAMGSetInterpVecVariant +HYPRE_BoomerAMGSetInterpVectors +HYPRE_BoomerAMGSetIsTriangular +HYPRE_BoomerAMGSetIsolatedFPoints +HYPRE_BoomerAMGSetJacobiTruncThreshold +HYPRE_BoomerAMGSetKeepSameSign +HYPRE_BoomerAMGSetKeepTranspose +HYPRE_BoomerAMGSetLevel +HYPRE_BoomerAMGSetLevelNonGalerkinTol +HYPRE_BoomerAMGSetLevelOuterWt +HYPRE_BoomerAMGSetLevelRelaxWt +HYPRE_BoomerAMGSetLogging +HYPRE_BoomerAMGSetMaxCoarseSize +HYPRE_BoomerAMGSetMaxIter +HYPRE_BoomerAMGSetMaxLevels +HYPRE_BoomerAMGSetMaxNzPerRow +HYPRE_BoomerAMGSetMaxRowSum +HYPRE_BoomerAMGSetMeasureType +HYPRE_BoomerAMGSetMinCoarseSize +HYPRE_BoomerAMGSetMinIter +HYPRE_BoomerAMGSetModuleRAP2 +HYPRE_BoomerAMGSetMultAddPMaxElmts +HYPRE_BoomerAMGSetMultAddTruncFactor +HYPRE_BoomerAMGSetMultAdditive +HYPRE_BoomerAMGSetNodal +HYPRE_BoomerAMGSetNodalDiag +HYPRE_BoomerAMGSetNodalLevels +HYPRE_BoomerAMGSetNonGalerkTol +HYPRE_BoomerAMGSetNonGalerkinTol +HYPRE_BoomerAMGSetNumCRRelaxSteps +HYPRE_BoomerAMGSetNumFunctions +HYPRE_BoomerAMGSetNumGridSweeps +HYPRE_BoomerAMGSetNumPaths +HYPRE_BoomerAMGSetNumSamples +HYPRE_BoomerAMGSetNumSweeps +HYPRE_BoomerAMGSetOldDefault +HYPRE_BoomerAMGSetOmega +HYPRE_BoomerAMGSetOuterWt +HYPRE_BoomerAMGSetOverlap +HYPRE_BoomerAMGSetPMaxElmts +HYPRE_BoomerAMGSetPlotFileName +HYPRE_BoomerAMGSetPlotGrids +HYPRE_BoomerAMGSetPostInterpType +HYPRE_BoomerAMGSetPrintFileName +HYPRE_BoomerAMGSetPrintLevel +HYPRE_BoomerAMGSetRAP2 +HYPRE_BoomerAMGSetRedundant +HYPRE_BoomerAMGSetRelaxOrder +HYPRE_BoomerAMGSetRelaxType +HYPRE_BoomerAMGSetRelaxWeight +HYPRE_BoomerAMGSetRelaxWt +HYPRE_BoomerAMGSetRestriction +HYPRE_BoomerAMGSetSCommPkgSwitch +HYPRE_BoomerAMGSetSabs +HYPRE_BoomerAMGSetSchwarzRlxWeight +HYPRE_BoomerAMGSetSchwarzUseNonSymm +HYPRE_BoomerAMGSetSepWeight +HYPRE_BoomerAMGSetSeqThreshold +HYPRE_BoomerAMGSetSetupType +HYPRE_BoomerAMGSetSimple +HYPRE_BoomerAMGSetSmoothInterpVectors +HYPRE_BoomerAMGSetSmoothNumLevels +HYPRE_BoomerAMGSetSmoothNumSweeps +HYPRE_BoomerAMGSetSmoothType +HYPRE_BoomerAMGSetStrongThreshold +HYPRE_BoomerAMGSetStrongThresholdR +HYPRE_BoomerAMGSetSym +HYPRE_BoomerAMGSetThreshold +HYPRE_BoomerAMGSetTol +HYPRE_BoomerAMGSetTruncFactor +HYPRE_BoomerAMGSetVariant +HYPRE_BoomerAMGSetup +HYPRE_BoomerAMGSolve +HYPRE_BoomerAMGSolveT +HYPRE_EuclidCreate +HYPRE_EuclidDestroy +HYPRE_EuclidSetBJ +HYPRE_EuclidSetILUT +HYPRE_EuclidSetLevel +HYPRE_EuclidSetMem +HYPRE_EuclidSetParams +HYPRE_EuclidSetParamsFromFile +HYPRE_EuclidSetRowScale +HYPRE_EuclidSetSparseA +HYPRE_EuclidSetStats +HYPRE_EuclidSetup +HYPRE_EuclidSolve +HYPRE_FSAICreate +HYPRE_FSAIDestroy +HYPRE_FSAIGetAlgoType +HYPRE_FSAIGetEigMaxIters +HYPRE_FSAIGetKapTolerance +HYPRE_FSAIGetLocalSolveType +HYPRE_FSAIGetMaxIterations +HYPRE_FSAIGetMaxNnzRow +HYPRE_FSAIGetMaxStepSize +HYPRE_FSAIGetMaxSteps +HYPRE_FSAIGetNumLevels +HYPRE_FSAIGetOmega +HYPRE_FSAIGetPrintLevel +HYPRE_FSAIGetThreshold +HYPRE_FSAIGetTolerance +HYPRE_FSAIGetZeroGuess +HYPRE_FSAISetAlgoType +HYPRE_FSAISetEigMaxIters +HYPRE_FSAISetKapTolerance +HYPRE_FSAISetLocalSolveType +HYPRE_FSAISetMaxIterations +HYPRE_FSAISetMaxNnzRow +HYPRE_FSAISetMaxStepSize +HYPRE_FSAISetMaxSteps +HYPRE_FSAISetNumLevels +HYPRE_FSAISetOmega +HYPRE_FSAISetPrintLevel +HYPRE_FSAISetThreshold +HYPRE_FSAISetTolerance +HYPRE_FSAISetZeroGuess +HYPRE_FSAISetup +HYPRE_FSAISolve +HYPRE_ILUCreate +HYPRE_ILUDestroy +HYPRE_ILUGetFinalRelativeResidualNorm +HYPRE_ILUGetNumIterations +HYPRE_ILUSetDropThreshold +HYPRE_ILUSetDropThresholdArray +HYPRE_ILUSetIterativeSetupMaxIter +HYPRE_ILUSetIterativeSetupOption +HYPRE_ILUSetIterativeSetupTolerance +HYPRE_ILUSetIterativeSetupType +HYPRE_ILUSetLevelOfFill +HYPRE_ILUSetLocalReordering +HYPRE_ILUSetLogging +HYPRE_ILUSetLowerJacobiIters +HYPRE_ILUSetMaxIter +HYPRE_ILUSetMaxNnzPerRow +HYPRE_ILUSetNSHDropThreshold +HYPRE_ILUSetNSHDropThresholdArray +HYPRE_ILUSetPrintLevel +HYPRE_ILUSetSchurMaxIter +HYPRE_ILUSetTol +HYPRE_ILUSetTriSolve +HYPRE_ILUSetType +HYPRE_ILUSetUpperJacobiIters +HYPRE_ILUSetup +HYPRE_ILUSolve +HYPRE_MGRBuildAff +HYPRE_MGRCreate +HYPRE_MGRDestroy +HYPRE_MGRGetCoarseGridConvergenceFactor +HYPRE_MGRGetFinalRelativeResidualNorm +HYPRE_MGRGetNumIterations +HYPRE_MGRSetBlockJacobiBlockSize +HYPRE_MGRSetBlockSize +HYPRE_MGRSetCoarseGridMethod +HYPRE_MGRSetCoarseGridPrintLevel +HYPRE_MGRSetCoarseSolver +HYPRE_MGRSetCpointsByBlock +HYPRE_MGRSetCpointsByContiguousBlock +HYPRE_MGRSetCpointsByPointMarkerArray +HYPRE_MGRSetFRelaxMethod +HYPRE_MGRSetFSolver +HYPRE_MGRSetFSolverAtLevel +HYPRE_MGRSetFrelaxPrintLevel +HYPRE_MGRSetGlobalSmoothCycle +HYPRE_MGRSetGlobalSmoothType +HYPRE_MGRSetGlobalSmootherAtLevel +HYPRE_MGRSetInterpType +HYPRE_MGRSetLevelFRelaxMethod +HYPRE_MGRSetLevelFRelaxNumFunctions +HYPRE_MGRSetLevelFRelaxType +HYPRE_MGRSetLevelInterpType +HYPRE_MGRSetLevelNonGalerkinMaxElmts +HYPRE_MGRSetLevelNumRelaxSweeps +HYPRE_MGRSetLevelPMaxElmts +HYPRE_MGRSetLevelRestrictType +HYPRE_MGRSetLevelSmoothIters +HYPRE_MGRSetLevelSmoothType +HYPRE_MGRSetLogging +HYPRE_MGRSetMaxCoarseLevels +HYPRE_MGRSetMaxGlobalSmoothIters +HYPRE_MGRSetMaxIter +HYPRE_MGRSetNonCpointsToFpoints +HYPRE_MGRSetNonGalerkinMaxElmts +HYPRE_MGRSetNumInterpSweeps +HYPRE_MGRSetNumRelaxSweeps +HYPRE_MGRSetNumRestrictSweeps +HYPRE_MGRSetPMaxElmts +HYPRE_MGRSetPrintLevel +HYPRE_MGRSetRelaxType +HYPRE_MGRSetReservedCoarseNodes +HYPRE_MGRSetReservedCpointsLevelToKeep +HYPRE_MGRSetRestrictType +HYPRE_MGRSetTol +HYPRE_MGRSetTruncateCoarseGridThreshold +HYPRE_MGRSetup +HYPRE_MGRSolve +HYPRE_ParCSRBiCGSTABCreate +HYPRE_ParCSRBiCGSTABDestroy +HYPRE_ParCSRBiCGSTABGetFinalRelativeResidualNorm +HYPRE_ParCSRBiCGSTABGetNumIterations +HYPRE_ParCSRBiCGSTABGetPrecond +HYPRE_ParCSRBiCGSTABGetResidual +HYPRE_ParCSRBiCGSTABSetAbsoluteTol +HYPRE_ParCSRBiCGSTABSetLogging +HYPRE_ParCSRBiCGSTABSetMaxIter +HYPRE_ParCSRBiCGSTABSetMinIter +HYPRE_ParCSRBiCGSTABSetPrecond +HYPRE_ParCSRBiCGSTABSetPrintLevel +HYPRE_ParCSRBiCGSTABSetStopCrit +HYPRE_ParCSRBiCGSTABSetTol +HYPRE_ParCSRBiCGSTABSetup +HYPRE_ParCSRBiCGSTABSolve +HYPRE_ParCSRCGNRCreate +HYPRE_ParCSRCGNRDestroy +HYPRE_ParCSRCGNRGetFinalRelativeResidualNorm +HYPRE_ParCSRCGNRGetNumIterations +HYPRE_ParCSRCGNRGetPrecond +HYPRE_ParCSRCGNRSetLogging +HYPRE_ParCSRCGNRSetMaxIter +HYPRE_ParCSRCGNRSetMinIter +HYPRE_ParCSRCGNRSetPrecond +HYPRE_ParCSRCGNRSetStopCrit +HYPRE_ParCSRCGNRSetTol +HYPRE_ParCSRCGNRSetup +HYPRE_ParCSRCGNRSolve +HYPRE_ParCSRCOGMRESCreate +HYPRE_ParCSRCOGMRESDestroy +HYPRE_ParCSRCOGMRESGetFinalRelativeResidualNorm +HYPRE_ParCSRCOGMRESGetNumIterations +HYPRE_ParCSRCOGMRESGetPrecond +HYPRE_ParCSRCOGMRESGetResidual +HYPRE_ParCSRCOGMRESSetAbsoluteTol +HYPRE_ParCSRCOGMRESSetCGS +HYPRE_ParCSRCOGMRESSetKDim +HYPRE_ParCSRCOGMRESSetLogging +HYPRE_ParCSRCOGMRESSetMaxIter +HYPRE_ParCSRCOGMRESSetMinIter +HYPRE_ParCSRCOGMRESSetPrecond +HYPRE_ParCSRCOGMRESSetPrintLevel +HYPRE_ParCSRCOGMRESSetTol +HYPRE_ParCSRCOGMRESSetUnroll +HYPRE_ParCSRCOGMRESSetup +HYPRE_ParCSRCOGMRESSolve +HYPRE_ParCSRDiagScale +HYPRE_ParCSRDiagScaleSetup +HYPRE_ParCSRFlexGMRESCreate +HYPRE_ParCSRFlexGMRESDestroy +HYPRE_ParCSRFlexGMRESGetFinalRelativeResidualNorm +HYPRE_ParCSRFlexGMRESGetNumIterations +HYPRE_ParCSRFlexGMRESGetPrecond +HYPRE_ParCSRFlexGMRESGetResidual +HYPRE_ParCSRFlexGMRESSetAbsoluteTol +HYPRE_ParCSRFlexGMRESSetKDim +HYPRE_ParCSRFlexGMRESSetLogging +HYPRE_ParCSRFlexGMRESSetMaxIter +HYPRE_ParCSRFlexGMRESSetMinIter +HYPRE_ParCSRFlexGMRESSetModifyPC +HYPRE_ParCSRFlexGMRESSetPrecond +HYPRE_ParCSRFlexGMRESSetPrintLevel +HYPRE_ParCSRFlexGMRESSetTol +HYPRE_ParCSRFlexGMRESSetup +HYPRE_ParCSRFlexGMRESSolve +HYPRE_ParCSRGMRESCreate +HYPRE_ParCSRGMRESDestroy +HYPRE_ParCSRGMRESGetFinalRelativeResidualNorm +HYPRE_ParCSRGMRESGetNumIterations +HYPRE_ParCSRGMRESGetPrecond +HYPRE_ParCSRGMRESGetRefSolution +HYPRE_ParCSRGMRESGetResidual +HYPRE_ParCSRGMRESSetAbsoluteTol +HYPRE_ParCSRGMRESSetKDim +HYPRE_ParCSRGMRESSetLogging +HYPRE_ParCSRGMRESSetMaxIter +HYPRE_ParCSRGMRESSetMinIter +HYPRE_ParCSRGMRESSetPrecond +HYPRE_ParCSRGMRESSetPrintLevel +HYPRE_ParCSRGMRESSetRefSolution +HYPRE_ParCSRGMRESSetStopCrit +HYPRE_ParCSRGMRESSetTol +HYPRE_ParCSRGMRESSetup +HYPRE_ParCSRGMRESSolve +HYPRE_ParCSRHybridCreate +HYPRE_ParCSRHybridDestroy +HYPRE_ParCSRHybridGetDSCGNumIterations +HYPRE_ParCSRHybridGetFinalRelativeResidualNorm +HYPRE_ParCSRHybridGetNumIterations +HYPRE_ParCSRHybridGetPCGNumIterations +HYPRE_ParCSRHybridGetRecomputeResidual +HYPRE_ParCSRHybridGetRecomputeResidualP +HYPRE_ParCSRHybridGetSetupSolveTime +HYPRE_ParCSRHybridSetAbsoluteTol +HYPRE_ParCSRHybridSetAggInterpType +HYPRE_ParCSRHybridSetAggNumLevels +HYPRE_ParCSRHybridSetCoarsenType +HYPRE_ParCSRHybridSetConvergenceTol +HYPRE_ParCSRHybridSetCycleNumSweeps +HYPRE_ParCSRHybridSetCycleRelaxType +HYPRE_ParCSRHybridSetCycleType +HYPRE_ParCSRHybridSetDSCGMaxIter +HYPRE_ParCSRHybridSetDofFunc +HYPRE_ParCSRHybridSetGridRelaxPoints +HYPRE_ParCSRHybridSetGridRelaxType +HYPRE_ParCSRHybridSetInterpType +HYPRE_ParCSRHybridSetKDim +HYPRE_ParCSRHybridSetKeepTranspose +HYPRE_ParCSRHybridSetLevelOuterWt +HYPRE_ParCSRHybridSetLevelRelaxWt +HYPRE_ParCSRHybridSetLogging +HYPRE_ParCSRHybridSetMaxCoarseSize +HYPRE_ParCSRHybridSetMaxLevels +HYPRE_ParCSRHybridSetMaxRowSum +HYPRE_ParCSRHybridSetMeasureType +HYPRE_ParCSRHybridSetMinCoarseSize +HYPRE_ParCSRHybridSetNodal +HYPRE_ParCSRHybridSetNonGalerkinTol +HYPRE_ParCSRHybridSetNumFunctions +HYPRE_ParCSRHybridSetNumGridSweeps +HYPRE_ParCSRHybridSetNumPaths +HYPRE_ParCSRHybridSetNumSweeps +HYPRE_ParCSRHybridSetOmega +HYPRE_ParCSRHybridSetOuterWt +HYPRE_ParCSRHybridSetPCGMaxIter +HYPRE_ParCSRHybridSetPMaxElmts +HYPRE_ParCSRHybridSetPrecond +HYPRE_ParCSRHybridSetPrintLevel +HYPRE_ParCSRHybridSetRecomputeResidual +HYPRE_ParCSRHybridSetRecomputeResidualP +HYPRE_ParCSRHybridSetRelChange +HYPRE_ParCSRHybridSetRelaxOrder +HYPRE_ParCSRHybridSetRelaxType +HYPRE_ParCSRHybridSetRelaxWeight +HYPRE_ParCSRHybridSetRelaxWt +HYPRE_ParCSRHybridSetSeqThreshold +HYPRE_ParCSRHybridSetSetupType +HYPRE_ParCSRHybridSetSolverType +HYPRE_ParCSRHybridSetStopCrit +HYPRE_ParCSRHybridSetStrongThreshold +HYPRE_ParCSRHybridSetTol +HYPRE_ParCSRHybridSetTruncFactor +HYPRE_ParCSRHybridSetTwoNorm +HYPRE_ParCSRHybridSetup +HYPRE_ParCSRHybridSolve +HYPRE_ParCSRLGMRESCreate +HYPRE_ParCSRLGMRESDestroy +HYPRE_ParCSRLGMRESGetFinalRelativeResidualNorm +HYPRE_ParCSRLGMRESGetNumIterations +HYPRE_ParCSRLGMRESGetPrecond +HYPRE_ParCSRLGMRESGetResidual +HYPRE_ParCSRLGMRESSetAbsoluteTol +HYPRE_ParCSRLGMRESSetAugDim +HYPRE_ParCSRLGMRESSetKDim +HYPRE_ParCSRLGMRESSetLogging +HYPRE_ParCSRLGMRESSetMaxIter +HYPRE_ParCSRLGMRESSetMinIter +HYPRE_ParCSRLGMRESSetPrecond +HYPRE_ParCSRLGMRESSetPrintLevel +HYPRE_ParCSRLGMRESSetTol +HYPRE_ParCSRLGMRESSetup +HYPRE_ParCSRLGMRESSolve +HYPRE_ParCSRMultiVectorPrint +HYPRE_ParCSRMultiVectorRead +HYPRE_ParCSROnProcTriSetup +HYPRE_ParCSROnProcTriSolve +HYPRE_ParCSRPCGCreate +HYPRE_ParCSRPCGDestroy +HYPRE_ParCSRPCGGetFinalRelativeResidualNorm +HYPRE_ParCSRPCGGetNumIterations +HYPRE_ParCSRPCGGetPrecond +HYPRE_ParCSRPCGGetResidual +HYPRE_ParCSRPCGSetAbsoluteTol +HYPRE_ParCSRPCGSetLogging +HYPRE_ParCSRPCGSetMaxIter +HYPRE_ParCSRPCGSetPrecond +HYPRE_ParCSRPCGSetPreconditioner +HYPRE_ParCSRPCGSetPrintLevel +HYPRE_ParCSRPCGSetRelChange +HYPRE_ParCSRPCGSetStopCrit +HYPRE_ParCSRPCGSetTol +HYPRE_ParCSRPCGSetTwoNorm +HYPRE_ParCSRPCGSetup +HYPRE_ParCSRPCGSolve +HYPRE_ParCSRParaSailsCreate +HYPRE_ParCSRParaSailsDestroy +HYPRE_ParCSRParaSailsGetFilter +HYPRE_ParCSRParaSailsGetLoadbal +HYPRE_ParCSRParaSailsSetFilter +HYPRE_ParCSRParaSailsSetLoadbal +HYPRE_ParCSRParaSailsSetLogging +HYPRE_ParCSRParaSailsSetParams +HYPRE_ParCSRParaSailsSetReuse +HYPRE_ParCSRParaSailsSetSym +HYPRE_ParCSRParaSailsSetup +HYPRE_ParCSRParaSailsSolve +HYPRE_ParCSRPilutCreate +HYPRE_ParCSRPilutDestroy +HYPRE_ParCSRPilutSetDropTolerance +HYPRE_ParCSRPilutSetFactorRowSize +HYPRE_ParCSRPilutSetLogging +HYPRE_ParCSRPilutSetMaxIter +HYPRE_ParCSRPilutSetup +HYPRE_ParCSRPilutSolve +HYPRE_ParCSRSetupInterpreter +HYPRE_ParCSRSetupMatvec +HYPRE_ParaSailsBuildIJMatrix +HYPRE_ParaSailsCreate +HYPRE_ParaSailsDestroy +HYPRE_ParaSailsGetFilter +HYPRE_ParaSailsGetLoadbal +HYPRE_ParaSailsGetLogging +HYPRE_ParaSailsGetNlevels +HYPRE_ParaSailsGetReuse +HYPRE_ParaSailsGetSym +HYPRE_ParaSailsGetThresh +HYPRE_ParaSailsSetFilter +HYPRE_ParaSailsSetLoadbal +HYPRE_ParaSailsSetLogging +HYPRE_ParaSailsSetNlevels +HYPRE_ParaSailsSetParams +HYPRE_ParaSailsSetReuse +HYPRE_ParaSailsSetSym +HYPRE_ParaSailsSetThresh +HYPRE_ParaSailsSetup +HYPRE_ParaSailsSolve +HYPRE_SchwarzCreate +HYPRE_SchwarzDestroy +HYPRE_SchwarzSetDofFunc +HYPRE_SchwarzSetDomainStructure +HYPRE_SchwarzSetDomainType +HYPRE_SchwarzSetNonSymm +HYPRE_SchwarzSetNumFunctions +HYPRE_SchwarzSetOverlap +HYPRE_SchwarzSetRelaxWeight +HYPRE_SchwarzSetVariant +HYPRE_SchwarzSetup +HYPRE_SchwarzSolve +HYPRE_TempParCSRSetupInterpreter diff --git a/src/parcsr_ls/mup.methods b/src/parcsr_ls/mup.methods new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/parcsr_ls/mup_code b/src/parcsr_ls/mup_code new file mode 100755 index 0000000000..8c06ae2246 --- /dev/null +++ b/src/parcsr_ls/mup_code @@ -0,0 +1,7 @@ +#!/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) + +../config/gen_code.sh HYPRE_parcsr_ls.h _hypre_parcsr_ls.h mup diff --git a/src/parcsr_ls/mup_fixed.c b/src/parcsr_ls/mup_fixed.c new file mode 100644 index 0000000000..bd7927c246 --- /dev/null +++ b/src/parcsr_ls/mup_fixed.c @@ -0,0 +1,7771 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_parcsr_ls.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(GenerateDifConv)( comm, nx, ny, nz, P, Q, R, p, q, r, value ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_ParCSRMatrix +GenerateLaplacian( 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(GenerateLaplacian)( comm, nx, ny, nz, P, Q, R, p, q, r, value ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(GenerateLaplacian27pt)( comm, nx, ny, nz, P, Q, R, p, q, r, value ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(GenerateLaplacian9pt)( comm, nx, ny, P, Q, p, q, value ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(GenerateRSVarDifConv)( comm, nx, ny, nz, P, Q, R, p, q, r, eps, rhs_ptr, type ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(GenerateRotate7pt)( comm, nx, ny, P, Q, p, q, alpha, eps ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(GenerateVarDifConv)( comm, nx, ny, nz, P, Q, R, p, q, r, eps, rhs_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GenerateCoordinates)( comm, nx, ny, nz, P, Q, R, p, q, r, coorddim ); +} + + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(GenerateSysLaplacian)( comm, nx, ny, nz, P, Q, R, p, q, r, num_fun, mtrx, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(GenerateSysLaplacianVCoef)( comm, nx, ny, nz, P, Q, R, p, q, r, num_fun, mtrx, value ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +afun( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ) +{ + return HYPRE_CURRENTPRECISION_FUNC(afun)( xx, yy, zz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +afun_rs( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ) +{ + return HYPRE_CURRENTPRECISION_FUNC(afun_rs)( xx, yy, zz ); +} + +/*--------------------------------------------------------------------------*/ + +void +aux_indexFromMask( HYPRE_Int n, HYPRE_Int *mask, HYPRE_Int *index ) +{ + return HYPRE_CURRENTPRECISION_FUNC(aux_indexFromMask)( n, mask, index ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +aux_maskCount( HYPRE_Int n, HYPRE_Int *mask ) +{ + return HYPRE_CURRENTPRECISION_FUNC(aux_maskCount)( n, mask ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +bfun( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ) +{ + return HYPRE_CURRENTPRECISION_FUNC(bfun)( xx, yy, zz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +bfun_rs( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ) +{ + return HYPRE_CURRENTPRECISION_FUNC(bfun_rs)( xx, yy, zz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +bndfun( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ) +{ + return HYPRE_CURRENTPRECISION_FUNC(bndfun)( xx, yy, zz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +bndfun_rs( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ) +{ + return HYPRE_CURRENTPRECISION_FUNC(bndfun_rs)( xx, yy, zz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +cfun( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ) +{ + return HYPRE_CURRENTPRECISION_FUNC(cfun)( xx, yy, zz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +cfun_rs( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ) +{ + return HYPRE_CURRENTPRECISION_FUNC(cfun_rs)( xx, yy, zz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +dfun( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ) +{ + return HYPRE_CURRENTPRECISION_FUNC(dfun)( xx, yy, zz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +dfun_rs( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ) +{ + return HYPRE_CURRENTPRECISION_FUNC(dfun_rs)( xx, yy, zz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +efun( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ) +{ + return HYPRE_CURRENTPRECISION_FUNC(efun)( xx, yy, zz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +efun_rs( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ) +{ + return HYPRE_CURRENTPRECISION_FUNC(efun_rs)( xx, yy, zz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +ffun( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ) +{ + return HYPRE_CURRENTPRECISION_FUNC(ffun)( xx, yy, zz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +ffun_rs( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ) +{ + return HYPRE_CURRENTPRECISION_FUNC(ffun_rs)( xx, yy, zz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +gfun( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ) +{ + return HYPRE_CURRENTPRECISION_FUNC(gfun)( xx, yy, zz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +gfun_rs( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ) +{ + return HYPRE_CURRENTPRECISION_FUNC(gfun_rs)( xx, yy, zz ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ADSComputePi)( A, C, G, x, y, z, PiNDx, PiNDy, PiNDz, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ADSComputePixyz)( A, C, G, x, y, z, PiNDx, PiNDy, PiNDz, Pix_ptr, Piy_ptr, Piz_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_ADSCreate( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ADSCreate)( ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ADSDestroy( void *solver ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ADSDestroy)( solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ADSGetFinalRelativeResidualNorm( void *solver, HYPRE_Real *rel_resid_norm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ADSGetFinalRelativeResidualNorm)( solver, rel_resid_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ADSGetNumIterations( void *solver, HYPRE_Int *num_iterations ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ADSGetNumIterations)( solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ADSSetAMGOptions)( solver, B_Pi_coarsen_type, B_Pi_agg_levels, B_Pi_relax_type, B_Pi_theta, B_Pi_interp_type, B_Pi_Pmax ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ADSSetAMSOptions)( solver, B_C_cycle_type, B_C_coarsen_type, B_C_agg_levels, B_C_relax_type, B_C_theta, B_C_interp_type, B_C_Pmax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ADSSetChebySmoothingOptions( void *solver, HYPRE_Int A_cheby_order, HYPRE_Real A_cheby_fraction ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ADSSetChebySmoothingOptions)( solver, A_cheby_order, A_cheby_fraction ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ADSSetCoordinateVectors( void *solver, hypre_ParVector *x, hypre_ParVector *y, hypre_ParVector *z ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ADSSetCoordinateVectors)( solver, x, y, z ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ADSSetCycleType( void *solver, HYPRE_Int cycle_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ADSSetCycleType)( solver, cycle_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ADSSetDiscreteCurl( void *solver, hypre_ParCSRMatrix *C ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ADSSetDiscreteCurl)( solver, C ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ADSSetDiscreteGradient( void *solver, hypre_ParCSRMatrix *G ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ADSSetDiscreteGradient)( solver, G ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ADSSetInterpolations)( solver, RT_Pi, RT_Pix, RT_Piy, RT_Piz, ND_Pi, ND_Pix, ND_Piy, ND_Piz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ADSSetMaxIter( void *solver, HYPRE_Int maxit ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ADSSetMaxIter)( solver, maxit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ADSSetPrintLevel( void *solver, HYPRE_Int print_level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ADSSetPrintLevel)( solver, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ADSSetSmoothingOptions)( solver, A_relax_type, A_relax_times, A_relax_weight, A_omega ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ADSSetTol( void *solver, HYPRE_Real tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ADSSetTol)( solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ADSSetup( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ADSSetup)( solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ADSSolve( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ADSSolve)( solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_AMECreate( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMECreate)( ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMEDestroy( void *esolver ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMEDestroy)( esolver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMEDiscrDivFreeComponent( void *esolver, hypre_ParVector *b ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMEDiscrDivFreeComponent)( esolver, b ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMEGetEigenvalues( void *esolver, HYPRE_Real **eigenvalues_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMEGetEigenvalues)( esolver, eigenvalues_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMEGetEigenvectors( void *esolver, HYPRE_ParVector **eigenvectors_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMEGetEigenvectors)( esolver, eigenvectors_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_AMEMultiOperatorA( void *data, void *x, void *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMEMultiOperatorA)( data, x, y ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_AMEMultiOperatorB( void *data, void *x, void *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMEMultiOperatorB)( data, x, y ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_AMEMultiOperatorM( void *data, void *x, void *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMEMultiOperatorM)( data, x, y ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_AMEOperatorA( void *data, void *x, void *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMEOperatorA)( data, x, y ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_AMEOperatorB( void *data, void *x, void *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMEOperatorB)( data, x, y ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_AMEOperatorM( void *data, void *x, void *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMEOperatorM)( data, x, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMESetAMSSolver( void *esolver, void *ams_solver ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMESetAMSSolver)( esolver, ams_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMESetBlockSize( void *esolver, HYPRE_Int block_size ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMESetBlockSize)( esolver, block_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMESetMassMatrix( void *esolver, hypre_ParCSRMatrix *M ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMESetMassMatrix)( esolver, M ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMESetMaxIter( void *esolver, HYPRE_Int maxit ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMESetMaxIter)( esolver, maxit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMESetMaxPCGIter( void *esolver, HYPRE_Int maxit ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMESetMaxPCGIter)( esolver, maxit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMESetPrintLevel( void *esolver, HYPRE_Int print_level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMESetPrintLevel)( esolver, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMESetRTol( void *esolver, HYPRE_Real tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMESetRTol)( esolver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMESetTol( void *esolver, HYPRE_Real tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMESetTol)( esolver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMESetup( void *esolver ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMESetup)( esolver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMESolve( void *esolver ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMESolve)( esolver ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGCreateDomainDof)( A, domain_type, overlap, num_functions, dof_func, domain_structure_pointer, piv_pointer, use_nonsymm ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_AMGDDCommPkg * +hypre_AMGDDCommPkgCreate( HYPRE_Int num_levels ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGDDCommPkgCreate)( num_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGDDCommPkgDestroy( hypre_AMGDDCommPkg *compGridCommPkg ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGDDCommPkgDestroy)( compGridCommPkg ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGDDCommPkgRecvLevelDestroy( hypre_AMGDDCommPkg *amgddCommPkg, HYPRE_Int level, HYPRE_Int proc ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGDDCommPkgRecvLevelDestroy)( amgddCommPkg, level, proc ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGDDCommPkgSendLevelDestroy( hypre_AMGDDCommPkg *amgddCommPkg, HYPRE_Int level, HYPRE_Int proc ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGDDCommPkgSendLevelDestroy)( amgddCommPkg, level, proc ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_AMGDDCompGrid * +hypre_AMGDDCompGridCreate( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGDDCompGridCreate)( ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGDDCompGridDestroy( hypre_AMGDDCompGrid *compGrid ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGDDCompGridDestroy)( compGrid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGDDCompGridFinalize( hypre_ParAMGDDData *amgdd_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGDDCompGridFinalize)( amgdd_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGDDCompGridInitialize( hypre_ParAMGDDData *amgdd_data, HYPRE_Int padding, HYPRE_Int level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGDDCompGridInitialize)( amgdd_data, padding, level ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_AMGDDCompGridMatrix* +hypre_AMGDDCompGridMatrixCreate( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGDDCompGridMatrixCreate)( ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGDDCompGridMatrixDestroy( hypre_AMGDDCompGridMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGDDCompGridMatrixDestroy)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGDDCompGridMatvec( HYPRE_Complex alpha, hypre_AMGDDCompGridMatrix *A, hypre_AMGDDCompGridVector *x, HYPRE_Complex beta, hypre_AMGDDCompGridVector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGDDCompGridMatvec)( alpha, A, x, beta, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGDDCompGridRealMatvec( HYPRE_Complex alpha, hypre_AMGDDCompGridMatrix *A, hypre_AMGDDCompGridVector *x, HYPRE_Complex beta, hypre_AMGDDCompGridVector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGDDCompGridRealMatvec)( alpha, A, x, beta, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGDDCompGridResize( hypre_AMGDDCompGrid *compGrid, HYPRE_Int new_size, HYPRE_Int need_coarse_info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGDDCompGridResize)( compGrid, new_size, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGDDCompGridSetupLocalIndices)( compGrid, num_added_nodes, recv_map, num_recv_procs, A_tmp_info, start_level, num_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGDDCompGridSetupLocalIndicesP( hypre_ParAMGDDData *amgdd_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGDDCompGridSetupLocalIndicesP)( amgdd_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGDDCompGridSetupRelax( hypre_ParAMGDDData *amgdd_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGDDCompGridSetupRelax)( amgdd_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGDDCompGridVectorAxpy( HYPRE_Complex alpha, hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGDDCompGridVectorAxpy)( alpha, x, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGDDCompGridVectorCopy( hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGDDCompGridVectorCopy)( x, y ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_AMGDDCompGridVector* +hypre_AMGDDCompGridVectorCreate( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGDDCompGridVectorCreate)( ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGDDCompGridVectorDestroy( hypre_AMGDDCompGridVector *vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGDDCompGridVectorDestroy)( vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGDDCompGridVectorInitialize( hypre_AMGDDCompGridVector *vector, HYPRE_Int num_owned, HYPRE_Int num_nonowned, HYPRE_Int num_real ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGDDCompGridVectorInitialize)( vector, num_owned, num_nonowned, num_real ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +hypre_AMGDDCompGridVectorInnerProd( hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGDDCompGridVectorInnerProd)( x, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGDDCompGridVectorRealAxpy( HYPRE_Complex alpha, hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGDDCompGridVectorRealAxpy)( alpha, x, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGDDCompGridVectorRealCopy( hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGDDCompGridVectorRealCopy)( x, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +hypre_AMGDDCompGridVectorRealInnerProd( hypre_AMGDDCompGridVector *x, hypre_AMGDDCompGridVector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGDDCompGridVectorRealInnerProd)( x, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGDDCompGridVectorRealScale( HYPRE_Complex alpha, hypre_AMGDDCompGridVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGDDCompGridVectorRealScale)( alpha, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGDDCompGridVectorRealSetConstantValues( hypre_AMGDDCompGridVector *vector, HYPRE_Complex value ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGDDCompGridVectorRealSetConstantValues)( vector, value ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGDDCompGridVectorScale( HYPRE_Complex alpha, hypre_AMGDDCompGridVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGDDCompGridVectorScale)( alpha, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGDDCompGridVectorSetConstantValues( hypre_AMGDDCompGridVector *vector, HYPRE_Complex value ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGDDCompGridVectorSetConstantValues)( vector, value ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_AMGHybridCreate( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridCreate)( ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridDestroy( void *AMGhybrid_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridDestroy)( AMGhybrid_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridGetDSCGNumIterations( void *AMGhybrid_vdata, HYPRE_Int *dscg_num_its ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridGetDSCGNumIterations)( AMGhybrid_vdata, dscg_num_its ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridGetFinalRelativeResidualNorm( void *AMGhybrid_vdata, HYPRE_Real *final_rel_res_norm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridGetFinalRelativeResidualNorm)( AMGhybrid_vdata, final_rel_res_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridGetNumIterations( void *AMGhybrid_vdata, HYPRE_Int *num_its ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridGetNumIterations)( AMGhybrid_vdata, num_its ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridGetPCGNumIterations( void *AMGhybrid_vdata, HYPRE_Int *pcg_num_its ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridGetPCGNumIterations)( AMGhybrid_vdata, pcg_num_its ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridGetRecomputeResidual( void *AMGhybrid_vdata, HYPRE_Int *recompute_residual ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridGetRecomputeResidual)( AMGhybrid_vdata, recompute_residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridGetRecomputeResidualP( void *AMGhybrid_vdata, HYPRE_Int *recompute_residual_p ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridGetRecomputeResidualP)( AMGhybrid_vdata, recompute_residual_p ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridGetSetupSolveTime( void *AMGhybrid_vdata, HYPRE_Real *time ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridGetSetupSolveTime)( AMGhybrid_vdata, time ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetAbsoluteTol( void *AMGhybrid_vdata, HYPRE_Real a_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetAbsoluteTol)( AMGhybrid_vdata, a_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetAggInterpType( void *AMGhybrid_vdata, HYPRE_Int agg_interp_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetAggInterpType)( AMGhybrid_vdata, agg_interp_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetAggNumLevels( void *AMGhybrid_vdata, HYPRE_Int agg_num_levels ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetAggNumLevels)( AMGhybrid_vdata, agg_num_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetCoarsenType( void *AMGhybrid_vdata, HYPRE_Int coarsen_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetCoarsenType)( AMGhybrid_vdata, coarsen_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetConvergenceTol( void *AMGhybrid_vdata, HYPRE_Real cf_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetConvergenceTol)( AMGhybrid_vdata, cf_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetCycleNumSweeps( void *AMGhybrid_vdata, HYPRE_Int num_sweeps, HYPRE_Int k ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetCycleNumSweeps)( AMGhybrid_vdata, num_sweeps, k ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetCycleRelaxType( void *AMGhybrid_vdata, HYPRE_Int relax_type, HYPRE_Int k ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetCycleRelaxType)( AMGhybrid_vdata, relax_type, k ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetCycleType( void *AMGhybrid_vdata, HYPRE_Int cycle_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetCycleType)( AMGhybrid_vdata, cycle_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetDSCGMaxIter( void *AMGhybrid_vdata, HYPRE_Int dscg_max_its ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetDSCGMaxIter)( AMGhybrid_vdata, dscg_max_its ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetDofFunc( void *AMGhybrid_vdata, HYPRE_Int *dof_func ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetDofFunc)( AMGhybrid_vdata, dof_func ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetGridRelaxPoints( void *AMGhybrid_vdata, HYPRE_Int **grid_relax_points ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetGridRelaxPoints)( AMGhybrid_vdata, grid_relax_points ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetGridRelaxType( void *AMGhybrid_vdata, HYPRE_Int *grid_relax_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetGridRelaxType)( AMGhybrid_vdata, grid_relax_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetInterpType( void *AMGhybrid_vdata, HYPRE_Int interp_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetInterpType)( AMGhybrid_vdata, interp_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetKDim( void *AMGhybrid_vdata, HYPRE_Int k_dim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetKDim)( AMGhybrid_vdata, k_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetKeepTranspose( void *AMGhybrid_vdata, HYPRE_Int keepT ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetKeepTranspose)( AMGhybrid_vdata, keepT ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetLevelOuterWt( void *AMGhybrid_vdata, HYPRE_Real outer_wt, HYPRE_Int level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetLevelOuterWt)( AMGhybrid_vdata, outer_wt, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetLevelRelaxWt( void *AMGhybrid_vdata, HYPRE_Real relax_wt, HYPRE_Int level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetLevelRelaxWt)( AMGhybrid_vdata, relax_wt, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetLogging( void *AMGhybrid_vdata, HYPRE_Int logging ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetLogging)( AMGhybrid_vdata, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetMaxCoarseSize( void *AMGhybrid_vdata, HYPRE_Int max_coarse_size ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetMaxCoarseSize)( AMGhybrid_vdata, max_coarse_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetMaxLevels( void *AMGhybrid_vdata, HYPRE_Int max_levels ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetMaxLevels)( AMGhybrid_vdata, max_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetMaxRowSum( void *AMGhybrid_vdata, HYPRE_Real max_row_sum ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetMaxRowSum)( AMGhybrid_vdata, max_row_sum ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetMeasureType( void *AMGhybrid_vdata, HYPRE_Int measure_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetMeasureType)( AMGhybrid_vdata, measure_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetMinCoarseSize( void *AMGhybrid_vdata, HYPRE_Int min_coarse_size ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetMinCoarseSize)( AMGhybrid_vdata, min_coarse_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetNodal( void *AMGhybrid_vdata, HYPRE_Int nodal ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetNodal)( AMGhybrid_vdata, nodal ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetNonGalerkinTol( void *AMGhybrid_vdata, HYPRE_Int nongalerk_num_tol, HYPRE_Real *nongalerkin_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetNonGalerkinTol)( AMGhybrid_vdata, nongalerk_num_tol, nongalerkin_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetNumFunctions( void *AMGhybrid_vdata, HYPRE_Int num_functions ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetNumFunctions)( AMGhybrid_vdata, num_functions ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetNumGridSweeps( void *AMGhybrid_vdata, HYPRE_Int *num_grid_sweeps ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetNumGridSweeps)( AMGhybrid_vdata, num_grid_sweeps ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetNumPaths( void *AMGhybrid_vdata, HYPRE_Int num_paths ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetNumPaths)( AMGhybrid_vdata, num_paths ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetNumSweeps( void *AMGhybrid_vdata, HYPRE_Int num_sweeps ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetNumSweeps)( AMGhybrid_vdata, num_sweeps ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetOmega( void *AMGhybrid_vdata, HYPRE_Real *omega ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetOmega)( AMGhybrid_vdata, omega ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetOuterWt( void *AMGhybrid_vdata, HYPRE_Real outer_wt ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetOuterWt)( AMGhybrid_vdata, outer_wt ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetPCGMaxIter( void *AMGhybrid_vdata, HYPRE_Int pcg_max_its ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetPCGMaxIter)( AMGhybrid_vdata, pcg_max_its ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetPMaxElmts( void *AMGhybrid_vdata, HYPRE_Int P_max_elmts ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetPMaxElmts)( AMGhybrid_vdata, P_max_elmts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetPrintLevel( void *AMGhybrid_vdata, HYPRE_Int print_level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetPrintLevel)( AMGhybrid_vdata, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetRecomputeResidual( void *AMGhybrid_vdata, HYPRE_Int recompute_residual ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetRecomputeResidual)( AMGhybrid_vdata, recompute_residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetRecomputeResidualP( void *AMGhybrid_vdata, HYPRE_Int recompute_residual_p ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetRecomputeResidualP)( AMGhybrid_vdata, recompute_residual_p ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetRelChange( void *AMGhybrid_vdata, HYPRE_Int rel_change ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetRelChange)( AMGhybrid_vdata, rel_change ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetRelaxOrder( void *AMGhybrid_vdata, HYPRE_Int relax_order ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetRelaxOrder)( AMGhybrid_vdata, relax_order ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetRelaxType( void *AMGhybrid_vdata, HYPRE_Int relax_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetRelaxType)( AMGhybrid_vdata, relax_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetRelaxWeight( void *AMGhybrid_vdata, HYPRE_Real *relax_weight ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetRelaxWeight)( AMGhybrid_vdata, relax_weight ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetRelaxWt( void *AMGhybrid_vdata, HYPRE_Real relax_wt ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetRelaxWt)( AMGhybrid_vdata, relax_wt ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetSeqThreshold( void *AMGhybrid_vdata, HYPRE_Int seq_threshold ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetSeqThreshold)( AMGhybrid_vdata, seq_threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetSetupType( void *AMGhybrid_vdata, HYPRE_Int setup_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetSetupType)( AMGhybrid_vdata, setup_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetSolverType( void *AMGhybrid_vdata, HYPRE_Int solver_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetSolverType)( AMGhybrid_vdata, solver_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetStopCrit( void *AMGhybrid_vdata, HYPRE_Int stop_crit ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetStopCrit)( AMGhybrid_vdata, stop_crit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetStrongThreshold( void *AMGhybrid_vdata, HYPRE_Real strong_threshold ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetStrongThreshold)( AMGhybrid_vdata, strong_threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetTol( void *AMGhybrid_vdata, HYPRE_Real tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetTol)( AMGhybrid_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetTruncFactor( void *AMGhybrid_vdata, HYPRE_Real trunc_factor ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetTruncFactor)( AMGhybrid_vdata, trunc_factor ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetTwoNorm( void *AMGhybrid_vdata, HYPRE_Int two_norm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetTwoNorm)( AMGhybrid_vdata, two_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSetup( void *AMGhybrid_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSetup)( AMGhybrid_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGHybridSolve( void *AMGhybrid_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGHybridSolve)( AMGhybrid_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMGNodalSchwarzSmoother( hypre_CSRMatrix *A, HYPRE_Int num_functions, HYPRE_Int option, hypre_CSRMatrix **domain_structure_pointer ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGNodalSchwarzSmoother)( A, num_functions, option, domain_structure_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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMGeAgglomerate)( i_AE_element, j_AE_element, i_face_face, j_face_face, w_face_face, i_face_element, j_face_element, i_element_face, j_element_face, i_face_to_prefer_weight, i_face_weight, num_faces, num_elements, num_AEs_pointer ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSComputeGPi)( A, G, Gx, Gy, Gz, dim, GPi_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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSComputePi)( A, G, Gx, Gy, Gz, dim, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSComputePixyz)( A, G, Gx, Gy, Gz, dim, Pix_ptr, Piy_ptr, Piz_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMSConstructDiscreteGradient( hypre_ParCSRMatrix *A, hypre_ParVector *x_coord, HYPRE_BigInt *edge_vertex, HYPRE_Int edge_orientation, hypre_ParCSRMatrix **G_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSConstructDiscreteGradient)( A, x_coord, edge_vertex, edge_orientation, G_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_AMSCreate( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSCreate)( ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMSDestroy( void *solver ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSDestroy)( solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMSFEIDestroy( void *solver ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSFEIDestroy)( solver ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSFEISetup)( solver, A, b, x, num_vert, num_local_vert, vert_number, vert_coord, num_edges, edge_vertex ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMSGetFinalRelativeResidualNorm( void *solver, HYPRE_Real *rel_resid_norm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSGetFinalRelativeResidualNorm)( solver, rel_resid_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMSGetNumIterations( void *solver, HYPRE_Int *num_iterations ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSGetNumIterations)( solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMSProjectOutGradients( void *solver, hypre_ParVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSProjectOutGradients)( solver, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMSSetAlphaAMGCoarseRelaxType( void *solver, HYPRE_Int B_Pi_coarse_relax_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSSetAlphaAMGCoarseRelaxType)( solver, B_Pi_coarse_relax_type ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSSetAlphaAMGOptions)( solver, B_Pi_coarsen_type, B_Pi_agg_levels, B_Pi_relax_type, B_Pi_theta, B_Pi_interp_type, B_Pi_Pmax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMSSetAlphaPoissonMatrix( void *solver, hypre_ParCSRMatrix *A_Pi ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSSetAlphaPoissonMatrix)( solver, A_Pi ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMSSetBetaAMGCoarseRelaxType( void *solver, HYPRE_Int B_G_coarse_relax_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSSetBetaAMGCoarseRelaxType)( solver, B_G_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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSSetBetaAMGOptions)( solver, B_G_coarsen_type, B_G_agg_levels, B_G_relax_type, B_G_theta, B_G_interp_type, B_G_Pmax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMSSetBetaPoissonMatrix( void *solver, hypre_ParCSRMatrix *A_G ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSSetBetaPoissonMatrix)( solver, A_G ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMSSetChebySmoothingOptions( void *solver, HYPRE_Int A_cheby_order, HYPRE_Real A_cheby_fraction ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSSetChebySmoothingOptions)( solver, A_cheby_order, A_cheby_fraction ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMSSetCoordinateVectors( void *solver, hypre_ParVector *x, hypre_ParVector *y, hypre_ParVector *z ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSSetCoordinateVectors)( solver, x, y, z ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMSSetCycleType( void *solver, HYPRE_Int cycle_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSSetCycleType)( solver, cycle_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMSSetDimension( void *solver, HYPRE_Int dim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSSetDimension)( solver, dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMSSetDiscreteGradient( void *solver, hypre_ParCSRMatrix *G ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSSetDiscreteGradient)( solver, G ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMSSetEdgeConstantVectors( void *solver, hypre_ParVector *Gx, hypre_ParVector *Gy, hypre_ParVector *Gz ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSSetEdgeConstantVectors)( solver, Gx, Gy, Gz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMSSetInteriorNodes( void *solver, hypre_ParVector *interior_nodes ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSSetInteriorNodes)( solver, interior_nodes ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMSSetInterpolations( void *solver, hypre_ParCSRMatrix *Pi, hypre_ParCSRMatrix *Pix, hypre_ParCSRMatrix *Piy, hypre_ParCSRMatrix *Piz ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSSetInterpolations)( solver, Pi, Pix, Piy, Piz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMSSetMaxIter( void *solver, HYPRE_Int maxit ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSSetMaxIter)( solver, maxit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMSSetPrintLevel( void *solver, HYPRE_Int print_level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSSetPrintLevel)( solver, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMSSetProjectionFrequency( void *solver, HYPRE_Int projection_frequency ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSSetProjectionFrequency)( solver, projection_frequency ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSSetSmoothingOptions)( solver, A_relax_type, A_relax_times, A_relax_weight, A_omega ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMSSetTol( void *solver, HYPRE_Real tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSSetTol)( solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMSSetup( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSSetup)( solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AMSSolve( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AMSSolve)( solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AdSchwarzCFSolve)( par_A, par_rhs, domain_structure, scale, par_x, par_aux, CF_marker, rlx_pt, pivots, use_nonsymm ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AdSchwarzSolve)( par_A, par_rhs, domain_structure, scale, par_x, par_aux, pivots, use_nonsymm ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AddToPattern)( kaporin_gradient, kap_grad_nonzeros, S_Pattern, S_nnz, kg_marker, max_step_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AmgCGCBoundaryFix( hypre_ParCSRMatrix *S, HYPRE_Int *CF_marker, HYPRE_Int *CF_marker_offd ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AmgCGCBoundaryFix)( S, CF_marker, CF_marker_offd ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AmgCGCChoose( hypre_CSRMatrix *G, HYPRE_Int *vertexrange, HYPRE_Int mpisize, HYPRE_Int **coarse ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AmgCGCChoose)( G, vertexrange, mpisize, coarse ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AmgCGCGraphAssemble)( S, vertexrange, CF_marker, CF_marker_offd, coarsen_type, ijG ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AmgCGCPrepare)( S, nlocal, CF_marker, CF_marker_offd, coarsen_type, vrange ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_Bisection)( n, diag, offd, y, z, tol, k, ev_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BlockDiagInvLapack( HYPRE_Real *diag, HYPRE_Int N, HYPRE_Int blk_size ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BlockDiagInvLapack)( diag, N, blk_size ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_BlockTridiagCreate( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BlockTridiagCreate)( ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BlockTridiagDestroy( void *data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BlockTridiagDestroy)( data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BlockTridiagSetAMGNumSweeps( void *data, HYPRE_Int nsweeps ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BlockTridiagSetAMGNumSweeps)( data, nsweeps ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BlockTridiagSetAMGRelaxType( void *data, HYPRE_Int relax_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BlockTridiagSetAMGRelaxType)( data, relax_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BlockTridiagSetAMGStrengthThreshold( void *data, HYPRE_Real thresh ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BlockTridiagSetAMGStrengthThreshold)( data, thresh ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BlockTridiagSetIndexSet( void *data, HYPRE_Int n, HYPRE_Int *inds ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BlockTridiagSetIndexSet)( data, n, inds ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BlockTridiagSetPrintLevel( void *data, HYPRE_Int print_level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BlockTridiagSetPrintLevel)( data, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BlockTridiagSetup( void *data, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BlockTridiagSetup)( data, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BlockTridiagSolve( void *data, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BlockTridiagSolve)( data, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGAdditiveCycle( void *amg_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGAdditiveCycle)( amg_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGBlockSolve( void *B, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBlockSolve)( B, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGBuildCoarseOperator( hypre_ParCSRMatrix *RT, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, hypre_ParCSRMatrix **RAP_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildCoarseOperator)( RT, A, P, RAP_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGBuildCoarseOperatorKT( hypre_ParCSRMatrix *RT, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, HYPRE_Int keepTranspose, hypre_ParCSRMatrix **RAP_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildCoarseOperatorKT)( RT, A, P, keepTranspose, RAP_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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildDirInterp)( A, CF_marker, S, num_cpts_global, num_functions, dof_func, debug_flag, trunc_factor, max_elmts, interp_type, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildExtInterp)( A, CF_marker, S, num_cpts_global, num_functions, dof_func, debug_flag, trunc_factor, max_elmts, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildExtPICCInterp)( A, CF_marker, S, num_cpts_global, num_functions, dof_func, debug_flag, trunc_factor, max_elmts, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildExtPIInterp)( A, CF_marker, S, num_cpts_global, num_functions, dof_func, debug_flag, trunc_factor, max_elmts, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildExtPIInterpHost)( A, CF_marker, S, num_cpts_global, num_functions, dof_func, debug_flag, trunc_factor, max_elmts, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildFF1Interp)( A, CF_marker, S, num_cpts_global, num_functions, dof_func, debug_flag, trunc_factor, max_elmts, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildFFInterp)( A, CF_marker, S, num_cpts_global, num_functions, dof_func, debug_flag, trunc_factor, max_elmts, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildInterp)( A, CF_marker, S, num_cpts_global, num_functions, dof_func, debug_flag, trunc_factor, max_elmts, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildInterpGSMG)( A, CF_marker, S, num_cpts_global, num_functions, dof_func, debug_flag, trunc_factor, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildInterpHE)( A, CF_marker, S, num_cpts_global, num_functions, dof_func, debug_flag, trunc_factor, max_elmts, P_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildInterpLS)( A, CF_marker, S, num_cpts_global, num_functions, dof_func, debug_flag, trunc_factor, num_smooth, SmoothVecs, P_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildInterpModUnk)( A, CF_marker, S, num_cpts_global, num_functions, dof_func, debug_flag, trunc_factor, max_elmts, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildInterpOnePnt)( A, CF_marker, S, num_cpts_global, num_functions, dof_func, debug_flag, P_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildInterpOnePntHost)( A, CF_marker, S, num_cpts_global, num_functions, dof_func, debug_flag, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildModExtInterp)( A, CF_marker, S, num_cpts_global, num_functions, dof_func, debug_flag, trunc_factor, max_elmts, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildModExtPEInterp)( A, CF_marker, S, num_cpts_global, num_functions, dof_func, debug_flag, trunc_factor, max_elmts, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildModExtPIInterp)( A, CF_marker, S, num_cpts_global, num_functions, dof_func, debug_flag, trunc_factor, max_elmts, P_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildModMultipass)( A, CF_marker, S, num_cpts_global, trunc_factor, P_max_elmts, interp_type, num_functions, dof_func, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildModMultipassHost)( A, CF_marker, S, num_cpts_global, trunc_factor, P_max_elmts, interp_type, num_functions, dof_func, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildModPartialExtInterp)( A, CF_marker, S, num_cpts_global, num_old_cpts_global, num_functions, dof_func, debug_flag, trunc_factor, max_elmts, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(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 ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildModPartialExtPEInterp)( A, CF_marker, S, num_cpts_global, num_old_cpts_global, num_functions, dof_func, debug_flag, trunc_factor, max_elmts, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(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 ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildMultipass)( A, CF_marker, S, num_cpts_global, num_functions, dof_func, debug_flag, trunc_factor, P_max_elmts, weight_option, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(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_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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildNonGalerkinCoarseOperator)( RAP_ptr, AP, strong_threshold, max_row_sum, num_functions, dof_func_value, CF_marker, droptol, sym_collapse, lump_percent, collapse_beta ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildPartialExtInterp)( A, CF_marker, S, num_cpts_global, num_old_cpts_global, num_functions, dof_func, debug_flag, trunc_factor, max_elmts, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildPartialExtPIInterp)( A, CF_marker, S, num_cpts_global, num_old_cpts_global, num_functions, dof_func, debug_flag, trunc_factor, max_elmts, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildPartialStdInterp)( A, CF_marker, S, num_cpts_global, num_old_cpts_global, num_functions, dof_func, debug_flag, trunc_factor, max_elmts, sep_weight, P_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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildRestrAIR)( A, CF_marker, S, num_cpts_global, num_functions, dof_func, filter_thresholdR, debug_flag, R_ptr, is_triangular, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildRestrDist2AIR)( A, CF_marker, S, num_cpts_global, num_functions, dof_func, filter_thresholdR, debug_flag, R_ptr, AIR1_5, is_triangular, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildRestrNeumannAIR)( A, CF_marker, num_cpts_global, num_functions, dof_func, NeumannDeg, strong_thresholdR, filter_thresholdR, debug_flag, R_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGBuildStdInterp)( A, CF_marker, S, num_cpts_global, num_functions, dof_func, debug_flag, trunc_factor, max_elmts, sep_weight, P_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGCGRelaxWt( void *amg_vdata, HYPRE_Int level, HYPRE_Int num_cg_sweeps, HYPRE_Real *rlx_wt_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCGRelaxWt)( amg_vdata, level, num_cg_sweeps, rlx_wt_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCoarseParms)( comm, local_num_variables, num_functions, dof_func, CF_marker, coarse_dof_func_ptr, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCoarseParmsHost)( comm, local_num_variables, num_functions, dof_func, CF_marker, coarse_dof_func_ptr, coarse_pnts_global ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGCoarsen( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, HYPRE_Int CF_init, HYPRE_Int debug_flag, hypre_IntArray **CF_marker_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCoarsen)( S, A, CF_init, debug_flag, CF_marker_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGCoarsenCGC( hypre_ParCSRMatrix *S, HYPRE_Int numberofgrids, HYPRE_Int coarsen_type, HYPRE_Int *CF_marker ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCoarsenCGC)( S, numberofgrids, coarsen_type, CF_marker ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCoarsenCGCb)( S, A, measure_type, coarsen_type, cgc_its, debug_flag, CF_marker_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCoarsenCR)( A, CF_marker_ptr, coarse_size_ptr, num_CR_relax_steps, IS_type, num_functions, rlx_type, relax_weight, omega, theta, smoother, AN, useCG, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCoarsenCR1)( A, CF_marker_ptr, coarse_size_ptr, num_CR_relax_steps, IS_type, CRaddCpoints ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCoarsenFalgout)( S, A, measure_type, cut_factor, debug_flag, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCoarsenHMIS)( S, A, measure_type, cut_factor, debug_flag, CF_marker_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCoarsenInterpVectors)( P, num_smooth_vecs, smooth_vecs, CF_marker, new_smooth_vecs, expand_level, num_functions ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGCoarsenPMIS( hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, HYPRE_Int CF_init, HYPRE_Int debug_flag, hypre_IntArray **CF_marker_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCoarsenPMIS)( S, A, CF_init, debug_flag, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCoarsenPMISHost)( S, A, CF_init, debug_flag, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCoarsenRuge)( S, A, measure_type, coarsen_type, cut_factor, debug_flag, CF_marker_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGCorrectCFMarker( hypre_IntArray *CF_marker, hypre_IntArray *new_CF_marker ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCorrectCFMarker)( CF_marker, new_CF_marker ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGCorrectCFMarker2( hypre_IntArray *CF_marker, hypre_IntArray *new_CF_marker ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCorrectCFMarker2)( CF_marker, new_CF_marker ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGCorrectCFMarker2Host( hypre_IntArray *CF_marker, hypre_IntArray *new_CF_marker ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCorrectCFMarker2Host)( CF_marker, new_CF_marker ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGCorrectCFMarkerHost( hypre_IntArray *CF_marker, hypre_IntArray *new_CF_marker ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCorrectCFMarkerHost)( CF_marker, new_CF_marker ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_BoomerAMGCreate( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCreate)( ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGCreate2ndS( hypre_ParCSRMatrix *S, HYPRE_Int *CF_marker, HYPRE_Int num_paths, HYPRE_BigInt *coarse_row_starts, hypre_ParCSRMatrix **C_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCreate2ndS)( S, CF_marker, num_paths, coarse_row_starts, C_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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCreateNodalA)( A, num_functions, dof_func, option, diag_option, AN_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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCreateS)( A, strength_threshold, max_row_sum, num_functions, dof_func, S_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGCreateSCommPkg( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *S, HYPRE_Int **col_offd_S_to_A_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCreateSCommPkg)( A, S, col_offd_S_to_A_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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCreateSFromCFMarker)( A, strength_threshold, max_row_sum, CF_marker, num_functions, dof_func, SMRK, S_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCreateSHost)( A, strength_threshold, max_row_sum, num_functions, dof_func, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCreateSabs)( A, strength_threshold, max_row_sum, num_functions, dof_func, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCreateSabsHost)( A, strength_threshold, max_row_sum, num_functions, dof_func, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCreateScalarCF)( CFN_marker, num_functions, num_nodes, dof_func_ptr, CF_marker_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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCreateScalarCFS)( SN, A, CFN_marker, num_functions, nodal, keep_same_sign, dof_func_ptr, CF_marker_ptr, S_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCreateSmoothDirs)( data, A, SmoothVecs, thresh, num_functions, dof_func, S_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGCreateSmoothVecs( void *data, hypre_ParCSRMatrix *A, HYPRE_Int num_sweeps, HYPRE_Int level, HYPRE_Real **SmoothVecs_p ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCreateSmoothVecs)( data, A, num_sweeps, level, SmoothVecs_p ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGCycle( void *amg_vdata, hypre_ParVector **F_array, hypre_ParVector **U_array ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCycle)( amg_vdata, F_array, U_array ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGCycleT( void *amg_vdata, hypre_ParVector **F_array, hypre_ParVector **U_array ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGCycleT)( amg_vdata, F_array, U_array ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_BoomerAMGDDCreate( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDDCreate)( ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDDDestroy( void *data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDDDestroy)( data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDDGetAMG( void *data, void **amg_solver ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDDGetAMG)( data, amg_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDDGetFACCycleType( void *data, HYPRE_Int *fac_cycle_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDDGetFACCycleType)( data, fac_cycle_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDDGetFACNumCycles( void *data, HYPRE_Int *fac_num_cycles ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDDGetFACNumCycles)( data, fac_num_cycles ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDDGetFACNumRelax( void *data, HYPRE_Int *fac_num_relax ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDDGetFACNumRelax)( data, fac_num_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDDGetFACRelaxType( void *data, HYPRE_Int *fac_relax_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDDGetFACRelaxType)( data, fac_relax_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDDGetFACRelaxWeight( void *data, HYPRE_Real *fac_relax_weight ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDDGetFACRelaxWeight)( data, fac_relax_weight ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDDGetNumGhostLayers( void *data, HYPRE_Int *num_ghost_layers ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDDGetNumGhostLayers)( data, num_ghost_layers ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDDGetPadding( void *data, HYPRE_Int *padding ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDDGetPadding)( data, padding ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDDGetStartLevel( void *data, HYPRE_Int *start_level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDDGetStartLevel)( data, start_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDDSetFACCycleType( void *data, HYPRE_Int fac_cycle_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDDSetFACCycleType)( data, fac_cycle_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDDSetFACNumCycles( void *data, HYPRE_Int fac_num_cycles ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDDSetFACNumCycles)( data, fac_num_cycles ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDDSetFACNumRelax( void *data, HYPRE_Int fac_num_relax ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDDSetFACNumRelax)( data, fac_num_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDDSetFACRelaxType( void *data, HYPRE_Int fac_relax_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDDSetFACRelaxType)( data, fac_relax_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDDSetFACRelaxWeight( void *data, HYPRE_Real fac_relax_weight ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDDSetFACRelaxWeight)( data, fac_relax_weight ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDDSetNumGhostLayers( void *data, HYPRE_Int num_ghost_layers ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDDSetNumGhostLayers)( data, num_ghost_layers ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDDSetPadding( void *data, HYPRE_Int padding ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDDSetPadding)( data, padding ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDDSetStartLevel( void *data, HYPRE_Int start_level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDDSetStartLevel)( data, start_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDDSetup( void *amgdd_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDDSetup)( amgdd_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDDSolve( void *solver, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDDSolve)( solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo( hypre_ParAMGDDData* amgdd_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDD_CommunicateRemainingMatrixInfo)( amgdd_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDD_FAC( void *amgdd_vdata, HYPRE_Int first_iteration ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDD_FAC)( amgdd_vdata, first_iteration ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDD_FAC_CFL1Jacobi( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDD_FAC_CFL1Jacobi)( amgdd_vdata, level, cycle_param ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDD_FAC_CFL1JacobiHost( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int relax_set ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDD_FAC_CFL1JacobiHost)( amgdd_vdata, level, relax_set ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDD_FAC_Cycle( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_type, HYPRE_Int first_iteration ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDD_FAC_Cycle)( amgdd_vdata, level, cycle_type, first_iteration ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDD_FAC_FCycle( void *amgdd_vdata, HYPRE_Int first_iteration ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDD_FAC_FCycle)( amgdd_vdata, first_iteration ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDD_FAC_GaussSeidel( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDD_FAC_GaussSeidel)( amgdd_vdata, level, cycle_param ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDD_FAC_Interpolate( hypre_AMGDDCompGrid *compGrid_f, hypre_AMGDDCompGrid *compGrid_c ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDD_FAC_Interpolate)( compGrid_f, compGrid_c ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDD_FAC_Jacobi( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDD_FAC_Jacobi)( amgdd_vdata, level, cycle_param ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDD_FAC_JacobiHost( void *amgdd_vdata, HYPRE_Int level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDD_FAC_JacobiHost)( amgdd_vdata, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDD_FAC_OrderedGaussSeidel( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDD_FAC_OrderedGaussSeidel)( amgdd_vdata, level, cycle_param ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDD_FAC_Relax( void *amgdd_vdata, HYPRE_Int level, HYPRE_Int cycle_param ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDD_FAC_Relax)( amgdd_vdata, level, cycle_param ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDD_FAC_Restrict( hypre_AMGDDCompGrid *compGrid_f, hypre_AMGDDCompGrid *compGrid_c, HYPRE_Int first_iteration ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDD_FAC_Restrict)( compGrid_f, compGrid_c, first_iteration ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDD_FixUpRecvMaps( hypre_AMGDDCompGrid **compGrid, hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int start_level, HYPRE_Int num_levels ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDD_FixUpRecvMaps)( compGrid, compGridCommPkg, start_level, num_levels ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDD_MarkCoarse)( list, marker, owned_coarse_indices, nonowned_coarse_indices, sort_map, num_owned, total_num_nodes, num_owned_coarse, list_size, dist, use_sort, nodes_to_add ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDD_PackRecvMapSendBuffer)( recv_map_send_buffer, recv_red_marker, num_recv_nodes, recv_buffer_size, current_level, num_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Complex* +hypre_BoomerAMGDD_PackResidualBuffer( hypre_AMGDDCompGrid **compGrid, hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int current_level, HYPRE_Int proc ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDD_PackResidualBuffer)( compGrid, compGridCommPkg, current_level, proc ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDD_PackSendBuffer)( amgdd_data, proc, current_level, padding, send_flag_buffer_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDD_RecursivelyBuildPsiComposite( HYPRE_Int node, HYPRE_Int m, hypre_AMGDDCompGrid *compGrid, HYPRE_Int *add_flag, HYPRE_Int use_sort ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDD_RecursivelyBuildPsiComposite)( node, m, compGrid, add_flag, use_sort ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDD_ResidualCommunication( hypre_ParAMGDDData *amgdd_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDD_ResidualCommunication)( amgdd_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDD_SetupNearestProcessorNeighbors( hypre_ParCSRMatrix *A, hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int level, HYPRE_Int *padding, HYPRE_Int num_ghost_layers ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDD_SetupNearestProcessorNeighbors)( A, compGridCommPkg, level, padding, num_ghost_layers ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDD_UnpackRecvBuffer)( amgdd_data, recv_buffer, A_tmp_info, recv_map_send_buffer_size, nodes_added_on_level, current_level, buffer_number ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDD_UnpackResidualBuffer( HYPRE_Complex *buffer, hypre_AMGDDCompGrid **compGrid, hypre_AMGDDCommPkg *compGridCommPkg, HYPRE_Int current_level, HYPRE_Int proc ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDD_UnpackResidualBuffer)( buffer, compGrid, compGridCommPkg, current_level, proc ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDD_UnpackSendFlagBuffer)( compGrid, send_flag_buffer, send_flag, num_send_nodes, send_buffer_size, current_level, num_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGDestroy( void *data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGDestroy)( data ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGFitVectors)( ip, n, num, V, nc, ind, val ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetAdditive( void *data, HYPRE_Int *additive ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetAdditive)( data, additive ); +} + +/*--------------------------------------------------------------------------*/ + +const char* +hypre_BoomerAMGGetAggProlongationName( hypre_ParAMGData *amg_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetAggProlongationName)( amg_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetCoarsenCutFactor( void *data, HYPRE_Int *coarsen_cut_factor ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetCoarsenCutFactor)( data, coarsen_cut_factor ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetCoarsenType( void *data, HYPRE_Int *coarsen_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetCoarsenType)( data, coarsen_type ); +} + +/*--------------------------------------------------------------------------*/ + +const char* +hypre_BoomerAMGGetCoarseningName( hypre_ParAMGData *amg_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetCoarseningName)( amg_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetConvergeType( void *data, HYPRE_Int *type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetConvergeType)( data, type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetCumNnzAP( void *data, HYPRE_Real *cum_nnz_AP ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetCumNnzAP)( data, cum_nnz_AP ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetCumNumIterations( void *data, HYPRE_Int *cum_num_iterations ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetCumNumIterations)( data, cum_num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +const char* +hypre_BoomerAMGGetCycleName( hypre_ParAMGData *amg_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetCycleName)( amg_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetCycleNumSweeps( void *data, HYPRE_Int *num_sweeps, HYPRE_Int k ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetCycleNumSweeps)( data, num_sweeps, k ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetCycleRelaxType( void *data, HYPRE_Int *relax_type, HYPRE_Int k ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetCycleRelaxType)( data, relax_type, k ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetCycleType( void *data, HYPRE_Int *cycle_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetCycleType)( data, cycle_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetDebugFlag( void *data, HYPRE_Int *debug_flag ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetDebugFlag)( data, debug_flag ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetDomainType( void *data, HYPRE_Int *domain_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetDomainType)( data, domain_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetFCycle( void *data, HYPRE_Int *fcycle ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetFCycle)( data, fcycle ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetFilterFunctions( void *data, HYPRE_Int *filter_functions ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetFilterFunctions)( data, filter_functions ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetFilterThresholdR( void *data, HYPRE_Real *filter_threshold ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetFilterThresholdR)( data, filter_threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetGridHierarchy( void *data, HYPRE_Int *cgrid ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetGridHierarchy)( data, cgrid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetGridRelaxPoints( void *data, HYPRE_Int ***grid_relax_points ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetGridRelaxPoints)( data, grid_relax_points ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetGridRelaxType( void *data, HYPRE_Int **grid_relax_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetGridRelaxType)( data, grid_relax_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetInterpType( void *data, HYPRE_Int *interp_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetInterpType)( data, interp_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetJacobiTruncThreshold( void *data, HYPRE_Real *jacobi_trunc_threshold ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetJacobiTruncThreshold)( data, jacobi_trunc_threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetLevelOuterWt( void *data, HYPRE_Real *omega, HYPRE_Int level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetLevelOuterWt)( data, omega, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetLevelRelaxWt( void *data, HYPRE_Real *relax_weight, HYPRE_Int level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetLevelRelaxWt)( data, relax_weight, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetLogging( void *data, HYPRE_Int *logging ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetLogging)( data, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetMaxCoarseSize( void *data, HYPRE_Int *max_coarse_size ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetMaxCoarseSize)( data, max_coarse_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetMaxIter( void *data, HYPRE_Int *max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetMaxIter)( data, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetMaxLevels( void *data, HYPRE_Int *max_levels ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetMaxLevels)( data, max_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetMaxRowSum( void *data, HYPRE_Real *max_row_sum ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetMaxRowSum)( data, max_row_sum ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetMeasureType( void *data, HYPRE_Int *measure_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetMeasureType)( data, measure_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetMinCoarseSize( void *data, HYPRE_Int *min_coarse_size ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetMinCoarseSize)( data, min_coarse_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetMinIter( void *data, HYPRE_Int *min_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetMinIter)( data, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetMultAdditive( void *data, HYPRE_Int *mult_additive ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetMultAdditive)( data, mult_additive ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetNumFunctions( void *data, HYPRE_Int *num_functions ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetNumFunctions)( data, num_functions ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetNumGridSweeps( void *data, HYPRE_Int **num_grid_sweeps ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetNumGridSweeps)( data, num_grid_sweeps ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetNumIterations( void *data, HYPRE_Int *num_iterations ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetNumIterations)( data, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetOmega( void *data, HYPRE_Real **omega ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetOmega)( data, omega ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetOverlap( void *data, HYPRE_Int *overlap ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetOverlap)( data, overlap ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetPMaxElmts( void *data, HYPRE_Int *P_max_elmts ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetPMaxElmts)( data, P_max_elmts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetPostInterpType( void *data, HYPRE_Int *post_interp_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetPostInterpType)( data, post_interp_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetPrintFileName( void *data, char **print_file_name ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetPrintFileName)( data, print_file_name ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetPrintLevel( void *data, HYPRE_Int *print_level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetPrintLevel)( data, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +const char* +hypre_BoomerAMGGetProlongationName( hypre_ParAMGData *amg_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetProlongationName)( amg_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetRedundant( void *data, HYPRE_Int *redundant ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetRedundant)( data, redundant ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetRelResidualNorm( void *data, HYPRE_Real *rel_resid_norm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetRelResidualNorm)( data, rel_resid_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetRelaxOrder( void *data, HYPRE_Int *relax_order ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetRelaxOrder)( data, relax_order ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetRelaxWeight( void *data, HYPRE_Real **relax_weight ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetRelaxWeight)( data, relax_weight ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetResidual( void *data, hypre_ParVector **resid ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetResidual)( data, resid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetSchwarzRlxWeight( void *data, HYPRE_Real *schwarz_rlx_weight ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetSchwarzRlxWeight)( data, schwarz_rlx_weight ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetSeqThreshold( void *data, HYPRE_Int *seq_threshold ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetSeqThreshold)( data, seq_threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetSetupType( void *data, HYPRE_Int *setup_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetSetupType)( data, setup_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetSimple( void *data, HYPRE_Int *simple ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetSimple)( data, simple ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetSmoothNumLevels( void *data, HYPRE_Int *smooth_num_levels ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetSmoothNumLevels)( data, smooth_num_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetSmoothNumSweeps( void *data, HYPRE_Int *smooth_num_sweeps ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetSmoothNumSweeps)( data, smooth_num_sweeps ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetSmoothType( void *data, HYPRE_Int *smooth_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetSmoothType)( data, smooth_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetStrongThreshold( void *data, HYPRE_Real *strong_threshold ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetStrongThreshold)( data, strong_threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetStrongThresholdR( void *data, HYPRE_Real *strong_threshold ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetStrongThresholdR)( data, strong_threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetTol( void *data, HYPRE_Real *tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetTol)( data, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetTruncFactor( void *data, HYPRE_Real *trunc_factor ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetTruncFactor)( data, trunc_factor ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGGetVariant( void *data, HYPRE_Int *variant ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGGetVariant)( data, variant ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGIndepHMIS( hypre_ParCSRMatrix *S, HYPRE_Int measure_type, HYPRE_Int debug_flag, HYPRE_Int *CF_marker ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGIndepHMIS)( S, measure_type, debug_flag, CF_marker ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGIndepHMISa( hypre_ParCSRMatrix *S, HYPRE_Int measure_type, HYPRE_Int debug_flag, HYPRE_Int *CF_marker ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGIndepHMISa)( S, measure_type, debug_flag, CF_marker ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGIndepPMIS( hypre_ParCSRMatrix *S, HYPRE_Int CF_init, HYPRE_Int debug_flag, HYPRE_Int *CF_marker ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGIndepPMIS)( S, CF_init, debug_flag, CF_marker ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGIndepPMISa( hypre_ParCSRMatrix *S, HYPRE_Int CF_init, HYPRE_Int debug_flag, HYPRE_Int *CF_marker ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGIndepPMISa)( S, CF_init, debug_flag, CF_marker ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGIndepRS( hypre_ParCSRMatrix *S, HYPRE_Int measure_type, HYPRE_Int debug_flag, HYPRE_Int *CF_marker ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGIndepRS)( S, measure_type, debug_flag, CF_marker ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGIndepRSa( hypre_ParCSRMatrix *S, HYPRE_Int measure_type, HYPRE_Int debug_flag, HYPRE_Int *CF_marker ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGIndepRSa)( S, measure_type, debug_flag, CF_marker ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGIndepSet)( S, measure_array, graph_array, graph_array_size, graph_array_offd, graph_array_offd_size, IS_marker, IS_marker_offd ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGIndepSetInit( hypre_ParCSRMatrix *S, HYPRE_Real *measure_array, HYPRE_Int seq_rand ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGIndepSetInit)( S, measure_array, seq_rand ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGInterpTruncation( hypre_ParCSRMatrix *P, HYPRE_Real trunc_factor, HYPRE_Int max_elmts ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGInterpTruncation)( P, trunc_factor, max_elmts ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGJacobiInterp)( A, P, S, num_functions, dof_func, CF_marker, level, truncation_threshold, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGJacobiInterp_1)( A, P, S, CF_marker, level, truncation_threshold, truncation_threshold_minus, dof_func, dof_func_offd, weight_AF ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGNormalizeVecs( HYPRE_Int n, HYPRE_Int num, HYPRE_Real *V ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGNormalizeVecs)( n, num, V ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGPrintGeneralInfo( hypre_ParAMGData *amg_data, HYPRE_Int shift ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGPrintGeneralInfo)( amg_data, shift ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGRefineInterp)( A, P, num_cpts_global, nf, dof_func, CF_marker, level ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGRelax)( A, f, cf_marker, relax_type, relax_points, relax_weight, omega, l1_norms, u, Vtemp, Ztemp ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGRelax0WeightedJacobi)( A, f, cf_marker, relax_points, relax_weight, u, Vtemp ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGRelax10TopoOrderedGaussSeidel)( A, f, cf_marker, relax_points, relax_weight, omega, u, Vtemp, Ztemp ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGRelax11TwoStageGaussSeidel)( A, f, cf_marker, relax_points, relax_weight, omega, A_diag_diag, u, Vtemp, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGRelax12TwoStageGaussSeidel)( A, f, cf_marker, relax_points, relax_weight, omega, A_diag_diag, u, Vtemp, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGRelax13HybridL1GaussSeidel)( A, f, cf_marker, relax_points, relax_weight, omega, l1_norms, u, Vtemp, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGRelax14HybridL1GaussSeidel)( A, f, cf_marker, relax_points, relax_weight, omega, l1_norms, u, Vtemp, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGRelax18WeightedL1Jacobi)( A, f, cf_marker, relax_points, relax_weight, l1_norms, u, Vtemp ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGRelax1GaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_ParVector *u ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGRelax1GaussSeidel)( A, f, cf_marker, relax_points, u ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGRelax2GaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_ParVector *u ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGRelax2GaussSeidel)( A, f, cf_marker, relax_points, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGRelax3HybridGaussSeidel)( A, f, cf_marker, relax_points, relax_weight, omega, u, Vtemp, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGRelax4HybridGaussSeidel)( A, f, cf_marker, relax_points, relax_weight, omega, u, Vtemp, Ztemp ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGRelax5ChaoticHybridGaussSeidel( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Int *cf_marker, HYPRE_Int relax_points, hypre_ParVector *u ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGRelax5ChaoticHybridGaussSeidel)( A, f, cf_marker, relax_points, u ); +} + +/*--------------------------------------------------------------------------*/ + +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_CURRENTPRECISION_FUNC(hypre_BoomerAMGRelax6HybridSSOR)( A, f, cf_marker, relax_points, relax_weight, omega, u, Vtemp, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGRelax7Jacobi)( A, f, cf_marker, relax_points, relax_weight, l1_norms, u, Vtemp ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGRelax89HybridL1SSOR)( A, f, cf_marker, relax_points, relax_weight, omega, l1_norms, u, Vtemp, Ztemp ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGRelax8HybridL1SSOR)( A, f, cf_marker, relax_points, relax_weight, omega, l1_norms, u, Vtemp, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGRelaxComputeL1Norms)( A, relax_type, relax_order, coarsest_lvl, CF_marker, l1_norms_data_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGRelaxHybridGaussSeidel_core)( A, f, cf_marker, relax_points, relax_weight, omega, l1_norms, u, Vtemp, Ztemp, GS_order, Symm, Skip_diag, forced_seq, Topo_order ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGRelaxHybridSOR)( A, f, cf_marker, relax_points, relax_weight, omega, l1_norms, u, Vtemp, Ztemp, direction, symm, skip_diag, force_seq ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGRelaxIF)( A, f, cf_marker, relax_type, relax_order, cycle_type, relax_weight, omega, l1_norms, u, Vtemp, Ztemp ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGRelaxKaczmarz( hypre_ParCSRMatrix *A, hypre_ParVector *f, HYPRE_Real omega, HYPRE_Real *l1_norms, hypre_ParVector *u ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGRelaxKaczmarz)( A, f, omega, l1_norms, u ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGRelaxT)( A, f, cf_marker, relax_type, relax_points, relax_weight, u, Vtemp ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGRelax_FCFJacobi)( A, f, cf_marker, relax_weight, u, Vtemp ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetADropTol( void *data, HYPRE_Real A_drop_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetADropTol)( data, A_drop_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetADropType( void *data, HYPRE_Int A_drop_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetADropType)( data, A_drop_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetAddLastLvl( void *data, HYPRE_Int add_last_lvl ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetAddLastLvl)( data, add_last_lvl ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetAddRelaxType( void *data, HYPRE_Int add_rlx_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetAddRelaxType)( data, add_rlx_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetAddRelaxWt( void *data, HYPRE_Real add_rlx_wt ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetAddRelaxWt)( data, add_rlx_wt ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetAdditive( void *data, HYPRE_Int additive ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetAdditive)( data, additive ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetAggInterpType( void *data, HYPRE_Int agg_interp_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetAggInterpType)( data, agg_interp_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetAggNumLevels( void *data, HYPRE_Int agg_num_levels ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetAggNumLevels)( data, agg_num_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetAggP12MaxElmts( void *data, HYPRE_Int agg_P12_max_elmts ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetAggP12MaxElmts)( data, agg_P12_max_elmts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetAggP12TruncFactor( void *data, HYPRE_Real agg_P12_trunc_factor ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetAggP12TruncFactor)( data, agg_P12_trunc_factor ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetAggPMaxElmts( void *data, HYPRE_Int agg_P_max_elmts ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetAggPMaxElmts)( data, agg_P_max_elmts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetAggTruncFactor( void *data, HYPRE_Real agg_trunc_factor ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetAggTruncFactor)( data, agg_trunc_factor ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetCGCIts( void *data, HYPRE_Int its ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetCGCIts)( data, its ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetCPoints( void *data, HYPRE_Int cpt_coarse_level, HYPRE_Int num_cpt_coarse, HYPRE_BigInt *cpt_coarse_index ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetCPoints)( data, cpt_coarse_level, num_cpt_coarse, cpt_coarse_index ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetCRRate( void *data, HYPRE_Real CR_rate ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetCRRate)( data, CR_rate ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetCRStrongTh( void *data, HYPRE_Real CR_strong_th ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetCRStrongTh)( data, CR_strong_th ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetCRUseCG( void *data, HYPRE_Int CR_use_CG ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetCRUseCG)( data, CR_use_CG ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetChebyEigEst( void *data, HYPRE_Int eig_est ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetChebyEigEst)( data, eig_est ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetChebyFraction( void *data, HYPRE_Real ratio ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetChebyFraction)( data, ratio ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetChebyOrder( void *data, HYPRE_Int order ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetChebyOrder)( data, order ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetChebyScale( void *data, HYPRE_Int scale ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetChebyScale)( data, scale ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetChebyVariant( void *data, HYPRE_Int variant ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetChebyVariant)( data, variant ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetCoarsenCutFactor( void *data, HYPRE_Int coarsen_cut_factor ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetCoarsenCutFactor)( data, coarsen_cut_factor ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetCoarsenType( void *data, HYPRE_Int coarsen_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetCoarsenType)( data, coarsen_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetConvergeType( void *data, HYPRE_Int type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetConvergeType)( data, type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetCoordDim( void *data, HYPRE_Int coorddim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetCoordDim)( data, coorddim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetCoordinates( void *data, float *coordinates ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetCoordinates)( data, coordinates ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetCumNnzAP( void *data, HYPRE_Real cum_nnz_AP ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetCumNnzAP)( data, cum_nnz_AP ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetCycleNumSweeps( void *data, HYPRE_Int num_sweeps, HYPRE_Int k ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetCycleNumSweeps)( data, num_sweeps, k ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetCycleRelaxType( void *data, HYPRE_Int relax_type, HYPRE_Int k ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetCycleRelaxType)( data, relax_type, k ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetCycleType( void *data, HYPRE_Int cycle_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetCycleType)( data, cycle_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetDebugFlag( void *data, HYPRE_Int debug_flag ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetDebugFlag)( data, debug_flag ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetDofFunc( void *data, HYPRE_Int *dof_func ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetDofFunc)( data, dof_func ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetDofPoint( void *data, HYPRE_Int *dof_point ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetDofPoint)( data, dof_point ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetDomainType( void *data, HYPRE_Int domain_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetDomainType)( data, domain_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetDropTol( void *data, HYPRE_Real drop_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetDropTol)( data, drop_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetEuBJ( void *data, HYPRE_Int eu_bj ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetEuBJ)( data, eu_bj ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetEuLevel( void *data, HYPRE_Int eu_level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetEuLevel)( data, eu_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetEuSparseA( void *data, HYPRE_Real eu_sparse_A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetEuSparseA)( data, eu_sparse_A ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetEuclidFile( void *data, char *euclidfile ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetEuclidFile)( data, euclidfile ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetFCycle( void *data, HYPRE_Int fcycle ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetFCycle)( data, fcycle ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetFPoints( void *data, HYPRE_Int isolated, HYPRE_Int num_points, HYPRE_BigInt *indices ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetFPoints)( data, isolated, num_points, indices ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetFSAIAlgoType( void *data, HYPRE_Int fsai_algo_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetFSAIAlgoType)( data, fsai_algo_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetFSAIEigMaxIters( void *data, HYPRE_Int fsai_eig_max_iters ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetFSAIEigMaxIters)( data, fsai_eig_max_iters ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetFSAIKapTolerance( void *data, HYPRE_Real fsai_kap_tolerance ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetFSAIKapTolerance)( data, fsai_kap_tolerance ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetFSAILocalSolveType( void *data, HYPRE_Int local_solve_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetFSAILocalSolveType)( data, local_solve_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetFSAIMaxNnzRow( void *data, HYPRE_Int fsai_max_nnz_row ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetFSAIMaxNnzRow)( data, fsai_max_nnz_row ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetFSAIMaxStepSize( void *data, HYPRE_Int fsai_max_step_size ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetFSAIMaxStepSize)( data, fsai_max_step_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetFSAIMaxSteps( void *data, HYPRE_Int fsai_max_steps ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetFSAIMaxSteps)( data, fsai_max_steps ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetFSAINumLevels( void *data, HYPRE_Int fsai_num_levels ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetFSAINumLevels)( data, fsai_num_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetFSAIThreshold( void *data, HYPRE_Real fsai_threshold ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetFSAIThreshold)( data, fsai_threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetFilter( void *data, HYPRE_Real filter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetFilter)( data, filter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetFilterFunctions( void *data, HYPRE_Int filter_functions ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetFilterFunctions)( data, filter_functions ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetFilterThresholdR( void *data, HYPRE_Real filter_threshold ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetFilterThresholdR)( data, filter_threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetGMRESSwitchR( void *data, HYPRE_Int gmres_switch ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetGMRESSwitchR)( data, gmres_switch ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetGSMG( void *data, HYPRE_Int par ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetGSMG)( data, par ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetGridRelaxPoints( void *data, HYPRE_Int **grid_relax_points ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetGridRelaxPoints)( data, grid_relax_points ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetGridRelaxType( void *data, HYPRE_Int *grid_relax_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetGridRelaxType)( data, grid_relax_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetILUDroptol( void *data, HYPRE_Real ilu_droptol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetILUDroptol)( data, ilu_droptol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetILUIterSetupMaxIter( void *data, HYPRE_Int ilu_iter_setup_max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetILUIterSetupMaxIter)( data, ilu_iter_setup_max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetILUIterSetupOption( void *data, HYPRE_Int ilu_iter_setup_option ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetILUIterSetupOption)( data, ilu_iter_setup_option ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetILUIterSetupTolerance( void *data, HYPRE_Real ilu_iter_setup_tolerance ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetILUIterSetupTolerance)( data, ilu_iter_setup_tolerance ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetILUIterSetupType( void *data, HYPRE_Int ilu_iter_setup_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetILUIterSetupType)( data, ilu_iter_setup_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetILULevel( void *data, HYPRE_Int ilu_lfil ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetILULevel)( data, ilu_lfil ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetILULocalReordering( void *data, HYPRE_Int ilu_reordering_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetILULocalReordering)( data, ilu_reordering_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetILULowerJacobiIters( void *data, HYPRE_Int ilu_lower_jacobi_iters ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetILULowerJacobiIters)( data, ilu_lower_jacobi_iters ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetILUMaxIter( void *data, HYPRE_Int ilu_max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetILUMaxIter)( data, ilu_max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetILUMaxRowNnz( void *data, HYPRE_Int ilu_max_row_nnz ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetILUMaxRowNnz)( data, ilu_max_row_nnz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetILUTriSolve( void *data, HYPRE_Int ilu_tri_solve ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetILUTriSolve)( data, ilu_tri_solve ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetILUType( void *data, HYPRE_Int ilu_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetILUType)( data, ilu_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetILUUpperJacobiIters( void *data, HYPRE_Int ilu_upper_jacobi_iters ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetILUUpperJacobiIters)( data, ilu_upper_jacobi_iters ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetISType( void *data, HYPRE_Int IS_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetISType)( data, IS_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetInterpRefine( void *data, HYPRE_Int num_refine ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetInterpRefine)( data, num_refine ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetInterpType( void *data, HYPRE_Int interp_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetInterpType)( data, interp_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetInterpVecAbsQTrunc( void *data, HYPRE_Real q_trunc ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetInterpVecAbsQTrunc)( data, q_trunc ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetInterpVecFirstLevel( void *data, HYPRE_Int level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetInterpVecFirstLevel)( data, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetInterpVecQMax( void *data, HYPRE_Int q_max ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetInterpVecQMax)( data, q_max ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetInterpVecVariant( void *solver, HYPRE_Int var ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetInterpVecVariant)( solver, var ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetInterpVectors( void *solver, HYPRE_Int num_vectors, hypre_ParVector **interp_vectors ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetInterpVectors)( solver, num_vectors, interp_vectors ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetIsTriangular( void *data, HYPRE_Int is_triangular ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetIsTriangular)( data, is_triangular ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetJacobiTruncThreshold( void *data, HYPRE_Real jacobi_trunc_threshold ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetJacobiTruncThreshold)( data, jacobi_trunc_threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetKeepSameSign( void *data, HYPRE_Int keep_same_sign ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetKeepSameSign)( data, keep_same_sign ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetKeepTranspose( void *data, HYPRE_Int keepTranspose ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetKeepTranspose)( data, keepTranspose ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetLevel( void *data, HYPRE_Int level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetLevel)( data, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetLevelNonGalerkinTol( void *data, HYPRE_Real nongalerkin_tol, HYPRE_Int level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetLevelNonGalerkinTol)( data, nongalerkin_tol, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetLevelOuterWt( void *data, HYPRE_Real omega, HYPRE_Int level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetLevelOuterWt)( data, omega, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetLevelRelaxWt( void *data, HYPRE_Real relax_weight, HYPRE_Int level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetLevelRelaxWt)( data, relax_weight, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetLogging( void *data, HYPRE_Int logging ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetLogging)( data, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetMaxCoarseSize( void *data, HYPRE_Int max_coarse_size ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetMaxCoarseSize)( data, max_coarse_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetMaxIter( void *data, HYPRE_Int max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetMaxIter)( data, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetMaxLevels( void *data, HYPRE_Int max_levels ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetMaxLevels)( data, max_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetMaxNzPerRow( void *data, HYPRE_Int max_nz_per_row ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetMaxNzPerRow)( data, max_nz_per_row ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetMaxRowSum( void *data, HYPRE_Real max_row_sum ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetMaxRowSum)( data, max_row_sum ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetMeasureType( void *data, HYPRE_Int measure_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetMeasureType)( data, measure_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetMinCoarseSize( void *data, HYPRE_Int min_coarse_size ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetMinCoarseSize)( data, min_coarse_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetMinIter( void *data, HYPRE_Int min_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetMinIter)( data, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetModuleRAP2( void *data, HYPRE_Int mod_rap2 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetModuleRAP2)( data, mod_rap2 ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetMultAddPMaxElmts( void *data, HYPRE_Int add_P_max_elmts ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetMultAddPMaxElmts)( data, add_P_max_elmts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetMultAddTruncFactor( void *data, HYPRE_Real add_trunc_factor ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetMultAddTruncFactor)( data, add_trunc_factor ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetMultAdditive( void *data, HYPRE_Int mult_additive ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetMultAdditive)( data, mult_additive ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetNodal( void *data, HYPRE_Int nodal ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetNodal)( data, nodal ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetNodalDiag( void *data, HYPRE_Int nodal ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetNodalDiag)( data, nodal ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetNodalLevels( void *data, HYPRE_Int nodal_levels ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetNodalLevels)( data, nodal_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetNonGalerkTol( void *data, HYPRE_Int nongalerk_num_tol, HYPRE_Real *nongalerk_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetNonGalerkTol)( data, nongalerk_num_tol, nongalerk_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetNonGalerkinTol( void *data, HYPRE_Real nongalerkin_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetNonGalerkinTol)( data, nongalerkin_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetNumCRRelaxSteps( void *data, HYPRE_Int num_CR_relax_steps ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetNumCRRelaxSteps)( data, num_CR_relax_steps ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetNumFunctions( void *data, HYPRE_Int num_functions ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetNumFunctions)( data, num_functions ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetNumGridSweeps( void *data, HYPRE_Int *num_grid_sweeps ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetNumGridSweeps)( data, num_grid_sweeps ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetNumIterations( void *data, HYPRE_Int num_iterations ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetNumIterations)( data, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetNumPaths( void *data, HYPRE_Int num_paths ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetNumPaths)( data, num_paths ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetNumPoints( void *data, HYPRE_Int num_points ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetNumPoints)( data, num_points ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetNumSamples( void *data, HYPRE_Int par ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetNumSamples)( data, par ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetNumSweeps( void *data, HYPRE_Int num_sweeps ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetNumSweeps)( data, num_sweeps ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetOmega( void *data, HYPRE_Real *omega ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetOmega)( data, omega ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetOuterWt( void *data, HYPRE_Real omega ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetOuterWt)( data, omega ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetOverlap( void *data, HYPRE_Int overlap ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetOverlap)( data, overlap ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetPMaxElmts( void *data, HYPRE_Int P_max_elmts ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetPMaxElmts)( data, P_max_elmts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetPlotFileName( void *data, const char *plot_file_name ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetPlotFileName)( data, plot_file_name ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetPlotGrids( void *data, HYPRE_Int plotgrids ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetPlotGrids)( data, plotgrids ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetPointDofMap( void *data, HYPRE_Int *point_dof_map ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetPointDofMap)( data, point_dof_map ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetPostInterpType( void *data, HYPRE_Int post_interp_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetPostInterpType)( data, post_interp_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetPrintFileName( void *data, const char *print_file_name ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetPrintFileName)( data, print_file_name ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetPrintLevel( void *data, HYPRE_Int print_level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetPrintLevel)( data, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetRAP2( void *data, HYPRE_Int rap2 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetRAP2)( data, rap2 ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetRedundant( void *data, HYPRE_Int redundant ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetRedundant)( data, redundant ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetRelaxOrder( void *data, HYPRE_Int relax_order ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetRelaxOrder)( data, relax_order ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetRelaxType( void *data, HYPRE_Int relax_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetRelaxType)( data, relax_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetRelaxWeight( void *data, HYPRE_Real *relax_weight ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetRelaxWeight)( data, relax_weight ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetRelaxWt( void *data, HYPRE_Real relax_weight ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetRelaxWt)( data, relax_weight ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetRestriction( void *data, HYPRE_Int restr_par ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetRestriction)( data, restr_par ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetSabs( void *data, HYPRE_Int Sabs ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetSabs)( data, Sabs ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetSchwarzRlxWeight( void *data, HYPRE_Real schwarz_rlx_weight ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetSchwarzRlxWeight)( data, schwarz_rlx_weight ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetSchwarzUseNonSymm( void *data, HYPRE_Int use_nonsymm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetSchwarzUseNonSymm)( data, use_nonsymm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetSepWeight( void *data, HYPRE_Int sep_weight ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetSepWeight)( data, sep_weight ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetSeqThreshold( void *data, HYPRE_Int seq_threshold ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetSeqThreshold)( data, seq_threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetSetupType( void *data, HYPRE_Int setup_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetSetupType)( data, setup_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetSimple( void *data, HYPRE_Int simple ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetSimple)( data, simple ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetSmoothInterpVectors( void *solver, HYPRE_Int smooth_interp_vectors ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetSmoothInterpVectors)( solver, smooth_interp_vectors ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetSmoothNumLevels( void *data, HYPRE_Int smooth_num_levels ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetSmoothNumLevels)( data, smooth_num_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetSmoothNumSweeps( void *data, HYPRE_Int smooth_num_sweeps ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetSmoothNumSweeps)( data, smooth_num_sweeps ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetSmoothType( void *data, HYPRE_Int smooth_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetSmoothType)( data, smooth_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetStrongThreshold( void *data, HYPRE_Real strong_threshold ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetStrongThreshold)( data, strong_threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetStrongThresholdR( void *data, HYPRE_Real strong_threshold ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetStrongThresholdR)( data, strong_threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetSym( void *data, HYPRE_Int sym ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetSym)( data, sym ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetThreshold( void *data, HYPRE_Real thresh ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetThreshold)( data, thresh ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetTol( void *data, HYPRE_Real tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetTol)( data, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetTruncFactor( void *data, HYPRE_Real trunc_factor ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetTruncFactor)( data, trunc_factor ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetVariant( void *data, HYPRE_Int variant ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetVariant)( data, variant ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetup( void *amg_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetup)( amg_vdata, A, f, u ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSetupStats( void *amg_vdata, hypre_ParCSRMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSetupStats)( amg_vdata, A ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSmoothInterpVectors( hypre_ParCSRMatrix *A, HYPRE_Int num_smooth_vecs, hypre_ParVector **smooth_vecs, HYPRE_Int smooth_steps ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSmoothInterpVectors)( A, num_smooth_vecs, smooth_vecs, smooth_steps ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSolve( void *amg_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSolve)( amg_vdata, A, f, u ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGSolveT( void *amg_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGSolveT)( amg_vdata, A, f, u ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGTruncandBuild( hypre_ParCSRMatrix *P, HYPRE_Real trunc_factor, HYPRE_Int max_elmts ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGTruncandBuild)( P, trunc_factor, max_elmts ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_BoomerAMGTruncateInterp( hypre_ParCSRMatrix *P, HYPRE_Real eps, HYPRE_Real dlt, HYPRE_Int *CF_marker ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGTruncateInterp)( P, eps, dlt, CF_marker ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoomerAMGWriteSolverParams( void *data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMGWriteSolverParams)( data ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMG_GMExpandInterp)( A, P, num_smooth_vecs, smooth_vecs, nf, dof_func, coarse_dof_func, variant, level, abs_trunc, weights, q_max, CF_marker, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMG_LNExpandInterp)( A, P, num_cpts_global, nf, dof_func, coarse_dof_func, CF_marker, level, weights, num_smooth_vecs, smooth_vecs, abs_trunc, q_max, interp_vec_first_level ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoomerAMG_MyCreateS)( A, strength_threshold, max_row_sum, num_functions, dof_func, S_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixDropInplace( hypre_CSRMatrix *A, HYPRE_Real droptol, HYPRE_Int max_row_nnz ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixDropInplace)( A, droptol, max_row_nnz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixExtractDenseMat( hypre_CSRMatrix *A, hypre_Vector *A_sub, HYPRE_Int *S_Pattern, HYPRE_Int S_nnz, HYPRE_Int *marker ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixExtractDenseMat)( A, A_sub, S_Pattern, S_nnz, marker ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixExtractDenseRow( hypre_CSRMatrix *A, hypre_Vector *A_subrow, HYPRE_Int *marker, HYPRE_Int row_num ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixExtractDenseRow)( A, A_subrow, marker, row_num ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixNormFro( hypre_CSRMatrix *A, HYPRE_Real *norm_io ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixNormFro)( A, norm_io ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixResNormFro( hypre_CSRMatrix *A, HYPRE_Real *norm_io ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixResNormFro)( A, norm_io ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixTrace( hypre_CSRMatrix *A, HYPRE_Real *trace_io ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixTrace)( A, trace_io ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParCSRMatrix * +hypre_CreateC( hypre_ParCSRMatrix *A, HYPRE_Real w ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CreateC)( A, w ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CreateDinv( void *amg_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CreateDinv)( amg_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CreateLambda( void *amg_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CreateLambda)( amg_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAIApply( void *fsai_vdata, HYPRE_Complex alpha, hypre_ParVector *b, hypre_ParVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAIApply)( fsai_vdata, alpha, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAIComputeOmega( void *fsai_vdata, hypre_ParCSRMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAIComputeOmega)( fsai_vdata, A ); +} + +/*--------------------------------------------------------------------------*/ + +void* +hypre_FSAICreate( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAICreate)( ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAIDestroy( void *data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAIDestroy)( data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAIDumpLocalLSDense( void *fsai_vdata, const char *filename, hypre_ParCSRMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAIDumpLocalLSDense)( fsai_vdata, filename, A ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAIGetAlgoType( void *data, HYPRE_Int *algo_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAIGetAlgoType)( data, algo_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAIGetEigMaxIters( void *data, HYPRE_Int *eig_max_iters ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAIGetEigMaxIters)( data, eig_max_iters ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAIGetKapTolerance( void *data, HYPRE_Real *kap_tolerance ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAIGetKapTolerance)( data, kap_tolerance ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAIGetLocalSolveType( void *data, HYPRE_Int *local_solve_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAIGetLocalSolveType)( data, local_solve_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAIGetLogging( void *data, HYPRE_Int *logging ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAIGetLogging)( data, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAIGetMaxIterations( void *data, HYPRE_Int *max_iterations ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAIGetMaxIterations)( data, max_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAIGetMaxNnzRow( void *data, HYPRE_Int *max_nnz_row ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAIGetMaxNnzRow)( data, max_nnz_row ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAIGetMaxStepSize( void *data, HYPRE_Int *max_step_size ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAIGetMaxStepSize)( data, max_step_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAIGetMaxSteps( void *data, HYPRE_Int *max_steps ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAIGetMaxSteps)( data, max_steps ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAIGetNumIterations( void *data, HYPRE_Int *num_iterations ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAIGetNumIterations)( data, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAIGetNumLevels( void *data, HYPRE_Int *num_levels ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAIGetNumLevels)( data, num_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAIGetOmega( void *data, HYPRE_Real *omega ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAIGetOmega)( data, omega ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAIGetPrintLevel( void *data, HYPRE_Int *print_level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAIGetPrintLevel)( data, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAIGetThreshold( void *data, HYPRE_Real *threshold ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAIGetThreshold)( data, threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAIGetTolerance( void *data, HYPRE_Real *tolerance ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAIGetTolerance)( data, tolerance ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAIGetZeroGuess( void *data, HYPRE_Int *zero_guess ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAIGetZeroGuess)( data, zero_guess ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAIPrintStats( void *fsai_vdata, hypre_ParCSRMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAIPrintStats)( fsai_vdata, A ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAISetAlgoType( void *data, HYPRE_Int algo_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAISetAlgoType)( data, algo_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAISetEigMaxIters( void *data, HYPRE_Int eig_max_iters ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAISetEigMaxIters)( data, eig_max_iters ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAISetKapTolerance( void *data, HYPRE_Real kap_tolerance ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAISetKapTolerance)( data, kap_tolerance ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAISetLocalSolveType( void *data, HYPRE_Int local_solve_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAISetLocalSolveType)( data, local_solve_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAISetLogging( void *data, HYPRE_Int logging ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAISetLogging)( data, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAISetMaxIterations( void *data, HYPRE_Int max_iterations ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAISetMaxIterations)( data, max_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAISetMaxNnzRow( void *data, HYPRE_Int max_nnz_row ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAISetMaxNnzRow)( data, max_nnz_row ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAISetMaxStepSize( void *data, HYPRE_Int max_step_size ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAISetMaxStepSize)( data, max_step_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAISetMaxSteps( void *data, HYPRE_Int max_steps ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAISetMaxSteps)( data, max_steps ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAISetNumIterations( void *data, HYPRE_Int num_iterations ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAISetNumIterations)( data, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAISetNumLevels( void *data, HYPRE_Int num_levels ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAISetNumLevels)( data, num_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAISetOmega( void *data, HYPRE_Real omega ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAISetOmega)( data, omega ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAISetPrintLevel( void *data, HYPRE_Int print_level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAISetPrintLevel)( data, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAISetThreshold( void *data, HYPRE_Real threshold ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAISetThreshold)( data, threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAISetTolerance( void *data, HYPRE_Real tolerance ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAISetTolerance)( data, tolerance ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAISetZeroGuess( void *data, HYPRE_Int zero_guess ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAISetZeroGuess)( data, zero_guess ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAISetup( void *fsai_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAISetup)( fsai_vdata, A, f, u ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAISetupNative( void *fsai_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAISetupNative)( fsai_vdata, A, f, u ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAISetupOMPDyn( void *fsai_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAISetupOMPDyn)( fsai_vdata, A, f, u ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FSAISolve( void *fsai_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *b, hypre_ParVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FSAISolve)( fsai_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FindKapGrad)( A_diag, kaporin_gradient, kap_grad_nonzeros, G_temp, S_Pattern, S_nnz, max_row_size, row_num, kg_marker ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GaussElimSetup( hypre_ParAMGData *amg_data, HYPRE_Int level, HYPRE_Int solver_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GaussElimSetup)( amg_data, level, solver_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GaussElimSolve( hypre_ParAMGData *amg_data, HYPRE_Int level, HYPRE_Int solver_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GaussElimSolve)( amg_data, level, solver_type ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GenerateMultiPi)( A, S, P, c_pts_starts, pass_order, pass_marker, pass_marker_offd, num_points, color, num_functions, dof_func, dof_func_offd, Pi_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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GenerateMultipassPi)( A, S, c_pts_starts, pass_order, pass_marker, pass_marker_offd, num_points, color, row_sums, P_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GenerateScale( hypre_CSRMatrix *domain_structure, HYPRE_Int num_variables, HYPRE_Real relaxation_weight, HYPRE_Real **scale_pointer ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GenerateScale)( domain_structure, num_variables, relaxation_weight, scale_pointer ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GenerateSendMapAndCommPkg)( comm, num_sends, num_recvs, recv_procs, send_procs, recv_vec_starts, A ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GenerateSubComm( MPI_Comm comm, HYPRE_Int participate, MPI_Comm *new_comm_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GenerateSubComm)( comm, participate, new_comm_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GetCommPkgRTFromCommPkgA( hypre_ParCSRMatrix *RT, hypre_ParCSRMatrix *A, HYPRE_Int *fine_to_coarse, HYPRE_Int *tmp_map_offd ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GetCommPkgRTFromCommPkgA)( RT, A, fine_to_coarse, tmp_map_offd ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GrabSubArray( HYPRE_Int *indices, HYPRE_Int start, HYPRE_Int end, HYPRE_BigInt *array, HYPRE_BigInt *output ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GrabSubArray)( indices, start, end, array, output ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GraphAdd( Link *list, HYPRE_Int *head, HYPRE_Int *tail, HYPRE_Int index, HYPRE_Int istack ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GraphAdd)( list, head, tail, index, istack ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GraphRemove( Link *list, HYPRE_Int *head, HYPRE_Int *tail, HYPRE_Int index ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GraphRemove)( list, head, tail, index ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUBuildRASExternalMatrix( hypre_ParCSRMatrix *A, HYPRE_Int *rperm, HYPRE_Int **E_i, HYPRE_Int **E_j, HYPRE_Real **E_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUBuildRASExternalMatrix)( A, rperm, E_i, E_j, E_data ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUCSRMatrixInverseSelfPrecondMRGlobal)( matA, M, droptol, tol, eps_tol, max_row_nnz, max_iter, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_ILUCreate( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUCreate)( ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUDestroy( void *ilu_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUDestroy)( ilu_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUGetFinalRelativeResidualNorm( void *ilu_vdata, HYPRE_Real *res_norm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUGetFinalRelativeResidualNorm)( ilu_vdata, res_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUGetInteriorExteriorPerm( hypre_ParCSRMatrix *A, HYPRE_MemoryLocation memory_location, HYPRE_Int **perm, HYPRE_Int *nLU, HYPRE_Int reordering_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUGetInteriorExteriorPerm)( A, memory_location, perm, nLU, reordering_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUGetIterativeSetupHistory( void *ilu_vdata, HYPRE_Complex **iter_setup_history ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUGetIterativeSetupHistory)( ilu_vdata, iter_setup_history ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUGetLocalPerm( hypre_ParCSRMatrix *A, HYPRE_Int **perm_ptr, HYPRE_Int *nLU, HYPRE_Int reordering_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUGetLocalPerm)( A, perm_ptr, nLU, reordering_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUGetNumIterations( void *ilu_vdata, HYPRE_Int *num_iterations ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUGetNumIterations)( ilu_vdata, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUGetPermddPQ)( A, io_pperm, io_qperm, tol, nB, nI, reordering_type ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUGetPermddPQPre)( n, nLU, A_diag_i, A_diag_j, A_diag_data, tol, perm, rperm, pperm_pre, qperm_pre, nB ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILULocalRCM( hypre_CSRMatrix *A, HYPRE_Int start, HYPRE_Int end, HYPRE_Int **permp, HYPRE_Int **qpermp, HYPRE_Int sym ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILULocalRCM)( A, start, end, permp, qpermp, sym ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILULocalRCMBuildFinalPerm)( start, end, G_perm, perm, qperm, permp, qpermp ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILULocalRCMBuildLevel( hypre_CSRMatrix *A, HYPRE_Int root, HYPRE_Int *marker, HYPRE_Int *level_i, HYPRE_Int *level_j, HYPRE_Int *nlevp ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILULocalRCMBuildLevel)( A, root, marker, level_i, level_j, nlevp ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILULocalRCMFindPPNode( hypre_CSRMatrix *A, HYPRE_Int *rootp, HYPRE_Int *marker ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILULocalRCMFindPPNode)( A, rootp, marker ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILULocalRCMMindegree( HYPRE_Int n, HYPRE_Int *degree, HYPRE_Int *marker, HYPRE_Int *rootp ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILULocalRCMMindegree)( n, degree, marker, rootp ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILULocalRCMNumbering( hypre_CSRMatrix *A, HYPRE_Int root, HYPRE_Int *marker, HYPRE_Int *perm, HYPRE_Int *current_nump ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILULocalRCMNumbering)( A, root, marker, perm, current_nump ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILULocalRCMOrder( hypre_CSRMatrix *A, HYPRE_Int *perm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILULocalRCMOrder)( A, perm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILULocalRCMQsort( HYPRE_Int *perm, HYPRE_Int start, HYPRE_Int end, HYPRE_Int *degree ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILULocalRCMQsort)( perm, start, end, degree ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILULocalRCMReverse( HYPRE_Int *perm, HYPRE_Int start, HYPRE_Int end ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILULocalRCMReverse)( perm, start, end ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUMaxQSplitRabsI( HYPRE_Real *arrayR, HYPRE_Int *arrayI, HYPRE_Int left, HYPRE_Int bound, HYPRE_Int right ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUMaxQSplitRabsI)( arrayR, arrayI, left, bound, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUMaxRabs)( array_data, array_j, start, end, nLU, rperm, value, index, l1_norm, nnz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUMaxrHeapAddRabsI( HYPRE_Real *heap, HYPRE_Int *I1, HYPRE_Int len ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUMaxrHeapAddRabsI)( heap, I1, len ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUMaxrHeapRemoveRabsI( HYPRE_Real *heap, HYPRE_Int *I1, HYPRE_Int len ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUMaxrHeapRemoveRabsI)( heap, I1, len ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUMinHeapAddI( HYPRE_Int *heap, HYPRE_Int len ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUMinHeapAddI)( heap, len ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUMinHeapAddIIIi( HYPRE_Int *heap, HYPRE_Int *I1, HYPRE_Int *Ii1, HYPRE_Int len ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUMinHeapAddIIIi)( heap, I1, Ii1, len ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUMinHeapAddIRIi( HYPRE_Int *heap, HYPRE_Real *I1, HYPRE_Int *Ii1, HYPRE_Int len ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUMinHeapAddIRIi)( heap, I1, Ii1, len ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUMinHeapRemoveI( HYPRE_Int *heap, HYPRE_Int len ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUMinHeapRemoveI)( heap, len ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUMinHeapRemoveIIIi( HYPRE_Int *heap, HYPRE_Int *I1, HYPRE_Int *Ii1, HYPRE_Int len ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUMinHeapRemoveIIIi)( heap, I1, Ii1, len ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUMinHeapRemoveIRIi( HYPRE_Int *heap, HYPRE_Real *I1, HYPRE_Int *Ii1, HYPRE_Int len ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUMinHeapRemoveIRIi)( heap, I1, Ii1, len ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUParCSRInverseNSH)( A, M, droptol, mr_tol, nsh_tol, eps_tol, mr_max_row_nnz, nsh_max_row_nnz, mr_max_iter, nsh_max_iter, mr_col_version, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetDropThreshold( void *ilu_vdata, HYPRE_Real threshold ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetDropThreshold)( ilu_vdata, threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetDropThresholdArray( void *ilu_vdata, HYPRE_Real *threshold ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetDropThresholdArray)( ilu_vdata, threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetIterativeSetupMaxIter( void *ilu_vdata, HYPRE_Int iter_setup_max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetIterativeSetupMaxIter)( ilu_vdata, iter_setup_max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetIterativeSetupOption( void *ilu_vdata, HYPRE_Int iter_setup_option ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetIterativeSetupOption)( ilu_vdata, iter_setup_option ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetIterativeSetupTolerance( void *ilu_vdata, HYPRE_Real iter_setup_tolerance ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetIterativeSetupTolerance)( ilu_vdata, iter_setup_tolerance ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetIterativeSetupType( void *ilu_vdata, HYPRE_Int iter_setup_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetIterativeSetupType)( ilu_vdata, iter_setup_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetLevelOfFill( void *ilu_vdata, HYPRE_Int lfil ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetLevelOfFill)( ilu_vdata, lfil ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetLocalReordering( void *ilu_vdata, HYPRE_Int ordering_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetLocalReordering)( ilu_vdata, ordering_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetLogging( void *ilu_vdata, HYPRE_Int logging ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetLogging)( ilu_vdata, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetLowerJacobiIters( void *ilu_vdata, HYPRE_Int lower_jacobi_iters ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetLowerJacobiIters)( ilu_vdata, lower_jacobi_iters ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetMaxIter( void *ilu_vdata, HYPRE_Int max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetMaxIter)( ilu_vdata, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetMaxNnzPerRow( void *ilu_vdata, HYPRE_Int nzmax ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetMaxNnzPerRow)( ilu_vdata, nzmax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetPrintLevel( void *ilu_vdata, HYPRE_Int print_level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetPrintLevel)( ilu_vdata, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetSchurNSHDropThreshold( void *ilu_vdata, HYPRE_Real threshold ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetSchurNSHDropThreshold)( ilu_vdata, threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetSchurNSHDropThresholdArray( void *ilu_vdata, HYPRE_Real *threshold ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetSchurNSHDropThresholdArray)( ilu_vdata, threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetSchurPrecondILUDropThreshold( void *ilu_vdata, HYPRE_Real sp_ilu_droptol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetSchurPrecondILUDropThreshold)( ilu_vdata, sp_ilu_droptol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetSchurPrecondILUDropThresholdArray( void *ilu_vdata, HYPRE_Real *sp_ilu_droptol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetSchurPrecondILUDropThresholdArray)( ilu_vdata, sp_ilu_droptol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetSchurPrecondILULevelOfFill( void *ilu_vdata, HYPRE_Int sp_ilu_lfil ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetSchurPrecondILULevelOfFill)( ilu_vdata, sp_ilu_lfil ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetSchurPrecondILUMaxNnzPerRow( void *ilu_vdata, HYPRE_Int sp_ilu_max_row_nnz ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetSchurPrecondILUMaxNnzPerRow)( ilu_vdata, sp_ilu_max_row_nnz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetSchurPrecondILUType( void *ilu_vdata, HYPRE_Int sp_ilu_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetSchurPrecondILUType)( ilu_vdata, sp_ilu_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetSchurPrecondLowerJacobiIters( void *ilu_vdata, HYPRE_Int sp_lower_jacobi_iters ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetSchurPrecondLowerJacobiIters)( ilu_vdata, sp_lower_jacobi_iters ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetSchurPrecondMaxIter( void *ilu_vdata, HYPRE_Int sp_max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetSchurPrecondMaxIter)( ilu_vdata, sp_max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetSchurPrecondPrintLevel( void *ilu_vdata, HYPRE_Int sp_print_level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetSchurPrecondPrintLevel)( ilu_vdata, sp_print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetSchurPrecondTol( void *ilu_vdata, HYPRE_Int sp_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetSchurPrecondTol)( ilu_vdata, sp_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetSchurPrecondTriSolve( void *ilu_vdata, HYPRE_Int sp_tri_solve ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetSchurPrecondTriSolve)( ilu_vdata, sp_tri_solve ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetSchurPrecondUpperJacobiIters( void *ilu_vdata, HYPRE_Int sp_upper_jacobi_iters ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetSchurPrecondUpperJacobiIters)( ilu_vdata, sp_upper_jacobi_iters ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetSchurSolverAbsoluteTol( void *ilu_vdata, HYPRE_Real ss_absolute_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetSchurSolverAbsoluteTol)( ilu_vdata, ss_absolute_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetSchurSolverLogging( void *ilu_vdata, HYPRE_Int ss_logging ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetSchurSolverLogging)( ilu_vdata, ss_logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetSchurSolverMaxIter( void *ilu_vdata, HYPRE_Int ss_max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetSchurSolverMaxIter)( ilu_vdata, ss_max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetSchurSolverPrintLevel( void *ilu_vdata, HYPRE_Int ss_print_level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetSchurSolverPrintLevel)( ilu_vdata, ss_print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetSchurSolverRelChange( void *ilu_vdata, HYPRE_Int ss_rel_change ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetSchurSolverRelChange)( ilu_vdata, ss_rel_change ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetSchurSolverTol( void *ilu_vdata, HYPRE_Real ss_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetSchurSolverTol)( ilu_vdata, ss_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetTol( void *ilu_vdata, HYPRE_Real tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetTol)( ilu_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetTriSolve( void *ilu_vdata, HYPRE_Int tri_solve ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetTriSolve)( ilu_vdata, tri_solve ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetType( void *ilu_vdata, HYPRE_Int ilu_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetType)( ilu_vdata, ilu_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetUpperJacobiIters( void *ilu_vdata, HYPRE_Int upper_jacobi_iters ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetUpperJacobiIters)( ilu_vdata, upper_jacobi_iters ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetup( void *ilu_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetup)( ilu_vdata, A, f, u ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetupILU0)( A, perm, qperm, nLU, nI, Lptr, Dptr, Uptr, Sptr, u_end ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetupILU0RAS( hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int nLU, hypre_ParCSRMatrix **Lptr, HYPRE_Real **Dptr, hypre_ParCSRMatrix **Uptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetupILU0RAS)( A, perm, nLU, Lptr, Dptr, Uptr ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetupILUK)( A, lfil, permp, qpermp, nLU, nI, Lptr, Dptr, Uptr, Sptr, u_end ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetupILUKRAS)( A, lfil, perm, nLU, Lptr, Dptr, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(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_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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(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 ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetupILUT)( A, lfil, tol, permp, qpermp, nLU, nI, Lptr, Dptr, Uptr, Sptr, u_end ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetupILUTRAS)( A, lfil, tol, perm, nLU, Lptr, Dptr, Uptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetupLDUtoCusparse( hypre_ParCSRMatrix *L, HYPRE_Real *D, hypre_ParCSRMatrix *U, hypre_ParCSRMatrix **LDUp ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetupLDUtoCusparse)( L, D, U, LDUp ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetupMILU0)( A, permp, qpermp, nLU, nI, Lptr, Dptr, Uptr, Sptr, u_end, modified ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetupRAPILU0)( A, perm, n, nLU, Lptr, Dptr, Uptr, mLptr, mDptr, mUptr, u_end ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetupRAPILU0Device)( A, perm, n, nLU, Apermptr, matSptr, ALUptr, BLUptr, CLUptr, Eptr, Fptr, test_opt ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSetupRAPMILU0( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **ALUp, HYPRE_Int modified ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSetupRAPMILU0)( A, ALUp, modified ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSolve( void *ilu_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSolve)( ilu_vdata, A, f, u ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSolveLU)( A, f, u, perm, nLU, L, D, U, ftemp, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSolveLUIter)( A, f, u, perm, nLU, L, D, U, ftemp, utemp, lower_jacobi_iters, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSolveLURAS)( A, f, u, perm, L, D, U, ftemp, utemp, fext, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSolveRAPGMRESHost)( A, f, u, perm, nLU, L, D, U, mL, mD, mU, ftemp, utemp, xtemp, ytemp, schur_solver, schur_precond, rhs, x, u_end ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSolveSchurGMRES)( A, f, u, perm, qperm, nLU, L, D, U, S, ftemp, utemp, schur_solver, schur_precond, rhs, x, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSolveSchurNSH)( A, f, u, perm, nLU, L, D, U, S, ftemp, utemp, schur_solver, rhs, x, u_end ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUSortOffdColmap( hypre_ParCSRMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUSortOffdColmap)( A ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ILUWriteSolverParams( void *ilu_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ILUWriteSolverParams)( ilu_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IndepSetGreedy( HYPRE_Int *A_i, HYPRE_Int *A_j, HYPRE_Int n, HYPRE_Int *cf ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IndepSetGreedy)( A_i, A_j, n, cf ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IndepSetGreedyS( HYPRE_Int *A_i, HYPRE_Int *A_j, HYPRE_Int n, HYPRE_Int *cf ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IndepSetGreedyS)( A_i, A_j, n, cf ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IntersectTwoArrays)( x, x_data, x_length, y, y_length, z, output_x_data, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IntersectTwoBigArrays)( x, x_data, x_length, y, y_length, z, output_x_data, intersect_length ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +hypre_LINPACKcgpthy( HYPRE_Real *a, HYPRE_Real *b ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LINPACKcgpthy)( a, b ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_LINPACKcgtql1( HYPRE_Int *n, HYPRE_Real *d, HYPRE_Real *e, HYPRE_Int *ierr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LINPACKcgtql1)( n, d, e, ierr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRAddVectorP( hypre_IntArray *CF_marker, HYPRE_Int point_type, HYPRE_Real a, hypre_ParVector *fromVector, HYPRE_Real b, hypre_ParVector **toVector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRAddVectorP)( CF_marker, point_type, a, fromVector, b, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRAddVectorR)( CF_marker, point_type, a, fromVector, b, toVector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRApproximateInverse( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **A_inv ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRApproximateInverse)( A, A_inv ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRBlockColLumpedRestrict)( A, A_FF, A_CF, CF_marker, blk_dim, Wr_ptr, R_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRBlockRelaxSetup( hypre_ParCSRMatrix *A, HYPRE_Int blk_size, HYPRE_Real **diaginvptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRBlockRelaxSetup)( A, blk_size, diaginvptr ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRBlockRelaxSolve)( A, f, u, blk_size, n_block, left_size, method, diaginv, Vtemp ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRBlockRelaxSolveDevice( hypre_ParCSRMatrix *B, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, hypre_ParVector *Vtemp, HYPRE_Real relax_weight ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRBlockRelaxSolveDevice)( B, A, f, u, Vtemp, relax_weight ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRBuildAff( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, HYPRE_Int debug_flag, hypre_ParCSRMatrix **A_ff_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRBuildAff)( A, CF_marker, debug_flag, A_ff_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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRBuildBlockJacobiP)( A, A_FF, A_FC, Wp, blk_size, CF_marker, P_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRBuildBlockJacobiWp( hypre_ParCSRMatrix *A_FF, hypre_ParCSRMatrix *A_FC, HYPRE_Int blk_size, hypre_ParCSRMatrix **Wp_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRBuildBlockJacobiWp)( A_FF, A_FC, blk_size, Wp_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRBuildCoarseOperator)( mgr_data, A_FF, A_FC, A_CF, A_CC_ptr, Wp, Wr, level ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRBuildInterp)( A, A_FF, A_FC, S, CF_marker, num_cpts_global, trunc_factor, max_elmts, block_jacobi_bsize, method, num_sweeps_post, Wp_ptr, P_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRBuildInterpApproximateInverse( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, HYPRE_BigInt *num_cpts_global, hypre_ParCSRMatrix **P_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRBuildInterpApproximateInverse)( A, CF_marker, num_cpts_global, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRBuildP)( A, CF_marker, num_cpts_global, method, debug_flag, P_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRBuildPFromWp( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *Wp, HYPRE_Int *CF_marker, hypre_ParCSRMatrix **P_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRBuildPFromWp)( A, Wp, CF_marker, P_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRBuildPFromWpHost( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *Wp, HYPRE_Int *CF_marker, hypre_ParCSRMatrix **P_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRBuildPFromWpHost)( A, Wp, CF_marker, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRBuildPHost)( A, A_FF, A_FC, CF_marker, num_cpts_global, method, Wp_ptr, P_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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRBuildRFromWr)( C_map, F_map, global_num_rows_R, global_num_cols_R, row_starts_R, col_starts_R, Wr, R_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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRBuildRestrict)( A, A_FF, A_FC, A_CF, CF_marker, num_cpts_global, trunc_factor, max_elmts, strong_threshold, max_row_sum, blk_size, method, W_ptr, R_ptr, RT_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRCoarseParms)( comm, num_rows, CF_marker, row_starts_cpts, row_starts_fpts ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRCoarsen)( S, A, final_coarse_size, final_coarse_indexes, debug_flag, CF_marker, last_level ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRColLumpedRestrict)( A, A_FF, A_CF, CF_marker, Wr_ptr, R_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_MGRCreate( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRCreate)( ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_MGRCreateFrelaxVcycleData( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRCreateFrelaxVcycleData)( ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_MGRCreateGSElimData( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRCreateGSElimData)( ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRCycle( void *mgr_vdata, hypre_ParVector **F_array, hypre_ParVector **U_array ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRCycle)( mgr_vdata, F_array, U_array ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRDataPrint( void *mgr_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRDataPrint)( mgr_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRDestroy( void *mgr_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRDestroy)( mgr_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRDestroyFrelaxVcycleData( void *mgr_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRDestroyFrelaxVcycleData)( mgr_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRDestroyGSElimData( void *mgr_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRDestroyGSElimData)( mgr_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRFrelaxVcycle( void *mgr_vdata, hypre_ParVector *f, hypre_ParVector *u ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRFrelaxVcycle)( mgr_vdata, f, u ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRGetCoarseGridConvergenceFactor( void *mgr_data, HYPRE_Real *conv_factor ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRGetCoarseGridConvergenceFactor)( mgr_data, conv_factor ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRGetFinalRelativeResidualNorm( void *mgr_vdata, HYPRE_Real *res_norm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRGetFinalRelativeResidualNorm)( mgr_vdata, res_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRGetNumIterations( void *mgr_vdata, HYPRE_Int *num_iterations ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRGetNumIterations)( mgr_vdata, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRGetSubBlock)( A, row_cf_marker, col_cf_marker, debug_flag, A_ff_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetBlockJacobiBlockSize( void *mgr_vdata, HYPRE_Int blk_size ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetBlockJacobiBlockSize)( mgr_vdata, blk_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetBlockSize( void *mgr_vdata, HYPRE_Int bsize ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetBlockSize)( mgr_vdata, bsize ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetCoarseGridMethod( void *mgr_vdata, HYPRE_Int *cg_method ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetCoarseGridMethod)( mgr_vdata, cg_method ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetCoarseGridPrintLevel( void *mgr_vdata, HYPRE_Int print_level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetCoarseGridPrintLevel)( mgr_vdata, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetCpointsByBlock)( mgr_vdata, block_size, max_num_levels, block_num_coarse_points, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetCpointsByContiguousBlock)( mgr_vdata, block_size, max_num_levels, begin_idx_array, block_num_coarse_points, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetCpointsByPointMarkerArray)( mgr_vdata, block_size, max_num_levels, block_num_coarse_points, block_coarse_indexes, point_marker_array ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetFRelaxMethod( void *mgr_vdata, HYPRE_Int relax_method ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetFRelaxMethod)( mgr_vdata, relax_method ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetFSolverAtLevel( void *mgr_vdata, void *fsolver, HYPRE_Int level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetFSolverAtLevel)( mgr_vdata, fsolver, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetFrelaxPrintLevel( void *mgr_vdata, HYPRE_Int print_level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetFrelaxPrintLevel)( mgr_vdata, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetGlobalSmoothCycle( void *mgr_vdata, HYPRE_Int global_smooth_cycle ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetGlobalSmoothCycle)( mgr_vdata, global_smooth_cycle ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetGlobalSmoothType( void *mgr_vdata, HYPRE_Int iter_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetGlobalSmoothType)( mgr_vdata, iter_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetGlobalSmootherAtLevel( void *mgr_vdata, HYPRE_Solver smoother, HYPRE_Int level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetGlobalSmootherAtLevel)( mgr_vdata, smoother, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetInterpType( void *mgr_vdata, HYPRE_Int interpType ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetInterpType)( mgr_vdata, interpType ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetLevelFRelaxMethod( void *mgr_vdata, HYPRE_Int *relax_method ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetLevelFRelaxMethod)( mgr_vdata, relax_method ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetLevelFRelaxNumFunctions( void *mgr_vdata, HYPRE_Int *num_functions ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetLevelFRelaxNumFunctions)( mgr_vdata, num_functions ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetLevelFRelaxType( void *mgr_vdata, HYPRE_Int *relax_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetLevelFRelaxType)( mgr_vdata, relax_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetLevelInterpType( void *mgr_vdata, HYPRE_Int *interpType ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetLevelInterpType)( mgr_vdata, interpType ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetLevelNonGalerkinMaxElmts( void *mgr_vdata, HYPRE_Int *max_elmts ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetLevelNonGalerkinMaxElmts)( mgr_vdata, max_elmts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetLevelNumRelaxSweeps( void *mgr_vdata, HYPRE_Int *nsweeps ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetLevelNumRelaxSweeps)( mgr_vdata, nsweeps ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetLevelPMaxElmts( void *mgr_vdata, HYPRE_Int *P_max_elmts ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetLevelPMaxElmts)( mgr_vdata, P_max_elmts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetLevelRestrictType( void *mgr_vdata, HYPRE_Int *restrictType ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetLevelRestrictType)( mgr_vdata, restrictType ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetLevelSmoothIters( void *mgr_vdata, HYPRE_Int *level_smooth_iters ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetLevelSmoothIters)( mgr_vdata, level_smooth_iters ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetLevelSmoothType( void *mgr_vdata, HYPRE_Int *level_smooth_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetLevelSmoothType)( mgr_vdata, level_smooth_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetLogging( void *mgr_vdata, HYPRE_Int logging ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetLogging)( mgr_vdata, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetMaxCoarseLevels( void *mgr_vdata, HYPRE_Int maxlev ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetMaxCoarseLevels)( mgr_vdata, maxlev ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetMaxGlobalSmoothIters( void *mgr_vdata, HYPRE_Int max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetMaxGlobalSmoothIters)( mgr_vdata, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetMaxIter( void *mgr_vdata, HYPRE_Int max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetMaxIter)( mgr_vdata, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetNonCpointsToFpoints( void *mgr_vdata, HYPRE_Int nonCptToFptFlag ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetNonCpointsToFpoints)( mgr_vdata, nonCptToFptFlag ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetNonGalerkinMaxElmts( void *mgr_vdata, HYPRE_Int max_elmts ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetNonGalerkinMaxElmts)( mgr_vdata, max_elmts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetNumInterpSweeps( void *mgr_vdata, HYPRE_Int nsweeps ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetNumInterpSweeps)( mgr_vdata, nsweeps ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetNumRelaxSweeps( void *mgr_vdata, HYPRE_Int nsweeps ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetNumRelaxSweeps)( mgr_vdata, nsweeps ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetNumRestrictSweeps( void *mgr_vdata, HYPRE_Int nsweeps ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetNumRestrictSweeps)( mgr_vdata, nsweeps ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetPMaxElmts( void *mgr_vdata, HYPRE_Int P_max_elmts ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetPMaxElmts)( mgr_vdata, P_max_elmts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetPrintLevel( void *mgr_vdata, HYPRE_Int print_level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetPrintLevel)( mgr_vdata, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetRelaxType( void *mgr_vdata, HYPRE_Int relax_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetRelaxType)( mgr_vdata, relax_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetReservedCoarseNodes( void *mgr_vdata, HYPRE_Int reserved_coarse_size, HYPRE_BigInt *reserved_coarse_nodes ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetReservedCoarseNodes)( mgr_vdata, reserved_coarse_size, reserved_coarse_nodes ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetReservedCpointsLevelToKeep( void *mgr_vdata, HYPRE_Int level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetReservedCpointsLevelToKeep)( mgr_vdata, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetRestrictType( void *mgr_vdata, HYPRE_Int restrictType ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetRestrictType)( mgr_vdata, restrictType ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetTol( void *mgr_vdata, HYPRE_Real tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetTol)( mgr_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetTruncateCoarseGridThreshold( void *mgr_vdata, HYPRE_Real threshold ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetTruncateCoarseGridThreshold)( mgr_vdata, threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetup( void *mgr_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetup)( mgr_vdata, A, f, u ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetupFrelaxVcycleData( void *mgr_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetupFrelaxVcycleData)( mgr_vdata, A, f, u, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSetupStats( void *mgr_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSetupStats)( mgr_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRSolve( void *mgr_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRSolve)( mgr_vdata, A, f, u ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRTruncateAcfCPR( hypre_ParCSRMatrix *A_CF, hypre_ParCSRMatrix **A_CF_new_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRTruncateAcfCPR)( A_CF, A_CF_new_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MGRTruncateAcfCPRDevice( hypre_ParCSRMatrix *A_CF, hypre_ParCSRMatrix **A_CF_new_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MGRTruncateAcfCPRDevice)( A_CF, A_CF_new_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPSchwarzCFFWSolve)( par_A, rhs_vector, domain_structure, par_x, relax_wt, aux_vector, CF_marker, rlx_pt, pivots, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPSchwarzCFSolve)( par_A, rhs_vector, domain_structure, par_x, relax_wt, aux_vector, CF_marker, rlx_pt, pivots, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPSchwarzFWSolve)( par_A, rhs_vector, domain_structure, par_x, relax_wt, aux_vector, pivots, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPSchwarzSolve)( par_A, rhs_vector, domain_structure, par_x, relax_wt, aux_vector, pivots, use_nonsymm ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_NSHCreate( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NSHCreate)( ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NSHDestroy( void *data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NSHDestroy)( data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NSHSetColVersion( void *nsh_vdata, HYPRE_Int mr_col_version ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NSHSetColVersion)( nsh_vdata, mr_col_version ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NSHSetDropThreshold( void *nsh_vdata, HYPRE_Real droptol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NSHSetDropThreshold)( nsh_vdata, droptol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NSHSetDropThresholdArray( void *nsh_vdata, HYPRE_Real *droptol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NSHSetDropThresholdArray)( nsh_vdata, droptol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NSHSetGlobalSolver( void *nsh_vdata, HYPRE_Int global_solver ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NSHSetGlobalSolver)( nsh_vdata, global_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NSHSetLogging( void *nsh_vdata, HYPRE_Int logging ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NSHSetLogging)( nsh_vdata, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NSHSetMRMaxIter( void *nsh_vdata, HYPRE_Int mr_max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NSHSetMRMaxIter)( nsh_vdata, mr_max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NSHSetMRMaxRowNnz( void *nsh_vdata, HYPRE_Int mr_max_row_nnz ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NSHSetMRMaxRowNnz)( nsh_vdata, mr_max_row_nnz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NSHSetMRTol( void *nsh_vdata, HYPRE_Real mr_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NSHSetMRTol)( nsh_vdata, mr_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NSHSetMaxIter( void *nsh_vdata, HYPRE_Int max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NSHSetMaxIter)( nsh_vdata, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NSHSetNSHMaxIter( void *nsh_vdata, HYPRE_Int nsh_max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NSHSetNSHMaxIter)( nsh_vdata, nsh_max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NSHSetNSHMaxRowNnz( void *nsh_vdata, HYPRE_Int nsh_max_row_nnz ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NSHSetNSHMaxRowNnz)( nsh_vdata, nsh_max_row_nnz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NSHSetNSHTol( void *nsh_vdata, HYPRE_Real nsh_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NSHSetNSHTol)( nsh_vdata, nsh_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NSHSetPrintLevel( void *nsh_vdata, HYPRE_Int print_level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NSHSetPrintLevel)( nsh_vdata, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NSHSetTol( void *nsh_vdata, HYPRE_Real tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NSHSetTol)( nsh_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NSHSetup( void *nsh_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NSHSetup)( nsh_vdata, A, f, u ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NSHSolve( void *nsh_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NSHSolve)( nsh_vdata, A, f, u ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NSHSolveInverse( hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, hypre_ParCSRMatrix *M, hypre_ParVector *ftemp, hypre_ParVector *utemp ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NSHSolveInverse)( A, f, u, M, ftemp, utemp ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NSHWriteSolverParams( void *nsh_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NSHWriteSolverParams)( nsh_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NonGalerkinIJBigBufferInit( HYPRE_Int *ijbuf_cnt, HYPRE_Int *ijbuf_rowcounter, HYPRE_BigInt *ijbuf_numcols ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NonGalerkinIJBigBufferInit)( ijbuf_cnt, ijbuf_rowcounter, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NonGalerkinIJBufferCompress)( memory_location, ijbuf_size, ijbuf_cnt, ijbuf_rowcounter, ijbuf_data, ijbuf_cols, ijbuf_rownums, ijbuf_numcols ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NonGalerkinIJBufferCompressRow)( ijbuf_cnt, ijbuf_rowcounter, ijbuf_data, ijbuf_cols, ijbuf_rownums, ijbuf_numcols ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NonGalerkinIJBufferEmpty)( B, ijbuf_size, ijbuf_cnt, ijbuf_rowcounter, ijbuf_data, ijbuf_cols, ijbuf_rownums, ijbuf_numcols ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NonGalerkinIJBufferInit( HYPRE_Int *ijbuf_cnt, HYPRE_Int *ijbuf_rowcounter, HYPRE_Int *ijbuf_numcols ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NonGalerkinIJBufferInit)( ijbuf_cnt, ijbuf_rowcounter, ijbuf_numcols ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NonGalerkinIJBufferNewRow( HYPRE_BigInt *ijbuf_rownums, HYPRE_Int *ijbuf_numcols, HYPRE_Int *ijbuf_rowcounter, HYPRE_BigInt new_row ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NonGalerkinIJBufferNewRow)( ijbuf_rownums, ijbuf_numcols, ijbuf_rowcounter, new_row ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NonGalerkinIJBufferWrite)( B, ijbuf_cnt, ijbuf_size, ijbuf_rowcounter, ijbuf_data, ijbuf_cols, ijbuf_rownums, ijbuf_numcols, row_to_write, col_to_write, val_to_write ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NonGalerkinSparsityPattern)( R_IAP, RAP, CF_marker, droptol, sym_collapse, collapse_beta ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParAMGCreateDomainDof)( A, domain_type, overlap, num_functions, dof_func, domain_structure_pointer, piv_pointer, use_nonsymm ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParAdSchwarzSolve)( A, F, domain_structure, scale, X, Vtemp, pivots, use_nonsymm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRComputeL1Norms( hypre_ParCSRMatrix *A, HYPRE_Int option, HYPRE_Int *cf_marker, HYPRE_Real **l1_norm_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRComputeL1Norms)( A, option, cf_marker, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRComputeL1NormsThreads)( A, option, num_threads, cf_marker, l1_norm_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixBlockDiagMatrix)( A, blk_size, point_type, CF_marker, diag_type, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixBlockDiagMatrixHost)( A, blk_size, point_type, CF_marker, diag_type, B_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +hypre_ParCSRMatrixChooseThresh( hypre_ParCSRMatrix *S ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixChooseThresh)( S ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixExtractBlockDiagHost)( par_A, blk_size, num_points, point_type, CF_marker, diag_size, diag_type, diag_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixFillSmooth( HYPRE_Int nsamples, HYPRE_Real *samples, hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, HYPRE_Int num_functions, HYPRE_Int *dof_func ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixFillSmooth)( nsamples, samples, S, A, num_functions, dof_func ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixFixZeroRows( hypre_ParCSRMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixFixZeroRows)( A ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixNormFro( hypre_ParCSRMatrix *A, HYPRE_Real *norm_io ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixNormFro)( A, norm_io ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixResNormFro( hypre_ParCSRMatrix *A, HYPRE_Real *norm_io ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixResNormFro)( A, norm_io ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixScaledNorm( hypre_ParCSRMatrix *A, HYPRE_Real *scnorm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixScaledNorm)( A, scnorm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixSetDiagRows( hypre_ParCSRMatrix *A, HYPRE_Real d ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixSetDiagRows)( A, d ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixThreshold( hypre_ParCSRMatrix *A, HYPRE_Real thresh ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixThreshold)( A, thresh ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrix_dof_func_offd( hypre_ParCSRMatrix *A, HYPRE_Int num_functions, HYPRE_Int *dof_func, HYPRE_Int **dof_func_offd ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrix_dof_func_offd)( A, num_functions, dof_func, dof_func_offd ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMaxEigEstimate( hypre_ParCSRMatrix *A, HYPRE_Int scale, HYPRE_Real *max_eig, HYPRE_Real *min_eig ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMaxEigEstimate)( A, scale, max_eig, min_eig ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMaxEigEstimateCG( hypre_ParCSRMatrix *A, HYPRE_Int scale, HYPRE_Int max_iter, HYPRE_Real *max_eig, HYPRE_Real *min_eig ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMaxEigEstimateCG)( A, scale, max_iter, max_eig, min_eig ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMaxEigEstimateCGHost( hypre_ParCSRMatrix *A, HYPRE_Int scale, HYPRE_Int max_iter, HYPRE_Real *max_eig, HYPRE_Real *min_eig ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMaxEigEstimateCGHost)( A, scale, max_iter, max_eig, min_eig ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMaxEigEstimateHost( hypre_ParCSRMatrix *A, HYPRE_Int scale, HYPRE_Real *max_eig, HYPRE_Real *min_eig ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMaxEigEstimateHost)( A, scale, max_eig, min_eig ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRRelax)( A, f, relax_type, relax_times, l1_norms, relax_weight, omega, max_eig_est, min_eig_est, cheby_order, cheby_fraction, u, v, z ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRRelax_CG( HYPRE_Solver solver, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int num_its ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRRelax_CG)( solver, A, f, u, num_its ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRRelax_Cheby)( A, f, max_eig, min_eig, fraction, order, scale, variant, u, v, r ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRRelax_Cheby_Setup)( A, max_eig, min_eig, fraction, order, scale, variant, coefs_ptr, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRRelax_Cheby_Solve)( A, f, ds_data, coefs, order, scale, variant, u, v, r, orig_u_vec, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRRelax_Cheby_SolveHost)( A, f, ds_data, coefs, order, scale, variant, u, v, r, orig_u_vec, tmp_vec ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRRelax_L1_Jacobi)( A, f, cf_marker, relax_points, relax_weight, l1_norms, u, Vtemp ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRSubspacePrec)( A0, A0_relax_type, A0_relax_times, A0_l1_norms, A0_relax_weight, A0_omega, A0_max_eig_est, A0_min_eig_est, A0_cheby_order, A0_cheby_fraction, A, B, HB, P, r, g, x, y, r0, g0, cycle, z ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParGenerateHybridScale( hypre_ParCSRMatrix *A, hypre_CSRMatrix *domain_structure, hypre_CSRMatrix **A_boundary_pointer, HYPRE_Real **scale_pointer ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParGenerateHybridScale)( A, domain_structure, A_boundary_pointer, scale_pointer ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParGenerateScale( hypre_ParCSRMatrix *A, hypre_CSRMatrix *domain_structure, HYPRE_Real relaxation_weight, HYPRE_Real **scale_pointer ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParGenerateScale)( A, domain_structure, relaxation_weight, scale_pointer ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParILUExtractEBFC( hypre_CSRMatrix *A_diag, HYPRE_Int nLU, hypre_CSRMatrix **Bp, hypre_CSRMatrix **Cp, hypre_CSRMatrix **Ep, hypre_CSRMatrix **Fp ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParILUExtractEBFC)( A_diag, nLU, Bp, Cp, Ep, Fp ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParILURAPReorder( hypre_ParCSRMatrix *A, HYPRE_Int *perm, HYPRE_Int *rqperm, hypre_ParCSRMatrix **A_pq ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParILURAPReorder)( A, perm, rqperm, A_pq ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParILURAPSchurGMRESCommInfoHost( void *ilu_vdata, HYPRE_Int *my_id, HYPRE_Int *num_procs ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParILURAPSchurGMRESCommInfoHost)( ilu_vdata, my_id, num_procs ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParILURAPSchurGMRESMatvecHost( void *matvec_data, HYPRE_Complex alpha, void *ilu_vdata, void *x, HYPRE_Complex beta, void *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParILURAPSchurGMRESMatvecHost)( matvec_data, alpha, ilu_vdata, x, beta, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParILURAPSchurGMRESSolveHost( void *ilu_vdata, void *ilu_vdata2, hypre_ParVector *f, hypre_ParVector *u ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParILURAPSchurGMRESSolveHost)( ilu_vdata, ilu_vdata2, f, u ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParKrylovAxpy( HYPRE_Complex alpha, void *x, void *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParKrylovAxpy)( alpha, x, y ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_ParKrylovCAlloc( size_t count, size_t elt_size, HYPRE_MemoryLocation location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParKrylovCAlloc)( count, elt_size, location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParKrylovClearVector( void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParKrylovClearVector)( x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParKrylovCommInfo( void *A, HYPRE_Int *my_id, HYPRE_Int *num_procs ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParKrylovCommInfo)( A, my_id, num_procs ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParKrylovCopyVector( void *x, void *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParKrylovCopyVector)( x, y ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_ParKrylovCreateVector( void *vvector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParKrylovCreateVector)( vvector ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_ParKrylovCreateVectorArray( HYPRE_Int n, void *vvector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParKrylovCreateVectorArray)( n, vvector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParKrylovDestroyVector( void *vvector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParKrylovDestroyVector)( vvector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParKrylovFree( void *ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParKrylovFree)( ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParKrylovIdentity( void *vdata, void *A, void *b, void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParKrylovIdentity)( vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParKrylovIdentitySetup( void *vdata, void *A, void *b, void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParKrylovIdentitySetup)( vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +hypre_ParKrylovInnerProd( void *x, void *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParKrylovInnerProd)( x, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParKrylovInnerProdTagged( void *x, void *y, HYPRE_Int *num_tags_ptr, HYPRE_Complex **iprod_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParKrylovInnerProdTagged)( x, y, num_tags_ptr, iprod_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParKrylovMassAxpy( HYPRE_Complex *alpha, void **x, void *y, HYPRE_Int k, HYPRE_Int unroll ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParKrylovMassAxpy)( alpha, x, y, k, unroll ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParKrylovMassDotpTwo( void *x, void *y, void **z, HYPRE_Int k, HYPRE_Int unroll, void *result_x, void *result_y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParKrylovMassDotpTwo)( x, y, z, k, unroll, result_x, result_y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParKrylovMassInnerProd( void *x, void **y, HYPRE_Int k, HYPRE_Int unroll, void *result ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParKrylovMassInnerProd)( x, y, k, unroll, result ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParKrylovMatvec( void *matvec_data, HYPRE_Complex alpha, void *A, void *x, HYPRE_Complex beta, void *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParKrylovMatvec)( matvec_data, alpha, A, x, beta, y ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_ParKrylovMatvecCreate( void *A, void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParKrylovMatvecCreate)( A, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParKrylovMatvecDestroy( void *matvec_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParKrylovMatvecDestroy)( matvec_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParKrylovMatvecT( void *matvec_data, HYPRE_Complex alpha, void *A, void *x, HYPRE_Complex beta, void *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParKrylovMatvecT)( matvec_data, alpha, A, x, beta, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParKrylovScaleVector( HYPRE_Complex alpha, void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParKrylovScaleVector)( alpha, x ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParMPSchwarzSolve)( par_A, A_boundary, rhs_vector, domain_structure, par_x, relax_wt, scale, Vtemp, pivots, use_nonsymm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParPrintVector( void *v, const char *file ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParPrintVector)( v, file ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_ParReadVector( MPI_Comm comm, const char *file ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParReadVector)( comm, file ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParSetRandomValues( void *v, HYPRE_Int seed ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParSetRandomValues)( v, seed ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorBlockGather( hypre_ParVector *x, hypre_ParVector *x_ [3 ], HYPRE_Int dim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorBlockGather)( x, x_, dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorBlockSplit( hypre_ParVector *x, hypre_ParVector *x_ [3 ], HYPRE_Int dim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorBlockSplit)( x, x_, dim ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParVector * +hypre_ParVectorInDomainOf( hypre_ParCSRMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorInDomainOf)( A ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParVector * +hypre_ParVectorInRangeOf( hypre_ParCSRMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorInRangeOf)( A ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorSize( void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorSize)( x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SchwarzCFSolve( void *schwarz_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u, HYPRE_Int *CF_marker, HYPRE_Int rlx_pt ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SchwarzCFSolve)( schwarz_vdata, A, f, u, CF_marker, rlx_pt ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_SchwarzCreate( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SchwarzCreate)( ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SchwarzDestroy( void *data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SchwarzDestroy)( data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SchwarzReScale( void *data, HYPRE_Int size, HYPRE_Real value ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SchwarzReScale)( data, size, value ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SchwarzSetDofFunc( void *data, HYPRE_Int *dof_func ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SchwarzSetDofFunc)( data, dof_func ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SchwarzSetDomainStructure( void *data, hypre_CSRMatrix *domain_structure ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SchwarzSetDomainStructure)( data, domain_structure ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SchwarzSetDomainType( void *data, HYPRE_Int domain_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SchwarzSetDomainType)( data, domain_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SchwarzSetNonSymm( void *data, HYPRE_Int value ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SchwarzSetNonSymm)( data, value ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SchwarzSetNumFunctions( void *data, HYPRE_Int num_functions ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SchwarzSetNumFunctions)( data, num_functions ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SchwarzSetOverlap( void *data, HYPRE_Int overlap ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SchwarzSetOverlap)( data, overlap ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SchwarzSetRelaxWeight( void *data, HYPRE_Real relax_weight ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SchwarzSetRelaxWeight)( data, relax_weight ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SchwarzSetScale( void *data, HYPRE_Real *scale ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SchwarzSetScale)( data, scale ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SchwarzSetVariant( void *data, HYPRE_Int variant ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SchwarzSetVariant)( data, variant ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SchwarzSetup( void *schwarz_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SchwarzSetup)( schwarz_vdata, A, f, u ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SchwarzSolve( void *schwarz_vdata, hypre_ParCSRMatrix *A, hypre_ParVector *f, hypre_ParVector *u ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SchwarzSolve)( schwarz_vdata, A, f, u ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SortedCopyParCSRData( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SortedCopyParCSRData)( A, B ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_alt_insert_new_nodes)( comm_pkg, extend_comm_pkg, IN_marker, full_off_procNodes, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_big_insert_new_nodes)( comm_pkg, extend_comm_pkg, IN_marker, full_off_procNodes, offset, OUT_marker ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_block_jacobi_solve)( A, f, u, blk_size, method, diaginv, Vtemp ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_build_interp_colmap)( P, full_off_procNodes, tmp_CF_marker_offd, fine_to_coarse_offd ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_cr)( A_i, A_j, A_data, n, cf, rlx, omega, tg, mu ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(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, skip_fine_or_same_sign ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_exchange_marker( hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int *IN_marker, HYPRE_Int *OUT_marker ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_exchange_marker)( comm_pkg, IN_marker, OUT_marker ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_formu( HYPRE_Int *cf, HYPRE_Int n, HYPRE_Real *e1, HYPRE_Int *A_i, HYPRE_Real rho ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_formu)( cf, n, e1, A_i, rho ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_fptgscr)( cf, A_i, A_j, A_data, n, e0, e1 ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_fptjaccr)( cf, A_i, A_j, A_data, n, e0, omega, e1 ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_index_of_minimum( HYPRE_BigInt *data, HYPRE_Int n ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_index_of_minimum)( data, n ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_initialize_vecs)( diag_n, offd_n, diag_ftc, offd_ftc, diag_pm, offd_pm, tmp_CF ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_map)( ix, iy, iz, p, q, r, nx, ny, nx_part, ny_part, nz_part ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_map2)( ix, iy, p, q, nx, nx_part, ny_part ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_matinv( HYPRE_Real *x, HYPRE_Real *a, HYPRE_Int k ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_matinv)( x, a, k ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_merge_lists( HYPRE_Int *list1, HYPRE_Int *list2, hypre_int *np1, hypre_MPI_Datatype *dptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_merge_lists)( list1, list2, np1, dptr ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_move_entry)( weight, weight_max, previous, next, first, last, head, tail, i ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_parCorrRes( hypre_ParCSRMatrix *A, hypre_ParVector *x, hypre_Vector *rhs, hypre_Vector **tmp_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_parCorrRes)( A, x, rhs, tmp_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_qsort2_ci( HYPRE_Complex *v, HYPRE_Int *w, HYPRE_Int left, HYPRE_Int right ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_qsort2_ci)( v, w, left, right ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_remove_entry)( weight, weight_max, previous, next, first, last, head, tail, i ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_seqAMGCycle( hypre_ParAMGData *amg_data, HYPRE_Int p_level, hypre_ParVector **Par_F_array, hypre_ParVector **Par_U_array ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_seqAMGCycle)( amg_data, p_level, Par_F_array, Par_U_array ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_seqAMGSetup( hypre_ParAMGData *amg_data, HYPRE_Int p_level, HYPRE_Int coarse_threshold ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_seqAMGSetup)( amg_data, p_level, coarse_threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ssort( HYPRE_BigInt *data, HYPRE_Int n ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ssort)( data, n ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_swap2_ci( HYPRE_Complex *v, HYPRE_Int *w, HYPRE_Int i, HYPRE_Int j ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_swap2_ci)( v, w, i, j ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_swap_int( HYPRE_BigInt *data, HYPRE_Int a, HYPRE_Int b ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_swap_int)( data, a, b ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_update_entry)( weight, weight_max, previous, next, first, last, head, tail, i ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(matrix_matrix_product)( i_element_edge_pointer, j_element_edge_pointer, i_element_face, j_element_face, i_face_edge, j_face_edge, num_elements, num_faces, num_edges ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +rfun( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ) +{ + return HYPRE_CURRENTPRECISION_FUNC(rfun)( xx, yy, zz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +rfun_rs( HYPRE_Real xx, HYPRE_Real yy, HYPRE_Real zz ) +{ + return HYPRE_CURRENTPRECISION_FUNC(rfun_rs)( xx, yy, zz ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(transpose_matrix_create)( i_face_element_pointer, j_face_element_pointer, i_element_face, j_element_face, num_elements, num_faces ); +} + + +#endif + diff --git a/src/parcsr_ls/mup_functions.c b/src/parcsr_ls/mup_functions.c new file mode 100644 index 0000000000..2235efabd9 --- /dev/null +++ b/src/parcsr_ls/mup_functions.c @@ -0,0 +1,5662 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_parcsr_ls.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_ADSCreate( HYPRE_Solver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ADSCreate_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSDestroy( HYPRE_Solver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ADSDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *rel_resid_norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ADSGetFinalRelativeResidualNorm_pre( precision, solver, rel_resid_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ADSGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSSetAMGOptions( HYPRE_Solver solver, HYPRE_Int coarsen_type, HYPRE_Int agg_levels, HYPRE_Int relax_type, hypre_long_double strength_threshold, HYPRE_Int interp_type, HYPRE_Int Pmax ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ADSSetAMGOptions_pre( precision, solver, coarsen_type, agg_levels, relax_type, strength_threshold, interp_type, Pmax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSSetAMSOptions( HYPRE_Solver solver, HYPRE_Int cycle_type, HYPRE_Int coarsen_type, HYPRE_Int agg_levels, HYPRE_Int relax_type, hypre_long_double strength_threshold, HYPRE_Int interp_type, HYPRE_Int Pmax ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ADSSetAMSOptions_pre( precision, solver, cycle_type, coarsen_type, agg_levels, relax_type, strength_threshold, interp_type, Pmax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSSetChebySmoothingOptions( HYPRE_Solver solver, HYPRE_Int cheby_order, hypre_long_double cheby_fraction ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ADSSetChebySmoothingOptions_pre( precision, solver, cheby_order, cheby_fraction ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSSetCoordinateVectors( HYPRE_Solver solver, HYPRE_ParVector x, HYPRE_ParVector y, HYPRE_ParVector z ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ADSSetCoordinateVectors_pre( precision, solver, x, y, z ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSSetCycleType( HYPRE_Solver solver, HYPRE_Int cycle_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ADSSetCycleType_pre( precision, solver, cycle_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSSetDiscreteCurl( HYPRE_Solver solver, HYPRE_ParCSRMatrix C ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ADSSetDiscreteCurl_pre( precision, solver, C ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSSetDiscreteGradient( HYPRE_Solver solver, HYPRE_ParCSRMatrix G ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ADSSetDiscreteGradient_pre( precision, solver, G ); +} + +/*--------------------------------------------------------------------------*/ + +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_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ADSSetInterpolations_pre( precision, solver, RT_Pi, RT_Pix, RT_Piy, RT_Piz, ND_Pi, ND_Pix, ND_Piy, ND_Piz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSSetMaxIter( HYPRE_Solver solver, HYPRE_Int maxit ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ADSSetMaxIter_pre( precision, solver, maxit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ADSSetPrintLevel_pre( precision, solver, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSSetSmoothingOptions( HYPRE_Solver solver, HYPRE_Int relax_type, HYPRE_Int relax_times, hypre_long_double relax_weight, hypre_long_double omega ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ADSSetSmoothingOptions_pre( precision, solver, relax_type, relax_times, relax_weight, omega ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSSetTol( HYPRE_Solver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ADSSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ADSSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSSolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ADSSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMECreate( HYPRE_Solver *esolver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMECreate_pre( precision, esolver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMEDestroy( HYPRE_Solver esolver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMEDestroy_pre( precision, esolver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMEGetEigenvalues( HYPRE_Solver esolver, void *eigenvalues ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMEGetEigenvalues_pre( precision, esolver, eigenvalues ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMEGetEigenvectors( HYPRE_Solver esolver, HYPRE_ParVector **eigenvectors ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMEGetEigenvectors_pre( precision, esolver, eigenvectors ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMESetAMSSolver( HYPRE_Solver esolver, HYPRE_Solver ams_solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMESetAMSSolver_pre( precision, esolver, ams_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMESetBlockSize( HYPRE_Solver esolver, HYPRE_Int block_size ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMESetBlockSize_pre( precision, esolver, block_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMESetMassMatrix( HYPRE_Solver esolver, HYPRE_ParCSRMatrix M ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMESetMassMatrix_pre( precision, esolver, M ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMESetMaxIter( HYPRE_Solver esolver, HYPRE_Int maxit ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMESetMaxIter_pre( precision, esolver, maxit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMESetMaxPCGIter( HYPRE_Solver esolver, HYPRE_Int maxit ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMESetMaxPCGIter_pre( precision, esolver, maxit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMESetPrintLevel( HYPRE_Solver esolver, HYPRE_Int print_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMESetPrintLevel_pre( precision, esolver, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMESetRTol( HYPRE_Solver esolver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMESetRTol_pre( precision, esolver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMESetTol( HYPRE_Solver esolver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMESetTol_pre( precision, esolver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMESetup( HYPRE_Solver esolver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMESetup_pre( precision, esolver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMESolve( HYPRE_Solver esolver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMESolve_pre( precision, esolver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSConstructDiscreteGradient( HYPRE_ParCSRMatrix A, HYPRE_ParVector x_coord, HYPRE_BigInt *edge_vertex, HYPRE_Int edge_orientation, HYPRE_ParCSRMatrix *G ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMSConstructDiscreteGradient_pre( precision, A, x_coord, edge_vertex, edge_orientation, G ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSCreate( HYPRE_Solver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMSCreate_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSDestroy( HYPRE_Solver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMSDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *rel_resid_norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMSGetFinalRelativeResidualNorm_pre( precision, solver, rel_resid_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMSGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSProjectOutGradients( HYPRE_Solver solver, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMSProjectOutGradients_pre( precision, solver, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetAlphaAMGCoarseRelaxType( HYPRE_Solver solver, HYPRE_Int alpha_coarse_relax_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMSSetAlphaAMGCoarseRelaxType_pre( precision, solver, alpha_coarse_relax_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetAlphaAMGOptions( HYPRE_Solver solver, HYPRE_Int alpha_coarsen_type, HYPRE_Int alpha_agg_levels, HYPRE_Int alpha_relax_type, hypre_long_double alpha_strength_threshold, HYPRE_Int alpha_interp_type, HYPRE_Int alpha_Pmax ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMSSetAlphaAMGOptions_pre( precision, solver, alpha_coarsen_type, alpha_agg_levels, alpha_relax_type, alpha_strength_threshold, alpha_interp_type, alpha_Pmax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetAlphaPoissonMatrix( HYPRE_Solver solver, HYPRE_ParCSRMatrix A_alpha ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMSSetAlphaPoissonMatrix_pre( precision, solver, A_alpha ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetBetaAMGCoarseRelaxType( HYPRE_Solver solver, HYPRE_Int beta_coarse_relax_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMSSetBetaAMGCoarseRelaxType_pre( precision, solver, beta_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_long_double beta_strength_threshold, HYPRE_Int beta_interp_type, HYPRE_Int beta_Pmax ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMSSetBetaAMGOptions_pre( precision, solver, beta_coarsen_type, beta_agg_levels, beta_relax_type, beta_strength_threshold, beta_interp_type, beta_Pmax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetBetaPoissonMatrix( HYPRE_Solver solver, HYPRE_ParCSRMatrix A_beta ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMSSetBetaPoissonMatrix_pre( precision, solver, A_beta ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetCoordinateVectors( HYPRE_Solver solver, HYPRE_ParVector x, HYPRE_ParVector y, HYPRE_ParVector z ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMSSetCoordinateVectors_pre( precision, solver, x, y, z ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetCycleType( HYPRE_Solver solver, HYPRE_Int cycle_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMSSetCycleType_pre( precision, solver, cycle_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetDimension( HYPRE_Solver solver, HYPRE_Int dim ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMSSetDimension_pre( precision, solver, dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetDiscreteGradient( HYPRE_Solver solver, HYPRE_ParCSRMatrix G ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMSSetDiscreteGradient_pre( precision, solver, G ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetEdgeConstantVectors( HYPRE_Solver solver, HYPRE_ParVector Gx, HYPRE_ParVector Gy, HYPRE_ParVector Gz ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMSSetEdgeConstantVectors_pre( precision, solver, Gx, Gy, Gz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetInteriorNodes( HYPRE_Solver solver, HYPRE_ParVector interior_nodes ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMSSetInteriorNodes_pre( precision, solver, interior_nodes ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetInterpolations( HYPRE_Solver solver, HYPRE_ParCSRMatrix Pi, HYPRE_ParCSRMatrix Pix, HYPRE_ParCSRMatrix Piy, HYPRE_ParCSRMatrix Piz ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMSSetInterpolations_pre( precision, solver, Pi, Pix, Piy, Piz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetMaxIter( HYPRE_Solver solver, HYPRE_Int maxit ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMSSetMaxIter_pre( precision, solver, maxit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMSSetPrintLevel_pre( precision, solver, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetProjectionFrequency( HYPRE_Solver solver, HYPRE_Int projection_frequency ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMSSetProjectionFrequency_pre( precision, solver, projection_frequency ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetSmoothingOptions( HYPRE_Solver solver, HYPRE_Int relax_type, HYPRE_Int relax_times, hypre_long_double relax_weight, hypre_long_double omega ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMSSetSmoothingOptions_pre( precision, solver, relax_type, relax_times, relax_weight, omega ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetTol( HYPRE_Solver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMSSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMSSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AMSSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BlockTridiagCreate( HYPRE_Solver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BlockTridiagCreate_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BlockTridiagDestroy( HYPRE_Solver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BlockTridiagDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BlockTridiagSetAMGNumSweeps( HYPRE_Solver solver, HYPRE_Int num_sweeps ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BlockTridiagSetAMGNumSweeps_pre( precision, solver, num_sweeps ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BlockTridiagSetAMGRelaxType( HYPRE_Solver solver, HYPRE_Int relax_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BlockTridiagSetAMGRelaxType_pre( precision, solver, relax_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BlockTridiagSetAMGStrengthThreshold( HYPRE_Solver solver, hypre_long_double thresh ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BlockTridiagSetAMGStrengthThreshold_pre( precision, solver, thresh ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BlockTridiagSetIndexSet( HYPRE_Solver solver, HYPRE_Int n, HYPRE_Int *inds ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BlockTridiagSetIndexSet_pre( precision, solver, n, inds ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BlockTridiagSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BlockTridiagSetPrintLevel_pre( precision, solver, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BlockTridiagSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BlockTridiagSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BlockTridiagSolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BlockTridiagSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGCreate( HYPRE_Solver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGCreate_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDDCreate( HYPRE_Solver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGDDCreate_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDDDestroy( HYPRE_Solver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGDDDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDDGetAMG( HYPRE_Solver solver, HYPRE_Solver *amg_solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGDDGetAMG_pre( precision, solver, amg_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDDGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *rel_resid_norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGDDGetFinalRelativeResidualNorm_pre( precision, solver, rel_resid_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDDGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGDDGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDDSetFACCycleType( HYPRE_Solver solver, HYPRE_Int amgdd_fac_cycle_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGDDSetFACCycleType_pre( precision, solver, amgdd_fac_cycle_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDDSetFACNumCycles( HYPRE_Solver solver, HYPRE_Int amgdd_fac_num_cycles ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGDDSetFACNumCycles_pre( precision, solver, amgdd_fac_num_cycles ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDDSetFACNumRelax( HYPRE_Solver solver, HYPRE_Int amgdd_fac_num_relax ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGDDSetFACNumRelax_pre( precision, solver, amgdd_fac_num_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDDSetFACRelaxType( HYPRE_Solver solver, HYPRE_Int amgdd_fac_relax_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGDDSetFACRelaxType_pre( precision, solver, amgdd_fac_relax_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDDSetFACRelaxWeight( HYPRE_Solver solver, hypre_long_double amgdd_fac_relax_weight ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGDDSetFACRelaxWeight_pre( precision, solver, amgdd_fac_relax_weight ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDDSetNumGhostLayers( HYPRE_Solver solver, HYPRE_Int num_ghost_layers ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGDDSetNumGhostLayers_pre( precision, solver, num_ghost_layers ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDDSetPadding( HYPRE_Solver solver, HYPRE_Int padding ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGDDSetPadding_pre( precision, solver, padding ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDDSetStartLevel( HYPRE_Solver solver, HYPRE_Int start_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGDDSetStartLevel_pre( precision, solver, start_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDDSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGDDSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDDSolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGDDSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDestroy( HYPRE_Solver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetAdditive( HYPRE_Solver solver, HYPRE_Int *additive ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetAdditive_pre( precision, solver, additive ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetCoarsenCutFactor( HYPRE_Solver solver, HYPRE_Int *coarsen_cut_factor ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetCoarsenCutFactor_pre( precision, solver, coarsen_cut_factor ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetCoarsenType( HYPRE_Solver solver, HYPRE_Int *coarsen_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetCoarsenType_pre( precision, solver, coarsen_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetConvergeType( HYPRE_Solver solver, HYPRE_Int *type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetConvergeType_pre( precision, solver, type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetCumNnzAP( HYPRE_Solver solver, void *cum_nnz_AP ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetCumNnzAP_pre( precision, solver, cum_nnz_AP ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetCumNumIterations( HYPRE_Solver solver, HYPRE_Int *cum_num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetCumNumIterations_pre( precision, solver, cum_num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetCycleNumSweeps( HYPRE_Solver solver, HYPRE_Int *num_sweeps, HYPRE_Int k ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetCycleNumSweeps_pre( precision, solver, num_sweeps, k ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetCycleRelaxType( HYPRE_Solver solver, HYPRE_Int *relax_type, HYPRE_Int k ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetCycleRelaxType_pre( precision, solver, relax_type, k ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetCycleType( HYPRE_Solver solver, HYPRE_Int *cycle_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetCycleType_pre( precision, solver, cycle_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetDebugFlag( HYPRE_Solver solver, HYPRE_Int *debug_flag ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetDebugFlag_pre( precision, solver, debug_flag ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetDomainType( HYPRE_Solver solver, HYPRE_Int *domain_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetDomainType_pre( precision, solver, domain_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetFCycle( HYPRE_Solver solver, HYPRE_Int *fcycle ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetFCycle_pre( precision, solver, fcycle ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetFilterFunctions( HYPRE_Solver solver, HYPRE_Int *filter_functions ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetFilterFunctions_pre( precision, solver, filter_functions ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetFilterThresholdR( HYPRE_Solver solver, void *filter_threshold ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetFilterThresholdR_pre( precision, solver, filter_threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *rel_resid_norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetFinalRelativeResidualNorm_pre( precision, solver, rel_resid_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetGridHierarchy( HYPRE_Solver solver, HYPRE_Int *cgrid ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetGridHierarchy_pre( precision, solver, cgrid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetJacobiTruncThreshold( HYPRE_Solver solver, void *jacobi_trunc_threshold ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetJacobiTruncThreshold_pre( precision, solver, jacobi_trunc_threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetLogging( HYPRE_Solver solver, HYPRE_Int *logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetMaxCoarseSize( HYPRE_Solver solver, HYPRE_Int *max_coarse_size ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetMaxCoarseSize_pre( precision, solver, max_coarse_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetMaxIter( HYPRE_Solver solver, HYPRE_Int *max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetMaxLevels( HYPRE_Solver solver, HYPRE_Int *max_levels ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetMaxLevels_pre( precision, solver, max_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetMaxRowSum( HYPRE_Solver solver, void *max_row_sum ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetMaxRowSum_pre( precision, solver, max_row_sum ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetMeasureType( HYPRE_Solver solver, HYPRE_Int *measure_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetMeasureType_pre( precision, solver, measure_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetMinCoarseSize( HYPRE_Solver solver, HYPRE_Int *min_coarse_size ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetMinCoarseSize_pre( precision, solver, min_coarse_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetMultAdditive( HYPRE_Solver solver, HYPRE_Int *mult_additive ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetMultAdditive_pre( precision, solver, mult_additive ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetNumFunctions( HYPRE_Solver solver, HYPRE_Int *num_functions ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetNumFunctions_pre( precision, solver, num_functions ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetOverlap( HYPRE_Solver solver, HYPRE_Int *overlap ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetOverlap_pre( precision, solver, overlap ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetPMaxElmts( HYPRE_Solver solver, HYPRE_Int *P_max_elmts ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetPMaxElmts_pre( precision, solver, P_max_elmts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetPostInterpType( HYPRE_Solver solver, HYPRE_Int *post_interp_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetPostInterpType_pre( precision, solver, post_interp_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetPrintLevel( HYPRE_Solver solver, HYPRE_Int *print_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetPrintLevel_pre( precision, solver, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetRedundant( HYPRE_Solver solver, HYPRE_Int *redundant ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetRedundant_pre( precision, solver, redundant ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetResidual( HYPRE_Solver solver, HYPRE_ParVector *residual ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetResidual_pre( precision, solver, residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetSchwarzRlxWeight( HYPRE_Solver solver, void *schwarz_rlx_weight ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetSchwarzRlxWeight_pre( precision, solver, schwarz_rlx_weight ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetSeqThreshold( HYPRE_Solver solver, HYPRE_Int *seq_threshold ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetSeqThreshold_pre( precision, solver, seq_threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetSimple( HYPRE_Solver solver, HYPRE_Int *simple ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetSimple_pre( precision, solver, simple ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetSmoothNumLevels( HYPRE_Solver solver, HYPRE_Int *smooth_num_levels ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetSmoothNumLevels_pre( precision, solver, smooth_num_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetSmoothNumSweeps( HYPRE_Solver solver, HYPRE_Int *smooth_num_sweeps ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetSmoothNumSweeps_pre( precision, solver, smooth_num_sweeps ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetSmoothType( HYPRE_Solver solver, HYPRE_Int *smooth_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetSmoothType_pre( precision, solver, smooth_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetStrongThreshold( HYPRE_Solver solver, void *strong_threshold ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetStrongThreshold_pre( precision, solver, strong_threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetStrongThresholdR( HYPRE_Solver solver, void *strong_threshold ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetStrongThresholdR_pre( precision, solver, strong_threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetTol( HYPRE_Solver solver, void *tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetTruncFactor( HYPRE_Solver solver, void *trunc_factor ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetTruncFactor_pre( precision, solver, trunc_factor ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetVariant( HYPRE_Solver solver, HYPRE_Int *variant ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGGetVariant_pre( precision, solver, variant ); +} + +/*--------------------------------------------------------------------------*/ + +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, void *relax_weights_ptr, HYPRE_Int max_levels ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGInitGridRelaxation_pre( precision, num_grid_sweeps_ptr, grid_relax_type_ptr, grid_relax_points_ptr, coarsen_type, relax_weights_ptr, max_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetADropTol( HYPRE_Solver solver, hypre_long_double A_drop_tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetADropTol_pre( precision, solver, A_drop_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetADropType( HYPRE_Solver solver, HYPRE_Int A_drop_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetADropType_pre( precision, solver, A_drop_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetAddLastLvl( HYPRE_Solver solver, HYPRE_Int add_last_lvl ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetAddLastLvl_pre( precision, solver, add_last_lvl ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetAddPMaxElmts( HYPRE_Solver solver, HYPRE_Int add_P_max_elmts ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetAddPMaxElmts_pre( precision, solver, add_P_max_elmts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetAddRelaxType( HYPRE_Solver solver, HYPRE_Int add_rlx_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetAddRelaxType_pre( precision, solver, add_rlx_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetAddRelaxWt( HYPRE_Solver solver, hypre_long_double add_rlx_wt ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetAddRelaxWt_pre( precision, solver, add_rlx_wt ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetAddTruncFactor( HYPRE_Solver solver, hypre_long_double add_trunc_factor ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetAddTruncFactor_pre( precision, solver, add_trunc_factor ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetAdditive( HYPRE_Solver solver, HYPRE_Int addlvl ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetAdditive_pre( precision, solver, addlvl ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetAggInterpType( HYPRE_Solver solver, HYPRE_Int agg_interp_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetAggInterpType_pre( precision, solver, agg_interp_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetAggNumLevels( HYPRE_Solver solver, HYPRE_Int agg_num_levels ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetAggNumLevels_pre( precision, solver, agg_num_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetAggP12MaxElmts( HYPRE_Solver solver, HYPRE_Int agg_P12_max_elmts ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetAggP12MaxElmts_pre( precision, solver, agg_P12_max_elmts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetAggP12TruncFactor( HYPRE_Solver solver, hypre_long_double agg_P12_trunc_factor ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetAggP12TruncFactor_pre( precision, solver, agg_P12_trunc_factor ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetAggPMaxElmts( HYPRE_Solver solver, HYPRE_Int agg_P_max_elmts ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetAggPMaxElmts_pre( precision, solver, agg_P_max_elmts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetAggTruncFactor( HYPRE_Solver solver, hypre_long_double agg_trunc_factor ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetAggTruncFactor_pre( precision, solver, agg_trunc_factor ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetCGCIts( HYPRE_Solver solver, HYPRE_Int its ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetCGCIts_pre( precision, solver, its ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetCPoints( HYPRE_Solver solver, HYPRE_Int cpt_coarse_level, HYPRE_Int num_cpt_coarse, HYPRE_BigInt *cpt_coarse_index ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetCPoints_pre( precision, solver, cpt_coarse_level, num_cpt_coarse, cpt_coarse_index ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetCRRate( HYPRE_Solver solver, hypre_long_double CR_rate ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetCRRate_pre( precision, solver, CR_rate ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetCRStrongTh( HYPRE_Solver solver, hypre_long_double CR_strong_th ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetCRStrongTh_pre( precision, solver, CR_strong_th ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetCRUseCG( HYPRE_Solver solver, HYPRE_Int CR_use_CG ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetCRUseCG_pre( precision, solver, CR_use_CG ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetChebyEigEst( HYPRE_Solver solver, HYPRE_Int eig_est ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetChebyEigEst_pre( precision, solver, eig_est ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetChebyFraction( HYPRE_Solver solver, hypre_long_double ratio ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetChebyFraction_pre( precision, solver, ratio ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetChebyOrder( HYPRE_Solver solver, HYPRE_Int order ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetChebyOrder_pre( precision, solver, order ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetChebyScale( HYPRE_Solver solver, HYPRE_Int scale ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetChebyScale_pre( precision, solver, scale ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetChebyVariant( HYPRE_Solver solver, HYPRE_Int variant ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetChebyVariant_pre( precision, solver, variant ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetCoarsenCutFactor( HYPRE_Solver solver, HYPRE_Int coarsen_cut_factor ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetCoarsenCutFactor_pre( precision, solver, coarsen_cut_factor ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetCoarsenType( HYPRE_Solver solver, HYPRE_Int coarsen_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetCoarsenType_pre( precision, solver, coarsen_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetConvergeType( HYPRE_Solver solver, HYPRE_Int type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetConvergeType_pre( precision, solver, type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetCoordDim( HYPRE_Solver solver, HYPRE_Int coorddim ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetCoordDim_pre( precision, solver, coorddim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetCoordinates( HYPRE_Solver solver, float *coordinates ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetCoordinates_pre( precision, solver, coordinates ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetCpointsToKeep( HYPRE_Solver solver, HYPRE_Int cpt_coarse_level, HYPRE_Int num_cpt_coarse, HYPRE_BigInt *cpt_coarse_index ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetCpointsToKeep_pre( precision, solver, cpt_coarse_level, num_cpt_coarse, cpt_coarse_index ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetCumNnzAP( HYPRE_Solver solver, hypre_long_double cum_nnz_AP ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetCumNnzAP_pre( precision, solver, cum_nnz_AP ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetCycleNumSweeps( HYPRE_Solver solver, HYPRE_Int num_sweeps, HYPRE_Int k ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetCycleNumSweeps_pre( precision, solver, num_sweeps, k ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetCycleRelaxType( HYPRE_Solver solver, HYPRE_Int relax_type, HYPRE_Int k ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetCycleRelaxType_pre( precision, solver, relax_type, k ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetCycleType( HYPRE_Solver solver, HYPRE_Int cycle_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetCycleType_pre( precision, solver, cycle_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetDebugFlag( HYPRE_Solver solver, HYPRE_Int debug_flag ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetDebugFlag_pre( precision, solver, debug_flag ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetDofFunc( HYPRE_Solver solver, HYPRE_Int *dof_func ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetDofFunc_pre( precision, solver, dof_func ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetDomainType( HYPRE_Solver solver, HYPRE_Int domain_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetDomainType_pre( precision, solver, domain_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetDropTol( HYPRE_Solver solver, hypre_long_double drop_tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetDropTol_pre( precision, solver, drop_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetEuBJ( HYPRE_Solver solver, HYPRE_Int eu_bj ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetEuBJ_pre( precision, solver, eu_bj ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetEuLevel( HYPRE_Solver solver, HYPRE_Int eu_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetEuLevel_pre( precision, solver, eu_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetEuSparseA( HYPRE_Solver solver, hypre_long_double eu_sparse_A ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetEuSparseA_pre( precision, solver, eu_sparse_A ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetEuclidFile( HYPRE_Solver solver, char *euclidfile ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetEuclidFile_pre( precision, solver, euclidfile ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFCycle( HYPRE_Solver solver, HYPRE_Int fcycle ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetFCycle_pre( precision, solver, fcycle ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFPoints( HYPRE_Solver solver, HYPRE_Int num_fpt, HYPRE_BigInt *fpt_index ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetFPoints_pre( precision, solver, num_fpt, fpt_index ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIAlgoType( HYPRE_Solver solver, HYPRE_Int algo_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetFSAIAlgoType_pre( precision, solver, algo_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIEigMaxIters( HYPRE_Solver solver, HYPRE_Int eig_max_iters ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetFSAIEigMaxIters_pre( precision, solver, eig_max_iters ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIKapTolerance( HYPRE_Solver solver, hypre_long_double kap_tolerance ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetFSAIKapTolerance_pre( precision, solver, kap_tolerance ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFSAILocalSolveType( HYPRE_Solver solver, HYPRE_Int local_solve_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetFSAILocalSolveType_pre( precision, solver, local_solve_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIMaxNnzRow( HYPRE_Solver solver, HYPRE_Int max_nnz_row ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetFSAIMaxNnzRow_pre( precision, solver, max_nnz_row ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIMaxStepSize( HYPRE_Solver solver, HYPRE_Int max_step_size ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetFSAIMaxStepSize_pre( precision, solver, max_step_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIMaxSteps( HYPRE_Solver solver, HYPRE_Int max_steps ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetFSAIMaxSteps_pre( precision, solver, max_steps ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFSAINumLevels( HYPRE_Solver solver, HYPRE_Int num_levels ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetFSAINumLevels_pre( precision, solver, num_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIThreshold( HYPRE_Solver solver, hypre_long_double threshold ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetFSAIThreshold_pre( precision, solver, threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFilter( HYPRE_Solver solver, hypre_long_double filter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetFilter_pre( precision, solver, filter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFilterFunctions( HYPRE_Solver solver, HYPRE_Int filter_functions ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetFilterFunctions_pre( precision, solver, filter_functions ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFilterThresholdR( HYPRE_Solver solver, hypre_long_double filter_threshold ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetFilterThresholdR_pre( precision, solver, filter_threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetGMRESSwitchR( HYPRE_Solver solver, HYPRE_Int gmres_switch ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetGMRESSwitchR_pre( precision, solver, gmres_switch ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetGSMG( HYPRE_Solver solver, HYPRE_Int gsmg ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetGSMG_pre( precision, solver, gsmg ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetGridRelaxPoints( HYPRE_Solver solver, HYPRE_Int **grid_relax_points ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetGridRelaxPoints_pre( precision, solver, grid_relax_points ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetGridRelaxType( HYPRE_Solver solver, HYPRE_Int *grid_relax_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetGridRelaxType_pre( precision, solver, grid_relax_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILUDroptol( HYPRE_Solver solver, hypre_long_double ilu_droptol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetILUDroptol_pre( precision, solver, ilu_droptol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupMaxIter( HYPRE_Solver solver, HYPRE_Int ilu_iter_setup_max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetILUIterSetupMaxIter_pre( precision, solver, ilu_iter_setup_max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupOption( HYPRE_Solver solver, HYPRE_Int ilu_iter_setup_option ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetILUIterSetupOption_pre( precision, solver, ilu_iter_setup_option ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupTolerance( HYPRE_Solver solver, hypre_long_double ilu_iter_setup_tolerance ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetILUIterSetupTolerance_pre( precision, solver, ilu_iter_setup_tolerance ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupType( HYPRE_Solver solver, HYPRE_Int ilu_iter_setup_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetILUIterSetupType_pre( precision, solver, ilu_iter_setup_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILULevel( HYPRE_Solver solver, HYPRE_Int ilu_lfil ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetILULevel_pre( precision, solver, ilu_lfil ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILULocalReordering( HYPRE_Solver solver, HYPRE_Int ilu_reordering_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetILULocalReordering_pre( precision, solver, ilu_reordering_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILULowerJacobiIters( HYPRE_Solver solver, HYPRE_Int ilu_lower_jacobi_iters ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetILULowerJacobiIters_pre( precision, solver, ilu_lower_jacobi_iters ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILUMaxIter( HYPRE_Solver solver, HYPRE_Int ilu_max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetILUMaxIter_pre( precision, solver, ilu_max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILUMaxRowNnz( HYPRE_Solver solver, HYPRE_Int ilu_max_row_nnz ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetILUMaxRowNnz_pre( precision, solver, ilu_max_row_nnz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILUTriSolve( HYPRE_Solver solver, HYPRE_Int ilu_tri_solve ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetILUTriSolve_pre( precision, solver, ilu_tri_solve ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILUType( HYPRE_Solver solver, HYPRE_Int ilu_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetILUType_pre( precision, solver, ilu_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILUUpperJacobiIters( HYPRE_Solver solver, HYPRE_Int ilu_upper_jacobi_iters ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetILUUpperJacobiIters_pre( precision, solver, ilu_upper_jacobi_iters ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetISType( HYPRE_Solver solver, HYPRE_Int IS_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetISType_pre( precision, solver, IS_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetInterpRefine( HYPRE_Solver solver, HYPRE_Int num_refine ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetInterpRefine_pre( precision, solver, num_refine ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetInterpType( HYPRE_Solver solver, HYPRE_Int interp_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetInterpType_pre( precision, solver, interp_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetInterpVecAbsQTrunc( HYPRE_Solver solver, hypre_long_double q_trunc ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetInterpVecAbsQTrunc_pre( precision, solver, q_trunc ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetInterpVecQMax( HYPRE_Solver solver, HYPRE_Int q_max ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetInterpVecQMax_pre( precision, solver, q_max ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetInterpVecVariant( HYPRE_Solver solver, HYPRE_Int var ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetInterpVecVariant_pre( precision, solver, var ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetInterpVectors( HYPRE_Solver solver, HYPRE_Int num_vectors, HYPRE_ParVector *interp_vectors ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetInterpVectors_pre( precision, solver, num_vectors, interp_vectors ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetIsTriangular( HYPRE_Solver solver, HYPRE_Int is_triangular ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetIsTriangular_pre( precision, solver, is_triangular ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetIsolatedFPoints( HYPRE_Solver solver, HYPRE_Int num_isolated_fpt, HYPRE_BigInt *isolated_fpt_index ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetIsolatedFPoints_pre( precision, solver, num_isolated_fpt, isolated_fpt_index ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetJacobiTruncThreshold( HYPRE_Solver solver, hypre_long_double jacobi_trunc_threshold ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetJacobiTruncThreshold_pre( precision, solver, jacobi_trunc_threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetKeepSameSign( HYPRE_Solver solver, HYPRE_Int keep_same_sign ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetKeepSameSign_pre( precision, solver, keep_same_sign ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetKeepTranspose( HYPRE_Solver solver, HYPRE_Int keepTranspose ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetKeepTranspose_pre( precision, solver, keepTranspose ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetLevel( HYPRE_Solver solver, HYPRE_Int level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetLevel_pre( precision, solver, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetLevelNonGalerkinTol( HYPRE_Solver solver, hypre_long_double nongalerkin_tol, HYPRE_Int level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetLevelNonGalerkinTol_pre( precision, solver, nongalerkin_tol, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetLevelOuterWt( HYPRE_Solver solver, hypre_long_double omega, HYPRE_Int level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetLevelOuterWt_pre( precision, solver, omega, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetLevelRelaxWt( HYPRE_Solver solver, hypre_long_double relax_weight, HYPRE_Int level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetLevelRelaxWt_pre( precision, solver, relax_weight, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetLogging( HYPRE_Solver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetMaxCoarseSize( HYPRE_Solver solver, HYPRE_Int max_coarse_size ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetMaxCoarseSize_pre( precision, solver, max_coarse_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetMaxLevels( HYPRE_Solver solver, HYPRE_Int max_levels ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetMaxLevels_pre( precision, solver, max_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetMaxNzPerRow( HYPRE_Solver solver, HYPRE_Int max_nz_per_row ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetMaxNzPerRow_pre( precision, solver, max_nz_per_row ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetMaxRowSum( HYPRE_Solver solver, hypre_long_double max_row_sum ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetMaxRowSum_pre( precision, solver, max_row_sum ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetMeasureType( HYPRE_Solver solver, HYPRE_Int measure_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetMeasureType_pre( precision, solver, measure_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetMinCoarseSize( HYPRE_Solver solver, HYPRE_Int min_coarse_size ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetMinCoarseSize_pre( precision, solver, min_coarse_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetMinIter_pre( precision, solver, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetModuleRAP2( HYPRE_Solver solver, HYPRE_Int mod_rap2 ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetModuleRAP2_pre( precision, solver, mod_rap2 ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetMultAddPMaxElmts( HYPRE_Solver solver, HYPRE_Int add_P_max_elmts ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetMultAddPMaxElmts_pre( precision, solver, add_P_max_elmts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetMultAddTruncFactor( HYPRE_Solver solver, hypre_long_double add_trunc_factor ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetMultAddTruncFactor_pre( precision, solver, add_trunc_factor ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetMultAdditive( HYPRE_Solver solver, HYPRE_Int addlvl ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetMultAdditive_pre( precision, solver, addlvl ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetNodal( HYPRE_Solver solver, HYPRE_Int nodal ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetNodal_pre( precision, solver, nodal ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetNodalDiag( HYPRE_Solver solver, HYPRE_Int nodal_diag ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetNodalDiag_pre( precision, solver, nodal_diag ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetNodalLevels( HYPRE_Solver solver, HYPRE_Int nodal_levels ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetNodalLevels_pre( precision, solver, nodal_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetNonGalerkTol( HYPRE_Solver solver, HYPRE_Int nongalerk_num_tol, void *nongalerk_tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetNonGalerkTol_pre( precision, solver, nongalerk_num_tol, nongalerk_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetNonGalerkinTol( HYPRE_Solver solver, hypre_long_double nongalerkin_tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetNonGalerkinTol_pre( precision, solver, nongalerkin_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetNumCRRelaxSteps( HYPRE_Solver solver, HYPRE_Int num_CR_relax_steps ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetNumCRRelaxSteps_pre( precision, solver, num_CR_relax_steps ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetNumFunctions( HYPRE_Solver solver, HYPRE_Int num_functions ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetNumFunctions_pre( precision, solver, num_functions ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetNumGridSweeps( HYPRE_Solver solver, HYPRE_Int *num_grid_sweeps ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetNumGridSweeps_pre( precision, solver, num_grid_sweeps ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetNumPaths( HYPRE_Solver solver, HYPRE_Int num_paths ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetNumPaths_pre( precision, solver, num_paths ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetNumSamples( HYPRE_Solver solver, HYPRE_Int num_samples ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetNumSamples_pre( precision, solver, num_samples ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetNumSweeps( HYPRE_Solver solver, HYPRE_Int num_sweeps ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetNumSweeps_pre( precision, solver, num_sweeps ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetOldDefault( HYPRE_Solver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetOldDefault_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetOmega( HYPRE_Solver solver, void *omega ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetOmega_pre( precision, solver, omega ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetOuterWt( HYPRE_Solver solver, hypre_long_double omega ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetOuterWt_pre( precision, solver, omega ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetOverlap( HYPRE_Solver solver, HYPRE_Int overlap ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetOverlap_pre( precision, solver, overlap ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetPMaxElmts( HYPRE_Solver solver, HYPRE_Int P_max_elmts ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetPMaxElmts_pre( precision, solver, P_max_elmts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetPlotFileName( HYPRE_Solver solver, const char *plotfilename ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetPlotFileName_pre( precision, solver, plotfilename ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetPlotGrids( HYPRE_Solver solver, HYPRE_Int plotgrids ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetPlotGrids_pre( precision, solver, plotgrids ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetPostInterpType( HYPRE_Solver solver, HYPRE_Int post_interp_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetPostInterpType_pre( precision, solver, post_interp_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetPrintFileName( HYPRE_Solver solver, const char *print_file_name ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetPrintFileName_pre( precision, solver, print_file_name ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetPrintLevel_pre( precision, solver, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetRAP2( HYPRE_Solver solver, HYPRE_Int rap2 ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetRAP2_pre( precision, solver, rap2 ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetRedundant( HYPRE_Solver solver, HYPRE_Int redundant ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetRedundant_pre( precision, solver, redundant ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetRelaxOrder( HYPRE_Solver solver, HYPRE_Int relax_order ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetRelaxOrder_pre( precision, solver, relax_order ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetRelaxType( HYPRE_Solver solver, HYPRE_Int relax_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetRelaxType_pre( precision, solver, relax_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetRelaxWeight( HYPRE_Solver solver, void *relax_weight ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetRelaxWeight_pre( precision, solver, relax_weight ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetRelaxWt( HYPRE_Solver solver, hypre_long_double relax_weight ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetRelaxWt_pre( precision, solver, relax_weight ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetRestriction( HYPRE_Solver solver, HYPRE_Int restr_par ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetRestriction_pre( precision, solver, restr_par ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetSCommPkgSwitch( HYPRE_Solver solver, hypre_long_double S_commpkg_switch ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetSCommPkgSwitch_pre( precision, solver, S_commpkg_switch ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetSabs( HYPRE_Solver solver, HYPRE_Int Sabs ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetSabs_pre( precision, solver, Sabs ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetSchwarzRlxWeight( HYPRE_Solver solver, hypre_long_double schwarz_rlx_weight ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetSchwarzRlxWeight_pre( precision, solver, schwarz_rlx_weight ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetSchwarzUseNonSymm( HYPRE_Solver solver, HYPRE_Int use_nonsymm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetSchwarzUseNonSymm_pre( precision, solver, use_nonsymm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetSepWeight( HYPRE_Solver solver, HYPRE_Int sep_weight ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetSepWeight_pre( precision, solver, sep_weight ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetSeqThreshold( HYPRE_Solver solver, HYPRE_Int seq_threshold ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetSeqThreshold_pre( precision, solver, seq_threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetSetupType( HYPRE_Solver solver, HYPRE_Int setup_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetSetupType_pre( precision, solver, setup_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetSimple( HYPRE_Solver solver, HYPRE_Int addlvl ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetSimple_pre( precision, solver, addlvl ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetSmoothInterpVectors( HYPRE_Solver solver, HYPRE_Int smooth_interp_vectors ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetSmoothInterpVectors_pre( precision, solver, smooth_interp_vectors ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetSmoothNumLevels( HYPRE_Solver solver, HYPRE_Int smooth_num_levels ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetSmoothNumLevels_pre( precision, solver, smooth_num_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetSmoothNumSweeps( HYPRE_Solver solver, HYPRE_Int smooth_num_sweeps ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetSmoothNumSweeps_pre( precision, solver, smooth_num_sweeps ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetSmoothType( HYPRE_Solver solver, HYPRE_Int smooth_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetSmoothType_pre( precision, solver, smooth_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetStrongThreshold( HYPRE_Solver solver, hypre_long_double strong_threshold ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetStrongThreshold_pre( precision, solver, strong_threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetStrongThresholdR( HYPRE_Solver solver, hypre_long_double strong_threshold ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetStrongThresholdR_pre( precision, solver, strong_threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetSym( HYPRE_Solver solver, HYPRE_Int sym ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetSym_pre( precision, solver, sym ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetThreshold( HYPRE_Solver solver, hypre_long_double threshold ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetThreshold_pre( precision, solver, threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetTol( HYPRE_Solver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetTruncFactor( HYPRE_Solver solver, hypre_long_double trunc_factor ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetTruncFactor_pre( precision, solver, trunc_factor ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetVariant( HYPRE_Solver solver, HYPRE_Int variant ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetVariant_pre( precision, solver, variant ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSolveT( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_BoomerAMGSolveT_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_EuclidCreate( MPI_Comm comm, HYPRE_Solver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_EuclidCreate_pre( precision, comm, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_EuclidDestroy( HYPRE_Solver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_EuclidDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_EuclidSetBJ( HYPRE_Solver solver, HYPRE_Int bj ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_EuclidSetBJ_pre( precision, solver, bj ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_EuclidSetILUT( HYPRE_Solver solver, hypre_long_double drop_tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_EuclidSetILUT_pre( precision, solver, drop_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_EuclidSetLevel( HYPRE_Solver solver, HYPRE_Int level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_EuclidSetLevel_pre( precision, solver, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_EuclidSetMem( HYPRE_Solver solver, HYPRE_Int eu_mem ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_EuclidSetMem_pre( precision, solver, eu_mem ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_EuclidSetParams( HYPRE_Solver solver, HYPRE_Int argc, char *argv[] ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_EuclidSetParams_pre( precision, solver, argc, argv ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_EuclidSetParamsFromFile( HYPRE_Solver solver, char *filename ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_EuclidSetParamsFromFile_pre( precision, solver, filename ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_EuclidSetRowScale( HYPRE_Solver solver, HYPRE_Int row_scale ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_EuclidSetRowScale_pre( precision, solver, row_scale ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_EuclidSetSparseA( HYPRE_Solver solver, hypre_long_double sparse_A ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_EuclidSetSparseA_pre( precision, solver, sparse_A ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_EuclidSetStats( HYPRE_Solver solver, HYPRE_Int eu_stats ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_EuclidSetStats_pre( precision, solver, eu_stats ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_EuclidSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_EuclidSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_EuclidSolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_EuclidSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAICreate( HYPRE_Solver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FSAICreate_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAIDestroy( HYPRE_Solver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FSAIDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetAlgoType( HYPRE_Solver solver, HYPRE_Int algo_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FSAISetAlgoType_pre( precision, solver, algo_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetEigMaxIters( HYPRE_Solver solver, HYPRE_Int eig_max_iters ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FSAISetEigMaxIters_pre( precision, solver, eig_max_iters ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetKapTolerance( HYPRE_Solver solver, hypre_long_double kap_tolerance ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FSAISetKapTolerance_pre( precision, solver, kap_tolerance ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetLocalSolveType( HYPRE_Solver solver, HYPRE_Int local_solve_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FSAISetLocalSolveType_pre( precision, solver, local_solve_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetMaxIterations( HYPRE_Solver solver, HYPRE_Int max_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FSAISetMaxIterations_pre( precision, solver, max_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetMaxNnzRow( HYPRE_Solver solver, HYPRE_Int max_nnz_row ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FSAISetMaxNnzRow_pre( precision, solver, max_nnz_row ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetMaxStepSize( HYPRE_Solver solver, HYPRE_Int max_step_size ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FSAISetMaxStepSize_pre( precision, solver, max_step_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetMaxSteps( HYPRE_Solver solver, HYPRE_Int max_steps ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FSAISetMaxSteps_pre( precision, solver, max_steps ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetNumLevels( HYPRE_Solver solver, HYPRE_Int num_levels ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FSAISetNumLevels_pre( precision, solver, num_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetOmega( HYPRE_Solver solver, hypre_long_double omega ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FSAISetOmega_pre( precision, solver, omega ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FSAISetPrintLevel_pre( precision, solver, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetThreshold( HYPRE_Solver solver, hypre_long_double threshold ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FSAISetThreshold_pre( precision, solver, threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetTolerance( HYPRE_Solver solver, hypre_long_double tolerance ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FSAISetTolerance_pre( precision, solver, tolerance ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetZeroGuess( HYPRE_Solver solver, HYPRE_Int zero_guess ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FSAISetZeroGuess_pre( precision, solver, zero_guess ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FSAISetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_FSAISolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUCreate( HYPRE_Solver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ILUCreate_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUDestroy( HYPRE_Solver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ILUDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *res_norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ILUGetFinalRelativeResidualNorm_pre( precision, solver, res_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ILUGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetDropThreshold( HYPRE_Solver solver, hypre_long_double threshold ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ILUSetDropThreshold_pre( precision, solver, threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetDropThresholdArray( HYPRE_Solver solver, void *threshold ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ILUSetDropThresholdArray_pre( precision, solver, threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetIterativeSetupMaxIter( HYPRE_Solver solver, HYPRE_Int iter_setup_max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ILUSetIterativeSetupMaxIter_pre( precision, solver, iter_setup_max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetIterativeSetupOption( HYPRE_Solver solver, HYPRE_Int iter_setup_option ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ILUSetIterativeSetupOption_pre( precision, solver, iter_setup_option ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetIterativeSetupTolerance( HYPRE_Solver solver, hypre_long_double iter_setup_tolerance ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ILUSetIterativeSetupTolerance_pre( precision, solver, iter_setup_tolerance ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetIterativeSetupType( HYPRE_Solver solver, HYPRE_Int iter_setup_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ILUSetIterativeSetupType_pre( precision, solver, iter_setup_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetLevelOfFill( HYPRE_Solver solver, HYPRE_Int lfil ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ILUSetLevelOfFill_pre( precision, solver, lfil ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetLocalReordering( HYPRE_Solver solver, HYPRE_Int reordering_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ILUSetLocalReordering_pre( precision, solver, reordering_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetLogging( HYPRE_Solver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ILUSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetLowerJacobiIters( HYPRE_Solver solver, HYPRE_Int lower_jacobi_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ILUSetLowerJacobiIters_pre( precision, solver, lower_jacobi_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ILUSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetMaxNnzPerRow( HYPRE_Solver solver, HYPRE_Int nzmax ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ILUSetMaxNnzPerRow_pre( precision, solver, nzmax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetNSHDropThreshold( HYPRE_Solver solver, hypre_long_double threshold ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ILUSetNSHDropThreshold_pre( precision, solver, threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetNSHDropThresholdArray( HYPRE_Solver solver, void *threshold ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ILUSetNSHDropThresholdArray_pre( precision, solver, threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ILUSetPrintLevel_pre( precision, solver, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetSchurMaxIter( HYPRE_Solver solver, HYPRE_Int ss_max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ILUSetSchurMaxIter_pre( precision, solver, ss_max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetTol( HYPRE_Solver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ILUSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetTriSolve( HYPRE_Solver solver, HYPRE_Int tri_solve ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ILUSetTriSolve_pre( precision, solver, tri_solve ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetType( HYPRE_Solver solver, HYPRE_Int ilu_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ILUSetType_pre( precision, solver, ilu_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetUpperJacobiIters( HYPRE_Solver solver, HYPRE_Int upper_jacobi_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ILUSetUpperJacobiIters_pre( precision, solver, upper_jacobi_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ILUSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ILUSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRBuildAff( HYPRE_ParCSRMatrix A, HYPRE_Int *CF_marker, HYPRE_Int debug_flag, HYPRE_ParCSRMatrix *A_ff ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRBuildAff_pre( precision, A, CF_marker, debug_flag, A_ff ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRCreate( HYPRE_Solver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRCreate_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRDestroy( HYPRE_Solver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRGetCoarseGridConvergenceFactor( HYPRE_Solver solver, void *conv_factor ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRGetCoarseGridConvergenceFactor_pre( precision, solver, conv_factor ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *res_norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRGetFinalRelativeResidualNorm_pre( precision, solver, res_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetBlockJacobiBlockSize( HYPRE_Solver solver, HYPRE_Int blk_size ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetBlockJacobiBlockSize_pre( precision, solver, blk_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetBlockSize( HYPRE_Solver solver, HYPRE_Int bsize ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetBlockSize_pre( precision, solver, bsize ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetCoarseGridMethod( HYPRE_Solver solver, HYPRE_Int *cg_method ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetCoarseGridMethod_pre( precision, solver, cg_method ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetCoarseGridPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetCoarseGridPrintLevel_pre( precision, solver, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +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_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetCoarseSolver_pre( precision, solver, coarse_grid_solver_solve, coarse_grid_solver_setup, coarse_grid_solver ); +} + +/*--------------------------------------------------------------------------*/ + +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_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetCpointsByBlock_pre( precision, solver, block_size, max_num_levels, num_block_coarse_points, block_coarse_indexes ); +} + +/*--------------------------------------------------------------------------*/ + +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_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetCpointsByContiguousBlock_pre( precision, solver, block_size, max_num_levels, idx_array, num_block_coarse_points, block_coarse_indexes ); +} + +/*--------------------------------------------------------------------------*/ + +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_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetCpointsByPointMarkerArray_pre( precision, solver, block_size, max_num_levels, num_block_coarse_points, lvl_block_coarse_indexes, point_marker_array ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetFRelaxMethod( HYPRE_Solver solver, HYPRE_Int relax_method ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetFRelaxMethod_pre( precision, solver, relax_method ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetFSolver( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn fine_grid_solver_solve, HYPRE_PtrToParSolverFcn fine_grid_solver_setup, HYPRE_Solver fsolver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetFSolver_pre( precision, solver, fine_grid_solver_solve, fine_grid_solver_setup, fsolver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetFSolverAtLevel( HYPRE_Solver solver, HYPRE_Solver fsolver, HYPRE_Int level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetFSolverAtLevel_pre( precision, solver, fsolver, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetFrelaxPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetFrelaxPrintLevel_pre( precision, solver, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetGlobalSmoothCycle( HYPRE_Solver solver, HYPRE_Int global_smooth_cycle ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetGlobalSmoothCycle_pre( precision, solver, global_smooth_cycle ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetGlobalSmoothType( HYPRE_Solver solver, HYPRE_Int smooth_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetGlobalSmoothType_pre( precision, solver, smooth_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetGlobalSmootherAtLevel( HYPRE_Solver solver, HYPRE_Solver smoother, HYPRE_Int level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetGlobalSmootherAtLevel_pre( precision, solver, smoother, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetInterpType( HYPRE_Solver solver, HYPRE_Int interp_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetInterpType_pre( precision, solver, interp_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetLevelFRelaxMethod( HYPRE_Solver solver, HYPRE_Int *relax_method ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetLevelFRelaxMethod_pre( precision, solver, relax_method ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetLevelFRelaxNumFunctions( HYPRE_Solver solver, HYPRE_Int *num_functions ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetLevelFRelaxNumFunctions_pre( precision, solver, num_functions ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetLevelFRelaxType( HYPRE_Solver solver, HYPRE_Int *relax_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetLevelFRelaxType_pre( precision, solver, relax_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetLevelInterpType( HYPRE_Solver solver, HYPRE_Int *interp_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetLevelInterpType_pre( precision, solver, interp_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetLevelNonGalerkinMaxElmts( HYPRE_Solver solver, HYPRE_Int *max_elmts ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetLevelNonGalerkinMaxElmts_pre( precision, solver, max_elmts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetLevelNumRelaxSweeps( HYPRE_Solver solver, HYPRE_Int *nsweeps ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetLevelNumRelaxSweeps_pre( precision, solver, nsweeps ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetLevelPMaxElmts( HYPRE_Solver solver, HYPRE_Int *P_max_elmts ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetLevelPMaxElmts_pre( precision, solver, P_max_elmts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetLevelRestrictType( HYPRE_Solver solver, HYPRE_Int *restrict_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetLevelRestrictType_pre( precision, solver, restrict_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetLevelSmoothIters( HYPRE_Solver solver, HYPRE_Int *smooth_iters ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetLevelSmoothIters_pre( precision, solver, smooth_iters ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetLevelSmoothType( HYPRE_Solver solver, HYPRE_Int *smooth_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetLevelSmoothType_pre( precision, solver, smooth_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetLogging( HYPRE_Solver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetMaxCoarseLevels( HYPRE_Solver solver, HYPRE_Int maxlev ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetMaxCoarseLevels_pre( precision, solver, maxlev ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetMaxGlobalSmoothIters( HYPRE_Solver solver, HYPRE_Int smooth_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetMaxGlobalSmoothIters_pre( precision, solver, smooth_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetNonCpointsToFpoints( HYPRE_Solver solver, HYPRE_Int nonCptToFptFlag ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetNonCpointsToFpoints_pre( precision, solver, nonCptToFptFlag ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetNonGalerkinMaxElmts( HYPRE_Solver solver, HYPRE_Int max_elmts ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetNonGalerkinMaxElmts_pre( precision, solver, max_elmts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetNumInterpSweeps( HYPRE_Solver solver, HYPRE_Int nsweeps ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetNumInterpSweeps_pre( precision, solver, nsweeps ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetNumRelaxSweeps( HYPRE_Solver solver, HYPRE_Int nsweeps ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetNumRelaxSweeps_pre( precision, solver, nsweeps ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetNumRestrictSweeps( HYPRE_Solver solver, HYPRE_Int nsweeps ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetNumRestrictSweeps_pre( precision, solver, nsweeps ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetPMaxElmts( HYPRE_Solver solver, HYPRE_Int P_max_elmts ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetPMaxElmts_pre( precision, solver, P_max_elmts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetPrintLevel_pre( precision, solver, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetRelaxType( HYPRE_Solver solver, HYPRE_Int relax_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetRelaxType_pre( precision, solver, relax_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetReservedCoarseNodes( HYPRE_Solver solver, HYPRE_Int reserved_coarse_size, HYPRE_BigInt *reserved_coarse_nodes ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetReservedCoarseNodes_pre( precision, solver, reserved_coarse_size, reserved_coarse_nodes ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetReservedCpointsLevelToKeep( HYPRE_Solver solver, HYPRE_Int level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetReservedCpointsLevelToKeep_pre( precision, solver, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetRestrictType( HYPRE_Solver solver, HYPRE_Int restrict_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetRestrictType_pre( precision, solver, restrict_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetTol( HYPRE_Solver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetTruncateCoarseGridThreshold( HYPRE_Solver solver, hypre_long_double threshold ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetTruncateCoarseGridThreshold_pre( precision, solver, threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MGRSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABCreate( MPI_Comm comm, HYPRE_Solver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRBiCGSTABCreate_pre( precision, comm, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABDestroy( HYPRE_Solver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRBiCGSTABDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRBiCGSTABGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRBiCGSTABGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRBiCGSTABGetPrecond_pre( precision, solver, precond_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABGetResidual( HYPRE_Solver solver, HYPRE_ParVector *residual ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRBiCGSTABGetResidual_pre( precision, solver, residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetAbsoluteTol( HYPRE_Solver solver, hypre_long_double a_tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRBiCGSTABSetAbsoluteTol_pre( precision, solver, a_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetLogging( HYPRE_Solver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRBiCGSTABSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRBiCGSTABSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRBiCGSTABSetMinIter_pre( precision, solver, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetPrecond( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRBiCGSTABSetPrecond_pre( precision, solver, precond, precond_setup, precond_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRBiCGSTABSetPrintLevel_pre( precision, solver, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetStopCrit( HYPRE_Solver solver, HYPRE_Int stop_crit ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRBiCGSTABSetStopCrit_pre( precision, solver, stop_crit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetTol( HYPRE_Solver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRBiCGSTABSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRBiCGSTABSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRBiCGSTABSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCGNRCreate( MPI_Comm comm, HYPRE_Solver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRCGNRCreate_pre( precision, comm, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCGNRDestroy( HYPRE_Solver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRCGNRDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCGNRGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRCGNRGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCGNRGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRCGNRGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCGNRGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRCGNRGetPrecond_pre( precision, solver, precond_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCGNRSetLogging( HYPRE_Solver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRCGNRSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCGNRSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRCGNRSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCGNRSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRCGNRSetMinIter_pre( precision, solver, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCGNRSetPrecond( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precondT, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRCGNRSetPrecond_pre( precision, solver, precond, precondT, precond_setup, precond_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCGNRSetStopCrit( HYPRE_Solver solver, HYPRE_Int stop_crit ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRCGNRSetStopCrit_pre( precision, solver, stop_crit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCGNRSetTol( HYPRE_Solver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRCGNRSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCGNRSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRCGNRSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCGNRSolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRCGNRSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESCreate( MPI_Comm comm, HYPRE_Solver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRCOGMRESCreate_pre( precision, comm, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESDestroy( HYPRE_Solver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRCOGMRESDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRCOGMRESGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRCOGMRESGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRCOGMRESGetPrecond_pre( precision, solver, precond_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESGetResidual( HYPRE_Solver solver, HYPRE_ParVector *residual ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRCOGMRESGetResidual_pre( precision, solver, residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetAbsoluteTol( HYPRE_Solver solver, hypre_long_double a_tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRCOGMRESSetAbsoluteTol_pre( precision, solver, a_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetCGS( HYPRE_Solver solver, HYPRE_Int cgs ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRCOGMRESSetCGS_pre( precision, solver, cgs ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetKDim( HYPRE_Solver solver, HYPRE_Int k_dim ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRCOGMRESSetKDim_pre( precision, solver, k_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetLogging( HYPRE_Solver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRCOGMRESSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRCOGMRESSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRCOGMRESSetMinIter_pre( precision, solver, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetPrecond( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRCOGMRESSetPrecond_pre( precision, solver, precond, precond_setup, precond_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRCOGMRESSetPrintLevel_pre( precision, solver, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetTol( HYPRE_Solver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRCOGMRESSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetUnroll( HYPRE_Solver solver, HYPRE_Int unroll ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRCOGMRESSetUnroll_pre( precision, solver, unroll ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRCOGMRESSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESSolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRCOGMRESSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRDiagScale( HYPRE_Solver solver, HYPRE_ParCSRMatrix HA, HYPRE_ParVector Hy, HYPRE_ParVector Hx ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRDiagScale_pre( precision, solver, HA, Hy, Hx ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRDiagScaleSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector y, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRDiagScaleSetup_pre( precision, solver, A, y, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESCreate( MPI_Comm comm, HYPRE_Solver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRFlexGMRESCreate_pre( precision, comm, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESDestroy( HYPRE_Solver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRFlexGMRESDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRFlexGMRESGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRFlexGMRESGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRFlexGMRESGetPrecond_pre( precision, solver, precond_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESGetResidual( HYPRE_Solver solver, HYPRE_ParVector *residual ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRFlexGMRESGetResidual_pre( precision, solver, residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetAbsoluteTol( HYPRE_Solver solver, hypre_long_double a_tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRFlexGMRESSetAbsoluteTol_pre( precision, solver, a_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetKDim( HYPRE_Solver solver, HYPRE_Int k_dim ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRFlexGMRESSetKDim_pre( precision, solver, k_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetLogging( HYPRE_Solver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRFlexGMRESSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRFlexGMRESSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRFlexGMRESSetMinIter_pre( precision, solver, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetModifyPC( HYPRE_Solver solver, HYPRE_PtrToModifyPCFcn modify_pc ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRFlexGMRESSetModifyPC_pre( precision, solver, modify_pc ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetPrecond( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRFlexGMRESSetPrecond_pre( precision, solver, precond, precond_setup, precond_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRFlexGMRESSetPrintLevel_pre( precision, solver, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetTol( HYPRE_Solver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRFlexGMRESSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRFlexGMRESSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRFlexGMRESSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESCreate( MPI_Comm comm, HYPRE_Solver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRGMRESCreate_pre( precision, comm, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESDestroy( HYPRE_Solver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRGMRESDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRGMRESGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRGMRESGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRGMRESGetPrecond_pre( precision, solver, precond_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESGetRefSolution( HYPRE_Solver solver, HYPRE_ParVector *ref_solution ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRGMRESGetRefSolution_pre( precision, solver, ref_solution ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESGetResidual( HYPRE_Solver solver, HYPRE_ParVector *residual ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRGMRESGetResidual_pre( precision, solver, residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESSetAbsoluteTol( HYPRE_Solver solver, hypre_long_double a_tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRGMRESSetAbsoluteTol_pre( precision, solver, a_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESSetKDim( HYPRE_Solver solver, HYPRE_Int k_dim ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRGMRESSetKDim_pre( precision, solver, k_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESSetLogging( HYPRE_Solver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRGMRESSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRGMRESSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRGMRESSetMinIter_pre( precision, solver, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESSetPrecond( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRGMRESSetPrecond_pre( precision, solver, precond, precond_setup, precond_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRGMRESSetPrintLevel_pre( precision, solver, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESSetRefSolution( HYPRE_Solver solver, HYPRE_ParVector ref_solution ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRGMRESSetRefSolution_pre( precision, solver, ref_solution ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESSetStopCrit( HYPRE_Solver solver, HYPRE_Int stop_crit ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRGMRESSetStopCrit_pre( precision, solver, stop_crit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESSetTol( HYPRE_Solver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRGMRESSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRGMRESSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESSolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRGMRESSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridCreate( HYPRE_Solver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridCreate_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridDestroy( HYPRE_Solver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridGetDSCGNumIterations( HYPRE_Solver solver, HYPRE_Int *dscg_num_its ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridGetDSCGNumIterations_pre( precision, solver, dscg_num_its ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_its ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridGetNumIterations_pre( precision, solver, num_its ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridGetPCGNumIterations( HYPRE_Solver solver, HYPRE_Int *pcg_num_its ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridGetPCGNumIterations_pre( precision, solver, pcg_num_its ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridGetRecomputeResidual( HYPRE_Solver solver, HYPRE_Int *recompute_residual ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridGetRecomputeResidual_pre( precision, solver, recompute_residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridGetRecomputeResidualP( HYPRE_Solver solver, HYPRE_Int *recompute_residual_p ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridGetRecomputeResidualP_pre( precision, solver, recompute_residual_p ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridGetSetupSolveTime( HYPRE_Solver solver, void *time ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridGetSetupSolveTime_pre( precision, solver, time ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetAbsoluteTol( HYPRE_Solver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetAbsoluteTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetAggInterpType( HYPRE_Solver solver, HYPRE_Int agg_interp_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetAggInterpType_pre( precision, solver, agg_interp_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetAggNumLevels( HYPRE_Solver solver, HYPRE_Int agg_num_levels ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetAggNumLevels_pre( precision, solver, agg_num_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetCoarsenType( HYPRE_Solver solver, HYPRE_Int coarsen_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetCoarsenType_pre( precision, solver, coarsen_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetConvergenceTol( HYPRE_Solver solver, hypre_long_double cf_tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetConvergenceTol_pre( precision, solver, cf_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetCycleNumSweeps( HYPRE_Solver solver, HYPRE_Int num_sweeps, HYPRE_Int k ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetCycleNumSweeps_pre( precision, solver, num_sweeps, k ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetCycleRelaxType( HYPRE_Solver solver, HYPRE_Int relax_type, HYPRE_Int k ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetCycleRelaxType_pre( precision, solver, relax_type, k ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetCycleType( HYPRE_Solver solver, HYPRE_Int cycle_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetCycleType_pre( precision, solver, cycle_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetDSCGMaxIter( HYPRE_Solver solver, HYPRE_Int dscg_max_its ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetDSCGMaxIter_pre( precision, solver, dscg_max_its ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetDofFunc( HYPRE_Solver solver, HYPRE_Int *dof_func ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetDofFunc_pre( precision, solver, dof_func ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetGridRelaxPoints( HYPRE_Solver solver, HYPRE_Int **grid_relax_points ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetGridRelaxPoints_pre( precision, solver, grid_relax_points ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetGridRelaxType( HYPRE_Solver solver, HYPRE_Int *grid_relax_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetGridRelaxType_pre( precision, solver, grid_relax_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetInterpType( HYPRE_Solver solver, HYPRE_Int interp_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetInterpType_pre( precision, solver, interp_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetKDim( HYPRE_Solver solver, HYPRE_Int k_dim ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetKDim_pre( precision, solver, k_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetKeepTranspose( HYPRE_Solver solver, HYPRE_Int keepT ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetKeepTranspose_pre( precision, solver, keepT ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetLevelOuterWt( HYPRE_Solver solver, hypre_long_double outer_wt, HYPRE_Int level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetLevelOuterWt_pre( precision, solver, outer_wt, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetLevelRelaxWt( HYPRE_Solver solver, hypre_long_double relax_wt, HYPRE_Int level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetLevelRelaxWt_pre( precision, solver, relax_wt, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetLogging( HYPRE_Solver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetMaxCoarseSize( HYPRE_Solver solver, HYPRE_Int max_coarse_size ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetMaxCoarseSize_pre( precision, solver, max_coarse_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetMaxLevels( HYPRE_Solver solver, HYPRE_Int max_levels ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetMaxLevels_pre( precision, solver, max_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetMaxRowSum( HYPRE_Solver solver, hypre_long_double max_row_sum ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetMaxRowSum_pre( precision, solver, max_row_sum ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetMeasureType( HYPRE_Solver solver, HYPRE_Int measure_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetMeasureType_pre( precision, solver, measure_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetMinCoarseSize( HYPRE_Solver solver, HYPRE_Int min_coarse_size ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetMinCoarseSize_pre( precision, solver, min_coarse_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetNodal( HYPRE_Solver solver, HYPRE_Int nodal ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetNodal_pre( precision, solver, nodal ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetNonGalerkinTol( HYPRE_Solver solver, HYPRE_Int num_levels, void *nongalerkin_tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetNonGalerkinTol_pre( precision, solver, num_levels, nongalerkin_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetNumFunctions( HYPRE_Solver solver, HYPRE_Int num_functions ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetNumFunctions_pre( precision, solver, num_functions ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetNumGridSweeps( HYPRE_Solver solver, HYPRE_Int *num_grid_sweeps ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetNumGridSweeps_pre( precision, solver, num_grid_sweeps ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetNumPaths( HYPRE_Solver solver, HYPRE_Int num_paths ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetNumPaths_pre( precision, solver, num_paths ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetNumSweeps( HYPRE_Solver solver, HYPRE_Int num_sweeps ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetNumSweeps_pre( precision, solver, num_sweeps ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetOmega( HYPRE_Solver solver, void *omega ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetOmega_pre( precision, solver, omega ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetOuterWt( HYPRE_Solver solver, hypre_long_double outer_wt ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetOuterWt_pre( precision, solver, outer_wt ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetPCGMaxIter( HYPRE_Solver solver, HYPRE_Int pcg_max_its ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetPCGMaxIter_pre( precision, solver, pcg_max_its ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetPMaxElmts( HYPRE_Solver solver, HYPRE_Int P_max_elmts ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetPMaxElmts_pre( precision, solver, P_max_elmts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetPrecond( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetPrecond_pre( precision, solver, precond, precond_setup, precond_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetPrintLevel_pre( precision, solver, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetRecomputeResidual( HYPRE_Solver solver, HYPRE_Int recompute_residual ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetRecomputeResidual_pre( precision, solver, recompute_residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetRecomputeResidualP( HYPRE_Solver solver, HYPRE_Int recompute_residual_p ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetRecomputeResidualP_pre( precision, solver, recompute_residual_p ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetRelChange( HYPRE_Solver solver, HYPRE_Int rel_change ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetRelChange_pre( precision, solver, rel_change ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetRelaxOrder( HYPRE_Solver solver, HYPRE_Int relax_order ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetRelaxOrder_pre( precision, solver, relax_order ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetRelaxType( HYPRE_Solver solver, HYPRE_Int relax_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetRelaxType_pre( precision, solver, relax_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetRelaxWeight( HYPRE_Solver solver, void *relax_weight ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetRelaxWeight_pre( precision, solver, relax_weight ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetRelaxWt( HYPRE_Solver solver, hypre_long_double relax_wt ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetRelaxWt_pre( precision, solver, relax_wt ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetSeqThreshold( HYPRE_Solver solver, HYPRE_Int seq_threshold ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetSeqThreshold_pre( precision, solver, seq_threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetSetupType( HYPRE_Solver solver, HYPRE_Int setup_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetSetupType_pre( precision, solver, setup_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetSolverType( HYPRE_Solver solver, HYPRE_Int solver_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetSolverType_pre( precision, solver, solver_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetStopCrit( HYPRE_Solver solver, HYPRE_Int stop_crit ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetStopCrit_pre( precision, solver, stop_crit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetStrongThreshold( HYPRE_Solver solver, hypre_long_double strong_threshold ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetStrongThreshold_pre( precision, solver, strong_threshold ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetTol( HYPRE_Solver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetTruncFactor( HYPRE_Solver solver, hypre_long_double trunc_factor ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetTruncFactor_pre( precision, solver, trunc_factor ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetTwoNorm( HYPRE_Solver solver, HYPRE_Int two_norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetTwoNorm_pre( precision, solver, two_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRHybridSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESCreate( MPI_Comm comm, HYPRE_Solver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRLGMRESCreate_pre( precision, comm, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESDestroy( HYPRE_Solver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRLGMRESDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRLGMRESGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRLGMRESGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRLGMRESGetPrecond_pre( precision, solver, precond_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESGetResidual( HYPRE_Solver solver, HYPRE_ParVector *residual ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRLGMRESGetResidual_pre( precision, solver, residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESSetAbsoluteTol( HYPRE_Solver solver, hypre_long_double a_tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRLGMRESSetAbsoluteTol_pre( precision, solver, a_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESSetAugDim( HYPRE_Solver solver, HYPRE_Int aug_dim ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRLGMRESSetAugDim_pre( precision, solver, aug_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESSetKDim( HYPRE_Solver solver, HYPRE_Int k_dim ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRLGMRESSetKDim_pre( precision, solver, k_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESSetLogging( HYPRE_Solver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRLGMRESSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRLGMRESSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESSetMinIter( HYPRE_Solver solver, HYPRE_Int min_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRLGMRESSetMinIter_pre( precision, solver, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESSetPrecond( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRLGMRESSetPrecond_pre( precision, solver, precond, precond_setup, precond_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRLGMRESSetPrintLevel_pre( precision, solver, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESSetTol( HYPRE_Solver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRLGMRESSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRLGMRESSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESSolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRLGMRESSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMultiVectorPrint( void *x_, const char *fileName ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRMultiVectorPrint_pre( precision, x_, fileName ); +} + +/*--------------------------------------------------------------------------*/ + +void * +HYPRE_ParCSRMultiVectorRead( MPI_Comm comm, void *ii_, const char *fileName ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRMultiVectorRead_pre( precision, comm, ii_, fileName ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSROnProcTriSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix HA, HYPRE_ParVector Hy, HYPRE_ParVector Hx ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSROnProcTriSetup_pre( precision, solver, HA, Hy, Hx ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSROnProcTriSolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix HA, HYPRE_ParVector Hy, HYPRE_ParVector Hx ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSROnProcTriSolve_pre( precision, solver, HA, Hy, Hx ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGCreate( MPI_Comm comm, HYPRE_Solver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRPCGCreate_pre( precision, comm, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGDestroy( HYPRE_Solver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRPCGDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGGetFinalRelativeResidualNorm( HYPRE_Solver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRPCGGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGGetNumIterations( HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRPCGGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGGetPrecond( HYPRE_Solver solver, HYPRE_Solver *precond_data ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRPCGGetPrecond_pre( precision, solver, precond_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGGetResidual( HYPRE_Solver solver, HYPRE_ParVector *residual ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRPCGGetResidual_pre( precision, solver, residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGSetAbsoluteTol( HYPRE_Solver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRPCGSetAbsoluteTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGSetLogging( HYPRE_Solver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRPCGSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRPCGSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGSetPrecond( HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRPCGSetPrecond_pre( precision, solver, precond, precond_setup, precond_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGSetPreconditioner( HYPRE_Solver solver, HYPRE_Solver precond ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRPCGSetPreconditioner_pre( precision, solver, precond ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGSetPrintLevel( HYPRE_Solver solver, HYPRE_Int print_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRPCGSetPrintLevel_pre( precision, solver, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGSetRelChange( HYPRE_Solver solver, HYPRE_Int rel_change ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRPCGSetRelChange_pre( precision, solver, rel_change ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGSetStopCrit( HYPRE_Solver solver, HYPRE_Int stop_crit ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRPCGSetStopCrit_pre( precision, solver, stop_crit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGSetTol( HYPRE_Solver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRPCGSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGSetTwoNorm( HYPRE_Solver solver, HYPRE_Int two_norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRPCGSetTwoNorm_pre( precision, solver, two_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRPCGSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGSolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRPCGSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRParaSailsCreate( MPI_Comm comm, HYPRE_Solver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRParaSailsCreate_pre( precision, comm, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRParaSailsDestroy( HYPRE_Solver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRParaSailsDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRParaSailsSetFilter( HYPRE_Solver solver, hypre_long_double filter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRParaSailsSetFilter_pre( precision, solver, filter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRParaSailsSetLoadbal( HYPRE_Solver solver, hypre_long_double loadbal ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRParaSailsSetLoadbal_pre( precision, solver, loadbal ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRParaSailsSetLogging( HYPRE_Solver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRParaSailsSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRParaSailsSetParams( HYPRE_Solver solver, hypre_long_double thresh, HYPRE_Int nlevels ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRParaSailsSetParams_pre( precision, solver, thresh, nlevels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRParaSailsSetReuse( HYPRE_Solver solver, HYPRE_Int reuse ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRParaSailsSetReuse_pre( precision, solver, reuse ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRParaSailsSetSym( HYPRE_Solver solver, HYPRE_Int sym ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRParaSailsSetSym_pre( precision, solver, sym ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRParaSailsSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRParaSailsSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRParaSailsSolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRParaSailsSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPilutCreate( MPI_Comm comm, HYPRE_Solver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRPilutCreate_pre( precision, comm, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPilutDestroy( HYPRE_Solver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRPilutDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPilutSetDropTolerance( HYPRE_Solver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRPilutSetDropTolerance_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPilutSetFactorRowSize( HYPRE_Solver solver, HYPRE_Int size ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRPilutSetFactorRowSize_pre( precision, solver, size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPilutSetLogging( HYPRE_Solver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRPilutSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPilutSetMaxIter( HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRPilutSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPilutSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRPilutSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPilutSolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRPilutSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRSetupInterpreter( mv_InterfaceInterpreter *i ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRSetupInterpreter_pre( precision, i ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRSetupMatvec( HYPRE_MatvecFunctions *mv ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRSetupMatvec_pre( precision, mv ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsBuildIJMatrix( HYPRE_Solver solver, HYPRE_IJMatrix *pij_A ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParaSailsBuildIJMatrix_pre( precision, solver, pij_A ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsCreate( MPI_Comm comm, HYPRE_Solver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParaSailsCreate_pre( precision, comm, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsDestroy( HYPRE_Solver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParaSailsDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsGetFilter( HYPRE_Solver solver, void *filter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParaSailsGetFilter_pre( precision, solver, filter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsGetLoadbal( HYPRE_Solver solver, void *loadbal ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParaSailsGetLoadbal_pre( precision, solver, loadbal ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsGetLogging( HYPRE_Solver solver, HYPRE_Int *logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParaSailsGetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsGetNlevels( HYPRE_Solver solver, HYPRE_Int *nlevels ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParaSailsGetNlevels_pre( precision, solver, nlevels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsGetReuse( HYPRE_Solver solver, HYPRE_Int *reuse ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParaSailsGetReuse_pre( precision, solver, reuse ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsGetSym( HYPRE_Solver solver, HYPRE_Int *sym ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParaSailsGetSym_pre( precision, solver, sym ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsGetThresh( HYPRE_Solver solver, void *thresh ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParaSailsGetThresh_pre( precision, solver, thresh ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsSetFilter( HYPRE_Solver solver, hypre_long_double filter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParaSailsSetFilter_pre( precision, solver, filter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsSetLoadbal( HYPRE_Solver solver, hypre_long_double loadbal ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParaSailsSetLoadbal_pre( precision, solver, loadbal ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsSetLogging( HYPRE_Solver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParaSailsSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsSetNlevels( HYPRE_Solver solver, HYPRE_Int nlevels ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParaSailsSetNlevels_pre( precision, solver, nlevels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsSetParams( HYPRE_Solver solver, hypre_long_double thresh, HYPRE_Int nlevels ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParaSailsSetParams_pre( precision, solver, thresh, nlevels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsSetReuse( HYPRE_Solver solver, HYPRE_Int reuse ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParaSailsSetReuse_pre( precision, solver, reuse ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsSetSym( HYPRE_Solver solver, HYPRE_Int sym ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParaSailsSetSym_pre( precision, solver, sym ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsSetThresh( HYPRE_Solver solver, hypre_long_double thresh ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParaSailsSetThresh_pre( precision, solver, thresh ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParaSailsSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsSolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParaSailsSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SchwarzCreate( HYPRE_Solver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SchwarzCreate_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SchwarzDestroy( HYPRE_Solver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SchwarzDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SchwarzSetDofFunc( HYPRE_Solver solver, HYPRE_Int *dof_func ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SchwarzSetDofFunc_pre( precision, solver, dof_func ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SchwarzSetDomainStructure( HYPRE_Solver solver, HYPRE_CSRMatrix domain_structure ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SchwarzSetDomainStructure_pre( precision, solver, domain_structure ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SchwarzSetDomainType( HYPRE_Solver solver, HYPRE_Int domain_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SchwarzSetDomainType_pre( precision, solver, domain_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SchwarzSetNonSymm( HYPRE_Solver solver, HYPRE_Int use_nonsymm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SchwarzSetNonSymm_pre( precision, solver, use_nonsymm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SchwarzSetNumFunctions( HYPRE_Solver solver, HYPRE_Int num_functions ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SchwarzSetNumFunctions_pre( precision, solver, num_functions ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SchwarzSetOverlap( HYPRE_Solver solver, HYPRE_Int overlap ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SchwarzSetOverlap_pre( precision, solver, overlap ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SchwarzSetRelaxWeight( HYPRE_Solver solver, hypre_long_double relax_weight ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SchwarzSetRelaxWeight_pre( precision, solver, relax_weight ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SchwarzSetVariant( HYPRE_Solver solver, HYPRE_Int variant ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SchwarzSetVariant_pre( precision, solver, variant ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SchwarzSetup( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SchwarzSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SchwarzSolve( HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SchwarzSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_TempParCSRSetupInterpreter( mv_InterfaceInterpreter *i ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_TempParCSRSetupInterpreter_pre( precision, i ); +} + + + +#endif + diff --git a/src/parcsr_ls/mup_pre.c b/src/parcsr_ls/mup_pre.c new file mode 100644 index 0000000000..25a54ed230 --- /dev/null +++ b/src/parcsr_ls/mup_pre.c @@ -0,0 +1,11305 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_parcsr_ls.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_ADSCreate_pre( HYPRE_Precision precision, HYPRE_Solver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ADSCreate_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ADSCreate_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ADSCreate_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ADSDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ADSDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ADSDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *rel_resid_norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ADSGetFinalRelativeResidualNorm_flt( solver, rel_resid_norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ADSGetFinalRelativeResidualNorm_dbl( solver, rel_resid_norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ADSGetFinalRelativeResidualNorm_long_dbl( solver, rel_resid_norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ADSGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ADSGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ADSGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSSetAMGOptions_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int coarsen_type, HYPRE_Int agg_levels, HYPRE_Int relax_type, hypre_long_double strength_threshold, HYPRE_Int interp_type, HYPRE_Int Pmax ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ADSSetAMGOptions_flt( solver, coarsen_type, agg_levels, relax_type, strength_threshold, interp_type, Pmax ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ADSSetAMGOptions_dbl( solver, coarsen_type, agg_levels, relax_type, strength_threshold, interp_type, Pmax ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ADSSetAMGOptions_long_dbl( solver, coarsen_type, agg_levels, relax_type, strength_threshold, interp_type, Pmax ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSSetAMSOptions_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int cycle_type, HYPRE_Int coarsen_type, HYPRE_Int agg_levels, HYPRE_Int relax_type, hypre_long_double strength_threshold, HYPRE_Int interp_type, HYPRE_Int Pmax ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ADSSetAMSOptions_flt( solver, cycle_type, coarsen_type, agg_levels, relax_type, strength_threshold, interp_type, Pmax ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ADSSetAMSOptions_dbl( solver, cycle_type, coarsen_type, agg_levels, relax_type, strength_threshold, interp_type, Pmax ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ADSSetAMSOptions_long_dbl( solver, cycle_type, coarsen_type, agg_levels, relax_type, strength_threshold, interp_type, Pmax ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSSetChebySmoothingOptions_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int cheby_order, hypre_long_double cheby_fraction ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ADSSetChebySmoothingOptions_flt( solver, cheby_order, cheby_fraction ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ADSSetChebySmoothingOptions_dbl( solver, cheby_order, cheby_fraction ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ADSSetChebySmoothingOptions_long_dbl( solver, cheby_order, cheby_fraction ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSSetCoordinateVectors_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParVector x, HYPRE_ParVector y, HYPRE_ParVector z ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ADSSetCoordinateVectors_flt( solver, x, y, z ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ADSSetCoordinateVectors_dbl( solver, x, y, z ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ADSSetCoordinateVectors_long_dbl( solver, x, y, z ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSSetCycleType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int cycle_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ADSSetCycleType_flt( solver, cycle_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ADSSetCycleType_dbl( solver, cycle_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ADSSetCycleType_long_dbl( solver, cycle_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSSetDiscreteCurl_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix C ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ADSSetDiscreteCurl_flt( solver, C ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ADSSetDiscreteCurl_dbl( solver, C ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ADSSetDiscreteCurl_long_dbl( solver, C ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSSetDiscreteGradient_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix G ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ADSSetDiscreteGradient_flt( solver, G ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ADSSetDiscreteGradient_dbl( solver, G ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ADSSetDiscreteGradient_long_dbl( solver, G ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSSetInterpolations_pre( HYPRE_Precision precision, 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 ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ADSSetInterpolations_flt( solver, RT_Pi, RT_Pix, RT_Piy, RT_Piz, ND_Pi, ND_Pix, ND_Piy, ND_Piz ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ADSSetInterpolations_dbl( solver, RT_Pi, RT_Pix, RT_Piy, RT_Piz, ND_Pi, ND_Pix, ND_Piy, ND_Piz ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ADSSetInterpolations_long_dbl( solver, RT_Pi, RT_Pix, RT_Piy, RT_Piz, ND_Pi, ND_Pix, ND_Piy, ND_Piz ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int maxit ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ADSSetMaxIter_flt( solver, maxit ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ADSSetMaxIter_dbl( solver, maxit ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ADSSetMaxIter_long_dbl( solver, maxit ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ADSSetPrintLevel_flt( solver, print_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ADSSetPrintLevel_dbl( solver, print_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ADSSetPrintLevel_long_dbl( solver, print_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSSetSmoothingOptions_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int relax_type, HYPRE_Int relax_times, hypre_long_double relax_weight, hypre_long_double omega ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ADSSetSmoothingOptions_flt( solver, relax_type, relax_times, relax_weight, omega ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ADSSetSmoothingOptions_dbl( solver, relax_type, relax_times, relax_weight, omega ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ADSSetSmoothingOptions_long_dbl( solver, relax_type, relax_times, relax_weight, omega ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ADSSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ADSSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ADSSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ADSSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ADSSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ADSSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ADSSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ADSSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ADSSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ADSSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMECreate_pre( HYPRE_Precision precision, HYPRE_Solver *esolver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMECreate_flt( esolver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMECreate_dbl( esolver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMECreate_long_dbl( esolver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMEDestroy_pre( HYPRE_Precision precision, HYPRE_Solver esolver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMEDestroy_flt( esolver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMEDestroy_dbl( esolver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMEDestroy_long_dbl( esolver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMEGetEigenvalues_pre( HYPRE_Precision precision, HYPRE_Solver esolver, void *eigenvalues ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMEGetEigenvalues_flt( esolver, eigenvalues ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMEGetEigenvalues_dbl( esolver, eigenvalues ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMEGetEigenvalues_long_dbl( esolver, eigenvalues ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMEGetEigenvectors_pre( HYPRE_Precision precision, HYPRE_Solver esolver, HYPRE_ParVector **eigenvectors ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMEGetEigenvectors_flt( esolver, eigenvectors ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMEGetEigenvectors_dbl( esolver, eigenvectors ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMEGetEigenvectors_long_dbl( esolver, eigenvectors ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMESetAMSSolver_pre( HYPRE_Precision precision, HYPRE_Solver esolver, HYPRE_Solver ams_solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMESetAMSSolver_flt( esolver, ams_solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMESetAMSSolver_dbl( esolver, ams_solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMESetAMSSolver_long_dbl( esolver, ams_solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMESetBlockSize_pre( HYPRE_Precision precision, HYPRE_Solver esolver, HYPRE_Int block_size ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMESetBlockSize_flt( esolver, block_size ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMESetBlockSize_dbl( esolver, block_size ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMESetBlockSize_long_dbl( esolver, block_size ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMESetMassMatrix_pre( HYPRE_Precision precision, HYPRE_Solver esolver, HYPRE_ParCSRMatrix M ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMESetMassMatrix_flt( esolver, M ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMESetMassMatrix_dbl( esolver, M ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMESetMassMatrix_long_dbl( esolver, M ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMESetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver esolver, HYPRE_Int maxit ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMESetMaxIter_flt( esolver, maxit ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMESetMaxIter_dbl( esolver, maxit ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMESetMaxIter_long_dbl( esolver, maxit ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMESetMaxPCGIter_pre( HYPRE_Precision precision, HYPRE_Solver esolver, HYPRE_Int maxit ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMESetMaxPCGIter_flt( esolver, maxit ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMESetMaxPCGIter_dbl( esolver, maxit ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMESetMaxPCGIter_long_dbl( esolver, maxit ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMESetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver esolver, HYPRE_Int print_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMESetPrintLevel_flt( esolver, print_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMESetPrintLevel_dbl( esolver, print_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMESetPrintLevel_long_dbl( esolver, print_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMESetRTol_pre( HYPRE_Precision precision, HYPRE_Solver esolver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMESetRTol_flt( esolver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMESetRTol_dbl( esolver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMESetRTol_long_dbl( esolver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMESetTol_pre( HYPRE_Precision precision, HYPRE_Solver esolver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMESetTol_flt( esolver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMESetTol_dbl( esolver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMESetTol_long_dbl( esolver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMESetup_pre( HYPRE_Precision precision, HYPRE_Solver esolver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMESetup_flt( esolver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMESetup_dbl( esolver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMESetup_long_dbl( esolver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMESolve_pre( HYPRE_Precision precision, HYPRE_Solver esolver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMESolve_flt( esolver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMESolve_dbl( esolver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMESolve_long_dbl( esolver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSConstructDiscreteGradient_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix A, HYPRE_ParVector x_coord, HYPRE_BigInt *edge_vertex, HYPRE_Int edge_orientation, HYPRE_ParCSRMatrix *G ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMSConstructDiscreteGradient_flt( A, x_coord, edge_vertex, edge_orientation, G ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMSConstructDiscreteGradient_dbl( A, x_coord, edge_vertex, edge_orientation, G ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMSConstructDiscreteGradient_long_dbl( A, x_coord, edge_vertex, edge_orientation, G ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSCreate_pre( HYPRE_Precision precision, HYPRE_Solver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMSCreate_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMSCreate_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMSCreate_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMSDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMSDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMSDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *rel_resid_norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMSGetFinalRelativeResidualNorm_flt( solver, rel_resid_norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMSGetFinalRelativeResidualNorm_dbl( solver, rel_resid_norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMSGetFinalRelativeResidualNorm_long_dbl( solver, rel_resid_norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMSGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMSGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMSGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSProjectOutGradients_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMSProjectOutGradients_flt( solver, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMSProjectOutGradients_dbl( solver, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMSProjectOutGradients_long_dbl( solver, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetAlphaAMGCoarseRelaxType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int alpha_coarse_relax_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMSSetAlphaAMGCoarseRelaxType_flt( solver, alpha_coarse_relax_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMSSetAlphaAMGCoarseRelaxType_dbl( solver, alpha_coarse_relax_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMSSetAlphaAMGCoarseRelaxType_long_dbl( solver, alpha_coarse_relax_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetAlphaAMGOptions_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int alpha_coarsen_type, HYPRE_Int alpha_agg_levels, HYPRE_Int alpha_relax_type, hypre_long_double alpha_strength_threshold, HYPRE_Int alpha_interp_type, HYPRE_Int alpha_Pmax ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMSSetAlphaAMGOptions_flt( solver, alpha_coarsen_type, alpha_agg_levels, alpha_relax_type, alpha_strength_threshold, alpha_interp_type, alpha_Pmax ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMSSetAlphaAMGOptions_dbl( solver, alpha_coarsen_type, alpha_agg_levels, alpha_relax_type, alpha_strength_threshold, alpha_interp_type, alpha_Pmax ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMSSetAlphaAMGOptions_long_dbl( solver, alpha_coarsen_type, alpha_agg_levels, alpha_relax_type, alpha_strength_threshold, alpha_interp_type, alpha_Pmax ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetAlphaPoissonMatrix_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A_alpha ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMSSetAlphaPoissonMatrix_flt( solver, A_alpha ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMSSetAlphaPoissonMatrix_dbl( solver, A_alpha ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMSSetAlphaPoissonMatrix_long_dbl( solver, A_alpha ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetBetaAMGCoarseRelaxType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int beta_coarse_relax_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMSSetBetaAMGCoarseRelaxType_flt( solver, beta_coarse_relax_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMSSetBetaAMGCoarseRelaxType_dbl( solver, beta_coarse_relax_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMSSetBetaAMGCoarseRelaxType_long_dbl( solver, beta_coarse_relax_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetBetaAMGOptions_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int beta_coarsen_type, HYPRE_Int beta_agg_levels, HYPRE_Int beta_relax_type, hypre_long_double beta_strength_threshold, HYPRE_Int beta_interp_type, HYPRE_Int beta_Pmax ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMSSetBetaAMGOptions_flt( solver, beta_coarsen_type, beta_agg_levels, beta_relax_type, beta_strength_threshold, beta_interp_type, beta_Pmax ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMSSetBetaAMGOptions_dbl( solver, beta_coarsen_type, beta_agg_levels, beta_relax_type, beta_strength_threshold, beta_interp_type, beta_Pmax ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMSSetBetaAMGOptions_long_dbl( solver, beta_coarsen_type, beta_agg_levels, beta_relax_type, beta_strength_threshold, beta_interp_type, beta_Pmax ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetBetaPoissonMatrix_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A_beta ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMSSetBetaPoissonMatrix_flt( solver, A_beta ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMSSetBetaPoissonMatrix_dbl( solver, A_beta ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMSSetBetaPoissonMatrix_long_dbl( solver, A_beta ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetCoordinateVectors_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParVector x, HYPRE_ParVector y, HYPRE_ParVector z ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMSSetCoordinateVectors_flt( solver, x, y, z ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMSSetCoordinateVectors_dbl( solver, x, y, z ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMSSetCoordinateVectors_long_dbl( solver, x, y, z ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetCycleType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int cycle_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMSSetCycleType_flt( solver, cycle_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMSSetCycleType_dbl( solver, cycle_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMSSetCycleType_long_dbl( solver, cycle_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetDimension_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int dim ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMSSetDimension_flt( solver, dim ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMSSetDimension_dbl( solver, dim ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMSSetDimension_long_dbl( solver, dim ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetDiscreteGradient_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix G ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMSSetDiscreteGradient_flt( solver, G ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMSSetDiscreteGradient_dbl( solver, G ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMSSetDiscreteGradient_long_dbl( solver, G ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetEdgeConstantVectors_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParVector Gx, HYPRE_ParVector Gy, HYPRE_ParVector Gz ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMSSetEdgeConstantVectors_flt( solver, Gx, Gy, Gz ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMSSetEdgeConstantVectors_dbl( solver, Gx, Gy, Gz ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMSSetEdgeConstantVectors_long_dbl( solver, Gx, Gy, Gz ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetInteriorNodes_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParVector interior_nodes ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMSSetInteriorNodes_flt( solver, interior_nodes ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMSSetInteriorNodes_dbl( solver, interior_nodes ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMSSetInteriorNodes_long_dbl( solver, interior_nodes ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetInterpolations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix Pi, HYPRE_ParCSRMatrix Pix, HYPRE_ParCSRMatrix Piy, HYPRE_ParCSRMatrix Piz ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMSSetInterpolations_flt( solver, Pi, Pix, Piy, Piz ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMSSetInterpolations_dbl( solver, Pi, Pix, Piy, Piz ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMSSetInterpolations_long_dbl( solver, Pi, Pix, Piy, Piz ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int maxit ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMSSetMaxIter_flt( solver, maxit ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMSSetMaxIter_dbl( solver, maxit ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMSSetMaxIter_long_dbl( solver, maxit ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMSSetPrintLevel_flt( solver, print_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMSSetPrintLevel_dbl( solver, print_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMSSetPrintLevel_long_dbl( solver, print_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetProjectionFrequency_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int projection_frequency ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMSSetProjectionFrequency_flt( solver, projection_frequency ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMSSetProjectionFrequency_dbl( solver, projection_frequency ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMSSetProjectionFrequency_long_dbl( solver, projection_frequency ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetSmoothingOptions_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int relax_type, HYPRE_Int relax_times, hypre_long_double relax_weight, hypre_long_double omega ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMSSetSmoothingOptions_flt( solver, relax_type, relax_times, relax_weight, omega ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMSSetSmoothingOptions_dbl( solver, relax_type, relax_times, relax_weight, omega ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMSSetSmoothingOptions_long_dbl( solver, relax_type, relax_times, relax_weight, omega ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMSSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMSSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMSSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMSSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMSSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMSSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_AMSSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AMSSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AMSSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AMSSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BlockTridiagCreate_pre( HYPRE_Precision precision, HYPRE_Solver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BlockTridiagCreate_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BlockTridiagCreate_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BlockTridiagCreate_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BlockTridiagDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BlockTridiagDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BlockTridiagDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BlockTridiagDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BlockTridiagSetAMGNumSweeps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_sweeps ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BlockTridiagSetAMGNumSweeps_flt( solver, num_sweeps ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BlockTridiagSetAMGNumSweeps_dbl( solver, num_sweeps ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BlockTridiagSetAMGNumSweeps_long_dbl( solver, num_sweeps ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BlockTridiagSetAMGRelaxType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int relax_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BlockTridiagSetAMGRelaxType_flt( solver, relax_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BlockTridiagSetAMGRelaxType_dbl( solver, relax_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BlockTridiagSetAMGRelaxType_long_dbl( solver, relax_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BlockTridiagSetAMGStrengthThreshold_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double thresh ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BlockTridiagSetAMGStrengthThreshold_flt( solver, thresh ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BlockTridiagSetAMGStrengthThreshold_dbl( solver, thresh ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BlockTridiagSetAMGStrengthThreshold_long_dbl( solver, thresh ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BlockTridiagSetIndexSet_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int n, HYPRE_Int *inds ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BlockTridiagSetIndexSet_flt( solver, n, inds ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BlockTridiagSetIndexSet_dbl( solver, n, inds ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BlockTridiagSetIndexSet_long_dbl( solver, n, inds ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BlockTridiagSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BlockTridiagSetPrintLevel_flt( solver, print_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BlockTridiagSetPrintLevel_dbl( solver, print_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BlockTridiagSetPrintLevel_long_dbl( solver, print_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BlockTridiagSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BlockTridiagSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BlockTridiagSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BlockTridiagSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BlockTridiagSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BlockTridiagSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BlockTridiagSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BlockTridiagSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGCreate_pre( HYPRE_Precision precision, HYPRE_Solver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGCreate_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGCreate_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGCreate_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDDCreate_pre( HYPRE_Precision precision, HYPRE_Solver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGDDCreate_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGDDCreate_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGDDCreate_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDDDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGDDDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGDDDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGDDDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDDGetAMG_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *amg_solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGDDGetAMG_flt( solver, amg_solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGDDGetAMG_dbl( solver, amg_solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGDDGetAMG_long_dbl( solver, amg_solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDDGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *rel_resid_norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGDDGetFinalRelativeResidualNorm_flt( solver, rel_resid_norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGDDGetFinalRelativeResidualNorm_dbl( solver, rel_resid_norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGDDGetFinalRelativeResidualNorm_long_dbl( solver, rel_resid_norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDDGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGDDGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGDDGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGDDGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDDSetFACCycleType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int amgdd_fac_cycle_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGDDSetFACCycleType_flt( solver, amgdd_fac_cycle_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGDDSetFACCycleType_dbl( solver, amgdd_fac_cycle_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGDDSetFACCycleType_long_dbl( solver, amgdd_fac_cycle_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDDSetFACNumCycles_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int amgdd_fac_num_cycles ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGDDSetFACNumCycles_flt( solver, amgdd_fac_num_cycles ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGDDSetFACNumCycles_dbl( solver, amgdd_fac_num_cycles ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGDDSetFACNumCycles_long_dbl( solver, amgdd_fac_num_cycles ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDDSetFACNumRelax_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int amgdd_fac_num_relax ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGDDSetFACNumRelax_flt( solver, amgdd_fac_num_relax ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGDDSetFACNumRelax_dbl( solver, amgdd_fac_num_relax ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGDDSetFACNumRelax_long_dbl( solver, amgdd_fac_num_relax ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDDSetFACRelaxType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int amgdd_fac_relax_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGDDSetFACRelaxType_flt( solver, amgdd_fac_relax_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGDDSetFACRelaxType_dbl( solver, amgdd_fac_relax_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGDDSetFACRelaxType_long_dbl( solver, amgdd_fac_relax_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDDSetFACRelaxWeight_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double amgdd_fac_relax_weight ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGDDSetFACRelaxWeight_flt( solver, amgdd_fac_relax_weight ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGDDSetFACRelaxWeight_dbl( solver, amgdd_fac_relax_weight ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGDDSetFACRelaxWeight_long_dbl( solver, amgdd_fac_relax_weight ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDDSetNumGhostLayers_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_ghost_layers ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGDDSetNumGhostLayers_flt( solver, num_ghost_layers ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGDDSetNumGhostLayers_dbl( solver, num_ghost_layers ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGDDSetNumGhostLayers_long_dbl( solver, num_ghost_layers ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDDSetPadding_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int padding ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGDDSetPadding_flt( solver, padding ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGDDSetPadding_dbl( solver, padding ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGDDSetPadding_long_dbl( solver, padding ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDDSetStartLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int start_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGDDSetStartLevel_flt( solver, start_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGDDSetStartLevel_dbl( solver, start_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGDDSetStartLevel_long_dbl( solver, start_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDDSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGDDSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGDDSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGDDSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDDSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGDDSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGDDSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGDDSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetAdditive_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *additive ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetAdditive_flt( solver, additive ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetAdditive_dbl( solver, additive ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetAdditive_long_dbl( solver, additive ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetCoarsenCutFactor_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *coarsen_cut_factor ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetCoarsenCutFactor_flt( solver, coarsen_cut_factor ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetCoarsenCutFactor_dbl( solver, coarsen_cut_factor ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetCoarsenCutFactor_long_dbl( solver, coarsen_cut_factor ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetCoarsenType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *coarsen_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetCoarsenType_flt( solver, coarsen_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetCoarsenType_dbl( solver, coarsen_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetCoarsenType_long_dbl( solver, coarsen_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetConvergeType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetConvergeType_flt( solver, type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetConvergeType_dbl( solver, type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetConvergeType_long_dbl( solver, type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetCumNnzAP_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *cum_nnz_AP ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetCumNnzAP_flt( solver, cum_nnz_AP ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetCumNnzAP_dbl( solver, cum_nnz_AP ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetCumNnzAP_long_dbl( solver, cum_nnz_AP ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetCumNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *cum_num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetCumNumIterations_flt( solver, cum_num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetCumNumIterations_dbl( solver, cum_num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetCumNumIterations_long_dbl( solver, cum_num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetCycleNumSweeps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_sweeps, HYPRE_Int k ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetCycleNumSweeps_flt( solver, num_sweeps, k ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetCycleNumSweeps_dbl( solver, num_sweeps, k ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetCycleNumSweeps_long_dbl( solver, num_sweeps, k ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetCycleRelaxType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *relax_type, HYPRE_Int k ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetCycleRelaxType_flt( solver, relax_type, k ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetCycleRelaxType_dbl( solver, relax_type, k ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetCycleRelaxType_long_dbl( solver, relax_type, k ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetCycleType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *cycle_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetCycleType_flt( solver, cycle_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetCycleType_dbl( solver, cycle_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetCycleType_long_dbl( solver, cycle_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetDebugFlag_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *debug_flag ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetDebugFlag_flt( solver, debug_flag ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetDebugFlag_dbl( solver, debug_flag ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetDebugFlag_long_dbl( solver, debug_flag ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetDomainType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *domain_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetDomainType_flt( solver, domain_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetDomainType_dbl( solver, domain_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetDomainType_long_dbl( solver, domain_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetFCycle_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *fcycle ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetFCycle_flt( solver, fcycle ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetFCycle_dbl( solver, fcycle ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetFCycle_long_dbl( solver, fcycle ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetFilterFunctions_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *filter_functions ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetFilterFunctions_flt( solver, filter_functions ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetFilterFunctions_dbl( solver, filter_functions ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetFilterFunctions_long_dbl( solver, filter_functions ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetFilterThresholdR_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *filter_threshold ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetFilterThresholdR_flt( solver, filter_threshold ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetFilterThresholdR_dbl( solver, filter_threshold ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetFilterThresholdR_long_dbl( solver, filter_threshold ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *rel_resid_norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetFinalRelativeResidualNorm_flt( solver, rel_resid_norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetFinalRelativeResidualNorm_dbl( solver, rel_resid_norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetFinalRelativeResidualNorm_long_dbl( solver, rel_resid_norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetGridHierarchy_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *cgrid ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetGridHierarchy_flt( solver, cgrid ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetGridHierarchy_dbl( solver, cgrid ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetGridHierarchy_long_dbl( solver, cgrid ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetJacobiTruncThreshold_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *jacobi_trunc_threshold ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetJacobiTruncThreshold_flt( solver, jacobi_trunc_threshold ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetJacobiTruncThreshold_dbl( solver, jacobi_trunc_threshold ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetJacobiTruncThreshold_long_dbl( solver, jacobi_trunc_threshold ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetMaxCoarseSize_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *max_coarse_size ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetMaxCoarseSize_flt( solver, max_coarse_size ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetMaxCoarseSize_dbl( solver, max_coarse_size ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetMaxCoarseSize_long_dbl( solver, max_coarse_size ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetMaxLevels_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *max_levels ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetMaxLevels_flt( solver, max_levels ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetMaxLevels_dbl( solver, max_levels ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetMaxLevels_long_dbl( solver, max_levels ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetMaxRowSum_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *max_row_sum ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetMaxRowSum_flt( solver, max_row_sum ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetMaxRowSum_dbl( solver, max_row_sum ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetMaxRowSum_long_dbl( solver, max_row_sum ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetMeasureType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *measure_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetMeasureType_flt( solver, measure_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetMeasureType_dbl( solver, measure_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetMeasureType_long_dbl( solver, measure_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetMinCoarseSize_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *min_coarse_size ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetMinCoarseSize_flt( solver, min_coarse_size ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetMinCoarseSize_dbl( solver, min_coarse_size ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetMinCoarseSize_long_dbl( solver, min_coarse_size ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetMultAdditive_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *mult_additive ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetMultAdditive_flt( solver, mult_additive ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetMultAdditive_dbl( solver, mult_additive ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetMultAdditive_long_dbl( solver, mult_additive ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetNumFunctions_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_functions ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetNumFunctions_flt( solver, num_functions ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetNumFunctions_dbl( solver, num_functions ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetNumFunctions_long_dbl( solver, num_functions ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetOverlap_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *overlap ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetOverlap_flt( solver, overlap ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetOverlap_dbl( solver, overlap ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetOverlap_long_dbl( solver, overlap ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetPMaxElmts_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *P_max_elmts ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetPMaxElmts_flt( solver, P_max_elmts ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetPMaxElmts_dbl( solver, P_max_elmts ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetPMaxElmts_long_dbl( solver, P_max_elmts ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetPostInterpType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *post_interp_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetPostInterpType_flt( solver, post_interp_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetPostInterpType_dbl( solver, post_interp_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetPostInterpType_long_dbl( solver, post_interp_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *print_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetPrintLevel_flt( solver, print_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetPrintLevel_dbl( solver, print_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetPrintLevel_long_dbl( solver, print_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetRedundant_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *redundant ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetRedundant_flt( solver, redundant ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetRedundant_dbl( solver, redundant ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetRedundant_long_dbl( solver, redundant ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParVector *residual ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetResidual_flt( solver, residual ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetResidual_dbl( solver, residual ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetResidual_long_dbl( solver, residual ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetSchwarzRlxWeight_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *schwarz_rlx_weight ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetSchwarzRlxWeight_flt( solver, schwarz_rlx_weight ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetSchwarzRlxWeight_dbl( solver, schwarz_rlx_weight ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetSchwarzRlxWeight_long_dbl( solver, schwarz_rlx_weight ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetSeqThreshold_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *seq_threshold ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetSeqThreshold_flt( solver, seq_threshold ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetSeqThreshold_dbl( solver, seq_threshold ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetSeqThreshold_long_dbl( solver, seq_threshold ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetSimple_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *simple ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetSimple_flt( solver, simple ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetSimple_dbl( solver, simple ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetSimple_long_dbl( solver, simple ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetSmoothNumLevels_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *smooth_num_levels ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetSmoothNumLevels_flt( solver, smooth_num_levels ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetSmoothNumLevels_dbl( solver, smooth_num_levels ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetSmoothNumLevels_long_dbl( solver, smooth_num_levels ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetSmoothNumSweeps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *smooth_num_sweeps ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetSmoothNumSweeps_flt( solver, smooth_num_sweeps ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetSmoothNumSweeps_dbl( solver, smooth_num_sweeps ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetSmoothNumSweeps_long_dbl( solver, smooth_num_sweeps ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetSmoothType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *smooth_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetSmoothType_flt( solver, smooth_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetSmoothType_dbl( solver, smooth_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetSmoothType_long_dbl( solver, smooth_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetStrongThreshold_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *strong_threshold ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetStrongThreshold_flt( solver, strong_threshold ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetStrongThreshold_dbl( solver, strong_threshold ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetStrongThreshold_long_dbl( solver, strong_threshold ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetStrongThresholdR_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *strong_threshold ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetStrongThresholdR_flt( solver, strong_threshold ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetStrongThresholdR_dbl( solver, strong_threshold ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetStrongThresholdR_long_dbl( solver, strong_threshold ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetTruncFactor_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *trunc_factor ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetTruncFactor_flt( solver, trunc_factor ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetTruncFactor_dbl( solver, trunc_factor ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetTruncFactor_long_dbl( solver, trunc_factor ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGGetVariant_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *variant ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGGetVariant_flt( solver, variant ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGGetVariant_dbl( solver, variant ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGGetVariant_long_dbl( solver, variant ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGInitGridRelaxation_pre( HYPRE_Precision precision, HYPRE_Int **num_grid_sweeps_ptr, HYPRE_Int **grid_relax_type_ptr, HYPRE_Int ***grid_relax_points_ptr, HYPRE_Int coarsen_type, void *relax_weights_ptr, HYPRE_Int max_levels ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGInitGridRelaxation_flt( num_grid_sweeps_ptr, grid_relax_type_ptr, grid_relax_points_ptr, coarsen_type, relax_weights_ptr, max_levels ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGInitGridRelaxation_dbl( num_grid_sweeps_ptr, grid_relax_type_ptr, grid_relax_points_ptr, coarsen_type, relax_weights_ptr, max_levels ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGInitGridRelaxation_long_dbl( num_grid_sweeps_ptr, grid_relax_type_ptr, grid_relax_points_ptr, coarsen_type, relax_weights_ptr, max_levels ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetADropTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double A_drop_tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetADropTol_flt( solver, A_drop_tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetADropTol_dbl( solver, A_drop_tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetADropTol_long_dbl( solver, A_drop_tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetADropType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int A_drop_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetADropType_flt( solver, A_drop_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetADropType_dbl( solver, A_drop_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetADropType_long_dbl( solver, A_drop_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetAddLastLvl_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int add_last_lvl ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetAddLastLvl_flt( solver, add_last_lvl ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetAddLastLvl_dbl( solver, add_last_lvl ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetAddLastLvl_long_dbl( solver, add_last_lvl ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetAddPMaxElmts_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int add_P_max_elmts ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetAddPMaxElmts_flt( solver, add_P_max_elmts ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetAddPMaxElmts_dbl( solver, add_P_max_elmts ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetAddPMaxElmts_long_dbl( solver, add_P_max_elmts ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetAddRelaxType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int add_rlx_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetAddRelaxType_flt( solver, add_rlx_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetAddRelaxType_dbl( solver, add_rlx_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetAddRelaxType_long_dbl( solver, add_rlx_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetAddRelaxWt_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double add_rlx_wt ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetAddRelaxWt_flt( solver, add_rlx_wt ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetAddRelaxWt_dbl( solver, add_rlx_wt ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetAddRelaxWt_long_dbl( solver, add_rlx_wt ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetAddTruncFactor_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double add_trunc_factor ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetAddTruncFactor_flt( solver, add_trunc_factor ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetAddTruncFactor_dbl( solver, add_trunc_factor ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetAddTruncFactor_long_dbl( solver, add_trunc_factor ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetAdditive_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int addlvl ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetAdditive_flt( solver, addlvl ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetAdditive_dbl( solver, addlvl ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetAdditive_long_dbl( solver, addlvl ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetAggInterpType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int agg_interp_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetAggInterpType_flt( solver, agg_interp_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetAggInterpType_dbl( solver, agg_interp_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetAggInterpType_long_dbl( solver, agg_interp_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetAggNumLevels_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int agg_num_levels ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetAggNumLevels_flt( solver, agg_num_levels ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetAggNumLevels_dbl( solver, agg_num_levels ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetAggNumLevels_long_dbl( solver, agg_num_levels ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetAggP12MaxElmts_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int agg_P12_max_elmts ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetAggP12MaxElmts_flt( solver, agg_P12_max_elmts ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetAggP12MaxElmts_dbl( solver, agg_P12_max_elmts ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetAggP12MaxElmts_long_dbl( solver, agg_P12_max_elmts ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetAggP12TruncFactor_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double agg_P12_trunc_factor ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetAggP12TruncFactor_flt( solver, agg_P12_trunc_factor ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetAggP12TruncFactor_dbl( solver, agg_P12_trunc_factor ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetAggP12TruncFactor_long_dbl( solver, agg_P12_trunc_factor ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetAggPMaxElmts_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int agg_P_max_elmts ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetAggPMaxElmts_flt( solver, agg_P_max_elmts ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetAggPMaxElmts_dbl( solver, agg_P_max_elmts ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetAggPMaxElmts_long_dbl( solver, agg_P_max_elmts ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetAggTruncFactor_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double agg_trunc_factor ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetAggTruncFactor_flt( solver, agg_trunc_factor ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetAggTruncFactor_dbl( solver, agg_trunc_factor ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetAggTruncFactor_long_dbl( solver, agg_trunc_factor ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetCGCIts_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int its ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetCGCIts_flt( solver, its ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetCGCIts_dbl( solver, its ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetCGCIts_long_dbl( solver, its ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetCPoints_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int cpt_coarse_level, HYPRE_Int num_cpt_coarse, HYPRE_BigInt *cpt_coarse_index ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetCPoints_flt( solver, cpt_coarse_level, num_cpt_coarse, cpt_coarse_index ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetCPoints_dbl( solver, cpt_coarse_level, num_cpt_coarse, cpt_coarse_index ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetCPoints_long_dbl( solver, cpt_coarse_level, num_cpt_coarse, cpt_coarse_index ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetCRRate_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double CR_rate ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetCRRate_flt( solver, CR_rate ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetCRRate_dbl( solver, CR_rate ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetCRRate_long_dbl( solver, CR_rate ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetCRStrongTh_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double CR_strong_th ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetCRStrongTh_flt( solver, CR_strong_th ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetCRStrongTh_dbl( solver, CR_strong_th ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetCRStrongTh_long_dbl( solver, CR_strong_th ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetCRUseCG_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int CR_use_CG ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetCRUseCG_flt( solver, CR_use_CG ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetCRUseCG_dbl( solver, CR_use_CG ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetCRUseCG_long_dbl( solver, CR_use_CG ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetChebyEigEst_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int eig_est ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetChebyEigEst_flt( solver, eig_est ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetChebyEigEst_dbl( solver, eig_est ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetChebyEigEst_long_dbl( solver, eig_est ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetChebyFraction_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double ratio ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetChebyFraction_flt( solver, ratio ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetChebyFraction_dbl( solver, ratio ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetChebyFraction_long_dbl( solver, ratio ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetChebyOrder_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int order ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetChebyOrder_flt( solver, order ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetChebyOrder_dbl( solver, order ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetChebyOrder_long_dbl( solver, order ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetChebyScale_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int scale ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetChebyScale_flt( solver, scale ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetChebyScale_dbl( solver, scale ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetChebyScale_long_dbl( solver, scale ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetChebyVariant_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int variant ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetChebyVariant_flt( solver, variant ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetChebyVariant_dbl( solver, variant ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetChebyVariant_long_dbl( solver, variant ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetCoarsenCutFactor_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int coarsen_cut_factor ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetCoarsenCutFactor_flt( solver, coarsen_cut_factor ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetCoarsenCutFactor_dbl( solver, coarsen_cut_factor ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetCoarsenCutFactor_long_dbl( solver, coarsen_cut_factor ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetCoarsenType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int coarsen_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetCoarsenType_flt( solver, coarsen_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetCoarsenType_dbl( solver, coarsen_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetCoarsenType_long_dbl( solver, coarsen_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetConvergeType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetConvergeType_flt( solver, type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetConvergeType_dbl( solver, type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetConvergeType_long_dbl( solver, type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetCoordDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int coorddim ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetCoordDim_flt( solver, coorddim ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetCoordDim_dbl( solver, coorddim ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetCoordDim_long_dbl( solver, coorddim ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetCoordinates_pre( HYPRE_Precision precision, HYPRE_Solver solver, float *coordinates ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetCoordinates_flt( solver, coordinates ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetCoordinates_dbl( solver, coordinates ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetCoordinates_long_dbl( solver, coordinates ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetCpointsToKeep_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int cpt_coarse_level, HYPRE_Int num_cpt_coarse, HYPRE_BigInt *cpt_coarse_index ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetCpointsToKeep_flt( solver, cpt_coarse_level, num_cpt_coarse, cpt_coarse_index ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetCpointsToKeep_dbl( solver, cpt_coarse_level, num_cpt_coarse, cpt_coarse_index ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetCpointsToKeep_long_dbl( solver, cpt_coarse_level, num_cpt_coarse, cpt_coarse_index ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetCumNnzAP_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double cum_nnz_AP ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetCumNnzAP_flt( solver, cum_nnz_AP ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetCumNnzAP_dbl( solver, cum_nnz_AP ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetCumNnzAP_long_dbl( solver, cum_nnz_AP ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetCycleNumSweeps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_sweeps, HYPRE_Int k ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetCycleNumSweeps_flt( solver, num_sweeps, k ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetCycleNumSweeps_dbl( solver, num_sweeps, k ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetCycleNumSweeps_long_dbl( solver, num_sweeps, k ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetCycleRelaxType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int relax_type, HYPRE_Int k ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetCycleRelaxType_flt( solver, relax_type, k ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetCycleRelaxType_dbl( solver, relax_type, k ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetCycleRelaxType_long_dbl( solver, relax_type, k ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetCycleType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int cycle_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetCycleType_flt( solver, cycle_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetCycleType_dbl( solver, cycle_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetCycleType_long_dbl( solver, cycle_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetDebugFlag_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int debug_flag ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetDebugFlag_flt( solver, debug_flag ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetDebugFlag_dbl( solver, debug_flag ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetDebugFlag_long_dbl( solver, debug_flag ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetDofFunc_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *dof_func ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetDofFunc_flt( solver, dof_func ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetDofFunc_dbl( solver, dof_func ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetDofFunc_long_dbl( solver, dof_func ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetDomainType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int domain_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetDomainType_flt( solver, domain_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetDomainType_dbl( solver, domain_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetDomainType_long_dbl( solver, domain_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetDropTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double drop_tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetDropTol_flt( solver, drop_tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetDropTol_dbl( solver, drop_tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetDropTol_long_dbl( solver, drop_tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetEuBJ_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int eu_bj ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetEuBJ_flt( solver, eu_bj ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetEuBJ_dbl( solver, eu_bj ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetEuBJ_long_dbl( solver, eu_bj ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetEuLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int eu_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetEuLevel_flt( solver, eu_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetEuLevel_dbl( solver, eu_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetEuLevel_long_dbl( solver, eu_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetEuSparseA_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double eu_sparse_A ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetEuSparseA_flt( solver, eu_sparse_A ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetEuSparseA_dbl( solver, eu_sparse_A ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetEuSparseA_long_dbl( solver, eu_sparse_A ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetEuclidFile_pre( HYPRE_Precision precision, HYPRE_Solver solver, char *euclidfile ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetEuclidFile_flt( solver, euclidfile ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetEuclidFile_dbl( solver, euclidfile ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetEuclidFile_long_dbl( solver, euclidfile ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFCycle_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int fcycle ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetFCycle_flt( solver, fcycle ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetFCycle_dbl( solver, fcycle ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetFCycle_long_dbl( solver, fcycle ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFPoints_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_fpt, HYPRE_BigInt *fpt_index ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetFPoints_flt( solver, num_fpt, fpt_index ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetFPoints_dbl( solver, num_fpt, fpt_index ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetFPoints_long_dbl( solver, num_fpt, fpt_index ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIAlgoType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int algo_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetFSAIAlgoType_flt( solver, algo_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetFSAIAlgoType_dbl( solver, algo_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetFSAIAlgoType_long_dbl( solver, algo_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIEigMaxIters_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int eig_max_iters ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetFSAIEigMaxIters_flt( solver, eig_max_iters ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetFSAIEigMaxIters_dbl( solver, eig_max_iters ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetFSAIEigMaxIters_long_dbl( solver, eig_max_iters ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIKapTolerance_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double kap_tolerance ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetFSAIKapTolerance_flt( solver, kap_tolerance ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetFSAIKapTolerance_dbl( solver, kap_tolerance ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetFSAIKapTolerance_long_dbl( solver, kap_tolerance ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFSAILocalSolveType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int local_solve_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetFSAILocalSolveType_flt( solver, local_solve_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetFSAILocalSolveType_dbl( solver, local_solve_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetFSAILocalSolveType_long_dbl( solver, local_solve_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIMaxNnzRow_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_nnz_row ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetFSAIMaxNnzRow_flt( solver, max_nnz_row ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetFSAIMaxNnzRow_dbl( solver, max_nnz_row ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetFSAIMaxNnzRow_long_dbl( solver, max_nnz_row ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIMaxStepSize_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_step_size ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetFSAIMaxStepSize_flt( solver, max_step_size ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetFSAIMaxStepSize_dbl( solver, max_step_size ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetFSAIMaxStepSize_long_dbl( solver, max_step_size ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIMaxSteps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_steps ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetFSAIMaxSteps_flt( solver, max_steps ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetFSAIMaxSteps_dbl( solver, max_steps ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetFSAIMaxSteps_long_dbl( solver, max_steps ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFSAINumLevels_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_levels ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetFSAINumLevels_flt( solver, num_levels ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetFSAINumLevels_dbl( solver, num_levels ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetFSAINumLevels_long_dbl( solver, num_levels ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFSAIThreshold_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double threshold ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetFSAIThreshold_flt( solver, threshold ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetFSAIThreshold_dbl( solver, threshold ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetFSAIThreshold_long_dbl( solver, threshold ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFilter_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double filter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetFilter_flt( solver, filter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetFilter_dbl( solver, filter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetFilter_long_dbl( solver, filter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFilterFunctions_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int filter_functions ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetFilterFunctions_flt( solver, filter_functions ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetFilterFunctions_dbl( solver, filter_functions ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetFilterFunctions_long_dbl( solver, filter_functions ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetFilterThresholdR_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double filter_threshold ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetFilterThresholdR_flt( solver, filter_threshold ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetFilterThresholdR_dbl( solver, filter_threshold ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetFilterThresholdR_long_dbl( solver, filter_threshold ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetGMRESSwitchR_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int gmres_switch ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetGMRESSwitchR_flt( solver, gmres_switch ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetGMRESSwitchR_dbl( solver, gmres_switch ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetGMRESSwitchR_long_dbl( solver, gmres_switch ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetGSMG_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int gsmg ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetGSMG_flt( solver, gsmg ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetGSMG_dbl( solver, gsmg ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetGSMG_long_dbl( solver, gsmg ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetGridRelaxPoints_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int **grid_relax_points ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetGridRelaxPoints_flt( solver, grid_relax_points ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetGridRelaxPoints_dbl( solver, grid_relax_points ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetGridRelaxPoints_long_dbl( solver, grid_relax_points ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetGridRelaxType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *grid_relax_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetGridRelaxType_flt( solver, grid_relax_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetGridRelaxType_dbl( solver, grid_relax_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetGridRelaxType_long_dbl( solver, grid_relax_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILUDroptol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double ilu_droptol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetILUDroptol_flt( solver, ilu_droptol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetILUDroptol_dbl( solver, ilu_droptol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetILUDroptol_long_dbl( solver, ilu_droptol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int ilu_iter_setup_max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetILUIterSetupMaxIter_flt( solver, ilu_iter_setup_max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetILUIterSetupMaxIter_dbl( solver, ilu_iter_setup_max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetILUIterSetupMaxIter_long_dbl( solver, ilu_iter_setup_max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupOption_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int ilu_iter_setup_option ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetILUIterSetupOption_flt( solver, ilu_iter_setup_option ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetILUIterSetupOption_dbl( solver, ilu_iter_setup_option ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetILUIterSetupOption_long_dbl( solver, ilu_iter_setup_option ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupTolerance_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double ilu_iter_setup_tolerance ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetILUIterSetupTolerance_flt( solver, ilu_iter_setup_tolerance ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetILUIterSetupTolerance_dbl( solver, ilu_iter_setup_tolerance ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetILUIterSetupTolerance_long_dbl( solver, ilu_iter_setup_tolerance ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILUIterSetupType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int ilu_iter_setup_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetILUIterSetupType_flt( solver, ilu_iter_setup_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetILUIterSetupType_dbl( solver, ilu_iter_setup_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetILUIterSetupType_long_dbl( solver, ilu_iter_setup_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILULevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int ilu_lfil ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetILULevel_flt( solver, ilu_lfil ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetILULevel_dbl( solver, ilu_lfil ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetILULevel_long_dbl( solver, ilu_lfil ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILULocalReordering_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int ilu_reordering_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetILULocalReordering_flt( solver, ilu_reordering_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetILULocalReordering_dbl( solver, ilu_reordering_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetILULocalReordering_long_dbl( solver, ilu_reordering_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILULowerJacobiIters_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int ilu_lower_jacobi_iters ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetILULowerJacobiIters_flt( solver, ilu_lower_jacobi_iters ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetILULowerJacobiIters_dbl( solver, ilu_lower_jacobi_iters ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetILULowerJacobiIters_long_dbl( solver, ilu_lower_jacobi_iters ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILUMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int ilu_max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetILUMaxIter_flt( solver, ilu_max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetILUMaxIter_dbl( solver, ilu_max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetILUMaxIter_long_dbl( solver, ilu_max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILUMaxRowNnz_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int ilu_max_row_nnz ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetILUMaxRowNnz_flt( solver, ilu_max_row_nnz ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetILUMaxRowNnz_dbl( solver, ilu_max_row_nnz ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetILUMaxRowNnz_long_dbl( solver, ilu_max_row_nnz ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILUTriSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int ilu_tri_solve ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetILUTriSolve_flt( solver, ilu_tri_solve ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetILUTriSolve_dbl( solver, ilu_tri_solve ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetILUTriSolve_long_dbl( solver, ilu_tri_solve ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILUType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int ilu_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetILUType_flt( solver, ilu_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetILUType_dbl( solver, ilu_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetILUType_long_dbl( solver, ilu_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetILUUpperJacobiIters_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int ilu_upper_jacobi_iters ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetILUUpperJacobiIters_flt( solver, ilu_upper_jacobi_iters ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetILUUpperJacobiIters_dbl( solver, ilu_upper_jacobi_iters ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetILUUpperJacobiIters_long_dbl( solver, ilu_upper_jacobi_iters ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetISType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int IS_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetISType_flt( solver, IS_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetISType_dbl( solver, IS_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetISType_long_dbl( solver, IS_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetInterpRefine_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_refine ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetInterpRefine_flt( solver, num_refine ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetInterpRefine_dbl( solver, num_refine ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetInterpRefine_long_dbl( solver, num_refine ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetInterpType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int interp_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetInterpType_flt( solver, interp_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetInterpType_dbl( solver, interp_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetInterpType_long_dbl( solver, interp_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetInterpVecAbsQTrunc_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double q_trunc ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetInterpVecAbsQTrunc_flt( solver, q_trunc ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetInterpVecAbsQTrunc_dbl( solver, q_trunc ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetInterpVecAbsQTrunc_long_dbl( solver, q_trunc ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetInterpVecQMax_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int q_max ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetInterpVecQMax_flt( solver, q_max ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetInterpVecQMax_dbl( solver, q_max ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetInterpVecQMax_long_dbl( solver, q_max ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetInterpVecVariant_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int var ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetInterpVecVariant_flt( solver, var ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetInterpVecVariant_dbl( solver, var ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetInterpVecVariant_long_dbl( solver, var ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetInterpVectors_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_vectors, HYPRE_ParVector *interp_vectors ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetInterpVectors_flt( solver, num_vectors, interp_vectors ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetInterpVectors_dbl( solver, num_vectors, interp_vectors ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetInterpVectors_long_dbl( solver, num_vectors, interp_vectors ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetIsTriangular_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int is_triangular ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetIsTriangular_flt( solver, is_triangular ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetIsTriangular_dbl( solver, is_triangular ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetIsTriangular_long_dbl( solver, is_triangular ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetIsolatedFPoints_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_isolated_fpt, HYPRE_BigInt *isolated_fpt_index ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetIsolatedFPoints_flt( solver, num_isolated_fpt, isolated_fpt_index ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetIsolatedFPoints_dbl( solver, num_isolated_fpt, isolated_fpt_index ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetIsolatedFPoints_long_dbl( solver, num_isolated_fpt, isolated_fpt_index ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetJacobiTruncThreshold_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double jacobi_trunc_threshold ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetJacobiTruncThreshold_flt( solver, jacobi_trunc_threshold ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetJacobiTruncThreshold_dbl( solver, jacobi_trunc_threshold ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetJacobiTruncThreshold_long_dbl( solver, jacobi_trunc_threshold ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetKeepSameSign_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int keep_same_sign ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetKeepSameSign_flt( solver, keep_same_sign ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetKeepSameSign_dbl( solver, keep_same_sign ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetKeepSameSign_long_dbl( solver, keep_same_sign ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetKeepTranspose_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int keepTranspose ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetKeepTranspose_flt( solver, keepTranspose ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetKeepTranspose_dbl( solver, keepTranspose ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetKeepTranspose_long_dbl( solver, keepTranspose ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetLevel_flt( solver, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetLevel_dbl( solver, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetLevel_long_dbl( solver, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetLevelNonGalerkinTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double nongalerkin_tol, HYPRE_Int level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetLevelNonGalerkinTol_flt( solver, nongalerkin_tol, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetLevelNonGalerkinTol_dbl( solver, nongalerkin_tol, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetLevelNonGalerkinTol_long_dbl( solver, nongalerkin_tol, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetLevelOuterWt_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double omega, HYPRE_Int level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetLevelOuterWt_flt( solver, omega, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetLevelOuterWt_dbl( solver, omega, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetLevelOuterWt_long_dbl( solver, omega, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetLevelRelaxWt_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double relax_weight, HYPRE_Int level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetLevelRelaxWt_flt( solver, relax_weight, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetLevelRelaxWt_dbl( solver, relax_weight, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetLevelRelaxWt_long_dbl( solver, relax_weight, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetMaxCoarseSize_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_coarse_size ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetMaxCoarseSize_flt( solver, max_coarse_size ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetMaxCoarseSize_dbl( solver, max_coarse_size ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetMaxCoarseSize_long_dbl( solver, max_coarse_size ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetMaxLevels_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_levels ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetMaxLevels_flt( solver, max_levels ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetMaxLevels_dbl( solver, max_levels ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetMaxLevels_long_dbl( solver, max_levels ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetMaxNzPerRow_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_nz_per_row ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetMaxNzPerRow_flt( solver, max_nz_per_row ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetMaxNzPerRow_dbl( solver, max_nz_per_row ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetMaxNzPerRow_long_dbl( solver, max_nz_per_row ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetMaxRowSum_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double max_row_sum ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetMaxRowSum_flt( solver, max_row_sum ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetMaxRowSum_dbl( solver, max_row_sum ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetMaxRowSum_long_dbl( solver, max_row_sum ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetMeasureType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int measure_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetMeasureType_flt( solver, measure_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetMeasureType_dbl( solver, measure_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetMeasureType_long_dbl( solver, measure_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetMinCoarseSize_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int min_coarse_size ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetMinCoarseSize_flt( solver, min_coarse_size ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetMinCoarseSize_dbl( solver, min_coarse_size ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetMinCoarseSize_long_dbl( solver, min_coarse_size ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int min_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetMinIter_flt( solver, min_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetMinIter_dbl( solver, min_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetMinIter_long_dbl( solver, min_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetModuleRAP2_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int mod_rap2 ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetModuleRAP2_flt( solver, mod_rap2 ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetModuleRAP2_dbl( solver, mod_rap2 ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetModuleRAP2_long_dbl( solver, mod_rap2 ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetMultAddPMaxElmts_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int add_P_max_elmts ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetMultAddPMaxElmts_flt( solver, add_P_max_elmts ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetMultAddPMaxElmts_dbl( solver, add_P_max_elmts ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetMultAddPMaxElmts_long_dbl( solver, add_P_max_elmts ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetMultAddTruncFactor_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double add_trunc_factor ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetMultAddTruncFactor_flt( solver, add_trunc_factor ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetMultAddTruncFactor_dbl( solver, add_trunc_factor ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetMultAddTruncFactor_long_dbl( solver, add_trunc_factor ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetMultAdditive_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int addlvl ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetMultAdditive_flt( solver, addlvl ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetMultAdditive_dbl( solver, addlvl ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetMultAdditive_long_dbl( solver, addlvl ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetNodal_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int nodal ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetNodal_flt( solver, nodal ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetNodal_dbl( solver, nodal ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetNodal_long_dbl( solver, nodal ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetNodalDiag_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int nodal_diag ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetNodalDiag_flt( solver, nodal_diag ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetNodalDiag_dbl( solver, nodal_diag ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetNodalDiag_long_dbl( solver, nodal_diag ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetNodalLevels_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int nodal_levels ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetNodalLevels_flt( solver, nodal_levels ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetNodalLevels_dbl( solver, nodal_levels ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetNodalLevels_long_dbl( solver, nodal_levels ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetNonGalerkTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int nongalerk_num_tol, void *nongalerk_tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetNonGalerkTol_flt( solver, nongalerk_num_tol, nongalerk_tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetNonGalerkTol_dbl( solver, nongalerk_num_tol, nongalerk_tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetNonGalerkTol_long_dbl( solver, nongalerk_num_tol, nongalerk_tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetNonGalerkinTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double nongalerkin_tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetNonGalerkinTol_flt( solver, nongalerkin_tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetNonGalerkinTol_dbl( solver, nongalerkin_tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetNonGalerkinTol_long_dbl( solver, nongalerkin_tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetNumCRRelaxSteps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_CR_relax_steps ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetNumCRRelaxSteps_flt( solver, num_CR_relax_steps ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetNumCRRelaxSteps_dbl( solver, num_CR_relax_steps ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetNumCRRelaxSteps_long_dbl( solver, num_CR_relax_steps ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetNumFunctions_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_functions ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetNumFunctions_flt( solver, num_functions ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetNumFunctions_dbl( solver, num_functions ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetNumFunctions_long_dbl( solver, num_functions ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetNumGridSweeps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_grid_sweeps ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetNumGridSweeps_flt( solver, num_grid_sweeps ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetNumGridSweeps_dbl( solver, num_grid_sweeps ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetNumGridSweeps_long_dbl( solver, num_grid_sweeps ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetNumPaths_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_paths ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetNumPaths_flt( solver, num_paths ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetNumPaths_dbl( solver, num_paths ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetNumPaths_long_dbl( solver, num_paths ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetNumSamples_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_samples ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetNumSamples_flt( solver, num_samples ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetNumSamples_dbl( solver, num_samples ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetNumSamples_long_dbl( solver, num_samples ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetNumSweeps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_sweeps ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetNumSweeps_flt( solver, num_sweeps ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetNumSweeps_dbl( solver, num_sweeps ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetNumSweeps_long_dbl( solver, num_sweeps ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetOldDefault_pre( HYPRE_Precision precision, HYPRE_Solver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetOldDefault_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetOldDefault_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetOldDefault_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetOmega_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *omega ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetOmega_flt( solver, omega ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetOmega_dbl( solver, omega ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetOmega_long_dbl( solver, omega ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetOuterWt_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double omega ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetOuterWt_flt( solver, omega ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetOuterWt_dbl( solver, omega ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetOuterWt_long_dbl( solver, omega ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetOverlap_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int overlap ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetOverlap_flt( solver, overlap ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetOverlap_dbl( solver, overlap ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetOverlap_long_dbl( solver, overlap ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetPMaxElmts_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int P_max_elmts ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetPMaxElmts_flt( solver, P_max_elmts ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetPMaxElmts_dbl( solver, P_max_elmts ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetPMaxElmts_long_dbl( solver, P_max_elmts ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetPlotFileName_pre( HYPRE_Precision precision, HYPRE_Solver solver, const char *plotfilename ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetPlotFileName_flt( solver, plotfilename ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetPlotFileName_dbl( solver, plotfilename ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetPlotFileName_long_dbl( solver, plotfilename ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetPlotGrids_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int plotgrids ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetPlotGrids_flt( solver, plotgrids ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetPlotGrids_dbl( solver, plotgrids ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetPlotGrids_long_dbl( solver, plotgrids ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetPostInterpType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int post_interp_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetPostInterpType_flt( solver, post_interp_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetPostInterpType_dbl( solver, post_interp_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetPostInterpType_long_dbl( solver, post_interp_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetPrintFileName_pre( HYPRE_Precision precision, HYPRE_Solver solver, const char *print_file_name ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetPrintFileName_flt( solver, print_file_name ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetPrintFileName_dbl( solver, print_file_name ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetPrintFileName_long_dbl( solver, print_file_name ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetPrintLevel_flt( solver, print_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetPrintLevel_dbl( solver, print_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetPrintLevel_long_dbl( solver, print_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetRAP2_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int rap2 ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetRAP2_flt( solver, rap2 ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetRAP2_dbl( solver, rap2 ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetRAP2_long_dbl( solver, rap2 ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetRedundant_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int redundant ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetRedundant_flt( solver, redundant ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetRedundant_dbl( solver, redundant ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetRedundant_long_dbl( solver, redundant ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetRelaxOrder_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int relax_order ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetRelaxOrder_flt( solver, relax_order ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetRelaxOrder_dbl( solver, relax_order ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetRelaxOrder_long_dbl( solver, relax_order ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetRelaxType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int relax_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetRelaxType_flt( solver, relax_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetRelaxType_dbl( solver, relax_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetRelaxType_long_dbl( solver, relax_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetRelaxWeight_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *relax_weight ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetRelaxWeight_flt( solver, relax_weight ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetRelaxWeight_dbl( solver, relax_weight ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetRelaxWeight_long_dbl( solver, relax_weight ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetRelaxWt_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double relax_weight ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetRelaxWt_flt( solver, relax_weight ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetRelaxWt_dbl( solver, relax_weight ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetRelaxWt_long_dbl( solver, relax_weight ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetRestriction_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int restr_par ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetRestriction_flt( solver, restr_par ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetRestriction_dbl( solver, restr_par ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetRestriction_long_dbl( solver, restr_par ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetSCommPkgSwitch_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double S_commpkg_switch ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetSCommPkgSwitch_flt( solver, S_commpkg_switch ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetSCommPkgSwitch_dbl( solver, S_commpkg_switch ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetSCommPkgSwitch_long_dbl( solver, S_commpkg_switch ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetSabs_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int Sabs ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetSabs_flt( solver, Sabs ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetSabs_dbl( solver, Sabs ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetSabs_long_dbl( solver, Sabs ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetSchwarzRlxWeight_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double schwarz_rlx_weight ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetSchwarzRlxWeight_flt( solver, schwarz_rlx_weight ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetSchwarzRlxWeight_dbl( solver, schwarz_rlx_weight ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetSchwarzRlxWeight_long_dbl( solver, schwarz_rlx_weight ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetSchwarzUseNonSymm_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int use_nonsymm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetSchwarzUseNonSymm_flt( solver, use_nonsymm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetSchwarzUseNonSymm_dbl( solver, use_nonsymm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetSchwarzUseNonSymm_long_dbl( solver, use_nonsymm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetSepWeight_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int sep_weight ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetSepWeight_flt( solver, sep_weight ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetSepWeight_dbl( solver, sep_weight ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetSepWeight_long_dbl( solver, sep_weight ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetSeqThreshold_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int seq_threshold ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetSeqThreshold_flt( solver, seq_threshold ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetSeqThreshold_dbl( solver, seq_threshold ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetSeqThreshold_long_dbl( solver, seq_threshold ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetSetupType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int setup_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetSetupType_flt( solver, setup_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetSetupType_dbl( solver, setup_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetSetupType_long_dbl( solver, setup_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetSimple_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int addlvl ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetSimple_flt( solver, addlvl ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetSimple_dbl( solver, addlvl ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetSimple_long_dbl( solver, addlvl ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetSmoothInterpVectors_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int smooth_interp_vectors ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetSmoothInterpVectors_flt( solver, smooth_interp_vectors ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetSmoothInterpVectors_dbl( solver, smooth_interp_vectors ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetSmoothInterpVectors_long_dbl( solver, smooth_interp_vectors ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetSmoothNumLevels_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int smooth_num_levels ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetSmoothNumLevels_flt( solver, smooth_num_levels ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetSmoothNumLevels_dbl( solver, smooth_num_levels ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetSmoothNumLevels_long_dbl( solver, smooth_num_levels ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetSmoothNumSweeps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int smooth_num_sweeps ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetSmoothNumSweeps_flt( solver, smooth_num_sweeps ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetSmoothNumSweeps_dbl( solver, smooth_num_sweeps ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetSmoothNumSweeps_long_dbl( solver, smooth_num_sweeps ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetSmoothType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int smooth_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetSmoothType_flt( solver, smooth_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetSmoothType_dbl( solver, smooth_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetSmoothType_long_dbl( solver, smooth_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetStrongThreshold_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double strong_threshold ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetStrongThreshold_flt( solver, strong_threshold ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetStrongThreshold_dbl( solver, strong_threshold ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetStrongThreshold_long_dbl( solver, strong_threshold ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetStrongThresholdR_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double strong_threshold ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetStrongThresholdR_flt( solver, strong_threshold ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetStrongThresholdR_dbl( solver, strong_threshold ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetStrongThresholdR_long_dbl( solver, strong_threshold ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetSym_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int sym ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetSym_flt( solver, sym ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetSym_dbl( solver, sym ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetSym_long_dbl( solver, sym ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetThreshold_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double threshold ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetThreshold_flt( solver, threshold ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetThreshold_dbl( solver, threshold ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetThreshold_long_dbl( solver, threshold ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetTruncFactor_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double trunc_factor ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetTruncFactor_flt( solver, trunc_factor ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetTruncFactor_dbl( solver, trunc_factor ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetTruncFactor_long_dbl( solver, trunc_factor ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetVariant_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int variant ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetVariant_flt( solver, variant ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetVariant_dbl( solver, variant ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetVariant_long_dbl( solver, variant ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_BoomerAMGSolveT_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_BoomerAMGSolveT_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_BoomerAMGSolveT_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_BoomerAMGSolveT_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_EuclidCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_Solver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_EuclidCreate_flt( comm, solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_EuclidCreate_dbl( comm, solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_EuclidCreate_long_dbl( comm, solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_EuclidDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_EuclidDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_EuclidDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_EuclidDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_EuclidSetBJ_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int bj ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_EuclidSetBJ_flt( solver, bj ); + case HYPRE_REAL_DOUBLE: + return HYPRE_EuclidSetBJ_dbl( solver, bj ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_EuclidSetBJ_long_dbl( solver, bj ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_EuclidSetILUT_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double drop_tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_EuclidSetILUT_flt( solver, drop_tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_EuclidSetILUT_dbl( solver, drop_tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_EuclidSetILUT_long_dbl( solver, drop_tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_EuclidSetLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_EuclidSetLevel_flt( solver, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_EuclidSetLevel_dbl( solver, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_EuclidSetLevel_long_dbl( solver, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_EuclidSetMem_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int eu_mem ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_EuclidSetMem_flt( solver, eu_mem ); + case HYPRE_REAL_DOUBLE: + return HYPRE_EuclidSetMem_dbl( solver, eu_mem ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_EuclidSetMem_long_dbl( solver, eu_mem ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_EuclidSetParams_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int argc, char *argv[] ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_EuclidSetParams_flt( solver, argc, argv ); + case HYPRE_REAL_DOUBLE: + return HYPRE_EuclidSetParams_dbl( solver, argc, argv ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_EuclidSetParams_long_dbl( solver, argc, argv ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_EuclidSetParamsFromFile_pre( HYPRE_Precision precision, HYPRE_Solver solver, char *filename ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_EuclidSetParamsFromFile_flt( solver, filename ); + case HYPRE_REAL_DOUBLE: + return HYPRE_EuclidSetParamsFromFile_dbl( solver, filename ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_EuclidSetParamsFromFile_long_dbl( solver, filename ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_EuclidSetRowScale_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int row_scale ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_EuclidSetRowScale_flt( solver, row_scale ); + case HYPRE_REAL_DOUBLE: + return HYPRE_EuclidSetRowScale_dbl( solver, row_scale ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_EuclidSetRowScale_long_dbl( solver, row_scale ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_EuclidSetSparseA_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double sparse_A ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_EuclidSetSparseA_flt( solver, sparse_A ); + case HYPRE_REAL_DOUBLE: + return HYPRE_EuclidSetSparseA_dbl( solver, sparse_A ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_EuclidSetSparseA_long_dbl( solver, sparse_A ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_EuclidSetStats_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int eu_stats ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_EuclidSetStats_flt( solver, eu_stats ); + case HYPRE_REAL_DOUBLE: + return HYPRE_EuclidSetStats_dbl( solver, eu_stats ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_EuclidSetStats_long_dbl( solver, eu_stats ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_EuclidSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_EuclidSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_EuclidSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_EuclidSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_EuclidSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_EuclidSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_EuclidSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_EuclidSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAICreate_pre( HYPRE_Precision precision, HYPRE_Solver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FSAICreate_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FSAICreate_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FSAICreate_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAIDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FSAIDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FSAIDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FSAIDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetAlgoType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int algo_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FSAISetAlgoType_flt( solver, algo_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FSAISetAlgoType_dbl( solver, algo_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FSAISetAlgoType_long_dbl( solver, algo_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetEigMaxIters_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int eig_max_iters ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FSAISetEigMaxIters_flt( solver, eig_max_iters ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FSAISetEigMaxIters_dbl( solver, eig_max_iters ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FSAISetEigMaxIters_long_dbl( solver, eig_max_iters ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetKapTolerance_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double kap_tolerance ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FSAISetKapTolerance_flt( solver, kap_tolerance ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FSAISetKapTolerance_dbl( solver, kap_tolerance ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FSAISetKapTolerance_long_dbl( solver, kap_tolerance ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetLocalSolveType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int local_solve_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FSAISetLocalSolveType_flt( solver, local_solve_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FSAISetLocalSolveType_dbl( solver, local_solve_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FSAISetLocalSolveType_long_dbl( solver, local_solve_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetMaxIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FSAISetMaxIterations_flt( solver, max_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FSAISetMaxIterations_dbl( solver, max_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FSAISetMaxIterations_long_dbl( solver, max_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetMaxNnzRow_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_nnz_row ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FSAISetMaxNnzRow_flt( solver, max_nnz_row ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FSAISetMaxNnzRow_dbl( solver, max_nnz_row ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FSAISetMaxNnzRow_long_dbl( solver, max_nnz_row ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetMaxStepSize_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_step_size ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FSAISetMaxStepSize_flt( solver, max_step_size ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FSAISetMaxStepSize_dbl( solver, max_step_size ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FSAISetMaxStepSize_long_dbl( solver, max_step_size ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetMaxSteps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_steps ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FSAISetMaxSteps_flt( solver, max_steps ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FSAISetMaxSteps_dbl( solver, max_steps ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FSAISetMaxSteps_long_dbl( solver, max_steps ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetNumLevels_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_levels ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FSAISetNumLevels_flt( solver, num_levels ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FSAISetNumLevels_dbl( solver, num_levels ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FSAISetNumLevels_long_dbl( solver, num_levels ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetOmega_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double omega ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FSAISetOmega_flt( solver, omega ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FSAISetOmega_dbl( solver, omega ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FSAISetOmega_long_dbl( solver, omega ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FSAISetPrintLevel_flt( solver, print_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FSAISetPrintLevel_dbl( solver, print_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FSAISetPrintLevel_long_dbl( solver, print_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetThreshold_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double threshold ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FSAISetThreshold_flt( solver, threshold ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FSAISetThreshold_dbl( solver, threshold ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FSAISetThreshold_long_dbl( solver, threshold ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetTolerance_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tolerance ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FSAISetTolerance_flt( solver, tolerance ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FSAISetTolerance_dbl( solver, tolerance ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FSAISetTolerance_long_dbl( solver, tolerance ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetZeroGuess_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int zero_guess ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FSAISetZeroGuess_flt( solver, zero_guess ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FSAISetZeroGuess_dbl( solver, zero_guess ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FSAISetZeroGuess_long_dbl( solver, zero_guess ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FSAISetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FSAISetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FSAISetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_FSAISolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_FSAISolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_FSAISolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_FSAISolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUCreate_pre( HYPRE_Precision precision, HYPRE_Solver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ILUCreate_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ILUCreate_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ILUCreate_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ILUDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ILUDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ILUDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *res_norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ILUGetFinalRelativeResidualNorm_flt( solver, res_norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ILUGetFinalRelativeResidualNorm_dbl( solver, res_norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ILUGetFinalRelativeResidualNorm_long_dbl( solver, res_norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ILUGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ILUGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ILUGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetDropThreshold_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double threshold ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ILUSetDropThreshold_flt( solver, threshold ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ILUSetDropThreshold_dbl( solver, threshold ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ILUSetDropThreshold_long_dbl( solver, threshold ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetDropThresholdArray_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *threshold ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ILUSetDropThresholdArray_flt( solver, threshold ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ILUSetDropThresholdArray_dbl( solver, threshold ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ILUSetDropThresholdArray_long_dbl( solver, threshold ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetIterativeSetupMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int iter_setup_max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ILUSetIterativeSetupMaxIter_flt( solver, iter_setup_max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ILUSetIterativeSetupMaxIter_dbl( solver, iter_setup_max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ILUSetIterativeSetupMaxIter_long_dbl( solver, iter_setup_max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetIterativeSetupOption_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int iter_setup_option ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ILUSetIterativeSetupOption_flt( solver, iter_setup_option ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ILUSetIterativeSetupOption_dbl( solver, iter_setup_option ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ILUSetIterativeSetupOption_long_dbl( solver, iter_setup_option ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetIterativeSetupTolerance_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double iter_setup_tolerance ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ILUSetIterativeSetupTolerance_flt( solver, iter_setup_tolerance ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ILUSetIterativeSetupTolerance_dbl( solver, iter_setup_tolerance ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ILUSetIterativeSetupTolerance_long_dbl( solver, iter_setup_tolerance ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetIterativeSetupType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int iter_setup_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ILUSetIterativeSetupType_flt( solver, iter_setup_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ILUSetIterativeSetupType_dbl( solver, iter_setup_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ILUSetIterativeSetupType_long_dbl( solver, iter_setup_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetLevelOfFill_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int lfil ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ILUSetLevelOfFill_flt( solver, lfil ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ILUSetLevelOfFill_dbl( solver, lfil ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ILUSetLevelOfFill_long_dbl( solver, lfil ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetLocalReordering_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int reordering_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ILUSetLocalReordering_flt( solver, reordering_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ILUSetLocalReordering_dbl( solver, reordering_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ILUSetLocalReordering_long_dbl( solver, reordering_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ILUSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ILUSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ILUSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetLowerJacobiIters_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int lower_jacobi_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ILUSetLowerJacobiIters_flt( solver, lower_jacobi_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ILUSetLowerJacobiIters_dbl( solver, lower_jacobi_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ILUSetLowerJacobiIters_long_dbl( solver, lower_jacobi_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ILUSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ILUSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ILUSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetMaxNnzPerRow_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int nzmax ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ILUSetMaxNnzPerRow_flt( solver, nzmax ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ILUSetMaxNnzPerRow_dbl( solver, nzmax ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ILUSetMaxNnzPerRow_long_dbl( solver, nzmax ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetNSHDropThreshold_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double threshold ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ILUSetNSHDropThreshold_flt( solver, threshold ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ILUSetNSHDropThreshold_dbl( solver, threshold ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ILUSetNSHDropThreshold_long_dbl( solver, threshold ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetNSHDropThresholdArray_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *threshold ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ILUSetNSHDropThresholdArray_flt( solver, threshold ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ILUSetNSHDropThresholdArray_dbl( solver, threshold ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ILUSetNSHDropThresholdArray_long_dbl( solver, threshold ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ILUSetPrintLevel_flt( solver, print_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ILUSetPrintLevel_dbl( solver, print_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ILUSetPrintLevel_long_dbl( solver, print_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetSchurMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int ss_max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ILUSetSchurMaxIter_flt( solver, ss_max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ILUSetSchurMaxIter_dbl( solver, ss_max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ILUSetSchurMaxIter_long_dbl( solver, ss_max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ILUSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ILUSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ILUSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetTriSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int tri_solve ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ILUSetTriSolve_flt( solver, tri_solve ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ILUSetTriSolve_dbl( solver, tri_solve ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ILUSetTriSolve_long_dbl( solver, tri_solve ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int ilu_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ILUSetType_flt( solver, ilu_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ILUSetType_dbl( solver, ilu_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ILUSetType_long_dbl( solver, ilu_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetUpperJacobiIters_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int upper_jacobi_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ILUSetUpperJacobiIters_flt( solver, upper_jacobi_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ILUSetUpperJacobiIters_dbl( solver, upper_jacobi_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ILUSetUpperJacobiIters_long_dbl( solver, upper_jacobi_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ILUSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ILUSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ILUSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ILUSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ILUSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ILUSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ILUSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRBuildAff_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix A, HYPRE_Int *CF_marker, HYPRE_Int debug_flag, HYPRE_ParCSRMatrix *A_ff ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRBuildAff_flt( A, CF_marker, debug_flag, A_ff ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRBuildAff_dbl( A, CF_marker, debug_flag, A_ff ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRBuildAff_long_dbl( A, CF_marker, debug_flag, A_ff ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRCreate_pre( HYPRE_Precision precision, HYPRE_Solver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRCreate_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRCreate_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRCreate_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRGetCoarseGridConvergenceFactor_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *conv_factor ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRGetCoarseGridConvergenceFactor_flt( solver, conv_factor ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRGetCoarseGridConvergenceFactor_dbl( solver, conv_factor ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRGetCoarseGridConvergenceFactor_long_dbl( solver, conv_factor ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *res_norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRGetFinalRelativeResidualNorm_flt( solver, res_norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRGetFinalRelativeResidualNorm_dbl( solver, res_norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRGetFinalRelativeResidualNorm_long_dbl( solver, res_norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetBlockJacobiBlockSize_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int blk_size ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetBlockJacobiBlockSize_flt( solver, blk_size ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetBlockJacobiBlockSize_dbl( solver, blk_size ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetBlockJacobiBlockSize_long_dbl( solver, blk_size ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetBlockSize_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int bsize ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetBlockSize_flt( solver, bsize ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetBlockSize_dbl( solver, bsize ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetBlockSize_long_dbl( solver, bsize ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetCoarseGridMethod_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *cg_method ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetCoarseGridMethod_flt( solver, cg_method ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetCoarseGridMethod_dbl( solver, cg_method ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetCoarseGridMethod_long_dbl( solver, cg_method ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetCoarseGridPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetCoarseGridPrintLevel_flt( solver, print_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetCoarseGridPrintLevel_dbl( solver, print_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetCoarseGridPrintLevel_long_dbl( solver, print_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetCoarseSolver_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToParSolverFcn coarse_grid_solver_solve, HYPRE_PtrToParSolverFcn coarse_grid_solver_setup, HYPRE_Solver coarse_grid_solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetCoarseSolver_flt( solver, coarse_grid_solver_solve, coarse_grid_solver_setup, coarse_grid_solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetCoarseSolver_dbl( solver, coarse_grid_solver_solve, coarse_grid_solver_setup, coarse_grid_solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetCoarseSolver_long_dbl( solver, coarse_grid_solver_solve, coarse_grid_solver_setup, coarse_grid_solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetCpointsByBlock_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int block_size, HYPRE_Int max_num_levels, HYPRE_Int *num_block_coarse_points, HYPRE_Int **block_coarse_indexes ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetCpointsByBlock_flt( solver, block_size, max_num_levels, num_block_coarse_points, block_coarse_indexes ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetCpointsByBlock_dbl( solver, block_size, max_num_levels, num_block_coarse_points, block_coarse_indexes ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetCpointsByBlock_long_dbl( solver, block_size, max_num_levels, num_block_coarse_points, block_coarse_indexes ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetCpointsByContiguousBlock_pre( HYPRE_Precision precision, 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 ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetCpointsByContiguousBlock_flt( solver, block_size, max_num_levels, idx_array, num_block_coarse_points, block_coarse_indexes ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetCpointsByContiguousBlock_dbl( solver, block_size, max_num_levels, idx_array, num_block_coarse_points, block_coarse_indexes ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetCpointsByContiguousBlock_long_dbl( solver, block_size, max_num_levels, idx_array, num_block_coarse_points, block_coarse_indexes ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetCpointsByPointMarkerArray_pre( HYPRE_Precision precision, 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 ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetCpointsByPointMarkerArray_flt( solver, block_size, max_num_levels, num_block_coarse_points, lvl_block_coarse_indexes, point_marker_array ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetCpointsByPointMarkerArray_dbl( solver, block_size, max_num_levels, num_block_coarse_points, lvl_block_coarse_indexes, point_marker_array ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetCpointsByPointMarkerArray_long_dbl( solver, block_size, max_num_levels, num_block_coarse_points, lvl_block_coarse_indexes, point_marker_array ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetFRelaxMethod_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int relax_method ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetFRelaxMethod_flt( solver, relax_method ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetFRelaxMethod_dbl( solver, relax_method ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetFRelaxMethod_long_dbl( solver, relax_method ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetFSolver_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToParSolverFcn fine_grid_solver_solve, HYPRE_PtrToParSolverFcn fine_grid_solver_setup, HYPRE_Solver fsolver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetFSolver_flt( solver, fine_grid_solver_solve, fine_grid_solver_setup, fsolver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetFSolver_dbl( solver, fine_grid_solver_solve, fine_grid_solver_setup, fsolver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetFSolver_long_dbl( solver, fine_grid_solver_solve, fine_grid_solver_setup, fsolver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetFSolverAtLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver fsolver, HYPRE_Int level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetFSolverAtLevel_flt( solver, fsolver, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetFSolverAtLevel_dbl( solver, fsolver, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetFSolverAtLevel_long_dbl( solver, fsolver, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetFrelaxPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetFrelaxPrintLevel_flt( solver, print_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetFrelaxPrintLevel_dbl( solver, print_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetFrelaxPrintLevel_long_dbl( solver, print_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetGlobalSmoothCycle_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int global_smooth_cycle ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetGlobalSmoothCycle_flt( solver, global_smooth_cycle ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetGlobalSmoothCycle_dbl( solver, global_smooth_cycle ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetGlobalSmoothCycle_long_dbl( solver, global_smooth_cycle ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetGlobalSmoothType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int smooth_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetGlobalSmoothType_flt( solver, smooth_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetGlobalSmoothType_dbl( solver, smooth_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetGlobalSmoothType_long_dbl( solver, smooth_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetGlobalSmootherAtLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver smoother, HYPRE_Int level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetGlobalSmootherAtLevel_flt( solver, smoother, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetGlobalSmootherAtLevel_dbl( solver, smoother, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetGlobalSmootherAtLevel_long_dbl( solver, smoother, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetInterpType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int interp_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetInterpType_flt( solver, interp_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetInterpType_dbl( solver, interp_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetInterpType_long_dbl( solver, interp_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetLevelFRelaxMethod_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *relax_method ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetLevelFRelaxMethod_flt( solver, relax_method ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetLevelFRelaxMethod_dbl( solver, relax_method ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetLevelFRelaxMethod_long_dbl( solver, relax_method ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetLevelFRelaxNumFunctions_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_functions ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetLevelFRelaxNumFunctions_flt( solver, num_functions ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetLevelFRelaxNumFunctions_dbl( solver, num_functions ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetLevelFRelaxNumFunctions_long_dbl( solver, num_functions ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetLevelFRelaxType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *relax_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetLevelFRelaxType_flt( solver, relax_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetLevelFRelaxType_dbl( solver, relax_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetLevelFRelaxType_long_dbl( solver, relax_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetLevelInterpType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *interp_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetLevelInterpType_flt( solver, interp_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetLevelInterpType_dbl( solver, interp_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetLevelInterpType_long_dbl( solver, interp_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetLevelNonGalerkinMaxElmts_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *max_elmts ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetLevelNonGalerkinMaxElmts_flt( solver, max_elmts ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetLevelNonGalerkinMaxElmts_dbl( solver, max_elmts ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetLevelNonGalerkinMaxElmts_long_dbl( solver, max_elmts ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetLevelNumRelaxSweeps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *nsweeps ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetLevelNumRelaxSweeps_flt( solver, nsweeps ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetLevelNumRelaxSweeps_dbl( solver, nsweeps ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetLevelNumRelaxSweeps_long_dbl( solver, nsweeps ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetLevelPMaxElmts_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *P_max_elmts ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetLevelPMaxElmts_flt( solver, P_max_elmts ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetLevelPMaxElmts_dbl( solver, P_max_elmts ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetLevelPMaxElmts_long_dbl( solver, P_max_elmts ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetLevelRestrictType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *restrict_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetLevelRestrictType_flt( solver, restrict_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetLevelRestrictType_dbl( solver, restrict_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetLevelRestrictType_long_dbl( solver, restrict_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetLevelSmoothIters_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *smooth_iters ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetLevelSmoothIters_flt( solver, smooth_iters ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetLevelSmoothIters_dbl( solver, smooth_iters ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetLevelSmoothIters_long_dbl( solver, smooth_iters ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetLevelSmoothType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *smooth_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetLevelSmoothType_flt( solver, smooth_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetLevelSmoothType_dbl( solver, smooth_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetLevelSmoothType_long_dbl( solver, smooth_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetMaxCoarseLevels_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int maxlev ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetMaxCoarseLevels_flt( solver, maxlev ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetMaxCoarseLevels_dbl( solver, maxlev ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetMaxCoarseLevels_long_dbl( solver, maxlev ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetMaxGlobalSmoothIters_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int smooth_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetMaxGlobalSmoothIters_flt( solver, smooth_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetMaxGlobalSmoothIters_dbl( solver, smooth_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetMaxGlobalSmoothIters_long_dbl( solver, smooth_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetNonCpointsToFpoints_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int nonCptToFptFlag ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetNonCpointsToFpoints_flt( solver, nonCptToFptFlag ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetNonCpointsToFpoints_dbl( solver, nonCptToFptFlag ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetNonCpointsToFpoints_long_dbl( solver, nonCptToFptFlag ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetNonGalerkinMaxElmts_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_elmts ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetNonGalerkinMaxElmts_flt( solver, max_elmts ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetNonGalerkinMaxElmts_dbl( solver, max_elmts ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetNonGalerkinMaxElmts_long_dbl( solver, max_elmts ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetNumInterpSweeps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int nsweeps ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetNumInterpSweeps_flt( solver, nsweeps ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetNumInterpSweeps_dbl( solver, nsweeps ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetNumInterpSweeps_long_dbl( solver, nsweeps ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetNumRelaxSweeps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int nsweeps ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetNumRelaxSweeps_flt( solver, nsweeps ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetNumRelaxSweeps_dbl( solver, nsweeps ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetNumRelaxSweeps_long_dbl( solver, nsweeps ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetNumRestrictSweeps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int nsweeps ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetNumRestrictSweeps_flt( solver, nsweeps ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetNumRestrictSweeps_dbl( solver, nsweeps ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetNumRestrictSweeps_long_dbl( solver, nsweeps ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetPMaxElmts_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int P_max_elmts ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetPMaxElmts_flt( solver, P_max_elmts ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetPMaxElmts_dbl( solver, P_max_elmts ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetPMaxElmts_long_dbl( solver, P_max_elmts ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetPrintLevel_flt( solver, print_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetPrintLevel_dbl( solver, print_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetPrintLevel_long_dbl( solver, print_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetRelaxType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int relax_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetRelaxType_flt( solver, relax_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetRelaxType_dbl( solver, relax_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetRelaxType_long_dbl( solver, relax_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetReservedCoarseNodes_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int reserved_coarse_size, HYPRE_BigInt *reserved_coarse_nodes ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetReservedCoarseNodes_flt( solver, reserved_coarse_size, reserved_coarse_nodes ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetReservedCoarseNodes_dbl( solver, reserved_coarse_size, reserved_coarse_nodes ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetReservedCoarseNodes_long_dbl( solver, reserved_coarse_size, reserved_coarse_nodes ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetReservedCpointsLevelToKeep_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetReservedCpointsLevelToKeep_flt( solver, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetReservedCpointsLevelToKeep_dbl( solver, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetReservedCpointsLevelToKeep_long_dbl( solver, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetRestrictType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int restrict_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetRestrictType_flt( solver, restrict_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetRestrictType_dbl( solver, restrict_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetRestrictType_long_dbl( solver, restrict_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetTruncateCoarseGridThreshold_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double threshold ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetTruncateCoarseGridThreshold_flt( solver, threshold ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetTruncateCoarseGridThreshold_dbl( solver, threshold ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetTruncateCoarseGridThreshold_long_dbl( solver, threshold ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MGRSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MGRSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MGRSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MGRSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_Solver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRBiCGSTABCreate_flt( comm, solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRBiCGSTABCreate_dbl( comm, solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRBiCGSTABCreate_long_dbl( comm, solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRBiCGSTABDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRBiCGSTABDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRBiCGSTABDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRBiCGSTABGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRBiCGSTABGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRBiCGSTABGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRBiCGSTABGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRBiCGSTABGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRBiCGSTABGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABGetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *precond_data ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRBiCGSTABGetPrecond_flt( solver, precond_data ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRBiCGSTABGetPrecond_dbl( solver, precond_data ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRBiCGSTABGetPrecond_long_dbl( solver, precond_data ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABGetResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParVector *residual ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRBiCGSTABGetResidual_flt( solver, residual ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRBiCGSTABGetResidual_dbl( solver, residual ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRBiCGSTABGetResidual_long_dbl( solver, residual ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double a_tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRBiCGSTABSetAbsoluteTol_flt( solver, a_tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRBiCGSTABSetAbsoluteTol_dbl( solver, a_tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRBiCGSTABSetAbsoluteTol_long_dbl( solver, a_tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRBiCGSTABSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRBiCGSTABSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRBiCGSTABSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRBiCGSTABSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRBiCGSTABSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRBiCGSTABSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int min_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRBiCGSTABSetMinIter_flt( solver, min_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRBiCGSTABSetMinIter_dbl( solver, min_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRBiCGSTABSetMinIter_long_dbl( solver, min_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRBiCGSTABSetPrecond_flt( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRBiCGSTABSetPrecond_dbl( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRBiCGSTABSetPrecond_long_dbl( solver, precond, precond_setup, precond_solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRBiCGSTABSetPrintLevel_flt( solver, print_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRBiCGSTABSetPrintLevel_dbl( solver, print_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRBiCGSTABSetPrintLevel_long_dbl( solver, print_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetStopCrit_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int stop_crit ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRBiCGSTABSetStopCrit_flt( solver, stop_crit ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRBiCGSTABSetStopCrit_dbl( solver, stop_crit ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRBiCGSTABSetStopCrit_long_dbl( solver, stop_crit ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRBiCGSTABSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRBiCGSTABSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRBiCGSTABSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRBiCGSTABSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRBiCGSTABSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRBiCGSTABSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRBiCGSTABSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRBiCGSTABSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRBiCGSTABSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRBiCGSTABSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCGNRCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_Solver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRCGNRCreate_flt( comm, solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRCGNRCreate_dbl( comm, solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRCGNRCreate_long_dbl( comm, solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCGNRDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRCGNRDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRCGNRDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRCGNRDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCGNRGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRCGNRGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRCGNRGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRCGNRGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCGNRGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRCGNRGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRCGNRGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRCGNRGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCGNRGetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *precond_data ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRCGNRGetPrecond_flt( solver, precond_data ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRCGNRGetPrecond_dbl( solver, precond_data ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRCGNRGetPrecond_long_dbl( solver, precond_data ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCGNRSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRCGNRSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRCGNRSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRCGNRSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCGNRSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRCGNRSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRCGNRSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRCGNRSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCGNRSetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int min_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRCGNRSetMinIter_flt( solver, min_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRCGNRSetMinIter_dbl( solver, min_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRCGNRSetMinIter_long_dbl( solver, min_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCGNRSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precondT, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRCGNRSetPrecond_flt( solver, precond, precondT, precond_setup, precond_solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRCGNRSetPrecond_dbl( solver, precond, precondT, precond_setup, precond_solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRCGNRSetPrecond_long_dbl( solver, precond, precondT, precond_setup, precond_solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCGNRSetStopCrit_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int stop_crit ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRCGNRSetStopCrit_flt( solver, stop_crit ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRCGNRSetStopCrit_dbl( solver, stop_crit ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRCGNRSetStopCrit_long_dbl( solver, stop_crit ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCGNRSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRCGNRSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRCGNRSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRCGNRSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCGNRSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRCGNRSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRCGNRSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRCGNRSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCGNRSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRCGNRSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRCGNRSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRCGNRSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_Solver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRCOGMRESCreate_flt( comm, solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRCOGMRESCreate_dbl( comm, solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRCOGMRESCreate_long_dbl( comm, solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRCOGMRESDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRCOGMRESDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRCOGMRESDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRCOGMRESGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRCOGMRESGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRCOGMRESGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRCOGMRESGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRCOGMRESGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRCOGMRESGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESGetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *precond_data ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRCOGMRESGetPrecond_flt( solver, precond_data ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRCOGMRESGetPrecond_dbl( solver, precond_data ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRCOGMRESGetPrecond_long_dbl( solver, precond_data ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESGetResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParVector *residual ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRCOGMRESGetResidual_flt( solver, residual ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRCOGMRESGetResidual_dbl( solver, residual ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRCOGMRESGetResidual_long_dbl( solver, residual ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double a_tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRCOGMRESSetAbsoluteTol_flt( solver, a_tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRCOGMRESSetAbsoluteTol_dbl( solver, a_tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRCOGMRESSetAbsoluteTol_long_dbl( solver, a_tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetCGS_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int cgs ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRCOGMRESSetCGS_flt( solver, cgs ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRCOGMRESSetCGS_dbl( solver, cgs ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRCOGMRESSetCGS_long_dbl( solver, cgs ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetKDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int k_dim ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRCOGMRESSetKDim_flt( solver, k_dim ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRCOGMRESSetKDim_dbl( solver, k_dim ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRCOGMRESSetKDim_long_dbl( solver, k_dim ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRCOGMRESSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRCOGMRESSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRCOGMRESSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRCOGMRESSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRCOGMRESSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRCOGMRESSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int min_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRCOGMRESSetMinIter_flt( solver, min_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRCOGMRESSetMinIter_dbl( solver, min_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRCOGMRESSetMinIter_long_dbl( solver, min_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRCOGMRESSetPrecond_flt( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRCOGMRESSetPrecond_dbl( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRCOGMRESSetPrecond_long_dbl( solver, precond, precond_setup, precond_solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRCOGMRESSetPrintLevel_flt( solver, print_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRCOGMRESSetPrintLevel_dbl( solver, print_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRCOGMRESSetPrintLevel_long_dbl( solver, print_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRCOGMRESSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRCOGMRESSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRCOGMRESSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetUnroll_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int unroll ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRCOGMRESSetUnroll_flt( solver, unroll ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRCOGMRESSetUnroll_dbl( solver, unroll ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRCOGMRESSetUnroll_long_dbl( solver, unroll ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRCOGMRESSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRCOGMRESSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRCOGMRESSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRCOGMRESSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRCOGMRESSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRCOGMRESSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRCOGMRESSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRDiagScale_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix HA, HYPRE_ParVector Hy, HYPRE_ParVector Hx ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRDiagScale_flt( solver, HA, Hy, Hx ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRDiagScale_dbl( solver, HA, Hy, Hx ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRDiagScale_long_dbl( solver, HA, Hy, Hx ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRDiagScaleSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector y, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRDiagScaleSetup_flt( solver, A, y, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRDiagScaleSetup_dbl( solver, A, y, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRDiagScaleSetup_long_dbl( solver, A, y, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_Solver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRFlexGMRESCreate_flt( comm, solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRFlexGMRESCreate_dbl( comm, solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRFlexGMRESCreate_long_dbl( comm, solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRFlexGMRESDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRFlexGMRESDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRFlexGMRESDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRFlexGMRESGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRFlexGMRESGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRFlexGMRESGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRFlexGMRESGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRFlexGMRESGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRFlexGMRESGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESGetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *precond_data ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRFlexGMRESGetPrecond_flt( solver, precond_data ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRFlexGMRESGetPrecond_dbl( solver, precond_data ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRFlexGMRESGetPrecond_long_dbl( solver, precond_data ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESGetResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParVector *residual ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRFlexGMRESGetResidual_flt( solver, residual ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRFlexGMRESGetResidual_dbl( solver, residual ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRFlexGMRESGetResidual_long_dbl( solver, residual ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double a_tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRFlexGMRESSetAbsoluteTol_flt( solver, a_tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRFlexGMRESSetAbsoluteTol_dbl( solver, a_tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRFlexGMRESSetAbsoluteTol_long_dbl( solver, a_tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetKDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int k_dim ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRFlexGMRESSetKDim_flt( solver, k_dim ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRFlexGMRESSetKDim_dbl( solver, k_dim ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRFlexGMRESSetKDim_long_dbl( solver, k_dim ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRFlexGMRESSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRFlexGMRESSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRFlexGMRESSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRFlexGMRESSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRFlexGMRESSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRFlexGMRESSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int min_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRFlexGMRESSetMinIter_flt( solver, min_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRFlexGMRESSetMinIter_dbl( solver, min_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRFlexGMRESSetMinIter_long_dbl( solver, min_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetModifyPC_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToModifyPCFcn modify_pc ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRFlexGMRESSetModifyPC_flt( solver, modify_pc ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRFlexGMRESSetModifyPC_dbl( solver, modify_pc ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRFlexGMRESSetModifyPC_long_dbl( solver, modify_pc ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRFlexGMRESSetPrecond_flt( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRFlexGMRESSetPrecond_dbl( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRFlexGMRESSetPrecond_long_dbl( solver, precond, precond_setup, precond_solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRFlexGMRESSetPrintLevel_flt( solver, print_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRFlexGMRESSetPrintLevel_dbl( solver, print_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRFlexGMRESSetPrintLevel_long_dbl( solver, print_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRFlexGMRESSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRFlexGMRESSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRFlexGMRESSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRFlexGMRESSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRFlexGMRESSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRFlexGMRESSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRFlexGMRESSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRFlexGMRESSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRFlexGMRESSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRFlexGMRESSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_Solver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRGMRESCreate_flt( comm, solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRGMRESCreate_dbl( comm, solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRGMRESCreate_long_dbl( comm, solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRGMRESDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRGMRESDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRGMRESDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRGMRESGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRGMRESGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRGMRESGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRGMRESGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRGMRESGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRGMRESGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESGetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *precond_data ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRGMRESGetPrecond_flt( solver, precond_data ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRGMRESGetPrecond_dbl( solver, precond_data ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRGMRESGetPrecond_long_dbl( solver, precond_data ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESGetRefSolution_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParVector *ref_solution ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRGMRESGetRefSolution_flt( solver, ref_solution ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRGMRESGetRefSolution_dbl( solver, ref_solution ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRGMRESGetRefSolution_long_dbl( solver, ref_solution ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESGetResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParVector *residual ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRGMRESGetResidual_flt( solver, residual ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRGMRESGetResidual_dbl( solver, residual ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRGMRESGetResidual_long_dbl( solver, residual ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double a_tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRGMRESSetAbsoluteTol_flt( solver, a_tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRGMRESSetAbsoluteTol_dbl( solver, a_tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRGMRESSetAbsoluteTol_long_dbl( solver, a_tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESSetKDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int k_dim ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRGMRESSetKDim_flt( solver, k_dim ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRGMRESSetKDim_dbl( solver, k_dim ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRGMRESSetKDim_long_dbl( solver, k_dim ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRGMRESSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRGMRESSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRGMRESSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRGMRESSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRGMRESSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRGMRESSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESSetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int min_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRGMRESSetMinIter_flt( solver, min_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRGMRESSetMinIter_dbl( solver, min_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRGMRESSetMinIter_long_dbl( solver, min_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRGMRESSetPrecond_flt( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRGMRESSetPrecond_dbl( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRGMRESSetPrecond_long_dbl( solver, precond, precond_setup, precond_solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRGMRESSetPrintLevel_flt( solver, print_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRGMRESSetPrintLevel_dbl( solver, print_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRGMRESSetPrintLevel_long_dbl( solver, print_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESSetRefSolution_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParVector ref_solution ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRGMRESSetRefSolution_flt( solver, ref_solution ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRGMRESSetRefSolution_dbl( solver, ref_solution ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRGMRESSetRefSolution_long_dbl( solver, ref_solution ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESSetStopCrit_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int stop_crit ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRGMRESSetStopCrit_flt( solver, stop_crit ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRGMRESSetStopCrit_dbl( solver, stop_crit ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRGMRESSetStopCrit_long_dbl( solver, stop_crit ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRGMRESSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRGMRESSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRGMRESSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRGMRESSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRGMRESSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRGMRESSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRGMRESSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRGMRESSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRGMRESSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRGMRESSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridCreate_pre( HYPRE_Precision precision, HYPRE_Solver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridCreate_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridCreate_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridCreate_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridGetDSCGNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *dscg_num_its ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridGetDSCGNumIterations_flt( solver, dscg_num_its ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridGetDSCGNumIterations_dbl( solver, dscg_num_its ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridGetDSCGNumIterations_long_dbl( solver, dscg_num_its ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_its ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridGetNumIterations_flt( solver, num_its ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridGetNumIterations_dbl( solver, num_its ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridGetNumIterations_long_dbl( solver, num_its ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridGetPCGNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *pcg_num_its ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridGetPCGNumIterations_flt( solver, pcg_num_its ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridGetPCGNumIterations_dbl( solver, pcg_num_its ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridGetPCGNumIterations_long_dbl( solver, pcg_num_its ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridGetRecomputeResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *recompute_residual ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridGetRecomputeResidual_flt( solver, recompute_residual ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridGetRecomputeResidual_dbl( solver, recompute_residual ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridGetRecomputeResidual_long_dbl( solver, recompute_residual ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridGetRecomputeResidualP_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *recompute_residual_p ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridGetRecomputeResidualP_flt( solver, recompute_residual_p ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridGetRecomputeResidualP_dbl( solver, recompute_residual_p ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridGetRecomputeResidualP_long_dbl( solver, recompute_residual_p ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridGetSetupSolveTime_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *time ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridGetSetupSolveTime_flt( solver, time ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridGetSetupSolveTime_dbl( solver, time ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridGetSetupSolveTime_long_dbl( solver, time ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetAbsoluteTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetAbsoluteTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetAbsoluteTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetAggInterpType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int agg_interp_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetAggInterpType_flt( solver, agg_interp_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetAggInterpType_dbl( solver, agg_interp_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetAggInterpType_long_dbl( solver, agg_interp_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetAggNumLevels_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int agg_num_levels ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetAggNumLevels_flt( solver, agg_num_levels ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetAggNumLevels_dbl( solver, agg_num_levels ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetAggNumLevels_long_dbl( solver, agg_num_levels ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetCoarsenType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int coarsen_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetCoarsenType_flt( solver, coarsen_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetCoarsenType_dbl( solver, coarsen_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetCoarsenType_long_dbl( solver, coarsen_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetConvergenceTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double cf_tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetConvergenceTol_flt( solver, cf_tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetConvergenceTol_dbl( solver, cf_tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetConvergenceTol_long_dbl( solver, cf_tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetCycleNumSweeps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_sweeps, HYPRE_Int k ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetCycleNumSweeps_flt( solver, num_sweeps, k ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetCycleNumSweeps_dbl( solver, num_sweeps, k ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetCycleNumSweeps_long_dbl( solver, num_sweeps, k ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetCycleRelaxType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int relax_type, HYPRE_Int k ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetCycleRelaxType_flt( solver, relax_type, k ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetCycleRelaxType_dbl( solver, relax_type, k ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetCycleRelaxType_long_dbl( solver, relax_type, k ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetCycleType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int cycle_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetCycleType_flt( solver, cycle_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetCycleType_dbl( solver, cycle_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetCycleType_long_dbl( solver, cycle_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetDSCGMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int dscg_max_its ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetDSCGMaxIter_flt( solver, dscg_max_its ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetDSCGMaxIter_dbl( solver, dscg_max_its ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetDSCGMaxIter_long_dbl( solver, dscg_max_its ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetDofFunc_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *dof_func ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetDofFunc_flt( solver, dof_func ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetDofFunc_dbl( solver, dof_func ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetDofFunc_long_dbl( solver, dof_func ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetGridRelaxPoints_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int **grid_relax_points ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetGridRelaxPoints_flt( solver, grid_relax_points ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetGridRelaxPoints_dbl( solver, grid_relax_points ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetGridRelaxPoints_long_dbl( solver, grid_relax_points ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetGridRelaxType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *grid_relax_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetGridRelaxType_flt( solver, grid_relax_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetGridRelaxType_dbl( solver, grid_relax_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetGridRelaxType_long_dbl( solver, grid_relax_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetInterpType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int interp_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetInterpType_flt( solver, interp_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetInterpType_dbl( solver, interp_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetInterpType_long_dbl( solver, interp_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetKDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int k_dim ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetKDim_flt( solver, k_dim ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetKDim_dbl( solver, k_dim ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetKDim_long_dbl( solver, k_dim ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetKeepTranspose_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int keepT ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetKeepTranspose_flt( solver, keepT ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetKeepTranspose_dbl( solver, keepT ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetKeepTranspose_long_dbl( solver, keepT ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetLevelOuterWt_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double outer_wt, HYPRE_Int level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetLevelOuterWt_flt( solver, outer_wt, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetLevelOuterWt_dbl( solver, outer_wt, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetLevelOuterWt_long_dbl( solver, outer_wt, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetLevelRelaxWt_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double relax_wt, HYPRE_Int level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetLevelRelaxWt_flt( solver, relax_wt, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetLevelRelaxWt_dbl( solver, relax_wt, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetLevelRelaxWt_long_dbl( solver, relax_wt, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetMaxCoarseSize_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_coarse_size ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetMaxCoarseSize_flt( solver, max_coarse_size ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetMaxCoarseSize_dbl( solver, max_coarse_size ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetMaxCoarseSize_long_dbl( solver, max_coarse_size ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetMaxLevels_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_levels ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetMaxLevels_flt( solver, max_levels ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetMaxLevels_dbl( solver, max_levels ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetMaxLevels_long_dbl( solver, max_levels ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetMaxRowSum_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double max_row_sum ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetMaxRowSum_flt( solver, max_row_sum ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetMaxRowSum_dbl( solver, max_row_sum ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetMaxRowSum_long_dbl( solver, max_row_sum ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetMeasureType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int measure_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetMeasureType_flt( solver, measure_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetMeasureType_dbl( solver, measure_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetMeasureType_long_dbl( solver, measure_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetMinCoarseSize_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int min_coarse_size ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetMinCoarseSize_flt( solver, min_coarse_size ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetMinCoarseSize_dbl( solver, min_coarse_size ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetMinCoarseSize_long_dbl( solver, min_coarse_size ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetNodal_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int nodal ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetNodal_flt( solver, nodal ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetNodal_dbl( solver, nodal ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetNodal_long_dbl( solver, nodal ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetNonGalerkinTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_levels, void *nongalerkin_tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetNonGalerkinTol_flt( solver, num_levels, nongalerkin_tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetNonGalerkinTol_dbl( solver, num_levels, nongalerkin_tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetNonGalerkinTol_long_dbl( solver, num_levels, nongalerkin_tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetNumFunctions_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_functions ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetNumFunctions_flt( solver, num_functions ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetNumFunctions_dbl( solver, num_functions ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetNumFunctions_long_dbl( solver, num_functions ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetNumGridSweeps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_grid_sweeps ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetNumGridSweeps_flt( solver, num_grid_sweeps ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetNumGridSweeps_dbl( solver, num_grid_sweeps ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetNumGridSweeps_long_dbl( solver, num_grid_sweeps ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetNumPaths_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_paths ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetNumPaths_flt( solver, num_paths ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetNumPaths_dbl( solver, num_paths ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetNumPaths_long_dbl( solver, num_paths ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetNumSweeps_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_sweeps ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetNumSweeps_flt( solver, num_sweeps ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetNumSweeps_dbl( solver, num_sweeps ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetNumSweeps_long_dbl( solver, num_sweeps ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetOmega_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *omega ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetOmega_flt( solver, omega ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetOmega_dbl( solver, omega ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetOmega_long_dbl( solver, omega ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetOuterWt_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double outer_wt ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetOuterWt_flt( solver, outer_wt ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetOuterWt_dbl( solver, outer_wt ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetOuterWt_long_dbl( solver, outer_wt ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetPCGMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int pcg_max_its ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetPCGMaxIter_flt( solver, pcg_max_its ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetPCGMaxIter_dbl( solver, pcg_max_its ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetPCGMaxIter_long_dbl( solver, pcg_max_its ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetPMaxElmts_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int P_max_elmts ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetPMaxElmts_flt( solver, P_max_elmts ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetPMaxElmts_dbl( solver, P_max_elmts ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetPMaxElmts_long_dbl( solver, P_max_elmts ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetPrecond_flt( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetPrecond_dbl( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetPrecond_long_dbl( solver, precond, precond_setup, precond_solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetPrintLevel_flt( solver, print_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetPrintLevel_dbl( solver, print_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetPrintLevel_long_dbl( solver, print_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetRecomputeResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int recompute_residual ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetRecomputeResidual_flt( solver, recompute_residual ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetRecomputeResidual_dbl( solver, recompute_residual ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetRecomputeResidual_long_dbl( solver, recompute_residual ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetRecomputeResidualP_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int recompute_residual_p ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetRecomputeResidualP_flt( solver, recompute_residual_p ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetRecomputeResidualP_dbl( solver, recompute_residual_p ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetRecomputeResidualP_long_dbl( solver, recompute_residual_p ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetRelChange_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int rel_change ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetRelChange_flt( solver, rel_change ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetRelChange_dbl( solver, rel_change ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetRelChange_long_dbl( solver, rel_change ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetRelaxOrder_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int relax_order ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetRelaxOrder_flt( solver, relax_order ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetRelaxOrder_dbl( solver, relax_order ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetRelaxOrder_long_dbl( solver, relax_order ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetRelaxType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int relax_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetRelaxType_flt( solver, relax_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetRelaxType_dbl( solver, relax_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetRelaxType_long_dbl( solver, relax_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetRelaxWeight_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *relax_weight ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetRelaxWeight_flt( solver, relax_weight ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetRelaxWeight_dbl( solver, relax_weight ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetRelaxWeight_long_dbl( solver, relax_weight ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetRelaxWt_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double relax_wt ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetRelaxWt_flt( solver, relax_wt ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetRelaxWt_dbl( solver, relax_wt ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetRelaxWt_long_dbl( solver, relax_wt ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetSeqThreshold_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int seq_threshold ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetSeqThreshold_flt( solver, seq_threshold ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetSeqThreshold_dbl( solver, seq_threshold ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetSeqThreshold_long_dbl( solver, seq_threshold ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetSetupType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int setup_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetSetupType_flt( solver, setup_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetSetupType_dbl( solver, setup_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetSetupType_long_dbl( solver, setup_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetSolverType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int solver_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetSolverType_flt( solver, solver_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetSolverType_dbl( solver, solver_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetSolverType_long_dbl( solver, solver_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetStopCrit_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int stop_crit ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetStopCrit_flt( solver, stop_crit ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetStopCrit_dbl( solver, stop_crit ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetStopCrit_long_dbl( solver, stop_crit ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetStrongThreshold_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double strong_threshold ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetStrongThreshold_flt( solver, strong_threshold ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetStrongThreshold_dbl( solver, strong_threshold ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetStrongThreshold_long_dbl( solver, strong_threshold ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetTruncFactor_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double trunc_factor ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetTruncFactor_flt( solver, trunc_factor ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetTruncFactor_dbl( solver, trunc_factor ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetTruncFactor_long_dbl( solver, trunc_factor ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetTwoNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int two_norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetTwoNorm_flt( solver, two_norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetTwoNorm_dbl( solver, two_norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetTwoNorm_long_dbl( solver, two_norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRHybridSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRHybridSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRHybridSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRHybridSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_Solver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRLGMRESCreate_flt( comm, solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRLGMRESCreate_dbl( comm, solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRLGMRESCreate_long_dbl( comm, solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRLGMRESDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRLGMRESDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRLGMRESDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRLGMRESGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRLGMRESGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRLGMRESGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRLGMRESGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRLGMRESGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRLGMRESGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESGetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *precond_data ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRLGMRESGetPrecond_flt( solver, precond_data ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRLGMRESGetPrecond_dbl( solver, precond_data ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRLGMRESGetPrecond_long_dbl( solver, precond_data ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESGetResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParVector *residual ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRLGMRESGetResidual_flt( solver, residual ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRLGMRESGetResidual_dbl( solver, residual ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRLGMRESGetResidual_long_dbl( solver, residual ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double a_tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRLGMRESSetAbsoluteTol_flt( solver, a_tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRLGMRESSetAbsoluteTol_dbl( solver, a_tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRLGMRESSetAbsoluteTol_long_dbl( solver, a_tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESSetAugDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int aug_dim ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRLGMRESSetAugDim_flt( solver, aug_dim ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRLGMRESSetAugDim_dbl( solver, aug_dim ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRLGMRESSetAugDim_long_dbl( solver, aug_dim ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESSetKDim_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int k_dim ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRLGMRESSetKDim_flt( solver, k_dim ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRLGMRESSetKDim_dbl( solver, k_dim ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRLGMRESSetKDim_long_dbl( solver, k_dim ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRLGMRESSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRLGMRESSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRLGMRESSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRLGMRESSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRLGMRESSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRLGMRESSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESSetMinIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int min_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRLGMRESSetMinIter_flt( solver, min_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRLGMRESSetMinIter_dbl( solver, min_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRLGMRESSetMinIter_long_dbl( solver, min_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRLGMRESSetPrecond_flt( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRLGMRESSetPrecond_dbl( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRLGMRESSetPrecond_long_dbl( solver, precond, precond_setup, precond_solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRLGMRESSetPrintLevel_flt( solver, print_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRLGMRESSetPrintLevel_dbl( solver, print_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRLGMRESSetPrintLevel_long_dbl( solver, print_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRLGMRESSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRLGMRESSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRLGMRESSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRLGMRESSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRLGMRESSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRLGMRESSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRLGMRESSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRLGMRESSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRLGMRESSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRLGMRESSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMultiVectorPrint_pre( HYPRE_Precision precision, void *x_, const char *fileName ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRMultiVectorPrint_flt( x_, fileName ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRMultiVectorPrint_dbl( x_, fileName ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRMultiVectorPrint_long_dbl( x_, fileName ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +void * +HYPRE_ParCSRMultiVectorRead_pre( HYPRE_Precision precision, MPI_Comm comm, void *ii_, const char *fileName ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRMultiVectorRead_flt( comm, ii_, fileName ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRMultiVectorRead_dbl( comm, ii_, fileName ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRMultiVectorRead_long_dbl( comm, ii_, fileName ); + default: + { void * value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSROnProcTriSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix HA, HYPRE_ParVector Hy, HYPRE_ParVector Hx ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSROnProcTriSetup_flt( solver, HA, Hy, Hx ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSROnProcTriSetup_dbl( solver, HA, Hy, Hx ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSROnProcTriSetup_long_dbl( solver, HA, Hy, Hx ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSROnProcTriSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix HA, HYPRE_ParVector Hy, HYPRE_ParVector Hx ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSROnProcTriSolve_flt( solver, HA, Hy, Hx ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSROnProcTriSolve_dbl( solver, HA, Hy, Hx ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSROnProcTriSolve_long_dbl( solver, HA, Hy, Hx ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_Solver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRPCGCreate_flt( comm, solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRPCGCreate_dbl( comm, solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRPCGCreate_long_dbl( comm, solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRPCGDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRPCGDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRPCGDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRPCGGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRPCGGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRPCGGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGGetNumIterations_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRPCGGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRPCGGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRPCGGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGGetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver *precond_data ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRPCGGetPrecond_flt( solver, precond_data ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRPCGGetPrecond_dbl( solver, precond_data ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRPCGGetPrecond_long_dbl( solver, precond_data ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGGetResidual_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParVector *residual ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRPCGGetResidual_flt( solver, residual ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRPCGGetResidual_dbl( solver, residual ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRPCGGetResidual_long_dbl( solver, residual ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRPCGSetAbsoluteTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRPCGSetAbsoluteTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRPCGSetAbsoluteTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRPCGSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRPCGSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRPCGSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRPCGSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRPCGSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRPCGSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGSetPrecond_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_PtrToParSolverFcn precond, HYPRE_PtrToParSolverFcn precond_setup, HYPRE_Solver precond_solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRPCGSetPrecond_flt( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRPCGSetPrecond_dbl( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRPCGSetPrecond_long_dbl( solver, precond, precond_setup, precond_solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGSetPreconditioner_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Solver precond ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRPCGSetPreconditioner_flt( solver, precond ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRPCGSetPreconditioner_dbl( solver, precond ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRPCGSetPreconditioner_long_dbl( solver, precond ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int print_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRPCGSetPrintLevel_flt( solver, print_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRPCGSetPrintLevel_dbl( solver, print_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRPCGSetPrintLevel_long_dbl( solver, print_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGSetRelChange_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int rel_change ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRPCGSetRelChange_flt( solver, rel_change ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRPCGSetRelChange_dbl( solver, rel_change ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRPCGSetRelChange_long_dbl( solver, rel_change ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGSetStopCrit_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int stop_crit ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRPCGSetStopCrit_flt( solver, stop_crit ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRPCGSetStopCrit_dbl( solver, stop_crit ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRPCGSetStopCrit_long_dbl( solver, stop_crit ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGSetTol_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRPCGSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRPCGSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRPCGSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGSetTwoNorm_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int two_norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRPCGSetTwoNorm_flt( solver, two_norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRPCGSetTwoNorm_dbl( solver, two_norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRPCGSetTwoNorm_long_dbl( solver, two_norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRPCGSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRPCGSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRPCGSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPCGSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRPCGSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRPCGSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRPCGSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRParaSailsCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_Solver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRParaSailsCreate_flt( comm, solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRParaSailsCreate_dbl( comm, solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRParaSailsCreate_long_dbl( comm, solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRParaSailsDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRParaSailsDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRParaSailsDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRParaSailsDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRParaSailsSetFilter_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double filter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRParaSailsSetFilter_flt( solver, filter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRParaSailsSetFilter_dbl( solver, filter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRParaSailsSetFilter_long_dbl( solver, filter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRParaSailsSetLoadbal_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double loadbal ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRParaSailsSetLoadbal_flt( solver, loadbal ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRParaSailsSetLoadbal_dbl( solver, loadbal ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRParaSailsSetLoadbal_long_dbl( solver, loadbal ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRParaSailsSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRParaSailsSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRParaSailsSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRParaSailsSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRParaSailsSetParams_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double thresh, HYPRE_Int nlevels ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRParaSailsSetParams_flt( solver, thresh, nlevels ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRParaSailsSetParams_dbl( solver, thresh, nlevels ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRParaSailsSetParams_long_dbl( solver, thresh, nlevels ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRParaSailsSetReuse_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int reuse ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRParaSailsSetReuse_flt( solver, reuse ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRParaSailsSetReuse_dbl( solver, reuse ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRParaSailsSetReuse_long_dbl( solver, reuse ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRParaSailsSetSym_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int sym ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRParaSailsSetSym_flt( solver, sym ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRParaSailsSetSym_dbl( solver, sym ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRParaSailsSetSym_long_dbl( solver, sym ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRParaSailsSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRParaSailsSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRParaSailsSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRParaSailsSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRParaSailsSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRParaSailsSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRParaSailsSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRParaSailsSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPilutCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_Solver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRPilutCreate_flt( comm, solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRPilutCreate_dbl( comm, solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRPilutCreate_long_dbl( comm, solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPilutDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRPilutDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRPilutDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRPilutDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPilutSetDropTolerance_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRPilutSetDropTolerance_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRPilutSetDropTolerance_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRPilutSetDropTolerance_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPilutSetFactorRowSize_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int size ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRPilutSetFactorRowSize_flt( solver, size ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRPilutSetFactorRowSize_dbl( solver, size ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRPilutSetFactorRowSize_long_dbl( solver, size ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPilutSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRPilutSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRPilutSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRPilutSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPilutSetMaxIter_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRPilutSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRPilutSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRPilutSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPilutSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRPilutSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRPilutSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRPilutSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRPilutSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRPilutSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRPilutSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRPilutSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRSetupInterpreter_pre( HYPRE_Precision precision, mv_InterfaceInterpreter *i ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRSetupInterpreter_flt( i ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRSetupInterpreter_dbl( i ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRSetupInterpreter_long_dbl( i ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRSetupMatvec_pre( HYPRE_Precision precision, HYPRE_MatvecFunctions *mv ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRSetupMatvec_flt( mv ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRSetupMatvec_dbl( mv ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRSetupMatvec_long_dbl( mv ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsBuildIJMatrix_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_IJMatrix *pij_A ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParaSailsBuildIJMatrix_flt( solver, pij_A ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParaSailsBuildIJMatrix_dbl( solver, pij_A ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParaSailsBuildIJMatrix_long_dbl( solver, pij_A ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_Solver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParaSailsCreate_flt( comm, solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParaSailsCreate_dbl( comm, solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParaSailsCreate_long_dbl( comm, solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParaSailsDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParaSailsDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParaSailsDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsGetFilter_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *filter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParaSailsGetFilter_flt( solver, filter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParaSailsGetFilter_dbl( solver, filter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParaSailsGetFilter_long_dbl( solver, filter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsGetLoadbal_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *loadbal ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParaSailsGetLoadbal_flt( solver, loadbal ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParaSailsGetLoadbal_dbl( solver, loadbal ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParaSailsGetLoadbal_long_dbl( solver, loadbal ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsGetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParaSailsGetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParaSailsGetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParaSailsGetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsGetNlevels_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *nlevels ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParaSailsGetNlevels_flt( solver, nlevels ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParaSailsGetNlevels_dbl( solver, nlevels ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParaSailsGetNlevels_long_dbl( solver, nlevels ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsGetReuse_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *reuse ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParaSailsGetReuse_flt( solver, reuse ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParaSailsGetReuse_dbl( solver, reuse ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParaSailsGetReuse_long_dbl( solver, reuse ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsGetSym_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *sym ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParaSailsGetSym_flt( solver, sym ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParaSailsGetSym_dbl( solver, sym ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParaSailsGetSym_long_dbl( solver, sym ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsGetThresh_pre( HYPRE_Precision precision, HYPRE_Solver solver, void *thresh ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParaSailsGetThresh_flt( solver, thresh ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParaSailsGetThresh_dbl( solver, thresh ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParaSailsGetThresh_long_dbl( solver, thresh ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsSetFilter_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double filter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParaSailsSetFilter_flt( solver, filter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParaSailsSetFilter_dbl( solver, filter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParaSailsSetFilter_long_dbl( solver, filter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsSetLoadbal_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double loadbal ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParaSailsSetLoadbal_flt( solver, loadbal ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParaSailsSetLoadbal_dbl( solver, loadbal ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParaSailsSetLoadbal_long_dbl( solver, loadbal ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsSetLogging_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParaSailsSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParaSailsSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParaSailsSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsSetNlevels_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int nlevels ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParaSailsSetNlevels_flt( solver, nlevels ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParaSailsSetNlevels_dbl( solver, nlevels ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParaSailsSetNlevels_long_dbl( solver, nlevels ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsSetParams_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double thresh, HYPRE_Int nlevels ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParaSailsSetParams_flt( solver, thresh, nlevels ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParaSailsSetParams_dbl( solver, thresh, nlevels ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParaSailsSetParams_long_dbl( solver, thresh, nlevels ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsSetReuse_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int reuse ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParaSailsSetReuse_flt( solver, reuse ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParaSailsSetReuse_dbl( solver, reuse ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParaSailsSetReuse_long_dbl( solver, reuse ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsSetSym_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int sym ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParaSailsSetSym_flt( solver, sym ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParaSailsSetSym_dbl( solver, sym ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParaSailsSetSym_long_dbl( solver, sym ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsSetThresh_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double thresh ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParaSailsSetThresh_flt( solver, thresh ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParaSailsSetThresh_dbl( solver, thresh ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParaSailsSetThresh_long_dbl( solver, thresh ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParaSailsSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParaSailsSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParaSailsSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParaSailsSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParaSailsSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParaSailsSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParaSailsSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SchwarzCreate_pre( HYPRE_Precision precision, HYPRE_Solver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SchwarzCreate_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SchwarzCreate_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SchwarzCreate_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SchwarzDestroy_pre( HYPRE_Precision precision, HYPRE_Solver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SchwarzDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SchwarzDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SchwarzDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SchwarzSetDofFunc_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int *dof_func ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SchwarzSetDofFunc_flt( solver, dof_func ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SchwarzSetDofFunc_dbl( solver, dof_func ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SchwarzSetDofFunc_long_dbl( solver, dof_func ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SchwarzSetDomainStructure_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_CSRMatrix domain_structure ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SchwarzSetDomainStructure_flt( solver, domain_structure ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SchwarzSetDomainStructure_dbl( solver, domain_structure ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SchwarzSetDomainStructure_long_dbl( solver, domain_structure ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SchwarzSetDomainType_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int domain_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SchwarzSetDomainType_flt( solver, domain_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SchwarzSetDomainType_dbl( solver, domain_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SchwarzSetDomainType_long_dbl( solver, domain_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SchwarzSetNonSymm_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int use_nonsymm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SchwarzSetNonSymm_flt( solver, use_nonsymm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SchwarzSetNonSymm_dbl( solver, use_nonsymm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SchwarzSetNonSymm_long_dbl( solver, use_nonsymm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SchwarzSetNumFunctions_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int num_functions ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SchwarzSetNumFunctions_flt( solver, num_functions ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SchwarzSetNumFunctions_dbl( solver, num_functions ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SchwarzSetNumFunctions_long_dbl( solver, num_functions ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SchwarzSetOverlap_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int overlap ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SchwarzSetOverlap_flt( solver, overlap ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SchwarzSetOverlap_dbl( solver, overlap ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SchwarzSetOverlap_long_dbl( solver, overlap ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SchwarzSetRelaxWeight_pre( HYPRE_Precision precision, HYPRE_Solver solver, hypre_long_double relax_weight ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SchwarzSetRelaxWeight_flt( solver, relax_weight ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SchwarzSetRelaxWeight_dbl( solver, relax_weight ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SchwarzSetRelaxWeight_long_dbl( solver, relax_weight ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SchwarzSetVariant_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_Int variant ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SchwarzSetVariant_flt( solver, variant ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SchwarzSetVariant_dbl( solver, variant ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SchwarzSetVariant_long_dbl( solver, variant ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SchwarzSetup_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SchwarzSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SchwarzSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SchwarzSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SchwarzSolve_pre( HYPRE_Precision precision, HYPRE_Solver solver, HYPRE_ParCSRMatrix A, HYPRE_ParVector b, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SchwarzSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SchwarzSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SchwarzSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_TempParCSRSetupInterpreter_pre( HYPRE_Precision precision, mv_InterfaceInterpreter *i ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_TempParCSRSetupInterpreter_flt( i ); + case HYPRE_REAL_DOUBLE: + return HYPRE_TempParCSRSetupInterpreter_dbl( i ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_TempParCSRSetupInterpreter_long_dbl( i ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + + + +#endif + diff --git a/src/parcsr_ls/par_amg.h b/src/parcsr_ls/par_amg.h index 715cf32cdf..ce05da2784 100644 --- a/src/parcsr_ls/par_amg.h +++ b/src/parcsr_ls/par_amg.h @@ -10,7 +10,7 @@ #define CUMNUMIT -#include "par_csr_block_matrix.h" +#include "_hypre_parcsr_block_mv.h" /*-------------------------------------------------------------------------- * hypre_ParAMGData diff --git a/src/parcsr_ls/par_amg_setup.c b/src/parcsr_ls/par_amg_setup.c index b6d922e737..60c7ad1ca2 100644 --- a/src/parcsr_ls/par_amg_setup.c +++ b/src/parcsr_ls/par_amg_setup.c @@ -8,7 +8,7 @@ #include "_hypre_onedpl.hpp" #include "_hypre_parcsr_ls.h" #include "par_amg.h" -#include "../parcsr_block_mv/par_csr_block_matrix.h" +#include "_hypre_parcsr_block_mv.h" #include "_hypre_utilities.hpp" #define DEBUG 0 @@ -2886,7 +2886,7 @@ hypre_BoomerAMGSetup( void *amg_vdata, if (hypre_ParAMGDataModularizedMatMat(amg_data)) { A_H = hypre_ParCSRMatrixRAPKT(P, A_array[level], - P, keepTranspose); + P, keepTranspose, 1); } else { @@ -3072,7 +3072,7 @@ hypre_BoomerAMGSetup( void *amg_vdata, if (hypre_ParAMGDataModularizedMatMat(amg_data)) { A_H = hypre_ParCSRMatrixRAPKT(P_array[level], A_array[level], - P_array[level], keepTranspose); + P_array[level], keepTranspose, 1); } else { @@ -4038,7 +4038,7 @@ hypre_BoomerAMGSetup( void *amg_vdata, } #endif - hypre_MemoryPrintUsage(comm, hypre_HandleLogLevel(hypre_handle()), "BoomerAMG setup end", 0); + hypre_MemoryPrintUsage(comm, hypre_HandleLogLevel(hypre_handle()), "BoomerAMG setup end ", 0); hypre_GpuProfilingPopRange(); HYPRE_ANNOTATE_FUNC_END; diff --git a/src/parcsr_ls/par_amg_solveT.c b/src/parcsr_ls/par_amg_solveT.c index e0df8686a9..4c269ab6c8 100644 --- a/src/parcsr_ls/par_amg_solveT.c +++ b/src/parcsr_ls/par_amg_solveT.c @@ -737,7 +737,7 @@ hypre_BoomerAMGRelaxT( hypre_ParCSRMatrix *A, b_vec[i] = f_vector_data[i]; } - hypre_gselim(A_mat, b_vec, n_global, relax_error); + hypre_gselim(A_mat, b_vec, n_global); for (i = 0; i < n; i++) { diff --git a/src/parcsr_ls/par_coarsen_device.c b/src/parcsr_ls/par_coarsen_device.c index daadfb79ed..777d2cb2db 100644 --- a/src/parcsr_ls/par_coarsen_device.c +++ b/src/parcsr_ls/par_coarsen_device.c @@ -218,7 +218,7 @@ hypre_BoomerAMGCoarsenPMISDevice( hypre_ParCSRMatrix *S, graph_diag, graph_diag + graph_diag_size, diag_iwork, - thrust::identity() ); + HYPRE_THRUST_IDENTITY(HYPRE_Int) ); #endif graph_diag_size = new_end - graph_diag; @@ -442,7 +442,7 @@ hypre_PMISCoarseningInitDevice( hypre_ParCSRMatrix *S, /* in */ thrust::make_counting_iterator(num_rows_diag), CF_marker_diag, graph_diag, - thrust::identity()); + HYPRE_THRUST_IDENTITY(HYPRE_Int)); #endif *graph_diag_size = new_end - graph_diag; diff --git a/src/parcsr_ls/par_cycle.c b/src/parcsr_ls/par_cycle.c index ee4b11476c..827008fed1 100644 --- a/src/parcsr_ls/par_cycle.c +++ b/src/parcsr_ls/par_cycle.c @@ -13,7 +13,7 @@ #include "_hypre_parcsr_ls.h" #include "par_amg.h" -#include "../parcsr_block_mv/par_csr_block_matrix.h" +#include "_hypre_parcsr_block_mv.h" /*-------------------------------------------------------------------------- * hypre_BoomerAMGCycle diff --git a/src/parcsr_ls/par_difconv.c b/src/parcsr_ls/par_difconv.c index cede6127ef..6e4fb5ae7b 100644 --- a/src/parcsr_ls/par_difconv.c +++ b/src/parcsr_ls/par_difconv.c @@ -341,4 +341,3 @@ GenerateDifConv( MPI_Comm comm, return (HYPRE_ParCSRMatrix) A; } - diff --git a/src/parcsr_ls/par_fsai_device.c b/src/parcsr_ls/par_fsai_device.c index d23824530a..6591231bbd 100644 --- a/src/parcsr_ls/par_fsai_device.c +++ b/src/parcsr_ls/par_fsai_device.c @@ -31,6 +31,8 @@ hypreGPUKernel_BatchedGaussJordanSolve( hypre_DeviceItem &item, HYPRE_Complex *rhs_data, HYPRE_Complex *sol_data ) { + HYPRE_UNUSED_VAR(item); + extern __shared__ void* shmem[]; HYPRE_Complex *ls_data = (HYPRE_Complex*) shmem; diff --git a/src/parcsr_ls/par_gauss_elim.c b/src/parcsr_ls/par_gauss_elim.c index c3a9ec6e4c..f86ca5cf79 100644 --- a/src/parcsr_ls/par_gauss_elim.c +++ b/src/parcsr_ls/par_gauss_elim.c @@ -641,11 +641,7 @@ hypre_GaussElimSolve(hypre_ParAMGData *amg_data, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); /* 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!"); - } + hypre_gselim(A_work, b_vec, global_num_rows); hypre_TMemcpy(u_data, b_data_h + first_row_index, HYPRE_Real, num_rows, memory_location, HYPRE_MEMORY_HOST); diff --git a/src/parcsr_ls/par_ilu_setup_device.c b/src/parcsr_ls/par_ilu_setup_device.c index f626b67cae..b1dae6ce24 100644 --- a/src/parcsr_ls/par_ilu_setup_device.c +++ b/src/parcsr_ls/par_ilu_setup_device.c @@ -455,6 +455,9 @@ hypre_ILUSetupIterativeILU0Device(hypre_CSRMatrix *A, rocsparse_datatype data_type; size_t buffer_size; HYPRE_Int history_size; +#if (ROCSPARSE_VERSION >= 300400) + HYPRE_Int num_free_iter = 10; +#endif HYPRE_ANNOTATE_FUNC_BEGIN; hypre_GpuProfilingPushRange("CSRMatrixITILU0"); @@ -547,6 +550,9 @@ hypre_ILUSetupIterativeILU0Device(hypre_CSRMatrix *A, (rocsparse_itilu0_alg) type, (rocsparse_int) option, (rocsparse_int*) num_iter_ptr, +#if (ROCSPARSE_VERSION >= 300400) + (rocsparse_int) num_free_iter, +#endif tolerance, (rocsparse_int) num_rows, (rocsparse_int) num_nonzeros, diff --git a/src/parcsr_ls/par_lr_restr.c b/src/parcsr_ls/par_lr_restr.c index 1c7ce2a7c3..b2eeaff4eb 100644 --- a/src/parcsr_ls/par_lr_restr.c +++ b/src/parcsr_ls/par_lr_restr.c @@ -16,10 +16,6 @@ // hypre_dense_topo_sort(HYPRE_Real *L, HYPRE_Int *ordering, HYPRE_Int n) // to get ordering for triangular solve. Can provide - -HYPRE_Int AIR_TOT_SOL_SIZE = 0; -HYPRE_Int AIR_MAX_SOL_SIZE = 0; - #define AIR_DEBUG 0 #define EPSILON 1e-18 #define EPSIMAC 1e-16 diff --git a/src/parcsr_ls/par_mgr.c b/src/parcsr_ls/par_mgr.c index 5b92f48cfb..365e2b3eca 100644 --- a/src/parcsr_ls/par_mgr.c +++ b/src/parcsr_ls/par_mgr.c @@ -7,7 +7,7 @@ /****************************************************************************** * - * Two-grid system solver + * Multigrid reduction solver/preconditioner * *****************************************************************************/ @@ -17,21 +17,10 @@ #include "_hypre_blas.h" #include "_hypre_lapack.h" -//#ifdef HYPRE_USING_DSUPERLU -//#include "dsuperlu.h" -//#endif +/*-------------------------------------------------------------------------- + * Create MGR object + *--------------------------------------------------------------------------*/ -/* 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(void) { @@ -155,8 +144,9 @@ hypre_MGRCreate(void) } /*-------------------------------------------------------------------------- + * Destroy MGR opject *--------------------------------------------------------------------------*/ -/* Destroy */ + HYPRE_Int hypre_MGRDestroy( void *data ) { @@ -505,8 +495,6 @@ hypre_MGRDestroy( void *data ) } /*-------------------------------------------------------------------------- - * hypre_MGRCreateGSElimData - * * Create data for Gaussian Elimination for F-relaxation. *--------------------------------------------------------------------------*/ @@ -529,8 +517,6 @@ hypre_MGRCreateGSElimData( void ) } /*-------------------------------------------------------------------------- - * hypre_MGRDestroyGSElimData - * * Destroy data for Gaussian Elimination for F-relaxation. *--------------------------------------------------------------------------*/ @@ -561,7 +547,10 @@ hypre_MGRDestroyGSElimData( void *data ) return hypre_error_flag; } -/* Create data for V-cycle F-relaxtion */ +/*-------------------------------------------------------------------------- + * Create data for V-cycle F-relaxtion + *--------------------------------------------------------------------------*/ + void * hypre_MGRCreateFrelaxVcycleData( void ) { @@ -597,7 +586,10 @@ hypre_MGRCreateFrelaxVcycleData( void ) return (void *) vdata; } -/* Destroy data for V-cycle F-relaxation */ +/*-------------------------------------------------------------------------- + * Destroy data for V-cycle F-relaxation + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_MGRDestroyFrelaxVcycleData( void *data ) { @@ -666,8 +658,10 @@ hypre_MGRDestroyFrelaxVcycleData( void *data ) return hypre_error_flag; } -/* Set C-point variables for each reduction level */ -/* Currently not implemented */ +/*-------------------------------------------------------------------------- + * Set C-point variables for each reduction level + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_MGRSetReductionLevelCpoints( void *mgr_vdata, HYPRE_Int nlevels, @@ -681,8 +675,10 @@ hypre_MGRSetReductionLevelCpoints( void *mgr_vdata, return hypre_error_flag; } -/* Initialize some data */ -/* Set whether non-coarse points on each level should be explicitly tagged as F-points */ +/*-------------------------------------------------------------------------- + * Set whether non-coarse points on each level should be explicitly tagged as F-points + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_MGRSetNonCpointsToFpoints( void *mgr_vdata, HYPRE_Int nonCptToFptFlag) { @@ -692,7 +688,10 @@ hypre_MGRSetNonCpointsToFpoints( void *mgr_vdata, HYPRE_Int nonCptToFptFlag return hypre_error_flag; } -/* Set whether the reserved C points are reduced before the coarse grid solve */ +/*-------------------------------------------------------------------------- + * Set whether the reserved C points are reduced before the coarse grid solve + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_MGRSetReservedCpointsLevelToKeep(void *mgr_vdata, HYPRE_Int level) { @@ -702,7 +701,10 @@ hypre_MGRSetReservedCpointsLevelToKeep(void *mgr_vdata, HYPRE_Int level) return hypre_error_flag; } -/* Set Cpoints by contiguous blocks, i.e. p1, p2, ..., pn, s1, s2, ..., sn, ... */ +/*-------------------------------------------------------------------------- + * Set Cpoints by contiguous blocks, i.e. p1, p2, ..., pn, s1, s2, ..., sn, ... + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_MGRSetCpointsByContiguousBlock( void *mgr_vdata, HYPRE_Int block_size, @@ -801,6 +803,9 @@ hypre_MGRSetCpointsByBlock( void *mgr_vdata, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_MGRSetCpointsByPointMarkerArray( void *mgr_vdata, HYPRE_Int block_size, @@ -869,7 +874,11 @@ hypre_MGRSetCpointsByPointMarkerArray( void *mgr_vdata, return hypre_error_flag; } -/*Set number of points that remain part of the coarse grid throughout the hierarchy */ +/*-------------------------------------------------------------------------- + * 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, @@ -901,7 +910,12 @@ hypre_MGRSetReservedCoarseNodes(void *mgr_vdata, return hypre_error_flag; } -/* Set CF marker array */ +/*-------------------------------------------------------------------------- + * Set CF marker array + * + * TODO: move to par_mgr_coarsen.c + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_MGRCoarsen(hypre_ParCSRMatrix *S, hypre_ParCSRMatrix *A, @@ -911,11 +925,11 @@ hypre_MGRCoarsen(hypre_ParCSRMatrix *S, 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_ParCSRMatrixNumRows(A); - HYPRE_MemoryLocation memory_location; + 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 = hypre_ParCSRMatrixMemoryLocation(A); /* If this is the last level, coarsen onto fixed coarse set */ if (cflag) @@ -927,7 +941,6 @@ hypre_MGRCoarsen(hypre_ParCSRMatrix *S, *CF_marker_ptr = hypre_IntArrayCreate(nloc); hypre_IntArrayInitialize(*CF_marker_ptr); hypre_IntArraySetConstantValues(*CF_marker_ptr, FMRK); - memory_location = hypre_IntArrayMemoryLocation(*CF_marker_ptr); if (hypre_GetActualMemLocation(memory_location) == hypre_MEMORY_DEVICE) { @@ -957,8 +970,18 @@ hypre_MGRCoarsen(hypre_ParCSRMatrix *S, * 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); + */ +#if defined(HYPRE_USING_GPU) + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) + { + hypre_BoomerAMGCoarsenPMIS(S, A, 2, debug_flag, CF_marker_ptr); + } + else +#endif + { + hypre_BoomerAMGCoarsen(S, A, 0, debug_flag, CF_marker_ptr); + } + hypre_IntArrayMigrate(*CF_marker_ptr, HYPRE_MEMORY_HOST); CF_marker = hypre_IntArrayData(*CF_marker_ptr); /* Update CF_marker to correct Cpoints marked as Fpoints. */ @@ -967,6 +990,7 @@ hypre_MGRCoarsen(hypre_ParCSRMatrix *S, { 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. */ @@ -975,6 +999,8 @@ hypre_MGRCoarsen(hypre_ParCSRMatrix *S, if (CF_marker[row] == CMRK) { continue; } CF_marker[row] = FMRK; } + + hypre_IntArrayMigrate(*CF_marker_ptr, memory_location); #if 0 /* IMPORTANT: Update coarse_indexes array to define the positions of the fixed coarse points * in the next level. @@ -1013,163 +1039,8 @@ hypre_MGRCoarsen(hypre_ParCSRMatrix *S, return hypre_error_flag; } -/* 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 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, @@ -1202,8 +1073,6 @@ hypre_MGRApproximateInverse(hypre_ParCSRMatrix *A, } /*-------------------------------------------------------------------------- - * hypre_blas_smat_inv_n2 - * * TODO (VPM): move this function to seq_ls *--------------------------------------------------------------------------*/ @@ -1220,8 +1089,6 @@ void hypre_blas_smat_inv_n2 (HYPRE_Real *a) } /*-------------------------------------------------------------------------- - * hypre_blas_smat_inv_n3 - * * TODO (VPM): move this function to seq_ls *--------------------------------------------------------------------------*/ @@ -1248,8 +1115,6 @@ void hypre_blas_smat_inv_n3 (HYPRE_Real *a) } /*-------------------------------------------------------------------------- - * hypre_blas_smat_inv_n4 - * * TODO (VPM): move this function to seq_ls *--------------------------------------------------------------------------*/ @@ -1346,8 +1211,6 @@ void hypre_blas_smat_inv_n4 (HYPRE_Real *a) } /*-------------------------------------------------------------------------- - * hypre_MGRSmallBlkInverse - * * TODO (VPM): move this function to seq_ls *--------------------------------------------------------------------------*/ @@ -1369,8 +1232,6 @@ void hypre_MGRSmallBlkInverse(HYPRE_Real *mat, } /*-------------------------------------------------------------------------- - * hypre_MGRSmallBlkInverse - * * TODO (VPM): move this function to seq_ls *--------------------------------------------------------------------------*/ @@ -1649,8 +1510,6 @@ hypre_MGRBlockRelaxSolveDevice( hypre_ParCSRMatrix *B, } /*-------------------------------------------------------------------------- - * hypre_MGRBlockRelaxSolve - * * Computes a block Jacobi relaxation of matrix A, given the inverse of the * diagonal blocks (of A) obtained by calling hypre_MGRBlockRelaxSetup. * @@ -1886,8 +1745,6 @@ hypre_BlockDiagInvLapack(HYPRE_Real *diag, HYPRE_Int N, HYPRE_Int blk_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. @@ -2105,8 +1962,6 @@ hypre_ParCSRMatrixExtractBlockDiagHost( hypre_ParCSRMatrix *par_A, } /*-------------------------------------------------------------------------- - * 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. @@ -2157,7 +2012,6 @@ hypre_ParCSRMatrixBlockDiagMatrix( hypre_ParCSRMatrix *A, } /*-------------------------------------------------------------------------- - * hypre_ParCSRMatrixBlockDiagMatrixHost *--------------------------------------------------------------------------*/ HYPRE_Int @@ -2324,8 +2178,6 @@ hypre_ParCSRMatrixBlockDiagMatrixHost( hypre_ParCSRMatrix *A, } /*-------------------------------------------------------------------------- - * hypre_MGRBlockRelaxSetup - * * Setup block smoother. Computes the entries of the inverse of the block * diagonal matrix with blk_size diagonal blocks. * @@ -2486,178 +2338,9 @@ hypre_MGRBlockRelaxSetup( hypre_ParCSRMatrix *A, #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) -{ - 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; - - 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; - } - - 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++) - { - 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 (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) - { - 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 ++) - { - 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++) - { - 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++) - { - for (k = 0;k < blk_size; k ++) - { - bidx = i*nb2 + j*blk_size + k; - printf("%e\t",diaginv[bidx]); - } - printf("\n"); - } - printf("\n"); - } - */ - } - 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_MGRBlockRelaxSolve(A, f, u, blk_size, n_block, left_size, method, diaginv, Vtemp); - - /*----------------------------------------------------------------- - * Free temporary memory - *-----------------------------------------------------------------*/ - hypre_TFree(diaginv, HYPRE_MEMORY_HOST); - - return (hypre_error_flag); -} -#endif /*-------------------------------------------------------------------------- - * hypre_MGRSetFSolver - * - * set F-relaxation solver + * Set F-relaxation solver *--------------------------------------------------------------------------*/ HYPRE_Int @@ -2687,9 +2370,7 @@ hypre_MGRSetFSolver( void *mgr_vdata, } /*-------------------------------------------------------------------------- - * hypre_MGRSetFSolverAtLevel - * - * set F-relaxation solver for a given MGR level. + * 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). @@ -4024,7 +3705,8 @@ hypre_MGRBuildAff( hypre_ParCSRMatrix *A, /* Free copy of CF marker */ hypre_TFree(CF_marker_copy, HYPRE_MEMORY_HOST); - return (0); + + return hypre_error_flag; } /********************************************************************************* @@ -4052,8 +3734,7 @@ hypre_MGRAddVectorP ( hypre_IntArray *CF_marker, HYPRE_Int n = hypre_IntArraySize(CF_marker); HYPRE_Int i, j; - j = 0; - for (i = 0; i < n; i++) + for (i = 0, j = 0; i < n; i++) { if (CF_marker_data[i] == point_type) { @@ -4061,7 +3742,8 @@ hypre_MGRAddVectorP ( hypre_IntArray *CF_marker, j++; } } - return 0; + + return hypre_error_flag; } /************************************************************************************* @@ -4101,79 +3783,7 @@ hypre_MGRAddVectorR ( hypre_IntArray *CF_marker, return 0; } -/* -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 *CF_marker_copy = hypre_CTAlloc(HYPRE_Int, local_num_variables, HYPRE_MEMORY_HOST); - HYPRE_Int i; - for (i = 0; i < local_num_variables; i++) { - CF_marker_copy[i] = -CF_marker[i]; - } - - hypre_BoomerAMGCoarseParms(comm, local_num_variables, 1, NULL, CF_marker_copy, coarse_dof_func_ptr, coarse_pnts_global_ptr); - hypre_MGRBuildP(A, CF_marker_copy, (*coarse_pnts_global_ptr), 0, debug_flag, P_f_ptr); - hypre_BoomerAMGBuildCoarseOperator(*P_f_ptr, A, *P_f_ptr, A_ff_ptr); - - hypre_TFree(CF_marker_copy, HYPRE_MEMORY_HOST); - return 0; -} -*/ - -/* Get pointer to coarse grid matrix for MGR solver */ -HYPRE_Int -hypre_MGRGetCoarseGridMatrix( void *mgr_vdata, hypre_ParCSRMatrix **RAP ) -{ - hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; - - 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; -} - -/* 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; - - 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; -} - -/* 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; - - 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; -} - -/* Print coarse grid linear system (for debugging)*/ +/* Print coarse grid linear system (for debugging) */ HYPRE_Int hypre_MGRPrintCoarseSystem( void *mgr_vdata, HYPRE_Int print_flag) { diff --git a/src/parcsr_ls/par_mgr_device.c b/src/parcsr_ls/par_mgr_device.c index dd91be490e..99ffe18720 100644 --- a/src/parcsr_ls/par_mgr_device.c +++ b/src/parcsr_ls/par_mgr_device.c @@ -19,11 +19,7 @@ #if defined (HYPRE_USING_GPU) template -#if defined(HYPRE_USING_SYCL) struct functor -#else -struct functor : public thrust::binary_function -#endif { T scale; @@ -458,6 +454,9 @@ hypreGPUKernel_CSRMatrixExtractBlockDiagMarked( hypre_DeviceItem &item, HYPRE_Int *B_j, HYPRE_Complex *B_a ) { + HYPRE_UNUSED_VAR(B_i); + HYPRE_UNUSED_VAR(B_j); + HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); HYPRE_Int bidx; HYPRE_Int lidx; diff --git a/src/parcsr_ls/par_mgr_rap.c b/src/parcsr_ls/par_mgr_rap.c index c18c61d1b0..a49c42787f 100644 --- a/src/parcsr_ls/par_mgr_rap.c +++ b/src/parcsr_ls/par_mgr_rap.c @@ -616,7 +616,7 @@ hypre_MGRBuildCoarseOperator(void *mgr_vdata, } else if (RT) { - RAP = hypre_ParCSRMatrixRAPKT(RT, A, P, 1); + RAP = hypre_ParCSRMatrixRAPKT(RT, A, P, 1, 0); } else if (R) { diff --git a/src/parcsr_ls/par_mgr_setup.c b/src/parcsr_ls/par_mgr_setup.c index e3f46d7b14..3ae55546e7 100644 --- a/src/parcsr_ls/par_mgr_setup.c +++ b/src/parcsr_ls/par_mgr_setup.c @@ -1735,9 +1735,11 @@ hypre_MGRSetup( void *mgr_vdata, } /*-------------------------------------------------------------------------- - * hypre_MGRSetupFrelaxVcycleData - * * Setup data for Frelax V-cycle + * + * TODO: + * 1) Revisit whether we should keep this function or not. + * 2) If kept, remove migrate calls from this function. *--------------------------------------------------------------------------*/ HYPRE_Int @@ -1751,6 +1753,9 @@ hypre_MGRSetupFrelaxVcycleData( void *mgr_vdata, hypre_ParMGRData *mgr_data = (hypre_ParMGRData*) mgr_vdata; hypre_ParAMGData **FrelaxVcycleData = mgr_data -> FrelaxVcycleData; HYPRE_MemoryLocation memory_location = hypre_ParCSRMatrixMemoryLocation(A); +/* #if defined(HYPRE_USING_GPU) */ +/* HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(memory_location); */ +/* #endif */ HYPRE_Int i, j, num_procs, my_id; @@ -1782,7 +1787,6 @@ hypre_MGRSetupFrelaxVcycleData( void *mgr_vdata, 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); @@ -1889,19 +1893,13 @@ hypre_MGRSetupFrelaxVcycleData( void *mgr_vdata, 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); + /* Count number of fine points */ + hypre_IntArrayCount(CF_marker_array[lev], smrk_local, &num_fine_points); if (num_functions > 1 && dof_func == NULL) { dof_func = hypre_IntArrayCreate(num_fine_points); - hypre_IntArrayInitialize(dof_func); + hypre_IntArrayInitialize_v2(dof_func, HYPRE_MEMORY_HOST); indx = 0; tms = num_fine_points / num_functions; if (tms * num_functions + indx > num_fine_points) { tms--; } @@ -1917,11 +1915,13 @@ hypre_MGRSetupFrelaxVcycleData( void *mgr_vdata, { hypre_IntArrayData(dof_func)[indx++] = k++; } + hypre_IntArrayMigrate(dof_func, memory_location); FrelaxVcycleData[lev] -> dof_func = dof_func; } dof_func_array[0] = dof_func; hypre_ParAMGDataDofFuncArray(FrelaxVcycleData[lev]) = dof_func_array; + hypre_IntArrayMigrate(CF_marker_array[lev], HYPRE_MEMORY_HOST); while (not_finished) { local_size = hypre_ParCSRMatrixNumRows(A_array_local[lev_local]); @@ -1935,12 +1935,15 @@ hypre_MGRSetupFrelaxVcycleData( void *mgr_vdata, { /* use the CF_marker from the outer MGR cycle to create the strength connection matrix */ + hypre_ParCSRMatrixMigrate(A_array_local[lev_local], HYPRE_MEMORY_HOST); 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_ParCSRMatrixMigrate(A_array_local[lev_local], memory_location); + hypre_ParCSRMatrixMigrate(S_local, memory_location); } else if (lev_local > 0) { @@ -1951,7 +1954,6 @@ hypre_MGRSetupFrelaxVcycleData( void *mgr_vdata, 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, @@ -1962,6 +1964,7 @@ hypre_MGRSetupFrelaxVcycleData( void *mgr_vdata, CF_marker_array_local[lev_local], &coarse_dof_func_lvl, coarse_pnts_global_lvl); + hypre_IntArrayMigrate(CF_marker_array_local[lev_local], HYPRE_MEMORY_HOST); if (my_id == (num_procs - 1)) { coarse_size = coarse_pnts_global_lvl[1]; @@ -1970,7 +1973,7 @@ hypre_MGRSetupFrelaxVcycleData( void *mgr_vdata, if (coarse_size == 0) // stop coarsening { - if (S_local) { hypre_ParCSRMatrixDestroy(S_local); } + hypre_ParCSRMatrixDestroy(S_local); hypre_IntArrayDestroy(coarse_dof_func_lvl); if (lev_local == 0) @@ -1984,7 +1987,7 @@ hypre_MGRSetupFrelaxVcycleData( void *mgr_vdata, { if (hypre_IntArrayData(CF_marker_array[lev])[i] == 1) { - CF_marker_local[i] = 0; + hypre_IntArrayData(CF_marker_array_local[lev_local])[i] = 0; } } } @@ -1993,7 +1996,8 @@ hypre_MGRSetupFrelaxVcycleData( void *mgr_vdata, /* 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]; + hypre_IntArrayData(CF_marker_array_local[lev_local])[i] = + hypre_IntArrayData(CF_marker_array[lev])[i]; } } } @@ -2005,13 +2009,14 @@ hypre_MGRSetupFrelaxVcycleData( void *mgr_vdata, 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); + hypre_IntArrayMigrate(CF_marker_array_local[lev_local], memory_location); + hypre_BoomerAMGBuildExtPIInterp(A_array_local[lev_local], + hypre_IntArrayData(CF_marker_array_local[lev_local]), + S_local, coarse_pnts_global_lvl, + num_functions, dof_func_data, + debug_flag, trunc_factor, + P_max_elmts, &P_local); + hypre_IntArrayMigrate(CF_marker_array_local[lev_local], HYPRE_MEMORY_HOST); /* 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 @@ -2025,7 +2030,7 @@ hypre_MGRSetupFrelaxVcycleData( void *mgr_vdata, { if (hypre_IntArrayData(CF_marker_array[lev])[i] == 1) { - CF_marker_local[i] = 0; + hypre_IntArrayData(CF_marker_array_local[lev_local])[i] = 0; } } } @@ -2034,10 +2039,13 @@ hypre_MGRSetupFrelaxVcycleData( void *mgr_vdata, /* 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]; + hypre_IntArrayData(CF_marker_array_local[lev_local])[i] = + hypre_IntArrayData(CF_marker_array[lev])[i]; } } } + hypre_IntArrayMigrate(CF_marker_array_local[lev_local], memory_location); + /* Save interpolation matrix pointer */ P_array_local[lev_local] = P_local; @@ -2047,17 +2055,18 @@ hypre_MGRSetupFrelaxVcycleData( void *mgr_vdata, } /* build the coarse grid */ - hypre_BoomerAMGBuildCoarseOperatorKT(P_local, A_array_local[lev_local], - P_local, 0, &RAP_local); + RAP_local = hypre_ParCSRMatrixRAPKT(P_local, + A_array_local[lev_local], + P_local, 0, 1); /* 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_ParCSRMatrixDestroy(S_local); S_local = NULL; + if ((lev_local == max_local_lvls - 1) || + (coarse_size <= max_local_coarse_size)) { not_finished = 0; } @@ -2066,13 +2075,14 @@ hypre_MGRSetupFrelaxVcycleData( void *mgr_vdata, 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]); + hypre_ParVectorInitialize_v2(F_array_local[lev_local], memory_location); 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]); + hypre_ParVectorInitialize_v2(U_array_local[lev_local], memory_location); } // end while loop + hypre_IntArrayMigrate(CF_marker_array[lev], memory_location); // setup Vcycle data (FrelaxVcycleData[lev] -> A_array) = A_array_local; @@ -2081,16 +2091,10 @@ hypre_MGRSetupFrelaxVcycleData( void *mgr_vdata, (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 ((lev_local > 0) && + (hypre_ParAMGDataUserCoarseRelaxType(FrelaxVcycleData[lev]) == 9)) { if ((coarse_size <= max_local_coarse_size) && coarse_size > 0) { diff --git a/src/parcsr_ls/par_mgr_solve.c b/src/parcsr_ls/par_mgr_solve.c index 5769337ea1..f5191ca860 100644 --- a/src/parcsr_ls/par_mgr_solve.c +++ b/src/parcsr_ls/par_mgr_solve.c @@ -283,6 +283,7 @@ hypre_MGRFrelaxVcycle ( void *Frelax_vdata, HYPRE_Int local_size; HYPRE_Int num_sweeps = 1; HYPRE_Int relax_order = hypre_ParAMGDataRelaxOrder(Frelax_data); + HYPRE_Int amg_relax_order; HYPRE_Int relax_type = 3; HYPRE_Real relax_weight = 1.0; HYPRE_Real omega = 1.0; @@ -308,6 +309,10 @@ hypre_MGRFrelaxVcycle ( void *Frelax_vdata, HYPRE_Complex fp_one = 1.0; HYPRE_Complex fp_neg_one = - fp_one; +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec; +#endif + HYPRE_ANNOTATE_FUNC_BEGIN; F_array[0] = f; @@ -319,6 +324,19 @@ hypre_MGRFrelaxVcycle ( void *Frelax_vdata, CF_marker = hypre_IntArrayData(CF_marker_array[0]); } + /* Disable internal relax. order in AMG when running on GPUs */ +#if defined(HYPRE_USING_GPU) + exec = hypre_GetExecPolicy1(hypre_ParCSRMatrixMemoryLocation(A_array[0])); + if (exec == HYPRE_EXEC_DEVICE) + { + amg_relax_order = 0; + } + else +#endif + { + amg_relax_order = relax_order; + } + /* (Re)set local_size for Vtemp */ local_size = hypre_VectorSize(hypre_ParVectorLocalVector(F_array[0])); hypre_ParVectorSetLocalSize(Vtemp, local_size); @@ -335,7 +353,7 @@ hypre_MGRFrelaxVcycle ( void *Frelax_vdata, F_array[0], CF_marker, relax_type, - relax_order, + amg_relax_order, 1, relax_weight, omega, @@ -353,7 +371,7 @@ hypre_MGRFrelaxVcycle ( void *Frelax_vdata, F_array[0], CF_marker, relax_type, - -1, + amg_relax_order, relax_weight, omega, NULL, @@ -381,8 +399,12 @@ hypre_MGRFrelaxVcycle ( void *Frelax_vdata, hypre_ParVectorSetZeros(U_array[coarse_grid]); /* 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); + hypre_ParCSRMatrixMatvecOutOfPlace(fp_neg_one, + A_array[fine_grid], + U_array[fine_grid], + fp_one, + F_array[fine_grid], + Vtemp); hypre_ParCSRMatrixMatvecT(fp_one, R_array[fine_grid], Vtemp, fp_zero, F_array[coarse_grid]); @@ -418,7 +440,7 @@ hypre_MGRFrelaxVcycle ( void *Frelax_vdata, Aux_F, CF_marker, relax_type, - relax_order, + amg_relax_order, cycle_param, relax_weight, omega, @@ -448,7 +470,7 @@ hypre_MGRFrelaxVcycle ( void *Frelax_vdata, Aux_F, CF_marker, relax_type, - relax_order, + amg_relax_order, cycle_param, relax_weight, omega, diff --git a/src/parcsr_ls/par_mod_multi_interp_device.c b/src/parcsr_ls/par_mod_multi_interp_device.c index 1167bae093..afd27682a6 100644 --- a/src/parcsr_ls/par_mod_multi_interp_device.c +++ b/src/parcsr_ls/par_mod_multi_interp_device.c @@ -51,8 +51,7 @@ struct globalC_functor }; #else template -struct tuple_plus : public - thrust::binary_function, thrust::tuple, thrust::tuple > +struct tuple_plus { __host__ __device__ thrust::tuple operator()( const thrust::tuple & x1, const thrust::tuple & x2) @@ -63,8 +62,7 @@ struct tuple_plus : public }; template -struct tuple_minus : public - thrust::binary_function, thrust::tuple, thrust::tuple > +struct tuple_minus { __host__ __device__ thrust::tuple operator()( const thrust::tuple & x1, const thrust::tuple & x2) @@ -74,8 +72,7 @@ struct tuple_minus : public } }; -struct local_equal_plus_constant : public - thrust::binary_function +struct local_equal_plus_constant { HYPRE_BigInt _value; @@ -131,8 +128,8 @@ __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 *fine_to_coarse, HYPRE_Int *fine_to_coarse_offd, HYPRE_Int *A_diag_i, + HYPRE_Complex *A_diag_data, HYPRE_Int *A_offd_i, 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 ); @@ -529,7 +526,7 @@ hypre_BoomerAMGBuildModMultipassDevice( hypre_ParCSRMatrix *A, thrust::make_permutation_iterator(pass_marker, points_left), thrust::make_permutation_iterator(pass_marker, points_left + remaining), diag_shifts, - thrust::identity(), + HYPRE_THRUST_IDENTITY(HYPRE_Int), current_pass + 1 ); hypre_TMemcpy(points_left_old, points_left, HYPRE_Int, remaining, HYPRE_MEMORY_DEVICE, @@ -541,7 +538,7 @@ hypre_BoomerAMGBuildModMultipassDevice( hypre_ParCSRMatrix *A, points_left_old + remaining, diag_shifts, pass_order + cnt_old, - thrust::identity() ); + HYPRE_THRUST_IDENTITY(HYPRE_Int) ); hypre_assert(new_end - pass_order == cnt); @@ -550,7 +547,7 @@ hypre_BoomerAMGBuildModMultipassDevice( hypre_ParCSRMatrix *A, points_left_old + remaining, diag_shifts, points_left, - HYPRE_THRUST_NOT(thrust::identity()) ); + HYPRE_THRUST_NOT(HYPRE_THRUST_IDENTITY(HYPRE_Int)) ); #endif hypre_assert(new_end - points_left == cnt_rem); @@ -999,12 +996,10 @@ hypre_GenerateMultipassPiDevice( hypre_ParCSRMatrix *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_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); @@ -1206,10 +1201,8 @@ hypre_GenerateMultipassPiDevice( hypre_ParCSRMatrix *A, 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, @@ -1945,10 +1938,8 @@ void hypreGPUKernel_generate_Pdiag_j_Poffd_j( hypre_DeviceItem &item, 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, diff --git a/src/parcsr_ls/par_relax_device.c b/src/parcsr_ls/par_relax_device.c index da76b94762..dfd6e86ad6 100644 --- a/src/parcsr_ls/par_relax_device.c +++ b/src/parcsr_ls/par_relax_device.c @@ -5,7 +5,7 @@ * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #include "_hypre_parcsr_ls.h" #include "_hypre_utilities.hpp" diff --git a/src/parcsr_ls/par_relax_more_device.c b/src/parcsr_ls/par_relax_more_device.c index 2eeb334c92..f5c98ea635 100644 --- a/src/parcsr_ls/par_relax_more_device.c +++ b/src/parcsr_ls/par_relax_more_device.c @@ -29,7 +29,6 @@ hypreGPUKernel_CSRMaxEigEstimate(hypre_DeviceItem &item, 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, @@ -126,8 +125,6 @@ hypre_ParCSRMaxEigEstimateDevice( hypre_ParCSRMatrix *A, HYPRE_Int *A_diag_i; HYPRE_Int *A_offd_i; HYPRE_Int *A_diag_j; - HYPRE_Int *A_offd_j; - A_num_rows = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A)); @@ -140,7 +137,6 @@ hypre_ParCSRMaxEigEstimateDevice( hypre_ParCSRMatrix *A, A_diag_j = hypre_CSRMatrixJ(hypre_ParCSRMatrixDiag(A)); A_diag_data = hypre_CSRMatrixData(hypre_ParCSRMatrixDiag(A)); A_offd_i = hypre_CSRMatrixI(hypre_ParCSRMatrixOffd(A)); - A_offd_j = hypre_CSRMatrixJ(hypre_ParCSRMatrixOffd(A)); A_offd_data = hypre_CSRMatrixData(hypre_ParCSRMatrixOffd(A)); dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); @@ -153,7 +149,6 @@ hypre_ParCSRMaxEigEstimateDevice( hypre_ParCSRMatrix *A, A_diag_j, A_diag_data, A_offd_i, - A_offd_j, A_offd_data, rowsums_lower, rowsums_upper, diff --git a/src/parcsr_ls/protos.h b/src/parcsr_ls/protos.h index b8621b197c..3141bb6579 100644 --- a/src/parcsr_ls/protos.h +++ b/src/parcsr_ls/protos.h @@ -92,8 +92,10 @@ 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_AMGHybridSetPrecond ( void *pcg_vdata, + HYPRE_Int (*solve)(void*, void*, void*, void*), + HYPRE_Int (*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 ); @@ -234,7 +236,6 @@ 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, @@ -283,731 +284,13 @@ HYPRE_Int hypre_GenerateSubComm ( MPI_Comm comm, HYPRE_Int participate, MPI_Comm 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_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_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_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_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_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_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_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_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 ); -#ifdef HYPRE_USING_DSUPERLU -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_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_parcsr_bicgstab.c */ -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_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_parcsr_cgnr.c */ -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_parcsr_Euclid.c */ -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_parcsr_flexgmres.c */ -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_parcsr_gmres.c */ -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_ParCSRGMRESSetRefSolution(HYPRE_Solver solver, HYPRE_ParVector ref_solution); -HYPRE_Int HYPRE_ParCSRGMRESGetRefSolution(HYPRE_Solver solver, HYPRE_ParVector *ref_solution); -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_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_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_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_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_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_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_parcsr_ParaSails.c */ -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_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_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_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_parcsr_pilut.c */ -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_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 ); /* par_add_cycle.c */ HYPRE_Int hypre_BoomerAMGAdditiveCycle ( void *amg_vdata ); @@ -1256,7 +539,6 @@ HYPRE_Int hypre_BoomerAMGCoarsenCGC ( hypre_ParCSRMatrix *S, HYPRE_Int numberofg 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, @@ -1328,11 +610,6 @@ HYPRE_Int hypre_BoomerAMGCoarseParmsDevice ( MPI_Comm comm, HYPRE_Int local_num_ HYPRE_Int hypre_BoomerAMGInitDofFuncDevice( HYPRE_Int *dof_func, HYPRE_Int local_size, HYPRE_Int offset, HYPRE_Int num_functions ); -/* par_coordinates.c */ -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, @@ -1372,11 +649,6 @@ HYPRE_Int hypre_BoomerAMGCoarsenCR ( hypre_ParCSRMatrix *A, hypre_IntArray **CF_ 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 ); - /* 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 ); @@ -1465,23 +737,15 @@ HYPRE_Int hypre_ParCSRMatrix_dof_func_offd ( hypre_ParCSRMatrix *A, HYPRE_Int nu 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 ); /* 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 ); /* 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 ); @@ -1836,8 +1100,6 @@ 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, @@ -1845,10 +1107,6 @@ HYPRE_Int hypre_ParCSRMaxEigEstimateDevice ( hypre_ParCSRMatrix *A, HYPRE_Int sc 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 ); - /* par_scaled_matnorm.c */ HYPRE_Int hypre_ParCSRMatrixScaledNorm ( hypre_ParCSRMatrix *A, HYPRE_Real *scnorm ); @@ -1956,9 +1214,6 @@ HYPRE_Int hypre_BoomerAMGBuildPartialExtInterp ( hypre_ParCSRMatrix *A, HYPRE_In 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 ); @@ -1970,9 +1225,6 @@ 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 ); @@ -2140,8 +1392,6 @@ HYPRE_Int hypre_MGRSetReservedCpointsLevelToKeep( void *mgr_vdata, HYPRE_Int lev 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_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, @@ -2179,16 +1429,10 @@ HYPRE_Int hypre_MGRBlockRelaxSolve( hypre_ParCSRMatrix *A, hypre_ParVector *f, 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 ); diff --git a/src/parcsr_mv/CMakeLists.txt b/src/parcsr_mv/CMakeLists.txt index 68bfb287d2..7c0f810394 100644 --- a/src/parcsr_mv/CMakeLists.txt +++ b/src/parcsr_mv/CMakeLists.txt @@ -8,15 +8,27 @@ set(HDRS _hypre_parcsr_mv.h ) -set(SRCS +# Add MUP headers +if(HYPRE_ENABLE_MIXED_PRECISION) + list(APPEND HDRS + HYPRE_parcsr_mv_mp.h + HYPRE_parcsr_mv_mup.h + _hypre_parcsr_mv_mup.h + _hypre_parcsr_mv_mup_def.h + _hypre_parcsr_mv_mup_undef.h + ) +endif() + +# Regular sources +set(REGULAR_SRCS communicationT.c F90_HYPRE_parcsr_matrix.c F90_HYPRE_parcsr_vector.c F90_parcsr_matrix.c F90_par_vector.c - gen_fffc.c HYPRE_parcsr_matrix.c HYPRE_parcsr_vector.c + gen_fffc.c new_commpkg.c numbers.c par_csr_aat.c @@ -25,30 +37,41 @@ set(SRCS 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_csr_matop_marked.c + par_csr_triplemat.c + par_make_system.c par_vector.c par_vector_batched.c - par_make_system.c - par_csr_triplemat.c par_csr_fffc_device.c + par_csr_filter_device.c par_csr_matop_device.c + par_csr_matmat_device.c + par_csr_matvec_device.c par_csr_triplemat_device.c par_vector_device.c ) -target_sources(${PROJECT_NAME} - PRIVATE ${SRCS} - ${HDRS} +# Mixed precision sources +set(MUP_SRCS + mup_fixed.c + mup_functions.c + mup_pre.c + parcsr_mv_mp.c + HYPRE_parcsr_mv_mp.c ) +if(HYPRE_ENABLE_MIXED_PRECISION) + setup_mixed_precision_compilation("parcsr_mv" SRCS "${REGULAR_SRCS}") + target_sources(${PROJECT_NAME} PRIVATE ${MUP_SRCS} ${HDRS}) +else() + target_sources(${PROJECT_NAME} PRIVATE ${REGULAR_SRCS} ${HDRS}) +endif() + if (HYPRE_USING_GPU) set(GPU_SRCS par_csr_matmat_device.c diff --git a/src/parcsr_mv/F90_HYPRE_parcsr_matrix.c b/src/parcsr_mv/F90_HYPRE_parcsr_matrix.c index 5849ff6be9..d44e066e00 100644 --- a/src/parcsr_mv/F90_HYPRE_parcsr_matrix.c +++ b/src/parcsr_mv/F90_HYPRE_parcsr_matrix.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_parcsr_mv.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/parcsr_mv/F90_HYPRE_parcsr_vector.c b/src/parcsr_mv/F90_HYPRE_parcsr_vector.c index 2bbc952be0..3ad40db948 100644 --- a/src/parcsr_mv/F90_HYPRE_parcsr_vector.c +++ b/src/parcsr_mv/F90_HYPRE_parcsr_vector.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_parcsr_mv.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/parcsr_mv/F90_par_vector.c b/src/parcsr_mv/F90_par_vector.c index bb8f2c5bad..9765d1c582 100644 --- a/src/parcsr_mv/F90_par_vector.c +++ b/src/parcsr_mv/F90_par_vector.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_parcsr_mv.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/parcsr_mv/F90_parcsr_matrix.c b/src/parcsr_mv/F90_parcsr_matrix.c index b446c5b584..d4b103180c 100644 --- a/src/parcsr_mv/F90_parcsr_matrix.c +++ b/src/parcsr_mv/F90_parcsr_matrix.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_parcsr_mv.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/parcsr_mv/HYPRE_parcsr_matrix.c b/src/parcsr_mv/HYPRE_parcsr_matrix.c index 05c554762f..08e255b9c4 100644 --- a/src/parcsr_mv/HYPRE_parcsr_matrix.c +++ b/src/parcsr_mv/HYPRE_parcsr_matrix.c @@ -449,3 +449,16 @@ HYPRE_ParCSRMatrixComputeScalingTagged(HYPRE_ParCSRMatrix A, type, memloc_tags, num_tags, tags, (hypre_ParVector **) scaling_ptr) ); } + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixMatmat( HYPRE_ParCSRMatrix A, + HYPRE_ParCSRMatrix B, + HYPRE_ParCSRMatrix *C ) +{ + *C = hypre_ParCSRMatMat(A, B); + + return hypre_error_flag; +} diff --git a/src/parcsr_mv/HYPRE_parcsr_mv.h b/src/parcsr_mv/HYPRE_parcsr_mv.h index c025f4e48b..8a637ccbc6 100644 --- a/src/parcsr_mv/HYPRE_parcsr_mv.h +++ b/src/parcsr_mv/HYPRE_parcsr_mv.h @@ -17,77 +17,345 @@ #include "HYPRE_utilities.h" #include "HYPRE_seq_mv.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_parcsr_mv_mup_def.h" +#endif + #ifdef __cplusplus extern "C" { #endif /*-------------------------------------------------------------------------- - * Structures *--------------------------------------------------------------------------*/ +/** + * @defgroup ParCSRInterface ParCSR Object Interface + * + * Interface for ParCSR matrices and vectors. This is an interface for matrices + * and vectors with object type HYPRE_PARCSR. + * + * @{ + **/ + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +/** + * @name ParCSR Matrices + * + * @{ + **/ + struct hypre_ParCSRMatrix_struct; +/** + * The matrix object. ParCSR matrices use a parallel compressed-sparse-row (CSR) + * storage format that consists of a diagonal CSR matrix for intra-processor + * couplings and an off-diagonal CSR matrix for inter-processor couplings. + **/ typedef struct hypre_ParCSRMatrix_struct *HYPRE_ParCSRMatrix; + +/** + * Create a matrix object. More info here about arguments... + **/ +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); + +/** + * Destroy a matrix object. + **/ +HYPRE_Int +HYPRE_ParCSRMatrixDestroy(HYPRE_ParCSRMatrix matrix); + +/** + * Prepare a matrix object for setting coefficient values. + **/ +HYPRE_Int +HYPRE_ParCSRMatrixInitialize(HYPRE_ParCSRMatrix matrix); + +/** + * Read a matrix from file. + **/ +HYPRE_Int +HYPRE_ParCSRMatrixRead(MPI_Comm comm, + const char *file_name, + HYPRE_ParCSRMatrix *matrix); + +/** + * Print a matrix to file. + **/ +HYPRE_Int +HYPRE_ParCSRMatrixPrint(HYPRE_ParCSRMatrix matrix, + const char *file_name); + +/*===== BEGIN 1 - IGNORE CODE IN DOCS =====*/ /*! \cond */ + +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); + +/*===== END 1 - IGNORE CODE IN DOCS =====*/ /*! \endcond */ + +/**@}*/ + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +/** + * @name ParCSR Vectors + * + * @{ + **/ + struct hypre_ParVector_struct; +/** + * The vector object. A Par vector is an array storage format compatible with + * ParCSR matrices. + **/ typedef struct hypre_ParVector_struct *HYPRE_ParVector; +/** + * Create a vector object. + **/ +HYPRE_Int +HYPRE_ParVectorCreate(MPI_Comm comm, + HYPRE_BigInt global_size, + HYPRE_BigInt *partitioning, + HYPRE_ParVector *vector); + +/** + * Destroy a vector object. + **/ +HYPRE_Int +HYPRE_ParVectorDestroy(HYPRE_ParVector vector); + + +/** + * Prepare a vector object for setting coefficient values. + **/ +HYPRE_Int +HYPRE_ParVectorInitialize(HYPRE_ParVector vector); + +/** + * Read a vector from file. + **/ +HYPRE_Int +HYPRE_ParVectorRead(MPI_Comm comm, + const char *file_name, + HYPRE_ParVector *vector); + +/** + * Print a vector to file. + **/ +HYPRE_Int +HYPRE_ParVectorPrint(HYPRE_ParVector vector, + const char *file_name); + +/*===== BEGIN 2 - IGNORE CODE IN DOCS =====*/ /*! \cond */ + +HYPRE_Int +HYPRE_ParMultiVectorCreate (MPI_Comm comm, + HYPRE_BigInt global_size, + HYPRE_BigInt *partitioning, + HYPRE_Int number_vectors, + HYPRE_ParVector *vector); + +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_ParVector +HYPRE_ParVectorCloneShallow(HYPRE_ParVector x); + + +/*===== END 2 - IGNORE CODE IN DOCS =====*/ /*! \endcond */ + +/**@}*/ + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +/** + * @name Basic Matrix/vector routines + * + * @{ + **/ + +/** + * Copy vector x into y (\f$y \leftarrow x\f$). + **/ +HYPRE_Int +HYPRE_ParVectorCopy(HYPRE_ParVector x, + HYPRE_ParVector y); + +/** + * Scale a vector by \e alpha (\f$y \leftarrow \alpha y\f$). + **/ +HYPRE_Int +HYPRE_ParVectorScale(HYPRE_Complex value, + HYPRE_ParVector x); + +/** + * Compute \f$y = y + \alpha x\f$. + **/ +HYPRE_Int +HYPRE_ParVectorAxpy(HYPRE_Complex alpha, + HYPRE_ParVector x, + HYPRE_ParVector y); + +/** + * Compute \e result, the inner product of vectors \e x and \e y. + **/ +HYPRE_Int +HYPRE_ParVectorInnerProd(HYPRE_ParVector x, + HYPRE_ParVector y, + HYPRE_Real *result); + +/** + * Compute a matrix-vector product \f$y = \alpha A x + \beta y\f$. + **/ +HYPRE_Int +HYPRE_ParCSRMatrixMatvec(HYPRE_Complex alpha, + HYPRE_ParCSRMatrix A, + HYPRE_ParVector x, + HYPRE_Complex beta, + HYPRE_ParVector y); + +/** + * Compute a transpose matrix-vector product \f$y = \alpha A^T x + \beta y\f$. + **/ +HYPRE_Int +HYPRE_ParCSRMatrixMatvecT(HYPRE_Complex alpha, + HYPRE_ParCSRMatrix A, + HYPRE_ParVector x, + HYPRE_Complex beta, + HYPRE_ParVector y); + +/** + * Matrix-matrix multiply. + **/ +HYPRE_Int +HYPRE_ParCSRMatrixMatmat(HYPRE_ParCSRMatrix A, + HYPRE_ParCSRMatrix B, + HYPRE_ParCSRMatrix *C); + +/*===== BEGIN 3 - IGNORE CODE IN DOCS =====*/ /*! \cond */ + +HYPRE_Int +HYPRE_ParCSRMatrixDiagScale(HYPRE_ParCSRMatrix A, + HYPRE_ParVector left, + HYPRE_ParVector right); + +HYPRE_Int +HYPRE_ParCSRMatrixComputeScalingTagged(HYPRE_ParCSRMatrix A, + HYPRE_Int type, + HYPRE_MemoryLocation memloc_tags, + HYPRE_Int num_tags, + HYPRE_Int *tags, + HYPRE_ParVector *scaling_ptr); + +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); + +/*===== END 3 - IGNORE CODE IN DOCS =====*/ /*! \endcond */ + +/**@}*/ + /*-------------------------------------------------------------------------- - * Prototypes *--------------------------------------------------------------------------*/ -/* 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_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_ParCSRMatrixDiagScale( HYPRE_ParCSRMatrix A, HYPRE_ParVector left, - HYPRE_ParVector right ); -HYPRE_Int HYPRE_ParCSRMatrixComputeScalingTagged( HYPRE_ParCSRMatrix A, HYPRE_Int type, - HYPRE_MemoryLocation memloc_tags, HYPRE_Int num_tags, - HYPRE_Int *tags, HYPRE_ParVector *scaling_ptr ); - -/* HYPRE_parcsr_vector.c */ -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_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 +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_parcsr_mv_mup_undef.h" +#include "HYPRE_parcsr_mv_mup.h" +#include "HYPRE_parcsr_mv_mp.h" +#endif +#endif + #endif diff --git a/src/parcsr_mv/HYPRE_parcsr_mv_mp.c b/src/parcsr_mv/HYPRE_parcsr_mv_mp.c new file mode 100644 index 0000000000..c69e558ddf --- /dev/null +++ b/src/parcsr_mv/HYPRE_parcsr_mv_mp.c @@ -0,0 +1,47 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_parcsr interface mixed precision functions + * + *****************************************************************************/ + +#include "_hypre_parcsr_mv.h" + +#ifdef HYPRE_MIXED_PRECISION +/*-------------------------------------------------------------------------- + * Mixed-precision HYPRE_ParVectorCopy + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParVectorCopy_mp( HYPRE_ParVector x, + HYPRE_ParVector y ) +{ + return ( hypre_ParVectorCopy_mp( (hypre_ParVector *) x, + (hypre_ParVector *) y ) ); +} + +HYPRE_Int +HYPRE_ParVectorConvert_mp( HYPRE_ParVector v, + HYPRE_Precision new_precision) +{ + hypre_ParVectorConvert_mp( (hypre_ParVector *) v, + new_precision ); + return hypre_error_flag; +} + +HYPRE_Int +HYPRE_ParCSRMatrixConvert_mp( HYPRE_ParCSRMatrix A, + HYPRE_Precision new_precision) +{ + hypre_ParCSRMatrixConvert_mp( (hypre_ParCSRMatrix *) A, + new_precision ); + return hypre_error_flag; +} + +#endif diff --git a/src/parcsr_mv/HYPRE_parcsr_mv_mp.h b/src/parcsr_mv/HYPRE_parcsr_mv_mp.h new file mode 100644 index 0000000000..36dbbd5f04 --- /dev/null +++ b/src/parcsr_mv/HYPRE_parcsr_mv_mp.h @@ -0,0 +1,35 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for HYPRE_parcsr_mv library + * + *****************************************************************************/ + +#ifndef HYPRE_PARCSR_MV_MP_HEADER +#define HYPRE_PARCSR_MV_MP_HEADER + +#ifdef HYPRE_MIXED_PRECISION + +#ifdef __cplusplus +extern "C" { +#endif + +HYPRE_Int HYPRE_ParVectorCopy_mp( HYPRE_ParVector x, HYPRE_ParVector y ); + +HYPRE_Int HYPRE_ParVectorConvert_mp( HYPRE_ParVector v, HYPRE_Precision new_precision ); + +HYPRE_Int HYPRE_ParCSRMatrixConvert_mp( HYPRE_ParCSRMatrix A, HYPRE_Precision new_precision ); + +#ifdef __cplusplus +} +#endif + +#endif + +#endif diff --git a/src/parcsr_mv/HYPRE_parcsr_mv_mup.h b/src/parcsr_mv/HYPRE_parcsr_mv_mup.h new file mode 100644 index 0000000000..e27883f706 --- /dev/null +++ b/src/parcsr_mv/HYPRE_parcsr_mv_mup.h @@ -0,0 +1,485 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#ifndef HYPRE_PARCSR_MV_MUP_HEADER +#define HYPRE_PARCSR_MV_MUP_HEADER + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (HYPRE_MIXED_PRECISION) + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_CSRMatrixToParCSRMatrix_flt( MPI_Comm comm, HYPRE_CSRMatrix A_CSR, HYPRE_BigInt *row_partitioning, HYPRE_BigInt *col_partitioning, HYPRE_ParCSRMatrix *matrix ); +HYPRE_Int +HYPRE_CSRMatrixToParCSRMatrix_dbl( MPI_Comm comm, HYPRE_CSRMatrix A_CSR, HYPRE_BigInt *row_partitioning, HYPRE_BigInt *col_partitioning, HYPRE_ParCSRMatrix *matrix ); +HYPRE_Int +HYPRE_CSRMatrixToParCSRMatrix_long_dbl( MPI_Comm comm, HYPRE_CSRMatrix A_CSR, HYPRE_BigInt *row_partitioning, HYPRE_BigInt *col_partitioning, HYPRE_ParCSRMatrix *matrix ); +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_flt( MPI_Comm comm, HYPRE_CSRMatrix A_CSR, HYPRE_ParCSRMatrix *matrix ); +HYPRE_Int +HYPRE_CSRMatrixToParCSRMatrix_WithNewPartitioning_dbl( MPI_Comm comm, HYPRE_CSRMatrix A_CSR, HYPRE_ParCSRMatrix *matrix ); +HYPRE_Int +HYPRE_CSRMatrixToParCSRMatrix_WithNewPartitioning_long_dbl( MPI_Comm comm, HYPRE_CSRMatrix A_CSR, HYPRE_ParCSRMatrix *matrix ); +HYPRE_Int +HYPRE_CSRMatrixToParCSRMatrix_WithNewPartitioning( MPI_Comm comm, HYPRE_CSRMatrix A_CSR, HYPRE_ParCSRMatrix *matrix ); + +HYPRE_Int +HYPRE_ParCSRMatrixComputeScalingTagged_flt( HYPRE_ParCSRMatrix A, HYPRE_Int type, HYPRE_MemoryLocation memloc_tags, HYPRE_Int num_tags, HYPRE_Int *tags, HYPRE_ParVector *scaling_ptr ); +HYPRE_Int +HYPRE_ParCSRMatrixComputeScalingTagged_dbl( HYPRE_ParCSRMatrix A, HYPRE_Int type, HYPRE_MemoryLocation memloc_tags, HYPRE_Int num_tags, HYPRE_Int *tags, HYPRE_ParVector *scaling_ptr ); +HYPRE_Int +HYPRE_ParCSRMatrixComputeScalingTagged_long_dbl( HYPRE_ParCSRMatrix A, HYPRE_Int type, HYPRE_MemoryLocation memloc_tags, HYPRE_Int num_tags, HYPRE_Int *tags, HYPRE_ParVector *scaling_ptr ); +HYPRE_Int +HYPRE_ParCSRMatrixComputeScalingTagged( HYPRE_ParCSRMatrix A, HYPRE_Int type, HYPRE_MemoryLocation memloc_tags, HYPRE_Int num_tags, HYPRE_Int *tags, HYPRE_ParVector *scaling_ptr ); + +HYPRE_Int +HYPRE_ParCSRMatrixCreate_flt( 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_dbl( 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_long_dbl( 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_flt( HYPRE_ParCSRMatrix matrix ); +HYPRE_Int +HYPRE_ParCSRMatrixDestroy_dbl( HYPRE_ParCSRMatrix matrix ); +HYPRE_Int +HYPRE_ParCSRMatrixDestroy_long_dbl( HYPRE_ParCSRMatrix matrix ); +HYPRE_Int +HYPRE_ParCSRMatrixDestroy( HYPRE_ParCSRMatrix matrix ); + +HYPRE_Int +HYPRE_ParCSRMatrixDiagScale_flt( HYPRE_ParCSRMatrix A, HYPRE_ParVector left, HYPRE_ParVector right ); +HYPRE_Int +HYPRE_ParCSRMatrixDiagScale_dbl( HYPRE_ParCSRMatrix A, HYPRE_ParVector left, HYPRE_ParVector right ); +HYPRE_Int +HYPRE_ParCSRMatrixDiagScale_long_dbl( HYPRE_ParCSRMatrix A, HYPRE_ParVector left, HYPRE_ParVector right ); +HYPRE_Int +HYPRE_ParCSRMatrixDiagScale( HYPRE_ParCSRMatrix A, HYPRE_ParVector left, HYPRE_ParVector right ); + +HYPRE_Int +HYPRE_ParCSRMatrixGetColPartitioning_flt( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt **col_partitioning_ptr ); +HYPRE_Int +HYPRE_ParCSRMatrixGetColPartitioning_dbl( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt **col_partitioning_ptr ); +HYPRE_Int +HYPRE_ParCSRMatrixGetColPartitioning_long_dbl( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt **col_partitioning_ptr ); +HYPRE_Int +HYPRE_ParCSRMatrixGetColPartitioning( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt **col_partitioning_ptr ); + +HYPRE_Int +HYPRE_ParCSRMatrixGetComm_flt( HYPRE_ParCSRMatrix matrix, MPI_Comm *comm ); +HYPRE_Int +HYPRE_ParCSRMatrixGetComm_dbl( HYPRE_ParCSRMatrix matrix, MPI_Comm *comm ); +HYPRE_Int +HYPRE_ParCSRMatrixGetComm_long_dbl( HYPRE_ParCSRMatrix matrix, MPI_Comm *comm ); +HYPRE_Int +HYPRE_ParCSRMatrixGetComm( HYPRE_ParCSRMatrix matrix, MPI_Comm *comm ); + +HYPRE_Int +HYPRE_ParCSRMatrixGetDims_flt( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt *M, HYPRE_BigInt *N ); +HYPRE_Int +HYPRE_ParCSRMatrixGetDims_dbl( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt *M, HYPRE_BigInt *N ); +HYPRE_Int +HYPRE_ParCSRMatrixGetDims_long_dbl( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt *M, HYPRE_BigInt *N ); +HYPRE_Int +HYPRE_ParCSRMatrixGetDims( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt *M, HYPRE_BigInt *N ); + +HYPRE_Int +HYPRE_ParCSRMatrixGetGlobalRowPartitioning_flt( HYPRE_ParCSRMatrix matrix, HYPRE_Int all_procs, HYPRE_BigInt **row_partitioning_ptr ); +HYPRE_Int +HYPRE_ParCSRMatrixGetGlobalRowPartitioning_dbl( HYPRE_ParCSRMatrix matrix, HYPRE_Int all_procs, HYPRE_BigInt **row_partitioning_ptr ); +HYPRE_Int +HYPRE_ParCSRMatrixGetGlobalRowPartitioning_long_dbl( HYPRE_ParCSRMatrix matrix, HYPRE_Int all_procs, HYPRE_BigInt **row_partitioning_ptr ); +HYPRE_Int +HYPRE_ParCSRMatrixGetGlobalRowPartitioning( HYPRE_ParCSRMatrix matrix, HYPRE_Int all_procs, HYPRE_BigInt **row_partitioning_ptr ); + +HYPRE_Int +HYPRE_ParCSRMatrixGetLocalRange_flt( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt *row_start, HYPRE_BigInt *row_end, HYPRE_BigInt *col_start, HYPRE_BigInt *col_end ); +HYPRE_Int +HYPRE_ParCSRMatrixGetLocalRange_dbl( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt *row_start, HYPRE_BigInt *row_end, HYPRE_BigInt *col_start, HYPRE_BigInt *col_end ); +HYPRE_Int +HYPRE_ParCSRMatrixGetLocalRange_long_dbl( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt *row_start, HYPRE_BigInt *row_end, HYPRE_BigInt *col_start, HYPRE_BigInt *col_end ); +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_flt( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind, hypre_float **values ); +HYPRE_Int +HYPRE_ParCSRMatrixGetRow_dbl( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind, hypre_double **values ); +HYPRE_Int +HYPRE_ParCSRMatrixGetRow_long_dbl( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind, hypre_long_double **values ); +HYPRE_Int +HYPRE_ParCSRMatrixGetRow( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind, void *values ); + +HYPRE_Int +HYPRE_ParCSRMatrixGetRowPartitioning_flt( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt **row_partitioning_ptr ); +HYPRE_Int +HYPRE_ParCSRMatrixGetRowPartitioning_dbl( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt **row_partitioning_ptr ); +HYPRE_Int +HYPRE_ParCSRMatrixGetRowPartitioning_long_dbl( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt **row_partitioning_ptr ); +HYPRE_Int +HYPRE_ParCSRMatrixGetRowPartitioning( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt **row_partitioning_ptr ); + +HYPRE_Int +HYPRE_ParCSRMatrixInitialize_flt( HYPRE_ParCSRMatrix matrix ); +HYPRE_Int +HYPRE_ParCSRMatrixInitialize_dbl( HYPRE_ParCSRMatrix matrix ); +HYPRE_Int +HYPRE_ParCSRMatrixInitialize_long_dbl( HYPRE_ParCSRMatrix matrix ); +HYPRE_Int +HYPRE_ParCSRMatrixInitialize( HYPRE_ParCSRMatrix matrix ); + +HYPRE_Int +HYPRE_ParCSRMatrixMatmat_flt( HYPRE_ParCSRMatrix A, HYPRE_ParCSRMatrix B, HYPRE_ParCSRMatrix *C ); +HYPRE_Int +HYPRE_ParCSRMatrixMatmat_dbl( HYPRE_ParCSRMatrix A, HYPRE_ParCSRMatrix B, HYPRE_ParCSRMatrix *C ); +HYPRE_Int +HYPRE_ParCSRMatrixMatmat_long_dbl( HYPRE_ParCSRMatrix A, HYPRE_ParCSRMatrix B, HYPRE_ParCSRMatrix *C ); +HYPRE_Int +HYPRE_ParCSRMatrixMatmat( HYPRE_ParCSRMatrix A, HYPRE_ParCSRMatrix B, HYPRE_ParCSRMatrix *C ); + +HYPRE_Int +HYPRE_ParCSRMatrixMatvec_flt( hypre_float alpha, HYPRE_ParCSRMatrix A, HYPRE_ParVector x, hypre_float beta, HYPRE_ParVector y ); +HYPRE_Int +HYPRE_ParCSRMatrixMatvec_dbl( hypre_double alpha, HYPRE_ParCSRMatrix A, HYPRE_ParVector x, hypre_double beta, HYPRE_ParVector y ); +HYPRE_Int +HYPRE_ParCSRMatrixMatvec_long_dbl( hypre_long_double alpha, HYPRE_ParCSRMatrix A, HYPRE_ParVector x, hypre_long_double beta, HYPRE_ParVector y ); +HYPRE_Int +HYPRE_ParCSRMatrixMatvec( hypre_long_double alpha, HYPRE_ParCSRMatrix A, HYPRE_ParVector x, hypre_long_double beta, HYPRE_ParVector y ); + +HYPRE_Int +HYPRE_ParCSRMatrixMatvecT_flt( hypre_float alpha, HYPRE_ParCSRMatrix A, HYPRE_ParVector x, hypre_float beta, HYPRE_ParVector y ); +HYPRE_Int +HYPRE_ParCSRMatrixMatvecT_dbl( hypre_double alpha, HYPRE_ParCSRMatrix A, HYPRE_ParVector x, hypre_double beta, HYPRE_ParVector y ); +HYPRE_Int +HYPRE_ParCSRMatrixMatvecT_long_dbl( hypre_long_double alpha, HYPRE_ParCSRMatrix A, HYPRE_ParVector x, hypre_long_double beta, HYPRE_ParVector y ); +HYPRE_Int +HYPRE_ParCSRMatrixMatvecT( hypre_long_double alpha, HYPRE_ParCSRMatrix A, HYPRE_ParVector x, hypre_long_double beta, HYPRE_ParVector y ); + +HYPRE_Int +HYPRE_ParCSRMatrixPrint_flt( HYPRE_ParCSRMatrix matrix, const char *file_name ); +HYPRE_Int +HYPRE_ParCSRMatrixPrint_dbl( HYPRE_ParCSRMatrix matrix, const char *file_name ); +HYPRE_Int +HYPRE_ParCSRMatrixPrint_long_dbl( HYPRE_ParCSRMatrix matrix, const char *file_name ); +HYPRE_Int +HYPRE_ParCSRMatrixPrint( HYPRE_ParCSRMatrix matrix, const char *file_name ); + +HYPRE_Int +HYPRE_ParCSRMatrixRead_flt( MPI_Comm comm, const char *file_name, HYPRE_ParCSRMatrix *matrix ); +HYPRE_Int +HYPRE_ParCSRMatrixRead_dbl( MPI_Comm comm, const char *file_name, HYPRE_ParCSRMatrix *matrix ); +HYPRE_Int +HYPRE_ParCSRMatrixRead_long_dbl( MPI_Comm comm, const char *file_name, HYPRE_ParCSRMatrix *matrix ); +HYPRE_Int +HYPRE_ParCSRMatrixRead( MPI_Comm comm, const char *file_name, HYPRE_ParCSRMatrix *matrix ); + +HYPRE_Int +HYPRE_ParCSRMatrixRestoreRow_flt( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind, hypre_float **values ); +HYPRE_Int +HYPRE_ParCSRMatrixRestoreRow_dbl( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind, hypre_double **values ); +HYPRE_Int +HYPRE_ParCSRMatrixRestoreRow_long_dbl( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind, hypre_long_double **values ); +HYPRE_Int +HYPRE_ParCSRMatrixRestoreRow( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind, void *values ); + +HYPRE_Int +HYPRE_ParMultiVectorCreate_flt( MPI_Comm comm, HYPRE_BigInt global_size, HYPRE_BigInt *partitioning, HYPRE_Int number_vectors, HYPRE_ParVector *vector ); +HYPRE_Int +HYPRE_ParMultiVectorCreate_dbl( MPI_Comm comm, HYPRE_BigInt global_size, HYPRE_BigInt *partitioning, HYPRE_Int number_vectors, HYPRE_ParVector *vector ); +HYPRE_Int +HYPRE_ParMultiVectorCreate_long_dbl( MPI_Comm comm, HYPRE_BigInt global_size, HYPRE_BigInt *partitioning, HYPRE_Int number_vectors, 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_ParVectorAxpy_flt( hypre_float alpha, HYPRE_ParVector x, HYPRE_ParVector y ); +HYPRE_Int +HYPRE_ParVectorAxpy_dbl( hypre_double alpha, HYPRE_ParVector x, HYPRE_ParVector y ); +HYPRE_Int +HYPRE_ParVectorAxpy_long_dbl( hypre_long_double alpha, HYPRE_ParVector x, HYPRE_ParVector y ); +HYPRE_Int +HYPRE_ParVectorAxpy( hypre_long_double alpha, HYPRE_ParVector x, HYPRE_ParVector y ); + +HYPRE_ParVector +HYPRE_ParVectorCloneShallow_flt( HYPRE_ParVector x ); +HYPRE_ParVector +HYPRE_ParVectorCloneShallow_dbl( HYPRE_ParVector x ); +HYPRE_ParVector +HYPRE_ParVectorCloneShallow_long_dbl( HYPRE_ParVector x ); +HYPRE_ParVector +HYPRE_ParVectorCloneShallow( HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParVectorCopy_flt( HYPRE_ParVector x, HYPRE_ParVector y ); +HYPRE_Int +HYPRE_ParVectorCopy_dbl( HYPRE_ParVector x, HYPRE_ParVector y ); +HYPRE_Int +HYPRE_ParVectorCopy_long_dbl( HYPRE_ParVector x, HYPRE_ParVector y ); +HYPRE_Int +HYPRE_ParVectorCopy( HYPRE_ParVector x, HYPRE_ParVector y ); + +HYPRE_Int +HYPRE_ParVectorCreate_flt( MPI_Comm comm, HYPRE_BigInt global_size, HYPRE_BigInt *partitioning, HYPRE_ParVector *vector ); +HYPRE_Int +HYPRE_ParVectorCreate_dbl( MPI_Comm comm, HYPRE_BigInt global_size, HYPRE_BigInt *partitioning, HYPRE_ParVector *vector ); +HYPRE_Int +HYPRE_ParVectorCreate_long_dbl( 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_flt( HYPRE_ParVector vector ); +HYPRE_Int +HYPRE_ParVectorDestroy_dbl( HYPRE_ParVector vector ); +HYPRE_Int +HYPRE_ParVectorDestroy_long_dbl( HYPRE_ParVector vector ); +HYPRE_Int +HYPRE_ParVectorDestroy( HYPRE_ParVector vector ); + +HYPRE_Int +HYPRE_ParVectorGetValues_flt( HYPRE_ParVector vector, HYPRE_Int num_values, HYPRE_BigInt *indices, hypre_float *values ); +HYPRE_Int +HYPRE_ParVectorGetValues_dbl( HYPRE_ParVector vector, HYPRE_Int num_values, HYPRE_BigInt *indices, hypre_double *values ); +HYPRE_Int +HYPRE_ParVectorGetValues_long_dbl( HYPRE_ParVector vector, HYPRE_Int num_values, HYPRE_BigInt *indices, hypre_long_double *values ); +HYPRE_Int +HYPRE_ParVectorGetValues( HYPRE_ParVector vector, HYPRE_Int num_values, HYPRE_BigInt *indices, void *values ); + +HYPRE_Int +HYPRE_ParVectorInitialize_flt( HYPRE_ParVector vector ); +HYPRE_Int +HYPRE_ParVectorInitialize_dbl( HYPRE_ParVector vector ); +HYPRE_Int +HYPRE_ParVectorInitialize_long_dbl( HYPRE_ParVector vector ); +HYPRE_Int +HYPRE_ParVectorInitialize( HYPRE_ParVector vector ); + +HYPRE_Int +HYPRE_ParVectorInnerProd_flt( HYPRE_ParVector x, HYPRE_ParVector y, hypre_float *result ); +HYPRE_Int +HYPRE_ParVectorInnerProd_dbl( HYPRE_ParVector x, HYPRE_ParVector y, hypre_double *result ); +HYPRE_Int +HYPRE_ParVectorInnerProd_long_dbl( HYPRE_ParVector x, HYPRE_ParVector y, hypre_long_double *result ); +HYPRE_Int +HYPRE_ParVectorInnerProd( HYPRE_ParVector x, HYPRE_ParVector y, void *result ); + +HYPRE_Int +HYPRE_ParVectorPrint_flt( HYPRE_ParVector vector, const char *file_name ); +HYPRE_Int +HYPRE_ParVectorPrint_dbl( HYPRE_ParVector vector, const char *file_name ); +HYPRE_Int +HYPRE_ParVectorPrint_long_dbl( HYPRE_ParVector vector, const char *file_name ); +HYPRE_Int +HYPRE_ParVectorPrint( HYPRE_ParVector vector, const char *file_name ); + +HYPRE_Int +HYPRE_ParVectorPrintBinaryIJ_flt( HYPRE_ParVector vector, const char *file_name ); +HYPRE_Int +HYPRE_ParVectorPrintBinaryIJ_dbl( HYPRE_ParVector vector, const char *file_name ); +HYPRE_Int +HYPRE_ParVectorPrintBinaryIJ_long_dbl( HYPRE_ParVector vector, const char *file_name ); +HYPRE_Int +HYPRE_ParVectorPrintBinaryIJ( HYPRE_ParVector vector, const char *file_name ); + +HYPRE_Int +HYPRE_ParVectorRead_flt( MPI_Comm comm, const char *file_name, HYPRE_ParVector *vector ); +HYPRE_Int +HYPRE_ParVectorRead_dbl( MPI_Comm comm, const char *file_name, HYPRE_ParVector *vector ); +HYPRE_Int +HYPRE_ParVectorRead_long_dbl( MPI_Comm comm, const char *file_name, HYPRE_ParVector *vector ); +HYPRE_Int +HYPRE_ParVectorRead( MPI_Comm comm, const char *file_name, HYPRE_ParVector *vector ); + +HYPRE_Int +HYPRE_ParVectorScale_flt( hypre_float value, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParVectorScale_dbl( hypre_double value, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParVectorScale_long_dbl( hypre_long_double value, HYPRE_ParVector x ); +HYPRE_Int +HYPRE_ParVectorScale( hypre_long_double value, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParVectorSetConstantValues_flt( HYPRE_ParVector vector, hypre_float value ); +HYPRE_Int +HYPRE_ParVectorSetConstantValues_dbl( HYPRE_ParVector vector, hypre_double value ); +HYPRE_Int +HYPRE_ParVectorSetConstantValues_long_dbl( HYPRE_ParVector vector, hypre_long_double value ); +HYPRE_Int +HYPRE_ParVectorSetConstantValues( HYPRE_ParVector vector, hypre_long_double value ); + +HYPRE_Int +HYPRE_ParVectorSetRandomValues_flt( HYPRE_ParVector vector, HYPRE_Int seed ); +HYPRE_Int +HYPRE_ParVectorSetRandomValues_dbl( HYPRE_ParVector vector, HYPRE_Int seed ); +HYPRE_Int +HYPRE_ParVectorSetRandomValues_long_dbl( HYPRE_ParVector vector, HYPRE_Int seed ); +HYPRE_Int +HYPRE_ParVectorSetRandomValues( HYPRE_ParVector vector, HYPRE_Int seed ); + +HYPRE_Int +HYPRE_VectorToParVector_flt( MPI_Comm comm, HYPRE_Vector b, HYPRE_BigInt *partitioning, HYPRE_ParVector *vector ); +HYPRE_Int +HYPRE_VectorToParVector_dbl( MPI_Comm comm, HYPRE_Vector b, HYPRE_BigInt *partitioning, HYPRE_ParVector *vector ); +HYPRE_Int +HYPRE_VectorToParVector_long_dbl( MPI_Comm comm, HYPRE_Vector b, HYPRE_BigInt *partitioning, HYPRE_ParVector *vector ); +HYPRE_Int +HYPRE_VectorToParVector( MPI_Comm comm, HYPRE_Vector b, HYPRE_BigInt *partitioning, HYPRE_ParVector *vector ); + + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_CSRMatrixToParCSRMatrix_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_CSRMatrix A_CSR, HYPRE_BigInt *row_partitioning, HYPRE_BigInt *col_partitioning, HYPRE_ParCSRMatrix *matrix ); + +HYPRE_Int +HYPRE_CSRMatrixToParCSRMatrix_WithNewPartitioning_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_CSRMatrix A_CSR, HYPRE_ParCSRMatrix *matrix ); + +HYPRE_Int +HYPRE_ParCSRMatrixComputeScalingTagged_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix A, HYPRE_Int type, HYPRE_MemoryLocation memloc_tags, HYPRE_Int num_tags, HYPRE_Int *tags, HYPRE_ParVector *scaling_ptr ); + +HYPRE_Int +HYPRE_ParCSRMatrixCreate_pre( HYPRE_Precision precision, 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_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix matrix ); + +HYPRE_Int +HYPRE_ParCSRMatrixDiagScale_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix A, HYPRE_ParVector left, HYPRE_ParVector right ); + +HYPRE_Int +HYPRE_ParCSRMatrixGetColPartitioning_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix matrix, HYPRE_BigInt **col_partitioning_ptr ); + +HYPRE_Int +HYPRE_ParCSRMatrixGetComm_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix matrix, MPI_Comm *comm ); + +HYPRE_Int +HYPRE_ParCSRMatrixGetDims_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix matrix, HYPRE_BigInt *M, HYPRE_BigInt *N ); + +HYPRE_Int +HYPRE_ParCSRMatrixGetGlobalRowPartitioning_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix matrix, HYPRE_Int all_procs, HYPRE_BigInt **row_partitioning_ptr ); + +HYPRE_Int +HYPRE_ParCSRMatrixGetLocalRange_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix matrix, HYPRE_BigInt *row_start, HYPRE_BigInt *row_end, HYPRE_BigInt *col_start, HYPRE_BigInt *col_end ); + +HYPRE_Int +HYPRE_ParCSRMatrixGetRow_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix matrix, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind, void *values ); + +HYPRE_Int +HYPRE_ParCSRMatrixGetRowPartitioning_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix matrix, HYPRE_BigInt **row_partitioning_ptr ); + +HYPRE_Int +HYPRE_ParCSRMatrixInitialize_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix matrix ); + +HYPRE_Int +HYPRE_ParCSRMatrixMatmat_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix A, HYPRE_ParCSRMatrix B, HYPRE_ParCSRMatrix *C ); + +HYPRE_Int +HYPRE_ParCSRMatrixMatvec_pre( HYPRE_Precision precision, hypre_long_double alpha, HYPRE_ParCSRMatrix A, HYPRE_ParVector x, hypre_long_double beta, HYPRE_ParVector y ); + +HYPRE_Int +HYPRE_ParCSRMatrixMatvecT_pre( HYPRE_Precision precision, hypre_long_double alpha, HYPRE_ParCSRMatrix A, HYPRE_ParVector x, hypre_long_double beta, HYPRE_ParVector y ); + +HYPRE_Int +HYPRE_ParCSRMatrixPrint_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix matrix, const char *file_name ); + +HYPRE_Int +HYPRE_ParCSRMatrixRead_pre( HYPRE_Precision precision, MPI_Comm comm, const char *file_name, HYPRE_ParCSRMatrix *matrix ); + +HYPRE_Int +HYPRE_ParCSRMatrixRestoreRow_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix matrix, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind, void *values ); + +HYPRE_Int +HYPRE_ParMultiVectorCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_BigInt global_size, HYPRE_BigInt *partitioning, HYPRE_Int number_vectors, HYPRE_ParVector *vector ); + +HYPRE_Int +HYPRE_ParVectorAxpy_pre( HYPRE_Precision precision, hypre_long_double alpha, HYPRE_ParVector x, HYPRE_ParVector y ); + +HYPRE_ParVector +HYPRE_ParVectorCloneShallow_pre( HYPRE_Precision precision, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParVectorCopy_pre( HYPRE_Precision precision, HYPRE_ParVector x, HYPRE_ParVector y ); + +HYPRE_Int +HYPRE_ParVectorCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_BigInt global_size, HYPRE_BigInt *partitioning, HYPRE_ParVector *vector ); + +HYPRE_Int +HYPRE_ParVectorDestroy_pre( HYPRE_Precision precision, HYPRE_ParVector vector ); + +HYPRE_Int +HYPRE_ParVectorGetValues_pre( HYPRE_Precision precision, HYPRE_ParVector vector, HYPRE_Int num_values, HYPRE_BigInt *indices, void *values ); + +HYPRE_Int +HYPRE_ParVectorInitialize_pre( HYPRE_Precision precision, HYPRE_ParVector vector ); + +HYPRE_Int +HYPRE_ParVectorInnerProd_pre( HYPRE_Precision precision, HYPRE_ParVector x, HYPRE_ParVector y, void *result ); + +HYPRE_Int +HYPRE_ParVectorPrint_pre( HYPRE_Precision precision, HYPRE_ParVector vector, const char *file_name ); + +HYPRE_Int +HYPRE_ParVectorPrintBinaryIJ_pre( HYPRE_Precision precision, HYPRE_ParVector vector, const char *file_name ); + +HYPRE_Int +HYPRE_ParVectorRead_pre( HYPRE_Precision precision, MPI_Comm comm, const char *file_name, HYPRE_ParVector *vector ); + +HYPRE_Int +HYPRE_ParVectorScale_pre( HYPRE_Precision precision, hypre_long_double value, HYPRE_ParVector x ); + +HYPRE_Int +HYPRE_ParVectorSetConstantValues_pre( HYPRE_Precision precision, HYPRE_ParVector vector, hypre_long_double value ); + +HYPRE_Int +HYPRE_ParVectorSetRandomValues_pre( HYPRE_Precision precision, HYPRE_ParVector vector, HYPRE_Int seed ); + +HYPRE_Int +HYPRE_VectorToParVector_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_Vector b, HYPRE_BigInt *partitioning, HYPRE_ParVector *vector ); + + +#endif + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/src/parcsr_mv/Makefile b/src/parcsr_mv/Makefile index 20d218519e..05fa5ae7f4 100644 --- a/src/parcsr_mv/Makefile +++ b/src/parcsr_mv/Makefile @@ -20,6 +20,7 @@ C_COMPILE_FLAGS = \ HEADERS =\ HYPRE_parcsr_mv.h\ + HYPRE_parcsr_mv_mp.h\ _hypre_parcsr_mv.h\ new_commpkg.h\ numbers.h\ @@ -78,12 +79,35 @@ DRIVER_FILES =\ driver_matvec.c\ driver_multivec.c +# Mixed precision files +MP_FILES = \ + mup_fixed.c\ + mup_functions.c\ + mup_pre.c\ + parcsr_mv_mp.c\ + HYPRE_parcsr_mv_mp.c + COBJS = ${FILES:.c=.o} CUOBJS = ${CUFILES:.c=.obj} OBJS = ${COBJS} ${CUOBJS} DRIVER_OBJS = ${DRIVER_FILES:.c=.o} +ifeq (${MP_BUILD}, 1) + +COBJS_single = ${FILES:.c=.o_flt} +COBJS_double = ${FILES:.c=.o_dbl} +COBJS_longdouble = ${FILES:.c=.o_ldbl} +CUOBJS_single = ${CUFILES:.c=.obj_flt} +CUOBJS_double = ${CUFILES:.c=.obj_dbl} +CUOBJS_longdouble = ${CUFILES:.c=.obj_ldbl} +MP_COBJS = ${MP_FILES:.c=.o} + +OBJS = ${COBJS_single} ${COBJS_double} ${COBJS_longdouble} ${MP_COBJS} +OBJS += ${CUOBJS_single} ${CUOBJS_double} ${CUOBJS_longdouble} + +endif + SONAME = libHYPRE_parcsr_mv-${HYPRE_RELEASE_VERSION}${HYPRE_LIB_SUFFIX} ################################################################## @@ -92,7 +116,7 @@ SONAME = libHYPRE_parcsr_mv-${HYPRE_RELEASE_VERSION}${HYPRE_LIB_SUFFIX} all: libHYPRE_parcsr_mv${HYPRE_LIB_SUFFIX} cp -fR $(srcdir)/HYPRE_*.h $(HYPRE_BUILD_DIR)/include - cp -fR $(srcdir)/_hypre_parcsr_mv.h $(HYPRE_BUILD_DIR)/include + cp -fR $(srcdir)/_hypre_*.h $(HYPRE_BUILD_DIR)/include # cp -fR libHYPRE* $(HYPRE_BUILD_DIR)/lib driver: driver.o libHYPRE_parcsr_mv${HYPRE_LIB_SUFFIX} @@ -121,11 +145,13 @@ driver_boolaat: driver_boolaat.o libHYPRE_parcsr_mv${HYPRE_LIB_SUFFIX} install: libHYPRE_parcsr_mv${HYPRE_LIB_SUFFIX} cp -fR $(srcdir)/HYPRE_*.h $(HYPRE_INC_INSTALL) - cp -fR $(srcdir)/_hypre_parcsr_mv.h $(HYPRE_INC_INSTALL) + cp -fR $(srcdir)/_hypre_*.h $(HYPRE_INC_INSTALL) # cp -fR libHYPRE* $(HYPRE_LIB_INSTALL) clean: rm -f *.o *.obj libHYPRE* + rm -f *.o_flt *.o_dbl *.o_ldbl + rm -f *.obj_flt *.obj_dbl *.obj_ldbl rm -f driver driver_matvec driver_matmul rm -rf pchdir tca.map *inslog* diff --git a/src/parcsr_mv/_hypre_parcsr_mv.h b/src/parcsr_mv/_hypre_parcsr_mv.h index 9161330f7a..128e549e16 100644 --- a/src/parcsr_mv/_hypre_parcsr_mv.h +++ b/src/parcsr_mv/_hypre_parcsr_mv.h @@ -8,7 +8,11 @@ #include "HYPRE_parcsr_mv.h" #include "_hypre_utilities.h" #include "_hypre_seq_block_mv.h" -#include "seq_mv.h" +#include "_hypre_seq_mv.h" + +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_parcsr_mv_mup_def.h" +#endif #ifdef __cplusplus extern "C" { @@ -254,6 +258,9 @@ typedef struct hypre_ParVector_struct hypre_IJAssumedPart *assumed_partition; /* only populated if this partition needed (for setting off-proc elements, for example)*/ +#if defined(HYPRE_MIXED_PRECISION) + HYPRE_Precision vector_precision; +#endif } hypre_ParVector; /*-------------------------------------------------------------------------- @@ -281,6 +288,10 @@ typedef struct hypre_ParVector_struct #define hypre_ParVectorAssumedPartition(vector) ((vector) -> assumed_partition) +#if defined(HYPRE_MIXED_PRECISION) +#define hypre_ParVectorPrecision(vector) ((vector) -> vector_precision) +#endif + static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_MemoryLocation hypre_ParVectorMemoryLocation(hypre_ParVector *vector) { @@ -373,6 +384,10 @@ typedef struct hypre_ParCSRMatrix_struct HYPRE_Int *soc_offd_j; #endif +#if defined(HYPRE_MIXED_PRECISION) + HYPRE_Precision matrix_precision; +#endif + } hypre_ParCSRMatrix; /*-------------------------------------------------------------------------- @@ -414,6 +429,10 @@ typedef struct hypre_ParCSRMatrix_struct #define hypre_ParCSRMatrixNumRows(matrix) hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(matrix)) #define hypre_ParCSRMatrixNumCols(matrix) hypre_CSRMatrixNumCols(hypre_ParCSRMatrixDiag(matrix)) +#if defined(HYPRE_MIXED_PRECISION) +#define hypre_ParCSRMatrixPrecision(matrix) ((matrix) -> matrix_precision) +#endif + static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_MemoryLocation hypre_ParCSRMatrixMemoryLocation(hypre_ParCSRMatrix *matrix) { @@ -700,99 +719,31 @@ 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_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_ParCSRMatrixDiagScale ( HYPRE_ParCSRMatrix A, HYPRE_ParVector left, - HYPRE_ParVector right ); -HYPRE_Int HYPRE_ParCSRMatrixComputeScalingTagged ( HYPRE_ParCSRMatrix A, HYPRE_Int type, - HYPRE_MemoryLocation memloc_tags, HYPRE_Int num_tags, - HYPRE_Int *tags, HYPRE_ParVector *scaling_ptr ); - -/* 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_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_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_ParVectorPointwiseDivision ( HYPRE_ParVector x, HYPRE_ParVector y, - HYPRE_ParVector *z_ptr ); -HYPRE_Int HYPRE_ParVectorPointwiseProduct ( HYPRE_ParVector x, HYPRE_ParVector y, - HYPRE_ParVector *z_ptr ); -HYPRE_Int HYPRE_ParVectorPointwiseInverse ( HYPRE_ParVector x, HYPRE_ParVector *y_ptr ); -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_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_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_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_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_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_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_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 ) ; + hypre_ParCSRMatrix **AXC_ptr ); /* new_commpkg.c */ HYPRE_Int hypre_PrintCommpkg ( hypre_ParCSRMatrix *A, const char *file_name ); @@ -1107,31 +1058,29 @@ 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_Int 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_Int 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 hypre_ParCSRMatrixZero_F ( hypre_ParCSRMatrix *P, HYPRE_Int *CF_marker ); +HYPRE_Int hypre_ParCSRMatrixCopy_C ( hypre_ParCSRMatrix *P, hypre_ParCSRMatrix *C, HYPRE_Int *CF_marker ); /* par_csr_matrix.c */ @@ -1180,7 +1129,6 @@ hypre_ParCSRMatrix *hypre_CSRMatrixToParCSRMatrix ( MPI_Comm comm, hypre_CSRMatr HYPRE_BigInt *row_starts, HYPRE_BigInt *col_starts ); HYPRE_Int hypre_GenerateDiagAndOffd ( hypre_CSRMatrix *A, hypre_ParCSRMatrix *matrix, HYPRE_BigInt first_col_diag, HYPRE_BigInt last_col_diag ); -#define GenerateDiagAndOffd hypre_GenerateDiagAndOffd // TODO (VPM): remove this macro in the next release hypre_CSRMatrix *hypre_MergeDiagAndOffd ( hypre_ParCSRMatrix *par_matrix ); hypre_CSRMatrix *hypre_MergeDiagAndOffdDevice ( hypre_ParCSRMatrix *par_matrix ); hypre_CSRMatrix *hypre_ParCSRMatrixToCSRMatrixAll ( hypre_ParCSRMatrix *par_matrix ); @@ -1201,8 +1149,10 @@ HYPRE_Int hypre_ParCSRMatrixTruncate(hypre_ParCSRMatrix *A, HYPRE_Real tol, 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); +HYPRE_Int hypre_ParCSRMatrixCopyColMapOffdToDevice(hypre_ParCSRMatrix *A); +HYPRE_Int hypre_ParCSRMatrixCopyColMapOffdToHost(hypre_ParCSRMatrix *A); +HYPRE_Int hypre_ParCSRMatrixEliminateRowsCols(hypre_ParCSRMatrix *A, + HYPRE_Int nrows, HYPRE_Int *rows); /* par_csr_matrix_stats.c */ HYPRE_Int hypre_ParCSRMatrixStatsArrayCompute( HYPRE_Int num_matrices, @@ -1255,17 +1205,19 @@ hypre_ParCSRMatrix *hypre_ParCSRTMatMatKTDevice( hypre_ParCSRMatrix *A, hypre_P 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_ParCSRTMatMat( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B); +hypre_ParCSRMatrix *hypre_ParCSRMatrixRAPKT( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *P, HYPRE_Int keep_transpose, + HYPRE_Int has_diagonal ); hypre_ParCSRMatrix *hypre_ParCSRMatrixRAP( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, - hypre_ParCSRMatrix *P ); + hypre_ParCSRMatrix *P ); hypre_ParCSRMatrix* hypre_ParCSRMatrixRAPKTDevice( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, - hypre_ParCSRMatrix *P, HYPRE_Int keep_transpose ); + hypre_ParCSRMatrix *P, HYPRE_Int keep_transpose, + HYPRE_Int has_diagonal ); hypre_ParCSRMatrix* hypre_ParCSRMatrixRAPKTHost( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, HYPRE_Int keep_transpose ); -/* par_make_system.c */ +/* par_make_system.c RDF: Why are external functions here? */ 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 ); @@ -1352,10 +1304,53 @@ HYPRE_Int hypre_ParVectorPointwiseInverse( hypre_ParVector *x, hypre_ParVector * HYPRE_Int hypre_ParVectorGetValuesDevice(hypre_ParVector *vector, HYPRE_Int num_values, HYPRE_BigInt *indices, HYPRE_BigInt base, HYPRE_Complex *values); +/* HYPRE_parcsr_vector.c */ +HYPRE_Int hypre_ParVectorStridedCopy( hypre_ParVector *x, HYPRE_Int istride, HYPRE_Int ostride, + HYPRE_Int size, HYPRE_Complex *data ); +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/* Mixed precision function protos */ +/* parcsr_mv_mp.c */ + +#ifdef HYPRE_MIXED_PRECISION +HYPRE_Int +hypre_ParVectorCopy_mp( hypre_ParVector *x, + hypre_ParVector *y ); + +HYPRE_Int +hypre_ParVectorAxpy_mp( hypre_double alpha, + hypre_ParVector *x, + hypre_ParVector *y ); + +HYPRE_Int +hypre_ParVectorConvert_mp ( hypre_ParVector *v, + HYPRE_Precision new_precision ); + +HYPRE_Int +hypre_ParCSRMatrixConvert_mp ( hypre_ParCSRMatrix *A, + HYPRE_Precision new_precision ); + +#endif #ifdef __cplusplus } #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_parcsr_mv_mup_undef.h" +#include "_hypre_parcsr_mv_mup.h" +#endif +#endif + #endif diff --git a/src/parcsr_mv/_hypre_parcsr_mv_mup.h b/src/parcsr_mv/_hypre_parcsr_mv_mup.h new file mode 100644 index 0000000000..aa7871bcf3 --- /dev/null +++ b/src/parcsr_mv/_hypre_parcsr_mv_mup.h @@ -0,0 +1,1568 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#ifndef hypre_PARCSR_MV_MUP_HEADER +#define hypre_PARCSR_MV_MUP_HEADER + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (HYPRE_MIXED_PRECISION) + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_IJAssumedPart * +hypre_AssumedPartitionCreate_flt( MPI_Comm comm, HYPRE_BigInt global_num, HYPRE_BigInt start, HYPRE_BigInt end ); +hypre_IJAssumedPart * +hypre_AssumedPartitionCreate_dbl( MPI_Comm comm, HYPRE_BigInt global_num, HYPRE_BigInt start, HYPRE_BigInt end ); +hypre_IJAssumedPart * +hypre_AssumedPartitionCreate_long_dbl( MPI_Comm comm, HYPRE_BigInt global_num, HYPRE_BigInt start, HYPRE_BigInt end ); + +HYPRE_Int +hypre_AssumedPartitionDestroy_flt( hypre_IJAssumedPart *apart ); +HYPRE_Int +hypre_AssumedPartitionDestroy_dbl( hypre_IJAssumedPart *apart ); +HYPRE_Int +hypre_AssumedPartitionDestroy_long_dbl( hypre_IJAssumedPart *apart ); + +HYPRE_Int +hypre_BooleanGenerateDiagAndOffd_flt( hypre_CSRBooleanMatrix *A, hypre_ParCSRBooleanMatrix *matrix, HYPRE_BigInt first_col_diag, HYPRE_BigInt last_col_diag ); +HYPRE_Int +hypre_BooleanGenerateDiagAndOffd_dbl( hypre_CSRBooleanMatrix *A, hypre_ParCSRBooleanMatrix *matrix, HYPRE_BigInt first_col_diag, HYPRE_BigInt last_col_diag ); +HYPRE_Int +hypre_BooleanGenerateDiagAndOffd_long_dbl( hypre_CSRBooleanMatrix *A, hypre_ParCSRBooleanMatrix *matrix, HYPRE_BigInt first_col_diag, HYPRE_BigInt last_col_diag ); + +HYPRE_Int +hypre_BooleanMatTCommPkgCreate_flt( hypre_ParCSRBooleanMatrix *A ); +HYPRE_Int +hypre_BooleanMatTCommPkgCreate_dbl( hypre_ParCSRBooleanMatrix *A ); +HYPRE_Int +hypre_BooleanMatTCommPkgCreate_long_dbl( hypre_ParCSRBooleanMatrix *A ); + +HYPRE_Int +hypre_BooleanMatvecCommPkgCreate_flt( hypre_ParCSRBooleanMatrix *A ); +HYPRE_Int +hypre_BooleanMatvecCommPkgCreate_dbl( hypre_ParCSRBooleanMatrix *A ); +HYPRE_Int +hypre_BooleanMatvecCommPkgCreate_long_dbl( hypre_ParCSRBooleanMatrix *A ); + +HYPRE_Int +hypre_BuildCSRBooleanMatrixMPIDataType_flt( HYPRE_Int num_nonzeros, HYPRE_Int num_rows, HYPRE_Int *a_i, HYPRE_Int *a_j, hypre_MPI_Datatype *csr_matrix_datatype ); +HYPRE_Int +hypre_BuildCSRBooleanMatrixMPIDataType_dbl( HYPRE_Int num_nonzeros, HYPRE_Int num_rows, HYPRE_Int *a_i, HYPRE_Int *a_j, hypre_MPI_Datatype *csr_matrix_datatype ); +HYPRE_Int +hypre_BuildCSRBooleanMatrixMPIDataType_long_dbl( HYPRE_Int num_nonzeros, HYPRE_Int num_rows, HYPRE_Int *a_i, HYPRE_Int *a_j, hypre_MPI_Datatype *csr_matrix_datatype ); + +HYPRE_Int +hypre_BuildCSRJDataType_flt( HYPRE_Int num_nonzeros, hypre_float *a_data, HYPRE_Int *a_j, hypre_MPI_Datatype *csr_jdata_datatype ); +HYPRE_Int +hypre_BuildCSRJDataType_dbl( HYPRE_Int num_nonzeros, hypre_double *a_data, HYPRE_Int *a_j, hypre_MPI_Datatype *csr_jdata_datatype ); +HYPRE_Int +hypre_BuildCSRJDataType_long_dbl( HYPRE_Int num_nonzeros, hypre_long_double *a_data, HYPRE_Int *a_j, hypre_MPI_Datatype *csr_jdata_datatype ); + +HYPRE_Int +hypre_BuildCSRMatrixMPIDataType_flt( HYPRE_Int num_nonzeros, HYPRE_Int num_rows, hypre_float *a_data, HYPRE_Int *a_i, HYPRE_Int *a_j, hypre_MPI_Datatype *csr_matrix_datatype ); +HYPRE_Int +hypre_BuildCSRMatrixMPIDataType_dbl( HYPRE_Int num_nonzeros, HYPRE_Int num_rows, hypre_double *a_data, HYPRE_Int *a_i, HYPRE_Int *a_j, hypre_MPI_Datatype *csr_matrix_datatype ); +HYPRE_Int +hypre_BuildCSRMatrixMPIDataType_long_dbl( HYPRE_Int num_nonzeros, HYPRE_Int num_rows, hypre_long_double *a_data, HYPRE_Int *a_i, HYPRE_Int *a_j, hypre_MPI_Datatype *csr_matrix_datatype ); + +HYPRE_Int +hypre_CSRBooleanMatrixBigInitialize_flt( hypre_CSRBooleanMatrix *matrix ); +HYPRE_Int +hypre_CSRBooleanMatrixBigInitialize_dbl( hypre_CSRBooleanMatrix *matrix ); +HYPRE_Int +hypre_CSRBooleanMatrixBigInitialize_long_dbl( hypre_CSRBooleanMatrix *matrix ); + +hypre_CSRBooleanMatrix * +hypre_CSRBooleanMatrixCreate_flt( HYPRE_Int num_rows, HYPRE_Int num_cols, HYPRE_Int num_nonzeros ); +hypre_CSRBooleanMatrix * +hypre_CSRBooleanMatrixCreate_dbl( HYPRE_Int num_rows, HYPRE_Int num_cols, HYPRE_Int num_nonzeros ); +hypre_CSRBooleanMatrix * +hypre_CSRBooleanMatrixCreate_long_dbl( HYPRE_Int num_rows, HYPRE_Int num_cols, HYPRE_Int num_nonzeros ); + +HYPRE_Int +hypre_CSRBooleanMatrixDestroy_flt( hypre_CSRBooleanMatrix *matrix ); +HYPRE_Int +hypre_CSRBooleanMatrixDestroy_dbl( hypre_CSRBooleanMatrix *matrix ); +HYPRE_Int +hypre_CSRBooleanMatrixDestroy_long_dbl( hypre_CSRBooleanMatrix *matrix ); + +HYPRE_Int +hypre_CSRBooleanMatrixInitialize_flt( hypre_CSRBooleanMatrix *matrix ); +HYPRE_Int +hypre_CSRBooleanMatrixInitialize_dbl( hypre_CSRBooleanMatrix *matrix ); +HYPRE_Int +hypre_CSRBooleanMatrixInitialize_long_dbl( hypre_CSRBooleanMatrix *matrix ); + +HYPRE_Int +hypre_CSRBooleanMatrixPrint_flt( hypre_CSRBooleanMatrix *matrix, const char *file_name ); +HYPRE_Int +hypre_CSRBooleanMatrixPrint_dbl( hypre_CSRBooleanMatrix *matrix, const char *file_name ); +HYPRE_Int +hypre_CSRBooleanMatrixPrint_long_dbl( hypre_CSRBooleanMatrix *matrix, const char *file_name ); + +hypre_CSRBooleanMatrix * +hypre_CSRBooleanMatrixRead_flt( const char *file_name ); +hypre_CSRBooleanMatrix * +hypre_CSRBooleanMatrixRead_dbl( const char *file_name ); +hypre_CSRBooleanMatrix * +hypre_CSRBooleanMatrixRead_long_dbl( const char *file_name ); + +HYPRE_Int +hypre_CSRBooleanMatrixSetDataOwner_flt( hypre_CSRBooleanMatrix *matrix, HYPRE_Int owns_data ); +HYPRE_Int +hypre_CSRBooleanMatrixSetDataOwner_dbl( hypre_CSRBooleanMatrix *matrix, HYPRE_Int owns_data ); +HYPRE_Int +hypre_CSRBooleanMatrixSetDataOwner_long_dbl( hypre_CSRBooleanMatrix *matrix, HYPRE_Int owns_data ); + +hypre_ParCSRBooleanMatrix * +hypre_CSRBooleanMatrixToParCSRBooleanMatrix_flt( MPI_Comm comm, hypre_CSRBooleanMatrix *A, HYPRE_BigInt *row_starts, HYPRE_BigInt *col_starts ); +hypre_ParCSRBooleanMatrix * +hypre_CSRBooleanMatrixToParCSRBooleanMatrix_dbl( MPI_Comm comm, hypre_CSRBooleanMatrix *A, HYPRE_BigInt *row_starts, HYPRE_BigInt *col_starts ); +hypre_ParCSRBooleanMatrix * +hypre_CSRBooleanMatrixToParCSRBooleanMatrix_long_dbl( MPI_Comm comm, hypre_CSRBooleanMatrix *A, HYPRE_BigInt *row_starts, HYPRE_BigInt *col_starts ); + +hypre_ParCSRMatrix * +hypre_CSRMatrixToParCSRMatrix_flt( MPI_Comm comm, hypre_CSRMatrix *A, HYPRE_BigInt *row_starts, HYPRE_BigInt *col_starts ); +hypre_ParCSRMatrix * +hypre_CSRMatrixToParCSRMatrix_dbl( MPI_Comm comm, hypre_CSRMatrix *A, HYPRE_BigInt *row_starts, HYPRE_BigInt *col_starts ); +hypre_ParCSRMatrix * +hypre_CSRMatrixToParCSRMatrix_long_dbl( MPI_Comm comm, hypre_CSRMatrix *A, HYPRE_BigInt *row_starts, HYPRE_BigInt *col_starts ); + +HYPRE_Int +hypre_ExchangeExternalRowsInit_flt( hypre_CSRMatrix *B_ext, hypre_ParCSRCommPkg *comm_pkg_A, void **request_ptr ); +HYPRE_Int +hypre_ExchangeExternalRowsInit_dbl( hypre_CSRMatrix *B_ext, hypre_ParCSRCommPkg *comm_pkg_A, void **request_ptr ); +HYPRE_Int +hypre_ExchangeExternalRowsInit_long_dbl( hypre_CSRMatrix *B_ext, hypre_ParCSRCommPkg *comm_pkg_A, void **request_ptr ); + +hypre_CSRMatrix* +hypre_ExchangeExternalRowsWait_flt( void *vequest ); +hypre_CSRMatrix* +hypre_ExchangeExternalRowsWait_dbl( void *vequest ); +hypre_CSRMatrix* +hypre_ExchangeExternalRowsWait_long_dbl( void *vequest ); + +HYPRE_Int +hypre_FillResponseIJDetermineSendProcs_flt( 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_dbl( 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_long_dbl( 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_FillResponseParToCSRMatrix_flt( 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_FillResponseParToCSRMatrix_dbl( 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_FillResponseParToCSRMatrix_long_dbl( 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_FillResponseParToVectorAll_flt( 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_FillResponseParToVectorAll_dbl( 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_FillResponseParToVectorAll_long_dbl( 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_GenerateDiagAndOffd_flt( hypre_CSRMatrix *A, hypre_ParCSRMatrix *matrix, HYPRE_BigInt first_col_diag, HYPRE_BigInt last_col_diag ); +HYPRE_Int +hypre_GenerateDiagAndOffd_dbl( hypre_CSRMatrix *A, hypre_ParCSRMatrix *matrix, HYPRE_BigInt first_col_diag, HYPRE_BigInt last_col_diag ); +HYPRE_Int +hypre_GenerateDiagAndOffd_long_dbl( hypre_CSRMatrix *A, hypre_ParCSRMatrix *matrix, HYPRE_BigInt first_col_diag, HYPRE_BigInt last_col_diag ); + +HYPRE_Int +hypre_GetAssumedPartitionProcFromRow_flt( MPI_Comm comm, HYPRE_BigInt row, HYPRE_BigInt global_first_row, HYPRE_BigInt global_num_rows, HYPRE_Int *proc_id ); +HYPRE_Int +hypre_GetAssumedPartitionProcFromRow_dbl( MPI_Comm comm, HYPRE_BigInt row, HYPRE_BigInt global_first_row, HYPRE_BigInt global_num_rows, HYPRE_Int *proc_id ); +HYPRE_Int +hypre_GetAssumedPartitionProcFromRow_long_dbl( MPI_Comm comm, HYPRE_BigInt row, HYPRE_BigInt global_first_row, HYPRE_BigInt global_num_rows, HYPRE_Int *proc_id ); + +HYPRE_Int +hypre_GetAssumedPartitionRowRange_flt( 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_GetAssumedPartitionRowRange_dbl( 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_GetAssumedPartitionRowRange_long_dbl( 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_LocateAssumedPartition_flt( 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_Int +hypre_LocateAssumedPartition_dbl( 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_Int +hypre_LocateAssumedPartition_long_dbl( 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_Int +hypre_MatTCommPkgCreate_flt( hypre_ParCSRMatrix *A ); +HYPRE_Int +hypre_MatTCommPkgCreate_dbl( hypre_ParCSRMatrix *A ); +HYPRE_Int +hypre_MatTCommPkgCreate_long_dbl( hypre_ParCSRMatrix *A ); + +void +hypre_MatTCommPkgCreate_core_flt( 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_MatTCommPkgCreate_core_dbl( 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_MatTCommPkgCreate_core_long_dbl( 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_MatvecCommPkgCreate_flt( hypre_ParCSRMatrix *A ); +HYPRE_Int +hypre_MatvecCommPkgCreate_dbl( hypre_ParCSRMatrix *A ); +HYPRE_Int +hypre_MatvecCommPkgCreate_long_dbl( hypre_ParCSRMatrix *A ); + +HYPRE_Int +hypre_MatvecCommPkgDestroy_flt( hypre_ParCSRCommPkg *comm_pkg ); +HYPRE_Int +hypre_MatvecCommPkgDestroy_dbl( hypre_ParCSRCommPkg *comm_pkg ); +HYPRE_Int +hypre_MatvecCommPkgDestroy_long_dbl( hypre_ParCSRCommPkg *comm_pkg ); + +hypre_CSRMatrix * +hypre_MergeDiagAndOffd_flt( hypre_ParCSRMatrix *par_matrix ); +hypre_CSRMatrix * +hypre_MergeDiagAndOffd_dbl( hypre_ParCSRMatrix *par_matrix ); +hypre_CSRMatrix * +hypre_MergeDiagAndOffd_long_dbl( hypre_ParCSRMatrix *par_matrix ); + +HYPRE_Int +hypre_NewCommPkgDestroy_flt( hypre_ParCSRMatrix *parcsr_A ); +HYPRE_Int +hypre_NewCommPkgDestroy_dbl( hypre_ParCSRMatrix *parcsr_A ); +HYPRE_Int +hypre_NewCommPkgDestroy_long_dbl( hypre_ParCSRMatrix *parcsr_A ); + +HYPRE_Int * +hypre_NumbersArray_flt( hypre_NumbersNode *node ); +HYPRE_Int * +hypre_NumbersArray_dbl( hypre_NumbersNode *node ); +HYPRE_Int * +hypre_NumbersArray_long_dbl( hypre_NumbersNode *node ); + +void +hypre_NumbersDeleteNode_flt( hypre_NumbersNode *node ); +void +hypre_NumbersDeleteNode_dbl( hypre_NumbersNode *node ); +void +hypre_NumbersDeleteNode_long_dbl( hypre_NumbersNode *node ); + +HYPRE_Int +hypre_NumbersEnter_flt( hypre_NumbersNode *node, const HYPRE_Int n ); +HYPRE_Int +hypre_NumbersEnter_dbl( hypre_NumbersNode *node, const HYPRE_Int n ); +HYPRE_Int +hypre_NumbersEnter_long_dbl( hypre_NumbersNode *node, const HYPRE_Int n ); + +HYPRE_Int +hypre_NumbersNEntered_flt( hypre_NumbersNode *node ); +HYPRE_Int +hypre_NumbersNEntered_dbl( hypre_NumbersNode *node ); +HYPRE_Int +hypre_NumbersNEntered_long_dbl( hypre_NumbersNode *node ); + +hypre_NumbersNode * +hypre_NumbersNewNode_flt( void ); +hypre_NumbersNode * +hypre_NumbersNewNode_dbl( void ); +hypre_NumbersNode * +hypre_NumbersNewNode_long_dbl( void ); + +HYPRE_Int +hypre_NumbersQuery_flt( hypre_NumbersNode *node, const HYPRE_Int n ); +HYPRE_Int +hypre_NumbersQuery_dbl( hypre_NumbersNode *node, const HYPRE_Int n ); +HYPRE_Int +hypre_NumbersQuery_long_dbl( hypre_NumbersNode *node, const HYPRE_Int n ); + +void +hypre_ParAat_RowSizes_flt( 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_dbl( 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_long_dbl( 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_ParCSRBooleanMatrix * +hypre_ParBooleanAAt_flt( hypre_ParCSRBooleanMatrix *A ); +hypre_ParCSRBooleanMatrix * +hypre_ParBooleanAAt_dbl( hypre_ParCSRBooleanMatrix *A ); +hypre_ParCSRBooleanMatrix * +hypre_ParBooleanAAt_long_dbl( hypre_ParCSRBooleanMatrix *A ); + +hypre_ParCSRBooleanMatrix * +hypre_ParBooleanMatmul_flt( hypre_ParCSRBooleanMatrix *A, hypre_ParCSRBooleanMatrix *B ); +hypre_ParCSRBooleanMatrix * +hypre_ParBooleanMatmul_dbl( hypre_ParCSRBooleanMatrix *A, hypre_ParCSRBooleanMatrix *B ); +hypre_ParCSRBooleanMatrix * +hypre_ParBooleanMatmul_long_dbl( hypre_ParCSRBooleanMatrix *A, hypre_ParCSRBooleanMatrix *B ); + +hypre_ParCSRMatrix * +hypre_ParCSRAAt_flt( hypre_ParCSRMatrix *A ); +hypre_ParCSRMatrix * +hypre_ParCSRAAt_dbl( hypre_ParCSRMatrix *A ); +hypre_ParCSRMatrix * +hypre_ParCSRAAt_long_dbl( hypre_ParCSRMatrix *A ); + +hypre_ParCSRBooleanMatrix * +hypre_ParCSRBooleanMatrixCreate_flt( 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_ParCSRBooleanMatrix * +hypre_ParCSRBooleanMatrixCreate_dbl( 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_ParCSRBooleanMatrix * +hypre_ParCSRBooleanMatrixCreate_long_dbl( 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_flt( hypre_ParCSRBooleanMatrix *matrix ); +HYPRE_Int +hypre_ParCSRBooleanMatrixDestroy_dbl( hypre_ParCSRBooleanMatrix *matrix ); +HYPRE_Int +hypre_ParCSRBooleanMatrixDestroy_long_dbl( hypre_ParCSRBooleanMatrix *matrix ); + +hypre_CSRBooleanMatrix * +hypre_ParCSRBooleanMatrixExtractAExt_flt( hypre_ParCSRBooleanMatrix *A, HYPRE_BigInt **pA_ext_row_map ); +hypre_CSRBooleanMatrix * +hypre_ParCSRBooleanMatrixExtractAExt_dbl( hypre_ParCSRBooleanMatrix *A, HYPRE_BigInt **pA_ext_row_map ); +hypre_CSRBooleanMatrix * +hypre_ParCSRBooleanMatrixExtractAExt_long_dbl( hypre_ParCSRBooleanMatrix *A, HYPRE_BigInt **pA_ext_row_map ); + +hypre_CSRBooleanMatrix * +hypre_ParCSRBooleanMatrixExtractBExt_flt( hypre_ParCSRBooleanMatrix *B, hypre_ParCSRBooleanMatrix *A ); +hypre_CSRBooleanMatrix * +hypre_ParCSRBooleanMatrixExtractBExt_dbl( hypre_ParCSRBooleanMatrix *B, hypre_ParCSRBooleanMatrix *A ); +hypre_CSRBooleanMatrix * +hypre_ParCSRBooleanMatrixExtractBExt_long_dbl( hypre_ParCSRBooleanMatrix *B, hypre_ParCSRBooleanMatrix *A ); + +HYPRE_Int +hypre_ParCSRBooleanMatrixGetLocalRange_flt( hypre_ParCSRBooleanMatrix *matrix, HYPRE_BigInt *row_start, HYPRE_BigInt *row_end, HYPRE_BigInt *col_start, HYPRE_BigInt *col_end ); +HYPRE_Int +hypre_ParCSRBooleanMatrixGetLocalRange_dbl( hypre_ParCSRBooleanMatrix *matrix, HYPRE_BigInt *row_start, HYPRE_BigInt *row_end, HYPRE_BigInt *col_start, HYPRE_BigInt *col_end ); +HYPRE_Int +hypre_ParCSRBooleanMatrixGetLocalRange_long_dbl( hypre_ParCSRBooleanMatrix *matrix, HYPRE_BigInt *row_start, HYPRE_BigInt *row_end, HYPRE_BigInt *col_start, HYPRE_BigInt *col_end ); + +HYPRE_Int +hypre_ParCSRBooleanMatrixGetRow_flt( hypre_ParCSRBooleanMatrix *mat, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind ); +HYPRE_Int +hypre_ParCSRBooleanMatrixGetRow_dbl( hypre_ParCSRBooleanMatrix *mat, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind ); +HYPRE_Int +hypre_ParCSRBooleanMatrixGetRow_long_dbl( hypre_ParCSRBooleanMatrix *mat, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind ); + +HYPRE_Int +hypre_ParCSRBooleanMatrixInitialize_flt( hypre_ParCSRBooleanMatrix *matrix ); +HYPRE_Int +hypre_ParCSRBooleanMatrixInitialize_dbl( hypre_ParCSRBooleanMatrix *matrix ); +HYPRE_Int +hypre_ParCSRBooleanMatrixInitialize_long_dbl( hypre_ParCSRBooleanMatrix *matrix ); + +HYPRE_Int +hypre_ParCSRBooleanMatrixPrint_flt( hypre_ParCSRBooleanMatrix *matrix, const char *file_name ); +HYPRE_Int +hypre_ParCSRBooleanMatrixPrint_dbl( hypre_ParCSRBooleanMatrix *matrix, const char *file_name ); +HYPRE_Int +hypre_ParCSRBooleanMatrixPrint_long_dbl( hypre_ParCSRBooleanMatrix *matrix, const char *file_name ); + +HYPRE_Int +hypre_ParCSRBooleanMatrixPrintIJ_flt( hypre_ParCSRBooleanMatrix *matrix, const char *filename ); +HYPRE_Int +hypre_ParCSRBooleanMatrixPrintIJ_dbl( hypre_ParCSRBooleanMatrix *matrix, const char *filename ); +HYPRE_Int +hypre_ParCSRBooleanMatrixPrintIJ_long_dbl( hypre_ParCSRBooleanMatrix *matrix, const char *filename ); + +hypre_ParCSRBooleanMatrix * +hypre_ParCSRBooleanMatrixRead_flt( MPI_Comm comm, const char *file_name ); +hypre_ParCSRBooleanMatrix * +hypre_ParCSRBooleanMatrixRead_dbl( MPI_Comm comm, const char *file_name ); +hypre_ParCSRBooleanMatrix * +hypre_ParCSRBooleanMatrixRead_long_dbl( MPI_Comm comm, const char *file_name ); + +HYPRE_Int +hypre_ParCSRBooleanMatrixRestoreRow_flt( hypre_ParCSRBooleanMatrix *matrix, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind ); +HYPRE_Int +hypre_ParCSRBooleanMatrixRestoreRow_dbl( hypre_ParCSRBooleanMatrix *matrix, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind ); +HYPRE_Int +hypre_ParCSRBooleanMatrixRestoreRow_long_dbl( hypre_ParCSRBooleanMatrix *matrix, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind ); + +HYPRE_Int +hypre_ParCSRBooleanMatrixSetColStartsOwner_flt( hypre_ParCSRBooleanMatrix *matrix, HYPRE_Int owns_col_starts ); +HYPRE_Int +hypre_ParCSRBooleanMatrixSetColStartsOwner_dbl( hypre_ParCSRBooleanMatrix *matrix, HYPRE_Int owns_col_starts ); +HYPRE_Int +hypre_ParCSRBooleanMatrixSetColStartsOwner_long_dbl( hypre_ParCSRBooleanMatrix *matrix, HYPRE_Int owns_col_starts ); + +HYPRE_Int +hypre_ParCSRBooleanMatrixSetDataOwner_flt( hypre_ParCSRBooleanMatrix *matrix, HYPRE_Int owns_data ); +HYPRE_Int +hypre_ParCSRBooleanMatrixSetDataOwner_dbl( hypre_ParCSRBooleanMatrix *matrix, HYPRE_Int owns_data ); +HYPRE_Int +hypre_ParCSRBooleanMatrixSetDataOwner_long_dbl( hypre_ParCSRBooleanMatrix *matrix, HYPRE_Int owns_data ); + +HYPRE_Int +hypre_ParCSRBooleanMatrixSetNNZ_flt( hypre_ParCSRBooleanMatrix *matrix ); +HYPRE_Int +hypre_ParCSRBooleanMatrixSetNNZ_dbl( hypre_ParCSRBooleanMatrix *matrix ); +HYPRE_Int +hypre_ParCSRBooleanMatrixSetNNZ_long_dbl( hypre_ParCSRBooleanMatrix *matrix ); + +HYPRE_Int +hypre_ParCSRBooleanMatrixSetRowStartsOwner_flt( hypre_ParCSRBooleanMatrix *matrix, HYPRE_Int owns_row_starts ); +HYPRE_Int +hypre_ParCSRBooleanMatrixSetRowStartsOwner_dbl( hypre_ParCSRBooleanMatrix *matrix, HYPRE_Int owns_row_starts ); +HYPRE_Int +hypre_ParCSRBooleanMatrixSetRowStartsOwner_long_dbl( hypre_ParCSRBooleanMatrix *matrix, HYPRE_Int owns_row_starts ); + +hypre_ParCSRCommHandle * +hypre_ParCSRCommHandleCreate_flt( HYPRE_Int job, hypre_ParCSRCommPkg *comm_pkg, void *send_data, void *recv_data ); +hypre_ParCSRCommHandle * +hypre_ParCSRCommHandleCreate_dbl( HYPRE_Int job, hypre_ParCSRCommPkg *comm_pkg, void *send_data, void *recv_data ); +hypre_ParCSRCommHandle * +hypre_ParCSRCommHandleCreate_long_dbl( HYPRE_Int job, hypre_ParCSRCommPkg *comm_pkg, void *send_data, void *recv_data ); + +hypre_ParCSRCommHandle * +hypre_ParCSRCommHandleCreate_v2_flt( 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_v2_dbl( 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_v2_long_dbl( 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_flt( hypre_ParCSRCommHandle *comm_handle ); +HYPRE_Int +hypre_ParCSRCommHandleDestroy_dbl( hypre_ParCSRCommHandle *comm_handle ); +HYPRE_Int +hypre_ParCSRCommHandleDestroy_long_dbl( hypre_ParCSRCommHandle *comm_handle ); + +HYPRE_Int +hypre_ParCSRCommPkgCreate_flt( 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_ParCSRCommPkgCreate_dbl( 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_ParCSRCommPkgCreate_long_dbl( 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_flt( 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_ParCSRCommPkgCreateAndFill_dbl( 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_ParCSRCommPkgCreateAndFill_long_dbl( 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_ParCSRCommPkgCreateApart_flt( 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_ParCSRCommPkgCreateApart_dbl( 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_ParCSRCommPkgCreateApart_long_dbl( 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_ParCSRCommPkgCreateApart_core_flt( 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_core_dbl( 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_core_long_dbl( 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 ); + +void +hypre_ParCSRCommPkgCreate_core_flt( 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 ); +void +hypre_ParCSRCommPkgCreate_core_dbl( 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 ); +void +hypre_ParCSRCommPkgCreate_core_long_dbl( 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_ParCSRCommPkgUpdateVecStarts_flt( hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int num_components_in, HYPRE_Int vecstride, HYPRE_Int idxstride ); +HYPRE_Int +hypre_ParCSRCommPkgUpdateVecStarts_dbl( hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int num_components_in, HYPRE_Int vecstride, HYPRE_Int idxstride ); +HYPRE_Int +hypre_ParCSRCommPkgUpdateVecStarts_long_dbl( hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int num_components_in, HYPRE_Int vecstride, HYPRE_Int idxstride ); + +HYPRE_Int +hypre_ParCSRDiagScaleVector_flt( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_y, hypre_ParVector *par_x ); +HYPRE_Int +hypre_ParCSRDiagScaleVector_dbl( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_y, hypre_ParVector *par_x ); +HYPRE_Int +hypre_ParCSRDiagScaleVector_long_dbl( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_y, hypre_ParVector *par_x ); + +HYPRE_Int +hypre_ParCSRDiagScaleVectorHost_flt( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_y, hypre_ParVector *par_x ); +HYPRE_Int +hypre_ParCSRDiagScaleVectorHost_dbl( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_y, hypre_ParVector *par_x ); +HYPRE_Int +hypre_ParCSRDiagScaleVectorHost_long_dbl( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_y, hypre_ParVector *par_x ); + +HYPRE_Int +hypre_ParCSRFindExtendCommPkg_flt( 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_ParCSRFindExtendCommPkg_dbl( 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_ParCSRFindExtendCommPkg_long_dbl( 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_ParCSRMatrix * +hypre_ParCSRMatMat_flt( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); +hypre_ParCSRMatrix * +hypre_ParCSRMatMat_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); +hypre_ParCSRMatrix * +hypre_ParCSRMatMat_long_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); + +HYPRE_Int +hypre_ParCSRMatMatDiag_flt( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, hypre_ParCSRMatrix **C_ptr ); +HYPRE_Int +hypre_ParCSRMatMatDiag_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, hypre_ParCSRMatrix **C_ptr ); +HYPRE_Int +hypre_ParCSRMatMatDiag_long_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, hypre_ParCSRMatrix **C_ptr ); + +hypre_ParCSRMatrix * +hypre_ParCSRMatMatHost_flt( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); +hypre_ParCSRMatrix * +hypre_ParCSRMatMatHost_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); +hypre_ParCSRMatrix * +hypre_ParCSRMatMatHost_long_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); + +HYPRE_Int +hypre_ParCSRMatrixAdd_flt( hypre_float alpha, hypre_ParCSRMatrix *A, hypre_float beta, hypre_ParCSRMatrix *B, hypre_ParCSRMatrix **Cout ); +HYPRE_Int +hypre_ParCSRMatrixAdd_dbl( hypre_double alpha, hypre_ParCSRMatrix *A, hypre_double beta, hypre_ParCSRMatrix *B, hypre_ParCSRMatrix **Cout ); +HYPRE_Int +hypre_ParCSRMatrixAdd_long_dbl( hypre_long_double alpha, hypre_ParCSRMatrix *A, hypre_long_double beta, hypre_ParCSRMatrix *B, hypre_ParCSRMatrix **Cout ); + +HYPRE_Int +hypre_ParCSRMatrixAddHost_flt( hypre_float alpha, hypre_ParCSRMatrix *A, hypre_float beta, hypre_ParCSRMatrix *B, hypre_ParCSRMatrix **Cout ); +HYPRE_Int +hypre_ParCSRMatrixAddHost_dbl( hypre_double alpha, hypre_ParCSRMatrix *A, hypre_double beta, hypre_ParCSRMatrix *B, hypre_ParCSRMatrix **Cout ); +HYPRE_Int +hypre_ParCSRMatrixAddHost_long_dbl( hypre_long_double alpha, hypre_ParCSRMatrix *A, hypre_long_double beta, hypre_ParCSRMatrix *B, hypre_ParCSRMatrix **Cout ); + +HYPRE_Int +hypre_ParCSRMatrixAminvDB_flt( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, hypre_float *d, hypre_ParCSRMatrix **C_ptr ); +HYPRE_Int +hypre_ParCSRMatrixAminvDB_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, hypre_double *d, hypre_ParCSRMatrix **C_ptr ); +HYPRE_Int +hypre_ParCSRMatrixAminvDB_long_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, hypre_long_double *d, hypre_ParCSRMatrix **C_ptr ); + +HYPRE_Int +hypre_ParCSRMatrixBlkFilter_flt( hypre_ParCSRMatrix *A, HYPRE_Int block_size, hypre_ParCSRMatrix **B_ptr ); +HYPRE_Int +hypre_ParCSRMatrixBlkFilter_dbl( hypre_ParCSRMatrix *A, HYPRE_Int block_size, hypre_ParCSRMatrix **B_ptr ); +HYPRE_Int +hypre_ParCSRMatrixBlkFilter_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int block_size, hypre_ParCSRMatrix **B_ptr ); + +HYPRE_Int +hypre_ParCSRMatrixBlockColSum_flt( hypre_ParCSRMatrix *A, HYPRE_Int row_major, HYPRE_Int num_rows_block, HYPRE_Int num_cols_block, hypre_DenseBlockMatrix **B_ptr ); +HYPRE_Int +hypre_ParCSRMatrixBlockColSum_dbl( hypre_ParCSRMatrix *A, HYPRE_Int row_major, HYPRE_Int num_rows_block, HYPRE_Int num_cols_block, hypre_DenseBlockMatrix **B_ptr ); +HYPRE_Int +hypre_ParCSRMatrixBlockColSum_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int row_major, HYPRE_Int num_rows_block, HYPRE_Int num_cols_block, hypre_DenseBlockMatrix **B_ptr ); + +hypre_ParCSRMatrix* +hypre_ParCSRMatrixClone_flt( hypre_ParCSRMatrix *A, HYPRE_Int copy_data ); +hypre_ParCSRMatrix* +hypre_ParCSRMatrixClone_dbl( hypre_ParCSRMatrix *A, HYPRE_Int copy_data ); +hypre_ParCSRMatrix* +hypre_ParCSRMatrixClone_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int copy_data ); + +hypre_ParCSRMatrix* +hypre_ParCSRMatrixClone_v2_flt( hypre_ParCSRMatrix *A, HYPRE_Int copy_data, HYPRE_MemoryLocation memory_location ); +hypre_ParCSRMatrix* +hypre_ParCSRMatrixClone_v2_dbl( hypre_ParCSRMatrix *A, HYPRE_Int copy_data, HYPRE_MemoryLocation memory_location ); +hypre_ParCSRMatrix* +hypre_ParCSRMatrixClone_v2_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int copy_data, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +hypre_ParCSRMatrixColSum_flt( hypre_ParCSRMatrix *A, hypre_ParVector **B_ptr ); +HYPRE_Int +hypre_ParCSRMatrixColSum_dbl( hypre_ParCSRMatrix *A, hypre_ParVector **B_ptr ); +HYPRE_Int +hypre_ParCSRMatrixColSum_long_dbl( hypre_ParCSRMatrix *A, hypre_ParVector **B_ptr ); + +HYPRE_Int +hypre_ParCSRMatrixCompressOffdMap_flt( hypre_ParCSRMatrix *A ); +HYPRE_Int +hypre_ParCSRMatrixCompressOffdMap_dbl( hypre_ParCSRMatrix *A ); +HYPRE_Int +hypre_ParCSRMatrixCompressOffdMap_long_dbl( hypre_ParCSRMatrix *A ); + +HYPRE_Int +hypre_ParCSRMatrixComputeScalingTagged_flt( hypre_ParCSRMatrix *A, HYPRE_Int type, HYPRE_MemoryLocation memloc_tags, HYPRE_Int num_tags, HYPRE_Int *tags, hypre_ParVector **scaling_ptr ); +HYPRE_Int +hypre_ParCSRMatrixComputeScalingTagged_dbl( hypre_ParCSRMatrix *A, HYPRE_Int type, HYPRE_MemoryLocation memloc_tags, HYPRE_Int num_tags, HYPRE_Int *tags, hypre_ParVector **scaling_ptr ); +HYPRE_Int +hypre_ParCSRMatrixComputeScalingTagged_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int type, HYPRE_MemoryLocation memloc_tags, HYPRE_Int num_tags, HYPRE_Int *tags, hypre_ParVector **scaling_ptr ); + +HYPRE_Int +hypre_ParCSRMatrixCopy_flt( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, HYPRE_Int copy_data ); +HYPRE_Int +hypre_ParCSRMatrixCopy_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, HYPRE_Int copy_data ); +HYPRE_Int +hypre_ParCSRMatrixCopy_long_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, HYPRE_Int copy_data ); + +HYPRE_Int +hypre_ParCSRMatrixCopyColMapOffdToDevice_flt( hypre_ParCSRMatrix *A ); +HYPRE_Int +hypre_ParCSRMatrixCopyColMapOffdToDevice_dbl( hypre_ParCSRMatrix *A ); +HYPRE_Int +hypre_ParCSRMatrixCopyColMapOffdToDevice_long_dbl( hypre_ParCSRMatrix *A ); + +HYPRE_Int +hypre_ParCSRMatrixCopyColMapOffdToHost_flt( hypre_ParCSRMatrix *A ); +HYPRE_Int +hypre_ParCSRMatrixCopyColMapOffdToHost_dbl( hypre_ParCSRMatrix *A ); +HYPRE_Int +hypre_ParCSRMatrixCopyColMapOffdToHost_long_dbl( hypre_ParCSRMatrix *A ); + +HYPRE_Int +hypre_ParCSRMatrixCopy_C_flt( hypre_ParCSRMatrix *P, hypre_ParCSRMatrix *C, HYPRE_Int *CF_marker ); +HYPRE_Int +hypre_ParCSRMatrixCopy_C_dbl( hypre_ParCSRMatrix *P, hypre_ParCSRMatrix *C, HYPRE_Int *CF_marker ); +HYPRE_Int +hypre_ParCSRMatrixCopy_C_long_dbl( hypre_ParCSRMatrix *P, hypre_ParCSRMatrix *C, HYPRE_Int *CF_marker ); + +hypre_ParCSRMatrix * +hypre_ParCSRMatrixCreate_flt( 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_dbl( 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_long_dbl( 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_ParCSRMatrixCreateAssumedPartition_flt( hypre_ParCSRMatrix *matrix ); +HYPRE_Int +hypre_ParCSRMatrixCreateAssumedPartition_dbl( hypre_ParCSRMatrix *matrix ); +HYPRE_Int +hypre_ParCSRMatrixCreateAssumedPartition_long_dbl( hypre_ParCSRMatrix *matrix ); + +hypre_ParCSRMatrix* +hypre_ParCSRMatrixCreateFromDenseBlockMatrix_flt( 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_ParCSRMatrixCreateFromDenseBlockMatrix_dbl( 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_ParCSRMatrixCreateFromDenseBlockMatrix_long_dbl( 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_flt( hypre_ParVector *b, HYPRE_BigInt global_num_rows, HYPRE_BigInt global_num_cols, HYPRE_BigInt *row_starts, HYPRE_BigInt *col_starts ); +hypre_ParCSRMatrix* +hypre_ParCSRMatrixCreateFromParVector_dbl( hypre_ParVector *b, HYPRE_BigInt global_num_rows, HYPRE_BigInt global_num_cols, HYPRE_BigInt *row_starts, HYPRE_BigInt *col_starts ); +hypre_ParCSRMatrix* +hypre_ParCSRMatrixCreateFromParVector_long_dbl( hypre_ParVector *b, HYPRE_BigInt global_num_rows, HYPRE_BigInt global_num_cols, HYPRE_BigInt *row_starts, HYPRE_BigInt *col_starts ); + +HYPRE_Int +hypre_ParCSRMatrixDestroy_flt( hypre_ParCSRMatrix *matrix ); +HYPRE_Int +hypre_ParCSRMatrixDestroy_dbl( hypre_ParCSRMatrix *matrix ); +HYPRE_Int +hypre_ParCSRMatrixDestroy_long_dbl( hypre_ParCSRMatrix *matrix ); + +HYPRE_Int +hypre_ParCSRMatrixDiagScale_flt( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_ld, hypre_ParVector *par_rd ); +HYPRE_Int +hypre_ParCSRMatrixDiagScale_dbl( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_ld, hypre_ParVector *par_rd ); +HYPRE_Int +hypre_ParCSRMatrixDiagScale_long_dbl( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_ld, hypre_ParVector *par_rd ); + +HYPRE_Int +hypre_ParCSRMatrixDropSmallEntries_flt( hypre_ParCSRMatrix *A, hypre_float tol, HYPRE_Int type ); +HYPRE_Int +hypre_ParCSRMatrixDropSmallEntries_dbl( hypre_ParCSRMatrix *A, hypre_double tol, HYPRE_Int type ); +HYPRE_Int +hypre_ParCSRMatrixDropSmallEntries_long_dbl( hypre_ParCSRMatrix *A, hypre_long_double tol, HYPRE_Int type ); + +HYPRE_Int +hypre_ParCSRMatrixDropSmallEntriesHost_flt( hypre_ParCSRMatrix *A, hypre_float tol, HYPRE_Int type ); +HYPRE_Int +hypre_ParCSRMatrixDropSmallEntriesHost_dbl( hypre_ParCSRMatrix *A, hypre_double tol, HYPRE_Int type ); +HYPRE_Int +hypre_ParCSRMatrixDropSmallEntriesHost_long_dbl( hypre_ParCSRMatrix *A, hypre_long_double tol, HYPRE_Int type ); + +HYPRE_Int +hypre_ParCSRMatrixEliminateRowsCols_flt( hypre_ParCSRMatrix *A, HYPRE_Int nrows, HYPRE_Int *rows ); +HYPRE_Int +hypre_ParCSRMatrixEliminateRowsCols_dbl( hypre_ParCSRMatrix *A, HYPRE_Int nrows, HYPRE_Int *rows ); +HYPRE_Int +hypre_ParCSRMatrixEliminateRowsCols_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int nrows, HYPRE_Int *rows ); + +hypre_CSRMatrix * +hypre_ParCSRMatrixExtractAExt_flt( hypre_ParCSRMatrix *A, HYPRE_Int data, HYPRE_BigInt **pA_ext_row_map ); +hypre_CSRMatrix * +hypre_ParCSRMatrixExtractAExt_dbl( hypre_ParCSRMatrix *A, HYPRE_Int data, HYPRE_BigInt **pA_ext_row_map ); +hypre_CSRMatrix * +hypre_ParCSRMatrixExtractAExt_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int data, HYPRE_BigInt **pA_ext_row_map ); + +hypre_CSRMatrix * +hypre_ParCSRMatrixExtractBExt_flt( hypre_ParCSRMatrix *B, hypre_ParCSRMatrix *A, HYPRE_Int data ); +hypre_CSRMatrix * +hypre_ParCSRMatrixExtractBExt_dbl( hypre_ParCSRMatrix *B, hypre_ParCSRMatrix *A, HYPRE_Int data ); +hypre_CSRMatrix * +hypre_ParCSRMatrixExtractBExt_long_dbl( hypre_ParCSRMatrix *B, hypre_ParCSRMatrix *A, HYPRE_Int data ); + +void +hypre_ParCSRMatrixExtractBExt_Arrays_flt( HYPRE_Int **pB_ext_i, HYPRE_BigInt **pB_ext_j, hypre_float **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_float *diag_data, hypre_float *offd_data ); +void +hypre_ParCSRMatrixExtractBExt_Arrays_dbl( HYPRE_Int **pB_ext_i, HYPRE_BigInt **pB_ext_j, hypre_double **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_double *diag_data, hypre_double *offd_data ); +void +hypre_ParCSRMatrixExtractBExt_Arrays_long_dbl( HYPRE_Int **pB_ext_i, HYPRE_BigInt **pB_ext_j, hypre_long_double **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_long_double *diag_data, hypre_long_double *offd_data ); + +void +hypre_ParCSRMatrixExtractBExt_Arrays_Overlap_flt( HYPRE_Int **pB_ext_i, HYPRE_BigInt **pB_ext_j, hypre_float **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_float *diag_data, hypre_float *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 ); +void +hypre_ParCSRMatrixExtractBExt_Arrays_Overlap_dbl( HYPRE_Int **pB_ext_i, HYPRE_BigInt **pB_ext_j, hypre_double **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_double *diag_data, hypre_double *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 ); +void +hypre_ParCSRMatrixExtractBExt_Arrays_Overlap_long_dbl( HYPRE_Int **pB_ext_i, HYPRE_BigInt **pB_ext_j, hypre_long_double **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_long_double *diag_data, hypre_long_double *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_Overlap_flt( 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_CSRMatrix * +hypre_ParCSRMatrixExtractBExt_Overlap_dbl( 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_CSRMatrix * +hypre_ParCSRMatrixExtractBExt_Overlap_long_dbl( 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 ); + +void +hypre_ParCSRMatrixExtractRowSubmatrices_flt( hypre_ParCSRMatrix *A_csr, HYPRE_Int *indices2, hypre_ParCSRMatrix ***submatrices ); +void +hypre_ParCSRMatrixExtractRowSubmatrices_dbl( hypre_ParCSRMatrix *A_csr, HYPRE_Int *indices2, hypre_ParCSRMatrix ***submatrices ); +void +hypre_ParCSRMatrixExtractRowSubmatrices_long_dbl( hypre_ParCSRMatrix *A_csr, HYPRE_Int *indices2, hypre_ParCSRMatrix ***submatrices ); + +void +hypre_ParCSRMatrixExtractSubmatrices_flt( hypre_ParCSRMatrix *A_csr, HYPRE_Int *indices2, hypre_ParCSRMatrix ***submatrices ); +void +hypre_ParCSRMatrixExtractSubmatrices_dbl( hypre_ParCSRMatrix *A_csr, HYPRE_Int *indices2, hypre_ParCSRMatrix ***submatrices ); +void +hypre_ParCSRMatrixExtractSubmatrices_long_dbl( hypre_ParCSRMatrix *A_csr, HYPRE_Int *indices2, hypre_ParCSRMatrix ***submatrices ); + +HYPRE_Int +hypre_ParCSRMatrixExtractSubmatrixFC_flt( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, HYPRE_BigInt *cpts_starts, const char *job, hypre_ParCSRMatrix **B_ptr, hypre_float strength_thresh ); +HYPRE_Int +hypre_ParCSRMatrixExtractSubmatrixFC_dbl( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, HYPRE_BigInt *cpts_starts, const char *job, hypre_ParCSRMatrix **B_ptr, hypre_double strength_thresh ); +HYPRE_Int +hypre_ParCSRMatrixExtractSubmatrixFC_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int *CF_marker, HYPRE_BigInt *cpts_starts, const char *job, hypre_ParCSRMatrix **B_ptr, hypre_long_double strength_thresh ); + +HYPRE_Real +hypre_ParCSRMatrixFnorm_flt( hypre_ParCSRMatrix *A ); +HYPRE_Real +hypre_ParCSRMatrixFnorm_dbl( hypre_ParCSRMatrix *A ); +HYPRE_Real +hypre_ParCSRMatrixFnorm_long_dbl( hypre_ParCSRMatrix *A ); + +void +hypre_ParCSRMatrixGenSpanningTree_flt( hypre_ParCSRMatrix *G_csr, HYPRE_Int **indices, HYPRE_Int G_type ); +void +hypre_ParCSRMatrixGenSpanningTree_dbl( hypre_ParCSRMatrix *G_csr, HYPRE_Int **indices, HYPRE_Int G_type ); +void +hypre_ParCSRMatrixGenSpanningTree_long_dbl( hypre_ParCSRMatrix *G_csr, HYPRE_Int **indices, HYPRE_Int G_type ); + +HYPRE_Int +hypre_ParCSRMatrixGenerateFFFC_flt( 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_dbl( 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_long_dbl( 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_flt( 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_dbl( 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_long_dbl( 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_flt( 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_float **D_lambda_ptr ); +HYPRE_Int +hypre_ParCSRMatrixGenerateFFFCD3_dbl( 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_double **D_lambda_ptr ); +HYPRE_Int +hypre_ParCSRMatrixGenerateFFFCD3_long_dbl( 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_long_double **D_lambda_ptr ); + +HYPRE_Int +hypre_ParCSRMatrixGenerateFFFCHost_flt( 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_ParCSRMatrixGenerateFFFCHost_dbl( 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_ParCSRMatrixGenerateFFFCHost_long_dbl( 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_ParCSRMatrixGetLocalRange_flt( hypre_ParCSRMatrix *matrix, HYPRE_BigInt *row_start, HYPRE_BigInt *row_end, HYPRE_BigInt *col_start, HYPRE_BigInt *col_end ); +HYPRE_Int +hypre_ParCSRMatrixGetLocalRange_dbl( hypre_ParCSRMatrix *matrix, HYPRE_BigInt *row_start, HYPRE_BigInt *row_end, HYPRE_BigInt *col_start, HYPRE_BigInt *col_end ); +HYPRE_Int +hypre_ParCSRMatrixGetLocalRange_long_dbl( hypre_ParCSRMatrix *matrix, HYPRE_BigInt *row_start, HYPRE_BigInt *row_end, HYPRE_BigInt *col_start, HYPRE_BigInt *col_end ); + +HYPRE_Int +hypre_ParCSRMatrixGetRow_flt( hypre_ParCSRMatrix *mat, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind, hypre_float **values ); +HYPRE_Int +hypre_ParCSRMatrixGetRow_dbl( hypre_ParCSRMatrix *mat, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind, hypre_double **values ); +HYPRE_Int +hypre_ParCSRMatrixGetRow_long_dbl( hypre_ParCSRMatrix *mat, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind, hypre_long_double **values ); + +HYPRE_Int +hypre_ParCSRMatrixInfNorm_flt( hypre_ParCSRMatrix *A, hypre_float *norm ); +HYPRE_Int +hypre_ParCSRMatrixInfNorm_dbl( hypre_ParCSRMatrix *A, hypre_double *norm ); +HYPRE_Int +hypre_ParCSRMatrixInfNorm_long_dbl( hypre_ParCSRMatrix *A, hypre_long_double *norm ); + +HYPRE_Int +hypre_ParCSRMatrixInitialize_flt( hypre_ParCSRMatrix *matrix ); +HYPRE_Int +hypre_ParCSRMatrixInitialize_dbl( hypre_ParCSRMatrix *matrix ); +HYPRE_Int +hypre_ParCSRMatrixInitialize_long_dbl( hypre_ParCSRMatrix *matrix ); + +HYPRE_Int +hypre_ParCSRMatrixInitialize_v2_flt( hypre_ParCSRMatrix *matrix, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_ParCSRMatrixInitialize_v2_dbl( hypre_ParCSRMatrix *matrix, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_ParCSRMatrixInitialize_v2_long_dbl( hypre_ParCSRMatrix *matrix, HYPRE_MemoryLocation memory_location ); + +HYPRE_Complex +hypre_ParCSRMatrixLocalSumElts_flt( hypre_ParCSRMatrix *A ); +HYPRE_Complex +hypre_ParCSRMatrixLocalSumElts_dbl( hypre_ParCSRMatrix *A ); +HYPRE_Complex +hypre_ParCSRMatrixLocalSumElts_long_dbl( hypre_ParCSRMatrix *A ); + +HYPRE_Int +hypre_ParCSRMatrixLocalTranspose_flt( hypre_ParCSRMatrix *A ); +HYPRE_Int +hypre_ParCSRMatrixLocalTranspose_dbl( hypre_ParCSRMatrix *A ); +HYPRE_Int +hypre_ParCSRMatrixLocalTranspose_long_dbl( hypre_ParCSRMatrix *A ); + +HYPRE_Int +hypre_ParCSRMatrixMatvec_flt( hypre_float alpha, hypre_ParCSRMatrix *A, hypre_ParVector *x, hypre_float beta, hypre_ParVector *y ); +HYPRE_Int +hypre_ParCSRMatrixMatvec_dbl( hypre_double alpha, hypre_ParCSRMatrix *A, hypre_ParVector *x, hypre_double beta, hypre_ParVector *y ); +HYPRE_Int +hypre_ParCSRMatrixMatvec_long_dbl( hypre_long_double alpha, hypre_ParCSRMatrix *A, hypre_ParVector *x, hypre_long_double beta, hypre_ParVector *y ); + +HYPRE_Int +hypre_ParCSRMatrixMatvecOutOfPlace_flt( hypre_float alpha, hypre_ParCSRMatrix *A, hypre_ParVector *x, hypre_float beta, hypre_ParVector *b, hypre_ParVector *y ); +HYPRE_Int +hypre_ParCSRMatrixMatvecOutOfPlace_dbl( hypre_double alpha, hypre_ParCSRMatrix *A, hypre_ParVector *x, hypre_double beta, hypre_ParVector *b, hypre_ParVector *y ); +HYPRE_Int +hypre_ParCSRMatrixMatvecOutOfPlace_long_dbl( hypre_long_double alpha, hypre_ParCSRMatrix *A, hypre_ParVector *x, hypre_long_double beta, hypre_ParVector *b, hypre_ParVector *y ); + +HYPRE_Int +hypre_ParCSRMatrixMatvecT_flt( hypre_float alpha, hypre_ParCSRMatrix *A, hypre_ParVector *x, hypre_float beta, hypre_ParVector *y ); +HYPRE_Int +hypre_ParCSRMatrixMatvecT_dbl( hypre_double alpha, hypre_ParCSRMatrix *A, hypre_ParVector *x, hypre_double beta, hypre_ParVector *y ); +HYPRE_Int +hypre_ParCSRMatrixMatvecT_long_dbl( hypre_long_double alpha, hypre_ParCSRMatrix *A, hypre_ParVector *x, hypre_long_double beta, hypre_ParVector *y ); + +HYPRE_Int +hypre_ParCSRMatrixMatvec_FF_flt( hypre_float alpha, hypre_ParCSRMatrix *A, hypre_ParVector *x, hypre_float beta, hypre_ParVector *y, HYPRE_Int *CF_marker, HYPRE_Int fpt ); +HYPRE_Int +hypre_ParCSRMatrixMatvec_FF_dbl( hypre_double alpha, hypre_ParCSRMatrix *A, hypre_ParVector *x, hypre_double beta, hypre_ParVector *y, HYPRE_Int *CF_marker, HYPRE_Int fpt ); +HYPRE_Int +hypre_ParCSRMatrixMatvec_FF_long_dbl( hypre_long_double alpha, hypre_ParCSRMatrix *A, hypre_ParVector *x, hypre_long_double beta, hypre_ParVector *y, HYPRE_Int *CF_marker, HYPRE_Int fpt ); + +HYPRE_Int +hypre_ParCSRMatrixMigrate_flt( hypre_ParCSRMatrix *A, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_ParCSRMatrixMigrate_dbl( hypre_ParCSRMatrix *A, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_ParCSRMatrixMigrate_long_dbl( hypre_ParCSRMatrix *A, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +hypre_ParCSRMatrixPrint_flt( hypre_ParCSRMatrix *matrix, const char *file_name ); +HYPRE_Int +hypre_ParCSRMatrixPrint_dbl( hypre_ParCSRMatrix *matrix, const char *file_name ); +HYPRE_Int +hypre_ParCSRMatrixPrint_long_dbl( hypre_ParCSRMatrix *matrix, const char *file_name ); + +HYPRE_Int +hypre_ParCSRMatrixPrintBinaryIJ_flt( hypre_ParCSRMatrix *matrix, HYPRE_Int base_i, HYPRE_Int base_j, const char *filename ); +HYPRE_Int +hypre_ParCSRMatrixPrintBinaryIJ_dbl( hypre_ParCSRMatrix *matrix, HYPRE_Int base_i, HYPRE_Int base_j, const char *filename ); +HYPRE_Int +hypre_ParCSRMatrixPrintBinaryIJ_long_dbl( hypre_ParCSRMatrix *matrix, HYPRE_Int base_i, HYPRE_Int base_j, const char *filename ); + +HYPRE_Int +hypre_ParCSRMatrixPrintIJ_flt( const hypre_ParCSRMatrix *matrix, const HYPRE_Int base_i, const HYPRE_Int base_j, const char *filename ); +HYPRE_Int +hypre_ParCSRMatrixPrintIJ_dbl( const hypre_ParCSRMatrix *matrix, const HYPRE_Int base_i, const HYPRE_Int base_j, const char *filename ); +HYPRE_Int +hypre_ParCSRMatrixPrintIJ_long_dbl( const hypre_ParCSRMatrix *matrix, const HYPRE_Int base_i, const HYPRE_Int base_j, const char *filename ); + +hypre_ParCSRMatrix * +hypre_ParCSRMatrixRAP_flt( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P ); +hypre_ParCSRMatrix * +hypre_ParCSRMatrixRAP_dbl( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P ); +hypre_ParCSRMatrix * +hypre_ParCSRMatrixRAP_long_dbl( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P ); + +hypre_ParCSRMatrix * +hypre_ParCSRMatrixRAPKT_flt( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, HYPRE_Int keep_transpose, HYPRE_Int has_diagonal ); +hypre_ParCSRMatrix * +hypre_ParCSRMatrixRAPKT_dbl( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, HYPRE_Int keep_transpose, HYPRE_Int has_diagonal ); +hypre_ParCSRMatrix * +hypre_ParCSRMatrixRAPKT_long_dbl( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, HYPRE_Int keep_transpose, HYPRE_Int has_diagonal ); + +hypre_ParCSRMatrix* +hypre_ParCSRMatrixRAPKTHost_flt( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, HYPRE_Int keep_transpose ); +hypre_ParCSRMatrix* +hypre_ParCSRMatrixRAPKTHost_dbl( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, HYPRE_Int keep_transpose ); +hypre_ParCSRMatrix* +hypre_ParCSRMatrixRAPKTHost_long_dbl( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, HYPRE_Int keep_transpose ); + +hypre_ParCSRMatrix * +hypre_ParCSRMatrixRead_flt( MPI_Comm comm, const char *file_name ); +hypre_ParCSRMatrix * +hypre_ParCSRMatrixRead_dbl( MPI_Comm comm, const char *file_name ); +hypre_ParCSRMatrix * +hypre_ParCSRMatrixRead_long_dbl( MPI_Comm comm, const char *file_name ); + +HYPRE_Int +hypre_ParCSRMatrixReadIJ_flt( MPI_Comm comm, const char *filename, HYPRE_Int *base_i_ptr, HYPRE_Int *base_j_ptr, hypre_ParCSRMatrix **matrix_ptr ); +HYPRE_Int +hypre_ParCSRMatrixReadIJ_dbl( MPI_Comm comm, const char *filename, HYPRE_Int *base_i_ptr, HYPRE_Int *base_j_ptr, hypre_ParCSRMatrix **matrix_ptr ); +HYPRE_Int +hypre_ParCSRMatrixReadIJ_long_dbl( MPI_Comm comm, const char *filename, HYPRE_Int *base_i_ptr, HYPRE_Int *base_j_ptr, hypre_ParCSRMatrix **matrix_ptr ); + +HYPRE_Int +hypre_ParCSRMatrixReorder_flt( hypre_ParCSRMatrix *A ); +HYPRE_Int +hypre_ParCSRMatrixReorder_dbl( hypre_ParCSRMatrix *A ); +HYPRE_Int +hypre_ParCSRMatrixReorder_long_dbl( hypre_ParCSRMatrix *A ); + +HYPRE_Int +hypre_ParCSRMatrixRestoreRow_flt( hypre_ParCSRMatrix *matrix, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind, hypre_float **values ); +HYPRE_Int +hypre_ParCSRMatrixRestoreRow_dbl( hypre_ParCSRMatrix *matrix, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind, hypre_double **values ); +HYPRE_Int +hypre_ParCSRMatrixRestoreRow_long_dbl( hypre_ParCSRMatrix *matrix, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind, hypre_long_double **values ); + +HYPRE_Int +hypre_ParCSRMatrixScale_flt( hypre_ParCSRMatrix *A, hypre_float scalar ); +HYPRE_Int +hypre_ParCSRMatrixScale_dbl( hypre_ParCSRMatrix *A, hypre_double scalar ); +HYPRE_Int +hypre_ParCSRMatrixScale_long_dbl( hypre_ParCSRMatrix *A, hypre_long_double scalar ); + +HYPRE_Int +hypre_ParCSRMatrixSetConstantValues_flt( hypre_ParCSRMatrix *A, hypre_float value ); +HYPRE_Int +hypre_ParCSRMatrixSetConstantValues_dbl( hypre_ParCSRMatrix *A, hypre_double value ); +HYPRE_Int +hypre_ParCSRMatrixSetConstantValues_long_dbl( hypre_ParCSRMatrix *A, hypre_long_double value ); + +HYPRE_Int +hypre_ParCSRMatrixSetDNumNonzeros_flt( hypre_ParCSRMatrix *matrix ); +HYPRE_Int +hypre_ParCSRMatrixSetDNumNonzeros_dbl( hypre_ParCSRMatrix *matrix ); +HYPRE_Int +hypre_ParCSRMatrixSetDNumNonzeros_long_dbl( hypre_ParCSRMatrix *matrix ); + +HYPRE_Int +hypre_ParCSRMatrixSetDataOwner_flt( hypre_ParCSRMatrix *matrix, HYPRE_Int owns_data ); +HYPRE_Int +hypre_ParCSRMatrixSetDataOwner_dbl( hypre_ParCSRMatrix *matrix, HYPRE_Int owns_data ); +HYPRE_Int +hypre_ParCSRMatrixSetDataOwner_long_dbl( hypre_ParCSRMatrix *matrix, HYPRE_Int owns_data ); + +HYPRE_Int +hypre_ParCSRMatrixSetNumNonzeros_flt( hypre_ParCSRMatrix *matrix ); +HYPRE_Int +hypre_ParCSRMatrixSetNumNonzeros_dbl( hypre_ParCSRMatrix *matrix ); +HYPRE_Int +hypre_ParCSRMatrixSetNumNonzeros_long_dbl( hypre_ParCSRMatrix *matrix ); + +HYPRE_Int +hypre_ParCSRMatrixSetNumRownnz_flt( hypre_ParCSRMatrix *matrix ); +HYPRE_Int +hypre_ParCSRMatrixSetNumRownnz_dbl( hypre_ParCSRMatrix *matrix ); +HYPRE_Int +hypre_ParCSRMatrixSetNumRownnz_long_dbl( hypre_ParCSRMatrix *matrix ); + +HYPRE_Int +hypre_ParCSRMatrixSetPatternOnly_flt( hypre_ParCSRMatrix *matrix, HYPRE_Int pattern_only ); +HYPRE_Int +hypre_ParCSRMatrixSetPatternOnly_dbl( hypre_ParCSRMatrix *matrix, HYPRE_Int pattern_only ); +HYPRE_Int +hypre_ParCSRMatrixSetPatternOnly_long_dbl( hypre_ParCSRMatrix *matrix, HYPRE_Int pattern_only ); + +HYPRE_Int +hypre_ParCSRMatrixStatsArrayCompute_flt( HYPRE_Int num_matrices, hypre_ParCSRMatrix **matrices, hypre_MatrixStatsArray *stats_array ); +HYPRE_Int +hypre_ParCSRMatrixStatsArrayCompute_dbl( HYPRE_Int num_matrices, hypre_ParCSRMatrix **matrices, hypre_MatrixStatsArray *stats_array ); +HYPRE_Int +hypre_ParCSRMatrixStatsArrayCompute_long_dbl( HYPRE_Int num_matrices, hypre_ParCSRMatrix **matrices, hypre_MatrixStatsArray *stats_array ); + +hypre_CSRMatrix * +hypre_ParCSRMatrixToCSRMatrixAll_flt( hypre_ParCSRMatrix *par_matrix ); +hypre_CSRMatrix * +hypre_ParCSRMatrixToCSRMatrixAll_dbl( hypre_ParCSRMatrix *par_matrix ); +hypre_CSRMatrix * +hypre_ParCSRMatrixToCSRMatrixAll_long_dbl( hypre_ParCSRMatrix *par_matrix ); + +hypre_CSRMatrix * +hypre_ParCSRMatrixToCSRMatrixAll_v2_flt( hypre_ParCSRMatrix *par_matrix, HYPRE_MemoryLocation memory_location ); +hypre_CSRMatrix * +hypre_ParCSRMatrixToCSRMatrixAll_v2_dbl( hypre_ParCSRMatrix *par_matrix, HYPRE_MemoryLocation memory_location ); +hypre_CSRMatrix * +hypre_ParCSRMatrixToCSRMatrixAll_v2_long_dbl( hypre_ParCSRMatrix *par_matrix, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +hypre_ParCSRMatrixTranspose_flt( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **AT_ptr, HYPRE_Int data ); +HYPRE_Int +hypre_ParCSRMatrixTranspose_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **AT_ptr, HYPRE_Int data ); +HYPRE_Int +hypre_ParCSRMatrixTranspose_long_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **AT_ptr, HYPRE_Int data ); + +HYPRE_Int +hypre_ParCSRMatrixTransposeHost_flt( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **AT_ptr, HYPRE_Int data ); +HYPRE_Int +hypre_ParCSRMatrixTransposeHost_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **AT_ptr, HYPRE_Int data ); +HYPRE_Int +hypre_ParCSRMatrixTransposeHost_long_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **AT_ptr, HYPRE_Int data ); + +HYPRE_Int +hypre_ParCSRMatrixTruncate_flt( hypre_ParCSRMatrix *A, hypre_float tol, HYPRE_Int max_row_elmts, HYPRE_Int rescale, HYPRE_Int nrm_type ); +HYPRE_Int +hypre_ParCSRMatrixTruncate_dbl( hypre_ParCSRMatrix *A, hypre_double tol, HYPRE_Int max_row_elmts, HYPRE_Int rescale, HYPRE_Int nrm_type ); +HYPRE_Int +hypre_ParCSRMatrixTruncate_long_dbl( hypre_ParCSRMatrix *A, hypre_long_double tol, HYPRE_Int max_row_elmts, HYPRE_Int rescale, HYPRE_Int nrm_type ); + +hypre_ParCSRMatrix * +hypre_ParCSRMatrixUnion_flt( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); +hypre_ParCSRMatrix * +hypre_ParCSRMatrixUnion_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); +hypre_ParCSRMatrix * +hypre_ParCSRMatrixUnion_long_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); + +HYPRE_Int +hypre_ParCSRMatrixZero_F_flt( hypre_ParCSRMatrix *P, HYPRE_Int *CF_marker ); +HYPRE_Int +hypre_ParCSRMatrixZero_F_dbl( hypre_ParCSRMatrix *P, HYPRE_Int *CF_marker ); +HYPRE_Int +hypre_ParCSRMatrixZero_F_long_dbl( hypre_ParCSRMatrix *P, HYPRE_Int *CF_marker ); + +hypre_ParCSRMatrix * +hypre_ParCSRTMatMat_flt( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); +hypre_ParCSRMatrix * +hypre_ParCSRTMatMat_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); +hypre_ParCSRMatrix * +hypre_ParCSRTMatMat_long_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); + +hypre_ParCSRMatrix * +hypre_ParCSRTMatMatKT_flt( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, HYPRE_Int keep_transpose ); +hypre_ParCSRMatrix * +hypre_ParCSRTMatMatKT_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, HYPRE_Int keep_transpose ); +hypre_ParCSRMatrix * +hypre_ParCSRTMatMatKT_long_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, HYPRE_Int keep_transpose ); + +hypre_ParCSRMatrix * +hypre_ParCSRTMatMatKTHost_flt( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, HYPRE_Int keep_transpose ); +hypre_ParCSRMatrix * +hypre_ParCSRTMatMatKTHost_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, HYPRE_Int keep_transpose ); +hypre_ParCSRMatrix * +hypre_ParCSRTMatMatKTHost_long_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, HYPRE_Int keep_transpose ); + +hypre_ParCSRMatrix * +hypre_ParMatMinus_F_flt( hypre_ParCSRMatrix *P, hypre_ParCSRMatrix *C, HYPRE_Int *CF_marker ); +hypre_ParCSRMatrix * +hypre_ParMatMinus_F_dbl( hypre_ParCSRMatrix *P, hypre_ParCSRMatrix *C, HYPRE_Int *CF_marker ); +hypre_ParCSRMatrix * +hypre_ParMatMinus_F_long_dbl( hypre_ParCSRMatrix *P, hypre_ParCSRMatrix *C, HYPRE_Int *CF_marker ); + +HYPRE_Int +hypre_ParMatScaleDiagInv_F_flt( hypre_ParCSRMatrix *C, hypre_ParCSRMatrix *A, hypre_float weight, HYPRE_Int *CF_marker ); +HYPRE_Int +hypre_ParMatScaleDiagInv_F_dbl( hypre_ParCSRMatrix *C, hypre_ParCSRMatrix *A, hypre_double weight, HYPRE_Int *CF_marker ); +HYPRE_Int +hypre_ParMatScaleDiagInv_F_long_dbl( hypre_ParCSRMatrix *C, hypre_ParCSRMatrix *A, hypre_long_double weight, HYPRE_Int *CF_marker ); + +hypre_ParCSRMatrix * +hypre_ParMatmul_flt( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); +hypre_ParCSRMatrix * +hypre_ParMatmul_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); +hypre_ParCSRMatrix * +hypre_ParMatmul_long_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); + +hypre_ParCSRMatrix * +hypre_ParMatmul_FC_flt( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, HYPRE_Int *CF_marker, HYPRE_Int *dof_func, HYPRE_Int *dof_func_offd ); +hypre_ParCSRMatrix * +hypre_ParMatmul_FC_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, HYPRE_Int *CF_marker, HYPRE_Int *dof_func, HYPRE_Int *dof_func_offd ); +hypre_ParCSRMatrix * +hypre_ParMatmul_FC_long_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, HYPRE_Int *CF_marker, HYPRE_Int *dof_func, HYPRE_Int *dof_func_offd ); + +void +hypre_ParMatmul_RowSizes_flt( 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 ); +void +hypre_ParMatmul_RowSizes_dbl( 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 ); +void +hypre_ParMatmul_RowSizes_long_dbl( 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_Int +hypre_ParMatmul_RowSizes_Marked_flt( 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_Int +hypre_ParMatmul_RowSizes_Marked_dbl( 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_Int +hypre_ParMatmul_RowSizes_Marked_long_dbl( 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_ParVector * +hypre_ParMultiVectorCreate_flt( MPI_Comm comm, HYPRE_BigInt global_size, HYPRE_BigInt *partitioning, HYPRE_Int num_vectors ); +hypre_ParVector * +hypre_ParMultiVectorCreate_dbl( MPI_Comm comm, HYPRE_BigInt global_size, HYPRE_BigInt *partitioning, HYPRE_Int num_vectors ); +hypre_ParVector * +hypre_ParMultiVectorCreate_long_dbl( MPI_Comm comm, HYPRE_BigInt global_size, HYPRE_BigInt *partitioning, HYPRE_Int num_vectors ); + +hypre_ParCSRMatrix * +hypre_ParTMatmul_flt( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); +hypre_ParCSRMatrix * +hypre_ParTMatmul_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); +hypre_ParCSRMatrix * +hypre_ParTMatmul_long_dbl( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ); + +HYPRE_Int +hypre_ParVectorAxpy_flt( hypre_float alpha, hypre_ParVector *x, hypre_ParVector *y ); +HYPRE_Int +hypre_ParVectorAxpy_dbl( hypre_double alpha, hypre_ParVector *x, hypre_ParVector *y ); +HYPRE_Int +hypre_ParVectorAxpy_long_dbl( hypre_long_double alpha, hypre_ParVector *x, hypre_ParVector *y ); + +HYPRE_Int +hypre_ParVectorAxpyz_flt( hypre_float alpha, hypre_ParVector *x, hypre_float beta, hypre_ParVector *y, hypre_ParVector *z ); +HYPRE_Int +hypre_ParVectorAxpyz_dbl( hypre_double alpha, hypre_ParVector *x, hypre_double beta, hypre_ParVector *y, hypre_ParVector *z ); +HYPRE_Int +hypre_ParVectorAxpyz_long_dbl( hypre_long_double alpha, hypre_ParVector *x, hypre_long_double beta, hypre_ParVector *y, hypre_ParVector *z ); + +hypre_ParVector * +hypre_ParVectorCloneDeep_v2_flt( hypre_ParVector *x, HYPRE_MemoryLocation memory_location ); +hypre_ParVector * +hypre_ParVectorCloneDeep_v2_dbl( hypre_ParVector *x, HYPRE_MemoryLocation memory_location ); +hypre_ParVector * +hypre_ParVectorCloneDeep_v2_long_dbl( hypre_ParVector *x, HYPRE_MemoryLocation memory_location ); + +hypre_ParVector * +hypre_ParVectorCloneShallow_flt( hypre_ParVector *x ); +hypre_ParVector * +hypre_ParVectorCloneShallow_dbl( hypre_ParVector *x ); +hypre_ParVector * +hypre_ParVectorCloneShallow_long_dbl( hypre_ParVector *x ); + +HYPRE_Int +hypre_ParVectorCopy_flt( hypre_ParVector *x, hypre_ParVector *y ); +HYPRE_Int +hypre_ParVectorCopy_dbl( hypre_ParVector *x, hypre_ParVector *y ); +HYPRE_Int +hypre_ParVectorCopy_long_dbl( hypre_ParVector *x, hypre_ParVector *y ); + +hypre_ParVector * +hypre_ParVectorCreate_flt( MPI_Comm comm, HYPRE_BigInt global_size, HYPRE_BigInt *partitioning_in ); +hypre_ParVector * +hypre_ParVectorCreate_dbl( MPI_Comm comm, HYPRE_BigInt global_size, HYPRE_BigInt *partitioning_in ); +hypre_ParVector * +hypre_ParVectorCreate_long_dbl( MPI_Comm comm, HYPRE_BigInt global_size, HYPRE_BigInt *partitioning_in ); + +HYPRE_Int +hypre_ParVectorCreateAssumedPartition_flt( hypre_ParVector *vector ); +HYPRE_Int +hypre_ParVectorCreateAssumedPartition_dbl( hypre_ParVector *vector ); +HYPRE_Int +hypre_ParVectorCreateAssumedPartition_long_dbl( hypre_ParVector *vector ); + +HYPRE_Int +hypre_ParVectorDestroy_flt( hypre_ParVector *vector ); +HYPRE_Int +hypre_ParVectorDestroy_dbl( hypre_ParVector *vector ); +HYPRE_Int +hypre_ParVectorDestroy_long_dbl( hypre_ParVector *vector ); + +HYPRE_Int +hypre_ParVectorGetValues_flt( hypre_ParVector *vector, HYPRE_Int num_values, HYPRE_BigInt *indices, hypre_float *values ); +HYPRE_Int +hypre_ParVectorGetValues_dbl( hypre_ParVector *vector, HYPRE_Int num_values, HYPRE_BigInt *indices, hypre_double *values ); +HYPRE_Int +hypre_ParVectorGetValues_long_dbl( hypre_ParVector *vector, HYPRE_Int num_values, HYPRE_BigInt *indices, hypre_long_double *values ); + +HYPRE_Int +hypre_ParVectorGetValues2_flt( hypre_ParVector *vector, HYPRE_Int num_values, HYPRE_BigInt *indices, HYPRE_BigInt base, hypre_float *values ); +HYPRE_Int +hypre_ParVectorGetValues2_dbl( hypre_ParVector *vector, HYPRE_Int num_values, HYPRE_BigInt *indices, HYPRE_BigInt base, hypre_double *values ); +HYPRE_Int +hypre_ParVectorGetValues2_long_dbl( hypre_ParVector *vector, HYPRE_Int num_values, HYPRE_BigInt *indices, HYPRE_BigInt base, hypre_long_double *values ); + +HYPRE_Int +hypre_ParVectorGetValuesHost_flt( hypre_ParVector *vector, HYPRE_Int num_values, HYPRE_BigInt *indices, HYPRE_BigInt base, hypre_float *values ); +HYPRE_Int +hypre_ParVectorGetValuesHost_dbl( hypre_ParVector *vector, HYPRE_Int num_values, HYPRE_BigInt *indices, HYPRE_BigInt base, hypre_double *values ); +HYPRE_Int +hypre_ParVectorGetValuesHost_long_dbl( hypre_ParVector *vector, HYPRE_Int num_values, HYPRE_BigInt *indices, HYPRE_BigInt base, hypre_long_double *values ); + +HYPRE_Int +hypre_ParVectorInitialize_flt( hypre_ParVector *vector ); +HYPRE_Int +hypre_ParVectorInitialize_dbl( hypre_ParVector *vector ); +HYPRE_Int +hypre_ParVectorInitialize_long_dbl( hypre_ParVector *vector ); + +HYPRE_Int +hypre_ParVectorInitializeShell_flt( hypre_ParVector *vector ); +HYPRE_Int +hypre_ParVectorInitializeShell_dbl( hypre_ParVector *vector ); +HYPRE_Int +hypre_ParVectorInitializeShell_long_dbl( hypre_ParVector *vector ); + +HYPRE_Int +hypre_ParVectorInitialize_v2_flt( hypre_ParVector *vector, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_ParVectorInitialize_v2_dbl( hypre_ParVector *vector, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_ParVectorInitialize_v2_long_dbl( hypre_ParVector *vector, HYPRE_MemoryLocation memory_location ); + +HYPRE_Real +hypre_ParVectorInnerProd_flt( hypre_ParVector *x, hypre_ParVector *y ); +HYPRE_Real +hypre_ParVectorInnerProd_dbl( hypre_ParVector *x, hypre_ParVector *y ); +HYPRE_Real +hypre_ParVectorInnerProd_long_dbl( hypre_ParVector *x, hypre_ParVector *y ); + +HYPRE_Int +hypre_ParVectorInnerProdTagged_flt( hypre_ParVector *x, hypre_ParVector *y, HYPRE_Int *num_tags_ptr, hypre_float **iprod_ptr ); +HYPRE_Int +hypre_ParVectorInnerProdTagged_dbl( hypre_ParVector *x, hypre_ParVector *y, HYPRE_Int *num_tags_ptr, hypre_double **iprod_ptr ); +HYPRE_Int +hypre_ParVectorInnerProdTagged_long_dbl( hypre_ParVector *x, hypre_ParVector *y, HYPRE_Int *num_tags_ptr, hypre_long_double **iprod_ptr ); + +HYPRE_Complex +hypre_ParVectorLocalSumElts_flt( hypre_ParVector *vector ); +HYPRE_Complex +hypre_ParVectorLocalSumElts_dbl( hypre_ParVector *vector ); +HYPRE_Complex +hypre_ParVectorLocalSumElts_long_dbl( hypre_ParVector *vector ); + +HYPRE_Int +hypre_ParVectorMassAxpy_flt( hypre_float *alpha, hypre_ParVector **x, hypre_ParVector *y, HYPRE_Int k, HYPRE_Int unroll ); +HYPRE_Int +hypre_ParVectorMassAxpy_dbl( hypre_double *alpha, hypre_ParVector **x, hypre_ParVector *y, HYPRE_Int k, HYPRE_Int unroll ); +HYPRE_Int +hypre_ParVectorMassAxpy_long_dbl( hypre_long_double *alpha, hypre_ParVector **x, hypre_ParVector *y, HYPRE_Int k, HYPRE_Int unroll ); + +HYPRE_Int +hypre_ParVectorMassDotpTwo_flt( hypre_ParVector *x, hypre_ParVector *y, hypre_ParVector **z, HYPRE_Int k, HYPRE_Int unroll, hypre_float *prod_x, hypre_float *prod_y ); +HYPRE_Int +hypre_ParVectorMassDotpTwo_dbl( hypre_ParVector *x, hypre_ParVector *y, hypre_ParVector **z, HYPRE_Int k, HYPRE_Int unroll, hypre_double *prod_x, hypre_double *prod_y ); +HYPRE_Int +hypre_ParVectorMassDotpTwo_long_dbl( hypre_ParVector *x, hypre_ParVector *y, hypre_ParVector **z, HYPRE_Int k, HYPRE_Int unroll, hypre_long_double *prod_x, hypre_long_double *prod_y ); + +HYPRE_Int +hypre_ParVectorMassInnerProd_flt( hypre_ParVector *x, hypre_ParVector **y, HYPRE_Int k, HYPRE_Int unroll, hypre_float *prod ); +HYPRE_Int +hypre_ParVectorMassInnerProd_dbl( hypre_ParVector *x, hypre_ParVector **y, HYPRE_Int k, HYPRE_Int unroll, hypre_double *prod ); +HYPRE_Int +hypre_ParVectorMassInnerProd_long_dbl( hypre_ParVector *x, hypre_ParVector **y, HYPRE_Int k, HYPRE_Int unroll, hypre_long_double *prod ); + +HYPRE_Int +hypre_ParVectorMigrate_flt( hypre_ParVector *x, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_ParVectorMigrate_dbl( hypre_ParVector *x, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_ParVectorMigrate_long_dbl( hypre_ParVector *x, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +hypre_ParVectorPointwiseDivision_flt( hypre_ParVector *x, hypre_ParVector *y, hypre_ParVector **z_ptr ); +HYPRE_Int +hypre_ParVectorPointwiseDivision_dbl( hypre_ParVector *x, hypre_ParVector *y, hypre_ParVector **z_ptr ); +HYPRE_Int +hypre_ParVectorPointwiseDivision_long_dbl( hypre_ParVector *x, hypre_ParVector *y, hypre_ParVector **z_ptr ); + +HYPRE_Int +hypre_ParVectorPointwiseDivpy_flt( hypre_ParVector *x, hypre_ParVector *b, hypre_ParVector *y ); +HYPRE_Int +hypre_ParVectorPointwiseDivpy_dbl( hypre_ParVector *x, hypre_ParVector *b, hypre_ParVector *y ); +HYPRE_Int +hypre_ParVectorPointwiseDivpy_long_dbl( hypre_ParVector *x, hypre_ParVector *b, hypre_ParVector *y ); + +HYPRE_Int +hypre_ParVectorPointwiseDivpyMarked_flt( hypre_ParVector *x, hypre_ParVector *b, hypre_ParVector *y, HYPRE_Int *marker, HYPRE_Int marker_val ); +HYPRE_Int +hypre_ParVectorPointwiseDivpyMarked_dbl( hypre_ParVector *x, hypre_ParVector *b, hypre_ParVector *y, HYPRE_Int *marker, HYPRE_Int marker_val ); +HYPRE_Int +hypre_ParVectorPointwiseDivpyMarked_long_dbl( hypre_ParVector *x, hypre_ParVector *b, hypre_ParVector *y, HYPRE_Int *marker, HYPRE_Int marker_val ); + +HYPRE_Int +hypre_ParVectorPointwiseInverse_flt( hypre_ParVector *x, hypre_ParVector **y_ptr ); +HYPRE_Int +hypre_ParVectorPointwiseInverse_dbl( hypre_ParVector *x, hypre_ParVector **y_ptr ); +HYPRE_Int +hypre_ParVectorPointwiseInverse_long_dbl( hypre_ParVector *x, hypre_ParVector **y_ptr ); + +HYPRE_Int +hypre_ParVectorPointwiseProduct_flt( hypre_ParVector *x, hypre_ParVector *y, hypre_ParVector **z_ptr ); +HYPRE_Int +hypre_ParVectorPointwiseProduct_dbl( hypre_ParVector *x, hypre_ParVector *y, hypre_ParVector **z_ptr ); +HYPRE_Int +hypre_ParVectorPointwiseProduct_long_dbl( hypre_ParVector *x, hypre_ParVector *y, hypre_ParVector **z_ptr ); + +HYPRE_Int +hypre_ParVectorPrint_flt( hypre_ParVector *vector, const char *file_name ); +HYPRE_Int +hypre_ParVectorPrint_dbl( hypre_ParVector *vector, const char *file_name ); +HYPRE_Int +hypre_ParVectorPrint_long_dbl( hypre_ParVector *vector, const char *file_name ); + +HYPRE_Int +hypre_ParVectorPrintBinaryIJ_flt( hypre_ParVector *par_vector, const char *filename ); +HYPRE_Int +hypre_ParVectorPrintBinaryIJ_dbl( hypre_ParVector *par_vector, const char *filename ); +HYPRE_Int +hypre_ParVectorPrintBinaryIJ_long_dbl( hypre_ParVector *par_vector, const char *filename ); + +HYPRE_Int +hypre_ParVectorPrintIJ_flt( hypre_ParVector *vector, HYPRE_Int base_j, const char *filename ); +HYPRE_Int +hypre_ParVectorPrintIJ_dbl( hypre_ParVector *vector, HYPRE_Int base_j, const char *filename ); +HYPRE_Int +hypre_ParVectorPrintIJ_long_dbl( hypre_ParVector *vector, HYPRE_Int base_j, const char *filename ); + +hypre_ParVector * +hypre_ParVectorRead_flt( MPI_Comm comm, const char *file_name ); +hypre_ParVector * +hypre_ParVectorRead_dbl( MPI_Comm comm, const char *file_name ); +hypre_ParVector * +hypre_ParVectorRead_long_dbl( MPI_Comm comm, const char *file_name ); + +HYPRE_Int +hypre_ParVectorReadIJ_flt( MPI_Comm comm, const char *filename, HYPRE_Int *base_j_ptr, hypre_ParVector **vector_ptr ); +HYPRE_Int +hypre_ParVectorReadIJ_dbl( MPI_Comm comm, const char *filename, HYPRE_Int *base_j_ptr, hypre_ParVector **vector_ptr ); +HYPRE_Int +hypre_ParVectorReadIJ_long_dbl( MPI_Comm comm, const char *filename, HYPRE_Int *base_j_ptr, hypre_ParVector **vector_ptr ); + +HYPRE_Int +hypre_ParVectorResize_flt( hypre_ParVector *vector, HYPRE_Int size, HYPRE_Int num_vectors ); +HYPRE_Int +hypre_ParVectorResize_dbl( hypre_ParVector *vector, HYPRE_Int size, HYPRE_Int num_vectors ); +HYPRE_Int +hypre_ParVectorResize_long_dbl( hypre_ParVector *vector, HYPRE_Int size, HYPRE_Int num_vectors ); + +HYPRE_Int +hypre_ParVectorScale_flt( hypre_float alpha, hypre_ParVector *y ); +HYPRE_Int +hypre_ParVectorScale_dbl( hypre_double alpha, hypre_ParVector *y ); +HYPRE_Int +hypre_ParVectorScale_long_dbl( hypre_long_double alpha, hypre_ParVector *y ); + +HYPRE_Int +hypre_ParVectorSetComponent_flt( hypre_ParVector *vector, HYPRE_Int component ); +HYPRE_Int +hypre_ParVectorSetComponent_dbl( hypre_ParVector *vector, HYPRE_Int component ); +HYPRE_Int +hypre_ParVectorSetComponent_long_dbl( hypre_ParVector *vector, HYPRE_Int component ); + +HYPRE_Int +hypre_ParVectorSetConstantValues_flt( hypre_ParVector *v, hypre_float value ); +HYPRE_Int +hypre_ParVectorSetConstantValues_dbl( hypre_ParVector *v, hypre_double value ); +HYPRE_Int +hypre_ParVectorSetConstantValues_long_dbl( hypre_ParVector *v, hypre_long_double value ); + +HYPRE_Int +hypre_ParVectorSetData_flt( hypre_ParVector *vector, hypre_float *data ); +HYPRE_Int +hypre_ParVectorSetData_dbl( hypre_ParVector *vector, hypre_double *data ); +HYPRE_Int +hypre_ParVectorSetData_long_dbl( hypre_ParVector *vector, hypre_long_double *data ); + +HYPRE_Int +hypre_ParVectorSetDataOwner_flt( hypre_ParVector *vector, HYPRE_Int owns_data ); +HYPRE_Int +hypre_ParVectorSetDataOwner_dbl( hypre_ParVector *vector, HYPRE_Int owns_data ); +HYPRE_Int +hypre_ParVectorSetDataOwner_long_dbl( hypre_ParVector *vector, HYPRE_Int owns_data ); + +HYPRE_Int +hypre_ParVectorSetLocalSize_flt( hypre_ParVector *vector, HYPRE_Int local_size ); +HYPRE_Int +hypre_ParVectorSetLocalSize_dbl( hypre_ParVector *vector, HYPRE_Int local_size ); +HYPRE_Int +hypre_ParVectorSetLocalSize_long_dbl( hypre_ParVector *vector, HYPRE_Int local_size ); + +HYPRE_Int +hypre_ParVectorSetNumTags_flt( hypre_ParVector *vector, HYPRE_Int num_tags ); +HYPRE_Int +hypre_ParVectorSetNumTags_dbl( hypre_ParVector *vector, HYPRE_Int num_tags ); +HYPRE_Int +hypre_ParVectorSetNumTags_long_dbl( hypre_ParVector *vector, HYPRE_Int num_tags ); + +HYPRE_Int +hypre_ParVectorSetOwnsTags_flt( hypre_ParVector *vector, HYPRE_Int owns_tags ); +HYPRE_Int +hypre_ParVectorSetOwnsTags_dbl( hypre_ParVector *vector, HYPRE_Int owns_tags ); +HYPRE_Int +hypre_ParVectorSetOwnsTags_long_dbl( hypre_ParVector *vector, HYPRE_Int owns_tags ); + +HYPRE_Int +hypre_ParVectorSetRandomValues_flt( hypre_ParVector *v, HYPRE_Int seed ); +HYPRE_Int +hypre_ParVectorSetRandomValues_dbl( hypre_ParVector *v, HYPRE_Int seed ); +HYPRE_Int +hypre_ParVectorSetRandomValues_long_dbl( hypre_ParVector *v, HYPRE_Int seed ); + +HYPRE_Int +hypre_ParVectorSetTags_flt( hypre_ParVector *vector, HYPRE_MemoryLocation memory_location, HYPRE_Int *tags ); +HYPRE_Int +hypre_ParVectorSetTags_dbl( hypre_ParVector *vector, HYPRE_MemoryLocation memory_location, HYPRE_Int *tags ); +HYPRE_Int +hypre_ParVectorSetTags_long_dbl( hypre_ParVector *vector, HYPRE_MemoryLocation memory_location, HYPRE_Int *tags ); + +HYPRE_Int +hypre_ParVectorSetValuesTagged_flt( hypre_ParVector *vector, hypre_float *values ); +HYPRE_Int +hypre_ParVectorSetValuesTagged_dbl( hypre_ParVector *vector, hypre_double *values ); +HYPRE_Int +hypre_ParVectorSetValuesTagged_long_dbl( hypre_ParVector *vector, hypre_long_double *values ); + +HYPRE_Int +hypre_ParVectorSetZeros_flt( hypre_ParVector *v ); +HYPRE_Int +hypre_ParVectorSetZeros_dbl( hypre_ParVector *v ); +HYPRE_Int +hypre_ParVectorSetZeros_long_dbl( hypre_ParVector *v ); + +HYPRE_Int +hypre_ParVectorStridedCopy_flt( hypre_ParVector *x, HYPRE_Int istride, HYPRE_Int ostride, HYPRE_Int size, hypre_float *data ); +HYPRE_Int +hypre_ParVectorStridedCopy_dbl( hypre_ParVector *x, HYPRE_Int istride, HYPRE_Int ostride, HYPRE_Int size, hypre_double *data ); +HYPRE_Int +hypre_ParVectorStridedCopy_long_dbl( hypre_ParVector *x, HYPRE_Int istride, HYPRE_Int ostride, HYPRE_Int size, hypre_long_double *data ); + +hypre_Vector * +hypre_ParVectorToVectorAll_flt( hypre_ParVector *par_v ); +hypre_Vector * +hypre_ParVectorToVectorAll_dbl( hypre_ParVector *par_v ); +hypre_Vector * +hypre_ParVectorToVectorAll_long_dbl( hypre_ParVector *par_v ); + +hypre_Vector * +hypre_ParVectorToVectorAll_v2_flt( hypre_ParVector *par_v, HYPRE_MemoryLocation memory_location ); +hypre_Vector * +hypre_ParVectorToVectorAll_v2_dbl( hypre_ParVector *par_v, HYPRE_MemoryLocation memory_location ); +hypre_Vector * +hypre_ParVectorToVectorAll_v2_long_dbl( hypre_ParVector *par_v, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +hypre_ParcsrBdiagInvScal_flt( hypre_ParCSRMatrix *A, HYPRE_Int blockSize, hypre_ParCSRMatrix **As ); +HYPRE_Int +hypre_ParcsrBdiagInvScal_dbl( hypre_ParCSRMatrix *A, HYPRE_Int blockSize, hypre_ParCSRMatrix **As ); +HYPRE_Int +hypre_ParcsrBdiagInvScal_long_dbl( hypre_ParCSRMatrix *A, HYPRE_Int blockSize, hypre_ParCSRMatrix **As ); + +HYPRE_Int +hypre_ParcsrGetExternalRowsInit_flt( 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_dbl( 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_long_dbl( 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_flt( void *vrequest ); +hypre_CSRMatrix* +hypre_ParcsrGetExternalRowsWait_dbl( void *vrequest ); +hypre_CSRMatrix* +hypre_ParcsrGetExternalRowsWait_long_dbl( void *vrequest ); + +HYPRE_Int +hypre_ParvecBdiagInvScal_flt( hypre_ParVector *b, HYPRE_Int blockSize, hypre_ParVector **bs, hypre_ParCSRMatrix *A ); +HYPRE_Int +hypre_ParvecBdiagInvScal_dbl( hypre_ParVector *b, HYPRE_Int blockSize, hypre_ParVector **bs, hypre_ParCSRMatrix *A ); +HYPRE_Int +hypre_ParvecBdiagInvScal_long_dbl( hypre_ParVector *b, HYPRE_Int blockSize, hypre_ParVector **bs, hypre_ParCSRMatrix *A ); + +HYPRE_Int +hypre_PrintCommpkg_flt( hypre_ParCSRMatrix *A, const char *file_name ); +HYPRE_Int +hypre_PrintCommpkg_dbl( hypre_ParCSRMatrix *A, const char *file_name ); +HYPRE_Int +hypre_PrintCommpkg_long_dbl( hypre_ParCSRMatrix *A, const char *file_name ); + +HYPRE_Int +hypre_RangeFillResponseIJDetermineRecvProcs_flt( 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_dbl( 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_long_dbl( 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 ); + +void +hypre_RowsWithColumn_flt( 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_RowsWithColumn_dbl( 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_RowsWithColumn_long_dbl( 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_RowsWithColumn_original_flt( HYPRE_Int *rowmin, HYPRE_Int *rowmax, HYPRE_BigInt column, hypre_ParCSRMatrix *A ); +void +hypre_RowsWithColumn_original_dbl( HYPRE_Int *rowmin, HYPRE_Int *rowmax, HYPRE_BigInt column, hypre_ParCSRMatrix *A ); +void +hypre_RowsWithColumn_original_long_dbl( HYPRE_Int *rowmin, HYPRE_Int *rowmax, HYPRE_BigInt column, hypre_ParCSRMatrix *A ); + +hypre_ParVector * +hypre_VectorToParVector_flt( MPI_Comm comm, hypre_Vector *v, HYPRE_BigInt *vec_starts ); +hypre_ParVector * +hypre_VectorToParVector_dbl( MPI_Comm comm, hypre_Vector *v, HYPRE_BigInt *vec_starts ); +hypre_ParVector * +hypre_VectorToParVector_long_dbl( MPI_Comm comm, hypre_Vector *v, HYPRE_BigInt *vec_starts ); + + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_Destroy2DSystem_flt( HYPRE_ParCSR_System_Problem *sys_prob ); +HYPRE_Int +HYPRE_Destroy2DSystem_dbl( HYPRE_ParCSR_System_Problem *sys_prob ); +HYPRE_Int +HYPRE_Destroy2DSystem_long_dbl( HYPRE_ParCSR_System_Problem *sys_prob ); +HYPRE_Int +HYPRE_Destroy2DSystem( HYPRE_ParCSR_System_Problem *sys_prob ); + +HYPRE_ParCSR_System_Problem * +HYPRE_Generate2DSystem_flt( 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_float *M_vals ); +HYPRE_ParCSR_System_Problem * +HYPRE_Generate2DSystem_dbl( 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_double *M_vals ); +HYPRE_ParCSR_System_Problem * +HYPRE_Generate2DSystem_long_dbl( 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_long_double *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, void *M_vals ); + + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_Destroy2DSystem_pre( HYPRE_Precision precision, HYPRE_ParCSR_System_Problem *sys_prob ); + +HYPRE_ParCSR_System_Problem * +HYPRE_Generate2DSystem_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix H_L1, HYPRE_ParCSRMatrix H_L2, HYPRE_ParVector H_b1, HYPRE_ParVector H_b2, HYPRE_ParVector H_x1, HYPRE_ParVector H_x2, void *M_vals ); + + +#endif + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/src/parcsr_mv/_hypre_parcsr_mv_mup_def.h b/src/parcsr_mv/_hypre_parcsr_mv_mup_def.h new file mode 100644 index 0000000000..aee2731ee1 --- /dev/null +++ b/src/parcsr_mv/_hypre_parcsr_mv_mup_def.h @@ -0,0 +1,327 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#ifndef hypre_PARCSR_MV_MUP_DEF_HEADER +#define hypre_PARCSR_MV_MUP_DEF_HEADER + +#include "_hypre_mup_def.h" + +#define HYPRE_CSRMatrixToParCSRMatrix HYPRE_MULTIPRECISION_FUNC ( HYPRE_CSRMatrixToParCSRMatrix ) +#define HYPRE_CSRMatrixToParCSRMatrix_WithNewPartitioning HYPRE_MULTIPRECISION_FUNC ( HYPRE_CSRMatrixToParCSRMatrix_WithNewPartitioning ) +#define HYPRE_Destroy2DSystem HYPRE_MULTIPRECISION_FUNC ( HYPRE_Destroy2DSystem ) +#define HYPRE_Generate2DSystem HYPRE_MULTIPRECISION_FUNC ( HYPRE_Generate2DSystem ) +#define HYPRE_ParCSRMatrixComputeScalingTagged HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRMatrixComputeScalingTagged ) +#define HYPRE_ParCSRMatrixCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRMatrixCreate ) +#define HYPRE_ParCSRMatrixDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRMatrixDestroy ) +#define HYPRE_ParCSRMatrixDiagScale HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRMatrixDiagScale ) +#define HYPRE_ParCSRMatrixGetColPartitioning HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRMatrixGetColPartitioning ) +#define HYPRE_ParCSRMatrixGetComm HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRMatrixGetComm ) +#define HYPRE_ParCSRMatrixGetDims HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRMatrixGetDims ) +#define HYPRE_ParCSRMatrixGetGlobalRowPartitioning HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRMatrixGetGlobalRowPartitioning ) +#define HYPRE_ParCSRMatrixGetLocalRange HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRMatrixGetLocalRange ) +#define HYPRE_ParCSRMatrixGetRow HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRMatrixGetRow ) +#define HYPRE_ParCSRMatrixGetRowPartitioning HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRMatrixGetRowPartitioning ) +#define HYPRE_ParCSRMatrixInitialize HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRMatrixInitialize ) +#define HYPRE_ParCSRMatrixMatmat HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRMatrixMatmat ) +#define HYPRE_ParCSRMatrixMatvec HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRMatrixMatvec ) +#define HYPRE_ParCSRMatrixMatvecT HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRMatrixMatvecT ) +#define HYPRE_ParCSRMatrixPrint HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRMatrixPrint ) +#define HYPRE_ParCSRMatrixRead HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRMatrixRead ) +#define HYPRE_ParCSRMatrixRestoreRow HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParCSRMatrixRestoreRow ) +#define HYPRE_ParMultiVectorCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParMultiVectorCreate ) +#define HYPRE_ParVectorAxpy HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParVectorAxpy ) +#define HYPRE_ParVectorCloneShallow HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParVectorCloneShallow ) +#define HYPRE_ParVectorCopy HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParVectorCopy ) +#define HYPRE_ParVectorCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParVectorCreate ) +#define HYPRE_ParVectorDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParVectorDestroy ) +#define HYPRE_ParVectorGetValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParVectorGetValues ) +#define HYPRE_ParVectorInitialize HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParVectorInitialize ) +#define HYPRE_ParVectorInnerProd HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParVectorInnerProd ) +#define HYPRE_ParVectorPointwiseDivision HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParVectorPointwiseDivision ) +#define HYPRE_ParVectorPointwiseInverse HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParVectorPointwiseInverse ) +#define HYPRE_ParVectorPointwiseProduct HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParVectorPointwiseProduct ) +#define HYPRE_ParVectorPrint HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParVectorPrint ) +#define HYPRE_ParVectorPrintBinaryIJ HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParVectorPrintBinaryIJ ) +#define HYPRE_ParVectorRead HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParVectorRead ) +#define HYPRE_ParVectorScale HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParVectorScale ) +#define HYPRE_ParVectorSetConstantValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParVectorSetConstantValues ) +#define HYPRE_ParVectorSetRandomValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_ParVectorSetRandomValues ) +#define HYPRE_VectorToParVector HYPRE_MULTIPRECISION_FUNC ( HYPRE_VectorToParVector ) +#define hypre_AssumedPartitionCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_AssumedPartitionCreate ) +#define hypre_AssumedPartitionDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_AssumedPartitionDestroy ) +#define hypre_BooleanGenerateDiagAndOffd HYPRE_FIXEDPRECISION_FUNC ( hypre_BooleanGenerateDiagAndOffd ) +#define hypre_BooleanMatTCommPkgCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_BooleanMatTCommPkgCreate ) +#define hypre_BooleanMatvecCommPkgCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_BooleanMatvecCommPkgCreate ) +#define hypre_BuildCSRBooleanMatrixMPIDataType HYPRE_FIXEDPRECISION_FUNC ( hypre_BuildCSRBooleanMatrixMPIDataType ) +#define hypre_BuildCSRJDataType HYPRE_FIXEDPRECISION_FUNC ( hypre_BuildCSRJDataType ) +#define hypre_BuildCSRMatrixMPIDataType HYPRE_FIXEDPRECISION_FUNC ( hypre_BuildCSRMatrixMPIDataType ) +#define hypre_CSRBooleanMatrixBigInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBooleanMatrixBigInitialize ) +#define hypre_CSRBooleanMatrixCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBooleanMatrixCreate ) +#define hypre_CSRBooleanMatrixDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBooleanMatrixDestroy ) +#define hypre_CSRBooleanMatrixInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBooleanMatrixInitialize ) +#define hypre_CSRBooleanMatrixPrint HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBooleanMatrixPrint ) +#define hypre_CSRBooleanMatrixRead HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBooleanMatrixRead ) +#define hypre_CSRBooleanMatrixSetDataOwner HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBooleanMatrixSetDataOwner ) +#define hypre_CSRBooleanMatrixToParCSRBooleanMatrix HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRBooleanMatrixToParCSRBooleanMatrix ) +#define hypre_CSRMatrixToParCSRMatrix HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixToParCSRMatrix ) +#define hypre_ExchangeExternalRowsInit HYPRE_FIXEDPRECISION_FUNC ( hypre_ExchangeExternalRowsInit ) +#define hypre_ExchangeExternalRowsWait HYPRE_FIXEDPRECISION_FUNC ( hypre_ExchangeExternalRowsWait ) +#define hypre_FillResponseIJDetermineSendProcs HYPRE_FIXEDPRECISION_FUNC ( hypre_FillResponseIJDetermineSendProcs ) +#define hypre_FillResponseParToCSRMatrix HYPRE_FIXEDPRECISION_FUNC ( hypre_FillResponseParToCSRMatrix ) +#define hypre_FillResponseParToVectorAll HYPRE_FIXEDPRECISION_FUNC ( hypre_FillResponseParToVectorAll ) +#define hypre_GenerateDiagAndOffd HYPRE_FIXEDPRECISION_FUNC ( hypre_GenerateDiagAndOffd ) +#define hypre_GetAssumedPartitionProcFromRow HYPRE_FIXEDPRECISION_FUNC ( hypre_GetAssumedPartitionProcFromRow ) +#define hypre_GetAssumedPartitionRowRange HYPRE_FIXEDPRECISION_FUNC ( hypre_GetAssumedPartitionRowRange ) +#define hypre_LocateAssumedPartition HYPRE_FIXEDPRECISION_FUNC ( hypre_LocateAssumedPartition ) +#define hypre_MatTCommPkgCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_MatTCommPkgCreate ) +#define hypre_MatTCommPkgCreate_core HYPRE_FIXEDPRECISION_FUNC ( hypre_MatTCommPkgCreate_core ) +#define hypre_MatvecCommPkgCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_MatvecCommPkgCreate ) +#define hypre_MatvecCommPkgDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_MatvecCommPkgDestroy ) +#define hypre_MergeDiagAndOffd HYPRE_FIXEDPRECISION_FUNC ( hypre_MergeDiagAndOffd ) +#define hypre_MergeDiagAndOffdHost HYPRE_FIXEDPRECISION_FUNC ( hypre_MergeDiagAndOffdHost ) +#define hypre_NewCommPkgDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_NewCommPkgDestroy ) +#define hypre_NumbersArray HYPRE_FIXEDPRECISION_FUNC ( hypre_NumbersArray ) +#define hypre_NumbersDeleteNode HYPRE_FIXEDPRECISION_FUNC ( hypre_NumbersDeleteNode ) +#define hypre_NumbersEnter HYPRE_FIXEDPRECISION_FUNC ( hypre_NumbersEnter ) +#define hypre_NumbersNEntered HYPRE_FIXEDPRECISION_FUNC ( hypre_NumbersNEntered ) +#define hypre_NumbersNewNode HYPRE_FIXEDPRECISION_FUNC ( hypre_NumbersNewNode ) +#define hypre_NumbersQuery HYPRE_FIXEDPRECISION_FUNC ( hypre_NumbersQuery ) +#define hypre_ParAat_RowSizes HYPRE_FIXEDPRECISION_FUNC ( hypre_ParAat_RowSizes ) +#define hypre_ParBooleanAAt HYPRE_FIXEDPRECISION_FUNC ( hypre_ParBooleanAAt ) +#define hypre_ParBooleanMatmul HYPRE_FIXEDPRECISION_FUNC ( hypre_ParBooleanMatmul ) +#define hypre_ParCSRAAt HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRAAt ) +#define hypre_ParCSRBooleanMatrixCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBooleanMatrixCreate ) +#define hypre_ParCSRBooleanMatrixDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBooleanMatrixDestroy ) +#define hypre_ParCSRBooleanMatrixExtractAExt HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBooleanMatrixExtractAExt ) +#define hypre_ParCSRBooleanMatrixExtractBExt HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBooleanMatrixExtractBExt ) +#define hypre_ParCSRBooleanMatrixGetLocalRange HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBooleanMatrixGetLocalRange ) +#define hypre_ParCSRBooleanMatrixGetRow HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBooleanMatrixGetRow ) +#define hypre_ParCSRBooleanMatrixInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBooleanMatrixInitialize ) +#define hypre_ParCSRBooleanMatrixPrint HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBooleanMatrixPrint ) +#define hypre_ParCSRBooleanMatrixPrintIJ HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBooleanMatrixPrintIJ ) +#define hypre_ParCSRBooleanMatrixRead HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBooleanMatrixRead ) +#define hypre_ParCSRBooleanMatrixRestoreRow HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBooleanMatrixRestoreRow ) +#define hypre_ParCSRBooleanMatrixSetColStartsOwner HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBooleanMatrixSetColStartsOwner ) +#define hypre_ParCSRBooleanMatrixSetDataOwner HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBooleanMatrixSetDataOwner ) +#define hypre_ParCSRBooleanMatrixSetNNZ HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBooleanMatrixSetNNZ ) +#define hypre_ParCSRBooleanMatrixSetRowStartsOwner HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRBooleanMatrixSetRowStartsOwner ) +#define hypre_ParCSRCommHandleCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRCommHandleCreate ) +#define hypre_ParCSRCommHandleCreate_v2 HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRCommHandleCreate_v2 ) +#define hypre_ParCSRCommHandleDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRCommHandleDestroy ) +#define hypre_ParCSRCommPkgCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRCommPkgCreate ) +#define hypre_ParCSRCommPkgCreateAndFill HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRCommPkgCreateAndFill ) +#define hypre_ParCSRCommPkgCreateApart HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRCommPkgCreateApart ) +#define hypre_ParCSRCommPkgCreateApart_core HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRCommPkgCreateApart_core ) +#define hypre_ParCSRCommPkgCreate_core HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRCommPkgCreate_core ) +#define hypre_ParCSRCommPkgUpdateVecStarts HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRCommPkgUpdateVecStarts ) +#define hypre_ParCSRDiagScaleVector HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRDiagScaleVector ) +#define hypre_ParCSRDiagScaleVectorHost HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRDiagScaleVectorHost ) +#define hypre_ParCSRFindExtendCommPkg HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRFindExtendCommPkg ) +#define hypre_ParCSRMatMat HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatMat ) +#define hypre_ParCSRMatMatDiag HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatMatDiag ) +#define hypre_ParCSRMatMatDiagHost HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatMatDiagHost ) +#define hypre_ParCSRMatMatHost HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatMatHost ) +#define hypre_ParCSRMatrixAdd HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixAdd ) +#define hypre_ParCSRMatrixAddHost HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixAddHost ) +#define hypre_ParCSRMatrixAminvDB HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixAminvDB ) +#define hypre_ParCSRMatrixBlkFilter HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixBlkFilter ) +#define hypre_ParCSRMatrixBlkFilterHost HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixBlkFilterHost ) +#define hypre_ParCSRMatrixBlockColSum HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixBlockColSum ) +#define hypre_ParCSRMatrixBlockColSumHost HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixBlockColSumHost ) +#define hypre_ParCSRMatrixClone HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixClone ) +#define hypre_ParCSRMatrixClone_v2 HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixClone_v2 ) +#define hypre_ParCSRMatrixColSum HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixColSum ) +#define hypre_ParCSRMatrixColSumHost HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixColSumHost ) +#define hypre_ParCSRMatrixCompressOffdMap HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixCompressOffdMap ) +#define hypre_ParCSRMatrixComputeScalingTagged HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixComputeScalingTagged ) +#define hypre_ParCSRMatrixCopy HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixCopy ) +#define hypre_ParCSRMatrixCopyColMapOffdToDevice HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixCopyColMapOffdToDevice ) +#define hypre_ParCSRMatrixCopyColMapOffdToHost HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixCopyColMapOffdToHost ) +#define hypre_ParCSRMatrixCopy_C HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixCopy_C ) +#define hypre_ParCSRMatrixCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixCreate ) +#define hypre_ParCSRMatrixCreateAssumedPartition HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixCreateAssumedPartition ) +#define hypre_ParCSRMatrixCreateFromDenseBlockMatrix HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixCreateFromDenseBlockMatrix ) +#define hypre_ParCSRMatrixCreateFromParVector HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixCreateFromParVector ) +#define hypre_ParCSRMatrixDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixDestroy ) +#define hypre_ParCSRMatrixDiagScale HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixDiagScale ) +#define hypre_ParCSRMatrixDiagScaleHost HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixDiagScaleHost ) +#define hypre_ParCSRMatrixDropSmallEntries HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixDropSmallEntries ) +#define hypre_ParCSRMatrixDropSmallEntriesHost HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixDropSmallEntriesHost ) +#define hypre_ParCSRMatrixEliminateRowsCols HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixEliminateRowsCols ) +#define hypre_ParCSRMatrixExtractAExt HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixExtractAExt ) +#define hypre_ParCSRMatrixExtractBExt HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixExtractBExt ) +#define hypre_ParCSRMatrixExtractBExt_Arrays HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixExtractBExt_Arrays ) +#define hypre_ParCSRMatrixExtractBExt_Arrays_Overlap HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixExtractBExt_Arrays_Overlap ) +#define hypre_ParCSRMatrixExtractBExt_Overlap HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixExtractBExt_Overlap ) +#define hypre_ParCSRMatrixExtractRowSubmatrices HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixExtractRowSubmatrices ) +#define hypre_ParCSRMatrixExtractSubmatrices HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixExtractSubmatrices ) +#define hypre_ParCSRMatrixExtractSubmatrixFC HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixExtractSubmatrixFC ) +#define hypre_ParCSRMatrixFnorm HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixFnorm ) +#define hypre_ParCSRMatrixGenSpanningTree HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixGenSpanningTree ) +#define hypre_ParCSRMatrixGenerateFFFC HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixGenerateFFFC ) +#define hypre_ParCSRMatrixGenerateFFFC3 HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixGenerateFFFC3 ) +#define hypre_ParCSRMatrixGenerateFFFCD3 HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixGenerateFFFCD3 ) +#define hypre_ParCSRMatrixGenerateFFFCHost HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixGenerateFFFCHost ) +#define hypre_ParCSRMatrixGetLocalRange HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixGetLocalRange ) +#define hypre_ParCSRMatrixGetRow HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixGetRow ) +#define hypre_ParCSRMatrixGetRowHost HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixGetRowHost ) +#define hypre_ParCSRMatrixInfNorm HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixInfNorm ) +#define hypre_ParCSRMatrixInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixInitialize ) +#define hypre_ParCSRMatrixInitialize_v2 HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixInitialize_v2 ) +#define hypre_ParCSRMatrixLocalSumElts HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixLocalSumElts ) +#define hypre_ParCSRMatrixLocalTranspose HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixLocalTranspose ) +#define hypre_ParCSRMatrixMatvec HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixMatvec ) +#define hypre_ParCSRMatrixMatvecOutOfPlace HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixMatvecOutOfPlace ) +#define hypre_ParCSRMatrixMatvecOutOfPlaceHost HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixMatvecOutOfPlaceHost ) +#define hypre_ParCSRMatrixMatvecT HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixMatvecT ) +#define hypre_ParCSRMatrixMatvecTHost HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixMatvecTHost ) +#define hypre_ParCSRMatrixMatvec_FF HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixMatvec_FF ) +#define hypre_ParCSRMatrixMigrate HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixMigrate ) +#define hypre_ParCSRMatrixPrint HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixPrint ) +#define hypre_ParCSRMatrixPrintBinaryIJ HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixPrintBinaryIJ ) +#define hypre_ParCSRMatrixPrintIJ HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixPrintIJ ) +#define hypre_ParCSRMatrixRAP HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixRAP ) +#define hypre_ParCSRMatrixRAPKT HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixRAPKT ) +#define hypre_ParCSRMatrixRAPKTHost HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixRAPKTHost ) +#define hypre_ParCSRMatrixRead HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixRead ) +#define hypre_ParCSRMatrixReadIJ HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixReadIJ ) +#define hypre_ParCSRMatrixReorder HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixReorder ) +#define hypre_ParCSRMatrixRestoreRow HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixRestoreRow ) +#define hypre_ParCSRMatrixScale HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixScale ) +#define hypre_ParCSRMatrixSetConstantValues HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixSetConstantValues ) +#define hypre_ParCSRMatrixSetDNumNonzeros HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixSetDNumNonzeros ) +#define hypre_ParCSRMatrixSetDataOwner HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixSetDataOwner ) +#define hypre_ParCSRMatrixSetNumNonzeros HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixSetNumNonzeros ) +#define hypre_ParCSRMatrixSetNumNonzeros_core HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixSetNumNonzeros_core ) +#define hypre_ParCSRMatrixSetNumRownnz HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixSetNumRownnz ) +#define hypre_ParCSRMatrixSetPatternOnly HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixSetPatternOnly ) +#define hypre_ParCSRMatrixStatsArrayCompute HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixStatsArrayCompute ) +#define hypre_ParCSRMatrixStatsComputePassOneLocal HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixStatsComputePassOneLocal ) +#define hypre_ParCSRMatrixStatsComputePassOneLocalHost HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixStatsComputePassOneLocalHost ) +#define hypre_ParCSRMatrixStatsComputePassTwoLocal HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixStatsComputePassTwoLocal ) +#define hypre_ParCSRMatrixStatsComputePassTwoLocalHost HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixStatsComputePassTwoLocalHost ) +#define hypre_ParCSRMatrixToCSRMatrixAll HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixToCSRMatrixAll ) +#define hypre_ParCSRMatrixToCSRMatrixAll_v2 HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixToCSRMatrixAll_v2 ) +#define hypre_ParCSRMatrixTranspose HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixTranspose ) +#define hypre_ParCSRMatrixTransposeHost HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixTransposeHost ) +#define hypre_ParCSRMatrixTruncate HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixTruncate ) +#define hypre_ParCSRMatrixUnion HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixUnion ) +#define hypre_ParCSRMatrixZero_F HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRMatrixZero_F ) +#define hypre_ParCSRTMatMat HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRTMatMat ) +#define hypre_ParCSRTMatMatKT HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRTMatMatKT ) +#define hypre_ParCSRTMatMatKTHost HYPRE_FIXEDPRECISION_FUNC ( hypre_ParCSRTMatMatKTHost ) +#define hypre_ParMatMinus_F HYPRE_FIXEDPRECISION_FUNC ( hypre_ParMatMinus_F ) +#define hypre_ParMatScaleDiagInv_F HYPRE_FIXEDPRECISION_FUNC ( hypre_ParMatScaleDiagInv_F ) +#define hypre_ParMatmul HYPRE_FIXEDPRECISION_FUNC ( hypre_ParMatmul ) +#define hypre_ParMatmul_FC HYPRE_FIXEDPRECISION_FUNC ( hypre_ParMatmul_FC ) +#define hypre_ParMatmul_RowSizes HYPRE_FIXEDPRECISION_FUNC ( hypre_ParMatmul_RowSizes ) +#define hypre_ParMatmul_RowSizes_Marked HYPRE_FIXEDPRECISION_FUNC ( hypre_ParMatmul_RowSizes_Marked ) +#define hypre_ParMultiVectorCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_ParMultiVectorCreate ) +#define hypre_ParTMatmul HYPRE_FIXEDPRECISION_FUNC ( hypre_ParTMatmul ) +#define hypre_ParVectorAxpy HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorAxpy ) +#define hypre_ParVectorAxpyz HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorAxpyz ) +#define hypre_ParVectorCloneDeep_v2 HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorCloneDeep_v2 ) +#define hypre_ParVectorCloneShallow HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorCloneShallow ) +#define hypre_ParVectorCopy HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorCopy ) +#define hypre_ParVectorCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorCreate ) +#define hypre_ParVectorCreateAssumedPartition HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorCreateAssumedPartition ) +#define hypre_ParVectorDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorDestroy ) +#define hypre_ParVectorGetValues HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorGetValues ) +#define hypre_ParVectorGetValues2 HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorGetValues2 ) +#define hypre_ParVectorGetValuesHost HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorGetValuesHost ) +#define hypre_ParVectorInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorInitialize ) +#define hypre_ParVectorInitializeShell HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorInitializeShell ) +#define hypre_ParVectorInitialize_v2 HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorInitialize_v2 ) +#define hypre_ParVectorInnerProd HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorInnerProd ) +#define hypre_ParVectorInnerProdTagged HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorInnerProdTagged ) +#define hypre_ParVectorLocalSumElts HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorLocalSumElts ) +#define hypre_ParVectorMassAxpy HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorMassAxpy ) +#define hypre_ParVectorMassDotpTwo HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorMassDotpTwo ) +#define hypre_ParVectorMassInnerProd HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorMassInnerProd ) +#define hypre_ParVectorMigrate HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorMigrate ) +#define hypre_ParVectorPointwiseDivision HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorPointwiseDivision ) +#define hypre_ParVectorPointwiseDivpy HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorPointwiseDivpy ) +#define hypre_ParVectorPointwiseDivpyMarked HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorPointwiseDivpyMarked ) +#define hypre_ParVectorPointwiseInverse HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorPointwiseInverse ) +#define hypre_ParVectorPointwiseProduct HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorPointwiseProduct ) +#define hypre_ParVectorPrint HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorPrint ) +#define hypre_ParVectorPrintBinaryIJ HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorPrintBinaryIJ ) +#define hypre_ParVectorPrintIJ HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorPrintIJ ) +#define hypre_ParVectorRead HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorRead ) +#define hypre_ParVectorReadIJ HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorReadIJ ) +#define hypre_ParVectorResize HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorResize ) +#define hypre_ParVectorScale HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorScale ) +#define hypre_ParVectorSetComponent HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorSetComponent ) +#define hypre_ParVectorSetConstantValues HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorSetConstantValues ) +#define hypre_ParVectorSetData HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorSetData ) +#define hypre_ParVectorSetDataOwner HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorSetDataOwner ) +#define hypre_ParVectorSetLocalSize HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorSetLocalSize ) +#define hypre_ParVectorSetNumTags HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorSetNumTags ) +#define hypre_ParVectorSetOwnsTags HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorSetOwnsTags ) +#define hypre_ParVectorSetRandomValues HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorSetRandomValues ) +#define hypre_ParVectorSetTags HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorSetTags ) +#define hypre_ParVectorSetValuesTagged HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorSetValuesTagged ) +#define hypre_ParVectorSetZeros HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorSetZeros ) +#define hypre_ParVectorStridedCopy HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorStridedCopy ) +#define hypre_ParVectorToVectorAll HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorToVectorAll ) +#define hypre_ParVectorToVectorAll_v2 HYPRE_FIXEDPRECISION_FUNC ( hypre_ParVectorToVectorAll_v2 ) +#define hypre_ParcsrBdiagInvScal HYPRE_FIXEDPRECISION_FUNC ( hypre_ParcsrBdiagInvScal ) +#define hypre_ParcsrGetExternalRowsInit HYPRE_FIXEDPRECISION_FUNC ( hypre_ParcsrGetExternalRowsInit ) +#define hypre_ParcsrGetExternalRowsWait HYPRE_FIXEDPRECISION_FUNC ( hypre_ParcsrGetExternalRowsWait ) +#define hypre_ParvecBdiagInvScal HYPRE_FIXEDPRECISION_FUNC ( hypre_ParvecBdiagInvScal ) +#define hypre_PrintCommpkg HYPRE_FIXEDPRECISION_FUNC ( hypre_PrintCommpkg ) +#define hypre_RangeFillResponseIJDetermineRecvProcs HYPRE_FIXEDPRECISION_FUNC ( hypre_RangeFillResponseIJDetermineRecvProcs ) +#define hypre_RowsWithColumn HYPRE_FIXEDPRECISION_FUNC ( hypre_RowsWithColumn ) +#define hypre_RowsWithColumn_original HYPRE_FIXEDPRECISION_FUNC ( hypre_RowsWithColumn_original ) +#define hypre_VectorToParVector HYPRE_FIXEDPRECISION_FUNC ( hypre_VectorToParVector ) +#define hypre_copyparvector HYPRE_FIXEDPRECISION_FUNC ( hypre_copyparvector ) +#define hypre_csrmatrixtoparcsrmatrix HYPRE_FIXEDPRECISION_FUNC ( hypre_csrmatrixtoparcsrmatrix ) +#define hypre_csrmatrixtoparcsrmatrix_withnewpartitioning HYPRE_FIXEDPRECISION_FUNC ( hypre_csrmatrixtoparcsrmatrix_withnewpartitioning ) +#define hypre_paraxpy HYPRE_FIXEDPRECISION_FUNC ( hypre_paraxpy ) +#define hypre_parcsrmatrixcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrmatrixcreate ) +#define hypre_parcsrmatrixdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrmatrixdestroy ) +#define hypre_parcsrmatrixgetcolpartiti HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrmatrixgetcolpartiti ) +#define hypre_parcsrmatrixgetcomm HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrmatrixgetcomm ) +#define hypre_parcsrmatrixgetdims HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrmatrixgetdims ) +#define hypre_parcsrmatrixgetlocalrange HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrmatrixgetlocalrange ) +#define hypre_parcsrmatrixgetrow HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrmatrixgetrow ) +#define hypre_parcsrmatrixgetrowpartiti HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrmatrixgetrowpartiti ) +#define hypre_parcsrmatrixglobalnumrows HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrmatrixglobalnumrows ) +#define hypre_parcsrmatrixinitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrmatrixinitialize ) +#define hypre_parcsrmatrixmatvec HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrmatrixmatvec ) +#define hypre_parcsrmatrixmatvect HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrmatrixmatvect ) +#define hypre_parcsrmatrixprint HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrmatrixprint ) +#define hypre_parcsrmatrixread HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrmatrixread ) +#define hypre_parcsrmatrixrestorerow HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrmatrixrestorerow ) +#define hypre_parcsrmatrixrowstarts HYPRE_FIXEDPRECISION_FUNC ( hypre_parcsrmatrixrowstarts ) +#define hypre_parinnerprod HYPRE_FIXEDPRECISION_FUNC ( hypre_parinnerprod ) +#define hypre_parmultivectorcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_parmultivectorcreate ) +#define hypre_parvectoraxpy HYPRE_FIXEDPRECISION_FUNC ( hypre_parvectoraxpy ) +#define hypre_parvectorcloneshallow HYPRE_FIXEDPRECISION_FUNC ( hypre_parvectorcloneshallow ) +#define hypre_parvectorcopy HYPRE_FIXEDPRECISION_FUNC ( hypre_parvectorcopy ) +#define hypre_parvectorcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_parvectorcreate ) +#define hypre_parvectordestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_parvectordestroy ) +#define hypre_parvectorinitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_parvectorinitialize ) +#define hypre_parvectorinnerprod HYPRE_FIXEDPRECISION_FUNC ( hypre_parvectorinnerprod ) +#define hypre_parvectorprint HYPRE_FIXEDPRECISION_FUNC ( hypre_parvectorprint ) +#define hypre_parvectorread HYPRE_FIXEDPRECISION_FUNC ( hypre_parvectorread ) +#define hypre_parvectorscale HYPRE_FIXEDPRECISION_FUNC ( hypre_parvectorscale ) +#define hypre_parvectorsetconstantvalue HYPRE_FIXEDPRECISION_FUNC ( hypre_parvectorsetconstantvalue ) +#define hypre_parvectorsetrandomvalues HYPRE_FIXEDPRECISION_FUNC ( hypre_parvectorsetrandomvalues ) +#define hypre_parvectortovectorall HYPRE_FIXEDPRECISION_FUNC ( hypre_parvectortovectorall ) +#define hypre_scaleparvector HYPRE_FIXEDPRECISION_FUNC ( hypre_scaleparvector ) +#define hypre_setparvectorconstantvalue HYPRE_FIXEDPRECISION_FUNC ( hypre_setparvectorconstantvalue ) +#define hypre_setparvectordataowner HYPRE_FIXEDPRECISION_FUNC ( hypre_setparvectordataowner ) +#define hypre_setparvectorrandomvalues HYPRE_FIXEDPRECISION_FUNC ( hypre_setparvectorrandomvalues ) +#define hypre_vectortoparvector HYPRE_FIXEDPRECISION_FUNC ( hypre_vectortoparvector ) + +#endif diff --git a/src/parcsr_mv/_hypre_parcsr_mv_mup_undef.h b/src/parcsr_mv/_hypre_parcsr_mv_mup_undef.h new file mode 100644 index 0000000000..52b29bf8d8 --- /dev/null +++ b/src/parcsr_mv/_hypre_parcsr_mv_mup_undef.h @@ -0,0 +1,322 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#undef hypre_PARCSR_MV_MUP_DEF_HEADER + +#undef HYPRE_CSRMatrixToParCSRMatrix +#undef HYPRE_CSRMatrixToParCSRMatrix_WithNewPartitioning +#undef HYPRE_Destroy2DSystem +#undef HYPRE_Generate2DSystem +#undef HYPRE_ParCSRMatrixComputeScalingTagged +#undef HYPRE_ParCSRMatrixCreate +#undef HYPRE_ParCSRMatrixDestroy +#undef HYPRE_ParCSRMatrixDiagScale +#undef HYPRE_ParCSRMatrixGetColPartitioning +#undef HYPRE_ParCSRMatrixGetComm +#undef HYPRE_ParCSRMatrixGetDims +#undef HYPRE_ParCSRMatrixGetGlobalRowPartitioning +#undef HYPRE_ParCSRMatrixGetLocalRange +#undef HYPRE_ParCSRMatrixGetRow +#undef HYPRE_ParCSRMatrixGetRowPartitioning +#undef HYPRE_ParCSRMatrixInitialize +#undef HYPRE_ParCSRMatrixMatmat +#undef HYPRE_ParCSRMatrixMatvec +#undef HYPRE_ParCSRMatrixMatvecT +#undef HYPRE_ParCSRMatrixPrint +#undef HYPRE_ParCSRMatrixRead +#undef HYPRE_ParCSRMatrixRestoreRow +#undef HYPRE_ParMultiVectorCreate +#undef HYPRE_ParVectorAxpy +#undef HYPRE_ParVectorCloneShallow +#undef HYPRE_ParVectorCopy +#undef HYPRE_ParVectorCreate +#undef HYPRE_ParVectorDestroy +#undef HYPRE_ParVectorGetValues +#undef HYPRE_ParVectorInitialize +#undef HYPRE_ParVectorInnerProd +#undef HYPRE_ParVectorPointwiseDivision +#undef HYPRE_ParVectorPointwiseInverse +#undef HYPRE_ParVectorPointwiseProduct +#undef HYPRE_ParVectorPrint +#undef HYPRE_ParVectorPrintBinaryIJ +#undef HYPRE_ParVectorRead +#undef HYPRE_ParVectorScale +#undef HYPRE_ParVectorSetConstantValues +#undef HYPRE_ParVectorSetRandomValues +#undef HYPRE_VectorToParVector +#undef hypre_AssumedPartitionCreate +#undef hypre_AssumedPartitionDestroy +#undef hypre_BooleanGenerateDiagAndOffd +#undef hypre_BooleanMatTCommPkgCreate +#undef hypre_BooleanMatvecCommPkgCreate +#undef hypre_BuildCSRBooleanMatrixMPIDataType +#undef hypre_BuildCSRJDataType +#undef hypre_BuildCSRMatrixMPIDataType +#undef hypre_CSRBooleanMatrixBigInitialize +#undef hypre_CSRBooleanMatrixCreate +#undef hypre_CSRBooleanMatrixDestroy +#undef hypre_CSRBooleanMatrixInitialize +#undef hypre_CSRBooleanMatrixPrint +#undef hypre_CSRBooleanMatrixRead +#undef hypre_CSRBooleanMatrixSetDataOwner +#undef hypre_CSRBooleanMatrixToParCSRBooleanMatrix +#undef hypre_CSRMatrixToParCSRMatrix +#undef hypre_ExchangeExternalRowsInit +#undef hypre_ExchangeExternalRowsWait +#undef hypre_FillResponseIJDetermineSendProcs +#undef hypre_FillResponseParToCSRMatrix +#undef hypre_FillResponseParToVectorAll +#undef hypre_GenerateDiagAndOffd +#undef hypre_GetAssumedPartitionProcFromRow +#undef hypre_GetAssumedPartitionRowRange +#undef hypre_LocateAssumedPartition +#undef hypre_MatTCommPkgCreate +#undef hypre_MatTCommPkgCreate_core +#undef hypre_MatvecCommPkgCreate +#undef hypre_MatvecCommPkgDestroy +#undef hypre_MergeDiagAndOffd +#undef hypre_MergeDiagAndOffdHost +#undef hypre_NewCommPkgDestroy +#undef hypre_NumbersArray +#undef hypre_NumbersDeleteNode +#undef hypre_NumbersEnter +#undef hypre_NumbersNEntered +#undef hypre_NumbersNewNode +#undef hypre_NumbersQuery +#undef hypre_ParAat_RowSizes +#undef hypre_ParBooleanAAt +#undef hypre_ParBooleanMatmul +#undef hypre_ParCSRAAt +#undef hypre_ParCSRBooleanMatrixCreate +#undef hypre_ParCSRBooleanMatrixDestroy +#undef hypre_ParCSRBooleanMatrixExtractAExt +#undef hypre_ParCSRBooleanMatrixExtractBExt +#undef hypre_ParCSRBooleanMatrixGetLocalRange +#undef hypre_ParCSRBooleanMatrixGetRow +#undef hypre_ParCSRBooleanMatrixInitialize +#undef hypre_ParCSRBooleanMatrixPrint +#undef hypre_ParCSRBooleanMatrixPrintIJ +#undef hypre_ParCSRBooleanMatrixRead +#undef hypre_ParCSRBooleanMatrixRestoreRow +#undef hypre_ParCSRBooleanMatrixSetColStartsOwner +#undef hypre_ParCSRBooleanMatrixSetDataOwner +#undef hypre_ParCSRBooleanMatrixSetNNZ +#undef hypre_ParCSRBooleanMatrixSetRowStartsOwner +#undef hypre_ParCSRCommHandleCreate +#undef hypre_ParCSRCommHandleCreate_v2 +#undef hypre_ParCSRCommHandleDestroy +#undef hypre_ParCSRCommPkgCreate +#undef hypre_ParCSRCommPkgCreateAndFill +#undef hypre_ParCSRCommPkgCreateApart +#undef hypre_ParCSRCommPkgCreateApart_core +#undef hypre_ParCSRCommPkgCreate_core +#undef hypre_ParCSRCommPkgUpdateVecStarts +#undef hypre_ParCSRDiagScaleVector +#undef hypre_ParCSRDiagScaleVectorHost +#undef hypre_ParCSRFindExtendCommPkg +#undef hypre_ParCSRMatMat +#undef hypre_ParCSRMatMatDiag +#undef hypre_ParCSRMatMatDiagHost +#undef hypre_ParCSRMatMatHost +#undef hypre_ParCSRMatrixAdd +#undef hypre_ParCSRMatrixAddHost +#undef hypre_ParCSRMatrixAminvDB +#undef hypre_ParCSRMatrixBlkFilter +#undef hypre_ParCSRMatrixBlkFilterHost +#undef hypre_ParCSRMatrixBlockColSum +#undef hypre_ParCSRMatrixBlockColSumHost +#undef hypre_ParCSRMatrixClone +#undef hypre_ParCSRMatrixClone_v2 +#undef hypre_ParCSRMatrixColSum +#undef hypre_ParCSRMatrixColSumHost +#undef hypre_ParCSRMatrixCompressOffdMap +#undef hypre_ParCSRMatrixComputeScalingTagged +#undef hypre_ParCSRMatrixCopy +#undef hypre_ParCSRMatrixCopyColMapOffdToDevice +#undef hypre_ParCSRMatrixCopyColMapOffdToHost +#undef hypre_ParCSRMatrixCopy_C +#undef hypre_ParCSRMatrixCreate +#undef hypre_ParCSRMatrixCreateAssumedPartition +#undef hypre_ParCSRMatrixCreateFromDenseBlockMatrix +#undef hypre_ParCSRMatrixCreateFromParVector +#undef hypre_ParCSRMatrixDestroy +#undef hypre_ParCSRMatrixDiagScale +#undef hypre_ParCSRMatrixDiagScaleHost +#undef hypre_ParCSRMatrixDropSmallEntries +#undef hypre_ParCSRMatrixDropSmallEntriesHost +#undef hypre_ParCSRMatrixEliminateRowsCols +#undef hypre_ParCSRMatrixExtractAExt +#undef hypre_ParCSRMatrixExtractBExt +#undef hypre_ParCSRMatrixExtractBExt_Arrays +#undef hypre_ParCSRMatrixExtractBExt_Arrays_Overlap +#undef hypre_ParCSRMatrixExtractBExt_Overlap +#undef hypre_ParCSRMatrixExtractRowSubmatrices +#undef hypre_ParCSRMatrixExtractSubmatrices +#undef hypre_ParCSRMatrixExtractSubmatrixFC +#undef hypre_ParCSRMatrixFnorm +#undef hypre_ParCSRMatrixGenSpanningTree +#undef hypre_ParCSRMatrixGenerateFFFC +#undef hypre_ParCSRMatrixGenerateFFFC3 +#undef hypre_ParCSRMatrixGenerateFFFCD3 +#undef hypre_ParCSRMatrixGenerateFFFCHost +#undef hypre_ParCSRMatrixGetLocalRange +#undef hypre_ParCSRMatrixGetRow +#undef hypre_ParCSRMatrixGetRowHost +#undef hypre_ParCSRMatrixInfNorm +#undef hypre_ParCSRMatrixInitialize +#undef hypre_ParCSRMatrixInitialize_v2 +#undef hypre_ParCSRMatrixLocalSumElts +#undef hypre_ParCSRMatrixLocalTranspose +#undef hypre_ParCSRMatrixMatvec +#undef hypre_ParCSRMatrixMatvecOutOfPlace +#undef hypre_ParCSRMatrixMatvecOutOfPlaceHost +#undef hypre_ParCSRMatrixMatvecT +#undef hypre_ParCSRMatrixMatvecTHost +#undef hypre_ParCSRMatrixMatvec_FF +#undef hypre_ParCSRMatrixMigrate +#undef hypre_ParCSRMatrixPrint +#undef hypre_ParCSRMatrixPrintBinaryIJ +#undef hypre_ParCSRMatrixPrintIJ +#undef hypre_ParCSRMatrixRAP +#undef hypre_ParCSRMatrixRAPKT +#undef hypre_ParCSRMatrixRAPKTHost +#undef hypre_ParCSRMatrixRead +#undef hypre_ParCSRMatrixReadIJ +#undef hypre_ParCSRMatrixReorder +#undef hypre_ParCSRMatrixRestoreRow +#undef hypre_ParCSRMatrixScale +#undef hypre_ParCSRMatrixSetConstantValues +#undef hypre_ParCSRMatrixSetDNumNonzeros +#undef hypre_ParCSRMatrixSetDataOwner +#undef hypre_ParCSRMatrixSetNumNonzeros +#undef hypre_ParCSRMatrixSetNumNonzeros_core +#undef hypre_ParCSRMatrixSetNumRownnz +#undef hypre_ParCSRMatrixSetPatternOnly +#undef hypre_ParCSRMatrixStatsArrayCompute +#undef hypre_ParCSRMatrixStatsComputePassOneLocal +#undef hypre_ParCSRMatrixStatsComputePassOneLocalHost +#undef hypre_ParCSRMatrixStatsComputePassTwoLocal +#undef hypre_ParCSRMatrixStatsComputePassTwoLocalHost +#undef hypre_ParCSRMatrixToCSRMatrixAll +#undef hypre_ParCSRMatrixToCSRMatrixAll_v2 +#undef hypre_ParCSRMatrixTranspose +#undef hypre_ParCSRMatrixTransposeHost +#undef hypre_ParCSRMatrixTruncate +#undef hypre_ParCSRMatrixUnion +#undef hypre_ParCSRMatrixZero_F +#undef hypre_ParCSRTMatMat +#undef hypre_ParCSRTMatMatKT +#undef hypre_ParCSRTMatMatKTHost +#undef hypre_ParMatMinus_F +#undef hypre_ParMatScaleDiagInv_F +#undef hypre_ParMatmul +#undef hypre_ParMatmul_FC +#undef hypre_ParMatmul_RowSizes +#undef hypre_ParMatmul_RowSizes_Marked +#undef hypre_ParMultiVectorCreate +#undef hypre_ParTMatmul +#undef hypre_ParVectorAxpy +#undef hypre_ParVectorAxpyz +#undef hypre_ParVectorCloneDeep_v2 +#undef hypre_ParVectorCloneShallow +#undef hypre_ParVectorCopy +#undef hypre_ParVectorCreate +#undef hypre_ParVectorCreateAssumedPartition +#undef hypre_ParVectorDestroy +#undef hypre_ParVectorGetValues +#undef hypre_ParVectorGetValues2 +#undef hypre_ParVectorGetValuesHost +#undef hypre_ParVectorInitialize +#undef hypre_ParVectorInitializeShell +#undef hypre_ParVectorInitialize_v2 +#undef hypre_ParVectorInnerProd +#undef hypre_ParVectorInnerProdTagged +#undef hypre_ParVectorLocalSumElts +#undef hypre_ParVectorMassAxpy +#undef hypre_ParVectorMassDotpTwo +#undef hypre_ParVectorMassInnerProd +#undef hypre_ParVectorMigrate +#undef hypre_ParVectorPointwiseDivision +#undef hypre_ParVectorPointwiseDivpy +#undef hypre_ParVectorPointwiseDivpyMarked +#undef hypre_ParVectorPointwiseInverse +#undef hypre_ParVectorPointwiseProduct +#undef hypre_ParVectorPrint +#undef hypre_ParVectorPrintBinaryIJ +#undef hypre_ParVectorPrintIJ +#undef hypre_ParVectorRead +#undef hypre_ParVectorReadIJ +#undef hypre_ParVectorResize +#undef hypre_ParVectorScale +#undef hypre_ParVectorSetComponent +#undef hypre_ParVectorSetConstantValues +#undef hypre_ParVectorSetData +#undef hypre_ParVectorSetDataOwner +#undef hypre_ParVectorSetLocalSize +#undef hypre_ParVectorSetNumTags +#undef hypre_ParVectorSetOwnsTags +#undef hypre_ParVectorSetRandomValues +#undef hypre_ParVectorSetTags +#undef hypre_ParVectorSetValuesTagged +#undef hypre_ParVectorSetZeros +#undef hypre_ParVectorStridedCopy +#undef hypre_ParVectorToVectorAll +#undef hypre_ParVectorToVectorAll_v2 +#undef hypre_ParcsrBdiagInvScal +#undef hypre_ParcsrGetExternalRowsInit +#undef hypre_ParcsrGetExternalRowsWait +#undef hypre_ParvecBdiagInvScal +#undef hypre_PrintCommpkg +#undef hypre_RangeFillResponseIJDetermineRecvProcs +#undef hypre_RowsWithColumn +#undef hypre_RowsWithColumn_original +#undef hypre_VectorToParVector +#undef hypre_copyparvector +#undef hypre_csrmatrixtoparcsrmatrix +#undef hypre_csrmatrixtoparcsrmatrix_withnewpartitioning +#undef hypre_paraxpy +#undef hypre_parcsrmatrixcreate +#undef hypre_parcsrmatrixdestroy +#undef hypre_parcsrmatrixgetcolpartiti +#undef hypre_parcsrmatrixgetcomm +#undef hypre_parcsrmatrixgetdims +#undef hypre_parcsrmatrixgetlocalrange +#undef hypre_parcsrmatrixgetrow +#undef hypre_parcsrmatrixgetrowpartiti +#undef hypre_parcsrmatrixglobalnumrows +#undef hypre_parcsrmatrixinitialize +#undef hypre_parcsrmatrixmatvec +#undef hypre_parcsrmatrixmatvect +#undef hypre_parcsrmatrixprint +#undef hypre_parcsrmatrixread +#undef hypre_parcsrmatrixrestorerow +#undef hypre_parcsrmatrixrowstarts +#undef hypre_parinnerprod +#undef hypre_parmultivectorcreate +#undef hypre_parvectoraxpy +#undef hypre_parvectorcloneshallow +#undef hypre_parvectorcopy +#undef hypre_parvectorcreate +#undef hypre_parvectordestroy +#undef hypre_parvectorinitialize +#undef hypre_parvectorinnerprod +#undef hypre_parvectorprint +#undef hypre_parvectorread +#undef hypre_parvectorscale +#undef hypre_parvectorsetconstantvalue +#undef hypre_parvectorsetrandomvalues +#undef hypre_parvectortovectorall +#undef hypre_scaleparvector +#undef hypre_setparvectorconstantvalue +#undef hypre_setparvectordataowner +#undef hypre_setparvectorrandomvalues +#undef hypre_vectortoparvector diff --git a/src/parcsr_mv/headers b/src/parcsr_mv/headers index dd9a435167..c7e6b97d09 100755 --- a/src/parcsr_mv/headers +++ b/src/parcsr_mv/headers @@ -21,7 +21,11 @@ cat > $INTERNAL_HEADER <<@ #include "HYPRE_parcsr_mv.h" #include "_hypre_utilities.h" #include "_hypre_seq_block_mv.h" -#include "seq_mv.h" +#include "_hypre_seq_mv.h" + +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_parcsr_mv_mup_def.h" +#endif #ifdef __cplusplus extern "C" { @@ -42,6 +46,7 @@ cat numbers.h >> $INTERNAL_HEADER cat par_chord_matrix.h >> $INTERNAL_HEADER cat par_make_system.h >> $INTERNAL_HEADER cat protos.h >> $INTERNAL_HEADER +cat protos_mp.h >> $INTERNAL_HEADER #../utilities/protos [!F]*.c >> $INTERNAL_HEADER @@ -55,6 +60,17 @@ cat >> $INTERNAL_HEADER <<@ } #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_parcsr_mv_mup_undef.h" +#include "_hypre_parcsr_mv_mup.h" +#endif +#endif + #endif @ diff --git a/src/parcsr_mv/mup.fixed b/src/parcsr_mv/mup.fixed new file mode 100644 index 0000000000..6cb8d48548 --- /dev/null +++ b/src/parcsr_mv/mup.fixed @@ -0,0 +1,267 @@ +hypre_AssumedPartitionCreate +hypre_AssumedPartitionDestroy +hypre_BooleanGenerateDiagAndOffd +hypre_BooleanMatTCommPkgCreate +hypre_BooleanMatvecCommPkgCreate +hypre_BuildCSRBooleanMatrixMPIDataType +hypre_BuildCSRJDataType +hypre_BuildCSRMatrixMPIDataType +hypre_CSRBooleanMatrixBigInitialize +hypre_CSRBooleanMatrixCreate +hypre_CSRBooleanMatrixDestroy +hypre_CSRBooleanMatrixInitialize +hypre_CSRBooleanMatrixPrint +hypre_CSRBooleanMatrixRead +hypre_CSRBooleanMatrixSetDataOwner +hypre_CSRBooleanMatrixToParCSRBooleanMatrix +hypre_CSRMatrixToParCSRMatrix +hypre_ExchangeExternalRowsInit +hypre_ExchangeExternalRowsWait +hypre_FillResponseIJDetermineSendProcs +hypre_FillResponseParToCSRMatrix +hypre_FillResponseParToVectorAll +hypre_GenerateDiagAndOffd +hypre_GetAssumedPartitionProcFromRow +hypre_GetAssumedPartitionRowRange +hypre_LocateAssumedPartition +hypre_MatTCommPkgCreate +hypre_MatTCommPkgCreate_core +hypre_MatvecCommPkgCreate +hypre_MatvecCommPkgDestroy +hypre_MergeDiagAndOffd +hypre_MergeDiagAndOffdHost +hypre_NewCommPkgDestroy +hypre_NumbersArray +hypre_NumbersDeleteNode +hypre_NumbersEnter +hypre_NumbersNEntered +hypre_NumbersNewNode +hypre_NumbersQuery +hypre_ParAat_RowSizes +hypre_ParBooleanAAt +hypre_ParBooleanMatmul +hypre_ParCSRAAt +hypre_ParCSRBooleanMatrixCreate +hypre_ParCSRBooleanMatrixDestroy +hypre_ParCSRBooleanMatrixExtractAExt +hypre_ParCSRBooleanMatrixExtractBExt +hypre_ParCSRBooleanMatrixGetLocalRange +hypre_ParCSRBooleanMatrixGetRow +hypre_ParCSRBooleanMatrixInitialize +hypre_ParCSRBooleanMatrixPrint +hypre_ParCSRBooleanMatrixPrintIJ +hypre_ParCSRBooleanMatrixRead +hypre_ParCSRBooleanMatrixRestoreRow +hypre_ParCSRBooleanMatrixSetColStartsOwner +hypre_ParCSRBooleanMatrixSetDataOwner +hypre_ParCSRBooleanMatrixSetNNZ +hypre_ParCSRBooleanMatrixSetRowStartsOwner +hypre_ParCSRCommHandleCreate +hypre_ParCSRCommHandleCreate_v2 +hypre_ParCSRCommHandleDestroy +hypre_ParCSRCommPkgCreate +hypre_ParCSRCommPkgCreateAndFill +hypre_ParCSRCommPkgCreateApart +hypre_ParCSRCommPkgCreateApart_core +hypre_ParCSRCommPkgCreate_core +hypre_ParCSRCommPkgUpdateVecStarts +hypre_ParCSRDiagScaleVector +hypre_ParCSRDiagScaleVectorHost +hypre_ParCSRFindExtendCommPkg +hypre_ParCSRMatMat +hypre_ParCSRMatMatDiag +hypre_ParCSRMatMatDiagHost +hypre_ParCSRMatMatHost +hypre_ParCSRMatrixAdd +hypre_ParCSRMatrixAddHost +hypre_ParCSRMatrixAminvDB +hypre_ParCSRMatrixBlkFilter +hypre_ParCSRMatrixBlkFilterHost +hypre_ParCSRMatrixBlockColSum +hypre_ParCSRMatrixBlockColSumHost +hypre_ParCSRMatrixClone +hypre_ParCSRMatrixClone_v2 +hypre_ParCSRMatrixColSum +hypre_ParCSRMatrixColSumHost +hypre_ParCSRMatrixCompressOffdMap +hypre_ParCSRMatrixComputeScalingTagged +hypre_ParCSRMatrixCopy +hypre_ParCSRMatrixCopyColMapOffdToDevice +hypre_ParCSRMatrixCopyColMapOffdToHost +hypre_ParCSRMatrixCopy_C +hypre_ParCSRMatrixCreate +hypre_ParCSRMatrixCreateAssumedPartition +hypre_ParCSRMatrixCreateFromDenseBlockMatrix +hypre_ParCSRMatrixCreateFromParVector +hypre_ParCSRMatrixDestroy +hypre_ParCSRMatrixDiagScale +hypre_ParCSRMatrixDiagScaleHost +hypre_ParCSRMatrixDropSmallEntries +hypre_ParCSRMatrixDropSmallEntriesHost +hypre_ParCSRMatrixEliminateRowsCols +hypre_ParCSRMatrixExtractAExt +hypre_ParCSRMatrixExtractBExt +hypre_ParCSRMatrixExtractBExt_Arrays +hypre_ParCSRMatrixExtractBExt_Arrays_Overlap +hypre_ParCSRMatrixExtractBExt_Overlap +hypre_ParCSRMatrixExtractRowSubmatrices +hypre_ParCSRMatrixExtractSubmatrices +hypre_ParCSRMatrixExtractSubmatrixFC +hypre_ParCSRMatrixFnorm +hypre_ParCSRMatrixGenSpanningTree +hypre_ParCSRMatrixGenerateFFFC +hypre_ParCSRMatrixGenerateFFFC3 +hypre_ParCSRMatrixGenerateFFFCD3 +hypre_ParCSRMatrixGenerateFFFCHost +hypre_ParCSRMatrixGetLocalRange +hypre_ParCSRMatrixGetRow +hypre_ParCSRMatrixGetRowHost +hypre_ParCSRMatrixInfNorm +hypre_ParCSRMatrixInitialize +hypre_ParCSRMatrixInitialize_v2 +hypre_ParCSRMatrixLocalSumElts +hypre_ParCSRMatrixLocalTranspose +hypre_ParCSRMatrixMatvec +hypre_ParCSRMatrixMatvecOutOfPlace +hypre_ParCSRMatrixMatvecOutOfPlaceHost +hypre_ParCSRMatrixMatvecT +hypre_ParCSRMatrixMatvecTHost +hypre_ParCSRMatrixMatvec_FF +hypre_ParCSRMatrixMigrate +hypre_ParCSRMatrixPrint +hypre_ParCSRMatrixPrintBinaryIJ +hypre_ParCSRMatrixPrintIJ +hypre_ParCSRMatrixRAP +hypre_ParCSRMatrixRAPKT +hypre_ParCSRMatrixRAPKTHost +hypre_ParCSRMatrixRead +hypre_ParCSRMatrixReadIJ +hypre_ParCSRMatrixReorder +hypre_ParCSRMatrixRestoreRow +hypre_ParCSRMatrixScale +hypre_ParCSRMatrixSetConstantValues +hypre_ParCSRMatrixSetDNumNonzeros +hypre_ParCSRMatrixSetDataOwner +hypre_ParCSRMatrixSetNumNonzeros +hypre_ParCSRMatrixSetNumNonzeros_core +hypre_ParCSRMatrixSetNumRownnz +hypre_ParCSRMatrixSetPatternOnly +hypre_ParCSRMatrixStatsArrayCompute +hypre_ParCSRMatrixStatsComputePassOneLocal +hypre_ParCSRMatrixStatsComputePassOneLocalHost +hypre_ParCSRMatrixStatsComputePassTwoLocal +hypre_ParCSRMatrixStatsComputePassTwoLocalHost +hypre_ParCSRMatrixToCSRMatrixAll +hypre_ParCSRMatrixToCSRMatrixAll_v2 +hypre_ParCSRMatrixTranspose +hypre_ParCSRMatrixTransposeHost +hypre_ParCSRMatrixTruncate +hypre_ParCSRMatrixUnion +hypre_ParCSRMatrixZero_F +hypre_ParCSRTMatMat +hypre_ParCSRTMatMatKT +hypre_ParCSRTMatMatKTHost +hypre_ParMatMinus_F +hypre_ParMatScaleDiagInv_F +hypre_ParMatmul +hypre_ParMatmul_FC +hypre_ParMatmul_RowSizes +hypre_ParMatmul_RowSizes_Marked +hypre_ParMultiVectorCreate +hypre_ParTMatmul +hypre_ParVectorAxpy +hypre_ParVectorAxpyz +hypre_ParVectorCloneDeep_v2 +hypre_ParVectorCloneShallow +hypre_ParVectorCopy +hypre_ParVectorCreate +hypre_ParVectorCreateAssumedPartition +hypre_ParVectorDestroy +hypre_ParVectorGetValues +hypre_ParVectorGetValues2 +hypre_ParVectorGetValuesHost +hypre_ParVectorInitialize +hypre_ParVectorInitializeShell +hypre_ParVectorInitialize_v2 +hypre_ParVectorInnerProd +hypre_ParVectorInnerProdTagged +hypre_ParVectorLocalSumElts +hypre_ParVectorMassAxpy +hypre_ParVectorMassDotpTwo +hypre_ParVectorMassInnerProd +hypre_ParVectorMigrate +hypre_ParVectorPointwiseDivision +hypre_ParVectorPointwiseDivpy +hypre_ParVectorPointwiseDivpyMarked +hypre_ParVectorPointwiseInverse +hypre_ParVectorPointwiseProduct +hypre_ParVectorPrint +hypre_ParVectorPrintBinaryIJ +hypre_ParVectorPrintIJ +hypre_ParVectorRead +hypre_ParVectorReadIJ +hypre_ParVectorResize +hypre_ParVectorScale +hypre_ParVectorSetComponent +hypre_ParVectorSetConstantValues +hypre_ParVectorSetData +hypre_ParVectorSetDataOwner +hypre_ParVectorSetLocalSize +hypre_ParVectorSetNumTags +hypre_ParVectorSetOwnsTags +hypre_ParVectorSetRandomValues +hypre_ParVectorSetTags +hypre_ParVectorSetValuesTagged +hypre_ParVectorSetZeros +hypre_ParVectorStridedCopy +hypre_ParVectorToVectorAll +hypre_ParVectorToVectorAll_v2 +hypre_ParcsrBdiagInvScal +hypre_ParcsrGetExternalRowsInit +hypre_ParcsrGetExternalRowsWait +hypre_ParvecBdiagInvScal +hypre_PrintCommpkg +hypre_RangeFillResponseIJDetermineRecvProcs +hypre_RowsWithColumn +hypre_RowsWithColumn_original +hypre_VectorToParVector +hypre_copyparvector +hypre_csrmatrixtoparcsrmatrix +hypre_csrmatrixtoparcsrmatrix_withnewpartitioning +hypre_paraxpy +hypre_parcsrmatrixcreate +hypre_parcsrmatrixdestroy +hypre_parcsrmatrixgetcolpartiti +hypre_parcsrmatrixgetcomm +hypre_parcsrmatrixgetdims +hypre_parcsrmatrixgetlocalrange +hypre_parcsrmatrixgetrow +hypre_parcsrmatrixgetrowpartiti +hypre_parcsrmatrixglobalnumrows +hypre_parcsrmatrixinitialize +hypre_parcsrmatrixmatvec +hypre_parcsrmatrixmatvect +hypre_parcsrmatrixprint +hypre_parcsrmatrixread +hypre_parcsrmatrixrestorerow +hypre_parcsrmatrixrowstarts +hypre_parinnerprod +hypre_parmultivectorcreate +hypre_parvectoraxpy +hypre_parvectorcloneshallow +hypre_parvectorcopy +hypre_parvectorcreate +hypre_parvectordestroy +hypre_parvectorinitialize +hypre_parvectorinnerprod +hypre_parvectorprint +hypre_parvectorread +hypre_parvectorscale +hypre_parvectorsetconstantvalue +hypre_parvectorsetrandomvalues +hypre_parvectortovectorall +hypre_scaleparvector +hypre_setparvectorconstantvalue +hypre_setparvectordataowner +hypre_setparvectorrandomvalues +hypre_vectortoparvector diff --git a/src/parcsr_mv/mup.functions b/src/parcsr_mv/mup.functions new file mode 100644 index 0000000000..26e45e4b67 --- /dev/null +++ b/src/parcsr_mv/mup.functions @@ -0,0 +1,41 @@ +HYPRE_CSRMatrixToParCSRMatrix +HYPRE_CSRMatrixToParCSRMatrix_WithNewPartitioning +HYPRE_Destroy2DSystem +HYPRE_Generate2DSystem +HYPRE_ParCSRMatrixComputeScalingTagged +HYPRE_ParCSRMatrixCreate +HYPRE_ParCSRMatrixDestroy +HYPRE_ParCSRMatrixDiagScale +HYPRE_ParCSRMatrixGetColPartitioning +HYPRE_ParCSRMatrixGetComm +HYPRE_ParCSRMatrixGetDims +HYPRE_ParCSRMatrixGetGlobalRowPartitioning +HYPRE_ParCSRMatrixGetLocalRange +HYPRE_ParCSRMatrixGetRow +HYPRE_ParCSRMatrixGetRowPartitioning +HYPRE_ParCSRMatrixInitialize +HYPRE_ParCSRMatrixMatmat +HYPRE_ParCSRMatrixMatvec +HYPRE_ParCSRMatrixMatvecT +HYPRE_ParCSRMatrixPrint +HYPRE_ParCSRMatrixRead +HYPRE_ParCSRMatrixRestoreRow +HYPRE_ParMultiVectorCreate +HYPRE_ParVectorAxpy +HYPRE_ParVectorCloneShallow +HYPRE_ParVectorCopy +HYPRE_ParVectorCreate +HYPRE_ParVectorDestroy +HYPRE_ParVectorGetValues +HYPRE_ParVectorInitialize +HYPRE_ParVectorInnerProd +HYPRE_ParVectorPointwiseDivision +HYPRE_ParVectorPointwiseInverse +HYPRE_ParVectorPointwiseProduct +HYPRE_ParVectorPrint +HYPRE_ParVectorPrintBinaryIJ +HYPRE_ParVectorRead +HYPRE_ParVectorScale +HYPRE_ParVectorSetConstantValues +HYPRE_ParVectorSetRandomValues +HYPRE_VectorToParVector diff --git a/src/parcsr_mv/mup.methods b/src/parcsr_mv/mup.methods new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/parcsr_mv/mup_code b/src/parcsr_mv/mup_code new file mode 100755 index 0000000000..a64a92274f --- /dev/null +++ b/src/parcsr_mv/mup_code @@ -0,0 +1,7 @@ +#!/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) + +../config/gen_code.sh HYPRE_parcsr_mv.h _hypre_parcsr_mv.h mup diff --git a/src/parcsr_mv/mup_fixed.c b/src/parcsr_mv/mup_fixed.c new file mode 100644 index 0000000000..313ed6c1f8 --- /dev/null +++ b/src/parcsr_mv/mup_fixed.c @@ -0,0 +1,1723 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_parcsr_mv.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_IJAssumedPart * +hypre_AssumedPartitionCreate( MPI_Comm comm, HYPRE_BigInt global_num, HYPRE_BigInt start, HYPRE_BigInt end ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AssumedPartitionCreate)( comm, global_num, start, end ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AssumedPartitionDestroy( hypre_IJAssumedPart *apart ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AssumedPartitionDestroy)( apart ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BooleanGenerateDiagAndOffd( hypre_CSRBooleanMatrix *A, hypre_ParCSRBooleanMatrix *matrix, HYPRE_BigInt first_col_diag, HYPRE_BigInt last_col_diag ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BooleanGenerateDiagAndOffd)( A, matrix, first_col_diag, last_col_diag ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BooleanMatTCommPkgCreate( hypre_ParCSRBooleanMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BooleanMatTCommPkgCreate)( A ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BooleanMatvecCommPkgCreate( hypre_ParCSRBooleanMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BooleanMatvecCommPkgCreate)( A ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BuildCSRBooleanMatrixMPIDataType)( num_nonzeros, num_rows, a_i, a_j, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BuildCSRJDataType)( num_nonzeros, a_data, a_j, csr_jdata_datatype ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BuildCSRMatrixMPIDataType)( num_nonzeros, num_rows, a_data, a_i, a_j, csr_matrix_datatype ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRBooleanMatrixBigInitialize( hypre_CSRBooleanMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRBooleanMatrixBigInitialize)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_CSRBooleanMatrix * +hypre_CSRBooleanMatrixCreate( HYPRE_Int num_rows, HYPRE_Int num_cols, HYPRE_Int num_nonzeros ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRBooleanMatrixCreate)( num_rows, num_cols, num_nonzeros ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRBooleanMatrixDestroy( hypre_CSRBooleanMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRBooleanMatrixDestroy)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRBooleanMatrixInitialize( hypre_CSRBooleanMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRBooleanMatrixInitialize)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRBooleanMatrixPrint( hypre_CSRBooleanMatrix *matrix, const char *file_name ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRBooleanMatrixPrint)( matrix, file_name ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_CSRBooleanMatrix * +hypre_CSRBooleanMatrixRead( const char *file_name ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRBooleanMatrixRead)( file_name ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRBooleanMatrixSetDataOwner( hypre_CSRBooleanMatrix *matrix, HYPRE_Int owns_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRBooleanMatrixSetDataOwner)( matrix, owns_data ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParCSRBooleanMatrix * +hypre_CSRBooleanMatrixToParCSRBooleanMatrix( MPI_Comm comm, hypre_CSRBooleanMatrix *A, HYPRE_BigInt *row_starts, HYPRE_BigInt *col_starts ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRBooleanMatrixToParCSRBooleanMatrix)( comm, A, row_starts, col_starts ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParCSRMatrix * +hypre_CSRMatrixToParCSRMatrix( MPI_Comm comm, hypre_CSRMatrix *A, HYPRE_BigInt *row_starts, HYPRE_BigInt *col_starts ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixToParCSRMatrix)( comm, A, row_starts, col_starts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ExchangeExternalRowsInit( hypre_CSRMatrix *B_ext, hypre_ParCSRCommPkg *comm_pkg_A, void **request_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ExchangeExternalRowsInit)( B_ext, comm_pkg_A, request_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_CSRMatrix* +hypre_ExchangeExternalRowsWait( void *vequest ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ExchangeExternalRowsWait)( vequest ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FillResponseIJDetermineSendProcs)( p_recv_contact_buf, contact_size, contact_proc, ro, comm, p_send_response_buf, response_message_size ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FillResponseParToCSRMatrix)( p_recv_contact_buf, contact_size, contact_proc, ro, comm, p_send_response_buf, response_message_size ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FillResponseParToVectorAll)( p_recv_contact_buf, contact_size, contact_proc, ro, comm, p_send_response_buf, response_message_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GenerateDiagAndOffd( hypre_CSRMatrix *A, hypre_ParCSRMatrix *matrix, HYPRE_BigInt first_col_diag, HYPRE_BigInt last_col_diag ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GenerateDiagAndOffd)( A, matrix, first_col_diag, last_col_diag ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GetAssumedPartitionProcFromRow( MPI_Comm comm, HYPRE_BigInt row, HYPRE_BigInt global_first_row, HYPRE_BigInt global_num_rows, HYPRE_Int *proc_id ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GetAssumedPartitionProcFromRow)( comm, row, global_first_row, global_num_rows, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GetAssumedPartitionRowRange)( comm, proc_id, global_first_row, global_num_rows, row_start, row_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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LocateAssumedPartition)( comm, row_start, row_end, global_first_row, global_num_rows, part, myid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MatTCommPkgCreate( hypre_ParCSRMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MatTCommPkgCreate)( A ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MatTCommPkgCreate_core)( comm, col_map_offd, first_col_diag, col_starts, num_rows_diag, num_cols_diag, num_cols_offd, row_starts, firstColDiag, colMapOffd, mat_i_diag, mat_j_diag, mat_i_offd, mat_j_offd, data, p_num_recvs, p_recv_procs, p_recv_vec_starts, p_num_sends, p_send_procs, p_send_map_starts, p_send_map_elmts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MatvecCommPkgCreate( hypre_ParCSRMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MatvecCommPkgCreate)( A ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MatvecCommPkgDestroy( hypre_ParCSRCommPkg *comm_pkg ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MatvecCommPkgDestroy)( comm_pkg ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_CSRMatrix * +hypre_MergeDiagAndOffd( hypre_ParCSRMatrix *par_matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MergeDiagAndOffd)( par_matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NewCommPkgDestroy( hypre_ParCSRMatrix *parcsr_A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NewCommPkgDestroy)( parcsr_A ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int * +hypre_NumbersArray( hypre_NumbersNode *node ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NumbersArray)( node ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_NumbersDeleteNode( hypre_NumbersNode *node ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NumbersDeleteNode)( node ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NumbersEnter( hypre_NumbersNode *node, const HYPRE_Int n ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NumbersEnter)( node, n ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NumbersNEntered( hypre_NumbersNode *node ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NumbersNEntered)( node ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_NumbersNode * +hypre_NumbersNewNode( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NumbersNewNode)( ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NumbersQuery( hypre_NumbersNode *node, const HYPRE_Int n ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NumbersQuery)( node, n ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParAat_RowSizes)( C_diag_i, C_offd_i, B_marker, A_diag_i, A_diag_j, A_offd_i, A_offd_j, A_col_map_offd, A_ext_i, A_ext_j, A_ext_row_map, C_diag_size, C_offd_size, num_rows_diag_A, num_cols_offd_A, num_rows_A_ext, first_col_diag_A, first_row_index_A ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParCSRBooleanMatrix * +hypre_ParBooleanAAt( hypre_ParCSRBooleanMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParBooleanAAt)( A ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParCSRBooleanMatrix * +hypre_ParBooleanMatmul( hypre_ParCSRBooleanMatrix *A, hypre_ParCSRBooleanMatrix *B ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParBooleanMatmul)( A, B ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParCSRMatrix * +hypre_ParCSRAAt( hypre_ParCSRMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRAAt)( A ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRBooleanMatrixCreate)( comm, global_num_rows, global_num_cols, row_starts, col_starts, num_cols_offd, num_nonzeros_diag, num_nonzeros_offd ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRBooleanMatrixDestroy( hypre_ParCSRBooleanMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRBooleanMatrixDestroy)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_CSRBooleanMatrix * +hypre_ParCSRBooleanMatrixExtractAExt( hypre_ParCSRBooleanMatrix *A, HYPRE_BigInt **pA_ext_row_map ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRBooleanMatrixExtractAExt)( A, pA_ext_row_map ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_CSRBooleanMatrix * +hypre_ParCSRBooleanMatrixExtractBExt( hypre_ParCSRBooleanMatrix *B, hypre_ParCSRBooleanMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRBooleanMatrixExtractBExt)( B, A ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRBooleanMatrixGetLocalRange( hypre_ParCSRBooleanMatrix *matrix, HYPRE_BigInt *row_start, HYPRE_BigInt *row_end, HYPRE_BigInt *col_start, HYPRE_BigInt *col_end ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRBooleanMatrixGetLocalRange)( matrix, row_start, row_end, col_start, col_end ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRBooleanMatrixGetRow( hypre_ParCSRBooleanMatrix *mat, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRBooleanMatrixGetRow)( mat, row, size, col_ind ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRBooleanMatrixInitialize( hypre_ParCSRBooleanMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRBooleanMatrixInitialize)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRBooleanMatrixPrint( hypre_ParCSRBooleanMatrix *matrix, const char *file_name ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRBooleanMatrixPrint)( matrix, file_name ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRBooleanMatrixPrintIJ( hypre_ParCSRBooleanMatrix *matrix, const char *filename ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRBooleanMatrixPrintIJ)( matrix, filename ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParCSRBooleanMatrix * +hypre_ParCSRBooleanMatrixRead( MPI_Comm comm, const char *file_name ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRBooleanMatrixRead)( comm, file_name ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRBooleanMatrixRestoreRow( hypre_ParCSRBooleanMatrix *matrix, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRBooleanMatrixRestoreRow)( matrix, row, size, col_ind ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRBooleanMatrixSetColStartsOwner( hypre_ParCSRBooleanMatrix *matrix, HYPRE_Int owns_col_starts ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRBooleanMatrixSetColStartsOwner)( matrix, owns_col_starts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRBooleanMatrixSetDataOwner( hypre_ParCSRBooleanMatrix *matrix, HYPRE_Int owns_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRBooleanMatrixSetDataOwner)( matrix, owns_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRBooleanMatrixSetNNZ( hypre_ParCSRBooleanMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRBooleanMatrixSetNNZ)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRBooleanMatrixSetRowStartsOwner( hypre_ParCSRBooleanMatrix *matrix, HYPRE_Int owns_row_starts ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRBooleanMatrixSetRowStartsOwner)( matrix, owns_row_starts ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParCSRCommHandle * +hypre_ParCSRCommHandleCreate( HYPRE_Int job, hypre_ParCSRCommPkg *comm_pkg, void *send_data, void *recv_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRCommHandleCreate)( job, comm_pkg, send_data, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRCommHandleCreate_v2)( job, comm_pkg, send_memory_location, send_data_in, recv_memory_location, recv_data_in ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRCommHandleDestroy( hypre_ParCSRCommHandle *comm_handle ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRCommHandleDestroy)( comm_handle ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRCommPkgCreate)( comm, col_map_offd, first_col_diag, col_starts, num_cols_diag, num_cols_offd, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRCommPkgCreateAndFill)( comm, num_recvs, recv_procs, recv_vec_starts, num_sends, send_procs, send_map_starts, send_map_elmts, comm_pkg_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRCommPkgCreateApart)( comm, col_map_off_d, first_col_diag, num_cols_off_d, global_num_cols, apart, comm_pkg ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRCommPkgCreateApart_core)( comm, col_map_off_d, first_col_diag, num_cols_off_d, global_num_cols, p_num_recvs, p_recv_procs, p_recv_vec_starts, p_num_sends, p_send_procs, p_send_map_starts, p_send_map_elements, apart ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRCommPkgCreate_core)( comm, col_map_offd, first_col_diag, col_starts, num_cols_diag, num_cols_offd, p_num_recvs, p_recv_procs, p_recv_vec_starts, p_num_sends, p_send_procs, p_send_map_starts, p_send_map_elmts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRCommPkgUpdateVecStarts( hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int num_components_in, HYPRE_Int vecstride, HYPRE_Int idxstride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRCommPkgUpdateVecStarts)( comm_pkg, num_components_in, vecstride, idxstride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRDiagScaleVector( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_y, hypre_ParVector *par_x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRDiagScaleVector)( par_A, par_y, par_x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRDiagScaleVectorHost( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_y, hypre_ParVector *par_x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRDiagScaleVectorHost)( par_A, par_y, par_x ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRFindExtendCommPkg)( comm, global_num_cols, first_col_diag, num_cols_diag, col_starts, apart, indices_len, indices, extend_comm_pkg ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParCSRMatrix * +hypre_ParCSRMatMat( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatMat)( A, B ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatMatDiag( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, hypre_ParCSRMatrix **C_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatMatDiag)( A, B, C_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParCSRMatrix * +hypre_ParCSRMatMatHost( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatMatHost)( A, B ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixAdd( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, HYPRE_Complex beta, hypre_ParCSRMatrix *B, hypre_ParCSRMatrix **Cout ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixAdd)( alpha, A, beta, B, Cout ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixAddHost( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, HYPRE_Complex beta, hypre_ParCSRMatrix *B, hypre_ParCSRMatrix **Cout ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixAddHost)( alpha, A, beta, B, Cout ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixAminvDB( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, HYPRE_Complex *d, hypre_ParCSRMatrix **C_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixAminvDB)( A, B, d, C_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixBlkFilter( hypre_ParCSRMatrix *A, HYPRE_Int block_size, hypre_ParCSRMatrix **B_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixBlkFilter)( A, block_size, B_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixBlockColSum)( A, row_major, num_rows_block, num_cols_block, B_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParCSRMatrix* +hypre_ParCSRMatrixClone( hypre_ParCSRMatrix *A, HYPRE_Int copy_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixClone)( A, copy_data ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParCSRMatrix* +hypre_ParCSRMatrixClone_v2( hypre_ParCSRMatrix *A, HYPRE_Int copy_data, HYPRE_MemoryLocation memory_location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixClone_v2)( A, copy_data, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixColSum( hypre_ParCSRMatrix *A, hypre_ParVector **B_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixColSum)( A, B_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixCompressOffdMap( hypre_ParCSRMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixCompressOffdMap)( A ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixComputeScalingTagged( hypre_ParCSRMatrix *A, HYPRE_Int type, HYPRE_MemoryLocation memloc_tags, HYPRE_Int num_tags, HYPRE_Int *tags, hypre_ParVector **scaling_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixComputeScalingTagged)( A, type, memloc_tags, num_tags, tags, scaling_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixCopy( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, HYPRE_Int copy_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixCopy)( A, B, copy_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixCopyColMapOffdToDevice( hypre_ParCSRMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixCopyColMapOffdToDevice)( A ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixCopyColMapOffdToHost( hypre_ParCSRMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixCopyColMapOffdToHost)( A ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixCopy_C( hypre_ParCSRMatrix *P, hypre_ParCSRMatrix *C, HYPRE_Int *CF_marker ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixCopy_C)( P, C, CF_marker ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixCreate)( comm, global_num_rows, global_num_cols, row_starts_in, col_starts_in, num_cols_offd, num_nonzeros_diag, num_nonzeros_offd ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixCreateAssumedPartition( hypre_ParCSRMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixCreateAssumedPartition)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixCreateFromDenseBlockMatrix)( comm, global_num_rows, global_num_cols, row_starts, col_starts, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixCreateFromParVector)( b, global_num_rows, global_num_cols, row_starts, col_starts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixDestroy( hypre_ParCSRMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixDestroy)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixDiagScale( hypre_ParCSRMatrix *par_A, hypre_ParVector *par_ld, hypre_ParVector *par_rd ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixDiagScale)( par_A, par_ld, par_rd ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixDropSmallEntries( hypre_ParCSRMatrix *A, HYPRE_Real tol, HYPRE_Int type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixDropSmallEntries)( A, tol, type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixDropSmallEntriesHost( hypre_ParCSRMatrix *A, HYPRE_Real tol, HYPRE_Int type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixDropSmallEntriesHost)( A, tol, type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixEliminateRowsCols( hypre_ParCSRMatrix *A, HYPRE_Int nrows, HYPRE_Int *rows ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixEliminateRowsCols)( A, nrows, rows ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_CSRMatrix * +hypre_ParCSRMatrixExtractAExt( hypre_ParCSRMatrix *A, HYPRE_Int data, HYPRE_BigInt **pA_ext_row_map ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixExtractAExt)( A, data, pA_ext_row_map ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_CSRMatrix * +hypre_ParCSRMatrixExtractBExt( hypre_ParCSRMatrix *B, hypre_ParCSRMatrix *A, HYPRE_Int data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixExtractBExt)( B, A, data ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixExtractBExt_Arrays)( pB_ext_i, pB_ext_j, pB_ext_data, pB_ext_row_map, num_nonzeros, data, find_row_map, comm, comm_pkg, num_cols_B, num_recvs, num_sends, first_col_diag, 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 ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixExtractBExt_Arrays_Overlap)( pB_ext_i, pB_ext_j, pB_ext_data, pB_ext_row_map, num_nonzeros, data, find_row_map, comm, comm_pkg, num_cols_B, num_recvs, num_sends, first_col_diag, 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 ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixExtractBExt_Overlap)( B, A, data, comm_handle_idx, comm_handle_data, CF_marker, CF_marker_offd, skip_fine, skip_same_sign ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_ParCSRMatrixExtractRowSubmatrices( hypre_ParCSRMatrix *A_csr, HYPRE_Int *indices2, hypre_ParCSRMatrix ***submatrices ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixExtractRowSubmatrices)( A_csr, indices2, submatrices ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_ParCSRMatrixExtractSubmatrices( hypre_ParCSRMatrix *A_csr, HYPRE_Int *indices2, hypre_ParCSRMatrix ***submatrices ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixExtractSubmatrices)( A_csr, indices2, submatrices ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixExtractSubmatrixFC)( A, CF_marker, cpts_starts, job, B_ptr, strength_thresh ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +hypre_ParCSRMatrixFnorm( hypre_ParCSRMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixFnorm)( A ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_ParCSRMatrixGenSpanningTree( hypre_ParCSRMatrix *G_csr, HYPRE_Int **indices, HYPRE_Int G_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixGenSpanningTree)( G_csr, indices, G_type ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixGenerateFFFC)( A, CF_marker, cpts_starts, S, A_FC_ptr, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixGenerateFFFC3)( A, CF_marker, cpts_starts, S, A_FC_ptr, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixGenerateFFFCD3)( A, CF_marker, cpts_starts, S, A_FC_ptr, A_FF_ptr, D_lambda_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixGenerateFFFCHost)( A, CF_marker, cpts_starts, S, A_FC_ptr, A_FF_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixGetLocalRange( hypre_ParCSRMatrix *matrix, HYPRE_BigInt *row_start, HYPRE_BigInt *row_end, HYPRE_BigInt *col_start, HYPRE_BigInt *col_end ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixGetLocalRange)( matrix, row_start, row_end, col_start, col_end ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixGetRow( hypre_ParCSRMatrix *mat, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind, HYPRE_Complex **values ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixGetRow)( mat, row, size, col_ind, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixInfNorm( hypre_ParCSRMatrix *A, HYPRE_Real *norm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixInfNorm)( A, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixInitialize( hypre_ParCSRMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixInitialize)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixInitialize_v2( hypre_ParCSRMatrix *matrix, HYPRE_MemoryLocation memory_location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixInitialize_v2)( matrix, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Complex +hypre_ParCSRMatrixLocalSumElts( hypre_ParCSRMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixLocalSumElts)( A ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixLocalTranspose( hypre_ParCSRMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixLocalTranspose)( A ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixMatvec( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, hypre_ParVector *x, HYPRE_Complex beta, hypre_ParVector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixMatvec)( alpha, A, x, beta, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixMatvecOutOfPlace( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, hypre_ParVector *x, HYPRE_Complex beta, hypre_ParVector *b, hypre_ParVector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixMatvecOutOfPlace)( alpha, A, x, beta, b, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixMatvecT( HYPRE_Complex alpha, hypre_ParCSRMatrix *A, hypre_ParVector *x, HYPRE_Complex beta, hypre_ParVector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixMatvecT)( alpha, A, x, beta, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixMatvec_FF)( alpha, A, x, beta, y, CF_marker, fpt ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixMigrate( hypre_ParCSRMatrix *A, HYPRE_MemoryLocation memory_location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixMigrate)( A, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixPrint( hypre_ParCSRMatrix *matrix, const char *file_name ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixPrint)( matrix, file_name ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixPrintBinaryIJ( hypre_ParCSRMatrix *matrix, HYPRE_Int base_i, HYPRE_Int base_j, const char *filename ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixPrintBinaryIJ)( matrix, base_i, base_j, filename ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixPrintIJ( const hypre_ParCSRMatrix *matrix, const HYPRE_Int base_i, const HYPRE_Int base_j, const char *filename ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixPrintIJ)( matrix, base_i, base_j, filename ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParCSRMatrix * +hypre_ParCSRMatrixRAP( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixRAP)( R, A, P ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParCSRMatrix * +hypre_ParCSRMatrixRAPKT( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, HYPRE_Int keep_transpose, HYPRE_Int has_diagonal ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixRAPKT)( R, A, P, keep_transpose, has_diagonal ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParCSRMatrix* +hypre_ParCSRMatrixRAPKTHost( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, HYPRE_Int keep_transpose ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixRAPKTHost)( R, A, P, keep_transpose ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParCSRMatrix * +hypre_ParCSRMatrixRead( MPI_Comm comm, const char *file_name ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixRead)( comm, file_name ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixReadIJ( MPI_Comm comm, const char *filename, HYPRE_Int *base_i_ptr, HYPRE_Int *base_j_ptr, hypre_ParCSRMatrix **matrix_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixReadIJ)( comm, filename, base_i_ptr, base_j_ptr, matrix_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixReorder( hypre_ParCSRMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixReorder)( A ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixRestoreRow( hypre_ParCSRMatrix *matrix, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind, HYPRE_Complex **values ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixRestoreRow)( matrix, row, size, col_ind, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixScale( hypre_ParCSRMatrix *A, HYPRE_Complex scalar ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixScale)( A, scalar ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixSetConstantValues( hypre_ParCSRMatrix *A, HYPRE_Complex value ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixSetConstantValues)( A, value ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixSetDNumNonzeros( hypre_ParCSRMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixSetDNumNonzeros)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixSetDataOwner( hypre_ParCSRMatrix *matrix, HYPRE_Int owns_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixSetDataOwner)( matrix, owns_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixSetNumNonzeros( hypre_ParCSRMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixSetNumNonzeros)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixSetNumRownnz( hypre_ParCSRMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixSetNumRownnz)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixSetPatternOnly( hypre_ParCSRMatrix *matrix, HYPRE_Int pattern_only ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixSetPatternOnly)( matrix, pattern_only ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixStatsArrayCompute( HYPRE_Int num_matrices, hypre_ParCSRMatrix **matrices, hypre_MatrixStatsArray *stats_array ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixStatsArrayCompute)( num_matrices, matrices, stats_array ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_CSRMatrix * +hypre_ParCSRMatrixToCSRMatrixAll( hypre_ParCSRMatrix *par_matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixToCSRMatrixAll)( par_matrix ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_CSRMatrix * +hypre_ParCSRMatrixToCSRMatrixAll_v2( hypre_ParCSRMatrix *par_matrix, HYPRE_MemoryLocation memory_location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixToCSRMatrixAll_v2)( par_matrix, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixTranspose( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **AT_ptr, HYPRE_Int data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixTranspose)( A, AT_ptr, data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixTransposeHost( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix **AT_ptr, HYPRE_Int data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixTransposeHost)( A, AT_ptr, data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixTruncate( hypre_ParCSRMatrix *A, HYPRE_Real tol, HYPRE_Int max_row_elmts, HYPRE_Int rescale, HYPRE_Int nrm_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixTruncate)( A, tol, max_row_elmts, rescale, nrm_type ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParCSRMatrix * +hypre_ParCSRMatrixUnion( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixUnion)( A, B ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixZero_F( hypre_ParCSRMatrix *P, HYPRE_Int *CF_marker ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRMatrixZero_F)( P, CF_marker ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParCSRMatrix * +hypre_ParCSRTMatMat( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRTMatMat)( A, B ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParCSRMatrix * +hypre_ParCSRTMatMatKT( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, HYPRE_Int keep_transpose ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRTMatMatKT)( A, B, keep_transpose ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParCSRMatrix * +hypre_ParCSRTMatMatKTHost( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, HYPRE_Int keep_transpose ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParCSRTMatMatKTHost)( A, B, keep_transpose ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParCSRMatrix * +hypre_ParMatMinus_F( hypre_ParCSRMatrix *P, hypre_ParCSRMatrix *C, HYPRE_Int *CF_marker ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParMatMinus_F)( P, C, CF_marker ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParMatScaleDiagInv_F( hypre_ParCSRMatrix *C, hypre_ParCSRMatrix *A, HYPRE_Complex weight, HYPRE_Int *CF_marker ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParMatScaleDiagInv_F)( C, A, weight, CF_marker ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParCSRMatrix * +hypre_ParMatmul( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParMatmul)( A, B ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParCSRMatrix * +hypre_ParMatmul_FC( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, HYPRE_Int *CF_marker, HYPRE_Int *dof_func, HYPRE_Int *dof_func_offd ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParMatmul_FC)( A, P, CF_marker, dof_func, dof_func_offd ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParMatmul_RowSizes)( memory_location, C_diag_i, C_offd_i, rownnz_A, A_diag_i, A_diag_j, A_offd_i, A_offd_j, B_diag_i, B_diag_j, B_offd_i, B_offd_j, B_ext_diag_i, B_ext_diag_j, B_ext_offd_i, B_ext_offd_j, map_B_to_C, C_diag_size, C_offd_size, num_rownnz_A, num_rows_diag_A, num_cols_offd_A, allsquare, num_cols_diag_B, num_cols_offd_B, num_cols_offd_C ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParMatmul_RowSizes_Marked)( C_diag_i, C_offd_i, B_marker, A_diag_i, A_diag_j, A_offd_i, A_offd_j, B_diag_i, B_diag_j, B_offd_i, B_offd_j, B_ext_diag_i, B_ext_diag_j, B_ext_offd_i, B_ext_offd_j, map_B_to_C, C_diag_size, C_offd_size, num_rows_diag_A, num_cols_offd_A, allsquare, num_cols_diag_B, num_cols_offd_B, num_cols_offd_C, CF_marker, dof_func, dof_func_offd ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParVector * +hypre_ParMultiVectorCreate( MPI_Comm comm, HYPRE_BigInt global_size, HYPRE_BigInt *partitioning, HYPRE_Int num_vectors ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParMultiVectorCreate)( comm, global_size, partitioning, num_vectors ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParCSRMatrix * +hypre_ParTMatmul( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParTMatmul)( A, B ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorAxpy( HYPRE_Complex alpha, hypre_ParVector *x, hypre_ParVector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorAxpy)( alpha, x, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorAxpyz( HYPRE_Complex alpha, hypre_ParVector *x, HYPRE_Complex beta, hypre_ParVector *y, hypre_ParVector *z ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorAxpyz)( alpha, x, beta, y, z ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParVector * +hypre_ParVectorCloneDeep_v2( hypre_ParVector *x, HYPRE_MemoryLocation memory_location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorCloneDeep_v2)( x, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParVector * +hypre_ParVectorCloneShallow( hypre_ParVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorCloneShallow)( x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorCopy( hypre_ParVector *x, hypre_ParVector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorCopy)( x, y ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParVector * +hypre_ParVectorCreate( MPI_Comm comm, HYPRE_BigInt global_size, HYPRE_BigInt *partitioning_in ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorCreate)( comm, global_size, partitioning_in ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorCreateAssumedPartition( hypre_ParVector *vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorCreateAssumedPartition)( vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorDestroy( hypre_ParVector *vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorDestroy)( vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorGetValues( hypre_ParVector *vector, HYPRE_Int num_values, HYPRE_BigInt *indices, HYPRE_Complex *values ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorGetValues)( vector, num_values, indices, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorGetValues2( hypre_ParVector *vector, HYPRE_Int num_values, HYPRE_BigInt *indices, HYPRE_BigInt base, HYPRE_Complex *values ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorGetValues2)( vector, num_values, indices, base, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorGetValuesHost( hypre_ParVector *vector, HYPRE_Int num_values, HYPRE_BigInt *indices, HYPRE_BigInt base, HYPRE_Complex *values ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorGetValuesHost)( vector, num_values, indices, base, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorInitialize( hypre_ParVector *vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorInitialize)( vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorInitializeShell( hypre_ParVector *vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorInitializeShell)( vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorInitialize_v2( hypre_ParVector *vector, HYPRE_MemoryLocation memory_location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorInitialize_v2)( vector, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +hypre_ParVectorInnerProd( hypre_ParVector *x, hypre_ParVector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorInnerProd)( x, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorInnerProdTagged( hypre_ParVector *x, hypre_ParVector *y, HYPRE_Int *num_tags_ptr, HYPRE_Complex **iprod_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorInnerProdTagged)( x, y, num_tags_ptr, iprod_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Complex +hypre_ParVectorLocalSumElts( hypre_ParVector *vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorLocalSumElts)( vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorMassAxpy( HYPRE_Complex *alpha, hypre_ParVector **x, hypre_ParVector *y, HYPRE_Int k, HYPRE_Int unroll ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorMassAxpy)( alpha, x, y, k, unroll ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorMassDotpTwo)( x, y, z, k, unroll, prod_x, prod_y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorMassInnerProd( hypre_ParVector *x, hypre_ParVector **y, HYPRE_Int k, HYPRE_Int unroll, HYPRE_Real *prod ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorMassInnerProd)( x, y, k, unroll, prod ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorMigrate( hypre_ParVector *x, HYPRE_MemoryLocation memory_location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorMigrate)( x, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorPointwiseDivision( hypre_ParVector *x, hypre_ParVector *y, hypre_ParVector **z_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorPointwiseDivision)( x, y, z_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorPointwiseDivpy( hypre_ParVector *x, hypre_ParVector *b, hypre_ParVector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorPointwiseDivpy)( x, b, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorPointwiseDivpyMarked( hypre_ParVector *x, hypre_ParVector *b, hypre_ParVector *y, HYPRE_Int *marker, HYPRE_Int marker_val ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorPointwiseDivpyMarked)( x, b, y, marker, marker_val ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorPointwiseInverse( hypre_ParVector *x, hypre_ParVector **y_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorPointwiseInverse)( x, y_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorPointwiseProduct( hypre_ParVector *x, hypre_ParVector *y, hypre_ParVector **z_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorPointwiseProduct)( x, y, z_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorPrint( hypre_ParVector *vector, const char *file_name ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorPrint)( vector, file_name ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorPrintBinaryIJ( hypre_ParVector *par_vector, const char *filename ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorPrintBinaryIJ)( par_vector, filename ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorPrintIJ( hypre_ParVector *vector, HYPRE_Int base_j, const char *filename ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorPrintIJ)( vector, base_j, filename ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParVector * +hypre_ParVectorRead( MPI_Comm comm, const char *file_name ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorRead)( comm, file_name ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorReadIJ( MPI_Comm comm, const char *filename, HYPRE_Int *base_j_ptr, hypre_ParVector **vector_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorReadIJ)( comm, filename, base_j_ptr, vector_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorResize( hypre_ParVector *vector, HYPRE_Int size, HYPRE_Int num_vectors ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorResize)( vector, size, num_vectors ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorScale( HYPRE_Complex alpha, hypre_ParVector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorScale)( alpha, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorSetComponent( hypre_ParVector *vector, HYPRE_Int component ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorSetComponent)( vector, component ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorSetConstantValues( hypre_ParVector *v, HYPRE_Complex value ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorSetConstantValues)( v, value ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorSetData( hypre_ParVector *vector, HYPRE_Complex *data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorSetData)( vector, data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorSetDataOwner( hypre_ParVector *vector, HYPRE_Int owns_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorSetDataOwner)( vector, owns_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorSetLocalSize( hypre_ParVector *vector, HYPRE_Int local_size ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorSetLocalSize)( vector, local_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorSetNumTags( hypre_ParVector *vector, HYPRE_Int num_tags ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorSetNumTags)( vector, num_tags ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorSetOwnsTags( hypre_ParVector *vector, HYPRE_Int owns_tags ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorSetOwnsTags)( vector, owns_tags ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorSetRandomValues( hypre_ParVector *v, HYPRE_Int seed ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorSetRandomValues)( v, seed ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorSetTags( hypre_ParVector *vector, HYPRE_MemoryLocation memory_location, HYPRE_Int *tags ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorSetTags)( vector, memory_location, tags ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorSetValuesTagged( hypre_ParVector *vector, HYPRE_Complex *values ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorSetValuesTagged)( vector, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorSetZeros( hypre_ParVector *v ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorSetZeros)( v ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorStridedCopy( hypre_ParVector *x, HYPRE_Int istride, HYPRE_Int ostride, HYPRE_Int size, HYPRE_Complex *data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorStridedCopy)( x, istride, ostride, size, data ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_Vector * +hypre_ParVectorToVectorAll( hypre_ParVector *par_v ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorToVectorAll)( par_v ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_Vector * +hypre_ParVectorToVectorAll_v2( hypre_ParVector *par_v, HYPRE_MemoryLocation memory_location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParVectorToVectorAll_v2)( par_v, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParcsrBdiagInvScal( hypre_ParCSRMatrix *A, HYPRE_Int blockSize, hypre_ParCSRMatrix **As ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParcsrBdiagInvScal)( A, blockSize, As ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParcsrGetExternalRowsInit)( A, indices_len, indices, comm_pkg, want_data, request_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_CSRMatrix* +hypre_ParcsrGetExternalRowsWait( void *vrequest ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParcsrGetExternalRowsWait)( vrequest ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParvecBdiagInvScal( hypre_ParVector *b, HYPRE_Int blockSize, hypre_ParVector **bs, hypre_ParCSRMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ParvecBdiagInvScal)( b, blockSize, bs, A ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PrintCommpkg( hypre_ParCSRMatrix *A, const char *file_name ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PrintCommpkg)( A, file_name ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_RangeFillResponseIJDetermineRecvProcs)( p_recv_contact_buf, contact_size, contact_proc, ro, comm, p_send_response_buf, response_message_size ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_RowsWithColumn)( rowmin, rowmax, column, num_rows_diag, firstColDiag, colMapOffd, mat_i_diag, mat_j_diag, mat_i_offd, mat_j_offd ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_RowsWithColumn_original( HYPRE_Int *rowmin, HYPRE_Int *rowmax, HYPRE_BigInt column, hypre_ParCSRMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_RowsWithColumn_original)( rowmin, rowmax, column, A ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_ParVector * +hypre_VectorToParVector( MPI_Comm comm, hypre_Vector *v, HYPRE_BigInt *vec_starts ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_VectorToParVector)( comm, v, vec_starts ); +} + + +#endif + diff --git a/src/parcsr_mv/mup_functions.c b/src/parcsr_mv/mup_functions.c new file mode 100644 index 0000000000..148402effb --- /dev/null +++ b/src/parcsr_mv/mup_functions.c @@ -0,0 +1,361 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_parcsr_mv.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_CSRMatrixToParCSRMatrix( MPI_Comm comm, HYPRE_CSRMatrix A_CSR, HYPRE_BigInt *row_partitioning, HYPRE_BigInt *col_partitioning, HYPRE_ParCSRMatrix *matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_CSRMatrixToParCSRMatrix_pre( precision, comm, A_CSR, row_partitioning, col_partitioning, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CSRMatrixToParCSRMatrix_WithNewPartitioning( MPI_Comm comm, HYPRE_CSRMatrix A_CSR, HYPRE_ParCSRMatrix *matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_CSRMatrixToParCSRMatrix_WithNewPartitioning_pre( precision, comm, A_CSR, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixComputeScalingTagged( HYPRE_ParCSRMatrix A, HYPRE_Int type, HYPRE_MemoryLocation memloc_tags, HYPRE_Int num_tags, HYPRE_Int *tags, HYPRE_ParVector *scaling_ptr ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRMatrixComputeScalingTagged_pre( precision, A, type, memloc_tags, num_tags, tags, scaling_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +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_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRMatrixCreate_pre( precision, comm, global_num_rows, global_num_cols, row_starts, col_starts, num_cols_offd, num_nonzeros_diag, num_nonzeros_offd, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixDestroy( HYPRE_ParCSRMatrix matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRMatrixDestroy_pre( precision, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixDiagScale( HYPRE_ParCSRMatrix A, HYPRE_ParVector left, HYPRE_ParVector right ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRMatrixDiagScale_pre( precision, A, left, right ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixGetColPartitioning( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt **col_partitioning_ptr ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRMatrixGetColPartitioning_pre( precision, matrix, col_partitioning_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixGetComm( HYPRE_ParCSRMatrix matrix, MPI_Comm *comm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRMatrixGetComm_pre( precision, matrix, comm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixGetDims( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt *M, HYPRE_BigInt *N ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRMatrixGetDims_pre( precision, matrix, M, N ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixGetGlobalRowPartitioning( HYPRE_ParCSRMatrix matrix, HYPRE_Int all_procs, HYPRE_BigInt **row_partitioning_ptr ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRMatrixGetGlobalRowPartitioning_pre( precision, matrix, all_procs, row_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_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRMatrixGetLocalRange_pre( precision, matrix, row_start, row_end, col_start, col_end ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixGetRow( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRMatrixGetRow_pre( precision, matrix, row, size, col_ind, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixGetRowPartitioning( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt **row_partitioning_ptr ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRMatrixGetRowPartitioning_pre( precision, matrix, row_partitioning_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixInitialize( HYPRE_ParCSRMatrix matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRMatrixInitialize_pre( precision, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixMatmat( HYPRE_ParCSRMatrix A, HYPRE_ParCSRMatrix B, HYPRE_ParCSRMatrix *C ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRMatrixMatmat_pre( precision, A, B, C ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixMatvec( hypre_long_double alpha, HYPRE_ParCSRMatrix A, HYPRE_ParVector x, hypre_long_double beta, HYPRE_ParVector y ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRMatrixMatvec_pre( precision, alpha, A, x, beta, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixMatvecT( hypre_long_double alpha, HYPRE_ParCSRMatrix A, HYPRE_ParVector x, hypre_long_double beta, HYPRE_ParVector y ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRMatrixMatvecT_pre( precision, alpha, A, x, beta, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixPrint( HYPRE_ParCSRMatrix matrix, const char *file_name ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRMatrixPrint_pre( precision, matrix, file_name ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixRead( MPI_Comm comm, const char *file_name, HYPRE_ParCSRMatrix *matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRMatrixRead_pre( precision, comm, file_name, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixRestoreRow( HYPRE_ParCSRMatrix matrix, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParCSRMatrixRestoreRow_pre( precision, matrix, row, size, col_ind, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParMultiVectorCreate( MPI_Comm comm, HYPRE_BigInt global_size, HYPRE_BigInt *partitioning, HYPRE_Int number_vectors, HYPRE_ParVector *vector ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParMultiVectorCreate_pre( precision, comm, global_size, partitioning, number_vectors, vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParVectorAxpy( hypre_long_double alpha, HYPRE_ParVector x, HYPRE_ParVector y ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParVectorAxpy_pre( precision, alpha, x, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_ParVector +HYPRE_ParVectorCloneShallow( HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParVectorCloneShallow_pre( precision, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParVectorCopy( HYPRE_ParVector x, HYPRE_ParVector y ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParVectorCopy_pre( precision, x, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParVectorCreate( MPI_Comm comm, HYPRE_BigInt global_size, HYPRE_BigInt *partitioning, HYPRE_ParVector *vector ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParVectorCreate_pre( precision, comm, global_size, partitioning, vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParVectorDestroy( HYPRE_ParVector vector ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParVectorDestroy_pre( precision, vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParVectorGetValues( HYPRE_ParVector vector, HYPRE_Int num_values, HYPRE_BigInt *indices, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParVectorGetValues_pre( precision, vector, num_values, indices, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParVectorInitialize( HYPRE_ParVector vector ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParVectorInitialize_pre( precision, vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParVectorInnerProd( HYPRE_ParVector x, HYPRE_ParVector y, void *result ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParVectorInnerProd_pre( precision, x, y, result ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParVectorPrint( HYPRE_ParVector vector, const char *file_name ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParVectorPrint_pre( precision, vector, file_name ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParVectorPrintBinaryIJ( HYPRE_ParVector vector, const char *file_name ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParVectorPrintBinaryIJ_pre( precision, vector, file_name ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParVectorRead( MPI_Comm comm, const char *file_name, HYPRE_ParVector *vector ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParVectorRead_pre( precision, comm, file_name, vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParVectorScale( hypre_long_double value, HYPRE_ParVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParVectorScale_pre( precision, value, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParVectorSetConstantValues( HYPRE_ParVector vector, hypre_long_double value ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParVectorSetConstantValues_pre( precision, vector, value ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParVectorSetRandomValues( HYPRE_ParVector vector, HYPRE_Int seed ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ParVectorSetRandomValues_pre( precision, vector, seed ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_VectorToParVector( MPI_Comm comm, HYPRE_Vector b, HYPRE_BigInt *partitioning, HYPRE_ParVector *vector ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_VectorToParVector_pre( precision, comm, b, partitioning, vector ); +} + + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_Destroy2DSystem( HYPRE_ParCSR_System_Problem *sys_prob ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_Destroy2DSystem_pre( precision, sys_prob ); +} + +/*--------------------------------------------------------------------------*/ + +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, void *M_vals ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_Generate2DSystem_pre( precision, H_L1, H_L2, H_b1, H_b2, H_x1, H_x2, M_vals ); +} + + +#endif + diff --git a/src/parcsr_mv/mup_pre.c b/src/parcsr_mv/mup_pre.c new file mode 100644 index 0000000000..fea9fc819d --- /dev/null +++ b/src/parcsr_mv/mup_pre.c @@ -0,0 +1,703 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_parcsr_mv.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_CSRMatrixToParCSRMatrix_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_CSRMatrix A_CSR, HYPRE_BigInt *row_partitioning, HYPRE_BigInt *col_partitioning, HYPRE_ParCSRMatrix *matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_CSRMatrixToParCSRMatrix_flt( comm, A_CSR, row_partitioning, col_partitioning, matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_CSRMatrixToParCSRMatrix_dbl( comm, A_CSR, row_partitioning, col_partitioning, matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_CSRMatrixToParCSRMatrix_long_dbl( comm, A_CSR, row_partitioning, col_partitioning, matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CSRMatrixToParCSRMatrix_WithNewPartitioning_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_CSRMatrix A_CSR, HYPRE_ParCSRMatrix *matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_CSRMatrixToParCSRMatrix_WithNewPartitioning_flt( comm, A_CSR, matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_CSRMatrixToParCSRMatrix_WithNewPartitioning_dbl( comm, A_CSR, matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_CSRMatrixToParCSRMatrix_WithNewPartitioning_long_dbl( comm, A_CSR, matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixComputeScalingTagged_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix A, HYPRE_Int type, HYPRE_MemoryLocation memloc_tags, HYPRE_Int num_tags, HYPRE_Int *tags, HYPRE_ParVector *scaling_ptr ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRMatrixComputeScalingTagged_flt( A, type, memloc_tags, num_tags, tags, scaling_ptr ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRMatrixComputeScalingTagged_dbl( A, type, memloc_tags, num_tags, tags, scaling_ptr ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRMatrixComputeScalingTagged_long_dbl( A, type, memloc_tags, num_tags, tags, scaling_ptr ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixCreate_pre( HYPRE_Precision precision, 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 ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRMatrixCreate_flt( comm, global_num_rows, global_num_cols, row_starts, col_starts, num_cols_offd, num_nonzeros_diag, num_nonzeros_offd, matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRMatrixCreate_dbl( comm, global_num_rows, global_num_cols, row_starts, col_starts, num_cols_offd, num_nonzeros_diag, num_nonzeros_offd, matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRMatrixCreate_long_dbl( comm, global_num_rows, global_num_cols, row_starts, col_starts, num_cols_offd, num_nonzeros_diag, num_nonzeros_offd, matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixDestroy_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRMatrixDestroy_flt( matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRMatrixDestroy_dbl( matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRMatrixDestroy_long_dbl( matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixDiagScale_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix A, HYPRE_ParVector left, HYPRE_ParVector right ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRMatrixDiagScale_flt( A, left, right ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRMatrixDiagScale_dbl( A, left, right ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRMatrixDiagScale_long_dbl( A, left, right ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixGetColPartitioning_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix matrix, HYPRE_BigInt **col_partitioning_ptr ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRMatrixGetColPartitioning_flt( matrix, col_partitioning_ptr ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRMatrixGetColPartitioning_dbl( matrix, col_partitioning_ptr ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRMatrixGetColPartitioning_long_dbl( matrix, col_partitioning_ptr ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixGetComm_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix matrix, MPI_Comm *comm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRMatrixGetComm_flt( matrix, comm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRMatrixGetComm_dbl( matrix, comm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRMatrixGetComm_long_dbl( matrix, comm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixGetDims_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix matrix, HYPRE_BigInt *M, HYPRE_BigInt *N ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRMatrixGetDims_flt( matrix, M, N ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRMatrixGetDims_dbl( matrix, M, N ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRMatrixGetDims_long_dbl( matrix, M, N ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixGetGlobalRowPartitioning_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix matrix, HYPRE_Int all_procs, HYPRE_BigInt **row_partitioning_ptr ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRMatrixGetGlobalRowPartitioning_flt( matrix, all_procs, row_partitioning_ptr ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRMatrixGetGlobalRowPartitioning_dbl( matrix, all_procs, row_partitioning_ptr ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRMatrixGetGlobalRowPartitioning_long_dbl( matrix, all_procs, row_partitioning_ptr ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixGetLocalRange_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix matrix, HYPRE_BigInt *row_start, HYPRE_BigInt *row_end, HYPRE_BigInt *col_start, HYPRE_BigInt *col_end ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRMatrixGetLocalRange_flt( matrix, row_start, row_end, col_start, col_end ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRMatrixGetLocalRange_dbl( matrix, row_start, row_end, col_start, col_end ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRMatrixGetLocalRange_long_dbl( matrix, row_start, row_end, col_start, col_end ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixGetRow_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix matrix, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRMatrixGetRow_flt( matrix, row, size, col_ind, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRMatrixGetRow_dbl( matrix, row, size, col_ind, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRMatrixGetRow_long_dbl( matrix, row, size, col_ind, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixGetRowPartitioning_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix matrix, HYPRE_BigInt **row_partitioning_ptr ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRMatrixGetRowPartitioning_flt( matrix, row_partitioning_ptr ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRMatrixGetRowPartitioning_dbl( matrix, row_partitioning_ptr ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRMatrixGetRowPartitioning_long_dbl( matrix, row_partitioning_ptr ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixInitialize_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRMatrixInitialize_flt( matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRMatrixInitialize_dbl( matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRMatrixInitialize_long_dbl( matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixMatmat_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix A, HYPRE_ParCSRMatrix B, HYPRE_ParCSRMatrix *C ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRMatrixMatmat_flt( A, B, C ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRMatrixMatmat_dbl( A, B, C ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRMatrixMatmat_long_dbl( A, B, C ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixMatvec_pre( HYPRE_Precision precision, hypre_long_double alpha, HYPRE_ParCSRMatrix A, HYPRE_ParVector x, hypre_long_double beta, HYPRE_ParVector y ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRMatrixMatvec_flt( alpha, A, x, beta, y ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRMatrixMatvec_dbl( alpha, A, x, beta, y ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRMatrixMatvec_long_dbl( alpha, A, x, beta, y ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixMatvecT_pre( HYPRE_Precision precision, hypre_long_double alpha, HYPRE_ParCSRMatrix A, HYPRE_ParVector x, hypre_long_double beta, HYPRE_ParVector y ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRMatrixMatvecT_flt( alpha, A, x, beta, y ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRMatrixMatvecT_dbl( alpha, A, x, beta, y ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRMatrixMatvecT_long_dbl( alpha, A, x, beta, y ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixPrint_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix matrix, const char *file_name ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRMatrixPrint_flt( matrix, file_name ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRMatrixPrint_dbl( matrix, file_name ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRMatrixPrint_long_dbl( matrix, file_name ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixRead_pre( HYPRE_Precision precision, MPI_Comm comm, const char *file_name, HYPRE_ParCSRMatrix *matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRMatrixRead_flt( comm, file_name, matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRMatrixRead_dbl( comm, file_name, matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRMatrixRead_long_dbl( comm, file_name, matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParCSRMatrixRestoreRow_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix matrix, HYPRE_BigInt row, HYPRE_Int *size, HYPRE_BigInt **col_ind, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParCSRMatrixRestoreRow_flt( matrix, row, size, col_ind, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParCSRMatrixRestoreRow_dbl( matrix, row, size, col_ind, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParCSRMatrixRestoreRow_long_dbl( matrix, row, size, col_ind, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParMultiVectorCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_BigInt global_size, HYPRE_BigInt *partitioning, HYPRE_Int number_vectors, HYPRE_ParVector *vector ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParMultiVectorCreate_flt( comm, global_size, partitioning, number_vectors, vector ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParMultiVectorCreate_dbl( comm, global_size, partitioning, number_vectors, vector ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParMultiVectorCreate_long_dbl( comm, global_size, partitioning, number_vectors, vector ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParVectorAxpy_pre( HYPRE_Precision precision, hypre_long_double alpha, HYPRE_ParVector x, HYPRE_ParVector y ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParVectorAxpy_flt( alpha, x, y ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParVectorAxpy_dbl( alpha, x, y ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParVectorAxpy_long_dbl( alpha, x, y ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_ParVector +HYPRE_ParVectorCloneShallow_pre( HYPRE_Precision precision, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParVectorCloneShallow_flt( x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParVectorCloneShallow_dbl( x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParVectorCloneShallow_long_dbl( x ); + default: + { HYPRE_ParVector value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParVectorCopy_pre( HYPRE_Precision precision, HYPRE_ParVector x, HYPRE_ParVector y ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParVectorCopy_flt( x, y ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParVectorCopy_dbl( x, y ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParVectorCopy_long_dbl( x, y ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParVectorCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_BigInt global_size, HYPRE_BigInt *partitioning, HYPRE_ParVector *vector ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParVectorCreate_flt( comm, global_size, partitioning, vector ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParVectorCreate_dbl( comm, global_size, partitioning, vector ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParVectorCreate_long_dbl( comm, global_size, partitioning, vector ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParVectorDestroy_pre( HYPRE_Precision precision, HYPRE_ParVector vector ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParVectorDestroy_flt( vector ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParVectorDestroy_dbl( vector ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParVectorDestroy_long_dbl( vector ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParVectorGetValues_pre( HYPRE_Precision precision, HYPRE_ParVector vector, HYPRE_Int num_values, HYPRE_BigInt *indices, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParVectorGetValues_flt( vector, num_values, indices, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParVectorGetValues_dbl( vector, num_values, indices, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParVectorGetValues_long_dbl( vector, num_values, indices, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParVectorInitialize_pre( HYPRE_Precision precision, HYPRE_ParVector vector ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParVectorInitialize_flt( vector ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParVectorInitialize_dbl( vector ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParVectorInitialize_long_dbl( vector ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParVectorInnerProd_pre( HYPRE_Precision precision, HYPRE_ParVector x, HYPRE_ParVector y, void *result ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParVectorInnerProd_flt( x, y, result ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParVectorInnerProd_dbl( x, y, result ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParVectorInnerProd_long_dbl( x, y, result ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParVectorPrint_pre( HYPRE_Precision precision, HYPRE_ParVector vector, const char *file_name ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParVectorPrint_flt( vector, file_name ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParVectorPrint_dbl( vector, file_name ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParVectorPrint_long_dbl( vector, file_name ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParVectorPrintBinaryIJ_pre( HYPRE_Precision precision, HYPRE_ParVector vector, const char *file_name ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParVectorPrintBinaryIJ_flt( vector, file_name ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParVectorPrintBinaryIJ_dbl( vector, file_name ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParVectorPrintBinaryIJ_long_dbl( vector, file_name ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParVectorRead_pre( HYPRE_Precision precision, MPI_Comm comm, const char *file_name, HYPRE_ParVector *vector ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParVectorRead_flt( comm, file_name, vector ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParVectorRead_dbl( comm, file_name, vector ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParVectorRead_long_dbl( comm, file_name, vector ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParVectorScale_pre( HYPRE_Precision precision, hypre_long_double value, HYPRE_ParVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParVectorScale_flt( value, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParVectorScale_dbl( value, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParVectorScale_long_dbl( value, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParVectorSetConstantValues_pre( HYPRE_Precision precision, HYPRE_ParVector vector, hypre_long_double value ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParVectorSetConstantValues_flt( vector, value ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParVectorSetConstantValues_dbl( vector, value ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParVectorSetConstantValues_long_dbl( vector, value ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ParVectorSetRandomValues_pre( HYPRE_Precision precision, HYPRE_ParVector vector, HYPRE_Int seed ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ParVectorSetRandomValues_flt( vector, seed ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ParVectorSetRandomValues_dbl( vector, seed ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ParVectorSetRandomValues_long_dbl( vector, seed ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_VectorToParVector_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_Vector b, HYPRE_BigInt *partitioning, HYPRE_ParVector *vector ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_VectorToParVector_flt( comm, b, partitioning, vector ); + case HYPRE_REAL_DOUBLE: + return HYPRE_VectorToParVector_dbl( comm, b, partitioning, vector ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_VectorToParVector_long_dbl( comm, b, partitioning, vector ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_Destroy2DSystem_pre( HYPRE_Precision precision, HYPRE_ParCSR_System_Problem *sys_prob ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_Destroy2DSystem_flt( sys_prob ); + case HYPRE_REAL_DOUBLE: + return HYPRE_Destroy2DSystem_dbl( sys_prob ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_Destroy2DSystem_long_dbl( sys_prob ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_ParCSR_System_Problem * +HYPRE_Generate2DSystem_pre( HYPRE_Precision precision, HYPRE_ParCSRMatrix H_L1, HYPRE_ParCSRMatrix H_L2, HYPRE_ParVector H_b1, HYPRE_ParVector H_b2, HYPRE_ParVector H_x1, HYPRE_ParVector H_x2, void *M_vals ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_Generate2DSystem_flt( H_L1, H_L2, H_b1, H_b2, H_x1, H_x2, M_vals ); + case HYPRE_REAL_DOUBLE: + return HYPRE_Generate2DSystem_dbl( H_L1, H_L2, H_b1, H_b2, H_x1, H_x2, M_vals ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_Generate2DSystem_long_dbl( H_L1, H_L2, H_b1, H_b2, H_x1, H_x2, M_vals ); + default: + { HYPRE_ParCSR_System_Problem * value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + + +#endif + diff --git a/src/parcsr_mv/new_commpkg.c b/src/parcsr_mv/new_commpkg.c index f835fa3e91..56e00e601f 100644 --- a/src/parcsr_mv/new_commpkg.c +++ b/src/parcsr_mv/new_commpkg.c @@ -152,6 +152,8 @@ hypre_ParCSRCommPkgCreateApart_core( #endif + HYPRE_ANNOTATE_FUNC_BEGIN; + /*----------------------------------------------------------- * Everyone knows where their assumed range is located * (because of the assumed partition object (apart). @@ -255,11 +257,15 @@ hypre_ParCSRCommPkgCreateApart_core( max_response_size = 6; /* 6 means we can fit 3 ranges*/ + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Exchange_1"); + 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); + HYPRE_ANNOTATE_REGION_END("%s", "Exchange_1"); + /*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. */ @@ -295,7 +301,7 @@ hypre_ParCSRCommPkgCreateApart_core( if (count > 0) { /*add the range if the proc id != myid*/ - tmp_id = response_buf[i * 2]; + tmp_id = (HYPRE_Int) response_buf[i * 2]; if (tmp_id != myid) { if (tmp_id != prev_id) /*increment the number of recvs */ @@ -365,11 +371,16 @@ hypre_ParCSRCommPkgCreateApart_core( max_response_size = 0; + + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Exchange_2"); + 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); + HYPRE_ANNOTATE_REGION_END("%s", "Exchange_2"); + num_sends = send_proc_obj.length; /*send procs are in send_proc_object.id */ @@ -394,9 +405,7 @@ hypre_ParCSRCommPkgCreateApart_core( * the same result as with the standard comm package) * 11/07/05 *-----------------------------------------------------------*/ - { - HYPRE_Int *orig_order; HYPRE_Int *orig_send_map_starts; HYPRE_BigInt *orig_send_elements; @@ -477,7 +486,6 @@ hypre_ParCSRCommPkgCreateApart_core( *p_send_map_elements = tmp_elements; hypre_TFree(send_proc_obj.elements, HYPRE_MEMORY_HOST); send_proc_obj.elements = NULL; - } else { @@ -502,6 +510,8 @@ hypre_ParCSRCommPkgCreateApart_core( recv_procs, recv_vec_starts. These are aliased to the comm package and will be destroyed there */ + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } diff --git a/src/parcsr_mv/par_csr_fffc_device.c b/src/parcsr_mv/par_csr_fffc_device.c index 019d6781b0..3124cf36c1 100644 --- a/src/parcsr_mv/par_csr_fffc_device.c +++ b/src/parcsr_mv/par_csr_fffc_device.c @@ -87,9 +87,9 @@ struct FF_pred /* this predicate selects A^s_{FC} */ template #if (defined(THRUST_VERSION) && THRUST_VERSION < THRUST_VERSION_NOTFN) -struct FC_pred -#else struct FC_pred : public thrust::unary_function +#else +struct FC_pred #endif { HYPRE_Int *row_CF_marker; @@ -631,7 +631,7 @@ hypre_ParCSRMatrixGenerateFFFCDevice_core( hypre_ParCSRMatrix *A, thrust::make_transform_iterator(recv_buf, -_1 - 1) + num_cols_A_offd, offd_mark, col_map_offd_AFF, - thrust::identity() ); + HYPRE_THRUST_IDENTITY(HYPRE_Int) ); hypre_assert(tmp_end_big - col_map_offd_AFF == num_cols_AFF_offd); #endif hypre_TFree(tmp_j, HYPRE_MEMORY_DEVICE); @@ -853,7 +853,7 @@ hypre_ParCSRMatrixGenerateFFFCDevice_core( hypre_ParCSRMatrix *A, recv_buf + num_cols_A_offd, offd_mark, col_map_offd_AFC, - thrust::identity()); + HYPRE_THRUST_IDENTITY(HYPRE_Int)); #endif hypre_assert(tmp_end_big - col_map_offd_AFC == num_cols_AFC_offd); hypre_TFree(tmp_j, HYPRE_MEMORY_DEVICE); @@ -1081,7 +1081,7 @@ hypre_ParCSRMatrixGenerateFFFCDevice_core( hypre_ParCSRMatrix *A, thrust::make_transform_iterator(recv_buf, -_1 - 1) + num_cols_A_offd, offd_mark, col_map_offd_ACF, - thrust::identity()); + HYPRE_THRUST_IDENTITY(HYPRE_Int)); #endif hypre_assert(tmp_end_big - col_map_offd_ACF == num_cols_ACF_offd); hypre_TFree(tmp_j, HYPRE_MEMORY_DEVICE); @@ -1305,7 +1305,7 @@ hypre_ParCSRMatrixGenerateFFFCDevice_core( hypre_ParCSRMatrix *A, recv_buf + num_cols_A_offd, offd_mark, col_map_offd_ACC, - thrust::identity()); + HYPRE_THRUST_IDENTITY(HYPRE_Int)); #endif hypre_assert(tmp_end_big - col_map_offd_ACC == num_cols_ACC_offd); hypre_TFree(tmp_j, HYPRE_MEMORY_DEVICE); @@ -1795,7 +1795,7 @@ hypre_ParCSRMatrixGenerate1DCFDevice( hypre_ParCSRMatrix *A, col_map_offd_A + num_cols_A_offd, offd_mark, col_map_offd_ACX, - thrust::identity()); + HYPRE_THRUST_IDENTITY(HYPRE_Int)); #endif hypre_assert(tmp_end_big - col_map_offd_ACX == num_cols_ACX_offd); hypre_TFree(tmp_j, HYPRE_MEMORY_DEVICE); @@ -1994,7 +1994,7 @@ hypre_ParCSRMatrixGenerate1DCFDevice( hypre_ParCSRMatrix *A, recv_buf + num_cols_A_offd, offd_mark, col_map_offd_AXC, - thrust::identity()); + HYPRE_THRUST_IDENTITY(HYPRE_Int)); #endif hypre_assert(tmp_end_big - col_map_offd_AXC == num_cols_AXC_offd); hypre_TFree(tmp_j, HYPRE_MEMORY_DEVICE); diff --git a/src/parcsr_mv/par_csr_matop.c b/src/parcsr_mv/par_csr_matop.c index 227bb64fc0..25003a759f 100644 --- a/src/parcsr_mv/par_csr_matop.c +++ b/src/parcsr_mv/par_csr_matop.c @@ -4161,7 +4161,6 @@ hypre_ParTMatmul( hypre_ParCSRMatrix *A, if ( hypre_GetExecPolicy2(memory_location_A, memory_location_B) == HYPRE_EXEC_DEVICE ) { hypre_CSRMatrixMoveDiagFirstDevice(hypre_ParCSRMatrixDiag(C)); - hypre_SyncComputeStream(); } #endif @@ -5290,31 +5289,15 @@ hypre_ParCSRMatrixAddHost( HYPRE_Complex alpha, #pragma omp parallel #endif { - HYPRE_Int ii, num_threads; - HYPRE_Int size, rest, ns, ne; + HYPRE_Int ns, ne; HYPRE_Int *marker_diag; HYPRE_Int *marker_offd; - ii = hypre_GetThreadNum(); - num_threads = hypre_NumActiveThreads(); - /*----------------------------------------------------------------------- * Compute C_diag = alpha*A_diag + beta*B_diag *-----------------------------------------------------------------------*/ - 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; - } - else - { - ns = ii * size + rest; - ne = (ii + 1) * size + rest; - } - + hypre_GetSimpleThreadPartition(&ns, &ne, num_rownnz_diag_C); marker_diag = hypre_TAlloc(HYPRE_Int, num_cols_diag_A, HYPRE_MEMORY_HOST); hypre_CSRMatrixAddFirstPass(ns, ne, twspace, marker_diag, NULL, NULL, A_diag, B_diag, @@ -5330,19 +5313,7 @@ hypre_ParCSRMatrixAddHost( HYPRE_Complex alpha, * Compute C_offd = alpha*A_offd + beta*B_offd *-----------------------------------------------------------------------*/ - 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; - } - else - { - ns = ii * size + rest; - ne = (ii + 1) * size + rest; - } - + hypre_GetSimpleThreadPartition(&ns, &ne, num_rownnz_offd_C); marker_offd = hypre_TAlloc(HYPRE_Int, num_cols_offd_C, HYPRE_MEMORY_HOST); hypre_CSRMatrixAddFirstPass(ns, ne, twspace, marker_offd, A2C_offd, B2C_offd, A_offd, B_offd, diff --git a/src/parcsr_mv/par_csr_matop_marked.c b/src/parcsr_mv/par_csr_matop_marked.c index b6c44e701e..6f0974a520 100644 --- a/src/parcsr_mv/par_csr_matop_marked.c +++ b/src/parcsr_mv/par_csr_matop_marked.c @@ -7,11 +7,7 @@ #include "_hypre_parcsr_mv.h" -void hypre_ParCSRMatrixCopy_C( hypre_ParCSRMatrix * P, - hypre_ParCSRMatrix * C, HYPRE_Int * CF_marker ); -void hypre_ParCSRMatrixZero_F( hypre_ParCSRMatrix * P, HYPRE_Int * CF_marker ); - -void hypre_ParMatmul_RowSizes_Marked( +HYPRE_Int 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, @@ -221,6 +217,7 @@ void hypre_ParMatmul_RowSizes_Marked( *C_offd_size = jj_count_offd; /* End of First Pass */ + return hypre_error_flag; } hypre_ParCSRMatrix * hypre_ParMatmul_FC( @@ -789,7 +786,7 @@ hypre_ParCSRMatrix * hypre_ParMatmul_FC( } -void hypre_ParMatScaleDiagInv_F( +HYPRE_Int hypre_ParMatScaleDiagInv_F( hypre_ParCSRMatrix * C, hypre_ParCSRMatrix * A, HYPRE_Complex weight, @@ -875,6 +872,7 @@ void hypre_ParMatScaleDiagInv_F( } } + return hypre_error_flag; } hypre_ParCSRMatrix * hypre_ParMatMinus_F( @@ -1087,33 +1085,37 @@ hypre_ParCSRMatrix * hypre_ParMatMinus_F( jg = Pnew_col_map_offd[j]; Pnew_offd_data[m] = 0; if ( num_cols_offd_C ) + { for ( mc = C_offd_i[i1]; mc < C_offd_i[i1 + 1]; ++mc ) { jC = C_offd_j[mc]; jCg = C_col_map_offd[jC]; if ( jCg == jg ) { Pnew_offd_data[m] -= C_offd_data[mc]; } } + } if ( num_cols_offd_P ) + { for ( mp = P_offd_i[i1]; mp < P_offd_i[i1 + 1]; ++mp ) { jP = P_offd_j[mp]; jPg = P_col_map_offd[jP]; if ( jPg == jg ) { Pnew_offd_data[m] += P_offd_data[mp]; } } + } } } } } - hypre_TFree(Pnew_j2m, HYPRE_MEMORY_HOST); return Pnew; } /* fine (marked <0 ) rows of Pnew set to 0 */ -void hypre_ParCSRMatrixZero_F( hypre_ParCSRMatrix * P, - HYPRE_Int * CF_marker ) +HYPRE_Int +hypre_ParCSRMatrixZero_F( hypre_ParCSRMatrix * P, + HYPRE_Int * CF_marker ) { hypre_CSRMatrix *P_diag = hypre_ParCSRMatrixDiag(P); hypre_CSRMatrix *P_offd = hypre_ParCSRMatrixOffd(P); @@ -1138,6 +1140,7 @@ void hypre_ParCSRMatrixZero_F( hypre_ParCSRMatrix * P, } } if ( num_cols_offd_P ) + { for ( i1 = 0; i1 < num_rows_offd_P; i1++ ) { if ( CF_marker[i1] < 0 ) /* Fine rows only */ @@ -1148,13 +1151,16 @@ void hypre_ParCSRMatrixZero_F( hypre_ParCSRMatrix * P, } } } + } + return hypre_error_flag; } /* coarse (marked >=0) rows of P copied from C Both matrices have the same sizes. */ -void hypre_ParCSRMatrixCopy_C( hypre_ParCSRMatrix * P, - hypre_ParCSRMatrix * C, - HYPRE_Int * CF_marker ) +HYPRE_Int +hypre_ParCSRMatrixCopy_C( hypre_ParCSRMatrix * P, + hypre_ParCSRMatrix * C, + HYPRE_Int * CF_marker ) { hypre_CSRMatrix *C_diag = hypre_ParCSRMatrixDiag(C); hypre_CSRMatrix *C_offd = hypre_ParCSRMatrixOffd(C); @@ -1184,6 +1190,7 @@ void hypre_ParCSRMatrixCopy_C( hypre_ParCSRMatrix * P, } } if ( num_cols_offd_C ) + { for ( i1 = 0; i1 < num_rows_offd_C; i1++ ) { if ( CF_marker[i1] >= 0 ) /* Coarse rows only */ @@ -1194,156 +1201,7 @@ void hypre_ParCSRMatrixCopy_C( hypre_ParCSRMatrix * P, } } } - -} - -/* RDF: Commented out due to issues with complex types and comparisons that - * don't make sense anyway. The function wasn't being used, either. */ -#if 0 - -/* Delete any matrix entry C(i,j) for which the corresponding entry P(i,j) - doesn't exist - but only for "fine" rows C(i)<0 This is done as a purely - local computation - C and P must have the same data distribution (among - processors). */ -void hypre_ParCSRMatrixDropEntries( hypre_ParCSRMatrix * C, - hypre_ParCSRMatrix * P, - HYPRE_Int * CF_marker ) -{ - hypre_CSRMatrix *C_diag = hypre_ParCSRMatrixDiag(C); - hypre_CSRMatrix *C_offd = hypre_ParCSRMatrixOffd(C); - HYPRE_Complex *C_diag_data = hypre_CSRMatrixData(C_diag); - HYPRE_Int *C_diag_i = hypre_CSRMatrixI(C_diag); - HYPRE_Int *C_diag_j = hypre_CSRMatrixJ(C_diag); - HYPRE_Complex *C_offd_data = hypre_CSRMatrixData(C_offd); - HYPRE_Int *C_offd_i = hypre_CSRMatrixI(C_offd); - HYPRE_Int *C_offd_j = hypre_CSRMatrixJ(C_offd); - hypre_CSRMatrix *P_diag = hypre_ParCSRMatrixDiag(P); - hypre_CSRMatrix *P_offd = hypre_ParCSRMatrixOffd(P); - HYPRE_Int *P_diag_i = hypre_CSRMatrixI(P_diag); - HYPRE_Int *P_diag_j = hypre_CSRMatrixJ(P_diag); - HYPRE_Int *P_offd_i = hypre_CSRMatrixI(P_offd); - HYPRE_Int *P_offd_j = hypre_CSRMatrixJ(P_offd); - HYPRE_Int *new_C_diag_i; - HYPRE_Int *new_C_offd_i; - HYPRE_Int num_rows_diag_C = hypre_CSRMatrixNumRows(C_diag); - HYPRE_Int num_rows_offd_C = hypre_CSRMatrixNumCols(C_offd); - HYPRE_Int num_nonzeros_diag = hypre_CSRMatrixNumNonzeros(C_diag); - HYPRE_Int num_nonzeros_offd = hypre_CSRMatrixNumNonzeros(C_offd); - HYPRE_Complex vmax = 0.0; - HYPRE_Complex vmin = 0.0; - HYPRE_Complex v, old_sum, new_sum, scale; - HYPRE_Int i1, m, m1d, m1o, jC, mP, keep; - - /* Repack the i,j,and data arrays of C so as to discard those elements for which - there is no corresponding element in P. - Elements of Coarse rows (CF_marker>=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); - 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 < C_diag_i[i1 + 1]; ++m ) - { - v = C_diag_data[m]; - jC = C_diag_j[m]; - old_sum += v; - /* Do we know anything about the order of P_diag_j? It would be better - not to search through it all here. If we know nothing, some - ordering or index scheme will be needed for efficiency (worth doing - iff this function gets called at all ) (may2006: this function is no - longer called) */ - keep = 0; - for ( mP = P_diag_i[i1]; mP < P_diag_i[i1 + 1]; ++mP ) - { - if ( jC == P_diag_j[m] ) - { - keep = 1; - break; - } - } - 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 */ - --num_nonzeros_diag; - } - } - for ( m = C_offd_i[i1]; m < C_offd_i[i1 + 1]; ++m ) - { - v = C_offd_data[m]; - jC = C_diag_j[m]; - old_sum += v; - keep = 0; - for ( mP = P_offd_i[i1]; mP < P_offd_i[i1 + 1]; ++mP ) - { - if ( jC == P_offd_j[m] ) - { - keep = 1; - break; - } - } - 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 */ - --num_nonzeros_offd; - } - } - - new_C_diag_i[i1 + 1] = m1d; - if ( i1 < num_rows_offd_C ) { new_C_offd_i[i1 + 1] = m1o; } - - /* rescale to keep row sum the same */ - if (new_sum != 0) { scale = old_sum / new_sum; } - else { scale = 1.0; } - for ( m = new_C_diag_i[i1]; m < new_C_diag_i[i1 + 1]; ++m ) - { - C_diag_data[m] *= scale; - } - if ( i1 < num_rows_offd_C ) /* this test fails when there is no offd block */ - for ( m = new_C_offd_i[i1]; m < new_C_offd_i[i1 + 1]; ++m ) - { - C_offd_data[m] *= scale; - } - } - for ( i1 = 1; i1 <= num_rows_diag_C; i1++ ) - { - C_diag_i[i1] = new_C_diag_i[i1]; - if ( i1 < num_rows_offd_C ) { C_offd_i[i1] = new_C_offd_i[i1]; } - } - 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; - /* SetNumNonzeros, SetDNumNonzeros are global, need hypre_MPI_Allreduce. - I suspect, but don't know, that other parts of hypre do not assume that - the correct values have been set. - hypre_ParCSRMatrixSetNumNonzeros( C ); - hypre_ParCSRMatrixSetDNumNonzeros( C );*/ - hypre_ParCSRMatrixNumNonzeros( C ) = 0; - hypre_ParCSRMatrixDNumNonzeros( C ) = 0.0; + return hypre_error_flag; } - -#endif diff --git a/src/parcsr_mv/par_csr_matrix.c b/src/parcsr_mv/par_csr_matrix.c index 2ef0f41ef4..1a3c04cfb8 100644 --- a/src/parcsr_mv/par_csr_matrix.c +++ b/src/parcsr_mv/par_csr_matrix.c @@ -130,6 +130,10 @@ hypre_ParCSRMatrixCreate( MPI_Comm comm, hypre_ParCSRMatrixSocOffdJ(matrix) = NULL; #endif +#if defined(HYPRE_MIXED_PRECISION) + hypre_ParCSRMatrixPrecision(matrix) = HYPRE_OBJECT_PRECISION; +#endif + return matrix; } @@ -3504,7 +3508,7 @@ hypre_ParCSRMatrixSetConstantValues( hypre_ParCSRMatrix *A, * Copies col_map_offd to host memory *--------------------------------------------------------------------------*/ -void +HYPRE_Int hypre_ParCSRMatrixCopyColMapOffdToDevice(hypre_ParCSRMatrix *A) { #if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) @@ -3524,13 +3528,15 @@ hypre_ParCSRMatrixCopyColMapOffdToDevice(hypre_ParCSRMatrix *A) #else HYPRE_UNUSED_VAR(A); #endif + + return hypre_error_flag; } /*-------------------------------------------------------------------------- * Copies col_map_offd to device memory *--------------------------------------------------------------------------*/ -void +HYPRE_Int hypre_ParCSRMatrixCopyColMapOffdToHost(hypre_ParCSRMatrix *A) { #if defined(HYPRE_USING_GPU) @@ -3550,4 +3556,140 @@ hypre_ParCSRMatrixCopyColMapOffdToHost(hypre_ParCSRMatrix *A) #else HYPRE_UNUSED_VAR(A); #endif + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Eliminates specified (local) rows and corresponding columns in the parallel + * matrix A by: + * + * - Zeroing out all nonzero entries in the specified local rows of A + * (both diagonal and off-diagonal blocks), and setting their diagonal + * entries to 1.0. + * - Zeroing out all entries in the columns corresponding to the specified + * rows, including those that appear as off-diagonal columns in other + * MPI ranks. + * + * This can be used to impose essential (Dirichlet) boundary conditions + * in parallel, where the eliminated rows and columns correspond to fixed + * degrees of freedom. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixEliminateRowsCols(hypre_ParCSRMatrix *A, + HYPRE_Int nrows, + HYPRE_Int *rows) +{ + MPI_Comm comm = hypre_ParCSRMatrixComm(A); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + 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 diag_nrows = hypre_CSRMatrixNumRows(A_diag); + HYPRE_Int offd_ncols = hypre_CSRMatrixNumCols(A_offd); + + hypre_ParCSRCommHandle *comm_handle; + hypre_ParCSRCommPkg *comm_pkg; + HYPRE_Int num_sends, *int_buf_data; + HYPRE_Int index, start; + HYPRE_Int i, j, k; + + HYPRE_Int *eliminate_row; + HYPRE_Int *eliminate_col; + + HYPRE_Int nprocs, ncols; + HYPRE_Int *cols; + + hypre_MPI_Comm_size(comm, &nprocs); + + /* take care of the diagonal part (sequential elimination) */ + hypre_CSRMatrixEliminateRowsCols(A_diag, nrows, rows); + + /* Parallel case */ + if (nprocs > 1) + { + /* make sure A has a communication package */ + comm_pkg = hypre_ParCSRMatrixCommPkg(A); + if (!comm_pkg) + { + hypre_MatvecCommPkgCreate(A); + comm_pkg = hypre_ParCSRMatrixCommPkg(A); + } + + /* Eliminate the off-diagonal rows */ + for (i = 0; i < nrows; i++) + { + for (j = A_offd_i[rows[i]]; j < A_offd_i[rows[i] + 1]; j++) + { + A_offd_a[j] = 0.0; + } + } + + eliminate_row = hypre_CTAlloc(HYPRE_Int, diag_nrows, HYPRE_MEMORY_HOST); + eliminate_col = hypre_CTAlloc(HYPRE_Int, offd_ncols, HYPRE_MEMORY_HOST); + + /* which of the local rows are to be eliminated */ + for (i = 0; i < nrows; i++) + { + eliminate_row[rows[i]] = 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, num_sends), + HYPRE_MEMORY_HOST); + 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++) + { + k = hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j); + int_buf_data[index++] = eliminate_row[k]; + } + } + comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, int_buf_data, eliminate_col); + hypre_ParCSRCommHandleDestroy(comm_handle); + + /* set the array cols */ + for (i = 0, ncols = 0; i < offd_ncols; i++) + { + if (eliminate_col[i]) + { + ncols++; + } + } + + cols = hypre_CTAlloc(HYPRE_Int, ncols, HYPRE_MEMORY_HOST); + for (i = 0, ncols = 0; i < offd_ncols; i++) + { + if (eliminate_col[i]) + { + cols[ncols++] = i; + } + } + + /* Free memory */ + hypre_TFree(int_buf_data, HYPRE_MEMORY_HOST); + hypre_TFree(eliminate_row, HYPRE_MEMORY_HOST); + hypre_TFree(eliminate_col, HYPRE_MEMORY_HOST); + + /* eliminate the off-diagonal columns */ + for (i = 0; i < hypre_CSRMatrixNumNonzeros(A_offd); i++) + { + if (hypre_BinarySearch(cols, A_offd_j[i], ncols) != -1) + { + A_offd_a[i] = 0.0; + } + } + + /* Free memory */ + hypre_TFree(cols, HYPRE_MEMORY_HOST); + } + + return hypre_error_flag; } diff --git a/src/parcsr_mv/par_csr_matrix.h b/src/parcsr_mv/par_csr_matrix.h index ddd004c58d..b4b2701fe3 100644 --- a/src/parcsr_mv/par_csr_matrix.h +++ b/src/parcsr_mv/par_csr_matrix.h @@ -83,6 +83,10 @@ typedef struct hypre_ParCSRMatrix_struct HYPRE_Int *soc_offd_j; #endif +#if defined(HYPRE_MIXED_PRECISION) + HYPRE_Precision matrix_precision; +#endif + } hypre_ParCSRMatrix; /*-------------------------------------------------------------------------- @@ -124,6 +128,10 @@ typedef struct hypre_ParCSRMatrix_struct #define hypre_ParCSRMatrixNumRows(matrix) hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(matrix)) #define hypre_ParCSRMatrixNumCols(matrix) hypre_CSRMatrixNumCols(hypre_ParCSRMatrixDiag(matrix)) +#if defined(HYPRE_MIXED_PRECISION) +#define hypre_ParCSRMatrixPrecision(matrix) ((matrix) -> matrix_precision) +#endif + static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_MemoryLocation hypre_ParCSRMatrixMemoryLocation(hypre_ParCSRMatrix *matrix) { diff --git a/src/parcsr_mv/par_csr_matvec_device.c b/src/parcsr_mv/par_csr_matvec_device.c index e25c7bf78d..8c0c3ed8c8 100644 --- a/src/parcsr_mv/par_csr_matvec_device.c +++ b/src/parcsr_mv/par_csr_matvec_device.c @@ -31,6 +31,7 @@ hypre_ParCSRMatrixMatvecOutOfPlaceDevice( HYPRE_Complex alpha, { hypre_GpuProfilingPushRange("Matvec"); + MPI_Comm comm = hypre_ParCSRMatrixComm(A); hypre_ParCSRCommPkg *comm_pkg = hypre_ParCSRMatrixCommPkg(A); hypre_ParCSRCommHandle *comm_handle; HYPRE_Int *d_send_map_elmts; @@ -61,9 +62,11 @@ hypre_ParCSRMatrixMatvecOutOfPlaceDevice( HYPRE_Complex alpha, HYPRE_Complex *x_buf_data; HYPRE_Int sync_stream; + HYPRE_Int num_procs; HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_MPI_Comm_size(comm, &num_procs); hypre_GetSyncCudaCompute(&sync_stream); hypre_SetSyncCudaCompute(0); @@ -223,26 +226,29 @@ hypre_ParCSRMatrixMatvecOutOfPlaceDevice( HYPRE_Complex alpha, #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); + if (num_procs > 1) + { + 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); + /* 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_HALO_EXCHANGE] += hypre_MPI_Wtime(); #endif - /* computation offd part */ - if (num_cols_offd) - { - hypre_CSRMatrixMatvec(alpha, offd, x_tmp, 1.0, y_local); - } + /* 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(); + hypre_profile_times[HYPRE_TIMER_ID_PACK_UNPACK] -= hypre_MPI_Wtime(); #endif + } /*--------------------------------------------------------------------- * Free memory diff --git a/src/parcsr_mv/par_csr_triplemat.c b/src/parcsr_mv/par_csr_triplemat.c index 3a230539e2..7e55401817 100644 --- a/src/parcsr_mv/par_csr_triplemat.c +++ b/src/parcsr_mv/par_csr_triplemat.c @@ -932,16 +932,22 @@ hypre_ParCSRMatrixRAPKTHost( hypre_ParCSRMatrix *R, * * 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 + * + * has_diagonal: enforces the presence of diagonal entries in C_diag + * by adding the identity matrix times zero to C_diag if needed + * (valid only for GPUs). *--------------------------------------------------------------------------*/ hypre_ParCSRMatrix* hypre_ParCSRMatrixRAPKT( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, - HYPRE_Int keep_transpose) + HYPRE_Int keep_transpose, + HYPRE_Int has_diagonal ) { hypre_ParCSRMatrix *C = NULL; + HYPRE_UNUSED_VAR(has_diagonal); HYPRE_ANNOTATE_FUNC_BEGIN; hypre_GpuProfilingPushRange("TripleMat-RAP"); @@ -951,7 +957,7 @@ hypre_ParCSRMatrixRAPKT( hypre_ParCSRMatrix *R, if (exec == HYPRE_EXEC_DEVICE) { - C = hypre_ParCSRMatrixRAPKTDevice(R, A, P, keep_transpose); + C = hypre_ParCSRMatrixRAPKTDevice(R, A, P, keep_transpose, has_diagonal); } else #endif @@ -959,6 +965,10 @@ hypre_ParCSRMatrixRAPKT( hypre_ParCSRMatrix *R, C = hypre_ParCSRMatrixRAPKTHost(R, A, P, keep_transpose); } + /* Generate nonzero rows in the diag and offd matrices */ + hypre_CSRMatrixSetRownnz(hypre_ParCSRMatrixDiag(C)); + hypre_CSRMatrixSetRownnz(hypre_ParCSRMatrixOffd(C)); + hypre_GpuProfilingPopRange(); HYPRE_ANNOTATE_FUNC_END; @@ -969,7 +979,8 @@ hypre_ParCSRMatrixRAPKT( hypre_ParCSRMatrix *R, * hypre_ParCSRMatrixRAP * * Computes "C = R * A * P" and discards the temporary local matrices generated - * in the algorithm (keep_transpose = 0). + * in the algorithm (keep_transpose = 0) while making sure that diagonal + * entries are present for GPU runs. *--------------------------------------------------------------------------*/ hypre_ParCSRMatrix* @@ -977,7 +988,7 @@ hypre_ParCSRMatrixRAP( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P ) { - return hypre_ParCSRMatrixRAPKT(R, A, P, 0); + return hypre_ParCSRMatrixRAPKT(R, A, P, 0, 1); } /*-------------------------------------------------------------------------- diff --git a/src/parcsr_mv/par_csr_triplemat_device.c b/src/parcsr_mv/par_csr_triplemat_device.c index 66ea7b9790..d9544216cd 100644 --- a/src/parcsr_mv/par_csr_triplemat_device.c +++ b/src/parcsr_mv/par_csr_triplemat_device.c @@ -60,7 +60,10 @@ struct RAP_functor } }; -/* C = A * B */ +/*-------------------------------------------------------------------------- + * Computes C = A * B on the device + *--------------------------------------------------------------------------*/ + hypre_ParCSRMatrix* hypre_ParCSRMatMatDevice( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B ) @@ -310,7 +313,10 @@ hypre_ParCSRMatMatDevice( hypre_ParCSRMatrix *A, return C; } -/* C = A^T * B */ +/*-------------------------------------------------------------------------- + * Computes C = A^T * B on the device + *--------------------------------------------------------------------------*/ + hypre_ParCSRMatrix* hypre_ParCSRTMatMatKTDevice( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B, @@ -614,23 +620,30 @@ hypre_ParCSRTMatMatKTDevice( hypre_ParCSRMatrix *A, return C; } -/* C = R^{T} * A * P */ +/*-------------------------------------------------------------------------- + * Computes C = R^{T} * A * P on the device. + * + * See hypre_ParCSRMatrixRAPKT for notes about the input arguments. + *--------------------------------------------------------------------------*/ + hypre_ParCSRMatrix* hypre_ParCSRMatrixRAPKTDevice( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, - HYPRE_Int keep_transpose ) + HYPRE_Int keep_transpose, + HYPRE_Int has_diagonal ) { 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_diag, *C_diag_new; hypre_CSRMatrix *C_offd; + hypre_CSRMatrix *zero; + HYPRE_Int num_cols_offd_C = 0; HYPRE_BigInt *col_map_offd_C = NULL; - HYPRE_Int num_procs; hypre_MPI_Comm_size(comm, &num_procs); @@ -651,6 +664,8 @@ hypre_ParCSRMatrixRAPKTDevice( hypre_ParCSRMatrix *R, return NULL; } + hypre_GpuProfilingPushRange("ParCSRMatrixRAPKT"); + if (num_procs > 1) { void *request; @@ -862,29 +877,36 @@ hypre_ParCSRMatrixRAPKTDevice( hypre_ParCSRMatrix *R, 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)) + if (has_diagonal) { - hypre_CSRMatrix *zero = hypre_CSRMatrixIdentityDevice(hypre_CSRMatrixNumRows(C_diag), 0.0); + /* Ensure that the diagonal entries exist in the matrix structure + (even if numerically zero) */ + if (hypre_CSRMatrixCheckForMissingDiagonal(C_diag)) + { + zero = hypre_CSRMatrixIdentityDevice(hypre_CSRMatrixNumRows(C_diag), 0.0); + C_diag_new = hypre_CSRMatrixAddDevice(1.0, C_diag, 1.0, zero); - hypre_CSRMatrix *C_diag_new = hypre_CSRMatrixAddDevice(1.0, C_diag, 1.0, zero); + hypre_CSRMatrixDestroy(C_diag); + hypre_CSRMatrixDestroy(zero); - hypre_CSRMatrixDestroy(C_diag); - hypre_CSRMatrixDestroy(zero); + hypre_ParCSRMatrixDiag(C) = C_diag_new; + } - 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))); } - /* Move the diagonal entry to the first of each row */ - hypre_CSRMatrixMoveDiagFirstDevice(hypre_ParCSRMatrixDiag(C)); - - hypre_assert(!hypre_CSRMatrixCheckDiagFirstDevice(hypre_ParCSRMatrixDiag(C))); - hypre_SyncComputeStream(); + hypre_GpuProfilingPopRange(); + return C; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_ParCSRTMatMatPartialAddDevice( hypre_ParCSRCommPkg *comm_pkg, HYPRE_Int num_rows, @@ -913,7 +935,8 @@ hypre_ParCSRTMatMatPartialAddDevice( hypre_ParCSRCommPkg *comm_pkg, hypre_CSRMatrix *Cz; // local part of Cbar - hypre_CSRMatrix *Cbar_local = hypre_CSRMatrixCreate(num_rows, hypre_CSRMatrixNumCols(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); diff --git a/src/parcsr_mv/par_vector.c b/src/parcsr_mv/par_vector.c index 36e74fed17..f3255f2a5f 100644 --- a/src/parcsr_mv/par_vector.c +++ b/src/parcsr_mv/par_vector.c @@ -68,6 +68,10 @@ hypre_ParVectorCreate( MPI_Comm comm, hypre_ParVectorOwnsData(vector) = 1; hypre_ParVectorActualLocalSize(vector) = 0; +#if defined(HYPRE_MIXED_PRECISION) + hypre_ParVectorPrecision(vector) = HYPRE_OBJECT_PRECISION; +#endif + return vector; } diff --git a/src/parcsr_mv/par_vector.h b/src/parcsr_mv/par_vector.h index 78dc581930..945a0c1283 100644 --- a/src/parcsr_mv/par_vector.h +++ b/src/parcsr_mv/par_vector.h @@ -42,6 +42,9 @@ typedef struct hypre_ParVector_struct hypre_IJAssumedPart *assumed_partition; /* only populated if this partition needed (for setting off-proc elements, for example)*/ +#if defined(HYPRE_MIXED_PRECISION) + HYPRE_Precision vector_precision; +#endif } hypre_ParVector; /*-------------------------------------------------------------------------- @@ -69,6 +72,10 @@ typedef struct hypre_ParVector_struct #define hypre_ParVectorAssumedPartition(vector) ((vector) -> assumed_partition) +#if defined(HYPRE_MIXED_PRECISION) +#define hypre_ParVectorPrecision(vector) ((vector) -> vector_precision) +#endif + static inline HYPRE_MAYBE_UNUSED_FUNC HYPRE_MemoryLocation hypre_ParVectorMemoryLocation(hypre_ParVector *vector) { diff --git a/src/parcsr_mv/parcsr_mv_mp.c b/src/parcsr_mv/parcsr_mv_mp.c new file mode 100644 index 0000000000..812d002630 --- /dev/null +++ b/src/parcsr_mv/parcsr_mv_mp.c @@ -0,0 +1,84 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 seq_mv mixed-precision interface + * + *****************************************************************************/ + +#include "_hypre_parcsr_mv.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * + * Member functions for hypre_ParVector class. + * + *****************************************************************************/ + +/*-------------------------------------------------------------------------- + * Mixed-precision hypre_ParVectorCopy + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorCopy_mp( hypre_ParVector *x, + hypre_ParVector *y ) +{ + hypre_Vector *x_local = hypre_ParVectorLocalVector(x); + hypre_Vector *y_local = hypre_ParVectorLocalVector(y); + return hypre_SeqVectorCopy_mp(x_local, y_local); +} + +/*-------------------------------------------------------------------------- + * Mixed-Precision hypre_ParVectorAxpy + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorAxpy_mp( hypre_double alpha, + hypre_ParVector *x, + hypre_ParVector *y ) +{ + hypre_Vector *x_local = hypre_ParVectorLocalVector(x); + hypre_Vector *y_local = hypre_ParVectorLocalVector(y); + + return hypre_SeqVectorAxpy_mp( alpha, x_local, y_local); +} + +/*-------------------------------------------------------------------------- + * Mixed-Precision Vector conversion + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParVectorConvert_mp( hypre_ParVector *v, + HYPRE_Precision new_precision) +{ + hypre_Vector *v_local = hypre_ParVectorLocalVector(v); + hypre_SeqVectorConvert_mp (v_local, new_precision); + hypre_VectorPrecision(v) = new_precision; + return (hypre_error_flag); +} +/*-------------------------------------------------------------------------- + * Mixed-Precision hypre_ParVectorAxpy + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ParCSRMatrixConvert_mp( hypre_ParCSRMatrix *A, + HYPRE_Precision new_precision) +{ + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(A); + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(A); + + hypre_CSRMatrixConvert_mp (A_diag, new_precision); + hypre_CSRMatrixConvert_mp (A_offd, new_precision); + + hypre_ParCSRMatrixPrecision(A) = new_precision; + + return (hypre_error_flag); +} + +#endif diff --git a/src/parcsr_mv/protos.h b/src/parcsr_mv/protos.h index b9e2b36541..ce66c05356 100644 --- a/src/parcsr_mv/protos.h +++ b/src/parcsr_mv/protos.h @@ -36,99 +36,31 @@ 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_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_ParCSRMatrixDiagScale ( HYPRE_ParCSRMatrix A, HYPRE_ParVector left, - HYPRE_ParVector right ); -HYPRE_Int HYPRE_ParCSRMatrixComputeScalingTagged ( HYPRE_ParCSRMatrix A, HYPRE_Int type, - HYPRE_MemoryLocation memloc_tags, HYPRE_Int num_tags, - HYPRE_Int *tags, HYPRE_ParVector *scaling_ptr ); - -/* 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_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_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_ParVectorPointwiseDivision ( HYPRE_ParVector x, HYPRE_ParVector y, - HYPRE_ParVector *z_ptr ); -HYPRE_Int HYPRE_ParVectorPointwiseProduct ( HYPRE_ParVector x, HYPRE_ParVector y, - HYPRE_ParVector *z_ptr ); -HYPRE_Int HYPRE_ParVectorPointwiseInverse ( HYPRE_ParVector x, HYPRE_ParVector *y_ptr ); -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_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_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_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_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_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_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_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 ) ; + hypre_ParCSRMatrix **AXC_ptr ); /* new_commpkg.c */ HYPRE_Int hypre_PrintCommpkg ( hypre_ParCSRMatrix *A, const char *file_name ); @@ -443,31 +375,29 @@ 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_Int 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_Int 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 hypre_ParCSRMatrixZero_F ( hypre_ParCSRMatrix *P, HYPRE_Int *CF_marker ); +HYPRE_Int hypre_ParCSRMatrixCopy_C ( hypre_ParCSRMatrix *P, hypre_ParCSRMatrix *C, HYPRE_Int *CF_marker ); /* par_csr_matrix.c */ @@ -516,7 +446,6 @@ hypre_ParCSRMatrix *hypre_CSRMatrixToParCSRMatrix ( MPI_Comm comm, hypre_CSRMatr HYPRE_BigInt *row_starts, HYPRE_BigInt *col_starts ); HYPRE_Int hypre_GenerateDiagAndOffd ( hypre_CSRMatrix *A, hypre_ParCSRMatrix *matrix, HYPRE_BigInt first_col_diag, HYPRE_BigInt last_col_diag ); -#define GenerateDiagAndOffd hypre_GenerateDiagAndOffd // TODO (VPM): remove this macro in the next release hypre_CSRMatrix *hypre_MergeDiagAndOffd ( hypre_ParCSRMatrix *par_matrix ); hypre_CSRMatrix *hypre_MergeDiagAndOffdDevice ( hypre_ParCSRMatrix *par_matrix ); hypre_CSRMatrix *hypre_ParCSRMatrixToCSRMatrixAll ( hypre_ParCSRMatrix *par_matrix ); @@ -537,8 +466,10 @@ HYPRE_Int hypre_ParCSRMatrixTruncate(hypre_ParCSRMatrix *A, HYPRE_Real tol, 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); +HYPRE_Int hypre_ParCSRMatrixCopyColMapOffdToDevice(hypre_ParCSRMatrix *A); +HYPRE_Int hypre_ParCSRMatrixCopyColMapOffdToHost(hypre_ParCSRMatrix *A); +HYPRE_Int hypre_ParCSRMatrixEliminateRowsCols(hypre_ParCSRMatrix *A, + HYPRE_Int nrows, HYPRE_Int *rows); /* par_csr_matrix_stats.c */ HYPRE_Int hypre_ParCSRMatrixStatsArrayCompute( HYPRE_Int num_matrices, @@ -591,17 +522,19 @@ hypre_ParCSRMatrix *hypre_ParCSRTMatMatKTDevice( hypre_ParCSRMatrix *A, hypre_P 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_ParCSRTMatMat( hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *B); +hypre_ParCSRMatrix *hypre_ParCSRMatrixRAPKT( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, + hypre_ParCSRMatrix *P, HYPRE_Int keep_transpose, + HYPRE_Int has_diagonal ); hypre_ParCSRMatrix *hypre_ParCSRMatrixRAP( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, - hypre_ParCSRMatrix *P ); + hypre_ParCSRMatrix *P ); hypre_ParCSRMatrix* hypre_ParCSRMatrixRAPKTDevice( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, - hypre_ParCSRMatrix *P, HYPRE_Int keep_transpose ); + hypre_ParCSRMatrix *P, HYPRE_Int keep_transpose, + HYPRE_Int has_diagonal ); hypre_ParCSRMatrix* hypre_ParCSRMatrixRAPKTHost( hypre_ParCSRMatrix *R, hypre_ParCSRMatrix *A, hypre_ParCSRMatrix *P, HYPRE_Int keep_transpose ); -/* par_make_system.c */ +/* par_make_system.c RDF: Why are external functions here? */ 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 ); @@ -688,3 +621,6 @@ HYPRE_Int hypre_ParVectorPointwiseInverse( hypre_ParVector *x, hypre_ParVector * HYPRE_Int hypre_ParVectorGetValuesDevice(hypre_ParVector *vector, HYPRE_Int num_values, HYPRE_BigInt *indices, HYPRE_BigInt base, HYPRE_Complex *values); +/* HYPRE_parcsr_vector.c */ +HYPRE_Int hypre_ParVectorStridedCopy( hypre_ParVector *x, HYPRE_Int istride, HYPRE_Int ostride, + HYPRE_Int size, HYPRE_Complex *data ); diff --git a/src/parcsr_mv/protos_mp.h b/src/parcsr_mv/protos_mp.h new file mode 100644 index 0000000000..bc96be26ce --- /dev/null +++ b/src/parcsr_mv/protos_mp.h @@ -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) + ******************************************************************************/ + +/* Mixed precision function protos */ +/* parcsr_mv_mp.c */ + +#ifdef HYPRE_MIXED_PRECISION +HYPRE_Int +hypre_ParVectorCopy_mp( hypre_ParVector *x, + hypre_ParVector *y ); + +HYPRE_Int +hypre_ParVectorAxpy_mp( hypre_double alpha, + hypre_ParVector *x, + hypre_ParVector *y ); + +HYPRE_Int +hypre_ParVectorConvert_mp ( hypre_ParVector *v, + HYPRE_Precision new_precision ); + +HYPRE_Int +hypre_ParCSRMatrixConvert_mp ( hypre_ParCSRMatrix *A, + HYPRE_Precision new_precision ); + +#endif diff --git a/src/seq_block_mv/CMakeLists.txt b/src/seq_block_mv/CMakeLists.txt index 59fbccf7bb..445be4e853 100644 --- a/src/seq_block_mv/CMakeLists.txt +++ b/src/seq_block_mv/CMakeLists.txt @@ -7,15 +7,27 @@ set(HDRS _hypre_seq_block_mv.h ) -set(SRCS +# Add MUP headers when mixed precision is enabled +if(HYPRE_ENABLE_MIXED_PRECISION) + list(APPEND HDRS + _hypre_seq_block_mv_mup.h + _hypre_seq_block_mv_mup_def.h + _hypre_seq_block_mv_mup_undef.h + ) +endif() + +# Regular sources +set(REGULAR_SRCS dense_block_matrix.c dense_block_matmult.c ) -target_sources(${PROJECT_NAME} - PRIVATE ${SRCS} - ${HDRS} -) +if(HYPRE_ENABLE_MIXED_PRECISION) + setup_mixed_precision_compilation("seq_block_mv" SRCS "${REGULAR_SRCS}") + target_sources(${PROJECT_NAME} PRIVATE ${HDRS}) +else() + target_sources(${PROJECT_NAME} PRIVATE ${REGULAR_SRCS} ${HDRS}) +endif() # if (HYPRE_USING_GPU) # set(GPU_SRCS diff --git a/src/seq_block_mv/Makefile b/src/seq_block_mv/Makefile index 0ec88cf5c2..ae5729c5a9 100644 --- a/src/seq_block_mv/Makefile +++ b/src/seq_block_mv/Makefile @@ -24,11 +24,28 @@ FILES =\ # CUFILES =\ +# Mixed precision files +MP_FILES = \ + mup_fixed.c\ + mup_functions.c\ + mup_pre.c + COBJS = ${FILES:.c=.o} #CUOBJS = ${CUFILES:.c=.obj} #OBJS = ${COBJS} ${CUOBJS} OBJS = ${COBJS} +ifeq (${MP_BUILD}, 1) + +COBJS_single = ${FILES:.c=.o_flt} +COBJS_double = ${FILES:.c=.o_dbl} +COBJS_longdouble = ${FILES:.c=.o_ldbl} +MP_COBJS = ${MP_FILES:.c=.o} + +OBJS = ${COBJS_single} ${COBJS_double} ${COBJS_longdouble} ${MP_COBJS} + +endif + SONAME = libHYPRE_seq_block_mv-${HYPRE_RELEASE_VERSION}${HYPRE_LIB_SUFFIX} ################################################################## @@ -39,13 +56,14 @@ all: $(MAKE) lib lib: libHYPRE_seq_block_mv${HYPRE_LIB_SUFFIX} - cp -fR $(srcdir)/_hypre_seq_block_mv.h $(HYPRE_BUILD_DIR)/include + cp -fR $(srcdir)/_hypre_*.h $(HYPRE_BUILD_DIR)/include install: libHYPRE_seq_block_mv${HYPRE_LIB_SUFFIX} - cp -fR $(srcdir)/_hypre_seq_block_mv.h $(HYPRE_INC_INSTALL) + cp -fR $(srcdir)/_hypre_*.h $(HYPRE_INC_INSTALL) clean: rm -f *.o *.obj libHYPRE* + rm -f *.o_flt *.o_dbl *.o_ldbl distclean: clean diff --git a/src/seq_block_mv/_hypre_seq_block_mv.h b/src/seq_block_mv/_hypre_seq_block_mv.h index 129c54dfc9..84f9b8eb77 100644 --- a/src/seq_block_mv/_hypre_seq_block_mv.h +++ b/src/seq_block_mv/_hypre_seq_block_mv.h @@ -11,7 +11,11 @@ #define hypre_SEQ_BLOCK_MV_HEADER #include -#include "seq_mv.h" +#include "_hypre_seq_mv.h" + +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_seq_block_mv_mup_def.h" +#endif #ifdef __cplusplus extern "C" { @@ -50,6 +54,10 @@ typedef struct hypre_DenseBlockMatrix_struct HYPRE_Complex *data; /* Matrix coefficients */ HYPRE_Complex **data_aop; /* Array of pointers to data */ HYPRE_MemoryLocation memory_location; /* Memory location of data array */ + +#if defined(HYPRE_MIXED_PRECISION) + HYPRE_Precision matrix_precision; +#endif } hypre_DenseBlockMatrix; /*-------------------------------------------------------------------------- @@ -80,6 +88,10 @@ typedef struct hypre_DenseBlockMatrix_struct (matrix) -> row_stride * i + \ (matrix) -> col_stride * j]) +#ifdef HYPRE_MIXED_PRECISION +#define hypre_DenseBlockMatrixPrecision(matrix) ((matrix) -> matrix_precision) +#endif + #endif /****************************************************************************** * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other @@ -89,26 +101,64 @@ typedef struct hypre_DenseBlockMatrix_struct ******************************************************************************/ /* 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*); +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 * +hypre_DenseBlockMatrixCreateByBlock( HYPRE_Int row_major, + HYPRE_Int num_blocks, + HYPRE_Int num_rows_block, + HYPRE_Int num_cols_block ); +hypre_DenseBlockMatrix* +hypre_DenseBlockMatrixClone( hypre_DenseBlockMatrix *A, + HYPRE_Int copy_data ); +HYPRE_Int +hypre_DenseBlockMatrixDestroy( hypre_DenseBlockMatrix *A ); +HYPRE_Int +hypre_DenseBlockMatrixInitializeOn( hypre_DenseBlockMatrix *A, + HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_DenseBlockMatrixInitialize( hypre_DenseBlockMatrix *A ); +HYPRE_Int +hypre_DenseBlockMatrixBuildAOP( hypre_DenseBlockMatrix *A ); +HYPRE_Int +hypre_DenseBlockMatrixCopy( hypre_DenseBlockMatrix *A, + hypre_DenseBlockMatrix *B ); +HYPRE_Int +hypre_DenseBlockMatrixMigrate( hypre_DenseBlockMatrix *A, + HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_DenseBlockMatrixPrint( MPI_Comm comm, + hypre_DenseBlockMatrix *A, + const char* filename ); /* dense_block_matmult.c */ -HYPRE_Int hypre_DenseBlockMatrixMultiply(hypre_DenseBlockMatrix*, hypre_DenseBlockMatrix*, - hypre_DenseBlockMatrix**); +HYPRE_Int +hypre_DenseBlockMatrixMultiplyHost( hypre_DenseBlockMatrix *A, + hypre_DenseBlockMatrix *B, + hypre_DenseBlockMatrix *C); +HYPRE_Int +hypre_DenseBlockMatrixMultiply( hypre_DenseBlockMatrix *A, + hypre_DenseBlockMatrix *B, + hypre_DenseBlockMatrix **C_ptr); #ifdef __cplusplus } #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_seq_block_mv_mup_undef.h" +#include "_hypre_seq_block_mv_mup.h" +#endif +#endif + #endif diff --git a/src/seq_block_mv/_hypre_seq_block_mv_mup.h b/src/seq_block_mv/_hypre_seq_block_mv_mup.h new file mode 100644 index 0000000000..48a23de9fe --- /dev/null +++ b/src/seq_block_mv/_hypre_seq_block_mv_mup.h @@ -0,0 +1,137 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#ifndef hypre_SEQ_BLOCK_MV_MUP_HEADER +#define hypre_SEQ_BLOCK_MV_MUP_HEADER + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (HYPRE_MIXED_PRECISION) + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +hypre_DenseBlockMatrixBuildAOP_flt( hypre_DenseBlockMatrix *A ); +HYPRE_Int +hypre_DenseBlockMatrixBuildAOP_dbl( hypre_DenseBlockMatrix *A ); +HYPRE_Int +hypre_DenseBlockMatrixBuildAOP_long_dbl( hypre_DenseBlockMatrix *A ); + +hypre_DenseBlockMatrix* +hypre_DenseBlockMatrixClone_flt( hypre_DenseBlockMatrix *A, HYPRE_Int copy_data ); +hypre_DenseBlockMatrix* +hypre_DenseBlockMatrixClone_dbl( hypre_DenseBlockMatrix *A, HYPRE_Int copy_data ); +hypre_DenseBlockMatrix* +hypre_DenseBlockMatrixClone_long_dbl( hypre_DenseBlockMatrix *A, HYPRE_Int copy_data ); + +HYPRE_Int +hypre_DenseBlockMatrixCopy_flt( hypre_DenseBlockMatrix *A, hypre_DenseBlockMatrix *B ); +HYPRE_Int +hypre_DenseBlockMatrixCopy_dbl( hypre_DenseBlockMatrix *A, hypre_DenseBlockMatrix *B ); +HYPRE_Int +hypre_DenseBlockMatrixCopy_long_dbl( hypre_DenseBlockMatrix *A, hypre_DenseBlockMatrix *B ); + +hypre_DenseBlockMatrix * +hypre_DenseBlockMatrixCreate_flt( HYPRE_Int row_major, HYPRE_Int num_rows, HYPRE_Int num_cols, HYPRE_Int num_rows_block, HYPRE_Int num_cols_block ); +hypre_DenseBlockMatrix * +hypre_DenseBlockMatrixCreate_dbl( HYPRE_Int row_major, HYPRE_Int num_rows, HYPRE_Int num_cols, HYPRE_Int num_rows_block, HYPRE_Int num_cols_block ); +hypre_DenseBlockMatrix * +hypre_DenseBlockMatrixCreate_long_dbl( HYPRE_Int row_major, HYPRE_Int num_rows, HYPRE_Int num_cols, HYPRE_Int num_rows_block, HYPRE_Int num_cols_block ); + +hypre_DenseBlockMatrix * +hypre_DenseBlockMatrixCreateByBlock_flt( HYPRE_Int row_major, HYPRE_Int num_blocks, HYPRE_Int num_rows_block, HYPRE_Int num_cols_block ); +hypre_DenseBlockMatrix * +hypre_DenseBlockMatrixCreateByBlock_dbl( HYPRE_Int row_major, HYPRE_Int num_blocks, HYPRE_Int num_rows_block, HYPRE_Int num_cols_block ); +hypre_DenseBlockMatrix * +hypre_DenseBlockMatrixCreateByBlock_long_dbl( HYPRE_Int row_major, HYPRE_Int num_blocks, HYPRE_Int num_rows_block, HYPRE_Int num_cols_block ); + +HYPRE_Int +hypre_DenseBlockMatrixDestroy_flt( hypre_DenseBlockMatrix *A ); +HYPRE_Int +hypre_DenseBlockMatrixDestroy_dbl( hypre_DenseBlockMatrix *A ); +HYPRE_Int +hypre_DenseBlockMatrixDestroy_long_dbl( hypre_DenseBlockMatrix *A ); + +HYPRE_Int +hypre_DenseBlockMatrixInitialize_flt( hypre_DenseBlockMatrix *A ); +HYPRE_Int +hypre_DenseBlockMatrixInitialize_dbl( hypre_DenseBlockMatrix *A ); +HYPRE_Int +hypre_DenseBlockMatrixInitialize_long_dbl( hypre_DenseBlockMatrix *A ); + +HYPRE_Int +hypre_DenseBlockMatrixInitializeOn_flt( hypre_DenseBlockMatrix *A, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_DenseBlockMatrixInitializeOn_dbl( hypre_DenseBlockMatrix *A, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_DenseBlockMatrixInitializeOn_long_dbl( hypre_DenseBlockMatrix *A, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +hypre_DenseBlockMatrixMigrate_flt( hypre_DenseBlockMatrix *A, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_DenseBlockMatrixMigrate_dbl( hypre_DenseBlockMatrix *A, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_DenseBlockMatrixMigrate_long_dbl( hypre_DenseBlockMatrix *A, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +hypre_DenseBlockMatrixMultiply_flt( hypre_DenseBlockMatrix *A, hypre_DenseBlockMatrix *B, hypre_DenseBlockMatrix **C_ptr ); +HYPRE_Int +hypre_DenseBlockMatrixMultiply_dbl( hypre_DenseBlockMatrix *A, hypre_DenseBlockMatrix *B, hypre_DenseBlockMatrix **C_ptr ); +HYPRE_Int +hypre_DenseBlockMatrixMultiply_long_dbl( hypre_DenseBlockMatrix *A, hypre_DenseBlockMatrix *B, hypre_DenseBlockMatrix **C_ptr ); + +HYPRE_Int +hypre_DenseBlockMatrixMultiplyHost_flt( hypre_DenseBlockMatrix *A, hypre_DenseBlockMatrix *B, hypre_DenseBlockMatrix *C ); +HYPRE_Int +hypre_DenseBlockMatrixMultiplyHost_dbl( hypre_DenseBlockMatrix *A, hypre_DenseBlockMatrix *B, hypre_DenseBlockMatrix *C ); +HYPRE_Int +hypre_DenseBlockMatrixMultiplyHost_long_dbl( hypre_DenseBlockMatrix *A, hypre_DenseBlockMatrix *B, hypre_DenseBlockMatrix *C ); + +HYPRE_Int +hypre_DenseBlockMatrixPrint_flt( MPI_Comm comm, hypre_DenseBlockMatrix *A, const char* filename ); +HYPRE_Int +hypre_DenseBlockMatrixPrint_dbl( MPI_Comm comm, hypre_DenseBlockMatrix *A, const char* filename ); +HYPRE_Int +hypre_DenseBlockMatrixPrint_long_dbl( MPI_Comm comm, hypre_DenseBlockMatrix *A, const char* filename ); + + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + + + +#endif + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/src/seq_block_mv/_hypre_seq_block_mv_mup_def.h b/src/seq_block_mv/_hypre_seq_block_mv_mup_def.h new file mode 100644 index 0000000000..f7073997cd --- /dev/null +++ b/src/seq_block_mv/_hypre_seq_block_mv_mup_def.h @@ -0,0 +1,31 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#ifndef hypre_SEQ_BLOCK_MV_MUP_DEF_HEADER +#define hypre_SEQ_BLOCK_MV_MUP_DEF_HEADER + +#include "_hypre_mup_def.h" + +#define hypre_DenseBlockMatrixBuildAOP HYPRE_FIXEDPRECISION_FUNC ( hypre_DenseBlockMatrixBuildAOP ) +#define hypre_DenseBlockMatrixClone HYPRE_FIXEDPRECISION_FUNC ( hypre_DenseBlockMatrixClone ) +#define hypre_DenseBlockMatrixCopy HYPRE_FIXEDPRECISION_FUNC ( hypre_DenseBlockMatrixCopy ) +#define hypre_DenseBlockMatrixCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_DenseBlockMatrixCreate ) +#define hypre_DenseBlockMatrixCreateByBlock HYPRE_FIXEDPRECISION_FUNC ( hypre_DenseBlockMatrixCreateByBlock ) +#define hypre_DenseBlockMatrixDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_DenseBlockMatrixDestroy ) +#define hypre_DenseBlockMatrixInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_DenseBlockMatrixInitialize ) +#define hypre_DenseBlockMatrixInitializeOn HYPRE_FIXEDPRECISION_FUNC ( hypre_DenseBlockMatrixInitializeOn ) +#define hypre_DenseBlockMatrixMigrate HYPRE_FIXEDPRECISION_FUNC ( hypre_DenseBlockMatrixMigrate ) +#define hypre_DenseBlockMatrixMultiply HYPRE_FIXEDPRECISION_FUNC ( hypre_DenseBlockMatrixMultiply ) +#define hypre_DenseBlockMatrixMultiplyHost HYPRE_FIXEDPRECISION_FUNC ( hypre_DenseBlockMatrixMultiplyHost ) +#define hypre_DenseBlockMatrixPrint HYPRE_FIXEDPRECISION_FUNC ( hypre_DenseBlockMatrixPrint ) + +#endif diff --git a/src/seq_block_mv/_hypre_seq_block_mv_mup_undef.h b/src/seq_block_mv/_hypre_seq_block_mv_mup_undef.h new file mode 100644 index 0000000000..e9327d155d --- /dev/null +++ b/src/seq_block_mv/_hypre_seq_block_mv_mup_undef.h @@ -0,0 +1,26 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#undef hypre_SEQ_BLOCK_MV_MUP_DEF_HEADER + +#undef hypre_DenseBlockMatrixBuildAOP +#undef hypre_DenseBlockMatrixClone +#undef hypre_DenseBlockMatrixCopy +#undef hypre_DenseBlockMatrixCreate +#undef hypre_DenseBlockMatrixCreateByBlock +#undef hypre_DenseBlockMatrixDestroy +#undef hypre_DenseBlockMatrixInitialize +#undef hypre_DenseBlockMatrixInitializeOn +#undef hypre_DenseBlockMatrixMigrate +#undef hypre_DenseBlockMatrixMultiply +#undef hypre_DenseBlockMatrixMultiplyHost +#undef hypre_DenseBlockMatrixPrint diff --git a/src/seq_block_mv/dense_block_matrix.c b/src/seq_block_mv/dense_block_matrix.c index cd3c5d6d09..1f86b2a890 100644 --- a/src/seq_block_mv/dense_block_matrix.c +++ b/src/seq_block_mv/dense_block_matrix.c @@ -54,6 +54,10 @@ hypre_DenseBlockMatrixCreate( HYPRE_Int row_major, hypre_DenseBlockMatrixDataAOP(A) = NULL; hypre_DenseBlockMatrixMemoryLocation(A) = hypre_HandleMemoryLocation(hypre_handle()); +#if defined(HYPRE_MIXED_PRECISION) + hypre_DenseBlockMatrixPrecision(A) = HYPRE_OBJECT_PRECISION; +#endif + if (row_major) { hypre_DenseBlockMatrixRowStride(A) = 1; diff --git a/src/seq_block_mv/dense_block_matrix.h b/src/seq_block_mv/dense_block_matrix.h index 75ec0bbacb..6f72173499 100644 --- a/src/seq_block_mv/dense_block_matrix.h +++ b/src/seq_block_mv/dense_block_matrix.h @@ -32,6 +32,10 @@ typedef struct hypre_DenseBlockMatrix_struct HYPRE_Complex *data; /* Matrix coefficients */ HYPRE_Complex **data_aop; /* Array of pointers to data */ HYPRE_MemoryLocation memory_location; /* Memory location of data array */ + +#if defined(HYPRE_MIXED_PRECISION) + HYPRE_Precision matrix_precision; +#endif } hypre_DenseBlockMatrix; /*-------------------------------------------------------------------------- @@ -62,4 +66,8 @@ typedef struct hypre_DenseBlockMatrix_struct (matrix) -> row_stride * i + \ (matrix) -> col_stride * j]) +#ifdef HYPRE_MIXED_PRECISION +#define hypre_DenseBlockMatrixPrecision(matrix) ((matrix) -> matrix_precision) +#endif + #endif diff --git a/src/seq_block_mv/headers b/src/seq_block_mv/headers index 4215eed053..bdbd8302aa 100755 --- a/src/seq_block_mv/headers +++ b/src/seq_block_mv/headers @@ -24,7 +24,11 @@ cat > $INTERNAL_HEADER <<@ #define hypre_SEQ_BLOCK_MV_HEADER #include -#include "seq_mv.h" +#include "_hypre_seq_mv.h" + +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_seq_block_mv_mup_def.h" +#endif #ifdef __cplusplus extern "C" { @@ -44,6 +48,17 @@ cat >> $INTERNAL_HEADER <<@ } #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_seq_block_mv_mup_undef.h" +#include "_hypre_seq_block_mv_mup.h" +#endif +#endif + #endif @ diff --git a/src/seq_block_mv/mup.fixed b/src/seq_block_mv/mup.fixed new file mode 100644 index 0000000000..01a08d7f1c --- /dev/null +++ b/src/seq_block_mv/mup.fixed @@ -0,0 +1,12 @@ +hypre_DenseBlockMatrixBuildAOP +hypre_DenseBlockMatrixClone +hypre_DenseBlockMatrixCopy +hypre_DenseBlockMatrixCreate +hypre_DenseBlockMatrixCreateByBlock +hypre_DenseBlockMatrixDestroy +hypre_DenseBlockMatrixInitialize +hypre_DenseBlockMatrixInitializeOn +hypre_DenseBlockMatrixMigrate +hypre_DenseBlockMatrixMultiply +hypre_DenseBlockMatrixMultiplyHost +hypre_DenseBlockMatrixPrint diff --git a/src/seq_block_mv/mup.functions b/src/seq_block_mv/mup.functions new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/seq_block_mv/mup.methods b/src/seq_block_mv/mup.methods new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/seq_block_mv/mup_code b/src/seq_block_mv/mup_code new file mode 100755 index 0000000000..490e5df99f --- /dev/null +++ b/src/seq_block_mv/mup_code @@ -0,0 +1,11 @@ +#!/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) + +touch mup_fake_ext.h + +../config/gen_code.sh mup_fake_ext.h _hypre_seq_block_mv.h mup + +rm -f mup_fake_ext.h mup_fake_ext_mup.h diff --git a/src/seq_block_mv/mup_fixed.c b/src/seq_block_mv/mup_fixed.c new file mode 100644 index 0000000000..a073222c62 --- /dev/null +++ b/src/seq_block_mv/mup_fixed.c @@ -0,0 +1,115 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_seq_block_mv.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +hypre_DenseBlockMatrixBuildAOP( hypre_DenseBlockMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_DenseBlockMatrixBuildAOP)( A ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_DenseBlockMatrix* +hypre_DenseBlockMatrixClone( hypre_DenseBlockMatrix *A, HYPRE_Int copy_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_DenseBlockMatrixClone)( A, copy_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_DenseBlockMatrixCopy( hypre_DenseBlockMatrix *A, hypre_DenseBlockMatrix *B ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_DenseBlockMatrixCopy)( A, B ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_DenseBlockMatrixCreate)( row_major, num_rows, num_cols, num_rows_block, num_cols_block ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_DenseBlockMatrix * +hypre_DenseBlockMatrixCreateByBlock( HYPRE_Int row_major, HYPRE_Int num_blocks, HYPRE_Int num_rows_block, HYPRE_Int num_cols_block ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_DenseBlockMatrixCreateByBlock)( row_major, num_blocks, num_rows_block, num_cols_block ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_DenseBlockMatrixDestroy( hypre_DenseBlockMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_DenseBlockMatrixDestroy)( A ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_DenseBlockMatrixInitialize( hypre_DenseBlockMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_DenseBlockMatrixInitialize)( A ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_DenseBlockMatrixInitializeOn( hypre_DenseBlockMatrix *A, HYPRE_MemoryLocation memory_location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_DenseBlockMatrixInitializeOn)( A, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_DenseBlockMatrixMigrate( hypre_DenseBlockMatrix *A, HYPRE_MemoryLocation memory_location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_DenseBlockMatrixMigrate)( A, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_DenseBlockMatrixMultiply( hypre_DenseBlockMatrix *A, hypre_DenseBlockMatrix *B, hypre_DenseBlockMatrix **C_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_DenseBlockMatrixMultiply)( A, B, C_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_DenseBlockMatrixMultiplyHost( hypre_DenseBlockMatrix *A, hypre_DenseBlockMatrix *B, hypre_DenseBlockMatrix *C ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_DenseBlockMatrixMultiplyHost)( A, B, C ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_DenseBlockMatrixPrint( MPI_Comm comm, hypre_DenseBlockMatrix *A, const char* filename ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_DenseBlockMatrixPrint)( comm, A, filename ); +} + + +#endif + diff --git a/src/seq_block_mv/mup_functions.c b/src/seq_block_mv/mup_functions.c new file mode 100644 index 0000000000..96138347f0 --- /dev/null +++ b/src/seq_block_mv/mup_functions.c @@ -0,0 +1,19 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_seq_block_mv.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + + + + +#endif + diff --git a/src/seq_block_mv/mup_pre.c b/src/seq_block_mv/mup_pre.c new file mode 100644 index 0000000000..96138347f0 --- /dev/null +++ b/src/seq_block_mv/mup_pre.c @@ -0,0 +1,19 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_seq_block_mv.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + + + + +#endif + diff --git a/src/seq_block_mv/protos.h b/src/seq_block_mv/protos.h index 799deffa75..084a3973e9 100644 --- a/src/seq_block_mv/protos.h +++ b/src/seq_block_mv/protos.h @@ -6,19 +6,46 @@ ******************************************************************************/ /* 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*); +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 * +hypre_DenseBlockMatrixCreateByBlock( HYPRE_Int row_major, + HYPRE_Int num_blocks, + HYPRE_Int num_rows_block, + HYPRE_Int num_cols_block ); +hypre_DenseBlockMatrix* +hypre_DenseBlockMatrixClone( hypre_DenseBlockMatrix *A, + HYPRE_Int copy_data ); +HYPRE_Int +hypre_DenseBlockMatrixDestroy( hypre_DenseBlockMatrix *A ); +HYPRE_Int +hypre_DenseBlockMatrixInitializeOn( hypre_DenseBlockMatrix *A, + HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_DenseBlockMatrixInitialize( hypre_DenseBlockMatrix *A ); +HYPRE_Int +hypre_DenseBlockMatrixBuildAOP( hypre_DenseBlockMatrix *A ); +HYPRE_Int +hypre_DenseBlockMatrixCopy( hypre_DenseBlockMatrix *A, + hypre_DenseBlockMatrix *B ); +HYPRE_Int +hypre_DenseBlockMatrixMigrate( hypre_DenseBlockMatrix *A, + HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_DenseBlockMatrixPrint( MPI_Comm comm, + hypre_DenseBlockMatrix *A, + const char* filename ); /* dense_block_matmult.c */ -HYPRE_Int hypre_DenseBlockMatrixMultiply(hypre_DenseBlockMatrix*, hypre_DenseBlockMatrix*, - hypre_DenseBlockMatrix**); +HYPRE_Int +hypre_DenseBlockMatrixMultiplyHost( hypre_DenseBlockMatrix *A, + hypre_DenseBlockMatrix *B, + hypre_DenseBlockMatrix *C); +HYPRE_Int +hypre_DenseBlockMatrixMultiply( hypre_DenseBlockMatrix *A, + hypre_DenseBlockMatrix *B, + hypre_DenseBlockMatrix **C_ptr); diff --git a/src/seq_mv/CMakeLists.txt b/src/seq_mv/CMakeLists.txt index c7962b47de..b4586ba55b 100644 --- a/src/seq_mv/CMakeLists.txt +++ b/src/seq_mv/CMakeLists.txt @@ -5,10 +5,21 @@ set(HDRS HYPRE_seq_mv.h - seq_mv.h + _hypre_seq_mv.h ) -set(SRCS +# Add MUP headers when mixed precision is enabled +if(HYPRE_ENABLE_MIXED_PRECISION) + list(APPEND HDRS + HYPRE_seq_mv_mup.h + _hypre_seq_mv_mup.h + _hypre_seq_mv_mup_def.h + _hypre_seq_mv_mup_undef.h + ) +endif() + +# Regular sources +set(REGULAR_SRCS csr_filter.c csr_matop.c csr_matrix.c @@ -20,6 +31,7 @@ set(SRCS HYPRE_vector.c mapped_matrix.c multiblock_matrix.c + vector.c vector_batched.c csr_matop_device.c csr_matrix_cuda_utils.c @@ -57,10 +69,17 @@ set(SRCS csr_spgemm_device_util.c csr_spmv_device.c csr_sptrans_device.c - vector.c vector_device.c ) +# Mixed precision sources +set(MUP_SRCS + mup_fixed.c + mup_functions.c + mup_pre.c + seq_mv_mp.c +) + # Autogenerate csr_spgemm_device_numer$ files file(READ "csr_spgemm_device_numer.in" CONTENTS) foreach(number RANGE 1 10) @@ -82,10 +101,12 @@ foreach(number RANGE 1 10) endif (NOT EXISTS ${fn}) endforeach(number RANGE 1 10) -target_sources(${PROJECT_NAME} - PRIVATE ${SRCS} - ${HDRS} -) +if(HYPRE_ENABLE_MIXED_PRECISION) + setup_mixed_precision_compilation("seq_mv" SRCS "${REGULAR_SRCS}") + target_sources(${PROJECT_NAME} PRIVATE ${MUP_SRCS} ${HDRS}) +else() + target_sources(${PROJECT_NAME} PRIVATE ${REGULAR_SRCS} ${HDRS}) +endif() if (HYPRE_USING_GPU) set(GPU_SRCS diff --git a/src/seq_mv/HYPRE_csr_matrix.c b/src/seq_mv/HYPRE_csr_matrix.c index 4fc715155d..7d74c83497 100644 --- a/src/seq_mv/HYPRE_csr_matrix.c +++ b/src/seq_mv/HYPRE_csr_matrix.c @@ -11,7 +11,7 @@ * *****************************************************************************/ -#include "seq_mv.h" +#include "_hypre_seq_mv.h" /*-------------------------------------------------------------------------- * HYPRE_CSRMatrixCreate diff --git a/src/seq_mv/HYPRE_mapped_matrix.c b/src/seq_mv/HYPRE_mapped_matrix.c index 24355b3236..7abbfe6ffd 100644 --- a/src/seq_mv/HYPRE_mapped_matrix.c +++ b/src/seq_mv/HYPRE_mapped_matrix.c @@ -11,7 +11,7 @@ * *****************************************************************************/ -#include "seq_mv.h" +#include "_hypre_seq_mv.h" /*-------------------------------------------------------------------------- * HYPRE_MappedMatrixCreate diff --git a/src/seq_mv/HYPRE_multiblock_matrix.c b/src/seq_mv/HYPRE_multiblock_matrix.c index 09c081f218..ee5ccaad41 100644 --- a/src/seq_mv/HYPRE_multiblock_matrix.c +++ b/src/seq_mv/HYPRE_multiblock_matrix.c @@ -11,7 +11,7 @@ * *****************************************************************************/ -#include "seq_mv.h" +#include "_hypre_seq_mv.h" /*-------------------------------------------------------------------------- * HYPRE_MultiblockMatrixCreate diff --git a/src/seq_mv/HYPRE_seq_mv.h b/src/seq_mv/HYPRE_seq_mv.h index 57e812a8d0..3c62f959bf 100644 --- a/src/seq_mv/HYPRE_seq_mv.h +++ b/src/seq_mv/HYPRE_seq_mv.h @@ -16,6 +16,10 @@ #include "HYPRE_utilities.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_seq_mv_mup_def.h" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -75,6 +79,7 @@ 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_Vector HYPRE_VectorRead( char *file_name ); +HYPRE_Int HYPRE_VectorCopy( HYPRE_Vector xvec, HYPRE_Vector yvec); typedef enum HYPRE_TimerID { @@ -139,4 +144,15 @@ extern HYPRE_Real hypre_profile_times[HYPRE_TIMER_ID_COUNT]; #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_seq_mv_mup_undef.h" +#include "HYPRE_seq_mv_mup.h" +#endif +#endif + #endif diff --git a/src/seq_mv/HYPRE_seq_mv_mup.h b/src/seq_mv/HYPRE_seq_mv_mup.h new file mode 100644 index 0000000000..ba5c2cc99c --- /dev/null +++ b/src/seq_mv/HYPRE_seq_mv_mup.h @@ -0,0 +1,413 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#ifndef HYPRE_SEQ_MV_MUP_HEADER +#define HYPRE_SEQ_MV_MUP_HEADER + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (HYPRE_MIXED_PRECISION) + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_CSRMatrix +HYPRE_CSRMatrixCreate_flt( HYPRE_Int num_rows, HYPRE_Int num_cols, HYPRE_Int *row_sizes ); +HYPRE_CSRMatrix +HYPRE_CSRMatrixCreate_dbl( HYPRE_Int num_rows, HYPRE_Int num_cols, HYPRE_Int *row_sizes ); +HYPRE_CSRMatrix +HYPRE_CSRMatrixCreate_long_dbl( 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_flt( HYPRE_CSRMatrix matrix ); +HYPRE_Int +HYPRE_CSRMatrixDestroy_dbl( HYPRE_CSRMatrix matrix ); +HYPRE_Int +HYPRE_CSRMatrixDestroy_long_dbl( HYPRE_CSRMatrix matrix ); +HYPRE_Int +HYPRE_CSRMatrixDestroy( HYPRE_CSRMatrix matrix ); + +HYPRE_Int +HYPRE_CSRMatrixGetNumRows_flt( HYPRE_CSRMatrix matrix, HYPRE_Int *num_rows ); +HYPRE_Int +HYPRE_CSRMatrixGetNumRows_dbl( HYPRE_CSRMatrix matrix, HYPRE_Int *num_rows ); +HYPRE_Int +HYPRE_CSRMatrixGetNumRows_long_dbl( HYPRE_CSRMatrix matrix, HYPRE_Int *num_rows ); +HYPRE_Int +HYPRE_CSRMatrixGetNumRows( HYPRE_CSRMatrix matrix, HYPRE_Int *num_rows ); + +HYPRE_Int +HYPRE_CSRMatrixInitialize_flt( HYPRE_CSRMatrix matrix ); +HYPRE_Int +HYPRE_CSRMatrixInitialize_dbl( HYPRE_CSRMatrix matrix ); +HYPRE_Int +HYPRE_CSRMatrixInitialize_long_dbl( HYPRE_CSRMatrix matrix ); +HYPRE_Int +HYPRE_CSRMatrixInitialize( HYPRE_CSRMatrix matrix ); + +void +HYPRE_CSRMatrixPrint_flt( HYPRE_CSRMatrix matrix, char *file_name ); +void +HYPRE_CSRMatrixPrint_dbl( HYPRE_CSRMatrix matrix, char *file_name ); +void +HYPRE_CSRMatrixPrint_long_dbl( HYPRE_CSRMatrix matrix, char *file_name ); +void +HYPRE_CSRMatrixPrint( HYPRE_CSRMatrix matrix, char *file_name ); + +HYPRE_CSRMatrix +HYPRE_CSRMatrixRead_flt( char *file_name ); +HYPRE_CSRMatrix +HYPRE_CSRMatrixRead_dbl( char *file_name ); +HYPRE_CSRMatrix +HYPRE_CSRMatrixRead_long_dbl( char *file_name ); +HYPRE_CSRMatrix +HYPRE_CSRMatrixRead( char *file_name ); + +HYPRE_Int +HYPRE_MappedMatrixAssemble_flt( HYPRE_MappedMatrix matrix ); +HYPRE_Int +HYPRE_MappedMatrixAssemble_dbl( HYPRE_MappedMatrix matrix ); +HYPRE_Int +HYPRE_MappedMatrixAssemble_long_dbl( HYPRE_MappedMatrix matrix ); +HYPRE_Int +HYPRE_MappedMatrixAssemble( HYPRE_MappedMatrix matrix ); + +HYPRE_MappedMatrix +HYPRE_MappedMatrixCreate_flt( void ); +HYPRE_MappedMatrix +HYPRE_MappedMatrixCreate_dbl( void ); +HYPRE_MappedMatrix +HYPRE_MappedMatrixCreate_long_dbl( void ); +HYPRE_MappedMatrix +HYPRE_MappedMatrixCreate( void ); + +HYPRE_Int +HYPRE_MappedMatrixDestroy_flt( HYPRE_MappedMatrix matrix ); +HYPRE_Int +HYPRE_MappedMatrixDestroy_dbl( HYPRE_MappedMatrix matrix ); +HYPRE_Int +HYPRE_MappedMatrixDestroy_long_dbl( HYPRE_MappedMatrix matrix ); +HYPRE_Int +HYPRE_MappedMatrixDestroy( HYPRE_MappedMatrix matrix ); + +HYPRE_Int +HYPRE_MappedMatrixGetColIndex_flt( HYPRE_MappedMatrix matrix, HYPRE_Int j ); +HYPRE_Int +HYPRE_MappedMatrixGetColIndex_dbl( HYPRE_MappedMatrix matrix, HYPRE_Int j ); +HYPRE_Int +HYPRE_MappedMatrixGetColIndex_long_dbl( HYPRE_MappedMatrix matrix, HYPRE_Int j ); +HYPRE_Int +HYPRE_MappedMatrixGetColIndex( HYPRE_MappedMatrix matrix, HYPRE_Int j ); + +void * +HYPRE_MappedMatrixGetMatrix_flt( HYPRE_MappedMatrix matrix ); +void * +HYPRE_MappedMatrixGetMatrix_dbl( HYPRE_MappedMatrix matrix ); +void * +HYPRE_MappedMatrixGetMatrix_long_dbl( HYPRE_MappedMatrix matrix ); +void * +HYPRE_MappedMatrixGetMatrix( HYPRE_MappedMatrix matrix ); + +HYPRE_Int +HYPRE_MappedMatrixInitialize_flt( HYPRE_MappedMatrix matrix ); +HYPRE_Int +HYPRE_MappedMatrixInitialize_dbl( HYPRE_MappedMatrix matrix ); +HYPRE_Int +HYPRE_MappedMatrixInitialize_long_dbl( HYPRE_MappedMatrix matrix ); +HYPRE_Int +HYPRE_MappedMatrixInitialize( HYPRE_MappedMatrix matrix ); + +HYPRE_Int +HYPRE_MappedMatrixLimitedDestroy_flt( HYPRE_MappedMatrix matrix ); +HYPRE_Int +HYPRE_MappedMatrixLimitedDestroy_dbl( HYPRE_MappedMatrix matrix ); +HYPRE_Int +HYPRE_MappedMatrixLimitedDestroy_long_dbl( HYPRE_MappedMatrix matrix ); +HYPRE_Int +HYPRE_MappedMatrixLimitedDestroy( HYPRE_MappedMatrix matrix ); + +void +HYPRE_MappedMatrixPrint_flt( HYPRE_MappedMatrix matrix ); +void +HYPRE_MappedMatrixPrint_dbl( HYPRE_MappedMatrix matrix ); +void +HYPRE_MappedMatrixPrint_long_dbl( HYPRE_MappedMatrix matrix ); +void +HYPRE_MappedMatrixPrint( HYPRE_MappedMatrix matrix ); + +HYPRE_Int +HYPRE_MappedMatrixSetMapData_flt( HYPRE_MappedMatrix matrix, void *MapData ); +HYPRE_Int +HYPRE_MappedMatrixSetMapData_dbl( HYPRE_MappedMatrix matrix, void *MapData ); +HYPRE_Int +HYPRE_MappedMatrixSetMapData_long_dbl( HYPRE_MappedMatrix matrix, void *MapData ); +HYPRE_Int +HYPRE_MappedMatrixSetMapData( HYPRE_MappedMatrix matrix, void *MapData ); + +HYPRE_Int +HYPRE_MappedMatrixSetMatrix_flt( HYPRE_MappedMatrix matrix, void *matrix_data ); +HYPRE_Int +HYPRE_MappedMatrixSetMatrix_dbl( HYPRE_MappedMatrix matrix, void *matrix_data ); +HYPRE_Int +HYPRE_MappedMatrixSetMatrix_long_dbl( HYPRE_MappedMatrix matrix, void *matrix_data ); +HYPRE_Int +HYPRE_MappedMatrixSetMatrix( HYPRE_MappedMatrix matrix, void *matrix_data ); + +HYPRE_Int +HYPRE_MultiblockMatrixAssemble_flt( HYPRE_MultiblockMatrix matrix ); +HYPRE_Int +HYPRE_MultiblockMatrixAssemble_dbl( HYPRE_MultiblockMatrix matrix ); +HYPRE_Int +HYPRE_MultiblockMatrixAssemble_long_dbl( HYPRE_MultiblockMatrix matrix ); +HYPRE_Int +HYPRE_MultiblockMatrixAssemble( HYPRE_MultiblockMatrix matrix ); + +HYPRE_MultiblockMatrix +HYPRE_MultiblockMatrixCreate_flt( void ); +HYPRE_MultiblockMatrix +HYPRE_MultiblockMatrixCreate_dbl( void ); +HYPRE_MultiblockMatrix +HYPRE_MultiblockMatrixCreate_long_dbl( void ); +HYPRE_MultiblockMatrix +HYPRE_MultiblockMatrixCreate( void ); + +HYPRE_Int +HYPRE_MultiblockMatrixDestroy_flt( HYPRE_MultiblockMatrix matrix ); +HYPRE_Int +HYPRE_MultiblockMatrixDestroy_dbl( HYPRE_MultiblockMatrix matrix ); +HYPRE_Int +HYPRE_MultiblockMatrixDestroy_long_dbl( HYPRE_MultiblockMatrix matrix ); +HYPRE_Int +HYPRE_MultiblockMatrixDestroy( HYPRE_MultiblockMatrix matrix ); + +HYPRE_Int +HYPRE_MultiblockMatrixInitialize_flt( HYPRE_MultiblockMatrix matrix ); +HYPRE_Int +HYPRE_MultiblockMatrixInitialize_dbl( HYPRE_MultiblockMatrix matrix ); +HYPRE_Int +HYPRE_MultiblockMatrixInitialize_long_dbl( HYPRE_MultiblockMatrix matrix ); +HYPRE_Int +HYPRE_MultiblockMatrixInitialize( HYPRE_MultiblockMatrix matrix ); + +HYPRE_Int +HYPRE_MultiblockMatrixLimitedDestroy_flt( HYPRE_MultiblockMatrix matrix ); +HYPRE_Int +HYPRE_MultiblockMatrixLimitedDestroy_dbl( HYPRE_MultiblockMatrix matrix ); +HYPRE_Int +HYPRE_MultiblockMatrixLimitedDestroy_long_dbl( HYPRE_MultiblockMatrix matrix ); +HYPRE_Int +HYPRE_MultiblockMatrixLimitedDestroy( HYPRE_MultiblockMatrix matrix ); + +void +HYPRE_MultiblockMatrixPrint_flt( HYPRE_MultiblockMatrix matrix ); +void +HYPRE_MultiblockMatrixPrint_dbl( HYPRE_MultiblockMatrix matrix ); +void +HYPRE_MultiblockMatrixPrint_long_dbl( HYPRE_MultiblockMatrix matrix ); +void +HYPRE_MultiblockMatrixPrint( HYPRE_MultiblockMatrix matrix ); + +HYPRE_Int +HYPRE_MultiblockMatrixSetNumSubmatrices_flt( HYPRE_MultiblockMatrix matrix, HYPRE_Int n ); +HYPRE_Int +HYPRE_MultiblockMatrixSetNumSubmatrices_dbl( HYPRE_MultiblockMatrix matrix, HYPRE_Int n ); +HYPRE_Int +HYPRE_MultiblockMatrixSetNumSubmatrices_long_dbl( HYPRE_MultiblockMatrix matrix, HYPRE_Int n ); +HYPRE_Int +HYPRE_MultiblockMatrixSetNumSubmatrices( HYPRE_MultiblockMatrix matrix, HYPRE_Int n ); + +HYPRE_Int +HYPRE_MultiblockMatrixSetSubmatrixType_flt( HYPRE_MultiblockMatrix matrix, HYPRE_Int j, HYPRE_Int type ); +HYPRE_Int +HYPRE_MultiblockMatrixSetSubmatrixType_dbl( HYPRE_MultiblockMatrix matrix, HYPRE_Int j, HYPRE_Int type ); +HYPRE_Int +HYPRE_MultiblockMatrixSetSubmatrixType_long_dbl( HYPRE_MultiblockMatrix matrix, HYPRE_Int j, HYPRE_Int type ); +HYPRE_Int +HYPRE_MultiblockMatrixSetSubmatrixType( HYPRE_MultiblockMatrix matrix, HYPRE_Int j, HYPRE_Int type ); + +HYPRE_Int +HYPRE_VectorCopy_flt( HYPRE_Vector xvec, HYPRE_Vector yvec ); +HYPRE_Int +HYPRE_VectorCopy_dbl( HYPRE_Vector xvec, HYPRE_Vector yvec ); +HYPRE_Int +HYPRE_VectorCopy_long_dbl( HYPRE_Vector xvec, HYPRE_Vector yvec ); +HYPRE_Int +HYPRE_VectorCopy( HYPRE_Vector xvec, HYPRE_Vector yvec ); + +HYPRE_Vector +HYPRE_VectorCreate_flt( HYPRE_Int size ); +HYPRE_Vector +HYPRE_VectorCreate_dbl( HYPRE_Int size ); +HYPRE_Vector +HYPRE_VectorCreate_long_dbl( HYPRE_Int size ); +HYPRE_Vector +HYPRE_VectorCreate( HYPRE_Int size ); + +HYPRE_Int +HYPRE_VectorDestroy_flt( HYPRE_Vector vector ); +HYPRE_Int +HYPRE_VectorDestroy_dbl( HYPRE_Vector vector ); +HYPRE_Int +HYPRE_VectorDestroy_long_dbl( HYPRE_Vector vector ); +HYPRE_Int +HYPRE_VectorDestroy( HYPRE_Vector vector ); + +HYPRE_Int +HYPRE_VectorInitialize_flt( HYPRE_Vector vector ); +HYPRE_Int +HYPRE_VectorInitialize_dbl( HYPRE_Vector vector ); +HYPRE_Int +HYPRE_VectorInitialize_long_dbl( HYPRE_Vector vector ); +HYPRE_Int +HYPRE_VectorInitialize( HYPRE_Vector vector ); + +HYPRE_Int +HYPRE_VectorPrint_flt( HYPRE_Vector vector, char *file_name ); +HYPRE_Int +HYPRE_VectorPrint_dbl( HYPRE_Vector vector, char *file_name ); +HYPRE_Int +HYPRE_VectorPrint_long_dbl( HYPRE_Vector vector, char *file_name ); +HYPRE_Int +HYPRE_VectorPrint( HYPRE_Vector vector, char *file_name ); + +HYPRE_Vector +HYPRE_VectorRead_flt( char *file_name ); +HYPRE_Vector +HYPRE_VectorRead_dbl( char *file_name ); +HYPRE_Vector +HYPRE_VectorRead_long_dbl( char *file_name ); +HYPRE_Vector +HYPRE_VectorRead( char *file_name ); + + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_CSRMatrix +HYPRE_CSRMatrixCreate_pre( HYPRE_Precision precision, HYPRE_Int num_rows, HYPRE_Int num_cols, HYPRE_Int *row_sizes ); + +HYPRE_Int +HYPRE_CSRMatrixDestroy_pre( HYPRE_Precision precision, HYPRE_CSRMatrix matrix ); + +HYPRE_Int +HYPRE_CSRMatrixGetNumRows_pre( HYPRE_Precision precision, HYPRE_CSRMatrix matrix, HYPRE_Int *num_rows ); + +HYPRE_Int +HYPRE_CSRMatrixInitialize_pre( HYPRE_Precision precision, HYPRE_CSRMatrix matrix ); + +void +HYPRE_CSRMatrixPrint_pre( HYPRE_Precision precision, HYPRE_CSRMatrix matrix, char *file_name ); + +HYPRE_CSRMatrix +HYPRE_CSRMatrixRead_pre( HYPRE_Precision precision, char *file_name ); + +HYPRE_Int +HYPRE_MappedMatrixAssemble_pre( HYPRE_Precision precision, HYPRE_MappedMatrix matrix ); + +HYPRE_MappedMatrix +HYPRE_MappedMatrixCreate_pre( HYPRE_Precision precision ); + +HYPRE_Int +HYPRE_MappedMatrixDestroy_pre( HYPRE_Precision precision, HYPRE_MappedMatrix matrix ); + +HYPRE_Int +HYPRE_MappedMatrixGetColIndex_pre( HYPRE_Precision precision, HYPRE_MappedMatrix matrix, HYPRE_Int j ); + +void * +HYPRE_MappedMatrixGetMatrix_pre( HYPRE_Precision precision, HYPRE_MappedMatrix matrix ); + +HYPRE_Int +HYPRE_MappedMatrixInitialize_pre( HYPRE_Precision precision, HYPRE_MappedMatrix matrix ); + +HYPRE_Int +HYPRE_MappedMatrixLimitedDestroy_pre( HYPRE_Precision precision, HYPRE_MappedMatrix matrix ); + +void +HYPRE_MappedMatrixPrint_pre( HYPRE_Precision precision, HYPRE_MappedMatrix matrix ); + +HYPRE_Int +HYPRE_MappedMatrixSetMapData_pre( HYPRE_Precision precision, HYPRE_MappedMatrix matrix, void *MapData ); + +HYPRE_Int +HYPRE_MappedMatrixSetMatrix_pre( HYPRE_Precision precision, HYPRE_MappedMatrix matrix, void *matrix_data ); + +HYPRE_Int +HYPRE_MultiblockMatrixAssemble_pre( HYPRE_Precision precision, HYPRE_MultiblockMatrix matrix ); + +HYPRE_MultiblockMatrix +HYPRE_MultiblockMatrixCreate_pre( HYPRE_Precision precision ); + +HYPRE_Int +HYPRE_MultiblockMatrixDestroy_pre( HYPRE_Precision precision, HYPRE_MultiblockMatrix matrix ); + +HYPRE_Int +HYPRE_MultiblockMatrixInitialize_pre( HYPRE_Precision precision, HYPRE_MultiblockMatrix matrix ); + +HYPRE_Int +HYPRE_MultiblockMatrixLimitedDestroy_pre( HYPRE_Precision precision, HYPRE_MultiblockMatrix matrix ); + +void +HYPRE_MultiblockMatrixPrint_pre( HYPRE_Precision precision, HYPRE_MultiblockMatrix matrix ); + +HYPRE_Int +HYPRE_MultiblockMatrixSetNumSubmatrices_pre( HYPRE_Precision precision, HYPRE_MultiblockMatrix matrix, HYPRE_Int n ); + +HYPRE_Int +HYPRE_MultiblockMatrixSetSubmatrixType_pre( HYPRE_Precision precision, HYPRE_MultiblockMatrix matrix, HYPRE_Int j, HYPRE_Int type ); + +HYPRE_Int +HYPRE_VectorCopy_pre( HYPRE_Precision precision, HYPRE_Vector xvec, HYPRE_Vector yvec ); + +HYPRE_Vector +HYPRE_VectorCreate_pre( HYPRE_Precision precision, HYPRE_Int size ); + +HYPRE_Int +HYPRE_VectorDestroy_pre( HYPRE_Precision precision, HYPRE_Vector vector ); + +HYPRE_Int +HYPRE_VectorInitialize_pre( HYPRE_Precision precision, HYPRE_Vector vector ); + +HYPRE_Int +HYPRE_VectorPrint_pre( HYPRE_Precision precision, HYPRE_Vector vector, char *file_name ); + +HYPRE_Vector +HYPRE_VectorRead_pre( HYPRE_Precision precision, char *file_name ); + + +#endif + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/src/seq_mv/HYPRE_vector.c b/src/seq_mv/HYPRE_vector.c index fb9f708d4f..5a4a1510d4 100644 --- a/src/seq_mv/HYPRE_vector.c +++ b/src/seq_mv/HYPRE_vector.c @@ -11,7 +11,7 @@ * *****************************************************************************/ -#include "seq_mv.h" +#include "_hypre_seq_mv.h" /*-------------------------------------------------------------------------- * HYPRE_VectorCreate @@ -64,3 +64,13 @@ HYPRE_VectorRead( char *file_name ) { return ( (HYPRE_Vector) hypre_SeqVectorRead( file_name ) ); } + +/*-------------------------------------------------------------------------- + * HYPRE_VectorCopy + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_VectorCopy( HYPRE_Vector xvec, HYPRE_Vector yvec) +{ + return ( hypre_SeqVectorCopy( (hypre_Vector *) xvec, (hypre_Vector *) yvec) ); +} \ No newline at end of file diff --git a/src/seq_mv/Makefile b/src/seq_mv/Makefile index d7a41d87fa..c12f0d89b3 100644 --- a/src/seq_mv/Makefile +++ b/src/seq_mv/Makefile @@ -19,7 +19,7 @@ HEADERS =\ HYPRE_seq_mv.h\ mapped_matrix.h\ multiblock_matrix.h\ - seq_mv.h\ + _hypre_seq_mv.h\ seq_mv.hpp\ vector.h @@ -77,10 +77,32 @@ CUFILES =\ csr_sptrans_device.c\ vector_device.c +# Mixed precision files +MP_FILES = \ + mup_fixed.c\ + mup_functions.c\ + mup_pre.c\ + seq_mv_mp.c + COBJS = ${FILES:.c=.o} CUOBJS = ${CUFILES:.c=.obj} OBJS = ${COBJS} ${CUOBJS} +ifeq (${MP_BUILD}, 1) + +COBJS_single = ${FILES:.c=.o_flt} +COBJS_double = ${FILES:.c=.o_dbl} +COBJS_longdouble = ${FILES:.c=.o_ldbl} +CUOBJS_single = ${CUFILES:.c=.obj_flt} +CUOBJS_double = ${CUFILES:.c=.obj_dbl} +CUOBJS_longdouble = ${CUFILES:.c=.obj_ldbl} +MP_COBJS = ${MP_FILES:.c=.o} + +OBJS = ${COBJS_single} ${COBJS_double} ${COBJS_longdouble} ${MP_COBJS} +OBJS += ${CUOBJS_single} ${CUOBJS_double} ${CUOBJS_longdouble} + +endif + SONAME = libHYPRE_seq_mv-${HYPRE_RELEASE_VERSION}${HYPRE_LIB_SUFFIX} ################################################################## @@ -93,16 +115,18 @@ all: lib: libHYPRE_seq_mv${HYPRE_LIB_SUFFIX} cp -fR $(srcdir)/HYPRE_*.h $(HYPRE_BUILD_DIR)/include - cp -fR $(srcdir)/seq_mv.h $(HYPRE_BUILD_DIR)/include + cp -fR $(srcdir)/_hypre_*.h $(HYPRE_BUILD_DIR)/include # cp -fR libHYPRE* $(HYPRE_BUILD_DIR)/lib install: libHYPRE_seq_mv${HYPRE_LIB_SUFFIX} cp -fR $(srcdir)/HYPRE_*.h $(HYPRE_INC_INSTALL) - cp -fR $(srcdir)/seq_mv.h $(HYPRE_INC_INSTALL) + cp -fR $(srcdir)/_hypre_*.h $(HYPRE_INC_INSTALL) # cp -fR libHYPRE* $(HYPRE_LIB_INSTALL) clean: deleteautogen rm -f *.o *.obj libHYPRE* + rm -f *.o_flt *.o_dbl *.o_ldbl + rm -f *.obj_flt *.obj_dbl *.obj_ldbl rm -rf pchdir tca.map *inslog* distclean: clean diff --git a/src/seq_mv/_hypre_seq_mv.h b/src/seq_mv/_hypre_seq_mv.h new file mode 100644 index 0000000000..41807fda06 --- /dev/null +++ b/src/seq_mv/_hypre_seq_mv.h @@ -0,0 +1,726 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use 'headers' to generate) ***/ + +#ifndef hypre_SEQ_MV_HEADER +#define hypre_SEQ_MV_HEADER + +#include +#include +#include + +#include + +#include "HYPRE_seq_mv.h" + +#include "_hypre_utilities.h" + +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_seq_mv_mup_def.h" +#endif + +#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) + ******************************************************************************/ + +/****************************************************************************** + * + * Header info for CSR Matrix data structures + * + * Note: this matrix currently uses 0-based indexing. + * + *****************************************************************************/ + +#ifndef hypre_CSR_MATRIX_HEADER +#define hypre_CSR_MATRIX_HEADER + +#if defined(HYPRE_USING_CUSPARSE) ||\ + defined(HYPRE_USING_ROCSPARSE) ||\ + defined(HYPRE_USING_ONEMKLSPARSE) +struct hypre_CsrsvData; +typedef struct hypre_CsrsvData hypre_CsrsvData; + +struct hypre_GpuMatData; +typedef struct hypre_GpuMatData hypre_GpuMatData; +#endif + +/*-------------------------------------------------------------------------- + * CSR Matrix + *--------------------------------------------------------------------------*/ + +typedef struct +{ + HYPRE_Int *i; + HYPRE_Int *j; + HYPRE_BigInt *big_j; + HYPRE_Int num_rows; + HYPRE_Int num_cols; + HYPRE_Int num_nonzeros; + hypre_int *i_short; + hypre_int *j_short; + HYPRE_Int owns_data; /* Does the CSRMatrix create/destroy `j`, `big_j`, and `data'? */ + 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) ||\ + 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; +#endif + +#if defined(HYPRE_MIXED_PRECISION) + HYPRE_Precision matrix_precision; +#endif +} hypre_CSRMatrix; + +/*-------------------------------------------------------------------------- + * Accessor functions for the CSR Matrix structure + *--------------------------------------------------------------------------*/ + +#define hypre_CSRMatrixData(matrix) ((matrix) -> data) +#define hypre_CSRMatrixI(matrix) ((matrix) -> i) +#define hypre_CSRMatrixJ(matrix) ((matrix) -> j) +#define hypre_CSRMatrixBigJ(matrix) ((matrix) -> big_j) +#define hypre_CSRMatrixNumRows(matrix) ((matrix) -> num_rows) +#define hypre_CSRMatrixNumCols(matrix) ((matrix) -> num_cols) +#define hypre_CSRMatrixNumNonzeros(matrix) ((matrix) -> num_nonzeros) +#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) ||\ + 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) +#define hypre_CSRMatrixGPUMatData(matrix) ((matrix) -> mat_data) +#endif + +#ifdef HYPRE_MIXED_PRECISION +#define hypre_CSRMatrixPrecision(matrix) ((matrix) -> matrix_precision) +#endif + +/*-------------------------------------------------------------------------- + * CSR Boolean Matrix + *--------------------------------------------------------------------------*/ + +typedef struct +{ + HYPRE_Int *i; + HYPRE_Int *j; + HYPRE_BigInt *big_j; + HYPRE_Int num_rows; + HYPRE_Int num_cols; + HYPRE_Int num_nonzeros; + HYPRE_Int owns_data; + +} hypre_CSRBooleanMatrix; + +/*-------------------------------------------------------------------------- + * Accessor functions for the CSR Boolean Matrix structure + *--------------------------------------------------------------------------*/ + +#define hypre_CSRBooleanMatrix_Get_I(matrix) ((matrix)->i) +#define hypre_CSRBooleanMatrix_Get_J(matrix) ((matrix)->j) +#define hypre_CSRBooleanMatrix_Get_BigJ(matrix) ((matrix)->big_j) +#define hypre_CSRBooleanMatrix_Get_NRows(matrix) ((matrix)->num_rows) +#define hypre_CSRBooleanMatrix_Get_NCols(matrix) ((matrix)->num_cols) +#define hypre_CSRBooleanMatrix_Get_NNZ(matrix) ((matrix)->num_nonzeros) +#define hypre_CSRBooleanMatrix_Get_OwnsData(matrix) ((matrix)->owns_data) + +#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) + ******************************************************************************/ + +/****************************************************************************** + * + * Header info for Mapped Matrix data structures + * + *****************************************************************************/ + +#ifndef hypre_MAPPED_MATRIX_HEADER +#define hypre_MAPPED_MATRIX_HEADER + +/*-------------------------------------------------------------------------- + * Mapped Matrix + *--------------------------------------------------------------------------*/ + +typedef struct +{ + void *matrix; + HYPRE_Int (*ColMap)(HYPRE_Int, void *); + void *MapData; + +} hypre_MappedMatrix; + +/*-------------------------------------------------------------------------- + * Accessor functions for the Mapped Matrix structure + *--------------------------------------------------------------------------*/ + +#define hypre_MappedMatrixMatrix(matrix) ((matrix) -> matrix) +#define hypre_MappedMatrixColMap(matrix) ((matrix) -> ColMap) +#define hypre_MappedMatrixMapData(matrix) ((matrix) -> MapData) + +#define hypre_MappedMatrixColIndex(matrix,j) \ + (hypre_MappedMatrixColMap(matrix)(j,hypre_MappedMatrixMapData(matrix))) + +#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) + ******************************************************************************/ + +/****************************************************************************** + * + * Header info for Multiblock Matrix data structures + * + *****************************************************************************/ + +#ifndef hypre_MULTIBLOCK_MATRIX_HEADER +#define hypre_MULTIBLOCK_MATRIX_HEADER + +/*-------------------------------------------------------------------------- + * Multiblock Matrix + *--------------------------------------------------------------------------*/ + +typedef struct +{ + HYPRE_Int num_submatrices; + HYPRE_Int *submatrix_types; + void **submatrices; + +} hypre_MultiblockMatrix; + +/*-------------------------------------------------------------------------- + * Accessor functions for the Multiblock Matrix structure + *--------------------------------------------------------------------------*/ + +#define hypre_MultiblockMatrixSubmatrices(matrix) ((matrix) -> submatrices) +#define hypre_MultiblockMatrixNumSubmatrices(matrix) ((matrix) -> num_submatrices) +#define hypre_MultiblockMatrixSubmatrixTypes(matrix) ((matrix) -> submatrix_types) + +#define hypre_MultiblockMatrixSubmatrix(matrix,j) (hypre_MultiblockMatrixSubmatrices\ +(matrix)[j]) +#define hypre_MultiblockMatrixSubmatrixType(matrix,j) (hypre_MultiblockMatrixSubmatrixTypes\ +(matrix)[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) + ******************************************************************************/ + +/****************************************************************************** + * + * Header info for Vector data structure + * + *****************************************************************************/ + +#ifndef hypre_VECTOR_HEADER +#define hypre_VECTOR_HEADER + +/*-------------------------------------------------------------------------- + * hypre_Vector + *--------------------------------------------------------------------------*/ + +typedef struct +{ + 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) */ + HYPRE_Int owns_tags; /* Whether the vector owns the array of tags or not */ + HYPRE_Int num_tags; /* Number of unique tags */ + HYPRE_Int *tags; /* Array of tags with same size as vector */ + 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 */ + HYPRE_Int multivec_storage_method; + /* ...if 0, store colwise v0[0], v0[1], ..., v1[0], v1[1], ... v2[0]... */ + /* ...if 1, store rowwise v0[0], v1[0], ..., v0[1], v1[1], ... */ + /* With colwise storage, vj[i] = data[ j*size + i] + With rowwise storage, vj[i] = data[ j + num_vectors*i] */ + HYPRE_Int vecstride, idxstride; + /* ... so vj[i] = data[ j*vecstride + i*idxstride ] regardless of row_storage.*/ + +#if defined(HYPRE_MIXED_PRECISION) + HYPRE_Precision vector_precision; +#endif + +} hypre_Vector; + +/*-------------------------------------------------------------------------- + * Accessor functions for the Vector structure + *--------------------------------------------------------------------------*/ + +#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_VectorOwnsTags(vector) ((vector) -> owns_tags) +#define hypre_VectorNumTags(vector) ((vector) -> num_tags) +#define hypre_VectorTags(vector) ((vector) -> tags) +#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_VectorEntryI(vector, i) ((vector) -> data[i]) +#define hypre_VectorEntryIJ(vector, i, j) \ + ((vector) -> data[((vector) -> vecstride) * j + ((vector) -> idxstride) * i]) + +#if defined(HYPRE_MIXED_PRECISION) +#define hypre_VectorPrecision(vector) ((vector) -> vector_precision) +#endif + +#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) + ******************************************************************************/ + +/* 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 *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); +HYPRE_Int 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_CSRMatrixComputeColSum( hypre_CSRMatrix *A, HYPRE_Complex *col_sum, + HYPRE_Int type, HYPRE_Complex scal ); +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); +HYPRE_Int hypre_CSRMatrixTaggedFnorm( hypre_CSRMatrix *A, HYPRE_Int num_tags, HYPRE_Int *tags, + HYPRE_Real **tnorms_ptr ); + +/* 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_CSRMatrix *hypre_CSRMatrixDeleteZerosDevice ( hypre_CSRMatrix *A, HYPRE_Real tol ); +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_CSRMatrixSetRownnzDevice( hypre_CSRMatrix *A ); +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_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_CSRMatrixComputeColSumDevice( hypre_CSRMatrix *A, HYPRE_Complex *col_sum, + HYPRE_Int type, HYPRE_Complex scal ); +HYPRE_Int hypre_CSRMatrixTaggedFnormDevice(hypre_CSRMatrix *A, HYPRE_Int num_tags, + HYPRE_Int *tags, HYPRE_Real *tnorms); +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_CSRMatrixPermuteDevice( hypre_CSRMatrix *A, HYPRE_Int *perm, + HYPRE_Int *rqperm, hypre_CSRMatrix *B ); +HYPRE_Int hypre_CSRMatrixSortRow(hypre_CSRMatrix *A); +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_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 ( 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_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_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_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_CSRMatrixGetLoadBalancedPartitionBegin( hypre_CSRMatrix *A ); +HYPRE_Int hypre_CSRMatrixGetLoadBalancedPartitionEnd( hypre_CSRMatrix *A ); +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_CSRMatrixEliminateRowsCols(hypre_CSRMatrix *A, HYPRE_Int nrows, HYPRE_Int *rows); + +/* 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 ); +// 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 ); + +/* 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_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 ); + +/* mapped_matrix.c */ +hypre_MappedMatrix *hypre_MappedMatrixCreate ( void ); +HYPRE_Int hypre_MappedMatrixDestroy ( hypre_MappedMatrix *matrix ); +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 ); +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 ); + +/* multiblock_matrix.c */ +hypre_MultiblockMatrix *hypre_MultiblockMatrixCreate ( void ); +HYPRE_Int hypre_MultiblockMatrixDestroy ( hypre_MultiblockMatrix *matrix ); +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 ); + +/* vector.c */ +hypre_Vector *hypre_SeqVectorCreate ( HYPRE_Int size ); +hypre_Vector *hypre_SeqMultiVectorCreate ( HYPRE_Int size, HYPRE_Int num_vectors ); +HYPRE_Int hypre_SeqVectorDestroy ( hypre_Vector *vector ); +HYPRE_Int hypre_SeqVectorInitializeShell( hypre_Vector *vector ); +HYPRE_Int hypre_SeqVectorSetData( hypre_Vector *vector, HYPRE_Complex *data ); +HYPRE_Int hypre_SeqVectorSetOwnsTags( hypre_Vector *vector, HYPRE_Int owns_tags ); +HYPRE_Int hypre_SeqVectorSetNumTags( hypre_Vector *vector, HYPRE_Int num_tags ); +HYPRE_Int hypre_SeqVectorSetTags( hypre_Vector *vector, + HYPRE_MemoryLocation memory_location, + HYPRE_Int *tags ); +HYPRE_Int hypre_SeqVectorSetValuesTagged( hypre_Vector *vector, HYPRE_Complex *values ); +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_SeqVectorSetSize ( hypre_Vector *vector, HYPRE_Int size ); +HYPRE_Int hypre_SeqVectorResize ( hypre_Vector *vector, HYPRE_Int size_in, + 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_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_SeqVectorCopyTags ( 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_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_Int hypre_SeqVectorInnerProdTagged( hypre_Vector *x, hypre_Vector *y, HYPRE_Complex *iprod ); +HYPRE_Complex hypre_SeqVectorSumElts ( hypre_Vector *vector ); +HYPRE_Complex hypre_SeqVectorSumEltsHost ( hypre_Vector *vector ); +HYPRE_Int hypre_SeqVectorPointwiseDivpy( hypre_Vector *x, hypre_Vector *b, hypre_Vector *y ); +HYPRE_Int hypre_SeqVectorPointwiseDivpyMarked( hypre_Vector *x, hypre_Vector *b, hypre_Vector *y, + HYPRE_Int *marker, HYPRE_Int marker_val ); +HYPRE_Int hypre_SeqVectorPointwiseProduct( hypre_Vector *x, hypre_Vector *y, hypre_Vector **z_ptr ); +HYPRE_Int hypre_SeqVectorPointwiseDivision( hypre_Vector *x, hypre_Vector *y, + hypre_Vector **z_ptr ); +HYPRE_Int hypre_SeqVectorPointwiseInverse( hypre_Vector *x, hypre_Vector **y_ptr ); +//HYPRE_Int hypre_SeqVectorMax( HYPRE_Complex alpha, hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *y ); + +/* csr_spadd_device.c */ +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); + +/* csr_sptrans_device.c */ +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_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_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); + +/* csr_spgemm_device.c */ +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); + +/* csr_spmv_device.c */ +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(); +HYPRE_Int hypre_CsrsvDataDestroy(hypre_CsrsvData *data); +hypre_GpuMatData* hypre_GpuMatDataCreate(); +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_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 + +HYPRE_Int hypre_CSRMatrixSpMVAnalysisDevice(hypre_CSRMatrix *matrix); + +/* vector_device.c */ +HYPRE_Int hypre_SeqVectorSetConstantValuesDevice ( hypre_Vector *v, HYPRE_Complex value ); +HYPRE_Int hypre_SeqVectorSetValuesTaggedDevice( hypre_Vector *vector, HYPRE_Complex *values ); +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_SeqVectorPointwiseDivpyDevice( hypre_Vector *x, hypre_Vector *b, hypre_Vector *y, + HYPRE_Int *marker, HYPRE_Int marker_val ); +HYPRE_Int hypre_SeqVectorPointwiseProductDevice( hypre_Vector *x, hypre_Vector *y, + hypre_Vector *z ); +HYPRE_Int hypre_SeqVectorPointwiseDivisionDevice( hypre_Vector *x, hypre_Vector *y, + hypre_Vector *z ); +HYPRE_Int hypre_SeqVectorPointwiseInverseDevice( hypre_Vector *x, hypre_Vector *y ); +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); +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/* Mixed precision function protos */ + +/* seq_mv_mp.c */ + +#ifdef HYPRE_MIXED_PRECISION +HYPRE_Int +hypre_SeqVectorCopy_mp( hypre_Vector *x, + hypre_Vector *y ); + +HYPRE_Int +hypre_SeqVectorAxpy_mp( hypre_double alpha, + hypre_Vector *x, + hypre_Vector *y ); + +HYPRE_Int +hypre_CSRMatrixConvert_mp ( hypre_CSRMatrix *A, + HYPRE_Precision new_precision); + +HYPRE_Int +hypre_SeqVectorConvert_mp ( hypre_Vector *v, + HYPRE_Precision new_precision); + +#endif + +#ifdef __cplusplus +} +#endif + +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_seq_mv_mup_undef.h" +#include "_hypre_seq_mv_mup.h" +#endif +#endif + +#endif + diff --git a/src/seq_mv/_hypre_seq_mv_mup.h b/src/seq_mv/_hypre_seq_mv_mup.h new file mode 100644 index 0000000000..c9942ec19b --- /dev/null +++ b/src/seq_mv/_hypre_seq_mv_mup.h @@ -0,0 +1,928 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#ifndef hypre_SEQ_MV_MUP_HEADER +#define hypre_SEQ_MV_MUP_HEADER + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (HYPRE_MIXED_PRECISION) + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_CSRMatrix * +hypre_CSRMatrixAdd_flt( hypre_float alpha, hypre_CSRMatrix *A, hypre_float beta, hypre_CSRMatrix *B ); +hypre_CSRMatrix * +hypre_CSRMatrixAdd_dbl( hypre_double alpha, hypre_CSRMatrix *A, hypre_double beta, hypre_CSRMatrix *B ); +hypre_CSRMatrix * +hypre_CSRMatrixAdd_long_dbl( hypre_long_double alpha, hypre_CSRMatrix *A, hypre_long_double beta, hypre_CSRMatrix *B ); + +HYPRE_Int +hypre_CSRMatrixAddFirstPass_flt( 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_CSRMatrixAddFirstPass_dbl( 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_CSRMatrixAddFirstPass_long_dbl( 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_CSRMatrix * +hypre_CSRMatrixAddHost_flt( hypre_float alpha, hypre_CSRMatrix *A, hypre_float beta, hypre_CSRMatrix *B ); +hypre_CSRMatrix * +hypre_CSRMatrixAddHost_dbl( hypre_double alpha, hypre_CSRMatrix *A, hypre_double beta, hypre_CSRMatrix *B ); +hypre_CSRMatrix * +hypre_CSRMatrixAddHost_long_dbl( hypre_long_double alpha, hypre_CSRMatrix *A, hypre_long_double beta, hypre_CSRMatrix *B ); + +hypre_CSRMatrix * +hypre_CSRMatrixAddPartial_flt( hypre_CSRMatrix *A, hypre_CSRMatrix *B, HYPRE_Int *row_nums ); +hypre_CSRMatrix * +hypre_CSRMatrixAddPartial_dbl( hypre_CSRMatrix *A, hypre_CSRMatrix *B, HYPRE_Int *row_nums ); +hypre_CSRMatrix * +hypre_CSRMatrixAddPartial_long_dbl( hypre_CSRMatrix *A, hypre_CSRMatrix *B, HYPRE_Int *row_nums ); + +HYPRE_Int +hypre_CSRMatrixAddSecondPass_flt( HYPRE_Int firstrow, HYPRE_Int lastrow, HYPRE_Int *marker, HYPRE_Int *map_A2C, HYPRE_Int *map_B2C, HYPRE_Int *rownnz_C, hypre_float alpha, hypre_float beta, hypre_CSRMatrix *A, hypre_CSRMatrix *B, hypre_CSRMatrix *C ); +HYPRE_Int +hypre_CSRMatrixAddSecondPass_dbl( HYPRE_Int firstrow, HYPRE_Int lastrow, HYPRE_Int *marker, HYPRE_Int *map_A2C, HYPRE_Int *map_B2C, HYPRE_Int *rownnz_C, hypre_double alpha, hypre_double beta, hypre_CSRMatrix *A, hypre_CSRMatrix *B, hypre_CSRMatrix *C ); +HYPRE_Int +hypre_CSRMatrixAddSecondPass_long_dbl( HYPRE_Int firstrow, HYPRE_Int lastrow, HYPRE_Int *marker, HYPRE_Int *map_A2C, HYPRE_Int *map_B2C, HYPRE_Int *rownnz_C, hypre_long_double alpha, hypre_long_double beta, hypre_CSRMatrix *A, hypre_CSRMatrix *B, hypre_CSRMatrix *C ); + +HYPRE_Int +hypre_CSRMatrixBigInitialize_flt( hypre_CSRMatrix *matrix ); +HYPRE_Int +hypre_CSRMatrixBigInitialize_dbl( hypre_CSRMatrix *matrix ); +HYPRE_Int +hypre_CSRMatrixBigInitialize_long_dbl( hypre_CSRMatrix *matrix ); + +HYPRE_Int +hypre_CSRMatrixBigJtoJ_flt( hypre_CSRMatrix *matrix ); +HYPRE_Int +hypre_CSRMatrixBigJtoJ_dbl( hypre_CSRMatrix *matrix ); +HYPRE_Int +hypre_CSRMatrixBigJtoJ_long_dbl( hypre_CSRMatrix *matrix ); + +HYPRE_Int +hypre_CSRMatrixCheckSetNumNonzeros_flt( hypre_CSRMatrix *matrix ); +HYPRE_Int +hypre_CSRMatrixCheckSetNumNonzeros_dbl( hypre_CSRMatrix *matrix ); +HYPRE_Int +hypre_CSRMatrixCheckSetNumNonzeros_long_dbl( hypre_CSRMatrix *matrix ); + +hypre_CSRMatrix * +hypre_CSRMatrixClone_flt( hypre_CSRMatrix *A, HYPRE_Int copy_data ); +hypre_CSRMatrix * +hypre_CSRMatrixClone_dbl( hypre_CSRMatrix *A, HYPRE_Int copy_data ); +hypre_CSRMatrix * +hypre_CSRMatrixClone_long_dbl( hypre_CSRMatrix *A, HYPRE_Int copy_data ); + +hypre_CSRMatrix * +hypre_CSRMatrixClone_v2_flt( hypre_CSRMatrix *A, HYPRE_Int copy_data, HYPRE_MemoryLocation memory_location ); +hypre_CSRMatrix * +hypre_CSRMatrixClone_v2_dbl( hypre_CSRMatrix *A, HYPRE_Int copy_data, HYPRE_MemoryLocation memory_location ); +hypre_CSRMatrix * +hypre_CSRMatrixClone_v2_long_dbl( hypre_CSRMatrix *A, HYPRE_Int copy_data, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +hypre_CSRMatrixComputeColSum_flt( hypre_CSRMatrix *A, hypre_float *col_sum, HYPRE_Int type, hypre_float scal ); +HYPRE_Int +hypre_CSRMatrixComputeColSum_dbl( hypre_CSRMatrix *A, hypre_double *col_sum, HYPRE_Int type, hypre_double scal ); +HYPRE_Int +hypre_CSRMatrixComputeColSum_long_dbl( hypre_CSRMatrix *A, hypre_long_double *col_sum, HYPRE_Int type, hypre_long_double scal ); + +HYPRE_Int +hypre_CSRMatrixComputeRowSum_flt( hypre_CSRMatrix *A, HYPRE_Int *CF_i, HYPRE_Int *CF_j, hypre_float *row_sum, HYPRE_Int type, hypre_float scal, const char *set_or_add ); +HYPRE_Int +hypre_CSRMatrixComputeRowSum_dbl( hypre_CSRMatrix *A, HYPRE_Int *CF_i, HYPRE_Int *CF_j, hypre_double *row_sum, HYPRE_Int type, hypre_double scal, const char *set_or_add ); +HYPRE_Int +hypre_CSRMatrixComputeRowSum_long_dbl( hypre_CSRMatrix *A, HYPRE_Int *CF_i, HYPRE_Int *CF_j, hypre_long_double *row_sum, HYPRE_Int type, hypre_long_double scal, const char *set_or_add ); + +HYPRE_Int +hypre_CSRMatrixCopy_flt( hypre_CSRMatrix *A, hypre_CSRMatrix *B, HYPRE_Int copy_data ); +HYPRE_Int +hypre_CSRMatrixCopy_dbl( hypre_CSRMatrix *A, hypre_CSRMatrix *B, HYPRE_Int copy_data ); +HYPRE_Int +hypre_CSRMatrixCopy_long_dbl( hypre_CSRMatrix *A, hypre_CSRMatrix *B, HYPRE_Int copy_data ); + +hypre_CSRMatrix * +hypre_CSRMatrixCreate_flt( HYPRE_Int num_rows, HYPRE_Int num_cols, HYPRE_Int num_nonzeros ); +hypre_CSRMatrix * +hypre_CSRMatrixCreate_dbl( HYPRE_Int num_rows, HYPRE_Int num_cols, HYPRE_Int num_nonzeros ); +hypre_CSRMatrix * +hypre_CSRMatrixCreate_long_dbl( HYPRE_Int num_rows, HYPRE_Int num_cols, HYPRE_Int num_nonzeros ); + +hypre_CSRMatrix * +hypre_CSRMatrixDeleteZeros_flt( hypre_CSRMatrix *A, hypre_float tol ); +hypre_CSRMatrix * +hypre_CSRMatrixDeleteZeros_dbl( hypre_CSRMatrix *A, hypre_double tol ); +hypre_CSRMatrix * +hypre_CSRMatrixDeleteZeros_long_dbl( hypre_CSRMatrix *A, hypre_long_double tol ); + +HYPRE_Int +hypre_CSRMatrixDestroy_flt( hypre_CSRMatrix *matrix ); +HYPRE_Int +hypre_CSRMatrixDestroy_dbl( hypre_CSRMatrix *matrix ); +HYPRE_Int +hypre_CSRMatrixDestroy_long_dbl( hypre_CSRMatrix *matrix ); + +HYPRE_Int +hypre_CSRMatrixDiagScale_flt( hypre_CSRMatrix *A, hypre_Vector *ld, hypre_Vector *rd ); +HYPRE_Int +hypre_CSRMatrixDiagScale_dbl( hypre_CSRMatrix *A, hypre_Vector *ld, hypre_Vector *rd ); +HYPRE_Int +hypre_CSRMatrixDiagScale_long_dbl( hypre_CSRMatrix *A, hypre_Vector *ld, hypre_Vector *rd ); + +HYPRE_Int +hypre_CSRMatrixEliminateRowsCols_flt( hypre_CSRMatrix *A, HYPRE_Int nrows, HYPRE_Int *rows ); +HYPRE_Int +hypre_CSRMatrixEliminateRowsCols_dbl( hypre_CSRMatrix *A, HYPRE_Int nrows, HYPRE_Int *rows ); +HYPRE_Int +hypre_CSRMatrixEliminateRowsCols_long_dbl( hypre_CSRMatrix *A, HYPRE_Int nrows, HYPRE_Int *rows ); + +HYPRE_Int +hypre_CSRMatrixExtractDiagonal_flt( hypre_CSRMatrix *A, hypre_float *d, HYPRE_Int type ); +HYPRE_Int +hypre_CSRMatrixExtractDiagonal_dbl( hypre_CSRMatrix *A, hypre_double *d, HYPRE_Int type ); +HYPRE_Int +hypre_CSRMatrixExtractDiagonal_long_dbl( hypre_CSRMatrix *A, hypre_long_double *d, HYPRE_Int type ); + +HYPRE_Int +hypre_CSRMatrixExtractDiagonalHost_flt( hypre_CSRMatrix *A, hypre_float *d, HYPRE_Int type ); +HYPRE_Int +hypre_CSRMatrixExtractDiagonalHost_dbl( hypre_CSRMatrix *A, hypre_double *d, HYPRE_Int type ); +HYPRE_Int +hypre_CSRMatrixExtractDiagonalHost_long_dbl( hypre_CSRMatrix *A, hypre_long_double *d, HYPRE_Int type ); + +HYPRE_Real +hypre_CSRMatrixFnorm_flt( hypre_CSRMatrix *A ); +HYPRE_Real +hypre_CSRMatrixFnorm_dbl( hypre_CSRMatrix *A ); +HYPRE_Real +hypre_CSRMatrixFnorm_long_dbl( hypre_CSRMatrix *A ); + +HYPRE_Int +hypre_CSRMatrixGetLoadBalancedPartitionBegin_flt( hypre_CSRMatrix *A ); +HYPRE_Int +hypre_CSRMatrixGetLoadBalancedPartitionBegin_dbl( hypre_CSRMatrix *A ); +HYPRE_Int +hypre_CSRMatrixGetLoadBalancedPartitionBegin_long_dbl( hypre_CSRMatrix *A ); + +HYPRE_Int +hypre_CSRMatrixGetLoadBalancedPartitionEnd_flt( hypre_CSRMatrix *A ); +HYPRE_Int +hypre_CSRMatrixGetLoadBalancedPartitionEnd_dbl( hypre_CSRMatrix *A ); +HYPRE_Int +hypre_CSRMatrixGetLoadBalancedPartitionEnd_long_dbl( hypre_CSRMatrix *A ); + +HYPRE_Int +hypre_CSRMatrixInitialize_flt( hypre_CSRMatrix *matrix ); +HYPRE_Int +hypre_CSRMatrixInitialize_dbl( hypre_CSRMatrix *matrix ); +HYPRE_Int +hypre_CSRMatrixInitialize_long_dbl( hypre_CSRMatrix *matrix ); + +HYPRE_Int +hypre_CSRMatrixInitialize_v2_flt( hypre_CSRMatrix *matrix, HYPRE_Int bigInit, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_CSRMatrixInitialize_v2_dbl( hypre_CSRMatrix *matrix, HYPRE_Int bigInit, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_CSRMatrixInitialize_v2_long_dbl( hypre_CSRMatrix *matrix, HYPRE_Int bigInit, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +hypre_CSRMatrixJtoBigJ_flt( hypre_CSRMatrix *matrix ); +HYPRE_Int +hypre_CSRMatrixJtoBigJ_dbl( hypre_CSRMatrix *matrix ); +HYPRE_Int +hypre_CSRMatrixJtoBigJ_long_dbl( hypre_CSRMatrix *matrix ); + +HYPRE_Int +hypre_CSRMatrixMatvec_flt( hypre_float alpha, hypre_CSRMatrix *A, hypre_Vector *x, hypre_float beta, hypre_Vector *y ); +HYPRE_Int +hypre_CSRMatrixMatvec_dbl( hypre_double alpha, hypre_CSRMatrix *A, hypre_Vector *x, hypre_double beta, hypre_Vector *y ); +HYPRE_Int +hypre_CSRMatrixMatvec_long_dbl( hypre_long_double alpha, hypre_CSRMatrix *A, hypre_Vector *x, hypre_long_double beta, hypre_Vector *y ); + +HYPRE_Int +hypre_CSRMatrixMatvecOutOfPlace_flt( hypre_float alpha, hypre_CSRMatrix *A, hypre_Vector *x, hypre_float beta, hypre_Vector *b, hypre_Vector *y, HYPRE_Int offset ); +HYPRE_Int +hypre_CSRMatrixMatvecOutOfPlace_dbl( hypre_double alpha, hypre_CSRMatrix *A, hypre_Vector *x, hypre_double beta, hypre_Vector *b, hypre_Vector *y, HYPRE_Int offset ); +HYPRE_Int +hypre_CSRMatrixMatvecOutOfPlace_long_dbl( hypre_long_double alpha, hypre_CSRMatrix *A, hypre_Vector *x, hypre_long_double beta, hypre_Vector *b, hypre_Vector *y, HYPRE_Int offset ); + +HYPRE_Int +hypre_CSRMatrixMatvecT_flt( hypre_float alpha, hypre_CSRMatrix *A, hypre_Vector *x, hypre_float beta, hypre_Vector *y ); +HYPRE_Int +hypre_CSRMatrixMatvecT_dbl( hypre_double alpha, hypre_CSRMatrix *A, hypre_Vector *x, hypre_double beta, hypre_Vector *y ); +HYPRE_Int +hypre_CSRMatrixMatvecT_long_dbl( hypre_long_double alpha, hypre_CSRMatrix *A, hypre_Vector *x, hypre_long_double beta, hypre_Vector *y ); + +HYPRE_Int +hypre_CSRMatrixMatvec_FF_flt( hypre_float alpha, hypre_CSRMatrix *A, hypre_Vector *x, hypre_float beta, hypre_Vector *y, HYPRE_Int *CF_marker_x, HYPRE_Int *CF_marker_y, HYPRE_Int fpt ); +HYPRE_Int +hypre_CSRMatrixMatvec_FF_dbl( hypre_double alpha, hypre_CSRMatrix *A, hypre_Vector *x, hypre_double beta, hypre_Vector *y, HYPRE_Int *CF_marker_x, HYPRE_Int *CF_marker_y, HYPRE_Int fpt ); +HYPRE_Int +hypre_CSRMatrixMatvec_FF_long_dbl( hypre_long_double alpha, hypre_CSRMatrix *A, hypre_Vector *x, hypre_long_double beta, hypre_Vector *y, HYPRE_Int *CF_marker_x, HYPRE_Int *CF_marker_y, HYPRE_Int fpt ); + +HYPRE_Int +hypre_CSRMatrixMigrate_flt( hypre_CSRMatrix *A, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_CSRMatrixMigrate_dbl( hypre_CSRMatrix *A, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_CSRMatrixMigrate_long_dbl( hypre_CSRMatrix *A, HYPRE_MemoryLocation memory_location ); + +hypre_CSRMatrix * +hypre_CSRMatrixMultiply_flt( hypre_CSRMatrix *A, hypre_CSRMatrix *B ); +hypre_CSRMatrix * +hypre_CSRMatrixMultiply_dbl( hypre_CSRMatrix *A, hypre_CSRMatrix *B ); +hypre_CSRMatrix * +hypre_CSRMatrixMultiply_long_dbl( hypre_CSRMatrix *A, hypre_CSRMatrix *B ); + +hypre_CSRMatrix * +hypre_CSRMatrixMultiplyHost_flt( hypre_CSRMatrix *A, hypre_CSRMatrix *B ); +hypre_CSRMatrix * +hypre_CSRMatrixMultiplyHost_dbl( hypre_CSRMatrix *A, hypre_CSRMatrix *B ); +hypre_CSRMatrix * +hypre_CSRMatrixMultiplyHost_long_dbl( hypre_CSRMatrix *A, hypre_CSRMatrix *B ); + +HYPRE_Int +hypre_CSRMatrixPermute_flt( hypre_CSRMatrix *A, HYPRE_Int *perm, HYPRE_Int *rqperm, hypre_CSRMatrix **B_ptr ); +HYPRE_Int +hypre_CSRMatrixPermute_dbl( hypre_CSRMatrix *A, HYPRE_Int *perm, HYPRE_Int *rqperm, hypre_CSRMatrix **B_ptr ); +HYPRE_Int +hypre_CSRMatrixPermute_long_dbl( hypre_CSRMatrix *A, HYPRE_Int *perm, HYPRE_Int *rqperm, hypre_CSRMatrix **B_ptr ); + +HYPRE_Int +hypre_CSRMatrixPrefetch_flt( hypre_CSRMatrix *A, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_CSRMatrixPrefetch_dbl( hypre_CSRMatrix *A, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_CSRMatrixPrefetch_long_dbl( hypre_CSRMatrix *A, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +hypre_CSRMatrixPrint_flt( hypre_CSRMatrix *matrix, const char *file_name ); +HYPRE_Int +hypre_CSRMatrixPrint_dbl( hypre_CSRMatrix *matrix, const char *file_name ); +HYPRE_Int +hypre_CSRMatrixPrint_long_dbl( hypre_CSRMatrix *matrix, const char *file_name ); + +HYPRE_Int +hypre_CSRMatrixPrintHB_flt( hypre_CSRMatrix *matrix_input, char *file_name ); +HYPRE_Int +hypre_CSRMatrixPrintHB_dbl( hypre_CSRMatrix *matrix_input, char *file_name ); +HYPRE_Int +hypre_CSRMatrixPrintHB_long_dbl( hypre_CSRMatrix *matrix_input, char *file_name ); + +HYPRE_Int +hypre_CSRMatrixPrintIJ_flt( hypre_CSRMatrix *matrix, HYPRE_Int base_i, HYPRE_Int base_j, char *filename ); +HYPRE_Int +hypre_CSRMatrixPrintIJ_dbl( hypre_CSRMatrix *matrix, HYPRE_Int base_i, HYPRE_Int base_j, char *filename ); +HYPRE_Int +hypre_CSRMatrixPrintIJ_long_dbl( hypre_CSRMatrix *matrix, HYPRE_Int base_i, HYPRE_Int base_j, char *filename ); + +HYPRE_Int +hypre_CSRMatrixPrintMM_flt( hypre_CSRMatrix *matrix, HYPRE_Int basei, HYPRE_Int basej, HYPRE_Int trans, const char *file_name ); +HYPRE_Int +hypre_CSRMatrixPrintMM_dbl( hypre_CSRMatrix *matrix, HYPRE_Int basei, HYPRE_Int basej, HYPRE_Int trans, const char *file_name ); +HYPRE_Int +hypre_CSRMatrixPrintMM_long_dbl( hypre_CSRMatrix *matrix, HYPRE_Int basei, HYPRE_Int basej, HYPRE_Int trans, const char *file_name ); + +hypre_CSRMatrix * +hypre_CSRMatrixRead_flt( char *file_name ); +hypre_CSRMatrix * +hypre_CSRMatrixRead_dbl( char *file_name ); +hypre_CSRMatrix * +hypre_CSRMatrixRead_long_dbl( char *file_name ); + +HYPRE_Int +hypre_CSRMatrixReorder_flt( hypre_CSRMatrix *A ); +HYPRE_Int +hypre_CSRMatrixReorder_dbl( hypre_CSRMatrix *A ); +HYPRE_Int +hypre_CSRMatrixReorder_long_dbl( hypre_CSRMatrix *A ); + +HYPRE_Int +hypre_CSRMatrixResize_flt( hypre_CSRMatrix *matrix, HYPRE_Int new_num_rows, HYPRE_Int new_num_cols, HYPRE_Int new_num_nonzeros ); +HYPRE_Int +hypre_CSRMatrixResize_dbl( hypre_CSRMatrix *matrix, HYPRE_Int new_num_rows, HYPRE_Int new_num_cols, HYPRE_Int new_num_nonzeros ); +HYPRE_Int +hypre_CSRMatrixResize_long_dbl( hypre_CSRMatrix *matrix, HYPRE_Int new_num_rows, HYPRE_Int new_num_cols, HYPRE_Int new_num_nonzeros ); + +HYPRE_Int +hypre_CSRMatrixScale_flt( hypre_CSRMatrix *A, hypre_float scalar ); +HYPRE_Int +hypre_CSRMatrixScale_dbl( hypre_CSRMatrix *A, hypre_double scalar ); +HYPRE_Int +hypre_CSRMatrixScale_long_dbl( hypre_CSRMatrix *A, hypre_long_double scalar ); + +HYPRE_Int +hypre_CSRMatrixSetConstantValues_flt( hypre_CSRMatrix *A, hypre_float value ); +HYPRE_Int +hypre_CSRMatrixSetConstantValues_dbl( hypre_CSRMatrix *A, hypre_double value ); +HYPRE_Int +hypre_CSRMatrixSetConstantValues_long_dbl( hypre_CSRMatrix *A, hypre_long_double value ); + +HYPRE_Int +hypre_CSRMatrixSetDataOwner_flt( hypre_CSRMatrix *matrix, HYPRE_Int owns_data ); +HYPRE_Int +hypre_CSRMatrixSetDataOwner_dbl( hypre_CSRMatrix *matrix, HYPRE_Int owns_data ); +HYPRE_Int +hypre_CSRMatrixSetDataOwner_long_dbl( hypre_CSRMatrix *matrix, HYPRE_Int owns_data ); + +HYPRE_Int +hypre_CSRMatrixSetPatternOnly_flt( hypre_CSRMatrix *matrix, HYPRE_Int pattern_only ); +HYPRE_Int +hypre_CSRMatrixSetPatternOnly_dbl( hypre_CSRMatrix *matrix, HYPRE_Int pattern_only ); +HYPRE_Int +hypre_CSRMatrixSetPatternOnly_long_dbl( hypre_CSRMatrix *matrix, HYPRE_Int pattern_only ); + +HYPRE_Int +hypre_CSRMatrixSetRownnz_flt( hypre_CSRMatrix *matrix ); +HYPRE_Int +hypre_CSRMatrixSetRownnz_dbl( hypre_CSRMatrix *matrix ); +HYPRE_Int +hypre_CSRMatrixSetRownnz_long_dbl( hypre_CSRMatrix *matrix ); + +HYPRE_Int +hypre_CSRMatrixSplit_flt( 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_dbl( 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_long_dbl( 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 +hypre_CSRMatrixSumElts_flt( hypre_CSRMatrix *A ); +HYPRE_Complex +hypre_CSRMatrixSumElts_dbl( hypre_CSRMatrix *A ); +HYPRE_Complex +hypre_CSRMatrixSumElts_long_dbl( hypre_CSRMatrix *A ); + +HYPRE_Int +hypre_CSRMatrixTaggedFnorm_flt( hypre_CSRMatrix *A, HYPRE_Int num_tags, HYPRE_Int *tags, hypre_float **tnorms_ptr ); +HYPRE_Int +hypre_CSRMatrixTaggedFnorm_dbl( hypre_CSRMatrix *A, HYPRE_Int num_tags, HYPRE_Int *tags, hypre_double **tnorms_ptr ); +HYPRE_Int +hypre_CSRMatrixTaggedFnorm_long_dbl( hypre_CSRMatrix *A, HYPRE_Int num_tags, HYPRE_Int *tags, hypre_long_double **tnorms_ptr ); + +HYPRE_Int +hypre_CSRMatrixTranspose_flt( hypre_CSRMatrix *A, hypre_CSRMatrix **AT, HYPRE_Int data ); +HYPRE_Int +hypre_CSRMatrixTranspose_dbl( hypre_CSRMatrix *A, hypre_CSRMatrix **AT, HYPRE_Int data ); +HYPRE_Int +hypre_CSRMatrixTranspose_long_dbl( hypre_CSRMatrix *A, hypre_CSRMatrix **AT, HYPRE_Int data ); + +HYPRE_Int +hypre_CSRMatrixTransposeHost_flt( hypre_CSRMatrix *A, hypre_CSRMatrix **AT, HYPRE_Int data ); +HYPRE_Int +hypre_CSRMatrixTransposeHost_dbl( hypre_CSRMatrix *A, hypre_CSRMatrix **AT, HYPRE_Int data ); +HYPRE_Int +hypre_CSRMatrixTransposeHost_long_dbl( hypre_CSRMatrix *A, hypre_CSRMatrix **AT, HYPRE_Int data ); + +HYPRE_Int +hypre_CSRMatrixTruncateDiag_flt( hypre_CSRMatrix *A ); +HYPRE_Int +hypre_CSRMatrixTruncateDiag_dbl( hypre_CSRMatrix *A ); +HYPRE_Int +hypre_CSRMatrixTruncateDiag_long_dbl( hypre_CSRMatrix *A ); + +hypre_CSRMatrix * +hypre_CSRMatrixUnion_flt( 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_CSRMatrixUnion_dbl( 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_CSRMatrixUnion_long_dbl( 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_GenerateLocalPartitioning_flt( HYPRE_BigInt length, HYPRE_Int num_procs, HYPRE_Int myid, HYPRE_BigInt *part ); +HYPRE_Int +hypre_GenerateLocalPartitioning_dbl( HYPRE_BigInt length, HYPRE_Int num_procs, HYPRE_Int myid, HYPRE_BigInt *part ); +HYPRE_Int +hypre_GenerateLocalPartitioning_long_dbl( HYPRE_BigInt length, HYPRE_Int num_procs, HYPRE_Int myid, HYPRE_BigInt *part ); + +HYPRE_Int +hypre_GeneratePartitioning_flt( HYPRE_BigInt length, HYPRE_Int num_procs, HYPRE_BigInt **part_ptr ); +HYPRE_Int +hypre_GeneratePartitioning_dbl( HYPRE_BigInt length, HYPRE_Int num_procs, HYPRE_BigInt **part_ptr ); +HYPRE_Int +hypre_GeneratePartitioning_long_dbl( HYPRE_BigInt length, HYPRE_Int num_procs, HYPRE_BigInt **part_ptr ); + +HYPRE_Int +hypre_MappedMatrixAssemble_flt( hypre_MappedMatrix *matrix ); +HYPRE_Int +hypre_MappedMatrixAssemble_dbl( hypre_MappedMatrix *matrix ); +HYPRE_Int +hypre_MappedMatrixAssemble_long_dbl( hypre_MappedMatrix *matrix ); + +hypre_MappedMatrix * +hypre_MappedMatrixCreate_flt( void ); +hypre_MappedMatrix * +hypre_MappedMatrixCreate_dbl( void ); +hypre_MappedMatrix * +hypre_MappedMatrixCreate_long_dbl( void ); + +HYPRE_Int +hypre_MappedMatrixDestroy_flt( hypre_MappedMatrix *matrix ); +HYPRE_Int +hypre_MappedMatrixDestroy_dbl( hypre_MappedMatrix *matrix ); +HYPRE_Int +hypre_MappedMatrixDestroy_long_dbl( hypre_MappedMatrix *matrix ); + +HYPRE_Int +hypre_MappedMatrixGetColIndex_flt( hypre_MappedMatrix *matrix, HYPRE_Int j ); +HYPRE_Int +hypre_MappedMatrixGetColIndex_dbl( hypre_MappedMatrix *matrix, HYPRE_Int j ); +HYPRE_Int +hypre_MappedMatrixGetColIndex_long_dbl( hypre_MappedMatrix *matrix, HYPRE_Int j ); + +void * +hypre_MappedMatrixGetMatrix_flt( hypre_MappedMatrix *matrix ); +void * +hypre_MappedMatrixGetMatrix_dbl( hypre_MappedMatrix *matrix ); +void * +hypre_MappedMatrixGetMatrix_long_dbl( hypre_MappedMatrix *matrix ); + +HYPRE_Int +hypre_MappedMatrixInitialize_flt( hypre_MappedMatrix *matrix ); +HYPRE_Int +hypre_MappedMatrixInitialize_dbl( hypre_MappedMatrix *matrix ); +HYPRE_Int +hypre_MappedMatrixInitialize_long_dbl( hypre_MappedMatrix *matrix ); + +HYPRE_Int +hypre_MappedMatrixLimitedDestroy_flt( hypre_MappedMatrix *matrix ); +HYPRE_Int +hypre_MappedMatrixLimitedDestroy_dbl( hypre_MappedMatrix *matrix ); +HYPRE_Int +hypre_MappedMatrixLimitedDestroy_long_dbl( hypre_MappedMatrix *matrix ); + +void +hypre_MappedMatrixPrint_flt( hypre_MappedMatrix *matrix ); +void +hypre_MappedMatrixPrint_dbl( hypre_MappedMatrix *matrix ); +void +hypre_MappedMatrixPrint_long_dbl( hypre_MappedMatrix *matrix ); + +HYPRE_Int +hypre_MappedMatrixSetMapData_flt( hypre_MappedMatrix *matrix, void *map_data ); +HYPRE_Int +hypre_MappedMatrixSetMapData_dbl( hypre_MappedMatrix *matrix, void *map_data ); +HYPRE_Int +hypre_MappedMatrixSetMapData_long_dbl( hypre_MappedMatrix *matrix, void *map_data ); + +HYPRE_Int +hypre_MappedMatrixSetMatrix_flt( hypre_MappedMatrix *matrix, void *matrix_data ); +HYPRE_Int +hypre_MappedMatrixSetMatrix_dbl( hypre_MappedMatrix *matrix, void *matrix_data ); +HYPRE_Int +hypre_MappedMatrixSetMatrix_long_dbl( hypre_MappedMatrix *matrix, void *matrix_data ); + +HYPRE_Int +hypre_MultiblockMatrixAssemble_flt( hypre_MultiblockMatrix *matrix ); +HYPRE_Int +hypre_MultiblockMatrixAssemble_dbl( hypre_MultiblockMatrix *matrix ); +HYPRE_Int +hypre_MultiblockMatrixAssemble_long_dbl( hypre_MultiblockMatrix *matrix ); + +hypre_MultiblockMatrix * +hypre_MultiblockMatrixCreate_flt( void ); +hypre_MultiblockMatrix * +hypre_MultiblockMatrixCreate_dbl( void ); +hypre_MultiblockMatrix * +hypre_MultiblockMatrixCreate_long_dbl( void ); + +HYPRE_Int +hypre_MultiblockMatrixDestroy_flt( hypre_MultiblockMatrix *matrix ); +HYPRE_Int +hypre_MultiblockMatrixDestroy_dbl( hypre_MultiblockMatrix *matrix ); +HYPRE_Int +hypre_MultiblockMatrixDestroy_long_dbl( hypre_MultiblockMatrix *matrix ); + +HYPRE_Int +hypre_MultiblockMatrixInitialize_flt( hypre_MultiblockMatrix *matrix ); +HYPRE_Int +hypre_MultiblockMatrixInitialize_dbl( hypre_MultiblockMatrix *matrix ); +HYPRE_Int +hypre_MultiblockMatrixInitialize_long_dbl( hypre_MultiblockMatrix *matrix ); + +HYPRE_Int +hypre_MultiblockMatrixLimitedDestroy_flt( hypre_MultiblockMatrix *matrix ); +HYPRE_Int +hypre_MultiblockMatrixLimitedDestroy_dbl( hypre_MultiblockMatrix *matrix ); +HYPRE_Int +hypre_MultiblockMatrixLimitedDestroy_long_dbl( hypre_MultiblockMatrix *matrix ); + +void +hypre_MultiblockMatrixPrint_flt( hypre_MultiblockMatrix *matrix ); +void +hypre_MultiblockMatrixPrint_dbl( hypre_MultiblockMatrix *matrix ); +void +hypre_MultiblockMatrixPrint_long_dbl( hypre_MultiblockMatrix *matrix ); + +HYPRE_Int +hypre_MultiblockMatrixSetNumSubmatrices_flt( hypre_MultiblockMatrix *matrix, HYPRE_Int n ); +HYPRE_Int +hypre_MultiblockMatrixSetNumSubmatrices_dbl( hypre_MultiblockMatrix *matrix, HYPRE_Int n ); +HYPRE_Int +hypre_MultiblockMatrixSetNumSubmatrices_long_dbl( hypre_MultiblockMatrix *matrix, HYPRE_Int n ); + +HYPRE_Int +hypre_MultiblockMatrixSetSubmatrix_flt( hypre_MultiblockMatrix *matrix, HYPRE_Int j, void *submatrix ); +HYPRE_Int +hypre_MultiblockMatrixSetSubmatrix_dbl( hypre_MultiblockMatrix *matrix, HYPRE_Int j, void *submatrix ); +HYPRE_Int +hypre_MultiblockMatrixSetSubmatrix_long_dbl( hypre_MultiblockMatrix *matrix, HYPRE_Int j, void *submatrix ); + +HYPRE_Int +hypre_MultiblockMatrixSetSubmatrixType_flt( hypre_MultiblockMatrix *matrix, HYPRE_Int j, HYPRE_Int type ); +HYPRE_Int +hypre_MultiblockMatrixSetSubmatrixType_dbl( hypre_MultiblockMatrix *matrix, HYPRE_Int j, HYPRE_Int type ); +HYPRE_Int +hypre_MultiblockMatrixSetSubmatrixType_long_dbl( hypre_MultiblockMatrix *matrix, HYPRE_Int j, HYPRE_Int type ); + +hypre_Vector * +hypre_SeqMultiVectorCreate_flt( HYPRE_Int size, HYPRE_Int num_vectors ); +hypre_Vector * +hypre_SeqMultiVectorCreate_dbl( HYPRE_Int size, HYPRE_Int num_vectors ); +hypre_Vector * +hypre_SeqMultiVectorCreate_long_dbl( HYPRE_Int size, HYPRE_Int num_vectors ); + +HYPRE_Int +hypre_SeqVectorAxpy_flt( hypre_float alpha, hypre_Vector *x, hypre_Vector *y ); +HYPRE_Int +hypre_SeqVectorAxpy_dbl( hypre_double alpha, hypre_Vector *x, hypre_Vector *y ); +HYPRE_Int +hypre_SeqVectorAxpy_long_dbl( hypre_long_double alpha, hypre_Vector *x, hypre_Vector *y ); + +HYPRE_Int +hypre_SeqVectorAxpyHost_flt( hypre_float alpha, hypre_Vector *x, hypre_Vector *y ); +HYPRE_Int +hypre_SeqVectorAxpyHost_dbl( hypre_double alpha, hypre_Vector *x, hypre_Vector *y ); +HYPRE_Int +hypre_SeqVectorAxpyHost_long_dbl( hypre_long_double alpha, hypre_Vector *x, hypre_Vector *y ); + +HYPRE_Int +hypre_SeqVectorAxpyz_flt( hypre_float alpha, hypre_Vector *x, hypre_float beta, hypre_Vector *y, hypre_Vector *z ); +HYPRE_Int +hypre_SeqVectorAxpyz_dbl( hypre_double alpha, hypre_Vector *x, hypre_double beta, hypre_Vector *y, hypre_Vector *z ); +HYPRE_Int +hypre_SeqVectorAxpyz_long_dbl( hypre_long_double alpha, hypre_Vector *x, hypre_long_double beta, hypre_Vector *y, hypre_Vector *z ); + +hypre_Vector * +hypre_SeqVectorCloneDeep_flt( hypre_Vector *x ); +hypre_Vector * +hypre_SeqVectorCloneDeep_dbl( hypre_Vector *x ); +hypre_Vector * +hypre_SeqVectorCloneDeep_long_dbl( hypre_Vector *x ); + +hypre_Vector * +hypre_SeqVectorCloneDeep_v2_flt( hypre_Vector *x, HYPRE_MemoryLocation memory_location ); +hypre_Vector * +hypre_SeqVectorCloneDeep_v2_dbl( hypre_Vector *x, HYPRE_MemoryLocation memory_location ); +hypre_Vector * +hypre_SeqVectorCloneDeep_v2_long_dbl( hypre_Vector *x, HYPRE_MemoryLocation memory_location ); + +hypre_Vector * +hypre_SeqVectorCloneShallow_flt( hypre_Vector *x ); +hypre_Vector * +hypre_SeqVectorCloneShallow_dbl( hypre_Vector *x ); +hypre_Vector * +hypre_SeqVectorCloneShallow_long_dbl( hypre_Vector *x ); + +HYPRE_Int +hypre_SeqVectorCopy_flt( hypre_Vector *x, hypre_Vector *y ); +HYPRE_Int +hypre_SeqVectorCopy_dbl( hypre_Vector *x, hypre_Vector *y ); +HYPRE_Int +hypre_SeqVectorCopy_long_dbl( hypre_Vector *x, hypre_Vector *y ); + +HYPRE_Int +hypre_SeqVectorCopyTags_flt( hypre_Vector *x, hypre_Vector *y ); +HYPRE_Int +hypre_SeqVectorCopyTags_dbl( hypre_Vector *x, hypre_Vector *y ); +HYPRE_Int +hypre_SeqVectorCopyTags_long_dbl( hypre_Vector *x, hypre_Vector *y ); + +hypre_Vector * +hypre_SeqVectorCreate_flt( HYPRE_Int size ); +hypre_Vector * +hypre_SeqVectorCreate_dbl( HYPRE_Int size ); +hypre_Vector * +hypre_SeqVectorCreate_long_dbl( HYPRE_Int size ); + +HYPRE_Int +hypre_SeqVectorDestroy_flt( hypre_Vector *vector ); +HYPRE_Int +hypre_SeqVectorDestroy_dbl( hypre_Vector *vector ); +HYPRE_Int +hypre_SeqVectorDestroy_long_dbl( hypre_Vector *vector ); + +HYPRE_Int +hypre_SeqVectorInitialize_flt( hypre_Vector *vector ); +HYPRE_Int +hypre_SeqVectorInitialize_dbl( hypre_Vector *vector ); +HYPRE_Int +hypre_SeqVectorInitialize_long_dbl( hypre_Vector *vector ); + +HYPRE_Int +hypre_SeqVectorInitializeShell_flt( hypre_Vector *vector ); +HYPRE_Int +hypre_SeqVectorInitializeShell_dbl( hypre_Vector *vector ); +HYPRE_Int +hypre_SeqVectorInitializeShell_long_dbl( hypre_Vector *vector ); + +HYPRE_Int +hypre_SeqVectorInitialize_v2_flt( hypre_Vector *vector, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_SeqVectorInitialize_v2_dbl( hypre_Vector *vector, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_SeqVectorInitialize_v2_long_dbl( hypre_Vector *vector, HYPRE_MemoryLocation memory_location ); + +HYPRE_Real +hypre_SeqVectorInnerProd_flt( hypre_Vector *x, hypre_Vector *y ); +HYPRE_Real +hypre_SeqVectorInnerProd_dbl( hypre_Vector *x, hypre_Vector *y ); +HYPRE_Real +hypre_SeqVectorInnerProd_long_dbl( hypre_Vector *x, hypre_Vector *y ); + +HYPRE_Real +hypre_SeqVectorInnerProdHost_flt( hypre_Vector *x, hypre_Vector *y ); +HYPRE_Real +hypre_SeqVectorInnerProdHost_dbl( hypre_Vector *x, hypre_Vector *y ); +HYPRE_Real +hypre_SeqVectorInnerProdHost_long_dbl( hypre_Vector *x, hypre_Vector *y ); + +HYPRE_Int +hypre_SeqVectorInnerProdTagged_flt( hypre_Vector *x, hypre_Vector *y, hypre_float *iprod ); +HYPRE_Int +hypre_SeqVectorInnerProdTagged_dbl( hypre_Vector *x, hypre_Vector *y, hypre_double *iprod ); +HYPRE_Int +hypre_SeqVectorInnerProdTagged_long_dbl( hypre_Vector *x, hypre_Vector *y, hypre_long_double *iprod ); + +HYPRE_Int +hypre_SeqVectorMassAxpy_flt( hypre_float *alpha, hypre_Vector **x, hypre_Vector *y, HYPRE_Int k, HYPRE_Int unroll ); +HYPRE_Int +hypre_SeqVectorMassAxpy_dbl( hypre_double *alpha, hypre_Vector **x, hypre_Vector *y, HYPRE_Int k, HYPRE_Int unroll ); +HYPRE_Int +hypre_SeqVectorMassAxpy_long_dbl( hypre_long_double *alpha, hypre_Vector **x, hypre_Vector *y, HYPRE_Int k, HYPRE_Int unroll ); + +HYPRE_Int +hypre_SeqVectorMassAxpy4_flt( hypre_float *alpha, hypre_Vector **x, hypre_Vector *y, HYPRE_Int k ); +HYPRE_Int +hypre_SeqVectorMassAxpy4_dbl( hypre_double *alpha, hypre_Vector **x, hypre_Vector *y, HYPRE_Int k ); +HYPRE_Int +hypre_SeqVectorMassAxpy4_long_dbl( hypre_long_double *alpha, hypre_Vector **x, hypre_Vector *y, HYPRE_Int k ); + +HYPRE_Int +hypre_SeqVectorMassAxpy8_flt( hypre_float *alpha, hypre_Vector **x, hypre_Vector *y, HYPRE_Int k ); +HYPRE_Int +hypre_SeqVectorMassAxpy8_dbl( hypre_double *alpha, hypre_Vector **x, hypre_Vector *y, HYPRE_Int k ); +HYPRE_Int +hypre_SeqVectorMassAxpy8_long_dbl( hypre_long_double *alpha, hypre_Vector **x, hypre_Vector *y, HYPRE_Int k ); + +HYPRE_Int +hypre_SeqVectorMassDotpTwo_flt( hypre_Vector *x, hypre_Vector *y, hypre_Vector **z, HYPRE_Int k, HYPRE_Int unroll, hypre_float *result_x, hypre_float *result_y ); +HYPRE_Int +hypre_SeqVectorMassDotpTwo_dbl( hypre_Vector *x, hypre_Vector *y, hypre_Vector **z, HYPRE_Int k, HYPRE_Int unroll, hypre_double *result_x, hypre_double *result_y ); +HYPRE_Int +hypre_SeqVectorMassDotpTwo_long_dbl( hypre_Vector *x, hypre_Vector *y, hypre_Vector **z, HYPRE_Int k, HYPRE_Int unroll, hypre_long_double *result_x, hypre_long_double *result_y ); + +HYPRE_Int +hypre_SeqVectorMassDotpTwo4_flt( hypre_Vector *x, hypre_Vector *y, hypre_Vector **z, HYPRE_Int k, hypre_float *result_x, hypre_float *result_y ); +HYPRE_Int +hypre_SeqVectorMassDotpTwo4_dbl( hypre_Vector *x, hypre_Vector *y, hypre_Vector **z, HYPRE_Int k, hypre_double *result_x, hypre_double *result_y ); +HYPRE_Int +hypre_SeqVectorMassDotpTwo4_long_dbl( hypre_Vector *x, hypre_Vector *y, hypre_Vector **z, HYPRE_Int k, hypre_long_double *result_x, hypre_long_double *result_y ); + +HYPRE_Int +hypre_SeqVectorMassDotpTwo8_flt( hypre_Vector *x, hypre_Vector *y, hypre_Vector **z, HYPRE_Int k, hypre_float *result_x, hypre_float *result_y ); +HYPRE_Int +hypre_SeqVectorMassDotpTwo8_dbl( hypre_Vector *x, hypre_Vector *y, hypre_Vector **z, HYPRE_Int k, hypre_double *result_x, hypre_double *result_y ); +HYPRE_Int +hypre_SeqVectorMassDotpTwo8_long_dbl( hypre_Vector *x, hypre_Vector *y, hypre_Vector **z, HYPRE_Int k, hypre_long_double *result_x, hypre_long_double *result_y ); + +HYPRE_Int +hypre_SeqVectorMassInnerProd_flt( hypre_Vector *x, hypre_Vector **y, HYPRE_Int k, HYPRE_Int unroll, hypre_float *result ); +HYPRE_Int +hypre_SeqVectorMassInnerProd_dbl( hypre_Vector *x, hypre_Vector **y, HYPRE_Int k, HYPRE_Int unroll, hypre_double *result ); +HYPRE_Int +hypre_SeqVectorMassInnerProd_long_dbl( hypre_Vector *x, hypre_Vector **y, HYPRE_Int k, HYPRE_Int unroll, hypre_long_double *result ); + +HYPRE_Int +hypre_SeqVectorMassInnerProd4_flt( hypre_Vector *x, hypre_Vector **y, HYPRE_Int k, hypre_float *result ); +HYPRE_Int +hypre_SeqVectorMassInnerProd4_dbl( hypre_Vector *x, hypre_Vector **y, HYPRE_Int k, hypre_double *result ); +HYPRE_Int +hypre_SeqVectorMassInnerProd4_long_dbl( hypre_Vector *x, hypre_Vector **y, HYPRE_Int k, hypre_long_double *result ); + +HYPRE_Int +hypre_SeqVectorMassInnerProd8_flt( hypre_Vector *x, hypre_Vector **y, HYPRE_Int k, hypre_float *result ); +HYPRE_Int +hypre_SeqVectorMassInnerProd8_dbl( hypre_Vector *x, hypre_Vector **y, HYPRE_Int k, hypre_double *result ); +HYPRE_Int +hypre_SeqVectorMassInnerProd8_long_dbl( hypre_Vector *x, hypre_Vector **y, HYPRE_Int k, hypre_long_double *result ); + +HYPRE_Int +hypre_SeqVectorMigrate_flt( hypre_Vector *x, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_SeqVectorMigrate_dbl( hypre_Vector *x, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_SeqVectorMigrate_long_dbl( hypre_Vector *x, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +hypre_SeqVectorPointwiseDivision_flt( hypre_Vector *x, hypre_Vector *y, hypre_Vector **z_ptr ); +HYPRE_Int +hypre_SeqVectorPointwiseDivision_dbl( hypre_Vector *x, hypre_Vector *y, hypre_Vector **z_ptr ); +HYPRE_Int +hypre_SeqVectorPointwiseDivision_long_dbl( hypre_Vector *x, hypre_Vector *y, hypre_Vector **z_ptr ); + +HYPRE_Int +hypre_SeqVectorPointwiseDivpy_flt( hypre_Vector *x, hypre_Vector *b, hypre_Vector *y ); +HYPRE_Int +hypre_SeqVectorPointwiseDivpy_dbl( hypre_Vector *x, hypre_Vector *b, hypre_Vector *y ); +HYPRE_Int +hypre_SeqVectorPointwiseDivpy_long_dbl( hypre_Vector *x, hypre_Vector *b, hypre_Vector *y ); + +HYPRE_Int +hypre_SeqVectorPointwiseDivpyMarked_flt( hypre_Vector *x, hypre_Vector *b, hypre_Vector *y, HYPRE_Int *marker, HYPRE_Int marker_val ); +HYPRE_Int +hypre_SeqVectorPointwiseDivpyMarked_dbl( hypre_Vector *x, hypre_Vector *b, hypre_Vector *y, HYPRE_Int *marker, HYPRE_Int marker_val ); +HYPRE_Int +hypre_SeqVectorPointwiseDivpyMarked_long_dbl( hypre_Vector *x, hypre_Vector *b, hypre_Vector *y, HYPRE_Int *marker, HYPRE_Int marker_val ); + +HYPRE_Int +hypre_SeqVectorPointwiseInverse_flt( hypre_Vector *x, hypre_Vector **y_ptr ); +HYPRE_Int +hypre_SeqVectorPointwiseInverse_dbl( hypre_Vector *x, hypre_Vector **y_ptr ); +HYPRE_Int +hypre_SeqVectorPointwiseInverse_long_dbl( hypre_Vector *x, hypre_Vector **y_ptr ); + +HYPRE_Int +hypre_SeqVectorPointwiseProduct_flt( hypre_Vector *x, hypre_Vector *y, hypre_Vector **z_ptr ); +HYPRE_Int +hypre_SeqVectorPointwiseProduct_dbl( hypre_Vector *x, hypre_Vector *y, hypre_Vector **z_ptr ); +HYPRE_Int +hypre_SeqVectorPointwiseProduct_long_dbl( hypre_Vector *x, hypre_Vector *y, hypre_Vector **z_ptr ); + +HYPRE_Int +hypre_SeqVectorPrint_flt( hypre_Vector *vector, char *file_name ); +HYPRE_Int +hypre_SeqVectorPrint_dbl( hypre_Vector *vector, char *file_name ); +HYPRE_Int +hypre_SeqVectorPrint_long_dbl( hypre_Vector *vector, char *file_name ); + +hypre_Vector * +hypre_SeqVectorRead_flt( char *file_name ); +hypre_Vector * +hypre_SeqVectorRead_dbl( char *file_name ); +hypre_Vector * +hypre_SeqVectorRead_long_dbl( char *file_name ); + +HYPRE_Int +hypre_SeqVectorResize_flt( hypre_Vector *vector, HYPRE_Int size_in, HYPRE_Int num_vectors_in ); +HYPRE_Int +hypre_SeqVectorResize_dbl( hypre_Vector *vector, HYPRE_Int size_in, HYPRE_Int num_vectors_in ); +HYPRE_Int +hypre_SeqVectorResize_long_dbl( hypre_Vector *vector, HYPRE_Int size_in, HYPRE_Int num_vectors_in ); + +HYPRE_Int +hypre_SeqVectorScale_flt( hypre_float alpha, hypre_Vector *y ); +HYPRE_Int +hypre_SeqVectorScale_dbl( hypre_double alpha, hypre_Vector *y ); +HYPRE_Int +hypre_SeqVectorScale_long_dbl( hypre_long_double alpha, hypre_Vector *y ); + +HYPRE_Int +hypre_SeqVectorScaleHost_flt( hypre_float alpha, hypre_Vector *y ); +HYPRE_Int +hypre_SeqVectorScaleHost_dbl( hypre_double alpha, hypre_Vector *y ); +HYPRE_Int +hypre_SeqVectorScaleHost_long_dbl( hypre_long_double alpha, hypre_Vector *y ); + +HYPRE_Int +hypre_SeqVectorSetConstantValues_flt( hypre_Vector *v, hypre_float value ); +HYPRE_Int +hypre_SeqVectorSetConstantValues_dbl( hypre_Vector *v, hypre_double value ); +HYPRE_Int +hypre_SeqVectorSetConstantValues_long_dbl( hypre_Vector *v, hypre_long_double value ); + +HYPRE_Int +hypre_SeqVectorSetConstantValuesHost_flt( hypre_Vector *v, hypre_float value ); +HYPRE_Int +hypre_SeqVectorSetConstantValuesHost_dbl( hypre_Vector *v, hypre_double value ); +HYPRE_Int +hypre_SeqVectorSetConstantValuesHost_long_dbl( hypre_Vector *v, hypre_long_double value ); + +HYPRE_Int +hypre_SeqVectorSetData_flt( hypre_Vector *vector, hypre_float *data ); +HYPRE_Int +hypre_SeqVectorSetData_dbl( hypre_Vector *vector, hypre_double *data ); +HYPRE_Int +hypre_SeqVectorSetData_long_dbl( hypre_Vector *vector, hypre_long_double *data ); + +HYPRE_Int +hypre_SeqVectorSetDataOwner_flt( hypre_Vector *vector, HYPRE_Int owns_data ); +HYPRE_Int +hypre_SeqVectorSetDataOwner_dbl( hypre_Vector *vector, HYPRE_Int owns_data ); +HYPRE_Int +hypre_SeqVectorSetDataOwner_long_dbl( hypre_Vector *vector, HYPRE_Int owns_data ); + +HYPRE_Int +hypre_SeqVectorSetNumTags_flt( hypre_Vector *vector, HYPRE_Int num_tags ); +HYPRE_Int +hypre_SeqVectorSetNumTags_dbl( hypre_Vector *vector, HYPRE_Int num_tags ); +HYPRE_Int +hypre_SeqVectorSetNumTags_long_dbl( hypre_Vector *vector, HYPRE_Int num_tags ); + +HYPRE_Int +hypre_SeqVectorSetOwnsTags_flt( hypre_Vector *vector, HYPRE_Int owns_tags ); +HYPRE_Int +hypre_SeqVectorSetOwnsTags_dbl( hypre_Vector *vector, HYPRE_Int owns_tags ); +HYPRE_Int +hypre_SeqVectorSetOwnsTags_long_dbl( hypre_Vector *vector, HYPRE_Int owns_tags ); + +HYPRE_Int +hypre_SeqVectorSetRandomValues_flt( hypre_Vector *v, HYPRE_Int seed ); +HYPRE_Int +hypre_SeqVectorSetRandomValues_dbl( hypre_Vector *v, HYPRE_Int seed ); +HYPRE_Int +hypre_SeqVectorSetRandomValues_long_dbl( hypre_Vector *v, HYPRE_Int seed ); + +HYPRE_Int +hypre_SeqVectorSetSize_flt( hypre_Vector *vector, HYPRE_Int size ); +HYPRE_Int +hypre_SeqVectorSetSize_dbl( hypre_Vector *vector, HYPRE_Int size ); +HYPRE_Int +hypre_SeqVectorSetSize_long_dbl( hypre_Vector *vector, HYPRE_Int size ); + +HYPRE_Int +hypre_SeqVectorSetTags_flt( hypre_Vector *vector, HYPRE_MemoryLocation memory_location, HYPRE_Int *tags ); +HYPRE_Int +hypre_SeqVectorSetTags_dbl( hypre_Vector *vector, HYPRE_MemoryLocation memory_location, HYPRE_Int *tags ); +HYPRE_Int +hypre_SeqVectorSetTags_long_dbl( hypre_Vector *vector, HYPRE_MemoryLocation memory_location, HYPRE_Int *tags ); + +HYPRE_Int +hypre_SeqVectorSetValuesTagged_flt( hypre_Vector *vector, hypre_float *values ); +HYPRE_Int +hypre_SeqVectorSetValuesTagged_dbl( hypre_Vector *vector, hypre_double *values ); +HYPRE_Int +hypre_SeqVectorSetValuesTagged_long_dbl( hypre_Vector *vector, hypre_long_double *values ); + +HYPRE_Int +hypre_SeqVectorStridedCopy_flt( hypre_Vector *x, HYPRE_Int istride, HYPRE_Int ostride, HYPRE_Int size, hypre_float *data ); +HYPRE_Int +hypre_SeqVectorStridedCopy_dbl( hypre_Vector *x, HYPRE_Int istride, HYPRE_Int ostride, HYPRE_Int size, hypre_double *data ); +HYPRE_Int +hypre_SeqVectorStridedCopy_long_dbl( hypre_Vector *x, HYPRE_Int istride, HYPRE_Int ostride, HYPRE_Int size, hypre_long_double *data ); + +HYPRE_Complex +hypre_SeqVectorSumElts_flt( hypre_Vector *vector ); +HYPRE_Complex +hypre_SeqVectorSumElts_dbl( hypre_Vector *vector ); +HYPRE_Complex +hypre_SeqVectorSumElts_long_dbl( hypre_Vector *vector ); + +HYPRE_Complex +hypre_SeqVectorSumEltsHost_flt( hypre_Vector *vector ); +HYPRE_Complex +hypre_SeqVectorSumEltsHost_dbl( hypre_Vector *vector ); +HYPRE_Complex +hypre_SeqVectorSumEltsHost_long_dbl( hypre_Vector *vector ); + + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + + + +#endif + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/src/seq_mv/_hypre_seq_mv_mup_def.h b/src/seq_mv/_hypre_seq_mv_mup_def.h new file mode 100644 index 0000000000..204b99edbb --- /dev/null +++ b/src/seq_mv/_hypre_seq_mv_mup_def.h @@ -0,0 +1,192 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#ifndef hypre_SEQ_MV_MUP_DEF_HEADER +#define hypre_SEQ_MV_MUP_DEF_HEADER + +#include "_hypre_mup_def.h" + +#define HYPRE_CSRMatrixCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_CSRMatrixCreate ) +#define HYPRE_CSRMatrixDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_CSRMatrixDestroy ) +#define HYPRE_CSRMatrixGetNumRows HYPRE_MULTIPRECISION_FUNC ( HYPRE_CSRMatrixGetNumRows ) +#define HYPRE_CSRMatrixInitialize HYPRE_MULTIPRECISION_FUNC ( HYPRE_CSRMatrixInitialize ) +#define HYPRE_CSRMatrixPrint HYPRE_MULTIPRECISION_FUNC ( HYPRE_CSRMatrixPrint ) +#define HYPRE_CSRMatrixRead HYPRE_MULTIPRECISION_FUNC ( HYPRE_CSRMatrixRead ) +#define HYPRE_MappedMatrixAssemble HYPRE_MULTIPRECISION_FUNC ( HYPRE_MappedMatrixAssemble ) +#define HYPRE_MappedMatrixCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_MappedMatrixCreate ) +#define HYPRE_MappedMatrixDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_MappedMatrixDestroy ) +#define HYPRE_MappedMatrixGetColIndex HYPRE_MULTIPRECISION_FUNC ( HYPRE_MappedMatrixGetColIndex ) +#define HYPRE_MappedMatrixGetMatrix HYPRE_MULTIPRECISION_FUNC ( HYPRE_MappedMatrixGetMatrix ) +#define HYPRE_MappedMatrixInitialize HYPRE_MULTIPRECISION_FUNC ( HYPRE_MappedMatrixInitialize ) +#define HYPRE_MappedMatrixLimitedDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_MappedMatrixLimitedDestroy ) +#define HYPRE_MappedMatrixPrint HYPRE_MULTIPRECISION_FUNC ( HYPRE_MappedMatrixPrint ) +#define HYPRE_MappedMatrixSetColMap HYPRE_MULTIPRECISION_FUNC ( HYPRE_MappedMatrixSetColMap ) +#define HYPRE_MappedMatrixSetMapData HYPRE_MULTIPRECISION_FUNC ( HYPRE_MappedMatrixSetMapData ) +#define HYPRE_MappedMatrixSetMatrix HYPRE_MULTIPRECISION_FUNC ( HYPRE_MappedMatrixSetMatrix ) +#define HYPRE_MultiblockMatrixAssemble HYPRE_MULTIPRECISION_FUNC ( HYPRE_MultiblockMatrixAssemble ) +#define HYPRE_MultiblockMatrixCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_MultiblockMatrixCreate ) +#define HYPRE_MultiblockMatrixDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_MultiblockMatrixDestroy ) +#define HYPRE_MultiblockMatrixInitialize HYPRE_MULTIPRECISION_FUNC ( HYPRE_MultiblockMatrixInitialize ) +#define HYPRE_MultiblockMatrixLimitedDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_MultiblockMatrixLimitedDestroy ) +#define HYPRE_MultiblockMatrixPrint HYPRE_MULTIPRECISION_FUNC ( HYPRE_MultiblockMatrixPrint ) +#define HYPRE_MultiblockMatrixSetNumSubmatrices HYPRE_MULTIPRECISION_FUNC ( HYPRE_MultiblockMatrixSetNumSubmatrices ) +#define HYPRE_MultiblockMatrixSetSubmatrixType HYPRE_MULTIPRECISION_FUNC ( HYPRE_MultiblockMatrixSetSubmatrixType ) +#define HYPRE_VectorCopy HYPRE_MULTIPRECISION_FUNC ( HYPRE_VectorCopy ) +#define HYPRE_VectorCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_VectorCreate ) +#define HYPRE_VectorDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_VectorDestroy ) +#define HYPRE_VectorInitialize HYPRE_MULTIPRECISION_FUNC ( HYPRE_VectorInitialize ) +#define HYPRE_VectorPrint HYPRE_MULTIPRECISION_FUNC ( HYPRE_VectorPrint ) +#define HYPRE_VectorRead HYPRE_MULTIPRECISION_FUNC ( HYPRE_VectorRead ) +#define hypre_CSRMatrixAdd HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixAdd ) +#define hypre_CSRMatrixAddFirstPass HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixAddFirstPass ) +#define hypre_CSRMatrixAddHost HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixAddHost ) +#define hypre_CSRMatrixAddPartial HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixAddPartial ) +#define hypre_CSRMatrixAddSecondPass HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixAddSecondPass ) +#define hypre_CSRMatrixBigInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixBigInitialize ) +#define hypre_CSRMatrixBigJtoJ HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixBigJtoJ ) +#define hypre_CSRMatrixCheckSetNumNonzeros HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixCheckSetNumNonzeros ) +#define hypre_CSRMatrixClone HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixClone ) +#define hypre_CSRMatrixClone_v2 HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixClone_v2 ) +#define hypre_CSRMatrixComputeColSum HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixComputeColSum ) +#define hypre_CSRMatrixComputeColSumHost HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixComputeColSumHost ) +#define hypre_CSRMatrixComputeRowSum HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixComputeRowSum ) +#define hypre_CSRMatrixComputeRowSumHost HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixComputeRowSumHost ) +#define hypre_CSRMatrixCopy HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixCopy ) +#define hypre_CSRMatrixCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixCreate ) +#define hypre_CSRMatrixDeleteZeros HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixDeleteZeros ) +#define hypre_CSRMatrixDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixDestroy ) +#define hypre_CSRMatrixDiagScale HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixDiagScale ) +#define hypre_CSRMatrixDiagScaleHost HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixDiagScaleHost ) +#define hypre_CSRMatrixEliminateRowsCols HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixEliminateRowsCols ) +#define hypre_CSRMatrixExtractDiagonal HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixExtractDiagonal ) +#define hypre_CSRMatrixExtractDiagonalHost HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixExtractDiagonalHost ) +#define hypre_CSRMatrixFnorm HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixFnorm ) +#define hypre_CSRMatrixGetLoadBalancedPartitionBegin HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixGetLoadBalancedPartitionBegin ) +#define hypre_CSRMatrixGetLoadBalancedPartitionEnd HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixGetLoadBalancedPartitionEnd ) +#define hypre_CSRMatrixInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixInitialize ) +#define hypre_CSRMatrixInitialize_v2 HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixInitialize_v2 ) +#define hypre_CSRMatrixJtoBigJ HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixJtoBigJ ) +#define hypre_CSRMatrixMatvec HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixMatvec ) +#define hypre_CSRMatrixMatvecOutOfPlace HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixMatvecOutOfPlace ) +#define hypre_CSRMatrixMatvecOutOfPlaceHost HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixMatvecOutOfPlaceHost ) +#define hypre_CSRMatrixMatvecT HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixMatvecT ) +#define hypre_CSRMatrixMatvecTHost HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixMatvecTHost ) +#define hypre_CSRMatrixMatvec_FF HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixMatvec_FF ) +#define hypre_CSRMatrixMigrate HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixMigrate ) +#define hypre_CSRMatrixMultiply HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixMultiply ) +#define hypre_CSRMatrixMultiplyHost HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixMultiplyHost ) +#define hypre_CSRMatrixPermute HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixPermute ) +#define hypre_CSRMatrixPermuteHost HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixPermuteHost ) +#define hypre_CSRMatrixPrefetch HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixPrefetch ) +#define hypre_CSRMatrixPrint HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixPrint ) +#define hypre_CSRMatrixPrintHB HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixPrintHB ) +#define hypre_CSRMatrixPrintIJ HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixPrintIJ ) +#define hypre_CSRMatrixPrintMM HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixPrintMM ) +#define hypre_CSRMatrixRead HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixRead ) +#define hypre_CSRMatrixReorder HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixReorder ) +#define hypre_CSRMatrixReorderHost HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixReorderHost ) +#define hypre_CSRMatrixResize HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixResize ) +#define hypre_CSRMatrixScale HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixScale ) +#define hypre_CSRMatrixSetConstantValues HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixSetConstantValues ) +#define hypre_CSRMatrixSetDataOwner HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixSetDataOwner ) +#define hypre_CSRMatrixSetPatternOnly HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixSetPatternOnly ) +#define hypre_CSRMatrixSetRownnz HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixSetRownnz ) +#define hypre_CSRMatrixSetRownnzHost HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixSetRownnzHost ) +#define hypre_CSRMatrixSplit HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixSplit ) +#define hypre_CSRMatrixSumElts HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixSumElts ) +#define hypre_CSRMatrixTaggedFnorm HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixTaggedFnorm ) +#define hypre_CSRMatrixTaggedFnormHost HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixTaggedFnormHost ) +#define hypre_CSRMatrixTranspose HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixTranspose ) +#define hypre_CSRMatrixTransposeHost HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixTransposeHost ) +#define hypre_CSRMatrixTruncateDiag HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixTruncateDiag ) +#define hypre_CSRMatrixUnion HYPRE_FIXEDPRECISION_FUNC ( hypre_CSRMatrixUnion ) +#define hypre_GenerateLocalPartitioning HYPRE_FIXEDPRECISION_FUNC ( hypre_GenerateLocalPartitioning ) +#define hypre_GeneratePartitioning HYPRE_FIXEDPRECISION_FUNC ( hypre_GeneratePartitioning ) +#define hypre_MappedMatrixAssemble HYPRE_FIXEDPRECISION_FUNC ( hypre_MappedMatrixAssemble ) +#define hypre_MappedMatrixCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_MappedMatrixCreate ) +#define hypre_MappedMatrixDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_MappedMatrixDestroy ) +#define hypre_MappedMatrixGetColIndex HYPRE_FIXEDPRECISION_FUNC ( hypre_MappedMatrixGetColIndex ) +#define hypre_MappedMatrixGetMatrix HYPRE_FIXEDPRECISION_FUNC ( hypre_MappedMatrixGetMatrix ) +#define hypre_MappedMatrixInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_MappedMatrixInitialize ) +#define hypre_MappedMatrixLimitedDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_MappedMatrixLimitedDestroy ) +#define hypre_MappedMatrixPrint HYPRE_FIXEDPRECISION_FUNC ( hypre_MappedMatrixPrint ) +#define hypre_MappedMatrixSetColMap HYPRE_FIXEDPRECISION_FUNC ( hypre_MappedMatrixSetColMap ) +#define hypre_MappedMatrixSetMapData HYPRE_FIXEDPRECISION_FUNC ( hypre_MappedMatrixSetMapData ) +#define hypre_MappedMatrixSetMatrix HYPRE_FIXEDPRECISION_FUNC ( hypre_MappedMatrixSetMatrix ) +#define hypre_MultiblockMatrixAssemble HYPRE_FIXEDPRECISION_FUNC ( hypre_MultiblockMatrixAssemble ) +#define hypre_MultiblockMatrixCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_MultiblockMatrixCreate ) +#define hypre_MultiblockMatrixDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_MultiblockMatrixDestroy ) +#define hypre_MultiblockMatrixInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_MultiblockMatrixInitialize ) +#define hypre_MultiblockMatrixLimitedDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_MultiblockMatrixLimitedDestroy ) +#define hypre_MultiblockMatrixPrint HYPRE_FIXEDPRECISION_FUNC ( hypre_MultiblockMatrixPrint ) +#define hypre_MultiblockMatrixSetNumSubmatrices HYPRE_FIXEDPRECISION_FUNC ( hypre_MultiblockMatrixSetNumSubmatrices ) +#define hypre_MultiblockMatrixSetSubmatrix HYPRE_FIXEDPRECISION_FUNC ( hypre_MultiblockMatrixSetSubmatrix ) +#define hypre_MultiblockMatrixSetSubmatrixType HYPRE_FIXEDPRECISION_FUNC ( hypre_MultiblockMatrixSetSubmatrixType ) +#define hypre_SeqMultiVectorCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqMultiVectorCreate ) +#define hypre_SeqVectorAxpy HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorAxpy ) +#define hypre_SeqVectorAxpyHost HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorAxpyHost ) +#define hypre_SeqVectorAxpyz HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorAxpyz ) +#define hypre_SeqVectorAxpyzHost HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorAxpyzHost ) +#define hypre_SeqVectorCloneDeep HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorCloneDeep ) +#define hypre_SeqVectorCloneDeep_v2 HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorCloneDeep_v2 ) +#define hypre_SeqVectorCloneShallow HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorCloneShallow ) +#define hypre_SeqVectorCopy HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorCopy ) +#define hypre_SeqVectorCopyTags HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorCopyTags ) +#define hypre_SeqVectorCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorCreate ) +#define hypre_SeqVectorDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorDestroy ) +#define hypre_SeqVectorInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorInitialize ) +#define hypre_SeqVectorInitializeShell HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorInitializeShell ) +#define hypre_SeqVectorInitialize_v2 HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorInitialize_v2 ) +#define hypre_SeqVectorInnerProd HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorInnerProd ) +#define hypre_SeqVectorInnerProdHost HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorInnerProdHost ) +#define hypre_SeqVectorInnerProdTagged HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorInnerProdTagged ) +#define hypre_SeqVectorInnerProdTaggedHost HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorInnerProdTaggedHost ) +#define hypre_SeqVectorMassAxpy HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorMassAxpy ) +#define hypre_SeqVectorMassAxpy4 HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorMassAxpy4 ) +#define hypre_SeqVectorMassAxpy8 HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorMassAxpy8 ) +#define hypre_SeqVectorMassDotpTwo HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorMassDotpTwo ) +#define hypre_SeqVectorMassDotpTwo4 HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorMassDotpTwo4 ) +#define hypre_SeqVectorMassDotpTwo8 HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorMassDotpTwo8 ) +#define hypre_SeqVectorMassInnerProd HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorMassInnerProd ) +#define hypre_SeqVectorMassInnerProd4 HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorMassInnerProd4 ) +#define hypre_SeqVectorMassInnerProd8 HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorMassInnerProd8 ) +#define hypre_SeqVectorMigrate HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorMigrate ) +#define hypre_SeqVectorPointwiseDivision HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorPointwiseDivision ) +#define hypre_SeqVectorPointwiseDivisionHost HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorPointwiseDivisionHost ) +#define hypre_SeqVectorPointwiseDivpy HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorPointwiseDivpy ) +#define hypre_SeqVectorPointwiseDivpyHost HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorPointwiseDivpyHost ) +#define hypre_SeqVectorPointwiseDivpyMarked HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorPointwiseDivpyMarked ) +#define hypre_SeqVectorPointwiseInverse HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorPointwiseInverse ) +#define hypre_SeqVectorPointwiseInverseHost HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorPointwiseInverseHost ) +#define hypre_SeqVectorPointwiseProduct HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorPointwiseProduct ) +#define hypre_SeqVectorPointwiseProductHost HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorPointwiseProductHost ) +#define hypre_SeqVectorPrint HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorPrint ) +#define hypre_SeqVectorRead HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorRead ) +#define hypre_SeqVectorResize HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorResize ) +#define hypre_SeqVectorScale HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorScale ) +#define hypre_SeqVectorScaleHost HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorScaleHost ) +#define hypre_SeqVectorSetConstantValues HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorSetConstantValues ) +#define hypre_SeqVectorSetConstantValuesHost HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorSetConstantValuesHost ) +#define hypre_SeqVectorSetData HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorSetData ) +#define hypre_SeqVectorSetDataOwner HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorSetDataOwner ) +#define hypre_SeqVectorSetNumTags HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorSetNumTags ) +#define hypre_SeqVectorSetOwnsTags HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorSetOwnsTags ) +#define hypre_SeqVectorSetRandomValues HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorSetRandomValues ) +#define hypre_SeqVectorSetSize HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorSetSize ) +#define hypre_SeqVectorSetTags HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorSetTags ) +#define hypre_SeqVectorSetValuesTagged HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorSetValuesTagged ) +#define hypre_SeqVectorSetValuesTaggedHost HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorSetValuesTaggedHost ) +#define hypre_SeqVectorStridedCopy HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorStridedCopy ) +#define hypre_SeqVectorSumElts HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorSumElts ) +#define hypre_SeqVectorSumEltsHost HYPRE_FIXEDPRECISION_FUNC ( hypre_SeqVectorSumEltsHost ) + +#endif diff --git a/src/seq_mv/_hypre_seq_mv_mup_undef.h b/src/seq_mv/_hypre_seq_mv_mup_undef.h new file mode 100644 index 0000000000..ce3d19ed13 --- /dev/null +++ b/src/seq_mv/_hypre_seq_mv_mup_undef.h @@ -0,0 +1,187 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#undef hypre_SEQ_MV_MUP_DEF_HEADER + +#undef HYPRE_CSRMatrixCreate +#undef HYPRE_CSRMatrixDestroy +#undef HYPRE_CSRMatrixGetNumRows +#undef HYPRE_CSRMatrixInitialize +#undef HYPRE_CSRMatrixPrint +#undef HYPRE_CSRMatrixRead +#undef HYPRE_MappedMatrixAssemble +#undef HYPRE_MappedMatrixCreate +#undef HYPRE_MappedMatrixDestroy +#undef HYPRE_MappedMatrixGetColIndex +#undef HYPRE_MappedMatrixGetMatrix +#undef HYPRE_MappedMatrixInitialize +#undef HYPRE_MappedMatrixLimitedDestroy +#undef HYPRE_MappedMatrixPrint +#undef HYPRE_MappedMatrixSetColMap +#undef HYPRE_MappedMatrixSetMapData +#undef HYPRE_MappedMatrixSetMatrix +#undef HYPRE_MultiblockMatrixAssemble +#undef HYPRE_MultiblockMatrixCreate +#undef HYPRE_MultiblockMatrixDestroy +#undef HYPRE_MultiblockMatrixInitialize +#undef HYPRE_MultiblockMatrixLimitedDestroy +#undef HYPRE_MultiblockMatrixPrint +#undef HYPRE_MultiblockMatrixSetNumSubmatrices +#undef HYPRE_MultiblockMatrixSetSubmatrixType +#undef HYPRE_VectorCopy +#undef HYPRE_VectorCreate +#undef HYPRE_VectorDestroy +#undef HYPRE_VectorInitialize +#undef HYPRE_VectorPrint +#undef HYPRE_VectorRead +#undef hypre_CSRMatrixAdd +#undef hypre_CSRMatrixAddFirstPass +#undef hypre_CSRMatrixAddHost +#undef hypre_CSRMatrixAddPartial +#undef hypre_CSRMatrixAddSecondPass +#undef hypre_CSRMatrixBigInitialize +#undef hypre_CSRMatrixBigJtoJ +#undef hypre_CSRMatrixCheckSetNumNonzeros +#undef hypre_CSRMatrixClone +#undef hypre_CSRMatrixClone_v2 +#undef hypre_CSRMatrixComputeColSum +#undef hypre_CSRMatrixComputeColSumHost +#undef hypre_CSRMatrixComputeRowSum +#undef hypre_CSRMatrixComputeRowSumHost +#undef hypre_CSRMatrixCopy +#undef hypre_CSRMatrixCreate +#undef hypre_CSRMatrixDeleteZeros +#undef hypre_CSRMatrixDestroy +#undef hypre_CSRMatrixDiagScale +#undef hypre_CSRMatrixDiagScaleHost +#undef hypre_CSRMatrixEliminateRowsCols +#undef hypre_CSRMatrixExtractDiagonal +#undef hypre_CSRMatrixExtractDiagonalHost +#undef hypre_CSRMatrixFnorm +#undef hypre_CSRMatrixGetLoadBalancedPartitionBegin +#undef hypre_CSRMatrixGetLoadBalancedPartitionEnd +#undef hypre_CSRMatrixInitialize +#undef hypre_CSRMatrixInitialize_v2 +#undef hypre_CSRMatrixJtoBigJ +#undef hypre_CSRMatrixMatvec +#undef hypre_CSRMatrixMatvecOutOfPlace +#undef hypre_CSRMatrixMatvecOutOfPlaceHost +#undef hypre_CSRMatrixMatvecT +#undef hypre_CSRMatrixMatvecTHost +#undef hypre_CSRMatrixMatvec_FF +#undef hypre_CSRMatrixMigrate +#undef hypre_CSRMatrixMultiply +#undef hypre_CSRMatrixMultiplyHost +#undef hypre_CSRMatrixPermute +#undef hypre_CSRMatrixPermuteHost +#undef hypre_CSRMatrixPrefetch +#undef hypre_CSRMatrixPrint +#undef hypre_CSRMatrixPrintHB +#undef hypre_CSRMatrixPrintIJ +#undef hypre_CSRMatrixPrintMM +#undef hypre_CSRMatrixRead +#undef hypre_CSRMatrixReorder +#undef hypre_CSRMatrixReorderHost +#undef hypre_CSRMatrixResize +#undef hypre_CSRMatrixScale +#undef hypre_CSRMatrixSetConstantValues +#undef hypre_CSRMatrixSetDataOwner +#undef hypre_CSRMatrixSetPatternOnly +#undef hypre_CSRMatrixSetRownnz +#undef hypre_CSRMatrixSetRownnzHost +#undef hypre_CSRMatrixSplit +#undef hypre_CSRMatrixSumElts +#undef hypre_CSRMatrixTaggedFnorm +#undef hypre_CSRMatrixTaggedFnormHost +#undef hypre_CSRMatrixTranspose +#undef hypre_CSRMatrixTransposeHost +#undef hypre_CSRMatrixTruncateDiag +#undef hypre_CSRMatrixUnion +#undef hypre_GenerateLocalPartitioning +#undef hypre_GeneratePartitioning +#undef hypre_MappedMatrixAssemble +#undef hypre_MappedMatrixCreate +#undef hypre_MappedMatrixDestroy +#undef hypre_MappedMatrixGetColIndex +#undef hypre_MappedMatrixGetMatrix +#undef hypre_MappedMatrixInitialize +#undef hypre_MappedMatrixLimitedDestroy +#undef hypre_MappedMatrixPrint +#undef hypre_MappedMatrixSetColMap +#undef hypre_MappedMatrixSetMapData +#undef hypre_MappedMatrixSetMatrix +#undef hypre_MultiblockMatrixAssemble +#undef hypre_MultiblockMatrixCreate +#undef hypre_MultiblockMatrixDestroy +#undef hypre_MultiblockMatrixInitialize +#undef hypre_MultiblockMatrixLimitedDestroy +#undef hypre_MultiblockMatrixPrint +#undef hypre_MultiblockMatrixSetNumSubmatrices +#undef hypre_MultiblockMatrixSetSubmatrix +#undef hypre_MultiblockMatrixSetSubmatrixType +#undef hypre_SeqMultiVectorCreate +#undef hypre_SeqVectorAxpy +#undef hypre_SeqVectorAxpyHost +#undef hypre_SeqVectorAxpyz +#undef hypre_SeqVectorAxpyzHost +#undef hypre_SeqVectorCloneDeep +#undef hypre_SeqVectorCloneDeep_v2 +#undef hypre_SeqVectorCloneShallow +#undef hypre_SeqVectorCopy +#undef hypre_SeqVectorCopyTags +#undef hypre_SeqVectorCreate +#undef hypre_SeqVectorDestroy +#undef hypre_SeqVectorInitialize +#undef hypre_SeqVectorInitializeShell +#undef hypre_SeqVectorInitialize_v2 +#undef hypre_SeqVectorInnerProd +#undef hypre_SeqVectorInnerProdHost +#undef hypre_SeqVectorInnerProdTagged +#undef hypre_SeqVectorInnerProdTaggedHost +#undef hypre_SeqVectorMassAxpy +#undef hypre_SeqVectorMassAxpy4 +#undef hypre_SeqVectorMassAxpy8 +#undef hypre_SeqVectorMassDotpTwo +#undef hypre_SeqVectorMassDotpTwo4 +#undef hypre_SeqVectorMassDotpTwo8 +#undef hypre_SeqVectorMassInnerProd +#undef hypre_SeqVectorMassInnerProd4 +#undef hypre_SeqVectorMassInnerProd8 +#undef hypre_SeqVectorMigrate +#undef hypre_SeqVectorPointwiseDivision +#undef hypre_SeqVectorPointwiseDivisionHost +#undef hypre_SeqVectorPointwiseDivpy +#undef hypre_SeqVectorPointwiseDivpyHost +#undef hypre_SeqVectorPointwiseDivpyMarked +#undef hypre_SeqVectorPointwiseInverse +#undef hypre_SeqVectorPointwiseInverseHost +#undef hypre_SeqVectorPointwiseProduct +#undef hypre_SeqVectorPointwiseProductHost +#undef hypre_SeqVectorPrint +#undef hypre_SeqVectorRead +#undef hypre_SeqVectorResize +#undef hypre_SeqVectorScale +#undef hypre_SeqVectorScaleHost +#undef hypre_SeqVectorSetConstantValues +#undef hypre_SeqVectorSetConstantValuesHost +#undef hypre_SeqVectorSetData +#undef hypre_SeqVectorSetDataOwner +#undef hypre_SeqVectorSetNumTags +#undef hypre_SeqVectorSetOwnsTags +#undef hypre_SeqVectorSetRandomValues +#undef hypre_SeqVectorSetSize +#undef hypre_SeqVectorSetTags +#undef hypre_SeqVectorSetValuesTagged +#undef hypre_SeqVectorSetValuesTaggedHost +#undef hypre_SeqVectorStridedCopy +#undef hypre_SeqVectorSumElts +#undef hypre_SeqVectorSumEltsHost diff --git a/src/seq_mv/csr_filter.c b/src/seq_mv/csr_filter.c index af371cc95d..8a94a0cc18 100644 --- a/src/seq_mv/csr_filter.c +++ b/src/seq_mv/csr_filter.c @@ -11,7 +11,7 @@ * *****************************************************************************/ -#include "seq_mv.h" +#include "_hypre_seq_mv.h" /*-------------------------------------------------------------------------- * hypre_CSRMatrixTruncateDiag diff --git a/src/seq_mv/csr_matop.c b/src/seq_mv/csr_matop.c index 0466eca1f1..303492b9eb 100644 --- a/src/seq_mv/csr_matop.c +++ b/src/seq_mv/csr_matop.c @@ -11,7 +11,7 @@ * *****************************************************************************/ -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #include "csr_matrix.h" /*-------------------------------------------------------------------------- @@ -167,20 +167,23 @@ hypre_CSRMatrixAddFirstPass( HYPRE_Int firstrow, } } - if (ii < (num_threads - 1)) + if (lastrow > firstrow) { - for (iic = rownnz_C[lastrow - 1] + 1; iic < rownnz_C[lastrow]; iic++) + if ((ii < (num_threads - 1)) && (lastrow < nnzrows_C)) { - hypre_assert(C_i[iic + 1] == 0); - C_i[iic + 1] = C_i[rownnz_C[lastrow - 1] + 1]; + 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]; + } } - } - else - { - for (iic = rownnz_C[lastrow - 1] + 1; iic < nrows_C; iic++) + else { - hypre_assert(C_i[iic + 1] == 0); - C_i[iic + 1] = C_i[rownnz_C[lastrow - 1] + 1]; + 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]; + } } } } @@ -229,6 +232,12 @@ hypre_CSRMatrixAddSecondPass( HYPRE_Int firstrow, hypre_CSRMatrix *B, hypre_CSRMatrix *C ) { + /* Exit if local number of rows is zero */ + if (lastrow - firstrow <= 0) + { + return hypre_error_flag; + } + HYPRE_Int *A_i = hypre_CSRMatrixI(A); HYPRE_Int *A_j = hypre_CSRMatrixJ(A); HYPRE_Complex *A_data = hypre_CSRMatrixData(A); @@ -448,8 +457,23 @@ hypre_CSRMatrixAdd( HYPRE_Complex alpha, HYPRE_Complex beta, hypre_CSRMatrix *B) { + HYPRE_Int nrows_A = hypre_CSRMatrixNumRows(A); + HYPRE_Int ncols_A = hypre_CSRMatrixNumCols(A); + HYPRE_Int nnzrows_A = hypre_CSRMatrixNumRownnz(A); + HYPRE_Int nnzrows_B = hypre_CSRMatrixNumRownnz(B); + hypre_CSRMatrix *C = NULL; + /* Trivial case: input matrices are empty */ + if (!nnzrows_A && !nnzrows_B) + { + C = hypre_CSRMatrixCreate(nrows_A, ncols_A, 0); + hypre_CSRMatrixNumRownnz(C) = 0; + hypre_CSRMatrixInitialize_v2(C, 0, hypre_CSRMatrixMemoryLocation(A)); + + return C; + } + #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy2( hypre_CSRMatrixMemoryLocation(A), hypre_CSRMatrixMemoryLocation(B) ); @@ -1610,6 +1634,8 @@ hypre_CSRMatrixReorder(hypre_CSRMatrix *A) * 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 + * + * TODO: Add OpenMP support *--------------------------------------------------------------------------*/ hypre_CSRMatrix * hypre_CSRMatrixAddPartial( hypre_CSRMatrix *A, @@ -2055,12 +2081,6 @@ hypre_CSRMatrixComputeColSum( hypre_CSRMatrix *A, } /*-------------------------------------------------------------------------- - * hypre_CSRMatrixExtractDiagonalHost - * type 0: diag - * 1: abs diag - * 2: diag inverse - * 3: diag inverse sqrt - * 4: abs diag inverse sqrt *--------------------------------------------------------------------------*/ HYPRE_Int @@ -2078,7 +2098,7 @@ hypre_CSRMatrixExtractDiagonalHost( hypre_CSRMatrix *A, for (i = 0; i < nrows; i++) { - d_i = 0.0; + d_i = (type < 10) ? 0.0 : d[i]; for (j = A_i[i]; j < A_i[i + 1]; j++) { if (A_j[j] == i) @@ -2091,6 +2111,14 @@ hypre_CSRMatrixExtractDiagonalHost( hypre_CSRMatrix *A, { d_i = hypre_cabs(A_data[j]); } + else if (type == 10) + { + d_i += A_data[j]; + } + else if (type == 11) + { + d_i += hypre_cabs(A_data[j]); + } else { if (A_data[j] == 0.0) @@ -2121,18 +2149,25 @@ hypre_CSRMatrixExtractDiagonalHost( hypre_CSRMatrix *A, } /*-------------------------------------------------------------------------- - * hypre_CSRMatrixExtractDiagonal + * Extracts values from the diagonal of a CSR matrix based on the specified type. * - * type 0: diag - * 1: abs diag - * 2: diag inverse - * 3: diag inverse sqrt + * Parameters: + * A - Input CSR matrix. + * d - Array to store the extracted or computed values. + * type - Specifies the operation to perform on the diagonal coefficients: + * 0: Extract the diagonal coefficients. + * 1: Extract the absolute values of the diagonal coefs.. + * 2: Compute the inverse of the diagonal coefs. (1 / diag). + * 3: Compute the inverse square root of the diagonal coefs. (1 / sqrt(diag)). + * 10: Extract diagonal coefs. and adds them to pre-existing values in d + * 11: Extract the absolute values of diagonal coefs. and adds them to + * pre-existing values in d. *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_CSRMatrixExtractDiagonal( hypre_CSRMatrix *A, - HYPRE_Complex *d, - HYPRE_Int type) +hypre_CSRMatrixExtractDiagonal(hypre_CSRMatrix *A, + HYPRE_Complex *d, + HYPRE_Int type) { #if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_CSRMatrixMemoryLocation(A) ); @@ -2151,8 +2186,6 @@ hypre_CSRMatrixExtractDiagonal( hypre_CSRMatrix *A, } /*-------------------------------------------------------------------------- - * hypre_CSRMatrixScale - * * Scales CSR matrix: A = scalar * A. *--------------------------------------------------------------------------*/ @@ -2174,6 +2207,9 @@ hypre_CSRMatrixScale( hypre_CSRMatrix *A, else #endif { +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif for (i = 0; i < k; i++) { data[i] *= scalar; @@ -2351,6 +2387,9 @@ hypre_CSRMatrixSetConstantValues( hypre_CSRMatrix *A, else #endif { +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel +#endif for (i = 0; i < nnz; i++) { hypre_CSRMatrixData(A)[i] = value; diff --git a/src/seq_mv/csr_matop_device.c b/src/seq_mv/csr_matop_device.c index ba75ceff0f..17a85fb729 100644 --- a/src/seq_mv/csr_matop_device.c +++ b/src/seq_mv/csr_matop_device.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_onedpl.hpp" -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #include "_hypre_utilities.hpp" #include "seq_mv.hpp" @@ -297,6 +297,148 @@ hypre_CSRMatrixTripleMultiplyDevice ( hypre_CSRMatrix *A, return ABC; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +hypre_CSRMatrix * +hypre_CSRMatrixDeleteZerosDevice( hypre_CSRMatrix *A, + HYPRE_Real tol ) +{ + HYPRE_MemoryLocation memory_location = hypre_CSRMatrixMemoryLocation(A); + 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 num_nonzeros = hypre_CSRMatrixNumNonzeros(A); + HYPRE_Int num_zeros; + + hypre_GpuProfilingPushRange("CSRMatrixDeleteZeros"); + + /* Count nonzeros with absolute value less than or equal to tol */ +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + num_zeros = HYPRE_THRUST_CALL( count_if, + A_data, + A_data + num_nonzeros, + [ = ] __device__ (HYPRE_Complex v) { return hypre_cabs(v) <= tol; } ); +#elif defined(HYPRE_USING_SYCL) + num_zeros = HYPRE_ONEDPL_CALL( std::count_if, + A_data, + A_data + num_nonzeros, + [ = ] (HYPRE_Complex v) { return hypre_cabs(v) <= tol; } ); +#endif + + /* Create new matrix containing only the entries with abs. coef greater than tol */ + if (num_zeros) + { + hypre_CSRMatrix *B; + HYPRE_Complex *B_data; + HYPRE_Int *B_i; + HYPRE_Int *B_j; + HYPRE_Int num_nonzeros_B = num_nonzeros - num_zeros; + + B = hypre_CSRMatrixCreate(nrows_A, ncols_A, num_nonzeros_B); + hypre_CSRMatrixInitialize_v2(B, 0, memory_location); + B_data = hypre_CSRMatrixData(B); + B_j = hypre_CSRMatrixJ(B); + B_i = hypre_CSRMatrixI(B); + +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + auto new_end = HYPRE_THRUST_CALL( copy_if, + thrust::make_zip_iterator(thrust::make_tuple(A_data, A_j)), + thrust::make_zip_iterator(thrust::make_tuple(A_data + num_nonzeros, A_j + num_nonzeros)), + A_data, + thrust::make_zip_iterator(thrust::make_tuple(B_data, B_j)), + hypreFunctor_NonzeroAboveTol(tol)); + hypre_assert(thrust::get<0>(new_end.get_iterator_tuple()) - B_data == num_nonzeros_B); +#elif defined(HYPRE_USING_SYCL) + auto new_end = HYPRE_ONEDPL_CALL( copy_if, + oneapi::dpl::make_zip_iterator(A_data, A_j), + oneapi::dpl::make_zip_iterator(A_data + num_nonzeros, A_j + num_nonzeros), + oneapi::dpl::make_zip_iterator(B_data, B_j), + [ = ] (auto v) { return hypre_cabs(std::get<0>(v)) > tol; } ); + hypre_assert(std::get<0>(new_end.base()) - B_data == num_nonzeros_B); +#endif + + /* Recompute row pointers */ + HYPRE_Int *row_indices = hypre_CTAlloc(HYPRE_Int, num_nonzeros, memory_location); + +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + HYPRE_THRUST_CALL( for_each, + thrust::make_counting_iterator(0), + thrust::make_counting_iterator(nrows_A), + [ = ] __device__ (HYPRE_Int i) + { + for (HYPRE_Int k = A_i[i]; k < A_i[i + 1]; k++) + { + row_indices[k] = i; + } + }); +#elif defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( for_each, + oneapi::dpl::counting_iterator(0), + oneapi::dpl::counting_iterator(nrows_A), + [ = ] (HYPRE_Int i) + { + for (HYPRE_Int k = A_i[i]; k < A_i[i + 1]; k++) + { + row_indices[k] = i; + } + }); +#endif + + HYPRE_Int *B_row_indices = hypre_CTAlloc(HYPRE_Int, num_nonzeros_B, memory_location); +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + HYPRE_THRUST_CALL( copy_if, + row_indices, + row_indices + num_nonzeros, + A_data, + B_row_indices, + hypreFunctor_NonzeroAboveTol(tol)); +#elif defined(HYPRE_USING_SYCL) + hypreSycl_copy_if( row_indices, + row_indices + num_nonzeros, + A_data, + B_row_indices, + [ = ] (HYPRE_Complex v) { return hypre_cabs(v) > tol; } ); +#endif + hypre_TFree(row_indices, memory_location); + +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + auto B_row_indices_end = B_row_indices + num_nonzeros_B; + HYPRE_THRUST_CALL( fill, B_i, B_i + 1, 0 ); + HYPRE_THRUST_CALL( transform, + thrust::make_counting_iterator(0), + thrust::make_counting_iterator(nrows_A), + B_i + 1, + [ = ] __device__ (HYPRE_Int i) + { + return thrust::upper_bound(thrust::seq, B_row_indices, B_row_indices_end, i) - B_row_indices; + } ); +#elif defined(HYPRE_USING_SYCL) + auto B_row_indices_end = B_row_indices + num_nonzeros_B; + HYPRE_ONEDPL_CALL( std::fill, B_i, B_i + 1, 0 ); + HYPRE_ONEDPL_CALL( transform, + oneapi::dpl::counting_iterator(0), + oneapi::dpl::counting_iterator(nrows_A), + B_i + 1, + [ = ] (HYPRE_Int i) + { + return std::upper_bound(B_row_indices, B_row_indices_end, i) - B_row_indices; + } ); +#endif + hypre_TFree(B_row_indices, memory_location); + hypre_GpuProfilingPopRange(); + + return B; + } + else + { + hypre_GpuProfilingPopRange(); + return NULL; + } +} + /*-------------------------------------------------------------------------- * hypre_CSRMatrixSplitDevice * @@ -304,8 +446,7 @@ hypre_CSRMatrixTripleMultiplyDevice ( hypre_CSRMatrix *A, * 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 + * 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 *--------------------------------------------------------------------------*/ @@ -1238,32 +1379,28 @@ hypre_CSRMatrixStack2Device(hypre_CSRMatrix *A, hypre_CSRMatrix *B) } /*-------------------------------------------------------------------------- - * hypreGPUKernel_CSRRowSum - * - * type == 0, sum, - * 1, abs sum (l-1) - * 2, square sum (l-2) *--------------------------------------------------------------------------*/ -template +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) +hypreGPUKernel_CSRRowSumCF( hypre_DeviceItem &item, + HYPRE_Int nrows, + HYPRE_Int* __restrict__ ir, + HYPRE_Int* __restrict__ ia, + HYPRE_Int* __restrict__ ja, + HYPRE_Complex* __restrict__ aa, + HYPRE_Int* __restrict__ CF_i, + HYPRE_Int* __restrict__ CF_j, + HYPRE_Complex* __restrict__ 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) + HYPRE_Int wid = hypre_gpu_get_grid_warp_id<1, 1>(item); + if (wid >= nrows) { return; } + HYPRE_Int row_i = compressed ? ir[wid] : wid; HYPRE_Int lane = hypre_gpu_get_lane_id<1>(item); HYPRE_Int p = 0, q = 0; @@ -1279,7 +1416,7 @@ hypreGPUKernel_CSRRowSum( hypre_DeviceItem &item, 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]]) ) + if (read_only_load(&CF_i[row_i]) != read_only_load(&CF_j[ja[j]])) { continue; } @@ -1315,6 +1452,73 @@ hypreGPUKernel_CSRRowSum( hypre_DeviceItem &item, } } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +template +__global__ void +hypreGPUKernel_CSRRowSum( hypre_DeviceItem &item, + HYPRE_Int nrows, + HYPRE_Int* __restrict__ ir, + HYPRE_Int* __restrict__ ia, + HYPRE_Complex* __restrict__ aa, + HYPRE_Complex* __restrict__ row_sum, + HYPRE_Complex scal, + HYPRE_Int set) +{ + HYPRE_Int wid = hypre_gpu_get_grid_warp_id<1, 1>(item); + if (wid >= nrows) + { + return; + } + + HYPRE_Int row_i = compressed ? ir[wid] : wid; + + 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) + { + 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 *--------------------------------------------------------------------------*/ @@ -1328,35 +1532,111 @@ hypre_CSRMatrixComputeRowSumDevice( hypre_CSRMatrix *A, 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); + HYPRE_Int nrows = hypre_CSRMatrixNumRows(A); + HYPRE_Int nrownnz = hypre_CSRMatrixNumRownnz(A); + HYPRE_Int *A_r = hypre_CSRMatrixRownnz(A); + HYPRE_Int *A_i = hypre_CSRMatrixI(A); + HYPRE_Int *A_j = hypre_CSRMatrixJ(A); + HYPRE_Complex *A_data = hypre_CSRMatrixData(A); + HYPRE_Int set = set_or_add[0] == 's'; + + /* Sanity check */ + if (!nrownnz) + { + return hypre_error_flag; + } dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); - dim3 gDim = hypre_GetDefaultDeviceGridDimension(nrows, "warp", bDim); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(nrownnz, "warp", bDim); - HYPRE_Int set = set_or_add[0] == 's'; - if (type == 0) + hypre_GpuProfilingPushRange("CSRMatrixComputeRowSum"); + + if (nrownnz < nrows && set) { - HYPRE_GPU_LAUNCH( hypreGPUKernel_CSRRowSum<0>, gDim, bDim, - nrows, A_i, A_j, A_data, - CF_i, CF_j, row_sum, scal, set ); + hypre_Memset(row_sum, 0, nrows * sizeof(HYPRE_Complex), HYPRE_MEMORY_DEVICE); } - else if (type == 1) + + if (nrownnz < nrows && CF_i && CF_j) { - HYPRE_GPU_LAUNCH( hypreGPUKernel_CSRRowSum<1>, gDim, bDim, - nrows, A_i, A_j, A_data, - CF_i, CF_j, row_sum, scal, set ); + if (type == 0) + { + HYPRE_GPU_LAUNCH( (hypreGPUKernel_CSRRowSumCF<0, 1>), gDim, bDim, + nrownnz, A_r, A_i, A_j, A_data, + CF_i, CF_j, row_sum, scal, set ); + } + else if (type == 1) + { + HYPRE_GPU_LAUNCH( (hypreGPUKernel_CSRRowSumCF<1, 1>), gDim, bDim, + nrownnz, A_r, A_i, A_j, A_data, + CF_i, CF_j, row_sum, scal, set ); + } + else if (type == 2) + { + HYPRE_GPU_LAUNCH( (hypreGPUKernel_CSRRowSumCF<2, 1>), gDim, bDim, + nrownnz, A_r, A_i, A_j, A_data, + CF_i, CF_j, row_sum, scal, set ); + } } - else if (type == 2) + else if (CF_i && CF_j) { - HYPRE_GPU_LAUNCH( hypreGPUKernel_CSRRowSum<2>, gDim, bDim, - nrows, A_i, A_j, A_data, CF_i, CF_j, - row_sum, scal, set ); + if (type == 0) + { + HYPRE_GPU_LAUNCH( (hypreGPUKernel_CSRRowSumCF<0, 0>), gDim, bDim, + nrows, A_r, A_i, A_j, A_data, + CF_i, CF_j, row_sum, scal, set ); + } + else if (type == 1) + { + HYPRE_GPU_LAUNCH( (hypreGPUKernel_CSRRowSumCF<1, 0>), gDim, bDim, + nrows, A_r, A_i, A_j, A_data, + CF_i, CF_j, row_sum, scal, set ); + } + else if (type == 2) + { + HYPRE_GPU_LAUNCH( (hypreGPUKernel_CSRRowSumCF<2, 0>), gDim, bDim, + nrows, A_r, A_i, A_j, A_data, + CF_i, CF_j, row_sum, scal, set ); + } + } + else if (nrownnz < nrows && !CF_i && !CF_j) + { + if (type == 0) + { + HYPRE_GPU_LAUNCH( (hypreGPUKernel_CSRRowSum<0, 1>), gDim, bDim, + nrownnz, A_r, A_i, A_data, row_sum, scal, set ); + } + else if (type == 1) + { + HYPRE_GPU_LAUNCH( (hypreGPUKernel_CSRRowSum<1, 1>), gDim, bDim, + nrownnz, A_r, A_i, A_data, row_sum, scal, set ); + } + else if (type == 2) + { + HYPRE_GPU_LAUNCH( (hypreGPUKernel_CSRRowSum<2, 1>), gDim, bDim, + nrownnz, A_r, A_i, A_data, row_sum, scal, set ); + } + } + else + { + if (type == 0) + { + HYPRE_GPU_LAUNCH( (hypreGPUKernel_CSRRowSum<0, 0>), gDim, bDim, + nrows, A_r, A_i, A_data, row_sum, scal, set ); + } + else if (type == 1) + { + HYPRE_GPU_LAUNCH( (hypreGPUKernel_CSRRowSum<1, 0>), gDim, bDim, + nrows, A_r, A_i, A_data, row_sum, scal, set ); + } + else if (type == 2) + { + HYPRE_GPU_LAUNCH( (hypreGPUKernel_CSRRowSum<2, 0>), gDim, bDim, + nrows, A_r, A_i, A_data, row_sum, scal, set ); + } } hypre_SyncComputeStream(); + hypre_GpuProfilingPopRange(); return hypre_error_flag; } @@ -1371,7 +1651,6 @@ template __global__ void hypreGPUKernel_CSRMatrixComputeColSum(hypre_DeviceItem &item, HYPRE_Int nrows, - HYPRE_Int ncols, const HYPRE_Int *ia, const HYPRE_Int *ja, const HYPRE_Complex *aa, @@ -1446,7 +1725,6 @@ hypre_CSRMatrixComputeColSumDevice(hypre_CSRMatrix *A, HYPRE_Complex scal) { HYPRE_Int nrows = hypre_CSRMatrixNumRows(A); - HYPRE_Int ncols = hypre_CSRMatrixNumCols(A); HYPRE_Int *A_i = hypre_CSRMatrixI(A); HYPRE_Int *A_j = hypre_CSRMatrixJ(A); HYPRE_Complex *A_a = hypre_CSRMatrixData(A); @@ -1455,23 +1733,26 @@ hypre_CSRMatrixComputeColSumDevice(hypre_CSRMatrix *A, dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); dim3 gDim = hypre_GetDefaultDeviceGridDimension(nrows, "warp", bDim); + hypre_GpuProfilingPushRange("CSRMatrixComputeColSum"); + /* Launch kernel based on type */ if (type == 0) { HYPRE_GPU_LAUNCH(hypreGPUKernel_CSRMatrixComputeColSum<0>, gDim, bDim, - nrows, ncols, A_i, A_j, A_a, scal, col_sum); + nrows, A_i, A_j, A_a, scal, col_sum); } else if (type == 1) { HYPRE_GPU_LAUNCH(hypreGPUKernel_CSRMatrixComputeColSum<1>, gDim, bDim, - nrows, ncols, A_i, A_j, A_a, scal, col_sum); + nrows, A_i, A_j, A_a, scal, col_sum); } else if (type == 2) { HYPRE_GPU_LAUNCH(hypreGPUKernel_CSRMatrixComputeColSum<2>, gDim, bDim, - nrows, ncols, A_i, A_j, A_a, scal, col_sum); + nrows, A_i, A_j, A_a, scal, col_sum); } + hypre_GpuProfilingPopRange(); hypre_SyncComputeStream(); return hypre_error_flag; @@ -1751,23 +2032,18 @@ hypre_CSRMatrixIntersectPattern(hypre_CSRMatrix *A, } /*-------------------------------------------------------------------------- - * hypreGPUKernel_CSRExtractDiag - * - * type 0: diag - * 1: abs diag - * 2: diag inverse - * 3: diag inverse sqrt - * 4: abs diag inverse sqrt + * GPU kernel for extracting diagonal entries from a matrix. + * For available types, see hypre_CSRMatrixExtractDiagonal *--------------------------------------------------------------------------*/ +template __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 nrows, + HYPRE_Int *ia, + HYPRE_Int *ja, + HYPRE_Complex *aa, + HYPRE_Complex *d) { HYPRE_Int row = hypre_gpu_get_grid_warp_id<1, 1>(item); @@ -1804,6 +2080,14 @@ hypreGPUKernel_CSRExtractDiag( hypre_DeviceItem &item, { d[row] = hypre_abs(aa[j]); } + else if (type == 10) + { + d[row] += aa[j]; + } + else if (type == 11) + { + d[row] += hypre_abs(aa[j]); + } else { if (aa[j] == 0.0) @@ -1832,14 +2116,13 @@ hypreGPUKernel_CSRExtractDiag( hypre_DeviceItem &item, } } - if (!has_diag && lane == 0) + if (type < 10 && !has_diag && !lane) { d[row] = 0.0; } } /*-------------------------------------------------------------------------- - * hypre_CSRMatrixExtractDiagonalDevice *--------------------------------------------------------------------------*/ HYPRE_Int @@ -1848,15 +2131,46 @@ hypre_CSRMatrixExtractDiagonalDevice( hypre_CSRMatrix *A, HYPRE_Int type) { HYPRE_Int nrows = hypre_CSRMatrixNumRows(A); - HYPRE_Complex *A_data = hypre_CSRMatrixData(A); + HYPRE_Complex *A_a = 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); + dim3 bDim = hypre_GetDefaultDeviceBlockDimension(); + dim3 gDim = hypre_GetDefaultDeviceGridDimension(nrows, "warp", bDim); + + switch (type) + { + case 0: + HYPRE_GPU_LAUNCH( hypreGPUKernel_CSRExtractDiag<0>, gDim, bDim, nrows, A_i, A_j, A_a, d ); + break; + + case 1: + HYPRE_GPU_LAUNCH( hypreGPUKernel_CSRExtractDiag<1>, gDim, bDim, nrows, A_i, A_j, A_a, d ); + break; + + case 2: + HYPRE_GPU_LAUNCH( hypreGPUKernel_CSRExtractDiag<2>, gDim, bDim, nrows, A_i, A_j, A_a, d ); + break; + + case 3: + HYPRE_GPU_LAUNCH( hypreGPUKernel_CSRExtractDiag<3>, gDim, bDim, nrows, A_i, A_j, A_a, d ); + break; - HYPRE_GPU_LAUNCH( hypreGPUKernel_CSRExtractDiag, gDim, bDim, nrows, - A_i, A_j, A_data, d, type ); + case 4: + HYPRE_GPU_LAUNCH( hypreGPUKernel_CSRExtractDiag<4>, gDim, bDim, nrows, A_i, A_j, A_a, d ); + break; + + case 10: + HYPRE_GPU_LAUNCH( hypreGPUKernel_CSRExtractDiag<10>, gDim, bDim, nrows, A_i, A_j, A_a, d ); + break; + + case 11: + HYPRE_GPU_LAUNCH( hypreGPUKernel_CSRExtractDiag<11>, gDim, bDim, nrows, A_i, A_j, A_a, d ); + break; + + default: + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unavailable type!"); + } hypre_SyncComputeStream(); @@ -2825,6 +3139,83 @@ hypre_CSRMatrixTransposeDevice(hypre_CSRMatrix *A, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * Functor for checking whether a matrix row is empty or not + *--------------------------------------------------------------------------*/ + +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) +struct is_non_empty_row +{ + const HYPRE_Int *A_i; + + is_non_empty_row(const HYPRE_Int *A_i) : A_i(A_i) {} + + __host__ __device__ + HYPRE_Int operator()(const HYPRE_Int i) const + { + return (A_i[i + 1] - A_i[i]) > 0; + } +}; +#endif + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixSetRownnzDevice( hypre_CSRMatrix *A ) +{ + HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A); + HYPRE_Int *A_i = hypre_CSRMatrixI(A); + HYPRE_Int *Arownnz = hypre_CSRMatrixRownnz(A); + HYPRE_Int irownnz; + + /* Count number of non-empty rows in A */ +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + irownnz = HYPRE_THRUST_CALL( count_if, + thrust::make_counting_iterator(0), + thrust::make_counting_iterator(num_rows), + is_non_empty_row(A_i) ); + +#elif defined(HYPRE_USING_SYCL) + irownnz = HYPRE_ONEDPL_CALL( count_if, + oneapi::dpl::counting_iterator(0), + oneapi::dpl::counting_iterator(num_rows), + [ = ] (const HYPRE_Int i) { return (A_i[i + 1] - A_i[i]) > 0; } ); +#endif + hypre_CSRMatrixNumRownnz(A) = irownnz; + + /* Free old rownnz pointer */ + hypre_TFree(Arownnz, HYPRE_MEMORY_DEVICE); + + /* Set new rownnz pointer */ + if (irownnz == 0 || irownnz == num_rows) + { + hypre_CSRMatrixRownnz(A) = NULL; + } + else + { + Arownnz = hypre_TAlloc(HYPRE_Int, irownnz, HYPRE_MEMORY_DEVICE); + +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + HYPRE_THRUST_CALL( copy_if, + thrust::make_counting_iterator(0), + thrust::make_counting_iterator(num_rows), + Arownnz, + is_non_empty_row(A_i) ); + +#elif defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( copy_if, + oneapi::dpl::counting_iterator(0), + oneapi::dpl::counting_iterator(num_rows), + Arownnz, + [ = ] (const HYPRE_Int i) { return (A_i[i + 1] - A_i[i]) > 0; } ); +#endif + hypre_CSRMatrixRownnz(A) = Arownnz; + } + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- * hypre_CSRMatrixSortRow *--------------------------------------------------------------------------*/ @@ -3342,7 +3733,7 @@ hypre_CSRMatrixTriLowerUpperSolveRocsparse(char uplo, hypre_CsrsvDataInfoL(csrsv_data), &buffer_size) ); - if (hypre_CsrsvDataBufferSize(csrsv_data) < buffer_size) + if (hypre_CsrsvDataBufferSize(csrsv_data) < (HYPRE_Int) buffer_size) { buffer = hypre_TReAlloc_v2(hypre_CsrsvDataBuffer(csrsv_data), char, hypre_CsrsvDataBufferSize(csrsv_data), @@ -3396,7 +3787,7 @@ hypre_CSRMatrixTriLowerUpperSolveRocsparse(char uplo, hypre_CsrsvDataInfoU(csrsv_data), &buffer_size) ); - if (hypre_CsrsvDataBufferSize(csrsv_data) < buffer_size) + if (hypre_CsrsvDataBufferSize(csrsv_data) < (HYPRE_Int) buffer_size) { buffer = hypre_TReAlloc_v2(hypre_CsrsvDataBuffer(csrsv_data), char, hypre_CsrsvDataBufferSize(csrsv_data), diff --git a/src/seq_mv/csr_matrix.c b/src/seq_mv/csr_matrix.c index 6a91bf365f..e22a2c7db1 100644 --- a/src/seq_mv/csr_matrix.c +++ b/src/seq_mv/csr_matrix.c @@ -11,7 +11,7 @@ * *****************************************************************************/ -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #ifdef HYPRE_PROFILE HYPRE_Real hypre_profile_times[HYPRE_TIMER_ID_COUNT] = { 0 }; @@ -50,6 +50,10 @@ hypre_CSRMatrixCreate( HYPRE_Int num_rows, hypre_CSRMatrixCsrsvData(matrix) = NULL; #endif +#if defined(HYPRE_MIXED_PRECISION) + hypre_CSRMatrixPrecision(matrix) = HYPRE_OBJECT_PRECISION; +#endif + return matrix; } @@ -356,17 +360,21 @@ hypre_CSRMatrixSetRownnzHost( hypre_CSRMatrix *matrix ) HYPRE_Int i, irownnz = 0; - for (i = 0; i < num_rows; i++) + /* Count the number of rows with nonzero entries */ + if ((A_i[num_rows] - A_i[0]) > 0) { - if ((A_i[i + 1] - A_i[i]) > 0) + for (i = 0; i < num_rows; i++) { - irownnz++; + if ((A_i[i + 1] - A_i[i]) > 0) + { + irownnz++; + } } } hypre_CSRMatrixNumRownnz(matrix) = irownnz; - /* Free old rownnz pointer */ + /* Free old rownnz array */ hypre_TFree(Arownnz, memory_location); /* Set new rownnz pointer */ @@ -376,6 +384,7 @@ hypre_CSRMatrixSetRownnzHost( hypre_CSRMatrix *matrix ) } else { + /* Compute new rownnz array */ Arownnz = hypre_CTAlloc(HYPRE_Int, irownnz, memory_location); irownnz = 0; for (i = 0; i < num_rows; i++) @@ -392,23 +401,26 @@ hypre_CSRMatrixSetRownnzHost( hypre_CSRMatrix *matrix ) } /*-------------------------------------------------------------------------- - * 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. + * Function to set the array rownnz and num_rownnz inside the CSRMatrix. + * - Needs the A_i array of CSRMatrix to find the nonzero rows. + * - Does not check for the existence of A_i or of the CSR matrix. *--------------------------------------------------------------------------*/ HYPRE_Int hypre_CSRMatrixSetRownnz( hypre_CSRMatrix *matrix ) { -#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + /* Return in case rownnz has been previously computed */ + if (hypre_CSRMatrixRownnz(matrix)) + { + return hypre_error_flag; + } + +#if defined(HYPRE_USING_GPU) HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_CSRMatrixMemoryLocation(matrix) ); if (exec == HYPRE_EXEC_DEVICE) { - // TODO RL: there's no need currently for having rownnz on GPUs + hypre_CSRMatrixSetRownnzDevice(matrix); } else #endif @@ -920,10 +932,10 @@ hypre_CSRMatrixCopy( hypre_CSRMatrix *A, hypre_CSRMatrix *B, HYPRE_Int copy_data /*-------------------------------------------------------------------------- * 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. + * Migrates the CSR matrix arrays (row pointer, column indices, optional + * row nnz, and data) to the given memory location. New arrays are + * allocated and copied if the location differs; old arrays are freed if + * owned. Updates the matrix to own the new arrays. *--------------------------------------------------------------------------*/ HYPRE_Int @@ -934,6 +946,7 @@ hypre_CSRMatrixMigrate( hypre_CSRMatrix *A, HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A); HYPRE_Int num_nonzeros = hypre_CSRMatrixNumNonzeros(A); HYPRE_Int num_rownnz = hypre_CSRMatrixNumRownnz(A); + HYPRE_Int owns_data = hypre_CSRMatrixOwnsData(A); HYPRE_Int *A_ri = hypre_CSRMatrixRownnz(A); HYPRE_Int *A_i = hypre_CSRMatrixI(A); HYPRE_Int *A_j = hypre_CSRMatrixJ(A); @@ -961,9 +974,13 @@ hypre_CSRMatrixMigrate( hypre_CSRMatrix *A, /* Update A's memory location */ hypre_CSRMatrixMemoryLocation(A) = memory_location; + /* Only perform migration if the actual memory space differs */ if ( hypre_GetActualMemLocation(memory_location) != hypre_GetActualMemLocation(old_memory_location) ) { + /* A takes ownership of `j`, `bigj`, and `data` since they will be allocated */ + hypre_CSRMatrixOwnsData(A) = 1; + if (A_ri) { B_ri = hypre_TAlloc(HYPRE_Int, num_rownnz, memory_location); @@ -987,8 +1004,11 @@ hypre_CSRMatrixMigrate( hypre_CSRMatrix *A, 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 (owns_data) + { + hypre_TFree(A_j, old_memory_location); + } } if (A_big_j) @@ -996,8 +1016,11 @@ hypre_CSRMatrixMigrate( hypre_CSRMatrix *A, 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 (owns_data) + { + hypre_TFree(A_big_j, old_memory_location); + } } if (A_data) @@ -1005,8 +1028,11 @@ hypre_CSRMatrixMigrate( hypre_CSRMatrix *A, 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; + if (owns_data) + { + hypre_TFree(A_data, old_memory_location); + } } } @@ -1426,6 +1452,57 @@ hypre_CSRMatrixGetLoadBalancedPartitionEnd(hypre_CSRMatrix *A) return hypre_CSRMatrixGetLoadBalancedPartitionBoundary(A, hypre_GetThreadNum() + 1); } +/*-------------------------------------------------------------------------- + * Eliminates specified rows and columns in a sequential CSR matrix A by: + * + * - Setting all entries in the specified columns to zero. + * - Setting all entries in the specified rows to zero, + * except the diagonal which is set to 1.0. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixEliminateRowsCols(hypre_CSRMatrix *A, + HYPRE_Int nrows, + HYPRE_Int *rows) +{ + HYPRE_Int nnz = hypre_CSRMatrixNumNonzeros(A); + HYPRE_Int *A_i = hypre_CSRMatrixI(A); + HYPRE_Int *A_j = hypre_CSRMatrixJ(A); + HYPRE_Real *A_a = hypre_CSRMatrixData(A); + + HYPRE_Int i, j; + HYPRE_Int irow; + + /* Remove the columns */ + for (i = 0; i < nnz; i++) + { + irow = hypre_BinarySearch(rows, A_j[i], nrows); + if (irow != -1) + { + A_a[i] = 0.0; + } + } + + /* Remove the rows and set the diagonal equal to 1 */ + for (i = 0; i < nrows; i++) + { + irow = rows[i]; + for (j = A_i[irow]; j < A_i[irow + 1]; j++) + { + if (A_j[j] == irow) + { + A_a[j] = 1.0; + } + else + { + A_a[j] = 0.0; + } + } + } + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- * hypre_CSRMatrixPrefetch *--------------------------------------------------------------------------*/ diff --git a/src/seq_mv/csr_matrix.h b/src/seq_mv/csr_matrix.h index 2a7c0c09cd..69a9e24b9b 100644 --- a/src/seq_mv/csr_matrix.h +++ b/src/seq_mv/csr_matrix.h @@ -40,7 +40,7 @@ typedef struct HYPRE_Int num_nonzeros; hypre_int *i_short; hypre_int *j_short; - HYPRE_Int owns_data; /* Does the CSRMatrix create/destroy `data', `i', `j'? */ + HYPRE_Int owns_data; /* Does the CSRMatrix create/destroy `j`, `big_j`, and `data'? */ 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 */ @@ -55,6 +55,10 @@ typedef struct hypre_CsrsvData *csrsv_data; hypre_GpuMatData *mat_data; #endif + +#if defined(HYPRE_MIXED_PRECISION) + HYPRE_Precision matrix_precision; +#endif } hypre_CSRMatrix; /*-------------------------------------------------------------------------- @@ -83,8 +87,9 @@ typedef struct #define hypre_CSRMatrixGPUMatData(matrix) ((matrix) -> mat_data) #endif -HYPRE_Int hypre_CSRMatrixGetLoadBalancedPartitionBegin( hypre_CSRMatrix *A ); -HYPRE_Int hypre_CSRMatrixGetLoadBalancedPartitionEnd( hypre_CSRMatrix *A ); +#ifdef HYPRE_MIXED_PRECISION +#define hypre_CSRMatrixPrecision(matrix) ((matrix) -> matrix_precision) +#endif /*-------------------------------------------------------------------------- * CSR Boolean Matrix diff --git a/src/seq_mv/csr_matrix_cuda_utils.c b/src/seq_mv/csr_matrix_cuda_utils.c index 0a78be5659..3bfed89867 100644 --- a/src/seq_mv/csr_matrix_cuda_utils.c +++ b/src/seq_mv/csr_matrix_cuda_utils.c @@ -5,7 +5,7 @@ * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #include "_hypre_utilities.hpp" #include "seq_mv.hpp" diff --git a/src/seq_mv/csr_matvec.c b/src/seq_mv/csr_matvec.c index 543009a392..6c6040c2ae 100644 --- a/src/seq_mv/csr_matvec.c +++ b/src/seq_mv/csr_matvec.c @@ -11,7 +11,7 @@ * *****************************************************************************/ -#include "seq_mv.h" +#include "_hypre_seq_mv.h" /*-------------------------------------------------------------------------- * hypre_CSRMatrixMatvec diff --git a/src/seq_mv/csr_matvec_device.c b/src/seq_mv/csr_matvec_device.c index 0d523504ff..24c9546aaf 100644 --- a/src/seq_mv/csr_matvec_device.c +++ b/src/seq_mv/csr_matvec_device.c @@ -11,7 +11,7 @@ * *****************************************************************************/ -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #include "_hypre_utilities.hpp" #include "seq_mv.hpp" diff --git a/src/seq_mv/csr_matvec_oomp.c b/src/seq_mv/csr_matvec_oomp.c index 75aec4d2a0..339c13bcd6 100644 --- a/src/seq_mv/csr_matvec_oomp.c +++ b/src/seq_mv/csr_matvec_oomp.c @@ -11,7 +11,7 @@ * *****************************************************************************/ -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #include "_hypre_utilities.hpp" #if defined(HYPRE_USING_DEVICE_OPENMP) diff --git a/src/seq_mv/csr_spadd_device.c b/src/seq_mv/csr_spadd_device.c index e080a14bb7..0da94e12c8 100644 --- a/src/seq_mv/csr_spadd_device.c +++ b/src/seq_mv/csr_spadd_device.c @@ -6,7 +6,7 @@ ******************************************************************************/ #include "_hypre_onedpl.hpp" -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #include "_hypre_utilities.hpp" #if defined(HYPRE_USING_GPU) diff --git a/src/seq_mv/csr_spgemm_device.c b/src/seq_mv/csr_spgemm_device.c index 877be714f8..12917e8dbe 100644 --- a/src/seq_mv/csr_spgemm_device.c +++ b/src/seq_mv/csr_spgemm_device.c @@ -5,7 +5,7 @@ * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #include "csr_spgemm_device.h" #include "seq_mv.hpp" diff --git a/src/seq_mv/csr_spgemm_device.h b/src/seq_mv/csr_spgemm_device.h index bbaea86fe4..3c626e6e26 100644 --- a/src/seq_mv/csr_spgemm_device.h +++ b/src/seq_mv/csr_spgemm_device.h @@ -65,6 +65,7 @@ hypre_int get_num_groups(hypre_DeviceItem &item) #if defined(HYPRE_USING_SYCL) return item.get_local_range(0); #else + HYPRE_UNUSED_VAR(item); return blockDim.z; #endif } @@ -76,6 +77,7 @@ hypre_int get_group_id(hypre_DeviceItem &item) #if defined(HYPRE_USING_SYCL) return item.get_local_id(0); #else + HYPRE_UNUSED_VAR(item); return threadIdx.z; #endif } @@ -87,6 +89,7 @@ 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 + HYPRE_UNUSED_VAR(item); return hypre_gpu_get_thread_id<2>(item); #endif } diff --git a/src/seq_mv/csr_spgemm_device_cusparse.c b/src/seq_mv/csr_spgemm_device_cusparse.c index fa2755530f..b6ae7250d1 100644 --- a/src/seq_mv/csr_spgemm_device_cusparse.c +++ b/src/seq_mv/csr_spgemm_device_cusparse.c @@ -5,7 +5,7 @@ * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #include "_hypre_utilities.hpp" #include "seq_mv.hpp" #include "csr_spgemm_device.h" diff --git a/src/seq_mv/csr_spgemm_device_numblocks.c b/src/seq_mv/csr_spgemm_device_numblocks.c index cec1e56fb9..4f733fb62c 100644 --- a/src/seq_mv/csr_spgemm_device_numblocks.c +++ b/src/seq_mv/csr_spgemm_device_numblocks.c @@ -5,7 +5,7 @@ * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #if defined(HYPRE_USING_GPU) diff --git a/src/seq_mv/csr_spgemm_device_numer.c b/src/seq_mv/csr_spgemm_device_numer.c index 7d93d2b3e2..fab92853c4 100644 --- a/src/seq_mv/csr_spgemm_device_numer.c +++ b/src/seq_mv/csr_spgemm_device_numer.c @@ -6,7 +6,7 @@ ******************************************************************************/ #include "_hypre_onedpl.hpp" -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #include "csr_spgemm_device.h" #if defined(HYPRE_USING_GPU) diff --git a/src/seq_mv/csr_spgemm_device_numer.h b/src/seq_mv/csr_spgemm_device_numer.h index 5da274708b..61e16964e4 100644 --- a/src/seq_mv/csr_spgemm_device_numer.h +++ b/src/seq_mv/csr_spgemm_device_numer.h @@ -8,7 +8,7 @@ /*- - - - - - - - - - - - - - - - - - - - - - - - - - * Perform SpGEMM with Row Nnz Upper Bound *- - - - - - - - - - - - - - - - - - - - - - - - - - */ -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #include "csr_spgemm_device.h" /*- - - - - - - - - - - - - - - - - - - - - - - - - - * diff --git a/src/seq_mv/csr_spgemm_device_numer.in b/src/seq_mv/csr_spgemm_device_numer.in index 92463d68ac..d478669620 100644 --- a/src/seq_mv/csr_spgemm_device_numer.in +++ b/src/seq_mv/csr_spgemm_device_numer.in @@ -6,7 +6,7 @@ * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #if defined(HYPRE_USING_GPU) diff --git a/src/seq_mv/csr_spgemm_device_onemklsparse.c b/src/seq_mv/csr_spgemm_device_onemklsparse.c index dc449fae1b..a9098843e5 100644 --- a/src/seq_mv/csr_spgemm_device_onemklsparse.c +++ b/src/seq_mv/csr_spgemm_device_onemklsparse.c @@ -5,7 +5,7 @@ * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #include "_hypre_utilities.hpp" #include "seq_mv.hpp" diff --git a/src/seq_mv/csr_spgemm_device_rocsparse.c b/src/seq_mv/csr_spgemm_device_rocsparse.c index faf37814b5..314dc4b4d5 100644 --- a/src/seq_mv/csr_spgemm_device_rocsparse.c +++ b/src/seq_mv/csr_spgemm_device_rocsparse.c @@ -5,7 +5,7 @@ * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #include "_hypre_utilities.hpp" #include "seq_mv.hpp" diff --git a/src/seq_mv/csr_spgemm_device_rowest.c b/src/seq_mv/csr_spgemm_device_rowest.c index cd6ebb3d1d..abb2effb1a 100644 --- a/src/seq_mv/csr_spgemm_device_rowest.c +++ b/src/seq_mv/csr_spgemm_device_rowest.c @@ -9,7 +9,7 @@ Row size estimations *- - - - - - - - - - - - - - - - - - - - - - - - - - */ -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #include "csr_spgemm_device.h" #if defined(HYPRE_USING_GPU) @@ -72,7 +72,6 @@ void hypre_spgemm_rownnz_naive( hypre_DeviceItem &item, HYPRE_Int *ia, HYPRE_Int *ja, HYPRE_Int *ib, - HYPRE_Int *jb, HYPRE_Int *rcL, HYPRE_Int *rcU ) { @@ -468,13 +467,13 @@ hypreDevice_CSRSpGemmRownnzEstimate( HYPRE_Int m, { /* naive overestimate */ 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 ); + m, /*k,*/ n, d_ia, d_ja, d_ib, NULL, d_rc ); } else if (row_est_mtd == 2) { /* naive underestimate */ 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 ); + m, /*k,*/ n, d_ia, d_ja, d_ib, d_rc, NULL ); } else if (row_est_mtd == 3) { @@ -493,7 +492,7 @@ hypreDevice_CSRSpGemmRownnzEstimate( HYPRE_Int m, HYPRE_Int *d_upp = d_low_upp + m; 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 ); + m, /*k,*/ n, d_ia, d_ja, d_ib, d_low, d_upp ); /* Cohen's algorithm, stochastic approach */ hypre_spgemm_rownnz_cohen diff --git a/src/seq_mv/csr_spgemm_device_symbl.c b/src/seq_mv/csr_spgemm_device_symbl.c index f40740191c..08a3b12a4f 100644 --- a/src/seq_mv/csr_spgemm_device_symbl.c +++ b/src/seq_mv/csr_spgemm_device_symbl.c @@ -6,7 +6,7 @@ ******************************************************************************/ #include "_hypre_onedpl.hpp" -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #include "csr_spgemm_device.h" #if defined(HYPRE_USING_GPU) @@ -144,7 +144,7 @@ hypreDevice_CSRSpGemmRownnzUpperbound( HYPRE_Int m, *rownnz_exact_ptr = !HYPRE_THRUST_CALL( any_of, d_rf, d_rf + m, - thrust::identity() ); + HYPRE_THRUST_IDENTITY(char) ); #endif hypre_TFree(d_rf, HYPRE_MEMORY_DEVICE); @@ -231,7 +231,7 @@ hypreDevice_CSRSpGemmRownnzNoBin( HYPRE_Int m, thrust::make_counting_iterator(m), d_rf, d_rind, - thrust::identity() ); + HYPRE_THRUST_IDENTITY(char) ); #endif hypre_assert(new_end - d_rind == num_failed_rows); @@ -340,7 +340,7 @@ hypreDevice_CSRSpGemmRownnzBinned( HYPRE_Int m, thrust::make_counting_iterator(m), d_rf, d_rind, - thrust::identity() ); + HYPRE_THRUST_IDENTITY(char) ); #endif hypre_assert(new_end - d_rind == num_failed_rows); diff --git a/src/seq_mv/csr_spgemm_device_symbl.h b/src/seq_mv/csr_spgemm_device_symbl.h index bf64351fb1..694a4e1da5 100644 --- a/src/seq_mv/csr_spgemm_device_symbl.h +++ b/src/seq_mv/csr_spgemm_device_symbl.h @@ -5,7 +5,7 @@ * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #include "csr_spgemm_device.h" /*- - - - - - - - - - - - - - - - - - - - - - - - - - * diff --git a/src/seq_mv/csr_spgemm_device_symbl.in b/src/seq_mv/csr_spgemm_device_symbl.in index dc51ffad26..aab1560457 100644 --- a/src/seq_mv/csr_spgemm_device_symbl.in +++ b/src/seq_mv/csr_spgemm_device_symbl.in @@ -6,7 +6,7 @@ * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #if defined(HYPRE_USING_GPU) diff --git a/src/seq_mv/csr_spgemm_device_util.c b/src/seq_mv/csr_spgemm_device_util.c index 92044dee03..6bf0aba925 100644 --- a/src/seq_mv/csr_spgemm_device_util.c +++ b/src/seq_mv/csr_spgemm_device_util.c @@ -6,7 +6,7 @@ ******************************************************************************/ #include "_hypre_onedpl.hpp" -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #include "csr_spgemm_device.h" #if defined(HYPRE_USING_GPU) diff --git a/src/seq_mv/csr_spmv_device.c b/src/seq_mv/csr_spmv_device.c index 38cefc7778..8aadfecae6 100644 --- a/src/seq_mv/csr_spmv_device.c +++ b/src/seq_mv/csr_spmv_device.c @@ -11,7 +11,7 @@ * *****************************************************************************/ -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #include "_hypre_utilities.hpp" #if defined(HYPRE_USING_GPU) @@ -165,6 +165,8 @@ hypreGPUKernel_CSRMatvecShuffle(hypre_DeviceItem &item, T beta, T *d_y ) { + HYPRE_UNUSED_VAR(num_vectors); + #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; diff --git a/src/seq_mv/csr_sptrans_device.c b/src/seq_mv/csr_sptrans_device.c index b7285ad4f9..c4799a38bb 100644 --- a/src/seq_mv/csr_sptrans_device.c +++ b/src/seq_mv/csr_sptrans_device.c @@ -6,7 +6,7 @@ ******************************************************************************/ #include "_hypre_onedpl.hpp" -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #include "_hypre_utilities.hpp" #if defined(HYPRE_USING_CUSPARSE) diff --git a/src/seq_mv/genpart.c b/src/seq_mv/genpart.c index ba256be4df..6c164459ad 100644 --- a/src/seq_mv/genpart.c +++ b/src/seq_mv/genpart.c @@ -5,7 +5,7 @@ * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ -#include "seq_mv.h" +#include "_hypre_seq_mv.h" /*-------------------------------------------------------------------------- * hypre_GeneratePartitioning: diff --git a/src/seq_mv/headers b/src/seq_mv/headers index 81f32d156d..267b3beff8 100755 --- a/src/seq_mv/headers +++ b/src/seq_mv/headers @@ -4,7 +4,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -INTERNAL_HEADER=seq_mv.h +INTERNAL_HEADER=_hypre_seq_mv.h #=========================================================================== # Include guards and other includes @@ -14,8 +14,8 @@ cat > $INTERNAL_HEADER <<@ /*** DO NOT EDIT THIS FILE DIRECTLY (use 'headers' to generate) ***/ -#ifndef hypre_MV_HEADER -#define hypre_MV_HEADER +#ifndef hypre_SEQ_MV_HEADER +#define hypre_SEQ_MV_HEADER #include #include @@ -27,6 +27,10 @@ cat > $INTERNAL_HEADER <<@ #include "_hypre_utilities.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_seq_mv_mup_def.h" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -42,6 +46,7 @@ cat mapped_matrix.h >> $INTERNAL_HEADER cat multiblock_matrix.h >> $INTERNAL_HEADER cat vector.h >> $INTERNAL_HEADER cat protos.h >> $INTERNAL_HEADER +cat protos_mp.h >> $INTERNAL_HEADER #../utilities/protos *.c >> $INTERNAL_HEADER @@ -55,7 +60,17 @@ cat >> $INTERNAL_HEADER <<@ } #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_seq_mv_mup_undef.h" +#include "_hypre_seq_mv_mup.h" +#endif +#endif + #endif @ - diff --git a/src/seq_mv/mapped_matrix.c b/src/seq_mv/mapped_matrix.c index 0895371e8b..2bc8d94374 100644 --- a/src/seq_mv/mapped_matrix.c +++ b/src/seq_mv/mapped_matrix.c @@ -11,7 +11,7 @@ * *****************************************************************************/ -#include "seq_mv.h" +#include "_hypre_seq_mv.h" /*-------------------------------------------------------------------------- * hypre_MappedMatrixCreate diff --git a/src/seq_mv/multiblock_matrix.c b/src/seq_mv/multiblock_matrix.c index fce20d179c..3b4d27f587 100644 --- a/src/seq_mv/multiblock_matrix.c +++ b/src/seq_mv/multiblock_matrix.c @@ -11,7 +11,7 @@ * *****************************************************************************/ -#include "seq_mv.h" +#include "_hypre_seq_mv.h" /*-------------------------------------------------------------------------- * hypre_MultiblockMatrixCreate diff --git a/src/seq_mv/mup.fixed b/src/seq_mv/mup.fixed new file mode 100644 index 0000000000..2ab9ea61b5 --- /dev/null +++ b/src/seq_mv/mup.fixed @@ -0,0 +1,142 @@ +hypre_CSRMatrixAdd +hypre_CSRMatrixAddFirstPass +hypre_CSRMatrixAddHost +hypre_CSRMatrixAddPartial +hypre_CSRMatrixAddSecondPass +hypre_CSRMatrixBigInitialize +hypre_CSRMatrixBigJtoJ +hypre_CSRMatrixCheckSetNumNonzeros +hypre_CSRMatrixClone +hypre_CSRMatrixClone_v2 +hypre_CSRMatrixComputeColSum +hypre_CSRMatrixComputeColSumHost +hypre_CSRMatrixComputeRowSum +hypre_CSRMatrixComputeRowSumHost +hypre_CSRMatrixCopy +hypre_CSRMatrixCreate +hypre_CSRMatrixDeleteZeros +hypre_CSRMatrixDestroy +hypre_CSRMatrixDiagScale +hypre_CSRMatrixDiagScaleHost +hypre_CSRMatrixEliminateRowsCols +hypre_CSRMatrixExtractDiagonal +hypre_CSRMatrixExtractDiagonalHost +hypre_CSRMatrixFnorm +hypre_CSRMatrixGetLoadBalancedPartitionBegin +hypre_CSRMatrixGetLoadBalancedPartitionEnd +hypre_CSRMatrixInitialize +hypre_CSRMatrixInitialize_v2 +hypre_CSRMatrixJtoBigJ +hypre_CSRMatrixMatvec +hypre_CSRMatrixMatvecOutOfPlace +hypre_CSRMatrixMatvecOutOfPlaceHost +hypre_CSRMatrixMatvecT +hypre_CSRMatrixMatvecTHost +hypre_CSRMatrixMatvec_FF +hypre_CSRMatrixMigrate +hypre_CSRMatrixMultiply +hypre_CSRMatrixMultiplyHost +hypre_CSRMatrixPermute +hypre_CSRMatrixPermuteHost +hypre_CSRMatrixPrefetch +hypre_CSRMatrixPrint +hypre_CSRMatrixPrintHB +hypre_CSRMatrixPrintIJ +hypre_CSRMatrixPrintMM +hypre_CSRMatrixRead +hypre_CSRMatrixReorder +hypre_CSRMatrixReorderHost +hypre_CSRMatrixResize +hypre_CSRMatrixScale +hypre_CSRMatrixSetConstantValues +hypre_CSRMatrixSetDataOwner +hypre_CSRMatrixSetPatternOnly +hypre_CSRMatrixSetRownnz +hypre_CSRMatrixSetRownnzHost +hypre_CSRMatrixSplit +hypre_CSRMatrixSumElts +hypre_CSRMatrixTaggedFnorm +hypre_CSRMatrixTaggedFnormHost +hypre_CSRMatrixTranspose +hypre_CSRMatrixTransposeHost +hypre_CSRMatrixTruncateDiag +hypre_CSRMatrixUnion +hypre_GenerateLocalPartitioning +hypre_GeneratePartitioning +hypre_MappedMatrixAssemble +hypre_MappedMatrixCreate +hypre_MappedMatrixDestroy +hypre_MappedMatrixGetColIndex +hypre_MappedMatrixGetMatrix +hypre_MappedMatrixInitialize +hypre_MappedMatrixLimitedDestroy +hypre_MappedMatrixPrint +hypre_MappedMatrixSetColMap +hypre_MappedMatrixSetMapData +hypre_MappedMatrixSetMatrix +hypre_MultiblockMatrixAssemble +hypre_MultiblockMatrixCreate +hypre_MultiblockMatrixDestroy +hypre_MultiblockMatrixInitialize +hypre_MultiblockMatrixLimitedDestroy +hypre_MultiblockMatrixPrint +hypre_MultiblockMatrixSetNumSubmatrices +hypre_MultiblockMatrixSetSubmatrix +hypre_MultiblockMatrixSetSubmatrixType +hypre_SeqMultiVectorCreate +hypre_SeqVectorAxpy +hypre_SeqVectorAxpyHost +hypre_SeqVectorAxpyz +hypre_SeqVectorAxpyzHost +hypre_SeqVectorCloneDeep +hypre_SeqVectorCloneDeep_v2 +hypre_SeqVectorCloneShallow +hypre_SeqVectorCopy +hypre_SeqVectorCopyTags +hypre_SeqVectorCreate +hypre_SeqVectorDestroy +hypre_SeqVectorInitialize +hypre_SeqVectorInitializeShell +hypre_SeqVectorInitialize_v2 +hypre_SeqVectorInnerProd +hypre_SeqVectorInnerProdHost +hypre_SeqVectorInnerProdTagged +hypre_SeqVectorInnerProdTaggedHost +hypre_SeqVectorMassAxpy +hypre_SeqVectorMassAxpy4 +hypre_SeqVectorMassAxpy8 +hypre_SeqVectorMassDotpTwo +hypre_SeqVectorMassDotpTwo4 +hypre_SeqVectorMassDotpTwo8 +hypre_SeqVectorMassInnerProd +hypre_SeqVectorMassInnerProd4 +hypre_SeqVectorMassInnerProd8 +hypre_SeqVectorMigrate +hypre_SeqVectorPointwiseDivision +hypre_SeqVectorPointwiseDivisionHost +hypre_SeqVectorPointwiseDivpy +hypre_SeqVectorPointwiseDivpyHost +hypre_SeqVectorPointwiseDivpyMarked +hypre_SeqVectorPointwiseInverse +hypre_SeqVectorPointwiseInverseHost +hypre_SeqVectorPointwiseProduct +hypre_SeqVectorPointwiseProductHost +hypre_SeqVectorPrint +hypre_SeqVectorRead +hypre_SeqVectorResize +hypre_SeqVectorScale +hypre_SeqVectorScaleHost +hypre_SeqVectorSetConstantValues +hypre_SeqVectorSetConstantValuesHost +hypre_SeqVectorSetData +hypre_SeqVectorSetDataOwner +hypre_SeqVectorSetNumTags +hypre_SeqVectorSetOwnsTags +hypre_SeqVectorSetRandomValues +hypre_SeqVectorSetSize +hypre_SeqVectorSetTags +hypre_SeqVectorSetValuesTagged +hypre_SeqVectorSetValuesTaggedHost +hypre_SeqVectorStridedCopy +hypre_SeqVectorSumElts +hypre_SeqVectorSumEltsHost diff --git a/src/seq_mv/mup.functions b/src/seq_mv/mup.functions new file mode 100644 index 0000000000..fe0efc74cf --- /dev/null +++ b/src/seq_mv/mup.functions @@ -0,0 +1,31 @@ +HYPRE_CSRMatrixCreate +HYPRE_CSRMatrixDestroy +HYPRE_CSRMatrixGetNumRows +HYPRE_CSRMatrixInitialize +HYPRE_CSRMatrixPrint +HYPRE_CSRMatrixRead +HYPRE_MappedMatrixAssemble +HYPRE_MappedMatrixCreate +HYPRE_MappedMatrixDestroy +HYPRE_MappedMatrixGetColIndex +HYPRE_MappedMatrixGetMatrix +HYPRE_MappedMatrixInitialize +HYPRE_MappedMatrixLimitedDestroy +HYPRE_MappedMatrixPrint +HYPRE_MappedMatrixSetColMap +HYPRE_MappedMatrixSetMapData +HYPRE_MappedMatrixSetMatrix +HYPRE_MultiblockMatrixAssemble +HYPRE_MultiblockMatrixCreate +HYPRE_MultiblockMatrixDestroy +HYPRE_MultiblockMatrixInitialize +HYPRE_MultiblockMatrixLimitedDestroy +HYPRE_MultiblockMatrixPrint +HYPRE_MultiblockMatrixSetNumSubmatrices +HYPRE_MultiblockMatrixSetSubmatrixType +HYPRE_VectorCopy +HYPRE_VectorCreate +HYPRE_VectorDestroy +HYPRE_VectorInitialize +HYPRE_VectorPrint +HYPRE_VectorRead diff --git a/src/seq_mv/mup.methods b/src/seq_mv/mup.methods new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/seq_mv/mup_code b/src/seq_mv/mup_code new file mode 100755 index 0000000000..d9da19bd59 --- /dev/null +++ b/src/seq_mv/mup_code @@ -0,0 +1,7 @@ +#!/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) + +../config/gen_code.sh HYPRE_seq_mv.h _hypre_seq_mv.h mup diff --git a/src/seq_mv/mup_fixed.c b/src/seq_mv/mup_fixed.c new file mode 100644 index 0000000000..ef655d4bf8 --- /dev/null +++ b/src/seq_mv/mup_fixed.c @@ -0,0 +1,1019 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_seq_mv.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_CSRMatrix * +hypre_CSRMatrixAdd( HYPRE_Complex alpha, hypre_CSRMatrix *A, HYPRE_Complex beta, hypre_CSRMatrix *B ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixAdd)( alpha, A, beta, B ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixAddFirstPass)( firstrow, lastrow, marker, twspace, map_A2C, map_B2C, A, B, nnzrows_C, nrows_C, ncols_C, rownnz_C, memory_location_C, C_i, C_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_CSRMatrix * +hypre_CSRMatrixAddHost( HYPRE_Complex alpha, hypre_CSRMatrix *A, HYPRE_Complex beta, hypre_CSRMatrix *B ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixAddHost)( alpha, A, beta, B ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_CSRMatrix * +hypre_CSRMatrixAddPartial( hypre_CSRMatrix *A, hypre_CSRMatrix *B, HYPRE_Int *row_nums ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixAddPartial)( A, B, row_nums ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixAddSecondPass)( firstrow, lastrow, marker, map_A2C, map_B2C, rownnz_C, alpha, beta, A, B, C ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixBigInitialize( hypre_CSRMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixBigInitialize)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixBigJtoJ( hypre_CSRMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixBigJtoJ)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixCheckSetNumNonzeros( hypre_CSRMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixCheckSetNumNonzeros)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_CSRMatrix * +hypre_CSRMatrixClone( hypre_CSRMatrix *A, HYPRE_Int copy_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixClone)( A, copy_data ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_CSRMatrix * +hypre_CSRMatrixClone_v2( hypre_CSRMatrix *A, HYPRE_Int copy_data, HYPRE_MemoryLocation memory_location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixClone_v2)( A, copy_data, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixComputeColSum( hypre_CSRMatrix *A, HYPRE_Complex *col_sum, HYPRE_Int type, HYPRE_Complex scal ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixComputeColSum)( A, col_sum, type, scal ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixComputeRowSum)( A, CF_i, CF_j, row_sum, type, scal, set_or_add ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixCopy( hypre_CSRMatrix *A, hypre_CSRMatrix *B, HYPRE_Int copy_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixCopy)( A, B, copy_data ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_CSRMatrix * +hypre_CSRMatrixCreate( HYPRE_Int num_rows, HYPRE_Int num_cols, HYPRE_Int num_nonzeros ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixCreate)( num_rows, num_cols, num_nonzeros ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_CSRMatrix * +hypre_CSRMatrixDeleteZeros( hypre_CSRMatrix *A, HYPRE_Real tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixDeleteZeros)( A, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixDestroy( hypre_CSRMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixDestroy)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixDiagScale( hypre_CSRMatrix *A, hypre_Vector *ld, hypre_Vector *rd ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixDiagScale)( A, ld, rd ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixEliminateRowsCols( hypre_CSRMatrix *A, HYPRE_Int nrows, HYPRE_Int *rows ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixEliminateRowsCols)( A, nrows, rows ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixExtractDiagonal( hypre_CSRMatrix *A, HYPRE_Complex *d, HYPRE_Int type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixExtractDiagonal)( A, d, type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixExtractDiagonalHost( hypre_CSRMatrix *A, HYPRE_Complex *d, HYPRE_Int type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixExtractDiagonalHost)( A, d, type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +hypre_CSRMatrixFnorm( hypre_CSRMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixFnorm)( A ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixGetLoadBalancedPartitionBegin( hypre_CSRMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixGetLoadBalancedPartitionBegin)( A ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixGetLoadBalancedPartitionEnd( hypre_CSRMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixGetLoadBalancedPartitionEnd)( A ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixInitialize( hypre_CSRMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixInitialize)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixInitialize_v2( hypre_CSRMatrix *matrix, HYPRE_Int bigInit, HYPRE_MemoryLocation memory_location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixInitialize_v2)( matrix, bigInit, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixJtoBigJ( hypre_CSRMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixJtoBigJ)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixMatvec( HYPRE_Complex alpha, hypre_CSRMatrix *A, hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixMatvec)( alpha, A, x, beta, y ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixMatvecOutOfPlace)( alpha, A, x, beta, b, y, offset ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixMatvecT( HYPRE_Complex alpha, hypre_CSRMatrix *A, hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixMatvecT)( alpha, A, x, beta, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixMatvec_FF)( alpha, A, x, beta, y, CF_marker_x, CF_marker_y, fpt ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixMigrate( hypre_CSRMatrix *A, HYPRE_MemoryLocation memory_location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixMigrate)( A, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_CSRMatrix * +hypre_CSRMatrixMultiply( hypre_CSRMatrix *A, hypre_CSRMatrix *B ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixMultiply)( A, B ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_CSRMatrix * +hypre_CSRMatrixMultiplyHost( hypre_CSRMatrix *A, hypre_CSRMatrix *B ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixMultiplyHost)( A, B ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixPermute( hypre_CSRMatrix *A, HYPRE_Int *perm, HYPRE_Int *rqperm, hypre_CSRMatrix **B_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixPermute)( A, perm, rqperm, B_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixPrefetch( hypre_CSRMatrix *A, HYPRE_MemoryLocation memory_location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixPrefetch)( A, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixPrint( hypre_CSRMatrix *matrix, const char *file_name ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixPrint)( matrix, file_name ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixPrintHB( hypre_CSRMatrix *matrix_input, char *file_name ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixPrintHB)( matrix_input, file_name ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixPrintIJ( hypre_CSRMatrix *matrix, HYPRE_Int base_i, HYPRE_Int base_j, char *filename ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixPrintIJ)( matrix, base_i, base_j, filename ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixPrintMM( hypre_CSRMatrix *matrix, HYPRE_Int basei, HYPRE_Int basej, HYPRE_Int trans, const char *file_name ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixPrintMM)( matrix, basei, basej, trans, file_name ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_CSRMatrix * +hypre_CSRMatrixRead( char *file_name ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixRead)( file_name ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixReorder( hypre_CSRMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixReorder)( A ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixResize( hypre_CSRMatrix *matrix, HYPRE_Int new_num_rows, HYPRE_Int new_num_cols, HYPRE_Int new_num_nonzeros ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixResize)( matrix, new_num_rows, new_num_cols, new_num_nonzeros ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixScale( hypre_CSRMatrix *A, HYPRE_Complex scalar ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixScale)( A, scalar ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixSetConstantValues( hypre_CSRMatrix *A, HYPRE_Complex value ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixSetConstantValues)( A, value ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixSetDataOwner( hypre_CSRMatrix *matrix, HYPRE_Int owns_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixSetDataOwner)( matrix, owns_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixSetPatternOnly( hypre_CSRMatrix *matrix, HYPRE_Int pattern_only ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixSetPatternOnly)( matrix, pattern_only ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixSetRownnz( hypre_CSRMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixSetRownnz)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixSplit)( Bs_ext, first_col_diag_B, last_col_diag_B, num_cols_offd_B, col_map_offd_B, num_cols_offd_C_ptr, col_map_offd_C_ptr, Bext_diag_ptr, Bext_offd_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Complex +hypre_CSRMatrixSumElts( hypre_CSRMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixSumElts)( A ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixTaggedFnorm( hypre_CSRMatrix *A, HYPRE_Int num_tags, HYPRE_Int *tags, HYPRE_Real **tnorms_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixTaggedFnorm)( A, num_tags, tags, tnorms_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixTranspose( hypre_CSRMatrix *A, hypre_CSRMatrix **AT, HYPRE_Int data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixTranspose)( A, AT, data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixTransposeHost( hypre_CSRMatrix *A, hypre_CSRMatrix **AT, HYPRE_Int data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixTransposeHost)( A, AT, data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixTruncateDiag( hypre_CSRMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixTruncateDiag)( A ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CSRMatrixUnion)( A, B, col_map_offd_A, col_map_offd_B, col_map_offd_C ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GenerateLocalPartitioning( HYPRE_BigInt length, HYPRE_Int num_procs, HYPRE_Int myid, HYPRE_BigInt *part ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GenerateLocalPartitioning)( length, num_procs, myid, part ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GeneratePartitioning( HYPRE_BigInt length, HYPRE_Int num_procs, HYPRE_BigInt **part_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GeneratePartitioning)( length, num_procs, part_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MappedMatrixAssemble( hypre_MappedMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MappedMatrixAssemble)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_MappedMatrix * +hypre_MappedMatrixCreate( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MappedMatrixCreate)( ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MappedMatrixDestroy( hypre_MappedMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MappedMatrixDestroy)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MappedMatrixGetColIndex( hypre_MappedMatrix *matrix, HYPRE_Int j ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MappedMatrixGetColIndex)( matrix, j ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_MappedMatrixGetMatrix( hypre_MappedMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MappedMatrixGetMatrix)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MappedMatrixInitialize( hypre_MappedMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MappedMatrixInitialize)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MappedMatrixLimitedDestroy( hypre_MappedMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MappedMatrixLimitedDestroy)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_MappedMatrixPrint( hypre_MappedMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MappedMatrixPrint)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MappedMatrixSetMapData( hypre_MappedMatrix *matrix, void *map_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MappedMatrixSetMapData)( matrix, map_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MappedMatrixSetMatrix( hypre_MappedMatrix *matrix, void *matrix_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MappedMatrixSetMatrix)( matrix, matrix_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MultiblockMatrixAssemble( hypre_MultiblockMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MultiblockMatrixAssemble)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_MultiblockMatrix * +hypre_MultiblockMatrixCreate( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MultiblockMatrixCreate)( ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MultiblockMatrixDestroy( hypre_MultiblockMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MultiblockMatrixDestroy)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MultiblockMatrixInitialize( hypre_MultiblockMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MultiblockMatrixInitialize)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MultiblockMatrixLimitedDestroy( hypre_MultiblockMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MultiblockMatrixLimitedDestroy)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_MultiblockMatrixPrint( hypre_MultiblockMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MultiblockMatrixPrint)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MultiblockMatrixSetNumSubmatrices( hypre_MultiblockMatrix *matrix, HYPRE_Int n ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MultiblockMatrixSetNumSubmatrices)( matrix, n ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MultiblockMatrixSetSubmatrix( hypre_MultiblockMatrix *matrix, HYPRE_Int j, void *submatrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MultiblockMatrixSetSubmatrix)( matrix, j, submatrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MultiblockMatrixSetSubmatrixType( hypre_MultiblockMatrix *matrix, HYPRE_Int j, HYPRE_Int type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MultiblockMatrixSetSubmatrixType)( matrix, j, type ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_Vector * +hypre_SeqMultiVectorCreate( HYPRE_Int size, HYPRE_Int num_vectors ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqMultiVectorCreate)( size, num_vectors ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorAxpy( HYPRE_Complex alpha, hypre_Vector *x, hypre_Vector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorAxpy)( alpha, x, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorAxpyHost( HYPRE_Complex alpha, hypre_Vector *x, hypre_Vector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorAxpyHost)( alpha, x, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorAxpyz( HYPRE_Complex alpha, hypre_Vector *x, HYPRE_Complex beta, hypre_Vector *y, hypre_Vector *z ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorAxpyz)( alpha, x, beta, y, z ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_Vector * +hypre_SeqVectorCloneDeep( hypre_Vector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorCloneDeep)( x ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_Vector * +hypre_SeqVectorCloneDeep_v2( hypre_Vector *x, HYPRE_MemoryLocation memory_location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorCloneDeep_v2)( x, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_Vector * +hypre_SeqVectorCloneShallow( hypre_Vector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorCloneShallow)( x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorCopy( hypre_Vector *x, hypre_Vector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorCopy)( x, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorCopyTags( hypre_Vector *x, hypre_Vector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorCopyTags)( x, y ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_Vector * +hypre_SeqVectorCreate( HYPRE_Int size ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorCreate)( size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorDestroy( hypre_Vector *vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorDestroy)( vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorInitialize( hypre_Vector *vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorInitialize)( vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorInitializeShell( hypre_Vector *vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorInitializeShell)( vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorInitialize_v2( hypre_Vector *vector, HYPRE_MemoryLocation memory_location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorInitialize_v2)( vector, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +hypre_SeqVectorInnerProd( hypre_Vector *x, hypre_Vector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorInnerProd)( x, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +hypre_SeqVectorInnerProdHost( hypre_Vector *x, hypre_Vector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorInnerProdHost)( x, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorInnerProdTagged( hypre_Vector *x, hypre_Vector *y, HYPRE_Complex *iprod ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorInnerProdTagged)( x, y, iprod ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorMassAxpy( HYPRE_Complex *alpha, hypre_Vector **x, hypre_Vector *y, HYPRE_Int k, HYPRE_Int unroll ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorMassAxpy)( alpha, x, y, k, unroll ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorMassAxpy4( HYPRE_Complex *alpha, hypre_Vector **x, hypre_Vector *y, HYPRE_Int k ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorMassAxpy4)( alpha, x, y, k ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorMassAxpy8( HYPRE_Complex *alpha, hypre_Vector **x, hypre_Vector *y, HYPRE_Int k ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorMassAxpy8)( alpha, x, y, k ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorMassDotpTwo)( x, y, z, k, unroll, result_x, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorMassDotpTwo4)( x, y, z, k, result_x, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorMassDotpTwo8)( x, y, z, k, result_x, result_y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorMassInnerProd( hypre_Vector *x, hypre_Vector **y, HYPRE_Int k, HYPRE_Int unroll, HYPRE_Real *result ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorMassInnerProd)( x, y, k, unroll, result ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorMassInnerProd4( hypre_Vector *x, hypre_Vector **y, HYPRE_Int k, HYPRE_Real *result ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorMassInnerProd4)( x, y, k, result ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorMassInnerProd8( hypre_Vector *x, hypre_Vector **y, HYPRE_Int k, HYPRE_Real *result ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorMassInnerProd8)( x, y, k, result ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorMigrate( hypre_Vector *x, HYPRE_MemoryLocation memory_location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorMigrate)( x, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorPointwiseDivision( hypre_Vector *x, hypre_Vector *y, hypre_Vector **z_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorPointwiseDivision)( x, y, z_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorPointwiseDivpy( hypre_Vector *x, hypre_Vector *b, hypre_Vector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorPointwiseDivpy)( x, b, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorPointwiseDivpyMarked( hypre_Vector *x, hypre_Vector *b, hypre_Vector *y, HYPRE_Int *marker, HYPRE_Int marker_val ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorPointwiseDivpyMarked)( x, b, y, marker, marker_val ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorPointwiseInverse( hypre_Vector *x, hypre_Vector **y_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorPointwiseInverse)( x, y_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorPointwiseProduct( hypre_Vector *x, hypre_Vector *y, hypre_Vector **z_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorPointwiseProduct)( x, y, z_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorPrint( hypre_Vector *vector, char *file_name ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorPrint)( vector, file_name ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_Vector * +hypre_SeqVectorRead( char *file_name ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorRead)( file_name ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorResize( hypre_Vector *vector, HYPRE_Int size_in, HYPRE_Int num_vectors_in ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorResize)( vector, size_in, num_vectors_in ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorScale( HYPRE_Complex alpha, hypre_Vector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorScale)( alpha, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorScaleHost( HYPRE_Complex alpha, hypre_Vector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorScaleHost)( alpha, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorSetConstantValues( hypre_Vector *v, HYPRE_Complex value ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorSetConstantValues)( v, value ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorSetConstantValuesHost( hypre_Vector *v, HYPRE_Complex value ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorSetConstantValuesHost)( v, value ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorSetData( hypre_Vector *vector, HYPRE_Complex *data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorSetData)( vector, data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorSetDataOwner( hypre_Vector *vector, HYPRE_Int owns_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorSetDataOwner)( vector, owns_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorSetNumTags( hypre_Vector *vector, HYPRE_Int num_tags ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorSetNumTags)( vector, num_tags ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorSetOwnsTags( hypre_Vector *vector, HYPRE_Int owns_tags ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorSetOwnsTags)( vector, owns_tags ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorSetRandomValues( hypre_Vector *v, HYPRE_Int seed ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorSetRandomValues)( v, seed ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorSetSize( hypre_Vector *vector, HYPRE_Int size ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorSetSize)( vector, size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorSetTags( hypre_Vector *vector, HYPRE_MemoryLocation memory_location, HYPRE_Int *tags ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorSetTags)( vector, memory_location, tags ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorSetValuesTagged( hypre_Vector *vector, HYPRE_Complex *values ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorSetValuesTagged)( vector, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorStridedCopy( hypre_Vector *x, HYPRE_Int istride, HYPRE_Int ostride, HYPRE_Int size, HYPRE_Complex *data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorStridedCopy)( x, istride, ostride, size, data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Complex +hypre_SeqVectorSumElts( hypre_Vector *vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorSumElts)( vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Complex +hypre_SeqVectorSumEltsHost( hypre_Vector *vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeqVectorSumEltsHost)( vector ); +} + + +#endif + diff --git a/src/seq_mv/mup_functions.c b/src/seq_mv/mup_functions.c new file mode 100644 index 0000000000..b5f89c814f --- /dev/null +++ b/src/seq_mv/mup_functions.c @@ -0,0 +1,289 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_seq_mv.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_CSRMatrix +HYPRE_CSRMatrixCreate( HYPRE_Int num_rows, HYPRE_Int num_cols, HYPRE_Int *row_sizes ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_CSRMatrixCreate_pre( precision, num_rows, num_cols, row_sizes ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CSRMatrixDestroy( HYPRE_CSRMatrix matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_CSRMatrixDestroy_pre( precision, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CSRMatrixGetNumRows( HYPRE_CSRMatrix matrix, HYPRE_Int *num_rows ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_CSRMatrixGetNumRows_pre( precision, matrix, num_rows ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CSRMatrixInitialize( HYPRE_CSRMatrix matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_CSRMatrixInitialize_pre( precision, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +void +HYPRE_CSRMatrixPrint( HYPRE_CSRMatrix matrix, char *file_name ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_CSRMatrixPrint_pre( precision, matrix, file_name ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_CSRMatrix +HYPRE_CSRMatrixRead( char *file_name ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_CSRMatrixRead_pre( precision, file_name ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MappedMatrixAssemble( HYPRE_MappedMatrix matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MappedMatrixAssemble_pre( precision, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_MappedMatrix +HYPRE_MappedMatrixCreate( void ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MappedMatrixCreate_pre( precision ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MappedMatrixDestroy( HYPRE_MappedMatrix matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MappedMatrixDestroy_pre( precision, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MappedMatrixGetColIndex( HYPRE_MappedMatrix matrix, HYPRE_Int j ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MappedMatrixGetColIndex_pre( precision, matrix, j ); +} + +/*--------------------------------------------------------------------------*/ + +void * +HYPRE_MappedMatrixGetMatrix( HYPRE_MappedMatrix matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MappedMatrixGetMatrix_pre( precision, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MappedMatrixInitialize( HYPRE_MappedMatrix matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MappedMatrixInitialize_pre( precision, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MappedMatrixLimitedDestroy( HYPRE_MappedMatrix matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MappedMatrixLimitedDestroy_pre( precision, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +void +HYPRE_MappedMatrixPrint( HYPRE_MappedMatrix matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MappedMatrixPrint_pre( precision, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MappedMatrixSetMapData( HYPRE_MappedMatrix matrix, void *MapData ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MappedMatrixSetMapData_pre( precision, matrix, MapData ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MappedMatrixSetMatrix( HYPRE_MappedMatrix matrix, void *matrix_data ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MappedMatrixSetMatrix_pre( precision, matrix, matrix_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MultiblockMatrixAssemble( HYPRE_MultiblockMatrix matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MultiblockMatrixAssemble_pre( precision, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_MultiblockMatrix +HYPRE_MultiblockMatrixCreate( void ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MultiblockMatrixCreate_pre( precision ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MultiblockMatrixDestroy( HYPRE_MultiblockMatrix matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MultiblockMatrixDestroy_pre( precision, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MultiblockMatrixInitialize( HYPRE_MultiblockMatrix matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MultiblockMatrixInitialize_pre( precision, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MultiblockMatrixLimitedDestroy( HYPRE_MultiblockMatrix matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MultiblockMatrixLimitedDestroy_pre( precision, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +void +HYPRE_MultiblockMatrixPrint( HYPRE_MultiblockMatrix matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MultiblockMatrixPrint_pre( precision, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MultiblockMatrixSetNumSubmatrices( HYPRE_MultiblockMatrix matrix, HYPRE_Int n ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MultiblockMatrixSetNumSubmatrices_pre( precision, matrix, n ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MultiblockMatrixSetSubmatrixType( HYPRE_MultiblockMatrix matrix, HYPRE_Int j, HYPRE_Int type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MultiblockMatrixSetSubmatrixType_pre( precision, matrix, j, type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_VectorCopy( HYPRE_Vector xvec, HYPRE_Vector yvec ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_VectorCopy_pre( precision, xvec, yvec ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Vector +HYPRE_VectorCreate( HYPRE_Int size ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_VectorCreate_pre( precision, size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_VectorDestroy( HYPRE_Vector vector ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_VectorDestroy_pre( precision, vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_VectorInitialize( HYPRE_Vector vector ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_VectorInitialize_pre( precision, vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_VectorPrint( HYPRE_Vector vector, char *file_name ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_VectorPrint_pre( precision, vector, file_name ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Vector +HYPRE_VectorRead( char *file_name ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_VectorRead_pre( precision, file_name ); +} + + + +#endif + diff --git a/src/seq_mv/mup_pre.c b/src/seq_mv/mup_pre.c new file mode 100644 index 0000000000..6ed239a0c9 --- /dev/null +++ b/src/seq_mv/mup_pre.c @@ -0,0 +1,559 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_seq_mv.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_CSRMatrix +HYPRE_CSRMatrixCreate_pre( HYPRE_Precision precision, HYPRE_Int num_rows, HYPRE_Int num_cols, HYPRE_Int *row_sizes ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_CSRMatrixCreate_flt( num_rows, num_cols, row_sizes ); + case HYPRE_REAL_DOUBLE: + return HYPRE_CSRMatrixCreate_dbl( num_rows, num_cols, row_sizes ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_CSRMatrixCreate_long_dbl( num_rows, num_cols, row_sizes ); + default: + { HYPRE_CSRMatrix value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CSRMatrixDestroy_pre( HYPRE_Precision precision, HYPRE_CSRMatrix matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_CSRMatrixDestroy_flt( matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_CSRMatrixDestroy_dbl( matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_CSRMatrixDestroy_long_dbl( matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CSRMatrixGetNumRows_pre( HYPRE_Precision precision, HYPRE_CSRMatrix matrix, HYPRE_Int *num_rows ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_CSRMatrixGetNumRows_flt( matrix, num_rows ); + case HYPRE_REAL_DOUBLE: + return HYPRE_CSRMatrixGetNumRows_dbl( matrix, num_rows ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_CSRMatrixGetNumRows_long_dbl( matrix, num_rows ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CSRMatrixInitialize_pre( HYPRE_Precision precision, HYPRE_CSRMatrix matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_CSRMatrixInitialize_flt( matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_CSRMatrixInitialize_dbl( matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_CSRMatrixInitialize_long_dbl( matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +void +HYPRE_CSRMatrixPrint_pre( HYPRE_Precision precision, HYPRE_CSRMatrix matrix, char *file_name ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_CSRMatrixPrint_flt( matrix, file_name ); + case HYPRE_REAL_DOUBLE: + return HYPRE_CSRMatrixPrint_dbl( matrix, file_name ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_CSRMatrixPrint_long_dbl( matrix, file_name ); + default: + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_CSRMatrix +HYPRE_CSRMatrixRead_pre( HYPRE_Precision precision, char *file_name ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_CSRMatrixRead_flt( file_name ); + case HYPRE_REAL_DOUBLE: + return HYPRE_CSRMatrixRead_dbl( file_name ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_CSRMatrixRead_long_dbl( file_name ); + default: + { HYPRE_CSRMatrix value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MappedMatrixAssemble_pre( HYPRE_Precision precision, HYPRE_MappedMatrix matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MappedMatrixAssemble_flt( matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MappedMatrixAssemble_dbl( matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MappedMatrixAssemble_long_dbl( matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_MappedMatrix +HYPRE_MappedMatrixCreate_pre( HYPRE_Precision precision ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MappedMatrixCreate_flt( ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MappedMatrixCreate_dbl( ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MappedMatrixCreate_long_dbl( ); + default: + { HYPRE_MappedMatrix value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MappedMatrixDestroy_pre( HYPRE_Precision precision, HYPRE_MappedMatrix matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MappedMatrixDestroy_flt( matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MappedMatrixDestroy_dbl( matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MappedMatrixDestroy_long_dbl( matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MappedMatrixGetColIndex_pre( HYPRE_Precision precision, HYPRE_MappedMatrix matrix, HYPRE_Int j ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MappedMatrixGetColIndex_flt( matrix, j ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MappedMatrixGetColIndex_dbl( matrix, j ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MappedMatrixGetColIndex_long_dbl( matrix, j ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +void * +HYPRE_MappedMatrixGetMatrix_pre( HYPRE_Precision precision, HYPRE_MappedMatrix matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MappedMatrixGetMatrix_flt( matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MappedMatrixGetMatrix_dbl( matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MappedMatrixGetMatrix_long_dbl( matrix ); + default: + { void * value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MappedMatrixInitialize_pre( HYPRE_Precision precision, HYPRE_MappedMatrix matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MappedMatrixInitialize_flt( matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MappedMatrixInitialize_dbl( matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MappedMatrixInitialize_long_dbl( matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MappedMatrixLimitedDestroy_pre( HYPRE_Precision precision, HYPRE_MappedMatrix matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MappedMatrixLimitedDestroy_flt( matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MappedMatrixLimitedDestroy_dbl( matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MappedMatrixLimitedDestroy_long_dbl( matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +void +HYPRE_MappedMatrixPrint_pre( HYPRE_Precision precision, HYPRE_MappedMatrix matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MappedMatrixPrint_flt( matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MappedMatrixPrint_dbl( matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MappedMatrixPrint_long_dbl( matrix ); + default: + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MappedMatrixSetMapData_pre( HYPRE_Precision precision, HYPRE_MappedMatrix matrix, void *MapData ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MappedMatrixSetMapData_flt( matrix, MapData ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MappedMatrixSetMapData_dbl( matrix, MapData ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MappedMatrixSetMapData_long_dbl( matrix, MapData ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MappedMatrixSetMatrix_pre( HYPRE_Precision precision, HYPRE_MappedMatrix matrix, void *matrix_data ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MappedMatrixSetMatrix_flt( matrix, matrix_data ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MappedMatrixSetMatrix_dbl( matrix, matrix_data ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MappedMatrixSetMatrix_long_dbl( matrix, matrix_data ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MultiblockMatrixAssemble_pre( HYPRE_Precision precision, HYPRE_MultiblockMatrix matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MultiblockMatrixAssemble_flt( matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MultiblockMatrixAssemble_dbl( matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MultiblockMatrixAssemble_long_dbl( matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_MultiblockMatrix +HYPRE_MultiblockMatrixCreate_pre( HYPRE_Precision precision ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MultiblockMatrixCreate_flt( ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MultiblockMatrixCreate_dbl( ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MultiblockMatrixCreate_long_dbl( ); + default: + { HYPRE_MultiblockMatrix value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MultiblockMatrixDestroy_pre( HYPRE_Precision precision, HYPRE_MultiblockMatrix matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MultiblockMatrixDestroy_flt( matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MultiblockMatrixDestroy_dbl( matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MultiblockMatrixDestroy_long_dbl( matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MultiblockMatrixInitialize_pre( HYPRE_Precision precision, HYPRE_MultiblockMatrix matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MultiblockMatrixInitialize_flt( matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MultiblockMatrixInitialize_dbl( matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MultiblockMatrixInitialize_long_dbl( matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MultiblockMatrixLimitedDestroy_pre( HYPRE_Precision precision, HYPRE_MultiblockMatrix matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MultiblockMatrixLimitedDestroy_flt( matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MultiblockMatrixLimitedDestroy_dbl( matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MultiblockMatrixLimitedDestroy_long_dbl( matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +void +HYPRE_MultiblockMatrixPrint_pre( HYPRE_Precision precision, HYPRE_MultiblockMatrix matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MultiblockMatrixPrint_flt( matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MultiblockMatrixPrint_dbl( matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MultiblockMatrixPrint_long_dbl( matrix ); + default: + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MultiblockMatrixSetNumSubmatrices_pre( HYPRE_Precision precision, HYPRE_MultiblockMatrix matrix, HYPRE_Int n ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MultiblockMatrixSetNumSubmatrices_flt( matrix, n ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MultiblockMatrixSetNumSubmatrices_dbl( matrix, n ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MultiblockMatrixSetNumSubmatrices_long_dbl( matrix, n ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MultiblockMatrixSetSubmatrixType_pre( HYPRE_Precision precision, HYPRE_MultiblockMatrix matrix, HYPRE_Int j, HYPRE_Int type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MultiblockMatrixSetSubmatrixType_flt( matrix, j, type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MultiblockMatrixSetSubmatrixType_dbl( matrix, j, type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MultiblockMatrixSetSubmatrixType_long_dbl( matrix, j, type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_VectorCopy_pre( HYPRE_Precision precision, HYPRE_Vector xvec, HYPRE_Vector yvec ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_VectorCopy_flt( xvec, yvec ); + case HYPRE_REAL_DOUBLE: + return HYPRE_VectorCopy_dbl( xvec, yvec ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_VectorCopy_long_dbl( xvec, yvec ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Vector +HYPRE_VectorCreate_pre( HYPRE_Precision precision, HYPRE_Int size ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_VectorCreate_flt( size ); + case HYPRE_REAL_DOUBLE: + return HYPRE_VectorCreate_dbl( size ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_VectorCreate_long_dbl( size ); + default: + { HYPRE_Vector value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_VectorDestroy_pre( HYPRE_Precision precision, HYPRE_Vector vector ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_VectorDestroy_flt( vector ); + case HYPRE_REAL_DOUBLE: + return HYPRE_VectorDestroy_dbl( vector ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_VectorDestroy_long_dbl( vector ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_VectorInitialize_pre( HYPRE_Precision precision, HYPRE_Vector vector ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_VectorInitialize_flt( vector ); + case HYPRE_REAL_DOUBLE: + return HYPRE_VectorInitialize_dbl( vector ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_VectorInitialize_long_dbl( vector ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_VectorPrint_pre( HYPRE_Precision precision, HYPRE_Vector vector, char *file_name ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_VectorPrint_flt( vector, file_name ); + case HYPRE_REAL_DOUBLE: + return HYPRE_VectorPrint_dbl( vector, file_name ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_VectorPrint_long_dbl( vector, file_name ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Vector +HYPRE_VectorRead_pre( HYPRE_Precision precision, char *file_name ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_VectorRead_flt( file_name ); + case HYPRE_REAL_DOUBLE: + return HYPRE_VectorRead_dbl( file_name ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_VectorRead_long_dbl( file_name ); + default: + { HYPRE_Vector value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + + + +#endif + diff --git a/src/seq_mv/protos.h b/src/seq_mv/protos.h index 09eb9de569..8902995a7a 100644 --- a/src/seq_mv/protos.h +++ b/src/seq_mv/protos.h @@ -42,7 +42,7 @@ hypre_CSRMatrix * hypre_CSRMatrixAddPartial( hypre_CSRMatrix *A, hypre_CSRMatrix HYPRE_Int *row_nums); HYPRE_Int 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 ); + const char *set_or_add); HYPRE_Int hypre_CSRMatrixComputeColSum( hypre_CSRMatrix *A, HYPRE_Complex *col_sum, HYPRE_Int type, HYPRE_Complex scal ); HYPRE_Int hypre_CSRMatrixExtractDiagonal( hypre_CSRMatrix *A, HYPRE_Complex *d, HYPRE_Int type); @@ -59,6 +59,7 @@ hypre_CSRMatrix *hypre_CSRMatrixAddDevice ( HYPRE_Complex alpha, hypre_CSRMatrix hypre_CSRMatrix *hypre_CSRMatrixMultiplyDevice ( hypre_CSRMatrix *A, hypre_CSRMatrix *B ); hypre_CSRMatrix *hypre_CSRMatrixTripleMultiplyDevice ( hypre_CSRMatrix *A, hypre_CSRMatrix *B, hypre_CSRMatrix *C ); +hypre_CSRMatrix *hypre_CSRMatrixDeleteZerosDevice ( hypre_CSRMatrix *A, HYPRE_Real tol ); 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 ); @@ -74,6 +75,7 @@ HYPRE_Int hypre_CSRMatrixSplitDevice(hypre_CSRMatrix *B_ext, HYPRE_BigInt first_ 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_CSRMatrixSetRownnzDevice( hypre_CSRMatrix *A ); HYPRE_Int hypre_CSRMatrixTransposeDevice ( hypre_CSRMatrix *A, hypre_CSRMatrix **AT, HYPRE_Int data ); hypre_CSRMatrix* hypre_CSRMatrixAddPartialDevice( hypre_CSRMatrix *A, hypre_CSRMatrix *B, @@ -154,10 +156,13 @@ hypre_CSRMatrix *hypre_CSRMatrixUnion( hypre_CSRMatrix *A, HYPRE_BigInt *col_map_offd_A, HYPRE_BigInt *col_map_offd_B, HYPRE_BigInt **col_map_offd_C ); +HYPRE_Int hypre_CSRMatrixGetLoadBalancedPartitionBegin( hypre_CSRMatrix *A ); +HYPRE_Int hypre_CSRMatrixGetLoadBalancedPartitionEnd( hypre_CSRMatrix *A ); 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_CSRMatrixEliminateRowsCols(hypre_CSRMatrix *A, HYPRE_Int nrows, HYPRE_Int *rows); /* csr_matvec.c */ // y[offset:end] = alpha*A[offset:end,:]*x + beta*b[offset:end] @@ -195,47 +200,6 @@ HYPRE_Int hypre_GeneratePartitioning ( HYPRE_BigInt length, HYPRE_Int num_procs, 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_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 ); - -/* HYPRE_mapped_matrix.c */ -HYPRE_MappedMatrix HYPRE_MappedMatrixCreate ( void ); -HYPRE_Int HYPRE_MappedMatrixDestroy ( HYPRE_MappedMatrix matrix ); -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 ); -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_multiblock_matrix.c */ -HYPRE_MultiblockMatrix HYPRE_MultiblockMatrixCreate ( void ); -HYPRE_Int HYPRE_MultiblockMatrixDestroy ( HYPRE_MultiblockMatrix matrix ); -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_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_Vector HYPRE_VectorRead ( char *file_name ); - /* mapped_matrix.c */ hypre_MappedMatrix *hypre_MappedMatrixCreate ( void ); HYPRE_Int hypre_MappedMatrixDestroy ( hypre_MappedMatrix *matrix ); diff --git a/src/seq_mv/protos_mp.h b/src/seq_mv/protos_mp.h new file mode 100644 index 0000000000..08bf3ca646 --- /dev/null +++ b/src/seq_mv/protos_mp.h @@ -0,0 +1,30 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/* Mixed precision function protos */ + +/* seq_mv_mp.c */ + +#ifdef HYPRE_MIXED_PRECISION +HYPRE_Int +hypre_SeqVectorCopy_mp( hypre_Vector *x, + hypre_Vector *y ); + +HYPRE_Int +hypre_SeqVectorAxpy_mp( hypre_double alpha, + hypre_Vector *x, + hypre_Vector *y ); + +HYPRE_Int +hypre_CSRMatrixConvert_mp ( hypre_CSRMatrix *A, + HYPRE_Precision new_precision); + +HYPRE_Int +hypre_SeqVectorConvert_mp ( hypre_Vector *v, + HYPRE_Precision new_precision); + +#endif diff --git a/src/seq_mv/seq_mv.h b/src/seq_mv/seq_mv.h index 7b4c59c1b9..41807fda06 100644 --- a/src/seq_mv/seq_mv.h +++ b/src/seq_mv/seq_mv.h @@ -1,8 +1,8 @@ /*** DO NOT EDIT THIS FILE DIRECTLY (use 'headers' to generate) ***/ -#ifndef hypre_MV_HEADER -#define hypre_MV_HEADER +#ifndef hypre_SEQ_MV_HEADER +#define hypre_SEQ_MV_HEADER #include #include @@ -14,6 +14,10 @@ #include "_hypre_utilities.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_seq_mv_mup_def.h" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -60,7 +64,7 @@ typedef struct HYPRE_Int num_nonzeros; hypre_int *i_short; hypre_int *j_short; - HYPRE_Int owns_data; /* Does the CSRMatrix create/destroy `data', `i', `j'? */ + HYPRE_Int owns_data; /* Does the CSRMatrix create/destroy `j`, `big_j`, and `data'? */ 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 */ @@ -75,6 +79,10 @@ typedef struct hypre_CsrsvData *csrsv_data; hypre_GpuMatData *mat_data; #endif + +#if defined(HYPRE_MIXED_PRECISION) + HYPRE_Precision matrix_precision; +#endif } hypre_CSRMatrix; /*-------------------------------------------------------------------------- @@ -103,8 +111,9 @@ typedef struct #define hypre_CSRMatrixGPUMatData(matrix) ((matrix) -> mat_data) #endif -HYPRE_Int hypre_CSRMatrixGetLoadBalancedPartitionBegin( hypre_CSRMatrix *A ); -HYPRE_Int hypre_CSRMatrixGetLoadBalancedPartitionEnd( hypre_CSRMatrix *A ); +#ifdef HYPRE_MIXED_PRECISION +#define hypre_CSRMatrixPrecision(matrix) ((matrix) -> matrix_precision) +#endif /*-------------------------------------------------------------------------- * CSR Boolean Matrix @@ -259,6 +268,11 @@ typedef struct With rowwise storage, vj[i] = data[ j + num_vectors*i] */ HYPRE_Int vecstride, idxstride; /* ... so vj[i] = data[ j*vecstride + i*idxstride ] regardless of row_storage.*/ + +#if defined(HYPRE_MIXED_PRECISION) + HYPRE_Precision vector_precision; +#endif + } hypre_Vector; /*-------------------------------------------------------------------------- @@ -281,6 +295,10 @@ typedef struct #define hypre_VectorEntryIJ(vector, i, j) \ ((vector) -> data[((vector) -> vecstride) * j + ((vector) -> idxstride) * i]) +#if defined(HYPRE_MIXED_PRECISION) +#define hypre_VectorPrecision(vector) ((vector) -> vector_precision) +#endif + #endif /****************************************************************************** * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other @@ -326,7 +344,7 @@ hypre_CSRMatrix * hypre_CSRMatrixAddPartial( hypre_CSRMatrix *A, hypre_CSRMatrix HYPRE_Int *row_nums); HYPRE_Int 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 ); + const char *set_or_add); HYPRE_Int hypre_CSRMatrixComputeColSum( hypre_CSRMatrix *A, HYPRE_Complex *col_sum, HYPRE_Int type, HYPRE_Complex scal ); HYPRE_Int hypre_CSRMatrixExtractDiagonal( hypre_CSRMatrix *A, HYPRE_Complex *d, HYPRE_Int type); @@ -343,6 +361,7 @@ hypre_CSRMatrix *hypre_CSRMatrixAddDevice ( HYPRE_Complex alpha, hypre_CSRMatrix hypre_CSRMatrix *hypre_CSRMatrixMultiplyDevice ( hypre_CSRMatrix *A, hypre_CSRMatrix *B ); hypre_CSRMatrix *hypre_CSRMatrixTripleMultiplyDevice ( hypre_CSRMatrix *A, hypre_CSRMatrix *B, hypre_CSRMatrix *C ); +hypre_CSRMatrix *hypre_CSRMatrixDeleteZerosDevice ( hypre_CSRMatrix *A, HYPRE_Real tol ); 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 ); @@ -358,6 +377,7 @@ HYPRE_Int hypre_CSRMatrixSplitDevice(hypre_CSRMatrix *B_ext, HYPRE_BigInt first_ 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_CSRMatrixSetRownnzDevice( hypre_CSRMatrix *A ); HYPRE_Int hypre_CSRMatrixTransposeDevice ( hypre_CSRMatrix *A, hypre_CSRMatrix **AT, HYPRE_Int data ); hypre_CSRMatrix* hypre_CSRMatrixAddPartialDevice( hypre_CSRMatrix *A, hypre_CSRMatrix *B, @@ -438,10 +458,13 @@ hypre_CSRMatrix *hypre_CSRMatrixUnion( hypre_CSRMatrix *A, HYPRE_BigInt *col_map_offd_A, HYPRE_BigInt *col_map_offd_B, HYPRE_BigInt **col_map_offd_C ); +HYPRE_Int hypre_CSRMatrixGetLoadBalancedPartitionBegin( hypre_CSRMatrix *A ); +HYPRE_Int hypre_CSRMatrixGetLoadBalancedPartitionEnd( hypre_CSRMatrix *A ); 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_CSRMatrixEliminateRowsCols(hypre_CSRMatrix *A, HYPRE_Int nrows, HYPRE_Int *rows); /* csr_matvec.c */ // y[offset:end] = alpha*A[offset:end,:]*x + beta*b[offset:end] @@ -479,47 +502,6 @@ HYPRE_Int hypre_GeneratePartitioning ( HYPRE_BigInt length, HYPRE_Int num_procs, 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_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 ); - -/* HYPRE_mapped_matrix.c */ -HYPRE_MappedMatrix HYPRE_MappedMatrixCreate ( void ); -HYPRE_Int HYPRE_MappedMatrixDestroy ( HYPRE_MappedMatrix matrix ); -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 ); -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_multiblock_matrix.c */ -HYPRE_MultiblockMatrix HYPRE_MultiblockMatrixCreate ( void ); -HYPRE_Int HYPRE_MultiblockMatrixDestroy ( HYPRE_MultiblockMatrix matrix ); -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_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_Vector HYPRE_VectorRead ( char *file_name ); - /* mapped_matrix.c */ hypre_MappedMatrix *hypre_MappedMatrixCreate ( void ); HYPRE_Int hypre_MappedMatrixDestroy ( hypre_MappedMatrix *matrix ); @@ -694,10 +676,51 @@ 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); +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/* Mixed precision function protos */ + +/* seq_mv_mp.c */ + +#ifdef HYPRE_MIXED_PRECISION +HYPRE_Int +hypre_SeqVectorCopy_mp( hypre_Vector *x, + hypre_Vector *y ); + +HYPRE_Int +hypre_SeqVectorAxpy_mp( hypre_double alpha, + hypre_Vector *x, + hypre_Vector *y ); + +HYPRE_Int +hypre_CSRMatrixConvert_mp ( hypre_CSRMatrix *A, + HYPRE_Precision new_precision); + +HYPRE_Int +hypre_SeqVectorConvert_mp ( hypre_Vector *v, + HYPRE_Precision new_precision); + +#endif #ifdef __cplusplus } #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_seq_mv_mup_undef.h" +#include "_hypre_seq_mv_mup.h" +#endif +#endif + #endif diff --git a/src/seq_mv/seq_mv.hpp b/src/seq_mv/seq_mv.hpp index 273e965090..88f350fd44 100644 --- a/src/seq_mv/seq_mv.hpp +++ b/src/seq_mv/seq_mv.hpp @@ -7,6 +7,10 @@ #ifndef SEQ_MV_HPP #define SEQ_MV_HPP +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_seq_mv_mup_def.h" +#endif + #ifdef __cplusplus extern "C" { #endif diff --git a/src/seq_mv/seq_mv_mp.c b/src/seq_mv/seq_mv_mp.c new file mode 100644 index 0000000000..1f423d9b72 --- /dev/null +++ b/src/seq_mv/seq_mv_mp.c @@ -0,0 +1,455 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 seq_mv mixed-precision interface + * + *****************************************************************************/ + +#include "_hypre_seq_mv.h" + +#if defined(HYPRE_MIXED_PRECISION) + +/****************************************************************************** + * + * Member functions for hypre_Vector class. + * + *****************************************************************************/ + +/*-------------------------------------------------------------------------- + * Mixed precision hypre_SeqVectorCopy -- TODO: Needs GPU support - DOK + * 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_SeqVectorCopy_mp( hypre_Vector *x, + hypre_Vector *y ) +{ + /* + #ifdef HYPRE_PROFILE + hypre_profile_times[HYPRE_TIMER_ID_BLAS1] -= hypre_MPI_Wtime(); + #endif + + hypre_GpuProfilingPushRange("SeqVectorCopy"); + */ + /* determine type of output vector data ==> Precision of y. */ + HYPRE_Precision precision_y = hypre_VectorPrecision (y); + + HYPRE_Int i; + + /* Generic pointer type */ + void *xp, *yp; + + /* Call standard vector copy if precisions match. */ + if (precision_y == hypre_VectorPrecision (x)) + { + return HYPRE_VectorCopy_pre(precision_y, (HYPRE_Vector)x, (HYPRE_Vector)y); + } + + size_t size = hypre_min(hypre_VectorSize(x), hypre_VectorSize(y)) * hypre_VectorNumVectors(x); + + /* Implicit conversion to generic data type (void pointer) */ + xp = hypre_VectorData(x); + yp = hypre_VectorData(y); + + switch (hypre_VectorPrecision (x)) + { + case HYPRE_REAL_SINGLE: + switch (precision_y) + { + case HYPRE_REAL_DOUBLE: +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + { + ((hypre_double *)yp)[i] = (hypre_double)((hypre_float *)xp)[i]; + } + break; + case HYPRE_REAL_LONGDOUBLE: +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + { + ((hypre_long_double *)yp)[i] = (hypre_long_double)((hypre_float *)xp)[i]; + } + break; + default: + break; + } + break; + case HYPRE_REAL_DOUBLE: + switch (precision_y) + { + case HYPRE_REAL_SINGLE: +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + { + ((hypre_float *)yp)[i] = (hypre_float)((hypre_double *)xp)[i]; + } + break; + case HYPRE_REAL_LONGDOUBLE: +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + { + ((hypre_long_double *)yp)[i] = (hypre_long_double)((hypre_double *)xp)[i]; + } + break; + default: + break; + } + break; + case HYPRE_REAL_LONGDOUBLE: + switch (precision_y) + { + case HYPRE_REAL_SINGLE: +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + { + ((hypre_float *)yp)[i] = (hypre_float)((hypre_long_double *)xp)[i]; + } + break; + case HYPRE_REAL_DOUBLE: +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + { + ((hypre_double *)yp)[i] = (hypre_double)((hypre_long_double *)xp)[i]; + } + break; + default: + break; + } + default: + hypre_error_w_msg_mp(HYPRE_ERROR_GENERIC, "Error: Undefined precision type for Vector Copy!\n"); + break; + } + + /* + #ifdef HYPRE_PROFILE + hypre_profile_times[HYPRE_TIMER_ID_BLAS1] += hypre_MPI_Wtime(); + #endif + hypre_GpuProfilingPopRange(); + */ + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Mixed-precision hypre_SeqVectorAxpy -- TODO: Needs GPU support - DOK + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorAxpy_mp( hypre_double alpha, + hypre_Vector *x, + hypre_Vector *y ) +{ + /* + #ifdef HYPRE_PROFILE + hypre_profile_times[HYPRE_TIMER_ID_BLAS1] -= hypre_MPI_Wtime(); + #endif + */ + /* determine type of output vector data ==> Precision of y. */ + HYPRE_Precision precision = hypre_VectorPrecision (y); + + void *xp, *yp; + + HYPRE_Int size = hypre_VectorSize(x); + HYPRE_Int i; + + size *= hypre_VectorNumVectors(x); + + /* Implicit conversion to generic data type (void pointer) */ + xp = hypre_VectorData(x); + yp = hypre_VectorData(y); + + switch (precision) + { + case HYPRE_REAL_SINGLE: +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + { + ((hypre_float *)yp)[i] += (hypre_float)(alpha * ((hypre_double *)xp)[i]); + } + break; + case HYPRE_REAL_DOUBLE: +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + { + ((hypre_double *)yp)[i] += (hypre_double)(alpha * ((hypre_float *)xp)[i]); + } + break; + case HYPRE_REAL_LONGDOUBLE: +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + { + ((hypre_long_double *)yp)[i] += (hypre_long_double)(alpha * ((hypre_double *)xp)[i]); + } + break; + default: + hypre_error_w_msg_mp(HYPRE_ERROR_GENERIC, "Error: Undefined precision type for Vector Axpy!\n"); + } + /* + #ifdef HYPRE_PROFILE + hypre_profile_times[HYPRE_TIMER_ID_BLAS1] += hypre_MPI_Wtime(); + #endif + */ + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Convert precision in a mixed precision vector + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SeqVectorConvert_mp (hypre_Vector *v, + HYPRE_Precision new_precision) +{ + HYPRE_Precision precision = hypre_VectorPrecision (v); + void *data = hypre_VectorData(v); + void *data_mp = NULL; + HYPRE_Int size = hypre_VectorSize(v); + HYPRE_MemoryLocation memory_location = hypre_VectorMemoryLocation(v); + HYPRE_Int i; + + if (new_precision == precision) + return hypre_error_flag; + else + { + switch (precision) + { + case HYPRE_REAL_SINGLE: + { + switch (new_precision) + { + case HYPRE_REAL_DOUBLE: + { + data_mp = (hypre_double *) hypre_CAlloc ((size_t)size, (size_t)sizeof(hypre_double), memory_location); +#ifdef HYPRE_USING_OPENMP +#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + ((hypre_double *)data_mp)[i] = (hypre_double) ((hypre_float *) data)[i]; + } + break; + case HYPRE_REAL_LONGDOUBLE: + { + data_mp = (hypre_long_double *) hypre_CAlloc ((size_t)size, (size_t)sizeof(hypre_long_double), memory_location); +#ifdef HYPRE_USING_OPENMP +#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + ((hypre_long_double *)data_mp)[i] = (hypre_long_double) ((hypre_float *) data)[i]; + } + break; + default: + hypre_error_w_msg_mp(HYPRE_ERROR_GENERIC, "Error: Undefined precision type!\n"); + } + } + break; + case HYPRE_REAL_DOUBLE: + { + switch (new_precision) + { + case HYPRE_REAL_SINGLE: + { + data_mp = (hypre_float *) hypre_CAlloc ((size_t)size, (size_t)sizeof(hypre_float), memory_location); +#ifdef HYPRE_USING_OPENMP +#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + ((hypre_float *)data_mp)[i] = (hypre_float) ((hypre_double *) data)[i]; + } + break; + case HYPRE_REAL_LONGDOUBLE: + { + data_mp = (hypre_long_double *) hypre_CAlloc ((size_t)size, (size_t)sizeof(hypre_long_double), memory_location); +#ifdef HYPRE_USING_OPENMP +#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + ((hypre_long_double *)data_mp)[i] = (hypre_long_double) ((hypre_double *) data)[i]; + } + break; + default: + hypre_error_w_msg_mp(HYPRE_ERROR_GENERIC, "Error: Undefined precision type!\n"); + } + } + break; + case HYPRE_REAL_LONGDOUBLE: + { + switch (new_precision) + { + case HYPRE_REAL_SINGLE: + { + data_mp = (hypre_float *) hypre_CAlloc ((size_t)size, (size_t)sizeof(hypre_float), memory_location); +#ifdef HYPRE_USING_OPENMP +#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + ((hypre_float *)data_mp)[i] = (hypre_float) ((hypre_long_double *) data)[i]; + } + break; + case HYPRE_REAL_DOUBLE: + { + data_mp = (hypre_double *) hypre_CAlloc ((size_t)size, (size_t)sizeof(hypre_double), memory_location); +#ifdef HYPRE_USING_OPENMP +#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + ((hypre_double *)data_mp)[i] = (hypre_double) ((hypre_long_double *) data)[i]; + } + break; + default: + hypre_error_w_msg_mp(HYPRE_ERROR_GENERIC, "Error: Undefined precision type!\n"); + } + } + break; + default: + hypre_error_w_msg_mp(HYPRE_ERROR_GENERIC, "Error: Undefined precision type!\n"); + } + hypre_Free(data, memory_location); + hypre_VectorData(v) = data_mp; + hypre_VectorPrecision(v) = new_precision; + } + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Convert precision in a mixed precision matrix + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CSRMatrixConvert_mp (hypre_CSRMatrix *A, + HYPRE_Precision new_precision) +{ + HYPRE_Precision precision = hypre_CSRMatrixPrecision (A); + void *data = hypre_CSRMatrixData(A); + void *data_mp = NULL; + HYPRE_Int size = hypre_CSRMatrixI(A)[hypre_CSRMatrixNumRows(A)]; + HYPRE_MemoryLocation memory_location = hypre_CSRMatrixMemoryLocation(A); + HYPRE_Int i; + + if (new_precision == precision) + return hypre_error_flag; + else + { + switch (precision) + { + case HYPRE_REAL_SINGLE: + { + switch (new_precision) + { + case HYPRE_REAL_DOUBLE: + { + data_mp = (hypre_double *) hypre_CAlloc ((size_t)size, (size_t)sizeof(hypre_double), memory_location); +#ifdef HYPRE_USING_OPENMP +#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + ((hypre_double *)data_mp)[i] = (hypre_double) ((hypre_float *) data)[i]; + } + break; + case HYPRE_REAL_LONGDOUBLE: + { + data_mp = (hypre_long_double *) hypre_CAlloc ((size_t)size, (size_t)sizeof(hypre_long_double), memory_location); +#ifdef HYPRE_USING_OPENMP +#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + ((hypre_long_double *)data_mp)[i] = (hypre_long_double) ((hypre_float *) data)[i]; + } + break; + default: + hypre_error_w_msg_mp(HYPRE_ERROR_GENERIC, "Error: Undefined precision type!\n"); + } + } + break; + case HYPRE_REAL_DOUBLE: + { + switch (new_precision) + { + case HYPRE_REAL_SINGLE: + { + data_mp = (hypre_float *) hypre_CAlloc ((size_t)size, (size_t)sizeof(hypre_float), memory_location); +#ifdef HYPRE_USING_OPENMP +#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + ((hypre_float *)data_mp)[i] = (hypre_float) ((hypre_double *) data)[i]; + } + break; + case HYPRE_REAL_LONGDOUBLE: + { + data_mp = (hypre_long_double *) hypre_CAlloc ((size_t)size, (size_t)sizeof(hypre_long_double), memory_location); +#ifdef HYPRE_USING_OPENMP +#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + ((hypre_long_double *)data_mp)[i] = (hypre_long_double) ((hypre_double *) data)[i]; + } + break; + default: + hypre_error_w_msg_mp(HYPRE_ERROR_GENERIC, "Error: Undefined precision type!\n"); + } + } + break; + case HYPRE_REAL_LONGDOUBLE: + { + switch (new_precision) + { + case HYPRE_REAL_SINGLE: + { + data_mp = (hypre_float *) hypre_CAlloc ((size_t)size, (size_t)sizeof(hypre_float), memory_location); +#ifdef HYPRE_USING_OPENMP +#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + ((hypre_float *)data_mp)[i] = (hypre_float) ((hypre_long_double *) data)[i]; + } + break; + case HYPRE_REAL_DOUBLE: + { + data_mp = (hypre_double *) hypre_CAlloc ((size_t)size, (size_t)sizeof(hypre_double), memory_location); +#ifdef HYPRE_USING_OPENMP +#pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + ((hypre_double *)data_mp)[i] = (hypre_double) ((hypre_long_double *) data)[i]; + } + break; + default: + hypre_error_w_msg_mp(HYPRE_ERROR_GENERIC, "Error: Undefined precision type!\n"); + } + } + break; + default: + hypre_error_w_msg_mp(HYPRE_ERROR_GENERIC, "Error: Undefined precision type!\n"); + } + hypre_Free(data, memory_location); + hypre_CSRMatrixData(A) = data_mp; + hypre_CSRMatrixPrecision(A) = new_precision; + } + return hypre_error_flag; +} + +#endif diff --git a/src/seq_mv/vector.c b/src/seq_mv/vector.c index 1c96bc3c19..9f96ff83ea 100644 --- a/src/seq_mv/vector.c +++ b/src/seq_mv/vector.c @@ -11,7 +11,7 @@ * *****************************************************************************/ -#include "seq_mv.h" +#include "_hypre_seq_mv.h" /*-------------------------------------------------------------------------- * hypre_SeqVectorCreate @@ -34,6 +34,10 @@ hypre_SeqVectorCreate( HYPRE_Int size ) hypre_VectorOwnsData(vector) = 1; hypre_VectorMemoryLocation(vector) = hypre_HandleMemoryLocation(hypre_handle()); +#if defined(HYPRE_MIXED_PRECISION) + hypre_VectorPrecision(vector) = HYPRE_OBJECT_PRECISION; +#endif + return vector; } diff --git a/src/seq_mv/vector.h b/src/seq_mv/vector.h index 03c7e30d66..d5db2326dc 100644 --- a/src/seq_mv/vector.h +++ b/src/seq_mv/vector.h @@ -38,6 +38,11 @@ typedef struct With rowwise storage, vj[i] = data[ j + num_vectors*i] */ HYPRE_Int vecstride, idxstride; /* ... so vj[i] = data[ j*vecstride + i*idxstride ] regardless of row_storage.*/ + +#if defined(HYPRE_MIXED_PRECISION) + HYPRE_Precision vector_precision; +#endif + } hypre_Vector; /*-------------------------------------------------------------------------- @@ -60,4 +65,8 @@ typedef struct #define hypre_VectorEntryIJ(vector, i, j) \ ((vector) -> data[((vector) -> vecstride) * j + ((vector) -> idxstride) * i]) +#if defined(HYPRE_MIXED_PRECISION) +#define hypre_VectorPrecision(vector) ((vector) -> vector_precision) +#endif + #endif diff --git a/src/seq_mv/vector_batched.c b/src/seq_mv/vector_batched.c index dd7739e23e..6a8371d76d 100644 --- a/src/seq_mv/vector_batched.c +++ b/src/seq_mv/vector_batched.c @@ -5,7 +5,7 @@ * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ -#include "seq_mv.h" +#include "_hypre_seq_mv.h" /*-------------------------------------------------------------------------- * hypre_SeqVectorMassAxpy8 diff --git a/src/seq_mv/vector_device.c b/src/seq_mv/vector_device.c index 9cdde17b5a..d0276ef50e 100644 --- a/src/seq_mv/vector_device.c +++ b/src/seq_mv/vector_device.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_onedpl.hpp" -#include "seq_mv.h" +#include "_hypre_seq_mv.h" #include "_hypre_utilities.hpp" #include "seq_mv.hpp" @@ -423,6 +423,9 @@ hypre_SeqVectorPrefetch( hypre_Vector *x, } hypre_MemPrefetch(x_data, sizeof(HYPRE_Complex) * total_size, memory_location); +#else + HYPRE_UNUSED_VAR(x); + HYPRE_UNUSED_VAR(memory_location); #endif return hypre_error_flag; diff --git a/src/sstruct_ls/CMakeLists.txt b/src/sstruct_ls/CMakeLists.txt index 2d35908a5e..d45687f169 100644 --- a/src/sstruct_ls/CMakeLists.txt +++ b/src/sstruct_ls/CMakeLists.txt @@ -8,77 +8,69 @@ set(HDRS _hypre_sstruct_ls.h ) -set(SRCS +# Add MUP headers when mixed precision is enabled +if(HYPRE_ENABLE_MIXED_PRECISION) + list(APPEND HDRS + HYPRE_sstruct_ls_mup.h + _hypre_sstruct_ls_mup.h + _hypre_sstruct_ls_mup_def.h + _hypre_sstruct_ls_mup_undef.h + ) +endif() + +# Regular sources +set(REGULAR_SRCS F90_HYPRE_sstruct_bicgstab.c F90_HYPRE_sstruct_gmres.c F90_HYPRE_sstruct_flexgmres.c F90_HYPRE_sstruct_lgmres.c - F90_HYPRE_sstruct_InterFAC.c F90_HYPRE_sstruct_int.c - F90_HYPRE_sstruct_maxwell.c F90_HYPRE_sstruct_pcg.c F90_HYPRE_sstruct_split.c F90_HYPRE_sstruct_sys_pfmg.c + F90_HYPRE_sstruct_ssamg.c HYPRE_sstruct_bicgstab.c HYPRE_sstruct_gmres.c HYPRE_sstruct_flexgmres.c HYPRE_sstruct_lgmres.c - HYPRE_sstruct_InterFAC.c HYPRE_sstruct_int.c - HYPRE_sstruct_maxwell.c HYPRE_sstruct_pcg.c HYPRE_sstruct_split.c HYPRE_sstruct_sys_pfmg.c - bsearch.c - fac.c - fac_amr_rap.c - fac_amr_fcoarsen.c - fac_amr_zero_data.c - fac_cf_coarsen.c - fac_cfstencil_box.c - fac_CFInterfaceExtents.c - fac_interp2.c - fac_relax.c - fac_restrict2.c - fac_setup2.c - fac_solve3.c - fac_zero_cdata.c - fac_zero_stencilcoef.c + HYPRE_sstruct_ssamg.c krylov.c krylov_sstruct.c - eliminate_rowscols.c - maxwell_grad.c - maxwell_physbdy.c - maxwell_PNedelec.c - maxwell_PNedelec_bdy.c - maxwell_semi_interp.c - maxwell_solve.c - maxwell_solve2.c - maxwell_TV.c - maxwell_TV_setup.c - maxwell_zeroBC.c - nd1_amge_interpolation.c - node_relax.c - sstruct_amr_intercommunication.c - sstruct_owninfo.c - sstruct_recvinfo.c - sstruct_sendinfo.c - sstruct_sharedDOFComm.c sys_pfmg.c sys_pfmg_relax.c sys_pfmg_setup.c sys_pfmg_setup_interp.c - sys_pfmg_setup_rap.c sys_pfmg_solve.c - sys_semi_interp.c - sys_semi_restrict.c + node_relax.c + ssamg.c + ssamg_csolver.c + ssamg_interp.c + ssamg_relax.c + ssamg_setup.c + ssamg_setup_rap.c + ssamg_solve.c + ssamg_stats.c + ssamg_uinterp.c ) -target_sources(${PROJECT_NAME} - PRIVATE ${SRCS} - ${HDRS} +# Mixed precision sources +set(MUP_SRCS + mup_fixed.c + mup_functions.c + mup_pre.c ) +if(HYPRE_ENABLE_MIXED_PRECISION) + setup_mixed_precision_compilation("sstruct_ls" SRCS "${REGULAR_SRCS}") + target_sources(${PROJECT_NAME} PRIVATE ${MUP_SRCS} ${HDRS}) +else() + target_sources(${PROJECT_NAME} PRIVATE ${REGULAR_SRCS} ${HDRS}) +endif() + if (HYPRE_USING_GPU) set(GPU_SRCS fac_amr_fcoarsen.c @@ -87,6 +79,9 @@ if (HYPRE_USING_GPU) fac_setup2.c fac_zero_stencilcoef.c node_relax.c + ssamg_interp.c + ssamg_relax.c + ssamg_uinterp.c ) convert_filenames_to_full_paths(GPU_SRCS) set(HYPRE_GPU_SOURCES ${HYPRE_GPU_SOURCES} ${GPU_SRCS} PARENT_SCOPE) diff --git a/src/sstruct_ls/F90_HYPRE_sstruct_InterFAC.c b/src/sstruct_ls/F90_HYPRE_sstruct_InterFAC.c deleted file mode 100644 index 3a71be3d1d..0000000000 --- a/src/sstruct_ls/F90_HYPRE_sstruct_InterFAC.c +++ /dev/null @@ -1,439 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_SStructFAC Routines - * - *****************************************************************************/ - -#include "_hypre_sstruct_ls.h" -#include "fortran.h" - -#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) -{ - *ierr = (hypre_F90_Int) - ( HYPRE_SStructFACCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_SStructSolver, solver) )); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACDestroy2 - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_sstructfacdestroy2, HYPRE_SSTRUCTFACDESTROY2) -(hypre_F90_Obj *solver, - hypre_F90_Int *ierr) -{ - *ierr = (hypre_F90_Int) - ( HYPRE_SStructFACDestroy2( - hypre_F90_PassObj (HYPRE_SStructSolver, solver) )); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACAMR_RAP - *--------------------------------------------------------------------------*/ - -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) -{ - *ierr = (hypre_F90_Int) - ( HYPRE_SStructFACAMR_RAP( - hypre_F90_PassObj (HYPRE_SStructMatrix, A), - rfactors, - hypre_F90_PassObjRef (HYPRE_SStructMatrix, facA) )); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACSetup2 - *--------------------------------------------------------------------------*/ - -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) -{ - *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_SStructFACSolve3 - *--------------------------------------------------------------------------*/ - -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) -{ - *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_SStructFACSetTol - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_sstructfacsettol, HYPRE_SSTRUCTFACSETTOL) -(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_SStructFACSetPLevels - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_sstructfacsetplevels, HYPRE_SSTRUCTFACSETPLEVELS) -(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_SStructFACZeroCFSten - *--------------------------------------------------------------------------*/ - -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) -{ - *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_SStructFACZeroFCSten - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_sstructfaczerofcsten, HYPRE_SSTRUCTFACZEROFCSTEN) -(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_SStructFACZeroAMRMatrixData - *--------------------------------------------------------------------------*/ - -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) -{ - *ierr = (hypre_F90_Int) - ( HYPRE_SStructFACZeroAMRMatrixData( - hypre_F90_PassObj (HYPRE_SStructMatrix, A), - hypre_F90_PassInt (part_crse), - rfactors[HYPRE_MAXDIM] )); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACZeroAMRVectorData - *--------------------------------------------------------------------------*/ - -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) -{ - *ierr = (hypre_F90_Int) - ( HYPRE_SStructFACZeroAMRVectorData( - hypre_F90_PassObj (HYPRE_SStructVector, b), - hypre_F90_PassIntArray (plevels), - rfactors )); -} - - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACSetPRefinements - *--------------------------------------------------------------------------*/ - -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) -{ - *ierr = (hypre_F90_Int) - ( HYPRE_SStructFACSetPRefinements( - hypre_F90_PassObj (HYPRE_SStructSolver, solver), - hypre_F90_PassInt (nparts), - rfactors )); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACSetMaxLevels - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_sstructfacsetmaxlevels, HYPRE_SSTRUCTFACSETMAXLEVELS) -(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_SStructFACSetMaxIter - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_sstructfacsetmaxiter, HYPRE_SSTRUCTFACSETMAXITER) -(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_SStructFACSetRelChange - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_sstructfacsetrelchange, HYPRE_SSTRUCTFACSETRELCHANGE) -(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_SStructFACSetZeroGuess - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_sstructfacsetzeroguess, HYPRE_SSTRUCTFACSETZEROGUESS) -(hypre_F90_Obj *solver, - hypre_F90_Int *ierr) -{ - *ierr = (hypre_F90_Int) - ( HYPRE_SStructFACSetZeroGuess( - hypre_F90_PassObj (HYPRE_SStructSolver, solver) )); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACSetNonZeroGuess - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_sstructfacsetnonzeroguess, HYPRE_SSTRUCTFACSETNONZEROGUESS) -(hypre_F90_Obj *solver, - hypre_F90_Int *ierr) -{ - *ierr = (hypre_F90_Int) - ( HYPRE_SStructFACSetNonZeroGuess( - hypre_F90_PassObj (HYPRE_SStructSolver, solver) )); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACSetRelaxType - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_sstructfacsetrelaxtype, HYPRE_SSTRUCTFACSETRELAXTYPE) -(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_SStructFACSetJacobiWeight - *--------------------------------------------------------------------------*/ -void -hypre_F90_IFACE(hypre_sstructfacsetjacobiweigh, HYPRE_SSTRUCTFACSETJACOBIWEIGH) -(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_SStructFACSetNumPreRelax - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_sstructfacsetnumprerelax, HYPRE_SSTRUCTFACSETNUMPRERELAX) -(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_SStructFACSetNumPostRelax - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_sstructfacsetnumpostrelax, HYPRE_SSTRUCTFACSETNUMPOSTRELAX) -(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_SStructFACSetCoarseSolverType - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_sstructfacsetcoarsesolver, HYPRE_SSTRUCTFACSETCOARSESOLVER) -(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))); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACSetLogging - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_sstructfacsetlogging, HYPRE_SSTRUCTFACSETLOGGING) -(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_SStructFACGetNumIterations - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_sstructfacgetnumiteration, HYPRE_SSTRUCTFACGETNUMITERATION) -(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))); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACGetFinalRelativeResidualNorm - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_sstructfacgetfinalrelativ, HYPRE_SSTRUCTFACGETFINALRELATIV) -(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) )); -} - -#ifdef __cplusplus -} -#endif diff --git a/src/sstruct_ls/F90_HYPRE_sstruct_bicgstab.c b/src/sstruct_ls/F90_HYPRE_sstruct_bicgstab.c index 2e002f3bf6..6f31ea7442 100644 --- a/src/sstruct_ls/F90_HYPRE_sstruct_bicgstab.c +++ b/src/sstruct_ls/F90_HYPRE_sstruct_bicgstab.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_sstruct_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/sstruct_ls/F90_HYPRE_sstruct_flexgmres.c b/src/sstruct_ls/F90_HYPRE_sstruct_flexgmres.c index 4d464f2d11..41a3506e7c 100644 --- a/src/sstruct_ls/F90_HYPRE_sstruct_flexgmres.c +++ b/src/sstruct_ls/F90_HYPRE_sstruct_flexgmres.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_sstruct_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/sstruct_ls/F90_HYPRE_sstruct_gmres.c b/src/sstruct_ls/F90_HYPRE_sstruct_gmres.c index 1f1e30b47c..1ce771ad8d 100644 --- a/src/sstruct_ls/F90_HYPRE_sstruct_gmres.c +++ b/src/sstruct_ls/F90_HYPRE_sstruct_gmres.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_sstruct_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/sstruct_ls/F90_HYPRE_sstruct_int.c b/src/sstruct_ls/F90_HYPRE_sstruct_int.c index 2e1e0deb3d..572fbac4e0 100644 --- a/src/sstruct_ls/F90_HYPRE_sstruct_int.c +++ b/src/sstruct_ls/F90_HYPRE_sstruct_int.c @@ -12,60 +12,12 @@ *****************************************************************************/ #include "_hypre_sstruct_ls.h" -#include "fortran.h" -#include "HYPRE_MatvecFunctions.h" +#include "_hypre_fortran.h" #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) -{ - *ierr = (hypre_F90_Int) - ( hypre_SStructPVectorSetRandomValues( - (hypre_SStructPVector *) pvector, - hypre_F90_PassInt (seed) )); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructVectorSetRandomValues - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_sstructvectorsetrandomval, HYPRE_SSTRUCTVECTORSETRANDOMVAL) -(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_SStructSetRandomValues - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_sstructsetrandomvalues, HYPRE_SSTRUCTSETRANDOMVALUES) -(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_SStructVectorSetupInterpreter *--------------------------------------------------------------------------*/ diff --git a/src/sstruct_ls/F90_HYPRE_sstruct_lgmres.c b/src/sstruct_ls/F90_HYPRE_sstruct_lgmres.c index e11e3d0ba0..6a49e32dbc 100644 --- a/src/sstruct_ls/F90_HYPRE_sstruct_lgmres.c +++ b/src/sstruct_ls/F90_HYPRE_sstruct_lgmres.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_sstruct_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/sstruct_ls/F90_HYPRE_sstruct_maxwell.c b/src/sstruct_ls/F90_HYPRE_sstruct_maxwell.c deleted file mode 100644 index 4aa2492c00..0000000000 --- a/src/sstruct_ls/F90_HYPRE_sstruct_maxwell.c +++ /dev/null @@ -1,397 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_SStructMaxwell interface - * - *****************************************************************************/ - -#include "_hypre_sstruct_ls.h" -#include "fortran.h" - -#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) -{ - *ierr = (hypre_F90_Int) - (HYPRE_SStructMaxwellCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_SStructSolver, solver)) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructMaxwellDestroy - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_sstructmaxwelldestroy, HYPRE_SSTRUCTMAXWELLDESTROY) -(hypre_F90_Obj *solver, - hypre_F90_Int *ierr) -{ - *ierr = (hypre_F90_Int) - (HYPRE_SStructMaxwellDestroy( - hypre_F90_PassObj (HYPRE_SStructSolver, solver))); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructMaxwellSetup - *--------------------------------------------------------------------------*/ - -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) -{ - *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_SStructMaxwellSolve - *--------------------------------------------------------------------------*/ - -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) -{ - *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_SStructMaxwellSolve2 - *--------------------------------------------------------------------------*/ - -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) -{ - *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_MaxwellGrad - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_maxwellgrad, HYPRE_MAXWELLGRAD) -(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_SStructMaxwellSetGrad - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_sstructmaxwellsetgrad, HYPRE_SSTRUCTMAXWELLSETGRAD) -(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_SStructMaxwellSetRfactors - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_sstructmaxwellsetrfactors, HYPRE_SSTRUCTMAXWELLSETRFACTORS) -(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_SStructMaxwellSetTol - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_sstructmaxwellsettol, HYPRE_SSTRUCTMAXWELLSETTOL) -(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_SStructMaxwellSetConstantCoef - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_sstructmaxwellsetconstant, HYPRE_SSTRUCTMAXWELLSETCONSTANT) -(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_SStructMaxwellSetMaxIter - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_sstructmaxwellsetmaxiter, HYPRE_SSTRUCTMAXWELLSETMAXITER) -(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_SStructMaxwellSetRelChange - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_sstructmaxwellsetrelchang, HYPRE_SSTRUCTMAXWELLSETRELCHANG) -(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_SStructMaxwellSetNumPreRelax - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_sstructmaxwellsetnumprere, HYPRE_SSTRUCTMAXWELLSETNUMPRERE) -(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_SStructMaxwellSetNumPostRelax - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_sstructmaxwellsetnumpostr, HYPRE_SSTRUCTMAXWELLSETNUMPOSTR) -(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_SStructMaxwellSetLogging - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_sstructmaxwellsetlogging, HYPRE_SSTRUCTMAXWELLSETLOGGING) -(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_SStructMaxwellSetPrintLevel - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_sstructmaxwellsetprintlev, HYPRE_SSTRUCTMAXWELLSETPRINTLEV) -(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_SStructMaxwellPrintLogging - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_sstructmaxwellprintloggin, HYPRE_SSTRUCTMAXWELLPRINTLOGGIN) -(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_SStructMaxwellGetNumIterations - *--------------------------------------------------------------------------*/ - -void -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_SStructMaxwellGetFinalRelativeResidualNorm - *--------------------------------------------------------------------------*/ - -void -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_SStructMaxwellPhysBdy - *--------------------------------------------------------------------------*/ - -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) -{ - *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_SStructMaxwellEliminateRowsCols - *--------------------------------------------------------------------------*/ - -void -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_SStructMaxwellZeroVector - *--------------------------------------------------------------------------*/ - -void -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) )); -} - -#ifdef __cplusplus -} -#endif diff --git a/src/sstruct_ls/F90_HYPRE_sstruct_pcg.c b/src/sstruct_ls/F90_HYPRE_sstruct_pcg.c index 4fbc2105c5..0948764a60 100644 --- a/src/sstruct_ls/F90_HYPRE_sstruct_pcg.c +++ b/src/sstruct_ls/F90_HYPRE_sstruct_pcg.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_sstruct_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/sstruct_ls/F90_HYPRE_sstruct_split.c b/src/sstruct_ls/F90_HYPRE_sstruct_split.c index 8523964e84..162cf5730e 100644 --- a/src/sstruct_ls/F90_HYPRE_sstruct_split.c +++ b/src/sstruct_ls/F90_HYPRE_sstruct_split.c @@ -11,7 +11,7 @@ *****************************************************************************/ #include "_hypre_sstruct_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/sstruct_ls/F90_HYPRE_sstruct_ssamg.c b/src/sstruct_ls/F90_HYPRE_sstruct_ssamg.c new file mode 100644 index 0000000000..3f1a26f71d --- /dev/null +++ b/src/sstruct_ls/F90_HYPRE_sstruct_ssamg.c @@ -0,0 +1,333 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_SStructSSAMG interface + * + *****************************************************************************/ + +#include "_hypre_sstruct_ls.h" +#include "_hypre_fortran.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*-------------------------------------------------------------------------- + * HYPRE_SStructSSAMGCreate + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_sstructssamgcreate, HYPRE_SSTRUCTSSAMGCREATE) +(hypre_F90_Comm *comm, + hypre_F90_Obj *solver, + hypre_F90_Int *ierr) +{ + *ierr = (hypre_F90_Int) + (HYPRE_SStructSSAMGCreate( + hypre_F90_PassComm (comm), + hypre_F90_PassObjRef (HYPRE_SStructSolver, solver) )); +} + +/*-------------------------------------------------------------------------- + * HYPRE_SStructSSAMGDestroy + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_sstructssamgdestroy, HYPRE_SSTRUCTSSAMGDESTROY) +(hypre_F90_Obj *solver, + hypre_F90_Int *ierr) +{ + *ierr = (hypre_F90_Int) + (HYPRE_SStructSSAMGDestroy( + hypre_F90_PassObj (HYPRE_SStructSolver, solver) )); +} + +/*-------------------------------------------------------------------------- + * HYPRE_SStructSSAMGSetup + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_sstructssamgsetup, HYPRE_SSTRUCTSSAMGSETUP) +(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_SStructSSAMGSetup( + 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_SStructSSAMGSolve + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_sstructssamgsolve, HYPRE_SSTRUCTSSAMGSOLVE) +(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_SStructSSAMGSolve( + 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_SStructSSAMGSetTol + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_sstructssamgsettol, HYPRE_SSTRUCTSSAMGSETTOL) +(hypre_F90_Obj *solver, + hypre_F90_Real *tol, + hypre_F90_Int *ierr) +{ + *ierr = (hypre_F90_Int) + (HYPRE_SStructSSAMGSetTol( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassReal (tol) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_SStructSSAMGSetMaxIter + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_sstructssamgsetmaxiter, HYPRE_SSTRUCTSSAMGSETMAXITER) +(hypre_F90_Obj *solver, + hypre_F90_Int *max_iter, + hypre_F90_Int *ierr) +{ + *ierr = (hypre_F90_Int) + (HYPRE_SStructSSAMGSetMaxIter( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (max_iter) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_SStructSSAMGSetRelChange + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_sstructssamgsetrelchang, HYPRE_SSTRUCTSSAMGSETRELCHANG) +(hypre_F90_Obj *solver, + hypre_F90_Int *rel_change, + hypre_F90_Int *ierr) +{ + *ierr = (hypre_F90_Int) + (HYPRE_SStructSSAMGSetRelChange( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (rel_change) )); +} + +/*-------------------------------------------------------------------------- + * HYPRE_SStructSSAMGSetZeroGuess + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_sstructssamgsetzerogues, HYPRE_SSTRUCTSSAMGSETZEROGUES) +(hypre_F90_Obj *solver, + hypre_F90_Int *ierr) +{ + *ierr = (hypre_F90_Int) + (HYPRE_SStructSSAMGSetZeroGuess( + hypre_F90_PassObj (HYPRE_SStructSolver, solver) )); +} + +/*-------------------------------------------------------------------------- + * HYPRE_SStructSSAMGSetNonZeroGuess + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_sstructssamgsetnonzerog, HYPRE_SSTRUCTSSAMGSETNONZEROG) +(hypre_F90_Obj *solver, + hypre_F90_Int *ierr) +{ + *ierr = (hypre_F90_Int) + (HYPRE_SStructSSAMGSetNonZeroGuess( + hypre_F90_PassObj (HYPRE_SStructSolver, solver) )); +} + +/*-------------------------------------------------------------------------- + * HYPRE_SStructSSAMGSetRelaxType + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_sstructssamgsetrelaxtyp, HYPRE_SSTRUCTSSAMGSETRELAXTYP) +(hypre_F90_Obj *solver, + hypre_F90_Int *relax_type, + hypre_F90_Int *ierr) +{ + *ierr = (hypre_F90_Int) + (HYPRE_SStructSSAMGSetRelaxType( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (relax_type) )); +} + +/*-------------------------------------------------------------------------- + * HYPRE_SStructSSAMGSetRelaxWeight + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_sstructssamgsetrelaxwei, HYPRE_SSTRUCTSSAMGSETRELAXWEI) +(hypre_F90_Obj *solver, + hypre_F90_Real *weight, + hypre_F90_Int *ierr) +{ + *ierr = (hypre_F90_Int) + (HYPRE_SStructSSAMGSetRelaxWeight( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassReal (weight) ) ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_SStructSSAMGSetNumPreRelax + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_sstructssamgsetnumprere, HYPRE_SSTRUCTSSAMGSETNUMPRERE) +(hypre_F90_Obj *solver, + hypre_F90_Int *num_pre_relax, + hypre_F90_Int *ierr) +{ + *ierr = (hypre_F90_Int) + (HYPRE_SStructSSAMGSetNumPreRelax( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (num_pre_relax) )); +} + +/*-------------------------------------------------------------------------- + * HYPRE_SStructSSAMGSetNumPostRelax + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_sstructssamgsetnumpostr, HYPRE_SSTRUCTSSAMGSETNUMPOSTR) +(hypre_F90_Obj *solver, + hypre_F90_Int *num_post_relax, + hypre_F90_Int *ierr) +{ + *ierr = (hypre_F90_Int) + (HYPRE_SStructSSAMGSetNumPostRelax( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (num_post_relax) )); +} + +/*-------------------------------------------------------------------------- + * HYPRE_SStructSSAMGSetSkipRelax + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_sstructssamgsetskiprela, HYPRE_SSTRUCTSSAMGSETSKIPRELA) +(hypre_F90_Obj *solver, + hypre_F90_Int *skip_relax, + hypre_F90_Int *ierr) +{ + *ierr = (hypre_F90_Int) + (HYPRE_SStructSSAMGSetSkipRelax( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (skip_relax) )); +} + +/*-------------------------------------------------------------------------- + * HYPRE_SStructSSAMGSetDxyz + * + * TODO: hypre_F90_PassRealArray (dxyz) might be wrong + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_sstructssamgsetdxyz, HYPRE_SSTRUCTSSAMGSETDXYZ) +(hypre_F90_Obj *solver, + hypre_F90_Int *nparts, + hypre_F90_RealArray2D **dxyz, + hypre_F90_Int *ierr) +{ + *ierr = (hypre_F90_Int) + (HYPRE_SStructSSAMGSetDxyz( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (nparts), + hypre_F90_PassRealArray2D (dxyz) )); +} + +/*-------------------------------------------------------------------------- + * HYPRE_SStructSSAMGSetLogging + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_sstructssamgsetlogging, HYPRE_SSTRUCTSSAMGSETLOGGING) +(hypre_F90_Obj *solver, + hypre_F90_Int *logging, + hypre_F90_Int *ierr) +{ + *ierr = (hypre_F90_Int) + (HYPRE_SStructSSAMGSetLogging( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (logging) )); +} + +/*-------------------------------------------------------------------------- + HYPRE_SStructSSAMGSetPrintLevel + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_sstructssamgsetprintlev, HYPRE_SSTRUCTSSAMGSETPRINTLEV) +(hypre_F90_Obj *solver, + hypre_F90_Int *print_level, + hypre_F90_Int *ierr) +{ + *ierr = (hypre_F90_Int) + (HYPRE_SStructSSAMGSetPrintLevel( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassInt (print_level) )); +} + +/*-------------------------------------------------------------------------- + * HYPRE_SStructSSAMGGetNumIterations + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_sstructssamggetnumitera, HYPRE_SSTRUCTSSAMGGETNUMITERA) +(hypre_F90_Obj *solver, + hypre_F90_Int *num_iterations, + hypre_F90_Int *ierr) +{ + *ierr = (hypre_F90_Int) + (HYPRE_SStructSSAMGGetNumIterations( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassIntRef (num_iterations) )); +} + +/*-------------------------------------------------------------------------- + * HYPRE_SStructSSAMGGetFinalRelativeResidualNorm + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_sstructssamggetfinalrel, HYPRE_SSTRUCTSSAMGGETFINALREL) +(hypre_F90_Obj *solver, + hypre_F90_Real *norm, + hypre_F90_Int *ierr) +{ + *ierr = (hypre_F90_Int) + (HYPRE_SStructSSAMGGetFinalRelativeResidualNorm( + hypre_F90_PassObj (HYPRE_SStructSolver, solver), + hypre_F90_PassRealRef (norm) )); +} + +#ifdef __cplusplus +} +#endif diff --git a/src/sstruct_ls/F90_HYPRE_sstruct_sys_pfmg.c b/src/sstruct_ls/F90_HYPRE_sstruct_sys_pfmg.c index af16fc8560..74f6bfd0c5 100644 --- a/src/sstruct_ls/F90_HYPRE_sstruct_sys_pfmg.c +++ b/src/sstruct_ls/F90_HYPRE_sstruct_sys_pfmg.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_sstruct_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/sstruct_ls/HYPRE_sstruct_InterFAC.c b/src/sstruct_ls/HYPRE_sstruct_InterFAC.c deleted file mode 100644 index 3fbd3ae9dd..0000000000 --- a/src/sstruct_ls/HYPRE_sstruct_InterFAC.c +++ /dev/null @@ -1,307 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_SStructFAC Routines - * - *****************************************************************************/ - -#include "_hypre_sstruct_ls.h" - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACCreate - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_SStructFACCreate( MPI_Comm comm, HYPRE_SStructSolver *solver ) -{ - *solver = ( (HYPRE_SStructSolver) hypre_FACCreate( comm ) ); - - return 0; -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACDestroy2 - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_SStructFACDestroy2( HYPRE_SStructSolver solver ) -{ - return ( hypre_FACDestroy2( (void *) solver ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACAMR_RAP - *--------------------------------------------------------------------------*/ -HYPRE_Int -HYPRE_SStructFACAMR_RAP( HYPRE_SStructMatrix A, - HYPRE_Int (*rfactors)[HYPRE_MAXDIM], - HYPRE_SStructMatrix *fac_A ) -{ - return ( hypre_AMR_RAP(A, rfactors, fac_A) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACSetup2 - *--------------------------------------------------------------------------*/ -HYPRE_Int -HYPRE_SStructFACSetup2( HYPRE_SStructSolver solver, - HYPRE_SStructMatrix A, - HYPRE_SStructVector b, - HYPRE_SStructVector x ) -{ - return ( hypre_FacSetup2( (void *) solver, - (hypre_SStructMatrix *) A, - (hypre_SStructVector *) b, - (hypre_SStructVector *) x ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACSolve3 - *--------------------------------------------------------------------------*/ -HYPRE_Int -HYPRE_SStructFACSolve3(HYPRE_SStructSolver solver, - HYPRE_SStructMatrix A, - HYPRE_SStructVector b, - HYPRE_SStructVector x) -{ - return ( hypre_FACSolve3((void *) solver, - (hypre_SStructMatrix *) A, - (hypre_SStructVector *) b, - (hypre_SStructVector *) x ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACSetTol - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_SStructFACSetTol( HYPRE_SStructSolver solver, - HYPRE_Real tol ) -{ - return ( hypre_FACSetTol( (void *) solver, tol ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACSetPLevels - *--------------------------------------------------------------------------*/ -HYPRE_Int -HYPRE_SStructFACSetPLevels( HYPRE_SStructSolver solver, - HYPRE_Int nparts, - HYPRE_Int *plevels) -{ - return ( hypre_FACSetPLevels( (void *) solver, nparts, plevels ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACZeroCFSten - *--------------------------------------------------------------------------*/ -HYPRE_Int -HYPRE_SStructFACZeroCFSten( HYPRE_SStructMatrix A, - HYPRE_SStructGrid grid, - HYPRE_Int part, - HYPRE_Int rfactors[HYPRE_MAXDIM] ) -{ - hypre_SStructPMatrix *Af = hypre_SStructMatrixPMatrix(A, part); - hypre_SStructPMatrix *Ac = hypre_SStructMatrixPMatrix(A, part - 1); - - return ( hypre_FacZeroCFSten(Af, Ac, (hypre_SStructGrid *)grid, - part, rfactors) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACZeroFCSten - *--------------------------------------------------------------------------*/ -HYPRE_Int -HYPRE_SStructFACZeroFCSten( HYPRE_SStructMatrix A, - HYPRE_SStructGrid grid, - HYPRE_Int part ) -{ - hypre_SStructPMatrix *Af = hypre_SStructMatrixPMatrix(A, part); - - return ( hypre_FacZeroFCSten(Af, (hypre_SStructGrid *)grid, - part) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACZeroAMRMatrixData - *--------------------------------------------------------------------------*/ -HYPRE_Int -HYPRE_SStructFACZeroAMRMatrixData( HYPRE_SStructMatrix A, - HYPRE_Int part_crse, - HYPRE_Int rfactors[HYPRE_MAXDIM] ) -{ - return ( hypre_ZeroAMRMatrixData(A, part_crse, rfactors) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACZeroAMRVectorData - *--------------------------------------------------------------------------*/ -HYPRE_Int -HYPRE_SStructFACZeroAMRVectorData( HYPRE_SStructVector b, - HYPRE_Int *plevels, - HYPRE_Int (*rfactors)[HYPRE_MAXDIM] ) -{ - return ( hypre_ZeroAMRVectorData(b, plevels, rfactors) ); -} - - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACSetPRefinements - *--------------------------------------------------------------------------*/ -HYPRE_Int -HYPRE_SStructFACSetPRefinements( HYPRE_SStructSolver solver, - HYPRE_Int nparts, - HYPRE_Int (*rfactors)[HYPRE_MAXDIM] ) -{ - return ( hypre_FACSetPRefinements( (void *) solver, - nparts, - rfactors ) ); -} -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACSetMaxLevels - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_SStructFACSetMaxLevels( HYPRE_SStructSolver solver, - HYPRE_Int max_levels ) -{ - return ( hypre_FACSetMaxLevels( (void *) solver, max_levels ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACSetMaxIter - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_SStructFACSetMaxIter( HYPRE_SStructSolver solver, - HYPRE_Int max_iter ) -{ - return ( hypre_FACSetMaxIter( (void *) solver, max_iter ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACSetRelChange - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_SStructFACSetRelChange( HYPRE_SStructSolver solver, - HYPRE_Int rel_change ) -{ - return ( hypre_FACSetRelChange( (void *) solver, rel_change ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACSetZeroGuess - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_SStructFACSetZeroGuess( HYPRE_SStructSolver solver ) -{ - return ( hypre_FACSetZeroGuess( (void *) solver, 1 ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACSetNonZeroGuess - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_SStructFACSetNonZeroGuess( HYPRE_SStructSolver solver ) -{ - return ( hypre_FACSetZeroGuess( (void *) solver, 0 ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACSetRelaxType - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_SStructFACSetRelaxType( HYPRE_SStructSolver solver, - HYPRE_Int relax_type ) -{ - return ( hypre_FACSetRelaxType( (void *) solver, relax_type) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACSetJacobiWeight - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_SStructFACSetJacobiWeight( HYPRE_SStructSolver solver, - HYPRE_Real weight) -{ - return ( hypre_FACSetJacobiWeight( (void *) solver, weight) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACSetNumPreRelax - *--------------------------------------------------------------------------*/ -HYPRE_Int -HYPRE_SStructFACSetNumPreRelax( HYPRE_SStructSolver solver, - HYPRE_Int num_pre_relax ) -{ - return ( hypre_FACSetNumPreSmooth( (void *) solver, num_pre_relax) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACSetNumPostRelax - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_SStructFACSetNumPostRelax( HYPRE_SStructSolver solver, - HYPRE_Int num_post_relax ) -{ - return ( hypre_FACSetNumPostSmooth( (void *) solver, num_post_relax) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACSetCoarseSolverType - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_SStructFACSetCoarseSolverType( HYPRE_SStructSolver solver, - HYPRE_Int csolver_type) -{ - return ( hypre_FACSetCoarseSolverType( (void *) solver, csolver_type) ); -} - - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACSetLogging - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_SStructFACSetLogging( HYPRE_SStructSolver solver, - HYPRE_Int logging ) -{ - return ( hypre_FACSetLogging( (void *) solver, logging) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACGetNumIterations - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_SStructFACGetNumIterations( HYPRE_SStructSolver solver, - HYPRE_Int *num_iterations ) -{ - return ( hypre_FACGetNumIterations( (void *) solver, num_iterations ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructFACGetFinalRelativeResidualNorm - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_SStructFACGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, - HYPRE_Real *norm ) -{ - return ( hypre_FACGetFinalRelativeResidualNorm( (void *) solver, norm ) ); -} - - diff --git a/src/sstruct_ls/HYPRE_sstruct_int.c b/src/sstruct_ls/HYPRE_sstruct_int.c index a91fdee119..d934978fb1 100644 --- a/src/sstruct_ls/HYPRE_sstruct_int.c +++ b/src/sstruct_ls/HYPRE_sstruct_int.c @@ -6,51 +6,11 @@ ******************************************************************************/ #include "_hypre_sstruct_ls.h" -#include "interpreter.h" -#include "HYPRE_MatvecFunctions.h" -#include "temp_multivector.h" +#include "_hypre_lobpcg_interpreter.h" +#include "_hypre_lobpcg_temp_multivector.h" -HYPRE_Int -hypre_SStructPVectorSetRandomValues( hypre_SStructPVector *pvector, HYPRE_Int seed ) -{ - HYPRE_Int ierr = 0; - HYPRE_Int nvars = hypre_SStructPVectorNVars(pvector); - hypre_StructVector *svector; - HYPRE_Int var; - - hypre_SeedRand( seed ); - - for (var = 0; var < nvars; var++) - { - svector = hypre_SStructPVectorSVector(pvector, var); - seed = hypre_RandI(); - hypre_StructVectorSetRandomValues(svector, seed); - } - - return ierr; -} - -HYPRE_Int -hypre_SStructVectorSetRandomValues( hypre_SStructVector *vector, HYPRE_Int seed ) -{ - HYPRE_Int ierr = 0; - HYPRE_Int nparts = hypre_SStructVectorNParts(vector); - hypre_SStructPVector *pvector; - HYPRE_Int part; - - hypre_SeedRand( seed ); - - for (part = 0; part < nparts; part++) - { - pvector = hypre_SStructVectorPVector(vector, part); - seed = hypre_RandI(); - hypre_SStructPVectorSetRandomValues(pvector, seed); - } - - return ierr; -} - +/* TODO: This does not belong here */ HYPRE_Int hypre_SStructSetRandomValues( void* v, HYPRE_Int seed ) { diff --git a/src/sstruct_ls/HYPRE_sstruct_ls.h b/src/sstruct_ls/HYPRE_sstruct_ls.h index c4e2356fe1..1440a7dd63 100644 --- a/src/sstruct_ls/HYPRE_sstruct_ls.h +++ b/src/sstruct_ls/HYPRE_sstruct_ls.h @@ -16,6 +16,10 @@ #include "HYPRE_parcsr_ls.h" #include "HYPRE_lobpcg.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_sstruct_ls_mup_def.h" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -52,15 +56,6 @@ typedef HYPRE_Int (*HYPRE_PtrToSStructSolverFcn)(HYPRE_SStructSolver, HYPRE_SStructVector, HYPRE_SStructVector); -#ifndef HYPRE_MODIFYPC -#define HYPRE_MODIFYPC -/* if pc not defined, then may need HYPRE_SOLVER also */ - -typedef HYPRE_Int (*HYPRE_PtrToModifyPCFcn)(HYPRE_Solver, - HYPRE_Int, - HYPRE_Real); -#endif - /**@}*/ /*-------------------------------------------------------------------------- @@ -210,7 +205,10 @@ HYPRE_SStructSysPFMGSetLogging(HYPRE_SStructSolver solver, HYPRE_Int logging); /** - * (Optional) Set the amount of printing to do to the screen. + * (Optional) Control how much information is printed. + * + * - 0 : no printout (default) + * - 1 : print convergence history **/ HYPRE_Int HYPRE_SStructSysPFMGSetPrintLevel(HYPRE_SStructSolver solver, @@ -237,20 +235,20 @@ HYPRE_SStructSysPFMGGetFinalRelativeResidualNorm(HYPRE_SStructSolver solver, *--------------------------------------------------------------------------*/ /** - * @name SStruct Split Solver + * @name SStruct SSAMG Solver + * + * The semi-structured algebraic multigrid (SSAMG) method is an iterative solver + * that can handle problems with multiple parts such as block-structured and + * structured adaptive mesh refinement grids (SAMR). * * @{ **/ -#define HYPRE_PFMG 10 -#define HYPRE_SMG 11 -#define HYPRE_Jacobi 17 - /** * Create a solver object. **/ HYPRE_Int -HYPRE_SStructSplitCreate(MPI_Comm comm, +HYPRE_SStructSSAMGCreate(MPI_Comm comm, HYPRE_SStructSolver *solver); /** @@ -263,14 +261,14 @@ HYPRE_SStructSplitCreate(MPI_Comm comm, * all internal reference counts go to zero. **/ HYPRE_Int -HYPRE_SStructSplitDestroy(HYPRE_SStructSolver solver); +HYPRE_SStructSSAMGDestroy(HYPRE_SStructSolver solver); /** - * Prepare to solve the system. The coefficient data in \e b and \e x is + * Prepare to solve the system. The coefficient data in {\tt b} and {\tt x} is * ignored here, but information about the layout of the data may be used. **/ HYPRE_Int -HYPRE_SStructSplitSetup(HYPRE_SStructSolver solver, +HYPRE_SStructSSAMGSetup(HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x); @@ -279,7 +277,7 @@ HYPRE_SStructSplitSetup(HYPRE_SStructSolver solver, * Solve the system. **/ HYPRE_Int -HYPRE_SStructSplitSolve(HYPRE_SStructSolver solver, +HYPRE_SStructSSAMGSolve(HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x); @@ -288,281 +286,218 @@ HYPRE_SStructSplitSolve(HYPRE_SStructSolver solver, * (Optional) Set the convergence tolerance. **/ HYPRE_Int -HYPRE_SStructSplitSetTol(HYPRE_SStructSolver solver, +HYPRE_SStructSSAMGSetTol(HYPRE_SStructSolver solver, HYPRE_Real tol); /** * (Optional) Set maximum number of iterations. **/ HYPRE_Int -HYPRE_SStructSplitSetMaxIter(HYPRE_SStructSolver solver, +HYPRE_SStructSSAMGSetMaxIter(HYPRE_SStructSolver solver, HYPRE_Int max_iter); /** - * (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. + * (Optional) Set maximum number of levels of the multigrid hierarchy. **/ HYPRE_Int -HYPRE_SStructSplitSetZeroGuess(HYPRE_SStructSolver solver); - -/** - * (Optional) Use a nonzero initial guess. This is the default behavior, but - * this routine allows the user to switch back after using \e SetZeroGuess. - **/ -HYPRE_Int -HYPRE_SStructSplitSetNonZeroGuess(HYPRE_SStructSolver solver); +HYPRE_SStructSSAMGSetMaxLevels(HYPRE_SStructSolver solver, + HYPRE_Int max_levels); /** - * (Optional) Set up the type of diagonal struct solver. Either \e ssolver is - * set to \e HYPRE\_SMG or \e HYPRE\_PFMG. - **/ -HYPRE_Int -HYPRE_SStructSplitSetStructSolver(HYPRE_SStructSolver solver, - HYPRE_Int ssolver ); - -/** - * Return the number of iterations taken. - **/ -HYPRE_Int -HYPRE_SStructSplitGetNumIterations(HYPRE_SStructSolver solver, - HYPRE_Int *num_iterations); - -/** - * Return the norm of the final relative residual. + * (Optional) Additionally require that the relative difference in + * successive iterates be small. **/ HYPRE_Int -HYPRE_SStructSplitGetFinalRelativeResidualNorm(HYPRE_SStructSolver solver, - HYPRE_Real *norm); - -/**@}*/ - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ +HYPRE_SStructSSAMGSetRelChange(HYPRE_SStructSolver solver, + HYPRE_Int rel_change); /** - * @name SStruct FAC Solver + * (Optional) Set type of coarse-grid operator to use. * - * @{ - **/ - -/** - * Create a solver object. - **/ -HYPRE_Int -HYPRE_SStructFACCreate(MPI_Comm comm, - HYPRE_SStructSolver *solver); - -/** - * Destroy a solver object. An object should be explicitly destroyed - * using this destructor when the user's code no longer needs direct - * access to it. Once destroyed, the object must not be referenced - * again. Note that the object may not be deallocated at the - * completion of this call, since there may be internal package - * references to the object. The object will then be destroyed when - * all internal reference counts go to zero. + * Current operators set by {\tt rap\_type} are: + * + * \begin{tabular}{l@{ -- }l} + * 0 & Galerkin (default) \\ + * 1 & non-Galerkin 5-pt or 7-pt stencils \\ + * \end{tabular} + * + * Both operators are constructed algebraically. The non-Galerkin option + * maintains a 5-pt stencil in 2D and a 7-pt stencil in 3D on all grid levels. + * The stencil coefficients are computed by averaging techniques. **/ HYPRE_Int -HYPRE_SStructFACDestroy2(HYPRE_SStructSolver solver); +HYPRE_SStructSSAMGSetNonGalerkinRAP(HYPRE_SStructSolver solver, + HYPRE_Int non_galerkin); /** - * Re-distribute the composite matrix so that the amr hierachy is approximately - * nested. Coarse underlying operators are also formed. + * (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_SStructFACAMR_RAP(HYPRE_SStructMatrix A, - HYPRE_Int (*rfactors)[HYPRE_MAXDIM], - HYPRE_SStructMatrix *fac_A); +HYPRE_SStructSSAMGSetZeroGuess(HYPRE_SStructSolver solver); /** - * Set up the FAC solver structure . + * (Optional) Use a nonzero initial guess. This is the default behavior, but + * this routine allows the user to switch back after using {\tt SetZeroGuess}. **/ HYPRE_Int -HYPRE_SStructFACSetup2(HYPRE_SStructSolver solver, - HYPRE_SStructMatrix A, - HYPRE_SStructVector b, - HYPRE_SStructVector x); +HYPRE_SStructSSAMGSetNonZeroGuess(HYPRE_SStructSolver solver); /** - * Solve the system. + * (Optional) Set interpolation type. + * + * Current interpolation methods set by {\tt interp\_type} are: + * + * \begin{tabular}{l@{ -- }l} + * -1 & Structured interpolation only (default) \\ + * 0 & Structured and classical modified unstructured interpolation \\ + * \end{tabular} **/ HYPRE_Int -HYPRE_SStructFACSolve3(HYPRE_SStructSolver solver, - HYPRE_SStructMatrix A, - HYPRE_SStructVector b, - HYPRE_SStructVector x); +HYPRE_SStructSSAMGSetInterpType(HYPRE_SStructSolver solver, + HYPRE_Int interp_type); /** - * Set up amr structure - **/ -HYPRE_Int -HYPRE_SStructFACSetPLevels(HYPRE_SStructSolver solver, - HYPRE_Int nparts, - HYPRE_Int *plevels); -/** - * Set up amr refinement factors + * (Optional) Set relaxation type. + * + * Current relaxation methods set by {\tt relax\_type} are: + * + * \begin{tabular}{l@{ -- }l} + * 0 & Jacobi \\ + * 1 & Weighted Jacobi (default) \\ + * 2 & L1-Jacobi \\ + * 10 & Red/Black Gauss-Seidel (symmetric: RB pre-relaxation, BR post-relaxation) \\ + * \end{tabular} **/ HYPRE_Int -HYPRE_SStructFACSetPRefinements(HYPRE_SStructSolver solver, - HYPRE_Int nparts, - HYPRE_Int (*rfactors)[HYPRE_MAXDIM] ); +HYPRE_SStructSSAMGSetRelaxType(HYPRE_SStructSolver solver, + HYPRE_Int relax_type); /** - * (Optional, but user must make sure that they do this function otherwise.) - * Zero off the coarse level stencils reaching into a fine level grid. + * (Optional) Skip relaxation on certain grids for isotropic problems. This can + * greatly improve efficiency by eliminating unnecessary relaxations when the + * underlying problem is isotropic. **/ HYPRE_Int -HYPRE_SStructFACZeroCFSten(HYPRE_SStructMatrix A, - HYPRE_SStructGrid grid, - HYPRE_Int part, - HYPRE_Int rfactors[HYPRE_MAXDIM]); +HYPRE_SStructSSAMGSetSkipRelax(HYPRE_SStructSolver solver, + HYPRE_Int skip_relax); /** - * (Optional, but user must make sure that they do this function otherwise.) - * Zero off the fine level stencils reaching into a coarse level grid. + * (Optional) Set Jacobi Weight. **/ HYPRE_Int -HYPRE_SStructFACZeroFCSten(HYPRE_SStructMatrix A, - HYPRE_SStructGrid grid, - HYPRE_Int part); +HYPRE_SStructSSAMGSetRelaxWeight(HYPRE_SStructSolver solver, + HYPRE_Real weight); /** - * (Optional, but user must make sure that they do this function otherwise.) - * Places the identity in the coarse grid matrix underlying the fine patches. - * Required between each pair of amr levels. + * (Optional) Set number of relaxation sweeps before coarse-grid correction. **/ HYPRE_Int -HYPRE_SStructFACZeroAMRMatrixData(HYPRE_SStructMatrix A, - HYPRE_Int part_crse, - HYPRE_Int rfactors[HYPRE_MAXDIM]); +HYPRE_SStructSSAMGSetNumPreRelax(HYPRE_SStructSolver solver, + HYPRE_Int num_pre_relax); /** - * (Optional, but user must make sure that they do this function otherwise.) - * Places zeros in the coarse grid vector underlying the fine patches. - * Required between each pair of amr levels. + * (Optional) Set number of relaxation sweeps after coarse-grid correction. **/ HYPRE_Int -HYPRE_SStructFACZeroAMRVectorData(HYPRE_SStructVector b, - HYPRE_Int *plevels, - HYPRE_Int (*rfactors)[HYPRE_MAXDIM] ); +HYPRE_SStructSSAMGSetNumPostRelax(HYPRE_SStructSolver solver, + HYPRE_Int num_post_relax); /** - * (Optional) Set maximum number of FAC levels. + * (Optional) Set number of relaxation sweeps in the coarse grid. **/ HYPRE_Int -HYPRE_SStructFACSetMaxLevels( HYPRE_SStructSolver solver, - HYPRE_Int max_levels ); -/** - * (Optional) Set the convergence tolerance. - **/ -HYPRE_Int -HYPRE_SStructFACSetTol(HYPRE_SStructSolver solver, - HYPRE_Real tol); -/** - * (Optional) Set maximum number of iterations. - **/ -HYPRE_Int -HYPRE_SStructFACSetMaxIter(HYPRE_SStructSolver solver, - HYPRE_Int max_iter); +HYPRE_SStructSSAMGSetNumCoarseRelax(HYPRE_SStructSolver solver, + HYPRE_Int num_coarse_relax); /** - * (Optional) Additionally require that the relative difference in - * successive iterates be small. + * (Optional) Set maximum size of coarse grid. This option can be disabled + * by setting max_coarse_size to zero. **/ HYPRE_Int -HYPRE_SStructFACSetRelChange(HYPRE_SStructSolver solver, - HYPRE_Int rel_change); +HYPRE_SStructSSAMGSetMaxCoarseSize(HYPRE_SStructSolver solver, + HYPRE_Int max_coarse_size); /** - * (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. + * (Optional) Set coarse solver type for SSAMG. Current options are + * \begin{tabular}{l@{ -- }l} + * 0 & Weighted Jacobi (default) \\ + * 1 & BoomerAMG \\ + * \end{tabular} **/ HYPRE_Int -HYPRE_SStructFACSetZeroGuess(HYPRE_SStructSolver solver); +HYPRE_SStructSSAMGSetCoarseSolverType(HYPRE_SStructSolver solver, + HYPRE_Int csolver_type); /** - * (Optional) Use a nonzero initial guess. This is the default behavior, but - * this routine allows the user to switch back after using \e SetZeroGuess. + * (Optional) Set the grid spacing metric used for coarsening purposes for each part. **/ HYPRE_Int -HYPRE_SStructFACSetNonZeroGuess(HYPRE_SStructSolver solver); +HYPRE_SStructSSAMGSetDxyz(HYPRE_SStructSolver solver, + HYPRE_Int nparts, + HYPRE_Real **dxyz); /** - * (Optional) Set relaxation type. See \ref HYPRE_SStructSysPFMGSetRelaxType - * for appropriate values of \e relax\_type. - **/ -HYPRE_Int -HYPRE_SStructFACSetRelaxType(HYPRE_SStructSolver solver, - HYPRE_Int relax_type); -/** - * (Optional) Set Jacobi weight if weighted Jacobi is used. - **/ -HYPRE_Int -HYPRE_SStructFACSetJacobiWeight(HYPRE_SStructSolver solver, - HYPRE_Real weight); -/** - * (Optional) Set number of relaxation sweeps before coarse-grid correction. + * (Optional) Set the amount of logging to do. **/ HYPRE_Int -HYPRE_SStructFACSetNumPreRelax(HYPRE_SStructSolver solver, - HYPRE_Int num_pre_relax); +HYPRE_SStructSSAMGSetLogging(HYPRE_SStructSolver solver, + HYPRE_Int logging); /** - * (Optional) Set number of relaxation sweeps after coarse-grid correction. - **/ -HYPRE_Int -HYPRE_SStructFACSetNumPostRelax(HYPRE_SStructSolver solver, - HYPRE_Int num_post_relax); -/** - * (Optional) Set coarsest solver type. - * - * Current solver types set by \e csolver\_type are: + * (Optional) Control how much information is printed. * - * - 1 : SysPFMG-PCG (default) - * - 2 : SysPFMG + * - 0 : no printout (default) + * - 1 : print setup info + * - 2 : print convergence history **/ HYPRE_Int -HYPRE_SStructFACSetCoarseSolverType(HYPRE_SStructSolver solver, - HYPRE_Int csolver_type); +HYPRE_SStructSSAMGSetPrintLevel(HYPRE_SStructSolver solver, + HYPRE_Int print_level); /** - * (Optional) Set the amount of logging to do. + * (Optional) Set printing frequency. **/ HYPRE_Int -HYPRE_SStructFACSetLogging(HYPRE_SStructSolver solver, - HYPRE_Int logging); +HYPRE_SStructSSAMGSetPrintFreq(HYPRE_SStructSolver solver, + HYPRE_Int print_freq); /** * Return the number of iterations taken. **/ HYPRE_Int -HYPRE_SStructFACGetNumIterations(HYPRE_SStructSolver solver, - HYPRE_Int *num_iterations); +HYPRE_SStructSSAMGGetNumIterations(HYPRE_SStructSolver solver, + HYPRE_Int *num_iterations); /** * Return the norm of the final relative residual. **/ HYPRE_Int -HYPRE_SStructFACGetFinalRelativeResidualNorm(HYPRE_SStructSolver solver, - HYPRE_Real *norm); +HYPRE_SStructSSAMGGetFinalRelativeResidualNorm(HYPRE_SStructSolver solver, + HYPRE_Real *norm); -/**@}*/ +/*@}*/ /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ + /** - * @name SStruct Maxwell Solver - * - * @{ + * @name SStruct Split Solver **/ +/*@{*/ + +#define HYPRE_PFMG 10 +#define HYPRE_SMG 11 +#define HYPRE_Jacobi 17 /** * Create a solver object. **/ HYPRE_Int -HYPRE_SStructMaxwellCreate( MPI_Comm comm, - HYPRE_SStructSolver *solver ); +HYPRE_SStructSplitCreate(MPI_Comm comm, + HYPRE_SStructSolver *solver); + /** * Destroy a solver object. An object should be explicitly destroyed * using this destructor when the user's code no longer needs direct @@ -573,152 +508,96 @@ HYPRE_SStructMaxwellCreate( MPI_Comm comm, * all internal reference counts go to zero. **/ HYPRE_Int -HYPRE_SStructMaxwellDestroy( HYPRE_SStructSolver solver ); +HYPRE_SStructSplitDestroy(HYPRE_SStructSolver solver); /** * Prepare to solve the system. The coefficient data in \e b and \e x is * ignored here, but information about the layout of the data may be used. **/ HYPRE_Int -HYPRE_SStructMaxwellSetup(HYPRE_SStructSolver solver, - HYPRE_SStructMatrix A, - HYPRE_SStructVector b, - HYPRE_SStructVector x); - -/** - * Solve the system. Full coupling of the augmented system used - * throughout the multigrid hierarchy. - **/ -HYPRE_Int -HYPRE_SStructMaxwellSolve(HYPRE_SStructSolver solver, - HYPRE_SStructMatrix A, - HYPRE_SStructVector b, - HYPRE_SStructVector x); - -/** - * Solve the system. Full coupling of the augmented system used - * only on the finest level, i.e., the node and edge multigrid - * cycles are coupled only on the finest level. - **/ -HYPRE_Int -HYPRE_SStructMaxwellSolve2(HYPRE_SStructSolver solver, - HYPRE_SStructMatrix A, - HYPRE_SStructVector b, - HYPRE_SStructVector x); - -/** - * Sets the gradient operator in the Maxwell solver. - **/ -HYPRE_Int -HYPRE_SStructMaxwellSetGrad(HYPRE_SStructSolver solver, - HYPRE_ParCSRMatrix T); - -/** - * Sets the coarsening factor. - **/ -HYPRE_Int -HYPRE_SStructMaxwellSetRfactors(HYPRE_SStructSolver solver, - HYPRE_Int *rfactors); - -/** - * Finds the physical boundary row ranks on all levels. - **/ -HYPRE_Int -HYPRE_SStructMaxwellPhysBdy(HYPRE_SStructGrid *grid_l, - HYPRE_Int num_levels, - HYPRE_Int *rfactors, - HYPRE_Int ***BdryRanks_ptr, - HYPRE_Int **BdryRanksCnt_ptr ); - -/** - * Eliminates the rows and cols corresponding to the physical boundary in - * a parcsr matrix. - **/ -HYPRE_Int -HYPRE_SStructMaxwellEliminateRowsCols(HYPRE_ParCSRMatrix parA, - HYPRE_Int nrows, - HYPRE_Int *rows ); +HYPRE_SStructSplitSetup(HYPRE_SStructSolver solver, + HYPRE_SStructMatrix A, + HYPRE_SStructVector b, + HYPRE_SStructVector x); /** - * Zeros the rows corresponding to the physical boundary in - * a par vector. + * Solve the system. **/ HYPRE_Int -HYPRE_SStructMaxwellZeroVector(HYPRE_ParVector b, - HYPRE_Int *rows, - HYPRE_Int nrows ); +HYPRE_SStructSplitSolve(HYPRE_SStructSolver solver, + HYPRE_SStructMatrix A, + HYPRE_SStructVector b, + HYPRE_SStructVector x); /** - * (Optional) Set the constant coefficient flag- Nedelec interpolation - * used. + * (Optional) Set the convergence tolerance. **/ HYPRE_Int -HYPRE_SStructMaxwellSetSetConstantCoef(HYPRE_SStructSolver solver, - HYPRE_Int flag); +HYPRE_SStructSplitSetTol(HYPRE_SStructSolver solver, + HYPRE_Real tol); /** - * (Optional) Creates a gradient matrix from the grid. This presupposes - * a particular orientation of the edge elements. + * (Optional) Set maximum number of iterations. **/ HYPRE_Int -HYPRE_SStructMaxwellGrad(HYPRE_SStructGrid grid, - HYPRE_ParCSRMatrix *T); +HYPRE_SStructSplitSetMaxIter(HYPRE_SStructSolver solver, + HYPRE_Int max_iter); /** - * (Optional) Set the convergence tolerance. - **/ -HYPRE_Int -HYPRE_SStructMaxwellSetTol(HYPRE_SStructSolver solver, - HYPRE_Real tol); -/** - * (Optional) Set maximum number of iterations. + * (Optional) Control how much information is printed. + * + * - 0 : no printout (default) + * - 1 : print convergence history **/ HYPRE_Int -HYPRE_SStructMaxwellSetMaxIter(HYPRE_SStructSolver solver, - HYPRE_Int max_iter); +HYPRE_SStructSplitSetPrintLevel( HYPRE_SStructSolver solver, + HYPRE_Int print_level ); /** - * (Optional) Additionally require that the relative difference in - * successive iterates be small. + * (Optional) Set the amount of logging to do. **/ HYPRE_Int -HYPRE_SStructMaxwellSetRelChange(HYPRE_SStructSolver solver, - HYPRE_Int rel_change); +HYPRE_SStructSplitSetLogging( HYPRE_SStructSolver solver, + HYPRE_Int logging ); /** - * (Optional) Set number of relaxation sweeps before coarse-grid correction. + * (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_SStructMaxwellSetNumPreRelax(HYPRE_SStructSolver solver, - HYPRE_Int num_pre_relax); +HYPRE_SStructSplitSetZeroGuess(HYPRE_SStructSolver solver); /** - * (Optional) Set number of relaxation sweeps after coarse-grid correction. + * (Optional) Use a nonzero initial guess. This is the default behavior, but + * this routine allows the user to switch back after using \e SetZeroGuess. **/ HYPRE_Int -HYPRE_SStructMaxwellSetNumPostRelax(HYPRE_SStructSolver solver, - HYPRE_Int num_post_relax); +HYPRE_SStructSplitSetNonZeroGuess(HYPRE_SStructSolver solver); /** - * (Optional) Set the amount of logging to do. + * (Optional) Set up the type of diagonal struct solver. Either \e ssolver is + * set to \e HYPRE\_SMG or \e HYPRE\_PFMG. **/ HYPRE_Int -HYPRE_SStructMaxwellSetLogging(HYPRE_SStructSolver solver, - HYPRE_Int logging); +HYPRE_SStructSplitSetStructSolver(HYPRE_SStructSolver solver, + HYPRE_Int ssolver ); /** * Return the number of iterations taken. **/ HYPRE_Int -HYPRE_SStructMaxwellGetNumIterations(HYPRE_SStructSolver solver, - HYPRE_Int *num_iterations); +HYPRE_SStructSplitGetNumIterations(HYPRE_SStructSolver solver, + HYPRE_Int *num_iterations); /** * Return the norm of the final relative residual. **/ HYPRE_Int -HYPRE_SStructMaxwellGetFinalRelativeResidualNorm(HYPRE_SStructSolver solver, - HYPRE_Real *norm); +HYPRE_SStructSplitGetFinalRelativeResidualNorm(HYPRE_SStructSolver solver, + HYPRE_Real *norm); + +HYPRE_Int HYPRE_SStructSplitPrintLogging ( HYPRE_SStructSolver solver ); /**@}*/ @@ -1259,5 +1138,15 @@ HYPRE_SStructSetupMatvec(HYPRE_MatvecFunctions *mv); } #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_sstruct_ls_mup_undef.h" +#include "HYPRE_sstruct_ls_mup.h" +#endif #endif +#endif diff --git a/src/sstruct_ls/HYPRE_sstruct_ls_mup.h b/src/sstruct_ls/HYPRE_sstruct_ls_mup.h new file mode 100644 index 0000000000..ebed680926 --- /dev/null +++ b/src/sstruct_ls/HYPRE_sstruct_ls_mup.h @@ -0,0 +1,1745 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#ifndef HYPRE_SSTRUCT_LS_MUP_HEADER +#define HYPRE_SSTRUCT_LS_MUP_HEADER + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (HYPRE_MIXED_PRECISION) + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_SStructBiCGSTABCreate_flt( MPI_Comm comm, HYPRE_SStructSolver *solver ); +HYPRE_Int +HYPRE_SStructBiCGSTABCreate_dbl( MPI_Comm comm, HYPRE_SStructSolver *solver ); +HYPRE_Int +HYPRE_SStructBiCGSTABCreate_long_dbl( MPI_Comm comm, HYPRE_SStructSolver *solver ); +HYPRE_Int +HYPRE_SStructBiCGSTABCreate( MPI_Comm comm, HYPRE_SStructSolver *solver ); + +HYPRE_Int +HYPRE_SStructBiCGSTABDestroy_flt( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructBiCGSTABDestroy_dbl( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructBiCGSTABDestroy_long_dbl( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructBiCGSTABDestroy( HYPRE_SStructSolver solver ); + +HYPRE_Int +HYPRE_SStructBiCGSTABGetFinalRelativeResidualNorm_flt( HYPRE_SStructSolver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_SStructBiCGSTABGetFinalRelativeResidualNorm_dbl( HYPRE_SStructSolver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_SStructBiCGSTABGetFinalRelativeResidualNorm_long_dbl( HYPRE_SStructSolver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_SStructBiCGSTABGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_SStructBiCGSTABGetNumIterations_flt( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_SStructBiCGSTABGetNumIterations_dbl( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_SStructBiCGSTABGetNumIterations_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_SStructBiCGSTABGetNumIterations( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_SStructBiCGSTABGetResidual_flt( HYPRE_SStructSolver solver, void **residual ); +HYPRE_Int +HYPRE_SStructBiCGSTABGetResidual_dbl( HYPRE_SStructSolver solver, void **residual ); +HYPRE_Int +HYPRE_SStructBiCGSTABGetResidual_long_dbl( HYPRE_SStructSolver solver, void **residual ); +HYPRE_Int +HYPRE_SStructBiCGSTABGetResidual( HYPRE_SStructSolver solver, void **residual ); + +HYPRE_Int +HYPRE_SStructBiCGSTABSetAbsoluteTol_flt( HYPRE_SStructSolver solver, hypre_float tol ); +HYPRE_Int +HYPRE_SStructBiCGSTABSetAbsoluteTol_dbl( HYPRE_SStructSolver solver, hypre_double tol ); +HYPRE_Int +HYPRE_SStructBiCGSTABSetAbsoluteTol_long_dbl( HYPRE_SStructSolver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_SStructBiCGSTABSetAbsoluteTol( HYPRE_SStructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_SStructBiCGSTABSetLogging_flt( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_SStructBiCGSTABSetLogging_dbl( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_SStructBiCGSTABSetLogging_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_SStructBiCGSTABSetLogging( HYPRE_SStructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_SStructBiCGSTABSetMaxIter_flt( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_SStructBiCGSTABSetMaxIter_dbl( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_SStructBiCGSTABSetMaxIter_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_SStructBiCGSTABSetMaxIter( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_SStructBiCGSTABSetMinIter_flt( HYPRE_SStructSolver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_SStructBiCGSTABSetMinIter_dbl( HYPRE_SStructSolver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_SStructBiCGSTABSetMinIter_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_SStructBiCGSTABSetMinIter( HYPRE_SStructSolver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_SStructBiCGSTABSetPrecond_flt( HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ); +HYPRE_Int +HYPRE_SStructBiCGSTABSetPrecond_dbl( HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ); +HYPRE_Int +HYPRE_SStructBiCGSTABSetPrecond_long_dbl( HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ); +HYPRE_Int +HYPRE_SStructBiCGSTABSetPrecond( HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ); + +HYPRE_Int +HYPRE_SStructBiCGSTABSetPrintLevel_flt( HYPRE_SStructSolver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_SStructBiCGSTABSetPrintLevel_dbl( HYPRE_SStructSolver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_SStructBiCGSTABSetPrintLevel_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_SStructBiCGSTABSetPrintLevel( HYPRE_SStructSolver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_SStructBiCGSTABSetStopCrit_flt( HYPRE_SStructSolver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_SStructBiCGSTABSetStopCrit_dbl( HYPRE_SStructSolver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_SStructBiCGSTABSetStopCrit_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_SStructBiCGSTABSetStopCrit( HYPRE_SStructSolver solver, HYPRE_Int stop_crit ); + +HYPRE_Int +HYPRE_SStructBiCGSTABSetTol_flt( HYPRE_SStructSolver solver, hypre_float tol ); +HYPRE_Int +HYPRE_SStructBiCGSTABSetTol_dbl( HYPRE_SStructSolver solver, hypre_double tol ); +HYPRE_Int +HYPRE_SStructBiCGSTABSetTol_long_dbl( HYPRE_SStructSolver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_SStructBiCGSTABSetTol( HYPRE_SStructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_SStructBiCGSTABSetup_flt( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructBiCGSTABSetup_dbl( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructBiCGSTABSetup_long_dbl( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructBiCGSTABSetup( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); + +HYPRE_Int +HYPRE_SStructBiCGSTABSolve_flt( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructBiCGSTABSolve_dbl( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructBiCGSTABSolve_long_dbl( 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_SStructDiagScale_flt( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector y, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructDiagScale_dbl( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector y, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructDiagScale_long_dbl( 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_SStructDiagScaleSetup_flt( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector y, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructDiagScaleSetup_dbl( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector y, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructDiagScaleSetup_long_dbl( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector y, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructDiagScaleSetup( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector y, HYPRE_SStructVector x ); + +HYPRE_Int +HYPRE_SStructFlexGMRESCreate_flt( MPI_Comm comm, HYPRE_SStructSolver *solver ); +HYPRE_Int +HYPRE_SStructFlexGMRESCreate_dbl( MPI_Comm comm, HYPRE_SStructSolver *solver ); +HYPRE_Int +HYPRE_SStructFlexGMRESCreate_long_dbl( MPI_Comm comm, HYPRE_SStructSolver *solver ); +HYPRE_Int +HYPRE_SStructFlexGMRESCreate( MPI_Comm comm, HYPRE_SStructSolver *solver ); + +HYPRE_Int +HYPRE_SStructFlexGMRESDestroy_flt( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructFlexGMRESDestroy_dbl( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructFlexGMRESDestroy_long_dbl( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructFlexGMRESDestroy( HYPRE_SStructSolver solver ); + +HYPRE_Int +HYPRE_SStructFlexGMRESGetFinalRelativeResidualNorm_flt( HYPRE_SStructSolver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_SStructFlexGMRESGetFinalRelativeResidualNorm_dbl( HYPRE_SStructSolver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_SStructFlexGMRESGetFinalRelativeResidualNorm_long_dbl( HYPRE_SStructSolver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_SStructFlexGMRESGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_SStructFlexGMRESGetNumIterations_flt( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_SStructFlexGMRESGetNumIterations_dbl( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_SStructFlexGMRESGetNumIterations_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_SStructFlexGMRESGetNumIterations( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_SStructFlexGMRESGetResidual_flt( HYPRE_SStructSolver solver, void **residual ); +HYPRE_Int +HYPRE_SStructFlexGMRESGetResidual_dbl( HYPRE_SStructSolver solver, void **residual ); +HYPRE_Int +HYPRE_SStructFlexGMRESGetResidual_long_dbl( HYPRE_SStructSolver solver, void **residual ); +HYPRE_Int +HYPRE_SStructFlexGMRESGetResidual( HYPRE_SStructSolver solver, void **residual ); + +HYPRE_Int +HYPRE_SStructFlexGMRESSetAbsoluteTol_flt( HYPRE_SStructSolver solver, hypre_float tol ); +HYPRE_Int +HYPRE_SStructFlexGMRESSetAbsoluteTol_dbl( HYPRE_SStructSolver solver, hypre_double tol ); +HYPRE_Int +HYPRE_SStructFlexGMRESSetAbsoluteTol_long_dbl( HYPRE_SStructSolver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_SStructFlexGMRESSetAbsoluteTol( HYPRE_SStructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_SStructFlexGMRESSetKDim_flt( HYPRE_SStructSolver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_SStructFlexGMRESSetKDim_dbl( HYPRE_SStructSolver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_SStructFlexGMRESSetKDim_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_SStructFlexGMRESSetKDim( HYPRE_SStructSolver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_SStructFlexGMRESSetLogging_flt( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_SStructFlexGMRESSetLogging_dbl( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_SStructFlexGMRESSetLogging_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_SStructFlexGMRESSetLogging( HYPRE_SStructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_SStructFlexGMRESSetMaxIter_flt( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_SStructFlexGMRESSetMaxIter_dbl( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_SStructFlexGMRESSetMaxIter_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_SStructFlexGMRESSetMaxIter( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_SStructFlexGMRESSetMinIter_flt( HYPRE_SStructSolver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_SStructFlexGMRESSetMinIter_dbl( HYPRE_SStructSolver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_SStructFlexGMRESSetMinIter_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_SStructFlexGMRESSetMinIter( HYPRE_SStructSolver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_SStructFlexGMRESSetModifyPC_flt( HYPRE_SStructSolver solver, HYPRE_PtrToModifyPCFcn modify_pc ); +HYPRE_Int +HYPRE_SStructFlexGMRESSetModifyPC_dbl( HYPRE_SStructSolver solver, HYPRE_PtrToModifyPCFcn modify_pc ); +HYPRE_Int +HYPRE_SStructFlexGMRESSetModifyPC_long_dbl( HYPRE_SStructSolver solver, HYPRE_PtrToModifyPCFcn modify_pc ); +HYPRE_Int +HYPRE_SStructFlexGMRESSetModifyPC( HYPRE_SStructSolver solver, HYPRE_PtrToModifyPCFcn modify_pc ); + +HYPRE_Int +HYPRE_SStructFlexGMRESSetPrecond_flt( HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ); +HYPRE_Int +HYPRE_SStructFlexGMRESSetPrecond_dbl( HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ); +HYPRE_Int +HYPRE_SStructFlexGMRESSetPrecond_long_dbl( HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ); +HYPRE_Int +HYPRE_SStructFlexGMRESSetPrecond( HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ); + +HYPRE_Int +HYPRE_SStructFlexGMRESSetPrintLevel_flt( HYPRE_SStructSolver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_SStructFlexGMRESSetPrintLevel_dbl( HYPRE_SStructSolver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_SStructFlexGMRESSetPrintLevel_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_SStructFlexGMRESSetPrintLevel( HYPRE_SStructSolver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_SStructFlexGMRESSetTol_flt( HYPRE_SStructSolver solver, hypre_float tol ); +HYPRE_Int +HYPRE_SStructFlexGMRESSetTol_dbl( HYPRE_SStructSolver solver, hypre_double tol ); +HYPRE_Int +HYPRE_SStructFlexGMRESSetTol_long_dbl( HYPRE_SStructSolver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_SStructFlexGMRESSetTol( HYPRE_SStructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_SStructFlexGMRESSetup_flt( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructFlexGMRESSetup_dbl( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructFlexGMRESSetup_long_dbl( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructFlexGMRESSetup( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); + +HYPRE_Int +HYPRE_SStructFlexGMRESSolve_flt( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructFlexGMRESSolve_dbl( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructFlexGMRESSolve_long_dbl( 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_SStructGMRESCreate_flt( MPI_Comm comm, HYPRE_SStructSolver *solver ); +HYPRE_Int +HYPRE_SStructGMRESCreate_dbl( MPI_Comm comm, HYPRE_SStructSolver *solver ); +HYPRE_Int +HYPRE_SStructGMRESCreate_long_dbl( MPI_Comm comm, HYPRE_SStructSolver *solver ); +HYPRE_Int +HYPRE_SStructGMRESCreate( MPI_Comm comm, HYPRE_SStructSolver *solver ); + +HYPRE_Int +HYPRE_SStructGMRESDestroy_flt( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructGMRESDestroy_dbl( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructGMRESDestroy_long_dbl( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructGMRESDestroy( HYPRE_SStructSolver solver ); + +HYPRE_Int +HYPRE_SStructGMRESGetFinalRelativeResidualNorm_flt( HYPRE_SStructSolver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_SStructGMRESGetFinalRelativeResidualNorm_dbl( HYPRE_SStructSolver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_SStructGMRESGetFinalRelativeResidualNorm_long_dbl( HYPRE_SStructSolver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_SStructGMRESGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_SStructGMRESGetNumIterations_flt( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_SStructGMRESGetNumIterations_dbl( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_SStructGMRESGetNumIterations_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_SStructGMRESGetNumIterations( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_SStructGMRESGetResidual_flt( HYPRE_SStructSolver solver, void **residual ); +HYPRE_Int +HYPRE_SStructGMRESGetResidual_dbl( HYPRE_SStructSolver solver, void **residual ); +HYPRE_Int +HYPRE_SStructGMRESGetResidual_long_dbl( HYPRE_SStructSolver solver, void **residual ); +HYPRE_Int +HYPRE_SStructGMRESGetResidual( HYPRE_SStructSolver solver, void **residual ); + +HYPRE_Int +HYPRE_SStructGMRESSetAbsoluteTol_flt( HYPRE_SStructSolver solver, hypre_float tol ); +HYPRE_Int +HYPRE_SStructGMRESSetAbsoluteTol_dbl( HYPRE_SStructSolver solver, hypre_double tol ); +HYPRE_Int +HYPRE_SStructGMRESSetAbsoluteTol_long_dbl( HYPRE_SStructSolver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_SStructGMRESSetAbsoluteTol( HYPRE_SStructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_SStructGMRESSetKDim_flt( HYPRE_SStructSolver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_SStructGMRESSetKDim_dbl( HYPRE_SStructSolver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_SStructGMRESSetKDim_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_SStructGMRESSetKDim( HYPRE_SStructSolver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_SStructGMRESSetLogging_flt( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_SStructGMRESSetLogging_dbl( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_SStructGMRESSetLogging_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_SStructGMRESSetLogging( HYPRE_SStructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_SStructGMRESSetMaxIter_flt( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_SStructGMRESSetMaxIter_dbl( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_SStructGMRESSetMaxIter_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_SStructGMRESSetMaxIter( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_SStructGMRESSetMinIter_flt( HYPRE_SStructSolver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_SStructGMRESSetMinIter_dbl( HYPRE_SStructSolver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_SStructGMRESSetMinIter_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_SStructGMRESSetMinIter( HYPRE_SStructSolver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_SStructGMRESSetPrecond_flt( HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ); +HYPRE_Int +HYPRE_SStructGMRESSetPrecond_dbl( HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ); +HYPRE_Int +HYPRE_SStructGMRESSetPrecond_long_dbl( HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ); +HYPRE_Int +HYPRE_SStructGMRESSetPrecond( HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ); + +HYPRE_Int +HYPRE_SStructGMRESSetPrintLevel_flt( HYPRE_SStructSolver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_SStructGMRESSetPrintLevel_dbl( HYPRE_SStructSolver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_SStructGMRESSetPrintLevel_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_SStructGMRESSetPrintLevel( HYPRE_SStructSolver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_SStructGMRESSetStopCrit_flt( HYPRE_SStructSolver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_SStructGMRESSetStopCrit_dbl( HYPRE_SStructSolver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_SStructGMRESSetStopCrit_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_SStructGMRESSetStopCrit( HYPRE_SStructSolver solver, HYPRE_Int stop_crit ); + +HYPRE_Int +HYPRE_SStructGMRESSetTol_flt( HYPRE_SStructSolver solver, hypre_float tol ); +HYPRE_Int +HYPRE_SStructGMRESSetTol_dbl( HYPRE_SStructSolver solver, hypre_double tol ); +HYPRE_Int +HYPRE_SStructGMRESSetTol_long_dbl( HYPRE_SStructSolver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_SStructGMRESSetTol( HYPRE_SStructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_SStructGMRESSetup_flt( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructGMRESSetup_dbl( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructGMRESSetup_long_dbl( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructGMRESSetup( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); + +HYPRE_Int +HYPRE_SStructGMRESSolve_flt( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructGMRESSolve_dbl( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructGMRESSolve_long_dbl( 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_SStructLGMRESCreate_flt( MPI_Comm comm, HYPRE_SStructSolver *solver ); +HYPRE_Int +HYPRE_SStructLGMRESCreate_dbl( MPI_Comm comm, HYPRE_SStructSolver *solver ); +HYPRE_Int +HYPRE_SStructLGMRESCreate_long_dbl( MPI_Comm comm, HYPRE_SStructSolver *solver ); +HYPRE_Int +HYPRE_SStructLGMRESCreate( MPI_Comm comm, HYPRE_SStructSolver *solver ); + +HYPRE_Int +HYPRE_SStructLGMRESDestroy_flt( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructLGMRESDestroy_dbl( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructLGMRESDestroy_long_dbl( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructLGMRESDestroy( HYPRE_SStructSolver solver ); + +HYPRE_Int +HYPRE_SStructLGMRESGetFinalRelativeResidualNorm_flt( HYPRE_SStructSolver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_SStructLGMRESGetFinalRelativeResidualNorm_dbl( HYPRE_SStructSolver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_SStructLGMRESGetFinalRelativeResidualNorm_long_dbl( HYPRE_SStructSolver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_SStructLGMRESGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_SStructLGMRESGetNumIterations_flt( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_SStructLGMRESGetNumIterations_dbl( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_SStructLGMRESGetNumIterations_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_SStructLGMRESGetNumIterations( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_SStructLGMRESGetResidual_flt( HYPRE_SStructSolver solver, void **residual ); +HYPRE_Int +HYPRE_SStructLGMRESGetResidual_dbl( HYPRE_SStructSolver solver, void **residual ); +HYPRE_Int +HYPRE_SStructLGMRESGetResidual_long_dbl( HYPRE_SStructSolver solver, void **residual ); +HYPRE_Int +HYPRE_SStructLGMRESGetResidual( HYPRE_SStructSolver solver, void **residual ); + +HYPRE_Int +HYPRE_SStructLGMRESSetAbsoluteTol_flt( HYPRE_SStructSolver solver, hypre_float tol ); +HYPRE_Int +HYPRE_SStructLGMRESSetAbsoluteTol_dbl( HYPRE_SStructSolver solver, hypre_double tol ); +HYPRE_Int +HYPRE_SStructLGMRESSetAbsoluteTol_long_dbl( HYPRE_SStructSolver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_SStructLGMRESSetAbsoluteTol( HYPRE_SStructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_SStructLGMRESSetAugDim_flt( HYPRE_SStructSolver solver, HYPRE_Int aug_dim ); +HYPRE_Int +HYPRE_SStructLGMRESSetAugDim_dbl( HYPRE_SStructSolver solver, HYPRE_Int aug_dim ); +HYPRE_Int +HYPRE_SStructLGMRESSetAugDim_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int aug_dim ); +HYPRE_Int +HYPRE_SStructLGMRESSetAugDim( HYPRE_SStructSolver solver, HYPRE_Int aug_dim ); + +HYPRE_Int +HYPRE_SStructLGMRESSetKDim_flt( HYPRE_SStructSolver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_SStructLGMRESSetKDim_dbl( HYPRE_SStructSolver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_SStructLGMRESSetKDim_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_SStructLGMRESSetKDim( HYPRE_SStructSolver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_SStructLGMRESSetLogging_flt( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_SStructLGMRESSetLogging_dbl( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_SStructLGMRESSetLogging_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_SStructLGMRESSetLogging( HYPRE_SStructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_SStructLGMRESSetMaxIter_flt( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_SStructLGMRESSetMaxIter_dbl( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_SStructLGMRESSetMaxIter_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_SStructLGMRESSetMaxIter( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_SStructLGMRESSetMinIter_flt( HYPRE_SStructSolver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_SStructLGMRESSetMinIter_dbl( HYPRE_SStructSolver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_SStructLGMRESSetMinIter_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int min_iter ); +HYPRE_Int +HYPRE_SStructLGMRESSetMinIter( HYPRE_SStructSolver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_SStructLGMRESSetPrecond_flt( HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ); +HYPRE_Int +HYPRE_SStructLGMRESSetPrecond_dbl( HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ); +HYPRE_Int +HYPRE_SStructLGMRESSetPrecond_long_dbl( HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ); +HYPRE_Int +HYPRE_SStructLGMRESSetPrecond( HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ); + +HYPRE_Int +HYPRE_SStructLGMRESSetPrintLevel_flt( HYPRE_SStructSolver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_SStructLGMRESSetPrintLevel_dbl( HYPRE_SStructSolver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_SStructLGMRESSetPrintLevel_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_SStructLGMRESSetPrintLevel( HYPRE_SStructSolver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_SStructLGMRESSetTol_flt( HYPRE_SStructSolver solver, hypre_float tol ); +HYPRE_Int +HYPRE_SStructLGMRESSetTol_dbl( HYPRE_SStructSolver solver, hypre_double tol ); +HYPRE_Int +HYPRE_SStructLGMRESSetTol_long_dbl( HYPRE_SStructSolver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_SStructLGMRESSetTol( HYPRE_SStructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_SStructLGMRESSetup_flt( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructLGMRESSetup_dbl( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructLGMRESSetup_long_dbl( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructLGMRESSetup( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); + +HYPRE_Int +HYPRE_SStructLGMRESSolve_flt( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructLGMRESSolve_dbl( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructLGMRESSolve_long_dbl( 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_SStructPCGCreate_flt( MPI_Comm comm, HYPRE_SStructSolver *solver ); +HYPRE_Int +HYPRE_SStructPCGCreate_dbl( MPI_Comm comm, HYPRE_SStructSolver *solver ); +HYPRE_Int +HYPRE_SStructPCGCreate_long_dbl( MPI_Comm comm, HYPRE_SStructSolver *solver ); +HYPRE_Int +HYPRE_SStructPCGCreate( MPI_Comm comm, HYPRE_SStructSolver *solver ); + +HYPRE_Int +HYPRE_SStructPCGDestroy_flt( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructPCGDestroy_dbl( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructPCGDestroy_long_dbl( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructPCGDestroy( HYPRE_SStructSolver solver ); + +HYPRE_Int +HYPRE_SStructPCGGetFinalRelativeResidualNorm_flt( HYPRE_SStructSolver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_SStructPCGGetFinalRelativeResidualNorm_dbl( HYPRE_SStructSolver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_SStructPCGGetFinalRelativeResidualNorm_long_dbl( HYPRE_SStructSolver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_SStructPCGGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_SStructPCGGetNumIterations_flt( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_SStructPCGGetNumIterations_dbl( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_SStructPCGGetNumIterations_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_SStructPCGGetNumIterations( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_SStructPCGGetResidual_flt( HYPRE_SStructSolver solver, void **residual ); +HYPRE_Int +HYPRE_SStructPCGGetResidual_dbl( HYPRE_SStructSolver solver, void **residual ); +HYPRE_Int +HYPRE_SStructPCGGetResidual_long_dbl( HYPRE_SStructSolver solver, void **residual ); +HYPRE_Int +HYPRE_SStructPCGGetResidual( HYPRE_SStructSolver solver, void **residual ); + +HYPRE_Int +HYPRE_SStructPCGSetAbsoluteTol_flt( HYPRE_SStructSolver solver, hypre_float tol ); +HYPRE_Int +HYPRE_SStructPCGSetAbsoluteTol_dbl( HYPRE_SStructSolver solver, hypre_double tol ); +HYPRE_Int +HYPRE_SStructPCGSetAbsoluteTol_long_dbl( HYPRE_SStructSolver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_SStructPCGSetAbsoluteTol( HYPRE_SStructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_SStructPCGSetLogging_flt( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_SStructPCGSetLogging_dbl( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_SStructPCGSetLogging_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_SStructPCGSetLogging( HYPRE_SStructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_SStructPCGSetMaxIter_flt( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_SStructPCGSetMaxIter_dbl( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_SStructPCGSetMaxIter_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_SStructPCGSetMaxIter( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_SStructPCGSetPrecond_flt( HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ); +HYPRE_Int +HYPRE_SStructPCGSetPrecond_dbl( HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ); +HYPRE_Int +HYPRE_SStructPCGSetPrecond_long_dbl( HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ); +HYPRE_Int +HYPRE_SStructPCGSetPrecond( HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ); + +HYPRE_Int +HYPRE_SStructPCGSetPrintLevel_flt( HYPRE_SStructSolver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_SStructPCGSetPrintLevel_dbl( HYPRE_SStructSolver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_SStructPCGSetPrintLevel_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_SStructPCGSetPrintLevel( HYPRE_SStructSolver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_SStructPCGSetRelChange_flt( HYPRE_SStructSolver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_SStructPCGSetRelChange_dbl( HYPRE_SStructSolver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_SStructPCGSetRelChange_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_SStructPCGSetRelChange( HYPRE_SStructSolver solver, HYPRE_Int rel_change ); + +HYPRE_Int +HYPRE_SStructPCGSetTol_flt( HYPRE_SStructSolver solver, hypre_float tol ); +HYPRE_Int +HYPRE_SStructPCGSetTol_dbl( HYPRE_SStructSolver solver, hypre_double tol ); +HYPRE_Int +HYPRE_SStructPCGSetTol_long_dbl( HYPRE_SStructSolver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_SStructPCGSetTol( HYPRE_SStructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_SStructPCGSetTwoNorm_flt( HYPRE_SStructSolver solver, HYPRE_Int two_norm ); +HYPRE_Int +HYPRE_SStructPCGSetTwoNorm_dbl( HYPRE_SStructSolver solver, HYPRE_Int two_norm ); +HYPRE_Int +HYPRE_SStructPCGSetTwoNorm_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int two_norm ); +HYPRE_Int +HYPRE_SStructPCGSetTwoNorm( HYPRE_SStructSolver solver, HYPRE_Int two_norm ); + +HYPRE_Int +HYPRE_SStructPCGSetup_flt( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructPCGSetup_dbl( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructPCGSetup_long_dbl( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructPCGSetup( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); + +HYPRE_Int +HYPRE_SStructPCGSolve_flt( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructPCGSolve_dbl( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructPCGSolve_long_dbl( 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_SStructSSAMGCreate_flt( MPI_Comm comm, HYPRE_SStructSolver *solver ); +HYPRE_Int +HYPRE_SStructSSAMGCreate_dbl( MPI_Comm comm, HYPRE_SStructSolver *solver ); +HYPRE_Int +HYPRE_SStructSSAMGCreate_long_dbl( MPI_Comm comm, HYPRE_SStructSolver *solver ); +HYPRE_Int +HYPRE_SStructSSAMGCreate( MPI_Comm comm, HYPRE_SStructSolver *solver ); + +HYPRE_Int +HYPRE_SStructSSAMGDestroy_flt( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructSSAMGDestroy_dbl( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructSSAMGDestroy_long_dbl( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructSSAMGDestroy( HYPRE_SStructSolver solver ); + +HYPRE_Int +HYPRE_SStructSSAMGGetFinalRelativeResidualNorm_flt( HYPRE_SStructSolver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_SStructSSAMGGetFinalRelativeResidualNorm_dbl( HYPRE_SStructSolver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_SStructSSAMGGetFinalRelativeResidualNorm_long_dbl( HYPRE_SStructSolver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_SStructSSAMGGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_SStructSSAMGGetNumIterations_flt( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_SStructSSAMGGetNumIterations_dbl( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_SStructSSAMGGetNumIterations_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_SStructSSAMGGetNumIterations( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_SStructSSAMGSetCoarseSolverType_flt( HYPRE_SStructSolver solver, HYPRE_Int csolver_type ); +HYPRE_Int +HYPRE_SStructSSAMGSetCoarseSolverType_dbl( HYPRE_SStructSolver solver, HYPRE_Int csolver_type ); +HYPRE_Int +HYPRE_SStructSSAMGSetCoarseSolverType_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int csolver_type ); +HYPRE_Int +HYPRE_SStructSSAMGSetCoarseSolverType( HYPRE_SStructSolver solver, HYPRE_Int csolver_type ); + +HYPRE_Int +HYPRE_SStructSSAMGSetDxyz_flt( HYPRE_SStructSolver solver, HYPRE_Int nparts, hypre_float **dxyz ); +HYPRE_Int +HYPRE_SStructSSAMGSetDxyz_dbl( HYPRE_SStructSolver solver, HYPRE_Int nparts, hypre_double **dxyz ); +HYPRE_Int +HYPRE_SStructSSAMGSetDxyz_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int nparts, hypre_long_double **dxyz ); +HYPRE_Int +HYPRE_SStructSSAMGSetDxyz( HYPRE_SStructSolver solver, HYPRE_Int nparts, void *dxyz ); + +HYPRE_Int +HYPRE_SStructSSAMGSetInterpType_flt( HYPRE_SStructSolver solver, HYPRE_Int interp_type ); +HYPRE_Int +HYPRE_SStructSSAMGSetInterpType_dbl( HYPRE_SStructSolver solver, HYPRE_Int interp_type ); +HYPRE_Int +HYPRE_SStructSSAMGSetInterpType_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int interp_type ); +HYPRE_Int +HYPRE_SStructSSAMGSetInterpType( HYPRE_SStructSolver solver, HYPRE_Int interp_type ); + +HYPRE_Int +HYPRE_SStructSSAMGSetLogging_flt( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_SStructSSAMGSetLogging_dbl( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_SStructSSAMGSetLogging_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_SStructSSAMGSetLogging( HYPRE_SStructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_SStructSSAMGSetMaxCoarseSize_flt( HYPRE_SStructSolver solver, HYPRE_Int max_coarse_size ); +HYPRE_Int +HYPRE_SStructSSAMGSetMaxCoarseSize_dbl( HYPRE_SStructSolver solver, HYPRE_Int max_coarse_size ); +HYPRE_Int +HYPRE_SStructSSAMGSetMaxCoarseSize_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int max_coarse_size ); +HYPRE_Int +HYPRE_SStructSSAMGSetMaxCoarseSize( HYPRE_SStructSolver solver, HYPRE_Int max_coarse_size ); + +HYPRE_Int +HYPRE_SStructSSAMGSetMaxIter_flt( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_SStructSSAMGSetMaxIter_dbl( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_SStructSSAMGSetMaxIter_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_SStructSSAMGSetMaxIter( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_SStructSSAMGSetMaxLevels_flt( HYPRE_SStructSolver solver, HYPRE_Int max_levels ); +HYPRE_Int +HYPRE_SStructSSAMGSetMaxLevels_dbl( HYPRE_SStructSolver solver, HYPRE_Int max_levels ); +HYPRE_Int +HYPRE_SStructSSAMGSetMaxLevels_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int max_levels ); +HYPRE_Int +HYPRE_SStructSSAMGSetMaxLevels( HYPRE_SStructSolver solver, HYPRE_Int max_levels ); + +HYPRE_Int +HYPRE_SStructSSAMGSetNonGalerkinRAP_flt( HYPRE_SStructSolver solver, HYPRE_Int non_galerkin ); +HYPRE_Int +HYPRE_SStructSSAMGSetNonGalerkinRAP_dbl( HYPRE_SStructSolver solver, HYPRE_Int non_galerkin ); +HYPRE_Int +HYPRE_SStructSSAMGSetNonGalerkinRAP_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int non_galerkin ); +HYPRE_Int +HYPRE_SStructSSAMGSetNonGalerkinRAP( HYPRE_SStructSolver solver, HYPRE_Int non_galerkin ); + +HYPRE_Int +HYPRE_SStructSSAMGSetNonZeroGuess_flt( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructSSAMGSetNonZeroGuess_dbl( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructSSAMGSetNonZeroGuess_long_dbl( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructSSAMGSetNonZeroGuess( HYPRE_SStructSolver solver ); + +HYPRE_Int +HYPRE_SStructSSAMGSetNumCoarseRelax_flt( HYPRE_SStructSolver solver, HYPRE_Int num_coarse_relax ); +HYPRE_Int +HYPRE_SStructSSAMGSetNumCoarseRelax_dbl( HYPRE_SStructSolver solver, HYPRE_Int num_coarse_relax ); +HYPRE_Int +HYPRE_SStructSSAMGSetNumCoarseRelax_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int num_coarse_relax ); +HYPRE_Int +HYPRE_SStructSSAMGSetNumCoarseRelax( HYPRE_SStructSolver solver, HYPRE_Int num_coarse_relax ); + +HYPRE_Int +HYPRE_SStructSSAMGSetNumPostRelax_flt( HYPRE_SStructSolver solver, HYPRE_Int num_post_relax ); +HYPRE_Int +HYPRE_SStructSSAMGSetNumPostRelax_dbl( HYPRE_SStructSolver solver, HYPRE_Int num_post_relax ); +HYPRE_Int +HYPRE_SStructSSAMGSetNumPostRelax_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int num_post_relax ); +HYPRE_Int +HYPRE_SStructSSAMGSetNumPostRelax( HYPRE_SStructSolver solver, HYPRE_Int num_post_relax ); + +HYPRE_Int +HYPRE_SStructSSAMGSetNumPreRelax_flt( HYPRE_SStructSolver solver, HYPRE_Int num_pre_relax ); +HYPRE_Int +HYPRE_SStructSSAMGSetNumPreRelax_dbl( HYPRE_SStructSolver solver, HYPRE_Int num_pre_relax ); +HYPRE_Int +HYPRE_SStructSSAMGSetNumPreRelax_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int num_pre_relax ); +HYPRE_Int +HYPRE_SStructSSAMGSetNumPreRelax( HYPRE_SStructSolver solver, HYPRE_Int num_pre_relax ); + +HYPRE_Int +HYPRE_SStructSSAMGSetPrintFreq_flt( HYPRE_SStructSolver solver, HYPRE_Int print_freq ); +HYPRE_Int +HYPRE_SStructSSAMGSetPrintFreq_dbl( HYPRE_SStructSolver solver, HYPRE_Int print_freq ); +HYPRE_Int +HYPRE_SStructSSAMGSetPrintFreq_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int print_freq ); +HYPRE_Int +HYPRE_SStructSSAMGSetPrintFreq( HYPRE_SStructSolver solver, HYPRE_Int print_freq ); + +HYPRE_Int +HYPRE_SStructSSAMGSetPrintLevel_flt( HYPRE_SStructSolver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_SStructSSAMGSetPrintLevel_dbl( HYPRE_SStructSolver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_SStructSSAMGSetPrintLevel_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_SStructSSAMGSetPrintLevel( HYPRE_SStructSolver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_SStructSSAMGSetRelChange_flt( HYPRE_SStructSolver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_SStructSSAMGSetRelChange_dbl( HYPRE_SStructSolver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_SStructSSAMGSetRelChange_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_SStructSSAMGSetRelChange( HYPRE_SStructSolver solver, HYPRE_Int rel_change ); + +HYPRE_Int +HYPRE_SStructSSAMGSetRelaxType_flt( HYPRE_SStructSolver solver, HYPRE_Int relax_type ); +HYPRE_Int +HYPRE_SStructSSAMGSetRelaxType_dbl( HYPRE_SStructSolver solver, HYPRE_Int relax_type ); +HYPRE_Int +HYPRE_SStructSSAMGSetRelaxType_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int relax_type ); +HYPRE_Int +HYPRE_SStructSSAMGSetRelaxType( HYPRE_SStructSolver solver, HYPRE_Int relax_type ); + +HYPRE_Int +HYPRE_SStructSSAMGSetRelaxWeight_flt( HYPRE_SStructSolver solver, hypre_float weight ); +HYPRE_Int +HYPRE_SStructSSAMGSetRelaxWeight_dbl( HYPRE_SStructSolver solver, hypre_double weight ); +HYPRE_Int +HYPRE_SStructSSAMGSetRelaxWeight_long_dbl( HYPRE_SStructSolver solver, hypre_long_double weight ); +HYPRE_Int +HYPRE_SStructSSAMGSetRelaxWeight( HYPRE_SStructSolver solver, hypre_long_double weight ); + +HYPRE_Int +HYPRE_SStructSSAMGSetSkipRelax_flt( HYPRE_SStructSolver solver, HYPRE_Int skip_relax ); +HYPRE_Int +HYPRE_SStructSSAMGSetSkipRelax_dbl( HYPRE_SStructSolver solver, HYPRE_Int skip_relax ); +HYPRE_Int +HYPRE_SStructSSAMGSetSkipRelax_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int skip_relax ); +HYPRE_Int +HYPRE_SStructSSAMGSetSkipRelax( HYPRE_SStructSolver solver, HYPRE_Int skip_relax ); + +HYPRE_Int +HYPRE_SStructSSAMGSetTol_flt( HYPRE_SStructSolver solver, hypre_float tol ); +HYPRE_Int +HYPRE_SStructSSAMGSetTol_dbl( HYPRE_SStructSolver solver, hypre_double tol ); +HYPRE_Int +HYPRE_SStructSSAMGSetTol_long_dbl( HYPRE_SStructSolver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_SStructSSAMGSetTol( HYPRE_SStructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_SStructSSAMGSetZeroGuess_flt( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructSSAMGSetZeroGuess_dbl( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructSSAMGSetZeroGuess_long_dbl( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructSSAMGSetZeroGuess( HYPRE_SStructSolver solver ); + +HYPRE_Int +HYPRE_SStructSSAMGSetup_flt( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructSSAMGSetup_dbl( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructSSAMGSetup_long_dbl( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructSSAMGSetup( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); + +HYPRE_Int +HYPRE_SStructSSAMGSolve_flt( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructSSAMGSolve_dbl( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructSSAMGSolve_long_dbl( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructSSAMGSolve( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); + +HYPRE_Int +HYPRE_SStructSetupInterpreter_flt( mv_InterfaceInterpreter *i ); +HYPRE_Int +HYPRE_SStructSetupInterpreter_dbl( mv_InterfaceInterpreter *i ); +HYPRE_Int +HYPRE_SStructSetupInterpreter_long_dbl( mv_InterfaceInterpreter *i ); +HYPRE_Int +HYPRE_SStructSetupInterpreter( mv_InterfaceInterpreter *i ); + +HYPRE_Int +HYPRE_SStructSetupMatvec_flt( HYPRE_MatvecFunctions *mv ); +HYPRE_Int +HYPRE_SStructSetupMatvec_dbl( HYPRE_MatvecFunctions *mv ); +HYPRE_Int +HYPRE_SStructSetupMatvec_long_dbl( HYPRE_MatvecFunctions *mv ); +HYPRE_Int +HYPRE_SStructSetupMatvec( HYPRE_MatvecFunctions *mv ); + +HYPRE_Int +HYPRE_SStructSplitCreate_flt( MPI_Comm comm, HYPRE_SStructSolver *solver ); +HYPRE_Int +HYPRE_SStructSplitCreate_dbl( MPI_Comm comm, HYPRE_SStructSolver *solver ); +HYPRE_Int +HYPRE_SStructSplitCreate_long_dbl( MPI_Comm comm, HYPRE_SStructSolver *solver ); +HYPRE_Int +HYPRE_SStructSplitCreate( MPI_Comm comm, HYPRE_SStructSolver *solver ); + +HYPRE_Int +HYPRE_SStructSplitDestroy_flt( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructSplitDestroy_dbl( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructSplitDestroy_long_dbl( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructSplitDestroy( HYPRE_SStructSolver solver ); + +HYPRE_Int +HYPRE_SStructSplitGetFinalRelativeResidualNorm_flt( HYPRE_SStructSolver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_SStructSplitGetFinalRelativeResidualNorm_dbl( HYPRE_SStructSolver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_SStructSplitGetFinalRelativeResidualNorm_long_dbl( HYPRE_SStructSolver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_SStructSplitGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_SStructSplitGetNumIterations_flt( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_SStructSplitGetNumIterations_dbl( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_SStructSplitGetNumIterations_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_SStructSplitGetNumIterations( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_SStructSplitPrintLogging_flt( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructSplitPrintLogging_dbl( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructSplitPrintLogging_long_dbl( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructSplitPrintLogging( HYPRE_SStructSolver solver ); + +HYPRE_Int +HYPRE_SStructSplitSetLogging_flt( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_SStructSplitSetLogging_dbl( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_SStructSplitSetLogging_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_SStructSplitSetLogging( HYPRE_SStructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_SStructSplitSetMaxIter_flt( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_SStructSplitSetMaxIter_dbl( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_SStructSplitSetMaxIter_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_SStructSplitSetMaxIter( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_SStructSplitSetNonZeroGuess_flt( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructSplitSetNonZeroGuess_dbl( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructSplitSetNonZeroGuess_long_dbl( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructSplitSetNonZeroGuess( HYPRE_SStructSolver solver ); + +HYPRE_Int +HYPRE_SStructSplitSetPrintLevel_flt( HYPRE_SStructSolver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_SStructSplitSetPrintLevel_dbl( HYPRE_SStructSolver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_SStructSplitSetPrintLevel_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_SStructSplitSetPrintLevel( HYPRE_SStructSolver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_SStructSplitSetStructSolver_flt( HYPRE_SStructSolver solver, HYPRE_Int ssolver ); +HYPRE_Int +HYPRE_SStructSplitSetStructSolver_dbl( HYPRE_SStructSolver solver, HYPRE_Int ssolver ); +HYPRE_Int +HYPRE_SStructSplitSetStructSolver_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int ssolver ); +HYPRE_Int +HYPRE_SStructSplitSetStructSolver( HYPRE_SStructSolver solver, HYPRE_Int ssolver ); + +HYPRE_Int +HYPRE_SStructSplitSetTol_flt( HYPRE_SStructSolver solver, hypre_float tol ); +HYPRE_Int +HYPRE_SStructSplitSetTol_dbl( HYPRE_SStructSolver solver, hypre_double tol ); +HYPRE_Int +HYPRE_SStructSplitSetTol_long_dbl( HYPRE_SStructSolver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_SStructSplitSetTol( HYPRE_SStructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_SStructSplitSetZeroGuess_flt( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructSplitSetZeroGuess_dbl( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructSplitSetZeroGuess_long_dbl( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructSplitSetZeroGuess( HYPRE_SStructSolver solver ); + +HYPRE_Int +HYPRE_SStructSplitSetup_flt( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructSplitSetup_dbl( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructSplitSetup_long_dbl( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructSplitSetup( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); + +HYPRE_Int +HYPRE_SStructSplitSolve_flt( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructSplitSolve_dbl( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructSplitSolve_long_dbl( 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_SStructSysPFMGCreate_flt( MPI_Comm comm, HYPRE_SStructSolver *solver ); +HYPRE_Int +HYPRE_SStructSysPFMGCreate_dbl( MPI_Comm comm, HYPRE_SStructSolver *solver ); +HYPRE_Int +HYPRE_SStructSysPFMGCreate_long_dbl( MPI_Comm comm, HYPRE_SStructSolver *solver ); +HYPRE_Int +HYPRE_SStructSysPFMGCreate( MPI_Comm comm, HYPRE_SStructSolver *solver ); + +HYPRE_Int +HYPRE_SStructSysPFMGDestroy_flt( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructSysPFMGDestroy_dbl( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructSysPFMGDestroy_long_dbl( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructSysPFMGDestroy( HYPRE_SStructSolver solver ); + +HYPRE_Int +HYPRE_SStructSysPFMGGetFinalRelativeResidualNorm_flt( HYPRE_SStructSolver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_SStructSysPFMGGetFinalRelativeResidualNorm_dbl( HYPRE_SStructSolver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_SStructSysPFMGGetFinalRelativeResidualNorm_long_dbl( HYPRE_SStructSolver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_SStructSysPFMGGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_SStructSysPFMGGetNumIterations_flt( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_SStructSysPFMGGetNumIterations_dbl( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_SStructSysPFMGGetNumIterations_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_SStructSysPFMGGetNumIterations( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_SStructSysPFMGSetDxyz_flt( HYPRE_SStructSolver solver, hypre_float *dxyz ); +HYPRE_Int +HYPRE_SStructSysPFMGSetDxyz_dbl( HYPRE_SStructSolver solver, hypre_double *dxyz ); +HYPRE_Int +HYPRE_SStructSysPFMGSetDxyz_long_dbl( HYPRE_SStructSolver solver, hypre_long_double *dxyz ); +HYPRE_Int +HYPRE_SStructSysPFMGSetDxyz( HYPRE_SStructSolver solver, void *dxyz ); + +HYPRE_Int +HYPRE_SStructSysPFMGSetJacobiWeight_flt( HYPRE_SStructSolver solver, hypre_float weight ); +HYPRE_Int +HYPRE_SStructSysPFMGSetJacobiWeight_dbl( HYPRE_SStructSolver solver, hypre_double weight ); +HYPRE_Int +HYPRE_SStructSysPFMGSetJacobiWeight_long_dbl( HYPRE_SStructSolver solver, hypre_long_double weight ); +HYPRE_Int +HYPRE_SStructSysPFMGSetJacobiWeight( HYPRE_SStructSolver solver, hypre_long_double weight ); + +HYPRE_Int +HYPRE_SStructSysPFMGSetLogging_flt( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_SStructSysPFMGSetLogging_dbl( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_SStructSysPFMGSetLogging_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_SStructSysPFMGSetLogging( HYPRE_SStructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_SStructSysPFMGSetMaxIter_flt( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_SStructSysPFMGSetMaxIter_dbl( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_SStructSysPFMGSetMaxIter_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_SStructSysPFMGSetMaxIter( HYPRE_SStructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_SStructSysPFMGSetNonZeroGuess_flt( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructSysPFMGSetNonZeroGuess_dbl( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructSysPFMGSetNonZeroGuess_long_dbl( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructSysPFMGSetNonZeroGuess( HYPRE_SStructSolver solver ); + +HYPRE_Int +HYPRE_SStructSysPFMGSetNumPostRelax_flt( HYPRE_SStructSolver solver, HYPRE_Int num_post_relax ); +HYPRE_Int +HYPRE_SStructSysPFMGSetNumPostRelax_dbl( HYPRE_SStructSolver solver, HYPRE_Int num_post_relax ); +HYPRE_Int +HYPRE_SStructSysPFMGSetNumPostRelax_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int num_post_relax ); +HYPRE_Int +HYPRE_SStructSysPFMGSetNumPostRelax( HYPRE_SStructSolver solver, HYPRE_Int num_post_relax ); + +HYPRE_Int +HYPRE_SStructSysPFMGSetNumPreRelax_flt( HYPRE_SStructSolver solver, HYPRE_Int num_pre_relax ); +HYPRE_Int +HYPRE_SStructSysPFMGSetNumPreRelax_dbl( HYPRE_SStructSolver solver, HYPRE_Int num_pre_relax ); +HYPRE_Int +HYPRE_SStructSysPFMGSetNumPreRelax_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int num_pre_relax ); +HYPRE_Int +HYPRE_SStructSysPFMGSetNumPreRelax( HYPRE_SStructSolver solver, HYPRE_Int num_pre_relax ); + +HYPRE_Int +HYPRE_SStructSysPFMGSetPrintLevel_flt( HYPRE_SStructSolver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_SStructSysPFMGSetPrintLevel_dbl( HYPRE_SStructSolver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_SStructSysPFMGSetPrintLevel_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_SStructSysPFMGSetPrintLevel( HYPRE_SStructSolver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_SStructSysPFMGSetRelChange_flt( HYPRE_SStructSolver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_SStructSysPFMGSetRelChange_dbl( HYPRE_SStructSolver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_SStructSysPFMGSetRelChange_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_SStructSysPFMGSetRelChange( HYPRE_SStructSolver solver, HYPRE_Int rel_change ); + +HYPRE_Int +HYPRE_SStructSysPFMGSetRelaxType_flt( HYPRE_SStructSolver solver, HYPRE_Int relax_type ); +HYPRE_Int +HYPRE_SStructSysPFMGSetRelaxType_dbl( HYPRE_SStructSolver solver, HYPRE_Int relax_type ); +HYPRE_Int +HYPRE_SStructSysPFMGSetRelaxType_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int relax_type ); +HYPRE_Int +HYPRE_SStructSysPFMGSetRelaxType( HYPRE_SStructSolver solver, HYPRE_Int relax_type ); + +HYPRE_Int +HYPRE_SStructSysPFMGSetSkipRelax_flt( HYPRE_SStructSolver solver, HYPRE_Int skip_relax ); +HYPRE_Int +HYPRE_SStructSysPFMGSetSkipRelax_dbl( HYPRE_SStructSolver solver, HYPRE_Int skip_relax ); +HYPRE_Int +HYPRE_SStructSysPFMGSetSkipRelax_long_dbl( HYPRE_SStructSolver solver, HYPRE_Int skip_relax ); +HYPRE_Int +HYPRE_SStructSysPFMGSetSkipRelax( HYPRE_SStructSolver solver, HYPRE_Int skip_relax ); + +HYPRE_Int +HYPRE_SStructSysPFMGSetTol_flt( HYPRE_SStructSolver solver, hypre_float tol ); +HYPRE_Int +HYPRE_SStructSysPFMGSetTol_dbl( HYPRE_SStructSolver solver, hypre_double tol ); +HYPRE_Int +HYPRE_SStructSysPFMGSetTol_long_dbl( HYPRE_SStructSolver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_SStructSysPFMGSetTol( HYPRE_SStructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_SStructSysPFMGSetZeroGuess_flt( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructSysPFMGSetZeroGuess_dbl( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructSysPFMGSetZeroGuess_long_dbl( HYPRE_SStructSolver solver ); +HYPRE_Int +HYPRE_SStructSysPFMGSetZeroGuess( HYPRE_SStructSolver solver ); + +HYPRE_Int +HYPRE_SStructSysPFMGSetup_flt( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructSysPFMGSetup_dbl( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructSysPFMGSetup_long_dbl( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructSysPFMGSetup( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); + +HYPRE_Int +HYPRE_SStructSysPFMGSolve_flt( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructSysPFMGSolve_dbl( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); +HYPRE_Int +HYPRE_SStructSysPFMGSolve_long_dbl( 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 ); + + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_SStructBiCGSTABCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_SStructSolver *solver ); + +HYPRE_Int +HYPRE_SStructBiCGSTABDestroy_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver ); + +HYPRE_Int +HYPRE_SStructBiCGSTABGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_SStructBiCGSTABGetNumIterations_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_SStructBiCGSTABGetResidual_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, void **residual ); + +HYPRE_Int +HYPRE_SStructBiCGSTABSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_SStructBiCGSTABSetLogging_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_SStructBiCGSTABSetMaxIter_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_SStructBiCGSTABSetMinIter_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_SStructBiCGSTABSetPrecond_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ); + +HYPRE_Int +HYPRE_SStructBiCGSTABSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_SStructBiCGSTABSetStopCrit_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int stop_crit ); + +HYPRE_Int +HYPRE_SStructBiCGSTABSetTol_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_SStructBiCGSTABSetup_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); + +HYPRE_Int +HYPRE_SStructBiCGSTABSolve_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); + +HYPRE_Int +HYPRE_SStructDiagScale_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector y, HYPRE_SStructVector x ); + +HYPRE_Int +HYPRE_SStructDiagScaleSetup_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector y, HYPRE_SStructVector x ); + +HYPRE_Int +HYPRE_SStructFlexGMRESCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_SStructSolver *solver ); + +HYPRE_Int +HYPRE_SStructFlexGMRESDestroy_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver ); + +HYPRE_Int +HYPRE_SStructFlexGMRESGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_SStructFlexGMRESGetNumIterations_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_SStructFlexGMRESGetResidual_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, void **residual ); + +HYPRE_Int +HYPRE_SStructFlexGMRESSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_SStructFlexGMRESSetKDim_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_SStructFlexGMRESSetLogging_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_SStructFlexGMRESSetMaxIter_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_SStructFlexGMRESSetMinIter_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_SStructFlexGMRESSetModifyPC_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_PtrToModifyPCFcn modify_pc ); + +HYPRE_Int +HYPRE_SStructFlexGMRESSetPrecond_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ); + +HYPRE_Int +HYPRE_SStructFlexGMRESSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_SStructFlexGMRESSetTol_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_SStructFlexGMRESSetup_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); + +HYPRE_Int +HYPRE_SStructFlexGMRESSolve_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); + +HYPRE_Int +HYPRE_SStructGMRESCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_SStructSolver *solver ); + +HYPRE_Int +HYPRE_SStructGMRESDestroy_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver ); + +HYPRE_Int +HYPRE_SStructGMRESGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_SStructGMRESGetNumIterations_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_SStructGMRESGetResidual_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, void **residual ); + +HYPRE_Int +HYPRE_SStructGMRESSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_SStructGMRESSetKDim_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_SStructGMRESSetLogging_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_SStructGMRESSetMaxIter_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_SStructGMRESSetMinIter_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_SStructGMRESSetPrecond_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ); + +HYPRE_Int +HYPRE_SStructGMRESSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_SStructGMRESSetStopCrit_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int stop_crit ); + +HYPRE_Int +HYPRE_SStructGMRESSetTol_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_SStructGMRESSetup_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); + +HYPRE_Int +HYPRE_SStructGMRESSolve_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); + +HYPRE_Int +HYPRE_SStructLGMRESCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_SStructSolver *solver ); + +HYPRE_Int +HYPRE_SStructLGMRESDestroy_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver ); + +HYPRE_Int +HYPRE_SStructLGMRESGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_SStructLGMRESGetNumIterations_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_SStructLGMRESGetResidual_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, void **residual ); + +HYPRE_Int +HYPRE_SStructLGMRESSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_SStructLGMRESSetAugDim_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int aug_dim ); + +HYPRE_Int +HYPRE_SStructLGMRESSetKDim_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_SStructLGMRESSetLogging_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_SStructLGMRESSetMaxIter_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_SStructLGMRESSetMinIter_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int min_iter ); + +HYPRE_Int +HYPRE_SStructLGMRESSetPrecond_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ); + +HYPRE_Int +HYPRE_SStructLGMRESSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_SStructLGMRESSetTol_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_SStructLGMRESSetup_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); + +HYPRE_Int +HYPRE_SStructLGMRESSolve_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); + +HYPRE_Int +HYPRE_SStructPCGCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_SStructSolver *solver ); + +HYPRE_Int +HYPRE_SStructPCGDestroy_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver ); + +HYPRE_Int +HYPRE_SStructPCGGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_SStructPCGGetNumIterations_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_SStructPCGGetResidual_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, void **residual ); + +HYPRE_Int +HYPRE_SStructPCGSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_SStructPCGSetLogging_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_SStructPCGSetMaxIter_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_SStructPCGSetPrecond_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ); + +HYPRE_Int +HYPRE_SStructPCGSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_SStructPCGSetRelChange_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int rel_change ); + +HYPRE_Int +HYPRE_SStructPCGSetTol_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_SStructPCGSetTwoNorm_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int two_norm ); + +HYPRE_Int +HYPRE_SStructPCGSetup_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); + +HYPRE_Int +HYPRE_SStructPCGSolve_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); + +HYPRE_Int +HYPRE_SStructSSAMGCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_SStructSolver *solver ); + +HYPRE_Int +HYPRE_SStructSSAMGDestroy_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver ); + +HYPRE_Int +HYPRE_SStructSSAMGGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_SStructSSAMGGetNumIterations_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_SStructSSAMGSetCoarseSolverType_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int csolver_type ); + +HYPRE_Int +HYPRE_SStructSSAMGSetDxyz_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int nparts, void *dxyz ); + +HYPRE_Int +HYPRE_SStructSSAMGSetInterpType_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int interp_type ); + +HYPRE_Int +HYPRE_SStructSSAMGSetLogging_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_SStructSSAMGSetMaxCoarseSize_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int max_coarse_size ); + +HYPRE_Int +HYPRE_SStructSSAMGSetMaxIter_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_SStructSSAMGSetMaxLevels_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int max_levels ); + +HYPRE_Int +HYPRE_SStructSSAMGSetNonGalerkinRAP_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int non_galerkin ); + +HYPRE_Int +HYPRE_SStructSSAMGSetNonZeroGuess_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver ); + +HYPRE_Int +HYPRE_SStructSSAMGSetNumCoarseRelax_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int num_coarse_relax ); + +HYPRE_Int +HYPRE_SStructSSAMGSetNumPostRelax_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int num_post_relax ); + +HYPRE_Int +HYPRE_SStructSSAMGSetNumPreRelax_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int num_pre_relax ); + +HYPRE_Int +HYPRE_SStructSSAMGSetPrintFreq_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int print_freq ); + +HYPRE_Int +HYPRE_SStructSSAMGSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_SStructSSAMGSetRelChange_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int rel_change ); + +HYPRE_Int +HYPRE_SStructSSAMGSetRelaxType_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int relax_type ); + +HYPRE_Int +HYPRE_SStructSSAMGSetRelaxWeight_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, hypre_long_double weight ); + +HYPRE_Int +HYPRE_SStructSSAMGSetSkipRelax_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int skip_relax ); + +HYPRE_Int +HYPRE_SStructSSAMGSetTol_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_SStructSSAMGSetZeroGuess_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver ); + +HYPRE_Int +HYPRE_SStructSSAMGSetup_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); + +HYPRE_Int +HYPRE_SStructSSAMGSolve_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); + +HYPRE_Int +HYPRE_SStructSetupInterpreter_pre( HYPRE_Precision precision, mv_InterfaceInterpreter *i ); + +HYPRE_Int +HYPRE_SStructSetupMatvec_pre( HYPRE_Precision precision, HYPRE_MatvecFunctions *mv ); + +HYPRE_Int +HYPRE_SStructSplitCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_SStructSolver *solver ); + +HYPRE_Int +HYPRE_SStructSplitDestroy_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver ); + +HYPRE_Int +HYPRE_SStructSplitGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_SStructSplitGetNumIterations_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_SStructSplitPrintLogging_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver ); + +HYPRE_Int +HYPRE_SStructSplitSetLogging_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_SStructSplitSetMaxIter_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_SStructSplitSetNonZeroGuess_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver ); + +HYPRE_Int +HYPRE_SStructSplitSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_SStructSplitSetStructSolver_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int ssolver ); + +HYPRE_Int +HYPRE_SStructSplitSetTol_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_SStructSplitSetZeroGuess_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver ); + +HYPRE_Int +HYPRE_SStructSplitSetup_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); + +HYPRE_Int +HYPRE_SStructSplitSolve_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); + +HYPRE_Int +HYPRE_SStructSysPFMGCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_SStructSolver *solver ); + +HYPRE_Int +HYPRE_SStructSysPFMGDestroy_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver ); + +HYPRE_Int +HYPRE_SStructSysPFMGGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_SStructSysPFMGGetNumIterations_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_SStructSysPFMGSetDxyz_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, void *dxyz ); + +HYPRE_Int +HYPRE_SStructSysPFMGSetJacobiWeight_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, hypre_long_double weight ); + +HYPRE_Int +HYPRE_SStructSysPFMGSetLogging_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_SStructSysPFMGSetMaxIter_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_SStructSysPFMGSetNonZeroGuess_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver ); + +HYPRE_Int +HYPRE_SStructSysPFMGSetNumPostRelax_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int num_post_relax ); + +HYPRE_Int +HYPRE_SStructSysPFMGSetNumPreRelax_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int num_pre_relax ); + +HYPRE_Int +HYPRE_SStructSysPFMGSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_SStructSysPFMGSetRelChange_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int rel_change ); + +HYPRE_Int +HYPRE_SStructSysPFMGSetRelaxType_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int relax_type ); + +HYPRE_Int +HYPRE_SStructSysPFMGSetSkipRelax_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int skip_relax ); + +HYPRE_Int +HYPRE_SStructSysPFMGSetTol_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_SStructSysPFMGSetZeroGuess_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver ); + +HYPRE_Int +HYPRE_SStructSysPFMGSetup_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); + +HYPRE_Int +HYPRE_SStructSysPFMGSolve_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ); + + +#endif + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/src/sstruct_ls/HYPRE_sstruct_maxwell.c b/src/sstruct_ls/HYPRE_sstruct_maxwell.c deleted file mode 100644 index 02de04411c..0000000000 --- a/src/sstruct_ls/HYPRE_sstruct_maxwell.c +++ /dev/null @@ -1,273 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_SStructMaxwell interface - * - *****************************************************************************/ - -#include "_hypre_sstruct_ls.h" - -/*-------------------------------------------------------------------------- - * HYPRE_SStructMaxwellCreate - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_SStructMaxwellCreate(MPI_Comm comm, HYPRE_SStructSolver *solver) -{ - *solver = ( (HYPRE_SStructSolver) hypre_MaxwellTVCreate(comm) ); - - return 0; -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructMaxwellDestroy - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_SStructMaxwellDestroy(HYPRE_SStructSolver solver) -{ - return ( hypre_MaxwellTVDestroy( (void *) solver ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructMaxwellSetup - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_SStructMaxwellSetup( HYPRE_SStructSolver 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 )); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructMaxwellSolve - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_SStructMaxwellSolve( HYPRE_SStructSolver solver, - HYPRE_SStructMatrix A, - HYPRE_SStructVector b, - HYPRE_SStructVector x ) -{ - return ( hypre_MaxwellSolve( (void *) solver, - (hypre_SStructMatrix *) A, - (hypre_SStructVector *) b, - (hypre_SStructVector *) x ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructMaxwellSolve2 - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_SStructMaxwellSolve2( HYPRE_SStructSolver solver, - HYPRE_SStructMatrix A, - HYPRE_SStructVector b, - HYPRE_SStructVector x ) -{ - return ( hypre_MaxwellSolve2( (void *) solver, - (hypre_SStructMatrix *) A, - (hypre_SStructVector *) b, - (hypre_SStructVector *) x ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_MaxwellGrad - *--------------------------------------------------------------------------*/ -HYPRE_Int -HYPRE_MaxwellGrad( HYPRE_SStructGrid grid, - HYPRE_ParCSRMatrix *T ) - -{ - *T = ( (HYPRE_ParCSRMatrix) hypre_Maxwell_Grad( (hypre_SStructGrid *) grid)); - return 0; -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructMaxwellSetGrad - *--------------------------------------------------------------------------*/ -HYPRE_Int -HYPRE_SStructMaxwellSetGrad( HYPRE_SStructSolver solver, - HYPRE_ParCSRMatrix T ) -{ - return ( hypre_MaxwellSetGrad( (void *) solver, - (hypre_ParCSRMatrix *) T) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructMaxwellSetRfactors - *--------------------------------------------------------------------------*/ -HYPRE_Int -HYPRE_SStructMaxwellSetRfactors( HYPRE_SStructSolver solver, - HYPRE_Int *rfactors ) -{ - return ( hypre_MaxwellSetRfactors( (void *) solver, - rfactors ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructMaxwellSetTol - *--------------------------------------------------------------------------*/ -HYPRE_Int -HYPRE_SStructMaxwellSetTol( HYPRE_SStructSolver solver, - HYPRE_Real tol ) -{ - return ( hypre_MaxwellSetTol( (void *) solver, tol ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructMaxwellSetConstantCoef - *--------------------------------------------------------------------------*/ -HYPRE_Int -HYPRE_SStructMaxwellSetConstantCoef( HYPRE_SStructSolver solver, - HYPRE_Int constant_coef) -{ - return ( hypre_MaxwellSetConstantCoef( (void *) solver, constant_coef) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructMaxwellSetMaxIter - *--------------------------------------------------------------------------*/ -HYPRE_Int -HYPRE_SStructMaxwellSetMaxIter( HYPRE_SStructSolver solver, - HYPRE_Int max_iter ) -{ - return ( hypre_MaxwellSetMaxIter( (void *) solver, max_iter ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructMaxwellSetRelChange - *--------------------------------------------------------------------------*/ -HYPRE_Int -HYPRE_SStructMaxwellSetRelChange( HYPRE_SStructSolver solver, - HYPRE_Int rel_change ) -{ - return ( hypre_MaxwellSetRelChange( (void *) solver, rel_change ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructMaxwellSetNumPreRelax - *--------------------------------------------------------------------------*/ -HYPRE_Int -HYPRE_SStructMaxwellSetNumPreRelax( HYPRE_SStructSolver solver, - HYPRE_Int num_pre_relax ) -{ - return ( hypre_MaxwellSetNumPreRelax( (void *) solver, num_pre_relax) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructMaxwellSetNumPostRelax - *--------------------------------------------------------------------------*/ -HYPRE_Int -HYPRE_SStructMaxwellSetNumPostRelax( HYPRE_SStructSolver solver, - HYPRE_Int num_post_relax ) -{ - return ( hypre_MaxwellSetNumPostRelax( (void *) solver, num_post_relax) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructMaxwellSetLogging - *--------------------------------------------------------------------------*/ -HYPRE_Int -HYPRE_SStructMaxwellSetLogging( HYPRE_SStructSolver solver, - HYPRE_Int logging ) -{ - return ( hypre_MaxwellSetLogging( (void *) solver, logging) ); -} - -/*-------------------------------------------------------------------------- -HYPRE_SStructMaxwellSetPrintLevel -*--------------------------------------------------------------------------*/ -HYPRE_Int -HYPRE_SStructMaxwellSetPrintLevel( HYPRE_SStructSolver solver, - HYPRE_Int print_level ) -{ - return ( hypre_MaxwellSetPrintLevel( (void *) solver, print_level) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructMaxwellPrintLogging - *--------------------------------------------------------------------------*/ -HYPRE_Int -HYPRE_SStructMaxwellPrintLogging( HYPRE_SStructSolver solver, - HYPRE_Int myid) -{ - return ( hypre_MaxwellPrintLogging( (void *) solver, myid) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructMaxwellGetNumIterations - *--------------------------------------------------------------------------*/ -HYPRE_Int -HYPRE_SStructMaxwellGetNumIterations( HYPRE_SStructSolver solver, - HYPRE_Int *num_iterations ) -{ - return ( hypre_MaxwellGetNumIterations( (void *) solver, num_iterations ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructMaxwellGetFinalRelativeResidualNorm - *--------------------------------------------------------------------------*/ -HYPRE_Int -HYPRE_SStructMaxwellGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, - HYPRE_Real *norm ) -{ - return ( hypre_MaxwellGetFinalRelativeResidualNorm( (void *) solver, norm ) ); -} - - -/*-------------------------------------------------------------------------- - * HYPRE_SStructMaxwellPhysBdy - *--------------------------------------------------------------------------*/ -HYPRE_Int -HYPRE_SStructMaxwellPhysBdy( HYPRE_SStructGrid *grid_l, - HYPRE_Int num_levels, - 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 ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructMaxwellEliminateRowsCols - *--------------------------------------------------------------------------*/ -HYPRE_Int -HYPRE_SStructMaxwellEliminateRowsCols( HYPRE_ParCSRMatrix parA, - HYPRE_Int nrows, - HYPRE_Int *rows ) -{ - return ( hypre_ParCSRMatrixEliminateRowsCols( (hypre_ParCSRMatrix *) parA, - nrows, - rows ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_SStructMaxwellZeroVector - *--------------------------------------------------------------------------*/ -HYPRE_Int HYPRE_SStructMaxwellZeroVector(HYPRE_ParVector v, - HYPRE_Int *rows, - HYPRE_Int nrows) -{ - return ( hypre_ParVectorZeroBCValues( (hypre_ParVector *) v, - rows, - nrows ) ); -} - - diff --git a/src/sstruct_ls/HYPRE_sstruct_pcg.c b/src/sstruct_ls/HYPRE_sstruct_pcg.c index 24174d4ac4..f63bd6c876 100644 --- a/src/sstruct_ls/HYPRE_sstruct_pcg.c +++ b/src/sstruct_ls/HYPRE_sstruct_pcg.c @@ -195,7 +195,6 @@ HYPRE_SStructDiagScaleSetup( HYPRE_SStructSolver solver, HYPRE_SStructVector y, HYPRE_SStructVector x ) { - return ( HYPRE_StructDiagScaleSetup( (HYPRE_StructSolver) solver, (HYPRE_StructMatrix) A, (HYPRE_StructVector) y, diff --git a/src/sstruct_ls/HYPRE_sstruct_split.c b/src/sstruct_ls/HYPRE_sstruct_split.c index f0f7f29370..bc6e3a34bf 100644 --- a/src/sstruct_ls/HYPRE_sstruct_split.c +++ b/src/sstruct_ls/HYPRE_sstruct_split.c @@ -28,8 +28,8 @@ typedef HYPRE_Int (*HYPRE_PtrToVoid4Fcn)(void*, void*, void*, void*); typedef struct hypre_SStructSolver_struct { + MPI_Comm comm; hypre_SStructVector *y; - HYPRE_Int nparts; HYPRE_Int *nvars; @@ -42,10 +42,17 @@ typedef struct hypre_SStructSolver_struct HYPRE_Real tol; HYPRE_Int max_iter; HYPRE_Int zero_guess; - HYPRE_Int num_iterations; - HYPRE_Real rel_norm; HYPRE_Int ssolver; + /* log info (always logged) */ + HYPRE_Int num_iterations; + HYPRE_Int print_level; + + /* additional log info (logged when `logging' > 0) */ + HYPRE_Int logging; + HYPRE_Real *norms; + HYPRE_Real *rel_norms; + void *matvec_data; } hypre_SStructSolver; @@ -63,6 +70,7 @@ HYPRE_SStructSplitCreate( MPI_Comm comm, solver = hypre_TAlloc(hypre_SStructSolver, 1, HYPRE_MEMORY_HOST); + (solver -> comm) = comm; (solver -> y) = NULL; (solver -> nparts) = 0; (solver -> nvars) = 0; @@ -74,7 +82,10 @@ HYPRE_SStructSplitCreate( MPI_Comm comm, (solver -> max_iter) = 200; (solver -> zero_guess) = 0; (solver -> num_iterations) = 0; - (solver -> rel_norm) = 0; + (solver -> print_level) = 0; + (solver -> logging) = 0; + (solver -> norms) = NULL; + (solver -> rel_norms) = NULL; (solver -> ssolver) = HYPRE_SMG; (solver -> matvec_data) = NULL; @@ -112,6 +123,12 @@ HYPRE_SStructSplitDestroy( HYPRE_SStructSolver solver ) ssolver_destroy = (solver -> ssolver_destroy); ssolver_data = (solver -> ssolver_data); + if ((solver -> logging) > 0) + { + hypre_TFree(solver -> norms, HYPRE_MEMORY_HOST); + hypre_TFree(solver -> rel_norms, HYPRE_MEMORY_HOST); + } + HYPRE_SStructVectorDestroy(y); for (part = 0; part < nparts; part++) { @@ -156,6 +173,7 @@ HYPRE_SStructSplitSetup( HYPRE_SStructSolver solver, HYPRE_SStructVector x ) { HYPRE_Int ssolver = (solver -> ssolver); + HYPRE_Int max_iter = (solver -> max_iter); hypre_SStructVector *y; HYPRE_Int nparts; HYPRE_Int *nvars; @@ -300,6 +318,21 @@ HYPRE_SStructSplitSetup( HYPRE_SStructSolver solver, (solver -> ssolver_solve) = ssolver_solve; (solver -> ssolver_destroy) = ssolver_destroy; (solver -> ssolver_data) = ssolver_data; + + /*----------------------------------------------------- + * Allocate space for log info + *-----------------------------------------------------*/ + + if ((solver -> logging) > 0) + { + (solver -> norms) = hypre_TAlloc(HYPRE_Real, max_iter + 1, HYPRE_MEMORY_HOST); + (solver -> rel_norms) = hypre_TAlloc(HYPRE_Real, max_iter + 1, HYPRE_MEMORY_HOST); + } + + /*----------------------------------------------------- + * Setup matvec for A*x + *-----------------------------------------------------*/ + if ((solver -> tol) > 0.0) { hypre_SStructMatvecCreate(&(solver -> matvec_data)); @@ -327,6 +360,9 @@ HYPRE_SStructSplitSolve( HYPRE_SStructSolver solver, HYPRE_Real tol = (solver -> tol); HYPRE_Int max_iter = (solver -> max_iter); HYPRE_Int zero_guess = (solver -> zero_guess); + HYPRE_Int logging = (solver -> logging); + HYPRE_Real *norms = (solver -> norms); + HYPRE_Real *rel_norms = (solver -> rel_norms); void *matvec_data = (solver -> matvec_data); hypre_SStructPMatrix *pA; @@ -343,19 +379,28 @@ HYPRE_SStructSplitSolve( HYPRE_SStructSolver solver, hypre_ParVector *pary; HYPRE_Int iter, part, vi, vj; - HYPRE_Real b_dot_b = 0, r_dot_r; + HYPRE_Real b_dot_b = 0.0, r_dot_r = 0.0; + HYPRE_Real eps = 0.0; +#ifdef DEBUG + char filename[255]; +#endif /* part of convergence check */ if (tol > 0.0) { /* eps = (tol^2) */ hypre_SStructInnerProd(b, b, &b_dot_b); + eps = tol * tol; /* if rhs is zero, return a zero solution */ - if (b_dot_b == 0.0) + if (!(b_dot_b > 0.0)) { hypre_SStructVectorSetConstantValues(x, 0.0); - (solver -> rel_norm) = 0.0; + if (logging > 0) + { + norms[0] = 0.0; + rel_norms[0] = 0.0; + } return hypre_error_flag; } @@ -366,16 +411,28 @@ HYPRE_SStructSplitSolve( HYPRE_SStructSolver solver, /* convergence check */ if (tol > 0.0) { - /* compute fine grid residual (b - Ax) */ - hypre_SStructCopy(b, y); - hypre_SStructMatvecCompute(matvec_data, -1.0, A, x, 1.0, y); + /* compute fine grid residual (r = b - Ax) */ + hypre_SStructMatvecCompute(matvec_data, -1.0, A, x, 1.0, b, y); hypre_SStructInnerProd(y, y, &r_dot_r); - (solver -> rel_norm) = hypre_sqrt(r_dot_r / b_dot_b); - if ((solver -> rel_norm) < tol) + if (logging > 0) + { + norms[iter] = sqrt(r_dot_r); + rel_norms[iter] = sqrt(r_dot_r / b_dot_b); + } + + if (r_dot_r / b_dot_b < eps) { break; } + +#ifdef DEBUG + hypre_sprintf(filename, "split_x.i%02d", iter); + HYPRE_SStructVectorPrint(filename, x, 0); + + hypre_sprintf(filename, "split_r.i%02d", iter); + HYPRE_SStructVectorPrint(filename, y, 0); +#endif } /* copy b into y */ @@ -399,7 +456,7 @@ HYPRE_SStructSplitSolve( HYPRE_SStructSolver solver, { sA = hypre_SStructPMatrixSMatrix(pA, vi, vj); sx = hypre_SStructPVectorSVector(px, vj); - hypre_StructMatvecCompute(sdata, -1.0, sA, sx, 1.0, sy); + hypre_StructMatvecCompute(sdata, -1.0, sA, sx, 1.0, sy, sy); } } } @@ -432,6 +489,7 @@ HYPRE_SStructSplitSolve( HYPRE_SStructSolver solver, } (solver -> num_iterations) = iter; + HYPRE_SStructSplitPrintLogging(solver); return hypre_error_flag; } @@ -458,6 +516,28 @@ HYPRE_SStructSplitSetMaxIter( HYPRE_SStructSolver solver, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSplitSetPrintLevel( HYPRE_SStructSolver solver, + HYPRE_Int print_level ) +{ + (solver -> print_level) = print_level; + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSplitSetLogging( HYPRE_SStructSolver solver, + HYPRE_Int logging ) +{ + (solver -> logging) = logging; + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -500,6 +580,50 @@ HYPRE_SStructSplitGetNumIterations( HYPRE_SStructSolver solver, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSplitPrintLogging( HYPRE_SStructSolver solver ) +{ + MPI_Comm comm = (solver -> comm); + HYPRE_Int num_iterations = (solver -> num_iterations); + HYPRE_Int max_iter = (solver -> max_iter); + HYPRE_Int logging = (solver -> logging); + HYPRE_Int print_level = (solver -> print_level); + HYPRE_Real *norms = (solver -> norms); + HYPRE_Real *rel_norms = (solver -> rel_norms); + + HYPRE_Int myid, i; + HYPRE_Real convr = 1.0; + HYPRE_Real avg_convr; + + hypre_MPI_Comm_rank(comm, &myid); + + if ((myid == 0) && (logging > 0) && (print_level > 0)) + { + hypre_printf("Iters ||r||_2 conv.rate ||r||_2/||b||_2\n"); + hypre_printf("% 5d %e %f %e\n", 0, norms[0], convr, rel_norms[0]); + for (i = 1; i <= num_iterations; i++) + { + convr = norms[i] / norms[i - 1]; + hypre_printf("% 5d %e %f %e\n", i, norms[i], convr, rel_norms[i]); + } + + if (max_iter > 1) + { + if (rel_norms[0] > 0.) + { + avg_convr = pow((rel_norms[num_iterations] / rel_norms[0]), + (1.0 / (HYPRE_Real) num_iterations)); + hypre_printf("\nAverage convergence factor = %f\n", avg_convr); + } + } + } + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -507,6 +631,26 @@ HYPRE_Int HYPRE_SStructSplitGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, HYPRE_Real *norm ) { - *norm = (solver -> rel_norm); + HYPRE_Int max_iter = (solver -> max_iter); + HYPRE_Int num_iterations = (solver -> num_iterations); + HYPRE_Int logging = (solver -> logging); + HYPRE_Real *rel_norms = (solver -> rel_norms); + + if (logging > 0) + { + if (max_iter == 0) + { + hypre_error_in_arg(1); + } + else if (num_iterations == max_iter) + { + *norm = rel_norms[num_iterations - 1]; + } + else + { + *norm = rel_norms[num_iterations]; + } + } + return hypre_error_flag; } diff --git a/src/sstruct_ls/HYPRE_sstruct_ssamg.c b/src/sstruct_ls/HYPRE_sstruct_ssamg.c new file mode 100644 index 0000000000..1ee3bdb6e3 --- /dev/null +++ b/src/sstruct_ls/HYPRE_sstruct_ssamg.c @@ -0,0 +1,283 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_sstruct_ls.h" + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGCreate( MPI_Comm comm, HYPRE_SStructSolver *solver ) +{ + *solver = ( (HYPRE_SStructSolver) hypre_SSAMGCreate( comm ) ); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGDestroy( HYPRE_SStructSolver solver ) +{ + return ( hypre_SSAMGDestroy( (void *) solver ) ); +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetup( HYPRE_SStructSolver solver, + HYPRE_SStructMatrix A, + HYPRE_SStructVector b, + HYPRE_SStructVector x ) +{ + return ( hypre_SSAMGSetup( (void *) solver, + (hypre_SStructMatrix *) A, + (hypre_SStructVector *) b, + (hypre_SStructVector *) x ) ); +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSolve( HYPRE_SStructSolver solver, + HYPRE_SStructMatrix A, + HYPRE_SStructVector b, + HYPRE_SStructVector x) +{ + return ( hypre_SSAMGSolve( (void *) solver, + (hypre_SStructMatrix *) A, + (hypre_SStructVector *) b, + (hypre_SStructVector *) x ) ); +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetTol( HYPRE_SStructSolver solver, + HYPRE_Real tol ) +{ + return ( hypre_SSAMGSetTol( (void *) solver, tol ) ); +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetMaxIter( HYPRE_SStructSolver solver, + HYPRE_Int max_iter ) +{ + return ( hypre_SSAMGSetMaxIter( (void *) solver, max_iter ) ); +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetMaxLevels( HYPRE_SStructSolver solver, + HYPRE_Int max_levels ) +{ + return ( hypre_SSAMGSetMaxLevels( (void *) solver, max_levels ) ); +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetRelChange( HYPRE_SStructSolver solver, + HYPRE_Int rel_change ) +{ + return ( hypre_SSAMGSetRelChange( (void *) solver, rel_change ) ); +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetNonGalerkinRAP( HYPRE_SStructSolver solver, + HYPRE_Int non_galerkin ) +{ + return ( hypre_SSAMGSetNonGalerkinRAP( (void *) solver, non_galerkin ) ); +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetZeroGuess( HYPRE_SStructSolver solver ) +{ + return ( hypre_SSAMGSetZeroGuess( (void *) solver, 1 ) ); +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetNonZeroGuess( HYPRE_SStructSolver solver ) +{ + return ( hypre_SSAMGSetZeroGuess( (void *) solver, 0 ) ); +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetRelaxType( HYPRE_SStructSolver solver, + HYPRE_Int relax_type ) +{ + return ( hypre_SSAMGSetRelaxType( (void *) solver, relax_type) ); +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetInterpType( HYPRE_SStructSolver solver, + HYPRE_Int interp_type ) +{ + return ( hypre_SSAMGSetInterpType( (void *) solver, interp_type) ); +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetSkipRelax( HYPRE_SStructSolver solver, + HYPRE_Int skip_relax ) +{ + return ( hypre_SSAMGSetSkipRelax( (void *) solver, skip_relax) ); +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetRelaxWeight( HYPRE_SStructSolver solver, + HYPRE_Real relax_weight ) +{ + return ( hypre_SSAMGSetRelaxWeight( (void *) solver, relax_weight) ); +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetNumPreRelax( HYPRE_SStructSolver solver, + HYPRE_Int num_pre_relax ) +{ + return ( hypre_SSAMGSetNumPreRelax( (void *) solver, num_pre_relax) ); +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetNumPostRelax( HYPRE_SStructSolver solver, + HYPRE_Int num_post_relax ) +{ + return ( hypre_SSAMGSetNumPosRelax( (void *) solver, num_post_relax) ); +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetCoarseSolverType( HYPRE_SStructSolver solver, + HYPRE_Int csolver_type ) +{ + return ( hypre_SSAMGSetCoarseSolverType( (void *) solver, csolver_type ) ); +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetNumCoarseRelax( HYPRE_SStructSolver solver, + HYPRE_Int num_coarse_relax ) +{ + return ( hypre_SSAMGSetNumCoarseRelax( (void *) solver, num_coarse_relax ) ); +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetMaxCoarseSize( HYPRE_SStructSolver solver, + HYPRE_Int max_coarse_size ) +{ + return ( hypre_SSAMGSetMaxCoarseSize( (void *) solver, max_coarse_size ) ); +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetDxyz( HYPRE_SStructSolver solver, + HYPRE_Int nparts, + HYPRE_Real **dxyz ) +{ + return ( hypre_SSAMGSetDxyz( (void *) solver, nparts, dxyz) ); +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetLogging( HYPRE_SStructSolver solver, + HYPRE_Int logging ) +{ + return ( hypre_SSAMGSetLogging( (void *) solver, logging) ); +} + +/*-------------------------------------------------------------------------- +*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetPrintLevel( HYPRE_SStructSolver solver, + HYPRE_Int print_level ) +{ + return ( hypre_SSAMGSetPrintLevel( (void *) solver, print_level) ); +} + +/*-------------------------------------------------------------------------- +*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetPrintFreq( HYPRE_SStructSolver solver, + HYPRE_Int print_freq ) +{ + if (print_freq < 1) + { + hypre_error_in_arg(2); + return hypre_error_flag; + } + + return ( hypre_SSAMGSetPrintFreq( (void *) solver, print_freq) ); +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGGetNumIterations( HYPRE_SStructSolver solver, + HYPRE_Int *num_iterations ) +{ + return ( hypre_SSAMGGetNumIterations( (void *) solver, num_iterations ) ); +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, + HYPRE_Real *norm ) +{ + return ( hypre_SSAMGGetFinalRelativeResidualNorm( (void *) solver, norm ) ); +} diff --git a/src/sstruct_ls/HYPRE_sstruct_sys_pfmg.c b/src/sstruct_ls/HYPRE_sstruct_sys_pfmg.c index 5fdd8f563d..44897f503f 100644 --- a/src/sstruct_ls/HYPRE_sstruct_sys_pfmg.c +++ b/src/sstruct_ls/HYPRE_sstruct_sys_pfmg.c @@ -204,4 +204,3 @@ HYPRE_SStructSysPFMGGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, { return ( hypre_SysPFMGGetFinalRelativeResidualNorm( (void *) solver, norm ) ); } - diff --git a/src/sstruct_ls/Makefile b/src/sstruct_ls/Makefile index a7d4175cb7..098a256788 100644 --- a/src/sstruct_ls/Makefile +++ b/src/sstruct_ls/Makefile @@ -30,12 +30,6 @@ C_COMPILE_FLAGS = \ HEADERS =\ HYPRE_sstruct_ls.h\ _hypre_sstruct_ls.h\ - fac.h\ - maxwell_TV.h\ - nd1_amge_interpolation.h\ - sstruct_owninfo.h\ - sstruct_recvinfo.h\ - sstruct_sendinfo.h\ sys_pfmg.h FILES =\ @@ -43,72 +37,65 @@ FILES =\ F90_HYPRE_sstruct_gmres.c\ F90_HYPRE_sstruct_flexgmres.c\ F90_HYPRE_sstruct_lgmres.c\ - F90_HYPRE_sstruct_InterFAC.c\ F90_HYPRE_sstruct_int.c\ - F90_HYPRE_sstruct_maxwell.c\ F90_HYPRE_sstruct_pcg.c\ F90_HYPRE_sstruct_split.c\ F90_HYPRE_sstruct_sys_pfmg.c\ + F90_HYPRE_sstruct_ssamg.c\ HYPRE_sstruct_bicgstab.c\ HYPRE_sstruct_gmres.c\ HYPRE_sstruct_flexgmres.c\ HYPRE_sstruct_lgmres.c\ - HYPRE_sstruct_InterFAC.c\ HYPRE_sstruct_int.c\ - HYPRE_sstruct_maxwell.c\ HYPRE_sstruct_pcg.c\ HYPRE_sstruct_split.c\ HYPRE_sstruct_sys_pfmg.c\ - bsearch.c\ - fac.c\ - fac_amr_zero_data.c\ - fac_cf_coarsen.c\ - fac_cfstencil_box.c\ - fac_CFInterfaceExtents.c\ - fac_interp2.c\ - fac_relax.c\ - fac_solve3.c\ - fac_zero_cdata.c\ + HYPRE_sstruct_ssamg.c\ krylov.c\ krylov_sstruct.c\ - eliminate_rowscols.c\ - maxwell_grad.c\ - maxwell_physbdy.c\ - maxwell_PNedelec.c\ - maxwell_PNedelec_bdy.c\ - maxwell_semi_interp.c\ - maxwell_solve.c\ - maxwell_solve2.c\ - maxwell_TV.c\ - maxwell_TV_setup.c\ - maxwell_zeroBC.c\ - nd1_amge_interpolation.c\ - sstruct_amr_intercommunication.c\ - sstruct_owninfo.c\ - sstruct_recvinfo.c\ - sstruct_sendinfo.c\ - sstruct_sharedDOFComm.c\ sys_pfmg.c\ sys_pfmg_relax.c\ sys_pfmg_setup.c\ sys_pfmg_setup_interp.c\ - sys_pfmg_setup_rap.c\ sys_pfmg_solve.c\ - sys_semi_interp.c\ - sys_semi_restrict.c + ssamg.c\ + ssamg_csolver.c\ + ssamg_stats.c\ + ssamg_setup.c\ + ssamg_setup_rap.c\ + ssamg_solve.c\ CUFILES =\ - fac_amr_fcoarsen.c\ - fac_amr_rap.c\ - fac_restrict2.c\ - fac_setup2.c\ - fac_zero_stencilcoef.c\ node_relax.c\ + ssamg_interp.c\ + ssamg_relax.c\ + ssamg_uinterp.c + +# Mixed precision files +MP_FILES = \ + mup_fixed.c\ + mup_functions.c\ + mup_pre.c COBJS = ${FILES:.c=.o} CUOBJS = ${CUFILES:.c=.obj} OBJS = ${COBJS} ${CUOBJS} +ifeq (${MP_BUILD}, 1) + +COBJS_single = ${FILES:.c=.o_flt} +COBJS_double = ${FILES:.c=.o_dbl} +COBJS_longdouble = ${FILES:.c=.o_ldbl} +CUOBJS_single = ${CUFILES:.c=.obj_flt} +CUOBJS_double = ${CUFILES:.c=.obj_dbl} +CUOBJS_longdouble = ${CUFILES:.c=.obj_ldbl} +MP_COBJS = ${MP_FILES:.c=.o} + +OBJS = ${COBJS_single} ${COBJS_double} ${COBJS_longdouble} ${MP_COBJS} +OBJS += ${CUOBJS_single} ${CUOBJS_double} ${CUOBJS_longdouble} + +endif + SONAME = libHYPRE_sstruct_ls-${HYPRE_RELEASE_VERSION}${HYPRE_LIB_SUFFIX} ################################################################## @@ -117,16 +104,18 @@ SONAME = libHYPRE_sstruct_ls-${HYPRE_RELEASE_VERSION}${HYPRE_LIB_SUFFIX} all: libHYPRE_sstruct_ls${HYPRE_LIB_SUFFIX} cp -fR $(srcdir)/HYPRE_*.h $(HYPRE_BUILD_DIR)/include - cp -fR $(srcdir)/_hypre_sstruct_ls.h $(HYPRE_BUILD_DIR)/include + cp -fR $(srcdir)/_hypre_*.h $(HYPRE_BUILD_DIR)/include # cp -fR libHYPRE* $(HYPRE_BUILD_DIR)/lib install: libHYPRE_sstruct_ls${HYPRE_LIB_SUFFIX} cp -fR $(srcdir)/HYPRE_*.h $(HYPRE_INC_INSTALL) - cp -fR $(srcdir)/_hypre_sstruct_ls.h $(HYPRE_INC_INSTALL) + cp -fR $(srcdir)/_hypre_*.h $(HYPRE_INC_INSTALL) # cp -fR libHYPRE* $(HYPRE_LIB_INSTALL) clean: rm -f *.o *.obj libHYPRE* + rm -f *.o_flt *.o_dbl *.o_ldbl + rm -f *.obj_flt *.obj_dbl *.obj_ldbl rm -rf pchdir tca.map *inslog* distclean: clean diff --git a/src/sstruct_ls/_hypre_sstruct_ls.h b/src/sstruct_ls/_hypre_sstruct_ls.h index 74d1a2912d..1ff0a29a28 100644 --- a/src/sstruct_ls/_hypre_sstruct_ls.h +++ b/src/sstruct_ls/_hypre_sstruct_ls.h @@ -1,9 +1,5 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_SSTRUCT_LS_HEADER #define hypre_SSTRUCT_LS_HEADER @@ -17,566 +13,29 @@ #include "HYPRE_sstruct_ls.h" #include "_hypre_utilities.h" -#include "krylov.h" +#include "_hypre_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 - -/*-------------------------------------------------------------------------- - * hypre_SStructOwnInfo data structure - * This structure is for the coarsen fboxes that are on this processor, - * and the cboxes of cgrid/(all coarsened fboxes) on this processor (i.e., - * the coarse boxes of the composite cgrid (no underlying) on this processor). - *--------------------------------------------------------------------------*/ -#ifndef hypre_OWNINFODATA_HEADER -#define hypre_OWNINFODATA_HEADER - - -typedef struct -{ - HYPRE_Int size; - - hypre_BoxArrayArray *own_boxes; /* size of fgrid */ - HYPRE_Int **own_cboxnums; /* local cbox number- each fbox - leads to an array of cboxes */ - - hypre_BoxArrayArray *own_composite_cboxes; /* size of cgrid */ - HYPRE_Int own_composite_size; -} hypre_SStructOwnInfoData; - - -/*-------------------------------------------------------------------------- - * Accessor macros: hypre_SStructOwnInfoData; - *--------------------------------------------------------------------------*/ - -#define hypre_SStructOwnInfoDataSize(own_data) ((own_data) -> size) -#define hypre_SStructOwnInfoDataOwnBoxes(own_data) ((own_data) -> own_boxes) -#define hypre_SStructOwnInfoDataOwnBoxNums(own_data) \ -((own_data) -> own_cboxnums) -#define hypre_SStructOwnInfoDataCompositeCBoxes(own_data) \ -((own_data) -> own_composite_cboxes) -#define hypre_SStructOwnInfoDataCompositeSize(own_data) \ -((own_data) -> own_composite_size) +#include "_hypre_lobpcg_multivector.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_sstruct_ls_mup_def.h" #endif -/*-------------------------------------------------------------------------- - * hypre_SStructRecvInfo data structure - *--------------------------------------------------------------------------*/ -#ifndef hypre_RECVINFODATA_HEADER -#define hypre_RECVINFODATA_HEADER - - -typedef struct -{ - HYPRE_Int size; - - hypre_BoxArrayArray *recv_boxes; - HYPRE_Int **recv_procs; - -} hypre_SStructRecvInfoData; - -#endif -/*-------------------------------------------------------------------------- - * hypre_SStructSendInfo data structure - *--------------------------------------------------------------------------*/ -#ifndef hypre_SENDINFODATA_HEADER -#define hypre_SENDINFODATA_HEADER - - -typedef struct -{ - HYPRE_Int size; - - hypre_BoxArrayArray *send_boxes; - HYPRE_Int **send_procs; - HYPRE_Int **send_remote_boxnums; - -} hypre_SStructSendInfoData; +#ifdef __cplusplus +extern "C" { #endif -typedef struct -{ - hypre_IJMatrix *Face_iedge; - hypre_IJMatrix *Element_iedge; - hypre_IJMatrix *Edge_iedge; - - hypre_IJMatrix *Element_Face; - hypre_IJMatrix *Element_Edge; - -} hypre_PTopology; /****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. * - * Header info for the Maxwell solver - * - *****************************************************************************/ - -#ifndef hypre_MAXWELL_HEADER -#define hypre_MAXWELL_HEADER - -/*-------------------------------------------------------------------------- - * hypre_MaxwellData: - *--------------------------------------------------------------------------*/ - -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; - - /* these will be extracted from the amg_data structure. Note that there is no grid - underlying these matrices and vectors if they are generated by the amg_setup. - So, will be stored as Parcsr_matrices and Par_vectors. */ - hypre_SStructMatrix *Ann; - hypre_SStructVector *bn; - hypre_SStructVector *xn; - - void *amg_vdata; - hypre_ParCSRMatrix **Ann_l; - hypre_SStructStencil **Ann_stencils; - hypre_ParCSRMatrix **Pn_l; - hypre_ParCSRMatrix **RnT_l; - hypre_ParVector **bn_l; - hypre_ParVector **xn_l; - hypre_ParVector **resn_l; - hypre_ParVector **en_l; - hypre_ParVector **nVtemp_l; - hypre_ParVector **nVtemp2_l; - HYPRE_Int **nCF_marker_l; - HYPRE_Real *nrelax_weight; - HYPRE_Real *nomega; - HYPRE_Int nrelax_type; - HYPRE_Int node_numlevels; - - hypre_ParCSRMatrix *Tgrad; - hypre_ParCSRMatrix *T_transpose; - - /* edge data structure. These will have grids. */ - HYPRE_Int edge_maxlevels; - HYPRE_Int edge_numlevels; - hypre_ParCSRMatrix **Aee_l; - hypre_ParVector **be_l; - hypre_ParVector **xe_l; - hypre_ParVector **rese_l; - hypre_ParVector **ee_l; - hypre_ParVector **eVtemp_l; - hypre_ParVector **eVtemp2_l; - HYPRE_Int **eCF_marker_l; - HYPRE_Real *erelax_weight; - HYPRE_Real *eomega; - HYPRE_Int erelax_type; - - /* edge data structure. These will have no grid. */ - hypre_IJMatrix **Pe_l; - hypre_IJMatrix **ReT_l; - HYPRE_Int **BdryRanks_l; - HYPRE_Int *BdryRanksCnts_l; - - /* edge-node data structure. These will have grids. */ - HYPRE_Int en_numlevels; - - /* log info (always logged) */ - HYPRE_Int num_iterations; - HYPRE_Int time_index; - - /* additional log info (logged when `logging' > 0) */ - HYPRE_Int print_level; - HYPRE_Int logging; - HYPRE_Real *norms; - HYPRE_Real *rel_norms; - -} hypre_MaxwellData; - -#endif -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 ); - -/* 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 ); - -/* fac_amr_rap.c */ -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 ); - -/* 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 ); - -/* fac_cf_coarsen.c */ -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 ); - -/* 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 ); - -/* 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 ); - -/* 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 ); - -/* 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_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 ); - -/* fac_solve3.c */ -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 ); - -/* 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 ); - -/* 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 ); - -/* maxwell_solve2.c */ -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_sstruct_bicgstab.c */ -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_sstruct_flexgmres.c */ -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_sstruct_gmres.c */ -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 ); + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ /* 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_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_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_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_sstruct_lgmres.c */ -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_sstruct_maxwell.c */ -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_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_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_sstruct_split.c */ -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_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_sstruct_sys_pfmg.c */ -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_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 ); /* krylov.c */ HYPRE_Int hypre_SStructKrylovIdentitySetup ( void *vdata, void *A, void *b, void *x ); @@ -601,72 +60,6 @@ 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 ); - -/* maxwell_PNedelec_bdy.c */ -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 ); - -/* 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 ); - -/* 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 ); - -/* 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 ); - -/* 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 ); - -/* 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 ); - /* node_relax.c */ void *hypre_NodeRelaxCreate ( MPI_Comm comm ); HYPRE_Int hypre_NodeRelaxDestroy ( void *relax_vdata ); @@ -685,36 +78,97 @@ 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 ); - -/* 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_SStructOwnInfoDataDestroy ( hypre_SStructOwnInfoData *owninfo_data ); - -/* sstruct_recvinfo.c */ -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_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 ); +/* ssamg.c */ +void * hypre_SSAMGCreate ( hypre_MPI_Comm comm ); +HYPRE_Int hypre_SSAMGDestroy ( void *ssamg_vdata ); +HYPRE_Int hypre_SSAMGSetTol ( void *ssamg_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_SSAMGSetMaxIter ( void *ssamg_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_SSAMGSetMaxLevels ( void *ssamg_vdata, HYPRE_Int max_levels ); +HYPRE_Int hypre_SSAMGSetRelChange ( void *ssamg_vdata, HYPRE_Int rel_change ); +HYPRE_Int hypre_SSAMGSetZeroGuess ( void *ssamg_vdata, HYPRE_Int zero_guess ); +HYPRE_Int hypre_SSAMGSetNonGalerkinRAP ( void *ssamg_vdata, HYPRE_Int non_galerkin ); +HYPRE_Int hypre_SSAMGSetDxyz ( void *ssamg_vdata, HYPRE_Int nparts, HYPRE_Real **dxyz ); +HYPRE_Int hypre_SSAMGSetRelaxType ( void *ssamg_vdata, HYPRE_Int relax_type ); +HYPRE_Int hypre_SSAMGSetInterpType ( void *ssamg_vdata, HYPRE_Int interp_type ); +HYPRE_Int hypre_SSAMGSetRelaxWeight ( void *ssamg_vdata, HYPRE_Real relax_weight ); +HYPRE_Int hypre_SSAMGSetSkipRelax ( void *ssamg_vdata, HYPRE_Int skip_relax ); +HYPRE_Int hypre_SSAMGSetNumPreRelax ( void *ssamg_vdata, HYPRE_Int num_pre_relax ); +HYPRE_Int hypre_SSAMGSetNumPosRelax ( void *ssamg_vdata, HYPRE_Int num_pos_relax ); +HYPRE_Int hypre_SSAMGSetNumCoarseRelax ( void *ssamg_vdata, HYPRE_Int num_coarse_relax ); +HYPRE_Int hypre_SSAMGSetMaxCoarseSize ( void *ssamg_vdata, HYPRE_Int max_coarse_size ); +HYPRE_Int hypre_SSAMGSetCoarseSolverType ( void *ssamg_vdata, HYPRE_Int csolver_type ); +HYPRE_Int hypre_SSAMGSetPrintLevel ( void *ssamg_vdata, HYPRE_Int print_level ); +HYPRE_Int hypre_SSAMGSetPrintFreq ( void *ssamg_vdata, HYPRE_Int print_freq ); +HYPRE_Int hypre_SSAMGSetLogging ( void *ssamg_vdata, HYPRE_Int logging ); +HYPRE_Int hypre_SSAMGPrintLogging ( void *ssamg_vdata ); +HYPRE_Int hypre_SSAMGPrintStats ( void *ssamg_vdata ); +HYPRE_Int hypre_SSAMGGetNumIterations ( void *ssamg_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_SSAMGGetFinalRelativeResidualNorm ( void *ssamg_vdata, + HYPRE_Real *relative_residual_norm ); + +/* ssamg_csolver.c */ +HYPRE_Int hypre_SSAMGCoarseSolverSetup( void *ssamg_vdata ); +HYPRE_Int hypre_SSAMGCoarseSolve( void *ssamg_vdata ); +HYPRE_Int hypre_SSAMGCoarseSolverDestroy( void *ssamg_vdata ); + +/* ssamg_interp.c */ +hypre_SStructMatrix* hypre_SSAMGCreateInterpOp ( hypre_SStructMatrix *A, hypre_SStructGrid *cgrid, + HYPRE_Int *cdir_p ); +HYPRE_Int hypre_SSAMGSetupInterpOp ( hypre_SStructMatrix *A, HYPRE_Int *cdir_p, + hypre_SStructMatrix *P, HYPRE_Int interp_type ); + +/* ssamg_uinterp.c */ +HYPRE_Int hypre_SSAMGSetupUInterpOp ( hypre_SStructMatrix *A, HYPRE_Int *cdir_p, + hypre_SStructMatrix *P, HYPRE_Int interp_type ); + +/* ssamg_setup_rap.c */ +HYPRE_Int hypre_SSAMGComputeRAP ( hypre_SStructMatrix *A, hypre_SStructMatrix *P, + hypre_SStructGrid **cgrid, HYPRE_Int *cdir_p, HYPRE_Int non_galerkin, + hypre_SStructMatrix **Ac_ptr ); +HYPRE_Int hypre_SSAMGComputeRAPNonGlk ( hypre_SStructMatrix *A, hypre_SStructMatrix *P, + HYPRE_Int *cdir_p, hypre_SStructMatrix **Ac_ptr ); + +/* ssamg_relax.c */ +HYPRE_Int hypre_SSAMGRelaxCreate ( MPI_Comm comm, HYPRE_Int nparts, void **relax_vdata_ptr ); +HYPRE_Int hypre_SSAMGRelaxDestroy ( void *relax_vdata ); +HYPRE_Int hypre_SSAMGRelaxSetup ( void *relax_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, + hypre_SStructVector *x ); +HYPRE_Int hypre_SSAMGRelax ( void *relax_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, + hypre_SStructVector *x ); +HYPRE_Int hypre_SSAMGRelaxGeneric ( void *relax_vdata, hypre_SStructMatrix *A, + hypre_SStructVector *b, hypre_SStructVector *x ); +HYPRE_Int hypre_SSAMGRelaxJacobi ( void *relax_vdata, hypre_SStructMatrix *A, + hypre_SStructVector *b, hypre_SStructVector *x ); +HYPRE_Int hypre_SSAMGRelaxSetPreRelax ( void *relax_vdata ); +HYPRE_Int hypre_SSAMGRelaxSetPostRelax ( void *relax_vdata ); +HYPRE_Int hypre_SSAMGRelaxSetTol ( void *relax_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_SSAMGRelaxSetWeights ( void *relax_vdata, HYPRE_Real *weights ); +HYPRE_Int hypre_SSAMGRelaxSetActiveParts ( void *relax_vdata, HYPRE_Int *active_p ); +HYPRE_Int hypre_SSAMGRelaxSetMatvecData ( void *relax_vdata, void *matvec_vdata ); +HYPRE_Int hypre_SSAMGRelaxSetNumNodesets ( void *relax_vdata, HYPRE_Int num_nodesets ); +HYPRE_Int hypre_SSAMGRelaxSetNodeset ( void *relax_vdata, HYPRE_Int nodeset, HYPRE_Int nodeset_size, + hypre_Index nodeset_stride, hypre_Index *nodeset_indices ); +HYPRE_Int hypre_SSAMGRelaxSetNodesetRank ( void *relax_vdata, HYPRE_Int nodeset, + HYPRE_Int nodeset_rank ); +HYPRE_Int hypre_SSAMGRelaxSetMaxIter ( void *relax_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_SSAMGRelaxSetZeroGuess ( void *relax_vdata, HYPRE_Int zero_guess ); +HYPRE_Int hypre_SSAMGRelaxSetType ( void *relax_vdata, HYPRE_Int relax_type ); +HYPRE_Int hypre_SSAMGRelaxSetTempVec ( void *relax_vdata, hypre_SStructVector *t ); +HYPRE_Int hypre_SSAMGRelaxGetRelaxWeight ( void *relax_vdata, HYPRE_Int part, HYPRE_Real *weight ); + +/* ssamg_setup.c */ +HYPRE_Int hypre_SSAMGSetup ( void *ssamg_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, + hypre_SStructVector *x ); +HYPRE_Int hypre_SSAMGComputeNumCoarseRelax ( void *ssamg_vdata ); +HYPRE_Int hypre_SSAMGComputeMaxLevels ( hypre_SStructGrid *grid, HYPRE_Int *max_levels ); +HYPRE_Int hypre_SSAMGComputeDxyz ( hypre_SStructMatrix *A, HYPRE_Real **dxyz, + HYPRE_Int *dxyz_flag ); +HYPRE_Int hypre_SSAMGCoarsen ( void *ssamg_vdata, hypre_SStructGrid *grid, HYPRE_Int *dxyz_flag, + HYPRE_Real **dxyz ); + +/* ssamg_solve.c */ +HYPRE_Int hypre_SSAMGSolve ( void *ssamg_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, + hypre_SStructVector *x ); /* sys_pfmg.c */ void *hypre_SysPFMGCreate ( MPI_Comm comm ); @@ -732,7 +186,7 @@ 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_SysPFMGPrintLogging ( void *sys_pfmg_vdata ); HYPRE_Int hypre_SysPFMGGetFinalRelativeResidualNorm ( void *sys_pfmg_vdata, HYPRE_Real *relative_residual_norm ); @@ -755,14 +209,13 @@ HYPRE_Int hypre_SysPFMGRelaxSetTempVec ( void *sys_pfmg_relax_vdata, hypre_SStru /* 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_SysPFMGZeroDiagonal( hypre_SStructPMatrix *A ); /* 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_Int cdir, + hypre_Index stride ); +HYPRE_Int hypre_SysPFMGSetupInterpOp( hypre_SStructPMatrix *P, hypre_SStructPMatrix *A, + HYPRE_Int cdir ); /* sys_pfmg_setup_rap.c */ hypre_SStructPMatrix *hypre_SysPFMGCreateRAPOp ( hypre_SStructPMatrix *R, hypre_SStructPMatrix *A, @@ -797,4 +250,16 @@ HYPRE_Int hypre_SysSemiRestrictDestroy ( void *sys_restrict_vdata ); } #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_sstruct_ls_mup_undef.h" +#include "_hypre_sstruct_ls_mup.h" +#endif #endif + +#endif + diff --git a/src/sstruct_ls/_hypre_sstruct_ls_mup.h b/src/sstruct_ls/_hypre_sstruct_ls_mup.h new file mode 100644 index 0000000000..8aa34caba3 --- /dev/null +++ b/src/sstruct_ls/_hypre_sstruct_ls_mup.h @@ -0,0 +1,900 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#ifndef hypre_SSTRUCT_LS_MUP_HEADER +#define hypre_SSTRUCT_LS_MUP_HEADER + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (HYPRE_MIXED_PRECISION) + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +hypre_NodeRelax_flt( void *relax_vdata, hypre_SStructPMatrix *A, hypre_SStructPVector *b, hypre_SStructPVector *x ); +HYPRE_Int +hypre_NodeRelax_dbl( void *relax_vdata, hypre_SStructPMatrix *A, hypre_SStructPVector *b, hypre_SStructPVector *x ); +HYPRE_Int +hypre_NodeRelax_long_dbl( void *relax_vdata, hypre_SStructPMatrix *A, hypre_SStructPVector *b, hypre_SStructPVector *x ); + +void * +hypre_NodeRelaxCreate_flt( MPI_Comm comm ); +void * +hypre_NodeRelaxCreate_dbl( MPI_Comm comm ); +void * +hypre_NodeRelaxCreate_long_dbl( MPI_Comm comm ); + +HYPRE_Int +hypre_NodeRelaxDestroy_flt( void *relax_vdata ); +HYPRE_Int +hypre_NodeRelaxDestroy_dbl( void *relax_vdata ); +HYPRE_Int +hypre_NodeRelaxDestroy_long_dbl( void *relax_vdata ); + +HYPRE_Int +hypre_NodeRelaxSetMaxIter_flt( void *relax_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_NodeRelaxSetMaxIter_dbl( void *relax_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_NodeRelaxSetMaxIter_long_dbl( void *relax_vdata, HYPRE_Int max_iter ); + +HYPRE_Int +hypre_NodeRelaxSetNodeset_flt( void *relax_vdata, HYPRE_Int nodeset, HYPRE_Int nodeset_size, hypre_Index nodeset_stride, hypre_Index *nodeset_indices ); +HYPRE_Int +hypre_NodeRelaxSetNodeset_dbl( void *relax_vdata, HYPRE_Int nodeset, HYPRE_Int nodeset_size, hypre_Index nodeset_stride, hypre_Index *nodeset_indices ); +HYPRE_Int +hypre_NodeRelaxSetNodeset_long_dbl( void *relax_vdata, HYPRE_Int nodeset, HYPRE_Int nodeset_size, hypre_Index nodeset_stride, hypre_Index *nodeset_indices ); + +HYPRE_Int +hypre_NodeRelaxSetNodesetRank_flt( void *relax_vdata, HYPRE_Int nodeset, HYPRE_Int nodeset_rank ); +HYPRE_Int +hypre_NodeRelaxSetNodesetRank_dbl( void *relax_vdata, HYPRE_Int nodeset, HYPRE_Int nodeset_rank ); +HYPRE_Int +hypre_NodeRelaxSetNodesetRank_long_dbl( void *relax_vdata, HYPRE_Int nodeset, HYPRE_Int nodeset_rank ); + +HYPRE_Int +hypre_NodeRelaxSetNumNodesets_flt( void *relax_vdata, HYPRE_Int num_nodesets ); +HYPRE_Int +hypre_NodeRelaxSetNumNodesets_dbl( void *relax_vdata, HYPRE_Int num_nodesets ); +HYPRE_Int +hypre_NodeRelaxSetNumNodesets_long_dbl( void *relax_vdata, HYPRE_Int num_nodesets ); + +HYPRE_Int +hypre_NodeRelaxSetTempVec_flt( void *relax_vdata, hypre_SStructPVector *t ); +HYPRE_Int +hypre_NodeRelaxSetTempVec_dbl( void *relax_vdata, hypre_SStructPVector *t ); +HYPRE_Int +hypre_NodeRelaxSetTempVec_long_dbl( void *relax_vdata, hypre_SStructPVector *t ); + +HYPRE_Int +hypre_NodeRelaxSetTol_flt( void *relax_vdata, hypre_float tol ); +HYPRE_Int +hypre_NodeRelaxSetTol_dbl( void *relax_vdata, hypre_double tol ); +HYPRE_Int +hypre_NodeRelaxSetTol_long_dbl( void *relax_vdata, hypre_long_double tol ); + +HYPRE_Int +hypre_NodeRelaxSetWeight_flt( void *relax_vdata, hypre_float weight ); +HYPRE_Int +hypre_NodeRelaxSetWeight_dbl( void *relax_vdata, hypre_double weight ); +HYPRE_Int +hypre_NodeRelaxSetWeight_long_dbl( void *relax_vdata, hypre_long_double weight ); + +HYPRE_Int +hypre_NodeRelaxSetZeroGuess_flt( void *relax_vdata, HYPRE_Int zero_guess ); +HYPRE_Int +hypre_NodeRelaxSetZeroGuess_dbl( void *relax_vdata, HYPRE_Int zero_guess ); +HYPRE_Int +hypre_NodeRelaxSetZeroGuess_long_dbl( void *relax_vdata, HYPRE_Int zero_guess ); + +HYPRE_Int +hypre_NodeRelaxSetup_flt( void *relax_vdata, hypre_SStructPMatrix *A, hypre_SStructPVector *b, hypre_SStructPVector *x ); +HYPRE_Int +hypre_NodeRelaxSetup_dbl( void *relax_vdata, hypre_SStructPMatrix *A, hypre_SStructPVector *b, hypre_SStructPVector *x ); +HYPRE_Int +hypre_NodeRelaxSetup_long_dbl( void *relax_vdata, hypre_SStructPMatrix *A, hypre_SStructPVector *b, hypre_SStructPVector *x ); + +HYPRE_Int +hypre_SSAMGCoarseSolve_flt( void *ssamg_vdata ); +HYPRE_Int +hypre_SSAMGCoarseSolve_dbl( void *ssamg_vdata ); +HYPRE_Int +hypre_SSAMGCoarseSolve_long_dbl( void *ssamg_vdata ); + +HYPRE_Int +hypre_SSAMGCoarseSolverDestroy_flt( void *ssamg_vdata ); +HYPRE_Int +hypre_SSAMGCoarseSolverDestroy_dbl( void *ssamg_vdata ); +HYPRE_Int +hypre_SSAMGCoarseSolverDestroy_long_dbl( void *ssamg_vdata ); + +HYPRE_Int +hypre_SSAMGCoarseSolverSetup_flt( void *ssamg_vdata ); +HYPRE_Int +hypre_SSAMGCoarseSolverSetup_dbl( void *ssamg_vdata ); +HYPRE_Int +hypre_SSAMGCoarseSolverSetup_long_dbl( void *ssamg_vdata ); + +HYPRE_Int +hypre_SSAMGCoarsen_flt( void *ssamg_vdata, hypre_SStructGrid *grid, HYPRE_Int *dxyz_flag, hypre_float **dxyz ); +HYPRE_Int +hypre_SSAMGCoarsen_dbl( void *ssamg_vdata, hypre_SStructGrid *grid, HYPRE_Int *dxyz_flag, hypre_double **dxyz ); +HYPRE_Int +hypre_SSAMGCoarsen_long_dbl( void *ssamg_vdata, hypre_SStructGrid *grid, HYPRE_Int *dxyz_flag, hypre_long_double **dxyz ); + +HYPRE_Int +hypre_SSAMGComputeDxyz_flt( hypre_SStructMatrix *A, hypre_float **dxyz, HYPRE_Int *dxyz_flag ); +HYPRE_Int +hypre_SSAMGComputeDxyz_dbl( hypre_SStructMatrix *A, hypre_double **dxyz, HYPRE_Int *dxyz_flag ); +HYPRE_Int +hypre_SSAMGComputeDxyz_long_dbl( hypre_SStructMatrix *A, hypre_long_double **dxyz, HYPRE_Int *dxyz_flag ); + +HYPRE_Int +hypre_SSAMGComputeMaxLevels_flt( hypre_SStructGrid *grid, HYPRE_Int *max_levels ); +HYPRE_Int +hypre_SSAMGComputeMaxLevels_dbl( hypre_SStructGrid *grid, HYPRE_Int *max_levels ); +HYPRE_Int +hypre_SSAMGComputeMaxLevels_long_dbl( hypre_SStructGrid *grid, HYPRE_Int *max_levels ); + +HYPRE_Int +hypre_SSAMGComputeRAP_flt( hypre_SStructMatrix *A, hypre_SStructMatrix *P, hypre_SStructGrid **cgrid, HYPRE_Int *cdir_p, HYPRE_Int non_galerkin, hypre_SStructMatrix **Ac_ptr ); +HYPRE_Int +hypre_SSAMGComputeRAP_dbl( hypre_SStructMatrix *A, hypre_SStructMatrix *P, hypre_SStructGrid **cgrid, HYPRE_Int *cdir_p, HYPRE_Int non_galerkin, hypre_SStructMatrix **Ac_ptr ); +HYPRE_Int +hypre_SSAMGComputeRAP_long_dbl( hypre_SStructMatrix *A, hypre_SStructMatrix *P, hypre_SStructGrid **cgrid, HYPRE_Int *cdir_p, HYPRE_Int non_galerkin, hypre_SStructMatrix **Ac_ptr ); + +HYPRE_Int +hypre_SSAMGComputeRAPNonGlk_flt( hypre_SStructMatrix *A, hypre_SStructMatrix *P, HYPRE_Int *cdir_p, hypre_SStructMatrix **Ac_ptr ); +HYPRE_Int +hypre_SSAMGComputeRAPNonGlk_dbl( hypre_SStructMatrix *A, hypre_SStructMatrix *P, HYPRE_Int *cdir_p, hypre_SStructMatrix **Ac_ptr ); +HYPRE_Int +hypre_SSAMGComputeRAPNonGlk_long_dbl( hypre_SStructMatrix *A, hypre_SStructMatrix *P, HYPRE_Int *cdir_p, hypre_SStructMatrix **Ac_ptr ); + +void * +hypre_SSAMGCreate_flt( hypre_MPI_Comm comm ); +void * +hypre_SSAMGCreate_dbl( hypre_MPI_Comm comm ); +void * +hypre_SSAMGCreate_long_dbl( hypre_MPI_Comm comm ); + +hypre_SStructMatrix* +hypre_SSAMGCreateInterpOp_flt( hypre_SStructMatrix *A, hypre_SStructGrid *cgrid, HYPRE_Int *cdir_p ); +hypre_SStructMatrix* +hypre_SSAMGCreateInterpOp_dbl( hypre_SStructMatrix *A, hypre_SStructGrid *cgrid, HYPRE_Int *cdir_p ); +hypre_SStructMatrix* +hypre_SSAMGCreateInterpOp_long_dbl( hypre_SStructMatrix *A, hypre_SStructGrid *cgrid, HYPRE_Int *cdir_p ); + +HYPRE_Int +hypre_SSAMGDestroy_flt( void *ssamg_vdata ); +HYPRE_Int +hypre_SSAMGDestroy_dbl( void *ssamg_vdata ); +HYPRE_Int +hypre_SSAMGDestroy_long_dbl( void *ssamg_vdata ); + +HYPRE_Int +hypre_SSAMGGetFinalRelativeResidualNorm_flt( void *ssamg_vdata, hypre_float *relative_residual_norm ); +HYPRE_Int +hypre_SSAMGGetFinalRelativeResidualNorm_dbl( void *ssamg_vdata, hypre_double *relative_residual_norm ); +HYPRE_Int +hypre_SSAMGGetFinalRelativeResidualNorm_long_dbl( void *ssamg_vdata, hypre_long_double *relative_residual_norm ); + +HYPRE_Int +hypre_SSAMGGetNumIterations_flt( void *ssamg_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_SSAMGGetNumIterations_dbl( void *ssamg_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_SSAMGGetNumIterations_long_dbl( void *ssamg_vdata, HYPRE_Int *num_iterations ); + +HYPRE_Int +hypre_SSAMGPrintLogging_flt( void *ssamg_vdata ); +HYPRE_Int +hypre_SSAMGPrintLogging_dbl( void *ssamg_vdata ); +HYPRE_Int +hypre_SSAMGPrintLogging_long_dbl( void *ssamg_vdata ); + +HYPRE_Int +hypre_SSAMGPrintStats_flt( void *ssamg_vdata ); +HYPRE_Int +hypre_SSAMGPrintStats_dbl( void *ssamg_vdata ); +HYPRE_Int +hypre_SSAMGPrintStats_long_dbl( void *ssamg_vdata ); + +HYPRE_Int +hypre_SSAMGRelax_flt( void *relax_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, hypre_SStructVector *x ); +HYPRE_Int +hypre_SSAMGRelax_dbl( void *relax_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, hypre_SStructVector *x ); +HYPRE_Int +hypre_SSAMGRelax_long_dbl( void *relax_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, hypre_SStructVector *x ); + +HYPRE_Int +hypre_SSAMGRelaxCreate_flt( MPI_Comm comm, HYPRE_Int nparts, void **relax_vdata_ptr ); +HYPRE_Int +hypre_SSAMGRelaxCreate_dbl( MPI_Comm comm, HYPRE_Int nparts, void **relax_vdata_ptr ); +HYPRE_Int +hypre_SSAMGRelaxCreate_long_dbl( MPI_Comm comm, HYPRE_Int nparts, void **relax_vdata_ptr ); + +HYPRE_Int +hypre_SSAMGRelaxDestroy_flt( void *relax_vdata ); +HYPRE_Int +hypre_SSAMGRelaxDestroy_dbl( void *relax_vdata ); +HYPRE_Int +hypre_SSAMGRelaxDestroy_long_dbl( void *relax_vdata ); + +HYPRE_Int +hypre_SSAMGRelaxGeneric_flt( void *relax_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, hypre_SStructVector *x ); +HYPRE_Int +hypre_SSAMGRelaxGeneric_dbl( void *relax_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, hypre_SStructVector *x ); +HYPRE_Int +hypre_SSAMGRelaxGeneric_long_dbl( void *relax_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, hypre_SStructVector *x ); + +HYPRE_Int +hypre_SSAMGRelaxJacobi_flt( void *relax_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, hypre_SStructVector *x ); +HYPRE_Int +hypre_SSAMGRelaxJacobi_dbl( void *relax_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, hypre_SStructVector *x ); +HYPRE_Int +hypre_SSAMGRelaxJacobi_long_dbl( void *relax_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, hypre_SStructVector *x ); + +HYPRE_Int +hypre_SSAMGRelaxSetActiveParts_flt( void *relax_vdata, HYPRE_Int *active_p ); +HYPRE_Int +hypre_SSAMGRelaxSetActiveParts_dbl( void *relax_vdata, HYPRE_Int *active_p ); +HYPRE_Int +hypre_SSAMGRelaxSetActiveParts_long_dbl( void *relax_vdata, HYPRE_Int *active_p ); + +HYPRE_Int +hypre_SSAMGRelaxSetMatvecData_flt( void *relax_vdata, void *matvec_vdata ); +HYPRE_Int +hypre_SSAMGRelaxSetMatvecData_dbl( void *relax_vdata, void *matvec_vdata ); +HYPRE_Int +hypre_SSAMGRelaxSetMatvecData_long_dbl( void *relax_vdata, void *matvec_vdata ); + +HYPRE_Int +hypre_SSAMGRelaxSetMaxIter_flt( void *relax_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_SSAMGRelaxSetMaxIter_dbl( void *relax_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_SSAMGRelaxSetMaxIter_long_dbl( void *relax_vdata, HYPRE_Int max_iter ); + +HYPRE_Int +hypre_SSAMGRelaxSetNodeset_flt( void *relax_vdata, HYPRE_Int nodeset, HYPRE_Int nodeset_size, hypre_Index nodeset_stride, hypre_Index *nodeset_indices ); +HYPRE_Int +hypre_SSAMGRelaxSetNodeset_dbl( void *relax_vdata, HYPRE_Int nodeset, HYPRE_Int nodeset_size, hypre_Index nodeset_stride, hypre_Index *nodeset_indices ); +HYPRE_Int +hypre_SSAMGRelaxSetNodeset_long_dbl( void *relax_vdata, HYPRE_Int nodeset, HYPRE_Int nodeset_size, hypre_Index nodeset_stride, hypre_Index *nodeset_indices ); + +HYPRE_Int +hypre_SSAMGRelaxSetNodesetRank_flt( void *relax_vdata, HYPRE_Int nodeset, HYPRE_Int nodeset_rank ); +HYPRE_Int +hypre_SSAMGRelaxSetNodesetRank_dbl( void *relax_vdata, HYPRE_Int nodeset, HYPRE_Int nodeset_rank ); +HYPRE_Int +hypre_SSAMGRelaxSetNodesetRank_long_dbl( void *relax_vdata, HYPRE_Int nodeset, HYPRE_Int nodeset_rank ); + +HYPRE_Int +hypre_SSAMGRelaxSetNumNodesets_flt( void *relax_vdata, HYPRE_Int num_nodesets ); +HYPRE_Int +hypre_SSAMGRelaxSetNumNodesets_dbl( void *relax_vdata, HYPRE_Int num_nodesets ); +HYPRE_Int +hypre_SSAMGRelaxSetNumNodesets_long_dbl( void *relax_vdata, HYPRE_Int num_nodesets ); + +HYPRE_Int +hypre_SSAMGRelaxSetPostRelax_flt( void *relax_vdata ); +HYPRE_Int +hypre_SSAMGRelaxSetPostRelax_dbl( void *relax_vdata ); +HYPRE_Int +hypre_SSAMGRelaxSetPostRelax_long_dbl( void *relax_vdata ); + +HYPRE_Int +hypre_SSAMGRelaxSetPreRelax_flt( void *relax_vdata ); +HYPRE_Int +hypre_SSAMGRelaxSetPreRelax_dbl( void *relax_vdata ); +HYPRE_Int +hypre_SSAMGRelaxSetPreRelax_long_dbl( void *relax_vdata ); + +HYPRE_Int +hypre_SSAMGRelaxSetTempVec_flt( void *relax_vdata, hypre_SStructVector *t ); +HYPRE_Int +hypre_SSAMGRelaxSetTempVec_dbl( void *relax_vdata, hypre_SStructVector *t ); +HYPRE_Int +hypre_SSAMGRelaxSetTempVec_long_dbl( void *relax_vdata, hypre_SStructVector *t ); + +HYPRE_Int +hypre_SSAMGRelaxSetTol_flt( void *relax_vdata, hypre_float tol ); +HYPRE_Int +hypre_SSAMGRelaxSetTol_dbl( void *relax_vdata, hypre_double tol ); +HYPRE_Int +hypre_SSAMGRelaxSetTol_long_dbl( void *relax_vdata, hypre_long_double tol ); + +HYPRE_Int +hypre_SSAMGRelaxSetType_flt( void *relax_vdata, HYPRE_Int relax_type ); +HYPRE_Int +hypre_SSAMGRelaxSetType_dbl( void *relax_vdata, HYPRE_Int relax_type ); +HYPRE_Int +hypre_SSAMGRelaxSetType_long_dbl( void *relax_vdata, HYPRE_Int relax_type ); + +HYPRE_Int +hypre_SSAMGRelaxSetWeights_flt( void *relax_vdata, hypre_float *weights ); +HYPRE_Int +hypre_SSAMGRelaxSetWeights_dbl( void *relax_vdata, hypre_double *weights ); +HYPRE_Int +hypre_SSAMGRelaxSetWeights_long_dbl( void *relax_vdata, hypre_long_double *weights ); + +HYPRE_Int +hypre_SSAMGRelaxSetZeroGuess_flt( void *relax_vdata, HYPRE_Int zero_guess ); +HYPRE_Int +hypre_SSAMGRelaxSetZeroGuess_dbl( void *relax_vdata, HYPRE_Int zero_guess ); +HYPRE_Int +hypre_SSAMGRelaxSetZeroGuess_long_dbl( void *relax_vdata, HYPRE_Int zero_guess ); + +HYPRE_Int +hypre_SSAMGRelaxSetup_flt( void *relax_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, hypre_SStructVector *x ); +HYPRE_Int +hypre_SSAMGRelaxSetup_dbl( void *relax_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, hypre_SStructVector *x ); +HYPRE_Int +hypre_SSAMGRelaxSetup_long_dbl( void *relax_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, hypre_SStructVector *x ); + +HYPRE_Int +hypre_SSAMGSetCoarseSolverType_flt( void *ssamg_vdata, HYPRE_Int csolver_type ); +HYPRE_Int +hypre_SSAMGSetCoarseSolverType_dbl( void *ssamg_vdata, HYPRE_Int csolver_type ); +HYPRE_Int +hypre_SSAMGSetCoarseSolverType_long_dbl( void *ssamg_vdata, HYPRE_Int csolver_type ); + +HYPRE_Int +hypre_SSAMGSetDxyz_flt( void *ssamg_vdata, HYPRE_Int nparts, hypre_float **dxyz ); +HYPRE_Int +hypre_SSAMGSetDxyz_dbl( void *ssamg_vdata, HYPRE_Int nparts, hypre_double **dxyz ); +HYPRE_Int +hypre_SSAMGSetDxyz_long_dbl( void *ssamg_vdata, HYPRE_Int nparts, hypre_long_double **dxyz ); + +HYPRE_Int +hypre_SSAMGSetInterpType_flt( void *ssamg_vdata, HYPRE_Int interp_type ); +HYPRE_Int +hypre_SSAMGSetInterpType_dbl( void *ssamg_vdata, HYPRE_Int interp_type ); +HYPRE_Int +hypre_SSAMGSetInterpType_long_dbl( void *ssamg_vdata, HYPRE_Int interp_type ); + +HYPRE_Int +hypre_SSAMGSetLogging_flt( void *ssamg_vdata, HYPRE_Int logging ); +HYPRE_Int +hypre_SSAMGSetLogging_dbl( void *ssamg_vdata, HYPRE_Int logging ); +HYPRE_Int +hypre_SSAMGSetLogging_long_dbl( void *ssamg_vdata, HYPRE_Int logging ); + +HYPRE_Int +hypre_SSAMGSetMaxCoarseSize_flt( void *ssamg_vdata, HYPRE_Int max_coarse_size ); +HYPRE_Int +hypre_SSAMGSetMaxCoarseSize_dbl( void *ssamg_vdata, HYPRE_Int max_coarse_size ); +HYPRE_Int +hypre_SSAMGSetMaxCoarseSize_long_dbl( void *ssamg_vdata, HYPRE_Int max_coarse_size ); + +HYPRE_Int +hypre_SSAMGSetMaxIter_flt( void *ssamg_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_SSAMGSetMaxIter_dbl( void *ssamg_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_SSAMGSetMaxIter_long_dbl( void *ssamg_vdata, HYPRE_Int max_iter ); + +HYPRE_Int +hypre_SSAMGSetMaxLevels_flt( void *ssamg_vdata, HYPRE_Int max_levels ); +HYPRE_Int +hypre_SSAMGSetMaxLevels_dbl( void *ssamg_vdata, HYPRE_Int max_levels ); +HYPRE_Int +hypre_SSAMGSetMaxLevels_long_dbl( void *ssamg_vdata, HYPRE_Int max_levels ); + +HYPRE_Int +hypre_SSAMGSetNonGalerkinRAP_flt( void *ssamg_vdata, HYPRE_Int non_galerkin ); +HYPRE_Int +hypre_SSAMGSetNonGalerkinRAP_dbl( void *ssamg_vdata, HYPRE_Int non_galerkin ); +HYPRE_Int +hypre_SSAMGSetNonGalerkinRAP_long_dbl( void *ssamg_vdata, HYPRE_Int non_galerkin ); + +HYPRE_Int +hypre_SSAMGSetNumCoarseRelax_flt( void *ssamg_vdata, HYPRE_Int num_coarse_relax ); +HYPRE_Int +hypre_SSAMGSetNumCoarseRelax_dbl( void *ssamg_vdata, HYPRE_Int num_coarse_relax ); +HYPRE_Int +hypre_SSAMGSetNumCoarseRelax_long_dbl( void *ssamg_vdata, HYPRE_Int num_coarse_relax ); + +HYPRE_Int +hypre_SSAMGSetNumPosRelax_flt( void *ssamg_vdata, HYPRE_Int num_pos_relax ); +HYPRE_Int +hypre_SSAMGSetNumPosRelax_dbl( void *ssamg_vdata, HYPRE_Int num_pos_relax ); +HYPRE_Int +hypre_SSAMGSetNumPosRelax_long_dbl( void *ssamg_vdata, HYPRE_Int num_pos_relax ); + +HYPRE_Int +hypre_SSAMGSetNumPreRelax_flt( void *ssamg_vdata, HYPRE_Int num_pre_relax ); +HYPRE_Int +hypre_SSAMGSetNumPreRelax_dbl( void *ssamg_vdata, HYPRE_Int num_pre_relax ); +HYPRE_Int +hypre_SSAMGSetNumPreRelax_long_dbl( void *ssamg_vdata, HYPRE_Int num_pre_relax ); + +HYPRE_Int +hypre_SSAMGSetPrintFreq_flt( void *ssamg_vdata, HYPRE_Int print_freq ); +HYPRE_Int +hypre_SSAMGSetPrintFreq_dbl( void *ssamg_vdata, HYPRE_Int print_freq ); +HYPRE_Int +hypre_SSAMGSetPrintFreq_long_dbl( void *ssamg_vdata, HYPRE_Int print_freq ); + +HYPRE_Int +hypre_SSAMGSetPrintLevel_flt( void *ssamg_vdata, HYPRE_Int print_level ); +HYPRE_Int +hypre_SSAMGSetPrintLevel_dbl( void *ssamg_vdata, HYPRE_Int print_level ); +HYPRE_Int +hypre_SSAMGSetPrintLevel_long_dbl( void *ssamg_vdata, HYPRE_Int print_level ); + +HYPRE_Int +hypre_SSAMGSetRelChange_flt( void *ssamg_vdata, HYPRE_Int rel_change ); +HYPRE_Int +hypre_SSAMGSetRelChange_dbl( void *ssamg_vdata, HYPRE_Int rel_change ); +HYPRE_Int +hypre_SSAMGSetRelChange_long_dbl( void *ssamg_vdata, HYPRE_Int rel_change ); + +HYPRE_Int +hypre_SSAMGSetRelaxType_flt( void *ssamg_vdata, HYPRE_Int relax_type ); +HYPRE_Int +hypre_SSAMGSetRelaxType_dbl( void *ssamg_vdata, HYPRE_Int relax_type ); +HYPRE_Int +hypre_SSAMGSetRelaxType_long_dbl( void *ssamg_vdata, HYPRE_Int relax_type ); + +HYPRE_Int +hypre_SSAMGSetRelaxWeight_flt( void *ssamg_vdata, hypre_float relax_weight ); +HYPRE_Int +hypre_SSAMGSetRelaxWeight_dbl( void *ssamg_vdata, hypre_double relax_weight ); +HYPRE_Int +hypre_SSAMGSetRelaxWeight_long_dbl( void *ssamg_vdata, hypre_long_double relax_weight ); + +HYPRE_Int +hypre_SSAMGSetSkipRelax_flt( void *ssamg_vdata, HYPRE_Int skip_relax ); +HYPRE_Int +hypre_SSAMGSetSkipRelax_dbl( void *ssamg_vdata, HYPRE_Int skip_relax ); +HYPRE_Int +hypre_SSAMGSetSkipRelax_long_dbl( void *ssamg_vdata, HYPRE_Int skip_relax ); + +HYPRE_Int +hypre_SSAMGSetTol_flt( void *ssamg_vdata, hypre_float tol ); +HYPRE_Int +hypre_SSAMGSetTol_dbl( void *ssamg_vdata, hypre_double tol ); +HYPRE_Int +hypre_SSAMGSetTol_long_dbl( void *ssamg_vdata, hypre_long_double tol ); + +HYPRE_Int +hypre_SSAMGSetZeroGuess_flt( void *ssamg_vdata, HYPRE_Int zero_guess ); +HYPRE_Int +hypre_SSAMGSetZeroGuess_dbl( void *ssamg_vdata, HYPRE_Int zero_guess ); +HYPRE_Int +hypre_SSAMGSetZeroGuess_long_dbl( void *ssamg_vdata, HYPRE_Int zero_guess ); + +HYPRE_Int +hypre_SSAMGSetup_flt( void *ssamg_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, hypre_SStructVector *x ); +HYPRE_Int +hypre_SSAMGSetup_dbl( void *ssamg_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, hypre_SStructVector *x ); +HYPRE_Int +hypre_SSAMGSetup_long_dbl( void *ssamg_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, hypre_SStructVector *x ); + +HYPRE_Int +hypre_SSAMGSetupInterpOp_flt( hypre_SStructMatrix *A, HYPRE_Int *cdir_p, hypre_SStructMatrix *P, HYPRE_Int interp_type ); +HYPRE_Int +hypre_SSAMGSetupInterpOp_dbl( hypre_SStructMatrix *A, HYPRE_Int *cdir_p, hypre_SStructMatrix *P, HYPRE_Int interp_type ); +HYPRE_Int +hypre_SSAMGSetupInterpOp_long_dbl( hypre_SStructMatrix *A, HYPRE_Int *cdir_p, hypre_SStructMatrix *P, HYPRE_Int interp_type ); + +HYPRE_Int +hypre_SSAMGSetupUInterpOp_flt( hypre_SStructMatrix *A, HYPRE_Int *cdir_p, hypre_SStructMatrix *P, HYPRE_Int interp_type ); +HYPRE_Int +hypre_SSAMGSetupUInterpOp_dbl( hypre_SStructMatrix *A, HYPRE_Int *cdir_p, hypre_SStructMatrix *P, HYPRE_Int interp_type ); +HYPRE_Int +hypre_SSAMGSetupUInterpOp_long_dbl( hypre_SStructMatrix *A, HYPRE_Int *cdir_p, hypre_SStructMatrix *P, HYPRE_Int interp_type ); + +HYPRE_Int +hypre_SSAMGSolve_flt( void *ssamg_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, hypre_SStructVector *x ); +HYPRE_Int +hypre_SSAMGSolve_dbl( void *ssamg_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, hypre_SStructVector *x ); +HYPRE_Int +hypre_SSAMGSolve_long_dbl( void *ssamg_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, hypre_SStructVector *x ); + +HYPRE_Int +hypre_SStructKrylovAxpy_flt( hypre_float alpha, void *x, void *y ); +HYPRE_Int +hypre_SStructKrylovAxpy_dbl( hypre_double alpha, void *x, void *y ); +HYPRE_Int +hypre_SStructKrylovAxpy_long_dbl( hypre_long_double alpha, void *x, void *y ); + +void * +hypre_SStructKrylovCAlloc_flt( size_t count, size_t elt_size, HYPRE_MemoryLocation location ); +void * +hypre_SStructKrylovCAlloc_dbl( size_t count, size_t elt_size, HYPRE_MemoryLocation location ); +void * +hypre_SStructKrylovCAlloc_long_dbl( size_t count, size_t elt_size, HYPRE_MemoryLocation location ); + +HYPRE_Int +hypre_SStructKrylovClearVector_flt( void *x ); +HYPRE_Int +hypre_SStructKrylovClearVector_dbl( void *x ); +HYPRE_Int +hypre_SStructKrylovClearVector_long_dbl( void *x ); + +HYPRE_Int +hypre_SStructKrylovCommInfo_flt( void *A, HYPRE_Int *my_id, HYPRE_Int *num_procs ); +HYPRE_Int +hypre_SStructKrylovCommInfo_dbl( void *A, HYPRE_Int *my_id, HYPRE_Int *num_procs ); +HYPRE_Int +hypre_SStructKrylovCommInfo_long_dbl( void *A, HYPRE_Int *my_id, HYPRE_Int *num_procs ); + +HYPRE_Int +hypre_SStructKrylovCopyVector_flt( void *x, void *y ); +HYPRE_Int +hypre_SStructKrylovCopyVector_dbl( void *x, void *y ); +HYPRE_Int +hypre_SStructKrylovCopyVector_long_dbl( void *x, void *y ); + +void * +hypre_SStructKrylovCreateVector_flt( void *vvector ); +void * +hypre_SStructKrylovCreateVector_dbl( void *vvector ); +void * +hypre_SStructKrylovCreateVector_long_dbl( void *vvector ); + +void * +hypre_SStructKrylovCreateVectorArray_flt( HYPRE_Int n, void *vvector ); +void * +hypre_SStructKrylovCreateVectorArray_dbl( HYPRE_Int n, void *vvector ); +void * +hypre_SStructKrylovCreateVectorArray_long_dbl( HYPRE_Int n, void *vvector ); + +HYPRE_Int +hypre_SStructKrylovDestroyVector_flt( void *vvector ); +HYPRE_Int +hypre_SStructKrylovDestroyVector_dbl( void *vvector ); +HYPRE_Int +hypre_SStructKrylovDestroyVector_long_dbl( void *vvector ); + +HYPRE_Int +hypre_SStructKrylovFree_flt( void *ptr ); +HYPRE_Int +hypre_SStructKrylovFree_dbl( void *ptr ); +HYPRE_Int +hypre_SStructKrylovFree_long_dbl( void *ptr ); + +HYPRE_Int +hypre_SStructKrylovIdentity_flt( void *vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_SStructKrylovIdentity_dbl( void *vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_SStructKrylovIdentity_long_dbl( void *vdata, void *A, void *b, void *x ); + +HYPRE_Int +hypre_SStructKrylovIdentitySetup_flt( void *vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_SStructKrylovIdentitySetup_dbl( void *vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_SStructKrylovIdentitySetup_long_dbl( void *vdata, void *A, void *b, void *x ); + +HYPRE_Real +hypre_SStructKrylovInnerProd_flt( void *x, void *y ); +HYPRE_Real +hypre_SStructKrylovInnerProd_dbl( void *x, void *y ); +HYPRE_Real +hypre_SStructKrylovInnerProd_long_dbl( void *x, void *y ); + +HYPRE_Int +hypre_SStructKrylovInnerProdTagged_flt( void *x, void *y, HYPRE_Int *num_tags_ptr, hypre_float **iprod_ptr ); +HYPRE_Int +hypre_SStructKrylovInnerProdTagged_dbl( void *x, void *y, HYPRE_Int *num_tags_ptr, hypre_double **iprod_ptr ); +HYPRE_Int +hypre_SStructKrylovInnerProdTagged_long_dbl( void *x, void *y, HYPRE_Int *num_tags_ptr, hypre_long_double **iprod_ptr ); + +HYPRE_Int +hypre_SStructKrylovMatvec_flt( void *matvec_data, hypre_float alpha, void *A, void *x, hypre_float beta, void *y ); +HYPRE_Int +hypre_SStructKrylovMatvec_dbl( void *matvec_data, hypre_double alpha, void *A, void *x, hypre_double beta, void *y ); +HYPRE_Int +hypre_SStructKrylovMatvec_long_dbl( void *matvec_data, hypre_long_double alpha, void *A, void *x, hypre_long_double beta, void *y ); + +void * +hypre_SStructKrylovMatvecCreate_flt( void *A, void *x ); +void * +hypre_SStructKrylovMatvecCreate_dbl( void *A, void *x ); +void * +hypre_SStructKrylovMatvecCreate_long_dbl( void *A, void *x ); + +HYPRE_Int +hypre_SStructKrylovMatvecDestroy_flt( void *matvec_data ); +HYPRE_Int +hypre_SStructKrylovMatvecDestroy_dbl( void *matvec_data ); +HYPRE_Int +hypre_SStructKrylovMatvecDestroy_long_dbl( void *matvec_data ); + +HYPRE_Int +hypre_SStructKrylovScaleVector_flt( hypre_float alpha, void *x ); +HYPRE_Int +hypre_SStructKrylovScaleVector_dbl( hypre_double alpha, void *x ); +HYPRE_Int +hypre_SStructKrylovScaleVector_long_dbl( hypre_long_double alpha, void *x ); + +HYPRE_Int +hypre_SStructSetRandomValues_flt( void *v, HYPRE_Int seed ); +HYPRE_Int +hypre_SStructSetRandomValues_dbl( void *v, HYPRE_Int seed ); +HYPRE_Int +hypre_SStructSetRandomValues_long_dbl( void *v, HYPRE_Int seed ); + +void * +hypre_SysPFMGCreate_flt( MPI_Comm comm ); +void * +hypre_SysPFMGCreate_dbl( MPI_Comm comm ); +void * +hypre_SysPFMGCreate_long_dbl( MPI_Comm comm ); + +hypre_SStructPMatrix * +hypre_SysPFMGCreateInterpOp_flt( hypre_SStructPMatrix *A, HYPRE_Int cdir, hypre_Index stride ); +hypre_SStructPMatrix * +hypre_SysPFMGCreateInterpOp_dbl( hypre_SStructPMatrix *A, HYPRE_Int cdir, hypre_Index stride ); +hypre_SStructPMatrix * +hypre_SysPFMGCreateInterpOp_long_dbl( hypre_SStructPMatrix *A, HYPRE_Int cdir, hypre_Index stride ); + +HYPRE_Int +hypre_SysPFMGDestroy_flt( void *sys_pfmg_vdata ); +HYPRE_Int +hypre_SysPFMGDestroy_dbl( void *sys_pfmg_vdata ); +HYPRE_Int +hypre_SysPFMGDestroy_long_dbl( void *sys_pfmg_vdata ); + +HYPRE_Int +hypre_SysPFMGGetFinalRelativeResidualNorm_flt( void *sys_pfmg_vdata, hypre_float *relative_residual_norm ); +HYPRE_Int +hypre_SysPFMGGetFinalRelativeResidualNorm_dbl( void *sys_pfmg_vdata, hypre_double *relative_residual_norm ); +HYPRE_Int +hypre_SysPFMGGetFinalRelativeResidualNorm_long_dbl( void *sys_pfmg_vdata, hypre_long_double *relative_residual_norm ); + +HYPRE_Int +hypre_SysPFMGGetNumIterations_flt( void *sys_pfmg_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_SysPFMGGetNumIterations_dbl( void *sys_pfmg_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_SysPFMGGetNumIterations_long_dbl( void *sys_pfmg_vdata, HYPRE_Int *num_iterations ); + +HYPRE_Int +hypre_SysPFMGPrintLogging_flt( void *sys_pfmg_vdata ); +HYPRE_Int +hypre_SysPFMGPrintLogging_dbl( void *sys_pfmg_vdata ); +HYPRE_Int +hypre_SysPFMGPrintLogging_long_dbl( void *sys_pfmg_vdata ); + +HYPRE_Int +hypre_SysPFMGRelax_flt( void *sys_pfmg_relax_vdata, hypre_SStructPMatrix *A, hypre_SStructPVector *b, hypre_SStructPVector *x ); +HYPRE_Int +hypre_SysPFMGRelax_dbl( void *sys_pfmg_relax_vdata, hypre_SStructPMatrix *A, hypre_SStructPVector *b, hypre_SStructPVector *x ); +HYPRE_Int +hypre_SysPFMGRelax_long_dbl( void *sys_pfmg_relax_vdata, hypre_SStructPMatrix *A, hypre_SStructPVector *b, hypre_SStructPVector *x ); + +void * +hypre_SysPFMGRelaxCreate_flt( MPI_Comm comm ); +void * +hypre_SysPFMGRelaxCreate_dbl( MPI_Comm comm ); +void * +hypre_SysPFMGRelaxCreate_long_dbl( MPI_Comm comm ); + +HYPRE_Int +hypre_SysPFMGRelaxDestroy_flt( void *sys_pfmg_relax_vdata ); +HYPRE_Int +hypre_SysPFMGRelaxDestroy_dbl( void *sys_pfmg_relax_vdata ); +HYPRE_Int +hypre_SysPFMGRelaxDestroy_long_dbl( void *sys_pfmg_relax_vdata ); + +HYPRE_Int +hypre_SysPFMGRelaxSetJacobiWeight_flt( void *sys_pfmg_relax_vdata, hypre_float weight ); +HYPRE_Int +hypre_SysPFMGRelaxSetJacobiWeight_dbl( void *sys_pfmg_relax_vdata, hypre_double weight ); +HYPRE_Int +hypre_SysPFMGRelaxSetJacobiWeight_long_dbl( void *sys_pfmg_relax_vdata, hypre_long_double weight ); + +HYPRE_Int +hypre_SysPFMGRelaxSetMaxIter_flt( void *sys_pfmg_relax_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_SysPFMGRelaxSetMaxIter_dbl( void *sys_pfmg_relax_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_SysPFMGRelaxSetMaxIter_long_dbl( void *sys_pfmg_relax_vdata, HYPRE_Int max_iter ); + +HYPRE_Int +hypre_SysPFMGRelaxSetPostRelax_flt( void *sys_pfmg_relax_vdata ); +HYPRE_Int +hypre_SysPFMGRelaxSetPostRelax_dbl( void *sys_pfmg_relax_vdata ); +HYPRE_Int +hypre_SysPFMGRelaxSetPostRelax_long_dbl( void *sys_pfmg_relax_vdata ); + +HYPRE_Int +hypre_SysPFMGRelaxSetPreRelax_flt( void *sys_pfmg_relax_vdata ); +HYPRE_Int +hypre_SysPFMGRelaxSetPreRelax_dbl( void *sys_pfmg_relax_vdata ); +HYPRE_Int +hypre_SysPFMGRelaxSetPreRelax_long_dbl( void *sys_pfmg_relax_vdata ); + +HYPRE_Int +hypre_SysPFMGRelaxSetTempVec_flt( void *sys_pfmg_relax_vdata, hypre_SStructPVector *t ); +HYPRE_Int +hypre_SysPFMGRelaxSetTempVec_dbl( void *sys_pfmg_relax_vdata, hypre_SStructPVector *t ); +HYPRE_Int +hypre_SysPFMGRelaxSetTempVec_long_dbl( void *sys_pfmg_relax_vdata, hypre_SStructPVector *t ); + +HYPRE_Int +hypre_SysPFMGRelaxSetTol_flt( void *sys_pfmg_relax_vdata, hypre_float tol ); +HYPRE_Int +hypre_SysPFMGRelaxSetTol_dbl( void *sys_pfmg_relax_vdata, hypre_double tol ); +HYPRE_Int +hypre_SysPFMGRelaxSetTol_long_dbl( void *sys_pfmg_relax_vdata, hypre_long_double tol ); + +HYPRE_Int +hypre_SysPFMGRelaxSetType_flt( void *sys_pfmg_relax_vdata, HYPRE_Int relax_type ); +HYPRE_Int +hypre_SysPFMGRelaxSetType_dbl( void *sys_pfmg_relax_vdata, HYPRE_Int relax_type ); +HYPRE_Int +hypre_SysPFMGRelaxSetType_long_dbl( void *sys_pfmg_relax_vdata, HYPRE_Int relax_type ); + +HYPRE_Int +hypre_SysPFMGRelaxSetZeroGuess_flt( void *sys_pfmg_relax_vdata, HYPRE_Int zero_guess ); +HYPRE_Int +hypre_SysPFMGRelaxSetZeroGuess_dbl( void *sys_pfmg_relax_vdata, HYPRE_Int zero_guess ); +HYPRE_Int +hypre_SysPFMGRelaxSetZeroGuess_long_dbl( void *sys_pfmg_relax_vdata, HYPRE_Int zero_guess ); + +HYPRE_Int +hypre_SysPFMGRelaxSetup_flt( void *sys_pfmg_relax_vdata, hypre_SStructPMatrix *A, hypre_SStructPVector *b, hypre_SStructPVector *x ); +HYPRE_Int +hypre_SysPFMGRelaxSetup_dbl( void *sys_pfmg_relax_vdata, hypre_SStructPMatrix *A, hypre_SStructPVector *b, hypre_SStructPVector *x ); +HYPRE_Int +hypre_SysPFMGRelaxSetup_long_dbl( void *sys_pfmg_relax_vdata, hypre_SStructPMatrix *A, hypre_SStructPVector *b, hypre_SStructPVector *x ); + +HYPRE_Int +hypre_SysPFMGSetDxyz_flt( void *sys_pfmg_vdata, hypre_float *dxyz ); +HYPRE_Int +hypre_SysPFMGSetDxyz_dbl( void *sys_pfmg_vdata, hypre_double *dxyz ); +HYPRE_Int +hypre_SysPFMGSetDxyz_long_dbl( void *sys_pfmg_vdata, hypre_long_double *dxyz ); + +HYPRE_Int +hypre_SysPFMGSetJacobiWeight_flt( void *sys_pfmg_vdata, hypre_float weight ); +HYPRE_Int +hypre_SysPFMGSetJacobiWeight_dbl( void *sys_pfmg_vdata, hypre_double weight ); +HYPRE_Int +hypre_SysPFMGSetJacobiWeight_long_dbl( void *sys_pfmg_vdata, hypre_long_double weight ); + +HYPRE_Int +hypre_SysPFMGSetLogging_flt( void *sys_pfmg_vdata, HYPRE_Int logging ); +HYPRE_Int +hypre_SysPFMGSetLogging_dbl( void *sys_pfmg_vdata, HYPRE_Int logging ); +HYPRE_Int +hypre_SysPFMGSetLogging_long_dbl( void *sys_pfmg_vdata, HYPRE_Int logging ); + +HYPRE_Int +hypre_SysPFMGSetMaxIter_flt( void *sys_pfmg_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_SysPFMGSetMaxIter_dbl( void *sys_pfmg_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_SysPFMGSetMaxIter_long_dbl( void *sys_pfmg_vdata, HYPRE_Int max_iter ); + +HYPRE_Int +hypre_SysPFMGSetNumPostRelax_flt( void *sys_pfmg_vdata, HYPRE_Int num_post_relax ); +HYPRE_Int +hypre_SysPFMGSetNumPostRelax_dbl( void *sys_pfmg_vdata, HYPRE_Int num_post_relax ); +HYPRE_Int +hypre_SysPFMGSetNumPostRelax_long_dbl( void *sys_pfmg_vdata, HYPRE_Int num_post_relax ); + +HYPRE_Int +hypre_SysPFMGSetNumPreRelax_flt( void *sys_pfmg_vdata, HYPRE_Int num_pre_relax ); +HYPRE_Int +hypre_SysPFMGSetNumPreRelax_dbl( void *sys_pfmg_vdata, HYPRE_Int num_pre_relax ); +HYPRE_Int +hypre_SysPFMGSetNumPreRelax_long_dbl( void *sys_pfmg_vdata, HYPRE_Int num_pre_relax ); + +HYPRE_Int +hypre_SysPFMGSetPrintLevel_flt( void *sys_pfmg_vdata, HYPRE_Int print_level ); +HYPRE_Int +hypre_SysPFMGSetPrintLevel_dbl( void *sys_pfmg_vdata, HYPRE_Int print_level ); +HYPRE_Int +hypre_SysPFMGSetPrintLevel_long_dbl( void *sys_pfmg_vdata, HYPRE_Int print_level ); + +HYPRE_Int +hypre_SysPFMGSetRelChange_flt( void *sys_pfmg_vdata, HYPRE_Int rel_change ); +HYPRE_Int +hypre_SysPFMGSetRelChange_dbl( void *sys_pfmg_vdata, HYPRE_Int rel_change ); +HYPRE_Int +hypre_SysPFMGSetRelChange_long_dbl( void *sys_pfmg_vdata, HYPRE_Int rel_change ); + +HYPRE_Int +hypre_SysPFMGSetRelaxType_flt( void *sys_pfmg_vdata, HYPRE_Int relax_type ); +HYPRE_Int +hypre_SysPFMGSetRelaxType_dbl( void *sys_pfmg_vdata, HYPRE_Int relax_type ); +HYPRE_Int +hypre_SysPFMGSetRelaxType_long_dbl( void *sys_pfmg_vdata, HYPRE_Int relax_type ); + +HYPRE_Int +hypre_SysPFMGSetSkipRelax_flt( void *sys_pfmg_vdata, HYPRE_Int skip_relax ); +HYPRE_Int +hypre_SysPFMGSetSkipRelax_dbl( void *sys_pfmg_vdata, HYPRE_Int skip_relax ); +HYPRE_Int +hypre_SysPFMGSetSkipRelax_long_dbl( void *sys_pfmg_vdata, HYPRE_Int skip_relax ); + +HYPRE_Int +hypre_SysPFMGSetTol_flt( void *sys_pfmg_vdata, hypre_float tol ); +HYPRE_Int +hypre_SysPFMGSetTol_dbl( void *sys_pfmg_vdata, hypre_double tol ); +HYPRE_Int +hypre_SysPFMGSetTol_long_dbl( void *sys_pfmg_vdata, hypre_long_double tol ); + +HYPRE_Int +hypre_SysPFMGSetZeroGuess_flt( void *sys_pfmg_vdata, HYPRE_Int zero_guess ); +HYPRE_Int +hypre_SysPFMGSetZeroGuess_dbl( void *sys_pfmg_vdata, HYPRE_Int zero_guess ); +HYPRE_Int +hypre_SysPFMGSetZeroGuess_long_dbl( void *sys_pfmg_vdata, HYPRE_Int zero_guess ); + +HYPRE_Int +hypre_SysPFMGSetup_flt( void *sys_pfmg_vdata, hypre_SStructMatrix *A_in, hypre_SStructVector *b_in, hypre_SStructVector *x_in ); +HYPRE_Int +hypre_SysPFMGSetup_dbl( void *sys_pfmg_vdata, hypre_SStructMatrix *A_in, hypre_SStructVector *b_in, hypre_SStructVector *x_in ); +HYPRE_Int +hypre_SysPFMGSetup_long_dbl( void *sys_pfmg_vdata, hypre_SStructMatrix *A_in, hypre_SStructVector *b_in, hypre_SStructVector *x_in ); + +HYPRE_Int +hypre_SysPFMGSetupInterpOp_flt( hypre_SStructPMatrix *P, hypre_SStructPMatrix *A, HYPRE_Int cdir ); +HYPRE_Int +hypre_SysPFMGSetupInterpOp_dbl( hypre_SStructPMatrix *P, hypre_SStructPMatrix *A, HYPRE_Int cdir ); +HYPRE_Int +hypre_SysPFMGSetupInterpOp_long_dbl( hypre_SStructPMatrix *P, hypre_SStructPMatrix *A, HYPRE_Int cdir ); + +HYPRE_Int +hypre_SysPFMGSolve_flt( void *sys_pfmg_vdata, hypre_SStructMatrix *A_in, hypre_SStructVector *b_in, hypre_SStructVector *x_in ); +HYPRE_Int +hypre_SysPFMGSolve_dbl( void *sys_pfmg_vdata, hypre_SStructMatrix *A_in, hypre_SStructVector *b_in, hypre_SStructVector *x_in ); +HYPRE_Int +hypre_SysPFMGSolve_long_dbl( void *sys_pfmg_vdata, hypre_SStructMatrix *A_in, hypre_SStructVector *b_in, hypre_SStructVector *x_in ); + +HYPRE_Int +hypre_SysPFMGZeroDiagonal_flt( hypre_SStructPMatrix *A ); +HYPRE_Int +hypre_SysPFMGZeroDiagonal_dbl( hypre_SStructPMatrix *A ); +HYPRE_Int +hypre_SysPFMGZeroDiagonal_long_dbl( hypre_SStructPMatrix *A ); + + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + + + +#endif + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/src/sstruct_ls/_hypre_sstruct_ls_mup_def.h b/src/sstruct_ls/_hypre_sstruct_ls_mup_def.h new file mode 100644 index 0000000000..0d8db673e1 --- /dev/null +++ b/src/sstruct_ls/_hypre_sstruct_ls_mup_def.h @@ -0,0 +1,414 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#ifndef hypre_SSTRUCT_LS_MUP_DEF_HEADER +#define hypre_SSTRUCT_LS_MUP_DEF_HEADER + +#include "_hypre_mup_def.h" + +#define HYPRE_SStructBiCGSTABCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructBiCGSTABCreate ) +#define HYPRE_SStructBiCGSTABDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructBiCGSTABDestroy ) +#define HYPRE_SStructBiCGSTABGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructBiCGSTABGetFinalRelativeResidualNorm ) +#define HYPRE_SStructBiCGSTABGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructBiCGSTABGetNumIterations ) +#define HYPRE_SStructBiCGSTABGetResidual HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructBiCGSTABGetResidual ) +#define HYPRE_SStructBiCGSTABSetAbsoluteTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructBiCGSTABSetAbsoluteTol ) +#define HYPRE_SStructBiCGSTABSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructBiCGSTABSetLogging ) +#define HYPRE_SStructBiCGSTABSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructBiCGSTABSetMaxIter ) +#define HYPRE_SStructBiCGSTABSetMinIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructBiCGSTABSetMinIter ) +#define HYPRE_SStructBiCGSTABSetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructBiCGSTABSetPrecond ) +#define HYPRE_SStructBiCGSTABSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructBiCGSTABSetPrintLevel ) +#define HYPRE_SStructBiCGSTABSetStopCrit HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructBiCGSTABSetStopCrit ) +#define HYPRE_SStructBiCGSTABSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructBiCGSTABSetTol ) +#define HYPRE_SStructBiCGSTABSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructBiCGSTABSetup ) +#define HYPRE_SStructBiCGSTABSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructBiCGSTABSolve ) +#define HYPRE_SStructDiagScale HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructDiagScale ) +#define HYPRE_SStructDiagScaleSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructDiagScaleSetup ) +#define HYPRE_SStructFlexGMRESCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructFlexGMRESCreate ) +#define HYPRE_SStructFlexGMRESDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructFlexGMRESDestroy ) +#define HYPRE_SStructFlexGMRESGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructFlexGMRESGetFinalRelativeResidualNorm ) +#define HYPRE_SStructFlexGMRESGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructFlexGMRESGetNumIterations ) +#define HYPRE_SStructFlexGMRESGetResidual HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructFlexGMRESGetResidual ) +#define HYPRE_SStructFlexGMRESSetAbsoluteTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructFlexGMRESSetAbsoluteTol ) +#define HYPRE_SStructFlexGMRESSetKDim HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructFlexGMRESSetKDim ) +#define HYPRE_SStructFlexGMRESSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructFlexGMRESSetLogging ) +#define HYPRE_SStructFlexGMRESSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructFlexGMRESSetMaxIter ) +#define HYPRE_SStructFlexGMRESSetMinIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructFlexGMRESSetMinIter ) +#define HYPRE_SStructFlexGMRESSetModifyPC HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructFlexGMRESSetModifyPC ) +#define HYPRE_SStructFlexGMRESSetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructFlexGMRESSetPrecond ) +#define HYPRE_SStructFlexGMRESSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructFlexGMRESSetPrintLevel ) +#define HYPRE_SStructFlexGMRESSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructFlexGMRESSetTol ) +#define HYPRE_SStructFlexGMRESSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructFlexGMRESSetup ) +#define HYPRE_SStructFlexGMRESSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructFlexGMRESSolve ) +#define HYPRE_SStructGMRESCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGMRESCreate ) +#define HYPRE_SStructGMRESDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGMRESDestroy ) +#define HYPRE_SStructGMRESGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGMRESGetFinalRelativeResidualNorm ) +#define HYPRE_SStructGMRESGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGMRESGetNumIterations ) +#define HYPRE_SStructGMRESGetResidual HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGMRESGetResidual ) +#define HYPRE_SStructGMRESSetAbsoluteTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGMRESSetAbsoluteTol ) +#define HYPRE_SStructGMRESSetKDim HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGMRESSetKDim ) +#define HYPRE_SStructGMRESSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGMRESSetLogging ) +#define HYPRE_SStructGMRESSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGMRESSetMaxIter ) +#define HYPRE_SStructGMRESSetMinIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGMRESSetMinIter ) +#define HYPRE_SStructGMRESSetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGMRESSetPrecond ) +#define HYPRE_SStructGMRESSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGMRESSetPrintLevel ) +#define HYPRE_SStructGMRESSetStopCrit HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGMRESSetStopCrit ) +#define HYPRE_SStructGMRESSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGMRESSetTol ) +#define HYPRE_SStructGMRESSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGMRESSetup ) +#define HYPRE_SStructGMRESSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGMRESSolve ) +#define HYPRE_SStructLGMRESCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructLGMRESCreate ) +#define HYPRE_SStructLGMRESDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructLGMRESDestroy ) +#define HYPRE_SStructLGMRESGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructLGMRESGetFinalRelativeResidualNorm ) +#define HYPRE_SStructLGMRESGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructLGMRESGetNumIterations ) +#define HYPRE_SStructLGMRESGetResidual HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructLGMRESGetResidual ) +#define HYPRE_SStructLGMRESSetAbsoluteTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructLGMRESSetAbsoluteTol ) +#define HYPRE_SStructLGMRESSetAugDim HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructLGMRESSetAugDim ) +#define HYPRE_SStructLGMRESSetKDim HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructLGMRESSetKDim ) +#define HYPRE_SStructLGMRESSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructLGMRESSetLogging ) +#define HYPRE_SStructLGMRESSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructLGMRESSetMaxIter ) +#define HYPRE_SStructLGMRESSetMinIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructLGMRESSetMinIter ) +#define HYPRE_SStructLGMRESSetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructLGMRESSetPrecond ) +#define HYPRE_SStructLGMRESSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructLGMRESSetPrintLevel ) +#define HYPRE_SStructLGMRESSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructLGMRESSetTol ) +#define HYPRE_SStructLGMRESSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructLGMRESSetup ) +#define HYPRE_SStructLGMRESSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructLGMRESSolve ) +#define HYPRE_SStructPCGCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructPCGCreate ) +#define HYPRE_SStructPCGDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructPCGDestroy ) +#define HYPRE_SStructPCGGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructPCGGetFinalRelativeResidualNorm ) +#define HYPRE_SStructPCGGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructPCGGetNumIterations ) +#define HYPRE_SStructPCGGetResidual HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructPCGGetResidual ) +#define HYPRE_SStructPCGSetAbsoluteTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructPCGSetAbsoluteTol ) +#define HYPRE_SStructPCGSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructPCGSetLogging ) +#define HYPRE_SStructPCGSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructPCGSetMaxIter ) +#define HYPRE_SStructPCGSetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructPCGSetPrecond ) +#define HYPRE_SStructPCGSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructPCGSetPrintLevel ) +#define HYPRE_SStructPCGSetRelChange HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructPCGSetRelChange ) +#define HYPRE_SStructPCGSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructPCGSetTol ) +#define HYPRE_SStructPCGSetTwoNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructPCGSetTwoNorm ) +#define HYPRE_SStructPCGSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructPCGSetup ) +#define HYPRE_SStructPCGSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructPCGSolve ) +#define HYPRE_SStructSSAMGCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSSAMGCreate ) +#define HYPRE_SStructSSAMGDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSSAMGDestroy ) +#define HYPRE_SStructSSAMGGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSSAMGGetFinalRelativeResidualNorm ) +#define HYPRE_SStructSSAMGGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSSAMGGetNumIterations ) +#define HYPRE_SStructSSAMGSetCoarseSolverType HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSSAMGSetCoarseSolverType ) +#define HYPRE_SStructSSAMGSetDxyz HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSSAMGSetDxyz ) +#define HYPRE_SStructSSAMGSetInterpType HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSSAMGSetInterpType ) +#define HYPRE_SStructSSAMGSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSSAMGSetLogging ) +#define HYPRE_SStructSSAMGSetMaxCoarseSize HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSSAMGSetMaxCoarseSize ) +#define HYPRE_SStructSSAMGSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSSAMGSetMaxIter ) +#define HYPRE_SStructSSAMGSetMaxLevels HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSSAMGSetMaxLevels ) +#define HYPRE_SStructSSAMGSetNonGalerkinRAP HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSSAMGSetNonGalerkinRAP ) +#define HYPRE_SStructSSAMGSetNonZeroGuess HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSSAMGSetNonZeroGuess ) +#define HYPRE_SStructSSAMGSetNumCoarseRelax HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSSAMGSetNumCoarseRelax ) +#define HYPRE_SStructSSAMGSetNumPostRelax HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSSAMGSetNumPostRelax ) +#define HYPRE_SStructSSAMGSetNumPreRelax HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSSAMGSetNumPreRelax ) +#define HYPRE_SStructSSAMGSetPrintFreq HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSSAMGSetPrintFreq ) +#define HYPRE_SStructSSAMGSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSSAMGSetPrintLevel ) +#define HYPRE_SStructSSAMGSetRelChange HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSSAMGSetRelChange ) +#define HYPRE_SStructSSAMGSetRelaxType HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSSAMGSetRelaxType ) +#define HYPRE_SStructSSAMGSetRelaxWeight HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSSAMGSetRelaxWeight ) +#define HYPRE_SStructSSAMGSetSkipRelax HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSSAMGSetSkipRelax ) +#define HYPRE_SStructSSAMGSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSSAMGSetTol ) +#define HYPRE_SStructSSAMGSetZeroGuess HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSSAMGSetZeroGuess ) +#define HYPRE_SStructSSAMGSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSSAMGSetup ) +#define HYPRE_SStructSSAMGSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSSAMGSolve ) +#define HYPRE_SStructSetupInterpreter HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSetupInterpreter ) +#define HYPRE_SStructSetupMatvec HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSetupMatvec ) +#define HYPRE_SStructSplitCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSplitCreate ) +#define HYPRE_SStructSplitDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSplitDestroy ) +#define HYPRE_SStructSplitGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSplitGetFinalRelativeResidualNorm ) +#define HYPRE_SStructSplitGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSplitGetNumIterations ) +#define HYPRE_SStructSplitPrintLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSplitPrintLogging ) +#define HYPRE_SStructSplitSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSplitSetLogging ) +#define HYPRE_SStructSplitSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSplitSetMaxIter ) +#define HYPRE_SStructSplitSetNonZeroGuess HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSplitSetNonZeroGuess ) +#define HYPRE_SStructSplitSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSplitSetPrintLevel ) +#define HYPRE_SStructSplitSetStructSolver HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSplitSetStructSolver ) +#define HYPRE_SStructSplitSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSplitSetTol ) +#define HYPRE_SStructSplitSetZeroGuess HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSplitSetZeroGuess ) +#define HYPRE_SStructSplitSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSplitSetup ) +#define HYPRE_SStructSplitSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSplitSolve ) +#define HYPRE_SStructSysPFMGCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSysPFMGCreate ) +#define HYPRE_SStructSysPFMGDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSysPFMGDestroy ) +#define HYPRE_SStructSysPFMGGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSysPFMGGetFinalRelativeResidualNorm ) +#define HYPRE_SStructSysPFMGGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSysPFMGGetNumIterations ) +#define HYPRE_SStructSysPFMGSetDxyz HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSysPFMGSetDxyz ) +#define HYPRE_SStructSysPFMGSetJacobiWeight HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSysPFMGSetJacobiWeight ) +#define HYPRE_SStructSysPFMGSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSysPFMGSetLogging ) +#define HYPRE_SStructSysPFMGSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSysPFMGSetMaxIter ) +#define HYPRE_SStructSysPFMGSetNonZeroGuess HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSysPFMGSetNonZeroGuess ) +#define HYPRE_SStructSysPFMGSetNumPostRelax HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSysPFMGSetNumPostRelax ) +#define HYPRE_SStructSysPFMGSetNumPreRelax HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSysPFMGSetNumPreRelax ) +#define HYPRE_SStructSysPFMGSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSysPFMGSetPrintLevel ) +#define HYPRE_SStructSysPFMGSetRelChange HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSysPFMGSetRelChange ) +#define HYPRE_SStructSysPFMGSetRelaxType HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSysPFMGSetRelaxType ) +#define HYPRE_SStructSysPFMGSetSkipRelax HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSysPFMGSetSkipRelax ) +#define HYPRE_SStructSysPFMGSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSysPFMGSetTol ) +#define HYPRE_SStructSysPFMGSetZeroGuess HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSysPFMGSetZeroGuess ) +#define HYPRE_SStructSysPFMGSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSysPFMGSetup ) +#define HYPRE_SStructSysPFMGSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructSysPFMGSolve ) +#define hypre_NodeRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_NodeRelax ) +#define hypre_NodeRelaxCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_NodeRelaxCreate ) +#define hypre_NodeRelaxDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_NodeRelaxDestroy ) +#define hypre_NodeRelaxSetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_NodeRelaxSetMaxIter ) +#define hypre_NodeRelaxSetNodeset HYPRE_FIXEDPRECISION_FUNC ( hypre_NodeRelaxSetNodeset ) +#define hypre_NodeRelaxSetNodesetRank HYPRE_FIXEDPRECISION_FUNC ( hypre_NodeRelaxSetNodesetRank ) +#define hypre_NodeRelaxSetNumNodesets HYPRE_FIXEDPRECISION_FUNC ( hypre_NodeRelaxSetNumNodesets ) +#define hypre_NodeRelaxSetTempVec HYPRE_FIXEDPRECISION_FUNC ( hypre_NodeRelaxSetTempVec ) +#define hypre_NodeRelaxSetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_NodeRelaxSetTol ) +#define hypre_NodeRelaxSetWeight HYPRE_FIXEDPRECISION_FUNC ( hypre_NodeRelaxSetWeight ) +#define hypre_NodeRelaxSetZeroGuess HYPRE_FIXEDPRECISION_FUNC ( hypre_NodeRelaxSetZeroGuess ) +#define hypre_NodeRelaxSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_NodeRelaxSetup ) +#define hypre_SSAMGCoarseSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGCoarseSolve ) +#define hypre_SSAMGCoarseSolverDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGCoarseSolverDestroy ) +#define hypre_SSAMGCoarseSolverSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGCoarseSolverSetup ) +#define hypre_SSAMGCoarsen HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGCoarsen ) +#define hypre_SSAMGComputeDxyz HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGComputeDxyz ) +#define hypre_SSAMGComputeMaxLevels HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGComputeMaxLevels ) +#define hypre_SSAMGComputeRAP HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGComputeRAP ) +#define hypre_SSAMGComputeRAPNonGlk HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGComputeRAPNonGlk ) +#define hypre_SSAMGCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGCreate ) +#define hypre_SSAMGCreateInterpOp HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGCreateInterpOp ) +#define hypre_SSAMGDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGDestroy ) +#define hypre_SSAMGGetFinalRelativeResidualNorm HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGGetFinalRelativeResidualNorm ) +#define hypre_SSAMGGetNumIterations HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGGetNumIterations ) +#define hypre_SSAMGPrintLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGPrintLogging ) +#define hypre_SSAMGPrintStats HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGPrintStats ) +#define hypre_SSAMGRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGRelax ) +#define hypre_SSAMGRelaxCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGRelaxCreate ) +#define hypre_SSAMGRelaxDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGRelaxDestroy ) +#define hypre_SSAMGRelaxGeneric HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGRelaxGeneric ) +#define hypre_SSAMGRelaxJacobi HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGRelaxJacobi ) +#define hypre_SSAMGRelaxSetActiveParts HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGRelaxSetActiveParts ) +#define hypre_SSAMGRelaxSetMatvecData HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGRelaxSetMatvecData ) +#define hypre_SSAMGRelaxSetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGRelaxSetMaxIter ) +#define hypre_SSAMGRelaxSetNodeset HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGRelaxSetNodeset ) +#define hypre_SSAMGRelaxSetNodesetRank HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGRelaxSetNodesetRank ) +#define hypre_SSAMGRelaxSetNumNodesets HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGRelaxSetNumNodesets ) +#define hypre_SSAMGRelaxSetPostRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGRelaxSetPostRelax ) +#define hypre_SSAMGRelaxSetPreRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGRelaxSetPreRelax ) +#define hypre_SSAMGRelaxSetTempVec HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGRelaxSetTempVec ) +#define hypre_SSAMGRelaxSetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGRelaxSetTol ) +#define hypre_SSAMGRelaxSetType HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGRelaxSetType ) +#define hypre_SSAMGRelaxSetWeights HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGRelaxSetWeights ) +#define hypre_SSAMGRelaxSetZeroGuess HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGRelaxSetZeroGuess ) +#define hypre_SSAMGRelaxSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGRelaxSetup ) +#define hypre_SSAMGSetCoarseSolverType HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGSetCoarseSolverType ) +#define hypre_SSAMGSetDxyz HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGSetDxyz ) +#define hypre_SSAMGSetInterpType HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGSetInterpType ) +#define hypre_SSAMGSetLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGSetLogging ) +#define hypre_SSAMGSetMaxCoarseSize HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGSetMaxCoarseSize ) +#define hypre_SSAMGSetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGSetMaxIter ) +#define hypre_SSAMGSetMaxLevels HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGSetMaxLevels ) +#define hypre_SSAMGSetNonGalerkinRAP HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGSetNonGalerkinRAP ) +#define hypre_SSAMGSetNumCoarseRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGSetNumCoarseRelax ) +#define hypre_SSAMGSetNumPosRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGSetNumPosRelax ) +#define hypre_SSAMGSetNumPreRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGSetNumPreRelax ) +#define hypre_SSAMGSetPrintFreq HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGSetPrintFreq ) +#define hypre_SSAMGSetPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGSetPrintLevel ) +#define hypre_SSAMGSetRelChange HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGSetRelChange ) +#define hypre_SSAMGSetRelaxType HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGSetRelaxType ) +#define hypre_SSAMGSetRelaxWeight HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGSetRelaxWeight ) +#define hypre_SSAMGSetSkipRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGSetSkipRelax ) +#define hypre_SSAMGSetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGSetTol ) +#define hypre_SSAMGSetZeroGuess HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGSetZeroGuess ) +#define hypre_SSAMGSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGSetup ) +#define hypre_SSAMGSetupInterpOp HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGSetupInterpOp ) +#define hypre_SSAMGSetupSInterpOp HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGSetupSInterpOp ) +#define hypre_SSAMGSetupUInterpOp HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGSetupUInterpOp ) +#define hypre_SSAMGSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_SSAMGSolve ) +#define hypre_SStructKrylovAxpy HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructKrylovAxpy ) +#define hypre_SStructKrylovCAlloc HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructKrylovCAlloc ) +#define hypre_SStructKrylovClearVector HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructKrylovClearVector ) +#define hypre_SStructKrylovCommInfo HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructKrylovCommInfo ) +#define hypre_SStructKrylovCopyVector HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructKrylovCopyVector ) +#define hypre_SStructKrylovCreateVector HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructKrylovCreateVector ) +#define hypre_SStructKrylovCreateVectorArray HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructKrylovCreateVectorArray ) +#define hypre_SStructKrylovDestroyVector HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructKrylovDestroyVector ) +#define hypre_SStructKrylovFree HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructKrylovFree ) +#define hypre_SStructKrylovIdentity HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructKrylovIdentity ) +#define hypre_SStructKrylovIdentitySetup HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructKrylovIdentitySetup ) +#define hypre_SStructKrylovInnerProd HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructKrylovInnerProd ) +#define hypre_SStructKrylovInnerProdTagged HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructKrylovInnerProdTagged ) +#define hypre_SStructKrylovMatvec HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructKrylovMatvec ) +#define hypre_SStructKrylovMatvecCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructKrylovMatvecCreate ) +#define hypre_SStructKrylovMatvecDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructKrylovMatvecDestroy ) +#define hypre_SStructKrylovPrintVector HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructKrylovPrintVector ) +#define hypre_SStructKrylovScaleVector HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructKrylovScaleVector ) +#define hypre_SStructSetRandomValues HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructSetRandomValues ) +#define hypre_SysPFMGCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGCreate ) +#define hypre_SysPFMGCreateInterpOp HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGCreateInterpOp ) +#define hypre_SysPFMGDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGDestroy ) +#define hypre_SysPFMGGetFinalRelativeResidualNorm HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGGetFinalRelativeResidualNorm ) +#define hypre_SysPFMGGetNumIterations HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGGetNumIterations ) +#define hypre_SysPFMGPrintLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGPrintLogging ) +#define hypre_SysPFMGRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGRelax ) +#define hypre_SysPFMGRelaxCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGRelaxCreate ) +#define hypre_SysPFMGRelaxDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGRelaxDestroy ) +#define hypre_SysPFMGRelaxSetJacobiWeight HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGRelaxSetJacobiWeight ) +#define hypre_SysPFMGRelaxSetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGRelaxSetMaxIter ) +#define hypre_SysPFMGRelaxSetPostRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGRelaxSetPostRelax ) +#define hypre_SysPFMGRelaxSetPreRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGRelaxSetPreRelax ) +#define hypre_SysPFMGRelaxSetTempVec HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGRelaxSetTempVec ) +#define hypre_SysPFMGRelaxSetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGRelaxSetTol ) +#define hypre_SysPFMGRelaxSetType HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGRelaxSetType ) +#define hypre_SysPFMGRelaxSetZeroGuess HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGRelaxSetZeroGuess ) +#define hypre_SysPFMGRelaxSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGRelaxSetup ) +#define hypre_SysPFMGSetDxyz HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGSetDxyz ) +#define hypre_SysPFMGSetJacobiWeight HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGSetJacobiWeight ) +#define hypre_SysPFMGSetLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGSetLogging ) +#define hypre_SysPFMGSetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGSetMaxIter ) +#define hypre_SysPFMGSetNumPostRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGSetNumPostRelax ) +#define hypre_SysPFMGSetNumPreRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGSetNumPreRelax ) +#define hypre_SysPFMGSetPrintFreq HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGSetPrintFreq ) +#define hypre_SysPFMGSetPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGSetPrintLevel ) +#define hypre_SysPFMGSetRelChange HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGSetRelChange ) +#define hypre_SysPFMGSetRelaxType HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGSetRelaxType ) +#define hypre_SysPFMGSetSkipRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGSetSkipRelax ) +#define hypre_SysPFMGSetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGSetTol ) +#define hypre_SysPFMGSetZeroGuess HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGSetZeroGuess ) +#define hypre_SysPFMGSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGSetup ) +#define hypre_SysPFMGSetupInterpOp HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGSetupInterpOp ) +#define hypre_SysPFMGSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGSolve ) +#define hypre_SysPFMGZeroDiagonal HYPRE_FIXEDPRECISION_FUNC ( hypre_SysPFMGZeroDiagonal ) +#define hypre_sstructbicgstabcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructbicgstabcreate ) +#define hypre_sstructbicgstabdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructbicgstabdestroy ) +#define hypre_sstructbicgstabgetfinalre HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructbicgstabgetfinalre ) +#define hypre_sstructbicgstabgetnumiter HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructbicgstabgetnumiter ) +#define hypre_sstructbicgstabgetresidua HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructbicgstabgetresidua ) +#define hypre_sstructbicgstabsetabsolutetol HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructbicgstabsetabsolutetol ) +#define hypre_sstructbicgstabsetlogging HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructbicgstabsetlogging ) +#define hypre_sstructbicgstabsetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructbicgstabsetmaxiter ) +#define hypre_sstructbicgstabsetminiter HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructbicgstabsetminiter ) +#define hypre_sstructbicgstabsetprecond HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructbicgstabsetprecond ) +#define hypre_sstructbicgstabsetprintle HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructbicgstabsetprintle ) +#define hypre_sstructbicgstabsetstopcri HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructbicgstabsetstopcri ) +#define hypre_sstructbicgstabsettol HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructbicgstabsettol ) +#define hypre_sstructbicgstabsetup HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructbicgstabsetup ) +#define hypre_sstructbicgstabsolve HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructbicgstabsolve ) +#define hypre_sstructdiagscale HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructdiagscale ) +#define hypre_sstructdiagscalesetup HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructdiagscalesetup ) +#define hypre_sstructflexgmrescreate HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructflexgmrescreate ) +#define hypre_sstructflexgmresdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructflexgmresdestroy ) +#define hypre_sstructflexgmresgetfinalrelat HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructflexgmresgetfinalrelat ) +#define hypre_sstructflexgmresgetnumiterati HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructflexgmresgetnumiterati ) +#define hypre_sstructflexgmresgetresidual HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructflexgmresgetresidual ) +#define hypre_sstructflexgmressetabsolutetol HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructflexgmressetabsolutetol ) +#define hypre_sstructflexgmressetkdim HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructflexgmressetkdim ) +#define hypre_sstructflexgmressetlogging HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructflexgmressetlogging ) +#define hypre_sstructflexgmressetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructflexgmressetmaxiter ) +#define hypre_sstructflexgmressetminiter HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructflexgmressetminiter ) +#define hypre_sstructflexgmressetprecond HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructflexgmressetprecond ) +#define hypre_sstructflexgmressetprintlevel HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructflexgmressetprintlevel ) +#define hypre_sstructflexgmressettol HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructflexgmressettol ) +#define hypre_sstructflexgmressetup HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructflexgmressetup ) +#define hypre_sstructflexgmressolve HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructflexgmressolve ) +#define hypre_sstructgmrescreate HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgmrescreate ) +#define hypre_sstructgmresdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgmresdestroy ) +#define hypre_sstructgmresgetfinalrelat HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgmresgetfinalrelat ) +#define hypre_sstructgmresgetnumiterati HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgmresgetnumiterati ) +#define hypre_sstructgmresgetresidual HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgmresgetresidual ) +#define hypre_sstructgmressetabsolutetol HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgmressetabsolutetol ) +#define hypre_sstructgmressetkdim HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgmressetkdim ) +#define hypre_sstructgmressetlogging HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgmressetlogging ) +#define hypre_sstructgmressetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgmressetmaxiter ) +#define hypre_sstructgmressetminiter HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgmressetminiter ) +#define hypre_sstructgmressetprecond HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgmressetprecond ) +#define hypre_sstructgmressetprintlevel HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgmressetprintlevel ) +#define hypre_sstructgmressetstopcrit HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgmressetstopcrit ) +#define hypre_sstructgmressettol HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgmressettol ) +#define hypre_sstructgmressetup HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgmressetup ) +#define hypre_sstructgmressolve HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgmressolve ) +#define hypre_sstructlgmrescreate HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructlgmrescreate ) +#define hypre_sstructlgmresdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructlgmresdestroy ) +#define hypre_sstructlgmresgetfinalrelat HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructlgmresgetfinalrelat ) +#define hypre_sstructlgmresgetnumiterati HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructlgmresgetnumiterati ) +#define hypre_sstructlgmresgetresidual HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructlgmresgetresidual ) +#define hypre_sstructlgmressetabsolutetol HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructlgmressetabsolutetol ) +#define hypre_sstructlgmressetaugdim HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructlgmressetaugdim ) +#define hypre_sstructlgmressetkdim HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructlgmressetkdim ) +#define hypre_sstructlgmressetlogging HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructlgmressetlogging ) +#define hypre_sstructlgmressetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructlgmressetmaxiter ) +#define hypre_sstructlgmressetminiter HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructlgmressetminiter ) +#define hypre_sstructlgmressetprecond HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructlgmressetprecond ) +#define hypre_sstructlgmressetprintlevel HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructlgmressetprintlevel ) +#define hypre_sstructlgmressettol HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructlgmressettol ) +#define hypre_sstructlgmressetup HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructlgmressetup ) +#define hypre_sstructlgmressolve HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructlgmressolve ) +#define hypre_sstructpcgcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructpcgcreate ) +#define hypre_sstructpcgdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructpcgdestroy ) +#define hypre_sstructpcggetfinalrelativ HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructpcggetfinalrelativ ) +#define hypre_sstructpcggetnumiteration HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructpcggetnumiteration ) +#define hypre_sstructpcggetresidual HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructpcggetresidual ) +#define hypre_sstructpcgsetabsolutetol HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructpcgsetabsolutetol ) +#define hypre_sstructpcgsetlogging HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructpcgsetlogging ) +#define hypre_sstructpcgsetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructpcgsetmaxiter ) +#define hypre_sstructpcgsetprecond HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructpcgsetprecond ) +#define hypre_sstructpcgsetprintlevel HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructpcgsetprintlevel ) +#define hypre_sstructpcgsetrelchange HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructpcgsetrelchange ) +#define hypre_sstructpcgsettol HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructpcgsettol ) +#define hypre_sstructpcgsettwonorm HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructpcgsettwonorm ) +#define hypre_sstructpcgsetup HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructpcgsetup ) +#define hypre_sstructpcgsolve HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructpcgsolve ) +#define hypre_sstructsetupinterpreter HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsetupinterpreter ) +#define hypre_sstructsetupmatvec HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsetupmatvec ) +#define hypre_sstructsplitcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsplitcreate ) +#define hypre_sstructsplitdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsplitdestroy ) +#define hypre_sstructsplitgetfinalrelat HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsplitgetfinalrelat ) +#define hypre_sstructsplitgetnumiterati HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsplitgetnumiterati ) +#define hypre_sstructsplitsetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsplitsetmaxiter ) +#define hypre_sstructsplitsetnonzerogue HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsplitsetnonzerogue ) +#define hypre_sstructsplitsetstructsolv HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsplitsetstructsolv ) +#define hypre_sstructsplitsettol HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsplitsettol ) +#define hypre_sstructsplitsetup HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsplitsetup ) +#define hypre_sstructsplitsetzeroguess HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsplitsetzeroguess ) +#define hypre_sstructsplitsolve HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsplitsolve ) +#define hypre_sstructssamgcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructssamgcreate ) +#define hypre_sstructssamgdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructssamgdestroy ) +#define hypre_sstructssamggetfinalrel HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructssamggetfinalrel ) +#define hypre_sstructssamggetnumitera HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructssamggetnumitera ) +#define hypre_sstructssamgsetdxyz HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructssamgsetdxyz ) +#define hypre_sstructssamgsetlogging HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructssamgsetlogging ) +#define hypre_sstructssamgsetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructssamgsetmaxiter ) +#define hypre_sstructssamgsetnonzerog HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructssamgsetnonzerog ) +#define hypre_sstructssamgsetnumpostr HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructssamgsetnumpostr ) +#define hypre_sstructssamgsetnumprere HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructssamgsetnumprere ) +#define hypre_sstructssamgsetprintlev HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructssamgsetprintlev ) +#define hypre_sstructssamgsetrelaxtyp HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructssamgsetrelaxtyp ) +#define hypre_sstructssamgsetrelaxwei HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructssamgsetrelaxwei ) +#define hypre_sstructssamgsetrelchang HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructssamgsetrelchang ) +#define hypre_sstructssamgsetskiprela HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructssamgsetskiprela ) +#define hypre_sstructssamgsettol HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructssamgsettol ) +#define hypre_sstructssamgsetup HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructssamgsetup ) +#define hypre_sstructssamgsetzerogues HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructssamgsetzerogues ) +#define hypre_sstructssamgsolve HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructssamgsolve ) +#define hypre_sstructsyspfmgcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsyspfmgcreate ) +#define hypre_sstructsyspfmgdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsyspfmgdestroy ) +#define hypre_sstructsyspfmggetfinalrel HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsyspfmggetfinalrel ) +#define hypre_sstructsyspfmggetnumitera HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsyspfmggetnumitera ) +#define hypre_sstructsyspfmgsetdxyz HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsyspfmgsetdxyz ) +#define hypre_sstructsyspfmgsetjacobiweigh HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsyspfmgsetjacobiweigh ) +#define hypre_sstructsyspfmgsetlogging HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsyspfmgsetlogging ) +#define hypre_sstructsyspfmgsetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsyspfmgsetmaxiter ) +#define hypre_sstructsyspfmgsetnonzerog HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsyspfmgsetnonzerog ) +#define hypre_sstructsyspfmgsetnumpostr HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsyspfmgsetnumpostr ) +#define hypre_sstructsyspfmgsetnumprere HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsyspfmgsetnumprere ) +#define hypre_sstructsyspfmgsetprintlev HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsyspfmgsetprintlev ) +#define hypre_sstructsyspfmgsetrelaxtyp HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsyspfmgsetrelaxtyp ) +#define hypre_sstructsyspfmgsetrelchang HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsyspfmgsetrelchang ) +#define hypre_sstructsyspfmgsetskiprela HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsyspfmgsetskiprela ) +#define hypre_sstructsyspfmgsettol HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsyspfmgsettol ) +#define hypre_sstructsyspfmgsetup HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsyspfmgsetup ) +#define hypre_sstructsyspfmgsetzerogues HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsyspfmgsetzerogues ) +#define hypre_sstructsyspfmgsolve HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructsyspfmgsolve ) + +#endif diff --git a/src/sstruct_ls/_hypre_sstruct_ls_mup_undef.h b/src/sstruct_ls/_hypre_sstruct_ls_mup_undef.h new file mode 100644 index 0000000000..558673c793 --- /dev/null +++ b/src/sstruct_ls/_hypre_sstruct_ls_mup_undef.h @@ -0,0 +1,409 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#undef hypre_SSTRUCT_LS_MUP_DEF_HEADER + +#undef HYPRE_SStructBiCGSTABCreate +#undef HYPRE_SStructBiCGSTABDestroy +#undef HYPRE_SStructBiCGSTABGetFinalRelativeResidualNorm +#undef HYPRE_SStructBiCGSTABGetNumIterations +#undef HYPRE_SStructBiCGSTABGetResidual +#undef HYPRE_SStructBiCGSTABSetAbsoluteTol +#undef HYPRE_SStructBiCGSTABSetLogging +#undef HYPRE_SStructBiCGSTABSetMaxIter +#undef HYPRE_SStructBiCGSTABSetMinIter +#undef HYPRE_SStructBiCGSTABSetPrecond +#undef HYPRE_SStructBiCGSTABSetPrintLevel +#undef HYPRE_SStructBiCGSTABSetStopCrit +#undef HYPRE_SStructBiCGSTABSetTol +#undef HYPRE_SStructBiCGSTABSetup +#undef HYPRE_SStructBiCGSTABSolve +#undef HYPRE_SStructDiagScale +#undef HYPRE_SStructDiagScaleSetup +#undef HYPRE_SStructFlexGMRESCreate +#undef HYPRE_SStructFlexGMRESDestroy +#undef HYPRE_SStructFlexGMRESGetFinalRelativeResidualNorm +#undef HYPRE_SStructFlexGMRESGetNumIterations +#undef HYPRE_SStructFlexGMRESGetResidual +#undef HYPRE_SStructFlexGMRESSetAbsoluteTol +#undef HYPRE_SStructFlexGMRESSetKDim +#undef HYPRE_SStructFlexGMRESSetLogging +#undef HYPRE_SStructFlexGMRESSetMaxIter +#undef HYPRE_SStructFlexGMRESSetMinIter +#undef HYPRE_SStructFlexGMRESSetModifyPC +#undef HYPRE_SStructFlexGMRESSetPrecond +#undef HYPRE_SStructFlexGMRESSetPrintLevel +#undef HYPRE_SStructFlexGMRESSetTol +#undef HYPRE_SStructFlexGMRESSetup +#undef HYPRE_SStructFlexGMRESSolve +#undef HYPRE_SStructGMRESCreate +#undef HYPRE_SStructGMRESDestroy +#undef HYPRE_SStructGMRESGetFinalRelativeResidualNorm +#undef HYPRE_SStructGMRESGetNumIterations +#undef HYPRE_SStructGMRESGetResidual +#undef HYPRE_SStructGMRESSetAbsoluteTol +#undef HYPRE_SStructGMRESSetKDim +#undef HYPRE_SStructGMRESSetLogging +#undef HYPRE_SStructGMRESSetMaxIter +#undef HYPRE_SStructGMRESSetMinIter +#undef HYPRE_SStructGMRESSetPrecond +#undef HYPRE_SStructGMRESSetPrintLevel +#undef HYPRE_SStructGMRESSetStopCrit +#undef HYPRE_SStructGMRESSetTol +#undef HYPRE_SStructGMRESSetup +#undef HYPRE_SStructGMRESSolve +#undef HYPRE_SStructLGMRESCreate +#undef HYPRE_SStructLGMRESDestroy +#undef HYPRE_SStructLGMRESGetFinalRelativeResidualNorm +#undef HYPRE_SStructLGMRESGetNumIterations +#undef HYPRE_SStructLGMRESGetResidual +#undef HYPRE_SStructLGMRESSetAbsoluteTol +#undef HYPRE_SStructLGMRESSetAugDim +#undef HYPRE_SStructLGMRESSetKDim +#undef HYPRE_SStructLGMRESSetLogging +#undef HYPRE_SStructLGMRESSetMaxIter +#undef HYPRE_SStructLGMRESSetMinIter +#undef HYPRE_SStructLGMRESSetPrecond +#undef HYPRE_SStructLGMRESSetPrintLevel +#undef HYPRE_SStructLGMRESSetTol +#undef HYPRE_SStructLGMRESSetup +#undef HYPRE_SStructLGMRESSolve +#undef HYPRE_SStructPCGCreate +#undef HYPRE_SStructPCGDestroy +#undef HYPRE_SStructPCGGetFinalRelativeResidualNorm +#undef HYPRE_SStructPCGGetNumIterations +#undef HYPRE_SStructPCGGetResidual +#undef HYPRE_SStructPCGSetAbsoluteTol +#undef HYPRE_SStructPCGSetLogging +#undef HYPRE_SStructPCGSetMaxIter +#undef HYPRE_SStructPCGSetPrecond +#undef HYPRE_SStructPCGSetPrintLevel +#undef HYPRE_SStructPCGSetRelChange +#undef HYPRE_SStructPCGSetTol +#undef HYPRE_SStructPCGSetTwoNorm +#undef HYPRE_SStructPCGSetup +#undef HYPRE_SStructPCGSolve +#undef HYPRE_SStructSSAMGCreate +#undef HYPRE_SStructSSAMGDestroy +#undef HYPRE_SStructSSAMGGetFinalRelativeResidualNorm +#undef HYPRE_SStructSSAMGGetNumIterations +#undef HYPRE_SStructSSAMGSetCoarseSolverType +#undef HYPRE_SStructSSAMGSetDxyz +#undef HYPRE_SStructSSAMGSetInterpType +#undef HYPRE_SStructSSAMGSetLogging +#undef HYPRE_SStructSSAMGSetMaxCoarseSize +#undef HYPRE_SStructSSAMGSetMaxIter +#undef HYPRE_SStructSSAMGSetMaxLevels +#undef HYPRE_SStructSSAMGSetNonGalerkinRAP +#undef HYPRE_SStructSSAMGSetNonZeroGuess +#undef HYPRE_SStructSSAMGSetNumCoarseRelax +#undef HYPRE_SStructSSAMGSetNumPostRelax +#undef HYPRE_SStructSSAMGSetNumPreRelax +#undef HYPRE_SStructSSAMGSetPrintFreq +#undef HYPRE_SStructSSAMGSetPrintLevel +#undef HYPRE_SStructSSAMGSetRelChange +#undef HYPRE_SStructSSAMGSetRelaxType +#undef HYPRE_SStructSSAMGSetRelaxWeight +#undef HYPRE_SStructSSAMGSetSkipRelax +#undef HYPRE_SStructSSAMGSetTol +#undef HYPRE_SStructSSAMGSetZeroGuess +#undef HYPRE_SStructSSAMGSetup +#undef HYPRE_SStructSSAMGSolve +#undef HYPRE_SStructSetupInterpreter +#undef HYPRE_SStructSetupMatvec +#undef HYPRE_SStructSplitCreate +#undef HYPRE_SStructSplitDestroy +#undef HYPRE_SStructSplitGetFinalRelativeResidualNorm +#undef HYPRE_SStructSplitGetNumIterations +#undef HYPRE_SStructSplitPrintLogging +#undef HYPRE_SStructSplitSetLogging +#undef HYPRE_SStructSplitSetMaxIter +#undef HYPRE_SStructSplitSetNonZeroGuess +#undef HYPRE_SStructSplitSetPrintLevel +#undef HYPRE_SStructSplitSetStructSolver +#undef HYPRE_SStructSplitSetTol +#undef HYPRE_SStructSplitSetZeroGuess +#undef HYPRE_SStructSplitSetup +#undef HYPRE_SStructSplitSolve +#undef HYPRE_SStructSysPFMGCreate +#undef HYPRE_SStructSysPFMGDestroy +#undef HYPRE_SStructSysPFMGGetFinalRelativeResidualNorm +#undef HYPRE_SStructSysPFMGGetNumIterations +#undef HYPRE_SStructSysPFMGSetDxyz +#undef HYPRE_SStructSysPFMGSetJacobiWeight +#undef HYPRE_SStructSysPFMGSetLogging +#undef HYPRE_SStructSysPFMGSetMaxIter +#undef HYPRE_SStructSysPFMGSetNonZeroGuess +#undef HYPRE_SStructSysPFMGSetNumPostRelax +#undef HYPRE_SStructSysPFMGSetNumPreRelax +#undef HYPRE_SStructSysPFMGSetPrintLevel +#undef HYPRE_SStructSysPFMGSetRelChange +#undef HYPRE_SStructSysPFMGSetRelaxType +#undef HYPRE_SStructSysPFMGSetSkipRelax +#undef HYPRE_SStructSysPFMGSetTol +#undef HYPRE_SStructSysPFMGSetZeroGuess +#undef HYPRE_SStructSysPFMGSetup +#undef HYPRE_SStructSysPFMGSolve +#undef hypre_NodeRelax +#undef hypre_NodeRelaxCreate +#undef hypre_NodeRelaxDestroy +#undef hypre_NodeRelaxSetMaxIter +#undef hypre_NodeRelaxSetNodeset +#undef hypre_NodeRelaxSetNodesetRank +#undef hypre_NodeRelaxSetNumNodesets +#undef hypre_NodeRelaxSetTempVec +#undef hypre_NodeRelaxSetTol +#undef hypre_NodeRelaxSetWeight +#undef hypre_NodeRelaxSetZeroGuess +#undef hypre_NodeRelaxSetup +#undef hypre_SSAMGCoarseSolve +#undef hypre_SSAMGCoarseSolverDestroy +#undef hypre_SSAMGCoarseSolverSetup +#undef hypre_SSAMGCoarsen +#undef hypre_SSAMGComputeDxyz +#undef hypre_SSAMGComputeMaxLevels +#undef hypre_SSAMGComputeRAP +#undef hypre_SSAMGComputeRAPNonGlk +#undef hypre_SSAMGCreate +#undef hypre_SSAMGCreateInterpOp +#undef hypre_SSAMGDestroy +#undef hypre_SSAMGGetFinalRelativeResidualNorm +#undef hypre_SSAMGGetNumIterations +#undef hypre_SSAMGPrintLogging +#undef hypre_SSAMGPrintStats +#undef hypre_SSAMGRelax +#undef hypre_SSAMGRelaxCreate +#undef hypre_SSAMGRelaxDestroy +#undef hypre_SSAMGRelaxGeneric +#undef hypre_SSAMGRelaxJacobi +#undef hypre_SSAMGRelaxSetActiveParts +#undef hypre_SSAMGRelaxSetMatvecData +#undef hypre_SSAMGRelaxSetMaxIter +#undef hypre_SSAMGRelaxSetNodeset +#undef hypre_SSAMGRelaxSetNodesetRank +#undef hypre_SSAMGRelaxSetNumNodesets +#undef hypre_SSAMGRelaxSetPostRelax +#undef hypre_SSAMGRelaxSetPreRelax +#undef hypre_SSAMGRelaxSetTempVec +#undef hypre_SSAMGRelaxSetTol +#undef hypre_SSAMGRelaxSetType +#undef hypre_SSAMGRelaxSetWeights +#undef hypre_SSAMGRelaxSetZeroGuess +#undef hypre_SSAMGRelaxSetup +#undef hypre_SSAMGSetCoarseSolverType +#undef hypre_SSAMGSetDxyz +#undef hypre_SSAMGSetInterpType +#undef hypre_SSAMGSetLogging +#undef hypre_SSAMGSetMaxCoarseSize +#undef hypre_SSAMGSetMaxIter +#undef hypre_SSAMGSetMaxLevels +#undef hypre_SSAMGSetNonGalerkinRAP +#undef hypre_SSAMGSetNumCoarseRelax +#undef hypre_SSAMGSetNumPosRelax +#undef hypre_SSAMGSetNumPreRelax +#undef hypre_SSAMGSetPrintFreq +#undef hypre_SSAMGSetPrintLevel +#undef hypre_SSAMGSetRelChange +#undef hypre_SSAMGSetRelaxType +#undef hypre_SSAMGSetRelaxWeight +#undef hypre_SSAMGSetSkipRelax +#undef hypre_SSAMGSetTol +#undef hypre_SSAMGSetZeroGuess +#undef hypre_SSAMGSetup +#undef hypre_SSAMGSetupInterpOp +#undef hypre_SSAMGSetupSInterpOp +#undef hypre_SSAMGSetupUInterpOp +#undef hypre_SSAMGSolve +#undef hypre_SStructKrylovAxpy +#undef hypre_SStructKrylovCAlloc +#undef hypre_SStructKrylovClearVector +#undef hypre_SStructKrylovCommInfo +#undef hypre_SStructKrylovCopyVector +#undef hypre_SStructKrylovCreateVector +#undef hypre_SStructKrylovCreateVectorArray +#undef hypre_SStructKrylovDestroyVector +#undef hypre_SStructKrylovFree +#undef hypre_SStructKrylovIdentity +#undef hypre_SStructKrylovIdentitySetup +#undef hypre_SStructKrylovInnerProd +#undef hypre_SStructKrylovInnerProdTagged +#undef hypre_SStructKrylovMatvec +#undef hypre_SStructKrylovMatvecCreate +#undef hypre_SStructKrylovMatvecDestroy +#undef hypre_SStructKrylovPrintVector +#undef hypre_SStructKrylovScaleVector +#undef hypre_SStructSetRandomValues +#undef hypre_SysPFMGCreate +#undef hypre_SysPFMGCreateInterpOp +#undef hypre_SysPFMGDestroy +#undef hypre_SysPFMGGetFinalRelativeResidualNorm +#undef hypre_SysPFMGGetNumIterations +#undef hypre_SysPFMGPrintLogging +#undef hypre_SysPFMGRelax +#undef hypre_SysPFMGRelaxCreate +#undef hypre_SysPFMGRelaxDestroy +#undef hypre_SysPFMGRelaxSetJacobiWeight +#undef hypre_SysPFMGRelaxSetMaxIter +#undef hypre_SysPFMGRelaxSetPostRelax +#undef hypre_SysPFMGRelaxSetPreRelax +#undef hypre_SysPFMGRelaxSetTempVec +#undef hypre_SysPFMGRelaxSetTol +#undef hypre_SysPFMGRelaxSetType +#undef hypre_SysPFMGRelaxSetZeroGuess +#undef hypre_SysPFMGRelaxSetup +#undef hypre_SysPFMGSetDxyz +#undef hypre_SysPFMGSetJacobiWeight +#undef hypre_SysPFMGSetLogging +#undef hypre_SysPFMGSetMaxIter +#undef hypre_SysPFMGSetNumPostRelax +#undef hypre_SysPFMGSetNumPreRelax +#undef hypre_SysPFMGSetPrintFreq +#undef hypre_SysPFMGSetPrintLevel +#undef hypre_SysPFMGSetRelChange +#undef hypre_SysPFMGSetRelaxType +#undef hypre_SysPFMGSetSkipRelax +#undef hypre_SysPFMGSetTol +#undef hypre_SysPFMGSetZeroGuess +#undef hypre_SysPFMGSetup +#undef hypre_SysPFMGSetupInterpOp +#undef hypre_SysPFMGSolve +#undef hypre_SysPFMGZeroDiagonal +#undef hypre_sstructbicgstabcreate +#undef hypre_sstructbicgstabdestroy +#undef hypre_sstructbicgstabgetfinalre +#undef hypre_sstructbicgstabgetnumiter +#undef hypre_sstructbicgstabgetresidua +#undef hypre_sstructbicgstabsetabsolutetol +#undef hypre_sstructbicgstabsetlogging +#undef hypre_sstructbicgstabsetmaxiter +#undef hypre_sstructbicgstabsetminiter +#undef hypre_sstructbicgstabsetprecond +#undef hypre_sstructbicgstabsetprintle +#undef hypre_sstructbicgstabsetstopcri +#undef hypre_sstructbicgstabsettol +#undef hypre_sstructbicgstabsetup +#undef hypre_sstructbicgstabsolve +#undef hypre_sstructdiagscale +#undef hypre_sstructdiagscalesetup +#undef hypre_sstructflexgmrescreate +#undef hypre_sstructflexgmresdestroy +#undef hypre_sstructflexgmresgetfinalrelat +#undef hypre_sstructflexgmresgetnumiterati +#undef hypre_sstructflexgmresgetresidual +#undef hypre_sstructflexgmressetabsolutetol +#undef hypre_sstructflexgmressetkdim +#undef hypre_sstructflexgmressetlogging +#undef hypre_sstructflexgmressetmaxiter +#undef hypre_sstructflexgmressetminiter +#undef hypre_sstructflexgmressetprecond +#undef hypre_sstructflexgmressetprintlevel +#undef hypre_sstructflexgmressettol +#undef hypre_sstructflexgmressetup +#undef hypre_sstructflexgmressolve +#undef hypre_sstructgmrescreate +#undef hypre_sstructgmresdestroy +#undef hypre_sstructgmresgetfinalrelat +#undef hypre_sstructgmresgetnumiterati +#undef hypre_sstructgmresgetresidual +#undef hypre_sstructgmressetabsolutetol +#undef hypre_sstructgmressetkdim +#undef hypre_sstructgmressetlogging +#undef hypre_sstructgmressetmaxiter +#undef hypre_sstructgmressetminiter +#undef hypre_sstructgmressetprecond +#undef hypre_sstructgmressetprintlevel +#undef hypre_sstructgmressetstopcrit +#undef hypre_sstructgmressettol +#undef hypre_sstructgmressetup +#undef hypre_sstructgmressolve +#undef hypre_sstructlgmrescreate +#undef hypre_sstructlgmresdestroy +#undef hypre_sstructlgmresgetfinalrelat +#undef hypre_sstructlgmresgetnumiterati +#undef hypre_sstructlgmresgetresidual +#undef hypre_sstructlgmressetabsolutetol +#undef hypre_sstructlgmressetaugdim +#undef hypre_sstructlgmressetkdim +#undef hypre_sstructlgmressetlogging +#undef hypre_sstructlgmressetmaxiter +#undef hypre_sstructlgmressetminiter +#undef hypre_sstructlgmressetprecond +#undef hypre_sstructlgmressetprintlevel +#undef hypre_sstructlgmressettol +#undef hypre_sstructlgmressetup +#undef hypre_sstructlgmressolve +#undef hypre_sstructpcgcreate +#undef hypre_sstructpcgdestroy +#undef hypre_sstructpcggetfinalrelativ +#undef hypre_sstructpcggetnumiteration +#undef hypre_sstructpcggetresidual +#undef hypre_sstructpcgsetabsolutetol +#undef hypre_sstructpcgsetlogging +#undef hypre_sstructpcgsetmaxiter +#undef hypre_sstructpcgsetprecond +#undef hypre_sstructpcgsetprintlevel +#undef hypre_sstructpcgsetrelchange +#undef hypre_sstructpcgsettol +#undef hypre_sstructpcgsettwonorm +#undef hypre_sstructpcgsetup +#undef hypre_sstructpcgsolve +#undef hypre_sstructsetupinterpreter +#undef hypre_sstructsetupmatvec +#undef hypre_sstructsplitcreate +#undef hypre_sstructsplitdestroy +#undef hypre_sstructsplitgetfinalrelat +#undef hypre_sstructsplitgetnumiterati +#undef hypre_sstructsplitsetmaxiter +#undef hypre_sstructsplitsetnonzerogue +#undef hypre_sstructsplitsetstructsolv +#undef hypre_sstructsplitsettol +#undef hypre_sstructsplitsetup +#undef hypre_sstructsplitsetzeroguess +#undef hypre_sstructsplitsolve +#undef hypre_sstructssamgcreate +#undef hypre_sstructssamgdestroy +#undef hypre_sstructssamggetfinalrel +#undef hypre_sstructssamggetnumitera +#undef hypre_sstructssamgsetdxyz +#undef hypre_sstructssamgsetlogging +#undef hypre_sstructssamgsetmaxiter +#undef hypre_sstructssamgsetnonzerog +#undef hypre_sstructssamgsetnumpostr +#undef hypre_sstructssamgsetnumprere +#undef hypre_sstructssamgsetprintlev +#undef hypre_sstructssamgsetrelaxtyp +#undef hypre_sstructssamgsetrelaxwei +#undef hypre_sstructssamgsetrelchang +#undef hypre_sstructssamgsetskiprela +#undef hypre_sstructssamgsettol +#undef hypre_sstructssamgsetup +#undef hypre_sstructssamgsetzerogues +#undef hypre_sstructssamgsolve +#undef hypre_sstructsyspfmgcreate +#undef hypre_sstructsyspfmgdestroy +#undef hypre_sstructsyspfmggetfinalrel +#undef hypre_sstructsyspfmggetnumitera +#undef hypre_sstructsyspfmgsetdxyz +#undef hypre_sstructsyspfmgsetjacobiweigh +#undef hypre_sstructsyspfmgsetlogging +#undef hypre_sstructsyspfmgsetmaxiter +#undef hypre_sstructsyspfmgsetnonzerog +#undef hypre_sstructsyspfmgsetnumpostr +#undef hypre_sstructsyspfmgsetnumprere +#undef hypre_sstructsyspfmgsetprintlev +#undef hypre_sstructsyspfmgsetrelaxtyp +#undef hypre_sstructsyspfmgsetrelchang +#undef hypre_sstructsyspfmgsetskiprela +#undef hypre_sstructsyspfmgsettol +#undef hypre_sstructsyspfmgsetup +#undef hypre_sstructsyspfmgsetzerogues +#undef hypre_sstructsyspfmgsolve diff --git a/src/sstruct_ls/bsearch.c b/src/sstruct_ls/bsearch.c deleted file mode 100644 index 3ed378c3b8..0000000000 --- a/src/sstruct_ls/bsearch.c +++ /dev/null @@ -1,106 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_sstruct_ls.h" - -/*-------------------------------------------------------------------------- - * hypre_LowerBinarySearch - * integers such that - * 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; - HYPRE_Int not_found = 1; - - /* special case, list is size zero. */ - if (list_length < 1) - { - return -1; - } - - /* special case, list[0] >= value */ - if (list[0] >= value) - { - return 0; - } - - low = 0; - high = list_length - 1; - while (not_found && low <= high) - { - m = (low + high) / 2; - if (m < 1) - { - m = 1; - } - - if (list[m - 1] < value && list[m] < value) - { - low = m + 1; - } - else if (value <= list[m - 1] && value <= list[m]) - { - high = m - 1; - } - else - { - not_found = 0; - return m; - } - } - return -1; -} - -/*-------------------------------------------------------------------------- - * hypre_UpperBinarySearch - * integers such that - * list[m] <= value < list[m+1]. - * The routine returns location m or -1. - *--------------------------------------------------------------------------*/ -HYPRE_Int hypre_UpperBinarySearch(HYPRE_Int *list, HYPRE_Int value, HYPRE_Int list_length) -{ - HYPRE_Int low, high, m; - HYPRE_Int not_found = 1; - - /* special case, list is size zero. */ - if (list_length < 1) - { - return -1; - } - - /* special case, list[list_length-1] >= value */ - if (list[list_length - 1] <= value) - { - return (list_length - 1); - } - - low = 0; - high = list_length - 1; - while (not_found && low <= high) - { - m = (low + high) / 2; - if (list[m] <= value && list[m + 1] <= value) - { - low = m + 1; - } - else if (value < list[m] && value < list[m + 1]) - { - high = m - 1; - } - else - { - not_found = 0; - return m; - } - } - - return -1; -} diff --git a/src/sstruct_ls/eliminate_rowscols.c b/src/sstruct_ls/eliminate_rowscols.c deleted file mode 100644 index f75defd3bf..0000000000 --- a/src/sstruct_ls/eliminate_rowscols.c +++ /dev/null @@ -1,255 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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" -#include "eliminate_rowscols.h" - -HYPRE_Int hypre_ParCSRMatrixEliminateRowsCols (hypre_ParCSRMatrix *A, - HYPRE_Int nrows_to_eliminate, - HYPRE_Int *rows_to_eliminate) -{ - HYPRE_Int ierr = 0; - - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - - hypre_CSRMatrix *diag = hypre_ParCSRMatrixDiag(A); - hypre_CSRMatrix *offd = hypre_ParCSRMatrixOffd(A); - HYPRE_Int diag_nrows = hypre_CSRMatrixNumRows(diag); - HYPRE_Int offd_ncols = hypre_CSRMatrixNumCols(offd); - - HYPRE_Int ncols_to_eliminate; - HYPRE_Int *cols_to_eliminate; - - HYPRE_Int myproc; - HYPRE_Int ibeg; - - hypre_MPI_Comm_rank(comm, &myproc); - ibeg = 0; - - - /* take care of the diagonal part (sequential elimination) */ - hypre_CSRMatrixEliminateRowsColsDiag (A, nrows_to_eliminate, - rows_to_eliminate); - - /* eliminate the off-diagonal rows */ - hypre_CSRMatrixEliminateRowsOffd (A, nrows_to_eliminate, - rows_to_eliminate); - - /* figure out which offd cols should be eliminated */ - { - hypre_ParCSRCommHandle *comm_handle; - hypre_ParCSRCommPkg *comm_pkg; - HYPRE_Int num_sends, *int_buf_data; - HYPRE_Int index, start; - HYPRE_Int i, j, k; - - HYPRE_Int *eliminate_row = hypre_CTAlloc(HYPRE_Int, diag_nrows, HYPRE_MEMORY_HOST); - HYPRE_Int *eliminate_col = hypre_CTAlloc(HYPRE_Int, offd_ncols, HYPRE_MEMORY_HOST); - - /* make sure A has a communication package */ - comm_pkg = hypre_ParCSRMatrixCommPkg(A); - if (!comm_pkg) - { - hypre_MatvecCommPkgCreate(A); - comm_pkg = hypre_ParCSRMatrixCommPkg(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; - } - - /* 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, - 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++) - { - k = hypre_ParCSRCommPkgSendMapElmt(comm_pkg, j); - int_buf_data[index++] = eliminate_row[k]; - } - } - comm_handle = hypre_ParCSRCommHandleCreate(11, comm_pkg, - int_buf_data, eliminate_col); - hypre_ParCSRCommHandleDestroy(comm_handle); - - /* set the array cols_to_eliminate */ - 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); - hypre_TFree(eliminate_col, HYPRE_MEMORY_HOST); - } - - /* eliminate the off-diagonal columns */ - hypre_CSRMatrixEliminateColsOffd (offd, ncols_to_eliminate, - cols_to_eliminate); - - hypre_TFree(cols_to_eliminate, HYPRE_MEMORY_HOST); - - return ierr; -} - - -HYPRE_Int hypre_CSRMatrixEliminateRowsColsDiag (hypre_ParCSRMatrix *A, - 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); - - HYPRE_Int i, j; - HYPRE_Int irow, ibeg, iend; - - HYPRE_Int nnz = hypre_CSRMatrixNumNonzeros(Adiag); - HYPRE_Int *Ai = hypre_CSRMatrixI(Adiag); - HYPRE_Int *Aj = hypre_CSRMatrixJ(Adiag); - HYPRE_Real *Adata = hypre_CSRMatrixData(Adiag); - - HYPRE_Int *local_rows; - - HYPRE_Int myproc; - - hypre_MPI_Comm_rank(comm, &myproc); - 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[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 */ - for (i = 0; i < nrows_to_eliminate; i++) - { - irow = local_rows[i]; - ibeg = Ai[irow]; - 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); - - return ierr; -} - -HYPRE_Int hypre_CSRMatrixEliminateRowsOffd (hypre_ParCSRMatrix *A, - HYPRE_Int nrows_to_eliminate, - HYPRE_Int *rows_to_eliminate) -{ - HYPRE_Int ierr = 0; - - MPI_Comm comm = hypre_ParCSRMatrixComm(A); - - hypre_CSRMatrix *Aoffd = hypre_ParCSRMatrixOffd(A); - HYPRE_Int *Ai = hypre_CSRMatrixI(Aoffd); - - HYPRE_Real *Adata = hypre_CSRMatrixData(Aoffd); - - HYPRE_Int i, j; - HYPRE_Int ibeg, iend; - - HYPRE_Int *local_rows; - HYPRE_Int myproc; - - hypre_MPI_Comm_rank(comm, &myproc); - 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[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]; - for (j = ibeg; j < iend; j++) - { - Adata[j] = 0.0; - } - } - - hypre_TFree(local_rows, HYPRE_MEMORY_HOST); - - return ierr; -} - -HYPRE_Int hypre_CSRMatrixEliminateColsOffd (hypre_CSRMatrix *Aoffd, - HYPRE_Int ncols_to_eliminate, - HYPRE_Int *cols_to_eliminate) -{ - HYPRE_Int ierr = 0; - - HYPRE_Int i; - HYPRE_Int icol; - - HYPRE_Int nnz = hypre_CSRMatrixNumNonzeros(Aoffd); - HYPRE_Int *Aj = hypre_CSRMatrixJ(Aoffd); - HYPRE_Real *Adata = hypre_CSRMatrixData(Aoffd); - - for (i = 0; i < nnz; i++) - { - icol = hypre_BinarySearch(cols_to_eliminate, Aj[i], - ncols_to_eliminate); - if (icol != -1) - { - Adata[i] = 0.0; - } - } - - return ierr; -} diff --git a/src/sstruct_ls/eliminate_rowscols.h b/src/sstruct_ls/eliminate_rowscols.h deleted file mode 100644 index 6ca9d907a0..0000000000 --- a/src/sstruct_ls/eliminate_rowscols.h +++ /dev/null @@ -1,64 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_PARCSR_ELIMINATE_ROWSCOLS -#define hypre_PARCSR_ELIMINATE_ROWSCOLS - -#ifdef __cplusplus -extern "C" { -#endif - -/* - Function: hypre_ParCSRMatrixEliminateRowsCols - - This function eliminates the global rows and columns of a matrix - A corresponding to given lists of sorted (!) local row numbers. - - The elimination is done as follows: - - / A_ii | A_ib \ / A_ii | 0 \ - (input) A = | -----+----- | ---> | -----+----- | (output) - \ A_bi | A_bb / \ 0 | I / -*/ -HYPRE_Int hypre_ParCSRMatrixEliminateRowsCols (hypre_ParCSRMatrix *A, - HYPRE_Int nrows_to_eliminate, - HYPRE_Int *rows_to_eliminate); - - -/* - Function: hypre_CSRMatrixEliminateRowsColsDiag - - Eliminate the rows and columns of Adiag corresponding to the - 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); - -/* - Function: hypre_CSRMatrixEliminateRowsOffd - - 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); - -/* - Function: hypre_CSRMatrixEliminateColsOffd - - 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); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/sstruct_ls/fac.c b/src/sstruct_ls/fac.c deleted file mode 100644 index 003974a210..0000000000 --- a/src/sstruct_ls/fac.c +++ /dev/null @@ -1,436 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_sstruct_ls.h" -#include "fac.h" - -/*-------------------------------------------------------------------------- - * hypre_FACCreate - *--------------------------------------------------------------------------*/ -void * -hypre_FACCreate( MPI_Comm comm ) -{ - hypre_FACData *fac_data; - - fac_data = hypre_CTAlloc(hypre_FACData, 1, HYPRE_MEMORY_HOST); - - (fac_data -> comm) = comm; - (fac_data -> time_index) = hypre_InitializeTiming("FAC"); - - /* set defaults */ - (fac_data -> tol) = 1.0e-06; - (fac_data -> max_cycles) = 200; - (fac_data -> zero_guess) = 0; - (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 -> num_pre_smooth) = 1; - (fac_data -> num_post_smooth) = 1; - (fac_data -> csolver_type) = 1; - (fac_data -> logging) = 0; - - return (void *) fac_data; -} - -/*-------------------------------------------------------------------------- - * hypre_FACDestroy - *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_FACDestroy2(void *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_SStructGraphDestroy(hypre_SStructMatrixGraph((fac_data -> A_rap))); - HYPRE_SStructMatrixDestroy((fac_data -> A_rap)); - for (level = 0; level <= (fac_data -> max_levels); level++) - { - HYPRE_SStructMatrixDestroy( (fac_data -> A_level[level]) ); - HYPRE_SStructVectorDestroy( (fac_data -> x_level[level]) ); - HYPRE_SStructVectorDestroy( (fac_data -> b_level[level]) ); - HYPRE_SStructVectorDestroy( (fac_data -> r_level[level]) ); - HYPRE_SStructVectorDestroy( (fac_data -> e_level[level]) ); - hypre_SStructPVectorDestroy( (fac_data -> tx_level[level]) ); - - HYPRE_SStructGraphDestroy( (fac_data -> graph_level[level]) ); - HYPRE_SStructGridDestroy( (fac_data -> grid_level[level]) ); - - hypre_SStructMatvecDestroy( (fac_data -> matvec_data_level[level]) ); - hypre_SStructPMatvecDestroy((fac_data -> pmatvec_data_level[level]) ); - - hypre_SysPFMGRelaxDestroy( (fac_data -> relax_data_level[level]) ); - - if (level > 0) - { - hypre_FacSemiRestrictDestroy2( (fac_data -> restrict_data_level[level]) ); - } - - if (level < (fac_data -> max_levels)) - { - hypre_FacSemiInterpDestroy2( (fac_data -> interp_data_level[level]) ); - } - } - 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_SStructVectorDestroy(fac_data -> tx); - - hypre_TFree(fac_data -> level_to_part, HYPRE_MEMORY_HOST); - hypre_TFree(fac_data -> part_to_level, HYPRE_MEMORY_HOST); - hypre_TFree(fac_data -> refine_factors, HYPRE_MEMORY_HOST); - - if ( (fac_data -> csolver_type) == 1) - { - HYPRE_SStructPCGDestroy(fac_data -> csolver); - HYPRE_SStructSysPFMGDestroy(fac_data -> cprecond); - } - else if ((fac_data -> csolver_type) == 2) - { - HYPRE_SStructSysPFMGDestroy(fac_data -> csolver); - } - - if ((fac_data -> logging) > 0) - { - hypre_TFree(fac_data -> norms, HYPRE_MEMORY_HOST); - hypre_TFree(fac_data -> rel_norms, HYPRE_MEMORY_HOST); - } - - hypre_FinalizeTiming(fac_data -> time_index); - - hypre_TFree(fac_data, HYPRE_MEMORY_HOST); - } - - return (ierr); -} - -HYPRE_Int -hypre_FACSetTol( void *fac_vdata, - HYPRE_Real tol ) -{ - hypre_FACData *fac_data = (hypre_FACData *)fac_vdata; - HYPRE_Int ierr = 0; - - (fac_data -> tol) = tol; - - return ierr; -} - - -/*-------------------------------------------------------------------------- - * hypre_FACSetPLevels - *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_FACSetPLevels( void *fac_vdata, - HYPRE_Int nparts, - HYPRE_Int *plevels) -{ - hypre_FACData *fac_data = (hypre_FACData *)fac_vdata; - HYPRE_Int *fac_plevels; - HYPRE_Int ierr = 0; - HYPRE_Int i; - - fac_plevels = hypre_CTAlloc(HYPRE_Int, nparts, HYPRE_MEMORY_HOST); - - for (i = 0; i < nparts; i++) - { - fac_plevels[i] = plevels[i]; - } - - (fac_data -> plevels) = fac_plevels; - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_FACSetPRefinements - *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_FACSetPRefinements( void *fac_vdata, - HYPRE_Int nparts, - hypre_Index *prefinements ) -{ - hypre_FACData *fac_data = (hypre_FACData *)fac_vdata; - hypre_Index *fac_prefinements; - HYPRE_Int ierr = 0; - HYPRE_Int i; - - fac_prefinements = hypre_TAlloc(hypre_Index, nparts, HYPRE_MEMORY_HOST); - - for (i = 0; i < nparts; i++) - { - hypre_CopyIndex( prefinements[i], fac_prefinements[i] ); - } - - (fac_data -> prefinements) = fac_prefinements; - - return ierr; -} -/*-------------------------------------------------------------------------- - * hypre_FACSetMaxLevels - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_FACSetMaxLevels( void *fac_vdata, - HYPRE_Int nparts ) -{ - hypre_FACData *fac_data = (hypre_FACData *)fac_vdata; - HYPRE_Int ierr = 0; - - (fac_data -> max_levels) = nparts - 1; - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_FACSetMaxIter - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_FACSetMaxIter( void *fac_vdata, - HYPRE_Int max_iter ) -{ - hypre_FACData *fac_data = (hypre_FACData *)fac_vdata; - HYPRE_Int ierr = 0; - - (fac_data -> max_cycles) = max_iter; - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_FACSetRelChange - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_FACSetRelChange( void *fac_vdata, - HYPRE_Int rel_change ) -{ - hypre_FACData *fac_data = (hypre_FACData *)fac_vdata; - HYPRE_Int ierr = 0; - - (fac_data -> rel_change) = rel_change; - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_FACSetZeroGuess - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_FACSetZeroGuess( void *fac_vdata, - HYPRE_Int zero_guess ) -{ - hypre_FACData *fac_data = (hypre_FACData *)fac_vdata; - HYPRE_Int ierr = 0; - - (fac_data -> zero_guess) = zero_guess; - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_FACSetRelaxType - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_FACSetRelaxType( void *fac_vdata, - HYPRE_Int relax_type ) -{ - hypre_FACData *fac_data = (hypre_FACData *)fac_vdata; - HYPRE_Int ierr = 0; - - (fac_data -> relax_type) = relax_type; - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_FACSetJacobiWeight - *--------------------------------------------------------------------------*/ -HYPRE_Int -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; - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - * hypre_FACSetNumPreRelax - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_FACSetNumPreSmooth( void *fac_vdata, - HYPRE_Int num_pre_smooth ) -{ - hypre_FACData *fac_data = (hypre_FACData *)fac_vdata; - HYPRE_Int ierr = 0; - - (fac_data -> num_pre_smooth) = num_pre_smooth; - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_FACSetNumPostRelax - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_FACSetNumPostSmooth( void *fac_vdata, - HYPRE_Int num_post_smooth ) -{ - hypre_FACData *fac_data = (hypre_FACData *)fac_vdata; - HYPRE_Int ierr = 0; - - (fac_data -> num_post_smooth) = num_post_smooth; - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_FACSetCoarseSolverType - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_FACSetCoarseSolverType( void *fac_vdata, - HYPRE_Int csolver_type) -{ - hypre_FACData *fac_data = (hypre_FACData *)fac_vdata; - HYPRE_Int ierr = 0; - - (fac_data -> csolver_type) = csolver_type; - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_FACSetLogging - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_FACSetLogging( void *fac_vdata, - HYPRE_Int logging) -{ - hypre_FACData *fac_data = (hypre_FACData *)fac_vdata; - HYPRE_Int ierr = 0; - - (fac_data -> logging) = logging; - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_SysFACGetNumIterations - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_FACGetNumIterations( void *fac_vdata, - HYPRE_Int *num_iterations ) -{ - hypre_FACData *fac_data = (hypre_FACData *)fac_vdata; - HYPRE_Int ierr = 0; - - *num_iterations = (fac_data -> num_iterations); - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_FACPrintLogging - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_FACPrintLogging( void *fac_vdata, - HYPRE_Int myid) -{ - hypre_FACData *fac_data = (hypre_FACData *)fac_vdata; - HYPRE_Int ierr = 0; - HYPRE_Int i; - HYPRE_Int num_iterations = (fac_data -> num_iterations); - HYPRE_Int logging = (fac_data -> logging); - HYPRE_Real *norms = (fac_data -> norms); - HYPRE_Real *rel_norms = (fac_data -> rel_norms); - - if (myid == 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; -} - -/*-------------------------------------------------------------------------- - * hypre_FACGetFinalRelativeResidualNorm - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_FACGetFinalRelativeResidualNorm( void *fac_vdata, - HYPRE_Real *relative_residual_norm ) -{ - hypre_FACData *fac_data = (hypre_FACData *)fac_vdata; - - HYPRE_Int max_iter = (fac_data -> max_cycles); - HYPRE_Int num_iterations = (fac_data -> num_iterations); - HYPRE_Int logging = (fac_data -> logging); - HYPRE_Real *rel_norms = (fac_data -> rel_norms); - - HYPRE_Int ierr = 0; - - - if (logging > 0) - { - if (max_iter == 0) - { - ierr = 1; - } - else if (num_iterations == max_iter) - { - *relative_residual_norm = rel_norms[num_iterations - 1]; - } - else - { - *relative_residual_norm = rel_norms[num_iterations]; - } - } - - return ierr; -} - diff --git a/src/sstruct_ls/fac.h b/src/sstruct_ls/fac.h deleted file mode 100644 index 39bc6efc0b..0000000000 --- a/src/sstruct_ls/fac.h +++ /dev/null @@ -1,93 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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 FAC solver - * - *****************************************************************************/ -/*-------------------------------------------------------------------------- - * hypre_FACData: - *--------------------------------------------------------------------------*/ - -#ifndef hypre_FAC_HEADER -#define hypre_FAC_HEADER - -typedef struct -{ - MPI_Comm comm; - - HYPRE_Int *plevels; - hypre_Index *prefinements; - - HYPRE_Int max_levels; - HYPRE_Int *level_to_part; - HYPRE_Int *part_to_level; - hypre_Index *refine_factors; /* refine_factors[level] */ - - hypre_SStructGrid **grid_level; - hypre_SStructGraph **graph_level; - - hypre_SStructMatrix *A_rap; - hypre_SStructMatrix **A_level; - hypre_SStructVector **b_level; - hypre_SStructVector **x_level; - hypre_SStructVector **r_level; - hypre_SStructVector **e_level; - hypre_SStructPVector **tx_level; - hypre_SStructVector *tx; - - - void **matvec_data_level; - void **pmatvec_data_level; - void *matvec_data; - void **relax_data_level; - void **restrict_data_level; - void **interp_data_level; - - HYPRE_Int csolver_type; - HYPRE_SStructSolver csolver; - HYPRE_SStructSolver cprecond; - - HYPRE_Real tol; - HYPRE_Int max_cycles; - HYPRE_Int zero_guess; - HYPRE_Int relax_type; - HYPRE_Real jacobi_weight; /* weighted jacobi weight */ - HYPRE_Int usr_jacobi_weight; /* indicator flag for user weight */ - - HYPRE_Int num_pre_smooth; - HYPRE_Int num_post_smooth; - - /* log info (always logged) */ - HYPRE_Int num_iterations; - HYPRE_Int time_index; - HYPRE_Int rel_change; - HYPRE_Int logging; - HYPRE_Real *norms; - HYPRE_Real *rel_norms; - - -} hypre_FACData; - -/*-------------------------------------------------------------------------- - * Accessor macros: hypre_FACData - *--------------------------------------------------------------------------*/ - -#define hypre_FACDataMaxLevels(fac_data)\ -((fac_data) -> max_levels) -#define hypre_FACDataLevelToPart(fac_data)\ -((fac_data) -> level_to_part) -#define hypre_FACDataPartToLevel(fac_data)\ -((fac_data) -> part_to_level) -#define hypre_FACDataRefineFactors(fac_data)\ -((fac_data) -> refine_factors) -#define hypre_FACDataRefineFactorsLevel(fac_data, level)\ -((fac_data) -> refinements[level]) - - -#endif diff --git a/src/sstruct_ls/fac_CFInterfaceExtents.c b/src/sstruct_ls/fac_CFInterfaceExtents.c deleted file mode 100644 index 43df0ebf8a..0000000000 --- a/src/sstruct_ls/fac_CFInterfaceExtents.c +++ /dev/null @@ -1,208 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_sstruct_ls.h" -#include "fac.h" - -#define AbsStencilShape(stencil, abs_shape) \ -{\ - HYPRE_Int ii,jj,kk;\ - ii = hypre_IndexX(stencil);\ - jj = hypre_IndexY(stencil);\ - kk = hypre_IndexZ(stencil);\ - abs_shape= hypre_abs(ii) + hypre_abs(jj) + hypre_abs(kk); \ -} - -/*-------------------------------------------------------------------------- - * hypre_CFInterfaceExtents: Given a cgrid_box, a fgrid_box, and stencils, - * find the extents of the C/F interface (interface nodes in the C box). - * Boxes corresponding to stencil shifts are stored in the first stencil_size - * boxes, and the union of these are appended to the end of the returned - * box_array. - *--------------------------------------------------------------------------*/ -hypre_BoxArray * -hypre_CFInterfaceExtents( hypre_Box *fgrid_box, - hypre_Box *cgrid_box, - hypre_StructStencil *stencils, - hypre_Index rfactors ) -{ - - hypre_BoxArray *stencil_box_extents; - hypre_BoxArray *union_boxes; - hypre_Box *cfine_box; - hypre_Box *box; - - hypre_Index stencil_shape, cstart, zero_index, neg_index; - HYPRE_Int stencil_size; - HYPRE_Int abs_stencil; - - HYPRE_Int ndim = hypre_StructStencilNDim(stencils); - HYPRE_Int i, j; - - hypre_ClearIndex(zero_index); - hypre_ClearIndex(neg_index); - for (i = 0; i < ndim; i++) - { - neg_index[i] = -1; - } - hypre_CopyIndex(hypre_BoxIMin(cgrid_box), cstart); - - stencil_size = hypre_StructStencilSize(stencils); - stencil_box_extents = hypre_BoxArrayCreate(stencil_size, ndim); - union_boxes = hypre_BoxArrayCreate(0, ndim); - - for (i = 0; i < stencil_size; i++) - { - 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, - 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); - } - } - - /*-------------------------------------------------------------------------- - * Union the stencil_box_extents to get the full CF extents and append to - * the end of the stencil_box_extents BoxArray. Then shift the unioned boxes - * by cstart. - *--------------------------------------------------------------------------*/ - if (hypre_BoxArraySize(union_boxes) > 1) - { - hypre_UnionBoxes(union_boxes); - } - - hypre_ForBoxI(i, union_boxes) - { - 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++) - { - 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]; - } - } - - return stencil_box_extents; -} - -HYPRE_Int -hypre_CFInterfaceExtents2( hypre_Box *fgrid_box, - hypre_Box *cgrid_box, - hypre_StructStencil *stencils, - hypre_Index rfactors, - hypre_BoxArray *cf_interface ) -{ - - hypre_BoxArray *stencil_box_extents; - hypre_BoxArray *union_boxes; - hypre_Box *cfine_box; - - hypre_Index stencil_shape, zero_index, neg_index; - HYPRE_Int stencil_size; - HYPRE_Int abs_stencil; - - HYPRE_Int ndim = hypre_StructStencilNDim(stencils); - - HYPRE_Int i; - HYPRE_Int ierr = 0; - - hypre_ClearIndex(zero_index); - hypre_ClearIndex(neg_index); - for (i = 0; i < ndim; i++) - { - neg_index[i] = -1; - } - - stencil_size = hypre_StructStencilSize(stencils); - stencil_box_extents = hypre_BoxArrayCreate(stencil_size, ndim); - union_boxes = hypre_BoxArrayCreate(0, ndim); - - for (i = 0; i < stencil_size; i++) - { - 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, 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); - } - } - - /*-------------------------------------------------------------------------- - * Union the stencil_box_extents to get the full CF extents and append to - * the end of the stencil_box_extents BoxArray. - *--------------------------------------------------------------------------*/ - if (hypre_BoxArraySize(union_boxes) > 1) - { - hypre_UnionBoxes(union_boxes); - } - - hypre_ForBoxI(i, union_boxes) - { - 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/src/sstruct_ls/fac_amr_fcoarsen.c b/src/sstruct_ls/fac_amr_fcoarsen.c deleted file mode 100644 index 52cd8cf77c..0000000000 --- a/src/sstruct_ls/fac_amr_fcoarsen.c +++ /dev/null @@ -1,3623 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other - * HYPRE Project Developers. See the top-level COPYRIGHT file for details. - * - * SPDX-License-Identifier: (Apache-2.0 OR MIT) - ******************************************************************************/ - -/****************************************************************************** - * OpenMP Problems - * - * Need to fix the way these variables are set and incremented in loops: - * vals - * - ******************************************************************************/ - -#include "_hypre_sstruct_ls.h" -#include "_hypre_struct_mv.hpp" -#include "fac.h" - -#define MapStencilRank(stencil, rank) \ - { \ - HYPRE_Int ii,jj,kk; \ - ii = hypre_IndexX(stencil); \ - jj = hypre_IndexY(stencil); \ - kk = hypre_IndexZ(stencil); \ - if (ii==-1) \ - ii=2; \ - if (jj==-1) \ - jj=2; \ - if (kk==-1) \ - kk=2; \ - rank = ii + 3*jj + 9*kk; \ - } - -#define InverseMapStencilRank(rank, stencil) \ - { \ - HYPRE_Int ij,ii,jj,kk; \ - ij = (rank%9); \ - ii = (ij%3); \ - jj = (ij-ii)/3; \ - kk = (rank-3*jj-ii)/9; \ - if (ii==2) \ - ii= -1; \ - if (jj==2) \ - jj= -1; \ - if (kk==2) \ - kk= -1; \ - hypre_SetIndex3(stencil, ii, jj, kk); \ - } - - -#define AbsStencilShape(stencil, abs_shape) \ - { \ - HYPRE_Int ii,jj,kk; \ - ii = hypre_IndexX(stencil); \ - jj = hypre_IndexY(stencil); \ - kk = hypre_IndexZ(stencil); \ - abs_shape= hypre_abs(ii) + hypre_abs(jj) + hypre_abs(kk); \ - } - -/*-------------------------------------------------------------------------- - * hypre_AMR_FCoarsen: Coarsen the fbox and f/c connections. Forms the - * coarse operator by averaging neighboring connections in the refinement - * patch. - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_AMR_FCoarsen( hypre_SStructMatrix * A, - hypre_SStructMatrix * fac_A, - hypre_SStructPMatrix * A_crse, - hypre_Index refine_factors, - HYPRE_Int level ) - -{ - hypre_Box fine_box; - hypre_Box intersect_box; - - MPI_Comm comm = hypre_SStructMatrixComm(A); - - hypre_SStructGraph *graph = hypre_SStructMatrixGraph(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 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 = 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_StructMatrix *crse_smatrix; - HYPRE_Real *crse_ptr; - HYPRE_Real **crse_ptrs; - hypre_Box *crse_dbox; - - hypre_StructGrid *cgrid; - hypre_BoxArray *cgrid_boxes; - hypre_Box *cgrid_box; - hypre_Index cstart; - hypre_Index fstart, fend; - hypre_Index stridec, stridef; - - hypre_StructGrid *fgrid; - hypre_BoxArray *fgrid_boxes; - hypre_Box *fgrid_box; - hypre_BoxArray ***fgrid_crse_extents; - hypre_BoxArray ***fbox_interior; - hypre_BoxArrayArray ***fbox_bdy; - HYPRE_Int ***interior_fboxi; - HYPRE_Int ***bdy_fboxi; - HYPRE_Int ***cboxi_fboxes; - HYPRE_Int **cboxi_fcnt; - - hypre_BoxArray *fbox_interior_ci, *fbox_bdy_ci_fi; - hypre_BoxArrayArray *fbox_bdy_ci; - HYPRE_Int *interior_fboxi_ci; - HYPRE_Int *bdy_fboxi_ci; - - HYPRE_Int centre; - - hypre_BoxArray *data_space; - - HYPRE_Int ci, fi, arrayi; - HYPRE_Int max_stencil_size = 27; - HYPRE_Int trueV = 1; - HYPRE_Int falseV = 0; - HYPRE_Int found, sort; - HYPRE_Int stencil_marker; - 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 = NULL; - hypre_Box coarse_cell_box; - HYPRE_Int volume_coarse_cell_box; - HYPRE_Int *volume_shift_box = NULL; - HYPRE_Int max_contribut_size = 0, stencil_i; - HYPRE_BigInt startrank, rank; - HYPRE_Real *vals = NULL, *vals2 = NULL; - - HYPRE_Int i, j, k, l, m, n, ll, kk, jj; - HYPRE_Int nvars, var1, var2, var2_start; - HYPRE_Int iA_shift_z, iA_shift_zy, iA_shift_zyx; - - hypre_Index lindex; - hypre_Index index1, index2; - hypre_Index index_temp; - - HYPRE_Int **box_graph_indices; - HYPRE_Int *box_graph_cnts; - HYPRE_Int *box_ranks, *box_ranks_cnt, *box_to_ranks_cnt; - HYPRE_Int *cdata_space_ranks, *box_starts, *box_ends; - HYPRE_Int *box_connections; - HYPRE_Int **coarse_contrib_Uv; - HYPRE_Int *fine_interface_ranks; - HYPRE_Int nUventries = hypre_SStructGraphNUVEntries(graph); - HYPRE_Int *iUventries = hypre_SStructGraphIUVEntries(graph); - hypre_SStructUVEntry **Uventries = hypre_SStructGraphUVEntries(graph); - hypre_SStructUVEntry *Uventry; - HYPRE_Int nUentries, cnt1; - hypre_Index index, *cindex, *Uv_cindex; - HYPRE_Int box_array_size, cbox_array_size; - - HYPRE_Int nrows; - HYPRE_BigInt to_rank; - HYPRE_Int *ncols; - HYPRE_BigInt *rows, *cols; - HYPRE_Int **interface_max_stencil_ranks; - HYPRE_Int **interface_max_stencil_cnt; - HYPRE_Int **interface_rank_stencils; - HYPRE_Int **interface_stencil_ranks; - HYPRE_Int *coarse_stencil_cnt; - HYPRE_Real *stencil_vals; - HYPRE_Int *common_rank_stencils, *common_stencil_ranks; - HYPRE_Int *common_stencil_i; - hypre_BoxManEntry *boxman_entry; - - HYPRE_Int *temp1, *temp2; - HYPRE_Real *temp3; - HYPRE_Real sum_contrib, scaling; - - HYPRE_Int **OffsetA; - - HYPRE_Int *parents; - HYPRE_Int *parents_cnodes; - - HYPRE_Int myid; - - hypre_MPI_Comm_rank(comm, &myid); - - hypre_BoxInit(&fine_box, ndim); - 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 - * operator inside the fgrid. - *--------------------------------------------------------------------------*/ - - if (graph_type == HYPRE_SSTRUCT) - { - startrank = hypre_SStructGridGhstartRank(grid); - } - else if (graph_type == HYPRE_PARCSR) - { - 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++) - { - stridef[i] = refine_factors[i]; - } - for (i = ndim; i < 3; i++) - { - stridef[i] = 1; - } - - /*-------------------------------------------------------------------------- - * Scaling for averaging row sum. - *--------------------------------------------------------------------------*/ - scaling = 1.0; - for (i = 0; i < ndim - 2; i++) - { - scaling *= refine_factors[0]; - } - - /*-------------------------------------------------------------------------- - * Determine the coarsened fine grid- fgrid_crse_extents. - * These are between fpart= level and cpart= (level-1). The - * fgrid_crse_extents will be indexed by cboxes- the boxarray of coarsened - * fboxes FULLY in a given cbox. - * - * Also, determine the interior and boundary boxes of each fbox. Having - * these will allow us to determine the f/c interface nodes without - * extensive checking. These are also indexed by the cboxes. - * fgrid_interior- for each cbox, we have a collection of child fboxes, - * each leading to an interior=> boxarray - * fgrid_bdy - for each cbox, we have a collection of child fboxes, - * each leading to a boxarray of bdies=> boxarrayarray. - * Because we need to know the fbox id for these boxarray/boxarrayarray, - * we will need one for each fbox. - * - * And, determine which cboxes contain a given fbox. That is, given a - * fbox, find all cboxes that contain a chunk of it. - *--------------------------------------------------------------------------*/ - nvars = hypre_SStructPMatrixNVars(A_pmatrix); - - fgrid_crse_extents = hypre_TAlloc(hypre_BoxArray **, nvars, HYPRE_MEMORY_HOST); - fbox_interior = hypre_TAlloc(hypre_BoxArray **, nvars, HYPRE_MEMORY_HOST); - fbox_bdy = hypre_TAlloc(hypre_BoxArrayArray **, nvars, HYPRE_MEMORY_HOST); - interior_fboxi = hypre_TAlloc(HYPRE_Int **, nvars, HYPRE_MEMORY_HOST); - bdy_fboxi = hypre_TAlloc(HYPRE_Int **, nvars, HYPRE_MEMORY_HOST); - 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++) - { - 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); - - 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); - - /*----------------------------------------------------------------------- - * Determine the fine grid boxes that are underlying a coarse grid box. - * Coarsen the indices to determine the looping extents of these - * boxes. Also, find the looping extents for the extended coarsened - * boxes, and the interior and boundary extents of a fine_grid box. - * The fine_grid boxes must be adjusted so that only the coarse nodes - * inside these boxes are included. Only the lower bound needs to be - * adjusted. - *-----------------------------------------------------------------------*/ - hypre_ForBoxI(ci, cgrid_boxes) - { - 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); - - hypre_ClearIndex(index_temp); - hypre_ForBoxI(fi, fgrid_boxes) - { - fgrid_box = hypre_BoxArrayBox(fgrid_boxes, fi); - hypre_CopyIndex(hypre_BoxIMin(fgrid_box), fstart); - for (i = 0; i < ndim; i++) - { - j = fstart[i] % refine_factors[i]; - if (j) - { - fstart[i] += refine_factors[i] - j; - } - } - - hypre_StructMapFineToCoarse(fstart, index_temp, - refine_factors, hypre_BoxIMin(&fine_box)); - hypre_StructMapFineToCoarse(hypre_BoxIMax(fgrid_box), index_temp, - refine_factors, hypre_BoxIMax(&fine_box)); - - hypre_IntersectBoxes(&fine_box, cgrid_box, &intersect_box); - if (hypre_BoxVolume(&intersect_box) > 0) - { - temp1[cnt1++] = fi; - } - } - - 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++) - { - fgrid_box = hypre_BoxArrayBox(fgrid_boxes, temp1[fi]); - hypre_CopyIndex(hypre_BoxIMin(fgrid_box), fstart); - hypre_CopyIndex(hypre_BoxIMax(fgrid_box), fend); - - /*-------------------------------------------------------------------- - * record which sides will be adjusted- fstart adjustments will - * decrease the box size, whereas fend adjustments will increase the - * box size. Since we fstart decreases the box size, we cannot - * have an f/c interface at an adjusted fstart end. fend may - * 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++) - { - j = fstart[i] % refine_factors[i]; - if (j) - { - fstart[i] += refine_factors[i] - j; - index1[i] = 0; - } - - j = fend[i] % refine_factors[i]; - if (refine_factors[i] - 1 - j) - { - fend[i] += (refine_factors[i] - 1) - j; - } - } - - hypre_StructMapFineToCoarse(fstart, index_temp, - refine_factors, hypre_BoxIMin(&fine_box)); - hypre_StructMapFineToCoarse(hypre_BoxIMax(fgrid_box), index_temp, - refine_factors, hypre_BoxIMax(&fine_box)); - hypre_IntersectBoxes(&fine_box, cgrid_box, &intersect_box); - - hypre_CopyBox(&intersect_box, - hypre_BoxArrayBox(fgrid_crse_extents[var1][ci], fi)); - - /*-------------------------------------------------------------------- - * adjust the fine intersect_box so that we get the interior and - * boundaries separately. - *--------------------------------------------------------------------*/ - hypre_StructMapCoarseToFine(hypre_BoxIMin(&intersect_box), index_temp, - refine_factors, hypre_BoxIMin(&fine_box)); - - /* 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_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++) - { - 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]; - - hypre_SubtractBoxes(&fine_box, &loop_box, - hypre_BoxArrayArrayBoxArray(fbox_bdy[var1][ci], fi)); - bdy_fboxi[var1][ci][fi] = temp1[fi]; - } - hypre_TFree(temp1, HYPRE_MEMORY_HOST); - - } /* hypre_ForBoxI(ci, cgrid_boxes) */ - - /*-------------------------------------------------------------------- - * Determine the cboxes that contain a chunk of a given fbox. - *--------------------------------------------------------------------*/ - hypre_ForBoxI(fi, fgrid_boxes) - { - fgrid_box = hypre_BoxArrayBox(fgrid_boxes, fi); - hypre_CopyIndex(hypre_BoxIMin(fgrid_box), fstart); - for (i = 0; i < ndim; i++) - { - j = fstart[i] % refine_factors[i]; - if (j) - { - fstart[i] += refine_factors[i] - j; - } - } - - hypre_StructMapFineToCoarse(fstart, index_temp, - refine_factors, hypre_BoxIMin(&fine_box)); - 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); - hypre_ForBoxI(i, cgrid_boxes) - { - 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; - 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][i] = temp1[i]; - } - hypre_TFree(temp1, HYPRE_MEMORY_HOST); - } - } /* for (var1= 0; var1< nvars; var1++) */ - - /*-------------------------------------------------------------------------- - * STEP 1: - * COMPUTE THE COARSE LEVEL OPERATOR INSIDE OF A REFINED BOX. - * - * We assume that the coarse and fine grid variables are of the same type. - * - * Coarse stencils in the refinement patches are obtained by averaging the - * fine grid coefficients. Since we are assuming cell-centred discretization, - * we apply a weighted averaging of ONLY the fine grid coefficients along - * interfaces of adjacent agglomerated coarse cells. - * - * Since the stencil pattern is assumed arbitrary, we must determine the - * stencil pattern of each var1-var2 struct_matrix to get the correct - * contributing stencil coefficients, averaging weights, etc. - *--------------------------------------------------------------------------*/ - - /*-------------------------------------------------------------------------- - * Agglomerated coarse cell info. These are needed in defining the looping - * extents for averaging- i.e., we loop over extents determined by the - * size of the agglomerated coarse cell. - * Note that the agglomerated coarse cell is constructed correctly for - * any dimensions (1, 2, or 3). - *--------------------------------------------------------------------------*/ - 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_CopyIndex(index_temp, hypre_BoxIMax(&coarse_cell_box)); - - volume_coarse_cell_box = hypre_BoxVolume(&coarse_cell_box); - - - /*-------------------------------------------------------------------------- - * Offsets in y & z directions for refinement patches. These will be used - * for pointing to correct coarse stencil location. - *--------------------------------------------------------------------------*/ - OffsetA = hypre_CTAlloc(HYPRE_Int *, 2, HYPRE_MEMORY_HOST); - for (i = 0; i < 2; i++) - { - OffsetA[i] = hypre_CTAlloc(HYPRE_Int, refine_factors[i + 1], HYPRE_MEMORY_HOST); - } - - /*-------------------------------------------------------------------------- - * Stencil contribution cnts, weights, etc are computed only if we have - * a new stencil pattern. If the pattern is the same, the previously - * computed stencil contribution cnts, weights, etc can be used. - * - * 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++) - { - 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); - - - for (var2 = 0; var2 < nvars; var2++) - { - stencils = hypre_SStructPMatrixSStencil(A_crse, var1, var2); - if (stencils != NULL) - { - stencil_size = hypre_StructStencilSize(stencils); - - /*----------------------------------------------------------------- - * When stencil_marker== true, form the stencil contributions cnts, - * weights, etc. This occurs for the first non-null stencil or - * when the stencil shape of the current non-null stencil has a - * different stencil shape from that of the latest non-null stencil. - * - * But when stencil_marker== false, we must check to see if we - * need new stencil contributions cnts, weights, etc. Thus, find - * the latest non-null stencil for comparison. - *-----------------------------------------------------------------*/ - if (stencil_marker == falseV) - { - /* search for the first previous non-null stencil */ - found = falseV; - var2_start = var2 - 1; - for (j = var1; j >= 0; j--) - { - for (i = var2_start; i >= 0; i--) - { - stencils_last = hypre_SStructPMatrixSStencil(A_crse, j, i); - if (stencils_last != NULL) - { - found = trueV; - break; - } - } - if (found) - { - break; - } - else - { - var2_start = nvars - 1; - } - } - - /*-------------------------------------------------------------- - * Compare the stencil shape. - *--------------------------------------------------------------*/ - stencil_last_size = hypre_StructStencilSize(stencils_last); - if (stencil_last_size != stencil_size) - { - stencil_marker = trueV; - break; - } - else - { - 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), - 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]); - - AbsStencilShape(index_temp, abs_stencil_shape); - if (abs_stencil_shape) - { - 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++) - { - hypre_BoxDestroy(shift_box[i]); - } - hypre_TFree(shift_box, HYPRE_MEMORY_HOST); - hypre_TFree(volume_shift_box, HYPRE_MEMORY_HOST); - hypre_TFree(vals, HYPRE_MEMORY_HOST); - - for (j = 1; j < max_stencil_size; j++) - { - stencil_i = rank_stencils[j]; - if (stencil_i != -1) - { - hypre_TFree(stencil_contrib_i[stencil_i], HYPRE_MEMORY_HOST); - hypre_TFree(weight_contrib_i[stencil_i], HYPRE_MEMORY_HOST); - } - } - hypre_TFree(stencil_contrib_i, HYPRE_MEMORY_HOST); - hypre_TFree(weight_contrib_i, HYPRE_MEMORY_HOST); - hypre_TFree(rank_stencils, HYPRE_MEMORY_HOST); - } - - if (found) - { - break; - } - } /* for (i= 0; i< stencil_size; i++) */ - } /* else */ - } /* if (stencil_marker == false) */ - - /*----------------------------------------------------------------- - * If stencil_marker==true, form the contribution structures. - * Since the type of averaging is determined by the stencil shapes, - * we need a ranking of the stencil shape to allow for easy - * determination. - * - * top: 14 12 13 centre: 5 3 4 bottom 23 21 22 - * 11 9 10 2 0 1 20 18 19 - * 17 15 16 8 6 7 26 24 25 - * - * for stencil of max. size 27. - * - * stencil_contrib_cnt[i]= no. of fine stencils averaged to - * form stencil entry i. - * stencil_contrib_i[i] = rank of fine stencils contributing - * to form stencil entry i. - * weight_contrib_i[i] = array of weights for weighting - * the contributions to stencil entry i. - * stencil_ranks[i] = rank of stencil entry i. - * rank_stencils[i] = stencil entry of rank i. - *-----------------------------------------------------------------*/ - - if (stencil_marker == trueV) - { - - /* mark stencil_marker for the next stencil */ - stencil_marker = falseV; - - 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); - rank_stencils = hypre_TAlloc(HYPRE_Int, max_stencil_size, HYPRE_MEMORY_HOST); - 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++) - { - rank_stencils[i] = -1; - if (i < stencil_size) - { - stencil_ranks[i] = -1; - } - } - - /*----------------------------------------------------------------- - * Get mappings between stencil entries and ranks and vice versa; - * fine grid looping extents for averaging of the fine coefficients; - * and the number of fine grid values to be averaged. - * Note that the shift_boxes are constructed correctly for any - * dimensions. For j>=ndim, - * hypre_BoxIMin(shift_box[i])[j]=hypre_BoxIMax(shift_box[i])[j]= 0. - *-----------------------------------------------------------------*/ - 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; - 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]); - - hypre_AddIndexes(hypre_BoxIMin(shift_box[i]), - hypre_BoxIMax(&coarse_cell_box), 3, - hypre_BoxIMax(shift_box[i])); - - hypre_IntersectBoxes(&coarse_cell_box, shift_box[i], shift_box[i]); - - volume_shift_box[i] = hypre_BoxVolume(shift_box[i]); - } - - /*----------------------------------------------------------------- - * Derive the contribution info. - * The above rank table is used to determine the direction indices. - * Weight construction procedure valid for any dimensions. - *-----------------------------------------------------------------*/ - - /* east */ - stencil_i = rank_stencils[1]; - if (stencil_i != -1) - { - stencil_contrib_cnt[stencil_i]++; - 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 (i = 1; i <= 7; i += 3) - { - if (rank_stencils[j * 9 + i] != -1) /* bottom or top planes */ - { - 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] = - 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; - - 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]; - - 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]), - abs_stencil_shape ); - weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum += weights[abs_stencil_shape]; - } - } - - if (ndim > 2) - { - for (j = 1; j <= 2; j++) - { - for (i = 1; i <= 7; i += 3) - { - if (rank_stencils[j * 9 + i] != -1) - { - stencil_contrib_i[stencil_i][k] = rank_stencils[j * 9 + i]; - - AbsStencilShape( - 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]; - } - } - } - } - - for (i = 0; i < k ; i++) - { - weight_contrib_i[stencil_i][i] /= sum; - } - } - - - /* west */ - stencil_i = rank_stencils[2]; - if (stencil_i != -1) - { - stencil_contrib_cnt[stencil_i]++; - 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 (i = 2; i <= 8; i += 3) - { - 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] ); - } - - if (stencil_i != -1) - { - 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; - - 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]; - - 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]), - abs_stencil_shape ); - weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum += weights[abs_stencil_shape]; - } - } - - if (ndim > 2) - { - for (j = 1; j <= 2; j++) - { - for (i = 2; i <= 8; i += 3) - { - if (rank_stencils[j * 9 + i] != -1) - { - stencil_contrib_i[stencil_i][k] = rank_stencils[j * 9 + i]; - - AbsStencilShape( - 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]; - } - } - } - } - - for (i = 0; i < k ; i++) - { - weight_contrib_i[stencil_i][i] /= sum; - } - } - - - /* north */ - stencil_i = rank_stencils[3]; - if (stencil_i != -1) - { - stencil_contrib_cnt[stencil_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 (i = 3; i <= 5; i++) - { - 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] ); - } - - if (stencil_i != -1) - { - 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; - - 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]; - - 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]), - abs_stencil_shape ); - weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum += weights[abs_stencil_shape]; - } - } - - if (ndim > 2) - { - for (j = 1; j <= 2; j++) - { - for (i = 3; i <= 5; i++) - { - if (rank_stencils[j * 9 + i] != -1) - { - stencil_contrib_i[stencil_i][k] = rank_stencils[j * 9 + i]; - - AbsStencilShape( - 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]; - } - } - } - } - - for (i = 0; i < k ; i++) - { - weight_contrib_i[stencil_i][i] /= sum; - } - } - - /* south */ - stencil_i = rank_stencils[6]; - if (stencil_i != -1) - { - stencil_contrib_cnt[stencil_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 (i = 6; i <= 8; i++) - { - 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] ); - } - - - if (stencil_i != -1) - { - 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; - - 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]; - - 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]), - abs_stencil_shape ); - weight_contrib_i[stencil_i][k++] = weights[abs_stencil_shape]; - sum += weights[abs_stencil_shape]; - } - } - - if (ndim > 2) - { - for (j = 1; j <= 2; j++) - { - for (i = 6; i <= 8; i++) - { - if (rank_stencils[j * 9 + i] != -1) - { - stencil_contrib_i[stencil_i][k] = rank_stencils[j * 9 + i]; - - AbsStencilShape( - 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]; - } - } - } - } - - for (i = 0; i < k ; i++) - { - weight_contrib_i[stencil_i][i] /= sum; - } - } - - /*----------------------------------------------------------------- - * If only 2-d, extract the corner indices. - *-----------------------------------------------------------------*/ - if (ndim == 2) - { - /* corners: ne & nw */ - for (i = 4; i <= 5; 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); - weight_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Real, 1, HYPRE_MEMORY_HOST); - 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++) - { - 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); - weight_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Real, 1, HYPRE_MEMORY_HOST); - stencil_contrib_i[stencil_i][0] = stencil_i; - weight_contrib_i[stencil_i][0] = weights[0]; - } - } - } - - /*----------------------------------------------------------------- - * Additional directions for 3-dim case - *-----------------------------------------------------------------*/ - if (ndim > 2) - { - /* sides: top */ - stencil_i = rank_stencils[9]; - if (stencil_i != -1) - { - stencil_contrib_cnt[stencil_i]++; - for (i = 1; i <= 8; i++) - { - if (rank_stencils[9 + i] != -1) - { - 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] = - 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; - - 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]; - - for (i = 1; i <= 8; i++) - { - if (rank_stencils[9 + i] != -1) - { - stencil_contrib_i[stencil_i][k] = 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]; - } - } - - for (i = 0; i < k ; i++) - { - weight_contrib_i[stencil_i][i] /= sum; - } - } - - /* sides: bottom */ - stencil_i = rank_stencils[18]; - if (stencil_i != -1) - { - stencil_contrib_cnt[stencil_i]++; - for (i = 1; i <= 8; i++) - { - if (rank_stencils[18 + i] != -1) - { - 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] = - 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; - - 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]; - - for (i = 1; i <= 8; i++) - { - if (rank_stencils[18 + i] != -1) - { - stencil_contrib_i[stencil_i][k] = 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]; - } - } - - for (i = 0; i < k ; i++) - { - weight_contrib_i[stencil_i][i] /= sum; - } - } - - /* edges: cne */ - stencil_i = rank_stencils[4]; - if (stencil_i != -1) - { - stencil_contrib_cnt[stencil_i]++; - for (j = 1; j <= 2; j++) - { - 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] ); - } - - if (stencil_i != -1) - { - 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; - - 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]; - - for (j = 1; j <= 2; j++) - { - if (rank_stencils[j * 9 + 4] != -1) - { - stencil_contrib_i[stencil_i][k] = 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]; - } - } - - for (i = 0; i < k ; i++) - { - weight_contrib_i[stencil_i][i] /= sum; - } - } - - /* edges: cse */ - stencil_i = rank_stencils[7]; - if (stencil_i != -1) - { - stencil_contrib_cnt[stencil_i]++; - for (j = 1; j <= 2; j++) - { - 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] ); - } - - if (stencil_i != -1) - { - 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; - - 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]; - - for (j = 1; j <= 2; j++) - { - if (rank_stencils[j * 9 + 7] != -1) - { - stencil_contrib_i[stencil_i][k] = 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]; - } - } - - for (i = 0; i < k ; i++) - { - weight_contrib_i[stencil_i][i] /= sum; - } - } - - /* edges: cnw */ - stencil_i = rank_stencils[5]; - if (stencil_i != -1) - { - stencil_contrib_cnt[stencil_i]++; - for (j = 1; j <= 2; j++) - { - 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] ); - } - - if (stencil_i != -1) - { - 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; - - 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]; - - for (j = 1; j <= 2; j++) - { - if (rank_stencils[j * 9 + 5] != -1) - { - stencil_contrib_i[stencil_i][k] = 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]; - } - } - - for (i = 0; i < k ; i++) - { - weight_contrib_i[stencil_i][i] /= sum; - } - } - - /* edges: csw */ - stencil_i = rank_stencils[8]; - if (stencil_i != -1) - { - stencil_contrib_cnt[stencil_i]++; - for (j = 1; j <= 2; j++) - { - 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] ); - } - - if (stencil_i != -1) - { - 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; - - 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]; - - for (j = 1; j <= 2; j++) - { - if (rank_stencils[j * 9 + 8] != -1) - { - stencil_contrib_i[stencil_i][k] = 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]; - } - } - - for (i = 0; i < k ; i++) - { - weight_contrib_i[stencil_i][i] /= sum; - } - } - - /* edges: top east */ - stencil_i = rank_stencils[10]; - if (stencil_i != -1) - { - stencil_contrib_cnt[stencil_i]++; - for (i = 3; i <= 6; i += 3) - { - if (rank_stencils[10 + i] != -1) - { - 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] = - 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; - - 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]; - - for (i = 3; i <= 6; i += 3) - { - if (rank_stencils[10 + i] != -1) - { - stencil_contrib_i[stencil_i][k] = 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]; - } - } - - for (i = 0; i < k ; i++) - { - weight_contrib_i[stencil_i][i] /= sum; - } - } - - /* edges: top west */ - stencil_i = rank_stencils[11]; - if (stencil_i != -1) - { - stencil_contrib_cnt[stencil_i]++; - for (i = 3; i <= 6; i += 3) - { - if (rank_stencils[11 + i] != -1) - { - 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] = - 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; - - 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]; - - for (i = 3; i <= 6; i += 3) - { - if (rank_stencils[11 + i] != -1) - { - stencil_contrib_i[stencil_i][k] = 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]; - } - } - - for (i = 0; i < k ; i++) - { - weight_contrib_i[stencil_i][i] /= sum; - } - } - - /* edges: top north */ - stencil_i = rank_stencils[12]; - if (stencil_i != -1) - { - stencil_contrib_cnt[stencil_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] ); - } - - if (stencil_i != -1) - { - 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; - - 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]; - - for (i = 13; i <= 14; i++) - { - if (rank_stencils[i] != -1) - { - stencil_contrib_i[stencil_i][k] = 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]; - } - } - - for (i = 0; i < k ; i++) - { - weight_contrib_i[stencil_i][i] /= sum; - } - } - - /* edges: top south*/ - stencil_i = rank_stencils[15]; - if (stencil_i != -1) - { - stencil_contrib_cnt[stencil_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] ); - } - - if (stencil_i != -1) - { - 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; - - 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]; - - for (i = 16; i <= 17; i++) - { - if (rank_stencils[i] != -1) - { - stencil_contrib_i[stencil_i][k] = 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]; - } - } - - for (i = 0; i < k ; i++) - { - weight_contrib_i[stencil_i][i] /= sum; - } - } - - /* edges: bottom east */ - stencil_i = rank_stencils[19]; - if (stencil_i != -1) - { - stencil_contrib_cnt[stencil_i]++; - for (i = 3; i <= 6; i += 3) - { - if (rank_stencils[19 + i] != -1) - { - 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] = - 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; - - 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]; - - for (i = 3; i <= 6; i += 3) - { - if (rank_stencils[19 + i] != -1) - { - stencil_contrib_i[stencil_i][k] = 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]; - } - } - - for (i = 0; i < k ; i++) - { - weight_contrib_i[stencil_i][i] /= sum; - } - } - - /* edges: bottom west */ - stencil_i = rank_stencils[20]; - if (stencil_i != -1) - { - stencil_contrib_cnt[stencil_i]++; - for (i = 3; i <= 6; i += 3) - { - if (rank_stencils[20 + i] != -1) - { - 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] = - 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; - - 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]; - - for (i = 3; i <= 6; i += 3) - { - if (rank_stencils[20 + i] != -1) - { - stencil_contrib_i[stencil_i][k] = 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]; - } - } - - for (i = 0; i < k ; i++) - { - weight_contrib_i[stencil_i][i] /= sum; - } - } - - /* edges: bottom north */ - stencil_i = rank_stencils[21]; - if (stencil_i != -1) - { - stencil_contrib_cnt[stencil_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] ); - } - - if (stencil_i != -1) - { - 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; - - 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]; - - for (i = 22; i <= 23; i++) - { - if (rank_stencils[i] != -1) - { - stencil_contrib_i[stencil_i][k] = 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]; - } - } - - for (i = 0; i < k ; i++) - { - weight_contrib_i[stencil_i][i] /= sum; - } - } - - /* edges: bottom south*/ - stencil_i = rank_stencils[24]; - if (stencil_i != -1) - { - stencil_contrib_cnt[stencil_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] ); - } - - if (stencil_i != -1) - { - 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; - - 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]; - - for (i = 25; i <= 26; i++) - { - if (rank_stencils[i] != -1) - { - stencil_contrib_i[stencil_i][k] = 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]; - } - } - - for (i = 0; i < k ; i++) - { - weight_contrib_i[stencil_i][i] /= sum; - } - } - - /* corners*/ - for (j = 1; j <= 2; j++) - { - for (i = 4; i <= 5; 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); - weight_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Real, 1, HYPRE_MEMORY_HOST); - stencil_contrib_i[stencil_i][0] = stencil_i; - weight_contrib_i[stencil_i][0] = weights[0]; - } - } - for (i = 7; i <= 8; 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); - weight_contrib_i[stencil_i] = hypre_TAlloc(HYPRE_Real, 1, HYPRE_MEMORY_HOST); - stencil_contrib_i[stencil_i][0] = stencil_i; - weight_contrib_i[stencil_i][0] = weights[0]; - } - } - } - - } /* if ndim > 2 */ - /*----------------------------------------------------------------- - * Allocate for the temporary vector used in computing the - * averages. - *-----------------------------------------------------------------*/ - vals = hypre_CTAlloc(HYPRE_Real, max_contribut_size, HYPRE_MEMORY_HOST); - - /*----------------------------------------------------------------- - * coarse grid stencil contributor structures have been formed. - *-----------------------------------------------------------------*/ - } /* if (stencil_marker == true) */ - - /*--------------------------------------------------------------------- - * Loop over gridboxes to average stencils - *---------------------------------------------------------------------*/ - smatrix_var = hypre_SStructPMatrixSMatrix(A_pmatrix, 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); - - hypre_ForBoxI(ci, cgrid_boxes) - { - 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]; - bdy_fboxi_ci = bdy_fboxi[var1][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++) - { - hypre_CopyIndex(hypre_StructStencilElement(stencils, i), 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); - /*-------------------------------------------------------------- - * 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++) - { - hypre_CopyIndex(hypre_StructStencilElement(stencils, i), - stencil_shape_i); - a_ptrs[i] = - hypre_StructMatrixExtractPointerByIndex(smatrix_var, - interior_fboxi_ci[fi], - stencil_shape_i); - } - - /*--------------------------------------------------------------- - * Compute the offsets for pointing to the correct data. - * Note that for 1-d, OffsetA[j][i]= 0. Therefore, this ptr - * will be correct for 1-d. - *---------------------------------------------------------------*/ - for (j = 0; j < 2; j++) - { - OffsetA[j][0] = 0; - for (i = 1; i < refine_factors[j + 1]; i++) - { - if (j == 0) - { - hypre_SetIndex3(index_temp, 0, i, 0); - } - else - { - hypre_SetIndex3(index_temp, 0, 0, i); - } - OffsetA[j][i] = hypre_BoxOffsetDistance(A_dbox, index_temp); - } - } - - hypre_CopyIndex(hypre_BoxIMin(fgrid_box), fstart); - hypre_CopyIndex(hypre_BoxIMax(fgrid_box), fend); - - /* coarsen the interior patch box*/ - hypre_ClearIndex(index_temp); - hypre_StructMapFineToCoarse(fstart, index_temp, stridef, - hypre_BoxIMin(&fine_box)); - hypre_StructMapFineToCoarse(fend, index_temp, stridef, - hypre_BoxIMax(&fine_box)); - - hypre_CopyIndex(hypre_BoxIMin(&fine_box), cstart); - - /*---------------------------------------------------------------- - * Loop over interior grid box. - *----------------------------------------------------------------*/ - - hypre_BoxGetSize(&fine_box, loop_size); - - hypre_SerialBoxLoop2Begin(ndim, loop_size, - A_dbox, fstart, stridef, iA, - crse_dbox, cstart, stridec, iAc); - { - for (i = 0; i < stencil_size; i++) - { - rank = stencil_ranks[i]; - - /*------------------------------------------------------------ - * Loop over refinement agglomeration making up a coarse cell - * when a non-centre stencil. - *------------------------------------------------------------*/ - if (rank) - { - /*-------------------------------------------------------- - * Loop over refinement agglomeration extents making up a - * a coarse cell. - *--------------------------------------------------------*/ - 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++) - { - vals[m] = 0.0; - } - - /*-------------------------------------------------------- - * For 1-d, index1[l]= index2[l]= 0, l>=1. So - * iA_shift_zyx= j, - * which is correct. Similarly, 2-d is correct. - *--------------------------------------------------------*/ - 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_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_contrib_cnt[i]; m++) - { - stencil_i = stencil_contrib_i[i][m]; - vals[m] += a_ptrs[stencil_i][iA_shift_zyx]; - } - } - } - } - /*---------------------------------------------------------- - * 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] += vals[m] * weight_contrib_i[i][m]; - } - crse_ptrs[i][iAc] /= volume_shift_box[i]; - - } /* if (rank) */ - } /* for i */ - - /*------------------------------------------------------------------ - * centre stencil: - * The centre stencil is computed so that the row sum is equal to - * the sum of the row sums of the fine matrix. Uses the computed - * coarse off-diagonal stencils. - * - * No fine-coarse interface for the interior boxes. - *------------------------------------------------------------------*/ - 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++) - { - 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_zyx = iA_shift_zy + j; - for (m = 0; m < stencil_size; m++) - { - sum += a_ptrs[m][iA_shift_zyx]; - } - } - } - } - - /*--------------------------------------------------------------- - * coarse centre coefficient- when away from the fine-coarse - * interface, the centre coefficient is the sum of the - * off-diagonal components. - *---------------------------------------------------------------*/ - sum /= scaling; - for (m = 0; m < stencil_size; m++) - { - rank = stencil_ranks[m]; - if (rank) - { - sum -= crse_ptrs[m][iAc]; - } - } - crse_ptrs[ rank_stencils[0] ][iAc] = sum; - } - hypre_SerialBoxLoop2End(iA, iAc); - } /* end hypre_ForBoxI(fi, fbox_interior_ci) */ - - /*------------------------------------------------------------------ - * Loop over the boundaries of each patch inside cgrid_box. - *------------------------------------------------------------------*/ - hypre_ForBoxArrayI(arrayi, fbox_bdy_ci) - { - 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); - - /*----------------------------------------------------------- - * 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++) - { - hypre_CopyIndex(hypre_StructStencilElement(stencils, i), - stencil_shape_i); - a_ptrs[i] = - hypre_StructMatrixExtractPointerByIndex(smatrix_var, - bdy_fboxi_ci[arrayi], - stencil_shape_i); - } - - /*-------------------------------------------------------------- - * Compute the offsets for pointing to the correct data. - *--------------------------------------------------------------*/ - for (j = 0; j < 2; j++) - { - OffsetA[j][0] = 0; - for (i = 1; i < refine_factors[j + 1]; i++) - { - if (j == 0) - { - hypre_SetIndex3(index_temp, 0, i, 0); - } - else - { - hypre_SetIndex3(index_temp, 0, 0, i); - } - OffsetA[j][i] = hypre_BoxOffsetDistance(A_dbox, index_temp); - } - } - - hypre_CopyIndex(hypre_BoxIMin(fgrid_box), fstart); - hypre_CopyIndex(hypre_BoxIMax(fgrid_box), fend); - - /* coarsen the patch box*/ - hypre_ClearIndex(index_temp); - hypre_StructMapFineToCoarse(fstart, index_temp, stridef, - hypre_BoxIMin(&fine_box)); - hypre_StructMapFineToCoarse(fend, index_temp, stridef, - hypre_BoxIMax(&fine_box)); - - hypre_CopyIndex(hypre_BoxIMin(&fine_box), cstart); - - /*-------------------------------------------------------------- - * Loop over boundary grid box. - *--------------------------------------------------------------*/ - - hypre_BoxGetSize(&fine_box, loop_size); - - hypre_SerialBoxLoop2Begin(ndim, loop_size, - A_dbox, fstart, stridef, iA, - crse_dbox, cstart, stridec, iAc); - { - zypre_BoxLoopGetIndex(lindex); - for (i = 0; i < stencil_size; i++) - { - rank = stencil_ranks[i]; - - /*-------------------------------------------------------- - * Loop over refinement agglomeration making up a coarse - * cell when a non-centre stencil. - *--------------------------------------------------------*/ - if (rank) - { - /*----------------------------------------------------- - * Loop over refinement agglomeration extents making up - * a coarse cell. - *-----------------------------------------------------*/ - 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++) - { - vals[m] = 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_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_contrib_cnt[i]; m++) - { - stencil_i = stencil_contrib_i[i][m]; - vals[m] += a_ptrs[stencil_i][iA_shift_zyx]; - } - } - } - } - /*--------------------------------------------------------- - * 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] += vals[m] * weight_contrib_i[i][m]; - } - crse_ptrs[i][iAc] /= volume_shift_box[i]; - - } /* if (rank) */ - } /* for i */ - - /*--------------------------------------------------------------- - * centre stencil: - * The centre stencil is computed so that the row sum is equal to - * th sum of the row sums of the fine matrix. Uses the computed - * coarse off-diagonal stencils. - * - * Along the fine-coarse interface, we need to add the unstructured - * connections. - *---------------------------------------------------------------*/ - 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); - - /*--------------------------------------------------------------- - * 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++) - { - 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_zyx = iA_shift_zy + j; - jj = kk + j; - for (m = 0; m < stencil_size; m++) - { - temp3[jj] += a_ptrs[m][iA_shift_zyx]; - } - } - } - } - - /*------------------------------------------------------------ - * extract all unstructured connections. Note that we extract - * from sstruct_matrix A, which already has been assembled. - *------------------------------------------------------------*/ - 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++) - { - 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++) - { - jj = kk + j; - - hypre_SetIndex3(index_temp, - 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, - var1, &boxman_entry); - 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 = trueV; - } - - if (found) - { - Uventry = hypre_SStructGraphUVEntry(graph, rank - startrank); - - if (Uventry != NULL) - { - nUentries = hypre_SStructUVEntryNUEntries(Uventry); - - m = 0; - for (i = 0; i < nUentries; i++) - { - if (hypre_SStructUVEntryToPart(Uventry, i) == part_crse) - { - m++; - } - } /* for (i= 0; i< nUentries; i++) */ - - temp2[jj] = m; - cnt1 += m; - - } /* if (Uventry != NULL) */ - } /* if (found) */ - - } /* for (j= index1[0]; j<= index2[0]; j++) */ - } /* 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[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); - - 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++) - { - kk = ll + k * refine_factors[0]; - for (j = index1[0]; j <= index2[0]; j++) - { - jj = kk + j; - - hypre_SetIndex3(index_temp, - 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, - var1, &boxman_entry); - hypre_SStructBoxManEntryGetGlobalRank(boxman_entry, index_temp, - &rank, matrix_type); - - 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) - { - found = trueV; - } - } - - if (found) - { - Uventry = hypre_SStructGraphUVEntry(graph, (HYPRE_Int)(rank - startrank)); - - if (Uventry != NULL) - { - nUentries = hypre_SStructUVEntryNUEntries(Uventry); - for (i = 0; i < nUentries; i++) - { - if (hypre_SStructUVEntryToPart(Uventry, i) == part_crse) - { - rows[cnt1] = rank; - cols[cnt1++] = hypre_SStructUVEntryToRank(Uventry, i); - } - - } /* for (i= 0; i< nUentries; i++) */ - } /* if (Uventry != NULL) */ - } /* if (found) */ - - } /* for (j= index1[0]; j<= index2[0]; j++) */ - } /* for (k= index1[1]; k<= index2[1]; k++) */ - } /* for (l= index1[2]; l<= index2[2]; l++) */ - - HYPRE_IJMatrixGetValues(ij_A, cnt1, ncols, rows, cols, vals2); - - 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++) - { - kk = ll + k * refine_factors[0]; - for (j = index1[0]; j <= index2[0]; j++) - { - jj = kk + j; - for (m = 0; m < temp2[jj]; m++) - { - temp3[jj] += vals2[cnt1]; - cnt1++; - } - 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++) */ - - hypre_TFree(ncols, HYPRE_MEMORY_HOST); - hypre_TFree(rows, HYPRE_MEMORY_HOST); - hypre_TFree(cols, HYPRE_MEMORY_HOST); - hypre_TFree(vals2, HYPRE_MEMORY_HOST); - hypre_TFree(temp2, HYPRE_MEMORY_HOST); - - } /* if Uventries > 0 */ - - 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++) - { - kk = ll + k * refine_factors[0]; - for (j = index1[0]; j <= index2[0]; j++) - { - jj = kk + j; - sum += temp3[jj]; - } - } - } - - sum /= scaling; - crse_ptrs[ rank_stencils[0] ][iAc] = sum; - - hypre_TFree(temp3, HYPRE_MEMORY_HOST); - - } - hypre_SerialBoxLoop2End(iA, iAc); - - } /* hypre_ForBoxI(fi, fbox_bdy_ci_fi) */ - } /* hypre_ForBoxArrayI(arrayi, fbox_bdy_ci) */ - } /* hypre_ForBoxI(ci, cgrid_boxes) */ - - hypre_TFree(a_ptrs, HYPRE_MEMORY_HOST); - hypre_TFree(crse_ptrs, HYPRE_MEMORY_HOST); - - } /* if (stencils != NULL) */ - } /* end var2 */ - } /* 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++) - { - 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++) - { - 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); - } - - if (weight_contrib_i) - { - for (j = 1; j < max_stencil_size; 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++) - { - if (OffsetA[j]) - { - hypre_TFree(OffsetA[j], HYPRE_MEMORY_HOST); - } - } - hypre_TFree(OffsetA, HYPRE_MEMORY_HOST); - } - - /*-------------------------------------------------------------------------- - * STEP 2: - * - * Interface coarsening: fine-to-coarse connections. We are - * assuming that only like-variables couple along interfaces. - * - * The task is to coarsen all the fine-to-coarse unstructured - * connections and to compute coarse coefficients along the - * interfaces (coarse-to-fine coefficients are obtained from these - * computed values assuming symmetry). This involves - * 1) scanning over the graph entries to find the locations of - * the unstructure connections; - * 2) determining the stencil shape of the coarsened connections; - * 3) averaging the unstructured coefficients to compute - * coefficient entries for the interface stencils; - * 4) determining the weights of the interface stencil coefficients - * to construct the structured coarse grid matrix along the - * interfaces. - * - * We perform this task by - * 1) scanning over the graph entries to group the locations - * of the fine-to-coarse connections wrt the boxes of the - * fine grid. Temporary vectors storing the Uventries indices - * and the number of connections for each box will be created; - * 2) for each fine grid box, group the fine-to-coarse connections - * with respect to the connected coarse nodes. Temporary vectors - * storing the Uventry indices and the Uentry indices for each - * coarse node will be created (i.e., for a fixed coarse grid node, - * record the fine node Uventries indices that connect to this - * coarse node and Uentry index of the Uventry that contains - * this coarse node.). The grouping is accomplished comparing the - * ranks of the coarse nodes; - * 3) using the Uventries and Uentry indices for each coarse node, - * "coarsen" the fine grid connections to this coarse node to - * create interface stencils (wrt to the coarse nodes- i.e., - * the centre of the stencil is at a coarse node). Also, find - * the IJ rows and columns corresponding to all the fine-to-coarse - * connections in a box, and extract the unstructured coefficients; - * 4) looping over all coarse grid nodes connected to a fixed fine box, - * compute the arithmetically averaged interface stencils; - * 5) compare the underlying coarse grid structured stencil shape - * to the interface stencil shape to determine how to weight the - * averaged interface stencil coefficients. - * - * EXCEPTION: A NODE CAN CONTAIN ONLY UNSTRUCTURED CONNECTIONS - * BETWEEN ONLY TWO AMR LEVELS- I.E., WE CANNOT HAVE A NODE THAT - * IS ON THE INTERFACE OF MORE THAN TWO AMR LEVELS. CHANGES TO - * HANDLE THIS LATTER CASE WILL INVOLVE THE SEARCH FOR f/c - * CONNECTIONS. - *-----------------------------------------------------------------*/ - if (nUventries > 0) - { - nvars = hypre_SStructPMatrixNVars(A_pmatrix); - - 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_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); - MapStencilRank( stencil_shape_i, stencil_ranks[i] ); - rank_stencils[ stencil_ranks[i] ] = i; - } - /*----------------------------------------------------------------- - * qsort the ranks into ascending order - *-----------------------------------------------------------------*/ - 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); - - 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_ends = hypre_CTAlloc(HYPRE_Int, hypre_BoxArraySize(fgrid_boxes), HYPRE_MEMORY_HOST); - hypre_SStructGraphFindSGridEndpts(graph, part_fine, var1, myid, - 0, box_starts); - hypre_SStructGraphFindSGridEndpts(graph, part_fine, var1, myid, - 1, box_ends); - - /*----------------------------------------------------------------- - * Step 1: scanning over the graph entries to group the locations - * of the unstructured connections wrt to fine grid boxes. - * - * Count the components that couple for each box. - * - * box_graph_indices[fi]= array of Uventries indices in box fi. - * box_graph_cnts[fi] = number of Uventries in box fi. - * cdata_space_rank[ci] = begin offset rank of coarse data_space - * box ci. - *-----------------------------------------------------------------*/ - 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); - - 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[i] = cdata_space_ranks[i - 1] + - hypre_BoxVolume(hypre_BoxArrayBox(data_space, i - 1)); - } - - /*----------------------------------------------------------------- - * Scanning obtained by searching iUventries between the start - * and end of a fine box. Binary search used to find the interval - * between these two endpts. Index (-1) returned if no interval - * 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++) - { - 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); - - for (k = 0; k < (j - i + 1); k++) - { - Uventry = hypre_SStructGraphUVEntry(graph, - iUventries[i + k]); - - 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_cnts[fi]++; - break; - } - } /* for (m= 0; m< hypre_SStructUVEntryNUEntries(Uventry); m++) */ - } /* for (k= 0; k< (j-i+1); k++) */ - } /* if (i >= 0) */ - } /* for (fi= 0; fi< box_array_size; fi++) */ - - /*----------------------------------------------------------------- - * Step 2: - * Determine and group the fine-to-coarse connections in a box. - * Grouped according to the coarsened fine grid interface nodes. - * - * box_ranks = ranks of coarsened fine grid interface - * nodes. - * box_connections = counter for the distinct coarsened fine - * grid interface nodes. This can be - * used to group all the Uventries of a - * coarsened fine grid node. - * cindex[l] = the hypre_Index of coarsen node l. - * parents_cnodes[l] = parent box that contains the coarsened - * fine grid interface node l. - * fine_interface_ranks[l]= rank of coarsened fine grid interface - * node l. - * box_ranks_cnt[l] = counter for no. of Uventries for - * coarsened node l. - * coarse_contrib_Uv[l] = Uventry indices for Uventries that - * contain fine-to-coarse connections of - * coarse node l. - *-----------------------------------------------------------------*/ - for (fi = 0; fi < box_array_size; fi++) - { - /*------------------------------------------------------------- - * Determine the coarse data ptrs corresponding to fine box fi. - * These are needed in assigning the averaged unstructured - * coefficients. - * - * Determine how many distinct coarse grid nodes are in the - * unstructured connection for a given box. Each node has a - * structures. - * - * temp1 & temp2 are linked lists vectors used for grouping the - * Uventries for a given coarse node. - *-------------------------------------------------------------*/ - 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); - 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); - - /*------------------------------------------------------------- - * determine the parent box of this fgrid_box. - *-------------------------------------------------------------*/ - hypre_ClearIndex(index_temp); - for (i = 0; i < box_graph_cnts[fi]; i++) - { - Uventry = Uventries[box_graph_indices[fi][i]]; - - /*------------------------------------------------------------- - * Coarsen the fine grid interface nodes and then get their - * ranks. The correct coarse grid is needed to determine the - * correct data_box. - * Save the rank of the coarsened index & the parent box id. - *-------------------------------------------------------------*/ - hypre_CopyIndex(hypre_SStructUVEntryIndex(Uventry), index); - hypre_StructMapFineToCoarse(index, index_temp, stridef, Uv_cindex[i]); - hypre_BoxSetExtents(&fine_box, Uv_cindex[i], Uv_cindex[i]); - - ci = 0; - for (j = 0; j < cboxi_fcnt[var1][fi]; j++) - { - 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) - { - break; - } - } - - parents[i] = ci; - 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; - j = 0; - temp1[cnt1] = j; - - for (i = 0; i < box_graph_cnts[fi]; i++) - { - if (box_ranks[i] != -1) - { - k = box_ranks[i]; - box_connections[i] = cnt1; - temp2[j++] = box_graph_indices[fi][i]; - - for (l = i + 1; l < box_graph_cnts[fi]; l++) - { - if (box_ranks[l] == k) - { - box_connections[l] = cnt1; - temp2[j++] = box_graph_indices[fi][l]; - box_ranks[l] = -1; - } - } - cnt1++; - temp1[cnt1] = j; - } - } - - /*----------------------------------------------------------------- - * Store the graph entry info and other index info for each coarse - * grid node. - *-----------------------------------------------------------------*/ - parents_cnodes = 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++) - { - if (box_ranks[i] != -1) - { - j = box_connections[i]; - parents_cnodes[j] = parents[i]; - 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]; - 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++) - { - 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: - * Create the interface stencils. - * - * interface_max_stencil_ranks[i] = stencil_shape rank for each coarse - * Uentry connection of coarsened node - * i (i.e., the stencil_shape ranks of - * the interface stencils at node i). - * interface_max_stencil_cnt[i][m]= counter for number of Uentries - * that describes a connection which - * coarsens into stencil_shape rank m. - * coarse_stencil_cnts[i] = counter for the no. of distinct - * interface stencil_shapes (i.e., the - * no. entries of the interface stencil). - * interface_stencil_ranks[i][l] = stencil_shape rank for interface - * stencil entry l, for coarse node i. - * interface_rank_stencils[i][j] = interface stencil entry for - * stencil_shape rank j, for node i. - *------------------------------------------------------------------------*/ - - /*----------------------------------------------------------------- - * Extract rows & cols info for extracting data from IJ matrix. - * Extract for all connections for a box. - *-----------------------------------------------------------------*/ - hypre_ClearIndex(index_temp); - - 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++) - { - Uventry = Uventries[ coarse_contrib_Uv[i][j] ]; - for (k = 0; k < hypre_SStructUVEntryNUEntries(Uventry); k++) - { - if (hypre_SStructUVEntryToPart(Uventry, k) == part_crse) - { - 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[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); - - 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); - - 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_cnt[i] = hypre_CTAlloc(HYPRE_Int, max_stencil_size, HYPRE_MEMORY_HOST); - - /*----------------------------------------------------------------- - * conjugate the coarse node index for determining the stencil - * shapes for the Uentry connections. - *-----------------------------------------------------------------*/ - 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++) - { - /*-------------------------------------------------------------- - * extract the row rank for a given Uventry. Note that these - * are the ranks in the grid of A. Therefore, we grab the index - * from the nested_graph Uventry to determine the global rank. - * With the rank, find the corresponding Uventry of the graph - * of A. The to_ranks now can be extracted out. - *--------------------------------------------------------------*/ - Uventry = Uventries[ coarse_contrib_Uv[i][j] ]; - hypre_CopyIndex(hypre_SStructUVEntryIndex(Uventry), index); - - 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); - - 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; - - /*--------------------------------------------------------- - * compute stencil shape for this Uentry. - *---------------------------------------------------------*/ - 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_cnt[i][m]++; - } - } - } - hypre_TFree(coarse_contrib_Uv[i], HYPRE_MEMORY_HOST); - - /*----------------------------------------------------------------- - * Determine only the distinct stencil ranks for coarse node i. - *-----------------------------------------------------------------*/ - l = 0; - for (j = 0; j < max_stencil_size; j++) - { - if (interface_max_stencil_cnt[i][j]) - { - l++; - } - } - - 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++) - { - if (interface_max_stencil_cnt[i][j]) - { - interface_rank_stencils[i][j] = l; - interface_stencil_ranks[i][l] = j; - l++; - } - } - } /* for (i= 0; i< cnt1; i++) */ - - hypre_TFree(coarse_contrib_Uv, HYPRE_MEMORY_HOST); - hypre_TFree(box_ranks_cnt, HYPRE_MEMORY_HOST); - hypre_TFree(cindex, HYPRE_MEMORY_HOST); - - /*----------------------------------------------------------------- - * Extract data from IJ matrix - *-----------------------------------------------------------------*/ - HYPRE_IJMatrixGetValues(ij_A, nrows, ncols, rows, cols, vals); - - hypre_TFree(ncols, HYPRE_MEMORY_HOST); - hypre_TFree(rows, HYPRE_MEMORY_HOST); - hypre_TFree(cols, HYPRE_MEMORY_HOST); - - /*----------------------------------------------------------------- - * Steps 4 & 5: - * Compute the arithmetically averaged interface stencils, - * and determine the interface stencil weights. - * - * stencil_vals[l] = averaged stencil coeff for interface - * stencil entry l. - * common_rank_stencils = final structured coarse stencil entries - * for the stencil_shapes that the - * interface stencils must collapse to. - * common_stencil_ranks = final structured coarse stencil_shape - * ranks for the stencil_shapes that the - * interface stencils must collapse to. - * common_stencil_i = stencil entry of the interface stencil - * corresponding to the common - * stencil_shape. - *-----------------------------------------------------------------*/ - k = 0; - for (i = 0; i < cnt1; i++) - { - 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++) - { - 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); - hypre_TFree(interface_max_stencil_cnt[i], HYPRE_MEMORY_HOST); - hypre_TFree(interface_rank_stencils[i], HYPRE_MEMORY_HOST); - - /*----------------------------------------------------------------- - * Determine which stencil has to be formed. This is accomplished - * by comparing the coarse grid stencil ranks with the computed - * interface stencil ranks. We qsort (if there are more than one - * rank) the ranks to give quick comparisons. Note that we need - * to swap the elements of stencil_vals & fine_interface_ranks[i]'s - * accordingly. - *-----------------------------------------------------------------*/ - - sort = falseV; - for (j = 0; j < (coarse_stencil_cnt[i] - 1); j++) - { - if (interface_stencil_ranks[i][j] > interface_stencil_ranks[i][j + 1]) - { - sort = trueV; - break; - } - } - - 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[j] = j; - } - - hypre_qsort1(interface_stencil_ranks[i], (HYPRE_Real *) temp1, 0, - 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++) - { - m = temp1[j]; - temp3[j] = stencil_vals[m]; - } - for (j = 0; j < coarse_stencil_cnt[i]; j++) - { - stencil_vals[j] = temp3[j]; - } - - hypre_TFree(temp1, HYPRE_MEMORY_HOST); - hypre_TFree(temp3, HYPRE_MEMORY_HOST); - } - - /*----------------------------------------------------------------- - * Compute the weights for the averaged stencil contributions. - * 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++) - { - InverseMapStencilRank(interface_stencil_ranks[i][j], index_temp); - AbsStencilShape(index_temp, abs_stencil_shape); - temp3[j] = weights[abs_stencil_shape]; - } - - /*----------------------------------------------------------------- - * Compare the coarse stencil and the interface stencil and - * extract the common stencil shapes. - * 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_stencil_i = hypre_TAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); - - 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]) ) - { - l++; - } - - if (l >= coarse_stencil_cnt[i]) - { - break; - } - /*-------------------------------------------------------------- - * Check if a common stencil shape rank has been found. - *--------------------------------------------------------------*/ - 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_stencil_i[m++] = l; - l++; - } - } - /*----------------------------------------------------------------- - * Find the contribution and weights for the averaged stencils. - *-----------------------------------------------------------------*/ - 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); - - /*----------------------------------------------------------------- - * For a compact stencil (e.g., -1 <= hypre_Index[i] <= 1, i= 0-2), - * the value of abs_stencil_shape can be used to determine the - * stencil: - * abs_stencil_shape= 3 only corners in 3-d - * 2 corners in 2-d; or the centre plane - * in 3-d, or e,w,n,s of the bottom - * or top plane in 3-d - * 1 e,w in 1-d; or e,w,n,s in 2-d; - * or the centre plane in 3-d, - * or c of the bottom or top plane - * in 3-d - * 0 c in 1-d, 2-d, or 3-d. - *-----------------------------------------------------------------*/ - - 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]; - - break; - - - case 2: /* corners in 2-d or edges in 3-d */ - - if (ndim == 2) - { - l = common_stencil_i[j]; - crse_ptr[fine_interface_ranks[i]] = stencil_vals[l]; - } - - else if (ndim == 3) - { - /*---------------------------------------------------------- - * The edge values are weighted sums of the averaged - * coefficients. The weights and averaged coefficients must - * be found. The contributions are found using the stencil - * ranks and the stencil ordering - * top: 14 12 13 centre: 5 3 4 bottom 23 21 22 - * 11 9 10 2 0 1 20 18 19 - * 17 15 16 8 6 7 26 24 25 - *----------------------------------------------------------*/ - l = common_stencil_ranks[j]; - temp1 = hypre_TAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); - - switch (l) - { - case 4: /* centre plane ne */ - - temp1[0] = 13; - temp1[1] = 22; - break; - - case 5: /* centre plane nw */ - - temp1[0] = 14; - temp1[1] = 23; - break; - - case 7: /* centre plane se */ - - temp1[0] = 16; - temp1[1] = 25; - break; - - case 8: /* centre plane sw */ - - temp1[0] = 17; - temp1[1] = 26; - break; - - case 10: /* top plane e */ - - temp1[0] = 13; - temp1[1] = 16; - break; - - case 11: /* top plane w */ - - temp1[0] = 14; - temp1[1] = 17; - break; - - case 12: /* top plane n */ - - temp1[0] = 13; - temp1[1] = 14; - break; - - case 15: /* top plane s */ - - temp1[0] = 16; - temp1[1] = 17; - break; - - case 19: /* bottom plane e */ - - temp1[0] = 22; - temp1[1] = 25; - break; - - case 20: /* bottom plane w */ - - temp1[0] = 23; - temp1[1] = 26; - break; - - case 21: /* bottom plane n */ - - temp1[0] = 22; - temp1[1] = 23; - break; - - case 24: /* bottom plane s */ - - temp1[0] = 25; - temp1[1] = 26; - break; - } - - - /*------------------------------------------------------- - * Add up the weighted contributions of the interface - * stencils. This involves searching the ranks of - * interface_stencil_ranks. The weights must be averaged. - *-------------------------------------------------------*/ - - l = common_stencil_i[j]; - sum = temp3[l]; - sum_contrib = sum * stencil_vals[l]; - - n = 1; - for (l = 0; l < 2; l++) - { - while ( (n < coarse_stencil_cnt[i]) - && (interface_stencil_ranks[i][n] < temp1[l]) ) - { - n++; - } - - if (n >= coarse_stencil_cnt[i]) - { - break; - } - - if (interface_stencil_ranks[i][n] == temp1[l]) - { - 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; - - hypre_TFree(temp1, HYPRE_MEMORY_HOST); - - } /* else if (ndim == 3) */ - - break; - - case 1: /* e,w in 1-d, or edges in 2-d, or faces in 3-d */ - - if (ndim == 1) - { - 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); - - switch (l) - { - case 1: /* e */ - - temp1[0] = 4; - temp1[1] = 7; - break; - - case 2: /* w */ - - temp1[0] = 5; - temp1[1] = 8; - break; - - case 3: /* n */ - - temp1[0] = 4; - temp1[1] = 5; - break; - - case 6: /* s */ - - temp1[0] = 7; - temp1[1] = 8; - break; - } - - /*------------------------------------------------------- - * Add up the weighted contributions of the interface - * stencils. - *-------------------------------------------------------*/ - - l = common_stencil_i[j]; - sum = temp3[l]; - sum_contrib = sum * stencil_vals[l]; - - n = 1; - for (l = 0; l < 2; l++) - { - while ( (n < coarse_stencil_cnt[i]) - && (interface_stencil_ranks[i][n] < temp1[l]) ) - { - n++; - } - - if (n >= coarse_stencil_cnt[i]) - { - break; - } - - if (interface_stencil_ranks[i][n] == temp1[l]) - { - 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; - - hypre_TFree(temp1, HYPRE_MEMORY_HOST); - - } /* else if (ndim == 2) */ - - else /* 3-d */ - { - l = common_stencil_ranks[j]; - temp1 = hypre_TAlloc(HYPRE_Int, 8, HYPRE_MEMORY_HOST); - - 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; - 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; - 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; - 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; - break; - - case 9: /* top plane c */ - - for (n = 0; n < 8; n++) - { - temp1[n] = 10 + n; - } - break; - - case 18: /* bottom plane c */ - - for (n = 0; n < 8; n++) - { - temp1[n] = 19 + n; - } - break; - - } - - /*------------------------------------------------------- - * Add up the weighted contributions of the interface - * stencils. - *-------------------------------------------------------*/ - - l = common_stencil_i[j]; - sum = temp3[l]; - sum_contrib = sum * stencil_vals[l]; - - n = 1; - for (l = 0; l < 8; l++) - { - while ( (n < coarse_stencil_cnt[i]) - && (interface_stencil_ranks[i][n] < temp1[l]) ) - { - n++; - } - - if (n >= coarse_stencil_cnt[i]) - { - break; - } - - if (interface_stencil_ranks[i][n] == temp1[l]) - { - 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; - - hypre_TFree(temp1, HYPRE_MEMORY_HOST); - - } /* else */ - - break; - - } /* switch(abs_stencil_shape) */ - } /* for (j= 0; j< m; j++) */ - - hypre_TFree(interface_stencil_ranks[i], HYPRE_MEMORY_HOST); - - hypre_TFree(stencil_vals, HYPRE_MEMORY_HOST); - hypre_TFree(temp3, HYPRE_MEMORY_HOST); - hypre_TFree(common_rank_stencils, HYPRE_MEMORY_HOST); - hypre_TFree(common_stencil_ranks, HYPRE_MEMORY_HOST); - hypre_TFree(common_stencil_ranks, HYPRE_MEMORY_HOST); - hypre_TFree(common_stencil_i, HYPRE_MEMORY_HOST); - - } /* for (i= 0; i< cnt1; i++) */ - - hypre_TFree(box_to_ranks_cnt, HYPRE_MEMORY_HOST); - hypre_TFree(interface_max_stencil_ranks, HYPRE_MEMORY_HOST); - hypre_TFree(interface_max_stencil_cnt, HYPRE_MEMORY_HOST); - hypre_TFree(interface_rank_stencils, HYPRE_MEMORY_HOST); - hypre_TFree(interface_stencil_ranks, HYPRE_MEMORY_HOST); - hypre_TFree(coarse_stencil_cnt, HYPRE_MEMORY_HOST); - hypre_TFree(fine_interface_ranks, HYPRE_MEMORY_HOST); - hypre_TFree(parents_cnodes, HYPRE_MEMORY_HOST); - hypre_TFree(vals, HYPRE_MEMORY_HOST); - - /*----------------------------------------------------------- - * Box fi is completed. - *-----------------------------------------------------------*/ - } /* for (fi= 0; fi< box_array_size; fi++) */ - - hypre_TFree(stencil_ranks, HYPRE_MEMORY_HOST); - 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++) - { - if (box_graph_indices[i]) - { - hypre_TFree(box_graph_indices[i], HYPRE_MEMORY_HOST); - } - } - hypre_TFree(box_graph_indices, HYPRE_MEMORY_HOST); - - hypre_TFree(box_starts, HYPRE_MEMORY_HOST); - hypre_TFree(box_ends, HYPRE_MEMORY_HOST); - } /* for (var1= 0; var1< nvars; var1++) */ - } /* if (nUventries > 0) */ - - - /*-------------------------------------------------------------------------- - * STEP 3: - * Coarsened f/c interface coefficients can be used to create the - * centre components along the coarsened f/c nodes now. Loop over - * the coarsened fbox_bdy's and set the centre stencils. - *--------------------------------------------------------------------------*/ - hypre_ClearIndex(index_temp); - for (var1 = 0; var1 < nvars; var1++) - { - /* only like variables couple. */ - smatrix_var = hypre_SStructPMatrixSMatrix(A_crse, var1, var1); - stencils = hypre_SStructPMatrixSStencil(A_crse, var1, var1); - 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++) - { - hypre_CopyIndex(hypre_StructStencilElement(stencils, i), - stencil_shape_i); - MapStencilRank(stencil_shape_i, rank); - rank_stencils[rank] = i; - } - centre = rank_stencils[0]; - - 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]; - - 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); - } - - /*------------------------------------------------------------------ - * Loop over the boundaries of each patch inside cgrid_box ci. - * These patch boxes must be coarsened to get the correct extents. - *------------------------------------------------------------------*/ - hypre_ForBoxArrayI(arrayi, fbox_bdy_ci) - { - 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); - hypre_StructMapFineToCoarse(hypre_BoxIMin(fgrid_box), index_temp, - stridef, hypre_BoxIMin(&fine_box)); - hypre_StructMapFineToCoarse(hypre_BoxIMax(fgrid_box), index_temp, - stridef, hypre_BoxIMax(&fine_box)); - - hypre_CopyIndex(hypre_BoxIMin(&fine_box), cstart); - hypre_BoxGetSize(&fine_box, loop_size); - -#define DEVICE_VAR is_device_ptr(a_ptrs) - hypre_BoxLoop1Begin(ndim, loop_size, - A_dbox, cstart, stridec, iA); - { - HYPRE_Int i; - for (i = 0; i < stencil_size; i++) - { - if (i != centre) - { - a_ptrs[centre][iA] -= a_ptrs[i][iA]; - } - } - } - hypre_BoxLoop1End(iA); -#undef DEVICE_VAR - - } /* hypre_ForBoxI(fi, fbox_bdy_ci_fi) */ - } /* hypre_ForBoxArrayI(arrayi, fbox_bdy_ci) */ - } /* hypre_ForBoxI(ci, cgrid_boxes) */ - - hypre_TFree(a_ptrs, HYPRE_MEMORY_HOST); - hypre_TFree(rank_stencils, 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 = hypre_SStructPGridSGrid(hypre_SStructPMatrixPGrid(A_pmatrix), var1); - fgrid_boxes = hypre_StructGridBoxes(fgrid); - - hypre_ForBoxI(ci, cgrid_boxes) - { - hypre_BoxArrayDestroy(fgrid_crse_extents[var1][ci]); - hypre_BoxArrayDestroy(fbox_interior[var1][ci]); - hypre_BoxArrayArrayDestroy(fbox_bdy[var1][ci]); - hypre_TFree(interior_fboxi[var1][ci], HYPRE_MEMORY_HOST); - hypre_TFree(bdy_fboxi[var1][ci], HYPRE_MEMORY_HOST); - } - hypre_TFree(fgrid_crse_extents[var1], HYPRE_MEMORY_HOST); - hypre_TFree(fbox_interior[var1], HYPRE_MEMORY_HOST); - hypre_TFree(fbox_bdy[var1], HYPRE_MEMORY_HOST); - hypre_TFree(interior_fboxi[var1], HYPRE_MEMORY_HOST); - hypre_TFree(bdy_fboxi[var1], HYPRE_MEMORY_HOST); - - hypre_ForBoxI(fi, fgrid_boxes) - { - hypre_TFree(cboxi_fboxes[var1][fi], HYPRE_MEMORY_HOST); - } - hypre_TFree(cboxi_fboxes[var1], HYPRE_MEMORY_HOST); - hypre_TFree(cboxi_fcnt[var1], HYPRE_MEMORY_HOST); - } - hypre_TFree(fgrid_crse_extents, HYPRE_MEMORY_HOST); - hypre_TFree(fbox_interior, HYPRE_MEMORY_HOST); - hypre_TFree(fbox_bdy, HYPRE_MEMORY_HOST); - hypre_TFree(interior_fboxi, HYPRE_MEMORY_HOST); - hypre_TFree(bdy_fboxi, HYPRE_MEMORY_HOST); - hypre_TFree(cboxi_fboxes, HYPRE_MEMORY_HOST); - hypre_TFree(cboxi_fcnt, HYPRE_MEMORY_HOST); - - return 0; -} diff --git a/src/sstruct_ls/fac_amr_rap.c b/src/sstruct_ls/fac_amr_rap.c deleted file mode 100644 index e4e273fdfa..0000000000 --- a/src/sstruct_ls/fac_amr_rap.c +++ /dev/null @@ -1,483 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_sstruct_ls.h" -#include "_hypre_struct_mv.hpp" -#include "fac.h" - -/*-------------------------------------------------------------------------- - * hypre_AMR_RAP: Forms the coarse operators for all amr levels. - * Given an amr composite matrix, the coarse grid operator is produced. - * Nesting of amr levels is not assumed. Communication of chunks of the - * coarse grid operator is performed. - * - * Note: The sstruct_grid of A and fac_A are the same. These are kept the - * same so that the row ranks are the same. However, the generated - * coarse-grid operators are re-distributed so that each processor has its - * operator on its grid. - *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_AMR_RAP( hypre_SStructMatrix *A, - hypre_Index *rfactors, - hypre_SStructMatrix **fac_A_ptr ) -{ - - MPI_Comm comm = hypre_SStructMatrixComm(A); - HYPRE_Int ndim = hypre_SStructMatrixNDim(A); - HYPRE_Int nparts = hypre_SStructMatrixNParts(A); - hypre_SStructGraph *graph = hypre_SStructMatrixGraph(A); - HYPRE_IJMatrix ij_A = hypre_SStructMatrixIJMatrix(A); - HYPRE_Int matrix_type = hypre_SStructMatrixObjectType(A); - - hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); - HYPRE_Int nUventries = hypre_SStructGraphNUVEntries(graph); - HYPRE_Int *iUventries = hypre_SStructGraphIUVEntries(graph); - hypre_SStructUVEntry **Uventries = hypre_SStructGraphUVEntries(graph); - hypre_SStructUVEntry *Uventry; - HYPRE_Int nUentries; - - hypre_CommPkg *amrA_comm_pkg; - hypre_CommHandle *comm_handle; - - hypre_SStructMatrix *fac_A; - hypre_SStructPMatrix *pmatrix, *fac_pmatrix; - hypre_StructMatrix *smatrix, *fac_smatrix; - hypre_Box *smatrix_dbox, *fac_smatrix_dbox; - HYPRE_Real *smatrix_vals, *fac_smatrix_vals; - - hypre_SStructGrid *fac_grid; - hypre_SStructGraph *fac_graph; - hypre_SStructPGrid *f_pgrid, *c_pgrid; - hypre_StructGrid *fgrid, *cgrid; - hypre_BoxArray *grid_boxes, *cgrid_boxes; - hypre_Box *grid_box; - hypre_Box scaled_box; - - hypre_SStructPGrid *temp_pgrid; - hypre_SStructStencil **temp_sstencils; - hypre_SStructPMatrix *temp_pmatrix; - - hypre_SStructOwnInfoData ***owninfo; - hypre_SStructRecvInfoData *recvinfo; - hypre_SStructSendInfoData *sendinfo; - hypre_BoxArrayArray *own_composite_cboxes, *own_boxes; - hypre_BoxArray *own_composite_cbox; - HYPRE_Int **own_cboxnums; - - hypre_BoxManager *fboxman, *cboxman; - hypre_BoxManEntry *boxman_entry; - hypre_Index ilower; - - HYPRE_Real *values; - HYPRE_Int *ncols, tot_cols; - HYPRE_BigInt *rows, *cols; - - hypre_SStructStencil *stencils; - hypre_Index stencil_shape, loop_size; - HYPRE_Int stencil_size, *stencil_vars; - - hypre_Index index, stride, zero_index; - HYPRE_Int nvars, var1, var2, part, cbox; - HYPRE_Int i, j, k, size; - - HYPRE_Int myid; - HYPRE_Int ierr = 0; - - hypre_MPI_Comm_rank(comm, &myid); - hypre_ClearIndex(zero_index); - - hypre_BoxInit(&scaled_box, ndim); - - hypre_SStructGraphRef(graph, &fac_graph); - fac_grid = hypre_SStructGraphGrid(fac_graph); - HYPRE_SStructMatrixCreate(comm, fac_graph, &fac_A); - HYPRE_SStructMatrixInitialize(fac_A); - - /*-------------------------------------------------------------------------- - * Copy all A's unstructured data and structured data that are not processed - * into fac_A. Since the grids are the same for both matrices, the ranks - * 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); - rows = hypre_CTAlloc(HYPRE_BigInt, nUventries, HYPRE_MEMORY_HOST); - - tot_cols = 0; - for (i = 0; i < nUventries; i++) - { - 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++) - { - Uventry = Uventries[iUventries[i]]; - part = hypre_SStructUVEntryPart(Uventry); - hypre_CopyIndex(hypre_SStructUVEntryIndex(Uventry), index); - var1 = hypre_SStructUVEntryVar(Uventry); - nUentries = hypre_SStructUVEntryNUEntries(Uventry); - - 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++) - { - cols[k++] = hypre_SStructUVEntryToRank(Uventry, j); - } - } - - 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, - ncols, (const HYPRE_BigInt *) rows, (const HYPRE_BigInt *) cols, - (const HYPRE_Real *) values); - hypre_TFree(ncols, HYPRE_MEMORY_HOST); - hypre_TFree(rows, HYPRE_MEMORY_HOST); - hypre_TFree(cols, HYPRE_MEMORY_HOST); - hypre_TFree(values, HYPRE_MEMORY_HOST); - - owninfo = hypre_CTAlloc(hypre_SStructOwnInfoData **, nparts, HYPRE_MEMORY_HOST); - for (part = (nparts - 1); part > 0; part--) - { - 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++) - { - 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); - - owninfo[part][var1] = hypre_SStructOwnInfo(fgrid, cgrid, cboxman, fboxman, - rfactors[part]); - } - } - - hypre_SetIndex3(stride, 1, 1, 1); - for (part = (nparts - 1); part > 0; part--) - { - 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++) - { - fgrid = hypre_SStructPGridSGrid(f_pgrid, var1); - cgrid = hypre_SStructPGridSGrid(c_pgrid, var1); - grid_boxes = hypre_StructGridBoxes(fgrid); - - stencils = hypre_SStructGraphStencil(graph, part, var1); - stencil_size = hypre_SStructStencilSize(stencils); - stencil_vars = hypre_SStructStencilVars(stencils); - - if (part == (nparts - 1)) /* copy all fine data */ - { - pmatrix = hypre_SStructMatrixPMatrix(A, part); - fac_pmatrix = hypre_SStructMatrixPMatrix(fac_A, part); - hypre_ForBoxI(i, grid_boxes) - { - 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++) - { - var2 = stencil_vars[j]; - smatrix = hypre_SStructPMatrixSMatrix(pmatrix, var1, var2); - fac_smatrix = hypre_SStructPMatrixSMatrix(fac_pmatrix, var1, var2); - - 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); - -#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]; - } - hypre_BoxLoop2End(iA, iAc); -#undef DEVICE_VAR - - } /* for (j = 0; j < stencil_size; j++) */ - } /* hypre_ForBoxI(i, grid_boxes) */ - } /* if (part == (nparts-1)) */ - - /*---------------------------------------------------------------------- - * 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); - - 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); - - hypre_ForBoxArrayI(i, own_composite_cboxes) - { - own_composite_cbox = hypre_BoxArrayArrayBoxArray(own_composite_cboxes, i); - hypre_ForBoxI(j, own_composite_cbox) - { - 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++) - { - var2 = stencil_vars[k]; - smatrix = hypre_SStructPMatrixSMatrix(pmatrix, var1, var2); - fac_smatrix = hypre_SStructPMatrixSMatrix(fac_pmatrix, var1, var2); - - 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); - -#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]; - } - hypre_BoxLoop2End(iA, iAc); -#undef DEVICE_VAR - - } /* for (k = 0; k< stencil_size; k++) */ - } /* hypre_ForBoxI(j, own_composite_cbox) */ - } /* hypre_ForBoxArrayI(i, own_composite_cboxes) */ - - } /* for (var1= 0; var1< nvars; var1++) */ - } /* for (part= (nparts-1); part> 0; part--) */ - - /*-------------------------------------------------------------------------- - * All possible data has been copied into fac_A- i.e., the original amr - * composite operator. Now we need to coarsen away the fboxes and the - * interface connections. - * - * Algo.: - * Loop from the finest amr_level to amr_level 1 - * { - * 1) coarsen the cf connections to get stencil connections from - * the coarse nodes to the coarsened fbox nodes. - * 2) coarsen the fboxes and the fc connections. These are coarsened - * into a temp SStruct_PMatrix whose grid is the coarsened fgrid. - * 3) copy all coarsened data that belongs on this processor and - * communicate any that belongs to another processor. - * } - *--------------------------------------------------------------------------*/ - for (part = (nparts - 1); part >= 1; part--) - { - hypre_AMR_CFCoarsen(A, fac_A, rfactors[part], part); - - /*----------------------------------------------------------------------- - * 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); - - hypre_SStructPGridCreate(hypre_SStructGridComm(f_pgrid), - ndim, &temp_pgrid); - - /*coarsen the fboxes.*/ - for (i = 0; i < hypre_BoxArraySize(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, - rfactors[part], hypre_BoxIMax(&scaled_box)); - - hypre_SStructPGridSetExtents(temp_pgrid, - hypre_BoxIMin(&scaled_box), - hypre_BoxIMax(&scaled_box)); - } - - nvars = hypre_SStructPGridNVars(f_pgrid); - hypre_SStructPGridSetVariables(temp_pgrid, nvars, - hypre_SStructPGridVarTypes(f_pgrid)); - 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++) - { - hypre_SStructStencilRef(hypre_SStructPMatrixStencil(fac_pmatrix, i), - &temp_sstencils[i]); - } - - hypre_SStructPMatrixCreate(hypre_SStructPMatrixComm(fac_pmatrix), - temp_pgrid, - temp_sstencils, - &temp_pmatrix); - hypre_SStructPMatrixInitialize(temp_pmatrix); - - hypre_AMR_FCoarsen(A, fac_A, temp_pmatrix, rfactors[part], part); - - /*----------------------------------------------------------------------- - * 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++) - { - 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]); - - /* loop over all the cbox chunks */ - for (i = 0; i < size; i++) - { - cgrid_boxes = hypre_BoxArrayArrayBoxArray(own_boxes, i); - hypre_ForBoxI(j, cgrid_boxes) - { - 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]; - - 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); - - /*--------------------------------------------------------------- - * 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 = - hypre_BoxArrayBox(hypre_StructMatrixDataSpace(fac_smatrix), cbox); - - hypre_CopyIndex(hypre_SStructStencilEntry(stencils, k), stencil_shape); - smatrix_vals = - hypre_StructMatrixExtractPointerByIndex(smatrix, - i, - stencil_shape); - fac_smatrix_vals = - hypre_StructMatrixExtractPointerByIndex(fac_smatrix, - cbox, - 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]; - } - hypre_BoxLoop2End(iA, iAc); -#undef DEVICE_VAR - - } /* for (k = 0; k < stencil_size; k++) */ - } /* hypre_ForBoxI(j, cgrid_boxes) */ - } /* for (i= 0; i< size; i++) */ - - hypre_SStructOwnInfoDataDestroy(owninfo[part][var1]); - } /* for (var1= 0; var1< nvars; var1++) */ - - hypre_TFree(owninfo[part], HYPRE_MEMORY_HOST); - - /*----------------------------------------------------------------------- - * Communication of off-process coarse data. A communication pkg is - * needed. Thus, compute the communication info- sendboxes, recvboxes, - * etc. - *-----------------------------------------------------------------------*/ - for (var1 = 0; var1 < nvars; 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); - - 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++) - { - fac_smatrix = hypre_SStructPMatrixSMatrix(fac_pmatrix, var1, var2); - smatrix = hypre_SStructPMatrixSMatrix(temp_pmatrix, var1, var2); - - hypre_SStructAMRInterCommunication(sendinfo, - recvinfo, - hypre_StructMatrixDataSpace(smatrix), - hypre_StructMatrixDataSpace(fac_smatrix), - hypre_StructMatrixNumValues(smatrix), - comm, - &amrA_comm_pkg); - - hypre_InitializeCommunication(amrA_comm_pkg, - hypre_StructMatrixData(smatrix), - hypre_StructMatrixData(fac_smatrix), 0, 0, - &comm_handle); - hypre_FinalizeCommunication(comm_handle); - - hypre_CommPkgDestroy(amrA_comm_pkg); - } - - hypre_SStructSendInfoDataDestroy(sendinfo); - hypre_SStructRecvInfoDataDestroy(recvinfo); - - } /* for (var1= 0; var1< nvars; var1++) */ - - hypre_SStructPGridDestroy(temp_pgrid); - hypre_SStructPMatrixDestroy(temp_pmatrix); - - } /* for (part= 0; part< nparts; part++) */ - - hypre_TFree(owninfo, HYPRE_MEMORY_HOST); - - HYPRE_SStructMatrixAssemble(fac_A); - - *fac_A_ptr = fac_A; - return ierr; -} diff --git a/src/sstruct_ls/fac_amr_zero_data.c b/src/sstruct_ls/fac_amr_zero_data.c deleted file mode 100644 index acf4f92894..0000000000 --- a/src/sstruct_ls/fac_amr_zero_data.c +++ /dev/null @@ -1,306 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_sstruct_ls.h" -#include "fac.h" - -/*-------------------------------------------------------------------------- - * hypre_ZeroAMRVectorData: Zeroes the data over the underlying coarse - * indices of the refinement patches. - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_ZeroAMRVectorData(hypre_SStructVector *b, - HYPRE_Int *plevels, - hypre_Index *rfactors ) -{ - hypre_SStructGrid *grid = hypre_SStructVectorGrid(b); - hypre_SStructPGrid *p_cgrid; - - hypre_StructGrid *cgrid; - hypre_BoxArray *cgrid_boxes; - hypre_Box *cgrid_box; - - hypre_BoxManager *fboxman; - hypre_BoxManEntry **boxman_entries; - HYPRE_Int nboxman_entries; - - hypre_Box scaled_box; - hypre_Box intersect_box; - - 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++) - { - 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--) - { - p_cgrid = hypre_SStructGridPGrid(grid, levels[level - 1]); - nvars = hypre_SStructPGridNVars(p_cgrid); - - 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); - 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); - - /* 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) - { - /*------------------------------------------------------------ - * Coarse underlying box found. Now zero off. - *------------------------------------------------------------*/ - 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); - - } /* if (intersect_size > 0) */ - } /* for (i= 0; i< nboxman_entries; i++) */ - - hypre_TFree(boxman_entries, HYPRE_MEMORY_HOST); - - } /* hypre_ForBoxI(ci, cgrid_boxes) */ - } /* for (var= 0; var< nvars; var++) */ - } /* for (level= max_level; level> 0; level--) */ - - hypre_TFree(levels, HYPRE_MEMORY_HOST); - hypre_TFree(refine_factors, HYPRE_MEMORY_HOST); - - return ierr; -} - - -/*-------------------------------------------------------------------------- - * hypre_ZeroAMRMatrixData: Zeroes the data over the underlying coarse - * indices of the refinement patches between two levels. - *--------------------------------------------------------------------------*/ - -HYPRE_Int -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_Int ndim = hypre_SStructMatrixNDim(A); - - hypre_SStructPGrid *p_cgrid; - - hypre_StructGrid *cgrid; - hypre_BoxArray *cgrid_boxes; - hypre_Box *cgrid_box; - - hypre_BoxManager *fboxman; - hypre_BoxManEntry **boxman_entries; - HYPRE_Int nboxman_entries; - - hypre_Box scaled_box; - hypre_Box intersect_box; - - hypre_SStructStencil *stencils; - HYPRE_Int stencil_size; - - 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); - nvars = hypre_SStructPGridNVars(p_cgrid); - - for (var = 0; var < nvars; var++) - { - stencils = hypre_SStructGraphStencil(graph, part_crse, var); - stencil_size = hypre_SStructStencilSize(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); - - 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); - - /* 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); - } /* hypre_ForBoxI(ci, cgrid_boxes) */ - } /* for (var= 0; var< nvars; var++) */ - - return ierr; -} - - - diff --git a/src/sstruct_ls/fac_cf_coarsen.c b/src/sstruct_ls/fac_cf_coarsen.c deleted file mode 100644 index d212826bcf..0000000000 --- a/src/sstruct_ls/fac_cf_coarsen.c +++ /dev/null @@ -1,504 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other - * HYPRE Project Developers. See the top-level COPYRIGHT file for details. - * - * SPDX-License-Identifier: (Apache-2.0 OR MIT) - ******************************************************************************/ - -/****************************************************************************** - * OpenMP Problems - * - * Are private static arrays a problem? - * - ******************************************************************************/ - -#include "_hypre_sstruct_ls.h" -#include "fac.h" - -#define MapStencilRank(stencil, rank) \ - { \ - HYPRE_Int ii,jj,kk; \ - ii = hypre_IndexX(stencil); \ - jj = hypre_IndexY(stencil); \ - kk = hypre_IndexZ(stencil); \ - if (ii==-1) \ - ii=2; \ - if (jj==-1) \ - jj=2; \ - if (kk==-1) \ - kk=2; \ - rank = ii + 3*jj + 9*kk; \ - } - -#define InverseMapStencilRank(rank, stencil) \ - { \ - HYPRE_Int ij,ii,jj,kk; \ - ij = (rank%9); \ - ii = (ij%3); \ - jj = (ij-ii)/3; \ - kk = (rank-3*jj-ii)/9; \ - if (ii==2) \ - ii= -1; \ - if (jj==2) \ - jj= -1; \ - if (kk==2) \ - kk= -1; \ - hypre_SetIndex3(stencil, ii, jj, kk); \ - } - - -#define AbsStencilShape(stencil, abs_shape) \ - { \ - HYPRE_Int ii,jj,kk; \ - ii = hypre_IndexX(stencil); \ - jj = hypre_IndexY(stencil); \ - kk = hypre_IndexZ(stencil); \ - abs_shape= hypre_abs(ii) + hypre_abs(jj) + hypre_abs(kk); \ - } - -/*-------------------------------------------------------------------------- - * 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. - * - * 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. - * - * ASSUMING ONLY LIKE-VARIABLES COUPLE THROUGH CF CONNECTIONS. - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_AMR_CFCoarsen( hypre_SStructMatrix * A, - hypre_SStructMatrix * fac_A, - hypre_Index refine_factors, - HYPRE_Int level ) - -{ - MPI_Comm comm = hypre_SStructMatrixComm(A); - hypre_SStructGraph *graph = hypre_SStructMatrixGraph(A); - HYPRE_Int graph_type = hypre_SStructGraphObjectType(graph); - 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 ndim = hypre_SStructMatrixNDim(A); - - hypre_SStructPMatrix *A_pmatrix; - hypre_StructMatrix *smatrix_var; - hypre_StructStencil *stencils; - HYPRE_Int stencil_size; - hypre_Index stencil_shape_i; - hypre_Index loop_size; - hypre_Box refined_box; - HYPRE_Real **a_ptrs; - hypre_Box *A_dbox; - - HYPRE_Int part_crse = level - 1; - HYPRE_Int part_fine = level; - - hypre_BoxManager *fboxman; - hypre_BoxManEntry **boxman_entries, *boxman_entry; - HYPRE_Int nboxman_entries; - hypre_Box boxman_entry_box; - - hypre_BoxArrayArray ***fgrid_cinterface_extents; - - hypre_StructGrid *cgrid; - hypre_BoxArray *cgrid_boxes; - hypre_Box *cgrid_box; - hypre_Index node_extents; - hypre_Index stridec, stridef; - - hypre_BoxArrayArray *cinterface_arrays; - hypre_BoxArray *cinterface_array; - hypre_Box *fgrid_cinterface; - - HYPRE_Int centre; - - HYPRE_Int ci, fi, boxi; - HYPRE_Int max_stencil_size = 27; - HYPRE_Int falseV = 0; - HYPRE_Int trueV = 1; - HYPRE_Int found; - HYPRE_Int *stencil_ranks, *rank_stencils; - HYPRE_BigInt rank, startrank; - HYPRE_Real *vals; - - HYPRE_Int i, j; - HYPRE_Int nvars, var1; - - hypre_Index lindex, zero_index; - hypre_Index index1, index2; - hypre_Index index_temp; - - hypre_SStructUVEntry *Uventry; - HYPRE_Int nUentries, cnt1; - HYPRE_Int box_array_size; - - 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 - * 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); - } - else if (graph_type == HYPRE_PARCSR) - { - 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++) - { - stridef[i] = refine_factors[i]; - } - for (i = ndim; i < 3; i++) - { - stridef[i] = 1; - } - - /*-------------------------------------------------------------------------- - * Determine the c/f interface index boxes: fgrid_cinterface_extents. - * 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 - * directions- i.e., we have a boxarrayarray for each cbox, each - * fbox leading to a boxarray. - * - * Algo.: For each cbox: - * 1) refine & stretch by a unit in each dimension. - * 2) boxman_intersect with the fgrid boxman to get all fboxes contained - * or abutting this cbox. - * 3) get the fgrid_cinterface_extents for each of these fboxes. - * - * fgrid_cinterface_extents[var1][ci] - *--------------------------------------------------------------------------*/ - 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++) - { - 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); - - hypre_ForBoxI(ci, cgrid_boxes) - { - 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_StructMapCoarseToFine(hypre_BoxIMax(cgrid_box), index1, - refine_factors, hypre_BoxIMax(&refined_box)); - - /*------------------------------------------------------------------------ - * Stretch the refined_box so that a BoxManIntersect will get abutting - * fboxes. - *------------------------------------------------------------------------*/ - for (i = 0; i < ndim; i++) - { - 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); - - /*------------------------------------------------------------------------ - * Get the fgrid_cinterface_extents using var1-var1 stencil (only like- - * variables couple). - *------------------------------------------------------------------------*/ - if (stencils != NULL) - { - for (i = 0; i < nboxman_entries; i++) - { - hypre_BoxManEntryGetExtents(boxman_entries[i], - hypre_BoxIMin(&boxman_entry_box), - hypre_BoxIMax(&boxman_entry_box)); - hypre_CFInterfaceExtents2(&boxman_entry_box, cgrid_box, stencils, refine_factors, - hypre_BoxArrayArrayBoxArray(fgrid_cinterface_extents[var1][ci], i) ); - } - } - hypre_TFree(boxman_entries, HYPRE_MEMORY_HOST); - - } /* hypre_ForBoxI(ci, cgrid_boxes) */ - } /* for (var1= 0; var1< nvars; var1++) */ - - /*-------------------------------------------------------------------------- - * STEP 1: - * ADJUST THE ENTRIES ALONG THE C/F BOXES SO THAT THE COARSENED - * C/F CONNECTION HAS THE APPROPRIATE ROW SUM. - * WE ARE ASSUMING ONLY LIKE VARIABLES COUPLE. - *--------------------------------------------------------------------------*/ - 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); - - /*---------------------------------------------------------------------- - * Extract only where variables couple. - *----------------------------------------------------------------------*/ - if (stencils != NULL) - { - stencil_size = hypre_StructStencilSize(stencils); - - /*------------------------------------------------------------------ - * stencil_ranks[i] = rank of stencil entry i. - * rank_stencils[i] = stencil entry of rank i. - * - * 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++) - { - rank_stencils[i] = -1; - if (i < stencil_size) - { - stencil_ranks[i] = -1; - } - } - - 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; - } - 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); - - 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++) - { - hypre_CopyIndex(hypre_StructStencilElement(stencils, i), stencil_shape_i); - a_ptrs[i] = hypre_StructMatrixExtractPointerByIndex(smatrix_var, - ci, - stencil_shape_i); - } - - /*------------------------------------------------------------------- - * Loop over the c/f interface boxes and set the centre to be the row - * sum. Coarsen the c/f connection and set the centre to preserve - * the row sum of the composite operator along the c/f interface. - *-------------------------------------------------------------------*/ - hypre_ForBoxArrayI(fi, cinterface_arrays) - { - cinterface_array = hypre_BoxArrayArrayBoxArray(cinterface_arrays, fi); - box_array_size = hypre_BoxArraySize(cinterface_array); - for (boxi = stencil_size; boxi < box_array_size; boxi++) - { - fgrid_cinterface = hypre_BoxArrayBox(cinterface_array, boxi); - hypre_CopyIndex(hypre_BoxIMin(fgrid_cinterface), node_extents); - hypre_BoxGetSize(fgrid_cinterface, loop_size); - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - A_dbox, node_extents, stridec, iA); - { - zypre_BoxLoopGetIndex(lindex); - for (i = 0; i < stencil_size; i++) - { - if (i != centre) - { - a_ptrs[centre][iA] += a_ptrs[i][iA]; - } - } - - /*----------------------------------------------------------------- - * 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. - *-----------------------------------------------------------------*/ - 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); - hypre_SStructBoxManEntryGetGlobalRank(boxman_entry, index_temp, &rank, - matrix_type); - if (nUventries > 0) - { - found = falseV; - if ((rank - startrank) >= hypre_SStructGraphIUVEntry(graph, 0) && - (rank - startrank) <= hypre_SStructGraphIUVEntry(graph, nUventries - 1)) - { - found = trueV; - } - } - - /*----------------------------------------------------------------- - * The graph has Uventries only if (nUventries > 0). Therefore, - * check this. Only like variables contribute to the row sum. - *-----------------------------------------------------------------*/ - if (nUventries > 0 && found == trueV) - { - Uventry = hypre_SStructGraphUVEntry(graph, rank - startrank); - - if (Uventry != NULL) - { - 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++) - { - if (hypre_SStructUVEntryToPart(Uventry, i) == part_fine - && hypre_SStructUVEntryToVar(Uventry, i) == var1) - { - temp1[cnt1++] = i; - } - } - - 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); - vals = hypre_CTAlloc(HYPRE_Real, cnt1, HYPRE_MEMORY_HOST); - - for (i = 0; i < cnt1; i++) - { - 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]), - zero_index, stridef, index2); - hypre_SubtractIndexes(index2, index_temp, - ndim, index1); - MapStencilRank(index1, temp2[i]); - - /* zero off this stencil connection into the fbox */ - if (temp2[i] < max_stencil_size) - { - j = rank_stencils[temp2[i]]; - if (j >= 0) - { - a_ptrs[j][iA] = 0.0; - } - } - } /* for (i= 0; i< cnt1; i++) */ - - hypre_TFree(temp1, HYPRE_MEMORY_HOST); - - HYPRE_IJMatrixGetValues(ij_A, cnt1, ncols, rows, cols, vals); - for (i = 0; i < cnt1; i++) - { - a_ptrs[centre][iA] += vals[i]; - } - - hypre_TFree(ncols, HYPRE_MEMORY_HOST); - hypre_TFree(rows, HYPRE_MEMORY_HOST); - hypre_TFree(cols, HYPRE_MEMORY_HOST); - - /* compute the connection to the coarsened fine box */ - for (i = 0; i < cnt1; i++) - { - if (temp2[i] < max_stencil_size) - { - j = rank_stencils[temp2[i]]; - if (j >= 0) - { - a_ptrs[j][iA] += vals[i]; - } - } - } - hypre_TFree(vals, HYPRE_MEMORY_HOST); - hypre_TFree(temp2, HYPRE_MEMORY_HOST); - - /* centre connection which preserves the row sum */ - for (i = 0; i < stencil_size; i++) - { - if (i != centre) - { - a_ptrs[centre][iA] -= a_ptrs[i][iA]; - } - } - - } /* if (Uventry != NULL) */ - } /* if (nUventries > 0) */ - } - hypre_SerialBoxLoop1End(iA); - } /* for (boxi= stencil_size; boxi< box_array_size; boxi++) */ - } /* hypre_ForBoxArrayI(fi, cinterface_arrays) */ - } /* hypre_ForBoxI(ci, cgrid_boxes) */ - - hypre_TFree(a_ptrs, HYPRE_MEMORY_HOST); - hypre_TFree(stencil_ranks, HYPRE_MEMORY_HOST); - hypre_TFree(rank_stencils, HYPRE_MEMORY_HOST); - } /* if (stencils != NULL) */ - } /* end var1 */ - - - for (var1 = 0; var1 < nvars; var1++) - { - cgrid = hypre_SStructPGridSGrid(hypre_SStructPMatrixPGrid(A_pmatrix), var1); - cgrid_boxes = hypre_StructGridBoxes(cgrid); - - hypre_ForBoxI(ci, cgrid_boxes) - { - hypre_BoxArrayArrayDestroy(fgrid_cinterface_extents[var1][ci]); - } - hypre_TFree(fgrid_cinterface_extents[var1], HYPRE_MEMORY_HOST); - } - hypre_TFree(fgrid_cinterface_extents, HYPRE_MEMORY_HOST); - - return 0; -} diff --git a/src/sstruct_ls/fac_cfstencil_box.c b/src/sstruct_ls/fac_cfstencil_box.c deleted file mode 100644 index a48e6bce6d..0000000000 --- a/src/sstruct_ls/fac_cfstencil_box.c +++ /dev/null @@ -1,149 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_sstruct_ls.h" -#include "fac.h" - -#define AbsStencilShape(stencil, abs_shape) \ -{\ - HYPRE_Int ii,jj,kk;\ - ii = hypre_IndexX(stencil);\ - jj = hypre_IndexY(stencil);\ - kk = hypre_IndexZ(stencil);\ - abs_shape= hypre_abs(ii) + hypre_abs(jj) + hypre_abs(kk); \ -} - -/*-------------------------------------------------------------------------- - * hypre_CF_StenBox: Given a cgrid_box, a fgrid_box, and a stencil_shape, - * the stencil_shape direction. Returns an empty box if these two boxes - * are not connected in the stencil_shape direction. - *--------------------------------------------------------------------------*/ -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 coarsen_box; - hypre_Box contracted_box; - hypre_Box extended_box; - hypre_Box intersect_box; - hypre_Box *stenbox; - - hypre_Box shift_cbox, shift_ibox; - hypre_Index size_cbox, size_ibox; - - hypre_Index temp_index; - hypre_Index shift_index; - - HYPRE_Int i, remainder, intersect_size; - - hypre_ClearIndex(temp_index); - stenbox = hypre_BoxCreate(ndim); - - hypre_BoxInit(&coarsen_box, ndim); - hypre_BoxInit(&contracted_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. - *--------------------------------------------------------------------------*/ - hypre_CopyBox(fgrid_box, &contracted_box); - for (i = 0; i < ndim; i++) - { - remainder = hypre_BoxIMin(&contracted_box)[i] % rfactors[i]; - if (remainder) - { - hypre_BoxIMin(&contracted_box)[i] += rfactors[i] - remainder; - } - } - - hypre_StructMapFineToCoarse(hypre_BoxIMin(&contracted_box), temp_index, - rfactors, hypre_BoxIMin(&coarsen_box)); - hypre_StructMapFineToCoarse(hypre_BoxIMax(&contracted_box), temp_index, - rfactors, hypre_BoxIMax(&coarsen_box)); - - hypre_ClearIndex(size_cbox); - 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. - *---------------------------------------------------------------------*/ - 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++) - { - 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); - if (intersect_size == 0) - { - hypre_CopyBox(&intersect_box, stenbox); - return stenbox; - } - - hypre_ClearIndex(size_ibox); - 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. - *---------------------------------------------------------------------*/ - hypre_SetIndex3(shift_index, - -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]); - 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. - *---------------------------------------------------------------------*/ - 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)); - hypre_IntersectBoxes(&shift_cbox, &shift_ibox, stenbox); - - return stenbox; -} diff --git a/src/sstruct_ls/fac_interp2.c b/src/sstruct_ls/fac_interp2.c deleted file mode 100644 index d6031d33f0..0000000000 --- a/src/sstruct_ls/fac_interp2.c +++ /dev/null @@ -1,1536 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other - * HYPRE Project Developers. See the top-level COPYRIGHT file for details. - * - * SPDX-License-Identifier: (Apache-2.0 OR MIT) - ******************************************************************************/ - -/****************************************************************************** - * OpenMP Problems - * - * Not sure about performace yet, so leaving the '#if 1' blocks below. - * - ******************************************************************************/ - -/****************************************************************************** - * FAC composite level interpolation. - * Identity interpolation of values away from underlying refinement patches; - * linear inside patch. - ******************************************************************************/ - -#include "_hypre_sstruct_ls.h" -#include "fac.h" - -/*-------------------------------------------------------------------------- - * hypre_FacSemiInterpData data structure - *--------------------------------------------------------------------------*/ -typedef struct -{ - HYPRE_Int nvars; - HYPRE_Int ndim; - hypre_Index stride; - - hypre_SStructPVector *recv_cvectors; - HYPRE_Int **recv_boxnum_map; /* mapping between the boxes of the - recv_grid and the given grid */ - hypre_BoxArrayArray **identity_arrayboxes; - hypre_BoxArrayArray **ownboxes; - HYPRE_Int ***own_cboxnums; - - hypre_CommPkg **interlevel_comm; - hypre_CommPkg **gnodes_comm_pkg; - - HYPRE_Real **weights; - -} hypre_FacSemiInterpData2; - -/*-------------------------------------------------------------------------- - * hypre_FacSemiInterpCreate - *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_FacSemiInterpCreate2( void **fac_interp_vdata_ptr ) -{ - 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; - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_FacSemiInterpDestroy - *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_FacSemiInterpDestroy2( void *fac_interp_vdata) -{ - HYPRE_Int ierr = 0; - - hypre_FacSemiInterpData2 *fac_interp_data = (hypre_FacSemiInterpData2 *)fac_interp_vdata; - HYPRE_Int i, j, size; - - if (fac_interp_data) - { - hypre_SStructPVectorDestroy(fac_interp_data-> recv_cvectors); - - 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]); - hypre_BoxArrayArrayDestroy(fac_interp_data -> ownboxes[i]); - for (j = 0; j < size; j++) - { - hypre_TFree(fac_interp_data -> own_cboxnums[i][j], HYPRE_MEMORY_HOST); - } - hypre_TFree(fac_interp_data -> own_cboxnums[i], HYPRE_MEMORY_HOST); - - hypre_CommPkgDestroy(fac_interp_data -> gnodes_comm_pkg[i]); - hypre_CommPkgDestroy(fac_interp_data -> interlevel_comm[i]); - - } - hypre_TFree(fac_interp_data -> recv_boxnum_map, HYPRE_MEMORY_HOST); - hypre_TFree(fac_interp_data -> identity_arrayboxes, HYPRE_MEMORY_HOST); - hypre_TFree(fac_interp_data -> ownboxes, HYPRE_MEMORY_HOST); - hypre_TFree(fac_interp_data -> own_cboxnums, HYPRE_MEMORY_HOST); - - 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++) - { - hypre_TFree(fac_interp_data -> weights[i], HYPRE_MEMORY_HOST); - } - hypre_TFree(fac_interp_data -> weights, HYPRE_MEMORY_HOST); - - hypre_TFree(fac_interp_data, HYPRE_MEMORY_HOST); - } - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_FacSemiInterpSetup2: - * Note that an intermediate coarse SStruct_PVector is used in interpolating - * the interlevel communicated data (coarse data). The data in these - * intermediate vectors will be interpolated to the fine grid. - *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_FacSemiInterpSetup2( void *fac_interp_vdata, - hypre_SStructVector *e, - hypre_SStructPVector *ec, - hypre_Index rfactors) -{ - 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_CommPkg **gnodes_comm_pkg; - hypre_CommPkg **interlevel_comm; - hypre_CommInfo *comm_info; - - hypre_SStructPVector *recv_cvectors; - hypre_SStructPGrid *recv_cgrid; - HYPRE_Int **recv_boxnum_map; - hypre_SStructGrid *temp_grid; - - hypre_SStructPGrid *pgrid; - - hypre_SStructPVector *ef = hypre_SStructVectorPVector(e, part_fine); - hypre_StructVector *e_var, *s_rc, *s_cvector; - - hypre_BoxArrayArray **identity_arrayboxes; - hypre_BoxArrayArray **ownboxes; - - hypre_BoxArrayArray **send_boxes, *send_rboxes; - HYPRE_Int ***send_processes; - HYPRE_Int ***send_remote_boxnums; - - hypre_BoxArrayArray **recv_boxes, *recv_rboxes; - HYPRE_Int ***recv_processes; - HYPRE_Int ***recv_remote_boxnums; - - hypre_BoxArray *boxarray; - hypre_BoxArray *tmp_boxarray, *intersect_boxes; - hypre_Box box, scaled_box; - HYPRE_Int ***own_cboxnums; - - hypre_BoxManager *boxman1; - hypre_BoxManEntry **boxman_entries; - HYPRE_Int nboxman_entries; - - HYPRE_Int nvars = hypre_SStructPVectorNVars(ef); - HYPRE_Int vars; - - hypre_Index zero_index, index; - hypre_Index ilower, iupper; - HYPRE_Int *num_ghost; - - HYPRE_Int ndim, i, j, k, fi, ci; - HYPRE_Int cnt1, cnt2; - HYPRE_Int proc, myproc, tot_procs; - HYPRE_Int num_values; - - HYPRE_Real **weights; - HYPRE_Real refine_factors_2recp[3]; - hypre_Index refine_factors_half; - - 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)); - hypre_SetIndex3(zero_index, 0, 0, 0); - - hypre_BoxInit(&box, ndim); - hypre_BoxInit(&scaled_box, ndim); - - /*------------------------------------------------------------------------ - * Intralevel communication structures- - * A communication pkg must be created for each StructVector. Stencils - * are needed in creating the packages- we are assuming that the same - * 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++) - { - e_var = hypre_SStructPVectorSVector(ec, vars); - num_ghost = hypre_StructVectorNumGhost(e_var); - - hypre_CreateCommInfoFromNumGhost(hypre_StructVectorGrid(e_var), - num_ghost, &comm_info); - hypre_CommPkgCreate(comm_info, - hypre_StructVectorDataSpace(e_var), - hypre_StructVectorDataSpace(e_var), - 1, NULL, 0, hypre_StructVectorComm(e_var), - &gnodes_comm_pkg[vars]); - hypre_CommInfoDestroy(comm_info); - } - - (fac_interp_data -> ndim) = ndim; - (fac_interp_data -> nvars) = nvars; - (fac_interp_data -> gnodes_comm_pkg) = gnodes_comm_pkg; - hypre_CopyIndex(rfactors, (fac_interp_data -> stride)); - - /*------------------------------------------------------------------------ - * Interlevel communication structures. - * - * Algorithm for identity_boxes: For each cbox on this processor, refine - * it and intersect it with the fmap. - * (cbox - all coarsened fmap_intersect boxes)= identity chunks - * for cbox. - * - * Algorithm for own_boxes (fullwgted boxes on this processor): For each - * fbox, coarsen it and boxmap intersect it with cmap. - * (cmap_intersect boxes on myproc)= ownboxes - * for this fbox. - * - * Algorithm for recv_box: For each fbox, coarsen it and boxmap intersect - * it with cmap. - * (cmap_intersect boxes off_proc)= unstretched recv_boxes. - * These boxes are stretched by one in each direction so that the ghostlayer - * 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); - - pgrid = hypre_SStructPVectorPGrid(ec); - hypre_ClearIndex(index); - for (i = 0; i < ndim; i++) - { - index[i] = rfactors[i] - 1; - } - - tmp_boxarray = hypre_BoxArrayCreate(0, ndim); - 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); - - hypre_ForBoxI(ci, boxarray) - { - box = *hypre_BoxArrayBox(boxarray, ci); - hypre_AppendBox(&box, - hypre_BoxArrayArrayBoxArray(identity_arrayboxes[vars], ci)); - - hypre_StructMapCoarseToFine(hypre_BoxIMin(&box), zero_index, - rfactors, hypre_BoxIMin(&scaled_box)); - hypre_StructMapCoarseToFine(hypre_BoxIMax(&box), index, - rfactors, hypre_BoxIMax(&scaled_box)); - - hypre_BoxManIntersect(boxman1, hypre_BoxIMin(&scaled_box), - hypre_BoxIMax(&scaled_box), &boxman_entries, - &nboxman_entries); - - 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); - hypre_IntersectBoxes(&box, &scaled_box, &box); - - /* contract this refined box so that only the coarse nodes on this - processor will be subtracted. */ - for (j = 0; j < ndim; j++) - { - k = hypre_BoxIMin(&box)[j] % rfactors[j]; - if (k) - { - hypre_BoxIMin(&box)[j] += rfactors[j] - k; - } - } - - hypre_StructMapFineToCoarse(hypre_BoxIMin(&box), zero_index, - rfactors, hypre_BoxIMin(&box)); - hypre_StructMapFineToCoarse(hypre_BoxIMax(&box), zero_index, - rfactors, hypre_BoxIMax(&box)); - hypre_AppendBox(&box, intersect_boxes); - } - - hypre_SubtractBoxArrays(hypre_BoxArrayArrayBoxArray(identity_arrayboxes[vars], ci), - intersect_boxes, tmp_boxarray); - hypre_MinUnionBoxes(hypre_BoxArrayArrayBoxArray(identity_arrayboxes[vars], ci)); - - hypre_TFree(boxman_entries, HYPRE_MEMORY_HOST); - hypre_BoxArrayDestroy(intersect_boxes); - } - } - hypre_BoxArrayDestroy(tmp_boxarray); - 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); - - 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); - hypre_ClearIndex(index); - for (i = 0; i < ndim; i++) - { - index[i] = 1; - } - - 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)); - - ownboxes[vars] = hypre_BoxArrayArrayCreate(hypre_BoxArraySize(boxarray), ndim); - 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); - - hypre_ForBoxI(fi, boxarray) - { - 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++) - { - k = hypre_BoxIMin(&box)[j] % rfactors[j]; - if (k) - { - hypre_BoxIMin(&box)[j] += rfactors[j] - k; - } - } - - hypre_StructMapFineToCoarse(hypre_BoxIMin(&box), zero_index, - rfactors, hypre_BoxIMin(&scaled_box)); - hypre_StructMapFineToCoarse(hypre_BoxIMax(&box), zero_index, - rfactors, hypre_BoxIMax(&scaled_box)); - - 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++) - { - hypre_SStructBoxManEntryGetProcess(boxman_entries[i], &proc); - if (proc == myproc) - { - cnt1++; - } - else - { - cnt2++; - } - } - - 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); - - cnt1 = 0; cnt2 = 0; - for (i = 0; i < nboxman_entries; i++) - { - hypre_BoxManEntryGetExtents(boxman_entries[i], ilower, iupper); - hypre_BoxSetExtents(&box, ilower, iupper); - hypre_IntersectBoxes(&box, &scaled_box, &box); - - hypre_SStructBoxManEntryGetProcess(boxman_entries[i], &proc); - if (proc == myproc) - { - hypre_AppendBox(&box, - hypre_BoxArrayArrayBoxArray(ownboxes[vars], fi)); - hypre_SStructBoxManEntryGetBoxnum(boxman_entries[i], - &own_cboxnums[vars][fi][cnt1]); - cnt1++; - } - else - { - /* extend the box so all the required data for interpolation is recvd. */ - hypre_SubtractIndexes(hypre_BoxIMin(&box), index, 3, - hypre_BoxIMin(&box)); - hypre_AddIndexes(hypre_BoxIMax(&box), index, 3, hypre_BoxIMax(&box)); - - hypre_AppendBox(&box, - hypre_BoxArrayArrayBoxArray(recv_boxes[vars], fi)); - recv_processes[vars][fi][cnt2] = proc; - cnt2++; - } - } - hypre_TFree(boxman_entries, HYPRE_MEMORY_HOST); - } /* hypre_ForBoxI(fi, boxarray) */ - } /* for (vars= 0; vars< nvars; vars++) */ - - (fac_interp_data -> ownboxes) = ownboxes; - (fac_interp_data -> own_cboxnums) = own_cboxnums; - - /*-------------------------------------------------------------------------- - * With the recv'ed boxes form a SStructPGrid and a SStructGrid. The - * SStructGrid is needed to generate a box_manager (so that a local box ordering - * for the remote_boxnums are obtained). Record the recv_boxnum/fbox_num - * mapping. That is, we interpolate a recv_box l to a fine box m, generally - * l != m since the recv_grid and fgrid do not agree. - *--------------------------------------------------------------------------*/ - 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); - - cnt2 = 0; - hypre_ClearIndex(index); - for (i = 0; i < ndim; i++) - { - index[i] = 1; - } - for (vars = 0; vars < nvars; vars++) - { - cnt1 = 0; - hypre_ForBoxArrayI(i, recv_boxes[vars]) - { - boxarray = hypre_BoxArrayArrayBoxArray(recv_boxes[vars], i); - cnt1 += hypre_BoxArraySize(boxarray); - } - recv_boxnum_map[vars] = hypre_CTAlloc(HYPRE_Int, cnt1, HYPRE_MEMORY_HOST); - - cnt1 = 0; - hypre_ForBoxArrayI(i, recv_boxes[vars]) - { - boxarray = hypre_BoxArrayArrayBoxArray(recv_boxes[vars], i); - hypre_ForBoxI(j, boxarray) - { - box = *hypre_BoxArrayBox(boxarray, j); - - /* contract the box its actual size. */ - hypre_AddIndexes(hypre_BoxIMin(&box), index, 3, hypre_BoxIMin(&box)); - hypre_SubtractIndexes(hypre_BoxIMax(&box), index, 3, - hypre_BoxIMax(&box)); - - hypre_SStructPGridSetExtents(recv_cgrid, - hypre_BoxIMin(&box), - hypre_BoxIMax(&box)); - - HYPRE_SStructGridSetExtents(temp_grid, 0, - hypre_BoxIMin(&box), - hypre_BoxIMax(&box)); - - recv_boxnum_map[vars][cnt1] = i; /* record the fbox num. i */ - cnt1++; - cnt2++; - } - } - } - - /*------------------------------------------------------------------------ - * When there are no boxes to communicate, set the temp_grid to have a - * box of size zero. This is needed so that this SStructGrid can be - * assembled. This is done only when this only one processor. - *------------------------------------------------------------------------*/ - if (cnt2 == 0) - { - /* min_index > max_index so that the box has volume zero. */ - hypre_BoxSetExtents(&box, index, zero_index); - hypre_SStructPGridSetExtents(recv_cgrid, - hypre_BoxIMin(&box), - hypre_BoxIMax(&box)); - - HYPRE_SStructGridSetExtents(temp_grid, 0, - hypre_BoxIMin(&box), - hypre_BoxIMax(&box)); - } - - HYPRE_SStructGridSetVariables(temp_grid, 0, - hypre_SStructPGridNVars(pgrid), - hypre_SStructPGridVarTypes(pgrid)); - HYPRE_SStructGridAssemble(temp_grid); - hypre_SStructPGridSetVariables(recv_cgrid, nvars, - hypre_SStructPGridVarTypes(pgrid) ); - hypre_SStructPGridAssemble(recv_cgrid); - - hypre_SStructPVectorCreate(hypre_SStructPGridComm(recv_cgrid), recv_cgrid, - &recv_cvectors); - hypre_SStructPVectorInitialize(recv_cvectors); - hypre_SStructPVectorAssemble(recv_cvectors); - - fac_interp_data -> recv_cvectors = recv_cvectors; - fac_interp_data -> recv_boxnum_map = recv_boxnum_map; - - /* pgrid recv_cgrid no longer needed. */ - hypre_SStructPGridDestroy(recv_cgrid); - - /*------------------------------------------------------------------------ - * Send_boxes. - * Algorithm for send_boxes: For each cbox on this processor, box_map - * intersect it with temp_grid's map. - * (intersection boxes off-proc)= send_boxes for this cbox. - * Note that the send_boxes will be stretched to include the ghostlayers. - * This guarantees that all the data required for linear interpolation - * 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); - - hypre_ClearIndex(index); - for (i = 0; i < ndim; i++) - { - index[i] = 1; - } - 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)); - - 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); - 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++) - { - hypre_SStructBoxManEntryGetProcess(boxman_entries[i], &proc); - if (proc != myproc) - { - cnt1++; - } - } - 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); - - cnt1 = 0; - for (i = 0; i < nboxman_entries; i++) - { - hypre_BoxManEntryGetExtents(boxman_entries[i], ilower, iupper); - hypre_BoxSetExtents(&box, ilower, iupper); - hypre_IntersectBoxes(&box, &scaled_box, &box); - - hypre_SStructBoxManEntryGetProcess(boxman_entries[i], &proc); - if (proc != myproc) - { - /* strech the box */ - hypre_SubtractIndexes(hypre_BoxIMin(&box), index, 3, - hypre_BoxIMin(&box)); - hypre_AddIndexes(hypre_BoxIMax(&box), index, 3, hypre_BoxIMax(&box)); - - hypre_AppendBox(&box, - hypre_BoxArrayArrayBoxArray(send_boxes[vars], ci)); - - send_processes[vars][ci][cnt1] = proc; - hypre_SStructBoxManEntryGetBoxnum( - boxman_entries[i], &send_remote_boxnums[vars][ci][cnt1]); - cnt1++; - } - } - - hypre_TFree(boxman_entries, HYPRE_MEMORY_HOST); - } /* hypre_ForBoxI(ci, boxarray) */ - } /* for (vars= 0; vars< nvars; vars++) */ - - /*-------------------------------------------------------------------------- - * Can disgard temp_grid now- only needed it's box_man info, - *--------------------------------------------------------------------------*/ - HYPRE_SStructGridDestroy(temp_grid); - - /*-------------------------------------------------------------------------- - * Can create the interlevel_comm. - *--------------------------------------------------------------------------*/ - interlevel_comm = hypre_CTAlloc(hypre_CommPkg *, nvars, HYPRE_MEMORY_HOST); - - num_values = 1; - for (vars = 0; vars < nvars; 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]); - - hypre_CommInfoCreate(send_boxes[vars], recv_boxes[vars], - send_processes[vars], recv_processes[vars], - send_remote_boxnums[vars], recv_remote_boxnums[vars], - send_rboxes, recv_rboxes, 1, &comm_info); - - hypre_CommPkgCreate(comm_info, - hypre_StructVectorDataSpace(s_rc), - hypre_StructVectorDataSpace(s_cvector), - num_values, NULL, 0, - hypre_StructVectorComm(s_rc), - &interlevel_comm[vars]); - hypre_CommInfoDestroy(comm_info); - } - hypre_TFree(send_boxes, HYPRE_MEMORY_HOST); - hypre_TFree(recv_boxes, HYPRE_MEMORY_HOST); - hypre_TFree(send_processes, HYPRE_MEMORY_HOST); - hypre_TFree(recv_processes, HYPRE_MEMORY_HOST); - hypre_TFree(send_remote_boxnums, HYPRE_MEMORY_HOST); - hypre_TFree(recv_remote_boxnums, HYPRE_MEMORY_HOST); - - (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[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++) - { - refine_factors_half[i] = rfactors[i] / 2; - refine_factors_2recp[i] = 1.0 / (2.0 * rfactors[i]); - } - - for (i = 0; i < ndim; i++) - { - for (j = 0; j <= refine_factors_half[i]; j++) - { - weights[i][j] = refine_factors_2recp[i] * (rfactors[i] + 2 * j - 1.0); - } - - for (j = (refine_factors_half[i] + 1); j <= rfactors[i]; j++) - { - weights[i][j] = refine_factors_2recp[i] * (2 * j - rfactors[i] - 1.0); - } - } - (fac_interp_data -> weights) = weights; - - - return ierr; -} - -HYPRE_Int -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_Int part_crse = 0; - - HYPRE_Int ierr = 0; - - /*----------------------------------------------------------------------- - * Compute e at coarse points (injection). - * The pgrid of xc is the same as the part_csre pgrid of e. - *-----------------------------------------------------------------------*/ - hypre_SStructPartialPCopy(xc, - hypre_SStructVectorPVector(e, part_crse), - identity_boxes); - - return ierr; -} - -/*------------------------------------------------------------------------- - * Linear interpolation. Interpolate the vector first by interpolating the - * values in ownboxes and then values in recv_cvectors (the interlevel - * communicated data). - *-------------------------------------------------------------------------*/ -HYPRE_Int -hypre_FAC_WeightedInterp2(void *fac_interp_vdata, - hypre_SStructPVector *xc, - hypre_SStructVector *e_parts) -{ - HYPRE_Int ierr = 0; - - 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_SStructPVector *recv_cvectors = interp_data-> recv_cvectors; - 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; - HYPRE_Int ndim = interp_data-> ndim; - - hypre_CommHandle *comm_handle; - - hypre_IndexRef stride; /* refinement factors */ - - hypre_SStructPVector *e; - - hypre_StructGrid *fgrid; - hypre_BoxArray *fgrid_boxes; - hypre_Box *fbox; - hypre_BoxArrayArray *own_cboxes; - hypre_BoxArray *own_abox; - hypre_Box *ownbox; - HYPRE_Int **var_boxnums; - HYPRE_Int *cboxnums; - - hypre_Box *xc_dbox; - hypre_Box *e_dbox; - - hypre_Box refined_box, intersect_box; - - - hypre_StructVector *xc_var; - hypre_StructVector *e_var; - hypre_StructVector *recv_var; - - HYPRE_Real ***xcp; - HYPRE_Real ***ep; - - hypre_Index loop_size, lindex; - hypre_Index start, start_offset; - hypre_Index startc; - hypre_Index stridec; - hypre_Index refine_factors; - hypre_Index refine_factors_half; - hypre_Index intersect_size; - hypre_Index zero_index, temp_index1, temp_index2; - - HYPRE_Int fi, bi; - HYPRE_Int nvars, var; - - HYPRE_Int i, j, k, offset_ip1, offset_jp1, offset_kp1; - 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_Real xweight1, xweight2; - HYPRE_Real yweight1 = 0.0, yweight2 = 0.0; - HYPRE_Real zweight1 = 0.0, zweight2 = 0.0; - - /*----------------------------------------------------------------------- - * Initialize some things - *-----------------------------------------------------------------------*/ - - hypre_BoxInit(&refined_box, ndim); - hypre_BoxInit(&intersect_box, ndim); - - 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++) - { - refine_factors[i] = 1; - } - hypre_SetIndex3(stridec, 1, 1, 1); - for (i = 0; i < ndim; i++) - { - refine_factors_half[i] = refine_factors[i] / 2; - } - - /*----------------------------------------------------------------------- - * Compute e in the refined patch. But first communicate the coarse - * 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++) - { - xc_var = hypre_SStructPVectorSVector(xc, var); - hypre_InitializeCommunication(comm_pkg[var], - hypre_StructVectorData(xc_var), - hypre_StructVectorData(xc_var), 0, 0, - &comm_handle); - hypre_FinalizeCommunication(comm_handle); - - if (recv_cvectors != NULL) - { - recv_var = hypre_SStructPVectorSVector(recv_cvectors, var); - hypre_InitializeCommunication(interlevel_comm[var], - hypre_StructVectorData(xc_var), - hypre_StructVectorData(recv_var), 0, 0, - &comm_handle); - hypre_FinalizeCommunication(comm_handle); - } - } - - e = hypre_SStructVectorPVector(e_parts, part_fine); - - /*----------------------------------------------------------------------- - * Allocate memory for the data pointers. Assuming linear interpolation. - * We stride through the refinement patch by the refinement factors, and - * so we must have pointers to the intermediate fine nodes=> ep will - * be size refine_factors[2]*refine_factors[1]. This holds for all - * dimensions since refine_factors[i]= 1 for i>= ndim. - * Note that we need 3 coarse nodes per coordinate direction for the - * interpolating. This is dimensional dependent: - * ndim= 3 kplane= 0,1,2 & jplane= 0,1,2 **ptr size [3][3] - * 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; - if (ndim < 3) - { - ksize = 1; - } - if (ndim < 2) - { - 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++) - { - ep[k] = hypre_TAlloc(HYPRE_Real *, refine_factors[1], HYPRE_MEMORY_HOST); - } - - for (k = 0; k < ksize; k++) - { - xcp[k] = hypre_TAlloc(HYPRE_Real *, jsize, HYPRE_MEMORY_HOST); - } - - for (var = 0; var < nvars; var++) - { - xc_var = hypre_SStructPVectorSVector(xc, var); - e_var = hypre_SStructPVectorSVector(e, var); - - fgrid = hypre_StructVectorGrid(e_var); - fgrid_boxes = hypre_StructGridBoxes(fgrid); - - own_cboxes = ownboxes[var]; - var_boxnums = own_cboxnums[var]; - - /*-------------------------------------------------------------------- - * Interpolate the own_box coarse grid values. - *--------------------------------------------------------------------*/ - hypre_ForBoxI(fi, fgrid_boxes) - { - 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]; - - /*-------------------------------------------------------------------- - * Get the ptrs for the fine struct_vectors. - *--------------------------------------------------------------------*/ - for (k = 0; k < refine_factors[2]; k++) - { - 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); - } - } - - hypre_ForBoxI(bi, own_abox) - { - 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++) - { - temp_index1[j] = refine_factors[j] - 1; - } - hypre_StructMapCoarseToFine(hypre_BoxIMax(ownbox), temp_index1, - refine_factors, hypre_BoxIMax(&refined_box)); - hypre_IntersectBoxes(fbox, &refined_box, &intersect_box); - - xc_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(xc_var), - cboxnums[bi]); - - /*----------------------------------------------------------------- - * Get ptrs for the crse struct_vectors. For linear interpolation - * and arbitrary refinement factors, we need to point to the correct - * coarse grid nodes. Note that the ownboxes were created so that - * only the coarse nodes inside a fbox are contained in ownbox. - * Since we loop over the fine intersect box, we need to refine - * ownbox. - *-----------------------------------------------------------------*/ - hypre_CopyIndex(hypre_BoxIMin(&intersect_box), start); - hypre_CopyIndex(hypre_BoxIMax(&intersect_box), intersect_size); - for (i = 0; i < 3; i++) - { - intersect_size[i] -= (start[i] - 1); - } - - /*------------------------------------------------------------------ - * The fine intersection box may not be divisible by the refinement - * factor. This means that the interpolated coarse nodes and their - * wieghts must be carefully determined. We accomplish this using the - * offset away from a fine index that is divisible by the factor. - * Because the ownboxes were created so that only coarse nodes - * completely in the fbox are included, start is always divisible - * by refine_factors. We do the calculation anyways for future changes. - *------------------------------------------------------------------*/ - hypre_ClearIndex(start_offset); - for (i = 0; i < ndim; 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 = -1; - } - - ptr_jshift = 0; - if ( start[1] % refine_factors[1] < refine_factors_half[1] && ndim >= 2 ) - { - ptr_jshift = -1; - } - - ptr_ishift = 0; - if ( start[0] % refine_factors[0] < refine_factors_half[0] ) - { - ptr_ishift = -1; - } - - for (k = 0; k < ksize; k++) - { - 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_CopyIndex(hypre_BoxIMin(ownbox), startc); - hypre_BoxGetSize(ownbox, loop_size); - - hypre_SerialBoxLoop2Begin(ndim, loop_size, - e_dbox, start, stride, ei, - xc_dbox, startc, stridec, xci); - { - /*-------------------------------------------------------- - * Linear interpolation. Determine the weights and the - * correct coarse grid values to be weighted. All fine - * values in an agglomerated coarse cell or in the remainder - * agglomerated coarse cells are determined. The upper - * 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++) - { - if (ndim == 3) - { - 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; - } - else - { - kshift = 1; - if (offset_kp1 > refine_factors_half[2] && - offset_kp1 <= refine_factors[2]) - { - zweight2 = weights[2][offset_kp1]; - } - else - { - zweight2 = weights[2][offset_kp1 - refine_factors[2]]; - } - } - zweight1 = 1.0 - zweight2; - } - else - { - if (offset_kp1 > refine_factors_half[2] && - offset_kp1 <= refine_factors[2]) - { - zweight2 = weights[2][offset_kp1]; - kshift = 0; - } - else - { - kshift = 0; - offset_kp1 -= refine_factors[2]; - if (offset_kp1 > 0 && offset_kp1 <= refine_factors_half[2]) - { - zweight2 = weights[2][offset_kp1]; - } - else - { - zweight2 = weights[2][offset_kp1]; - kshift = 1; - } - } - zweight1 = 1.0 - zweight2; - } - } /* if (ndim == 3) */ - - for (j = 0; j < jmax; j++) - { - if (ndim >= 2) - { - 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; - } - else - { - jshift = 1; - if (offset_jp1 > refine_factors_half[1] && - offset_jp1 <= refine_factors[1]) - { - yweight2 = weights[1][offset_jp1]; - } - else - { - yweight2 = weights[1][offset_jp1 - refine_factors[1]]; - } - } - yweight1 = 1.0 - yweight2; - } - - else - { - if (offset_jp1 > refine_factors_half[1] && - offset_jp1 <= refine_factors[1]) - { - yweight2 = weights[1][offset_jp1]; - jshift = 0; - } - else - { - jshift = 0; - offset_jp1 -= refine_factors[1]; - if (offset_jp1 > 0 && offset_jp1 <= refine_factors_half[1]) - { - yweight2 = weights[1][offset_jp1]; - } - else - { - yweight2 = weights[1][offset_jp1]; - jshift = 1; - } - } - yweight1 = 1.0 - yweight2; - } - } /* if (ndim >= 2) */ - - for (i = 0; i < imax; i++) - { - 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; - } - else - { - ishift = 1; - if (offset_ip1 > refine_factors_half[0] && - offset_ip1 <= refine_factors[0]) - { - xweight2 = weights[0][offset_ip1]; - } - else - { - xweight2 = weights[0][offset_ip1 - refine_factors[0]]; - } - } - xweight1 = 1.0 - xweight2; - } - - else - { - if (offset_ip1 > refine_factors_half[0] && - offset_ip1 <= refine_factors[0]) - { - xweight2 = weights[0][offset_ip1]; - ishift = 0; - } - else - { - ishift = 0; - offset_ip1 -= refine_factors[0]; - if (offset_ip1 > 0 && offset_ip1 <= refine_factors_half[0]) - { - xweight2 = weights[0][offset_ip1]; - } - else - { - xweight2 = weights[0][offset_ip1]; - ishift = 1; - } - } - 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]) ); - } - 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]); - } - else - { - 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++) */ - } /* for (k= 0; k< kmax; k++) */ - } - hypre_SerialBoxLoop2End(ei, xci); - - }/* hypre_ForBoxI(bi, own_abox) */ - } /* hypre_ForBoxArray(fi, fgrid_boxes) */ - - /*-------------------------------------------------------------------- - * Interpolate the off-processor coarse grid values. These are the - * recv_cvector values. We will use the ownbox ptrs. - * recv_vector is non-null even when it has a grid with zero-volume - * boxes. - *--------------------------------------------------------------------*/ - recv_var = hypre_SStructPVectorSVector(recv_cvectors, var); - own_abox = hypre_StructGridBoxes(hypre_StructVectorGrid(recv_var)); - cboxnums = recv_boxnum_map[var]; - - hypre_ForBoxI(bi, own_abox) - { - 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); - - fi = cboxnums[bi]; - fbox = hypre_BoxArrayBox(fgrid_boxes, 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 (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); - } - } - - hypre_StructMapCoarseToFine(hypre_BoxIMin(ownbox), zero_index, - refine_factors, hypre_BoxIMin(&refined_box)); - hypre_ClearIndex(temp_index1); - for (j = 0; j < ndim; j++) - { - temp_index1[j] = refine_factors[j] - 1; - } - hypre_StructMapCoarseToFine(hypre_BoxIMax(ownbox), temp_index1, - refine_factors, hypre_BoxIMax(&refined_box)); - hypre_IntersectBoxes(fbox, &refined_box, &intersect_box); - - /*----------------------------------------------------------------- - * Get ptrs for the crse struct_vectors. For linear interpolation - * and arbitrary refinement factors, we need to point to the correct - * coarse grid nodes. Note that the ownboxes were created so that - * only the coarse nodes inside a fbox are contained in ownbox. - * Since we loop over the fine intersect box, we need to refine - * ownbox. - *-----------------------------------------------------------------*/ - hypre_CopyIndex(hypre_BoxIMin(&intersect_box), start); - hypre_CopyIndex(hypre_BoxIMax(&intersect_box), intersect_size); - for (i = 0; i < 3; i++) - { - intersect_size[i] -= (start[i] - 1); - } - - /*------------------------------------------------------------------ - * The fine intersection box may not be divisible by the refinement - * factor. This means that the interpolated coarse nodes and their - * weights must be carefully determined. We accomplish this using the - * offset away from a fine index that is divisible by the factor. - * Because the ownboxes were created so that only coarse nodes - * completely in the fbox are included, start is always divisible - * by refine_factors. We do the calculation anyways for future changes. - *------------------------------------------------------------------*/ - hypre_ClearIndex(start_offset); - for (i = 0; i < ndim; 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 = -1; - } - - ptr_jshift = 0; - if ((start[1] % refine_factors[1] < refine_factors_half[1]) && ndim >= 2) - { - ptr_jshift = -1; - } - - ptr_ishift = 0; - if ( start[0] % refine_factors[0] < refine_factors_half[0] ) - { - ptr_ishift = -1; - } - - for (k = 0; k < ksize; k++) - { - 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); - } - } - - hypre_CopyIndex(hypre_BoxIMin(ownbox), startc); - hypre_BoxGetSize(ownbox, loop_size); - - hypre_SerialBoxLoop2Begin(ndim, loop_size, - e_dbox, start, stride, ei, - xc_dbox, startc, stridec, xci); - { - /*-------------------------------------------------------- - * Linear interpolation. Determine the weights and the - * correct coarse grid values to be weighted. All fine - * values in an agglomerated coarse cell or in the remainder - * agglomerated coarse cells are determined. The upper - * 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++) - { - if (ndim == 3) - { - 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; - } - else - { - kshift = 1; - if (offset_kp1 > refine_factors_half[2] && - offset_kp1 <= refine_factors[2]) - { - zweight2 = weights[2][offset_kp1]; - } - else - { - zweight2 = weights[2][offset_kp1 - refine_factors[2]]; - } - } - zweight1 = 1.0 - zweight2; - } - - else - { - if (offset_kp1 > refine_factors_half[2] && - offset_kp1 <= refine_factors[2]) - { - zweight2 = weights[2][offset_kp1]; - kshift = 0; - } - else - { - kshift = 0; - offset_kp1 -= refine_factors[2]; - if (offset_kp1 > 0 && offset_kp1 <= refine_factors_half[2]) - { - zweight2 = weights[2][offset_kp1]; - } - else - { - zweight2 = weights[2][offset_kp1]; - kshift = 1; - } - } - zweight1 = 1.0 - zweight2; - } - } /* if (ndim == 3) */ - - for (j = 0; j < jmax; j++) - { - if (ndim >= 2) - { - 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; - } - else - { - jshift = 1; - if (offset_jp1 > refine_factors_half[1] && - offset_jp1 <= refine_factors[1]) - { - yweight2 = weights[1][offset_jp1]; - } - else - { - yweight2 = weights[1][offset_jp1 - refine_factors[1]]; - } - } - yweight1 = 1.0 - yweight2; - } - - else - { - if (offset_jp1 > refine_factors_half[1] && - offset_jp1 <= refine_factors[1]) - { - yweight2 = weights[1][offset_jp1]; - jshift = 0; - } - else - { - jshift = 0; - offset_jp1 -= refine_factors[1]; - if (offset_jp1 > 0 && offset_jp1 <= refine_factors_half[1]) - { - yweight2 = weights[1][offset_jp1]; - } - else - { - yweight2 = weights[1][offset_jp1]; - jshift = 1; - } - } - yweight1 = 1.0 - yweight2; - } - } /* if (ndim >= 2) */ - - for (i = 0; i < imax; i++) - { - 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; - } - else - { - ishift = 1; - if (offset_ip1 > refine_factors_half[0] && - offset_ip1 <= refine_factors[0]) - { - xweight2 = weights[0][offset_ip1]; - } - else - { - xweight2 = weights[0][offset_ip1 - refine_factors[0]]; - } - } - xweight1 = 1.0 - xweight2; - } - - else - { - if (offset_ip1 > refine_factors_half[0] && - offset_ip1 <= refine_factors[0]) - { - xweight2 = weights[0][offset_ip1]; - ishift = 0; - } - else - { - ishift = 0; - offset_ip1 -= refine_factors[0]; - if (offset_ip1 > 0 && offset_ip1 <= refine_factors_half[0]) - { - xweight2 = weights[0][offset_ip1]; - } - else - { - xweight2 = weights[0][offset_ip1]; - ishift = 1; - } - } - 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]) ); - } - 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]); - } - - else - { - 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++) */ - } /* for (k= 0; k< kmax; k++) */ - } - hypre_SerialBoxLoop2End(ei, xci); - - } /* if (hypre_BoxVolume(ownbox)) */ - } /* hypre_ForBoxI(bi, own_abox) */ - } /* for (var= 0; var< nvars; var++)*/ - - 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++) - { - hypre_TFree(ep[k], HYPRE_MEMORY_HOST); - } - hypre_TFree(ep, HYPRE_MEMORY_HOST); - - /*----------------------------------------------------------------------- - * Return - *-----------------------------------------------------------------------*/ - return ierr; -} diff --git a/src/sstruct_ls/fac_relax.c b/src/sstruct_ls/fac_relax.c deleted file mode 100644 index b111ebe1d5..0000000000 --- a/src/sstruct_ls/fac_relax.c +++ /dev/null @@ -1,34 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other - * HYPRE Project Developers. See the top-level COPYRIGHT file for details. - * - * SPDX-License-Identifier: (Apache-2.0 OR MIT) - ******************************************************************************/ - -/****************************************************************************** - * FAC relaxation. Refinement patches are solved using system pfmg - * relaxation. - ******************************************************************************/ - -#include "_hypre_sstruct_ls.h" -#include "fac.h" - -#define DEBUG 0 - -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_SysPFMGRelaxSetPreRelax(relax_vdata); - hypre_SysPFMGRelaxSetMaxIter(relax_vdata, num_relax); - hypre_SysPFMGRelaxSetZeroGuess(relax_vdata, *zero_guess); - hypre_SysPFMGRelax(relax_vdata, A, b, x); - zero_guess = 0; - - return 0; -} - diff --git a/src/sstruct_ls/fac_restrict2.c b/src/sstruct_ls/fac_restrict2.c deleted file mode 100644 index 36b7bf45b7..0000000000 --- a/src/sstruct_ls/fac_restrict2.c +++ /dev/null @@ -1,929 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other - * HYPRE Project Developers. See the top-level COPYRIGHT file for details. - * - * SPDX-License-Identifier: (Apache-2.0 OR MIT) - ******************************************************************************/ - -/****************************************************************************** - * OpenMP Problems - * - * Are private static arrays a problem? - * - ******************************************************************************/ - -/****************************************************************************** - * FAC composite level restriction. - * Injection away from the refinement patches; constant restriction - * inside patch. - ******************************************************************************/ - -#include "_hypre_sstruct_ls.h" -#include "_hypre_struct_mv.hpp" -#include "fac.h" - -#define MapCellRank(i, j , k, rank) \ - { \ - rank = 4*k + 2*j + i; \ - } - -#define InverseMapCellRank(rank, stencil) \ - { \ - HYPRE_Int ij,ii,jj,kk; \ - ij = (rank%4); \ - ii = (ij%2); \ - jj = (ij-ii)/2; \ - kk = (rank-2*jj-ii)/4; \ - hypre_SetIndex3(stencil, ii, jj, kk); \ - } - -/*-------------------------------------------------------------------------- - * hypre_FacSemiRestrictData data structure - *--------------------------------------------------------------------------*/ - -typedef struct -{ - HYPRE_Int nvars; - hypre_Index stride; - - hypre_SStructPVector *fgrid_cvectors; /* the grid of this vector may not - be on the actual grid */ - hypre_BoxArrayArray **identity_arrayboxes; - hypre_BoxArrayArray **fullwgt_ownboxes; - hypre_BoxArrayArray **fullwgt_sendboxes; - - 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_FacSemiRestrictData2; - -/*-------------------------------------------------------------------------- - * hypre_FacSemiRestrictCreate - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_FacSemiRestrictCreate2( void **fac_restrict_vdata_ptr) -{ - HYPRE_Int ierr = 0; - hypre_FacSemiRestrictData2 *fac_restrict_data; - - fac_restrict_data = hypre_CTAlloc(hypre_FacSemiRestrictData2, 1, HYPRE_MEMORY_HOST); - *fac_restrict_vdata_ptr = (void *) fac_restrict_data; - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_FacSemiRestrictSetup: - * Two types of communication are needed- one for the interlevel coarsened - * fine boxes, and the other for the ghostlayer of the restricted vector. - * - * Approach: Identity away from the patches & fullweighting in a patch. - * Since a fbox may not have the desired mapping - * fbox= [a_0, a_1, a_2]x [b_0, b_1, b_2], a_i= c_i*rfactor[i] - * b_i= f_i*rfactor[i] + g_i - * with g_i= (rfactor[i]-1), attention must be paid to what the own_boxes, - * send_boxes, and recv_boxes are. These map overlap. The reason: - * myproc fullwgts what it can or equivalently, gets the restriction - * contributions of its data. Some off_procs can compute the remaining - * part of the agglomerate belonging to myproc and communicate it to myproc. - * Hence, myproc's own_boxes contains these nodes as well as myproc's - * recv_boxes. - *--------------------------------------------------------------------------*/ - -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 ierr = 0; - - hypre_FacSemiRestrictData2 *fac_restrict_data = (hypre_FacSemiRestrictData2 *)fac_restrict_vdata; - MPI_Comm comm = hypre_SStructPVectorComm(rc); - hypre_CommInfo *comm_info; - hypre_CommPkg **interlevel_comm; - - hypre_SStructPVector *rf = hypre_SStructVectorPVector(r, part_fine); - hypre_StructVector *s_rc, *s_cvector; - hypre_SStructPGrid *pgrid; - - hypre_SStructPVector *fgrid_cvectors; - hypre_SStructPGrid *fgrid_coarsen; - hypre_BoxArrayArray **identity_arrayboxes; - hypre_BoxArrayArray **fullwgt_ownboxes; - hypre_BoxArrayArray **fullwgt_sendboxes; - hypre_BoxArray *boxarray; - hypre_BoxArray *tmp_boxarray, *intersect_boxes; - HYPRE_Int ***own_cboxnums; - - hypre_BoxArrayArray **send_boxes, *send_rboxes; - HYPRE_Int ***send_processes; - HYPRE_Int ***send_remote_boxnums; - - hypre_BoxArrayArray **recv_boxes, *recv_rboxes; - HYPRE_Int ***recv_processes; - HYPRE_Int ***recv_remote_boxnums; - - hypre_BoxManager *boxman; - hypre_BoxManEntry **boxman_entries; - HYPRE_Int nboxman_entries; - - hypre_Box box, scaled_box; - - hypre_Index zero_index, index, ilower, iupper; - HYPRE_Int ndim = hypre_SStructVectorNDim(r); - HYPRE_Int myproc, proc; - HYPRE_Int nvars, vars; - HYPRE_Int num_values; - - HYPRE_Int i, cnt1, cnt2; - HYPRE_Int fi, ci; - - hypre_BoxInit(&box, ndim); - hypre_BoxInit(&scaled_box, ndim); - - hypre_MPI_Comm_rank(comm, &myproc); - hypre_ClearIndex(zero_index); - - nvars = hypre_SStructPVectorNVars(rc); - (fac_restrict_data -> nvars) = nvars; - hypre_CopyIndex(rfactors, (fac_restrict_data -> stride)); - for (i = ndim; i < 3; i++) - { - 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++) - { - boxarray = hypre_StructGridBoxes(hypre_SStructPGridSGrid(pgrid, vars)); - hypre_ForBoxI(fi, boxarray) - { - hypre_CopyBox(hypre_BoxArrayBox(boxarray, fi), &box); - hypre_StructMapFineToCoarse(hypre_BoxIMin(&box), zero_index, - rfactors, hypre_BoxIMin(&box)); - hypre_StructMapFineToCoarse(hypre_BoxIMax(&box), zero_index, - rfactors, hypre_BoxIMax(&box)); - hypre_SStructPGridSetExtents(fgrid_coarsen, - hypre_BoxIMin(&box), - hypre_BoxIMax(&box)); - } - } - hypre_SStructPGridSetVariables( fgrid_coarsen, nvars, - hypre_SStructPGridVarTypes(pgrid) ); - hypre_SStructPGridAssemble(fgrid_coarsen); - - hypre_SStructPVectorCreate(hypre_SStructPGridComm(fgrid_coarsen), fgrid_coarsen, - &fgrid_cvectors); - hypre_SStructPVectorInitialize(fgrid_cvectors); - hypre_SStructPVectorAssemble(fgrid_cvectors); - - /* pgrid fgrid_coarsen no longer needed */ - hypre_SStructPGridDestroy(fgrid_coarsen); - - fac_restrict_data -> fgrid_cvectors = fgrid_cvectors; - - /*-------------------------------------------------------------------------- - * boxes that are not underlying a fine box: - * - * algorithm: subtract all coarsened fine grid boxes that intersect with - * this processor's coarse boxes. Note that we cannot loop over all the - * coarsened fine boxes and subtract them from the coarse grid since we do - * not know if some of the overlying fine boxes belong on another - * processor. For each cbox, we get a boxarray of boxes that are not - * underlying-> size(identity_arrayboxes[vars])= #cboxes. - * - * Note that no contraction is needed for the intersect boxes since they - * 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); - - hypre_ClearIndex(index); - for (i = 0; i < ndim; i++) - { - index[i] = rfactors[i] - 1; - } - - tmp_boxarray = hypre_BoxArrayCreate(0, ndim); - for (vars = 0; vars < nvars; 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); - - hypre_ForBoxI(ci, boxarray) - { - hypre_CopyBox(hypre_BoxArrayBox(boxarray, ci), &box); - hypre_AppendBox(&box, - hypre_BoxArrayArrayBoxArray(identity_arrayboxes[vars], ci)); - - hypre_StructMapCoarseToFine(hypre_BoxIMin(&box), zero_index, - rfactors, hypre_BoxIMin(&scaled_box)); - hypre_StructMapCoarseToFine(hypre_BoxIMax(&box), index, - rfactors, hypre_BoxIMax(&scaled_box)); - - hypre_BoxManIntersect(boxman, hypre_BoxIMin(&scaled_box), - hypre_BoxIMax(&scaled_box), &boxman_entries, - &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++) - { - hypre_BoxManEntryGetExtents(boxman_entries[i], ilower, iupper); - hypre_BoxSetExtents(&box, ilower, iupper); - hypre_IntersectBoxes(&box, &scaled_box, &box); - - hypre_StructMapFineToCoarse(hypre_BoxIMin(&box), zero_index, - rfactors, hypre_BoxIMin(&box)); - hypre_StructMapFineToCoarse(hypre_BoxIMax(&box), zero_index, - rfactors, hypre_BoxIMax(&box)); - hypre_AppendBox(&box, intersect_boxes); - } - - hypre_SubtractBoxArrays(hypre_BoxArrayArrayBoxArray(identity_arrayboxes[vars], ci), - intersect_boxes, tmp_boxarray); - hypre_MinUnionBoxes(hypre_BoxArrayArrayBoxArray(identity_arrayboxes[vars], ci)); - - hypre_TFree(boxman_entries, HYPRE_MEMORY_HOST); - hypre_BoxArrayDestroy(intersect_boxes); - } - } - hypre_BoxArrayDestroy(tmp_boxarray); - fac_restrict_data -> identity_arrayboxes = identity_arrayboxes; - - /*-------------------------------------------------------------------------- - * fboxes that are coarsened. Some will be sent. We create the communication - * pattern. For each fbox, we need a boxarray of sendboxes or ownboxes. - * - * Algorithm: Coarsen each fbox and see which cboxes it intersects using - * BoxManIntersect. Cboxes that do not belong on the processor will have - * a chunk sent to it. - * - * 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); - - 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++) - { - 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); - - 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(fi, boxarray) - { - hypre_CopyBox(hypre_BoxArrayBox(boxarray, fi), &box); - hypre_StructMapFineToCoarse(hypre_BoxIMin(&box), zero_index, - rfactors, hypre_BoxIMin(&scaled_box)); - hypre_StructMapFineToCoarse(hypre_BoxIMax(&box), zero_index, - rfactors, hypre_BoxIMax(&scaled_box)); - - 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++) - { - hypre_SStructBoxManEntryGetProcess(boxman_entries[i], &proc); - if (proc != myproc) - { - cnt1++; - } - else - { - cnt2++; - } - } - 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); - own_cboxnums[vars][fi] = hypre_CTAlloc(HYPRE_Int, cnt2, HYPRE_MEMORY_HOST); - - cnt1 = 0; cnt2 = 0; - for (i = 0; i < nboxman_entries; i++) - { - hypre_BoxManEntryGetExtents(boxman_entries[i], ilower, iupper); - hypre_BoxSetExtents(&box, ilower, iupper); - hypre_IntersectBoxes(&box, &scaled_box, &box); - - hypre_SStructBoxManEntryGetProcess(boxman_entries[i], &proc); - if (proc != myproc) - { - hypre_AppendBox(&box, - hypre_BoxArrayArrayBoxArray(fullwgt_sendboxes[vars], fi)); - hypre_AppendBox(&box, - hypre_BoxArrayArrayBoxArray(send_boxes[vars], fi)); - - send_processes[vars][fi][cnt1] = proc; - hypre_SStructBoxManEntryGetBoxnum(boxman_entries[i], - &send_remote_boxnums[vars][fi][cnt1]); - cnt1++; - } - - else - { - hypre_AppendBox(&box, - hypre_BoxArrayArrayBoxArray(fullwgt_ownboxes[vars], fi)); - hypre_SStructBoxManEntryGetBoxnum(boxman_entries[i], - &own_cboxnums[vars][fi][cnt2]); - cnt2++; - } - } - hypre_TFree(boxman_entries, HYPRE_MEMORY_HOST); - - } /* 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; - - /*-------------------------------------------------------------------------- - * coarsened fboxes this processor will receive. - * - * Algorithm: For each cbox on this processor, refine it and find which - * 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); - - /* dummy pointer for CommInfoCreate */ - recv_remote_boxnums = hypre_CTAlloc(HYPRE_Int **, nvars, HYPRE_MEMORY_HOST); - - 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)); - - 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); - - hypre_ForBoxI(ci, boxarray) - { - hypre_CopyBox(hypre_BoxArrayBox(boxarray, ci), &box); - hypre_StructMapCoarseToFine(hypre_BoxIMin(&box), zero_index, - rfactors, hypre_BoxIMin(&scaled_box)); - hypre_StructMapCoarseToFine(hypre_BoxIMax(&box), index, - rfactors, hypre_BoxIMax(&scaled_box)); - - hypre_BoxManIntersect(boxman, hypre_BoxIMin(&scaled_box), - hypre_BoxIMax(&scaled_box), &boxman_entries, &nboxman_entries); - - cnt1 = 0; - for (i = 0; i < nboxman_entries; i++) - { - hypre_SStructBoxManEntryGetProcess(boxman_entries[i], &proc); - if (proc != myproc) - { - 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); - - cnt1 = 0; - for (i = 0; i < nboxman_entries; i++) - { - hypre_SStructBoxManEntryGetProcess(boxman_entries[i], &proc); - if (proc != myproc) - { - hypre_BoxManEntryGetExtents(boxman_entries[i], ilower, iupper); - hypre_BoxSetExtents(&box, ilower, iupper); - hypre_IntersectBoxes(&box, &scaled_box, &box); - - /* no contracting neede */ - hypre_StructMapFineToCoarse(hypre_BoxIMin(&box), zero_index, - rfactors, hypre_BoxIMin(&box)); - hypre_StructMapFineToCoarse(hypre_BoxIMax(&box), zero_index, - rfactors, hypre_BoxIMax(&box)); - hypre_AppendBox(&box, - hypre_BoxArrayArrayBoxArray(recv_boxes[vars], ci)); - - recv_processes[vars][ci][cnt1] = proc; - cnt1++; - - } /* if (proc != myproc) */ - } /* for (i= 0; i< nmap_entries; i++) */ - - hypre_TFree(boxman_entries, HYPRE_MEMORY_HOST); - - } /* hypre_ForBoxI(ci, boxarray) */ - } /* 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]); - - hypre_CommInfoCreate(send_boxes[vars], recv_boxes[vars], - send_processes[vars], recv_processes[vars], - send_remote_boxnums[vars], recv_remote_boxnums[vars], - send_rboxes, recv_rboxes, 1, &comm_info); - - hypre_CommPkgCreate(comm_info, - hypre_StructVectorDataSpace(s_cvector), - hypre_StructVectorDataSpace(s_rc), - num_values, NULL, 0, - hypre_StructVectorComm(s_rc), - &interlevel_comm[vars]); - hypre_CommInfoDestroy(comm_info); - } - hypre_TFree(send_boxes, HYPRE_MEMORY_HOST); - hypre_TFree(recv_boxes, HYPRE_MEMORY_HOST); - hypre_TFree(send_processes, HYPRE_MEMORY_HOST); - hypre_TFree(recv_processes, HYPRE_MEMORY_HOST); - hypre_TFree(send_remote_boxnums, HYPRE_MEMORY_HOST); - hypre_TFree(recv_remote_boxnums, HYPRE_MEMORY_HOST); - - (fac_restrict_data -> interlevel_comm) = interlevel_comm; - - return ierr; - -} - -HYPRE_Int -hypre_FACRestrict2( void * fac_restrict_vdata, - hypre_SStructVector * xf, - hypre_SStructPVector * xc) -{ - HYPRE_Int ierr = 0; - - 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 **fullwgt_ownboxes = restrict_data->fullwgt_ownboxes; - HYPRE_Int ***own_cboxnums = restrict_data->own_cboxnums; - hypre_CommPkg **interlevel_comm = restrict_data-> interlevel_comm; - hypre_CommHandle *comm_handle; - - HYPRE_Int ndim = hypre_SStructVectorNDim(xf); - - hypre_BoxArrayArray *arrayarray_ownboxes; - - hypre_IndexRef stride; /* refinement factors */ - - hypre_StructGrid *fgrid; - hypre_BoxArray *fgrid_boxes; - hypre_Box *fgrid_box; - hypre_StructGrid *cgrid; - hypre_BoxArray *cgrid_boxes; - hypre_BoxArray *own_boxes; - hypre_Box *own_box; - HYPRE_Int *boxnums; - - hypre_Box *xc_temp_dbox; - hypre_Box *xf_dbox; - - hypre_StructVector *xc_temp; - hypre_StructVector *xc_var; - hypre_StructVector *xf_var; - - HYPRE_Real ***xfp; - HYPRE_Real ***xcp; - HYPRE_Real ***xcp_temp; - - hypre_Index loop_size, lindex; - hypre_Index start, fbox_size, node_offset; - hypre_Index startc; - hypre_Index stridec; - hypre_Index rfactors; - hypre_Index temp_index1, temp_index2; - - HYPRE_Int fi, ci; - HYPRE_Int nvars, var; - /* HYPRE_Int volume_crse_cell; */ - - HYPRE_Int i, j, k; - HYPRE_Int imax, jmax, kmax; - HYPRE_Int icell, jcell, kcell, ijkcell; - - HYPRE_Real *sum; - HYPRE_Real scaling; - - HYPRE_Int part_crse = 0; - HYPRE_Int part_fine = 1; - HYPRE_Int num_coarse_cells; - - /*----------------------------------------------------------------------- - * Initialize some things - *-----------------------------------------------------------------------*/ - stride = (restrict_data -> stride); - - hypre_SetIndex(lindex, 0); - hypre_SetIndex(stridec, 1); - hypre_CopyIndex(stride, rfactors); - for (i = ndim; i < HYPRE_MAXDIM; i++) - { - rfactors[i] = 1; - } - - /* 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); - - /*----------------------------------------------------------------------- - * 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 *= 2; - } - 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 *= rfactors[0]; - } - - /*----------------------------------------------------------------------- - * Initialize the coarse vector to zero. - *-----------------------------------------------------------------------*/ - hypre_SStructPVectorSetConstantValues(xc, 0.0); - - /*----------------------------------------------------------------------- - * Copy the coarse data: xf[part_crse] -> xc - *-----------------------------------------------------------------------*/ - hypre_SStructPartialPCopy(hypre_SStructVectorPVector(xf, part_crse), - xc, identity_arrayboxes); - - /*----------------------------------------------------------------------- - * Piecewise constant restriction over the refinement patch. - * - * Initialize the work vector by setting to zero. - *-----------------------------------------------------------------------*/ - hypre_SStructPVectorSetConstantValues(fgrid_cvectors, 0.0); - - /*----------------------------------------------------------------------- - * Allocate memory for the data pointers. Assuming constant restriction. - * We stride through the refinement patch by the refinement factors, and - * so we must have pointers to the intermediate fine nodes=> xfp will - * be size rfactors[2]*rfactors[1]. Because the fbox may not have the - * ideal refinement form, we need to contribute to 2^ndim cells. - *-----------------------------------------------------------------------*/ - 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[k] = hypre_TAlloc(HYPRE_Real *, 2, HYPRE_MEMORY_HOST); - xcp[k] = hypre_TAlloc(HYPRE_Real *, 2, HYPRE_MEMORY_HOST); - } - } - else /* 1d does not really require these HYPRE_Real ptrs */ - { - 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[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[k] = hypre_TAlloc(HYPRE_Real *, rfactors[1], HYPRE_MEMORY_HOST); - } - - for (var = 0; var < nvars; 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); - cgrid = hypre_StructVectorGrid(xc_temp); - cgrid_boxes = hypre_StructGridBoxes(cgrid); - - hypre_ForBoxI(fi, fgrid_boxes) - { - 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 (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); - } - } - - /*-------------------------------------------------------------------- - * Get the ptrs for the coarse struct_vectors. Note that the coarse - * work vector is indexed with respect to the local fine box no.'s. - * Work vectors were created this way. - * Dimensionally dependent. - *--------------------------------------------------------------------*/ - xc_temp_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(xc_temp), fi); - if (ndim > 1) - { - for (k = 0; k < (ndim - 1); k++) - { - 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); - } - } - } - else /* 1d case */ - { - hypre_ClearIndex(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); - - /*-------------------------------------------------------------------- - * Adjust "fbox_size" so that this hypre_Index is appropriate for - * ndim < 3. - * fbox_size= hypre_BoxIMax(fgrid_box)-hypre_BoxIMin(fgrid_box)+1. - *--------------------------------------------------------------------*/ - for (i = 0; i < 3; i++) - { - fbox_size[i] -= (start[i] - 1); - } - - /*-------------------------------------------------------------------- - * The fine intersection box may not be divisible by the refinement - * factor. We need to know the remainder to determine which - * coarse node gets the restricted values. - *--------------------------------------------------------------------*/ - hypre_ClearIndex(node_offset); - for (i = 0; i < ndim; i++) - { - node_offset[i] = rfactors[i] - (start[i] % rfactors[i]) - 1; - } - - hypre_SetIndex3(temp_index2, 0, 0, 0); - hypre_StructMapFineToCoarse(start, temp_index2, rfactors, startc); - - hypre_BoxGetSize(fgrid_box, temp_index1); - hypre_StructMapFineToCoarse(temp_index1, temp_index2, rfactors, loop_size); - - hypre_SerialBoxLoop2Begin(ndim, loop_size, - xf_dbox, start, stride, xfi, - xc_temp_dbox, startc, stridec, xci); - { - /*----------------------------------------------------------------- - * Arithmetic average the refinement patch values to get - * restricted coarse grid values in an agglomerate; i.e., - * 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] ); - - for (i = 0; i < num_coarse_cells; i++) - { - sum[i] = 0.0; - } - - for (k = 0; k < kmax; k++) - { - kcell = 1; - if (k <= node_offset[2]) - { - kcell = 0; - } - - for (j = 0; j < jmax; j++) - { - jcell = 1; - if (j <= node_offset[1]) - { - jcell = 0; - } - - for (i = 0; i < imax; i++) - { - icell = 1; - if (i <= node_offset[0]) - { - icell = 0; - } - - MapCellRank(icell, jcell, kcell, ijkcell); - sum[ijkcell] += xfp[k][j][xfi + i]; - } - } - } - - /*----------------------------------------------------------------- - * Add the compute averages to the correct coarse cell. - *-----------------------------------------------------------------*/ - for (ijkcell = 0; ijkcell < num_coarse_cells; ijkcell++) - { - if (sum[ijkcell] != 0.0) - { - 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]; - } - } - - } - hypre_SerialBoxLoop2End(xfi, xci); - - } /* hypre_ForBoxI(fi, fgrid_boxes) */ - } /* for (var= 0; var< nvars; var++)*/ - - /*------------------------------------------------------------------ - * Communicate calculated restricted function over the coarsened - * patch. Only actual communicated values will be put in the - * coarse vector. - *------------------------------------------------------------------*/ - for (var = 0; var < nvars; 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, - &comm_handle); - - hypre_FinalizeCommunication(comm_handle); - } - - /*------------------------------------------------------------------ - * Need to add the coarsened patches that belong on this processor - * to the coarse vector. - *------------------------------------------------------------------*/ - for (var = 0; var < nvars; 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]; - hypre_ForBoxI(ci, cgrid_boxes) - { - 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); - 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]); - - hypre_BoxGetSize(own_box, loop_size); - -#define DEVICE_VAR is_device_ptr(xcp, xcp_temp) - hypre_BoxLoop2Begin(ndim, loop_size, - 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]; - } - hypre_BoxLoop2End(xfi, xci); -#undef DEVICE_VAR - - } /* hypre_ForBoxI(i, own_boxes) */ - } /* hypre_ForBoxI(ci, cgrid_boxes) */ - } /* for (var= 0; var< nvars; var++) */ - - hypre_TFree(sum, HYPRE_MEMORY_HOST); - for (k = 0; k < rfactors[2]; k++) - { - hypre_TFree(xfp[k], HYPRE_MEMORY_HOST); - } - hypre_TFree(xfp, HYPRE_MEMORY_HOST); - - if (ndim > 1) - { - for (k = 0; k < (ndim - 1); k++) - { - hypre_TFree(xcp_temp[k], HYPRE_MEMORY_HOST); - hypre_TFree(xcp[k], HYPRE_MEMORY_HOST); - } - } - else - { - hypre_TFree(xcp_temp[0], HYPRE_MEMORY_HOST); - hypre_TFree(xcp[0], HYPRE_MEMORY_HOST); - } - - hypre_TFree(xcp_temp, HYPRE_MEMORY_HOST); - hypre_TFree(xcp, HYPRE_MEMORY_HOST); - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_FacSemiRestrictDestroy - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_FacSemiRestrictDestroy2( void *fac_restrict_vdata ) -{ - HYPRE_Int ierr = 0; - hypre_FacSemiRestrictData2 *fac_restrict_data = (hypre_FacSemiRestrictData2 *)fac_restrict_vdata; - HYPRE_Int nvars; - HYPRE_Int i, j; - - - if (fac_restrict_data) - { - nvars = (fac_restrict_data-> nvars); - hypre_SStructPVectorDestroy(fac_restrict_data-> fgrid_cvectors); - - 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++) - { - hypre_TFree((fac_restrict_data -> own_cboxnums)[i][j], HYPRE_MEMORY_HOST); - } - hypre_TFree((fac_restrict_data -> own_cboxnums)[i], HYPRE_MEMORY_HOST); - - hypre_BoxArrayArrayDestroy((fac_restrict_data -> fullwgt_ownboxes)[i]); - hypre_CommPkgDestroy((fac_restrict_data -> interlevel_comm)[i]); - } - - hypre_TFree(fac_restrict_data -> identity_arrayboxes, HYPRE_MEMORY_HOST); - hypre_TFree(fac_restrict_data -> fullwgt_sendboxes, HYPRE_MEMORY_HOST); - hypre_TFree(fac_restrict_data -> own_cboxnums, HYPRE_MEMORY_HOST); - hypre_TFree(fac_restrict_data -> fullwgt_ownboxes, HYPRE_MEMORY_HOST); - hypre_TFree(fac_restrict_data -> interlevel_comm, HYPRE_MEMORY_HOST); - - hypre_TFree(fac_restrict_data, HYPRE_MEMORY_HOST); - } - return ierr; - -} diff --git a/src/sstruct_ls/fac_setup2.c b/src/sstruct_ls/fac_setup2.c deleted file mode 100644 index 79537ec885..0000000000 --- a/src/sstruct_ls/fac_setup2.c +++ /dev/null @@ -1,953 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_sstruct_ls.h" -#include "_hypre_struct_mv.hpp" -#include "fac.h" - -/*-------------------------------------------------------------------------- - * hypre_FacSetup2: Constructs the level composite structures. - * Each consists only of two levels, the refinement patches and the - * coarse parent base grids. - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_FacSetup2( void *fac_vdata, - hypre_SStructMatrix *A_in, - hypre_SStructVector *b, - hypre_SStructVector *x ) -{ - HYPRE_UNUSED_VAR(b); - - hypre_FACData *fac_data = (hypre_FACData*)fac_vdata; - - HYPRE_Int *plevels = (fac_data-> plevels); - hypre_Index *rfactors = (fac_data-> prefinements); - - MPI_Comm comm; - HYPRE_Int ndim; - HYPRE_Int npart; - HYPRE_Int nparts_level = 2; - HYPRE_Int part_crse = 0; - HYPRE_Int part_fine = 1; - hypre_SStructPMatrix *A_pmatrix; - hypre_StructMatrix *A_smatrix; - hypre_Box *A_smatrix_dbox; - - hypre_SStructGrid **grid_level; - hypre_SStructGraph **graph_level; - HYPRE_Int part, level; - HYPRE_Int nvars; - - hypre_SStructGraph *graph; - hypre_SStructGrid *grid; - hypre_SStructPGrid *pgrid; - hypre_StructGrid *sgrid; - hypre_BoxArray *sgrid_boxes; - hypre_Box *sgrid_box; - hypre_SStructStencil *stencils; - hypre_BoxArray *iboxarray; - - hypre_Index *refine_factors; - hypre_IndexRef box_start; - hypre_IndexRef box_end; - - hypre_SStructUVEntry **Uventries; - HYPRE_Int nUventries; - HYPRE_Int *iUventries; - hypre_SStructUVEntry *Uventry; - hypre_SStructUEntry *Uentry; - hypre_Index index, to_index, stride; - HYPRE_Int var, to_var, to_part, level_part, level_topart; - HYPRE_Int var1, var2; - HYPRE_Int i, j, k, nUentries; - HYPRE_BigInt row_coord, to_rank; - hypre_BoxManEntry *boxman_entry; - - hypre_SStructMatrix *A_rap; - hypre_SStructMatrix **A_level; - hypre_SStructVector **b_level; - hypre_SStructVector **x_level; - hypre_SStructVector **r_level; - hypre_SStructVector **e_level; - hypre_SStructPVector **tx_level; - hypre_SStructVector *tx; - - void **matvec_data_level; - void **pmatvec_data_level; - void *matvec_data; - void **relax_data_level; - void **interp_data_level; - void **restrict_data_level; - - - /* coarsest grid solver */ - 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_Real jacobi_weight = fac_data -> jacobi_weight; - HYPRE_Int *levels; - HYPRE_Int *part_to_level; - - HYPRE_Int box, box_volume; - HYPRE_Int max_box_volume; - HYPRE_Int stencil_size; - hypre_Index stencil_shape_i, loop_size; - 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; - - HYPRE_IJMatrix ij_A; - HYPRE_Int matrix_type; - - HYPRE_Int max_cycles; - - HYPRE_Int ierr = 0; - /*hypre_SStructMatrix *nested_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; - - comm = hypre_SStructMatrixComm(A_rap); - ndim = hypre_SStructMatrixNDim(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); - - /*-------------------------------------------------------------------------- - * logging arrays. - *--------------------------------------------------------------------------*/ - if ((fac_data -> logging) > 0) - { - 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); - } - - /*-------------------------------------------------------------------------- - * Extract the amr/sstruct level/part structure and refinement factors. - *--------------------------------------------------------------------------*/ - 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++) - { - part_to_level[part] = plevels[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; - } - } - (fac_data -> level_to_part) = levels; - (fac_data -> part_to_level) = part_to_level; - (fac_data -> refine_factors) = refine_factors; - - /*-------------------------------------------------------------------------- - * 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--) - { - HYPRE_SStructGridCreate(comm, ndim, nparts_level, &grid_level[level]); - } - - for (level = max_level; level >= 0; level--) - { - /*-------------------------------------------------------------------------- - * 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); - 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_SStructGridSetVariables( grid_level[level], part_fine, - hypre_SStructPGridNVars(pgrid), - hypre_SStructPGridVarTypes(pgrid) ); - - /*----------------------------------------------------------------------- - * Create the coarsest level grid if A has only 1 level - *-----------------------------------------------------------------------*/ - if (level == 0) - { - 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_SStructGridSetVariables( grid_level[level], part_crse, - hypre_SStructPGridNVars(pgrid), - hypre_SStructPGridVarTypes(pgrid) ); - } - } - - /*-------------------------------------------------------------------------- - * 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); - 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_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_SStructGridSetVariables( grid_level[level], part_crse, - hypre_SStructPGridNVars(pgrid), - hypre_SStructPGridVarTypes(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_SStructPGridVarTypes(pgrid) ); - } - } - - HYPRE_SStructGridAssemble(grid_level[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--) - { - HYPRE_SStructGraphCreate(comm, grid_level[level], &graph_level[level]); - } - - for (level = max_level; level >= 0; level--) - { - /*----------------------------------------------------------------------- - * Create the fine part of the finest level structured graph connection. - *-----------------------------------------------------------------------*/ - if (level == max_level) - { - pgrid = hypre_SStructGridPGrid(grid, levels[level]); - nvars = hypre_SStructPGridNVars(pgrid); - for (var1 = 0; var1 < nvars; var1++) - { - stencils = hypre_SStructGraphStencil(graph, levels[level], var1); - HYPRE_SStructGraphSetStencil(graph_level[level], part_fine, var1, stencils); - - if (level == 0) - { - HYPRE_SStructGraphSetStencil(graph_level[level], part_crse, var1, stencils); - } - } - } - - /*-------------------------------------------------------------------------- - * Create the coarse part of the graph_level using the graph of A, and the - * and the fine part if level < max_level. - *--------------------------------------------------------------------------*/ - if (level > 0) - { - 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); - HYPRE_SStructGraphSetStencil(graph_level[level], part_crse, 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 ); - } - - } - } - } - - /*----------------------------------------------------------- - * Extract the non-stencil graph structure: assuming only like - * variables connect. Also count the number of unstructured - * connections per part. - * - * THE COARSEST COMPOSITE MATRIX DOES NOT HAVE ANY NON-STENCIL - * CONNECTIONS. - *-----------------------------------------------------------*/ - Uventries = hypre_SStructGraphUVEntries(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++) - { - Uventry = Uventries[iUventries[i]]; - - part = hypre_SStructUVEntryPart(Uventry); - hypre_CopyIndex(hypre_SStructUVEntryIndex(Uventry), index); - var = hypre_SStructUVEntryVar(Uventry); - nUentries = hypre_SStructUVEntryNUEntries(Uventry); - - 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); - - if ( part_to_level[part] >= part_to_level[to_part] ) - { - level = part_to_level[part]; - level_part = part_fine; - level_topart = part_crse; - } - else - { - level = part_to_level[to_part]; - level_part = part_crse; - level_topart = part_fine; - } - nrows[level]++; - - HYPRE_SStructGraphAddEntries(graph_level[level], level_part, index, - var, level_topart, to_index, to_var); - } - } - - for (level = 0; level <= max_level; level++) - { - HYPRE_SStructGraphAssemble(graph_level[level]); - } - - (fac_data -> graph_level) = graph_level; - - /*--------------------------------------------------------------- - * Create the level SStruct_Vectors, and temporary global - * 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); - - tx_level = hypre_TAlloc(hypre_SStructPVector *, max_level + 1, HYPRE_MEMORY_HOST); - - for (level = 0; level <= max_level; level++) - { - HYPRE_SStructVectorCreate(comm, grid_level[level], &b_level[level]); - HYPRE_SStructVectorInitialize(b_level[level]); - HYPRE_SStructVectorAssemble(b_level[level]); - - HYPRE_SStructVectorCreate(comm, grid_level[level], &x_level[level]); - HYPRE_SStructVectorInitialize(x_level[level]); - HYPRE_SStructVectorAssemble(x_level[level]); - - HYPRE_SStructVectorCreate(comm, grid_level[level], &r_level[level]); - HYPRE_SStructVectorInitialize(r_level[level]); - HYPRE_SStructVectorAssemble(r_level[level]); - - HYPRE_SStructVectorCreate(comm, grid_level[level], &e_level[level]); - HYPRE_SStructVectorInitialize(e_level[level]); - HYPRE_SStructVectorAssemble(e_level[level]); - - /* temporary vector for fine patch relaxation */ - hypre_SStructPVectorCreate(comm, - hypre_SStructGridPGrid(grid_level[level], part_fine), - &tx_level[level]); - hypre_SStructPVectorInitialize(tx_level[level]); - hypre_SStructPVectorAssemble(tx_level[level]); - - } - - /* temp SStructVectors */ - HYPRE_SStructVectorCreate(comm, grid, &tx); - HYPRE_SStructVectorInitialize(tx); - HYPRE_SStructVectorAssemble(tx); - - (fac_data -> b_level) = b_level; - (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) = tx; - - /*----------------------------------------------------------- - * Set up the level composite sstruct_matrices. - *-----------------------------------------------------------*/ - - 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++) - { - HYPRE_SStructMatrixCreate(comm, graph_level[level], &A_level[level]); - HYPRE_SStructMatrixInitialize(A_level[level]); - - 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); - - hypre_ForBoxI(i, sgrid_boxes) - { - sgrid_box = hypre_BoxArrayBox(sgrid_boxes, i); - box_volume = hypre_BoxVolume(sgrid_box); - - 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]); - - /*----------------------------------------------------------- - * extract stencil values for all fine levels. - *-----------------------------------------------------------*/ - for (var1 = 0; var1 < nvars; var1++) - { - 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); - - for (i = 0; i < stencil_size; i++) - { - 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); - box_end = hypre_BoxIMax(sgrid_box); - - 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); - -#define DEVICE_VAR is_device_ptr(values,A_smatrix_value) - hypre_BoxLoop2Begin(ndim, loop_size, - sgrid_box, box_start, stride, k, - A_smatrix_dbox, box_start, stride, 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 */ - } /* for i */ - } /* for var1 */ - hypre_TFree(values, HYPRE_MEMORY_HOST); - - /*----------------------------------------------------------- - * Extract the coarse part - *-----------------------------------------------------------*/ - if (level > 0) - { - 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); - - hypre_ForBoxI( i, sgrid_boxes ) - { - sgrid_box = hypre_BoxArrayBox(sgrid_boxes, i); - box_volume = hypre_BoxVolume(sgrid_box); - - 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]); - - /*----------------------------------------------------------- - * extract stencil values - *-----------------------------------------------------------*/ - for (var1 = 0; var1 < nvars; var1++) - { - sgrid = hypre_SStructPGridSGrid(pgrid, var1); - sgrid_boxes = hypre_StructGridBoxes(sgrid); - - 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); - 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); - box_end = hypre_BoxIMax(sgrid_box); - - 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); - -#define DEVICE_VAR is_device_ptr(values,A_smatrix_value) - hypre_BoxLoop2Begin(ndim, loop_size, - sgrid_box, box_start, stride, k, - A_smatrix_dbox, box_start, stride, 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 */ - } /* for i */ - } /* for var1 */ - hypre_TFree(values, HYPRE_MEMORY_HOST); - } /* if level > 0 */ - } /* for level */ - - /*----------------------------------------------------------- - * extract the non-stencil values for all but the coarsest - * level sstruct_matrix. Use the HYPRE_IJMatrixGetValues - * for each level of A. - *-----------------------------------------------------------*/ - - Uventries = hypre_SStructGraphUVEntries(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[0] = NULL; - rows[0] = NULL; - cols[0] = NULL; - 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][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++) - { - Uventry = Uventries[iUventries[i]]; - - part = hypre_SStructUVEntryPart(Uventry); - hypre_CopyIndex(hypre_SStructUVEntryIndex(Uventry), index); - var = hypre_SStructUVEntryVar(Uventry); - - hypre_SStructGridFindBoxManEntry(grid, part, index, var, &boxman_entry); - hypre_SStructBoxManEntryGetGlobalRank(boxman_entry, index, &row_coord, - matrix_type); - - 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; - } - } - hypre_TFree(cnt, HYPRE_MEMORY_HOST); - - 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); - - HYPRE_IJMatrixGetValues(ij_A, nrows[level], ncols[level], rows[level], - cols[level], vals); - - Uventries = hypre_SStructGraphUVEntries(graph_level[level]); - /*----------------------------------------------------------- - * 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] & - * 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++) - { - j = hypre_SStructGraphIUVEntry(graph_level[level], i); - 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++) - { - to_rank = hypre_SStructUVEntryToRank(Uventry, k); - - level_rows[level_cnt] = row_coord; - 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, - (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); - - hypre_TFree(vals, HYPRE_MEMORY_HOST); - hypre_TFree(level_rows, HYPRE_MEMORY_HOST); - hypre_TFree(level_cols, HYPRE_MEMORY_HOST); - } - - hypre_TFree(ncols, HYPRE_MEMORY_HOST); - 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, - * 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++) - { - if (level < max_level) - { - hypre_FacSemiInterpCreate2(&interp_data_level[level]); - hypre_FacSemiInterpSetup2(interp_data_level[level], - x_level[level + 1], - hypre_SStructVectorPVector(x_level[level], part_fine), - refine_factors[level + 1]); - } - else - { - interp_data_level[level] = NULL; - } - - if (level > 0) - { - hypre_FacSemiRestrictCreate2(&restrict_data_level[level]); - - hypre_FacSemiRestrictSetup2(restrict_data_level[level], - x_level[level], part_crse, part_fine, - hypre_SStructVectorPVector(x_level[level - 1], part_fine), - refine_factors[level]); - } - else - { - restrict_data_level[level] = NULL; - } - } - - 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], - part_fine, - refine_factors[level]); - hypre_FacZeroFCSten(hypre_SStructMatrixPMatrix(A_level[level], part_fine), - grid_level[level], - part_fine); - */ - - hypre_ZeroAMRMatrixData(A_level[level], part_crse, refine_factors[level]); - - - HYPRE_SStructMatrixAssemble(A_level[level]); - /*------------------------------------------------------------ - * create data structures that are needed for coarsening - -------------------------------------------------------------*/ - hypre_SStructMatvecCreate(&matvec_data_level[level]); - hypre_SStructMatvecSetup(matvec_data_level[level], - A_level[level], - x_level[level]); - - 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)); - } - - /*--------------------------------------------------------------- - * 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); - for (var1 = 0; var1 < nvars; var1++) - { - sgrid = hypre_SStructPGridSGrid(pgrid, var1); - sgrid_boxes = hypre_StructGridBoxes(sgrid); - - max_box_volume = 0; - hypre_ForBoxI(i, sgrid_boxes) - { - sgrid_box = hypre_BoxArrayBox(sgrid_boxes, i); - box_volume = hypre_BoxVolume(sgrid_box); - - 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); - - for (i = 0; i < stencil_size; i++) - { - 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); - box_end = hypre_BoxIMax(sgrid_box); - - 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); - -#define DEVICE_VAR is_device_ptr(values,A_smatrix_value) - hypre_BoxLoop2Begin(ndim, loop_size, - sgrid_box, box_start, stride, k, - A_smatrix_dbox, box_start, stride, iA); - { - values[k] = A_smatrix_value[iA]; - } - hypre_BoxLoop2End(k, iA); -#undef DEVICE_VAR - - HYPRE_SStructMatrixSetBoxValues(A_level[0], part_crse, box_start, box_end, - var1, 1, &i, values); - } /* hypre_ForBoxI */ - } /* for i */ - - hypre_TFree(values, HYPRE_MEMORY_HOST); - } /* for var1 */ - - HYPRE_SStructMatrixAssemble(A_level[0]); - - hypre_SStructMatvecCreate(&matvec_data_level[0]); - hypre_SStructMatvecSetup(matvec_data_level[0], - A_level[0], - x_level[0]); - - 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_SStructMatvecCreate(&matvec_data); - hypre_SStructMatvecSetup(matvec_data, A_rap, x); - - /*HYPRE_SStructVectorPrint("sstruct.out.b_l", b_level[max_level], 0);*/ - /*HYPRE_SStructMatrixPrint("sstruct.out.A_l", A_level[max_level-2], 0);*/ - (fac_data -> A_level) = A_level; - (fac_data -> matvec_data_level) = matvec_data_level; - (fac_data -> pmatvec_data_level) = pmatvec_data_level; - (fac_data -> matvec_data) = matvec_data; - (fac_data -> interp_data_level) = interp_data_level; - (fac_data -> restrict_data_level) = restrict_data_level; - - /*--------------------------------------------------------------- - * 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[level] = hypre_SysPFMGRelaxCreate(comm); - hypre_SysPFMGRelaxSetTol(relax_data_level[level], 0.0); - hypre_SysPFMGRelaxSetType(relax_data_level[level], relax_type); - if (usr_jacobi_weight) - { - hypre_SysPFMGRelaxSetJacobiWeight(relax_data_level[level], jacobi_weight); - } - hypre_SysPFMGRelaxSetTempVec(relax_data_level[level], tx_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 - * csolver_type= 2 multigrid - *---------------------------------------------------------------*/ - if (csolver_type == 1) - { - HYPRE_SStructPCGCreate(comm, &crse_solver); - 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); - HYPRE_SStructSysPFMGSetTol(crse_precond, 0.0); - HYPRE_SStructSysPFMGSetZeroGuess(crse_precond); - /* weighted Jacobi = 1; red-black GS = 2 */ - HYPRE_SStructSysPFMGSetRelaxType(crse_precond, 3); - if (usr_jacobi_weight) - { - HYPRE_SStructFACSetJacobiWeight(crse_precond, jacobi_weight); - } - HYPRE_SStructSysPFMGSetNumPreRelax(crse_precond, 1); - HYPRE_SStructSysPFMGSetNumPostRelax(crse_precond, 1); - HYPRE_PCGSetPrecond((HYPRE_Solver) crse_solver, - (HYPRE_PtrToSolverFcn) HYPRE_SStructSysPFMGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_SStructSysPFMGSetup, - (HYPRE_Solver) crse_precond); - - HYPRE_PCGSetup((HYPRE_Solver) crse_solver, - (HYPRE_Matrix) A_level[0], - (HYPRE_Vector) b_level[0], - (HYPRE_Vector) x_level[0]); - } - - else if (csolver_type == 2) - { - crse_precond = NULL; - - HYPRE_SStructSysPFMGCreate(comm, &crse_solver); - HYPRE_SStructSysPFMGSetMaxIter(crse_solver, 1); - HYPRE_SStructSysPFMGSetTol(crse_solver, 1.0e-6); - HYPRE_SStructSysPFMGSetZeroGuess(crse_solver); - /* weighted Jacobi = 1; red-black GS = 2 */ - HYPRE_SStructSysPFMGSetRelaxType(crse_solver, relax_type); - if (usr_jacobi_weight) - { - HYPRE_SStructFACSetJacobiWeight(crse_precond, jacobi_weight); - } - HYPRE_SStructSysPFMGSetNumPreRelax(crse_solver, 1); - HYPRE_SStructSysPFMGSetNumPostRelax(crse_solver, 1); - HYPRE_SStructSysPFMGSetup(crse_solver, A_level[0], b_level[0], x_level[0]); - } - - (fac_data -> csolver) = crse_solver; - (fac_data -> cprecond) = crse_precond; - - hypre_FacZeroCData(fac_vdata, A_rap); - - return ierr; -} diff --git a/src/sstruct_ls/fac_solve3.c b/src/sstruct_ls/fac_solve3.c deleted file mode 100644 index f1cb60b95c..0000000000 --- a/src/sstruct_ls/fac_solve3.c +++ /dev/null @@ -1,407 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other - * HYPRE Project Developers. See the top-level COPYRIGHT file for details. - * - * SPDX-License-Identifier: (Apache-2.0 OR MIT) - ******************************************************************************/ - -/****************************************************************************** - * FAC cycle. Refinement patches are solved using relaxation. - * Note that the level solves compute corrections to the composite solution. - ******************************************************************************/ - -#include "_hypre_sstruct_ls.h" -#include "fac.h" - -#define DEBUG 0 - -HYPRE_Int -hypre_FACSolve3( void *fac_vdata, - hypre_SStructMatrix *A_user, - hypre_SStructVector *b_in, - hypre_SStructVector *x_in ) -{ - 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; - hypre_SStructPVector *py; - hypre_ParCSRMatrix *parcsrA; - hypre_ParVector *parx; - hypre_ParVector *pary; - - 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 - *--------------------------------------------------------------*/ - - hypre_BeginTiming(fac_data -> time_index); - - (fac_data -> num_iterations) = 0; - - /* if max_cycles is zero, return */ - if (max_cycles == 0) - { - /* if using a zero initial guess, return zero */ - if (zero_guess) - { - hypre_SStructVectorSetConstantValues(x_in, 0.0); - } - - hypre_EndTiming(fac_data -> time_index); - return ierr; - } - - /*-------------------------------------------------------------- - * Convergence check- we need to compute the norm of the - * composite rhs. - *--------------------------------------------------------------*/ - - if (tol > 0.0) - { - /* eps = (tol^2) */ - - hypre_SStructInnerProd(b_in, b_in, &b_dot_b); - if (b_dot_b < 0.000000001) - { - hypre_SStructInnerProd(x_in, x_in, &b_dot_b); - } - - eps = tol * tol; - - /* if rhs is zero, return a zero solution */ - - if (b_dot_b == 0.0) - { - hypre_SStructVectorSetConstantValues(x_in, 0.0); - if (logging > 0) - { - norms[0] = 0.0; - rel_norms[0] = 0.0; - } - - hypre_EndTiming(fac_data -> time_index); - return ierr; - } - } - - /*-------------------------------------------------------------- - * FAC-cycles: - *--------------------------------------------------------------*/ - for (i = 0; i < max_cycles; i++) - { - hypre_SStructCopy(b_in, tx); - hypre_SStructMatvecCompute(matvec_data, -1.0, A_in, x_in, 1.0, tx); - - /*----------------------------------------------------------- - * convergence check - *-----------------------------------------------------------*/ - if (tol > 0.0) - { - /*----------------------------------------------------------- - * Compute the inner product of the composite residual. - *-----------------------------------------------------------*/ - hypre_SStructInnerProd(tx, tx, &r_dot_r); - - if (logging > 0) - { - norms[i] = hypre_sqrt(r_dot_r); - if (b_dot_b > 0) - { - 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 (rel_change) - { - if ((e_dot_e / x_dot_x) < eps) - { - break; - } - } - else - { - break; - } - } - } - - /*----------------------------------------------------------- - * Extract the level composite rhs's. Since we are using a - * correction scheme fac cycle, the rhs's is the composite - * residuals of A_in, x_in, and b_in. - *-----------------------------------------------------------*/ - hypre_SStructPCopy(hypre_SStructVectorPVector(tx, levels[max_level]), - hypre_SStructVectorPVector(b_level[max_level], part_fine)); - - for (level = 1; level <= max_level; level++) - { - hypre_SStructPCopy(hypre_SStructVectorPVector(tx, levels[level - 1]), - hypre_SStructVectorPVector(b_level[level], part_crse)); - } - - /*-------------------------------------------------------------- - * Down cycle: - *--------------------------------------------------------------*/ - hypre_SStructVectorSetConstantValues(x_level[max_level], 0.0); - for (level = max_level; level > 0; level--) - { - /*----------------------------------------------------------- - * 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); - - /*----------------------------------------------------------- - * 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 - * contributions are involved. - *-----------------------------------------------------------*/ - - /* structured contribution */ - 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); - - /*----------------------------------------------------------- - * 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 - * 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); - } - - /*----------------------------------------------------------- - * coarsest solve: - * The coarsest level is solved using the part_crse data of - * 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)); - -#if DEBUG -#endif - - /*----------------------------------------------------------- - * Up cycle - *-----------------------------------------------------------*/ - for (level = 1; level <= max_level; level++) - { - - /*----------------------------------------------------------- - * 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 - * to part_crse of the finer composite level. - * 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); - */ - - /*----------------------------------------------------------- - * 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]); - - /*----------------------------------------------------------- - * 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]); - - /*----------------------------------------------------------- - * add the correction to x_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]); - } - - /*----------------------------------------------------------- - * 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)); - } - } - - } - - /*-------------------------------------------------------------- - * Add two-level corrections x_level to the composite solution - * x_in. - * - * 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_SStructVectorPVector(x_level[max_level], part_fine), - hypre_SStructVectorPVector(x_in, levels[max_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]) ); - } - - /*----------------------------------------------- - * 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; - } - } - - (fac_data -> num_iterations) = (i + 1); - - } -#if DEBUG -#endif - - hypre_EndTiming(fac_data -> time_index); - - return ierr; -} diff --git a/src/sstruct_ls/fac_zero_cdata.c b/src/sstruct_ls/fac_zero_cdata.c deleted file mode 100644 index 9be784f0ca..0000000000 --- a/src/sstruct_ls/fac_zero_cdata.c +++ /dev/null @@ -1,168 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_sstruct_ls.h" -#include "fac.h" - -/*-------------------------------------------------------------------------- - * hypre_FacZeroCData: Zeroes the data over the underlying coarse indices of - * the refinement patches. - * Algo.:For each cbox - * { - * 1) refine cbox and boxman_intersect with fboxman - * 2) loop over intersection boxes - * 3) coarsen and contract (only the coarse nodes on this - * processor) and zero data. - * } - * - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_FacZeroCData( void *fac_vdata, - hypre_SStructMatrix *A ) -{ - hypre_FACData *fac_data = (hypre_FACData*)fac_vdata; - - hypre_SStructGrid *grid; - hypre_SStructPGrid *p_cgrid; - - hypre_StructGrid *cgrid; - hypre_BoxArray *cgrid_boxes; - hypre_Box *cgrid_box; - - hypre_BoxManager *fboxman; - hypre_BoxManEntry **boxman_entries; - HYPRE_Int nboxman_entries; - - hypre_Box scaled_box; - hypre_Box intersect_box; - - hypre_SStructPMatrix *level_pmatrix; - hypre_StructStencil *stencils; - HYPRE_Int stencil_size; - - 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; - - HYPRE_Int ndim = hypre_SStructMatrixNDim(A); - HYPRE_Int part_crse = 0; - HYPRE_Int part_fine = 1; - HYPRE_Int level; - HYPRE_Int nvars, var; - - 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--) - { - 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); - nvars = hypre_SStructPGridNVars(p_cgrid); - - for (var = 0; var < nvars; var++) - { - stencils = hypre_SStructPMatrixSStencil(level_pmatrix, var, var); - stencil_size = hypre_StructStencilSize(stencils); - - /*--------------------------------------------------------------------- - * For each variable, find the underlying boxes for each coarse box. - *---------------------------------------------------------------------*/ - cgrid = hypre_SStructPGridSGrid(p_cgrid, var); - cgrid_boxes = hypre_StructGridBoxes(cgrid); - fboxman = hypre_SStructGridBoxManager(grid, part_fine, 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, 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, - *refine_factors, hypre_BoxIMax(&scaled_box)); - - 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)[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, - *refine_factors, hypre_BoxIMax(&intersect_box)); - - 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); - - 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_TFree(values, HYPRE_MEMORY_HOST); - - } /* if (intersect_size > 0) */ - } /* for (i= 0; i< nboxman_entries; i++) */ - - hypre_TFree(boxman_entries, HYPRE_MEMORY_HOST); - - } /* hypre_ForBoxI(ci, cgrid_boxes) */ - } /* for (var= 0; var< nvars; var++) */ - } /* for (level= max_level; level> 0; level--) */ - - return ierr; -} - diff --git a/src/sstruct_ls/fac_zero_stencilcoef.c b/src/sstruct_ls/fac_zero_stencilcoef.c deleted file mode 100644 index 6b02443b98..0000000000 --- a/src/sstruct_ls/fac_zero_stencilcoef.c +++ /dev/null @@ -1,421 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_sstruct_ls.h" -#include "_hypre_struct_mv.hpp" -#include "fac.h" - -#define AbsStencilShape(stencil, abs_shape) \ - { \ - HYPRE_Int ii,jj,kk; \ - ii = hypre_IndexX(stencil); \ - jj = hypre_IndexY(stencil); \ - kk = hypre_IndexZ(stencil); \ - abs_shape= hypre_abs(ii) + hypre_abs(jj) + hypre_abs(kk); \ - } - -/*-------------------------------------------------------------------------- - * hypre_FacZeroCFSten: Zeroes the coarse stencil coefficients that reach - * into an underlying coarsened refinement box. - * Algo: For each cbox - * { - * 1) refine cbox and expand by one in each direction - * 2) boxman_intersect with the fboxman - * 3) loop over intersection boxes to see if stencil - * reaches over. - * } - *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_FacZeroCFSten( hypre_SStructPMatrix *Af, - hypre_SStructPMatrix *Ac, - hypre_SStructGrid *grid, - HYPRE_Int fine_part, - hypre_Index rfactors ) -{ - HYPRE_UNUSED_VAR(Af); - - hypre_BoxManager *fboxman; - hypre_BoxManEntry **boxman_entries; - HYPRE_Int nboxman_entries; - - hypre_SStructPGrid *p_cgrid; - - hypre_Box fgrid_box; - hypre_StructGrid *cgrid; - hypre_BoxArray *cgrid_boxes; - hypre_Box *cgrid_box; - hypre_Box scaled_box; - - hypre_Box *shift_ibox; - - hypre_StructMatrix *smatrix; - - hypre_StructStencil *stencils; - HYPRE_Int stencil_size; - - hypre_Index refine_factors, upper_shift; - hypre_Index stride; - hypre_Index stencil_shape; - hypre_Index zero_index, ilower, iupper; - - HYPRE_Int nvars, var1, var2; - HYPRE_Int ndim; - - hypre_Box *ac_dbox; - HYPRE_Real *ac_ptr; - hypre_Index loop_size; - - HYPRE_Int ci, i, j; - - HYPRE_Int abs_shape; - - HYPRE_Int ierr = 0; - - p_cgrid = hypre_SStructPMatrixPGrid(Ac); - nvars = hypre_SStructPMatrixNVars(Ac); - ndim = hypre_SStructPGridNDim(p_cgrid); - - hypre_BoxInit(&fgrid_box, ndim); - hypre_BoxInit(&scaled_box, ndim); - - hypre_ClearIndex(zero_index); - hypre_ClearIndex(stride); - hypre_ClearIndex(upper_shift); - for (i = 0; i < ndim; i++) - { - stride[i] = 1; - upper_shift[i] = rfactors[i] - 1; - } - - hypre_CopyIndex(rfactors, refine_factors); - if (ndim < 3) - { - for (i = ndim; i < 3; i++) - { - refine_factors[i] = 1; - } - } - - for (var1 = 0; var1 < nvars; var1++) - { - cgrid = hypre_SStructPGridSGrid(hypre_SStructPMatrixPGrid(Ac), var1); - cgrid_boxes = hypre_StructGridBoxes(cgrid); - - fboxman = hypre_SStructGridBoxManager(grid, fine_part, var1); - - /*------------------------------------------------------------------ - * For each parent coarse box find all fboxes that may be connected - * through a stencil entry- refine this box, expand it by one - * in each direction, and boxman_intersect with fboxman - *------------------------------------------------------------------*/ - hypre_ForBoxI(ci, cgrid_boxes) - { - cgrid_box = hypre_BoxArrayBox(cgrid_boxes, ci); - - hypre_StructMapCoarseToFine(hypre_BoxIMin(cgrid_box), zero_index, - refine_factors, hypre_BoxIMin(&scaled_box)); - hypre_StructMapCoarseToFine(hypre_BoxIMax(cgrid_box), upper_shift, - refine_factors, hypre_BoxIMax(&scaled_box)); - - hypre_SubtractIndexes(hypre_BoxIMin(&scaled_box), stride, 3, - hypre_BoxIMin(&scaled_box)); - hypre_AddIndexes(hypre_BoxIMax(&scaled_box), stride, 3, - hypre_BoxIMax(&scaled_box)); - - hypre_BoxManIntersect(fboxman, hypre_BoxIMin(&scaled_box), - hypre_BoxIMax(&scaled_box), &boxman_entries, - &nboxman_entries); - - for (var2 = 0; var2 < nvars; var2++) - { - stencils = hypre_SStructPMatrixSStencil(Ac, var1, var2); - - if (stencils != NULL) - { - stencil_size = hypre_StructStencilSize(stencils); - smatrix = hypre_SStructPMatrixSMatrix(Ac, var1, var2); - ac_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(smatrix), - ci); - - /*--------------------------------------------------------- - * Find the stencil coefficients that must be zeroed off. - * Loop over all possible boxes. - *---------------------------------------------------------*/ - for (i = 0; i < stencil_size; i++) - { - hypre_CopyIndex(hypre_StructStencilElement(stencils, i), - stencil_shape); - AbsStencilShape(stencil_shape, abs_shape); - - if (abs_shape) /* non-centre stencils are zeroed */ - { - /* look for connecting fboxes that must be zeroed. */ - 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); - - if ( hypre_BoxVolume(shift_ibox) ) - { - ac_ptr = hypre_StructMatrixExtractPointerByIndex(smatrix, - ci, - stencil_shape); - hypre_BoxGetSize(shift_ibox, loop_size); - -#define DEVICE_VAR is_device_ptr(ac_ptr) - hypre_BoxLoop1Begin(ndim, loop_size, - ac_dbox, hypre_BoxIMin(shift_ibox), - stride, iac); - { - ac_ptr[iac] = 0.0; - } - hypre_BoxLoop1End(iac); -#undef DEVICE_VAR - } /* if ( hypre_BoxVolume(shift_ibox) ) */ - - hypre_BoxDestroy(shift_ibox); - - } /* for (j= 0; j< nboxman_entries; j++) */ - } /* if (abs_shape) */ - } /* for (i= 0; i< stencil_size; i++) */ - } /* if (stencils != NULL) */ - } /* for (var2= 0; var2< nvars; var2++) */ - - hypre_TFree(boxman_entries, HYPRE_MEMORY_HOST); - } /* hypre_ForBoxI ci */ - } /* for (var1= 0; var1< nvars; var1++) */ - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_FacZeroFCSten: Zeroes the fine stencil coefficients that reach - * into a coarse box. - * Idea: zero off any stencil connection of a fine box that does not - * connect to a sibling box - * Algo: For each fbox - * { - * 1) expand by one in each direction so that sibling boxes can be - * reached - * 2) boxman_intersect with the fboxman to get all fboxes including - * itself and the siblings - * 3) loop over intersection boxes, shift them in the stencil - * direction (now we are off the fbox), and subtract any sibling - * extents. The remaining chunks (boxes of a box_array) are - * the desired but shifted extents. - * 4) shift these shifted extents in the negative stencil direction - * to get back into fbox. Zero-off the matrix over these latter - * extents. - * } - *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_FacZeroFCSten( hypre_SStructPMatrix *A, - hypre_SStructGrid *grid, - HYPRE_Int fine_part) -{ - MPI_Comm comm = hypre_SStructGridComm(grid); - hypre_BoxManager *fboxman; - hypre_BoxManEntry **boxman_entries; - HYPRE_Int nboxman_entries; - - hypre_SStructPGrid *p_fgrid; - hypre_StructGrid *fgrid; - hypre_BoxArray *fgrid_boxes; - hypre_Box *fgrid_box; - hypre_Box scaled_box; - - - hypre_BoxArray *intersect_boxes, *tmp_box_array1, *tmp_box_array2; - - hypre_StructMatrix *smatrix; - - hypre_StructStencil *stencils; - HYPRE_Int stencil_size; - - hypre_Index stride, ilower, iupper; - hypre_Index stencil_shape, shift_index; - - hypre_Box shift_ibox; - hypre_Box intersect_box; - hypre_Index size_ibox; - - HYPRE_Int nvars, var1, var2; - HYPRE_Int ndim; - - hypre_Box *a_dbox; - HYPRE_Real *a_ptr; - hypre_Index loop_size; - - HYPRE_Int fi, fj, i, j; - HYPRE_Int abs_shape; - HYPRE_Int myid, proc; - HYPRE_Int ierr = 0; - - hypre_MPI_Comm_rank(comm, &myid); - - p_fgrid = hypre_SStructPMatrixPGrid(A); - nvars = hypre_SStructPMatrixNVars(A); - ndim = hypre_SStructPGridNDim(p_fgrid); - - hypre_BoxInit(&scaled_box, ndim); - hypre_BoxInit(&shift_ibox, ndim); - hypre_BoxInit(&intersect_box, ndim); - - hypre_ClearIndex(stride); - for (i = 0; i < ndim; i++) - { - stride[i] = 1; - } - - tmp_box_array1 = hypre_BoxArrayCreate(1, ndim); - - for (var1 = 0; var1 < nvars; var1++) - { - fgrid = hypre_SStructPGridSGrid(hypre_SStructPMatrixPGrid(A), var1); - fgrid_boxes = hypre_StructGridBoxes(fgrid); - fboxman = hypre_SStructGridBoxManager(grid, fine_part, var1); - - hypre_ForBoxI(fi, fgrid_boxes) - { - fgrid_box = hypre_BoxArrayBox(fgrid_boxes, fi); - hypre_ClearIndex(size_ibox); - for (i = 0; i < ndim; i++) - { - size_ibox[i] = hypre_BoxSizeD(fgrid_box, i) - 1; - } - - /* expand fgrid_box & boxman_intersect with fboxman. */ - hypre_SubtractIndexes(hypre_BoxIMin(fgrid_box), stride, 3, - hypre_BoxIMin(&scaled_box)); - hypre_AddIndexes(hypre_BoxIMax(fgrid_box), stride, 3, - hypre_BoxIMax(&scaled_box)); - - hypre_BoxManIntersect(fboxman, hypre_BoxIMin(&scaled_box), - hypre_BoxIMax(&scaled_box), &boxman_entries, - &nboxman_entries); - - for (var2 = 0; var2 < nvars; var2++) - { - stencils = hypre_SStructPMatrixSStencil(A, var1, var2); - - if (stencils != NULL) - { - 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++) - { - hypre_CopyIndex(hypre_StructStencilElement(stencils, i), - stencil_shape); - AbsStencilShape(stencil_shape, abs_shape); - - if (abs_shape) /* non-centre stencils are zeroed */ - { - hypre_SetIndex3(shift_index, - size_ibox[0]*stencil_shape[0], - size_ibox[1]*stencil_shape[1], - size_ibox[2]*stencil_shape[2]); - hypre_AddIndexes(shift_index, hypre_BoxIMin(fgrid_box), 3, - hypre_BoxIMin(&shift_ibox)); - hypre_AddIndexes(shift_index, hypre_BoxIMax(fgrid_box), 3, - hypre_BoxIMax(&shift_ibox)); - hypre_IntersectBoxes(&shift_ibox, fgrid_box, &shift_ibox); - - hypre_SetIndex3(shift_index, -stencil_shape[0], -stencil_shape[1], - -stencil_shape[2]); - - /*----------------------------------------------------------- - * Check to see if the stencil does not couple to a sibling - * box. These boxes should be in boxman_entries. But do not - * subtract fgrid_box itself, which is also in boxman_entries. - *-----------------------------------------------------------*/ - hypre_AddIndexes(stencil_shape, hypre_BoxIMin(&shift_ibox), 3, - hypre_BoxIMin(&shift_ibox)); - 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)); - - for (j = 0; j < nboxman_entries; j++) - { - hypre_SStructBoxManEntryGetProcess(boxman_entries[j], &proc); - hypre_SStructBoxManEntryGetBoxnum(boxman_entries[j], &fj); - - if ((proc != myid) || (fj != fi)) - { - hypre_BoxManEntryGetExtents(boxman_entries[j], ilower, iupper); - hypre_BoxSetExtents(&scaled_box, ilower, iupper); - - hypre_IntersectBoxes(&shift_ibox, &scaled_box, &intersect_box); - - if ( hypre_BoxVolume(&intersect_box) ) - { - hypre_CopyBox(&intersect_box, - hypre_BoxArrayBox(tmp_box_array1, 0)); - - tmp_box_array2 = hypre_BoxArrayCreate(0, ndim); - - hypre_SubtractBoxArrays(intersect_boxes, - tmp_box_array1, - tmp_box_array2); - - hypre_BoxArrayDestroy(tmp_box_array2); - } - } - } /* for (j= 0; j< nboxman_entries; j++) */ - - /*----------------------------------------------------------- - * intersect_boxes now has the shifted extents for the - * coefficients to be zeroed. - *-----------------------------------------------------------*/ - a_ptr = hypre_StructMatrixExtractPointerByIndex(smatrix, - fi, - stencil_shape); - hypre_ForBoxI(fj, intersect_boxes) - { - hypre_CopyBox(hypre_BoxArrayBox(intersect_boxes, fj), &intersect_box); - - hypre_AddIndexes(shift_index, hypre_BoxIMin(&intersect_box), 3, - hypre_BoxIMin(&intersect_box)); - hypre_AddIndexes(shift_index, hypre_BoxIMax(&intersect_box), 3, - hypre_BoxIMax(&intersect_box)); - - hypre_BoxGetSize(&intersect_box, loop_size); - -#define DEVICE_VAR is_device_ptr(a_ptr) - hypre_BoxLoop1Begin(ndim, loop_size, - a_dbox, hypre_BoxIMin(&intersect_box), - stride, ia); - { - a_ptr[ia] = 0.0; - } - hypre_BoxLoop1End(ia); -#undef DEVICE_VAR - - } /* hypre_ForBoxI(fj, intersect_boxes) */ - - hypre_BoxArrayDestroy(intersect_boxes); - - } /* if (abs_shape) */ - } /* for (i= 0; i< stencil_size; i++) */ - } /* if (stencils != NULL) */ - } /* for (var2= 0; var2< nvars; var2++) */ - - hypre_TFree(boxman_entries, HYPRE_MEMORY_HOST); - } /* hypre_ForBoxI(fi, fgrid_boxes) */ - } /* for (var1= 0; var1< nvars; var1++) */ - - hypre_BoxArrayDestroy(tmp_box_array1); - - return ierr; -} diff --git a/src/sstruct_ls/headers b/src/sstruct_ls/headers new file mode 100755 index 0000000000..9928012073 --- /dev/null +++ b/src/sstruct_ls/headers @@ -0,0 +1,74 @@ +#!/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_sstruct_ls.h + +#=========================================================================== +# Include guards and other includes +#=========================================================================== + +cat > $INTERNAL_HEADER <<@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use 'headers' to generate) ***/ + +#ifndef hypre_SSTRUCT_LS_HEADER +#define hypre_SSTRUCT_LS_HEADER + +#include +#include +#include + +#include + +#include "HYPRE_sstruct_ls.h" + +#include "_hypre_utilities.h" +#include "_hypre_krylov.h" +#include "_hypre_struct_ls.h" +#include "_hypre_sstruct_mv.h" +#include "_hypre_parcsr_ls.h" +#include "_hypre_lobpcg_multivector.h" + +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_sstruct_ls_mup_def.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +@ + +#=========================================================================== +# Structures and prototypes +#=========================================================================== + +cat protos.h >> $INTERNAL_HEADER + +#=========================================================================== +# Include guards +#=========================================================================== + +cat >> $INTERNAL_HEADER <<@ + +#ifdef __cplusplus +} +#endif + +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_sstruct_ls_mup_undef.h" +#include "_hypre_sstruct_ls_mup.h" +#endif +#endif + +#endif + +@ diff --git a/src/sstruct_ls/krylov_sstruct.c b/src/sstruct_ls/krylov_sstruct.c index df07242bf7..1ca08a2d85 100644 --- a/src/sstruct_ls/krylov_sstruct.c +++ b/src/sstruct_ls/krylov_sstruct.c @@ -300,3 +300,13 @@ hypre_SStructKrylovCommInfo( void *A, hypre_MPI_Comm_rank(comm, my_id); return hypre_error_flag; } + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructKrylovPrintVector( void *x, + const char *filename) +{ + return ( HYPRE_SStructVectorPrint( filename, (hypre_SStructVector *) x, 0) ); +} diff --git a/src/sstruct_ls/maxwell_PNedelec.c b/src/sstruct_ls/maxwell_PNedelec.c deleted file mode 100644 index 551fb4ba49..0000000000 --- a/src/sstruct_ls/maxwell_PNedelec.c +++ /dev/null @@ -1,2894 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other - * HYPRE Project Developers. See the top-level COPYRIGHT file for details. - * - * SPDX-License-Identifier: (Apache-2.0 OR MIT) - ******************************************************************************/ - -/****************************************************************************** - * OpenMP Problems - * - * Need to fix the way these variables are set and incremented in loops: - * j, k (only where they are listed at the end of SMP_PRIVATE) - * - ******************************************************************************/ - -#include "_hypre_sstruct_ls.h" - -hypre_IJMatrix * -hypre_Maxwell_PNedelec( hypre_SStructGrid *fgrid_edge, - hypre_SStructGrid *cgrid_edge, - hypre_Index rfactor ) -{ - MPI_Comm comm = (fgrid_edge-> comm); - - HYPRE_IJMatrix edge_Edge; - - hypre_SStructPGrid *p_cgrid, *p_fgrid; - hypre_StructGrid *var_cgrid, *var_fgrid; - hypre_BoxArray *cboxes, *fboxes, *box_array; - hypre_Box *cbox, *fbox, *cellbox, *vbox, copy_box; - - hypre_BoxArray **contract_fedgeBoxes; - hypre_Index **Edge_cstarts, **upper_shifts, **lower_shifts; - HYPRE_Int **cfbox_mapping, **fcbox_mapping; - - hypre_BoxManEntry *entry; - HYPRE_BigInt rank, rank2; - HYPRE_BigInt start_rank1, start_rank2; - - HYPRE_Int nedges; - - HYPRE_BigInt *iedgeEdge; - HYPRE_BigInt *jedge_Edge; - - HYPRE_Real *vals_edgeEdge; - HYPRE_Real fCedge_ratio; - HYPRE_Int *ncols_edgeEdge; - - hypre_Index cindex; - hypre_Index findex; - hypre_Index var_index, *boxoffset, *suboffset; - hypre_Index loop_size, start, cstart, stride, hi_index, lindex; - hypre_Index ishift, jshift, kshift, zero_index, one_index; - HYPRE_Int n_boxoffsets; - - 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 nvars, Edge_nvars, part, var; - HYPRE_Int tot_vars = 8; - - HYPRE_Int t, i, j, k, m, n, size; - HYPRE_BigInt l, p; - - HYPRE_BigInt ilower, iupper; - HYPRE_BigInt jlower, jupper; - HYPRE_BigInt **lower_ranks, **upper_ranks; - - HYPRE_Int ***n_CtoVbox, ****CtoVboxnums; - HYPRE_Int *num_vboxes, **vboxnums; - - HYPRE_Int trueV = 1; - HYPRE_Int falseV = 0; - HYPRE_Int row_in; - - HYPRE_Int myproc; - - hypre_BoxInit(©_box, ndim); - - hypre_MPI_Comm_rank(comm, &myproc); - hypre_SetIndex3(ishift, 1, 0, 0); - hypre_SetIndex3(jshift, 0, 1, 0); - hypre_SetIndex3(kshift, 0, 0, 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; - } - - /*------------------------------------------------------------------- - * Find the coarse-fine connection pattern, i.e., the topology - * needed to create the interpolation operators. - * These connections are determined using the cell-centred grids. - * Note that we are assuming the variable type enumeration - * given in hypre_SStructVariable_enum. - * - * We consider both 2-d and 3-d cases. In 2-d, the edges are faces. - * We will continue to call them edges, but use the face variable - * enumeration. - *-------------------------------------------------------------------*/ - 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); - - part = 0; - p_cgrid = hypre_SStructGridPGrid(cgrid_edge, part); - nvars = hypre_SStructPGridNVars(p_cgrid); - vartypes = hypre_SStructPGridVarTypes(p_cgrid); - - for (i = 0; i < nvars; i++) - { - t = vartypes[i]; - hypre_SStructVariableGetOffset((hypre_SStructVariable) t, - ndim, varoffsets[t]); - switch (t) - { - case 2: - { - vartype_map[2] = i; - break; - } - - case 3: - { - vartype_map[3] = i; - break; - } - - case 5: - { - vartype_map[5] = i; - break; - } - - case 6: - { - vartype_map[6] = i; - break; - } - - case 7: - { - vartype_map[7] = i; - break; - } - } - } - - /* local sizes */ - nedges = 0; - 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++) - { - var_fgrid = hypre_SStructPGridSGrid(p_fgrid, var); - nedges += hypre_StructGridLocalSize(var_fgrid); - } - } - - /*-------------------------------------------------------------------------- - * Form mappings between the c & f box numbers. Note that a cbox - * can land inside only one fbox since the latter was contracted. Without - * 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++) - { - p_fgrid = hypre_SStructGridPGrid(fgrid_edge, i); - 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); - - p_cgrid = hypre_SStructGridPGrid(cgrid_edge, i); - 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); - - /* assuming if i1 > i2 and (box j1) is coarsened from (box i1) - and (box j2) from (box i2), then j1 > j2. */ - k = 0; - hypre_ForBoxI(j, fboxes) - { - fbox = hypre_BoxArrayBox(fboxes, j); - hypre_CopyBox(fbox, ©_box); - hypre_ProjectBox(©_box, zero_index, rfactor); - hypre_StructMapFineToCoarse(hypre_BoxIMin(©_box), zero_index, - rfactor, hypre_BoxIMin(©_box)); - hypre_StructMapFineToCoarse(hypre_BoxIMax(©_box), zero_index, - rfactor, hypre_BoxIMax(©_box)); - - /* since the ordering of the cboxes was determined by the fbox - 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); - hypre_IntersectBoxes(©_box, cbox, ©_box); - if (hypre_BoxVolume(©_box)) - { - cfbox_mapping[i][k] = j; - fcbox_mapping[i][j] = k; - k++; - } /* if (hypre_BoxVolume(©_box)) */ - } /* hypre_ForBoxI(j, fboxes) */ - } /* for (i= 0; i< nparts; i++) */ - - /* 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++) - { - 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++) - { - p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); - 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++) - { - 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); - hypre_SStructGridFindBoxManEntry(fgrid_edge, part, findex, t, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, findex, &lower_ranks[part][t], - matrix_type); - - fbox = hypre_BoxArrayBox(box_array, hypre_BoxArraySize(box_array) - 1); - hypre_CopyIndex(hypre_BoxIMax(fbox), findex); - hypre_SStructGridFindBoxManEntry(fgrid_edge, part, findex, t, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, findex, &upper_ranks[part][t], - matrix_type); - } - } - - /* CREATE IJ_MATRICES- need to find the size of each one. Notice that the row - and col ranks of these matrices can be created using only grid information. - Grab the first part, first variable, first box, and lower index (lower rank); - Grab the last part, last variable, last box, and upper index (upper rank). */ - - /* edge_Edge. Same for 2-d and 3-d. */ - /* lower rank */ - start_rank1 = hypre_SStructGridStartRank(fgrid_edge); - start_rank2 = hypre_SStructGridStartRank(cgrid_edge); - ilower = start_rank1; - jlower = start_rank2; - - /* upper rank */ - part = nparts - 1; - p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); - nvars = hypre_SStructPGridNVars(p_fgrid); - 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); - 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); - 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); - hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMax(cbox), &jupper); - - HYPRE_IJMatrixCreate(comm, ilower, iupper, jlower, jupper, &edge_Edge); - HYPRE_IJMatrixSetObjectType(edge_Edge, HYPRE_PARCSR); - HYPRE_IJMatrixInitialize(edge_Edge); - - /*----------------------------------------------------------------------- - * edge_Edge, the actual interpolation matrix. - * For each fine edge row, we need to know if it is a edge, - * boundary edge, or face edge. Knowing this allows us to determine the - * structure and weights of the interpolation matrix. - * We assume that a coarse edge interpolates only to fine edges in or on - * an agglomerate. That is, fine edges with indices that do were - * truncated do not get interpolated to. - * Scheme: Loop over fine edge grid. For each fine edge ijk, - * 1) map it to a fine cell with the fine edge at the lower end - * of the box,e.g. x_edge[ijk] -> cell[i,j+1,k+1]. - * 2) coarsen the fine cell to obtain a coarse cell. Determine the - * location of the fine edge with respect to the coarse edges - * of this cell. Coarsening needed only when determining the - * column rank. - * Need to distinguish between 2-d and 3-d. - *-----------------------------------------------------------------------*/ - - /* count the row/col connections */ - iedgeEdge = hypre_CTAlloc(HYPRE_BigInt, 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); - - for (part = 0; part < nparts; part++) - { - p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); - 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); - - hypre_ForBoxI(i, fboxes) - { - fbox = hypre_BoxArrayBox(fboxes, i); - - /* contract the fbox to correspond to the correct cbox */ - 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++) - { - 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]; - } - else - { - upper_shifts[part][i][k] = rfactor[k] - p - 1; - lower_shifts[part][i][k] = -p; - } - } - - /* record the cstarts of the cbox */ - hypre_ProjectBox(cbox, zero_index, rfactor); - hypre_CopyIndex(hypre_BoxIMin(cbox), Edge_cstarts[part][i]); - hypre_StructMapFineToCoarse(Edge_cstarts[part][i], zero_index, rfactor, - Edge_cstarts[part][i]); - - hypre_BoxDestroy(cbox); - } - - } /* for (part= 0; part< nparts; part++) */ - - /*----------------------------------------------------------------------- - * 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++) - { - 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]; - - 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; - boxoffset = hypre_CTAlloc(hypre_Index, n_boxoffsets, HYPRE_MEMORY_HOST); - suboffset = hypre_CTAlloc(hypre_Index, n_boxoffsets, HYPRE_MEMORY_HOST); - switch (var) - { - case 2: /* 2-d: x_face (vertical edges), stride=[rfactor[0],1,1] */ - { - hypre_SetIndex3(stride, rfactor[0], 1, 1); - hypre_CopyIndex(varoffsets[2], var_index); - - /* boxoffset shrink in the i direction */ - 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 */ - hypre_SetIndex3(hi_index, 1, 0, 0); - break; - } - - case 3: /* 2-d: y_face (horizontal edges), stride=[1,rfactor[1],1] */ - { - hypre_SetIndex3(stride, 1, rfactor[1], 1); - hypre_CopyIndex(varoffsets[3], var_index); - - /* boxoffset shrink in the j direction */ - 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 */ - hypre_SetIndex3(hi_index, 0, 1, 0); - break; - } - - case 5: /* 3-d: x_edge, stride=[1,rfactor[1],rfactor[2]] */ - { - hypre_SetIndex3(stride, 1, rfactor[1], rfactor[2]); - 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(suboffset[0], 0, 1, 0); - hypre_SetIndex3(suboffset[1], 0, 0, 1); - - /* extend loop_size by one in the stride direction */ - hypre_SetIndex3(hi_index, 0, 1, 1); - break; - } - - case 6: /* 3-d: y_edge, stride=[rfactor[0],1,rfactor[2]] */ - { - hypre_SetIndex3(stride, rfactor[0], 1, rfactor[2]); - 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(suboffset[0], 1, 0, 0); - hypre_SetIndex3(suboffset[1], 0, 0, 1); - - /* extend loop_size by one in the stride direction */ - hypre_SetIndex3(hi_index, 1, 0, 1); - break; - } - - case 7: /* 3-d: z_edge, stride=[rfactor[0],rfactor[1],1] */ - { - hypre_SetIndex3(stride, rfactor[0], rfactor[1], 1); - 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(suboffset[0], 1, 0, 0); - hypre_SetIndex3(suboffset[1], 0, 1, 0); - - /* extend loop_size by one in the stride direction */ - hypre_SetIndex3(hi_index, 1, 1, 0); - break; - } - } - - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - - /* vboxes inside the i'th cellbox */ - num_vboxes = n_CtoVbox[part][i]; - vboxnums = CtoVboxnums[part][i]; - - /* adjust the project cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - - /* the adjusted variable box may be bigger than the actually - variable box- variables that are shared may lead to smaller - variable boxes than the SubtractIndex produces. If the box - 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++) - { - hypre_SubtractIndexes(hypre_BoxIMin(©_box), suboffset[k], 3, - findex); - row_in = falseV; - for (p = 0; p < num_vboxes[t]; p++) - { - vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); - - if (hypre_IndexInBox(findex, vbox)) - { - hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in = trueV; - break; - } - } - /* not in any vbox */ - if (!row_in) - { - hypre_AddIndexes(hypre_BoxIMin(©_box), boxoffset[k], 3, - hypre_BoxIMin(©_box)); - } - } - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, stride, - loop_size); - /* extend the loop_size so that upper boundary of the box are reached. */ - hypre_AddIndexes(loop_size, hi_index, 3, loop_size); - - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, stride, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k = 0; k < 3; k++) - { - findex[k] *= stride[k]; - } - hypre_AddIndexes(findex, start, 3, findex); - - hypre_SStructGridFindBoxManEntry(fgrid_edge, part, findex, t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, findex, &p, matrix_type); - - /* 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; - j++; - } - } - hypre_SerialBoxLoop1End(m); - - } /* hypre_ForBoxI */ - - hypre_TFree(boxoffset, HYPRE_MEMORY_HOST); - hypre_TFree(suboffset, HYPRE_MEMORY_HOST); - } /* for (t= 0; t< nvars; t++) */ - } /* for (part= 0; part< nparts; part++) */ - - /*----------------------------------------------------------------------- - * Record the row ranks for the face edges. Only for 3-d. - * Loop over the face edges. - *-----------------------------------------------------------------------*/ - if (ndim == 3) - { - 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); - - /* note that fboxes are the contracted CELL boxes. Will get the correct - variable grid extents. */ - 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++) - { - hypre_ClearIndex(boxoffset[t]); - hypre_IndexD(boxoffset[t], t) = rfactor[t] - 1; - } - - for (t = 0; t < Edge_nvars; t++) - { - var = Edge_vartypes[t]; - 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) - { - case 5: - { - /* 3-d x_edge, can be Y or Z_Face */ - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - - /* vboxes inside the i'th cellbox */ - num_vboxes = n_CtoVbox[part][i]; - vboxnums = CtoVboxnums[part][i]; - - /* adjust the contracted cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - - /****************************************************** - * Check the location of the shifted lower box index: - * x_edge-> Z_Face & Y_Face: - * Z_Face- contract in the z direction only if the - * processor interface is in the z direction - * Y_Face- contract in the y direction if the processor - * interface is in the y direction. - ******************************************************/ - 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++) - { - vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); - if (hypre_IndexInBox(findex, vbox)) - { - hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in = trueV; - break; - } - } - /* not in any vbox */ - if (!row_in) - { - hypre_AddIndexes(hypre_BoxIMin(©_box), boxoffset[2], 3, - hypre_BoxIMin(©_box)); - } - hypre_SubtractIndexes(hypre_BoxIMin(©_box), jshift, 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - /* increase the loop_size by one in the Z plane direction */ - loop_size[2]++; - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k = 0; k < 3; 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++) - { - hypre_CopyIndex(findex, var_index); - var_index[0] += p; - for (n = 1; n < rfactor[1]; n++) - { - var_index[1]++; - hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &l, - matrix_type); - - /* still row l may be outside the processor */ - if ((l <= upper_ranks[part][t]) && - (l >= lower_ranks[part][t])) - { - iedgeEdge[j] = l; - - /* Z_Face. Two coarse Edge connections. */ - ncols_edgeEdge[j] = 2; - j++; - } - - } /* for (n= 1; n< rfactor[1]; n++) */ - } /* for (p= 0; p< rfactor[0]; p++) */ - } - hypre_SerialBoxLoop1End(m); - - /* Y_Face */ - hypre_CopyBox(cellbox, ©_box); - 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++) - { - vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); - if (hypre_IndexInBox(findex, vbox)) - { - hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in = trueV; - break; - } - } - /* not in any vbox */ - if (!row_in) - { - hypre_AddIndexes(hypre_BoxIMin(©_box), boxoffset[1], 3, - hypre_BoxIMin(©_box)); - } - hypre_SubtractIndexes(hypre_BoxIMin(©_box), kshift, 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - loop_size[1]++; - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k = 0; k < 3; k++) - { - findex[k] *= rfactor[k]; - } - hypre_AddIndexes(findex, start, 3, findex); - - /* Y_Face */ - 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[2]++; - hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &l, - matrix_type); - if ((l <= upper_ranks[part][t]) && - (l >= lower_ranks[part][t])) - { - iedgeEdge[j] = l; - - /* Y_Face. Two coarse Edge connections. */ - ncols_edgeEdge[j] = 2; - j++; - } - - } /* for (n= 1; n< rfactor[2]; n++) */ - } /* for (p= 0; p< rfactor[0]; p++) */ - } - hypre_SerialBoxLoop1End(m); - } /* hypre_ForBoxI(i, fboxes) */ - - break; - } - - case 6: - { - /* 3-d y_edge, can be X or Z_Face */ - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - - /* vboxes inside the i'th cellbox */ - num_vboxes = n_CtoVbox[part][i]; - vboxnums = CtoVboxnums[part][i]; - - /* adjust the project cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - - /****************************************************** - * Check the location of the shifted lower box index: - * y_edge-> X_Face & Z_Face: - * Z_Face- contract in the z direction only if the - * processor interface is in the z direction - * X_Face- contract in the x direction if the processor - * interface is in the x direction. - ******************************************************/ - 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++) - { - vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); - if (hypre_IndexInBox(findex, vbox)) - { - hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in = trueV; - break; - } - } - /* not in any vbox */ - if (!row_in) - { - hypre_AddIndexes(hypre_BoxIMin(©_box), boxoffset[2], 3, - hypre_BoxIMin(©_box)); - } - hypre_SubtractIndexes(hypre_BoxIMin(©_box), ishift, 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - /* increase the loop_size by one in the Z_Face direction to - cover upper boundary Z_Faces. */ - loop_size[2]++; - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - - for (k = 0; k < 3; k++) - { - findex[k] *= rfactor[k]; - } - - hypre_AddIndexes(findex, start, 3, findex); - - /* Z_Face */ - 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[0]++; - hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &l, - matrix_type); - if ((l <= upper_ranks[part][t]) && - (l >= lower_ranks[part][t])) - { - iedgeEdge[j] = l; - - /* Z_Face. Two coarse Edge connections. */ - ncols_edgeEdge[j] = 2; - j++; - } - - } /* for (n= 1; n< rfactor[0]; n++) */ - } /* for (p= 0; p< rfactor[1]; p++) */ - } - hypre_SerialBoxLoop1End(m); - - /* X_Face */ - hypre_CopyBox(cellbox, ©_box); - - 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++) - { - vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); - if (hypre_IndexInBox(findex, vbox)) - { - hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in = trueV; - break; - } - } - /* not in any vbox */ - if (!row_in) - { - hypre_AddIndexes(hypre_BoxIMin(©_box), boxoffset[0], 3, - hypre_BoxIMin(©_box)); - } - hypre_SubtractIndexes(hypre_BoxIMin(©_box), kshift, 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - loop_size[0]++; - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - - for (k = 0; k < 3; k++) - { - findex[k] *= rfactor[k]; - } - - hypre_AddIndexes(findex, start, 3, findex); - - /* X_Face */ - 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[2]++; - hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &l, - matrix_type); - if ((l <= upper_ranks[part][t]) && - (l >= lower_ranks[part][t])) - { - iedgeEdge[j] = l; - - /* X_Face. Two coarse Edge connections. */ - ncols_edgeEdge[j] = 2; - j++; - } - - } /* for (n= 1; n< rfactor[2]; n++) */ - } /* for (p= 0; p< rfactor[1]; p++) */ - } - hypre_SerialBoxLoop1End(m); - } /* hypre_ForBoxI(i, fboxes) */ - - break; - } - - case 7: - { - /* 3-d z_edge, can be interior, X or Y_Face, or Z_Edge */ - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - - /* vboxes inside the i'th cellbox */ - num_vboxes = n_CtoVbox[part][i]; - vboxnums = CtoVboxnums[part][i]; - - /* adjust the project cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - - /****************************************************** - * Check the location of the shifted lower box index: - * z_edge-> X_Face & Y_Face: - * X_Face- contract in the x direction if the processor - * interface is in the x direction. - * Y_Face- contract in the y direction if the processor - * interface is in the y direction. - ******************************************************/ - 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++) - { - vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); - if (hypre_IndexInBox(findex, vbox)) - { - hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in = trueV; - break; - } - } - /* not in any vbox */ - if (!row_in) - { - hypre_AddIndexes(hypre_BoxIMin(©_box), boxoffset[0], 3, - hypre_BoxIMin(©_box)); - } - hypre_SubtractIndexes(hypre_BoxIMin(©_box), jshift, 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - /* increase the loop_size by one in the X_Face direction */ - loop_size[0]++; - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - - for (k = 0; k < 3; k++) - { - findex[k] *= rfactor[k]; - } - - hypre_AddIndexes(findex, start, 3, findex); - - /* X_Face */ - 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[1]++; - hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &l, - matrix_type); - if ((l <= upper_ranks[part][t]) && - (l >= lower_ranks[part][t])) - { - iedgeEdge[j] = l; - - /* X_Face. Two coarse Edge connections. */ - ncols_edgeEdge[j] = 2; - j++; - } - } /* for (n= 1; n< rfactor[1]; n++) */ - } /* for (p= 0; p< rfactor[2]; p++) */ - } - hypre_SerialBoxLoop1End(m); - - /* Y_Face */ - hypre_CopyBox(cellbox, ©_box); - 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++) - { - vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); - if (hypre_IndexInBox(findex, vbox)) - { - hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in = trueV; - break; - } - } - /* not in any vbox */ - if (!row_in) - { - hypre_AddIndexes(hypre_BoxIMin(©_box), boxoffset[1], 3, - hypre_BoxIMin(©_box)); - } - hypre_SubtractIndexes(hypre_BoxIMin(©_box), ishift, 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - loop_size[1]++; - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - - for (k = 0; k < 3; k++) - { - findex[k] *= rfactor[k]; - } - - hypre_AddIndexes(findex, start, 3, findex); - - /* Y_Face */ - 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[0]++; - hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &l, - matrix_type); - if ((l <= upper_ranks[part][t]) && - (l >= lower_ranks[part][t])) - { - iedgeEdge[j] = l; - - /* Y_Face. Two coarse Edge connections. */ - ncols_edgeEdge[j] = 2; - j++; - } - } /* for (n= 1; n< rfactor[0]; n++) */ - } /* for (p= 0; p< rfactor[2]; p++) */ - } - hypre_SerialBoxLoop1End(m); - } /* hypre_ForBoxI(i, fboxes) */ - - break; - } - - } /* switch */ - } /* for (t= 0; t< Edge_nvars; t++) */ - - hypre_TFree(boxoffset, HYPRE_MEMORY_HOST); - } /* for (part= 0; part< nparts; part++) */ - } /* if (ndim == 3) */ - - 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); - - /* note that fboxes are the contracted CELL boxes. Will get the correct - variable grid extents. */ - fboxes = contract_fedgeBoxes[part]; - - for (t = 0; t < Edge_nvars; t++) - { - var = Edge_vartypes[t]; - 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) - { - case 2: - { - /* 2-d x_face = x_edge, can be interior */ - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - - /* adjust the contract cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - hypre_SubtractIndexes(hypre_BoxIMin(©_box), varoffsets[var], 3, - hypre_BoxIMin(©_box)); - /*hypre_IntersectBoxes(©_box, vbox, ©_box);*/ - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k = 0; k < 3; k++) - { - findex[k] *= rfactor[k]; - } - hypre_AddIndexes(findex, start, 3, findex); - - /* get interior edges */ - for (p = 1; p < rfactor[0]; p++) - { - hypre_CopyIndex(findex, var_index); - 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; - - /* lies interior of Face. Two coarse Edge connection. */ - ncols_edgeEdge[j] = 2; - j++; - - var_index[1]++; - } /* for (n= 0; n< rfactor[1]; n++) */ - } /* for (p= 1; p< rfactor[0]; p++) */ - - } - hypre_SerialBoxLoop1End(m); - } /* hypre_ForBoxI(i, fboxes) */ - break; - } - - case 3: - { - /* 2-d y_face = y_edge, can be interior */ - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - - /* adjust the project cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - hypre_SubtractIndexes(hypre_BoxIMin(©_box), varoffsets[var], 3, - hypre_BoxIMin(©_box)); - /* hypre_IntersectBoxes(©_box, vbox, ©_box);*/ - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - - for (k = 0; k < 3; k++) - { - findex[k] *= rfactor[k]; - } - - hypre_AddIndexes(findex, start, 3, findex); - - /* get interior edges */ - for (p = 1; p < rfactor[1]; p++) - { - hypre_CopyIndex(findex, var_index); - 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; - - /* lies interior of Face. Two coarse Edge connection. */ - ncols_edgeEdge[j] = 2; - j++; - - var_index[0]++; - } /* for (n= 0; n< rfactor[0]; n++) */ - } /* for (p= 1; p< rfactor[1]; p++) */ - - } - hypre_SerialBoxLoop1End(m); - } /* hypre_ForBoxI(i, fboxes) */ - break; - } - - case 5: - { - /* 3-d x_edge, can be only interior */ - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - - /* adjust the project cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - hypre_SubtractIndexes(hypre_BoxIMin(©_box), varoffsets[var], 3, - hypre_BoxIMin(©_box)); - /* hypre_IntersectBoxes(©_box, vbox, ©_box);*/ - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k = 0; k < 3; k++) - { - findex[k] *= rfactor[k]; - } - hypre_AddIndexes(findex, start, 3, findex); - - /* get interior edges */ - 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[1]++; - 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; - - /* Interior. Four coarse Edge connections. */ - 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]; - - } /* 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); - } /* for (p= 1; p< rfactor[2]; p++) */ - - } - hypre_SerialBoxLoop1End(m); - } /* hypre_ForBoxI(i, fboxes) */ - break; - } - - case 6: - { - /* 3-d y_edge, can be only interior */ - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - - /* adjust the project cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - hypre_SubtractIndexes(hypre_BoxIMin(©_box), varoffsets[var], 3, - hypre_BoxIMin(©_box)); - /* hypre_IntersectBoxes(©_box, vbox, ©_box);*/ - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k = 0; k < 3; k++) - { - findex[k] *= rfactor[k]; - } - hypre_AddIndexes(findex, start, 3, findex); - - /* get interior edges */ - 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[0]++; - 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; - - /* Interior. Four coarse Edge connections. */ - 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]; - - } /* 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); - } /* for (p= 1; p< rfactor[2]; p++) */ - - } - hypre_SerialBoxLoop1End(m); - } /* hypre_ForBoxI(i, fboxes) */ - - break; - } - - case 7: - { - /* 3-d z_edge, can be only interior */ - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - - /* adjust the project cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - hypre_SubtractIndexes(hypre_BoxIMin(©_box), varoffsets[var], 3, - hypre_BoxIMin(©_box)); - /* hypre_IntersectBoxes(©_box, vbox, ©_box);*/ - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k = 0; k < 3; k++) - { - findex[k] *= rfactor[k]; - } - hypre_AddIndexes(findex, start, 3, findex); - - /* get interior edges */ - 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[0]++; - 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; - - /* Interior. Four coarse Edge connections. */ - 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]; - - } /* 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); - } /* for (p= 1; p< rfactor[1]; p++) */ - } - hypre_SerialBoxLoop1End(m); - } /* hypre_ForBoxI(i, fboxes) */ - break; - } - - } /* switch */ - } /* for (t= 0; t< Edge_nvars; t++) */ - } /* for (part= 0; part< nparts; part++) */ - - k = 0; - j = 0; - for (i = 0; i < nedges; i++) - { - if (ncols_edgeEdge[i]) - { - k += ncols_edgeEdge[i]; - j++; - } - } - vals_edgeEdge = hypre_CTAlloc(HYPRE_Real, k, HYPRE_MEMORY_HOST); - jedge_Edge = hypre_CTAlloc(HYPRE_BigInt, k, HYPRE_MEMORY_HOST); - - /* update nedges so that the true number of rows is set */ - size = j; - - /********************************************************************* - * Fill up the edge_Edge interpolation matrix. Interpolation weights - * are determined differently for each type of fine edges. - *********************************************************************/ - - /* loop over fedges aligning with the agglomerate coarse edges first. */ - 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 */ - - /* note that fboxes are the contracted CELL boxes. Will get the correct - variable grid extents. */ - fboxes = contract_fedgeBoxes[part]; - - 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; - boxoffset = hypre_CTAlloc(hypre_Index, n_boxoffsets, HYPRE_MEMORY_HOST); - suboffset = hypre_CTAlloc(hypre_Index, n_boxoffsets, HYPRE_MEMORY_HOST); - 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]; - - /* boxoffset shrink in the i direction */ - 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 */ - hypre_SetIndex3(hi_index, 1, 0, 0); - break; - } - - case 3: /* 2-d: y_face (horizontal edges), stride=[1,rfactor[1],1] - fCedge_ratio= 1.0/rfactor[0] */ - { - hypre_SetIndex3(stride, 1, rfactor[1], 1); - fCedge_ratio = 1.0 / rfactor[0]; - - /* boxoffset shrink in the j direction */ - 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 */ - hypre_SetIndex3(hi_index, 0, 1, 0); - break; - } - - case 5: /* 3-d: x_edge, stride=[1,rfactor[1],rfactor[2]] - fCedge_ratio= 1.0/rfactor[0] */ - { - hypre_SetIndex3(stride, 1, rfactor[1], rfactor[2]); - 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(suboffset[0], 0, 1, 0); - hypre_SetIndex3(suboffset[1], 0, 0, 1); - - /* extend loop_size by one in the stride direction */ - hypre_SetIndex3(hi_index, 0, 1, 1); - break; - } - - case 6: /* 3-d: y_edge, stride=[rfactor[0],1,rfactor[2]] - fCedge_ratio= 1.0/rfactor[1] */ - { - hypre_SetIndex3(stride, rfactor[0], 1, rfactor[2]); - 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(suboffset[0], 1, 0, 0); - hypre_SetIndex3(suboffset[1], 0, 0, 1); - - /* extend loop_size by one in the stride direction */ - hypre_SetIndex3(hi_index, 1, 0, 1); - break; - } - case 7: /* 3-d: z_edge, stride=[rfactor[0],rfactor[1],1] - fCedge_ratio= 1.0/rfactor[2] */ - { - hypre_SetIndex3(stride, rfactor[0], rfactor[1], 1); - 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(suboffset[0], 1, 0, 0); - hypre_SetIndex3(suboffset[1], 0, 1, 0); - - /* extend loop_size by one in the stride direction */ - hypre_SetIndex3(hi_index, 1, 1, 0); - break; - } - default: - { - fCedge_ratio = 1.0; - } - } - - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - - /* vboxes inside the i'th cellbox */ - num_vboxes = n_CtoVbox[part][i]; - vboxnums = CtoVboxnums[part][i]; - - hypre_CopyIndex(Edge_cstarts[part][i], cstart); - - /* adjust the contracted cellbox to the variable box. - Note that some of the fboxes may be skipped because they - vanish. */ - hypre_CopyBox(cellbox, ©_box); - - 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++) - { - vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); - - if (hypre_IndexInBox(findex, vbox)) - { - hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in = trueV; - break; - } - } - /* not in any vbox */ - if (!row_in) - { - hypre_AddIndexes(hypre_BoxIMin(©_box), boxoffset[j], 3, - hypre_BoxIMin(©_box)); - - /* also modify cstart */ - hypre_AddIndexes(boxoffset[j], one_index, 3, boxoffset[j]); - hypre_StructMapFineToCoarse(boxoffset[j], zero_index, rfactor, - boxoffset[j]); - hypre_AddIndexes(cstart, boxoffset[j], 3, cstart); - } - } - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, stride, - loop_size); - - /* extend the loop_size so that upper boundary of the box are reached. */ - hypre_AddIndexes(loop_size, hi_index, 3, loop_size); - - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - /* note that the correct cbox corresponding to this non-vanishing - fbox is used. */ - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, stride, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (j = 0; j < 3; j++) - { - findex[j] *= stride[j]; - } - - /* make sure that we do have the fine row corresponding to findex */ - hypre_AddIndexes(findex, start, 3, findex); - hypre_SStructGridFindBoxManEntry(fgrid_edge, part, findex, t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, findex, &p, matrix_type); - - /* still row p may be outside the processor- check to make sure in */ - if ( (p <= upper_ranks[part][t]) && (p >= lower_ranks[part][t]) ) - { - hypre_SubtractIndexes(findex, start, 3, findex); - - /* determine where the edge lies- coarsening required. */ - hypre_StructMapFineToCoarse(findex, zero_index, rfactor, - cindex); - hypre_AddIndexes(cindex, cstart, 3, cindex); - - /* lies on coarse Edge. Coarse Edge connection: - var_index= cindex - subtract_index.*/ - hypre_SubtractIndexes(cindex, varoffsets[var], 3, var_index); - - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &l, - matrix_type); - jedge_Edge[k] = l; - vals_edgeEdge[k] = fCedge_ratio; - - k++; - } /* if ((p <= upper_ranks[part][t]) && (p >= lower_ranks[part][t])) */ - } - hypre_SerialBoxLoop1End(m); - } /* hypre_ForBoxI */ - - hypre_TFree(boxoffset, HYPRE_MEMORY_HOST); - hypre_TFree(suboffset, HYPRE_MEMORY_HOST); - } /* for (t= 0; t< nvars; t++) */ - } /* for (part= 0; part< nparts; part++) */ - - /* generate the face interpolation weights/info. Only for 3-d */ - if (ndim == 3) - { - 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 */ - - /* note that fboxes are the contracted CELL boxes. Will get the correct - variable grid extents. */ - 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++) - { - hypre_ClearIndex(boxoffset[t]); - hypre_IndexD(boxoffset[t], t) = rfactor[t] - 1; - } - - 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) - { - case 5: - { - /* 3-d x_edge, can be Y or Z_Face */ - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - - /* vboxes inside the i'th cellbox */ - num_vboxes = n_CtoVbox[part][i]; - vboxnums = CtoVboxnums[part][i]; - - hypre_CopyIndex(Edge_cstarts[part][i], cstart); - - /* adjust the project cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - - /****************************************************** - * Check the location of the shifted lower box index: - * x_edge-> Z_Face & Y_Face: - * Z_Face- contract in the z direction only if the - * processor interface is in the z direction - * Y_Face- contract in the y direction if the processor - * interface is in the y direction. - ******************************************************/ - 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++) - { - vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); - if (hypre_IndexInBox(findex, vbox)) - { - hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in = trueV; - break; - } - } - /* not in any vbox */ - if (!row_in) - { - hypre_AddIndexes(hypre_BoxIMin(©_box), boxoffset[2], 3, - hypre_BoxIMin(©_box)); - - /* modify cstart */ - hypre_AddIndexes(cstart, kshift, 3, cstart); - } - hypre_SubtractIndexes(hypre_BoxIMin(©_box), jshift, 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - /* increase the loop_size by one in the Z plane direction */ - loop_size[2]++; - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - - /* because of rfactor striding, cindex= findex. But adjust - by cstart to get actually coarse edge. */ - hypre_CopyIndex(findex, cindex); - hypre_AddIndexes(cindex, cstart, 3, cindex); - - /* Will need the actual fine indices. */ - for (l = 0; l < ndim; l++) - { - findex[l] *= rfactor[l]; - } - hypre_AddIndexes(findex, start, 3, findex); - - /****************************************************** - * ranks for coarse edges. Fine edges of agglomerate - * connect to these coarse edges. - * Z_Face (i,j,k-1). Two like-var coarse Edge connections. - * x_Edge (i,j,k-1), (i,j-1,k-1) - ******************************************************/ - hypre_SubtractIndexes(cindex, kshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank2, - matrix_type); - - hypre_SubtractIndexes(var_index, jshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - - /* loop over the strips of x_edges making up the Z_Face */ - 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[1]++; - hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &l, - matrix_type); - - /* still row l may be outside the processor */ - 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]); - k++; - - 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++) */ - } /* for (p= 0; p< rfactor[0]; p++) */ - } - hypre_SerialBoxLoop1End(m); - - /* Y plane direction */ - hypre_CopyIndex(Edge_cstarts[part][i], cstart); - hypre_CopyBox(cellbox, ©_box); - 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++) - { - vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); - if (hypre_IndexInBox(findex, vbox)) - { - hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in = trueV; - break; - } - } - /* not in any vbox */ - if (!row_in) - { - hypre_AddIndexes(hypre_BoxIMin(©_box), boxoffset[1], 3, - hypre_BoxIMin(©_box)); - - /* modify cstart */ - hypre_AddIndexes(cstart, jshift, 3, cstart); - } - hypre_SubtractIndexes(hypre_BoxIMin(©_box), kshift, 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - loop_size[1]++; - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - - /* because of rfactor striding, cindex= findex. But adjust - by cstart to get actually coarse edge. */ - hypre_CopyIndex(findex, cindex); - hypre_AddIndexes(cindex, cstart, 3, cindex); - - /* Will need the actual fine indices. */ - for (l = 0; l < ndim; l++) - { - findex[l] *= rfactor[l]; - } - hypre_AddIndexes(findex, start, 3, findex); - - /****************************************************** - * Y_Face. Two coarse Edge connections. - * x_Edge (i,j-1,k), (i,j-1,k-1) - ******************************************************/ - hypre_SubtractIndexes(cindex, jshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank2, - matrix_type); - - hypre_SubtractIndexes(var_index, kshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - - /* loop over the strips of x_edges making up the Y_Face */ - 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[2]++; - hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &l, - matrix_type); - 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]); - k++; - - 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++) */ - } /* for (p= 0; p< rfactor[0]; p++) */ - } - hypre_SerialBoxLoop1End(m); - } /* hypre_ForBoxI(i, fboxes) */ - break; - } - - case 6: - { - /* 3-d y_edge, can be X or Z_Face */ - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - - /* vboxes inside the i'th cellbox */ - num_vboxes = n_CtoVbox[part][i]; - vboxnums = CtoVboxnums[part][i]; - - hypre_CopyIndex(Edge_cstarts[part][i], cstart); - - /* adjust the project cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - - /****************************************************** - * Check the location of the shifted lower box index: - * y_edge-> X_Face & Z_Face: - * Z_Face- contract in the z direction only if the - * processor interface is in the z direction - * X_Face- contract in the x direction if the processor - * interface is in the x direction. - ******************************************************/ - - /* Z_Face */ - 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++) - { - vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); - if (hypre_IndexInBox(findex, vbox)) - { - hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in = trueV; - break; - } - } - /* not in any vbox */ - if (!row_in) - { - hypre_AddIndexes(hypre_BoxIMin(©_box), boxoffset[2], 3, - hypre_BoxIMin(©_box)); - /* modify cstart */ - hypre_AddIndexes(cstart, kshift, 3, cstart); - } - - hypre_SubtractIndexes(hypre_BoxIMin(©_box), ishift, 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - /* increase the loop_size by one in the Z plane direction */ - loop_size[2]++; - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - - /* because of rfactor striding, cindex= findex. But adjust - by cstart to get actually coarse edge. */ - hypre_CopyIndex(findex, cindex); - hypre_AddIndexes(cindex, cstart, 3, cindex); - - /* Will need the actual fine indices. */ - for (l = 0; l < ndim; l++) - { - findex[l] *= rfactor[l]; - } - hypre_AddIndexes(findex, start, 3, findex); - - /****************************************************** - * ranks for coarse edges. Fine edges of agglomerate - * connect to these coarse edges. - * Z_Face (i,j,k-1). Two like-var coarse Edge connections. - * y_Edge (i,j,k-1), (i-1,j,k-1) - ******************************************************/ - hypre_SubtractIndexes(cindex, kshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank2, - matrix_type); - - hypre_SubtractIndexes(var_index, ishift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - - /* loop over the strips of y_edges making up the Z_Face */ - 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[0]++; - hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &l, - matrix_type); - 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]); - k++; - - 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++) */ - } /* for (p= 0; p< rfactor[1]; p++) */ - } - hypre_SerialBoxLoop1End(m); - - /* X_Face */ - hypre_CopyBox(cellbox, ©_box); - hypre_CopyIndex(Edge_cstarts[part][i], cstart); - - 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++) - { - vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); - if (hypre_IndexInBox(findex, vbox)) - { - hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in = trueV; - break; - } - } - /* not in any vbox */ - if (!row_in) - { - hypre_AddIndexes(hypre_BoxIMin(©_box), boxoffset[0], 3, - hypre_BoxIMin(©_box)); - /* modify cstart */ - hypre_AddIndexes(cstart, ishift, 3, cstart); - } - hypre_SubtractIndexes(hypre_BoxIMin(©_box), kshift, 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - loop_size[0]++; - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - - /* because of rfactor striding, cindex= findex. But adjust - by cstart to get actually coarse edge. */ - hypre_CopyIndex(findex, cindex); - hypre_AddIndexes(cindex, cstart, 3, cindex); - - /* Will need the actual fine indices. */ - for (l = 0; l < ndim; l++) - { - findex[l] *= rfactor[l]; - } - hypre_AddIndexes(findex, start, 3, findex); - /****************************************************** - * X_Face. Two coarse Edge connections. - * y_Edge (i-1,j,k), (i-1,j,k-1) - ******************************************************/ - hypre_SubtractIndexes(cindex, ishift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank2, - matrix_type); - - hypre_SubtractIndexes(var_index, kshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - - /* loop over the strips of y_edges making up the X_Face */ - 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[2]++; - hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &l, - matrix_type); - 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]); - k++; - - 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++) */ - } /* for (p= 0; p< rfactor[1]; p++) */ - - } - hypre_SerialBoxLoop1End(m); - } /* hypre_ForBoxI(i, fboxes) */ - break; - } - - case 7: - { - /* 3-d z_edge, can be X or Y_Face */ - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - - /* vboxes inside the i'th cellbox */ - num_vboxes = n_CtoVbox[part][i]; - vboxnums = CtoVboxnums[part][i]; - - hypre_CopyIndex(Edge_cstarts[part][i], cstart); - - /* adjust the project cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - - /****************************************************** - * Check the location of the shifted lower box index: - * z_edge-> X_Face & Y_Face: - * X_Face- contract in the x direction if the processor - * interface is in the x direction. - * Y_Face- contract in the y direction if the processor - * interface is in the y direction. - ******************************************************/ - 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++) - { - vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); - if (hypre_IndexInBox(findex, vbox)) - { - hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in = trueV; - break; - } - } - /* not in any vbox */ - if (!row_in) - { - hypre_AddIndexes(hypre_BoxIMin(©_box), boxoffset[0], 3, - hypre_BoxIMin(©_box)); - /* modify cstart */ - hypre_AddIndexes(cstart, ishift, 3, cstart); - } - hypre_SubtractIndexes(hypre_BoxIMin(©_box), jshift, 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - /* increase the loop_size by one in the X plane direction */ - loop_size[0]++; - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - - /* because of rfactor striding, cindex= findex. But adjust - by cstart to get actually coarse edge. */ - hypre_CopyIndex(findex, cindex); - hypre_AddIndexes(cindex, cstart, 3, cindex); - - /* Will need the actual fine indices. */ - for (l = 0; l < ndim; l++) - { - findex[l] *= rfactor[l]; - } - hypre_AddIndexes(findex, start, 3, findex); - - /****************************************************** - * ranks for coarse edges. Fine edges of agglomerate - * connect to these coarse edges. - * X_Face. Two coarse Edge connections. - * z_Edge (i-1,j,k), (i-1,j-1,k) - ******************************************************/ - hypre_SubtractIndexes(cindex, ishift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank2, - matrix_type); - - hypre_SubtractIndexes(var_index, jshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - - /* loop over the strips of z_edges making up the X_Face */ - 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[1]++; - hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &l, - matrix_type); - 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]); - k++; - - 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++) */ - } /* for (p= 0; p< rfactor[2]; p++) */ - } - hypre_SerialBoxLoop1End(m); - - /* Y plane */ - hypre_CopyBox(cellbox, ©_box); - hypre_CopyIndex(Edge_cstarts[part][i], cstart); - - 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++) - { - vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); - if (hypre_IndexInBox(findex, vbox)) - { - hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in = trueV; - break; - } - } - /* not in any vbox */ - if (!row_in) - { - hypre_AddIndexes(hypre_BoxIMin(©_box), boxoffset[1], 3, - hypre_BoxIMin(©_box)); - /* modify cstart */ - hypre_AddIndexes(cstart, jshift, 3, cstart); - } - hypre_SubtractIndexes(hypre_BoxIMin(©_box), ishift, 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - loop_size[1]++; - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - - /* because of rfactor striding, cindex= findex. But adjust - by cstart to get actually coarse edge. */ - hypre_CopyIndex(findex, cindex); - hypre_AddIndexes(cindex, cstart, 3, cindex); - - /* Will need the actual fine indices. */ - for (l = 0; l < ndim; l++) - { - findex[l] *= rfactor[l]; - } - hypre_AddIndexes(findex, start, 3, findex); - /********************************************************** - * Y_Face (i,j-1,k). Two like-var coarse Edge connections. - * z_Edge (i,j-1,k), (i-1,j-1,k) - **********************************************************/ - hypre_SubtractIndexes(cindex, jshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank2, - matrix_type); - - hypre_SubtractIndexes(var_index, ishift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - - /* loop over the strips of y_edges making up the Y_Face */ - 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[0]++; - hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &l, - matrix_type); - 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]); - k++; - - 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++) */ - } /* for (p= 0; p< rfactor[2]; p++) */ - - } - hypre_SerialBoxLoop1End(m); - } /* hypre_ForBoxI(i, fboxes) */ - break; - } - - } /* switch */ - } /* for (t= 0; t< Edge_nvars; t++) */ - hypre_TFree(boxoffset, HYPRE_MEMORY_HOST); - } /* for (part= 0; part< nparts; part++) */ - } /* if (ndim == 3) */ - - /* generate the interior interpolation weights/info */ - 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 */ - - /* note that fboxes are the contracted CELL boxes. Will get the correct - variable grid extents. */ - fboxes = contract_fedgeBoxes[part]; - - 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) - { - case 2: - { - /* 2-d x_face = x_edge, can be interior or on X_Edge */ - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - vbox = hypre_BoxArrayBox(box_array, i); - hypre_CopyIndex(Edge_cstarts[part][i], cstart); - - /* adjust the project cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - hypre_SubtractIndexes(hypre_BoxIMin(©_box), varoffsets[var], 3, - hypre_BoxIMin(©_box)); - /* hypre_IntersectBoxes(©_box, vbox, ©_box);*/ - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, r); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - - /***************************************************** - * Where the fine edge lies wrt the coarse edge: - * Since we stride by rfactor, lindex is - * the coarse index. No coarsening needed, i.e., - * cindex= findex. - * - * Loop over the interior fine edges in an agglomerate. - *****************************************************/ - for (p = 1; p < rfactor[0]; p++) - { - for (n = 0; n < rfactor[1]; n++) - { - hypre_CopyIndex(findex, cindex); - hypre_AddIndexes(cindex, cstart, 3, cindex); - - /*interior of Face. Extract the two coarse Edge - (x_Edge ijk & (i-1,j,k)*/ - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, cindex, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, - matrix_type); - jedge_Edge[k] = rank; - vals_edgeEdge[k] = (HYPRE_Real) p / (rfactor[0] * rfactor[1]); - k++; - - hypre_SubtractIndexes(cindex, ishift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - 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]); - k++; - } /* for (n= 0; n< rfactor[1]; n++) */ - } /* for (p= 1; p< rfactor[0]; p++) */ - - } - hypre_SerialBoxLoop1End(r); - } /* hypre_ForBoxI(i, fboxes) */ - break; - } - - case 3: - { - /* 2-d y_face = y_edge, can be interior or on Y_Edge */ - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - vbox = hypre_BoxArrayBox(box_array, i); - hypre_CopyIndex(Edge_cstarts[part][i], cstart); - - /* adjust the project cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - hypre_SubtractIndexes(hypre_BoxIMin(©_box), varoffsets[var], 3, - hypre_BoxIMin(©_box)); - /* hypre_IntersectBoxes(©_box, vbox, ©_box);*/ - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, r); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - - /***************************************************** - * Where the fine edge lies wrt the coarse edge: - * Since we stride by rfactor, lindex is - * the coarse index. No coarsening needed, i.e., - * cindex= findex. - * - * Loop over the interior fine edges in an agglomerate. - *****************************************************/ - for (p = 1; p < rfactor[1]; p++) - { - for (n = 0; n < rfactor[0]; n++) - { - hypre_CopyIndex(findex, cindex); - hypre_AddIndexes(cindex, cstart, 3, cindex); - - /*lies interior of Face. Extract the two coarse Edge - (y_Edge ijk & (i,j-1,k). */ - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, cindex, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, - matrix_type); - jedge_Edge[k] = rank; - vals_edgeEdge[k] = (HYPRE_Real) p / (rfactor[0] * rfactor[1]); - k++; - - hypre_SubtractIndexes(cindex, jshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - 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]); - k++; - } /* for (n= 0; n< rfactor[0]; n++) */ - } /* for (p= 1; p< rfactor[1]; p++) */ - - } - hypre_SerialBoxLoop1End(r); - } /* hypre_ForBoxI(i, fboxes) */ - break; - } - - case 5: - { - /* 3-d x_edge, must be interior */ - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - vbox = hypre_BoxArrayBox(box_array, i); - hypre_CopyIndex(Edge_cstarts[part][i], cstart); - - /* adjust the project cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - hypre_SubtractIndexes(hypre_BoxIMin(©_box), varoffsets[var], 3, - hypre_BoxIMin(©_box)); - /*hypre_IntersectBoxes(©_box, vbox, ©_box);*/ - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, r); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - - /***************************************************** - * Where the fine edge lies wrt the coarse edge: - * Since we stride by rfactor, lindex is - * the coarse index. No coarsening needed, i.e., - * cindex= findex. - * - * Loop over the interior fine edges in an agglomerate. - *****************************************************/ - for (p = 1; p < rfactor[2]; p++) - { - for (n = 1; n < rfactor[1]; n++) - { - for (m = 0; m < rfactor[0]; m++) - { - hypre_CopyIndex(findex, cindex); - hypre_AddIndexes(cindex, cstart, 3, cindex); - - /*********************************************** - * Interior. - * x_Edge ijk, (i,j-1,k), (i,j-1,k-1), (i,j,k-1) - ***********************************************/ - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, cindex, - 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]); - - k++; - - hypre_SubtractIndexes(cindex, jshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - 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]); - k++; - - hypre_SubtractIndexes(var_index, kshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - 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]); - k++; - - hypre_AddIndexes(var_index, jshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - 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]); - k++; - } /* for (m= 0; m< rfactor[0]; m++) */ - } /* for (n= 1; n< rfactor[1]; n++) */ - } /* for (p= 1; p< rfactor[2]; p++) */ - } - hypre_SerialBoxLoop1End(r); - } /* hypre_ForBoxI(i, fboxes) */ - break; - } - - case 6: - { - /* 3-d y_edge, must be interior */ - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - vbox = hypre_BoxArrayBox(box_array, i); - hypre_CopyIndex(Edge_cstarts[part][i], cstart); - - /* adjust the project cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - hypre_SubtractIndexes(hypre_BoxIMin(©_box), varoffsets[var], 3, - hypre_BoxIMin(©_box)); - /*hypre_IntersectBoxes(©_box, vbox, ©_box);*/ - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, r); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - - /***************************************************** - * Where the fine edge lies wrt the coarse edge: - * Since we stride by rfactor, lindex is - * the coarse index. No coarsening needed, i.e., - * cindex= findex. - * - * Loop over the interior fine edges in an agglomerate. - *****************************************************/ - for (p = 1; p < rfactor[2]; p++) - { - for (n = 1; n < rfactor[0]; n++) - { - for (m = 0; m < rfactor[1]; m++) - { - hypre_CopyIndex(findex, cindex); - hypre_AddIndexes(cindex, cstart, 3, cindex); - - /*********************************************** - * Interior. - * y_Edge ijk, (i-1,j,k), (i-1,j,k-1), (i,j,k-1) - ***********************************************/ - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, cindex, - 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]); - k++; - - hypre_SubtractIndexes(cindex, ishift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - 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]); - k++; - - hypre_SubtractIndexes(var_index, kshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - 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]); - k++; - - hypre_AddIndexes(var_index, ishift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - 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]); - k++; - } /* for (m= 0; m< rfactor[1]; m++) */ - } /* for (n= 1; n< rfactor[0]; n++) */ - } /* for (p= 1; p< rfactor[2]; p++) */ - - } - hypre_SerialBoxLoop1End(r); - } /* hypre_ForBoxI(i, fboxes) */ - break; - } - - case 7: - { - /* 3-d z_edge, only the interior */ - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - vbox = hypre_BoxArrayBox(box_array, i); - hypre_CopyIndex(Edge_cstarts[part][i], cstart); - - /* adjust the project cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - hypre_SubtractIndexes(hypre_BoxIMin(©_box), varoffsets[var], 3, - hypre_BoxIMin(©_box)); - /*hypre_IntersectBoxes(©_box, vbox, ©_box);*/ - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, r); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - - /***************************************************** - * Where the fine edge lies wrt the coarse edge: - * Since we stride by rfactor, lindex is - * the coarse index. No coarsening needed, i.e., - * cindex= findex. - * - * Loop over the interior fine edges in an agglomerate. - *****************************************************/ - for (p = 1; p < rfactor[1]; p++) - { - for (n = 1; n < rfactor[0]; n++) - { - for (m = 0; m < rfactor[2]; m++) - { - hypre_CopyIndex(findex, cindex); - hypre_AddIndexes(cindex, cstart, 3, cindex); - - /************************************************* - * Interior. - * z_Edge ijk, (i-1,j,k), (i-1,j-1,k), (i,j-1,k) - *************************************************/ - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, cindex, - 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]); - k++; - - hypre_SubtractIndexes(cindex, ishift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - 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]); - k++; - - hypre_SubtractIndexes(var_index, jshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - 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]); - k++; - - hypre_AddIndexes(var_index, ishift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - 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]); - k++; - } /* for (m= 0; m< rfactor[2]; m++) */ - } /* for (n= 1; n< rfactor[0]; n++) */ - } /* for (p= 1; p< rfactor[1]; p++) */ - } - hypre_SerialBoxLoop1End(r); - } /* hypre_ForBoxI(i, fboxes) */ - break; - } - } /* switch */ - } /* for (t= 0; t< Edge_nvars; t++) */ - } /* for (part= 0; part< nparts; part++) */ - - HYPRE_IJMatrixSetValues(edge_Edge, size, ncols_edgeEdge, - (const HYPRE_BigInt*) iedgeEdge, (const HYPRE_BigInt*) jedge_Edge, - (const HYPRE_Real*) vals_edgeEdge); - HYPRE_IJMatrixAssemble((HYPRE_IJMatrix) edge_Edge); - - hypre_TFree(ncols_edgeEdge, HYPRE_MEMORY_HOST); - hypre_TFree(iedgeEdge, HYPRE_MEMORY_HOST); - hypre_TFree(jedge_Edge, HYPRE_MEMORY_HOST); - hypre_TFree(vals_edgeEdge, HYPRE_MEMORY_HOST); - - hypre_TFree(varoffsets, HYPRE_MEMORY_HOST); - hypre_TFree(vartype_map, HYPRE_MEMORY_HOST); - - /* n_CtoVbox[part][cellboxi][var] & CtoVboxnums[part][cellboxi][var][nvboxes] */ - for (part = 0; part < nparts; part++) - { - p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); - Edge_nvars = hypre_SStructPGridNVars(p_fgrid); - - var_fgrid = hypre_SStructPGridCellSGrid(p_fgrid); - fboxes = hypre_StructGridBoxes(var_fgrid); - hypre_ForBoxI(j, fboxes) - { - for (t = 0; t < Edge_nvars; t++) - { - hypre_TFree(CtoVboxnums[part][j][t], HYPRE_MEMORY_HOST); - } - hypre_TFree(n_CtoVbox[part][j], HYPRE_MEMORY_HOST); - hypre_TFree(CtoVboxnums[part][j], HYPRE_MEMORY_HOST); - } - hypre_TFree(n_CtoVbox[part], HYPRE_MEMORY_HOST); - hypre_TFree(CtoVboxnums[part], HYPRE_MEMORY_HOST); - } - hypre_TFree(n_CtoVbox, HYPRE_MEMORY_HOST); - hypre_TFree(CtoVboxnums, HYPRE_MEMORY_HOST); - - for (part = 0; part < nparts; part++) - { - hypre_BoxArrayDestroy(contract_fedgeBoxes[part]); - hypre_TFree(Edge_cstarts[part], HYPRE_MEMORY_HOST); - hypre_TFree(upper_shifts[part], HYPRE_MEMORY_HOST); - hypre_TFree(lower_shifts[part], HYPRE_MEMORY_HOST); - hypre_TFree(cfbox_mapping[part], HYPRE_MEMORY_HOST); - hypre_TFree(fcbox_mapping[part], HYPRE_MEMORY_HOST); - hypre_TFree(upper_ranks[part], HYPRE_MEMORY_HOST); - hypre_TFree(lower_ranks[part], HYPRE_MEMORY_HOST); - } - hypre_TFree(contract_fedgeBoxes, HYPRE_MEMORY_HOST); - hypre_TFree(Edge_cstarts, HYPRE_MEMORY_HOST); - hypre_TFree(upper_shifts, HYPRE_MEMORY_HOST); - hypre_TFree(lower_shifts, HYPRE_MEMORY_HOST); - hypre_TFree(cfbox_mapping, HYPRE_MEMORY_HOST); - hypre_TFree(fcbox_mapping, HYPRE_MEMORY_HOST); - hypre_TFree(upper_ranks, HYPRE_MEMORY_HOST); - hypre_TFree(lower_ranks, HYPRE_MEMORY_HOST); - - return (hypre_IJMatrix *) edge_Edge; -} diff --git a/src/sstruct_ls/maxwell_PNedelec_bdy.c b/src/sstruct_ls/maxwell_PNedelec_bdy.c deleted file mode 100644 index f041a69e02..0000000000 --- a/src/sstruct_ls/maxwell_PNedelec_bdy.c +++ /dev/null @@ -1,447 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_sstruct_ls.h" - -/*-------------------------------------------------------------------------- - * Finds the boundary boxes for all var_grids in pgrid. Use the cell grid - * to determine the boundary. - * bdry[n_cellboxes, nvars+1]= boxarrayarray ptr.: hypre_BoxArrayArray ***bdry. - * bdry[n_cellboxes, 0] is the cell-centred box. - * Each box_arrayarray: for each variable, there are a max of 2*(ndim-1) - * box_arrays (e.g., in 3d, the x_edges on the boundary can be the two - * z_faces & the two y_faces of the boundary). Each of these box_arrays - * consists of boxes that can be on the boundary. - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_Maxwell_PNedelec_Bdy( hypre_StructGrid *cell_grid, - hypre_SStructPGrid *pgrid, - hypre_BoxArrayArray ****bdry_ptr ) -{ - - HYPRE_Int ierr = 0; - - HYPRE_Int nvars = hypre_SStructPGridNVars(pgrid); - - hypre_BoxArrayArray *cellgrid_bdry; - hypre_BoxArrayArray ***bdry; - hypre_BoxArray *box_array, *box_array2; - hypre_BoxArray *cell_boxes; - hypre_Box *box, *bdy_box, *shifted_box; - - HYPRE_Int ndim = hypre_SStructPGridNDim(pgrid); - - HYPRE_SStructVariable *vartypes = hypre_SStructPGridVarTypes(pgrid); - hypre_Index varoffset, ishift, jshift, kshift; - hypre_Index lower, upper; - - HYPRE_Int *flag; - HYPRE_Int i, j, k, t, nboxes, bdy; - - hypre_SetIndex3(ishift, 1, 0, 0); - hypre_SetIndex3(jshift, 0, 1, 0); - hypre_SetIndex3(kshift, 0, 0, 1); - - 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); - - hypre_ForBoxI(j, cell_boxes) - { - 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); - bdy = 0; - - for (i = 0; i < ndim; i++) - { - 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))) - { - flag[2 * i] = 1; - bdy++; - } - - if (hypre_BoxArraySize(hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 2 * i + 1))) - { - flag[2 * i + 1] = 1; - bdy++; - } - } - - /* 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); - - 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 */ - } - - for (i = 0; i < nvars; i++) - { - t = vartypes[i]; - hypre_SStructVariableGetOffset(vartypes[i], ndim, varoffset); - - 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); - 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, varoffset, ndim, upper); - - hypre_BoxSetExtents(shifted_box, lower, upper); - hypre_AppendBox(shifted_box, box_array2); - } - } - - if (flag[1]) /* boundary i= upper */ - { - 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); - - /* 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); - } - } - - break; - } - - case 3: /* yface, boundary j= lower, upper */ - { - if (flag[2]) /* boundary j= lower */ - { - 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, varoffset, ndim, upper); - - hypre_BoxSetExtents(shifted_box, lower, upper); - hypre_AppendBox(shifted_box, box_array2); - } - } - - if (flag[3]) /* boundary j= upper */ - { - 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_BoxSetExtents(shifted_box, lower, upper); - hypre_AppendBox(shifted_box, box_array2); - } - } - - break; - } - - case 5: /* xedge, boundary z_faces & y_faces */ - { - if (flag[4]) /* boundary k= lower zface*/ - { - box_array = hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 4); - 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, 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); - 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); - } - } - - if (flag[2]) /* boundary j= lower yface*/ - { - box_array = hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 2); - 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, 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); - 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, kshift, ndim, lower); - - hypre_BoxSetExtents(shifted_box, lower, upper); - hypre_AppendBox(shifted_box, box_array2); - } - } - break; - } - - case 6: /* yedge, boundary z_faces & x_faces */ - { - if (flag[4]) /* boundary k= lower zface*/ - { - box_array = hypre_BoxArrayArrayBoxArray(cellgrid_bdry, 4); - 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, 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); - 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); - - /* 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); - - /* 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); - } - } - - break; - } - - case 7: /* zedge, boundary y_faces & x_faces */ - { - 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); - - /* 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); - - /* 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); - - /* 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); - - /* 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; - } - - } /* switch(t) */ - } /* for (i= 0; i< nvars; i++) */ - } /* if (bdy) */ - - 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++) - { - bdry[j][i] = hypre_BoxArrayArrayCreate(0, ndim); - } - } - - hypre_BoxArrayArrayDestroy(cellgrid_bdry); - hypre_TFree(flag, HYPRE_MEMORY_HOST); - } /* hypre_ForBoxI(j, cell_boxes) */ - - hypre_BoxDestroy(shifted_box); - - *bdry_ptr = bdry; - - return ierr; -} - diff --git a/src/sstruct_ls/maxwell_TV.c b/src/sstruct_ls/maxwell_TV.c deleted file mode 100644 index 19044c04eb..0000000000 --- a/src/sstruct_ls/maxwell_TV.c +++ /dev/null @@ -1,397 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_sstruct_ls.h" -#include "maxwell_TV.h" - -/*-------------------------------------------------------------------------- - * hypre_MaxwellTVCreate - *--------------------------------------------------------------------------*/ - -void * -hypre_MaxwellTVCreate( MPI_Comm comm ) -{ - hypre_MaxwellData *maxwell_data; - hypre_Index *maxwell_rfactor; - - maxwell_data = hypre_CTAlloc(hypre_MaxwellData, 1, HYPRE_MEMORY_HOST); - - (maxwell_data -> comm) = comm; - (maxwell_data -> time_index) = hypre_InitializeTiming("Maxwell_Solver"); - - /* set defaults */ - (maxwell_data -> tol) = 1.0e-06; - (maxwell_data -> max_iter) = 200; - (maxwell_data -> rel_change) = 0; - (maxwell_data -> zero_guess) = 0; - (maxwell_data -> num_pre_relax) = 1; - (maxwell_data -> num_post_relax) = 1; - (maxwell_data -> constant_coef) = 0; - (maxwell_data -> print_level) = 0; - (maxwell_data -> logging) = 0; - - maxwell_rfactor = hypre_TAlloc(hypre_Index, 1, HYPRE_MEMORY_HOST); - hypre_SetIndex3(maxwell_rfactor[0], 2, 2, 2); - (maxwell_data -> rfactor) = maxwell_rfactor; - - - return (void *) maxwell_data; -} - -/*-------------------------------------------------------------------------- - * hypre_MaxwellTVDestroy - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_MaxwellTVDestroy( void *maxwell_vdata ) -{ - hypre_MaxwellData *maxwell_data = (hypre_MaxwellData *)maxwell_vdata; - - HYPRE_Int l; - HYPRE_Int ierr = 0; - - if (maxwell_data) - { - hypre_TFree(maxwell_data-> rfactor, HYPRE_MEMORY_HOST); - - if ((maxwell_data -> logging) > 0) - { - hypre_TFree(maxwell_data -> norms, HYPRE_MEMORY_HOST); - hypre_TFree(maxwell_data -> rel_norms, HYPRE_MEMORY_HOST); - } - - if ((maxwell_data -> edge_numlevels) > 0) - { - 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); - - /* 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); - } - hypre_TFree(maxwell_data-> egrid_l, HYPRE_MEMORY_HOST); - hypre_TFree(maxwell_data-> Aee_l, HYPRE_MEMORY_HOST); - hypre_TFree(maxwell_data-> be_l, HYPRE_MEMORY_HOST); - hypre_TFree(maxwell_data-> xe_l, HYPRE_MEMORY_HOST); - hypre_TFree(maxwell_data-> rese_l, HYPRE_MEMORY_HOST); - hypre_TFree(maxwell_data-> ee_l, HYPRE_MEMORY_HOST); - hypre_TFree(maxwell_data-> eVtemp_l, HYPRE_MEMORY_HOST); - hypre_TFree(maxwell_data-> eVtemp2_l, HYPRE_MEMORY_HOST); - hypre_TFree(maxwell_data-> Pe_l, HYPRE_MEMORY_HOST); - hypre_TFree(maxwell_data-> ReT_l, HYPRE_MEMORY_HOST); - 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); - } - - if ((maxwell_data -> node_numlevels) > 0) - { - 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_BoomerAMGDestroy(maxwell_data-> amg_vdata); - - hypre_TFree(maxwell_data-> Ann_l, HYPRE_MEMORY_HOST); - hypre_TFree(maxwell_data-> Pn_l, HYPRE_MEMORY_HOST); - hypre_TFree(maxwell_data-> RnT_l, HYPRE_MEMORY_HOST); - hypre_TFree(maxwell_data-> bn_l, HYPRE_MEMORY_HOST); - hypre_TFree(maxwell_data-> xn_l, HYPRE_MEMORY_HOST); - hypre_TFree(maxwell_data-> resn_l, HYPRE_MEMORY_HOST); - hypre_TFree(maxwell_data-> en_l, HYPRE_MEMORY_HOST); - hypre_TFree(maxwell_data-> nVtemp_l, HYPRE_MEMORY_HOST); - hypre_TFree(maxwell_data-> nVtemp2_l, HYPRE_MEMORY_HOST); - hypre_TFree(maxwell_data-> nCF_marker_l, HYPRE_MEMORY_HOST); - hypre_TFree(maxwell_data-> nrelax_weight, HYPRE_MEMORY_HOST); - hypre_TFree(maxwell_data-> nomega, HYPRE_MEMORY_HOST); - } - - HYPRE_SStructStencilDestroy(maxwell_data-> Ann_stencils[0]); - hypre_TFree(maxwell_data-> Ann_stencils, HYPRE_MEMORY_HOST); - - if ((maxwell_data -> en_numlevels) > 0) - { - for (l = 1; l < (maxwell_data-> en_numlevels); 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_SStructVectorDestroy( - (HYPRE_SStructVector) maxwell_data-> xn); - HYPRE_SStructMatrixDestroy( - (HYPRE_SStructMatrix) maxwell_data-> Ann); - HYPRE_IJMatrixDestroy(maxwell_data-> Aen); - - hypre_ParCSRMatrixDestroy(maxwell_data-> T_transpose); - - hypre_FinalizeTiming(maxwell_data -> time_index); - hypre_TFree(maxwell_data, HYPRE_MEMORY_HOST); - } - - return (ierr); -} - -/*-------------------------------------------------------------------------- - * hypre_MaxwellSetRfactors - *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_MaxwellSetRfactors(void *maxwell_vdata, - HYPRE_Int rfactor[HYPRE_MAXDIM] ) -{ - hypre_MaxwellData *maxwell_data = (hypre_MaxwellData *)maxwell_vdata; - hypre_Index *maxwell_rfactor = (maxwell_data -> rfactor); - HYPRE_Int ierr = 0; - - hypre_CopyIndex(rfactor, maxwell_rfactor[0]); - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_MaxwellSetGrad - *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_MaxwellSetGrad(void *maxwell_vdata, - hypre_ParCSRMatrix *T ) -{ - hypre_MaxwellData *maxwell_data = (hypre_MaxwellData *)maxwell_vdata; - HYPRE_Int ierr = 0; - - (maxwell_data -> Tgrad) = T; - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_MaxwellSetConstantCoef - *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_MaxwellSetConstantCoef( void *maxwell_vdata, - HYPRE_Int constant_coef) -{ - hypre_MaxwellData *maxwell_data = (hypre_MaxwellData *)maxwell_vdata; - HYPRE_Int ierr = 0; - - (maxwell_data -> constant_coef) = constant_coef; - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_MaxwellSetTol - *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_MaxwellSetTol( void *maxwell_vdata, - HYPRE_Real tol ) -{ - hypre_MaxwellData *maxwell_data = (hypre_MaxwellData *)maxwell_vdata; - HYPRE_Int ierr = 0; - - (maxwell_data -> tol) = tol; - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_MaxwellSetMaxIter - *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_MaxwellSetMaxIter( void *maxwell_vdata, - HYPRE_Int max_iter ) -{ - hypre_MaxwellData *maxwell_data = (hypre_MaxwellData *)maxwell_vdata; - HYPRE_Int ierr = 0; - - (maxwell_data -> max_iter) = max_iter; - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_MaxwellSetRelChange - *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_MaxwellSetRelChange( void *maxwell_vdata, - HYPRE_Int rel_change ) -{ - hypre_MaxwellData *maxwell_data = (hypre_MaxwellData *)maxwell_vdata; - HYPRE_Int ierr = 0; - - (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_Int ierr = 0; - - (maxwell_data -> num_pre_relax) = num_pre_relax; - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_MaxwellSetNumPostRelax - *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_MaxwellSetNumPostRelax( void *maxwell_vdata, - HYPRE_Int num_post_relax ) -{ - hypre_MaxwellData *maxwell_data = (hypre_MaxwellData *)maxwell_vdata; - HYPRE_Int ierr = 0; - - (maxwell_data -> num_post_relax) = num_post_relax; - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_MaxwellGetNumIterations - *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_MaxwellGetNumIterations( void *maxwell_vdata, - HYPRE_Int *num_iterations ) -{ - hypre_MaxwellData *maxwell_data = (hypre_MaxwellData *)maxwell_vdata; - HYPRE_Int ierr = 0; - - *num_iterations = (maxwell_data -> num_iterations); - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_MaxwellSetPrintLevel - *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_MaxwellSetPrintLevel( void *maxwell_vdata, - HYPRE_Int print_level) -{ - hypre_MaxwellData *maxwell_data = (hypre_MaxwellData *)maxwell_vdata; - HYPRE_Int ierr = 0; - - (maxwell_data -> print_level) = print_level; - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_MaxwellSetLogging - *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_MaxwellSetLogging( void *maxwell_vdata, - HYPRE_Int logging) -{ - hypre_MaxwellData *maxwell_data = (hypre_MaxwellData *)maxwell_vdata; - HYPRE_Int ierr = 0; - - (maxwell_data -> logging) = logging; - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_MaxwellPrintLogging - *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_MaxwellPrintLogging( void *maxwell_vdata, - HYPRE_Int myid) -{ - 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 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 (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; -} - -HYPRE_Int -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); - HYPRE_Real *rel_norms = (maxwell_data -> rel_norms); - - HYPRE_Int ierr = 0; - - if (logging > 0) - { - if (max_iter == 0) - { - ierr = 1; - } - else if (num_iterations == max_iter) - { - *relative_residual_norm = rel_norms[num_iterations - 1]; - } - else - { - *relative_residual_norm = rel_norms[num_iterations]; - } - } - return ierr; -} diff --git a/src/sstruct_ls/maxwell_TV.h b/src/sstruct_ls/maxwell_TV.h deleted file mode 100644 index 72ea06bcd2..0000000000 --- a/src/sstruct_ls/maxwell_TV.h +++ /dev/null @@ -1,106 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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 Maxwell solver - * - *****************************************************************************/ - -#ifndef hypre_MAXWELL_HEADER -#define hypre_MAXWELL_HEADER - -/*-------------------------------------------------------------------------- - * hypre_MaxwellData: - *--------------------------------------------------------------------------*/ - -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; - - /* these will be extracted from the amg_data structure. Note that there is no grid - underlying these matrices and vectors if they are generated by the amg_setup. - So, will be stored as Parcsr_matrices and Par_vectors. */ - hypre_SStructMatrix *Ann; - hypre_SStructVector *bn; - hypre_SStructVector *xn; - - void *amg_vdata; - hypre_ParCSRMatrix **Ann_l; - hypre_SStructStencil **Ann_stencils; - hypre_ParCSRMatrix **Pn_l; - hypre_ParCSRMatrix **RnT_l; - hypre_ParVector **bn_l; - hypre_ParVector **xn_l; - hypre_ParVector **resn_l; - hypre_ParVector **en_l; - hypre_ParVector **nVtemp_l; - hypre_ParVector **nVtemp2_l; - HYPRE_Int **nCF_marker_l; - HYPRE_Real *nrelax_weight; - HYPRE_Real *nomega; - HYPRE_Int nrelax_type; - HYPRE_Int node_numlevels; - - hypre_ParCSRMatrix *Tgrad; - hypre_ParCSRMatrix *T_transpose; - - /* edge data structure. These will have grids. */ - HYPRE_Int edge_maxlevels; - HYPRE_Int edge_numlevels; - hypre_ParCSRMatrix **Aee_l; - hypre_ParVector **be_l; - hypre_ParVector **xe_l; - hypre_ParVector **rese_l; - hypre_ParVector **ee_l; - hypre_ParVector **eVtemp_l; - hypre_ParVector **eVtemp2_l; - HYPRE_Int **eCF_marker_l; - HYPRE_Real *erelax_weight; - HYPRE_Real *eomega; - HYPRE_Int erelax_type; - - /* edge data structure. These will have no grid. */ - hypre_IJMatrix **Pe_l; - hypre_IJMatrix **ReT_l; - HYPRE_Int **BdryRanks_l; - HYPRE_Int *BdryRanksCnts_l; - - /* edge-node data structure. These will have grids. */ - HYPRE_Int en_numlevels; - - /* log info (always logged) */ - HYPRE_Int num_iterations; - HYPRE_Int time_index; - - /* additional log info (logged when `logging' > 0) */ - HYPRE_Int print_level; - HYPRE_Int logging; - HYPRE_Real *norms; - HYPRE_Real *rel_norms; - -} hypre_MaxwellData; - -#endif diff --git a/src/sstruct_ls/maxwell_TV_setup.c b/src/sstruct_ls/maxwell_TV_setup.c deleted file mode 100644 index 42e5e91cda..0000000000 --- a/src/sstruct_ls/maxwell_TV_setup.c +++ /dev/null @@ -1,1535 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other - * HYPRE Project Developers. See the top-level COPYRIGHT file for details. - * - * SPDX-License-Identifier: (Apache-2.0 OR MIT) - ******************************************************************************/ - -/****************************************************************************** - * OpenMP Problems - * - * Are private static arrays a problem? - * - ******************************************************************************/ - -#include "_hypre_sstruct_ls.h" -#include "maxwell_TV.h" -#include "par_amg.h" - -#define DEBUG 0 -/*-------------------------------------------------------------------------- - * hypre_MaxwellTV_Setup - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_MaxwellTV_Setup(void *maxwell_vdata, - hypre_SStructMatrix *Aee_in, - hypre_SStructVector *b_in, - hypre_SStructVector *x_in) -{ - hypre_MaxwellData *maxwell_TV_data = (hypre_MaxwellData *)maxwell_vdata; - - MPI_Comm comm = hypre_SStructMatrixComm(Aee_in); - - hypre_SStructGraph *graph = hypre_SStructMatrixGraph(Aee_in); - hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); - hypre_Index *rfactor_in = (maxwell_TV_data-> rfactor); - hypre_ParCSRMatrix *T = (maxwell_TV_data-> Tgrad); - - hypre_SStructMatrix *Ann; - HYPRE_IJMatrix Aen; - hypre_SStructVector *bn; - hypre_SStructVector *xn; - - hypre_ParCSRMatrix *Aee = hypre_SStructMatrixParCSRMatrix(Aee_in); - hypre_ParCSRMatrix *T_transpose; - hypre_ParCSRMatrix *transpose; - hypre_ParCSRMatrix *parcsr_mat; - HYPRE_Int size, *size_ptr; - HYPRE_BigInt *col_inds; - HYPRE_Real *values; - - hypre_ParVector *parvector_x; - hypre_ParVector *parvector_b; - - hypre_ParCSRMatrix **Aen_l; - - void *amg_vdata; - hypre_ParAMGData *amg_data; - hypre_ParCSRMatrix **Ann_l; - hypre_ParCSRMatrix **Pn_l; - hypre_ParCSRMatrix **RnT_l; - hypre_ParVector **bn_l; - hypre_ParVector **xn_l; - hypre_ParVector **resn_l; - hypre_ParVector **en_l; - hypre_ParVector **nVtemp_l; - hypre_ParVector **nVtemp2_l; - HYPRE_Int **nCF_marker_l; - HYPRE_Real *nrelax_weight; - HYPRE_Real *nomega; - HYPRE_Int nrelax_type; - HYPRE_Int node_numlevels; - - hypre_ParCSRMatrix **Aee_l; - hypre_IJMatrix **Pe_l; - hypre_IJMatrix **ReT_l; - hypre_ParVector **be_l; - hypre_ParVector **xe_l; - hypre_ParVector **rese_l; - hypre_ParVector **ee_l; - hypre_ParVector **eVtemp_l; - hypre_ParVector **eVtemp2_l; - HYPRE_Real *erelax_weight; - HYPRE_Real *eomega; - HYPRE_Int **eCF_marker_l; - HYPRE_Int erelax_type; - -#if 0 - /* objects needed to fine the edge relaxation parameters */ - HYPRE_Int relax_type; - HYPRE_Int *relax_types; - void *e_amg_vdata; - hypre_ParAMGData *e_amgData; - HYPRE_Int numCGSweeps = 10; - HYPRE_Int **amg_CF_marker; - hypre_ParCSRMatrix **A_array; -#endif - - hypre_SStructGrid *node_grid; - hypre_SStructGraph *node_graph; - - HYPRE_Int *coarsen; - hypre_SStructGrid **egrid_l; - hypre_SStructGrid *edge_grid, *face_grid, *cell_grid; - hypre_SStructGrid **topological_edge, **topological_face = NULL, **topological_cell; - - HYPRE_Int **BdryRanks_l; - HYPRE_Int *BdryRanksCnts_l; - - hypre_SStructPGrid *pgrid; - hypre_StructGrid *sgrid; - - hypre_BoxArray *boxes, *tmp_box_array; - hypre_Box *box, *box_piece, *contract_box; - hypre_BoxArray *cboxes; - - HYPRE_SStructVariable *vartypes, *vartype_edges, *vartype_faces = NULL, *vartype_cell; - hypre_SStructStencil **Ann_stencils; - - hypre_MaxwellOffProcRow **OffProcRows; - HYPRE_Int num_OffProcRows; - - hypre_Index rfactor; - hypre_Index index, cindex, shape, loop_size, start, lindex; - HYPRE_Int stencil_size; - HYPRE_Int matrix_type = HYPRE_PARCSR; - - HYPRE_Int ndim = hypre_SStructMatrixNDim(Aee_in); - HYPRE_Int nparts, part, vars, nboxes, lev_nboxes; - - HYPRE_Int nrows; - HYPRE_BigInt rank, start_rank, *jnode, *inode; - HYPRE_Int *flag, *ncols; - HYPRE_BigInt *flag2; - HYPRE_Real *vals; - - HYPRE_Int i, j, k, l, m; - HYPRE_BigInt big_i, *big_i_ptr; - - hypre_BoxManager *node_boxman; - hypre_BoxManEntry *entry; - HYPRE_Int kstart = 0, kend = 0; - HYPRE_BigInt ilower, iupper; - HYPRE_BigInt jlower, jupper; - HYPRE_Int myproc; - - HYPRE_BigInt first_local_row, last_local_row; - HYPRE_BigInt first_local_col, last_local_col; - - HYPRE_Int edge_maxlevels, edge_numlevels, en_numlevels; - - HYPRE_Int constant_coef = maxwell_TV_data -> constant_coef; - HYPRE_Int trueV = 1; - 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; - - /* Adjust rfactor so that the correct dimension is used */ - for (i = ndim; i < 3; i++) - { - rfactor_in[0][i] = 1; - } - hypre_CopyIndex(rfactor_in[0], rfactor); - hypre_SetIndex(lindex, 0); - - /*--------------------------------------------------------------------- - * Set up matrices Ann, Aen. - * - * Forming the finest node matrix: We are assuming the Aee_in is in the - * parcsr data structure, the stencil structure for the node is the - * 9 or 27 point fem pattern, etc. - * - * Need to form the grid, graph, etc. for these matrices. - *---------------------------------------------------------------------*/ - 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; - - for (i = 0; i < nparts; i++) - { - pgrid = hypre_SStructPMatrixPGrid(hypre_SStructMatrixPMatrix(Aee_in, i)); - sgrid = hypre_SStructPGridCellSGrid(pgrid); - - boxes = hypre_StructGridBoxes(sgrid); - hypre_ForBoxI(j, boxes) - { - box = hypre_BoxArrayBox(boxes, j); - HYPRE_SStructGridSetExtents(node_grid, i, - hypre_BoxIMin(box), hypre_BoxIMax(box)); - } - - HYPRE_SStructGridSetVariables(node_grid, i, 1, vartypes); - } - HYPRE_SStructGridAssemble(node_grid); - - /* Ann stencils & graph */ - stencil_size = 1; - for (i = 0; i < ndim; i++) - { - stencil_size *= 3; - } - - 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 */ - if (ndim > 2) - { - kstart = -1; - kend = 2; - } - else if (ndim == 2) - { - kstart = 0; - kend = 1; - } - - m = 0; - for (k = kstart; k < kend; k++) - { - for (j = -1; j < 2; j++) - { - for (i = -1; i < 2; i++) - { - hypre_SetIndex3(shape, i, j, k); - HYPRE_SStructStencilSetEntry(Ann_stencils[0], m, shape, vars); - m++; - } - } - } - - HYPRE_SStructGraphCreate(comm, node_grid, &node_graph); - for (part = 0; part < nparts; part++) - { - HYPRE_SStructGraphSetStencil(node_graph, part, 0, Ann_stencils[0]); - } - HYPRE_SStructGraphAssemble(node_graph); - - HYPRE_SStructMatrixCreate(comm, node_graph, &Ann); - HYPRE_SStructMatrixSetObjectType(Ann, HYPRE_PARCSR); - HYPRE_SStructMatrixInitialize(Ann); - - /* Aen is constructed as an IJ matrix. Constructing it as a sstruct_matrix - * would make it a square matrix. */ - 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); - 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); - /* grab the first edge variable type */ - 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); - - hypre_SStructGridBoxProcFindBoxManEntry(node_grid, part, 0, - hypre_BoxArraySize(boxes) - 1, - myproc, &entry); - hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMax(box), &jupper); - - 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); - hypre_TFree(vartypes, HYPRE_MEMORY_HOST); - - hypre_SStructGridBoxProcFindBoxManEntry(grid, part, vars - 1, - hypre_BoxArraySize(boxes) - 1, - myproc, &entry); - hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMax(box), &iupper); - - HYPRE_IJMatrixCreate(comm, ilower, iupper, jlower, jupper, &Aen); - HYPRE_IJMatrixSetObjectType(Aen, HYPRE_PARCSR); - HYPRE_IJMatrixInitialize(Aen); - - /* 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); - 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, 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++) - { - HYPRE_ParCSRMatrixGetRow((HYPRE_ParCSRMatrix) parcsr_mat, - big_i, &size, &col_inds, &values); - - size_ptr[0] = size; - big_i_ptr[0] = big_i; - - //RL: this is very slow when using on device - HYPRE_IJMatrixSetValues(Aen, 1, size_ptr, big_i_ptr, (const HYPRE_BigInt *) col_inds, - (const HYPRE_Real *) values); - - HYPRE_ParCSRMatrixRestoreRow((HYPRE_ParCSRMatrix) parcsr_mat, - big_i, &size, &col_inds, &values); - } - hypre_ParCSRMatrixDestroy(parcsr_mat); - HYPRE_IJMatrixAssemble(Aen); - - /* 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)); - 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++) - { - HYPRE_ParCSRMatrixGetRow((HYPRE_ParCSRMatrix) parcsr_mat, - big_i, &size, &col_inds, &values); - - size_ptr[0] = size; - big_i_ptr[0] = big_i; - - //RL: this is very slow when using on device - HYPRE_IJMatrixSetValues(hypre_SStructMatrixIJMatrix(Ann), - 1, size_ptr, big_i_ptr, (const HYPRE_BigInt *) col_inds, - (const HYPRE_Real *) values); - - HYPRE_ParCSRMatrixRestoreRow((HYPRE_ParCSRMatrix) parcsr_mat, - big_i, &size, &col_inds, &values); - } - hypre_ParCSRMatrixDestroy(parcsr_mat); - - 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++) - { - pgrid = hypre_SStructGridPGrid(node_grid, part); - sgrid = hypre_SStructPGridSGrid(pgrid, 0); - 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++) - { - 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++) - { - pgrid = hypre_SStructGridPGrid(node_grid, part); - sgrid = hypre_SStructPGridSGrid(pgrid, 0); - boxes = hypre_StructGridBoxes(sgrid); - node_boxman = hypre_SStructGridBoxManager(node_grid, part, 0); - - hypre_ForBoxI(j, boxes) - { - box = hypre_BoxArrayBox(boxes, j); - hypre_BoxManGetEntry(node_boxman, myproc, j, &entry); - i = hypre_BoxVolume(box); - - 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++) - { - box_piece = hypre_BoxArrayBox(tmp_box_array, m); - if (hypre_BoxVolume(box_piece) < i) - { - hypre_BoxGetSize(box_piece, loop_size); - hypre_CopyIndex(hypre_BoxIMin(box_piece), start); - - hypre_SerialBoxLoop0Begin(ndim, loop_size); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(index, lindex[0], lindex[1], lindex[2]); - hypre_AddIndexes(index, start, 3, index); - - hypre_SStructBoxManEntryGetGlobalRank(entry, index, - &rank, matrix_type); - flag[(HYPRE_Int)(rank - start_rank)] = 0; - flag2[(HYPRE_Int)(rank - start_rank)] = rank; - } - hypre_SerialBoxLoop0End(); - } /* if (hypre_BoxVolume(box_piece) < i) */ - } /* for (m= 0; m< hypre_BoxArraySize(tmp_box_array); m++) */ - hypre_BoxArrayDestroy(tmp_box_array); - } /* hypre_ForBoxI(j, boxes) */ - } /* for (part= 0; part< nparts; part++) */ - - /* set up boundary identity */ - j = 0; - for (i = 0; i < nrows; i++) - { - if (!flag[i]) - { - j++; - } - } - - 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++) - { - if (!flag[i]) - { - ncols[j] = 1; - inode[j] = flag2[i]; - jnode[j] = flag2[i]; - vals[j] = 1.0; - j++; - } - } - hypre_TFree(flag, HYPRE_MEMORY_HOST); - hypre_TFree(flag2, HYPRE_MEMORY_HOST); - - HYPRE_IJMatrixSetValues(hypre_SStructMatrixIJMatrix(Ann), - j, ncols, (const HYPRE_BigInt*) inode, - (const HYPRE_BigInt*) jnode, (const HYPRE_Real*) vals); - 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 - HYPRE_SStructMatrixPrint("sstruct.out.Ann", Ann, 0); - HYPRE_IJMatrixPrint(Aen, "driver.out.Aen"); -#endif - - /* setup bn & xn using matvec. Assemble first and then perform matvec to get - the nodal rhs and initial guess. */ - HYPRE_SStructVectorCreate(comm, node_grid, &bn); - HYPRE_SStructVectorSetObjectType(bn, HYPRE_PARCSR); - HYPRE_SStructVectorInitialize(bn); - HYPRE_SStructVectorAssemble(bn); - - hypre_SStructVectorConvert(b_in, &parvector_x); - /*HYPRE_SStructVectorGetObject((HYPRE_SStructVector) b_in, (void **) &parvector_x);*/ - HYPRE_SStructVectorGetObject((HYPRE_SStructVector) bn, (void **) &parvector_b); - hypre_ParCSRMatrixMatvec(1.0, T_transpose, parvector_x, 0.0, parvector_b); - - HYPRE_SStructVectorCreate(comm, node_grid, &xn); - HYPRE_SStructVectorSetObjectType(xn, HYPRE_PARCSR); - HYPRE_SStructVectorInitialize(xn); - HYPRE_SStructVectorAssemble(xn); - - hypre_SStructVectorConvert(x_in, &parvector_x); - /*HYPRE_SStructVectorGetObject((HYPRE_SStructVector) x_in, (void **) &parvector_x);*/ - HYPRE_SStructVectorGetObject((HYPRE_SStructVector) xn, (void **) &parvector_b); - hypre_ParCSRMatrixMatvec(1.0, T_transpose, parvector_x, 0.0, parvector_b); - - /* Destroy the node grid and graph. This only decrements reference counters. */ - HYPRE_SStructGridDestroy(node_grid); - HYPRE_SStructGraphDestroy(node_graph); - - /* 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(); - hypre_BoomerAMGSetStrongThreshold(amg_vdata, 0.25); - hypre_BoomerAMGSetup(amg_vdata, - hypre_SStructMatrixParCSRMatrix(Ann), - hypre_SStructVectorParVector(bn), - hypre_SStructVectorParVector(xn)); - { - amg_data = (hypre_ParAMGData*) amg_vdata; - - 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); - RnT_l = hypre_CTAlloc(hypre_ParCSRMatrix *, node_numlevels, HYPRE_MEMORY_HOST); - bn_l = hypre_CTAlloc(hypre_ParVector*, node_numlevels, HYPRE_MEMORY_HOST); - 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); - - /* 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_type = 6; /* fast parallel hybrid */ - - for (i = 0; i < node_numlevels; 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]; - - 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])); - 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])); - 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]), - hypre_ParCSRMatrixGlobalNumRows(Ann_l[i]), - hypre_ParCSRMatrixRowStarts(Ann_l[i])); - hypre_ParVectorInitialize(nVtemp2_l[i]); - - if (hypre_ParAMGDataCFMarkerArray(amg_data)[i]) - { - nCF_marker_l[i] = hypre_IntArrayData(hypre_ParAMGDataCFMarkerArray(amg_data)[i]); - } - else - { - nCF_marker_l[i] = NULL; - } - nrelax_weight[i] = hypre_ParAMGDataRelaxWeight(amg_data)[i]; - nomega[i] = hypre_ParAMGDataOmega(amg_data)[i]; - } - } - (maxwell_TV_data -> Ann_stencils) = Ann_stencils; - (maxwell_TV_data -> T_transpose) = T_transpose; - (maxwell_TV_data -> Ann) = Ann; - (maxwell_TV_data -> Aen) = Aen; - (maxwell_TV_data -> bn) = bn; - (maxwell_TV_data -> xn) = xn; - - (maxwell_TV_data -> amg_vdata) = amg_vdata; - (maxwell_TV_data -> Ann_l) = Ann_l; - (maxwell_TV_data -> Pn_l) = Pn_l; - (maxwell_TV_data -> RnT_l) = RnT_l; - (maxwell_TV_data -> bn_l) = bn_l; - (maxwell_TV_data -> xn_l) = xn_l; - (maxwell_TV_data -> resn_l) = resn_l; - (maxwell_TV_data -> en_l) = en_l; - (maxwell_TV_data -> nVtemp_l) = nVtemp_l; - (maxwell_TV_data -> nVtemp2_l) = nVtemp2_l; - (maxwell_TV_data -> nCF_marker_l) = nCF_marker_l; - (maxwell_TV_data -> nrelax_weight) = nrelax_weight; - (maxwell_TV_data -> nomega) = nomega; - (maxwell_TV_data -> nrelax_type) = nrelax_type; - (maxwell_TV_data -> node_numlevels) = node_numlevels; - - /* coarsen the edge matrix. Will coarsen uniformly since we have no - * 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++) - { - pgrid = hypre_SStructGridPGrid(grid, part); - sgrid = hypre_SStructPGridCellSGrid(pgrid); - - 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_BoxDestroy(box); - /* the following allows some of the parts to have volume zero grids */ - 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)); - } - - (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. */ - egrid_l = hypre_TAlloc(hypre_SStructGrid *, edge_maxlevels, HYPRE_MEMORY_HOST); - hypre_SStructGridRef(grid, &egrid_l[0]); - - /* form the topological grids for the topological matrices. */ - - /* Assuming same variable ordering on all parts */ - pgrid = hypre_SStructGridPGrid(grid, 0); - - HYPRE_SStructGridCreate(comm, ndim, nparts, &edge_grid); - 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_edges[2] = hypre_SStructPGridVarType(pgrid, i); - j = vartype_edges[2]; - - switch (j) - { - case 5: - { - 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; - break; - } - case 7: - { - vartype_edges[i] = HYPRE_SSTRUCT_VARIABLE_ZEDGE; - vartype_faces[i] = HYPRE_SSTRUCT_VARIABLE_ZFACE; - break; - } - - } /* switch(j) */ - } /* for (i= 0; i< 3; i++) */ - } - else - { - for (i = 0; i < 2; i++) - { - vartype_edges[1] = hypre_SStructPGridVarType(pgrid, i); - j = vartype_edges[1]; - - switch (j) - { - case 2: - { - vartype_edges[i] = HYPRE_SSTRUCT_VARIABLE_XFACE; - break; - } - case 3: - { - vartype_edges[i] = HYPRE_SSTRUCT_VARIABLE_YFACE; - break; - } - } /* switch(j) */ - } /* for (i= 0; i< 3; i++) */ - } - - HYPRE_SStructGridCreate(comm, ndim, nparts, &cell_grid); - vartype_cell = hypre_CTAlloc(HYPRE_SStructVariable, 1, HYPRE_MEMORY_HOST); - vartype_cell[0] = HYPRE_SSTRUCT_VARIABLE_CELL; - - for (i = 0; i < nparts; i++) - { - pgrid = hypre_SStructPMatrixPGrid(hypre_SStructMatrixPMatrix(Aee_in, i)); - sgrid = hypre_SStructPGridCellSGrid(pgrid); - - boxes = hypre_StructGridBoxes(sgrid); - hypre_ForBoxI(j, boxes) - { - box = hypre_BoxArrayBox(boxes, j); - HYPRE_SStructGridSetExtents(edge_grid, i, - hypre_BoxIMin(box), hypre_BoxIMax(box)); - HYPRE_SStructGridSetExtents(cell_grid, i, - hypre_BoxIMin(box), hypre_BoxIMax(box)); - if (ndim > 2) - { - HYPRE_SStructGridSetExtents(face_grid, i, - hypre_BoxIMin(box), hypre_BoxIMax(box)); - } - } - HYPRE_SStructGridSetVariables(edge_grid, i, ndim, vartype_edges); - HYPRE_SStructGridSetVariables(cell_grid, i, 1, vartype_cell); - - if (ndim > 2) - { - HYPRE_SStructGridSetVariables(face_grid, i, ndim, vartype_faces); - } - } - - HYPRE_SStructGridAssemble(edge_grid); - topological_edge = hypre_TAlloc(hypre_SStructGrid *, edge_maxlevels, HYPRE_MEMORY_HOST); - 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; - - if (ndim > 2) - { - HYPRE_SStructGridAssemble(face_grid); - topological_face = hypre_TAlloc(hypre_SStructGrid *, edge_maxlevels, HYPRE_MEMORY_HOST); - topological_face[0] = face_grid; - } - - /*-------------------------------------------------------------------------- - * to determine when to stop coarsening, we check the cell bounding boxes - * of the level egrid. After each coarsening, the bounding boxes are - * 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; - - 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]); - if (ndim > 2) - { - HYPRE_SStructGridCreate(comm, ndim, nparts, &topological_face[l + 1]); - } - - /* coarsen the non-zero bounding boxes only if we have some. */ - nboxes = 0; - if (j < nparts) - { - for (part = 0; part < nparts; part++) - { - 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++) - { - if ( hypre_BoxIMaxD(box, i) < hypre_BoxIMinD(box, i) ) - { - m = falseV; - break; - } - } - - if (m) - { - /* 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 - is attained. Project does not automatically perform this. - E.g., consider a grid with only one box whose width - does not divide by rfactor, but it contains beginning and - ending indices that are divisible by rfactor. Then an extra - coarse grid layer is given by project. */ - - contract_box = hypre_BoxContraction(box, sgrid, rfactor); - hypre_CopyBox(contract_box, box); - hypre_BoxDestroy(contract_box); - - hypre_ProjectBox(box, cindex, rfactor); - hypre_StructMapFineToCoarse(hypre_BoxIMin(box), cindex, - rfactor, hypre_BoxIMin(box)); - hypre_StructMapFineToCoarse(hypre_BoxIMax(box), cindex, - rfactor, hypre_BoxIMax(box)); - - /* 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; - hypre_CoarsenPGrid(egrid_l[l], cindex, rfactor, part, - egrid_l[l + 1], &k); - - /* build the topological grids */ - hypre_CoarsenPGrid(topological_edge[l], cindex, rfactor, part, - topological_edge[l + 1], &i); - hypre_CoarsenPGrid(topological_cell[l], cindex, rfactor, part, - topological_cell[l + 1], &i); - if (ndim > 2) - { - hypre_CoarsenPGrid(topological_face[l], cindex, rfactor, - part, topological_face[l + 1], &i); - } - nboxes += k; - } - else - { - /* record empty, coarsened-away part */ - coarsen[part] = falseV; - /* set up a dummy box so this grid can be destroyed */ - HYPRE_SStructGridSetExtents(egrid_l[l + 1], part, - hypre_BoxIMin(box), hypre_BoxIMin(box)); - - HYPRE_SStructGridSetExtents(topological_edge[l + 1], part, - hypre_BoxIMin(box), hypre_BoxIMin(box)); - - HYPRE_SStructGridSetExtents(topological_cell[l + 1], part, - hypre_BoxIMin(box), hypre_BoxIMin(box)); - - if (ndim > 2) - { - HYPRE_SStructGridSetExtents(topological_face[l + 1], part, - hypre_BoxIMin(box), hypre_BoxIMin(box)); - } - j++; - } - - } /* if (coarsen[part]) */ - - 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, - vartype_edges); - HYPRE_SStructGridSetVariables(topological_cell[l + 1], part, 1, - vartype_cell); - if (ndim > 2) - { - 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]); - if (ndim > 2) - { - HYPRE_SStructGridAssemble(topological_face[l + 1]); - } - - lev_nboxes = 0; - hypre_MPI_Allreduce(&nboxes, &lev_nboxes, 1, HYPRE_MPI_INT, hypre_MPI_SUM, - hypre_SStructGridComm(egrid_l[l + 1])); - - if (lev_nboxes) /* there were coarsen boxes */ - { - edge_numlevels++; - } - - else - { - /* no coarse boxes. Trigger coarsening completed and destroy the - cgrids corresponding to this level. */ - j = nparts; - } - - /* extract the cell bounding boxes */ - if (j < nparts) - { - for (part = 0; part < nparts; part++) - { - if (coarsen[part]) - { - 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)); - hypre_BoxDestroy(box); - } - } - } - - else - { - 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]); - } - break; - } - } - (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; - - hypre_BoxArrayDestroy(cboxes); - hypre_TFree(coarsen, HYPRE_MEMORY_HOST); - /* okay to de-allocate vartypes now */ - hypre_TFree(vartype_edges, HYPRE_MEMORY_HOST); - hypre_TFree(vartype_cell, HYPRE_MEMORY_HOST); - if (ndim > 2) - { - hypre_TFree(vartype_faces, HYPRE_MEMORY_HOST); - } - - - /* Aen matrices are defined for 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; - - 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); - - 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); - - 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] = - 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] = - 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] = - 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] = - hypre_ParVectorCreate(hypre_ParCSRMatrixComm(Aee_l[0]), - hypre_ParCSRMatrixGlobalNumRows(Aee_l[0]), - hypre_ParCSRMatrixRowStarts(Aee_l[0])); - hypre_ParVectorInitialize(eVtemp2_l[0]); - - for (l = 0; l < (en_numlevels - 1); l++) - { - if (l < edge_numlevels) /* create edge operators */ - { - if (!constant_coef) - { - void *PTopology_vdata; - hypre_PTopology *PTopology; - - 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); - } - 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); - } - - PTopology = (hypre_PTopology*)PTopology_vdata; - - /* extract off-processors rows of Pe_l[l]. Needed for amge.*/ - hypre_SStructSharedDOF_ParcsrMatRowsComm(egrid_l[l], - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(Pe_l[l]), - &num_OffProcRows, - &OffProcRows); - - if (ndim == 3) - { - hypre_ND1AMGeInterpolation(Aee_l[l], - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(PTopology -> Element_iedge), - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(PTopology -> Face_iedge), - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(PTopology -> Edge_iedge), - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(PTopology -> Element_Face), - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(PTopology -> Element_Edge), - num_OffProcRows, - OffProcRows, - Pe_l[l]); - } - else - { - hypre_ND1AMGeInterpolation(Aee_l[l], - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(PTopology -> Element_iedge), - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(PTopology -> Edge_iedge), - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(PTopology -> Edge_iedge), - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(PTopology -> Element_Edge), - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(PTopology -> Element_Edge), - num_OffProcRows, - OffProcRows, - Pe_l[l]); - } - - hypre_DestroyPTopology(PTopology_vdata); - - for (i = 0; i < num_OffProcRows; i++) - { - hypre_MaxwellOffProcRowDestroy((void *) OffProcRows[i]); - } - hypre_TFree(OffProcRows, HYPRE_MEMORY_HOST); - } - - else - { - Pe_l[l] = hypre_Maxwell_PNedelec(topological_edge[l], - topological_edge[l + 1], - rfactor); - } -#if DEBUG -#endif - - - 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]); - - /* zero off boundary points */ - 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]); - 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]); - - } /* 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++) - { - if (!constant_coef) - { - void *PTopology_vdata; - hypre_PTopology *PTopology; - - 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); - } - 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); - } - - PTopology = (hypre_PTopology*)PTopology_vdata; - - /* extract off-processors rows of Pe_l[l]. Needed for amge.*/ - hypre_SStructSharedDOF_ParcsrMatRowsComm(egrid_l[l], - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(Pe_l[l]), - &num_OffProcRows, - &OffProcRows); - if (ndim == 3) - { - hypre_ND1AMGeInterpolation(Aee_l[l], - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(PTopology -> Element_iedge), - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(PTopology -> Face_iedge), - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(PTopology -> Edge_iedge), - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(PTopology -> Element_Face), - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(PTopology -> Element_Edge), - num_OffProcRows, - OffProcRows, - Pe_l[l]); - } - else - { - hypre_ND1AMGeInterpolation(Aee_l[l], - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(PTopology -> Element_iedge), - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(PTopology -> Edge_iedge), - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(PTopology -> Edge_iedge), - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(PTopology -> Element_Edge), - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(PTopology -> Element_Edge), - num_OffProcRows, - OffProcRows, - Pe_l[l]); - } - - hypre_DestroyPTopology(PTopology_vdata); - for (i = 0; i < num_OffProcRows; i++) - { - hypre_MaxwellOffProcRowDestroy((void *) OffProcRows[i]); - } - hypre_TFree(OffProcRows, HYPRE_MEMORY_HOST); - } - - else - { - Pe_l[l] = hypre_Maxwell_PNedelec(topological_edge[l], - topological_edge[l + 1], - rfactor); - } - - 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]); - - /* 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]); - } - - /* Can delete all topological grids. Not even referenced in IJMatrices. */ - for (l = 0; l < edge_numlevels; l++) - { - HYPRE_SStructGridDestroy(topological_edge[l]); - HYPRE_SStructGridDestroy(topological_cell[l]); - if (ndim > 2) - { - HYPRE_SStructGridDestroy(topological_face[l]); - } - } - hypre_TFree(topological_edge, HYPRE_MEMORY_HOST); - hypre_TFree(topological_cell, HYPRE_MEMORY_HOST); - if (ndim > 2) - { - hypre_TFree(topological_face, HYPRE_MEMORY_HOST); - } - -#if DEBUG -#endif - - (maxwell_TV_data -> Aee_l) = Aee_l; - (maxwell_TV_data -> Aen_l) = Aen_l; - (maxwell_TV_data -> Pe_l) = Pe_l; - (maxwell_TV_data -> ReT_l) = ReT_l; - (maxwell_TV_data -> xe_l) = xe_l; - (maxwell_TV_data -> be_l) = be_l; - (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; - - /*----------------------------------------------------- - * 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); - 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++) - { - erelax_weight[l] = 1.0; - eCF_marker_l[l] = NULL; - - 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; - - 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; - A_array[0] = Aee_l[l]; - - (e_amgData -> CF_marker_array) = amg_CF_marker; - (e_amgData -> A_array) = A_array; - (e_amgData -> Vtemp ) = eVtemp_l[l]; - (e_amgData -> grid_relax_type) = relax_types; - (e_amgData -> smooth_num_levels) = 0; - (e_amgData -> smooth_type) = 0; - hypre_BoomerAMGCGRelaxWt((void *) e_amgData, 0, numCGSweeps, &eomega[l]); - - 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 -> Vtemp ) = 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; - } -#endif - - for (l = 0; l < edge_numlevels; l++) - { - 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 -> eomega) = eomega; - (maxwell_TV_data -> eCF_marker_l) = eCF_marker_l; - - - /*----------------------------------------------------- - * Allocate space for log info - *-----------------------------------------------------*/ - - if ((maxwell_TV_data -> logging) > 0) - { - 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); - } - - return ierr; -} - -HYPRE_Int -hypre_CoarsenPGrid( hypre_SStructGrid *fgrid, - hypre_Index index, - hypre_Index stride, - HYPRE_Int part, - hypre_SStructGrid *cgrid, - HYPRE_Int *nboxes) -{ - HYPRE_Int ierr = 0; - - hypre_SStructPGrid *pgrid = hypre_SStructGridPGrid(fgrid, part); - hypre_StructGrid *sgrid = hypre_SStructPGridCellSGrid(pgrid); - - hypre_BoxArray *boxes; - hypre_Box *box, *contract_box; - HYPRE_Int i; - - /*----------------------------------------- - * Set the coarse sgrid - *-----------------------------------------*/ - boxes = hypre_BoxArrayDuplicate(hypre_StructGridBoxes(sgrid)); - for (i = 0; i < hypre_BoxArraySize(boxes); i++) - { - box = hypre_BoxArrayBox(boxes, i); - - /* contract box so that divisible by stride */ - contract_box = hypre_BoxContraction(box, sgrid, stride); - hypre_ProjectBox(contract_box, index, stride); - - hypre_StructMapFineToCoarse(hypre_BoxIMin(contract_box), index, stride, - hypre_BoxIMin(contract_box)); - hypre_StructMapFineToCoarse(hypre_BoxIMax(contract_box), index, stride, - hypre_BoxIMax(contract_box)); - - /* set box even if zero volume but don't count it */ - HYPRE_SStructGridSetExtents(cgrid, part, - hypre_BoxIMin(contract_box), - hypre_BoxIMax(contract_box)); - - if ( hypre_BoxVolume(contract_box) ) - { - *nboxes = *nboxes + 1; - } - hypre_BoxDestroy(contract_box); - } - hypre_BoxArrayDestroy(boxes); - - return ierr; -} - - - -/*-------------------------------------------------------------------------- - * Contracts a box so that the resulting box divides evenly into rfactor. - * Contraction is done in the (+) or (-) direction that does not have - * neighbor boxes, or if both directions have neighbor boxes, the (-) side - * is contracted. - * Modified to use box manager AHB 11/06 - *--------------------------------------------------------------------------*/ - -hypre_Box * -hypre_BoxContraction( hypre_Box *box, - hypre_StructGrid *sgrid, - hypre_Index rfactor ) -{ - - hypre_BoxManager *boxman = hypre_StructGridBoxMan(sgrid); - - 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_Index remainder, box_width; - HYPRE_Int i, j, k, p; - HYPRE_Int npos, nneg; - - - /* get the boxes out of the box manager - use these as the neighbor boxes */ - neighbor_boxes = hypre_BoxArrayCreate(0, ndim); - hypre_BoxManGetAllEntriesBoxes( boxman, neighbor_boxes); - - hypre_BoxInit(&intersect_box, ndim); - - contracted_box = hypre_BoxCreate(ndim); - - hypre_ClearIndex(remainder); - 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]; - - if (k) - { - remainder[i] = k; - p++; - } - } - - hypre_CopyBox(box, contracted_box); - if (p) - { - 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]; - - npos = 0; - hypre_ForBoxI(k, neighbor_boxes) - { - nbox = hypre_BoxArrayBox(neighbor_boxes, k); - hypre_IntersectBoxes(shifted_box, nbox, &intersect_box); - if (hypre_BoxVolume(&intersect_box)) - { - npos++; - } - } - - hypre_CopyBox(box, shifted_box); - hypre_BoxIMax(shifted_box)[i] -= box_width[i]; - hypre_BoxIMin(shifted_box)[i] -= box_width[i]; - - nneg = 0; - hypre_ForBoxI(k, neighbor_boxes) - { - nbox = hypre_BoxArrayBox(neighbor_boxes, k); - hypre_IntersectBoxes(shifted_box, nbox, &intersect_box); - if (hypre_BoxVolume(&intersect_box)) - { - nneg++; - } - } - - if ( (npos) || ( (!npos) && (!nneg) ) ) - { - /* contract - direction */ - hypre_BoxIMin(contracted_box)[i] += remainder[i]; - } - else - { - if (nneg) - { - /* contract + direction */ - hypre_BoxIMax(contracted_box)[i] -= remainder[i]; - } - } - - } /* if (remainder[i]) */ - } /* for (i= 0; i< ndim; i++) */ - - hypre_BoxDestroy(shifted_box); - } /* if (p) */ - - hypre_BoxArrayDestroy(neighbor_boxes); - - return contracted_box; -} diff --git a/src/sstruct_ls/maxwell_grad.c b/src/sstruct_ls/maxwell_grad.c deleted file mode 100644 index da651a6543..0000000000 --- a/src/sstruct_ls/maxwell_grad.c +++ /dev/null @@ -1,750 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other - * HYPRE Project Developers. See the top-level COPYRIGHT file for details. - * - * SPDX-License-Identifier: (Apache-2.0 OR MIT) - ******************************************************************************/ - -/****************************************************************************** - * OpenMP Problems - * - * Need to fix the way these variables are set and incremented in loops: - * i, nrows (only where they are listed at the end of SMP_PRIVATE) - * - * Are private static arrays a problem? - * - ******************************************************************************/ - -#include "_hypre_sstruct_ls.h" - -/*-------------------------------------------------------------------------- - * hypre_Maxwell_Grad.c - * Forms a node-to-edge gradient operator. Looping over the - * edge grid so that each processor fills up only its own rows. Each - * processor will have its processor interface nodal ranks. - * Loops over two types of boxes, interior of grid boxes and boundary - * of boxes. Algo: - * find all nodal and edge physical boundary points and set - * the appropriate flag to be 0 at a boundary dof. - * set -1's in value array - * for each edge box, - * for interior - * { - * connect edge ijk (row) to nodes (col) connected to this edge - * and change -1 to 1 if needed; - * } - * for boundary layers - * { - * if edge not on the physical boundary connect only the nodes - * that are not on the physical boundary - * } - * set parcsr matrix with values; - * - * Note that the nodes that are on the processor interface can be - * on the physical boundary. But the off-proc edges connected to this - * type of node will be a physical boundary edge. - * - *--------------------------------------------------------------------------*/ -hypre_ParCSRMatrix * -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_SStructGrid *node_grid, *edge_grid; - - hypre_SStructPGrid *pgrid; - hypre_StructGrid *var_grid; - hypre_BoxArray *boxes, *tmp_box_array1, *tmp_box_array2; - hypre_BoxArray *edge_boxes, *cell_boxes; - hypre_Box *box, *cell_box; - hypre_Box layer, interior_box; - hypre_Box *box_piece; - - hypre_BoxManager *boxman; - hypre_BoxManEntry *entry; - - HYPRE_BigInt *inode, *jedge; - HYPRE_Int nrows, nnodes, *nflag, *eflag, *ncols; - HYPRE_Real *vals; - - hypre_Index index; - hypre_Index loop_size, start, lindex; - hypre_Index shift, shift2; - hypre_Index *offsets, *varoffsets; - - HYPRE_Int nparts = hypre_SStructGridNParts(grid); - HYPRE_Int ndim = hypre_SStructGridNDim(grid); - - HYPRE_SStructVariable vartype_node, *vartype_edges; - HYPRE_SStructVariable *vartypes; - - HYPRE_Int nvars, part; - - HYPRE_BigInt m; - HYPRE_Int i, j, k, n, d; - HYPRE_Int *direction, ndirection; - - HYPRE_BigInt ilower, iupper; - HYPRE_BigInt jlower, jupper; - - HYPRE_BigInt start_rank1, start_rank2, rank; - HYPRE_Int myproc; - - HYPRE_MemoryLocation memory_location; - - hypre_BoxInit(&layer, ndim); - hypre_BoxInit(&interior_box, ndim); - - hypre_MPI_Comm_rank(comm, &myproc); - - hypre_ClearIndex(shift); - 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.*/ - HYPRE_SStructGridCreate(comm, ndim, nparts, &node_grid); - HYPRE_SStructGridCreate(comm, ndim, nparts, &edge_grid); - - vartype_node = HYPRE_SSTRUCT_VARIABLE_NODE; - 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); - nvars = hypre_SStructPGridNVars(pgrid); - - k = 0; - for (i = 0; i < nvars; i++) - { - j = vartypes[i]; - switch (j) - { - case 2: - { - vartype_edges[k] = HYPRE_SSTRUCT_VARIABLE_XFACE; - k++; - break; - } - - case 3: - { - vartype_edges[k] = HYPRE_SSTRUCT_VARIABLE_YFACE; - k++; - break; - } - - case 5: - { - vartype_edges[k] = HYPRE_SSTRUCT_VARIABLE_XEDGE; - k++; - break; - } - - case 6: - { - vartype_edges[k] = HYPRE_SSTRUCT_VARIABLE_YEDGE; - k++; - break; - } - - case 7: - { - vartype_edges[k] = HYPRE_SSTRUCT_VARIABLE_ZEDGE; - k++; - break; - } - - } /* switch(j) */ - } /* for (i= 0; i< nvars; i++) */ - - for (part = 0; part < nparts; part++) - { - pgrid = hypre_SStructGridPGrid(grid, part); - var_grid = hypre_SStructPGridCellSGrid(pgrid) ; - - boxes = hypre_StructGridBoxes(var_grid); - hypre_ForBoxI(j, boxes) - { - box = hypre_BoxArrayBox(boxes, j); - HYPRE_SStructGridSetExtents(node_grid, part, - hypre_BoxIMin(box), hypre_BoxIMax(box)); - HYPRE_SStructGridSetExtents(edge_grid, part, - hypre_BoxIMin(box), hypre_BoxIMax(box)); - } - HYPRE_SStructGridSetVariables(node_grid, part, 1, &vartype_node); - HYPRE_SStructGridSetVariables(edge_grid, part, ndim, vartype_edges); - } - HYPRE_SStructGridAssemble(node_grid); - HYPRE_SStructGridAssemble(edge_grid); - - /* CREATE IJ_MATRICES- need to find the size of each one. Notice that the row - and col ranks of these matrices can be created using only grid information. - Grab the first part, first variable, first box, and lower index (lower rank); - Grab the last part, last variable, last box, and upper index (upper rank). */ - - /* Grad: node(col) -> edge(row). Same for 2-d and 3-d */ - /* lower rank */ - 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); - 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); - boxes = hypre_StructGridBoxes(var_grid); - box = hypre_BoxArrayBox(boxes, 0); - hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMin(box), &jlower); - - /* upper rank */ - part = nparts - 1; - - pgrid = hypre_SStructGridPGrid(edge_grid, part); - nvars = hypre_SStructPGridNVars(pgrid); - var_grid = hypre_SStructPGridSGrid(pgrid, nvars - 1); - boxes = hypre_StructGridBoxes(var_grid); - box = hypre_BoxArrayBox(boxes, hypre_BoxArraySize(boxes) - 1); - - 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); - boxes = hypre_StructGridBoxes(var_grid); - box = hypre_BoxArrayBox(boxes, hypre_BoxArraySize(boxes) - 1); - - hypre_SStructGridBoxProcFindBoxManEntry(node_grid, part, nvars - 1, - hypre_BoxArraySize(boxes) - 1, myproc, - &entry); - hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMax(box), &jupper); - - HYPRE_IJMatrixCreate(comm, ilower, iupper, jlower, jupper, &T_grad); - 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++) - { - pgrid = hypre_SStructGridPGrid(edge_grid, part); - nvars = hypre_SStructPGridNVars(pgrid); - for (m = 0; m < nvars; m++) - { - var_grid = hypre_SStructPGridSGrid(pgrid, m); - boxes = hypre_StructGridBoxes(var_grid); - hypre_ForBoxI(j, boxes) - { - 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); - } - } - - 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); - /* 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); - } - } - - eflag = hypre_CTAlloc(HYPRE_Int, nrows, HYPRE_MEMORY_HOST); - nflag = hypre_CTAlloc(HYPRE_Int, nnodes, HYPRE_MEMORY_HOST); - - /* 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++) - { - eflag[i] = 2; - } - j = 2 * ndim; - for (i = 0; i < nnodes; i++) - { - 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++) - { - /* node flag */ - pgrid = hypre_SStructGridPGrid(node_grid, part); - 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); - hypre_BoxManGetEntry(boxman, myproc, j, &entry); - i = hypre_BoxVolume(box); - - 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++) - { - box_piece = hypre_BoxArrayBox(tmp_box_array1, m); - if (hypre_BoxVolume(box_piece) < i) - { - hypre_BoxGetSize(box_piece, loop_size); - hypre_CopyIndex(hypre_BoxIMin(box_piece), start); - - hypre_SerialBoxLoop0Begin(ndim, loop_size); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(index, lindex[0], lindex[1], lindex[2]); - hypre_AddIndexes(index, start, 3, index); - - hypre_SStructBoxManEntryGetGlobalRank(entry, index, - &rank, matrix_type); - nflag[rank - start_rank1] = 0; - } - hypre_SerialBoxLoop0End(); - } /* if (hypre_BoxVolume(box_piece) < i) */ - - } /* for (m= 0; m< hypre_BoxArraySize(tmp_box_array1); m++) */ - hypre_BoxArrayDestroy(tmp_box_array1); - - } /* hypre_ForBoxI(j, boxes) */ - - /*----------------------------------------------------------------- - * edge flag. Since we want only the edges that completely lie - * on a boundary, whereas the boundary extraction routines mark - * edges that touch the boundary, we need to call the boundary - * routines in appropriate directions: - * 2-d horizontal edges (y faces)- search in j directions - * 2-d vertical edges (x faces) - search in i directions - * 3-d x edges - search in j,k directions - * 3-d y edges - search in i,k directions - * 3-d z edges - search in i,j directions - *-----------------------------------------------------------------*/ - 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++) - { - var_grid = hypre_SStructPGridSGrid(pgrid, m); - boxes = hypre_StructGridBoxes(var_grid); - boxman = hypre_SStructGridBoxManager(edge_grid, part, m); - - j = vartype_edges[m]; - switch (j) - { - case 2: /* x faces, 2d */ - { - ndirection = 1; - direction[0] = 0; - break; - } - - case 3: /* y faces, 2d */ - { - ndirection = 1; - direction[0] = 1; - break; - } - - case 5: /* x edges, 3d */ - { - ndirection = 2; - direction[0] = 1; - direction[1] = 2; - break; - } - - case 6: /* y edges, 3d */ - { - ndirection = 2; - direction[0] = 0; - direction[1] = 2; - break; - } - - case 7: /* z edges, 3d */ - { - ndirection = 2; - direction[0] = 0; - direction[1] = 1; - break; - } - - default: - { - ndirection = 0; - } - } /* switch(j) */ - - hypre_ForBoxI(j, boxes) - { - box = hypre_BoxArrayBox(boxes, j); - hypre_BoxManGetEntry(boxman, myproc, j, &entry); - i = hypre_BoxVolume(box); - - for (d = 0; d < ndirection; 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++) - { - box_piece = hypre_BoxArrayBox(tmp_box_array1, k); - if (hypre_BoxVolume(box_piece) < i) - { - hypre_BoxGetSize(box_piece, loop_size); - hypre_CopyIndex(hypre_BoxIMin(box_piece), start); - - hypre_SerialBoxLoop0Begin(ndim, loop_size); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(index, lindex[0], lindex[1], lindex[2]); - hypre_AddIndexes(index, start, 3, index); - - hypre_SStructBoxManEntryGetGlobalRank(entry, index, - &rank, matrix_type); - eflag[rank - start_rank2] = 0; - } - hypre_SerialBoxLoop0End(); - } /* if (hypre_BoxVolume(box_piece) < i) */ - } /* for (k= 0; k< hypre_BoxArraySize(tmp_box_array1); k++) */ - - hypre_BoxArrayDestroy(tmp_box_array1); - - for (k = 0; k < hypre_BoxArraySize(tmp_box_array2); k++) - { - box_piece = hypre_BoxArrayBox(tmp_box_array2, k); - if (hypre_BoxVolume(box_piece) < i) - { - hypre_BoxGetSize(box_piece, loop_size); - hypre_CopyIndex(hypre_BoxIMin(box_piece), start); - - hypre_SerialBoxLoop0Begin(ndim, loop_size); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(index, lindex[0], lindex[1], lindex[2]); - hypre_AddIndexes(index, start, 3, index); - - hypre_SStructBoxManEntryGetGlobalRank(entry, index, - &rank, matrix_type); - eflag[rank - start_rank2] = 0; - } - hypre_SerialBoxLoop0End(); - } /* if (hypre_BoxVolume(box_piece) < i) */ - } /* for (k= 0; k< hypre_BoxArraySize(tmp_box_array2); k++) */ - hypre_BoxArrayDestroy(tmp_box_array2); - } /* for (d= 0; d< ndirection; d++) */ - - } /* hypre_ForBoxI(j, boxes) */ - } /* for (m= 0; m< nvars; m++) */ - - hypre_TFree(direction, HYPRE_MEMORY_HOST); - } /* for (part= 0; part< nparts; part++) */ - - /* set vals. Will have more memory than is needed- extra allotted - for repeated nodes. */ - 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, memory_location); - vals = hypre_TAlloc(HYPRE_Real, k, memory_location); - for (i = 0; i < k; i++) - { - 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++) - { - j = vartype_edges[i]; - hypre_SStructVariableGetOffset(vartype_edges[i], ndim, varoffsets[i]); - switch (j) - { - case 2: - { - hypre_SetIndex3(offsets[i], 0, 1, 0); - break; - } - - case 3: - { - hypre_SetIndex3(offsets[i], 1, 0, 0); - break; - } - - case 5: - { - hypre_SetIndex3(offsets[i], 1, 0, 0); - break; - } - - case 6: - { - hypre_SetIndex3(offsets[i], 0, 1, 0); - break; - } - - case 7: - { - hypre_SetIndex3(offsets[i], 0, 0, 1); - break; - } - } /* switch(j) */ - } /* for (i= 0; i< ndim; i++) */ - - nrows = 0; i = 0; - for (part = 0; part < nparts; part++) - { - /* grab boxarray for node rank extracting later */ - pgrid = hypre_SStructGridPGrid(node_grid, part); - var_grid = hypre_SStructPGridSGrid(pgrid, 0); - - /* grab edge structures */ - pgrid = hypre_SStructGridPGrid(edge_grid, part); - - /* the cell-centred reference box is used to get the correct - 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); - - nvars = hypre_SStructPGridNVars(pgrid); - for (n = 0; n < nvars; n++) - { - var_grid = hypre_SStructPGridSGrid(pgrid, n); - edge_boxes = hypre_StructGridBoxes(var_grid); - - hypre_ForBoxI(j, edge_boxes) - { - box = hypre_BoxArrayBox(edge_boxes, j); - cell_box = hypre_BoxArrayBox(cell_boxes, j); - - hypre_CopyBox(cell_box, &interior_box); - - /* shrink the cell_box to get the interior cell_box. All - edges in the interior box should be on this proc. */ - hypre_SubtractIndexes(hypre_BoxIMin(&interior_box), shift, 3, - hypre_BoxIMin(&interior_box)); - - hypre_AddIndexes(hypre_BoxIMax(&interior_box), shift, 3, - hypre_BoxIMax(&interior_box)); - - /* offset this to the variable interior box */ - hypre_CopyBox(&interior_box, &layer); - hypre_SubtractIndexes(hypre_BoxIMin(&layer), varoffsets[n], 3, - hypre_BoxIMin(&layer)); - - hypre_BoxGetSize(&layer, loop_size); - hypre_CopyIndex(hypre_BoxIMin(&layer), start); - - /* Interior box- loop over each edge and find the row rank and - then the column ranks for the connected nodes. Change the - appropriate values to 1. */ - hypre_SerialBoxLoop0Begin(ndim, loop_size); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(index, lindex[0], lindex[1], lindex[2]); - hypre_AddIndexes(index, start, 3, index); - - /* edge ijk connected to nodes ijk & ijk-offsets. Interior edges - and so no boundary edges to consider. */ - hypre_SStructGridFindBoxManEntry(edge_grid, part, index, n, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, index, &m, matrix_type); - inode[nrows] = m; - - hypre_SStructGridFindBoxManEntry(node_grid, part, index, 0, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, index, &m, matrix_type); - jedge[i] = m; - vals[i] = 1.0; /* change only this connection */ - i++; - - hypre_SubtractIndexes(index, offsets[n], 3, index); - hypre_SStructGridFindBoxManEntry(node_grid, part, index, 0, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, index, &m, matrix_type); - jedge[i] = m; - i++; - - ncols[nrows] = 2; - nrows++; - } - hypre_SerialBoxLoop0End(); - - /* 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++) - { - /*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]; - - /* ndirection= 0 negative; ndirection= 1 positive */ - for (ndirection = 0; ndirection < 2; ndirection++) - { - hypre_CopyBox(box, &layer); - - if (ndirection) - { - hypre_BoxShiftPos(&layer, shift2); - } - else - { - hypre_BoxShiftNeg(&layer, shift2); - } - - hypre_IntersectBoxes(box, &layer, &layer); - hypre_BoxGetSize(&layer, loop_size); - hypre_CopyIndex(hypre_BoxIMin(&layer), start); - - hypre_SerialBoxLoop0Begin(ndim, loop_size); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(index, lindex[0], lindex[1], lindex[2]); - hypre_AddIndexes(index, start, 3, index); - - /* edge ijk connects to nodes ijk & ijk+offsets. */ - hypre_SStructGridFindBoxManEntry(edge_grid, part, index, n, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, index, &m, - matrix_type); - - /* check if the edge lies on the boundary & if not - check if the connecting node is on the boundary. */ - if (eflag[m - start_rank2]) - { - inode[nrows] = m; - /* edge not completely on the boundary. One connecting - node must be in the interior. */ - hypre_SStructGridFindBoxManEntry(node_grid, part, index, 0, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, index, &m, - matrix_type); - - /* check if node on my processor. If not, the node must - be in the interior (draw a diagram to see this). */ - if (m >= start_rank1 && m <= jupper) - { - /* node on proc. Now check if on the boundary. */ - if (nflag[m - start_rank1]) /* interior node */ - { - jedge[i] = m; - vals[i] = 1.0; - i++; - - ncols[nrows]++; - } - } - else /* node off-proc */ - { - jedge[i] = m; - vals[i] = 1.0; - i++; - - ncols[nrows]++; - } - - /* ijk+offsets */ - hypre_SubtractIndexes(index, offsets[n], 3, index); - hypre_SStructGridFindBoxManEntry(node_grid, part, index, 0, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, index, &m, - matrix_type); - /* boundary checks again */ - if (m >= start_rank1 && m <= jupper) - { - /* node on proc. Now check if on the boundary. */ - if (nflag[m - start_rank1]) /* interior node */ - { - jedge[i] = m; - i++; - ncols[nrows]++; - } - } - else /* node off-proc */ - { - jedge[i] = m; - i++; - ncols[nrows]++; - } - - nrows++; /* must have at least one node connection */ - } /* if (eflag[m-start_rank2]) */ - - } - hypre_SerialBoxLoop0End(); - } /* for (ndirection= 0; ndirection< 2; ndirection++) */ - } /* for (d= 0; d< ndim; d++) */ - - } /* hypre_ForBoxI(j, boxes) */ - } /* for (n= 0; n< nvars; n++) */ - } /* for (part= 0; part< nparts; part++) */ - - hypre_TFree(offsets, HYPRE_MEMORY_HOST); - hypre_TFree(varoffsets, HYPRE_MEMORY_HOST); - hypre_TFree(vartype_edges, HYPRE_MEMORY_HOST); - HYPRE_SStructGridDestroy(node_grid); - HYPRE_SStructGridDestroy(edge_grid); - - HYPRE_IJMatrixSetValues(T_grad, nrows, ncols, - (const HYPRE_BigInt*) inode, (const HYPRE_BigInt*) jedge, - (const HYPRE_Real*) vals); - HYPRE_IJMatrixAssemble(T_grad); - - hypre_TFree(eflag, HYPRE_MEMORY_HOST); - hypre_TFree(nflag, HYPRE_MEMORY_HOST); - 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); - HYPRE_IJMatrixSetObjectType(T_grad, -1); - HYPRE_IJMatrixDestroy(T_grad); - - return parcsr_grad; -} diff --git a/src/sstruct_ls/maxwell_physbdy.c b/src/sstruct_ls/maxwell_physbdy.c deleted file mode 100644 index 3b6a0f4060..0000000000 --- a/src/sstruct_ls/maxwell_physbdy.c +++ /dev/null @@ -1,948 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other - * HYPRE Project Developers. See the top-level COPYRIGHT file for details. - * - * SPDX-License-Identifier: (Apache-2.0 OR MIT) - ******************************************************************************/ - -/****************************************************************************** - * OpenMP Problems - * - * Need to fix the way these variables are set and incremented in loops: - * cnt - * - ******************************************************************************/ - -#include "_hypre_sstruct_ls.h" - -/*-------------------------------------------------------------------------- - * Finds the physical boundary boxes for all levels. Since the coarse grid's - * boundary may not be on the physical bdry, we need to compare the coarse - * grid to the finest level boundary boxes. All boxes of the coarse grids - * must be checked, not just the bounding box. - * Algo: - * 1) obtain boundary boxes for the finest grid - * i) mark the fboxes that have boundary elements. - * 2) loop over coarse levels - * i) for a cbox that maps to a fbox that has boundary layers - * a) refine the cbox - * b) intersect with the cell boundary layers of the fbox - * c) coarsen the intersection - * ii) determine the var boxes - * iii) mark the coarse box - * - * Concerns: Checking an individual pgrid may give artificial physical - * boundaries. Need to check if any other pgrid is adjacent to it. - * We omit this case and assume only one part for now. - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_Maxwell_PhysBdy( hypre_SStructGrid **grid_l, - HYPRE_Int num_levels, - hypre_Index rfactors, - HYPRE_Int ***BdryRanksl_ptr, - HYPRE_Int **BdryRanksCntsl_ptr ) -{ - - MPI_Comm comm = (grid_l[0]-> comm); - - HYPRE_Int **BdryRanks_l; - HYPRE_Int *BdryRanksCnts_l; - - HYPRE_Int *npts; - HYPRE_BigInt *ranks, *upper_rank, *lower_rank; - hypre_BoxManEntry *boxman_entry; - - hypre_SStructGrid *grid; - hypre_SStructPGrid *pgrid; - hypre_StructGrid *cell_fgrid, *cell_cgrid, *sgrid; - - hypre_BoxArrayArray ****bdry; - hypre_BoxArrayArray *fbdry; - hypre_BoxArrayArray *cbdry; - - hypre_BoxArray *box_array; - hypre_BoxArray *fboxes, *cboxes; - - hypre_Box *fbox, *cbox; - hypre_Box *box, *contract_fbox, rbox; - hypre_Box intersect; - - HYPRE_Int **cbox_mapping = NULL, **fbox_mapping = NULL; - HYPRE_Int **boxes_with_bdry; - - HYPRE_Int ndim, nvars; - HYPRE_Int nboxes, nfboxes; - HYPRE_Int boxi; - - hypre_Index zero_shift, upper_shift, lower_shift; - hypre_Index loop_size, start, index, lindex; - - HYPRE_Int i, j, k, l, m, n, p; - HYPRE_Int d; - HYPRE_Int cnt; - - HYPRE_Int part = 0; /* NOTE, ASSUMING ONE PART */ - HYPRE_Int matrix_type = HYPRE_PARCSR; - HYPRE_Int myproc; - - HYPRE_Int ierr = 0; - - hypre_MPI_Comm_rank(comm, &myproc); - - 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); - - 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); - - /* 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); - 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); - } - - /*----------------------------------------------------------------------------- - * construct box_number mapping between levels, and offset strides because of - * projection coarsening. Note: from the way the coarse boxes are created and - * numbered, to determine the coarse box that matches the fbox, we need to - * only check the tail end of the list of cboxes. In fact, given fbox_i, - * if it's coarsened extents do not interesect with the first coarse box of the - * tail end, then this fbox vanishes in the coarsening. - * c/fbox_mapping gives the fine/coarse box mapping between two consecutive levels - * of the multilevel hierarchy. - *-----------------------------------------------------------------------------*/ - 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); - } - 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); - - 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); - - /* assuming if i1 > i2 and (box j1) is coarsened from (box i1) - and (box j2) from (box i2), then j1 > j2. */ - k = 0; - hypre_ForBoxI(j, fboxes) - { - fbox = hypre_BoxArrayBox(fboxes, j); - hypre_CopyBox(fbox, &rbox); - hypre_ProjectBox(&rbox, zero_shift, rfactors); - hypre_StructMapFineToCoarse(hypre_BoxIMin(&rbox), zero_shift, - rfactors, hypre_BoxIMin(&rbox)); - hypre_StructMapFineToCoarse(hypre_BoxIMax(&rbox), zero_shift, - rfactors, hypre_BoxIMax(&rbox)); - - /* since the ordering of the cboxes was determined by the fbox - 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); - hypre_IntersectBoxes(&rbox, cbox, &rbox); - if (hypre_BoxVolume(&rbox)) - { - 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); - - /* 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)); - - hypre_Maxwell_PNedelec_Bdy(cell_fgrid, pgrid, &bdry[0]); - for (i = 0; i < nboxes; i++) - { - if (bdry[0][i]) /* boundary layers on box[i] */ - { - for (j = 0; j < nvars; j++) - { - 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); - hypre_ForBoxI(p, box_array) - { - 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 */ - } /* if (bdry[0][i]) */ - } - nfboxes = nboxes; - - /* coarser levels */ - 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]; - 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); - - /* cell grid boxarrayarray */ - bdry[i][j][0] = hypre_BoxArrayArrayCreate(2 * ndim, ndim); - - /* var grid boxarrayarrays */ - for (k = 0; k < nvars; k++) - { - 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++) - { - /* see if the j box of level (i-1) has any boundary layers */ - if (boxes_with_bdry[i - 1][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); - - /* 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++) - { - 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]; - } - else - { - upper_shift[k] = rfactors[k] - p - 1; - lower_shift[k] = -p; - } - } - hypre_BoxDestroy(contract_fbox); - - hypre_CopyBox(cbox, &rbox); - hypre_StructMapCoarseToFine(hypre_BoxIMin(&rbox), zero_shift, - rfactors, hypre_BoxIMin(&rbox)); - hypre_StructMapCoarseToFine(hypre_BoxIMax(&rbox), zero_shift, - rfactors, hypre_BoxIMax(&rbox)); - - hypre_AddIndexes(lower_shift, hypre_BoxIMin(&rbox), 3, - hypre_BoxIMin(&rbox)); - hypre_AddIndexes(upper_shift, hypre_BoxIMax(&rbox), 3, - hypre_BoxIMax(&rbox)); - - /* Determine, if any, boundary layers for this rbox. Since the - 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 is the cell-centred box_arrayarray. Contains an array of (2*ndim) - boxarrays, one for each direction. */ - 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) - { - case 0: /* lower x direction, x_upper= x_lower */ - { - 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 */ - 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 */ - 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 */ - 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 */ - 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 */ - break; - } - } - - box_array = hypre_BoxArrayArrayBoxArray(fbdry, l); - hypre_ForBoxI(p, box_array) - { - hypre_IntersectBoxes(hypre_BoxArrayBox(box_array, p), &rbox, - &intersect); - if (hypre_BoxVolume(&intersect)) - { - /* coarsen the refined boundary box and append it to - boxarray hypre_BoxArrayArrayBoxArray(cbdry, l) */ - hypre_ProjectBox(&intersect, zero_shift, rfactors); - hypre_StructMapFineToCoarse(hypre_BoxIMin(&intersect), - zero_shift, rfactors, hypre_BoxIMin(&intersect)); - hypre_StructMapFineToCoarse(hypre_BoxIMax(&intersect), - zero_shift, rfactors, hypre_BoxIMax(&intersect)); - - /* the coarsened intersect box may be incorrect because - of the box projecting formulas. */ - if (n) /* replace upper by lower */ - { - hypre_BoxIMax(&intersect)[d] = hypre_BoxIMin(&intersect)[d]; - } - else /* replace lower by upper */ - { - hypre_BoxIMin(&intersect)[d] = hypre_BoxIMax(&intersect)[d]; - } - - hypre_AppendBox(&intersect, - hypre_BoxArrayArrayBoxArray(cbdry, l)); - cnt++; /* counter to signal boundary layers for cbox boxi */ - } /* if (hypre_BoxVolume(&intersect)) */ - } /* hypre_ForBoxI(p, box_array) */ - } /* hypre_ForBoxArrayI(l, fbdry) */ - - /* All the boundary box_arrayarrays have been checked for coarse boxi. - Now get the variable boundary layers if any, count the number of - boundary points, and appropriately mark boxi. */ - if (cnt) - { - hypre_Maxwell_VarBdy(pgrid, bdry[i][boxi]); - - for (p = 0; p < nvars; p++) - { - cbdry = bdry[i][boxi][p + 1]; - hypre_ForBoxArrayI(l, cbdry) - { - box_array = hypre_BoxArrayArrayBoxArray(cbdry, l); - hypre_ForBoxI(m, box_array) - { - cbox = hypre_BoxArrayBox(box_array, m); - npts[i] += hypre_BoxVolume(cbox); - } - } - } - - 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; - } /* for (i= 1; i< num_levels; i++) */ - - /* de-allocate objects that are not needed anymore */ - 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]) - { - 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)); - } - if (num_levels > 1) - { - hypre_TFree(fbox_mapping, HYPRE_MEMORY_HOST); - hypre_TFree(cbox_mapping, HYPRE_MEMORY_HOST); - } - - /* 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); - - /* loop over levels and extract boundary ranks. Only extract unique - ranks */ - 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++) - { - if (boxes_with_bdry[i][j]) - { - for (k = 0; k < nvars; k++) - { - fbdry = bdry[i][j][k + 1]; - - hypre_ForBoxArrayI(m, fbdry) - { - box_array = hypre_BoxArrayArrayBoxArray(fbdry, m); - hypre_ForBoxI(p, box_array) - { - box = hypre_BoxArrayBox(box_array, p); - hypre_BoxGetSize(box, loop_size); - hypre_CopyIndex(hypre_BoxIMin(box), start); - - hypre_SerialBoxLoop0Begin(ndim, loop_size); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(index, lindex[0], lindex[1], lindex[2]); - hypre_AddIndexes(index, start, 3, index); - - hypre_SStructGridFindBoxManEntry(grid, part, index, - k, &boxman_entry); - hypre_SStructBoxManEntryGetGlobalRank(boxman_entry, index, - &ranks[cnt], matrix_type); - cnt++; - - } - hypre_SerialBoxLoop0End(); - } /* hypre_ForBoxI(p, box_array) */ - } /* hypre_ForBoxArrayI(m, fbdry) */ - - } /* for (k= 0; k< nvars; k++) */ - } /* if (boxes_with_bdry[i][j]) */ - - for (k = 0; k < nvars; k++) - { - hypre_BoxArrayArrayDestroy(bdry[i][j][k + 1]); - } - hypre_BoxArrayArrayDestroy(bdry[i][j][0]); - hypre_TFree(bdry[i][j], HYPRE_MEMORY_HOST); - - } /* for (j= 0; j< nboxes; j++) */ - hypre_TFree(bdry[i], HYPRE_MEMORY_HOST); - - /* mark all ranks that are outside this processor to -1 */ - for (j = 0; j < cnt; j++) - { - if ( (ranks[j] < lower_rank[i]) || (ranks[j] > upper_rank[i]) ) - { - 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); - - k = 0; - if (ranks[0] < 0) /* remove the off-processor markers */ - { - for (j = 1; j < cnt; j++) - { - if (ranks[j] > -1) - { - k = j; - break; - } - } - } - - l = 1; - for (j = k + 1; j < cnt; j++) - { - if (ranks[j] != ranks[j - 1]) - { - 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++) - { - if (ranks[j] != ranks[j - 1]) - { - l++; - 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; - } - - hypre_TFree(ranks, HYPRE_MEMORY_HOST); - hypre_TFree(boxes_with_bdry[i], HYPRE_MEMORY_HOST); - - } /* for (i= 0; i< num_levels; i++) */ - - hypre_TFree(boxes_with_bdry, HYPRE_MEMORY_HOST); - hypre_TFree(lower_rank, HYPRE_MEMORY_HOST); - hypre_TFree(upper_rank, HYPRE_MEMORY_HOST); - - hypre_TFree(bdry, HYPRE_MEMORY_HOST); - hypre_TFree(npts, HYPRE_MEMORY_HOST); - - *BdryRanksl_ptr = BdryRanks_l; - *BdryRanksCntsl_ptr = BdryRanksCnts_l; - - return ierr; -} - -/*----------------------------------------------------------------------------- - * Determine the variable boundary layers using the cell-centred boundary - * layers. The cell-centred boundary layers are located in bdry[0], a - * hypre_BoxArrayArray of size 2*ndim, one array for the upper side and one - * for the lower side, for each direction. - *-----------------------------------------------------------------------------*/ -HYPRE_Int -hypre_Maxwell_VarBdy( hypre_SStructPGrid *pgrid, - hypre_BoxArrayArray **bdry ) -{ - HYPRE_Int ierr = 0; - HYPRE_Int nvars = hypre_SStructPGridNVars(pgrid); - - hypre_BoxArrayArray *cell_bdry = bdry[0]; - hypre_BoxArray *box_array, *box_array2; - hypre_Box *bdy_box, *shifted_box; - - HYPRE_SStructVariable *vartypes = hypre_SStructPGridVarTypes(pgrid); - hypre_Index varoffset, ishift, jshift, kshift; - hypre_Index lower, upper; - - HYPRE_Int ndim = hypre_SStructPGridNDim(pgrid); - HYPRE_Int i, k, t; - - hypre_SetIndex3(ishift, 1, 0, 0); - hypre_SetIndex3(jshift, 0, 1, 0); - hypre_SetIndex3(kshift, 0, 0, 1); - - shifted_box = hypre_BoxCreate(ndim); - for (i = 0; i < nvars; i++) - { - t = vartypes[i]; - hypre_SStructVariableGetOffset(vartypes[i], ndim, varoffset); - switch (t) - { - case 2: /* xface, boundary i= lower, upper */ - { - /* boundary i= lower */ - box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 0); - if (hypre_BoxArraySize(box_array)) - { - box_array2 = hypre_BoxArrayArrayBoxArray(bdry[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, 3, lower); - hypre_SubtractIndexes(upper, varoffset, 3, upper); - - hypre_BoxSetExtents(shifted_box, lower, upper); - hypre_AppendBox(shifted_box, box_array2); - } - } - - /* boundary i= upper */ - box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 1); - if (hypre_BoxArraySize(box_array)) - { - box_array2 = hypre_BoxArrayArrayBoxArray(bdry[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_BoxSetExtents(shifted_box, lower, upper); - hypre_AppendBox(shifted_box, box_array2); - } - } - break; - } - - case 3: /* yface, boundary j= lower, upper */ - { - box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 2); - if (hypre_BoxArraySize(box_array)) - { - box_array2 = hypre_BoxArrayArrayBoxArray(bdry[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, 3, lower); - hypre_SubtractIndexes(upper, varoffset, 3, upper); - - hypre_BoxSetExtents(shifted_box, lower, upper); - hypre_AppendBox(shifted_box, box_array2); - } - } - - box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 3); - if (hypre_BoxArraySize(box_array)) - { - box_array2 = hypre_BoxArrayArrayBoxArray(bdry[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_BoxSetExtents(shifted_box, lower, upper); - hypre_AppendBox(shifted_box, box_array2); - } - } - break; - } - - case 5: /* xedge, boundary z_faces & y_faces */ - { - /* boundary k= lower zface*/ - box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 4); - if (hypre_BoxArraySize(box_array)) - { - box_array2 = hypre_BoxArrayArrayBoxArray(bdry[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, 3, lower); - hypre_SubtractIndexes(upper, kshift, 3, upper); - - hypre_BoxSetExtents(shifted_box, lower, upper); - hypre_AppendBox(shifted_box, box_array2); - } - } - - /* boundary k= upper zface*/ - box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 5); - if (hypre_BoxArraySize(box_array)) - { - box_array2 = hypre_BoxArrayArrayBoxArray(bdry[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, jshift, 3, lower); - - hypre_BoxSetExtents(shifted_box, lower, upper); - hypre_AppendBox(shifted_box, box_array2); - } - } - - /* boundary j= lower yface*/ - box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 2); - if (hypre_BoxArraySize(box_array)) - { - box_array2 = hypre_BoxArrayArrayBoxArray(bdry[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, 3, lower); - hypre_SubtractIndexes(upper, jshift, 3, upper); - - hypre_BoxSetExtents(shifted_box, lower, upper); - hypre_AppendBox(shifted_box, box_array2); - } - } - - /* boundary j= upper yface*/ - box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 3); - if (hypre_BoxArraySize(box_array)) - { - box_array2 = hypre_BoxArrayArrayBoxArray(bdry[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, kshift, 3, lower); - - hypre_BoxSetExtents(shifted_box, lower, upper); - hypre_AppendBox(shifted_box, box_array2); - } - } - break; - } - - case 6: /* yedge, boundary z_faces & x_faces */ - { - /* boundary k= lower zface*/ - box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 4); - if (hypre_BoxArraySize(box_array)) - { - box_array2 = hypre_BoxArrayArrayBoxArray(bdry[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, 3, lower); - hypre_SubtractIndexes(upper, kshift, 3, upper); - - hypre_BoxSetExtents(shifted_box, lower, upper); - hypre_AppendBox(shifted_box, box_array2); - } - } - - /* boundary k= upper zface*/ - box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 5); - if (hypre_BoxArraySize(box_array)) - { - box_array2 = hypre_BoxArrayArrayBoxArray(bdry[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, 3, lower); - - hypre_BoxSetExtents(shifted_box, lower, upper); - hypre_AppendBox(shifted_box, box_array2); - } - } - - /* boundary i= lower xface*/ - box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 0); - if (hypre_BoxArraySize(box_array)) - { - box_array2 = hypre_BoxArrayArrayBoxArray(bdry[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, 3, lower); - hypre_SubtractIndexes(upper, ishift, 3, upper); - - hypre_BoxSetExtents(shifted_box, lower, upper); - hypre_AppendBox(shifted_box, box_array2); - } - } - - /* boundary i= upper xface*/ - box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 1); - if (hypre_BoxArraySize(box_array)) - { - box_array2 = hypre_BoxArrayArrayBoxArray(bdry[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, kshift, 3, lower); - - hypre_BoxSetExtents(shifted_box, lower, upper); - hypre_AppendBox(shifted_box, box_array2); - } - } - break; - } - - case 7: /* zedge, boundary y_faces & x_faces */ - { - /* boundary j= lower yface*/ - box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 2); - if (hypre_BoxArraySize(box_array)) - { - box_array2 = hypre_BoxArrayArrayBoxArray(bdry[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, 3, lower); - hypre_SubtractIndexes(upper, jshift, 3, upper); - - hypre_BoxSetExtents(shifted_box, lower, upper); - hypre_AppendBox(shifted_box, box_array2); - } - } - - /* boundary j= upper yface*/ - box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 3); - if (hypre_BoxArraySize(box_array)) - { - box_array2 = hypre_BoxArrayArrayBoxArray(bdry[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, 3, lower); - - hypre_BoxSetExtents(shifted_box, lower, upper); - hypre_AppendBox(shifted_box, box_array2); - } - } - - /* boundary i= lower xface*/ - box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 0); - if (hypre_BoxArraySize(box_array)) - { - box_array2 = hypre_BoxArrayArrayBoxArray(bdry[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, 3, lower); - hypre_SubtractIndexes(upper, ishift, 3, upper); - - hypre_BoxSetExtents(shifted_box, lower, upper); - hypre_AppendBox(shifted_box, box_array2); - } - } - - /* boundary i= upper xface*/ - box_array = hypre_BoxArrayArrayBoxArray(cell_bdry, 1); - if (hypre_BoxArraySize(box_array)) - { - box_array2 = hypre_BoxArrayArrayBoxArray(bdry[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, 3, lower); - - hypre_BoxSetExtents(shifted_box, lower, upper); - hypre_AppendBox(shifted_box, box_array2); - } - } - break; - } - - } /* switch(t) */ - } /* for (i= 0; i< nvars; i++) */ - - hypre_BoxDestroy(shifted_box); - - return ierr; -} diff --git a/src/sstruct_ls/maxwell_semi_interp.c b/src/sstruct_ls/maxwell_semi_interp.c deleted file mode 100644 index b761983e6b..0000000000 --- a/src/sstruct_ls/maxwell_semi_interp.c +++ /dev/null @@ -1,5400 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other - * HYPRE Project Developers. See the top-level COPYRIGHT file for details. - * - * SPDX-License-Identifier: (Apache-2.0 OR MIT) - ******************************************************************************/ - -/****************************************************************************** - * OpenMP Problems - * - * Need to fix the way these variables are set and incremented in loops: - * nElements, nElements_iedges, nFaces, nFaces_iedges, nEdges, nEdges_iedges, - * nElements_Faces, nElements_Edges, - * j, l, k (these three only where they are listed at the end of SMP_PRIVATE) - * - ******************************************************************************/ - -#include "_hypre_sstruct_ls.h" - -/*-------------------------------------------------------------------------- - * hypre_Maxwell_Interp.c - *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_CreatePTopology(void **PTopology_vdata_ptr) -{ - hypre_PTopology *PTopology; - HYPRE_Int ierr = 0; - - PTopology = hypre_CTAlloc(hypre_PTopology, 1, HYPRE_MEMORY_HOST); - - (PTopology -> Face_iedge) = NULL; - (PTopology -> Element_iedge) = NULL; - (PTopology -> Edge_iedge) = NULL; - - (PTopology -> Element_Face) = NULL; - (PTopology -> Element_Edge) = NULL; - - *PTopology_vdata_ptr = (void *) PTopology; - - return ierr; -} - -HYPRE_Int -hypre_DestroyPTopology(void *PTopology_vdata) -{ - hypre_PTopology *PTopology = (hypre_PTopology *)PTopology_vdata; - HYPRE_Int ierr = 0; - - if (PTopology) - { - if ( (PTopology -> Face_iedge) != NULL) - { - HYPRE_IJMatrixDestroy(PTopology -> Face_iedge); - } - HYPRE_IJMatrixDestroy(PTopology -> Element_iedge); - HYPRE_IJMatrixDestroy(PTopology -> Edge_iedge); - - if ( (PTopology -> Element_Face) != NULL) - { - HYPRE_IJMatrixDestroy(PTopology -> Element_Face); - } - HYPRE_IJMatrixDestroy(PTopology -> Element_Edge); - } - hypre_TFree(PTopology, HYPRE_MEMORY_HOST); - - return ierr; -} - -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) -{ - MPI_Comm comm = (fgrid_element -> comm); - - hypre_PTopology *PTopology = (hypre_PTopology *) PTopology_vdata; - - hypre_IJMatrix *Face_iedge; - hypre_IJMatrix *Element_iedge; - hypre_IJMatrix *Edge_iedge; - - hypre_IJMatrix *Element_Face; - hypre_IJMatrix *Element_Edge; - - hypre_IJMatrix *edge_Edge; - - hypre_SStructPGrid *p_cgrid, *p_fgrid; - hypre_StructGrid *var_cgrid, *var_fgrid; - hypre_BoxArray *cboxes, *fboxes, *box_array; - hypre_Box *cbox, *fbox, *cellbox, *vbox, copy_box; - - hypre_BoxArray **contract_fedgeBoxes; - hypre_Index **Edge_cstarts, **upper_shifts, **lower_shifts; - HYPRE_Int **cfbox_mapping, **fcbox_mapping; - - hypre_BoxManEntry *entry; - HYPRE_BigInt rank, rank2; - HYPRE_BigInt start_rank1; - - HYPRE_Int nFaces, nEdges, nElements, nedges; - 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 = NULL, *iEdge; - HYPRE_BigInt *jFace_edge; - HYPRE_BigInt *jEdge_iedge; - HYPRE_BigInt *jElement_Face = NULL, *jedge_Edge; - HYPRE_BigInt *iElement, *jElement_Edge, *iedgeEdge, *jElement_edge; - - 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; - 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; - HYPRE_Int *off_proc_flag; - - hypre_Index cindex; - hypre_Index findex; - hypre_Index var_index, cell_index, *boxoffset, *suboffset; - hypre_Index loop_size, start, cstart, stride, low_index, hi_index; - hypre_Index ishift, jshift, kshift, zero_index, one_index; - hypre_Index lindex; - HYPRE_Int n_boxoffsets; - - HYPRE_Int nparts = hypre_SStructGridNParts(fgrid_element); - HYPRE_Int ndim = hypre_SStructGridNDim(fgrid_element); - - HYPRE_SStructVariable *vartypes, *Face_vartypes, *Edge_vartypes = NULL; - hypre_Index *varoffsets; - HYPRE_Int *vartype_map; - HYPRE_Int matrix_type = HYPRE_PARCSR; - - 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; - - HYPRE_BigInt ilower, iupper; - HYPRE_BigInt jlower, jupper; - HYPRE_BigInt **flower_ranks, **fupper_ranks; - HYPRE_BigInt **clower_ranks, **cupper_ranks; - HYPRE_Int ***n_CtoVbox, ****CtoVboxnums; - HYPRE_Int *num_vboxes, **vboxnums; - - HYPRE_Int size1; - HYPRE_Int trueV = 1; - 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); - hypre_SetIndex3(ishift, 1, 0, 0); - hypre_SetIndex3(jshift, 0, 1, 0); - hypre_SetIndex3(kshift, 0, 0, 1); - hypre_ClearIndex(zero_index); - hypre_ClearIndex(one_index); - hypre_SetIndex(one_index, 1); - hypre_SetIndex(lindex, 1); - - /* set rfactor[2]= 1 if ndim=2. */ - if (ndim == 2) - { - rfactor[2] = 1; - } - - /*------------------------------------------------------------------- - * Find the coarse-fine connection pattern, i.e., the topology - * needed to create the interpolation operators. - * Face_iedge, Edge_iedge, Element_iedge, Element_Face, Element_Edge, - * and edge_Edge connections are defined in terms of parcsr_matrices. - * These connections are determined using the cell-centred grids. - * Note that we are assuming the variable type enumeration - * given in hypre_SStructVariable_enum. - * - * We consider both 2-d and 3-d cases. In 2-d, the edges are faces. - * We will continue to call them edges, but use the face variable - * enumeration. - *-------------------------------------------------------------------*/ - 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 face and edge grids. */ - vartype_map = hypre_CTAlloc(HYPRE_Int, 8, HYPRE_MEMORY_HOST); - - part = 0; - p_cgrid = hypre_SStructGridPGrid(cgrid_face, part); /* face cgrid */ - nvars = hypre_SStructPGridNVars(p_cgrid); - vartypes = hypre_SStructPGridVarTypes(p_cgrid); - - for (i = 0; i < nvars; i++) - { - t = vartypes[i]; - switch (t) - { - case 2: - { - vartype_map[2] = i; - break; - } - - case 3: - { - vartype_map[3] = i; - break; - } - - case 4: - { - vartype_map[4] = i; - break; - } - } - } - - if (ndim == 3) - { - p_cgrid = hypre_SStructGridPGrid(cgrid_edge, part); /* edge cgrid */ - nvars = hypre_SStructPGridNVars(p_cgrid); - vartypes = hypre_SStructPGridVarTypes(p_cgrid); - - for (i = 0; i < nvars; i++) - { - t = vartypes[i]; - switch (t) - { - case 5: - { - vartype_map[5] = i; - break; - } - - case 6: - { - vartype_map[6] = i; - break; - } - - case 7: - { - vartype_map[7] = i; - break; - } - } - } - } - - /* local sizes */ - nFaces = 0; - nEdges = 0; - nElements = 0; - nedges = 0; - - nxFaces = 0; - nyFaces = 0; - nzFaces = 0; - /* nxEdges = 0; */ - /* nyEdges = 0; */ - /* nzEdges = 0; */ - - 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); - - 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); - - for (var = 0; var < nvars; var++) - { - var_cgrid = hypre_SStructPGridSGrid(p_cgrid, var); - t = vartypes[var]; - nFaces += hypre_StructGridLocalSize(var_cgrid); - - switch (t) - { - case 2: - nxFaces += hypre_StructGridLocalSize(var_cgrid); - break; - case 3: - nyFaces += hypre_StructGridLocalSize(var_cgrid); - break; - case 4: - nzFaces += hypre_StructGridLocalSize(var_cgrid); - break; - } - - hypre_SStructVariableGetOffset((hypre_SStructVariable) t, - ndim, varoffsets[t]); - } - - /* 2-d vs 3-d case */ - if (ndim < 3) - { - nEdges = nFaces; - /* 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); - - 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; */ - /* } */ - - hypre_SStructVariableGetOffset((hypre_SStructVariable) t, - ndim, varoffsets[t]); - } - } - - /* 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); - - for (var = 0; var < nvars; var++) - { - var_fgrid = hypre_SStructPGridSGrid(p_fgrid, var); - nedges += hypre_StructGridLocalSize(var_fgrid); - } - } - - /*-------------------------------------------------------------------------- - * Form mappings between the c & f box numbers. Note that a cbox - * can land inside only one fbox since the latter was contracted. Without - * the extraction, a cbox can land in more than 1 fboxes (e.g., cbox - * boundary extending into other fboxes). These mappings are for the - * cell-centred boxes. - * Check: Other variable boxes should follow this mapping, by - * property of the variable-shifted indices? Can the cell-centred boundary - * indices of a box be non-cell-centred indices for another box? - * - * 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++) - { - p_fgrid = hypre_SStructGridPGrid(fgrid_element, i); - 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); - - p_cgrid = hypre_SStructGridPGrid(cgrid_element, i); - 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); - - /* assuming if i1 > i2 and (box j1) is coarsened from (box i1) - and (box j2) from (box i2), then j1 > j2. */ - k = 0; - hypre_ForBoxI(j, fboxes) - { - fbox = hypre_BoxArrayBox(fboxes, j); - hypre_CopyBox(fbox, ©_box); - hypre_ProjectBox(©_box, zero_index, rfactor); - hypre_StructMapFineToCoarse(hypre_BoxIMin(©_box), zero_index, - rfactor, hypre_BoxIMin(©_box)); - hypre_StructMapFineToCoarse(hypre_BoxIMax(©_box), zero_index, - rfactor, hypre_BoxIMax(©_box)); - - /* since the ordering of the cboxes was determined by the fbox - 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); - hypre_IntersectBoxes(©_box, cbox, ©_box); - if (hypre_BoxVolume(©_box)) - { - 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); - hypre_ForBoxI(j, fboxes) - { - fbox = hypre_BoxArrayBox(fboxes, j); - - /* contract the fbox to correspond to the correct cbox */ - 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++) - { - 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]; - } - else - { - upper_shifts[i][j][l] = rfactor[l] - p - 1; - lower_shifts[i][j][l] = -p; - } - } - - /* record the cstarts of the cbox */ - hypre_ProjectBox(cbox, zero_index, rfactor); - hypre_CopyIndex(hypre_BoxIMin(cbox), Edge_cstarts[i][j]); - hypre_StructMapFineToCoarse(Edge_cstarts[i][j], zero_index, rfactor, - Edge_cstarts[i][j]); - - hypre_BoxDestroy(cbox); - } - } /* for (i= 0; i< nparts; i++) */ - - /* 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++) - { - 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); - - 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); - - /* cell grid ranks */ - 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); - hypre_SStructGridFindBoxManEntry(fgrid_element, part, findex, 0, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, findex, &flower_ranks[part][0], - matrix_type); - - 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); - - 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); - hypre_SStructGridFindBoxManEntry(cgrid_element, part, cindex, 0, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &clower_ranks[part][0], - matrix_type); - - cbox = hypre_BoxArrayBox(box_array, hypre_BoxArraySize(box_array) - 1); - hypre_CopyIndex(hypre_BoxIMax(cbox), cindex); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, cindex, 0, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &cupper_ranks[part][0], - matrix_type); - - /* face grid ranks */ - p_fgrid = hypre_SStructGridPGrid(fgrid_face, part); - p_cgrid = hypre_SStructGridPGrid(cgrid_face, part); - nvars = hypre_SStructPGridNVars(p_fgrid); - vartypes = hypre_SStructPGridVarTypes(p_cgrid); - - for (i = 0; i < nvars; i++) - { - 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); - hypre_SStructGridFindBoxManEntry(fgrid_face, part, findex, i, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, findex, &flower_ranks[part][t], - matrix_type); - - 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); - cbox = hypre_BoxArrayBox(box_array, 0); - hypre_CopyIndex(hypre_BoxIMin(cbox), cindex); - hypre_SStructGridFindBoxManEntry(cgrid_face, part, cindex, i, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &clower_ranks[part][t], - matrix_type); - - cbox = hypre_BoxArrayBox(box_array, hypre_BoxArraySize(box_array) - 1); - hypre_CopyIndex(hypre_BoxIMax(cbox), cindex); - hypre_SStructGridFindBoxManEntry(cgrid_face, part, cindex, i, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &cupper_ranks[part][t], - matrix_type); - } - /* edge grid ranks */ - p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); - p_cgrid = hypre_SStructGridPGrid(cgrid_edge, part); - nvars = hypre_SStructPGridNVars(p_fgrid); - vartypes = hypre_SStructPGridVarTypes(p_cgrid); - - for (i = 0; i < nvars; i++) - { - 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); - hypre_SStructGridFindBoxManEntry(fgrid_edge, part, findex, i, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, findex, &flower_ranks[part][t], - matrix_type); - - 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); - cbox = hypre_BoxArrayBox(box_array, 0); - hypre_CopyIndex(hypre_BoxIMin(cbox), cindex); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, cindex, i, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &clower_ranks[part][t], - matrix_type); - - cbox = hypre_BoxArrayBox(box_array, hypre_BoxArraySize(box_array) - 1); - hypre_CopyIndex(hypre_BoxIMax(cbox), cindex); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, cindex, i, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &cupper_ranks[part][t], - matrix_type); - } - } - - /* CREATE IJ_MATRICES- need to find the size of each one. Notice that the row - and col ranks of these matrices can be created using only grid information. - Grab the first part, first variable, first box, and lower index (lower rank); - Grab the last part, last variable, last box, and upper index (upper rank). */ - - /* Element_iedge- same for 2-d and 3-d */ - /* lower rank */ - 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) ; - cboxes = hypre_StructGridBoxes(var_cgrid); - cbox = hypre_BoxArrayBox(cboxes, 0); - hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMin(cbox), &ilower); - - p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); - hypre_SStructGridBoxProcFindBoxManEntry(fgrid_edge, part, 0, box, myproc, &entry); - - 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; - p_cgrid = hypre_SStructGridPGrid(cgrid_element, part); - var_cgrid = hypre_SStructPGridCellSGrid(p_cgrid) ; - cboxes = hypre_StructGridBoxes(var_cgrid); - cbox = hypre_BoxArrayBox(cboxes, 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); - 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); - hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMax(fbox), &jupper); - - HYPRE_IJMatrixCreate(comm, ilower, iupper, jlower, jupper, &Element_iedge); - HYPRE_IJMatrixSetObjectType(Element_iedge, HYPRE_PARCSR); - HYPRE_IJMatrixInitialize(Element_iedge); - - /* Edge_iedge. Note that even though not all the iedges are involved (e.g., - * 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; - 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); - 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); - fboxes = hypre_StructGridBoxes(var_fgrid); - fbox = hypre_BoxArrayBox(fboxes, 0); - hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMin(fbox), &jlower); - - /* upper rank */ - part = nparts - 1; - p_cgrid = hypre_SStructGridPGrid(cgrid_edge, part); - nvars = hypre_SStructPGridNVars(p_cgrid); - 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); - 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); - 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); - hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMax(fbox), &jupper); - - HYPRE_IJMatrixCreate(comm, ilower, iupper, jlower, jupper, &Edge_iedge); - HYPRE_IJMatrixSetObjectType(Edge_iedge, HYPRE_PARCSR); - HYPRE_IJMatrixInitialize(Edge_iedge); - - /* edge_Edge. Same for 2-d and 3-d. */ - /* lower rank */ - 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); - 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); - cboxes = hypre_StructGridBoxes(var_cgrid); - cbox = hypre_BoxArrayBox(cboxes, 0); - hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMin(cbox), &jlower); - - /* upper rank */ - part = nparts - 1; - p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); - nvars = hypre_SStructPGridNVars(p_fgrid); - 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); - 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); - 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); - hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMax(cbox), &jupper); - - HYPRE_IJMatrixCreate(comm, ilower, iupper, jlower, jupper, &edge_Edge); - HYPRE_IJMatrixSetObjectType(edge_Edge, HYPRE_PARCSR); - HYPRE_IJMatrixInitialize(edge_Edge); - - /* Face_iedge. Only needed in 3-d. */ - if (ndim == 3) - { - /* lower rank */ - 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); - 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); - fboxes = hypre_StructGridBoxes(var_fgrid); - fbox = hypre_BoxArrayBox(fboxes, 0); - hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMin(fbox), &jlower); - - /* upper rank */ - part = nparts - 1; - p_cgrid = hypre_SStructGridPGrid(cgrid_face, part); - nvars = hypre_SStructPGridNVars(p_cgrid); - var_cgrid = hypre_SStructPGridSGrid(p_cgrid, nvars - 1); - cboxes = hypre_StructGridBoxes(var_cgrid); - cbox = hypre_BoxArrayBox(cboxes, hypre_BoxArraySize(cboxes) - 1); - - 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); - 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); - hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMax(fbox), &jupper); - - HYPRE_IJMatrixCreate(comm, ilower, iupper, jlower, jupper, &Face_iedge); - HYPRE_IJMatrixSetObjectType(Face_iedge, HYPRE_PARCSR); - HYPRE_IJMatrixInitialize(Face_iedge); - } - - /* Element_Face. Only for 3-d since Element_Edge= Element_Face in 2-d. */ - /* lower rank */ - if (ndim == 3) - { - 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); - cboxes = hypre_StructGridBoxes(var_cgrid); - cbox = hypre_BoxArrayBox(cboxes, 0); - hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMin(cbox), &ilower); - - hypre_SStructGridBoxProcFindBoxManEntry(cgrid_face, part, 0, box, - myproc, &entry); - p_cgrid = hypre_SStructGridPGrid(cgrid_face, part); - 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; - p_cgrid = hypre_SStructGridPGrid(cgrid_element, part); - nvars = hypre_SStructPGridNVars(p_cgrid); - var_cgrid = hypre_SStructPGridSGrid(p_cgrid, nvars - 1); - cboxes = hypre_StructGridBoxes(var_cgrid); - cbox = hypre_BoxArrayBox(cboxes, hypre_BoxArraySize(cboxes) - 1); - - 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); - cboxes = hypre_StructGridBoxes(var_cgrid); - cbox = hypre_BoxArrayBox(cboxes, hypre_BoxArraySize(cboxes) - 1); - - 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); - HYPRE_IJMatrixSetObjectType(Element_Face, HYPRE_PARCSR); - HYPRE_IJMatrixInitialize(Element_Face); - } - - /* Element_Edge. Same for 2-d and 3-d. */ - /* lower rank */ - 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); - 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); - cboxes = hypre_StructGridBoxes(var_cgrid); - cbox = hypre_BoxArrayBox(cboxes, 0); - hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMin(cbox), &jlower); - - /* upper rank */ - part = nparts - 1; - p_cgrid = hypre_SStructGridPGrid(cgrid_element, part); - nvars = hypre_SStructPGridNVars(p_cgrid); - var_cgrid = hypre_SStructPGridSGrid(p_cgrid, nvars - 1); - cboxes = hypre_StructGridBoxes(var_cgrid); - cbox = hypre_BoxArrayBox(cboxes, hypre_BoxArraySize(cboxes) - 1); - - 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); - 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); - hypre_SStructBoxManEntryGetGlobalCSRank(entry, hypre_BoxIMax(cbox), &jupper); - - HYPRE_IJMatrixCreate(comm, ilower, iupper, jlower, jupper, &Element_Edge); - HYPRE_IJMatrixSetObjectType(Element_Edge, HYPRE_PARCSR); - HYPRE_IJMatrixInitialize(Element_Edge); - - /*------------------------------------------------------------------------------ - * fill up the parcsr matrices. - *------------------------------------------------------------------------------*/ - /* count the number of connections, i.e., the columns - * no. of interior edges per face, or no. of interior edges per cell. - * 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; - } - else - { - 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, memory_location); - } - 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, memory_location); - for (i = 0; i < nElements; i++) - { - ncols_Elementedge[i] = n_Cell_iedges; - } - 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 - * between 2-d and 3-d. - * Loop over the coarse element grid - * a) Refine the coarse cell and grab the fine cells that will contain - * the fine edges. - * To obtain the correct coarse-to-fine cell index mapping, we - * map lindex to the fine cell grid and then adjust - * so that the final mapped fine cell is the one on the upper - * corner of the agglomerate. Will need to determine the fine box - * 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++) - { - if (ndim == 3) - { - 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_element, part); /* ccell grid */ - var_cgrid = hypre_SStructPGridCellSGrid(p_cgrid); - cboxes = hypre_StructGridBoxes(var_cgrid); - - p_fgrid = hypre_SStructGridPGrid(fgrid_element, part); /* fcell grid */ - var_fgrid = hypre_SStructPGridCellSGrid(p_fgrid); - fboxes = hypre_StructGridBoxes(var_fgrid); - - hypre_ForBoxI(i, cboxes) - { - 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]; - fbox = hypre_BoxArrayBox(fboxes, fboxi); - - /********************************************************************** - * determine the shift to get the correct c-to-f cell index map: - * d= hypre_BoxIMin(fbox)[j]%rfactor[j]*sign(hypre_BoxIMin(fbox)[j]) - * stride[j]= d-1 if d>0 - * stride[j]= rfactor[j]-1+d if d<=0. - * This is upper_shifts[part][fboxi]. - **********************************************************************/ - hypre_ClearIndex(stride); - hypre_CopyIndex(upper_shifts[part][fboxi], stride); - - /* loop over each cell and find the row rank of Element_edge and then - the column ranks of the connected fine edges. */ - hypre_SerialBoxLoop0Begin(ndim, loop_size); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(cindex, lindex[0], lindex[1], lindex[2]); - hypre_AddIndexes(cindex, cstart, 3, cindex); - - /* refined cindex to get the correct upper fine index */ - hypre_StructMapCoarseToFine(cindex, zero_index, rfactor, findex); - hypre_AddIndexes(findex, stride, 3, findex); - - /* Element(i,j,k) rank */ - hypre_SStructGridFindBoxManEntry(cgrid_element, part, cindex, 0, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, matrix_type); - 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); - - for (t = 0; t < Edge_nvars; t++) - { - hypre_CopyIndex(findex, hi_index); - var = Edge_vartypes[t]; /* c & f edges enumerated the same */ - - /* determine looping extents over the refined cells that - will have fine edges. */ - switch (var) - { - case 5: /* x_edges */ - { - hi_index[1] -= 1; - hi_index[2] -= 1; - break; - } - case 6: /* y_edges */ - { - hi_index[0] -= 1; - hi_index[2] -= 1; - break; - } - case 7: /* z_edges */ - { - hi_index[0] -= 1; - hi_index[1] -= 1; - break; - } - } /* switch (var) */ - - /* column ranks. */ - for (m = low_index[2]; m <= hi_index[2]; m++) - { - for (k = low_index[1]; k <= hi_index[1]; k++) - { - 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; - nElements_iedges++; - } /* for (j= findex[0]; j<= hi_index[0]; j++) */ - } /* for (k= findex[1]; k<= hi_index[1]; k++) */ - } /* for (m= findex[2]; m<= hi_index[2]; m++) */ - } /* for (t= 0; t< Edge_nvars; t++) */ - } /* if (ndim == 3) */ - - else if (ndim == 2) /* only x & y faces */ - { - hypre_SetIndex3(low_index, findex[0] - rfactor[0] + 1, - findex[1] - rfactor[1] + 1, - findex[2]); - - for (t = 0; t < Face_nvars; t++) - { - hypre_CopyIndex(findex, hi_index); - 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; - break; - } - case 3: /* y_edges */ - { - hi_index[1] -= 1; - break; - } - } /* switch (var) */ - - /* column ranks. */ - for (k = low_index[1]; k <= hi_index[1]; k++) - { - 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; - nElements_iedges++; - } /* for (j= findex[0]; j<= hi_index[0]; j++) */ - } /* for (k= findex[1]; k<= hi_index[1]; k++) */ - } /* for (t= 0; t< Face_nvars; t++) */ - } /* if (ndim == 2) */ - } - hypre_SerialBoxLoop0End(); - } /* hypre_ForBoxI(i, cboxes) */ - } /* for (part= 0; part< nparts; part++) */ - - HYPRE_IJMatrixSetValues(Element_iedge, nElements, ncols_Elementedge, - (const HYPRE_BigInt*) iElement, (const HYPRE_BigInt*) jElement_edge, - (const HYPRE_Real*) vals_Elementedge); - HYPRE_IJMatrixAssemble((HYPRE_IJMatrix) Element_iedge); - - hypre_TFree(ncols_Elementedge, memory_location); - hypre_TFree(jElement_edge, memory_location); - hypre_TFree(vals_Elementedge, memory_location); - - /* Face_edge */ - /*------------------------------------------------------------------------------ - * Fill out Face_edge a row at a time. Since we have different Face types - * so that the size of the cols change depending on what type the Face - * is, we need to loop over the grids and take a count of the col elements. - * Loop over the coarse face grids and add up the number of interior edges. - * Will compute only for 3-d. In 2-d, these structures are obtained for - * Edge_edge. - *------------------------------------------------------------------------------*/ - if (ndim == 3) - { - 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); - - 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++) - { - var = Face_vartypes[t]; - var_cgrid = hypre_SStructPGridSGrid(p_cgrid, t); - k = hypre_StructGridLocalSize(var_cgrid); - - switch (var) - { - case 2: /* x_Faces (i,j,k) then (i-1,j,k), contain y,z edges */ - { - for (i = 0; i < k; i++) - { - /* y_iedge connections to x_Face */ - ncols_Faceedge[nFaces] = (rfactor[2] - 1) * rfactor[1]; - - /* z_iedge connections to x_Face */ - ncols_Faceedge[nFaces] += rfactor[2] * (rfactor[1] - 1); - - j += ncols_Faceedge[nFaces]; - nFaces++; - } - break; - } /* case 2 */ - - case 3: /* y_Faces (i,j,k) then (i,j-1,k), contain x,z edges */ - { - for (i = 0; i < k; i++) - { - /* x_iedge connections to y_Face */ - ncols_Faceedge[nFaces] = (rfactor[2] - 1) * rfactor[0]; - - /* z_iedge connections to y_Face */ - ncols_Faceedge[nFaces] += rfactor[2] * (rfactor[0] - 1); - - j += ncols_Faceedge[nFaces]; - nFaces++; - } - break; - } /* case 3 */ - - case 4: /* z_Faces (i,j,k) then (i,j,k-1), contain x,y edges */ - { - for (i = 0; i < k; i++) - { - /* x_iedge connections to z_Face */ - ncols_Faceedge[nFaces] = (rfactor[1] - 1) * rfactor[0]; - - /* y_iedge connections to z_Face */ - ncols_Faceedge[nFaces] += rfactor[1] * (rfactor[0] - 1); - - j += ncols_Faceedge[nFaces]; - nFaces++; - } - break; - } /* case 4 */ - - } /* switch(var) */ - } /* for (t= 0; t< Face_nvars; t++) */ - } /* for (part= 0; part< nparts; part++) */ - - 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; - } - - /*--------------------------------------------------------------------------- - * Fill up the row/column ranks of Face_edge. - * Loop over the coarse Cell grid - * a) for each Cell box, stretch to a Face box - * b) for each coarse face, if it is on the proc, map it to a - * coarse cell (add the variable offset). - * c) refine the coarse cell and grab the fine cells that will contain - * the fine edges. Refining requires a shifting dependent on the - * begining index of the fine box. - * d) map these fine cells to the fine edges. - *---------------------------------------------------------------------------*/ - nFaces = 0; - 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); - - for (t = 0; t < Face_nvars; 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) - { - case 2: /* x_Faces-> y_iedges, z_iedges */ - { - hypre_ForBoxI(i, cboxes) - { - cbox = hypre_BoxArrayBox(cboxes, i); - hypre_CopyBox(cbox, ©_box); - hypre_SubtractIndexes(hypre_BoxIMin(©_box), varoffsets[var], 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - /* determine which fine box cbox has coarsened from */ - fboxi = cfbox_mapping[part][i]; - fbox = hypre_BoxArrayBox(fboxes, fboxi); - - /********************************************************** - * determine the shift to get the correct c-to-f cell - * index map. This is upper_shifts[part][fboxi]. - **********************************************************/ - hypre_ClearIndex(stride); - hypre_CopyIndex(upper_shifts[part][fboxi], stride); - - hypre_SerialBoxLoop0Begin(ndim, loop_size); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(cindex, lindex[0], lindex[1], lindex[2]); - hypre_AddIndexes(cindex, start, 3, cindex); - - hypre_SStructGridFindBoxManEntry(cgrid_face, part, cindex, t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, matrix_type); - - /* check if rank on proc before continuing */ - if ((rank <= cupper_ranks[part][var]) && - (rank >= clower_ranks[part][var])) - { - iFace[nFaces] = rank; - nFaces++; - - /* transform face index to cell index */ - hypre_AddIndexes(cindex, varoffsets[var], 3, cell_index); - - /* Refine the coarse cell to the upper fine index. The face will - be on the "lower end" fine cells, i.e., the slab box starting - with fine index cell_index. The fine edges will be on the - lower x of the fine cell, e.g., with fine cell (i,j,k), - y_iedge (i-1,j,k) & z_iedge (i-1,j,k). */ - hypre_StructMapCoarseToFine(cell_index, zero_index, - rfactor, findex); - hypre_AddIndexes(findex, stride, 3, findex); - - /* cell_index was refined to the upper fine index. Shift - back to the lower end, subtract (rfactor-1). */ - for (j = 0; j < ndim; j++) - { - findex[j] -= rfactor[j] - 1; - } - - /* y_iedges */ - ilower = findex[0] - 1; - for (k = 0; k < rfactor[2] - 1; k++) - { - for (j = 0; j < rfactor[1]; j++) - { - 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; - nFaces_iedges++; - } - } - - /* z_iedges */ - for (k = 0; k < rfactor[2]; k++) - { - for (j = 0; j < rfactor[1] - 1; j++) - { - 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; - nFaces_iedges++; - } - } - } /* if ((rank <= cupper_ranks[part][var]) && -(rank >= clower_ranks[part][var])) */ - } - - hypre_SerialBoxLoop0End(); - } /* hypre_ForBoxI(i, cboxes) */ - break; - } /* 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); - hypre_CopyBox(cbox, ©_box); - hypre_SubtractIndexes(hypre_BoxIMin(©_box), varoffsets[var], 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - /* determine which fine box cbox has coarsened from */ - fboxi = cfbox_mapping[part][i]; - fbox = hypre_BoxArrayBox(fboxes, fboxi); - - /********************************************************** - * determine the shift to get the correct c-to-f cell - * index map. This is upper_shifts[part][fboxi]. - **********************************************************/ - hypre_ClearIndex(stride); - hypre_CopyIndex(upper_shifts[part][fboxi], stride); - - hypre_SerialBoxLoop0Begin(ndim, loop_size); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(cindex, lindex[0], lindex[1], lindex[2]); - hypre_AddIndexes(cindex, start, 3, cindex); - - hypre_SStructGridFindBoxManEntry(cgrid_face, part, cindex, t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, matrix_type); - /* check if rank on proc before continuing */ - if ((rank <= cupper_ranks[part][var]) && - (rank >= clower_ranks[part][var])) - { - iFace[nFaces] = rank; - nFaces++; - - /* transform face index to cell index */ - hypre_AddIndexes(cindex, varoffsets[var], 3, cell_index); - - /* Refine the coarse cell to the upper fine index. The face will - be on the "lower end" fine cells, i.e., the slab box starting - with fine index cell_index. The fine edges will be on the - lower x of the fine cell, e.g., with fine cell (i,j,k), - y_iedge (i-1,j,k) & z_iedge (i-1,j,k). */ - hypre_StructMapCoarseToFine(cell_index, zero_index, - rfactor, findex); - hypre_AddIndexes(findex, stride, 3, findex); - - /* cell_index is refined to the upper fine index. Shift - back to the lower end, subtract (rfactor-1). */ - for (j = 0; j < ndim; j++) - { - findex[j] -= rfactor[j] - 1; - } - - /* x_iedges */ - ilower = findex[1] - 1; - for (k = 0; k < rfactor[2] - 1; k++) - { - for (j = 0; j < rfactor[0]; j++) - { - 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; - nFaces_iedges++; - } - } - - /* z_iedges */ - for (k = 0; k < rfactor[2]; k++) - { - for (j = 0; j < rfactor[0] - 1; j++) - { - 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; - nFaces_iedges++; - } - } - } /* if ((rank <= cupper_ranks[part][var]) && -(rank >= clower_ranks[part][var])) */ - } - - hypre_SerialBoxLoop0End(); - } /* hypre_ForBoxI(i, cboxes) */ - break; - } /* 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); - hypre_CopyBox(cbox, ©_box); - hypre_SubtractIndexes(hypre_BoxIMin(©_box), varoffsets[var], 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - /* determine which fine box cbox has coarsened from */ - fboxi = cfbox_mapping[part][i]; - fbox = hypre_BoxArrayBox(fboxes, fboxi); - - /********************************************************** - * determine the shift to get the correct c-to-f cell - * index map. This is upper_shifts[part][fboxi]. - **********************************************************/ - hypre_ClearIndex(stride); - hypre_CopyIndex(upper_shifts[part][fboxi], stride); - - hypre_SerialBoxLoop0Begin(ndim, loop_size); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(cindex, lindex[0], lindex[1], lindex[2]); - hypre_AddIndexes(cindex, start, 3, cindex); - - hypre_SStructGridFindBoxManEntry(cgrid_face, part, cindex, t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, matrix_type); - - /* check if rank on proc before continuing */ - if ((rank <= cupper_ranks[part][var]) && - (rank >= clower_ranks[part][var])) - { - iFace[nFaces] = rank; - nFaces++; - - /* transform face index to cell index */ - hypre_AddIndexes(cindex, varoffsets[var], 3, cell_index); - - /* Refine the coarse cell to the upper fine index. The face will - be on the "lower end" fine cells, i.e., the slab box starting - with fine index cell_index. The fine edges will be on the - lower x of the fine cell, e.g., with fine cell (i,j,k), - y_iedge (i-1,j,k) & z_iedge (i-1,j,k). */ - hypre_StructMapCoarseToFine(cell_index, zero_index, - rfactor, findex); - hypre_AddIndexes(findex, stride, 3, findex); - - /* cell_index is refined to the upper fine index. Shift - back to the lower end, subtract (rfactor-1). */ - for (j = 0; j < ndim; j++) - { - findex[j] -= rfactor[j] - 1; - } - - /* x_iedges */ - ilower = findex[2] - 1; - for (k = 0; k < rfactor[1] - 1; k++) - { - for (j = 0; j < rfactor[0]; j++) - { - 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; - nFaces_iedges++; - } - } - - /* y_iedges */ - for (k = 0; k < rfactor[1]; k++) - { - for (j = 0; j < rfactor[0] - 1; j++) - { - 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; - nFaces_iedges++; - } - } - } /* if ((rank <= cupper_ranks[part][var]) && -(rank >= clower_ranks[part][var])) */ - } - hypre_SerialBoxLoop0End(); - } /* hypre_ForBoxI(i, cboxes) */ - break; - } /* case 4: z_Faces-> x_iedges, y_iedges */ - - } /* switch(var) */ - } /* for (t= 0; t< Face_nvars; t++) */ - } /* for (part= 0; part< nparts; part++) */ - - HYPRE_IJMatrixSetValues(Face_iedge, nFaces, ncols_Faceedge, - (const HYPRE_BigInt*) iFace, (const HYPRE_BigInt*) jFace_edge, - (const HYPRE_Real*) vals_Faceedge); - HYPRE_IJMatrixAssemble((HYPRE_IJMatrix) Face_iedge); - - 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 */ - /*------------------------------------------------------------------------------ - * 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, memory_location); - - 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_nvars = hypre_SStructPGridNVars(p_cgrid); - - for (t = 0; t < Edge_nvars; t++) - { - var = Edge_vartypes[t]; - var_cgrid = hypre_SStructPGridSGrid(p_cgrid, t); - j = hypre_StructGridLocalSize(var_cgrid); - - switch (var) - { - case 2: /* 2-d, x_Face */ - { - m = rfactor[1]; - break; - } - - case 3: /* 2-d, y_Face */ - { - m = rfactor[0]; - break; - } - - case 5: /* 3-d, x_Edge */ - { - m = rfactor[0]; - break; - } - - case 6: /* 3-d, y_Edge */ - { - m = rfactor[1]; - break; - } - - case 7: /* 3-d, z_Edge */ - { - m = rfactor[2]; - break; - } - - default: - { - m = 0; - } - } - - for (i = nEdges; i < nEdges + j; i++) /*fill in the column size for Edge */ - { - ncols_Edgeiedge[i] = m; - k += m; - } - nEdges += j; - - } /* for (t= 0; t< Edge_nvars; t++) */ - } /* for (part= 0; part< nparts; part++) */ - - 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; - } - - /*--------------------------------------------------------------------------- - * Fill up the row/column ranks of Edge_edge. Since a refinement of the - * coarse edge index does not get the correct fine edge index, we need to - * map it to the cell grid. Recall, all variable grids are gotten by coarsening - * a cell centred grid. - * Loop over the coarse Cell grid - * a) for each Cell box, map to an Edge box - * b) for each coarse Edge on my proc , map it to a coarse cell - * (add the variable offset). - * c) refine the coarse cell and grab the fine cells that will contain - * the fine edges. - * d) map these fine cells to the fine edges. - *---------------------------------------------------------------------------*/ - - nEdges = 0; - nEdges_iedges = 0; - for (part = 0; part < nparts; part++) - { - p_cgrid = hypre_SStructGridPGrid(cgrid_edge, part); - 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++) - { - var = Edge_vartypes[t]; - var_cgrid = hypre_SStructPGridCellSGrid(p_cgrid); - cboxes = hypre_StructGridBoxes(var_cgrid); - - hypre_ForBoxI(i, cboxes) - { - cbox = hypre_BoxArrayBox(cboxes, i); - - /*------------------------------------------------------------------- - * extract the variable box by offsetting with var_offset. Note that - * this may lead to a bigger variable domain than is on this proc. - * Off-proc Edges will be checked to eliminate this problem. - *-------------------------------------------------------------------*/ - hypre_CopyBox(cbox, ©_box); - hypre_SubtractIndexes(hypre_BoxIMin(©_box), varoffsets[var], 3, - hypre_BoxIMin(©_box)); - hypre_BoxGetSize(©_box, loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - /* determine which fine box cbox has coarsened from */ - fboxi = cfbox_mapping[part][i]; - fbox = hypre_BoxArrayBox(fboxes, fboxi); - - /********************************************************** - * determine the shift to get the correct c-to-f cell - * index map. This is upper_shifts[part][fboxi]. - **********************************************************/ - hypre_ClearIndex(stride); - hypre_CopyIndex(upper_shifts[part][fboxi], stride); - - hypre_SerialBoxLoop0Begin(ndim, loop_size); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(cindex, lindex[0], lindex[1], lindex[2]); - hypre_AddIndexes(cindex, start, 3, cindex); - - /* row rank */ - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, cindex, t, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, - matrix_type); - - /* check if rank on proc before continuing */ - if ((rank <= cupper_ranks[part][var]) && - (rank >= clower_ranks[part][var])) - { - iEdge[nEdges] = rank; - nEdges++; - - hypre_AddIndexes(cindex, varoffsets[var], 3, cell_index); - - /* refine cindex and then map back to variable index */ - hypre_StructMapCoarseToFine(cell_index, zero_index, rfactor, - findex); - hypre_AddIndexes(findex, stride, 3, findex); - - /* cell_index is refined to the upper fine index. Shift - back to the lower end, subtract (rfactor-1). */ - for (j = 0; j < ndim; j++) - { - findex[j] -= rfactor[j] - 1; - } - - hypre_SubtractIndexes(findex, varoffsets[var], 3, var_index); - - switch (var) - { - case 2: /* 2-d, x_face */ - { - 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; - nEdges_iedges++; - - /* increment the x component to get the next one in the - refinement cell. */ - var_index[1]++; - } - break; - } - - case 3: /* 2-d, y_face */ - { - 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; - nEdges_iedges++; - - /* increment the y component to get the next one in the - refinement cell. */ - var_index[0]++; - } - break; - } - - case 5: /* 3-d, x_edge */ - { - 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; - nEdges_iedges++; - - /* increment the x component to get the next one in the - refinement cell. */ - var_index[0]++; - } - break; - } - - case 6: /* 3-d, y_edge */ - { - 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; - nEdges_iedges++; - - /* increment the y component to get the next one in the - refinement cell. */ - var_index[1]++; - } - break; - } - - case 7: /* 3-d, z_edge */ - { - 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; - nEdges_iedges++; - - /* increment the z component to get the next one in the - refinement cell. */ - var_index[2]++; - } - break; - } - } /* switch(var) */ - - } /* if ((rank <= cupper_ranks[part][var]) && - (rank >= clower_ranks[part][var])) */ - } - hypre_SerialBoxLoop0End(); - - } /* hypre_ForBoxI(i, cboxes) */ - } /* for (t= 0; t< Edge_nvars; t++) */ - } /* for (part= 0; part< nparts; part++) */ - - HYPRE_IJMatrixSetValues(Edge_iedge, nEdges, ncols_Edgeiedge, - (const HYPRE_BigInt*) iEdge, (const HYPRE_BigInt*) jEdge_iedge, - (const HYPRE_Real*) vals_Edgeiedge); - HYPRE_IJMatrixAssemble((HYPRE_IJMatrix) Edge_iedge); - - 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, 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, 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, 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, memory_location); - vals_ElementEdge = hypre_CTAlloc(HYPRE_Real, k, memory_location); - for (i = 0; i < k; i++) - { - vals_ElementEdge[i] = 1.0; - } - - /*--------------------------------------------------------------------------- - * 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++) - { - /* 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); - } - - 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_element, part); /* cell grid */ - var_cgrid = hypre_SStructPGridCellSGrid(p_cgrid); - cboxes = hypre_StructGridBoxes(var_cgrid); - - if (ndim == 3) - { - hypre_ForBoxI(i, cboxes) - { - cbox = hypre_BoxArrayBox(cboxes, i); - hypre_BoxGetSize(cbox, loop_size); - hypre_CopyIndex(hypre_BoxIMin(cbox), start); - - hypre_SerialBoxLoop0Begin(ndim, loop_size); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(cindex, lindex[0], lindex[1], lindex[2]); - hypre_AddIndexes(cindex, start, 3, cindex); - - /*------------------------------------------------------------- - * 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++) - { - var = Face_vartypes[t]; - - hypre_SStructGridFindBoxManEntry(cgrid_face, part, cindex, t, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, - matrix_type); - jElement_Face[nElements_Faces] = rank; - nElements_Faces++; - - hypre_SubtractIndexes(cindex, varoffsets[var], 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_face, part, var_index, t, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jElement_Face[nElements_Faces] = rank; - nElements_Faces++; - } - - } - hypre_SerialBoxLoop0End(); - } /* hypre_ForBoxI(i, cboxes) */ - } /* if (ndim == 3) */ - - /*------------------------------------------------------------------- - * jElement_Edge: - * 3-dim - * x_Edge: (i,j,k) then (i,j-1,k), (i,j-1,k-1), (i,j,k-1) - * y_Edge: (i,j,k) then (i-1,j,k), (i-1,j,k-1), (i,j,k-1) - * z_Edge: (i,j,k) then (i,j-1,k), (i-1,j-1,k), (i-1,j,k) - * - * 2-dim - * x_Edge or x_Face: (i,j) then (i-1,j) - * y_Edge or y_Face: (i,j) then (i,j-1) - *-------------------------------------------------------------------*/ - hypre_ForBoxI(i, cboxes) - { - cbox = hypre_BoxArrayBox(cboxes, i); - hypre_BoxGetSize(cbox, loop_size); - hypre_CopyIndex(hypre_BoxIMin(cbox), start); - - hypre_SerialBoxLoop0Begin(ndim, loop_size); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(cindex, lindex[0], lindex[1], lindex[2]); - hypre_AddIndexes(cindex, start, 3, cindex); - - for (t = 0; t < Edge_nvars; t++) - { - /* Edge (i,j,k) */ - var = Edge_vartypes[t]; - - switch (var) - { - case 2: /* x_Face= {(i,j), (i-1,j)} */ - { - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, cindex, t, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, - matrix_type); - jElement_Edge[nElements_Edges] = rank; - nElements_Edges++; - - hypre_SubtractIndexes(cindex, ishift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, t, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jElement_Edge[nElements_Edges] = rank; - nElements_Edges++; - break; - } - - case 3: /* y_Face= {(i,j), (i,j-1)} */ - { - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, cindex, t, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, - matrix_type); - jElement_Edge[nElements_Edges] = rank; - nElements_Edges++; - - hypre_SubtractIndexes(cindex, jshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, t, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jElement_Edge[nElements_Edges] = rank; - nElements_Edges++; - break; - } - - case 5: /* "/" x_Edge={(i,j,k),(i,j-1,k),(i,j-1,k-1),(i,j,k-1)} */ - { - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, cindex, t, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, - matrix_type); - jElement_Edge[nElements_Edges] = rank; - nElements_Edges++; - - hypre_SubtractIndexes(cindex, jshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, t, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jElement_Edge[nElements_Edges] = rank; - nElements_Edges++; - - hypre_SubtractIndexes(var_index, kshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, t, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jElement_Edge[nElements_Edges] = rank; - nElements_Edges++; - - hypre_AddIndexes(var_index, jshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, t, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jElement_Edge[nElements_Edges] = rank; - nElements_Edges++; - break; - } - - case 6: /* "-" y_Edge={(i,j,k),(i-1,j,k),(i-1,j,k-1),(i,j,k-1)}*/ - { - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, cindex, t, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, - matrix_type); - jElement_Edge[nElements_Edges] = rank; - nElements_Edges++; - - hypre_SubtractIndexes(cindex, ishift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, t, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jElement_Edge[nElements_Edges] = rank; - nElements_Edges++; - - hypre_SubtractIndexes(var_index, kshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, t, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jElement_Edge[nElements_Edges] = rank; - nElements_Edges++; - - hypre_AddIndexes(var_index, ishift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, t, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jElement_Edge[nElements_Edges] = rank; - nElements_Edges++; - break; - } - - case 7: /* "|" z_Edge={(i,j,k),(i,j-1,k),(i-1,j-1,k),(i-1,j,k)}*/ - { - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, cindex, t, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, - matrix_type); - jElement_Edge[nElements_Edges] = rank; - nElements_Edges++; - - hypre_SubtractIndexes(cindex, jshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, t, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jElement_Edge[nElements_Edges] = rank; - nElements_Edges++; - - hypre_SubtractIndexes(var_index, ishift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, t, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jElement_Edge[nElements_Edges] = rank; - nElements_Edges++; - - hypre_AddIndexes(var_index, jshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, t, - &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jElement_Edge[nElements_Edges] = rank; - nElements_Edges++; - break; - } - - } /* switch (var) */ - } /* for (t= 0; t< Edge_nvars; t++) */ - } - hypre_SerialBoxLoop0End(); - } /* hypre_ForBoxI(i, cboxes) */ - } /* for (part= 0; part< nparts; part++) */ - - if (ndim == 3) - { - HYPRE_IJMatrixSetValues(Element_Face, nElements, ncols_ElementFace, - (const HYPRE_BigInt*) iElement, (const HYPRE_BigInt*) jElement_Face, - (const HYPRE_Real*) vals_ElementFace); - HYPRE_IJMatrixAssemble((HYPRE_IJMatrix) Element_Face); - - 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, - (const HYPRE_BigInt*) iElement, (const HYPRE_BigInt*) jElement_Edge, - (const HYPRE_Real*) vals_ElementEdge); - HYPRE_IJMatrixAssemble((HYPRE_IJMatrix) Element_Edge); - - 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. - * For each fine edge row, we need to know if it is a edge, - * boundary edge, or face edge. Knowing this allows us to determine the - * structure and weights of the interpolation matrix. - * - * Scheme:A.Loop over contracted boxes of fine edge grid. - * For each fine edge ijk, - * 1) map it to a fine cell with the fine edge at the lower end - * of the box,e.g. x_edge[ijk] -> cell[i,j+1,k+1]. - * 2) coarsen the fine cell to obtain a coarse cell. Determine the - * location of the fine edge with respect to the coarse edges - * of this cell. Coarsening needed only when determining the - * column rank. - * - * Need to distinguish between 2-d and 3-d. - *-----------------------------------------------------------------------*/ - - /* count the row/col connections */ - 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. - * Will loop over the face & interior edges separately also. - * Since the weights for these edges will be used to determine the - * weights along the face edges, we need to retrieve these computed - * weights from vals_edgeEdge. Done by keeping a pointer of size nedges - * 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++) - { - 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]; - - 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; - boxoffset = hypre_CTAlloc(hypre_Index, n_boxoffsets, HYPRE_MEMORY_HOST); - suboffset = hypre_CTAlloc(hypre_Index, n_boxoffsets, HYPRE_MEMORY_HOST); - switch (var) - { - case 2: /* 2-d: x_face (vertical edges), stride=[rfactor[0],1,1] */ - { - hypre_SetIndex3(stride, rfactor[0], 1, 1); - hypre_CopyIndex(varoffsets[2], var_index); - - /* boxoffset shrink in the i direction */ - 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 */ - hypre_SetIndex3(hi_index, 1, 0, 0); - break; - } - - case 3: /* 2-d: y_face (horizontal edges), stride=[1,rfactor[1],1] */ - { - hypre_SetIndex3(stride, 1, rfactor[1], 1); - hypre_CopyIndex(varoffsets[3], var_index); - - /* boxoffset shrink in the j direction */ - 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 */ - hypre_SetIndex3(hi_index, 0, 1, 0); - break; - } - - case 5: /* 3-d: x_edge, stride=[1,rfactor[1],rfactor[2]] */ - { - hypre_SetIndex3(stride, 1, rfactor[1], rfactor[2]); - 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(suboffset[0], 0, 1, 0); - hypre_SetIndex3(suboffset[1], 0, 0, 1); - - /* extend loop_size by one in the stride direction */ - hypre_SetIndex3(hi_index, 0, 1, 1); - break; - } - - case 6: /* 3-d: y_edge, stride=[rfactor[0],1,rfactor[2]] */ - { - hypre_SetIndex3(stride, rfactor[0], 1, rfactor[2]); - 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(suboffset[0], 1, 0, 0); - hypre_SetIndex3(suboffset[1], 0, 0, 1); - - /* extend loop_size by one in the stride direction */ - hypre_SetIndex3(hi_index, 1, 0, 1); - break; - } - - case 7: /* 3-d: z_edge, stride=[rfactor[0],rfactor[1],1] */ - { - hypre_SetIndex3(stride, rfactor[0], rfactor[1], 1); - 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(suboffset[0], 1, 0, 0); - hypre_SetIndex3(suboffset[1], 0, 1, 0); - - /* extend loop_size by one in the stride direction */ - hypre_SetIndex3(hi_index, 1, 1, 0); - break; - } - } - - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - - /* vboxes inside the i'th cellbox */ - num_vboxes = n_CtoVbox[part][i]; - vboxnums = CtoVboxnums[part][i]; - - /* adjust the project cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - - /* the adjusted variable box may be bigger than the actually - variable box- variables that are shared may lead to smaller - variable boxes than the SubtractIndex produces. If the box - 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++) - { - hypre_SubtractIndexes(hypre_BoxIMin(©_box), suboffset[k], 3, - findex); - row_in = falseV; - for (p = 0; p < num_vboxes[t]; p++) - { - vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); - - if (hypre_IndexInBox(findex, vbox)) - { - hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in = trueV; - break; - } - } - /* not in any vbox */ - if (!row_in) - { - hypre_AddIndexes(hypre_BoxIMin(©_box), boxoffset[k], 3, - hypre_BoxIMin(©_box)); - } - } - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, stride, - loop_size); - - /* extend the loop_size so that upper boundary of the box are reached. */ - hypre_AddIndexes(loop_size, hi_index, 3, loop_size); - - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, stride, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k = 0; k < 3; k++) - { - findex[k] *= stride[k]; - } - hypre_AddIndexes(findex, start, 3, findex); - - hypre_SStructGridFindBoxManEntry(fgrid_edge, part, findex, t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, findex, &rank, matrix_type); - /* 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; - j++; - } - } - hypre_SerialBoxLoop1End(m); - - } /* hypre_ForBoxI */ - hypre_TFree(boxoffset, HYPRE_MEMORY_HOST); - hypre_TFree(suboffset, HYPRE_MEMORY_HOST); - } /* for (t= 0; t< nvars; t++) */ - } /* for (part= 0; part< nparts; part++) */ - - /*----------------------------------------------------------------------- - * Record the row ranks for the face edges. Only for 3-d. - * - * Loop over the face edges. - * Since the weights for these edges will be used to determine the - * weights along the face edges, we need to retrieve these computed - * weights form vals_edgeEdge. Done by keeping a pointer of size nedges - * that points to the location of the weight: - * pointer[rank of edge]= index location where weight resides. - *-----------------------------------------------------------------------*/ - if (ndim == 3) - { - 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); - - /* note that fboxes are the contracted CELL boxes. Will get the correct - variable grid extents. */ - 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++) - { - hypre_ClearIndex(boxoffset[t]); - hypre_IndexD(boxoffset[t], t) = rfactor[t] - 1; - } - - for (t = 0; t < Edge_nvars; t++) - { - var = Edge_vartypes[t]; - 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) - { - case 5: - { - /* 3-d x_edge, can be Y or Z_Face */ - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - - /* vboxes inside the i'th cellbox */ - num_vboxes = n_CtoVbox[part][i]; - vboxnums = CtoVboxnums[part][i]; - - /* adjust the contracted cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - - /****************************************************** - * Check the location of the shifted lower box index: - * x_edge-> Z_Face & Y_Face: - * Z_Face- contract in the z direction only if the - * processor interface is in the z direction - * Y_Face- contract in the y direction if the processor - * interface is in the y direction. - ******************************************************/ - 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++) - { - vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); - if (hypre_IndexInBox(findex, vbox)) - { - hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in = trueV; - break; - } - } - /* not in any vbox */ - if (!row_in) - { - hypre_AddIndexes(hypre_BoxIMin(©_box), boxoffset[2], 3, - hypre_BoxIMin(©_box)); - } - hypre_SubtractIndexes(hypre_BoxIMin(©_box), jshift, 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - /* increase the loop_size by one in the Z plane direction */ - loop_size[2]++; - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k = 0; k < 3; 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++) - { - hypre_CopyIndex(findex, var_index); - var_index[0] += p; - for (n = 1; n < rfactor[1]; n++) - { - var_index[1]++; - hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - /* still row rank may be outside the processor */ - if ((rank <= fupper_ranks[part][var]) && - (rank >= flower_ranks[part][var])) - { - iedgeEdge[j] = rank; - - /* Z_Face. Two coarse Edge connections. */ - ncols_edgeEdge[j] = 2; - j++; - - /* record index location */ - 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++) */ - } - hypre_SerialBoxLoop1End(m); - - /* Y_Face */ - hypre_CopyBox(cellbox, ©_box); - 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++) - { - vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); - if (hypre_IndexInBox(findex, vbox)) - { - hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in = trueV; - break; - } - } - /* not in any vbox */ - if (!row_in) - { - hypre_AddIndexes(hypre_BoxIMin(©_box), boxoffset[1], 3, - hypre_BoxIMin(©_box)); - } - hypre_SubtractIndexes(hypre_BoxIMin(©_box), kshift, 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - loop_size[1]++; - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k = 0; k < 3; 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++) - { - hypre_CopyIndex(findex, var_index); - var_index[0] += p; - for (n = 1; n < rfactor[2]; n++) - { - var_index[2]++; - hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - if ((rank <= fupper_ranks[part][var]) && - (rank >= flower_ranks[part][var])) - { - iedgeEdge[j] = rank; - - /* Y_Face. Two coarse Edge connections. */ - ncols_edgeEdge[j] = 2; - j++; - - /* record index location */ - bdryedge_location[rank - start_rank1] = l; - l += 2; - } - } /* for (n= 1; n< rfactor[2]; n++) */ - } /* for (p= 0; p< rfactor[0]; p++) */ - } - hypre_SerialBoxLoop1End(m); - } /* hypre_ForBoxI(i, fboxes) */ - - break; - } - - case 6: - { - /* 3-d y_edge, can be X or Z_Face */ - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - - /* vboxes inside the i'th cellbox */ - num_vboxes = n_CtoVbox[part][i]; - vboxnums = CtoVboxnums[part][i]; - - /* adjust the project cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - - /****************************************************** - * Check the location of the shifted lower box index: - * y_edge-> X_Face & Z_Face: - * Z_Face- contract in the z direction only if the - * processor interface is in the z direction - * X_Face- contract in the x direction if the processor - * interface is in the x direction. - ******************************************************/ - 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++) - { - vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); - if (hypre_IndexInBox(findex, vbox)) - { - hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in = trueV; - break; - } - } - /* not in any vbox */ - if (!row_in) - { - hypre_AddIndexes(hypre_BoxIMin(©_box), boxoffset[2], 3, - hypre_BoxIMin(©_box)); - } - hypre_SubtractIndexes(hypre_BoxIMin(©_box), ishift, 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - /* reset and then increase the loop_size by one in the Z_Face direction */ - loop_size[2]++; - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - - for (k = 0; k < 3; k++) - { - findex[k] *= rfactor[k]; - } - hypre_AddIndexes(findex, start, 3, findex); - - /* Z_Face */ - 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[0]++; - hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - if ((rank <= fupper_ranks[part][var]) && - (rank >= flower_ranks[part][var])) - { - iedgeEdge[j] = rank; - - /* Z_Face. Two coarse Edge connections. */ - ncols_edgeEdge[j] = 2; - j++; - - /* record index location */ - bdryedge_location[rank - start_rank1] = l; - l += 2; - } - } /* for (n= 1; n< rfactor[0]; n++) */ - } /* for (p= 0; p< rfactor[1]; p++) */ - } - hypre_SerialBoxLoop1End(m); - - /* X_Face */ - hypre_CopyBox(cellbox, ©_box); - 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++) - { - vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); - if (hypre_IndexInBox(findex, vbox)) - { - hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in = trueV; - break; - } - } - /* not in any vbox */ - if (!row_in) - { - hypre_AddIndexes(hypre_BoxIMin(©_box), boxoffset[0], 3, - hypre_BoxIMin(©_box)); - } - hypre_SubtractIndexes(hypre_BoxIMin(©_box), kshift, 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - loop_size[0]++; - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k = 0; k < 3; 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++) - { - hypre_CopyIndex(findex, var_index); - var_index[1] += p; - for (n = 1; n < rfactor[2]; n++) - { - var_index[2]++; - hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - if ((rank <= fupper_ranks[part][var]) && - (rank >= flower_ranks[part][var])) - { - iedgeEdge[j] = rank; - /* X_Face. Two coarse Edge connections. */ - ncols_edgeEdge[j] = 2; - j++; - - /* record index location */ - bdryedge_location[rank - start_rank1] = l; - l += 2; - } - } /* for (n= 1; n< rfactor[2]; n++) */ - } /* for (p= 0; p< rfactor[1]; p++) */ - } - hypre_SerialBoxLoop1End(m); - } /* hypre_ForBoxI(i, fboxes) */ - - break; - } - - case 7: - { - /* 3-d z_edge, can be interior, X or Y_Face, or Z_Edge */ - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - - /* vboxes inside the i'th cellbox */ - num_vboxes = n_CtoVbox[part][i]; - vboxnums = CtoVboxnums[part][i]; - - /* adjust the project cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - - /****************************************************** - * Check the location of the shifted lower box index: - * z_edge-> X_Face & Y_Face: - * X_Face- contract in the x direction if the processor - * interface is in the x direction. - * Y_Face- contract in the y direction if the processor - * interface is in the y direction. - ******************************************************/ - 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++) - { - vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); - if (hypre_IndexInBox(findex, vbox)) - { - hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in = trueV; - break; - } - } - /* not in any vbox */ - if (!row_in) - { - hypre_AddIndexes(hypre_BoxIMin(©_box), boxoffset[0], 3, - hypre_BoxIMin(©_box)); - } - hypre_SubtractIndexes(hypre_BoxIMin(©_box), jshift, 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - /* increase the loop_size by one in the X_Face direction */ - loop_size[0]++; - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - - for (k = 0; k < 3; k++) - { - findex[k] *= rfactor[k]; - } - - hypre_AddIndexes(findex, start, 3, findex); - - /****************************************************** - * Loop over the X_Face z_edges. - ******************************************************/ - 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[1]++; - hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - if ((rank <= fupper_ranks[part][var]) && - (rank >= flower_ranks[part][var])) - { - iedgeEdge[j] = rank; - - /* X_Face. Two coarse Edge connections. */ - ncols_edgeEdge[j] = 2; - j++; - - /* record index location */ - bdryedge_location[rank - start_rank1] = l; - l += 2; - } - } /* for (n= 1; n< rfactor[1]; n++) */ - } /* for (p= 0; p< rfactor[2]; p++) */ - } - hypre_SerialBoxLoop1End(m); - - /* Y_Face */ - hypre_CopyBox(cellbox, ©_box); - - 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++) - { - vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); - if (hypre_IndexInBox(findex, vbox)) - { - hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in = trueV; - break; - } - } - /* not in any vbox */ - if (!row_in) - { - hypre_AddIndexes(hypre_BoxIMin(©_box), boxoffset[1], 3, - hypre_BoxIMin(©_box)); - } - hypre_SubtractIndexes(hypre_BoxIMin(©_box), ishift, 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - loop_size[1]++; - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - - for (k = 0; k < 3; 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++) - { - hypre_CopyIndex(findex, var_index); - var_index[2] += p; - for (n = 1; n < rfactor[0]; n++) - { - var_index[0]++; - hypre_SStructGridFindBoxManEntry(fgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - if ((rank <= fupper_ranks[part][var]) && - (rank >= flower_ranks[part][var])) - { - iedgeEdge[j] = rank; - - /* Y_Face. Two coarse Edge connections. */ - ncols_edgeEdge[j] = 2; - j++; - - /* record index location */ - bdryedge_location[rank - start_rank1] = l; - l += 2; - } - } /* for (n= 1; n< rfactor[0]; n++) */ - } /* for (p= 0; p< rfactor[2]; p++) */ - } - hypre_SerialBoxLoop1End(m); - } /* hypre_ForBoxI(i, fboxes) */ - - break; - } - - } /* switch */ - } /* for (t= 0; t< Edge_nvars; t++) */ - - hypre_TFree(boxoffset, HYPRE_MEMORY_HOST); - } /* for (part= 0; part< nparts; part++) */ - } /* if (ndim == 3) */ - - 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); - - /* note that fboxes are the contracted CELL boxes. Will get the correct - variable grid extents. */ - fboxes = contract_fedgeBoxes[part]; - - for (t = 0; t < Edge_nvars; t++) - { - var = Edge_vartypes[t]; - 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) - { - case 2: - { - /* 2-d x_face = x_edge, can be interior */ - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - vbox = hypre_BoxArrayBox(box_array, i); - - /* adjust the contracted cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - hypre_SubtractIndexes(hypre_BoxIMin(©_box), varoffsets[var], 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k = 0; k < 3; k++) - { - findex[k] *= rfactor[k]; - } - hypre_AddIndexes(findex, start, 3, findex); - - /* get interior edges */ - for (p = 1; p < rfactor[0]; p++) - { - hypre_CopyIndex(findex, var_index); - 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; - - /* lies interior of Face. Four coarse Edge connection. */ - ncols_edgeEdge[j] = 4; - j++; - - var_index[1]++; - } /* for (n= 0; n< rfactor[1]; n++) */ - } /* for (p= 1; p< rfactor[0]; p++) */ - - } - hypre_SerialBoxLoop1End(m); - } /* hypre_ForBoxI(i, fboxes) */ - break; - } - - case 3: - { - /* 2-d y_face = y_edge, can be interior */ - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - vbox = hypre_BoxArrayBox(box_array, i); - - /* adjust the project cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - hypre_SubtractIndexes(hypre_BoxIMin(©_box), varoffsets[var], 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - - for (k = 0; k < 3; k++) - { - findex[k] *= rfactor[k]; - } - - hypre_AddIndexes(findex, start, 3, findex); - - /* get interior edges */ - for (p = 1; p < rfactor[1]; p++) - { - hypre_CopyIndex(findex, var_index); - 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; - - /* lies interior of Face. Four coarse Edge connection. */ - ncols_edgeEdge[j] = 4; - j++; - - var_index[0]++; - } /* for (n= 0; n< rfactor[0]; n++) */ - } /* for (p= 1; p< rfactor[1]; p++) */ - } - hypre_SerialBoxLoop1End(m); - } /* hypre_ForBoxI(i, fboxes) */ - break; - } - - case 5: - { - /* 3-d x_edge, can be only interior */ - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - vbox = hypre_BoxArrayBox(box_array, i); - - /* adjust the project cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - hypre_SubtractIndexes(hypre_BoxIMin(©_box), varoffsets[var], 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k = 0; k < 3; k++) - { - findex[k] *= rfactor[k]; - } - hypre_AddIndexes(findex, start, 3, findex); - - /* get interior edges */ - 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[1]++; - 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; - - /* Interior. Twelve coarse Edge connections. */ - 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]; - - } /* 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); - } /* for (p= 1; p< rfactor[2]; p++) */ - - } - hypre_SerialBoxLoop1End(m); - } /* hypre_ForBoxI(i, fboxes) */ - break; - } - - case 6: - { - /* 3-d y_edge, can be only interior */ - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - vbox = hypre_BoxArrayBox(box_array, i); - - /* adjust the contract cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - hypre_SubtractIndexes(hypre_BoxIMin(©_box), varoffsets[var], 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k = 0; k < 3; k++) - { - findex[k] *= rfactor[k]; - } - hypre_AddIndexes(findex, start, 3, findex); - - /* get interior edges */ - 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[0]++; - 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; - - /* Interior. Twelve coarse Edge connections. */ - 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]; - - } /* 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); - } /* for (p= 1; p< rfactor[2]; p++) */ - - } - hypre_SerialBoxLoop1End(m); - } /* hypre_ForBoxI(i, fboxes) */ - - break; - } - - case 7: - { - /* 3-d z_edge, can be only interior */ - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - vbox = hypre_BoxArrayBox(box_array, i); - - /* adjust the contracted cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - hypre_SubtractIndexes(hypre_BoxIMin(©_box), varoffsets[var], 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (k = 0; k < 3; k++) - { - findex[k] *= rfactor[k]; - } - hypre_AddIndexes(findex, start, 3, findex); - - /* get interior edges */ - 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[0]++; - 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; - - /* Interior. Twelve coarse Edge connections. */ - 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]; - - } /* 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); - } /* for (p= 1; p< rfactor[1]; p++) */ - - } - hypre_SerialBoxLoop1End(m); - } /* hypre_ForBoxI(i, fboxes) */ - break; - } - - } /* switch */ - } /* for (t= 0; t< Edge_nvars; t++) */ - } /* for (part= 0; part< nparts; part++) */ - - k = 0; - j = 0; - for (i = 0; i < nedges; i++) - { - if (ncols_edgeEdge[i]) - { - k += ncols_edgeEdge[i]; - j++; - } - } - vals_edgeEdge = hypre_CTAlloc(HYPRE_Real, k, memory_location); - jedge_Edge = hypre_CTAlloc(HYPRE_BigInt, k, memory_location); - size1 = j; - - /********************************************************************* - * Fill up the edge_Edge interpolation matrix. Interpolation weights - * are determined differently for each type of fine edges. - * - * fedge_on_CEdge: use geometric interpolation, i.e., length of - * edge ratio. - * - * fedge_on_agglomerate_face: box mg approach. Collapse the like - * variable stencil connections of the given face. Weighted linear - * interpolation of the fedge_on_CEdge values. - * - * fedge_in_agglomerate_interior: amge. - *********************************************************************/ - - /* loop over fedges aligning with the agglomerate coarse edges first. */ - 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 */ - - /* note that fboxes are the contracted CELL boxes. Will get the correct - variable grid extents. */ - fboxes = contract_fedgeBoxes[part]; - - 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; - boxoffset = hypre_CTAlloc(hypre_Index, n_boxoffsets, HYPRE_MEMORY_HOST); - suboffset = hypre_CTAlloc(hypre_Index, n_boxoffsets, HYPRE_MEMORY_HOST); - 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]; - - /* boxoffset shrink in the i direction */ - 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 */ - hypre_SetIndex3(hi_index, 1, 0, 0); - break; - } - - case 3: /* 2-d: y_face (horizontal edges), stride=[1,rfactor[1],1] - fCedge_ratio= 1.0/rfactor[0] */ - { - hypre_SetIndex3(stride, 1, rfactor[1], 1); - fCedge_ratio = 1.0 / rfactor[0]; - - /* boxoffset shrink in the j direction */ - 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 */ - hypre_SetIndex3(hi_index, 0, 1, 0); - break; - } - - case 5: /* 3-d: x_edge, stride=[1,rfactor[1],rfactor[2]] - fCedge_ratio= 1.0/rfactor[0] */ - { - hypre_SetIndex3(stride, 1, rfactor[1], rfactor[2]); - 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(suboffset[0], 0, 1, 0); - hypre_SetIndex3(suboffset[1], 0, 0, 1); - - /* extend loop_size by one in the stride direction */ - hypre_SetIndex3(hi_index, 0, 1, 1); - break; - } - - case 6: /* 3-d: y_edge, stride=[rfactor[0],1,rfactor[2]] - fCedge_ratio= 1.0/rfactor[1] */ - { - hypre_SetIndex3(stride, rfactor[0], 1, rfactor[2]); - 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(suboffset[0], 1, 0, 0); - hypre_SetIndex3(suboffset[1], 0, 0, 1); - - /* extend loop_size by one in the stride direction */ - hypre_SetIndex3(hi_index, 1, 0, 1); - break; - } - - case 7: /* 3-d: z_edge, stride=[rfactor[0],rfactor[1],1] - fCedge_ratio= 1.0/rfactor[2] */ - { - hypre_SetIndex3(stride, rfactor[0], rfactor[1], 1); - 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(suboffset[0], 1, 0, 0); - hypre_SetIndex3(suboffset[1], 0, 1, 0); - - /* extend loop_size by one in the stride direction */ - hypre_SetIndex3(hi_index, 1, 1, 0); - break; - } - default: - { - fCedge_ratio = 1.0; - } - } - - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - - /* vboxes inside the i'th cellbox */ - num_vboxes = n_CtoVbox[part][i]; - vboxnums = CtoVboxnums[part][i]; - - hypre_CopyIndex(Edge_cstarts[part][i], cstart); - - /* adjust the contracted cellbox to the variable box. - Note that some of the fboxes may be skipped because they - vanish. */ - hypre_CopyBox(cellbox, ©_box); - - 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++) - { - vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); - - if (hypre_IndexInBox(findex, vbox)) - { - hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in = trueV; - break; - } - } - /* not in any vbox */ - if (!row_in) - { - hypre_AddIndexes(hypre_BoxIMin(©_box), boxoffset[j], 3, - hypre_BoxIMin(©_box)); - - /* also modify cstart */ - hypre_AddIndexes(boxoffset[j], one_index, 3, boxoffset[j]); - hypre_StructMapFineToCoarse(boxoffset[j], zero_index, rfactor, - boxoffset[j]); - hypre_AddIndexes(cstart, boxoffset[j], 3, cstart); - } - } - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, stride, - loop_size); - - /* extend the loop_size so that upper boundary of the box are reached. */ - hypre_AddIndexes(loop_size, hi_index, 3, loop_size); - - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - /* note that the correct cbox corresponding to this non-vanishing - fbox is used. */ - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, stride, m); - { - HYPRE_BigInt big_j; - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - for (j = 0; j < 3; j++) - { - findex[j] *= stride[j]; - } - - hypre_AddIndexes(findex, start, 3, findex); - hypre_SStructGridFindBoxManEntry(fgrid_edge, part, findex, t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, findex, &big_j, matrix_type); - - /* still row p may be outside the processor- check to make sure in */ - if ((big_j <= fupper_ranks[part][var]) && (big_j >= flower_ranks[part][var])) - { - hypre_SubtractIndexes(findex, start, 3, findex); - - /* determine where the edge lies- coarsening required. */ - hypre_StructMapFineToCoarse(findex, zero_index, rfactor, - cindex); - hypre_AddIndexes(cindex, cstart, 3, cindex); - hypre_AddIndexes(findex, start, 3, findex); - - /* lies on coarse Edge. Coarse Edge connection: - var_index= cindex - subtract_index.*/ - hypre_SubtractIndexes(cindex, varoffsets[var], 3, var_index); - - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - vals_edgeEdge[k] = fCedge_ratio; - - k++; - } - } - hypre_SerialBoxLoop1End(m); - } /* hypre_ForBoxI */ - hypre_TFree(boxoffset, HYPRE_MEMORY_HOST); - hypre_TFree(suboffset, HYPRE_MEMORY_HOST); - } /* for (t= 0; t< nvars; t++) */ - } /* for (part= 0; part< nparts; part++) */ - - /* generate the face interpolation weights/info. Only for 3-d */ - if (ndim == 3) - { - /* Allocate memory to arrays for the tridiagonal system & solutions. - Take the maximum size needed. */ - i = rfactor[0] - 1; - for (j = 1; j < ndim; j++) - { - if (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); - 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); - - 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 */ - - /* note that fboxes are the contracted CELL boxes. Will get the correct - variable grid extents. */ - 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++) - { - hypre_ClearIndex(boxoffset[t]); - hypre_IndexD(boxoffset[t], t) = rfactor[t] - 1; - } - - 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) - { - case 5: - { - /* 3-d x_edge, can be Y or Z_Face */ - fCedge_ratio = 1.0 / rfactor[0]; - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - - /* vboxes inside the i'th cellbox */ - num_vboxes = n_CtoVbox[part][i]; - vboxnums = CtoVboxnums[part][i]; - - hypre_CopyIndex(Edge_cstarts[part][i], cstart); - - /* adjust the project cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - - /****************************************************** - * Check the location of the shifted lower box index: - * x_edge-> Z_Face & Y_Face: - * Z_Face- contract in the z direction only if the - * processor interface is in the z direction - * Y_Face- contract in the y direction if the processor - * interface is in the y direction. - ******************************************************/ - 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++) - { - vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); - if (hypre_IndexInBox(findex, vbox)) - { - hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in = trueV; - break; - } - } - /* not in any vbox */ - if (!row_in) - { - hypre_AddIndexes(hypre_BoxIMin(©_box), boxoffset[2], 3, - hypre_BoxIMin(©_box)); - - /* modify cstart */ - hypre_AddIndexes(cstart, kshift, 3, cstart); - } - hypre_SubtractIndexes(hypre_BoxIMin(©_box), jshift, 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - /* increase the loop_size by one in the Z plane direction */ - loop_size[2]++; - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - - /* because of rfactor striding, cindex= findex. But adjust - by cstart to get actually coarse edge. */ - hypre_CopyIndex(findex, cindex); - hypre_AddIndexes(cindex, cstart, 3, cindex); - - /* Will need the actual fine indices. */ - for (l = 0; l < ndim; l++) - { - findex[l] *= rfactor[l]; - } - hypre_AddIndexes(findex, start, 3, findex); - - hypre_SubtractIndexes(cindex, kshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank2, - matrix_type); - - hypre_SubtractIndexes(var_index, jshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - - /* 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++) - { - /* 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++) - { - face_w1[n] = 0.0; - face_w2[n] = 0.0; - } - - /****************************************************** - * grab the already computed lower-end edge weight. - * These are bdry agglomerate wgts that are pre-determined - * so that no communication is needed. - ******************************************************/ - - /* lower-end and upper-end edge weights */ - 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[1]++; - off_proc_flag[n] = - hypre_CollapseStencilToStencil(Aee, - fgrid_edge, - part, - t, - var_index, - 2, - 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]; - 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); - - /* place weights into vals_edgeEdge */ - 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 */ - k++; - - jedge_Edge[k] = rank2; - vals_edgeEdge[k] = face_w2[n - 1]; /* upper end connection */ - k++; - } - } - } /* for (p= 0; p< rfactor[0]; p++) */ - } - hypre_SerialBoxLoop1End(m); - - /* Y_Face */ - hypre_CopyIndex(Edge_cstarts[part][i], cstart); - hypre_CopyBox(cellbox, ©_box); - 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++) - { - vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); - if (hypre_IndexInBox(findex, vbox)) - { - hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in = trueV; - break; - } - } - /* not in any vbox */ - if (!row_in) - { - hypre_AddIndexes(hypre_BoxIMin(©_box), boxoffset[1], 3, - hypre_BoxIMin(©_box)); - - /* modify cstart */ - hypre_AddIndexes(cstart, jshift, 3, cstart); - } - hypre_SubtractIndexes(hypre_BoxIMin(©_box), kshift, 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - loop_size[1]++; - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - - /* because of rfactor striding, cindex= findex. But adjust - by cstart to get actually coarse edge. */ - hypre_CopyIndex(findex, cindex); - hypre_AddIndexes(cindex, cstart, 3, cindex); - - /* Will need the actual fine indices. */ - for (l = 0; l < ndim; l++) - { - findex[l] *= rfactor[l]; - } - hypre_AddIndexes(findex, start, 3, findex); - - /****************************************************** - * Y_Face. Two coarse Edge connections. - * x_Edge (i,j-1,k), (i,j-1,k-1) - ******************************************************/ - hypre_SubtractIndexes(cindex, jshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank2, - matrix_type); - - hypre_SubtractIndexes(var_index, kshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - - /* 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++) - { - /* 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++) - { - 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; - - /****************************************************** - * 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[2]++; - off_proc_flag[n] = - hypre_CollapseStencilToStencil(Aee, - fgrid_edge, - part, - t, - var_index, - 1, - 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]; - 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); - - /* place weights into vals_edgeEdge */ - 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 */ - k++; - - jedge_Edge[k] = rank2; - vals_edgeEdge[k] = face_w2[n - 1]; /* upper end connection */ - k++; - } - } - } /* for (p= 0; p< rfactor[0]; p++) */ - - } - hypre_SerialBoxLoop1End(m); - } /* hypre_ForBoxI(i, fboxes) */ - break; - } - - case 6: - { - /* 3-d y_edge, can be X or Z_Face */ - fCedge_ratio = 1.0 / rfactor[1]; - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - - /* vboxes inside the i'th cellbox */ - num_vboxes = n_CtoVbox[part][i]; - vboxnums = CtoVboxnums[part][i]; - - hypre_CopyIndex(Edge_cstarts[part][i], cstart); - - /* adjust the project cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - - /****************************************************** - * Check the location of the shifted lower box index: - * y_edge-> X_Face & Z_Face: - * Z_Face- contract in the z direction only if the - * processor interface is in the z direction - * X_Face- contract in the x direction if the processor - * interface is in the x direction. - ******************************************************/ - /* Z_Face */ - 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++) - { - vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); - if (hypre_IndexInBox(findex, vbox)) - { - hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in = trueV; - break; - } - } - /* not in any vbox */ - if (!row_in) - { - hypre_AddIndexes(hypre_BoxIMin(©_box), boxoffset[2], 3, - hypre_BoxIMin(©_box)); - - /* modify cstart */ - hypre_AddIndexes(cstart, kshift, 3, cstart); - } - hypre_SubtractIndexes(hypre_BoxIMin(©_box), ishift, 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - /* increase the loop_size by one in the Z plane direction */ - loop_size[2]++; - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - - /* because of rfactor striding, cindex= findex. But adjust - by cstart to get actually coarse edge. */ - hypre_CopyIndex(findex, cindex); - hypre_AddIndexes(cindex, cstart, 3, cindex); - - /* Will need the actual fine indices. */ - for (l = 0; l < ndim; l++) - { - findex[l] *= rfactor[l]; - } - hypre_AddIndexes(findex, start, 3, findex); - - hypre_SubtractIndexes(cindex, kshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank2, - matrix_type); - - hypre_SubtractIndexes(var_index, ishift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - - /* 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++) - { - /* 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++) - { - 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; - - /****************************************************** - * 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[0]++; - off_proc_flag[n] = - hypre_CollapseStencilToStencil(Aee, - fgrid_edge, - part, - t, - var_index, - 2, - 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]; - 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); - - /* place weights into vals_edgeEdge */ - 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 */ - k++; - - jedge_Edge[k] = rank2; - vals_edgeEdge[k] = face_w2[n - 1]; /* upper end connection */ - k++; - } - } - } /* for (p= 0; p< rfactor[1]; p++) */ - } - hypre_SerialBoxLoop1End(m); - - /* X_Face */ - hypre_CopyBox(cellbox, ©_box); - hypre_CopyIndex(Edge_cstarts[part][i], cstart); - - 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++) - { - vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); - if (hypre_IndexInBox(findex, vbox)) - { - hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in = trueV; - break; - } - } - /* not in any vbox */ - if (!row_in) - { - hypre_AddIndexes(hypre_BoxIMin(©_box), boxoffset[0], 3, - hypre_BoxIMin(©_box)); - - /* modify cstart */ - hypre_AddIndexes(cstart, ishift, 3, cstart); - } - hypre_SubtractIndexes(hypre_BoxIMin(©_box), kshift, 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - loop_size[0]++; - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - - /* because of rfactor striding, cindex= findex. But adjust - by cstart to get actually coarse edge. */ - hypre_CopyIndex(findex, cindex); - hypre_AddIndexes(cindex, cstart, 3, cindex); - - /* Will need the actual fine indices. */ - for (l = 0; l < ndim; l++) - { - findex[l] *= rfactor[l]; - } - hypre_AddIndexes(findex, start, 3, findex); - - /****************************************************** - * X_Face. Two coarse Edge connections. - * y_Edge (i-1,j,k), (i-1,j,k-1) - ******************************************************/ - hypre_SubtractIndexes(cindex, ishift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank2, - matrix_type); - - hypre_SubtractIndexes(var_index, kshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - - /* 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++) - { - /* 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++) - { - 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; - - /****************************************************** - * 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[2]++; - off_proc_flag[n] = - hypre_CollapseStencilToStencil(Aee, - fgrid_edge, - part, - t, - var_index, - 0, - 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]; - 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); - - /* place weights into vals_edgeEdge */ - 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 */ - k++; - - jedge_Edge[k] = rank2; - vals_edgeEdge[k] = face_w2[n - 1]; /* upper end connection */ - k++; - } - } - } /* for (p= 0; p< rfactor[1]; p++) */ - - } - hypre_SerialBoxLoop1End(m); - } /* hypre_ForBoxI(i, fboxes) */ - break; - } - - case 7: - { - /* 3-d z_edge, can be X or Y_Face */ - fCedge_ratio = 1.0 / rfactor[2]; - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - - /* vboxes inside the i'th cellbox */ - num_vboxes = n_CtoVbox[part][i]; - vboxnums = CtoVboxnums[part][i]; - - hypre_CopyIndex(Edge_cstarts[part][i], cstart); - - /* adjust the project cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - - /****************************************************** - * Check the location of the shifted lower box index: - * z_edge-> X_Face & Y_Face: - * X_Face- contract in the x direction if the processor - * interface is in the x direction. - * Y_Face- contract in the y direction if the processor - * interface is in the y direction. - ******************************************************/ - 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++) - { - vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); - if (hypre_IndexInBox(findex, vbox)) - { - hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in = trueV; - break; - } - } - /* not in any vbox */ - if (!row_in) - { - hypre_AddIndexes(hypre_BoxIMin(©_box), boxoffset[0], 3, - hypre_BoxIMin(©_box)); - - /* modify cstart */ - hypre_AddIndexes(cstart, ishift, 3, cstart); - } - hypre_SubtractIndexes(hypre_BoxIMin(©_box), jshift, 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - /* increase the loop_size by one in the X plane direction */ - loop_size[0]++; - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - - /* because of rfactor striding, cindex= findex. But adjust - by cstart to get actually coarse edge. */ - hypre_CopyIndex(findex, cindex); - hypre_AddIndexes(cindex, cstart, 3, cindex); - - /* Will need the actual fine indices. */ - for (l = 0; l < ndim; l++) - { - findex[l] *= rfactor[l]; - } - hypre_AddIndexes(findex, start, 3, findex); - - hypre_SubtractIndexes(cindex, ishift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank2, - matrix_type); - - hypre_SubtractIndexes(var_index, jshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - - /* 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++) - { - /* 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++) - { - 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; - - /****************************************************** - * 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[1]++; - off_proc_flag[n] = - hypre_CollapseStencilToStencil(Aee, - fgrid_edge, - part, - t, - var_index, - 0, - 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]; - 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); - - /* place weights into vals_edgeEdge */ - 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 */ - k++; - - jedge_Edge[k] = rank2; - vals_edgeEdge[k] = face_w2[n - 1]; /* upper end connection */ - k++; - } - } - } /* for (p= 0; p< rfactor[2]; p++) */ - } - hypre_SerialBoxLoop1End(m); - - /* Y_Face */ - hypre_CopyBox(cellbox, ©_box); - hypre_CopyIndex(Edge_cstarts[part][i], cstart); - - 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++) - { - vbox = hypre_BoxArrayBox(box_array, vboxnums[t][p]); - if (hypre_IndexInBox(findex, vbox)) - { - hypre_CopyIndex(findex, hypre_BoxIMin(©_box)); - row_in = trueV; - break; - } - } - /* not in any vbox */ - if (!row_in) - { - hypre_AddIndexes(hypre_BoxIMin(©_box), boxoffset[1], 3, - hypre_BoxIMin(©_box)); - /* modify cstart */ - hypre_AddIndexes(cstart, jshift, 3, cstart); - } - hypre_SubtractIndexes(hypre_BoxIMin(©_box), ishift, 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - loop_size[1]++; - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, m); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - - /* because of rfactor striding, cindex= findex. But adjust - by cstart to get actually coarse edge. */ - hypre_CopyIndex(findex, cindex); - hypre_AddIndexes(cindex, cstart, 3, cindex); - - /* Will need the actual fine indices. */ - for (l = 0; l < ndim; l++) - { - findex[l] *= rfactor[l]; - } - hypre_AddIndexes(findex, start, 3, findex); - - /********************************************************** - * Y_Face (i,j-1,k). Two like-var coarse Edge connections. - * z_Edge (i,j-1,k), (i-1,j-1,k) - **********************************************************/ - hypre_SubtractIndexes(cindex, jshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank2, - matrix_type); - - hypre_SubtractIndexes(var_index, ishift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - - /* 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++) - { - /* 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++) - { - 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; - - /****************************************************** - * 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[0]++; - off_proc_flag[n] = - hypre_CollapseStencilToStencil(Aee, - fgrid_edge, - part, - t, - var_index, - 1, - 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]; - 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); - - /* place weights into vals_edgeEdge */ - 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 */ - k++; - - jedge_Edge[k] = rank2; - vals_edgeEdge[k] = face_w2[n - 1]; /* upper end connection */ - k++; - } - } - } /* for (p= 0; p< rfactor[2]; p++) */ - - } - hypre_SerialBoxLoop1End(m); - } /* hypre_ForBoxI(i, fboxes) */ - break; - } - default: - { - fCedge_ratio = 1.0; - } - } /* switch */ - } /* for (t= 0; t< Edge_nvars; t++) */ - - hypre_TFree(boxoffset, HYPRE_MEMORY_HOST); - } /* for (part= 0; part< nparts; part++) */ - - hypre_TFree(upper, HYPRE_MEMORY_HOST); - hypre_TFree(lower, HYPRE_MEMORY_HOST); - hypre_TFree(diag, HYPRE_MEMORY_HOST); - hypre_TFree(face_w1, HYPRE_MEMORY_HOST); - hypre_TFree(face_w2, HYPRE_MEMORY_HOST); - hypre_TFree(off_proc_flag, HYPRE_MEMORY_HOST); - } /* if (ndim == 3) */ - - /* generate the interior interpolation weights/info */ - 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 */ - - /* note that fboxes are the contracted CELL boxes. Will get the correct - variable grid extents. */ - fboxes = contract_fedgeBoxes[part]; - - 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) - { - case 2: - { - /* 2-d x_face = x_edge, can be interior or on X_Edge */ - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - vbox = hypre_BoxArrayBox(box_array, i); - hypre_CopyIndex(Edge_cstarts[part][i], cstart); - - /* adjust the project cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - hypre_SubtractIndexes(hypre_BoxIMin(©_box), varoffsets[var], 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, r); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - - /***************************************************** - * Where the fine edge lies wrt the coarse edge: - * Since we stride by rfactor, lindex is - * the coarse index. No coarsening needed, i.e., - * cindex= findex. - * - * Loop over the interior fine edges in an agglomerate. - *****************************************************/ - for (p = 1; p < rfactor[0]; p++) - { - for (n = 0; n < rfactor[1]; n++) - { - hypre_CopyIndex(findex, cindex); - hypre_AddIndexes(cindex, cstart, 3, cindex); - - /*interior of Face. Extract the four coarse Edge - (x_Edge ijk & (i-1,j,k) and y_Edge ijk & (i,j-1,k) - column ranks. No weights determined. */ - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, cindex, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - hypre_SubtractIndexes(cindex, ishift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - /* y_Edges */ - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, cindex, - vartype_map[3], &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - hypre_SubtractIndexes(cindex, jshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - vartype_map[3], &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - } /* for (n= 0; n< rfactor[1]; n++) */ - } /* for (p= 1; p< rfactor[0]; p++) */ - - } - hypre_SerialBoxLoop1End(r); - } /* hypre_ForBoxI(i, fboxes) */ - - break; - } - - case 3: - { - /* 2-d y_face = y_edge, can be interior or on Y_Edge */ - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - vbox = hypre_BoxArrayBox(box_array, i); - hypre_CopyIndex(Edge_cstarts[part][i], cstart); - - /* adjust the project cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - hypre_SubtractIndexes(hypre_BoxIMin(©_box), varoffsets[var], 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, r); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - - /***************************************************** - * Where the fine edge lies wrt the coarse edge: - * Since we stride by rfactor, lindex is - * the coarse index. No coarsening needed, i.e., - * cindex= findex. - * - * Loop over the interior fine edges in an agglomerate. - *****************************************************/ - for (p = 1; p < rfactor[1]; p++) - { - for (n = 0; n < rfactor[0]; n++) - { - hypre_CopyIndex(findex, cindex); - hypre_AddIndexes(cindex, cstart, 3, cindex); - - /*lies interior of Face. Extract the four coarse Edge - (y_Edge ijk & (i,j-1,k) and x_Edge ijk & (i-1,j,k) - column ranks. No weights determined. */ - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, cindex, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - hypre_SubtractIndexes(cindex, jshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - /* x_Edges */ - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, cindex, - vartype_map[2], &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - hypre_SubtractIndexes(cindex, ishift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - vartype_map[2], &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - } /* for (n= 0; n< rfactor[0]; n++) */ - } /* for (p= 1; p< rfactor[1]; p++) */ - - } - hypre_SerialBoxLoop1End(r); - } /* hypre_ForBoxI(i, fboxes) */ - - break; - } - - case 5: - { - /* 3-d x_edge, must be interior */ - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - vbox = hypre_BoxArrayBox(box_array, i); - hypre_CopyIndex(Edge_cstarts[part][i], cstart); - - /* adjust the project cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - hypre_SubtractIndexes(hypre_BoxIMin(©_box), varoffsets[var], 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, r); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - - /***************************************************** - * Where the fine edge lies wrt the coarse edge: - * Since we stride by rfactor, lindex is - * the coarse index. No coarsening needed, i.e., - * cindex= findex. - * - * Loop over the interior fine edges in an agglomerate. - *****************************************************/ - for (p = 1; p < rfactor[2]; p++) - { - for (n = 1; n < rfactor[1]; n++) - { - for (m = 0; m < rfactor[0]; m++) - { - hypre_CopyIndex(findex, cindex); - hypre_AddIndexes(cindex, cstart, 3, cindex); - - /*********************************************** - * Interior. - * x_Edge ijk, (i,j-1,k), (i,j-1,k-1), (i,j,k-1) - * y_Edge ijk, (i-1,j,k), (i-1,j,k-1), (i,j,k-1) - * z_Edge ijk, (i-1,j,k), (i-1,j-1,k), (i,j-1,k) - * - * vals_edgeEdge's are not set. - ***********************************************/ - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, cindex, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - hypre_SubtractIndexes(cindex, jshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - hypre_SubtractIndexes(var_index, kshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - hypre_AddIndexes(var_index, jshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - /* y_Edge */ - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, cindex, - vartype_map[6], &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - hypre_SubtractIndexes(cindex, ishift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - vartype_map[6], &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - hypre_SubtractIndexes(var_index, kshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - vartype_map[6], &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - hypre_AddIndexes(var_index, ishift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - vartype_map[6], &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - /* z_Edge */ - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, cindex, - vartype_map[7], &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - hypre_SubtractIndexes(cindex, ishift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - vartype_map[7], &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - hypre_SubtractIndexes(var_index, jshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - vartype_map[7], &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - hypre_AddIndexes(var_index, ishift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - vartype_map[7], &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - } /* for (m= 0; m< rfactor[0]; m++) */ - } /* for (n= 1; n< rfactor[1]; n++) */ - } /* for (p= 1; p< rfactor[2]; p++) */ - } - hypre_SerialBoxLoop1End(r); - } /* hypre_ForBoxI(i, fboxes) */ - - break; - } - - case 6: - { - /* 3-d y_edge, must be interior */ - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - vbox = hypre_BoxArrayBox(box_array, i); - hypre_CopyIndex(Edge_cstarts[part][i], cstart); - - /* adjust the project cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - hypre_SubtractIndexes(hypre_BoxIMin(©_box), varoffsets[var], 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, r); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - - /***************************************************** - * Where the fine edge lies wrt the coarse edge: - * Since we stride by rfactor, lindex is - * the coarse index. No coarsening needed, i.e., - * cindex= findex. - * - * Loop over the interior fine edges in an agglomerate. - *****************************************************/ - for (p = 1; p < rfactor[2]; p++) - { - for (n = 1; n < rfactor[0]; n++) - { - for (m = 0; m < rfactor[1]; m++) - { - hypre_CopyIndex(findex, cindex); - hypre_AddIndexes(cindex, cstart, 3, cindex); - - /*********************************************** - * Interior. - * y_Edge ijk, (i-1,j,k), (i-1,j,k-1), (i,j,k-1) - * z_Edge ijk, (i-1,j,k), (i-1,j-1,k), (i,j-1,k) - * x_Edge ijk, (i,j-1,k), (i,j-1,k-1), (i,j,k-1) - * - * vals_edgeEdge's are not set. - ***********************************************/ - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, cindex, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - hypre_SubtractIndexes(cindex, ishift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - hypre_SubtractIndexes(var_index, kshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - hypre_AddIndexes(var_index, ishift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - /* z_Edge */ - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, cindex, - vartype_map[7], &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - hypre_SubtractIndexes(cindex, ishift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - vartype_map[7], &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - hypre_SubtractIndexes(var_index, jshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - vartype_map[7], &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - hypre_AddIndexes(var_index, ishift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - vartype_map[7], &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - /* x_Edge */ - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, cindex, - vartype_map[5], &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - hypre_SubtractIndexes(cindex, jshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - vartype_map[5], &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - hypre_SubtractIndexes(var_index, kshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - vartype_map[5], &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - hypre_AddIndexes(var_index, jshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - vartype_map[5], &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - } /* for (m= 0; m< rfactor[1]; m++) */ - } /* for (n= 1; n< rfactor[0]; n++) */ - } /* for (p= 1; p< rfactor[2]; p++) */ - - } - hypre_SerialBoxLoop1End(r); - } /* hypre_ForBoxI(i, fboxes) */ - - break; - } - - case 7: - { - /* 3-d z_edge, only the interior */ - hypre_ForBoxI(i, fboxes) - { - cellbox = hypre_BoxArrayBox(fboxes, i); - vbox = hypre_BoxArrayBox(box_array, i); - hypre_CopyIndex(Edge_cstarts[part][i], cstart); - - /* adjust the project cellbox to the variable box */ - hypre_CopyBox(cellbox, ©_box); - hypre_SubtractIndexes(hypre_BoxIMin(©_box), varoffsets[var], 3, - hypre_BoxIMin(©_box)); - - hypre_BoxGetSize(©_box, loop_size); - hypre_StructMapFineToCoarse(loop_size, zero_index, rfactor, - loop_size); - hypre_CopyIndex(hypre_BoxIMin(©_box), start); - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - ©_box, start, rfactor, r); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(findex, lindex[0], lindex[1], lindex[2]); - - /***************************************************** - * Where the fine edge lies wrt the coarse edge: - * Since we stride by rfactor, lindex is - * the coarse index. No coarsening needed, i.e., - * cindex= findex. - * - * Loop over the interior fine edges in an agglomerate. - *****************************************************/ - for (p = 1; p < rfactor[1]; p++) - { - for (n = 1; n < rfactor[0]; n++) - { - for (m = 0; m < rfactor[2]; m++) - { - hypre_CopyIndex(findex, cindex); - hypre_AddIndexes(cindex, cstart, 3, cindex); - - /************************************************* - * Interior. - * z_Edge ijk, (i-1,j,k), (i-1,j-1,k), (i,j-1,k) - * x_Edge ijk, (i,j-1,k), (i,j-1,k-1), (i,j,k-1) - * y_Edge ijk, (i-1,j,k), (i-1,j,k-1), (i,j,k-1) - * - * vals_edgeEdge's are not set. - *************************************************/ - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, cindex, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - hypre_SubtractIndexes(cindex, ishift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - hypre_SubtractIndexes(var_index, jshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - hypre_AddIndexes(var_index, ishift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - t, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - /* x_Edge */ - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, cindex, - vartype_map[5], &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - hypre_SubtractIndexes(cindex, jshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - vartype_map[5], &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - hypre_SubtractIndexes(var_index, kshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - vartype_map[5], &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - hypre_AddIndexes(var_index, jshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - vartype_map[5], &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - /* y_Edge */ - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, cindex, - vartype_map[6], &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, cindex, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - hypre_SubtractIndexes(cindex, ishift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - vartype_map[6], &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - hypre_SubtractIndexes(var_index, kshift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - vartype_map[6], &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - - hypre_AddIndexes(var_index, ishift, 3, var_index); - hypre_SStructGridFindBoxManEntry(cgrid_edge, part, var_index, - vartype_map[6], &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, var_index, &rank, - matrix_type); - jedge_Edge[k] = rank; - k++; - } /* for (m= 0; m< rfactor[2]; m++) */ - } /* for (n= 1; n< rfactor[0]; n++) */ - } /* for (p= 1; p< rfactor[1]; p++) */ - - } - hypre_SerialBoxLoop1End(r); - } /* hypre_ForBoxI(i, fboxes) */ - - break; - } - - } /* switch */ - } /* for (t= 0; t< Edge_nvars; t++) */ - } /* for (part= 0; part< nparts; part++) */ - hypre_TFree(bdryedge_location, HYPRE_MEMORY_HOST); - - HYPRE_IJMatrixSetValues(edge_Edge, size1, ncols_edgeEdge, - (const HYPRE_BigInt*) iedgeEdge, (const HYPRE_BigInt*) jedge_Edge, - (const HYPRE_Real*) vals_edgeEdge); - HYPRE_IJMatrixAssemble((HYPRE_IJMatrix) edge_Edge); - - 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++) - { - p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); - Edge_nvars = hypre_SStructPGridNVars(p_fgrid); - - var_fgrid = hypre_SStructPGridCellSGrid(p_fgrid); - fboxes = hypre_StructGridBoxes(var_fgrid); - hypre_ForBoxI(j, fboxes) - { - for (t = 0; t < Edge_nvars; t++) - { - hypre_TFree(CtoVboxnums[part][j][t], HYPRE_MEMORY_HOST); - } - hypre_TFree(n_CtoVbox[part][j], HYPRE_MEMORY_HOST); - hypre_TFree(CtoVboxnums[part][j], HYPRE_MEMORY_HOST); - } - hypre_TFree(n_CtoVbox[part], HYPRE_MEMORY_HOST); - hypre_TFree(CtoVboxnums[part], HYPRE_MEMORY_HOST); - } - hypre_TFree(n_CtoVbox, HYPRE_MEMORY_HOST); - hypre_TFree(CtoVboxnums, HYPRE_MEMORY_HOST); - - for (part = 0; part < nparts; part++) - { - p_fgrid = hypre_SStructGridPGrid(fgrid_edge, part); - var_fgrid = hypre_SStructPGridCellSGrid(p_fgrid); - fboxes = hypre_StructGridBoxes(var_fgrid); - - hypre_BoxArrayDestroy(contract_fedgeBoxes[part]); - hypre_TFree(Edge_cstarts[part], HYPRE_MEMORY_HOST); - hypre_TFree(upper_shifts[part], HYPRE_MEMORY_HOST); - hypre_TFree(lower_shifts[part], HYPRE_MEMORY_HOST); - hypre_TFree(cfbox_mapping[part], HYPRE_MEMORY_HOST); - hypre_TFree(fcbox_mapping[part], HYPRE_MEMORY_HOST); - hypre_TFree(fupper_ranks[part], HYPRE_MEMORY_HOST); - hypre_TFree(flower_ranks[part], HYPRE_MEMORY_HOST); - hypre_TFree(cupper_ranks[part], HYPRE_MEMORY_HOST); - hypre_TFree(clower_ranks[part], HYPRE_MEMORY_HOST); - } - - hypre_TFree(contract_fedgeBoxes, HYPRE_MEMORY_HOST); - hypre_TFree(Edge_cstarts, HYPRE_MEMORY_HOST); - hypre_TFree(upper_shifts, HYPRE_MEMORY_HOST); - hypre_TFree(lower_shifts, HYPRE_MEMORY_HOST); - hypre_TFree(cfbox_mapping, HYPRE_MEMORY_HOST); - hypre_TFree(fcbox_mapping, HYPRE_MEMORY_HOST); - hypre_TFree(fupper_ranks, HYPRE_MEMORY_HOST); - hypre_TFree(flower_ranks, HYPRE_MEMORY_HOST); - hypre_TFree(cupper_ranks, HYPRE_MEMORY_HOST); - hypre_TFree(clower_ranks, HYPRE_MEMORY_HOST); - - hypre_TFree(varoffsets, HYPRE_MEMORY_HOST); - hypre_TFree(vartype_map, HYPRE_MEMORY_HOST); - - if (ndim > 2) - { - (PTopology -> Face_iedge) = Face_iedge; - (PTopology -> Element_Face) = Element_Face; - } - (PTopology -> Element_iedge) = Element_iedge; - (PTopology -> Edge_iedge) = Edge_iedge; - (PTopology -> Element_Edge) = Element_Edge; - - return edge_Edge; -} - -/*-------------------------------------------------------------------------- - * hypre_CollapseStencilToStencil: Collapses 3d stencil shape & values to - * a 2d 3-point stencil: collapsed_vals= [ldiag diag udiag]. - * Algo: - * 1) Given the collapsing direction & the collapsed stencil pattern, - * group the ranks into three collapsed sets: diag_ranks, ldiag_ranks, - * udiag_ranks. - * 2) concatenate these sets, marking the set location - * 3) qsort the concatenated set and the col_inds - * 4) search compare the two sorted arrays to compute the collapsed vals. - * - * Example, suppose collapsing to y_edges. Then the new_stencil pattern - * is [n c s]^t and we need to collapse in the x direction to get this - * 3-pt stencil: collapse_dir= 0 & new_stencil_dir= 1. - *--------------------------------------------------------------------------*/ -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 ierr = 0; - - HYPRE_Int matrix_type = HYPRE_PARCSR; - HYPRE_BigInt start_rank = hypre_ParCSRMatrixFirstRowIndex(Aee); - HYPRE_BigInt end_rank = hypre_ParCSRMatrixLastRowIndex(Aee); - - hypre_BoxManEntry *entry; - - HYPRE_BigInt *ranks; - HYPRE_Int *marker; /* marker to record the rank groups */ - HYPRE_Int max_ranksize = 9; - - HYPRE_Real *collapsed_vals; - - hypre_Index index1, index2; - - HYPRE_Int size; - HYPRE_BigInt *col_inds, *col_inds2; - HYPRE_Real *values; - HYPRE_BigInt rank, row_rank; - HYPRE_Int *swap_inds; - - HYPRE_Int i, j, m, centre, found; - HYPRE_Int getrow_ierr; - HYPRE_Int cnt; - - /* create the collapsed stencil coefficients. Three components. */ - 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 - TO GIVE SOMETHING MORE REASONABLE. */ - hypre_SStructGridFindBoxManEntry(grid, part, pt_location, var, &entry); - hypre_SStructBoxManEntryGetGlobalRank(entry, pt_location, &rank, matrix_type); - if (rank < start_rank || rank > end_rank) - { - collapsed_vals[1] = 1.0; - *collapsed_vals_ptr = collapsed_vals; - ierr = 1; - return ierr; - } - - /* Extract the ranks of the collapsed stencil pattern. Since only like-var - 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); - - cnt = 0; - centre = 0; - for (j = -1; j <= 1; j++) - { - hypre_CopyIndex(pt_location, index1); - index1[new_stencil_dir] += j; - - for (i = -1; i <= 1; i++) - { - hypre_CopyIndex(index1, index2); - 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; - - /* mark centre component- entry!=NULL always */ - if ( (!i) && (!j) ) - { - centre = cnt; - } - cnt++; - } - } - } - - /* 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); - 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[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); - - /* search for values to collapse */ - m = 0; - for (i = 0; i < cnt; i++) - { - found = 0; - while (!found) - { - if (ranks[i] != col_inds2[m]) - { - m++; - } - else - { - collapsed_vals[marker[i]] += values[swap_inds[m]]; - m++; - break; /* break out of while loop */ - } - } /* while (!found) */ - } /* for (i= 0; i< cnt; i++) */ - - HYPRE_ParCSRMatrixRestoreRow((HYPRE_ParCSRMatrix) Aee, row_rank, &size, - &col_inds, &values); - - hypre_TFree(col_inds2, HYPRE_MEMORY_HOST); - hypre_TFree(ranks, HYPRE_MEMORY_HOST); - hypre_TFree(marker, HYPRE_MEMORY_HOST); - hypre_TFree(swap_inds, HYPRE_MEMORY_HOST); - - *collapsed_vals_ptr = collapsed_vals; - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_TriDiagSolve: Direct tridiagonal solve - *------------------------------------------------------------------------*/ -HYPRE_Int -hypre_TriDiagSolve(HYPRE_Real *diag, - HYPRE_Real *upper, - HYPRE_Real *lower, - HYPRE_Real *rhs, - HYPRE_Int size) -{ - HYPRE_Int ierr = 0; - - HYPRE_Int i, size1; - HYPRE_Real *copy_diag; - HYPRE_Real multiplier; - - 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[i] = diag[i]; - } - - /* forward substitution */ - 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]; - } - - /* backward substitution */ - rhs[size1] /= copy_diag[size1]; - for (i = size1 - 1; i >= 0; i--) - { - rhs[i] = (rhs[i] - upper[i] * rhs[i + 1]) / copy_diag[i]; - } - - hypre_TFree(copy_diag, HYPRE_MEMORY_HOST); - - return ierr; -} diff --git a/src/sstruct_ls/maxwell_solve.c b/src/sstruct_ls/maxwell_solve.c deleted file mode 100644 index d732359a8e..0000000000 --- a/src/sstruct_ls/maxwell_solve.c +++ /dev/null @@ -1,783 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_sstruct_ls.h" - -/*-------------------------------------------------------------------------- - * hypre_MaxwellSolve- note that there is no input operator Aee. We assume - * that maxwell_vdata has the exact operators. This prevents the need to - * to recompute Ann in the solve phase. However, we do allow the f_edge & - * u_edge to change per call. - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_MaxwellSolve( void *maxwell_vdata, - hypre_SStructMatrix *A_in, - hypre_SStructVector *f, - hypre_SStructVector *u ) -{ - HYPRE_UNUSED_VAR(A_in); - - hypre_MaxwellData *maxwell_data = (hypre_MaxwellData *) maxwell_vdata; - - hypre_ParVector *f_edge; - hypre_ParVector *u_edge; - - HYPRE_Int max_iter = maxwell_data-> max_iter; - HYPRE_Real tol = maxwell_data-> tol; - HYPRE_Int rel_change = maxwell_data-> rel_change; - HYPRE_Int zero_guess = maxwell_data-> zero_guess; - HYPRE_Int npre_relax = maxwell_data-> num_pre_relax; - HYPRE_Int npost_relax = maxwell_data-> num_post_relax; - - hypre_ParCSRMatrix **Ann_l = maxwell_data-> Ann_l; - hypre_ParCSRMatrix **Pn_l = maxwell_data-> Pn_l; - hypre_ParCSRMatrix **RnT_l = maxwell_data-> RnT_l; - hypre_ParVector **bn_l = maxwell_data-> bn_l; - hypre_ParVector **xn_l = maxwell_data-> xn_l; - hypre_ParVector **resn_l = maxwell_data-> resn_l; - hypre_ParVector **en_l = maxwell_data-> en_l; - 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 *nomega = maxwell_data-> nomega; - HYPRE_Int nrelax_type = maxwell_data-> nrelax_type; - HYPRE_Int node_numlevs = maxwell_data-> node_numlevels; - - hypre_ParCSRMatrix *Tgrad = maxwell_data-> Tgrad; - hypre_ParCSRMatrix *T_transpose = maxwell_data-> T_transpose; - - hypre_ParCSRMatrix **Aen_l = maxwell_data-> Aen_l; - HYPRE_Int en_numlevs = maxwell_data-> en_numlevels; - - hypre_ParCSRMatrix **Aee_l = maxwell_data-> Aee_l; - hypre_IJMatrix **Pe_l = maxwell_data-> Pe_l; - hypre_IJMatrix **ReT_l = maxwell_data-> ReT_l; - hypre_ParVector **be_l = maxwell_data-> be_l; - hypre_ParVector **xe_l = maxwell_data-> xe_l; - hypre_ParVector **rese_l = maxwell_data-> rese_l; - hypre_ParVector **ee_l = maxwell_data-> ee_l; - 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 *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 logging = maxwell_data-> logging; - HYPRE_Real *norms = maxwell_data-> norms; - HYPRE_Real *rel_norms = maxwell_data-> rel_norms; - - HYPRE_Int relax_local, cycle_param; - - HYPRE_Real b_dot_b = 0, r_dot_r, eps = 0; - HYPRE_Real e_dot_e = 0, x_dot_x = 1; - - HYPRE_Int i, j; - HYPRE_Int level; - - /* added for the relaxation routines */ - hypre_ParVector *ze = NULL; - -#if !defined(HYPRE_USING_CUDA) && !defined(HYPRE_USING_HIP) &&!defined(HYPRE_USING_SYCL) - /* GPU impl. needs ze */ - if (hypre_NumThreads() > 1) -#endif - { - /* 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_ParVectorInitialize(ze); - } - - hypre_BeginTiming(maxwell_data-> time_index); - - hypre_SStructVectorConvert(f, &f_edge); - 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; - - /* 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; - - (maxwell_data-> num_iterations) = 0; - /* if max_iter is zero, return */ - if (max_iter == 0) - { - /* if using a zero initial guess, return zero */ - if (zero_guess) - { - hypre_ParVectorSetConstantValues(xe_l[0], 0.0); - } - - hypre_EndTiming(maxwell_data -> time_index); - - return hypre_error_flag; - } - - /* part of convergence check */ - if (tol > 0.0) - { - /* eps = (tol^2) */ - 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) - { - hypre_ParVectorSetConstantValues(xe_l[0], 0.0); - if (logging > 0) - { - norms[0] = 0.0; - rel_norms[0] = 0.0; - } - - hypre_EndTiming(maxwell_data -> time_index); - - return hypre_error_flag; - } - } - - /*----------------------------------------------------- - * Do V-cycles: - * For each index l, "fine" = (l-1), "coarse" = l - * down cycle: - * a) smooth nodes (Ann) - * b) update edge residual (Ane) - * c) smooth edges (Aee) - * d) restrict updated node and edge residuals - * up cycle: - * a) interpolate node and edges separately - * a) smooth nodes - * b) update edge residual - * c) smooth edges - * - * solution update: - * edge_sol= edge_sol + T*node_sol - *-----------------------------------------------------*/ - for (i = 0; i < max_iter; i++) - { - /* fine grid pre_relaxation */ - for (j = 0; j < npre_relax; j++) - { - hypre_ParVectorCopy(bn_l[0], nVtemp_l[0]); - hypre_ParCSRMatrixMatvecT(-1.0, Aen_l[0], xe_l[0], - 1.0, nVtemp_l[0]); - - hypre_BoomerAMGRelaxIF(Ann_l[0], - nVtemp_l[0], - nCF_marker_l[0], - nrelax_type, - relax_local, - cycle_param, - nrelax_weight[0], - nomega[0], - NULL, - xn_l[0], - nVtemp2_l[0], - ze); - - /* 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]); - hypre_ParVectorZeroBCValues(eVtemp_l[0], BdryRanks_l[0], - BdryRanksCnts_l[0]); - - hypre_BoomerAMGRelaxIF(Aee_l[0], - eVtemp_l[0], - eCF_marker_l[0], - erelax_type, - relax_local, - cycle_param, - erelax_weight[0], - eomega[0], - NULL, - xe_l[0], - eVtemp2_l[0], - ze); - } /* for (j = 0; j < npre_relax; j++) */ - - /* compute fine grid residual. Note the edge residual of - the block system is the residual of the actual edge equations - itself. */ - hypre_ParVectorCopy(bn_l[0], resn_l[0]); - hypre_ParCSRMatrixMatvec(-1.0, Ann_l[0], xn_l[0], 1.0, resn_l[0]); - hypre_ParCSRMatrixMatvecT(-1.0, Aen_l[0], xe_l[0], 1.0, resn_l[0]); - - hypre_ParVectorCopy(be_l[0], rese_l[0]); - hypre_ParCSRMatrixMatvec(-1.0, Aee_l[0], xe_l[0], 1.0, rese_l[0]); - hypre_ParCSRMatrixMatvec(-1.0, Aen_l[0], xn_l[0], 1.0, rese_l[0]); - hypre_ParVectorZeroBCValues(rese_l[0], BdryRanks_l[0], BdryRanksCnts_l[0]); - - /* convergence check */ - if (tol > 0.0) - { - r_dot_r = hypre_ParVectorInnerProd(rese_l[0], rese_l[0]); - - if (logging > 0) - { - norms[i] = hypre_sqrt(r_dot_r); - if (b_dot_b > 0) - { - 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 (rel_change) - { - if ((e_dot_e / x_dot_x) < eps) - { - break; - } - } - else - { - break; - } - } - } - - if (en_numlevs > 1) - { - hypre_ParCSRMatrixMatvecT(1.0, RnT_l[0], resn_l[0], 0.0, - bn_l[1]); - - hypre_ParCSRMatrixMatvecT(1.0, - (hypre_ParCSRMatrix *) hypre_IJMatrixObject(ReT_l[0]), - rese_l[0], 0.0, be_l[1]); - - hypre_ParVectorZeroBCValues(be_l[1], BdryRanks_l[1], - BdryRanksCnts_l[1]); - - /* zero off initial guess for the next level */ - hypre_ParVectorSetConstantValues(xn_l[1], 0.0); - hypre_ParVectorSetConstantValues(xe_l[1], 0.0); - - } /* if (en_numlevs > 1) */ - - for (level = 1; level <= en_numlevs - 2; level++) - { - /*----------------------------------------------- - * Down cycle - *-----------------------------------------------*/ - for (j = 0; j < npre_relax; j++) - { - hypre_ParVectorCopy(bn_l[level], nVtemp_l[level]); - if (j) - { - hypre_ParCSRMatrixMatvecT(-1.0, Aen_l[level], - xe_l[level], 1.0, nVtemp_l[level]); - } - hypre_BoomerAMGRelaxIF(Ann_l[level], - nVtemp_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); - - /* update edge right-hand fe_l= fe_l-Aen_l*xn_l[level] */ - hypre_ParVectorCopy(be_l[level], eVtemp_l[level]); - hypre_ParCSRMatrixMatvec(-1.0, Aen_l[level], - xn_l[level], 1.0, eVtemp_l[level]); - hypre_ParVectorZeroBCValues(eVtemp_l[level], BdryRanks_l[level], - BdryRanksCnts_l[level]); - - hypre_BoomerAMGRelaxIF(Aee_l[level], - eVtemp_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(bn_l[level], resn_l[level]); - hypre_ParCSRMatrixMatvec(-1.0, Ann_l[level], xn_l[level], - 1.0, resn_l[level]); - - hypre_ParCSRMatrixMatvecT(-1.0, Aen_l[level], xe_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]); - hypre_ParCSRMatrixMatvec(-1.0, Aen_l[level], xn_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]); - - 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(xn_l[level + 1], 0.0); - hypre_ParVectorSetConstantValues(xe_l[level + 1], 0.0); - - } /* for (level = 0; level<= en_numlevels-2; level++) */ - - /*---------------------------------------------------------------- - * For the lowest edge-node level, solve using relaxation or - * cycling down if there are more than en_numlevels levels for - * one of the node or edge dofs. - *----------------------------------------------------------------*/ - level = en_numlevs - 1; - - /* npre_relax if not the coarsest level. Otherwise, relax once.*/ - if ( (en_numlevs != edge_numlevs) - || (en_numlevs != node_numlevs) ) - { - for (j = 0; j < npre_relax; j++) - { - hypre_ParVectorCopy(bn_l[level], nVtemp_l[level]); - if (j) - { - hypre_ParCSRMatrixMatvecT(-1.0, Aen_l[level], - xe_l[level], 1.0, nVtemp_l[level]); - } - hypre_BoomerAMGRelaxIF(Ann_l[level], - nVtemp_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); - - /* update edge right-hand fe_l= fe_l-Aen_l*xn_l[level] */ - hypre_ParVectorCopy(be_l[level], eVtemp_l[level]); - hypre_ParCSRMatrixMatvec(-1.0, Aen_l[level], - xn_l[level], 1.0, eVtemp_l[level]); - - hypre_ParVectorZeroBCValues(eVtemp_l[level], BdryRanks_l[level], - BdryRanksCnts_l[level]); - - hypre_BoomerAMGRelaxIF(Aee_l[level], - eVtemp_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++) */ - } /* if ( (en_numlevs != edge_numlevs) */ - - else - { - 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_ParVectorCopy(be_l[level], eVtemp_l[level]); - hypre_ParCSRMatrixMatvec(-1.0, Aen_l[level], xn_l[level], - 1.0, eVtemp_l[level]); - - hypre_ParVectorZeroBCValues(eVtemp_l[level], BdryRanks_l[level], - BdryRanksCnts_l[level]); - - hypre_BoomerAMGRelaxIF(Aee_l[level], - eVtemp_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); - } - - /* Continue down the edge hierarchy if more edge levels. */ - if (edge_numlevs > en_numlevs) - { - hypre_ParVectorCopy(be_l[level], rese_l[level]); - 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_ParVectorSetConstantValues(xe_l[level + 1], 0.0); - - for (level = en_numlevs; level <= edge_numlevs - 2; level++) - { - 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); - } - - /* 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]); - 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_ParVectorSetConstantValues(xe_l[level + 1], 0.0); - } /* for (level = en_numlevs; level< edge_numlevs-2; level++) */ - - /* coarsest relaxation */ - level = edge_numlevs - 1; - 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); - } /* if (edge_numlevs > en_numlevs) */ - - /*----------------------------------------------------------- - * node hierarchy has more levels than the edge hierarchy: - * continue to march down the node hierarchy - *-----------------------------------------------------------*/ - else if (node_numlevs > en_numlevs) - { - hypre_ParVectorCopy(bn_l[level], resn_l[level]); - 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_ParVectorSetConstantValues(xn_l[level + 1], 0.0); - - for (level = en_numlevs; level <= node_numlevs - 2; level++) - { - 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); - } - - /* 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]); - hypre_ParCSRMatrixMatvecT(1.0, RnT_l[level], resn_l[level], - 0.0, bn_l[level + 1]); - - hypre_ParVectorSetConstantValues(xn_l[level + 1], 0.0); - } /* for (level = en_numlevs; level<= node_numlevs-2; level++) */ - - /* coarsest relaxation */ - level = node_numlevs - 1; - 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); - } /* else if (node_numlevs > en_numlevs) */ - - /*--------------------------------------------------------------------- - * Up cycle. First the extra hierarchy levels. Notice we relax on - * the coarsest en_numlevel. - *---------------------------------------------------------------------*/ - if (edge_numlevs > en_numlevs) - { - 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_ParVectorZeroBCValues(ee_l[level], BdryRanks_l[level], - BdryRanksCnts_l[level]); - hypre_ParVectorAxpy(1.0, ee_l[level], xe_l[level]); - - /* post smooth */ - for (j = 0; j < npost_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 (level = (edge_numlevs - 2); level>= en_numlevs; level--) */ - } /* if (edge_numlevs > en_numlevs) */ - - else if (node_numlevs > en_numlevs) - { - for (level = (node_numlevs - 2); level >= en_numlevs - 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); - } - - } /* for (level = (node_numlevs - 2); level>= en_numlevs; level--) */ - } /* else if (node_numlevs > en_numlevs) */ - - /*--------------------------------------------------------------------- - * Cycle up the common levels. - *---------------------------------------------------------------------*/ - for (level = (en_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]); - - hypre_ParCSRMatrixMatvec(1.0, - (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]); - - /* post smooth */ - for (j = 0; j < npost_relax; j++) - { - hypre_ParVectorCopy(bn_l[level], nVtemp_l[level]); - hypre_ParCSRMatrixMatvecT(-1.0, Aen_l[level], xe_l[level], - 1.0, nVtemp_l[level]); - hypre_BoomerAMGRelaxIF(Ann_l[level], - nVtemp_l[level], - nCF_marker_l[level], - nrelax_type, - relax_local, - cycle_param, - nrelax_weight[level], - nomega[level], - NULL, - xn_l[level], - nVtemp_l[level], - ze); - - hypre_ParVectorCopy(be_l[level], eVtemp_l[level]); - hypre_ParCSRMatrixMatvec(-1.0, Aen_l[level], xn_l[level], - 1.0, eVtemp_l[level]); - hypre_ParVectorZeroBCValues(eVtemp_l[level], BdryRanks_l[level], - BdryRanksCnts_l[level]); - - hypre_BoomerAMGRelaxIF(Aee_l[level], - eVtemp_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 (level = (en_numlevs - 2); level>= 1; level--) */ - - /* interpolate error and correct on finest grids */ - hypre_ParCSRMatrixMatvec(1.0, Pn_l[0], xn_l[1], 0.0, en_l[0]); - hypre_ParVectorAxpy(1.0, en_l[0], xn_l[0]); - - hypre_ParCSRMatrixMatvec(1.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]); - hypre_ParVectorAxpy(1.0, ee_l[0], xe_l[0]); - - /* part of convergence check. Will assume that if en_numlevels= 1, - then so would edge_numlevels and node_numlevels. Otherwise, - we measure the error of xe_l[0] + T*xn_l[0]. */ - if ((tol > 0.0) && (rel_change)) - { - if (en_numlevs > 1) - { - hypre_ParCSRMatrixMatvec(1.0, Tgrad, en_l[0], 1.0, - 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]); - - 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]); - } - else - { - e_dot_e = 0.0; - x_dot_x = 1.0; - } - } - - /* check nodal convergence */ - - for (j = 0; j < npost_relax; j++) - { - hypre_ParVectorCopy(bn_l[0], nVtemp_l[0]); - hypre_ParCSRMatrixMatvecT(-1.0, Aen_l[0], xe_l[0], - 1.0, nVtemp_l[0]); - hypre_BoomerAMGRelaxIF(Ann_l[0], - nVtemp_l[0], - nCF_marker_l[0], - nrelax_type, - relax_local, - cycle_param, - nrelax_weight[0], - nomega[0], - NULL, - xn_l[0], - nVtemp2_l[0], - ze); - - hypre_ParVectorCopy(be_l[0], eVtemp_l[0]); - hypre_ParCSRMatrixMatvec(-1.0, Aen_l[0], xn_l[0], 1.0, - eVtemp_l[0]); - hypre_ParVectorZeroBCValues(eVtemp_l[0], BdryRanks_l[0], - BdryRanksCnts_l[0]); - - hypre_BoomerAMGRelaxIF(Aee_l[0], - eVtemp_l[0], - eCF_marker_l[0], - erelax_type, - relax_local, - cycle_param, - erelax_weight[0], - eomega[0], - NULL, - xe_l[0], - eVtemp2_l[0], - ze); - } /* for (j = 0; j < npost_relax; j++) */ - - (maxwell_data -> num_iterations) = (i + 1); - } - - /* add the gradient solution component to u_edge */ - hypre_ParCSRMatrixMatvec(1.0, Tgrad, xn_l[0], 1.0, u_edge); - hypre_ParVectorZeroBCValues(u_edge, BdryRanks_l[0], BdryRanksCnts_l[0]); - - hypre_EndTiming(maxwell_data -> time_index); - hypre_ParVectorDestroy(ze); - - return hypre_error_flag; -} diff --git a/src/sstruct_ls/maxwell_solve2.c b/src/sstruct_ls/maxwell_solve2.c deleted file mode 100644 index a478e790dc..0000000000 --- a/src/sstruct_ls/maxwell_solve2.c +++ /dev/null @@ -1,433 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_sstruct_ls.h" - -/*-------------------------------------------------------------------------- - * hypre_MaxwellSolve- note that there is no input operator Aee. We assume - * that maxwell_vdata has the exact operators. This prevents the need to - * to recompute Ann in the solve phase. However, we do allow the f_edge & - * u_edge to change per call. - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_MaxwellSolve2( void *maxwell_vdata, - hypre_SStructMatrix *A_in, - hypre_SStructVector *f, - hypre_SStructVector *u ) -{ - HYPRE_UNUSED_VAR(A_in); - - hypre_MaxwellData *maxwell_data = (hypre_MaxwellData *)maxwell_vdata; - - hypre_ParVector *f_edge; - hypre_ParVector *u_edge; - - HYPRE_Int max_iter = maxwell_data-> max_iter; - HYPRE_Real tol = maxwell_data-> tol; - HYPRE_Int rel_change = maxwell_data-> rel_change; - HYPRE_Int zero_guess = maxwell_data-> zero_guess; - HYPRE_Int npre_relax = maxwell_data-> num_pre_relax; - HYPRE_Int npost_relax = maxwell_data-> num_post_relax; - - hypre_ParCSRMatrix **Ann_l = maxwell_data-> Ann_l; - hypre_ParCSRMatrix **Pn_l = maxwell_data-> Pn_l; - hypre_ParCSRMatrix **RnT_l = maxwell_data-> RnT_l; - hypre_ParVector **bn_l = maxwell_data-> bn_l; - hypre_ParVector **xn_l = maxwell_data-> xn_l; - hypre_ParVector **resn_l = maxwell_data-> resn_l; - 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 *nomega = maxwell_data-> nomega; - HYPRE_Int nrelax_type = maxwell_data-> nrelax_type; - HYPRE_Int node_numlevs = maxwell_data-> node_numlevels; - - hypre_ParCSRMatrix *Tgrad = maxwell_data-> Tgrad; - hypre_ParCSRMatrix *T_transpose = maxwell_data-> T_transpose; - - hypre_ParCSRMatrix **Aee_l = maxwell_data-> Aee_l; - hypre_IJMatrix **Pe_l = maxwell_data-> Pe_l; - hypre_IJMatrix **ReT_l = maxwell_data-> ReT_l; - hypre_ParVector **be_l = maxwell_data-> be_l; - hypre_ParVector **xe_l = maxwell_data-> xe_l; - hypre_ParVector **rese_l = maxwell_data-> rese_l; - 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 *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 logging = maxwell_data-> logging; - HYPRE_Real *norms = maxwell_data-> norms; - HYPRE_Real *rel_norms = maxwell_data-> rel_norms; - - HYPRE_Int relax_local, cycle_param; - - HYPRE_Real b_dot_b = 0, r_dot_r, eps = 0; - HYPRE_Real e_dot_e = 1.0, x_dot_x = 1.0; - - HYPRE_Int i, j; - HYPRE_Int level; - - /* added for the relaxation routines */ - hypre_ParVector *ze = NULL; - - if (hypre_NumThreads() > 1) - { - /* 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_ParVectorInitialize(ze); - } - - hypre_BeginTiming(maxwell_data-> time_index); - - hypre_SStructVectorConvert(f, &f_edge); - 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; - - /* 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; - - (maxwell_data-> num_iterations) = 0; - /* if max_iter is zero, return */ - if (max_iter == 0) - { - /* if using a zero initial guess, return zero */ - if (zero_guess) - { - hypre_ParVectorSetConstantValues(xe_l[0], 0.0); - } - - hypre_EndTiming(maxwell_data -> time_index); - - return hypre_error_flag; - } - - /* part of convergence check */ - if (tol > 0.0) - { - /* eps = (tol^2) */ - 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) - { - hypre_ParVectorSetConstantValues(xe_l[0], 0.0); - if (logging > 0) - { - norms[0] = 0.0; - rel_norms[0] = 0.0; - } - - hypre_EndTiming(maxwell_data -> time_index); - - return hypre_error_flag; - } - } - - /*----------------------------------------------------- - * Do V-cycles: - * For each index l, "fine" = l, "coarse" = (l-1) - * - * solution update: - * edge_sol= edge_sol + T*node_sol - *-----------------------------------------------------*/ - for (i = 0; i < max_iter; i++) - { - /* 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]); - hypre_ParCSRMatrixMatvec(1.0, T_transpose, rese_l[0], 0.0, bn_l[0]); - - /* convergence check */ - if (tol > 0.0) - { - r_dot_r = hypre_ParVectorInnerProd(rese_l[0], rese_l[0]); - - if (logging > 0) - { - norms[i] = hypre_sqrt(r_dot_r); - if (b_dot_b > 0) - { - 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 (rel_change) - { - if ((e_dot_e / x_dot_x) < eps) - { - break; - } - } - else - { - break; - } - } - } - - 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]); - - 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 (level = 0; level<= node_numlevs-2; level++) */ - - /* coarsest node solve */ - level = node_numlevs - 1; - 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); - - /*--------------------------------------------------------------------- - * 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); - } - } /* for (level = (en_numlevs - 2); level>= 1; level--) */ - - /* interpolate error and correct on finest grids */ - hypre_ParCSRMatrixMatvec(1.0, Pn_l[0], xn_l[1], 0.0, en_l[0]); - hypre_ParVectorAxpy(1.0, en_l[0], xn_l[0]); - - for (j = 0; j < npost_relax; j++) - { - hypre_BoomerAMGRelaxIF(Ann_l[0], - bn_l[0], - nCF_marker_l[0], - nrelax_type, - relax_local, - cycle_param, - nrelax_weight[0], - nomega[0], - NULL, - xn_l[0], - nVtemp2_l[0], - ze); - } /* for (j = 0; j < npost_relax; j++) */ - hypre_ParVectorCopy(bn_l[0], resn_l[0]); - hypre_ParCSRMatrixMatvec(-1.0, Ann_l[0], xn_l[0], 1.0, resn_l[0]); - - /* add the gradient solution component to xe_l[0] */ - hypre_ParCSRMatrixMatvec(1.0, Tgrad, xn_l[0], 1.0, xe_l[0]); - - 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]); - - 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 (level = 1; level<= edge_numlevels-2; level++) */ - - /* coarsest edge solve */ - level = edge_numlevs - 1; - 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); - } - - /*--------------------------------------------------------------------- - * 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_ParVectorZeroBCValues(ee_l[level], BdryRanks_l[level], - BdryRanksCnts_l[level]); - hypre_ParVectorAxpy(1.0, ee_l[level], xe_l[level]); - - /* post smooth */ - for (j = 0; j < npost_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 (level = (edge_numlevs - 2); level>= 1; level--) */ - - /* interpolate error and correct on finest grids */ - hypre_ParCSRMatrixMatvec(1.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]); - hypre_ParVectorAxpy(1.0, ee_l[0], xe_l[0]); - - for (j = 0; j < npost_relax; j++) - { - hypre_BoomerAMGRelaxIF(Aee_l[0], - be_l[0], - eCF_marker_l[0], - erelax_type, - relax_local, - cycle_param, - erelax_weight[0], - eomega[0], - NULL, - xe_l[0], - eVtemp2_l[0], - ze); - } /* for (j = 0; j < npost_relax; j++) */ - - e_dot_e = hypre_ParVectorInnerProd(ee_l[0], ee_l[0]); - x_dot_x = hypre_ParVectorInnerProd(xe_l[0], xe_l[0]); - - hypre_ParVectorCopy(be_l[0], rese_l[0]); - hypre_ParCSRMatrixMatvec(-1.0, Aee_l[0], xe_l[0], 1.0, rese_l[0]); - - (maxwell_data -> num_iterations) = (i + 1); - } - - hypre_EndTiming(maxwell_data -> time_index); - - hypre_ParVectorDestroy(ze); - - return hypre_error_flag; -} diff --git a/src/sstruct_ls/maxwell_zeroBC.c b/src/sstruct_ls/maxwell_zeroBC.c deleted file mode 100644 index 865ba87e7e..0000000000 --- a/src/sstruct_ls/maxwell_zeroBC.c +++ /dev/null @@ -1,43 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_sstruct_ls.h" - -HYPRE_Int -hypre_ParVectorZeroBCValues(hypre_ParVector *v, - HYPRE_Int *rows, - HYPRE_Int nrows) -{ - HYPRE_Int ierr = 0; - - hypre_Vector *v_local = hypre_ParVectorLocalVector(v); - - hypre_SeqVectorZeroBCValues(v_local, rows, nrows); - - return ierr; -} - -HYPRE_Int -hypre_SeqVectorZeroBCValues(hypre_Vector *v, - HYPRE_Int *rows, - HYPRE_Int nrows) -{ - HYPRE_Real *vector_data = hypre_VectorData(v); - HYPRE_Int i; - HYPRE_Int ierr = 0; - -#if defined(HYPRE_USING_OPENMP) - #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE -#endif - for (i = 0; i < nrows; i++) - { - vector_data[rows[i]] = 0.0; - } - - return ierr; -} - diff --git a/src/sstruct_ls/mup.fixed b/src/sstruct_ls/mup.fixed new file mode 100644 index 0000000000..bff4aad143 --- /dev/null +++ b/src/sstruct_ls/mup.fixed @@ -0,0 +1,254 @@ +hypre_NodeRelax +hypre_NodeRelaxCreate +hypre_NodeRelaxDestroy +hypre_NodeRelaxSetMaxIter +hypre_NodeRelaxSetNodeset +hypre_NodeRelaxSetNodesetRank +hypre_NodeRelaxSetNumNodesets +hypre_NodeRelaxSetTempVec +hypre_NodeRelaxSetTol +hypre_NodeRelaxSetWeight +hypre_NodeRelaxSetZeroGuess +hypre_NodeRelaxSetup +hypre_SSAMGCoarseSolve +hypre_SSAMGCoarseSolverDestroy +hypre_SSAMGCoarseSolverSetup +hypre_SSAMGCoarsen +hypre_SSAMGComputeDxyz +hypre_SSAMGComputeMaxLevels +hypre_SSAMGComputeRAP +hypre_SSAMGComputeRAPNonGlk +hypre_SSAMGCreate +hypre_SSAMGCreateInterpOp +hypre_SSAMGDestroy +hypre_SSAMGGetFinalRelativeResidualNorm +hypre_SSAMGGetNumIterations +hypre_SSAMGPrintLogging +hypre_SSAMGPrintStats +hypre_SSAMGRelax +hypre_SSAMGRelaxCreate +hypre_SSAMGRelaxDestroy +hypre_SSAMGRelaxGeneric +hypre_SSAMGRelaxJacobi +hypre_SSAMGRelaxSetActiveParts +hypre_SSAMGRelaxSetMatvecData +hypre_SSAMGRelaxSetMaxIter +hypre_SSAMGRelaxSetNodeset +hypre_SSAMGRelaxSetNodesetRank +hypre_SSAMGRelaxSetNumNodesets +hypre_SSAMGRelaxSetPostRelax +hypre_SSAMGRelaxSetPreRelax +hypre_SSAMGRelaxSetTempVec +hypre_SSAMGRelaxSetTol +hypre_SSAMGRelaxSetType +hypre_SSAMGRelaxSetWeights +hypre_SSAMGRelaxSetZeroGuess +hypre_SSAMGRelaxSetup +hypre_SSAMGSetCoarseSolverType +hypre_SSAMGSetDxyz +hypre_SSAMGSetInterpType +hypre_SSAMGSetLogging +hypre_SSAMGSetMaxCoarseSize +hypre_SSAMGSetMaxIter +hypre_SSAMGSetMaxLevels +hypre_SSAMGSetNonGalerkinRAP +hypre_SSAMGSetNumCoarseRelax +hypre_SSAMGSetNumPosRelax +hypre_SSAMGSetNumPreRelax +hypre_SSAMGSetPrintFreq +hypre_SSAMGSetPrintLevel +hypre_SSAMGSetRelChange +hypre_SSAMGSetRelaxType +hypre_SSAMGSetRelaxWeight +hypre_SSAMGSetSkipRelax +hypre_SSAMGSetTol +hypre_SSAMGSetZeroGuess +hypre_SSAMGSetup +hypre_SSAMGSetupInterpOp +hypre_SSAMGSetupSInterpOp +hypre_SSAMGSetupUInterpOp +hypre_SSAMGSolve +hypre_SStructKrylovAxpy +hypre_SStructKrylovCAlloc +hypre_SStructKrylovClearVector +hypre_SStructKrylovCommInfo +hypre_SStructKrylovCopyVector +hypre_SStructKrylovCreateVector +hypre_SStructKrylovCreateVectorArray +hypre_SStructKrylovDestroyVector +hypre_SStructKrylovFree +hypre_SStructKrylovIdentity +hypre_SStructKrylovIdentitySetup +hypre_SStructKrylovInnerProd +hypre_SStructKrylovInnerProdTagged +hypre_SStructKrylovMatvec +hypre_SStructKrylovMatvecCreate +hypre_SStructKrylovMatvecDestroy +hypre_SStructKrylovPrintVector +hypre_SStructKrylovScaleVector +hypre_SStructSetRandomValues +hypre_SysPFMGCreate +hypre_SysPFMGCreateInterpOp +hypre_SysPFMGDestroy +hypre_SysPFMGGetFinalRelativeResidualNorm +hypre_SysPFMGGetNumIterations +hypre_SysPFMGPrintLogging +hypre_SysPFMGRelax +hypre_SysPFMGRelaxCreate +hypre_SysPFMGRelaxDestroy +hypre_SysPFMGRelaxSetJacobiWeight +hypre_SysPFMGRelaxSetMaxIter +hypre_SysPFMGRelaxSetPostRelax +hypre_SysPFMGRelaxSetPreRelax +hypre_SysPFMGRelaxSetTempVec +hypre_SysPFMGRelaxSetTol +hypre_SysPFMGRelaxSetType +hypre_SysPFMGRelaxSetZeroGuess +hypre_SysPFMGRelaxSetup +hypre_SysPFMGSetDxyz +hypre_SysPFMGSetJacobiWeight +hypre_SysPFMGSetLogging +hypre_SysPFMGSetMaxIter +hypre_SysPFMGSetNumPostRelax +hypre_SysPFMGSetNumPreRelax +hypre_SysPFMGSetPrintFreq +hypre_SysPFMGSetPrintLevel +hypre_SysPFMGSetRelChange +hypre_SysPFMGSetRelaxType +hypre_SysPFMGSetSkipRelax +hypre_SysPFMGSetTol +hypre_SysPFMGSetZeroGuess +hypre_SysPFMGSetup +hypre_SysPFMGSetupInterpOp +hypre_SysPFMGSolve +hypre_SysPFMGZeroDiagonal +hypre_sstructbicgstabcreate +hypre_sstructbicgstabdestroy +hypre_sstructbicgstabgetfinalre +hypre_sstructbicgstabgetnumiter +hypre_sstructbicgstabgetresidua +hypre_sstructbicgstabsetabsolutetol +hypre_sstructbicgstabsetlogging +hypre_sstructbicgstabsetmaxiter +hypre_sstructbicgstabsetminiter +hypre_sstructbicgstabsetprecond +hypre_sstructbicgstabsetprintle +hypre_sstructbicgstabsetstopcri +hypre_sstructbicgstabsettol +hypre_sstructbicgstabsetup +hypre_sstructbicgstabsolve +hypre_sstructdiagscale +hypre_sstructdiagscalesetup +hypre_sstructflexgmrescreate +hypre_sstructflexgmresdestroy +hypre_sstructflexgmresgetfinalrelat +hypre_sstructflexgmresgetnumiterati +hypre_sstructflexgmresgetresidual +hypre_sstructflexgmressetabsolutetol +hypre_sstructflexgmressetkdim +hypre_sstructflexgmressetlogging +hypre_sstructflexgmressetmaxiter +hypre_sstructflexgmressetminiter +hypre_sstructflexgmressetprecond +hypre_sstructflexgmressetprintlevel +hypre_sstructflexgmressettol +hypre_sstructflexgmressetup +hypre_sstructflexgmressolve +hypre_sstructgmrescreate +hypre_sstructgmresdestroy +hypre_sstructgmresgetfinalrelat +hypre_sstructgmresgetnumiterati +hypre_sstructgmresgetresidual +hypre_sstructgmressetabsolutetol +hypre_sstructgmressetkdim +hypre_sstructgmressetlogging +hypre_sstructgmressetmaxiter +hypre_sstructgmressetminiter +hypre_sstructgmressetprecond +hypre_sstructgmressetprintlevel +hypre_sstructgmressetstopcrit +hypre_sstructgmressettol +hypre_sstructgmressetup +hypre_sstructgmressolve +hypre_sstructlgmrescreate +hypre_sstructlgmresdestroy +hypre_sstructlgmresgetfinalrelat +hypre_sstructlgmresgetnumiterati +hypre_sstructlgmresgetresidual +hypre_sstructlgmressetabsolutetol +hypre_sstructlgmressetaugdim +hypre_sstructlgmressetkdim +hypre_sstructlgmressetlogging +hypre_sstructlgmressetmaxiter +hypre_sstructlgmressetminiter +hypre_sstructlgmressetprecond +hypre_sstructlgmressetprintlevel +hypre_sstructlgmressettol +hypre_sstructlgmressetup +hypre_sstructlgmressolve +hypre_sstructpcgcreate +hypre_sstructpcgdestroy +hypre_sstructpcggetfinalrelativ +hypre_sstructpcggetnumiteration +hypre_sstructpcggetresidual +hypre_sstructpcgsetabsolutetol +hypre_sstructpcgsetlogging +hypre_sstructpcgsetmaxiter +hypre_sstructpcgsetprecond +hypre_sstructpcgsetprintlevel +hypre_sstructpcgsetrelchange +hypre_sstructpcgsettol +hypre_sstructpcgsettwonorm +hypre_sstructpcgsetup +hypre_sstructpcgsolve +hypre_sstructsetupinterpreter +hypre_sstructsetupmatvec +hypre_sstructsplitcreate +hypre_sstructsplitdestroy +hypre_sstructsplitgetfinalrelat +hypre_sstructsplitgetnumiterati +hypre_sstructsplitsetmaxiter +hypre_sstructsplitsetnonzerogue +hypre_sstructsplitsetstructsolv +hypre_sstructsplitsettol +hypre_sstructsplitsetup +hypre_sstructsplitsetzeroguess +hypre_sstructsplitsolve +hypre_sstructssamgcreate +hypre_sstructssamgdestroy +hypre_sstructssamggetfinalrel +hypre_sstructssamggetnumitera +hypre_sstructssamgsetdxyz +hypre_sstructssamgsetlogging +hypre_sstructssamgsetmaxiter +hypre_sstructssamgsetnonzerog +hypre_sstructssamgsetnumpostr +hypre_sstructssamgsetnumprere +hypre_sstructssamgsetprintlev +hypre_sstructssamgsetrelaxtyp +hypre_sstructssamgsetrelaxwei +hypre_sstructssamgsetrelchang +hypre_sstructssamgsetskiprela +hypre_sstructssamgsettol +hypre_sstructssamgsetup +hypre_sstructssamgsetzerogues +hypre_sstructssamgsolve +hypre_sstructsyspfmgcreate +hypre_sstructsyspfmgdestroy +hypre_sstructsyspfmggetfinalrel +hypre_sstructsyspfmggetnumitera +hypre_sstructsyspfmgsetdxyz +hypre_sstructsyspfmgsetjacobiweigh +hypre_sstructsyspfmgsetlogging +hypre_sstructsyspfmgsetmaxiter +hypre_sstructsyspfmgsetnonzerog +hypre_sstructsyspfmgsetnumpostr +hypre_sstructsyspfmgsetnumprere +hypre_sstructsyspfmgsetprintlev +hypre_sstructsyspfmgsetrelaxtyp +hypre_sstructsyspfmgsetrelchang +hypre_sstructsyspfmgsetskiprela +hypre_sstructsyspfmgsettol +hypre_sstructsyspfmgsetup +hypre_sstructsyspfmgsetzerogues +hypre_sstructsyspfmgsolve diff --git a/src/sstruct_ls/mup.functions b/src/sstruct_ls/mup.functions new file mode 100644 index 0000000000..4a83520c72 --- /dev/null +++ b/src/sstruct_ls/mup.functions @@ -0,0 +1,141 @@ +HYPRE_SStructBiCGSTABCreate +HYPRE_SStructBiCGSTABDestroy +HYPRE_SStructBiCGSTABGetFinalRelativeResidualNorm +HYPRE_SStructBiCGSTABGetNumIterations +HYPRE_SStructBiCGSTABGetResidual +HYPRE_SStructBiCGSTABSetAbsoluteTol +HYPRE_SStructBiCGSTABSetLogging +HYPRE_SStructBiCGSTABSetMaxIter +HYPRE_SStructBiCGSTABSetMinIter +HYPRE_SStructBiCGSTABSetPrecond +HYPRE_SStructBiCGSTABSetPrintLevel +HYPRE_SStructBiCGSTABSetStopCrit +HYPRE_SStructBiCGSTABSetTol +HYPRE_SStructBiCGSTABSetup +HYPRE_SStructBiCGSTABSolve +HYPRE_SStructDiagScale +HYPRE_SStructDiagScaleSetup +HYPRE_SStructFlexGMRESCreate +HYPRE_SStructFlexGMRESDestroy +HYPRE_SStructFlexGMRESGetFinalRelativeResidualNorm +HYPRE_SStructFlexGMRESGetNumIterations +HYPRE_SStructFlexGMRESGetResidual +HYPRE_SStructFlexGMRESSetAbsoluteTol +HYPRE_SStructFlexGMRESSetKDim +HYPRE_SStructFlexGMRESSetLogging +HYPRE_SStructFlexGMRESSetMaxIter +HYPRE_SStructFlexGMRESSetMinIter +HYPRE_SStructFlexGMRESSetModifyPC +HYPRE_SStructFlexGMRESSetPrecond +HYPRE_SStructFlexGMRESSetPrintLevel +HYPRE_SStructFlexGMRESSetTol +HYPRE_SStructFlexGMRESSetup +HYPRE_SStructFlexGMRESSolve +HYPRE_SStructGMRESCreate +HYPRE_SStructGMRESDestroy +HYPRE_SStructGMRESGetFinalRelativeResidualNorm +HYPRE_SStructGMRESGetNumIterations +HYPRE_SStructGMRESGetResidual +HYPRE_SStructGMRESSetAbsoluteTol +HYPRE_SStructGMRESSetKDim +HYPRE_SStructGMRESSetLogging +HYPRE_SStructGMRESSetMaxIter +HYPRE_SStructGMRESSetMinIter +HYPRE_SStructGMRESSetPrecond +HYPRE_SStructGMRESSetPrintLevel +HYPRE_SStructGMRESSetStopCrit +HYPRE_SStructGMRESSetTol +HYPRE_SStructGMRESSetup +HYPRE_SStructGMRESSolve +HYPRE_SStructLGMRESCreate +HYPRE_SStructLGMRESDestroy +HYPRE_SStructLGMRESGetFinalRelativeResidualNorm +HYPRE_SStructLGMRESGetNumIterations +HYPRE_SStructLGMRESGetResidual +HYPRE_SStructLGMRESSetAbsoluteTol +HYPRE_SStructLGMRESSetAugDim +HYPRE_SStructLGMRESSetKDim +HYPRE_SStructLGMRESSetLogging +HYPRE_SStructLGMRESSetMaxIter +HYPRE_SStructLGMRESSetMinIter +HYPRE_SStructLGMRESSetPrecond +HYPRE_SStructLGMRESSetPrintLevel +HYPRE_SStructLGMRESSetTol +HYPRE_SStructLGMRESSetup +HYPRE_SStructLGMRESSolve +HYPRE_SStructPCGCreate +HYPRE_SStructPCGDestroy +HYPRE_SStructPCGGetFinalRelativeResidualNorm +HYPRE_SStructPCGGetNumIterations +HYPRE_SStructPCGGetResidual +HYPRE_SStructPCGSetAbsoluteTol +HYPRE_SStructPCGSetLogging +HYPRE_SStructPCGSetMaxIter +HYPRE_SStructPCGSetPrecond +HYPRE_SStructPCGSetPrintLevel +HYPRE_SStructPCGSetRelChange +HYPRE_SStructPCGSetTol +HYPRE_SStructPCGSetTwoNorm +HYPRE_SStructPCGSetup +HYPRE_SStructPCGSolve +HYPRE_SStructSSAMGCreate +HYPRE_SStructSSAMGDestroy +HYPRE_SStructSSAMGGetFinalRelativeResidualNorm +HYPRE_SStructSSAMGGetNumIterations +HYPRE_SStructSSAMGSetCoarseSolverType +HYPRE_SStructSSAMGSetDxyz +HYPRE_SStructSSAMGSetInterpType +HYPRE_SStructSSAMGSetLogging +HYPRE_SStructSSAMGSetMaxCoarseSize +HYPRE_SStructSSAMGSetMaxIter +HYPRE_SStructSSAMGSetMaxLevels +HYPRE_SStructSSAMGSetNonGalerkinRAP +HYPRE_SStructSSAMGSetNonZeroGuess +HYPRE_SStructSSAMGSetNumCoarseRelax +HYPRE_SStructSSAMGSetNumPostRelax +HYPRE_SStructSSAMGSetNumPreRelax +HYPRE_SStructSSAMGSetPrintFreq +HYPRE_SStructSSAMGSetPrintLevel +HYPRE_SStructSSAMGSetRelChange +HYPRE_SStructSSAMGSetRelaxType +HYPRE_SStructSSAMGSetRelaxWeight +HYPRE_SStructSSAMGSetSkipRelax +HYPRE_SStructSSAMGSetTol +HYPRE_SStructSSAMGSetZeroGuess +HYPRE_SStructSSAMGSetup +HYPRE_SStructSSAMGSolve +HYPRE_SStructSetupInterpreter +HYPRE_SStructSetupMatvec +HYPRE_SStructSplitCreate +HYPRE_SStructSplitDestroy +HYPRE_SStructSplitGetFinalRelativeResidualNorm +HYPRE_SStructSplitGetNumIterations +HYPRE_SStructSplitPrintLogging +HYPRE_SStructSplitSetLogging +HYPRE_SStructSplitSetMaxIter +HYPRE_SStructSplitSetNonZeroGuess +HYPRE_SStructSplitSetPrintLevel +HYPRE_SStructSplitSetStructSolver +HYPRE_SStructSplitSetTol +HYPRE_SStructSplitSetZeroGuess +HYPRE_SStructSplitSetup +HYPRE_SStructSplitSolve +HYPRE_SStructSysPFMGCreate +HYPRE_SStructSysPFMGDestroy +HYPRE_SStructSysPFMGGetFinalRelativeResidualNorm +HYPRE_SStructSysPFMGGetNumIterations +HYPRE_SStructSysPFMGSetDxyz +HYPRE_SStructSysPFMGSetJacobiWeight +HYPRE_SStructSysPFMGSetLogging +HYPRE_SStructSysPFMGSetMaxIter +HYPRE_SStructSysPFMGSetNonZeroGuess +HYPRE_SStructSysPFMGSetNumPostRelax +HYPRE_SStructSysPFMGSetNumPreRelax +HYPRE_SStructSysPFMGSetPrintLevel +HYPRE_SStructSysPFMGSetRelChange +HYPRE_SStructSysPFMGSetRelaxType +HYPRE_SStructSysPFMGSetSkipRelax +HYPRE_SStructSysPFMGSetTol +HYPRE_SStructSysPFMGSetZeroGuess +HYPRE_SStructSysPFMGSetup +HYPRE_SStructSysPFMGSolve diff --git a/src/sstruct_ls/mup.methods b/src/sstruct_ls/mup.methods new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/sstruct_ls/mup_code b/src/sstruct_ls/mup_code new file mode 100755 index 0000000000..be92270e24 --- /dev/null +++ b/src/sstruct_ls/mup_code @@ -0,0 +1,7 @@ +#!/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) + +../config/gen_code.sh HYPRE_sstruct_ls.h _hypre_sstruct_ls.h mup diff --git a/src/sstruct_ls/mup_fixed.c b/src/sstruct_ls/mup_fixed.c new file mode 100644 index 0000000000..6dfcdb8105 --- /dev/null +++ b/src/sstruct_ls/mup_fixed.c @@ -0,0 +1,987 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_sstruct_ls.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +hypre_NodeRelax( void *relax_vdata, hypre_SStructPMatrix *A, hypre_SStructPVector *b, hypre_SStructPVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NodeRelax)( relax_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_NodeRelaxCreate( MPI_Comm comm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NodeRelaxCreate)( comm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NodeRelaxDestroy( void *relax_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NodeRelaxDestroy)( relax_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NodeRelaxSetMaxIter( void *relax_vdata, HYPRE_Int max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NodeRelaxSetMaxIter)( relax_vdata, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NodeRelaxSetNodeset( void *relax_vdata, HYPRE_Int nodeset, HYPRE_Int nodeset_size, hypre_Index nodeset_stride, hypre_Index *nodeset_indices ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NodeRelaxSetNodeset)( relax_vdata, nodeset, nodeset_size, nodeset_stride, nodeset_indices ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NodeRelaxSetNodesetRank( void *relax_vdata, HYPRE_Int nodeset, HYPRE_Int nodeset_rank ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NodeRelaxSetNodesetRank)( relax_vdata, nodeset, nodeset_rank ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NodeRelaxSetNumNodesets( void *relax_vdata, HYPRE_Int num_nodesets ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NodeRelaxSetNumNodesets)( relax_vdata, num_nodesets ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NodeRelaxSetTempVec( void *relax_vdata, hypre_SStructPVector *t ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NodeRelaxSetTempVec)( relax_vdata, t ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NodeRelaxSetTol( void *relax_vdata, HYPRE_Real tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NodeRelaxSetTol)( relax_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NodeRelaxSetWeight( void *relax_vdata, HYPRE_Real weight ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NodeRelaxSetWeight)( relax_vdata, weight ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NodeRelaxSetZeroGuess( void *relax_vdata, HYPRE_Int zero_guess ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NodeRelaxSetZeroGuess)( relax_vdata, zero_guess ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_NodeRelaxSetup( void *relax_vdata, hypre_SStructPMatrix *A, hypre_SStructPVector *b, hypre_SStructPVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_NodeRelaxSetup)( relax_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGCoarseSolve( void *ssamg_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGCoarseSolve)( ssamg_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGCoarseSolverDestroy( void *ssamg_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGCoarseSolverDestroy)( ssamg_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGCoarseSolverSetup( void *ssamg_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGCoarseSolverSetup)( ssamg_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGCoarsen( void *ssamg_vdata, hypre_SStructGrid *grid, HYPRE_Int *dxyz_flag, HYPRE_Real **dxyz ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGCoarsen)( ssamg_vdata, grid, dxyz_flag, dxyz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGComputeDxyz( hypre_SStructMatrix *A, HYPRE_Real **dxyz, HYPRE_Int *dxyz_flag ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGComputeDxyz)( A, dxyz, dxyz_flag ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGComputeMaxLevels( hypre_SStructGrid *grid, HYPRE_Int *max_levels ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGComputeMaxLevels)( grid, max_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGComputeRAP( hypre_SStructMatrix *A, hypre_SStructMatrix *P, hypre_SStructGrid **cgrid, HYPRE_Int *cdir_p, HYPRE_Int non_galerkin, hypre_SStructMatrix **Ac_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGComputeRAP)( A, P, cgrid, cdir_p, non_galerkin, Ac_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGComputeRAPNonGlk( hypre_SStructMatrix *A, hypre_SStructMatrix *P, HYPRE_Int *cdir_p, hypre_SStructMatrix **Ac_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGComputeRAPNonGlk)( A, P, cdir_p, Ac_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_SSAMGCreate( hypre_MPI_Comm comm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGCreate)( comm ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_SStructMatrix* +hypre_SSAMGCreateInterpOp( hypre_SStructMatrix *A, hypre_SStructGrid *cgrid, HYPRE_Int *cdir_p ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGCreateInterpOp)( A, cgrid, cdir_p ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGDestroy( void *ssamg_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGDestroy)( ssamg_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGGetFinalRelativeResidualNorm( void *ssamg_vdata, HYPRE_Real *relative_residual_norm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGGetFinalRelativeResidualNorm)( ssamg_vdata, relative_residual_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGGetNumIterations( void *ssamg_vdata, HYPRE_Int *num_iterations ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGGetNumIterations)( ssamg_vdata, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGPrintLogging( void *ssamg_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGPrintLogging)( ssamg_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGPrintStats( void *ssamg_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGPrintStats)( ssamg_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelax( void *relax_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, hypre_SStructVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGRelax)( relax_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxCreate( MPI_Comm comm, HYPRE_Int nparts, void **relax_vdata_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGRelaxCreate)( comm, nparts, relax_vdata_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxDestroy( void *relax_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGRelaxDestroy)( relax_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxGeneric( void *relax_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, hypre_SStructVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGRelaxGeneric)( relax_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxJacobi( void *relax_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, hypre_SStructVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGRelaxJacobi)( relax_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxSetActiveParts( void *relax_vdata, HYPRE_Int *active_p ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGRelaxSetActiveParts)( relax_vdata, active_p ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxSetMatvecData( void *relax_vdata, void *matvec_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGRelaxSetMatvecData)( relax_vdata, matvec_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxSetMaxIter( void *relax_vdata, HYPRE_Int max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGRelaxSetMaxIter)( relax_vdata, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxSetNodeset( void *relax_vdata, HYPRE_Int nodeset, HYPRE_Int nodeset_size, hypre_Index nodeset_stride, hypre_Index *nodeset_indices ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGRelaxSetNodeset)( relax_vdata, nodeset, nodeset_size, nodeset_stride, nodeset_indices ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxSetNodesetRank( void *relax_vdata, HYPRE_Int nodeset, HYPRE_Int nodeset_rank ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGRelaxSetNodesetRank)( relax_vdata, nodeset, nodeset_rank ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxSetNumNodesets( void *relax_vdata, HYPRE_Int num_nodesets ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGRelaxSetNumNodesets)( relax_vdata, num_nodesets ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxSetPostRelax( void *relax_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGRelaxSetPostRelax)( relax_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxSetPreRelax( void *relax_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGRelaxSetPreRelax)( relax_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxSetTempVec( void *relax_vdata, hypre_SStructVector *t ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGRelaxSetTempVec)( relax_vdata, t ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxSetTol( void *relax_vdata, HYPRE_Real tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGRelaxSetTol)( relax_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxSetType( void *relax_vdata, HYPRE_Int relax_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGRelaxSetType)( relax_vdata, relax_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxSetWeights( void *relax_vdata, HYPRE_Real *weights ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGRelaxSetWeights)( relax_vdata, weights ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxSetZeroGuess( void *relax_vdata, HYPRE_Int zero_guess ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGRelaxSetZeroGuess)( relax_vdata, zero_guess ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxSetup( void *relax_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, hypre_SStructVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGRelaxSetup)( relax_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetCoarseSolverType( void *ssamg_vdata, HYPRE_Int csolver_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGSetCoarseSolverType)( ssamg_vdata, csolver_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetDxyz( void *ssamg_vdata, HYPRE_Int nparts, HYPRE_Real **dxyz ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGSetDxyz)( ssamg_vdata, nparts, dxyz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetInterpType( void *ssamg_vdata, HYPRE_Int interp_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGSetInterpType)( ssamg_vdata, interp_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetLogging( void *ssamg_vdata, HYPRE_Int logging ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGSetLogging)( ssamg_vdata, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetMaxCoarseSize( void *ssamg_vdata, HYPRE_Int max_coarse_size ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGSetMaxCoarseSize)( ssamg_vdata, max_coarse_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetMaxIter( void *ssamg_vdata, HYPRE_Int max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGSetMaxIter)( ssamg_vdata, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetMaxLevels( void *ssamg_vdata, HYPRE_Int max_levels ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGSetMaxLevels)( ssamg_vdata, max_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetNonGalerkinRAP( void *ssamg_vdata, HYPRE_Int non_galerkin ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGSetNonGalerkinRAP)( ssamg_vdata, non_galerkin ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetNumCoarseRelax( void *ssamg_vdata, HYPRE_Int num_coarse_relax ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGSetNumCoarseRelax)( ssamg_vdata, num_coarse_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetNumPosRelax( void *ssamg_vdata, HYPRE_Int num_pos_relax ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGSetNumPosRelax)( ssamg_vdata, num_pos_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetNumPreRelax( void *ssamg_vdata, HYPRE_Int num_pre_relax ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGSetNumPreRelax)( ssamg_vdata, num_pre_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetPrintFreq( void *ssamg_vdata, HYPRE_Int print_freq ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGSetPrintFreq)( ssamg_vdata, print_freq ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetPrintLevel( void *ssamg_vdata, HYPRE_Int print_level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGSetPrintLevel)( ssamg_vdata, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetRelChange( void *ssamg_vdata, HYPRE_Int rel_change ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGSetRelChange)( ssamg_vdata, rel_change ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetRelaxType( void *ssamg_vdata, HYPRE_Int relax_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGSetRelaxType)( ssamg_vdata, relax_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetRelaxWeight( void *ssamg_vdata, HYPRE_Real relax_weight ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGSetRelaxWeight)( ssamg_vdata, relax_weight ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetSkipRelax( void *ssamg_vdata, HYPRE_Int skip_relax ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGSetSkipRelax)( ssamg_vdata, skip_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetTol( void *ssamg_vdata, HYPRE_Real tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGSetTol)( ssamg_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetZeroGuess( void *ssamg_vdata, HYPRE_Int zero_guess ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGSetZeroGuess)( ssamg_vdata, zero_guess ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetup( void *ssamg_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, hypre_SStructVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGSetup)( ssamg_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetupInterpOp( hypre_SStructMatrix *A, HYPRE_Int *cdir_p, hypre_SStructMatrix *P, HYPRE_Int interp_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGSetupInterpOp)( A, cdir_p, P, interp_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetupUInterpOp( hypre_SStructMatrix *A, HYPRE_Int *cdir_p, hypre_SStructMatrix *P, HYPRE_Int interp_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGSetupUInterpOp)( A, cdir_p, P, interp_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSolve( void *ssamg_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, hypre_SStructVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SSAMGSolve)( ssamg_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructKrylovAxpy( HYPRE_Complex alpha, void *x, void *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructKrylovAxpy)( alpha, x, y ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_SStructKrylovCAlloc( size_t count, size_t elt_size, HYPRE_MemoryLocation location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructKrylovCAlloc)( count, elt_size, location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructKrylovClearVector( void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructKrylovClearVector)( x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructKrylovCommInfo( void *A, HYPRE_Int *my_id, HYPRE_Int *num_procs ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructKrylovCommInfo)( A, my_id, num_procs ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructKrylovCopyVector( void *x, void *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructKrylovCopyVector)( x, y ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_SStructKrylovCreateVector( void *vvector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructKrylovCreateVector)( vvector ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_SStructKrylovCreateVectorArray( HYPRE_Int n, void *vvector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructKrylovCreateVectorArray)( n, vvector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructKrylovDestroyVector( void *vvector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructKrylovDestroyVector)( vvector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructKrylovFree( void *ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructKrylovFree)( ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructKrylovIdentity( void *vdata, void *A, void *b, void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructKrylovIdentity)( vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructKrylovIdentitySetup( void *vdata, void *A, void *b, void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructKrylovIdentitySetup)( vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +hypre_SStructKrylovInnerProd( void *x, void *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructKrylovInnerProd)( x, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructKrylovInnerProdTagged( void *x, void *y, HYPRE_Int *num_tags_ptr, HYPRE_Complex **iprod_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructKrylovInnerProdTagged)( x, y, num_tags_ptr, iprod_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructKrylovMatvec( void *matvec_data, HYPRE_Complex alpha, void *A, void *x, HYPRE_Complex beta, void *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructKrylovMatvec)( matvec_data, alpha, A, x, beta, y ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_SStructKrylovMatvecCreate( void *A, void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructKrylovMatvecCreate)( A, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructKrylovMatvecDestroy( void *matvec_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructKrylovMatvecDestroy)( matvec_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructKrylovScaleVector( HYPRE_Complex alpha, void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructKrylovScaleVector)( alpha, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructSetRandomValues( void *v, HYPRE_Int seed ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructSetRandomValues)( v, seed ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_SysPFMGCreate( MPI_Comm comm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGCreate)( comm ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_SStructPMatrix * +hypre_SysPFMGCreateInterpOp( hypre_SStructPMatrix *A, HYPRE_Int cdir, hypre_Index stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGCreateInterpOp)( A, cdir, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGDestroy( void *sys_pfmg_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGDestroy)( sys_pfmg_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGGetFinalRelativeResidualNorm( void *sys_pfmg_vdata, HYPRE_Real *relative_residual_norm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGGetFinalRelativeResidualNorm)( sys_pfmg_vdata, relative_residual_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGGetNumIterations( void *sys_pfmg_vdata, HYPRE_Int *num_iterations ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGGetNumIterations)( sys_pfmg_vdata, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGPrintLogging( void *sys_pfmg_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGPrintLogging)( sys_pfmg_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGRelax( void *sys_pfmg_relax_vdata, hypre_SStructPMatrix *A, hypre_SStructPVector *b, hypre_SStructPVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGRelax)( sys_pfmg_relax_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_SysPFMGRelaxCreate( MPI_Comm comm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGRelaxCreate)( comm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGRelaxDestroy( void *sys_pfmg_relax_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGRelaxDestroy)( sys_pfmg_relax_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGRelaxSetJacobiWeight( void *sys_pfmg_relax_vdata, HYPRE_Real weight ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGRelaxSetJacobiWeight)( sys_pfmg_relax_vdata, weight ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGRelaxSetMaxIter( void *sys_pfmg_relax_vdata, HYPRE_Int max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGRelaxSetMaxIter)( sys_pfmg_relax_vdata, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGRelaxSetPostRelax( void *sys_pfmg_relax_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGRelaxSetPostRelax)( sys_pfmg_relax_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGRelaxSetPreRelax( void *sys_pfmg_relax_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGRelaxSetPreRelax)( sys_pfmg_relax_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGRelaxSetTempVec( void *sys_pfmg_relax_vdata, hypre_SStructPVector *t ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGRelaxSetTempVec)( sys_pfmg_relax_vdata, t ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGRelaxSetTol( void *sys_pfmg_relax_vdata, HYPRE_Real tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGRelaxSetTol)( sys_pfmg_relax_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGRelaxSetType( void *sys_pfmg_relax_vdata, HYPRE_Int relax_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGRelaxSetType)( sys_pfmg_relax_vdata, relax_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGRelaxSetZeroGuess( void *sys_pfmg_relax_vdata, HYPRE_Int zero_guess ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGRelaxSetZeroGuess)( sys_pfmg_relax_vdata, zero_guess ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGRelaxSetup( void *sys_pfmg_relax_vdata, hypre_SStructPMatrix *A, hypre_SStructPVector *b, hypre_SStructPVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGRelaxSetup)( sys_pfmg_relax_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGSetDxyz( void *sys_pfmg_vdata, HYPRE_Real *dxyz ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGSetDxyz)( sys_pfmg_vdata, dxyz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGSetJacobiWeight( void *sys_pfmg_vdata, HYPRE_Real weight ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGSetJacobiWeight)( sys_pfmg_vdata, weight ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGSetLogging( void *sys_pfmg_vdata, HYPRE_Int logging ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGSetLogging)( sys_pfmg_vdata, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGSetMaxIter( void *sys_pfmg_vdata, HYPRE_Int max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGSetMaxIter)( sys_pfmg_vdata, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGSetNumPostRelax( void *sys_pfmg_vdata, HYPRE_Int num_post_relax ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGSetNumPostRelax)( sys_pfmg_vdata, num_post_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGSetNumPreRelax( void *sys_pfmg_vdata, HYPRE_Int num_pre_relax ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGSetNumPreRelax)( sys_pfmg_vdata, num_pre_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGSetPrintLevel( void *sys_pfmg_vdata, HYPRE_Int print_level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGSetPrintLevel)( sys_pfmg_vdata, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGSetRelChange( void *sys_pfmg_vdata, HYPRE_Int rel_change ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGSetRelChange)( sys_pfmg_vdata, rel_change ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGSetRelaxType( void *sys_pfmg_vdata, HYPRE_Int relax_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGSetRelaxType)( sys_pfmg_vdata, relax_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGSetSkipRelax( void *sys_pfmg_vdata, HYPRE_Int skip_relax ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGSetSkipRelax)( sys_pfmg_vdata, skip_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGSetTol( void *sys_pfmg_vdata, HYPRE_Real tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGSetTol)( sys_pfmg_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGSetZeroGuess( void *sys_pfmg_vdata, HYPRE_Int zero_guess ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGSetZeroGuess)( sys_pfmg_vdata, zero_guess ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGSetup( void *sys_pfmg_vdata, hypre_SStructMatrix *A_in, hypre_SStructVector *b_in, hypre_SStructVector *x_in ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGSetup)( sys_pfmg_vdata, A_in, b_in, x_in ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGSetupInterpOp( hypre_SStructPMatrix *P, hypre_SStructPMatrix *A, HYPRE_Int cdir ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGSetupInterpOp)( P, A, cdir ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGSolve( void *sys_pfmg_vdata, hypre_SStructMatrix *A_in, hypre_SStructVector *b_in, hypre_SStructVector *x_in ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGSolve)( sys_pfmg_vdata, A_in, b_in, x_in ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGZeroDiagonal( hypre_SStructPMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SysPFMGZeroDiagonal)( A ); +} + + +#endif + diff --git a/src/sstruct_ls/mup_functions.c b/src/sstruct_ls/mup_functions.c new file mode 100644 index 0000000000..e0382cb76f --- /dev/null +++ b/src/sstruct_ls/mup_functions.c @@ -0,0 +1,1288 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_sstruct_ls.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_SStructBiCGSTABCreate( MPI_Comm comm, HYPRE_SStructSolver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructBiCGSTABCreate_pre( precision, comm, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructBiCGSTABDestroy( HYPRE_SStructSolver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructBiCGSTABDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructBiCGSTABGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructBiCGSTABGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructBiCGSTABGetNumIterations( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructBiCGSTABGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructBiCGSTABGetResidual( HYPRE_SStructSolver solver, void **residual ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructBiCGSTABGetResidual_pre( precision, solver, residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructBiCGSTABSetAbsoluteTol( HYPRE_SStructSolver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructBiCGSTABSetAbsoluteTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructBiCGSTABSetLogging( HYPRE_SStructSolver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructBiCGSTABSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructBiCGSTABSetMaxIter( HYPRE_SStructSolver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructBiCGSTABSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructBiCGSTABSetMinIter( HYPRE_SStructSolver solver, HYPRE_Int min_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructBiCGSTABSetMinIter_pre( precision, solver, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructBiCGSTABSetPrecond( HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructBiCGSTABSetPrecond_pre( precision, solver, precond, precond_setup, precond_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructBiCGSTABSetPrintLevel( HYPRE_SStructSolver solver, HYPRE_Int level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructBiCGSTABSetPrintLevel_pre( precision, solver, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructBiCGSTABSetStopCrit( HYPRE_SStructSolver solver, HYPRE_Int stop_crit ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructBiCGSTABSetStopCrit_pre( precision, solver, stop_crit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructBiCGSTABSetTol( HYPRE_SStructSolver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructBiCGSTABSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructBiCGSTABSetup( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructBiCGSTABSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructBiCGSTABSolve( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructBiCGSTABSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructDiagScale( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector y, HYPRE_SStructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructDiagScale_pre( precision, solver, A, y, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructDiagScaleSetup( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector y, HYPRE_SStructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructDiagScaleSetup_pre( precision, solver, A, y, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESCreate( MPI_Comm comm, HYPRE_SStructSolver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructFlexGMRESCreate_pre( precision, comm, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESDestroy( HYPRE_SStructSolver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructFlexGMRESDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructFlexGMRESGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESGetNumIterations( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructFlexGMRESGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESGetResidual( HYPRE_SStructSolver solver, void **residual ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructFlexGMRESGetResidual_pre( precision, solver, residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESSetAbsoluteTol( HYPRE_SStructSolver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructFlexGMRESSetAbsoluteTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESSetKDim( HYPRE_SStructSolver solver, HYPRE_Int k_dim ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructFlexGMRESSetKDim_pre( precision, solver, k_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESSetLogging( HYPRE_SStructSolver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructFlexGMRESSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESSetMaxIter( HYPRE_SStructSolver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructFlexGMRESSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESSetMinIter( HYPRE_SStructSolver solver, HYPRE_Int min_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructFlexGMRESSetMinIter_pre( precision, solver, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESSetModifyPC( HYPRE_SStructSolver solver, HYPRE_PtrToModifyPCFcn modify_pc ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructFlexGMRESSetModifyPC_pre( precision, solver, modify_pc ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESSetPrecond( HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructFlexGMRESSetPrecond_pre( precision, solver, precond, precond_setup, precond_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESSetPrintLevel( HYPRE_SStructSolver solver, HYPRE_Int print_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructFlexGMRESSetPrintLevel_pre( precision, solver, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESSetTol( HYPRE_SStructSolver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructFlexGMRESSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESSetup( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructFlexGMRESSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESSolve( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructFlexGMRESSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESCreate( MPI_Comm comm, HYPRE_SStructSolver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGMRESCreate_pre( precision, comm, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESDestroy( HYPRE_SStructSolver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGMRESDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGMRESGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESGetNumIterations( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGMRESGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESGetResidual( HYPRE_SStructSolver solver, void **residual ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGMRESGetResidual_pre( precision, solver, residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESSetAbsoluteTol( HYPRE_SStructSolver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGMRESSetAbsoluteTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESSetKDim( HYPRE_SStructSolver solver, HYPRE_Int k_dim ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGMRESSetKDim_pre( precision, solver, k_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESSetLogging( HYPRE_SStructSolver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGMRESSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESSetMaxIter( HYPRE_SStructSolver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGMRESSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESSetMinIter( HYPRE_SStructSolver solver, HYPRE_Int min_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGMRESSetMinIter_pre( precision, solver, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESSetPrecond( HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGMRESSetPrecond_pre( precision, solver, precond, precond_setup, precond_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESSetPrintLevel( HYPRE_SStructSolver solver, HYPRE_Int print_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGMRESSetPrintLevel_pre( precision, solver, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESSetStopCrit( HYPRE_SStructSolver solver, HYPRE_Int stop_crit ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGMRESSetStopCrit_pre( precision, solver, stop_crit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESSetTol( HYPRE_SStructSolver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGMRESSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESSetup( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGMRESSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESSolve( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGMRESSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESCreate( MPI_Comm comm, HYPRE_SStructSolver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructLGMRESCreate_pre( precision, comm, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESDestroy( HYPRE_SStructSolver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructLGMRESDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructLGMRESGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESGetNumIterations( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructLGMRESGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESGetResidual( HYPRE_SStructSolver solver, void **residual ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructLGMRESGetResidual_pre( precision, solver, residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESSetAbsoluteTol( HYPRE_SStructSolver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructLGMRESSetAbsoluteTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESSetAugDim( HYPRE_SStructSolver solver, HYPRE_Int aug_dim ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructLGMRESSetAugDim_pre( precision, solver, aug_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESSetKDim( HYPRE_SStructSolver solver, HYPRE_Int k_dim ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructLGMRESSetKDim_pre( precision, solver, k_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESSetLogging( HYPRE_SStructSolver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructLGMRESSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESSetMaxIter( HYPRE_SStructSolver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructLGMRESSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESSetMinIter( HYPRE_SStructSolver solver, HYPRE_Int min_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructLGMRESSetMinIter_pre( precision, solver, min_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESSetPrecond( HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructLGMRESSetPrecond_pre( precision, solver, precond, precond_setup, precond_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESSetPrintLevel( HYPRE_SStructSolver solver, HYPRE_Int print_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructLGMRESSetPrintLevel_pre( precision, solver, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESSetTol( HYPRE_SStructSolver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructLGMRESSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESSetup( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructLGMRESSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESSolve( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructLGMRESSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructPCGCreate( MPI_Comm comm, HYPRE_SStructSolver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructPCGCreate_pre( precision, comm, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructPCGDestroy( HYPRE_SStructSolver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructPCGDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructPCGGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructPCGGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructPCGGetNumIterations( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructPCGGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructPCGGetResidual( HYPRE_SStructSolver solver, void **residual ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructPCGGetResidual_pre( precision, solver, residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructPCGSetAbsoluteTol( HYPRE_SStructSolver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructPCGSetAbsoluteTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructPCGSetLogging( HYPRE_SStructSolver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructPCGSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructPCGSetMaxIter( HYPRE_SStructSolver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructPCGSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructPCGSetPrecond( HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructPCGSetPrecond_pre( precision, solver, precond, precond_setup, precond_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructPCGSetPrintLevel( HYPRE_SStructSolver solver, HYPRE_Int level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructPCGSetPrintLevel_pre( precision, solver, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructPCGSetRelChange( HYPRE_SStructSolver solver, HYPRE_Int rel_change ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructPCGSetRelChange_pre( precision, solver, rel_change ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructPCGSetTol( HYPRE_SStructSolver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructPCGSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructPCGSetTwoNorm( HYPRE_SStructSolver solver, HYPRE_Int two_norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructPCGSetTwoNorm_pre( precision, solver, two_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructPCGSetup( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructPCGSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructPCGSolve( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructPCGSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGCreate( MPI_Comm comm, HYPRE_SStructSolver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSSAMGCreate_pre( precision, comm, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGDestroy( HYPRE_SStructSolver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSSAMGDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSSAMGGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGGetNumIterations( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSSAMGGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetCoarseSolverType( HYPRE_SStructSolver solver, HYPRE_Int csolver_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSSAMGSetCoarseSolverType_pre( precision, solver, csolver_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetDxyz( HYPRE_SStructSolver solver, HYPRE_Int nparts, void *dxyz ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSSAMGSetDxyz_pre( precision, solver, nparts, dxyz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetInterpType( HYPRE_SStructSolver solver, HYPRE_Int interp_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSSAMGSetInterpType_pre( precision, solver, interp_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetLogging( HYPRE_SStructSolver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSSAMGSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetMaxCoarseSize( HYPRE_SStructSolver solver, HYPRE_Int max_coarse_size ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSSAMGSetMaxCoarseSize_pre( precision, solver, max_coarse_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetMaxIter( HYPRE_SStructSolver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSSAMGSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetMaxLevels( HYPRE_SStructSolver solver, HYPRE_Int max_levels ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSSAMGSetMaxLevels_pre( precision, solver, max_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetNonGalerkinRAP( HYPRE_SStructSolver solver, HYPRE_Int non_galerkin ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSSAMGSetNonGalerkinRAP_pre( precision, solver, non_galerkin ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetNonZeroGuess( HYPRE_SStructSolver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSSAMGSetNonZeroGuess_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetNumCoarseRelax( HYPRE_SStructSolver solver, HYPRE_Int num_coarse_relax ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSSAMGSetNumCoarseRelax_pre( precision, solver, num_coarse_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetNumPostRelax( HYPRE_SStructSolver solver, HYPRE_Int num_post_relax ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSSAMGSetNumPostRelax_pre( precision, solver, num_post_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetNumPreRelax( HYPRE_SStructSolver solver, HYPRE_Int num_pre_relax ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSSAMGSetNumPreRelax_pre( precision, solver, num_pre_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetPrintFreq( HYPRE_SStructSolver solver, HYPRE_Int print_freq ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSSAMGSetPrintFreq_pre( precision, solver, print_freq ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetPrintLevel( HYPRE_SStructSolver solver, HYPRE_Int print_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSSAMGSetPrintLevel_pre( precision, solver, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetRelChange( HYPRE_SStructSolver solver, HYPRE_Int rel_change ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSSAMGSetRelChange_pre( precision, solver, rel_change ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetRelaxType( HYPRE_SStructSolver solver, HYPRE_Int relax_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSSAMGSetRelaxType_pre( precision, solver, relax_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetRelaxWeight( HYPRE_SStructSolver solver, hypre_long_double weight ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSSAMGSetRelaxWeight_pre( precision, solver, weight ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetSkipRelax( HYPRE_SStructSolver solver, HYPRE_Int skip_relax ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSSAMGSetSkipRelax_pre( precision, solver, skip_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetTol( HYPRE_SStructSolver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSSAMGSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetZeroGuess( HYPRE_SStructSolver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSSAMGSetZeroGuess_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetup( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSSAMGSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSolve( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSSAMGSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSetupInterpreter( mv_InterfaceInterpreter *i ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSetupInterpreter_pre( precision, i ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSetupMatvec( HYPRE_MatvecFunctions *mv ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSetupMatvec_pre( precision, mv ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSplitCreate( MPI_Comm comm, HYPRE_SStructSolver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSplitCreate_pre( precision, comm, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSplitDestroy( HYPRE_SStructSolver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSplitDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSplitGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSplitGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSplitGetNumIterations( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSplitGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSplitPrintLogging( HYPRE_SStructSolver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSplitPrintLogging_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSplitSetLogging( HYPRE_SStructSolver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSplitSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSplitSetMaxIter( HYPRE_SStructSolver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSplitSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSplitSetNonZeroGuess( HYPRE_SStructSolver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSplitSetNonZeroGuess_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSplitSetPrintLevel( HYPRE_SStructSolver solver, HYPRE_Int print_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSplitSetPrintLevel_pre( precision, solver, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSplitSetStructSolver( HYPRE_SStructSolver solver, HYPRE_Int ssolver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSplitSetStructSolver_pre( precision, solver, ssolver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSplitSetTol( HYPRE_SStructSolver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSplitSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSplitSetZeroGuess( HYPRE_SStructSolver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSplitSetZeroGuess_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSplitSetup( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSplitSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSplitSolve( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSplitSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGCreate( MPI_Comm comm, HYPRE_SStructSolver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSysPFMGCreate_pre( precision, comm, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGDestroy( HYPRE_SStructSolver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSysPFMGDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGGetFinalRelativeResidualNorm( HYPRE_SStructSolver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSysPFMGGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGGetNumIterations( HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSysPFMGGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGSetDxyz( HYPRE_SStructSolver solver, void *dxyz ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSysPFMGSetDxyz_pre( precision, solver, dxyz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGSetJacobiWeight( HYPRE_SStructSolver solver, hypre_long_double weight ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSysPFMGSetJacobiWeight_pre( precision, solver, weight ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGSetLogging( HYPRE_SStructSolver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSysPFMGSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGSetMaxIter( HYPRE_SStructSolver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSysPFMGSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGSetNonZeroGuess( HYPRE_SStructSolver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSysPFMGSetNonZeroGuess_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGSetNumPostRelax( HYPRE_SStructSolver solver, HYPRE_Int num_post_relax ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSysPFMGSetNumPostRelax_pre( precision, solver, num_post_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGSetNumPreRelax( HYPRE_SStructSolver solver, HYPRE_Int num_pre_relax ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSysPFMGSetNumPreRelax_pre( precision, solver, num_pre_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGSetPrintLevel( HYPRE_SStructSolver solver, HYPRE_Int print_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSysPFMGSetPrintLevel_pre( precision, solver, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGSetRelChange( HYPRE_SStructSolver solver, HYPRE_Int rel_change ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSysPFMGSetRelChange_pre( precision, solver, rel_change ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGSetRelaxType( HYPRE_SStructSolver solver, HYPRE_Int relax_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSysPFMGSetRelaxType_pre( precision, solver, relax_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGSetSkipRelax( HYPRE_SStructSolver solver, HYPRE_Int skip_relax ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSysPFMGSetSkipRelax_pre( precision, solver, skip_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGSetTol( HYPRE_SStructSolver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSysPFMGSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGSetZeroGuess( HYPRE_SStructSolver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSysPFMGSetZeroGuess_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGSetup( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSysPFMGSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGSolve( HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructSysPFMGSolve_pre( precision, solver, A, b, x ); +} + + + +#endif + diff --git a/src/sstruct_ls/mup_pre.c b/src/sstruct_ls/mup_pre.c new file mode 100644 index 0000000000..134781cf0a --- /dev/null +++ b/src/sstruct_ls/mup_pre.c @@ -0,0 +1,2557 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_sstruct_ls.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_SStructBiCGSTABCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_SStructSolver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructBiCGSTABCreate_flt( comm, solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructBiCGSTABCreate_dbl( comm, solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructBiCGSTABCreate_long_dbl( comm, solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructBiCGSTABDestroy_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructBiCGSTABDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructBiCGSTABDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructBiCGSTABDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructBiCGSTABGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructBiCGSTABGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructBiCGSTABGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructBiCGSTABGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructBiCGSTABGetNumIterations_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructBiCGSTABGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructBiCGSTABGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructBiCGSTABGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructBiCGSTABGetResidual_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, void **residual ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructBiCGSTABGetResidual_flt( solver, residual ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructBiCGSTABGetResidual_dbl( solver, residual ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructBiCGSTABGetResidual_long_dbl( solver, residual ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructBiCGSTABSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructBiCGSTABSetAbsoluteTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructBiCGSTABSetAbsoluteTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructBiCGSTABSetAbsoluteTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructBiCGSTABSetLogging_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructBiCGSTABSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructBiCGSTABSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructBiCGSTABSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructBiCGSTABSetMaxIter_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructBiCGSTABSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructBiCGSTABSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructBiCGSTABSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructBiCGSTABSetMinIter_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int min_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructBiCGSTABSetMinIter_flt( solver, min_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructBiCGSTABSetMinIter_dbl( solver, min_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructBiCGSTABSetMinIter_long_dbl( solver, min_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructBiCGSTABSetPrecond_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructBiCGSTABSetPrecond_flt( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructBiCGSTABSetPrecond_dbl( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructBiCGSTABSetPrecond_long_dbl( solver, precond, precond_setup, precond_solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructBiCGSTABSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructBiCGSTABSetPrintLevel_flt( solver, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructBiCGSTABSetPrintLevel_dbl( solver, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructBiCGSTABSetPrintLevel_long_dbl( solver, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructBiCGSTABSetStopCrit_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int stop_crit ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructBiCGSTABSetStopCrit_flt( solver, stop_crit ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructBiCGSTABSetStopCrit_dbl( solver, stop_crit ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructBiCGSTABSetStopCrit_long_dbl( solver, stop_crit ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructBiCGSTABSetTol_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructBiCGSTABSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructBiCGSTABSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructBiCGSTABSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructBiCGSTABSetup_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructBiCGSTABSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructBiCGSTABSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructBiCGSTABSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructBiCGSTABSolve_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructBiCGSTABSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructBiCGSTABSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructBiCGSTABSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructDiagScale_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector y, HYPRE_SStructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructDiagScale_flt( solver, A, y, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructDiagScale_dbl( solver, A, y, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructDiagScale_long_dbl( solver, A, y, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructDiagScaleSetup_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector y, HYPRE_SStructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructDiagScaleSetup_flt( solver, A, y, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructDiagScaleSetup_dbl( solver, A, y, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructDiagScaleSetup_long_dbl( solver, A, y, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_SStructSolver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructFlexGMRESCreate_flt( comm, solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructFlexGMRESCreate_dbl( comm, solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructFlexGMRESCreate_long_dbl( comm, solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESDestroy_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructFlexGMRESDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructFlexGMRESDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructFlexGMRESDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructFlexGMRESGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructFlexGMRESGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructFlexGMRESGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESGetNumIterations_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructFlexGMRESGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructFlexGMRESGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructFlexGMRESGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESGetResidual_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, void **residual ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructFlexGMRESGetResidual_flt( solver, residual ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructFlexGMRESGetResidual_dbl( solver, residual ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructFlexGMRESGetResidual_long_dbl( solver, residual ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructFlexGMRESSetAbsoluteTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructFlexGMRESSetAbsoluteTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructFlexGMRESSetAbsoluteTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESSetKDim_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int k_dim ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructFlexGMRESSetKDim_flt( solver, k_dim ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructFlexGMRESSetKDim_dbl( solver, k_dim ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructFlexGMRESSetKDim_long_dbl( solver, k_dim ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESSetLogging_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructFlexGMRESSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructFlexGMRESSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructFlexGMRESSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESSetMaxIter_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructFlexGMRESSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructFlexGMRESSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructFlexGMRESSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESSetMinIter_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int min_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructFlexGMRESSetMinIter_flt( solver, min_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructFlexGMRESSetMinIter_dbl( solver, min_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructFlexGMRESSetMinIter_long_dbl( solver, min_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESSetModifyPC_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_PtrToModifyPCFcn modify_pc ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructFlexGMRESSetModifyPC_flt( solver, modify_pc ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructFlexGMRESSetModifyPC_dbl( solver, modify_pc ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructFlexGMRESSetModifyPC_long_dbl( solver, modify_pc ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESSetPrecond_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructFlexGMRESSetPrecond_flt( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructFlexGMRESSetPrecond_dbl( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructFlexGMRESSetPrecond_long_dbl( solver, precond, precond_setup, precond_solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int print_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructFlexGMRESSetPrintLevel_flt( solver, print_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructFlexGMRESSetPrintLevel_dbl( solver, print_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructFlexGMRESSetPrintLevel_long_dbl( solver, print_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESSetTol_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructFlexGMRESSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructFlexGMRESSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructFlexGMRESSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESSetup_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructFlexGMRESSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructFlexGMRESSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructFlexGMRESSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructFlexGMRESSolve_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructFlexGMRESSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructFlexGMRESSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructFlexGMRESSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_SStructSolver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGMRESCreate_flt( comm, solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGMRESCreate_dbl( comm, solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGMRESCreate_long_dbl( comm, solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESDestroy_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGMRESDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGMRESDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGMRESDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGMRESGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGMRESGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGMRESGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESGetNumIterations_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGMRESGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGMRESGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGMRESGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESGetResidual_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, void **residual ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGMRESGetResidual_flt( solver, residual ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGMRESGetResidual_dbl( solver, residual ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGMRESGetResidual_long_dbl( solver, residual ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGMRESSetAbsoluteTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGMRESSetAbsoluteTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGMRESSetAbsoluteTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESSetKDim_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int k_dim ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGMRESSetKDim_flt( solver, k_dim ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGMRESSetKDim_dbl( solver, k_dim ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGMRESSetKDim_long_dbl( solver, k_dim ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESSetLogging_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGMRESSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGMRESSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGMRESSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESSetMaxIter_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGMRESSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGMRESSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGMRESSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESSetMinIter_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int min_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGMRESSetMinIter_flt( solver, min_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGMRESSetMinIter_dbl( solver, min_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGMRESSetMinIter_long_dbl( solver, min_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESSetPrecond_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGMRESSetPrecond_flt( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGMRESSetPrecond_dbl( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGMRESSetPrecond_long_dbl( solver, precond, precond_setup, precond_solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int print_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGMRESSetPrintLevel_flt( solver, print_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGMRESSetPrintLevel_dbl( solver, print_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGMRESSetPrintLevel_long_dbl( solver, print_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESSetStopCrit_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int stop_crit ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGMRESSetStopCrit_flt( solver, stop_crit ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGMRESSetStopCrit_dbl( solver, stop_crit ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGMRESSetStopCrit_long_dbl( solver, stop_crit ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESSetTol_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGMRESSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGMRESSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGMRESSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESSetup_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGMRESSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGMRESSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGMRESSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGMRESSolve_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGMRESSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGMRESSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGMRESSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_SStructSolver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructLGMRESCreate_flt( comm, solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructLGMRESCreate_dbl( comm, solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructLGMRESCreate_long_dbl( comm, solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESDestroy_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructLGMRESDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructLGMRESDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructLGMRESDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructLGMRESGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructLGMRESGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructLGMRESGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESGetNumIterations_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructLGMRESGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructLGMRESGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructLGMRESGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESGetResidual_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, void **residual ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructLGMRESGetResidual_flt( solver, residual ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructLGMRESGetResidual_dbl( solver, residual ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructLGMRESGetResidual_long_dbl( solver, residual ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructLGMRESSetAbsoluteTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructLGMRESSetAbsoluteTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructLGMRESSetAbsoluteTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESSetAugDim_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int aug_dim ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructLGMRESSetAugDim_flt( solver, aug_dim ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructLGMRESSetAugDim_dbl( solver, aug_dim ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructLGMRESSetAugDim_long_dbl( solver, aug_dim ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESSetKDim_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int k_dim ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructLGMRESSetKDim_flt( solver, k_dim ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructLGMRESSetKDim_dbl( solver, k_dim ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructLGMRESSetKDim_long_dbl( solver, k_dim ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESSetLogging_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructLGMRESSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructLGMRESSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructLGMRESSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESSetMaxIter_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructLGMRESSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructLGMRESSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructLGMRESSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESSetMinIter_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int min_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructLGMRESSetMinIter_flt( solver, min_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructLGMRESSetMinIter_dbl( solver, min_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructLGMRESSetMinIter_long_dbl( solver, min_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESSetPrecond_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructLGMRESSetPrecond_flt( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructLGMRESSetPrecond_dbl( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructLGMRESSetPrecond_long_dbl( solver, precond, precond_setup, precond_solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int print_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructLGMRESSetPrintLevel_flt( solver, print_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructLGMRESSetPrintLevel_dbl( solver, print_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructLGMRESSetPrintLevel_long_dbl( solver, print_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESSetTol_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructLGMRESSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructLGMRESSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructLGMRESSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESSetup_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructLGMRESSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructLGMRESSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructLGMRESSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructLGMRESSolve_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructLGMRESSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructLGMRESSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructLGMRESSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructPCGCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_SStructSolver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructPCGCreate_flt( comm, solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructPCGCreate_dbl( comm, solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructPCGCreate_long_dbl( comm, solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructPCGDestroy_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructPCGDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructPCGDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructPCGDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructPCGGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructPCGGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructPCGGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructPCGGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructPCGGetNumIterations_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructPCGGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructPCGGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructPCGGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructPCGGetResidual_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, void **residual ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructPCGGetResidual_flt( solver, residual ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructPCGGetResidual_dbl( solver, residual ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructPCGGetResidual_long_dbl( solver, residual ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructPCGSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructPCGSetAbsoluteTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructPCGSetAbsoluteTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructPCGSetAbsoluteTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructPCGSetLogging_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructPCGSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructPCGSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructPCGSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructPCGSetMaxIter_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructPCGSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructPCGSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructPCGSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructPCGSetPrecond_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_PtrToSStructSolverFcn precond, HYPRE_PtrToSStructSolverFcn precond_setup, void *precond_solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructPCGSetPrecond_flt( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructPCGSetPrecond_dbl( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructPCGSetPrecond_long_dbl( solver, precond, precond_setup, precond_solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructPCGSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructPCGSetPrintLevel_flt( solver, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructPCGSetPrintLevel_dbl( solver, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructPCGSetPrintLevel_long_dbl( solver, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructPCGSetRelChange_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int rel_change ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructPCGSetRelChange_flt( solver, rel_change ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructPCGSetRelChange_dbl( solver, rel_change ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructPCGSetRelChange_long_dbl( solver, rel_change ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructPCGSetTol_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructPCGSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructPCGSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructPCGSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructPCGSetTwoNorm_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int two_norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructPCGSetTwoNorm_flt( solver, two_norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructPCGSetTwoNorm_dbl( solver, two_norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructPCGSetTwoNorm_long_dbl( solver, two_norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructPCGSetup_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructPCGSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructPCGSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructPCGSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructPCGSolve_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructPCGSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructPCGSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructPCGSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_SStructSolver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSSAMGCreate_flt( comm, solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSSAMGCreate_dbl( comm, solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSSAMGCreate_long_dbl( comm, solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGDestroy_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSSAMGDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSSAMGDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSSAMGDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSSAMGGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSSAMGGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSSAMGGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGGetNumIterations_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSSAMGGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSSAMGGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSSAMGGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetCoarseSolverType_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int csolver_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSSAMGSetCoarseSolverType_flt( solver, csolver_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSSAMGSetCoarseSolverType_dbl( solver, csolver_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSSAMGSetCoarseSolverType_long_dbl( solver, csolver_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetDxyz_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int nparts, void *dxyz ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSSAMGSetDxyz_flt( solver, nparts, dxyz ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSSAMGSetDxyz_dbl( solver, nparts, dxyz ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSSAMGSetDxyz_long_dbl( solver, nparts, dxyz ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetInterpType_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int interp_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSSAMGSetInterpType_flt( solver, interp_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSSAMGSetInterpType_dbl( solver, interp_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSSAMGSetInterpType_long_dbl( solver, interp_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetLogging_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSSAMGSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSSAMGSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSSAMGSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetMaxCoarseSize_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int max_coarse_size ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSSAMGSetMaxCoarseSize_flt( solver, max_coarse_size ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSSAMGSetMaxCoarseSize_dbl( solver, max_coarse_size ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSSAMGSetMaxCoarseSize_long_dbl( solver, max_coarse_size ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetMaxIter_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSSAMGSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSSAMGSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSSAMGSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetMaxLevels_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int max_levels ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSSAMGSetMaxLevels_flt( solver, max_levels ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSSAMGSetMaxLevels_dbl( solver, max_levels ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSSAMGSetMaxLevels_long_dbl( solver, max_levels ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetNonGalerkinRAP_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int non_galerkin ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSSAMGSetNonGalerkinRAP_flt( solver, non_galerkin ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSSAMGSetNonGalerkinRAP_dbl( solver, non_galerkin ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSSAMGSetNonGalerkinRAP_long_dbl( solver, non_galerkin ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetNonZeroGuess_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSSAMGSetNonZeroGuess_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSSAMGSetNonZeroGuess_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSSAMGSetNonZeroGuess_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetNumCoarseRelax_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int num_coarse_relax ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSSAMGSetNumCoarseRelax_flt( solver, num_coarse_relax ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSSAMGSetNumCoarseRelax_dbl( solver, num_coarse_relax ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSSAMGSetNumCoarseRelax_long_dbl( solver, num_coarse_relax ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetNumPostRelax_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int num_post_relax ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSSAMGSetNumPostRelax_flt( solver, num_post_relax ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSSAMGSetNumPostRelax_dbl( solver, num_post_relax ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSSAMGSetNumPostRelax_long_dbl( solver, num_post_relax ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetNumPreRelax_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int num_pre_relax ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSSAMGSetNumPreRelax_flt( solver, num_pre_relax ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSSAMGSetNumPreRelax_dbl( solver, num_pre_relax ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSSAMGSetNumPreRelax_long_dbl( solver, num_pre_relax ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetPrintFreq_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int print_freq ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSSAMGSetPrintFreq_flt( solver, print_freq ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSSAMGSetPrintFreq_dbl( solver, print_freq ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSSAMGSetPrintFreq_long_dbl( solver, print_freq ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int print_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSSAMGSetPrintLevel_flt( solver, print_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSSAMGSetPrintLevel_dbl( solver, print_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSSAMGSetPrintLevel_long_dbl( solver, print_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetRelChange_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int rel_change ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSSAMGSetRelChange_flt( solver, rel_change ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSSAMGSetRelChange_dbl( solver, rel_change ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSSAMGSetRelChange_long_dbl( solver, rel_change ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetRelaxType_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int relax_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSSAMGSetRelaxType_flt( solver, relax_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSSAMGSetRelaxType_dbl( solver, relax_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSSAMGSetRelaxType_long_dbl( solver, relax_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetRelaxWeight_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, hypre_long_double weight ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSSAMGSetRelaxWeight_flt( solver, weight ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSSAMGSetRelaxWeight_dbl( solver, weight ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSSAMGSetRelaxWeight_long_dbl( solver, weight ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetSkipRelax_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int skip_relax ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSSAMGSetSkipRelax_flt( solver, skip_relax ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSSAMGSetSkipRelax_dbl( solver, skip_relax ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSSAMGSetSkipRelax_long_dbl( solver, skip_relax ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetTol_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSSAMGSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSSAMGSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSSAMGSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetZeroGuess_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSSAMGSetZeroGuess_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSSAMGSetZeroGuess_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSSAMGSetZeroGuess_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSetup_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSSAMGSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSSAMGSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSSAMGSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSSAMGSolve_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSSAMGSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSSAMGSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSSAMGSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSetupInterpreter_pre( HYPRE_Precision precision, mv_InterfaceInterpreter *i ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSetupInterpreter_flt( i ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSetupInterpreter_dbl( i ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSetupInterpreter_long_dbl( i ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSetupMatvec_pre( HYPRE_Precision precision, HYPRE_MatvecFunctions *mv ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSetupMatvec_flt( mv ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSetupMatvec_dbl( mv ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSetupMatvec_long_dbl( mv ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSplitCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_SStructSolver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSplitCreate_flt( comm, solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSplitCreate_dbl( comm, solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSplitCreate_long_dbl( comm, solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSplitDestroy_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSplitDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSplitDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSplitDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSplitGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSplitGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSplitGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSplitGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSplitGetNumIterations_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSplitGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSplitGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSplitGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSplitPrintLogging_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSplitPrintLogging_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSplitPrintLogging_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSplitPrintLogging_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSplitSetLogging_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSplitSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSplitSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSplitSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSplitSetMaxIter_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSplitSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSplitSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSplitSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSplitSetNonZeroGuess_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSplitSetNonZeroGuess_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSplitSetNonZeroGuess_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSplitSetNonZeroGuess_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSplitSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int print_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSplitSetPrintLevel_flt( solver, print_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSplitSetPrintLevel_dbl( solver, print_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSplitSetPrintLevel_long_dbl( solver, print_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSplitSetStructSolver_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int ssolver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSplitSetStructSolver_flt( solver, ssolver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSplitSetStructSolver_dbl( solver, ssolver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSplitSetStructSolver_long_dbl( solver, ssolver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSplitSetTol_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSplitSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSplitSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSplitSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSplitSetZeroGuess_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSplitSetZeroGuess_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSplitSetZeroGuess_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSplitSetZeroGuess_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSplitSetup_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSplitSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSplitSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSplitSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSplitSolve_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSplitSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSplitSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSplitSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_SStructSolver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSysPFMGCreate_flt( comm, solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSysPFMGCreate_dbl( comm, solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSysPFMGCreate_long_dbl( comm, solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGDestroy_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSysPFMGDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSysPFMGDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSysPFMGDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSysPFMGGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSysPFMGGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSysPFMGGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGGetNumIterations_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSysPFMGGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSysPFMGGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSysPFMGGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGSetDxyz_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, void *dxyz ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSysPFMGSetDxyz_flt( solver, dxyz ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSysPFMGSetDxyz_dbl( solver, dxyz ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSysPFMGSetDxyz_long_dbl( solver, dxyz ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGSetJacobiWeight_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, hypre_long_double weight ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSysPFMGSetJacobiWeight_flt( solver, weight ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSysPFMGSetJacobiWeight_dbl( solver, weight ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSysPFMGSetJacobiWeight_long_dbl( solver, weight ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGSetLogging_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSysPFMGSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSysPFMGSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSysPFMGSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGSetMaxIter_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSysPFMGSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSysPFMGSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSysPFMGSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGSetNonZeroGuess_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSysPFMGSetNonZeroGuess_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSysPFMGSetNonZeroGuess_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSysPFMGSetNonZeroGuess_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGSetNumPostRelax_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int num_post_relax ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSysPFMGSetNumPostRelax_flt( solver, num_post_relax ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSysPFMGSetNumPostRelax_dbl( solver, num_post_relax ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSysPFMGSetNumPostRelax_long_dbl( solver, num_post_relax ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGSetNumPreRelax_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int num_pre_relax ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSysPFMGSetNumPreRelax_flt( solver, num_pre_relax ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSysPFMGSetNumPreRelax_dbl( solver, num_pre_relax ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSysPFMGSetNumPreRelax_long_dbl( solver, num_pre_relax ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int print_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSysPFMGSetPrintLevel_flt( solver, print_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSysPFMGSetPrintLevel_dbl( solver, print_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSysPFMGSetPrintLevel_long_dbl( solver, print_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGSetRelChange_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int rel_change ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSysPFMGSetRelChange_flt( solver, rel_change ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSysPFMGSetRelChange_dbl( solver, rel_change ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSysPFMGSetRelChange_long_dbl( solver, rel_change ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGSetRelaxType_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int relax_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSysPFMGSetRelaxType_flt( solver, relax_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSysPFMGSetRelaxType_dbl( solver, relax_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSysPFMGSetRelaxType_long_dbl( solver, relax_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGSetSkipRelax_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_Int skip_relax ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSysPFMGSetSkipRelax_flt( solver, skip_relax ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSysPFMGSetSkipRelax_dbl( solver, skip_relax ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSysPFMGSetSkipRelax_long_dbl( solver, skip_relax ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGSetTol_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSysPFMGSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSysPFMGSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSysPFMGSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGSetZeroGuess_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSysPFMGSetZeroGuess_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSysPFMGSetZeroGuess_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSysPFMGSetZeroGuess_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGSetup_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSysPFMGSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSysPFMGSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSysPFMGSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructSysPFMGSolve_pre( HYPRE_Precision precision, HYPRE_SStructSolver solver, HYPRE_SStructMatrix A, HYPRE_SStructVector b, HYPRE_SStructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructSysPFMGSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructSysPFMGSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructSysPFMGSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + + + +#endif + diff --git a/src/sstruct_ls/nd1_amge_interpolation.c b/src/sstruct_ls/nd1_amge_interpolation.c deleted file mode 100644 index 8af35e781c..0000000000 --- a/src/sstruct_ls/nd1_amge_interpolation.c +++ /dev/null @@ -1,473 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_IJ_mv.h" -#include "_hypre_sstruct_ls.h" - -#include "nd1_amge_interpolation.h" - -/* - Assume that we are given a fine and coarse topology and the - coarse degrees of freedom (DOFs) have been chosen. Assume also, - that the global interpolation matrix dof_DOF has a prescribed - nonzero pattern. Then, the fine degrees of freedom can be split - into 4 groups (here "i" stands for "interior"): - - NODEidof - dofs which are interpolated only from the DOF - in one coarse vertex - EDGEidof - dofs which are interpolated only from the DOFs - in one coarse edge - FACEidof - dofs which are interpolated only from the DOFs - in one coarse face - ELEMidof - dofs which are interpolated only from the DOFs - in one coarse element - - The interpolation operator dof_DOF can be build in 4 steps, by - consequently filling-in the rows corresponding to the above groups. - The code below uses harmonic extension to extend the interpolation - 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_Int ierr = 0; - - HYPRE_Int i, j; - HYPRE_BigInt big_k; - HYPRE_BigInt *offproc_rnums; - HYPRE_Int *swap = NULL; - - hypre_ParCSRMatrix * dof_DOF = (hypre_ParCSRMatrix *)hypre_IJMatrixObject(IJ_dof_DOF); - hypre_ParCSRMatrix * ELEM_DOF = ELEM_EDGE; - hypre_ParCSRMatrix * ELEM_FACEidof; - hypre_ParCSRMatrix * ELEM_EDGEidof; - hypre_CSRMatrix *A, *P; - HYPRE_Int numELEM = hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(ELEM_EDGE)); - - HYPRE_Int getrow_ierr; - HYPRE_Int three_dimensional_problem; - - MPI_Comm comm = hypre_ParCSRMatrixComm(Aee); - HYPRE_Int myproc; - - hypre_MPI_Comm_rank(comm, &myproc); - -#if 0 - hypre_IJMatrix * ij_dof_DOF = hypre_CTAlloc(hypre_IJMatrix, 1, HYPRE_MEMORY_HOST); - /* Convert dof_DOF to IJ matrix, so we can use AddToValues */ - hypre_IJMatrixComm(ij_dof_DOF) = hypre_ParCSRMatrixComm(dof_DOF); - hypre_IJMatrixRowPartitioning(ij_dof_DOF) = - hypre_ParCSRMatrixRowStarts(dof_DOF); - hypre_IJMatrixColPartitioning(ij_dof_DOF) = - hypre_ParCSRMatrixColStarts(dof_DOF); - hypre_IJMatrixObject(ij_dof_DOF) = dof_DOF; - hypre_IJMatrixAssembleFlag(ij_dof_DOF) = 1; -#endif - - /* 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[i] = (OffProcRows[i] -> row); - swap[i] = i; - } - } - - if (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); - - /* Loop over local coarse elements */ - big_k = hypre_ParCSRMatrixFirstRowIndex(ELEM_EDGE); - for (i = 0; i < numELEM; i++, big_k++) - { - HYPRE_Int size1, size2; - HYPRE_BigInt *col_ind0, *col_ind1, *col_ind2; - - HYPRE_BigInt *DOF0, *DOF; - HYPRE_Int num_DOF; - HYPRE_Int num_idof; - HYPRE_BigInt *idof0, *idof, *bdof; - HYPRE_Int num_bdof; - - HYPRE_Real *boolean_data; - - /* 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[j] = DOF0[j]; - } - hypre_ParCSRMatrixRestoreRow (ELEM_DOF, big_k, &num_DOF, &DOF0, &boolean_data); - - 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[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); - - /* 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[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[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); - 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_BigQsort0(bdof, 0, num_bdof - 1); - - /* A = extract_rows(Aee, idof) */ - A = hypre_CSRMatrixCreate (num_idof, num_idof + num_bdof, - num_idof * (num_idof + num_bdof)); - hypre_CSRMatrixBigInitialize(A); - { - 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], &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]; - } - } - - /* P = extract_rows(dof_DOF, idof+bdof) */ - 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); - HYPRE_Real *data = hypre_CSRMatrixData(P); - HYPRE_Int m; - - 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], &size1, &tmp_J, &tmp_data); - if (getrow_ierr >= 0) - { - 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], &size1, &tmp_J, &tmp_data); - /* search for OffProcRows */ - m = 0; - while (m < num_OffProcRows) - { - if (offproc_rnums[m] == idof[j]) - { - break; - } - else - { - m++; - } - } - size1 = (OffProcRows[swap[m]] -> ncols); - tmp_J = (OffProcRows[swap[m]] -> cols); - 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], &size1, &tmp_J, &tmp_data); - if (getrow_ierr >= 0) - { - 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], &size1, &tmp_J, &tmp_data); - /* search for OffProcRows */ - m = 0; - while (m < num_OffProcRows) - { - if (offproc_rnums[m] == bdof[j - num_idof]) - { - break; - } - else - { - m++; - } - } - 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, 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]; - } - } - } - - /* Pi = Aii^{-1} Aib Pb */ - hypre_HarmonicExtension (A, P, num_DOF, DOF, - num_idof, idof, num_bdof, bdof); - - /* Insert Pi in dof_DOF */ - { - HYPRE_Int * ncols = hypre_CTAlloc(HYPRE_Int, num_idof, HYPRE_MEMORY_HOST); - HYPRE_Int * idof_indexes = hypre_CTAlloc(HYPRE_Int, num_idof, HYPRE_MEMORY_HOST); - - for (j = 0; j < num_idof; j++) - { - ncols[j] = num_DOF; - idof_indexes[j] = j * num_DOF; - } - - hypre_IJMatrixAddToValuesParCSR (IJ_dof_DOF, - num_idof, ncols, idof, idof_indexes, - hypre_CSRMatrixBigJ(P), - hypre_CSRMatrixData(P)); - - hypre_TFree(ncols, HYPRE_MEMORY_HOST); - hypre_TFree(idof_indexes, HYPRE_MEMORY_HOST); - } - - hypre_TFree(DOF, HYPRE_MEMORY_HOST); - hypre_TFree(idof, HYPRE_MEMORY_HOST); - if (three_dimensional_problem) - { - hypre_TFree(col_ind1, HYPRE_MEMORY_HOST); - } - hypre_TFree(col_ind2, HYPRE_MEMORY_HOST); - hypre_TFree(bdof, HYPRE_MEMORY_HOST); - - hypre_CSRMatrixDestroy(A); - hypre_CSRMatrixDestroy(P); - } - -#if 0 - hypre_TFree(ij_dof_DOF, HYPRE_MEMORY_HOST); -#endif - - if (three_dimensional_problem) - { - hypre_ParCSRMatrixDestroy(ELEM_FACEidof); - } - hypre_ParCSRMatrixDestroy(ELEM_EDGEidof); - - if (num_OffProcRows) - { - hypre_TFree(offproc_rnums, HYPRE_MEMORY_HOST); - hypre_TFree(swap, HYPRE_MEMORY_HOST); - } - - return ierr; -} - - - - -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 ierr = 0; - - HYPRE_Int i, j, k, l, m; - HYPRE_Real factor; - - HYPRE_Int *IA = hypre_CSRMatrixI(A); - HYPRE_BigInt *JA = hypre_CSRMatrixBigJ(A); - HYPRE_Real *dataA = hypre_CSRMatrixData(A); - - HYPRE_Int *IP = hypre_CSRMatrixI(P); - 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); - - /* Loop over the rows of A */ - for (i = 0; i < num_idof; i++) - for (j = IA[i]; j < IA[i + 1]; j++) - { - /* Global to local*/ - 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); - if (k > -1) - { - for (l = IP[k + num_idof]; l < IP[k + num_idof + 1]; l++) - { - m = hypre_BigBinarySearch(DOF, JP[l], num_DOF); - if (m > -1) - { - m += i * num_DOF; - /* Pi[i*num_DOF+m] += dataA[j] * dataP[l];*/ - Pi[m] += dataA[j] * dataP[l]; - } - } - } - } - /* If a column is an idof, put it in Aii */ - else - { - 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) - { - 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]; - } - } - - /* Back Substitution */ - 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 (m = 0; m < 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]; - } - } - - /* Put -Pi back in P. We assume that each idof depends on _all_ DOFs */ - for (i = 0; i < num_idof; i++, JP += num_DOF, dataP += num_DOF) - for (j = 0; j < num_DOF; j++) - { - JP[j] = DOF[j]; - dataP[j] = -Pi[i * num_DOF + j]; - } - - hypre_TFree(Aii, HYPRE_MEMORY_HOST); - hypre_TFree(Pi, HYPRE_MEMORY_HOST); - - return ierr; -} diff --git a/src/sstruct_ls/nd1_amge_interpolation.h b/src/sstruct_ls/nd1_amge_interpolation.h deleted file mode 100644 index 049b33a83b..0000000000 --- a/src/sstruct_ls/nd1_amge_interpolation.h +++ /dev/null @@ -1,62 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_ND1_AMGE_INTERPOLATION -#define hypre_ND1_AMGE_INTERPOLATION - -/* - Function: hypre_ND1AMGeInterpolation - - Defines an operator-dependent (AMGe) interpolation for the fine interior - edges, given the (e.g. geometric) interpolation for the fine edges on the - boundaries of coarse elements. The parameters are: - - Aee [input] - The stiffness matrix for lowest order Nedelec elements on the fine level. - - ELEM_iedge, FACE_iedge, EDGE_iedge [input] - coarse grid elements, faces and edges. - - ELEM_FACE, ELEM_EDGE [input] - - edge_EDGE [input/output] - The interpolation from coarse to fine edges. This is a partially filled - matrix, with set (and fixed) nonzero pattern. We assume that the rows - corresponding to fine edges on the boundary of a coarse element are - given and complete the construction by computing the rest of the entries. - - 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); - -/* - Function: hypre_HarmonicExtension - - Defines the interpolation operator Pi:DOF->idof by harmonically extending - Pb:DOF->bdof based on the operator A. Specifically, - A = [Aii,Aib] is idof x (idof+bdof) - P = [-Pi;Pb] is (idof+bdof) x DOF - and the function computes - Pi = Aii^{-1} Aib Pb. - The columns in A and P use global numbering, while the rows are numbered - 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); - -#endif diff --git a/src/sstruct_ls/node_relax.c b/src/sstruct_ls/node_relax.c index 1f9c1bfed7..b920bdffc1 100644 --- a/src/sstruct_ls/node_relax.c +++ b/src/sstruct_ls/node_relax.c @@ -39,8 +39,6 @@ typedef struct hypre_SStructPVector *t; - HYPRE_Int **diag_rank; - /* defines sends and recieves for each struct_vector */ hypre_ComputePkg ***svec_compute_pkgs; hypre_CommHandle **comm_handle; @@ -79,7 +77,7 @@ hypre_NodeRelaxCreate( MPI_Comm comm ) hypre_Index stride; hypre_Index indices[1]; - relax_data = hypre_CTAlloc(hypre_NodeRelaxData, 1, HYPRE_MEMORY_HOST); + relax_data = hypre_CTAlloc(hypre_NodeRelaxData, 1, HYPRE_MEMORY_HOST); (relax_data -> comm) = comm; (relax_data -> time_index) = hypre_InitializeTiming("NodeRelax"); @@ -95,7 +93,6 @@ hypre_NodeRelaxCreate( MPI_Comm comm ) (relax_data -> nodeset_ranks) = NULL; (relax_data -> nodeset_strides) = NULL; (relax_data -> nodeset_indices) = NULL; - (relax_data -> diag_rank) = NULL; (relax_data -> t) = NULL; /* (relax_data -> A_loc) = NULL; @@ -158,15 +155,10 @@ hypre_NodeRelaxDestroy( void *relax_vdata ) hypre_TFree(relax_data -> x_loc, memory_location); hypre_TFree(relax_data -> A_loc, memory_location); */ + hypre_TFree(relax_data -> Ap, memory_location); 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); - } - hypre_TFree(relax_data -> diag_rank, HYPRE_MEMORY_HOST); hypre_FinalizeTiming(relax_data -> time_index); hypre_TFree(relax_data, HYPRE_MEMORY_HOST); @@ -193,11 +185,6 @@ hypre_NodeRelaxSetup( void *relax_vdata, HYPRE_Int ndim = hypre_SStructPMatrixNDim(A); hypre_SStructPVector *t; - HYPRE_Int **diag_rank; - /* - HYPRE_Real *A_loc; - HYPRE_Real *x_loc; - */ HYPRE_Real **Ap; HYPRE_Real **bp; HYPRE_Real **xp; @@ -207,8 +194,8 @@ hypre_NodeRelaxSetup( void *relax_vdata, hypre_ComputePkg **compute_pkgs; hypre_ComputePkg ***svec_compute_pkgs; hypre_CommHandle **comm_handle; + hypre_Index ustride; - hypre_Index diag_index; hypre_IndexRef stride; hypre_IndexRef index; @@ -244,6 +231,8 @@ hypre_NodeRelaxSetup( void *relax_vdata, HYPRE_MemoryLocation memory_location; + hypre_SetIndex(ustride, 1); + /*---------------------------------------------------------- * Set up the temp vector *----------------------------------------------------------*/ @@ -257,46 +246,12 @@ hypre_NodeRelaxSetup( void *relax_vdata, (relax_data -> t) = t; } - /*---------------------------------------------------------- - * Find the matrix diagonals, use diag_rank[vi][vj] = -1 to - * mark that the coresponding StructMatrix is NULL. - *----------------------------------------------------------*/ - - nvars = hypre_SStructPMatrixNVars(A); - - hypre_assert(nvars <= HYPRE_MAXVARS); - - 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); - for (vj = 0; vj < nvars; vj++) - { - if (hypre_SStructPMatrixSMatrix(A, vi, vj) != NULL) - { - sstencil = hypre_SStructPMatrixSStencil(A, vi, vj); - hypre_SetIndex3(diag_index, 0, 0, 0); - diag_rank[vi][vj] = hypre_StructStencilElementRank(sstencil, diag_index); - } - else - { - diag_rank[vi][vj] = -1; - } - } - } - - 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, memory_location); - A_loc = hypre_TAlloc(HYPRE_Real , i*nvars*nvars, memory_location); - */ - /* Allocate pointers for vector and matrix */ + nvars = hypre_SStructPMatrixNVars(A); + memory_location = hypre_StructMatrixMemoryLocation(hypre_SStructPMatrixSMatrix(A, 0, 0)); bp = hypre_TAlloc(HYPRE_Real *, nvars, memory_location); xp = hypre_TAlloc(HYPRE_Real *, nvars, memory_location); tp = hypre_TAlloc(HYPRE_Real *, nvars, memory_location); @@ -414,7 +369,7 @@ hypre_NodeRelaxSetup( void *relax_vdata, sstencil_union_shape); - hypre_CreateComputeInfo(sgrid, sstencil_union, &compute_info); + hypre_CreateComputeInfo(sgrid, ustride, sstencil_union, &compute_info); orig_indt_boxes = hypre_ComputeInfoIndtBoxes(compute_info); orig_dept_boxes = hypre_ComputeInfoDeptBoxes(compute_info); @@ -477,14 +432,14 @@ hypre_NodeRelaxSetup( void *relax_vdata, if (vi == -1) { - hypre_ComputePkgCreate(compute_info, + hypre_ComputePkgCreate(memory_location, compute_info, hypre_StructVectorDataSpace( hypre_SStructPVectorSVector(x, 0)), 1, sgrid, &compute_pkgs[p]); } else { - hypre_ComputePkgCreate(compute_info, + hypre_ComputePkgCreate(memory_location, compute_info, hypre_StructVectorDataSpace( hypre_SStructPVectorSVector(x, vi)), 1, sgrid, &svec_compute_pkgs[p][vi]); @@ -505,7 +460,6 @@ hypre_NodeRelaxSetup( void *relax_vdata, hypre_SStructPVectorRef(x, &(relax_data -> x)); hypre_SStructPVectorRef(b, &(relax_data -> b)); - (relax_data -> diag_rank) = diag_rank; /* (relax_data -> A_loc) = A_loc; (relax_data -> x_loc) = x_loc; @@ -544,10 +498,10 @@ hypre_NodeRelaxSetup( void *relax_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_NodeRelax( void *relax_vdata, - hypre_SStructPMatrix *A, - hypre_SStructPVector *b, - hypre_SStructPVector *x ) +hypre_NodeRelax( void *relax_vdata, + hypre_SStructPMatrix *A, + hypre_SStructPVector *b, + hypre_SStructPVector *x ) { hypre_NodeRelaxData *relax_data = (hypre_NodeRelaxData *)relax_vdata; @@ -558,9 +512,8 @@ hypre_NodeRelax( void *relax_vdata, 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_ComputePkg ***svec_compute_pkgs = (relax_data -> svec_compute_pkgs); hypre_CommHandle **comm_handle = (relax_data -> comm_handle); hypre_ComputePkg *compute_pkg; @@ -574,10 +527,6 @@ hypre_NodeRelax( void *relax_vdata, 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 **Ap = (relax_data -> Ap); HYPRE_Real **bp = (relax_data -> bp); HYPRE_Real **xp = (relax_data -> xp); @@ -619,6 +568,7 @@ hypre_NodeRelax( void *relax_vdata, hypre_StructStencil *stencil; hypre_Index *stencil_shape; HYPRE_Int stencil_size; + HYPRE_Int stencil_diag_entry; HYPRE_Int iter, p, compute_i, i, j, si; HYPRE_Int nodeset; @@ -706,10 +656,14 @@ hypre_NodeRelax( void *relax_vdata, { for (vj = 0; vj < nvars; vj++) { - if (hypre_SStructPMatrixSMatrix(A, vi, vj) != NULL) + A_block = hypre_SStructPMatrixSMatrix(A, vi, vj); + if (A_block != NULL) { - h_Ap[vi * nvars + vj] = hypre_StructMatrixBoxData( hypre_SStructPMatrixSMatrix(A, vi, vj), - i, diag_rank[vi][vj] ); + stencil = hypre_StructMatrixStencil(A_block); + stencil_diag_entry = hypre_StructStencilDiagEntry(stencil); + + h_Ap[vi * nvars + vj] = hypre_StructMatrixBoxData(A_block, i, + stencil_diag_entry); } else { @@ -740,15 +694,15 @@ hypre_NodeRelax( void *relax_vdata, b_data_box, start, stride, bi, x_data_box, start, stride, xi); { - 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_Int vi, vj; 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. *----------------------------------------------*/ + for (vi = 0; vi < nvars; vi++) { HYPRE_Real *bpi = bp[vi]; @@ -763,9 +717,7 @@ 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 */ + hypre_gselim(A_loc, x_loc, nvars); /*------------------------------------------------ * Copy solution from local storage. @@ -892,9 +844,11 @@ hypre_NodeRelax( void *relax_vdata, stencil = hypre_StructMatrixStencil(A_block); stencil_shape = hypre_StructStencilShape(stencil); stencil_size = hypre_StructStencilSize(stencil); + stencil_diag_entry = hypre_StructStencilDiagEntry(stencil); + for (si = 0; si < stencil_size; si++) { - if (si != diag_rank[vi][vj]) + if (si != stencil_diag_entry) { HYPRE_Real *Apij = hypre_StructMatrixBoxData(A_block, i, si); HYPRE_Real *xpj = hypre_StructVectorBoxData(x_block, i) + @@ -921,10 +875,13 @@ hypre_NodeRelax( void *relax_vdata, { for (vj = 0; vj < nvars; vj++) { - if (hypre_SStructPMatrixSMatrix(A, vi, vj) != NULL) + A_block = hypre_SStructPMatrixSMatrix(A, vi, vj); + if (A_block != NULL) { - h_Ap[vi * nvars + vj] = hypre_StructMatrixBoxData( hypre_SStructPMatrixSMatrix(A, vi, vj), - i, diag_rank[vi][vj]); + stencil = hypre_StructMatrixStencil(A_block); + stencil_diag_entry = hypre_StructStencilDiagEntry(stencil); + + h_Ap[vi * nvars + vj] = hypre_StructMatrixBoxData(A_block, i, stencil_diag_entry); } else { @@ -943,7 +900,7 @@ hypre_NodeRelax( void *relax_vdata, A_data_box, start, stride, Ai, t_data_box, start, stride, ti); { - HYPRE_Int vi, vj, err; + HYPRE_Int vi, vj; /* HYPRE_Real *A_loc = tA_loc + hypre_BoxLoopBlock() * nvars * nvars; HYPRE_Real *x_loc = tx_loc + hypre_BoxLoopBlock() * nvars; @@ -969,8 +926,7 @@ hypre_NodeRelax( void *relax_vdata, /*------------------------------------------------ * Invert intra-nodal coupling *----------------------------------------------*/ - hypre_gselim(A_loc, x_loc, nvars, err); - (void) err; + hypre_gselim(A_loc, x_loc, nvars); /*------------------------------------------------ * Copy solution from local storage. diff --git a/src/sstruct_ls/protos.h b/src/sstruct_ls/protos.h new file mode 100644 index 0000000000..495d5c7235 --- /dev/null +++ b/src/sstruct_ls/protos.h @@ -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) + ******************************************************************************/ + +/* HYPRE_sstruct_int.c */ +HYPRE_Int hypre_SStructSetRandomValues ( void *v, HYPRE_Int seed ); + +/* 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 ); + +/* 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 ); +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 ); +HYPRE_Int hypre_SStructKrylovMatvecDestroy ( void *matvec_data ); +HYPRE_Real hypre_SStructKrylovInnerProd ( void *x, void *y ); +HYPRE_Int hypre_SStructKrylovInnerProdTagged ( void *x, void *y, HYPRE_Int *num_tags_ptr, + HYPRE_Complex **iprod_ptr ); +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 ); + +/* 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 ); + +/* ssamg.c */ +void * hypre_SSAMGCreate ( hypre_MPI_Comm comm ); +HYPRE_Int hypre_SSAMGDestroy ( void *ssamg_vdata ); +HYPRE_Int hypre_SSAMGSetTol ( void *ssamg_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_SSAMGSetMaxIter ( void *ssamg_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_SSAMGSetMaxLevels ( void *ssamg_vdata, HYPRE_Int max_levels ); +HYPRE_Int hypre_SSAMGSetRelChange ( void *ssamg_vdata, HYPRE_Int rel_change ); +HYPRE_Int hypre_SSAMGSetZeroGuess ( void *ssamg_vdata, HYPRE_Int zero_guess ); +HYPRE_Int hypre_SSAMGSetNonGalerkinRAP ( void *ssamg_vdata, HYPRE_Int non_galerkin ); +HYPRE_Int hypre_SSAMGSetDxyz ( void *ssamg_vdata, HYPRE_Int nparts, HYPRE_Real **dxyz ); +HYPRE_Int hypre_SSAMGSetRelaxType ( void *ssamg_vdata, HYPRE_Int relax_type ); +HYPRE_Int hypre_SSAMGSetInterpType ( void *ssamg_vdata, HYPRE_Int interp_type ); +HYPRE_Int hypre_SSAMGSetRelaxWeight ( void *ssamg_vdata, HYPRE_Real relax_weight ); +HYPRE_Int hypre_SSAMGSetSkipRelax ( void *ssamg_vdata, HYPRE_Int skip_relax ); +HYPRE_Int hypre_SSAMGSetNumPreRelax ( void *ssamg_vdata, HYPRE_Int num_pre_relax ); +HYPRE_Int hypre_SSAMGSetNumPosRelax ( void *ssamg_vdata, HYPRE_Int num_pos_relax ); +HYPRE_Int hypre_SSAMGSetNumCoarseRelax ( void *ssamg_vdata, HYPRE_Int num_coarse_relax ); +HYPRE_Int hypre_SSAMGSetMaxCoarseSize ( void *ssamg_vdata, HYPRE_Int max_coarse_size ); +HYPRE_Int hypre_SSAMGSetCoarseSolverType ( void *ssamg_vdata, HYPRE_Int csolver_type ); +HYPRE_Int hypre_SSAMGSetPrintLevel ( void *ssamg_vdata, HYPRE_Int print_level ); +HYPRE_Int hypre_SSAMGSetPrintFreq ( void *ssamg_vdata, HYPRE_Int print_freq ); +HYPRE_Int hypre_SSAMGSetLogging ( void *ssamg_vdata, HYPRE_Int logging ); +HYPRE_Int hypre_SSAMGPrintLogging ( void *ssamg_vdata ); +HYPRE_Int hypre_SSAMGPrintStats ( void *ssamg_vdata ); +HYPRE_Int hypre_SSAMGGetNumIterations ( void *ssamg_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_SSAMGGetFinalRelativeResidualNorm ( void *ssamg_vdata, + HYPRE_Real *relative_residual_norm ); + +/* ssamg_csolver.c */ +HYPRE_Int hypre_SSAMGCoarseSolverSetup( void *ssamg_vdata ); +HYPRE_Int hypre_SSAMGCoarseSolve( void *ssamg_vdata ); +HYPRE_Int hypre_SSAMGCoarseSolverDestroy( void *ssamg_vdata ); + +/* ssamg_interp.c */ +hypre_SStructMatrix* hypre_SSAMGCreateInterpOp ( hypre_SStructMatrix *A, hypre_SStructGrid *cgrid, + HYPRE_Int *cdir_p ); +HYPRE_Int hypre_SSAMGSetupInterpOp ( hypre_SStructMatrix *A, HYPRE_Int *cdir_p, + hypre_SStructMatrix *P, HYPRE_Int interp_type ); + +/* ssamg_uinterp.c */ +HYPRE_Int hypre_SSAMGSetupUInterpOp ( hypre_SStructMatrix *A, HYPRE_Int *cdir_p, + hypre_SStructMatrix *P, HYPRE_Int interp_type ); + +/* ssamg_setup_rap.c */ +HYPRE_Int hypre_SSAMGComputeRAP ( hypre_SStructMatrix *A, hypre_SStructMatrix *P, + hypre_SStructGrid **cgrid, HYPRE_Int *cdir_p, HYPRE_Int non_galerkin, + hypre_SStructMatrix **Ac_ptr ); +HYPRE_Int hypre_SSAMGComputeRAPNonGlk ( hypre_SStructMatrix *A, hypre_SStructMatrix *P, + HYPRE_Int *cdir_p, hypre_SStructMatrix **Ac_ptr ); + +/* ssamg_relax.c */ +HYPRE_Int hypre_SSAMGRelaxCreate ( MPI_Comm comm, HYPRE_Int nparts, void **relax_vdata_ptr ); +HYPRE_Int hypre_SSAMGRelaxDestroy ( void *relax_vdata ); +HYPRE_Int hypre_SSAMGRelaxSetup ( void *relax_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, + hypre_SStructVector *x ); +HYPRE_Int hypre_SSAMGRelax ( void *relax_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, + hypre_SStructVector *x ); +HYPRE_Int hypre_SSAMGRelaxGeneric ( void *relax_vdata, hypre_SStructMatrix *A, + hypre_SStructVector *b, hypre_SStructVector *x ); +HYPRE_Int hypre_SSAMGRelaxJacobi ( void *relax_vdata, hypre_SStructMatrix *A, + hypre_SStructVector *b, hypre_SStructVector *x ); +HYPRE_Int hypre_SSAMGRelaxSetPreRelax ( void *relax_vdata ); +HYPRE_Int hypre_SSAMGRelaxSetPostRelax ( void *relax_vdata ); +HYPRE_Int hypre_SSAMGRelaxSetTol ( void *relax_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_SSAMGRelaxSetWeights ( void *relax_vdata, HYPRE_Real *weights ); +HYPRE_Int hypre_SSAMGRelaxSetActiveParts ( void *relax_vdata, HYPRE_Int *active_p ); +HYPRE_Int hypre_SSAMGRelaxSetMatvecData ( void *relax_vdata, void *matvec_vdata ); +HYPRE_Int hypre_SSAMGRelaxSetNumNodesets ( void *relax_vdata, HYPRE_Int num_nodesets ); +HYPRE_Int hypre_SSAMGRelaxSetNodeset ( void *relax_vdata, HYPRE_Int nodeset, HYPRE_Int nodeset_size, + hypre_Index nodeset_stride, hypre_Index *nodeset_indices ); +HYPRE_Int hypre_SSAMGRelaxSetNodesetRank ( void *relax_vdata, HYPRE_Int nodeset, + HYPRE_Int nodeset_rank ); +HYPRE_Int hypre_SSAMGRelaxSetMaxIter ( void *relax_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_SSAMGRelaxSetZeroGuess ( void *relax_vdata, HYPRE_Int zero_guess ); +HYPRE_Int hypre_SSAMGRelaxSetType ( void *relax_vdata, HYPRE_Int relax_type ); +HYPRE_Int hypre_SSAMGRelaxSetTempVec ( void *relax_vdata, hypre_SStructVector *t ); +HYPRE_Int hypre_SSAMGRelaxGetRelaxWeight ( void *relax_vdata, HYPRE_Int part, HYPRE_Real *weight ); + +/* ssamg_setup.c */ +HYPRE_Int hypre_SSAMGSetup ( void *ssamg_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, + hypre_SStructVector *x ); +HYPRE_Int hypre_SSAMGComputeNumCoarseRelax ( void *ssamg_vdata ); +HYPRE_Int hypre_SSAMGComputeMaxLevels ( hypre_SStructGrid *grid, HYPRE_Int *max_levels ); +HYPRE_Int hypre_SSAMGComputeDxyz ( hypre_SStructMatrix *A, HYPRE_Real **dxyz, + HYPRE_Int *dxyz_flag ); +HYPRE_Int hypre_SSAMGCoarsen ( void *ssamg_vdata, hypre_SStructGrid *grid, HYPRE_Int *dxyz_flag, + HYPRE_Real **dxyz ); + +/* ssamg_solve.c */ +HYPRE_Int hypre_SSAMGSolve ( void *ssamg_vdata, hypre_SStructMatrix *A, hypre_SStructVector *b, + hypre_SStructVector *x ); + +/* 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 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_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 ); + +/* 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_SysPFMGZeroDiagonal( hypre_SStructPMatrix *A ); + +/* sys_pfmg_setup_interp.c */ +hypre_SStructPMatrix *hypre_SysPFMGCreateInterpOp( hypre_SStructPMatrix *A, HYPRE_Int cdir, + hypre_Index stride ); +HYPRE_Int hypre_SysPFMGSetupInterpOp( hypre_SStructPMatrix *P, hypre_SStructPMatrix *A, + HYPRE_Int cdir ); + +/* 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 ); + +/* sys_pfmg_solve.c */ +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_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_SysSemiRestrictDestroy ( void *sys_restrict_vdata ); diff --git a/src/sstruct_ls/ssamg.c b/src/sstruct_ls/ssamg.c new file mode 100644 index 0000000000..2ed01e3840 --- /dev/null +++ b/src/sstruct_ls/ssamg.c @@ -0,0 +1,518 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_sstruct_ls.h" +#include "ssamg.h" + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +void * +hypre_SSAMGCreate( hypre_MPI_Comm comm ) +{ + hypre_SSAMGData *ssamg_data; + HYPRE_Int d; + + ssamg_data = hypre_CTAlloc(hypre_SSAMGData, 1, HYPRE_MEMORY_HOST); + + (ssamg_data -> comm) = comm; + (ssamg_data -> time_index) = hypre_InitializeTiming("SSAMG"); + + /* set defaults */ + (ssamg_data -> tol) = 1.0e-06; + (ssamg_data -> max_iter) = 200; + (ssamg_data -> rel_change) = 0; + (ssamg_data -> non_galerkin) = 0; + (ssamg_data -> zero_guess) = 0; + (ssamg_data -> max_levels) = 0; + (ssamg_data -> relax_type) = 0; + (ssamg_data -> interp_type) = 0; + (ssamg_data -> skip_relax) = 0; + (ssamg_data -> usr_relax_weight) = 1.0; + (ssamg_data -> usr_set_rweight) = 0; + (ssamg_data -> num_pre_relax) = 1; + (ssamg_data -> num_post_relax) = 1; + (ssamg_data -> logging) = 0; + (ssamg_data -> print_level) = 0; + (ssamg_data -> print_freq) = 1; + + /* Coarse solver defaults */ + (ssamg_data -> csolver) = NULL; + (ssamg_data -> ij_Ac) = NULL; + (ssamg_data -> par_b) = NULL; + (ssamg_data -> par_x) = NULL; + (ssamg_data -> csolver_type) = 0; + (ssamg_data -> num_coarse_relax) = -1; + (ssamg_data -> max_coarse_size) = 0; + + /* initialize */ + (ssamg_data -> nparts) = -1; + (ssamg_data -> num_levels) = -1; + for (d = 0; d < HYPRE_MAXDIM; d++) + { + (ssamg_data -> dxyz[d]) = NULL; + } + + return (void *) ssamg_data; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGDestroy( void *ssamg_vdata ) +{ + hypre_SSAMGData *ssamg_data = (hypre_SSAMGData *) ssamg_vdata; + + HYPRE_Int num_levels; + HYPRE_Int max_levels; + HYPRE_Int l, d; + + if (ssamg_data) + { + if (hypre_SSAMGDataLogging(ssamg_data) > 0) + { + hypre_TFree(ssamg_data -> norms, HYPRE_MEMORY_HOST); + hypre_TFree(ssamg_data -> rel_norms, HYPRE_MEMORY_HOST); + } + + if (hypre_SSAMGDataNumLevels(ssamg_data) > -1) + { + num_levels = hypre_SSAMGDataNumLevels(ssamg_data); + max_levels = hypre_SSAMGDataMaxLevels(ssamg_data); + + /* Destroy data */ + for (l = 0; l < (num_levels - 1); l++) + { + hypre_SSAMGRelaxDestroy(ssamg_data -> relax_data_l[l]); + hypre_SStructMatvecDestroy(ssamg_data -> matvec_data_l[l]); + HYPRE_SStructGridDestroy(ssamg_data -> grid_l[l]); + HYPRE_SStructVectorDestroy(ssamg_data -> b_l[l]); + HYPRE_SStructVectorDestroy(ssamg_data -> x_l[l]); + HYPRE_SStructVectorDestroy(ssamg_data -> tx_l[l]); + HYPRE_SStructMatrixDestroy(ssamg_data -> A_l[l]); + HYPRE_SStructMatrixDestroy(ssamg_data -> P_l[l]); + HYPRE_SStructMatrixDestroy(ssamg_data -> RT_l[l]); + hypre_SStructMatvecDestroy(ssamg_data -> restrict_data_l[l]); + hypre_SStructMatvecDestroy(ssamg_data -> interp_data_l[l]); + hypre_TFree(ssamg_data -> cdir_l[l], HYPRE_MEMORY_HOST); + hypre_TFree(ssamg_data -> active_l[l], HYPRE_MEMORY_HOST); + hypre_TFree(ssamg_data -> relax_weights[l], HYPRE_MEMORY_HOST); + } + + /* Destroy coarse solver data */ + hypre_SSAMGCoarseSolverDestroy(ssamg_vdata); + + for (l = num_levels; l < max_levels; l++) + { + hypre_TFree(ssamg_data -> active_l[l], HYPRE_MEMORY_HOST); + hypre_TFree(ssamg_data -> relax_weights[l], HYPRE_MEMORY_HOST); + } + + hypre_TFree(ssamg_data -> b_l, HYPRE_MEMORY_HOST); + hypre_TFree(ssamg_data -> x_l, HYPRE_MEMORY_HOST); + hypre_TFree(ssamg_data -> tx_l, HYPRE_MEMORY_HOST); + hypre_TFree(ssamg_data -> A_l, HYPRE_MEMORY_HOST); + hypre_TFree(ssamg_data -> P_l, HYPRE_MEMORY_HOST); + hypre_TFree(ssamg_data -> RT_l, HYPRE_MEMORY_HOST); + hypre_TFree(ssamg_data -> grid_l, HYPRE_MEMORY_HOST); + hypre_TFree(ssamg_data -> cdir_l, HYPRE_MEMORY_HOST); + hypre_TFree(ssamg_data -> active_l, HYPRE_MEMORY_HOST); + hypre_TFree(ssamg_data -> relax_weights, HYPRE_MEMORY_HOST); + hypre_TFree(ssamg_data -> relax_data_l, HYPRE_MEMORY_HOST); + hypre_TFree(ssamg_data -> matvec_data_l, HYPRE_MEMORY_HOST); + hypre_TFree(ssamg_data -> restrict_data_l, HYPRE_MEMORY_HOST); + hypre_TFree(ssamg_data -> interp_data_l, HYPRE_MEMORY_HOST); + + ssamg_data -> e_l = NULL; + ssamg_data -> r_l = NULL; + } + + for (d = 0; d < HYPRE_MAXDIM; d++) + { + hypre_TFree(ssamg_data -> dxyz[d], HYPRE_MEMORY_HOST); + } + + hypre_FinalizeTiming(ssamg_data -> time_index); + hypre_TFree(ssamg_data, HYPRE_MEMORY_HOST); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetTol( void *ssamg_vdata, + HYPRE_Real tol) +{ + hypre_SSAMGData *ssamg_data = (hypre_SSAMGData *) ssamg_vdata; + + hypre_SSAMGDataTol(ssamg_data) = tol; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetMaxIter( void *ssamg_vdata, + HYPRE_Int max_iter) +{ + hypre_SSAMGData *ssamg_data = (hypre_SSAMGData *) ssamg_vdata; + + hypre_SSAMGDataMaxIter(ssamg_data) = max_iter; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetMaxLevels( void *ssamg_vdata, + HYPRE_Int max_levels) +{ + hypre_SSAMGData *ssamg_data = (hypre_SSAMGData *) ssamg_vdata; + + hypre_SSAMGDataMaxLevels(ssamg_data) = max_levels; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetRelChange( void *ssamg_vdata, + HYPRE_Int rel_change) +{ + hypre_SSAMGData *ssamg_data = (hypre_SSAMGData *) ssamg_vdata; + + hypre_SSAMGDataRelChange(ssamg_data) = rel_change; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetZeroGuess( void *ssamg_vdata, + HYPRE_Int zero_guess) +{ + hypre_SSAMGData *ssamg_data = (hypre_SSAMGData *) ssamg_vdata; + + hypre_SSAMGDataZeroGuess(ssamg_data) = zero_guess; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetNonGalerkinRAP( void *ssamg_vdata, + HYPRE_Int non_galerkin ) +{ + hypre_SSAMGData *ssamg_data = (hypre_SSAMGData *) ssamg_vdata; + + (ssamg_data -> non_galerkin) = non_galerkin; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetDxyz( void *ssamg_vdata, + HYPRE_Int nparts, + HYPRE_Real **dxyz ) +{ + hypre_SSAMGData *ssamg_data = (hypre_SSAMGData *) ssamg_vdata; + + HYPRE_Int part; + + for (part = 0; part < nparts; part++) + { + (ssamg_data -> dxyz[part][0]) = dxyz[part][0]; + (ssamg_data -> dxyz[part][1]) = dxyz[part][1]; + (ssamg_data -> dxyz[part][2]) = dxyz[part][2]; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetRelaxType( void *ssamg_vdata, + HYPRE_Int relax_type) +{ + hypre_SSAMGData *ssamg_data = (hypre_SSAMGData *) ssamg_vdata; + + hypre_SSAMGDataRelaxType(ssamg_data) = relax_type; + + /* Use default relaxation weight or user's for L1-Jacobi*/ + if (relax_type == 2) + { + hypre_SSAMGDataUsrSetRWeight(ssamg_data) = 1; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetInterpType( void *ssamg_vdata, + HYPRE_Int interp_type) +{ + hypre_SSAMGData *ssamg_data = (hypre_SSAMGData *) ssamg_vdata; + + hypre_SSAMGDataInterpType(ssamg_data) = interp_type; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetSkipRelax( void *ssamg_vdata, + HYPRE_Int skip_relax) +{ + hypre_SSAMGData *ssamg_data = (hypre_SSAMGData *) ssamg_vdata; + + hypre_SSAMGDataSkipRelax(ssamg_data) = skip_relax; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetRelaxWeight( void *ssamg_vdata, + HYPRE_Real usr_relax_weight) +{ + hypre_SSAMGData *ssamg_data = (hypre_SSAMGData *) ssamg_vdata; + + hypre_SSAMGDataUsrRelaxWeight(ssamg_data) = usr_relax_weight; + hypre_SSAMGDataUsrSetRWeight(ssamg_data) = 1; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetNumPreRelax( void *ssamg_vdata, + HYPRE_Int num_pre_relax) +{ + hypre_SSAMGData *ssamg_data = (hypre_SSAMGData *) ssamg_vdata; + + hypre_SSAMGDataNumPreRelax(ssamg_data) = num_pre_relax; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetNumPosRelax( void *ssamg_vdata, + HYPRE_Int num_pos_relax) +{ + hypre_SSAMGData *ssamg_data = (hypre_SSAMGData *) ssamg_vdata; + + hypre_SSAMGDataNumPosRelax(ssamg_data) = num_pos_relax; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetNumCoarseRelax( void *ssamg_vdata, + HYPRE_Int num_coarse_relax) +{ + hypre_SSAMGData *ssamg_data = (hypre_SSAMGData *) ssamg_vdata; + + hypre_SSAMGDataNumCoarseRelax(ssamg_data) = num_coarse_relax; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetMaxCoarseSize( void *ssamg_vdata, + HYPRE_Int max_coarse_size) +{ + hypre_SSAMGData *ssamg_data = (hypre_SSAMGData *) ssamg_vdata; + + hypre_SSAMGDataMaxCoarseSize(ssamg_data) = max_coarse_size; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetCoarseSolverType( void *ssamg_vdata, + HYPRE_Int csolver_type) +{ + hypre_SSAMGData *ssamg_data = (hypre_SSAMGData *) ssamg_vdata; + + hypre_SSAMGDataCSolverType(ssamg_data) = csolver_type; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetPrintLevel( void *ssamg_vdata, + HYPRE_Int print_level) +{ + hypre_SSAMGData *ssamg_data = (hypre_SSAMGData *) ssamg_vdata; + + hypre_SSAMGDataPrintLevel(ssamg_data) = print_level; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetPrintFreq( void *ssamg_vdata, + HYPRE_Int print_freq) +{ + hypre_SSAMGData *ssamg_data = (hypre_SSAMGData *) ssamg_vdata; + + hypre_SSAMGDataPrintFreq(ssamg_data) = print_freq; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetLogging( void *ssamg_vdata, + HYPRE_Int logging) +{ + hypre_SSAMGData *ssamg_data = (hypre_SSAMGData *) ssamg_vdata; + + hypre_SSAMGDataLogging(ssamg_data) = logging; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGPrintLogging( void *ssamg_vdata ) +{ + hypre_SSAMGData *ssamg_data = (hypre_SSAMGData *) ssamg_vdata; + MPI_Comm comm = (ssamg_data -> comm); + HYPRE_Int num_iterations = (ssamg_data -> num_iterations); + HYPRE_Int max_iter = (ssamg_data -> max_iter); + HYPRE_Int logging = (ssamg_data -> logging); + HYPRE_Int print_level = (ssamg_data -> print_level); + HYPRE_Int print_freq = (ssamg_data -> print_freq); + HYPRE_Real *norms = (ssamg_data -> norms); + HYPRE_Real *rel_norms = (ssamg_data -> rel_norms); + HYPRE_Int myid, i; + HYPRE_Real convr = 1.0; + HYPRE_Real avg_convr; + + hypre_MPI_Comm_rank(comm, &myid); + + if ((myid == 0) && (print_level > 1) && (logging > 0)) + { + hypre_printf("Iters ||r||_2 conv.rate ||r||_2/||b||_2\n"); + hypre_printf("% 5d %e %f %e\n", 0, norms[0], convr, rel_norms[0]); + for (i = print_freq; i < num_iterations; i = (i + print_freq)) + { + convr = norms[i] / norms[i - 1]; + hypre_printf("% 5d %e %f %e\n", i, norms[i], convr, rel_norms[i]); + } + + if ((i != num_iterations - 1) && (num_iterations > 0)) + { + i = num_iterations; + convr = norms[i] / norms[i - 1]; + hypre_printf("% 5d %e %f %e\n", i, norms[i], convr, rel_norms[i]); + } + + if ((max_iter > 1) && (rel_norms[0] > 0.)) + { + avg_convr = pow((rel_norms[num_iterations] / rel_norms[0]), + (1.0 / (HYPRE_Real) num_iterations)); + hypre_printf("\nAverage convergence factor = %f\n", avg_convr); + } + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGGetNumIterations( void *ssamg_vdata, + HYPRE_Int *num_iterations) +{ + hypre_SSAMGData *ssamg_data = (hypre_SSAMGData *) ssamg_vdata; + + *num_iterations = hypre_SSAMGDataNumIterations(ssamg_data); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGGetFinalRelativeResidualNorm( void *ssamg_vdata, + HYPRE_Real *relative_residual_norm ) +{ + hypre_SSAMGData *ssamg_data = (hypre_SSAMGData *) ssamg_vdata; + + HYPRE_Int max_iter = hypre_SSAMGDataMaxIter(ssamg_data); + HYPRE_Int num_iterations = hypre_SSAMGDataNumIterations(ssamg_data); + HYPRE_Int logging = hypre_SSAMGDataLogging(ssamg_data); + HYPRE_Real *rel_norms = hypre_SSAMGDataRelNorms(ssamg_data); + + if (logging > 0) + { + if (max_iter == 0) + { + hypre_error_in_arg(1); + } + else + { + *relative_residual_norm = rel_norms[num_iterations]; + } + } + + return hypre_error_flag; +} diff --git a/src/sstruct_ls/ssamg.h b/src/sstruct_ls/ssamg.h new file mode 100644 index 0000000000..80150e0f71 --- /dev/null +++ b/src/sstruct_ls/ssamg.h @@ -0,0 +1,122 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_SSAMG_HEADER +#define hypre_SSAMG_HEADER + +//#define DEBUG_SETUP +//#define DEBUG_SOLVE + +/*-------------------------------------------------------------------------- + * hypre_SSAMGData + *--------------------------------------------------------------------------*/ + +typedef struct hypre_SSAMGData_struct +{ + hypre_MPI_Comm comm; + HYPRE_Int nparts; + + HYPRE_Real tol; /* relative tolerance for convergence */ + HYPRE_Int max_iter; /* max. number of iterations */ + HYPRE_Int max_levels; /* max_level <= 0 means no limit */ + HYPRE_Int rel_change; /* tests convergence with rel change of x */ + HYPRE_Int zero_guess; /* initial guess is vector of zeros */ + HYPRE_Int non_galerkin; /* controls choice of RAP codes */ + HYPRE_Int num_levels; /* number of levels of the multigrid hierarchy */ + HYPRE_Int num_pre_relax; /* number of pre relaxation sweeps */ + HYPRE_Int num_post_relax; /* number of post relaxation sweeps */ + HYPRE_Int skip_relax; /* skip relaxation flag */ + HYPRE_Int relax_type; /* relaxation type flag */ + HYPRE_Int interp_type; /* interp type flag */ + HYPRE_Real usr_relax_weight; /* user relax weight */ + HYPRE_Int usr_set_rweight; /* user sets relax weight */ + HYPRE_Real *dxyz[HYPRE_MAXDIM]; /* nparts array used to determine cdir */ + + /* Coarse solver data */ + HYPRE_Solver csolver; + HYPRE_IJMatrix ij_Ac; + hypre_ParVector *par_b; + hypre_ParVector *par_x; + HYPRE_Int csolver_type; /* coarse solver type */ + HYPRE_Int num_coarse_relax; /* number of coarse relaxation sweeps */ + HYPRE_Int max_coarse_size; /* maximum size for the coarse grid */ + + /* (nlevels x nparts) arrays */ + HYPRE_Int **active_l; /* active parts for relaxation */ + HYPRE_Int **cdir_l; /* coarsening directions */ + HYPRE_Real **relax_weights; /* relaxation weights */ + hypre_SStructGrid **grid_l; /* grids */ + + /* work matrices and vectors */ + hypre_SStructMatrix **A_l; + hypre_SStructMatrix **P_l; + hypre_SStructMatrix **RT_l; + hypre_SStructVector **b_l; + hypre_SStructVector **x_l; + hypre_SStructVector **r_l; + hypre_SStructVector **e_l; + hypre_SStructVector **tx_l; + + /* data structures for performing relaxation, interpolation, + restriction and matrix-vector multiplication */ + void **relax_data_l; + void **matvec_data_l; + void **restrict_data_l; + void **interp_data_l; + + /* log info (always logged) */ + HYPRE_Int num_iterations; + HYPRE_Int time_index; + HYPRE_Int print_level; + HYPRE_Int print_freq; + + /* additional log info (logged when `logging' > 0) */ + HYPRE_Int logging; + HYPRE_Real *norms; + HYPRE_Real *rel_norms; + +} hypre_SSAMGData; + +/*-------------------------------------------------------------------------- + * Accessor functions for the hypre_SSAMGData structure + *--------------------------------------------------------------------------*/ + +#define hypre_SSAMGDataComm(ssamg_data) ((ssamg_data) -> comm) +#define hypre_SSAMGDataNParts(ssamg_data) ((ssamg_data) -> nparts) +#define hypre_SSAMGDataTol(ssamg_data) ((ssamg_data) -> tol) +#define hypre_SSAMGDataNumLevels(ssamg_data) ((ssamg_data) -> num_levels) +#define hypre_SSAMGDataMaxLevels(ssamg_data) ((ssamg_data) -> max_levels) +#define hypre_SSAMGDataMaxIter(ssamg_data) ((ssamg_data) -> max_iter) +#define hypre_SSAMGDataRelChange(ssamg_data) ((ssamg_data) -> rel_change) +#define hypre_SSAMGDataZeroGuess(ssamg_data) ((ssamg_data) -> zero_guess) +#define hypre_SSAMGDataNonGalerkin(ssamg_data) ((ssamg_data) -> non_galerkin) +#define hypre_SSAMGDataNumIterations(ssamg_data) ((ssamg_data) -> num_iterations) +#define hypre_SSAMGDataSkipRelax(ssamg_data) ((ssamg_data) -> skip_relax) +#define hypre_SSAMGDataRelaxType(ssamg_data) ((ssamg_data) -> relax_type) +#define hypre_SSAMGDataInterpType(ssamg_data) ((ssamg_data) -> interp_type) +#define hypre_SSAMGDataUsrRelaxWeight(ssamg_data) ((ssamg_data) -> usr_relax_weight) +#define hypre_SSAMGDataUsrSetRWeight(ssamg_data) ((ssamg_data) -> usr_set_rweight) +#define hypre_SSAMGDataRelaxWeights(ssamg_data) ((ssamg_data) -> relax_weights) +#define hypre_SSAMGDataNumPreRelax(ssamg_data) ((ssamg_data) -> num_pre_relax) +#define hypre_SSAMGDataNumPosRelax(ssamg_data) ((ssamg_data) -> num_post_relax) +#define hypre_SSAMGDataNumCoarseRelax(ssamg_data) ((ssamg_data) -> num_coarse_relax) +#define hypre_SSAMGDataMaxCoarseSize(ssamg_data) ((ssamg_data) -> max_coarse_size) +#define hypre_SSAMGDataCSolverType(ssamg_data) ((ssamg_data) -> csolver_type) +#define hypre_SSAMGDataTimeIndex(ssamg_data) ((ssamg_data) -> time_index) +#define hypre_SSAMGDataPrintLevel(ssamg_data) ((ssamg_data) -> print_level) +#define hypre_SSAMGDataPrintFreq(ssamg_data) ((ssamg_data) -> print_freq) +#define hypre_SSAMGDataLogging(ssamg_data) ((ssamg_data) -> logging) +#define hypre_SSAMGDataDxyz(ssamg_data) ((ssamg_data) -> dxyz) +#define hypre_SSAMGDataDxyzD(ssamg_data, d) ((ssamg_data) -> dxyz[d]) +#define hypre_SSAMGDataActivel(ssamg_data) ((ssamg_data) -> active_l) +#define hypre_SSAMGDataGridl(ssamg_data) ((ssamg_data) -> grid_l) +#define hypre_SSAMGDataAl(ssamg_data) ((ssamg_data) -> A_l) +#define hypre_SSAMGDataCdir(ssamg_data) ((ssamg_data) -> cdir_l) +#define hypre_SSAMGDataNorms(ssamg_data) ((ssamg_data) -> norms) +#define hypre_SSAMGDataRelNorms(ssamg_data) ((ssamg_data) -> rel_norms) + +#endif diff --git a/src/sstruct_ls/ssamg_csolver.c b/src/sstruct_ls/ssamg_csolver.c new file mode 100644 index 0000000000..d74e7bbef2 --- /dev/null +++ b/src/sstruct_ls/ssamg_csolver.c @@ -0,0 +1,222 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_sstruct_ls.h" +#include "ssamg.h" + +/*-------------------------------------------------------------------------- + * hypre_SSAMGCoarseSolverSetup + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGCoarseSolverSetup( void *ssamg_vdata ) +{ + hypre_SSAMGData *ssamg_data = (hypre_SSAMGData *) ssamg_vdata; + + MPI_Comm comm = hypre_SSAMGDataComm(ssamg_data); + HYPRE_Int nparts = hypre_SSAMGDataNParts(ssamg_data); + HYPRE_Int num_levels = hypre_SSAMGDataNumLevels(ssamg_data); + HYPRE_Int num_crelax = hypre_SSAMGDataNumCoarseRelax(ssamg_data); + HYPRE_Int csolver_type = hypre_SSAMGDataCSolverType(ssamg_data); + hypre_SStructGrid *cgrid = hypre_SSAMGDataGridl(ssamg_data)[num_levels - 1]; + + void **relax_data_l = (ssamg_data -> relax_data_l); + void **matvec_data_l = (ssamg_data -> matvec_data_l); + HYPRE_Int **active_l = hypre_SSAMGDataActivel(ssamg_data); + HYPRE_Real **relax_weights = hypre_SSAMGDataRelaxWeights(ssamg_data); + hypre_SStructMatrix **A_l = (ssamg_data -> A_l); + hypre_SStructVector **x_l = (ssamg_data -> x_l); + hypre_SStructVector **b_l = (ssamg_data -> b_l); + hypre_SStructVector **tx_l = (ssamg_data -> tx_l); + + hypre_Box *bbox; + hypre_SStructPGrid *pgrid; + hypre_StructGrid *sgrid; + HYPRE_Solver csolver; + HYPRE_IJMatrix ij_Ac; + hypre_ParCSRMatrix *par_Ac; + hypre_ParVector *par_b; + hypre_ParVector *par_x; + + HYPRE_Int l, part, cmax_size, max_work; + char marker_name[32]; + + l = (num_levels - 1); + hypre_sprintf(marker_name, "%s-%d", "MG Level", l); + hypre_GpuProfilingPushRange(marker_name); + HYPRE_ANNOTATE_MGLEVEL_BEGIN(l); + + if (csolver_type == 0) + { + /* Compute maximum number of relaxation sweeps in the coarse grid if requested */ + if (num_crelax < 0) + { + /* do no more work on the coarsest grid than the cost of a V-cycle + * (estimating roughly 4 communications per V-cycle level) */ + max_work = 4 * num_levels; + + /* do sweeps proportional to the coarsest grid size */ + cmax_size = 0; + for (part = 0; part < nparts; part++) + { + pgrid = hypre_SStructGridPGrid(cgrid, part); + sgrid = hypre_SStructPGridCellSGrid(pgrid); + bbox = hypre_StructGridBoundingBox(sgrid); + + cmax_size = hypre_max(cmax_size, hypre_BoxMaxSize(bbox)); + } + num_crelax = hypre_min(max_work, cmax_size); + hypre_SSAMGDataNumCoarseRelax(ssamg_data) = num_crelax; + } + + hypre_SStructMatvecCreate(&matvec_data_l[l]); + hypre_SStructMatvecSetup(matvec_data_l[l], A_l[l], x_l[l]); + hypre_SSAMGRelaxCreate(comm, nparts, &relax_data_l[l]); + hypre_SSAMGRelaxSetTol(relax_data_l[l], 0.0); + hypre_SSAMGRelaxSetWeights(relax_data_l[l], relax_weights[l]); + hypre_SSAMGRelaxSetActiveParts(relax_data_l[l], active_l[l]); + hypre_SSAMGRelaxSetType(relax_data_l[l], 0); + hypre_SSAMGRelaxSetMaxIter(relax_data_l[l], num_crelax); + hypre_SSAMGRelaxSetTempVec(relax_data_l[l], tx_l[l]); + hypre_SSAMGRelaxSetMatvecData(relax_data_l[l], matvec_data_l[l]); + hypre_SSAMGRelaxSetup(relax_data_l[l], A_l[l], b_l[l], x_l[l]); + } + else if (csolver_type == 1) + { + /* Convert SStructMatrix to IJMatrix */ + HYPRE_SStructMatrixToIJMatrix(A_l[l], 1, &ij_Ac); + HYPRE_IJMatrixGetObject(ij_Ac, (void **) &par_Ac); + par_x = hypre_SStructVectorParVector(x_l[l]); + par_b = hypre_SStructVectorParVector(b_l[l]); + + /* Use BoomerAMG */ + hypre_RestoreLogLevel(); + HYPRE_BoomerAMGCreate(&csolver); + HYPRE_BoomerAMGSetStrongThreshold(csolver, 0.5); + HYPRE_BoomerAMGSetPMaxElmts(csolver, 4); + HYPRE_BoomerAMGSetInterpType(csolver, 18); /* MM ext-e interpolation */ + HYPRE_BoomerAMGSetCoarsenType(csolver, 8); /* PMIS coarsening */ + if (num_crelax > 0) + { + HYPRE_BoomerAMGSetMaxIter(csolver, num_crelax); + } + HYPRE_BoomerAMGSetTol(csolver, 0.0); + HYPRE_BoomerAMGSetPrintLevel(csolver, 0); + HYPRE_BoomerAMGSetLogging(csolver, 1); + //HYPRE_BoomerAMGSetAggNumLevels(csolver, 1); + HYPRE_BoomerAMGSetup(csolver, par_Ac, par_b, par_x); + hypre_SetLogLevel(0); + + (ssamg_data -> csolver) = csolver; + (ssamg_data -> ij_Ac) = ij_Ac; + (ssamg_data -> par_x) = par_x; + (ssamg_data -> par_b) = par_b; + } + else + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown coarse solve!\n"); + } + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_MGLEVEL_END(l); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_SSAMGCoarseSolve + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGCoarseSolve( void *ssamg_vdata ) +{ + hypre_SSAMGData *ssamg_data = (hypre_SSAMGData *) ssamg_vdata; + HYPRE_Int csolver_type = hypre_SSAMGDataCSolverType(ssamg_data); + HYPRE_Int num_levels = hypre_SSAMGDataNumLevels(ssamg_data); + void **relax_data_l = (ssamg_data -> relax_data_l); + + hypre_SStructMatrix **A_l = (ssamg_data -> A_l); + hypre_SStructVector **x_l = (ssamg_data -> x_l); + hypre_SStructVector **b_l = (ssamg_data -> b_l); + HYPRE_Solver csolver = (ssamg_data -> csolver); + HYPRE_IJMatrix ij_Ac = (ssamg_data -> ij_Ac); + hypre_ParVector *par_x = (ssamg_data -> par_x); + hypre_ParVector *par_b = (ssamg_data -> par_b); + hypre_ParCSRMatrix *par_Ac; + + HYPRE_Int l; + + HYPRE_ANNOTATE_FUNC_BEGIN; + + /* Coarsest level solver */ + l = (num_levels - 1); + if (csolver_type == 0) + { + hypre_SSAMGRelaxSetZeroGuess(relax_data_l[l], 1); + hypre_SSAMGRelax(relax_data_l[l], A_l[l], b_l[l], x_l[l]); + } + else if (csolver_type == 1) + { + hypre_SStructVectorSetConstantValues(x_l[l], 0.0); + HYPRE_IJMatrixGetObject(ij_Ac, (void **) &par_Ac); + HYPRE_BoomerAMGSolve(csolver, par_Ac, par_b, par_x); + } + else + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown coarse solve!\n"); + } + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_SSAMGCoarseSolverDestroy + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGCoarseSolverDestroy( void *ssamg_vdata ) +{ + hypre_SSAMGData *ssamg_data = (hypre_SSAMGData *) ssamg_vdata; + HYPRE_Int csolver_type = hypre_SSAMGDataCSolverType(ssamg_data); + HYPRE_Int num_levels = hypre_SSAMGDataNumLevels(ssamg_data); + + HYPRE_Int l; + + HYPRE_ANNOTATE_FUNC_BEGIN; + + l = (num_levels - 1); + HYPRE_SStructGridDestroy(ssamg_data -> grid_l[l]); + HYPRE_SStructMatrixDestroy(ssamg_data -> A_l[l]); + HYPRE_SStructVectorDestroy(ssamg_data -> b_l[l]); + HYPRE_SStructVectorDestroy(ssamg_data -> x_l[l]); + HYPRE_SStructVectorDestroy(ssamg_data -> tx_l[l]); + hypre_TFree(ssamg_data -> cdir_l[l], HYPRE_MEMORY_HOST); + hypre_TFree(ssamg_data -> active_l[l], HYPRE_MEMORY_HOST); + hypre_TFree(ssamg_data -> relax_weights[l], HYPRE_MEMORY_HOST); + if (csolver_type == 0) + { + hypre_SSAMGRelaxDestroy(ssamg_data -> relax_data_l[l]); + hypre_SStructMatvecDestroy(ssamg_data -> matvec_data_l[l]); + } + else if (csolver_type == 1) + { + HYPRE_BoomerAMGDestroy(ssamg_data -> csolver); + HYPRE_IJMatrixDestroy(ssamg_data -> ij_Ac); + (ssamg_data -> par_x) = NULL; + (ssamg_data -> par_b) = NULL; + } + else + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown coarse solve!\n"); + } + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} diff --git a/src/sstruct_ls/ssamg_interp.c b/src/sstruct_ls/ssamg_interp.c new file mode 100644 index 0000000000..8377e6da65 --- /dev/null +++ b/src/sstruct_ls/ssamg_interp.c @@ -0,0 +1,380 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_sstruct_ls.h" +#include "_hypre_struct_mv.hpp" +#include "ssamg.h" + +/*-------------------------------------------------------------------------- + * TODO: + * 1) Consider inter-variable coupling + * 2) Do we need to Destroy SStructStencil? + *--------------------------------------------------------------------------*/ + +hypre_SStructMatrix * +hypre_SSAMGCreateInterpOp( hypre_SStructMatrix *A, + hypre_SStructGrid *dom_grid, + HYPRE_Int *cdir_p) +{ + MPI_Comm comm = hypre_SStructMatrixComm(A); + HYPRE_Int ndim = hypre_SStructMatrixNDim(A); + hypre_SStructGraph *graph = hypre_SStructMatrixGraph(A); + hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); + HYPRE_Int nparts = hypre_SStructGridNParts(grid); + + hypre_SStructMatrix *P; + hypre_SStructPMatrix *pmatrix; + hypre_StructMatrix *smatrix; + hypre_SStructGraph *graph_P; + hypre_SStructStencil ***stencils_P; + hypre_StructStencil *stencil; + + HYPRE_Int centries[3] = {0, 1, 2}; + HYPRE_Int *num_centries; + HYPRE_Int stencil_size_A; + HYPRE_Int stencil_size_P; + hypre_Index **st_shape; + hypre_Index *strides; + + HYPRE_Int cdir; + HYPRE_Int part, nvars; + HYPRE_Int i, s, vi; + + /*------------------------------------------------------- + * Allocate data + *-------------------------------------------------------*/ + st_shape = hypre_CTAlloc(hypre_Index *, nparts, HYPRE_MEMORY_HOST); + strides = hypre_CTAlloc(hypre_Index, nparts, HYPRE_MEMORY_HOST); + num_centries = hypre_CTAlloc(HYPRE_Int, nparts, HYPRE_MEMORY_HOST); + + /*------------------------------------------------------- + * Create SStructGraph data structure for P + *-------------------------------------------------------*/ + HYPRE_SStructGraphCreate(comm, grid, &graph_P); + + /* Set domain grid. This is needed in order to SStructUMatrixSetBoxValues be + able to compute the correct column indices in case of rectangular matrices */ + HYPRE_SStructGraphSetDomainGrid(graph_P, dom_grid); + + /* Set stencil entries */ + stencils_P = hypre_SStructGraphStencils(graph_P); + for (part = 0; part < nparts; part++) + { + cdir = cdir_p[part]; + pmatrix = hypre_SStructMatrixPMatrix(A, part); + nvars = hypre_SStructPMatrixNVars(pmatrix); + + hypre_SetIndex(strides[part], 1); + if (cdir > -1) + { + /* Coarsening in direction cdir by a factor of 2 */ + hypre_IndexD(strides[part], cdir) = 2; + + stencil_size_P = 3; + st_shape[part] = hypre_CTAlloc(hypre_Index, stencil_size_P, HYPRE_MEMORY_HOST); + num_centries[part] = stencil_size_P; + for (vi = 0; vi < nvars; vi++) + { + smatrix = hypre_SStructPMatrixSMatrix(pmatrix, vi, vi); + stencil = hypre_StructMatrixStencil(smatrix); + stencil_size_A = hypre_StructStencilSize(stencil); + + /* Set up the stencil for P(part, vi, vi) */ + for (i = 0; i < stencil_size_P; i++) + { + hypre_SetIndex(st_shape[part][i], 0); + } + hypre_IndexD(st_shape[part][1], cdir) = -1; + hypre_IndexD(st_shape[part][2], cdir) = 1; + + /* Create stencil for P(part, vi) */ + HYPRE_SStructStencilCreate(ndim, stencil_size_P, &stencils_P[part][vi]); + for (s = 0; s < stencil_size_P; s++) + { + HYPRE_SStructStencilSetEntry(stencils_P[part][vi], s, st_shape[part][s], vi); + } + + /* Figure out which entries to make constant (ncentries) */ + for (i = 0; i < stencil_size_A; i++) + { + /* Check for entries in A in direction cdir that are variable */ + if (hypre_IndexD(hypre_StructStencilOffset(stencil, i), cdir) != 0) + { + if (!hypre_StructMatrixConstEntry(smatrix, i)) + { + num_centries[part] = 1; /* Make only the diagonal of P constant */ + break; + } + } + } + } + } + else + { + /* This part is not coarsened */ + hypre_IndexD(strides[part], 0) = 2; + stencil_size_P = 1; + st_shape[part] = hypre_CTAlloc(hypre_Index, 1, HYPRE_MEMORY_HOST); + num_centries[part] = stencil_size_P; + for (vi = 0; vi < nvars; vi++) + { + /* Set up the stencil for P(part, vi, vi) */ + hypre_SetIndex(st_shape[part][0], 0); + + /* Create stencil for P(part, vi) */ + HYPRE_SStructStencilCreate(ndim, stencil_size_P, &stencils_P[part][vi]); + HYPRE_SStructStencilSetEntry(stencils_P[part][vi], 0, st_shape[part][0], vi); + } + } + } + + HYPRE_SStructGraphAssemble(graph_P); + HYPRE_SStructMatrixCreate(comm, graph_P, &P); + for (part = 0; part < nparts; part++) + { + HYPRE_SStructMatrixSetDomainStride(P, part, strides[part]); + HYPRE_SStructMatrixSetConstantEntries(P, part, -1, -1, num_centries[part], centries); + } + + /* Free memory */ + HYPRE_SStructGraphDestroy(graph_P); + hypre_TFree(strides, HYPRE_MEMORY_HOST); + hypre_TFree(num_centries, HYPRE_MEMORY_HOST); + for (part = 0; part < nparts; part++) + { + hypre_TFree(st_shape[part], HYPRE_MEMORY_HOST); + } + hypre_TFree(st_shape, HYPRE_MEMORY_HOST); + + return P; +} + +/*-------------------------------------------------------------------------- + * Sets up structured interpolation coefficients + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetupSInterpOp( hypre_SStructMatrix *A, + HYPRE_Int *cdir_p, + hypre_SStructMatrix *P, + HYPRE_Int interp_type) +{ + HYPRE_Int ndim = hypre_SStructMatrixNDim(P); + hypre_SStructGraph *graph = hypre_SStructMatrixGraph(P); + hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); + HYPRE_Int nparts = hypre_SStructGridNParts(grid); + + hypre_SStructPMatrix *A_p, *P_p; + hypre_StructMatrix *A_s, *P_s; + hypre_SStructPGrid *pgrid; + hypre_StructGrid *sgrid; + hypre_BoxArray *compute_boxes; + hypre_BoxArray *pbnd_boxa; + hypre_BoxArrayArray *pbnd_boxaa; + hypre_Box *compute_box; + hypre_Box *tmp_box; + hypre_Box *P_dbox; + + hypre_StructStencil *P_stencil; + HYPRE_Real *Pp1, *Pp2; + HYPRE_Real Pconst0, Pconst1, Pconst2; + + hypre_Index Pstart, Pstride; + hypre_Index origin, stride, loop_size; + hypre_Box *shrink_box; + + HYPRE_Int cdir; + HYPRE_Int part, nvars; + HYPRE_Int box_id; + HYPRE_Int d, i, ii, j, vi; + HYPRE_Real one = 1.0; + HYPRE_Real half = 0.5; + + HYPRE_MemoryLocation memory_location_P = hypre_SStructMatrixMemoryLocation(P); + + /*------------------------------------------------------- + * Create temporary boxes + *-------------------------------------------------------*/ + + tmp_box = hypre_BoxCreate(ndim); + shrink_box = hypre_BoxCreate(ndim); + compute_box = hypre_BoxCreate(ndim); + + /*------------------------------------------------------- + * Setup structured prolongation component + *-------------------------------------------------------*/ + + for (part = 0; part < nparts; part++) + { + cdir = cdir_p[part]; + A_p = hypre_SStructMatrixPMatrix(A, part); + P_p = hypre_SStructMatrixPMatrix(P, part); + pgrid = hypre_SStructGridPGrid(grid, part); + nvars = hypre_SStructPMatrixNVars(P_p); + + for (vi = 0; vi < nvars; vi++) + { + pbnd_boxaa = hypre_SStructPGridPBndBoxArrayArray(pgrid, vi); + A_s = hypre_SStructPMatrixSMatrix(A_p, vi, vi); + P_s = hypre_SStructPMatrixSMatrix(P_p, vi, vi); + sgrid = hypre_StructMatrixGrid(P_s); + P_stencil = hypre_StructMatrixStencil(P_s); + + /* Set center coefficient to 1 */ + hypre_TMemcpy(hypre_StructMatrixConstData(P_s, 0), &one, HYPRE_Real, 1, + memory_location_P, HYPRE_MEMORY_HOST); + + /* If there are no off-diagonal entries, assemble the matrix and continue outer loop */ + if (hypre_StructStencilSize(P_stencil) <= 1) + { + /* Assemble structured component of prolongation matrix */ + hypre_StructMatrixAssemble(P_s); + + /* The following call is needed to prevent cases where interpolation reaches + * outside the boundary with nonzero coefficient */ + hypre_StructMatrixClearBoundary(P_s); + + continue; + } + + if (hypre_StructMatrixConstEntry(P_s, 1)) + { + /* Off-diagonal entries are constant */ + hypre_TMemcpy(hypre_StructMatrixConstData(P_s, 1), &half, HYPRE_Real, 1, + memory_location_P, HYPRE_MEMORY_HOST); + hypre_TMemcpy(hypre_StructMatrixConstData(P_s, 2), &half, HYPRE_Real, 1, + memory_location_P, HYPRE_MEMORY_HOST); + } + else + { + /* Set prolongation entries derived from constant coefficients in A */ + hypre_PFMGSetupInterpOp_core_CC(P_s, A_s, cdir, &Pconst0, &Pconst1, &Pconst2); + + /* Set prolongation entries derived from variable coefficients in A */ + hypre_PFMGSetupInterpOp_core_VC(P_s, A_s, cdir, Pconst0, Pconst1, Pconst2); + + /* Get the stencil space on the base grid for entry 1 of P (valid also for entry 2) */ + hypre_StructMatrixGetStencilSpace(P_s, 1, 0, origin, stride); + + /* Get grid boxes for P_s */ + compute_boxes = hypre_StructGridBoxes(hypre_StructMatrixGrid(P_s)); + + /* Adjust weights at part boundaries */ + hypre_ForBoxArrayI(i, pbnd_boxaa) + { + pbnd_boxa = hypre_BoxArrayArrayBoxArray(pbnd_boxaa, i); + box_id = hypre_BoxArrayArrayID(pbnd_boxaa, i); + ii = hypre_BinarySearch(hypre_StructGridIDs(sgrid), + box_id, + hypre_StructGridNumBoxes(sgrid)); + + if (ii > -1) + { + hypre_ForBoxI(j, pbnd_boxa) + { + hypre_CopyBox(hypre_BoxArrayBox(pbnd_boxa, j), compute_box); + hypre_ProjectBox(compute_box, origin, stride); + hypre_CopyToIndex(hypre_BoxIMin(compute_box), ndim, Pstart); + hypre_StructMatrixMapDataIndex(P_s, Pstart); + hypre_CopyToIndex(stride, ndim, Pstride); + hypre_StructMatrixMapDataStride(P_s, Pstride); + + Pp1 = hypre_StructMatrixBoxData(P_s, ii, 1); + Pp2 = hypre_StructMatrixBoxData(P_s, ii, 2); + P_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(P_s), ii); + + /* Update compute_box */ + for (d = 0; d < ndim; d++) + { + if ((d != cdir) && (hypre_BoxSizeD(compute_box, d) > 1)) + { + hypre_IndexD(hypre_BoxIMin(compute_box), d) -= 1; + hypre_IndexD(hypre_BoxIMax(compute_box), d) += 1; + } + } + hypre_CopyBox(compute_box, tmp_box); + hypre_IntersectBoxes(tmp_box, + hypre_BoxArrayBox(compute_boxes, ii), + compute_box); + hypre_BoxGetStrideSize(compute_box, stride, loop_size); + + /* Only do the renormalization at boundaries if interp_type < 0 + * (that is, if no unstructured interpolation is used) */ + if (interp_type < 0) + { + if (hypre_IndexD(loop_size, cdir) > 1) + { + hypre_BoxLoop1Begin(ndim, loop_size, P_dbox, Pstart, Pstride, Pi); + { + HYPRE_Real center = Pp1[Pi] + Pp2[Pi]; + + if (center) + { + Pp1[Pi] /= center; + Pp2[Pi] /= center; + } + } + hypre_BoxLoop1End(Pi); + } + else + { + hypre_BoxLoop1Begin(ndim, loop_size, P_dbox, Pstart, Pstride, Pi); + { + if (Pp1[Pi] > Pp2[Pi]) + { + Pp1[Pi] = 1.0; + Pp2[Pi] = 0.0; + } + else if (Pp2[Pi] > Pp1[Pi]) + { + Pp1[Pi] = 0.0; + Pp2[Pi] = 1.0; + } + } + hypre_BoxLoop1End(Pi); + } /* if loop_size[cdir] > 1 */ + } /* if interp_type < 0 */ + } /* loop on pbnd_boxa */ + } /* if ii > -1 */ + } /* loop on pbnd_boxaa */ + } /* if constant coefficients */ + + /* Assemble structured component of prolongation matrix */ + hypre_StructMatrixAssemble(P_s); + + /* The following call is needed to prevent cases where interpolation reaches + * outside the boundary with nonzero coefficient */ + hypre_StructMatrixClearBoundary(P_s); + } + } + + /* Free memory */ + hypre_BoxDestroy(tmp_box); + hypre_BoxDestroy(shrink_box); + hypre_BoxDestroy(compute_box); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Sets up interpolation coefficients + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetupInterpOp( hypre_SStructMatrix *A, + HYPRE_Int *cdir_p, + hypre_SStructMatrix *P, + HYPRE_Int interp_type) +{ + /* Setup structured interpolation component */ + hypre_SSAMGSetupSInterpOp(A, cdir_p, P, interp_type); + + /* Setup unstructured interpolation component */ + hypre_SSAMGSetupUInterpOp(A, cdir_p, P, interp_type); + + return hypre_error_flag; +} diff --git a/src/sstruct_ls/ssamg_relax.c b/src/sstruct_ls/ssamg_relax.c new file mode 100644 index 0000000000..0c162d4674 --- /dev/null +++ b/src/sstruct_ls/ssamg_relax.c @@ -0,0 +1,1358 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_sstruct_ls.h" +#include "_hypre_struct_mv.hpp" + +typedef struct hypre_SSAMGRelaxData_struct +{ + MPI_Comm comm; + + HYPRE_Int nparts; + HYPRE_Int type; + HYPRE_Int max_iter; + HYPRE_Int zero_guess; + HYPRE_Real tol; + HYPRE_Real *weights; /* nparts array */ + HYPRE_Real *mweights; /* nparts array */ + HYPRE_Int *active_p; /* active parts */ + + hypre_SStructMatrix *A; + hypre_SStructVector *b; + hypre_SStructVector *x; + hypre_SStructVector *t; + hypre_SStructVector *z; + + /* defines set of nodes to apply relaxation */ + HYPRE_Int num_nodesets; + HYPRE_Int *nodeset_sizes; /* (num_nodeset) */ + HYPRE_Int *nodeset_ranks; /* (num_nodeset) */ + hypre_Index *nodeset_strides; /* (num_nodeset) */ + hypre_Index **nodeset_indices; /* (num_nodeset x nodeset_size) */ + + /* defines sends and recieves for each StructVector */ + hypre_ComputePkg ****svec_compute_pkgs; /* (nparts x num_nodeset) */ + hypre_CommHandle ***comm_handle; /* (nparts x num_nodeset) */ + + /* defines independent and dependent boxes for computations */ + hypre_ComputePkg ***compute_pkgs; /* (nparts x num_nodeset) */ + + /* pointers to local storage used to invert diagonal blocks */ + HYPRE_Real **A_loc; + HYPRE_Real *x_loc; + + /* pointers for vector and matrix data */ + HYPRE_Real ***Ap; + HYPRE_Real **bp; + HYPRE_Real **xp; + HYPRE_Real **tp; + + /* log info (always logged) */ + HYPRE_Int num_iterations; + HYPRE_Int time_index; + + /* Matvec data structure */ + void *matvec_vdata; + +} hypre_SSAMGRelaxData; + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxCreate( MPI_Comm comm, + HYPRE_Int nparts, + void **relax_vdata_ptr) +{ + hypre_SSAMGRelaxData *relax_data; + + relax_data = hypre_CTAlloc(hypre_SSAMGRelaxData, 1, HYPRE_MEMORY_HOST); + + (relax_data -> comm) = comm; + (relax_data -> time_index) = hypre_InitializeTiming("SSAMG Relax"); + + /* set defaults */ + (relax_data -> nparts) = nparts; + (relax_data -> tol) = 1.0e-6; + (relax_data -> max_iter) = 1; + (relax_data -> zero_guess) = 0; + (relax_data -> type) = 0; + (relax_data -> weights) = NULL; + (relax_data -> mweights) = NULL; + (relax_data -> active_p) = NULL; + (relax_data -> A) = NULL; + (relax_data -> b) = NULL; + (relax_data -> x) = NULL; + (relax_data -> t) = NULL; + (relax_data -> z) = NULL; + (relax_data -> num_nodesets) = 0; + (relax_data -> nodeset_sizes) = NULL; + (relax_data -> nodeset_ranks) = NULL; + (relax_data -> nodeset_strides) = NULL; + (relax_data -> nodeset_indices) = NULL; + (relax_data -> svec_compute_pkgs) = NULL; + (relax_data -> compute_pkgs) = NULL; + (relax_data -> comm_handle) = NULL; + + *relax_vdata_ptr = (void *) relax_data; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxDestroy( void *relax_vdata ) +{ + hypre_SSAMGRelaxData *relax_data = (hypre_SSAMGRelaxData *) relax_vdata; + hypre_SStructPMatrix *pmatrix; + HYPRE_Int part, nparts, vi, i, nvars = 0; + + if (relax_data) + { + nparts = (relax_data -> nparts); + for (part = 0; part < nparts; part++) + { + pmatrix = hypre_SStructMatrixPMatrix((relax_data -> A), part); + nvars = hypre_SStructPMatrixNVars(pmatrix); + for (i = 0; i < (relax_data -> num_nodesets); i++) + { + hypre_TFree(relax_data -> nodeset_indices[i], HYPRE_MEMORY_HOST); + for (vi = 0; vi < nvars; vi++) + { + hypre_ComputePkgDestroy(relax_data -> svec_compute_pkgs[part][i][vi]); + } + hypre_TFree(relax_data -> svec_compute_pkgs[part][i], HYPRE_MEMORY_HOST); + hypre_ComputePkgDestroy(relax_data -> compute_pkgs[part][i]); + } + hypre_TFree(relax_data -> svec_compute_pkgs[part], HYPRE_MEMORY_HOST); + hypre_TFree(relax_data -> comm_handle[part], HYPRE_MEMORY_HOST); + hypre_TFree(relax_data -> compute_pkgs[part], HYPRE_MEMORY_HOST); + } + HYPRE_SStructMatrixDestroy(relax_data -> A); + HYPRE_SStructVectorDestroy(relax_data -> b); + HYPRE_SStructVectorDestroy(relax_data -> x); + HYPRE_SStructVectorDestroy(relax_data -> t); + HYPRE_SStructVectorDestroy(relax_data -> z); + + hypre_TFree(relax_data -> nodeset_sizes, HYPRE_MEMORY_HOST); + hypre_TFree(relax_data -> nodeset_ranks, HYPRE_MEMORY_HOST); + hypre_TFree(relax_data -> nodeset_strides, HYPRE_MEMORY_HOST); + hypre_TFree(relax_data -> nodeset_indices, HYPRE_MEMORY_HOST); + hypre_TFree(relax_data -> svec_compute_pkgs, HYPRE_MEMORY_HOST); + hypre_TFree(relax_data -> comm_handle, HYPRE_MEMORY_HOST); + hypre_TFree(relax_data -> compute_pkgs, HYPRE_MEMORY_HOST); + hypre_TFree(relax_data -> x_loc, HYPRE_MEMORY_HOST); + hypre_TFree((relax_data ->A_loc)[0], HYPRE_MEMORY_HOST); + hypre_TFree(relax_data -> A_loc, HYPRE_MEMORY_HOST); + hypre_TFree(relax_data -> bp, HYPRE_MEMORY_HOST); + hypre_TFree(relax_data -> xp, HYPRE_MEMORY_HOST); + hypre_TFree(relax_data -> tp, HYPRE_MEMORY_HOST); + for (vi = 0; vi < nvars; vi++) + { + hypre_TFree((relax_data -> Ap)[vi], HYPRE_MEMORY_HOST); + } + hypre_TFree(relax_data -> Ap, HYPRE_MEMORY_HOST); + hypre_TFree(relax_data -> mweights, HYPRE_MEMORY_HOST); + hypre_FinalizeTiming(relax_data -> time_index); + hypre_TFree(relax_data, HYPRE_MEMORY_HOST); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxSetTol( void *relax_vdata, + HYPRE_Real tol ) +{ + hypre_SSAMGRelaxData *relax_data = (hypre_SSAMGRelaxData *) relax_vdata; + + (relax_data -> tol) = tol; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxSetMaxIter( void *relax_vdata, + HYPRE_Int max_iter ) +{ + hypre_SSAMGRelaxData *relax_data = (hypre_SSAMGRelaxData *) relax_vdata; + + (relax_data -> max_iter) = max_iter; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxSetZeroGuess( void *relax_vdata, + HYPRE_Int zero_guess ) +{ + hypre_SSAMGRelaxData *relax_data = (hypre_SSAMGRelaxData *) relax_vdata; + + (relax_data -> zero_guess) = zero_guess; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxSetWeights( void *relax_vdata, + HYPRE_Real *weights ) +{ + hypre_SSAMGRelaxData *relax_data = (hypre_SSAMGRelaxData *) relax_vdata; + + (relax_data -> weights) = weights; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxSetActiveParts( void *relax_vdata, + HYPRE_Int *active_p ) +{ + hypre_SSAMGRelaxData *relax_data = (hypre_SSAMGRelaxData *) relax_vdata; + + (relax_data -> active_p) = active_p; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxSetMatvecData( void *relax_vdata, + void *matvec_vdata ) +{ + hypre_SSAMGRelaxData *relax_data = (hypre_SSAMGRelaxData *) relax_vdata; + + (relax_data -> matvec_vdata) = matvec_vdata; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxSetNumNodesets( void *relax_vdata, + HYPRE_Int num_nodesets ) +{ + hypre_SSAMGRelaxData *relax_data = (hypre_SSAMGRelaxData *) relax_vdata; + HYPRE_Int i; + + /* free up old nodeset memory */ + for (i = 0; i < (relax_data -> num_nodesets); i++) + { + hypre_TFree(relax_data -> nodeset_indices[i], HYPRE_MEMORY_HOST); + } + hypre_TFree(relax_data -> nodeset_sizes, HYPRE_MEMORY_HOST); + hypre_TFree(relax_data -> nodeset_ranks, HYPRE_MEMORY_HOST); + hypre_TFree(relax_data -> nodeset_strides, HYPRE_MEMORY_HOST); + hypre_TFree(relax_data -> nodeset_indices, HYPRE_MEMORY_HOST); + + /* alloc new nodeset memory */ + (relax_data -> num_nodesets) = num_nodesets; + (relax_data -> nodeset_sizes) = hypre_TAlloc(HYPRE_Int, num_nodesets, HYPRE_MEMORY_HOST); + (relax_data -> nodeset_ranks) = hypre_TAlloc(HYPRE_Int, num_nodesets, HYPRE_MEMORY_HOST); + (relax_data -> nodeset_strides) = hypre_TAlloc(hypre_Index, num_nodesets, HYPRE_MEMORY_HOST); + (relax_data -> nodeset_indices) = hypre_TAlloc(hypre_Index *, num_nodesets, HYPRE_MEMORY_HOST); + for (i = 0; i < num_nodesets; i++) + { + (relax_data -> nodeset_sizes[i]) = 0; + (relax_data -> nodeset_ranks[i]) = i; + (relax_data -> nodeset_indices[i]) = NULL; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxSetNodeset( void *relax_vdata, + HYPRE_Int nodeset, + HYPRE_Int nodeset_size, + hypre_Index nodeset_stride, + hypre_Index *nodeset_indices ) +{ + hypre_SSAMGRelaxData *relax_data = (hypre_SSAMGRelaxData *) relax_vdata; + HYPRE_Int i; + + /* free up old nodeset memory */ + hypre_TFree(relax_data -> nodeset_indices[nodeset], HYPRE_MEMORY_HOST); + + /* alloc new nodeset memory */ + (relax_data -> nodeset_sizes[nodeset]) = nodeset_size; + (relax_data -> nodeset_indices[nodeset]) = hypre_TAlloc(hypre_Index, nodeset_size, + HYPRE_MEMORY_HOST); + + /* set values */ + hypre_CopyIndex(nodeset_stride, (relax_data -> nodeset_strides[nodeset])); + for (i = 0; i < nodeset_size; i++) + { + hypre_CopyIndex(nodeset_indices[i], (relax_data -> nodeset_indices[nodeset][i])); + } + + return hypre_error_flag; +} + + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxSetNodesetRank( void *relax_vdata, + HYPRE_Int nodeset, + HYPRE_Int nodeset_rank ) +{ + hypre_SSAMGRelaxData *relax_data = (hypre_SSAMGRelaxData *) relax_vdata; + + (relax_data -> nodeset_ranks[nodeset]) = nodeset_rank; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxSetType( void *relax_vdata, + HYPRE_Int type) +{ + hypre_SSAMGRelaxData *relax_data = (hypre_SSAMGRelaxData *) relax_vdata; + hypre_Index stride; + + (relax_data -> type) = type; + switch (type) + { + case 2: /* L1-Jacobi*/ + case 1: /* Weighted Jacobi */ + case 0: /* Jacobi */ + { + hypre_Index indices[1]; + + hypre_SetIndex(stride, 1); + hypre_SetIndex(indices[0], 0); + hypre_SSAMGRelaxSetNumNodesets(relax_data, 1); + hypre_SSAMGRelaxSetNodeset(relax_vdata, 0, 1, stride, indices); + } + break; + + case 10: /* Red-Black Gauss-Seidel */ + { + /* TODO: extend this to 3D */ + + hypre_Index red[4], black[4]; + + hypre_SetIndex(stride, 2); + + /* define red points (point set 0) */ + hypre_SetIndex3(red[0], 1, 0, 0); + hypre_SetIndex3(red[1], 0, 1, 0); + hypre_SetIndex3(red[2], 0, 0, 1); + hypre_SetIndex3(red[3], 1, 1, 1); + + /* define black points (point set 1) */ + hypre_SetIndex3(black[0], 0, 0, 0); + hypre_SetIndex3(black[1], 1, 1, 0); + hypre_SetIndex3(black[2], 1, 0, 1); + hypre_SetIndex3(black[3], 0, 1, 1); + + hypre_SSAMGRelaxSetNumNodesets(relax_data, 2); + hypre_SSAMGRelaxSetNodeset(relax_data, 0, 4, stride, red); + hypre_SSAMGRelaxSetNodeset(relax_data, 1, 4, stride, black); + } + break; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxSetPreRelax( void *relax_vdata ) +{ + hypre_SSAMGRelaxData *relax_data = (hypre_SSAMGRelaxData *) relax_vdata; + HYPRE_Int type = (relax_data -> type); + + switch (type) + { + case 2: /* L1-Jacobi */ + case 1: /* Weighted Jacobi */ + case 0: /* Jacobi */ + break; + + case 10: /* Red-Black Gauss-Seidel */ + { + hypre_SSAMGRelaxSetNodesetRank(relax_data, 0, 0); + hypre_SSAMGRelaxSetNodesetRank(relax_data, 1, 1); + } + break; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxSetPostRelax( void *relax_vdata ) +{ + hypre_SSAMGRelaxData *relax_data = (hypre_SSAMGRelaxData *) relax_vdata; + HYPRE_Int type = (relax_data -> type); + + switch (type) + { + case 2: /* L1-Jacobi */ + case 1: /* Weighted Jacobi */ + case 0: /* Jacobi */ + break; + + case 10: /* Red-Black Gauss-Seidel */ + { + hypre_SSAMGRelaxSetNodesetRank(relax_data, 0, 1); + hypre_SSAMGRelaxSetNodesetRank(relax_data, 1, 0); + } + break; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxSetTempVec( void *relax_vdata, + hypre_SStructVector *t ) +{ + hypre_SSAMGRelaxData *relax_data = (hypre_SSAMGRelaxData *) relax_vdata; + + HYPRE_SStructVectorDestroy(relax_data -> t); + hypre_SStructVectorRef(t, &(relax_data -> t)); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxSetup( void *relax_vdata, + hypre_SStructMatrix *A, + hypre_SStructVector *b, + hypre_SStructVector *x ) +{ + hypre_SSAMGRelaxData *relax_data = (hypre_SSAMGRelaxData *) relax_vdata; + HYPRE_Int relax_type = (relax_data -> type); + HYPRE_Int num_nodesets = (relax_data -> num_nodesets); + HYPRE_Int *nodeset_sizes = (relax_data -> nodeset_sizes); + hypre_Index *nodeset_strides = (relax_data -> nodeset_strides); + hypre_Index **nodeset_indices = (relax_data -> nodeset_indices); + HYPRE_Real *weights = (relax_data -> weights); + HYPRE_Int ndim = hypre_SStructMatrixNDim(A); + HYPRE_Int nparts = hypre_SStructMatrixNParts(A); + HYPRE_MemoryLocation memory_location = hypre_SStructMatrixMemoryLocation(A); + + MPI_Comm comm; + hypre_SStructGrid *grid; + hypre_StructGrid *sgrid; + hypre_SStructVector *t; + hypre_SStructPVector *px; + hypre_StructVector *sx; + hypre_SStructPMatrix *pA; + hypre_StructMatrix *sA; + hypre_SStructVector *z = NULL; + + hypre_ComputePkg ****svec_compute_pkgs; + hypre_CommHandle ***comm_handle; + hypre_ComputePkg ***compute_pkgs; + hypre_ComputeInfo *compute_info; + hypre_Index ustride; + + HYPRE_Real **bp; + HYPRE_Real **xp; + HYPRE_Real **tp; + HYPRE_Real ***Ap; + HYPRE_Real *x_loc; + HYPRE_Real **A_loc; + HYPRE_Real *mweights; + + hypre_StructStencil *sstencil; + hypre_Index *sstencil_shape; + HYPRE_Int sstencil_size; + hypre_StructStencil *sstencil_union; + hypre_Index *sstencil_union_shape; + HYPRE_Int sstencil_union_count; + + hypre_IndexRef stride; + hypre_IndexRef index; + hypre_BoxArrayArray *orig_indt_boxes; + hypre_BoxArrayArray *orig_dept_boxes; + hypre_BoxArrayArray *box_aa; + hypre_BoxArray *box_a; + hypre_Box *box; + HYPRE_Int box_aa_size; + HYPRE_Int box_a_size; + hypre_BoxArrayArray *new_box_aa; + hypre_BoxArray *new_box_a; + hypre_Box *new_box; + + HYPRE_Int compute_i; + HYPRE_Int i, j, k, m, s, vi, vj, part; + HYPRE_Int nvars; + HYPRE_Int set; + + hypre_SetIndex(ustride, 1); + + /*---------------------------------------------------------- + * Set up the temp vector + *----------------------------------------------------------*/ + if ((relax_data -> t) == NULL) + { + comm = hypre_SStructVectorComm(b); + grid = hypre_SStructVectorGrid(b); + + HYPRE_SStructVectorCreate(comm, grid, &t); + HYPRE_SStructVectorInitialize(t); + HYPRE_SStructVectorAssemble(t); + (relax_data -> t) = t; + } + + /*---------------------------------------------------------- + * Set mweights = (1 - weights) + *----------------------------------------------------------*/ + mweights = hypre_TAlloc(HYPRE_Real, nparts, HYPRE_MEMORY_HOST); + for (part = 0; part < nparts; part++) + { + mweights[part] = 1.0 - weights[part]; + } + (relax_data -> mweights) = mweights; + + /*---------------------------------------------------------- + * Allocate storage used to invert local diagonal blocks + *----------------------------------------------------------*/ + // TODO: Why nthreads is used in all TAllocs? + nvars = 1; + x_loc = hypre_TAlloc(HYPRE_Real, hypre_NumThreads() * nvars, HYPRE_MEMORY_HOST); + A_loc = hypre_TAlloc(HYPRE_Real *, hypre_NumThreads() * nvars, HYPRE_MEMORY_HOST); + + // nvars*nvars is probably not needed here! + A_loc[0] = hypre_TAlloc(HYPRE_Real, hypre_NumThreads() * nvars * nvars, HYPRE_MEMORY_HOST); + + for (vi = 1; vi < hypre_NumThreads()*nvars; vi++) + { + A_loc[vi] = A_loc[0] + vi * nvars; + } + + /* Allocate pointers for vector and matrix */ + bp = hypre_TAlloc(HYPRE_Real *, nvars, HYPRE_MEMORY_HOST); + xp = hypre_TAlloc(HYPRE_Real *, nvars, HYPRE_MEMORY_HOST); + tp = hypre_TAlloc(HYPRE_Real *, nvars, HYPRE_MEMORY_HOST); + Ap = hypre_TAlloc(HYPRE_Real **, nvars, HYPRE_MEMORY_HOST); + for (vi = 0; vi < nvars; vi++) + { + Ap[vi] = hypre_TAlloc(HYPRE_Real *, nvars, HYPRE_MEMORY_HOST); + } + + /*---------------------------------------------------------- + * Set up the compute packages for each part + *----------------------------------------------------------*/ + svec_compute_pkgs = hypre_CTAlloc(hypre_ComputePkg ***, nparts, HYPRE_MEMORY_HOST); + compute_pkgs = hypre_CTAlloc(hypre_ComputePkg **, nparts, HYPRE_MEMORY_HOST); + comm_handle = hypre_CTAlloc(hypre_CommHandle **, nparts, HYPRE_MEMORY_HOST); + + for (part = 0; part < nparts; part++) + { + pA = hypre_SStructMatrixPMatrix(A, part); + px = hypre_SStructVectorPVector(x, part); + nvars = hypre_SStructPMatrixNVars(pA); + if (nvars > 0) + { + sA = hypre_SStructPMatrixSMatrix(pA, 0, 0); + sgrid = hypre_StructMatrixGrid(sA); + } + else + { + sgrid = NULL; + } + + svec_compute_pkgs[part] = hypre_CTAlloc(hypre_ComputePkg **, num_nodesets, + HYPRE_MEMORY_HOST); + compute_pkgs[part] = hypre_CTAlloc(hypre_ComputePkg *, num_nodesets, + HYPRE_MEMORY_HOST); + comm_handle[part] = hypre_CTAlloc(hypre_CommHandle *, nvars, + HYPRE_MEMORY_HOST); + + for (set = 0; set < num_nodesets; set++) + { + /*---------------------------------------------------------- + * Set up the compute packages to define sends and receives + * for each StructVector (svec_compute_pkgs) and the compute + * package to define independent and dependent computations + * (compute_pkgs). + *----------------------------------------------------------*/ + svec_compute_pkgs[part][set] = hypre_CTAlloc(hypre_ComputePkg *, nvars, + HYPRE_MEMORY_HOST); + + /*---------------------------------------------------------- + * The first execution (vi=-1) sets up the stencil to + * define independent and dependent computations. The + * stencil is the "union" over i,j of all stencils for + * for struct_matrix A_ij. + * + * Other executions (vi > -1) set up the stencil to + * define sends and recieves for the struct_vector vi. + * The stencil for vector i is the "union" over j of all + * stencils for struct_matrix A_ji. + *----------------------------------------------------------*/ + for (vi = -1; vi < nvars; vi++) + { + sstencil_union_count = 0; + if (vi == -1) + { + for (i = 0; i < nvars; i++) + { + for (vj = 0; vj < nvars; vj++) + { + sA = hypre_SStructPMatrixSMatrix(pA, vj, i); + if (sA != NULL) + { + sstencil = hypre_StructMatrixStencil(sA); + sstencil_union_count += hypre_StructStencilSize(sstencil); + } + } + } + } + else + { + for (vj = 0; vj < nvars; vj++) + { + sA = hypre_SStructPMatrixSMatrix(pA, vj, vi); + if (sA != NULL) + { + sstencil = hypre_StructMatrixStencil(sA); + sstencil_union_count += hypre_StructStencilSize(sstencil); + } + } + } + sstencil_union_shape = hypre_CTAlloc(hypre_Index, sstencil_union_count, + HYPRE_MEMORY_HOST); + sstencil_union_count = 0; + if (vi == -1) + { + for (i = 0; i < nvars; i++) + { + for (vj = 0; vj < nvars; vj++) + { + sA = hypre_SStructPMatrixSMatrix(pA, vj, i); + if (sA != NULL) + { + sstencil = hypre_StructMatrixStencil(sA); + sstencil_size = hypre_StructStencilSize(sstencil); + sstencil_shape = hypre_StructStencilShape(sstencil); + for (s = 0; s < sstencil_size; s++) + { + hypre_CopyIndex(sstencil_shape[s], + sstencil_union_shape[sstencil_union_count]); + sstencil_union_count++; + } + } + } + } + } + else + { + for (vj = 0; vj < nvars; vj++) + { + sA = hypre_SStructPMatrixSMatrix(pA, vj, vi); + if (sA != NULL) + { + sstencil = hypre_StructMatrixStencil(sA); + sstencil_size = hypre_StructStencilSize(sstencil); + sstencil_shape = hypre_StructStencilShape(sstencil); + for (s = 0; s < sstencil_size; s++) + { + hypre_CopyIndex(sstencil_shape[s], + sstencil_union_shape[sstencil_union_count]); + sstencil_union_count++; + } + } + } + } + + sstencil_union = hypre_StructStencilCreate(ndim, + sstencil_union_count, + sstencil_union_shape); + hypre_CreateComputeInfo(sgrid, ustride, sstencil_union, &compute_info); + orig_indt_boxes = hypre_ComputeInfoIndtBoxes(compute_info); + orig_dept_boxes = hypre_ComputeInfoDeptBoxes(compute_info); + stride = nodeset_strides[set]; + + for (compute_i = 0; compute_i < 2; compute_i++) + { + if (compute_i) + { + box_aa = orig_dept_boxes; + } + else + { + box_aa = orig_indt_boxes; + } + + box_aa_size = hypre_BoxArrayArraySize(box_aa); + new_box_aa = hypre_BoxArrayArrayCreate(box_aa_size, ndim); + + for (i = 0; i < box_aa_size; i++) + { + box_a = hypre_BoxArrayArrayBoxArray(box_aa, i); + box_a_size = hypre_BoxArraySize(box_a); + new_box_a = hypre_BoxArrayArrayBoxArray(new_box_aa, i); + hypre_BoxArraySetSize(new_box_a, box_a_size * nodeset_sizes[set]); + + k = 0; + for (m = 0; m < nodeset_sizes[set]; m++) + { + index = nodeset_indices[set][m]; + + for (j = 0; j < box_a_size; j++) + { + box = hypre_BoxArrayBox(box_a, j); + new_box = hypre_BoxArrayBox(new_box_a, k); + + hypre_CopyBox(box, new_box); + hypre_ProjectBox(new_box, index, stride); + + k++; + } + } + } + + if (compute_i) + { + hypre_ComputeInfoDeptBoxes(compute_info) = new_box_aa; + } + else + { + hypre_ComputeInfoIndtBoxes(compute_info) = new_box_aa; + } + } + + hypre_CopyIndex(stride, hypre_ComputeInfoStride(compute_info)); + + if (nvars > 0) + { + if (vi == -1) + { + sx = hypre_SStructPVectorSVector(px, 0); + hypre_ComputePkgCreate(memory_location, compute_info, + hypre_StructVectorDataSpace(sx), + 1, sgrid, &compute_pkgs[part][set]); + } + else + { + sx = hypre_SStructPVectorSVector(px, vi); + hypre_ComputePkgCreate(memory_location, compute_info, + hypre_StructVectorDataSpace(sx), + 1, sgrid, &svec_compute_pkgs[part][set][vi]); + } + } + + hypre_BoxArrayArrayDestroy(orig_indt_boxes); + hypre_BoxArrayArrayDestroy(orig_dept_boxes); + hypre_StructStencilDestroy(sstencil_union); + } /* loop on nvars */ + } /* loop on nodesets */ + } /* loop on parts */ + + + /*---------------------------------------------------------- + * Compute additional info for relaxation + *----------------------------------------------------------*/ + if (relax_type == 0 || relax_type == 1) + { + hypre_SStructMatrixGetDiagonal(A, &z); + } + else if (relax_type == 2) + { + hypre_SStructMatrixComputeL1Norms(A, 1, &z); + } + (relax_data -> z) = z; + + /*---------------------------------------------------------- + * Set up the relax data structure + *----------------------------------------------------------*/ + hypre_SStructMatrixRef(A, &(relax_data -> A)); + hypre_SStructVectorRef(x, &(relax_data -> x)); + hypre_SStructVectorRef(b, &(relax_data -> b)); + + (relax_data -> A_loc) = A_loc; + (relax_data -> x_loc) = x_loc; + (relax_data -> Ap) = Ap; + (relax_data -> bp) = bp; + (relax_data -> tp) = tp; + (relax_data -> xp) = xp; + (relax_data -> svec_compute_pkgs) = svec_compute_pkgs; + (relax_data -> compute_pkgs) = compute_pkgs; + (relax_data -> comm_handle) = comm_handle; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelax( void *relax_vdata, + hypre_SStructMatrix *A, + hypre_SStructVector *b, + hypre_SStructVector *x ) +{ + hypre_SSAMGRelaxData *relax_data = (hypre_SSAMGRelaxData *) relax_vdata; + HYPRE_Int relax_type = (relax_data -> type); + HYPRE_Int num_nodesets = (relax_data -> num_nodesets); + + if (num_nodesets == 1) + { + if ((relax_type == 0) || (relax_type == 1) || (relax_type == 2)) + { + hypre_SSAMGRelaxJacobi(relax_vdata, A, b, x); + } + } + else + { + hypre_SSAMGRelaxGeneric(relax_vdata, A, b, x); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_SSAMGRelaxGeneric + * + * Computes x_{k+1} = x_k + w*inv(D)*(b - A*x_k) + * + * Does not unroll stencil loops. Use hypre_SSAMGRelaxMV for better performance + * + * TODO: + * 1) Do we really need nodesets? + * 2) Can we reduce communication? + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxGeneric( void *relax_vdata, + hypre_SStructMatrix *A, + hypre_SStructVector *b, + hypre_SStructVector *x ) +{ + hypre_SSAMGRelaxData *relax_data = (hypre_SSAMGRelaxData *) relax_vdata; + HYPRE_Int max_iter = (relax_data -> max_iter); + HYPRE_Int zero_guess = (relax_data -> zero_guess); + HYPRE_Int *active_p = (relax_data -> active_p); + HYPRE_Real *weights = (relax_data -> weights); + 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_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_SStructVector *t = (relax_data -> t); + HYPRE_Int ndim = hypre_SStructMatrixNDim(A); + HYPRE_Int nparts = hypre_SStructMatrixNParts(A); + hypre_ParCSRMatrix *uA = hypre_SStructMatrixParCSRMatrix(A); + + hypre_StructMatrix *sA; + hypre_SStructPMatrix *pA; + hypre_SStructPVector *px, *pb, *pt; + hypre_StructVector *sx, *sb, *st; + hypre_ParVector *ux, *ut; + + HYPRE_Real *Ap; + HYPRE_Real *bp; + HYPRE_Real *xp; + HYPRE_Real *tp; + + hypre_StructStencil *stencil; + HYPRE_Int stencil_diag; + HYPRE_Int stencil_size; + hypre_Index *stencil_shape; + + 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_IndexRef stride; + hypre_IndexRef start; + hypre_Index ustride; + hypre_Index loop_size; + + HYPRE_Int iter; + HYPRE_Int part, nvars, set, nodeset; + HYPRE_Int offset; + HYPRE_Int compute_i, i, j, vi, vj, si; + HYPRE_Complex zero = 0.0; + + /*---------------------------------------------------------- + * Initialize some things and deal with special cases + *----------------------------------------------------------*/ + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_BeginTiming(relax_data -> time_index); + + HYPRE_SStructMatrixDestroy(relax_data -> A); + HYPRE_SStructVectorDestroy(relax_data -> b); + HYPRE_SStructVectorDestroy(relax_data -> x); + hypre_SStructMatrixRef(A, &(relax_data -> A)); + hypre_SStructVectorRef(x, &(relax_data -> x)); + hypre_SStructVectorRef(b, &(relax_data -> b)); + + (relax_data -> num_iterations) = 0; + + /* if max_iter is zero, return */ + if (max_iter == 0) + { + /* if using a zero initial guess, return zero */ + if (zero_guess) + { + hypre_SStructVectorSetConstantValues(x, zero); + } + + hypre_EndTiming(relax_data -> time_index); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; + } + + /*---------------------------------------------------------- + * Do zero_guess iteration + *----------------------------------------------------------*/ + + iter = 0; + if (zero_guess) + { + if (num_nodesets > 1) + { + hypre_SStructVectorSetConstantValues(x, zero); + } + + for (part = 0; part < nparts; part++) + { + HYPRE_ANNOTATE_REGION_BEGIN("%s %d", "Diag scale part", part); + + if (active_p[part]) + { + pA = hypre_SStructMatrixPMatrix(A, part); + px = hypre_SStructVectorPVector(x, part); + pb = hypre_SStructVectorPVector(b, part); + nvars = hypre_SStructPMatrixNVars(pA); + + for (set = 0; set < num_nodesets; set++) + { + nodeset = nodeset_ranks[set]; + stride = nodeset_strides[nodeset]; + compute_pkg = compute_pkgs[part][nodeset]; + + for (compute_i = 0; compute_i < 2; compute_i++) + { + if (compute_i) + { + compute_box_aa = hypre_ComputePkgDeptBoxes(compute_pkg); + } + else + { + compute_box_aa = hypre_ComputePkgIndtBoxes(compute_pkg); + } + + hypre_ForBoxArrayI(i, compute_box_aa) + { + compute_box_a = hypre_BoxArrayArrayBoxArray(compute_box_aa, i); + for (vi = 0; vi < nvars; vi++) + { + sA = hypre_SStructPMatrixSMatrix(pA, vi, vi); + sb = hypre_SStructPVectorSVector(pb, vi); + sx = hypre_SStructPVectorSVector(px, vi); + + A_data_box = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(sA), i); + b_data_box = hypre_BoxArrayBox(hypre_StructVectorDataSpace(sb), i); + x_data_box = hypre_BoxArrayBox(hypre_StructVectorDataSpace(sx), i); + + // Implement hypre_StructMatrixDiagData ? + stencil = hypre_StructMatrixStencil(sA); + stencil_diag = hypre_StructStencilDiagEntry(stencil); + Ap = hypre_StructMatrixBoxData(sA, i, stencil_diag); + + bp = hypre_StructVectorBoxData(sb, i); + xp = hypre_StructVectorBoxData(sx, i); + + hypre_ForBoxI(j, compute_box_a) + { + compute_box = hypre_BoxArrayBox(compute_box_a, j); + + start = hypre_BoxIMin(compute_box); + hypre_BoxGetStrideSize(compute_box, stride, loop_size); + + if (weights[part] != 1.0) + { + hypre_BoxLoop3Begin(ndim, loop_size, + A_data_box, start, stride, Ai, + x_data_box, start, stride, xi, + b_data_box, start, stride, bi); + { + xp[xi] = weights[part] * bp[bi] / Ap[Ai]; + } + hypre_BoxLoop3End(Ai, xi, bi); + } + else + { + hypre_BoxLoop3Begin(ndim, loop_size, + A_data_box, start, stride, Ai, + x_data_box, start, stride, xi, + b_data_box, start, stride, bi); + { + xp[xi] = bp[bi] / Ap[Ai]; + } + hypre_BoxLoop3End(Ai, xi, bi); + } + } /* hypre_ForBoxI */ + } /* loop on vars */ + } /* hypre_ForBoxArrayI */ + } /* loop on compute_i */ + } /* loop on sets */ + } /* if (active_p[part]) */ + HYPRE_ANNOTATE_REGION_END("%s %d", "Diag scale part", part); + } /* loop on parts */ + + iter++; + } /* if (zero_guess) */ + + /*---------------------------------------------------------- + * Do regular iterations + *----------------------------------------------------------*/ + hypre_SetIndex(ustride, 1); + for (; iter < max_iter; iter++) + { + for (part = 0; part < nparts; part++) + { + HYPRE_ANNOTATE_REGION_BEGIN("%s %d", "Residual part", part); + + pt = hypre_SStructVectorPVector(t, part); + if (active_p[part]) + { + pA = hypre_SStructMatrixPMatrix(A, part); + px = hypre_SStructVectorPVector(x, part); + pb = hypre_SStructVectorPVector(b, part); + nvars = hypre_SStructPMatrixNVars(pA); + + for (set = 0; set < num_nodesets; set++) + { + nodeset = nodeset_ranks[set]; + stride = nodeset_strides[nodeset]; + compute_pkg = compute_pkgs[part][nodeset]; + + for (compute_i = 0; compute_i < 2; compute_i++) + { + switch (compute_i) + { + case 0: + { + for (vi = 0; vi < nvars; vi++) + { + sx = hypre_SStructPVectorSVector(px, vi); + xp = hypre_StructVectorData(sx); + svec_compute_pkg = svec_compute_pkgs[part][nodeset][vi]; + hypre_InitializeIndtComputations(svec_compute_pkg, + xp, &comm_handle[part][vi]); + } + compute_box_aa = hypre_ComputePkgIndtBoxes(compute_pkg); + } + break; + + case 1: + { + for (vi = 0; vi < nvars; vi++) + { + hypre_FinalizeIndtComputations(comm_handle[part][vi]); + } + compute_box_aa = hypre_ComputePkgDeptBoxes(compute_pkg); + } + break; + } + + hypre_ForBoxArrayI(i, compute_box_aa) + { + compute_box_a = hypre_BoxArrayArrayBoxArray(compute_box_aa, i); + + sA = hypre_SStructPMatrixSMatrix(pA, 0, 0); + sb = hypre_SStructPVectorSVector(pb, 0); + sx = hypre_SStructPVectorSVector(px, 0); + st = hypre_SStructPVectorSVector(pt, 0); + + A_data_box = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(sA), i); + b_data_box = hypre_BoxArrayBox(hypre_StructVectorDataSpace(sb), i); + x_data_box = hypre_BoxArrayBox(hypre_StructVectorDataSpace(sx), i); + t_data_box = hypre_BoxArrayBox(hypre_StructVectorDataSpace(st), i); + + hypre_ForBoxI(j, compute_box_a) + { + compute_box = hypre_BoxArrayBox(compute_box_a, j); + start = hypre_BoxIMin(compute_box); + hypre_BoxGetStrideSize(compute_box, stride, loop_size); + + for (vi = 0; vi < nvars; vi++) + { + sb = hypre_SStructPVectorSVector(pb, vi); + st = hypre_SStructPVectorSVector(pt, vi); + bp = hypre_StructVectorBoxData(sb, i); + tp = hypre_StructVectorBoxData(st, i); + + /* Copy rhs into temp vector */ + hypre_BoxLoop2Begin(ndim, loop_size, + b_data_box, start, stride, bi, + t_data_box, start, stride, ti); + { + tp[ti] = bp[bi]; + } + hypre_BoxLoop2End(bi, ti); + + for (vj = 0; vj < nvars; vj++) + { + sA = hypre_SStructPMatrixSMatrix(pA, vi, vj); + if (sA != NULL) + { + sx = hypre_SStructPVectorSVector(px, vj); + stencil = hypre_StructMatrixStencil(sA); + stencil_shape = hypre_StructStencilShape(stencil); + stencil_size = hypre_StructStencilSize(stencil); + stencil_diag = hypre_StructStencilDiagEntry(stencil); + + for (si = 0; si < stencil_size; si++) + { + offset = hypre_BoxOffsetDistance(x_data_box, + stencil_shape[si]); + Ap = hypre_StructMatrixBoxData(sA, i, si); + xp = hypre_StructVectorBoxData(sx, i) + offset; + + hypre_BoxLoop3Begin(ndim, loop_size, + A_data_box, start, stride, Ai, + x_data_box, start, stride, xi, + t_data_box, start, stride, ti); + { + tp[ti] -= Ap[Ai] * xp[xi]; + } + hypre_BoxLoop3End(Ai, xi, ti); + } /* loop on stencil entries */ + } /* if (sA != NULL) */ + } /* loop on j-vars */ + } /* loop on i-vars */ + } /* hypre_ForBoxI */ + } /* hypre_ForBoxArrayI */ + } /* loop on compute_i */ + } /* loop on sets */ + } /* if (active_p[part]) */ + HYPRE_ANNOTATE_REGION_END("%s %d", "Residual part", part); + } /* loop on parts */ + + /* Compute unstructured component: t = t - U*x */ + hypre_SStructVectorConvert(x, &ux); + hypre_SStructVectorConvert(t, &ut); + hypre_ParCSRMatrixMatvec(-1.0, uA, ux, 1.0, ut); + hypre_SStructVectorRestore(x, NULL); + hypre_SStructVectorRestore(t, ut); + + /* Apply diagonal scaling */ + for (part = 0; part < nparts; part++) + { + HYPRE_ANNOTATE_REGION_BEGIN("%s %d", "Diag scale part", part); + + px = hypre_SStructVectorPVector(x, part); + if (active_p[part]) + { + pA = hypre_SStructMatrixPMatrix(A, part); + pt = hypre_SStructVectorPVector(t, part); + nvars = hypre_SStructPMatrixNVars(pA); + for (vi = 0; vi < nvars; vi++) + { + sA = hypre_SStructPMatrixSMatrix(pA, vi, vi); + sx = hypre_SStructPVectorSVector(px, vi); + st = hypre_SStructPVectorSVector(pt, vi); + + stencil = hypre_StructMatrixStencil(sA); + stencil_diag = hypre_StructStencilDiagEntry(stencil); + compute_box_a = hypre_StructGridBoxes(hypre_StructMatrixGrid(sA)); + hypre_ForBoxI(i, compute_box_a) + { + compute_box = hypre_BoxArrayBox(compute_box_a, i); + start = hypre_BoxIMin(compute_box); + hypre_BoxGetStrideSize(compute_box, ustride, loop_size); + + A_data_box = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(sA), i); + x_data_box = hypre_BoxArrayBox(hypre_StructVectorDataSpace(sx), i); + t_data_box = hypre_BoxArrayBox(hypre_StructVectorDataSpace(st), i); + + Ap = hypre_StructMatrixBoxData(sA, i, stencil_diag); + xp = hypre_StructVectorBoxData(sx, i); + tp = hypre_StructVectorBoxData(st, i); + + hypre_BoxLoop3Begin(ndim, loop_size, + A_data_box, start, ustride, Ai, + x_data_box, start, ustride, xi, + t_data_box, start, ustride, ti); + { + xp[xi] += weights[part] * tp[ti] / Ap[Ai]; + } + hypre_BoxLoop3End(Ai, xi, ti); + } /* hypre_ForBoxI(i, compute_box_a) */ + } /* loop on vars */ + } + HYPRE_ANNOTATE_REGION_END("%s %d", "Diag scale part", part); + } /* loop on parts */ + } /* loop on iterations */ + + (relax_data -> num_iterations) = iter; + hypre_EndTiming(relax_data -> time_index); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_SSAMGRelaxJacobi + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGRelaxJacobi( void *relax_vdata, + hypre_SStructMatrix *A, + hypre_SStructVector *b, + hypre_SStructVector *x ) +{ + HYPRE_Int nparts = hypre_SStructMatrixNParts(A); + hypre_SSAMGRelaxData *relax_data = (hypre_SSAMGRelaxData *) relax_vdata; + HYPRE_Int max_iter = (relax_data -> max_iter); + HYPRE_Int zero_guess = (relax_data -> zero_guess); + HYPRE_Int num_nodesets = (relax_data -> num_nodesets); + HYPRE_Complex *weights = (relax_data -> weights); + void *matvec_vdata = (relax_data -> matvec_vdata); + hypre_SStructVector *t = (relax_data -> t); + hypre_SStructVector *z = (relax_data -> z); + + hypre_SStructPMatrix *pA; + hypre_SStructPVector *px; + hypre_SStructPGrid *pgrid; + HYPRE_Int part, active; + HYPRE_Int iter = 0; + HYPRE_Complex zero = 0.0; + HYPRE_Complex one = 1.0; + HYPRE_Complex mone = -1.0; + HYPRE_Complex *zeros; + HYPRE_Complex *ones; + + /*---------------------------------------------------------- + * Initialize some things and deal with special cases + *----------------------------------------------------------*/ + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_BeginTiming(relax_data -> time_index); + + (relax_data -> num_iterations) = 0; + /* if max_iter is zero, return */ + if (max_iter == 0) + { + /* if using a zero initial guess, return zero */ + if (zero_guess) + { + hypre_SStructVectorSetConstantValues(x, zero); + } + + hypre_EndTiming(relax_data -> time_index); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; + } + + if (num_nodesets > 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "num_nodesets > 1 not supported!"); + hypre_EndTiming(relax_data -> time_index); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; + } + + zeros = hypre_CTAlloc(HYPRE_Complex, nparts, HYPRE_MEMORY_HOST); + ones = hypre_CTAlloc(HYPRE_Complex, nparts, HYPRE_MEMORY_HOST); + for (part = 0; part < nparts; part++) + { + ones[part] = 1.0; + } + + /*---------------------------------------------------------- + * Do zero_guess iteration + *----------------------------------------------------------*/ + if (zero_guess) + { + /* x = (w/z)*b */ + hypre_SStructVectorPointwiseDivpy(weights, b, z, zeros, x); + + /* Set x = 0 on inactive parts */ + for (part = 0; part < nparts; part++) + { + pA = hypre_SStructMatrixPMatrix(A, part); + pgrid = hypre_SStructPMatrixPGrid(pA); + active = hypre_SStructPGridActive(pgrid, 0); + if (!active) + { + px = hypre_SStructVectorPVector(x, part); + hypre_SStructPVectorSetConstantValues(px, 0.0); + } + } + iter++; + } + + /*---------------------------------------------------------- + * Do regular iterations + *----------------------------------------------------------*/ + for (; iter < max_iter; iter++) + { + /* t = b - A*x */ + hypre_SStructMatvecCompute(matvec_vdata, mone, A, x, one, b, t); + + /* x = x + (w/z)*t */ + hypre_SStructVectorPointwiseDivpy(weights, t, z, ones, x); + } + + (relax_data -> num_iterations) = iter; + hypre_EndTiming(relax_data -> time_index); + hypre_TFree(ones, HYPRE_MEMORY_HOST); + hypre_TFree(zeros, HYPRE_MEMORY_HOST); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} diff --git a/src/sstruct_ls/ssamg_setup.c b/src/sstruct_ls/ssamg_setup.c new file mode 100644 index 0000000000..b8989e9dfc --- /dev/null +++ b/src/sstruct_ls/ssamg_setup.c @@ -0,0 +1,987 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_sstruct_ls.h" +#include "ssamg.h" + +//#define DEBUG_SETUP +//#define DEBUG_SYMMETRY +//#define DEBUG_MATMULT +//#define DEBUG_WITH_GLVIS + +/*-------------------------------------------------------------------------- + * TODO: + * 1) Test full periodic problems. See what sys_pfmg does + * 2) Implement HYPRE_SStructMatrixSetTranspose + * 3) SetDxyz cannot be called by the user before SSAMGSetup because + * dxyz is being allocated here. + * 4) Fix computation of cmaxsize. Should it vary across parts? + * 5) Move "Initialize some data." to SSAMGCreate??? + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetup( void *ssamg_vdata, + hypre_SStructMatrix *A, + hypre_SStructVector *b, + hypre_SStructVector *x ) +{ + hypre_SSAMGData *ssamg_data = (hypre_SSAMGData *) ssamg_vdata; + + /* Data from the SStructMatrix */ + HYPRE_Int ndim = hypre_SStructMatrixNDim(A); + hypre_SStructGraph *graph = hypre_SStructMatrixGraph(A); + hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); + + /* Solver parameters */ + MPI_Comm comm = hypre_SSAMGDataComm(ssamg_data); + HYPRE_Int non_galerkin = hypre_SSAMGDataNonGalerkin(ssamg_data); + HYPRE_Int max_iter = hypre_SSAMGDataMaxIter(ssamg_data); + HYPRE_Int max_levels = hypre_SSAMGDataMaxLevels(ssamg_data); + HYPRE_Int interp_type = hypre_SSAMGDataInterpType(ssamg_data); + HYPRE_Int relax_type = hypre_SSAMGDataRelaxType(ssamg_data); + HYPRE_Real **dxyz = hypre_SSAMGDataDxyz(ssamg_data); + HYPRE_Int **active_l; + HYPRE_Int **cdir_l; + hypre_SStructGrid **grid_l; + + /* Work data structures */ + hypre_SStructMatrix **A_l = (ssamg_data -> A_l); + hypre_SStructMatrix **P_l = (ssamg_data -> P_l); + hypre_SStructMatrix **RT_l = (ssamg_data -> RT_l); + hypre_SStructVector **b_l = (ssamg_data -> b_l); + hypre_SStructVector **x_l = (ssamg_data -> x_l); + hypre_SStructVector **r_l = (ssamg_data -> r_l); + hypre_SStructVector **e_l = (ssamg_data -> e_l); + hypre_SStructVector **tx_l = (ssamg_data -> tx_l); + + /* Data pointers */ + void **relax_data_l = (ssamg_data -> relax_data_l); + void **matvec_data_l = (ssamg_data -> matvec_data_l); + void **restrict_data_l = (ssamg_data -> restrict_data_l); + void **interp_data_l = (ssamg_data -> interp_data_l); + + HYPRE_Int *dxyz_flag; + HYPRE_Real **relax_weights; + HYPRE_Int d, l; + HYPRE_Int nparts; + HYPRE_Int num_levels; + char marker_name[32]; + + /*----------------------------------------------------- + * Sanity checks + *-----------------------------------------------------*/ + if (hypre_SStructMatrixObjectType(A) != HYPRE_SSTRUCT) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Matrix is not HYPRE_SSTRUCT"); + + return hypre_error_flag; + } + + if (hypre_SStructVectorObjectType(x) != HYPRE_SSTRUCT) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "LHS is not HYPRE_SSTRUCT"); + + return hypre_error_flag; + } + + if (hypre_SStructVectorObjectType(b) != HYPRE_SSTRUCT) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "RHS is not HYPRE_SSTRUCT"); + + return hypre_error_flag; + } + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("SSAMG-Setup"); + hypre_MemoryPrintUsage(comm, hypre_HandleLogLevel(hypre_handle()), "SSAMG setup begin", 0); + hypre_SetLogLevel(0); + + /*----------------------------------------------------- + * Initialize some data. + *-----------------------------------------------------*/ + + HYPRE_ANNOTATE_REGION_BEGIN("%s", "SSAMG-Init"); + hypre_GpuProfilingPushRange("SSAMG-Init"); + + nparts = hypre_SStructMatrixNParts(A); + dxyz_flag = hypre_TAlloc(HYPRE_Int, nparts, HYPRE_MEMORY_HOST); + for (d = 0; d < ndim; d++) + { + dxyz[d] = hypre_CTAlloc(HYPRE_Real, nparts, HYPRE_MEMORY_HOST); + hypre_SSAMGDataDxyzD(ssamg_data, d) = dxyz[d]; + } + hypre_SSAMGDataNParts(ssamg_data) = nparts; + + /* Compute Maximum number of multigrid levels */ + hypre_SSAMGComputeMaxLevels(grid, &max_levels); + hypre_SSAMGDataMaxLevels(ssamg_data) = max_levels; + + /* Compute dxyz for each part */ + hypre_SSAMGComputeDxyz(A, dxyz, dxyz_flag); + + /* Compute coarsening direction and active levels for relaxation */ + hypre_SSAMGCoarsen(ssamg_vdata, grid, dxyz_flag, dxyz); + + /* Get info from ssamg_data */ + cdir_l = hypre_SSAMGDataCdir(ssamg_data); + grid_l = hypre_SSAMGDataGridl(ssamg_data); + active_l = hypre_SSAMGDataActivel(ssamg_data); + relax_weights = hypre_SSAMGDataRelaxWeights(ssamg_data); + + /* Allocate data */ + num_levels = hypre_SSAMGDataNumLevels(ssamg_data); + A_l = hypre_TAlloc(hypre_SStructMatrix *, num_levels, HYPRE_MEMORY_HOST); + P_l = hypre_TAlloc(hypre_SStructMatrix *, num_levels - 1, HYPRE_MEMORY_HOST); + RT_l = hypre_TAlloc(hypre_SStructMatrix *, num_levels - 1, HYPRE_MEMORY_HOST); + b_l = hypre_TAlloc(hypre_SStructVector *, num_levels, HYPRE_MEMORY_HOST); + x_l = hypre_TAlloc(hypre_SStructVector *, num_levels, HYPRE_MEMORY_HOST); + tx_l = hypre_TAlloc(hypre_SStructVector *, num_levels, HYPRE_MEMORY_HOST); + r_l = tx_l; + e_l = tx_l; + relax_data_l = hypre_TAlloc(void *, num_levels, HYPRE_MEMORY_HOST); + matvec_data_l = hypre_TAlloc(void *, num_levels, HYPRE_MEMORY_HOST); + restrict_data_l = hypre_TAlloc(void *, num_levels, HYPRE_MEMORY_HOST); + interp_data_l = hypre_TAlloc(void *, num_levels, HYPRE_MEMORY_HOST); + + hypre_SStructMatrixRef(A, &A_l[0]); + hypre_SStructVectorRef(b, &b_l[0]); + hypre_SStructVectorRef(x, &x_l[0]); + + HYPRE_SStructVectorCreate(comm, grid_l[0], &tx_l[0]); + HYPRE_SStructVectorInitialize(tx_l[0]); + HYPRE_SStructVectorAssemble(tx_l[0]); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_REGION_END("%s", "SSAMG-Init"); + + /*--------------------------------------------------------------------- + * Compute relaxation, interpolation, restriction and coarse grids + *---------------------------------------------------------------------*/ + for (l = 0; l < (num_levels - 1); l++) + { + HYPRE_ANNOTATE_MGLEVEL_BEGIN(l); + hypre_sprintf(marker_name, "%s-%d", "MG Level", l); + hypre_GpuProfilingPushRange(marker_name); + + /* Build relaxation data */ + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Relaxation"); + hypre_GpuProfilingPushRange("Relaxation"); + + hypre_SStructMatvecCreate(&matvec_data_l[l]); + hypre_SStructMatvecSetup(matvec_data_l[l], A_l[l], x_l[l]); + hypre_SSAMGRelaxCreate(comm, nparts, &relax_data_l[l]); + hypre_SSAMGRelaxSetTol(relax_data_l[l], 0.0); + hypre_SSAMGRelaxSetWeights(relax_data_l[l], relax_weights[l]); + hypre_SSAMGRelaxSetActiveParts(relax_data_l[l], active_l[l]); + hypre_SSAMGRelaxSetType(relax_data_l[l], relax_type); + hypre_SSAMGRelaxSetTempVec(relax_data_l[l], tx_l[l]); + hypre_SSAMGRelaxSetMatvecData(relax_data_l[l], matvec_data_l[l]); + hypre_SSAMGRelaxSetup(relax_data_l[l], A_l[l], b_l[l], x_l[l]); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_REGION_END("%s", "Relaxation"); + + /* Build prolongation matrix */ + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Interpolation"); + hypre_GpuProfilingPushRange("Interpolation"); + P_l[l] = hypre_SSAMGCreateInterpOp(A_l[l], grid_l[l + 1], cdir_l[l]); + HYPRE_SStructMatrixInitialize(P_l[l]); + HYPRE_SStructMatrixAssemble(P_l[l]); + //HYPRE_SStructMatrixSetTranspose(P_l[l], 1); + hypre_SSAMGSetupInterpOp(A_l[l], cdir_l[l], P_l[l], interp_type); + + /* Build restriction matrix */ + hypre_SStructMatrixRef(P_l[l], &RT_l[l]); + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_REGION_END("%s", "Interpolation"); + + /* Compute coarse matrix and build work structures for the coarse level */ + HYPRE_ANNOTATE_REGION_BEGIN("%s", "RAP"); + hypre_GpuProfilingPushRange("RAP"); + + hypre_SSAMGComputeRAP(A_l[l], P_l[l], &grid_l[l + 1], cdir_l[l], non_galerkin, &A_l[l + 1]); + HYPRE_SStructVectorCreate(comm, grid_l[l + 1], &b_l[l + 1]); + HYPRE_SStructVectorInitialize(b_l[l + 1]); + HYPRE_SStructVectorAssemble(b_l[l + 1]); + HYPRE_SStructVectorCreate(comm, grid_l[l + 1], &x_l[l + 1]); + HYPRE_SStructVectorInitialize(x_l[l + 1]); + HYPRE_SStructVectorAssemble(x_l[l + 1]); + HYPRE_SStructVectorCreate(comm, grid_l[l + 1], &tx_l[l + 1]); + HYPRE_SStructVectorInitialize(tx_l[l + 1]); + HYPRE_SStructVectorAssemble(tx_l[l + 1]); + hypre_SStructMatvecCreate(&interp_data_l[l]); + hypre_SStructMatvecSetup(interp_data_l[l], P_l[l], x_l[l + 1]); + hypre_SStructMatvecCreate(&restrict_data_l[l]); + hypre_SStructMatvecSetTranspose(restrict_data_l[l], 1); + hypre_SStructMatvecSetup(restrict_data_l[l], RT_l[l], x_l[l]); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_REGION_END("%s", "RAP"); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_MGLEVEL_END(l); + } + + /* Update SSAMG pointers */ + (ssamg_data -> A_l) = A_l; + (ssamg_data -> P_l) = P_l; + (ssamg_data -> RT_l) = RT_l; + (ssamg_data -> b_l) = b_l; + (ssamg_data -> x_l) = x_l; + (ssamg_data -> tx_l) = tx_l; + (ssamg_data -> r_l) = r_l; + (ssamg_data -> e_l) = e_l; + (ssamg_data -> relax_data_l) = relax_data_l; + (ssamg_data -> matvec_data_l) = matvec_data_l; + (ssamg_data -> restrict_data_l) = restrict_data_l; + (ssamg_data -> interp_data_l) = interp_data_l; + + /* Set up coarse solve */ + hypre_SSAMGCoarseSolverSetup(ssamg_vdata); + + /*----------------------------------------------------- + * Allocate space for log info + *-----------------------------------------------------*/ + + if ((ssamg_data -> logging) > 0) + { + max_iter = (ssamg_data -> max_iter); + (ssamg_data -> norms) = hypre_CTAlloc(HYPRE_Real, max_iter + 1, HYPRE_MEMORY_HOST); + (ssamg_data -> rel_norms) = hypre_CTAlloc(HYPRE_Real, max_iter + 1, HYPRE_MEMORY_HOST); + } + + /* Print statistics */ + hypre_SSAMGPrintStats(ssamg_vdata); + + /* Free memory */ + hypre_TFree(dxyz_flag, HYPRE_MEMORY_HOST); + +#ifdef DEBUG_SETUP + hypre_SStructVector **ones_l; + hypre_SStructVector **Aones_l; + hypre_SStructVector **Pones_l; + hypre_SStructPGrid *pgrid; + HYPRE_Int mypid, part; + HYPRE_Int min_level = 0; + char filename[255]; + FILE *file; + + hypre_MPI_Comm_rank(hypre_SStructMatrixComm(A), &mypid); + + ones_l = hypre_TAlloc(hypre_SStructVector *, num_levels, HYPRE_MEMORY_HOST); + Aones_l = hypre_TAlloc(hypre_SStructVector *, num_levels, HYPRE_MEMORY_HOST); + Pones_l = hypre_TAlloc(hypre_SStructVector *, num_levels - 1, HYPRE_MEMORY_HOST); + + /* Print fine level grid */ + hypre_sprintf(filename, "ssgrid.l%02d", min_level); +#ifdef DEBUG_WITH_GLVIS + hypre_SStructGridPrintGLVis(grid_l[min_level], filename, NULL, NULL); +#else + file = fopen(filename, "w"); + hypre_SStructGridPrint(file, grid_l[min_level]); + fclose(file); +#endif + + /* Print part boundary data */ + for (part = 0; part < nparts; part++) + { + pgrid = hypre_SStructGridPGrid(grid_l[0], part); + + hypre_sprintf(filename, "pbnd_boxa.l%02d.p%02d", min_level, part); + hypre_BoxArrayArrayPrint(hypre_SStructGridComm(grid_l[min_level]), + filename, + hypre_SStructPGridPBndBoxArrayArray(pgrid, 0)); + } + + /* Print fine level matrix */ + hypre_sprintf(filename, "ssamg_A.l%02d", min_level); + HYPRE_SStructMatrixPrint(filename, A_l[min_level], 0); + + /* compute Aones = A.1 */ + HYPRE_SStructVectorCreate(comm, grid_l[min_level], &ones_l[min_level]); + HYPRE_SStructVectorInitialize(ones_l[min_level]); + HYPRE_SStructVectorSetConstantValues(ones_l[min_level], 1.0); + HYPRE_SStructVectorAssemble(ones_l[min_level]); + HYPRE_SStructVectorCreate(comm, grid_l[min_level], &Aones_l[min_level]); + HYPRE_SStructVectorInitialize(Aones_l[min_level]); + HYPRE_SStructVectorAssemble(Aones_l[min_level]); + hypre_SStructMatvecCompute(matvec_data_l[min_level], 1.0, A_l[min_level], + ones_l[min_level], 0.0, + Aones_l[min_level], Aones_l[min_level]); + + /* Print Aones */ + hypre_sprintf(filename, "ssamg_Aones.l%02d", min_level); +#ifdef DEBUG_WITH_GLVIS + HYPRE_SStructVectorPrintGLVis(Aones_l[min_level], filename); +#else + HYPRE_SStructVectorPrint(filename, Aones_l[min_level], 0); +#endif + + for (l = min_level; l < (num_levels - 1); l++) + { + /* Print coarse grids */ + hypre_sprintf(filename, "ssgrid.l%02d", l + 1); +#ifdef DEBUG_WITH_GLVIS + hypre_SStructGridPrintGLVis(grid_l[l + 1], filename, NULL, NULL); +#else + file = fopen(filename, "w"); + hypre_SStructGridPrint(file, grid_l[l + 1]); + fclose(file); +#endif + + /* Print part boundary data */ + for (part = 0; part < nparts; part++) + { + pgrid = hypre_SStructGridPGrid(grid_l[l + 1], part); + + hypre_sprintf(filename, "pbnd_boxa.l%02d.p%02d", l + 1, part); + hypre_BoxArrayArrayPrint(hypre_SStructGridComm(grid_l[l + 1]), + filename, + hypre_SStructPGridPBndBoxArrayArray(pgrid, 0)); + } + + /* Print coarse matrices */ + hypre_sprintf(filename, "ssamg_A.l%02d", l + 1); + HYPRE_SStructMatrixPrint(filename, A_l[l + 1], 0); + + /* Print interpolation matrix */ + hypre_sprintf(filename, "ssamg_P.l%02d", l); + HYPRE_SStructMatrixPrint(filename, P_l[l], 0); + + /* compute Pones = P.1 */ + HYPRE_SStructVectorCreate(comm, grid_l[l + 1], &ones_l[l + 1]); + HYPRE_SStructVectorInitialize(ones_l[l + 1]); + HYPRE_SStructVectorSetConstantValues(ones_l[l + 1], 1.0); + HYPRE_SStructVectorAssemble(ones_l[l + 1]); + HYPRE_SStructVectorCreate(comm, grid_l[l], &Pones_l[l]); + HYPRE_SStructVectorInitialize(Pones_l[l]); + HYPRE_SStructVectorAssemble(Pones_l[l]); + hypre_SStructMatvecCompute(interp_data_l[l], 1.0, P_l[l], ones_l[l], + 0.0, Pones_l[l], Pones_l[l]); + + /* Print Pones */ + hypre_sprintf(filename, "ssamg_Pones.l%02d", l); +#ifdef DEBUG_WITH_GLVIS + HYPRE_SStructVectorPrintGLVis(Pones_l[l], filename); +#else + HYPRE_SStructVectorPrint(filename, Pones_l[l], 0); +#endif + + /* compute Aones = A.1 */ + HYPRE_SStructVectorCreate(comm, grid_l[l + 1], &Aones_l[l + 1]); + HYPRE_SStructVectorInitialize(Aones_l[l + 1]); + HYPRE_SStructVectorAssemble(Aones_l[l + 1]); + if (hypre_SSAMGDataCSolverType(ssamg_data) && l == num_levels - 2) + { + hypre_SStructMatvecCreate(&matvec_data_l[l + 1]); + hypre_SStructMatvecSetup(matvec_data_l[l + 1], A_l[l + 1], x_l[l + 1]); + } + hypre_SStructMatvecCompute(matvec_data_l[l + 1], 1.0, A_l[l + 1], ones_l[l + 1], + 0.0, Aones_l[l + 1], Aones_l[l + 1]); + + /* Print Aones */ + hypre_sprintf(filename, "ssamg_Aones.l%02d", l + 1); +#ifdef DEBUG_WITH_GLVIS + HYPRE_SStructVectorPrintGLVis(Aones_l[l + 1], filename); +#else + HYPRE_SStructVectorPrint(filename, Aones_l[l + 1], 0); +#endif + } + + HYPRE_SStructVectorDestroy(ones_l[min_level]); + HYPRE_SStructVectorDestroy(Aones_l[min_level]); + for (l = min_level; l < (num_levels - 1); l++) + { + HYPRE_SStructVectorDestroy(ones_l[l + 1]); + HYPRE_SStructVectorDestroy(Aones_l[l + 1]); + HYPRE_SStructVectorDestroy(Pones_l[l]); + } + hypre_TFree(ones_l, HYPRE_MEMORY_HOST); + hypre_TFree(Pones_l, HYPRE_MEMORY_HOST); + hypre_TFree(Aones_l, HYPRE_MEMORY_HOST); + + /* Check symmetry */ +#ifdef DEBUG_SYMMETRY + { + HYPRE_IJMatrix ij_A, ij_AT, ij_B; + hypre_SStructVector *randvec[2]; + hypre_SStructVector *ssrandvec[2]; + HYPRE_Real B_norm; + HYPRE_Real x_dot_ssamg_y; + HYPRE_Real y_dot_ssamg_x; + HYPRE_Real x_dot_y; + HYPRE_Int k; + + /* Compute Frobenius norm of (A - A^T) */ + for (l = min_level; l < num_levels; l++) + { + HYPRE_SStructMatrixToIJMatrix(A_l[l], 0, &ij_A); + HYPRE_IJMatrixTranspose(ij_A, &ij_AT); + HYPRE_IJMatrixAdd(1.0, ij_A, -1.0, ij_AT, &ij_B); + HYPRE_IJMatrixNorm(ij_B, &B_norm); + hypre_ParPrintf(comm, "Frobenius norm (A[%02d] - A[%02d]^T) = %20.15e\n", l, l, B_norm); + + /* Print matrices */ + hypre_sprintf(filename, "ssamg_ijA.l%02d", l); + HYPRE_IJMatrixPrint(ij_A, filename); + hypre_sprintf(filename, "ssamg_ijB.l%02d", l); + HYPRE_IJMatrixPrint(ij_B, filename); + + /* Free memory */ + HYPRE_IJMatrixDestroy(ij_A); + HYPRE_IJMatrixDestroy(ij_AT); + HYPRE_IJMatrixDestroy(ij_B); + } + + /* Check symmetry of SSAMG operator */ + for (k = 0; k < 2; k++) + { + HYPRE_SStructVectorCreate(comm, grid_l[0], &randvec[k]); + HYPRE_SStructVectorInitialize(randvec[k]); + HYPRE_SStructVectorSetRandomValues(randvec[k], 100 * (10 * k + 5)); + HYPRE_SStructVectorAssemble(randvec[k]); + } + + for (k = 0; k < 2; k++) + { + HYPRE_SStructVectorCreate(comm, grid_l[0], &ssrandvec[k]); + HYPRE_SStructVectorInitialize(ssrandvec[k]); + HYPRE_SStructVectorSetConstantValues(ssrandvec[k], 0.0); + HYPRE_SStructVectorAssemble(ssrandvec[k]); + } + + /* Compute - */ + hypre_SSAMGSolve(ssamg_vdata, A, randvec[0], ssrandvec[0]); + hypre_SSAMGSolve(ssamg_vdata, A, randvec[1], ssrandvec[1]); + + hypre_SStructInnerProd(ssrandvec[1], randvec[0], &x_dot_ssamg_y); + hypre_SStructInnerProd(ssrandvec[0], randvec[1], &y_dot_ssamg_x); + hypre_SStructInnerProd(randvec[0], randvec[1], &x_dot_y); + + hypre_printf("\n"); + hypre_printf(" = %20.15e\n", x_dot_y); + hypre_printf(" = %20.15e\n", x_dot_ssamg_y); + hypre_printf("/ = %20.15e\n", x_dot_ssamg_y / x_dot_y); + hypre_printf(" = %20.15e\n", y_dot_ssamg_x); + hypre_printf("/ = %20.15e\n", y_dot_ssamg_x / x_dot_y); + hypre_printf(" - = %20.15e\n", x_dot_ssamg_y - y_dot_ssamg_x); + hypre_printf("/ - / = %20.15e\n", + x_dot_ssamg_y / x_dot_y - y_dot_ssamg_x / x_dot_y); + hypre_printf("\n"); + + //HYPRE_SStructVectorPrint("randvecX", randvec[0], 0); + //HYPRE_SStructVectorPrint("randvecY", randvec[1], 0); + for (k = 0; k < 2; k++) + { + HYPRE_SStructVectorDestroy(randvec[k]); + HYPRE_SStructVectorDestroy(ssrandvec[k]); + } + } +#endif /* DEBUG_SYMMETRY */ + +#ifdef DEBUG_MATMULT + { + HYPRE_IJMatrix ij_A[2], ij_P; + hypre_ParCSRMatrix *par_A[2], *par_P, *par_AP, *par_RAP, *par_B; + HYPRE_Real norm; + + HYPRE_SStructMatrixToIJMatrix(A_l[min_level], 0, &ij_A[0]); + HYPRE_IJMatrixGetObject(ij_A[0], (void **) &par_A[0]); + for (l = min_level; l < num_levels - 1; l++) + { + hypre_ParPrintf(comm, "Converting A[%02d]\n", l); + HYPRE_SStructMatrixToIJMatrix(A_l[l + 1], 0, &ij_A[1]); + hypre_ParPrintf(comm, "Converting P[%02d]\n", l); + HYPRE_SStructMatrixToIJMatrix(P_l[l], 0, &ij_P); + + HYPRE_IJMatrixGetObject(ij_A[1], (void **) &par_A[1]); + HYPRE_IJMatrixGetObject(ij_P, (void **) &par_P); + + par_AP = hypre_ParMatmul(par_A[0], par_P); + par_RAP = hypre_ParTMatmul(par_P, par_AP); + + hypre_ParCSRMatrixAdd(1.0, par_RAP, -1.0, par_A[1], &par_B); + norm = hypre_ParCSRMatrixFnorm(par_B); + hypre_ParPrintf(comm, "Frobenius norm (RAP_par[%02d] - RAP_ss[%02d]^T) = %20.15e\n", l, l, norm); + + /* Print matrices */ + hypre_sprintf(filename, "ssamg_ijP.l%02d", l); + hypre_ParPrintf(comm, "Printing %s\n", filename); + HYPRE_IJMatrixPrint(ij_P, filename); + + hypre_sprintf(filename, "ssamg_ijRAPdiff.l%02d", l + 1); + hypre_ParPrintf(comm, "Printing %s\n", filename); + hypre_ParCSRMatrixPrintIJ(par_B, 0, 0, filename); + + HYPRE_IJMatrixDestroy(ij_A[0]); + ij_A[0] = ij_A[1]; + par_A[0] = par_A[1]; + + HYPRE_IJMatrixDestroy(ij_P); + hypre_ParCSRMatrixDestroy(par_AP); + hypre_ParCSRMatrixDestroy(par_RAP); + hypre_ParCSRMatrixDestroy(par_B); + } + HYPRE_IJMatrixDestroy(ij_A[0]); + } +#endif // ifdef (DEBUG_MATMULT) +#endif // ifdef (DEBUG_SETUP) + + hypre_RestoreLogLevel(); + hypre_MemoryPrintUsage(comm, hypre_HandleLogLevel(hypre_handle()), "SSAMG setup end ", 0); + hypre_GpuProfilingPopRange(); + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_SSAMGComputeMaxLevels + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGComputeMaxLevels( hypre_SStructGrid *grid, + HYPRE_Int *max_levels ) +{ + hypre_SStructPGrid *pgrid; + hypre_StructGrid *sgrid; + + HYPRE_Int max_levels_in; + HYPRE_Int max_levels_out; + HYPRE_Int max_levels_part; + HYPRE_Int part, nparts; + + nparts = hypre_SStructGridNParts(grid); + + max_levels_in = *max_levels; + max_levels_out = 0; + for (part = 0; part < nparts; part++) + { + pgrid = hypre_SStructGridPGrid(grid, part); + sgrid = hypre_SStructPGridCellSGrid(pgrid); + + hypre_PFMGComputeMaxLevels(sgrid, &max_levels_part); + + max_levels_out = hypre_max(max_levels_part, max_levels_out); + } + + *max_levels = max_levels_out; + if (max_levels_in > 0) + { + *max_levels = hypre_min(max_levels_out, max_levels_in); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_SSAMGComputeDxyz + * + * Computes dxyz for each part independently. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGComputeDxyz( hypre_SStructMatrix *A, + HYPRE_Real **dxyz, + HYPRE_Int *dxyz_flag ) +{ + MPI_Comm comm = hypre_SStructMatrixComm(A); + HYPRE_Int nparts = hypre_SStructMatrixNParts(A); + HYPRE_Int ndim = hypre_SStructMatrixNDim(A); + + hypre_SStructPMatrix *pmatrix; + hypre_StructMatrix *smatrix; + hypre_StructGrid *sgrid; + + HYPRE_Int size, idx; + HYPRE_Real *tcxyz; + HYPRE_Real *cxyz; + + HYPRE_Real cxyz_max; + HYPRE_Real sys_dxyz[HYPRE_MAXDIM]; + HYPRE_Real mean[HYPRE_MAXDIM]; + HYPRE_Real deviation[HYPRE_MAXDIM]; + + HYPRE_BigInt global_size; + HYPRE_Int d, var, part, nvars; + HYPRE_Real max_anisotropy; + + HYPRE_ANNOTATE_FUNC_BEGIN; + + /* Compute cxyz array size */ + size = 0; + for (part = 0; part < nparts; part++) + { + pmatrix = hypre_SStructMatrixPMatrix(A, part); + size += hypre_SStructPMatrixNVars(pmatrix); + } + size *= 2 * ndim; + + /* Allocate arrays */ + tcxyz = hypre_CTAlloc(HYPRE_Real, size, HYPRE_MEMORY_HOST); + cxyz = hypre_CTAlloc(HYPRE_Real, size, HYPRE_MEMORY_HOST); + + /* Compute temporary (local) values for cxyz */ + idx = 0; + for (part = 0; part < nparts; part++) + { + pmatrix = hypre_SStructMatrixPMatrix(A, part); + nvars = hypre_SStructPMatrixNVars(pmatrix); + + for (var = 0; var < nvars; var++) + { + smatrix = hypre_SStructPMatrixSMatrix(pmatrix, var, var); + + hypre_PFMGComputeCxyz(smatrix, &tcxyz[idx], &tcxyz[idx + ndim]); + idx += 2 * ndim; + } + } + + /* Compute global values for cxyz */ + hypre_MPI_Allreduce(tcxyz, cxyz, size, HYPRE_MPI_REAL, hypre_MPI_SUM, comm); + + /* Compute dxyz for each StructMatrix */ + for (part = 0; part < nparts; part++) + { + pmatrix = hypre_SStructMatrixPMatrix(A, part); + nvars = hypre_SStructPMatrixNVars(pmatrix); + dxyz_flag[part] = 0; + + for (var = 0; var < nvars; var++) + { + smatrix = hypre_SStructPMatrixSMatrix(pmatrix, var, var); + sgrid = hypre_StructMatrixGrid(smatrix); + global_size = hypre_StructGridGlobalSize(sgrid); + + for (d = 0; d < ndim; d++) + { + mean[d] = cxyz[d] / (HYPRE_Real) global_size; + deviation[d] = cxyz[d + ndim] / (HYPRE_Real) global_size; + } + + cxyz_max = 0.0; + for (d = 0; d < ndim; d++) + { + cxyz_max = hypre_max(cxyz_max, cxyz[d]); + sys_dxyz[d] = 0.0; + } + + if (cxyz_max == 0.0) + { + /* Do isotropic coarsening */ + for (d = 0; d < ndim; d++) + { + cxyz[d] = 1.0; + } + cxyz_max = 1.0; + } + + for (d = 0; d < ndim; d++) + { + max_anisotropy = HYPRE_REAL_MAX / 1000; + if (cxyz[d] > (cxyz_max / max_anisotropy)) + { + cxyz[d] /= cxyz_max; + sys_dxyz[d] = sqrt(1.0 / cxyz[d]); + } + else + { + sys_dxyz[d] = sqrt(max_anisotropy); + } + } + + /* Set 'dxyz_flag' if the matrix-coefficient variation is "too large". + * This is used later to set relaxation weights for Jacobi. + * + * Use the "square of the coefficient of variation" = (sigma/mu)^2, + * where sigma is the standard deviation and mu is the mean. This is + * equivalent to computing (d - mu^2)/mu^2 where d is the average of + * the squares of the coefficients stored in 'deviation'. Care is + * taken to avoid dividing by zero when the mean is zero. */ + + for (d = 0; d < ndim; d++) + { + deviation[d] -= mean[d] * mean[d]; + if ( deviation[d] > 0.1 * (mean[d]*mean[d]) ) + { + dxyz_flag[part] = 1; + break; + } + } + + for (d = 0; d < ndim; d++) + { + dxyz[d][part] += sys_dxyz[d]; + } + + /* Update cxyz pointer */ + cxyz += 2 * ndim; + } + } + cxyz -= size; + + /* Free memory */ + hypre_TFree(cxyz, HYPRE_MEMORY_HOST); + hypre_TFree(tcxyz, HYPRE_MEMORY_HOST); + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_SSAMGCoarsen + * + * TODO: extend to multiple variables + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGCoarsen( void *ssamg_vdata, + hypre_SStructGrid *grid, + HYPRE_Int *dxyz_flag, + HYPRE_Real **dxyz ) +{ + hypre_SSAMGData *ssamg_data = (hypre_SSAMGData *) ssamg_vdata; + HYPRE_Int ndim = hypre_SStructGridNDim(grid); + HYPRE_Int skip_relax = hypre_SSAMGDataSkipRelax(ssamg_data); + HYPRE_Int max_levels = hypre_SSAMGDataMaxLevels(ssamg_data); + HYPRE_Int max_csize = hypre_SSAMGDataMaxCoarseSize(ssamg_data); + HYPRE_Int nparts = hypre_SSAMGDataNParts(ssamg_data); + HYPRE_Real usr_relax = hypre_SSAMGDataUsrRelaxWeight(ssamg_data); + HYPRE_Int usr_set_rweight = hypre_SSAMGDataUsrSetRWeight(ssamg_data); + + HYPRE_Int **active_l; + hypre_SStructGrid **grid_l; + hypre_SStructPGrid *pgrid; + hypre_StructGrid *sgrid; + hypre_Box **cbox; + + HYPRE_Int **cdir_l; + HYPRE_Real **weights; + hypre_Index *periodic; + hypre_Index *strides; + hypre_Index *coarsen; + + hypre_Index cindex; + hypre_Index zero; + HYPRE_Int num_levels = 0; + HYPRE_Int part; + HYPRE_Int l, d, cdir; + HYPRE_Int coarse_flag; + HYPRE_Int cbox_imin, cbox_imax; + HYPRE_BigInt coarse_size; + HYPRE_Real min_dxyz; + HYPRE_Real alpha, beta; + + HYPRE_ANNOTATE_FUNC_BEGIN; + + /* Allocate data */ + grid_l = hypre_TAlloc(hypre_SStructGrid *, max_levels, HYPRE_MEMORY_HOST); + active_l = hypre_TAlloc(HYPRE_Int *, max_levels, HYPRE_MEMORY_HOST); + cdir_l = hypre_TAlloc(HYPRE_Int *, max_levels, HYPRE_MEMORY_HOST); + weights = hypre_TAlloc(HYPRE_Real *, max_levels, HYPRE_MEMORY_HOST); + cbox = hypre_TAlloc(hypre_Box *, nparts, HYPRE_MEMORY_HOST); + periodic = hypre_TAlloc(hypre_Index, nparts, HYPRE_MEMORY_HOST); + strides = hypre_TAlloc(hypre_Index, nparts, HYPRE_MEMORY_HOST); + coarsen = hypre_TAlloc(hypre_Index, nparts, HYPRE_MEMORY_HOST); + + hypre_SStructGridRef(grid, &grid_l[0]); + + /* Initalize data */ + for (l = 0; l < max_levels; l++) + { + weights[l] = hypre_CTAlloc(HYPRE_Real, nparts, HYPRE_MEMORY_HOST); + if (usr_set_rweight) + { + for (part = 0; part < nparts; part++) + { + weights[l][part] = usr_relax; + } + } + + active_l[l] = hypre_CTAlloc(HYPRE_Int, nparts, HYPRE_MEMORY_HOST); + for (part = 0; part < nparts; part++) + { + active_l[l][part] = 1; + } + } + + for (part = 0; part < nparts; part++) + { + hypre_SetIndex(strides[part], 1); + + /* Force relaxation on finest grid */ + hypre_SetIndex(coarsen[part], 1); + } + hypre_SetIndex(zero, 0); + + /* Get grid bounding box and periodicity data */ + for (part = 0; part < nparts; part++) + { + pgrid = hypre_SStructGridPGrid(grid_l[0], part); + sgrid = hypre_SStructPGridCellSGrid(pgrid); + cbox[part] = hypre_BoxClone(hypre_StructGridBoundingBox(sgrid)); + + hypre_CopyIndex(hypre_StructGridPeriodic(sgrid), periodic[part]); + } + + for (l = 0; l < max_levels; l++) + { + cdir_l[l] = hypre_TAlloc(HYPRE_Int, nparts, HYPRE_MEMORY_HOST); + for (part = 0; part < nparts; part++) + { + cdir_l[l][part] = -1; + } + + coarse_flag = 0; + for (part = 0; part < nparts; part++) + { + pgrid = hypre_SStructGridPGrid(grid_l[l], part); + + /* Initialize min_dxyz */ + min_dxyz = 1; + for (d = 0; d < ndim; d++) + { + min_dxyz += dxyz[d][part]; + } + + /* Determine cdir */ + cdir = -1; alpha = 0.0; + for (d = 0; d < ndim; d++) + { + cbox_imax = hypre_BoxIMaxD(cbox[part], d); + cbox_imin = hypre_BoxIMinD(cbox[part], d); + + if ((cbox_imax > cbox_imin) && (dxyz[d][part] < min_dxyz)) + { + min_dxyz = dxyz[d][part]; + cdir = d; + } + alpha += 1.0 / (dxyz[d][part] * dxyz[d][part]); + } + + /* Change relax_weights */ + if (!usr_set_rweight) + { + beta = 0.0; + if (dxyz_flag[part] || (ndim == 1)) + { + weights[l][part] = 2.0 / 3.0; + } + else + { + for (d = 0; d < ndim; d++) + { + if (d != cdir) + { + beta += 1.0 / (dxyz[d][part] * dxyz[d][part]); + } + } + + /* determine level Jacobi weights */ + weights[l][part] = 2.0 / (3.0 - beta / alpha); + } + } + + if ((cdir > -1) && (l < (max_levels - 1))) + { + coarse_flag = 1; + cdir_l[l][part] = cdir; + + /* don't coarsen if a periodic direction and not divisible by 2 */ + if ((periodic[part][cdir]) && (periodic[part][cdir] % 2)) + { + cdir_l[l][part] = -1; + continue; + } + + if (hypre_IndexD(coarsen[part], cdir) != 0) + { + /* coarsened previously in this direction, relax level l */ + active_l[l][part] = 1; + //hypre_IndexD(coarsen[part], cdir) = 0; + hypre_SetIndex(coarsen[part], 0); + } + else + { + if (skip_relax) + { + active_l[l][part] = 0; + (pgrid -> active[0]) = 0; + } + } + hypre_IndexD(coarsen[part], cdir) = 1; + + /* set cindex and stride */ + hypre_SetIndex(cindex, 0); + hypre_SetIndex(strides[part], 1); + hypre_IndexD(strides[part], cdir) = 2; + + /* update dxyz and coarsen cbox*/ + dxyz[cdir][part] *= 2; + hypre_ProjectBox(cbox[part], cindex, strides[part]); + hypre_StructMapFineToCoarse(hypre_BoxIMin(cbox[part]), cindex, strides[part], + hypre_BoxIMin(cbox[part])); + hypre_StructMapFineToCoarse(hypre_BoxIMax(cbox[part]), cindex, strides[part], + hypre_BoxIMax(cbox[part])); + + /* update periodic */ + periodic[part][cdir] /= 2; + } + else + { + /* Update coarse grid relax weight */ + if (max_levels > 1) + { + weights[l][part] = 1.0; + } + } + } /* loop on parts */ + + /* If there's no part to be coarsened, exit loop */ + if (!coarse_flag) + { + num_levels = l + 1; + break; + } + + /* Compute the coarsened SStructGrid object */ + hypre_SStructGridCoarsen(grid_l[l], zero, strides, periodic, &grid_l[l + 1]); + + /* Check coarse grid size */ + coarse_size = hypre_SStructGridGlobalSize(grid_l[l + 1]); + if (coarse_size < max_csize) + { + num_levels = l + 1; + HYPRE_SStructGridDestroy(grid_l[l + 1]); + + break; + } + } /* loop on levels */ + + /* Free memory */ + for (part = 0; part < nparts; part++) + { + hypre_BoxDestroy(cbox[part]); + } + hypre_TFree(cbox, HYPRE_MEMORY_HOST); + hypre_TFree(periodic, HYPRE_MEMORY_HOST); + hypre_TFree(strides, HYPRE_MEMORY_HOST); + hypre_TFree(coarsen, HYPRE_MEMORY_HOST); + + /* Output */ + hypre_SSAMGDataCdir(ssamg_data) = cdir_l; + hypre_SSAMGDataGridl(ssamg_data) = grid_l; + hypre_SSAMGDataActivel(ssamg_data) = active_l; + hypre_SSAMGDataNumLevels(ssamg_data) = num_levels; + hypre_SSAMGDataRelaxWeights(ssamg_data) = weights; + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} diff --git a/src/sstruct_ls/ssamg_setup_rap.c b/src/sstruct_ls/ssamg_setup_rap.c new file mode 100644 index 0000000000..22cba3f39e --- /dev/null +++ b/src/sstruct_ls/ssamg_setup_rap.c @@ -0,0 +1,215 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_sstruct_ls.h" +#include "ssamg.h" + +/*-------------------------------------------------------------------------- + * hypre_SSAMGComputeRAP + * + * Wrapper for 2D and 3D RAP routines which sets up new coarse + * grid structures for SSAMG. + * + * if the non_galerkin option is turned on, then use the PARFLOW formula + * for computing the coarse grid operator (works only with 5pt stencils in + * 2D and 7pt stencils in 3D). If non_galerkin is turned off, then it uses + * the general purpose matrix-matrix multiplication function (SStructMatmult) + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGComputeRAP( hypre_SStructMatrix *A, + hypre_SStructMatrix *P, + hypre_SStructGrid **cgrid, + HYPRE_Int *cdir_p, + HYPRE_Int non_galerkin, + hypre_SStructMatrix **Ac_ptr ) +{ + hypre_SStructMatrix *Ac; + hypre_SStructGraph *graph; + hypre_SStructGrid *grid; + + if (non_galerkin) + { + hypre_SSAMGComputeRAPNonGlk(A, P, cdir_p, &Ac); + } + else + { + hypre_SStructMatrixPtAP(A, P, &Ac); + } + + /* Update grid object */ + graph = hypre_SStructMatrixGraph(Ac); + grid = hypre_SStructGraphGrid(graph); + HYPRE_SStructGridDestroy(*cgrid); + hypre_SStructGridRef(grid, cgrid); + + /* Update pointer to resulting matrix */ + *Ac_ptr = Ac; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_SSAMGComputeRAPNonGlk + * + * Notes: + * 1) Multivariable version not implemented. + * 2) Needs debugging. + *--------------------------------------------------------------------------*/ +HYPRE_Int +hypre_SSAMGComputeRAPNonGlk( hypre_SStructMatrix *A, + hypre_SStructMatrix *P, + HYPRE_Int *cdir_p, + hypre_SStructMatrix **Ac_ptr ) +{ + MPI_Comm comm = hypre_SStructMatrixComm(A); + HYPRE_Int ndim = hypre_SStructMatrixNDim(A); + hypre_SStructGraph *graph = hypre_SStructMatrixGraph(P); + HYPRE_Int nparts = hypre_SStructGraphNParts(graph); + hypre_SStructGrid *cgrid = hypre_SStructGraphDomGrid(graph); + + hypre_StructStencil *stencil; + hypre_SStructGraph *cgraph; + hypre_SStructPGrid *pcgrid; + hypre_StructGrid *scgrid; + hypre_StructMatrix ****sAc; + hypre_SStructStencil *st_Ac; + hypre_StructMatrix *sA, *sP; + hypre_SStructPMatrix *pA, *pP, *pAc; + hypre_SStructMatrix *Ac; + hypre_IJMatrix *ij_Ac; + //hypre_ParCSRMatrix *parcsr_uAc; + + //hypre_SStructMatrix *ssmatrices[3] = {A, P, P}; + HYPRE_Int terms[3] = {1, 0, 1}; + HYPRE_Int trans[3] = {1, 0, 0}; + + hypre_Index cindex; + hypre_Index cstride; + hypre_Index *st_shape; + HYPRE_Int cdir; + HYPRE_Int nvars; + HYPRE_Int st_size; + HYPRE_Int part, s, vi, vj; + + /* Allocate memory */ + sAc = hypre_TAlloc(hypre_StructMatrix ***, nparts, HYPRE_MEMORY_HOST); + for (part = 0; part < nparts; part++) + { + pcgrid = hypre_SStructGridPGrid(cgrid, part); + nvars = hypre_SStructPGridNVars(pcgrid); + + sAc[part] = hypre_TAlloc(hypre_StructMatrix **, nvars, HYPRE_MEMORY_HOST); + for (vi = 0; vi < nvars; vi++) + { + sAc[part][vi] = hypre_TAlloc(hypre_StructMatrix *, nvars, HYPRE_MEMORY_HOST); + } + } + + /* Create SStructGraph of Ac */ + HYPRE_SStructGraphCreate(comm, cgrid, &cgraph); + HYPRE_SStructGraphSetObjectType(cgraph, HYPRE_SSTRUCT); + + /* Compute struct component of Ac */ + hypre_SetIndex(cindex, 0); + for (part = 0; part < nparts; part++) + { + cdir = cdir_p[part]; + pA = hypre_SStructMatrixPMatrix(A, part); + pP = hypre_SStructMatrixPMatrix(P, part); + nvars = hypre_SStructPMatrixNVars(pA); + pcgrid = hypre_SStructGridPGrid(cgrid, part); + + hypre_SetIndex(cstride, 1); + hypre_IndexD(cstride, cdir) = 2; + for (vi = 0; vi < nvars; vi++) + { + sA = hypre_SStructPMatrixSMatrix(pA, vi, vi); + sP = hypre_SStructPMatrixSMatrix(pP, vi, vi); + scgrid = hypre_SStructPGridSGrid(pcgrid, vi); + stencil = hypre_StructMatrixUserStencil(sA); + st_size = hypre_StructStencilSize(stencil); + + if (st_size == 5 || st_size == 7) + { + sAc[part][vi][vi] = hypre_PFMGCreateRAPOp(sP, sA, sP, scgrid, cdir, 1); + hypre_StructMatrixInitialize(sAc[part][vi][vi]); + hypre_PFMGSetupRAPOp(sP, sA, sP, cdir, cindex, cstride, 1, sAc[part][vi][vi]); + } + else + { + /* Use generic StructMatmult */ + hypre_StructMatrix *smatrices[3] = {sA, sP, sP}; + + hypre_StructMatmult(-1, 3, smatrices, 3, terms, trans, &sAc[part][vi][vi]); + } + + /* Create SStructStencil object for M */ + stencil = hypre_StructMatrixStencil(sAc[part][vi][vi]); + st_size = hypre_StructStencilSize(stencil); + st_shape = hypre_StructStencilShape(stencil); + + HYPRE_SStructStencilCreate(ndim, st_size, &st_Ac); + for (s = 0; s < st_size; s++) + { + HYPRE_SStructStencilSetEntry(st_Ac, s, st_shape[s], vi); + } + HYPRE_SStructGraphSetStencil(cgraph, part, vi, st_Ac); + HYPRE_SStructStencilDestroy(st_Ac); + } + } + + /* Compute unstructured component of Ac */ + //call to hypre_SStructMatrixMultComputeU + + /* Assemble SStructGraph */ + HYPRE_SStructGraphAssemble(cgraph); + + /* Create Ac */ + HYPRE_SStructMatrixCreate(comm, cgraph, &Ac); + HYPRE_SStructMatrixInitialize(Ac); + for (part = 0; part < nparts; part++) + { + pAc = hypre_SStructMatrixPMatrix(Ac, part); + for (vi = 0; vi < nvars; vi++) + { + hypre_StructMatrixDestroy(hypre_SStructPMatrixSMatrix(pAc, vi, vi)); + hypre_SStructPMatrixSMatrix(pAc, vi, vi) = hypre_StructMatrixRef(sAc[part][vi][vi]); + } + } + ij_Ac = hypre_SStructMatrixIJMatrix(Ac); + hypre_IJMatrixDestroyParCSR(ij_Ac); + hypre_IJMatrixObject(ij_Ac) = NULL; + hypre_IJMatrixTranslator(ij_Ac) = NULL; + hypre_IJMatrixAssembleFlag(ij_Ac) = 1; + //hypre_IJMatrixSetObject(ij_Ac, parcsr_uAc); + HYPRE_SStructMatrixAssemble(Ac); + + /* Set pointer to Ac */ + *Ac_ptr = Ac; + + /* Free memory */ + HYPRE_SStructGraphDestroy(cgraph); + for (part = 0; part < nparts; part++) + { + pcgrid = hypre_SStructGridPGrid(cgrid, part); + nvars = hypre_SStructPGridNVars(pcgrid); + + for (vi = 0; vi < nvars; vi++) + { + for (vj = 0; vj < nvars; vj++) + { + hypre_StructMatrixDestroy(sAc[part][vi][vj]); + } + hypre_TFree(sAc[part][vi], HYPRE_MEMORY_HOST); + } + hypre_TFree(sAc[part], HYPRE_MEMORY_HOST); + } + hypre_TFree(sAc, HYPRE_MEMORY_HOST); + + return hypre_error_flag; +} diff --git a/src/sstruct_ls/ssamg_solve.c b/src/sstruct_ls/ssamg_solve.c new file mode 100644 index 0000000000..a009c1a465 --- /dev/null +++ b/src/sstruct_ls/ssamg_solve.c @@ -0,0 +1,441 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_sstruct_ls.h" +#include "ssamg.h" + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSolve( void *ssamg_vdata, + hypre_SStructMatrix *A, + hypre_SStructVector *b, + hypre_SStructVector *x ) +{ + hypre_SSAMGData *ssamg_data = (hypre_SSAMGData *) ssamg_vdata; + + /* Solver parameters */ + HYPRE_Real tol = hypre_SSAMGDataTol(ssamg_data); + HYPRE_Int max_iter = hypre_SSAMGDataMaxIter(ssamg_data); + HYPRE_Int logging = hypre_SSAMGDataLogging(ssamg_data); + HYPRE_Int rel_change = hypre_SSAMGDataRelChange(ssamg_data); + HYPRE_Int zero_guess = hypre_SSAMGDataZeroGuess(ssamg_data); + HYPRE_Int num_pre_relax = hypre_SSAMGDataNumPreRelax(ssamg_data); + HYPRE_Int num_post_relax = hypre_SSAMGDataNumPosRelax(ssamg_data); + HYPRE_Int num_levels = hypre_SSAMGDataNumLevels(ssamg_data); + HYPRE_Real *norms = hypre_SSAMGDataNorms(ssamg_data); + HYPRE_Real *rel_norms = hypre_SSAMGDataRelNorms(ssamg_data); + HYPRE_Int **active_l = hypre_SSAMGDataActivel(ssamg_data); + + /* Work data structures */ + hypre_SStructGrid **grid_l = (ssamg_data -> grid_l); + hypre_SStructMatrix **A_l = (ssamg_data -> A_l); + hypre_SStructMatrix **P_l = (ssamg_data -> P_l); + hypre_SStructMatrix **RT_l = (ssamg_data -> RT_l); + hypre_SStructVector **b_l = (ssamg_data -> b_l); + hypre_SStructVector **x_l = (ssamg_data -> x_l); + hypre_SStructVector **r_l = (ssamg_data -> r_l); + hypre_SStructVector **e_l = (ssamg_data -> e_l); + void **relax_data_l = (ssamg_data -> relax_data_l); + void **matvec_data_l = (ssamg_data -> matvec_data_l); + void **restrict_data_l = (ssamg_data -> restrict_data_l); + void **interp_data_l = (ssamg_data -> interp_data_l); + + /* Local Variables */ + HYPRE_Real b_dot_b = 1.0, r_dot_r, eps = 0; + HYPRE_Real e_dot_e = 0.0, x_dot_x = 1.0; + HYPRE_Int i, l; + char marker_name[32]; +#ifdef DEBUG_SOLVE + char filename[255]; +#endif + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("SSAMG-Solve"); + + /*----------------------------------------------------- + * Initialize some things and deal with special cases + *-----------------------------------------------------*/ + + hypre_BeginTiming(ssamg_data -> time_index); + + /*----------------------------------------------------- + * Refs to A,x,b (the SStructMatrix & SStructVectors) + *-----------------------------------------------------*/ + HYPRE_SStructMatrixDestroy(A_l[0]); + HYPRE_SStructVectorDestroy(b_l[0]); + HYPRE_SStructVectorDestroy(x_l[0]); + hypre_SStructMatrixRef(A, &A_l[0]); + hypre_SStructVectorRef(b, &b_l[0]); + hypre_SStructVectorRef(x, &x_l[0]); + + (ssamg_data -> num_iterations) = 0; + + /* if max_iter is zero, return */ + if (max_iter == 0) + { + /* if using a zero initial guess, return zero */ + if (zero_guess) + { + hypre_SStructVectorSetConstantValues(x_l[0], 0.0); + } + hypre_EndTiming(ssamg_data -> time_index); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; + } + + /* part of convergence check */ + if (tol > 0.) + { + /* eps = (tol^2) */ + hypre_SStructInnerProd(b_l[0], b_l[0], &b_dot_b); + eps = tol * tol; + + if (logging > 0) + { + norms[0] = 0.0; + rel_norms[0] = 0.0; + } + + if (!(b_dot_b > 0.0)) + { +#if 0 + /* if rhs is zero, return a zero solution */ + hypre_SStructVectorSetConstantValues(x_l[0], 0.0); + hypre_EndTiming(ssamg_data -> time_index); + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +#else + b_dot_b = 1.0; +#endif + } + } + +#ifdef DEBUG_SOLVE + hypre_SStructInnerProd(x, x, &x_dot_x); + hypre_printf(" = %20.15e\n", x_dot_x); + hypre_printf(" = %20.15e\n", b_dot_b); + + /* Print initial solution and residual */ + hypre_sprintf(filename, "ssamg_x.i%02d", 0); + HYPRE_SStructVectorPrint(filename, x_l[0], 0); + hypre_sprintf(filename, "ssamg_r.i%02d", 0); + HYPRE_SStructVectorPrint(filename, r_l[0], 0); +#endif + + /*----------------------------------------------------- + * Do V-cycles: + * For each index l, "fine" = l, "coarse" = (l+1) + *-----------------------------------------------------*/ + + for (i = 0; i < max_iter; i++) + { + /*-------------------------------------------------- + * Down cycle + *--------------------------------------------------*/ + HYPRE_ANNOTATE_MGLEVEL_BEGIN(0); + hypre_sprintf(marker_name, "%s-%d", "SSAMG Level", 0); + hypre_GpuProfilingPushRange(marker_name); + + /* fine grid pre-relaxation */ + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Relaxation"); + hypre_GpuProfilingPushRange("Relaxation"); + hypre_SSAMGRelaxSetPreRelax(relax_data_l[0]); + hypre_SSAMGRelaxSetMaxIter(relax_data_l[0], num_pre_relax); + hypre_SSAMGRelaxSetZeroGuess(relax_data_l[0], zero_guess); + hypre_SSAMGRelax(relax_data_l[0], A_l[0], b_l[0], x_l[0]); + zero_guess = 0; + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_REGION_END("%s", "Relaxation"); + + /* compute fine grid residual (r = b - Ax) */ + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Residual"); + hypre_GpuProfilingPushRange("Residual"); + + hypre_SStructMatvecCompute(matvec_data_l[0], + -1.0, A_l[0], x_l[0], + 1.0, b_l[0], r_l[0]); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_REGION_END("%s", "Residual"); + + /* convergence check */ + if (tol > 0.0) + { + hypre_SStructInnerProd(r_l[0], r_l[0], &r_dot_r); + + if (logging > 0) + { + norms[i] = sqrt(r_dot_r); + rel_norms[i] = sqrt(r_dot_r / b_dot_b); + } + + /* always do at least 1 V-cycle */ + if ((r_dot_r / b_dot_b < eps) && (i > 0)) + { + if (rel_change) + { + if ((e_dot_e / x_dot_x) < eps) + { + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_MGLEVEL_END(0); + break; + } + } + else + { + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_MGLEVEL_END(0); + break; + } + } + } + + if (num_levels > 1) + { + /* restrict fine grid residual */ + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Restriction"); + hypre_GpuProfilingPushRange("Restriction"); + + hypre_SStructMatvecCompute(restrict_data_l[0], + 1.0, RT_l[0], r_l[0], + 0.0, b_l[1], b_l[1]); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_REGION_END("%s", "Restriction"); +#ifdef DEBUG_SOLVE + hypre_sprintf(filename, "ssamg_xdown.i%02d.l%02d", i, 0); + HYPRE_SStructVectorPrint(filename, x_l[0], 0); + hypre_sprintf(filename, "ssamg_rdown.i%02d.l%02d", i, 0); + HYPRE_SStructVectorPrint(filename, r_l[0], 0); + hypre_sprintf(filename, "ssamg_b.i%02d.l%02d", i, 1); + HYPRE_SStructVectorPrint(filename, b_l[1], 0); +#endif + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_MGLEVEL_END(0); + + for (l = 1; l <= (num_levels - 2); l++) + { + HYPRE_ANNOTATE_MGLEVEL_BEGIN(l); + hypre_sprintf(marker_name, "%s-%d", "SSAMG Level", l); + hypre_GpuProfilingPushRange(marker_name); + + /* Set active parts on current grid */ + hypre_SStructGridSetActiveParts(grid_l[l], active_l[l]); + + /* pre-relaxation */ + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Relaxation"); + hypre_GpuProfilingPushRange("Relaxation"); + + hypre_SSAMGRelaxSetPreRelax(relax_data_l[l]); + hypre_SSAMGRelaxSetMaxIter(relax_data_l[l], num_pre_relax); + hypre_SSAMGRelaxSetZeroGuess(relax_data_l[l], 1); + hypre_SSAMGRelax(relax_data_l[l], A_l[l], b_l[l], x_l[l]); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_REGION_END("%s", "Relaxation"); + + /* compute residual (r = b - Ax) */ + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Residual"); + hypre_GpuProfilingPushRange("Residual"); + + hypre_SStructMatvecCompute(matvec_data_l[l], + -1.0, A_l[l], x_l[l], + 1.0, b_l[l], r_l[l]); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_REGION_END("%s", "Residual"); + + /* Set all parts on current grid to active */ + hypre_SStructGridSetAllPartsActive(grid_l[l]); + + /* restrict residual */ + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Restriction"); + hypre_GpuProfilingPushRange("Restriction"); + + hypre_SStructMatvecCompute(restrict_data_l[l], + 1.0, RT_l[l], r_l[l], + 0.0, b_l[l + 1], b_l[l + 1]); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_REGION_END("%s", "Restriction"); +#ifdef DEBUG_SOLVE + hypre_sprintf(filename, "ssamg_xdown.i%02d.l%02d", i, l); + HYPRE_SStructVectorPrint(filename, x_l[l], 0); + hypre_sprintf(filename, "ssamg_rdown.i%02d.l%02d", i, l); + HYPRE_SStructVectorPrint(filename, r_l[l], 0); + hypre_sprintf(filename, "ssamg_b.i%02d.l%02d", i, l + 1); + HYPRE_SStructVectorPrint(filename, b_l[l + 1], 0); +#endif + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_MGLEVEL_END(l); + } + + /*-------------------------------------------------- + * Bottom + *--------------------------------------------------*/ + HYPRE_ANNOTATE_MGLEVEL_BEGIN(num_levels - 1); + hypre_sprintf(marker_name, "%s-%d", "SSAMG Level", num_levels - 1); + hypre_GpuProfilingPushRange(marker_name); + + /* Run coarse solver */ + hypre_SSAMGCoarseSolve(ssamg_vdata); + +#ifdef DEBUG_SOLVE + hypre_sprintf(filename, "ssamg_xbottom.i%02d.l%02d", i, l); + HYPRE_SStructVectorPrint(filename, x_l[l], 0); +#endif + + /*-------------------------------------------------- + * Up cycle + *--------------------------------------------------*/ + + for (l = (num_levels - 2); l >= 1; l--) + { + /* interpolate error and correct (x = x + Pe_c) */ + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Interpolation"); + hypre_GpuProfilingPushRange("Interpolation"); + + hypre_SStructMatvecCompute(interp_data_l[l], + 1.0, P_l[l], x_l[l + 1], + 1.0, x_l[l], x_l[l]); + + hypre_GpuProfilingPopRange(); + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_REGION_END("%s", "Interpolation"); + HYPRE_ANNOTATE_MGLEVEL_END(l + 1); +#ifdef DEBUG_SOLVE + hypre_sprintf(filename, "ssamg_eup.i%02d.l%02d", i, l); + HYPRE_SStructVectorPrint(filename, e_l[l], 0); + hypre_sprintf(filename, "ssamg_xup.i%02d.l%02d", i, l); + HYPRE_SStructVectorPrint(filename, x_l[l], 0); +#endif + HYPRE_ANNOTATE_MGLEVEL_BEGIN(l); + hypre_sprintf(marker_name, "%s-%d", "SSAMG Level", l); + hypre_GpuProfilingPushRange(marker_name); + + /* Set active parts on current grid */ + hypre_SStructGridSetActiveParts(grid_l[l], active_l[l]); + + /* post-relaxation */ + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Relaxation"); + hypre_GpuProfilingPushRange("Relaxation"); + + hypre_SSAMGRelaxSetPostRelax(relax_data_l[l]); + hypre_SSAMGRelaxSetMaxIter(relax_data_l[l], num_post_relax); + hypre_SSAMGRelaxSetZeroGuess(relax_data_l[l], 0); + hypre_SSAMGRelax(relax_data_l[l], A_l[l], b_l[l], x_l[l]); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_REGION_END("%s", "Relaxation"); + + /* Set all parts to active */ + hypre_SStructGridSetAllPartsActive(grid_l[l]); + } + + /* interpolate error and correct on fine grid (x = x + Pe_c) */ + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Interpolation"); + hypre_GpuProfilingPushRange("Interpolation"); + + hypre_SStructMatvecCompute(interp_data_l[0], + 1.0, P_l[0], x_l[1], + 1.0, x_l[0], x_l[0]); + + hypre_GpuProfilingPopRange(); + //hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_REGION_END("%s", "Interpolation"); + HYPRE_ANNOTATE_MGLEVEL_END(1); +#ifdef DEBUG_SOLVE + hypre_sprintf(filename, "ssamg_eup.i%02d.l%02d", i, 0); + HYPRE_SStructVectorPrint(filename, e_l[0], 0); + hypre_sprintf(filename, "ssamg_xup.i%02d.l%02d", i, 0); + HYPRE_SStructVectorPrint(filename, x_l[0], 0); +#endif + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_MGLEVEL_BEGIN(0); + hypre_sprintf(marker_name, "%s-%d", "SSAMG Level", 0); + hypre_GpuProfilingPushRange(marker_name); + } + + /* part of convergence check */ + if ((tol > 0.0) && (rel_change)) + { + if (num_levels > 1) + { + hypre_SStructInnerProd(e_l[0], e_l[0], &e_dot_e); + hypre_SStructInnerProd(x_l[0], x_l[0], &x_dot_x); + } + else + { + e_dot_e = 0.0; + x_dot_x = 1.0; + } + } + + /* fine grid post-relaxation */ + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Relaxation"); + hypre_GpuProfilingPushRange("Relaxation"); + + hypre_SSAMGRelaxSetPostRelax(relax_data_l[0]); + hypre_SSAMGRelaxSetMaxIter(relax_data_l[0], num_post_relax); + hypre_SSAMGRelaxSetZeroGuess(relax_data_l[0], 0); + hypre_SSAMGRelax(relax_data_l[0], A_l[0], b_l[0], x_l[0]); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_REGION_END("%s", "Relaxation"); + +#ifdef DEBUG_SOLVE + hypre_sprintf(filename, "ssamg_xpostf.i%02d.l%02d", i, 0); + HYPRE_SStructVectorPrint(filename, x_l[0], 0); +#endif + + (ssamg_data -> num_iterations) = (i + 1); + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_MGLEVEL_END(0); + } + +#ifdef DEBUG_SOLVE + HYPRE_Real b_dot_x; + + hypre_SStructInnerProd(b, x, &b_dot_x); + hypre_SStructInnerProd(b, b, &b_dot_b); + + if (b_dot_x < 0) + { + hypre_printf("b_dot_x: %e\n", b_dot_x); + hypre_printf("b_dot_b: %e\n", b_dot_b); + hypre_printf("b_dot_x/b_dot_b: %e\n", b_dot_x / b_dot_b); + + hypre_sprintf(filename, "ssamg_b.negdot"); + HYPRE_SStructVectorPrint(filename, b, 0); + + hypre_sprintf(filename, "ssamg_x.negdot"); + HYPRE_SStructVectorPrint(filename, x, 0); + } +#endif + + /*----------------------------------------------------- + * Destroy Refs to A_in, x_in, b_in + *-----------------------------------------------------*/ + /* hypre_SStructMatrixDestroy(A_l[0]); */ + /* hypre_SStructVectorDestroy(b_l[0]); */ + /* hypre_SStructVectorDestroy(x_l[0]); */ + + hypre_EndTiming(ssamg_data -> time_index); + hypre_SSAMGPrintLogging((void *) ssamg_data); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} diff --git a/src/sstruct_ls/ssamg_stats.c b/src/sstruct_ls/ssamg_stats.c new file mode 100644 index 0000000000..2c3f0a4544 --- /dev/null +++ b/src/sstruct_ls/ssamg_stats.c @@ -0,0 +1,633 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_sstruct_ls.h" +#include "ssamg.h" + +/*-------------------------------------------------------------------------- + * hypre_SSAMGPrintStats + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGPrintStats( void *ssamg_vdata ) +{ + hypre_SSAMGData *ssamg_data = (hypre_SSAMGData *) ssamg_vdata; + MPI_Comm comm = hypre_SSAMGDataComm(ssamg_data); + HYPRE_Int num_levels = hypre_SSAMGDataNumLevels(ssamg_data); + HYPRE_Int non_galerkin = hypre_SSAMGDataNonGalerkin(ssamg_data); + HYPRE_Int print_level = hypre_SSAMGDataPrintLevel(ssamg_data); + HYPRE_Int relax_type = hypre_SSAMGDataRelaxType(ssamg_data); + HYPRE_Int skip_relax = hypre_SSAMGDataSkipRelax(ssamg_data); + HYPRE_Int num_pre_relax = hypre_SSAMGDataNumPreRelax(ssamg_data); + HYPRE_Int num_pos_relax = hypre_SSAMGDataNumPosRelax(ssamg_data); + HYPRE_Int num_crelax = hypre_SSAMGDataNumCoarseRelax(ssamg_data); + HYPRE_Int csolver_type = hypre_SSAMGDataCSolverType(ssamg_data); + HYPRE_Int nparts = hypre_SSAMGDataNParts(ssamg_data); + HYPRE_Int **cdir_l = hypre_SSAMGDataCdir(ssamg_data); + HYPRE_Int **active_l = hypre_SSAMGDataActivel(ssamg_data); + HYPRE_Real **weights = hypre_SSAMGDataRelaxWeights(ssamg_data); + + hypre_SStructMatrix **A_l = hypre_SSAMGDataAl(ssamg_data); + hypre_SStructPMatrix *pmatrix; + hypre_StructMatrix *smatrix; + hypre_ParCSRMatrix *umatrix; + hypre_StructGrid *sgrid; + hypre_StructStencil *stencil; + hypre_CSRMatrix *diag; + hypre_CSRMatrix *offd; + HYPRE_Int *diag_i; + HYPRE_Int *offd_i; + HYPRE_Real *diag_a; + HYPRE_Real *offd_a; + + hypre_IntArray arr_diag_r; + hypre_IntArray arr_offd_r; + hypre_IntArray arr_rownnz; + HYPRE_Int *rownnz; + HYPRE_Int num_rownnz; + + HYPRE_Int *global_num_rows = NULL; + HYPRE_Int *global_num_rownnz = NULL; + HYPRE_Int *global_num_nonzeros = NULL; + HYPRE_Int *global_min_entries = NULL; + HYPRE_Int *global_max_entries = NULL; + HYPRE_Real *global_avg_entries = NULL; + HYPRE_Real *global_min_rowsum = NULL; + HYPRE_Real *global_max_rowsum = NULL; + HYPRE_Int *global_num_boxes = NULL; + HYPRE_Int *global_num_dofs = NULL; + HYPRE_Int *global_num_ghrows = NULL; + HYPRE_Int *global_min_stsize = NULL; + HYPRE_Int *global_max_stsize = NULL; + HYPRE_Real *global_avg_stsize = NULL; + + HYPRE_Int stencil_size; + HYPRE_Int min_entries; + HYPRE_Int max_entries; + HYPRE_Int min_stsize; + HYPRE_Int max_stsize; + HYPRE_Real avg_stsize; + HYPRE_Real min_rowsum; + HYPRE_Real max_rowsum; + HYPRE_Real rowsum; + + HYPRE_Int num_ghrows; + HYPRE_Int num_boxes; + HYPRE_Int num_parts; + HYPRE_Int num_boxes_part; + HYPRE_Int num_dofs; + HYPRE_Int num_dofs_grid; + + HYPRE_Int myid, i, ii, j, l; + HYPRE_Int part, vi, vj, nvars; + HYPRE_Int entries; + HYPRE_Int chunk, chunk_size, chunk_last; + HYPRE_Int nparts_per_line = 8; + HYPRE_Int offset = 2; + HYPRE_Int ndigits; + HYPRE_Int ndigits_S[6] = {7, 7, 6, 5, 5, 5}; + HYPRE_Int ndigits_U[7] = {6, 6, 6, 9, 5, 5, 5}; + HYPRE_Int header[5]; + HYPRE_Real send_buffer[5]; + HYPRE_Real recv_buffer[5]; + + hypre_MPI_Comm_rank(comm, &myid); + + if (print_level == 0) + { + return hypre_error_flag; + } + + /* Allocate memory */ + if (myid == 0) + { + global_num_rows = hypre_CTAlloc(HYPRE_Int, num_levels, HYPRE_MEMORY_HOST); + global_num_rownnz = hypre_CTAlloc(HYPRE_Int, num_levels, HYPRE_MEMORY_HOST); + global_num_nonzeros = hypre_CTAlloc(HYPRE_Int, num_levels, HYPRE_MEMORY_HOST); + global_min_entries = hypre_CTAlloc(HYPRE_Int, num_levels, HYPRE_MEMORY_HOST); + global_max_entries = hypre_CTAlloc(HYPRE_Int, num_levels, HYPRE_MEMORY_HOST); + global_avg_entries = hypre_CTAlloc(HYPRE_Real, num_levels, HYPRE_MEMORY_HOST); + global_min_rowsum = hypre_CTAlloc(HYPRE_Real, num_levels, HYPRE_MEMORY_HOST); + global_max_rowsum = hypre_CTAlloc(HYPRE_Real, num_levels, HYPRE_MEMORY_HOST); + global_num_boxes = hypre_CTAlloc(HYPRE_Int, num_levels, HYPRE_MEMORY_HOST); + global_num_dofs = hypre_CTAlloc(HYPRE_Int, num_levels, HYPRE_MEMORY_HOST); + global_num_ghrows = hypre_CTAlloc(HYPRE_Int, num_levels, HYPRE_MEMORY_HOST); + global_min_stsize = hypre_CTAlloc(HYPRE_Int, num_levels, HYPRE_MEMORY_HOST); + global_max_stsize = hypre_CTAlloc(HYPRE_Int, num_levels, HYPRE_MEMORY_HOST); + global_avg_stsize = hypre_CTAlloc(HYPRE_Real, num_levels, HYPRE_MEMORY_HOST); + } + + /* Gather UMatrix info */ + for (l = 0; l < num_levels; l++) + { + umatrix = hypre_SStructMatrixParCSRMatrix(A_l[l]); + hypre_ParCSRMatrixSetNumRownnz(umatrix); + if (!hypre_ParCSRMatrixNumNonzeros(umatrix)) + { + hypre_ParCSRMatrixSetNumNonzeros(umatrix); + } + + diag = hypre_ParCSRMatrixDiag(umatrix); + offd = hypre_ParCSRMatrixOffd(umatrix); + diag_i = hypre_CSRMatrixI(diag); + offd_i = hypre_CSRMatrixI(offd); + diag_a = hypre_CSRMatrixData(diag); + offd_a = hypre_CSRMatrixData(offd); + + /* WM: todo - can have the case where all rows have nonzero, which causes issues below... best way to fix this? */ + if (!hypre_CSRMatrixRownnz(diag) && hypre_CSRMatrixNumRownnz(diag)) + { + hypre_CSRMatrixRownnz(diag) = hypre_CTAlloc(HYPRE_Int, hypre_CSRMatrixNumRows(diag), + HYPRE_MEMORY_HOST); + for (i = 0; i < hypre_CSRMatrixNumRows(diag); i++) + { + hypre_CSRMatrixRownnz(diag)[i] = i; + } + } + if (!hypre_CSRMatrixRownnz(offd) && hypre_CSRMatrixNumRownnz(offd)) + { + hypre_CSRMatrixRownnz(offd) = hypre_CTAlloc(HYPRE_Int, hypre_CSRMatrixNumRows(offd), + HYPRE_MEMORY_HOST); + for (i = 0; i < hypre_CSRMatrixNumRows(offd); i++) + { + hypre_CSRMatrixRownnz(offd)[i] = i; + } + } + + hypre_IntArrayData(&arr_diag_r) = hypre_CSRMatrixRownnz(diag); + hypre_IntArrayData(&arr_offd_r) = hypre_CSRMatrixRownnz(offd); + hypre_IntArraySize(&arr_diag_r) = hypre_CSRMatrixNumRownnz(diag); + hypre_IntArraySize(&arr_offd_r) = hypre_CSRMatrixNumRownnz(offd); + hypre_IntArrayMemoryLocation(&arr_diag_r) = HYPRE_MEMORY_HOST; + hypre_IntArrayMemoryLocation(&arr_offd_r) = HYPRE_MEMORY_HOST; + hypre_IntArrayMemoryLocation(&arr_rownnz) = HYPRE_MEMORY_HOST; + + hypre_IntArrayMergeOrdered(&arr_diag_r, &arr_offd_r, &arr_rownnz); + + num_rownnz = hypre_IntArraySize(&arr_rownnz); + rownnz = hypre_IntArrayData(&arr_rownnz); + + if (hypre_ParCSRMatrixNumNonzeros(umatrix) < 0) + { + hypre_ParCSRMatrixSetNumNonzeros(umatrix); + } + if (myid == 0) + { + global_num_rows[l] = hypre_ParCSRMatrixGlobalNumRows(umatrix); + global_num_rownnz[l] = hypre_ParCSRMatrixGlobalNumRownnz(umatrix); + global_num_nonzeros[l] = hypre_ParCSRMatrixNumNonzeros(umatrix); + if (global_num_rownnz[l]) + { + global_avg_entries[l] = global_num_nonzeros[l] / (HYPRE_Real) global_num_rownnz[l]; + } + } + + if (num_rownnz) + { + min_entries = HYPRE_INT_MAX; + max_entries = HYPRE_INT_MIN; + min_rowsum = HYPRE_REAL_MAX; + max_rowsum = - min_rowsum; + } + else + { + min_entries = 0; + max_entries = 0; + min_rowsum = 0.0; + max_rowsum = 0.0; + } + + for (i = 0; i < num_rownnz; i++) + { + ii = rownnz[i]; + + entries = (diag_i[ii + 1] - diag_i[ii]) + (offd_i[ii + 1] - offd_i[ii]); + min_entries = hypre_min(entries, min_entries); + max_entries = hypre_max(entries, max_entries); + + rowsum = 0.0; + for (j = diag_i[ii]; j < diag_i[ii + 1]; j++) + { + rowsum += diag_a[j]; + } + for (j = offd_i[ii]; j < offd_i[ii + 1]; j++) + { + rowsum += offd_a[j]; + } + min_rowsum = hypre_min(rowsum, min_rowsum); + max_rowsum = hypre_max(rowsum, max_rowsum); + } + + send_buffer[0] = - (HYPRE_Real) min_entries; + send_buffer[1] = (HYPRE_Real) max_entries; + send_buffer[2] = - min_rowsum; + send_buffer[3] = max_rowsum; + + hypre_MPI_Reduce(send_buffer, recv_buffer, 4, HYPRE_MPI_REAL, hypre_MPI_MAX, 0, comm); + + if (myid == 0) + { + global_min_entries[l] = - (HYPRE_Int) recv_buffer[0]; + global_max_entries[l] = (HYPRE_Int) recv_buffer[1]; + global_min_rowsum[l] = - recv_buffer[2]; + global_max_rowsum[l] = recv_buffer[3]; + } + + hypre_TFree(rownnz, HYPRE_MEMORY_HOST); + } + + /* Gather SMatrix info */ + for (l = 0; l < num_levels; l++) + { + nparts = hypre_SStructMatrixNParts(A_l[l]); + umatrix = hypre_SStructMatrixParCSRMatrix(A_l[l]); + + min_stsize = HYPRE_INT_MAX; + max_stsize = HYPRE_INT_MIN; + + num_ghrows = num_dofs = num_boxes = num_parts = 0; + avg_stsize = 0.0; + for (part = 0; part < nparts; part++) + { + pmatrix = hypre_SStructMatrixPMatrix(A_l[l], part); + nvars = hypre_SStructPMatrixNVars(pmatrix); + + num_boxes_part = 0; + for (vi = 0; vi < nvars; vi++) + { + for (vj = 0; vj < nvars; vj++) + { + smatrix = hypre_SStructPMatrixSMatrix(pmatrix, vi, vj); + if (smatrix) + { + sgrid = hypre_StructMatrixGrid(smatrix); + num_dofs_grid = hypre_StructGridLocalSize(sgrid); + num_boxes_part += hypre_StructGridNumBoxes(sgrid); + num_dofs += num_dofs_grid; + num_ghrows -= num_dofs_grid; + + if (num_dofs_grid) + { + stencil = hypre_StructMatrixStencil(smatrix); + stencil_size = hypre_StructStencilSize(stencil); + min_stsize = hypre_min(stencil_size, min_stsize); + max_stsize = hypre_max(stencil_size, max_stsize); + avg_stsize += stencil_size * num_dofs_grid; + } + } + } + } + + num_boxes += num_boxes_part; + if (num_boxes_part) + { + num_parts++; + } + } + + send_buffer[0] = (HYPRE_Real) num_boxes; + send_buffer[1] = (HYPRE_Real) num_dofs; + send_buffer[2] = (HYPRE_Real) num_ghrows; + send_buffer[3] = (HYPRE_Real) avg_stsize; + + hypre_MPI_Reduce(send_buffer, recv_buffer, 4, HYPRE_MPI_REAL, hypre_MPI_SUM, 0, comm); + + if (myid == 0) + { + global_num_boxes[l] = (HYPRE_Int) recv_buffer[0]; + global_num_dofs[l] = (HYPRE_Int) recv_buffer[1]; + global_num_ghrows[l] = (HYPRE_Int) recv_buffer[2] + + hypre_ParCSRMatrixGlobalNumRows(umatrix); + global_avg_stsize[l] = recv_buffer[3] / global_num_dofs[l]; + } + + send_buffer[0] = - (HYPRE_Real) min_stsize; + send_buffer[1] = (HYPRE_Real) max_stsize; + + hypre_MPI_Reduce(send_buffer, recv_buffer, 2, HYPRE_MPI_REAL, hypre_MPI_MAX, 0, comm); + + if (myid == 0) + { + global_min_stsize[l] = - (HYPRE_Int) recv_buffer[0]; + global_max_stsize[l] = (HYPRE_Int) recv_buffer[1]; + } + } + + /* Print statistics */ + if (myid == 0) + { + hypre_printf("\nSSAMG Setup Parameters:\n\n"); + + if (print_level > 0) + { + /* Print coarsening direction */ + hypre_printf("Coarsening direction:\n\n"); + chunk_size = hypre_min(nparts, nparts_per_line); + for (chunk = 0; chunk < nparts; chunk += chunk_size) + { + ndigits = 4; + hypre_printf("lev "); + chunk_last = hypre_min(chunk + chunk_size, nparts); + for (part = chunk; part < chunk_last; part++) + { + hypre_printf("pt. %d ", part); + ndigits += 7; + } + hypre_printf("\n"); + for (i = 0; i < ndigits; i++) { hypre_printf("%s", "="); } + hypre_printf("\n"); + for (l = 0; l < (num_levels - 1); l++) + { + hypre_printf("%3d ", l); + for (part = chunk; part < chunk_last; part++) + { + hypre_printf("%6d ", cdir_l[l][part]); + } + hypre_printf("\n"); + } + hypre_printf("\n\n"); + } + + /* Print active parts */ + if (skip_relax > 0) + { + hypre_printf("Active parts:\n\n"); + chunk_size = hypre_min(nparts, nparts_per_line); + for (chunk = 0; chunk < nparts; chunk += chunk_size) + { + ndigits = 4; + hypre_printf("lev "); + chunk_last = hypre_min(chunk + chunk_size, nparts); + for (part = chunk; part < chunk_last; part++) + { + hypre_printf("pt. %d ", part); + ndigits += 7; + } + hypre_printf("\n"); + for (i = 0; i < ndigits; i++) { hypre_printf("%s", "="); } + hypre_printf("\n"); + for (l = 0; l < num_levels; l++) + { + hypre_printf("%3d ", l); + for (part = chunk; part < chunk_last; part++) + { + hypre_printf("%6d ", active_l[l][part]); + } + hypre_printf("\n"); + } + hypre_printf("\n\n"); + } + } + + /* Print relaxation weights for each part*/ + if ((relax_type == 0) || (relax_type == 1)) + { + hypre_printf("Relaxation weights:\n\n"); + chunk_size = hypre_min(nparts, nparts_per_line); + for (chunk = 0; chunk < nparts; chunk += chunk_size) + { + ndigits = 4; + hypre_printf("lev "); + chunk_last = hypre_min(chunk + chunk_size, nparts); + for (part = chunk; part < chunk_last; part++) + { + hypre_printf("pt. %d ", part); + ndigits += 7; + } + hypre_printf("\n"); + for (i = 0; i < ndigits; i++) { hypre_printf("%s", "="); } + hypre_printf("\n"); + for (l = 0; l < num_levels; l++) + { + hypre_printf("%3d ", l); + for (part = chunk; part < chunk_last; part++) + { + hypre_printf("%6.2f ", weights[l][part]); + } + hypre_printf("\n"); + } + hypre_printf("\n\n"); + } + } + } + + /* Print SMatrix info */ + for (l = 0; l < num_levels; l++) + { + nparts = hypre_SStructMatrixNParts(A_l[l]); + ndigits_S[0] = hypre_max(hypre_ndigits(nparts) + offset, ndigits_S[0]); + ndigits_S[1] = hypre_max(hypre_ndigits(global_num_boxes[l]) + offset, ndigits_S[1]); + ndigits_S[2] = hypre_max(hypre_ndigits(global_num_dofs[l]) + offset, ndigits_S[2]); + ndigits_S[3] = hypre_max(hypre_ndigits(global_min_stsize[l]) + offset, ndigits_S[3]); + ndigits_S[4] = hypre_max(hypre_ndigits(global_max_stsize[l]) + offset, ndigits_S[4]); + ndigits_S[5] = hypre_max(hypre_ndigits((HYPRE_BigInt)global_avg_stsize[l]) + offset, + ndigits_S[5]); + } + + header[0] = 3 + (ndigits_S[0] + ndigits_S[1]) / 2; + header[1] = ndigits_S[2] + ndigits_S[3] + ndigits_S[4] + ndigits_S[5] + + (3 + ndigits_S[0] + ndigits_S[1] - header[0]); + header[2] = header[0] + header[1]; + //header[2] = header[0] + header[1] + 22; + + /* Print first line of header */ + hypre_printf("SMatrix info:\n\n"); + hypre_printf("%*s", header[0], "active"); + hypre_printf("%*s", header[1], "stencil size"); + //hypre_printf("%22s", "row sums"); + hypre_printf("\n"); + + /* Print second line of header */ + hypre_printf("%s", "lev"); + hypre_printf("%*s", ndigits_S[0], "parts"); + hypre_printf("%*s", ndigits_S[1], "boxes"); + hypre_printf("%*s", ndigits_S[2], "DOFs"); + hypre_printf("%*s", ndigits_S[3], "min"); + hypre_printf("%*s", ndigits_S[4], "max"); + hypre_printf("%*s", ndigits_S[5], "avg"); + //hypre_printf("%11s %10s", "min", "max"); + hypre_printf("\n"); + + /* Print third line of header */ + for (i = 0; i < header[2]; i++) + { + hypre_printf("%s", "="); + } + hypre_printf("\n"); + + /* Print info */ + for (l = 0; l < num_levels; l++) + { + nparts = hypre_SStructMatrixNParts(A_l[l]); + hypre_printf("%3d", l); + hypre_printf("%*d", ndigits_S[0], nparts); + hypre_printf("%*d", ndigits_S[1], global_num_boxes[l]); + hypre_printf("%*d", ndigits_S[2], global_num_dofs[l]); + hypre_printf("%*d", ndigits_S[3], global_min_stsize[l]); + hypre_printf("%*d", ndigits_S[4], global_max_stsize[l]); + hypre_printf("%*.1f", ndigits_S[5], global_avg_stsize[l]); + hypre_printf("\n"); + } + hypre_printf("\n\n"); + + /* Print UMatrix info */ + for (l = 0; l < num_levels; l++) + { + ndigits_U[0] = hypre_max(hypre_ndigits(global_num_rows[l]) + offset, ndigits_U[0]); + ndigits_U[1] = hypre_max(hypre_ndigits(global_num_ghrows[l]) + offset, ndigits_U[1]); + ndigits_U[2] = hypre_max(hypre_ndigits(global_num_rownnz[l]) + offset, ndigits_U[2]); + ndigits_U[3] = hypre_max(hypre_ndigits(global_num_nonzeros[l]) + offset, ndigits_U[3]); + ndigits_U[4] = hypre_max(hypre_ndigits(global_min_entries[l]) + offset, ndigits_U[4]); + ndigits_U[5] = hypre_max(hypre_ndigits(global_max_entries[l]) + offset, ndigits_U[5]); + ndigits_U[6] = hypre_max(hypre_ndigits((HYPRE_BigInt)global_avg_entries[l]) + + offset, ndigits_U[6]); + } + + header[0] = 3 + ndigits_U[0] + ndigits_U[1]; + header[1] = ndigits_U[2]; + header[2] = ndigits_U[3]; + header[3] = hypre_max(16, ndigits_U[4] + ndigits_U[5] + ndigits_U[6]); + header[4] = header[0] + header[1] + header[2] + header[3] + 22; + ndigits_U[4] = 16 - ndigits_U[5] - ndigits_U[6]; + + /* Print first line of header */ + hypre_printf("UMatrix info:\n\n"); + hypre_printf("%*s", header[0], "ghost"); + hypre_printf("%*s", header[1], "nnz"); + hypre_printf("%*s", header[2], "nnz"); + hypre_printf("%*s", header[3], "entries/nnzrow"); + hypre_printf("%22s\n", "row sums"); + + /* Print second line of header */ + hypre_printf("%s", "lev"); + hypre_printf("%*s", ndigits_U[0], "rows"); + hypre_printf("%*s", ndigits_U[1], "rows"); + hypre_printf("%*s", ndigits_U[2], "rows"); + hypre_printf("%*s", ndigits_U[3], "entries"); + hypre_printf("%*s", ndigits_U[4], "min"); + hypre_printf("%*s", ndigits_U[5], "max"); + hypre_printf("%*s", ndigits_U[6], "avg"); + hypre_printf("%11s %10s\n", "min", "max"); + + /* Print third line of header */ + for (i = 0; i < header[4]; i++) + { + hypre_printf("%s", "="); + } + hypre_printf("\n"); + + /* Print info */ + for (l = 0; l < num_levels; l++) + { + hypre_printf("%3d", l); + hypre_printf("%*d", ndigits_U[0], global_num_rows[l]); + hypre_printf("%*d", ndigits_U[1], global_num_ghrows[l]); + hypre_printf("%*d", ndigits_U[2], global_num_rownnz[l]); + hypre_printf("%*d", ndigits_U[3], global_num_nonzeros[l]); + hypre_printf("%*d", ndigits_U[4], global_min_entries[l]); + hypre_printf("%*d", ndigits_U[5], global_max_entries[l]); + hypre_printf("%*.1f", ndigits_U[6], global_avg_entries[l]); + hypre_printf("%11.2e", global_min_rowsum[l]); + hypre_printf("%11.2e", global_max_rowsum[l]); + hypre_printf("\n"); + } + hypre_printf("\n\n"); + + /* SSAMG details */ + if (non_galerkin) + { + hypre_printf("RAP type: non-galerkin\n"); + } + else + { + hypre_printf("RAP type: galerkin\n"); + } + + hypre_printf("Relaxation skip: "); + if (skip_relax) + { + hypre_printf("on\n"); + } + else + { + hypre_printf("none\n"); + } + + hypre_printf("Relaxation type: "); + if (relax_type == 0) + { + hypre_printf("Jacobi\n"); + } + else if (relax_type == 1) + { + hypre_printf("Weighted Jacobi\n"); + } + else if (relax_type == 2) + { + hypre_printf("L1-Jacobi\n"); + } + else if (relax_type == 10) + { + hypre_printf("Red-Black Gauss-Seidel\n"); + } + else + { + hypre_printf("Unknown\n"); + } + + hypre_printf("Coarse solver type: "); + if (csolver_type == 0) + { + hypre_printf("Weighted Jacobi\n"); + } + else if (csolver_type == 1) + { + hypre_printf("BoomerAMG\n"); + } + else + { + hypre_printf("Unknown\n"); + } + + hypre_printf("Number of pre-sweeps: %d\n", num_pre_relax); + hypre_printf("Number of pos-sweeps: %d\n", num_pos_relax); + hypre_printf("Number of coarse-sweeps: %d\n", num_crelax); + hypre_printf("Number of levels: %d\n", num_levels); + } + + /* Print coarse solver data */ + if ((csolver_type == 1) && (print_level > 0)) + { + hypre_BoomerAMGSetupStats((void*) (ssamg_data -> csolver), + hypre_SStructMatrixParCSRMatrix(A_l[0])); + } + + if ((myid == 0) && (print_level > 0)) + { + hypre_printf("\n\n"); + } + + if (myid == 0) + { + hypre_TFree(global_num_rows, HYPRE_MEMORY_HOST); + hypre_TFree(global_num_rownnz, HYPRE_MEMORY_HOST); + hypre_TFree(global_num_nonzeros, HYPRE_MEMORY_HOST); + hypre_TFree(global_min_entries, HYPRE_MEMORY_HOST); + hypre_TFree(global_max_entries, HYPRE_MEMORY_HOST); + hypre_TFree(global_avg_entries, HYPRE_MEMORY_HOST); + hypre_TFree(global_min_rowsum, HYPRE_MEMORY_HOST); + hypre_TFree(global_max_rowsum, HYPRE_MEMORY_HOST); + hypre_TFree(global_num_boxes, HYPRE_MEMORY_HOST); + hypre_TFree(global_num_dofs, HYPRE_MEMORY_HOST); + hypre_TFree(global_num_ghrows, HYPRE_MEMORY_HOST); + hypre_TFree(global_min_stsize, HYPRE_MEMORY_HOST); + hypre_TFree(global_max_stsize, HYPRE_MEMORY_HOST); + hypre_TFree(global_avg_stsize, HYPRE_MEMORY_HOST); + } + + return hypre_error_flag; +} diff --git a/src/sstruct_ls/ssamg_uinterp.c b/src/sstruct_ls/ssamg_uinterp.c new file mode 100644 index 0000000000..edd3d6ca64 --- /dev/null +++ b/src/sstruct_ls/ssamg_uinterp.c @@ -0,0 +1,559 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/* Disable OpenMP support in this source file due to issues with box loop reduction */ +#include "HYPRE_config.h" +#if defined (HYPRE_USING_OPENMP) +#define OMP0 +#define OMP1 +#endif + +#include "_hypre_sstruct_ls.h" +#include "_hypre_struct_mv.hpp" +#include "ssamg.h" + +/*-------------------------------------------------------------------------- + * Sets up unstructured interpolation coefficients + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SSAMGSetupUInterpOp( hypre_SStructMatrix *A, + HYPRE_Int *cdir_p, + hypre_SStructMatrix *P, + HYPRE_Int interp_type) +{ + HYPRE_MemoryLocation memory_location = hypre_SStructMatrixMemoryLocation(A); + HYPRE_Int ndim = hypre_SStructMatrixNDim(P); + hypre_SStructGraph *graph = hypre_SStructMatrixGraph(P); + hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); + HYPRE_Int nparts = hypre_SStructGridNParts(grid); + + hypre_ParCSRMatrix *A_u = hypre_SStructMatrixParCSRMatrix(A); + hypre_CSRMatrix *A_ud = hypre_ParCSRMatrixDiag(A_u); + hypre_CSRMatrix *A_uo = hypre_ParCSRMatrixOffd(A_u); + hypre_ParCSRMatrix *A_aug; + hypre_ParCSRMatrix *P_u; + hypre_CSRMatrix *P_ud; + hypre_CSRMatrix *P_uo; + + hypre_SStructPMatrix *A_p; + hypre_StructMatrix *A_s; + hypre_SStructPGrid *pgrid; + hypre_StructGrid *sgrid; + hypre_BoxArray *compute_boxes; + hypre_Box *compute_box; + hypre_Box *tmp_box; + + hypre_Index stride, loop_size; + hypre_Box *shrink_box; + hypre_Index grow_index; + hypre_IndexRef shrink_start; + + HYPRE_Int *num_ghost; + HYPRE_Int cdir; + HYPRE_Int part, nvars; + HYPRE_Int i, j, vi; + HYPRE_Int vol, offset; + HYPRE_Int box_start_index; + + HYPRE_Int debug_flag = 0; + HYPRE_Real trunc_factor = 0.0; + HYPRE_Int max_elmts = 4; + + void *A_obj; + hypre_IJMatrix *A_struct_bndry_ij = NULL; + hypre_ParCSRMatrix *A_struct_bndry; + hypre_ParCSRMatrix *A_bndry; + hypre_ParCSRMatrix *zero; + hypre_CSRMatrix *zero_diag; + hypre_CSRMatrix *delete_zeros; + HYPRE_Int num_indices; + HYPRE_Int *indices[HYPRE_MAXDIM]; + hypre_BoxArray *indices_boxa = NULL; + hypre_Index start; + HYPRE_Real threshold; + hypre_BoxArray ***convert_boxa; + HYPRE_Int *CF_marker; + +#if defined(HYPRE_USING_GPU) + HYPRE_Int *all_indices[HYPRE_MAXDIM]; + HYPRE_Int *box_nnzrows; + HYPRE_Int *box_nnzrows_end; + HYPRE_Int max_num_rownnz; + HYPRE_Int *nonzero_rows; + HYPRE_Int *nonzero_rows_end; + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(memory_location); +#endif + + /*------------------------------------------------------- + * Create temporary boxes + *-------------------------------------------------------*/ + + tmp_box = hypre_BoxCreate(ndim); + shrink_box = hypre_BoxCreate(ndim); + compute_box = hypre_BoxCreate(ndim); + + /* Set up unstructured interpolation component */ + if (interp_type >= 0) + { +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + if (exec == HYPRE_EXEC_DEVICE) + { + /* Get nonzero rows of A_u (that is, all rows with nonzeros in diag or offd) */ + if (!hypre_CSRMatrixRownnz(A_ud)) + { + hypre_CSRMatrixSetRownnz(A_ud); + } + if (!hypre_CSRMatrixRownnz(A_uo)) + { + hypre_CSRMatrixSetRownnz(A_uo); + } + max_num_rownnz = hypre_CSRMatrixNumRownnz(A_ud) + hypre_CSRMatrixNumRownnz(A_uo); + nonzero_rows = hypre_TAlloc(HYPRE_Int, max_num_rownnz, HYPRE_MEMORY_DEVICE); + HYPRE_THRUST_CALL(merge, + hypre_CSRMatrixRownnz(A_ud), + hypre_CSRMatrixRownnz(A_ud) + hypre_CSRMatrixNumRownnz(A_ud), + hypre_CSRMatrixRownnz(A_uo), + hypre_CSRMatrixRownnz(A_uo) + hypre_CSRMatrixNumRownnz(A_uo), + nonzero_rows); + nonzero_rows_end = HYPRE_THRUST_CALL(unique, + nonzero_rows, + nonzero_rows + max_num_rownnz); + } +#endif + + /* Convert boundary of A to IJ matrix */ + offset = 0; + threshold = 0.8; // WM: todo - what should this be? + convert_boxa = hypre_TAlloc(hypre_BoxArray**, nparts, HYPRE_MEMORY_HOST); + for (part = 0; part < nparts; part++) + { + A_p = hypre_SStructMatrixPMatrix(A, part); + pgrid = hypre_SStructGridPGrid(grid, part); + nvars = hypre_SStructPGridNVars(pgrid); + + convert_boxa[part] = hypre_CTAlloc(hypre_BoxArray*, nvars, HYPRE_MEMORY_HOST); + + /* Loop over variables */ + for (vi = 0; vi < nvars; vi++) + { + A_s = hypre_SStructPMatrixSMatrix(A_p, vi, vi); + sgrid = hypre_StructMatrixGrid(A_s); + + /* WM: todo - using the DataSpace yields a box that contains one layer + of ghost zones on the fine grid but NOT on the coarse grid... + need to do grid box and then add the ghosts... why? */ + /* compute_boxes = hypre_StructMatrixDataSpace(A_s); */ + compute_boxes = hypre_StructGridBoxes(sgrid); + convert_boxa[part][vi] = hypre_BoxArrayCreate(0, ndim); + + /* Loop over boxes */ + hypre_ForBoxI(i, compute_boxes) + { + hypre_CopyBox(hypre_BoxArrayBox(compute_boxes, i), compute_box); + num_ghost = hypre_StructGridNumGhost(sgrid); + hypre_BoxGrowByArray(compute_box, num_ghost); + hypre_BoxGetSize(compute_box, loop_size); + vol = hypre_BoxVolume(compute_box); + hypre_SetIndex(stride, 1); + hypre_CopyToIndex(hypre_BoxIMin(compute_box), ndim, start); + +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { + /* Get ALL the indices */ + for (j = 0; j < ndim; j++) + { + all_indices[j] = hypre_CTAlloc(HYPRE_Int, vol, HYPRE_MEMORY_DEVICE); + } + + hypre_BoxLoop1Begin(ndim, loop_size, compute_box, start, stride, ii); + { + hypre_Index index; + hypre_BoxLoopGetIndex(index); + if (ndim > 0) + { + all_indices[0][ii] = index[0] + start[0]; + } + if (ndim > 1) + { + all_indices[1][ii] = index[1] + start[1]; + } + if (ndim > 2) + { + all_indices[2][ii] = index[2] + start[2]; + } + } + hypre_BoxLoop1End(ii); + +#if defined(HYPRE_USING_SYCL) + /* WM: todo - sycl */ +#else + /* Get the nonzero rows for this box */ + box_nnzrows = hypre_TAlloc(HYPRE_Int, vol, + HYPRE_MEMORY_DEVICE); + box_nnzrows_end = HYPRE_THRUST_CALL(copy_if, + nonzero_rows, + nonzero_rows_end, + box_nnzrows, + in_range(offset, offset + vol)); + HYPRE_THRUST_CALL(transform, + box_nnzrows, + box_nnzrows_end, + thrust::make_constant_iterator(offset), + box_nnzrows, + thrust::minus()); + num_indices = box_nnzrows_end - box_nnzrows; + + for (j = 0; j < ndim; j++) + { + indices[j] = hypre_CTAlloc(HYPRE_Int, num_indices, + HYPRE_MEMORY_DEVICE); + } + + /* Gather indices at non-zero rows of A_u */ + for (j = 0; j < ndim; j++) + { + HYPRE_THRUST_CALL(gather, + box_nnzrows, + box_nnzrows_end, + all_indices[j], + indices[j]); + } + + /* Free memory */ + for (j = 0; j < ndim; j++) + { + hypre_TFree(all_indices[j], HYPRE_MEMORY_DEVICE); + } + hypre_TFree(box_nnzrows, HYPRE_MEMORY_DEVICE); + +#endif // defined(HYPRE_USING_SYCL) + } + else +#endif // defined(HYPRE_USING_GPU) + { + num_indices = 0; + for (j = 0; j < ndim; j++) + { + indices[j] = hypre_CTAlloc(HYPRE_Int, vol, HYPRE_MEMORY_HOST); + } + + /* TODO: re-enable box loop reduction with OpenMP */ + hypre_BoxLoop1ReductionBeginHost(ndim, loop_size, compute_box, + start, stride, ii, num_indices); + { + if (hypre_CSRMatrixI(A_ud)[offset + ii + 1] - + hypre_CSRMatrixI(A_ud)[offset + ii] + + hypre_CSRMatrixI(A_uo)[offset + ii + 1] - + hypre_CSRMatrixI(A_uo)[offset + ii] > 0) + { + hypre_Index index; + hypre_BoxLoopGetIndexHost(index); + for (j = 0; j < ndim; j++) + { + indices[j][num_indices] = index[j] + start[j]; + } + num_indices++; + } + } + hypre_BoxLoop1ReductionEndHost(ii, num_indices); + } + + /* WM: todo - these offsets for the unstructured indices only + work with no inter-variable couplings? */ + offset += vol; + + /* Create box array from indices marking where A_u is non-trivial */ + if (num_indices) + { + hypre_BoxArrayCreateFromIndices(ndim, num_indices, indices, + threshold, &indices_boxa); + hypre_ForBoxI(j, indices_boxa) + { + hypre_CopyBox(hypre_BoxArrayBox(indices_boxa, j), tmp_box); + + /* WM: todo - need 2 for distance 2 interp below? + Make this dependent on interpolation or just hardcode to 2? */ + hypre_BoxGrowByValue(tmp_box, 2); + + /* WM: intersect with the struct grid box... is that right? + NOTE: if you change to DataSpace of the matrix above, you'll + need to change this line */ + hypre_IntersectBoxes(tmp_box, + hypre_BoxArrayBox(compute_boxes, i), + tmp_box); + + /* Safety check: only append valid boxes */ + if (hypre_BoxVolume(tmp_box) > 0) + { + hypre_AppendBox(tmp_box, convert_boxa[part][vi]); + } + } + hypre_BoxArrayDestroy(indices_boxa); + indices_boxa = NULL; + } + + /* Free memory */ + for (j = 0; j < ndim; j++) + { + hypre_TFree(indices[j], memory_location); + } + } + } + } + hypre_SStructMatrixBoxesToUMatrix(A, grid, &A_struct_bndry_ij, convert_boxa); + for (part = 0; part < nparts; part++) + { + for (vi = 0; vi < nvars; vi++) + { + hypre_BoxArrayDestroy(convert_boxa[part][vi]); + } + hypre_TFree(convert_boxa[part], HYPRE_MEMORY_HOST); + } + hypre_TFree(convert_boxa, HYPRE_MEMORY_HOST); + + /* Add structured boundary portion to unstructured portion */ + HYPRE_IJMatrixGetObject(A_struct_bndry_ij, &A_obj); + A_struct_bndry = (hypre_ParCSRMatrix *) A_obj; + hypre_ParCSRMatrixAdd(1.0, A_struct_bndry, 1.0, A_u, &A_bndry); + + /* WM: todo - I'm adding a zero diagonal here because if BoomerAMG + interpolation gets a totally empty matrix (no nonzeros and a NULL data array) + you run into seg faults... this is kind of a dirty fix for now */ + zero = hypre_ParCSRMatrixCreate(hypre_ParCSRMatrixComm(A_u), + hypre_ParCSRMatrixGlobalNumRows(A_u), + hypre_ParCSRMatrixGlobalNumCols(A_u), + hypre_ParCSRMatrixRowStarts(A_u), + hypre_ParCSRMatrixRowStarts(A_u), + 0, + hypre_ParCSRMatrixNumRows(A_u), + 0); + hypre_ParCSRMatrixInitialize_v2(zero, memory_location); + zero_diag = hypre_ParCSRMatrixDiag(zero); + for (i = 0; i < hypre_CSRMatrixNumRows(zero_diag); i++) + { + hypre_CSRMatrixI(zero_diag)[i] = i; + hypre_CSRMatrixJ(zero_diag)[i] = i; + hypre_CSRMatrixData(zero_diag)[i] = 0.0; + } + hypre_CSRMatrixI(zero_diag)[ hypre_CSRMatrixNumRows(zero_diag) ] = + hypre_CSRMatrixNumRows(zero_diag); + hypre_ParCSRMatrixAdd(1.0, zero, 1.0, A_bndry, &A_aug); + + /* Free memory */ + hypre_ParCSRMatrixDestroy(zero); + hypre_ParCSRMatrixDestroy(A_bndry); + + /* Get CF splitting */ + CF_marker = hypre_CTAlloc(HYPRE_Int, + hypre_ParCSRMatrixNumRows(A_u), + memory_location); + + /* Initialize CF_marker to all C-point (F-points marked below) */ +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { + hypreDevice_IntFilln(CF_marker, (size_t) hypre_ParCSRMatrixNumRows(A_u), 1); + } + else +#endif + { + for (i = 0; i < hypre_ParCSRMatrixNumRows(A_u); i++) + { + CF_marker[i] = 1; + } + } + + /* Loop over parts */ + /* WM: todo - re-work CF splitting stuff below... + I don't think what I have is general. */ + box_start_index = 0; + for (part = 0; part < nparts; part++) + { + pgrid = hypre_SStructGridPGrid(grid, part); + nvars = hypre_SStructPGridNVars(pgrid); + A_p = hypre_SStructMatrixPMatrix(A, part); + + /* WM: todo - cdir can be -1, indicating no coarsening... + need to account for this case */ + cdir = cdir_p[part]; + + /* Loop over variables */ + for (vi = 0; vi < nvars; vi++) + { + A_s = hypre_SStructPMatrixSMatrix(A_p, vi, vi); + sgrid = hypre_StructMatrixGrid(A_s); + compute_boxes = hypre_StructGridBoxes(sgrid); + /* compute_boxes = hypre_StructMatrixDataSpace(A_s); */ + + /* Loop over boxes */ + hypre_ForBoxI(i, compute_boxes) + { + /* WM: how to set loop_size, box, start, stride? + * I guess cdir will be used to set the stride? */ + /* WM: do I need to worry about ghost zones here or anything? */ + /* compute_box = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A_s), i); */ + hypre_CopyBox(hypre_BoxArrayBox(compute_boxes, i), compute_box); + hypre_CopyBox(hypre_BoxArrayBox(compute_boxes, i), shrink_box); + + /* Grow the compute box to include ghosts */ + /* WM: todo - use the below instead? I guess sometimes the number of ghosts is not 1 in all directions? */ + /* HYPRE_Int *num_ghost = hypre_StructGridNumGhost(sgrid); */ + /* hypre_BoxGrowByArray(compute_box, num_ghost); */ + + hypre_SetIndex(grow_index, 1); + hypre_BoxGrowByIndex(compute_box, grow_index); + + /* Don't add ghosts to the shrink box in the coarseining direction */ + /* WM: is this right??? What if num_ghosts is not 1??? */ + /* num_ghost[2 * cdir] -= 1; */ + /* num_ghost[2 * cdir + 1] -= 1; */ + /* hypre_BoxGrowByArray(shrink_box, num_ghost); */ + + hypre_IndexD(grow_index, cdir) = 0; + hypre_BoxGrowByIndex(shrink_box, grow_index); + shrink_start = hypre_BoxIMin(shrink_box); + + /* WM: define the start by even/odd coordinate... is this right? */ + if (hypre_IndexD(shrink_start, cdir) % 2 == 0) + { + hypre_IndexD(shrink_start, cdir)++; + } + + /* Set the stride to 2 in the coarsening direction (1 otherwise) */ + hypre_SetIndex(stride, 1); + hypre_IndexD(stride, cdir) = 2; + + /* Get the loop size */ + /* WM: todo - what if there are multiple boxes per part??? + Does this approach still work? */ + hypre_BoxGetStrideSize(shrink_box, stride, loop_size); + + /* Loop over dofs */ + hypre_BoxLoop1Begin(ndim, loop_size, compute_box, + shrink_start, stride, ii); + { + CF_marker[box_start_index + ii] = -1; + } + hypre_BoxLoop1End(ii); + + /* Increment box start index */ + box_start_index += hypre_BoxVolume(compute_box); + } + } + } + + /* Generate unstructured interpolation */ + /* WM: todo - experiment with strenght matrix that counts only the P_s stencil + entries and all inter-part connections as strong; this keeps the same + sparsity pattern inside the structured part + WM: todo - add other interpolation options (align interp_type parameter + with BoomerAMG numbering) */ +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_CSRMatrixMoveDiagFirstDevice(hypre_ParCSRMatrixDiag(A_aug)); + } +#endif + hypre_BoomerAMGBuildInterp(A_aug, + CF_marker, + A_aug, /* WM: todo - do I need to do any strength measure here? */ + hypre_ParCSRMatrixColStarts(hypre_SStructMatrixParCSRMatrix(P)), + 1, + NULL, + debug_flag, + trunc_factor, + max_elmts, + &P_u); + + /* Set P_u as unstructured component of P */ + hypre_IJMatrixDestroyParCSR(hypre_SStructMatrixIJMatrix(P)); + hypre_IJMatrixSetObject(hypre_SStructMatrixIJMatrix(P), P_u); + hypre_SStructMatrixParCSRMatrix(P) = P_u; + hypre_IJMatrixAssembleFlag(hypre_SStructMatrixIJMatrix(P)) = 1; + + /* Zero out C-point injection entries and entries in P_u outside + of non-zero rows of A_u and delete zeros */ + P_ud = hypre_ParCSRMatrixDiag(P_u); + P_uo = hypre_ParCSRMatrixOffd(P_u); + for (i = 0; i < hypre_CSRMatrixNumRows(A_ud); i++) + { + /* If this is a C-point or a zero row in A_u, zero out P_u */ + if (CF_marker[i] == 1 || + (hypre_CSRMatrixI(A_ud)[i + 1] - hypre_CSRMatrixI(A_ud)[i] + + hypre_CSRMatrixI(A_uo)[i + 1] - hypre_CSRMatrixI(A_uo)[i]) == 0) + { + for (j = hypre_CSRMatrixI(P_ud)[i]; j < hypre_CSRMatrixI(P_ud)[i + 1]; j++) + { + hypre_CSRMatrixData(P_ud)[j] = 0.0; + } + for (j = hypre_CSRMatrixI(P_uo)[i]; j < hypre_CSRMatrixI(P_uo)[i + 1]; j++) + { + hypre_CSRMatrixData(P_uo)[j] = 0.0; + } + } + } + + delete_zeros = hypre_CSRMatrixDeleteZeros(P_ud, HYPRE_REAL_MIN); + if (delete_zeros) + { + hypre_CSRMatrixDestroy(P_ud); + P_ud = hypre_ParCSRMatrixDiag(P_u) = delete_zeros; + } + hypre_CSRMatrixSetRownnz(P_ud); + + delete_zeros = hypre_CSRMatrixDeleteZeros(P_uo, HYPRE_REAL_MIN); + if (delete_zeros) + { + hypre_CSRMatrixDestroy(P_uo); + P_uo = hypre_ParCSRMatrixOffd(P_u) = delete_zeros; + } + hypre_CSRMatrixSetRownnz(P_uo); + + /* Overwrite entries in P_s where appropriate with values of P_u */ + hypre_SStructMatrixCompressUToS(P, 0); + + /* Remove zeros from P_u again after the compression above */ + /* WM: todo - Currently I have to get rid of zeros twice... + is there a better way? */ + delete_zeros = hypre_CSRMatrixDeleteZeros(P_ud, HYPRE_REAL_MIN); + if (delete_zeros) + { + hypre_CSRMatrixDestroy(P_ud); + P_ud = hypre_ParCSRMatrixDiag(P_u) = delete_zeros; + hypre_CSRMatrixSetRownnz(P_ud); + } + + delete_zeros = hypre_CSRMatrixDeleteZeros(P_uo, HYPRE_REAL_MIN); + if (delete_zeros) + { + hypre_CSRMatrixDestroy(P_uo); + P_uo = hypre_ParCSRMatrixOffd(P_u) = delete_zeros; + hypre_CSRMatrixSetRownnz(P_uo); + } + hypre_ParCSRMatrixSetNumNonzeros(P_u); + + /* Clean up */ + HYPRE_IJMatrixDestroy(A_struct_bndry_ij); + hypre_ParCSRMatrixDestroy(A_aug); + hypre_TFree(CF_marker, hypre_HandleMemoryLocation(hypre_handle())); +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_TFree(nonzero_rows, HYPRE_MEMORY_DEVICE); + } +#endif + } + + /* Free memory */ + hypre_BoxDestroy(tmp_box); + hypre_BoxDestroy(shrink_box); + hypre_BoxDestroy(compute_box); + + return hypre_error_flag; +} diff --git a/src/sstruct_ls/sstruct_amr_intercommunication.c b/src/sstruct_ls/sstruct_amr_intercommunication.c deleted file mode 100644 index 5cb5ce1afc..0000000000 --- a/src/sstruct_ls/sstruct_amr_intercommunication.c +++ /dev/null @@ -1,102 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_sstruct_ls.h" - -/*-------------------------------------------------------------------------- - * hypre_SStructAMRInterCommunication: Given the sendinfo, recvinfo, etc., - * a communication pkg is formed. This pkg may be used for amr inter_level - * communication. - *--------------------------------------------------------------------------*/ - -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_CommInfo *comm_info; - hypre_CommPkg *comm_pkg; - - hypre_BoxArrayArray *sendboxes; - HYPRE_Int **sprocesses; - hypre_BoxArrayArray *send_rboxes; - HYPRE_Int **send_rboxnums; - - hypre_BoxArrayArray *recvboxes; - HYPRE_Int **rprocesses; - hypre_BoxArrayArray *recv_rboxes; - HYPRE_Int **recv_rboxnums; - - hypre_BoxArray *boxarray; - - HYPRE_Int i, j; - HYPRE_Int ierr = 0; - - /*------------------------------------------------------------------------ - * The communication info is copied from sendinfo & recvinfo. - *------------------------------------------------------------------------*/ - sendboxes = 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); - - hypre_ForBoxArrayI(i, sendboxes) - { - 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); - - hypre_ForBoxI(j, boxarray) - { - sprocesses[i][j] = (sendinfo -> send_procs)[i][j]; - send_rboxnums[i][j] = (sendinfo -> send_remote_boxnums)[i][j]; - } - } - - recvboxes = hypre_BoxArrayArrayDuplicate(recvinfo -> recv_boxes); - recv_rboxes = hypre_BoxArrayArrayDuplicate(recvinfo -> recv_boxes); - rprocesses = hypre_CTAlloc(HYPRE_Int *, hypre_BoxArrayArraySize(recvboxes), HYPRE_MEMORY_HOST); - - /* dummy pointer for CommInfoCreate */ - recv_rboxnums = hypre_CTAlloc(HYPRE_Int *, hypre_BoxArrayArraySize(recvboxes), HYPRE_MEMORY_HOST); - - 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); - - hypre_ForBoxI(j, boxarray) - { - rprocesses[i][j] = (recvinfo -> recv_procs)[i][j]; - } - } - - - hypre_CommInfoCreate(sendboxes, recvboxes, sprocesses, rprocesses, - send_rboxnums, recv_rboxnums, send_rboxes, - recv_rboxes, 1, &comm_info); - - hypre_CommPkgCreate(comm_info, - send_data_space, - recv_data_space, - num_values, NULL, 0, comm, - &comm_pkg); - hypre_CommInfoDestroy(comm_info); - - *comm_pkg_ptr = comm_pkg; - - return ierr; -} - - diff --git a/src/sstruct_ls/sstruct_owninfo.c b/src/sstruct_ls/sstruct_owninfo.c deleted file mode 100644 index c3df9fd709..0000000000 --- a/src/sstruct_ls/sstruct_owninfo.c +++ /dev/null @@ -1,259 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_sstruct_ls.h" - -HYPRE_Int -hypre_SStructIndexScaleF_C( hypre_Index findex, - hypre_Index index, - hypre_Index stride, - hypre_Index cindex ) -{ - hypre_IndexX(cindex) = - (hypre_IndexX(findex) - hypre_IndexX(index)) / hypre_IndexX(stride); - hypre_IndexY(cindex) = - (hypre_IndexY(findex) - hypre_IndexY(index)) / hypre_IndexY(stride); - hypre_IndexZ(cindex) = - (hypre_IndexZ(findex) - hypre_IndexZ(index)) / hypre_IndexZ(stride); - - return 0; -} - - -HYPRE_Int -hypre_SStructIndexScaleC_F( hypre_Index cindex, - hypre_Index index, - hypre_Index stride, - hypre_Index findex ) -{ - hypre_IndexX(findex) = - hypre_IndexX(cindex) * hypre_IndexX(stride) + hypre_IndexX(index); - hypre_IndexY(findex) = - hypre_IndexY(cindex) * hypre_IndexY(stride) + hypre_IndexY(index); - hypre_IndexZ(findex) = - hypre_IndexZ(cindex) * hypre_IndexZ(stride) + hypre_IndexZ(index); - - return 0; -} -/*-------------------------------------------------------------------------- - * hypre_SStructOwnInfo: Given a fgrid, coarsen each fbox and find the - * coarsened boxes that belong on my current processor. These are my own_boxes. - *--------------------------------------------------------------------------*/ - -hypre_SStructOwnInfoData * -hypre_SStructOwnInfo( hypre_StructGrid *fgrid, - hypre_StructGrid *cgrid, - hypre_BoxManager *cboxman, - hypre_BoxManager *fboxman, - hypre_Index rfactor ) -{ - hypre_SStructOwnInfoData *owninfo_data; - - MPI_Comm comm = hypre_SStructVectorComm(fgrid); - HYPRE_Int ndim = hypre_StructGridNDim(fgrid); - - hypre_BoxArray *grid_boxes; - hypre_BoxArray *intersect_boxes; - hypre_BoxArray *tmp_boxarray; - - hypre_Box *grid_box, scaled_box; - hypre_Box boxman_entry_box; - - hypre_BoxManEntry **boxman_entries; - HYPRE_Int nboxman_entries; - - hypre_BoxArrayArray *own_boxes; - HYPRE_Int **own_cboxnums; - - hypre_BoxArrayArray *own_composite_cboxes; - - hypre_Index ilower, iupper, index; - - HYPRE_Int myproc, proc; - - HYPRE_Int cnt; - HYPRE_Int i, j, k, mod; - - hypre_BoxInit(&scaled_box, ndim); - hypre_BoxInit(&boxman_entry_box, ndim); - - hypre_ClearIndex(index); - hypre_MPI_Comm_rank(comm, &myproc); - - owninfo_data = hypre_CTAlloc(hypre_SStructOwnInfoData, 1, HYPRE_MEMORY_HOST); - - /*------------------------------------------------------------------------ - * 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 - * will give the own_boxes. - *------------------------------------------------------------------------*/ - 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); - - 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++; - } - } - hypre_TFree(boxman_entries, HYPRE_MEMORY_HOST); - } /* hypre_ForBoxI(i, grid_boxes) */ - - (owninfo_data -> size) = hypre_BoxArraySize(grid_boxes); - (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. - *------------------------------------------------------------------------*/ - 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, - &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 - 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); - } - hypre_BoxArrayDestroy(tmp_boxarray); - - (owninfo_data -> own_composite_cboxes) = own_composite_cboxes; - - return owninfo_data; -} - -/*-------------------------------------------------------------------------- - * hypre_SStructOwnInfoDataDestroy - *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_SStructOwnInfoDataDestroy(hypre_SStructOwnInfoData *owninfo_data) -{ - HYPRE_Int ierr = 0; - HYPRE_Int i; - - if (owninfo_data) - { - if (owninfo_data -> own_boxes) - { - hypre_BoxArrayArrayDestroy( (owninfo_data -> own_boxes) ); - } - - 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, HYPRE_MEMORY_HOST); - - if (owninfo_data -> own_composite_cboxes) - { - hypre_BoxArrayArrayDestroy( (owninfo_data -> own_composite_cboxes) ); - } - } - - hypre_TFree(owninfo_data, HYPRE_MEMORY_HOST); - - return ierr; -} - diff --git a/src/sstruct_ls/sstruct_owninfo.h b/src/sstruct_ls/sstruct_owninfo.h deleted file mode 100644 index 34ccad8748..0000000000 --- a/src/sstruct_ls/sstruct_owninfo.h +++ /dev/null @@ -1,44 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_SStructOwnInfo data structure - * This structure is for the coarsen fboxes that are on this processor, - * and the cboxes of cgrid/(all coarsened fboxes) on this processor (i.e., - * the coarse boxes of the composite cgrid (no underlying) on this processor). - *--------------------------------------------------------------------------*/ -#ifndef hypre_OWNINFODATA_HEADER -#define hypre_OWNINFODATA_HEADER - - -typedef struct -{ - HYPRE_Int size; - - hypre_BoxArrayArray *own_boxes; /* size of fgrid */ - HYPRE_Int **own_cboxnums; /* local cbox number- each fbox - leads to an array of cboxes */ - - hypre_BoxArrayArray *own_composite_cboxes; /* size of cgrid */ - HYPRE_Int own_composite_size; -} hypre_SStructOwnInfoData; - - -/*-------------------------------------------------------------------------- - * Accessor macros: hypre_SStructOwnInfoData; - *--------------------------------------------------------------------------*/ - -#define hypre_SStructOwnInfoDataSize(own_data) ((own_data) -> size) -#define hypre_SStructOwnInfoDataOwnBoxes(own_data) ((own_data) -> own_boxes) -#define hypre_SStructOwnInfoDataOwnBoxNums(own_data) \ -((own_data) -> own_cboxnums) -#define hypre_SStructOwnInfoDataCompositeCBoxes(own_data) \ -((own_data) -> own_composite_cboxes) -#define hypre_SStructOwnInfoDataCompositeSize(own_data) \ -((own_data) -> own_composite_size) - -#endif diff --git a/src/sstruct_ls/sstruct_recvinfo.c b/src/sstruct_ls/sstruct_recvinfo.c deleted file mode 100644 index accb99ccef..0000000000 --- a/src/sstruct_ls/sstruct_recvinfo.c +++ /dev/null @@ -1,156 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_sstruct_ls.h" - -/*-------------------------------------------------------------------------- - * hypre_SStructRecvInfo: For each processor, for each cbox of its cgrid, - * refine it and find out which processors owe this cbox. Coarsen these - * fine recv boxes and store them. - *--------------------------------------------------------------------------*/ - -hypre_SStructRecvInfoData * -hypre_SStructRecvInfo( hypre_StructGrid *cgrid, - hypre_BoxManager *fboxman, - hypre_Index rfactor ) -{ - hypre_SStructRecvInfoData *recvinfo_data; - - MPI_Comm comm = hypre_StructGridComm(cgrid); - HYPRE_Int ndim = hypre_StructGridNDim(cgrid); - - hypre_BoxArray *grid_boxes; - hypre_Box *grid_box, fbox; - hypre_Box *intersect_box, boxman_entry_box; - - hypre_BoxManEntry **boxman_entries; - HYPRE_Int nboxman_entries; - - hypre_BoxArrayArray *recv_boxes; - HYPRE_Int **recv_processes; - - hypre_Index ilower, iupper, index1, index2; - - HYPRE_Int myproc, proc; - - HYPRE_Int cnt; - HYPRE_Int i, j; - - 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_MPI_Comm_rank(comm, &myproc); - - recvinfo_data = hypre_CTAlloc(hypre_SStructRecvInfoData, 1, HYPRE_MEMORY_HOST); - - /*------------------------------------------------------------------------ - * 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 - * get the exact receiving box extents, we need to take an intersection. - * Since only coarse data is communicated, these intersection boxes - * must be coarsened. - *------------------------------------------------------------------------*/ - 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); - - hypre_ForBoxI(i, grid_boxes) - { - 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_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++; - } - } - hypre_TFree(boxman_entries, HYPRE_MEMORY_HOST); - } /* 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; - - return recvinfo_data; -} - -/*-------------------------------------------------------------------------- - * hypre_SStructRecvInfoDataDestroy - *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_SStructRecvInfoDataDestroy(hypre_SStructRecvInfoData *recvinfo_data) -{ - HYPRE_Int ierr = 0; - HYPRE_Int i; - - if (recvinfo_data) - { - if (recvinfo_data -> recv_boxes) - { - hypre_BoxArrayArrayDestroy( (recvinfo_data -> recv_boxes) ); - } - - 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, HYPRE_MEMORY_HOST); - } - - hypre_TFree(recvinfo_data, HYPRE_MEMORY_HOST); - - return ierr; -} - diff --git a/src/sstruct_ls/sstruct_recvinfo.h b/src/sstruct_ls/sstruct_recvinfo.h deleted file mode 100644 index e28f96bf9c..0000000000 --- a/src/sstruct_ls/sstruct_recvinfo.h +++ /dev/null @@ -1,24 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_SStructRecvInfo data structure - *--------------------------------------------------------------------------*/ -#ifndef hypre_RECVINFODATA_HEADER -#define hypre_RECVINFODATA_HEADER - - -typedef struct -{ - HYPRE_Int size; - - hypre_BoxArrayArray *recv_boxes; - HYPRE_Int **recv_procs; - -} hypre_SStructRecvInfoData; - -#endif diff --git a/src/sstruct_ls/sstruct_sendinfo.c b/src/sstruct_ls/sstruct_sendinfo.c deleted file mode 100644 index 32fee3668e..0000000000 --- a/src/sstruct_ls/sstruct_sendinfo.c +++ /dev/null @@ -1,168 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_sstruct_ls.h" - -/*-------------------------------------------------------------------------- - * 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, - * and the remote boxnums of these sendboxes. - *--------------------------------------------------------------------------*/ - -hypre_SStructSendInfoData * -hypre_SStructSendInfo( hypre_StructGrid *fgrid, - hypre_BoxManager *cboxman, - hypre_Index rfactor ) -{ - hypre_SStructSendInfoData *sendinfo_data; - - MPI_Comm comm = hypre_StructGridComm(fgrid); - HYPRE_Int ndim = hypre_StructGridNDim(fgrid); - - hypre_BoxArray *grid_boxes; - hypre_Box *grid_box, cbox; - hypre_Box *intersect_box, boxman_entry_box; - - hypre_BoxManEntry **boxman_entries; - HYPRE_Int nboxman_entries; - - hypre_BoxArrayArray *send_boxes; - HYPRE_Int **send_processes; - HYPRE_Int **send_remote_boxnums; - - hypre_Index ilower, iupper, index; - - HYPRE_Int myproc, proc; - - HYPRE_Int cnt; - HYPRE_Int i, j; - - hypre_BoxInit(&cbox, ndim); - hypre_BoxInit(&boxman_entry_box, ndim); - - hypre_ClearIndex(index); - hypre_MPI_Comm_rank(comm, &myproc); - - sendinfo_data = hypre_CTAlloc(hypre_SStructSendInfoData, 1, HYPRE_MEMORY_HOST); - - /*------------------------------------------------------------------------ - * 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 - * will give boxes that we will need to send data to- i.e., we scan - * through the boxes of grid and find the processors that own a chunk - * of it. - *------------------------------------------------------------------------*/ - 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); - - 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), - &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++; - } - } - hypre_TFree(boxman_entries, HYPRE_MEMORY_HOST); - } /* 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; - - return sendinfo_data; -} - -/*-------------------------------------------------------------------------- - * hypre_SStructSendInfoDataDestroy - *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_SStructSendInfoDataDestroy(hypre_SStructSendInfoData *sendinfo_data) -{ - HYPRE_Int ierr = 0; - HYPRE_Int i; - - if (sendinfo_data) - { - if (sendinfo_data -> send_boxes) - { - hypre_BoxArrayArrayDestroy( (sendinfo_data -> send_boxes) ); - } - - for (i = 0; i < (sendinfo_data -> size); i++) - { - if (sendinfo_data -> send_procs[i]) - { - 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_procs, HYPRE_MEMORY_HOST); - hypre_TFree(sendinfo_data -> send_remote_boxnums, HYPRE_MEMORY_HOST); - } - - hypre_TFree(sendinfo_data, HYPRE_MEMORY_HOST); - - return ierr; -} - diff --git a/src/sstruct_ls/sstruct_sendinfo.h b/src/sstruct_ls/sstruct_sendinfo.h deleted file mode 100644 index 402895850a..0000000000 --- a/src/sstruct_ls/sstruct_sendinfo.h +++ /dev/null @@ -1,25 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_SStructSendInfo data structure - *--------------------------------------------------------------------------*/ -#ifndef hypre_SENDINFODATA_HEADER -#define hypre_SENDINFODATA_HEADER - - -typedef struct -{ - HYPRE_Int size; - - hypre_BoxArrayArray *send_boxes; - HYPRE_Int **send_procs; - HYPRE_Int **send_remote_boxnums; - -} hypre_SStructSendInfoData; - -#endif diff --git a/src/sstruct_ls/sstruct_sharedDOFComm.c b/src/sstruct_ls/sstruct_sharedDOFComm.c deleted file mode 100644 index 35b2978c31..0000000000 --- a/src/sstruct_ls/sstruct_sharedDOFComm.c +++ /dev/null @@ -1,898 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other - * HYPRE Project Developers. See the top-level COPYRIGHT file for details. - * - * SPDX-License-Identifier: (Apache-2.0 OR MIT) - ******************************************************************************/ - -/****************************************************************************** - * OpenMP Problems - * - * Need to fix the way these variables are set and incremented in loops: - * tot_nsendRowsNcols, send_ColsData_alloc, tot_sendColsData - * - ******************************************************************************/ - -#include "_hypre_sstruct_ls.h" - -/*-------------------------------------------------------------------------- - * hypre_MaxwellOffProcRowCreate - *--------------------------------------------------------------------------*/ -hypre_MaxwellOffProcRow * -hypre_MaxwellOffProcRowCreate(HYPRE_Int ncols) -{ - hypre_MaxwellOffProcRow *OffProcRow; - HYPRE_BigInt *cols; - HYPRE_Real *data; - - 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); - - (OffProcRow -> cols) = cols; - (OffProcRow -> data) = data; - - return OffProcRow; -} - -/*-------------------------------------------------------------------------- - * hypre_MaxwellOffProcRowDestroy - *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_MaxwellOffProcRowDestroy(void *OffProcRow_vdata) -{ - hypre_MaxwellOffProcRow *OffProcRow = (hypre_MaxwellOffProcRow *)OffProcRow_vdata; - HYPRE_Int ierr = 0; - - if (OffProcRow) - { - hypre_TFree(OffProcRow -> cols, HYPRE_MEMORY_HOST); - hypre_TFree(OffProcRow -> data, HYPRE_MEMORY_HOST); - } - hypre_TFree(OffProcRow, HYPRE_MEMORY_HOST); - - return ierr; -} - -/*-------------------------------------------------------------------------- - * 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 - * boundaries but internally are stored on one processor. - * Algo: - * for each cellbox - * RECVs: - * i) stretch the cellbox to the variable box - * ii) in the appropriate (dof-dependent) direction, take the - * boundary and boxman_intersect to extract boxmanentries - * that contain these boundary edges. - * iii)loop over the boxmanentries and see if they belong - * on this proc or another proc - * 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) - * ii) boxman_intersect with the cellgrid boxman - * iii)loop over the boxmanentries and see if they belong - * on this proc or another proc - * a) if belong on another proc, these are the sends: - * count and prepare the communication buffers and - * 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 - * (the same dof is on the boundary of several cells). - *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_SStructSharedDOF_ParcsrMatRowsComm( hypre_SStructGrid *grid, - hypre_ParCSRMatrix *A, - HYPRE_Int *num_offprocrows_ptr, - hypre_MaxwellOffProcRow ***OffProcRows_ptr) -{ - MPI_Comm A_comm = hypre_ParCSRMatrixComm(A); - MPI_Comm grid_comm = hypre_SStructGridComm(grid); - - HYPRE_Int matrix_type = HYPRE_PARCSR; - - HYPRE_Int nparts = hypre_SStructGridNParts(grid); - HYPRE_Int ndim = hypre_SStructGridNDim(grid); - - hypre_SStructGrid *cell_ssgrid; - - hypre_SStructPGrid *pgrid; - hypre_StructGrid *cellgrid; - hypre_BoxArray *cellboxes; - hypre_Box *box, *cellbox, vbox, boxman_entry_box; - - hypre_Index loop_size, start, lindex; - 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 = 0; - hypre_BoxArray *recv_slabs = NULL, *send_slabs = NULL; - hypre_Index varoffset; - - hypre_BoxManager **boxmans, *cell_boxman; - hypre_BoxManEntry **boxman_entries, *entry; - HYPRE_Int nboxman_entries; - - hypre_Index ilower, iupper, index; - - 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_ColsData_alloc; - HYPRE_Int *tot_nsendRowsNcols, *tot_sendColsData; - HYPRE_Real **vals; /* buffer for cols & data */ - - HYPRE_BigInt *col_inds; - HYPRE_Real *values; - - hypre_MPI_Request *requests; - hypre_MPI_Status *status; - HYPRE_Int **rbuffer_RowsNcols; - HYPRE_Real **rbuffer_ColsData; - HYPRE_Int num_sends, num_recvs; - - hypre_MaxwellOffProcRow **OffProcRows; - HYPRE_Int *starts; - - 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); - 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; - - for (i = 0; i < nparts; i++) - { - pgrid = hypre_SStructGridPGrid(grid, i); - cellgrid = hypre_SStructPGridCellSGrid(pgrid); - - cellboxes = hypre_StructGridBoxes(cellgrid); - hypre_ForBoxI(j, cellboxes) - { - box = hypre_BoxArrayBox(cellboxes, j); - HYPRE_SStructGridSetExtents(cell_ssgrid, i, - hypre_BoxIMin(box), hypre_BoxIMax(box)); - } - HYPRE_SStructGridSetVariables(cell_ssgrid, i, 1, vartypes); - } - 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); - 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++) - { - 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; - } - - for (part = 0; part < nparts; part++) - { - pgrid = hypre_SStructGridPGrid(grid, part); - nvars = hypre_SStructPGridNVars(pgrid); - vartypes = hypre_SStructPGridVarTypes(pgrid); - - cellgrid = hypre_SStructPGridCellSGrid(pgrid); - cellboxes = hypre_StructGridBoxes(cellgrid); - - boxmans = hypre_TAlloc(hypre_BoxManager *, nvars, HYPRE_MEMORY_HOST); - for (t = 0; t < nvars; t++) - { - boxmans[t] = hypre_SStructGridBoxManager(grid, part, t); - } - cell_boxman = hypre_SStructGridBoxManager(cell_ssgrid, part, 0); - - hypre_ForBoxI(j, cellboxes) - { - cellbox = hypre_BoxArrayBox(cellboxes, j); - - for (t = 0; t < nvars; t++) - { - var = vartypes[t]; - hypre_SStructVariableGetOffset((hypre_SStructVariable) var, - ndim, varoffset); - - /* form the variable cellbox */ - hypre_CopyBox(cellbox, &vbox); - hypre_SubtractIndexes(hypre_BoxIMin(&vbox), varoffset, 3, - hypre_BoxIMin(&vbox)); - - /* boundary layer box depends on variable type */ - switch (var) - { - case 1: /* node based */ - { - nbdry_slabs = 6; - recv_slabs = hypre_BoxArrayCreate(nbdry_slabs, ndim); - - /* slab in the +/- i,j,k directions */ - box = hypre_BoxArrayBox(recv_slabs, 0); - hypre_CopyBox(&vbox, box); - hypre_BoxIMin(box)[0] = hypre_BoxIMax(box)[0]; - - box = hypre_BoxArrayBox(recv_slabs, 1); - hypre_CopyBox(&vbox, box); - 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); - hypre_CopyBox(&vbox, box); - hypre_BoxIMin(box)[1] = hypre_BoxIMax(box)[1]; - - hypre_BoxIMin(box)[0]++; /* contract */ - hypre_BoxIMax(box)[0]--; /* contract */ - - box = hypre_BoxArrayBox(recv_slabs, 3); - hypre_CopyBox(&vbox, box); - 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); - hypre_CopyBox(&vbox, box); - 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); - hypre_CopyBox(&vbox, box); - hypre_BoxIMax(box)[2] = hypre_BoxIMin(box)[2]; - - hypre_BoxIMin(box)[0]++; /* contract */ - hypre_BoxIMax(box)[0]--; /* contract */ - 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); - - box = hypre_BoxArrayBox(send_slabs, 0); - hypre_CopyBox(cellbox, box); - 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_BoxIMax(box)[1]++; /* stretch one layer +/- j*/ - hypre_BoxIMin(box)[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)[2]++; /* stretch one layer +/- k*/ - hypre_BoxIMin(box)[2]--; - - hypre_BoxIMax(box)[1]++; /* stretch one layer +/- j*/ - hypre_BoxIMin(box)[1]--; - - - box = hypre_BoxArrayBox(send_slabs, 2); - hypre_CopyBox(cellbox, box); - 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); - hypre_CopyBox(cellbox, box); - 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); - hypre_CopyBox(cellbox, box); - hypre_BoxIMax(box)[2]++; - hypre_BoxIMin(box)[2] = hypre_BoxIMax(box)[2]; - - - box = hypre_BoxArrayBox(send_slabs, 5); - hypre_CopyBox(cellbox, box); - 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); - - /* slab in the +/- i direction */ - box = hypre_BoxArrayBox(recv_slabs, 0); - hypre_CopyBox(&vbox, box); - hypre_BoxIMin(box)[0] = hypre_BoxIMax(box)[0]; - - box = hypre_BoxArrayBox(recv_slabs, 1); - hypre_CopyBox(&vbox, box); - 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); - hypre_CopyBox(cellbox, box); - hypre_BoxIMax(box)[0]++; - hypre_BoxIMin(box)[0] = hypre_BoxIMax(box)[0]; - - box = hypre_BoxArrayBox(send_slabs, 1); - hypre_CopyBox(cellbox, box); - 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); - - /* slab in the +/- j direction */ - box = hypre_BoxArrayBox(recv_slabs, 0); - hypre_CopyBox(&vbox, box); - hypre_BoxIMin(box)[1] = hypre_BoxIMax(box)[1]; - - box = hypre_BoxArrayBox(recv_slabs, 1); - hypre_CopyBox(&vbox, box); - 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); - - box = hypre_BoxArrayBox(send_slabs, 0); - hypre_CopyBox(cellbox, box); - hypre_BoxIMax(box)[1]++; - hypre_BoxIMin(box)[1] = hypre_BoxIMax(box)[1]; - - box = hypre_BoxArrayBox(send_slabs, 1); - hypre_CopyBox(cellbox, box); - 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); - - /* slab in the +/- k direction */ - box = hypre_BoxArrayBox(recv_slabs, 0); - hypre_CopyBox(&vbox, box); - hypre_BoxIMin(box)[2] = hypre_BoxIMax(box)[2]; - - box = hypre_BoxArrayBox(recv_slabs, 1); - hypre_CopyBox(&vbox, box); - 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); - - box = hypre_BoxArrayBox(send_slabs, 0); - hypre_CopyBox(cellbox, box); - hypre_BoxIMax(box)[2]++; - hypre_BoxIMin(box)[2] = hypre_BoxIMax(box)[2]; - - box = hypre_BoxArrayBox(send_slabs, 1); - hypre_CopyBox(cellbox, box); - 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); - - /* slab in the +/- j & k direction */ - box = hypre_BoxArrayBox(recv_slabs, 0); - hypre_CopyBox(&vbox, box); - hypre_BoxIMin(box)[1] = hypre_BoxIMax(box)[1]; - - box = hypre_BoxArrayBox(recv_slabs, 1); - hypre_CopyBox(&vbox, box); - 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); - hypre_CopyBox(&vbox, box); - hypre_BoxIMin(box)[2] = hypre_BoxIMax(box)[2]; - - hypre_BoxIMin(box)[1]++; /* contract */ - hypre_BoxIMax(box)[1]--; /* contract */ - - box = hypre_BoxArrayBox(recv_slabs, 3); - hypre_CopyBox(&vbox, box); - 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); - - box = hypre_BoxArrayBox(send_slabs, 0); - hypre_CopyBox(cellbox, box); - 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, 1); - hypre_CopyBox(cellbox, box); - 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); - hypre_CopyBox(cellbox, box); - hypre_BoxIMax(box)[2]++; - hypre_BoxIMin(box)[2] = hypre_BoxIMax(box)[2]; - - box = hypre_BoxArrayBox(send_slabs, 3); - hypre_CopyBox(cellbox, box); - 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); - - /* slab in the +/- i & k direction */ - box = hypre_BoxArrayBox(recv_slabs, 0); - hypre_CopyBox(&vbox, box); - hypre_BoxIMin(box)[0] = hypre_BoxIMax(box)[0]; - - box = hypre_BoxArrayBox(recv_slabs, 1); - hypre_CopyBox(&vbox, box); - 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); - hypre_CopyBox(&vbox, box); - hypre_BoxIMin(box)[2] = hypre_BoxIMax(box)[2]; - - hypre_BoxIMin(box)[0]++; /* contract */ - hypre_BoxIMax(box)[0]--; /* contract */ - - box = hypre_BoxArrayBox(recv_slabs, 3); - hypre_CopyBox(&vbox, box); - 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); - - box = hypre_BoxArrayBox(send_slabs, 0); - hypre_CopyBox(cellbox, box); - hypre_BoxIMax(box)[0]++; - hypre_BoxIMin(box)[0] = hypre_BoxIMax(box)[0]; - - hypre_BoxIMax(box)[2]++; /* stretch one layer +/- k*/ - hypre_BoxIMin(box)[2]--; - - 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)[2]++; /* stretch one layer +/- k*/ - hypre_BoxIMin(box)[2]--; - - box = hypre_BoxArrayBox(send_slabs, 2); - hypre_CopyBox(cellbox, box); - hypre_BoxIMax(box)[2]++; - hypre_BoxIMin(box)[2] = hypre_BoxIMax(box)[2]; - - box = hypre_BoxArrayBox(send_slabs, 3); - hypre_CopyBox(cellbox, box); - 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); - - /* slab in the +/- i & j direction */ - box = hypre_BoxArrayBox(recv_slabs, 0); - hypre_CopyBox(&vbox, box); - hypre_BoxIMin(box)[0] = hypre_BoxIMax(box)[0]; - - box = hypre_BoxArrayBox(recv_slabs, 1); - hypre_CopyBox(&vbox, box); - 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); - hypre_CopyBox(&vbox, box); - hypre_BoxIMin(box)[1] = hypre_BoxIMax(box)[1]; - - hypre_BoxIMin(box)[0]++; /* contract */ - hypre_BoxIMax(box)[0]--; /* contract */ - - box = hypre_BoxArrayBox(recv_slabs, 3); - hypre_CopyBox(&vbox, box); - 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); - - box = hypre_BoxArrayBox(send_slabs, 0); - hypre_CopyBox(cellbox, box); - hypre_BoxIMax(box)[1]++; - hypre_BoxIMin(box)[1] = hypre_BoxIMax(box)[1]; - - hypre_BoxIMax(box)[0]++; /* stretch one layer +/- i*/ - hypre_BoxIMin(box)[0]--; - - 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)[0]++; /* stretch one layer +/- i*/ - hypre_BoxIMin(box)[0]--; - - box = hypre_BoxArrayBox(send_slabs, 2); - hypre_CopyBox(cellbox, box); - hypre_BoxIMax(box)[0]++; - hypre_BoxIMin(box)[0] = hypre_BoxIMax(box)[0]; - - box = hypre_BoxArrayBox(send_slabs, 3); - hypre_CopyBox(cellbox, box); - hypre_BoxIMin(box)[0]--; - hypre_BoxIMax(box)[0] = hypre_BoxIMin(box)[0]; - - break; - } - - } /* switch(var) */ - - /* determine no. of recv rows */ - for (i = 0; i < nbdry_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++) - { - hypre_SStructBoxManEntryGetProcess(boxman_entries[m], &proc); - if (proc != myproc) - { - hypre_BoxManEntryGetExtents(boxman_entries[m], ilower, iupper); - hypre_BoxSetExtents(&boxman_entry_box, ilower, iupper); - hypre_IntersectBoxes(&boxman_entry_box, box, &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); - hypre_BoxManIntersect(cell_boxman, hypre_BoxIMin(box), hypre_BoxIMax(box), - &boxman_entries, &nboxman_entries); - - for (m = 0; m < nboxman_entries; m++) - { - hypre_SStructBoxManEntryGetProcess(boxman_entries[m], &proc); - if (proc != myproc) - { - hypre_BoxManEntryGetExtents(boxman_entries[m], ilower, iupper); - 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 - the correct var box - extend to var_box and then intersect - with vbox */ - hypre_SubtractIndexes(hypre_BoxIMin(&boxman_entry_box), - varoffset, 3, - hypre_BoxIMin(&boxman_entry_box)); - hypre_IntersectBoxes(&boxman_entry_box, &vbox, &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], HYPRE_MEMORY_HOST); - } - - hypre_BoxGetSize(&boxman_entry_box, loop_size); - hypre_CopyIndex(hypre_BoxIMin(&boxman_entry_box), start); - - hypre_SerialBoxLoop0Begin(ndim, loop_size); - { - zypre_BoxLoopGetIndex(lindex); - hypre_SetIndex3(index, lindex[0], lindex[1], lindex[2]); - hypre_AddIndexes(index, start, 3, index); - - hypre_SStructGridFindBoxManEntry(grid, part, index, t, - &entry); - if (entry) - { - hypre_SStructBoxManEntryGetGlobalRank(entry, index, - &rank, matrix_type); - - /* index may still be off myproc because vbox was formed - by expanding the cellbox to the variable box without - checking (difficult) the whole expanded box is on myproc */ - if (rank <= end_rank && rank >= start_rank) - { - send_RowsNcols[proc][tot_nsendRowsNcols[proc]] = rank; - tot_nsendRowsNcols[proc]++; - - HYPRE_ParCSRMatrixGetRow((HYPRE_ParCSRMatrix) A, rank, &n, - &col_inds, &values); - 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] ) - { - 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++) - { - vals[proc][tot_sendColsData[proc]] = (HYPRE_Real) col_inds[k]; - tot_sendColsData[proc]++; - vals[proc][tot_sendColsData[proc]] = values[k]; - tot_sendColsData[proc]++; - } - HYPRE_ParCSRMatrixRestoreRow((HYPRE_ParCSRMatrix) A, rank, &n, - &col_inds, &values); - } /* if (rank <= end_rank && rank >= start_rank) */ - } /* if (entry) */ - } - hypre_SerialBoxLoop0End(); - - } /* if (proc != myproc) */ - } /* for (m= 0; m< nboxman_entries; m++) */ - hypre_TFree(boxman_entries, HYPRE_MEMORY_HOST); - - } /* for (i= 0; i< nbdry_slabs; i++) */ - hypre_BoxArrayDestroy(send_slabs); - hypre_BoxArrayDestroy(recv_slabs); - - } /* for (t= 0; t< nvars; t++) */ - } /* hypre_ForBoxI(j, cellboxes) */ - hypre_TFree(boxmans, HYPRE_MEMORY_HOST); - } /* for (part= 0; part< nparts; part++) */ - - 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++) - { - starts[i + 1] = starts[i] + RecvFromProcs[i]; - if (RecvFromProcs[i]) - { - num_recvs++; - k += RecvFromProcs[i]; - } - - if (tot_sendColsData[i]) - { - num_sends++; - } - } - 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); - - /* send row size data */ - 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++) - { - 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, - proc, 0, grid_comm, &requests[j++]); - } /* if (RecvFromProcs[proc]) */ - - } /* for (proc= 0; proc< nprocs; proc++) */ - - for (proc = 0; proc < nprocs; proc++) - { - if (tot_nsendRowsNcols[proc]) - { - hypre_MPI_Isend(send_RowsNcols[proc], tot_nsendRowsNcols[proc], HYPRE_MPI_INT, proc, - 0, grid_comm, &requests[j++]); - } - } - - hypre_MPI_Waitall(j, requests, status); - - /* unpack data */ - for (proc = 0; proc < nprocs; proc++) - { - send_RowsNcols_alloc[proc] = 0; - if (RecvFromProcs[proc]) - { - 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]; - - 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); - hypre_TFree(rbuffer_RowsNcols[proc], HYPRE_MEMORY_HOST); - } - } - - hypre_TFree(rbuffer_RowsNcols, HYPRE_MEMORY_HOST); - 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); - - /* send row data */ - 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, - proc, 1, grid_comm, &requests[j++]); - } /* if (RecvFromProcs[proc]) */ - } /* for (proc= 0; proc< nprocs; proc++) */ - - for (proc = 0; proc < nprocs; proc++) - { - if (tot_sendColsData[proc]) - { - hypre_MPI_Isend(vals[proc], tot_sendColsData[proc], HYPRE_MPI_REAL, proc, - 1, grid_comm, &requests[j++]); - } - } - - hypre_MPI_Waitall(j, requests, status); - - /* unpack data */ - for (proc = 0; proc < nprocs; proc++) - { - if (RecvFromProcs[proc]) - { - 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); - - for (t = 0; t < m; t++) - { - col_inds[t] = (HYPRE_Int) rbuffer_ColsData[proc][k++]; - values[t] = rbuffer_ColsData[proc][k++]; - } - } - hypre_TFree(rbuffer_ColsData[proc], HYPRE_MEMORY_HOST); - } /* if (RecvFromProcs[proc]) */ - - } /* for (proc= 0; proc< nprocs; proc++) */ - hypre_TFree(rbuffer_ColsData, HYPRE_MEMORY_HOST); - - hypre_TFree(requests, HYPRE_MEMORY_HOST); - hypre_TFree(status, HYPRE_MEMORY_HOST); - for (proc = 0; proc < nprocs; proc++) - { - hypre_TFree(send_RowsNcols[proc], HYPRE_MEMORY_HOST); - hypre_TFree(vals[proc], HYPRE_MEMORY_HOST); - } - hypre_TFree(send_RowsNcols, HYPRE_MEMORY_HOST); - hypre_TFree(vals, HYPRE_MEMORY_HOST); - hypre_TFree(tot_sendColsData, HYPRE_MEMORY_HOST); - hypre_TFree(tot_nsendRowsNcols, HYPRE_MEMORY_HOST); - hypre_TFree(send_ColsData_alloc, HYPRE_MEMORY_HOST); - hypre_TFree(send_RowsNcols_alloc, HYPRE_MEMORY_HOST); - hypre_TFree(SendToProcs, HYPRE_MEMORY_HOST); - hypre_TFree(RecvFromProcs, HYPRE_MEMORY_HOST); - hypre_TFree(starts, HYPRE_MEMORY_HOST); - - *OffProcRows_ptr = OffProcRows; - - return ierr; -} diff --git a/src/sstruct_ls/sys_pfmg.c b/src/sstruct_ls/sys_pfmg.c index 262ae49364..20cad39995 100644 --- a/src/sstruct_ls/sys_pfmg.c +++ b/src/sstruct_ls/sys_pfmg.c @@ -16,7 +16,7 @@ hypre_SysPFMGCreate( MPI_Comm comm ) { hypre_SysPFMGData *sys_pfmg_data; - sys_pfmg_data = hypre_CTAlloc(hypre_SysPFMGData, 1, HYPRE_MEMORY_HOST); + sys_pfmg_data = hypre_CTAlloc(hypre_SysPFMGData, 1, HYPRE_MEMORY_HOST); (sys_pfmg_data -> comm) = comm; (sys_pfmg_data -> time_index) = hypre_InitializeTiming("SYS_PFMG"); @@ -38,6 +38,7 @@ hypre_SysPFMGCreate( MPI_Comm comm ) (sys_pfmg_data -> skip_relax) = 1; (sys_pfmg_data -> logging) = 0; (sys_pfmg_data -> print_level) = 0; + (sys_pfmg_data -> print_freq) = 1; /* initialize */ (sys_pfmg_data -> num_levels) = -1; @@ -67,13 +68,16 @@ hypre_SysPFMGDestroy( void *sys_pfmg_vdata ) { for (l = 0; l < (sys_pfmg_data -> num_levels); l++) { - hypre_SysPFMGRelaxDestroy(sys_pfmg_data -> relax_data_l[l]); + if (sys_pfmg_data -> active_l[l]) + { + hypre_SysPFMGRelaxDestroy(sys_pfmg_data -> relax_data_l[l]); + } hypre_SStructPMatvecDestroy(sys_pfmg_data -> matvec_data_l[l]); } for (l = 0; l < ((sys_pfmg_data -> num_levels) - 1); l++) { - hypre_SysSemiRestrictDestroy(sys_pfmg_data -> restrict_data_l[l]); - hypre_SysSemiInterpDestroy(sys_pfmg_data -> interp_data_l[l]); + hypre_SStructPMatvecDestroy(sys_pfmg_data -> restrict_data_l[l]); + hypre_SStructPMatvecDestroy(sys_pfmg_data -> interp_data_l[l]); } hypre_TFree(sys_pfmg_data -> relax_data_l, HYPRE_MEMORY_HOST); hypre_TFree(sys_pfmg_data -> matvec_data_l, HYPRE_MEMORY_HOST); @@ -81,14 +85,13 @@ hypre_SysPFMGDestroy( void *sys_pfmg_vdata ) 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_SStructPGridDestroy(sys_pfmg_data -> grid_l[0]); hypre_SStructPMatrixDestroy(sys_pfmg_data -> A_l[0]); hypre_SStructPVectorDestroy(sys_pfmg_data -> b_l[0]); 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_SStructPMatrixDestroy(sys_pfmg_data -> P_l[l]); hypre_SStructPVectorDestroy(sys_pfmg_data -> b_l[l + 1]); @@ -99,7 +102,6 @@ hypre_SysPFMGDestroy( void *sys_pfmg_vdata ) 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); - hypre_TFree(sys_pfmg_data -> P_grid_l, HYPRE_MEMORY_HOST); hypre_TFree(sys_pfmg_data -> A_l, HYPRE_MEMORY_HOST); hypre_TFree(sys_pfmg_data -> P_l, HYPRE_MEMORY_HOST); hypre_TFree(sys_pfmg_data -> RT_l, HYPRE_MEMORY_HOST); @@ -119,8 +121,8 @@ hypre_SysPFMGDestroy( void *sys_pfmg_vdata ) *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_SysPFMGSetTol( void *sys_pfmg_vdata, - HYPRE_Real tol ) +hypre_SysPFMGSetTol( void *sys_pfmg_vdata, + HYPRE_Real tol ) { hypre_SysPFMGData *sys_pfmg_data = (hypre_SysPFMGData *)sys_pfmg_vdata; @@ -133,8 +135,8 @@ hypre_SysPFMGSetTol( void *sys_pfmg_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_SysPFMGSetMaxIter( void *sys_pfmg_vdata, - HYPRE_Int max_iter ) +hypre_SysPFMGSetMaxIter( void *sys_pfmg_vdata, + HYPRE_Int max_iter ) { hypre_SysPFMGData *sys_pfmg_data = (hypre_SysPFMGData *)sys_pfmg_vdata; @@ -147,8 +149,8 @@ hypre_SysPFMGSetMaxIter( void *sys_pfmg_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_SysPFMGSetRelChange( void *sys_pfmg_vdata, - HYPRE_Int rel_change ) +hypre_SysPFMGSetRelChange( void *sys_pfmg_vdata, + HYPRE_Int rel_change ) { hypre_SysPFMGData *sys_pfmg_data = (hypre_SysPFMGData *)sys_pfmg_vdata; @@ -161,8 +163,8 @@ hypre_SysPFMGSetRelChange( void *sys_pfmg_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_SysPFMGSetZeroGuess( void *sys_pfmg_vdata, - HYPRE_Int zero_guess ) +hypre_SysPFMGSetZeroGuess( void *sys_pfmg_vdata, + HYPRE_Int zero_guess ) { hypre_SysPFMGData *sys_pfmg_data = (hypre_SysPFMGData *)sys_pfmg_vdata; @@ -175,8 +177,8 @@ hypre_SysPFMGSetZeroGuess( void *sys_pfmg_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_SysPFMGSetRelaxType( void *sys_pfmg_vdata, - HYPRE_Int relax_type ) +hypre_SysPFMGSetRelaxType( void *sys_pfmg_vdata, + HYPRE_Int relax_type ) { hypre_SysPFMGData *sys_pfmg_data = (hypre_SysPFMGData *)sys_pfmg_vdata; @@ -188,8 +190,8 @@ hypre_SysPFMGSetRelaxType( void *sys_pfmg_vdata, /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_SysPFMGSetJacobiWeight( void *sys_pfmg_vdata, - HYPRE_Real weight ) +hypre_SysPFMGSetJacobiWeight( void *sys_pfmg_vdata, + HYPRE_Real weight ) { hypre_SysPFMGData *sys_pfmg_data = (hypre_SysPFMGData *)sys_pfmg_vdata; @@ -203,8 +205,8 @@ hypre_SysPFMGSetJacobiWeight( void *sys_pfmg_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_SysPFMGSetNumPreRelax( void *sys_pfmg_vdata, - HYPRE_Int num_pre_relax ) +hypre_SysPFMGSetNumPreRelax( void *sys_pfmg_vdata, + HYPRE_Int num_pre_relax ) { hypre_SysPFMGData *sys_pfmg_data = (hypre_SysPFMGData *)sys_pfmg_vdata; @@ -217,8 +219,8 @@ hypre_SysPFMGSetNumPreRelax( void *sys_pfmg_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_SysPFMGSetNumPostRelax( void *sys_pfmg_vdata, - HYPRE_Int num_post_relax ) +hypre_SysPFMGSetNumPostRelax( void *sys_pfmg_vdata, + HYPRE_Int num_post_relax ) { hypre_SysPFMGData *sys_pfmg_data = (hypre_SysPFMGData *)sys_pfmg_vdata; @@ -231,7 +233,7 @@ hypre_SysPFMGSetNumPostRelax( void *sys_pfmg_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_SysPFMGSetSkipRelax( void *sys_pfmg_vdata, +hypre_SysPFMGSetSkipRelax( void *sys_pfmg_vdata, HYPRE_Int skip_relax ) { hypre_SysPFMGData *sys_pfmg_data = (hypre_SysPFMGData *)sys_pfmg_vdata; @@ -245,8 +247,8 @@ hypre_SysPFMGSetSkipRelax( void *sys_pfmg_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_SysPFMGSetDxyz( void *sys_pfmg_vdata, - HYPRE_Real *dxyz ) +hypre_SysPFMGSetDxyz( void *sys_pfmg_vdata, + HYPRE_Real *dxyz ) { hypre_SysPFMGData *sys_pfmg_data = (hypre_SysPFMGData *)sys_pfmg_vdata; @@ -261,8 +263,8 @@ hypre_SysPFMGSetDxyz( void *sys_pfmg_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_SysPFMGSetLogging( void *sys_pfmg_vdata, - HYPRE_Int logging) +hypre_SysPFMGSetLogging( void *sys_pfmg_vdata, + HYPRE_Int logging ) { hypre_SysPFMGData *sys_pfmg_data = (hypre_SysPFMGData *)sys_pfmg_vdata; @@ -275,8 +277,8 @@ hypre_SysPFMGSetLogging( void *sys_pfmg_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_SysPFMGSetPrintLevel( void *sys_pfmg_vdata, - HYPRE_Int print_level) +hypre_SysPFMGSetPrintLevel( void *sys_pfmg_vdata, + HYPRE_Int print_level ) { hypre_SysPFMGData *sys_pfmg_data = (hypre_SysPFMGData *)sys_pfmg_vdata; @@ -289,12 +291,12 @@ hypre_SysPFMGSetPrintLevel( void *sys_pfmg_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_SysPFMGGetNumIterations( void *sys_pfmg_vdata, - HYPRE_Int *num_iterations ) +hypre_SysPFMGSetPrintFreq( void *sys_pfmg_vdata, + HYPRE_Int print_freq ) { hypre_SysPFMGData *sys_pfmg_data = (hypre_SysPFMGData *)sys_pfmg_vdata; - *num_iterations = (sys_pfmg_data -> num_iterations); + (sys_pfmg_data -> print_freq) = print_freq; return hypre_error_flag; } @@ -303,28 +305,53 @@ hypre_SysPFMGGetNumIterations( void *sys_pfmg_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_SysPFMGPrintLogging( void *sys_pfmg_vdata, - HYPRE_Int myid) +hypre_SysPFMGGetNumIterations( void *sys_pfmg_vdata, + HYPRE_Int *num_iterations ) { hypre_SysPFMGData *sys_pfmg_data = (hypre_SysPFMGData *)sys_pfmg_vdata; - HYPRE_Int i; - HYPRE_Int num_iterations = (sys_pfmg_data -> num_iterations); - HYPRE_Int logging = (sys_pfmg_data -> logging); - HYPRE_Int print_level = (sys_pfmg_data -> print_level); - HYPRE_Real *norms = (sys_pfmg_data -> norms); - HYPRE_Real *rel_norms = (sys_pfmg_data -> rel_norms); - if (myid == 0) + *num_iterations = (sys_pfmg_data -> num_iterations); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SysPFMGPrintLogging( void *sys_pfmg_vdata ) +{ + hypre_SysPFMGData *sys_pfmg_data = (hypre_SysPFMGData *)sys_pfmg_vdata; + MPI_Comm comm = (sys_pfmg_data -> comm); + HYPRE_Int num_iterations = (sys_pfmg_data -> num_iterations); + HYPRE_Int max_iter = (sys_pfmg_data -> max_iter); + HYPRE_Int logging = (sys_pfmg_data -> logging); + HYPRE_Int print_level = (sys_pfmg_data -> print_level); + HYPRE_Real *norms = (sys_pfmg_data -> norms); + HYPRE_Real *rel_norms = (sys_pfmg_data -> rel_norms); + HYPRE_Int myid, i; + HYPRE_Real convr = 1.0; + HYPRE_Real avg_convr; + + hypre_MPI_Comm_rank(comm, &myid); + + if ((myid == 0) && (logging > 0) && (print_level > 0)) { - if (print_level > 0 ) + hypre_printf("Iters ||r||_2 conv.rate ||r||_2/||b||_2\n"); + hypre_printf("% 5d %e %f %e\n", 0, norms[0], convr, rel_norms[0]); + for (i = 1; i <= num_iterations; i++) + { + convr = norms[i] / norms[i - 1]; + hypre_printf("% 5d %e %f %e\n", i, norms[i], convr, rel_norms[i]); + } + + if (max_iter > 1) { - if (logging > 0) + if (rel_norms[0] > 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]); - } + avg_convr = pow((rel_norms[num_iterations] / rel_norms[0]), + (1.0 / (HYPRE_Real) num_iterations)); + hypre_printf("\nAverage convergence factor = %f\n", avg_convr); } } } @@ -336,7 +363,7 @@ hypre_SysPFMGPrintLogging( void *sys_pfmg_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_SysPFMGGetFinalRelativeResidualNorm( void *sys_pfmg_vdata, +hypre_SysPFMGGetFinalRelativeResidualNorm( void *sys_pfmg_vdata, HYPRE_Real *relative_residual_norm ) { hypre_SysPFMGData *sys_pfmg_data = (hypre_SysPFMGData *)sys_pfmg_vdata; @@ -352,10 +379,6 @@ hypre_SysPFMGGetFinalRelativeResidualNorm( void *sys_pfmg_vdata, { hypre_error_in_arg(1); } - else if (num_iterations == max_iter) - { - *relative_residual_norm = rel_norms[num_iterations - 1]; - } else { *relative_residual_norm = rel_norms[num_iterations]; @@ -364,5 +387,3 @@ hypre_SysPFMGGetFinalRelativeResidualNorm( void *sys_pfmg_vdata, return hypre_error_flag; } - - diff --git a/src/sstruct_ls/sys_pfmg.h b/src/sstruct_ls/sys_pfmg.h index e19f6569ae..3c7eb9e3e4 100644 --- a/src/sstruct_ls/sys_pfmg.h +++ b/src/sstruct_ls/sys_pfmg.h @@ -43,7 +43,6 @@ typedef struct 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; @@ -66,6 +65,7 @@ typedef struct HYPRE_Int num_iterations; HYPRE_Int time_index; HYPRE_Int print_level; + HYPRE_Int print_freq; /* additional log info (logged when `logging' > 0) */ HYPRE_Int logging; diff --git a/src/sstruct_ls/sys_pfmg_setup.c b/src/sstruct_ls/sys_pfmg_setup.c index b005475d3b..a4e4216f5f 100644 --- a/src/sstruct_ls/sys_pfmg_setup.c +++ b/src/sstruct_ls/sys_pfmg_setup.c @@ -10,18 +10,6 @@ #define DEBUG 0 -#define hypre_PFMGSetCIndex(cdir, cindex) \ - { \ - hypre_SetIndex3(cindex, 0, 0, 0); \ - hypre_IndexD(cindex, cdir) = 0; \ - } - -#define hypre_PFMGSetFIndex(cdir, findex) \ - { \ - hypre_SetIndex3(findex, 0, 0, 0); \ - hypre_IndexD(findex, cdir) = 1; \ - } - #define hypre_PFMGSetStride(cdir, stride) \ { \ hypre_SetIndex3(stride, 1, 1, 1); \ @@ -35,111 +23,76 @@ HYPRE_Int hypre_SysPFMGSetup( void *sys_pfmg_vdata, hypre_SStructMatrix *A_in, hypre_SStructVector *b_in, - hypre_SStructVector *x_in ) + hypre_SStructVector *x_in ) { - 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_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; - - hypre_Index coarsen; - - HYPRE_Int *cdir_l; - HYPRE_Int *active_l; - hypre_SStructPGrid **grid_l; - hypre_SStructPGrid **P_grid_l; - + hypre_SysPFMGData *sys_pfmg_data = (hypre_SysPFMGData *) sys_pfmg_vdata; + hypre_SStructPMatrix *A = hypre_SStructMatrixPMatrix(A_in, 0); + hypre_SStructPVector *b = hypre_SStructVectorPVector(b_in, 0); + hypre_SStructPVector *x = hypre_SStructVectorPVector(x_in, 0); + + MPI_Comm comm = (sys_pfmg_data -> comm); + HYPRE_Int relax_type = (sys_pfmg_data -> relax_type); + 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 = (sys_pfmg_data -> max_iter); + HYPRE_Int max_levels; + HYPRE_Int num_levels; + + hypre_Index stride; + hypre_Index periodic; + + hypre_StructMatrix *smatrix; hypre_SStructPMatrix **A_l; hypre_SStructPMatrix **P_l; hypre_SStructPMatrix **RT_l; hypre_SStructPVector **b_l; hypre_SStructPVector **x_l; + hypre_SStructPGrid **grid_l; + HYPRE_Int *cdir_l; + HYPRE_Int *active_l; /* temp vectors */ hypre_SStructPVector **tx_l; hypre_SStructPVector **r_l; hypre_SStructPVector **e_l; - void **relax_data_l; - void **matvec_data_l; - void **restrict_data_l; - void **interp_data_l; - - hypre_SStructPGrid *grid; - hypre_StructGrid *sgrid; - HYPRE_Int dim; - HYPRE_Int full_periodic; + void **relax_data_l; + void **matvec_data_l; + void **restrict_data_l; + void **interp_data_l; - hypre_Box *cbox; + hypre_SStructPGrid *grid; + hypre_StructGrid *sgrid; + HYPRE_Int resize; - HYPRE_Real *relax_weights; - HYPRE_Real *mean, *deviation; - HYPRE_Real alpha, beta; - HYPRE_Int dxyz_flag; + hypre_Box *cbox; - HYPRE_Real min_dxyz; - HYPRE_Int cdir, periodic, cmaxsize; - HYPRE_Int d, l; - HYPRE_Int i; - - HYPRE_Real** sys_dxyz; - - HYPRE_Int nvars; + HYPRE_Real *relax_weights; + HYPRE_Int dxyz_flag; + HYPRE_Int cdir, cmaxsize; + HYPRE_Int d, l, i; + HYPRE_Real var_dxyz[3] = {0.0, 0.0, 0.0}; + HYPRE_Int nvars; #if DEBUG char filename[255]; #endif - /*----------------------------------------------------- - * Refs to A,x,b (the PMatrix & PVectors within - * the input SStructMatrix & SStructVectors) - *-----------------------------------------------------*/ - hypre_SStructPMatrixRef(hypre_SStructMatrixPMatrix(A_in, 0), &A); - hypre_SStructPVectorRef(hypre_SStructVectorPVector(b_in, 0), &b); - hypre_SStructPVectorRef(hypre_SStructVectorPVector(x_in, 0), &x); - - /*-------------------------------------------------------- - * Allocate arrays for mesh sizes for each diagonal block - *--------------------------------------------------------*/ - nvars = hypre_SStructPMatrixNVars(A); - sys_dxyz = hypre_TAlloc(HYPRE_Real *, nvars, HYPRE_MEMORY_HOST); - for ( i = 0; i < nvars; i++) - { - sys_dxyz[i] = hypre_TAlloc(HYPRE_Real, 3, HYPRE_MEMORY_HOST); - } - /*----------------------------------------------------- * Set up coarse grids *-----------------------------------------------------*/ grid = hypre_SStructPMatrixPGrid(A); sgrid = hypre_SStructPGridSGrid(grid, 0); - dim = hypre_StructGridNDim(sgrid); + nvars = hypre_SStructPGridNVars(grid); + + /* Initialize periodic */ + hypre_CopyIndex(hypre_StructGridPeriodic(sgrid), periodic); /* Compute a new max_levels value based on the grid */ - cbox = hypre_BoxDuplicate(hypre_StructGridBoundingBox(sgrid)); - max_levels = - hypre_Log2(hypre_BoxSizeD(cbox, 0)) + 2 + - hypre_Log2(hypre_BoxSizeD(cbox, 1)) + 2 + - hypre_Log2(hypre_BoxSizeD(cbox, 2)) + 2; + hypre_PFMGComputeMaxLevels(sgrid, &max_levels); if ((sys_pfmg_data -> max_levels) > 0) { max_levels = hypre_min(max_levels, (sys_pfmg_data -> max_levels)); @@ -147,201 +100,23 @@ hypre_SysPFMGSetup( void *sys_pfmg_vdata, (sys_pfmg_data -> max_levels) = max_levels; /* compute dxyz */ - dxyz_flag = 0; - if ((dxyz[0] == 0) || (dxyz[1] == 0) || (dxyz[2] == 0)) + for (i = 0; i < nvars; i++) { - mean = hypre_CTAlloc(HYPRE_Real, 3, HYPRE_MEMORY_HOST); - deviation = hypre_CTAlloc(HYPRE_Real, 3, HYPRE_MEMORY_HOST); + smatrix = hypre_SStructPMatrixSMatrix(A, i, i); + hypre_PFMGComputeDxyz(smatrix, var_dxyz, &dxyz_flag); - dxyz_flag = 0; - for (i = 0; i < nvars; i++) + for (d = 0; d < 3; d++) { - 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 - * variation */ - if (!dxyz_flag) - { - for (d = 0; d < dim; d++) - { - deviation[d] -= mean[d] * mean[d]; - /* square of coeff. of variation */ - if (deviation[d] / (mean[d]*mean[d]) > .1) - { - dxyz_flag = 1; - break; - } - } - } - - for (d = 0; d < 3; d++) - { - dxyz[d] += sys_dxyz[i][d]; - } + dxyz[d] += var_dxyz[d]; } - hypre_TFree(mean, HYPRE_MEMORY_HOST); - hypre_TFree(deviation, HYPRE_MEMORY_HOST); } - grid_l = hypre_TAlloc(hypre_SStructPGrid *, max_levels, HYPRE_MEMORY_HOST); - grid_l[0] = grid; - P_grid_l = hypre_TAlloc(hypre_SStructPGrid *, max_levels, HYPRE_MEMORY_HOST); - P_grid_l[0] = NULL; - cdir_l = hypre_TAlloc(HYPRE_Int, max_levels, HYPRE_MEMORY_HOST); - active_l = hypre_TAlloc(HYPRE_Int, max_levels, HYPRE_MEMORY_HOST); - relax_weights = hypre_CTAlloc(HYPRE_Real, max_levels, HYPRE_MEMORY_HOST); - hypre_SetIndex3(coarsen, 1, 1, 1); /* forces relaxation on finest grid */ - for (l = 0; ; l++) - { - /* determine cdir */ - min_dxyz = dxyz[0] + dxyz[1] + dxyz[2] + 1; - cdir = -1; - alpha = 0.0; - for (d = 0; d < dim; d++) - { - if ((hypre_BoxIMaxD(cbox, d) > hypre_BoxIMinD(cbox, d)) && - (dxyz[d] < min_dxyz)) - { - min_dxyz = dxyz[d]; - cdir = d; - } - alpha += 1.0 / (dxyz[d] * dxyz[d]); - } - relax_weights[l] = 2.0 / 3.0; - - /* If it's possible to coarsen, change relax_weights */ - beta = 0.0; - if (cdir != -1) - { - if (dxyz_flag) - { - relax_weights[l] = 2.0 / 3.0; - } - - else - { - for (d = 0; d < dim; d++) - { - if (d != cdir) - { - beta += 1.0 / (dxyz[d] * dxyz[d]); - } - } - if (beta == alpha) - { - alpha = 0.0; - } - else - { - alpha = beta / alpha; - } - - /* determine level Jacobi weights */ - if (dim > 1) - { - relax_weights[l] = 2.0 / (3.0 - alpha); - } - else - { - relax_weights[l] = 2.0 / 3.0; /* always 2/3 for 1-d */ - } - } - } - - if (cdir != -1) - { - /* don't coarsen if a periodic direction and not divisible by 2 */ - periodic = hypre_IndexD(hypre_StructGridPeriodic(grid_l[l]), cdir); - if ((periodic) && (periodic % 2)) - { - cdir = -1; - } - - /* don't coarsen if we've reached max_levels */ - if (l == (max_levels - 1)) - { - cdir = -1; - } - } - - /* stop coarsening */ - if (cdir == -1) - { - active_l[l] = 1; /* forces relaxation on coarsest grid */ - cmaxsize = 0; - for (d = 0; d < dim; d++) - { - cmaxsize = hypre_max(cmaxsize, hypre_BoxSizeD(cbox, d)); - } - - break; - } - - cdir_l[l] = cdir; - - if (hypre_IndexD(coarsen, cdir) != 0) - { - /* coarsened previously in this direction, relax level l */ - active_l[l] = 1; - hypre_SetIndex3(coarsen, 0, 0, 0); - hypre_IndexD(coarsen, cdir) = 1; - } - else - { - active_l[l] = 0; - hypre_IndexD(coarsen, cdir) = 1; - } - - /* set cindex, findex, and stride */ - hypre_PFMGSetCIndex(cdir, cindex); - hypre_PFMGSetFIndex(cdir, findex); - hypre_PFMGSetStride(cdir, stride); - - /* update dxyz and coarsen cbox*/ - dxyz[cdir] *= 2; - hypre_ProjectBox(cbox, cindex, stride); - hypre_StructMapFineToCoarse(hypre_BoxIMin(cbox), cindex, stride, - hypre_BoxIMin(cbox)); - hypre_StructMapFineToCoarse(hypre_BoxIMax(cbox), cindex, stride, - hypre_BoxIMax(cbox)); - - /* build the interpolation grid */ - 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]); - } - num_levels = l + 1; - - /*----------------------------------------------------- - * For fully periodic problems, the coarsest grid - * problem (a single node) can have zero diagonal - * blocks. This causes problems with the gselim - * routine (which doesn't do pivoting). We avoid - * this by skipping relaxation. - *-----------------------------------------------------*/ - - full_periodic = 1; - for (d = 0; d < dim; d++) - { - full_periodic *= hypre_IndexD(hypre_SStructPGridPeriodic(grid), d); - } - if ( full_periodic != 0) - { - hypre_SStructPGridDestroy(grid_l[num_levels - 1]); - hypre_SStructPGridDestroy(P_grid_l[num_levels - 1]); - num_levels -= 1; - } - - /* free up some things */ + /* Run coarsening */ + cbox = hypre_BoxClone(hypre_StructGridBoundingBox(sgrid)); + hypre_PFMGCoarsen(cbox, periodic, max_levels, dxyz_flag, dxyz, + &cdir_l, &active_l, &relax_weights, &num_levels); + cmaxsize = hypre_BoxMaxSize(cbox); hypre_BoxDestroy(cbox); - for ( i = 0; i < nvars; i++) - { - 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) @@ -354,14 +129,12 @@ hypre_SysPFMGSetup( void *sys_pfmg_vdata, (sys_pfmg_data -> num_levels) = num_levels; (sys_pfmg_data -> cdir_l) = cdir_l; - (sys_pfmg_data -> active_l) = active_l; - (sys_pfmg_data -> grid_l) = grid_l; - (sys_pfmg_data -> P_grid_l) = P_grid_l; /*----------------------------------------------------- * Set up matrix and vector structures *-----------------------------------------------------*/ + grid_l = hypre_TAlloc(hypre_SStructPGrid *, max_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); @@ -371,52 +144,74 @@ hypre_SysPFMGSetup( void *sys_pfmg_vdata, r_l = tx_l; e_l = tx_l; + hypre_SStructPGridRef(grid, &grid_l[0]); hypre_SStructPMatrixRef(A, &A_l[0]); hypre_SStructPVectorRef(b, &b_l[0]); hypre_SStructPVectorRef(x, &x_l[0]); hypre_SStructPVectorCreate(comm, grid_l[0], &tx_l[0]); hypre_SStructPVectorInitialize(tx_l[0]); + hypre_SStructPVectorAssemble(tx_l[0]); for (l = 0; l < (num_levels - 1); l++) { cdir = cdir_l[l]; - P_l[l] = hypre_SysPFMGCreateInterpOp(A_l[l], P_grid_l[l + 1], cdir); - hypre_SStructPMatrixInitialize(P_l[l]); + hypre_PFMGSetStride(cdir, stride); + /* set up interpolation and restriction operators */ + P_l[l] = hypre_SysPFMGCreateInterpOp(A_l[l], cdir, stride); RT_l[l] = P_l[l]; +#if 0 /* TODO: Allow RT != P */ + if (nonsymmetric_cycle) + { + RT_l[l] = hypre_SysPFMGCreateRestrictOp(A_l[l], cdir, stride); + } +#endif + hypre_SStructPMatrixSetTranspose(RT_l[l], 1, &resize); + hypre_SStructPMatrixInitialize(P_l[l]); + hypre_SysPFMGSetupInterpOp(P_l[l], A_l[l], cdir); +#if 0 /* TODO: Allow RT != P */ + if (nonsymmetric_cycle) + { + hypre_StructMatrixInitialize(RT_l[l]); + hypre_SysPFMGSetupRestrictOp(RT_l[l], A_l[l], cdir); + } +#endif - 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]); + if (RT_l[l] != P_l[l]) + { + /* If restriction is not the same as interpolation, compute RAP */ + hypre_SStructPMatrixRTtAP(RT_l[l], A_l[l], P_l[l], &A_l[l + 1]); + } + else + { + hypre_SStructPMatrixPtAP(A_l[l], P_l[l], &A_l[l + 1]); + } + hypre_SStructPGridRef(hypre_SStructPMatrixPGrid(A_l[l + 1]), &grid_l[l + 1]); hypre_SStructPVectorCreate(comm, grid_l[l + 1], &b_l[l + 1]); hypre_SStructPVectorInitialize(b_l[l + 1]); + hypre_SStructPVectorAssemble(b_l[l + 1]); hypre_SStructPVectorCreate(comm, grid_l[l + 1], &x_l[l + 1]); hypre_SStructPVectorInitialize(x_l[l + 1]); + hypre_SStructPVectorAssemble(x_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]); } - (sys_pfmg_data -> A_l) = A_l; - (sys_pfmg_data -> P_l) = P_l; - (sys_pfmg_data -> RT_l) = RT_l; - (sys_pfmg_data -> b_l) = b_l; - (sys_pfmg_data -> x_l) = x_l; - (sys_pfmg_data -> tx_l) = tx_l; - (sys_pfmg_data -> r_l) = r_l; - (sys_pfmg_data -> e_l) = e_l; + (sys_pfmg_data -> grid_l) = grid_l; + (sys_pfmg_data -> A_l) = A_l; + (sys_pfmg_data -> P_l) = P_l; + (sys_pfmg_data -> RT_l) = RT_l; + (sys_pfmg_data -> b_l) = b_l; + (sys_pfmg_data -> x_l) = x_l; + (sys_pfmg_data -> tx_l) = tx_l; + (sys_pfmg_data -> r_l) = r_l; + (sys_pfmg_data -> e_l) = e_l; /*----------------------------------------------------- * Set up multigrid operators and call setup routines @@ -431,26 +226,26 @@ hypre_SysPFMGSetup( void *sys_pfmg_vdata, { cdir = cdir_l[l]; - hypre_PFMGSetCIndex(cdir, cindex); - hypre_PFMGSetFIndex(cdir, findex); hypre_PFMGSetStride(cdir, stride); - /* set up interpolation operator */ - hypre_SysPFMGSetupInterpOp(A_l[l], cdir, findex, stride, P_l[l]); - - /* set up the coarse grid operator */ - hypre_SysPFMGSetupRAPOp(RT_l[l], A_l[l], P_l[l], - cdir, cindex, stride, A_l[l + 1]); + /* set up the interpolation operator */ + hypre_SStructPMatvecCreate(&interp_data_l[l]); + hypre_SStructPMatvecSetup(interp_data_l[l], P_l[l], x_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], - cindex, findex, stride); + /* set up the restriction operator */ + hypre_SStructPMatvecCreate(&restrict_data_l[l]); + hypre_SStructPMatvecSetTranspose(restrict_data_l[l], 1); + hypre_SStructPMatvecSetup(restrict_data_l[l], RT_l[l], r_l[l]); + } - /* 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], - cindex, findex, stride); + /* Check for zero diagonal on coarsest grid, occurs with singular problems + * like full Neumann or full periodic. Note that a processor with zero + * diagonal will set active_l = 0, other processors will not. This is OK as + * we only want to avoid the division by zero on the one processor that owns + * the single coarse grid point. */ + if (hypre_SysPFMGZeroDiagonal(A_l[l])) + { + active_l[l] = 0; } /* set up fine grid relaxation */ @@ -472,41 +267,46 @@ hypre_SysPFMGSetup( void *sys_pfmg_vdata, for (l = 1; l < num_levels; l++) { /* set relaxation parameters */ - relax_data_l[l] = hypre_SysPFMGRelaxCreate(comm); - hypre_SysPFMGRelaxSetTol(relax_data_l[l], 0.0); - if (usr_jacobi_weight) + if (active_l[l]) { - hypre_SysPFMGRelaxSetJacobiWeight(relax_data_l[l], jacobi_weight); - } - else - { - hypre_SysPFMGRelaxSetJacobiWeight(relax_data_l[l], relax_weights[l]); + relax_data_l[l] = hypre_SysPFMGRelaxCreate(comm); + hypre_SysPFMGRelaxSetTol(relax_data_l[l], 0.0); + if (usr_jacobi_weight) + { + hypre_SysPFMGRelaxSetJacobiWeight(relax_data_l[l], jacobi_weight); + } + else + { + hypre_SysPFMGRelaxSetJacobiWeight(relax_data_l[l], relax_weights[l]); + } + hypre_SysPFMGRelaxSetType(relax_data_l[l], relax_type); + hypre_SysPFMGRelaxSetTempVec(relax_data_l[l], tx_l[l]); } - hypre_SysPFMGRelaxSetType(relax_data_l[l], relax_type); - hypre_SysPFMGRelaxSetTempVec(relax_data_l[l], tx_l[l]); } /* change coarsest grid relaxation parameters */ l = num_levels - 1; + if (active_l[l]) { HYPRE_Int maxwork, maxiter; 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; + /* do sweeps proportional to the coarsest grid size */ maxiter = hypre_min(maxwork, cmaxsize); -#if 0 - hypre_printf("maxwork = %d, cmaxsize = %d, maxiter = %d\n", - maxwork, cmaxsize, maxiter); -#endif hypre_SysPFMGRelaxSetMaxIter(relax_data_l[l], maxiter); } /* call relax setup */ for (l = 1; l < num_levels; l++) { - hypre_SysPFMGRelaxSetup(relax_data_l[l], A_l[l], b_l[l], x_l[l]); + if (active_l[l]) + { + hypre_SysPFMGRelaxSetup(relax_data_l[l], A_l[l], b_l[l], x_l[l]); + } } } hypre_TFree(relax_weights, HYPRE_MEMORY_HOST); @@ -518,6 +318,7 @@ hypre_SysPFMGSetup( void *sys_pfmg_vdata, hypre_SStructPMatvecSetup(matvec_data_l[l], A_l[l], x_l[l]); } + (sys_pfmg_data -> active_l) = active_l; (sys_pfmg_data -> relax_data_l) = relax_data_l; (sys_pfmg_data -> matvec_data_l) = matvec_data_l; (sys_pfmg_data -> restrict_data_l) = restrict_data_l; @@ -529,107 +330,53 @@ hypre_SysPFMGSetup( void *sys_pfmg_vdata, if ((sys_pfmg_data -> logging) > 0) { - max_iter = (sys_pfmg_data -> max_iter); - (sys_pfmg_data -> norms) = hypre_TAlloc(HYPRE_Real, max_iter, HYPRE_MEMORY_HOST); - (sys_pfmg_data -> rel_norms) = hypre_TAlloc(HYPRE_Real, max_iter, HYPRE_MEMORY_HOST); + (sys_pfmg_data -> norms) = hypre_TAlloc(HYPRE_Real, max_iter + 1, HYPRE_MEMORY_HOST); + (sys_pfmg_data -> rel_norms) = hypre_TAlloc(HYPRE_Real, max_iter + 1, HYPRE_MEMORY_HOST); } #if DEBUG for (l = 0; l < (num_levels - 1); l++) { - hypre_sprintf(filename, "zout_A.%02d", l); + hypre_sprintf(filename, "syspfmg_A.%02d", l); hypre_SStructPMatrixPrint(filename, A_l[l], 0); - hypre_sprintf(filename, "zout_P.%02d", l); + hypre_sprintf(filename, "syspfmg_P.%02d", l); hypre_SStructPMatrixPrint(filename, P_l[l], 0); } - hypre_sprintf(filename, "zout_A.%02d", l); + hypre_sprintf(filename, "syspfmg_A.%02d", l); hypre_SStructPMatrixPrint(filename, A_l[l], 0); #endif - /*----------------------------------------------------- - * Destroy Refs to A,x,b (the PMatrix & PVectors within - * the input SStructMatrix & SStructVectors). - *-----------------------------------------------------*/ - hypre_SStructPMatrixDestroy(A); - hypre_SStructPVectorDestroy(x); - hypre_SStructPVectorDestroy(b); - return hypre_error_flag; } /*-------------------------------------------------------------------------- + * Returns 1 if there is a zero on the diagonal, otherwise returns 0. *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_SysStructCoarsen( hypre_SStructPGrid *fgrid, - hypre_Index index, - hypre_Index stride, - HYPRE_Int prune, - hypre_SStructPGrid **cgrid_ptr ) +hypre_SysPFMGZeroDiagonal( hypre_SStructPMatrix *A ) { - hypre_SStructPGrid *cgrid; - - hypre_StructGrid *sfgrid; - hypre_StructGrid *scgrid; + HYPRE_Int zero_diag = 0; + HYPRE_Int nvars = hypre_SStructPMatrixNVars(A); + hypre_StructMatrix *sA; + HYPRE_Int vi; - MPI_Comm comm; - HYPRE_Int ndim; - HYPRE_Int nvars; - hypre_SStructVariable *vartypes; - hypre_SStructVariable *new_vartypes; - HYPRE_Int i; - HYPRE_Int t; - - /*----------------------------------------- - * Copy information from fine grid - *-----------------------------------------*/ - - comm = hypre_SStructPGridComm(fgrid); - ndim = hypre_SStructPGridNDim(fgrid); - nvars = hypre_SStructPGridNVars(fgrid); - vartypes = hypre_SStructPGridVarTypes(fgrid); - - cgrid = hypre_TAlloc(hypre_SStructPGrid, 1, HYPRE_MEMORY_HOST); - - hypre_SStructPGridComm(cgrid) = comm; - hypre_SStructPGridNDim(cgrid) = ndim; - hypre_SStructPGridNVars(cgrid) = nvars; - new_vartypes = hypre_TAlloc(hypre_SStructVariable, nvars, HYPRE_MEMORY_HOST); - for (i = 0; i < nvars; i++) + for (vi = 0; vi < nvars; vi++) { - new_vartypes[i] = vartypes[i]; + sA = hypre_SStructPMatrixSMatrix(A, vi, vi); + if (sA != NULL) + { + zero_diag += hypre_StructMatrixZeroDiagonal(sA); + } + else + { + zero_diag += 1; + } } - hypre_SStructPGridVarTypes(cgrid) = new_vartypes; - - for (t = 0; t < 8; t++) + if (zero_diag > 0) { - hypre_SStructPGridVTSGrid(cgrid, t) = NULL; - hypre_SStructPGridVTIBoxArray(cgrid, t) = NULL; + zero_diag = 1; } - /*----------------------------------------- - * Set the coarse sgrid - *-----------------------------------------*/ - - sfgrid = hypre_SStructPGridCellSGrid(fgrid); - hypre_StructCoarsen(sfgrid, index, stride, prune, &scgrid); - - hypre_CopyIndex(hypre_StructGridPeriodic(scgrid), - hypre_SStructPGridPeriodic(cgrid)); - - hypre_SStructPGridSetCellSGrid(cgrid, scgrid); - - hypre_SStructPGridPNeighbors(cgrid) = hypre_BoxArrayCreate(0, ndim); - hypre_SStructPGridPNborOffsets(cgrid) = NULL; - - hypre_SStructPGridLocalSize(cgrid) = 0; - hypre_SStructPGridGlobalSize(cgrid) = 0; - hypre_SStructPGridGhlocalSize(cgrid) = 0; - - hypre_SStructPGridAssemble(cgrid); - - *cgrid_ptr = cgrid; - - return hypre_error_flag; + return zero_diag; } - diff --git a/src/sstruct_ls/sys_pfmg_setup_interp.c b/src/sstruct_ls/sys_pfmg_setup_interp.c index f5735a12c6..7eaa5462ff 100644 --- a/src/sstruct_ls/sys_pfmg_setup_interp.c +++ b/src/sstruct_ls/sys_pfmg_setup_interp.c @@ -12,50 +12,55 @@ hypre_SStructPMatrix * hypre_SysPFMGCreateInterpOp( hypre_SStructPMatrix *A, - hypre_SStructPGrid *cgrid, - HYPRE_Int cdir ) + HYPRE_Int cdir, + hypre_Index stride ) { hypre_SStructPMatrix *P; - hypre_Index *stencil_shape; - HYPRE_Int stencil_size; + HYPRE_Int rap_type = 0; + hypre_StructMatrix *sA; + hypre_StructMatrix *sP; - HYPRE_Int ndim; + HYPRE_Int stencil_size; + hypre_Index *stencil_shape; - HYPRE_Int nvars; + HYPRE_Int nvars, ndim, i, s, vi; hypre_SStructStencil **P_stencils; + HYPRE_Int centries[1] = {0}; - HYPRE_Int i, s; + /* Create struct interpolation matrix sP first */ + sA = hypre_SStructPMatrixSMatrix(A, 0, 0); + sP = hypre_PFMGCreateInterpOp(sA, cdir, stride, rap_type); + hypre_StructMatrixInitializeShell(sP); /* Don't allocate data */ - /* set up stencil_shape */ - stencil_size = 2; - stencil_shape = hypre_CTAlloc(hypre_Index, stencil_size, HYPRE_MEMORY_HOST); - for (i = 0; i < stencil_size; i++) - { - hypre_SetIndex3(stencil_shape[i], 0, 0, 0); - } - hypre_IndexD(stencil_shape[0], cdir) = -1; - hypre_IndexD(stencil_shape[1], cdir) = 1; + stencil_size = hypre_StructStencilSize(hypre_StructMatrixStencil(sP)); + stencil_shape = hypre_StructStencilShape(hypre_StructMatrixStencil(sP)); - /* set up P_stencils */ - ndim = hypre_StructStencilNDim(hypre_SStructPMatrixSStencil(A, 0, 0)); + /* Set up P_stencils */ nvars = hypre_SStructPMatrixNVars(A); + ndim = hypre_SStructPMatrixNDim(A); P_stencils = hypre_CTAlloc(hypre_SStructStencil *, nvars, HYPRE_MEMORY_HOST); for (s = 0; s < nvars; s++) { HYPRE_SStructStencilCreate(ndim, stencil_size, &P_stencils[s]); for (i = 0; i < stencil_size; i++) { - HYPRE_SStructStencilSetEntry(P_stencils[s], i, - stencil_shape[i], s); + HYPRE_SStructStencilSetEntry(P_stencils[s], i, stencil_shape[i], s); } } - /* create interpolation matrix */ - hypre_SStructPMatrixCreate(hypre_SStructPMatrixComm(A), cgrid, - P_stencils, &P); + /* Set up the P matrix */ + hypre_SStructPMatrixCreate(hypre_SStructPMatrixComm(A), + hypre_SStructPMatrixPGrid(A), P_stencils, &P); + hypre_SStructPMatrixSetDomainStride(P, stride); - hypre_TFree(stencil_shape, HYPRE_MEMORY_HOST); + /* Make the diagonal constant */ + for (vi = 0; vi < nvars; vi++) + { + hypre_StructMatrixSetConstantEntries(hypre_SStructPMatrixSMatrix(P, vi, vi), 1, centries); + } + + hypre_StructMatrixDestroy(sP); return P; } @@ -64,24 +69,17 @@ hypre_SysPFMGCreateInterpOp( hypre_SStructPMatrix *A, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_SysPFMGSetupInterpOp( hypre_SStructPMatrix *A, - HYPRE_Int cdir, - hypre_Index findex, - hypre_Index stride, - hypre_SStructPMatrix *P ) +hypre_SysPFMGSetupInterpOp( hypre_SStructPMatrix *P, + hypre_SStructPMatrix *A, + HYPRE_Int cdir ) { - HYPRE_Int nvars; - hypre_StructMatrix *A_s; - hypre_StructMatrix *P_s; - HYPRE_Int vi; - - nvars = hypre_SStructPMatrixNVars(A); + HYPRE_Int nvars = hypre_SStructPMatrixNVars(P); + HYPRE_Int vi; for (vi = 0; vi < nvars; vi++) { - A_s = hypre_SStructPMatrixSMatrix(A, vi, vi); - P_s = hypre_SStructPMatrixSMatrix(P, vi, vi); - hypre_PFMGSetupInterpOp(A_s, cdir, findex, stride, P_s, 0); + hypre_PFMGSetupInterpOp(hypre_SStructPMatrixSMatrix(P, vi, vi), + hypre_SStructPMatrixSMatrix(A, vi, vi), cdir); } return hypre_error_flag; diff --git a/src/sstruct_ls/sys_pfmg_setup_rap.c b/src/sstruct_ls/sys_pfmg_setup_rap.c deleted file mode 100644 index cd6f5027dd..0000000000 --- a/src/sstruct_ls/sys_pfmg_setup_rap.c +++ /dev/null @@ -1,172 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_sstruct_ls.h" - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -hypre_SStructPMatrix * -hypre_SysPFMGCreateRAPOp( hypre_SStructPMatrix *R, - hypre_SStructPMatrix *A, - hypre_SStructPMatrix *P, - hypre_SStructPGrid *coarse_grid, - HYPRE_Int cdir ) -{ - hypre_SStructPMatrix *RAP; - HYPRE_Int ndim; - HYPRE_Int nvars; - hypre_SStructVariable vartype; - - hypre_SStructStencil **RAP_stencils; - - hypre_StructMatrix *RAP_s; - hypre_StructMatrix *R_s; - hypre_StructMatrix *A_s; - hypre_StructMatrix *P_s; - - hypre_Index **RAP_shapes; - - hypre_StructStencil *sstencil; - hypre_Index *shape; - HYPRE_Int s; - HYPRE_Int *sstencil_sizes; - - HYPRE_Int stencil_size; - - hypre_StructGrid *cgrid; - - HYPRE_Int vi, vj; - - HYPRE_Int sten_cntr; - - HYPRE_Int P_stored_as_transpose = 0; - - ndim = hypre_StructStencilNDim(hypre_SStructPMatrixSStencil(A, 0, 0)); - nvars = hypre_SStructPMatrixNVars(A); - - vartype = hypre_SStructPGridVarType(coarse_grid, 0); - cgrid = hypre_SStructPGridVTSGrid(coarse_grid, vartype); - - RAP_stencils = hypre_CTAlloc(hypre_SStructStencil *, nvars, HYPRE_MEMORY_HOST); - - RAP_shapes = hypre_CTAlloc(hypre_Index *, nvars, HYPRE_MEMORY_HOST); - sstencil_sizes = hypre_CTAlloc(HYPRE_Int, nvars, HYPRE_MEMORY_HOST); - - /*-------------------------------------------------------------------------- - * Symmetry within a block is exploited, but not symmetry of the form - * A_{vi,vj} = A_{vj,vi}^T. - *--------------------------------------------------------------------------*/ - - for (vi = 0; vi < nvars; vi++) - { - R_s = hypre_SStructPMatrixSMatrix(R, vi, vi); - stencil_size = 0; - for (vj = 0; vj < nvars; vj++) - { - A_s = hypre_SStructPMatrixSMatrix(A, vi, vj); - 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); - /* Just want stencil for RAP */ - hypre_StructMatrixInitializeShell(RAP_s); - sstencil = hypre_StructMatrixStencil(RAP_s); - shape = hypre_StructStencilShape(sstencil); - sstencil_sizes[vj] = hypre_StructStencilSize(sstencil); - stencil_size += sstencil_sizes[vj]; - 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_StructMatrixDestroy(RAP_s); - } - } - - HYPRE_SStructStencilCreate(ndim, stencil_size, &RAP_stencils[vi]); - sten_cntr = 0; - for (vj = 0; vj < nvars; vj++) - { - if (sstencil_sizes[vj] > 0) - { - for (s = 0; s < sstencil_sizes[vj]; s++) - { - HYPRE_SStructStencilSetEntry(RAP_stencils[vi], - sten_cntr, RAP_shapes[vj][s], vj); - sten_cntr++; - } - hypre_TFree(RAP_shapes[vj], HYPRE_MEMORY_HOST); - } - } - } - - /* create RAP Pmatrix */ - hypre_SStructPMatrixCreate(hypre_SStructPMatrixComm(A), - coarse_grid, RAP_stencils, &RAP); - - hypre_TFree(RAP_shapes, HYPRE_MEMORY_HOST); - hypre_TFree(sstencil_sizes, HYPRE_MEMORY_HOST); - - return RAP; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -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_Int nvars; - HYPRE_Int vi, vj; - - hypre_StructMatrix *R_s; - hypre_StructMatrix *A_s; - hypre_StructMatrix *P_s; - - hypre_StructMatrix *Ac_s; - - HYPRE_Int P_stored_as_transpose = 0; - - nvars = hypre_SStructPMatrixNVars(A); - - /*-------------------------------------------------------------------------- - * Symmetry within a block is exploited, but not symmetry of the form - * A_{vi,vj} = A_{vj,vi}^T. - *--------------------------------------------------------------------------*/ - - for (vi = 0; vi < nvars; vi++) - { - R_s = hypre_SStructPMatrixSMatrix(R, vi, vi); - for (vj = 0; vj < nvars; vj++) - { - A_s = hypre_SStructPMatrixSMatrix(A, vi, vj); - Ac_s = hypre_SStructPMatrixSMatrix(Ac, vi, vj); - P_s = hypre_SStructPMatrixSMatrix(P, vj, vj); - if (A_s != NULL) - { - hypre_SemiBuildRAP(A_s, P_s, R_s, cdir, cindex, cstride, - P_stored_as_transpose, Ac_s); - /* Assemble here? */ - hypre_StructMatrixAssemble(Ac_s); - } - } - } - - return hypre_error_flag; -} - diff --git a/src/sstruct_ls/sys_pfmg_solve.c b/src/sstruct_ls/sys_pfmg_solve.c index 533b9f62c8..8b6e924013 100644 --- a/src/sstruct_ls/sys_pfmg_solve.c +++ b/src/sstruct_ls/sys_pfmg_solve.c @@ -21,40 +21,44 @@ hypre_SysPFMGSolve( void *sys_pfmg_vdata, { hypre_SysPFMGData *sys_pfmg_data = (hypre_SysPFMGData*)sys_pfmg_vdata; - hypre_SStructPMatrix *A; - hypre_SStructPVector *b; - hypre_SStructPVector *x; - - HYPRE_Real tol = (sys_pfmg_data -> tol); - HYPRE_Int max_iter = (sys_pfmg_data -> max_iter); - HYPRE_Int rel_change = (sys_pfmg_data -> rel_change); - HYPRE_Int zero_guess = (sys_pfmg_data -> zero_guess); - HYPRE_Int num_pre_relax = (sys_pfmg_data -> num_pre_relax); - HYPRE_Int num_post_relax = (sys_pfmg_data -> num_post_relax); - HYPRE_Int num_levels = (sys_pfmg_data -> num_levels); - hypre_SStructPMatrix **A_l = (sys_pfmg_data -> A_l); - hypre_SStructPMatrix **P_l = (sys_pfmg_data -> P_l); - hypre_SStructPMatrix **RT_l = (sys_pfmg_data -> RT_l); - hypre_SStructPVector **b_l = (sys_pfmg_data -> b_l); - hypre_SStructPVector **x_l = (sys_pfmg_data -> x_l); - hypre_SStructPVector **r_l = (sys_pfmg_data -> r_l); - hypre_SStructPVector **e_l = (sys_pfmg_data -> e_l); - void **relax_data_l = (sys_pfmg_data -> relax_data_l); - void **matvec_data_l = (sys_pfmg_data -> matvec_data_l); - void **restrict_data_l = (sys_pfmg_data -> restrict_data_l); - void **interp_data_l = (sys_pfmg_data -> interp_data_l); - HYPRE_Int logging = (sys_pfmg_data -> logging); - HYPRE_Real *norms = (sys_pfmg_data -> norms); - HYPRE_Real *rel_norms = (sys_pfmg_data -> rel_norms); - HYPRE_Int *active_l = (sys_pfmg_data -> active_l); - - HYPRE_Real b_dot_b, r_dot_r, eps = 0; - HYPRE_Real e_dot_e = 0, x_dot_x = 1; - - HYPRE_Int i, l; - + hypre_SStructPMatrix *A; + hypre_SStructPVector *b; + hypre_SStructPVector *x; + + HYPRE_Real tol = (sys_pfmg_data -> tol); + HYPRE_Int max_iter = (sys_pfmg_data -> max_iter); + HYPRE_Int rel_change = (sys_pfmg_data -> rel_change); + HYPRE_Int zero_guess = (sys_pfmg_data -> zero_guess); + HYPRE_Int num_pre_relax = (sys_pfmg_data -> num_pre_relax); + HYPRE_Int num_post_relax = (sys_pfmg_data -> num_post_relax); + HYPRE_Int num_levels = (sys_pfmg_data -> num_levels); + hypre_SStructPMatrix **A_l = (sys_pfmg_data -> A_l); + hypre_SStructPMatrix **P_l = (sys_pfmg_data -> P_l); + hypre_SStructPMatrix **RT_l = (sys_pfmg_data -> RT_l); + hypre_SStructPVector **b_l = (sys_pfmg_data -> b_l); + hypre_SStructPVector **x_l = (sys_pfmg_data -> x_l); + hypre_SStructPVector **r_l = (sys_pfmg_data -> r_l); + hypre_SStructPVector **e_l = (sys_pfmg_data -> e_l); + void **relax_data_l = (sys_pfmg_data -> relax_data_l); + void **matvec_data_l = (sys_pfmg_data -> matvec_data_l); + void **restrict_data_l = (sys_pfmg_data -> restrict_data_l); + void **interp_data_l = (sys_pfmg_data -> interp_data_l); + HYPRE_Real *norms = (sys_pfmg_data -> norms); + HYPRE_Real *rel_norms = (sys_pfmg_data -> rel_norms); + HYPRE_Int *active_l = (sys_pfmg_data -> active_l); + HYPRE_Int logging = (sys_pfmg_data -> logging); + + HYPRE_Real b_dot_b, r_dot_r, eps = 0; + HYPRE_Real e_dot_e = 0, x_dot_x = 1; + + HYPRE_Int i, l; +#if 0 + HYPRE_Int print_level = (sys_pfmg_data -> print_level); + HYPRE_Int print_freq = (sys_pfmg_data -> print_freq); + char filename[255]; +#endif #if DEBUG - char filename[255]; + char filename[255]; #endif /*----------------------------------------------------- @@ -68,11 +72,12 @@ hypre_SysPFMGSolve( void *sys_pfmg_vdata, * Refs to A,x,b (the PMatrix & PVectors within * the input SStructMatrix & SStructVectors) *-----------------------------------------------------*/ + + /* RDF: Why do we need the '_in' objects? */ hypre_SStructPMatrixRef(hypre_SStructMatrixPMatrix(A_in, 0), &A); hypre_SStructPVectorRef(hypre_SStructVectorPVector(b_in, 0), &b); hypre_SStructPVectorRef(hypre_SStructVectorPVector(x_in, 0), &x); - hypre_SStructPMatrixDestroy(A_l[0]); hypre_SStructPVectorDestroy(b_l[0]); hypre_SStructPVectorDestroy(x_l[0]); @@ -80,7 +85,6 @@ hypre_SysPFMGSolve( void *sys_pfmg_vdata, hypre_SStructPVectorRef(b, &b_l[0]); hypre_SStructPVectorRef(x, &x_l[0]); - (sys_pfmg_data -> num_iterations) = 0; /* if max_iter is zero, return */ @@ -98,6 +102,16 @@ hypre_SysPFMGSolve( void *sys_pfmg_vdata, return hypre_error_flag; } +#if 0 + /* RDF: Not needed if max_iter > 0 */ + if (((tol > 0.) && (logging > 0)) || (print_level > 1)) + { + /* Compute fine grid residual (r = b - Ax) */ + hypre_SStructPMatvecCompute(matvec_data_l[0], -1.0, + A_l[0], x_l[0], 1.0, b_l[0], r_l[0]); + } +#endif + /* part of convergence check */ if (tol > 0.0) { @@ -106,9 +120,9 @@ hypre_SysPFMGSolve( void *sys_pfmg_vdata, eps = tol * tol; /* if rhs is zero, return a zero solution */ - if (b_dot_b == 0.0) + if (!(b_dot_b > 0.0)) { - hypre_SStructPVectorSetConstantValues(x, 0.0); + hypre_SStructPVectorSetConstantValues(x_l[0], 0.0); if (logging > 0) { norms[0] = 0.0; @@ -117,11 +131,19 @@ hypre_SysPFMGSolve( void *sys_pfmg_vdata, hypre_EndTiming(sys_pfmg_data -> time_index); HYPRE_ANNOTATE_FUNC_END; - return hypre_error_flag; } } + /* Print initial solution and residual */ +#if DEBUG + hypre_sprintf(filename, "sys_pfmg_x.i%02d", 0); + hypre_SStructPVectorPrint(filename, x_l[0], 0); + + hypre_sprintf(filename, "sys_pfmg_r.i%02d", 0); + hypre_SStructPVectorPrint(filename, r_l[0], 0); +#endif + /*----------------------------------------------------- * Do V-cycles: * For each index l, "fine" = l, "coarse" = (l+1) @@ -132,6 +154,7 @@ hypre_SysPFMGSolve( void *sys_pfmg_vdata, /*-------------------------------------------------- * Down cycle *--------------------------------------------------*/ + HYPRE_ANNOTATE_MGLEVEL_BEGIN(0); /* fine grid pre-relaxation */ @@ -141,10 +164,9 @@ hypre_SysPFMGSolve( void *sys_pfmg_vdata, hypre_SysPFMGRelax(relax_data_l[0], A_l[0], b_l[0], x_l[0]); zero_guess = 0; - /* compute fine grid residual (b - Ax) */ - hypre_SStructPCopy(b_l[0], r_l[0]); - hypre_SStructPMatvecCompute(matvec_data_l[0], - -1.0, A_l[0], x_l[0], 1.0, r_l[0]); + /* compute fine grid residual (r = b - Ax) */ + /* RDF: I don't think we should have a different interface for matvec as elsewhere */ + hypre_SStructPMatvecCompute(matvec_data_l[0], -1.0, A_l[0], x_l[0], 1.0, b_l[0], r_l[0]); /* convergence check */ if (tol > 0.0) @@ -178,23 +200,24 @@ hypre_SysPFMGSolve( void *sys_pfmg_vdata, if (num_levels > 1) { /* restrict fine grid residual */ - hypre_SysSemiRestrict(restrict_data_l[0], RT_l[0], r_l[0], b_l[1]); + hypre_SStructPMatvecCompute(restrict_data_l[0], 1.0, RT_l[0], r_l[0], 0.0, + b_l[1], b_l[1]); #if DEBUG - hypre_sprintf(filename, "zout_xdown.%02d", 0); + hypre_sprintf(filename, "syspfmg_xdown.%02d", 0); hypre_SStructPVectorPrint(filename, x_l[0], 0); - hypre_sprintf(filename, "zout_rdown.%02d", 0); + hypre_sprintf(filename, "syspfmg_rdown.%02d", 0); hypre_SStructPVectorPrint(filename, r_l[0], 0); - hypre_sprintf(filename, "zout_b.%02d", 1); + hypre_sprintf(filename, "syspfmg_b.%02d", 1); hypre_SStructPVectorPrint(filename, b_l[1], 0); #endif HYPRE_ANNOTATE_MGLEVEL_END(0); for (l = 1; l <= (num_levels - 2); l++) { + HYPRE_ANNOTATE_MGLEVEL_BEGIN(l); + if (active_l[l]) { - HYPRE_ANNOTATE_MGLEVEL_BEGIN(l); - /* pre-relaxation */ hypre_SysPFMGRelaxSetPreRelax(relax_data_l[l]); hypre_SysPFMGRelaxSetMaxIter(relax_data_l[l], num_pre_relax); @@ -202,9 +225,8 @@ hypre_SysPFMGSolve( void *sys_pfmg_vdata, hypre_SysPFMGRelax(relax_data_l[l], A_l[l], b_l[l], x_l[l]); /* compute residual (b - Ax) */ - hypre_SStructPCopy(b_l[l], r_l[l]); - hypre_SStructPMatvecCompute(matvec_data_l[l], - -1.0, A_l[l], x_l[l], 1.0, r_l[l]); + hypre_SStructPMatvecCompute(matvec_data_l[l], -1.0, A_l[l], + x_l[l], 1.0, b_l[l], r_l[l]); } else { @@ -214,16 +236,14 @@ hypre_SysPFMGSolve( void *sys_pfmg_vdata, } /* restrict residual */ - hypre_SysSemiRestrict(restrict_data_l[l], - RT_l[l], r_l[l], b_l[l + 1]); + hypre_SStructPMatvecCompute(restrict_data_l[l], 1.0, RT_l[l], r_l[l], 0.0, + b_l[l + 1], b_l[l + 1]); #if DEBUG - hypre_sprintf(filename, "zout_xdown.%02d", l); + hypre_sprintf(filename, "syspfmg_xdown.%02d", l); hypre_SStructPVectorPrint(filename, x_l[l], 0); - hypre_sprintf(filename, "zout_rdown.%02d", l); + hypre_sprintf(filename, "syspfmg_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_sprintf(filename, "syspfmg_b.%02d", l + 1); hypre_SStructPVectorPrint(filename, b_l[l + 1], 0); #endif HYPRE_ANNOTATE_MGLEVEL_END(l); @@ -232,12 +252,20 @@ hypre_SysPFMGSolve( void *sys_pfmg_vdata, /*-------------------------------------------------- * Bottom *--------------------------------------------------*/ + HYPRE_ANNOTATE_MGLEVEL_BEGIN(num_levels - 1); - hypre_SysPFMGRelaxSetZeroGuess(relax_data_l[l], 1); - hypre_SysPFMGRelax(relax_data_l[l], A_l[l], b_l[l], x_l[l]); + if (active_l[l]) + { + hypre_SysPFMGRelaxSetZeroGuess(relax_data_l[l], 1); + hypre_SysPFMGRelax(relax_data_l[l], A_l[l], b_l[l], x_l[l]); + } + else + { + hypre_SStructPVectorSetConstantValues(x_l[l], 0.0); + } #if DEBUG - hypre_sprintf(filename, "zout_xbottom.%02d", l); + hypre_sprintf(filename, "syspfmg_xbottom.%02d", l); hypre_SStructPVectorPrint(filename, x_l[l], 0); #endif @@ -248,17 +276,17 @@ 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_SStructPMatvecCompute(interp_data_l[l], 1.0, P_l[l], x_l[l + 1], 0.0, + e_l[l], e_l[l]); hypre_SStructPAxpy(1.0, e_l[l], x_l[l]); HYPRE_ANNOTATE_MGLEVEL_END(l + 1); #if DEBUG - hypre_sprintf(filename, "zout_eup.%02d", l); + hypre_sprintf(filename, "syspfmg_eup.%02d", l); hypre_SStructPVectorPrint(filename, e_l[l], 0); - hypre_sprintf(filename, "zout_xup.%02d", l); + hypre_sprintf(filename, "syspfmg_xup.%02d", l); hypre_SStructPVectorPrint(filename, x_l[l], 0); #endif HYPRE_ANNOTATE_MGLEVEL_BEGIN(l); - if (active_l[l]) { /* post-relaxation */ @@ -270,13 +298,14 @@ hypre_SysPFMGSolve( void *sys_pfmg_vdata, } /* interpolate error and correct on fine grid (x = x + Pe_c) */ - hypre_SysSemiInterp(interp_data_l[0], P_l[0], x_l[1], e_l[0]); + hypre_SStructPMatvecCompute(interp_data_l[0], 1.0, P_l[0], x_l[1], 0.0, + e_l[0], e_l[0]); hypre_SStructPAxpy(1.0, e_l[0], x_l[0]); HYPRE_ANNOTATE_MGLEVEL_END(1); #if DEBUG - hypre_sprintf(filename, "zout_eup.%02d", 0); + hypre_sprintf(filename, "syspfmg_eup.%02d", 0); hypre_SStructPVectorPrint(filename, e_l[0], 0); - hypre_sprintf(filename, "zout_xup.%02d", 0); + hypre_sprintf(filename, "syspfmg_xup.%02d", 0); hypre_SStructPVectorPrint(filename, x_l[0], 0); #endif HYPRE_ANNOTATE_MGLEVEL_BEGIN(0); @@ -290,26 +319,81 @@ hypre_SysPFMGSolve( void *sys_pfmg_vdata, hypre_SStructPInnerProd(e_l[0], e_l[0], &e_dot_e); hypre_SStructPInnerProd(x_l[0], x_l[0], &x_dot_x); } + else + { + e_dot_e = 0.0; + x_dot_x = 1.0; + } } + /* fine grid post-relaxation */ hypre_SysPFMGRelaxSetPostRelax(relax_data_l[0]); hypre_SysPFMGRelaxSetMaxIter(relax_data_l[0], num_post_relax); hypre_SysPFMGRelaxSetZeroGuess(relax_data_l[0], 0); hypre_SysPFMGRelax(relax_data_l[0], A_l[0], b_l[0], x_l[0]); - (sys_pfmg_data -> num_iterations) = (i + 1); + (sys_pfmg_data -> num_iterations) = (i + 1); HYPRE_ANNOTATE_MGLEVEL_END(0); + +#if 0 + /* RDF: In PFMG, we don't do any of this */ + if ((logging > 0) || (print_level > 1)) + { + /* Recompute fine grid residual (r = b - Ax) after post-smoothing */ + hypre_SStructPMatvecCompute(matvec_data_l[0], -1.0, A_l[0], x_l[0], 1.0, b_l[0], r_l[0]); + + if (logging > 0) + { + hypre_SStructPInnerProd(r_l[0], r_l[0], &r_dot_r); + + norms[i + 1] = sqrt(r_dot_r); + rel_norms[i + 1] = sqrt(r_dot_r / b_dot_b); + } + + if (print_level > 1 && !((i + 1) % print_freq)) + { + /* Print solution */ + hypre_sprintf(filename, "sys_pfmg_x.i%02d", (i + 1)); + hypre_SStructPVectorPrint(filename, x_l[0], 0); + + /* Print residual */ + hypre_sprintf(filename, "sys_pfmg_r.i%02d", (i + 1)); + hypre_SStructPVectorPrint(filename, r_l[0], 0); + } + } + else + { + /* r_l[0] is the fine grid residual computed after pre-smoothing */ + /* RDF: This is redundant unless the next convergence check passes, + * which will never happen because it's already been checked above */ + hypre_SStructPInnerProd(r_l[0], r_l[0], &r_dot_r); + } + + /* convergence check */ + if (tol > 0.0) + { + if (r_dot_r / b_dot_b < eps) + { + if (((rel_change) && (e_dot_e / x_dot_x) < eps) || (!rel_change)) + { + break; + } + } + } +#endif } /*----------------------------------------------------- * Destroy Refs to A,x,b (the PMatrix & PVectors within * the input SStructMatrix & SStructVectors). *-----------------------------------------------------*/ + hypre_SStructPMatrixDestroy(A); hypre_SStructPVectorDestroy(x); hypre_SStructPVectorDestroy(b); hypre_EndTiming(sys_pfmg_data -> time_index); + hypre_SysPFMGPrintLogging((void *) sys_pfmg_data); HYPRE_ANNOTATE_FUNC_END; return hypre_error_flag; diff --git a/src/sstruct_ls/sys_semi_interp.c b/src/sstruct_ls/sys_semi_interp.c deleted file mode 100644 index 3ff55bca69..0000000000 --- a/src/sstruct_ls/sys_semi_interp.c +++ /dev/null @@ -1,138 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_sstruct_ls.h" - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -typedef struct -{ - HYPRE_Int nvars; - void **sinterp_data; - -} hypre_SysSemiInterpData; - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_SysSemiInterpCreate( void **sys_interp_vdata_ptr ) -{ - hypre_SysSemiInterpData *sys_interp_data; - - sys_interp_data = hypre_CTAlloc(hypre_SysSemiInterpData, 1, HYPRE_MEMORY_HOST); - *sys_interp_vdata_ptr = (void *) sys_interp_data; - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -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_SysSemiInterpData *sys_interp_data = (hypre_SysSemiInterpData *)sys_interp_vdata; - void **sinterp_data; - - HYPRE_Int nvars; - - hypre_StructMatrix *P_s; - hypre_StructVector *xc_s; - hypre_StructVector *e_s; - - HYPRE_Int vi; - - nvars = hypre_SStructPMatrixNVars(P); - sinterp_data = hypre_CTAlloc(void *, nvars, HYPRE_MEMORY_HOST); - - for (vi = 0; vi < nvars; vi++) - { - P_s = hypre_SStructPMatrixSMatrix(P, vi, vi); - xc_s = hypre_SStructPVectorSVector(xc, vi); - e_s = hypre_SStructPVectorSVector(e, vi); - sinterp_data[vi] = hypre_SemiInterpCreate( ); - hypre_SemiInterpSetup( sinterp_data[vi], P_s, P_stored_as_transpose, - xc_s, e_s, cindex, findex, stride); - } - - (sys_interp_data -> nvars) = nvars; - (sys_interp_data -> sinterp_data) = sinterp_data; - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_SysSemiInterp( void *sys_interp_vdata, - hypre_SStructPMatrix *P, - hypre_SStructPVector *xc, - hypre_SStructPVector *e ) -{ - hypre_SysSemiInterpData *sys_interp_data = (hypre_SysSemiInterpData *)sys_interp_vdata; - void **sinterp_data = (sys_interp_data -> sinterp_data); - HYPRE_Int nvars = (sys_interp_data -> nvars); - - void *sdata; - hypre_StructMatrix *P_s; - hypre_StructVector *xc_s; - hypre_StructVector *e_s; - - HYPRE_Int vi; - - for (vi = 0; vi < nvars; vi++) - { - sdata = sinterp_data[vi]; - P_s = hypre_SStructPMatrixSMatrix(P, vi, vi); - xc_s = hypre_SStructPVectorSVector(xc, vi); - e_s = hypre_SStructPVectorSVector(e, vi); - hypre_SemiInterp(sdata, P_s, xc_s, e_s); - } - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_SysSemiInterpDestroy( void *sys_interp_vdata ) -{ - hypre_SysSemiInterpData *sys_interp_data = (hypre_SysSemiInterpData *)sys_interp_vdata; - - HYPRE_Int nvars; - void **sinterp_data; - HYPRE_Int vi; - - if (sys_interp_data) - { - nvars = (sys_interp_data -> nvars); - sinterp_data = (sys_interp_data -> sinterp_data); - for (vi = 0; vi < nvars; vi++) - { - if (sinterp_data[vi] != NULL) - { - hypre_SemiInterpDestroy(sinterp_data[vi]); - } - } - hypre_TFree(sinterp_data, HYPRE_MEMORY_HOST); - hypre_TFree(sys_interp_data, HYPRE_MEMORY_HOST); - } - - return hypre_error_flag; -} - diff --git a/src/sstruct_ls/sys_semi_restrict.c b/src/sstruct_ls/sys_semi_restrict.c deleted file mode 100644 index 43cc4b660d..0000000000 --- a/src/sstruct_ls/sys_semi_restrict.c +++ /dev/null @@ -1,138 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_sstruct_ls.h" - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -typedef struct -{ - HYPRE_Int nvars; - void **srestrict_data; -} hypre_SysSemiRestrictData; - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_SysSemiRestrictCreate( void **sys_restrict_vdata_ptr) -{ - hypre_SysSemiRestrictData *sys_restrict_data; - - sys_restrict_data = hypre_CTAlloc(hypre_SysSemiRestrictData, 1, HYPRE_MEMORY_HOST); - *sys_restrict_vdata_ptr = (void *) sys_restrict_data; - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -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_SysSemiRestrictData *sys_restrict_data = (hypre_SysSemiRestrictData *)sys_restrict_vdata; - void **srestrict_data; - - HYPRE_Int nvars; - - hypre_StructMatrix *R_s; - hypre_StructVector *rc_s; - hypre_StructVector *r_s; - - HYPRE_Int vi; - - nvars = hypre_SStructPMatrixNVars(R); - srestrict_data = hypre_CTAlloc(void *, nvars, HYPRE_MEMORY_HOST); - - for (vi = 0; vi < nvars; vi++) - { - R_s = hypre_SStructPMatrixSMatrix(R, vi, vi); - rc_s = hypre_SStructPVectorSVector(rc, vi); - 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); - } - - (sys_restrict_data -> nvars) = nvars; - (sys_restrict_data -> srestrict_data) = srestrict_data; - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_SysSemiRestrict( void *sys_restrict_vdata, - hypre_SStructPMatrix *R, - hypre_SStructPVector *r, - hypre_SStructPVector *rc ) -{ - hypre_SysSemiRestrictData *sys_restrict_data = (hypre_SysSemiRestrictData *)sys_restrict_vdata; - void **srestrict_data - = (sys_restrict_data -> srestrict_data); - HYPRE_Int nvars = (sys_restrict_data -> nvars); - - void *sdata; - hypre_StructMatrix *R_s; - hypre_StructVector *rc_s; - hypre_StructVector *r_s; - - HYPRE_Int vi; - - for (vi = 0; vi < nvars; vi++) - { - sdata = srestrict_data[vi]; - R_s = hypre_SStructPMatrixSMatrix(R, vi, vi); - rc_s = hypre_SStructPVectorSVector(rc, vi); - r_s = hypre_SStructPVectorSVector(r, vi); - hypre_SemiRestrict(sdata, R_s, r_s, rc_s); - } - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_SysSemiRestrictDestroy( void *sys_restrict_vdata ) -{ - hypre_SysSemiRestrictData *sys_restrict_data = (hypre_SysSemiRestrictData *)sys_restrict_vdata; - - HYPRE_Int nvars; - void **srestrict_data; - HYPRE_Int vi; - - if (sys_restrict_data) - { - nvars = (sys_restrict_data -> nvars); - srestrict_data = (sys_restrict_data -> srestrict_data); - for (vi = 0; vi < nvars; vi++) - { - if (srestrict_data[vi] != NULL) - { - hypre_SemiRestrictDestroy(srestrict_data[vi]); - } - } - hypre_TFree(srestrict_data, HYPRE_MEMORY_HOST); - hypre_TFree(sys_restrict_data, HYPRE_MEMORY_HOST); - } - - return hypre_error_flag; -} - diff --git a/src/sstruct_mv/CMakeLists.txt b/src/sstruct_mv/CMakeLists.txt index 3b674ab9c7..541cace177 100644 --- a/src/sstruct_mv/CMakeLists.txt +++ b/src/sstruct_mv/CMakeLists.txt @@ -8,7 +8,18 @@ set(HDRS _hypre_sstruct_mv.h ) -set(SRCS +# Add MUP headers when mixed precision is enabled +if(HYPRE_ENABLE_MIXED_PRECISION) + list(APPEND HDRS + HYPRE_sstruct_mv_mup.h + _hypre_sstruct_mv_mup.h + _hypre_sstruct_mv_mup_def.h + _hypre_sstruct_mv_mup_undef.h + ) +endif() + +# Regular sources +set(REGULAR_SRCS F90_HYPRE_sstruct_graph.c F90_HYPRE_sstruct_grid.c F90_HYPRE_sstruct_matrix.c @@ -24,18 +35,29 @@ set(SRCS sstruct_graph.c sstruct_grid.c sstruct_innerprod.c - sstruct_matrix.c sstruct_matvec.c + sstruct_matmult.c + sstruct_matop.c sstruct_scale.c sstruct_stencil.c + sstruct_matrix.c sstruct_vector.c ) -target_sources(${PROJECT_NAME} - PRIVATE ${SRCS} - ${HDRS} +# Mixed precision sources +set(MUP_SRCS + mup_fixed.c + mup_functions.c + mup_pre.c ) +if(HYPRE_ENABLE_MIXED_PRECISION) + setup_mixed_precision_compilation("sstruct_mv" SRCS "${REGULAR_SRCS}") + target_sources(${PROJECT_NAME} PRIVATE ${MUP_SRCS} ${HDRS}) +else() + target_sources(${PROJECT_NAME} PRIVATE ${REGULAR_SRCS} ${HDRS}) +endif() + if (HYPRE_USING_GPU) set(GPU_SRCS sstruct_matrix.c diff --git a/src/sstruct_mv/F90_HYPRE_sstruct_graph.c b/src/sstruct_mv/F90_HYPRE_sstruct_graph.c index ac229ddb8a..94f1501b4b 100644 --- a/src/sstruct_mv/F90_HYPRE_sstruct_graph.c +++ b/src/sstruct_mv/F90_HYPRE_sstruct_graph.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_sstruct_mv.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/sstruct_mv/F90_HYPRE_sstruct_grid.c b/src/sstruct_mv/F90_HYPRE_sstruct_grid.c index c1e19be99f..cf3ac7b934 100644 --- a/src/sstruct_mv/F90_HYPRE_sstruct_grid.c +++ b/src/sstruct_mv/F90_HYPRE_sstruct_grid.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_sstruct_mv.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/sstruct_mv/F90_HYPRE_sstruct_matrix.c b/src/sstruct_mv/F90_HYPRE_sstruct_matrix.c index a2fc9f8c4c..4b298da622 100644 --- a/src/sstruct_mv/F90_HYPRE_sstruct_matrix.c +++ b/src/sstruct_mv/F90_HYPRE_sstruct_matrix.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_sstruct_mv.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/sstruct_mv/F90_HYPRE_sstruct_stencil.c b/src/sstruct_mv/F90_HYPRE_sstruct_stencil.c index 51f30b0710..62c71152f9 100644 --- a/src/sstruct_mv/F90_HYPRE_sstruct_stencil.c +++ b/src/sstruct_mv/F90_HYPRE_sstruct_stencil.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_sstruct_mv.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/sstruct_mv/F90_HYPRE_sstruct_vector.c b/src/sstruct_mv/F90_HYPRE_sstruct_vector.c index f50bb2cf43..99f181e244 100644 --- a/src/sstruct_mv/F90_HYPRE_sstruct_vector.c +++ b/src/sstruct_mv/F90_HYPRE_sstruct_vector.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_sstruct_mv.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { @@ -329,9 +329,24 @@ hypre_F90_IFACE(hypre_sstructvectorscale, HYPRE_SSTRUCTVECTORSCALE) } /*-------------------------------------------------------------------------- - * HYPRE_SStructInnerProd + * HYPRE_SStructVectorInnerProd *--------------------------------------------------------------------------*/ +void +hypre_F90_IFACE(hypre_sstructvectorinnerprod, HYPRE_SSTRUCTVECTORINNERPROD) +(hypre_F90_Obj *x, + hypre_F90_Obj *y, + hypre_F90_Complex *result, + hypre_F90_Int *ierr) +{ + *ierr = (hypre_F90_Int) + (HYPRE_SStructVectorInnerProd( + hypre_F90_PassObj (HYPRE_SStructVector, x), + hypre_F90_PassObj (HYPRE_SStructVector, y), + hypre_F90_PassComplexRef (result) ) ); +} + +/* For backward compatibility */ void hypre_F90_IFACE(hypre_sstructinnerprod, HYPRE_SSTRUCTINNERPROD) (hypre_F90_Obj *x, @@ -347,9 +362,24 @@ hypre_F90_IFACE(hypre_sstructinnerprod, HYPRE_SSTRUCTINNERPROD) } /*-------------------------------------------------------------------------- - * HYPRE_SStructAxpy + * HYPRE_SStructVectorAxpy *--------------------------------------------------------------------------*/ +void +hypre_F90_IFACE(hypre_sstructvectoraxpy, HYPRE_SSTRUCTVECTORAXPY) +(hypre_F90_Complex *alpha, + hypre_F90_Obj *x, + hypre_F90_Obj *y, + hypre_F90_Int *ierr) +{ + *ierr = (hypre_F90_Int) + (HYPRE_SStructVectorAxpy( + hypre_F90_PassComplex (alpha), + hypre_F90_PassObj (HYPRE_SStructVector, x), + hypre_F90_PassObj (HYPRE_SStructVector, y) ) ); +} + +/* For backward compatibility */ void hypre_F90_IFACE(hypre_sstructaxpy, HYPRE_SSTRUCTAXPY) (hypre_F90_Complex *alpha, diff --git a/src/sstruct_mv/HYPRE_sstruct_graph.c b/src/sstruct_mv/HYPRE_sstruct_graph.c index 5691325e7d..47c31f7fdf 100644 --- a/src/sstruct_mv/HYPRE_sstruct_graph.c +++ b/src/sstruct_mv/HYPRE_sstruct_graph.c @@ -13,43 +13,56 @@ #include "_hypre_sstruct_mv.h" -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - HYPRE_Int HYPRE_SStructGraphCreate( MPI_Comm comm, HYPRE_SStructGrid grid, HYPRE_SStructGraph *graph_ptr ) { hypre_SStructGraph *graph; - HYPRE_Int nparts; + HYPRE_Int ndim = hypre_SStructGridNDim(grid); + HYPRE_Int nparts = hypre_SStructGridNParts(grid); + hypre_SStructStencil ***stencils; - hypre_SStructPGrid **pgrids; + hypre_SStructPGrid *pgrid; HYPRE_Int *fem_nsparse; HYPRE_Int **fem_sparse_i; HYPRE_Int **fem_sparse_j; HYPRE_Int **fem_entries; - HYPRE_Int nvars; - HYPRE_Int part, var; + hypre_Box ***Uvboxes; - graph = hypre_TAlloc(hypre_SStructGraph, 1, HYPRE_MEMORY_HOST); + HYPRE_Int d, part, var, nvars; + + /* Sanity check */ + if (!grid) + { + hypre_error_in_arg(2); + return hypre_error_flag; + } + + graph = hypre_TAlloc(hypre_SStructGraph, 1, HYPRE_MEMORY_HOST); hypre_SStructGraphComm(graph) = comm; - hypre_SStructGraphNDim(graph) = hypre_SStructGridNDim(grid); + hypre_SStructGraphNDim(graph) = ndim; hypre_SStructGridRef(grid, &hypre_SStructGraphGrid(graph)); - hypre_SStructGridRef(grid, &hypre_SStructGraphDomainGrid(graph)); - nparts = hypre_SStructGridNParts(grid); - hypre_SStructGraphNParts(graph) = nparts; - pgrids = hypre_SStructGridPGrids(grid); - stencils = hypre_TAlloc(hypre_SStructStencil **, nparts, HYPRE_MEMORY_HOST); - fem_nsparse = hypre_TAlloc(HYPRE_Int, nparts, HYPRE_MEMORY_HOST); - fem_sparse_i = hypre_TAlloc(HYPRE_Int *, nparts, HYPRE_MEMORY_HOST); - fem_sparse_j = hypre_TAlloc(HYPRE_Int *, nparts, HYPRE_MEMORY_HOST); - fem_entries = hypre_TAlloc(HYPRE_Int *, nparts, HYPRE_MEMORY_HOST); + hypre_SStructGridRef(grid, &hypre_SStructGraphDomGrid(graph)); + hypre_SStructGraphNParts(graph) = nparts; + + stencils = hypre_TAlloc(hypre_SStructStencil **, nparts, HYPRE_MEMORY_HOST); + fem_nsparse = hypre_TAlloc(HYPRE_Int, nparts, HYPRE_MEMORY_HOST); + fem_sparse_i = hypre_TAlloc(HYPRE_Int *, nparts, HYPRE_MEMORY_HOST); + fem_sparse_j = hypre_TAlloc(HYPRE_Int *, nparts, HYPRE_MEMORY_HOST); + fem_entries = hypre_TAlloc(HYPRE_Int *, nparts, HYPRE_MEMORY_HOST); + Uvboxes = hypre_TAlloc(hypre_Box **, nparts, HYPRE_MEMORY_HOST); for (part = 0; part < nparts; part++) { - nvars = hypre_SStructPGridNVars(pgrids[part]); - stencils[part] = hypre_TAlloc(hypre_SStructStencil *, nvars, HYPRE_MEMORY_HOST); + pgrid = hypre_SStructGraphPGrid(graph, part); + nvars = hypre_SStructPGridNVars(pgrid); + + /* Allocate pointers */ + stencils[part] = hypre_TAlloc(hypre_SStructStencil *, nvars, HYPRE_MEMORY_HOST); + Uvboxes[part] = hypre_TAlloc(hypre_Box *, nvars, HYPRE_MEMORY_HOST); + + /* Initialize pointers */ fem_nsparse[part] = 0; fem_sparse_i[part] = NULL; fem_sparse_j[part] = NULL; @@ -57,13 +70,24 @@ HYPRE_SStructGraphCreate( MPI_Comm comm, for (var = 0; var < nvars; var++) { stencils[part][var] = NULL; + Uvboxes[part][var] = hypre_BoxCreate(ndim); + for (d = 0; d < ndim; d++) + { + hypre_BoxIMinD(Uvboxes[part][var], d) = HYPRE_INT_MAX / 2; + hypre_BoxIMaxD(Uvboxes[part][var], d) = HYPRE_INT_MIN / 2; + } + for (d = ndim; d < HYPRE_MAXDIM; d++) + { + hypre_BoxIMinD(Uvboxes[part][var], d) = 0; + hypre_BoxIMaxD(Uvboxes[part][var], d) = 0; + } } } - hypre_SStructGraphStencils(graph) = stencils; - hypre_SStructGraphFEMNSparse(graph) = fem_nsparse; - hypre_SStructGraphFEMSparseJ(graph) = fem_sparse_i; - hypre_SStructGraphFEMSparseI(graph) = fem_sparse_j; - hypre_SStructGraphFEMEntries(graph) = fem_entries; + hypre_SStructGraphStencils(graph) = stencils; + hypre_SStructGraphFEMNSparse(graph) = fem_nsparse; + hypre_SStructGraphFEMSparseJ(graph) = fem_sparse_i; + hypre_SStructGraphFEMSparseI(graph) = fem_sparse_j; + hypre_SStructGraphFEMEntries(graph) = fem_entries; hypre_SStructGraphNUVEntries(graph) = 0; hypre_SStructGraphIUVEntries(graph) = NULL; @@ -71,6 +95,7 @@ HYPRE_SStructGraphCreate( MPI_Comm comm, hypre_SStructGraphUVESize(graph) = 0; hypre_SStructGraphUEMaxSize(graph) = 0; hypre_SStructGraphUVEOffsets(graph) = NULL; + hypre_SStructGraphUVBoxes(graph) = Uvboxes; hypre_SStructGraphRefCount(graph) = 1; hypre_SStructGraphObjectType(graph) = HYPRE_SSTRUCT; @@ -91,19 +116,20 @@ HYPRE_Int HYPRE_SStructGraphDestroy( HYPRE_SStructGraph graph ) { HYPRE_Int nparts; - hypre_SStructPGrid **pgrids; + HYPRE_Int nvars; + hypre_SStructPGrid *pgrid; 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_BigInt *iUventries; hypre_SStructUVEntry **Uventries; hypre_SStructUVEntry *Uventry; HYPRE_BigInt **Uveoffsets; + hypre_Box ***Uvboxes; hypre_SStructGraphEntry **graph_entries; - HYPRE_Int nvars; HYPRE_Int part, var, i; if (graph) @@ -111,37 +137,49 @@ HYPRE_SStructGraphDestroy( HYPRE_SStructGraph graph ) hypre_SStructGraphRefCount(graph) --; if (hypre_SStructGraphRefCount(graph) == 0) { - nparts = hypre_SStructGraphNParts(graph); - pgrids = hypre_SStructGraphPGrids(graph); - stencils = hypre_SStructGraphStencils(graph); + nparts = hypre_SStructGraphNParts(graph); + + /* FEM data */ fem_nsparse = hypre_SStructGraphFEMNSparse(graph); fem_sparse_i = hypre_SStructGraphFEMSparseJ(graph); fem_sparse_j = hypre_SStructGraphFEMSparseI(graph); fem_entries = hypre_SStructGraphFEMEntries(graph); + + /* S-graph data */ + stencils = hypre_SStructGraphStencils(graph); + + /* U-graph data */ nUventries = hypre_SStructGraphNUVEntries(graph); iUventries = hypre_SStructGraphIUVEntries(graph); Uventries = hypre_SStructGraphUVEntries(graph); Uveoffsets = hypre_SStructGraphUVEOffsets(graph); + Uvboxes = hypre_SStructGraphUVBoxes(graph); + for (part = 0; part < nparts; part++) { - nvars = hypre_SStructPGridNVars(pgrids[part]); + pgrid = hypre_SStructGraphPGrid(graph, part); + nvars = hypre_SStructPGridNVars(pgrid); + for (var = 0; var < nvars; var++) { HYPRE_SStructStencilDestroy(stencils[part][var]); + hypre_BoxDestroy(Uvboxes[part][var]); } hypre_TFree(stencils[part], HYPRE_MEMORY_HOST); hypre_TFree(fem_sparse_i[part], HYPRE_MEMORY_HOST); hypre_TFree(fem_sparse_j[part], HYPRE_MEMORY_HOST); hypre_TFree(fem_entries[part], HYPRE_MEMORY_HOST); hypre_TFree(Uveoffsets[part], HYPRE_MEMORY_HOST); + hypre_TFree(Uvboxes[part], HYPRE_MEMORY_HOST); } HYPRE_SStructGridDestroy(hypre_SStructGraphGrid(graph)); - HYPRE_SStructGridDestroy(hypre_SStructGraphDomainGrid(graph)); + HYPRE_SStructGridDestroy(hypre_SStructGraphDomGrid(graph)); hypre_TFree(stencils, HYPRE_MEMORY_HOST); hypre_TFree(fem_nsparse, HYPRE_MEMORY_HOST); hypre_TFree(fem_sparse_i, HYPRE_MEMORY_HOST); hypre_TFree(fem_sparse_j, HYPRE_MEMORY_HOST); hypre_TFree(fem_entries, HYPRE_MEMORY_HOST); + /* RDF: THREAD? */ for (i = 0; i < nUventries; i++) { @@ -156,6 +194,7 @@ HYPRE_SStructGraphDestroy( HYPRE_SStructGraph graph ) hypre_TFree(iUventries, HYPRE_MEMORY_HOST); hypre_TFree(Uventries, HYPRE_MEMORY_HOST); hypre_TFree(Uveoffsets, HYPRE_MEMORY_HOST); + hypre_TFree(Uvboxes, HYPRE_MEMORY_HOST); graph_entries = hypre_SStructGraphEntries(graph); for (i = 0; i < hypre_SStructNGraphEntries(graph); i++) { @@ -174,11 +213,11 @@ HYPRE_SStructGraphDestroy( HYPRE_SStructGraph graph ) HYPRE_Int HYPRE_SStructGraphSetDomainGrid( HYPRE_SStructGraph graph, - HYPRE_SStructGrid domain_grid) + HYPRE_SStructGrid dom_grid) { /* This should only decrement a reference counter */ - HYPRE_SStructGridDestroy(hypre_SStructGraphDomainGrid(graph)); - hypre_SStructGridRef(domain_grid, &hypre_SStructGraphDomainGrid(graph)); + HYPRE_SStructGridDestroy(hypre_SStructGraphDomGrid(graph)); + hypre_SStructGridRef(dom_grid, &hypre_SStructGraphDomGrid(graph)); return hypre_error_flag; } @@ -226,8 +265,8 @@ HYPRE_SStructGraphSetFEMSparsity( HYPRE_SStructGraph graph, HYPRE_Int s; hypre_SStructGraphFEMPNSparse(graph, part) = nsparse; - fem_sparse_i = hypre_TAlloc(HYPRE_Int, nsparse, HYPRE_MEMORY_HOST); - fem_sparse_j = hypre_TAlloc(HYPRE_Int, nsparse, HYPRE_MEMORY_HOST); + fem_sparse_i = hypre_TAlloc(HYPRE_Int, nsparse, HYPRE_MEMORY_HOST); + fem_sparse_j = hypre_TAlloc(HYPRE_Int, nsparse, HYPRE_MEMORY_HOST); for (s = 0; s < nsparse; s++) { fem_sparse_i[s] = sparsity[2 * s]; @@ -264,6 +303,8 @@ HYPRE_SStructGraphAddEntries( HYPRE_SStructGraph graph, HYPRE_Int n_entries = hypre_SStructNGraphEntries(graph); HYPRE_Int a_entries = hypre_SStructAGraphEntries(graph); + HYPRE_ANNOTATE_FUNC_BEGIN; + /* check storage */ if (!a_entries) { @@ -276,7 +317,7 @@ HYPRE_SStructGraphAddEntries( HYPRE_SStructGraph graph, else if (n_entries >= a_entries) { a_entries += 1000; - entries = hypre_TReAlloc(entries, hypre_SStructGraphEntry *, a_entries, HYPRE_MEMORY_HOST); + entries = hypre_TReAlloc(entries, hypre_SStructGraphEntry *, a_entries, HYPRE_MEMORY_HOST); hypre_SStructAGraphEntries(graph) = a_entries; hypre_SStructGraphEntries(graph) = entries; @@ -284,7 +325,7 @@ HYPRE_SStructGraphAddEntries( HYPRE_SStructGraph graph, /*save parameters to a new entry */ - new_entry = hypre_TAlloc(hypre_SStructGraphEntry, 1, HYPRE_MEMORY_HOST); + new_entry = hypre_TAlloc(hypre_SStructGraphEntry, 1, HYPRE_MEMORY_HOST); hypre_SStructGraphEntryPart(new_entry) = part; hypre_SStructGraphEntryToPart(new_entry) = to_part; @@ -302,6 +343,8 @@ HYPRE_SStructGraphAddEntries( HYPRE_SStructGraph graph, n_entries++; hypre_SStructNGraphEntries(graph) = n_entries; + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } @@ -317,24 +360,25 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) MPI_Comm comm = hypre_SStructGraphComm(graph); HYPRE_Int ndim = hypre_SStructGraphNDim(graph); hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); - hypre_SStructGrid *dom_grid = hypre_SStructGraphDomainGrid(graph); + hypre_SStructGrid *dom_grid = hypre_SStructGraphDomGrid(graph); HYPRE_Int nparts = hypre_SStructGraphNParts(graph); hypre_SStructStencil ***stencils = hypre_SStructGraphStencils(graph); + hypre_Box ***Uvboxes = hypre_SStructGraphUVBoxes(graph); + hypre_BoxManager ***managers = hypre_SStructGridBoxManagers(grid); HYPRE_Int nUventries; - HYPRE_Int *iUventries; + HYPRE_BigInt *iUventries; hypre_SStructUVEntry **Uventries; HYPRE_Int Uvesize; HYPRE_BigInt **Uveoffsets; - HYPRE_Int type = hypre_SStructGraphObjectType(graph); - hypre_SStructGraphEntry **add_entries = hypre_SStructGraphEntries(graph); + HYPRE_Int type = hypre_SStructGraphObjectType(graph); + hypre_SStructGraphEntry **add_entries = hypre_SStructGraphEntries(graph); HYPRE_Int n_add_entries = hypre_SStructNGraphEntries(graph); hypre_SStructPGrid *pgrid; hypre_StructGrid *sgrid; HYPRE_Int nvars; hypre_BoxArray *boxes; - hypre_Box *box; - HYPRE_Int vol, d; + hypre_Box *Uvbox; hypre_SStructGraphEntry *new_entry; hypre_SStructUVEntry *Uventry; @@ -351,10 +395,17 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) HYPRE_Int nprocs, myproc; HYPRE_Int part, var; hypre_IndexRef index; - HYPRE_Int i, j; + HYPRE_Int i, ii, j, d; + + hypre_Box *pbnd_box; + hypre_BoxArray *boxa; + hypre_BoxArray *pbnd_boxa; + hypre_BoxArrayArray *pbnd_boxaa; + HYPRE_Int **idxcnt; + HYPRE_Int **idxcap; + HYPRE_Int ****indices; /* may need to re-do box managers for the AP*/ - hypre_BoxManager ***managers = hypre_SStructGridBoxManagers(grid); hypre_BoxManager ***new_managers = NULL; hypre_BoxManager *orig_boxman; hypre_BoxManager *new_boxman; @@ -364,17 +415,19 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) hypre_BoxManEntry *all_entries, *entry; HYPRE_Int num_entries; + HYPRE_Int capacity; void *info; - hypre_Box *bbox, *new_box; - hypre_Box ***new_gboxes, *new_gbox; + hypre_Box *bbox, *new_box, *grow_box; HYPRE_Int *num_ghost; + HYPRE_ANNOTATE_FUNC_BEGIN; + /*--------------------------------------------------------- * If AP, then may need to redo the box managers * * Currently using bounding boxes based on the indexes in add_entries to * determine which boxes to gather in the box managers. We refer to these - * bounding boxes as "gather boxes" here (new_gboxes). This should work + * bounding boxes as "gather boxes" here (Uvboxes). This should work * well in most cases, but it does have the potential to cause lots of grid * boxes to be gathered (hence lots of communication). * @@ -387,7 +440,8 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) * are local, which is generally how they should be used). *---------------------------------------------------------*/ - new_box = hypre_BoxCreate(ndim); + new_box = hypre_BoxCreate(ndim); + grow_box = hypre_BoxCreate(ndim); /* if any processor has added entries, then all need to participate */ @@ -397,16 +451,14 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) if (global_n_add_entries > 0 ) { /* create new managers */ - new_managers = hypre_TAlloc(hypre_BoxManager **, nparts, HYPRE_MEMORY_HOST); - new_gboxes = hypre_TAlloc(hypre_Box **, nparts, HYPRE_MEMORY_HOST); + new_managers = hypre_TAlloc(hypre_BoxManager **, nparts, HYPRE_MEMORY_HOST); for (part = 0; part < nparts; part++) { 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); + new_managers[part] = hypre_TAlloc(hypre_BoxManager *, nvars, HYPRE_MEMORY_HOST); for (var = 0; var < nvars; var++) { @@ -420,11 +472,6 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) hypre_StructGridNDim(sgrid), bbox, hypre_StructGridComm(sgrid), &new_managers[part][var]); - /* create gather box with flipped bounding box extents */ - new_gboxes[part][var] = hypre_BoxCreate(ndim); - hypre_BoxSetExtents(new_gboxes[part][var], - hypre_BoxIMax(bbox), hypre_BoxIMin(bbox)); - /* need to set the num ghost for new manager also */ num_ghost = hypre_StructGridNumGhost(sgrid); @@ -443,13 +490,14 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) switch (k) { case 0: - part = hypre_SStructGraphEntryPart(new_entry); - var = hypre_SStructGraphEntryVar(new_entry); + part = hypre_SStructGraphEntryPart(new_entry); + var = hypre_SStructGraphEntryVar(new_entry); index = hypre_SStructGraphEntryIndex(new_entry); break; + case 1: - part = hypre_SStructGraphEntryToPart(new_entry) ; - var = hypre_SStructGraphEntryToVar(new_entry); + part = hypre_SStructGraphEntryToPart(new_entry); + var = hypre_SStructGraphEntryToVar(new_entry); index = hypre_SStructGraphEntryToIndex(new_entry); break; } @@ -457,21 +505,14 @@ 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); + bbox = hypre_BoxManBoundingBox(new_boxman); + Uvbox = Uvboxes[part][var]; - if (hypre_IndexInBox(index, bbox) != 0) + if (hypre_IndexInBox(index, bbox)) { /* compute new gather box extents based on index */ - for (d = 0; d < ndim; d++) - { - hypre_BoxIMinD(new_gbox, d) = - hypre_min(hypre_BoxIMinD(new_gbox, d), hypre_IndexD(index, d)); - hypre_BoxIMaxD(new_gbox, d) = - hypre_max(hypre_BoxIMaxD(new_gbox, d), hypre_IndexD(index, d)); - } + hypre_BoxSpanIndex(Uvbox, index); } } } @@ -487,13 +528,13 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) for (var = 0; var < nvars; var++) { new_boxman = new_managers[part][var]; - new_gbox = new_gboxes[part][var]; + Uvbox = Uvboxes[part][var]; /* call gather if non-empty gather box */ - if (hypre_BoxVolume(new_gbox) > 0) + if (hypre_BoxVolume(Uvbox) > 0) { hypre_BoxManGatherEntries( - new_boxman, hypre_BoxIMin(new_gbox), hypre_BoxIMax(new_gbox)); + new_boxman, hypre_BoxIMin(Uvbox), hypre_BoxIMax(Uvbox)); } /* check to see if gather was called by some processor */ @@ -535,20 +576,17 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) } else /* no gather called */ { - /*leave the old manager (so destroy the new one) */ + /* leave the old manager (so destroy the new one) */ hypre_BoxManDestroy(new_boxman); - /*copy the old to the new */ + /* 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); - hypre_TFree(new_gboxes[part], HYPRE_MEMORY_HOST); + } /* 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; @@ -569,12 +607,13 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) /* first set up Uvesize and Uveoffsets */ Uvesize = 0; - Uveoffsets = hypre_TAlloc(HYPRE_BigInt *, nparts, HYPRE_MEMORY_HOST); + Uveoffsets = hypre_TAlloc(HYPRE_BigInt *, nparts, HYPRE_MEMORY_HOST); for (part = 0; part < nparts; part++) { pgrid = hypre_SStructGridPGrid(grid, part); nvars = hypre_SStructPGridNVars(pgrid); - Uveoffsets[part] = hypre_TAlloc(HYPRE_BigInt, nvars, HYPRE_MEMORY_HOST); + + Uveoffsets[part] = hypre_TAlloc(HYPRE_BigInt, nvars, HYPRE_MEMORY_HOST); for (var = 0; var < nvars; var++) { Uveoffsets[part][var] = Uvesize; @@ -582,26 +621,42 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) boxes = hypre_StructGridBoxes(sgrid); hypre_ForBoxI(i, boxes) { - box = hypre_BoxArrayBox(boxes, i); - vol = 1; - for (d = 0; d < ndim; d++) - { - vol *= (hypre_BoxSizeD(box, d) + 2); - } - Uvesize += vol; + hypre_CopyBox(hypre_BoxArrayBox(boxes, i), grow_box); + hypre_BoxGrowByValue(grow_box, 1); + Uvesize += hypre_BoxVolume(grow_box); } } } hypre_SStructGraphUVESize(graph) = Uvesize; hypre_SStructGraphUVEOffsets(graph) = Uveoffsets; + hypre_BoxDestroy(grow_box); - /* now set up nUventries, iUventries, and Uventries */ + /* now set up indices, nUventries, iUventries, and Uventries */ + indices = hypre_TAlloc(HYPRE_Int ***, nparts, HYPRE_MEMORY_HOST); + idxcnt = hypre_TAlloc(HYPRE_Int *, nparts, HYPRE_MEMORY_HOST); + idxcap = hypre_TAlloc(HYPRE_Int *, nparts, HYPRE_MEMORY_HOST); + for (part = 0; part < nparts; part++) + { + pgrid = hypre_SStructGridPGrid(grid, part); + nvars = hypre_SStructPGridNVars(pgrid); - iUventries = hypre_TAlloc(HYPRE_Int, n_add_entries, HYPRE_MEMORY_HOST); - Uventries = hypre_CTAlloc(hypre_SStructUVEntry *, Uvesize, HYPRE_MEMORY_HOST); + indices[part] = hypre_TAlloc(HYPRE_Int **, nvars, HYPRE_MEMORY_HOST); + idxcnt[part] = hypre_CTAlloc(HYPRE_Int, nvars, HYPRE_MEMORY_HOST); + idxcap[part] = hypre_TAlloc(HYPRE_Int, nvars, HYPRE_MEMORY_HOST); + for (var = 0; var < nvars; var++) + { + indices[part][var] = hypre_TAlloc(HYPRE_Int *, ndim, HYPRE_MEMORY_HOST); + for (d = 0; d < ndim; d++) + { + indices[part][var][d] = hypre_CTAlloc(HYPRE_Int, n_add_entries, HYPRE_MEMORY_HOST); + } + idxcap[part][var] = n_add_entries; + } + } + iUventries = hypre_TAlloc(HYPRE_BigInt, n_add_entries, HYPRE_MEMORY_HOST); + Uventries = hypre_CTAlloc(hypre_SStructUVEntry *, Uvesize, HYPRE_MEMORY_HOST); hypre_SStructGraphIUVEntries(graph) = iUventries; hypre_SStructGraphUVEntries(graph) = Uventries; - nUventries = 0; /* go through each entry that was added */ @@ -609,13 +664,52 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) { 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); + 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); + /* Safety checks */ + hypre_assert((part >= 0) && (part < nparts)); + hypre_assert((to_part >= 0) && (to_part < nparts)); + + /* Ensure capacity before writing new indices */ + if (idxcnt[part][var] >= idxcap[part][var]) + { + capacity = hypre_max(2 * idxcap[part][var], 1); + for (d = 0; d < ndim; d++) + { + indices[part][var][d] = hypre_TReAlloc(indices[part][var][d], HYPRE_Int, + capacity, HYPRE_MEMORY_HOST); + } + idxcap[part][var] = capacity; + } + if (idxcnt[to_part][to_var] >= idxcap[to_part][to_var]) + { + capacity = hypre_max(2 * idxcap[to_part][to_var], 1); + for (d = 0; d < ndim; d++) + { + indices[to_part][to_var][d] = hypre_TReAlloc(indices[to_part][to_var][d], HYPRE_Int, + capacity, HYPRE_MEMORY_HOST); + } + idxcap[to_part][to_var] = capacity; + } + + /* Safety checks */ + hypre_assert(idxcap[part][var] > idxcnt[part][var]); + hypre_assert(idxcap[to_part][to_var] > idxcnt[to_part][to_var]); + + /* Build indices array */ + for (d = 0; d < ndim; d++) + { + indices[part][var][d][idxcnt[part][var]] = hypre_IndexD(index, d); + indices[to_part][to_var][d][idxcnt[to_part][to_var]] = hypre_IndexD(to_index, d); + } + idxcnt[part][var]++; + idxcnt[to_part][to_var]++; + /* compute location (rank) for Uventry */ hypre_SStructGraphGetUVEntryRank(graph, part, var, index, &Uverank); @@ -625,7 +719,7 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) if (Uventries[Uverank] == NULL) { - Uventry = hypre_TAlloc(hypre_SStructUVEntry, 1, HYPRE_MEMORY_HOST); + Uventry = hypre_TAlloc(hypre_SStructUVEntry, 1, HYPRE_MEMORY_HOST); hypre_SStructUVEntryPart(Uventry) = part; hypre_CopyIndex(index, hypre_SStructUVEntryIndex(Uventry)); hypre_SStructUVEntryVar(Uventry) = var; @@ -633,14 +727,14 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) hypre_SStructBoxManEntryGetGlobalRank(boxman_entry, index, &rank, type); hypre_SStructUVEntryRank(Uventry) = rank; nUentries = 1; - Uentries = hypre_TAlloc(hypre_SStructUEntry, nUentries, HYPRE_MEMORY_HOST); + Uentries = hypre_TAlloc(hypre_SStructUEntry, nUentries, HYPRE_MEMORY_HOST); } else { Uventry = Uventries[Uverank]; nUentries = hypre_SStructUVEntryNUEntries(Uventry) + 1; Uentries = hypre_SStructUVEntryUEntries(Uventry); - Uentries = hypre_TReAlloc(Uentries, hypre_SStructUEntry, nUentries, HYPRE_MEMORY_HOST); + Uentries = hypre_TReAlloc(Uentries, hypre_SStructUEntry, nUentries, HYPRE_MEMORY_HOST); } hypre_SStructUVEntryNUEntries(Uventry) = nUentries; hypre_SStructUVEntryUEntries(Uventry) = Uentries; @@ -652,8 +746,8 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) 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_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); @@ -671,6 +765,80 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) } } /* end of loop through add entries */ + /*--------------------------------------------------------- + * Set up part boundary data + *---------------------------------------------------------*/ + + /* Create part boundary boxes */ + pbnd_box = hypre_BoxCreate(ndim); + for (part = 0; part < nparts; part++) + { + pgrid = hypre_SStructGridPGrid(grid, part); + nvars = hypre_SStructPGridNVars(pgrid); + for (var = 0; var < nvars; var++) + { + sgrid = hypre_SStructPGridSGrid(pgrid, var); + boxes = hypre_StructGridBoxes(sgrid); + pbnd_boxaa = hypre_SStructPGridPBndBoxArrayArray(pgrid, var); + + /* Eliminate duplicate entries */ + hypre_UniqueIntArrayND(ndim, &idxcnt[part][var], indices[part][var]); + + /* Create array of boxes + Note: we use a threshold of 0.5 to facilitate the construction + of boxes when indices are distributed in "every other" fashion + for a given direction + */ + boxa = NULL; + hypre_BoxArrayCreateFromIndices(ndim, idxcnt[part][var], + indices[part][var], 0.5, &boxa); + + /* Intersect newly created BoxArray with grid boxes */ + if (boxa) + { + hypre_ForBoxI(i, boxes) + { + pbnd_boxa = hypre_BoxArrayArrayBoxArray(pbnd_boxaa, i); + hypre_ForBoxI(ii, boxa) + { + hypre_IntersectBoxes(hypre_BoxArrayBox(boxes, i), + hypre_BoxArrayBox(boxa, ii), + pbnd_box); + if (hypre_BoxVolume(pbnd_box) > 0) + { + hypre_AppendBox(pbnd_box, pbnd_boxa); + } + } + } + + /* Free memory */ + hypre_BoxArrayDestroy(boxa); + } + } + } + + /* Free memory */ + for (part = 0; part < nparts; part++) + { + pgrid = hypre_SStructGridPGrid(grid, part); + nvars = hypre_SStructPGridNVars(pgrid); + for (var = 0; var < nvars; var++) + { + for (d = 0; d < ndim; d++) + { + hypre_TFree(indices[part][var][d], HYPRE_MEMORY_HOST); + } + hypre_TFree(indices[part][var], HYPRE_MEMORY_HOST); + } + hypre_TFree(idxcnt[part], HYPRE_MEMORY_HOST); + hypre_TFree(idxcap[part], HYPRE_MEMORY_HOST); + hypre_TFree(indices[part], HYPRE_MEMORY_HOST); + } + hypre_TFree(idxcnt, HYPRE_MEMORY_HOST); + hypre_TFree(idxcap, HYPRE_MEMORY_HOST); + hypre_TFree(indices, HYPRE_MEMORY_HOST); + hypre_BoxDestroy(pbnd_box); + /*--------------------------------------------------------- * Set up the FEM stencil information *---------------------------------------------------------*/ @@ -693,14 +861,15 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) hypre_Index **stencil_offsets; HYPRE_Int **stencil_vars; - nvars = hypre_SStructPGridNVars(hypre_SStructGridPGrid(grid, part)); + pgrid = hypre_SStructGridPGrid(grid, part); + nvars = hypre_SStructPGridNVars(pgrid); /* build default full sparsity pattern if nothing set by user */ if (fem_nsparse < 0) { fem_nsparse = fem_nvars * fem_nvars; - fem_sparse_i = hypre_TAlloc(HYPRE_Int, fem_nsparse, HYPRE_MEMORY_HOST); - fem_sparse_j = hypre_TAlloc(HYPRE_Int, fem_nsparse, HYPRE_MEMORY_HOST); + fem_sparse_i = hypre_TAlloc(HYPRE_Int, fem_nsparse, HYPRE_MEMORY_HOST); + fem_sparse_j = hypre_TAlloc(HYPRE_Int, fem_nsparse, HYPRE_MEMORY_HOST); s = 0; for (i = 0; i < fem_nvars; i++) { @@ -716,16 +885,16 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) hypre_SStructGraphFEMPSparseJ(graph, part) = fem_sparse_j; } - fem_entries = hypre_CTAlloc(HYPRE_Int, fem_nsparse, HYPRE_MEMORY_HOST); + fem_entries = hypre_CTAlloc(HYPRE_Int, fem_nsparse, HYPRE_MEMORY_HOST); hypre_SStructGraphFEMPEntries(graph, part) = fem_entries; - stencil_sizes = hypre_CTAlloc(HYPRE_Int, nvars, HYPRE_MEMORY_HOST); - stencil_offsets = hypre_CTAlloc(hypre_Index *, nvars, HYPRE_MEMORY_HOST); - stencil_vars = hypre_CTAlloc(HYPRE_Int *, nvars, HYPRE_MEMORY_HOST); + stencil_sizes = hypre_CTAlloc(HYPRE_Int, nvars, HYPRE_MEMORY_HOST); + stencil_offsets = hypre_CTAlloc(hypre_Index *, nvars, HYPRE_MEMORY_HOST); + 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++) @@ -797,7 +966,7 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) if (nUventries > 1) { - hypre_qsort0(iUventries, 0, nUventries - 1); + hypre_BigQsort0(iUventries, 0, nUventries - 1); j = 1; for (i = 1; i < nUventries; i++) @@ -812,6 +981,8 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) hypre_SStructGraphNUVEntries(graph) = nUventries; } + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } @@ -932,6 +1103,9 @@ HYPRE_SStructGraphRead( FILE *file, } hypre_fscanf(file, "\n"); + /* Assemble graph */ + HYPRE_SStructGraphAssemble(graph); + *graph_ptr = graph; return hypre_error_flag; diff --git a/src/sstruct_mv/HYPRE_sstruct_grid.c b/src/sstruct_mv/HYPRE_sstruct_grid.c index 4a8bb82604..2a83d8b0ec 100644 --- a/src/sstruct_mv/HYPRE_sstruct_grid.c +++ b/src/sstruct_mv/HYPRE_sstruct_grid.c @@ -33,21 +33,22 @@ 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 i; - grid = hypre_TAlloc(hypre_SStructGrid, 1, HYPRE_MEMORY_HOST); + HYPRE_ANNOTATE_FUNC_BEGIN; + + grid = hypre_TAlloc(hypre_SStructGrid, 1, HYPRE_MEMORY_HOST); hypre_SStructGridComm(grid) = comm; hypre_SStructGridNDim(grid) = ndim; hypre_SStructGridNParts(grid) = nparts; - pgrids = hypre_TAlloc(hypre_SStructPGrid *, nparts, HYPRE_MEMORY_HOST); - nneighbors = hypre_TAlloc(HYPRE_Int, nparts, HYPRE_MEMORY_HOST); - neighbors = hypre_TAlloc(hypre_SStructNeighbor *, nparts, HYPRE_MEMORY_HOST); - nbor_offsets = hypre_TAlloc(hypre_Index *, nparts, HYPRE_MEMORY_HOST); - fem_nvars = hypre_TAlloc(HYPRE_Int, nparts, HYPRE_MEMORY_HOST); - fem_vars = hypre_TAlloc(HYPRE_Int *, nparts, HYPRE_MEMORY_HOST); - fem_offsets = hypre_TAlloc(hypre_Index *, nparts, HYPRE_MEMORY_HOST); + pgrids = hypre_TAlloc(hypre_SStructPGrid *, nparts, HYPRE_MEMORY_HOST); + nneighbors = hypre_TAlloc(HYPRE_Int, nparts, HYPRE_MEMORY_HOST); + neighbors = hypre_TAlloc(hypre_SStructNeighbor *, nparts, HYPRE_MEMORY_HOST); + nbor_offsets = hypre_TAlloc(hypre_Index *, nparts, HYPRE_MEMORY_HOST); + fem_nvars = hypre_TAlloc(HYPRE_Int, nparts, HYPRE_MEMORY_HOST); + fem_vars = hypre_TAlloc(HYPRE_Int *, nparts, HYPRE_MEMORY_HOST); + fem_offsets = hypre_TAlloc(hypre_Index *, nparts, HYPRE_MEMORY_HOST); for (i = 0; i < nparts; i++) { hypre_SStructPGridCreate(comm, ndim, &pgrid); @@ -59,15 +60,19 @@ HYPRE_SStructGridCreate( MPI_Comm comm, fem_vars[i] = NULL; fem_offsets[i] = NULL; } - hypre_SStructGridPGrids(grid) = pgrids; - hypre_SStructGridNNeighbors(grid) = nneighbors; - hypre_SStructGridNeighbors(grid) = neighbors; - hypre_SStructGridNborOffsets(grid) = nbor_offsets; - hypre_SStructGridNUCVars(grid) = 0; - hypre_SStructGridUCVars(grid) = NULL; - hypre_SStructGridFEMNVars(grid) = fem_nvars; - hypre_SStructGridFEMVars(grid) = fem_vars; - hypre_SStructGridFEMOffsets(grid) = fem_offsets; + hypre_SStructGridPGrids(grid) = pgrids; + hypre_SStructGridNNeighbors(grid) = nneighbors; + hypre_SStructGridNeighbors(grid) = neighbors; + hypre_SStructGridNborOffsets(grid) = nbor_offsets; + hypre_SStructGridNVNeighbors(grid) = NULL; + hypre_SStructGridVNeighbors(grid) = NULL; + hypre_SStructGridVNborCommInfo(grid) = NULL; + hypre_SStructGridVNborNComms(grid) = 0; + hypre_SStructGridNUCVars(grid) = 0; + hypre_SStructGridUCVars(grid) = NULL; + hypre_SStructGridFEMNVars(grid) = fem_nvars; + hypre_SStructGridFEMVars(grid) = fem_vars; + hypre_SStructGridFEMOffsets(grid) = fem_offsets; hypre_SStructGridBoxManagers(grid) = NULL; hypre_SStructGridNborBoxManagers(grid) = NULL; @@ -80,15 +85,10 @@ HYPRE_SStructGridCreate( MPI_Comm comm, /* GEC0902 ghost addition to the grid */ hypre_SStructGridGhlocalSize(grid) = 0; - /* Initialize num ghost */ - for (i = 0; i < 2 * ndim; i++) - { - num_ghost[i] = 1; - } - hypre_SStructGridSetNumGhost(grid, num_ghost); - *grid_ptr = grid; + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } @@ -105,8 +105,8 @@ HYPRE_SStructGridDestroy( HYPRE_SStructGrid grid ) hypre_Index **nbor_offsets; HYPRE_Int **nvneighbors; hypre_SStructNeighbor ***vneighbors; - hypre_SStructCommInfo **vnbor_comm_info; - HYPRE_Int vnbor_ncomms; + hypre_SStructCommInfo **vcomm_info; + HYPRE_Int vncomms; HYPRE_Int *fem_nvars; HYPRE_Int **fem_vars; hypre_Index **fem_offsets; @@ -120,20 +120,20 @@ HYPRE_SStructGridDestroy( HYPRE_SStructGrid grid ) hypre_SStructGridRefCount(grid) --; if (hypre_SStructGridRefCount(grid) == 0) { - nparts = hypre_SStructGridNParts(grid); - pgrids = hypre_SStructGridPGrids(grid); - nneighbors = hypre_SStructGridNNeighbors(grid); - neighbors = hypre_SStructGridNeighbors(grid); - nbor_offsets = hypre_SStructGridNborOffsets(grid); - nvneighbors = hypre_SStructGridNVNeighbors(grid); - vneighbors = hypre_SStructGridVNeighbors(grid); - vnbor_comm_info = hypre_SStructGridVNborCommInfo(grid); - vnbor_ncomms = hypre_SStructGridVNborNComms(grid); - fem_nvars = hypre_SStructGridFEMNVars(grid); - fem_vars = hypre_SStructGridFEMVars(grid); - fem_offsets = hypre_SStructGridFEMOffsets(grid); - managers = hypre_SStructGridBoxManagers(grid); - nbor_managers = hypre_SStructGridNborBoxManagers(grid); + nparts = hypre_SStructGridNParts(grid); + pgrids = hypre_SStructGridPGrids(grid); + nneighbors = hypre_SStructGridNNeighbors(grid); + neighbors = hypre_SStructGridNeighbors(grid); + nbor_offsets = hypre_SStructGridNborOffsets(grid); + nvneighbors = hypre_SStructGridNVNeighbors(grid); + vneighbors = hypre_SStructGridVNeighbors(grid); + vcomm_info = hypre_SStructGridVNborCommInfo(grid); + vncomms = hypre_SStructGridVNborNComms(grid); + fem_nvars = hypre_SStructGridFEMNVars(grid); + fem_vars = hypre_SStructGridFEMVars(grid); + fem_offsets = hypre_SStructGridFEMOffsets(grid); + managers = hypre_SStructGridBoxManagers(grid); + nbor_managers = hypre_SStructGridNborBoxManagers(grid); for (part = 0; part < nparts; part++) { @@ -154,13 +154,12 @@ HYPRE_SStructGridDestroy( HYPRE_SStructGrid grid ) hypre_TFree(managers[part], HYPRE_MEMORY_HOST); hypre_TFree(nbor_managers[part], HYPRE_MEMORY_HOST); } - for (i = 0; i < vnbor_ncomms; i++) + for (i = 0; i < vncomms; i++) { hypre_CommInfoDestroy( - hypre_SStructCommInfoCommInfo(vnbor_comm_info[i])); - hypre_TFree(vnbor_comm_info[i], HYPRE_MEMORY_HOST); + hypre_SStructCommInfoCommInfo(vcomm_info[i])); + hypre_TFree(vcomm_info[i], HYPRE_MEMORY_HOST); } - hypre_TFree(vnbor_comm_info, HYPRE_MEMORY_HOST); hypre_TFree(pgrids, HYPRE_MEMORY_HOST); hypre_TFree(nneighbors, HYPRE_MEMORY_HOST); hypre_TFree(neighbors, HYPRE_MEMORY_HOST); @@ -170,7 +169,7 @@ HYPRE_SStructGridDestroy( HYPRE_SStructGrid grid ) hypre_TFree(fem_offsets, HYPRE_MEMORY_HOST); hypre_TFree(nvneighbors, HYPRE_MEMORY_HOST); hypre_TFree(vneighbors, HYPRE_MEMORY_HOST); - hypre_TFree(vnbor_comm_info, HYPRE_MEMORY_HOST); + hypre_TFree(vcomm_info, HYPRE_MEMORY_HOST); hypre_TFree(managers, HYPRE_MEMORY_HOST); hypre_TFree(nbor_managers, HYPRE_MEMORY_HOST); hypre_TFree(grid, HYPRE_MEMORY_HOST); @@ -239,12 +238,12 @@ 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); } - ucvar = hypre_TAlloc(hypre_SStructUCVar, 1, HYPRE_MEMORY_HOST); - hypre_SStructUCVarUVars(ucvar) = hypre_TAlloc(hypre_SStructUVar, nvars, HYPRE_MEMORY_HOST); + ucvar = hypre_TAlloc(hypre_SStructUCVar, 1, HYPRE_MEMORY_HOST); + hypre_SStructUCVarUVars(ucvar) = hypre_TAlloc(hypre_SStructUVar, nvars, HYPRE_MEMORY_HOST); hypre_SStructUCVarPart(ucvar) = part; hypre_CopyToCleanIndex(index, ndim, hypre_SStructUCVarCell(ucvar)); hypre_SStructUCVarNUVars(ucvar) = nvars; @@ -306,7 +305,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++) { @@ -338,10 +337,10 @@ HYPRE_SStructGridSetFEMOrdering( HYPRE_SStructGrid grid, } } - 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); + 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++) { @@ -401,9 +400,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); } @@ -448,7 +447,7 @@ HYPRE_SStructGridSetNeighborPart( HYPRE_SStructGrid grid, hypre_IndexD(ilower_mapped, dd) = hypre_IndexD(nbor_iupper, dd); } } - for (d = ndim; d < ndim; d++) + for (d = ndim; d < HYPRE_MAXDIM; d++) { hypre_IndexD(coord, d) = d; hypre_IndexD(dir, d) = 1; @@ -494,9 +493,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); } @@ -608,10 +607,11 @@ HYPRE_SStructGridAssemble( HYPRE_SStructGrid grid ) HYPRE_Int part, var, b, vb, d, i, valid; HYPRE_Int nbor_part, sub_part; + HYPRE_ANNOTATE_FUNC_BEGIN; + /*------------------------------------------------------------- * if I own no data on some part, prune that part's neighbor info *-------------------------------------------------------------*/ - for (part = 0; part < nparts; part++) { pgrid = hypre_SStructGridPGrid(grid, part); @@ -662,6 +662,11 @@ HYPRE_SStructGridAssemble( HYPRE_SStructGrid grid ) hypre_SStructPGridAssemble(pgrids[part]); } + /*------------------------------------------------------------- + * Update global sizes of struct grids + *-------------------------------------------------------------*/ + hypre_SStructGridComputeGlobalSizes(grid); + /*------------------------------------------------------------- * re-organize u-variables to reference via local cell rank *-------------------------------------------------------------*/ @@ -707,23 +712,23 @@ HYPRE_SStructGridAssemble( HYPRE_SStructGrid grid ) box = hypre_BoxCreate(ndim); tmp_boxa = hypre_BoxArrayCreate(0, ndim); - nvneighbors = hypre_TAlloc(HYPRE_Int *, nparts, HYPRE_MEMORY_HOST); - vneighbors = hypre_TAlloc(hypre_SStructNeighbor **, nparts, HYPRE_MEMORY_HOST); + nvneighbors = hypre_TAlloc(HYPRE_Int *, nparts, HYPRE_MEMORY_HOST); + vneighbors = hypre_TAlloc(hypre_SStructNeighbor **, nparts, HYPRE_MEMORY_HOST); for (part = 0; part < nparts; part++) { pgrid = hypre_SStructGridPGrid(grid, part); nvars = hypre_SStructPGridNVars(pgrid); vartypes = hypre_SStructPGridVarTypes(pgrid); - nvneighbors[part] = hypre_TAlloc(HYPRE_Int, nvars, HYPRE_MEMORY_HOST); - vneighbors[part] = hypre_TAlloc(hypre_SStructNeighbor *, nvars, HYPRE_MEMORY_HOST); + nvneighbors[part] = hypre_TAlloc(HYPRE_Int, nvars, HYPRE_MEMORY_HOST); + vneighbors[part] = hypre_TAlloc(hypre_SStructNeighbor *, nvars, HYPRE_MEMORY_HOST); for (var = 0; var < nvars; var++) { /* Put each new vneighbor box into a BoxArrayArray so we can remove overlap */ nbor_boxes = hypre_BoxArrayArrayCreate(nneighbors[part], ndim); - fr_roots = hypre_TAlloc(hypre_Index, nneighbors[part], HYPRE_MEMORY_HOST); - to_roots = hypre_TAlloc(hypre_Index, nneighbors[part], HYPRE_MEMORY_HOST); + fr_roots = hypre_TAlloc(hypre_Index, nneighbors[part], HYPRE_MEMORY_HOST); + to_roots = hypre_TAlloc(hypre_Index, nneighbors[part], HYPRE_MEMORY_HOST); hypre_SStructVariableGetOffset((hypre_SStructVariable) vartypes[var], ndim, varoffset); nvneighbors[part][var] = 0; for (b = 0; b < nneighbors[part]; b++) @@ -791,7 +796,7 @@ HYPRE_SStructGridAssemble( HYPRE_SStructGrid grid ) } /* Set up vneighbors for this (part, var) */ - vneighbors[part][var] = hypre_TAlloc(hypre_SStructNeighbor, nvneighbors[part][var], + vneighbors[part][var] = hypre_TAlloc(hypre_SStructNeighbor, nvneighbors[part][var], HYPRE_MEMORY_HOST); vb = 0; for (b = 0; b < nneighbors[part]; b++) @@ -850,6 +855,8 @@ HYPRE_SStructGridAssemble( HYPRE_SStructGrid grid ) hypre_SStructGridCreateCommInfo(grid); + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } @@ -882,7 +889,84 @@ HYPRE_Int HYPRE_SStructGridSetNumGhost( HYPRE_SStructGrid grid, HYPRE_Int *num_ghost) { - hypre_SStructGridSetNumGhost(grid, num_ghost); + return (hypre_SStructGridSetNumGhost(grid, num_ghost)); +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridPrintGLVis( HYPRE_SStructGrid grid, + const char *meshprefix, + HYPRE_Real *trans, + HYPRE_Real *origin ) +{ + return (hypre_SStructGridPrintGLVis(grid, meshprefix, trans, origin)); +} + +/*--------------------------------------------------------------------------- + * HYPRE_SStructGridProjectBox + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridProjectBox(HYPRE_SStructGrid grid, + HYPRE_Int *ilower, + HYPRE_Int *iupper, + HYPRE_Int *origin, + HYPRE_Int *stride) +{ + hypre_Box *box; + + box = hypre_BoxCreate(hypre_SStructGridNDim(grid)); + hypre_CopyIndex(ilower, hypre_BoxIMin(box)); + hypre_CopyIndex(iupper, hypre_BoxIMax(box)); + hypre_ProjectBox(box, origin, stride); + hypre_CopyIndex(hypre_BoxIMin(box), ilower); + hypre_CopyIndex(hypre_BoxIMax(box), iupper); + hypre_BoxDestroy(box); + + return hypre_error_flag; +} + +/*--------------------------------------------------------------------------- + * HYPRE_SStructGridCoarsen + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridCoarsen( HYPRE_SStructGrid fgrid, + HYPRE_Index *strides, + HYPRE_SStructGrid *cgrid ) +{ + hypre_Index origin; + + hypre_SetIndex(origin, 0); + hypre_SStructGridCoarsen(fgrid, origin, strides, NULL, cgrid); + + return hypre_error_flag; +} + +/*--------------------------------------------------------------------------- + * HYPRE_SStructGridGetVariableBox + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridGetVariableBox(HYPRE_SStructGrid grid, + HYPRE_Int part, + HYPRE_Int var, + HYPRE_Int *cell_ilower, + HYPRE_Int *cell_iupper, + HYPRE_Int *var_ilower, + HYPRE_Int *var_iupper ) +{ + HYPRE_Int ndim = hypre_SStructGridNDim(grid); + hypre_SStructPGrid *pgrid = hypre_SStructGridPGrid(grid, part); + HYPRE_SStructVariable vartype = hypre_SStructPGridVarType(pgrid, var); + + hypre_Index varoffset; + + hypre_SStructVariableGetOffset(vartype, ndim, varoffset); + hypre_SubtractIndexes(cell_ilower, varoffset, ndim, var_ilower); + hypre_SubtractIndexes(cell_iupper, varoffset, ndim, var_iupper); return hypre_error_flag; } diff --git a/src/sstruct_mv/HYPRE_sstruct_matrix.c b/src/sstruct_mv/HYPRE_sstruct_matrix.c index 9533367455..707b6566ee 100644 --- a/src/sstruct_mv/HYPRE_sstruct_matrix.c +++ b/src/sstruct_mv/HYPRE_sstruct_matrix.c @@ -21,13 +21,18 @@ HYPRE_SStructMatrixCreate( MPI_Comm comm, HYPRE_SStructGraph graph, HYPRE_SStructMatrix *matrix_ptr ) { + hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); hypre_SStructStencil ***stencils = hypre_SStructGraphStencils(graph); + HYPRE_Int nparts = hypre_SStructGraphNParts(graph); hypre_SStructMatrix *matrix; - HYPRE_Int ***splits; - HYPRE_Int nparts; hypre_SStructPMatrix **pmatrices; + HYPRE_Int ***splits; HYPRE_Int ***symmetric; + HYPRE_Int ***num_centries; + HYPRE_Int ****centries; + hypre_Index *dom_stride; + hypre_Index *ran_stride; hypre_SStructPGrid *pgrid; HYPRE_Int nvars; @@ -38,109 +43,119 @@ HYPRE_SStructMatrixCreate( MPI_Comm comm, HYPRE_SStructVariable vitype, vjtype; HYPRE_Int part, vi, vj, i; - HYPRE_Int size, rectangular; + HYPRE_Int size, usize; + + /* Sanity check */ + if (!graph) + { + hypre_error_in_arg(2); + return hypre_error_flag; + } - matrix = hypre_TAlloc(hypre_SStructMatrix, 1, HYPRE_MEMORY_HOST); + matrix = hypre_TAlloc(hypre_SStructMatrix, 1, HYPRE_MEMORY_HOST); hypre_SStructMatrixComm(matrix) = comm; hypre_SStructMatrixNDim(matrix) = hypre_SStructGraphNDim(graph); hypre_SStructGraphRef(graph, &hypre_SStructMatrixGraph(matrix)); /* compute S/U-matrix split */ - nparts = hypre_SStructGraphNParts(graph); hypre_SStructMatrixNParts(matrix) = nparts; - splits = hypre_TAlloc(HYPRE_Int **, nparts, HYPRE_MEMORY_HOST); + splits = hypre_TAlloc(HYPRE_Int **, nparts, HYPRE_MEMORY_HOST); hypre_SStructMatrixSplits(matrix) = splits; - pmatrices = hypre_TAlloc(hypre_SStructPMatrix *, nparts, HYPRE_MEMORY_HOST); + pmatrices = hypre_TAlloc(hypre_SStructPMatrix *, nparts, HYPRE_MEMORY_HOST); hypre_SStructMatrixPMatrices(matrix) = pmatrices; - symmetric = hypre_TAlloc(HYPRE_Int **, nparts, HYPRE_MEMORY_HOST); + symmetric = hypre_TAlloc(HYPRE_Int **, nparts, HYPRE_MEMORY_HOST); hypre_SStructMatrixSymmetric(matrix) = symmetric; - /* is this a rectangular matrix? */ - rectangular = 0; - if (hypre_SStructGraphGrid(graph) != hypre_SStructGraphDomainGrid(graph)) - { - rectangular = 1; - } + num_centries = hypre_TAlloc(HYPRE_Int **, nparts, HYPRE_MEMORY_HOST); + hypre_SStructMatrixNumCEntries(matrix) = num_centries; + centries = hypre_TAlloc(HYPRE_Int ***, nparts, HYPRE_MEMORY_HOST); + hypre_SStructMatrixCEntries(matrix) = centries; + dom_stride = hypre_TAlloc(hypre_Index, nparts, HYPRE_MEMORY_HOST); + hypre_SStructMatrixDomainStride(matrix) = dom_stride; + ran_stride = hypre_TAlloc(hypre_Index, nparts, HYPRE_MEMORY_HOST); + hypre_SStructMatrixRangeStride(matrix) = ran_stride; + + size = 0; for (part = 0; part < nparts; part++) { - pgrid = hypre_SStructGraphPGrid(graph, part); - nvars = hypre_SStructPGridNVars(pgrid); - splits[part] = hypre_TAlloc(HYPRE_Int *, nvars, HYPRE_MEMORY_HOST); - symmetric[part] = hypre_TAlloc(HYPRE_Int *, nvars, HYPRE_MEMORY_HOST); + pgrid = hypre_SStructGridPGrid(grid, part); + nvars = hypre_SStructPGridNVars(pgrid); + splits[part] = hypre_TAlloc(HYPRE_Int *, nvars, HYPRE_MEMORY_HOST); + symmetric[part] = hypre_TAlloc(HYPRE_Int *, nvars, HYPRE_MEMORY_HOST); + num_centries[part] = hypre_TAlloc(HYPRE_Int *, nvars, HYPRE_MEMORY_HOST); + centries[part] = hypre_TAlloc(HYPRE_Int **, nvars, HYPRE_MEMORY_HOST); + for (vi = 0; vi < nvars; vi++) { - stencil_size = hypre_SStructStencilSize(stencils[part][vi]); - stencil_vars = hypre_SStructStencilVars(stencils[part][vi]); - pstencil_size = 0; - splits[part][vi] = hypre_TAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); - symmetric[part][vi] = hypre_TAlloc(HYPRE_Int, nvars, HYPRE_MEMORY_HOST); + pstencil_size = 0; + stencil_size = hypre_SStructStencilSize(stencils[part][vi]); + stencil_vars = hypre_SStructStencilVars(stencils[part][vi]); + splits[part][vi] = hypre_TAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); + symmetric[part][vi] = hypre_TAlloc(HYPRE_Int, nvars, HYPRE_MEMORY_HOST); + num_centries[part][vi] = hypre_TAlloc(HYPRE_Int, nvars, HYPRE_MEMORY_HOST); + centries[part][vi] = hypre_TAlloc(HYPRE_Int *, nvars, HYPRE_MEMORY_HOST); + + size = hypre_max(size, stencil_size); + for (i = 0; i < stencil_size; i++) { - /* for rectangular matrices, put all coefficients in U-matrix */ - if (rectangular) + vj = stencil_vars[i]; + vitype = hypre_SStructPGridVarType(pgrid, vi); + vjtype = hypre_SStructPGridVarType(pgrid, vj); + if (vjtype == vitype) { - splits[part][vi][i] = -1; + splits[part][vi][i] = pstencil_size; + pstencil_size++; } else { - vj = stencil_vars[i]; - vitype = hypre_SStructPGridVarType(pgrid, vi); - vjtype = hypre_SStructPGridVarType(pgrid, vj); - if (vjtype == vitype) - { - splits[part][vi][i] = pstencil_size; - pstencil_size++; - } - else - { - splits[part][vi][i] = -1; - } + splits[part][vi][i] = -1; } } + for (vj = 0; vj < nvars; vj++) { - symmetric[part][vi][vj] = 0; + symmetric[part][vi][vj] = 0; + num_centries[part][vi][vj] = 0; } + + hypre_SetIndex(dom_stride[part], 1); + hypre_SetIndex(ran_stride[part], 1); } } + usize = size + hypre_SStructGraphUEMaxSize(graph); - /* GEC0902 move the IJ creation to the initialization phase - * ilower = hypre_SStructGridGhstartRank(grid); - * iupper = ilower + hypre_SStructGridGhlocalSize(grid) - 1; - * HYPRE_IJMatrixCreate(comm, ilower, iupper, ilower, iupper, - * &hypre_SStructMatrixIJMatrix(matrix)); */ - - hypre_SStructMatrixIJMatrix(matrix) = NULL; - hypre_SStructMatrixParCSRMatrix(matrix) = NULL; - - size = 0; for (part = 0; part < nparts; part++) { - pgrid = hypre_SStructGraphPGrid(graph, part); + pgrid = hypre_SStructGridPGrid(grid, part); nvars = hypre_SStructPGridNVars(pgrid); + for (vi = 0; vi < nvars; vi++) { - size = hypre_max(size, hypre_SStructStencilSize(stencils[part][vi])); + for (vj = 0; vj < nvars; vj++) + { + centries[part][vi][vj] = hypre_CTAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); + } } } - hypre_SStructMatrixSEntries(matrix) = hypre_TAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); - size += hypre_SStructGraphUEMaxSize(graph); - hypre_SStructMatrixUEntries(matrix) = hypre_TAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); - hypre_SStructMatrixEntriesSize(matrix) = size; - hypre_SStructMatrixTmpRowCoords(matrix) = NULL; - hypre_SStructMatrixTmpColCoords(matrix) = NULL; - hypre_SStructMatrixTmpCoeffs(matrix) = NULL; + + hypre_SStructMatrixIJMatrix(matrix) = NULL; + hypre_SStructMatrixParCSRMatrix(matrix) = NULL; + hypre_SStructMatrixSEntries(matrix) = hypre_TAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); + hypre_SStructMatrixUEntries(matrix) = hypre_TAlloc(HYPRE_Int, usize, HYPRE_MEMORY_HOST); + hypre_SStructMatrixEntriesSize(matrix) = usize; + hypre_SStructMatrixTmpRowCoords(matrix) = NULL; + hypre_SStructMatrixTmpColCoords(matrix) = NULL; + hypre_SStructMatrixTmpCoeffs(matrix) = NULL; hypre_SStructMatrixTmpRowCoordsDevice(matrix) = NULL; hypre_SStructMatrixTmpColCoordsDevice(matrix) = NULL; hypre_SStructMatrixTmpCoeffsDevice(matrix) = NULL; - - hypre_SStructMatrixNSSymmetric(matrix) = 0; - hypre_SStructMatrixGlobalSize(matrix) = 0; - hypre_SStructMatrixRefCount(matrix) = 1; + hypre_SStructMatrixNSSymmetric(matrix) = 0; + hypre_SStructMatrixGlobalSize(matrix) = 0; + hypre_SStructMatrixRefCount(matrix) = 1; /* GEC0902 setting the default of the object_type to HYPRE_SSTRUCT */ - - hypre_SStructMatrixObjectType(matrix) = HYPRE_SSTRUCT; + hypre_SStructMatrixObjectType(matrix) = HYPRE_SSTRUCT; *matrix_ptr = matrix; @@ -158,49 +173,82 @@ HYPRE_SStructMatrixDestroy( HYPRE_SStructMatrix matrix ) HYPRE_Int nparts; hypre_SStructPMatrix **pmatrices; HYPRE_Int ***symmetric; - hypre_SStructPGrid *pgrid; - HYPRE_Int nvars; - HYPRE_Int part, var; + HYPRE_Int ***num_centries; + HYPRE_Int ****centries; + hypre_Index *dom_stride; + hypre_Index *ran_stride; +#if defined(HYPRE_USING_GPU) HYPRE_MemoryLocation memory_location; +#endif + + HYPRE_Int nvars; + HYPRE_Int part, vi, vj; if (matrix) { - memory_location = hypre_SStructMatrixMemoryLocation(matrix); - hypre_SStructMatrixRefCount(matrix) --; if (hypre_SStructMatrixRefCount(matrix) == 0) { - graph = hypre_SStructMatrixGraph(matrix); - splits = hypre_SStructMatrixSplits(matrix); - nparts = hypre_SStructMatrixNParts(matrix); - pmatrices = hypre_SStructMatrixPMatrices(matrix); - symmetric = hypre_SStructMatrixSymmetric(matrix); + graph = hypre_SStructMatrixGraph(matrix); + splits = hypre_SStructMatrixSplits(matrix); + nparts = hypre_SStructMatrixNParts(matrix); + pmatrices = hypre_SStructMatrixPMatrices(matrix); + symmetric = hypre_SStructMatrixSymmetric(matrix); + num_centries = hypre_SStructMatrixNumCEntries(matrix); + centries = hypre_SStructMatrixCEntries(matrix); + dom_stride = hypre_SStructMatrixDomainStride(matrix); + ran_stride = hypre_SStructMatrixRangeStride(matrix); +#if defined(HYPRE_USING_GPU) + memory_location = hypre_SStructMatrixMemoryLocation(matrix); +#endif + for (part = 0; part < nparts; part++) { - pgrid = hypre_SStructGraphPGrid(graph, part); - nvars = hypre_SStructPGridNVars(pgrid); - for (var = 0; var < nvars; var++) + nvars = hypre_SStructPMatrixNVars(pmatrices[part]); + for (vi = 0; vi < nvars; vi++) { - hypre_TFree(splits[part][var], HYPRE_MEMORY_HOST); - hypre_TFree(symmetric[part][var], HYPRE_MEMORY_HOST); + for (vj = 0; vj < nvars; vj++) + { + hypre_TFree(centries[part][vi][vj], HYPRE_MEMORY_HOST); + } + hypre_TFree(splits[part][vi], HYPRE_MEMORY_HOST); + hypre_TFree(symmetric[part][vi], HYPRE_MEMORY_HOST); + hypre_TFree(num_centries[part][vi], HYPRE_MEMORY_HOST); + hypre_TFree(centries[part][vi], HYPRE_MEMORY_HOST); } hypre_TFree(splits[part], HYPRE_MEMORY_HOST); hypre_TFree(symmetric[part], HYPRE_MEMORY_HOST); + hypre_TFree(num_centries[part], HYPRE_MEMORY_HOST); + hypre_TFree(centries[part], HYPRE_MEMORY_HOST); hypre_SStructPMatrixDestroy(pmatrices[part]); } HYPRE_SStructGraphDestroy(graph); + hypre_TFree(splits, HYPRE_MEMORY_HOST); hypre_TFree(pmatrices, HYPRE_MEMORY_HOST); hypre_TFree(symmetric, HYPRE_MEMORY_HOST); - HYPRE_IJMatrixDestroy(hypre_SStructMatrixIJMatrix(matrix)); + hypre_TFree(num_centries, HYPRE_MEMORY_HOST); + hypre_TFree(centries, HYPRE_MEMORY_HOST); + hypre_TFree(dom_stride, HYPRE_MEMORY_HOST); + hypre_TFree(ran_stride, HYPRE_MEMORY_HOST); hypre_TFree(hypre_SStructMatrixSEntries(matrix), HYPRE_MEMORY_HOST); 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), memory_location); - hypre_TFree(hypre_SStructMatrixTmpColCoordsDevice(matrix), memory_location); - hypre_TFree(hypre_SStructMatrixTmpCoeffsDevice(matrix), memory_location); +#if defined(HYPRE_USING_GPU) + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) + { + hypre_TFree(hypre_SStructMatrixTmpRowCoordsDevice(matrix), + HYPRE_MEMORY_DEVICE); + hypre_TFree(hypre_SStructMatrixTmpColCoordsDevice(matrix), + HYPRE_MEMORY_DEVICE); + hypre_TFree(hypre_SStructMatrixTmpCoeffsDevice(matrix), + HYPRE_MEMORY_DEVICE); + } +#endif + HYPRE_IJMatrixDestroy(hypre_SStructMatrixIJMatrix(matrix)); + hypre_TFree(matrix, HYPRE_MEMORY_HOST); } } @@ -214,15 +262,24 @@ HYPRE_SStructMatrixDestroy( HYPRE_SStructMatrix matrix ) HYPRE_Int HYPRE_SStructMatrixInitialize( HYPRE_SStructMatrix matrix ) { - HYPRE_Int nparts = hypre_SStructMatrixNParts(matrix); - hypre_SStructGraph *graph = hypre_SStructMatrixGraph(matrix); - hypre_SStructPMatrix **pmatrices = hypre_SStructMatrixPMatrices(matrix); - HYPRE_Int ***symmetric = hypre_SStructMatrixSymmetric(matrix); - hypre_SStructStencil ***stencils = hypre_SStructGraphStencils(graph); + MPI_Comm comm = hypre_SStructMatrixComm(matrix); + HYPRE_Int ndim = hypre_SStructMatrixNDim(matrix); + HYPRE_Int nparts = hypre_SStructMatrixNParts(matrix); + hypre_SStructPMatrix **pmatrices = hypre_SStructMatrixPMatrices(matrix); + HYPRE_Int ***symmetric = hypre_SStructMatrixSymmetric(matrix); + HYPRE_Int ***num_centries = hypre_SStructMatrixNumCEntries(matrix); + HYPRE_Int ****centries = hypre_SStructMatrixCEntries(matrix); + HYPRE_Int matrix_type = hypre_SStructMatrixObjectType(matrix); + hypre_Index *dom_stride = hypre_SStructMatrixDomainStride(matrix); + hypre_Index *ran_stride = hypre_SStructMatrixRangeStride(matrix); + hypre_SStructGraph *graph = hypre_SStructMatrixGraph(matrix); + hypre_SStructStencil ***stencils = hypre_SStructGraphStencils(graph); + hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); + HYPRE_Int *split; - MPI_Comm pcomm; hypre_SStructPGrid *pgrid; + hypre_StructGrid *sgrid; hypre_SStructStencil **pstencils; HYPRE_Int nvars; @@ -232,20 +289,21 @@ HYPRE_SStructMatrixInitialize( HYPRE_SStructMatrix matrix ) HYPRE_Int pstencil_ndim; HYPRE_Int pstencil_size; - HYPRE_Int part, var, i; + HYPRE_Int part, var, i, vi, vj; - /* GEC0902 addition of variables for ilower and iupper */ - MPI_Comm comm; - hypre_SStructGrid *grid, *domain_grid; + hypre_BoxArray *boxes; + hypre_Box *box; + HYPRE_Int *num_ghost; + HYPRE_BigInt nrows, ncols; HYPRE_BigInt ilower, iupper, jlower, jupper; - HYPRE_Int matrix_type = hypre_SStructMatrixObjectType(matrix); /* S-matrix */ for (part = 0; part < nparts; part++) { - pgrid = hypre_SStructGraphPGrid(graph, part); + pgrid = hypre_SStructGridPGrid(grid, part); nvars = hypre_SStructPGridNVars(pgrid); - pstencils = hypre_TAlloc(hypre_SStructStencil *, nvars, HYPRE_MEMORY_HOST); + pstencils = hypre_TAlloc(hypre_SStructStencil *, nvars, HYPRE_MEMORY_HOST); + for (var = 0; var < nvars; var++) { split = hypre_SStructMatrixSplit(matrix, part, var); @@ -273,16 +331,24 @@ HYPRE_SStructMatrixInitialize( HYPRE_SStructMatrix matrix ) } } } - pcomm = hypre_SStructPGridComm(pgrid); - hypre_SStructPMatrixCreate(pcomm, pgrid, pstencils, &pmatrices[part]); - for (var = 0; var < nvars; var++) + comm = hypre_SStructPGridComm(pgrid); + hypre_SStructPMatrixCreate(comm, pgrid, pstencils, &pmatrices[part]); + for (vi = 0; vi < nvars; vi++) { - for (i = 0; i < nvars; i++) + for (vj = 0; vj < nvars; vj++) { - hypre_SStructPMatrixSetSymmetric(pmatrices[part], var, i, - symmetric[part][var][i]); + hypre_SStructPMatrixSetSymmetric(pmatrices[part], + vi, vj, + symmetric[part][vj][vj]); + hypre_SStructPMatrixSetCEntries(pmatrices[part], + vi, vj, + num_centries[part][vi][vj], + centries[part][vi][vj]); } } + + hypre_SStructPMatrixSetDomainStride(pmatrices[part], dom_stride[part]); + hypre_SStructPMatrixSetRangeStride(pmatrices[part], ran_stride[part]); hypre_SStructPMatrixInitialize(pmatrices[part]); } @@ -291,23 +357,81 @@ HYPRE_SStructMatrixInitialize( HYPRE_SStructMatrix matrix ) /* GEC0902 knowing the kind of matrix we can create the IJMATRIX with the * the right dimension (HYPRE_PARCSR without ghosts) */ - grid = hypre_SStructGraphGrid(graph); - domain_grid = hypre_SStructGraphDomainGrid(graph); - comm = hypre_SStructMatrixComm(matrix); - + // TODO: Move this to assemble? + ilower = iupper = 0; + jlower = jupper = 0; + nrows = ncols = 0; + box = hypre_BoxCreate(ndim); 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; + hypre_SStructGrid *dom_grid = hypre_SStructGraphDomGrid(graph); + + nrows = hypre_SStructGridLocalSize(grid); + ncols = hypre_SStructGridLocalSize(dom_grid); + +#if 0 + // RDF: The following assumes a single base grid, which is what we want. + // However, the current code does not fully support the base grid idea. + // The above code allows full rectangular matrix support in the pure + // HYPRE_PARCSR setting (which is needed, for example, to build the + // gradient matrix in AMS). + for (part = 0; part < nparts; part++) + { + pgrid = hypre_SStructGridPGrid(grid, part); + nvars = hypre_SStructPGridNVars(pgrid); + for (var = 0; var < nvars; var++) + { + sgrid = hypre_SStructPGridSGrid(pgrid, var); + boxes = hypre_StructGridBoxes(sgrid); + hypre_ForBoxI(i, boxes) + { + /* Range grid (rows) */ + hypre_CopyBox(hypre_BoxArrayBox(boxes, i), box); + hypre_CoarsenBox(box, NULL, ran_stride[part]); + nrows += hypre_BoxVolume(box); + + /* Domain grid (cols) */ + hypre_CopyBox(hypre_BoxArrayBox(boxes, i), box); + hypre_CoarsenBox(box, NULL, dom_stride[part]); + ncols += hypre_BoxVolume(box); + } + } + } +#endif } 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; + for (part = 0; part < nparts; part++) + { + pgrid = hypre_SStructGridPGrid(grid, part); + nvars = hypre_SStructPGridNVars(pgrid); + for (var = 0; var < nvars; var++) + { + sgrid = hypre_SStructPGridSGrid(pgrid, var); + boxes = hypre_StructGridBoxes(sgrid); + num_ghost = hypre_StructGridNumGhost(sgrid); + hypre_ForBoxI(i, boxes) + { + /* Range grid (rows) */ + hypre_CopyBox(hypre_BoxArrayBox(boxes, i), box); + hypre_CoarsenBox(box, NULL, ran_stride[part]); + if (hypre_BoxVolume(box)) + { + hypre_BoxGrowByArray(box, num_ghost); + nrows += hypre_BoxVolume(box); + } + + /* Domain grid (columns) */ + hypre_CopyBox(hypre_BoxArrayBox(boxes, i), box); + hypre_CoarsenBox(box, NULL, dom_stride[part]); + if (hypre_BoxVolume(box)) + { + hypre_BoxGrowByArray(box, num_ghost); + ncols += hypre_BoxVolume(box); + } + } + } + } } else { @@ -315,14 +439,23 @@ HYPRE_SStructMatrixInitialize( HYPRE_SStructMatrix matrix ) return hypre_error_flag; } + hypre_BoxDestroy(box); + hypre_MPI_Scan(&nrows, &iupper, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + hypre_MPI_Scan(&ncols, &jupper, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + + ilower = iupper - nrows; + jlower = jupper - ncols; + iupper--; jupper--; HYPRE_IJMatrixCreate(comm, ilower, iupper, jlower, jupper, &hypre_SStructMatrixIJMatrix(matrix)); - - hypre_SStructUMatrixInitialize(matrix); + hypre_SStructUMatrixInitialize(matrix, hypre_HandleMemoryLocation(hypre_handle())); return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + HYPRE_Int HYPRE_SStructMatrixSetEarlyAssemble( HYPRE_SStructMatrix matrix, HYPRE_Int early_assemble ) @@ -713,24 +846,27 @@ HYPRE_SStructMatrixAddFEMBoxValues(HYPRE_SStructMatrix matrix, HYPRE_Int HYPRE_SStructMatrixAssemble( HYPRE_SStructMatrix matrix ) { - HYPRE_Int ndim = hypre_SStructMatrixNDim(matrix); - hypre_SStructGraph *graph = hypre_SStructMatrixGraph(matrix); - HYPRE_Int nparts = hypre_SStructMatrixNParts(matrix); - hypre_SStructPMatrix **pmatrices = hypre_SStructMatrixPMatrices(matrix); - hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); + HYPRE_Int ndim = hypre_SStructMatrixNDim(matrix); + hypre_SStructGraph *graph = hypre_SStructMatrixGraph(matrix); + HYPRE_Int nparts = hypre_SStructMatrixNParts(matrix); + hypre_SStructPMatrix **pmatrices = hypre_SStructMatrixPMatrices(matrix); + hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); hypre_SStructCommInfo **vnbor_comm_info = hypre_SStructGridVNborCommInfo(grid); HYPRE_Int vnbor_ncomms = hypre_SStructGridVNborNComms(grid); HYPRE_Int part; + void *par_u; hypre_CommInfo *comm_info; HYPRE_Int send_part, recv_part; HYPRE_Int send_var, recv_var; hypre_StructMatrix *send_matrix, *recv_matrix; - hypre_CommPkg *comm_pkg; + hypre_CommPkg *comm_pkg, **comm_pkgs; + HYPRE_Complex **send_data, **recv_data; hypre_CommHandle *comm_handle; - HYPRE_Int ci; + HYPRE_Int ci, num_comm_pkgs; + HYPRE_ANNOTATE_FUNC_BEGIN; /*------------------------------------------------------ * NOTE: Inter-part couplings were taken care of earlier. @@ -749,6 +885,11 @@ HYPRE_SStructMatrixAssemble( HYPRE_SStructMatrix matrix ) * Communicate and accumulate between parts *------------------------------------------------------*/ + send_data = hypre_TAlloc(HYPRE_Complex *, vnbor_ncomms, HYPRE_MEMORY_HOST); + recv_data = hypre_TAlloc(HYPRE_Complex *, vnbor_ncomms, HYPRE_MEMORY_HOST); + comm_pkgs = hypre_TAlloc(hypre_CommPkg *, vnbor_ncomms, HYPRE_MEMORY_HOST); + + num_comm_pkgs = 0; for (ci = 0; ci < vnbor_ncomms; ci++) { comm_info = hypre_SStructCommInfoCommInfo(vnbor_comm_info[ci]); @@ -777,10 +918,10 @@ HYPRE_SStructMatrixAssemble( HYPRE_SStructMatrix matrix ) /* to compute 'orders', remember that we are doing reverse communication */ num_values = hypre_StructMatrixNumValues(recv_matrix); - symm = hypre_StructMatrixSymmElements(recv_matrix); + symm = hypre_StructMatrixSymmEntries(recv_matrix); stencil_size = hypre_StructStencilSize(recv_stencil); - v_to_s = hypre_TAlloc(HYPRE_Int, num_values, HYPRE_MEMORY_HOST); - s_to_v = hypre_TAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); + v_to_s = hypre_TAlloc(HYPRE_Int, num_values, HYPRE_MEMORY_HOST); + s_to_v = hypre_TAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); for (si = 0, i = 0; si < stencil_size; si++) { s_to_v[si] = -1; @@ -792,20 +933,20 @@ HYPRE_SStructMatrixAssemble( HYPRE_SStructMatrix matrix ) } } hypre_CommInfoGetTransforms(comm_info, &num_transforms, &coords, &dirs); - orders = hypre_TAlloc(HYPRE_Int *, num_transforms, HYPRE_MEMORY_HOST); - order = hypre_TAlloc(HYPRE_Int, num_values, HYPRE_MEMORY_HOST); + orders = hypre_TAlloc(HYPRE_Int *, num_transforms, HYPRE_MEMORY_HOST); + order = hypre_TAlloc(HYPRE_Int, num_values, HYPRE_MEMORY_HOST); for (ti = 0; ti < num_transforms; ti++) { for (i = 0; i < num_values; i++) { si = v_to_s[i]; - sentry0 = hypre_StructStencilElement(recv_stencil, si); + sentry0 = hypre_StructStencilOffset(recv_stencil, si); for (j = 0; j < ndim; j++) { hypre_IndexD(sentry1, hypre_IndexD(coords[ti], j)) = hypre_IndexD(sentry0, j) * hypre_IndexD(dirs[ti], j); } - order[i] = hypre_StructStencilElementRank(send_stencil, sentry1); + order[i] = hypre_StructStencilOffsetEntry(send_stencil, sentry1); /* currently, both send and recv transforms are parsed */ if (order[i] > -1) { @@ -813,7 +954,7 @@ HYPRE_SStructMatrixAssemble( HYPRE_SStructMatrix matrix ) } } /* want order to indicate the natural order on the remote process */ - orders[ti] = hypre_TAlloc(HYPRE_Int, num_values, HYPRE_MEMORY_HOST); + orders[ti] = hypre_TAlloc(HYPRE_Int, num_values, HYPRE_MEMORY_HOST); for (i = 0; i < num_values; i++) { orders[ti][i] = -1; @@ -835,14 +976,12 @@ HYPRE_SStructMatrixAssemble( HYPRE_SStructMatrix matrix ) hypre_StructMatrixDataSpace(send_matrix), hypre_StructMatrixDataSpace(recv_matrix), num_values, orders, 1, - hypre_StructMatrixComm(send_matrix), &comm_pkg); - /* note reversal of send/recv data here */ - hypre_InitializeCommunication(comm_pkg, - hypre_StructMatrixData(recv_matrix), - hypre_StructMatrixData(send_matrix), - 1, 0, &comm_handle); - hypre_FinalizeCommunication(comm_handle); - hypre_CommPkgDestroy(comm_pkg); + hypre_StructMatrixComm(send_matrix), + hypre_StructMatrixMemoryLocation(send_matrix), + &comm_pkgs[num_comm_pkgs]); + send_data[num_comm_pkgs] = hypre_StructMatrixVData(send_matrix); + recv_data[num_comm_pkgs] = hypre_StructMatrixVData(recv_matrix); + num_comm_pkgs++; for (ti = 0; ti < num_transforms; ti++) { @@ -852,6 +991,34 @@ HYPRE_SStructMatrixAssemble( HYPRE_SStructMatrix matrix ) } } + /* Communicate */ + if (num_comm_pkgs > 0) + { + /* Agglomerate comm_pkgs into one comm_pkg */ + comm_pkg = NULL; + if (num_comm_pkgs > 1) + { + hypre_CommPkgAgglomerate(num_comm_pkgs, comm_pkgs, &comm_pkg); + for (ci = 0; ci < num_comm_pkgs; ci++) + { + hypre_CommPkgDestroy(comm_pkgs[ci]); + } + } + else if (num_comm_pkgs > 0) + { + comm_pkg = comm_pkgs[0]; + } + + /* Note reversal of send/recv data */ + hypre_StructCommunicationInitialize(comm_pkg, recv_data, send_data, 1, 0, &comm_handle); + hypre_StructCommunicationFinalize(comm_handle); + hypre_CommPkgDestroy(comm_pkg); + } + + hypre_TFree(comm_pkgs, HYPRE_MEMORY_HOST); + hypre_TFree(send_data, HYPRE_MEMORY_HOST); + hypre_TFree(recv_data, HYPRE_MEMORY_HOST); + /*------------------------------------------------------ * Assemble P and U matrices *------------------------------------------------------*/ @@ -864,6 +1031,78 @@ HYPRE_SStructMatrixAssemble( HYPRE_SStructMatrix matrix ) /* U-matrix */ hypre_SStructUMatrixAssemble(matrix); + /* Update ParCSRMatrix pointer */ + HYPRE_IJMatrixGetObject(hypre_SStructMatrixIJMatrix(matrix), &par_u); + hypre_SStructMatrixParCSRMatrix(matrix) = (hypre_ParCSRMatrix*) par_u; + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * NOTE: Same as observed for HYPRE_SStructMatrixSetSymmetric + * + * Should set things up so that this information can be passed + * immediately to the PMatrix. Unfortunately, the PMatrix is + * currently not created until the SStructMatrix is initialized. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixSetDomainStride( HYPRE_SStructMatrix matrix, + HYPRE_Int part, + HYPRE_Int *dom_stride ) +{ + HYPRE_Int ndim = hypre_SStructMatrixNDim(matrix); + hypre_Index *mdom_stride = hypre_SStructMatrixDomainStride(matrix); + HYPRE_Int pstart = part; + HYPRE_Int psize = 1; + HYPRE_Int p; + + if (part == -1) + { + pstart = 0; + psize = hypre_SStructMatrixNParts(matrix); + } + + for (p = pstart; p < (pstart + psize); p++) + { + hypre_CopyToIndex(dom_stride, ndim, mdom_stride[p]); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * NOTE: Same as observed for HYPRE_SStructMatrixSetSymmetric + * + * Should set things up so that this information can be passed + * immediately to the PMatrix. Unfortunately, the PMatrix is + * currently not created until the SStructMatrix is initialized. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixSetRangeStride( HYPRE_SStructMatrix matrix, + HYPRE_Int part, + HYPRE_Int *ran_stride ) +{ + HYPRE_Int ndim = hypre_SStructMatrixNDim(matrix); + hypre_Index *mran_stride = hypre_SStructMatrixRangeStride(matrix); + HYPRE_Int pstart = part; + HYPRE_Int psize = 1; + HYPRE_Int p; + + if (part == -1) + { + pstart = 0; + psize = hypre_SStructMatrixNParts(matrix); + } + + for (p = pstart; p < (pstart + psize); p++) + { + hypre_CopyToIndex(ran_stride, ndim, mran_stride[p]); + } + return hypre_error_flag; } @@ -884,13 +1123,13 @@ HYPRE_SStructMatrixSetSymmetric( HYPRE_SStructMatrix matrix, hypre_SStructGraph *graph = hypre_SStructMatrixGraph(matrix); hypre_SStructPGrid *pgrid; - HYPRE_Int pstart = part; - HYPRE_Int psize = 1; - HYPRE_Int vstart = var; - HYPRE_Int vsize = 1; - HYPRE_Int tstart = to_var; - HYPRE_Int tsize = 1; - HYPRE_Int p, v, t; + HYPRE_Int pstart = part; + HYPRE_Int psize = 1; + HYPRE_Int vstart = var; + HYPRE_Int vsize = 1; + HYPRE_Int tstart = to_var; + HYPRE_Int tsize = 1; + HYPRE_Int p, v, t; if (part == -1) { @@ -898,7 +1137,7 @@ HYPRE_SStructMatrixSetSymmetric( HYPRE_SStructMatrix matrix, psize = hypre_SStructMatrixNParts(matrix); } - for (p = pstart; p < psize; p++) + for (p = pstart; p < (pstart + psize); p++) { pgrid = hypre_SStructGraphPGrid(graph, p); if (var == -1) @@ -912,9 +1151,9 @@ HYPRE_SStructMatrixSetSymmetric( HYPRE_SStructMatrix matrix, tsize = hypre_SStructPGridNVars(pgrid); } - for (v = vstart; v < vsize; v++) + for (v = vstart; v < (vstart + vsize); v++) { - for (t = tstart; t < tsize; t++) + for (t = tstart; t < (tstart + tsize); t++) { msymmetric[p][v][t] = symmetric; } @@ -924,6 +1163,65 @@ HYPRE_SStructMatrixSetSymmetric( HYPRE_SStructMatrix matrix, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixSetConstantEntries( HYPRE_SStructMatrix matrix, + HYPRE_Int part, + HYPRE_Int var, + HYPRE_Int to_var, + HYPRE_Int nentries, + HYPRE_Int *centries ) +{ + HYPRE_Int ***mnum_centries = hypre_SStructMatrixNumCEntries(matrix); + HYPRE_Int ****mcentries = hypre_SStructMatrixCEntries(matrix); + hypre_SStructGraph *graph = hypre_SStructMatrixGraph(matrix); + hypre_SStructPGrid *pgrid = hypre_SStructGraphPGrid(graph, part); + + HYPRE_Int pstart = part; + HYPRE_Int psize = 1; + HYPRE_Int vstart = var; + HYPRE_Int vsize = 1; + HYPRE_Int tstart = to_var; + HYPRE_Int tsize = 1; + HYPRE_Int i, p, v, t; + + if (part == -1) + { + pstart = 0; + psize = hypre_SStructMatrixNParts(matrix); + } + + for (p = pstart; p < (pstart + psize); p++) + { + if (var == -1) + { + vstart = 0; + vsize = hypre_SStructPGridNVars(pgrid); + } + if (to_var == -1) + { + tstart = 0; + tsize = hypre_SStructPGridNVars(pgrid); + } + + for (v = vstart; v < (vstart + vsize); v++) + { + for (t = tstart; t < (tstart + tsize); t++) + { + mnum_centries[p][v][t] = nentries; + for (i = 0; i < nentries; i++) + { + mcentries[p][v][t][i] = centries[i]; + } + } + } + } + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -984,7 +1282,7 @@ HYPRE_Int HYPRE_SStructMatrixGetObject( HYPRE_SStructMatrix matrix, void **object ) { - HYPRE_Int type = hypre_SStructMatrixObjectType(matrix); + HYPRE_Int type = hypre_SStructMatrixObjectType(matrix); hypre_SStructPMatrix *pmatrix; hypre_StructMatrix *smatrix; HYPRE_Int part, var; @@ -1000,8 +1298,7 @@ HYPRE_SStructMatrixGetObject( HYPRE_SStructMatrix matrix, else if (type == HYPRE_STRUCT) { /* only one part & one variable */ - part = 0; - var = 0; + part = var = 0; pmatrix = hypre_SStructMatrixPMatrix(matrix, part); smatrix = hypre_SStructPMatrixSMatrix(pmatrix, var, var); *object = smatrix; @@ -1011,14 +1308,24 @@ HYPRE_SStructMatrixGetObject( HYPRE_SStructMatrix matrix, } /*-------------------------------------------------------------------------- - * HYPRE_SStructMatrixPrint - * + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixGetGrid( HYPRE_SStructMatrix matrix, + HYPRE_SStructGrid *grid ) +{ + hypre_SStructGraph *graph = hypre_SStructMatrixGraph(matrix); + + *grid = (HYPRE_SStructGrid) hypre_SStructGraphGrid(graph); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- * 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 @@ -1151,7 +1458,6 @@ HYPRE_SStructMatrixPrint( const char *filename, } /*-------------------------------------------------------------------------- - * HYPRE_SStructMatrixRead *--------------------------------------------------------------------------*/ HYPRE_Int @@ -1239,9 +1545,6 @@ HYPRE_SStructMatrixRead( MPI_Comm comm, } hypre_TFree(stencils, HYPRE_MEMORY_HOST); - /* Assemble graph */ - HYPRE_SStructGraphAssemble(graph); - /* Create matrix */ HYPRE_SStructMatrixCreate(comm, graph, &matrix); @@ -1275,6 +1578,13 @@ HYPRE_SStructMatrixRead( MPI_Comm comm, smatrix = hypre_SStructPMatrixSMatrix(pmatrix, vi, vj); if (data_size > 0) { + /* Free up old data pointer because ReadData calls Initialize. + * RDF: This is a bit hacky. If we could call Initialize in + * StructMatrixRead() instead, that would be better; we would + * need to modify the io file to do that. Alternatively, adding + * InitializeShell() and InitializeData() to SStructMatrix and + * PMatrix could provide another solution. */ + hypre_TFree(hypre_StructMatrixData(smatrix), hypre_StructMatrixMemoryLocation(smatrix)); hypre_StructMatrixReadData(file, smatrix); } } @@ -1339,3 +1649,88 @@ HYPRE_SStructMatrixMatvec( HYPRE_Complex alpha, return hypre_error_flag; } + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixToIJMatrix( HYPRE_SStructMatrix matrix, + HYPRE_Int fill_diagonal, + HYPRE_IJMatrix *ijmatrix ) +{ + HYPRE_IJMatrix ij_s; + HYPRE_IJMatrix ij_u; + HYPRE_ParCSRMatrix parcsr_u; + HYPRE_ParCSRMatrix parcsr_s; + HYPRE_ParCSRMatrix parcsr_ss; + + HYPRE_BigInt nrows_ss; + HYPRE_BigInt ncols_ss; + + if (!matrix) + { + hypre_error_in_arg(1); + return hypre_error_flag; + } + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("SStructMatrixToIJMatrix"); + + if (hypre_SStructMatrixObjectType(matrix) != HYPRE_PARCSR) + { + ij_s = (HYPRE_IJMatrix) + hypre_SStructMatrixToUMatrix((hypre_SStructMatrix *) matrix, fill_diagonal); + + /* Add the unstructured part */ + ij_u = hypre_SStructMatrixIJMatrix(matrix); + if (ij_u) + { + HYPRE_IJMatrixGetObject(ij_u, (void **) &parcsr_u); + HYPRE_IJMatrixGetObject(ij_s, (void **) &parcsr_s); + + hypre_ParCSRMatrixAdd(1.0, parcsr_u, 1.0, parcsr_s, &parcsr_ss); + + /* For square matrices, the first row entry is the diagonal coefficient */ + nrows_ss = hypre_ParCSRMatrixGlobalNumRows(parcsr_ss); + ncols_ss = hypre_ParCSRMatrixGlobalNumCols(parcsr_ss); + if (nrows_ss == ncols_ss) + { + hypre_ParCSRMatrixReorder(parcsr_ss); + } + + HYPRE_IJMatrixDestroy(ij_s); + HYPRE_IJMatrixCreate(hypre_ParCSRMatrixComm(parcsr_ss), + hypre_ParCSRMatrixFirstRowIndex(parcsr_ss), + hypre_ParCSRMatrixLastRowIndex(parcsr_ss), + hypre_ParCSRMatrixFirstColDiag(parcsr_ss), + hypre_ParCSRMatrixLastColDiag(parcsr_ss), + ijmatrix); + HYPRE_IJMatrixSetObjectType(*ijmatrix, HYPRE_PARCSR); + hypre_IJMatrixSetObject(*ijmatrix, parcsr_ss); + } + else + { + *ijmatrix = ij_s; + } + } + else + { + *ijmatrix = hypre_SStructMatrixIJMatrix(matrix); + } + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ +HYPRE_Int HYPRE_SStructMatrixMatmat( HYPRE_SStructMatrix A, + HYPRE_SStructMatrix B, + HYPRE_SStructMatrix *C ) +{ + hypre_SStructMatmat(A, B, C); + + return hypre_error_flag; +} diff --git a/src/sstruct_mv/HYPRE_sstruct_mv.h b/src/sstruct_mv/HYPRE_sstruct_mv.h index 79222f81a9..726de0823d 100644 --- a/src/sstruct_mv/HYPRE_sstruct_mv.h +++ b/src/sstruct_mv/HYPRE_sstruct_mv.h @@ -13,6 +13,10 @@ #include "HYPRE_struct_mv.h" #include "HYPRE_IJ_mv.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_sstruct_mv_mup_def.h" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -21,7 +25,7 @@ extern "C" { *--------------------------------------------------------------------------*/ /** - * @defgroup SStructSystemInterface SStruct System Interface + * @defgroup SStructInterface SStruct System and Object Interface * * A semi-structured-grid conceptual interface. This interface represents a * semi-structured-grid conceptual view of a linear system. @@ -284,6 +288,179 @@ HYPRE_SStructGridSetSharedPart(HYPRE_SStructGrid grid, HYPRE_Int *index_map, HYPRE_Int *index_dir); +/** + * AMRNEW + * + * Declare a part to be a refinement of another part in an AMR hierarchy. + * + * The index space of \e fine_part is defined to be a refinement of the index + * space of \e coarse_part by a refinement factor in each dimension given by + * \e rfactors. The two index spaces are aligned based on \e coarse_index + * and \e fine_index, which specifies the fine index of the lower left cell + * of the given coarse index. This induces notions of \e real and \e + * slave variables and interpolation between them, which impacts how vector and + * matrix values are set. + * + * By default, real variables are defined as follows, and the remaining + * variables are slave variables (this may be changed by the user through + * the routine \e HYPRE_SStructGridSetAMRRefSlaves: + * - fine variables on the interior of overlapping coarse-fine regions; + * - coarse variables on the boundary of overlapping coarse-fine regions; + * - all variables in non-overlapping regions. + * + * By default, interpolation (and restriction) is defined to be the natural + * finite element interpolation corresponding to each variable type, but this + * may be changed by the user via the other \e SStructGridSetAMR routines. + * + * There are two basic steps for changing interpolation, both optional. The + * first is through the \e SStructGridSetAMRRef routines using a reference + * overlapping coarse-fine patch. This reference patch is applied throughout + * the entire part to define the global interpolation operator. Interpolation + * may then be changed at individual locations in the grid through the + * \e HYPRE_SStructGridSetAMRInterp routine. + * + * The reference coarse-fine patch consists of a single coarse cell and its + * refinement, where the coarse and fine reference patches are assumed to have a + * lower left index of zero. Coarse and fine variables are referenced in the + * patch by their associated cell indexes (in the same way that variables are + * referenced on the grid). For example, in 2D, for a refinement factor of two + * in both directions and a nodal variable type, the lower left fine variable + * would be referenced by the index (-1,-1) and the upper right variable by + * index (1,1). Similarly, the lower left coarse variable would be referenced + * by index (-1,-1) and the upper right with index (0,0). + */ +HYPRE_Int +HYPRE_SStructGridSetAMRPart(HYPRE_SStructGrid grid, + HYPRE_Int coarse_part, + HYPRE_Int fine_part, + HYPRE_Int *coarse_index, + HYPRE_Int *fine_index, + HYPRE_Int *rfactors); + +/** + * AMRNEW + * + * Define the slave variables in the reference coarse-fine patch. The argument + * \e slaves is an array of blocks of size \e ndim containing the + * associated cell indexes for the slave variables. + * + * See \e HYPRE_SStructGridSetAMRPart for details on the coarse-fine patch. + * This routine must be called after \e HYPRE_SStructGridSetAMRPart and + * before any other \e SStructGridSetAMR routines. + */ +HYPRE_Int +HYPRE_SStructGridSetAMRRefSlaves(HYPRE_SStructGrid grid, + HYPRE_Int coarse_part, + HYPRE_Int var, + HYPRE_Int nslaves, + HYPRE_Int *slaves); + +/** + * AMRNEW + * + * Set interpolation on the reference coarse-fine patch. Interpolation maps + * real variables to all variables (real and slave). Real variables are mapped + * to real variables identically. Slave coarse variables are not interpolated + * at all. Users may only change interpolation from real variables (coarse and + * fine) to slave fine variables \e scf=1 (see special cell-centered case + * below). The argument \e sindex is a fine reference patch index for slave + * variable \e svar. The array \e indexes contains both coarse and fine + * reference patch indexes for variables \e vars as specified in \e cf by + * a 0 (coarse) or a 1 (fine). + * + * Cell-centered variables are treated as a special case, where coupling occurs + * through fictitious slave face variables. Although these variables are + * associated with faces, they should actually be thought of as being centered + * either at cells just outside of the patch for fine faces (\e scf=1) or at + * the patch center for coarse faces (\e scf=0). These fictitious variables + * are also referenced differently from other variables, where, for convenience, + * \e sindex always specifies cells just outside of the patch (in the coarse + * case in particular, this approach enables a distinction between the multiple + * coarse faces and interpolation formulas). Interpolation may be from any + * neighboring real variables, inside or outside of the patch. + * + * Idea for the cell-centered case: To reduce the need to fix up interpolation + * at individual grid locations, consider adding a rule to replace interpolation + * from nonexistent coarse variables with interpolation from existing underlying + * fine variables. For example, in those cases, take the average of the closest + * fine variables (in the odd refinement case, this is just injection from the + * underlying fine variable). + * + * See \e HYPRE_SStructGridSetAMRPart for details on the coarse-fine patch. + * Note: Currently, each call must set an entire row of interpolation. + */ +HYPRE_Int +HYPRE_SStructGridSetAMRRefInterp(HYPRE_SStructGrid grid, + HYPRE_Int coarse_part, + HYPRE_Int scf, + HYPRE_Int svar, + HYPRE_Int *sindex, + HYPRE_Int nvalues, + HYPRE_Int *vars, + HYPRE_Int *cf, + HYPRE_Int *indexes, + HYPRE_Complex *values); + +/** + * AMRNEW + * + * Set (the transpose of) restriction on the reference coarse-fine patch. By + * default, restriction is the transpose of interpolation. Usually, this + * routine should only be called to set up a nonsymmetric operator. Usage is + * the same as for setting up interpolation. + */ +HYPRE_Int +HYPRE_SStructGridSetAMRRefRestrictT(HYPRE_SStructGrid grid, + HYPRE_Int coarse_part, + HYPRE_Int scf, + HYPRE_Int svar, + HYPRE_Int *sindex, + HYPRE_Int nvalues, + HYPRE_Int *vars, + HYPRE_Int *cf, + HYPRE_Int *indexes, + HYPRE_Complex *values); + +/** + * AMRNEW + * + * Set interpolation at a specific grid index on a refined part. Usage is the + * same as for setting interpolation on the reference coarse-fine patch, except + * that an additional argument \e coarse_index is given. + */ +HYPRE_Int +HYPRE_SStructGridSetAMRInterp(HYPRE_SStructGrid grid, + HYPRE_Int coarse_part, + HYPRE_Int *coarse_index, + HYPRE_Int scf, + HYPRE_Int svar, + HYPRE_Int *sindex, + HYPRE_Int nvalues, + HYPRE_Int *vars, + HYPRE_Int *cf, + HYPRE_Int *indexes, + HYPRE_Complex *values); + +/** + * AMRNEW + * + * Set restriction at a specific grid index on a refined part. Usage is the + * same as for setting restriction on the reference coarse-fine patch, except + * that an additional argument \e coarse_index is given. + */ +HYPRE_Int +HYPRE_SStructGridSetAMRRestrictT(HYPRE_SStructGrid grid, + HYPRE_Int coarse_part, + HYPRE_Int *coarse_index, + HYPRE_Int scf, + HYPRE_Int svar, + HYPRE_Int *sindex, + HYPRE_Int nvalues, + HYPRE_Int *vars, + HYPRE_Int *cf, + HYPRE_Int *indexes, + HYPRE_Complex *values); + /** * Add an unstructured part to the grid. The variables in the unstructured part * of the grid are referenced by a global rank between 0 and the total number of @@ -303,6 +480,35 @@ HYPRE_SStructGridAddUnstructuredPart(HYPRE_SStructGrid grid, HYPRE_Int HYPRE_SStructGridAssemble(HYPRE_SStructGrid grid); +/** + * AMRNEW + * + * Set the storage type of associated matrix and vector objects. This object + * type is inherited by \e SStructGraph, \e SStructMatrix, and \e + * SStructVector at their creation, but can also be changed through the + * corresponding \e SetObjectType routines. Setting an object type with this + * routine helps to minimize the number of overall calls to \e SetObjectType, + * but is particularly useful when grid-based operators are needed, such as a + * discrete gradient (\e HYPRE_SStructGridGetGradient). + * + * Currently, \e type can be \c HYPRE_SSTRUCT, \c HYPRE_STRUCT, or + * \c HYPRE_PARCSR. The default is \c HYPRE_SSTRUCT. + */ +HYPRE_Int +HYPRE_SStructGridSetObjectType(HYPRE_SStructGrid grid, + HYPRE_Int type); + +/** + * AMRNEW + * + * Get a reference to a discrete gradient matrix object. + * + * RDF: Not sure yet if this routine really needs to exist. + */ +HYPRE_Int +HYPRE_SStructGridGetGradient(HYPRE_SStructGrid grid, + void **gradient); + /** * Set the periodicity on a particular part. * @@ -326,6 +532,41 @@ HYPRE_Int HYPRE_SStructGridSetNumGhost(HYPRE_SStructGrid grid, HYPRE_Int *num_ghost); +/** + * Helper function for returning the box dimensions of a (part,var)-structured grid. + **/ +HYPRE_Int +HYPRE_SStructGridGetVariableBox(HYPRE_SStructGrid grid, + HYPRE_Int part, + HYPRE_Int var, + HYPRE_Int *cell_ilower, + HYPRE_Int *cell_iupper, + HYPRE_Int *var_ilower, + HYPRE_Int *var_iupper ); + +/** + * Project the box described by \e ilower and \e iupper onto the strided + * index space that contains the index \e origin and has stride \e stride. + * This routine is useful when dealing with rectangular matrices. + **/ +HYPRE_Int +HYPRE_SStructGridProjectBox(HYPRE_SStructGrid grid, + HYPRE_Int *ilower, + HYPRE_Int *iupper, + HYPRE_Int *origin, + HYPRE_Int *stride); + +/** + * Coarsen \e grid by factor \e strides to create \e cgrid. + **/ +HYPRE_Int +HYPRE_SStructGridCoarsen(HYPRE_SStructGrid fgrid, + HYPRE_Index *strides, + HYPRE_SStructGrid *cgrid); + +HYPRE_Int HYPRE_SStructGridPrintGLVis ( HYPRE_SStructGrid grid, const char *meshprefix, + HYPRE_Real *trans, HYPRE_Real *origin ); + /**@}*/ /*-------------------------------------------------------------------------- @@ -367,6 +608,9 @@ HYPRE_SStructStencilSetEntry(HYPRE_SStructStencil stencil, 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 ); + /**@}*/ /*-------------------------------------------------------------------------- @@ -474,6 +718,11 @@ HYPRE_SStructGraphAssemble(HYPRE_SStructGraph graph); 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 ); + /**@}*/ /*-------------------------------------------------------------------------- @@ -492,7 +741,16 @@ struct hypre_SStructMatrix_struct; typedef struct hypre_SStructMatrix_struct *HYPRE_SStructMatrix; /** - * Create a matrix object. + * Create a matrix object. Matrices may have different range and domain grids, + * that is, they need not be square. By default, the range and domain grids are + * the same as the argument \e grid in \ref HYPRE_SStructMatrixCreate. Both + * grids live on a common fine index space and should have the same number of + * boxes. The actual range is a coarsening of the range grid with coarsening + * factor \e ran_stride specified in \ref HYPRE_SStructMatrixSetRangeStride. + * Similarly, the actual domain is a coarsening of the domain grid with factor + * \e dom_stride specified in \ref HYPRE_SStructMatrixSetDomainStride. + * Currently, either \e ran_stride or \e dom_stride or both must be all ones + * (i.e., no coarsening). **/ HYPRE_Int HYPRE_SStructMatrixCreate(MPI_Comm comm, @@ -511,6 +769,37 @@ HYPRE_SStructMatrixDestroy(HYPRE_SStructMatrix matrix); HYPRE_Int HYPRE_SStructMatrixInitialize(HYPRE_SStructMatrix matrix); +/** + * (Optional) Set matrix domain stride part by part. For more information, + * see \ref HYPRE_SStructMatrixCreate. + **/ +HYPRE_Int +HYPRE_SStructMatrixSetDomainStride(HYPRE_SStructMatrix matrix, + HYPRE_Int part, + HYPRE_Int *dom_stride); + +/** + * (Optional) Set matrix range stride part by part. For more information, + * see \ref HYPRE_SStructMatrixCreate. + **/ +HYPRE_Int +HYPRE_SStructMatrixSetRangeStride(HYPRE_SStructMatrix matrix, + HYPRE_Int part, + HYPRE_Int *ran_stride); + +/** + * (Optional) Set matrix coefficients which are constant over the grid. + * This considers a block matrix associated with the tuple \e (part, var, to_var). + * The \e centries array is of length \e nentries. + **/ +HYPRE_Int +HYPRE_SStructMatrixSetConstantEntries(HYPRE_SStructMatrix matrix, + HYPRE_Int part, + HYPRE_Int var, + HYPRE_Int to_var, + HYPRE_Int nentries, + HYPRE_Int *centries ); + /** * (Optional, GPU only) Sets if the matrix assemble routine does reductions * of the IJ part before calling HYPRE_SStructMatrixAssemble. @@ -818,6 +1107,13 @@ HYPRE_Int HYPRE_SStructMatrixGetObject(HYPRE_SStructMatrix matrix, void **object); +/** + * Returns the grid object of a HYPRE_SStructMatrix. + **/ +HYPRE_Int +HYPRE_SStructMatrixGetGrid( HYPRE_SStructMatrix matrix, + HYPRE_SStructGrid *grid ); + /** * Print the matrix to file. This is mainly for debugging purposes. **/ @@ -827,7 +1123,18 @@ HYPRE_SStructMatrixPrint(const char *filename, HYPRE_Int all); /** - * Read the matrix from file. This is mainly for debugging purposes. + * Converts a SStructMatrix to an IJMatrix. This will sum the structured + * and unstructured components of the input SStructMatrix and construct + * the resulting sum as an IJMatrix. When the flag \e fill_diagonal is + * turned on, the diagonal coefficient of ghost rows is set to 1. + **/ +HYPRE_Int +HYPRE_SStructMatrixToIJMatrix(HYPRE_SStructMatrix matrix, + HYPRE_Int fill_diagonal, + HYPRE_IJMatrix *ijmatrix); + +/** + * Read the matrix from file. This is mainly for debugging purposes. **/ HYPRE_Int HYPRE_SStructMatrixRead( MPI_Comm comm, @@ -887,6 +1194,21 @@ HYPRE_SStructVectorSetValues(HYPRE_SStructVector vector, HYPRE_Int var, HYPRE_Complex *value); +/** + * Set vector coefficients to a constant value over the grid. + **/ +HYPRE_Int +HYPRE_SStructVectorSetConstantValues(HYPRE_SStructVector vector, + HYPRE_Complex value); + +/** + * Set vector coefficients to random values between -1.0 and 1.0 over the grid. + * The parameter \e seed controls the generation of random numbers. + **/ +HYPRE_Int +HYPRE_SStructVectorSetRandomValues(HYPRE_SStructVector vector, + HYPRE_Int seed); + /** * Add to vector coefficients index by index. * @@ -1126,14 +1448,136 @@ HYPRE_SStructVectorRead( MPI_Comm comm, const char *filename, HYPRE_SStructVector *vector_ptr ); + + +HYPRE_Int HYPRE_SStructVectorPrintGLVis( HYPRE_SStructVector vector, const char *fileprefix ); + +/**@}*/ + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +/** + * @name SStruct Other + * + * @{ + **/ + +/** + * AMRNEW + * + * Get a reference to the constructed matrix and right-hand-side (rhs) objects + * for an AMR system. This routine is similar to the routines \e + * HYPRE_SStructMatrixGetObject and \e HYPRE_SStructVectorGetObject, but + * ensures that trivial equations such as Dirichlet conditions are also + * satisfied exactly in the AMR system. + */ +HYPRE_Int +HYPRE_SStructGetAMRObjects(HYPRE_SStructMatrix matrix, + HYPRE_SStructVector rhs, + void **matrix_object, + void **rhs_object); + /**@}*/ + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +/** + * @name Basic Matrix/vector routines + * + * @{ + **/ + +/** + * Copy vector x into y (\f$y \leftarrow x\f$). + **/ +HYPRE_Int +HYPRE_SStructVectorCopy(HYPRE_SStructVector x, + HYPRE_SStructVector y); + +/** + * Scale a vector by \e alpha (\f$y \leftarrow \alpha y\f$). + **/ +HYPRE_Int +HYPRE_SStructVectorScale(HYPRE_Complex alpha, + HYPRE_SStructVector y); + +/** + * Compute \f$y = y + \alpha x\f$. + **/ +HYPRE_Int +HYPRE_SStructVectorAxpy(HYPRE_Complex alpha, + HYPRE_SStructVector x, + HYPRE_SStructVector y); + +/** + * Compute \e result, the inner product of vectors \e x and \e y. + **/ +HYPRE_Int +HYPRE_SStructVectorInnerProd(HYPRE_SStructVector x, + HYPRE_SStructVector y, + HYPRE_Real *result); + +/** + * 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 + * \f$\alpha=1\f$ and \f$\beta=0\f$. + **/ +HYPRE_Int +HYPRE_SStructMatrixMatvec(HYPRE_Complex alpha, + HYPRE_SStructMatrix A, + HYPRE_SStructVector x, + HYPRE_Complex beta, + HYPRE_SStructVector y); + +/** + * Matrix-matrix multiply. + **/ +HYPRE_Int +HYPRE_SStructMatrixMatmat(HYPRE_SStructMatrix A, + HYPRE_SStructMatrix B, + HYPRE_SStructMatrix *C); + /**@}*/ /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ +/*===== BEGIN 1 - IGNORE CODE IN DOCS =====*/ /*! \cond */ + +/* Keep these for backward compatibility (for now) */ + +HYPRE_Int +HYPRE_SStructAxpy(HYPRE_Complex alpha, + HYPRE_SStructVector x, + HYPRE_SStructVector y); + +HYPRE_Int +HYPRE_SStructInnerProd(HYPRE_SStructVector x, + HYPRE_SStructVector y, + HYPRE_Real *result); + +/*===== END 1 - IGNORE CODE IN DOCS =====*/ /*! \endcond */ + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +/**@}*/ + #ifdef __cplusplus } #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_sstruct_mv_mup_undef.h" +#include "HYPRE_sstruct_mv_mup.h" +#endif +#endif + #endif diff --git a/src/sstruct_mv/HYPRE_sstruct_mv_mup.h b/src/sstruct_mv/HYPRE_sstruct_mv_mup.h new file mode 100644 index 0000000000..8fa5cb83b2 --- /dev/null +++ b/src/sstruct_mv/HYPRE_sstruct_mv_mup.h @@ -0,0 +1,1145 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#ifndef HYPRE_SSTRUCT_MV_MUP_HEADER +#define HYPRE_SSTRUCT_MV_MUP_HEADER + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (HYPRE_MIXED_PRECISION) + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_SStructAxpy_flt( hypre_float alpha, HYPRE_SStructVector x, HYPRE_SStructVector y ); +HYPRE_Int +HYPRE_SStructAxpy_dbl( hypre_double alpha, HYPRE_SStructVector x, HYPRE_SStructVector y ); +HYPRE_Int +HYPRE_SStructAxpy_long_dbl( hypre_long_double alpha, HYPRE_SStructVector x, HYPRE_SStructVector y ); +HYPRE_Int +HYPRE_SStructAxpy( hypre_long_double alpha, HYPRE_SStructVector x, HYPRE_SStructVector y ); + +HYPRE_Int +HYPRE_SStructGraphAddEntries_flt( 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_SStructGraphAddEntries_dbl( 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_SStructGraphAddEntries_long_dbl( 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_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_flt( HYPRE_SStructGraph graph ); +HYPRE_Int +HYPRE_SStructGraphAssemble_dbl( HYPRE_SStructGraph graph ); +HYPRE_Int +HYPRE_SStructGraphAssemble_long_dbl( HYPRE_SStructGraph graph ); +HYPRE_Int +HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ); + +HYPRE_Int +HYPRE_SStructGraphCreate_flt( MPI_Comm comm, HYPRE_SStructGrid grid, HYPRE_SStructGraph *graph ); +HYPRE_Int +HYPRE_SStructGraphCreate_dbl( MPI_Comm comm, HYPRE_SStructGrid grid, HYPRE_SStructGraph *graph ); +HYPRE_Int +HYPRE_SStructGraphCreate_long_dbl( MPI_Comm comm, HYPRE_SStructGrid grid, HYPRE_SStructGraph *graph ); +HYPRE_Int +HYPRE_SStructGraphCreate( MPI_Comm comm, HYPRE_SStructGrid grid, HYPRE_SStructGraph *graph ); + +HYPRE_Int +HYPRE_SStructGraphDestroy_flt( HYPRE_SStructGraph graph ); +HYPRE_Int +HYPRE_SStructGraphDestroy_dbl( HYPRE_SStructGraph graph ); +HYPRE_Int +HYPRE_SStructGraphDestroy_long_dbl( HYPRE_SStructGraph graph ); +HYPRE_Int +HYPRE_SStructGraphDestroy( HYPRE_SStructGraph graph ); + +HYPRE_Int +HYPRE_SStructGraphPrint_flt( FILE *file, HYPRE_SStructGraph graph ); +HYPRE_Int +HYPRE_SStructGraphPrint_dbl( FILE *file, HYPRE_SStructGraph graph ); +HYPRE_Int +HYPRE_SStructGraphPrint_long_dbl( FILE *file, HYPRE_SStructGraph graph ); +HYPRE_Int +HYPRE_SStructGraphPrint( FILE *file, HYPRE_SStructGraph graph ); + +HYPRE_Int +HYPRE_SStructGraphRead_flt( FILE *file, HYPRE_SStructGrid grid, HYPRE_SStructStencil **stencils, HYPRE_SStructGraph *graph_ptr ); +HYPRE_Int +HYPRE_SStructGraphRead_dbl( FILE *file, HYPRE_SStructGrid grid, HYPRE_SStructStencil **stencils, HYPRE_SStructGraph *graph_ptr ); +HYPRE_Int +HYPRE_SStructGraphRead_long_dbl( FILE *file, HYPRE_SStructGrid grid, HYPRE_SStructStencil **stencils, HYPRE_SStructGraph *graph_ptr ); +HYPRE_Int +HYPRE_SStructGraphRead( FILE *file, HYPRE_SStructGrid grid, HYPRE_SStructStencil **stencils, HYPRE_SStructGraph *graph_ptr ); + +HYPRE_Int +HYPRE_SStructGraphSetDomainGrid_flt( HYPRE_SStructGraph graph, HYPRE_SStructGrid domain_grid ); +HYPRE_Int +HYPRE_SStructGraphSetDomainGrid_dbl( HYPRE_SStructGraph graph, HYPRE_SStructGrid domain_grid ); +HYPRE_Int +HYPRE_SStructGraphSetDomainGrid_long_dbl( HYPRE_SStructGraph graph, HYPRE_SStructGrid domain_grid ); +HYPRE_Int +HYPRE_SStructGraphSetDomainGrid( HYPRE_SStructGraph graph, HYPRE_SStructGrid domain_grid ); + +HYPRE_Int +HYPRE_SStructGraphSetFEM_flt( HYPRE_SStructGraph graph, HYPRE_Int part ); +HYPRE_Int +HYPRE_SStructGraphSetFEM_dbl( HYPRE_SStructGraph graph, HYPRE_Int part ); +HYPRE_Int +HYPRE_SStructGraphSetFEM_long_dbl( HYPRE_SStructGraph graph, HYPRE_Int part ); +HYPRE_Int +HYPRE_SStructGraphSetFEM( HYPRE_SStructGraph graph, HYPRE_Int part ); + +HYPRE_Int +HYPRE_SStructGraphSetFEMSparsity_flt( HYPRE_SStructGraph graph, HYPRE_Int part, HYPRE_Int nsparse, HYPRE_Int *sparsity ); +HYPRE_Int +HYPRE_SStructGraphSetFEMSparsity_dbl( HYPRE_SStructGraph graph, HYPRE_Int part, HYPRE_Int nsparse, HYPRE_Int *sparsity ); +HYPRE_Int +HYPRE_SStructGraphSetFEMSparsity_long_dbl( HYPRE_SStructGraph graph, HYPRE_Int part, HYPRE_Int nsparse, HYPRE_Int *sparsity ); +HYPRE_Int +HYPRE_SStructGraphSetFEMSparsity( HYPRE_SStructGraph graph, HYPRE_Int part, HYPRE_Int nsparse, HYPRE_Int *sparsity ); + +HYPRE_Int +HYPRE_SStructGraphSetObjectType_flt( HYPRE_SStructGraph graph, HYPRE_Int type ); +HYPRE_Int +HYPRE_SStructGraphSetObjectType_dbl( HYPRE_SStructGraph graph, HYPRE_Int type ); +HYPRE_Int +HYPRE_SStructGraphSetObjectType_long_dbl( HYPRE_SStructGraph graph, HYPRE_Int type ); +HYPRE_Int +HYPRE_SStructGraphSetObjectType( HYPRE_SStructGraph graph, HYPRE_Int type ); + +HYPRE_Int +HYPRE_SStructGraphSetStencil_flt( HYPRE_SStructGraph graph, HYPRE_Int part, HYPRE_Int var, HYPRE_SStructStencil stencil ); +HYPRE_Int +HYPRE_SStructGraphSetStencil_dbl( HYPRE_SStructGraph graph, HYPRE_Int part, HYPRE_Int var, HYPRE_SStructStencil stencil ); +HYPRE_Int +HYPRE_SStructGraphSetStencil_long_dbl( HYPRE_SStructGraph graph, HYPRE_Int part, HYPRE_Int var, HYPRE_SStructStencil stencil ); +HYPRE_Int +HYPRE_SStructGraphSetStencil( HYPRE_SStructGraph graph, HYPRE_Int part, HYPRE_Int var, HYPRE_SStructStencil stencil ); + +HYPRE_Int +HYPRE_SStructGridAddVariables_flt( HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int nvars, HYPRE_SStructVariable *vartypes ); +HYPRE_Int +HYPRE_SStructGridAddVariables_dbl( HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int nvars, HYPRE_SStructVariable *vartypes ); +HYPRE_Int +HYPRE_SStructGridAddVariables_long_dbl( HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int *index, 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_SStructGridAssemble_flt( HYPRE_SStructGrid grid ); +HYPRE_Int +HYPRE_SStructGridAssemble_dbl( HYPRE_SStructGrid grid ); +HYPRE_Int +HYPRE_SStructGridAssemble_long_dbl( HYPRE_SStructGrid grid ); +HYPRE_Int +HYPRE_SStructGridAssemble( HYPRE_SStructGrid grid ); + +HYPRE_Int +HYPRE_SStructGridCoarsen_flt( HYPRE_SStructGrid fgrid, HYPRE_Index *strides, HYPRE_SStructGrid *cgrid ); +HYPRE_Int +HYPRE_SStructGridCoarsen_dbl( HYPRE_SStructGrid fgrid, HYPRE_Index *strides, HYPRE_SStructGrid *cgrid ); +HYPRE_Int +HYPRE_SStructGridCoarsen_long_dbl( HYPRE_SStructGrid fgrid, HYPRE_Index *strides, HYPRE_SStructGrid *cgrid ); +HYPRE_Int +HYPRE_SStructGridCoarsen( HYPRE_SStructGrid fgrid, HYPRE_Index *strides, HYPRE_SStructGrid *cgrid ); + +HYPRE_Int +HYPRE_SStructGridCreate_flt( MPI_Comm comm, HYPRE_Int ndim, HYPRE_Int nparts, HYPRE_SStructGrid *grid ); +HYPRE_Int +HYPRE_SStructGridCreate_dbl( MPI_Comm comm, HYPRE_Int ndim, HYPRE_Int nparts, HYPRE_SStructGrid *grid ); +HYPRE_Int +HYPRE_SStructGridCreate_long_dbl( MPI_Comm comm, HYPRE_Int ndim, HYPRE_Int nparts, HYPRE_SStructGrid *grid ); +HYPRE_Int +HYPRE_SStructGridCreate( MPI_Comm comm, HYPRE_Int ndim, HYPRE_Int nparts, HYPRE_SStructGrid *grid ); + +HYPRE_Int +HYPRE_SStructGridDestroy_flt( HYPRE_SStructGrid grid ); +HYPRE_Int +HYPRE_SStructGridDestroy_dbl( HYPRE_SStructGrid grid ); +HYPRE_Int +HYPRE_SStructGridDestroy_long_dbl( HYPRE_SStructGrid grid ); +HYPRE_Int +HYPRE_SStructGridDestroy( HYPRE_SStructGrid grid ); + +HYPRE_Int +HYPRE_SStructGridGetVariableBox_flt( HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int var, HYPRE_Int *cell_ilower, HYPRE_Int *cell_iupper, HYPRE_Int *var_ilower, HYPRE_Int *var_iupper ); +HYPRE_Int +HYPRE_SStructGridGetVariableBox_dbl( HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int var, HYPRE_Int *cell_ilower, HYPRE_Int *cell_iupper, HYPRE_Int *var_ilower, HYPRE_Int *var_iupper ); +HYPRE_Int +HYPRE_SStructGridGetVariableBox_long_dbl( HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int var, HYPRE_Int *cell_ilower, HYPRE_Int *cell_iupper, HYPRE_Int *var_ilower, HYPRE_Int *var_iupper ); +HYPRE_Int +HYPRE_SStructGridGetVariableBox( HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int var, HYPRE_Int *cell_ilower, HYPRE_Int *cell_iupper, HYPRE_Int *var_ilower, HYPRE_Int *var_iupper ); + +HYPRE_Int +HYPRE_SStructGridPrintGLVis_flt( HYPRE_SStructGrid grid, const char *meshprefix, hypre_float *trans, hypre_float *origin ); +HYPRE_Int +HYPRE_SStructGridPrintGLVis_dbl( HYPRE_SStructGrid grid, const char *meshprefix, hypre_double *trans, hypre_double *origin ); +HYPRE_Int +HYPRE_SStructGridPrintGLVis_long_dbl( HYPRE_SStructGrid grid, const char *meshprefix, hypre_long_double *trans, hypre_long_double *origin ); +HYPRE_Int +HYPRE_SStructGridPrintGLVis( HYPRE_SStructGrid grid, const char *meshprefix, void *trans, void *origin ); + +HYPRE_Int +HYPRE_SStructGridProjectBox_flt( HYPRE_SStructGrid grid, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *origin, HYPRE_Int *stride ); +HYPRE_Int +HYPRE_SStructGridProjectBox_dbl( HYPRE_SStructGrid grid, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *origin, HYPRE_Int *stride ); +HYPRE_Int +HYPRE_SStructGridProjectBox_long_dbl( HYPRE_SStructGrid grid, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *origin, HYPRE_Int *stride ); +HYPRE_Int +HYPRE_SStructGridProjectBox( HYPRE_SStructGrid grid, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *origin, HYPRE_Int *stride ); + +HYPRE_Int +HYPRE_SStructGridSetExtents_flt( HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper ); +HYPRE_Int +HYPRE_SStructGridSetExtents_dbl( HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper ); +HYPRE_Int +HYPRE_SStructGridSetExtents_long_dbl( HYPRE_SStructGrid grid, HYPRE_Int part, 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_SStructGridSetFEMOrdering_flt( HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int *ordering ); +HYPRE_Int +HYPRE_SStructGridSetFEMOrdering_dbl( HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int *ordering ); +HYPRE_Int +HYPRE_SStructGridSetFEMOrdering_long_dbl( HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int *ordering ); +HYPRE_Int +HYPRE_SStructGridSetFEMOrdering( HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int *ordering ); + +HYPRE_Int +HYPRE_SStructGridSetNeighborPart_flt( 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_SStructGridSetNeighborPart_dbl( 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_SStructGridSetNeighborPart_long_dbl( 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_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_SStructGridSetNumGhost_flt( HYPRE_SStructGrid grid, HYPRE_Int *num_ghost ); +HYPRE_Int +HYPRE_SStructGridSetNumGhost_dbl( HYPRE_SStructGrid grid, HYPRE_Int *num_ghost ); +HYPRE_Int +HYPRE_SStructGridSetNumGhost_long_dbl( HYPRE_SStructGrid grid, HYPRE_Int *num_ghost ); +HYPRE_Int +HYPRE_SStructGridSetNumGhost( HYPRE_SStructGrid grid, HYPRE_Int *num_ghost ); + +HYPRE_Int +HYPRE_SStructGridSetPeriodic_flt( HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int *periodic ); +HYPRE_Int +HYPRE_SStructGridSetPeriodic_dbl( HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int *periodic ); +HYPRE_Int +HYPRE_SStructGridSetPeriodic_long_dbl( HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int *periodic ); +HYPRE_Int +HYPRE_SStructGridSetPeriodic( HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int *periodic ); + +HYPRE_Int +HYPRE_SStructGridSetSharedPart_flt( 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_SStructGridSetSharedPart_dbl( 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_SStructGridSetSharedPart_long_dbl( 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_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_SStructGridSetVariables_flt( HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int nvars, HYPRE_SStructVariable *vartypes ); +HYPRE_Int +HYPRE_SStructGridSetVariables_dbl( HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int nvars, HYPRE_SStructVariable *vartypes ); +HYPRE_Int +HYPRE_SStructGridSetVariables_long_dbl( 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_Int +HYPRE_SStructInnerProd_flt( HYPRE_SStructVector x, HYPRE_SStructVector y, hypre_float *result ); +HYPRE_Int +HYPRE_SStructInnerProd_dbl( HYPRE_SStructVector x, HYPRE_SStructVector y, hypre_double *result ); +HYPRE_Int +HYPRE_SStructInnerProd_long_dbl( HYPRE_SStructVector x, HYPRE_SStructVector y, hypre_long_double *result ); +HYPRE_Int +HYPRE_SStructInnerProd( HYPRE_SStructVector x, HYPRE_SStructVector y, void *result ); + +HYPRE_Int +HYPRE_SStructMatrixAddFEMBoxValues_flt( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, hypre_float *values ); +HYPRE_Int +HYPRE_SStructMatrixAddFEMBoxValues_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, hypre_double *values ); +HYPRE_Int +HYPRE_SStructMatrixAddFEMBoxValues_long_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, hypre_long_double *values ); +HYPRE_Int +HYPRE_SStructMatrixAddFEMBoxValues( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, void *values ); + +HYPRE_Int +HYPRE_SStructMatrixAddFEMValues_flt( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, hypre_float *values ); +HYPRE_Int +HYPRE_SStructMatrixAddFEMValues_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, hypre_double *values ); +HYPRE_Int +HYPRE_SStructMatrixAddFEMValues_long_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, hypre_long_double *values ); +HYPRE_Int +HYPRE_SStructMatrixAddFEMValues( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, void *values ); + +HYPRE_Int +HYPRE_SStructMatrixAddToBoxValues_flt( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_float *values ); +HYPRE_Int +HYPRE_SStructMatrixAddToBoxValues_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_double *values ); +HYPRE_Int +HYPRE_SStructMatrixAddToBoxValues_long_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_long_double *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, void *values ); + +HYPRE_Int +HYPRE_SStructMatrixAddToBoxValues2_flt( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_float *values ); +HYPRE_Int +HYPRE_SStructMatrixAddToBoxValues2_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_double *values ); +HYPRE_Int +HYPRE_SStructMatrixAddToBoxValues2_long_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_long_double *values ); +HYPRE_Int +HYPRE_SStructMatrixAddToBoxValues2( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ); + +HYPRE_Int +HYPRE_SStructMatrixAddToValues_flt( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_float *values ); +HYPRE_Int +HYPRE_SStructMatrixAddToValues_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_double *values ); +HYPRE_Int +HYPRE_SStructMatrixAddToValues_long_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_long_double *values ); +HYPRE_Int +HYPRE_SStructMatrixAddToValues( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, void *values ); + +HYPRE_Int +HYPRE_SStructMatrixAssemble_flt( HYPRE_SStructMatrix matrix ); +HYPRE_Int +HYPRE_SStructMatrixAssemble_dbl( HYPRE_SStructMatrix matrix ); +HYPRE_Int +HYPRE_SStructMatrixAssemble_long_dbl( HYPRE_SStructMatrix matrix ); +HYPRE_Int +HYPRE_SStructMatrixAssemble( HYPRE_SStructMatrix matrix ); + +HYPRE_Int +HYPRE_SStructMatrixCreate_flt( MPI_Comm comm, HYPRE_SStructGraph graph, HYPRE_SStructMatrix *matrix ); +HYPRE_Int +HYPRE_SStructMatrixCreate_dbl( MPI_Comm comm, HYPRE_SStructGraph graph, HYPRE_SStructMatrix *matrix ); +HYPRE_Int +HYPRE_SStructMatrixCreate_long_dbl( MPI_Comm comm, HYPRE_SStructGraph graph, HYPRE_SStructMatrix *matrix ); +HYPRE_Int +HYPRE_SStructMatrixCreate( MPI_Comm comm, HYPRE_SStructGraph graph, HYPRE_SStructMatrix *matrix ); + +HYPRE_Int +HYPRE_SStructMatrixDestroy_flt( HYPRE_SStructMatrix matrix ); +HYPRE_Int +HYPRE_SStructMatrixDestroy_dbl( HYPRE_SStructMatrix matrix ); +HYPRE_Int +HYPRE_SStructMatrixDestroy_long_dbl( HYPRE_SStructMatrix matrix ); +HYPRE_Int +HYPRE_SStructMatrixDestroy( HYPRE_SStructMatrix matrix ); + +HYPRE_Int +HYPRE_SStructMatrixGetBoxValues_flt( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_float *values ); +HYPRE_Int +HYPRE_SStructMatrixGetBoxValues_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_double *values ); +HYPRE_Int +HYPRE_SStructMatrixGetBoxValues_long_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_long_double *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, void *values ); + +HYPRE_Int +HYPRE_SStructMatrixGetBoxValues2_flt( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_float *values ); +HYPRE_Int +HYPRE_SStructMatrixGetBoxValues2_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_double *values ); +HYPRE_Int +HYPRE_SStructMatrixGetBoxValues2_long_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_long_double *values ); +HYPRE_Int +HYPRE_SStructMatrixGetBoxValues2( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ); + +HYPRE_Int +HYPRE_SStructMatrixGetFEMValues_flt( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, hypre_float *values ); +HYPRE_Int +HYPRE_SStructMatrixGetFEMValues_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, hypre_double *values ); +HYPRE_Int +HYPRE_SStructMatrixGetFEMValues_long_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, hypre_long_double *values ); +HYPRE_Int +HYPRE_SStructMatrixGetFEMValues( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, void *values ); + +HYPRE_Int +HYPRE_SStructMatrixGetGrid_flt( HYPRE_SStructMatrix matrix, HYPRE_SStructGrid *grid ); +HYPRE_Int +HYPRE_SStructMatrixGetGrid_dbl( HYPRE_SStructMatrix matrix, HYPRE_SStructGrid *grid ); +HYPRE_Int +HYPRE_SStructMatrixGetGrid_long_dbl( HYPRE_SStructMatrix matrix, HYPRE_SStructGrid *grid ); +HYPRE_Int +HYPRE_SStructMatrixGetGrid( HYPRE_SStructMatrix matrix, HYPRE_SStructGrid *grid ); + +HYPRE_Int +HYPRE_SStructMatrixGetObject_flt( HYPRE_SStructMatrix matrix, void **object ); +HYPRE_Int +HYPRE_SStructMatrixGetObject_dbl( HYPRE_SStructMatrix matrix, void **object ); +HYPRE_Int +HYPRE_SStructMatrixGetObject_long_dbl( HYPRE_SStructMatrix matrix, void **object ); +HYPRE_Int +HYPRE_SStructMatrixGetObject( HYPRE_SStructMatrix matrix, void **object ); + +HYPRE_Int +HYPRE_SStructMatrixGetValues_flt( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_float *values ); +HYPRE_Int +HYPRE_SStructMatrixGetValues_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_double *values ); +HYPRE_Int +HYPRE_SStructMatrixGetValues_long_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_long_double *values ); +HYPRE_Int +HYPRE_SStructMatrixGetValues( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, void *values ); + +HYPRE_Int +HYPRE_SStructMatrixInitialize_flt( HYPRE_SStructMatrix matrix ); +HYPRE_Int +HYPRE_SStructMatrixInitialize_dbl( HYPRE_SStructMatrix matrix ); +HYPRE_Int +HYPRE_SStructMatrixInitialize_long_dbl( HYPRE_SStructMatrix matrix ); +HYPRE_Int +HYPRE_SStructMatrixInitialize( HYPRE_SStructMatrix matrix ); + +HYPRE_Int +HYPRE_SStructMatrixMatmat_flt( HYPRE_SStructMatrix A, HYPRE_SStructMatrix B, HYPRE_SStructMatrix *C ); +HYPRE_Int +HYPRE_SStructMatrixMatmat_dbl( HYPRE_SStructMatrix A, HYPRE_SStructMatrix B, HYPRE_SStructMatrix *C ); +HYPRE_Int +HYPRE_SStructMatrixMatmat_long_dbl( HYPRE_SStructMatrix A, HYPRE_SStructMatrix B, HYPRE_SStructMatrix *C ); +HYPRE_Int +HYPRE_SStructMatrixMatmat( HYPRE_SStructMatrix A, HYPRE_SStructMatrix B, HYPRE_SStructMatrix *C ); + +HYPRE_Int +HYPRE_SStructMatrixMatvec_flt( hypre_float alpha, HYPRE_SStructMatrix A, HYPRE_SStructVector x, hypre_float beta, HYPRE_SStructVector y ); +HYPRE_Int +HYPRE_SStructMatrixMatvec_dbl( hypre_double alpha, HYPRE_SStructMatrix A, HYPRE_SStructVector x, hypre_double beta, HYPRE_SStructVector y ); +HYPRE_Int +HYPRE_SStructMatrixMatvec_long_dbl( hypre_long_double alpha, HYPRE_SStructMatrix A, HYPRE_SStructVector x, hypre_long_double beta, HYPRE_SStructVector y ); +HYPRE_Int +HYPRE_SStructMatrixMatvec( hypre_long_double alpha, HYPRE_SStructMatrix A, HYPRE_SStructVector x, hypre_long_double beta, HYPRE_SStructVector y ); + +HYPRE_Int +HYPRE_SStructMatrixPrint_flt( const char *filename, HYPRE_SStructMatrix matrix, HYPRE_Int all ); +HYPRE_Int +HYPRE_SStructMatrixPrint_dbl( const char *filename, HYPRE_SStructMatrix matrix, HYPRE_Int all ); +HYPRE_Int +HYPRE_SStructMatrixPrint_long_dbl( const char *filename, HYPRE_SStructMatrix matrix, HYPRE_Int all ); +HYPRE_Int +HYPRE_SStructMatrixPrint( const char *filename, HYPRE_SStructMatrix matrix, HYPRE_Int all ); + +HYPRE_Int +HYPRE_SStructMatrixRead_flt( MPI_Comm comm, const char *filename, HYPRE_SStructMatrix *matrix_ptr ); +HYPRE_Int +HYPRE_SStructMatrixRead_dbl( MPI_Comm comm, const char *filename, HYPRE_SStructMatrix *matrix_ptr ); +HYPRE_Int +HYPRE_SStructMatrixRead_long_dbl( MPI_Comm comm, const char *filename, HYPRE_SStructMatrix *matrix_ptr ); +HYPRE_Int +HYPRE_SStructMatrixRead( MPI_Comm comm, const char *filename, HYPRE_SStructMatrix *matrix_ptr ); + +HYPRE_Int +HYPRE_SStructMatrixSetBoxValues_flt( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_float *values ); +HYPRE_Int +HYPRE_SStructMatrixSetBoxValues_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_double *values ); +HYPRE_Int +HYPRE_SStructMatrixSetBoxValues_long_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_long_double *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, void *values ); + +HYPRE_Int +HYPRE_SStructMatrixSetBoxValues2_flt( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_float *values ); +HYPRE_Int +HYPRE_SStructMatrixSetBoxValues2_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_double *values ); +HYPRE_Int +HYPRE_SStructMatrixSetBoxValues2_long_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_long_double *values ); +HYPRE_Int +HYPRE_SStructMatrixSetBoxValues2( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ); + +HYPRE_Int +HYPRE_SStructMatrixSetConstantEntries_flt( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int var, HYPRE_Int to_var, HYPRE_Int nentries, HYPRE_Int *centries ); +HYPRE_Int +HYPRE_SStructMatrixSetConstantEntries_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int var, HYPRE_Int to_var, HYPRE_Int nentries, HYPRE_Int *centries ); +HYPRE_Int +HYPRE_SStructMatrixSetConstantEntries_long_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int var, HYPRE_Int to_var, HYPRE_Int nentries, HYPRE_Int *centries ); +HYPRE_Int +HYPRE_SStructMatrixSetConstantEntries( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int var, HYPRE_Int to_var, HYPRE_Int nentries, HYPRE_Int *centries ); + +HYPRE_Int +HYPRE_SStructMatrixSetDomainStride_flt( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *dom_stride ); +HYPRE_Int +HYPRE_SStructMatrixSetDomainStride_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *dom_stride ); +HYPRE_Int +HYPRE_SStructMatrixSetDomainStride_long_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *dom_stride ); +HYPRE_Int +HYPRE_SStructMatrixSetDomainStride( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *dom_stride ); + +HYPRE_Int +HYPRE_SStructMatrixSetEarlyAssemble_flt( HYPRE_SStructMatrix matrix, HYPRE_Int early_assemble ); +HYPRE_Int +HYPRE_SStructMatrixSetEarlyAssemble_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int early_assemble ); +HYPRE_Int +HYPRE_SStructMatrixSetEarlyAssemble_long_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int early_assemble ); +HYPRE_Int +HYPRE_SStructMatrixSetEarlyAssemble( HYPRE_SStructMatrix matrix, HYPRE_Int early_assemble ); + +HYPRE_Int +HYPRE_SStructMatrixSetNSSymmetric_flt( HYPRE_SStructMatrix matrix, HYPRE_Int symmetric ); +HYPRE_Int +HYPRE_SStructMatrixSetNSSymmetric_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int symmetric ); +HYPRE_Int +HYPRE_SStructMatrixSetNSSymmetric_long_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int symmetric ); +HYPRE_Int +HYPRE_SStructMatrixSetNSSymmetric( HYPRE_SStructMatrix matrix, HYPRE_Int symmetric ); + +HYPRE_Int +HYPRE_SStructMatrixSetObjectType_flt( HYPRE_SStructMatrix matrix, HYPRE_Int type ); +HYPRE_Int +HYPRE_SStructMatrixSetObjectType_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int type ); +HYPRE_Int +HYPRE_SStructMatrixSetObjectType_long_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int type ); +HYPRE_Int +HYPRE_SStructMatrixSetObjectType( HYPRE_SStructMatrix matrix, HYPRE_Int type ); + +HYPRE_Int +HYPRE_SStructMatrixSetRangeStride_flt( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ran_stride ); +HYPRE_Int +HYPRE_SStructMatrixSetRangeStride_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ran_stride ); +HYPRE_Int +HYPRE_SStructMatrixSetRangeStride_long_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ran_stride ); +HYPRE_Int +HYPRE_SStructMatrixSetRangeStride( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ran_stride ); + +HYPRE_Int +HYPRE_SStructMatrixSetSymmetric_flt( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int var, HYPRE_Int to_var, HYPRE_Int symmetric ); +HYPRE_Int +HYPRE_SStructMatrixSetSymmetric_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int var, HYPRE_Int to_var, HYPRE_Int symmetric ); +HYPRE_Int +HYPRE_SStructMatrixSetSymmetric_long_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int var, HYPRE_Int to_var, HYPRE_Int symmetric ); +HYPRE_Int +HYPRE_SStructMatrixSetSymmetric( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int var, HYPRE_Int to_var, HYPRE_Int symmetric ); + +HYPRE_Int +HYPRE_SStructMatrixSetValues_flt( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_float *values ); +HYPRE_Int +HYPRE_SStructMatrixSetValues_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_double *values ); +HYPRE_Int +HYPRE_SStructMatrixSetValues_long_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_long_double *values ); +HYPRE_Int +HYPRE_SStructMatrixSetValues( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, void *values ); + +HYPRE_Int +HYPRE_SStructMatrixToIJMatrix_flt( HYPRE_SStructMatrix matrix, HYPRE_Int fill_diagonal, HYPRE_IJMatrix *ijmatrix ); +HYPRE_Int +HYPRE_SStructMatrixToIJMatrix_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int fill_diagonal, HYPRE_IJMatrix *ijmatrix ); +HYPRE_Int +HYPRE_SStructMatrixToIJMatrix_long_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int fill_diagonal, HYPRE_IJMatrix *ijmatrix ); +HYPRE_Int +HYPRE_SStructMatrixToIJMatrix( HYPRE_SStructMatrix matrix, HYPRE_Int fill_diagonal, HYPRE_IJMatrix *ijmatrix ); + +HYPRE_Int +HYPRE_SStructStencilCreate_flt( HYPRE_Int ndim, HYPRE_Int size, HYPRE_SStructStencil *stencil ); +HYPRE_Int +HYPRE_SStructStencilCreate_dbl( HYPRE_Int ndim, HYPRE_Int size, HYPRE_SStructStencil *stencil ); +HYPRE_Int +HYPRE_SStructStencilCreate_long_dbl( HYPRE_Int ndim, HYPRE_Int size, HYPRE_SStructStencil *stencil ); +HYPRE_Int +HYPRE_SStructStencilCreate( HYPRE_Int ndim, HYPRE_Int size, HYPRE_SStructStencil *stencil ); + +HYPRE_Int +HYPRE_SStructStencilDestroy_flt( HYPRE_SStructStencil stencil ); +HYPRE_Int +HYPRE_SStructStencilDestroy_dbl( HYPRE_SStructStencil stencil ); +HYPRE_Int +HYPRE_SStructStencilDestroy_long_dbl( HYPRE_SStructStencil stencil ); +HYPRE_Int +HYPRE_SStructStencilDestroy( HYPRE_SStructStencil stencil ); + +HYPRE_Int +HYPRE_SStructStencilPrint_flt( FILE *file, HYPRE_SStructStencil stencil ); +HYPRE_Int +HYPRE_SStructStencilPrint_dbl( FILE *file, HYPRE_SStructStencil stencil ); +HYPRE_Int +HYPRE_SStructStencilPrint_long_dbl( FILE *file, HYPRE_SStructStencil stencil ); +HYPRE_Int +HYPRE_SStructStencilPrint( FILE *file, HYPRE_SStructStencil stencil ); + +HYPRE_Int +HYPRE_SStructStencilRead_flt( FILE *file, HYPRE_SStructStencil *stencil_ptr ); +HYPRE_Int +HYPRE_SStructStencilRead_dbl( FILE *file, HYPRE_SStructStencil *stencil_ptr ); +HYPRE_Int +HYPRE_SStructStencilRead_long_dbl( FILE *file, HYPRE_SStructStencil *stencil_ptr ); +HYPRE_Int +HYPRE_SStructStencilRead( FILE *file, HYPRE_SStructStencil *stencil_ptr ); + +HYPRE_Int +HYPRE_SStructStencilSetEntry_flt( HYPRE_SStructStencil stencil, HYPRE_Int entry, HYPRE_Int *offset, HYPRE_Int var ); +HYPRE_Int +HYPRE_SStructStencilSetEntry_dbl( HYPRE_SStructStencil stencil, HYPRE_Int entry, HYPRE_Int *offset, HYPRE_Int var ); +HYPRE_Int +HYPRE_SStructStencilSetEntry_long_dbl( 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_SStructVectorAddFEMBoxValues_flt( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, hypre_float *values ); +HYPRE_Int +HYPRE_SStructVectorAddFEMBoxValues_dbl( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, hypre_double *values ); +HYPRE_Int +HYPRE_SStructVectorAddFEMBoxValues_long_dbl( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, hypre_long_double *values ); +HYPRE_Int +HYPRE_SStructVectorAddFEMBoxValues( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, void *values ); + +HYPRE_Int +HYPRE_SStructVectorAddFEMValues_flt( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, hypre_float *values ); +HYPRE_Int +HYPRE_SStructVectorAddFEMValues_dbl( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, hypre_double *values ); +HYPRE_Int +HYPRE_SStructVectorAddFEMValues_long_dbl( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, hypre_long_double *values ); +HYPRE_Int +HYPRE_SStructVectorAddFEMValues( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, void *values ); + +HYPRE_Int +HYPRE_SStructVectorAddToBoxValues_flt( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, hypre_float *values ); +HYPRE_Int +HYPRE_SStructVectorAddToBoxValues_dbl( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, hypre_double *values ); +HYPRE_Int +HYPRE_SStructVectorAddToBoxValues_long_dbl( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, hypre_long_double *values ); +HYPRE_Int +HYPRE_SStructVectorAddToBoxValues( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, void *values ); + +HYPRE_Int +HYPRE_SStructVectorAddToBoxValues2_flt( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_float *values ); +HYPRE_Int +HYPRE_SStructVectorAddToBoxValues2_dbl( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_double *values ); +HYPRE_Int +HYPRE_SStructVectorAddToBoxValues2_long_dbl( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_long_double *values ); +HYPRE_Int +HYPRE_SStructVectorAddToBoxValues2( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ); + +HYPRE_Int +HYPRE_SStructVectorAddToValues_flt( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, hypre_float *value ); +HYPRE_Int +HYPRE_SStructVectorAddToValues_dbl( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, hypre_double *value ); +HYPRE_Int +HYPRE_SStructVectorAddToValues_long_dbl( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, hypre_long_double *value ); +HYPRE_Int +HYPRE_SStructVectorAddToValues( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, void *value ); + +HYPRE_Int +HYPRE_SStructVectorAssemble_flt( HYPRE_SStructVector vector ); +HYPRE_Int +HYPRE_SStructVectorAssemble_dbl( HYPRE_SStructVector vector ); +HYPRE_Int +HYPRE_SStructVectorAssemble_long_dbl( HYPRE_SStructVector vector ); +HYPRE_Int +HYPRE_SStructVectorAssemble( HYPRE_SStructVector vector ); + +HYPRE_Int +HYPRE_SStructVectorAxpy_flt( hypre_float alpha, HYPRE_SStructVector x, HYPRE_SStructVector y ); +HYPRE_Int +HYPRE_SStructVectorAxpy_dbl( hypre_double alpha, HYPRE_SStructVector x, HYPRE_SStructVector y ); +HYPRE_Int +HYPRE_SStructVectorAxpy_long_dbl( hypre_long_double alpha, HYPRE_SStructVector x, HYPRE_SStructVector y ); +HYPRE_Int +HYPRE_SStructVectorAxpy( hypre_long_double alpha, HYPRE_SStructVector x, HYPRE_SStructVector y ); + +HYPRE_Int +HYPRE_SStructVectorCopy_flt( HYPRE_SStructVector x, HYPRE_SStructVector y ); +HYPRE_Int +HYPRE_SStructVectorCopy_dbl( HYPRE_SStructVector x, HYPRE_SStructVector y ); +HYPRE_Int +HYPRE_SStructVectorCopy_long_dbl( HYPRE_SStructVector x, HYPRE_SStructVector y ); +HYPRE_Int +HYPRE_SStructVectorCopy( HYPRE_SStructVector x, HYPRE_SStructVector y ); + +HYPRE_Int +HYPRE_SStructVectorCreate_flt( MPI_Comm comm, HYPRE_SStructGrid grid, HYPRE_SStructVector *vector ); +HYPRE_Int +HYPRE_SStructVectorCreate_dbl( MPI_Comm comm, HYPRE_SStructGrid grid, HYPRE_SStructVector *vector ); +HYPRE_Int +HYPRE_SStructVectorCreate_long_dbl( MPI_Comm comm, HYPRE_SStructGrid grid, HYPRE_SStructVector *vector ); +HYPRE_Int +HYPRE_SStructVectorCreate( MPI_Comm comm, HYPRE_SStructGrid grid, HYPRE_SStructVector *vector ); + +HYPRE_Int +HYPRE_SStructVectorDestroy_flt( HYPRE_SStructVector vector ); +HYPRE_Int +HYPRE_SStructVectorDestroy_dbl( HYPRE_SStructVector vector ); +HYPRE_Int +HYPRE_SStructVectorDestroy_long_dbl( HYPRE_SStructVector vector ); +HYPRE_Int +HYPRE_SStructVectorDestroy( HYPRE_SStructVector vector ); + +HYPRE_Int +HYPRE_SStructVectorGather_flt( HYPRE_SStructVector vector ); +HYPRE_Int +HYPRE_SStructVectorGather_dbl( HYPRE_SStructVector vector ); +HYPRE_Int +HYPRE_SStructVectorGather_long_dbl( HYPRE_SStructVector vector ); +HYPRE_Int +HYPRE_SStructVectorGather( HYPRE_SStructVector vector ); + +HYPRE_Int +HYPRE_SStructVectorGetBoxValues_flt( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, hypre_float *values ); +HYPRE_Int +HYPRE_SStructVectorGetBoxValues_dbl( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, hypre_double *values ); +HYPRE_Int +HYPRE_SStructVectorGetBoxValues_long_dbl( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, hypre_long_double *values ); +HYPRE_Int +HYPRE_SStructVectorGetBoxValues( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, void *values ); + +HYPRE_Int +HYPRE_SStructVectorGetBoxValues2_flt( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_float *values ); +HYPRE_Int +HYPRE_SStructVectorGetBoxValues2_dbl( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_double *values ); +HYPRE_Int +HYPRE_SStructVectorGetBoxValues2_long_dbl( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_long_double *values ); +HYPRE_Int +HYPRE_SStructVectorGetBoxValues2( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ); + +HYPRE_Int +HYPRE_SStructVectorGetFEMValues_flt( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, hypre_float *values ); +HYPRE_Int +HYPRE_SStructVectorGetFEMValues_dbl( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, hypre_double *values ); +HYPRE_Int +HYPRE_SStructVectorGetFEMValues_long_dbl( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, hypre_long_double *values ); +HYPRE_Int +HYPRE_SStructVectorGetFEMValues( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, void *values ); + +HYPRE_Int +HYPRE_SStructVectorGetObject_flt( HYPRE_SStructVector vector, void **object ); +HYPRE_Int +HYPRE_SStructVectorGetObject_dbl( HYPRE_SStructVector vector, void **object ); +HYPRE_Int +HYPRE_SStructVectorGetObject_long_dbl( HYPRE_SStructVector vector, void **object ); +HYPRE_Int +HYPRE_SStructVectorGetObject( HYPRE_SStructVector vector, void **object ); + +HYPRE_Int +HYPRE_SStructVectorGetValues_flt( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, hypre_float *value ); +HYPRE_Int +HYPRE_SStructVectorGetValues_dbl( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, hypre_double *value ); +HYPRE_Int +HYPRE_SStructVectorGetValues_long_dbl( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, hypre_long_double *value ); +HYPRE_Int +HYPRE_SStructVectorGetValues( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, void *value ); + +HYPRE_Int +HYPRE_SStructVectorInitialize_flt( HYPRE_SStructVector vector ); +HYPRE_Int +HYPRE_SStructVectorInitialize_dbl( HYPRE_SStructVector vector ); +HYPRE_Int +HYPRE_SStructVectorInitialize_long_dbl( HYPRE_SStructVector vector ); +HYPRE_Int +HYPRE_SStructVectorInitialize( HYPRE_SStructVector vector ); + +HYPRE_Int +HYPRE_SStructVectorInnerProd_flt( HYPRE_SStructVector x, HYPRE_SStructVector y, hypre_float *result ); +HYPRE_Int +HYPRE_SStructVectorInnerProd_dbl( HYPRE_SStructVector x, HYPRE_SStructVector y, hypre_double *result ); +HYPRE_Int +HYPRE_SStructVectorInnerProd_long_dbl( HYPRE_SStructVector x, HYPRE_SStructVector y, hypre_long_double *result ); +HYPRE_Int +HYPRE_SStructVectorInnerProd( HYPRE_SStructVector x, HYPRE_SStructVector y, void *result ); + +HYPRE_Int +HYPRE_SStructVectorPrint_flt( const char *filename, HYPRE_SStructVector vector, HYPRE_Int all ); +HYPRE_Int +HYPRE_SStructVectorPrint_dbl( const char *filename, HYPRE_SStructVector vector, HYPRE_Int all ); +HYPRE_Int +HYPRE_SStructVectorPrint_long_dbl( const char *filename, HYPRE_SStructVector vector, HYPRE_Int all ); +HYPRE_Int +HYPRE_SStructVectorPrint( const char *filename, HYPRE_SStructVector vector, HYPRE_Int all ); + +HYPRE_Int +HYPRE_SStructVectorPrintGLVis_flt( HYPRE_SStructVector vector, const char *fileprefix ); +HYPRE_Int +HYPRE_SStructVectorPrintGLVis_dbl( HYPRE_SStructVector vector, const char *fileprefix ); +HYPRE_Int +HYPRE_SStructVectorPrintGLVis_long_dbl( HYPRE_SStructVector vector, const char *fileprefix ); +HYPRE_Int +HYPRE_SStructVectorPrintGLVis( HYPRE_SStructVector vector, const char *fileprefix ); + +HYPRE_Int +HYPRE_SStructVectorRead_flt( MPI_Comm comm, const char *filename, HYPRE_SStructVector *vector_ptr ); +HYPRE_Int +HYPRE_SStructVectorRead_dbl( MPI_Comm comm, const char *filename, HYPRE_SStructVector *vector_ptr ); +HYPRE_Int +HYPRE_SStructVectorRead_long_dbl( MPI_Comm comm, const char *filename, HYPRE_SStructVector *vector_ptr ); +HYPRE_Int +HYPRE_SStructVectorRead( MPI_Comm comm, const char *filename, HYPRE_SStructVector *vector_ptr ); + +HYPRE_Int +HYPRE_SStructVectorScale_flt( hypre_float alpha, HYPRE_SStructVector y ); +HYPRE_Int +HYPRE_SStructVectorScale_dbl( hypre_double alpha, HYPRE_SStructVector y ); +HYPRE_Int +HYPRE_SStructVectorScale_long_dbl( hypre_long_double alpha, HYPRE_SStructVector y ); +HYPRE_Int +HYPRE_SStructVectorScale( hypre_long_double alpha, HYPRE_SStructVector y ); + +HYPRE_Int +HYPRE_SStructVectorSetBoxValues_flt( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, hypre_float *values ); +HYPRE_Int +HYPRE_SStructVectorSetBoxValues_dbl( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, hypre_double *values ); +HYPRE_Int +HYPRE_SStructVectorSetBoxValues_long_dbl( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, hypre_long_double *values ); +HYPRE_Int +HYPRE_SStructVectorSetBoxValues( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, void *values ); + +HYPRE_Int +HYPRE_SStructVectorSetBoxValues2_flt( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_float *values ); +HYPRE_Int +HYPRE_SStructVectorSetBoxValues2_dbl( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_double *values ); +HYPRE_Int +HYPRE_SStructVectorSetBoxValues2_long_dbl( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_long_double *values ); +HYPRE_Int +HYPRE_SStructVectorSetBoxValues2( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ); + +HYPRE_Int +HYPRE_SStructVectorSetConstantValues_flt( HYPRE_SStructVector vector, hypre_float value ); +HYPRE_Int +HYPRE_SStructVectorSetConstantValues_dbl( HYPRE_SStructVector vector, hypre_double value ); +HYPRE_Int +HYPRE_SStructVectorSetConstantValues_long_dbl( HYPRE_SStructVector vector, hypre_long_double value ); +HYPRE_Int +HYPRE_SStructVectorSetConstantValues( HYPRE_SStructVector vector, hypre_long_double value ); + +HYPRE_Int +HYPRE_SStructVectorSetObjectType_flt( HYPRE_SStructVector vector, HYPRE_Int type ); +HYPRE_Int +HYPRE_SStructVectorSetObjectType_dbl( HYPRE_SStructVector vector, HYPRE_Int type ); +HYPRE_Int +HYPRE_SStructVectorSetObjectType_long_dbl( HYPRE_SStructVector vector, HYPRE_Int type ); +HYPRE_Int +HYPRE_SStructVectorSetObjectType( HYPRE_SStructVector vector, HYPRE_Int type ); + +HYPRE_Int +HYPRE_SStructVectorSetRandomValues_flt( HYPRE_SStructVector vector, HYPRE_Int seed ); +HYPRE_Int +HYPRE_SStructVectorSetRandomValues_dbl( HYPRE_SStructVector vector, HYPRE_Int seed ); +HYPRE_Int +HYPRE_SStructVectorSetRandomValues_long_dbl( HYPRE_SStructVector vector, HYPRE_Int seed ); +HYPRE_Int +HYPRE_SStructVectorSetRandomValues( HYPRE_SStructVector vector, HYPRE_Int seed ); + +HYPRE_Int +HYPRE_SStructVectorSetValues_flt( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, hypre_float *value ); +HYPRE_Int +HYPRE_SStructVectorSetValues_dbl( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, hypre_double *value ); +HYPRE_Int +HYPRE_SStructVectorSetValues_long_dbl( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, hypre_long_double *value ); +HYPRE_Int +HYPRE_SStructVectorSetValues( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, void *value ); + + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_SStructAxpy_pre( HYPRE_Precision precision, hypre_long_double alpha, HYPRE_SStructVector x, HYPRE_SStructVector y ); + +HYPRE_Int +HYPRE_SStructGraphAddEntries_pre( HYPRE_Precision precision, 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_pre( HYPRE_Precision precision, HYPRE_SStructGraph graph ); + +HYPRE_Int +HYPRE_SStructGraphCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_SStructGrid grid, HYPRE_SStructGraph *graph ); + +HYPRE_Int +HYPRE_SStructGraphDestroy_pre( HYPRE_Precision precision, HYPRE_SStructGraph graph ); + +HYPRE_Int +HYPRE_SStructGraphPrint_pre( HYPRE_Precision precision, FILE *file, HYPRE_SStructGraph graph ); + +HYPRE_Int +HYPRE_SStructGraphRead_pre( HYPRE_Precision precision, FILE *file, HYPRE_SStructGrid grid, HYPRE_SStructStencil **stencils, HYPRE_SStructGraph *graph_ptr ); + +HYPRE_Int +HYPRE_SStructGraphSetDomainGrid_pre( HYPRE_Precision precision, HYPRE_SStructGraph graph, HYPRE_SStructGrid domain_grid ); + +HYPRE_Int +HYPRE_SStructGraphSetFEM_pre( HYPRE_Precision precision, HYPRE_SStructGraph graph, HYPRE_Int part ); + +HYPRE_Int +HYPRE_SStructGraphSetFEMSparsity_pre( HYPRE_Precision precision, HYPRE_SStructGraph graph, HYPRE_Int part, HYPRE_Int nsparse, HYPRE_Int *sparsity ); + +HYPRE_Int +HYPRE_SStructGraphSetObjectType_pre( HYPRE_Precision precision, HYPRE_SStructGraph graph, HYPRE_Int type ); + +HYPRE_Int +HYPRE_SStructGraphSetStencil_pre( HYPRE_Precision precision, HYPRE_SStructGraph graph, HYPRE_Int part, HYPRE_Int var, HYPRE_SStructStencil stencil ); + +HYPRE_Int +HYPRE_SStructGridAddVariables_pre( HYPRE_Precision precision, HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int nvars, HYPRE_SStructVariable *vartypes ); + +HYPRE_Int +HYPRE_SStructGridAssemble_pre( HYPRE_Precision precision, HYPRE_SStructGrid grid ); + +HYPRE_Int +HYPRE_SStructGridCoarsen_pre( HYPRE_Precision precision, HYPRE_SStructGrid fgrid, HYPRE_Index *strides, HYPRE_SStructGrid *cgrid ); + +HYPRE_Int +HYPRE_SStructGridCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_Int ndim, HYPRE_Int nparts, HYPRE_SStructGrid *grid ); + +HYPRE_Int +HYPRE_SStructGridDestroy_pre( HYPRE_Precision precision, HYPRE_SStructGrid grid ); + +HYPRE_Int +HYPRE_SStructGridGetVariableBox_pre( HYPRE_Precision precision, HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int var, HYPRE_Int *cell_ilower, HYPRE_Int *cell_iupper, HYPRE_Int *var_ilower, HYPRE_Int *var_iupper ); + +HYPRE_Int +HYPRE_SStructGridPrintGLVis_pre( HYPRE_Precision precision, HYPRE_SStructGrid grid, const char *meshprefix, void *trans, void *origin ); + +HYPRE_Int +HYPRE_SStructGridProjectBox_pre( HYPRE_Precision precision, HYPRE_SStructGrid grid, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *origin, HYPRE_Int *stride ); + +HYPRE_Int +HYPRE_SStructGridSetExtents_pre( HYPRE_Precision precision, HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper ); + +HYPRE_Int +HYPRE_SStructGridSetFEMOrdering_pre( HYPRE_Precision precision, HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int *ordering ); + +HYPRE_Int +HYPRE_SStructGridSetNeighborPart_pre( HYPRE_Precision precision, 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_SStructGridSetNumGhost_pre( HYPRE_Precision precision, HYPRE_SStructGrid grid, HYPRE_Int *num_ghost ); + +HYPRE_Int +HYPRE_SStructGridSetPeriodic_pre( HYPRE_Precision precision, HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int *periodic ); + +HYPRE_Int +HYPRE_SStructGridSetSharedPart_pre( HYPRE_Precision precision, 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_SStructGridSetVariables_pre( HYPRE_Precision precision, HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int nvars, HYPRE_SStructVariable *vartypes ); + +HYPRE_Int +HYPRE_SStructInnerProd_pre( HYPRE_Precision precision, HYPRE_SStructVector x, HYPRE_SStructVector y, void *result ); + +HYPRE_Int +HYPRE_SStructMatrixAddFEMBoxValues_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, void *values ); + +HYPRE_Int +HYPRE_SStructMatrixAddFEMValues_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, void *values ); + +HYPRE_Int +HYPRE_SStructMatrixAddToBoxValues_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, void *values ); + +HYPRE_Int +HYPRE_SStructMatrixAddToBoxValues2_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ); + +HYPRE_Int +HYPRE_SStructMatrixAddToValues_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, void *values ); + +HYPRE_Int +HYPRE_SStructMatrixAssemble_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix ); + +HYPRE_Int +HYPRE_SStructMatrixCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_SStructGraph graph, HYPRE_SStructMatrix *matrix ); + +HYPRE_Int +HYPRE_SStructMatrixDestroy_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix ); + +HYPRE_Int +HYPRE_SStructMatrixGetBoxValues_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, void *values ); + +HYPRE_Int +HYPRE_SStructMatrixGetBoxValues2_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ); + +HYPRE_Int +HYPRE_SStructMatrixGetFEMValues_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, void *values ); + +HYPRE_Int +HYPRE_SStructMatrixGetGrid_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_SStructGrid *grid ); + +HYPRE_Int +HYPRE_SStructMatrixGetObject_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, void **object ); + +HYPRE_Int +HYPRE_SStructMatrixGetValues_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, void *values ); + +HYPRE_Int +HYPRE_SStructMatrixInitialize_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix ); + +HYPRE_Int +HYPRE_SStructMatrixMatmat_pre( HYPRE_Precision precision, HYPRE_SStructMatrix A, HYPRE_SStructMatrix B, HYPRE_SStructMatrix *C ); + +HYPRE_Int +HYPRE_SStructMatrixMatvec_pre( HYPRE_Precision precision, hypre_long_double alpha, HYPRE_SStructMatrix A, HYPRE_SStructVector x, hypre_long_double beta, HYPRE_SStructVector y ); + +HYPRE_Int +HYPRE_SStructMatrixPrint_pre( HYPRE_Precision precision, const char *filename, HYPRE_SStructMatrix matrix, HYPRE_Int all ); + +HYPRE_Int +HYPRE_SStructMatrixRead_pre( HYPRE_Precision precision, MPI_Comm comm, const char *filename, HYPRE_SStructMatrix *matrix_ptr ); + +HYPRE_Int +HYPRE_SStructMatrixSetBoxValues_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, void *values ); + +HYPRE_Int +HYPRE_SStructMatrixSetBoxValues2_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ); + +HYPRE_Int +HYPRE_SStructMatrixSetConstantEntries_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int var, HYPRE_Int to_var, HYPRE_Int nentries, HYPRE_Int *centries ); + +HYPRE_Int +HYPRE_SStructMatrixSetDomainStride_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *dom_stride ); + +HYPRE_Int +HYPRE_SStructMatrixSetEarlyAssemble_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int early_assemble ); + +HYPRE_Int +HYPRE_SStructMatrixSetNSSymmetric_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int symmetric ); + +HYPRE_Int +HYPRE_SStructMatrixSetObjectType_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int type ); + +HYPRE_Int +HYPRE_SStructMatrixSetRangeStride_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ran_stride ); + +HYPRE_Int +HYPRE_SStructMatrixSetSymmetric_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int var, HYPRE_Int to_var, HYPRE_Int symmetric ); + +HYPRE_Int +HYPRE_SStructMatrixSetValues_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, void *values ); + +HYPRE_Int +HYPRE_SStructMatrixToIJMatrix_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int fill_diagonal, HYPRE_IJMatrix *ijmatrix ); + +HYPRE_Int +HYPRE_SStructStencilCreate_pre( HYPRE_Precision precision, HYPRE_Int ndim, HYPRE_Int size, HYPRE_SStructStencil *stencil ); + +HYPRE_Int +HYPRE_SStructStencilDestroy_pre( HYPRE_Precision precision, HYPRE_SStructStencil stencil ); + +HYPRE_Int +HYPRE_SStructStencilPrint_pre( HYPRE_Precision precision, FILE *file, HYPRE_SStructStencil stencil ); + +HYPRE_Int +HYPRE_SStructStencilRead_pre( HYPRE_Precision precision, FILE *file, HYPRE_SStructStencil *stencil_ptr ); + +HYPRE_Int +HYPRE_SStructStencilSetEntry_pre( HYPRE_Precision precision, HYPRE_SStructStencil stencil, HYPRE_Int entry, HYPRE_Int *offset, HYPRE_Int var ); + +HYPRE_Int +HYPRE_SStructVectorAddFEMBoxValues_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, void *values ); + +HYPRE_Int +HYPRE_SStructVectorAddFEMValues_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, void *values ); + +HYPRE_Int +HYPRE_SStructVectorAddToBoxValues_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, void *values ); + +HYPRE_Int +HYPRE_SStructVectorAddToBoxValues2_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ); + +HYPRE_Int +HYPRE_SStructVectorAddToValues_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, void *value ); + +HYPRE_Int +HYPRE_SStructVectorAssemble_pre( HYPRE_Precision precision, HYPRE_SStructVector vector ); + +HYPRE_Int +HYPRE_SStructVectorAxpy_pre( HYPRE_Precision precision, hypre_long_double alpha, HYPRE_SStructVector x, HYPRE_SStructVector y ); + +HYPRE_Int +HYPRE_SStructVectorCopy_pre( HYPRE_Precision precision, HYPRE_SStructVector x, HYPRE_SStructVector y ); + +HYPRE_Int +HYPRE_SStructVectorCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_SStructGrid grid, HYPRE_SStructVector *vector ); + +HYPRE_Int +HYPRE_SStructVectorDestroy_pre( HYPRE_Precision precision, HYPRE_SStructVector vector ); + +HYPRE_Int +HYPRE_SStructVectorGather_pre( HYPRE_Precision precision, HYPRE_SStructVector vector ); + +HYPRE_Int +HYPRE_SStructVectorGetBoxValues_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, void *values ); + +HYPRE_Int +HYPRE_SStructVectorGetBoxValues2_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ); + +HYPRE_Int +HYPRE_SStructVectorGetFEMValues_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, void *values ); + +HYPRE_Int +HYPRE_SStructVectorGetObject_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, void **object ); + +HYPRE_Int +HYPRE_SStructVectorGetValues_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, void *value ); + +HYPRE_Int +HYPRE_SStructVectorInitialize_pre( HYPRE_Precision precision, HYPRE_SStructVector vector ); + +HYPRE_Int +HYPRE_SStructVectorInnerProd_pre( HYPRE_Precision precision, HYPRE_SStructVector x, HYPRE_SStructVector y, void *result ); + +HYPRE_Int +HYPRE_SStructVectorPrint_pre( HYPRE_Precision precision, const char *filename, HYPRE_SStructVector vector, HYPRE_Int all ); + +HYPRE_Int +HYPRE_SStructVectorPrintGLVis_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, const char *fileprefix ); + +HYPRE_Int +HYPRE_SStructVectorRead_pre( HYPRE_Precision precision, MPI_Comm comm, const char *filename, HYPRE_SStructVector *vector_ptr ); + +HYPRE_Int +HYPRE_SStructVectorScale_pre( HYPRE_Precision precision, hypre_long_double alpha, HYPRE_SStructVector y ); + +HYPRE_Int +HYPRE_SStructVectorSetBoxValues_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, void *values ); + +HYPRE_Int +HYPRE_SStructVectorSetBoxValues2_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ); + +HYPRE_Int +HYPRE_SStructVectorSetConstantValues_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, hypre_long_double value ); + +HYPRE_Int +HYPRE_SStructVectorSetObjectType_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, HYPRE_Int type ); + +HYPRE_Int +HYPRE_SStructVectorSetRandomValues_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, HYPRE_Int seed ); + +HYPRE_Int +HYPRE_SStructVectorSetValues_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, void *value ); + + +#endif + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/src/sstruct_mv/HYPRE_sstruct_stencil.c b/src/sstruct_mv/HYPRE_sstruct_stencil.c index 541558651d..fb9eb4afc6 100644 --- a/src/sstruct_mv/HYPRE_sstruct_stencil.c +++ b/src/sstruct_mv/HYPRE_sstruct_stencil.c @@ -69,7 +69,7 @@ HYPRE_SStructStencilSetEntry( HYPRE_SStructStencil stencil, { hypre_StructStencil *sstencil = hypre_SStructStencilSStencil(stencil); - HYPRE_StructStencilSetElement(sstencil, entry, offset); + HYPRE_StructStencilSetEntry(sstencil, entry, offset); hypre_SStructStencilVar(stencil, entry) = var; return hypre_error_flag; diff --git a/src/sstruct_mv/HYPRE_sstruct_vector.c b/src/sstruct_mv/HYPRE_sstruct_vector.c index 50026a3995..2432bb6c89 100644 --- a/src/sstruct_mv/HYPRE_sstruct_vector.c +++ b/src/sstruct_mv/HYPRE_sstruct_vector.c @@ -28,6 +28,13 @@ HYPRE_SStructVectorCreate( MPI_Comm comm, hypre_SStructPGrid *pgrid; HYPRE_Int part; + /* Sanity check */ + if (!grid) + { + hypre_error_in_arg(2); + return hypre_error_flag; + } + vector = hypre_TAlloc(hypre_SStructVector, 1, HYPRE_MEMORY_HOST); hypre_SStructVectorComm(vector) = comm; @@ -99,7 +106,6 @@ HYPRE_SStructVectorDestroy( HYPRE_SStructVector vector ) } hypre_TFree(pvectors, HYPRE_MEMORY_HOST); 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 * ijvector does not use the owndata flag in the data structure @@ -108,6 +114,7 @@ HYPRE_SStructVectorDestroy( HYPRE_SStructVector vector ) /* GEC if data has been allocated then free the pointer */ hypre_TFree(hypre_SStructVectorDataIndices(vector), HYPRE_MEMORY_HOST); + /* TODO (VPM): shouldn't HYPRE_IJVectorDestroy be taking care of this free? */ if (hypre_SStructVectorData(vector) && (vector_type == HYPRE_PARCSR)) { hypre_TFree(hypre_SStructVectorData(vector), memory_location); @@ -171,7 +178,6 @@ HYPRE_SStructVectorInitialize( HYPRE_SStructVector vector ) { pvector = hypre_SStructVectorPVector(vector, part); pdataindices = hypre_SStructPVectorDataIndices(pvector); - /* shift-num = dataindices[part]; */ pdata = data + dataindices[part]; nvars = hypre_SStructPVectorNVars(pvector); @@ -180,14 +186,9 @@ HYPRE_SStructVectorInitialize( HYPRE_SStructVector vector ) for (var = 0; var < nvars; var++) { svector = hypre_SStructPVectorSVector(pvector, var); - /* shift-pnum = pdataindices[var]; */ sdata = pdata + pdataindices[var]; - - /* GEC1002 initialization of inside data pointer of a svector - * because no data is alloced, we make sure the flag is zero. This - * affects the destroy */ hypre_StructVectorInitializeData(svector, sdata); - hypre_StructVectorDataAlloced(svector) = 0; + if (vartypes[var] > 0) { /* needed to get AddTo accumulation correct between processors */ @@ -241,7 +242,7 @@ 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_VectorMemoryLocation(parlocal_vector)); hypre_VectorData(parlocal_vector) = data ; @@ -643,6 +644,7 @@ HYPRE_SStructVectorAssemble( HYPRE_SStructVector vector ) HYPRE_Int send_part, recv_part; HYPRE_Int send_var, recv_var; hypre_StructVector *send_vector, *recv_vector; + HYPRE_Complex *sdata, *rdata; hypre_CommPkg *comm_pkg; hypre_CommHandle *comm_handle; HYPRE_Int ci; @@ -678,13 +680,14 @@ HYPRE_SStructVectorAssemble( HYPRE_SStructVector vector ) hypre_StructVectorDataSpace(send_vector), hypre_StructVectorDataSpace(recv_vector), 1, NULL, 1, hypre_StructVectorComm(send_vector), + hypre_StructVectorMemoryLocation(send_vector), &comm_pkg); + /* note reversal of send/recv data here */ - hypre_InitializeCommunication(comm_pkg, - hypre_StructVectorData(recv_vector), - hypre_StructVectorData(send_vector), - 1, 0, &comm_handle); - hypre_FinalizeCommunication(comm_handle); + sdata = hypre_StructVectorData(send_vector); + rdata = hypre_StructVectorData(recv_vector); + hypre_StructCommunicationInitialize(comm_pkg, &rdata, &sdata, 1, 0, &comm_handle); + hypre_StructCommunicationFinalize(comm_handle); hypre_CommPkgDestroy(comm_pkg); } @@ -734,6 +737,7 @@ HYPRE_SStructVectorGather( HYPRE_SStructVector vector ) HYPRE_Int send_part, recv_part; HYPRE_Int send_var, recv_var; hypre_StructVector *send_vector, *recv_vector; + HYPRE_Complex *sdata, *rdata; hypre_CommPkg *comm_pkg; hypre_CommHandle *comm_handle; HYPRE_Int ci; @@ -770,12 +774,12 @@ HYPRE_SStructVectorGather( HYPRE_SStructVector vector ) hypre_StructVectorDataSpace(send_vector), hypre_StructVectorDataSpace(recv_vector), 1, NULL, 0, hypre_StructVectorComm(send_vector), + hypre_StructVectorMemoryLocation(send_vector), &comm_pkg); - hypre_InitializeCommunication(comm_pkg, - hypre_StructVectorData(send_vector), - hypre_StructVectorData(recv_vector), - 0, 0, &comm_handle); - hypre_FinalizeCommunication(comm_handle); + sdata = hypre_StructVectorData(send_vector); + rdata = hypre_StructVectorData(recv_vector); + hypre_StructCommunicationInitialize(comm_pkg, &sdata, &rdata, 0, 0, &comm_handle); + hypre_StructCommunicationFinalize(comm_handle); hypre_CommPkgDestroy(comm_pkg); /* boundary ghost values may not be clear */ @@ -792,17 +796,17 @@ HYPRE_Int HYPRE_SStructVectorSetConstantValues( HYPRE_SStructVector vector, HYPRE_Complex value ) { - hypre_SStructPVector *pvector; - HYPRE_Int part; - HYPRE_Int nparts = hypre_SStructVectorNParts(vector); + return (hypre_SStructVectorSetConstantValues(vector, value)); +} - for ( part = 0; part < nparts; part++ ) - { - pvector = hypre_SStructVectorPVector( vector, part ); - hypre_SStructPVectorSetConstantValues( pvector, value ); - } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ - return hypre_error_flag; +HYPRE_Int +HYPRE_SStructVectorSetRandomValues( HYPRE_SStructVector vector, + HYPRE_Int seed ) +{ + return (hypre_SStructVectorSetRandomValues(vector, seed)); } /*-------------------------------------------------------------------------- @@ -812,7 +816,6 @@ HYPRE_Int HYPRE_SStructVectorSetObjectType( HYPRE_SStructVector vector, HYPRE_Int type ) { - /* this implements only HYPRE_PARCSR, which is always available */ hypre_SStructVectorObjectType(vector) = type; return hypre_error_flag; @@ -852,8 +855,6 @@ HYPRE_SStructVectorGetObject( HYPRE_SStructVector vector, } /*-------------------------------------------------------------------------- - * HYPRE_SStructVectorPrint - * * This function prints a SStructVector to file. For the assumptions used * here, see HYPRE_SStructMatrixPrint. *--------------------------------------------------------------------------*/ @@ -911,7 +912,6 @@ HYPRE_SStructVectorPrint( const char *filename, } /*-------------------------------------------------------------------------- - * HYPRE_SStructVectorRead *--------------------------------------------------------------------------*/ HYPRE_Int @@ -981,6 +981,18 @@ HYPRE_SStructVectorRead( MPI_Comm comm, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorPrintGLVis( HYPRE_SStructVector vector, + const char *fileprefix ) +{ + hypre_SStructVectorPrintGLVis(vector, fileprefix); + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- * copy x to y, y should already exist and be the same size *--------------------------------------------------------------------------*/ @@ -1011,6 +1023,17 @@ HYPRE_SStructVectorScale( HYPRE_Complex alpha, * inner or dot product, result = < x, y > *--------------------------------------------------------------------------*/ +HYPRE_Int +HYPRE_SStructVectorInnerProd( HYPRE_SStructVector x, + HYPRE_SStructVector y, + HYPRE_Real *result ) +{ + hypre_SStructInnerProd(x, y, result); + + return hypre_error_flag; +} + +/* For backward compatibility */ HYPRE_Int HYPRE_SStructInnerProd( HYPRE_SStructVector x, HYPRE_SStructVector y, @@ -1025,6 +1048,17 @@ HYPRE_SStructInnerProd( HYPRE_SStructVector x, * y = y + alpha*x for vectors y, x and scalar alpha *--------------------------------------------------------------------------*/ +HYPRE_Int +HYPRE_SStructVectorAxpy( HYPRE_Complex alpha, + HYPRE_SStructVector x, + HYPRE_SStructVector y ) +{ + hypre_SStructAxpy(alpha, x, y); + + return hypre_error_flag; +} + +/* For backward compatibility */ HYPRE_Int HYPRE_SStructAxpy( HYPRE_Complex alpha, HYPRE_SStructVector x, diff --git a/src/sstruct_mv/Makefile b/src/sstruct_mv/Makefile index 24b49e15c4..63ab790c7d 100644 --- a/src/sstruct_mv/Makefile +++ b/src/sstruct_mv/Makefile @@ -45,6 +45,8 @@ FILES =\ sstruct_grid.c\ sstruct_innerprod.c\ sstruct_matvec.c\ + sstruct_matmult.c\ + sstruct_matop.c\ sstruct_scale.c\ sstruct_stencil.c @@ -52,10 +54,31 @@ CUFILES =\ sstruct_matrix.c\ sstruct_vector.c +# Mixed precision files +MP_FILES = \ + mup_fixed.c\ + mup_functions.c\ + mup_pre.c + COBJS = ${FILES:.c=.o} CUOBJS = ${CUFILES:.c=.obj} OBJS = ${COBJS} ${CUOBJS} +ifeq (${MP_BUILD}, 1) + +COBJS_single = ${FILES:.c=.o_flt} +COBJS_double = ${FILES:.c=.o_dbl} +COBJS_longdouble = ${FILES:.c=.o_ldbl} +CUOBJS_single = ${CUFILES:.c=.obj_flt} +CUOBJS_double = ${CUFILES:.c=.obj_dbl} +CUOBJS_longdouble = ${CUFILES:.c=.obj_ldbl} +MP_COBJS = ${MP_FILES:.c=.o} + +OBJS = ${COBJS_single} ${COBJS_double} ${COBJS_longdouble} ${MP_COBJS} +OBJS += ${CUOBJS_single} ${CUOBJS_double} ${CUOBJS_longdouble} + +endif + SONAME = libHYPRE_sstruct_mv-${HYPRE_RELEASE_VERSION}${HYPRE_LIB_SUFFIX} ################################################################## @@ -64,16 +87,18 @@ SONAME = libHYPRE_sstruct_mv-${HYPRE_RELEASE_VERSION}${HYPRE_LIB_SUFFIX} all: libHYPRE_sstruct_mv${HYPRE_LIB_SUFFIX} cp -fR $(srcdir)/HYPRE_*.h $(HYPRE_BUILD_DIR)/include - cp -fR $(srcdir)/_hypre_sstruct_mv.h $(HYPRE_BUILD_DIR)/include + cp -fR $(srcdir)/_hypre_*.h $(HYPRE_BUILD_DIR)/include # cp -fR libHYPRE* $(HYPRE_BUILD_DIR)/lib install: libHYPRE_sstruct_mv${HYPRE_LIB_SUFFIX} cp -fR $(srcdir)/HYPRE_*.h $(HYPRE_INC_INSTALL) - cp -fR $(srcdir)/_hypre_sstruct_mv.h $(HYPRE_INC_INSTALL) + cp -fR $(srcdir)/_hypre_*.h $(HYPRE_INC_INSTALL) # cp -fR libHYPRE* $(HYPRE_LIB_INSTALL) clean: rm -f *.o *.obj libHYPRE* + rm -f *.o_flt *.o_dbl *.o_ldbl + rm -f *.obj_flt *.obj_dbl *.obj_ldbl rm -rf pchdir tca.map *inslog* distclean: clean diff --git a/src/sstruct_mv/_hypre_sstruct_mv.h b/src/sstruct_mv/_hypre_sstruct_mv.h index a803a9584e..e424607671 100644 --- a/src/sstruct_mv/_hypre_sstruct_mv.h +++ b/src/sstruct_mv/_hypre_sstruct_mv.h @@ -14,6 +14,10 @@ #include "_hypre_struct_mv.h" #include "_hypre_IJ_mv.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_sstruct_mv_mup_def.h" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -69,20 +73,30 @@ typedef struct HYPRE_SStructVariable *vartypes; /* types of variables */ hypre_StructGrid *sgrids[8]; /* struct grids for each vartype */ hypre_BoxArray *iboxarrays[8]; /* interface boxes */ - + hypre_BoxArrayArray *pbnd_boxaa[8]; /* arrays of box arrays for part boundaries + each BoxArrayArray entry has size equal to + the number of boxes in a sgrid */ + HYPRE_Int active[8]; /* flag indicating if grid is active for mat/vec + operations purposes */ hypre_BoxArray *pneighbors; hypre_Index *pnbor_offsets; HYPRE_Int local_size; /* Number of variables locally */ HYPRE_BigInt global_size; /* Total number of variables */ + HYPRE_Int ref_count; + hypre_Index periodic; /* Indicates if pgrid is periodic */ /* GEC0902 additions for ghost expansion of boxes */ - + // TODO: deprecate ghlocal_size HYPRE_Int ghlocal_size; /* Number of vars including ghosts */ - HYPRE_Int cell_sgrid_done; /* =1 implies cell grid already assembled */ + + /* Geometrical data */ + HYPRE_Real coords_origin[HYPRE_MAXDIM]; /* Origin coordinates */ + hypre_Index coords_stride; + } hypre_SStructPGrid; typedef struct @@ -103,9 +117,9 @@ enum hypre_SStructBoxManInfoType typedef struct { - HYPRE_Int type; - HYPRE_BigInt offset; - HYPRE_BigInt ghoffset; + HYPRE_Int type; + HYPRE_BigInt offset; + HYPRE_BigInt ghoffset; } hypre_SStructBoxManInfo; @@ -176,10 +190,9 @@ typedef struct hypre_SStructGrid_struct HYPRE_Int ref_count; /* GEC0902 additions for ghost expansion of boxes */ - + // TODO: deprecate these ones. SStructMatrix should hold these data instead 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_SStructGrid; @@ -222,7 +235,6 @@ typedef struct hypre_SStructGrid_struct #define hypre_SStructGridRefCount(grid) ((grid) -> ref_count) #define hypre_SStructGridGhlocalSize(grid) ((grid) -> ghlocal_size) #define hypre_SStructGridGhstartRank(grid) ((grid) -> ghstart_rank) -#define hypre_SStructGridNumGhost(grid) ((grid) -> num_ghost) /*-------------------------------------------------------------------------- * Accessor macros: hypre_SStructPGrid @@ -234,6 +246,8 @@ typedef struct hypre_SStructGrid_struct #define hypre_SStructPGridVarTypes(pgrid) ((pgrid) -> vartypes) #define hypre_SStructPGridVarType(pgrid, var) ((pgrid) -> vartypes[var]) #define hypre_SStructPGridCellSGridDone(pgrid) ((pgrid) -> cell_sgrid_done) +#define hypre_SStructPGridCoordsOrigin(pgrid) ((pgrid) -> coords_origin) +#define hypre_SStructPGridCoordsStride(pgrid) ((pgrid) -> coords_stride) #define hypre_SStructPGridSGrids(pgrid) ((pgrid) -> sgrids) #define hypre_SStructPGridSGrid(pgrid, var) \ @@ -249,11 +263,20 @@ typedef struct hypre_SStructGrid_struct ((pgrid) -> iboxarrays[HYPRE_SSTRUCT_VARIABLE_CELL]) #define hypre_SStructPGridVTIBoxArray(pgrid, vartype) \ ((pgrid) -> iboxarrays[vartype]) - +#define hypre_SStructPGridPBndBoxArrayArrays(pgrid) ((pgrid) -> pbnd_boxaa) +#define hypre_SStructPGridPBndBoxArrayArray(pgrid, var) \ +((pgrid) -> pbnd_boxaa[hypre_SStructPGridVarType(pgrid, var)]) +#define hypre_SStructPGridVTPBndBoxArrayArray(pgrid, vartype) \ +((pgrid) -> pbnd_boxaa[vartype]) + +#define hypre_SStructPGridActive(pgrid, var) \ +((pgrid) -> active[hypre_SStructPGridVarType(pgrid, var)]) +#define hypre_SStructPGridVTActive(pgrid, vart) ((pgrid) -> active[vart]) #define hypre_SStructPGridPNeighbors(pgrid) ((pgrid) -> pneighbors) #define hypre_SStructPGridPNborOffsets(pgrid) ((pgrid) -> pnbor_offsets) #define hypre_SStructPGridLocalSize(pgrid) ((pgrid) -> local_size) #define hypre_SStructPGridGlobalSize(pgrid) ((pgrid) -> global_size) +#define hypre_SStructPGridRefCount(pgrid) ((pgrid) -> ref_count) #define hypre_SStructPGridPeriodic(pgrid) ((pgrid) -> periodic) #define hypre_SStructPGridGhlocalSize(pgrid) ((pgrid) -> ghlocal_size) @@ -312,7 +335,6 @@ typedef struct hypre_SStructGrid_struct #define hypre_SStructUCVarProc(uc, i) ((uc) -> uvars[i].proc) #endif - /****************************************************************************** * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. @@ -357,8 +379,8 @@ hypre_StructStencilShape( hypre_SStructStencilSStencil(stencil) ) hypre_StructStencilSize( hypre_SStructStencilSStencil(stencil) ) #define hypre_SStructStencilNDim(stencil) \ hypre_StructStencilNDim( hypre_SStructStencilSStencil(stencil) ) -#define hypre_SStructStencilEntry(stencil, i) \ -hypre_StructStencilElement( hypre_SStructStencilSStencil(stencil), i ) +#define hypre_SStructStencilOffset(stencil, i) \ +hypre_StructStencilOffset( hypre_SStructStencilSStencil(stencil), i ) #endif /****************************************************************************** @@ -399,7 +421,7 @@ typedef struct HYPRE_Int to_var; HYPRE_Int to_boxnum; /* local box number */ HYPRE_Int to_proc; - HYPRE_Int to_rank; + HYPRE_BigInt to_rank; } hypre_SStructUEntry; @@ -408,7 +430,7 @@ typedef struct HYPRE_Int part; hypre_Index index; HYPRE_Int var; - HYPRE_Int rank; + HYPRE_BigInt rank; HYPRE_Int nUentries; hypre_SStructUEntry *Uentries; @@ -418,13 +440,12 @@ typedef struct hypre_SStructGraph_struct { MPI_Comm comm; HYPRE_Int ndim; - hypre_SStructGrid *grid; - hypre_SStructGrid *domain_grid; /* same as grid by default */ - HYPRE_Int nparts; - hypre_SStructPGrid **pgrids; + HYPRE_Int nparts; /* number of parts */ + hypre_SStructGrid *grid; /* base grid */ + hypre_SStructGrid *dom_grid; /* domain grid */ hypre_SStructStencil ***stencils; /* each (part, var) has a stencil */ - /* info for fem-based user input */ + /* Info for fem-based user input */ HYPRE_Int *fem_nsparse; HYPRE_Int **fem_sparse_i; HYPRE_Int **fem_sparse_j; @@ -433,21 +454,21 @@ typedef struct hypre_SStructGraph_struct /* U-graph info: Entries are referenced via a local rank that comes from an * ordering of the local grid boxes with ghost zones added. */ HYPRE_Int nUventries; /* number of Uventries */ - HYPRE_Int *iUventries; /* rank indexes into Uventries */ + HYPRE_BigInt *iUventries; /* rank indexes into Uventries */ hypre_SStructUVEntry **Uventries; HYPRE_Int Uvesize; /* size of Uventries array */ HYPRE_Int Uemaxsize; /* max size of Uentries */ HYPRE_BigInt **Uveoffsets; /* offsets for computing rank indexes */ - - HYPRE_Int ref_count; - - HYPRE_Int type; /* GEC0203 */ + hypre_Box ***Uvboxes; /* (part, var) array of boxes for non-stencil entries */ /* These are created in GraphAddEntries() then deleted in GraphAssemble() */ hypre_SStructGraphEntry **graph_entries; HYPRE_Int n_graph_entries; /* number graph entries */ HYPRE_Int a_graph_entries; /* alloced graph entries */ + /* Object data */ + HYPRE_Int ref_count; + HYPRE_Int type; } hypre_SStructGraph; /*-------------------------------------------------------------------------- @@ -457,14 +478,14 @@ typedef struct hypre_SStructGraph_struct #define hypre_SStructGraphComm(graph) ((graph) -> comm) #define hypre_SStructGraphNDim(graph) ((graph) -> ndim) #define hypre_SStructGraphGrid(graph) ((graph) -> grid) -#define hypre_SStructGraphDomainGrid(graph) ((graph) -> domain_grid) -#define hypre_SStructGraphNParts(graph) ((graph) -> nparts) +#define hypre_SStructGraphDomGrid(graph) ((graph) -> dom_grid) #define hypre_SStructGraphPGrids(graph) \ hypre_SStructGridPGrids(hypre_SStructGraphGrid(graph)) #define hypre_SStructGraphPGrid(graph, p) \ hypre_SStructGridPGrid(hypre_SStructGraphGrid(graph), p) #define hypre_SStructGraphStencils(graph) ((graph) -> stencils) #define hypre_SStructGraphStencil(graph, p, v) ((graph) -> stencils[p][v]) +#define hypre_SStructGraphNParts(graph) ((graph) -> nparts) #define hypre_SStructGraphFEMNSparse(graph) ((graph) -> fem_nsparse) #define hypre_SStructGraphFEMSparseI(graph) ((graph) -> fem_sparse_i) @@ -484,12 +505,14 @@ typedef struct hypre_SStructGraph_struct #define hypre_SStructGraphUEMaxSize(graph) ((graph) -> Uemaxsize) #define hypre_SStructGraphUVEOffsets(graph) ((graph) -> Uveoffsets) #define hypre_SStructGraphUVEOffset(graph, p, v)((graph) -> Uveoffsets[p][v]) +#define hypre_SStructGraphUVBoxes(graph) ((graph) -> Uvboxes) +#define hypre_SStructGraphUVBox(graph, p, v) ((graph) -> Uvboxes[p][v]) -#define hypre_SStructGraphRefCount(graph) ((graph) -> ref_count) -#define hypre_SStructGraphObjectType(graph) ((graph) -> type) #define hypre_SStructGraphEntries(graph) ((graph) -> graph_entries) #define hypre_SStructNGraphEntries(graph) ((graph) -> n_graph_entries) #define hypre_SStructAGraphEntries(graph) ((graph) -> a_graph_entries) +#define hypre_SStructGraphRefCount(graph) ((graph) -> ref_count) +#define hypre_SStructGraphObjectType(graph) ((graph) -> type) /*-------------------------------------------------------------------------- * Accessor macros: hypre_SStructUVEntry @@ -552,7 +575,7 @@ typedef struct hypre_SStructGraph_struct * hypre_SStructMatrix: *--------------------------------------------------------------------------*/ -typedef struct +typedef struct hypre_SStructPMatrix_struct { MPI_Comm comm; hypre_SStructPGrid *pgrid; @@ -564,6 +587,10 @@ typedef struct hypre_StructMatrix ***smatrices; /* nvar x nvar array of smatrices */ HYPRE_Int **symmetric; /* Stencil entries symmetric? * (nvar x nvar array) */ + HYPRE_Int **num_centries; /* (nvar x nvar) array */ + HYPRE_Int ***centries; /* (nvar x nvar x sentries_size) array constant entries */ + hypre_Index dom_stride; /* domain grid stride */ + hypre_Index ran_stride; /* range grid stride */ /* temporary storage for SetValues routines */ HYPRE_Int sentries_size; @@ -575,18 +602,28 @@ typedef struct } hypre_SStructPMatrix; +/*-------------------------------------------------------------------------- + * hypre_SStructMatrix: + * + * - Storage of parts id dictated by the coarse grid + *--------------------------------------------------------------------------*/ + typedef struct hypre_SStructMatrix_struct { MPI_Comm comm; HYPRE_Int ndim; + HYPRE_Int ***splits; /* S/U-matrix split for each stencil */ hypre_SStructGraph *graph; - HYPRE_Int ***splits; /* S/U-matrix split for each stencil */ /* S-matrix info */ HYPRE_Int nparts; hypre_SStructPMatrix **pmatrices; HYPRE_Int ***symmetric; /* Stencil entries symmetric? * (nparts x nvar x nvar array) */ + HYPRE_Int ***num_centries; /* (nparts x nvar x nvar) array */ + HYPRE_Int ****centries; /* (nparts x nvar x nvar x entries_size) array */ + hypre_Index *dom_stride; /* (nparts) array of domain stride */ + hypre_Index *ran_stride; /* (nparts) array of range stride */ /* U-matrix info */ HYPRE_IJMatrix ijmatrix; @@ -596,7 +633,6 @@ typedef struct hypre_SStructMatrix_struct HYPRE_Int entries_size; HYPRE_Int *Sentries; HYPRE_Int *Uentries; - HYPRE_Int tmp_size; /* size of the following 3 */ HYPRE_BigInt *tmp_row_coords; HYPRE_BigInt *tmp_col_coords; @@ -619,31 +655,35 @@ typedef struct hypre_SStructMatrix_struct * Accessor macros: hypre_SStructMatrix *--------------------------------------------------------------------------*/ -#define hypre_SStructMatrixComm(mat) ((mat) -> comm) -#define hypre_SStructMatrixNDim(mat) ((mat) -> ndim) -#define hypre_SStructMatrixGraph(mat) ((mat) -> graph) -#define hypre_SStructMatrixSplits(mat) ((mat) -> splits) -#define hypre_SStructMatrixSplit(mat, p, v) ((mat) -> splits[p][v]) -#define hypre_SStructMatrixNParts(mat) ((mat) -> nparts) -#define hypre_SStructMatrixPMatrices(mat) ((mat) -> pmatrices) -#define hypre_SStructMatrixPMatrix(mat, part) ((mat) -> pmatrices[part]) -#define hypre_SStructMatrixSymmetric(mat) ((mat) -> symmetric) -#define hypre_SStructMatrixIJMatrix(mat) ((mat) -> ijmatrix) -#define hypre_SStructMatrixParCSRMatrix(mat) ((mat) -> parcsrmatrix) -#define hypre_SStructMatrixEntriesSize(mat) ((mat) -> entries_size) -#define hypre_SStructMatrixSEntries(mat) ((mat) -> Sentries) -#define hypre_SStructMatrixUEntries(mat) ((mat) -> Uentries) -#define hypre_SStructMatrixTmpSize(mat) ((mat) -> tmp_size) -#define hypre_SStructMatrixTmpRowCoords(mat) ((mat) -> tmp_row_coords) -#define hypre_SStructMatrixTmpColCoords(mat) ((mat) -> tmp_col_coords) -#define hypre_SStructMatrixTmpCoeffs(mat) ((mat) -> tmp_coeffs) -#define hypre_SStructMatrixTmpRowCoordsDevice(mat) ((mat) -> d_tmp_row_coords) -#define hypre_SStructMatrixTmpColCoordsDevice(mat) ((mat) -> d_tmp_col_coords) -#define hypre_SStructMatrixTmpCoeffsDevice(mat) ((mat) -> d_tmp_coeffs) -#define hypre_SStructMatrixNSSymmetric(mat) ((mat) -> ns_symmetric) -#define hypre_SStructMatrixGlobalSize(mat) ((mat) -> global_size) -#define hypre_SStructMatrixRefCount(mat) ((mat) -> ref_count) -#define hypre_SStructMatrixObjectType(mat) ((mat) -> object_type) +#define hypre_SStructMatrixComm(mat) ((mat) -> comm) +#define hypre_SStructMatrixNDim(mat) ((mat) -> ndim) +#define hypre_SStructMatrixGraph(mat) ((mat) -> graph) +#define hypre_SStructMatrixSplits(mat) ((mat) -> splits) +#define hypre_SStructMatrixSplit(mat, p, v) ((mat) -> splits[p][v]) +#define hypre_SStructMatrixNParts(mat) ((mat) -> nparts) +#define hypre_SStructMatrixPMatrices(mat) ((mat) -> pmatrices) +#define hypre_SStructMatrixPMatrix(mat, part) ((mat) -> pmatrices[part]) +#define hypre_SStructMatrixSymmetric(mat) ((mat) -> symmetric) +#define hypre_SStructMatrixNumCEntries(mat) ((mat) -> num_centries) +#define hypre_SStructMatrixCEntries(mat) ((mat) -> centries) +#define hypre_SStructMatrixDomainStride(mat) ((mat) -> dom_stride) +#define hypre_SStructMatrixRangeStride(mat) ((mat) -> ran_stride) +#define hypre_SStructMatrixIJMatrix(mat) ((mat) -> ijmatrix) +#define hypre_SStructMatrixParCSRMatrix(mat) ((mat) -> parcsrmatrix) +#define hypre_SStructMatrixEntriesSize(mat) ((mat) -> entries_size) +#define hypre_SStructMatrixSEntries(mat) ((mat) -> Sentries) +#define hypre_SStructMatrixUEntries(mat) ((mat) -> Uentries) +#define hypre_SStructMatrixTmpSize(mat) ((mat) -> tmp_size) +#define hypre_SStructMatrixTmpRowCoords(mat) ((mat) -> tmp_row_coords) +#define hypre_SStructMatrixTmpColCoords(mat) ((mat) -> tmp_col_coords) +#define hypre_SStructMatrixTmpCoeffs(mat) ((mat) -> tmp_coeffs) +#define hypre_SStructMatrixTmpRowCoordsDevice(mat) ((mat) -> d_tmp_row_coords) +#define hypre_SStructMatrixTmpColCoordsDevice(mat) ((mat) -> d_tmp_col_coords) +#define hypre_SStructMatrixTmpCoeffsDevice(mat) ((mat) -> d_tmp_coeffs) +#define hypre_SStructMatrixNSSymmetric(mat) ((mat) -> ns_symmetric) +#define hypre_SStructMatrixGlobalSize(mat) ((mat) -> global_size) +#define hypre_SStructMatrixRefCount(mat) ((mat) -> ref_count) +#define hypre_SStructMatrixObjectType(mat) ((mat) -> object_type) /*-------------------------------------------------------------------------- * Accessor macros: hypre_SStructPMatrix @@ -651,20 +691,21 @@ typedef struct hypre_SStructMatrix_struct #define hypre_SStructPMatrixComm(pmat) ((pmat) -> comm) #define hypre_SStructPMatrixPGrid(pmat) ((pmat) -> pgrid) -#define hypre_SStructPMatrixNDim(pmat) \ -hypre_SStructPGridNDim(hypre_SStructPMatrixPGrid(pmat)) +#define hypre_SStructPMatrixNDim(pmat) hypre_SStructPGridNDim((pmat) -> pgrid) #define hypre_SStructPMatrixStencils(pmat) ((pmat) -> stencils) #define hypre_SStructPMatrixNVars(pmat) ((pmat) -> nvars) #define hypre_SStructPMatrixStencil(pmat, var) ((pmat) -> stencils[var]) #define hypre_SStructPMatrixSMaps(pmat) ((pmat) -> smaps) #define hypre_SStructPMatrixSMap(pmat, var) ((pmat) -> smaps[var]) #define hypre_SStructPMatrixSStencils(pmat) ((pmat) -> sstencils) -#define hypre_SStructPMatrixSStencil(pmat, vi, vj) \ -((pmat) -> sstencils[vi][vj]) +#define hypre_SStructPMatrixSStencil(pmat, vi, vj) ((pmat) -> sstencils[vi][vj]) #define hypre_SStructPMatrixSMatrices(pmat) ((pmat) -> smatrices) -#define hypre_SStructPMatrixSMatrix(pmat, vi, vj) \ -((pmat) -> smatrices[vi][vj]) +#define hypre_SStructPMatrixSMatrix(pmat, vi, vj) ((pmat) -> smatrices[vi][vj]) #define hypre_SStructPMatrixSymmetric(pmat) ((pmat) -> symmetric) +#define hypre_SStructPMatrixNumCEntries(pmat) ((pmat) -> num_centries) +#define hypre_SStructPMatrixCEntries(pmat) ((pmat) -> centries) +#define hypre_SStructPMatrixDomainStride(pmat) ((pmat) -> dom_stride) +#define hypre_SStructPMatrixRangeStride(pmat) ((pmat) -> ran_stride) #define hypre_SStructPMatrixSEntriesSize(pmat) ((pmat) -> sentries_size) #define hypre_SStructPMatrixSEntries(pmat) ((pmat) -> sentries) #define hypre_SStructPMatrixAccumulated(pmat) ((pmat) -> accumulated) @@ -697,16 +738,15 @@ typedef struct hypre_SStructPGrid *pgrid; HYPRE_Int nvars; - hypre_StructVector **svectors; /* nvar array of svectors */ - hypre_CommPkg **comm_pkgs; /* nvar array of comm pkgs */ + hypre_StructVector **svectors; /* nvar array of svectors */ + hypre_CommPkg **comm_pkgs; /* nvar array of comm pkgs */ - HYPRE_Int accumulated; /* AddTo values accumulated? */ + HYPRE_Int accumulated; /* AddTo values accumulated? */ HYPRE_Int ref_count; - HYPRE_Int *dataindices; /* GEC1002 array for starting index of the - svector. pdataindices[varx] */ - HYPRE_Int datasize; /* Size of the pvector = sums size of svectors */ + HYPRE_Int *dataindices; /* dataindices[p]: start index of data for var v */ + HYPRE_Int datasize; /* Size of the pvector = sums size of svectors */ } hypre_SStructPVector; @@ -720,7 +760,6 @@ typedef struct hypre_SStructVector_struct /* s-vector info */ HYPRE_Int nparts; hypre_SStructPVector **pvectors; - hypre_CommPkg ***comm_pkgs; /* nvar array of comm pkgs */ /* u-vector info */ HYPRE_IJVector ijvector; @@ -729,11 +768,10 @@ 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 */ + /* 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 *dataindices; /* dataindices[p]: start index of data for part p */ + HYPRE_Int datasize; /* size of all data = ghlocalsize */ HYPRE_Int global_size; /* Total number coefficients */ HYPRE_Int ref_count; @@ -744,38 +782,40 @@ typedef struct hypre_SStructVector_struct * Accessor macros: hypre_SStructVector *--------------------------------------------------------------------------*/ -#define hypre_SStructVectorComm(vec) ((vec) -> comm) -#define hypre_SStructVectorNDim(vec) ((vec) -> ndim) -#define hypre_SStructVectorGrid(vec) ((vec) -> grid) -#define hypre_SStructVectorObjectType(vec) ((vec) -> object_type) -#define hypre_SStructVectorNParts(vec) ((vec) -> nparts) -#define hypre_SStructVectorPVectors(vec) ((vec) -> pvectors) -#define hypre_SStructVectorPVector(vec, part) ((vec) -> pvectors[part]) -#define hypre_SStructVectorIJVector(vec) ((vec) -> ijvector) -#define hypre_SStructVectorParVector(vec) ((vec) -> parvector) -#define hypre_SStructVectorNborNComms(vec) ((vec) -> nbor_ncomms) -#define hypre_SStructVectorGlobalSize(vec) ((vec) -> global_size) -#define hypre_SStructVectorRefCount(vec) ((vec) -> ref_count) -#define hypre_SStructVectorData(vec) ((vec) -> data ) -#define hypre_SStructVectorDataIndices(vec) ((vec) -> dataindices) -#define hypre_SStructVectorDataSize(vec) ((vec) -> datasize) +#define hypre_SStructVectorComm(vec) ((vec) -> comm) +#define hypre_SStructVectorNDim(vec) ((vec) -> ndim) +#define hypre_SStructVectorGrid(vec) ((vec) -> grid) +#define hypre_SStructVectorObjectType(vec) ((vec) -> object_type) +#define hypre_SStructVectorNParts(vec) ((vec) -> nparts) +#define hypre_SStructVectorPVectors(vec) ((vec) -> pvectors) +#define hypre_SStructVectorPVector(vec, part) ((vec) -> pvectors[part]) +#define hypre_SStructVectorIJVector(vec) ((vec) -> ijvector) +#define hypre_SStructVectorParVector(vec) ((vec) -> parvector) +#define hypre_SStructVectorNborNComms(vec) ((vec) -> nbor_ncomms) +#define hypre_SStructVectorGlobalSize(vec) ((vec) -> global_size) +#define hypre_SStructVectorRefCount(vec) ((vec) -> ref_count) +#define hypre_SStructVectorData(vec) ((vec) -> data ) +#define hypre_SStructVectorDataIndices(vec) ((vec) -> dataindices) +#define hypre_SStructVectorDataIndex(vec, part) ((vec) -> dataindices[part]) +#define hypre_SStructVectorDataSize(vec) ((vec) -> datasize) /*-------------------------------------------------------------------------- * Accessor macros: hypre_SStructPVector *--------------------------------------------------------------------------*/ -#define hypre_SStructPVectorComm(pvec) ((pvec) -> comm) -#define hypre_SStructPVectorPGrid(pvec) ((pvec) -> pgrid) -#define hypre_SStructPVectorNVars(pvec) ((pvec) -> nvars) -#define hypre_SStructPVectorSVectors(pvec) ((pvec) -> svectors) -#define hypre_SStructPVectorSVector(pvec, v) ((pvec) -> svectors[v]) -#define hypre_SStructPVectorCommPkgs(pvec) ((pvec) -> comm_pkgs) -#define hypre_SStructPVectorCommPkg(pvec, v) ((pvec) -> comm_pkgs[v]) -#define hypre_SStructPVectorAccumulated(pvec) ((pvec) -> accumulated) -#define hypre_SStructPVectorRefCount(pvec) ((pvec) -> ref_count) -#define hypre_SStructPVectorDataIndices(pvec) ((pvec) -> dataindices ) -#define hypre_SStructPVectorDataSize(pvec) ((pvec) -> datasize ) +#define hypre_SStructPVectorComm(pvec) ((pvec) -> comm) +#define hypre_SStructPVectorPGrid(pvec) ((pvec) -> pgrid) +#define hypre_SStructPVectorNVars(pvec) ((pvec) -> nvars) +#define hypre_SStructPVectorSVectors(pvec) ((pvec) -> svectors) +#define hypre_SStructPVectorSVector(pvec, v) ((pvec) -> svectors[v]) +#define hypre_SStructPVectorCommPkgs(pvec) ((pvec) -> comm_pkgs) +#define hypre_SStructPVectorCommPkg(pvec, v) ((pvec) -> comm_pkgs[v]) +#define hypre_SStructPVectorAccumulated(pvec) ((pvec) -> accumulated) +#define hypre_SStructPVectorRefCount(pvec) ((pvec) -> ref_count) +#define hypre_SStructPVectorDataIndices(pvec) ((pvec) -> dataindices) +#define hypre_SStructPVectorDataIndex(pvec, v) ((pvec) -> dataindices[v]) +#define hypre_SStructPVectorDataSize(pvec) ((pvec) -> datasize) #endif /****************************************************************************** @@ -785,138 +825,75 @@ typedef struct hypre_SStructVector_struct * 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_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_SStructGraphAssemble ( HYPRE_SStructGraph graph ); -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_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_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_sstruct_matrix.c */ -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_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_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_SStructStencilDestroy ( HYPRE_SStructStencil stencil ); -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_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_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_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 ); +/****************************************************************************** + * + * Header info for the semi-structured matrix/matrix multiplication structures + * + *****************************************************************************/ + +#ifndef hypre_SSTRUCT_MATMULT_HEADER +#define hypre_SSTRUCT_MATMULT_HEADER + +/*-------------------------------------------------------------------------- + * SStructPMatmult data structure + *--------------------------------------------------------------------------*/ + +typedef struct hypre_SStructPMatmultData_struct +{ + hypre_StructMatmultData *smmdata; /* struct matmult data object */ + HYPRE_Int ***smmid; /* (nvars x nvars) array of matmult id-arrays */ + HYPRE_Int **smmsz; /* (nvars x nvars) array of matmult id-array sizes */ + HYPRE_Int nvars; + + HYPRE_Int nmatrices; + hypre_SStructPMatrix **pmatrices; /* matrices we are multiplying */ + HYPRE_Int nterms; + HYPRE_Int *terms; + HYPRE_Int *transposes; + + hypre_CommPkg *comm_pkg; /* agglomerated communication package */ + HYPRE_Complex **comm_data; /* agglomerated communication data */ + +} hypre_SStructPMatmultData; + +/*-------------------------------------------------------------------------- + * SStructMatmult data structure + *--------------------------------------------------------------------------*/ + +typedef struct hypre_SStructMatmultData_struct +{ + HYPRE_Int nparts; + hypre_SStructPMatmultData **pmmdata; /* pointer to nparts array */ + + HYPRE_Int nmatrices; + hypre_SStructMatrix **matrices; /* matrices we are multiplying */ + HYPRE_Int nterms; + HYPRE_Int *terms; + HYPRE_Int *transposes; + + hypre_CommPkg *comm_pkg; /* agglomerated communication package */ + HYPRE_Complex **comm_data; /* agglomerated communication data */ + +} hypre_SStructMatmultData; + +#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) + ******************************************************************************/ /* sstruct_axpy.c */ HYPRE_Int hypre_SStructPAxpy ( HYPRE_Complex alpha, hypre_SStructPVector *px, hypre_SStructPVector *py ); +HYPRE_Int hypre_SStructPVectorPointwiseDivpy ( HYPRE_Complex alpha, hypre_SStructPVector *px, + hypre_SStructPVector *pz, HYPRE_Complex beta, + hypre_SStructPVector *py ); HYPRE_Int hypre_SStructAxpy ( HYPRE_Complex alpha, hypre_SStructVector *x, hypre_SStructVector *y ); +HYPRE_Int hypre_SStructVectorPointwiseDivpy ( HYPRE_Complex *alpha, hypre_SStructVector *x, + hypre_SStructVector *z, HYPRE_Complex *beta, + hypre_SStructVector *y ); /* sstruct_copy.c */ HYPRE_Int hypre_SStructPCopy ( hypre_SStructPVector *px, hypre_SStructPVector *py ); @@ -928,21 +905,24 @@ HYPRE_Int hypre_SStructCopy ( hypre_SStructVector *x, hypre_SStructVector *y ); 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_BigInt 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 var, HYPRE_Int proc, HYPRE_Int endpt, HYPRE_BigInt *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_SStructPGridRef( hypre_SStructPGrid *pgrid, hypre_SStructPGrid **pgrid_ref); 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_SStructPGridSetSGrid ( hypre_StructGrid *sgrid, hypre_SStructPGrid *pgrid, + HYPRE_Int var ); HYPRE_Int hypre_SStructPGridSetVariables ( hypre_SStructPGrid *pgrid, HYPRE_Int nvars, HYPRE_SStructVariable *vartypes ); HYPRE_Int hypre_SStructPGridSetPNeighbor ( hypre_SStructPGrid *pgrid, hypre_Box *pneighbor_box, @@ -950,6 +930,7 @@ HYPRE_Int hypre_SStructPGridSetPNeighbor ( hypre_SStructPGrid *pgrid, hypre_Box HYPRE_Int hypre_SStructPGridAssemble ( hypre_SStructPGrid *pgrid ); HYPRE_Int hypre_SStructPGridGetMaxBoxSize ( hypre_SStructPGrid *pgrid ); HYPRE_Int hypre_SStructGridRef ( hypre_SStructGrid *grid, hypre_SStructGrid **grid_ref ); +HYPRE_Int hypre_SStructGridComputeGlobalSizes ( hypre_SStructGrid *grid ); HYPRE_Int hypre_SStructGridAssembleBoxManagers ( hypre_SStructGrid *grid ); HYPRE_Int hypre_SStructGridAssembleNborBoxManagers ( hypre_SStructGrid *grid ); HYPRE_Int hypre_SStructGridCreateCommInfo ( hypre_SStructGrid *grid ); @@ -992,6 +973,12 @@ HYPRE_Int hypre_SStructCellBoxToVarBox ( hypre_Box *box, hypre_Index offset, hyp 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_SStructGridPrintGLVis ( hypre_SStructGrid *grid, const char *meshprefix, + HYPRE_Real *trans, HYPRE_Real *origin ); +HYPRE_Int hypre_SStructGridCoarsen ( hypre_SStructGrid *fgrid, hypre_IndexRef origin, + hypre_Index *strides, hypre_Index *periodic, hypre_SStructGrid **cgrid_ptr ); +HYPRE_Int hypre_SStructGridSetActiveParts ( hypre_SStructGrid *grid, HYPRE_Int *active ); +HYPRE_Int hypre_SStructGridSetAllPartsActive ( hypre_SStructGrid *grid ); 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 ); @@ -999,6 +986,8 @@ HYPRE_Int hypre_SStructGridRead ( MPI_Comm comm, FILE *file, hypre_SStructGrid * /* sstruct_innerprod.c */ HYPRE_Int hypre_SStructPInnerProd ( hypre_SStructPVector *px, hypre_SStructPVector *py, HYPRE_Real *presult_ptr ); +HYPRE_Int hypre_SStructPInnerProdLocal ( hypre_SStructPVector *px, hypre_SStructPVector *py, + HYPRE_Real *presult_ptr ); HYPRE_Int hypre_SStructInnerProd ( hypre_SStructVector *x, hypre_SStructVector *y, HYPRE_Real *result_ptr ); @@ -1016,18 +1005,34 @@ HYPRE_Int hypre_SStructPMatrixSetBoxValues( hypre_SStructPMatrix *pmatrix, hypre HYPRE_Int action ); HYPRE_Int hypre_SStructPMatrixAccumulate ( hypre_SStructPMatrix *pmatrix ); HYPRE_Int hypre_SStructPMatrixAssemble ( hypre_SStructPMatrix *pmatrix ); +HYPRE_Int hypre_SStructPMatrixSetTranspose( hypre_SStructPMatrix *pmatrix, HYPRE_Int transpose, + HYPRE_Int *resize ); HYPRE_Int hypre_SStructPMatrixSetSymmetric ( hypre_SStructPMatrix *pmatrix, HYPRE_Int var, HYPRE_Int to_var, HYPRE_Int symmetric ); +HYPRE_Int hypre_SStructPMatrixSetCEntries( hypre_SStructPMatrix *pmatrix, HYPRE_Int var, + HYPRE_Int to_var, HYPRE_Int num_centries, HYPRE_Int *centries ); +HYPRE_Int hypre_SStructPMatrixSetDomainStride ( hypre_SStructPMatrix *pmatrix, + hypre_Index dom_stride ); +HYPRE_Int hypre_SStructPMatrixSetRangeStride ( hypre_SStructPMatrix *pmatrix, + hypre_Index ran_stride ); HYPRE_Int hypre_SStructPMatrixPrint ( const char *filename, hypre_SStructPMatrix *pmatrix, HYPRE_Int all ); -HYPRE_Int hypre_SStructUMatrixInitialize ( hypre_SStructMatrix *matrix ); +HYPRE_Int hypre_SStructPMatrixGetDiagonal ( hypre_SStructPMatrix *pmatrix, + hypre_SStructPVector *pdiag ); +HYPRE_Int hypre_SStructUMatrixInitialize ( hypre_SStructMatrix *matrix, + HYPRE_MemoryLocation memory_location ); 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_SStructUMatrixSetBoxValuesHelper( 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_IJMatrix ijmatrix ); 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_SStructMatrixMapDataBox ( hypre_SStructMatrix *matrix, HYPRE_Int part, + HYPRE_Int vi, HYPRE_Int vj, hypre_Box *map_vbox ); 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, @@ -1035,32 +1040,148 @@ HYPRE_Int hypre_SStructMatrixSplitEntries ( hypre_SStructMatrix *matrix, HYPRE_I 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_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_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_SStructMatrixCompressUToS( HYPRE_SStructMatrix matrix, HYPRE_Int action ); +HYPRE_Int hypre_SStructMatrixBoxesToUMatrix( hypre_SStructMatrix *A, hypre_SStructGrid *grid, + hypre_IJMatrix **ij_Ahat_ptr, hypre_BoxArray ***convert_boxa); +hypre_IJMatrix* hypre_SStructMatrixToUMatrix( HYPRE_SStructMatrix matrix, + HYPRE_Int fill_diagonal ); +HYPRE_Int hypre_SStructMatrixHaloToUMatrix ( hypre_SStructMatrix *A, hypre_SStructGrid *grid, + hypre_IJMatrix **ij_Ahat_ptr, HYPRE_Int halo_size ); +HYPRE_Int hypre_SStructMatrixGetDiagonal ( hypre_SStructMatrix *matrix, + hypre_SStructVector **diag_ptr ); HYPRE_MemoryLocation hypre_SStructMatrixMemoryLocation(hypre_SStructMatrix *matrix); /* sstruct_matvec.c */ HYPRE_Int hypre_SStructPMatvecCreate ( void **pmatvec_vdata_ptr ); +HYPRE_Int hypre_SStructPMatvecSetTranspose ( void *pmatvec_vdata, HYPRE_Int transpose ); 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_SStructPMatrix *pA, hypre_SStructPVector *px, HYPRE_Complex beta, hypre_SStructPVector *pb, + 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_SStructMatvecCreate ( void **matvec_vdata_ptr ); +HYPRE_Int hypre_SStructMatvecSetTranspose ( void *matvec_vdata, HYPRE_Int transpose ); 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_SStructMatrix *A, hypre_SStructVector *x, HYPRE_Complex beta, hypre_SStructVector *b, + 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 ); +/* sstruct_matmult.c */ +HYPRE_Int +hypre_SStructPMatmultCreate(HYPRE_Int nmatrices_input, + hypre_SStructPMatrix **pmatrices_input, + HYPRE_Int nterms, + HYPRE_Int *terms_input, + HYPRE_Int *trans_input, + hypre_SStructPMatmultData **pmmdata_ptr); +HYPRE_Int +hypre_SStructPMatmultDestroy( hypre_SStructPMatmultData *pmmdata ); +HYPRE_Int +hypre_SStructPMatmultInitialize( hypre_SStructPMatmultData *pmmdata, + HYPRE_Int assemble_grid, + hypre_SStructPMatrix **pM_ptr ); +HYPRE_Int +hypre_SStructPMatmultCommSetup( hypre_SStructPMatmultData *pmmdata ); +HYPRE_Int +hypre_SStructPMatmultCommunicate( hypre_SStructPMatmultData *pmmdata ); +HYPRE_Int +hypre_SStructPMatmultCompute( hypre_SStructPMatmultData *pmmdata, + hypre_SStructPMatrix *pM ); +HYPRE_Int +hypre_SStructPMatmult(HYPRE_Int nmatrices, + hypre_SStructPMatrix **matrices, + HYPRE_Int nterms, + HYPRE_Int *terms, + HYPRE_Int *trans, + hypre_SStructPMatrix **M_ptr ); +HYPRE_Int +hypre_SStructPMatmat( hypre_SStructPMatrix *A, + hypre_SStructPMatrix *B, + hypre_SStructPMatrix **M_ptr ); +HYPRE_Int +hypre_SStructPMatrixPtAP( hypre_SStructPMatrix *A, + hypre_SStructPMatrix *P, + hypre_SStructPMatrix **M_ptr ); +HYPRE_Int +hypre_SStructPMatrixRAP( hypre_SStructPMatrix *R, + hypre_SStructPMatrix *A, + hypre_SStructPMatrix *P, + hypre_SStructPMatrix **M_ptr ); +HYPRE_Int +hypre_SStructPMatrixRTtAP( hypre_SStructPMatrix *RT, + hypre_SStructPMatrix *A, + hypre_SStructPMatrix *P, + hypre_SStructPMatrix **M_ptr ); +HYPRE_Int +hypre_SStructMatmultCreate(HYPRE_Int nmatrices_input, + hypre_SStructMatrix **matrices_input, + HYPRE_Int nterms, + HYPRE_Int *terms_input, + HYPRE_Int *trans_input, + hypre_SStructMatmultData **mmdata_ptr); +HYPRE_Int +hypre_SStructMatmultDestroy( hypre_SStructMatmultData *mmdata ); +HYPRE_Int +hypre_SStructMatmultInitialize( hypre_SStructMatmultData *mmdata, + hypre_SStructMatrix **M_ptr ); +HYPRE_Int +hypre_SStructMatmultCommunicate( hypre_SStructMatmultData *mmdata ); +HYPRE_Int +hypre_SStructMatmultComputeS( hypre_SStructMatmultData *mmdata, + hypre_SStructMatrix *M ); +HYPRE_Int +hypre_SStructMatmultComputeU( hypre_SStructMatmultData *mmdata, + hypre_SStructMatrix *M ); +HYPRE_Int +hypre_SStructMatmultCompute( hypre_SStructMatmultData *mmdata, + hypre_SStructMatrix *M ); +HYPRE_Int +hypre_SStructMatmult(HYPRE_Int nmatrices, + hypre_SStructMatrix **matrices, + HYPRE_Int nterms, + HYPRE_Int *terms, + HYPRE_Int *trans, + hypre_SStructMatrix **M_ptr ); +HYPRE_Int +hypre_SStructMatmat( hypre_SStructMatrix *A, + hypre_SStructMatrix *B, + hypre_SStructMatrix **M_ptr ); +HYPRE_Int +hypre_SStructMatrixPtAP( hypre_SStructMatrix *A, + hypre_SStructMatrix *P, + hypre_SStructMatrix **M_ptr ); +HYPRE_Int +hypre_SStructMatrixRAP( hypre_SStructMatrix *R, + hypre_SStructMatrix *A, + hypre_SStructMatrix *P, + hypre_SStructMatrix **M_ptr ); +HYPRE_Int +hypre_SStructMatrixRTtAP( hypre_SStructMatrix *RT, + hypre_SStructMatrix *A, + hypre_SStructMatrix *P, + hypre_SStructMatrix **M_ptr ); + +/* sstruct_matop.c */ +HYPRE_Int hypre_SStructPMatrixComputeRowSum ( hypre_SStructPMatrix *pA, HYPRE_Int type, + hypre_SStructPVector *prowsum ); +HYPRE_Int hypre_SStructMatrixComputeRowSum ( hypre_SStructMatrix *A, HYPRE_Int type, + hypre_SStructVector **rowsum_ptr ); +HYPRE_Int hypre_SStructMatrixComputeL1Norms ( hypre_SStructMatrix *A, HYPRE_Int option, + hypre_SStructVector **l1_norms_ptr ); + /* sstruct_scale.c */ HYPRE_Int hypre_SStructPScale ( HYPRE_Complex alpha, hypre_SStructPVector *py ); HYPRE_Int hypre_SStructScale ( HYPRE_Complex alpha, hypre_SStructVector *y ); @@ -1089,10 +1210,12 @@ HYPRE_Int hypre_SStructPVectorGetBoxValues( hypre_SStructPVector *pvector, hypre HYPRE_Int var, hypre_Box *value_box, HYPRE_Complex *values ); HYPRE_Int hypre_SStructPVectorSetConstantValues ( hypre_SStructPVector *pvector, HYPRE_Complex value ); +HYPRE_Int hypre_SStructPVectorSetRandomValues ( hypre_SStructPVector *pvector, HYPRE_Int seed ); 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_SStructVectorSetRandomValues ( hypre_SStructVector *vector, HYPRE_Int seed ); HYPRE_Int hypre_SStructVectorConvert ( hypre_SStructVector *vector, hypre_ParVector **parvector_ptr ); HYPRE_Int hypre_SStructVectorParConvert ( hypre_SStructVector *vector, @@ -1102,6 +1225,7 @@ HYPRE_Int hypre_SStructVectorParRestore ( hypre_SStructVector *vector, hypre_Par HYPRE_Int hypre_SStructPVectorInitializeShell ( hypre_SStructPVector *pvector ); HYPRE_Int hypre_SStructVectorInitializeShell ( hypre_SStructVector *vector ); HYPRE_Int hypre_SStructVectorClearGhostValues ( hypre_SStructVector *vector ); +HYPRE_Int hypre_SStructVectorPrintGLVis ( hypre_SStructVector *vector, const char *fileprefix ); HYPRE_MemoryLocation hypre_SStructVectorMemoryLocation(hypre_SStructVector *vector); HYPRE_Int hypre_SStructVectorPointwiseDivision ( hypre_SStructVector *x, hypre_SStructVector *y, hypre_SStructVector **z_ptr ); @@ -1114,5 +1238,16 @@ HYPRE_Int hypre_SStructVectorPointwiseInverse ( hypre_SStructVector *x, } #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_sstruct_mv_mup_undef.h" +#include "_hypre_sstruct_mv_mup.h" +#endif +#endif + #endif diff --git a/src/sstruct_mv/_hypre_sstruct_mv_mup.h b/src/sstruct_mv/_hypre_sstruct_mv_mup.h new file mode 100644 index 0000000000..5f750f1ad5 --- /dev/null +++ b/src/sstruct_mv/_hypre_sstruct_mv_mup.h @@ -0,0 +1,1180 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#ifndef hypre_SSTRUCT_MV_MUP_HEADER +#define hypre_SSTRUCT_MV_MUP_HEADER + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (HYPRE_MIXED_PRECISION) + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +hypre_SStructAxpy_flt( hypre_float alpha, hypre_SStructVector *x, hypre_SStructVector *y ); +HYPRE_Int +hypre_SStructAxpy_dbl( hypre_double alpha, hypre_SStructVector *x, hypre_SStructVector *y ); +HYPRE_Int +hypre_SStructAxpy_long_dbl( hypre_long_double alpha, hypre_SStructVector *x, hypre_SStructVector *y ); + +HYPRE_Int +hypre_SStructBoxManEntryGetBoxnum_flt( hypre_BoxManEntry *entry, HYPRE_Int *id_ptr ); +HYPRE_Int +hypre_SStructBoxManEntryGetBoxnum_dbl( hypre_BoxManEntry *entry, HYPRE_Int *id_ptr ); +HYPRE_Int +hypre_SStructBoxManEntryGetBoxnum_long_dbl( hypre_BoxManEntry *entry, HYPRE_Int *id_ptr ); + +HYPRE_Int +hypre_SStructBoxManEntryGetCSRstrides_flt( hypre_BoxManEntry *entry, hypre_Index strides ); +HYPRE_Int +hypre_SStructBoxManEntryGetCSRstrides_dbl( hypre_BoxManEntry *entry, hypre_Index strides ); +HYPRE_Int +hypre_SStructBoxManEntryGetCSRstrides_long_dbl( hypre_BoxManEntry *entry, hypre_Index strides ); + +HYPRE_Int +hypre_SStructBoxManEntryGetGhstrides_flt( hypre_BoxManEntry *entry, hypre_Index strides ); +HYPRE_Int +hypre_SStructBoxManEntryGetGhstrides_dbl( hypre_BoxManEntry *entry, hypre_Index strides ); +HYPRE_Int +hypre_SStructBoxManEntryGetGhstrides_long_dbl( hypre_BoxManEntry *entry, hypre_Index strides ); + +HYPRE_Int +hypre_SStructBoxManEntryGetGlobalCSRank_flt( hypre_BoxManEntry *entry, hypre_Index index, HYPRE_BigInt *rank_ptr ); +HYPRE_Int +hypre_SStructBoxManEntryGetGlobalCSRank_dbl( hypre_BoxManEntry *entry, hypre_Index index, HYPRE_BigInt *rank_ptr ); +HYPRE_Int +hypre_SStructBoxManEntryGetGlobalCSRank_long_dbl( hypre_BoxManEntry *entry, hypre_Index index, HYPRE_BigInt *rank_ptr ); + +HYPRE_Int +hypre_SStructBoxManEntryGetGlobalGhrank_flt( hypre_BoxManEntry *entry, hypre_Index index, HYPRE_BigInt *rank_ptr ); +HYPRE_Int +hypre_SStructBoxManEntryGetGlobalGhrank_dbl( hypre_BoxManEntry *entry, hypre_Index index, HYPRE_BigInt *rank_ptr ); +HYPRE_Int +hypre_SStructBoxManEntryGetGlobalGhrank_long_dbl( hypre_BoxManEntry *entry, hypre_Index index, HYPRE_BigInt *rank_ptr ); + +HYPRE_Int +hypre_SStructBoxManEntryGetGlobalRank_flt( hypre_BoxManEntry *entry, hypre_Index index, HYPRE_BigInt *rank_ptr, HYPRE_Int type ); +HYPRE_Int +hypre_SStructBoxManEntryGetGlobalRank_dbl( hypre_BoxManEntry *entry, hypre_Index index, HYPRE_BigInt *rank_ptr, HYPRE_Int type ); +HYPRE_Int +hypre_SStructBoxManEntryGetGlobalRank_long_dbl( hypre_BoxManEntry *entry, hypre_Index index, HYPRE_BigInt *rank_ptr, HYPRE_Int type ); + +HYPRE_Int +hypre_SStructBoxManEntryGetPart_flt( hypre_BoxManEntry *entry, HYPRE_Int part, HYPRE_Int *part_ptr ); +HYPRE_Int +hypre_SStructBoxManEntryGetPart_dbl( hypre_BoxManEntry *entry, HYPRE_Int part, HYPRE_Int *part_ptr ); +HYPRE_Int +hypre_SStructBoxManEntryGetPart_long_dbl( hypre_BoxManEntry *entry, HYPRE_Int part, HYPRE_Int *part_ptr ); + +HYPRE_Int +hypre_SStructBoxManEntryGetProcess_flt( hypre_BoxManEntry *entry, HYPRE_Int *proc_ptr ); +HYPRE_Int +hypre_SStructBoxManEntryGetProcess_dbl( hypre_BoxManEntry *entry, HYPRE_Int *proc_ptr ); +HYPRE_Int +hypre_SStructBoxManEntryGetProcess_long_dbl( hypre_BoxManEntry *entry, HYPRE_Int *proc_ptr ); + +HYPRE_Int +hypre_SStructBoxManEntryGetStrides_flt( hypre_BoxManEntry *entry, hypre_Index strides, HYPRE_Int type ); +HYPRE_Int +hypre_SStructBoxManEntryGetStrides_dbl( hypre_BoxManEntry *entry, hypre_Index strides, HYPRE_Int type ); +HYPRE_Int +hypre_SStructBoxManEntryGetStrides_long_dbl( hypre_BoxManEntry *entry, hypre_Index strides, HYPRE_Int type ); + +HYPRE_Int +hypre_SStructBoxNumMap_flt( hypre_SStructGrid *grid, HYPRE_Int part, HYPRE_Int boxnum, HYPRE_Int **num_varboxes_ptr, HYPRE_Int ***map_ptr ); +HYPRE_Int +hypre_SStructBoxNumMap_dbl( hypre_SStructGrid *grid, HYPRE_Int part, HYPRE_Int boxnum, HYPRE_Int **num_varboxes_ptr, HYPRE_Int ***map_ptr ); +HYPRE_Int +hypre_SStructBoxNumMap_long_dbl( hypre_SStructGrid *grid, HYPRE_Int part, HYPRE_Int boxnum, HYPRE_Int **num_varboxes_ptr, HYPRE_Int ***map_ptr ); + +HYPRE_Int +hypre_SStructBoxToNborBox_flt( hypre_Box *box, hypre_Index root, hypre_Index nbor_root, hypre_Index coord, hypre_Index dir ); +HYPRE_Int +hypre_SStructBoxToNborBox_dbl( hypre_Box *box, hypre_Index root, hypre_Index nbor_root, hypre_Index coord, hypre_Index dir ); +HYPRE_Int +hypre_SStructBoxToNborBox_long_dbl( hypre_Box *box, hypre_Index root, hypre_Index nbor_root, hypre_Index coord, hypre_Index dir ); + +HYPRE_Int +hypre_SStructCellBoxToVarBox_flt( hypre_Box *box, hypre_Index offset, hypre_Index varoffset, HYPRE_Int *valid ); +HYPRE_Int +hypre_SStructCellBoxToVarBox_dbl( hypre_Box *box, hypre_Index offset, hypre_Index varoffset, HYPRE_Int *valid ); +HYPRE_Int +hypre_SStructCellBoxToVarBox_long_dbl( hypre_Box *box, hypre_Index offset, hypre_Index varoffset, HYPRE_Int *valid ); + +HYPRE_Int +hypre_SStructCellGridBoxNumMap_flt( hypre_SStructGrid *grid, HYPRE_Int part, HYPRE_Int ***num_varboxes_ptr, HYPRE_Int ****map_ptr ); +HYPRE_Int +hypre_SStructCellGridBoxNumMap_dbl( hypre_SStructGrid *grid, HYPRE_Int part, HYPRE_Int ***num_varboxes_ptr, HYPRE_Int ****map_ptr ); +HYPRE_Int +hypre_SStructCellGridBoxNumMap_long_dbl( hypre_SStructGrid *grid, HYPRE_Int part, HYPRE_Int ***num_varboxes_ptr, HYPRE_Int ****map_ptr ); + +HYPRE_Int +hypre_SStructCopy_flt( hypre_SStructVector *x, hypre_SStructVector *y ); +HYPRE_Int +hypre_SStructCopy_dbl( hypre_SStructVector *x, hypre_SStructVector *y ); +HYPRE_Int +hypre_SStructCopy_long_dbl( hypre_SStructVector *x, hypre_SStructVector *y ); + +HYPRE_BigInt +hypre_SStructGraphFindBoxEndpt_flt( hypre_SStructGraph *graph, HYPRE_Int part, HYPRE_Int var, HYPRE_Int proc, HYPRE_Int endpt, HYPRE_Int boxi ); +HYPRE_BigInt +hypre_SStructGraphFindBoxEndpt_dbl( hypre_SStructGraph *graph, HYPRE_Int part, HYPRE_Int var, HYPRE_Int proc, HYPRE_Int endpt, HYPRE_Int boxi ); +HYPRE_BigInt +hypre_SStructGraphFindBoxEndpt_long_dbl( hypre_SStructGraph *graph, HYPRE_Int part, HYPRE_Int var, HYPRE_Int proc, HYPRE_Int endpt, HYPRE_Int boxi ); + +HYPRE_Int +hypre_SStructGraphFindSGridEndpts_flt( hypre_SStructGraph *graph, HYPRE_Int part, HYPRE_Int var, HYPRE_Int proc, HYPRE_Int endpt, HYPRE_BigInt *endpts ); +HYPRE_Int +hypre_SStructGraphFindSGridEndpts_dbl( hypre_SStructGraph *graph, HYPRE_Int part, HYPRE_Int var, HYPRE_Int proc, HYPRE_Int endpt, HYPRE_BigInt *endpts ); +HYPRE_Int +hypre_SStructGraphFindSGridEndpts_long_dbl( hypre_SStructGraph *graph, HYPRE_Int part, HYPRE_Int var, HYPRE_Int proc, HYPRE_Int endpt, HYPRE_BigInt *endpts ); + +HYPRE_Int +hypre_SStructGraphGetUVEntryRank_flt( hypre_SStructGraph *graph, HYPRE_Int part, HYPRE_Int var, hypre_Index index, HYPRE_BigInt *rank ); +HYPRE_Int +hypre_SStructGraphGetUVEntryRank_dbl( hypre_SStructGraph *graph, HYPRE_Int part, HYPRE_Int var, hypre_Index index, HYPRE_BigInt *rank ); +HYPRE_Int +hypre_SStructGraphGetUVEntryRank_long_dbl( hypre_SStructGraph *graph, HYPRE_Int part, HYPRE_Int var, hypre_Index index, HYPRE_BigInt *rank ); + +HYPRE_Int +hypre_SStructGraphRef_flt( hypre_SStructGraph *graph, hypre_SStructGraph **graph_ref ); +HYPRE_Int +hypre_SStructGraphRef_dbl( hypre_SStructGraph *graph, hypre_SStructGraph **graph_ref ); +HYPRE_Int +hypre_SStructGraphRef_long_dbl( hypre_SStructGraph *graph, hypre_SStructGraph **graph_ref ); + +HYPRE_Int +hypre_SStructGridAssembleBoxManagers_flt( hypre_SStructGrid *grid ); +HYPRE_Int +hypre_SStructGridAssembleBoxManagers_dbl( hypre_SStructGrid *grid ); +HYPRE_Int +hypre_SStructGridAssembleBoxManagers_long_dbl( hypre_SStructGrid *grid ); + +HYPRE_Int +hypre_SStructGridAssembleNborBoxManagers_flt( hypre_SStructGrid *grid ); +HYPRE_Int +hypre_SStructGridAssembleNborBoxManagers_dbl( hypre_SStructGrid *grid ); +HYPRE_Int +hypre_SStructGridAssembleNborBoxManagers_long_dbl( hypre_SStructGrid *grid ); + +HYPRE_Int +hypre_SStructGridBoxProcFindBoxManEntry_flt( hypre_SStructGrid *grid, HYPRE_Int part, HYPRE_Int var, HYPRE_Int box, HYPRE_Int proc, hypre_BoxManEntry **entry_ptr ); +HYPRE_Int +hypre_SStructGridBoxProcFindBoxManEntry_dbl( hypre_SStructGrid *grid, HYPRE_Int part, HYPRE_Int var, HYPRE_Int box, HYPRE_Int proc, hypre_BoxManEntry **entry_ptr ); +HYPRE_Int +hypre_SStructGridBoxProcFindBoxManEntry_long_dbl( hypre_SStructGrid *grid, HYPRE_Int part, HYPRE_Int var, HYPRE_Int box, HYPRE_Int proc, hypre_BoxManEntry **entry_ptr ); + +HYPRE_Int +hypre_SStructGridCoarsen_flt( hypre_SStructGrid *fgrid, hypre_IndexRef origin, hypre_Index *strides, hypre_Index *periodic, hypre_SStructGrid **cgrid_ptr ); +HYPRE_Int +hypre_SStructGridCoarsen_dbl( hypre_SStructGrid *fgrid, hypre_IndexRef origin, hypre_Index *strides, hypre_Index *periodic, hypre_SStructGrid **cgrid_ptr ); +HYPRE_Int +hypre_SStructGridCoarsen_long_dbl( hypre_SStructGrid *fgrid, hypre_IndexRef origin, hypre_Index *strides, hypre_Index *periodic, hypre_SStructGrid **cgrid_ptr ); + +HYPRE_Int +hypre_SStructGridComputeGlobalSizes_flt( hypre_SStructGrid *grid ); +HYPRE_Int +hypre_SStructGridComputeGlobalSizes_dbl( hypre_SStructGrid *grid ); +HYPRE_Int +hypre_SStructGridComputeGlobalSizes_long_dbl( hypre_SStructGrid *grid ); + +HYPRE_Int +hypre_SStructGridCreateCommInfo_flt( hypre_SStructGrid *grid ); +HYPRE_Int +hypre_SStructGridCreateCommInfo_dbl( hypre_SStructGrid *grid ); +HYPRE_Int +hypre_SStructGridCreateCommInfo_long_dbl( hypre_SStructGrid *grid ); + +HYPRE_Int +hypre_SStructGridFindBoxManEntry_flt( hypre_SStructGrid *grid, HYPRE_Int part, hypre_Index index, HYPRE_Int var, hypre_BoxManEntry **entry_ptr ); +HYPRE_Int +hypre_SStructGridFindBoxManEntry_dbl( hypre_SStructGrid *grid, HYPRE_Int part, hypre_Index index, HYPRE_Int var, hypre_BoxManEntry **entry_ptr ); +HYPRE_Int +hypre_SStructGridFindBoxManEntry_long_dbl( hypre_SStructGrid *grid, HYPRE_Int part, hypre_Index index, HYPRE_Int var, hypre_BoxManEntry **entry_ptr ); + +HYPRE_Int +hypre_SStructGridFindNborBoxManEntry_flt( hypre_SStructGrid *grid, HYPRE_Int part, hypre_Index index, HYPRE_Int var, hypre_BoxManEntry **entry_ptr ); +HYPRE_Int +hypre_SStructGridFindNborBoxManEntry_dbl( hypre_SStructGrid *grid, HYPRE_Int part, hypre_Index index, HYPRE_Int var, hypre_BoxManEntry **entry_ptr ); +HYPRE_Int +hypre_SStructGridFindNborBoxManEntry_long_dbl( hypre_SStructGrid *grid, HYPRE_Int part, hypre_Index index, HYPRE_Int var, hypre_BoxManEntry **entry_ptr ); + +HYPRE_Int +hypre_SStructGridGetMaxBoxSize_flt( hypre_SStructGrid *grid ); +HYPRE_Int +hypre_SStructGridGetMaxBoxSize_dbl( hypre_SStructGrid *grid ); +HYPRE_Int +hypre_SStructGridGetMaxBoxSize_long_dbl( hypre_SStructGrid *grid ); + +HYPRE_Int +hypre_SStructGridIntersect_flt( 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_SStructGridIntersect_dbl( 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_SStructGridIntersect_long_dbl( 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_SStructGridPrint_flt( FILE *file, hypre_SStructGrid *grid ); +HYPRE_Int +hypre_SStructGridPrint_dbl( FILE *file, hypre_SStructGrid *grid ); +HYPRE_Int +hypre_SStructGridPrint_long_dbl( FILE *file, hypre_SStructGrid *grid ); + +HYPRE_Int +hypre_SStructGridPrintGLVis_flt( hypre_SStructGrid *grid, const char *meshprefix, hypre_float *trans, hypre_float *origin ); +HYPRE_Int +hypre_SStructGridPrintGLVis_dbl( hypre_SStructGrid *grid, const char *meshprefix, hypre_double *trans, hypre_double *origin ); +HYPRE_Int +hypre_SStructGridPrintGLVis_long_dbl( hypre_SStructGrid *grid, const char *meshprefix, hypre_long_double *trans, hypre_long_double *origin ); + +HYPRE_Int +hypre_SStructGridRead_flt( MPI_Comm comm, FILE *file, hypre_SStructGrid **grid_ptr ); +HYPRE_Int +hypre_SStructGridRead_dbl( MPI_Comm comm, FILE *file, hypre_SStructGrid **grid_ptr ); +HYPRE_Int +hypre_SStructGridRead_long_dbl( MPI_Comm comm, FILE *file, hypre_SStructGrid **grid_ptr ); + +HYPRE_Int +hypre_SStructGridRef_flt( hypre_SStructGrid *grid, hypre_SStructGrid **grid_ref ); +HYPRE_Int +hypre_SStructGridRef_dbl( hypre_SStructGrid *grid, hypre_SStructGrid **grid_ref ); +HYPRE_Int +hypre_SStructGridRef_long_dbl( hypre_SStructGrid *grid, hypre_SStructGrid **grid_ref ); + +HYPRE_Int +hypre_SStructGridSetActiveParts_flt( hypre_SStructGrid *grid, HYPRE_Int *active ); +HYPRE_Int +hypre_SStructGridSetActiveParts_dbl( hypre_SStructGrid *grid, HYPRE_Int *active ); +HYPRE_Int +hypre_SStructGridSetActiveParts_long_dbl( hypre_SStructGrid *grid, HYPRE_Int *active ); + +HYPRE_Int +hypre_SStructGridSetAllPartsActive_flt( hypre_SStructGrid *grid ); +HYPRE_Int +hypre_SStructGridSetAllPartsActive_dbl( hypre_SStructGrid *grid ); +HYPRE_Int +hypre_SStructGridSetAllPartsActive_long_dbl( hypre_SStructGrid *grid ); + +HYPRE_Int +hypre_SStructGridSetNumGhost_flt( hypre_SStructGrid *grid, HYPRE_Int *num_ghost ); +HYPRE_Int +hypre_SStructGridSetNumGhost_dbl( hypre_SStructGrid *grid, HYPRE_Int *num_ghost ); +HYPRE_Int +hypre_SStructGridSetNumGhost_long_dbl( hypre_SStructGrid *grid, HYPRE_Int *num_ghost ); + +HYPRE_Int +hypre_SStructIndexToNborIndex_flt( 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_SStructIndexToNborIndex_dbl( 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_SStructIndexToNborIndex_long_dbl( 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_SStructInnerProd_flt( hypre_SStructVector *x, hypre_SStructVector *y, hypre_float *result_ptr ); +HYPRE_Int +hypre_SStructInnerProd_dbl( hypre_SStructVector *x, hypre_SStructVector *y, hypre_double *result_ptr ); +HYPRE_Int +hypre_SStructInnerProd_long_dbl( hypre_SStructVector *x, hypre_SStructVector *y, hypre_long_double *result_ptr ); + +HYPRE_Int +hypre_SStructMatmat_flt( hypre_SStructMatrix *A, hypre_SStructMatrix *B, hypre_SStructMatrix **M_ptr ); +HYPRE_Int +hypre_SStructMatmat_dbl( hypre_SStructMatrix *A, hypre_SStructMatrix *B, hypre_SStructMatrix **M_ptr ); +HYPRE_Int +hypre_SStructMatmat_long_dbl( hypre_SStructMatrix *A, hypre_SStructMatrix *B, hypre_SStructMatrix **M_ptr ); + +HYPRE_Int +hypre_SStructMatmult_flt( HYPRE_Int nmatrices, hypre_SStructMatrix **matrices, HYPRE_Int nterms, HYPRE_Int *terms, HYPRE_Int *trans, hypre_SStructMatrix **M_ptr ); +HYPRE_Int +hypre_SStructMatmult_dbl( HYPRE_Int nmatrices, hypre_SStructMatrix **matrices, HYPRE_Int nterms, HYPRE_Int *terms, HYPRE_Int *trans, hypre_SStructMatrix **M_ptr ); +HYPRE_Int +hypre_SStructMatmult_long_dbl( HYPRE_Int nmatrices, hypre_SStructMatrix **matrices, HYPRE_Int nterms, HYPRE_Int *terms, HYPRE_Int *trans, hypre_SStructMatrix **M_ptr ); + +HYPRE_Int +hypre_SStructMatmultCommunicate_flt( hypre_SStructMatmultData *mmdata ); +HYPRE_Int +hypre_SStructMatmultCommunicate_dbl( hypre_SStructMatmultData *mmdata ); +HYPRE_Int +hypre_SStructMatmultCommunicate_long_dbl( hypre_SStructMatmultData *mmdata ); + +HYPRE_Int +hypre_SStructMatmultCompute_flt( hypre_SStructMatmultData *mmdata, hypre_SStructMatrix *M ); +HYPRE_Int +hypre_SStructMatmultCompute_dbl( hypre_SStructMatmultData *mmdata, hypre_SStructMatrix *M ); +HYPRE_Int +hypre_SStructMatmultCompute_long_dbl( hypre_SStructMatmultData *mmdata, hypre_SStructMatrix *M ); + +HYPRE_Int +hypre_SStructMatmultComputeS_flt( hypre_SStructMatmultData *mmdata, hypre_SStructMatrix *M ); +HYPRE_Int +hypre_SStructMatmultComputeS_dbl( hypre_SStructMatmultData *mmdata, hypre_SStructMatrix *M ); +HYPRE_Int +hypre_SStructMatmultComputeS_long_dbl( hypre_SStructMatmultData *mmdata, hypre_SStructMatrix *M ); + +HYPRE_Int +hypre_SStructMatmultComputeU_flt( hypre_SStructMatmultData *mmdata, hypre_SStructMatrix *M ); +HYPRE_Int +hypre_SStructMatmultComputeU_dbl( hypre_SStructMatmultData *mmdata, hypre_SStructMatrix *M ); +HYPRE_Int +hypre_SStructMatmultComputeU_long_dbl( hypre_SStructMatmultData *mmdata, hypre_SStructMatrix *M ); + +HYPRE_Int +hypre_SStructMatmultCreate_flt( HYPRE_Int nmatrices_input, hypre_SStructMatrix **matrices_input, HYPRE_Int nterms, HYPRE_Int *terms_input, HYPRE_Int *trans_input, hypre_SStructMatmultData **mmdata_ptr ); +HYPRE_Int +hypre_SStructMatmultCreate_dbl( HYPRE_Int nmatrices_input, hypre_SStructMatrix **matrices_input, HYPRE_Int nterms, HYPRE_Int *terms_input, HYPRE_Int *trans_input, hypre_SStructMatmultData **mmdata_ptr ); +HYPRE_Int +hypre_SStructMatmultCreate_long_dbl( HYPRE_Int nmatrices_input, hypre_SStructMatrix **matrices_input, HYPRE_Int nterms, HYPRE_Int *terms_input, HYPRE_Int *trans_input, hypre_SStructMatmultData **mmdata_ptr ); + +HYPRE_Int +hypre_SStructMatmultDestroy_flt( hypre_SStructMatmultData *mmdata ); +HYPRE_Int +hypre_SStructMatmultDestroy_dbl( hypre_SStructMatmultData *mmdata ); +HYPRE_Int +hypre_SStructMatmultDestroy_long_dbl( hypre_SStructMatmultData *mmdata ); + +HYPRE_Int +hypre_SStructMatmultInitialize_flt( hypre_SStructMatmultData *mmdata, hypre_SStructMatrix **M_ptr ); +HYPRE_Int +hypre_SStructMatmultInitialize_dbl( hypre_SStructMatmultData *mmdata, hypre_SStructMatrix **M_ptr ); +HYPRE_Int +hypre_SStructMatmultInitialize_long_dbl( hypre_SStructMatmultData *mmdata, hypre_SStructMatrix **M_ptr ); + +HYPRE_Int +hypre_SStructMatrixBoxesToUMatrix_flt( hypre_SStructMatrix *A, hypre_SStructGrid *grid, hypre_IJMatrix **ij_Ahat_ptr, hypre_BoxArray ***convert_boxa ); +HYPRE_Int +hypre_SStructMatrixBoxesToUMatrix_dbl( hypre_SStructMatrix *A, hypre_SStructGrid *grid, hypre_IJMatrix **ij_Ahat_ptr, hypre_BoxArray ***convert_boxa ); +HYPRE_Int +hypre_SStructMatrixBoxesToUMatrix_long_dbl( hypre_SStructMatrix *A, hypre_SStructGrid *grid, hypre_IJMatrix **ij_Ahat_ptr, hypre_BoxArray ***convert_boxa ); + +HYPRE_Int +hypre_SStructMatrixCompressUToS_flt( HYPRE_SStructMatrix matrix, HYPRE_Int action ); +HYPRE_Int +hypre_SStructMatrixCompressUToS_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int action ); +HYPRE_Int +hypre_SStructMatrixCompressUToS_long_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int action ); + +HYPRE_Int +hypre_SStructMatrixComputeL1Norms_flt( hypre_SStructMatrix *A, HYPRE_Int option, hypre_SStructVector **l1_norms_ptr ); +HYPRE_Int +hypre_SStructMatrixComputeL1Norms_dbl( hypre_SStructMatrix *A, HYPRE_Int option, hypre_SStructVector **l1_norms_ptr ); +HYPRE_Int +hypre_SStructMatrixComputeL1Norms_long_dbl( hypre_SStructMatrix *A, HYPRE_Int option, hypre_SStructVector **l1_norms_ptr ); + +HYPRE_Int +hypre_SStructMatrixComputeRowSum_flt( hypre_SStructMatrix *A, HYPRE_Int type, hypre_SStructVector **rowsum_ptr ); +HYPRE_Int +hypre_SStructMatrixComputeRowSum_dbl( hypre_SStructMatrix *A, HYPRE_Int type, hypre_SStructVector **rowsum_ptr ); +HYPRE_Int +hypre_SStructMatrixComputeRowSum_long_dbl( hypre_SStructMatrix *A, HYPRE_Int type, hypre_SStructVector **rowsum_ptr ); + +HYPRE_Int +hypre_SStructMatrixGetDiagonal_flt( hypre_SStructMatrix *matrix, hypre_SStructVector **diag_ptr ); +HYPRE_Int +hypre_SStructMatrixGetDiagonal_dbl( hypre_SStructMatrix *matrix, hypre_SStructVector **diag_ptr ); +HYPRE_Int +hypre_SStructMatrixGetDiagonal_long_dbl( hypre_SStructMatrix *matrix, hypre_SStructVector **diag_ptr ); + +HYPRE_Int +hypre_SStructMatrixHaloToUMatrix_flt( hypre_SStructMatrix *A, hypre_SStructGrid *grid, hypre_IJMatrix **ij_Ahat_ptr, HYPRE_Int halo_size ); +HYPRE_Int +hypre_SStructMatrixHaloToUMatrix_dbl( hypre_SStructMatrix *A, hypre_SStructGrid *grid, hypre_IJMatrix **ij_Ahat_ptr, HYPRE_Int halo_size ); +HYPRE_Int +hypre_SStructMatrixHaloToUMatrix_long_dbl( hypre_SStructMatrix *A, hypre_SStructGrid *grid, hypre_IJMatrix **ij_Ahat_ptr, HYPRE_Int halo_size ); + +HYPRE_Int +hypre_SStructMatrixMapDataBox_flt( hypre_SStructMatrix *matrix, HYPRE_Int part, HYPRE_Int vi, HYPRE_Int vj, hypre_Box *map_vbox ); +HYPRE_Int +hypre_SStructMatrixMapDataBox_dbl( hypre_SStructMatrix *matrix, HYPRE_Int part, HYPRE_Int vi, HYPRE_Int vj, hypre_Box *map_vbox ); +HYPRE_Int +hypre_SStructMatrixMapDataBox_long_dbl( hypre_SStructMatrix *matrix, HYPRE_Int part, HYPRE_Int vi, HYPRE_Int vj, hypre_Box *map_vbox ); + +HYPRE_MemoryLocation +hypre_SStructMatrixMemoryLocation_flt( hypre_SStructMatrix *matrix ); +HYPRE_MemoryLocation +hypre_SStructMatrixMemoryLocation_dbl( hypre_SStructMatrix *matrix ); +HYPRE_MemoryLocation +hypre_SStructMatrixMemoryLocation_long_dbl( hypre_SStructMatrix *matrix ); + +HYPRE_Int +hypre_SStructMatrixPtAP_flt( hypre_SStructMatrix *A, hypre_SStructMatrix *P, hypre_SStructMatrix **M_ptr ); +HYPRE_Int +hypre_SStructMatrixPtAP_dbl( hypre_SStructMatrix *A, hypre_SStructMatrix *P, hypre_SStructMatrix **M_ptr ); +HYPRE_Int +hypre_SStructMatrixPtAP_long_dbl( hypre_SStructMatrix *A, hypre_SStructMatrix *P, hypre_SStructMatrix **M_ptr ); + +HYPRE_Int +hypre_SStructMatrixRAP_flt( hypre_SStructMatrix *R, hypre_SStructMatrix *A, hypre_SStructMatrix *P, hypre_SStructMatrix **M_ptr ); +HYPRE_Int +hypre_SStructMatrixRAP_dbl( hypre_SStructMatrix *R, hypre_SStructMatrix *A, hypre_SStructMatrix *P, hypre_SStructMatrix **M_ptr ); +HYPRE_Int +hypre_SStructMatrixRAP_long_dbl( hypre_SStructMatrix *R, hypre_SStructMatrix *A, hypre_SStructMatrix *P, hypre_SStructMatrix **M_ptr ); + +HYPRE_Int +hypre_SStructMatrixRTtAP_flt( hypre_SStructMatrix *RT, hypre_SStructMatrix *A, hypre_SStructMatrix *P, hypre_SStructMatrix **M_ptr ); +HYPRE_Int +hypre_SStructMatrixRTtAP_dbl( hypre_SStructMatrix *RT, hypre_SStructMatrix *A, hypre_SStructMatrix *P, hypre_SStructMatrix **M_ptr ); +HYPRE_Int +hypre_SStructMatrixRTtAP_long_dbl( hypre_SStructMatrix *RT, hypre_SStructMatrix *A, hypre_SStructMatrix *P, hypre_SStructMatrix **M_ptr ); + +HYPRE_Int +hypre_SStructMatrixRef_flt( hypre_SStructMatrix *matrix, hypre_SStructMatrix **matrix_ref ); +HYPRE_Int +hypre_SStructMatrixRef_dbl( hypre_SStructMatrix *matrix, hypre_SStructMatrix **matrix_ref ); +HYPRE_Int +hypre_SStructMatrixRef_long_dbl( hypre_SStructMatrix *matrix, hypre_SStructMatrix **matrix_ref ); + +HYPRE_Int +hypre_SStructMatrixSetBoxValues_flt( HYPRE_SStructMatrix matrix, HYPRE_Int part, hypre_Box *set_box, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_Box *value_box, hypre_float *values, HYPRE_Int action ); +HYPRE_Int +hypre_SStructMatrixSetBoxValues_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, hypre_Box *set_box, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_Box *value_box, hypre_double *values, HYPRE_Int action ); +HYPRE_Int +hypre_SStructMatrixSetBoxValues_long_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, hypre_Box *set_box, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_Box *value_box, hypre_long_double *values, HYPRE_Int action ); + +HYPRE_Int +hypre_SStructMatrixSetInterPartValues_flt( HYPRE_SStructMatrix matrix, HYPRE_Int part, hypre_Box *set_box, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_Box *value_box, hypre_float *values, HYPRE_Int action ); +HYPRE_Int +hypre_SStructMatrixSetInterPartValues_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, hypre_Box *set_box, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_Box *value_box, hypre_double *values, HYPRE_Int action ); +HYPRE_Int +hypre_SStructMatrixSetInterPartValues_long_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, hypre_Box *set_box, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_Box *value_box, hypre_long_double *values, HYPRE_Int action ); + +HYPRE_Int +hypre_SStructMatrixSetValues_flt( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_float *values, HYPRE_Int action ); +HYPRE_Int +hypre_SStructMatrixSetValues_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_double *values, HYPRE_Int action ); +HYPRE_Int +hypre_SStructMatrixSetValues_long_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_long_double *values, HYPRE_Int action ); + +HYPRE_Int +hypre_SStructMatrixSplitEntries_flt( 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_SStructMatrixSplitEntries_dbl( 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_SStructMatrixSplitEntries_long_dbl( 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_IJMatrix* +hypre_SStructMatrixToUMatrix_flt( HYPRE_SStructMatrix matrix, HYPRE_Int fill_diagonal ); +hypre_IJMatrix* +hypre_SStructMatrixToUMatrix_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int fill_diagonal ); +hypre_IJMatrix* +hypre_SStructMatrixToUMatrix_long_dbl( HYPRE_SStructMatrix matrix, HYPRE_Int fill_diagonal ); + +HYPRE_Int +hypre_SStructMatvec_flt( hypre_float alpha, hypre_SStructMatrix *A, hypre_SStructVector *x, hypre_float beta, hypre_SStructVector *y ); +HYPRE_Int +hypre_SStructMatvec_dbl( hypre_double alpha, hypre_SStructMatrix *A, hypre_SStructVector *x, hypre_double beta, hypre_SStructVector *y ); +HYPRE_Int +hypre_SStructMatvec_long_dbl( hypre_long_double alpha, hypre_SStructMatrix *A, hypre_SStructVector *x, hypre_long_double beta, hypre_SStructVector *y ); + +HYPRE_Int +hypre_SStructMatvecCompute_flt( void *matvec_vdata, hypre_float alpha, hypre_SStructMatrix *A, hypre_SStructVector *x, hypre_float beta, hypre_SStructVector *b, hypre_SStructVector *y ); +HYPRE_Int +hypre_SStructMatvecCompute_dbl( void *matvec_vdata, hypre_double alpha, hypre_SStructMatrix *A, hypre_SStructVector *x, hypre_double beta, hypre_SStructVector *b, hypre_SStructVector *y ); +HYPRE_Int +hypre_SStructMatvecCompute_long_dbl( void *matvec_vdata, hypre_long_double alpha, hypre_SStructMatrix *A, hypre_SStructVector *x, hypre_long_double beta, hypre_SStructVector *b, hypre_SStructVector *y ); + +HYPRE_Int +hypre_SStructMatvecCreate_flt( void **matvec_vdata_ptr ); +HYPRE_Int +hypre_SStructMatvecCreate_dbl( void **matvec_vdata_ptr ); +HYPRE_Int +hypre_SStructMatvecCreate_long_dbl( void **matvec_vdata_ptr ); + +HYPRE_Int +hypre_SStructMatvecDestroy_flt( void *matvec_vdata ); +HYPRE_Int +hypre_SStructMatvecDestroy_dbl( void *matvec_vdata ); +HYPRE_Int +hypre_SStructMatvecDestroy_long_dbl( void *matvec_vdata ); + +HYPRE_Int +hypre_SStructMatvecSetTranspose_flt( void *matvec_vdata, HYPRE_Int transpose ); +HYPRE_Int +hypre_SStructMatvecSetTranspose_dbl( void *matvec_vdata, HYPRE_Int transpose ); +HYPRE_Int +hypre_SStructMatvecSetTranspose_long_dbl( void *matvec_vdata, HYPRE_Int transpose ); + +HYPRE_Int +hypre_SStructMatvecSetup_flt( void *matvec_vdata, hypre_SStructMatrix *A, hypre_SStructVector *x ); +HYPRE_Int +hypre_SStructMatvecSetup_dbl( void *matvec_vdata, hypre_SStructMatrix *A, hypre_SStructVector *x ); +HYPRE_Int +hypre_SStructMatvecSetup_long_dbl( void *matvec_vdata, hypre_SStructMatrix *A, hypre_SStructVector *x ); + +HYPRE_Int +hypre_SStructNborBoxToBox_flt( hypre_Box *nbor_box, hypre_Index root, hypre_Index nbor_root, hypre_Index coord, hypre_Index dir ); +HYPRE_Int +hypre_SStructNborBoxToBox_dbl( hypre_Box *nbor_box, hypre_Index root, hypre_Index nbor_root, hypre_Index coord, hypre_Index dir ); +HYPRE_Int +hypre_SStructNborBoxToBox_long_dbl( hypre_Box *nbor_box, hypre_Index root, hypre_Index nbor_root, hypre_Index coord, hypre_Index dir ); + +HYPRE_Int +hypre_SStructNborIndexToIndex_flt( 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_SStructNborIndexToIndex_dbl( 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_SStructNborIndexToIndex_long_dbl( 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_SStructPAxpy_flt( hypre_float alpha, hypre_SStructPVector *px, hypre_SStructPVector *py ); +HYPRE_Int +hypre_SStructPAxpy_dbl( hypre_double alpha, hypre_SStructPVector *px, hypre_SStructPVector *py ); +HYPRE_Int +hypre_SStructPAxpy_long_dbl( hypre_long_double alpha, hypre_SStructPVector *px, hypre_SStructPVector *py ); + +HYPRE_Int +hypre_SStructPCopy_flt( hypre_SStructPVector *px, hypre_SStructPVector *py ); +HYPRE_Int +hypre_SStructPCopy_dbl( hypre_SStructPVector *px, hypre_SStructPVector *py ); +HYPRE_Int +hypre_SStructPCopy_long_dbl( hypre_SStructPVector *px, hypre_SStructPVector *py ); + +HYPRE_Int +hypre_SStructPGridAssemble_flt( hypre_SStructPGrid *pgrid ); +HYPRE_Int +hypre_SStructPGridAssemble_dbl( hypre_SStructPGrid *pgrid ); +HYPRE_Int +hypre_SStructPGridAssemble_long_dbl( hypre_SStructPGrid *pgrid ); + +HYPRE_Int +hypre_SStructPGridCreate_flt( MPI_Comm comm, HYPRE_Int ndim, hypre_SStructPGrid **pgrid_ptr ); +HYPRE_Int +hypre_SStructPGridCreate_dbl( MPI_Comm comm, HYPRE_Int ndim, hypre_SStructPGrid **pgrid_ptr ); +HYPRE_Int +hypre_SStructPGridCreate_long_dbl( MPI_Comm comm, HYPRE_Int ndim, hypre_SStructPGrid **pgrid_ptr ); + +HYPRE_Int +hypre_SStructPGridDestroy_flt( hypre_SStructPGrid *pgrid ); +HYPRE_Int +hypre_SStructPGridDestroy_dbl( hypre_SStructPGrid *pgrid ); +HYPRE_Int +hypre_SStructPGridDestroy_long_dbl( hypre_SStructPGrid *pgrid ); + +HYPRE_Int +hypre_SStructPGridGetMaxBoxSize_flt( hypre_SStructPGrid *pgrid ); +HYPRE_Int +hypre_SStructPGridGetMaxBoxSize_dbl( hypre_SStructPGrid *pgrid ); +HYPRE_Int +hypre_SStructPGridGetMaxBoxSize_long_dbl( hypre_SStructPGrid *pgrid ); + +HYPRE_Int +hypre_SStructPGridRef_flt( hypre_SStructPGrid *pgrid, hypre_SStructPGrid **pgrid_ref ); +HYPRE_Int +hypre_SStructPGridRef_dbl( hypre_SStructPGrid *pgrid, hypre_SStructPGrid **pgrid_ref ); +HYPRE_Int +hypre_SStructPGridRef_long_dbl( hypre_SStructPGrid *pgrid, hypre_SStructPGrid **pgrid_ref ); + +HYPRE_Int +hypre_SStructPGridSetCellSGrid_flt( hypre_SStructPGrid *pgrid, hypre_StructGrid *cell_sgrid ); +HYPRE_Int +hypre_SStructPGridSetCellSGrid_dbl( hypre_SStructPGrid *pgrid, hypre_StructGrid *cell_sgrid ); +HYPRE_Int +hypre_SStructPGridSetCellSGrid_long_dbl( hypre_SStructPGrid *pgrid, hypre_StructGrid *cell_sgrid ); + +HYPRE_Int +hypre_SStructPGridSetExtents_flt( hypre_SStructPGrid *pgrid, hypre_Index ilower, hypre_Index iupper ); +HYPRE_Int +hypre_SStructPGridSetExtents_dbl( hypre_SStructPGrid *pgrid, hypre_Index ilower, hypre_Index iupper ); +HYPRE_Int +hypre_SStructPGridSetExtents_long_dbl( hypre_SStructPGrid *pgrid, hypre_Index ilower, hypre_Index iupper ); + +HYPRE_Int +hypre_SStructPGridSetPNeighbor_flt( hypre_SStructPGrid *pgrid, hypre_Box *pneighbor_box, hypre_Index pnbor_offset ); +HYPRE_Int +hypre_SStructPGridSetPNeighbor_dbl( hypre_SStructPGrid *pgrid, hypre_Box *pneighbor_box, hypre_Index pnbor_offset ); +HYPRE_Int +hypre_SStructPGridSetPNeighbor_long_dbl( hypre_SStructPGrid *pgrid, hypre_Box *pneighbor_box, hypre_Index pnbor_offset ); + +HYPRE_Int +hypre_SStructPGridSetSGrid_flt( hypre_StructGrid *sgrid, hypre_SStructPGrid *pgrid, HYPRE_Int var ); +HYPRE_Int +hypre_SStructPGridSetSGrid_dbl( hypre_StructGrid *sgrid, hypre_SStructPGrid *pgrid, HYPRE_Int var ); +HYPRE_Int +hypre_SStructPGridSetSGrid_long_dbl( hypre_StructGrid *sgrid, hypre_SStructPGrid *pgrid, HYPRE_Int var ); + +HYPRE_Int +hypre_SStructPGridSetVariables_flt( hypre_SStructPGrid *pgrid, HYPRE_Int nvars, HYPRE_SStructVariable *vartypes ); +HYPRE_Int +hypre_SStructPGridSetVariables_dbl( hypre_SStructPGrid *pgrid, HYPRE_Int nvars, HYPRE_SStructVariable *vartypes ); +HYPRE_Int +hypre_SStructPGridSetVariables_long_dbl( hypre_SStructPGrid *pgrid, HYPRE_Int nvars, HYPRE_SStructVariable *vartypes ); + +HYPRE_Int +hypre_SStructPInnerProd_flt( hypre_SStructPVector *px, hypre_SStructPVector *py, hypre_float *presult_ptr ); +HYPRE_Int +hypre_SStructPInnerProd_dbl( hypre_SStructPVector *px, hypre_SStructPVector *py, hypre_double *presult_ptr ); +HYPRE_Int +hypre_SStructPInnerProd_long_dbl( hypre_SStructPVector *px, hypre_SStructPVector *py, hypre_long_double *presult_ptr ); + +HYPRE_Int +hypre_SStructPInnerProdLocal_flt( hypre_SStructPVector *px, hypre_SStructPVector *py, hypre_float *presult_ptr ); +HYPRE_Int +hypre_SStructPInnerProdLocal_dbl( hypre_SStructPVector *px, hypre_SStructPVector *py, hypre_double *presult_ptr ); +HYPRE_Int +hypre_SStructPInnerProdLocal_long_dbl( hypre_SStructPVector *px, hypre_SStructPVector *py, hypre_long_double *presult_ptr ); + +HYPRE_Int +hypre_SStructPMatmat_flt( hypre_SStructPMatrix *A, hypre_SStructPMatrix *B, hypre_SStructPMatrix **M_ptr ); +HYPRE_Int +hypre_SStructPMatmat_dbl( hypre_SStructPMatrix *A, hypre_SStructPMatrix *B, hypre_SStructPMatrix **M_ptr ); +HYPRE_Int +hypre_SStructPMatmat_long_dbl( hypre_SStructPMatrix *A, hypre_SStructPMatrix *B, hypre_SStructPMatrix **M_ptr ); + +HYPRE_Int +hypre_SStructPMatmult_flt( HYPRE_Int nmatrices, hypre_SStructPMatrix **matrices, HYPRE_Int nterms, HYPRE_Int *terms, HYPRE_Int *trans, hypre_SStructPMatrix **M_ptr ); +HYPRE_Int +hypre_SStructPMatmult_dbl( HYPRE_Int nmatrices, hypre_SStructPMatrix **matrices, HYPRE_Int nterms, HYPRE_Int *terms, HYPRE_Int *trans, hypre_SStructPMatrix **M_ptr ); +HYPRE_Int +hypre_SStructPMatmult_long_dbl( HYPRE_Int nmatrices, hypre_SStructPMatrix **matrices, HYPRE_Int nterms, HYPRE_Int *terms, HYPRE_Int *trans, hypre_SStructPMatrix **M_ptr ); + +HYPRE_Int +hypre_SStructPMatmultCommSetup_flt( hypre_SStructPMatmultData *pmmdata ); +HYPRE_Int +hypre_SStructPMatmultCommSetup_dbl( hypre_SStructPMatmultData *pmmdata ); +HYPRE_Int +hypre_SStructPMatmultCommSetup_long_dbl( hypre_SStructPMatmultData *pmmdata ); + +HYPRE_Int +hypre_SStructPMatmultCommunicate_flt( hypre_SStructPMatmultData *pmmdata ); +HYPRE_Int +hypre_SStructPMatmultCommunicate_dbl( hypre_SStructPMatmultData *pmmdata ); +HYPRE_Int +hypre_SStructPMatmultCommunicate_long_dbl( hypre_SStructPMatmultData *pmmdata ); + +HYPRE_Int +hypre_SStructPMatmultCompute_flt( hypre_SStructPMatmultData *pmmdata, hypre_SStructPMatrix *pM ); +HYPRE_Int +hypre_SStructPMatmultCompute_dbl( hypre_SStructPMatmultData *pmmdata, hypre_SStructPMatrix *pM ); +HYPRE_Int +hypre_SStructPMatmultCompute_long_dbl( hypre_SStructPMatmultData *pmmdata, hypre_SStructPMatrix *pM ); + +HYPRE_Int +hypre_SStructPMatmultCreate_flt( HYPRE_Int nmatrices_input, hypre_SStructPMatrix **pmatrices_input, HYPRE_Int nterms, HYPRE_Int *terms_input, HYPRE_Int *trans_input, hypre_SStructPMatmultData **pmmdata_ptr ); +HYPRE_Int +hypre_SStructPMatmultCreate_dbl( HYPRE_Int nmatrices_input, hypre_SStructPMatrix **pmatrices_input, HYPRE_Int nterms, HYPRE_Int *terms_input, HYPRE_Int *trans_input, hypre_SStructPMatmultData **pmmdata_ptr ); +HYPRE_Int +hypre_SStructPMatmultCreate_long_dbl( HYPRE_Int nmatrices_input, hypre_SStructPMatrix **pmatrices_input, HYPRE_Int nterms, HYPRE_Int *terms_input, HYPRE_Int *trans_input, hypre_SStructPMatmultData **pmmdata_ptr ); + +HYPRE_Int +hypre_SStructPMatmultDestroy_flt( hypre_SStructPMatmultData *pmmdata ); +HYPRE_Int +hypre_SStructPMatmultDestroy_dbl( hypre_SStructPMatmultData *pmmdata ); +HYPRE_Int +hypre_SStructPMatmultDestroy_long_dbl( hypre_SStructPMatmultData *pmmdata ); + +HYPRE_Int +hypre_SStructPMatmultInitialize_flt( hypre_SStructPMatmultData *pmmdata, HYPRE_Int assemble_grid, hypre_SStructPMatrix **pM_ptr ); +HYPRE_Int +hypre_SStructPMatmultInitialize_dbl( hypre_SStructPMatmultData *pmmdata, HYPRE_Int assemble_grid, hypre_SStructPMatrix **pM_ptr ); +HYPRE_Int +hypre_SStructPMatmultInitialize_long_dbl( hypre_SStructPMatmultData *pmmdata, HYPRE_Int assemble_grid, hypre_SStructPMatrix **pM_ptr ); + +HYPRE_Int +hypre_SStructPMatrixAccumulate_flt( hypre_SStructPMatrix *pmatrix ); +HYPRE_Int +hypre_SStructPMatrixAccumulate_dbl( hypre_SStructPMatrix *pmatrix ); +HYPRE_Int +hypre_SStructPMatrixAccumulate_long_dbl( hypre_SStructPMatrix *pmatrix ); + +HYPRE_Int +hypre_SStructPMatrixAssemble_flt( hypre_SStructPMatrix *pmatrix ); +HYPRE_Int +hypre_SStructPMatrixAssemble_dbl( hypre_SStructPMatrix *pmatrix ); +HYPRE_Int +hypre_SStructPMatrixAssemble_long_dbl( hypre_SStructPMatrix *pmatrix ); + +HYPRE_Int +hypre_SStructPMatrixComputeRowSum_flt( hypre_SStructPMatrix *pA, HYPRE_Int type, hypre_SStructPVector *prowsum ); +HYPRE_Int +hypre_SStructPMatrixComputeRowSum_dbl( hypre_SStructPMatrix *pA, HYPRE_Int type, hypre_SStructPVector *prowsum ); +HYPRE_Int +hypre_SStructPMatrixComputeRowSum_long_dbl( hypre_SStructPMatrix *pA, HYPRE_Int type, hypre_SStructPVector *prowsum ); + +HYPRE_Int +hypre_SStructPMatrixCreate_flt( MPI_Comm comm, hypre_SStructPGrid *pgrid, hypre_SStructStencil **stencils, hypre_SStructPMatrix **pmatrix_ptr ); +HYPRE_Int +hypre_SStructPMatrixCreate_dbl( MPI_Comm comm, hypre_SStructPGrid *pgrid, hypre_SStructStencil **stencils, hypre_SStructPMatrix **pmatrix_ptr ); +HYPRE_Int +hypre_SStructPMatrixCreate_long_dbl( MPI_Comm comm, hypre_SStructPGrid *pgrid, hypre_SStructStencil **stencils, hypre_SStructPMatrix **pmatrix_ptr ); + +HYPRE_Int +hypre_SStructPMatrixDestroy_flt( hypre_SStructPMatrix *pmatrix ); +HYPRE_Int +hypre_SStructPMatrixDestroy_dbl( hypre_SStructPMatrix *pmatrix ); +HYPRE_Int +hypre_SStructPMatrixDestroy_long_dbl( hypre_SStructPMatrix *pmatrix ); + +HYPRE_Int +hypre_SStructPMatrixGetDiagonal_flt( hypre_SStructPMatrix *pmatrix, hypre_SStructPVector *pdiag ); +HYPRE_Int +hypre_SStructPMatrixGetDiagonal_dbl( hypre_SStructPMatrix *pmatrix, hypre_SStructPVector *pdiag ); +HYPRE_Int +hypre_SStructPMatrixGetDiagonal_long_dbl( hypre_SStructPMatrix *pmatrix, hypre_SStructPVector *pdiag ); + +HYPRE_Int +hypre_SStructPMatrixInitialize_flt( hypre_SStructPMatrix *pmatrix ); +HYPRE_Int +hypre_SStructPMatrixInitialize_dbl( hypre_SStructPMatrix *pmatrix ); +HYPRE_Int +hypre_SStructPMatrixInitialize_long_dbl( hypre_SStructPMatrix *pmatrix ); + +HYPRE_Int +hypre_SStructPMatrixPrint_flt( const char *filename, hypre_SStructPMatrix *pmatrix, HYPRE_Int all ); +HYPRE_Int +hypre_SStructPMatrixPrint_dbl( const char *filename, hypre_SStructPMatrix *pmatrix, HYPRE_Int all ); +HYPRE_Int +hypre_SStructPMatrixPrint_long_dbl( const char *filename, hypre_SStructPMatrix *pmatrix, HYPRE_Int all ); + +HYPRE_Int +hypre_SStructPMatrixPtAP_flt( hypre_SStructPMatrix *A, hypre_SStructPMatrix *P, hypre_SStructPMatrix **M_ptr ); +HYPRE_Int +hypre_SStructPMatrixPtAP_dbl( hypre_SStructPMatrix *A, hypre_SStructPMatrix *P, hypre_SStructPMatrix **M_ptr ); +HYPRE_Int +hypre_SStructPMatrixPtAP_long_dbl( hypre_SStructPMatrix *A, hypre_SStructPMatrix *P, hypre_SStructPMatrix **M_ptr ); + +HYPRE_Int +hypre_SStructPMatrixRAP_flt( hypre_SStructPMatrix *R, hypre_SStructPMatrix *A, hypre_SStructPMatrix *P, hypre_SStructPMatrix **M_ptr ); +HYPRE_Int +hypre_SStructPMatrixRAP_dbl( hypre_SStructPMatrix *R, hypre_SStructPMatrix *A, hypre_SStructPMatrix *P, hypre_SStructPMatrix **M_ptr ); +HYPRE_Int +hypre_SStructPMatrixRAP_long_dbl( hypre_SStructPMatrix *R, hypre_SStructPMatrix *A, hypre_SStructPMatrix *P, hypre_SStructPMatrix **M_ptr ); + +HYPRE_Int +hypre_SStructPMatrixRTtAP_flt( hypre_SStructPMatrix *RT, hypre_SStructPMatrix *A, hypre_SStructPMatrix *P, hypre_SStructPMatrix **M_ptr ); +HYPRE_Int +hypre_SStructPMatrixRTtAP_dbl( hypre_SStructPMatrix *RT, hypre_SStructPMatrix *A, hypre_SStructPMatrix *P, hypre_SStructPMatrix **M_ptr ); +HYPRE_Int +hypre_SStructPMatrixRTtAP_long_dbl( hypre_SStructPMatrix *RT, hypre_SStructPMatrix *A, hypre_SStructPMatrix *P, hypre_SStructPMatrix **M_ptr ); + +HYPRE_Int +hypre_SStructPMatrixRef_flt( hypre_SStructPMatrix *matrix, hypre_SStructPMatrix **matrix_ref ); +HYPRE_Int +hypre_SStructPMatrixRef_dbl( hypre_SStructPMatrix *matrix, hypre_SStructPMatrix **matrix_ref ); +HYPRE_Int +hypre_SStructPMatrixRef_long_dbl( hypre_SStructPMatrix *matrix, hypre_SStructPMatrix **matrix_ref ); + +HYPRE_Int +hypre_SStructPMatrixSetBoxValues_flt( hypre_SStructPMatrix *pmatrix, hypre_Box *set_box, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_Box *value_box, hypre_float *values, HYPRE_Int action ); +HYPRE_Int +hypre_SStructPMatrixSetBoxValues_dbl( hypre_SStructPMatrix *pmatrix, hypre_Box *set_box, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_Box *value_box, hypre_double *values, HYPRE_Int action ); +HYPRE_Int +hypre_SStructPMatrixSetBoxValues_long_dbl( hypre_SStructPMatrix *pmatrix, hypre_Box *set_box, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_Box *value_box, hypre_long_double *values, HYPRE_Int action ); + +HYPRE_Int +hypre_SStructPMatrixSetCEntries_flt( hypre_SStructPMatrix *pmatrix, HYPRE_Int var, HYPRE_Int to_var, HYPRE_Int num_centries, HYPRE_Int *centries ); +HYPRE_Int +hypre_SStructPMatrixSetCEntries_dbl( hypre_SStructPMatrix *pmatrix, HYPRE_Int var, HYPRE_Int to_var, HYPRE_Int num_centries, HYPRE_Int *centries ); +HYPRE_Int +hypre_SStructPMatrixSetCEntries_long_dbl( hypre_SStructPMatrix *pmatrix, HYPRE_Int var, HYPRE_Int to_var, HYPRE_Int num_centries, HYPRE_Int *centries ); + +HYPRE_Int +hypre_SStructPMatrixSetDomainStride_flt( hypre_SStructPMatrix *pmatrix, hypre_Index dom_stride ); +HYPRE_Int +hypre_SStructPMatrixSetDomainStride_dbl( hypre_SStructPMatrix *pmatrix, hypre_Index dom_stride ); +HYPRE_Int +hypre_SStructPMatrixSetDomainStride_long_dbl( hypre_SStructPMatrix *pmatrix, hypre_Index dom_stride ); + +HYPRE_Int +hypre_SStructPMatrixSetRangeStride_flt( hypre_SStructPMatrix *pmatrix, hypre_Index ran_stride ); +HYPRE_Int +hypre_SStructPMatrixSetRangeStride_dbl( hypre_SStructPMatrix *pmatrix, hypre_Index ran_stride ); +HYPRE_Int +hypre_SStructPMatrixSetRangeStride_long_dbl( hypre_SStructPMatrix *pmatrix, hypre_Index ran_stride ); + +HYPRE_Int +hypre_SStructPMatrixSetSymmetric_flt( hypre_SStructPMatrix *pmatrix, HYPRE_Int var, HYPRE_Int to_var, HYPRE_Int symmetric ); +HYPRE_Int +hypre_SStructPMatrixSetSymmetric_dbl( hypre_SStructPMatrix *pmatrix, HYPRE_Int var, HYPRE_Int to_var, HYPRE_Int symmetric ); +HYPRE_Int +hypre_SStructPMatrixSetSymmetric_long_dbl( hypre_SStructPMatrix *pmatrix, HYPRE_Int var, HYPRE_Int to_var, HYPRE_Int symmetric ); + +HYPRE_Int +hypre_SStructPMatrixSetTranspose_flt( hypre_SStructPMatrix *pmatrix, HYPRE_Int transpose, HYPRE_Int *resize ); +HYPRE_Int +hypre_SStructPMatrixSetTranspose_dbl( hypre_SStructPMatrix *pmatrix, HYPRE_Int transpose, HYPRE_Int *resize ); +HYPRE_Int +hypre_SStructPMatrixSetTranspose_long_dbl( hypre_SStructPMatrix *pmatrix, HYPRE_Int transpose, HYPRE_Int *resize ); + +HYPRE_Int +hypre_SStructPMatrixSetValues_flt( hypre_SStructPMatrix *pmatrix, hypre_Index index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_float *values, HYPRE_Int action ); +HYPRE_Int +hypre_SStructPMatrixSetValues_dbl( hypre_SStructPMatrix *pmatrix, hypre_Index index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_double *values, HYPRE_Int action ); +HYPRE_Int +hypre_SStructPMatrixSetValues_long_dbl( hypre_SStructPMatrix *pmatrix, hypre_Index index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_long_double *values, HYPRE_Int action ); + +HYPRE_Int +hypre_SStructPMatvec_flt( hypre_float alpha, hypre_SStructPMatrix *pA, hypre_SStructPVector *px, hypre_float beta, hypre_SStructPVector *py ); +HYPRE_Int +hypre_SStructPMatvec_dbl( hypre_double alpha, hypre_SStructPMatrix *pA, hypre_SStructPVector *px, hypre_double beta, hypre_SStructPVector *py ); +HYPRE_Int +hypre_SStructPMatvec_long_dbl( hypre_long_double alpha, hypre_SStructPMatrix *pA, hypre_SStructPVector *px, hypre_long_double beta, hypre_SStructPVector *py ); + +HYPRE_Int +hypre_SStructPMatvecCompute_flt( void *pmatvec_vdata, hypre_float alpha, hypre_SStructPMatrix *pA, hypre_SStructPVector *px, hypre_float beta, hypre_SStructPVector *pb, hypre_SStructPVector *py ); +HYPRE_Int +hypre_SStructPMatvecCompute_dbl( void *pmatvec_vdata, hypre_double alpha, hypre_SStructPMatrix *pA, hypre_SStructPVector *px, hypre_double beta, hypre_SStructPVector *pb, hypre_SStructPVector *py ); +HYPRE_Int +hypre_SStructPMatvecCompute_long_dbl( void *pmatvec_vdata, hypre_long_double alpha, hypre_SStructPMatrix *pA, hypre_SStructPVector *px, hypre_long_double beta, hypre_SStructPVector *pb, hypre_SStructPVector *py ); + +HYPRE_Int +hypre_SStructPMatvecCreate_flt( void **pmatvec_vdata_ptr ); +HYPRE_Int +hypre_SStructPMatvecCreate_dbl( void **pmatvec_vdata_ptr ); +HYPRE_Int +hypre_SStructPMatvecCreate_long_dbl( void **pmatvec_vdata_ptr ); + +HYPRE_Int +hypre_SStructPMatvecDestroy_flt( void *pmatvec_vdata ); +HYPRE_Int +hypre_SStructPMatvecDestroy_dbl( void *pmatvec_vdata ); +HYPRE_Int +hypre_SStructPMatvecDestroy_long_dbl( void *pmatvec_vdata ); + +HYPRE_Int +hypre_SStructPMatvecSetTranspose_flt( void *pmatvec_vdata, HYPRE_Int transpose ); +HYPRE_Int +hypre_SStructPMatvecSetTranspose_dbl( void *pmatvec_vdata, HYPRE_Int transpose ); +HYPRE_Int +hypre_SStructPMatvecSetTranspose_long_dbl( void *pmatvec_vdata, HYPRE_Int transpose ); + +HYPRE_Int +hypre_SStructPMatvecSetup_flt( void *pmatvec_vdata, hypre_SStructPMatrix *pA, hypre_SStructPVector *px ); +HYPRE_Int +hypre_SStructPMatvecSetup_dbl( void *pmatvec_vdata, hypre_SStructPMatrix *pA, hypre_SStructPVector *px ); +HYPRE_Int +hypre_SStructPMatvecSetup_long_dbl( void *pmatvec_vdata, hypre_SStructPMatrix *pA, hypre_SStructPVector *px ); + +HYPRE_Int +hypre_SStructPScale_flt( hypre_float alpha, hypre_SStructPVector *py ); +HYPRE_Int +hypre_SStructPScale_dbl( hypre_double alpha, hypre_SStructPVector *py ); +HYPRE_Int +hypre_SStructPScale_long_dbl( hypre_long_double alpha, hypre_SStructPVector *py ); + +HYPRE_Int +hypre_SStructPVectorAccumulate_flt( hypre_SStructPVector *pvector ); +HYPRE_Int +hypre_SStructPVectorAccumulate_dbl( hypre_SStructPVector *pvector ); +HYPRE_Int +hypre_SStructPVectorAccumulate_long_dbl( hypre_SStructPVector *pvector ); + +HYPRE_Int +hypre_SStructPVectorAssemble_flt( hypre_SStructPVector *pvector ); +HYPRE_Int +hypre_SStructPVectorAssemble_dbl( hypre_SStructPVector *pvector ); +HYPRE_Int +hypre_SStructPVectorAssemble_long_dbl( hypre_SStructPVector *pvector ); + +HYPRE_Int +hypre_SStructPVectorCreate_flt( MPI_Comm comm, hypre_SStructPGrid *pgrid, hypre_SStructPVector **pvector_ptr ); +HYPRE_Int +hypre_SStructPVectorCreate_dbl( MPI_Comm comm, hypre_SStructPGrid *pgrid, hypre_SStructPVector **pvector_ptr ); +HYPRE_Int +hypre_SStructPVectorCreate_long_dbl( MPI_Comm comm, hypre_SStructPGrid *pgrid, hypre_SStructPVector **pvector_ptr ); + +HYPRE_Int +hypre_SStructPVectorDestroy_flt( hypre_SStructPVector *pvector ); +HYPRE_Int +hypre_SStructPVectorDestroy_dbl( hypre_SStructPVector *pvector ); +HYPRE_Int +hypre_SStructPVectorDestroy_long_dbl( hypre_SStructPVector *pvector ); + +HYPRE_Int +hypre_SStructPVectorGather_flt( hypre_SStructPVector *pvector ); +HYPRE_Int +hypre_SStructPVectorGather_dbl( hypre_SStructPVector *pvector ); +HYPRE_Int +hypre_SStructPVectorGather_long_dbl( hypre_SStructPVector *pvector ); + +HYPRE_Int +hypre_SStructPVectorGetBoxValues_flt( hypre_SStructPVector *pvector, hypre_Box *set_box, HYPRE_Int var, hypre_Box *value_box, hypre_float *values ); +HYPRE_Int +hypre_SStructPVectorGetBoxValues_dbl( hypre_SStructPVector *pvector, hypre_Box *set_box, HYPRE_Int var, hypre_Box *value_box, hypre_double *values ); +HYPRE_Int +hypre_SStructPVectorGetBoxValues_long_dbl( hypre_SStructPVector *pvector, hypre_Box *set_box, HYPRE_Int var, hypre_Box *value_box, hypre_long_double *values ); + +HYPRE_Int +hypre_SStructPVectorGetValues_flt( hypre_SStructPVector *pvector, hypre_Index index, HYPRE_Int var, hypre_float *value ); +HYPRE_Int +hypre_SStructPVectorGetValues_dbl( hypre_SStructPVector *pvector, hypre_Index index, HYPRE_Int var, hypre_double *value ); +HYPRE_Int +hypre_SStructPVectorGetValues_long_dbl( hypre_SStructPVector *pvector, hypre_Index index, HYPRE_Int var, hypre_long_double *value ); + +HYPRE_Int +hypre_SStructPVectorInitialize_flt( hypre_SStructPVector *pvector ); +HYPRE_Int +hypre_SStructPVectorInitialize_dbl( hypre_SStructPVector *pvector ); +HYPRE_Int +hypre_SStructPVectorInitialize_long_dbl( hypre_SStructPVector *pvector ); + +HYPRE_Int +hypre_SStructPVectorInitializeShell_flt( hypre_SStructPVector *pvector ); +HYPRE_Int +hypre_SStructPVectorInitializeShell_dbl( hypre_SStructPVector *pvector ); +HYPRE_Int +hypre_SStructPVectorInitializeShell_long_dbl( hypre_SStructPVector *pvector ); + +HYPRE_Int +hypre_SStructPVectorPointwiseDivpy_flt( hypre_float alpha, hypre_SStructPVector *px, hypre_SStructPVector *pz, hypre_float beta, hypre_SStructPVector *py ); +HYPRE_Int +hypre_SStructPVectorPointwiseDivpy_dbl( hypre_double alpha, hypre_SStructPVector *px, hypre_SStructPVector *pz, hypre_double beta, hypre_SStructPVector *py ); +HYPRE_Int +hypre_SStructPVectorPointwiseDivpy_long_dbl( hypre_long_double alpha, hypre_SStructPVector *px, hypre_SStructPVector *pz, hypre_long_double beta, hypre_SStructPVector *py ); + +HYPRE_Int +hypre_SStructPVectorPrint_flt( const char *filename, hypre_SStructPVector *pvector, HYPRE_Int all ); +HYPRE_Int +hypre_SStructPVectorPrint_dbl( const char *filename, hypre_SStructPVector *pvector, HYPRE_Int all ); +HYPRE_Int +hypre_SStructPVectorPrint_long_dbl( const char *filename, hypre_SStructPVector *pvector, HYPRE_Int all ); + +HYPRE_Int +hypre_SStructPVectorRef_flt( hypre_SStructPVector *vector, hypre_SStructPVector **vector_ref ); +HYPRE_Int +hypre_SStructPVectorRef_dbl( hypre_SStructPVector *vector, hypre_SStructPVector **vector_ref ); +HYPRE_Int +hypre_SStructPVectorRef_long_dbl( hypre_SStructPVector *vector, hypre_SStructPVector **vector_ref ); + +HYPRE_Int +hypre_SStructPVectorSetBoxValues_flt( hypre_SStructPVector *pvector, hypre_Box *set_box, HYPRE_Int var, hypre_Box *value_box, hypre_float *values, HYPRE_Int action ); +HYPRE_Int +hypre_SStructPVectorSetBoxValues_dbl( hypre_SStructPVector *pvector, hypre_Box *set_box, HYPRE_Int var, hypre_Box *value_box, hypre_double *values, HYPRE_Int action ); +HYPRE_Int +hypre_SStructPVectorSetBoxValues_long_dbl( hypre_SStructPVector *pvector, hypre_Box *set_box, HYPRE_Int var, hypre_Box *value_box, hypre_long_double *values, HYPRE_Int action ); + +HYPRE_Int +hypre_SStructPVectorSetConstantValues_flt( hypre_SStructPVector *pvector, hypre_float value ); +HYPRE_Int +hypre_SStructPVectorSetConstantValues_dbl( hypre_SStructPVector *pvector, hypre_double value ); +HYPRE_Int +hypre_SStructPVectorSetConstantValues_long_dbl( hypre_SStructPVector *pvector, hypre_long_double value ); + +HYPRE_Int +hypre_SStructPVectorSetRandomValues_flt( hypre_SStructPVector *pvector, HYPRE_Int seed ); +HYPRE_Int +hypre_SStructPVectorSetRandomValues_dbl( hypre_SStructPVector *pvector, HYPRE_Int seed ); +HYPRE_Int +hypre_SStructPVectorSetRandomValues_long_dbl( hypre_SStructPVector *pvector, HYPRE_Int seed ); + +HYPRE_Int +hypre_SStructPVectorSetValues_flt( hypre_SStructPVector *pvector, hypre_Index index, HYPRE_Int var, hypre_float *value, HYPRE_Int action ); +HYPRE_Int +hypre_SStructPVectorSetValues_dbl( hypre_SStructPVector *pvector, hypre_Index index, HYPRE_Int var, hypre_double *value, HYPRE_Int action ); +HYPRE_Int +hypre_SStructPVectorSetValues_long_dbl( hypre_SStructPVector *pvector, hypre_Index index, HYPRE_Int var, hypre_long_double *value, HYPRE_Int action ); + +HYPRE_Int +hypre_SStructPartialPCopy_flt( hypre_SStructPVector *px, hypre_SStructPVector *py, hypre_BoxArrayArray **array_boxes ); +HYPRE_Int +hypre_SStructPartialPCopy_dbl( hypre_SStructPVector *px, hypre_SStructPVector *py, hypre_BoxArrayArray **array_boxes ); +HYPRE_Int +hypre_SStructPartialPCopy_long_dbl( hypre_SStructPVector *px, hypre_SStructPVector *py, hypre_BoxArrayArray **array_boxes ); + +HYPRE_Int +hypre_SStructScale_flt( hypre_float alpha, hypre_SStructVector *y ); +HYPRE_Int +hypre_SStructScale_dbl( hypre_double alpha, hypre_SStructVector *y ); +HYPRE_Int +hypre_SStructScale_long_dbl( hypre_long_double alpha, hypre_SStructVector *y ); + +HYPRE_Int +hypre_SStructStencilRef_flt( hypre_SStructStencil *stencil, hypre_SStructStencil **stencil_ref ); +HYPRE_Int +hypre_SStructStencilRef_dbl( hypre_SStructStencil *stencil, hypre_SStructStencil **stencil_ref ); +HYPRE_Int +hypre_SStructStencilRef_long_dbl( hypre_SStructStencil *stencil, hypre_SStructStencil **stencil_ref ); + +HYPRE_Int +hypre_SStructUMatrixAssemble_flt( hypre_SStructMatrix *matrix ); +HYPRE_Int +hypre_SStructUMatrixAssemble_dbl( hypre_SStructMatrix *matrix ); +HYPRE_Int +hypre_SStructUMatrixAssemble_long_dbl( hypre_SStructMatrix *matrix ); + +HYPRE_Int +hypre_SStructUMatrixInitialize_flt( hypre_SStructMatrix *matrix, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_SStructUMatrixInitialize_dbl( hypre_SStructMatrix *matrix, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_SStructUMatrixInitialize_long_dbl( hypre_SStructMatrix *matrix, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +hypre_SStructUMatrixSetBoxValues_flt( hypre_SStructMatrix *matrix, HYPRE_Int part, hypre_Box *set_box, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_Box *value_box, hypre_float *values, HYPRE_Int action ); +HYPRE_Int +hypre_SStructUMatrixSetBoxValues_dbl( hypre_SStructMatrix *matrix, HYPRE_Int part, hypre_Box *set_box, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_Box *value_box, hypre_double *values, HYPRE_Int action ); +HYPRE_Int +hypre_SStructUMatrixSetBoxValues_long_dbl( hypre_SStructMatrix *matrix, HYPRE_Int part, hypre_Box *set_box, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_Box *value_box, hypre_long_double *values, HYPRE_Int action ); + +HYPRE_Int +hypre_SStructUMatrixSetBoxValuesHelper_flt( hypre_SStructMatrix *matrix, HYPRE_Int part, hypre_Box *set_box, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_Box *value_box, hypre_float *values, HYPRE_Int action, HYPRE_IJMatrix ijmatrix ); +HYPRE_Int +hypre_SStructUMatrixSetBoxValuesHelper_dbl( hypre_SStructMatrix *matrix, HYPRE_Int part, hypre_Box *set_box, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_Box *value_box, hypre_double *values, HYPRE_Int action, HYPRE_IJMatrix ijmatrix ); +HYPRE_Int +hypre_SStructUMatrixSetBoxValuesHelper_long_dbl( hypre_SStructMatrix *matrix, HYPRE_Int part, hypre_Box *set_box, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_Box *value_box, hypre_long_double *values, HYPRE_Int action, HYPRE_IJMatrix ijmatrix ); + +HYPRE_Int +hypre_SStructUMatrixSetValues_flt( hypre_SStructMatrix *matrix, HYPRE_Int part, hypre_Index index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_float *values, HYPRE_Int action ); +HYPRE_Int +hypre_SStructUMatrixSetValues_dbl( hypre_SStructMatrix *matrix, HYPRE_Int part, hypre_Index index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_double *values, HYPRE_Int action ); +HYPRE_Int +hypre_SStructUMatrixSetValues_long_dbl( hypre_SStructMatrix *matrix, HYPRE_Int part, hypre_Index index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, hypre_long_double *values, HYPRE_Int action ); + +HYPRE_Int +hypre_SStructVarToNborVar_flt( hypre_SStructGrid *grid, HYPRE_Int part, HYPRE_Int var, HYPRE_Int *coord, HYPRE_Int *nbor_var_ptr ); +HYPRE_Int +hypre_SStructVarToNborVar_dbl( hypre_SStructGrid *grid, HYPRE_Int part, HYPRE_Int var, HYPRE_Int *coord, HYPRE_Int *nbor_var_ptr ); +HYPRE_Int +hypre_SStructVarToNborVar_long_dbl( hypre_SStructGrid *grid, HYPRE_Int part, HYPRE_Int var, HYPRE_Int *coord, HYPRE_Int *nbor_var_ptr ); + +HYPRE_Int +hypre_SStructVariableGetOffset_flt( HYPRE_SStructVariable vartype, HYPRE_Int ndim, hypre_Index varoffset ); +HYPRE_Int +hypre_SStructVariableGetOffset_dbl( HYPRE_SStructVariable vartype, HYPRE_Int ndim, hypre_Index varoffset ); +HYPRE_Int +hypre_SStructVariableGetOffset_long_dbl( HYPRE_SStructVariable vartype, HYPRE_Int ndim, hypre_Index varoffset ); + +HYPRE_Int +hypre_SStructVectorClearGhostValues_flt( hypre_SStructVector *vector ); +HYPRE_Int +hypre_SStructVectorClearGhostValues_dbl( hypre_SStructVector *vector ); +HYPRE_Int +hypre_SStructVectorClearGhostValues_long_dbl( hypre_SStructVector *vector ); + +HYPRE_Int +hypre_SStructVectorConvert_flt( hypre_SStructVector *vector, hypre_ParVector **parvector_ptr ); +HYPRE_Int +hypre_SStructVectorConvert_dbl( hypre_SStructVector *vector, hypre_ParVector **parvector_ptr ); +HYPRE_Int +hypre_SStructVectorConvert_long_dbl( hypre_SStructVector *vector, hypre_ParVector **parvector_ptr ); + +HYPRE_Int +hypre_SStructVectorInitializeShell_flt( hypre_SStructVector *vector ); +HYPRE_Int +hypre_SStructVectorInitializeShell_dbl( hypre_SStructVector *vector ); +HYPRE_Int +hypre_SStructVectorInitializeShell_long_dbl( hypre_SStructVector *vector ); + +HYPRE_MemoryLocation +hypre_SStructVectorMemoryLocation_flt( hypre_SStructVector *vector ); +HYPRE_MemoryLocation +hypre_SStructVectorMemoryLocation_dbl( hypre_SStructVector *vector ); +HYPRE_MemoryLocation +hypre_SStructVectorMemoryLocation_long_dbl( hypre_SStructVector *vector ); + +HYPRE_Int +hypre_SStructVectorParConvert_flt( hypre_SStructVector *vector, hypre_ParVector **parvector_ptr ); +HYPRE_Int +hypre_SStructVectorParConvert_dbl( hypre_SStructVector *vector, hypre_ParVector **parvector_ptr ); +HYPRE_Int +hypre_SStructVectorParConvert_long_dbl( hypre_SStructVector *vector, hypre_ParVector **parvector_ptr ); + +HYPRE_Int +hypre_SStructVectorParRestore_flt( hypre_SStructVector *vector, hypre_ParVector *parvector ); +HYPRE_Int +hypre_SStructVectorParRestore_dbl( hypre_SStructVector *vector, hypre_ParVector *parvector ); +HYPRE_Int +hypre_SStructVectorParRestore_long_dbl( hypre_SStructVector *vector, hypre_ParVector *parvector ); + +HYPRE_Int +hypre_SStructVectorPointwiseDivision_flt( hypre_SStructVector *x, hypre_SStructVector *y, hypre_SStructVector **z_ptr ); +HYPRE_Int +hypre_SStructVectorPointwiseDivision_dbl( hypre_SStructVector *x, hypre_SStructVector *y, hypre_SStructVector **z_ptr ); +HYPRE_Int +hypre_SStructVectorPointwiseDivision_long_dbl( hypre_SStructVector *x, hypre_SStructVector *y, hypre_SStructVector **z_ptr ); + +HYPRE_Int +hypre_SStructVectorPointwiseDivpy_flt( hypre_float *alpha, hypre_SStructVector *x, hypre_SStructVector *z, hypre_float *beta, hypre_SStructVector *y ); +HYPRE_Int +hypre_SStructVectorPointwiseDivpy_dbl( hypre_double *alpha, hypre_SStructVector *x, hypre_SStructVector *z, hypre_double *beta, hypre_SStructVector *y ); +HYPRE_Int +hypre_SStructVectorPointwiseDivpy_long_dbl( hypre_long_double *alpha, hypre_SStructVector *x, hypre_SStructVector *z, hypre_long_double *beta, hypre_SStructVector *y ); + +HYPRE_Int +hypre_SStructVectorPointwiseInverse_flt( hypre_SStructVector *x, hypre_SStructVector **y_ptr ); +HYPRE_Int +hypre_SStructVectorPointwiseInverse_dbl( hypre_SStructVector *x, hypre_SStructVector **y_ptr ); +HYPRE_Int +hypre_SStructVectorPointwiseInverse_long_dbl( hypre_SStructVector *x, hypre_SStructVector **y_ptr ); + +HYPRE_Int +hypre_SStructVectorPointwiseProduct_flt( hypre_SStructVector *x, hypre_SStructVector *y, hypre_SStructVector **z_ptr ); +HYPRE_Int +hypre_SStructVectorPointwiseProduct_dbl( hypre_SStructVector *x, hypre_SStructVector *y, hypre_SStructVector **z_ptr ); +HYPRE_Int +hypre_SStructVectorPointwiseProduct_long_dbl( hypre_SStructVector *x, hypre_SStructVector *y, hypre_SStructVector **z_ptr ); + +HYPRE_Int +hypre_SStructVectorPrintGLVis_flt( hypre_SStructVector *vector, const char *fileprefix ); +HYPRE_Int +hypre_SStructVectorPrintGLVis_dbl( hypre_SStructVector *vector, const char *fileprefix ); +HYPRE_Int +hypre_SStructVectorPrintGLVis_long_dbl( hypre_SStructVector *vector, const char *fileprefix ); + +HYPRE_Int +hypre_SStructVectorRef_flt( hypre_SStructVector *vector, hypre_SStructVector **vector_ref ); +HYPRE_Int +hypre_SStructVectorRef_dbl( hypre_SStructVector *vector, hypre_SStructVector **vector_ref ); +HYPRE_Int +hypre_SStructVectorRef_long_dbl( hypre_SStructVector *vector, hypre_SStructVector **vector_ref ); + +HYPRE_Int +hypre_SStructVectorRestore_flt( hypre_SStructVector *vector, hypre_ParVector *parvector ); +HYPRE_Int +hypre_SStructVectorRestore_dbl( hypre_SStructVector *vector, hypre_ParVector *parvector ); +HYPRE_Int +hypre_SStructVectorRestore_long_dbl( hypre_SStructVector *vector, hypre_ParVector *parvector ); + +HYPRE_Int +hypre_SStructVectorSetConstantValues_flt( hypre_SStructVector *vector, hypre_float value ); +HYPRE_Int +hypre_SStructVectorSetConstantValues_dbl( hypre_SStructVector *vector, hypre_double value ); +HYPRE_Int +hypre_SStructVectorSetConstantValues_long_dbl( hypre_SStructVector *vector, hypre_long_double value ); + +HYPRE_Int +hypre_SStructVectorSetRandomValues_flt( hypre_SStructVector *vector, HYPRE_Int seed ); +HYPRE_Int +hypre_SStructVectorSetRandomValues_dbl( hypre_SStructVector *vector, HYPRE_Int seed ); +HYPRE_Int +hypre_SStructVectorSetRandomValues_long_dbl( hypre_SStructVector *vector, HYPRE_Int seed ); + + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + + + +#endif + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/src/sstruct_mv/_hypre_sstruct_mv_mup_def.h b/src/sstruct_mv/_hypre_sstruct_mv_mup_def.h new file mode 100644 index 0000000000..2ab014dd7b --- /dev/null +++ b/src/sstruct_mv/_hypre_sstruct_mv_mup_def.h @@ -0,0 +1,332 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#ifndef hypre_SSTRUCT_MV_MUP_DEF_HEADER +#define hypre_SSTRUCT_MV_MUP_DEF_HEADER + +#include "_hypre_mup_def.h" + +#define HYPRE_SStructAxpy HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructAxpy ) +#define HYPRE_SStructGraphAddEntries HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGraphAddEntries ) +#define HYPRE_SStructGraphAssemble HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGraphAssemble ) +#define HYPRE_SStructGraphCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGraphCreate ) +#define HYPRE_SStructGraphDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGraphDestroy ) +#define HYPRE_SStructGraphPrint HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGraphPrint ) +#define HYPRE_SStructGraphRead HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGraphRead ) +#define HYPRE_SStructGraphSetDomainGrid HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGraphSetDomainGrid ) +#define HYPRE_SStructGraphSetFEM HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGraphSetFEM ) +#define HYPRE_SStructGraphSetFEMSparsity HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGraphSetFEMSparsity ) +#define HYPRE_SStructGraphSetObjectType HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGraphSetObjectType ) +#define HYPRE_SStructGraphSetStencil HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGraphSetStencil ) +#define HYPRE_SStructGridAddVariables HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGridAddVariables ) +#define HYPRE_SStructGridAssemble HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGridAssemble ) +#define HYPRE_SStructGridCoarsen HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGridCoarsen ) +#define HYPRE_SStructGridCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGridCreate ) +#define HYPRE_SStructGridDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGridDestroy ) +#define HYPRE_SStructGridGetVariableBox HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGridGetVariableBox ) +#define HYPRE_SStructGridPrintGLVis HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGridPrintGLVis ) +#define HYPRE_SStructGridProjectBox HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGridProjectBox ) +#define HYPRE_SStructGridSetExtents HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGridSetExtents ) +#define HYPRE_SStructGridSetFEMOrdering HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGridSetFEMOrdering ) +#define HYPRE_SStructGridSetNeighborPart HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGridSetNeighborPart ) +#define HYPRE_SStructGridSetNumGhost HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGridSetNumGhost ) +#define HYPRE_SStructGridSetPeriodic HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGridSetPeriodic ) +#define HYPRE_SStructGridSetSharedPart HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGridSetSharedPart ) +#define HYPRE_SStructGridSetVariables HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructGridSetVariables ) +#define HYPRE_SStructInnerProd HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructInnerProd ) +#define HYPRE_SStructMatrixAddFEMBoxValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructMatrixAddFEMBoxValues ) +#define HYPRE_SStructMatrixAddFEMValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructMatrixAddFEMValues ) +#define HYPRE_SStructMatrixAddToBoxValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructMatrixAddToBoxValues ) +#define HYPRE_SStructMatrixAddToBoxValues2 HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructMatrixAddToBoxValues2 ) +#define HYPRE_SStructMatrixAddToValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructMatrixAddToValues ) +#define HYPRE_SStructMatrixAssemble HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructMatrixAssemble ) +#define HYPRE_SStructMatrixCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructMatrixCreate ) +#define HYPRE_SStructMatrixDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructMatrixDestroy ) +#define HYPRE_SStructMatrixGetBoxValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructMatrixGetBoxValues ) +#define HYPRE_SStructMatrixGetBoxValues2 HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructMatrixGetBoxValues2 ) +#define HYPRE_SStructMatrixGetFEMValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructMatrixGetFEMValues ) +#define HYPRE_SStructMatrixGetGrid HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructMatrixGetGrid ) +#define HYPRE_SStructMatrixGetObject HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructMatrixGetObject ) +#define HYPRE_SStructMatrixGetValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructMatrixGetValues ) +#define HYPRE_SStructMatrixInitialize HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructMatrixInitialize ) +#define HYPRE_SStructMatrixMatmat HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructMatrixMatmat ) +#define HYPRE_SStructMatrixMatvec HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructMatrixMatvec ) +#define HYPRE_SStructMatrixPrint HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructMatrixPrint ) +#define HYPRE_SStructMatrixRead HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructMatrixRead ) +#define HYPRE_SStructMatrixSetBoxValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructMatrixSetBoxValues ) +#define HYPRE_SStructMatrixSetBoxValues2 HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructMatrixSetBoxValues2 ) +#define HYPRE_SStructMatrixSetConstantEntries HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructMatrixSetConstantEntries ) +#define HYPRE_SStructMatrixSetDomainStride HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructMatrixSetDomainStride ) +#define HYPRE_SStructMatrixSetEarlyAssemble HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructMatrixSetEarlyAssemble ) +#define HYPRE_SStructMatrixSetNSSymmetric HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructMatrixSetNSSymmetric ) +#define HYPRE_SStructMatrixSetObjectType HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructMatrixSetObjectType ) +#define HYPRE_SStructMatrixSetRangeStride HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructMatrixSetRangeStride ) +#define HYPRE_SStructMatrixSetSymmetric HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructMatrixSetSymmetric ) +#define HYPRE_SStructMatrixSetValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructMatrixSetValues ) +#define HYPRE_SStructMatrixToIJMatrix HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructMatrixToIJMatrix ) +#define HYPRE_SStructStencilCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructStencilCreate ) +#define HYPRE_SStructStencilDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructStencilDestroy ) +#define HYPRE_SStructStencilPrint HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructStencilPrint ) +#define HYPRE_SStructStencilRead HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructStencilRead ) +#define HYPRE_SStructStencilSetEntry HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructStencilSetEntry ) +#define HYPRE_SStructVectorAddFEMBoxValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructVectorAddFEMBoxValues ) +#define HYPRE_SStructVectorAddFEMValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructVectorAddFEMValues ) +#define HYPRE_SStructVectorAddToBoxValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructVectorAddToBoxValues ) +#define HYPRE_SStructVectorAddToBoxValues2 HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructVectorAddToBoxValues2 ) +#define HYPRE_SStructVectorAddToValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructVectorAddToValues ) +#define HYPRE_SStructVectorAssemble HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructVectorAssemble ) +#define HYPRE_SStructVectorAxpy HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructVectorAxpy ) +#define HYPRE_SStructVectorCopy HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructVectorCopy ) +#define HYPRE_SStructVectorCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructVectorCreate ) +#define HYPRE_SStructVectorDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructVectorDestroy ) +#define HYPRE_SStructVectorGather HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructVectorGather ) +#define HYPRE_SStructVectorGetBoxValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructVectorGetBoxValues ) +#define HYPRE_SStructVectorGetBoxValues2 HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructVectorGetBoxValues2 ) +#define HYPRE_SStructVectorGetFEMValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructVectorGetFEMValues ) +#define HYPRE_SStructVectorGetObject HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructVectorGetObject ) +#define HYPRE_SStructVectorGetValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructVectorGetValues ) +#define HYPRE_SStructVectorInitialize HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructVectorInitialize ) +#define HYPRE_SStructVectorInnerProd HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructVectorInnerProd ) +#define HYPRE_SStructVectorPrint HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructVectorPrint ) +#define HYPRE_SStructVectorPrintGLVis HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructVectorPrintGLVis ) +#define HYPRE_SStructVectorRead HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructVectorRead ) +#define HYPRE_SStructVectorScale HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructVectorScale ) +#define HYPRE_SStructVectorSetBoxValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructVectorSetBoxValues ) +#define HYPRE_SStructVectorSetBoxValues2 HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructVectorSetBoxValues2 ) +#define HYPRE_SStructVectorSetConstantValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructVectorSetConstantValues ) +#define HYPRE_SStructVectorSetObjectType HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructVectorSetObjectType ) +#define HYPRE_SStructVectorSetRandomValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructVectorSetRandomValues ) +#define HYPRE_SStructVectorSetValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_SStructVectorSetValues ) +#define hypre_SStructAxpy HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructAxpy ) +#define hypre_SStructBoxManEntryGetBoxnum HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructBoxManEntryGetBoxnum ) +#define hypre_SStructBoxManEntryGetCSRstrides HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructBoxManEntryGetCSRstrides ) +#define hypre_SStructBoxManEntryGetGhstrides HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructBoxManEntryGetGhstrides ) +#define hypre_SStructBoxManEntryGetGlobalCSRank HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructBoxManEntryGetGlobalCSRank ) +#define hypre_SStructBoxManEntryGetGlobalGhrank HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructBoxManEntryGetGlobalGhrank ) +#define hypre_SStructBoxManEntryGetGlobalRank HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructBoxManEntryGetGlobalRank ) +#define hypre_SStructBoxManEntryGetPart HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructBoxManEntryGetPart ) +#define hypre_SStructBoxManEntryGetProcess HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructBoxManEntryGetProcess ) +#define hypre_SStructBoxManEntryGetStrides HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructBoxManEntryGetStrides ) +#define hypre_SStructBoxNumMap HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructBoxNumMap ) +#define hypre_SStructBoxToNborBox HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructBoxToNborBox ) +#define hypre_SStructCellBoxToVarBox HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructCellBoxToVarBox ) +#define hypre_SStructCellGridBoxNumMap HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructCellGridBoxNumMap ) +#define hypre_SStructCopy HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructCopy ) +#define hypre_SStructGraphFindBoxEndpt HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructGraphFindBoxEndpt ) +#define hypre_SStructGraphFindSGridEndpts HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructGraphFindSGridEndpts ) +#define hypre_SStructGraphGetUVEntryRank HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructGraphGetUVEntryRank ) +#define hypre_SStructGraphRef HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructGraphRef ) +#define hypre_SStructGridAssembleBoxManagers HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructGridAssembleBoxManagers ) +#define hypre_SStructGridAssembleNborBoxManagers HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructGridAssembleNborBoxManagers ) +#define hypre_SStructGridBoxProcFindBoxManEntry HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructGridBoxProcFindBoxManEntry ) +#define hypre_SStructGridCoarsen HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructGridCoarsen ) +#define hypre_SStructGridComputeGlobalSizes HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructGridComputeGlobalSizes ) +#define hypre_SStructGridCreateCommInfo HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructGridCreateCommInfo ) +#define hypre_SStructGridFindBoxManEntry HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructGridFindBoxManEntry ) +#define hypre_SStructGridFindNborBoxManEntry HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructGridFindNborBoxManEntry ) +#define hypre_SStructGridGetMaxBoxSize HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructGridGetMaxBoxSize ) +#define hypre_SStructGridIntersect HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructGridIntersect ) +#define hypre_SStructGridPrint HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructGridPrint ) +#define hypre_SStructGridPrintGLVis HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructGridPrintGLVis ) +#define hypre_SStructGridRead HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructGridRead ) +#define hypre_SStructGridRef HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructGridRef ) +#define hypre_SStructGridSetActiveParts HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructGridSetActiveParts ) +#define hypre_SStructGridSetAllPartsActive HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructGridSetAllPartsActive ) +#define hypre_SStructGridSetNumGhost HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructGridSetNumGhost ) +#define hypre_SStructIndexToNborIndex HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructIndexToNborIndex ) +#define hypre_SStructInnerProd HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructInnerProd ) +#define hypre_SStructMatmat HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatmat ) +#define hypre_SStructMatmult HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatmult ) +#define hypre_SStructMatmultCommunicate HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatmultCommunicate ) +#define hypre_SStructMatmultCompute HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatmultCompute ) +#define hypre_SStructMatmultComputeS HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatmultComputeS ) +#define hypre_SStructMatmultComputeU HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatmultComputeU ) +#define hypre_SStructMatmultCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatmultCreate ) +#define hypre_SStructMatmultDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatmultDestroy ) +#define hypre_SStructMatmultInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatmultInitialize ) +#define hypre_SStructMatrixBoxesToUMatrix HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatrixBoxesToUMatrix ) +#define hypre_SStructMatrixCompressUToS HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatrixCompressUToS ) +#define hypre_SStructMatrixComputeL1Norms HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatrixComputeL1Norms ) +#define hypre_SStructMatrixComputeRowSum HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatrixComputeRowSum ) +#define hypre_SStructMatrixGetDiagonal HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatrixGetDiagonal ) +#define hypre_SStructMatrixHaloToUMatrix HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatrixHaloToUMatrix ) +#define hypre_SStructMatrixMapDataBox HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatrixMapDataBox ) +#define hypre_SStructMatrixMemoryLocation HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatrixMemoryLocation ) +#define hypre_SStructMatrixPtAP HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatrixPtAP ) +#define hypre_SStructMatrixRAP HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatrixRAP ) +#define hypre_SStructMatrixRTtAP HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatrixRTtAP ) +#define hypre_SStructMatrixRef HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatrixRef ) +#define hypre_SStructMatrixSetBoxValues HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatrixSetBoxValues ) +#define hypre_SStructMatrixSetInterPartValues HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatrixSetInterPartValues ) +#define hypre_SStructMatrixSetValues HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatrixSetValues ) +#define hypre_SStructMatrixSplitEntries HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatrixSplitEntries ) +#define hypre_SStructMatrixToUMatrix HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatrixToUMatrix ) +#define hypre_SStructMatvec HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatvec ) +#define hypre_SStructMatvecCompute HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatvecCompute ) +#define hypre_SStructMatvecCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatvecCreate ) +#define hypre_SStructMatvecDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatvecDestroy ) +#define hypre_SStructMatvecSetTranspose HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatvecSetTranspose ) +#define hypre_SStructMatvecSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructMatvecSetup ) +#define hypre_SStructNborBoxToBox HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructNborBoxToBox ) +#define hypre_SStructNborIndexToIndex HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructNborIndexToIndex ) +#define hypre_SStructPAxpy HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPAxpy ) +#define hypre_SStructPCopy HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPCopy ) +#define hypre_SStructPGridAssemble HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPGridAssemble ) +#define hypre_SStructPGridCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPGridCreate ) +#define hypre_SStructPGridDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPGridDestroy ) +#define hypre_SStructPGridGetMaxBoxSize HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPGridGetMaxBoxSize ) +#define hypre_SStructPGridRef HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPGridRef ) +#define hypre_SStructPGridSetCellSGrid HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPGridSetCellSGrid ) +#define hypre_SStructPGridSetExtents HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPGridSetExtents ) +#define hypre_SStructPGridSetPNeighbor HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPGridSetPNeighbor ) +#define hypre_SStructPGridSetSGrid HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPGridSetSGrid ) +#define hypre_SStructPGridSetVariables HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPGridSetVariables ) +#define hypre_SStructPInnerProd HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPInnerProd ) +#define hypre_SStructPInnerProdLocal HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPInnerProdLocal ) +#define hypre_SStructPMatmat HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatmat ) +#define hypre_SStructPMatmult HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatmult ) +#define hypre_SStructPMatmultCommSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatmultCommSetup ) +#define hypre_SStructPMatmultCommunicate HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatmultCommunicate ) +#define hypre_SStructPMatmultCompute HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatmultCompute ) +#define hypre_SStructPMatmultCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatmultCreate ) +#define hypre_SStructPMatmultDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatmultDestroy ) +#define hypre_SStructPMatmultInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatmultInitialize ) +#define hypre_SStructPMatrixAccumulate HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatrixAccumulate ) +#define hypre_SStructPMatrixAssemble HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatrixAssemble ) +#define hypre_SStructPMatrixComputeRowSum HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatrixComputeRowSum ) +#define hypre_SStructPMatrixCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatrixCreate ) +#define hypre_SStructPMatrixDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatrixDestroy ) +#define hypre_SStructPMatrixGetDiagonal HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatrixGetDiagonal ) +#define hypre_SStructPMatrixInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatrixInitialize ) +#define hypre_SStructPMatrixPrint HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatrixPrint ) +#define hypre_SStructPMatrixPtAP HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatrixPtAP ) +#define hypre_SStructPMatrixRAP HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatrixRAP ) +#define hypre_SStructPMatrixRTtAP HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatrixRTtAP ) +#define hypre_SStructPMatrixRef HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatrixRef ) +#define hypre_SStructPMatrixSetBoxValues HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatrixSetBoxValues ) +#define hypre_SStructPMatrixSetCEntries HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatrixSetCEntries ) +#define hypre_SStructPMatrixSetDomainStride HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatrixSetDomainStride ) +#define hypre_SStructPMatrixSetRangeStride HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatrixSetRangeStride ) +#define hypre_SStructPMatrixSetSymmetric HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatrixSetSymmetric ) +#define hypre_SStructPMatrixSetTranspose HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatrixSetTranspose ) +#define hypre_SStructPMatrixSetValues HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatrixSetValues ) +#define hypre_SStructPMatvec HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatvec ) +#define hypre_SStructPMatvecCompute HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatvecCompute ) +#define hypre_SStructPMatvecCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatvecCreate ) +#define hypre_SStructPMatvecDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatvecDestroy ) +#define hypre_SStructPMatvecSetTranspose HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatvecSetTranspose ) +#define hypre_SStructPMatvecSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPMatvecSetup ) +#define hypre_SStructPScale HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPScale ) +#define hypre_SStructPVectorAccumulate HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPVectorAccumulate ) +#define hypre_SStructPVectorAssemble HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPVectorAssemble ) +#define hypre_SStructPVectorCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPVectorCreate ) +#define hypre_SStructPVectorDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPVectorDestroy ) +#define hypre_SStructPVectorGather HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPVectorGather ) +#define hypre_SStructPVectorGetBoxValues HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPVectorGetBoxValues ) +#define hypre_SStructPVectorGetValues HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPVectorGetValues ) +#define hypre_SStructPVectorInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPVectorInitialize ) +#define hypre_SStructPVectorInitializeShell HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPVectorInitializeShell ) +#define hypre_SStructPVectorPointwiseDivpy HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPVectorPointwiseDivpy ) +#define hypre_SStructPVectorPrint HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPVectorPrint ) +#define hypre_SStructPVectorRef HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPVectorRef ) +#define hypre_SStructPVectorSetBoxValues HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPVectorSetBoxValues ) +#define hypre_SStructPVectorSetConstantValues HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPVectorSetConstantValues ) +#define hypre_SStructPVectorSetRandomValues HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPVectorSetRandomValues ) +#define hypre_SStructPVectorSetValues HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPVectorSetValues ) +#define hypre_SStructPartialPCopy HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructPartialPCopy ) +#define hypre_SStructScale HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructScale ) +#define hypre_SStructStencilRef HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructStencilRef ) +#define hypre_SStructUMatrixAssemble HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructUMatrixAssemble ) +#define hypre_SStructUMatrixInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructUMatrixInitialize ) +#define hypre_SStructUMatrixSetBoxValues HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructUMatrixSetBoxValues ) +#define hypre_SStructUMatrixSetBoxValuesHelper HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructUMatrixSetBoxValuesHelper ) +#define hypre_SStructUMatrixSetValues HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructUMatrixSetValues ) +#define hypre_SStructVarToNborVar HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructVarToNborVar ) +#define hypre_SStructVariableGetOffset HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructVariableGetOffset ) +#define hypre_SStructVectorClearGhostValues HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructVectorClearGhostValues ) +#define hypre_SStructVectorConvert HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructVectorConvert ) +#define hypre_SStructVectorInitializeShell HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructVectorInitializeShell ) +#define hypre_SStructVectorMemoryLocation HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructVectorMemoryLocation ) +#define hypre_SStructVectorParConvert HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructVectorParConvert ) +#define hypre_SStructVectorParRestore HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructVectorParRestore ) +#define hypre_SStructVectorPointwiseDivision HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructVectorPointwiseDivision ) +#define hypre_SStructVectorPointwiseDivpy HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructVectorPointwiseDivpy ) +#define hypre_SStructVectorPointwiseInverse HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructVectorPointwiseInverse ) +#define hypre_SStructVectorPointwiseProduct HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructVectorPointwiseProduct ) +#define hypre_SStructVectorPrintGLVis HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructVectorPrintGLVis ) +#define hypre_SStructVectorRef HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructVectorRef ) +#define hypre_SStructVectorRestore HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructVectorRestore ) +#define hypre_SStructVectorSetConstantValues HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructVectorSetConstantValues ) +#define hypre_SStructVectorSetRandomValues HYPRE_FIXEDPRECISION_FUNC ( hypre_SStructVectorSetRandomValues ) +#define hypre_sstructaxpy HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructaxpy ) +#define hypre_sstructgraphaddentries HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgraphaddentries ) +#define hypre_sstructgraphassemble HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgraphassemble ) +#define hypre_sstructgraphcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgraphcreate ) +#define hypre_sstructgraphdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgraphdestroy ) +#define hypre_sstructgraphsetdomaingrid HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgraphsetdomaingrid ) +#define hypre_sstructgraphsetfem HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgraphsetfem ) +#define hypre_sstructgraphsetfemsparsity HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgraphsetfemsparsity ) +#define hypre_sstructgraphsetobjecttype HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgraphsetobjecttype ) +#define hypre_sstructgraphsetstencil HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgraphsetstencil ) +#define hypre_sstructgridaddvariables HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgridaddvariables ) +#define hypre_sstructgridassemble HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgridassemble ) +#define hypre_sstructgridcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgridcreate ) +#define hypre_sstructgriddestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgriddestroy ) +#define hypre_sstructgridsetextents HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgridsetextents ) +#define hypre_sstructgridsetfemordering HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgridsetfemordering ) +#define hypre_sstructgridsetneighborpart HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgridsetneighborpart ) +#define hypre_sstructgridsetnumghost HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgridsetnumghost ) +#define hypre_sstructgridsetperiodic HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgridsetperiodic ) +#define hypre_sstructgridsetsharedpart HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgridsetsharedpart ) +#define hypre_sstructgridsetvariables HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructgridsetvariables ) +#define hypre_sstructinnerprod HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructinnerprod ) +#define hypre_sstructmatrixaddfemvalues HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructmatrixaddfemvalues ) +#define hypre_sstructmatrixaddtoboxvalu HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructmatrixaddtoboxvalu ) +#define hypre_sstructmatrixaddtovalues HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructmatrixaddtovalues ) +#define hypre_sstructmatrixassemble HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructmatrixassemble ) +#define hypre_sstructmatrixcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructmatrixcreate ) +#define hypre_sstructmatrixdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructmatrixdestroy ) +#define hypre_sstructmatrixgetboxvalues HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructmatrixgetboxvalues ) +#define hypre_sstructmatrixgetobject HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructmatrixgetobject ) +#define hypre_sstructmatrixgetvalues HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructmatrixgetvalues ) +#define hypre_sstructmatrixinitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructmatrixinitialize ) +#define hypre_sstructmatrixmatvec HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructmatrixmatvec ) +#define hypre_sstructmatrixprint HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructmatrixprint ) +#define hypre_sstructmatrixsetboxvalues HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructmatrixsetboxvalues ) +#define hypre_sstructmatrixsetnssymmetr HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructmatrixsetnssymmetr ) +#define hypre_sstructmatrixsetobjecttyp HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructmatrixsetobjecttyp ) +#define hypre_sstructmatrixsetsymmetric HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructmatrixsetsymmetric ) +#define hypre_sstructmatrixsetvalues HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructmatrixsetvalues ) +#define hypre_sstructstencilcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructstencilcreate ) +#define hypre_sstructstencildestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructstencildestroy ) +#define hypre_sstructstencilsetentry HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructstencilsetentry ) +#define hypre_sstructvectoraddtoboxvalu HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructvectoraddtoboxvalu ) +#define hypre_sstructvectoraddtovalues HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructvectoraddtovalues ) +#define hypre_sstructvectorassemble HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructvectorassemble ) +#define hypre_sstructvectoraxpy HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructvectoraxpy ) +#define hypre_sstructvectorcopy HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructvectorcopy ) +#define hypre_sstructvectorcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructvectorcreate ) +#define hypre_sstructvectordestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructvectordestroy ) +#define hypre_sstructvectorgather HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructvectorgather ) +#define hypre_sstructvectorgetboxvalues HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructvectorgetboxvalues ) +#define hypre_sstructvectorgetobject HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructvectorgetobject ) +#define hypre_sstructvectorgetvalues HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructvectorgetvalues ) +#define hypre_sstructvectorinitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructvectorinitialize ) +#define hypre_sstructvectorinnerprod HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructvectorinnerprod ) +#define hypre_sstructvectorprint HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructvectorprint ) +#define hypre_sstructvectorscale HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructvectorscale ) +#define hypre_sstructvectorsetboxvalues HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructvectorsetboxvalues ) +#define hypre_sstructvectorsetconstantv HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructvectorsetconstantv ) +#define hypre_sstructvectorsetobjecttyp HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructvectorsetobjecttyp ) +#define hypre_sstructvectorsetvalues HYPRE_FIXEDPRECISION_FUNC ( hypre_sstructvectorsetvalues ) + +#endif diff --git a/src/sstruct_mv/_hypre_sstruct_mv_mup_undef.h b/src/sstruct_mv/_hypre_sstruct_mv_mup_undef.h new file mode 100644 index 0000000000..af99e95fca --- /dev/null +++ b/src/sstruct_mv/_hypre_sstruct_mv_mup_undef.h @@ -0,0 +1,327 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#undef hypre_SSTRUCT_MV_MUP_DEF_HEADER + +#undef HYPRE_SStructAxpy +#undef HYPRE_SStructGraphAddEntries +#undef HYPRE_SStructGraphAssemble +#undef HYPRE_SStructGraphCreate +#undef HYPRE_SStructGraphDestroy +#undef HYPRE_SStructGraphPrint +#undef HYPRE_SStructGraphRead +#undef HYPRE_SStructGraphSetDomainGrid +#undef HYPRE_SStructGraphSetFEM +#undef HYPRE_SStructGraphSetFEMSparsity +#undef HYPRE_SStructGraphSetObjectType +#undef HYPRE_SStructGraphSetStencil +#undef HYPRE_SStructGridAddVariables +#undef HYPRE_SStructGridAssemble +#undef HYPRE_SStructGridCoarsen +#undef HYPRE_SStructGridCreate +#undef HYPRE_SStructGridDestroy +#undef HYPRE_SStructGridGetVariableBox +#undef HYPRE_SStructGridPrintGLVis +#undef HYPRE_SStructGridProjectBox +#undef HYPRE_SStructGridSetExtents +#undef HYPRE_SStructGridSetFEMOrdering +#undef HYPRE_SStructGridSetNeighborPart +#undef HYPRE_SStructGridSetNumGhost +#undef HYPRE_SStructGridSetPeriodic +#undef HYPRE_SStructGridSetSharedPart +#undef HYPRE_SStructGridSetVariables +#undef HYPRE_SStructInnerProd +#undef HYPRE_SStructMatrixAddFEMBoxValues +#undef HYPRE_SStructMatrixAddFEMValues +#undef HYPRE_SStructMatrixAddToBoxValues +#undef HYPRE_SStructMatrixAddToBoxValues2 +#undef HYPRE_SStructMatrixAddToValues +#undef HYPRE_SStructMatrixAssemble +#undef HYPRE_SStructMatrixCreate +#undef HYPRE_SStructMatrixDestroy +#undef HYPRE_SStructMatrixGetBoxValues +#undef HYPRE_SStructMatrixGetBoxValues2 +#undef HYPRE_SStructMatrixGetFEMValues +#undef HYPRE_SStructMatrixGetGrid +#undef HYPRE_SStructMatrixGetObject +#undef HYPRE_SStructMatrixGetValues +#undef HYPRE_SStructMatrixInitialize +#undef HYPRE_SStructMatrixMatmat +#undef HYPRE_SStructMatrixMatvec +#undef HYPRE_SStructMatrixPrint +#undef HYPRE_SStructMatrixRead +#undef HYPRE_SStructMatrixSetBoxValues +#undef HYPRE_SStructMatrixSetBoxValues2 +#undef HYPRE_SStructMatrixSetConstantEntries +#undef HYPRE_SStructMatrixSetDomainStride +#undef HYPRE_SStructMatrixSetEarlyAssemble +#undef HYPRE_SStructMatrixSetNSSymmetric +#undef HYPRE_SStructMatrixSetObjectType +#undef HYPRE_SStructMatrixSetRangeStride +#undef HYPRE_SStructMatrixSetSymmetric +#undef HYPRE_SStructMatrixSetValues +#undef HYPRE_SStructMatrixToIJMatrix +#undef HYPRE_SStructStencilCreate +#undef HYPRE_SStructStencilDestroy +#undef HYPRE_SStructStencilPrint +#undef HYPRE_SStructStencilRead +#undef HYPRE_SStructStencilSetEntry +#undef HYPRE_SStructVectorAddFEMBoxValues +#undef HYPRE_SStructVectorAddFEMValues +#undef HYPRE_SStructVectorAddToBoxValues +#undef HYPRE_SStructVectorAddToBoxValues2 +#undef HYPRE_SStructVectorAddToValues +#undef HYPRE_SStructVectorAssemble +#undef HYPRE_SStructVectorAxpy +#undef HYPRE_SStructVectorCopy +#undef HYPRE_SStructVectorCreate +#undef HYPRE_SStructVectorDestroy +#undef HYPRE_SStructVectorGather +#undef HYPRE_SStructVectorGetBoxValues +#undef HYPRE_SStructVectorGetBoxValues2 +#undef HYPRE_SStructVectorGetFEMValues +#undef HYPRE_SStructVectorGetObject +#undef HYPRE_SStructVectorGetValues +#undef HYPRE_SStructVectorInitialize +#undef HYPRE_SStructVectorInnerProd +#undef HYPRE_SStructVectorPrint +#undef HYPRE_SStructVectorPrintGLVis +#undef HYPRE_SStructVectorRead +#undef HYPRE_SStructVectorScale +#undef HYPRE_SStructVectorSetBoxValues +#undef HYPRE_SStructVectorSetBoxValues2 +#undef HYPRE_SStructVectorSetConstantValues +#undef HYPRE_SStructVectorSetObjectType +#undef HYPRE_SStructVectorSetRandomValues +#undef HYPRE_SStructVectorSetValues +#undef hypre_SStructAxpy +#undef hypre_SStructBoxManEntryGetBoxnum +#undef hypre_SStructBoxManEntryGetCSRstrides +#undef hypre_SStructBoxManEntryGetGhstrides +#undef hypre_SStructBoxManEntryGetGlobalCSRank +#undef hypre_SStructBoxManEntryGetGlobalGhrank +#undef hypre_SStructBoxManEntryGetGlobalRank +#undef hypre_SStructBoxManEntryGetPart +#undef hypre_SStructBoxManEntryGetProcess +#undef hypre_SStructBoxManEntryGetStrides +#undef hypre_SStructBoxNumMap +#undef hypre_SStructBoxToNborBox +#undef hypre_SStructCellBoxToVarBox +#undef hypre_SStructCellGridBoxNumMap +#undef hypre_SStructCopy +#undef hypre_SStructGraphFindBoxEndpt +#undef hypre_SStructGraphFindSGridEndpts +#undef hypre_SStructGraphGetUVEntryRank +#undef hypre_SStructGraphRef +#undef hypre_SStructGridAssembleBoxManagers +#undef hypre_SStructGridAssembleNborBoxManagers +#undef hypre_SStructGridBoxProcFindBoxManEntry +#undef hypre_SStructGridCoarsen +#undef hypre_SStructGridComputeGlobalSizes +#undef hypre_SStructGridCreateCommInfo +#undef hypre_SStructGridFindBoxManEntry +#undef hypre_SStructGridFindNborBoxManEntry +#undef hypre_SStructGridGetMaxBoxSize +#undef hypre_SStructGridIntersect +#undef hypre_SStructGridPrint +#undef hypre_SStructGridPrintGLVis +#undef hypre_SStructGridRead +#undef hypre_SStructGridRef +#undef hypre_SStructGridSetActiveParts +#undef hypre_SStructGridSetAllPartsActive +#undef hypre_SStructGridSetNumGhost +#undef hypre_SStructIndexToNborIndex +#undef hypre_SStructInnerProd +#undef hypre_SStructMatmat +#undef hypre_SStructMatmult +#undef hypre_SStructMatmultCommunicate +#undef hypre_SStructMatmultCompute +#undef hypre_SStructMatmultComputeS +#undef hypre_SStructMatmultComputeU +#undef hypre_SStructMatmultCreate +#undef hypre_SStructMatmultDestroy +#undef hypre_SStructMatmultInitialize +#undef hypre_SStructMatrixBoxesToUMatrix +#undef hypre_SStructMatrixCompressUToS +#undef hypre_SStructMatrixComputeL1Norms +#undef hypre_SStructMatrixComputeRowSum +#undef hypre_SStructMatrixGetDiagonal +#undef hypre_SStructMatrixHaloToUMatrix +#undef hypre_SStructMatrixMapDataBox +#undef hypre_SStructMatrixMemoryLocation +#undef hypre_SStructMatrixPtAP +#undef hypre_SStructMatrixRAP +#undef hypre_SStructMatrixRTtAP +#undef hypre_SStructMatrixRef +#undef hypre_SStructMatrixSetBoxValues +#undef hypre_SStructMatrixSetInterPartValues +#undef hypre_SStructMatrixSetValues +#undef hypre_SStructMatrixSplitEntries +#undef hypre_SStructMatrixToUMatrix +#undef hypre_SStructMatvec +#undef hypre_SStructMatvecCompute +#undef hypre_SStructMatvecCreate +#undef hypre_SStructMatvecDestroy +#undef hypre_SStructMatvecSetTranspose +#undef hypre_SStructMatvecSetup +#undef hypre_SStructNborBoxToBox +#undef hypre_SStructNborIndexToIndex +#undef hypre_SStructPAxpy +#undef hypre_SStructPCopy +#undef hypre_SStructPGridAssemble +#undef hypre_SStructPGridCreate +#undef hypre_SStructPGridDestroy +#undef hypre_SStructPGridGetMaxBoxSize +#undef hypre_SStructPGridRef +#undef hypre_SStructPGridSetCellSGrid +#undef hypre_SStructPGridSetExtents +#undef hypre_SStructPGridSetPNeighbor +#undef hypre_SStructPGridSetSGrid +#undef hypre_SStructPGridSetVariables +#undef hypre_SStructPInnerProd +#undef hypre_SStructPInnerProdLocal +#undef hypre_SStructPMatmat +#undef hypre_SStructPMatmult +#undef hypre_SStructPMatmultCommSetup +#undef hypre_SStructPMatmultCommunicate +#undef hypre_SStructPMatmultCompute +#undef hypre_SStructPMatmultCreate +#undef hypre_SStructPMatmultDestroy +#undef hypre_SStructPMatmultInitialize +#undef hypre_SStructPMatrixAccumulate +#undef hypre_SStructPMatrixAssemble +#undef hypre_SStructPMatrixComputeRowSum +#undef hypre_SStructPMatrixCreate +#undef hypre_SStructPMatrixDestroy +#undef hypre_SStructPMatrixGetDiagonal +#undef hypre_SStructPMatrixInitialize +#undef hypre_SStructPMatrixPrint +#undef hypre_SStructPMatrixPtAP +#undef hypre_SStructPMatrixRAP +#undef hypre_SStructPMatrixRTtAP +#undef hypre_SStructPMatrixRef +#undef hypre_SStructPMatrixSetBoxValues +#undef hypre_SStructPMatrixSetCEntries +#undef hypre_SStructPMatrixSetDomainStride +#undef hypre_SStructPMatrixSetRangeStride +#undef hypre_SStructPMatrixSetSymmetric +#undef hypre_SStructPMatrixSetTranspose +#undef hypre_SStructPMatrixSetValues +#undef hypre_SStructPMatvec +#undef hypre_SStructPMatvecCompute +#undef hypre_SStructPMatvecCreate +#undef hypre_SStructPMatvecDestroy +#undef hypre_SStructPMatvecSetTranspose +#undef hypre_SStructPMatvecSetup +#undef hypre_SStructPScale +#undef hypre_SStructPVectorAccumulate +#undef hypre_SStructPVectorAssemble +#undef hypre_SStructPVectorCreate +#undef hypre_SStructPVectorDestroy +#undef hypre_SStructPVectorGather +#undef hypre_SStructPVectorGetBoxValues +#undef hypre_SStructPVectorGetValues +#undef hypre_SStructPVectorInitialize +#undef hypre_SStructPVectorInitializeShell +#undef hypre_SStructPVectorPointwiseDivpy +#undef hypre_SStructPVectorPrint +#undef hypre_SStructPVectorRef +#undef hypre_SStructPVectorSetBoxValues +#undef hypre_SStructPVectorSetConstantValues +#undef hypre_SStructPVectorSetRandomValues +#undef hypre_SStructPVectorSetValues +#undef hypre_SStructPartialPCopy +#undef hypre_SStructScale +#undef hypre_SStructStencilRef +#undef hypre_SStructUMatrixAssemble +#undef hypre_SStructUMatrixInitialize +#undef hypre_SStructUMatrixSetBoxValues +#undef hypre_SStructUMatrixSetBoxValuesHelper +#undef hypre_SStructUMatrixSetValues +#undef hypre_SStructVarToNborVar +#undef hypre_SStructVariableGetOffset +#undef hypre_SStructVectorClearGhostValues +#undef hypre_SStructVectorConvert +#undef hypre_SStructVectorInitializeShell +#undef hypre_SStructVectorMemoryLocation +#undef hypre_SStructVectorParConvert +#undef hypre_SStructVectorParRestore +#undef hypre_SStructVectorPointwiseDivision +#undef hypre_SStructVectorPointwiseDivpy +#undef hypre_SStructVectorPointwiseInverse +#undef hypre_SStructVectorPointwiseProduct +#undef hypre_SStructVectorPrintGLVis +#undef hypre_SStructVectorRef +#undef hypre_SStructVectorRestore +#undef hypre_SStructVectorSetConstantValues +#undef hypre_SStructVectorSetRandomValues +#undef hypre_sstructaxpy +#undef hypre_sstructgraphaddentries +#undef hypre_sstructgraphassemble +#undef hypre_sstructgraphcreate +#undef hypre_sstructgraphdestroy +#undef hypre_sstructgraphsetdomaingrid +#undef hypre_sstructgraphsetfem +#undef hypre_sstructgraphsetfemsparsity +#undef hypre_sstructgraphsetobjecttype +#undef hypre_sstructgraphsetstencil +#undef hypre_sstructgridaddvariables +#undef hypre_sstructgridassemble +#undef hypre_sstructgridcreate +#undef hypre_sstructgriddestroy +#undef hypre_sstructgridsetextents +#undef hypre_sstructgridsetfemordering +#undef hypre_sstructgridsetneighborpart +#undef hypre_sstructgridsetnumghost +#undef hypre_sstructgridsetperiodic +#undef hypre_sstructgridsetsharedpart +#undef hypre_sstructgridsetvariables +#undef hypre_sstructinnerprod +#undef hypre_sstructmatrixaddfemvalues +#undef hypre_sstructmatrixaddtoboxvalu +#undef hypre_sstructmatrixaddtovalues +#undef hypre_sstructmatrixassemble +#undef hypre_sstructmatrixcreate +#undef hypre_sstructmatrixdestroy +#undef hypre_sstructmatrixgetboxvalues +#undef hypre_sstructmatrixgetobject +#undef hypre_sstructmatrixgetvalues +#undef hypre_sstructmatrixinitialize +#undef hypre_sstructmatrixmatvec +#undef hypre_sstructmatrixprint +#undef hypre_sstructmatrixsetboxvalues +#undef hypre_sstructmatrixsetnssymmetr +#undef hypre_sstructmatrixsetobjecttyp +#undef hypre_sstructmatrixsetsymmetric +#undef hypre_sstructmatrixsetvalues +#undef hypre_sstructstencilcreate +#undef hypre_sstructstencildestroy +#undef hypre_sstructstencilsetentry +#undef hypre_sstructvectoraddtoboxvalu +#undef hypre_sstructvectoraddtovalues +#undef hypre_sstructvectorassemble +#undef hypre_sstructvectoraxpy +#undef hypre_sstructvectorcopy +#undef hypre_sstructvectorcreate +#undef hypre_sstructvectordestroy +#undef hypre_sstructvectorgather +#undef hypre_sstructvectorgetboxvalues +#undef hypre_sstructvectorgetobject +#undef hypre_sstructvectorgetvalues +#undef hypre_sstructvectorinitialize +#undef hypre_sstructvectorinnerprod +#undef hypre_sstructvectorprint +#undef hypre_sstructvectorscale +#undef hypre_sstructvectorsetboxvalues +#undef hypre_sstructvectorsetconstantv +#undef hypre_sstructvectorsetobjecttyp +#undef hypre_sstructvectorsetvalues diff --git a/src/sstruct_mv/headers b/src/sstruct_mv/headers index 9e07536f97..ee78e1cd0d 100755 --- a/src/sstruct_mv/headers +++ b/src/sstruct_mv/headers @@ -27,6 +27,10 @@ cat > $INTERNAL_HEADER <<@ #include "_hypre_struct_mv.h" #include "_hypre_IJ_mv.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_sstruct_mv_mup_def.h" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -43,6 +47,7 @@ cat sstruct_stencil.h >> $INTERNAL_HEADER cat sstruct_graph.h >> $INTERNAL_HEADER cat sstruct_matrix.h >> $INTERNAL_HEADER cat sstruct_vector.h >> $INTERNAL_HEADER +cat sstruct_matmult.h >> $INTERNAL_HEADER cat protos.h >> $INTERNAL_HEADER @@ -56,6 +61,17 @@ cat >> $INTERNAL_HEADER <<@ } #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_sstruct_mv_mup_undef.h" +#include "_hypre_sstruct_mv_mup.h" +#endif +#endif + #endif @ diff --git a/src/sstruct_mv/mup.fixed b/src/sstruct_mv/mup.fixed new file mode 100644 index 0000000000..f0a4526b10 --- /dev/null +++ b/src/sstruct_mv/mup.fixed @@ -0,0 +1,222 @@ +hypre_SStructAxpy +hypre_SStructBoxManEntryGetBoxnum +hypre_SStructBoxManEntryGetCSRstrides +hypre_SStructBoxManEntryGetGhstrides +hypre_SStructBoxManEntryGetGlobalCSRank +hypre_SStructBoxManEntryGetGlobalGhrank +hypre_SStructBoxManEntryGetGlobalRank +hypre_SStructBoxManEntryGetPart +hypre_SStructBoxManEntryGetProcess +hypre_SStructBoxManEntryGetStrides +hypre_SStructBoxNumMap +hypre_SStructBoxToNborBox +hypre_SStructCellBoxToVarBox +hypre_SStructCellGridBoxNumMap +hypre_SStructCopy +hypre_SStructGraphFindBoxEndpt +hypre_SStructGraphFindSGridEndpts +hypre_SStructGraphGetUVEntryRank +hypre_SStructGraphRef +hypre_SStructGridAssembleBoxManagers +hypre_SStructGridAssembleNborBoxManagers +hypre_SStructGridBoxProcFindBoxManEntry +hypre_SStructGridCoarsen +hypre_SStructGridComputeGlobalSizes +hypre_SStructGridCreateCommInfo +hypre_SStructGridFindBoxManEntry +hypre_SStructGridFindNborBoxManEntry +hypre_SStructGridGetMaxBoxSize +hypre_SStructGridIntersect +hypre_SStructGridPrint +hypre_SStructGridPrintGLVis +hypre_SStructGridRead +hypre_SStructGridRef +hypre_SStructGridSetActiveParts +hypre_SStructGridSetAllPartsActive +hypre_SStructGridSetNumGhost +hypre_SStructIndexToNborIndex +hypre_SStructInnerProd +hypre_SStructMatmat +hypre_SStructMatmult +hypre_SStructMatmultCommunicate +hypre_SStructMatmultCompute +hypre_SStructMatmultComputeS +hypre_SStructMatmultComputeU +hypre_SStructMatmultCreate +hypre_SStructMatmultDestroy +hypre_SStructMatmultInitialize +hypre_SStructMatrixBoxesToUMatrix +hypre_SStructMatrixCompressUToS +hypre_SStructMatrixComputeL1Norms +hypre_SStructMatrixComputeRowSum +hypre_SStructMatrixGetDiagonal +hypre_SStructMatrixHaloToUMatrix +hypre_SStructMatrixMapDataBox +hypre_SStructMatrixMemoryLocation +hypre_SStructMatrixPtAP +hypre_SStructMatrixRAP +hypre_SStructMatrixRTtAP +hypre_SStructMatrixRef +hypre_SStructMatrixSetBoxValues +hypre_SStructMatrixSetInterPartValues +hypre_SStructMatrixSetValues +hypre_SStructMatrixSplitEntries +hypre_SStructMatrixToUMatrix +hypre_SStructMatvec +hypre_SStructMatvecCompute +hypre_SStructMatvecCreate +hypre_SStructMatvecDestroy +hypre_SStructMatvecSetTranspose +hypre_SStructMatvecSetup +hypre_SStructNborBoxToBox +hypre_SStructNborIndexToIndex +hypre_SStructPAxpy +hypre_SStructPCopy +hypre_SStructPGridAssemble +hypre_SStructPGridCreate +hypre_SStructPGridDestroy +hypre_SStructPGridGetMaxBoxSize +hypre_SStructPGridRef +hypre_SStructPGridSetCellSGrid +hypre_SStructPGridSetExtents +hypre_SStructPGridSetPNeighbor +hypre_SStructPGridSetSGrid +hypre_SStructPGridSetVariables +hypre_SStructPInnerProd +hypre_SStructPInnerProdLocal +hypre_SStructPMatmat +hypre_SStructPMatmult +hypre_SStructPMatmultCommSetup +hypre_SStructPMatmultCommunicate +hypre_SStructPMatmultCompute +hypre_SStructPMatmultCreate +hypre_SStructPMatmultDestroy +hypre_SStructPMatmultInitialize +hypre_SStructPMatrixAccumulate +hypre_SStructPMatrixAssemble +hypre_SStructPMatrixComputeRowSum +hypre_SStructPMatrixCreate +hypre_SStructPMatrixDestroy +hypre_SStructPMatrixGetDiagonal +hypre_SStructPMatrixInitialize +hypre_SStructPMatrixPrint +hypre_SStructPMatrixPtAP +hypre_SStructPMatrixRAP +hypre_SStructPMatrixRTtAP +hypre_SStructPMatrixRef +hypre_SStructPMatrixSetBoxValues +hypre_SStructPMatrixSetCEntries +hypre_SStructPMatrixSetDomainStride +hypre_SStructPMatrixSetRangeStride +hypre_SStructPMatrixSetSymmetric +hypre_SStructPMatrixSetTranspose +hypre_SStructPMatrixSetValues +hypre_SStructPMatvec +hypre_SStructPMatvecCompute +hypre_SStructPMatvecCreate +hypre_SStructPMatvecDestroy +hypre_SStructPMatvecSetTranspose +hypre_SStructPMatvecSetup +hypre_SStructPScale +hypre_SStructPVectorAccumulate +hypre_SStructPVectorAssemble +hypre_SStructPVectorCreate +hypre_SStructPVectorDestroy +hypre_SStructPVectorGather +hypre_SStructPVectorGetBoxValues +hypre_SStructPVectorGetValues +hypre_SStructPVectorInitialize +hypre_SStructPVectorInitializeShell +hypre_SStructPVectorPointwiseDivpy +hypre_SStructPVectorPrint +hypre_SStructPVectorRef +hypre_SStructPVectorSetBoxValues +hypre_SStructPVectorSetConstantValues +hypre_SStructPVectorSetRandomValues +hypre_SStructPVectorSetValues +hypre_SStructPartialPCopy +hypre_SStructScale +hypre_SStructStencilRef +hypre_SStructUMatrixAssemble +hypre_SStructUMatrixInitialize +hypre_SStructUMatrixSetBoxValues +hypre_SStructUMatrixSetBoxValuesHelper +hypre_SStructUMatrixSetValues +hypre_SStructVarToNborVar +hypre_SStructVariableGetOffset +hypre_SStructVectorClearGhostValues +hypre_SStructVectorConvert +hypre_SStructVectorInitializeShell +hypre_SStructVectorMemoryLocation +hypre_SStructVectorParConvert +hypre_SStructVectorParRestore +hypre_SStructVectorPointwiseDivision +hypre_SStructVectorPointwiseDivpy +hypre_SStructVectorPointwiseInverse +hypre_SStructVectorPointwiseProduct +hypre_SStructVectorPrintGLVis +hypre_SStructVectorRef +hypre_SStructVectorRestore +hypre_SStructVectorSetConstantValues +hypre_SStructVectorSetRandomValues +hypre_sstructaxpy +hypre_sstructgraphaddentries +hypre_sstructgraphassemble +hypre_sstructgraphcreate +hypre_sstructgraphdestroy +hypre_sstructgraphsetdomaingrid +hypre_sstructgraphsetfem +hypre_sstructgraphsetfemsparsity +hypre_sstructgraphsetobjecttype +hypre_sstructgraphsetstencil +hypre_sstructgridaddvariables +hypre_sstructgridassemble +hypre_sstructgridcreate +hypre_sstructgriddestroy +hypre_sstructgridsetextents +hypre_sstructgridsetfemordering +hypre_sstructgridsetneighborpart +hypre_sstructgridsetnumghost +hypre_sstructgridsetperiodic +hypre_sstructgridsetsharedpart +hypre_sstructgridsetvariables +hypre_sstructinnerprod +hypre_sstructmatrixaddfemvalues +hypre_sstructmatrixaddtoboxvalu +hypre_sstructmatrixaddtovalues +hypre_sstructmatrixassemble +hypre_sstructmatrixcreate +hypre_sstructmatrixdestroy +hypre_sstructmatrixgetboxvalues +hypre_sstructmatrixgetobject +hypre_sstructmatrixgetvalues +hypre_sstructmatrixinitialize +hypre_sstructmatrixmatvec +hypre_sstructmatrixprint +hypre_sstructmatrixsetboxvalues +hypre_sstructmatrixsetnssymmetr +hypre_sstructmatrixsetobjecttyp +hypre_sstructmatrixsetsymmetric +hypre_sstructmatrixsetvalues +hypre_sstructstencilcreate +hypre_sstructstencildestroy +hypre_sstructstencilsetentry +hypre_sstructvectoraddtoboxvalu +hypre_sstructvectoraddtovalues +hypre_sstructvectorassemble +hypre_sstructvectoraxpy +hypre_sstructvectorcopy +hypre_sstructvectorcreate +hypre_sstructvectordestroy +hypre_sstructvectorgather +hypre_sstructvectorgetboxvalues +hypre_sstructvectorgetobject +hypre_sstructvectorgetvalues +hypre_sstructvectorinitialize +hypre_sstructvectorinnerprod +hypre_sstructvectorprint +hypre_sstructvectorscale +hypre_sstructvectorsetboxvalues +hypre_sstructvectorsetconstantv +hypre_sstructvectorsetobjecttyp +hypre_sstructvectorsetvalues diff --git a/src/sstruct_mv/mup.functions b/src/sstruct_mv/mup.functions new file mode 100644 index 0000000000..86c8d5a8a5 --- /dev/null +++ b/src/sstruct_mv/mup.functions @@ -0,0 +1,91 @@ +HYPRE_SStructAxpy +HYPRE_SStructGraphAddEntries +HYPRE_SStructGraphAssemble +HYPRE_SStructGraphCreate +HYPRE_SStructGraphDestroy +HYPRE_SStructGraphPrint +HYPRE_SStructGraphRead +HYPRE_SStructGraphSetDomainGrid +HYPRE_SStructGraphSetFEM +HYPRE_SStructGraphSetFEMSparsity +HYPRE_SStructGraphSetObjectType +HYPRE_SStructGraphSetStencil +HYPRE_SStructGridAddVariables +HYPRE_SStructGridAssemble +HYPRE_SStructGridCoarsen +HYPRE_SStructGridCreate +HYPRE_SStructGridDestroy +HYPRE_SStructGridGetVariableBox +HYPRE_SStructGridPrintGLVis +HYPRE_SStructGridProjectBox +HYPRE_SStructGridSetExtents +HYPRE_SStructGridSetFEMOrdering +HYPRE_SStructGridSetNeighborPart +HYPRE_SStructGridSetNumGhost +HYPRE_SStructGridSetPeriodic +HYPRE_SStructGridSetSharedPart +HYPRE_SStructGridSetVariables +HYPRE_SStructInnerProd +HYPRE_SStructMatrixAddFEMBoxValues +HYPRE_SStructMatrixAddFEMValues +HYPRE_SStructMatrixAddToBoxValues +HYPRE_SStructMatrixAddToBoxValues2 +HYPRE_SStructMatrixAddToValues +HYPRE_SStructMatrixAssemble +HYPRE_SStructMatrixCreate +HYPRE_SStructMatrixDestroy +HYPRE_SStructMatrixGetBoxValues +HYPRE_SStructMatrixGetBoxValues2 +HYPRE_SStructMatrixGetFEMValues +HYPRE_SStructMatrixGetGrid +HYPRE_SStructMatrixGetObject +HYPRE_SStructMatrixGetValues +HYPRE_SStructMatrixInitialize +HYPRE_SStructMatrixMatmat +HYPRE_SStructMatrixMatvec +HYPRE_SStructMatrixPrint +HYPRE_SStructMatrixRead +HYPRE_SStructMatrixSetBoxValues +HYPRE_SStructMatrixSetBoxValues2 +HYPRE_SStructMatrixSetConstantEntries +HYPRE_SStructMatrixSetDomainStride +HYPRE_SStructMatrixSetEarlyAssemble +HYPRE_SStructMatrixSetNSSymmetric +HYPRE_SStructMatrixSetObjectType +HYPRE_SStructMatrixSetRangeStride +HYPRE_SStructMatrixSetSymmetric +HYPRE_SStructMatrixSetValues +HYPRE_SStructMatrixToIJMatrix +HYPRE_SStructStencilCreate +HYPRE_SStructStencilDestroy +HYPRE_SStructStencilPrint +HYPRE_SStructStencilRead +HYPRE_SStructStencilSetEntry +HYPRE_SStructVectorAddFEMBoxValues +HYPRE_SStructVectorAddFEMValues +HYPRE_SStructVectorAddToBoxValues +HYPRE_SStructVectorAddToBoxValues2 +HYPRE_SStructVectorAddToValues +HYPRE_SStructVectorAssemble +HYPRE_SStructVectorAxpy +HYPRE_SStructVectorCopy +HYPRE_SStructVectorCreate +HYPRE_SStructVectorDestroy +HYPRE_SStructVectorGather +HYPRE_SStructVectorGetBoxValues +HYPRE_SStructVectorGetBoxValues2 +HYPRE_SStructVectorGetFEMValues +HYPRE_SStructVectorGetObject +HYPRE_SStructVectorGetValues +HYPRE_SStructVectorInitialize +HYPRE_SStructVectorInnerProd +HYPRE_SStructVectorPrint +HYPRE_SStructVectorPrintGLVis +HYPRE_SStructVectorRead +HYPRE_SStructVectorScale +HYPRE_SStructVectorSetBoxValues +HYPRE_SStructVectorSetBoxValues2 +HYPRE_SStructVectorSetConstantValues +HYPRE_SStructVectorSetObjectType +HYPRE_SStructVectorSetRandomValues +HYPRE_SStructVectorSetValues diff --git a/src/sstruct_mv/mup.methods b/src/sstruct_mv/mup.methods new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/sstruct_mv/mup_code b/src/sstruct_mv/mup_code new file mode 100755 index 0000000000..f6336ac3f1 --- /dev/null +++ b/src/sstruct_mv/mup_code @@ -0,0 +1,7 @@ +#!/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) + +../config/gen_code.sh HYPRE_sstruct_mv.h _hypre_sstruct_mv.h mup diff --git a/src/sstruct_mv/mup_fixed.c b/src/sstruct_mv/mup_fixed.c new file mode 100644 index 0000000000..23156d2640 --- /dev/null +++ b/src/sstruct_mv/mup_fixed.c @@ -0,0 +1,1307 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_sstruct_mv.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +hypre_SStructAxpy( HYPRE_Complex alpha, hypre_SStructVector *x, hypre_SStructVector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructAxpy)( alpha, x, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructBoxManEntryGetBoxnum( hypre_BoxManEntry *entry, HYPRE_Int *id_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructBoxManEntryGetBoxnum)( entry, id_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructBoxManEntryGetCSRstrides( hypre_BoxManEntry *entry, hypre_Index strides ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructBoxManEntryGetCSRstrides)( entry, strides ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructBoxManEntryGetGhstrides( hypre_BoxManEntry *entry, hypre_Index strides ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructBoxManEntryGetGhstrides)( entry, strides ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructBoxManEntryGetGlobalCSRank( hypre_BoxManEntry *entry, hypre_Index index, HYPRE_BigInt *rank_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructBoxManEntryGetGlobalCSRank)( entry, index, rank_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructBoxManEntryGetGlobalGhrank( hypre_BoxManEntry *entry, hypre_Index index, HYPRE_BigInt *rank_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructBoxManEntryGetGlobalGhrank)( entry, index, rank_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructBoxManEntryGetGlobalRank( hypre_BoxManEntry *entry, hypre_Index index, HYPRE_BigInt *rank_ptr, HYPRE_Int type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructBoxManEntryGetGlobalRank)( entry, index, rank_ptr, type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructBoxManEntryGetPart( hypre_BoxManEntry *entry, HYPRE_Int part, HYPRE_Int *part_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructBoxManEntryGetPart)( entry, part, part_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructBoxManEntryGetProcess( hypre_BoxManEntry *entry, HYPRE_Int *proc_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructBoxManEntryGetProcess)( entry, proc_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructBoxManEntryGetStrides( hypre_BoxManEntry *entry, hypre_Index strides, HYPRE_Int type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructBoxManEntryGetStrides)( entry, strides, type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructBoxNumMap( hypre_SStructGrid *grid, HYPRE_Int part, HYPRE_Int boxnum, HYPRE_Int **num_varboxes_ptr, HYPRE_Int ***map_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructBoxNumMap)( grid, part, boxnum, num_varboxes_ptr, map_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructBoxToNborBox( hypre_Box *box, hypre_Index root, hypre_Index nbor_root, hypre_Index coord, hypre_Index dir ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructBoxToNborBox)( box, root, nbor_root, coord, dir ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructCellBoxToVarBox( hypre_Box *box, hypre_Index offset, hypre_Index varoffset, HYPRE_Int *valid ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructCellBoxToVarBox)( box, offset, varoffset, valid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructCellGridBoxNumMap( hypre_SStructGrid *grid, HYPRE_Int part, HYPRE_Int ***num_varboxes_ptr, HYPRE_Int ****map_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructCellGridBoxNumMap)( grid, part, num_varboxes_ptr, map_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructCopy( hypre_SStructVector *x, hypre_SStructVector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructCopy)( x, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_BigInt +hypre_SStructGraphFindBoxEndpt( hypre_SStructGraph *graph, HYPRE_Int part, HYPRE_Int var, HYPRE_Int proc, HYPRE_Int endpt, HYPRE_Int boxi ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructGraphFindBoxEndpt)( graph, part, var, proc, endpt, boxi ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructGraphFindSGridEndpts( hypre_SStructGraph *graph, HYPRE_Int part, HYPRE_Int var, HYPRE_Int proc, HYPRE_Int endpt, HYPRE_BigInt *endpts ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructGraphFindSGridEndpts)( graph, part, var, proc, endpt, endpts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructGraphGetUVEntryRank( hypre_SStructGraph *graph, HYPRE_Int part, HYPRE_Int var, hypre_Index index, HYPRE_BigInt *rank ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructGraphGetUVEntryRank)( graph, part, var, index, rank ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructGraphRef( hypre_SStructGraph *graph, hypre_SStructGraph **graph_ref ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructGraphRef)( graph, graph_ref ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructGridAssembleBoxManagers( hypre_SStructGrid *grid ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructGridAssembleBoxManagers)( grid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructGridAssembleNborBoxManagers( hypre_SStructGrid *grid ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructGridAssembleNborBoxManagers)( grid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructGridBoxProcFindBoxManEntry( hypre_SStructGrid *grid, HYPRE_Int part, HYPRE_Int var, HYPRE_Int box, HYPRE_Int proc, hypre_BoxManEntry **entry_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructGridBoxProcFindBoxManEntry)( grid, part, var, box, proc, entry_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructGridCoarsen( hypre_SStructGrid *fgrid, hypre_IndexRef origin, hypre_Index *strides, hypre_Index *periodic, hypre_SStructGrid **cgrid_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructGridCoarsen)( fgrid, origin, strides, periodic, cgrid_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructGridComputeGlobalSizes( hypre_SStructGrid *grid ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructGridComputeGlobalSizes)( grid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructGridCreateCommInfo( hypre_SStructGrid *grid ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructGridCreateCommInfo)( grid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructGridFindBoxManEntry( hypre_SStructGrid *grid, HYPRE_Int part, hypre_Index index, HYPRE_Int var, hypre_BoxManEntry **entry_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructGridFindBoxManEntry)( grid, part, index, var, entry_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructGridFindNborBoxManEntry( hypre_SStructGrid *grid, HYPRE_Int part, hypre_Index index, HYPRE_Int var, hypre_BoxManEntry **entry_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructGridFindNborBoxManEntry)( grid, part, index, var, entry_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructGridGetMaxBoxSize( hypre_SStructGrid *grid ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructGridGetMaxBoxSize)( grid ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructGridIntersect)( grid, part, var, box, action, entries_ptr, nentries_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructGridPrint( FILE *file, hypre_SStructGrid *grid ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructGridPrint)( file, grid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructGridPrintGLVis( hypre_SStructGrid *grid, const char *meshprefix, HYPRE_Real *trans, HYPRE_Real *origin ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructGridPrintGLVis)( grid, meshprefix, trans, origin ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructGridRead( MPI_Comm comm, FILE *file, hypre_SStructGrid **grid_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructGridRead)( comm, file, grid_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructGridRef( hypre_SStructGrid *grid, hypre_SStructGrid **grid_ref ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructGridRef)( grid, grid_ref ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructGridSetActiveParts( hypre_SStructGrid *grid, HYPRE_Int *active ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructGridSetActiveParts)( grid, active ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructGridSetAllPartsActive( hypre_SStructGrid *grid ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructGridSetAllPartsActive)( grid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructGridSetNumGhost( hypre_SStructGrid *grid, HYPRE_Int *num_ghost ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructGridSetNumGhost)( grid, num_ghost ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructIndexToNborIndex)( index, root, nbor_root, coord, dir, ndim, nbor_index ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructInnerProd( hypre_SStructVector *x, hypre_SStructVector *y, HYPRE_Real *result_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructInnerProd)( x, y, result_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatmat( hypre_SStructMatrix *A, hypre_SStructMatrix *B, hypre_SStructMatrix **M_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatmat)( A, B, M_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatmult( HYPRE_Int nmatrices, hypre_SStructMatrix **matrices, HYPRE_Int nterms, HYPRE_Int *terms, HYPRE_Int *trans, hypre_SStructMatrix **M_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatmult)( nmatrices, matrices, nterms, terms, trans, M_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatmultCommunicate( hypre_SStructMatmultData *mmdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatmultCommunicate)( mmdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatmultCompute( hypre_SStructMatmultData *mmdata, hypre_SStructMatrix *M ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatmultCompute)( mmdata, M ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatmultComputeS( hypre_SStructMatmultData *mmdata, hypre_SStructMatrix *M ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatmultComputeS)( mmdata, M ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatmultComputeU( hypre_SStructMatmultData *mmdata, hypre_SStructMatrix *M ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatmultComputeU)( mmdata, M ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatmultCreate( HYPRE_Int nmatrices_input, hypre_SStructMatrix **matrices_input, HYPRE_Int nterms, HYPRE_Int *terms_input, HYPRE_Int *trans_input, hypre_SStructMatmultData **mmdata_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatmultCreate)( nmatrices_input, matrices_input, nterms, terms_input, trans_input, mmdata_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatmultDestroy( hypre_SStructMatmultData *mmdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatmultDestroy)( mmdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatmultInitialize( hypre_SStructMatmultData *mmdata, hypre_SStructMatrix **M_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatmultInitialize)( mmdata, M_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatrixBoxesToUMatrix( hypre_SStructMatrix *A, hypre_SStructGrid *grid, hypre_IJMatrix **ij_Ahat_ptr, hypre_BoxArray ***convert_boxa ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatrixBoxesToUMatrix)( A, grid, ij_Ahat_ptr, convert_boxa ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatrixCompressUToS( HYPRE_SStructMatrix matrix, HYPRE_Int action ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatrixCompressUToS)( matrix, action ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatrixComputeL1Norms( hypre_SStructMatrix *A, HYPRE_Int option, hypre_SStructVector **l1_norms_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatrixComputeL1Norms)( A, option, l1_norms_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatrixComputeRowSum( hypre_SStructMatrix *A, HYPRE_Int type, hypre_SStructVector **rowsum_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatrixComputeRowSum)( A, type, rowsum_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatrixGetDiagonal( hypre_SStructMatrix *matrix, hypre_SStructVector **diag_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatrixGetDiagonal)( matrix, diag_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatrixHaloToUMatrix( hypre_SStructMatrix *A, hypre_SStructGrid *grid, hypre_IJMatrix **ij_Ahat_ptr, HYPRE_Int halo_size ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatrixHaloToUMatrix)( A, grid, ij_Ahat_ptr, halo_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatrixMapDataBox( hypre_SStructMatrix *matrix, HYPRE_Int part, HYPRE_Int vi, HYPRE_Int vj, hypre_Box *map_vbox ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatrixMapDataBox)( matrix, part, vi, vj, map_vbox ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_MemoryLocation +hypre_SStructMatrixMemoryLocation( hypre_SStructMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatrixMemoryLocation)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatrixPtAP( hypre_SStructMatrix *A, hypre_SStructMatrix *P, hypre_SStructMatrix **M_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatrixPtAP)( A, P, M_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatrixRAP( hypre_SStructMatrix *R, hypre_SStructMatrix *A, hypre_SStructMatrix *P, hypre_SStructMatrix **M_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatrixRAP)( R, A, P, M_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatrixRTtAP( hypre_SStructMatrix *RT, hypre_SStructMatrix *A, hypre_SStructMatrix *P, hypre_SStructMatrix **M_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatrixRTtAP)( RT, A, P, M_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatrixRef( hypre_SStructMatrix *matrix, hypre_SStructMatrix **matrix_ref ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatrixRef)( matrix, matrix_ref ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatrixSetBoxValues)( matrix, part, set_box, var, nentries, entries, value_box, values, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatrixSetInterPartValues)( matrix, part, set_box, var, nentries, entries, value_box, values, action ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatrixSetValues)( matrix, part, index, var, nentries, entries, values, action ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatrixSplitEntries)( matrix, part, var, nentries, entries, nSentries_ptr, Sentries_ptr, nUentries_ptr, Uentries_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_IJMatrix* +hypre_SStructMatrixToUMatrix( HYPRE_SStructMatrix matrix, HYPRE_Int fill_diagonal ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatrixToUMatrix)( matrix, fill_diagonal ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatvec( HYPRE_Complex alpha, hypre_SStructMatrix *A, hypre_SStructVector *x, HYPRE_Complex beta, hypre_SStructVector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatvec)( alpha, A, x, beta, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatvecCompute( void *matvec_vdata, HYPRE_Complex alpha, hypre_SStructMatrix *A, hypre_SStructVector *x, HYPRE_Complex beta, hypre_SStructVector *b, hypre_SStructVector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatvecCompute)( matvec_vdata, alpha, A, x, beta, b, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatvecCreate( void **matvec_vdata_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatvecCreate)( matvec_vdata_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatvecDestroy( void *matvec_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatvecDestroy)( matvec_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatvecSetTranspose( void *matvec_vdata, HYPRE_Int transpose ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatvecSetTranspose)( matvec_vdata, transpose ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatvecSetup( void *matvec_vdata, hypre_SStructMatrix *A, hypre_SStructVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructMatvecSetup)( matvec_vdata, A, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructNborBoxToBox( hypre_Box *nbor_box, hypre_Index root, hypre_Index nbor_root, hypre_Index coord, hypre_Index dir ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructNborBoxToBox)( nbor_box, root, nbor_root, coord, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructNborIndexToIndex)( nbor_index, root, nbor_root, coord, dir, ndim, index ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPAxpy( HYPRE_Complex alpha, hypre_SStructPVector *px, hypre_SStructPVector *py ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPAxpy)( alpha, px, py ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPCopy( hypre_SStructPVector *px, hypre_SStructPVector *py ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPCopy)( px, py ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPGridAssemble( hypre_SStructPGrid *pgrid ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPGridAssemble)( pgrid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPGridCreate( MPI_Comm comm, HYPRE_Int ndim, hypre_SStructPGrid **pgrid_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPGridCreate)( comm, ndim, pgrid_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPGridDestroy( hypre_SStructPGrid *pgrid ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPGridDestroy)( pgrid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPGridGetMaxBoxSize( hypre_SStructPGrid *pgrid ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPGridGetMaxBoxSize)( pgrid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPGridRef( hypre_SStructPGrid *pgrid, hypre_SStructPGrid **pgrid_ref ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPGridRef)( pgrid, pgrid_ref ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPGridSetCellSGrid( hypre_SStructPGrid *pgrid, hypre_StructGrid *cell_sgrid ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPGridSetCellSGrid)( pgrid, cell_sgrid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPGridSetExtents( hypre_SStructPGrid *pgrid, hypre_Index ilower, hypre_Index iupper ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPGridSetExtents)( pgrid, ilower, iupper ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPGridSetPNeighbor( hypre_SStructPGrid *pgrid, hypre_Box *pneighbor_box, hypre_Index pnbor_offset ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPGridSetPNeighbor)( pgrid, pneighbor_box, pnbor_offset ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPGridSetSGrid( hypre_StructGrid *sgrid, hypre_SStructPGrid *pgrid, HYPRE_Int var ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPGridSetSGrid)( sgrid, pgrid, var ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPGridSetVariables( hypre_SStructPGrid *pgrid, HYPRE_Int nvars, HYPRE_SStructVariable *vartypes ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPGridSetVariables)( pgrid, nvars, vartypes ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPInnerProd( hypre_SStructPVector *px, hypre_SStructPVector *py, HYPRE_Real *presult_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPInnerProd)( px, py, presult_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPInnerProdLocal( hypre_SStructPVector *px, hypre_SStructPVector *py, HYPRE_Real *presult_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPInnerProdLocal)( px, py, presult_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatmat( hypre_SStructPMatrix *A, hypre_SStructPMatrix *B, hypre_SStructPMatrix **M_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatmat)( A, B, M_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatmult( HYPRE_Int nmatrices, hypre_SStructPMatrix **matrices, HYPRE_Int nterms, HYPRE_Int *terms, HYPRE_Int *trans, hypre_SStructPMatrix **M_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatmult)( nmatrices, matrices, nterms, terms, trans, M_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatmultCommSetup( hypre_SStructPMatmultData *pmmdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatmultCommSetup)( pmmdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatmultCommunicate( hypre_SStructPMatmultData *pmmdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatmultCommunicate)( pmmdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatmultCompute( hypre_SStructPMatmultData *pmmdata, hypre_SStructPMatrix *pM ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatmultCompute)( pmmdata, pM ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatmultCreate( HYPRE_Int nmatrices_input, hypre_SStructPMatrix **pmatrices_input, HYPRE_Int nterms, HYPRE_Int *terms_input, HYPRE_Int *trans_input, hypre_SStructPMatmultData **pmmdata_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatmultCreate)( nmatrices_input, pmatrices_input, nterms, terms_input, trans_input, pmmdata_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatmultDestroy( hypre_SStructPMatmultData *pmmdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatmultDestroy)( pmmdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatmultInitialize( hypre_SStructPMatmultData *pmmdata, HYPRE_Int assemble_grid, hypre_SStructPMatrix **pM_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatmultInitialize)( pmmdata, assemble_grid, pM_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatrixAccumulate( hypre_SStructPMatrix *pmatrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatrixAccumulate)( pmatrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatrixAssemble( hypre_SStructPMatrix *pmatrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatrixAssemble)( pmatrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatrixComputeRowSum( hypre_SStructPMatrix *pA, HYPRE_Int type, hypre_SStructPVector *prowsum ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatrixComputeRowSum)( pA, type, prowsum ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatrixCreate( MPI_Comm comm, hypre_SStructPGrid *pgrid, hypre_SStructStencil **stencils, hypre_SStructPMatrix **pmatrix_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatrixCreate)( comm, pgrid, stencils, pmatrix_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatrixDestroy( hypre_SStructPMatrix *pmatrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatrixDestroy)( pmatrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatrixGetDiagonal( hypre_SStructPMatrix *pmatrix, hypre_SStructPVector *pdiag ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatrixGetDiagonal)( pmatrix, pdiag ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatrixInitialize( hypre_SStructPMatrix *pmatrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatrixInitialize)( pmatrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatrixPrint( const char *filename, hypre_SStructPMatrix *pmatrix, HYPRE_Int all ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatrixPrint)( filename, pmatrix, all ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatrixPtAP( hypre_SStructPMatrix *A, hypre_SStructPMatrix *P, hypre_SStructPMatrix **M_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatrixPtAP)( A, P, M_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatrixRAP( hypre_SStructPMatrix *R, hypre_SStructPMatrix *A, hypre_SStructPMatrix *P, hypre_SStructPMatrix **M_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatrixRAP)( R, A, P, M_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatrixRTtAP( hypre_SStructPMatrix *RT, hypre_SStructPMatrix *A, hypre_SStructPMatrix *P, hypre_SStructPMatrix **M_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatrixRTtAP)( RT, A, P, M_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatrixRef( hypre_SStructPMatrix *matrix, hypre_SStructPMatrix **matrix_ref ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatrixRef)( matrix, matrix_ref ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatrixSetBoxValues)( pmatrix, set_box, var, nentries, entries, value_box, values, action ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatrixSetCEntries( hypre_SStructPMatrix *pmatrix, HYPRE_Int var, HYPRE_Int to_var, HYPRE_Int num_centries, HYPRE_Int *centries ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatrixSetCEntries)( pmatrix, var, to_var, num_centries, centries ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatrixSetDomainStride( hypre_SStructPMatrix *pmatrix, hypre_Index dom_stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatrixSetDomainStride)( pmatrix, dom_stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatrixSetRangeStride( hypre_SStructPMatrix *pmatrix, hypre_Index ran_stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatrixSetRangeStride)( pmatrix, ran_stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatrixSetSymmetric( hypre_SStructPMatrix *pmatrix, HYPRE_Int var, HYPRE_Int to_var, HYPRE_Int symmetric ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatrixSetSymmetric)( pmatrix, var, to_var, symmetric ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatrixSetTranspose( hypre_SStructPMatrix *pmatrix, HYPRE_Int transpose, HYPRE_Int *resize ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatrixSetTranspose)( pmatrix, transpose, resize ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatrixSetValues)( pmatrix, index, var, nentries, entries, values, action ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatvec( HYPRE_Complex alpha, hypre_SStructPMatrix *pA, hypre_SStructPVector *px, HYPRE_Complex beta, hypre_SStructPVector *py ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatvec)( alpha, pA, px, beta, py ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatvecCompute( void *pmatvec_vdata, HYPRE_Complex alpha, hypre_SStructPMatrix *pA, hypre_SStructPVector *px, HYPRE_Complex beta, hypre_SStructPVector *pb, hypre_SStructPVector *py ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatvecCompute)( pmatvec_vdata, alpha, pA, px, beta, pb, py ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatvecCreate( void **pmatvec_vdata_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatvecCreate)( pmatvec_vdata_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatvecDestroy( void *pmatvec_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatvecDestroy)( pmatvec_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatvecSetTranspose( void *pmatvec_vdata, HYPRE_Int transpose ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatvecSetTranspose)( pmatvec_vdata, transpose ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatvecSetup( void *pmatvec_vdata, hypre_SStructPMatrix *pA, hypre_SStructPVector *px ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPMatvecSetup)( pmatvec_vdata, pA, px ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPScale( HYPRE_Complex alpha, hypre_SStructPVector *py ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPScale)( alpha, py ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPVectorAccumulate( hypre_SStructPVector *pvector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPVectorAccumulate)( pvector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPVectorAssemble( hypre_SStructPVector *pvector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPVectorAssemble)( pvector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPVectorCreate( MPI_Comm comm, hypre_SStructPGrid *pgrid, hypre_SStructPVector **pvector_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPVectorCreate)( comm, pgrid, pvector_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPVectorDestroy( hypre_SStructPVector *pvector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPVectorDestroy)( pvector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPVectorGather( hypre_SStructPVector *pvector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPVectorGather)( pvector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPVectorGetBoxValues( hypre_SStructPVector *pvector, hypre_Box *set_box, HYPRE_Int var, hypre_Box *value_box, HYPRE_Complex *values ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPVectorGetBoxValues)( pvector, set_box, var, value_box, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPVectorGetValues( hypre_SStructPVector *pvector, hypre_Index index, HYPRE_Int var, HYPRE_Complex *value ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPVectorGetValues)( pvector, index, var, value ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPVectorInitialize( hypre_SStructPVector *pvector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPVectorInitialize)( pvector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPVectorInitializeShell( hypre_SStructPVector *pvector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPVectorInitializeShell)( pvector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPVectorPointwiseDivpy( HYPRE_Complex alpha, hypre_SStructPVector *px, hypre_SStructPVector *pz, HYPRE_Complex beta, hypre_SStructPVector *py ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPVectorPointwiseDivpy)( alpha, px, pz, beta, py ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPVectorPrint( const char *filename, hypre_SStructPVector *pvector, HYPRE_Int all ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPVectorPrint)( filename, pvector, all ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPVectorRef( hypre_SStructPVector *vector, hypre_SStructPVector **vector_ref ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPVectorRef)( vector, vector_ref ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPVectorSetBoxValues( hypre_SStructPVector *pvector, hypre_Box *set_box, HYPRE_Int var, hypre_Box *value_box, HYPRE_Complex *values, HYPRE_Int action ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPVectorSetBoxValues)( pvector, set_box, var, value_box, values, action ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPVectorSetConstantValues( hypre_SStructPVector *pvector, HYPRE_Complex value ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPVectorSetConstantValues)( pvector, value ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPVectorSetRandomValues( hypre_SStructPVector *pvector, HYPRE_Int seed ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPVectorSetRandomValues)( pvector, seed ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPVectorSetValues( hypre_SStructPVector *pvector, hypre_Index index, HYPRE_Int var, HYPRE_Complex *value, HYPRE_Int action ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPVectorSetValues)( pvector, index, var, value, action ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPartialPCopy( hypre_SStructPVector *px, hypre_SStructPVector *py, hypre_BoxArrayArray **array_boxes ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructPartialPCopy)( px, py, array_boxes ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructScale( HYPRE_Complex alpha, hypre_SStructVector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructScale)( alpha, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructStencilRef( hypre_SStructStencil *stencil, hypre_SStructStencil **stencil_ref ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructStencilRef)( stencil, stencil_ref ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructUMatrixAssemble( hypre_SStructMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructUMatrixAssemble)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructUMatrixInitialize( hypre_SStructMatrix *matrix, HYPRE_MemoryLocation memory_location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructUMatrixInitialize)( matrix, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructUMatrixSetBoxValues)( matrix, part, set_box, var, nentries, entries, value_box, values, action ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructUMatrixSetBoxValuesHelper( 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_IJMatrix ijmatrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructUMatrixSetBoxValuesHelper)( matrix, part, set_box, var, nentries, entries, value_box, values, action, ijmatrix ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructUMatrixSetValues)( matrix, part, index, var, nentries, entries, values, action ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructVarToNborVar( hypre_SStructGrid *grid, HYPRE_Int part, HYPRE_Int var, HYPRE_Int *coord, HYPRE_Int *nbor_var_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructVarToNborVar)( grid, part, var, coord, nbor_var_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructVariableGetOffset( HYPRE_SStructVariable vartype, HYPRE_Int ndim, hypre_Index varoffset ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructVariableGetOffset)( vartype, ndim, varoffset ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructVectorClearGhostValues( hypre_SStructVector *vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructVectorClearGhostValues)( vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructVectorConvert( hypre_SStructVector *vector, hypre_ParVector **parvector_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructVectorConvert)( vector, parvector_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructVectorInitializeShell( hypre_SStructVector *vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructVectorInitializeShell)( vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_MemoryLocation +hypre_SStructVectorMemoryLocation( hypre_SStructVector *vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructVectorMemoryLocation)( vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructVectorParConvert( hypre_SStructVector *vector, hypre_ParVector **parvector_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructVectorParConvert)( vector, parvector_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructVectorParRestore( hypre_SStructVector *vector, hypre_ParVector *parvector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructVectorParRestore)( vector, parvector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructVectorPointwiseDivision( hypre_SStructVector *x, hypre_SStructVector *y, hypre_SStructVector **z_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructVectorPointwiseDivision)( x, y, z_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructVectorPointwiseDivpy( HYPRE_Complex *alpha, hypre_SStructVector *x, hypre_SStructVector *z, HYPRE_Complex *beta, hypre_SStructVector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructVectorPointwiseDivpy)( alpha, x, z, beta, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructVectorPointwiseInverse( hypre_SStructVector *x, hypre_SStructVector **y_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructVectorPointwiseInverse)( x, y_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructVectorPointwiseProduct( hypre_SStructVector *x, hypre_SStructVector *y, hypre_SStructVector **z_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructVectorPointwiseProduct)( x, y, z_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructVectorPrintGLVis( hypre_SStructVector *vector, const char *fileprefix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructVectorPrintGLVis)( vector, fileprefix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructVectorRef( hypre_SStructVector *vector, hypre_SStructVector **vector_ref ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructVectorRef)( vector, vector_ref ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructVectorRestore( hypre_SStructVector *vector, hypre_ParVector *parvector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructVectorRestore)( vector, parvector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructVectorSetConstantValues( hypre_SStructVector *vector, HYPRE_Complex value ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructVectorSetConstantValues)( vector, value ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructVectorSetRandomValues( hypre_SStructVector *vector, HYPRE_Int seed ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SStructVectorSetRandomValues)( vector, seed ); +} + + +#endif + diff --git a/src/sstruct_mv/mup_functions.c b/src/sstruct_mv/mup_functions.c new file mode 100644 index 0000000000..6a61e72824 --- /dev/null +++ b/src/sstruct_mv/mup_functions.c @@ -0,0 +1,838 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_sstruct_mv.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_SStructAxpy( hypre_long_double alpha, HYPRE_SStructVector x, HYPRE_SStructVector y ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructAxpy_pre( precision, alpha, x, y ); +} + +/*--------------------------------------------------------------------------*/ + +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_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGraphAddEntries_pre( precision, graph, part, index, var, to_part, to_index, to_var ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGraphAssemble_pre( precision, graph ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGraphCreate( MPI_Comm comm, HYPRE_SStructGrid grid, HYPRE_SStructGraph *graph ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGraphCreate_pre( precision, comm, grid, graph ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGraphDestroy( HYPRE_SStructGraph graph ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGraphDestroy_pre( precision, graph ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGraphPrint( FILE *file, HYPRE_SStructGraph graph ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGraphPrint_pre( precision, file, graph ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGraphRead( FILE *file, HYPRE_SStructGrid grid, HYPRE_SStructStencil **stencils, HYPRE_SStructGraph *graph_ptr ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGraphRead_pre( precision, file, grid, stencils, graph_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGraphSetDomainGrid( HYPRE_SStructGraph graph, HYPRE_SStructGrid domain_grid ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGraphSetDomainGrid_pre( precision, graph, domain_grid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGraphSetFEM( HYPRE_SStructGraph graph, HYPRE_Int part ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGraphSetFEM_pre( precision, graph, part ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGraphSetFEMSparsity( HYPRE_SStructGraph graph, HYPRE_Int part, HYPRE_Int nsparse, HYPRE_Int *sparsity ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGraphSetFEMSparsity_pre( precision, graph, part, nsparse, sparsity ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGraphSetObjectType( HYPRE_SStructGraph graph, HYPRE_Int type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGraphSetObjectType_pre( precision, graph, type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGraphSetStencil( HYPRE_SStructGraph graph, HYPRE_Int part, HYPRE_Int var, HYPRE_SStructStencil stencil ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGraphSetStencil_pre( precision, graph, part, var, stencil ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridAddVariables( HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int nvars, HYPRE_SStructVariable *vartypes ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGridAddVariables_pre( precision, grid, part, index, nvars, vartypes ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridAssemble( HYPRE_SStructGrid grid ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGridAssemble_pre( precision, grid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridCoarsen( HYPRE_SStructGrid fgrid, HYPRE_Index *strides, HYPRE_SStructGrid *cgrid ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGridCoarsen_pre( precision, fgrid, strides, cgrid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridCreate( MPI_Comm comm, HYPRE_Int ndim, HYPRE_Int nparts, HYPRE_SStructGrid *grid ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGridCreate_pre( precision, comm, ndim, nparts, grid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridDestroy( HYPRE_SStructGrid grid ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGridDestroy_pre( precision, grid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridGetVariableBox( HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int var, HYPRE_Int *cell_ilower, HYPRE_Int *cell_iupper, HYPRE_Int *var_ilower, HYPRE_Int *var_iupper ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGridGetVariableBox_pre( precision, grid, part, var, cell_ilower, cell_iupper, var_ilower, var_iupper ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridPrintGLVis( HYPRE_SStructGrid grid, const char *meshprefix, void *trans, void *origin ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGridPrintGLVis_pre( precision, grid, meshprefix, trans, origin ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridProjectBox( HYPRE_SStructGrid grid, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *origin, HYPRE_Int *stride ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGridProjectBox_pre( precision, grid, ilower, iupper, origin, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridSetExtents( HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGridSetExtents_pre( precision, grid, part, ilower, iupper ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridSetFEMOrdering( HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int *ordering ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGridSetFEMOrdering_pre( precision, grid, part, 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_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGridSetNeighborPart_pre( precision, grid, part, ilower, iupper, nbor_part, nbor_ilower, nbor_iupper, index_map, index_dir ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridSetNumGhost( HYPRE_SStructGrid grid, HYPRE_Int *num_ghost ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGridSetNumGhost_pre( precision, grid, num_ghost ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridSetPeriodic( HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int *periodic ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGridSetPeriodic_pre( precision, grid, part, periodic ); +} + +/*--------------------------------------------------------------------------*/ + +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_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGridSetSharedPart_pre( precision, grid, part, ilower, iupper, offset, shared_part, shared_ilower, shared_iupper, shared_offset, index_map, index_dir ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridSetVariables( HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int nvars, HYPRE_SStructVariable *vartypes ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructGridSetVariables_pre( precision, grid, part, nvars, vartypes ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructInnerProd( HYPRE_SStructVector x, HYPRE_SStructVector y, void *result ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructInnerProd_pre( precision, x, y, result ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixAddFEMBoxValues( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructMatrixAddFEMBoxValues_pre( precision, matrix, part, ilower, iupper, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixAddFEMValues( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructMatrixAddFEMValues_pre( precision, matrix, part, index, 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, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructMatrixAddToBoxValues_pre( precision, matrix, part, ilower, iupper, var, nentries, entries, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixAddToBoxValues2( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructMatrixAddToBoxValues2_pre( precision, matrix, part, ilower, iupper, var, nentries, entries, vilower, viupper, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixAddToValues( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructMatrixAddToValues_pre( precision, matrix, part, index, var, nentries, entries, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixAssemble( HYPRE_SStructMatrix matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructMatrixAssemble_pre( precision, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixCreate( MPI_Comm comm, HYPRE_SStructGraph graph, HYPRE_SStructMatrix *matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructMatrixCreate_pre( precision, comm, graph, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixDestroy( HYPRE_SStructMatrix matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructMatrixDestroy_pre( precision, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +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, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructMatrixGetBoxValues_pre( precision, matrix, part, ilower, iupper, var, nentries, entries, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixGetBoxValues2( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructMatrixGetBoxValues2_pre( precision, matrix, part, ilower, iupper, var, nentries, entries, vilower, viupper, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixGetFEMValues( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructMatrixGetFEMValues_pre( precision, matrix, part, index, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixGetGrid( HYPRE_SStructMatrix matrix, HYPRE_SStructGrid *grid ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructMatrixGetGrid_pre( precision, matrix, grid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixGetObject( HYPRE_SStructMatrix matrix, void **object ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructMatrixGetObject_pre( precision, matrix, object ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixGetValues( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructMatrixGetValues_pre( precision, matrix, part, index, var, nentries, entries, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixInitialize( HYPRE_SStructMatrix matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructMatrixInitialize_pre( precision, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixMatmat( HYPRE_SStructMatrix A, HYPRE_SStructMatrix B, HYPRE_SStructMatrix *C ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructMatrixMatmat_pre( precision, A, B, C ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixMatvec( hypre_long_double alpha, HYPRE_SStructMatrix A, HYPRE_SStructVector x, hypre_long_double beta, HYPRE_SStructVector y ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructMatrixMatvec_pre( precision, alpha, A, x, beta, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixPrint( const char *filename, HYPRE_SStructMatrix matrix, HYPRE_Int all ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructMatrixPrint_pre( precision, filename, matrix, all ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixRead( MPI_Comm comm, const char *filename, HYPRE_SStructMatrix *matrix_ptr ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructMatrixRead_pre( precision, comm, filename, matrix_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +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, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructMatrixSetBoxValues_pre( precision, matrix, part, ilower, iupper, var, nentries, entries, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixSetBoxValues2( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructMatrixSetBoxValues2_pre( precision, matrix, part, ilower, iupper, var, nentries, entries, vilower, viupper, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixSetConstantEntries( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int var, HYPRE_Int to_var, HYPRE_Int nentries, HYPRE_Int *centries ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructMatrixSetConstantEntries_pre( precision, matrix, part, var, to_var, nentries, centries ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixSetDomainStride( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *dom_stride ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructMatrixSetDomainStride_pre( precision, matrix, part, dom_stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixSetEarlyAssemble( HYPRE_SStructMatrix matrix, HYPRE_Int early_assemble ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructMatrixSetEarlyAssemble_pre( precision, matrix, early_assemble ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixSetNSSymmetric( HYPRE_SStructMatrix matrix, HYPRE_Int symmetric ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructMatrixSetNSSymmetric_pre( precision, matrix, symmetric ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixSetObjectType( HYPRE_SStructMatrix matrix, HYPRE_Int type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructMatrixSetObjectType_pre( precision, matrix, type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixSetRangeStride( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ran_stride ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructMatrixSetRangeStride_pre( precision, matrix, part, ran_stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixSetSymmetric( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int var, HYPRE_Int to_var, HYPRE_Int symmetric ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructMatrixSetSymmetric_pre( precision, matrix, part, var, to_var, symmetric ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixSetValues( HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructMatrixSetValues_pre( precision, matrix, part, index, var, nentries, entries, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixToIJMatrix( HYPRE_SStructMatrix matrix, HYPRE_Int fill_diagonal, HYPRE_IJMatrix *ijmatrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructMatrixToIJMatrix_pre( precision, matrix, fill_diagonal, ijmatrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructStencilCreate( HYPRE_Int ndim, HYPRE_Int size, HYPRE_SStructStencil *stencil ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructStencilCreate_pre( precision, ndim, size, stencil ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructStencilDestroy( HYPRE_SStructStencil stencil ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructStencilDestroy_pre( precision, stencil ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructStencilPrint( FILE *file, HYPRE_SStructStencil stencil ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructStencilPrint_pre( precision, file, stencil ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructStencilRead( FILE *file, HYPRE_SStructStencil *stencil_ptr ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructStencilRead_pre( precision, file, stencil_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructStencilSetEntry( HYPRE_SStructStencil stencil, HYPRE_Int entry, HYPRE_Int *offset, HYPRE_Int var ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructStencilSetEntry_pre( precision, stencil, entry, offset, var ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorAddFEMBoxValues( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructVectorAddFEMBoxValues_pre( precision, vector, part, ilower, iupper, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorAddFEMValues( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructVectorAddFEMValues_pre( precision, vector, part, index, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorAddToBoxValues( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructVectorAddToBoxValues_pre( precision, vector, part, ilower, iupper, var, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorAddToBoxValues2( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructVectorAddToBoxValues2_pre( precision, vector, part, ilower, iupper, var, vilower, viupper, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorAddToValues( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, void *value ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructVectorAddToValues_pre( precision, vector, part, index, var, value ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorAssemble( HYPRE_SStructVector vector ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructVectorAssemble_pre( precision, vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorAxpy( hypre_long_double alpha, HYPRE_SStructVector x, HYPRE_SStructVector y ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructVectorAxpy_pre( precision, alpha, x, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorCopy( HYPRE_SStructVector x, HYPRE_SStructVector y ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructVectorCopy_pre( precision, x, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorCreate( MPI_Comm comm, HYPRE_SStructGrid grid, HYPRE_SStructVector *vector ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructVectorCreate_pre( precision, comm, grid, vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorDestroy( HYPRE_SStructVector vector ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructVectorDestroy_pre( precision, vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorGather( HYPRE_SStructVector vector ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructVectorGather_pre( precision, vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorGetBoxValues( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructVectorGetBoxValues_pre( precision, vector, part, ilower, iupper, var, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorGetBoxValues2( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructVectorGetBoxValues2_pre( precision, vector, part, ilower, iupper, var, vilower, viupper, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorGetFEMValues( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructVectorGetFEMValues_pre( precision, vector, part, index, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorGetObject( HYPRE_SStructVector vector, void **object ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructVectorGetObject_pre( precision, vector, object ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorGetValues( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, void *value ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructVectorGetValues_pre( precision, vector, part, index, var, value ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorInitialize( HYPRE_SStructVector vector ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructVectorInitialize_pre( precision, vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorInnerProd( HYPRE_SStructVector x, HYPRE_SStructVector y, void *result ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructVectorInnerProd_pre( precision, x, y, result ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorPrint( const char *filename, HYPRE_SStructVector vector, HYPRE_Int all ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructVectorPrint_pre( precision, filename, vector, all ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorPrintGLVis( HYPRE_SStructVector vector, const char *fileprefix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructVectorPrintGLVis_pre( precision, vector, fileprefix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorRead( MPI_Comm comm, const char *filename, HYPRE_SStructVector *vector_ptr ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructVectorRead_pre( precision, comm, filename, vector_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorScale( hypre_long_double alpha, HYPRE_SStructVector y ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructVectorScale_pre( precision, alpha, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorSetBoxValues( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructVectorSetBoxValues_pre( precision, vector, part, ilower, iupper, var, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorSetBoxValues2( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructVectorSetBoxValues2_pre( precision, vector, part, ilower, iupper, var, vilower, viupper, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorSetConstantValues( HYPRE_SStructVector vector, hypre_long_double value ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructVectorSetConstantValues_pre( precision, vector, value ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorSetObjectType( HYPRE_SStructVector vector, HYPRE_Int type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructVectorSetObjectType_pre( precision, vector, type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorSetRandomValues( HYPRE_SStructVector vector, HYPRE_Int seed ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructVectorSetRandomValues_pre( precision, vector, seed ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorSetValues( HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, void *value ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SStructVectorSetValues_pre( precision, vector, part, index, var, value ); +} + + + +#endif + diff --git a/src/sstruct_mv/mup_pre.c b/src/sstruct_mv/mup_pre.c new file mode 100644 index 0000000000..1f5736c629 --- /dev/null +++ b/src/sstruct_mv/mup_pre.c @@ -0,0 +1,1657 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_sstruct_mv.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_SStructAxpy_pre( HYPRE_Precision precision, hypre_long_double alpha, HYPRE_SStructVector x, HYPRE_SStructVector y ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructAxpy_flt( alpha, x, y ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructAxpy_dbl( alpha, x, y ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructAxpy_long_dbl( alpha, x, y ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGraphAddEntries_pre( HYPRE_Precision precision, HYPRE_SStructGraph graph, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, HYPRE_Int to_part, HYPRE_Int *to_index, HYPRE_Int to_var ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGraphAddEntries_flt( graph, part, index, var, to_part, to_index, to_var ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGraphAddEntries_dbl( graph, part, index, var, to_part, to_index, to_var ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGraphAddEntries_long_dbl( graph, part, index, var, to_part, to_index, to_var ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGraphAssemble_pre( HYPRE_Precision precision, HYPRE_SStructGraph graph ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGraphAssemble_flt( graph ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGraphAssemble_dbl( graph ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGraphAssemble_long_dbl( graph ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGraphCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_SStructGrid grid, HYPRE_SStructGraph *graph ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGraphCreate_flt( comm, grid, graph ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGraphCreate_dbl( comm, grid, graph ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGraphCreate_long_dbl( comm, grid, graph ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGraphDestroy_pre( HYPRE_Precision precision, HYPRE_SStructGraph graph ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGraphDestroy_flt( graph ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGraphDestroy_dbl( graph ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGraphDestroy_long_dbl( graph ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGraphPrint_pre( HYPRE_Precision precision, FILE *file, HYPRE_SStructGraph graph ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGraphPrint_flt( file, graph ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGraphPrint_dbl( file, graph ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGraphPrint_long_dbl( file, graph ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGraphRead_pre( HYPRE_Precision precision, FILE *file, HYPRE_SStructGrid grid, HYPRE_SStructStencil **stencils, HYPRE_SStructGraph *graph_ptr ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGraphRead_flt( file, grid, stencils, graph_ptr ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGraphRead_dbl( file, grid, stencils, graph_ptr ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGraphRead_long_dbl( file, grid, stencils, graph_ptr ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGraphSetDomainGrid_pre( HYPRE_Precision precision, HYPRE_SStructGraph graph, HYPRE_SStructGrid domain_grid ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGraphSetDomainGrid_flt( graph, domain_grid ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGraphSetDomainGrid_dbl( graph, domain_grid ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGraphSetDomainGrid_long_dbl( graph, domain_grid ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGraphSetFEM_pre( HYPRE_Precision precision, HYPRE_SStructGraph graph, HYPRE_Int part ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGraphSetFEM_flt( graph, part ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGraphSetFEM_dbl( graph, part ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGraphSetFEM_long_dbl( graph, part ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGraphSetFEMSparsity_pre( HYPRE_Precision precision, HYPRE_SStructGraph graph, HYPRE_Int part, HYPRE_Int nsparse, HYPRE_Int *sparsity ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGraphSetFEMSparsity_flt( graph, part, nsparse, sparsity ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGraphSetFEMSparsity_dbl( graph, part, nsparse, sparsity ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGraphSetFEMSparsity_long_dbl( graph, part, nsparse, sparsity ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGraphSetObjectType_pre( HYPRE_Precision precision, HYPRE_SStructGraph graph, HYPRE_Int type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGraphSetObjectType_flt( graph, type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGraphSetObjectType_dbl( graph, type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGraphSetObjectType_long_dbl( graph, type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGraphSetStencil_pre( HYPRE_Precision precision, HYPRE_SStructGraph graph, HYPRE_Int part, HYPRE_Int var, HYPRE_SStructStencil stencil ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGraphSetStencil_flt( graph, part, var, stencil ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGraphSetStencil_dbl( graph, part, var, stencil ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGraphSetStencil_long_dbl( graph, part, var, stencil ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridAddVariables_pre( HYPRE_Precision precision, HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int nvars, HYPRE_SStructVariable *vartypes ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGridAddVariables_flt( grid, part, index, nvars, vartypes ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGridAddVariables_dbl( grid, part, index, nvars, vartypes ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGridAddVariables_long_dbl( grid, part, index, nvars, vartypes ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridAssemble_pre( HYPRE_Precision precision, HYPRE_SStructGrid grid ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGridAssemble_flt( grid ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGridAssemble_dbl( grid ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGridAssemble_long_dbl( grid ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridCoarsen_pre( HYPRE_Precision precision, HYPRE_SStructGrid fgrid, HYPRE_Index *strides, HYPRE_SStructGrid *cgrid ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGridCoarsen_flt( fgrid, strides, cgrid ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGridCoarsen_dbl( fgrid, strides, cgrid ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGridCoarsen_long_dbl( fgrid, strides, cgrid ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_Int ndim, HYPRE_Int nparts, HYPRE_SStructGrid *grid ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGridCreate_flt( comm, ndim, nparts, grid ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGridCreate_dbl( comm, ndim, nparts, grid ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGridCreate_long_dbl( comm, ndim, nparts, grid ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridDestroy_pre( HYPRE_Precision precision, HYPRE_SStructGrid grid ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGridDestroy_flt( grid ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGridDestroy_dbl( grid ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGridDestroy_long_dbl( grid ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridGetVariableBox_pre( HYPRE_Precision precision, HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int var, HYPRE_Int *cell_ilower, HYPRE_Int *cell_iupper, HYPRE_Int *var_ilower, HYPRE_Int *var_iupper ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGridGetVariableBox_flt( grid, part, var, cell_ilower, cell_iupper, var_ilower, var_iupper ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGridGetVariableBox_dbl( grid, part, var, cell_ilower, cell_iupper, var_ilower, var_iupper ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGridGetVariableBox_long_dbl( grid, part, var, cell_ilower, cell_iupper, var_ilower, var_iupper ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridPrintGLVis_pre( HYPRE_Precision precision, HYPRE_SStructGrid grid, const char *meshprefix, void *trans, void *origin ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGridPrintGLVis_flt( grid, meshprefix, trans, origin ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGridPrintGLVis_dbl( grid, meshprefix, trans, origin ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGridPrintGLVis_long_dbl( grid, meshprefix, trans, origin ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridProjectBox_pre( HYPRE_Precision precision, HYPRE_SStructGrid grid, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *origin, HYPRE_Int *stride ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGridProjectBox_flt( grid, ilower, iupper, origin, stride ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGridProjectBox_dbl( grid, ilower, iupper, origin, stride ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGridProjectBox_long_dbl( grid, ilower, iupper, origin, stride ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridSetExtents_pre( HYPRE_Precision precision, HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGridSetExtents_flt( grid, part, ilower, iupper ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGridSetExtents_dbl( grid, part, ilower, iupper ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGridSetExtents_long_dbl( grid, part, ilower, iupper ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridSetFEMOrdering_pre( HYPRE_Precision precision, HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int *ordering ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGridSetFEMOrdering_flt( grid, part, ordering ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGridSetFEMOrdering_dbl( grid, part, ordering ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGridSetFEMOrdering_long_dbl( grid, part, ordering ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridSetNeighborPart_pre( HYPRE_Precision precision, 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 ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGridSetNeighborPart_flt( grid, part, ilower, iupper, nbor_part, nbor_ilower, nbor_iupper, index_map, index_dir ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGridSetNeighborPart_dbl( grid, part, ilower, iupper, nbor_part, nbor_ilower, nbor_iupper, index_map, index_dir ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGridSetNeighborPart_long_dbl( grid, part, ilower, iupper, nbor_part, nbor_ilower, nbor_iupper, index_map, index_dir ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridSetNumGhost_pre( HYPRE_Precision precision, HYPRE_SStructGrid grid, HYPRE_Int *num_ghost ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGridSetNumGhost_flt( grid, num_ghost ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGridSetNumGhost_dbl( grid, num_ghost ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGridSetNumGhost_long_dbl( grid, num_ghost ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridSetPeriodic_pre( HYPRE_Precision precision, HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int *periodic ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGridSetPeriodic_flt( grid, part, periodic ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGridSetPeriodic_dbl( grid, part, periodic ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGridSetPeriodic_long_dbl( grid, part, periodic ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridSetSharedPart_pre( HYPRE_Precision precision, 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 ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGridSetSharedPart_flt( grid, part, ilower, iupper, offset, shared_part, shared_ilower, shared_iupper, shared_offset, index_map, index_dir ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGridSetSharedPart_dbl( grid, part, ilower, iupper, offset, shared_part, shared_ilower, shared_iupper, shared_offset, index_map, index_dir ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGridSetSharedPart_long_dbl( grid, part, ilower, iupper, offset, shared_part, shared_ilower, shared_iupper, shared_offset, index_map, index_dir ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructGridSetVariables_pre( HYPRE_Precision precision, HYPRE_SStructGrid grid, HYPRE_Int part, HYPRE_Int nvars, HYPRE_SStructVariable *vartypes ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructGridSetVariables_flt( grid, part, nvars, vartypes ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructGridSetVariables_dbl( grid, part, nvars, vartypes ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructGridSetVariables_long_dbl( grid, part, nvars, vartypes ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructInnerProd_pre( HYPRE_Precision precision, HYPRE_SStructVector x, HYPRE_SStructVector y, void *result ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructInnerProd_flt( x, y, result ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructInnerProd_dbl( x, y, result ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructInnerProd_long_dbl( x, y, result ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixAddFEMBoxValues_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructMatrixAddFEMBoxValues_flt( matrix, part, ilower, iupper, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructMatrixAddFEMBoxValues_dbl( matrix, part, ilower, iupper, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructMatrixAddFEMBoxValues_long_dbl( matrix, part, ilower, iupper, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixAddFEMValues_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructMatrixAddFEMValues_flt( matrix, part, index, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructMatrixAddFEMValues_dbl( matrix, part, index, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructMatrixAddFEMValues_long_dbl( matrix, part, index, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixAddToBoxValues_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructMatrixAddToBoxValues_flt( matrix, part, ilower, iupper, var, nentries, entries, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructMatrixAddToBoxValues_dbl( matrix, part, ilower, iupper, var, nentries, entries, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructMatrixAddToBoxValues_long_dbl( matrix, part, ilower, iupper, var, nentries, entries, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixAddToBoxValues2_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructMatrixAddToBoxValues2_flt( matrix, part, ilower, iupper, var, nentries, entries, vilower, viupper, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructMatrixAddToBoxValues2_dbl( matrix, part, ilower, iupper, var, nentries, entries, vilower, viupper, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructMatrixAddToBoxValues2_long_dbl( matrix, part, ilower, iupper, var, nentries, entries, vilower, viupper, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixAddToValues_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructMatrixAddToValues_flt( matrix, part, index, var, nentries, entries, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructMatrixAddToValues_dbl( matrix, part, index, var, nentries, entries, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructMatrixAddToValues_long_dbl( matrix, part, index, var, nentries, entries, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixAssemble_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructMatrixAssemble_flt( matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructMatrixAssemble_dbl( matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructMatrixAssemble_long_dbl( matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_SStructGraph graph, HYPRE_SStructMatrix *matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructMatrixCreate_flt( comm, graph, matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructMatrixCreate_dbl( comm, graph, matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructMatrixCreate_long_dbl( comm, graph, matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixDestroy_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructMatrixDestroy_flt( matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructMatrixDestroy_dbl( matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructMatrixDestroy_long_dbl( matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixGetBoxValues_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructMatrixGetBoxValues_flt( matrix, part, ilower, iupper, var, nentries, entries, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructMatrixGetBoxValues_dbl( matrix, part, ilower, iupper, var, nentries, entries, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructMatrixGetBoxValues_long_dbl( matrix, part, ilower, iupper, var, nentries, entries, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixGetBoxValues2_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructMatrixGetBoxValues2_flt( matrix, part, ilower, iupper, var, nentries, entries, vilower, viupper, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructMatrixGetBoxValues2_dbl( matrix, part, ilower, iupper, var, nentries, entries, vilower, viupper, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructMatrixGetBoxValues2_long_dbl( matrix, part, ilower, iupper, var, nentries, entries, vilower, viupper, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixGetFEMValues_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructMatrixGetFEMValues_flt( matrix, part, index, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructMatrixGetFEMValues_dbl( matrix, part, index, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructMatrixGetFEMValues_long_dbl( matrix, part, index, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixGetGrid_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_SStructGrid *grid ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructMatrixGetGrid_flt( matrix, grid ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructMatrixGetGrid_dbl( matrix, grid ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructMatrixGetGrid_long_dbl( matrix, grid ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixGetObject_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, void **object ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructMatrixGetObject_flt( matrix, object ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructMatrixGetObject_dbl( matrix, object ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructMatrixGetObject_long_dbl( matrix, object ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixGetValues_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructMatrixGetValues_flt( matrix, part, index, var, nentries, entries, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructMatrixGetValues_dbl( matrix, part, index, var, nentries, entries, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructMatrixGetValues_long_dbl( matrix, part, index, var, nentries, entries, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixInitialize_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructMatrixInitialize_flt( matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructMatrixInitialize_dbl( matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructMatrixInitialize_long_dbl( matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixMatmat_pre( HYPRE_Precision precision, HYPRE_SStructMatrix A, HYPRE_SStructMatrix B, HYPRE_SStructMatrix *C ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructMatrixMatmat_flt( A, B, C ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructMatrixMatmat_dbl( A, B, C ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructMatrixMatmat_long_dbl( A, B, C ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixMatvec_pre( HYPRE_Precision precision, hypre_long_double alpha, HYPRE_SStructMatrix A, HYPRE_SStructVector x, hypre_long_double beta, HYPRE_SStructVector y ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructMatrixMatvec_flt( alpha, A, x, beta, y ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructMatrixMatvec_dbl( alpha, A, x, beta, y ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructMatrixMatvec_long_dbl( alpha, A, x, beta, y ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixPrint_pre( HYPRE_Precision precision, const char *filename, HYPRE_SStructMatrix matrix, HYPRE_Int all ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructMatrixPrint_flt( filename, matrix, all ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructMatrixPrint_dbl( filename, matrix, all ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructMatrixPrint_long_dbl( filename, matrix, all ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixRead_pre( HYPRE_Precision precision, MPI_Comm comm, const char *filename, HYPRE_SStructMatrix *matrix_ptr ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructMatrixRead_flt( comm, filename, matrix_ptr ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructMatrixRead_dbl( comm, filename, matrix_ptr ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructMatrixRead_long_dbl( comm, filename, matrix_ptr ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixSetBoxValues_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructMatrixSetBoxValues_flt( matrix, part, ilower, iupper, var, nentries, entries, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructMatrixSetBoxValues_dbl( matrix, part, ilower, iupper, var, nentries, entries, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructMatrixSetBoxValues_long_dbl( matrix, part, ilower, iupper, var, nentries, entries, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixSetBoxValues2_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructMatrixSetBoxValues2_flt( matrix, part, ilower, iupper, var, nentries, entries, vilower, viupper, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructMatrixSetBoxValues2_dbl( matrix, part, ilower, iupper, var, nentries, entries, vilower, viupper, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructMatrixSetBoxValues2_long_dbl( matrix, part, ilower, iupper, var, nentries, entries, vilower, viupper, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixSetConstantEntries_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int var, HYPRE_Int to_var, HYPRE_Int nentries, HYPRE_Int *centries ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructMatrixSetConstantEntries_flt( matrix, part, var, to_var, nentries, centries ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructMatrixSetConstantEntries_dbl( matrix, part, var, to_var, nentries, centries ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructMatrixSetConstantEntries_long_dbl( matrix, part, var, to_var, nentries, centries ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixSetDomainStride_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *dom_stride ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructMatrixSetDomainStride_flt( matrix, part, dom_stride ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructMatrixSetDomainStride_dbl( matrix, part, dom_stride ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructMatrixSetDomainStride_long_dbl( matrix, part, dom_stride ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixSetEarlyAssemble_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int early_assemble ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructMatrixSetEarlyAssemble_flt( matrix, early_assemble ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructMatrixSetEarlyAssemble_dbl( matrix, early_assemble ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructMatrixSetEarlyAssemble_long_dbl( matrix, early_assemble ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixSetNSSymmetric_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int symmetric ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructMatrixSetNSSymmetric_flt( matrix, symmetric ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructMatrixSetNSSymmetric_dbl( matrix, symmetric ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructMatrixSetNSSymmetric_long_dbl( matrix, symmetric ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixSetObjectType_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructMatrixSetObjectType_flt( matrix, type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructMatrixSetObjectType_dbl( matrix, type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructMatrixSetObjectType_long_dbl( matrix, type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixSetRangeStride_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *ran_stride ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructMatrixSetRangeStride_flt( matrix, part, ran_stride ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructMatrixSetRangeStride_dbl( matrix, part, ran_stride ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructMatrixSetRangeStride_long_dbl( matrix, part, ran_stride ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixSetSymmetric_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int var, HYPRE_Int to_var, HYPRE_Int symmetric ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructMatrixSetSymmetric_flt( matrix, part, var, to_var, symmetric ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructMatrixSetSymmetric_dbl( matrix, part, var, to_var, symmetric ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructMatrixSetSymmetric_long_dbl( matrix, part, var, to_var, symmetric ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixSetValues_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, HYPRE_Int nentries, HYPRE_Int *entries, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructMatrixSetValues_flt( matrix, part, index, var, nentries, entries, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructMatrixSetValues_dbl( matrix, part, index, var, nentries, entries, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructMatrixSetValues_long_dbl( matrix, part, index, var, nentries, entries, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructMatrixToIJMatrix_pre( HYPRE_Precision precision, HYPRE_SStructMatrix matrix, HYPRE_Int fill_diagonal, HYPRE_IJMatrix *ijmatrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructMatrixToIJMatrix_flt( matrix, fill_diagonal, ijmatrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructMatrixToIJMatrix_dbl( matrix, fill_diagonal, ijmatrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructMatrixToIJMatrix_long_dbl( matrix, fill_diagonal, ijmatrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructStencilCreate_pre( HYPRE_Precision precision, HYPRE_Int ndim, HYPRE_Int size, HYPRE_SStructStencil *stencil ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructStencilCreate_flt( ndim, size, stencil ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructStencilCreate_dbl( ndim, size, stencil ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructStencilCreate_long_dbl( ndim, size, stencil ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructStencilDestroy_pre( HYPRE_Precision precision, HYPRE_SStructStencil stencil ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructStencilDestroy_flt( stencil ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructStencilDestroy_dbl( stencil ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructStencilDestroy_long_dbl( stencil ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructStencilPrint_pre( HYPRE_Precision precision, FILE *file, HYPRE_SStructStencil stencil ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructStencilPrint_flt( file, stencil ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructStencilPrint_dbl( file, stencil ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructStencilPrint_long_dbl( file, stencil ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructStencilRead_pre( HYPRE_Precision precision, FILE *file, HYPRE_SStructStencil *stencil_ptr ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructStencilRead_flt( file, stencil_ptr ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructStencilRead_dbl( file, stencil_ptr ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructStencilRead_long_dbl( file, stencil_ptr ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructStencilSetEntry_pre( HYPRE_Precision precision, HYPRE_SStructStencil stencil, HYPRE_Int entry, HYPRE_Int *offset, HYPRE_Int var ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructStencilSetEntry_flt( stencil, entry, offset, var ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructStencilSetEntry_dbl( stencil, entry, offset, var ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructStencilSetEntry_long_dbl( stencil, entry, offset, var ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorAddFEMBoxValues_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructVectorAddFEMBoxValues_flt( vector, part, ilower, iupper, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructVectorAddFEMBoxValues_dbl( vector, part, ilower, iupper, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructVectorAddFEMBoxValues_long_dbl( vector, part, ilower, iupper, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorAddFEMValues_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructVectorAddFEMValues_flt( vector, part, index, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructVectorAddFEMValues_dbl( vector, part, index, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructVectorAddFEMValues_long_dbl( vector, part, index, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorAddToBoxValues_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructVectorAddToBoxValues_flt( vector, part, ilower, iupper, var, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructVectorAddToBoxValues_dbl( vector, part, ilower, iupper, var, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructVectorAddToBoxValues_long_dbl( vector, part, ilower, iupper, var, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorAddToBoxValues2_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructVectorAddToBoxValues2_flt( vector, part, ilower, iupper, var, vilower, viupper, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructVectorAddToBoxValues2_dbl( vector, part, ilower, iupper, var, vilower, viupper, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructVectorAddToBoxValues2_long_dbl( vector, part, ilower, iupper, var, vilower, viupper, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorAddToValues_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, void *value ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructVectorAddToValues_flt( vector, part, index, var, value ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructVectorAddToValues_dbl( vector, part, index, var, value ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructVectorAddToValues_long_dbl( vector, part, index, var, value ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorAssemble_pre( HYPRE_Precision precision, HYPRE_SStructVector vector ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructVectorAssemble_flt( vector ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructVectorAssemble_dbl( vector ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructVectorAssemble_long_dbl( vector ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorAxpy_pre( HYPRE_Precision precision, hypre_long_double alpha, HYPRE_SStructVector x, HYPRE_SStructVector y ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructVectorAxpy_flt( alpha, x, y ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructVectorAxpy_dbl( alpha, x, y ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructVectorAxpy_long_dbl( alpha, x, y ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorCopy_pre( HYPRE_Precision precision, HYPRE_SStructVector x, HYPRE_SStructVector y ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructVectorCopy_flt( x, y ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructVectorCopy_dbl( x, y ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructVectorCopy_long_dbl( x, y ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_SStructGrid grid, HYPRE_SStructVector *vector ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructVectorCreate_flt( comm, grid, vector ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructVectorCreate_dbl( comm, grid, vector ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructVectorCreate_long_dbl( comm, grid, vector ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorDestroy_pre( HYPRE_Precision precision, HYPRE_SStructVector vector ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructVectorDestroy_flt( vector ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructVectorDestroy_dbl( vector ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructVectorDestroy_long_dbl( vector ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorGather_pre( HYPRE_Precision precision, HYPRE_SStructVector vector ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructVectorGather_flt( vector ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructVectorGather_dbl( vector ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructVectorGather_long_dbl( vector ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorGetBoxValues_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructVectorGetBoxValues_flt( vector, part, ilower, iupper, var, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructVectorGetBoxValues_dbl( vector, part, ilower, iupper, var, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructVectorGetBoxValues_long_dbl( vector, part, ilower, iupper, var, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorGetBoxValues2_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructVectorGetBoxValues2_flt( vector, part, ilower, iupper, var, vilower, viupper, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructVectorGetBoxValues2_dbl( vector, part, ilower, iupper, var, vilower, viupper, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructVectorGetBoxValues2_long_dbl( vector, part, ilower, iupper, var, vilower, viupper, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorGetFEMValues_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructVectorGetFEMValues_flt( vector, part, index, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructVectorGetFEMValues_dbl( vector, part, index, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructVectorGetFEMValues_long_dbl( vector, part, index, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorGetObject_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, void **object ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructVectorGetObject_flt( vector, object ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructVectorGetObject_dbl( vector, object ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructVectorGetObject_long_dbl( vector, object ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorGetValues_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, void *value ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructVectorGetValues_flt( vector, part, index, var, value ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructVectorGetValues_dbl( vector, part, index, var, value ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructVectorGetValues_long_dbl( vector, part, index, var, value ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorInitialize_pre( HYPRE_Precision precision, HYPRE_SStructVector vector ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructVectorInitialize_flt( vector ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructVectorInitialize_dbl( vector ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructVectorInitialize_long_dbl( vector ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorInnerProd_pre( HYPRE_Precision precision, HYPRE_SStructVector x, HYPRE_SStructVector y, void *result ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructVectorInnerProd_flt( x, y, result ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructVectorInnerProd_dbl( x, y, result ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructVectorInnerProd_long_dbl( x, y, result ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorPrint_pre( HYPRE_Precision precision, const char *filename, HYPRE_SStructVector vector, HYPRE_Int all ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructVectorPrint_flt( filename, vector, all ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructVectorPrint_dbl( filename, vector, all ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructVectorPrint_long_dbl( filename, vector, all ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorPrintGLVis_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, const char *fileprefix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructVectorPrintGLVis_flt( vector, fileprefix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructVectorPrintGLVis_dbl( vector, fileprefix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructVectorPrintGLVis_long_dbl( vector, fileprefix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorRead_pre( HYPRE_Precision precision, MPI_Comm comm, const char *filename, HYPRE_SStructVector *vector_ptr ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructVectorRead_flt( comm, filename, vector_ptr ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructVectorRead_dbl( comm, filename, vector_ptr ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructVectorRead_long_dbl( comm, filename, vector_ptr ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorScale_pre( HYPRE_Precision precision, hypre_long_double alpha, HYPRE_SStructVector y ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructVectorScale_flt( alpha, y ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructVectorScale_dbl( alpha, y ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructVectorScale_long_dbl( alpha, y ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorSetBoxValues_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructVectorSetBoxValues_flt( vector, part, ilower, iupper, var, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructVectorSetBoxValues_dbl( vector, part, ilower, iupper, var, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructVectorSetBoxValues_long_dbl( vector, part, ilower, iupper, var, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorSetBoxValues2_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int var, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructVectorSetBoxValues2_flt( vector, part, ilower, iupper, var, vilower, viupper, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructVectorSetBoxValues2_dbl( vector, part, ilower, iupper, var, vilower, viupper, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructVectorSetBoxValues2_long_dbl( vector, part, ilower, iupper, var, vilower, viupper, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorSetConstantValues_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, hypre_long_double value ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructVectorSetConstantValues_flt( vector, value ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructVectorSetConstantValues_dbl( vector, value ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructVectorSetConstantValues_long_dbl( vector, value ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorSetObjectType_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, HYPRE_Int type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructVectorSetObjectType_flt( vector, type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructVectorSetObjectType_dbl( vector, type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructVectorSetObjectType_long_dbl( vector, type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorSetRandomValues_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, HYPRE_Int seed ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructVectorSetRandomValues_flt( vector, seed ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructVectorSetRandomValues_dbl( vector, seed ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructVectorSetRandomValues_long_dbl( vector, seed ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SStructVectorSetValues_pre( HYPRE_Precision precision, HYPRE_SStructVector vector, HYPRE_Int part, HYPRE_Int *index, HYPRE_Int var, void *value ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SStructVectorSetValues_flt( vector, part, index, var, value ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SStructVectorSetValues_dbl( vector, part, index, var, value ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SStructVectorSetValues_long_dbl( vector, part, index, var, value ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + + + +#endif + diff --git a/src/sstruct_mv/protos.h b/src/sstruct_mv/protos.h index ee2febcf51..59410920cb 100644 --- a/src/sstruct_mv/protos.h +++ b/src/sstruct_mv/protos.h @@ -5,138 +5,16 @@ * 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_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_SStructGraphAssemble ( HYPRE_SStructGraph graph ); -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_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_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_sstruct_matrix.c */ -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_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_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_SStructStencilDestroy ( HYPRE_SStructStencil stencil ); -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_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_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_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_SStructPVectorPointwiseDivpy ( HYPRE_Complex alpha, hypre_SStructPVector *px, + hypre_SStructPVector *pz, HYPRE_Complex beta, + hypre_SStructPVector *py ); HYPRE_Int hypre_SStructAxpy ( HYPRE_Complex alpha, hypre_SStructVector *x, hypre_SStructVector *y ); +HYPRE_Int hypre_SStructVectorPointwiseDivpy ( HYPRE_Complex *alpha, hypre_SStructVector *x, + hypre_SStructVector *z, HYPRE_Complex *beta, + hypre_SStructVector *y ); /* sstruct_copy.c */ HYPRE_Int hypre_SStructPCopy ( hypre_SStructPVector *px, hypre_SStructPVector *py ); @@ -148,21 +26,24 @@ HYPRE_Int hypre_SStructCopy ( hypre_SStructVector *x, hypre_SStructVector *y ); 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_BigInt 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 var, HYPRE_Int proc, HYPRE_Int endpt, HYPRE_BigInt *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_SStructPGridRef( hypre_SStructPGrid *pgrid, hypre_SStructPGrid **pgrid_ref); 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_SStructPGridSetSGrid ( hypre_StructGrid *sgrid, hypre_SStructPGrid *pgrid, + HYPRE_Int var ); HYPRE_Int hypre_SStructPGridSetVariables ( hypre_SStructPGrid *pgrid, HYPRE_Int nvars, HYPRE_SStructVariable *vartypes ); HYPRE_Int hypre_SStructPGridSetPNeighbor ( hypre_SStructPGrid *pgrid, hypre_Box *pneighbor_box, @@ -170,6 +51,7 @@ HYPRE_Int hypre_SStructPGridSetPNeighbor ( hypre_SStructPGrid *pgrid, hypre_Box HYPRE_Int hypre_SStructPGridAssemble ( hypre_SStructPGrid *pgrid ); HYPRE_Int hypre_SStructPGridGetMaxBoxSize ( hypre_SStructPGrid *pgrid ); HYPRE_Int hypre_SStructGridRef ( hypre_SStructGrid *grid, hypre_SStructGrid **grid_ref ); +HYPRE_Int hypre_SStructGridComputeGlobalSizes ( hypre_SStructGrid *grid ); HYPRE_Int hypre_SStructGridAssembleBoxManagers ( hypre_SStructGrid *grid ); HYPRE_Int hypre_SStructGridAssembleNborBoxManagers ( hypre_SStructGrid *grid ); HYPRE_Int hypre_SStructGridCreateCommInfo ( hypre_SStructGrid *grid ); @@ -212,6 +94,12 @@ HYPRE_Int hypre_SStructCellBoxToVarBox ( hypre_Box *box, hypre_Index offset, hyp 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_SStructGridPrintGLVis ( hypre_SStructGrid *grid, const char *meshprefix, + HYPRE_Real *trans, HYPRE_Real *origin ); +HYPRE_Int hypre_SStructGridCoarsen ( hypre_SStructGrid *fgrid, hypre_IndexRef origin, + hypre_Index *strides, hypre_Index *periodic, hypre_SStructGrid **cgrid_ptr ); +HYPRE_Int hypre_SStructGridSetActiveParts ( hypre_SStructGrid *grid, HYPRE_Int *active ); +HYPRE_Int hypre_SStructGridSetAllPartsActive ( hypre_SStructGrid *grid ); 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 ); @@ -219,6 +107,8 @@ HYPRE_Int hypre_SStructGridRead ( MPI_Comm comm, FILE *file, hypre_SStructGrid * /* sstruct_innerprod.c */ HYPRE_Int hypre_SStructPInnerProd ( hypre_SStructPVector *px, hypre_SStructPVector *py, HYPRE_Real *presult_ptr ); +HYPRE_Int hypre_SStructPInnerProdLocal ( hypre_SStructPVector *px, hypre_SStructPVector *py, + HYPRE_Real *presult_ptr ); HYPRE_Int hypre_SStructInnerProd ( hypre_SStructVector *x, hypre_SStructVector *y, HYPRE_Real *result_ptr ); @@ -236,18 +126,34 @@ HYPRE_Int hypre_SStructPMatrixSetBoxValues( hypre_SStructPMatrix *pmatrix, hypre HYPRE_Int action ); HYPRE_Int hypre_SStructPMatrixAccumulate ( hypre_SStructPMatrix *pmatrix ); HYPRE_Int hypre_SStructPMatrixAssemble ( hypre_SStructPMatrix *pmatrix ); +HYPRE_Int hypre_SStructPMatrixSetTranspose( hypre_SStructPMatrix *pmatrix, HYPRE_Int transpose, + HYPRE_Int *resize ); HYPRE_Int hypre_SStructPMatrixSetSymmetric ( hypre_SStructPMatrix *pmatrix, HYPRE_Int var, HYPRE_Int to_var, HYPRE_Int symmetric ); +HYPRE_Int hypre_SStructPMatrixSetCEntries( hypre_SStructPMatrix *pmatrix, HYPRE_Int var, + HYPRE_Int to_var, HYPRE_Int num_centries, HYPRE_Int *centries ); +HYPRE_Int hypre_SStructPMatrixSetDomainStride ( hypre_SStructPMatrix *pmatrix, + hypre_Index dom_stride ); +HYPRE_Int hypre_SStructPMatrixSetRangeStride ( hypre_SStructPMatrix *pmatrix, + hypre_Index ran_stride ); HYPRE_Int hypre_SStructPMatrixPrint ( const char *filename, hypre_SStructPMatrix *pmatrix, HYPRE_Int all ); -HYPRE_Int hypre_SStructUMatrixInitialize ( hypre_SStructMatrix *matrix ); +HYPRE_Int hypre_SStructPMatrixGetDiagonal ( hypre_SStructPMatrix *pmatrix, + hypre_SStructPVector *pdiag ); +HYPRE_Int hypre_SStructUMatrixInitialize ( hypre_SStructMatrix *matrix, + HYPRE_MemoryLocation memory_location ); 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_SStructUMatrixSetBoxValuesHelper( 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_IJMatrix ijmatrix ); 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_SStructMatrixMapDataBox ( hypre_SStructMatrix *matrix, HYPRE_Int part, + HYPRE_Int vi, HYPRE_Int vj, hypre_Box *map_vbox ); 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, @@ -255,32 +161,148 @@ HYPRE_Int hypre_SStructMatrixSplitEntries ( hypre_SStructMatrix *matrix, HYPRE_I 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_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_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_SStructMatrixCompressUToS( HYPRE_SStructMatrix matrix, HYPRE_Int action ); +HYPRE_Int hypre_SStructMatrixBoxesToUMatrix( hypre_SStructMatrix *A, hypre_SStructGrid *grid, + hypre_IJMatrix **ij_Ahat_ptr, hypre_BoxArray ***convert_boxa); +hypre_IJMatrix* hypre_SStructMatrixToUMatrix( HYPRE_SStructMatrix matrix, + HYPRE_Int fill_diagonal ); +HYPRE_Int hypre_SStructMatrixHaloToUMatrix ( hypre_SStructMatrix *A, hypre_SStructGrid *grid, + hypre_IJMatrix **ij_Ahat_ptr, HYPRE_Int halo_size ); +HYPRE_Int hypre_SStructMatrixGetDiagonal ( hypre_SStructMatrix *matrix, + hypre_SStructVector **diag_ptr ); HYPRE_MemoryLocation hypre_SStructMatrixMemoryLocation(hypre_SStructMatrix *matrix); /* sstruct_matvec.c */ HYPRE_Int hypre_SStructPMatvecCreate ( void **pmatvec_vdata_ptr ); +HYPRE_Int hypre_SStructPMatvecSetTranspose ( void *pmatvec_vdata, HYPRE_Int transpose ); 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_SStructPMatrix *pA, hypre_SStructPVector *px, HYPRE_Complex beta, hypre_SStructPVector *pb, + 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_SStructMatvecCreate ( void **matvec_vdata_ptr ); +HYPRE_Int hypre_SStructMatvecSetTranspose ( void *matvec_vdata, HYPRE_Int transpose ); 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_SStructMatrix *A, hypre_SStructVector *x, HYPRE_Complex beta, hypre_SStructVector *b, + 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 ); +/* sstruct_matmult.c */ +HYPRE_Int +hypre_SStructPMatmultCreate(HYPRE_Int nmatrices_input, + hypre_SStructPMatrix **pmatrices_input, + HYPRE_Int nterms, + HYPRE_Int *terms_input, + HYPRE_Int *trans_input, + hypre_SStructPMatmultData **pmmdata_ptr); +HYPRE_Int +hypre_SStructPMatmultDestroy( hypre_SStructPMatmultData *pmmdata ); +HYPRE_Int +hypre_SStructPMatmultInitialize( hypre_SStructPMatmultData *pmmdata, + HYPRE_Int assemble_grid, + hypre_SStructPMatrix **pM_ptr ); +HYPRE_Int +hypre_SStructPMatmultCommSetup( hypre_SStructPMatmultData *pmmdata ); +HYPRE_Int +hypre_SStructPMatmultCommunicate( hypre_SStructPMatmultData *pmmdata ); +HYPRE_Int +hypre_SStructPMatmultCompute( hypre_SStructPMatmultData *pmmdata, + hypre_SStructPMatrix *pM ); +HYPRE_Int +hypre_SStructPMatmult(HYPRE_Int nmatrices, + hypre_SStructPMatrix **matrices, + HYPRE_Int nterms, + HYPRE_Int *terms, + HYPRE_Int *trans, + hypre_SStructPMatrix **M_ptr ); +HYPRE_Int +hypre_SStructPMatmat( hypre_SStructPMatrix *A, + hypre_SStructPMatrix *B, + hypre_SStructPMatrix **M_ptr ); +HYPRE_Int +hypre_SStructPMatrixPtAP( hypre_SStructPMatrix *A, + hypre_SStructPMatrix *P, + hypre_SStructPMatrix **M_ptr ); +HYPRE_Int +hypre_SStructPMatrixRAP( hypre_SStructPMatrix *R, + hypre_SStructPMatrix *A, + hypre_SStructPMatrix *P, + hypre_SStructPMatrix **M_ptr ); +HYPRE_Int +hypre_SStructPMatrixRTtAP( hypre_SStructPMatrix *RT, + hypre_SStructPMatrix *A, + hypre_SStructPMatrix *P, + hypre_SStructPMatrix **M_ptr ); +HYPRE_Int +hypre_SStructMatmultCreate(HYPRE_Int nmatrices_input, + hypre_SStructMatrix **matrices_input, + HYPRE_Int nterms, + HYPRE_Int *terms_input, + HYPRE_Int *trans_input, + hypre_SStructMatmultData **mmdata_ptr); +HYPRE_Int +hypre_SStructMatmultDestroy( hypre_SStructMatmultData *mmdata ); +HYPRE_Int +hypre_SStructMatmultInitialize( hypre_SStructMatmultData *mmdata, + hypre_SStructMatrix **M_ptr ); +HYPRE_Int +hypre_SStructMatmultCommunicate( hypre_SStructMatmultData *mmdata ); +HYPRE_Int +hypre_SStructMatmultComputeS( hypre_SStructMatmultData *mmdata, + hypre_SStructMatrix *M ); +HYPRE_Int +hypre_SStructMatmultComputeU( hypre_SStructMatmultData *mmdata, + hypre_SStructMatrix *M ); +HYPRE_Int +hypre_SStructMatmultCompute( hypre_SStructMatmultData *mmdata, + hypre_SStructMatrix *M ); +HYPRE_Int +hypre_SStructMatmult(HYPRE_Int nmatrices, + hypre_SStructMatrix **matrices, + HYPRE_Int nterms, + HYPRE_Int *terms, + HYPRE_Int *trans, + hypre_SStructMatrix **M_ptr ); +HYPRE_Int +hypre_SStructMatmat( hypre_SStructMatrix *A, + hypre_SStructMatrix *B, + hypre_SStructMatrix **M_ptr ); +HYPRE_Int +hypre_SStructMatrixPtAP( hypre_SStructMatrix *A, + hypre_SStructMatrix *P, + hypre_SStructMatrix **M_ptr ); +HYPRE_Int +hypre_SStructMatrixRAP( hypre_SStructMatrix *R, + hypre_SStructMatrix *A, + hypre_SStructMatrix *P, + hypre_SStructMatrix **M_ptr ); +HYPRE_Int +hypre_SStructMatrixRTtAP( hypre_SStructMatrix *RT, + hypre_SStructMatrix *A, + hypre_SStructMatrix *P, + hypre_SStructMatrix **M_ptr ); + +/* sstruct_matop.c */ +HYPRE_Int hypre_SStructPMatrixComputeRowSum ( hypre_SStructPMatrix *pA, HYPRE_Int type, + hypre_SStructPVector *prowsum ); +HYPRE_Int hypre_SStructMatrixComputeRowSum ( hypre_SStructMatrix *A, HYPRE_Int type, + hypre_SStructVector **rowsum_ptr ); +HYPRE_Int hypre_SStructMatrixComputeL1Norms ( hypre_SStructMatrix *A, HYPRE_Int option, + hypre_SStructVector **l1_norms_ptr ); + /* sstruct_scale.c */ HYPRE_Int hypre_SStructPScale ( HYPRE_Complex alpha, hypre_SStructPVector *py ); HYPRE_Int hypre_SStructScale ( HYPRE_Complex alpha, hypre_SStructVector *y ); @@ -309,10 +331,12 @@ HYPRE_Int hypre_SStructPVectorGetBoxValues( hypre_SStructPVector *pvector, hypre HYPRE_Int var, hypre_Box *value_box, HYPRE_Complex *values ); HYPRE_Int hypre_SStructPVectorSetConstantValues ( hypre_SStructPVector *pvector, HYPRE_Complex value ); +HYPRE_Int hypre_SStructPVectorSetRandomValues ( hypre_SStructPVector *pvector, HYPRE_Int seed ); 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_SStructVectorSetRandomValues ( hypre_SStructVector *vector, HYPRE_Int seed ); HYPRE_Int hypre_SStructVectorConvert ( hypre_SStructVector *vector, hypre_ParVector **parvector_ptr ); HYPRE_Int hypre_SStructVectorParConvert ( hypre_SStructVector *vector, @@ -322,6 +346,7 @@ HYPRE_Int hypre_SStructVectorParRestore ( hypre_SStructVector *vector, hypre_Par HYPRE_Int hypre_SStructPVectorInitializeShell ( hypre_SStructPVector *pvector ); HYPRE_Int hypre_SStructVectorInitializeShell ( hypre_SStructVector *vector ); HYPRE_Int hypre_SStructVectorClearGhostValues ( hypre_SStructVector *vector ); +HYPRE_Int hypre_SStructVectorPrintGLVis ( hypre_SStructVector *vector, const char *fileprefix ); HYPRE_MemoryLocation hypre_SStructVectorMemoryLocation(hypre_SStructVector *vector); HYPRE_Int hypre_SStructVectorPointwiseDivision ( hypre_SStructVector *x, hypre_SStructVector *y, hypre_SStructVector **z_ptr ); diff --git a/src/sstruct_mv/sstruct_axpy.c b/src/sstruct_mv/sstruct_axpy.c index 3991ab8302..6caa601016 100644 --- a/src/sstruct_mv/sstruct_axpy.c +++ b/src/sstruct_mv/sstruct_axpy.c @@ -14,7 +14,6 @@ #include "_hypre_sstruct_mv.h" /*-------------------------------------------------------------------------- - * hypre_SStructPAxpy *--------------------------------------------------------------------------*/ HYPRE_Int @@ -22,21 +21,64 @@ hypre_SStructPAxpy( HYPRE_Complex alpha, hypre_SStructPVector *px, hypre_SStructPVector *py ) { - HYPRE_Int nvars = hypre_SStructPVectorNVars(px); - HYPRE_Int var; + HYPRE_Int nvars = hypre_SStructPVectorNVars(px); + HYPRE_Int var; + HYPRE_Complex beta = 1.0; for (var = 0; var < nvars; var++) { - hypre_StructAxpy(alpha, - hypre_SStructPVectorSVector(px, var), - hypre_SStructPVectorSVector(py, var)); + hypre_StructVectorAxpy(alpha, + hypre_SStructPVectorSVector(px, var), + beta, + hypre_SStructPVectorSVector(py, var), + hypre_SStructPVectorSVector(py, var)); + } + + return hypre_error_flag; +} + +/*------------------------------------------------------------------------- + * Computes y = alpha*x./z + beta*y for a part if it is active. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPVectorPointwiseDivpy( HYPRE_Complex alpha, + hypre_SStructPVector *px, + hypre_SStructPVector *pz, + HYPRE_Complex beta, + hypre_SStructPVector *py ) +{ + HYPRE_Int nvars = hypre_SStructPVectorNVars(px); + HYPRE_Int var, active; + + hypre_SStructPGrid *pgrid; + hypre_StructVector *sx; + hypre_StructVector *sy; + hypre_StructVector *sz; + + for (var = 0; var < nvars; var++) + { + pgrid = hypre_SStructPVectorPGrid(px); + active = hypre_SStructPGridActive(pgrid, var); + + if (active) + { + sx = hypre_SStructPVectorSVector(px, var); + sy = hypre_SStructPVectorSVector(py, var); + sz = hypre_SStructPVectorSVector(pz, var); + + hypre_StructVectorPointwiseDivpy(alpha, sx, sz, beta, sy); + } } return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_SStructAxpy + * TODO: + * - Change to SStructVectorAxpy + * - Add beta and z arguments (z = beta * y + alpha * x) + * - Update hypre_SStructPAxpy to hypre_SStructVectorPAxpy *--------------------------------------------------------------------------*/ HYPRE_Int @@ -47,8 +89,8 @@ 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) { @@ -80,3 +122,67 @@ hypre_SStructAxpy( HYPRE_Complex alpha, return hypre_error_flag; } + +/*------------------------------------------------------------------ + * y = alpha[part]*x./z + beta[part]*y + *----------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructVectorPointwiseDivpy( HYPRE_Complex *alpha, + hypre_SStructVector *x, + hypre_SStructVector *z, + HYPRE_Complex *beta, + hypre_SStructVector *y ) +{ + 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 z_object_type = hypre_SStructVectorObjectType(z); + + hypre_ParVector *x_par; + hypre_ParVector *y_par; + hypre_ParVector *z_par; + + hypre_SStructPVector *px; + hypre_SStructPVector *py; + hypre_SStructPVector *pz; + + /* Sanity check */ + if ((x_object_type != y_object_type) || (x_object_type != z_object_type)) + { + hypre_error_in_arg(2); + hypre_error_in_arg(3); + hypre_error_in_arg(5); + return hypre_error_flag; + } + + if (x_object_type == HYPRE_SSTRUCT || x_object_type == HYPRE_STRUCT) + { + for (part = 0; part < nparts; part++) + { + px = hypre_SStructVectorPVector(x, part); + py = hypre_SStructVectorPVector(y, part); + pz = hypre_SStructVectorPVector(z, part); + + hypre_SStructPVectorPointwiseDivpy(alpha[part], px, pz, beta[part], py); + } + } + else if (x_object_type == HYPRE_PARCSR) + { + hypre_SStructVectorConvert(x, &x_par); + hypre_SStructVectorConvert(y, &y_par); + hypre_SStructVectorConvert(z, &z_par); + + if ((alpha[0] != 1.0) || (beta[0] != 1.0)) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "{alpha, beta} != 1.0 not implemented!"); + return hypre_error_flag; + } + + hypre_ParVectorPointwiseDivpy(x_par, z_par, y_par); + } + + return hypre_error_flag; +} diff --git a/src/sstruct_mv/sstruct_copy.c b/src/sstruct_mv/sstruct_copy.c index eab9d41dc2..cf751e8c8c 100644 --- a/src/sstruct_mv/sstruct_copy.c +++ b/src/sstruct_mv/sstruct_copy.c @@ -14,7 +14,6 @@ #include "_hypre_sstruct_mv.h" /*-------------------------------------------------------------------------- - * hypre_SStructPCopy *--------------------------------------------------------------------------*/ HYPRE_Int @@ -34,8 +33,8 @@ hypre_SStructPCopy( hypre_SStructPVector *px, } /*-------------------------------------------------------------------------- - * hypre_SStructPartialPCopy: Copy the components on only a subset of the - * pgrid. For each box of an sgrid, an array of subboxes are copied. + * Copy the components on only a subset of the pgrid. + * For each box of an sgrid, an array of subboxes are copied. *--------------------------------------------------------------------------*/ HYPRE_Int @@ -59,7 +58,6 @@ hypre_SStructPartialPCopy( hypre_SStructPVector *px, } /*-------------------------------------------------------------------------- - * hypre_SStructCopy *--------------------------------------------------------------------------*/ HYPRE_Int diff --git a/src/sstruct_mv/sstruct_graph.c b/src/sstruct_mv/sstruct_graph.c index aee1823fb5..2721ad7392 100644 --- a/src/sstruct_mv/sstruct_graph.c +++ b/src/sstruct_mv/sstruct_graph.c @@ -96,13 +96,13 @@ hypre_SStructGraphGetUVEntryRank( hypre_SStructGraph *graph, /*-------------------------------------------------------------------------- * Computes the local Uventries index for the endpt of a box. This index * can be used to localize a search for Uventries of a box. - * endpt= 0 start of boxes - * endpt= 1 end of boxes + * endpt = 0 start of boxes + * endpt = 1 end of boxes * 9/09 AB - modified to use the box manager *--------------------------------------------------------------------------*/ -HYPRE_Int +HYPRE_BigInt hypre_SStructGraphFindBoxEndpt(hypre_SStructGraph *graph, HYPRE_Int part, HYPRE_Int var, @@ -132,7 +132,6 @@ hypre_SStructGraphFindBoxEndpt(hypre_SStructGraph *graph, hypre_SStructBoxManEntryGetGlobalRank( boxman_entry, hypre_BoxIMin(box), &rank, type); } - else { hypre_SStructBoxManEntryGetGlobalRank( @@ -143,7 +142,7 @@ hypre_SStructGraphFindBoxEndpt(hypre_SStructGraph *graph, { rank -= hypre_SStructGridGhstartRank(grid); } - if (type == HYPRE_PARCSR) + else if (type == HYPRE_PARCSR) { rank -= hypre_SStructGridStartRank(grid); } @@ -154,19 +153,19 @@ hypre_SStructGraphFindBoxEndpt(hypre_SStructGraph *graph, /*-------------------------------------------------------------------------- * Computes the local Uventries index for the start or end of each box of * a given sgrid. - * endpt= 0 start of boxes - * endpt= 1 end of boxes + * endpt = 0 start of boxes + * endpt = 1 end of boxes *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_SStructGraphFindSGridEndpts(hypre_SStructGraph *graph, - HYPRE_Int part, - HYPRE_Int var, - HYPRE_Int proc, - HYPRE_Int endpt, - HYPRE_Int *endpts) +hypre_SStructGraphFindSGridEndpts( hypre_SStructGraph *graph, + HYPRE_Int part, + HYPRE_Int var, + HYPRE_Int proc, + HYPRE_Int endpt, + HYPRE_BigInt *endpts ) { - hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); + hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); hypre_StructGrid *sgrid; hypre_BoxArray *boxes; HYPRE_Int i; @@ -182,4 +181,3 @@ hypre_SStructGraphFindSGridEndpts(hypre_SStructGraph *graph, return hypre_error_flag; } - diff --git a/src/sstruct_mv/sstruct_graph.h b/src/sstruct_mv/sstruct_graph.h index 51af06e930..2f49cdab58 100644 --- a/src/sstruct_mv/sstruct_graph.h +++ b/src/sstruct_mv/sstruct_graph.h @@ -36,7 +36,7 @@ typedef struct HYPRE_Int to_var; HYPRE_Int to_boxnum; /* local box number */ HYPRE_Int to_proc; - HYPRE_Int to_rank; + HYPRE_BigInt to_rank; } hypre_SStructUEntry; @@ -45,7 +45,7 @@ typedef struct HYPRE_Int part; hypre_Index index; HYPRE_Int var; - HYPRE_Int rank; + HYPRE_BigInt rank; HYPRE_Int nUentries; hypre_SStructUEntry *Uentries; @@ -55,13 +55,12 @@ typedef struct hypre_SStructGraph_struct { MPI_Comm comm; HYPRE_Int ndim; - hypre_SStructGrid *grid; - hypre_SStructGrid *domain_grid; /* same as grid by default */ - HYPRE_Int nparts; - hypre_SStructPGrid **pgrids; + HYPRE_Int nparts; /* number of parts */ + hypre_SStructGrid *grid; /* base grid */ + hypre_SStructGrid *dom_grid; /* domain grid */ hypre_SStructStencil ***stencils; /* each (part, var) has a stencil */ - /* info for fem-based user input */ + /* Info for fem-based user input */ HYPRE_Int *fem_nsparse; HYPRE_Int **fem_sparse_i; HYPRE_Int **fem_sparse_j; @@ -70,21 +69,21 @@ typedef struct hypre_SStructGraph_struct /* U-graph info: Entries are referenced via a local rank that comes from an * ordering of the local grid boxes with ghost zones added. */ HYPRE_Int nUventries; /* number of Uventries */ - HYPRE_Int *iUventries; /* rank indexes into Uventries */ + HYPRE_BigInt *iUventries; /* rank indexes into Uventries */ hypre_SStructUVEntry **Uventries; HYPRE_Int Uvesize; /* size of Uventries array */ HYPRE_Int Uemaxsize; /* max size of Uentries */ HYPRE_BigInt **Uveoffsets; /* offsets for computing rank indexes */ - - HYPRE_Int ref_count; - - HYPRE_Int type; /* GEC0203 */ + hypre_Box ***Uvboxes; /* (part, var) array of boxes for non-stencil entries */ /* These are created in GraphAddEntries() then deleted in GraphAssemble() */ hypre_SStructGraphEntry **graph_entries; HYPRE_Int n_graph_entries; /* number graph entries */ HYPRE_Int a_graph_entries; /* alloced graph entries */ + /* Object data */ + HYPRE_Int ref_count; + HYPRE_Int type; } hypre_SStructGraph; /*-------------------------------------------------------------------------- @@ -94,14 +93,14 @@ typedef struct hypre_SStructGraph_struct #define hypre_SStructGraphComm(graph) ((graph) -> comm) #define hypre_SStructGraphNDim(graph) ((graph) -> ndim) #define hypre_SStructGraphGrid(graph) ((graph) -> grid) -#define hypre_SStructGraphDomainGrid(graph) ((graph) -> domain_grid) -#define hypre_SStructGraphNParts(graph) ((graph) -> nparts) +#define hypre_SStructGraphDomGrid(graph) ((graph) -> dom_grid) #define hypre_SStructGraphPGrids(graph) \ hypre_SStructGridPGrids(hypre_SStructGraphGrid(graph)) #define hypre_SStructGraphPGrid(graph, p) \ hypre_SStructGridPGrid(hypre_SStructGraphGrid(graph), p) #define hypre_SStructGraphStencils(graph) ((graph) -> stencils) #define hypre_SStructGraphStencil(graph, p, v) ((graph) -> stencils[p][v]) +#define hypre_SStructGraphNParts(graph) ((graph) -> nparts) #define hypre_SStructGraphFEMNSparse(graph) ((graph) -> fem_nsparse) #define hypre_SStructGraphFEMSparseI(graph) ((graph) -> fem_sparse_i) @@ -121,12 +120,14 @@ typedef struct hypre_SStructGraph_struct #define hypre_SStructGraphUEMaxSize(graph) ((graph) -> Uemaxsize) #define hypre_SStructGraphUVEOffsets(graph) ((graph) -> Uveoffsets) #define hypre_SStructGraphUVEOffset(graph, p, v)((graph) -> Uveoffsets[p][v]) +#define hypre_SStructGraphUVBoxes(graph) ((graph) -> Uvboxes) +#define hypre_SStructGraphUVBox(graph, p, v) ((graph) -> Uvboxes[p][v]) -#define hypre_SStructGraphRefCount(graph) ((graph) -> ref_count) -#define hypre_SStructGraphObjectType(graph) ((graph) -> type) #define hypre_SStructGraphEntries(graph) ((graph) -> graph_entries) #define hypre_SStructNGraphEntries(graph) ((graph) -> n_graph_entries) #define hypre_SStructAGraphEntries(graph) ((graph) -> a_graph_entries) +#define hypre_SStructGraphRefCount(graph) ((graph) -> ref_count) +#define hypre_SStructGraphObjectType(graph) ((graph) -> type) /*-------------------------------------------------------------------------- * Accessor macros: hypre_SStructUVEntry diff --git a/src/sstruct_mv/sstruct_grid.c b/src/sstruct_mv/sstruct_grid.c index cfee930994..2fc4b5f9d1 100644 --- a/src/sstruct_mv/sstruct_grid.c +++ b/src/sstruct_mv/sstruct_grid.c @@ -34,30 +34,39 @@ hypre_SStructVariableGetOffset( HYPRE_SStructVariable vartype, case HYPRE_SSTRUCT_VARIABLE_CELL: hypre_SetIndex(varoffset, 0); break; + case HYPRE_SSTRUCT_VARIABLE_NODE: hypre_SetIndex(varoffset, 1); break; + case HYPRE_SSTRUCT_VARIABLE_XFACE: hypre_SetIndex3(varoffset, 1, 0, 0); break; + case HYPRE_SSTRUCT_VARIABLE_YFACE: hypre_SetIndex3(varoffset, 0, 1, 0); break; + case HYPRE_SSTRUCT_VARIABLE_ZFACE: hypre_SetIndex3(varoffset, 0, 0, 1); break; + case HYPRE_SSTRUCT_VARIABLE_XEDGE: hypre_SetIndex3(varoffset, 0, 1, 1); break; + case HYPRE_SSTRUCT_VARIABLE_YEDGE: hypre_SetIndex3(varoffset, 1, 0, 1); break; + case HYPRE_SSTRUCT_VARIABLE_ZEDGE: hypre_SetIndex3(varoffset, 1, 1, 0); break; + case HYPRE_SSTRUCT_VARIABLE_UNDEFINED: break; } + for (d = ndim; d < HYPRE_MAXDIM; d++) { hypre_IndexD(varoffset, d) = 0; @@ -80,22 +89,24 @@ hypre_SStructPGridCreate( MPI_Comm comm, { hypre_SStructPGrid *pgrid; hypre_StructGrid *sgrid; - HYPRE_Int t; + HYPRE_Int t, d; - pgrid = hypre_TAlloc(hypre_SStructPGrid, 1, HYPRE_MEMORY_HOST); + pgrid = hypre_TAlloc(hypre_SStructPGrid, 1, HYPRE_MEMORY_HOST); - hypre_SStructPGridComm(pgrid) = comm; - hypre_SStructPGridNDim(pgrid) = ndim; - hypre_SStructPGridNVars(pgrid) = 0; - hypre_SStructPGridCellSGridDone(pgrid) = 0; - hypre_SStructPGridVarTypes(pgrid) = NULL; + hypre_SStructPGridComm(pgrid) = comm; + hypre_SStructPGridNDim(pgrid) = ndim; + hypre_SStructPGridNVars(pgrid) = 0; + hypre_SStructPGridCellSGridDone(pgrid) = 0; + hypre_SStructPGridVarTypes(pgrid) = NULL; for (t = 0; t < 8; t++) { + hypre_SStructPGridVTPBndBoxArrayArray(pgrid, t) = NULL; hypre_SStructPGridVTSGrid(pgrid, t) = NULL; hypre_SStructPGridVTIBoxArray(pgrid, t) = NULL; + hypre_SStructPGridVTActive(pgrid, t) = 1; } - HYPRE_StructGridCreate(comm, ndim, &sgrid); + hypre_StructGridCreate(comm, ndim, &sgrid); hypre_SStructPGridCellSGrid(pgrid) = sgrid; hypre_SStructPGridPNeighbors(pgrid) = hypre_BoxArrayCreate(0, ndim); @@ -103,40 +114,65 @@ hypre_SStructPGridCreate( MPI_Comm comm, hypre_SStructPGridLocalSize(pgrid) = 0; hypre_SStructPGridGlobalSize(pgrid) = 0; + hypre_SStructPGridRefCount(pgrid) = 1; - /* GEC0902 ghost addition to the grid */ - hypre_SStructPGridGhlocalSize(pgrid) = 0; - + /* GEC0902 ghost addition to the grid */ + hypre_SStructPGridGhlocalSize(pgrid) = 0; hypre_SetIndex(hypre_SStructPGridPeriodic(pgrid), 0); + hypre_SetIndex(hypre_SStructPGridCoordsStride(pgrid), 1); + for (d = 0; d < HYPRE_MAXDIM; d++) + { + hypre_SStructPGridCoordsOrigin(pgrid)[d] = 0.0; + } *pgrid_ptr = pgrid; return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPGridRef( hypre_SStructPGrid *pgrid, + hypre_SStructPGrid **pgrid_ref) +{ + hypre_SStructPGridRefCount(pgrid) ++; + *pgrid_ref = pgrid; + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ HYPRE_Int hypre_SStructPGridDestroy( hypre_SStructPGrid *pgrid ) { - hypre_StructGrid **sgrids; - hypre_BoxArray **iboxarrays; - HYPRE_Int t; + hypre_StructGrid **sgrids; + hypre_BoxArray **iboxarrays; + hypre_BoxArrayArray **pbnd_boxaa; + HYPRE_Int t; if (pgrid) { - sgrids = hypre_SStructPGridSGrids(pgrid); - iboxarrays = hypre_SStructPGridIBoxArrays(pgrid); - hypre_TFree(hypre_SStructPGridVarTypes(pgrid), HYPRE_MEMORY_HOST); - for (t = 0; t < 8; t++) + hypre_SStructPGridRefCount(pgrid) --; + if (hypre_SStructPGridRefCount(pgrid) == 0) { - HYPRE_StructGridDestroy(sgrids[t]); - hypre_BoxArrayDestroy(iboxarrays[t]); + sgrids = hypre_SStructPGridSGrids(pgrid); + iboxarrays = hypre_SStructPGridIBoxArrays(pgrid); + pbnd_boxaa = hypre_SStructPGridPBndBoxArrayArrays(pgrid); + hypre_TFree(hypre_SStructPGridVarTypes(pgrid), HYPRE_MEMORY_HOST); + for (t = 0; t < 8; t++) + { + HYPRE_StructGridDestroy(sgrids[t]); + hypre_BoxArrayDestroy(iboxarrays[t]); + hypre_BoxArrayArrayDestroy(pbnd_boxaa[t]); + } + hypre_BoxArrayDestroy(hypre_SStructPGridPNeighbors(pgrid)); + hypre_TFree(hypre_SStructPGridPNborOffsets(pgrid), HYPRE_MEMORY_HOST); + hypre_TFree(pgrid, HYPRE_MEMORY_HOST); } - hypre_BoxArrayDestroy(hypre_SStructPGridPNeighbors(pgrid)); - hypre_TFree(hypre_SStructPGridPNborOffsets(pgrid), HYPRE_MEMORY_HOST); - hypre_TFree(pgrid, HYPRE_MEMORY_HOST); } return hypre_error_flag; @@ -170,6 +206,26 @@ hypre_SStructPGridSetCellSGrid( hypre_SStructPGrid *pgrid, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPGridSetSGrid( hypre_StructGrid *sgrid, + hypre_SStructPGrid *pgrid, + HYPRE_Int var ) +{ + hypre_StructGrid *sgrid_old; + + /* Destroy old sgrid */ + sgrid_old = hypre_SStructPGridSGrid(pgrid, var); + hypre_StructGridDestroy(sgrid_old); + + /* Point to new sgrid */ + hypre_StructGridRef(sgrid, &hypre_SStructPGridSGrid(pgrid, var)); + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -183,7 +239,7 @@ hypre_SStructPGridSetVariables( hypre_SStructPGrid *pgrid, hypre_TFree(hypre_SStructPGridVarTypes(pgrid), HYPRE_MEMORY_HOST); - new_vartypes = hypre_TAlloc(hypre_SStructVariable, nvars, HYPRE_MEMORY_HOST); + new_vartypes = hypre_TAlloc(hypre_SStructVariable, nvars, HYPRE_MEMORY_HOST); for (i = 0; i < nvars; i++) { new_vartypes[i] = vartypes[i]; @@ -211,7 +267,8 @@ hypre_SStructPGridSetPNeighbor( hypre_SStructPGrid *pgrid, hypre_AppendBox(pneighbor_box, pneighbors); if ((size % memchunk) == 0) { - pnbor_offsets = hypre_TReAlloc(pnbor_offsets, hypre_Index, (size + memchunk), HYPRE_MEMORY_HOST); + pnbor_offsets = hypre_TReAlloc(pnbor_offsets, hypre_Index, (size + memchunk), + HYPRE_MEMORY_HOST); hypre_SStructPGridPNborOffsets(pgrid) = pnbor_offsets; } hypre_CopyIndex(pnbor_offset, pnbor_offsets[size]); @@ -232,6 +289,7 @@ hypre_SStructPGridAssemble( hypre_SStructPGrid *pgrid ) HYPRE_SStructVariable *vartypes = hypre_SStructPGridVarTypes(pgrid); hypre_StructGrid **sgrids = hypre_SStructPGridSGrids(pgrid); hypre_BoxArray **iboxarrays = hypre_SStructPGridIBoxArrays(pgrid); + hypre_BoxArrayArray **pbnd_boxaa = hypre_SStructPGridPBndBoxArrayArrays(pgrid); hypre_BoxArray *pneighbors = hypre_SStructPGridPNeighbors(pgrid); hypre_Index *pnbor_offsets = hypre_SStructPGridPNborOffsets(pgrid); hypre_IndexRef periodic = hypre_SStructPGridPeriodic(pgrid); @@ -244,6 +302,7 @@ hypre_SStructPGridAssemble( hypre_SStructPGrid *pgrid ) hypre_BoxArray *hood_boxes; HYPRE_Int hood_first_local; HYPRE_Int hood_num_local; + HYPRE_Int num_boxes; hypre_BoxArray *nbor_boxes; hypre_BoxArray *diff_boxes; hypre_BoxArray *tmp_boxes; @@ -270,7 +329,7 @@ hypre_SStructPGridAssemble( hypre_SStructPGrid *pgrid ) /* get neighbor info from the struct grid box manager */ boxman = hypre_StructGridBoxMan(cell_sgrid); - hood_boxes = hypre_BoxArrayCreate(0, ndim); + hood_boxes = hypre_BoxArrayCreate(0, ndim); hypre_BoxManGetAllEntriesBoxes(boxman, hood_boxes); hood_first_local = hypre_BoxManFirstLocal(boxman); hood_num_local = hypre_BoxManNumMyEntries(boxman); @@ -290,7 +349,6 @@ hypre_SStructPGridAssemble( hypre_SStructPGrid *pgrid ) if ((t > 0) && (sgrids[t] == NULL)) { HYPRE_StructGridCreate(comm, ndim, &sgrid); - hypre_StructGridSetNumGhost(sgrid, hypre_StructGridNumGhost(cell_sgrid)); boxes = hypre_BoxArrayCreate(0, ndim); hypre_SStructVariableGetOffset((hypre_SStructVariable) t, ndim, varoffset); @@ -348,19 +406,17 @@ hypre_SStructPGridAssemble( hypre_SStructPGrid *pgrid ) hypre_StructGridSetBoxes(sgrid, boxes); HYPRE_StructGridAssemble(sgrid); - sgrids[t] = sgrid; } } hypre_BoxArrayDestroy(hood_boxes); - hypre_BoxArrayDestroy(nbor_boxes); hypre_BoxArrayDestroy(diff_boxes); hypre_BoxArrayDestroy(tmp_boxes); /*------------------------------------------------------------- - * compute iboxarrays + * compute iboxarrays and allocate pboxarrays *-------------------------------------------------------------*/ for (t = 0; t < 8; t++) @@ -368,8 +424,19 @@ hypre_SStructPGridAssemble( hypre_SStructPGrid *pgrid ) sgrid = sgrids[t]; if (sgrid != NULL) { - iboxarray = hypre_BoxArrayDuplicate(hypre_StructGridBoxes(sgrid)); + if (pbnd_boxaa[t] == NULL) + { + num_boxes = hypre_StructGridNumBoxes(sgrid); + pbnd_boxaa[t] = hypre_BoxArrayArrayCreate(num_boxes, ndim); + + /* Set BoxArrayArray IDs */ + for (i = 0; i < num_boxes; i++) + { + hypre_BoxArrayArrayID(pbnd_boxaa[t], i) = i; + } + } + iboxarray = hypre_BoxArrayClone(hypre_StructGridBoxes(sgrid)); hypre_SStructVariableGetOffset((hypre_SStructVariable) t, ndim, varoffset); hypre_ForBoxI(i, iboxarray) @@ -436,6 +503,85 @@ hypre_SStructGridRef( hypre_SStructGrid *grid, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * Computes the global sizes of the semi-struct grid, part grids, and struct + * grids. It reduces the number of calls to hypre_MPI_Allreduce to a single one + * in contrast to nparts*nvars when calling hypre_StructGridComputeGlobalSize + * for each StructGrid. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructGridComputeGlobalSizes(hypre_SStructGrid *grid) +{ + MPI_Comm comm = hypre_SStructGridComm(grid); + HYPRE_Int nparts = hypre_SStructGridNParts(grid); + + hypre_SStructPGrid *pgrid; + hypre_StructGrid *sgrid; + + HYPRE_Int part; + HYPRE_Int var, nvars; + HYPRE_Int ngrids; + HYPRE_BigInt global_size; + HYPRE_BigInt pglobal_size; + HYPRE_BigInt *local_sizes; + HYPRE_BigInt *global_sizes; + + /* Determine number of struct grids */ + ngrids = 0; + for (part = 0; part < nparts; part++) + { + pgrid = hypre_SStructGridPGrid(grid, part); + ngrids += hypre_SStructPGridNVars(pgrid); + } + + /* Allocate memory */ + local_sizes = hypre_CTAlloc(HYPRE_BigInt, ngrids, HYPRE_MEMORY_HOST); + global_sizes = hypre_CTAlloc(HYPRE_BigInt, ngrids, HYPRE_MEMORY_HOST); + + /* Build local_sizes array */ + ngrids = 0; + for (part = 0; part < nparts; part++) + { + pgrid = hypre_SStructGridPGrid(grid, part); + nvars = hypre_SStructPGridNVars(pgrid); + for (var = 0; var < nvars; var++) + { + sgrid = hypre_SStructPGridSGrid(pgrid, var); + local_sizes[ngrids++] = (HYPRE_BigInt) hypre_StructGridLocalSize(sgrid); + } + } + + /* Compute global sizes */ + hypre_MPI_Allreduce(local_sizes, global_sizes, ngrids, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, comm); + + /* Set global size data members*/ + global_size = ngrids = 0; + for (part = 0; part < nparts; part++) + { + pgrid = hypre_SStructGridPGrid(grid, part); + nvars = hypre_SStructPGridNVars(pgrid); + + pglobal_size = 0; + for (var = 0; var < nvars; var++) + { + sgrid = hypre_SStructPGridSGrid(pgrid, var); + hypre_StructGridGlobalSize(sgrid) = global_sizes[ngrids]; + pglobal_size += global_sizes[ngrids]; + ngrids++; + } + hypre_SStructPGridGlobalSize(pgrid) = pglobal_size; + global_size += pglobal_size; + } + hypre_SStructGridGlobalSize(grid) = global_size; + + /* Free memory */ + hypre_TFree(local_sizes, HYPRE_MEMORY_HOST); + hypre_TFree(global_sizes, HYPRE_MEMORY_HOST); + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- * This replaces hypre_SStructGridAssembleMaps *--------------------------------------------------------------------------*/ @@ -510,7 +656,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*/ - managers = hypre_TAlloc(hypre_BoxManager **, nparts, HYPRE_MEMORY_HOST); + managers = hypre_TAlloc(hypre_BoxManager **, nparts, HYPRE_MEMORY_HOST); /* first offsets */ box_offset = offsets[0]; @@ -534,7 +680,7 @@ hypre_SStructGridAssembleBoxManagers( hypre_SStructGrid *grid ) pgrid = hypre_SStructGridPGrid(grid, part); nvars = hypre_SStructPGridNVars(pgrid); - managers[part] = hypre_TAlloc(hypre_BoxManager *, nvars, HYPRE_MEMORY_HOST); + managers[part] = hypre_TAlloc(hypre_BoxManager *, nvars, HYPRE_MEMORY_HOST); for (var = 0; var < nvars; var++) { @@ -765,10 +911,10 @@ hypre_SStructGridAssembleNborBoxManagers( hypre_SStructGrid *grid ) int_box = hypre_BoxCreate(ndim); ghbox = hypre_BoxCreate(ndim); /* nbor_info is copied into the box manager */ - nbor_info = hypre_TAlloc(hypre_SStructBoxManNborInfo, 1, HYPRE_MEMORY_HOST); - peri_info = hypre_CTAlloc(hypre_SStructBoxManNborInfo, 1, HYPRE_MEMORY_HOST); + nbor_info = hypre_TAlloc(hypre_SStructBoxManNborInfo, 1, HYPRE_MEMORY_HOST); + peri_info = hypre_CTAlloc(hypre_SStructBoxManNborInfo, 1, HYPRE_MEMORY_HOST); - nbor_managers = hypre_TAlloc(hypre_BoxManager **, nparts, HYPRE_MEMORY_HOST); + nbor_managers = hypre_TAlloc(hypre_BoxManager **, nparts, HYPRE_MEMORY_HOST); info_size = sizeof(hypre_SStructBoxManNborInfo); @@ -777,7 +923,7 @@ hypre_SStructGridAssembleNborBoxManagers( hypre_SStructGrid *grid ) pgrid = hypre_SStructGridPGrid(grid, part); nvars = hypre_SStructPGridNVars(pgrid); - nbor_managers[part] = hypre_TAlloc(hypre_BoxManager *, nvars, HYPRE_MEMORY_HOST); + nbor_managers[part] = hypre_TAlloc(hypre_BoxManager *, nvars, HYPRE_MEMORY_HOST); for (var = 0; var < nvars; var++) { @@ -1036,6 +1182,9 @@ hypre_SStructGridAssembleNborBoxManagers( hypre_SStructGrid *grid ) * "triangle" (given by pi < pj) stores the send information and the lower * triangle stores the receive information. * + * TODO: + * 1) Can we reduce the allocation size of cinfo_a? + * *--------------------------------------------------------------------------*/ HYPRE_Int @@ -1105,16 +1254,16 @@ hypre_SStructGridCreateCommInfo( hypre_SStructGrid *grid ) for (pi = 0; pi < nparts; pi++) { nvars = hypre_SStructPGridNVars(pgrids[pi]); - if ( maxvars < nvars ) + if (maxvars < nvars) { 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 */ - vnbor_ncomms = 0; + /* for each part */ for (pi = 0; pi < nparts; pi++) { @@ -1203,27 +1352,35 @@ hypre_SStructGridCreateCommInfo( hypre_SStructGrid *grid ) HYPRE_Int j_num_boxes = hypre_StructGridNumBoxes( 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); - cdirs = hypre_CTAlloc(hypre_Index, nvneighbors[pi][vi], HYPRE_MEMORY_HOST); + cnum_transforms = hypre_CTAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); + ccoords = hypre_CTAlloc(hypre_Index, nvneighbors[pi][vi], + HYPRE_MEMORY_HOST); + cdirs = hypre_CTAlloc(hypre_Index, nvneighbors[pi][vi], + HYPRE_MEMORY_HOST); - cinfo = hypre_TAlloc(CInfo, 1, HYPRE_MEMORY_HOST); + cinfo = hypre_TAlloc(CInfo, 1, HYPRE_MEMORY_HOST); (cinfo->boxes) = hypre_BoxArrayArrayCreate(i_num_boxes, ndim); (cinfo->rboxes) = hypre_BoxArrayArrayCreate(i_num_boxes, ndim); - (cinfo->procs) = hypre_CTAlloc(HYPRE_Int *, i_num_boxes, HYPRE_MEMORY_HOST); - (cinfo->rboxnums) = hypre_CTAlloc(HYPRE_Int *, i_num_boxes, HYPRE_MEMORY_HOST); - (cinfo->transforms) = hypre_CTAlloc(HYPRE_Int *, i_num_boxes, HYPRE_MEMORY_HOST); + (cinfo->procs) = hypre_CTAlloc(HYPRE_Int *, i_num_boxes, + HYPRE_MEMORY_HOST); + (cinfo->rboxnums) = hypre_CTAlloc(HYPRE_Int *, i_num_boxes, + HYPRE_MEMORY_HOST); + (cinfo->transforms) = hypre_CTAlloc(HYPRE_Int *, i_num_boxes, + HYPRE_MEMORY_HOST); (cinfo->num_transforms) = cnum_transforms; (cinfo->coords) = ccoords; (cinfo->dirs) = cdirs; cinfo_a[cinfoi] = cinfo; - cinfo = hypre_TAlloc(CInfo, 1, HYPRE_MEMORY_HOST); + cinfo = hypre_TAlloc(CInfo, 1, HYPRE_MEMORY_HOST); (cinfo->boxes) = hypre_BoxArrayArrayCreate(j_num_boxes, ndim); (cinfo->rboxes) = hypre_BoxArrayArrayCreate(j_num_boxes, ndim); - (cinfo->procs) = hypre_CTAlloc(HYPRE_Int *, j_num_boxes, HYPRE_MEMORY_HOST); - (cinfo->rboxnums) = hypre_CTAlloc(HYPRE_Int *, j_num_boxes, HYPRE_MEMORY_HOST); - (cinfo->transforms) = hypre_CTAlloc(HYPRE_Int *, j_num_boxes, HYPRE_MEMORY_HOST); + (cinfo->procs) = hypre_CTAlloc(HYPRE_Int *, j_num_boxes, + HYPRE_MEMORY_HOST); + (cinfo->rboxnums) = hypre_CTAlloc(HYPRE_Int *, j_num_boxes, + HYPRE_MEMORY_HOST); + (cinfo->transforms) = hypre_CTAlloc(HYPRE_Int *, j_num_boxes, + HYPRE_MEMORY_HOST); (cinfo->num_transforms) = cnum_transforms; (cinfo->coords) = ccoords; (cinfo->dirs) = cdirs; @@ -1267,11 +1424,11 @@ hypre_SStructGridCreateCommInfo( hypre_SStructGrid *grid ) 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]); @@ -1316,7 +1473,7 @@ hypre_SStructGridCreateCommInfo( hypre_SStructGrid *grid ) } /* end of pi part loop */ /* loop through the upper triangle and create vnbor_comm_info */ - vnbor_comm_info = hypre_TAlloc(hypre_SStructCommInfo *, vnbor_ncomms, HYPRE_MEMORY_HOST); + vnbor_comm_info = hypre_TAlloc(hypre_SStructCommInfo *, vnbor_ncomms, HYPRE_MEMORY_HOST); vnbor_ncomms = 0; for (pi = 0; pi < nparts; pi++) { @@ -1330,7 +1487,7 @@ hypre_SStructGridCreateCommInfo( hypre_SStructGrid *grid ) if (cinfo_a[cinfoi] != NULL) { - comm_info = hypre_TAlloc(hypre_SStructCommInfo, 1, HYPRE_MEMORY_HOST); + comm_info = hypre_TAlloc(hypre_SStructCommInfo, 1, HYPRE_MEMORY_HOST); cinfoj = (((pj) * maxvars + vj) * nparts + pi) * maxvars + vi; send_cinfo = cinfo_a[cinfoi]; @@ -1481,6 +1638,9 @@ hypre_SStructGridFindBoxManEntry( hypre_SStructGrid *grid, } /*-------------------------------------------------------------------------- + * TODO: refactor hypre_SStructGridFindBoxManEntry and + * hypre_SStructGridFindNborBoxManEntry + * into a single function. *--------------------------------------------------------------------------*/ HYPRE_Int @@ -1539,34 +1699,20 @@ hypre_SStructGridBoxProcFindBoxManEntry( hypre_SStructGrid *grid, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_SStructBoxManEntryGetCSRstrides( hypre_BoxManEntry *entry, - hypre_Index strides ) +hypre_SStructBoxManEntryGetCSRstrides( hypre_BoxManEntry *entry, + hypre_Index strides ) { - hypre_SStructBoxManInfo *entry_info; + hypre_SStructBoxManInfo *entry_info; + hypre_SStructBoxManNborInfo *entry_ninfo; hypre_BoxManEntryGetInfo(entry, (void **) &entry_info); - if (hypre_SStructBoxManInfoType(entry_info) == hypre_SSTRUCT_BOXMAN_INFO_DEFAULT) { - HYPRE_Int d, ndim = hypre_BoxManEntryNDim(entry); - hypre_Index imin; - hypre_Index imax; - - hypre_BoxManEntryGetExtents(entry, imin, imax); - - 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]; - } + hypre_BoxManEntryGetStride(entry, strides); } else { - hypre_SStructBoxManNborInfo *entry_ninfo; - entry_ninfo = (hypre_SStructBoxManNborInfo *) entry_info; - hypre_CopyIndex(hypre_SStructBoxManNborInfoStride(entry_ninfo), strides); } @@ -1583,23 +1729,21 @@ HYPRE_Int hypre_SStructBoxManEntryGetGhstrides( hypre_BoxManEntry *entry, hypre_Index strides ) { - hypre_SStructBoxManInfo *entry_info; - HYPRE_Int *numghost; + hypre_SStructBoxManInfo *entry_info; + hypre_SStructBoxManNborInfo *entry_ninfo; - hypre_BoxManEntryGetInfo(entry, (void **) &entry_info); + hypre_Index imin, imax; + HYPRE_Int *numghost; + HYPRE_Int d, ndim; + hypre_BoxManEntryGetInfo(entry, (void **) &entry_info); if (hypre_SStructBoxManInfoType(entry_info) == hypre_SSTRUCT_BOXMAN_INFO_DEFAULT) { - HYPRE_Int d, ndim = hypre_BoxManEntryNDim(entry); - hypre_Index imin; - hypre_Index imax; - + ndim = hypre_BoxManEntryNDim(entry); hypre_BoxManEntryGetExtents(entry, imin, imax); /* getting the ghost from the mapentry to modify imin, imax */ - numghost = hypre_BoxManEntryNumGhost(entry); - for (d = 0; d < ndim; d++) { imax[d] += numghost[2 * d + 1]; @@ -1607,7 +1751,6 @@ hypre_SStructBoxManEntryGetGhstrides( hypre_BoxManEntry *entry, } /* imin, imax modified now and calculation identical. */ - strides[0] = 1; for (d = 1; d < ndim; d++) { @@ -1617,7 +1760,6 @@ hypre_SStructBoxManEntryGetGhstrides( hypre_BoxManEntry *entry, } else { - hypre_SStructBoxManNborInfo *entry_ninfo; /* now get the ghost strides using the macro */ entry_ninfo = (hypre_SStructBoxManNborInfo *) entry_info; hypre_CopyIndex(hypre_SStructBoxManNborInfoGhstride(entry_ninfo), strides); @@ -1937,28 +2079,22 @@ hypre_SStructVarToNborVar( hypre_SStructGrid *grid, HYPRE_Int hypre_SStructGridSetNumGhost( hypre_SStructGrid *grid, HYPRE_Int *num_ghost ) { - HYPRE_Int ndim = hypre_SStructGridNDim(grid); HYPRE_Int nparts = hypre_SStructGridNParts(grid); - HYPRE_Int part, i, t; + HYPRE_Int nvars; + HYPRE_Int part; + HYPRE_Int var; hypre_SStructPGrid *pgrid; hypre_StructGrid *sgrid; - for (i = 0; i < 2 * ndim; i++) - { - hypre_SStructGridNumGhost(grid)[i] = num_ghost[i]; - } - for (part = 0; part < nparts; part++) { pgrid = hypre_SStructGridPGrid(grid, part); + nvars = hypre_SStructPGridNVars(pgrid); - for (t = 0; t < 8; t++) + for (var = 0; var < nvars; var++) { - sgrid = hypre_SStructPGridVTSGrid(pgrid, t); - if (sgrid != NULL) - { - hypre_StructGridSetNumGhost(sgrid, num_ghost); - } + sgrid = hypre_SStructPGridSGrid(pgrid, var); + hypre_StructGridSetNumGhost(sgrid, num_ghost); } } @@ -2045,15 +2181,15 @@ hypre_SStructBoxNumMap(hypre_SStructGrid *grid, 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); + num_boxes = hypre_CTAlloc(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++) { vargrid = hypre_SStructPGridSGrid(pgrid, var); boxes = hypre_StructGridBoxes(vargrid); - temp = hypre_CTAlloc(HYPRE_Int, hypre_BoxArraySize(boxes), HYPRE_MEMORY_HOST); + temp = hypre_CTAlloc(HYPRE_Int, hypre_BoxArraySize(boxes), HYPRE_MEMORY_HOST); /* map cellbox to a variable box */ hypre_CopyBox(cellbox, &vbox); @@ -2079,7 +2215,7 @@ 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 { @@ -2117,8 +2253,8 @@ hypre_SStructCellGridBoxNumMap(hypre_SStructGrid *grid, HYPRE_Int ***num_varboxes_ptr, HYPRE_Int ****map_ptr) { - hypre_SStructPGrid *pgrid = hypre_SStructGridPGrid(grid, part); - hypre_StructGrid *cellgrid = hypre_SStructPGridCellSGrid(pgrid); + hypre_SStructPGrid *pgrid = hypre_SStructGridPGrid(grid, part); + hypre_StructGrid *cellgrid = hypre_SStructPGridCellSGrid(pgrid); hypre_BoxArray *cellboxes = hypre_StructGridBoxes(cellgrid); HYPRE_Int **num_boxes; @@ -2126,10 +2262,9 @@ hypre_SStructCellGridBoxNumMap(hypre_SStructGrid *grid, HYPRE_Int i, ncellboxes; - ncellboxes = hypre_BoxArraySize(cellboxes); - - num_boxes = hypre_TAlloc(HYPRE_Int *, ncellboxes, HYPRE_MEMORY_HOST); - var_boxnums = hypre_TAlloc(HYPRE_Int **, ncellboxes, HYPRE_MEMORY_HOST); + ncellboxes = hypre_BoxArraySize(cellboxes); + num_boxes = hypre_TAlloc(HYPRE_Int *, ncellboxes, HYPRE_MEMORY_HOST); + var_boxnums = hypre_TAlloc(HYPRE_Int **, ncellboxes, HYPRE_MEMORY_HOST); hypre_ForBoxI(i, cellboxes) { @@ -2214,7 +2349,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++) { @@ -2243,6 +2378,210 @@ hypre_SStructGridIntersect( hypre_SStructGrid *grid, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * Save a GLVis mesh file with the given prefix corresponding to the input + * SStruct grid assuming that the cells in each part are the same. The optional + * trans and origin parameters specify the coordinate transformation for each + * part, relative to a square Cartesian grid. + *--------------------------------------------------------------------------*/ +HYPRE_Int +hypre_SStructGridPrintGLVis( hypre_SStructGrid *grid, + const char *meshprefix, + HYPRE_Real *trans, + HYPRE_Real *origin ) +{ + HYPRE_Int ndim = hypre_SStructGridNDim(grid); + HYPRE_Int nparts = hypre_SStructGridNParts(grid); + + hypre_SStructPGrid *pgrid; + hypre_StructGrid *sgrid; + hypre_BoxArray *boxes; + hypre_Box *box; + hypre_Index loop_size; + hypre_Index index; + hypre_Index stride; + + /* GLVis data */ + FILE *file; + char meshfile[255]; + HYPRE_Int cellNV; + HYPRE_Int ncells; + HYPRE_Int nvertices; + HYPRE_Int nelements; + HYPRE_Int element_id = 2 * ndim - 1; + HYPRE_Int use_trans = (trans != NULL && origin != NULL); + HYPRE_Real coords[HYPRE_MAXDIM]; + HYPRE_Int vinc[8][3] = + { + {0, 0, 0}, {1, 0, 0}, + {1, 1, 0}, {0, 1, 0}, + {0, 0, 1}, {1, 0, 1}, + {1, 1, 1}, {0, 1, 1} + }; + + /* Local data */ + char msg[512]; + HYPRE_Int myid; + HYPRE_Int d, dd, i, v, part, vertex; + HYPRE_Real *T, *O; + + /* Initialize some data */ + hypre_MPI_Comm_rank(hypre_SStructGridComm(grid), &myid); + hypre_SetIndex(stride, 1); + switch (ndim) + { + case 2: + cellNV = 4; + break; + + case 3: + cellNV = 8; + break; + + default: + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "SStructGridPrintGLVis works only in 2D/3D.\n"); + return hypre_error_flag; + } + + if (use_trans) + { + T = trans; + O = origin; + } + else + { + T = hypre_CTAlloc(HYPRE_Real, ndim * ndim, HYPRE_MEMORY_HOST); + O = hypre_CTAlloc(HYPRE_Real, ndim, HYPRE_MEMORY_HOST); + for (d = 0; d < ndim; d++) + { + T[ndim * d + d] = 1.0; + } + } + + /* Compute number of elements and vertices */ + nvertices = nelements = 0; + 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); + + ncells = hypre_BoxVolume(box); + nvertices += ncells * cellNV; + nelements += ncells; + } + } + + /* Open mesh file */ + hypre_sprintf(meshfile, "%s.%06d", meshprefix, myid); + if ((file = fopen(meshfile, "w")) == NULL) + { + hypre_sprintf(msg, "Error: can't open output file %s\n", meshfile); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, msg); + return hypre_error_flag; + } + + /* Write mesh header */ + hypre_fprintf(file, "MFEM mesh v1.0\n"); + hypre_fprintf(file, "\ndimension\n"); + hypre_fprintf(file, "%d\n", ndim); + + /* Write mesh elements */ + hypre_fprintf(file, "\nelements\n"); + hypre_fprintf(file, "%d\n", nelements); + vertex = 0; + 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_BoxGetSize(box, loop_size); + hypre_SerialBoxLoop0Begin(ndim, loop_size); + { + hypre_fprintf(file, "1 %d ", element_id); + for (v = 0; v < cellNV; v++, vertex++) + { + hypre_fprintf(file, "%d ", vertex); + } + hypre_fprintf(file, "\n"); + } + hypre_SerialBoxLoop0End() + } + } + + /* boundary will be generated by GLVis */ + hypre_fprintf(file, "\nboundary\n"); + hypre_fprintf(file, "0\n"); + + /* mesh vertices */ + hypre_fprintf(file, "\nvertices\n"); + hypre_fprintf(file, "%d\n", nvertices); + hypre_fprintf(file, "%d\n", ndim); + 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_BoxGetSize(box, loop_size); + hypre_SerialBoxLoop0Begin(ndim, loop_size); + { + zypre_BoxLoopGetIndex(index); + hypre_AddIndexes(index, hypre_BoxIMin(box), ndim, index); + + for (v = 0; v < cellNV; v++) + { + for (d = 0; d < ndim; d++) + { + coords[d] = O[d]; + for (dd = 0; dd < ndim; dd++) + { + coords[d] += T[d * ndim + dd] * (index[dd] + vinc[v][dd]); + } + hypre_fprintf(file, "%.14e ", coords[d]); + } + hypre_fprintf(file, "\n"); + } + } + hypre_SerialBoxLoop0End() + } + hypre_fprintf(file, "\n"); + + if (use_trans) + { + T += ndim * ndim; + O += ndim; + } + } + + /* Close file */ + fflush(file); + fclose(file); + + /* Free memory */ + if (!use_trans) + { + hypre_TFree(T, HYPRE_MEMORY_HOST); + hypre_TFree(O, HYPRE_MEMORY_HOST); + } + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -2343,7 +2682,9 @@ hypre_SStructGridPrint( FILE *file, hypre_fprintf(file, "\n"); /* Print ghost info */ - num_ghost = hypre_SStructGridNumGhost(grid); + pgrid = hypre_SStructGridPGrid(grid, 0); + sgrid = hypre_SStructPGridSGrid(pgrid, 0); + num_ghost = hypre_StructGridNumGhost(sgrid); hypre_fprintf(file, "GridSetNumGhost:"); for (i = 0; i < 2 * ndim; i++) { @@ -2397,8 +2738,6 @@ hypre_SStructGridPrint( FILE *file, } /*-------------------------------------------------------------------------- - * hypre_SStructGridRead - * * This function reads a semi-structured grid from file. This is used mainly * for debugging purposes. *--------------------------------------------------------------------------*/ @@ -2423,35 +2762,31 @@ hypre_SStructGridRead( MPI_Comm comm, HYPRE_Int b, d, i, j; HYPRE_Int part; HYPRE_Int nparts, nvars; - HYPRE_Int nboxes; - HYPRE_Int *nboxes_array; + HYPRE_Int num_boxes; + HYPRE_Int num_boxes_total; 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 */ + num_boxes_total = 0; for (i = 0; i < nparts; i++) { - hypre_fscanf(file, "GridNumBoxes: %d %d\n", &part, &nboxes); - nboxes_array[part] = nboxes; + hypre_fscanf(file, "GridNumBoxes: %d %d\n", &part, &num_boxes); + num_boxes_total += num_boxes; } hypre_fscanf(file, "\n"); /* Read boxes per part */ - for (i = 0; i < nparts; i++) + for (i = 0; i < num_boxes_total; 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, "\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"); @@ -2532,10 +2867,139 @@ hypre_SStructGridRead( MPI_Comm comm, HYPRE_SStructGridAssemble(grid); /* Free memory */ - hypre_TFree(nboxes_array, HYPRE_MEMORY_HOST); hypre_BoxDestroy(box); *grid_ptr = grid; return hypre_error_flag; } + +/*-------------------------------------------------------------------------- + * This functions coarsens a SStructGrid. + * + * For now, it assumes that all StructGrids share the same origin + * + * TODO: + * 1) How to deal with neighbors? + * How to make the calls to SetNeighborPart or SetSharedPart? + * 2) Set FEM data with call to HYPRE_SStructGridSetFEMOrdering + * 3) Extend to multiple variables (some pieces of code already done) + * 4) Do we really need the call to SStructPGridCellSGridDone? + * *** 5) Are we dealing correctly with parts that have no boxes left for coarsening ? + * 6) Replace HYPRE_SS calls to only what we really need from them (?) + *--------------------------------------------------------------------------*/ +HYPRE_Int +hypre_SStructGridCoarsen( hypre_SStructGrid *fgrid, + hypre_IndexRef origin, + hypre_Index *strides, // coarsening factor for each part + hypre_Index *periodic, // periodic data for each part + hypre_SStructGrid **cgrid_ptr ) +{ + HYPRE_UNUSED_VAR(periodic); + + MPI_Comm comm = hypre_SStructGridComm(fgrid); + HYPRE_Int ndim = hypre_SStructGridNDim(fgrid); + HYPRE_Int nparts = hypre_SStructGridNParts(fgrid); + + hypre_SStructGrid *cgrid; + hypre_SStructPGrid *pfgrid; + hypre_SStructPGrid *pcgrid; + hypre_StructGrid *sfgrid; + hypre_StructGrid *scgrid; + hypre_BoxArrayArray *fpbnd_boxaa; + hypre_BoxArrayArray *cpbnd_boxaa; + + hypre_SStructVariable *vartypes; + HYPRE_Int part, var, nvars; + + /* Create coarse SStructGrid */ + HYPRE_SStructGridCreate(comm, ndim, nparts, &cgrid); + + for (part = 0; part < nparts; part++) + { + pfgrid = hypre_SStructGridPGrid(fgrid, part); + pcgrid = hypre_SStructGridPGrid(cgrid, part); + nvars = hypre_SStructPGridNVars(pfgrid); + vartypes = hypre_SStructPGridVarTypes(pfgrid); + + HYPRE_SStructGridSetVariables(cgrid, part, nvars, vartypes); + + for (var = 0; var < nvars; var++) + { + sfgrid = hypre_SStructPGridSGrid(pfgrid, var); + scgrid = hypre_SStructPGridSGrid(pcgrid, var); + hypre_StructGridDestroy(scgrid); + + hypre_StructCoarsen(sfgrid, origin, strides[part], 1, &scgrid); + hypre_SStructPGridSGrid(pcgrid, var) = scgrid; + + /* coarsen part boundary box array */ + if (hypre_StructGridNumBoxes(scgrid)) + { + fpbnd_boxaa = hypre_SStructPGridPBndBoxArrayArray(pfgrid, var); + hypre_CoarsenBoxArrayArrayOutward(fpbnd_boxaa, + hypre_StructGridBoxes(scgrid), + origin, strides[part], &cpbnd_boxaa); + hypre_SStructPGridPBndBoxArrayArray(pcgrid, var) = cpbnd_boxaa; + } + } + + /* TODO: Set periodic data */ + //HYPRE_SStructGridSetPeriodic(cgrid, part, periodic[part]); + + /* TODO: Coarsen neighboring data */ + } + + /* Assemble coarse SStructGrid */ + HYPRE_SStructGridAssemble(cgrid); + + /* Set pointer to coarse SStructGrid */ + *cgrid_ptr = cgrid; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructGridSetActiveParts( hypre_SStructGrid *grid, + HYPRE_Int *active ) +{ + HYPRE_Int nparts = hypre_SStructGridNParts(grid); + hypre_SStructPGrid *pgrid; + HYPRE_Int part, var; + + for (part = 0; part < nparts; part++) + { + pgrid = hypre_SStructGridPGrid(grid, part); + for (var = 0; var < 8; var++) + { + hypre_SStructPGridVTActive(pgrid, var) = active[part]; + } + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructGridSetAllPartsActive( hypre_SStructGrid *grid ) +{ + HYPRE_Int nparts = hypre_SStructGridNParts(grid); + hypre_SStructPGrid *pgrid; + HYPRE_Int part, var; + + for (part = 0; part < nparts; part++) + { + pgrid = hypre_SStructGridPGrid(grid, part); + for (var = 0; var < 8; var++) + { + hypre_SStructPGridVTActive(pgrid, var) = 1; + } + } + + return hypre_error_flag; +} diff --git a/src/sstruct_mv/sstruct_grid.h b/src/sstruct_mv/sstruct_grid.h index e1a9f6d0a6..e0a4aab7dd 100644 --- a/src/sstruct_mv/sstruct_grid.h +++ b/src/sstruct_mv/sstruct_grid.h @@ -49,20 +49,30 @@ typedef struct HYPRE_SStructVariable *vartypes; /* types of variables */ hypre_StructGrid *sgrids[8]; /* struct grids for each vartype */ hypre_BoxArray *iboxarrays[8]; /* interface boxes */ - + hypre_BoxArrayArray *pbnd_boxaa[8]; /* arrays of box arrays for part boundaries + each BoxArrayArray entry has size equal to + the number of boxes in a sgrid */ + HYPRE_Int active[8]; /* flag indicating if grid is active for mat/vec + operations purposes */ hypre_BoxArray *pneighbors; hypre_Index *pnbor_offsets; HYPRE_Int local_size; /* Number of variables locally */ HYPRE_BigInt global_size; /* Total number of variables */ + HYPRE_Int ref_count; + hypre_Index periodic; /* Indicates if pgrid is periodic */ /* GEC0902 additions for ghost expansion of boxes */ - + // TODO: deprecate ghlocal_size HYPRE_Int ghlocal_size; /* Number of vars including ghosts */ - HYPRE_Int cell_sgrid_done; /* =1 implies cell grid already assembled */ + + /* Geometrical data */ + HYPRE_Real coords_origin[HYPRE_MAXDIM]; /* Origin coordinates */ + hypre_Index coords_stride; + } hypre_SStructPGrid; typedef struct @@ -83,9 +93,9 @@ enum hypre_SStructBoxManInfoType typedef struct { - HYPRE_Int type; - HYPRE_BigInt offset; - HYPRE_BigInt ghoffset; + HYPRE_Int type; + HYPRE_BigInt offset; + HYPRE_BigInt ghoffset; } hypre_SStructBoxManInfo; @@ -156,10 +166,9 @@ typedef struct hypre_SStructGrid_struct HYPRE_Int ref_count; /* GEC0902 additions for ghost expansion of boxes */ - + // TODO: deprecate these ones. SStructMatrix should hold these data instead 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_SStructGrid; @@ -202,7 +211,6 @@ typedef struct hypre_SStructGrid_struct #define hypre_SStructGridRefCount(grid) ((grid) -> ref_count) #define hypre_SStructGridGhlocalSize(grid) ((grid) -> ghlocal_size) #define hypre_SStructGridGhstartRank(grid) ((grid) -> ghstart_rank) -#define hypre_SStructGridNumGhost(grid) ((grid) -> num_ghost) /*-------------------------------------------------------------------------- * Accessor macros: hypre_SStructPGrid @@ -214,6 +222,8 @@ typedef struct hypre_SStructGrid_struct #define hypre_SStructPGridVarTypes(pgrid) ((pgrid) -> vartypes) #define hypre_SStructPGridVarType(pgrid, var) ((pgrid) -> vartypes[var]) #define hypre_SStructPGridCellSGridDone(pgrid) ((pgrid) -> cell_sgrid_done) +#define hypre_SStructPGridCoordsOrigin(pgrid) ((pgrid) -> coords_origin) +#define hypre_SStructPGridCoordsStride(pgrid) ((pgrid) -> coords_stride) #define hypre_SStructPGridSGrids(pgrid) ((pgrid) -> sgrids) #define hypre_SStructPGridSGrid(pgrid, var) \ @@ -229,11 +239,20 @@ typedef struct hypre_SStructGrid_struct ((pgrid) -> iboxarrays[HYPRE_SSTRUCT_VARIABLE_CELL]) #define hypre_SStructPGridVTIBoxArray(pgrid, vartype) \ ((pgrid) -> iboxarrays[vartype]) - +#define hypre_SStructPGridPBndBoxArrayArrays(pgrid) ((pgrid) -> pbnd_boxaa) +#define hypre_SStructPGridPBndBoxArrayArray(pgrid, var) \ +((pgrid) -> pbnd_boxaa[hypre_SStructPGridVarType(pgrid, var)]) +#define hypre_SStructPGridVTPBndBoxArrayArray(pgrid, vartype) \ +((pgrid) -> pbnd_boxaa[vartype]) + +#define hypre_SStructPGridActive(pgrid, var) \ +((pgrid) -> active[hypre_SStructPGridVarType(pgrid, var)]) +#define hypre_SStructPGridVTActive(pgrid, vart) ((pgrid) -> active[vart]) #define hypre_SStructPGridPNeighbors(pgrid) ((pgrid) -> pneighbors) #define hypre_SStructPGridPNborOffsets(pgrid) ((pgrid) -> pnbor_offsets) #define hypre_SStructPGridLocalSize(pgrid) ((pgrid) -> local_size) #define hypre_SStructPGridGlobalSize(pgrid) ((pgrid) -> global_size) +#define hypre_SStructPGridRefCount(pgrid) ((pgrid) -> ref_count) #define hypre_SStructPGridPeriodic(pgrid) ((pgrid) -> periodic) #define hypre_SStructPGridGhlocalSize(pgrid) ((pgrid) -> ghlocal_size) @@ -292,4 +311,3 @@ typedef struct hypre_SStructGrid_struct #define hypre_SStructUCVarProc(uc, i) ((uc) -> uvars[i].proc) #endif - diff --git a/src/sstruct_mv/sstruct_innerprod.c b/src/sstruct_mv/sstruct_innerprod.c index 56b3040ad0..f131e860c4 100644 --- a/src/sstruct_mv/sstruct_innerprod.c +++ b/src/sstruct_mv/sstruct_innerprod.c @@ -14,13 +14,33 @@ #include "_hypre_sstruct_mv.h" /*-------------------------------------------------------------------------- - * hypre_SStructPInnerProd *--------------------------------------------------------------------------*/ HYPRE_Int hypre_SStructPInnerProd( hypre_SStructPVector *px, hypre_SStructPVector *py, HYPRE_Real *presult_ptr ) +{ + HYPRE_Real local_result; + HYPRE_Real global_result; + + hypre_SStructPInnerProdLocal(px, py, &local_result); + hypre_MPI_Allreduce(&local_result, &global_result, 1, + HYPRE_MPI_REAL, hypre_MPI_SUM, + hypre_SStructPVectorComm(px)); + + *presult_ptr = global_result; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPInnerProdLocal( hypre_SStructPVector *px, + hypre_SStructPVector *py, + HYPRE_Real *presult_ptr ) { HYPRE_Int nvars = hypre_SStructPVectorNVars(px); HYPRE_Real presult; @@ -30,8 +50,8 @@ hypre_SStructPInnerProd( hypre_SStructPVector *px, presult = 0.0; for (var = 0; var < nvars; var++) { - sresult = hypre_StructInnerProd(hypre_SStructPVectorSVector(px, var), - hypre_SStructPVectorSVector(py, var)); + sresult = hypre_StructInnerProdLocal(hypre_SStructPVectorSVector(px, var), + hypre_SStructPVectorSVector(py, var)); presult += sresult; } @@ -41,7 +61,6 @@ hypre_SStructPInnerProd( hypre_SStructPVector *px, } /*-------------------------------------------------------------------------- - * hypre_SStructInnerProd *--------------------------------------------------------------------------*/ HYPRE_Int @@ -50,7 +69,8 @@ hypre_SStructInnerProd( hypre_SStructVector *x, HYPRE_Real *result_ptr ) { HYPRE_Int nparts = hypre_SStructVectorNParts(x); - HYPRE_Real result; + HYPRE_Real local_result; + HYPRE_Real result = 0.0; HYPRE_Real presult; HYPRE_Int part; @@ -64,16 +84,20 @@ hypre_SStructInnerProd( hypre_SStructVector *x, return hypre_error_flag; } - result = 0.0; - if ( (x_object_type == HYPRE_SSTRUCT) || (x_object_type == HYPRE_STRUCT) ) { + local_result = 0.0; for (part = 0; part < nparts; part++) { - hypre_SStructPInnerProd(hypre_SStructVectorPVector(x, part), - hypre_SStructVectorPVector(y, part), &presult); - result += presult; + hypre_SStructPInnerProdLocal(hypre_SStructVectorPVector(x, part), + hypre_SStructVectorPVector(y, part), + &presult); + local_result += presult; } + + hypre_MPI_Allreduce(&local_result, &result, 1, + HYPRE_MPI_REAL, hypre_MPI_SUM, + hypre_SStructVectorComm(x)); } else if (x_object_type == HYPRE_PARCSR) diff --git a/src/sstruct_mv/sstruct_matmult.c b/src/sstruct_mv/sstruct_matmult.c new file mode 100644 index 0000000000..840752c59b --- /dev/null +++ b/src/sstruct_mv/sstruct_matmult.c @@ -0,0 +1,1455 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_sstruct_mv.h" +#include "sstruct_matmult.h" + +//#define DEBUG_MATMULT + +/*========================================================================== + * SStructPMatrix matrix-multiply routines + * + * The pmatrix (SStructPMatrix) contains an nvars x nvars array of struct + * (StructMatrix) matrices. The multiply is then a block-matrix multiply + * involving these struct matrices. + * + * NOTE: This only works for cell-centered variable types (see below comment). + * This is also restricted to cases where there is only one struct matrix term + * to compute M_ij of the pmatrix M. + * + * RDF: The struct matmult requires a common base grid, but the base grid in a + * pmatrix will differ depending on the variable types involved (see the sgrids + * construction in SStructPGridAssemble). Need to figure out how to handle this + * (note that the "Engwer trick" would be a good solution and also minimizes the + * box manager requirements). Another note: Stencil entries are currently split + * such that inter-variable-type couplings are put in the unstructured matrix. + * Hence, with the exception of the above term size restriction, this could be + * made to work in general. We ultimately want to have all of the structured + * stencil entries to go in the pmatrix, of course. + *==========================================================================*/ + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatmultCreate(HYPRE_Int nmatrices_input, + hypre_SStructPMatrix **pmatrices_input, + HYPRE_Int nterms, + HYPRE_Int *terms_input, + HYPRE_Int *trans_input, + hypre_SStructPMatmultData **pmmdata_ptr) +{ + hypre_SStructPMatmultData *pmmdata; + hypre_StructMatmultData *smmdata; + HYPRE_Int ***smmid; + HYPRE_Int **smmsz; + + hypre_SStructPMatrix **pmatrices; + hypre_StructMatrix **smatrices; + HYPRE_Int *sterms; + + HYPRE_Int *terms; + HYPRE_Int *trans; + HYPRE_Int *matmap; + HYPRE_Int nmatrices; + HYPRE_Int nvars; + HYPRE_Int max_matmults, max_matrices; + HYPRE_Int m, t, vi, vj; + + HYPRE_Int *i, *n, k, nn, ii; /* Nested for-loop variables */ + HYPRE_Int zero_product; + + pmmdata = hypre_CTAlloc(hypre_SStructPMatmultData, 1, HYPRE_MEMORY_HOST); + + /* Create new matrices and terms arrays from the input arguments, because we + * only want to consider those matrices actually involved in the multiply */ + matmap = hypre_CTAlloc(HYPRE_Int, nmatrices_input, HYPRE_MEMORY_HOST); + for (t = 0; t < nterms; t++) + { + m = terms_input[t]; + matmap[m] = 1; + } + nmatrices = 0; + for (m = 0; m < nmatrices_input; m++) + { + if (matmap[m]) + { + matmap[m] = nmatrices; + nmatrices++; + } + } + pmatrices = hypre_CTAlloc(hypre_SStructPMatrix *, nmatrices, HYPRE_MEMORY_HOST); + terms = hypre_CTAlloc(HYPRE_Int, nterms, HYPRE_MEMORY_HOST); + trans = hypre_CTAlloc(HYPRE_Int, nterms, HYPRE_MEMORY_HOST); + for (t = 0; t < nterms; t++) + { + m = terms_input[t]; + pmatrices[matmap[m]] = pmatrices_input[m]; + terms[t] = matmap[m]; + trans[t] = trans_input[t]; + } + hypre_TFree(matmap, HYPRE_MEMORY_HOST); + + /* Set nvars */ + nvars = hypre_SStructPMatrixNVars(pmatrices[0]); + (pmmdata -> nvars) = nvars; + + /* This mimics the following nested for-loop (similar to BoxLoop) to compute + * the all-at-once PMatrix product M = A1 * A2 * ... * AN, where N = nterms: + * + * for i ... + * { + * for j ... + * { + * M_ij = 0 + * for k1 ... + * for k2 ... + * ... + * for km ... // where m = N-1 + * { + * M_ij += A1_{i,k1} * A2_{k1,k2} * ... * AN_{km,j} + * } + * } + * } + * + */ + + i = hypre_CTAlloc(HYPRE_Int, (nterms + 1), HYPRE_MEMORY_HOST); + n = hypre_CTAlloc(HYPRE_Int, (nterms + 1), HYPRE_MEMORY_HOST); + + /* In general, we need to have the same number of matrices as terms */ + smatrices = hypre_CTAlloc(hypre_StructMatrix *, nterms, HYPRE_MEMORY_HOST); + sterms = hypre_CTAlloc(HYPRE_Int, nterms, HYPRE_MEMORY_HOST); + for (k = 0; k < nterms; k++) + { + sterms[k] = k; + } + + max_matmults = (HYPRE_Int) hypre_pow(nvars, (nterms + 1)); + max_matrices = nterms * nvars * nvars; + hypre_StructMatmultCreate(max_matmults, max_matrices, &smmdata); + smmid = hypre_TAlloc(HYPRE_Int **, nvars, HYPRE_MEMORY_HOST); + smmsz = hypre_TAlloc(HYPRE_Int *, nvars, HYPRE_MEMORY_HOST); + for (vi = 0; vi < nvars; vi++) + { + smmid[vi] = hypre_TAlloc(HYPRE_Int *, nvars, HYPRE_MEMORY_HOST); + smmsz[vi] = hypre_TAlloc(HYPRE_Int, nvars, HYPRE_MEMORY_HOST); + for (vj = 0; vj < nvars; vj++) + { + /* Initialize loop variables */ + nn = 1; + for (k = 1; k < nterms; k++) + { + nn *= nvars; + i[k] = 0; + n[k] = nvars - 2; /* offsetting by 2 produces a simpler comparison below */ + } + i[0] = vi; + i[nterms] = vj; + n[nterms] = nvars; /* This ensures that the below loop-index update terminates */ + + /* Initialize the array entries to NULL */ + smmid[vi][vj] = hypre_CTAlloc(HYPRE_Int, nn, HYPRE_MEMORY_HOST); + smmsz[vi][vj] = 0; + /* Run through the nested for-loop */ + for (ii = 0; ii < nn; ii++) + { + /* M_ij += A1_{i,k1} * A2_{k1,k2} * ... * AN_{km,j} */ + + zero_product = 0; + for (k = 0; k < nterms; k++) + { + /* If (trans[k] > 0), use the transpose matrix (reverse the indices) */ + smatrices[k] = hypre_SStructPMatrixSMatrix(pmatrices[terms[k]], + trans[k] ? i[k + 1] : i[k], + trans[k] ? i[k] : i[k + 1]); + if (smatrices[k] == NULL) + { + zero_product = 1; + break; + } + } + if (!zero_product) + { + hypre_StructMatmultSetProduct(smmdata, nterms, smatrices, nterms, sterms, trans, + &smmid[vi][vj][smmsz[vi][vj]]); + smmsz[vi][vj]++; + } + + /* Update loop indices */ + for (k = 1; i[k] > n[k]; k++) + { + i[k] = 0; + } + i[k]++; + } + } + } + hypre_TFree(i, HYPRE_MEMORY_HOST); + hypre_TFree(n, HYPRE_MEMORY_HOST); + hypre_TFree(smatrices, HYPRE_MEMORY_HOST); + hypre_TFree(sterms, HYPRE_MEMORY_HOST); + + /* Set SStructPMatmultData object */ + (pmmdata -> smmdata) = smmdata; + (pmmdata -> smmid) = smmid; + (pmmdata -> smmsz) = smmsz; + (pmmdata -> nmatrices) = nmatrices; + (pmmdata -> pmatrices) = pmatrices; + (pmmdata -> nterms) = nterms; + (pmmdata -> terms) = terms; + (pmmdata -> transposes) = trans; + (pmmdata -> comm_pkg) = NULL; + (pmmdata -> comm_data) = NULL; + + *pmmdata_ptr = pmmdata; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Destroys an object of type hypre_SStructPMatmultData + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatmultDestroy( hypre_SStructPMatmultData *pmmdata ) +{ + HYPRE_Int vi, vj, nvars; + + if (pmmdata) + { + hypre_StructMatmultDestroy(pmmdata -> smmdata); + nvars = (pmmdata -> nvars); + for (vi = 0; vi < nvars; vi++) + { + for (vj = 0; vj < nvars; vj++) + { + hypre_TFree(pmmdata -> smmid[vi][vj], HYPRE_MEMORY_HOST); + } + hypre_TFree(pmmdata -> smmid[vi], HYPRE_MEMORY_HOST); + hypre_TFree(pmmdata -> smmsz[vi], HYPRE_MEMORY_HOST); + } + hypre_TFree(pmmdata -> smmid, HYPRE_MEMORY_HOST); + hypre_TFree(pmmdata -> smmsz, HYPRE_MEMORY_HOST); + + hypre_TFree(pmmdata -> pmatrices, HYPRE_MEMORY_HOST); + hypre_TFree(pmmdata -> transposes, HYPRE_MEMORY_HOST); + hypre_TFree(pmmdata -> terms, HYPRE_MEMORY_HOST); + + hypre_TFree(pmmdata, HYPRE_MEMORY_HOST); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatmultInitialize( hypre_SStructPMatmultData *pmmdata, + HYPRE_Int assemble_grid, + hypre_SStructPMatrix **pM_ptr ) +{ + hypre_StructMatmultData *smmdata = (pmmdata -> smmdata); + HYPRE_Int ***smmid = (pmmdata -> smmid); + HYPRE_Int **smmsz = (pmmdata -> smmsz); + HYPRE_Int nvars = (pmmdata -> nvars); + hypre_SStructPMatrix *pmatrix = pmmdata -> pmatrices[0]; + + MPI_Comm comm; + HYPRE_Int ndim; + hypre_StructStencil *stencil; + hypre_Index *offset; + + hypre_BoxArrayArray *fpbnd_boxaa; + hypre_BoxArrayArray *cpbnd_boxaa; + hypre_Index origin; + hypre_IndexRef coarsen_stride; + HYPRE_Int coarsen; + HYPRE_Int num_boxes; + hypre_BoxArray *grid_boxes; + + HYPRE_SStructVariable *vartypes; + hypre_SStructStencil **pstencils; + hypre_SStructPGrid *pgrid; + hypre_SStructPGrid *pfgrid; + hypre_SStructPMatrix *pM; + hypre_StructMatrix *sM; + hypre_StructGrid *sgrid; + HYPRE_Int **smaps; + HYPRE_Int *sentries; + + HYPRE_Int vi, vj, e, cnt, k; + HYPRE_Int pstencil_size; + HYPRE_Int max_stencil_size; + + /* Initialize variables */ + ndim = hypre_SStructPMatrixNDim(pmatrix); + comm = hypre_SStructPMatrixComm(pmatrix); + pfgrid = hypre_SStructPMatrixPGrid(pmatrix); /* Same grid for all input matrices */ + vartypes = hypre_SStructPGridVarTypes(pfgrid); + hypre_SetIndex(origin, 0); + + /* Check: This currently only works for cell-centered variable types */ + for (vi = 0; vi < nvars; vi++) + { + if (vartypes[vi] != HYPRE_SSTRUCT_VARIABLE_CELL) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "SStructPMatmult currently supports only cell variable types\n"); + return hypre_error_flag; + } + } + + /* Create temporary semi-struct stencil data structure */ + pstencils = hypre_TAlloc(hypre_SStructStencil *, nvars, HYPRE_MEMORY_HOST); + for (vi = 0; vi < nvars; vi++) + { + HYPRE_SStructStencilCreate(ndim, 0, &pstencils[vi]); + } + + /* Create part grid data structure */ + hypre_SStructPGridCreate(comm, ndim, &pgrid); + hypre_SStructPGridSetVariables(pgrid, nvars, vartypes); + /* RDF: Need to figure out how to handle the cell grid (see 'RDF' below also) */ + hypre_StructGridDestroy(hypre_SStructPGridCellSGrid(pgrid)); + hypre_SStructPGridCellSGrid(pgrid) = NULL; + + /* Create part matrix data structure */ + hypre_SStructPMatrixCreate(comm, pgrid, pstencils, &pM); + smaps = hypre_SStructPMatrixSMaps(pM); + + /* Initialize the struct matmults for this part */ + /* RDF NOTE: This does not assemble the struct grids. They are assembled + * below or in HYPRE_SStructGridAssemble() to reduce box manager overhead. + * Check: The struct 'assemble_grid' feature may not be needed anymore. */ + hypre_StructMatmultInitialize(smmdata, 0); + + /* Setup part matrix data structure */ + max_stencil_size = 0; + for (vi = 0; vi < nvars; vi++) + { + pstencil_size = 0; + coarsen = 0; + coarsen_stride = NULL; + for (vj = 0; vj < nvars; vj++) + { + /* This currently only works if smmsz[vi][vj] <= 1. That is, either + * M_ij = 0 or M_ij = A1_{vi,k1} * A2_{k1,k2} * ... * AN_{km,vj} (only + * one product in the sum). TODO: Need to write a matrix sum routine + * and extend this to work in general. */ + if (smmsz[vi][vj] > 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "SStructPMatmult currently supports only one StructMatmult term\n"); + return hypre_error_flag; + } + + if (smmsz[vi][vj] > 0) + { + hypre_StructMatrix **smatrices; + + /* Destroy the default struct matrix for the (vi,vj)-block of the PMatrix */ + sM = hypre_SStructPMatrixSMatrix(pM, vi, vj); + hypre_StructMatrixDestroy(sM); + + /* Replace the default struct matrix for the (vi,vj)-block of the PMatrix */ + smatrices = hypre_CTAlloc(hypre_StructMatrix *, smmsz[vi][vj], HYPRE_MEMORY_HOST); + for (k = 0; k < smmsz[vi][vj]; k++) + { + hypre_StructMatmultGetMatrix(smmdata, smmid[vi][vj][k], &smatrices[k]); + } + hypre_StructMatrixAddInit(smmsz[vi][vj], smatrices, &sM); + hypre_SStructPMatrixSMatrix(pM, vi, vj) = sM; + hypre_TFree(smatrices, HYPRE_MEMORY_HOST); + + /* Replace the struct stencil for the (vi,vj)-block with actual stencils */ + stencil = hypre_StructMatrixStencil(sM); + hypre_SStructPMatrixSStencil(pM, vi, vj) = hypre_StructStencilRef(stencil); + + /* Update the part stencil size */ + pstencil_size += hypre_StructStencilSize(stencil); + + /* Set up the struct grids for the part */ + /* RDF: This may only work when there is a cell variable type. We need to + * either construct a cell grid from the struct matmult grids somehow, or + * do something entirely different. */ + if (hypre_SStructPGridSGrid(pgrid, vi) == NULL) + { + /* Set a reference to the grid in sM */ + sgrid = hypre_StructMatrixGrid(sM); + hypre_StructGridRef(sgrid, &hypre_SStructPGridSGrid(pgrid, vi)); + + /* Set periodic based on struct grid (which could be coarsened) */ + hypre_CopyIndex(hypre_StructGridPeriodic(sgrid), hypre_SStructPGridPeriodic(pgrid)); + + /* Build part boundaries array */ + num_boxes = hypre_StructGridNumBoxes(sgrid); + grid_boxes = hypre_StructGridBoxes(sgrid); + fpbnd_boxaa = hypre_SStructPGridPBndBoxArrayArray(pfgrid, vi); + if (num_boxes) + { + coarsen = (smmdata -> coarsen); + if (coarsen) + { + coarsen_stride = (smmdata -> coarsen_stride); + hypre_CoarsenBoxArrayArrayOutward(fpbnd_boxaa, grid_boxes, origin, + coarsen_stride, &cpbnd_boxaa); + } + else + { + cpbnd_boxaa = hypre_BoxArrayArrayClone(fpbnd_boxaa); + } + hypre_SStructPGridPBndBoxArrayArray(pgrid, vi) = cpbnd_boxaa; + } + } + } + } + max_stencil_size = hypre_max(pstencil_size, max_stencil_size); + + /* Update smaps array */ + smaps[vi] = hypre_TReAlloc(smaps[vi], HYPRE_Int, pstencil_size, HYPRE_MEMORY_HOST); + + /* Destroy placeholder semi-struct stencil and update with actual one */ + HYPRE_SStructStencilDestroy(pstencils[vi]); + HYPRE_SStructStencilCreate(ndim, pstencil_size, &pstencils[vi]); + cnt = 0; + for (vj = 0; vj < nvars; vj++) + { + sM = hypre_SStructPMatrixSMatrix(pM, vi, vj); + if (sM) + { + stencil = hypre_StructMatrixStencil(sM); + offset = hypre_StructStencilShape(stencil); + for (e = 0; e < hypre_StructStencilSize(stencil); e++) + { + HYPRE_SStructStencilSetEntry(pstencils[vi], cnt++, offset[e], vj); + smaps[vi][e] = e; + } + } + } + } + + /* Update sentries array */ + hypre_TFree(hypre_SStructPMatrixSEntries(pM), HYPRE_MEMORY_HOST); + sentries = hypre_TAlloc(HYPRE_Int, max_stencil_size, HYPRE_MEMORY_HOST); + hypre_SStructPMatrixSEntries(pM) = sentries; + hypre_SStructPMatrixSEntriesSize(pM) = max_stencil_size; + + if (assemble_grid) + { + hypre_SStructPGridAssemble(pgrid); + } + hypre_SStructPGridDestroy(pgrid); /* The grid will remain in the pM matrix */ + + /* Point to resulting matrix */ + *pM_ptr = pM; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatmultCommSetup( hypre_SStructPMatmultData *pmmdata ) +{ + hypre_StructMatmultData *smmdata = (pmmdata -> smmdata); + + HYPRE_ANNOTATE_FUNC_BEGIN; + + hypre_StructMatmultCommSetup(smmdata); + (pmmdata -> comm_pkg) = (smmdata -> comm_pkg); + (pmmdata -> comm_data) = (smmdata -> comm_data); + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_SStructPMatmultCommunicate( hypre_SStructPMatmultData *pmmdata ) +{ + hypre_StructMatmultData *smmdata = (pmmdata -> smmdata); + + HYPRE_ANNOTATE_FUNC_BEGIN; + + hypre_SStructPMatmultCommSetup(pmmdata); + hypre_StructMatmultCommunicate(smmdata); + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatmultCompute( hypre_SStructPMatmultData *pmmdata, + hypre_SStructPMatrix *pM ) +{ + hypre_StructMatmultData *smmdata = (pmmdata -> smmdata); + HYPRE_Int ***smmid = (pmmdata -> smmid); + HYPRE_Int **smmsz = (pmmdata -> smmsz); + HYPRE_Int nvars = (pmmdata -> nvars); + + hypre_StructMatrix *sM, *sMk; + HYPRE_Int vi, vj, k; + + for (vi = 0; vi < nvars; vi++) + { + for (vj = 0; vj < nvars; vj++) + { + /* This computes the coefficients of the (vi,vj)-block of the PMatrix */ + sM = hypre_SStructPMatrixSMatrix(pM, vi, vj); + for (k = 0; k < smmsz[vi][vj]; k++) + { + hypre_StructMatmultCompute(smmdata, smmid[vi][vj][k]); + hypre_StructMatmultGetMatrix(smmdata, smmid[vi][vj][k], &sMk); + hypre_StructMatrixAddMat(sM, 1.0, sMk); /* Compute sM += alpha * sMk */ + hypre_StructMatrixDestroy(sMk); + } + } + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Computes the product of several SStructPMatrix matrices + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatmult(HYPRE_Int nmatrices, + hypre_SStructPMatrix **matrices, + HYPRE_Int nterms, + HYPRE_Int *terms, + HYPRE_Int *trans, + hypre_SStructPMatrix **M_ptr ) +{ + hypre_SStructPMatmultData *mmdata; + + hypre_SStructPMatmultCreate(nmatrices, matrices, nterms, terms, trans, &mmdata); + hypre_SStructPMatmultInitialize(mmdata, 1, M_ptr); /* Make sure to assemble the grid */ + hypre_SStructPMatmultCommunicate(mmdata); + hypre_SStructPMatmultCompute(mmdata, *M_ptr); + hypre_SStructPMatmultDestroy(mmdata); + + hypre_SStructPMatrixAssemble(*M_ptr); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Computes the product of two SStructPMatrix matrices: M = A*B + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatmat( hypre_SStructPMatrix *A, + hypre_SStructPMatrix *B, + hypre_SStructPMatrix **M_ptr ) +{ + HYPRE_Int nmatrices = 2; + hypre_SStructPMatrix *matrices[2] = {A, B}; + HYPRE_Int nterms = 2; + HYPRE_Int terms[3] = {0, 1}; + HYPRE_Int trans[2] = {0, 0}; + + hypre_SStructPMatmult(nmatrices, matrices, nterms, terms, trans, M_ptr); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Computes M = P^T*A*P + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatrixPtAP( hypre_SStructPMatrix *A, + hypre_SStructPMatrix *P, + hypre_SStructPMatrix **M_ptr ) +{ + HYPRE_Int nmatrices = 2; + hypre_SStructPMatrix *matrices[2] = {A, P}; + HYPRE_Int nterms = 3; + HYPRE_Int terms[3] = {1, 0, 1}; + HYPRE_Int trans[3] = {1, 0, 0}; + + hypre_SStructPMatmult(nmatrices, matrices, nterms, terms, trans, M_ptr); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Computes M = R*A*P + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatrixRAP( hypre_SStructPMatrix *R, + hypre_SStructPMatrix *A, + hypre_SStructPMatrix *P, + hypre_SStructPMatrix **M_ptr ) +{ + HYPRE_Int nmatrices = 3; + hypre_SStructPMatrix *matrices[3] = {A, P, R}; + HYPRE_Int nterms = 3; + HYPRE_Int terms[3] = {2, 0, 1}; + HYPRE_Int trans[3] = {0, 0, 0}; + + hypre_SStructPMatmult(nmatrices, matrices, nterms, terms, trans, M_ptr); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Computes M = RT^T*A*P + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatrixRTtAP( hypre_SStructPMatrix *RT, + hypre_SStructPMatrix *A, + hypre_SStructPMatrix *P, + hypre_SStructPMatrix **M_ptr ) +{ + HYPRE_Int nmatrices = 3; + hypre_SStructPMatrix *matrices[3] = {A, P, RT}; + HYPRE_Int nterms = 3; + HYPRE_Int terms[3] = {2, 0, 1}; + HYPRE_Int trans[3] = {1, 0, 0}; + + hypre_SStructPMatmult(nmatrices, matrices, nterms, terms, trans, M_ptr); + + return hypre_error_flag; +} + +/*========================================================================== + * SStructMatrix matrix-multiply routines + *==========================================================================*/ + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatmultCreate(HYPRE_Int nmatrices_input, + hypre_SStructMatrix **matrices_input, + HYPRE_Int nterms, + HYPRE_Int *terms_input, + HYPRE_Int *trans_input, + hypre_SStructMatmultData **mmdata_ptr) +{ + hypre_SStructMatmultData *mmdata; + hypre_SStructPMatmultData *pmmdata; + + hypre_SStructPMatrix **pmatrices; + hypre_SStructMatrix **matrices; + + HYPRE_Int *terms; + HYPRE_Int *trans; + HYPRE_Int *matmap; + HYPRE_Int nmatrices; + HYPRE_Int part, nparts; + HYPRE_Int m, t; + + mmdata = hypre_CTAlloc(hypre_SStructMatmultData, 1, HYPRE_MEMORY_HOST); + + /* Create new matrices and terms arrays from the input arguments, because we + * only want to consider those matrices actually involved in the multiply */ + matmap = hypre_CTAlloc(HYPRE_Int, nmatrices_input, HYPRE_MEMORY_HOST); + for (t = 0; t < nterms; t++) + { + m = terms_input[t]; + matmap[m] = 1; + } + nmatrices = 0; + for (m = 0; m < nmatrices_input; m++) + { + if (matmap[m]) + { + matmap[m] = nmatrices; + nmatrices++; + } + } + matrices = hypre_CTAlloc(hypre_SStructMatrix *, nmatrices, HYPRE_MEMORY_HOST); + pmatrices = hypre_CTAlloc(hypre_SStructPMatrix *, nmatrices, HYPRE_MEMORY_HOST); + terms = hypre_CTAlloc(HYPRE_Int, nterms, HYPRE_MEMORY_HOST); + trans = hypre_CTAlloc(HYPRE_Int, nterms, HYPRE_MEMORY_HOST); + for (t = 0; t < nterms; t++) + { + m = terms_input[t]; + matrices[matmap[m]] = matrices_input[m]; + terms[t] = matmap[m]; + trans[t] = trans_input[t]; + } + hypre_TFree(matmap, HYPRE_MEMORY_HOST); + + /* Set number of parts */ + nparts = hypre_SStructMatrixNParts(matrices[0]); + (mmdata -> nparts) = nparts; + + /* Create SStructPMatmultData object */ + (mmdata -> pmmdata) = hypre_TAlloc(hypre_SStructPMatmultData *, nparts, HYPRE_MEMORY_HOST); + for (part = 0; part < nparts; part++) + { + for (m = 0; m < nmatrices; m++) + { + pmatrices[m] = hypre_SStructMatrixPMatrix(matrices[m], part); + } + hypre_SStructPMatmultCreate(nmatrices, pmatrices, nterms, terms, trans, &pmmdata); + (mmdata -> pmmdata)[part] = pmmdata; + } + hypre_TFree(pmatrices, HYPRE_MEMORY_HOST); + + /* Set SStructMatmultData object */ + (mmdata -> nterms) = nterms; + (mmdata -> nmatrices) = nmatrices; + (mmdata -> matrices) = matrices; + (mmdata -> terms) = terms; + (mmdata -> transposes) = trans; + (mmdata -> comm_pkg) = NULL; + (mmdata -> comm_data) = NULL; + + *mmdata_ptr = mmdata; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Destroys an object of type hypre_SStructMatmultData + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatmultDestroy( hypre_SStructMatmultData *mmdata ) +{ + HYPRE_Int part, nparts; + + if (mmdata) + { + nparts = (mmdata -> nparts); + for (part = 0; part < nparts; part++) + { + hypre_SStructPMatmultDestroy((mmdata -> pmmdata)[part]); + } + hypre_TFree(mmdata -> pmmdata, HYPRE_MEMORY_HOST); + + hypre_TFree(mmdata -> matrices, HYPRE_MEMORY_HOST); + hypre_TFree(mmdata -> transposes, HYPRE_MEMORY_HOST); + hypre_TFree(mmdata -> terms, HYPRE_MEMORY_HOST); + + hypre_CommPkgDestroy(mmdata -> comm_pkg); + hypre_TFree(mmdata -> comm_data, HYPRE_MEMORY_HOST); + + hypre_TFree(mmdata, HYPRE_MEMORY_HOST); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_SStructMatmultInitialize + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatmultInitialize( hypre_SStructMatmultData *mmdata, + hypre_SStructMatrix **M_ptr ) +{ + HYPRE_Int nparts = (mmdata -> nparts); + HYPRE_Int nterms = (mmdata -> nterms); + HYPRE_Int *terms = (mmdata -> terms); + HYPRE_Int *trans = (mmdata -> transposes); + hypre_SStructPMatmultData **pmmdata = (mmdata -> pmmdata); + hypre_SStructMatrix **matrices = (mmdata -> matrices); + + /* M matrix variables */ + hypre_SStructMatrix *M; + hypre_SStructGrid *Mgrid; + hypre_SStructGraph *Mgraph; + hypre_SStructPMatrix *pM; + hypre_SStructStencil *stencil; + HYPRE_Int stencil_size; + HYPRE_Int pstencil_size; + HYPRE_Int max_stencil_size; + HYPRE_Int ***splits; + HYPRE_Int *sentries; + HYPRE_Int *uentries; + + /* Unstructured component variables */ + hypre_IJMatrix *ij_M; + hypre_IJMatrix *ijmatrix; + HYPRE_BigInt ilower, iupper; + HYPRE_BigInt jlower, jupper; + + /* Input matrices variables */ + hypre_SStructPMatrix *pmatrix; + HYPRE_SStructVariable *vartypes; + hypre_SStructPGrid *pgrid; + + /* Local variables */ + MPI_Comm comm; + HYPRE_Int ndim; + HYPRE_Int part; + HYPRE_Int i, vi, vj, nvars; + + /* TODO: sanity check for input matrices */ + + /* Initialize variables */ + comm = hypre_SStructMatrixComm(matrices[0]); + ndim = hypre_SStructMatrixNDim(matrices[0]); + + /* Create the grid for M */ + HYPRE_SStructGridCreate(comm, ndim, nparts, &Mgrid); + for (part = 0; part < nparts; part++) + { + pmatrix = hypre_SStructMatrixPMatrix(matrices[0], part); + pgrid = hypre_SStructPMatrixPGrid(pmatrix); + nvars = hypre_SStructPGridNVars(pgrid); + vartypes = hypre_SStructPGridVarTypes(pgrid); + + HYPRE_SStructGridSetVariables(Mgrid, part, nvars, vartypes); + } + + /* Create M's graph */ + HYPRE_SStructGraphCreate(comm, Mgrid, &Mgraph); + + /* Create temporary stencil data structure */ + for (part = 0; part < nparts; part++) + { + for (vi = 0; vi < nvars; vi++) + { + HYPRE_SStructStencilCreate(ndim, 0, &stencil); + HYPRE_SStructGraphSetStencil(Mgraph, part, vi, stencil); + HYPRE_SStructStencilDestroy(stencil); + } + } + + /* Assemble M's graph */ + HYPRE_SStructGraphAssemble(Mgraph); + + /* Create the matrix M */ + HYPRE_SStructMatrixCreate(comm, Mgraph, &M); + splits = hypre_SStructMatrixSplits(M); + + /* Decrease reference counter for Mgraph and Mgrid */ + HYPRE_SStructGraphDestroy(Mgraph); + HYPRE_SStructGridDestroy(Mgrid); + + /* Setup Pmatrix */ + max_stencil_size = 0; + for (part = 0; part < nparts; part++) + { + pgrid = hypre_SStructGridPGrid(Mgrid, part); + nvars = hypre_SStructPGridNVars(pgrid); + + /* Create resulting part matrix */ + hypre_SStructPMatmultInitialize(pmmdata[part], 0, &pM); /* Don't assemble the grid */ + + /* Update part matrix of M */ + hypre_SStructMatrixPMatrix(M, part) = pM; + + /* Update part grid of M */ + hypre_SStructPGridDestroy(pgrid); + pgrid = hypre_SStructPMatrixPGrid(pM); + hypre_SStructPGridRef(pgrid, &hypre_SStructGridPGrid(Mgrid, part)); + + /* Update graph stencils */ + for (vi = 0; vi < nvars; vi++) + { + stencil = hypre_SStructGraphStencil(Mgraph, part, vi); + HYPRE_SStructStencilDestroy(stencil); + stencil = hypre_SStructPMatrixStencil(pM, vi); + hypre_SStructStencilRef(stencil, &hypre_SStructGraphStencil(Mgraph, part, vi)); + stencil_size = hypre_SStructStencilSize(stencil); + max_stencil_size = hypre_max(max_stencil_size, stencil_size); + + /* Update split array */ + splits[part][vi] = hypre_TReAlloc(splits[part][vi], HYPRE_Int, + stencil_size, HYPRE_MEMORY_HOST); + pstencil_size = 0; + for (i = 0; i < stencil_size; i++) + { + vj = hypre_SStructStencilVar(stencil, i); + if (hypre_SStructPGridVarType(pgrid, vi) == + hypre_SStructPGridVarType(pgrid, vj)) + { + splits[part][vi][i] = pstencil_size; + pstencil_size++; + } + else + { + splits[part][vi][i] = -1; + } + } + } + } + + /* Update sentries and uentries arrays */ + hypre_TFree(hypre_SStructMatrixSEntries(M), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_SStructMatrixUEntries(M), HYPRE_MEMORY_HOST); + sentries = hypre_TAlloc(HYPRE_Int, max_stencil_size, HYPRE_MEMORY_HOST); + uentries = hypre_TAlloc(HYPRE_Int, max_stencil_size, HYPRE_MEMORY_HOST); + hypre_SStructMatrixSEntries(M) = sentries; + hypre_SStructMatrixUEntries(M) = uentries; + + /* Assemble semi-struct grid */ + HYPRE_SStructGridAssemble(Mgrid); + + /* Set row bounds of the unstructured matrix component */ + ijmatrix = hypre_SStructMatrixIJMatrix(matrices[terms[0]]); + if (trans[0]) + { + ilower = hypre_IJMatrixColPartitioning(ijmatrix)[0]; + iupper = hypre_IJMatrixColPartitioning(ijmatrix)[1] - 1; + } + else + { + ilower = hypre_IJMatrixRowPartitioning(ijmatrix)[0]; + iupper = hypre_IJMatrixRowPartitioning(ijmatrix)[1] - 1; + } + + /* Set column bounds of the unstructured matrix component */ + ijmatrix = hypre_SStructMatrixIJMatrix(matrices[terms[nterms - 1]]); + if (trans[nterms - 1]) + { + jlower = hypre_IJMatrixRowPartitioning(ijmatrix)[0]; + jupper = hypre_IJMatrixRowPartitioning(ijmatrix)[1] - 1; + } + else + { + jlower = hypre_IJMatrixColPartitioning(ijmatrix)[0]; + jupper = hypre_IJMatrixColPartitioning(ijmatrix)[1] - 1; + } + + /* Create the unstructured matrix component (UMatrix) */ + HYPRE_IJMatrixCreate(comm, ilower, iupper, jlower, jupper, &ij_M); + HYPRE_IJMatrixSetObjectType(ij_M, HYPRE_PARCSR); + hypre_SStructMatrixIJMatrix(M) = ij_M; + + *M_ptr = M; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Run communication phase for computing the structured component of M + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatmultCommunicate( hypre_SStructMatmultData *mmdata ) +{ + HYPRE_Int nparts = (mmdata -> nparts); + hypre_SStructPMatmultData **pmmdata = (mmdata -> pmmdata); + hypre_CommPkg *comm_pkg = (mmdata -> comm_pkg); + HYPRE_Complex **comm_data = (mmdata -> comm_data); + + hypre_CommPkg **comm_pkg_a; + HYPRE_Complex ***comm_data_a; + HYPRE_Int num_comm_pkgs; + + HYPRE_Int part; + hypre_CommHandle *comm_handle; + + HYPRE_ANNOTATE_FUNC_BEGIN; + + for (part = 0; part < nparts; part++) + { + hypre_SStructPMatmultCommSetup(pmmdata[part]); + } + + /* Allocate communication package and data arrays */ + comm_pkg_a = hypre_TAlloc(hypre_CommPkg *, nparts, HYPRE_MEMORY_HOST); + comm_data_a = hypre_TAlloc(HYPRE_Complex **, nparts, HYPRE_MEMORY_HOST); + + /* Update pointers to communication packages and data */ + num_comm_pkgs = 0; + for (part = 0; part < nparts; part++) + { + if (pmmdata[part] && (pmmdata[part] -> comm_pkg)) + { + comm_pkg_a[num_comm_pkgs] = (pmmdata[part] -> comm_pkg); + comm_data_a[num_comm_pkgs] = (pmmdata[part] -> comm_data); + num_comm_pkgs++; + } + } + + if (num_comm_pkgs > 0) + { + /* Agglomerate communication packages if needed */ + HYPRE_ANNOTATE_REGION_BEGIN("%s", "CommSetup"); + if (!comm_pkg) + { + hypre_CommPkgAgglomerate(num_comm_pkgs, comm_pkg_a, &comm_pkg); + hypre_CommPkgAgglomData(num_comm_pkgs, comm_pkg_a, comm_data_a, comm_pkg, &comm_data); + (mmdata -> comm_pkg) = comm_pkg; + (mmdata -> comm_data) = comm_data; + } + HYPRE_ANNOTATE_REGION_END("%s", "CommSetup"); + + hypre_StructCommunicationInitialize(comm_pkg, comm_data, comm_data, 0, 0, &comm_handle); + hypre_StructCommunicationFinalize(comm_handle); + } + + /* Free up communication package and data arrays */ + hypre_TFree(comm_pkg_a, HYPRE_MEMORY_HOST); + hypre_TFree(comm_data_a, HYPRE_MEMORY_HOST); + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Computes the structured component of the product of SStructMatrices + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatmultComputeS( hypre_SStructMatmultData *mmdata, + hypre_SStructMatrix *M ) +{ + HYPRE_Int nparts = (mmdata -> nparts); + hypre_SStructPMatmultData **pmmdata = (mmdata -> pmmdata); + + hypre_SStructPMatrix *pM; + HYPRE_Int part; + + for (part = 0; part < nparts; part++) + { + pM = hypre_SStructMatrixPMatrix(M, part); + hypre_SStructPMatmultCompute(pmmdata[part], pM); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Computes the unstructured component of the product of SStructMatrices + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatmultComputeU( hypre_SStructMatmultData *mmdata, + hypre_SStructMatrix *M ) +{ + HYPRE_Int nmatrices = (mmdata -> nmatrices); + HYPRE_Int nterms = (mmdata -> nterms); + HYPRE_Int *terms = (mmdata -> terms); + HYPRE_Int *trans = (mmdata -> transposes); + hypre_SStructMatrix **matrices = (mmdata -> matrices); + + /* M matrix variables */ + hypre_IJMatrix *ij_M; + + /* Temporary variables */ + hypre_SStructGraph *graph; + hypre_SStructGrid *grid; + hypre_ParCSRMatrix **parcsr_tmp; + hypre_ParCSRMatrix *parcsr_sA; + hypre_ParCSRMatrix *parcsr_uA; + hypre_ParCSRMatrix *parcsr_sP; + hypre_ParCSRMatrix *parcsr_uP; + hypre_ParCSRMatrix *parcsr_sM = NULL; + hypre_ParCSRMatrix *parcsr_uM; + hypre_ParCSRMatrix *parcsr_uMold; + hypre_ParCSRMatrix *parcsr_sMold; + hypre_IJMatrix *ijmatrix; + hypre_IJMatrix *ij_tmp = NULL; + hypre_IJMatrix **ij_sA; + + HYPRE_Int m, t; + HYPRE_BigInt num_nonzeros_uP; + HYPRE_Int urap2 = 0; /* Split unstructured RAP into 2 stages */ + +#if defined(HYPRE_USING_GPU) + HYPRE_MemoryLocation memory_location; + HYPRE_ExecutionPolicy exec; +#endif + + HYPRE_ANNOTATE_FUNC_BEGIN; + + m = terms[2]; + ijmatrix = hypre_SStructMatrixIJMatrix(matrices[m]); + HYPRE_IJMatrixGetObject(ijmatrix, (void **) &parcsr_uP); + num_nonzeros_uP = hypre_ParCSRMatrixNumNonzeros(parcsr_uP); +#if defined(HYPRE_USING_GPU) + memory_location = hypre_ParCSRMatrixMemoryLocation(parcsr_uP); + exec = hypre_GetExecPolicy1(memory_location); +#endif + + /* The following ensures that NumNonzeros is initialized (a negative value + * means uninitialized). RDF: Not sure if this is needed for anything other + * than matching the subsequent if test for the special PtAP case. */ + if (num_nonzeros_uP < 0) + { + hypre_ParCSRMatrixSetNumNonzeros(parcsr_uP); + num_nonzeros_uP = hypre_ParCSRMatrixNumNonzeros(parcsr_uP); + } + + if (nterms == 3 && (num_nonzeros_uP == 0)) + { + /* Specialization for RAP when P has only the structured component. + * + * RDF: This assumes that we are computing PtAP so it probably should be + * moved to the PtAP routine instead of being here. */ + m = terms[1]; + graph = hypre_SStructMatrixGraph(matrices[m]); + grid = hypre_SStructGraphGrid(graph); + ijmatrix = hypre_SStructMatrixIJMatrix(matrices[m]); + HYPRE_IJMatrixGetObject(ijmatrix, (void **) &parcsr_sA); + + m = terms[2]; + hypre_SStructMatrixHaloToUMatrix(matrices[m], grid, &ij_tmp, 2); + //ij_tmp = hypre_SStructMatrixToUMatrix(matrices[m], 0); + HYPRE_IJMatrixGetObject(ij_tmp, (void **) &parcsr_sP); + + if (!hypre_ParCSRMatrixCommPkg(parcsr_sP)) + { + hypre_MatvecCommPkgCreate(parcsr_sP); + } + + /* Compute unstructured RAP */ + if (!urap2) + { + /* Note: this call does NOT add structural zeros to the diagonal */ + parcsr_uM = hypre_ParCSRMatrixRAPKT(parcsr_sP, parcsr_sA, parcsr_sP, 1, 0); + } + else + { + hypre_ParCSRMatrix *Q = hypre_ParCSRMatMat(parcsr_sA, parcsr_sP); + parcsr_uM = hypre_ParCSRTMatMatKT(parcsr_sP, Q, 1); + hypre_MatvecCommPkgCreate(parcsr_uM); + } + + HYPRE_IJMatrixDestroy(ij_tmp); + } + else + { + /* Temporary work matrices */ + parcsr_tmp = hypre_TAlloc(hypre_ParCSRMatrix *, 3, HYPRE_MEMORY_HOST); + ij_sA = hypre_TAlloc(hypre_IJMatrix *, nmatrices, HYPRE_MEMORY_HOST); + for (m = 0; m < nmatrices; m++) + { + ij_sA[m] = NULL; + } + + /* Set initial data */ + m = terms[nterms - 2]; + graph = hypre_SStructMatrixGraph(matrices[m]); + grid = hypre_SStructGraphGrid(graph); + + m = terms[nterms - 1]; + ijmatrix = hypre_SStructMatrixIJMatrix(matrices[m]); + HYPRE_IJMatrixGetObject(ijmatrix, (void **) &parcsr_uMold); + /* WM: todo - converting the whole matrix for now to be safe... */ + /* hypre_SStructMatrixHaloToUMatrix(matrices[m], grid, &ij_sA[m], 2); */ + ij_sA[m] = hypre_SStructMatrixToUMatrix(matrices[m], 0); + + HYPRE_IJMatrixGetObject(ij_sA[m], (void **) &parcsr_sMold); + +#if defined(DEBUG_MATMULT) + char matname[64]; + + hypre_ParCSRMatrixPrintIJ(parcsr_uMold, 0, 0, "parcsr_uP"); + hypre_ParCSRMatrixPrintIJ(parcsr_sMold, 0, 0, "parcsr_sP"); +#endif + + /* Compute uM iteratively */ + for (t = (nterms - 2); t >= 0; t--) + { + m = terms[t]; + + /* Convert sA_n to IJMatrix */ + if (ij_sA[m] == NULL) + { + graph = hypre_SStructMatrixGraph(matrices[terms[t + 1]]); + grid = hypre_SStructGraphGrid(graph); + + /* WM: todo - converting the whole matrix for now to be safe... */ + /* hypre_SStructMatrixHaloToUMatrix(matrices[m], grid, &ij_sA[m], 2); */ + ij_sA[m] = hypre_SStructMatrixToUMatrix(matrices[m], 0); + + } + HYPRE_IJMatrixGetObject(ij_sA[m], (void **) &parcsr_sA); +#if defined(DEBUG_MATMULT) + hypre_sprintf(matname, "parcsr_sA_%d", t); + hypre_ParCSRMatrixPrintIJ(parcsr_sA, 0, 0, matname); +#endif + + /* 1) Compute sA_n*uMold */ + if (trans[t]) + { + parcsr_tmp[0] = hypre_ParTMatmul(parcsr_sA, parcsr_uMold); + } + else + { + parcsr_tmp[0] = hypre_ParMatmul(parcsr_sA, parcsr_uMold); + } +#if defined(DEBUG_MATMULT) + hypre_sprintf(matname, "parcsr_0a_%d", t); + hypre_ParCSRMatrixPrintIJ(parcsr_tmp[0], 0, 0, matname); +#endif + + /* 2) Compute uA_n*uMold */ + ijmatrix = hypre_SStructMatrixIJMatrix(matrices[m]); + HYPRE_IJMatrixGetObject(ijmatrix, (void **) &parcsr_uA); +#if defined(DEBUG_MATMULT) + hypre_sprintf(matname, "parcsr_uA_%d", t); + hypre_ParCSRMatrixPrintIJ(parcsr_uA, 0, 0, matname); +#endif + if (trans[t]) + { + parcsr_tmp[1] = hypre_ParTMatmul(parcsr_uA, parcsr_uMold); + } + else + { + parcsr_tmp[1] = hypre_ParMatmul(parcsr_uA, parcsr_uMold); + } +#if defined(DEBUG_MATMULT) + hypre_sprintf(matname, "parcsr_1_%d", t); + hypre_ParCSRMatrixPrintIJ(parcsr_tmp[1], 0, 0, matname); +#endif + + if (t != (nterms - 2)) + { + hypre_ParCSRMatrixDestroy(parcsr_uMold); + } + + /* 3) Compute (sA_n*uMold + uA_n*uMold) */ + hypre_ParCSRMatrixAdd(1.0, parcsr_tmp[0], 1.0, parcsr_tmp[1], &parcsr_tmp[2]); +#if defined(DEBUG_MATMULT) + hypre_sprintf(matname, "parcsr_2_%d", t); + hypre_ParCSRMatrixPrintIJ(parcsr_tmp[2], 0, 0, matname); +#endif + + /* Free sA_n*uMold and uA_n*uMold */ + hypre_ParCSRMatrixDestroy(parcsr_tmp[0]); + hypre_ParCSRMatrixDestroy(parcsr_tmp[1]); + + /* 4) Compute uA_n*sMold */ + if (trans[t]) + { + parcsr_tmp[0] = hypre_ParTMatmul(parcsr_uA, parcsr_sMold); + } + else + { + parcsr_tmp[0] = hypre_ParMatmul(parcsr_uA, parcsr_sMold); + } +#if defined(DEBUG_MATMULT) + hypre_sprintf(matname, "parcsr_0b_%d", t); + hypre_ParCSRMatrixPrintIJ(parcsr_tmp[0], 0, 0, matname); +#endif + + /* 5) Compute (uA_n*uMold + sA_n*uMold + uA_n*uMold) */ + hypre_ParCSRMatrixAdd(1.0, parcsr_tmp[0], 1.0, parcsr_tmp[2], &parcsr_uM); +#if defined(DEBUG_MATMULT) + hypre_sprintf(matname, "parcsr_uM_%d", t); + hypre_ParCSRMatrixPrintIJ(parcsr_uM, 0, 0, matname); +#endif + + /* Free temporary work matrices */ + hypre_ParCSRMatrixDestroy(parcsr_tmp[0]); + hypre_ParCSRMatrixDestroy(parcsr_tmp[2]); + + /* 6) Compute sA_n*sMold */ + if (trans[t]) + { + parcsr_sM = hypre_ParTMatmul(parcsr_sA, parcsr_sMold); + } + else + { + parcsr_sM = hypre_ParMatmul(parcsr_sA, parcsr_sMold); + } +#if defined(DEBUG_MATMULT) + hypre_sprintf(matname, "parcsr_sM_%d", t); + hypre_ParCSRMatrixPrintIJ(parcsr_sM, 0, 0, matname); +#endif + + if (t < (nterms - 2)) + { + hypre_ParCSRMatrixDestroy(parcsr_sMold); + } + + /* 7) Update pointers */ + parcsr_sMold = parcsr_sM; + parcsr_uMold = parcsr_uM; + } + + /* Free temporary work matrices */ + hypre_TFree(parcsr_tmp, HYPRE_MEMORY_HOST); + hypre_ParCSRMatrixDestroy(parcsr_sM); + for (m = 0; m < nmatrices; m++) + { + if (ij_sA[m] != NULL) + { + HYPRE_IJMatrixDestroy(ij_sA[m]); + } + } + hypre_TFree(ij_sA, HYPRE_MEMORY_HOST); + } + + /* Update pointer to unstructured matrix component of M */ + ij_M = hypre_SStructMatrixIJMatrix(M); + hypre_IJMatrixDestroyParCSR(ij_M); + hypre_IJMatrixSetObject(ij_M, parcsr_uM); + hypre_SStructMatrixParCSRMatrix(M) = parcsr_uM; + hypre_IJMatrixAssembleFlag(ij_M) = 1; + hypre_ParCSRMatrixSetNumNonzeros(parcsr_uM); + + /* Add to entries in S with entries from U where the sparsity pattern permits. */ +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_HOST) +#endif + { + hypre_SStructMatrixCompressUToS(M, 1); + hypre_ParCSRMatrixSetNumNonzeros(parcsr_uM); + } + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Iterative multiplication of SStructMatrices A_i (i=1,...,n) computed as + * + * M_1 = A_1 = (sA_1 + uA_1) + * M_2 = A_2 * M_1 = (sA_2 + uA_2) * (sM_1 + uM_1) + * = sA_2*sM_1 + (sA_2*uM_1 + uA_2 * (sM_1 + uM_1)) + * \.../ \.../ + * \./ \./ + * | | + * = sM_2 + uM_2 + * ... + * M_n = A_n * M_{n-1} = (sA_n + uA_n) * (sM_{n-1} + uM_{n-1}) + * = sA_n*sM_{n-1} + (sA_n*uM_{n-1} + uA_n * (sM_{n-1} + uM_{n-1})) + * \.../ \.../ + * \./ \./ + * | | + * = sM_n + uM_n + * + * Notes: + * 1) A is transposed in each call to hypre_ParTMatmul. This operation + * could be done only once and At reused... + * 2) Should we phase out domain grid and have only a base grid? + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatmultCompute( hypre_SStructMatmultData *mmdata, + hypre_SStructMatrix *M ) +{ + /* Computes the structured component */ + hypre_SStructMatmultComputeS(mmdata, M); + + /* Computes the unstructured component */ + hypre_SStructMatmultComputeU(mmdata, M); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Computes the product of several SStructMatrix matrices + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatmult(HYPRE_Int nmatrices, + hypre_SStructMatrix **matrices, + HYPRE_Int nterms, + HYPRE_Int *terms, + HYPRE_Int *trans, + hypre_SStructMatrix **M_ptr ) +{ + hypre_SStructMatmultData *mmdata; + + hypre_SStructMatmultCreate(nmatrices, matrices, nterms, terms, trans, &mmdata); + hypre_SStructMatmultInitialize(mmdata, M_ptr); + hypre_SStructMatmultCommunicate(mmdata); + hypre_SStructMatmultCompute(mmdata, *M_ptr); + hypre_SStructMatmultDestroy(mmdata); + + HYPRE_SStructMatrixAssemble(*M_ptr); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Computes the product of two SStructMatrix matrices: M = A*B + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatmat( hypre_SStructMatrix *A, + hypre_SStructMatrix *B, + hypre_SStructMatrix **M_ptr ) +{ + HYPRE_Int nmatrices = 2; + HYPRE_SStructMatrix matrices[2] = {A, B}; + HYPRE_Int nterms = 2; + HYPRE_Int terms[3] = {0, 1}; + HYPRE_Int trans[2] = {0, 0}; + + hypre_SStructMatmult(nmatrices, matrices, nterms, terms, trans, M_ptr); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Computes M = P^T*A*P + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatrixPtAP( hypre_SStructMatrix *A, + hypre_SStructMatrix *P, + hypre_SStructMatrix **M_ptr ) +{ + HYPRE_Int nmatrices = 2; + HYPRE_SStructMatrix matrices[2] = {A, P}; + HYPRE_Int nterms = 3; + HYPRE_Int terms[3] = {1, 0, 1}; + HYPRE_Int trans[3] = {1, 0, 0}; + + hypre_SStructMatmult(nmatrices, matrices, nterms, terms, trans, M_ptr); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Computes M = R*A*P + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatrixRAP( hypre_SStructMatrix *R, + hypre_SStructMatrix *A, + hypre_SStructMatrix *P, + hypre_SStructMatrix **M_ptr ) +{ + HYPRE_Int nmatrices = 3; + HYPRE_SStructMatrix matrices[3] = {A, P, R}; + HYPRE_Int nterms = 3; + HYPRE_Int terms[3] = {2, 0, 1}; + HYPRE_Int trans[3] = {0, 0, 0}; + + hypre_SStructMatmult(nmatrices, matrices, nterms, terms, trans, M_ptr); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Computes M = RT^T*A*P + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatrixRTtAP( hypre_SStructMatrix *RT, + hypre_SStructMatrix *A, + hypre_SStructMatrix *P, + hypre_SStructMatrix **M_ptr ) +{ + HYPRE_Int nmatrices = 3; + HYPRE_SStructMatrix matrices[3] = {A, P, RT}; + HYPRE_Int nterms = 3; + HYPRE_Int terms[3] = {2, 0, 1}; + HYPRE_Int trans[3] = {1, 0, 0}; + + hypre_SStructMatmult(nmatrices, matrices, nterms, terms, trans, M_ptr); + + return hypre_error_flag; +} diff --git a/src/sstruct_mv/sstruct_matmult.h b/src/sstruct_mv/sstruct_matmult.h new file mode 100644 index 0000000000..1dca0cdb2c --- /dev/null +++ b/src/sstruct_mv/sstruct_matmult.h @@ -0,0 +1,59 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 semi-structured matrix/matrix multiplication structures + * + *****************************************************************************/ + +#ifndef hypre_SSTRUCT_MATMULT_HEADER +#define hypre_SSTRUCT_MATMULT_HEADER + +/*-------------------------------------------------------------------------- + * SStructPMatmult data structure + *--------------------------------------------------------------------------*/ + +typedef struct hypre_SStructPMatmultData_struct +{ + hypre_StructMatmultData *smmdata; /* struct matmult data object */ + HYPRE_Int ***smmid; /* (nvars x nvars) array of matmult id-arrays */ + HYPRE_Int **smmsz; /* (nvars x nvars) array of matmult id-array sizes */ + HYPRE_Int nvars; + + HYPRE_Int nmatrices; + hypre_SStructPMatrix **pmatrices; /* matrices we are multiplying */ + HYPRE_Int nterms; + HYPRE_Int *terms; + HYPRE_Int *transposes; + + hypre_CommPkg *comm_pkg; /* agglomerated communication package */ + HYPRE_Complex **comm_data; /* agglomerated communication data */ + +} hypre_SStructPMatmultData; + +/*-------------------------------------------------------------------------- + * SStructMatmult data structure + *--------------------------------------------------------------------------*/ + +typedef struct hypre_SStructMatmultData_struct +{ + HYPRE_Int nparts; + hypre_SStructPMatmultData **pmmdata; /* pointer to nparts array */ + + HYPRE_Int nmatrices; + hypre_SStructMatrix **matrices; /* matrices we are multiplying */ + HYPRE_Int nterms; + HYPRE_Int *terms; + HYPRE_Int *transposes; + + hypre_CommPkg *comm_pkg; /* agglomerated communication package */ + HYPRE_Complex **comm_data; /* agglomerated communication data */ + +} hypre_SStructMatmultData; + +#endif diff --git a/src/sstruct_mv/sstruct_matop.c b/src/sstruct_mv/sstruct_matop.c new file mode 100644 index 0000000000..c6473c2810 --- /dev/null +++ b/src/sstruct_mv/sstruct_matop.c @@ -0,0 +1,160 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_sstruct_mv.h" + +/*========================================================================== + * SStructPMatrix routines + *==========================================================================*/ + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatrixComputeRowSum( hypre_SStructPMatrix *pA, + HYPRE_Int type, + hypre_SStructPVector *prowsum ) +{ + HYPRE_Int nvars = hypre_SStructPMatrixNVars(pA); + + hypre_StructMatrix *sA; + hypre_StructVector *sv; + HYPRE_Int vi, vj; + + for (vi = 0; vi < nvars; vi++) + { + sv = hypre_SStructPVectorSVector(prowsum, vi); + for (vj = 0; vj < nvars; vj++) + { + sA = hypre_SStructPMatrixSMatrix(pA, vi, vj); + hypre_StructMatrixComputeRowSum(sA, type, sv); + } + } + + return hypre_error_flag; +} + +/*========================================================================== + * SStructMatrix routines + *==========================================================================*/ + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatrixComputeRowSum( hypre_SStructMatrix *A, + HYPRE_Int type, + hypre_SStructVector **rowsum_ptr ) +{ + MPI_Comm comm = hypre_SStructMatrixComm(A); + hypre_ParCSRMatrix *par_A = hypre_SStructMatrixParCSRMatrix(A); + hypre_CSRMatrix *A_diag = hypre_ParCSRMatrixDiag(par_A); + hypre_CSRMatrix *A_offd = hypre_ParCSRMatrixOffd(par_A); + hypre_SStructGraph *graph = hypre_SStructMatrixGraph(A); + hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); + HYPRE_Int object_type = hypre_SStructMatrixObjectType(A); + HYPRE_Int nparts = hypre_SStructMatrixNParts(A); + hypre_SStructVector *rowsum; + + hypre_SStructPMatrix *pA; + hypre_SStructPVector *pv; + HYPRE_Complex *data; + HYPRE_Int part; + + if (*rowsum_ptr) + { + rowsum = *rowsum_ptr; + } + else + { + HYPRE_SStructVectorCreate(comm, grid, &rowsum); + HYPRE_SStructVectorInitialize(rowsum); + HYPRE_SStructVectorAssemble(rowsum); + } + data = hypre_SStructVectorData(rowsum); + + if ((object_type == HYPRE_SSTRUCT) || (object_type == HYPRE_STRUCT)) + { + /* do S-matrix computations */ + for (part = 0; part < nparts; part++) + { + pA = hypre_SStructMatrixPMatrix(A, part); + pv = hypre_SStructVectorPVector(rowsum, part); + + hypre_SStructPMatrixComputeRowSum(pA, type, pv); + } + + if (object_type == HYPRE_SSTRUCT) + { + hypre_CSRMatrixComputeRowSum(A_diag, NULL, NULL, data, type, 1.0, "add"); + hypre_CSRMatrixComputeRowSum(A_offd, NULL, NULL, data, type, 1.0, "add"); + } + } + else + { + hypre_CSRMatrixComputeRowSum(A_diag, NULL, NULL, data, type, 1.0, "set"); + hypre_CSRMatrixComputeRowSum(A_offd, NULL, NULL, data, type, 1.0, "add"); + } + + *rowsum_ptr = rowsum; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Compute the l1 norms of the rows of a given matrix, depending on + * the option parameter: + * + * option 1 = Compute the l1 norm of the rows + * option 2 = Compute the l1 norm of the (processor) off-diagonal + * part of the rows plus the diagonal of A + * option 3 = Compute the l2 norm^2 of the rows + * option 4 = Truncated version of option 2 based on Remark 6.2 in "Multigrid + * Smoothers for Ultra-Parallel Computing" + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatrixComputeL1Norms( hypre_SStructMatrix *A, + HYPRE_Int option, + hypre_SStructVector **l1_norms_ptr ) +{ + MPI_Comm comm = hypre_SStructMatrixComm(A); + hypre_SStructGraph *graph = hypre_SStructMatrixGraph(A); + hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); + hypre_SStructVector *l1_norms; + + /* Create l1_norms vector */ + HYPRE_SStructVectorCreate(comm, grid, &l1_norms); + HYPRE_SStructVectorInitialize(l1_norms); + HYPRE_SStructVectorAssemble(l1_norms); + + /* Compute l1_norms */ + if (option == 1) + { + hypre_SStructMatrixComputeRowSum(A, 1, &l1_norms); + } + else if (option == 2) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Option 2 not implemented yet!"); + } + else if (option == 3) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Option 3 not implemented yet!"); + } + else if (option == 4) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Option 4 not implemented yet!"); + } + else + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown option!"); + } + + *l1_norms_ptr = l1_norms; + + return hypre_error_flag; +} diff --git a/src/sstruct_mv/sstruct_matrix.c b/src/sstruct_mv/sstruct_matrix.c index 72e92aaa3b..ed35b06f8e 100644 --- a/src/sstruct_mv/sstruct_matrix.c +++ b/src/sstruct_mv/sstruct_matrix.c @@ -13,6 +13,11 @@ #include "_hypre_sstruct_mv.h" #include "_hypre_struct_mv.hpp" +#include "_hypre_onedpl.hpp" + +/* #define DEBUG_MATCONV */ +/* #define DEBUG_U2S */ +/* #define DEBUG_SETBOX */ /*========================================================================== * SStructPMatrix routines @@ -32,6 +37,10 @@ hypre_SStructPMatrixRef( hypre_SStructPMatrix *matrix, } /*-------------------------------------------------------------------------- + * TODO: If we had a data structure for an integer array that keeps track + * of its size, we could combine num_centries and centries into a + * single variable of that type. The same could be done with + * sentries_size and sentries. *--------------------------------------------------------------------------*/ HYPRE_Int @@ -40,18 +49,21 @@ hypre_SStructPMatrixCreate( MPI_Comm comm, hypre_SStructStencil **stencils, hypre_SStructPMatrix **pmatrix_ptr ) { + HYPRE_Int ndim = hypre_SStructPGridNDim(pgrid); + HYPRE_Int nvars = hypre_SStructPGridNVars(pgrid); + hypre_SStructPMatrix *pmatrix; - HYPRE_Int nvars; HYPRE_Int **smaps; hypre_StructStencil ***sstencils; hypre_StructMatrix ***smatrices; HYPRE_Int **symmetric; + HYPRE_Int **num_centries; + HYPRE_Int ***centries; hypre_StructStencil *sstencil; HYPRE_Int *vars; hypre_Index *sstencil_shape; HYPRE_Int sstencil_size; - HYPRE_Int new_dim; HYPRE_Int *new_sizes; hypre_Index **new_shapes; HYPRE_Int size; @@ -60,23 +72,22 @@ hypre_SStructPMatrixCreate( MPI_Comm comm, HYPRE_Int vi, vj; HYPRE_Int i, j, k; - pmatrix = hypre_TAlloc(hypre_SStructPMatrix, 1, HYPRE_MEMORY_HOST); + pmatrix = hypre_TAlloc(hypre_SStructPMatrix, 1, HYPRE_MEMORY_HOST); hypre_SStructPMatrixComm(pmatrix) = comm; - hypre_SStructPMatrixPGrid(pmatrix) = pgrid; + hypre_SStructPGridRef(pgrid, &hypre_SStructPMatrixPGrid(pmatrix)); hypre_SStructPMatrixStencils(pmatrix) = stencils; - nvars = hypre_SStructPGridNVars(pgrid); - hypre_SStructPMatrixNVars(pmatrix) = nvars; + hypre_SStructPMatrixNVars(pmatrix) = nvars; /* create sstencils */ - smaps = hypre_TAlloc(HYPRE_Int *, nvars, HYPRE_MEMORY_HOST); - sstencils = hypre_TAlloc(hypre_StructStencil **, nvars, HYPRE_MEMORY_HOST); - new_sizes = hypre_TAlloc(HYPRE_Int, nvars, HYPRE_MEMORY_HOST); - new_shapes = hypre_TAlloc(hypre_Index *, nvars, HYPRE_MEMORY_HOST); + smaps = hypre_TAlloc(HYPRE_Int *, nvars, HYPRE_MEMORY_HOST); + sstencils = hypre_TAlloc(hypre_StructStencil **, nvars, HYPRE_MEMORY_HOST); + new_sizes = hypre_TAlloc(HYPRE_Int, nvars, HYPRE_MEMORY_HOST); + new_shapes = hypre_TAlloc(hypre_Index *, nvars, HYPRE_MEMORY_HOST); size = 0; for (vi = 0; vi < nvars; vi++) { - sstencils[vi] = hypre_TAlloc(hypre_StructStencil *, nvars, HYPRE_MEMORY_HOST); + sstencils[vi] = hypre_TAlloc(hypre_StructStencil *, nvars, HYPRE_MEMORY_HOST); for (vj = 0; vj < nvars; vj++) { sstencils[vi][vj] = NULL; @@ -88,7 +99,7 @@ hypre_SStructPMatrixCreate( MPI_Comm comm, sstencil_shape = hypre_StructStencilShape(sstencil); sstencil_size = hypre_StructStencilSize(sstencil); - smaps[vi] = hypre_TAlloc(HYPRE_Int, sstencil_size, HYPRE_MEMORY_HOST); + smaps[vi] = hypre_TAlloc(HYPRE_Int, sstencil_size, HYPRE_MEMORY_HOST); for (i = 0; i < sstencil_size; i++) { j = vars[i]; @@ -98,7 +109,7 @@ hypre_SStructPMatrixCreate( MPI_Comm comm, { if (new_sizes[vj]) { - new_shapes[vj] = hypre_TAlloc(hypre_Index, new_sizes[vj], HYPRE_MEMORY_HOST); + new_shapes[vj] = hypre_TAlloc(hypre_Index, new_sizes[vj], HYPRE_MEMORY_HOST); new_sizes[vj] = 0; } } @@ -110,13 +121,12 @@ hypre_SStructPMatrixCreate( MPI_Comm comm, smaps[vi][i] = k; new_sizes[j]++; } - new_dim = hypre_StructStencilNDim(sstencil); for (vj = 0; vj < nvars; vj++) { if (new_sizes[vj]) { sstencils[vi][vj] = - hypre_StructStencilCreate(new_dim, new_sizes[vj], new_shapes[vj]); + hypre_StructStencilCreate(ndim, new_sizes[vj], new_shapes[vj]); } size = hypre_max(size, new_sizes[vj]); } @@ -127,10 +137,10 @@ hypre_SStructPMatrixCreate( MPI_Comm comm, hypre_TFree(new_shapes, HYPRE_MEMORY_HOST); /* create smatrices */ - smatrices = hypre_TAlloc(hypre_StructMatrix **, nvars, HYPRE_MEMORY_HOST); + smatrices = hypre_TAlloc(hypre_StructMatrix **, nvars, HYPRE_MEMORY_HOST); for (vi = 0; vi < nvars; vi++) { - smatrices[vi] = hypre_TAlloc(hypre_StructMatrix *, nvars, HYPRE_MEMORY_HOST); + smatrices[vi] = hypre_TAlloc(hypre_StructMatrix *, nvars, HYPRE_MEMORY_HOST); for (vj = 0; vj < nvars; vj++) { smatrices[vi][vj] = NULL; @@ -144,21 +154,33 @@ hypre_SStructPMatrixCreate( MPI_Comm comm, } hypre_SStructPMatrixSMatrices(pmatrix) = smatrices; - /* create symmetric */ - symmetric = hypre_TAlloc(HYPRE_Int *, nvars, HYPRE_MEMORY_HOST); + /* create domain and range grid strides */ + hypre_SetIndex(hypre_SStructPMatrixDomainStride(pmatrix), 1); + hypre_SetIndex(hypre_SStructPMatrixRangeStride(pmatrix), 1); + + /* create arrays */ + symmetric = hypre_TAlloc(HYPRE_Int *, nvars, HYPRE_MEMORY_HOST); + num_centries = hypre_TAlloc(HYPRE_Int *, nvars, HYPRE_MEMORY_HOST); + centries = hypre_TAlloc(HYPRE_Int **, nvars, HYPRE_MEMORY_HOST); for (vi = 0; vi < nvars; vi++) { - symmetric[vi] = hypre_TAlloc(HYPRE_Int, nvars, HYPRE_MEMORY_HOST); + symmetric[vi] = hypre_TAlloc(HYPRE_Int, nvars, HYPRE_MEMORY_HOST); + num_centries[vi] = hypre_TAlloc(HYPRE_Int, nvars, HYPRE_MEMORY_HOST); + centries[vi] = hypre_TAlloc(HYPRE_Int *, nvars, HYPRE_MEMORY_HOST); for (vj = 0; vj < nvars; vj++) { - symmetric[vi][vj] = 0; + centries[vi][vj] = hypre_TAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); + symmetric[vi][vj] = 0; + num_centries[vi][vj] = 0; } } - hypre_SStructPMatrixSymmetric(pmatrix) = symmetric; + hypre_SStructPMatrixSymmetric(pmatrix) = symmetric; + hypre_SStructPMatrixNumCEntries(pmatrix) = num_centries; + hypre_SStructPMatrixCEntries(pmatrix) = centries; hypre_SStructPMatrixSEntriesSize(pmatrix) = size; - hypre_SStructPMatrixSEntries(pmatrix) = hypre_TAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); - + hypre_SStructPMatrixSEntries(pmatrix) = hypre_TAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); + hypre_SStructPMatrixAccumulated(pmatrix) = 0; hypre_SStructPMatrixRefCount(pmatrix) = 1; *pmatrix_ptr = pmatrix; @@ -178,6 +200,10 @@ hypre_SStructPMatrixDestroy( hypre_SStructPMatrix *pmatrix ) hypre_StructStencil ***sstencils; hypre_StructMatrix ***smatrices; HYPRE_Int **symmetric; + HYPRE_Int **num_centries; + HYPRE_Int ***centries; + HYPRE_Int *sentries; + HYPRE_Int vi, vj; if (pmatrix) @@ -185,12 +211,16 @@ hypre_SStructPMatrixDestroy( hypre_SStructPMatrix *pmatrix ) hypre_SStructPMatrixRefCount(pmatrix) --; if (hypre_SStructPMatrixRefCount(pmatrix) == 0) { - stencils = hypre_SStructPMatrixStencils(pmatrix); - nvars = hypre_SStructPMatrixNVars(pmatrix); - smaps = hypre_SStructPMatrixSMaps(pmatrix); - sstencils = hypre_SStructPMatrixSStencils(pmatrix); - smatrices = hypre_SStructPMatrixSMatrices(pmatrix); - symmetric = hypre_SStructPMatrixSymmetric(pmatrix); + stencils = hypre_SStructPMatrixStencils(pmatrix); + nvars = hypre_SStructPMatrixNVars(pmatrix); + smaps = hypre_SStructPMatrixSMaps(pmatrix); + sstencils = hypre_SStructPMatrixSStencils(pmatrix); + smatrices = hypre_SStructPMatrixSMatrices(pmatrix); + symmetric = hypre_SStructPMatrixSymmetric(pmatrix); + num_centries = hypre_SStructPMatrixNumCEntries(pmatrix); + centries = hypre_SStructPMatrixCEntries(pmatrix); + sentries = hypre_SStructPMatrixSEntries(pmatrix); + for (vi = 0; vi < nvars; vi++) { HYPRE_SStructStencilDestroy(stencils[vi]); @@ -199,17 +229,23 @@ hypre_SStructPMatrixDestroy( hypre_SStructPMatrix *pmatrix ) { hypre_StructStencilDestroy(sstencils[vi][vj]); hypre_StructMatrixDestroy(smatrices[vi][vj]); + hypre_TFree(centries[vi][vj], HYPRE_MEMORY_HOST); } hypre_TFree(sstencils[vi], HYPRE_MEMORY_HOST); hypre_TFree(smatrices[vi], HYPRE_MEMORY_HOST); hypre_TFree(symmetric[vi], HYPRE_MEMORY_HOST); + hypre_TFree(num_centries[vi], HYPRE_MEMORY_HOST); + hypre_TFree(centries[vi], HYPRE_MEMORY_HOST); } + hypre_SStructPGridDestroy(hypre_SStructPMatrixPGrid(pmatrix)); hypre_TFree(stencils, HYPRE_MEMORY_HOST); hypre_TFree(smaps, HYPRE_MEMORY_HOST); hypre_TFree(sstencils, HYPRE_MEMORY_HOST); hypre_TFree(smatrices, HYPRE_MEMORY_HOST); hypre_TFree(symmetric, HYPRE_MEMORY_HOST); - hypre_TFree(hypre_SStructPMatrixSEntries(pmatrix), HYPRE_MEMORY_HOST); + hypre_TFree(num_centries, HYPRE_MEMORY_HOST); + hypre_TFree(centries, HYPRE_MEMORY_HOST); + hypre_TFree(sentries, HYPRE_MEMORY_HOST); hypre_TFree(pmatrix, HYPRE_MEMORY_HOST); } } @@ -219,15 +255,20 @@ hypre_SStructPMatrixDestroy( hypre_SStructPMatrix *pmatrix ) /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_SStructPMatrixInitialize( hypre_SStructPMatrix *pmatrix ) { HYPRE_Int nvars = hypre_SStructPMatrixNVars(pmatrix); HYPRE_Int **symmetric = hypre_SStructPMatrixSymmetric(pmatrix); + HYPRE_Int **num_centries = hypre_SStructPMatrixNumCEntries(pmatrix); + HYPRE_Int ***centries = hypre_SStructPMatrixCEntries(pmatrix); + hypre_IndexRef dom_stride = hypre_SStructPMatrixDomainStride(pmatrix); + hypre_IndexRef ran_stride = hypre_SStructPMatrixRangeStride(pmatrix); + // HYPRE_Int num_ghost[2*HYPRE_MAXDIM]; hypre_StructMatrix *smatrix; HYPRE_Int vi, vj; - /* HYPRE_Int num_ghost[2*HYPRE_MAXDIM]; */ - /* HYPRE_Int vi, vj, d, ndim; */ + // HYPRE_Int d, ndim; #if 0 ndim = hypre_SStructPMatrixNDim(pmatrix); @@ -237,6 +278,10 @@ hypre_SStructPMatrixInitialize( hypre_SStructPMatrix *pmatrix ) { num_ghost[2 * d] = num_ghost[2 * d + 1] = 1; } + for (d = ndim; d < HYPRE_MAXDIM; d++) + { + num_ghost[2 * d] = num_ghost[2 * d + 1] = 0; + } #endif for (vi = 0; vi < nvars; vi++) { @@ -245,8 +290,13 @@ hypre_SStructPMatrixInitialize( hypre_SStructPMatrix *pmatrix ) smatrix = hypre_SStructPMatrixSMatrix(pmatrix, vi, vj); if (smatrix != NULL) { + HYPRE_StructMatrixSetDomainStride(smatrix, dom_stride); + HYPRE_StructMatrixSetRangeStride(smatrix, ran_stride); + HYPRE_StructMatrixSetConstantEntries(smatrix, + num_centries[vi][vj], + centries[vi][vj]); HYPRE_StructMatrixSetSymmetric(smatrix, symmetric[vi][vj]); - /* hypre_StructMatrixSetNumGhost(smatrix, num_ghost); */ + // HYPRE_StructMatrixSetNumGhost(smatrix, num_ghost); hypre_StructMatrixInitialize(smatrix); /* needed to get AddTo accumulation correct between processors */ hypre_StructMatrixClearGhostValues(smatrix); @@ -254,8 +304,6 @@ hypre_SStructPMatrixInitialize( hypre_SStructPMatrix *pmatrix ) } } - hypre_SStructPMatrixAccumulated(pmatrix) = 0; - return hypre_error_flag; } @@ -390,10 +438,12 @@ hypre_SStructPMatrixSetBoxValues( hypre_SStructPMatrix *pmatrix, /* set values inside the grid */ hypre_StructMatrixSetBoxValues(smatrix, set_box, value_box, nentries, sentries, values, action, -1, 0); + /* TODO: Why need DeviceSync? */ #if defined(HYPRE_USING_GPU) hypre_SyncDevice(); #endif + /* set (AddTo/Get) or clear (Set) values outside the grid in ghost zones */ if (action != 0) { @@ -489,6 +539,8 @@ hypre_SStructPMatrixAccumulate( hypre_SStructPMatrix *pmatrix ) hypre_CommInfo *comm_info; hypre_CommPkg *comm_pkg; hypre_CommHandle *comm_handle; + HYPRE_Complex *data; + hypre_Index ustride; /* if values already accumulated, just return */ if (hypre_SStructPMatrixAccumulated(pmatrix)) @@ -496,6 +548,12 @@ hypre_SStructPMatrixAccumulate( hypre_SStructPMatrix *pmatrix ) return hypre_error_flag; } + hypre_SetIndex(ustride, 1); + + for (d = ndim; d < HYPRE_MAXDIM; d++) + { + num_ghost[2 * d] = num_ghost[2 * d + 1] = 0; + } for (vi = 0; vi < nvars; vi++) { for (vj = 0; vj < nvars; vj++) @@ -508,22 +566,21 @@ 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 */ - hypre_CreateCommInfoFromNumGhost(sgrid, num_ghost, &comm_info); + hypre_CreateCommInfoFromNumGhost(sgrid, ustride, num_ghost, &comm_info); hypre_CommPkgCreate(comm_info, hypre_StructMatrixDataSpace(smatrix), hypre_StructMatrixDataSpace(smatrix), hypre_StructMatrixNumValues(smatrix), NULL, 1, hypre_StructMatrixComm(smatrix), + hypre_StructMatrixMemoryLocation(smatrix), &comm_pkg); - hypre_InitializeCommunication(comm_pkg, - hypre_StructMatrixData(smatrix), - hypre_StructMatrixData(smatrix), - 1, 0, &comm_handle); - hypre_FinalizeCommunication(comm_handle); + data = hypre_StructMatrixVData(smatrix); + hypre_StructCommunicationInitialize(comm_pkg, &data, &data, 1, 0, &comm_handle); + hypre_StructCommunicationFinalize(comm_handle); hypre_CommInfoDestroy(comm_info); hypre_CommPkgDestroy(comm_pkg); @@ -565,8 +622,42 @@ hypre_SStructPMatrixAssemble( hypre_SStructPMatrix *pmatrix ) } /*-------------------------------------------------------------------------- + * This routine may be called at any time. The boolean 'resize' is returned to + * indicate whether a MatrixResize() is needed. *--------------------------------------------------------------------------*/ +HYPRE_Int +hypre_SStructPMatrixSetTranspose( hypre_SStructPMatrix *pmatrix, + HYPRE_Int transpose, + HYPRE_Int *resize ) +{ + HYPRE_Int nvars = hypre_SStructPMatrixNVars(pmatrix); + hypre_StructMatrix *smatrix; + HYPRE_Int vi, vj; + + for (vi = 0; vi < nvars; vi++) + { + for (vj = 0; vj < nvars; vj++) + { + smatrix = hypre_SStructPMatrixSMatrix(pmatrix, vi, vj); + if (smatrix != NULL) + { + hypre_StructMatrixSetTranspose(smatrix, transpose, resize); + } + } + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * TODO: Deprecate this function. var == -1 or to_var == -1 are never used. + * These cases are used only in HYPRE_SStructMatrixSetSymmetric. + * + * RDF: The '-1' cases are used in the sstruct driver, and the thought was that + * it would be a useful way to set everything symmetric. + *--------------------------------------------------------------------------*/ +#if 1 HYPRE_Int hypre_SStructPMatrixSetSymmetric( hypre_SStructPMatrix *pmatrix, HYPRE_Int var, @@ -603,6 +694,76 @@ hypre_SStructPMatrixSetSymmetric( hypre_SStructPMatrix *pmatrix, return hypre_error_flag; } +#else +/*-------------------------------------------------------------------------- + * NOTE: Should we have an accessor macro for doing this job? + * How would we call it? + *--------------------------------------------------------------------------*/ +HYPRE_Int +hypre_SStructPMatrixSetSymmetric( hypre_SStructPMatrix *pmatrix, + HYPRE_Int var, + HYPRE_Int to_var, + HYPRE_Int symmetric ) +{ + HYPRE_Int **pmsymmetric = hypre_SStructPMatrixSymmetric(pmatrix); + + pmsymmetric[var][to_var] = symmetric; + + return hypre_error_flag; +} +#endif + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatrixSetCEntries( hypre_SStructPMatrix *pmatrix, + HYPRE_Int var, + HYPRE_Int to_var, + HYPRE_Int num_centries, + HYPRE_Int *centries ) +{ + HYPRE_Int **pmnum_centries = hypre_SStructPMatrixNumCEntries(pmatrix); + HYPRE_Int ***pmcentries = hypre_SStructPMatrixCEntries(pmatrix); + HYPRE_Int i; + + pmnum_centries[var][to_var] = num_centries; + for (i = 0; i < num_centries; i++) + { + pmcentries[var][to_var][i] = centries[i]; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * NOTE: Should we have an accessor macro for doing this job? + * How would we call it? + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatrixSetDomainStride( hypre_SStructPMatrix *pmatrix, + hypre_Index dom_stride ) +{ + hypre_CopyIndex(dom_stride, hypre_SStructPMatrixDomainStride(pmatrix)); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * NOTE: Should we have an accessor macro for doing this job? + * How would we call it? + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatrixSetRangeStride( hypre_SStructPMatrix *pmatrix, + hypre_Index ran_stride ) +{ + hypre_CopyIndex(ran_stride, hypre_SStructPMatrixRangeStride(pmatrix)); + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -623,7 +784,8 @@ hypre_SStructPMatrixPrint( const char *filename, smatrix = hypre_SStructPMatrixSMatrix(pmatrix, vi, vj); if (smatrix != NULL) { - hypre_sprintf(new_filename, "%s.%02d.%02d", filename, vi, vj); + // hypre_sprintf(new_filename, "%s.v%1d%1d", filename, vi, vj); + hypre_sprintf(new_filename, "%s.%1d%1d", filename, vi, vj); hypre_StructMatrixPrint(new_filename, smatrix, all); } } @@ -632,6 +794,31 @@ hypre_SStructPMatrixPrint( const char *filename, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * Returns the diagonal of a SStructPMatrix as a SStructPVector + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatrixGetDiagonal( hypre_SStructPMatrix *pmatrix, + hypre_SStructPVector *pdiag ) +{ + HYPRE_Int nvars = hypre_SStructPMatrixNVars(pmatrix); + hypre_StructMatrix *smatrix; + hypre_StructVector *sdiag; + + HYPRE_Int var; + + for (var = 0; var < nvars; var++) + { + smatrix = hypre_SStructPMatrixSMatrix(pmatrix, var, var); + sdiag = hypre_SStructPVectorSVector(pdiag, var); + + hypre_StructMatrixGetDiagonal(smatrix, sdiag); + } + + return hypre_error_flag; +} + /*========================================================================== * SStructUMatrix routines *==========================================================================*/ @@ -640,143 +827,182 @@ hypre_SStructPMatrixPrint( const char *filename, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_SStructUMatrixInitialize( hypre_SStructMatrix *matrix ) +hypre_SStructUMatrixInitialize( hypre_SStructMatrix *matrix, + HYPRE_MemoryLocation memory_location ) { - HYPRE_Int ndim = hypre_SStructMatrixNDim(matrix); - HYPRE_IJMatrix ijmatrix = hypre_SStructMatrixIJMatrix(matrix); - HYPRE_Int matrix_type = hypre_SStructMatrixObjectType(matrix); - hypre_SStructGraph *graph = hypre_SStructMatrixGraph(matrix); - hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); - HYPRE_Int nparts = hypre_SStructGraphNParts(graph); - hypre_SStructPGrid **pgrids = hypre_SStructGraphPGrids(graph); - hypre_SStructStencil ***stencils = hypre_SStructGraphStencils(graph); - HYPRE_Int nUventries = hypre_SStructGraphNUVEntries(graph); - HYPRE_Int *iUventries = hypre_SStructGraphIUVEntries(graph); - hypre_SStructUVEntry **Uventries = hypre_SStructGraphUVEntries(graph); - HYPRE_Int **nvneighbors = hypre_SStructGridNVNeighbors(grid); + HYPRE_Int ndim = hypre_SStructMatrixNDim(matrix); + HYPRE_IJMatrix ijmatrix = hypre_SStructMatrixIJMatrix(matrix); + HYPRE_Int matrix_type = hypre_SStructMatrixObjectType(matrix); + hypre_SStructGraph *graph = hypre_SStructMatrixGraph(matrix); + hypre_SStructStencil ***stencils = hypre_SStructGraphStencils(graph); + HYPRE_Int nUventries = hypre_SStructGraphNUVEntries(graph); + HYPRE_BigInt *iUventries = hypre_SStructGraphIUVEntries(graph); + hypre_SStructUVEntry **Uventries = hypre_SStructGraphUVEntries(graph); + HYPRE_Int nparts = hypre_SStructGraphNParts(graph); + hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); + HYPRE_Int **nvneighbors = hypre_SStructGridNVNeighbors(grid); + + hypre_SStructPGrid *pgrid; hypre_StructGrid *sgrid; hypre_SStructStencil *stencil; - HYPRE_Int *split; - HYPRE_Int nvars; - HYPRE_Int nrows, nnzs ; - HYPRE_BigInt rowstart; - HYPRE_Int part, var, entry, b, m, mi; - HYPRE_Int *row_sizes; - HYPRE_Int max_row_size; - hypre_BoxArray *boxes; hypre_Box *box; hypre_Box *ghost_box; hypre_IndexRef start; hypre_Index loop_size, stride; - HYPRE_IJMatrixSetObjectType(ijmatrix, HYPRE_PARCSR); + HYPRE_Int *split; + HYPRE_Int nvars; + HYPRE_Int nrows, nnzrow = 0; + HYPRE_BigInt rowstart; + HYPRE_Int part, var, entry, b, m; + HYPRE_BigInt iUventry; + HYPRE_Int *row_sizes; + HYPRE_Int max_size = 0; -#ifdef HYPRE_USING_OPENMP - HYPRE_IJMatrixSetOMPFlag(ijmatrix, 1); /* Use OpenMP */ +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(memory_location); #endif + HYPRE_IJMatrixSetObjectType(ijmatrix, HYPRE_PARCSR); if (matrix_type == HYPRE_SSTRUCT || matrix_type == HYPRE_STRUCT) { rowstart = hypre_SStructGridGhstartRank(grid); - nrows = hypre_SStructGridGhlocalSize(grid) ; + nrows = hypre_SStructGridGhlocalSize(grid); } else /* matrix_type == HYPRE_PARCSR */ { rowstart = hypre_SStructGridStartRank(grid); - nrows = hypre_SStructGridLocalSize(grid); + nrows = hypre_SStructGridLocalSize(grid); } - /* set row sizes */ + /* Set row_sizes and max_size */ m = 0; - max_row_size = 0; ghost_box = hypre_BoxCreate(ndim); - row_sizes = hypre_CTAlloc(HYPRE_Int, nrows, HYPRE_MEMORY_HOST); +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { + row_sizes = NULL; + } + else +#endif + { + row_sizes = hypre_CTAlloc(HYPRE_Int, nrows, HYPRE_MEMORY_HOST); + } hypre_SetIndex(stride, 1); for (part = 0; part < nparts; part++) { - nvars = hypre_SStructPGridNVars(pgrids[part]); + pgrid = hypre_SStructGridPGrid(grid, part); + nvars = hypre_SStructPGridNVars(pgrid); + + /* This part is active in the range grid */ for (var = 0; var < nvars; var++) { - sgrid = hypre_SStructPGridSGrid(pgrids[part], var); + sgrid = hypre_SStructPGridSGrid(pgrid, var); stencil = stencils[part][var]; split = hypre_SStructMatrixSplit(matrix, part, var); - nnzs = 0; + nnzrow = 0; for (entry = 0; entry < hypre_SStructStencilSize(stencil); entry++) { if (split[entry] == -1) { - nnzs++; + nnzrow++; } } #if 0 /* TODO: For now, assume stencil is full/complete */ if (hypre_SStructMatrixSymmetric(matrix)) { - nnzs = 2 * nnzs - 1; + nnzrow = 2 * nnzrow - 1; } #endif - boxes = hypre_StructGridBoxes(sgrid); - hypre_ForBoxI(b, boxes) + +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_HOST) +#endif { - box = hypre_BoxArrayBox(boxes, b); - hypre_CopyBox(box, ghost_box); - if (matrix_type == HYPRE_SSTRUCT || matrix_type == HYPRE_STRUCT) - { - hypre_BoxGrowByArray(ghost_box, hypre_StructGridNumGhost(sgrid)); - } - start = hypre_BoxIMin(box); - hypre_BoxGetSize(box, loop_size); - zypre_BoxLoop1Begin(hypre_SStructMatrixNDim(matrix), loop_size, - ghost_box, start, stride, mi); + boxes = hypre_StructGridBoxes(sgrid); + hypre_ForBoxI(b, boxes) { - row_sizes[m + mi] = nnzs; - } - zypre_BoxLoop1End(mi); + box = hypre_BoxArrayBox(boxes, b); + hypre_CopyBox(box, ghost_box); + if (matrix_type == HYPRE_SSTRUCT || matrix_type == HYPRE_STRUCT) + { + hypre_BoxGrowByArray(ghost_box, hypre_StructGridNumGhost(sgrid)); + } + + start = hypre_BoxIMin(box); + hypre_BoxGetSize(box, loop_size); + hypre_BoxLoop1BeginHost(ndim, loop_size, ghost_box, start, stride, mi); + { + row_sizes[m + mi] = nnzrow; + } + hypre_BoxLoop1EndHost(mi); - m += hypre_BoxVolume(ghost_box); + m += hypre_BoxVolume(ghost_box); + } } - max_row_size = hypre_max(max_row_size, nnzs); + max_size = hypre_max(max_size, nnzrow); if (nvneighbors[part][var]) { - max_row_size = - hypre_max(max_row_size, hypre_SStructStencilSize(stencil)); + max_size = hypre_max(max_size, hypre_SStructStencilSize(stencil)); } - } - } + } /* loop on variables */ + } /* loop on parts */ hypre_BoxDestroy(ghost_box); - /* GEC0902 essentially for each UVentry we figure out how many extra columns - * we need to add to the rowsizes */ + /* GEC0902 essentially for each UVentry we figure out how many + * extra columns we need to add to the rowsizes */ /* RDF: THREAD? */ for (entry = 0; entry < nUventries; entry++) { - mi = iUventries[entry]; - m = hypre_SStructUVEntryRank(Uventries[mi]) - rowstart; + iUventry = iUventries[entry]; + m = (HYPRE_Int) (hypre_SStructUVEntryRank(Uventries[iUventry]) - rowstart); if ((m > -1) && (m < nrows)) { - row_sizes[m] += hypre_SStructUVEntryNUEntries(Uventries[mi]); - max_row_size = hypre_max(max_row_size, row_sizes[m]); +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_HOST) +#endif + { + row_sizes[m] += hypre_SStructUVEntryNUEntries(Uventries[iUventry]); + } + max_size = hypre_max(max_size, + nnzrow + hypre_SStructUVEntryNUEntries(Uventries[iUventry])); } } - /* ZTODO: Update row_sizes based on neighbor off-part couplings */ - HYPRE_IJMatrixSetRowSizes (ijmatrix, (const HYPRE_Int *) row_sizes); - - hypre_TFree(row_sizes, HYPRE_MEMORY_HOST); +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_HOST) +#endif + { + /* ZTODO: Update row_sizes based on neighbor off-part couplings */ + HYPRE_IJMatrixSetRowSizes(ijmatrix, (const HYPRE_Int *) row_sizes); + 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_SStructMatrixTmpSize(matrix) = max_size; + hypre_SStructMatrixTmpRowCoords(matrix) = hypre_CTAlloc(HYPRE_BigInt, max_size, + HYPRE_MEMORY_HOST); + hypre_SStructMatrixTmpColCoords(matrix) = hypre_CTAlloc(HYPRE_BigInt, max_size, + HYPRE_MEMORY_HOST); + hypre_SStructMatrixTmpCoeffs(matrix) = hypre_CTAlloc(HYPRE_Complex, max_size, + HYPRE_MEMORY_HOST); +#if defined (HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { + hypre_SStructMatrixTmpRowCoordsDevice(matrix) = hypre_CTAlloc(HYPRE_BigInt, max_size, + HYPRE_MEMORY_DEVICE); + hypre_SStructMatrixTmpColCoordsDevice(matrix) = hypre_CTAlloc(HYPRE_BigInt, max_size, + HYPRE_MEMORY_DEVICE); + hypre_SStructMatrixTmpCoeffsDevice(matrix) = hypre_CTAlloc(HYPRE_Complex, max_size, + HYPRE_MEMORY_DEVICE); + } +#endif - HYPRE_IJMatrixInitialize(ijmatrix); + HYPRE_IJMatrixInitialize_v2(ijmatrix, memory_location); HYPRE_IJMatrixGetObject(ijmatrix, (void **) &hypre_SStructMatrixParCSRMatrix(matrix)); @@ -790,6 +1016,8 @@ hypre_SStructUMatrixInitialize( hypre_SStructMatrix *matrix ) * * 9/09 - AB: modified to use the box manager - here we need to check the * neighbor box manager also + * + * TODO: Do we really need dom_grid here? *--------------------------------------------------------------------------*/ HYPRE_Int @@ -802,15 +1030,20 @@ hypre_SStructUMatrixSetValues( hypre_SStructMatrix *matrix, HYPRE_Complex *values, HYPRE_Int action ) { - HYPRE_Int ndim = hypre_SStructMatrixNDim(matrix); - HYPRE_IJMatrix ijmatrix = hypre_SStructMatrixIJMatrix(matrix); - hypre_SStructGraph *graph = hypre_SStructMatrixGraph(matrix); - hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); - hypre_SStructGrid *dom_grid = hypre_SStructGraphDomainGrid(graph); - hypre_SStructStencil *stencil = hypre_SStructGraphStencil(graph, part, var); - HYPRE_Int *vars = hypre_SStructStencilVars(stencil); - hypre_Index *shape = hypre_SStructStencilShape(stencil); - HYPRE_Int size = hypre_SStructStencilSize(stencil); + HYPRE_Int ndim = hypre_SStructMatrixNDim(matrix); + HYPRE_IJMatrix ijmatrix = hypre_SStructMatrixIJMatrix(matrix); + hypre_SStructGraph *graph = hypre_SStructMatrixGraph(matrix); + HYPRE_Int matrix_type = hypre_SStructMatrixObjectType(matrix); + hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); + hypre_SStructGrid *dom_grid = hypre_SStructGraphDomGrid(graph); + hypre_SStructStencil *stencil = hypre_SStructGraphStencil(graph, part, var); + HYPRE_Int *vars = hypre_SStructStencilVars(stencil); + hypre_Index *shape = hypre_SStructStencilShape(stencil); + HYPRE_Int size = hypre_SStructStencilSize(stencil); + + HYPRE_Complex *h_values; + HYPRE_MemoryLocation memory_location = hypre_IJMatrixMemoryLocation(ijmatrix); + hypre_IndexRef offset; hypre_Index to_index; hypre_SStructUVEntry *Uventry; @@ -822,9 +1055,8 @@ hypre_SStructUMatrixSetValues( hypre_SStructMatrix *matrix, HYPRE_Complex *coeffs; HYPRE_Int i, entry; HYPRE_BigInt Uverank; - HYPRE_Int matrix_type = hypre_SStructMatrixObjectType(matrix); - HYPRE_Complex *h_values; - HYPRE_MemoryLocation memory_location = hypre_IJMatrixMemoryLocation(ijmatrix); + + HYPRE_ANNOTATE_FUNC_BEGIN; hypre_SStructGridFindBoxManEntry(grid, part, index, var, &boxman_entry); @@ -839,6 +1071,9 @@ hypre_SStructUMatrixSetValues( hypre_SStructMatrix *matrix, hypre_error_in_arg(1); hypre_error_in_arg(2); hypre_error_in_arg(3); + + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } else @@ -850,12 +1085,13 @@ hypre_SStructUMatrixSetValues( hypre_SStructMatrix *matrix, &row_coord, matrix_type); col_coords = hypre_SStructMatrixTmpColCoords(matrix); - coeffs = hypre_SStructMatrixTmpCoeffs(matrix); + coeffs = hypre_SStructMatrixTmpCoeffs(matrix); - if ( hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE ) + 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, memory_location); + hypre_TMemcpy(h_values, values, HYPRE_Complex, nentries, + HYPRE_MEMORY_HOST, memory_location); } else { @@ -889,7 +1125,7 @@ hypre_SStructUMatrixSetValues( hypre_SStructMatrix *matrix, hypre_SStructBoxManEntryGetGlobalRank(boxman_entry, to_index, &col_coords[ncoeffs], matrix_type); - coeffs[ncoeffs] = h_values[i]; + coeffs[ncoeffs] = values[i]; ncoeffs++; } } @@ -902,6 +1138,11 @@ hypre_SStructUMatrixSetValues( hypre_SStructMatrix *matrix, if (Uverank > -1) { Uventry = hypre_SStructGraphUVEntry(graph, Uverank); + + /* Sanity check */ + //hypre_assert(entry < hypre_SStructUVEntryNUEntries(Uventry)); + + /* Set column number and coefficient */ col_coords[ncoeffs] = hypre_SStructUVEntryToRank(Uventry, entry); coeffs[ncoeffs] = h_values[i]; ncoeffs++; @@ -932,21 +1173,25 @@ hypre_SStructUMatrixSetValues( hypre_SStructMatrix *matrix, hypreDevice_BigIntFilln(hypre_SStructMatrixTmpRowCoordsDevice(matrix), ncoeffs, row_coord); - hypre_TMemcpy(hypre_SStructMatrixTmpColCoordsDevice(matrix), col_coords, HYPRE_BigInt, ncoeffs, + hypre_TMemcpy(hypre_SStructMatrixTmpColCoordsDevice(matrix), + col_coords, HYPRE_BigInt, ncoeffs, memory_location, HYPRE_MEMORY_HOST); - hypre_TMemcpy(hypre_SStructMatrixTmpCoeffsDevice(matrix), coeffs, HYPRE_Complex, ncoeffs, + hypre_TMemcpy(hypre_SStructMatrixTmpCoeffsDevice(matrix), + coeffs, HYPRE_Complex, ncoeffs, memory_location, HYPRE_MEMORY_HOST); if (action > 0) { - HYPRE_IJMatrixAddToValues(ijmatrix, ncoeffs, NULL, hypre_SStructMatrixTmpRowCoordsDevice(matrix), + 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, hypre_SStructMatrixTmpRowCoordsDevice(matrix), + HYPRE_IJMatrixSetValues(ijmatrix, ncoeffs, NULL, + hypre_SStructMatrixTmpRowCoordsDevice(matrix), (const HYPRE_BigInt *) hypre_SStructMatrixTmpColCoordsDevice(matrix), (const HYPRE_Complex *) hypre_SStructMatrixTmpCoeffsDevice(matrix)); } @@ -983,6 +1228,8 @@ hypre_SStructUMatrixSetValues( hypre_SStructMatrix *matrix, hypre_TFree(h_values, HYPRE_MEMORY_HOST); } + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } @@ -992,6 +1239,7 @@ hypre_SStructUMatrixSetValues( hypre_SStructMatrix *matrix, * (action > 0): add-to values * (action = 0): set values * (action < 0): get values + * (action =-2): get values and zero out * * 9/09 - AB: modified to use the box manager- here we need to check the * neighbor box manager also @@ -1010,64 +1258,99 @@ hypre_SStructUMatrixSetValues( hypre_SStructMatrix *matrix, *--------------------------------------------------------------------------*/ 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_SStructUMatrixSetBoxValuesHelper( 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_IJMatrix ijmatrix ) { - HYPRE_Int ndim = hypre_SStructMatrixNDim(matrix); - HYPRE_IJMatrix ijmatrix = hypre_SStructMatrixIJMatrix(matrix); - hypre_SStructGraph *graph = hypre_SStructMatrixGraph(matrix); - hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); - hypre_SStructGrid *dom_grid = hypre_SStructGraphDomainGrid(graph); - hypre_SStructStencil *stencil = hypre_SStructGraphStencil(graph, part, var); - HYPRE_Int *vars = hypre_SStructStencilVars(stencil); - hypre_Index *shape = hypre_SStructStencilShape(stencil); - HYPRE_Int size = hypre_SStructStencilSize(stencil); + HYPRE_Int ndim = hypre_SStructMatrixNDim(matrix); + HYPRE_Int matrix_type = hypre_SStructMatrixObjectType(matrix); + hypre_SStructPMatrix *pmatrix = hypre_SStructMatrixPMatrix(matrix, part); + hypre_SStructGraph *graph = hypre_SStructMatrixGraph(matrix); + hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); + hypre_SStructGrid *dom_grid = hypre_SStructGraphDomGrid(graph); + hypre_SStructStencil *stencil = hypre_SStructGraphStencil(graph, part, var); + HYPRE_Int *vars = hypre_SStructStencilVars(stencil); + hypre_Index *shape = hypre_SStructStencilShape(stencil); + HYPRE_Int size = hypre_SStructStencilSize(stencil); + hypre_IndexRef dom_stride = hypre_SStructPMatrixDomainStride(pmatrix); + HYPRE_MemoryLocation memory_location = hypre_IJMatrixMemoryLocation(ijmatrix); + hypre_IndexRef offset; hypre_BoxManEntry **boxman_entries; HYPRE_Int nboxman_entries; hypre_BoxManEntry **boxman_to_entries; HYPRE_Int nboxman_to_entries; - HYPRE_Int nrows; - HYPRE_Int *ncols, *row_indexes;; + HYPRE_Int nrows, num_nonzeros; + HYPRE_Int *ncols, *row_indexes; HYPRE_BigInt *rows, *cols; HYPRE_Complex *ijvalues; - hypre_Box *box = hypre_BoxCreate(ndim); + HYPRE_Int *values_map; + hypre_Box *box; hypre_Box *to_box; hypre_Box *map_box; hypre_Box *int_box; - hypre_Index index, stride, loop_size; - hypre_IndexRef start; + hypre_Box *map_vbox; + hypre_Index index; + hypre_Index unit_stride; + hypre_Index loop_size; + hypre_Index mstart; + hypre_IndexRef vstart; hypre_Index rs, cs; HYPRE_BigInt row_base, col_base; - HYPRE_Int ei, entry, ii, jj; - HYPRE_Int matrix_type = hypre_SStructMatrixObjectType(matrix); - HYPRE_MemoryLocation memory_location = hypre_IJMatrixMemoryLocation(ijmatrix); + HYPRE_Int ei, entry, i, ii, jj; +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(memory_location); +#endif + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("SStructUMatrixSetBoxValuesHelper"); /*------------------------------------------ * all stencil entries *------------------------------------------*/ + hypre_SetIndex(unit_stride, 1); if (entries[0] < size) { - to_box = hypre_BoxCreate(ndim); - map_box = hypre_BoxCreate(ndim); - int_box = hypre_BoxCreate(ndim); - - nrows = hypre_BoxVolume(set_box); - 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); + box = hypre_BoxCreate(ndim); + to_box = hypre_BoxCreate(ndim); + map_box = hypre_BoxCreate(ndim); + int_box = hypre_BoxCreate(ndim); + map_vbox = hypre_BoxCreate(ndim); + + nrows = hypre_BoxVolume(set_box); + num_nonzeros = nrows * nentries; + ncols = hypre_CTAlloc(HYPRE_Int, nrows, memory_location); + rows = hypre_CTAlloc(HYPRE_BigInt, nrows, memory_location); + row_indexes = hypre_CTAlloc(HYPRE_Int, nrows + 1, memory_location); + cols = hypre_CTAlloc(HYPRE_BigInt, num_nonzeros, memory_location); + ijvalues = hypre_TAlloc(HYPRE_Complex, num_nonzeros, memory_location); + values_map = hypre_TAlloc(HYPRE_Int, num_nonzeros, memory_location); + + /* TODO (VPM): We could wrap this into a separate function */ +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + if (exec == HYPRE_EXEC_DEVICE) + { + hypreDevice_IntFilln(values_map, num_nonzeros, -1); + } + else +#endif + { +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < num_nonzeros; i++) + { + values_map[i] = -1; + } + } hypre_SStructGridIntersect(grid, part, var, set_box, -1, &boxman_entries, &nboxman_entries); @@ -1076,97 +1359,115 @@ hypre_SStructUMatrixSetBoxValues( hypre_SStructMatrix *matrix, { hypre_SStructBoxManEntryGetStrides(boxman_entries[ii], rs, matrix_type); - hypre_CopyBox(set_box, box); hypre_BoxManEntryGetExtents(boxman_entries[ii], - hypre_BoxIMin(map_box), hypre_BoxIMax(map_box)); - hypre_IntersectBoxes(box, map_box, int_box); + hypre_BoxIMin(map_box), + hypre_BoxIMax(map_box)); + hypre_IntersectBoxes(set_box, map_box, int_box); hypre_CopyBox(int_box, box); /* For each index in 'box', compute a row of length <= nentries and * insert it into an nentries-length segment of 'cols' and 'ijvalues'. * This may result in gaps, but IJSetValues2() is designed for that. */ - nrows = hypre_BoxVolume(box); -#undef DEVICE_VAR -#define DEVICE_VAR is_device_ptr(ncols,row_indexes) - hypre_LoopBegin(nrows, i) +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + if (exec == HYPRE_EXEC_DEVICE) { - ncols[i] = 0; - row_indexes[i] = i * nentries; + hypreDevice_IntFilln(ncols, nrows, 0); + HYPRE_THRUST_CALL( transform, + thrust::counting_iterator(0), + thrust::counting_iterator(nrows + 1), + row_indexes, + _1 * nentries ); + } + else +#endif + { +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < nrows; i++) + { + ncols[i] = 0; + row_indexes[i] = i * nentries; + } } - hypre_LoopEnd() -#undef DEVICE_VAR -#define DEVICE_VAR for (ei = 0; ei < nentries; ei++) { - entry = entries[ei]; + entry = entries[ei]; + offset = shape[entry]; hypre_CopyBox(box, to_box); - - offset = shape[entry]; hypre_BoxShiftPos(to_box, offset); + hypre_CoarsenBox(to_box, NULL, dom_stride); hypre_SStructGridIntersect(dom_grid, part, vars[entry], to_box, -1, &boxman_to_entries, &nboxman_to_entries); for (jj = 0; jj < nboxman_to_entries; jj++) { - hypre_SStructBoxManEntryGetStrides(boxman_to_entries[jj], cs, matrix_type); - + hypre_SStructBoxManEntryGetStrides(boxman_to_entries[jj], + cs, matrix_type); hypre_BoxManEntryGetExtents(boxman_to_entries[jj], - hypre_BoxIMin(map_box), hypre_BoxIMax(map_box)); + hypre_BoxIMin(map_box), + hypre_BoxIMax(map_box)); hypre_IntersectBoxes(to_box, map_box, int_box); hypre_CopyIndex(hypre_BoxIMin(int_box), index); hypre_SStructBoxManEntryGetGlobalRank(boxman_to_entries[jj], index, &col_base, matrix_type); + hypre_RefineBox(int_box, NULL, dom_stride); hypre_BoxShiftNeg(int_box, offset); - hypre_CopyIndex(hypre_BoxIMin(int_box), index); + hypre_CopyIndex(hypre_BoxIMin(int_box), mstart); hypre_SStructBoxManEntryGetGlobalRank(boxman_entries[ii], - index, &row_base, matrix_type); + mstart, &row_base, matrix_type); + + hypre_CopyBox(value_box, map_vbox); + hypre_SStructMatrixMapDataBox(matrix, part, var, vars[entry], map_vbox); + hypre_SStructMatrixMapDataBox(matrix, part, var, vars[entry], int_box); - start = hypre_BoxIMin(int_box); + vstart = hypre_BoxIMin(int_box); hypre_BoxGetSize(int_box, loop_size); #if defined(HYPRE_USING_GPU) + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) { - hypre_assert(ndim <= 3); + //hypre_assert(ndim <= 3); - HYPRE_Int rs_0, rs_1, rs_2; - HYPRE_Int cs_0, cs_1, cs_2; + HYPRE_Int rs_0 = 0, rs_1 = 0, rs_2 = 0; + HYPRE_Int cs_0 = 0, cs_1 = 0, cs_2 = 0; if (ndim > 0) { - rs_0 = rs[0]; + rs_0 = rs[0] * dom_stride[0]; cs_0 = cs[0]; } if (ndim > 1) { - rs_1 = rs[1]; + rs_1 = rs[1] * dom_stride[1]; cs_1 = cs[1]; } if (ndim > 2) { - rs_2 = rs[2]; + rs_2 = rs[2] * dom_stride[2]; cs_2 = cs[2]; } #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); + box, mstart, dom_stride, mi, + map_vbox, vstart, unit_stride, vi); { - hypre_Index index; + hypre_Index loop_index; HYPRE_Int ci; - hypre_BoxLoopGetIndex(index); + hypre_BoxLoopGetIndex(loop_index); ci = mi * nentries + ncols[mi]; rows[mi] = row_base; @@ -1174,57 +1475,59 @@ hypre_SStructUMatrixSetBoxValues( hypre_SStructMatrix *matrix, if (ndim > 0) { - rows[mi] += index[0] * rs_0; - cols[ci] += index[0] * cs_0; + rows[mi] += loop_index[0] * rs_0; + cols[ci] += loop_index[0] * cs_0; } if (ndim > 1) { - rows[mi] += index[1] * rs_1; - cols[ci] += index[1] * cs_1; + rows[mi] += loop_index[1] * rs_1; + cols[ci] += loop_index[1] * cs_1; } if (ndim > 2) { - rows[mi] += index[2] * rs_2; - cols[ci] += index[2] * cs_2; + rows[mi] += loop_index[2] * rs_2; + cols[ci] += loop_index[2] * cs_2; } ijvalues[ci] = values[ei + vi * nentries]; + values_map[ei + vi * nentries] = ci; ncols[mi]++; } hypre_BoxLoop2End(mi, vi); #undef DEVICE_VAR #define DEVICE_VAR } -#else + else +#endif { hypre_BoxLoop2Begin(ndim, loop_size, - box, start, stride, mi, - value_box, start, stride, vi); + box, mstart, dom_stride, mi, + map_vbox, vstart, unit_stride, vi); { - hypre_Index index; - HYPRE_Int ci; + hypre_Index loop_index; + HYPRE_Int ci, d; - hypre_BoxLoopGetIndex(index); + hypre_BoxLoopGetIndex(loop_index); + //hypre_assert((mi >= 0) && (vi >= 0)); 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]; + rows[mi] += loop_index[d] * rs[d] * dom_stride[d]; + cols[ci] += loop_index[d] * cs[d]; } - + /* WM: todo - if doing a get, don't need to manipulate ijvalues here, right? + * likewise, if doing a set, don't need the values_map */ ijvalues[ci] = values[ei + vi * nentries]; + values_map[ei + vi * nentries] = ci; ncols[mi]++; } hypre_BoxLoop2End(mi, vi); } -#endif } /* end loop through boxman to entries */ hypre_TFree(boxman_to_entries, HYPRE_MEMORY_HOST); @@ -1249,11 +1552,66 @@ hypre_SStructUMatrixSetBoxValues( hypre_SStructMatrix *matrix, } else { - HYPRE_IJMatrixGetValues(ijmatrix, nrows, ncols, rows, cols, values); + if (action == -2) + { + /* Zero out entries gotten */ + HYPRE_IJMatrixGetValuesAndZeroOut(ijmatrix, nrows, ncols, + rows, row_indexes, cols, ijvalues); + } + else + { + HYPRE_IJMatrixGetValues2(ijmatrix, nrows, ncols, + rows, row_indexes, cols, ijvalues); + } } } /* end loop through boxman entries */ + /* WM: do backwards mapping from ijvalues to values if doing a get */ + /* WM: todo - put this in a boxloop to avoid unnecessary copies? */ + nrows = hypre_BoxVolume(set_box); + if (action < 0) + { +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + HYPRE_THRUST_CALL( for_each, + thrust::make_counting_iterator(0), + thrust::make_counting_iterator(num_nonzeros), + [ = ] __device__ (HYPRE_Int i) + { + if (values_map[i] >= 0) + { + values[i] = ijvalues[values_map[i]]; + } + }); +#elif defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( for_each, + oneapi::dpl::counting_iterator(0), + oneapi::dpl::counting_iterator(num_nonzeros), + [ = ] (HYPRE_Int i) + { + if (values_map[i] >= 0) + { + values[i] = ijvalues[values_map[i]]; + } + }); +#endif + } + else +#endif + { + for (i = 0; i < num_nonzeros; i++) + { + if (values_map[i] >= 0) + { + values[i] = ijvalues[values_map[i]]; + } + } + } + } + hypre_TFree(boxman_entries, HYPRE_MEMORY_HOST); hypre_TFree(ncols, memory_location); @@ -1261,10 +1619,17 @@ hypre_SStructUMatrixSetBoxValues( hypre_SStructMatrix *matrix, hypre_TFree(row_indexes, memory_location); hypre_TFree(cols, memory_location); hypre_TFree(ijvalues, memory_location); + hypre_TFree(values_map, memory_location); + hypre_BoxDestroy(box); hypre_BoxDestroy(to_box); hypre_BoxDestroy(map_box); hypre_BoxDestroy(int_box); + hypre_BoxDestroy(map_vbox); + +#if defined(DEBUG_SETBOX) + hypre_printf("%s: num_nonzeros: %d\n", __func__, num_nonzeros); +#endif } /*------------------------------------------ @@ -1286,7 +1651,8 @@ hypre_SStructUMatrixSetBoxValues( hypre_SStructMatrix *matrix, hypre_SerialBoxLoop0End(); } - hypre_BoxDestroy(box); + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; return hypre_error_flag; } @@ -1295,12 +1661,39 @@ hypre_SStructUMatrixSetBoxValues( hypre_SStructMatrix *matrix, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_SStructUMatrixAssemble( hypre_SStructMatrix *matrix ) -{ - HYPRE_IJMatrix ijmatrix = hypre_SStructMatrixIJMatrix(matrix); - - HYPRE_IJMatrixAssemble(ijmatrix); - +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_IJMatrix ijmatrix = hypre_SStructMatrixIJMatrix(matrix); + + hypre_SStructUMatrixSetBoxValuesHelper(matrix, part, set_box, var, + nentries, entries, value_box, values, + action, ijmatrix); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructUMatrixAssemble( hypre_SStructMatrix *matrix ) +{ + HYPRE_IJMatrix ijmatrix = hypre_SStructMatrixIJMatrix(matrix); + + HYPRE_ANNOTATE_FUNC_BEGIN; + + HYPRE_IJMatrixAssemble(ijmatrix); + + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } @@ -1308,6 +1701,37 @@ hypre_SStructUMatrixAssemble( hypre_SStructMatrix *matrix ) * SStructMatrix routines *==========================================================================*/ +/*-------------------------------------------------------------------------- + * Maps map_vbox in place to the index space where data is stored for S(vi,vj) + * + * Note: Since off-diagonal components of the SStructMatrix are being stored + * in the UMatrix, this function does not change map_vbox when vi != vj + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatrixMapDataBox( hypre_SStructMatrix *matrix, + HYPRE_Int part, + HYPRE_Int vi, + HYPRE_Int vj, + hypre_Box *map_vbox ) +{ + HYPRE_Int matrix_type = hypre_SStructMatrixObjectType(matrix); + hypre_SStructPMatrix *pmatrix; + hypre_StructMatrix *smatrix; + + if (matrix_type == HYPRE_SSTRUCT || matrix_type == HYPRE_STRUCT) + { + pmatrix = hypre_SStructMatrixPMatrix(matrix, part); + smatrix = hypre_SStructPMatrixSMatrix(pmatrix, vi, vj); + if (vi == vj) + { + hypre_StructMatrixMapDataBox(smatrix, map_vbox); + } + } + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -1475,6 +1899,7 @@ hypre_SStructMatrixSetBoxValues( HYPRE_SStructMatrix matrix, HYPRE_Int nUentries; hypre_SStructPMatrix *pmatrix; + HYPRE_ANNOTATE_FUNC_BEGIN; hypre_SStructMatrixSplitEntries(matrix, part, var, nentries, entries, &nSentries, &Sentries, @@ -1503,6 +1928,8 @@ hypre_SStructMatrixSetBoxValues( HYPRE_SStructMatrix matrix, value_box, values, action); } + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } @@ -1522,54 +1949,56 @@ hypre_SStructMatrixSetInterPartValues( HYPRE_SStructMatrix matrix, HYPRE_Complex *values, HYPRE_Int action ) { - HYPRE_Int ndim = hypre_SStructMatrixNDim(matrix); - hypre_SStructGraph *graph = hypre_SStructMatrixGraph(matrix); - hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); - hypre_SStructPMatrix *pmatrix; - hypre_SStructPGrid *pgrid; - - hypre_SStructStencil *stencil; - hypre_Index *shape; - HYPRE_Int *smap; - HYPRE_Int *vars, frvartype, tovartype; + HYPRE_Int ndim = hypre_SStructMatrixNDim(matrix); + hypre_IJMatrix *ij_matrix = hypre_SStructMatrixIJMatrix(matrix); + hypre_SStructGraph *graph = hypre_SStructMatrixGraph(matrix); + hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); + hypre_SStructPMatrix *pmatrix = hypre_SStructMatrixPMatrix(matrix, part); + hypre_SStructPGrid *pgrid = hypre_SStructPMatrixPGrid(pmatrix); + hypre_BoxArrayArray *pbnd_boxaa = hypre_SStructPGridPBndBoxArrayArray(pgrid, var); + HYPRE_Int *smap = hypre_SStructPMatrixSMap(pmatrix, var); + hypre_SStructVariable frvartype = hypre_SStructPGridVarType(pgrid, var); + hypre_SStructStencil *stencil = hypre_SStructPMatrixStencil(pmatrix, var); + hypre_Index *shape = hypre_SStructStencilShape(stencil); + HYPRE_Int *vars = hypre_SStructStencilVars(stencil); + HYPRE_MemoryLocation memloc = hypre_IJMatrixMemoryLocation(ij_matrix); + + hypre_SStructVariable tovartype; hypre_StructMatrix *smatrix; - hypre_Box *box, *ibox0, *ibox1, *tobox, *frbox; - hypre_Index stride, loop_size; + hypre_StructGrid *sgrid; + hypre_BoxArray *pbnd_boxa; + hypre_BoxArray *grid_boxes; + hypre_Box *grid_box, *box, *ibox0, *ibox1, *ibox2, *tobox, *frbox; + hypre_Index ustride, loop_size; hypre_IndexRef offset, start; hypre_BoxManEntry **frentries, **toentries; hypre_SStructBoxManInfo *frinfo, *toinfo; - HYPRE_Complex *tvalues = NULL; - HYPRE_Int tvalues_size = 0; + HYPRE_Complex *tvalues; + HYPRE_Int box_id; 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); - - pgrid = hypre_SStructPMatrixPGrid(pmatrix); - frvartype = hypre_SStructPGridVarType(pgrid, var); + HYPRE_Int entry, sentry, ei, fri, toi, i; + HYPRE_Int volume, tvalues_size = 16384; + hypre_SetIndex(ustride, 1); box = hypre_BoxCreate(ndim); ibox0 = hypre_BoxCreate(ndim); ibox1 = hypre_BoxCreate(ndim); + ibox2 = hypre_BoxCreate(ndim); tobox = hypre_BoxCreate(ndim); frbox = hypre_BoxCreate(ndim); - stencil = hypre_SStructPMatrixStencil(pmatrix, var); - smap = hypre_SStructPMatrixSMap(pmatrix, var); - shape = hypre_SStructStencilShape(stencil); - vars = hypre_SStructStencilVars(stencil); - - hypre_SetIndex(stride, 1); + /* Allocate memory */ + tvalues = hypre_TAlloc(HYPRE_Complex, tvalues_size, memloc); for (ei = 0; ei < nentries; ei++) { entry = entries[ei]; sentry = smap[entry]; offset = shape[entry]; - smatrix = hypre_SStructPMatrixSMatrix(pmatrix, var, vars[entry]); tovartype = hypre_SStructPGridVarType(pgrid, vars[entry]); + smatrix = hypre_SStructPMatrixSMatrix(pmatrix, var, vars[entry]); + sgrid = hypre_StructMatrixGrid(smatrix); + grid_boxes = hypre_StructGridBoxes(sgrid); /* shift box in the stencil offset direction */ hypre_CopyBox(set_box, box); @@ -1583,8 +2012,9 @@ hypre_SStructMatrixSetInterPartValues( HYPRE_SStructMatrix matrix, for (toi = 0; toi < ntoentries; toi++) { - hypre_BoxManEntryGetExtents( - toentries[toi], hypre_BoxIMin(tobox), hypre_BoxIMax(tobox)); + hypre_BoxManEntryGetExtents(toentries[toi], + hypre_BoxIMin(tobox), + hypre_BoxIMax(tobox)); hypre_IntersectBoxes(box, tobox, ibox0); if (hypre_BoxVolume(ibox0)) { @@ -1611,6 +2041,7 @@ hypre_SStructMatrixSetInterPartValues( HYPRE_SStructMatrix matrix, { continue; } + hypre_BoxManEntryGetInfo(frentries[fri], (void **) &frinfo); hypre_BoxManEntryGetInfo(toentries[toi], (void **) &toinfo); if ( hypre_SStructBoxManInfoType(frinfo) == @@ -1620,95 +2051,1097 @@ hypre_SStructMatrixSetInterPartValues( HYPRE_SStructMatrix matrix, } } - hypre_BoxManEntryGetExtents( - frentries[fri], hypre_BoxIMin(frbox), hypre_BoxIMax(frbox)); + hypre_BoxManEntryGetExtents(frentries[fri], + hypre_BoxIMin(frbox), + hypre_BoxIMax(frbox)); hypre_IntersectBoxes(ibox0, frbox, ibox1); 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, - memory_location); - tvalues_size = tvalues_new_size; + volume = hypre_BoxVolume(ibox1); + if (tvalues_size < volume) + { + tvalues = hypre_TReAlloc_v2(tvalues, HYPRE_Complex, + tvalues_size, HYPRE_Complex, + volume, memloc); + tvalues_size = volume; + } if (action >= 0) { - /* set or add */ + /* Update list of part boundaries */ + hypre_ForBoxI(i, grid_boxes) + { + box_id = hypre_StructGridID(sgrid, i); + grid_box = hypre_BoxArrayBox(grid_boxes, i); + hypre_IntersectBoxes(grid_box, ibox1, ibox2); + + pbnd_boxa = hypre_BoxArrayArrayBoxArray(pbnd_boxaa, box_id); + hypre_AppendBox(ibox2, pbnd_boxa); + } + /* set or add */ /* copy values into tvalues */ start = hypre_BoxIMin(ibox1); hypre_BoxGetSize(ibox1, loop_size); -#undef DEVICE_VAR -#define DEVICE_VAR is_device_ptr(tvalues,values) hypre_BoxLoop2Begin(ndim, loop_size, - ibox1, start, stride, mi, - value_box, start, stride, vi); + ibox1, start, ustride, mi, + value_box, start, ustride, vi); { tvalues[mi] = values[ei + vi * nentries]; } hypre_BoxLoop2End(mi, vi); -#undef DEVICE_VAR -#define DEVICE_VAR + /* put values into UMatrix */ - hypre_SStructUMatrixSetBoxValues( - matrix, part, ibox1, var, 1, &entry, ibox1, tvalues, action); + hypre_SStructUMatrixSetBoxValues(matrix, part, ibox1, var, 1, + &entry, ibox1, tvalues, action); + /* zero out values in PMatrix (possibly in ghost) */ - hypre_StructMatrixClearBoxValues( - smatrix, ibox1, 1, &sentry, -1, 1); + hypre_StructMatrixClearBoxValues(smatrix, ibox1, 1, &sentry, -1, 1); } else { - /* get */ - /* get values from UMatrix */ - hypre_SStructUMatrixSetBoxValues( - matrix, part, ibox1, var, 1, &entry, ibox1, tvalues, action); + hypre_SStructUMatrixSetBoxValues(matrix, part, ibox1, var, 1, + &entry, ibox1, tvalues, action); /* copy tvalues into values */ start = hypre_BoxIMin(ibox1); hypre_BoxGetSize(ibox1, loop_size); -#undef DEVICE_VAR -#define DEVICE_VAR is_device_ptr(tvalues,values) hypre_BoxLoop2Begin(ndim, loop_size, - ibox1, start, stride, mi, - value_box, start, stride, vi); + ibox1, start, ustride, mi, + value_box, start, ustride, vi); { values[ei + vi * nentries] = tvalues[mi]; } hypre_BoxLoop2End(mi, vi); -#undef DEVICE_VAR -#define DEVICE_VAR + } /* end if action */ } /* end if nonzero ibox1 */ } /* end of "from" boxman entries loop */ + hypre_TFree(frentries, HYPRE_MEMORY_HOST); } /* end if nonzero ibox0 */ } /* end of "to" boxman entries loop */ + hypre_TFree(toentries, HYPRE_MEMORY_HOST); } /* end of entries loop */ + /* Free memory */ hypre_BoxDestroy(box); hypre_BoxDestroy(ibox0); hypre_BoxDestroy(ibox1); + hypre_BoxDestroy(ibox2); hypre_BoxDestroy(tobox); hypre_BoxDestroy(frbox); - hypre_TFree(tvalues, memory_location); + hypre_TFree(tvalues, memloc); return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * Add to or set (overwrite) entries in S with entries from U where + * the sparsity pattern permits. + * + * (action > 0): add-to values + * (action = 0): set values + * + * WM: TODO - what if there are constant stencil entries? + * Not sure what the expected behavior should be. For now, avoid this case. + * WM: TODO - does this potentially screw up pre-existing communication packages? + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatrixCompressUToS( HYPRE_SStructMatrix A, + HYPRE_Int action ) +{ + HYPRE_MemoryLocation memory_location = hypre_SStructMatrixMemoryLocation(A); + HYPRE_Int nparts = hypre_SStructMatrixNParts(A); + HYPRE_Int *Sentries = hypre_SStructMatrixSEntries(A); + HYPRE_SStructGraph graph = hypre_SStructMatrixGraph(A); + hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); + HYPRE_Int **nvneighbors = hypre_SStructGridNVNeighbors(grid); + HYPRE_Int ndim = hypre_SStructGridNDim(grid); + + hypre_ParCSRMatrix *A_u = hypre_SStructMatrixParCSRMatrix(A); + hypre_CSRMatrix *A_ud = hypre_ParCSRMatrixDiag(A_u); + hypre_CSRMatrix *A_uo = hypre_ParCSRMatrixOffd(A_u); + HYPRE_Int num_rows = hypre_CSRMatrixNumRows(A_ud); + + hypre_SStructPMatrix *pmatrix; + hypre_StructMatrix *smatrix; + hypre_StructGrid *sgrid; + hypre_SStructStencil *stencil; + HYPRE_Int *split; + hypre_Index start, stride, loop_size; + hypre_BoxArray *grid_boxes; + hypre_Box *grid_box; + HYPRE_Int *num_ghost; + HYPRE_Int i, j, offset, volume, var, entry, part, nvars, nSentries, num_indices; + HYPRE_Real threshold = 0.9; + HYPRE_Int *indices[3] = {NULL, NULL, NULL}; + HYPRE_Int *indices_0 = NULL; + HYPRE_Int *indices_1 = NULL; + HYPRE_Int *indices_2 = NULL; + hypre_BoxArray *indices_boxa = NULL; + HYPRE_Int size; + HYPRE_Complex *values; + +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(memory_location); + + HYPRE_Int max_num_rownnz; + HYPRE_Int *nonzero_rows = NULL; + HYPRE_Int *nonzero_rows_end = NULL; + HYPRE_Int *all_indices_0 = NULL; + HYPRE_Int *all_indices_1 = NULL; + HYPRE_Int *all_indices_2 = NULL; + HYPRE_Int *box_nnzrows = NULL; + HYPRE_Int *box_nnzrows_end = NULL; +#endif + +#if defined(DEBUG_U2S) + char msg[128]; +#endif + + /* Return in the case of a trivial unstructured component */ + /* WM: TODO - safe to return based on local info? That is, no collective calls below? */ + if (!(hypre_CSRMatrixNumNonzeros(A_ud) + hypre_CSRMatrixNumNonzeros(A_uo))) + { + return hypre_error_flag; + } + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("SStructMatrixCompressUToS"); + + /* Create work variables */ + grid_box = hypre_BoxCreate(ndim); + +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { +#if defined(HYPRE_USING_SYCL) + /* WM: todo - sycl */ +#else + max_num_rownnz = hypre_min(num_rows, + hypre_CSRMatrixNumRownnz(A_ud) + + hypre_CSRMatrixNumRownnz(A_uo)); + + if (hypre_CSRMatrixRownnz(A_ud) && hypre_CSRMatrixRownnz(A_uo)) + { + nonzero_rows = hypre_TAlloc(HYPRE_Int, max_num_rownnz, HYPRE_MEMORY_DEVICE); + HYPRE_THRUST_CALL( merge, + hypre_CSRMatrixRownnz(A_ud), + hypre_CSRMatrixRownnz(A_ud) + hypre_CSRMatrixNumRownnz(A_ud), + hypre_CSRMatrixRownnz(A_uo), + hypre_CSRMatrixRownnz(A_uo) + hypre_CSRMatrixNumRownnz(A_uo), + nonzero_rows ); + } + else if (hypre_CSRMatrixRownnz(A_ud)) + { + nonzero_rows = hypre_CSRMatrixRownnz(A_ud); + } + + if (nonzero_rows) + { + nonzero_rows_end = HYPRE_THRUST_CALL(unique, + nonzero_rows, + nonzero_rows + max_num_rownnz); + } + else + { + nonzero_rows = hypre_TAlloc(HYPRE_Int, num_rows, HYPRE_MEMORY_DEVICE); + HYPRE_THRUST_CALL( sequence, nonzero_rows, nonzero_rows + num_rows ); + nonzero_rows_end = nonzero_rows + num_rows; + } +#endif + } +#endif + + /* Set work arrays */ +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { + if (ndim > 0) + { + all_indices_0 = hypre_TAlloc(HYPRE_Int, num_rows, HYPRE_MEMORY_DEVICE); + indices_0 = hypre_TAlloc(HYPRE_Int, num_rows, HYPRE_MEMORY_DEVICE); + indices[0] = hypre_TAlloc(HYPRE_Int, num_rows, HYPRE_MEMORY_HOST); + } + + if (ndim > 1) + { + all_indices_1 = hypre_TAlloc(HYPRE_Int, num_rows, HYPRE_MEMORY_DEVICE); + indices_1 = hypre_TAlloc(HYPRE_Int, num_rows, HYPRE_MEMORY_DEVICE); + indices[1] = hypre_TAlloc(HYPRE_Int, num_rows, HYPRE_MEMORY_HOST); + } + + if (ndim > 2) + { + all_indices_2 = hypre_TAlloc(HYPRE_Int, num_rows, HYPRE_MEMORY_DEVICE); + indices_2 = hypre_TAlloc(HYPRE_Int, num_rows, HYPRE_MEMORY_DEVICE); + indices[2] = hypre_TAlloc(HYPRE_Int, num_rows, HYPRE_MEMORY_HOST); + } + + box_nnzrows = hypre_TAlloc(HYPRE_Int, num_rows, HYPRE_MEMORY_DEVICE); + } + else +#endif + { + if (ndim > 0) { indices_0 = hypre_CTAlloc(HYPRE_Int, num_rows, HYPRE_MEMORY_HOST); } + if (ndim > 1) { indices_1 = hypre_CTAlloc(HYPRE_Int, num_rows, HYPRE_MEMORY_HOST); } + if (ndim > 2) { indices_2 = hypre_CTAlloc(HYPRE_Int, num_rows, HYPRE_MEMORY_HOST); } + } + + /* Set entries of ij_Ahat */ + offset = 0; + for (part = 0; part < nparts; part++) + { + pmatrix = hypre_SStructMatrixPMatrix(A, part); + nvars = hypre_SStructPMatrixNVars(pmatrix); + + for (var = 0; var < nvars; var++) + { + split = hypre_SStructMatrixSplit(A, part, var); + smatrix = hypre_SStructPMatrixSMatrix(pmatrix, var, var); + stencil = hypre_SStructGraphStencil(graph, part, var); + sgrid = hypre_StructMatrixGrid(smatrix); + + nSentries = 0; + for (entry = 0; entry < hypre_SStructStencilSize(stencil); entry++) + { + if (split[entry] > -1) + { + Sentries[nSentries] = split[entry]; + nSentries++; + } + } + + grid_boxes = hypre_StructGridBoxes(sgrid); + + /* Loop over boxes */ + hypre_ForBoxI(i, grid_boxes) + { + /* WM: todo - I'm using the struct grid box grown by + num_ghosts instead of the matrix data space again here */ + hypre_CopyBox(hypre_BoxArrayBox(grid_boxes, i), grid_box); + num_ghost = hypre_StructGridNumGhost(sgrid); + hypre_BoxGrowByArray(grid_box, num_ghost); + hypre_BoxGetSize(grid_box, loop_size); + volume = hypre_BoxVolume(grid_box); + hypre_SetIndex(stride, 1); + hypre_CopyToIndex(hypre_BoxIMin(grid_box), ndim, start); + +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { + /* Get ALL the indices */ + hypre_BoxLoop1Begin(ndim, loop_size, grid_box, start, stride, ii); + { + hypre_Index index; + hypre_BoxLoopGetIndex(index); + if (ndim > 0) + { + all_indices_0[ii] = index[0] + start[0]; + } + if (ndim > 1) + { + all_indices_1[ii] = index[1] + start[1]; + } + if (ndim > 2) + { + all_indices_2[ii] = index[2] + start[2]; + } + } + hypre_BoxLoop1End(ii); + +#if defined(HYPRE_USING_SYCL) + /* WM: todo - sycl */ +#else + /* Get the nonzero rows for this box */ + box_nnzrows_end = HYPRE_THRUST_CALL( copy_if, + nonzero_rows, + nonzero_rows_end, + box_nnzrows, + in_range(offset, offset + volume) ); + HYPRE_THRUST_CALL( transform, + box_nnzrows, + box_nnzrows_end, + thrust::make_constant_iterator(offset), + box_nnzrows, + thrust::minus() ); + num_indices = box_nnzrows_end - box_nnzrows; + + /* Gather indices at non-zero rows of A_u */ + if (ndim > 0) + { + HYPRE_THRUST_CALL( gather, box_nnzrows, box_nnzrows_end, all_indices_0, indices_0 ); + } + + if (ndim > 1) + { + HYPRE_THRUST_CALL( gather, box_nnzrows, box_nnzrows_end, all_indices_1, indices_1 ); + } + + if (ndim > 2) + { + HYPRE_THRUST_CALL( gather, box_nnzrows, box_nnzrows_end, all_indices_2, indices_2 ); + } +#endif // defined(HYPRE_USING_SYCL) + } + else +#endif // defined(HYPRE_USING_GPU) + { + num_indices = 0; + hypre_BoxLoop1ReductionBeginHost(ndim, loop_size, grid_box, start, stride, ii, num_indices); + { + if (hypre_CSRMatrixI(A_ud)[offset + ii + 1] - + hypre_CSRMatrixI(A_ud)[offset + ii] + + hypre_CSRMatrixI(A_uo)[offset + ii + 1] - + hypre_CSRMatrixI(A_uo)[offset + ii] > 0) + { + hypre_Index index; + hypre_BoxLoopGetIndexHost(index); + if (ndim > 0) { indices_0[num_indices] = index[0] + start[0]; } + if (ndim > 1) { indices_1[num_indices] = index[1] + start[1]; } + if (ndim > 2) { indices_2[num_indices] = index[2] + start[2]; } + num_indices++; + } + } + hypre_BoxLoop1ReductionEndHost(ii, num_indices); + } + + /* WM: todo - these offsets for the unstructured indices only work + with no inter-variable couplings? */ + offset += volume; + + /* WM: todo - make sure threshold is set such that + there are no extra rows here! */ + if (num_indices) + { +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { + if (ndim > 0) hypre_TMemcpy(indices[0], indices_0, HYPRE_Int, num_indices, + HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + if (ndim > 1) hypre_TMemcpy(indices[1], indices_1, HYPRE_Int, num_indices, + HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + if (ndim > 2) hypre_TMemcpy(indices[2], indices_2, HYPRE_Int, num_indices, + HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); + } + else +#endif + { + indices[0] = indices_0; + indices[1] = indices_1; + indices[2] = indices_2; + } + + /* Create array of boxes from set of indices */ + hypre_BoxArrayCreateFromIndices(ndim, num_indices, indices, + threshold, &indices_boxa); + hypre_ForBoxI(j, indices_boxa) + { +#if defined (DEBUG_U2S) + hypre_sprintf(msg, "Part %d, Box %d - ", part, j); + hypre_BoxPrintDebug(msg, hypre_BoxArrayBox(indices_boxa, j)); +#endif + size = hypre_BoxVolume(hypre_BoxArrayBox(indices_boxa, j)) * nSentries; + values = hypre_CTAlloc(HYPRE_Complex, size, memory_location); + + /* INIT values from the structured matrix if action = 0 + (need current stencil values for entries that don't exist in U matrix) */ + if (action == 0) + { + hypre_SStructPMatrixSetBoxValues(pmatrix, + hypre_BoxArrayBox(indices_boxa, j), + var, nSentries, Sentries, + hypre_BoxArrayBox(indices_boxa, j), + values, -1); + } + + /* GET values from unstructured matrix */ + /* WM: note - I'm passing the entire box here, so I expect to get back + ALL intra-part connections in A_u */ + /* WM: question - What about inter-part connections? I hope that they are + always excluded here? Double check this. */ + hypre_SStructUMatrixSetBoxValues(A, part, + hypre_BoxArrayBox(indices_boxa, j), + var, nSentries, Sentries, + hypre_BoxArrayBox(indices_boxa, j), + values, -2); + + /* ADD values to structured matrix */ + /* WM: todo - just call to hypre_SStructMatrixSetBoxValues() instead of + * hypre_SStructPMatrixSetBoxValues() and hypre_SStructMatrixSetInterPartValues()? */ + hypre_SStructPMatrixSetBoxValues(pmatrix, + hypre_BoxArrayBox(indices_boxa, j), + var, nSentries, Sentries, + hypre_BoxArrayBox(indices_boxa, j), + values, action); + if (nvneighbors[part][var] > 0) + { + hypre_SStructMatrixSetInterPartValues(A, part, + hypre_BoxArrayBox(indices_boxa, j), + var, nSentries, Sentries, + hypre_BoxArrayBox(indices_boxa, j), + values, 1); + } + + /* Free memory */ + hypre_TFree(values, memory_location); + } + hypre_BoxArrayDestroy(indices_boxa); + indices_boxa = NULL; + } + } /* Loop over boxes */ + } /* Loop over vars */ + } /* Loop over parts */ + hypre_BoxDestroy(grid_box); + + /* Free memory */ +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { + if (nonzero_rows != hypre_CSRMatrixRownnz(A_ud)) + { + hypre_TFree(nonzero_rows, HYPRE_MEMORY_DEVICE); + } + hypre_TFree(all_indices_0, HYPRE_MEMORY_DEVICE); + hypre_TFree(all_indices_1, HYPRE_MEMORY_DEVICE); + hypre_TFree(all_indices_2, HYPRE_MEMORY_DEVICE); + hypre_TFree(indices_0, HYPRE_MEMORY_DEVICE); + hypre_TFree(indices_1, HYPRE_MEMORY_DEVICE); + hypre_TFree(indices_2, HYPRE_MEMORY_DEVICE); + hypre_TFree(box_nnzrows, HYPRE_MEMORY_DEVICE); + hypre_TFree(indices[0], HYPRE_MEMORY_HOST); + hypre_TFree(indices[1], HYPRE_MEMORY_HOST); + hypre_TFree(indices[2], HYPRE_MEMORY_HOST); + } + else +#endif + { + hypre_TFree(indices_0, HYPRE_MEMORY_HOST); + hypre_TFree(indices_1, HYPRE_MEMORY_HOST); + hypre_TFree(indices_2, HYPRE_MEMORY_HOST); + } + + /* WM: TODO: insert a check here that ensures the matrix A doesn't change in the case of action > 0 */ + /* what about if action = 0? Then A does change... is there some other way to check correctness? */ + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Notes (VPM): + * 1) Use part and var as arguments to this function? + * 2) We are not converting the whole SStructMatrix, only the + * structured part. Change function's name? + * 3) This converts only A(vi, vi). Need to expand to other variables. + *--------------------------------------------------------------------------*/ + +hypre_IJMatrix * +hypre_SStructMatrixToUMatrix( HYPRE_SStructMatrix matrix, + HYPRE_Int fill_diagonal ) +{ + MPI_Comm comm = hypre_SStructMatrixComm(matrix); + HYPRE_Int ndim = hypre_SStructMatrixNDim(matrix); + HYPRE_Int nparts = hypre_SStructMatrixNParts(matrix); + HYPRE_IJMatrix ij_A = hypre_SStructMatrixIJMatrix(matrix); + HYPRE_MemoryLocation memory_location = hypre_IJMatrixMemoryLocation(ij_A); + hypre_SStructGraph *graph = hypre_SStructMatrixGraph(matrix); + hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); + hypre_SStructPGrid *pgrid; + hypre_StructGrid *sgrid; + hypre_BoxArray *grid_boxes; + hypre_Box *grid_box; + HYPRE_Int i, part, var, nvars, nrows; + + hypre_IJMatrix *ij_Ahat = NULL; + HYPRE_BigInt sizes[4]; + HYPRE_Int *ncols, *rowidx; + HYPRE_BigInt *rows, *cols; + HYPRE_Complex *values; +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(memory_location); +#endif + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("SStructMatrixToUMatrix"); + + /* Set beggining/end of rows and columns that belong to this process */ + HYPRE_IJMatrixGetLocalRange(ij_A, &sizes[0], &sizes[1], &sizes[2], &sizes[3]); + nrows = (HYPRE_Int) (sizes[1] - sizes[0] + 1); + + /* Set all diagonal entries to 1 */ + if (fill_diagonal) + { + /* Create and initialize ij_Ahat */ + HYPRE_IJMatrixCreate(comm, sizes[0], sizes[1], sizes[2], sizes[3], &ij_Ahat); + HYPRE_IJMatrixSetObjectType(ij_Ahat, HYPRE_PARCSR); + HYPRE_IJMatrixInitialize_v2(ij_Ahat, memory_location); + + ncols = hypre_TAlloc(HYPRE_Int, nrows, memory_location); + rows = hypre_TAlloc(HYPRE_BigInt, nrows, memory_location); + rowidx = hypre_TAlloc(HYPRE_Int, nrows, memory_location); + cols = hypre_TAlloc(HYPRE_BigInt, nrows, memory_location); + values = hypre_TAlloc(HYPRE_Complex, nrows, memory_location); + +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_DEVICE) + { +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + HYPRE_THRUST_CALL( fill, ncols, ncols + nrows, 1 ); + HYPRE_THRUST_CALL( fill, values, values + nrows, 1.0 ); + HYPRE_THRUST_CALL( sequence, rowidx, rowidx + nrows ); + HYPRE_THRUST_CALL( sequence, rows, rows + nrows, sizes[0] ); + HYPRE_THRUST_CALL( sequence, cols, cols + nrows, sizes[2] ); + +#elif defined(HYPRE_USING_SYCL) + HYPRE_ONEDPL_CALL( std::fill, ncols, ncols + nrows, 1 ); + HYPRE_ONEDPL_CALL( std::fill, values, values + nrows, 1.0 ); + hypreSycl_sequence( rowidx, rowidx + nrows, 0 ); + hypreSycl_sequence( rows, rows + nrows, sizes[0] ); + hypreSycl_sequence( cols, cols + nrows, sizes[2] ); +#endif + } + else +#endif + { +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < nrows; i++) + { + ncols[i] = 1; + rows[i] = sizes[0] + i; + cols[i] = sizes[2] + i; + rowidx[i] = i; + values[i] = 1.0; + } + } + + HYPRE_IJMatrixSetValues2(ij_Ahat, nrows, ncols, + (const HYPRE_BigInt *) rows, + (const HYPRE_Int *) rowidx, + (const HYPRE_BigInt *) cols, + (const HYPRE_Complex *) values); + + hypre_TFree(ncols, memory_location); + hypre_TFree(rows, memory_location); + hypre_TFree(rowidx, memory_location); + hypre_TFree(cols, memory_location); + hypre_TFree(values, memory_location); + } + + hypre_BoxArray ***convert_boxa; + convert_boxa = hypre_TAlloc(hypre_BoxArray **, nparts, HYPRE_MEMORY_HOST); + for (part = 0; part < nparts; part++) + { + pgrid = hypre_SStructGridPGrid(grid, part); + nvars = hypre_SStructPGridNVars(pgrid); + convert_boxa[part] = hypre_CTAlloc(hypre_BoxArray *, nvars, HYPRE_MEMORY_HOST); + for (var = 0; var < nvars; var++) + { + /* WM: question - what about connections between variables? Note the var, var arguments below */ + sgrid = hypre_SStructPGridSGrid(pgrid, var); + grid_boxes = hypre_StructGridBoxes(sgrid); + convert_boxa[part][var] = hypre_BoxArrayCreate(0, ndim); + hypre_ForBoxI(i, grid_boxes) + { + grid_box = hypre_BoxArrayBox(grid_boxes, i); + hypre_AppendBox(grid_box, convert_boxa[part][var]); + } + } + } + hypre_SStructMatrixBoxesToUMatrix(matrix, grid, &ij_Ahat, convert_boxa); + + /* Free memory */ + for (part = 0; part < nparts; part++) + { + pgrid = hypre_SStructGridPGrid(grid, part); + nvars = hypre_SStructPGridNVars(pgrid); + for (var = 0; var < nvars; var++) + { + hypre_BoxArrayDestroy(convert_boxa[part][var]); + } + hypre_TFree(convert_boxa[part], HYPRE_MEMORY_HOST); + } + hypre_TFree(convert_boxa, HYPRE_MEMORY_HOST); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return ij_Ahat; +} + +/*-------------------------------------------------------------------------- + * Notes: + * *) Consider a single variable type for now. + * *) Input grid comes from the matrix we are multiplying to A + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatrixBoxesToUMatrix( hypre_SStructMatrix *A, + hypre_SStructGrid *grid, + hypre_IJMatrix **ij_Ahat_ptr, + hypre_BoxArray ***convert_boxa) +{ + HYPRE_Int ndim = hypre_SStructMatrixNDim(A); + HYPRE_Int nparts = hypre_SStructMatrixNParts(A); + HYPRE_Int *Sentries = hypre_SStructMatrixSEntries(A); + HYPRE_IJMatrix ij_A = hypre_SStructMatrixIJMatrix(A); + HYPRE_MemoryLocation memory_location = hypre_IJMatrixMemoryLocation(ij_A); + + hypre_SStructPGrid *pgrid; + hypre_StructGrid *sgrid; + hypre_SStructStencil *stencil; + + hypre_SStructPMatrix *pA; + hypre_IJMatrix *ij_Ahat; + hypre_AuxParCSRMatrix *aux_matrix; + + HYPRE_Int *split; + hypre_BoxArray *grid_boxes; + hypre_Box *box = hypre_BoxCreate(ndim); + hypre_Box *ghost_box = hypre_BoxCreate(ndim); + hypre_Box *grid_box; + hypre_Box *convert_box; + + hypre_Index stride; + HYPRE_Int nrows; + HYPRE_Int ncols; + HYPRE_Int *row_sizes = NULL; + HYPRE_Complex *values; + + HYPRE_BigInt sizes[4]; + HYPRE_Int entry, part, var, nvars; + HYPRE_Int nnzrow; + HYPRE_Int nvalues, i, j; + HYPRE_Int *num_ghost; + HYPRE_Int nSentries; + HYPRE_Int m = 0; + hypre_Index loop_size; + hypre_IndexRef start; +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(memory_location); +#endif + +#if defined(HYPRE_DEBUG) && defined(DEBUG_MATCONV) + char msg[512]; +#endif + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("SStructMatrixBoxesToUMatrix"); + + /* Get row and column ranges */ + HYPRE_IJMatrixGetLocalRange(ij_A, &sizes[0], &sizes[1], &sizes[2], &sizes[3]); + nrows = (HYPRE_Int) (sizes[1] - sizes[0] + 1); + ncols = (HYPRE_Int) (sizes[3] - sizes[2] + 1); + + /* Set row sizes */ + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Set rowsizes"); + nvalues = 0; + hypre_SetIndex(stride, 1); +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_HOST) +#endif + { + if (!*ij_Ahat_ptr) + { + row_sizes = hypre_CTAlloc(HYPRE_Int, nrows, HYPRE_MEMORY_HOST); + } + } + + for (part = 0; part < nparts; part++) + { + pA = hypre_SStructMatrixPMatrix(A, part); + pgrid = hypre_SStructGridPGrid(grid, part); + nvars = hypre_SStructPMatrixNVars(pA); + + for (var = 0; var < nvars; var++) + { + sgrid = hypre_SStructPGridSGrid(pgrid, var); + split = hypre_SStructMatrixSplit(A, part, var); + stencil = hypre_SStructPMatrixStencil(pA, var); + grid_boxes = hypre_StructGridBoxes(sgrid); + num_ghost = hypre_StructGridNumGhost(sgrid); + + nnzrow = hypre_SStructStencilSize(stencil); + + hypre_ForBoxI(i, grid_boxes) + { + grid_box = hypre_BoxArrayBox(grid_boxes, i); + hypre_CopyBox(grid_box, ghost_box); + hypre_BoxGrowByArray(ghost_box, num_ghost); + + hypre_ForBoxI(j, convert_boxa[part][var]) + { + convert_box = hypre_BoxArrayBox(convert_boxa[part][var], j); + +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_HOST) +#endif + { + if (!*ij_Ahat_ptr) + { + /* WM: do I need to check whether there is a non-trivial + intersection, or is that handled automatically? */ + hypre_IntersectBoxes(grid_box, convert_box, box); + start = hypre_BoxIMin(box); + hypre_BoxGetSize(box, loop_size); + hypre_BoxLoop1Begin(ndim, loop_size, ghost_box, start, stride, mi); + { + row_sizes[m + mi] = nnzrow; + } + hypre_BoxLoop1End(mi); + } + } + + nvalues = hypre_max(nvalues, nnzrow * hypre_BoxVolume(convert_box)); + } /* Loop over convert_boxa[part][var] */ + +#if defined(HYPRE_USING_GPU) + if (exec == HYPRE_EXEC_HOST) +#endif + { + m += hypre_BoxVolume(ghost_box); + } + } /* Loop over grid_boxes */ + } /* Loop over vars */ + } /* Loop over parts */ + hypre_BoxDestroy(box); + hypre_BoxDestroy(ghost_box); + HYPRE_ANNOTATE_REGION_END("%s", "Set rowsizes"); + + /* Create and initialize ij_Ahat */ + if (*ij_Ahat_ptr) + { + ij_Ahat = *ij_Ahat_ptr; + } + else + { + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Create Matrix"); + HYPRE_IJMatrixPartialClone(ij_A, &ij_Ahat); + if (row_sizes) + { + hypre_AuxParCSRMatrixCreate(&aux_matrix, nrows, ncols, row_sizes); + hypre_IJMatrixTranslator(ij_Ahat) = aux_matrix; + } + HYPRE_IJMatrixInitialize_v2(ij_Ahat, memory_location); + HYPRE_ANNOTATE_REGION_END("%s", "Create Matrix"); + } + + /* Allocate memory */ + values = hypre_CTAlloc(HYPRE_Complex, nvalues, memory_location); + + /* Set entries of ij_Ahat */ + for (part = 0; part < nparts; part++) + { + pA = hypre_SStructMatrixPMatrix(A, part); + pgrid = hypre_SStructGridPGrid(grid, part); + nvars = hypre_SStructPMatrixNVars(pA); + + for (var = 0; var < nvars; var++) + { + split = hypre_SStructMatrixSplit(A, part, var); + stencil = hypre_SStructPMatrixStencil(pA, var); + + nSentries = 0; + for (entry = 0; entry < hypre_SStructStencilSize(stencil); entry++) + { + if (split[entry] > -1) + { + Sentries[nSentries] = split[entry]; + nSentries++; + } + } + + hypre_ForBoxI(i, convert_boxa[part][var]) + { + convert_box = hypre_BoxArrayBox(convert_boxa[part][var], i); + + hypre_assert(hypre_BoxVolume(convert_box) > 0); + hypre_assert(hypre_BoxVolume(convert_box) <= nvalues); + +#if defined(HYPRE_DEBUG) && defined(DEBUG_MATCONV) + hypre_sprintf(msg, "Part %d - Box %d - ", part, i); + hypre_BoxPrintDebug(convert_box); + HYPRE_ANNOTATE_REGION_BEGIN("%s %d %s %d", "Get values part", part, "convert_box", i); +#endif + /* GET values from this box */ + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Get entries"); + hypre_SStructPMatrixSetBoxValues(pA, convert_box, var, + nSentries, Sentries, convert_box, values, -1); + HYPRE_ANNOTATE_REGION_END("%s", "Get entries"); + +#if defined(HYPRE_DEBUG) && defined(DEBUG_MATCONV) + HYPRE_ANNOTATE_REGION_END("%s %d %s %d", "Get values part", part, "convert_box", i); + HYPRE_ANNOTATE_REGION_BEGIN("%s %d %s %d", "Set values part", part, "convert_box", i); +#endif + /* SET values to ij_Ahat */ + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Set entries"); + hypre_SStructUMatrixSetBoxValuesHelper(A, part, convert_box, + var, nSentries, Sentries, + convert_box, values, 0, ij_Ahat); + HYPRE_ANNOTATE_REGION_END("%s", "Set entries"); +#if defined(HYPRE_DEBUG) && defined(DEBUG_MATCONV) + HYPRE_ANNOTATE_REGION_END("%s %d %s %d", "Set values part", part, "convert_box", i); +#endif + } /* Loop over convert_boxa */ + } /* Loop over vars */ + } /* Loop over parts */ + + /* Free memory */ + hypre_TFree(values, memory_location); + + /* Assemble ij_A */ + HYPRE_IJMatrixAssemble(ij_Ahat); + + /* Set pointer to ij_Ahat */ + *ij_Ahat_ptr = ij_Ahat; + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Notes: + * *) Consider a single variable type for now. + * *) Input grid comes from the matrix we are multiplying to A + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatrixHaloToUMatrix( hypre_SStructMatrix *A, + hypre_SStructGrid *grid, + hypre_IJMatrix **ij_Ahat_ptr, + HYPRE_Int halo_size) +{ + HYPRE_Int ndim = hypre_SStructMatrixNDim(A); + HYPRE_Int nparts = hypre_SStructMatrixNParts(A); + HYPRE_IJMatrix ij_A = hypre_SStructMatrixIJMatrix(A); + hypre_SStructPGrid *pgrid; + hypre_StructGrid *sgrid; + + hypre_BoxArrayArray ***convert_boxaa; + hypre_BoxArrayArray *pbnd_boxaa; + hypre_BoxArray *convert_boxa; + hypre_BoxArray *pbnd_boxa; + hypre_BoxArray *grid_boxes; + hypre_Box *box; + hypre_Box *grow_box; + hypre_Box *grid_box; + hypre_Box *convert_box; + + HYPRE_BigInt sizes[4]; + HYPRE_Int part, var, nvars; + HYPRE_Int i, j, k, kk; + HYPRE_Int num_boxes; + HYPRE_Int pbnd_boxaa_size; + HYPRE_Int convert_boxaa_size; + HYPRE_Int grid_box_id; + HYPRE_Int convert_box_id; + + HYPRE_ANNOTATE_FUNC_BEGIN; + + /* Get row and column ranges */ + HYPRE_IJMatrixGetLocalRange(ij_A, &sizes[0], &sizes[1], &sizes[2], &sizes[3]); + + /* Find boxes to be converted */ + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Find boxes"); + convert_box = hypre_BoxCreate(ndim); + grow_box = hypre_BoxCreate(ndim); + convert_boxaa = hypre_TAlloc(hypre_BoxArrayArray **, nparts, HYPRE_MEMORY_HOST); + for (part = 0; part < nparts; part++) + { + pgrid = hypre_SStructGridPGrid(grid, part); + nvars = hypre_SStructPGridNVars(pgrid); + + convert_boxaa[part] = hypre_TAlloc(hypre_BoxArrayArray *, nvars, HYPRE_MEMORY_HOST); + for (var = 0; var < nvars; var++) + { + sgrid = hypre_SStructPGridSGrid(pgrid, var); + num_boxes = hypre_StructGridNumBoxes(sgrid); + grid_boxes = hypre_StructGridBoxes(sgrid); + + /* Exit this loop if there are no grid boxes */ + if (!num_boxes) + { + convert_boxaa[part][var] = hypre_BoxArrayArrayCreate(0, ndim); + continue; + } + + pbnd_boxaa = hypre_SStructPGridPBndBoxArrayArray(pgrid, var); + pbnd_boxaa_size = hypre_BoxArrayArraySize(pbnd_boxaa); + + convert_boxaa_size = hypre_min(num_boxes, pbnd_boxaa_size) + 1; + convert_boxaa[part][var] = hypre_BoxArrayArrayCreate(convert_boxaa_size, ndim); + + k = kk = 0; + hypre_ForBoxArrayI(i, pbnd_boxaa) + { + pbnd_boxa = hypre_BoxArrayArrayBoxArray(pbnd_boxaa, i); + convert_box_id = hypre_BoxArrayArrayID(pbnd_boxaa, i); + grid_box_id = hypre_StructGridID(sgrid, k); + convert_boxa = hypre_BoxArrayArrayBoxArray(convert_boxaa[part][var], kk); + + /* Find matching box id */ + while (convert_box_id != grid_box_id) + { + k++; + //hypre_assert(k < hypre_StructGridNumBoxes(sgrid)); + grid_box_id = hypre_StructGridID(sgrid, k); + } + grid_box = hypre_BoxArrayBox(grid_boxes, k); + + if (hypre_BoxArraySize(pbnd_boxa)) + { + hypre_ForBoxI(j, pbnd_boxa) + { + box = hypre_BoxArrayBox(pbnd_boxa, j); + hypre_CopyBox(box, grow_box); + hypre_BoxGrowByValue(grow_box, halo_size - 1); + hypre_IntersectBoxes(grow_box, grid_box, convert_box); + + hypre_AppendBox(convert_box, convert_boxa); + } + + /* Eliminate duplicated entries */ + hypre_UnionBoxes(convert_boxa); + + /* Update convert_boxaa */ + hypre_BoxArrayArrayID(convert_boxaa[part][var], kk) = convert_box_id; + kk++; + } + } /* loop over grid_boxes */ + + hypre_BoxArrayArraySize(convert_boxaa[part][var]) = kk; + } /* loop over vars */ + } /* loop over parts */ + hypre_BoxDestroy(grow_box); + hypre_BoxDestroy(convert_box); + HYPRE_ANNOTATE_REGION_END("%s", "Find boxes"); + + /* Flatten the convert_boxaa to convert_boxa_flattened (that is ArrayArray to Array). */ + hypre_BoxArray ***convert_boxaa_flattened = hypre_TAlloc(hypre_BoxArray **, nparts, + HYPRE_MEMORY_HOST); + for (part = 0; part < nparts; part++) + { + convert_boxaa_flattened[part] = hypre_TAlloc(hypre_BoxArray *, nvars, HYPRE_MEMORY_HOST); + for (var = 0; var < nvars; var++) + { + convert_boxaa_flattened[part][var] = hypre_BoxArrayCreate(0, ndim); + hypre_ForBoxArrayI(i, convert_boxaa[part][var]) + { + grid_boxes = hypre_BoxArrayArrayBoxArray(convert_boxaa[part][var], i); + hypre_ForBoxI(j, grid_boxes) + { + box = hypre_BoxArrayBox(grid_boxes, j); + hypre_AppendBox(box, convert_boxaa_flattened[part][var]); + } + } + } + } + + hypre_SStructMatrixBoxesToUMatrix(A, grid, ij_Ahat_ptr, convert_boxaa_flattened); + + /* Free memory */ + for (part = 0; part < nparts; part++) + { + pgrid = hypre_SStructGridPGrid(grid, part); + nvars = hypre_SStructPGridNVars(pgrid); + for (var = 0; var < nvars; var++) + { + hypre_BoxArrayArrayDestroy(convert_boxaa[part][var]); + hypre_BoxArrayDestroy(convert_boxaa_flattened[part][var]); + } + hypre_TFree(convert_boxaa[part], HYPRE_MEMORY_HOST); + hypre_TFree(convert_boxaa_flattened[part], HYPRE_MEMORY_HOST); + } + hypre_TFree(convert_boxaa, HYPRE_MEMORY_HOST); + hypre_TFree(convert_boxaa_flattened, HYPRE_MEMORY_HOST); + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Returns the diagonal of a SStructMatrix as a SStructVector + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatrixGetDiagonal( hypre_SStructMatrix *matrix, + hypre_SStructVector **diag_ptr ) +{ + MPI_Comm comm = hypre_SStructMatrixComm(matrix); + hypre_SStructGraph *graph = hypre_SStructMatrixGraph(matrix); + hypre_SStructGrid *grid = hypre_SStructGraphGrid(graph); + HYPRE_Int nparts = hypre_SStructMatrixNParts(matrix); + HYPRE_Int object_type = hypre_SStructMatrixObjectType(matrix); + + hypre_SStructVector *diag; + hypre_ParVector *par_d; + hypre_SStructPMatrix *pmatrix; + hypre_SStructPVector *pdiag; + HYPRE_Int part; + + hypre_ParCSRMatrix *A; + hypre_CSRMatrix *A_diag; + + /* Create vector */ + HYPRE_SStructVectorCreate(comm, grid, &diag); + HYPRE_SStructVectorInitialize(diag); + HYPRE_SStructVectorAssemble(diag); + + /* Fill vector with the diagonal of the matrix */ + if (object_type == HYPRE_SSTRUCT || object_type == HYPRE_STRUCT) + { + for (part = 0; part < nparts; part++) + { + pmatrix = hypre_SStructMatrixPMatrix(matrix, part); + pdiag = hypre_SStructVectorPVector(diag, part); + + hypre_SStructPMatrixGetDiagonal(pmatrix, pdiag); + } + } + + /* Unstructured diagonal component */ + if (object_type == HYPRE_SSTRUCT || object_type == HYPRE_PARCSR) + { + A = hypre_SStructMatrixParCSRMatrix(matrix); + A_diag = hypre_ParCSRMatrixDiag(A); + + hypre_SStructVectorConvert(diag, &par_d); + hypre_CSRMatrixExtractDiagonal(A_diag, hypre_ParVectorLocalData(par_d), 10); + hypre_SStructVectorRestore(diag, par_d); + } + + *diag_ptr = diag; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + HYPRE_MemoryLocation hypre_SStructMatrixMemoryLocation(hypre_SStructMatrix *matrix) { - HYPRE_Int type = hypre_SStructMatrixObjectType(matrix); + HYPRE_Int type = hypre_SStructMatrixObjectType(matrix); + void *object; + + HYPRE_SStructMatrixGetObject(matrix, &object); 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); diff --git a/src/sstruct_mv/sstruct_matrix.h b/src/sstruct_mv/sstruct_matrix.h index 84c1743028..d08003128e 100644 --- a/src/sstruct_mv/sstruct_matrix.h +++ b/src/sstruct_mv/sstruct_matrix.h @@ -18,7 +18,7 @@ * hypre_SStructMatrix: *--------------------------------------------------------------------------*/ -typedef struct +typedef struct hypre_SStructPMatrix_struct { MPI_Comm comm; hypre_SStructPGrid *pgrid; @@ -30,6 +30,10 @@ typedef struct hypre_StructMatrix ***smatrices; /* nvar x nvar array of smatrices */ HYPRE_Int **symmetric; /* Stencil entries symmetric? * (nvar x nvar array) */ + HYPRE_Int **num_centries; /* (nvar x nvar) array */ + HYPRE_Int ***centries; /* (nvar x nvar x sentries_size) array constant entries */ + hypre_Index dom_stride; /* domain grid stride */ + hypre_Index ran_stride; /* range grid stride */ /* temporary storage for SetValues routines */ HYPRE_Int sentries_size; @@ -41,18 +45,28 @@ typedef struct } hypre_SStructPMatrix; +/*-------------------------------------------------------------------------- + * hypre_SStructMatrix: + * + * - Storage of parts id dictated by the coarse grid + *--------------------------------------------------------------------------*/ + typedef struct hypre_SStructMatrix_struct { MPI_Comm comm; HYPRE_Int ndim; + HYPRE_Int ***splits; /* S/U-matrix split for each stencil */ hypre_SStructGraph *graph; - HYPRE_Int ***splits; /* S/U-matrix split for each stencil */ /* S-matrix info */ HYPRE_Int nparts; hypre_SStructPMatrix **pmatrices; HYPRE_Int ***symmetric; /* Stencil entries symmetric? * (nparts x nvar x nvar array) */ + HYPRE_Int ***num_centries; /* (nparts x nvar x nvar) array */ + HYPRE_Int ****centries; /* (nparts x nvar x nvar x entries_size) array */ + hypre_Index *dom_stride; /* (nparts) array of domain stride */ + hypre_Index *ran_stride; /* (nparts) array of range stride */ /* U-matrix info */ HYPRE_IJMatrix ijmatrix; @@ -62,7 +76,6 @@ typedef struct hypre_SStructMatrix_struct HYPRE_Int entries_size; HYPRE_Int *Sentries; HYPRE_Int *Uentries; - HYPRE_Int tmp_size; /* size of the following 3 */ HYPRE_BigInt *tmp_row_coords; HYPRE_BigInt *tmp_col_coords; @@ -85,31 +98,35 @@ typedef struct hypre_SStructMatrix_struct * Accessor macros: hypre_SStructMatrix *--------------------------------------------------------------------------*/ -#define hypre_SStructMatrixComm(mat) ((mat) -> comm) -#define hypre_SStructMatrixNDim(mat) ((mat) -> ndim) -#define hypre_SStructMatrixGraph(mat) ((mat) -> graph) -#define hypre_SStructMatrixSplits(mat) ((mat) -> splits) -#define hypre_SStructMatrixSplit(mat, p, v) ((mat) -> splits[p][v]) -#define hypre_SStructMatrixNParts(mat) ((mat) -> nparts) -#define hypre_SStructMatrixPMatrices(mat) ((mat) -> pmatrices) -#define hypre_SStructMatrixPMatrix(mat, part) ((mat) -> pmatrices[part]) -#define hypre_SStructMatrixSymmetric(mat) ((mat) -> symmetric) -#define hypre_SStructMatrixIJMatrix(mat) ((mat) -> ijmatrix) -#define hypre_SStructMatrixParCSRMatrix(mat) ((mat) -> parcsrmatrix) -#define hypre_SStructMatrixEntriesSize(mat) ((mat) -> entries_size) -#define hypre_SStructMatrixSEntries(mat) ((mat) -> Sentries) -#define hypre_SStructMatrixUEntries(mat) ((mat) -> Uentries) -#define hypre_SStructMatrixTmpSize(mat) ((mat) -> tmp_size) -#define hypre_SStructMatrixTmpRowCoords(mat) ((mat) -> tmp_row_coords) -#define hypre_SStructMatrixTmpColCoords(mat) ((mat) -> tmp_col_coords) -#define hypre_SStructMatrixTmpCoeffs(mat) ((mat) -> tmp_coeffs) -#define hypre_SStructMatrixTmpRowCoordsDevice(mat) ((mat) -> d_tmp_row_coords) -#define hypre_SStructMatrixTmpColCoordsDevice(mat) ((mat) -> d_tmp_col_coords) -#define hypre_SStructMatrixTmpCoeffsDevice(mat) ((mat) -> d_tmp_coeffs) -#define hypre_SStructMatrixNSSymmetric(mat) ((mat) -> ns_symmetric) -#define hypre_SStructMatrixGlobalSize(mat) ((mat) -> global_size) -#define hypre_SStructMatrixRefCount(mat) ((mat) -> ref_count) -#define hypre_SStructMatrixObjectType(mat) ((mat) -> object_type) +#define hypre_SStructMatrixComm(mat) ((mat) -> comm) +#define hypre_SStructMatrixNDim(mat) ((mat) -> ndim) +#define hypre_SStructMatrixGraph(mat) ((mat) -> graph) +#define hypre_SStructMatrixSplits(mat) ((mat) -> splits) +#define hypre_SStructMatrixSplit(mat, p, v) ((mat) -> splits[p][v]) +#define hypre_SStructMatrixNParts(mat) ((mat) -> nparts) +#define hypre_SStructMatrixPMatrices(mat) ((mat) -> pmatrices) +#define hypre_SStructMatrixPMatrix(mat, part) ((mat) -> pmatrices[part]) +#define hypre_SStructMatrixSymmetric(mat) ((mat) -> symmetric) +#define hypre_SStructMatrixNumCEntries(mat) ((mat) -> num_centries) +#define hypre_SStructMatrixCEntries(mat) ((mat) -> centries) +#define hypre_SStructMatrixDomainStride(mat) ((mat) -> dom_stride) +#define hypre_SStructMatrixRangeStride(mat) ((mat) -> ran_stride) +#define hypre_SStructMatrixIJMatrix(mat) ((mat) -> ijmatrix) +#define hypre_SStructMatrixParCSRMatrix(mat) ((mat) -> parcsrmatrix) +#define hypre_SStructMatrixEntriesSize(mat) ((mat) -> entries_size) +#define hypre_SStructMatrixSEntries(mat) ((mat) -> Sentries) +#define hypre_SStructMatrixUEntries(mat) ((mat) -> Uentries) +#define hypre_SStructMatrixTmpSize(mat) ((mat) -> tmp_size) +#define hypre_SStructMatrixTmpRowCoords(mat) ((mat) -> tmp_row_coords) +#define hypre_SStructMatrixTmpColCoords(mat) ((mat) -> tmp_col_coords) +#define hypre_SStructMatrixTmpCoeffs(mat) ((mat) -> tmp_coeffs) +#define hypre_SStructMatrixTmpRowCoordsDevice(mat) ((mat) -> d_tmp_row_coords) +#define hypre_SStructMatrixTmpColCoordsDevice(mat) ((mat) -> d_tmp_col_coords) +#define hypre_SStructMatrixTmpCoeffsDevice(mat) ((mat) -> d_tmp_coeffs) +#define hypre_SStructMatrixNSSymmetric(mat) ((mat) -> ns_symmetric) +#define hypre_SStructMatrixGlobalSize(mat) ((mat) -> global_size) +#define hypre_SStructMatrixRefCount(mat) ((mat) -> ref_count) +#define hypre_SStructMatrixObjectType(mat) ((mat) -> object_type) /*-------------------------------------------------------------------------- * Accessor macros: hypre_SStructPMatrix @@ -117,20 +134,21 @@ typedef struct hypre_SStructMatrix_struct #define hypre_SStructPMatrixComm(pmat) ((pmat) -> comm) #define hypre_SStructPMatrixPGrid(pmat) ((pmat) -> pgrid) -#define hypre_SStructPMatrixNDim(pmat) \ -hypre_SStructPGridNDim(hypre_SStructPMatrixPGrid(pmat)) +#define hypre_SStructPMatrixNDim(pmat) hypre_SStructPGridNDim((pmat) -> pgrid) #define hypre_SStructPMatrixStencils(pmat) ((pmat) -> stencils) #define hypre_SStructPMatrixNVars(pmat) ((pmat) -> nvars) #define hypre_SStructPMatrixStencil(pmat, var) ((pmat) -> stencils[var]) #define hypre_SStructPMatrixSMaps(pmat) ((pmat) -> smaps) #define hypre_SStructPMatrixSMap(pmat, var) ((pmat) -> smaps[var]) #define hypre_SStructPMatrixSStencils(pmat) ((pmat) -> sstencils) -#define hypre_SStructPMatrixSStencil(pmat, vi, vj) \ -((pmat) -> sstencils[vi][vj]) +#define hypre_SStructPMatrixSStencil(pmat, vi, vj) ((pmat) -> sstencils[vi][vj]) #define hypre_SStructPMatrixSMatrices(pmat) ((pmat) -> smatrices) -#define hypre_SStructPMatrixSMatrix(pmat, vi, vj) \ -((pmat) -> smatrices[vi][vj]) +#define hypre_SStructPMatrixSMatrix(pmat, vi, vj) ((pmat) -> smatrices[vi][vj]) #define hypre_SStructPMatrixSymmetric(pmat) ((pmat) -> symmetric) +#define hypre_SStructPMatrixNumCEntries(pmat) ((pmat) -> num_centries) +#define hypre_SStructPMatrixCEntries(pmat) ((pmat) -> centries) +#define hypre_SStructPMatrixDomainStride(pmat) ((pmat) -> dom_stride) +#define hypre_SStructPMatrixRangeStride(pmat) ((pmat) -> ran_stride) #define hypre_SStructPMatrixSEntriesSize(pmat) ((pmat) -> sentries_size) #define hypre_SStructPMatrixSEntries(pmat) ((pmat) -> sentries) #define hypre_SStructPMatrixAccumulated(pmat) ((pmat) -> accumulated) diff --git a/src/sstruct_mv/sstruct_matvec.c b/src/sstruct_mv/sstruct_matvec.c index 5f0ef3e336..d26ad1958f 100644 --- a/src/sstruct_mv/sstruct_matvec.c +++ b/src/sstruct_mv/sstruct_matvec.c @@ -21,15 +21,14 @@ * hypre_SStructPMatvecData data structure *--------------------------------------------------------------------------*/ -typedef struct +typedef struct hypre_SStructPMatvecData_struct { - HYPRE_Int nvars; - void ***smatvec_data; - + HYPRE_Int nvars; + HYPRE_Int transpose; + void ***smatvec_data; } hypre_SStructPMatvecData; /*-------------------------------------------------------------------------- - * hypre_SStructPMatvecCreate *--------------------------------------------------------------------------*/ HYPRE_Int @@ -37,33 +36,83 @@ hypre_SStructPMatvecCreate( void **pmatvec_vdata_ptr ) { hypre_SStructPMatvecData *pmatvec_data; - pmatvec_data = hypre_CTAlloc(hypre_SStructPMatvecData, 1, HYPRE_MEMORY_HOST); + pmatvec_data = hypre_CTAlloc(hypre_SStructPMatvecData, 1, HYPRE_MEMORY_HOST); + (pmatvec_data -> nvars) = 0; + (pmatvec_data -> transpose) = 0; + *pmatvec_vdata_ptr = (void *) pmatvec_data; return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_SStructPMatvecSetup *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_SStructPMatvecSetup( void *pmatvec_vdata, - hypre_SStructPMatrix *pA, - hypre_SStructPVector *px ) +hypre_SStructPMatvecSetTranspose( void *pmatvec_vdata, + HYPRE_Int transpose ) +{ + hypre_SStructPMatvecData *pmatvec_data = (hypre_SStructPMatvecData *) pmatvec_vdata; + + (pmatvec_data -> transpose) = transpose; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatvecDestroy( void *pmatvec_vdata ) { hypre_SStructPMatvecData *pmatvec_data = (hypre_SStructPMatvecData *)pmatvec_vdata; HYPRE_Int nvars; void ***smatvec_data; - hypre_StructMatrix *sA; - hypre_StructVector *sx; HYPRE_Int vi, vj; + if (pmatvec_data) + { + nvars = (pmatvec_data -> nvars); + smatvec_data = (pmatvec_data -> smatvec_data); + for (vi = 0; vi < nvars; vi++) + { + for (vj = 0; vj < nvars; vj++) + { + if (smatvec_data[vi][vj] != NULL) + { + hypre_StructMatvecDestroy(smatvec_data[vi][vj]); + } + } + hypre_TFree(smatvec_data[vi], HYPRE_MEMORY_HOST); + } + hypre_TFree(smatvec_data, HYPRE_MEMORY_HOST); + hypre_TFree(pmatvec_data, HYPRE_MEMORY_HOST); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPMatvecSetup( void *pmatvec_vdata, + hypre_SStructPMatrix *pA, + hypre_SStructPVector *px ) +{ + hypre_SStructPMatvecData *pmatvec_data = (hypre_SStructPMatvecData *) pmatvec_vdata; + HYPRE_Int transpose = (pmatvec_data -> transpose); + HYPRE_Int nvars; + void ***smatvec_data; + hypre_StructMatrix *sA; + hypre_StructVector *sx; + HYPRE_Int vi, vj; + nvars = hypre_SStructPMatrixNVars(pA); - smatvec_data = hypre_TAlloc(void **, nvars, HYPRE_MEMORY_HOST); + smatvec_data = hypre_TAlloc(void **, nvars, HYPRE_MEMORY_HOST); for (vi = 0; vi < nvars; vi++) { - smatvec_data[vi] = hypre_TAlloc(void *, nvars, HYPRE_MEMORY_HOST); + smatvec_data[vi] = hypre_TAlloc(void *, nvars, HYPRE_MEMORY_HOST); for (vj = 0; vj < nvars; vj++) { sA = hypre_SStructPMatrixSMatrix(pA, vi, vj); @@ -72,6 +121,8 @@ hypre_SStructPMatvecSetup( void *pmatvec_vdata, if (sA != NULL) { smatvec_data[vi][vj] = hypre_StructMatvecCreate(); + + hypre_StructMatvecSetTranspose(smatvec_data[vi][vj], transpose); hypre_StructMatvecSetup(smatvec_data[vi][vj], sA, sx); } } @@ -83,7 +134,6 @@ hypre_SStructPMatvecSetup( void *pmatvec_vdata, } /*-------------------------------------------------------------------------- - * hypre_SStructPMatvecCompute *--------------------------------------------------------------------------*/ HYPRE_Int @@ -92,88 +142,64 @@ hypre_SStructPMatvecCompute( void *pmatvec_vdata, hypre_SStructPMatrix *pA, hypre_SStructPVector *px, HYPRE_Complex beta, + hypre_SStructPVector *pb, hypre_SStructPVector *py ) { hypre_SStructPMatvecData *pmatvec_data = (hypre_SStructPMatvecData *)pmatvec_vdata; HYPRE_Int nvars = (pmatvec_data -> nvars); void ***smatvec_data = (pmatvec_data -> smatvec_data); - void *sdata; + hypre_SStructPGrid *pgrid; hypre_StructMatrix *sA; - hypre_StructVector *sx; - hypre_StructVector *sy; - - HYPRE_Int vi, vj; + hypre_StructVector *sx, *sb, *sy; + HYPRE_Int vi, vj, active; + void *sdata; for (vi = 0; vi < nvars; vi++) { - sy = hypre_SStructPVectorSVector(py, vi); + pgrid = hypre_SStructPMatrixPGrid(pA); + active = hypre_SStructPGridActive(pgrid, vi); + sb = hypre_SStructPVectorSVector(pb, vi); + sy = hypre_SStructPVectorSVector(py, vi); - /* diagonal block computation */ - if (smatvec_data[vi][vi] != NULL) + if (active) { - sdata = smatvec_data[vi][vi]; - sA = hypre_SStructPMatrixSMatrix(pA, vi, vi); - sx = hypre_SStructPVectorSVector(px, vi); - hypre_StructMatvecCompute(sdata, alpha, sA, sx, beta, sy); - } - else - { - hypre_StructScale(beta, sy); - } - - /* off-diagonal block computation */ - for (vj = 0; vj < nvars; vj++) - { - if ((smatvec_data[vi][vj] != NULL) && (vj != vi)) + /* diagonal block computation */ + if (smatvec_data[vi][vi] != NULL) { - sdata = smatvec_data[vi][vj]; - sA = hypre_SStructPMatrixSMatrix(pA, vi, vj); - sx = hypre_SStructPVectorSVector(px, vj); - hypre_StructMatvecCompute(sdata, alpha, sA, sx, 1.0, sy); + sdata = smatvec_data[vi][vi]; + sA = hypre_SStructPMatrixSMatrix(pA, vi, vi); + sx = hypre_SStructPVectorSVector(px, vi); + hypre_StructMatvecCompute(sdata, alpha, sA, sx, beta, sb, sy); + } + else + { + hypre_StructVectorAxpy(0.0, sb, beta, sb, sy); } - } - } - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - * hypre_SStructPMatvecDestroy - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_SStructPMatvecDestroy( void *pmatvec_vdata ) -{ - hypre_SStructPMatvecData *pmatvec_data = (hypre_SStructPMatvecData *)pmatvec_vdata; - HYPRE_Int nvars; - void ***smatvec_data; - HYPRE_Int vi, vj; - if (pmatvec_data) - { - nvars = (pmatvec_data -> nvars); - smatvec_data = (pmatvec_data -> smatvec_data); - for (vi = 0; vi < nvars; vi++) - { + /* off-diagonal block computation */ for (vj = 0; vj < nvars; vj++) { - if (smatvec_data[vi][vj] != NULL) + if ((smatvec_data[vi][vj] != NULL) && (vj != vi)) { - hypre_StructMatvecDestroy(smatvec_data[vi][vj]); + sdata = smatvec_data[vi][vj]; + sA = hypre_SStructPMatrixSMatrix(pA, vi, vj); + sx = hypre_SStructPVectorSVector(px, vj); + hypre_StructMatvecCompute(sdata, alpha, sA, sx, 1.0, sy, sy); } } - hypre_TFree(smatvec_data[vi], HYPRE_MEMORY_HOST); } - hypre_TFree(smatvec_data, HYPRE_MEMORY_HOST); - hypre_TFree(pmatvec_data, HYPRE_MEMORY_HOST); + else + { + hypre_StructVectorAxpy(0.0, sb, beta, sb, sy); + } } return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_SStructPMatvec + * NOTE: This does not seem to be used anywhere. *--------------------------------------------------------------------------*/ HYPRE_Int @@ -187,7 +213,7 @@ hypre_SStructPMatvec( HYPRE_Complex alpha, hypre_SStructPMatvecCreate(&pmatvec_data); hypre_SStructPMatvecSetup(pmatvec_data, pA, px); - hypre_SStructPMatvecCompute(pmatvec_data, alpha, pA, px, beta, py); + hypre_SStructPMatvecCompute(pmatvec_data, alpha, pA, px, beta, py, py); hypre_SStructPMatvecDestroy(pmatvec_data); return hypre_error_flag; @@ -201,15 +227,14 @@ hypre_SStructPMatvec( HYPRE_Complex alpha, * hypre_SStructMatvecData data structure *--------------------------------------------------------------------------*/ -typedef struct +typedef struct hypre_SStructMatvecData_struct { HYPRE_Int nparts; - void **pmatvec_data; - + HYPRE_Int transpose; + void **pmatvec_data; } hypre_SStructMatvecData; /*-------------------------------------------------------------------------- - * hypre_SStructMatvecCreate *--------------------------------------------------------------------------*/ HYPRE_Int @@ -217,14 +242,30 @@ hypre_SStructMatvecCreate( void **matvec_vdata_ptr ) { hypre_SStructMatvecData *matvec_data; - matvec_data = hypre_CTAlloc(hypre_SStructMatvecData, 1, HYPRE_MEMORY_HOST); + matvec_data = hypre_CTAlloc(hypre_SStructMatvecData, 1, HYPRE_MEMORY_HOST); + (matvec_data -> nparts) = 0; + (matvec_data -> transpose) = 0; + *matvec_vdata_ptr = (void *) matvec_data; return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_SStructMatvecSetup + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructMatvecSetTranspose( void *matvec_vdata, + HYPRE_Int transpose ) +{ + hypre_SStructMatvecData *matvec_data = (hypre_SStructMatvecData *) matvec_vdata; + + (matvec_data -> transpose) = transpose; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ HYPRE_Int @@ -233,29 +274,37 @@ hypre_SStructMatvecSetup( void *matvec_vdata, hypre_SStructVector *x ) { hypre_SStructMatvecData *matvec_data = (hypre_SStructMatvecData *)matvec_vdata; + HYPRE_Int transpose = (matvec_data -> transpose); + HYPRE_Int nparts; void **pmatvec_data; hypre_SStructPMatrix *pA; hypre_SStructPVector *px; HYPRE_Int part; + HYPRE_ANNOTATE_FUNC_BEGIN; + nparts = hypre_SStructMatrixNParts(A); - pmatvec_data = hypre_TAlloc(void *, nparts, HYPRE_MEMORY_HOST); + pmatvec_data = hypre_TAlloc(void *, nparts, HYPRE_MEMORY_HOST); for (part = 0; part < nparts; part++) { hypre_SStructPMatvecCreate(&pmatvec_data[part]); pA = hypre_SStructMatrixPMatrix(A, part); px = hypre_SStructVectorPVector(x, part); + + hypre_SStructPMatvecSetTranspose(pmatvec_data[part], transpose); hypre_SStructPMatvecSetup(pmatvec_data[part], pA, px); } (matvec_data -> nparts) = nparts; (matvec_data -> pmatvec_data) = pmatvec_data; + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_SStructMatvecCompute + * Compute y = alpha*A*x + beta*b *--------------------------------------------------------------------------*/ HYPRE_Int @@ -264,47 +313,55 @@ hypre_SStructMatvecCompute( void *matvec_vdata, hypre_SStructMatrix *A, hypre_SStructVector *x, HYPRE_Complex beta, + hypre_SStructVector *b, hypre_SStructVector *y ) { hypre_SStructMatvecData *matvec_data = (hypre_SStructMatvecData *)matvec_vdata; HYPRE_Int nparts = (matvec_data -> nparts); + HYPRE_Int transpose = (matvec_data -> transpose); void **pmatvec_data = (matvec_data -> pmatvec_data); void *pdata; hypre_SStructPMatrix *pA; - hypre_SStructPVector *px; - hypre_SStructPVector *py; + hypre_SStructPVector *px, *pb, *py; hypre_ParCSRMatrix *parcsrA = hypre_SStructMatrixParCSRMatrix(A); - hypre_ParVector *parx; - hypre_ParVector *pary; + hypre_ParVector *parx, *parb, *pary; - HYPRE_Int part; HYPRE_Int x_object_type = hypre_SStructVectorObjectType(x); HYPRE_Int A_object_type = hypre_SStructMatrixObjectType(A); + HYPRE_Int part; if (x_object_type != A_object_type) { hypre_error_in_arg(2); hypre_error_in_arg(3); + return hypre_error_flag; } + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("SStructMatvecCompute"); + if ( (x_object_type == HYPRE_SSTRUCT) || (x_object_type == HYPRE_STRUCT) ) { /* do S-matrix computations */ + hypre_GpuProfilingPushRange("Structured"); for (part = 0; part < nparts; part++) { - pdata = pmatvec_data[part]; pA = hypre_SStructMatrixPMatrix(A, part); px = hypre_SStructVectorPVector(x, part); + pb = hypre_SStructVectorPVector(b, part); py = hypre_SStructVectorPVector(y, part); - hypre_SStructPMatvecCompute(pdata, alpha, pA, px, beta, py); + pdata = pmatvec_data[part]; + + hypre_SStructPMatvecCompute(pdata, alpha, pA, px, beta, pb, py); } + hypre_GpuProfilingPopRange(); + hypre_GpuProfilingPushRange("Unstructured"); if (x_object_type == HYPRE_SSTRUCT) { - /* do U-matrix computations */ /* GEC1002 the data chunk pointed by the local-parvectors @@ -316,36 +373,41 @@ hypre_SStructMatvecCompute( void *matvec_vdata, hypre_SStructVectorConvert(x, &parx); hypre_SStructVectorConvert(y, &pary); - hypre_ParCSRMatrixMatvec(alpha, parcsrA, parx, 1.0, pary); + if (transpose) + { + hypre_ParCSRMatrixMatvecT(alpha, parcsrA, parx, 1.0, pary); + } + else + { + hypre_ParCSRMatrixMatvec(alpha, parcsrA, parx, 1.0, pary); + } /* dummy functions since there is nothing to restore */ - - hypre_SStructVectorRestore(x, NULL); + hypre_SStructVectorRestore(x, parx); hypre_SStructVectorRestore(y, pary); - - parx = NULL; } - + hypre_GpuProfilingPopRange(); } - else if (x_object_type == HYPRE_PARCSR) { hypre_SStructVectorConvert(x, &parx); + hypre_SStructVectorConvert(b, &parb); hypre_SStructVectorConvert(y, &pary); - hypre_ParCSRMatrixMatvec(alpha, parcsrA, parx, beta, pary); + hypre_ParCSRMatrixMatvecOutOfPlace(alpha, parcsrA, parx, beta, parb, pary); - hypre_SStructVectorRestore(x, NULL); + hypre_SStructVectorRestore(x, parx); + hypre_SStructVectorRestore(b, parb); hypre_SStructVectorRestore(y, pary); - - parx = NULL; } + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_SStructMatvecDestroy *--------------------------------------------------------------------------*/ HYPRE_Int @@ -372,7 +434,6 @@ hypre_SStructMatvecDestroy( void *matvec_vdata ) } /*-------------------------------------------------------------------------- - * hypre_SStructMatvec *--------------------------------------------------------------------------*/ HYPRE_Int @@ -386,7 +447,7 @@ hypre_SStructMatvec( HYPRE_Complex alpha, hypre_SStructMatvecCreate(&matvec_data); hypre_SStructMatvecSetup(matvec_data, A, x); - hypre_SStructMatvecCompute(matvec_data, alpha, A, x, beta, y); + hypre_SStructMatvecCompute(matvec_data, alpha, A, x, beta, y, y); hypre_SStructMatvecDestroy(matvec_data); return hypre_error_flag; diff --git a/src/sstruct_mv/sstruct_scale.c b/src/sstruct_mv/sstruct_scale.c index f7a1ebbce4..3faadd04a6 100644 --- a/src/sstruct_mv/sstruct_scale.c +++ b/src/sstruct_mv/sstruct_scale.c @@ -42,6 +42,12 @@ hypre_SStructScale( HYPRE_Complex alpha, HYPRE_Int part; HYPRE_Int y_object_type = hypre_SStructVectorObjectType(y); + /* If alpha is 1.0, y does not change */ + if (alpha == 1.0) + { + return hypre_error_flag; + } + if (y_object_type == HYPRE_SSTRUCT) { for (part = 0; part < nparts; part++) diff --git a/src/sstruct_mv/sstruct_stencil.c b/src/sstruct_mv/sstruct_stencil.c index 1406cdc9fd..58cf31417b 100644 --- a/src/sstruct_mv/sstruct_stencil.c +++ b/src/sstruct_mv/sstruct_stencil.c @@ -8,15 +8,19 @@ #include "_hypre_sstruct_mv.h" /*-------------------------------------------------------------------------- - * hypre_SStructStencilRef + * TODO: the struct function hypre_StructStencilRef has a different + * prototype than this one. *--------------------------------------------------------------------------*/ HYPRE_Int hypre_SStructStencilRef( hypre_SStructStencil *stencil, hypre_SStructStencil **stencil_ref ) { - hypre_SStructStencilRefCount(stencil) ++; - *stencil_ref = stencil; + if (stencil_ref) + { + hypre_SStructStencilRefCount(stencil) ++; + *stencil_ref = stencil; + } return hypre_error_flag; } diff --git a/src/sstruct_mv/sstruct_stencil.h b/src/sstruct_mv/sstruct_stencil.h index 994218a04a..22a7803d83 100644 --- a/src/sstruct_mv/sstruct_stencil.h +++ b/src/sstruct_mv/sstruct_stencil.h @@ -42,7 +42,7 @@ hypre_StructStencilShape( hypre_SStructStencilSStencil(stencil) ) hypre_StructStencilSize( hypre_SStructStencilSStencil(stencil) ) #define hypre_SStructStencilNDim(stencil) \ hypre_StructStencilNDim( hypre_SStructStencilSStencil(stencil) ) -#define hypre_SStructStencilEntry(stencil, i) \ -hypre_StructStencilElement( hypre_SStructStencilSStencil(stencil), i ) +#define hypre_SStructStencilOffset(stencil, i) \ +hypre_StructStencilOffset( hypre_SStructStencilSStencil(stencil), i ) #endif diff --git a/src/sstruct_mv/sstruct_vector.c b/src/sstruct_mv/sstruct_vector.c index 6f1d1504a1..3a16f7ca17 100644 --- a/src/sstruct_mv/sstruct_vector.c +++ b/src/sstruct_mv/sstruct_vector.c @@ -46,13 +46,13 @@ hypre_SStructPVectorCreate( MPI_Comm comm, hypre_StructGrid *sgrid; HYPRE_Int var; - pvector = hypre_TAlloc(hypre_SStructPVector, 1, HYPRE_MEMORY_HOST); + pvector = hypre_TAlloc(hypre_SStructPVector, 1, HYPRE_MEMORY_HOST); hypre_SStructPVectorComm(pvector) = comm; hypre_SStructPVectorPGrid(pvector) = pgrid; nvars = hypre_SStructPGridNVars(pgrid); hypre_SStructPVectorNVars(pvector) = nvars; - svectors = hypre_TAlloc(hypre_StructVector *, nvars, HYPRE_MEMORY_HOST); + svectors = hypre_TAlloc(hypre_StructVector *, nvars, HYPRE_MEMORY_HOST); for (var = 0; var < nvars; var++) { @@ -60,7 +60,7 @@ hypre_SStructPVectorCreate( MPI_Comm comm, svectors[var] = hypre_StructVectorCreate(comm, sgrid); } hypre_SStructPVectorSVectors(pvector) = svectors; - comm_pkgs = hypre_TAlloc(hypre_CommPkg *, nvars, HYPRE_MEMORY_HOST); + comm_pkgs = hypre_TAlloc(hypre_CommPkg *, nvars, HYPRE_MEMORY_HOST); for (var = 0; var < nvars; var++) { comm_pkgs[var] = NULL; @@ -131,7 +131,7 @@ hypre_SStructPVectorInitialize( hypre_SStructPVector *pvector ) for (var = 0; var < nvars; var++) { svector = hypre_SStructPVectorSVector(pvector, var); - hypre_StructVectorInitialize(svector); + hypre_StructVectorInitialize(svector, 1); if (vartypes[var] > 0) { /* needed to get AddTo accumulation correct between processors */ @@ -249,6 +249,7 @@ hypre_SStructPVectorSetBoxValues( hypre_SStructPVector *pvector, #if defined(HYPRE_USING_GPU) hypre_SyncDevice(); #endif + /* set (AddTo/Get) or clear (Set) values outside the grid in ghost zones */ if (action != 0) { @@ -336,6 +337,8 @@ hypre_SStructPVectorAccumulate( hypre_SStructPVector *pvector ) hypre_CommInfo *comm_info; hypre_CommPkg *comm_pkg; hypre_CommHandle *comm_handle; + HYPRE_Complex *data; + hypre_Index ustride; HYPRE_Int ndim = hypre_SStructPGridNDim(pgrid); HYPRE_SStructVariable *vartypes = hypre_SStructPGridVarTypes(pgrid); @@ -351,6 +354,8 @@ hypre_SStructPVectorAccumulate( hypre_SStructPVector *pvector ) return hypre_error_flag; } + hypre_SetIndex(ustride, 1); + for (var = 0; var < nvars; var++) { if (vartypes[var] > 0) @@ -362,12 +367,13 @@ hypre_SStructPVectorAccumulate( hypre_SStructPVector *pvector ) num_ghost[2 * d] = num_ghost[2 * d + 1] = hypre_IndexD(varoffset, d); } - hypre_CreateCommInfoFromNumGhost(sgrid, num_ghost, &comm_info); + hypre_CreateCommInfoFromNumGhost(sgrid, ustride, num_ghost, &comm_info); hypre_CommPkgDestroy(comm_pkgs[var]); hypre_CommPkgCreate(comm_info, hypre_StructVectorDataSpace(svectors[var]), hypre_StructVectorDataSpace(svectors[var]), 1, NULL, 0, hypre_StructVectorComm(svectors[var]), + hypre_StructVectorMemoryLocation(svectors[var]), &comm_pkgs[var]); /* accumulate values from AddTo */ @@ -375,12 +381,11 @@ hypre_SStructPVectorAccumulate( hypre_SStructPVector *pvector ) hypre_StructVectorDataSpace(svectors[var]), hypre_StructVectorDataSpace(svectors[var]), 1, NULL, 1, hypre_StructVectorComm(svectors[var]), + hypre_StructVectorMemoryLocation(svectors[var]), &comm_pkg); - hypre_InitializeCommunication(comm_pkg, - hypre_StructVectorData(svectors[var]), - hypre_StructVectorData(svectors[var]), 1, 0, - &comm_handle); - hypre_FinalizeCommunication(comm_handle); + data = hypre_StructVectorData(svectors[var]); + hypre_StructCommunicationInitialize(comm_pkg, &data, &data, 1, 0, &comm_handle); + hypre_StructCommunicationFinalize(comm_handle); hypre_CommInfoDestroy(comm_info); hypre_CommPkgDestroy(comm_pkg); @@ -423,17 +428,16 @@ hypre_SStructPVectorGather( hypre_SStructPVector *pvector ) hypre_StructVector **svectors = hypre_SStructPVectorSVectors(pvector); hypre_CommPkg **comm_pkgs = hypre_SStructPVectorCommPkgs(pvector); hypre_CommHandle *comm_handle; + HYPRE_Complex *data; HYPRE_Int var; for (var = 0; var < nvars; var++) { if (comm_pkgs[var] != NULL) { - hypre_InitializeCommunication(comm_pkgs[var], - hypre_StructVectorData(svectors[var]), - hypre_StructVectorData(svectors[var]), 0, 0, - &comm_handle); - hypre_FinalizeCommunication(comm_handle); + data = hypre_StructVectorData(svectors[var]); + hypre_StructCommunicationInitialize(comm_pkgs[var], &data, &data, 0, 0, &comm_handle); + hypre_StructCommunicationFinalize(comm_handle); } } @@ -509,6 +513,30 @@ hypre_SStructPVectorSetConstantValues( hypre_SStructPVector *pvector, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructPVectorSetRandomValues( hypre_SStructPVector *pvector, + HYPRE_Int seed ) +{ + HYPRE_Int nvars = hypre_SStructPVectorNVars(pvector); + hypre_StructVector *svector; + HYPRE_Int vseed; + HYPRE_Int var; + + vseed = seed; + for (var = 0; var < nvars; var++) + { + svector = hypre_SStructPVectorSVector(pvector, var); + hypre_StructVectorSetRandomValues(svector, vseed); + vseed++; + } + + return hypre_error_flag; +} + + /*-------------------------------------------------------------------------- * For now, just print multiple files *--------------------------------------------------------------------------*/ @@ -524,6 +552,7 @@ hypre_SStructPVectorPrint( const char *filename, for (var = 0; var < nvars; var++) { + // hypre_sprintf(new_filename, "%s.v%02d", filename, var); hypre_sprintf(new_filename, "%s.%02d", filename, var); hypre_StructVectorPrint(new_filename, hypre_SStructPVectorSVector(pvector, var), @@ -570,6 +599,34 @@ hypre_SStructVectorSetConstantValues( hypre_SStructVector *vector, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructVectorSetRandomValues( hypre_SStructVector *vector, + HYPRE_Int seed ) +{ + HYPRE_Int nparts = hypre_SStructVectorNParts(vector); + HYPRE_Int nvars; + hypre_SStructPVector *pvector; + HYPRE_Int part; + HYPRE_Int pseed; + HYPRE_Int myid; + + myid = hypre_MPI_Comm_rank(hypre_SStructVectorComm(vector), &myid); + pseed = seed * (myid + 1); + for (part = 0; part < nparts; part++) + { + pvector = hypre_SStructVectorPVector(vector, part); + nvars = hypre_SStructPVectorNVars(pvector); + + hypre_SStructPVectorSetRandomValues(pvector, pseed); + pseed += nvars; + } + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- * Here the address of the parvector inside the semistructured vector * is provided to the "outside". It assumes that the vector type @@ -593,6 +650,8 @@ HYPRE_Int hypre_SStructVectorParConvert( hypre_SStructVector *vector, hypre_ParVector **parvector_ptr ) { + HYPRE_Int ndim = hypre_SStructVectorNDim(vector); + hypre_ParVector *parvector; HYPRE_Complex *pardata; HYPRE_Int pari; @@ -601,16 +660,17 @@ hypre_SStructVectorParConvert( hypre_SStructVector *vector, hypre_StructVector *y; hypre_Box *y_data_box; HYPRE_Complex *yp; - hypre_BoxArray *boxes; - hypre_Box *box; + HYPRE_Int nboxes; + hypre_Box *loop_box; hypre_Index loop_size; hypre_IndexRef start; - hypre_Index stride; + hypre_Index ustride; HYPRE_Int nparts, nvars; HYPRE_Int part, var, i; - hypre_SetIndex(stride, 1); + loop_box = hypre_BoxCreate(ndim); + hypre_SetIndex(ustride, 1); parvector = hypre_SStructVectorParVector(vector); pardata = hypre_VectorData(hypre_ParVectorLocalVector(parvector)); @@ -624,23 +684,22 @@ hypre_SStructVectorParConvert( hypre_SStructVector *vector, { y = hypre_SStructPVectorSVector(pvector, var); - boxes = hypre_StructGridBoxes(hypre_StructVectorGrid(y)); - hypre_ForBoxI(i, boxes) + nboxes = hypre_StructVectorNBoxes(y); + for (i = 0; i < nboxes; i++) { - box = hypre_BoxArrayBox(boxes, i); - start = hypre_BoxIMin(box); + hypre_StructVectorGridBoxCopy(y, i, loop_box); + start = hypre_BoxIMin(loop_box); - y_data_box = - hypre_BoxArrayBox(hypre_StructVectorDataSpace(y), i); - yp = hypre_StructVectorBoxData(y, i); + y_data_box = hypre_StructVectorGridDataBox(y, i); + yp = hypre_StructVectorGridData(y, i); - hypre_BoxGetSize(box, loop_size); + hypre_BoxGetSize(loop_box, loop_size); #undef DEVICE_VAR #define DEVICE_VAR is_device_ptr(pardata,yp) - hypre_BoxLoop2Begin(hypre_SStructVectorNDim(vector), loop_size, - y_data_box, start, stride, yi, - box, start, stride, bi); + hypre_BoxLoop2Begin(ndim, loop_size, + y_data_box, start, ustride, yi, + loop_box, start, ustride, bi); { pardata[pari + bi] = yp[yi]; } @@ -648,11 +707,13 @@ hypre_SStructVectorParConvert( hypre_SStructVector *vector, #undef DEVICE_VAR #define DEVICE_VAR - pari += hypre_BoxVolume(box); + pari += hypre_BoxVolume(loop_box); } } } + hypre_BoxDestroy(loop_box); + *parvector_ptr = hypre_SStructVectorParVector(vector); return hypre_error_flag; @@ -681,6 +742,8 @@ HYPRE_Int hypre_SStructVectorParRestore( hypre_SStructVector *vector, hypre_ParVector *parvector ) { + HYPRE_Int ndim = hypre_SStructVectorNDim(vector); + HYPRE_Complex *pardata; HYPRE_Int pari; @@ -688,18 +751,19 @@ hypre_SStructVectorParRestore( hypre_SStructVector *vector, hypre_StructVector *y; hypre_Box *y_data_box; HYPRE_Complex *yp; - hypre_BoxArray *boxes; - hypre_Box *box; + HYPRE_Int nboxes; + hypre_Box *loop_box; hypre_Index loop_size; hypre_IndexRef start; - hypre_Index stride; + hypre_Index ustride; HYPRE_Int nparts, nvars; HYPRE_Int part, var, i; if (parvector != NULL) { - hypre_SetIndex(stride, 1); + loop_box = hypre_BoxCreate(ndim); + hypre_SetIndex(ustride, 1); parvector = hypre_SStructVectorParVector(vector); pardata = hypre_VectorData(hypre_ParVectorLocalVector(parvector)); @@ -713,23 +777,22 @@ hypre_SStructVectorParRestore( hypre_SStructVector *vector, { y = hypre_SStructPVectorSVector(pvector, var); - boxes = hypre_StructGridBoxes(hypre_StructVectorGrid(y)); - hypre_ForBoxI(i, boxes) + nboxes = hypre_StructVectorNBoxes(y); + for (i = 0; i < nboxes; i++) { - box = hypre_BoxArrayBox(boxes, i); - start = hypre_BoxIMin(box); + hypre_StructVectorGridBoxCopy(y, i, loop_box); + start = hypre_BoxIMin(loop_box); - y_data_box = - hypre_BoxArrayBox(hypre_StructVectorDataSpace(y), i); - yp = hypre_StructVectorBoxData(y, i); + y_data_box = hypre_StructVectorGridDataBox(y, i); + yp = hypre_StructVectorGridData(y, i); - hypre_BoxGetSize(box, loop_size); + hypre_BoxGetSize(loop_box, loop_size); #undef DEVICE_VAR #define DEVICE_VAR is_device_ptr(yp,pardata) hypre_BoxLoop2Begin(hypre_SStructVectorNDim(vector), loop_size, - y_data_box, start, stride, yi, - box, start, stride, bi); + y_data_box, start, ustride, yi, + loop_box, start, ustride, bi); { yp[yi] = pardata[pari + bi]; } @@ -737,10 +800,12 @@ hypre_SStructVectorParRestore( hypre_SStructVector *vector, #undef DEVICE_VAR #define DEVICE_VAR - pari += hypre_BoxVolume(box); + pari += hypre_BoxVolume(loop_box); } } } + + hypre_BoxDestroy(loop_box); } return hypre_error_flag; @@ -765,7 +830,7 @@ hypre_SStructPVectorInitializeShell( hypre_SStructPVector *pvector) hypre_StructVector *svector; pdatasize = 0; - pdataindices = hypre_CTAlloc(HYPRE_Int, nvars, HYPRE_MEMORY_HOST); + pdataindices = hypre_CTAlloc(HYPRE_Int, nvars, HYPRE_MEMORY_HOST); for (var = 0; var < nvars; var++) { @@ -806,7 +871,7 @@ hypre_SStructVectorInitializeShell( hypre_SStructVector *vector) HYPRE_Int *dataindices; datasize = 0; - dataindices = hypre_CTAlloc(HYPRE_Int, nparts, HYPRE_MEMORY_HOST); + dataindices = hypre_CTAlloc(HYPRE_Int, nparts, HYPRE_MEMORY_HOST); for (part = 0; part < nparts; part++) { pvector = hypre_SStructVectorPVector(vector, part) ; @@ -849,6 +914,170 @@ hypre_SStructVectorClearGhostValues(hypre_SStructVector *vector) return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * Print vector to a format readable by GLVis. + * This is mainly for debugging purposes. + * + * RDF TODO: Update to use non-unitary stride? + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SStructVectorPrintGLVis( hypre_SStructVector *vector, + const char *fileprefix ) +{ + hypre_SStructPVector *pvector; + hypre_StructVector *svector; + hypre_SStructPGrid *pgrid; + hypre_StructGrid *sgrid; + hypre_BoxArray *grid_boxes; + hypre_BoxArray *data_space; + hypre_Box *gbox; + hypre_Box *dbox; + hypre_IndexRef start; + hypre_Index loop_size; + hypre_Index stride; + HYPRE_SStructVariable vartype; + HYPRE_Real *data; + + FILE *file[8]; + char filename[255]; + char fe_coll[100]; + // HYPRE_Int cellNV; + // HYPRE_Int var_off; + // HYPRE_Int vinc[8][3] = {{0, 0, 0}, {1, 0, 0}, + // {1, 1, 0}, {0, 1, 0}, + // {0, 0, 1}, {1, 0, 1}, + // {1, 1, 1}, {0, 1, 1}}; + HYPRE_Int myid; + HYPRE_Int i, ndim; + HYPRE_Int part, nparts; + HYPRE_Int var, nvars; + HYPRE_Int dbox_volume; + + /* Initialize some data */ + hypre_SetIndex(stride, 1); + ndim = hypre_SStructVectorNDim(vector); + nparts = hypre_SStructVectorNParts(vector); + hypre_MPI_Comm_rank(hypre_SStructVectorComm(vector), &myid); + switch (ndim) + { + case 2: + // cellNV = 4; + break; + + case 3: + // cellNV = 8; + break; + + default: + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "SStructVectorPrintGLVis works only in 2D/3D.\n"); + return hypre_error_flag; + } + for (var = 0; var < 8; var++) + { + file[var] = NULL; + } + + /* Open files */ + for (part = 0; part < nparts; part++) + { + pvector = hypre_SStructVectorPVector(vector, part); + pgrid = hypre_SStructPVectorPGrid(pvector); + nvars = hypre_SStructPGridNVars(pgrid); + for (var = 0; var < nvars; var++) + { + vartype = hypre_SStructPGridVarType(pgrid, var); + hypre_sprintf(filename, "%s.%02d.%05d", fileprefix, vartype, myid); + if (file[vartype] == NULL) + { + file[vartype] = fopen(filename, "w"); + } + } + } + + /* Print variables separately */ + for (part = 0; part < nparts; part++) + { + pvector = hypre_SStructVectorPVector(vector, part); + pgrid = hypre_SStructPVectorPGrid(pvector); + + for (var = 0; var < nvars; var++) + { + svector = hypre_SStructPVectorSVector(pvector, var); + vartype = hypre_SStructPGridVarType(pgrid, var); + sgrid = hypre_SStructPGridCellSGrid(pgrid); + + /* set the finite element collection based on variable type */ + switch (vartype) + { + case HYPRE_SSTRUCT_VARIABLE_CELL: + hypre_sprintf(fe_coll, "Local_L2_%dD_P0", ndim); + // var_off = 0; + break; + + case HYPRE_SSTRUCT_VARIABLE_NODE: + hypre_sprintf(fe_coll, "Local_H1_%dD_P1", ndim); + // var_off = 1; + break; + + default: + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Error: unsuported variable type\n"); + return hypre_error_flag; + } + + /* grid function header */ + hypre_fprintf(file[vartype], "FiniteElementSpace\n"); + hypre_fprintf(file[vartype], "FiniteElementCollection: %s\n", fe_coll); + hypre_fprintf(file[vartype], "VDim: 1\n"); + hypre_fprintf(file[vartype], "Ordering: 0\n\n"); + + grid_boxes = hypre_StructGridBoxes(sgrid); + data_space = hypre_StructVectorDataSpace(svector); + data = hypre_StructVectorData(svector); + dbox_volume = 0; + hypre_ForBoxI(i, grid_boxes) + { + gbox = hypre_BoxArrayBox(grid_boxes, i); + dbox = hypre_BoxArrayBox(data_space, i); + + start = hypre_BoxIMin(gbox); + dbox_volume = hypre_BoxVolume(dbox); + hypre_BoxGetSize(gbox, loop_size); + switch (vartype) + { + case HYPRE_SSTRUCT_VARIABLE_CELL: + hypre_SerialBoxLoop1Begin(ndim, loop_size, dbox, start, stride, datai); + { + hypre_fprintf(file[vartype], "%.14e\n", data[datai]); + } + hypre_SerialBoxLoop1End(datai); + break; + + case HYPRE_SSTRUCT_VARIABLE_NODE: + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "TODO: print node variables"); + return hypre_error_flag; + } + data += dbox_volume; + } /* loop on grid boxes */ + } /* loop on parts */ + } /* loop on variables */ + + /*---------------------------------------- + * Close files + *----------------------------------------*/ + for (var = 0; var < 8; var++) + { + if (file[var] != NULL) + { + fflush(file[var]); + fclose(file[var]); + } + } + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ diff --git a/src/sstruct_mv/sstruct_vector.h b/src/sstruct_mv/sstruct_vector.h index 5870108445..6d00315588 100644 --- a/src/sstruct_mv/sstruct_vector.h +++ b/src/sstruct_mv/sstruct_vector.h @@ -24,16 +24,15 @@ typedef struct hypre_SStructPGrid *pgrid; HYPRE_Int nvars; - hypre_StructVector **svectors; /* nvar array of svectors */ - hypre_CommPkg **comm_pkgs; /* nvar array of comm pkgs */ + hypre_StructVector **svectors; /* nvar array of svectors */ + hypre_CommPkg **comm_pkgs; /* nvar array of comm pkgs */ - HYPRE_Int accumulated; /* AddTo values accumulated? */ + HYPRE_Int accumulated; /* AddTo values accumulated? */ HYPRE_Int ref_count; - HYPRE_Int *dataindices; /* GEC1002 array for starting index of the - svector. pdataindices[varx] */ - HYPRE_Int datasize; /* Size of the pvector = sums size of svectors */ + HYPRE_Int *dataindices; /* dataindices[p]: start index of data for var v */ + HYPRE_Int datasize; /* Size of the pvector = sums size of svectors */ } hypre_SStructPVector; @@ -47,7 +46,6 @@ typedef struct hypre_SStructVector_struct /* s-vector info */ HYPRE_Int nparts; hypre_SStructPVector **pvectors; - hypre_CommPkg ***comm_pkgs; /* nvar array of comm pkgs */ /* u-vector info */ HYPRE_IJVector ijvector; @@ -56,11 +54,10 @@ 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 */ + /* 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 *dataindices; /* dataindices[p]: start index of data for part p */ + HYPRE_Int datasize; /* size of all data = ghlocalsize */ HYPRE_Int global_size; /* Total number coefficients */ HYPRE_Int ref_count; @@ -71,37 +68,39 @@ typedef struct hypre_SStructVector_struct * Accessor macros: hypre_SStructVector *--------------------------------------------------------------------------*/ -#define hypre_SStructVectorComm(vec) ((vec) -> comm) -#define hypre_SStructVectorNDim(vec) ((vec) -> ndim) -#define hypre_SStructVectorGrid(vec) ((vec) -> grid) -#define hypre_SStructVectorObjectType(vec) ((vec) -> object_type) -#define hypre_SStructVectorNParts(vec) ((vec) -> nparts) -#define hypre_SStructVectorPVectors(vec) ((vec) -> pvectors) -#define hypre_SStructVectorPVector(vec, part) ((vec) -> pvectors[part]) -#define hypre_SStructVectorIJVector(vec) ((vec) -> ijvector) -#define hypre_SStructVectorParVector(vec) ((vec) -> parvector) -#define hypre_SStructVectorNborNComms(vec) ((vec) -> nbor_ncomms) -#define hypre_SStructVectorGlobalSize(vec) ((vec) -> global_size) -#define hypre_SStructVectorRefCount(vec) ((vec) -> ref_count) -#define hypre_SStructVectorData(vec) ((vec) -> data ) -#define hypre_SStructVectorDataIndices(vec) ((vec) -> dataindices) -#define hypre_SStructVectorDataSize(vec) ((vec) -> datasize) +#define hypre_SStructVectorComm(vec) ((vec) -> comm) +#define hypre_SStructVectorNDim(vec) ((vec) -> ndim) +#define hypre_SStructVectorGrid(vec) ((vec) -> grid) +#define hypre_SStructVectorObjectType(vec) ((vec) -> object_type) +#define hypre_SStructVectorNParts(vec) ((vec) -> nparts) +#define hypre_SStructVectorPVectors(vec) ((vec) -> pvectors) +#define hypre_SStructVectorPVector(vec, part) ((vec) -> pvectors[part]) +#define hypre_SStructVectorIJVector(vec) ((vec) -> ijvector) +#define hypre_SStructVectorParVector(vec) ((vec) -> parvector) +#define hypre_SStructVectorNborNComms(vec) ((vec) -> nbor_ncomms) +#define hypre_SStructVectorGlobalSize(vec) ((vec) -> global_size) +#define hypre_SStructVectorRefCount(vec) ((vec) -> ref_count) +#define hypre_SStructVectorData(vec) ((vec) -> data ) +#define hypre_SStructVectorDataIndices(vec) ((vec) -> dataindices) +#define hypre_SStructVectorDataIndex(vec, part) ((vec) -> dataindices[part]) +#define hypre_SStructVectorDataSize(vec) ((vec) -> datasize) /*-------------------------------------------------------------------------- * Accessor macros: hypre_SStructPVector *--------------------------------------------------------------------------*/ -#define hypre_SStructPVectorComm(pvec) ((pvec) -> comm) -#define hypre_SStructPVectorPGrid(pvec) ((pvec) -> pgrid) -#define hypre_SStructPVectorNVars(pvec) ((pvec) -> nvars) -#define hypre_SStructPVectorSVectors(pvec) ((pvec) -> svectors) -#define hypre_SStructPVectorSVector(pvec, v) ((pvec) -> svectors[v]) -#define hypre_SStructPVectorCommPkgs(pvec) ((pvec) -> comm_pkgs) -#define hypre_SStructPVectorCommPkg(pvec, v) ((pvec) -> comm_pkgs[v]) -#define hypre_SStructPVectorAccumulated(pvec) ((pvec) -> accumulated) -#define hypre_SStructPVectorRefCount(pvec) ((pvec) -> ref_count) -#define hypre_SStructPVectorDataIndices(pvec) ((pvec) -> dataindices ) -#define hypre_SStructPVectorDataSize(pvec) ((pvec) -> datasize ) +#define hypre_SStructPVectorComm(pvec) ((pvec) -> comm) +#define hypre_SStructPVectorPGrid(pvec) ((pvec) -> pgrid) +#define hypre_SStructPVectorNVars(pvec) ((pvec) -> nvars) +#define hypre_SStructPVectorSVectors(pvec) ((pvec) -> svectors) +#define hypre_SStructPVectorSVector(pvec, v) ((pvec) -> svectors[v]) +#define hypre_SStructPVectorCommPkgs(pvec) ((pvec) -> comm_pkgs) +#define hypre_SStructPVectorCommPkg(pvec, v) ((pvec) -> comm_pkgs[v]) +#define hypre_SStructPVectorAccumulated(pvec) ((pvec) -> accumulated) +#define hypre_SStructPVectorRefCount(pvec) ((pvec) -> ref_count) +#define hypre_SStructPVectorDataIndices(pvec) ((pvec) -> dataindices) +#define hypre_SStructPVectorDataIndex(pvec, v) ((pvec) -> dataindices[v]) +#define hypre_SStructPVectorDataSize(pvec) ((pvec) -> datasize) #endif diff --git a/src/struct_ls/CMakeLists.txt b/src/struct_ls/CMakeLists.txt index 952398324d..adfe0a722e 100644 --- a/src/struct_ls/CMakeLists.txt +++ b/src/struct_ls/CMakeLists.txt @@ -8,86 +8,108 @@ set(HDRS _hypre_struct_ls.h ) -set(SRCS - coarsen.c +# Add MUP headers when mixed precision is enabled +if(HYPRE_ENABLE_MIXED_PRECISION) + list(APPEND HDRS + HYPRE_struct_ls_mp.h + HYPRE_struct_ls_mup.h + _hypre_struct_ls_mup.h + _hypre_struct_ls_mup_def.h + _hypre_struct_ls_mup_undef.h + ) +endif() + +# Regular sources +set(REGULAR_SRCS cyclic_reduction.c + diagscale.c F90_HYPRE_struct_bicgstab.c F90_HYPRE_struct_cycred.c + F90_HYPRE_struct_flexgmres.c + F90_HYPRE_struct_lgmres.c F90_HYPRE_struct_gmres.c + F90_HYPRE_struct_lgmres.c F90_HYPRE_struct_hybrid.c F90_HYPRE_struct_int.c F90_HYPRE_struct_jacobi.c F90_HYPRE_struct_pcg.c F90_HYPRE_struct_pfmg.c F90_HYPRE_struct_smg.c - F90_HYPRE_struct_sparse_msg.c hybrid.c HYPRE_struct_bicgstab.c HYPRE_struct_cycred.c + HYPRE_struct_flexgmres.c + HYPRE_struct_gmres.c HYPRE_struct_hybrid.c - HYPRE_struct_int.c HYPRE_struct_jacobi.c + HYPRE_struct_lgmres.c HYPRE_struct_pfmg.c HYPRE_struct_smg.c - HYPRE_struct_sparse_msg.c - HYPRE_struct_pcg.c - HYPRE_struct_gmres.c - HYPRE_struct_flexgmres.c - HYPRE_struct_lgmres.c jacobi.c pcg_struct.c - pfmg2_setup_rap.c - pfmg3_setup_rap.c pfmg.c + pfmg_coarsen.c pfmg_relax.c + pfmg_setup_rap.c + pfmg_solve.c + semi.c + smg_relax.c + smg_setup.c + smg_setup_rap.c + smg_setup_restrict.c + smg_solve.c + cyclic_reduction.c + diagscale.c + HYPRE_struct_int.c + HYPRE_struct_pcg.c + pfmg2_setup_rap.c + pfmg3_setup_rap.c pfmg_setup.c pfmg_setup_interp.c pfmg_setup_rap5.c pfmg_setup_rap7.c pfmg_setup_rap.c pfmg_solve.c - point_relax.c red_black_constantcoef_gs.c red_black_gs.c - semi.c semi_interp.c semi_restrict.c semi_setup_rap.c smg2_setup_rap.c smg3_setup_rap.c - smg_axpy.c smg.c - smg_relax.c + smg_axpy.c smg_residual.c - smg_setup.c smg_setup_interp.c smg_setup_rap.c smg_setup_restrict.c smg_solve.c - sparse_msg2_setup_rap.c - sparse_msg3_setup_rap.c - sparse_msg.c - sparse_msg_filter.c - sparse_msg_interp.c - sparse_msg_restrict.c - 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} + +# Mixed precision sources +set(MUP_SRCS + mup_fixed.c + mup_functions.c + mup_pre.c ) +if(HYPRE_ENABLE_MIXED_PRECISION) + setup_mixed_precision_compilation("struct_ls" SRCS "${REGULAR_SRCS}") + target_sources(${PROJECT_NAME} PRIVATE ${MUP_SRCS} ${HDRS}) +else() + target_sources(${PROJECT_NAME} PRIVATE ${REGULAR_SRCS} ${HDRS}) +endif() + if (HYPRE_USING_GPU) set(GPU_SRCS cyclic_reduction.c + diagscale.c + jacobi.c HYPRE_struct_int.c HYPRE_struct_pcg.c pfmg2_setup_rap.c pfmg3_setup_rap.c + pfmg_coarsen.c pfmg_setup.c pfmg_setup_interp.c pfmg_setup_rap5.c @@ -104,11 +126,6 @@ if (HYPRE_USING_GPU) smg_axpy.c smg_residual.c smg_setup_interp.c - sparse_msg2_setup_rap.c - sparse_msg3_setup_rap.c - sparse_msg_filter.c - sparse_msg_interp.c - sparse_msg_restrict.c ) convert_filenames_to_full_paths(GPU_SRCS) set(HYPRE_GPU_SOURCES ${HYPRE_GPU_SOURCES} ${GPU_SRCS} PARENT_SCOPE) diff --git a/src/struct_ls/F90_HYPRE_struct_bicgstab.c b/src/struct_ls/F90_HYPRE_struct_bicgstab.c index c55c1c7370..feaac70c8a 100644 --- a/src/struct_ls/F90_HYPRE_struct_bicgstab.c +++ b/src/struct_ls/F90_HYPRE_struct_bicgstab.c @@ -6,7 +6,7 @@ ******************************************************************************/ #include "_hypre_struct_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/struct_ls/F90_HYPRE_struct_cycred.c b/src/struct_ls/F90_HYPRE_struct_cycred.c index 0b858fe9dc..d07f905a6e 100644 --- a/src/struct_ls/F90_HYPRE_struct_cycred.c +++ b/src/struct_ls/F90_HYPRE_struct_cycred.c @@ -6,7 +6,7 @@ ******************************************************************************/ #include "_hypre_struct_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/struct_ls/F90_HYPRE_struct_flexgmres.c b/src/struct_ls/F90_HYPRE_struct_flexgmres.c index c00cba2789..ec5522017d 100644 --- a/src/struct_ls/F90_HYPRE_struct_flexgmres.c +++ b/src/struct_ls/F90_HYPRE_struct_flexgmres.c @@ -6,7 +6,7 @@ ******************************************************************************/ #include "_hypre_struct_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/struct_ls/F90_HYPRE_struct_gmres.c b/src/struct_ls/F90_HYPRE_struct_gmres.c index 794aa24775..70fb22c319 100644 --- a/src/struct_ls/F90_HYPRE_struct_gmres.c +++ b/src/struct_ls/F90_HYPRE_struct_gmres.c @@ -6,7 +6,7 @@ ******************************************************************************/ #include "_hypre_struct_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/struct_ls/F90_HYPRE_struct_hybrid.c b/src/struct_ls/F90_HYPRE_struct_hybrid.c index 802adf1edc..5c68c775c3 100644 --- a/src/struct_ls/F90_HYPRE_struct_hybrid.c +++ b/src/struct_ls/F90_HYPRE_struct_hybrid.c @@ -6,7 +6,7 @@ ******************************************************************************/ #include "_hypre_struct_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/struct_ls/F90_HYPRE_struct_int.c b/src/struct_ls/F90_HYPRE_struct_int.c index bafb38e712..463344541f 100644 --- a/src/struct_ls/F90_HYPRE_struct_int.c +++ b/src/struct_ls/F90_HYPRE_struct_int.c @@ -6,45 +6,12 @@ ******************************************************************************/ #include "_hypre_struct_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #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) -{ - *ierr = (hypre_F90_Int) - ( hypre_StructVectorSetRandomValues( - (hypre_StructVector *) vector, - hypre_F90_PassInt (seed) )); -} - - -/*-------------------------------------------------------------------------- - * HYPRE_StructSetRandomValues - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_structsetrandomvalues, HYPRE_STRUCTSETRANDOMVALUES) -(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_StructSetupInterpreter *--------------------------------------------------------------------------*/ diff --git a/src/struct_ls/F90_HYPRE_struct_jacobi.c b/src/struct_ls/F90_HYPRE_struct_jacobi.c index 3a487397cf..d20f638ccb 100644 --- a/src/struct_ls/F90_HYPRE_struct_jacobi.c +++ b/src/struct_ls/F90_HYPRE_struct_jacobi.c @@ -6,7 +6,7 @@ ******************************************************************************/ #include "_hypre_struct_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/struct_ls/F90_HYPRE_struct_lgmres.c b/src/struct_ls/F90_HYPRE_struct_lgmres.c index a4ff21132a..43ac23b300 100644 --- a/src/struct_ls/F90_HYPRE_struct_lgmres.c +++ b/src/struct_ls/F90_HYPRE_struct_lgmres.c @@ -6,7 +6,7 @@ ******************************************************************************/ #include "_hypre_struct_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/struct_ls/F90_HYPRE_struct_pcg.c b/src/struct_ls/F90_HYPRE_struct_pcg.c index 33af5a6327..a861b3b00c 100644 --- a/src/struct_ls/F90_HYPRE_struct_pcg.c +++ b/src/struct_ls/F90_HYPRE_struct_pcg.c @@ -6,7 +6,7 @@ ******************************************************************************/ #include "_hypre_struct_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/struct_ls/F90_HYPRE_struct_pfmg.c b/src/struct_ls/F90_HYPRE_struct_pfmg.c index 3e52142eae..f8a4aa4ff9 100644 --- a/src/struct_ls/F90_HYPRE_struct_pfmg.c +++ b/src/struct_ls/F90_HYPRE_struct_pfmg.c @@ -6,7 +6,7 @@ ******************************************************************************/ #include "_hypre_struct_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/struct_ls/F90_HYPRE_struct_smg.c b/src/struct_ls/F90_HYPRE_struct_smg.c index dc298d208d..fa5ab82c93 100644 --- a/src/struct_ls/F90_HYPRE_struct_smg.c +++ b/src/struct_ls/F90_HYPRE_struct_smg.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_struct_ls.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/struct_ls/F90_HYPRE_struct_sparse_msg.c b/src/struct_ls/F90_HYPRE_struct_sparse_msg.c deleted file mode 100644 index 77542a9909..0000000000 --- a/src/struct_ls/F90_HYPRE_struct_sparse_msg.c +++ /dev/null @@ -1,322 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_ls.h" -#include "fortran.h" - -#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 ) -{ - *ierr = (hypre_F90_Int) - ( HYPRE_StructSparseMSGCreate( - hypre_F90_PassComm (comm), - hypre_F90_PassObjRef (HYPRE_StructSolver, solver) ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_StructSparseMSGDestroy - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_structsparsemsgdestroy, HYPRE_STRUCTSPARSEMSGDESTROY) -( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) -{ - *ierr = (hypre_F90_Int) - ( HYPRE_StructSparseMSGDestroy( - hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_StructSparseMSGSetup - *--------------------------------------------------------------------------*/ - -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 ) -{ - *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_StructSparseMSGSolve - *--------------------------------------------------------------------------*/ - -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 ) -{ - *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_StructSparseMSGSetTol - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_structsparsemsgsettol, HYPRE_STRUCTSPARSEMSGSETTOL) -( 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_StructSparseMSGSetMaxIter - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_structsparsemsgsetmaxiter, HYPRE_STRUCTSPARSEMSGSETMAXITER) -( 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_StructSparseMSGSetJump - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_structsparsemsgsetjump, HYPRE_STRUCTSPARSEMSGSETJUMP) -( 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_StructSparseMSGSetRelChange - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_structsparsemsgsetrelchan, HYPRE_STRUCTSPARSEMSGSETRELCHAN) -( 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_StructSparseMSGSetZeroGuess - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_structsparsemsgsetzerogue, HYPRE_STRUCTSPARSEMSGSETZEROGUE) -( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) -{ - *ierr = (hypre_F90_Int) - ( HYPRE_StructSparseMSGSetZeroGuess( - hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_StructSparseMSGSetNonZeroGuess - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_structsparsemsgsetnonzero, HYPRE_STRUCTSPARSEMSGSETNONZERO) -( hypre_F90_Obj *solver, - hypre_F90_Int *ierr ) -{ - *ierr = (hypre_F90_Int) - ( HYPRE_StructSparseMSGSetNonZeroGuess( - hypre_F90_PassObj (HYPRE_StructSolver, solver) ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_StructSparseMSGSetRelaxType - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_structsparsemsgsetrelaxty, HYPRE_STRUCTSPARSEMSGSETRELAXTY) -( 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_StructSparseMSGSetJacobiWeight - *--------------------------------------------------------------------------*/ -void -hypre_F90_IFACE(hypre_structsparsemsgsetjacobiweigh, HYPRE_STRUCTSPARSEMSGSETJACOBIWEIGH) -(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_StructSparseMSGSetNumPreRelax - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_structsparsemsgsetnumprer, HYPRE_STRUCTSPARSEMSGSETNUMPRER) -( 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_StructSparseMSGSetNumPostRelax - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_structsparsemsgsetnumpost, HYPRE_STRUCTSPARSEMSGSETNUMPOST) -( 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_StructSparseMSGSetNumFineRelax - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_structsparsemsgsetnumfine, HYPRE_STRUCTSPARSEMSGSETNUMFINE) -( 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_StructSparseMSGSetLogging - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_structsparsemsgsetlogging, HYPRE_STRUCTSPARSEMSGSETLOGGING) -( 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_StructSparseMSGSetPrintLevel - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_structsparsemsgsetprintle, HYPRE_STRUCTSPARSEMSGSETPRINTLE) -( 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_StructSparseMSGGetNumIterations - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_structsparsemsggetnumiter, HYPRE_STRUCTSPARSEMSGGETNUMITER) -( 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_StructSparseMSGGetFinalRelativeResidualNorm - *--------------------------------------------------------------------------*/ - -void -hypre_F90_IFACE(hypre_structsparsemsggetfinalre, HYPRE_STRUCTSPARSEMSGGETFINALRE) -( 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) ) ); -} - -#ifdef __cplusplus -} -#endif diff --git a/src/struct_ls/HYPRE_struct_int.c b/src/struct_ls/HYPRE_struct_int.c index ab9f9449e8..2f6ad18187 100644 --- a/src/struct_ls/HYPRE_struct_int.c +++ b/src/struct_ls/HYPRE_struct_int.c @@ -6,107 +6,37 @@ ******************************************************************************/ #include "_hypre_struct_ls.h" -#include "temp_multivector.h" -#include "_hypre_struct_mv.hpp" - -HYPRE_Int -hypre_StructVectorSetRandomValues( hypre_StructVector *vector, - 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_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 ); - 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); - start = hypre_BoxIMin(box); - - v_data_box = hypre_BoxArrayBox(hypre_StructVectorDataSpace(vector), i); - vp = hypre_StructVectorBoxData(vector, i); - - hypre_BoxGetSize(box, loop_size); - - hypre_SerialBoxLoop1Begin(hypre_StructVectorNDim(vector), loop_size, - v_data_box, start, unit_stride, vi); - { - vp[vi] = 2.0 * hypre_Rand() - 1.0; - } - hypre_SerialBoxLoop1End(vi); - } - - 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 ) -{ - - return hypre_StructVectorSetRandomValues( (hypre_StructVector*)v, seed ); -} +#include "_hypre_lobpcg_temp_multivector.h" HYPRE_Int HYPRE_StructSetupInterpreter( mv_InterfaceInterpreter *i ) { - i->CreateVector = hypre_StructKrylovCreateVector; - i->DestroyVector = hypre_StructKrylovDestroyVector; - i->InnerProd = hypre_StructKrylovInnerProd; - i->CopyVector = hypre_StructKrylovCopyVector; - i->ClearVector = hypre_StructKrylovClearVector; - i->SetRandomValues = hypre_StructSetRandomValues; - i->ScaleVector = hypre_StructKrylovScaleVector; - i->Axpy = hypre_StructKrylovAxpy; - - i->CreateMultiVector = mv_TempMultiVectorCreateFromSampleVector; + i->CreateVector = hypre_StructKrylovCreateVector; + i->DestroyVector = hypre_StructKrylovDestroyVector; + i->InnerProd = hypre_StructKrylovInnerProd; + i->CopyVector = hypre_StructKrylovCopyVector; + i->ClearVector = hypre_StructKrylovClearVector; + i->SetRandomValues = hypre_StructKrylovSetRandomValues; + i->ScaleVector = hypre_StructKrylovScaleVector; + i->Axpy = hypre_StructKrylovAxpy; + + 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; + 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 hypre_error_flag; } @@ -114,12 +44,12 @@ HYPRE_StructSetupInterpreter( mv_InterfaceInterpreter *i ) HYPRE_Int HYPRE_StructSetupMatvec(HYPRE_MatvecFunctions * mv) { - mv->MatvecCreate = hypre_StructKrylovMatvecCreate; - mv->Matvec = hypre_StructKrylovMatvec; - mv->MatvecDestroy = hypre_StructKrylovMatvecDestroy; + mv->MatvecCreate = hypre_StructKrylovMatvecCreate; + mv->Matvec = hypre_StructKrylovMatvec; + mv->MatvecDestroy = hypre_StructKrylovMatvecDestroy; - mv->MatMultiVecCreate = NULL; - mv->MatMultiVec = NULL; + mv->MatMultiVecCreate = NULL; + mv->MatMultiVec = NULL; mv->MatMultiVecDestroy = NULL; return hypre_error_flag; diff --git a/src/struct_ls/HYPRE_struct_jacobi.c b/src/struct_ls/HYPRE_struct_jacobi.c index 7b7d0dac0e..9910cccc3e 100644 --- a/src/struct_ls/HYPRE_struct_jacobi.c +++ b/src/struct_ls/HYPRE_struct_jacobi.c @@ -14,7 +14,7 @@ HYPRE_Int HYPRE_StructJacobiCreate( MPI_Comm comm, HYPRE_StructSolver *solver ) { - *solver = ( (HYPRE_StructSolver) hypre_JacobiCreate( comm ) ); + *solver = ( (HYPRE_StructSolver) hypre_StructJacobiCreate( comm ) ); return hypre_error_flag; } @@ -25,7 +25,7 @@ HYPRE_StructJacobiCreate( MPI_Comm comm, HYPRE_Int HYPRE_StructJacobiDestroy( HYPRE_StructSolver solver ) { - return ( hypre_JacobiDestroy( (void *) solver ) ); + return ( hypre_StructJacobiDestroy( (void *) solver ) ); } /*-------------------------------------------------------------------------- @@ -37,10 +37,10 @@ HYPRE_StructJacobiSetup( HYPRE_StructSolver solver, HYPRE_StructVector b, HYPRE_StructVector x ) { - return ( hypre_JacobiSetup( (void *) solver, - (hypre_StructMatrix *) A, - (hypre_StructVector *) b, - (hypre_StructVector *) x ) ); + return ( hypre_StructJacobiSetup( (void *) solver, + (hypre_StructMatrix *) A, + (hypre_StructVector *) b, + (hypre_StructVector *) x ) ); } /*-------------------------------------------------------------------------- @@ -52,10 +52,10 @@ HYPRE_StructJacobiSolve( HYPRE_StructSolver solver, HYPRE_StructVector b, HYPRE_StructVector x ) { - return ( hypre_JacobiSolve( (void *) solver, - (hypre_StructMatrix *) A, - (hypre_StructVector *) b, - (hypre_StructVector *) x ) ); + return ( hypre_StructJacobiSolve( (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_StructJacobiSetTol( (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_StructJacobiGetTol( (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_StructJacobiSetMaxIter( (void *) solver, max_iter ) ); } /*-------------------------------------------------------------------------- @@ -95,7 +95,7 @@ HYPRE_Int HYPRE_StructJacobiGetMaxIter( HYPRE_StructSolver solver, HYPRE_Int * max_iter ) { - return ( hypre_JacobiGetMaxIter( (void *) solver, max_iter ) ); + return ( hypre_StructJacobiGetMaxIter( (void *) solver, max_iter ) ); } /*-------------------------------------------------------------------------- @@ -104,7 +104,7 @@ HYPRE_StructJacobiGetMaxIter( HYPRE_StructSolver solver, HYPRE_Int HYPRE_StructJacobiSetZeroGuess( HYPRE_StructSolver solver ) { - return ( hypre_JacobiSetZeroGuess( (void *) solver, 1 ) ); + return ( hypre_StructJacobiSetZeroGuess( (void *) solver, 1 ) ); } /*-------------------------------------------------------------------------- @@ -114,7 +114,7 @@ HYPRE_Int HYPRE_StructJacobiGetZeroGuess( HYPRE_StructSolver solver, HYPRE_Int * zeroguess ) { - return ( hypre_JacobiGetZeroGuess( (void *) solver, zeroguess ) ); + return ( hypre_StructJacobiGetZeroGuess( (void *) solver, zeroguess ) ); } /*-------------------------------------------------------------------------- @@ -123,12 +123,9 @@ HYPRE_StructJacobiGetZeroGuess( HYPRE_StructSolver solver, HYPRE_Int HYPRE_StructJacobiSetNonZeroGuess( HYPRE_StructSolver solver ) { - return ( hypre_JacobiSetZeroGuess( (void *) solver, 0 ) ); + return ( hypre_StructJacobiSetZeroGuess( (void *) solver, 0 ) ); } - -/* NOT YET IMPLEMENTED */ - /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -136,7 +133,7 @@ HYPRE_Int HYPRE_StructJacobiGetNumIterations( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ) { - return ( hypre_JacobiGetNumIterations( (void *) solver, num_iterations ) ); + return ( hypre_StructJacobiGetNumIterations( (void *) solver, num_iterations ) ); } /*-------------------------------------------------------------------------- @@ -146,5 +143,5 @@ HYPRE_Int HYPRE_StructJacobiGetFinalRelativeResidualNorm( HYPRE_StructSolver solver, HYPRE_Real *norm ) { - return ( hypre_JacobiGetFinalRelativeResidualNorm( (void *) solver, norm ) ); + return ( hypre_StructJacobiGetFinalRelativeResidualNorm( (void *) solver, norm ) ); } diff --git a/src/struct_ls/HYPRE_struct_ls.h b/src/struct_ls/HYPRE_struct_ls.h index 21adef37ca..912efac48c 100644 --- a/src/struct_ls/HYPRE_struct_ls.h +++ b/src/struct_ls/HYPRE_struct_ls.h @@ -12,6 +12,10 @@ #include "HYPRE_struct_mv.h" #include "HYPRE_lobpcg.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_struct_ls_mup_def.h" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -48,15 +52,6 @@ typedef HYPRE_Int (*HYPRE_PtrToStructSolverFcn)(HYPRE_StructSolver, HYPRE_StructVector, HYPRE_StructVector); -#ifndef HYPRE_MODIFYPC -#define HYPRE_MODIFYPC -/* if pc not defined, then may need HYPRE_SOLVER also */ - -typedef HYPRE_Int (*HYPRE_PtrToModifyPCFcn)(HYPRE_Solver, - HYPRE_Int, - HYPRE_Real); -#endif - /**@}*/ /*-------------------------------------------------------------------------- @@ -291,6 +286,21 @@ HYPRE_Int HYPRE_StructPFMGSetRAPType(HYPRE_StructSolver solver, HYPRE_Int HYPRE_StructPFMGGetRAPType(HYPRE_StructSolver solver, HYPRE_Int *rap_type ); +/** + * (Optional) Set the kernel type used for computing struct matrix-matrix multiplication. + * + * Current values set by \e matmult_type are: + * + * - -1 : proxy to the default depending on hypre's build type (CPU or GPU) + * - 0 : standard (core) algorithm (default for CPUs) + * - 1 : fused algorithm with less, but more computationally intensive BoxLoops (default for GPUs) + **/ +HYPRE_Int HYPRE_StructPFMGSetMatmultType(HYPRE_StructSolver solver, + HYPRE_Int matmult_type); + +HYPRE_Int HYPRE_StructPFMGGetMatmultType(HYPRE_StructSolver solver, + HYPRE_Int *matmult_type); + /** * (Optional) Set number of relaxation sweeps before coarse-grid correction. **/ @@ -336,7 +346,10 @@ HYPRE_Int HYPRE_StructPFMGGetLogging(HYPRE_StructSolver solver, HYPRE_Int *logging); /** - * (Optional) Set the amount of printing to do to the screen. + * (Optional) Control how much information is printed. + * + * - 0 : no printout (default) + * - 1 : print convergence history **/ HYPRE_Int HYPRE_StructPFMGSetPrintLevel(HYPRE_StructSolver solver, HYPRE_Int print_level); @@ -486,7 +499,10 @@ HYPRE_Int HYPRE_StructSMGGetLogging(HYPRE_StructSolver solver, HYPRE_Int *logging); /** - * (Optional) Set the amount of printing to do to the screen. + * (Optional) Control how much information is printed. + * + * - 0 : no printout (default) + * - 1 : print convergence history **/ HYPRE_Int HYPRE_StructSMGSetPrintLevel(HYPRE_StructSolver solver, HYPRE_Int print_level); @@ -1107,72 +1123,6 @@ HYPRE_Int HYPRE_StructHybridSetPCGAbsoluteTolFactor(HYPRE_StructSolver solver, /**@}*/ -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -/* - * @name Struct SparseMSG Solver - **/ - -HYPRE_Int HYPRE_StructSparseMSGCreate(MPI_Comm comm, - 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_Int HYPRE_StructSparseMSGSolve(HYPRE_StructSolver solver, - HYPRE_StructMatrix A, - HYPRE_StructVector b, - HYPRE_StructVector x); - -HYPRE_Int HYPRE_StructSparseMSGSetTol(HYPRE_StructSolver solver, - HYPRE_Real tol); - -HYPRE_Int HYPRE_StructSparseMSGSetMaxIter(HYPRE_StructSolver solver, - HYPRE_Int max_iter); - -HYPRE_Int HYPRE_StructSparseMSGSetJump(HYPRE_StructSolver solver, - HYPRE_Int jump); - -HYPRE_Int HYPRE_StructSparseMSGSetRelChange(HYPRE_StructSolver solver, - 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 HYPRE_StructSparseMSGSetJacobiWeight(HYPRE_StructSolver solver, - HYPRE_Real weight); - -HYPRE_Int HYPRE_StructSparseMSGSetNumPreRelax(HYPRE_StructSolver solver, - HYPRE_Int num_pre_relax); - -HYPRE_Int HYPRE_StructSparseMSGSetNumPostRelax(HYPRE_StructSolver solver, - HYPRE_Int num_post_relax); - -HYPRE_Int HYPRE_StructSparseMSGSetNumFineRelax(HYPRE_StructSolver solver, - HYPRE_Int num_fine_relax); - -HYPRE_Int HYPRE_StructSparseMSGSetLogging(HYPRE_StructSolver solver, - HYPRE_Int logging); - -HYPRE_Int HYPRE_StructSparseMSGSetPrintLevel(HYPRE_StructSolver solver, - HYPRE_Int print_level); - - -HYPRE_Int HYPRE_StructSparseMSGGetNumIterations(HYPRE_StructSolver solver, - HYPRE_Int *num_iterations); - -HYPRE_Int HYPRE_StructSparseMSGGetFinalRelativeResidualNorm(HYPRE_StructSolver solver, - HYPRE_Real *norm); - /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -1209,5 +1159,16 @@ HYPRE_StructSetupMatvec(HYPRE_MatvecFunctions *mv); } #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_struct_ls_mup_undef.h" +#include "HYPRE_struct_ls_mup.h" +#include "HYPRE_struct_ls_mp.h" +#endif #endif +#endif diff --git a/src/struct_ls/HYPRE_struct_ls_mp.c b/src/struct_ls/HYPRE_struct_ls_mp.c new file mode 100644 index 0000000000..3e67e712c3 --- /dev/null +++ b/src/struct_ls/HYPRE_struct_ls_mp.c @@ -0,0 +1,188 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_parcsr_ls mixed precision functions + * + *****************************************************************************/ + + #include "_hypre_struct_ls.h" + +#ifdef HYPRE_MIXED_PRECISION + +/*-------------------------------------------------------------------------- + * Mixed-precision HYPRE_SMGSetup + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGSetup_mp( HYPRE_StructSolver solver, + HYPRE_StructMatrix A, + HYPRE_StructVector b, + HYPRE_StructVector x ) +{ + hypre_StructVector *btemp = NULL; + hypre_StructVector *xtemp = NULL; + /* get matrix precision to call appropriate setup */ + HYPRE_Precision precision = hypre_StructMatrixPrecision (A); + + /* call standard setup if precisions match */ + if(precision == hypre_StructVectorPrecision (b)) + { + return HYPRE_StructSMGSetup( solver, A, b, x ); + } + + HYPRE_StructVectorCreate_pre(precision, + hypre_StructMatrixComm(A), + hypre_StructMatrixGrid(A), + &btemp); + HYPRE_StructVectorInitialize_pre( precision, btemp ); + HYPRE_StructVectorCreate_pre(precision, + hypre_StructMatrixComm(A), + hypre_StructMatrixGrid(A), + &xtemp); + HYPRE_StructVectorInitialize_pre( precision, xtemp ); + + /* copy from double-precision {b,x} to single precision {btemp,xtemp} */ + HYPRE_StructVectorCopy_mp(b, btemp); + HYPRE_StructVectorCopy_mp(x, xtemp); + + /* call setup */ + HYPRE_StructSMGSetup_pre( precision, solver, A, btemp, xtemp ); + + /* copy from single precision {btemp,xtemp} to double-precision {b,x} */ + HYPRE_StructVectorCopy_mp(btemp, b); + HYPRE_StructVectorCopy_mp(xtemp, x); + + /* free data */ + HYPRE_StructVectorDestroy_pre(precision, btemp); + HYPRE_StructVectorDestroy_pre(precision, xtemp); + + return hypre_error_flag; + +} + +/*-------------------------------------------------------------------------- + * Mixed-precision HYPRE_SMGSetup + *--------------------------------------------------------------------------*/ +HYPRE_Int +HYPRE_StructSMGSolve_mp( HYPRE_StructSolver solver, + HYPRE_StructMatrix A, + HYPRE_StructVector b, + HYPRE_StructVector x ) +{ + HYPRE_StructVector btemp = NULL; + HYPRE_StructVector xtemp = NULL; + + HYPRE_StructVectorCreate_flt(hypre_StructMatrixComm(A), + hypre_StructMatrixGrid(A), + &btemp); + HYPRE_StructVectorInitialize_flt( btemp ); + HYPRE_StructVectorCreate_flt(hypre_StructMatrixComm(A), + hypre_StructMatrixGrid(A), + &xtemp); + HYPRE_StructVectorInitialize_flt( xtemp ); + + /* copy from double-precision {b,x} to single precision {btemp,xtemp} */ + HYPRE_StructVectorCopy_mp(b, btemp); + HYPRE_StructVectorCopy_mp(x, xtemp); + + /* call solve */ + HYPRE_StructSMGSolve_flt( solver, A, btemp, xtemp ); + + /* copy from single precision {btemp,xtemp} to double-precision {b,x} */ + HYPRE_StructVectorCopy_mp(btemp, b); + HYPRE_StructVectorCopy_mp(xtemp, x); + + /* free data */ + HYPRE_StructVectorDestroy_flt(btemp); + HYPRE_StructVectorDestroy_flt(xtemp); + + return 0; +} + +/*-------------------------------------------------------------------------- + * Mixed-precision HYPRE_PFMGSetup + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetup_mp( HYPRE_StructSolver solver, + HYPRE_StructMatrix A, + HYPRE_StructVector b, + HYPRE_StructVector x ) +{ + HYPRE_StructVector btemp = NULL; + HYPRE_StructVector xtemp = NULL; + + HYPRE_StructVectorCreate_flt(hypre_StructMatrixComm(A), + hypre_StructMatrixGrid(A), + &btemp); + HYPRE_StructVectorInitialize_flt( btemp ); + HYPRE_StructVectorCreate_flt(hypre_StructMatrixComm(A), + hypre_StructMatrixGrid(A), + &xtemp); + HYPRE_StructVectorInitialize_flt( xtemp ); + + /* copy from double-precision {b,x} to single precision {btemp,xtemp} */ + HYPRE_StructVectorCopy_mp(b, btemp); + HYPRE_StructVectorCopy_mp(x, xtemp); + + /* call setup */ + HYPRE_StructPFMGSetup_flt( solver, A, btemp, xtemp ); + + /* copy from single precision {btemp,xtemp} to double-precision {b,x} */ + HYPRE_StructVectorCopy_mp(btemp, b); + HYPRE_StructVectorCopy_mp(xtemp, x); + + /* free data */ + HYPRE_StructVectorDestroy_flt(btemp); + HYPRE_StructVectorDestroy_flt(xtemp); + + return 0; + +} + +/*-------------------------------------------------------------------------- + * Mixed-precision HYPRE_PFMGSolve + *--------------------------------------------------------------------------*/ +HYPRE_Int +HYPRE_StructPFMGSolve_mp( HYPRE_StructSolver solver, + HYPRE_StructMatrix A, + HYPRE_StructVector b, + HYPRE_StructVector x ) +{ + HYPRE_StructVector btemp = NULL; + HYPRE_StructVector xtemp = NULL; + + HYPRE_StructVectorCreate_flt(hypre_StructMatrixComm(A), + hypre_StructMatrixGrid(A), + &btemp); + HYPRE_StructVectorInitialize_flt( btemp ); + HYPRE_StructVectorCreate_flt(hypre_StructMatrixComm(A), + hypre_StructMatrixGrid(A), + &xtemp); + HYPRE_StructVectorInitialize_flt( xtemp ); + + /* copy from double-precision {b,x} to single precision {btemp,xtemp} */ + HYPRE_StructVectorCopy_mp(b, btemp); + HYPRE_StructVectorCopy_mp(x, xtemp); + + /* call setup */ + HYPRE_StructPFMGSolve_flt( solver, A, btemp, xtemp ); + + /* copy from single precision {btemp,xtemp} to double-precision {b,x} */ + HYPRE_StructVectorCopy_mp(btemp, b); + HYPRE_StructVectorCopy_mp(xtemp, x); + + /* free data */ + HYPRE_StructVectorDestroy_flt(btemp); + HYPRE_StructVectorDestroy_flt(xtemp); + + return 0; +} + +#endif diff --git a/src/struct_ls/HYPRE_struct_ls_mp.h b/src/struct_ls/HYPRE_struct_ls_mp.h new file mode 100644 index 0000000000..6c0b6cfaad --- /dev/null +++ b/src/struct_ls/HYPRE_struct_ls_mp.h @@ -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) + ******************************************************************************/ + +#ifndef HYPRE_STRUCT_LS_MP_HEADER +#define HYPRE_STRUCT_LS_MP_HEADER + +#include "_hypre_struct_ls.h" + +/* Mixed precision function protos */ + +#ifdef HYPRE_MIXED_PRECISION + +#ifdef __cplusplus +extern "C" { +#endif + +HYPRE_Int +HYPRE_StructSMGSetup_mp( HYPRE_StructSolver solver, + HYPRE_StructMatrix A, + HYPRE_StructVector b, + HYPRE_StructVector x); + +HYPRE_Int +HYPRE_StructSMGSolve_mp( HYPRE_StructSolver solver, + HYPRE_StructMatrix A, + HYPRE_StructVector b, + HYPRE_StructVector x); +HYPRE_Int +HYPRE_StructPFMGSetup_mp( HYPRE_StructSolver solver, + HYPRE_StructMatrix A, + HYPRE_StructVector b, + HYPRE_StructVector x); + +HYPRE_Int +HYPRE_StructPFMGSolve_mp( HYPRE_StructSolver solver, + HYPRE_StructMatrix A, + HYPRE_StructVector b, + HYPRE_StructVector x); + +#ifdef __cplusplus +} +#endif + +#endif +#endif + diff --git a/src/struct_ls/HYPRE_struct_ls_mup.h b/src/struct_ls/HYPRE_struct_ls_mup.h new file mode 100644 index 0000000000..664d649c64 --- /dev/null +++ b/src/struct_ls/HYPRE_struct_ls_mup.h @@ -0,0 +1,2177 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#ifndef HYPRE_STRUCT_LS_MUP_HEADER +#define HYPRE_STRUCT_LS_MUP_HEADER + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (HYPRE_MIXED_PRECISION) + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_StructBiCGSTABCreate_flt( MPI_Comm comm, HYPRE_StructSolver *solver ); +HYPRE_Int +HYPRE_StructBiCGSTABCreate_dbl( MPI_Comm comm, HYPRE_StructSolver *solver ); +HYPRE_Int +HYPRE_StructBiCGSTABCreate_long_dbl( MPI_Comm comm, HYPRE_StructSolver *solver ); +HYPRE_Int +HYPRE_StructBiCGSTABCreate( MPI_Comm comm, HYPRE_StructSolver *solver ); + +HYPRE_Int +HYPRE_StructBiCGSTABDestroy_flt( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructBiCGSTABDestroy_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructBiCGSTABDestroy_long_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructBiCGSTABDestroy( HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructBiCGSTABGetFinalRelativeResidualNorm_flt( HYPRE_StructSolver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_StructBiCGSTABGetFinalRelativeResidualNorm_dbl( HYPRE_StructSolver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_StructBiCGSTABGetFinalRelativeResidualNorm_long_dbl( HYPRE_StructSolver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_StructBiCGSTABGetFinalRelativeResidualNorm( HYPRE_StructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_StructBiCGSTABGetNumIterations_flt( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_StructBiCGSTABGetNumIterations_dbl( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_StructBiCGSTABGetNumIterations_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_StructBiCGSTABGetNumIterations( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_StructBiCGSTABGetResidual_flt( HYPRE_StructSolver solver, void **residual ); +HYPRE_Int +HYPRE_StructBiCGSTABGetResidual_dbl( HYPRE_StructSolver solver, void **residual ); +HYPRE_Int +HYPRE_StructBiCGSTABGetResidual_long_dbl( HYPRE_StructSolver solver, void **residual ); +HYPRE_Int +HYPRE_StructBiCGSTABGetResidual( HYPRE_StructSolver solver, void **residual ); + +HYPRE_Int +HYPRE_StructBiCGSTABSetAbsoluteTol_flt( HYPRE_StructSolver solver, hypre_float tol ); +HYPRE_Int +HYPRE_StructBiCGSTABSetAbsoluteTol_dbl( HYPRE_StructSolver solver, hypre_double tol ); +HYPRE_Int +HYPRE_StructBiCGSTABSetAbsoluteTol_long_dbl( HYPRE_StructSolver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_StructBiCGSTABSetAbsoluteTol( HYPRE_StructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_StructBiCGSTABSetLogging_flt( HYPRE_StructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_StructBiCGSTABSetLogging_dbl( HYPRE_StructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_StructBiCGSTABSetLogging_long_dbl( HYPRE_StructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_StructBiCGSTABSetLogging( HYPRE_StructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_StructBiCGSTABSetMaxIter_flt( HYPRE_StructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_StructBiCGSTABSetMaxIter_dbl( HYPRE_StructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_StructBiCGSTABSetMaxIter_long_dbl( HYPRE_StructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_StructBiCGSTABSetMaxIter( HYPRE_StructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_StructBiCGSTABSetPrecond_flt( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ); +HYPRE_Int +HYPRE_StructBiCGSTABSetPrecond_dbl( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ); +HYPRE_Int +HYPRE_StructBiCGSTABSetPrecond_long_dbl( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ); +HYPRE_Int +HYPRE_StructBiCGSTABSetPrecond( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ); + +HYPRE_Int +HYPRE_StructBiCGSTABSetPrintLevel_flt( HYPRE_StructSolver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_StructBiCGSTABSetPrintLevel_dbl( HYPRE_StructSolver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_StructBiCGSTABSetPrintLevel_long_dbl( HYPRE_StructSolver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_StructBiCGSTABSetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_StructBiCGSTABSetTol_flt( HYPRE_StructSolver solver, hypre_float tol ); +HYPRE_Int +HYPRE_StructBiCGSTABSetTol_dbl( HYPRE_StructSolver solver, hypre_double tol ); +HYPRE_Int +HYPRE_StructBiCGSTABSetTol_long_dbl( HYPRE_StructSolver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_StructBiCGSTABSetTol( HYPRE_StructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_StructBiCGSTABSetup_flt( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructBiCGSTABSetup_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructBiCGSTABSetup_long_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructBiCGSTABSetup( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructBiCGSTABSolve_flt( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructBiCGSTABSolve_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructBiCGSTABSolve_long_dbl( HYPRE_StructSolver solver, 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_Int +HYPRE_StructCycRedCreate_flt( MPI_Comm comm, HYPRE_StructSolver *solver ); +HYPRE_Int +HYPRE_StructCycRedCreate_dbl( MPI_Comm comm, HYPRE_StructSolver *solver ); +HYPRE_Int +HYPRE_StructCycRedCreate_long_dbl( MPI_Comm comm, HYPRE_StructSolver *solver ); +HYPRE_Int +HYPRE_StructCycRedCreate( MPI_Comm comm, HYPRE_StructSolver *solver ); + +HYPRE_Int +HYPRE_StructCycRedDestroy_flt( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructCycRedDestroy_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructCycRedDestroy_long_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructCycRedDestroy( HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructCycRedSetBase_flt( HYPRE_StructSolver solver, HYPRE_Int ndim, HYPRE_Int *base_index, HYPRE_Int *base_stride ); +HYPRE_Int +HYPRE_StructCycRedSetBase_dbl( HYPRE_StructSolver solver, HYPRE_Int ndim, HYPRE_Int *base_index, HYPRE_Int *base_stride ); +HYPRE_Int +HYPRE_StructCycRedSetBase_long_dbl( HYPRE_StructSolver solver, HYPRE_Int ndim, HYPRE_Int *base_index, HYPRE_Int *base_stride ); +HYPRE_Int +HYPRE_StructCycRedSetBase( HYPRE_StructSolver solver, HYPRE_Int ndim, HYPRE_Int *base_index, HYPRE_Int *base_stride ); + +HYPRE_Int +HYPRE_StructCycRedSetTDim_flt( HYPRE_StructSolver solver, HYPRE_Int tdim ); +HYPRE_Int +HYPRE_StructCycRedSetTDim_dbl( HYPRE_StructSolver solver, HYPRE_Int tdim ); +HYPRE_Int +HYPRE_StructCycRedSetTDim_long_dbl( HYPRE_StructSolver solver, HYPRE_Int tdim ); +HYPRE_Int +HYPRE_StructCycRedSetTDim( HYPRE_StructSolver solver, HYPRE_Int tdim ); + +HYPRE_Int +HYPRE_StructCycRedSetup_flt( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructCycRedSetup_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructCycRedSetup_long_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructCycRedSetup( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructCycRedSolve_flt( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructCycRedSolve_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructCycRedSolve_long_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructCycRedSolve( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructDiagScale_flt( HYPRE_StructSolver solver, HYPRE_StructMatrix HA, HYPRE_StructVector Hy, HYPRE_StructVector Hx ); +HYPRE_Int +HYPRE_StructDiagScale_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix HA, HYPRE_StructVector Hy, HYPRE_StructVector Hx ); +HYPRE_Int +HYPRE_StructDiagScale_long_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix HA, HYPRE_StructVector Hy, HYPRE_StructVector Hx ); +HYPRE_Int +HYPRE_StructDiagScale( HYPRE_StructSolver solver, HYPRE_StructMatrix HA, HYPRE_StructVector Hy, HYPRE_StructVector Hx ); + +HYPRE_Int +HYPRE_StructDiagScaleSetup_flt( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector y, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructDiagScaleSetup_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector y, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructDiagScaleSetup_long_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector y, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructDiagScaleSetup( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector y, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructFlexGMRESCreate_flt( MPI_Comm comm, HYPRE_StructSolver *solver ); +HYPRE_Int +HYPRE_StructFlexGMRESCreate_dbl( MPI_Comm comm, HYPRE_StructSolver *solver ); +HYPRE_Int +HYPRE_StructFlexGMRESCreate_long_dbl( MPI_Comm comm, HYPRE_StructSolver *solver ); +HYPRE_Int +HYPRE_StructFlexGMRESCreate( MPI_Comm comm, HYPRE_StructSolver *solver ); + +HYPRE_Int +HYPRE_StructFlexGMRESDestroy_flt( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructFlexGMRESDestroy_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructFlexGMRESDestroy_long_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructFlexGMRESDestroy( HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructFlexGMRESGetFinalRelativeResidualNorm_flt( HYPRE_StructSolver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_StructFlexGMRESGetFinalRelativeResidualNorm_dbl( HYPRE_StructSolver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_StructFlexGMRESGetFinalRelativeResidualNorm_long_dbl( HYPRE_StructSolver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_StructFlexGMRESGetFinalRelativeResidualNorm( HYPRE_StructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_StructFlexGMRESGetNumIterations_flt( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_StructFlexGMRESGetNumIterations_dbl( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_StructFlexGMRESGetNumIterations_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_StructFlexGMRESGetNumIterations( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_StructFlexGMRESSetAbsoluteTol_flt( HYPRE_StructSolver solver, hypre_float tol ); +HYPRE_Int +HYPRE_StructFlexGMRESSetAbsoluteTol_dbl( HYPRE_StructSolver solver, hypre_double tol ); +HYPRE_Int +HYPRE_StructFlexGMRESSetAbsoluteTol_long_dbl( HYPRE_StructSolver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_StructFlexGMRESSetAbsoluteTol( HYPRE_StructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_StructFlexGMRESSetKDim_flt( HYPRE_StructSolver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_StructFlexGMRESSetKDim_dbl( HYPRE_StructSolver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_StructFlexGMRESSetKDim_long_dbl( HYPRE_StructSolver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_StructFlexGMRESSetKDim( HYPRE_StructSolver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_StructFlexGMRESSetLogging_flt( HYPRE_StructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_StructFlexGMRESSetLogging_dbl( HYPRE_StructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_StructFlexGMRESSetLogging_long_dbl( HYPRE_StructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_StructFlexGMRESSetLogging( HYPRE_StructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_StructFlexGMRESSetMaxIter_flt( HYPRE_StructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_StructFlexGMRESSetMaxIter_dbl( HYPRE_StructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_StructFlexGMRESSetMaxIter_long_dbl( HYPRE_StructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_StructFlexGMRESSetMaxIter( HYPRE_StructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_StructFlexGMRESSetModifyPC_flt( HYPRE_StructSolver solver, HYPRE_PtrToModifyPCFcn modify_pc ); +HYPRE_Int +HYPRE_StructFlexGMRESSetModifyPC_dbl( HYPRE_StructSolver solver, HYPRE_PtrToModifyPCFcn modify_pc ); +HYPRE_Int +HYPRE_StructFlexGMRESSetModifyPC_long_dbl( HYPRE_StructSolver solver, HYPRE_PtrToModifyPCFcn modify_pc ); +HYPRE_Int +HYPRE_StructFlexGMRESSetModifyPC( HYPRE_StructSolver solver, HYPRE_PtrToModifyPCFcn modify_pc ); + +HYPRE_Int +HYPRE_StructFlexGMRESSetPrecond_flt( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ); +HYPRE_Int +HYPRE_StructFlexGMRESSetPrecond_dbl( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ); +HYPRE_Int +HYPRE_StructFlexGMRESSetPrecond_long_dbl( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ); +HYPRE_Int +HYPRE_StructFlexGMRESSetPrecond( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ); + +HYPRE_Int +HYPRE_StructFlexGMRESSetPrintLevel_flt( HYPRE_StructSolver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_StructFlexGMRESSetPrintLevel_dbl( HYPRE_StructSolver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_StructFlexGMRESSetPrintLevel_long_dbl( HYPRE_StructSolver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_StructFlexGMRESSetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_StructFlexGMRESSetTol_flt( HYPRE_StructSolver solver, hypre_float tol ); +HYPRE_Int +HYPRE_StructFlexGMRESSetTol_dbl( HYPRE_StructSolver solver, hypre_double tol ); +HYPRE_Int +HYPRE_StructFlexGMRESSetTol_long_dbl( HYPRE_StructSolver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_StructFlexGMRESSetTol( HYPRE_StructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_StructFlexGMRESSetup_flt( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructFlexGMRESSetup_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructFlexGMRESSetup_long_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructFlexGMRESSetup( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructFlexGMRESSolve_flt( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructFlexGMRESSolve_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructFlexGMRESSolve_long_dbl( HYPRE_StructSolver solver, 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_Int +HYPRE_StructGMRESCreate_flt( MPI_Comm comm, HYPRE_StructSolver *solver ); +HYPRE_Int +HYPRE_StructGMRESCreate_dbl( MPI_Comm comm, HYPRE_StructSolver *solver ); +HYPRE_Int +HYPRE_StructGMRESCreate_long_dbl( MPI_Comm comm, HYPRE_StructSolver *solver ); +HYPRE_Int +HYPRE_StructGMRESCreate( MPI_Comm comm, HYPRE_StructSolver *solver ); + +HYPRE_Int +HYPRE_StructGMRESDestroy_flt( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructGMRESDestroy_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructGMRESDestroy_long_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructGMRESDestroy( HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructGMRESGetFinalRelativeResidualNorm_flt( HYPRE_StructSolver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_StructGMRESGetFinalRelativeResidualNorm_dbl( HYPRE_StructSolver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_StructGMRESGetFinalRelativeResidualNorm_long_dbl( HYPRE_StructSolver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_StructGMRESGetFinalRelativeResidualNorm( HYPRE_StructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_StructGMRESGetNumIterations_flt( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_StructGMRESGetNumIterations_dbl( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_StructGMRESGetNumIterations_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_StructGMRESGetNumIterations( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_StructGMRESSetAbsoluteTol_flt( HYPRE_StructSolver solver, hypre_float tol ); +HYPRE_Int +HYPRE_StructGMRESSetAbsoluteTol_dbl( HYPRE_StructSolver solver, hypre_double tol ); +HYPRE_Int +HYPRE_StructGMRESSetAbsoluteTol_long_dbl( HYPRE_StructSolver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_StructGMRESSetAbsoluteTol( HYPRE_StructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_StructGMRESSetKDim_flt( HYPRE_StructSolver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_StructGMRESSetKDim_dbl( HYPRE_StructSolver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_StructGMRESSetKDim_long_dbl( HYPRE_StructSolver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_StructGMRESSetKDim( HYPRE_StructSolver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_StructGMRESSetLogging_flt( HYPRE_StructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_StructGMRESSetLogging_dbl( HYPRE_StructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_StructGMRESSetLogging_long_dbl( HYPRE_StructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_StructGMRESSetLogging( HYPRE_StructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_StructGMRESSetMaxIter_flt( HYPRE_StructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_StructGMRESSetMaxIter_dbl( HYPRE_StructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_StructGMRESSetMaxIter_long_dbl( HYPRE_StructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_StructGMRESSetMaxIter( HYPRE_StructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_StructGMRESSetPrecond_flt( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ); +HYPRE_Int +HYPRE_StructGMRESSetPrecond_dbl( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ); +HYPRE_Int +HYPRE_StructGMRESSetPrecond_long_dbl( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ); +HYPRE_Int +HYPRE_StructGMRESSetPrecond( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ); + +HYPRE_Int +HYPRE_StructGMRESSetPrintLevel_flt( HYPRE_StructSolver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_StructGMRESSetPrintLevel_dbl( HYPRE_StructSolver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_StructGMRESSetPrintLevel_long_dbl( HYPRE_StructSolver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_StructGMRESSetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_StructGMRESSetTol_flt( HYPRE_StructSolver solver, hypre_float tol ); +HYPRE_Int +HYPRE_StructGMRESSetTol_dbl( HYPRE_StructSolver solver, hypre_double tol ); +HYPRE_Int +HYPRE_StructGMRESSetTol_long_dbl( HYPRE_StructSolver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_StructGMRESSetTol( HYPRE_StructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_StructGMRESSetup_flt( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructGMRESSetup_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructGMRESSetup_long_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructGMRESSetup( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructGMRESSolve_flt( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructGMRESSolve_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructGMRESSolve_long_dbl( HYPRE_StructSolver solver, 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_Int +HYPRE_StructHybridCreate_flt( MPI_Comm comm, HYPRE_StructSolver *solver ); +HYPRE_Int +HYPRE_StructHybridCreate_dbl( MPI_Comm comm, HYPRE_StructSolver *solver ); +HYPRE_Int +HYPRE_StructHybridCreate_long_dbl( MPI_Comm comm, HYPRE_StructSolver *solver ); +HYPRE_Int +HYPRE_StructHybridCreate( MPI_Comm comm, HYPRE_StructSolver *solver ); + +HYPRE_Int +HYPRE_StructHybridDestroy_flt( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructHybridDestroy_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructHybridDestroy_long_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructHybridDestroy( HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructHybridGetDSCGNumIterations_flt( HYPRE_StructSolver solver, HYPRE_Int *ds_num_its ); +HYPRE_Int +HYPRE_StructHybridGetDSCGNumIterations_dbl( HYPRE_StructSolver solver, HYPRE_Int *ds_num_its ); +HYPRE_Int +HYPRE_StructHybridGetDSCGNumIterations_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *ds_num_its ); +HYPRE_Int +HYPRE_StructHybridGetDSCGNumIterations( HYPRE_StructSolver solver, HYPRE_Int *ds_num_its ); + +HYPRE_Int +HYPRE_StructHybridGetFinalRelativeResidualNorm_flt( HYPRE_StructSolver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_StructHybridGetFinalRelativeResidualNorm_dbl( HYPRE_StructSolver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_StructHybridGetFinalRelativeResidualNorm_long_dbl( HYPRE_StructSolver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_StructHybridGetFinalRelativeResidualNorm( HYPRE_StructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_StructHybridGetNumIterations_flt( HYPRE_StructSolver solver, HYPRE_Int *num_its ); +HYPRE_Int +HYPRE_StructHybridGetNumIterations_dbl( HYPRE_StructSolver solver, HYPRE_Int *num_its ); +HYPRE_Int +HYPRE_StructHybridGetNumIterations_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *num_its ); +HYPRE_Int +HYPRE_StructHybridGetNumIterations( HYPRE_StructSolver solver, HYPRE_Int *num_its ); + +HYPRE_Int +HYPRE_StructHybridGetPCGNumIterations_flt( HYPRE_StructSolver solver, HYPRE_Int *pre_num_its ); +HYPRE_Int +HYPRE_StructHybridGetPCGNumIterations_dbl( HYPRE_StructSolver solver, HYPRE_Int *pre_num_its ); +HYPRE_Int +HYPRE_StructHybridGetPCGNumIterations_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *pre_num_its ); +HYPRE_Int +HYPRE_StructHybridGetPCGNumIterations( HYPRE_StructSolver solver, HYPRE_Int *pre_num_its ); + +HYPRE_Int +HYPRE_StructHybridGetRecomputeResidual_flt( HYPRE_StructSolver solver, HYPRE_Int *recompute_residual ); +HYPRE_Int +HYPRE_StructHybridGetRecomputeResidual_dbl( HYPRE_StructSolver solver, HYPRE_Int *recompute_residual ); +HYPRE_Int +HYPRE_StructHybridGetRecomputeResidual_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *recompute_residual ); +HYPRE_Int +HYPRE_StructHybridGetRecomputeResidual( HYPRE_StructSolver solver, HYPRE_Int *recompute_residual ); + +HYPRE_Int +HYPRE_StructHybridGetRecomputeResidualP_flt( HYPRE_StructSolver solver, HYPRE_Int *recompute_residual_p ); +HYPRE_Int +HYPRE_StructHybridGetRecomputeResidualP_dbl( HYPRE_StructSolver solver, HYPRE_Int *recompute_residual_p ); +HYPRE_Int +HYPRE_StructHybridGetRecomputeResidualP_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *recompute_residual_p ); +HYPRE_Int +HYPRE_StructHybridGetRecomputeResidualP( HYPRE_StructSolver solver, HYPRE_Int *recompute_residual_p ); + +HYPRE_Int +HYPRE_StructHybridSetConvergenceTol_flt( HYPRE_StructSolver solver, hypre_float cf_tol ); +HYPRE_Int +HYPRE_StructHybridSetConvergenceTol_dbl( HYPRE_StructSolver solver, hypre_double cf_tol ); +HYPRE_Int +HYPRE_StructHybridSetConvergenceTol_long_dbl( HYPRE_StructSolver solver, hypre_long_double cf_tol ); +HYPRE_Int +HYPRE_StructHybridSetConvergenceTol( HYPRE_StructSolver solver, hypre_long_double cf_tol ); + +HYPRE_Int +HYPRE_StructHybridSetDSCGMaxIter_flt( HYPRE_StructSolver solver, HYPRE_Int ds_max_its ); +HYPRE_Int +HYPRE_StructHybridSetDSCGMaxIter_dbl( HYPRE_StructSolver solver, HYPRE_Int ds_max_its ); +HYPRE_Int +HYPRE_StructHybridSetDSCGMaxIter_long_dbl( HYPRE_StructSolver solver, HYPRE_Int ds_max_its ); +HYPRE_Int +HYPRE_StructHybridSetDSCGMaxIter( HYPRE_StructSolver solver, HYPRE_Int ds_max_its ); + +HYPRE_Int +HYPRE_StructHybridSetKDim_flt( HYPRE_StructSolver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_StructHybridSetKDim_dbl( HYPRE_StructSolver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_StructHybridSetKDim_long_dbl( HYPRE_StructSolver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_StructHybridSetKDim( HYPRE_StructSolver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_StructHybridSetLogging_flt( HYPRE_StructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_StructHybridSetLogging_dbl( HYPRE_StructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_StructHybridSetLogging_long_dbl( HYPRE_StructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_StructHybridSetLogging( HYPRE_StructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_StructHybridSetPCGAbsoluteTolFactor_flt( HYPRE_StructSolver solver, hypre_float pcg_atolf ); +HYPRE_Int +HYPRE_StructHybridSetPCGAbsoluteTolFactor_dbl( HYPRE_StructSolver solver, hypre_double pcg_atolf ); +HYPRE_Int +HYPRE_StructHybridSetPCGAbsoluteTolFactor_long_dbl( HYPRE_StructSolver solver, hypre_long_double pcg_atolf ); +HYPRE_Int +HYPRE_StructHybridSetPCGAbsoluteTolFactor( HYPRE_StructSolver solver, hypre_long_double pcg_atolf ); + +HYPRE_Int +HYPRE_StructHybridSetPCGMaxIter_flt( HYPRE_StructSolver solver, HYPRE_Int pre_max_its ); +HYPRE_Int +HYPRE_StructHybridSetPCGMaxIter_dbl( HYPRE_StructSolver solver, HYPRE_Int pre_max_its ); +HYPRE_Int +HYPRE_StructHybridSetPCGMaxIter_long_dbl( HYPRE_StructSolver solver, HYPRE_Int pre_max_its ); +HYPRE_Int +HYPRE_StructHybridSetPCGMaxIter( HYPRE_StructSolver solver, HYPRE_Int pre_max_its ); + +HYPRE_Int +HYPRE_StructHybridSetPrecond_flt( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ); +HYPRE_Int +HYPRE_StructHybridSetPrecond_dbl( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ); +HYPRE_Int +HYPRE_StructHybridSetPrecond_long_dbl( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ); +HYPRE_Int +HYPRE_StructHybridSetPrecond( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ); + +HYPRE_Int +HYPRE_StructHybridSetPrintLevel_flt( HYPRE_StructSolver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_StructHybridSetPrintLevel_dbl( HYPRE_StructSolver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_StructHybridSetPrintLevel_long_dbl( HYPRE_StructSolver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_StructHybridSetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_StructHybridSetRecomputeResidual_flt( HYPRE_StructSolver solver, HYPRE_Int recompute_residual ); +HYPRE_Int +HYPRE_StructHybridSetRecomputeResidual_dbl( HYPRE_StructSolver solver, HYPRE_Int recompute_residual ); +HYPRE_Int +HYPRE_StructHybridSetRecomputeResidual_long_dbl( HYPRE_StructSolver solver, HYPRE_Int recompute_residual ); +HYPRE_Int +HYPRE_StructHybridSetRecomputeResidual( HYPRE_StructSolver solver, HYPRE_Int recompute_residual ); + +HYPRE_Int +HYPRE_StructHybridSetRecomputeResidualP_flt( HYPRE_StructSolver solver, HYPRE_Int recompute_residual_p ); +HYPRE_Int +HYPRE_StructHybridSetRecomputeResidualP_dbl( HYPRE_StructSolver solver, HYPRE_Int recompute_residual_p ); +HYPRE_Int +HYPRE_StructHybridSetRecomputeResidualP_long_dbl( HYPRE_StructSolver solver, HYPRE_Int recompute_residual_p ); +HYPRE_Int +HYPRE_StructHybridSetRecomputeResidualP( HYPRE_StructSolver solver, HYPRE_Int recompute_residual_p ); + +HYPRE_Int +HYPRE_StructHybridSetRelChange_flt( HYPRE_StructSolver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_StructHybridSetRelChange_dbl( HYPRE_StructSolver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_StructHybridSetRelChange_long_dbl( HYPRE_StructSolver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_StructHybridSetRelChange( HYPRE_StructSolver solver, HYPRE_Int rel_change ); + +HYPRE_Int +HYPRE_StructHybridSetSolverType_flt( HYPRE_StructSolver solver, HYPRE_Int solver_type ); +HYPRE_Int +HYPRE_StructHybridSetSolverType_dbl( HYPRE_StructSolver solver, HYPRE_Int solver_type ); +HYPRE_Int +HYPRE_StructHybridSetSolverType_long_dbl( HYPRE_StructSolver solver, HYPRE_Int solver_type ); +HYPRE_Int +HYPRE_StructHybridSetSolverType( HYPRE_StructSolver solver, HYPRE_Int solver_type ); + +HYPRE_Int +HYPRE_StructHybridSetStopCrit_flt( HYPRE_StructSolver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_StructHybridSetStopCrit_dbl( HYPRE_StructSolver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_StructHybridSetStopCrit_long_dbl( HYPRE_StructSolver solver, HYPRE_Int stop_crit ); +HYPRE_Int +HYPRE_StructHybridSetStopCrit( HYPRE_StructSolver solver, HYPRE_Int stop_crit ); + +HYPRE_Int +HYPRE_StructHybridSetTol_flt( HYPRE_StructSolver solver, hypre_float tol ); +HYPRE_Int +HYPRE_StructHybridSetTol_dbl( HYPRE_StructSolver solver, hypre_double tol ); +HYPRE_Int +HYPRE_StructHybridSetTol_long_dbl( HYPRE_StructSolver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_StructHybridSetTol( HYPRE_StructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_StructHybridSetTwoNorm_flt( HYPRE_StructSolver solver, HYPRE_Int two_norm ); +HYPRE_Int +HYPRE_StructHybridSetTwoNorm_dbl( HYPRE_StructSolver solver, HYPRE_Int two_norm ); +HYPRE_Int +HYPRE_StructHybridSetTwoNorm_long_dbl( HYPRE_StructSolver solver, HYPRE_Int two_norm ); +HYPRE_Int +HYPRE_StructHybridSetTwoNorm( HYPRE_StructSolver solver, HYPRE_Int two_norm ); + +HYPRE_Int +HYPRE_StructHybridSetup_flt( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructHybridSetup_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructHybridSetup_long_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructHybridSetup( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructHybridSolve_flt( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructHybridSolve_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructHybridSolve_long_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructHybridSolve( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructJacobiCreate_flt( MPI_Comm comm, HYPRE_StructSolver *solver ); +HYPRE_Int +HYPRE_StructJacobiCreate_dbl( MPI_Comm comm, HYPRE_StructSolver *solver ); +HYPRE_Int +HYPRE_StructJacobiCreate_long_dbl( MPI_Comm comm, HYPRE_StructSolver *solver ); +HYPRE_Int +HYPRE_StructJacobiCreate( MPI_Comm comm, HYPRE_StructSolver *solver ); + +HYPRE_Int +HYPRE_StructJacobiDestroy_flt( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructJacobiDestroy_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructJacobiDestroy_long_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructJacobiDestroy( HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructJacobiGetFinalRelativeResidualNorm_flt( HYPRE_StructSolver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_StructJacobiGetFinalRelativeResidualNorm_dbl( HYPRE_StructSolver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_StructJacobiGetFinalRelativeResidualNorm_long_dbl( HYPRE_StructSolver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_StructJacobiGetFinalRelativeResidualNorm( HYPRE_StructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_StructJacobiGetMaxIter_flt( HYPRE_StructSolver solver, HYPRE_Int *max_iter ); +HYPRE_Int +HYPRE_StructJacobiGetMaxIter_dbl( HYPRE_StructSolver solver, HYPRE_Int *max_iter ); +HYPRE_Int +HYPRE_StructJacobiGetMaxIter_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *max_iter ); +HYPRE_Int +HYPRE_StructJacobiGetMaxIter( HYPRE_StructSolver solver, HYPRE_Int *max_iter ); + +HYPRE_Int +HYPRE_StructJacobiGetNumIterations_flt( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_StructJacobiGetNumIterations_dbl( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_StructJacobiGetNumIterations_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_StructJacobiGetNumIterations( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_StructJacobiGetTol_flt( HYPRE_StructSolver solver, hypre_float *tol ); +HYPRE_Int +HYPRE_StructJacobiGetTol_dbl( HYPRE_StructSolver solver, hypre_double *tol ); +HYPRE_Int +HYPRE_StructJacobiGetTol_long_dbl( HYPRE_StructSolver solver, hypre_long_double *tol ); +HYPRE_Int +HYPRE_StructJacobiGetTol( HYPRE_StructSolver solver, void *tol ); + +HYPRE_Int +HYPRE_StructJacobiGetZeroGuess_flt( HYPRE_StructSolver solver, HYPRE_Int *zeroguess ); +HYPRE_Int +HYPRE_StructJacobiGetZeroGuess_dbl( HYPRE_StructSolver solver, HYPRE_Int *zeroguess ); +HYPRE_Int +HYPRE_StructJacobiGetZeroGuess_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *zeroguess ); +HYPRE_Int +HYPRE_StructJacobiGetZeroGuess( HYPRE_StructSolver solver, HYPRE_Int *zeroguess ); + +HYPRE_Int +HYPRE_StructJacobiSetMaxIter_flt( HYPRE_StructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_StructJacobiSetMaxIter_dbl( HYPRE_StructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_StructJacobiSetMaxIter_long_dbl( HYPRE_StructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_StructJacobiSetMaxIter( HYPRE_StructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_StructJacobiSetNonZeroGuess_flt( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructJacobiSetNonZeroGuess_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructJacobiSetNonZeroGuess_long_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructJacobiSetNonZeroGuess( HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructJacobiSetTol_flt( HYPRE_StructSolver solver, hypre_float tol ); +HYPRE_Int +HYPRE_StructJacobiSetTol_dbl( HYPRE_StructSolver solver, hypre_double tol ); +HYPRE_Int +HYPRE_StructJacobiSetTol_long_dbl( HYPRE_StructSolver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_StructJacobiSetTol( HYPRE_StructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_StructJacobiSetZeroGuess_flt( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructJacobiSetZeroGuess_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructJacobiSetZeroGuess_long_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructJacobiSetZeroGuess( HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructJacobiSetup_flt( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructJacobiSetup_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructJacobiSetup_long_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructJacobiSetup( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructJacobiSolve_flt( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructJacobiSolve_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructJacobiSolve_long_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructJacobiSolve( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructLGMRESCreate_flt( MPI_Comm comm, HYPRE_StructSolver *solver ); +HYPRE_Int +HYPRE_StructLGMRESCreate_dbl( MPI_Comm comm, HYPRE_StructSolver *solver ); +HYPRE_Int +HYPRE_StructLGMRESCreate_long_dbl( MPI_Comm comm, HYPRE_StructSolver *solver ); +HYPRE_Int +HYPRE_StructLGMRESCreate( MPI_Comm comm, HYPRE_StructSolver *solver ); + +HYPRE_Int +HYPRE_StructLGMRESDestroy_flt( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructLGMRESDestroy_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructLGMRESDestroy_long_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructLGMRESDestroy( HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructLGMRESGetFinalRelativeResidualNorm_flt( HYPRE_StructSolver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_StructLGMRESGetFinalRelativeResidualNorm_dbl( HYPRE_StructSolver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_StructLGMRESGetFinalRelativeResidualNorm_long_dbl( HYPRE_StructSolver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_StructLGMRESGetFinalRelativeResidualNorm( HYPRE_StructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_StructLGMRESGetNumIterations_flt( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_StructLGMRESGetNumIterations_dbl( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_StructLGMRESGetNumIterations_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_StructLGMRESGetNumIterations( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_StructLGMRESSetAbsoluteTol_flt( HYPRE_StructSolver solver, hypre_float tol ); +HYPRE_Int +HYPRE_StructLGMRESSetAbsoluteTol_dbl( HYPRE_StructSolver solver, hypre_double tol ); +HYPRE_Int +HYPRE_StructLGMRESSetAbsoluteTol_long_dbl( HYPRE_StructSolver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_StructLGMRESSetAbsoluteTol( HYPRE_StructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_StructLGMRESSetAugDim_flt( HYPRE_StructSolver solver, HYPRE_Int aug_dim ); +HYPRE_Int +HYPRE_StructLGMRESSetAugDim_dbl( HYPRE_StructSolver solver, HYPRE_Int aug_dim ); +HYPRE_Int +HYPRE_StructLGMRESSetAugDim_long_dbl( HYPRE_StructSolver solver, HYPRE_Int aug_dim ); +HYPRE_Int +HYPRE_StructLGMRESSetAugDim( HYPRE_StructSolver solver, HYPRE_Int aug_dim ); + +HYPRE_Int +HYPRE_StructLGMRESSetKDim_flt( HYPRE_StructSolver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_StructLGMRESSetKDim_dbl( HYPRE_StructSolver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_StructLGMRESSetKDim_long_dbl( HYPRE_StructSolver solver, HYPRE_Int k_dim ); +HYPRE_Int +HYPRE_StructLGMRESSetKDim( HYPRE_StructSolver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_StructLGMRESSetLogging_flt( HYPRE_StructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_StructLGMRESSetLogging_dbl( HYPRE_StructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_StructLGMRESSetLogging_long_dbl( HYPRE_StructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_StructLGMRESSetLogging( HYPRE_StructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_StructLGMRESSetMaxIter_flt( HYPRE_StructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_StructLGMRESSetMaxIter_dbl( HYPRE_StructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_StructLGMRESSetMaxIter_long_dbl( HYPRE_StructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_StructLGMRESSetMaxIter( HYPRE_StructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_StructLGMRESSetPrecond_flt( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ); +HYPRE_Int +HYPRE_StructLGMRESSetPrecond_dbl( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ); +HYPRE_Int +HYPRE_StructLGMRESSetPrecond_long_dbl( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ); +HYPRE_Int +HYPRE_StructLGMRESSetPrecond( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ); + +HYPRE_Int +HYPRE_StructLGMRESSetPrintLevel_flt( HYPRE_StructSolver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_StructLGMRESSetPrintLevel_dbl( HYPRE_StructSolver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_StructLGMRESSetPrintLevel_long_dbl( HYPRE_StructSolver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_StructLGMRESSetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_StructLGMRESSetTol_flt( HYPRE_StructSolver solver, hypre_float tol ); +HYPRE_Int +HYPRE_StructLGMRESSetTol_dbl( HYPRE_StructSolver solver, hypre_double tol ); +HYPRE_Int +HYPRE_StructLGMRESSetTol_long_dbl( HYPRE_StructSolver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_StructLGMRESSetTol( HYPRE_StructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_StructLGMRESSetup_flt( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructLGMRESSetup_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructLGMRESSetup_long_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructLGMRESSetup( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructLGMRESSolve_flt( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructLGMRESSolve_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructLGMRESSolve_long_dbl( HYPRE_StructSolver solver, 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_Int +HYPRE_StructPCGCreate_flt( MPI_Comm comm, HYPRE_StructSolver *solver ); +HYPRE_Int +HYPRE_StructPCGCreate_dbl( MPI_Comm comm, HYPRE_StructSolver *solver ); +HYPRE_Int +HYPRE_StructPCGCreate_long_dbl( MPI_Comm comm, HYPRE_StructSolver *solver ); +HYPRE_Int +HYPRE_StructPCGCreate( MPI_Comm comm, HYPRE_StructSolver *solver ); + +HYPRE_Int +HYPRE_StructPCGDestroy_flt( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructPCGDestroy_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructPCGDestroy_long_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructPCGDestroy( HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructPCGGetFinalRelativeResidualNorm_flt( HYPRE_StructSolver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_StructPCGGetFinalRelativeResidualNorm_dbl( HYPRE_StructSolver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_StructPCGGetFinalRelativeResidualNorm_long_dbl( HYPRE_StructSolver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_StructPCGGetFinalRelativeResidualNorm( HYPRE_StructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_StructPCGGetNumIterations_flt( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_StructPCGGetNumIterations_dbl( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_StructPCGGetNumIterations_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_StructPCGGetNumIterations( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_StructPCGSetAbsoluteTol_flt( HYPRE_StructSolver solver, hypre_float tol ); +HYPRE_Int +HYPRE_StructPCGSetAbsoluteTol_dbl( HYPRE_StructSolver solver, hypre_double tol ); +HYPRE_Int +HYPRE_StructPCGSetAbsoluteTol_long_dbl( HYPRE_StructSolver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_StructPCGSetAbsoluteTol( HYPRE_StructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_StructPCGSetLogging_flt( HYPRE_StructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_StructPCGSetLogging_dbl( HYPRE_StructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_StructPCGSetLogging_long_dbl( HYPRE_StructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_StructPCGSetLogging( HYPRE_StructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_StructPCGSetMaxIter_flt( HYPRE_StructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_StructPCGSetMaxIter_dbl( HYPRE_StructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_StructPCGSetMaxIter_long_dbl( HYPRE_StructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_StructPCGSetMaxIter( HYPRE_StructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_StructPCGSetPrecond_flt( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ); +HYPRE_Int +HYPRE_StructPCGSetPrecond_dbl( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ); +HYPRE_Int +HYPRE_StructPCGSetPrecond_long_dbl( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ); +HYPRE_Int +HYPRE_StructPCGSetPrecond( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ); + +HYPRE_Int +HYPRE_StructPCGSetPrintLevel_flt( HYPRE_StructSolver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_StructPCGSetPrintLevel_dbl( HYPRE_StructSolver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_StructPCGSetPrintLevel_long_dbl( HYPRE_StructSolver solver, HYPRE_Int level ); +HYPRE_Int +HYPRE_StructPCGSetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_StructPCGSetRelChange_flt( HYPRE_StructSolver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_StructPCGSetRelChange_dbl( HYPRE_StructSolver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_StructPCGSetRelChange_long_dbl( HYPRE_StructSolver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_StructPCGSetRelChange( HYPRE_StructSolver solver, HYPRE_Int rel_change ); + +HYPRE_Int +HYPRE_StructPCGSetTol_flt( HYPRE_StructSolver solver, hypre_float tol ); +HYPRE_Int +HYPRE_StructPCGSetTol_dbl( HYPRE_StructSolver solver, hypre_double tol ); +HYPRE_Int +HYPRE_StructPCGSetTol_long_dbl( HYPRE_StructSolver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_StructPCGSetTol( HYPRE_StructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_StructPCGSetTwoNorm_flt( HYPRE_StructSolver solver, HYPRE_Int two_norm ); +HYPRE_Int +HYPRE_StructPCGSetTwoNorm_dbl( HYPRE_StructSolver solver, HYPRE_Int two_norm ); +HYPRE_Int +HYPRE_StructPCGSetTwoNorm_long_dbl( HYPRE_StructSolver solver, HYPRE_Int two_norm ); +HYPRE_Int +HYPRE_StructPCGSetTwoNorm( HYPRE_StructSolver solver, HYPRE_Int two_norm ); + +HYPRE_Int +HYPRE_StructPCGSetup_flt( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructPCGSetup_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructPCGSetup_long_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructPCGSetup( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructPCGSolve_flt( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructPCGSolve_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructPCGSolve_long_dbl( HYPRE_StructSolver solver, 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_Int +HYPRE_StructPFMGCreate_flt( MPI_Comm comm, HYPRE_StructSolver *solver ); +HYPRE_Int +HYPRE_StructPFMGCreate_dbl( MPI_Comm comm, HYPRE_StructSolver *solver ); +HYPRE_Int +HYPRE_StructPFMGCreate_long_dbl( MPI_Comm comm, HYPRE_StructSolver *solver ); +HYPRE_Int +HYPRE_StructPFMGCreate( MPI_Comm comm, HYPRE_StructSolver *solver ); + +HYPRE_Int +HYPRE_StructPFMGDestroy_flt( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructPFMGDestroy_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructPFMGDestroy_long_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructPFMGDestroy( HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructPFMGGetFinalRelativeResidualNorm_flt( HYPRE_StructSolver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_StructPFMGGetFinalRelativeResidualNorm_dbl( HYPRE_StructSolver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_StructPFMGGetFinalRelativeResidualNorm_long_dbl( HYPRE_StructSolver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_StructPFMGGetFinalRelativeResidualNorm( HYPRE_StructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_StructPFMGGetJacobiWeight_flt( HYPRE_StructSolver solver, hypre_float *weight ); +HYPRE_Int +HYPRE_StructPFMGGetJacobiWeight_dbl( HYPRE_StructSolver solver, hypre_double *weight ); +HYPRE_Int +HYPRE_StructPFMGGetJacobiWeight_long_dbl( HYPRE_StructSolver solver, hypre_long_double *weight ); +HYPRE_Int +HYPRE_StructPFMGGetJacobiWeight( HYPRE_StructSolver solver, void *weight ); + +HYPRE_Int +HYPRE_StructPFMGGetLogging_flt( HYPRE_StructSolver solver, HYPRE_Int *logging ); +HYPRE_Int +HYPRE_StructPFMGGetLogging_dbl( HYPRE_StructSolver solver, HYPRE_Int *logging ); +HYPRE_Int +HYPRE_StructPFMGGetLogging_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *logging ); +HYPRE_Int +HYPRE_StructPFMGGetLogging( HYPRE_StructSolver solver, HYPRE_Int *logging ); + +HYPRE_Int +HYPRE_StructPFMGGetMatmultType_flt( HYPRE_StructSolver solver, HYPRE_Int *matmult_type ); +HYPRE_Int +HYPRE_StructPFMGGetMatmultType_dbl( HYPRE_StructSolver solver, HYPRE_Int *matmult_type ); +HYPRE_Int +HYPRE_StructPFMGGetMatmultType_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *matmult_type ); +HYPRE_Int +HYPRE_StructPFMGGetMatmultType( HYPRE_StructSolver solver, HYPRE_Int *matmult_type ); + +HYPRE_Int +HYPRE_StructPFMGGetMaxIter_flt( HYPRE_StructSolver solver, HYPRE_Int *max_iter ); +HYPRE_Int +HYPRE_StructPFMGGetMaxIter_dbl( HYPRE_StructSolver solver, HYPRE_Int *max_iter ); +HYPRE_Int +HYPRE_StructPFMGGetMaxIter_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *max_iter ); +HYPRE_Int +HYPRE_StructPFMGGetMaxIter( HYPRE_StructSolver solver, HYPRE_Int *max_iter ); + +HYPRE_Int +HYPRE_StructPFMGGetMaxLevels_flt( HYPRE_StructSolver solver, HYPRE_Int *max_levels ); +HYPRE_Int +HYPRE_StructPFMGGetMaxLevels_dbl( HYPRE_StructSolver solver, HYPRE_Int *max_levels ); +HYPRE_Int +HYPRE_StructPFMGGetMaxLevels_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *max_levels ); +HYPRE_Int +HYPRE_StructPFMGGetMaxLevels( HYPRE_StructSolver solver, HYPRE_Int *max_levels ); + +HYPRE_Int +HYPRE_StructPFMGGetNumIterations_flt( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_StructPFMGGetNumIterations_dbl( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_StructPFMGGetNumIterations_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_StructPFMGGetNumIterations( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_StructPFMGGetNumPostRelax_flt( HYPRE_StructSolver solver, HYPRE_Int *num_post_relax ); +HYPRE_Int +HYPRE_StructPFMGGetNumPostRelax_dbl( HYPRE_StructSolver solver, HYPRE_Int *num_post_relax ); +HYPRE_Int +HYPRE_StructPFMGGetNumPostRelax_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *num_post_relax ); +HYPRE_Int +HYPRE_StructPFMGGetNumPostRelax( HYPRE_StructSolver solver, HYPRE_Int *num_post_relax ); + +HYPRE_Int +HYPRE_StructPFMGGetNumPreRelax_flt( HYPRE_StructSolver solver, HYPRE_Int *num_pre_relax ); +HYPRE_Int +HYPRE_StructPFMGGetNumPreRelax_dbl( HYPRE_StructSolver solver, HYPRE_Int *num_pre_relax ); +HYPRE_Int +HYPRE_StructPFMGGetNumPreRelax_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *num_pre_relax ); +HYPRE_Int +HYPRE_StructPFMGGetNumPreRelax( HYPRE_StructSolver solver, HYPRE_Int *num_pre_relax ); + +HYPRE_Int +HYPRE_StructPFMGGetPrintLevel_flt( HYPRE_StructSolver solver, HYPRE_Int *print_level ); +HYPRE_Int +HYPRE_StructPFMGGetPrintLevel_dbl( HYPRE_StructSolver solver, HYPRE_Int *print_level ); +HYPRE_Int +HYPRE_StructPFMGGetPrintLevel_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *print_level ); +HYPRE_Int +HYPRE_StructPFMGGetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int *print_level ); + +HYPRE_Int +HYPRE_StructPFMGGetRAPType_flt( HYPRE_StructSolver solver, HYPRE_Int *rap_type ); +HYPRE_Int +HYPRE_StructPFMGGetRAPType_dbl( HYPRE_StructSolver solver, HYPRE_Int *rap_type ); +HYPRE_Int +HYPRE_StructPFMGGetRAPType_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *rap_type ); +HYPRE_Int +HYPRE_StructPFMGGetRAPType( HYPRE_StructSolver solver, HYPRE_Int *rap_type ); + +HYPRE_Int +HYPRE_StructPFMGGetRelChange_flt( HYPRE_StructSolver solver, HYPRE_Int *rel_change ); +HYPRE_Int +HYPRE_StructPFMGGetRelChange_dbl( HYPRE_StructSolver solver, HYPRE_Int *rel_change ); +HYPRE_Int +HYPRE_StructPFMGGetRelChange_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *rel_change ); +HYPRE_Int +HYPRE_StructPFMGGetRelChange( HYPRE_StructSolver solver, HYPRE_Int *rel_change ); + +HYPRE_Int +HYPRE_StructPFMGGetRelaxType_flt( HYPRE_StructSolver solver, HYPRE_Int *relax_type ); +HYPRE_Int +HYPRE_StructPFMGGetRelaxType_dbl( HYPRE_StructSolver solver, HYPRE_Int *relax_type ); +HYPRE_Int +HYPRE_StructPFMGGetRelaxType_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *relax_type ); +HYPRE_Int +HYPRE_StructPFMGGetRelaxType( HYPRE_StructSolver solver, HYPRE_Int *relax_type ); + +HYPRE_Int +HYPRE_StructPFMGGetSkipRelax_flt( HYPRE_StructSolver solver, HYPRE_Int *skip_relax ); +HYPRE_Int +HYPRE_StructPFMGGetSkipRelax_dbl( HYPRE_StructSolver solver, HYPRE_Int *skip_relax ); +HYPRE_Int +HYPRE_StructPFMGGetSkipRelax_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *skip_relax ); +HYPRE_Int +HYPRE_StructPFMGGetSkipRelax( HYPRE_StructSolver solver, HYPRE_Int *skip_relax ); + +HYPRE_Int +HYPRE_StructPFMGGetTol_flt( HYPRE_StructSolver solver, hypre_float *tol ); +HYPRE_Int +HYPRE_StructPFMGGetTol_dbl( HYPRE_StructSolver solver, hypre_double *tol ); +HYPRE_Int +HYPRE_StructPFMGGetTol_long_dbl( HYPRE_StructSolver solver, hypre_long_double *tol ); +HYPRE_Int +HYPRE_StructPFMGGetTol( HYPRE_StructSolver solver, void *tol ); + +HYPRE_Int +HYPRE_StructPFMGGetZeroGuess_flt( HYPRE_StructSolver solver, HYPRE_Int *zeroguess ); +HYPRE_Int +HYPRE_StructPFMGGetZeroGuess_dbl( HYPRE_StructSolver solver, HYPRE_Int *zeroguess ); +HYPRE_Int +HYPRE_StructPFMGGetZeroGuess_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *zeroguess ); +HYPRE_Int +HYPRE_StructPFMGGetZeroGuess( HYPRE_StructSolver solver, HYPRE_Int *zeroguess ); + +HYPRE_Int +HYPRE_StructPFMGSetDxyz_flt( HYPRE_StructSolver solver, hypre_float *dxyz ); +HYPRE_Int +HYPRE_StructPFMGSetDxyz_dbl( HYPRE_StructSolver solver, hypre_double *dxyz ); +HYPRE_Int +HYPRE_StructPFMGSetDxyz_long_dbl( HYPRE_StructSolver solver, hypre_long_double *dxyz ); +HYPRE_Int +HYPRE_StructPFMGSetDxyz( HYPRE_StructSolver solver, void *dxyz ); + +HYPRE_Int +HYPRE_StructPFMGSetJacobiWeight_flt( HYPRE_StructSolver solver, hypre_float weight ); +HYPRE_Int +HYPRE_StructPFMGSetJacobiWeight_dbl( HYPRE_StructSolver solver, hypre_double weight ); +HYPRE_Int +HYPRE_StructPFMGSetJacobiWeight_long_dbl( HYPRE_StructSolver solver, hypre_long_double weight ); +HYPRE_Int +HYPRE_StructPFMGSetJacobiWeight( HYPRE_StructSolver solver, hypre_long_double weight ); + +HYPRE_Int +HYPRE_StructPFMGSetLogging_flt( HYPRE_StructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_StructPFMGSetLogging_dbl( HYPRE_StructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_StructPFMGSetLogging_long_dbl( HYPRE_StructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_StructPFMGSetLogging( HYPRE_StructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_StructPFMGSetMatmultType_flt( HYPRE_StructSolver solver, HYPRE_Int matmult_type ); +HYPRE_Int +HYPRE_StructPFMGSetMatmultType_dbl( HYPRE_StructSolver solver, HYPRE_Int matmult_type ); +HYPRE_Int +HYPRE_StructPFMGSetMatmultType_long_dbl( HYPRE_StructSolver solver, HYPRE_Int matmult_type ); +HYPRE_Int +HYPRE_StructPFMGSetMatmultType( HYPRE_StructSolver solver, HYPRE_Int matmult_type ); + +HYPRE_Int +HYPRE_StructPFMGSetMaxIter_flt( HYPRE_StructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_StructPFMGSetMaxIter_dbl( HYPRE_StructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_StructPFMGSetMaxIter_long_dbl( HYPRE_StructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_StructPFMGSetMaxIter( HYPRE_StructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_StructPFMGSetMaxLevels_flt( HYPRE_StructSolver solver, HYPRE_Int max_levels ); +HYPRE_Int +HYPRE_StructPFMGSetMaxLevels_dbl( HYPRE_StructSolver solver, HYPRE_Int max_levels ); +HYPRE_Int +HYPRE_StructPFMGSetMaxLevels_long_dbl( HYPRE_StructSolver solver, HYPRE_Int max_levels ); +HYPRE_Int +HYPRE_StructPFMGSetMaxLevels( HYPRE_StructSolver solver, HYPRE_Int max_levels ); + +HYPRE_Int +HYPRE_StructPFMGSetNonZeroGuess_flt( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructPFMGSetNonZeroGuess_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructPFMGSetNonZeroGuess_long_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructPFMGSetNonZeroGuess( HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructPFMGSetNumPostRelax_flt( HYPRE_StructSolver solver, HYPRE_Int num_post_relax ); +HYPRE_Int +HYPRE_StructPFMGSetNumPostRelax_dbl( HYPRE_StructSolver solver, HYPRE_Int num_post_relax ); +HYPRE_Int +HYPRE_StructPFMGSetNumPostRelax_long_dbl( HYPRE_StructSolver solver, HYPRE_Int num_post_relax ); +HYPRE_Int +HYPRE_StructPFMGSetNumPostRelax( HYPRE_StructSolver solver, HYPRE_Int num_post_relax ); + +HYPRE_Int +HYPRE_StructPFMGSetNumPreRelax_flt( HYPRE_StructSolver solver, HYPRE_Int num_pre_relax ); +HYPRE_Int +HYPRE_StructPFMGSetNumPreRelax_dbl( HYPRE_StructSolver solver, HYPRE_Int num_pre_relax ); +HYPRE_Int +HYPRE_StructPFMGSetNumPreRelax_long_dbl( HYPRE_StructSolver solver, HYPRE_Int num_pre_relax ); +HYPRE_Int +HYPRE_StructPFMGSetNumPreRelax( HYPRE_StructSolver solver, HYPRE_Int num_pre_relax ); + +HYPRE_Int +HYPRE_StructPFMGSetPrintLevel_flt( HYPRE_StructSolver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_StructPFMGSetPrintLevel_dbl( HYPRE_StructSolver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_StructPFMGSetPrintLevel_long_dbl( HYPRE_StructSolver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_StructPFMGSetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_StructPFMGSetRAPType_flt( HYPRE_StructSolver solver, HYPRE_Int rap_type ); +HYPRE_Int +HYPRE_StructPFMGSetRAPType_dbl( HYPRE_StructSolver solver, HYPRE_Int rap_type ); +HYPRE_Int +HYPRE_StructPFMGSetRAPType_long_dbl( HYPRE_StructSolver solver, HYPRE_Int rap_type ); +HYPRE_Int +HYPRE_StructPFMGSetRAPType( HYPRE_StructSolver solver, HYPRE_Int rap_type ); + +HYPRE_Int +HYPRE_StructPFMGSetRelChange_flt( HYPRE_StructSolver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_StructPFMGSetRelChange_dbl( HYPRE_StructSolver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_StructPFMGSetRelChange_long_dbl( HYPRE_StructSolver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_StructPFMGSetRelChange( HYPRE_StructSolver solver, HYPRE_Int rel_change ); + +HYPRE_Int +HYPRE_StructPFMGSetRelaxType_flt( HYPRE_StructSolver solver, HYPRE_Int relax_type ); +HYPRE_Int +HYPRE_StructPFMGSetRelaxType_dbl( HYPRE_StructSolver solver, HYPRE_Int relax_type ); +HYPRE_Int +HYPRE_StructPFMGSetRelaxType_long_dbl( HYPRE_StructSolver solver, HYPRE_Int relax_type ); +HYPRE_Int +HYPRE_StructPFMGSetRelaxType( HYPRE_StructSolver solver, HYPRE_Int relax_type ); + +HYPRE_Int +HYPRE_StructPFMGSetSkipRelax_flt( HYPRE_StructSolver solver, HYPRE_Int skip_relax ); +HYPRE_Int +HYPRE_StructPFMGSetSkipRelax_dbl( HYPRE_StructSolver solver, HYPRE_Int skip_relax ); +HYPRE_Int +HYPRE_StructPFMGSetSkipRelax_long_dbl( HYPRE_StructSolver solver, HYPRE_Int skip_relax ); +HYPRE_Int +HYPRE_StructPFMGSetSkipRelax( HYPRE_StructSolver solver, HYPRE_Int skip_relax ); + +HYPRE_Int +HYPRE_StructPFMGSetTol_flt( HYPRE_StructSolver solver, hypre_float tol ); +HYPRE_Int +HYPRE_StructPFMGSetTol_dbl( HYPRE_StructSolver solver, hypre_double tol ); +HYPRE_Int +HYPRE_StructPFMGSetTol_long_dbl( HYPRE_StructSolver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_StructPFMGSetTol( HYPRE_StructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_StructPFMGSetZeroGuess_flt( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructPFMGSetZeroGuess_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructPFMGSetZeroGuess_long_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructPFMGSetZeroGuess( HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructPFMGSetup_flt( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructPFMGSetup_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructPFMGSetup_long_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructPFMGSetup( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructPFMGSolve_flt( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructPFMGSolve_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructPFMGSolve_long_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructPFMGSolve( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructSMGCreate_flt( MPI_Comm comm, HYPRE_StructSolver *solver ); +HYPRE_Int +HYPRE_StructSMGCreate_dbl( MPI_Comm comm, HYPRE_StructSolver *solver ); +HYPRE_Int +HYPRE_StructSMGCreate_long_dbl( MPI_Comm comm, HYPRE_StructSolver *solver ); +HYPRE_Int +HYPRE_StructSMGCreate( MPI_Comm comm, HYPRE_StructSolver *solver ); + +HYPRE_Int +HYPRE_StructSMGDestroy_flt( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructSMGDestroy_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructSMGDestroy_long_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructSMGDestroy( HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructSMGGetFinalRelativeResidualNorm_flt( HYPRE_StructSolver solver, hypre_float *norm ); +HYPRE_Int +HYPRE_StructSMGGetFinalRelativeResidualNorm_dbl( HYPRE_StructSolver solver, hypre_double *norm ); +HYPRE_Int +HYPRE_StructSMGGetFinalRelativeResidualNorm_long_dbl( HYPRE_StructSolver solver, hypre_long_double *norm ); +HYPRE_Int +HYPRE_StructSMGGetFinalRelativeResidualNorm( HYPRE_StructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_StructSMGGetLogging_flt( HYPRE_StructSolver solver, HYPRE_Int *logging ); +HYPRE_Int +HYPRE_StructSMGGetLogging_dbl( HYPRE_StructSolver solver, HYPRE_Int *logging ); +HYPRE_Int +HYPRE_StructSMGGetLogging_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *logging ); +HYPRE_Int +HYPRE_StructSMGGetLogging( HYPRE_StructSolver solver, HYPRE_Int *logging ); + +HYPRE_Int +HYPRE_StructSMGGetMaxIter_flt( HYPRE_StructSolver solver, HYPRE_Int *max_iter ); +HYPRE_Int +HYPRE_StructSMGGetMaxIter_dbl( HYPRE_StructSolver solver, HYPRE_Int *max_iter ); +HYPRE_Int +HYPRE_StructSMGGetMaxIter_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *max_iter ); +HYPRE_Int +HYPRE_StructSMGGetMaxIter( HYPRE_StructSolver solver, HYPRE_Int *max_iter ); + +HYPRE_Int +HYPRE_StructSMGGetMemoryUse_flt( HYPRE_StructSolver solver, HYPRE_Int *memory_use ); +HYPRE_Int +HYPRE_StructSMGGetMemoryUse_dbl( HYPRE_StructSolver solver, HYPRE_Int *memory_use ); +HYPRE_Int +HYPRE_StructSMGGetMemoryUse_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *memory_use ); +HYPRE_Int +HYPRE_StructSMGGetMemoryUse( HYPRE_StructSolver solver, HYPRE_Int *memory_use ); + +HYPRE_Int +HYPRE_StructSMGGetNumIterations_flt( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_StructSMGGetNumIterations_dbl( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_StructSMGGetNumIterations_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); +HYPRE_Int +HYPRE_StructSMGGetNumIterations( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_StructSMGGetNumPostRelax_flt( HYPRE_StructSolver solver, HYPRE_Int *num_post_relax ); +HYPRE_Int +HYPRE_StructSMGGetNumPostRelax_dbl( HYPRE_StructSolver solver, HYPRE_Int *num_post_relax ); +HYPRE_Int +HYPRE_StructSMGGetNumPostRelax_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *num_post_relax ); +HYPRE_Int +HYPRE_StructSMGGetNumPostRelax( HYPRE_StructSolver solver, HYPRE_Int *num_post_relax ); + +HYPRE_Int +HYPRE_StructSMGGetNumPreRelax_flt( HYPRE_StructSolver solver, HYPRE_Int *num_pre_relax ); +HYPRE_Int +HYPRE_StructSMGGetNumPreRelax_dbl( HYPRE_StructSolver solver, HYPRE_Int *num_pre_relax ); +HYPRE_Int +HYPRE_StructSMGGetNumPreRelax_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *num_pre_relax ); +HYPRE_Int +HYPRE_StructSMGGetNumPreRelax( HYPRE_StructSolver solver, HYPRE_Int *num_pre_relax ); + +HYPRE_Int +HYPRE_StructSMGGetPrintLevel_flt( HYPRE_StructSolver solver, HYPRE_Int *print_level ); +HYPRE_Int +HYPRE_StructSMGGetPrintLevel_dbl( HYPRE_StructSolver solver, HYPRE_Int *print_level ); +HYPRE_Int +HYPRE_StructSMGGetPrintLevel_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *print_level ); +HYPRE_Int +HYPRE_StructSMGGetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int *print_level ); + +HYPRE_Int +HYPRE_StructSMGGetRelChange_flt( HYPRE_StructSolver solver, HYPRE_Int *rel_change ); +HYPRE_Int +HYPRE_StructSMGGetRelChange_dbl( HYPRE_StructSolver solver, HYPRE_Int *rel_change ); +HYPRE_Int +HYPRE_StructSMGGetRelChange_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *rel_change ); +HYPRE_Int +HYPRE_StructSMGGetRelChange( HYPRE_StructSolver solver, HYPRE_Int *rel_change ); + +HYPRE_Int +HYPRE_StructSMGGetTol_flt( HYPRE_StructSolver solver, hypre_float *tol ); +HYPRE_Int +HYPRE_StructSMGGetTol_dbl( HYPRE_StructSolver solver, hypre_double *tol ); +HYPRE_Int +HYPRE_StructSMGGetTol_long_dbl( HYPRE_StructSolver solver, hypre_long_double *tol ); +HYPRE_Int +HYPRE_StructSMGGetTol( HYPRE_StructSolver solver, void *tol ); + +HYPRE_Int +HYPRE_StructSMGGetZeroGuess_flt( HYPRE_StructSolver solver, HYPRE_Int *zeroguess ); +HYPRE_Int +HYPRE_StructSMGGetZeroGuess_dbl( HYPRE_StructSolver solver, HYPRE_Int *zeroguess ); +HYPRE_Int +HYPRE_StructSMGGetZeroGuess_long_dbl( HYPRE_StructSolver solver, HYPRE_Int *zeroguess ); +HYPRE_Int +HYPRE_StructSMGGetZeroGuess( HYPRE_StructSolver solver, HYPRE_Int *zeroguess ); + +HYPRE_Int +HYPRE_StructSMGSetLogging_flt( HYPRE_StructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_StructSMGSetLogging_dbl( HYPRE_StructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_StructSMGSetLogging_long_dbl( HYPRE_StructSolver solver, HYPRE_Int logging ); +HYPRE_Int +HYPRE_StructSMGSetLogging( HYPRE_StructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_StructSMGSetMaxIter_flt( HYPRE_StructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_StructSMGSetMaxIter_dbl( HYPRE_StructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_StructSMGSetMaxIter_long_dbl( HYPRE_StructSolver solver, HYPRE_Int max_iter ); +HYPRE_Int +HYPRE_StructSMGSetMaxIter( HYPRE_StructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_StructSMGSetMemoryUse_flt( HYPRE_StructSolver solver, HYPRE_Int memory_use ); +HYPRE_Int +HYPRE_StructSMGSetMemoryUse_dbl( HYPRE_StructSolver solver, HYPRE_Int memory_use ); +HYPRE_Int +HYPRE_StructSMGSetMemoryUse_long_dbl( HYPRE_StructSolver solver, HYPRE_Int memory_use ); +HYPRE_Int +HYPRE_StructSMGSetMemoryUse( HYPRE_StructSolver solver, HYPRE_Int memory_use ); + +HYPRE_Int +HYPRE_StructSMGSetNonZeroGuess_flt( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructSMGSetNonZeroGuess_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructSMGSetNonZeroGuess_long_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructSMGSetNonZeroGuess( HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructSMGSetNumPostRelax_flt( HYPRE_StructSolver solver, HYPRE_Int num_post_relax ); +HYPRE_Int +HYPRE_StructSMGSetNumPostRelax_dbl( HYPRE_StructSolver solver, HYPRE_Int num_post_relax ); +HYPRE_Int +HYPRE_StructSMGSetNumPostRelax_long_dbl( HYPRE_StructSolver solver, HYPRE_Int num_post_relax ); +HYPRE_Int +HYPRE_StructSMGSetNumPostRelax( HYPRE_StructSolver solver, HYPRE_Int num_post_relax ); + +HYPRE_Int +HYPRE_StructSMGSetNumPreRelax_flt( HYPRE_StructSolver solver, HYPRE_Int num_pre_relax ); +HYPRE_Int +HYPRE_StructSMGSetNumPreRelax_dbl( HYPRE_StructSolver solver, HYPRE_Int num_pre_relax ); +HYPRE_Int +HYPRE_StructSMGSetNumPreRelax_long_dbl( HYPRE_StructSolver solver, HYPRE_Int num_pre_relax ); +HYPRE_Int +HYPRE_StructSMGSetNumPreRelax( HYPRE_StructSolver solver, HYPRE_Int num_pre_relax ); + +HYPRE_Int +HYPRE_StructSMGSetPrintLevel_flt( HYPRE_StructSolver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_StructSMGSetPrintLevel_dbl( HYPRE_StructSolver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_StructSMGSetPrintLevel_long_dbl( HYPRE_StructSolver solver, HYPRE_Int print_level ); +HYPRE_Int +HYPRE_StructSMGSetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_StructSMGSetRelChange_flt( HYPRE_StructSolver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_StructSMGSetRelChange_dbl( HYPRE_StructSolver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_StructSMGSetRelChange_long_dbl( HYPRE_StructSolver solver, HYPRE_Int rel_change ); +HYPRE_Int +HYPRE_StructSMGSetRelChange( HYPRE_StructSolver solver, HYPRE_Int rel_change ); + +HYPRE_Int +HYPRE_StructSMGSetTol_flt( HYPRE_StructSolver solver, hypre_float tol ); +HYPRE_Int +HYPRE_StructSMGSetTol_dbl( HYPRE_StructSolver solver, hypre_double tol ); +HYPRE_Int +HYPRE_StructSMGSetTol_long_dbl( HYPRE_StructSolver solver, hypre_long_double tol ); +HYPRE_Int +HYPRE_StructSMGSetTol( HYPRE_StructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_StructSMGSetZeroGuess_flt( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructSMGSetZeroGuess_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructSMGSetZeroGuess_long_dbl( HYPRE_StructSolver solver ); +HYPRE_Int +HYPRE_StructSMGSetZeroGuess( HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructSMGSetup_flt( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructSMGSetup_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructSMGSetup_long_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructSMGSetup( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructSMGSolve_flt( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructSMGSolve_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructSMGSolve_long_dbl( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); +HYPRE_Int +HYPRE_StructSMGSolve( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructSetupInterpreter_flt( mv_InterfaceInterpreter *i ); +HYPRE_Int +HYPRE_StructSetupInterpreter_dbl( mv_InterfaceInterpreter *i ); +HYPRE_Int +HYPRE_StructSetupInterpreter_long_dbl( mv_InterfaceInterpreter *i ); +HYPRE_Int +HYPRE_StructSetupInterpreter( mv_InterfaceInterpreter *i ); + +HYPRE_Int +HYPRE_StructSetupMatvec_flt( HYPRE_MatvecFunctions *mv ); +HYPRE_Int +HYPRE_StructSetupMatvec_dbl( HYPRE_MatvecFunctions *mv ); +HYPRE_Int +HYPRE_StructSetupMatvec_long_dbl( HYPRE_MatvecFunctions *mv ); +HYPRE_Int +HYPRE_StructSetupMatvec( HYPRE_MatvecFunctions *mv ); + + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_StructBiCGSTABCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_StructSolver *solver ); + +HYPRE_Int +HYPRE_StructBiCGSTABDestroy_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructBiCGSTABGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_StructBiCGSTABGetNumIterations_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_StructBiCGSTABGetResidual_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, void **residual ); + +HYPRE_Int +HYPRE_StructBiCGSTABSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_StructBiCGSTABSetLogging_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_StructBiCGSTABSetMaxIter_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_StructBiCGSTABSetPrecond_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ); + +HYPRE_Int +HYPRE_StructBiCGSTABSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_StructBiCGSTABSetTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_StructBiCGSTABSetup_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructBiCGSTABSolve_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructCycRedCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_StructSolver *solver ); + +HYPRE_Int +HYPRE_StructCycRedDestroy_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructCycRedSetBase_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int ndim, HYPRE_Int *base_index, HYPRE_Int *base_stride ); + +HYPRE_Int +HYPRE_StructCycRedSetTDim_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int tdim ); + +HYPRE_Int +HYPRE_StructCycRedSetup_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructCycRedSolve_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructDiagScale_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix HA, HYPRE_StructVector Hy, HYPRE_StructVector Hx ); + +HYPRE_Int +HYPRE_StructDiagScaleSetup_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector y, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructFlexGMRESCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_StructSolver *solver ); + +HYPRE_Int +HYPRE_StructFlexGMRESDestroy_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructFlexGMRESGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_StructFlexGMRESGetNumIterations_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_StructFlexGMRESSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_StructFlexGMRESSetKDim_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_StructFlexGMRESSetLogging_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_StructFlexGMRESSetMaxIter_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_StructFlexGMRESSetModifyPC_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_PtrToModifyPCFcn modify_pc ); + +HYPRE_Int +HYPRE_StructFlexGMRESSetPrecond_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ); + +HYPRE_Int +HYPRE_StructFlexGMRESSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_StructFlexGMRESSetTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_StructFlexGMRESSetup_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructFlexGMRESSolve_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructGMRESCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_StructSolver *solver ); + +HYPRE_Int +HYPRE_StructGMRESDestroy_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructGMRESGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_StructGMRESGetNumIterations_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_StructGMRESSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_StructGMRESSetKDim_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_StructGMRESSetLogging_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_StructGMRESSetMaxIter_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_StructGMRESSetPrecond_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ); + +HYPRE_Int +HYPRE_StructGMRESSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_StructGMRESSetTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_StructGMRESSetup_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructGMRESSolve_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructHybridCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_StructSolver *solver ); + +HYPRE_Int +HYPRE_StructHybridDestroy_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructHybridGetDSCGNumIterations_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *ds_num_its ); + +HYPRE_Int +HYPRE_StructHybridGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_StructHybridGetNumIterations_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *num_its ); + +HYPRE_Int +HYPRE_StructHybridGetPCGNumIterations_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *pre_num_its ); + +HYPRE_Int +HYPRE_StructHybridGetRecomputeResidual_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *recompute_residual ); + +HYPRE_Int +HYPRE_StructHybridGetRecomputeResidualP_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *recompute_residual_p ); + +HYPRE_Int +HYPRE_StructHybridSetConvergenceTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double cf_tol ); + +HYPRE_Int +HYPRE_StructHybridSetDSCGMaxIter_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int ds_max_its ); + +HYPRE_Int +HYPRE_StructHybridSetKDim_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_StructHybridSetLogging_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_StructHybridSetPCGAbsoluteTolFactor_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double pcg_atolf ); + +HYPRE_Int +HYPRE_StructHybridSetPCGMaxIter_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int pre_max_its ); + +HYPRE_Int +HYPRE_StructHybridSetPrecond_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ); + +HYPRE_Int +HYPRE_StructHybridSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_StructHybridSetRecomputeResidual_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int recompute_residual ); + +HYPRE_Int +HYPRE_StructHybridSetRecomputeResidualP_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int recompute_residual_p ); + +HYPRE_Int +HYPRE_StructHybridSetRelChange_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int rel_change ); + +HYPRE_Int +HYPRE_StructHybridSetSolverType_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int solver_type ); + +HYPRE_Int +HYPRE_StructHybridSetStopCrit_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int stop_crit ); + +HYPRE_Int +HYPRE_StructHybridSetTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_StructHybridSetTwoNorm_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int two_norm ); + +HYPRE_Int +HYPRE_StructHybridSetup_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructHybridSolve_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructJacobiCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_StructSolver *solver ); + +HYPRE_Int +HYPRE_StructJacobiDestroy_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructJacobiGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_StructJacobiGetMaxIter_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *max_iter ); + +HYPRE_Int +HYPRE_StructJacobiGetNumIterations_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_StructJacobiGetTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, void *tol ); + +HYPRE_Int +HYPRE_StructJacobiGetZeroGuess_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *zeroguess ); + +HYPRE_Int +HYPRE_StructJacobiSetMaxIter_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_StructJacobiSetNonZeroGuess_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructJacobiSetTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_StructJacobiSetZeroGuess_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructJacobiSetup_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructJacobiSolve_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructLGMRESCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_StructSolver *solver ); + +HYPRE_Int +HYPRE_StructLGMRESDestroy_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructLGMRESGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_StructLGMRESGetNumIterations_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_StructLGMRESSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_StructLGMRESSetAugDim_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int aug_dim ); + +HYPRE_Int +HYPRE_StructLGMRESSetKDim_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int k_dim ); + +HYPRE_Int +HYPRE_StructLGMRESSetLogging_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_StructLGMRESSetMaxIter_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_StructLGMRESSetPrecond_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ); + +HYPRE_Int +HYPRE_StructLGMRESSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_StructLGMRESSetTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_StructLGMRESSetup_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructLGMRESSolve_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructPCGCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_StructSolver *solver ); + +HYPRE_Int +HYPRE_StructPCGDestroy_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructPCGGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_StructPCGGetNumIterations_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_StructPCGSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_StructPCGSetLogging_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_StructPCGSetMaxIter_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_StructPCGSetPrecond_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ); + +HYPRE_Int +HYPRE_StructPCGSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int level ); + +HYPRE_Int +HYPRE_StructPCGSetRelChange_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int rel_change ); + +HYPRE_Int +HYPRE_StructPCGSetTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_StructPCGSetTwoNorm_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int two_norm ); + +HYPRE_Int +HYPRE_StructPCGSetup_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructPCGSolve_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructPFMGCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_StructSolver *solver ); + +HYPRE_Int +HYPRE_StructPFMGDestroy_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructPFMGGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_StructPFMGGetJacobiWeight_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, void *weight ); + +HYPRE_Int +HYPRE_StructPFMGGetLogging_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *logging ); + +HYPRE_Int +HYPRE_StructPFMGGetMatmultType_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *matmult_type ); + +HYPRE_Int +HYPRE_StructPFMGGetMaxIter_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *max_iter ); + +HYPRE_Int +HYPRE_StructPFMGGetMaxLevels_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *max_levels ); + +HYPRE_Int +HYPRE_StructPFMGGetNumIterations_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_StructPFMGGetNumPostRelax_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *num_post_relax ); + +HYPRE_Int +HYPRE_StructPFMGGetNumPreRelax_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *num_pre_relax ); + +HYPRE_Int +HYPRE_StructPFMGGetPrintLevel_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *print_level ); + +HYPRE_Int +HYPRE_StructPFMGGetRAPType_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *rap_type ); + +HYPRE_Int +HYPRE_StructPFMGGetRelChange_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *rel_change ); + +HYPRE_Int +HYPRE_StructPFMGGetRelaxType_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *relax_type ); + +HYPRE_Int +HYPRE_StructPFMGGetSkipRelax_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *skip_relax ); + +HYPRE_Int +HYPRE_StructPFMGGetTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, void *tol ); + +HYPRE_Int +HYPRE_StructPFMGGetZeroGuess_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *zeroguess ); + +HYPRE_Int +HYPRE_StructPFMGSetDxyz_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, void *dxyz ); + +HYPRE_Int +HYPRE_StructPFMGSetJacobiWeight_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double weight ); + +HYPRE_Int +HYPRE_StructPFMGSetLogging_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_StructPFMGSetMatmultType_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int matmult_type ); + +HYPRE_Int +HYPRE_StructPFMGSetMaxIter_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_StructPFMGSetMaxLevels_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int max_levels ); + +HYPRE_Int +HYPRE_StructPFMGSetNonZeroGuess_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructPFMGSetNumPostRelax_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int num_post_relax ); + +HYPRE_Int +HYPRE_StructPFMGSetNumPreRelax_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int num_pre_relax ); + +HYPRE_Int +HYPRE_StructPFMGSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_StructPFMGSetRAPType_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int rap_type ); + +HYPRE_Int +HYPRE_StructPFMGSetRelChange_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int rel_change ); + +HYPRE_Int +HYPRE_StructPFMGSetRelaxType_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int relax_type ); + +HYPRE_Int +HYPRE_StructPFMGSetSkipRelax_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int skip_relax ); + +HYPRE_Int +HYPRE_StructPFMGSetTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_StructPFMGSetZeroGuess_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructPFMGSetup_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructPFMGSolve_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructSMGCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_StructSolver *solver ); + +HYPRE_Int +HYPRE_StructSMGDestroy_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructSMGGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, void *norm ); + +HYPRE_Int +HYPRE_StructSMGGetLogging_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *logging ); + +HYPRE_Int +HYPRE_StructSMGGetMaxIter_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *max_iter ); + +HYPRE_Int +HYPRE_StructSMGGetMemoryUse_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *memory_use ); + +HYPRE_Int +HYPRE_StructSMGGetNumIterations_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *num_iterations ); + +HYPRE_Int +HYPRE_StructSMGGetNumPostRelax_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *num_post_relax ); + +HYPRE_Int +HYPRE_StructSMGGetNumPreRelax_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *num_pre_relax ); + +HYPRE_Int +HYPRE_StructSMGGetPrintLevel_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *print_level ); + +HYPRE_Int +HYPRE_StructSMGGetRelChange_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *rel_change ); + +HYPRE_Int +HYPRE_StructSMGGetTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, void *tol ); + +HYPRE_Int +HYPRE_StructSMGGetZeroGuess_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *zeroguess ); + +HYPRE_Int +HYPRE_StructSMGSetLogging_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int logging ); + +HYPRE_Int +HYPRE_StructSMGSetMaxIter_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int max_iter ); + +HYPRE_Int +HYPRE_StructSMGSetMemoryUse_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int memory_use ); + +HYPRE_Int +HYPRE_StructSMGSetNonZeroGuess_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructSMGSetNumPostRelax_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int num_post_relax ); + +HYPRE_Int +HYPRE_StructSMGSetNumPreRelax_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int num_pre_relax ); + +HYPRE_Int +HYPRE_StructSMGSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int print_level ); + +HYPRE_Int +HYPRE_StructSMGSetRelChange_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int rel_change ); + +HYPRE_Int +HYPRE_StructSMGSetTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double tol ); + +HYPRE_Int +HYPRE_StructSMGSetZeroGuess_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ); + +HYPRE_Int +HYPRE_StructSMGSetup_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructSMGSolve_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ); + +HYPRE_Int +HYPRE_StructSetupInterpreter_pre( HYPRE_Precision precision, mv_InterfaceInterpreter *i ); + +HYPRE_Int +HYPRE_StructSetupMatvec_pre( HYPRE_Precision precision, HYPRE_MatvecFunctions *mv ); + + +#endif + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/src/struct_ls/HYPRE_struct_pcg.c b/src/struct_ls/HYPRE_struct_pcg.c index 9bd1455894..678c1a456b 100644 --- a/src/struct_ls/HYPRE_struct_pcg.c +++ b/src/struct_ls/HYPRE_struct_pcg.c @@ -188,65 +188,15 @@ HYPRE_StructDiagScaleSetup( HYPRE_StructSolver solver, HYPRE_Int HYPRE_StructDiagScale( HYPRE_StructSolver solver, - HYPRE_StructMatrix HA, - HYPRE_StructVector Hy, - HYPRE_StructVector Hx ) + HYPRE_StructMatrix A, + HYPRE_StructVector y, + HYPRE_StructVector x ) { HYPRE_UNUSED_VAR(solver); - hypre_StructMatrix *A = (hypre_StructMatrix *) HA; - hypre_StructVector *y = (hypre_StructVector *) Hy; - hypre_StructVector *x = (hypre_StructVector *) Hx; - - hypre_BoxArray *boxes; - hypre_Box *box; - - hypre_Box *A_data_box; - hypre_Box *y_data_box; - hypre_Box *x_data_box; - - HYPRE_Real *Ap; - HYPRE_Real *yp; - HYPRE_Real *xp; - - hypre_Index index; - hypre_IndexRef start; - hypre_Index stride; - hypre_Index loop_size; - - HYPRE_Int i; - - /* x = D^{-1} y */ - hypre_SetIndex(stride, 1); - boxes = hypre_StructGridBoxes(hypre_StructMatrixGrid(A)); - hypre_ForBoxI(i, boxes) - { - box = hypre_BoxArrayBox(boxes, i); - - A_data_box = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A), i); - x_data_box = hypre_BoxArrayBox(hypre_StructVectorDataSpace(x), i); - y_data_box = hypre_BoxArrayBox(hypre_StructVectorDataSpace(y), i); - - hypre_SetIndex(index, 0); - Ap = hypre_StructMatrixExtractPointerByIndex(A, i, index); - xp = hypre_StructVectorBoxData(x, i); - yp = hypre_StructVectorBoxData(y, i); - - start = hypre_BoxIMin(box); - - hypre_BoxGetSize(box, loop_size); - -#define DEVICE_VAR is_device_ptr(xp,yp,Ap) - hypre_BoxLoop3Begin(hypre_StructVectorNDim(Hx), loop_size, - A_data_box, start, stride, Ai, - x_data_box, start, stride, xi, - y_data_box, start, stride, yi); - { - xp[xi] = yp[yi] / Ap[Ai]; - } - hypre_BoxLoop3End(Ai, xi, yi); -#undef DEVICE_VAR - } + hypre_StructDiagScale( (hypre_StructMatrix*) A, + (hypre_StructVector*) y, + (hypre_StructVector*) x ); return hypre_error_flag; } diff --git a/src/struct_ls/HYPRE_struct_pfmg.c b/src/struct_ls/HYPRE_struct_pfmg.c index 3a2899d9d7..0bffa955a5 100644 --- a/src/struct_ls/HYPRE_struct_pfmg.c +++ b/src/struct_ls/HYPRE_struct_pfmg.c @@ -199,6 +199,23 @@ HYPRE_StructPFMGGetRAPType( HYPRE_StructSolver solver, return ( hypre_PFMGGetRAPType( (void *) solver, rap_type) ); } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetMatmultType( HYPRE_StructSolver solver, + HYPRE_Int matmult_type ) +{ + return ( hypre_PFMGSetMatmultType( (void *) solver, matmult_type ) ); +} + +HYPRE_Int +HYPRE_StructPFMGGetMatmultType( HYPRE_StructSolver solver, + HYPRE_Int * matmult_type ) +{ + return ( hypre_PFMGGetMatmultType( (void *) solver, matmult_type ) ); +} + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ diff --git a/src/struct_ls/HYPRE_struct_sparse_msg.c b/src/struct_ls/HYPRE_struct_sparse_msg.c deleted file mode 100644 index 5f9f8feb13..0000000000 --- a/src/struct_ls/HYPRE_struct_sparse_msg.c +++ /dev/null @@ -1,232 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_StructSparseMSG interface - * - *****************************************************************************/ - -#include "_hypre_struct_ls.h" - -/*-------------------------------------------------------------------------- - * HYPRE_StructSparseMSGCreate - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_StructSparseMSGCreate( MPI_Comm comm, HYPRE_StructSolver *solver ) -{ - *solver = ( (HYPRE_StructSolver) hypre_SparseMSGCreate( comm ) ); - - return 0; -} - -/*-------------------------------------------------------------------------- - * HYPRE_StructSparseMSGDestroy - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_StructSparseMSGDestroy( HYPRE_StructSolver solver ) -{ - return ( hypre_SparseMSGDestroy( (void *) solver ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_StructSparseMSGSetup - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_StructSparseMSGSetup( HYPRE_StructSolver 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_StructSparseMSGSolve( HYPRE_StructSolver solver, - HYPRE_StructMatrix A, - HYPRE_StructVector b, - HYPRE_StructVector x ) -{ - return ( hypre_SparseMSGSolve( (void *) solver, - (hypre_StructMatrix *) A, - (hypre_StructVector *) b, - (hypre_StructVector *) x ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_StructSparseMSGSetTol - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_StructSparseMSGSetTol( HYPRE_StructSolver solver, - HYPRE_Real tol ) -{ - return ( hypre_SparseMSGSetTol( (void *) solver, tol ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_StructSparseMSGSetMaxIter - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_StructSparseMSGSetMaxIter( HYPRE_StructSolver solver, - HYPRE_Int max_iter ) -{ - return ( hypre_SparseMSGSetMaxIter( (void *) solver, max_iter ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_StructSparseMSGSetJump - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_StructSparseMSGSetJump( HYPRE_StructSolver solver, - HYPRE_Int jump ) -{ - return ( hypre_SparseMSGSetJump( (void *) solver, jump ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_StructSparseMSGSetRelChange - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_StructSparseMSGSetRelChange( HYPRE_StructSolver solver, - HYPRE_Int rel_change ) -{ - return ( hypre_SparseMSGSetRelChange( (void *) solver, rel_change ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_StructSparseMSGSetZeroGuess - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_StructSparseMSGSetZeroGuess( HYPRE_StructSolver solver ) -{ - return ( hypre_SparseMSGSetZeroGuess( (void *) solver, 1 ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_StructSparseMSGSetNonZeroGuess - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_StructSparseMSGSetNonZeroGuess( HYPRE_StructSolver solver ) -{ - return ( hypre_SparseMSGSetZeroGuess( (void *) solver, 0 ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_StructSparseMSGSetRelaxType - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_StructSparseMSGSetRelaxType( HYPRE_StructSolver solver, - HYPRE_Int relax_type ) -{ - return ( hypre_SparseMSGSetRelaxType( (void *) solver, relax_type) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_StructSparseMSGSetJacobiWeight - *--------------------------------------------------------------------------*/ -HYPRE_Int -HYPRE_StructSparseMSGSetJacobiWeight(HYPRE_StructSolver solver, - HYPRE_Real weight) -{ - return ( hypre_SparseMSGSetJacobiWeight( (void *) solver, weight) ); -} - - -/*-------------------------------------------------------------------------- - * HYPRE_StructSparseMSGSetNumPreRelax - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_StructSparseMSGSetNumPreRelax( HYPRE_StructSolver solver, - HYPRE_Int num_pre_relax ) -{ - return ( hypre_SparseMSGSetNumPreRelax( (void *) solver, num_pre_relax) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_StructSparseMSGSetNumPostRelax - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_StructSparseMSGSetNumPostRelax( HYPRE_StructSolver solver, - HYPRE_Int num_post_relax ) -{ - return ( hypre_SparseMSGSetNumPostRelax( (void *) solver, num_post_relax) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_StructSparseMSGSetNumFineRelax - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_StructSparseMSGSetNumFineRelax( HYPRE_StructSolver solver, - HYPRE_Int num_fine_relax ) -{ - return ( hypre_SparseMSGSetNumFineRelax( (void *) solver, num_fine_relax) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_StructSparseMSGSetLogging - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_StructSparseMSGSetLogging( HYPRE_StructSolver solver, - HYPRE_Int logging ) -{ - return ( hypre_SparseMSGSetLogging( (void *) solver, logging) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_StructSparseMSGSetPrintLevel - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_StructSparseMSGSetPrintLevel( HYPRE_StructSolver solver, - HYPRE_Int print_level ) -{ - return ( hypre_SparseMSGSetPrintLevel( (void *) solver, print_level) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_StructSparseMSGGetNumIterations - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_StructSparseMSGGetNumIterations( HYPRE_StructSolver solver, - HYPRE_Int *num_iterations ) -{ - return ( hypre_SparseMSGGetNumIterations( (void *) solver, num_iterations ) ); -} - -/*-------------------------------------------------------------------------- - * HYPRE_StructSparseMSGGetFinalRelativeResidualNorm - *--------------------------------------------------------------------------*/ - -HYPRE_Int -HYPRE_StructSparseMSGGetFinalRelativeResidualNorm( HYPRE_StructSolver solver, - HYPRE_Real *norm ) -{ - return ( hypre_SparseMSGGetFinalRelativeResidualNorm( (void *) solver, norm ) ); -} - diff --git a/src/struct_ls/Makefile b/src/struct_ls/Makefile index 2ba52ac53b..7832e5a97d 100644 --- a/src/struct_ls/Makefile +++ b/src/struct_ls/Makefile @@ -22,11 +22,9 @@ HEADERS =\ _hypre_struct_ls.h\ pfmg.h\ red_black_gs.h\ - smg.h\ - sparse_msg.h + smg.h FILES =\ - coarsen.c\ F90_HYPRE_struct_bicgstab.c\ F90_HYPRE_struct_cycred.c\ F90_HYPRE_struct_flexgmres.c\ @@ -38,8 +36,6 @@ FILES =\ F90_HYPRE_struct_pcg.c\ F90_HYPRE_struct_pfmg.c\ F90_HYPRE_struct_smg.c\ - F90_HYPRE_struct_sparse_msg.c\ - hybrid.c\ HYPRE_struct_bicgstab.c\ HYPRE_struct_cycred.c\ HYPRE_struct_flexgmres.c\ @@ -49,8 +45,7 @@ FILES =\ HYPRE_struct_lgmres.c\ HYPRE_struct_pfmg.c\ HYPRE_struct_smg.c\ - HYPRE_struct_sparse_msg.c\ - jacobi.c\ + hybrid.c\ pcg_struct.c\ pfmg.c\ pfmg_relax.c\ @@ -61,23 +56,21 @@ FILES =\ smg_setup.c\ smg_setup_rap.c\ smg_setup_restrict.c\ - smg_solve.c\ - sparse_msg.c\ - sparse_msg_setup.c\ - sparse_msg_setup_rap.c\ - sparse_msg_solve.c + smg_solve.c CUFILES =\ - cyclic_reduction.c\ HYPRE_struct_int.c\ HYPRE_struct_pcg.c\ + cyclic_reduction.c\ + diagscale.c\ + jacobi.c\ pfmg2_setup_rap.c\ pfmg3_setup_rap.c\ + pfmg_coarsen.c\ pfmg_setup.c\ pfmg_setup_interp.c\ pfmg_setup_rap5.c\ pfmg_setup_rap7.c\ - point_relax.c\ red_black_constantcoef_gs.c\ red_black_gs.c\ semi_interp.c\ @@ -88,17 +81,34 @@ CUFILES =\ smg.c\ smg_axpy.c\ smg_residual.c\ - smg_setup_interp.c\ - sparse_msg2_setup_rap.c\ - sparse_msg3_setup_rap.c\ - sparse_msg_filter.c\ - sparse_msg_interp.c\ - sparse_msg_restrict.c + smg_setup_interp.c + +# Mixed precision files +MP_FILES = \ + mup_fixed.c\ + mup_functions.c\ + mup_pre.c\ + HYPRE_struct_ls_mp.c COBJS = ${FILES:.c=.o} CUOBJS = ${CUFILES:.c=.obj} OBJS = ${COBJS} ${CUOBJS} +ifeq (${MP_BUILD}, 1) + +COBJS_single = ${FILES:.c=.o_flt} +COBJS_double = ${FILES:.c=.o_dbl} +COBJS_longdouble = ${FILES:.c=.o_ldbl} +CUOBJS_single = ${CUFILES:.c=.obj_flt} +CUOBJS_double = ${CUFILES:.c=.obj_dbl} +CUOBJS_longdouble = ${CUFILES:.c=.obj_ldbl} +MP_COBJS = ${MP_FILES:.c=.o} + +OBJS = ${COBJS_single} ${COBJS_double} ${COBJS_longdouble} ${MP_COBJS} +OBJS += ${CUOBJS_single} ${CUOBJS_double} ${CUOBJS_longdouble} + +endif + SONAME = libHYPRE_struct_ls-${HYPRE_RELEASE_VERSION}${HYPRE_LIB_SUFFIX} ################################################################## @@ -107,16 +117,18 @@ SONAME = libHYPRE_struct_ls-${HYPRE_RELEASE_VERSION}${HYPRE_LIB_SUFFIX} all: libHYPRE_struct_ls${HYPRE_LIB_SUFFIX} cp -fR $(srcdir)/HYPRE_*.h $(HYPRE_BUILD_DIR)/include - cp -fR $(srcdir)/_hypre_struct_ls.h $(HYPRE_BUILD_DIR)/include + cp -fR $(srcdir)/_hypre_*.h $(HYPRE_BUILD_DIR)/include # cp -fR libHYPRE* $(HYPRE_BUILD_DIR)/lib install: libHYPRE_struct_ls${HYPRE_LIB_SUFFIX} cp -fR $(srcdir)/HYPRE_*.h $(HYPRE_INC_INSTALL) - cp -fR $(srcdir)/_hypre_struct_ls.h $(HYPRE_INC_INSTALL) + cp -fR $(srcdir)/_hypre_*.h $(HYPRE_INC_INSTALL) # cp -fR libHYPRE* $(HYPRE_LIB_INSTALL) clean: rm -f *.o *.obj libHYPRE* + rm -f *.o_flt *.o_dbl *.o_ldbl + rm -f *.obj_flt *.obj_dbl *.obj_ldbl rm -rf pchdir tca.map *inslog* distclean: clean diff --git a/src/struct_ls/_hypre_struct_ls.h b/src/struct_ls/_hypre_struct_ls.h index df3b050fe8..4531a245a3 100644 --- a/src/struct_ls/_hypre_struct_ls.h +++ b/src/struct_ls/_hypre_struct_ls.h @@ -7,13 +7,15 @@ #include "_hypre_utilities.h" #include "HYPRE_struct_ls.h" #include "_hypre_struct_mv.h" -#include "krylov.h" +#include "_hypre_krylov.h" -#include "temp_multivector.h" - /* ... needed to make sense of functions in HYPRE_parcsr_int.c */ -#include "HYPRE_MatvecFunctions.h" +#include "_hypre_lobpcg_temp_multivector.h" /* ... needed to make sense of functions in HYPRE_parcsr_int.c */ +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_struct_ls_mup_def.h" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -25,14 +27,6 @@ extern "C" { * 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, @@ -47,10 +41,6 @@ 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 ); - -/* general.c */ -HYPRE_Int hypre_Log2 ( HYPRE_Int p ); /* hybrid.c */ void *hypre_HybridCreate ( MPI_Comm comm ); @@ -83,29 +73,26 @@ HYPRE_Int hypre_HybridSetup ( void *hybrid_vdata, hypre_StructMatrix *A, hypre_S 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_struct_pfmg.c */ -HYPRE_Int hypre_PFMGSetDeviceLevel( void *pfmg_vdata, HYPRE_Int device_level ); +/* diagscale.c */ +HYPRE_Int hypre_StructDiagScale( hypre_StructMatrix *A, hypre_StructVector *y, hypre_StructVector *x ); /* 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 ); +void *hypre_StructJacobiCreate ( MPI_Comm comm ); +HYPRE_Int hypre_StructJacobiDestroy ( void *jacobi_vdata ); +HYPRE_Int hypre_StructJacobiSetup ( void *jacobi_vdata, hypre_StructMatrix *A, + hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int hypre_StructJacobiSolve ( void *jacobi_vdata, hypre_StructMatrix *A, + hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int hypre_StructJacobiSetTol ( void *jacobi_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_StructJacobiGetTol ( void *jacobi_vdata, HYPRE_Real *tol ); +HYPRE_Int hypre_StructJacobiSetMaxIter ( void *jacobi_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_StructJacobiGetMaxIter ( void *jacobi_vdata, HYPRE_Int *max_iter ); +HYPRE_Int hypre_StructJacobiSetZeroGuess ( void *jacobi_vdata, HYPRE_Int zero_guess ); +HYPRE_Int hypre_StructJacobiGetZeroGuess ( void *jacobi_vdata, HYPRE_Int *zero_guess ); +HYPRE_Int hypre_StructJacobiGetNumIterations ( void *jacobi_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_StructJacobiSetWeight ( void *jacobi_vdata, HYPRE_Real weight ); +HYPRE_Int hypre_StructJacobiSetTempVec ( void *jacobi_vdata, hypre_StructVector *t ); +HYPRE_Int hypre_StructJacobiGetFinalRelativeResidualNorm ( void *jacobi_vdata, HYPRE_Real *norm ); /* pcg_struct.c */ void *hypre_StructKrylovCAlloc ( size_t count, size_t elt_size, HYPRE_MemoryLocation location ); @@ -122,6 +109,7 @@ HYPRE_Int hypre_StructKrylovInnerProdTagged ( void *x, void *y, HYPRE_Int *num_t HYPRE_Complex **iprod_ptr ); HYPRE_Int hypre_StructKrylovCopyVector ( void *x, void *y ); HYPRE_Int hypre_StructKrylovClearVector ( void *x ); +HYPRE_Int hypre_StructKrylovSetRandomValues ( void *x, HYPRE_Int seed ); 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 ); @@ -227,6 +215,8 @@ 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_PFMGSetMatmultType ( void *pfmg_vdata, HYPRE_Int matmult_type ); +HYPRE_Int hypre_PFMGGetMatmultType ( void *pfmg_vdata, HYPRE_Int *matmult_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 ); @@ -238,11 +228,22 @@ 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_PFMGSetPrintFreq ( void *pfmg_vdata, HYPRE_Int print_freq ); +HYPRE_Int hypre_PFMGGetPrintFreq ( void *pfmg_vdata, HYPRE_Int *print_freq ); HYPRE_Int hypre_PFMGGetNumIterations ( void *pfmg_vdata, HYPRE_Int *num_iterations ); -HYPRE_Int hypre_PFMGPrintLogging ( void *pfmg_vdata, HYPRE_Int myid ); +HYPRE_Int hypre_PFMGPrintLogging ( void *pfmg_vdata ); HYPRE_Int hypre_PFMGGetFinalRelativeResidualNorm ( void *pfmg_vdata, HYPRE_Real *relative_residual_norm ); +/* pfmg_coarsen.c */ +HYPRE_Int hypre_PFMGComputeMaxLevels ( hypre_StructGrid *grid, HYPRE_Int *max_levels_ptr ); +HYPRE_Int hypre_PFMGComputeCxyz ( hypre_StructMatrix *A, HYPRE_Real *cxyz, HYPRE_Real *sqcxyz ); +HYPRE_Int hypre_PFMGComputeDxyz ( hypre_StructMatrix *A, HYPRE_Real *dxyz, HYPRE_Int *dxyz_flag ); +HYPRE_Int hypre_PFMGCoarsen ( hypre_Box *cbox, hypre_Index periodic, HYPRE_Int max_levels, + HYPRE_Int dxyz_flag, HYPRE_Real *dxyz, HYPRE_Int **cdir_l_ptr, + HYPRE_Int **active_l_ptr, HYPRE_Real **relax_weights_ptr, + HYPRE_Int *num_levels ); + /* pfmg_relax.c */ void *hypre_PFMGRelaxCreate ( MPI_Comm comm ); HYPRE_Int hypre_PFMGRelaxDestroy ( void *pfmg_relax_vdata ); @@ -260,83 +261,26 @@ HYPRE_Int hypre_PFMGRelaxSetZeroGuess ( void *pfmg_relax_vdata, HYPRE_Int zero_g 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_ZeroDiagonal ( hypre_StructMatrix *A ); +HYPRE_Int hypre_PFMGSetup ( void *pfmg_vdata, hypre_StructMatrix *A, + hypre_StructVector *b, hypre_StructVector *x ); /* 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_Int cdir, + hypre_Index stride, HYPRE_Int rap_type ); +HYPRE_Int hypre_PFMGSetupInterpOp ( hypre_StructMatrix *P, hypre_StructMatrix *A, HYPRE_Int cdir ); +HYPRE_Int hypre_PFMGSetupInterpOp_core_CC( hypre_StructMatrix *P, hypre_StructMatrix *A, + HYPRE_Int cdir, HYPRE_Complex *Pconst0_ptr, + HYPRE_Complex *Pconst1_ptr, HYPRE_Complex *Pconst2_ptr ); +HYPRE_Int hypre_PFMGSetupInterpOp_core_VC( hypre_StructMatrix *P, hypre_StructMatrix *A, + HYPRE_Int cdir, HYPRE_Complex Pconst0, + HYPRE_Complex Pconst1, HYPRE_Complex Pconst2 ); + /* 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 ); /* pfmg_setup_rap7.c */ hypre_StructMatrix *hypre_PFMGCreateCoarseOp7 ( hypre_StructMatrix *R, hypre_StructMatrix *A, @@ -356,41 +300,6 @@ HYPRE_Int hypre_PFMGSetupRAPOp ( hypre_StructMatrix *R, hypre_StructMatrix *A, 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 ); - /* red_black_constantcoef_gs.c */ HYPRE_Int hypre_RedBlackConstantCoefGS ( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); @@ -489,12 +398,12 @@ 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_SMGPrintLogging ( void *smg_vdata ); 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 ); +HYPRE_Int hypre_SMGSetMaxLevel ( void *smg_vdata, HYPRE_Int max_level ); /* smg_relax.c */ void *hypre_SMGRelaxCreate ( MPI_Comm comm ); @@ -546,16 +455,6 @@ HYPRE_Int hypre_SMGResidualSetBase ( void *residual_vdata, hypre_Index base_inde 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_SMGResidualDestroy ( void *residual_vdata ); - /* smg_setup.c */ HYPRE_Int hypre_SMGSetup ( void *smg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); @@ -583,89 +482,20 @@ HYPRE_Int hypre_SMGSetupRestrictOp ( hypre_StructMatrix *A, hypre_StructMatrix * 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 ); - -/* 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 ); - -/* 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 ); - -/* 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 ); - -/* 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_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_SparseMSGRestrictDestroy ( void *restrict_vdata ); - -/* sparse_msg_setup.c */ -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 ); - -/* sparse_msg_solve.c */ -HYPRE_Int hypre_SparseMSGSolve ( void *smsg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, - hypre_StructVector *x ); - #ifdef __cplusplus } #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_struct_ls_mup_undef.h" +#include "_hypre_struct_ls_mup.h" +#endif +#endif + #endif diff --git a/src/struct_ls/_hypre_struct_ls_mup.h b/src/struct_ls/_hypre_struct_ls_mup.h new file mode 100644 index 0000000000..8fdda4bd8b --- /dev/null +++ b/src/struct_ls/_hypre_struct_ls_mup.h @@ -0,0 +1,1824 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#ifndef hypre_STRUCT_LS_MUP_HEADER +#define hypre_STRUCT_LS_MUP_HEADER + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (HYPRE_MIXED_PRECISION) + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_StructMatrix * +hypre_CycRedCreateCoarseOp_flt( hypre_StructMatrix *A, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ); +hypre_StructMatrix * +hypre_CycRedCreateCoarseOp_dbl( hypre_StructMatrix *A, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ); +hypre_StructMatrix * +hypre_CycRedCreateCoarseOp_long_dbl( hypre_StructMatrix *A, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ); + +HYPRE_Int +hypre_CycRedSetupCoarseOp_flt( hypre_StructMatrix *A, hypre_StructMatrix *Ac, hypre_Index cindex, hypre_Index cstride, HYPRE_Int cdir ); +HYPRE_Int +hypre_CycRedSetupCoarseOp_dbl( hypre_StructMatrix *A, hypre_StructMatrix *Ac, hypre_Index cindex, hypre_Index cstride, HYPRE_Int cdir ); +HYPRE_Int +hypre_CycRedSetupCoarseOp_long_dbl( hypre_StructMatrix *A, hypre_StructMatrix *Ac, hypre_Index cindex, hypre_Index cstride, HYPRE_Int cdir ); + +HYPRE_Int +hypre_CyclicReduction_flt( void *cyc_red_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_CyclicReduction_dbl( void *cyc_red_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_CyclicReduction_long_dbl( void *cyc_red_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); + +void * +hypre_CyclicReductionCreate_flt( MPI_Comm comm ); +void * +hypre_CyclicReductionCreate_dbl( MPI_Comm comm ); +void * +hypre_CyclicReductionCreate_long_dbl( MPI_Comm comm ); + +HYPRE_Int +hypre_CyclicReductionDestroy_flt( void *cyc_red_vdata ); +HYPRE_Int +hypre_CyclicReductionDestroy_dbl( void *cyc_red_vdata ); +HYPRE_Int +hypre_CyclicReductionDestroy_long_dbl( void *cyc_red_vdata ); + +HYPRE_Int +hypre_CyclicReductionSetBase_flt( void *cyc_red_vdata, hypre_Index base_index, hypre_Index base_stride ); +HYPRE_Int +hypre_CyclicReductionSetBase_dbl( void *cyc_red_vdata, hypre_Index base_index, hypre_Index base_stride ); +HYPRE_Int +hypre_CyclicReductionSetBase_long_dbl( void *cyc_red_vdata, hypre_Index base_index, hypre_Index base_stride ); + +HYPRE_Int +hypre_CyclicReductionSetCDir_flt( void *cyc_red_vdata, HYPRE_Int cdir ); +HYPRE_Int +hypre_CyclicReductionSetCDir_dbl( void *cyc_red_vdata, HYPRE_Int cdir ); +HYPRE_Int +hypre_CyclicReductionSetCDir_long_dbl( void *cyc_red_vdata, HYPRE_Int cdir ); + +HYPRE_Int +hypre_CyclicReductionSetup_flt( void *cyc_red_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_CyclicReductionSetup_dbl( void *cyc_red_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_CyclicReductionSetup_long_dbl( void *cyc_red_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); + +void * +hypre_HybridCreate_flt( MPI_Comm comm ); +void * +hypre_HybridCreate_dbl( MPI_Comm comm ); +void * +hypre_HybridCreate_long_dbl( MPI_Comm comm ); + +HYPRE_Int +hypre_HybridDestroy_flt( void *hybrid_vdata ); +HYPRE_Int +hypre_HybridDestroy_dbl( void *hybrid_vdata ); +HYPRE_Int +hypre_HybridDestroy_long_dbl( void *hybrid_vdata ); + +HYPRE_Int +hypre_HybridGetDSCGNumIterations_flt( void *hybrid_vdata, HYPRE_Int *dscg_num_its ); +HYPRE_Int +hypre_HybridGetDSCGNumIterations_dbl( void *hybrid_vdata, HYPRE_Int *dscg_num_its ); +HYPRE_Int +hypre_HybridGetDSCGNumIterations_long_dbl( void *hybrid_vdata, HYPRE_Int *dscg_num_its ); + +HYPRE_Int +hypre_HybridGetFinalRelativeResidualNorm_flt( void *hybrid_vdata, hypre_float *final_rel_res_norm ); +HYPRE_Int +hypre_HybridGetFinalRelativeResidualNorm_dbl( void *hybrid_vdata, hypre_double *final_rel_res_norm ); +HYPRE_Int +hypre_HybridGetFinalRelativeResidualNorm_long_dbl( void *hybrid_vdata, hypre_long_double *final_rel_res_norm ); + +HYPRE_Int +hypre_HybridGetNumIterations_flt( void *hybrid_vdata, HYPRE_Int *num_its ); +HYPRE_Int +hypre_HybridGetNumIterations_dbl( void *hybrid_vdata, HYPRE_Int *num_its ); +HYPRE_Int +hypre_HybridGetNumIterations_long_dbl( void *hybrid_vdata, HYPRE_Int *num_its ); + +HYPRE_Int +hypre_HybridGetPCGNumIterations_flt( void *hybrid_vdata, HYPRE_Int *pcg_num_its ); +HYPRE_Int +hypre_HybridGetPCGNumIterations_dbl( void *hybrid_vdata, HYPRE_Int *pcg_num_its ); +HYPRE_Int +hypre_HybridGetPCGNumIterations_long_dbl( void *hybrid_vdata, HYPRE_Int *pcg_num_its ); + +HYPRE_Int +hypre_HybridGetRecomputeResidual_flt( void *hybrid_vdata, HYPRE_Int *recompute_residual ); +HYPRE_Int +hypre_HybridGetRecomputeResidual_dbl( void *hybrid_vdata, HYPRE_Int *recompute_residual ); +HYPRE_Int +hypre_HybridGetRecomputeResidual_long_dbl( void *hybrid_vdata, HYPRE_Int *recompute_residual ); + +HYPRE_Int +hypre_HybridGetRecomputeResidualP_flt( void *hybrid_vdata, HYPRE_Int *recompute_residual_p ); +HYPRE_Int +hypre_HybridGetRecomputeResidualP_dbl( void *hybrid_vdata, HYPRE_Int *recompute_residual_p ); +HYPRE_Int +hypre_HybridGetRecomputeResidualP_long_dbl( void *hybrid_vdata, HYPRE_Int *recompute_residual_p ); + +HYPRE_Int +hypre_HybridSetConvergenceTol_flt( void *hybrid_vdata, hypre_float cf_tol ); +HYPRE_Int +hypre_HybridSetConvergenceTol_dbl( void *hybrid_vdata, hypre_double cf_tol ); +HYPRE_Int +hypre_HybridSetConvergenceTol_long_dbl( void *hybrid_vdata, hypre_long_double cf_tol ); + +HYPRE_Int +hypre_HybridSetDSCGMaxIter_flt( void *hybrid_vdata, HYPRE_Int dscg_max_its ); +HYPRE_Int +hypre_HybridSetDSCGMaxIter_dbl( void *hybrid_vdata, HYPRE_Int dscg_max_its ); +HYPRE_Int +hypre_HybridSetDSCGMaxIter_long_dbl( void *hybrid_vdata, HYPRE_Int dscg_max_its ); + +HYPRE_Int +hypre_HybridSetKDim_flt( void *hybrid_vdata, HYPRE_Int k_dim ); +HYPRE_Int +hypre_HybridSetKDim_dbl( void *hybrid_vdata, HYPRE_Int k_dim ); +HYPRE_Int +hypre_HybridSetKDim_long_dbl( void *hybrid_vdata, HYPRE_Int k_dim ); + +HYPRE_Int +hypre_HybridSetLogging_flt( void *hybrid_vdata, HYPRE_Int logging ); +HYPRE_Int +hypre_HybridSetLogging_dbl( void *hybrid_vdata, HYPRE_Int logging ); +HYPRE_Int +hypre_HybridSetLogging_long_dbl( void *hybrid_vdata, HYPRE_Int logging ); + +HYPRE_Int +hypre_HybridSetPCGAbsoluteTolFactor_flt( void *hybrid_vdata, hypre_float pcg_atolf ); +HYPRE_Int +hypre_HybridSetPCGAbsoluteTolFactor_dbl( void *hybrid_vdata, hypre_double pcg_atolf ); +HYPRE_Int +hypre_HybridSetPCGAbsoluteTolFactor_long_dbl( void *hybrid_vdata, hypre_long_double pcg_atolf ); + +HYPRE_Int +hypre_HybridSetPCGMaxIter_flt( void *hybrid_vdata, HYPRE_Int pcg_max_its ); +HYPRE_Int +hypre_HybridSetPCGMaxIter_dbl( void *hybrid_vdata, HYPRE_Int pcg_max_its ); +HYPRE_Int +hypre_HybridSetPCGMaxIter_long_dbl( void *hybrid_vdata, HYPRE_Int pcg_max_its ); + +HYPRE_Int +hypre_HybridSetPrintLevel_flt( void *hybrid_vdata, HYPRE_Int print_level ); +HYPRE_Int +hypre_HybridSetPrintLevel_dbl( void *hybrid_vdata, HYPRE_Int print_level ); +HYPRE_Int +hypre_HybridSetPrintLevel_long_dbl( void *hybrid_vdata, HYPRE_Int print_level ); + +HYPRE_Int +hypre_HybridSetRecomputeResidual_flt( void *hybrid_vdata, HYPRE_Int recompute_residual ); +HYPRE_Int +hypre_HybridSetRecomputeResidual_dbl( void *hybrid_vdata, HYPRE_Int recompute_residual ); +HYPRE_Int +hypre_HybridSetRecomputeResidual_long_dbl( void *hybrid_vdata, HYPRE_Int recompute_residual ); + +HYPRE_Int +hypre_HybridSetRecomputeResidualP_flt( void *hybrid_vdata, HYPRE_Int recompute_residual_p ); +HYPRE_Int +hypre_HybridSetRecomputeResidualP_dbl( void *hybrid_vdata, HYPRE_Int recompute_residual_p ); +HYPRE_Int +hypre_HybridSetRecomputeResidualP_long_dbl( void *hybrid_vdata, HYPRE_Int recompute_residual_p ); + +HYPRE_Int +hypre_HybridSetRelChange_flt( void *hybrid_vdata, HYPRE_Int rel_change ); +HYPRE_Int +hypre_HybridSetRelChange_dbl( void *hybrid_vdata, HYPRE_Int rel_change ); +HYPRE_Int +hypre_HybridSetRelChange_long_dbl( void *hybrid_vdata, HYPRE_Int rel_change ); + +HYPRE_Int +hypre_HybridSetSolverType_flt( void *hybrid_vdata, HYPRE_Int solver_type ); +HYPRE_Int +hypre_HybridSetSolverType_dbl( void *hybrid_vdata, HYPRE_Int solver_type ); +HYPRE_Int +hypre_HybridSetSolverType_long_dbl( void *hybrid_vdata, HYPRE_Int solver_type ); + +HYPRE_Int +hypre_HybridSetStopCrit_flt( void *hybrid_vdata, HYPRE_Int stop_crit ); +HYPRE_Int +hypre_HybridSetStopCrit_dbl( void *hybrid_vdata, HYPRE_Int stop_crit ); +HYPRE_Int +hypre_HybridSetStopCrit_long_dbl( void *hybrid_vdata, HYPRE_Int stop_crit ); + +HYPRE_Int +hypre_HybridSetTol_flt( void *hybrid_vdata, hypre_float tol ); +HYPRE_Int +hypre_HybridSetTol_dbl( void *hybrid_vdata, hypre_double tol ); +HYPRE_Int +hypre_HybridSetTol_long_dbl( void *hybrid_vdata, hypre_long_double tol ); + +HYPRE_Int +hypre_HybridSetTwoNorm_flt( void *hybrid_vdata, HYPRE_Int two_norm ); +HYPRE_Int +hypre_HybridSetTwoNorm_dbl( void *hybrid_vdata, HYPRE_Int two_norm ); +HYPRE_Int +hypre_HybridSetTwoNorm_long_dbl( void *hybrid_vdata, HYPRE_Int two_norm ); + +HYPRE_Int +hypre_HybridSetup_flt( void *hybrid_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_HybridSetup_dbl( void *hybrid_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_HybridSetup_long_dbl( void *hybrid_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); + +HYPRE_Int +hypre_HybridSolve_flt( void *hybrid_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_HybridSolve_dbl( void *hybrid_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_HybridSolve_long_dbl( void *hybrid_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); + +HYPRE_Int +hypre_PFMG2BuildRAPNoSym_flt( 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_dbl( 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_long_dbl( 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_flt( 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_CC0_dbl( 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_CC0_long_dbl( 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_flt( 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_dbl( 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_long_dbl( 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_flt( 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_dbl( 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_long_dbl( 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_flt( 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_dbl( 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_long_dbl( 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_flt( 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_dbl( 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_long_dbl( 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_flt( 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_CC0_dbl( 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_CC0_long_dbl( 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_flt( 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_dbl( 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_long_dbl( 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_flt( 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_dbl( 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_long_dbl( 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_flt( 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_dbl( 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_long_dbl( 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_flt( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ); +hypre_StructMatrix * +hypre_PFMG2CreateRAPOp_dbl( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ); +hypre_StructMatrix * +hypre_PFMG2CreateRAPOp_long_dbl( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ); + +HYPRE_Int +hypre_PFMG3BuildRAPNoSym_flt( 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_dbl( 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_long_dbl( 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_flt( 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_CC0_dbl( 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_CC0_long_dbl( 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_flt( 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_dbl( 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_long_dbl( 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_flt( 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_dbl( 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_long_dbl( 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_flt( 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_dbl( 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_long_dbl( 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_flt( 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_dbl( 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_long_dbl( 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_flt( 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_dbl( 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_long_dbl( 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_flt( 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_dbl( 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_long_dbl( 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_flt( 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_CC0_dbl( 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_CC0_long_dbl( 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_flt( 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_dbl( 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_long_dbl( 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_flt( 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_dbl( 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_long_dbl( 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_flt( 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_dbl( 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_long_dbl( 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_flt( 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_dbl( 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_long_dbl( 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_flt( 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_dbl( 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_long_dbl( 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_flt( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ); +hypre_StructMatrix * +hypre_PFMG3CreateRAPOp_dbl( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ); +hypre_StructMatrix * +hypre_PFMG3CreateRAPOp_long_dbl( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ); + +HYPRE_Int +hypre_PFMGBuildCoarseOp5_flt( 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_dbl( 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_long_dbl( hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); + +HYPRE_Int +hypre_PFMGBuildCoarseOp7_flt( hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int +hypre_PFMGBuildCoarseOp7_dbl( hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); +HYPRE_Int +hypre_PFMGBuildCoarseOp7_long_dbl( hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix *R, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride, hypre_StructMatrix *RAP ); + +HYPRE_Int +hypre_PFMGCoarsen_flt( hypre_Box *cbox, hypre_Index periodic, HYPRE_Int max_levels, HYPRE_Int dxyz_flag, hypre_float *dxyz, HYPRE_Int **cdir_l_ptr, HYPRE_Int **active_l_ptr, hypre_float **relax_weights_ptr, HYPRE_Int *num_levels ); +HYPRE_Int +hypre_PFMGCoarsen_dbl( hypre_Box *cbox, hypre_Index periodic, HYPRE_Int max_levels, HYPRE_Int dxyz_flag, hypre_double *dxyz, HYPRE_Int **cdir_l_ptr, HYPRE_Int **active_l_ptr, hypre_double **relax_weights_ptr, HYPRE_Int *num_levels ); +HYPRE_Int +hypre_PFMGCoarsen_long_dbl( hypre_Box *cbox, hypre_Index periodic, HYPRE_Int max_levels, HYPRE_Int dxyz_flag, hypre_long_double *dxyz, HYPRE_Int **cdir_l_ptr, HYPRE_Int **active_l_ptr, hypre_long_double **relax_weights_ptr, HYPRE_Int *num_levels ); + +HYPRE_Int +hypre_PFMGComputeCxyz_flt( hypre_StructMatrix *A, hypre_float *cxyz, hypre_float *sqcxyz ); +HYPRE_Int +hypre_PFMGComputeCxyz_dbl( hypre_StructMatrix *A, hypre_double *cxyz, hypre_double *sqcxyz ); +HYPRE_Int +hypre_PFMGComputeCxyz_long_dbl( hypre_StructMatrix *A, hypre_long_double *cxyz, hypre_long_double *sqcxyz ); + +HYPRE_Int +hypre_PFMGComputeDxyz_flt( hypre_StructMatrix *A, hypre_float *dxyz, HYPRE_Int *dxyz_flag ); +HYPRE_Int +hypre_PFMGComputeDxyz_dbl( hypre_StructMatrix *A, hypre_double *dxyz, HYPRE_Int *dxyz_flag ); +HYPRE_Int +hypre_PFMGComputeDxyz_long_dbl( hypre_StructMatrix *A, hypre_long_double *dxyz, HYPRE_Int *dxyz_flag ); + +HYPRE_Int +hypre_PFMGComputeMaxLevels_flt( hypre_StructGrid *grid, HYPRE_Int *max_levels_ptr ); +HYPRE_Int +hypre_PFMGComputeMaxLevels_dbl( hypre_StructGrid *grid, HYPRE_Int *max_levels_ptr ); +HYPRE_Int +hypre_PFMGComputeMaxLevels_long_dbl( hypre_StructGrid *grid, HYPRE_Int *max_levels_ptr ); + +void * +hypre_PFMGCreate_flt( MPI_Comm comm ); +void * +hypre_PFMGCreate_dbl( MPI_Comm comm ); +void * +hypre_PFMGCreate_long_dbl( MPI_Comm comm ); + +hypre_StructMatrix * +hypre_PFMGCreateCoarseOp5_flt( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ); +hypre_StructMatrix * +hypre_PFMGCreateCoarseOp5_dbl( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ); +hypre_StructMatrix * +hypre_PFMGCreateCoarseOp5_long_dbl( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ); + +hypre_StructMatrix * +hypre_PFMGCreateCoarseOp7_flt( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ); +hypre_StructMatrix * +hypre_PFMGCreateCoarseOp7_dbl( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ); +hypre_StructMatrix * +hypre_PFMGCreateCoarseOp7_long_dbl( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ); + +hypre_StructMatrix * +hypre_PFMGCreateInterpOp_flt( hypre_StructMatrix *A, HYPRE_Int cdir, hypre_Index stride, HYPRE_Int rap_type ); +hypre_StructMatrix * +hypre_PFMGCreateInterpOp_dbl( hypre_StructMatrix *A, HYPRE_Int cdir, hypre_Index stride, HYPRE_Int rap_type ); +hypre_StructMatrix * +hypre_PFMGCreateInterpOp_long_dbl( hypre_StructMatrix *A, HYPRE_Int cdir, hypre_Index stride, HYPRE_Int rap_type ); + +hypre_StructMatrix * +hypre_PFMGCreateRAPOp_flt( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir, HYPRE_Int rap_type ); +hypre_StructMatrix * +hypre_PFMGCreateRAPOp_dbl( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir, HYPRE_Int rap_type ); +hypre_StructMatrix * +hypre_PFMGCreateRAPOp_long_dbl( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir, HYPRE_Int rap_type ); + +HYPRE_Int +hypre_PFMGDestroy_flt( void *pfmg_vdata ); +HYPRE_Int +hypre_PFMGDestroy_dbl( void *pfmg_vdata ); +HYPRE_Int +hypre_PFMGDestroy_long_dbl( void *pfmg_vdata ); + +HYPRE_Int +hypre_PFMGGetFinalRelativeResidualNorm_flt( void *pfmg_vdata, hypre_float *relative_residual_norm ); +HYPRE_Int +hypre_PFMGGetFinalRelativeResidualNorm_dbl( void *pfmg_vdata, hypre_double *relative_residual_norm ); +HYPRE_Int +hypre_PFMGGetFinalRelativeResidualNorm_long_dbl( void *pfmg_vdata, hypre_long_double *relative_residual_norm ); + +HYPRE_Int +hypre_PFMGGetJacobiWeight_flt( void *pfmg_vdata, hypre_float *weight ); +HYPRE_Int +hypre_PFMGGetJacobiWeight_dbl( void *pfmg_vdata, hypre_double *weight ); +HYPRE_Int +hypre_PFMGGetJacobiWeight_long_dbl( void *pfmg_vdata, hypre_long_double *weight ); + +HYPRE_Int +hypre_PFMGGetLogging_flt( void *pfmg_vdata, HYPRE_Int *logging ); +HYPRE_Int +hypre_PFMGGetLogging_dbl( void *pfmg_vdata, HYPRE_Int *logging ); +HYPRE_Int +hypre_PFMGGetLogging_long_dbl( void *pfmg_vdata, HYPRE_Int *logging ); + +HYPRE_Int +hypre_PFMGGetMatmultType_flt( void *pfmg_vdata, HYPRE_Int *matmult_type ); +HYPRE_Int +hypre_PFMGGetMatmultType_dbl( void *pfmg_vdata, HYPRE_Int *matmult_type ); +HYPRE_Int +hypre_PFMGGetMatmultType_long_dbl( void *pfmg_vdata, HYPRE_Int *matmult_type ); + +HYPRE_Int +hypre_PFMGGetMaxIter_flt( void *pfmg_vdata, HYPRE_Int *max_iter ); +HYPRE_Int +hypre_PFMGGetMaxIter_dbl( void *pfmg_vdata, HYPRE_Int *max_iter ); +HYPRE_Int +hypre_PFMGGetMaxIter_long_dbl( void *pfmg_vdata, HYPRE_Int *max_iter ); + +HYPRE_Int +hypre_PFMGGetMaxLevels_flt( void *pfmg_vdata, HYPRE_Int *max_levels ); +HYPRE_Int +hypre_PFMGGetMaxLevels_dbl( void *pfmg_vdata, HYPRE_Int *max_levels ); +HYPRE_Int +hypre_PFMGGetMaxLevels_long_dbl( void *pfmg_vdata, HYPRE_Int *max_levels ); + +HYPRE_Int +hypre_PFMGGetNumIterations_flt( void *pfmg_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_PFMGGetNumIterations_dbl( void *pfmg_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_PFMGGetNumIterations_long_dbl( void *pfmg_vdata, HYPRE_Int *num_iterations ); + +HYPRE_Int +hypre_PFMGGetNumPostRelax_flt( void *pfmg_vdata, HYPRE_Int *num_post_relax ); +HYPRE_Int +hypre_PFMGGetNumPostRelax_dbl( void *pfmg_vdata, HYPRE_Int *num_post_relax ); +HYPRE_Int +hypre_PFMGGetNumPostRelax_long_dbl( void *pfmg_vdata, HYPRE_Int *num_post_relax ); + +HYPRE_Int +hypre_PFMGGetNumPreRelax_flt( void *pfmg_vdata, HYPRE_Int *num_pre_relax ); +HYPRE_Int +hypre_PFMGGetNumPreRelax_dbl( void *pfmg_vdata, HYPRE_Int *num_pre_relax ); +HYPRE_Int +hypre_PFMGGetNumPreRelax_long_dbl( void *pfmg_vdata, HYPRE_Int *num_pre_relax ); + +HYPRE_Int +hypre_PFMGGetPrintFreq_flt( void *pfmg_vdata, HYPRE_Int *print_freq ); +HYPRE_Int +hypre_PFMGGetPrintFreq_dbl( void *pfmg_vdata, HYPRE_Int *print_freq ); +HYPRE_Int +hypre_PFMGGetPrintFreq_long_dbl( void *pfmg_vdata, HYPRE_Int *print_freq ); + +HYPRE_Int +hypre_PFMGGetPrintLevel_flt( void *pfmg_vdata, HYPRE_Int *print_level ); +HYPRE_Int +hypre_PFMGGetPrintLevel_dbl( void *pfmg_vdata, HYPRE_Int *print_level ); +HYPRE_Int +hypre_PFMGGetPrintLevel_long_dbl( void *pfmg_vdata, HYPRE_Int *print_level ); + +HYPRE_Int +hypre_PFMGGetRAPType_flt( void *pfmg_vdata, HYPRE_Int *rap_type ); +HYPRE_Int +hypre_PFMGGetRAPType_dbl( void *pfmg_vdata, HYPRE_Int *rap_type ); +HYPRE_Int +hypre_PFMGGetRAPType_long_dbl( void *pfmg_vdata, HYPRE_Int *rap_type ); + +HYPRE_Int +hypre_PFMGGetRelChange_flt( void *pfmg_vdata, HYPRE_Int *rel_change ); +HYPRE_Int +hypre_PFMGGetRelChange_dbl( void *pfmg_vdata, HYPRE_Int *rel_change ); +HYPRE_Int +hypre_PFMGGetRelChange_long_dbl( void *pfmg_vdata, HYPRE_Int *rel_change ); + +HYPRE_Int +hypre_PFMGGetRelaxType_flt( void *pfmg_vdata, HYPRE_Int *relax_type ); +HYPRE_Int +hypre_PFMGGetRelaxType_dbl( void *pfmg_vdata, HYPRE_Int *relax_type ); +HYPRE_Int +hypre_PFMGGetRelaxType_long_dbl( void *pfmg_vdata, HYPRE_Int *relax_type ); + +HYPRE_Int +hypre_PFMGGetSkipRelax_flt( void *pfmg_vdata, HYPRE_Int *skip_relax ); +HYPRE_Int +hypre_PFMGGetSkipRelax_dbl( void *pfmg_vdata, HYPRE_Int *skip_relax ); +HYPRE_Int +hypre_PFMGGetSkipRelax_long_dbl( void *pfmg_vdata, HYPRE_Int *skip_relax ); + +HYPRE_Int +hypre_PFMGGetTol_flt( void *pfmg_vdata, hypre_float *tol ); +HYPRE_Int +hypre_PFMGGetTol_dbl( void *pfmg_vdata, hypre_double *tol ); +HYPRE_Int +hypre_PFMGGetTol_long_dbl( void *pfmg_vdata, hypre_long_double *tol ); + +HYPRE_Int +hypre_PFMGGetZeroGuess_flt( void *pfmg_vdata, HYPRE_Int *zero_guess ); +HYPRE_Int +hypre_PFMGGetZeroGuess_dbl( void *pfmg_vdata, HYPRE_Int *zero_guess ); +HYPRE_Int +hypre_PFMGGetZeroGuess_long_dbl( void *pfmg_vdata, HYPRE_Int *zero_guess ); + +HYPRE_Int +hypre_PFMGPrintLogging_flt( void *pfmg_vdata ); +HYPRE_Int +hypre_PFMGPrintLogging_dbl( void *pfmg_vdata ); +HYPRE_Int +hypre_PFMGPrintLogging_long_dbl( void *pfmg_vdata ); + +HYPRE_Int +hypre_PFMGRelax_flt( void *pfmg_relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_PFMGRelax_dbl( void *pfmg_relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_PFMGRelax_long_dbl( void *pfmg_relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); + +void * +hypre_PFMGRelaxCreate_flt( MPI_Comm comm ); +void * +hypre_PFMGRelaxCreate_dbl( MPI_Comm comm ); +void * +hypre_PFMGRelaxCreate_long_dbl( MPI_Comm comm ); + +HYPRE_Int +hypre_PFMGRelaxDestroy_flt( void *pfmg_relax_vdata ); +HYPRE_Int +hypre_PFMGRelaxDestroy_dbl( void *pfmg_relax_vdata ); +HYPRE_Int +hypre_PFMGRelaxDestroy_long_dbl( void *pfmg_relax_vdata ); + +HYPRE_Int +hypre_PFMGRelaxSetJacobiWeight_flt( void *pfmg_relax_vdata, hypre_float weight ); +HYPRE_Int +hypre_PFMGRelaxSetJacobiWeight_dbl( void *pfmg_relax_vdata, hypre_double weight ); +HYPRE_Int +hypre_PFMGRelaxSetJacobiWeight_long_dbl( void *pfmg_relax_vdata, hypre_long_double weight ); + +HYPRE_Int +hypre_PFMGRelaxSetMaxIter_flt( void *pfmg_relax_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_PFMGRelaxSetMaxIter_dbl( void *pfmg_relax_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_PFMGRelaxSetMaxIter_long_dbl( void *pfmg_relax_vdata, HYPRE_Int max_iter ); + +HYPRE_Int +hypre_PFMGRelaxSetPostRelax_flt( void *pfmg_relax_vdata ); +HYPRE_Int +hypre_PFMGRelaxSetPostRelax_dbl( void *pfmg_relax_vdata ); +HYPRE_Int +hypre_PFMGRelaxSetPostRelax_long_dbl( void *pfmg_relax_vdata ); + +HYPRE_Int +hypre_PFMGRelaxSetPreRelax_flt( void *pfmg_relax_vdata ); +HYPRE_Int +hypre_PFMGRelaxSetPreRelax_dbl( void *pfmg_relax_vdata ); +HYPRE_Int +hypre_PFMGRelaxSetPreRelax_long_dbl( void *pfmg_relax_vdata ); + +HYPRE_Int +hypre_PFMGRelaxSetTempVec_flt( void *pfmg_relax_vdata, hypre_StructVector *t ); +HYPRE_Int +hypre_PFMGRelaxSetTempVec_dbl( void *pfmg_relax_vdata, hypre_StructVector *t ); +HYPRE_Int +hypre_PFMGRelaxSetTempVec_long_dbl( void *pfmg_relax_vdata, hypre_StructVector *t ); + +HYPRE_Int +hypre_PFMGRelaxSetTol_flt( void *pfmg_relax_vdata, hypre_float tol ); +HYPRE_Int +hypre_PFMGRelaxSetTol_dbl( void *pfmg_relax_vdata, hypre_double tol ); +HYPRE_Int +hypre_PFMGRelaxSetTol_long_dbl( void *pfmg_relax_vdata, hypre_long_double tol ); + +HYPRE_Int +hypre_PFMGRelaxSetType_flt( void *pfmg_relax_vdata, HYPRE_Int relax_type ); +HYPRE_Int +hypre_PFMGRelaxSetType_dbl( void *pfmg_relax_vdata, HYPRE_Int relax_type ); +HYPRE_Int +hypre_PFMGRelaxSetType_long_dbl( void *pfmg_relax_vdata, HYPRE_Int relax_type ); + +HYPRE_Int +hypre_PFMGRelaxSetZeroGuess_flt( void *pfmg_relax_vdata, HYPRE_Int zero_guess ); +HYPRE_Int +hypre_PFMGRelaxSetZeroGuess_dbl( void *pfmg_relax_vdata, HYPRE_Int zero_guess ); +HYPRE_Int +hypre_PFMGRelaxSetZeroGuess_long_dbl( void *pfmg_relax_vdata, HYPRE_Int zero_guess ); + +HYPRE_Int +hypre_PFMGRelaxSetup_flt( void *pfmg_relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_PFMGRelaxSetup_dbl( void *pfmg_relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_PFMGRelaxSetup_long_dbl( void *pfmg_relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); + +HYPRE_Int +hypre_PFMGSetDxyz_flt( void *pfmg_vdata, hypre_float *dxyz ); +HYPRE_Int +hypre_PFMGSetDxyz_dbl( void *pfmg_vdata, hypre_double *dxyz ); +HYPRE_Int +hypre_PFMGSetDxyz_long_dbl( void *pfmg_vdata, hypre_long_double *dxyz ); + +HYPRE_Int +hypre_PFMGSetJacobiWeight_flt( void *pfmg_vdata, hypre_float weight ); +HYPRE_Int +hypre_PFMGSetJacobiWeight_dbl( void *pfmg_vdata, hypre_double weight ); +HYPRE_Int +hypre_PFMGSetJacobiWeight_long_dbl( void *pfmg_vdata, hypre_long_double weight ); + +HYPRE_Int +hypre_PFMGSetLogging_flt( void *pfmg_vdata, HYPRE_Int logging ); +HYPRE_Int +hypre_PFMGSetLogging_dbl( void *pfmg_vdata, HYPRE_Int logging ); +HYPRE_Int +hypre_PFMGSetLogging_long_dbl( void *pfmg_vdata, HYPRE_Int logging ); + +HYPRE_Int +hypre_PFMGSetMatmultType_flt( void *pfmg_vdata, HYPRE_Int matmult_type ); +HYPRE_Int +hypre_PFMGSetMatmultType_dbl( void *pfmg_vdata, HYPRE_Int matmult_type ); +HYPRE_Int +hypre_PFMGSetMatmultType_long_dbl( void *pfmg_vdata, HYPRE_Int matmult_type ); + +HYPRE_Int +hypre_PFMGSetMaxIter_flt( void *pfmg_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_PFMGSetMaxIter_dbl( void *pfmg_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_PFMGSetMaxIter_long_dbl( void *pfmg_vdata, HYPRE_Int max_iter ); + +HYPRE_Int +hypre_PFMGSetMaxLevels_flt( void *pfmg_vdata, HYPRE_Int max_levels ); +HYPRE_Int +hypre_PFMGSetMaxLevels_dbl( void *pfmg_vdata, HYPRE_Int max_levels ); +HYPRE_Int +hypre_PFMGSetMaxLevels_long_dbl( void *pfmg_vdata, HYPRE_Int max_levels ); + +HYPRE_Int +hypre_PFMGSetNumPostRelax_flt( void *pfmg_vdata, HYPRE_Int num_post_relax ); +HYPRE_Int +hypre_PFMGSetNumPostRelax_dbl( void *pfmg_vdata, HYPRE_Int num_post_relax ); +HYPRE_Int +hypre_PFMGSetNumPostRelax_long_dbl( void *pfmg_vdata, HYPRE_Int num_post_relax ); + +HYPRE_Int +hypre_PFMGSetNumPreRelax_flt( void *pfmg_vdata, HYPRE_Int num_pre_relax ); +HYPRE_Int +hypre_PFMGSetNumPreRelax_dbl( void *pfmg_vdata, HYPRE_Int num_pre_relax ); +HYPRE_Int +hypre_PFMGSetNumPreRelax_long_dbl( void *pfmg_vdata, HYPRE_Int num_pre_relax ); + +HYPRE_Int +hypre_PFMGSetPrintFreq_flt( void *pfmg_vdata, HYPRE_Int print_freq ); +HYPRE_Int +hypre_PFMGSetPrintFreq_dbl( void *pfmg_vdata, HYPRE_Int print_freq ); +HYPRE_Int +hypre_PFMGSetPrintFreq_long_dbl( void *pfmg_vdata, HYPRE_Int print_freq ); + +HYPRE_Int +hypre_PFMGSetPrintLevel_flt( void *pfmg_vdata, HYPRE_Int print_level ); +HYPRE_Int +hypre_PFMGSetPrintLevel_dbl( void *pfmg_vdata, HYPRE_Int print_level ); +HYPRE_Int +hypre_PFMGSetPrintLevel_long_dbl( void *pfmg_vdata, HYPRE_Int print_level ); + +HYPRE_Int +hypre_PFMGSetRAPType_flt( void *pfmg_vdata, HYPRE_Int rap_type ); +HYPRE_Int +hypre_PFMGSetRAPType_dbl( void *pfmg_vdata, HYPRE_Int rap_type ); +HYPRE_Int +hypre_PFMGSetRAPType_long_dbl( void *pfmg_vdata, HYPRE_Int rap_type ); + +HYPRE_Int +hypre_PFMGSetRelChange_flt( void *pfmg_vdata, HYPRE_Int rel_change ); +HYPRE_Int +hypre_PFMGSetRelChange_dbl( void *pfmg_vdata, HYPRE_Int rel_change ); +HYPRE_Int +hypre_PFMGSetRelChange_long_dbl( void *pfmg_vdata, HYPRE_Int rel_change ); + +HYPRE_Int +hypre_PFMGSetRelaxType_flt( void *pfmg_vdata, HYPRE_Int relax_type ); +HYPRE_Int +hypre_PFMGSetRelaxType_dbl( void *pfmg_vdata, HYPRE_Int relax_type ); +HYPRE_Int +hypre_PFMGSetRelaxType_long_dbl( void *pfmg_vdata, HYPRE_Int relax_type ); + +HYPRE_Int +hypre_PFMGSetSkipRelax_flt( void *pfmg_vdata, HYPRE_Int skip_relax ); +HYPRE_Int +hypre_PFMGSetSkipRelax_dbl( void *pfmg_vdata, HYPRE_Int skip_relax ); +HYPRE_Int +hypre_PFMGSetSkipRelax_long_dbl( void *pfmg_vdata, HYPRE_Int skip_relax ); + +HYPRE_Int +hypre_PFMGSetTol_flt( void *pfmg_vdata, hypre_float tol ); +HYPRE_Int +hypre_PFMGSetTol_dbl( void *pfmg_vdata, hypre_double tol ); +HYPRE_Int +hypre_PFMGSetTol_long_dbl( void *pfmg_vdata, hypre_long_double tol ); + +HYPRE_Int +hypre_PFMGSetZeroGuess_flt( void *pfmg_vdata, HYPRE_Int zero_guess ); +HYPRE_Int +hypre_PFMGSetZeroGuess_dbl( void *pfmg_vdata, HYPRE_Int zero_guess ); +HYPRE_Int +hypre_PFMGSetZeroGuess_long_dbl( void *pfmg_vdata, HYPRE_Int zero_guess ); + +HYPRE_Int +hypre_PFMGSetup_flt( void *pfmg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_PFMGSetup_dbl( void *pfmg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_PFMGSetup_long_dbl( void *pfmg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); + +HYPRE_Int +hypre_PFMGSetupInterpOp_flt( hypre_StructMatrix *P, hypre_StructMatrix *A, HYPRE_Int cdir ); +HYPRE_Int +hypre_PFMGSetupInterpOp_dbl( hypre_StructMatrix *P, hypre_StructMatrix *A, HYPRE_Int cdir ); +HYPRE_Int +hypre_PFMGSetupInterpOp_long_dbl( hypre_StructMatrix *P, hypre_StructMatrix *A, HYPRE_Int cdir ); + +HYPRE_Int +hypre_PFMGSetupInterpOp_core_CC_flt( hypre_StructMatrix *P, hypre_StructMatrix *A, HYPRE_Int cdir, hypre_float *Pconst0_ptr, hypre_float *Pconst1_ptr, hypre_float *Pconst2_ptr ); +HYPRE_Int +hypre_PFMGSetupInterpOp_core_CC_dbl( hypre_StructMatrix *P, hypre_StructMatrix *A, HYPRE_Int cdir, hypre_double *Pconst0_ptr, hypre_double *Pconst1_ptr, hypre_double *Pconst2_ptr ); +HYPRE_Int +hypre_PFMGSetupInterpOp_core_CC_long_dbl( hypre_StructMatrix *P, hypre_StructMatrix *A, HYPRE_Int cdir, hypre_long_double *Pconst0_ptr, hypre_long_double *Pconst1_ptr, hypre_long_double *Pconst2_ptr ); + +HYPRE_Int +hypre_PFMGSetupInterpOp_core_VC_flt( hypre_StructMatrix *P, hypre_StructMatrix *A, HYPRE_Int cdir, hypre_float Pconst0, hypre_float Pconst1, hypre_float Pconst2 ); +HYPRE_Int +hypre_PFMGSetupInterpOp_core_VC_dbl( hypre_StructMatrix *P, hypre_StructMatrix *A, HYPRE_Int cdir, hypre_double Pconst0, hypre_double Pconst1, hypre_double Pconst2 ); +HYPRE_Int +hypre_PFMGSetupInterpOp_core_VC_long_dbl( hypre_StructMatrix *P, hypre_StructMatrix *A, HYPRE_Int cdir, hypre_long_double Pconst0, hypre_long_double Pconst1, hypre_long_double Pconst2 ); + +HYPRE_Int +hypre_PFMGSetupRAPOp_flt( 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_Int +hypre_PFMGSetupRAPOp_dbl( 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_Int +hypre_PFMGSetupRAPOp_long_dbl( 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_Int +hypre_PFMGSolve_flt( void *pfmg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_PFMGSolve_dbl( void *pfmg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_PFMGSolve_long_dbl( void *pfmg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); + +HYPRE_Int +hypre_RedBlackConstantCoefGS_flt( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_RedBlackConstantCoefGS_dbl( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_RedBlackConstantCoefGS_long_dbl( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); + +HYPRE_Int +hypre_RedBlackGS_flt( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_RedBlackGS_dbl( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_RedBlackGS_long_dbl( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); + +void * +hypre_RedBlackGSCreate_flt( MPI_Comm comm ); +void * +hypre_RedBlackGSCreate_dbl( MPI_Comm comm ); +void * +hypre_RedBlackGSCreate_long_dbl( MPI_Comm comm ); + +HYPRE_Int +hypre_RedBlackGSDestroy_flt( void *relax_vdata ); +HYPRE_Int +hypre_RedBlackGSDestroy_dbl( void *relax_vdata ); +HYPRE_Int +hypre_RedBlackGSDestroy_long_dbl( void *relax_vdata ); + +HYPRE_Int +hypre_RedBlackGSSetMaxIter_flt( void *relax_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_RedBlackGSSetMaxIter_dbl( void *relax_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_RedBlackGSSetMaxIter_long_dbl( void *relax_vdata, HYPRE_Int max_iter ); + +HYPRE_Int +hypre_RedBlackGSSetStartBlack_flt( void *relax_vdata ); +HYPRE_Int +hypre_RedBlackGSSetStartBlack_dbl( void *relax_vdata ); +HYPRE_Int +hypre_RedBlackGSSetStartBlack_long_dbl( void *relax_vdata ); + +HYPRE_Int +hypre_RedBlackGSSetStartRed_flt( void *relax_vdata ); +HYPRE_Int +hypre_RedBlackGSSetStartRed_dbl( void *relax_vdata ); +HYPRE_Int +hypre_RedBlackGSSetStartRed_long_dbl( void *relax_vdata ); + +HYPRE_Int +hypre_RedBlackGSSetTol_flt( void *relax_vdata, hypre_float tol ); +HYPRE_Int +hypre_RedBlackGSSetTol_dbl( void *relax_vdata, hypre_double tol ); +HYPRE_Int +hypre_RedBlackGSSetTol_long_dbl( void *relax_vdata, hypre_long_double tol ); + +HYPRE_Int +hypre_RedBlackGSSetZeroGuess_flt( void *relax_vdata, HYPRE_Int zero_guess ); +HYPRE_Int +hypre_RedBlackGSSetZeroGuess_dbl( void *relax_vdata, HYPRE_Int zero_guess ); +HYPRE_Int +hypre_RedBlackGSSetZeroGuess_long_dbl( void *relax_vdata, HYPRE_Int zero_guess ); + +HYPRE_Int +hypre_RedBlackGSSetup_flt( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_RedBlackGSSetup_dbl( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_RedBlackGSSetup_long_dbl( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); + +HYPRE_Int +hypre_SMG2BuildRAPNoSym_flt( hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructMatrix *R, hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); +HYPRE_Int +hypre_SMG2BuildRAPNoSym_dbl( hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructMatrix *R, hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); +HYPRE_Int +hypre_SMG2BuildRAPNoSym_long_dbl( hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructMatrix *R, hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); + +HYPRE_Int +hypre_SMG2BuildRAPSym_flt( hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructMatrix *R, hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); +HYPRE_Int +hypre_SMG2BuildRAPSym_dbl( hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructMatrix *R, hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); +HYPRE_Int +hypre_SMG2BuildRAPSym_long_dbl( hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructMatrix *R, hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); + +hypre_StructMatrix * +hypre_SMG2CreateRAPOp_flt( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructGrid *coarse_grid ); +hypre_StructMatrix * +hypre_SMG2CreateRAPOp_dbl( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructGrid *coarse_grid ); +hypre_StructMatrix * +hypre_SMG2CreateRAPOp_long_dbl( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructGrid *coarse_grid ); + +HYPRE_Int +hypre_SMG2RAPPeriodicNoSym_flt( hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); +HYPRE_Int +hypre_SMG2RAPPeriodicNoSym_dbl( hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); +HYPRE_Int +hypre_SMG2RAPPeriodicNoSym_long_dbl( hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); + +HYPRE_Int +hypre_SMG2RAPPeriodicSym_flt( hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); +HYPRE_Int +hypre_SMG2RAPPeriodicSym_dbl( hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); +HYPRE_Int +hypre_SMG2RAPPeriodicSym_long_dbl( hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); + +HYPRE_Int +hypre_SMG3BuildRAPNoSym_flt( hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructMatrix *R, hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); +HYPRE_Int +hypre_SMG3BuildRAPNoSym_dbl( hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructMatrix *R, hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); +HYPRE_Int +hypre_SMG3BuildRAPNoSym_long_dbl( hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructMatrix *R, hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); + +HYPRE_Int +hypre_SMG3BuildRAPSym_flt( hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructMatrix *R, hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); +HYPRE_Int +hypre_SMG3BuildRAPSym_dbl( hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructMatrix *R, hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); +HYPRE_Int +hypre_SMG3BuildRAPSym_long_dbl( hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructMatrix *R, hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); + +hypre_StructMatrix * +hypre_SMG3CreateRAPOp_flt( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructGrid *coarse_grid ); +hypre_StructMatrix * +hypre_SMG3CreateRAPOp_dbl( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructGrid *coarse_grid ); +hypre_StructMatrix * +hypre_SMG3CreateRAPOp_long_dbl( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructGrid *coarse_grid ); + +HYPRE_Int +hypre_SMG3RAPPeriodicNoSym_flt( hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); +HYPRE_Int +hypre_SMG3RAPPeriodicNoSym_dbl( hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); +HYPRE_Int +hypre_SMG3RAPPeriodicNoSym_long_dbl( hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); + +HYPRE_Int +hypre_SMG3RAPPeriodicSym_flt( hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); +HYPRE_Int +hypre_SMG3RAPPeriodicSym_dbl( hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); +HYPRE_Int +hypre_SMG3RAPPeriodicSym_long_dbl( hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ); + +HYPRE_Int +hypre_SMGAxpy_flt( hypre_float alpha, hypre_StructVector *x, hypre_StructVector *y, hypre_Index base_index, hypre_Index base_stride ); +HYPRE_Int +hypre_SMGAxpy_dbl( hypre_double alpha, hypre_StructVector *x, hypre_StructVector *y, hypre_Index base_index, hypre_Index base_stride ); +HYPRE_Int +hypre_SMGAxpy_long_dbl( hypre_long_double alpha, hypre_StructVector *x, hypre_StructVector *y, hypre_Index base_index, hypre_Index base_stride ); + +void * +hypre_SMGCreate_flt( MPI_Comm comm ); +void * +hypre_SMGCreate_dbl( MPI_Comm comm ); +void * +hypre_SMGCreate_long_dbl( MPI_Comm comm ); + +hypre_StructMatrix * +hypre_SMGCreateInterpOp_flt( hypre_StructMatrix *A, hypre_StructGrid *cgrid, HYPRE_Int cdir ); +hypre_StructMatrix * +hypre_SMGCreateInterpOp_dbl( hypre_StructMatrix *A, hypre_StructGrid *cgrid, HYPRE_Int cdir ); +hypre_StructMatrix * +hypre_SMGCreateInterpOp_long_dbl( hypre_StructMatrix *A, hypre_StructGrid *cgrid, HYPRE_Int cdir ); + +hypre_StructMatrix * +hypre_SMGCreateRAPOp_flt( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructGrid *coarse_grid ); +hypre_StructMatrix * +hypre_SMGCreateRAPOp_dbl( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructGrid *coarse_grid ); +hypre_StructMatrix * +hypre_SMGCreateRAPOp_long_dbl( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructGrid *coarse_grid ); + +hypre_StructMatrix * +hypre_SMGCreateRestrictOp_flt( hypre_StructMatrix *A, hypre_StructGrid *cgrid, HYPRE_Int cdir ); +hypre_StructMatrix * +hypre_SMGCreateRestrictOp_dbl( hypre_StructMatrix *A, hypre_StructGrid *cgrid, HYPRE_Int cdir ); +hypre_StructMatrix * +hypre_SMGCreateRestrictOp_long_dbl( hypre_StructMatrix *A, hypre_StructGrid *cgrid, HYPRE_Int cdir ); + +HYPRE_Int +hypre_SMGDestroy_flt( void *smg_vdata ); +HYPRE_Int +hypre_SMGDestroy_dbl( void *smg_vdata ); +HYPRE_Int +hypre_SMGDestroy_long_dbl( void *smg_vdata ); + +HYPRE_Int +hypre_SMGGetFinalRelativeResidualNorm_flt( void *smg_vdata, hypre_float *relative_residual_norm ); +HYPRE_Int +hypre_SMGGetFinalRelativeResidualNorm_dbl( void *smg_vdata, hypre_double *relative_residual_norm ); +HYPRE_Int +hypre_SMGGetFinalRelativeResidualNorm_long_dbl( void *smg_vdata, hypre_long_double *relative_residual_norm ); + +HYPRE_Int +hypre_SMGGetLogging_flt( void *smg_vdata, HYPRE_Int *logging ); +HYPRE_Int +hypre_SMGGetLogging_dbl( void *smg_vdata, HYPRE_Int *logging ); +HYPRE_Int +hypre_SMGGetLogging_long_dbl( void *smg_vdata, HYPRE_Int *logging ); + +HYPRE_Int +hypre_SMGGetMaxIter_flt( void *smg_vdata, HYPRE_Int *max_iter ); +HYPRE_Int +hypre_SMGGetMaxIter_dbl( void *smg_vdata, HYPRE_Int *max_iter ); +HYPRE_Int +hypre_SMGGetMaxIter_long_dbl( void *smg_vdata, HYPRE_Int *max_iter ); + +HYPRE_Int +hypre_SMGGetMemoryUse_flt( void *smg_vdata, HYPRE_Int *memory_use ); +HYPRE_Int +hypre_SMGGetMemoryUse_dbl( void *smg_vdata, HYPRE_Int *memory_use ); +HYPRE_Int +hypre_SMGGetMemoryUse_long_dbl( void *smg_vdata, HYPRE_Int *memory_use ); + +HYPRE_Int +hypre_SMGGetNumIterations_flt( void *smg_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_SMGGetNumIterations_dbl( void *smg_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_SMGGetNumIterations_long_dbl( void *smg_vdata, HYPRE_Int *num_iterations ); + +HYPRE_Int +hypre_SMGGetNumPostRelax_flt( void *smg_vdata, HYPRE_Int *num_post_relax ); +HYPRE_Int +hypre_SMGGetNumPostRelax_dbl( void *smg_vdata, HYPRE_Int *num_post_relax ); +HYPRE_Int +hypre_SMGGetNumPostRelax_long_dbl( void *smg_vdata, HYPRE_Int *num_post_relax ); + +HYPRE_Int +hypre_SMGGetNumPreRelax_flt( void *smg_vdata, HYPRE_Int *num_pre_relax ); +HYPRE_Int +hypre_SMGGetNumPreRelax_dbl( void *smg_vdata, HYPRE_Int *num_pre_relax ); +HYPRE_Int +hypre_SMGGetNumPreRelax_long_dbl( void *smg_vdata, HYPRE_Int *num_pre_relax ); + +HYPRE_Int +hypre_SMGGetPrintLevel_flt( void *smg_vdata, HYPRE_Int *print_level ); +HYPRE_Int +hypre_SMGGetPrintLevel_dbl( void *smg_vdata, HYPRE_Int *print_level ); +HYPRE_Int +hypre_SMGGetPrintLevel_long_dbl( void *smg_vdata, HYPRE_Int *print_level ); + +HYPRE_Int +hypre_SMGGetRelChange_flt( void *smg_vdata, HYPRE_Int *rel_change ); +HYPRE_Int +hypre_SMGGetRelChange_dbl( void *smg_vdata, HYPRE_Int *rel_change ); +HYPRE_Int +hypre_SMGGetRelChange_long_dbl( void *smg_vdata, HYPRE_Int *rel_change ); + +HYPRE_Int +hypre_SMGGetTol_flt( void *smg_vdata, hypre_float *tol ); +HYPRE_Int +hypre_SMGGetTol_dbl( void *smg_vdata, hypre_double *tol ); +HYPRE_Int +hypre_SMGGetTol_long_dbl( void *smg_vdata, hypre_long_double *tol ); + +HYPRE_Int +hypre_SMGGetZeroGuess_flt( void *smg_vdata, HYPRE_Int *zero_guess ); +HYPRE_Int +hypre_SMGGetZeroGuess_dbl( void *smg_vdata, HYPRE_Int *zero_guess ); +HYPRE_Int +hypre_SMGGetZeroGuess_long_dbl( void *smg_vdata, HYPRE_Int *zero_guess ); + +HYPRE_Int +hypre_SMGPrintLogging_flt( void *smg_vdata ); +HYPRE_Int +hypre_SMGPrintLogging_dbl( void *smg_vdata ); +HYPRE_Int +hypre_SMGPrintLogging_long_dbl( void *smg_vdata ); + +HYPRE_Int +hypre_SMGRelax_flt( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_SMGRelax_dbl( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_SMGRelax_long_dbl( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); + +void * +hypre_SMGRelaxCreate_flt( MPI_Comm comm ); +void * +hypre_SMGRelaxCreate_dbl( MPI_Comm comm ); +void * +hypre_SMGRelaxCreate_long_dbl( MPI_Comm comm ); + +HYPRE_Int +hypre_SMGRelaxDestroy_flt( void *relax_vdata ); +HYPRE_Int +hypre_SMGRelaxDestroy_dbl( void *relax_vdata ); +HYPRE_Int +hypre_SMGRelaxDestroy_long_dbl( void *relax_vdata ); + +HYPRE_Int +hypre_SMGRelaxDestroyARem_flt( void *relax_vdata ); +HYPRE_Int +hypre_SMGRelaxDestroyARem_dbl( void *relax_vdata ); +HYPRE_Int +hypre_SMGRelaxDestroyARem_long_dbl( void *relax_vdata ); + +HYPRE_Int +hypre_SMGRelaxDestroyASol_flt( void *relax_vdata ); +HYPRE_Int +hypre_SMGRelaxDestroyASol_dbl( void *relax_vdata ); +HYPRE_Int +hypre_SMGRelaxDestroyASol_long_dbl( void *relax_vdata ); + +HYPRE_Int +hypre_SMGRelaxDestroyTempVec_flt( void *relax_vdata ); +HYPRE_Int +hypre_SMGRelaxDestroyTempVec_dbl( void *relax_vdata ); +HYPRE_Int +hypre_SMGRelaxDestroyTempVec_long_dbl( void *relax_vdata ); + +HYPRE_Int +hypre_SMGRelaxSetBase_flt( void *relax_vdata, hypre_Index base_index, hypre_Index base_stride ); +HYPRE_Int +hypre_SMGRelaxSetBase_dbl( void *relax_vdata, hypre_Index base_index, hypre_Index base_stride ); +HYPRE_Int +hypre_SMGRelaxSetBase_long_dbl( void *relax_vdata, hypre_Index base_index, hypre_Index base_stride ); + +HYPRE_Int +hypre_SMGRelaxSetMaxIter_flt( void *relax_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_SMGRelaxSetMaxIter_dbl( void *relax_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_SMGRelaxSetMaxIter_long_dbl( void *relax_vdata, HYPRE_Int max_iter ); + +HYPRE_Int +hypre_SMGRelaxSetMaxLevel_flt( void *relax_vdata, HYPRE_Int num_max_level ); +HYPRE_Int +hypre_SMGRelaxSetMaxLevel_dbl( void *relax_vdata, HYPRE_Int num_max_level ); +HYPRE_Int +hypre_SMGRelaxSetMaxLevel_long_dbl( void *relax_vdata, HYPRE_Int num_max_level ); + +HYPRE_Int +hypre_SMGRelaxSetMemoryUse_flt( void *relax_vdata, HYPRE_Int memory_use ); +HYPRE_Int +hypre_SMGRelaxSetMemoryUse_dbl( void *relax_vdata, HYPRE_Int memory_use ); +HYPRE_Int +hypre_SMGRelaxSetMemoryUse_long_dbl( void *relax_vdata, HYPRE_Int memory_use ); + +HYPRE_Int +hypre_SMGRelaxSetNewMatrixStencil_flt( void *relax_vdata, hypre_StructStencil *diff_stencil ); +HYPRE_Int +hypre_SMGRelaxSetNewMatrixStencil_dbl( void *relax_vdata, hypre_StructStencil *diff_stencil ); +HYPRE_Int +hypre_SMGRelaxSetNewMatrixStencil_long_dbl( void *relax_vdata, hypre_StructStencil *diff_stencil ); + +HYPRE_Int +hypre_SMGRelaxSetNumPostRelax_flt( void *relax_vdata, HYPRE_Int num_post_relax ); +HYPRE_Int +hypre_SMGRelaxSetNumPostRelax_dbl( void *relax_vdata, HYPRE_Int num_post_relax ); +HYPRE_Int +hypre_SMGRelaxSetNumPostRelax_long_dbl( void *relax_vdata, HYPRE_Int num_post_relax ); + +HYPRE_Int +hypre_SMGRelaxSetNumPreRelax_flt( void *relax_vdata, HYPRE_Int num_pre_relax ); +HYPRE_Int +hypre_SMGRelaxSetNumPreRelax_dbl( void *relax_vdata, HYPRE_Int num_pre_relax ); +HYPRE_Int +hypre_SMGRelaxSetNumPreRelax_long_dbl( void *relax_vdata, HYPRE_Int num_pre_relax ); + +HYPRE_Int +hypre_SMGRelaxSetNumPreSpaces_flt( void *relax_vdata, HYPRE_Int num_pre_spaces ); +HYPRE_Int +hypre_SMGRelaxSetNumPreSpaces_dbl( void *relax_vdata, HYPRE_Int num_pre_spaces ); +HYPRE_Int +hypre_SMGRelaxSetNumPreSpaces_long_dbl( void *relax_vdata, HYPRE_Int num_pre_spaces ); + +HYPRE_Int +hypre_SMGRelaxSetNumRegSpaces_flt( void *relax_vdata, HYPRE_Int num_reg_spaces ); +HYPRE_Int +hypre_SMGRelaxSetNumRegSpaces_dbl( void *relax_vdata, HYPRE_Int num_reg_spaces ); +HYPRE_Int +hypre_SMGRelaxSetNumRegSpaces_long_dbl( void *relax_vdata, HYPRE_Int num_reg_spaces ); + +HYPRE_Int +hypre_SMGRelaxSetNumSpaces_flt( void *relax_vdata, HYPRE_Int num_spaces ); +HYPRE_Int +hypre_SMGRelaxSetNumSpaces_dbl( void *relax_vdata, HYPRE_Int num_spaces ); +HYPRE_Int +hypre_SMGRelaxSetNumSpaces_long_dbl( void *relax_vdata, HYPRE_Int num_spaces ); + +HYPRE_Int +hypre_SMGRelaxSetPreSpaceRank_flt( void *relax_vdata, HYPRE_Int i, HYPRE_Int pre_space_rank ); +HYPRE_Int +hypre_SMGRelaxSetPreSpaceRank_dbl( void *relax_vdata, HYPRE_Int i, HYPRE_Int pre_space_rank ); +HYPRE_Int +hypre_SMGRelaxSetPreSpaceRank_long_dbl( void *relax_vdata, HYPRE_Int i, HYPRE_Int pre_space_rank ); + +HYPRE_Int +hypre_SMGRelaxSetRegSpaceRank_flt( void *relax_vdata, HYPRE_Int i, HYPRE_Int reg_space_rank ); +HYPRE_Int +hypre_SMGRelaxSetRegSpaceRank_dbl( void *relax_vdata, HYPRE_Int i, HYPRE_Int reg_space_rank ); +HYPRE_Int +hypre_SMGRelaxSetRegSpaceRank_long_dbl( void *relax_vdata, HYPRE_Int i, HYPRE_Int reg_space_rank ); + +HYPRE_Int +hypre_SMGRelaxSetSpace_flt( void *relax_vdata, HYPRE_Int i, HYPRE_Int space_index, HYPRE_Int space_stride ); +HYPRE_Int +hypre_SMGRelaxSetSpace_dbl( void *relax_vdata, HYPRE_Int i, HYPRE_Int space_index, HYPRE_Int space_stride ); +HYPRE_Int +hypre_SMGRelaxSetSpace_long_dbl( void *relax_vdata, HYPRE_Int i, HYPRE_Int space_index, HYPRE_Int space_stride ); + +HYPRE_Int +hypre_SMGRelaxSetTempVec_flt( void *relax_vdata, hypre_StructVector *temp_vec ); +HYPRE_Int +hypre_SMGRelaxSetTempVec_dbl( void *relax_vdata, hypre_StructVector *temp_vec ); +HYPRE_Int +hypre_SMGRelaxSetTempVec_long_dbl( void *relax_vdata, hypre_StructVector *temp_vec ); + +HYPRE_Int +hypre_SMGRelaxSetTol_flt( void *relax_vdata, hypre_float tol ); +HYPRE_Int +hypre_SMGRelaxSetTol_dbl( void *relax_vdata, hypre_double tol ); +HYPRE_Int +hypre_SMGRelaxSetTol_long_dbl( void *relax_vdata, hypre_long_double tol ); + +HYPRE_Int +hypre_SMGRelaxSetZeroGuess_flt( void *relax_vdata, HYPRE_Int zero_guess ); +HYPRE_Int +hypre_SMGRelaxSetZeroGuess_dbl( void *relax_vdata, HYPRE_Int zero_guess ); +HYPRE_Int +hypre_SMGRelaxSetZeroGuess_long_dbl( void *relax_vdata, HYPRE_Int zero_guess ); + +HYPRE_Int +hypre_SMGRelaxSetup_flt( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_SMGRelaxSetup_dbl( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_SMGRelaxSetup_long_dbl( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); + +HYPRE_Int +hypre_SMGRelaxSetupARem_flt( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_SMGRelaxSetupARem_dbl( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_SMGRelaxSetupARem_long_dbl( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); + +HYPRE_Int +hypre_SMGRelaxSetupASol_flt( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_SMGRelaxSetupASol_dbl( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_SMGRelaxSetupASol_long_dbl( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); + +HYPRE_Int +hypre_SMGRelaxSetupBaseBoxArray_flt( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_SMGRelaxSetupBaseBoxArray_dbl( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_SMGRelaxSetupBaseBoxArray_long_dbl( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); + +HYPRE_Int +hypre_SMGRelaxSetupTempVec_flt( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_SMGRelaxSetupTempVec_dbl( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_SMGRelaxSetupTempVec_long_dbl( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); + +HYPRE_Int +hypre_SMGResidual_flt( void *residual_vdata, hypre_StructMatrix *A, hypre_StructVector *x, hypre_StructVector *b, hypre_StructVector *r ); +HYPRE_Int +hypre_SMGResidual_dbl( void *residual_vdata, hypre_StructMatrix *A, hypre_StructVector *x, hypre_StructVector *b, hypre_StructVector *r ); +HYPRE_Int +hypre_SMGResidual_long_dbl( void *residual_vdata, hypre_StructMatrix *A, hypre_StructVector *x, hypre_StructVector *b, hypre_StructVector *r ); + +void * +hypre_SMGResidualCreate_flt( void ); +void * +hypre_SMGResidualCreate_dbl( void ); +void * +hypre_SMGResidualCreate_long_dbl( void ); + +HYPRE_Int +hypre_SMGResidualDestroy_flt( void *residual_vdata ); +HYPRE_Int +hypre_SMGResidualDestroy_dbl( void *residual_vdata ); +HYPRE_Int +hypre_SMGResidualDestroy_long_dbl( void *residual_vdata ); + +HYPRE_Int +hypre_SMGResidualSetBase_flt( void *residual_vdata, hypre_Index base_index, hypre_Index base_stride ); +HYPRE_Int +hypre_SMGResidualSetBase_dbl( void *residual_vdata, hypre_Index base_index, hypre_Index base_stride ); +HYPRE_Int +hypre_SMGResidualSetBase_long_dbl( void *residual_vdata, hypre_Index base_index, hypre_Index base_stride ); + +HYPRE_Int +hypre_SMGResidualSetup_flt( void *residual_vdata, hypre_StructMatrix *A, hypre_StructVector *x, hypre_StructVector *b, hypre_StructVector *r ); +HYPRE_Int +hypre_SMGResidualSetup_dbl( void *residual_vdata, hypre_StructMatrix *A, hypre_StructVector *x, hypre_StructVector *b, hypre_StructVector *r ); +HYPRE_Int +hypre_SMGResidualSetup_long_dbl( void *residual_vdata, hypre_StructMatrix *A, hypre_StructVector *x, hypre_StructVector *b, hypre_StructVector *r ); + +HYPRE_Int +hypre_SMGSetBase_flt( void *smg_vdata, hypre_Index base_index, hypre_Index base_stride ); +HYPRE_Int +hypre_SMGSetBase_dbl( void *smg_vdata, hypre_Index base_index, hypre_Index base_stride ); +HYPRE_Int +hypre_SMGSetBase_long_dbl( void *smg_vdata, hypre_Index base_index, hypre_Index base_stride ); + +HYPRE_Int +hypre_SMGSetLogging_flt( void *smg_vdata, HYPRE_Int logging ); +HYPRE_Int +hypre_SMGSetLogging_dbl( void *smg_vdata, HYPRE_Int logging ); +HYPRE_Int +hypre_SMGSetLogging_long_dbl( void *smg_vdata, HYPRE_Int logging ); + +HYPRE_Int +hypre_SMGSetMaxIter_flt( void *smg_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_SMGSetMaxIter_dbl( void *smg_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_SMGSetMaxIter_long_dbl( void *smg_vdata, HYPRE_Int max_iter ); + +HYPRE_Int +hypre_SMGSetMaxLevel_flt( void *smg_vdata, HYPRE_Int max_level ); +HYPRE_Int +hypre_SMGSetMaxLevel_dbl( void *smg_vdata, HYPRE_Int max_level ); +HYPRE_Int +hypre_SMGSetMaxLevel_long_dbl( void *smg_vdata, HYPRE_Int max_level ); + +HYPRE_Int +hypre_SMGSetMemoryUse_flt( void *smg_vdata, HYPRE_Int memory_use ); +HYPRE_Int +hypre_SMGSetMemoryUse_dbl( void *smg_vdata, HYPRE_Int memory_use ); +HYPRE_Int +hypre_SMGSetMemoryUse_long_dbl( void *smg_vdata, HYPRE_Int memory_use ); + +HYPRE_Int +hypre_SMGSetNumPostRelax_flt( void *smg_vdata, HYPRE_Int num_post_relax ); +HYPRE_Int +hypre_SMGSetNumPostRelax_dbl( void *smg_vdata, HYPRE_Int num_post_relax ); +HYPRE_Int +hypre_SMGSetNumPostRelax_long_dbl( void *smg_vdata, HYPRE_Int num_post_relax ); + +HYPRE_Int +hypre_SMGSetNumPreRelax_flt( void *smg_vdata, HYPRE_Int num_pre_relax ); +HYPRE_Int +hypre_SMGSetNumPreRelax_dbl( void *smg_vdata, HYPRE_Int num_pre_relax ); +HYPRE_Int +hypre_SMGSetNumPreRelax_long_dbl( void *smg_vdata, HYPRE_Int num_pre_relax ); + +HYPRE_Int +hypre_SMGSetPrintLevel_flt( void *smg_vdata, HYPRE_Int print_level ); +HYPRE_Int +hypre_SMGSetPrintLevel_dbl( void *smg_vdata, HYPRE_Int print_level ); +HYPRE_Int +hypre_SMGSetPrintLevel_long_dbl( void *smg_vdata, HYPRE_Int print_level ); + +HYPRE_Int +hypre_SMGSetRelChange_flt( void *smg_vdata, HYPRE_Int rel_change ); +HYPRE_Int +hypre_SMGSetRelChange_dbl( void *smg_vdata, HYPRE_Int rel_change ); +HYPRE_Int +hypre_SMGSetRelChange_long_dbl( void *smg_vdata, HYPRE_Int rel_change ); + +HYPRE_Int +hypre_SMGSetStructVectorConstantValues_flt( hypre_StructVector *vector, hypre_float values, hypre_BoxArray *box_array, hypre_Index stride ); +HYPRE_Int +hypre_SMGSetStructVectorConstantValues_dbl( hypre_StructVector *vector, hypre_double values, hypre_BoxArray *box_array, hypre_Index stride ); +HYPRE_Int +hypre_SMGSetStructVectorConstantValues_long_dbl( hypre_StructVector *vector, hypre_long_double values, hypre_BoxArray *box_array, hypre_Index stride ); + +HYPRE_Int +hypre_SMGSetTol_flt( void *smg_vdata, hypre_float tol ); +HYPRE_Int +hypre_SMGSetTol_dbl( void *smg_vdata, hypre_double tol ); +HYPRE_Int +hypre_SMGSetTol_long_dbl( void *smg_vdata, hypre_long_double tol ); + +HYPRE_Int +hypre_SMGSetZeroGuess_flt( void *smg_vdata, HYPRE_Int zero_guess ); +HYPRE_Int +hypre_SMGSetZeroGuess_dbl( void *smg_vdata, HYPRE_Int zero_guess ); +HYPRE_Int +hypre_SMGSetZeroGuess_long_dbl( void *smg_vdata, HYPRE_Int zero_guess ); + +HYPRE_Int +hypre_SMGSetup_flt( void *smg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_SMGSetup_dbl( void *smg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_SMGSetup_long_dbl( void *smg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); + +HYPRE_Int +hypre_SMGSetupInterpOp_flt( 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_Int +hypre_SMGSetupInterpOp_dbl( 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_Int +hypre_SMGSetupInterpOp_long_dbl( 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_Int +hypre_SMGSetupRAPOp_flt( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructMatrix *Ac, hypre_Index cindex, hypre_Index cstride ); +HYPRE_Int +hypre_SMGSetupRAPOp_dbl( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructMatrix *Ac, hypre_Index cindex, hypre_Index cstride ); +HYPRE_Int +hypre_SMGSetupRAPOp_long_dbl( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructMatrix *Ac, hypre_Index cindex, hypre_Index cstride ); + +HYPRE_Int +hypre_SMGSetupRestrictOp_flt( hypre_StructMatrix *A, hypre_StructMatrix *R, hypre_StructVector *temp_vec, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride ); +HYPRE_Int +hypre_SMGSetupRestrictOp_dbl( hypre_StructMatrix *A, hypre_StructMatrix *R, hypre_StructVector *temp_vec, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride ); +HYPRE_Int +hypre_SMGSetupRestrictOp_long_dbl( hypre_StructMatrix *A, hypre_StructMatrix *R, hypre_StructVector *temp_vec, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride ); + +HYPRE_Int +hypre_SMGSolve_flt( void *smg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_SMGSolve_dbl( void *smg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_SMGSolve_long_dbl( void *smg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); + +HYPRE_Int +hypre_SemiBuildRAP_flt( 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_Int +hypre_SemiBuildRAP_dbl( 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_Int +hypre_SemiBuildRAP_long_dbl( 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_flt( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir, HYPRE_Int P_stored_as_transpose ); +hypre_StructMatrix * +hypre_SemiCreateRAPOp_dbl( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir, HYPRE_Int P_stored_as_transpose ); +hypre_StructMatrix * +hypre_SemiCreateRAPOp_long_dbl( 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_SemiInterp_flt( void *interp_vdata, hypre_StructMatrix *P, hypre_StructVector *xc, hypre_StructVector *e ); +HYPRE_Int +hypre_SemiInterp_dbl( void *interp_vdata, hypre_StructMatrix *P, hypre_StructVector *xc, hypre_StructVector *e ); +HYPRE_Int +hypre_SemiInterp_long_dbl( void *interp_vdata, hypre_StructMatrix *P, hypre_StructVector *xc, hypre_StructVector *e ); + +void * +hypre_SemiInterpCreate_flt( void ); +void * +hypre_SemiInterpCreate_dbl( void ); +void * +hypre_SemiInterpCreate_long_dbl( void ); + +HYPRE_Int +hypre_SemiInterpDestroy_flt( void *interp_vdata ); +HYPRE_Int +hypre_SemiInterpDestroy_dbl( void *interp_vdata ); +HYPRE_Int +hypre_SemiInterpDestroy_long_dbl( void *interp_vdata ); + +HYPRE_Int +hypre_SemiInterpSetup_flt( 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_SemiInterpSetup_dbl( 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_SemiInterpSetup_long_dbl( 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_SemiRestrict_flt( void *restrict_vdata, hypre_StructMatrix *R, hypre_StructVector *r, hypre_StructVector *rc ); +HYPRE_Int +hypre_SemiRestrict_dbl( void *restrict_vdata, hypre_StructMatrix *R, hypre_StructVector *r, hypre_StructVector *rc ); +HYPRE_Int +hypre_SemiRestrict_long_dbl( void *restrict_vdata, hypre_StructMatrix *R, hypre_StructVector *r, hypre_StructVector *rc ); + +void * +hypre_SemiRestrictCreate_flt( void ); +void * +hypre_SemiRestrictCreate_dbl( void ); +void * +hypre_SemiRestrictCreate_long_dbl( void ); + +HYPRE_Int +hypre_SemiRestrictDestroy_flt( void *restrict_vdata ); +HYPRE_Int +hypre_SemiRestrictDestroy_dbl( void *restrict_vdata ); +HYPRE_Int +hypre_SemiRestrictDestroy_long_dbl( void *restrict_vdata ); + +HYPRE_Int +hypre_SemiRestrictSetup_flt( 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_SemiRestrictSetup_dbl( 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_SemiRestrictSetup_long_dbl( 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_StructDiagScale_flt( hypre_StructMatrix *A, hypre_StructVector *y, hypre_StructVector *x ); +HYPRE_Int +hypre_StructDiagScale_dbl( hypre_StructMatrix *A, hypre_StructVector *y, hypre_StructVector *x ); +HYPRE_Int +hypre_StructDiagScale_long_dbl( hypre_StructMatrix *A, hypre_StructVector *y, hypre_StructVector *x ); + +HYPRE_Int +hypre_StructInterpAssemble_flt( 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_dbl( 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_long_dbl( hypre_StructMatrix *A, hypre_StructMatrix *P, HYPRE_Int P_stored_as_transpose, HYPRE_Int cdir, hypre_Index index, hypre_Index stride ); + +void * +hypre_StructJacobiCreate_flt( MPI_Comm comm ); +void * +hypre_StructJacobiCreate_dbl( MPI_Comm comm ); +void * +hypre_StructJacobiCreate_long_dbl( MPI_Comm comm ); + +HYPRE_Int +hypre_StructJacobiDestroy_flt( void *jacobi_vdata ); +HYPRE_Int +hypre_StructJacobiDestroy_dbl( void *jacobi_vdata ); +HYPRE_Int +hypre_StructJacobiDestroy_long_dbl( void *jacobi_vdata ); + +HYPRE_Int +hypre_StructJacobiGetFinalRelativeResidualNorm_flt( void *jacobi_vdata, hypre_float *norm ); +HYPRE_Int +hypre_StructJacobiGetFinalRelativeResidualNorm_dbl( void *jacobi_vdata, hypre_double *norm ); +HYPRE_Int +hypre_StructJacobiGetFinalRelativeResidualNorm_long_dbl( void *jacobi_vdata, hypre_long_double *norm ); + +HYPRE_Int +hypre_StructJacobiGetMaxIter_flt( void *jacobi_vdata, HYPRE_Int *max_iter ); +HYPRE_Int +hypre_StructJacobiGetMaxIter_dbl( void *jacobi_vdata, HYPRE_Int *max_iter ); +HYPRE_Int +hypre_StructJacobiGetMaxIter_long_dbl( void *jacobi_vdata, HYPRE_Int *max_iter ); + +HYPRE_Int +hypre_StructJacobiGetNumIterations_flt( void *jacobi_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_StructJacobiGetNumIterations_dbl( void *jacobi_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int +hypre_StructJacobiGetNumIterations_long_dbl( void *jacobi_vdata, HYPRE_Int *num_iterations ); + +HYPRE_Int +hypre_StructJacobiGetTol_flt( void *jacobi_vdata, hypre_float *tol ); +HYPRE_Int +hypre_StructJacobiGetTol_dbl( void *jacobi_vdata, hypre_double *tol ); +HYPRE_Int +hypre_StructJacobiGetTol_long_dbl( void *jacobi_vdata, hypre_long_double *tol ); + +HYPRE_Int +hypre_StructJacobiGetZeroGuess_flt( void *jacobi_vdata, HYPRE_Int *zero_guess ); +HYPRE_Int +hypre_StructJacobiGetZeroGuess_dbl( void *jacobi_vdata, HYPRE_Int *zero_guess ); +HYPRE_Int +hypre_StructJacobiGetZeroGuess_long_dbl( void *jacobi_vdata, HYPRE_Int *zero_guess ); + +HYPRE_Int +hypre_StructJacobiSetMaxIter_flt( void *jacobi_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_StructJacobiSetMaxIter_dbl( void *jacobi_vdata, HYPRE_Int max_iter ); +HYPRE_Int +hypre_StructJacobiSetMaxIter_long_dbl( void *jacobi_vdata, HYPRE_Int max_iter ); + +HYPRE_Int +hypre_StructJacobiSetTempVec_flt( void *jacobi_vdata, hypre_StructVector *t ); +HYPRE_Int +hypre_StructJacobiSetTempVec_dbl( void *jacobi_vdata, hypre_StructVector *t ); +HYPRE_Int +hypre_StructJacobiSetTempVec_long_dbl( void *jacobi_vdata, hypre_StructVector *t ); + +HYPRE_Int +hypre_StructJacobiSetTol_flt( void *jacobi_vdata, hypre_float tol ); +HYPRE_Int +hypre_StructJacobiSetTol_dbl( void *jacobi_vdata, hypre_double tol ); +HYPRE_Int +hypre_StructJacobiSetTol_long_dbl( void *jacobi_vdata, hypre_long_double tol ); + +HYPRE_Int +hypre_StructJacobiSetWeight_flt( void *jacobi_vdata, hypre_float weight ); +HYPRE_Int +hypre_StructJacobiSetWeight_dbl( void *jacobi_vdata, hypre_double weight ); +HYPRE_Int +hypre_StructJacobiSetWeight_long_dbl( void *jacobi_vdata, hypre_long_double weight ); + +HYPRE_Int +hypre_StructJacobiSetZeroGuess_flt( void *jacobi_vdata, HYPRE_Int zero_guess ); +HYPRE_Int +hypre_StructJacobiSetZeroGuess_dbl( void *jacobi_vdata, HYPRE_Int zero_guess ); +HYPRE_Int +hypre_StructJacobiSetZeroGuess_long_dbl( void *jacobi_vdata, HYPRE_Int zero_guess ); + +HYPRE_Int +hypre_StructJacobiSetup_flt( void *jacobi_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_StructJacobiSetup_dbl( void *jacobi_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_StructJacobiSetup_long_dbl( void *jacobi_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); + +HYPRE_Int +hypre_StructJacobiSolve_flt( void *jacobi_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_StructJacobiSolve_dbl( void *jacobi_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int +hypre_StructJacobiSolve_long_dbl( void *jacobi_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); + +HYPRE_Int +hypre_StructKrylovAxpy_flt( hypre_float alpha, void *x, void *y ); +HYPRE_Int +hypre_StructKrylovAxpy_dbl( hypre_double alpha, void *x, void *y ); +HYPRE_Int +hypre_StructKrylovAxpy_long_dbl( hypre_long_double alpha, void *x, void *y ); + +void * +hypre_StructKrylovCAlloc_flt( size_t count, size_t elt_size, HYPRE_MemoryLocation location ); +void * +hypre_StructKrylovCAlloc_dbl( size_t count, size_t elt_size, HYPRE_MemoryLocation location ); +void * +hypre_StructKrylovCAlloc_long_dbl( size_t count, size_t elt_size, HYPRE_MemoryLocation location ); + +HYPRE_Int +hypre_StructKrylovClearVector_flt( void *x ); +HYPRE_Int +hypre_StructKrylovClearVector_dbl( void *x ); +HYPRE_Int +hypre_StructKrylovClearVector_long_dbl( void *x ); + +HYPRE_Int +hypre_StructKrylovCommInfo_flt( void *A, HYPRE_Int *my_id, HYPRE_Int *num_procs ); +HYPRE_Int +hypre_StructKrylovCommInfo_dbl( void *A, HYPRE_Int *my_id, HYPRE_Int *num_procs ); +HYPRE_Int +hypre_StructKrylovCommInfo_long_dbl( void *A, HYPRE_Int *my_id, HYPRE_Int *num_procs ); + +HYPRE_Int +hypre_StructKrylovCopyVector_flt( void *x, void *y ); +HYPRE_Int +hypre_StructKrylovCopyVector_dbl( void *x, void *y ); +HYPRE_Int +hypre_StructKrylovCopyVector_long_dbl( void *x, void *y ); + +void * +hypre_StructKrylovCreateVector_flt( void *vvector ); +void * +hypre_StructKrylovCreateVector_dbl( void *vvector ); +void * +hypre_StructKrylovCreateVector_long_dbl( void *vvector ); + +void * +hypre_StructKrylovCreateVectorArray_flt( HYPRE_Int n, void *vvector ); +void * +hypre_StructKrylovCreateVectorArray_dbl( HYPRE_Int n, void *vvector ); +void * +hypre_StructKrylovCreateVectorArray_long_dbl( HYPRE_Int n, void *vvector ); + +HYPRE_Int +hypre_StructKrylovDestroyVector_flt( void *vvector ); +HYPRE_Int +hypre_StructKrylovDestroyVector_dbl( void *vvector ); +HYPRE_Int +hypre_StructKrylovDestroyVector_long_dbl( void *vvector ); + +HYPRE_Int +hypre_StructKrylovFree_flt( void *ptr ); +HYPRE_Int +hypre_StructKrylovFree_dbl( void *ptr ); +HYPRE_Int +hypre_StructKrylovFree_long_dbl( void *ptr ); + +HYPRE_Int +hypre_StructKrylovIdentity_flt( void *vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_StructKrylovIdentity_dbl( void *vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_StructKrylovIdentity_long_dbl( void *vdata, void *A, void *b, void *x ); + +HYPRE_Int +hypre_StructKrylovIdentitySetup_flt( void *vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_StructKrylovIdentitySetup_dbl( void *vdata, void *A, void *b, void *x ); +HYPRE_Int +hypre_StructKrylovIdentitySetup_long_dbl( void *vdata, void *A, void *b, void *x ); + +HYPRE_Real +hypre_StructKrylovInnerProd_flt( void *x, void *y ); +HYPRE_Real +hypre_StructKrylovInnerProd_dbl( void *x, void *y ); +HYPRE_Real +hypre_StructKrylovInnerProd_long_dbl( void *x, void *y ); + +HYPRE_Int +hypre_StructKrylovInnerProdTagged_flt( void *x, void *y, HYPRE_Int *num_tags_ptr, hypre_float **iprod_ptr ); +HYPRE_Int +hypre_StructKrylovInnerProdTagged_dbl( void *x, void *y, HYPRE_Int *num_tags_ptr, hypre_double **iprod_ptr ); +HYPRE_Int +hypre_StructKrylovInnerProdTagged_long_dbl( void *x, void *y, HYPRE_Int *num_tags_ptr, hypre_long_double **iprod_ptr ); + +HYPRE_Int +hypre_StructKrylovMatvec_flt( void *matvec_data, hypre_float alpha, void *A, void *x, hypre_float beta, void *y ); +HYPRE_Int +hypre_StructKrylovMatvec_dbl( void *matvec_data, hypre_double alpha, void *A, void *x, hypre_double beta, void *y ); +HYPRE_Int +hypre_StructKrylovMatvec_long_dbl( void *matvec_data, hypre_long_double alpha, void *A, void *x, hypre_long_double beta, void *y ); + +void * +hypre_StructKrylovMatvecCreate_flt( void *A, void *x ); +void * +hypre_StructKrylovMatvecCreate_dbl( void *A, void *x ); +void * +hypre_StructKrylovMatvecCreate_long_dbl( void *A, void *x ); + +HYPRE_Int +hypre_StructKrylovMatvecDestroy_flt( void *matvec_data ); +HYPRE_Int +hypre_StructKrylovMatvecDestroy_dbl( void *matvec_data ); +HYPRE_Int +hypre_StructKrylovMatvecDestroy_long_dbl( void *matvec_data ); + +HYPRE_Int +hypre_StructKrylovScaleVector_flt( hypre_float alpha, void *x ); +HYPRE_Int +hypre_StructKrylovScaleVector_dbl( hypre_double alpha, void *x ); +HYPRE_Int +hypre_StructKrylovScaleVector_long_dbl( hypre_long_double alpha, void *x ); + +HYPRE_Int +hypre_StructKrylovSetRandomValues_flt( void *x, HYPRE_Int seed ); +HYPRE_Int +hypre_StructKrylovSetRandomValues_dbl( void *x, HYPRE_Int seed ); +HYPRE_Int +hypre_StructKrylovSetRandomValues_long_dbl( void *x, HYPRE_Int seed ); + + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + + + +#endif + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/src/struct_ls/_hypre_struct_ls_mup_def.h b/src/struct_ls/_hypre_struct_ls_mup_def.h new file mode 100644 index 0000000000..bc2cd90e1e --- /dev/null +++ b/src/struct_ls/_hypre_struct_ls_mup_def.h @@ -0,0 +1,624 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#ifndef hypre_STRUCT_LS_MUP_DEF_HEADER +#define hypre_STRUCT_LS_MUP_DEF_HEADER + +#include "_hypre_mup_def.h" + +#define HYPRE_StructBiCGSTABCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructBiCGSTABCreate ) +#define HYPRE_StructBiCGSTABDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructBiCGSTABDestroy ) +#define HYPRE_StructBiCGSTABGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructBiCGSTABGetFinalRelativeResidualNorm ) +#define HYPRE_StructBiCGSTABGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructBiCGSTABGetNumIterations ) +#define HYPRE_StructBiCGSTABGetResidual HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructBiCGSTABGetResidual ) +#define HYPRE_StructBiCGSTABSetAbsoluteTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructBiCGSTABSetAbsoluteTol ) +#define HYPRE_StructBiCGSTABSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructBiCGSTABSetLogging ) +#define HYPRE_StructBiCGSTABSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructBiCGSTABSetMaxIter ) +#define HYPRE_StructBiCGSTABSetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructBiCGSTABSetPrecond ) +#define HYPRE_StructBiCGSTABSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructBiCGSTABSetPrintLevel ) +#define HYPRE_StructBiCGSTABSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructBiCGSTABSetTol ) +#define HYPRE_StructBiCGSTABSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructBiCGSTABSetup ) +#define HYPRE_StructBiCGSTABSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructBiCGSTABSolve ) +#define HYPRE_StructCycRedCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructCycRedCreate ) +#define HYPRE_StructCycRedDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructCycRedDestroy ) +#define HYPRE_StructCycRedSetBase HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructCycRedSetBase ) +#define HYPRE_StructCycRedSetTDim HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructCycRedSetTDim ) +#define HYPRE_StructCycRedSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructCycRedSetup ) +#define HYPRE_StructCycRedSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructCycRedSolve ) +#define HYPRE_StructDiagScale HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructDiagScale ) +#define HYPRE_StructDiagScaleSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructDiagScaleSetup ) +#define HYPRE_StructFlexGMRESCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructFlexGMRESCreate ) +#define HYPRE_StructFlexGMRESDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructFlexGMRESDestroy ) +#define HYPRE_StructFlexGMRESGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructFlexGMRESGetFinalRelativeResidualNorm ) +#define HYPRE_StructFlexGMRESGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructFlexGMRESGetNumIterations ) +#define HYPRE_StructFlexGMRESSetAbsoluteTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructFlexGMRESSetAbsoluteTol ) +#define HYPRE_StructFlexGMRESSetKDim HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructFlexGMRESSetKDim ) +#define HYPRE_StructFlexGMRESSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructFlexGMRESSetLogging ) +#define HYPRE_StructFlexGMRESSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructFlexGMRESSetMaxIter ) +#define HYPRE_StructFlexGMRESSetModifyPC HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructFlexGMRESSetModifyPC ) +#define HYPRE_StructFlexGMRESSetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructFlexGMRESSetPrecond ) +#define HYPRE_StructFlexGMRESSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructFlexGMRESSetPrintLevel ) +#define HYPRE_StructFlexGMRESSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructFlexGMRESSetTol ) +#define HYPRE_StructFlexGMRESSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructFlexGMRESSetup ) +#define HYPRE_StructFlexGMRESSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructFlexGMRESSolve ) +#define HYPRE_StructGMRESCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructGMRESCreate ) +#define HYPRE_StructGMRESDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructGMRESDestroy ) +#define HYPRE_StructGMRESGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructGMRESGetFinalRelativeResidualNorm ) +#define HYPRE_StructGMRESGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructGMRESGetNumIterations ) +#define HYPRE_StructGMRESSetAbsoluteTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructGMRESSetAbsoluteTol ) +#define HYPRE_StructGMRESSetKDim HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructGMRESSetKDim ) +#define HYPRE_StructGMRESSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructGMRESSetLogging ) +#define HYPRE_StructGMRESSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructGMRESSetMaxIter ) +#define HYPRE_StructGMRESSetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructGMRESSetPrecond ) +#define HYPRE_StructGMRESSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructGMRESSetPrintLevel ) +#define HYPRE_StructGMRESSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructGMRESSetTol ) +#define HYPRE_StructGMRESSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructGMRESSetup ) +#define HYPRE_StructGMRESSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructGMRESSolve ) +#define HYPRE_StructHybridCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructHybridCreate ) +#define HYPRE_StructHybridDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructHybridDestroy ) +#define HYPRE_StructHybridGetDSCGNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructHybridGetDSCGNumIterations ) +#define HYPRE_StructHybridGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructHybridGetFinalRelativeResidualNorm ) +#define HYPRE_StructHybridGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructHybridGetNumIterations ) +#define HYPRE_StructHybridGetPCGNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructHybridGetPCGNumIterations ) +#define HYPRE_StructHybridGetRecomputeResidual HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructHybridGetRecomputeResidual ) +#define HYPRE_StructHybridGetRecomputeResidualP HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructHybridGetRecomputeResidualP ) +#define HYPRE_StructHybridSetConvergenceTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructHybridSetConvergenceTol ) +#define HYPRE_StructHybridSetDSCGMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructHybridSetDSCGMaxIter ) +#define HYPRE_StructHybridSetKDim HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructHybridSetKDim ) +#define HYPRE_StructHybridSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructHybridSetLogging ) +#define HYPRE_StructHybridSetPCGAbsoluteTolFactor HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructHybridSetPCGAbsoluteTolFactor ) +#define HYPRE_StructHybridSetPCGMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructHybridSetPCGMaxIter ) +#define HYPRE_StructHybridSetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructHybridSetPrecond ) +#define HYPRE_StructHybridSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructHybridSetPrintLevel ) +#define HYPRE_StructHybridSetRecomputeResidual HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructHybridSetRecomputeResidual ) +#define HYPRE_StructHybridSetRecomputeResidualP HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructHybridSetRecomputeResidualP ) +#define HYPRE_StructHybridSetRelChange HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructHybridSetRelChange ) +#define HYPRE_StructHybridSetSolverType HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructHybridSetSolverType ) +#define HYPRE_StructHybridSetStopCrit HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructHybridSetStopCrit ) +#define HYPRE_StructHybridSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructHybridSetTol ) +#define HYPRE_StructHybridSetTwoNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructHybridSetTwoNorm ) +#define HYPRE_StructHybridSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructHybridSetup ) +#define HYPRE_StructHybridSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructHybridSolve ) +#define HYPRE_StructJacobiCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructJacobiCreate ) +#define HYPRE_StructJacobiDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructJacobiDestroy ) +#define HYPRE_StructJacobiGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructJacobiGetFinalRelativeResidualNorm ) +#define HYPRE_StructJacobiGetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructJacobiGetMaxIter ) +#define HYPRE_StructJacobiGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructJacobiGetNumIterations ) +#define HYPRE_StructJacobiGetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructJacobiGetTol ) +#define HYPRE_StructJacobiGetZeroGuess HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructJacobiGetZeroGuess ) +#define HYPRE_StructJacobiSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructJacobiSetMaxIter ) +#define HYPRE_StructJacobiSetNonZeroGuess HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructJacobiSetNonZeroGuess ) +#define HYPRE_StructJacobiSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructJacobiSetTol ) +#define HYPRE_StructJacobiSetZeroGuess HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructJacobiSetZeroGuess ) +#define HYPRE_StructJacobiSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructJacobiSetup ) +#define HYPRE_StructJacobiSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructJacobiSolve ) +#define HYPRE_StructLGMRESCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructLGMRESCreate ) +#define HYPRE_StructLGMRESDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructLGMRESDestroy ) +#define HYPRE_StructLGMRESGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructLGMRESGetFinalRelativeResidualNorm ) +#define HYPRE_StructLGMRESGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructLGMRESGetNumIterations ) +#define HYPRE_StructLGMRESSetAbsoluteTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructLGMRESSetAbsoluteTol ) +#define HYPRE_StructLGMRESSetAugDim HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructLGMRESSetAugDim ) +#define HYPRE_StructLGMRESSetKDim HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructLGMRESSetKDim ) +#define HYPRE_StructLGMRESSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructLGMRESSetLogging ) +#define HYPRE_StructLGMRESSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructLGMRESSetMaxIter ) +#define HYPRE_StructLGMRESSetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructLGMRESSetPrecond ) +#define HYPRE_StructLGMRESSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructLGMRESSetPrintLevel ) +#define HYPRE_StructLGMRESSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructLGMRESSetTol ) +#define HYPRE_StructLGMRESSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructLGMRESSetup ) +#define HYPRE_StructLGMRESSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructLGMRESSolve ) +#define HYPRE_StructPCGCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPCGCreate ) +#define HYPRE_StructPCGDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPCGDestroy ) +#define HYPRE_StructPCGGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPCGGetFinalRelativeResidualNorm ) +#define HYPRE_StructPCGGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPCGGetNumIterations ) +#define HYPRE_StructPCGSetAbsoluteTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPCGSetAbsoluteTol ) +#define HYPRE_StructPCGSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPCGSetLogging ) +#define HYPRE_StructPCGSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPCGSetMaxIter ) +#define HYPRE_StructPCGSetPrecond HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPCGSetPrecond ) +#define HYPRE_StructPCGSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPCGSetPrintLevel ) +#define HYPRE_StructPCGSetRelChange HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPCGSetRelChange ) +#define HYPRE_StructPCGSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPCGSetTol ) +#define HYPRE_StructPCGSetTwoNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPCGSetTwoNorm ) +#define HYPRE_StructPCGSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPCGSetup ) +#define HYPRE_StructPCGSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPCGSolve ) +#define HYPRE_StructPFMGCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGCreate ) +#define HYPRE_StructPFMGDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGDestroy ) +#define HYPRE_StructPFMGGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGGetFinalRelativeResidualNorm ) +#define HYPRE_StructPFMGGetJacobiWeight HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGGetJacobiWeight ) +#define HYPRE_StructPFMGGetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGGetLogging ) +#define HYPRE_StructPFMGGetMatmultType HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGGetMatmultType ) +#define HYPRE_StructPFMGGetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGGetMaxIter ) +#define HYPRE_StructPFMGGetMaxLevels HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGGetMaxLevels ) +#define HYPRE_StructPFMGGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGGetNumIterations ) +#define HYPRE_StructPFMGGetNumPostRelax HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGGetNumPostRelax ) +#define HYPRE_StructPFMGGetNumPreRelax HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGGetNumPreRelax ) +#define HYPRE_StructPFMGGetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGGetPrintLevel ) +#define HYPRE_StructPFMGGetRAPType HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGGetRAPType ) +#define HYPRE_StructPFMGGetRelChange HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGGetRelChange ) +#define HYPRE_StructPFMGGetRelaxType HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGGetRelaxType ) +#define HYPRE_StructPFMGGetSkipRelax HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGGetSkipRelax ) +#define HYPRE_StructPFMGGetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGGetTol ) +#define HYPRE_StructPFMGGetZeroGuess HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGGetZeroGuess ) +#define HYPRE_StructPFMGSetDxyz HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGSetDxyz ) +#define HYPRE_StructPFMGSetJacobiWeight HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGSetJacobiWeight ) +#define HYPRE_StructPFMGSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGSetLogging ) +#define HYPRE_StructPFMGSetMatmultType HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGSetMatmultType ) +#define HYPRE_StructPFMGSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGSetMaxIter ) +#define HYPRE_StructPFMGSetMaxLevels HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGSetMaxLevels ) +#define HYPRE_StructPFMGSetNonZeroGuess HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGSetNonZeroGuess ) +#define HYPRE_StructPFMGSetNumPostRelax HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGSetNumPostRelax ) +#define HYPRE_StructPFMGSetNumPreRelax HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGSetNumPreRelax ) +#define HYPRE_StructPFMGSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGSetPrintLevel ) +#define HYPRE_StructPFMGSetRAPType HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGSetRAPType ) +#define HYPRE_StructPFMGSetRelChange HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGSetRelChange ) +#define HYPRE_StructPFMGSetRelaxType HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGSetRelaxType ) +#define HYPRE_StructPFMGSetSkipRelax HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGSetSkipRelax ) +#define HYPRE_StructPFMGSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGSetTol ) +#define HYPRE_StructPFMGSetZeroGuess HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGSetZeroGuess ) +#define HYPRE_StructPFMGSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGSetup ) +#define HYPRE_StructPFMGSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructPFMGSolve ) +#define HYPRE_StructSMGCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructSMGCreate ) +#define HYPRE_StructSMGDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructSMGDestroy ) +#define HYPRE_StructSMGGetFinalRelativeResidualNorm HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructSMGGetFinalRelativeResidualNorm ) +#define HYPRE_StructSMGGetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructSMGGetLogging ) +#define HYPRE_StructSMGGetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructSMGGetMaxIter ) +#define HYPRE_StructSMGGetMemoryUse HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructSMGGetMemoryUse ) +#define HYPRE_StructSMGGetNumIterations HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructSMGGetNumIterations ) +#define HYPRE_StructSMGGetNumPostRelax HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructSMGGetNumPostRelax ) +#define HYPRE_StructSMGGetNumPreRelax HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructSMGGetNumPreRelax ) +#define HYPRE_StructSMGGetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructSMGGetPrintLevel ) +#define HYPRE_StructSMGGetRelChange HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructSMGGetRelChange ) +#define HYPRE_StructSMGGetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructSMGGetTol ) +#define HYPRE_StructSMGGetZeroGuess HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructSMGGetZeroGuess ) +#define HYPRE_StructSMGSetLogging HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructSMGSetLogging ) +#define HYPRE_StructSMGSetMaxIter HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructSMGSetMaxIter ) +#define HYPRE_StructSMGSetMemoryUse HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructSMGSetMemoryUse ) +#define HYPRE_StructSMGSetNonZeroGuess HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructSMGSetNonZeroGuess ) +#define HYPRE_StructSMGSetNumPostRelax HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructSMGSetNumPostRelax ) +#define HYPRE_StructSMGSetNumPreRelax HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructSMGSetNumPreRelax ) +#define HYPRE_StructSMGSetPrintLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructSMGSetPrintLevel ) +#define HYPRE_StructSMGSetRelChange HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructSMGSetRelChange ) +#define HYPRE_StructSMGSetTol HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructSMGSetTol ) +#define HYPRE_StructSMGSetZeroGuess HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructSMGSetZeroGuess ) +#define HYPRE_StructSMGSetup HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructSMGSetup ) +#define HYPRE_StructSMGSolve HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructSMGSolve ) +#define HYPRE_StructSetupInterpreter HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructSetupInterpreter ) +#define HYPRE_StructSetupMatvec HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructSetupMatvec ) +#define hypre_CycRedCreateCoarseOp HYPRE_FIXEDPRECISION_FUNC ( hypre_CycRedCreateCoarseOp ) +#define hypre_CycRedSetupCoarseOp HYPRE_FIXEDPRECISION_FUNC ( hypre_CycRedSetupCoarseOp ) +#define hypre_CyclicReduction HYPRE_FIXEDPRECISION_FUNC ( hypre_CyclicReduction ) +#define hypre_CyclicReductionCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_CyclicReductionCreate ) +#define hypre_CyclicReductionDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_CyclicReductionDestroy ) +#define hypre_CyclicReductionSetBase HYPRE_FIXEDPRECISION_FUNC ( hypre_CyclicReductionSetBase ) +#define hypre_CyclicReductionSetCDir HYPRE_FIXEDPRECISION_FUNC ( hypre_CyclicReductionSetCDir ) +#define hypre_CyclicReductionSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_CyclicReductionSetup ) +#define hypre_HybridCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_HybridCreate ) +#define hypre_HybridDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_HybridDestroy ) +#define hypre_HybridGetDSCGNumIterations HYPRE_FIXEDPRECISION_FUNC ( hypre_HybridGetDSCGNumIterations ) +#define hypre_HybridGetFinalRelativeResidualNorm HYPRE_FIXEDPRECISION_FUNC ( hypre_HybridGetFinalRelativeResidualNorm ) +#define hypre_HybridGetNumIterations HYPRE_FIXEDPRECISION_FUNC ( hypre_HybridGetNumIterations ) +#define hypre_HybridGetPCGNumIterations HYPRE_FIXEDPRECISION_FUNC ( hypre_HybridGetPCGNumIterations ) +#define hypre_HybridGetRecomputeResidual HYPRE_FIXEDPRECISION_FUNC ( hypre_HybridGetRecomputeResidual ) +#define hypre_HybridGetRecomputeResidualP HYPRE_FIXEDPRECISION_FUNC ( hypre_HybridGetRecomputeResidualP ) +#define hypre_HybridSetConvergenceTol HYPRE_FIXEDPRECISION_FUNC ( hypre_HybridSetConvergenceTol ) +#define hypre_HybridSetDSCGMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_HybridSetDSCGMaxIter ) +#define hypre_HybridSetKDim HYPRE_FIXEDPRECISION_FUNC ( hypre_HybridSetKDim ) +#define hypre_HybridSetLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_HybridSetLogging ) +#define hypre_HybridSetPCGAbsoluteTolFactor HYPRE_FIXEDPRECISION_FUNC ( hypre_HybridSetPCGAbsoluteTolFactor ) +#define hypre_HybridSetPCGMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_HybridSetPCGMaxIter ) +#define hypre_HybridSetPrecond HYPRE_FIXEDPRECISION_FUNC ( hypre_HybridSetPrecond ) +#define hypre_HybridSetPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_HybridSetPrintLevel ) +#define hypre_HybridSetRecomputeResidual HYPRE_FIXEDPRECISION_FUNC ( hypre_HybridSetRecomputeResidual ) +#define hypre_HybridSetRecomputeResidualP HYPRE_FIXEDPRECISION_FUNC ( hypre_HybridSetRecomputeResidualP ) +#define hypre_HybridSetRelChange HYPRE_FIXEDPRECISION_FUNC ( hypre_HybridSetRelChange ) +#define hypre_HybridSetSolverType HYPRE_FIXEDPRECISION_FUNC ( hypre_HybridSetSolverType ) +#define hypre_HybridSetStopCrit HYPRE_FIXEDPRECISION_FUNC ( hypre_HybridSetStopCrit ) +#define hypre_HybridSetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_HybridSetTol ) +#define hypre_HybridSetTwoNorm HYPRE_FIXEDPRECISION_FUNC ( hypre_HybridSetTwoNorm ) +#define hypre_HybridSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_HybridSetup ) +#define hypre_HybridSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_HybridSolve ) +#define hypre_HybridSolveUseBiCGSTAB HYPRE_FIXEDPRECISION_FUNC ( hypre_HybridSolveUseBiCGSTAB ) +#define hypre_HybridSolveUseGMRES HYPRE_FIXEDPRECISION_FUNC ( hypre_HybridSolveUseGMRES ) +#define hypre_HybridSolveUsePCG HYPRE_FIXEDPRECISION_FUNC ( hypre_HybridSolveUsePCG ) +#define hypre_PFMG2BuildRAPNoSym HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMG2BuildRAPNoSym ) +#define hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC0 HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC0 ) +#define hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC1 HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC1 ) +#define hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC0 HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC0 ) +#define hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC1 HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC1 ) +#define hypre_PFMG2BuildRAPSym HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMG2BuildRAPSym ) +#define hypre_PFMG2BuildRAPSym_onebox_FSS5_CC0 HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMG2BuildRAPSym_onebox_FSS5_CC0 ) +#define hypre_PFMG2BuildRAPSym_onebox_FSS5_CC1 HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMG2BuildRAPSym_onebox_FSS5_CC1 ) +#define hypre_PFMG2BuildRAPSym_onebox_FSS9_CC0 HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMG2BuildRAPSym_onebox_FSS9_CC0 ) +#define hypre_PFMG2BuildRAPSym_onebox_FSS9_CC1 HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMG2BuildRAPSym_onebox_FSS9_CC1 ) +#define hypre_PFMG2CreateRAPOp HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMG2CreateRAPOp ) +#define hypre_PFMG3BuildRAPNoSym HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMG3BuildRAPNoSym ) +#define hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC0 HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC0 ) +#define hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC1 HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC1 ) +#define hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC0 HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC0 ) +#define hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC1 HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC1 ) +#define hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC0 HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC0 ) +#define hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC1 HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC1 ) +#define hypre_PFMG3BuildRAPSym HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMG3BuildRAPSym ) +#define hypre_PFMG3BuildRAPSym_onebox_FSS07_CC0 HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMG3BuildRAPSym_onebox_FSS07_CC0 ) +#define hypre_PFMG3BuildRAPSym_onebox_FSS07_CC1 HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMG3BuildRAPSym_onebox_FSS07_CC1 ) +#define hypre_PFMG3BuildRAPSym_onebox_FSS19_CC0 HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMG3BuildRAPSym_onebox_FSS19_CC0 ) +#define hypre_PFMG3BuildRAPSym_onebox_FSS19_CC1 HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMG3BuildRAPSym_onebox_FSS19_CC1 ) +#define hypre_PFMG3BuildRAPSym_onebox_FSS27_CC0 HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMG3BuildRAPSym_onebox_FSS27_CC0 ) +#define hypre_PFMG3BuildRAPSym_onebox_FSS27_CC1 HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMG3BuildRAPSym_onebox_FSS27_CC1 ) +#define hypre_PFMG3CreateRAPOp HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMG3CreateRAPOp ) +#define hypre_PFMGBuildCoarseOp5 HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGBuildCoarseOp5 ) +#define hypre_PFMGBuildCoarseOp7 HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGBuildCoarseOp7 ) +#define hypre_PFMGCoarsen HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGCoarsen ) +#define hypre_PFMGComputeCxyz HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGComputeCxyz ) +#define hypre_PFMGComputeCxyz_core_CC HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGComputeCxyz_core_CC ) +#define hypre_PFMGComputeCxyz_core_VC HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGComputeCxyz_core_VC ) +#define hypre_PFMGComputeDxyz HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGComputeDxyz ) +#define hypre_PFMGComputeMaxLevels HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGComputeMaxLevels ) +#define hypre_PFMGCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGCreate ) +#define hypre_PFMGCreateCoarseOp5 HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGCreateCoarseOp5 ) +#define hypre_PFMGCreateCoarseOp7 HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGCreateCoarseOp7 ) +#define hypre_PFMGCreateInterpOp HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGCreateInterpOp ) +#define hypre_PFMGCreateRAPOp HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGCreateRAPOp ) +#define hypre_PFMGDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGDestroy ) +#define hypre_PFMGGetFinalRelativeResidualNorm HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGGetFinalRelativeResidualNorm ) +#define hypre_PFMGGetJacobiWeight HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGGetJacobiWeight ) +#define hypre_PFMGGetLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGGetLogging ) +#define hypre_PFMGGetMatmultType HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGGetMatmultType ) +#define hypre_PFMGGetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGGetMaxIter ) +#define hypre_PFMGGetMaxLevels HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGGetMaxLevels ) +#define hypre_PFMGGetNumIterations HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGGetNumIterations ) +#define hypre_PFMGGetNumPostRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGGetNumPostRelax ) +#define hypre_PFMGGetNumPreRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGGetNumPreRelax ) +#define hypre_PFMGGetPrintFreq HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGGetPrintFreq ) +#define hypre_PFMGGetPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGGetPrintLevel ) +#define hypre_PFMGGetRAPType HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGGetRAPType ) +#define hypre_PFMGGetRelChange HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGGetRelChange ) +#define hypre_PFMGGetRelaxType HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGGetRelaxType ) +#define hypre_PFMGGetSkipRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGGetSkipRelax ) +#define hypre_PFMGGetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGGetTol ) +#define hypre_PFMGGetZeroGuess HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGGetZeroGuess ) +#define hypre_PFMGPrintLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGPrintLogging ) +#define hypre_PFMGRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGRelax ) +#define hypre_PFMGRelaxCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGRelaxCreate ) +#define hypre_PFMGRelaxDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGRelaxDestroy ) +#define hypre_PFMGRelaxSetJacobiWeight HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGRelaxSetJacobiWeight ) +#define hypre_PFMGRelaxSetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGRelaxSetMaxIter ) +#define hypre_PFMGRelaxSetPostRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGRelaxSetPostRelax ) +#define hypre_PFMGRelaxSetPreRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGRelaxSetPreRelax ) +#define hypre_PFMGRelaxSetTempVec HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGRelaxSetTempVec ) +#define hypre_PFMGRelaxSetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGRelaxSetTol ) +#define hypre_PFMGRelaxSetType HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGRelaxSetType ) +#define hypre_PFMGRelaxSetZeroGuess HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGRelaxSetZeroGuess ) +#define hypre_PFMGRelaxSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGRelaxSetup ) +#define hypre_PFMGSetDxyz HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGSetDxyz ) +#define hypre_PFMGSetJacobiWeight HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGSetJacobiWeight ) +#define hypre_PFMGSetLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGSetLogging ) +#define hypre_PFMGSetMatmultType HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGSetMatmultType ) +#define hypre_PFMGSetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGSetMaxIter ) +#define hypre_PFMGSetMaxLevels HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGSetMaxLevels ) +#define hypre_PFMGSetNumPostRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGSetNumPostRelax ) +#define hypre_PFMGSetNumPreRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGSetNumPreRelax ) +#define hypre_PFMGSetPrintFreq HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGSetPrintFreq ) +#define hypre_PFMGSetPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGSetPrintLevel ) +#define hypre_PFMGSetRAPType HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGSetRAPType ) +#define hypre_PFMGSetRelChange HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGSetRelChange ) +#define hypre_PFMGSetRelaxType HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGSetRelaxType ) +#define hypre_PFMGSetSkipRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGSetSkipRelax ) +#define hypre_PFMGSetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGSetTol ) +#define hypre_PFMGSetZeroGuess HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGSetZeroGuess ) +#define hypre_PFMGSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGSetup ) +#define hypre_PFMGSetupInterpOp HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGSetupInterpOp ) +#define hypre_PFMGSetupInterpOp_core_CC HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGSetupInterpOp_core_CC ) +#define hypre_PFMGSetupInterpOp_core_VC HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGSetupInterpOp_core_VC ) +#define hypre_PFMGSetupRAPOp HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGSetupRAPOp ) +#define hypre_PFMGSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_PFMGSolve ) +#define hypre_RedBlackConstantCoefGS HYPRE_FIXEDPRECISION_FUNC ( hypre_RedBlackConstantCoefGS ) +#define hypre_RedBlackGS HYPRE_FIXEDPRECISION_FUNC ( hypre_RedBlackGS ) +#define hypre_RedBlackGSCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_RedBlackGSCreate ) +#define hypre_RedBlackGSDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_RedBlackGSDestroy ) +#define hypre_RedBlackGSSetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_RedBlackGSSetMaxIter ) +#define hypre_RedBlackGSSetStartBlack HYPRE_FIXEDPRECISION_FUNC ( hypre_RedBlackGSSetStartBlack ) +#define hypre_RedBlackGSSetStartRed HYPRE_FIXEDPRECISION_FUNC ( hypre_RedBlackGSSetStartRed ) +#define hypre_RedBlackGSSetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_RedBlackGSSetTol ) +#define hypre_RedBlackGSSetZeroGuess HYPRE_FIXEDPRECISION_FUNC ( hypre_RedBlackGSSetZeroGuess ) +#define hypre_RedBlackGSSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_RedBlackGSSetup ) +#define hypre_SMG2BuildRAPNoSym HYPRE_FIXEDPRECISION_FUNC ( hypre_SMG2BuildRAPNoSym ) +#define hypre_SMG2BuildRAPSym HYPRE_FIXEDPRECISION_FUNC ( hypre_SMG2BuildRAPSym ) +#define hypre_SMG2CreateRAPOp HYPRE_FIXEDPRECISION_FUNC ( hypre_SMG2CreateRAPOp ) +#define hypre_SMG2RAPPeriodicNoSym HYPRE_FIXEDPRECISION_FUNC ( hypre_SMG2RAPPeriodicNoSym ) +#define hypre_SMG2RAPPeriodicSym HYPRE_FIXEDPRECISION_FUNC ( hypre_SMG2RAPPeriodicSym ) +#define hypre_SMG3BuildRAPNoSym HYPRE_FIXEDPRECISION_FUNC ( hypre_SMG3BuildRAPNoSym ) +#define hypre_SMG3BuildRAPSym HYPRE_FIXEDPRECISION_FUNC ( hypre_SMG3BuildRAPSym ) +#define hypre_SMG3CreateRAPOp HYPRE_FIXEDPRECISION_FUNC ( hypre_SMG3CreateRAPOp ) +#define hypre_SMG3RAPPeriodicNoSym HYPRE_FIXEDPRECISION_FUNC ( hypre_SMG3RAPPeriodicNoSym ) +#define hypre_SMG3RAPPeriodicSym HYPRE_FIXEDPRECISION_FUNC ( hypre_SMG3RAPPeriodicSym ) +#define hypre_SMGAxpy HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGAxpy ) +#define hypre_SMGCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGCreate ) +#define hypre_SMGCreateInterpOp HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGCreateInterpOp ) +#define hypre_SMGCreateRAPOp HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGCreateRAPOp ) +#define hypre_SMGCreateRestrictOp HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGCreateRestrictOp ) +#define hypre_SMGDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGDestroy ) +#define hypre_SMGGetFinalRelativeResidualNorm HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGGetFinalRelativeResidualNorm ) +#define hypre_SMGGetLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGGetLogging ) +#define hypre_SMGGetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGGetMaxIter ) +#define hypre_SMGGetMemoryUse HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGGetMemoryUse ) +#define hypre_SMGGetNumIterations HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGGetNumIterations ) +#define hypre_SMGGetNumPostRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGGetNumPostRelax ) +#define hypre_SMGGetNumPreRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGGetNumPreRelax ) +#define hypre_SMGGetPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGGetPrintLevel ) +#define hypre_SMGGetRelChange HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGGetRelChange ) +#define hypre_SMGGetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGGetTol ) +#define hypre_SMGGetZeroGuess HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGGetZeroGuess ) +#define hypre_SMGPrintLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGPrintLogging ) +#define hypre_SMGRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGRelax ) +#define hypre_SMGRelaxCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGRelaxCreate ) +#define hypre_SMGRelaxDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGRelaxDestroy ) +#define hypre_SMGRelaxDestroyARem HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGRelaxDestroyARem ) +#define hypre_SMGRelaxDestroyASol HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGRelaxDestroyASol ) +#define hypre_SMGRelaxDestroyTempVec HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGRelaxDestroyTempVec ) +#define hypre_SMGRelaxSetBase HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGRelaxSetBase ) +#define hypre_SMGRelaxSetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGRelaxSetMaxIter ) +#define hypre_SMGRelaxSetMaxLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGRelaxSetMaxLevel ) +#define hypre_SMGRelaxSetMemoryUse HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGRelaxSetMemoryUse ) +#define hypre_SMGRelaxSetNewMatrixStencil HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGRelaxSetNewMatrixStencil ) +#define hypre_SMGRelaxSetNumPostRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGRelaxSetNumPostRelax ) +#define hypre_SMGRelaxSetNumPreRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGRelaxSetNumPreRelax ) +#define hypre_SMGRelaxSetNumPreSpaces HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGRelaxSetNumPreSpaces ) +#define hypre_SMGRelaxSetNumRegSpaces HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGRelaxSetNumRegSpaces ) +#define hypre_SMGRelaxSetNumSpaces HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGRelaxSetNumSpaces ) +#define hypre_SMGRelaxSetPreSpaceRank HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGRelaxSetPreSpaceRank ) +#define hypre_SMGRelaxSetRegSpaceRank HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGRelaxSetRegSpaceRank ) +#define hypre_SMGRelaxSetSpace HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGRelaxSetSpace ) +#define hypre_SMGRelaxSetTempVec HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGRelaxSetTempVec ) +#define hypre_SMGRelaxSetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGRelaxSetTol ) +#define hypre_SMGRelaxSetZeroGuess HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGRelaxSetZeroGuess ) +#define hypre_SMGRelaxSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGRelaxSetup ) +#define hypre_SMGRelaxSetupARem HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGRelaxSetupARem ) +#define hypre_SMGRelaxSetupASol HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGRelaxSetupASol ) +#define hypre_SMGRelaxSetupBaseBoxArray HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGRelaxSetupBaseBoxArray ) +#define hypre_SMGRelaxSetupTempVec HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGRelaxSetupTempVec ) +#define hypre_SMGResidual HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGResidual ) +#define hypre_SMGResidualCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGResidualCreate ) +#define hypre_SMGResidualDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGResidualDestroy ) +#define hypre_SMGResidualSetBase HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGResidualSetBase ) +#define hypre_SMGResidualSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGResidualSetup ) +#define hypre_SMGSetBase HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGSetBase ) +#define hypre_SMGSetLogging HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGSetLogging ) +#define hypre_SMGSetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGSetMaxIter ) +#define hypre_SMGSetMaxLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGSetMaxLevel ) +#define hypre_SMGSetMemoryUse HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGSetMemoryUse ) +#define hypre_SMGSetNumPostRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGSetNumPostRelax ) +#define hypre_SMGSetNumPreRelax HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGSetNumPreRelax ) +#define hypre_SMGSetPrintLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGSetPrintLevel ) +#define hypre_SMGSetRelChange HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGSetRelChange ) +#define hypre_SMGSetStructVectorConstantValues HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGSetStructVectorConstantValues ) +#define hypre_SMGSetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGSetTol ) +#define hypre_SMGSetZeroGuess HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGSetZeroGuess ) +#define hypre_SMGSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGSetup ) +#define hypre_SMGSetupInterpOp HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGSetupInterpOp ) +#define hypre_SMGSetupRAPOp HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGSetupRAPOp ) +#define hypre_SMGSetupRestrictOp HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGSetupRestrictOp ) +#define hypre_SMGSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_SMGSolve ) +#define hypre_SemiBuildRAP HYPRE_FIXEDPRECISION_FUNC ( hypre_SemiBuildRAP ) +#define hypre_SemiCreateRAPOp HYPRE_FIXEDPRECISION_FUNC ( hypre_SemiCreateRAPOp ) +#define hypre_SemiInterp HYPRE_FIXEDPRECISION_FUNC ( hypre_SemiInterp ) +#define hypre_SemiInterpCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_SemiInterpCreate ) +#define hypre_SemiInterpDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_SemiInterpDestroy ) +#define hypre_SemiInterpSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_SemiInterpSetup ) +#define hypre_SemiRestrict HYPRE_FIXEDPRECISION_FUNC ( hypre_SemiRestrict ) +#define hypre_SemiRestrictCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_SemiRestrictCreate ) +#define hypre_SemiRestrictDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_SemiRestrictDestroy ) +#define hypre_SemiRestrictSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_SemiRestrictSetup ) +#define hypre_StructDiagScale HYPRE_FIXEDPRECISION_FUNC ( hypre_StructDiagScale ) +#define hypre_StructInterpAssemble HYPRE_FIXEDPRECISION_FUNC ( hypre_StructInterpAssemble ) +#define hypre_StructJacobiCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_StructJacobiCreate ) +#define hypre_StructJacobiDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_StructJacobiDestroy ) +#define hypre_StructJacobiGetFinalRelativeResidualNorm HYPRE_FIXEDPRECISION_FUNC ( hypre_StructJacobiGetFinalRelativeResidualNorm ) +#define hypre_StructJacobiGetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_StructJacobiGetMaxIter ) +#define hypre_StructJacobiGetNumIterations HYPRE_FIXEDPRECISION_FUNC ( hypre_StructJacobiGetNumIterations ) +#define hypre_StructJacobiGetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_StructJacobiGetTol ) +#define hypre_StructJacobiGetZeroGuess HYPRE_FIXEDPRECISION_FUNC ( hypre_StructJacobiGetZeroGuess ) +#define hypre_StructJacobiSetMaxIter HYPRE_FIXEDPRECISION_FUNC ( hypre_StructJacobiSetMaxIter ) +#define hypre_StructJacobiSetTempVec HYPRE_FIXEDPRECISION_FUNC ( hypre_StructJacobiSetTempVec ) +#define hypre_StructJacobiSetTol HYPRE_FIXEDPRECISION_FUNC ( hypre_StructJacobiSetTol ) +#define hypre_StructJacobiSetWeight HYPRE_FIXEDPRECISION_FUNC ( hypre_StructJacobiSetWeight ) +#define hypre_StructJacobiSetZeroGuess HYPRE_FIXEDPRECISION_FUNC ( hypre_StructJacobiSetZeroGuess ) +#define hypre_StructJacobiSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_StructJacobiSetup ) +#define hypre_StructJacobiSolve HYPRE_FIXEDPRECISION_FUNC ( hypre_StructJacobiSolve ) +#define hypre_StructKrylovAxpy HYPRE_FIXEDPRECISION_FUNC ( hypre_StructKrylovAxpy ) +#define hypre_StructKrylovCAlloc HYPRE_FIXEDPRECISION_FUNC ( hypre_StructKrylovCAlloc ) +#define hypre_StructKrylovClearVector HYPRE_FIXEDPRECISION_FUNC ( hypre_StructKrylovClearVector ) +#define hypre_StructKrylovCommInfo HYPRE_FIXEDPRECISION_FUNC ( hypre_StructKrylovCommInfo ) +#define hypre_StructKrylovCopyVector HYPRE_FIXEDPRECISION_FUNC ( hypre_StructKrylovCopyVector ) +#define hypre_StructKrylovCreateVector HYPRE_FIXEDPRECISION_FUNC ( hypre_StructKrylovCreateVector ) +#define hypre_StructKrylovCreateVectorArray HYPRE_FIXEDPRECISION_FUNC ( hypre_StructKrylovCreateVectorArray ) +#define hypre_StructKrylovDestroyVector HYPRE_FIXEDPRECISION_FUNC ( hypre_StructKrylovDestroyVector ) +#define hypre_StructKrylovFree HYPRE_FIXEDPRECISION_FUNC ( hypre_StructKrylovFree ) +#define hypre_StructKrylovIdentity HYPRE_FIXEDPRECISION_FUNC ( hypre_StructKrylovIdentity ) +#define hypre_StructKrylovIdentitySetup HYPRE_FIXEDPRECISION_FUNC ( hypre_StructKrylovIdentitySetup ) +#define hypre_StructKrylovInnerProd HYPRE_FIXEDPRECISION_FUNC ( hypre_StructKrylovInnerProd ) +#define hypre_StructKrylovInnerProdTagged HYPRE_FIXEDPRECISION_FUNC ( hypre_StructKrylovInnerProdTagged ) +#define hypre_StructKrylovMatvec HYPRE_FIXEDPRECISION_FUNC ( hypre_StructKrylovMatvec ) +#define hypre_StructKrylovMatvecCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_StructKrylovMatvecCreate ) +#define hypre_StructKrylovMatvecDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_StructKrylovMatvecDestroy ) +#define hypre_StructKrylovScaleVector HYPRE_FIXEDPRECISION_FUNC ( hypre_StructKrylovScaleVector ) +#define hypre_StructKrylovSetRandomValues HYPRE_FIXEDPRECISION_FUNC ( hypre_StructKrylovSetRandomValues ) +#define hypre_structbicgstabcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_structbicgstabcreate ) +#define hypre_structbicgstabdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_structbicgstabdestroy ) +#define hypre_structbicgstabgetfinalrel HYPRE_FIXEDPRECISION_FUNC ( hypre_structbicgstabgetfinalrel ) +#define hypre_structbicgstabgetnumitera HYPRE_FIXEDPRECISION_FUNC ( hypre_structbicgstabgetnumitera ) +#define hypre_structbicgstabgetresidual HYPRE_FIXEDPRECISION_FUNC ( hypre_structbicgstabgetresidual ) +#define hypre_structbicgstabsetabstol HYPRE_FIXEDPRECISION_FUNC ( hypre_structbicgstabsetabstol ) +#define hypre_structbicgstabsetlogging HYPRE_FIXEDPRECISION_FUNC ( hypre_structbicgstabsetlogging ) +#define hypre_structbicgstabsetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_structbicgstabsetmaxiter ) +#define hypre_structbicgstabsetprecond HYPRE_FIXEDPRECISION_FUNC ( hypre_structbicgstabsetprecond ) +#define hypre_structbicgstabsetprintlev HYPRE_FIXEDPRECISION_FUNC ( hypre_structbicgstabsetprintlev ) +#define hypre_structbicgstabsettol HYPRE_FIXEDPRECISION_FUNC ( hypre_structbicgstabsettol ) +#define hypre_structbicgstabsetup HYPRE_FIXEDPRECISION_FUNC ( hypre_structbicgstabsetup ) +#define hypre_structbicgstabsolve HYPRE_FIXEDPRECISION_FUNC ( hypre_structbicgstabsolve ) +#define hypre_structcycredcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_structcycredcreate ) +#define hypre_structcycreddestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_structcycreddestroy ) +#define hypre_structcycredsetbase HYPRE_FIXEDPRECISION_FUNC ( hypre_structcycredsetbase ) +#define hypre_structcycredsettdim HYPRE_FIXEDPRECISION_FUNC ( hypre_structcycredsettdim ) +#define hypre_structcycredsetup HYPRE_FIXEDPRECISION_FUNC ( hypre_structcycredsetup ) +#define hypre_structcycredsolve HYPRE_FIXEDPRECISION_FUNC ( hypre_structcycredsolve ) +#define hypre_structdiagscale HYPRE_FIXEDPRECISION_FUNC ( hypre_structdiagscale ) +#define hypre_structdiagscalesetup HYPRE_FIXEDPRECISION_FUNC ( hypre_structdiagscalesetup ) +#define hypre_structfgmrescreate HYPRE_FIXEDPRECISION_FUNC ( hypre_structfgmrescreate ) +#define hypre_structfgmresdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_structfgmresdestroy ) +#define hypre_structfgmresgetfinalrel HYPRE_FIXEDPRECISION_FUNC ( hypre_structfgmresgetfinalrel ) +#define hypre_structfgmresgetnumiter HYPRE_FIXEDPRECISION_FUNC ( hypre_structfgmresgetnumiter ) +#define hypre_structfgmressetabstol HYPRE_FIXEDPRECISION_FUNC ( hypre_structfgmressetabstol ) +#define hypre_structfgmressetkdim HYPRE_FIXEDPRECISION_FUNC ( hypre_structfgmressetkdim ) +#define hypre_structfgmressetlogging HYPRE_FIXEDPRECISION_FUNC ( hypre_structfgmressetlogging ) +#define hypre_structfgmressetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_structfgmressetmaxiter ) +#define hypre_structfgmressetprecond HYPRE_FIXEDPRECISION_FUNC ( hypre_structfgmressetprecond ) +#define hypre_structfgmressetprintlevel HYPRE_FIXEDPRECISION_FUNC ( hypre_structfgmressetprintlevel ) +#define hypre_structfgmressettol HYPRE_FIXEDPRECISION_FUNC ( hypre_structfgmressettol ) +#define hypre_structfgmressetup HYPRE_FIXEDPRECISION_FUNC ( hypre_structfgmressetup ) +#define hypre_structfgmressolve HYPRE_FIXEDPRECISION_FUNC ( hypre_structfgmressolve ) +#define hypre_structgmrescreate HYPRE_FIXEDPRECISION_FUNC ( hypre_structgmrescreate ) +#define hypre_structgmresdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_structgmresdestroy ) +#define hypre_structgmresgetfinalrelati HYPRE_FIXEDPRECISION_FUNC ( hypre_structgmresgetfinalrelati ) +#define hypre_structgmresgetnumiteratio HYPRE_FIXEDPRECISION_FUNC ( hypre_structgmresgetnumiteratio ) +#define hypre_structgmressetabstol HYPRE_FIXEDPRECISION_FUNC ( hypre_structgmressetabstol ) +#define hypre_structgmressetkdim HYPRE_FIXEDPRECISION_FUNC ( hypre_structgmressetkdim ) +#define hypre_structgmressetlogging HYPRE_FIXEDPRECISION_FUNC ( hypre_structgmressetlogging ) +#define hypre_structgmressetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_structgmressetmaxiter ) +#define hypre_structgmressetprecond HYPRE_FIXEDPRECISION_FUNC ( hypre_structgmressetprecond ) +#define hypre_structgmressetprintlevel HYPRE_FIXEDPRECISION_FUNC ( hypre_structgmressetprintlevel ) +#define hypre_structgmressettol HYPRE_FIXEDPRECISION_FUNC ( hypre_structgmressettol ) +#define hypre_structgmressetup HYPRE_FIXEDPRECISION_FUNC ( hypre_structgmressetup ) +#define hypre_structgmressolve HYPRE_FIXEDPRECISION_FUNC ( hypre_structgmressolve ) +#define hypre_structhybridcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_structhybridcreate ) +#define hypre_structhybriddestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_structhybriddestroy ) +#define hypre_structhybridgetdscgnumite HYPRE_FIXEDPRECISION_FUNC ( hypre_structhybridgetdscgnumite ) +#define hypre_structhybridgetfinalrelat HYPRE_FIXEDPRECISION_FUNC ( hypre_structhybridgetfinalrelat ) +#define hypre_structhybridgetnumiterati HYPRE_FIXEDPRECISION_FUNC ( hypre_structhybridgetnumiterati ) +#define hypre_structhybridgetpcgnumiter HYPRE_FIXEDPRECISION_FUNC ( hypre_structhybridgetpcgnumiter ) +#define hypre_structhybridsetconvergenc HYPRE_FIXEDPRECISION_FUNC ( hypre_structhybridsetconvergenc ) +#define hypre_structhybridsetdscgmaxite HYPRE_FIXEDPRECISION_FUNC ( hypre_structhybridsetdscgmaxite ) +#define hypre_structhybridsetkdim HYPRE_FIXEDPRECISION_FUNC ( hypre_structhybridsetkdim ) +#define hypre_structhybridsetlogging HYPRE_FIXEDPRECISION_FUNC ( hypre_structhybridsetlogging ) +#define hypre_structhybridsetpcgabsolut HYPRE_FIXEDPRECISION_FUNC ( hypre_structhybridsetpcgabsolut ) +#define hypre_structhybridsetpcgmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_structhybridsetpcgmaxiter ) +#define hypre_structhybridsetprecond HYPRE_FIXEDPRECISION_FUNC ( hypre_structhybridsetprecond ) +#define hypre_structhybridsetprintlevel HYPRE_FIXEDPRECISION_FUNC ( hypre_structhybridsetprintlevel ) +#define hypre_structhybridsetrelchange HYPRE_FIXEDPRECISION_FUNC ( hypre_structhybridsetrelchange ) +#define hypre_structhybridsetsolvertype HYPRE_FIXEDPRECISION_FUNC ( hypre_structhybridsetsolvertype ) +#define hypre_structhybridsetstopcrit HYPRE_FIXEDPRECISION_FUNC ( hypre_structhybridsetstopcrit ) +#define hypre_structhybridsettol HYPRE_FIXEDPRECISION_FUNC ( hypre_structhybridsettol ) +#define hypre_structhybridsettwonorm HYPRE_FIXEDPRECISION_FUNC ( hypre_structhybridsettwonorm ) +#define hypre_structhybridsetup HYPRE_FIXEDPRECISION_FUNC ( hypre_structhybridsetup ) +#define hypre_structhybridsolve HYPRE_FIXEDPRECISION_FUNC ( hypre_structhybridsolve ) +#define hypre_structjacobicreate HYPRE_FIXEDPRECISION_FUNC ( hypre_structjacobicreate ) +#define hypre_structjacobidestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_structjacobidestroy ) +#define hypre_structjacobigetfinalrelat HYPRE_FIXEDPRECISION_FUNC ( hypre_structjacobigetfinalrelat ) +#define hypre_structjacobigetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_structjacobigetmaxiter ) +#define hypre_structjacobigetnumiterati HYPRE_FIXEDPRECISION_FUNC ( hypre_structjacobigetnumiterati ) +#define hypre_structjacobigettol HYPRE_FIXEDPRECISION_FUNC ( hypre_structjacobigettol ) +#define hypre_structjacobigetzeroguess HYPRE_FIXEDPRECISION_FUNC ( hypre_structjacobigetzeroguess ) +#define hypre_structjacobisetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_structjacobisetmaxiter ) +#define hypre_structjacobisetnonzerogue HYPRE_FIXEDPRECISION_FUNC ( hypre_structjacobisetnonzerogue ) +#define hypre_structjacobisettol HYPRE_FIXEDPRECISION_FUNC ( hypre_structjacobisettol ) +#define hypre_structjacobisetup HYPRE_FIXEDPRECISION_FUNC ( hypre_structjacobisetup ) +#define hypre_structjacobisetzeroguess HYPRE_FIXEDPRECISION_FUNC ( hypre_structjacobisetzeroguess ) +#define hypre_structjacobisolve HYPRE_FIXEDPRECISION_FUNC ( hypre_structjacobisolve ) +#define hypre_structlgmrescreate HYPRE_FIXEDPRECISION_FUNC ( hypre_structlgmrescreate ) +#define hypre_structlgmresdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_structlgmresdestroy ) +#define hypre_structlgmresgetfinalrel HYPRE_FIXEDPRECISION_FUNC ( hypre_structlgmresgetfinalrel ) +#define hypre_structlgmresgetnumiter HYPRE_FIXEDPRECISION_FUNC ( hypre_structlgmresgetnumiter ) +#define hypre_structlgmressetabstol HYPRE_FIXEDPRECISION_FUNC ( hypre_structlgmressetabstol ) +#define hypre_structlgmressetaugdim HYPRE_FIXEDPRECISION_FUNC ( hypre_structlgmressetaugdim ) +#define hypre_structlgmressetkdim HYPRE_FIXEDPRECISION_FUNC ( hypre_structlgmressetkdim ) +#define hypre_structlgmressetlogging HYPRE_FIXEDPRECISION_FUNC ( hypre_structlgmressetlogging ) +#define hypre_structlgmressetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_structlgmressetmaxiter ) +#define hypre_structlgmressetprecond HYPRE_FIXEDPRECISION_FUNC ( hypre_structlgmressetprecond ) +#define hypre_structlgmressetprintlevel HYPRE_FIXEDPRECISION_FUNC ( hypre_structlgmressetprintlevel ) +#define hypre_structlgmressettol HYPRE_FIXEDPRECISION_FUNC ( hypre_structlgmressettol ) +#define hypre_structlgmressetup HYPRE_FIXEDPRECISION_FUNC ( hypre_structlgmressetup ) +#define hypre_structlgmressolve HYPRE_FIXEDPRECISION_FUNC ( hypre_structlgmressolve ) +#define hypre_structpcgcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_structpcgcreate ) +#define hypre_structpcgdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_structpcgdestroy ) +#define hypre_structpcggetfinalrelative HYPRE_FIXEDPRECISION_FUNC ( hypre_structpcggetfinalrelative ) +#define hypre_structpcggetnumiterations HYPRE_FIXEDPRECISION_FUNC ( hypre_structpcggetnumiterations ) +#define hypre_structpcgsetabstol HYPRE_FIXEDPRECISION_FUNC ( hypre_structpcgsetabstol ) +#define hypre_structpcgsetlogging HYPRE_FIXEDPRECISION_FUNC ( hypre_structpcgsetlogging ) +#define hypre_structpcgsetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_structpcgsetmaxiter ) +#define hypre_structpcgsetprecond HYPRE_FIXEDPRECISION_FUNC ( hypre_structpcgsetprecond ) +#define hypre_structpcgsetprintlevel HYPRE_FIXEDPRECISION_FUNC ( hypre_structpcgsetprintlevel ) +#define hypre_structpcgsetrelchange HYPRE_FIXEDPRECISION_FUNC ( hypre_structpcgsetrelchange ) +#define hypre_structpcgsettol HYPRE_FIXEDPRECISION_FUNC ( hypre_structpcgsettol ) +#define hypre_structpcgsettwonorm HYPRE_FIXEDPRECISION_FUNC ( hypre_structpcgsettwonorm ) +#define hypre_structpcgsetup HYPRE_FIXEDPRECISION_FUNC ( hypre_structpcgsetup ) +#define hypre_structpcgsolve HYPRE_FIXEDPRECISION_FUNC ( hypre_structpcgsolve ) +#define hypre_structpfmgcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmgcreate ) +#define hypre_structpfmgdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmgdestroy ) +#define hypre_structpfmggetfinalrelativ HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmggetfinalrelativ ) +#define hypre_structpfmggetlogging HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmggetlogging ) +#define hypre_structpfmggetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmggetmaxiter ) +#define hypre_structpfmggetmaxlevels HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmggetmaxlevels ) +#define hypre_structpfmggetnumiteration HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmggetnumiteration ) +#define hypre_structpfmggetnumpostrelax HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmggetnumpostrelax ) +#define hypre_structpfmggetnumprerelax HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmggetnumprerelax ) +#define hypre_structpfmggetprintlevel HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmggetprintlevel ) +#define hypre_structpfmggetraptype HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmggetraptype ) +#define hypre_structpfmggetrelaxtype HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmggetrelaxtype ) +#define hypre_structpfmggetrelchange HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmggetrelchange ) +#define hypre_structpfmggetskiprelax HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmggetskiprelax ) +#define hypre_structpfmggettol HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmggettol ) +#define hypre_structpfmggetzeroguess HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmggetzeroguess ) +#define hypre_structpfmgsetdxyz HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmgsetdxyz ) +#define hypre_structpfmgsetjacobiweigh HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmgsetjacobiweigh ) +#define hypre_structpfmgsetlogging HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmgsetlogging ) +#define hypre_structpfmgsetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmgsetmaxiter ) +#define hypre_structpfmgsetmaxlevels HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmgsetmaxlevels ) +#define hypre_structpfmgsetnonzeroguess HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmgsetnonzeroguess ) +#define hypre_structpfmgsetnumpostrelax HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmgsetnumpostrelax ) +#define hypre_structpfmgsetnumprerelax HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmgsetnumprerelax ) +#define hypre_structpfmgsetprintlevel HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmgsetprintlevel ) +#define hypre_structpfmgsetraptype HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmgsetraptype ) +#define hypre_structpfmgsetrelaxtype HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmgsetrelaxtype ) +#define hypre_structpfmgsetrelchange HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmgsetrelchange ) +#define hypre_structpfmgsetskiprelax HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmgsetskiprelax ) +#define hypre_structpfmgsettol HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmgsettol ) +#define hypre_structpfmgsetup HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmgsetup ) +#define hypre_structpfmgsetzeroguess HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmgsetzeroguess ) +#define hypre_structpfmgsolve HYPRE_FIXEDPRECISION_FUNC ( hypre_structpfmgsolve ) +#define hypre_structsetupinterpreter HYPRE_FIXEDPRECISION_FUNC ( hypre_structsetupinterpreter ) +#define hypre_structsetupmatvec HYPRE_FIXEDPRECISION_FUNC ( hypre_structsetupmatvec ) +#define hypre_structsmgcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_structsmgcreate ) +#define hypre_structsmgdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_structsmgdestroy ) +#define hypre_structsmggetfinalrelative HYPRE_FIXEDPRECISION_FUNC ( hypre_structsmggetfinalrelative ) +#define hypre_structsmggetlogging HYPRE_FIXEDPRECISION_FUNC ( hypre_structsmggetlogging ) +#define hypre_structsmggetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_structsmggetmaxiter ) +#define hypre_structsmggetmemoryuse HYPRE_FIXEDPRECISION_FUNC ( hypre_structsmggetmemoryuse ) +#define hypre_structsmggetnumiterations HYPRE_FIXEDPRECISION_FUNC ( hypre_structsmggetnumiterations ) +#define hypre_structsmggetnumpostrelax HYPRE_FIXEDPRECISION_FUNC ( hypre_structsmggetnumpostrelax ) +#define hypre_structsmggetnumprerelax HYPRE_FIXEDPRECISION_FUNC ( hypre_structsmggetnumprerelax ) +#define hypre_structsmggetprintlevel HYPRE_FIXEDPRECISION_FUNC ( hypre_structsmggetprintlevel ) +#define hypre_structsmggetrelchange HYPRE_FIXEDPRECISION_FUNC ( hypre_structsmggetrelchange ) +#define hypre_structsmggettol HYPRE_FIXEDPRECISION_FUNC ( hypre_structsmggettol ) +#define hypre_structsmggetzeroguess HYPRE_FIXEDPRECISION_FUNC ( hypre_structsmggetzeroguess ) +#define hypre_structsmgsetlogging HYPRE_FIXEDPRECISION_FUNC ( hypre_structsmgsetlogging ) +#define hypre_structsmgsetmaxiter HYPRE_FIXEDPRECISION_FUNC ( hypre_structsmgsetmaxiter ) +#define hypre_structsmgsetmemoryuse HYPRE_FIXEDPRECISION_FUNC ( hypre_structsmgsetmemoryuse ) +#define hypre_structsmgsetnonzeroguess HYPRE_FIXEDPRECISION_FUNC ( hypre_structsmgsetnonzeroguess ) +#define hypre_structsmgsetnumpostrelax HYPRE_FIXEDPRECISION_FUNC ( hypre_structsmgsetnumpostrelax ) +#define hypre_structsmgsetnumprerelax HYPRE_FIXEDPRECISION_FUNC ( hypre_structsmgsetnumprerelax ) +#define hypre_structsmgsetprintlevel HYPRE_FIXEDPRECISION_FUNC ( hypre_structsmgsetprintlevel ) +#define hypre_structsmgsetrelchange HYPRE_FIXEDPRECISION_FUNC ( hypre_structsmgsetrelchange ) +#define hypre_structsmgsettol HYPRE_FIXEDPRECISION_FUNC ( hypre_structsmgsettol ) +#define hypre_structsmgsetup HYPRE_FIXEDPRECISION_FUNC ( hypre_structsmgsetup ) +#define hypre_structsmgsetzeroguess HYPRE_FIXEDPRECISION_FUNC ( hypre_structsmgsetzeroguess ) +#define hypre_structsmgsolve HYPRE_FIXEDPRECISION_FUNC ( hypre_structsmgsolve ) + +#endif diff --git a/src/struct_ls/_hypre_struct_ls_mup_undef.h b/src/struct_ls/_hypre_struct_ls_mup_undef.h new file mode 100644 index 0000000000..0a8719fe60 --- /dev/null +++ b/src/struct_ls/_hypre_struct_ls_mup_undef.h @@ -0,0 +1,619 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#undef hypre_STRUCT_LS_MUP_DEF_HEADER + +#undef HYPRE_StructBiCGSTABCreate +#undef HYPRE_StructBiCGSTABDestroy +#undef HYPRE_StructBiCGSTABGetFinalRelativeResidualNorm +#undef HYPRE_StructBiCGSTABGetNumIterations +#undef HYPRE_StructBiCGSTABGetResidual +#undef HYPRE_StructBiCGSTABSetAbsoluteTol +#undef HYPRE_StructBiCGSTABSetLogging +#undef HYPRE_StructBiCGSTABSetMaxIter +#undef HYPRE_StructBiCGSTABSetPrecond +#undef HYPRE_StructBiCGSTABSetPrintLevel +#undef HYPRE_StructBiCGSTABSetTol +#undef HYPRE_StructBiCGSTABSetup +#undef HYPRE_StructBiCGSTABSolve +#undef HYPRE_StructCycRedCreate +#undef HYPRE_StructCycRedDestroy +#undef HYPRE_StructCycRedSetBase +#undef HYPRE_StructCycRedSetTDim +#undef HYPRE_StructCycRedSetup +#undef HYPRE_StructCycRedSolve +#undef HYPRE_StructDiagScale +#undef HYPRE_StructDiagScaleSetup +#undef HYPRE_StructFlexGMRESCreate +#undef HYPRE_StructFlexGMRESDestroy +#undef HYPRE_StructFlexGMRESGetFinalRelativeResidualNorm +#undef HYPRE_StructFlexGMRESGetNumIterations +#undef HYPRE_StructFlexGMRESSetAbsoluteTol +#undef HYPRE_StructFlexGMRESSetKDim +#undef HYPRE_StructFlexGMRESSetLogging +#undef HYPRE_StructFlexGMRESSetMaxIter +#undef HYPRE_StructFlexGMRESSetModifyPC +#undef HYPRE_StructFlexGMRESSetPrecond +#undef HYPRE_StructFlexGMRESSetPrintLevel +#undef HYPRE_StructFlexGMRESSetTol +#undef HYPRE_StructFlexGMRESSetup +#undef HYPRE_StructFlexGMRESSolve +#undef HYPRE_StructGMRESCreate +#undef HYPRE_StructGMRESDestroy +#undef HYPRE_StructGMRESGetFinalRelativeResidualNorm +#undef HYPRE_StructGMRESGetNumIterations +#undef HYPRE_StructGMRESSetAbsoluteTol +#undef HYPRE_StructGMRESSetKDim +#undef HYPRE_StructGMRESSetLogging +#undef HYPRE_StructGMRESSetMaxIter +#undef HYPRE_StructGMRESSetPrecond +#undef HYPRE_StructGMRESSetPrintLevel +#undef HYPRE_StructGMRESSetTol +#undef HYPRE_StructGMRESSetup +#undef HYPRE_StructGMRESSolve +#undef HYPRE_StructHybridCreate +#undef HYPRE_StructHybridDestroy +#undef HYPRE_StructHybridGetDSCGNumIterations +#undef HYPRE_StructHybridGetFinalRelativeResidualNorm +#undef HYPRE_StructHybridGetNumIterations +#undef HYPRE_StructHybridGetPCGNumIterations +#undef HYPRE_StructHybridGetRecomputeResidual +#undef HYPRE_StructHybridGetRecomputeResidualP +#undef HYPRE_StructHybridSetConvergenceTol +#undef HYPRE_StructHybridSetDSCGMaxIter +#undef HYPRE_StructHybridSetKDim +#undef HYPRE_StructHybridSetLogging +#undef HYPRE_StructHybridSetPCGAbsoluteTolFactor +#undef HYPRE_StructHybridSetPCGMaxIter +#undef HYPRE_StructHybridSetPrecond +#undef HYPRE_StructHybridSetPrintLevel +#undef HYPRE_StructHybridSetRecomputeResidual +#undef HYPRE_StructHybridSetRecomputeResidualP +#undef HYPRE_StructHybridSetRelChange +#undef HYPRE_StructHybridSetSolverType +#undef HYPRE_StructHybridSetStopCrit +#undef HYPRE_StructHybridSetTol +#undef HYPRE_StructHybridSetTwoNorm +#undef HYPRE_StructHybridSetup +#undef HYPRE_StructHybridSolve +#undef HYPRE_StructJacobiCreate +#undef HYPRE_StructJacobiDestroy +#undef HYPRE_StructJacobiGetFinalRelativeResidualNorm +#undef HYPRE_StructJacobiGetMaxIter +#undef HYPRE_StructJacobiGetNumIterations +#undef HYPRE_StructJacobiGetTol +#undef HYPRE_StructJacobiGetZeroGuess +#undef HYPRE_StructJacobiSetMaxIter +#undef HYPRE_StructJacobiSetNonZeroGuess +#undef HYPRE_StructJacobiSetTol +#undef HYPRE_StructJacobiSetZeroGuess +#undef HYPRE_StructJacobiSetup +#undef HYPRE_StructJacobiSolve +#undef HYPRE_StructLGMRESCreate +#undef HYPRE_StructLGMRESDestroy +#undef HYPRE_StructLGMRESGetFinalRelativeResidualNorm +#undef HYPRE_StructLGMRESGetNumIterations +#undef HYPRE_StructLGMRESSetAbsoluteTol +#undef HYPRE_StructLGMRESSetAugDim +#undef HYPRE_StructLGMRESSetKDim +#undef HYPRE_StructLGMRESSetLogging +#undef HYPRE_StructLGMRESSetMaxIter +#undef HYPRE_StructLGMRESSetPrecond +#undef HYPRE_StructLGMRESSetPrintLevel +#undef HYPRE_StructLGMRESSetTol +#undef HYPRE_StructLGMRESSetup +#undef HYPRE_StructLGMRESSolve +#undef HYPRE_StructPCGCreate +#undef HYPRE_StructPCGDestroy +#undef HYPRE_StructPCGGetFinalRelativeResidualNorm +#undef HYPRE_StructPCGGetNumIterations +#undef HYPRE_StructPCGSetAbsoluteTol +#undef HYPRE_StructPCGSetLogging +#undef HYPRE_StructPCGSetMaxIter +#undef HYPRE_StructPCGSetPrecond +#undef HYPRE_StructPCGSetPrintLevel +#undef HYPRE_StructPCGSetRelChange +#undef HYPRE_StructPCGSetTol +#undef HYPRE_StructPCGSetTwoNorm +#undef HYPRE_StructPCGSetup +#undef HYPRE_StructPCGSolve +#undef HYPRE_StructPFMGCreate +#undef HYPRE_StructPFMGDestroy +#undef HYPRE_StructPFMGGetFinalRelativeResidualNorm +#undef HYPRE_StructPFMGGetJacobiWeight +#undef HYPRE_StructPFMGGetLogging +#undef HYPRE_StructPFMGGetMatmultType +#undef HYPRE_StructPFMGGetMaxIter +#undef HYPRE_StructPFMGGetMaxLevels +#undef HYPRE_StructPFMGGetNumIterations +#undef HYPRE_StructPFMGGetNumPostRelax +#undef HYPRE_StructPFMGGetNumPreRelax +#undef HYPRE_StructPFMGGetPrintLevel +#undef HYPRE_StructPFMGGetRAPType +#undef HYPRE_StructPFMGGetRelChange +#undef HYPRE_StructPFMGGetRelaxType +#undef HYPRE_StructPFMGGetSkipRelax +#undef HYPRE_StructPFMGGetTol +#undef HYPRE_StructPFMGGetZeroGuess +#undef HYPRE_StructPFMGSetDxyz +#undef HYPRE_StructPFMGSetJacobiWeight +#undef HYPRE_StructPFMGSetLogging +#undef HYPRE_StructPFMGSetMatmultType +#undef HYPRE_StructPFMGSetMaxIter +#undef HYPRE_StructPFMGSetMaxLevels +#undef HYPRE_StructPFMGSetNonZeroGuess +#undef HYPRE_StructPFMGSetNumPostRelax +#undef HYPRE_StructPFMGSetNumPreRelax +#undef HYPRE_StructPFMGSetPrintLevel +#undef HYPRE_StructPFMGSetRAPType +#undef HYPRE_StructPFMGSetRelChange +#undef HYPRE_StructPFMGSetRelaxType +#undef HYPRE_StructPFMGSetSkipRelax +#undef HYPRE_StructPFMGSetTol +#undef HYPRE_StructPFMGSetZeroGuess +#undef HYPRE_StructPFMGSetup +#undef HYPRE_StructPFMGSolve +#undef HYPRE_StructSMGCreate +#undef HYPRE_StructSMGDestroy +#undef HYPRE_StructSMGGetFinalRelativeResidualNorm +#undef HYPRE_StructSMGGetLogging +#undef HYPRE_StructSMGGetMaxIter +#undef HYPRE_StructSMGGetMemoryUse +#undef HYPRE_StructSMGGetNumIterations +#undef HYPRE_StructSMGGetNumPostRelax +#undef HYPRE_StructSMGGetNumPreRelax +#undef HYPRE_StructSMGGetPrintLevel +#undef HYPRE_StructSMGGetRelChange +#undef HYPRE_StructSMGGetTol +#undef HYPRE_StructSMGGetZeroGuess +#undef HYPRE_StructSMGSetLogging +#undef HYPRE_StructSMGSetMaxIter +#undef HYPRE_StructSMGSetMemoryUse +#undef HYPRE_StructSMGSetNonZeroGuess +#undef HYPRE_StructSMGSetNumPostRelax +#undef HYPRE_StructSMGSetNumPreRelax +#undef HYPRE_StructSMGSetPrintLevel +#undef HYPRE_StructSMGSetRelChange +#undef HYPRE_StructSMGSetTol +#undef HYPRE_StructSMGSetZeroGuess +#undef HYPRE_StructSMGSetup +#undef HYPRE_StructSMGSolve +#undef HYPRE_StructSetupInterpreter +#undef HYPRE_StructSetupMatvec +#undef hypre_CycRedCreateCoarseOp +#undef hypre_CycRedSetupCoarseOp +#undef hypre_CyclicReduction +#undef hypre_CyclicReductionCreate +#undef hypre_CyclicReductionDestroy +#undef hypre_CyclicReductionSetBase +#undef hypre_CyclicReductionSetCDir +#undef hypre_CyclicReductionSetup +#undef hypre_HybridCreate +#undef hypre_HybridDestroy +#undef hypre_HybridGetDSCGNumIterations +#undef hypre_HybridGetFinalRelativeResidualNorm +#undef hypre_HybridGetNumIterations +#undef hypre_HybridGetPCGNumIterations +#undef hypre_HybridGetRecomputeResidual +#undef hypre_HybridGetRecomputeResidualP +#undef hypre_HybridSetConvergenceTol +#undef hypre_HybridSetDSCGMaxIter +#undef hypre_HybridSetKDim +#undef hypre_HybridSetLogging +#undef hypre_HybridSetPCGAbsoluteTolFactor +#undef hypre_HybridSetPCGMaxIter +#undef hypre_HybridSetPrecond +#undef hypre_HybridSetPrintLevel +#undef hypre_HybridSetRecomputeResidual +#undef hypre_HybridSetRecomputeResidualP +#undef hypre_HybridSetRelChange +#undef hypre_HybridSetSolverType +#undef hypre_HybridSetStopCrit +#undef hypre_HybridSetTol +#undef hypre_HybridSetTwoNorm +#undef hypre_HybridSetup +#undef hypre_HybridSolve +#undef hypre_HybridSolveUseBiCGSTAB +#undef hypre_HybridSolveUseGMRES +#undef hypre_HybridSolveUsePCG +#undef hypre_PFMG2BuildRAPNoSym +#undef hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC0 +#undef hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC1 +#undef hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC0 +#undef hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC1 +#undef hypre_PFMG2BuildRAPSym +#undef hypre_PFMG2BuildRAPSym_onebox_FSS5_CC0 +#undef hypre_PFMG2BuildRAPSym_onebox_FSS5_CC1 +#undef hypre_PFMG2BuildRAPSym_onebox_FSS9_CC0 +#undef hypre_PFMG2BuildRAPSym_onebox_FSS9_CC1 +#undef hypre_PFMG2CreateRAPOp +#undef hypre_PFMG3BuildRAPNoSym +#undef hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC0 +#undef hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC1 +#undef hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC0 +#undef hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC1 +#undef hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC0 +#undef hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC1 +#undef hypre_PFMG3BuildRAPSym +#undef hypre_PFMG3BuildRAPSym_onebox_FSS07_CC0 +#undef hypre_PFMG3BuildRAPSym_onebox_FSS07_CC1 +#undef hypre_PFMG3BuildRAPSym_onebox_FSS19_CC0 +#undef hypre_PFMG3BuildRAPSym_onebox_FSS19_CC1 +#undef hypre_PFMG3BuildRAPSym_onebox_FSS27_CC0 +#undef hypre_PFMG3BuildRAPSym_onebox_FSS27_CC1 +#undef hypre_PFMG3CreateRAPOp +#undef hypre_PFMGBuildCoarseOp5 +#undef hypre_PFMGBuildCoarseOp7 +#undef hypre_PFMGCoarsen +#undef hypre_PFMGComputeCxyz +#undef hypre_PFMGComputeCxyz_core_CC +#undef hypre_PFMGComputeCxyz_core_VC +#undef hypre_PFMGComputeDxyz +#undef hypre_PFMGComputeMaxLevels +#undef hypre_PFMGCreate +#undef hypre_PFMGCreateCoarseOp5 +#undef hypre_PFMGCreateCoarseOp7 +#undef hypre_PFMGCreateInterpOp +#undef hypre_PFMGCreateRAPOp +#undef hypre_PFMGDestroy +#undef hypre_PFMGGetFinalRelativeResidualNorm +#undef hypre_PFMGGetJacobiWeight +#undef hypre_PFMGGetLogging +#undef hypre_PFMGGetMatmultType +#undef hypre_PFMGGetMaxIter +#undef hypre_PFMGGetMaxLevels +#undef hypre_PFMGGetNumIterations +#undef hypre_PFMGGetNumPostRelax +#undef hypre_PFMGGetNumPreRelax +#undef hypre_PFMGGetPrintFreq +#undef hypre_PFMGGetPrintLevel +#undef hypre_PFMGGetRAPType +#undef hypre_PFMGGetRelChange +#undef hypre_PFMGGetRelaxType +#undef hypre_PFMGGetSkipRelax +#undef hypre_PFMGGetTol +#undef hypre_PFMGGetZeroGuess +#undef hypre_PFMGPrintLogging +#undef hypre_PFMGRelax +#undef hypre_PFMGRelaxCreate +#undef hypre_PFMGRelaxDestroy +#undef hypre_PFMGRelaxSetJacobiWeight +#undef hypre_PFMGRelaxSetMaxIter +#undef hypre_PFMGRelaxSetPostRelax +#undef hypre_PFMGRelaxSetPreRelax +#undef hypre_PFMGRelaxSetTempVec +#undef hypre_PFMGRelaxSetTol +#undef hypre_PFMGRelaxSetType +#undef hypre_PFMGRelaxSetZeroGuess +#undef hypre_PFMGRelaxSetup +#undef hypre_PFMGSetDxyz +#undef hypre_PFMGSetJacobiWeight +#undef hypre_PFMGSetLogging +#undef hypre_PFMGSetMatmultType +#undef hypre_PFMGSetMaxIter +#undef hypre_PFMGSetMaxLevels +#undef hypre_PFMGSetNumPostRelax +#undef hypre_PFMGSetNumPreRelax +#undef hypre_PFMGSetPrintFreq +#undef hypre_PFMGSetPrintLevel +#undef hypre_PFMGSetRAPType +#undef hypre_PFMGSetRelChange +#undef hypre_PFMGSetRelaxType +#undef hypre_PFMGSetSkipRelax +#undef hypre_PFMGSetTol +#undef hypre_PFMGSetZeroGuess +#undef hypre_PFMGSetup +#undef hypre_PFMGSetupInterpOp +#undef hypre_PFMGSetupInterpOp_core_CC +#undef hypre_PFMGSetupInterpOp_core_VC +#undef hypre_PFMGSetupRAPOp +#undef hypre_PFMGSolve +#undef hypre_RedBlackConstantCoefGS +#undef hypre_RedBlackGS +#undef hypre_RedBlackGSCreate +#undef hypre_RedBlackGSDestroy +#undef hypre_RedBlackGSSetMaxIter +#undef hypre_RedBlackGSSetStartBlack +#undef hypre_RedBlackGSSetStartRed +#undef hypre_RedBlackGSSetTol +#undef hypre_RedBlackGSSetZeroGuess +#undef hypre_RedBlackGSSetup +#undef hypre_SMG2BuildRAPNoSym +#undef hypre_SMG2BuildRAPSym +#undef hypre_SMG2CreateRAPOp +#undef hypre_SMG2RAPPeriodicNoSym +#undef hypre_SMG2RAPPeriodicSym +#undef hypre_SMG3BuildRAPNoSym +#undef hypre_SMG3BuildRAPSym +#undef hypre_SMG3CreateRAPOp +#undef hypre_SMG3RAPPeriodicNoSym +#undef hypre_SMG3RAPPeriodicSym +#undef hypre_SMGAxpy +#undef hypre_SMGCreate +#undef hypre_SMGCreateInterpOp +#undef hypre_SMGCreateRAPOp +#undef hypre_SMGCreateRestrictOp +#undef hypre_SMGDestroy +#undef hypre_SMGGetFinalRelativeResidualNorm +#undef hypre_SMGGetLogging +#undef hypre_SMGGetMaxIter +#undef hypre_SMGGetMemoryUse +#undef hypre_SMGGetNumIterations +#undef hypre_SMGGetNumPostRelax +#undef hypre_SMGGetNumPreRelax +#undef hypre_SMGGetPrintLevel +#undef hypre_SMGGetRelChange +#undef hypre_SMGGetTol +#undef hypre_SMGGetZeroGuess +#undef hypre_SMGPrintLogging +#undef hypre_SMGRelax +#undef hypre_SMGRelaxCreate +#undef hypre_SMGRelaxDestroy +#undef hypre_SMGRelaxDestroyARem +#undef hypre_SMGRelaxDestroyASol +#undef hypre_SMGRelaxDestroyTempVec +#undef hypre_SMGRelaxSetBase +#undef hypre_SMGRelaxSetMaxIter +#undef hypre_SMGRelaxSetMaxLevel +#undef hypre_SMGRelaxSetMemoryUse +#undef hypre_SMGRelaxSetNewMatrixStencil +#undef hypre_SMGRelaxSetNumPostRelax +#undef hypre_SMGRelaxSetNumPreRelax +#undef hypre_SMGRelaxSetNumPreSpaces +#undef hypre_SMGRelaxSetNumRegSpaces +#undef hypre_SMGRelaxSetNumSpaces +#undef hypre_SMGRelaxSetPreSpaceRank +#undef hypre_SMGRelaxSetRegSpaceRank +#undef hypre_SMGRelaxSetSpace +#undef hypre_SMGRelaxSetTempVec +#undef hypre_SMGRelaxSetTol +#undef hypre_SMGRelaxSetZeroGuess +#undef hypre_SMGRelaxSetup +#undef hypre_SMGRelaxSetupARem +#undef hypre_SMGRelaxSetupASol +#undef hypre_SMGRelaxSetupBaseBoxArray +#undef hypre_SMGRelaxSetupTempVec +#undef hypre_SMGResidual +#undef hypre_SMGResidualCreate +#undef hypre_SMGResidualDestroy +#undef hypre_SMGResidualSetBase +#undef hypre_SMGResidualSetup +#undef hypre_SMGSetBase +#undef hypre_SMGSetLogging +#undef hypre_SMGSetMaxIter +#undef hypre_SMGSetMaxLevel +#undef hypre_SMGSetMemoryUse +#undef hypre_SMGSetNumPostRelax +#undef hypre_SMGSetNumPreRelax +#undef hypre_SMGSetPrintLevel +#undef hypre_SMGSetRelChange +#undef hypre_SMGSetStructVectorConstantValues +#undef hypre_SMGSetTol +#undef hypre_SMGSetZeroGuess +#undef hypre_SMGSetup +#undef hypre_SMGSetupInterpOp +#undef hypre_SMGSetupRAPOp +#undef hypre_SMGSetupRestrictOp +#undef hypre_SMGSolve +#undef hypre_SemiBuildRAP +#undef hypre_SemiCreateRAPOp +#undef hypre_SemiInterp +#undef hypre_SemiInterpCreate +#undef hypre_SemiInterpDestroy +#undef hypre_SemiInterpSetup +#undef hypre_SemiRestrict +#undef hypre_SemiRestrictCreate +#undef hypre_SemiRestrictDestroy +#undef hypre_SemiRestrictSetup +#undef hypre_StructDiagScale +#undef hypre_StructInterpAssemble +#undef hypre_StructJacobiCreate +#undef hypre_StructJacobiDestroy +#undef hypre_StructJacobiGetFinalRelativeResidualNorm +#undef hypre_StructJacobiGetMaxIter +#undef hypre_StructJacobiGetNumIterations +#undef hypre_StructJacobiGetTol +#undef hypre_StructJacobiGetZeroGuess +#undef hypre_StructJacobiSetMaxIter +#undef hypre_StructJacobiSetTempVec +#undef hypre_StructJacobiSetTol +#undef hypre_StructJacobiSetWeight +#undef hypre_StructJacobiSetZeroGuess +#undef hypre_StructJacobiSetup +#undef hypre_StructJacobiSolve +#undef hypre_StructKrylovAxpy +#undef hypre_StructKrylovCAlloc +#undef hypre_StructKrylovClearVector +#undef hypre_StructKrylovCommInfo +#undef hypre_StructKrylovCopyVector +#undef hypre_StructKrylovCreateVector +#undef hypre_StructKrylovCreateVectorArray +#undef hypre_StructKrylovDestroyVector +#undef hypre_StructKrylovFree +#undef hypre_StructKrylovIdentity +#undef hypre_StructKrylovIdentitySetup +#undef hypre_StructKrylovInnerProd +#undef hypre_StructKrylovInnerProdTagged +#undef hypre_StructKrylovMatvec +#undef hypre_StructKrylovMatvecCreate +#undef hypre_StructKrylovMatvecDestroy +#undef hypre_StructKrylovScaleVector +#undef hypre_StructKrylovSetRandomValues +#undef hypre_structbicgstabcreate +#undef hypre_structbicgstabdestroy +#undef hypre_structbicgstabgetfinalrel +#undef hypre_structbicgstabgetnumitera +#undef hypre_structbicgstabgetresidual +#undef hypre_structbicgstabsetabstol +#undef hypre_structbicgstabsetlogging +#undef hypre_structbicgstabsetmaxiter +#undef hypre_structbicgstabsetprecond +#undef hypre_structbicgstabsetprintlev +#undef hypre_structbicgstabsettol +#undef hypre_structbicgstabsetup +#undef hypre_structbicgstabsolve +#undef hypre_structcycredcreate +#undef hypre_structcycreddestroy +#undef hypre_structcycredsetbase +#undef hypre_structcycredsettdim +#undef hypre_structcycredsetup +#undef hypre_structcycredsolve +#undef hypre_structdiagscale +#undef hypre_structdiagscalesetup +#undef hypre_structfgmrescreate +#undef hypre_structfgmresdestroy +#undef hypre_structfgmresgetfinalrel +#undef hypre_structfgmresgetnumiter +#undef hypre_structfgmressetabstol +#undef hypre_structfgmressetkdim +#undef hypre_structfgmressetlogging +#undef hypre_structfgmressetmaxiter +#undef hypre_structfgmressetprecond +#undef hypre_structfgmressetprintlevel +#undef hypre_structfgmressettol +#undef hypre_structfgmressetup +#undef hypre_structfgmressolve +#undef hypre_structgmrescreate +#undef hypre_structgmresdestroy +#undef hypre_structgmresgetfinalrelati +#undef hypre_structgmresgetnumiteratio +#undef hypre_structgmressetabstol +#undef hypre_structgmressetkdim +#undef hypre_structgmressetlogging +#undef hypre_structgmressetmaxiter +#undef hypre_structgmressetprecond +#undef hypre_structgmressetprintlevel +#undef hypre_structgmressettol +#undef hypre_structgmressetup +#undef hypre_structgmressolve +#undef hypre_structhybridcreate +#undef hypre_structhybriddestroy +#undef hypre_structhybridgetdscgnumite +#undef hypre_structhybridgetfinalrelat +#undef hypre_structhybridgetnumiterati +#undef hypre_structhybridgetpcgnumiter +#undef hypre_structhybridsetconvergenc +#undef hypre_structhybridsetdscgmaxite +#undef hypre_structhybridsetkdim +#undef hypre_structhybridsetlogging +#undef hypre_structhybridsetpcgabsolut +#undef hypre_structhybridsetpcgmaxiter +#undef hypre_structhybridsetprecond +#undef hypre_structhybridsetprintlevel +#undef hypre_structhybridsetrelchange +#undef hypre_structhybridsetsolvertype +#undef hypre_structhybridsetstopcrit +#undef hypre_structhybridsettol +#undef hypre_structhybridsettwonorm +#undef hypre_structhybridsetup +#undef hypre_structhybridsolve +#undef hypre_structjacobicreate +#undef hypre_structjacobidestroy +#undef hypre_structjacobigetfinalrelat +#undef hypre_structjacobigetmaxiter +#undef hypre_structjacobigetnumiterati +#undef hypre_structjacobigettol +#undef hypre_structjacobigetzeroguess +#undef hypre_structjacobisetmaxiter +#undef hypre_structjacobisetnonzerogue +#undef hypre_structjacobisettol +#undef hypre_structjacobisetup +#undef hypre_structjacobisetzeroguess +#undef hypre_structjacobisolve +#undef hypre_structlgmrescreate +#undef hypre_structlgmresdestroy +#undef hypre_structlgmresgetfinalrel +#undef hypre_structlgmresgetnumiter +#undef hypre_structlgmressetabstol +#undef hypre_structlgmressetaugdim +#undef hypre_structlgmressetkdim +#undef hypre_structlgmressetlogging +#undef hypre_structlgmressetmaxiter +#undef hypre_structlgmressetprecond +#undef hypre_structlgmressetprintlevel +#undef hypre_structlgmressettol +#undef hypre_structlgmressetup +#undef hypre_structlgmressolve +#undef hypre_structpcgcreate +#undef hypre_structpcgdestroy +#undef hypre_structpcggetfinalrelative +#undef hypre_structpcggetnumiterations +#undef hypre_structpcgsetabstol +#undef hypre_structpcgsetlogging +#undef hypre_structpcgsetmaxiter +#undef hypre_structpcgsetprecond +#undef hypre_structpcgsetprintlevel +#undef hypre_structpcgsetrelchange +#undef hypre_structpcgsettol +#undef hypre_structpcgsettwonorm +#undef hypre_structpcgsetup +#undef hypre_structpcgsolve +#undef hypre_structpfmgcreate +#undef hypre_structpfmgdestroy +#undef hypre_structpfmggetfinalrelativ +#undef hypre_structpfmggetlogging +#undef hypre_structpfmggetmaxiter +#undef hypre_structpfmggetmaxlevels +#undef hypre_structpfmggetnumiteration +#undef hypre_structpfmggetnumpostrelax +#undef hypre_structpfmggetnumprerelax +#undef hypre_structpfmggetprintlevel +#undef hypre_structpfmggetraptype +#undef hypre_structpfmggetrelaxtype +#undef hypre_structpfmggetrelchange +#undef hypre_structpfmggetskiprelax +#undef hypre_structpfmggettol +#undef hypre_structpfmggetzeroguess +#undef hypre_structpfmgsetdxyz +#undef hypre_structpfmgsetjacobiweigh +#undef hypre_structpfmgsetlogging +#undef hypre_structpfmgsetmaxiter +#undef hypre_structpfmgsetmaxlevels +#undef hypre_structpfmgsetnonzeroguess +#undef hypre_structpfmgsetnumpostrelax +#undef hypre_structpfmgsetnumprerelax +#undef hypre_structpfmgsetprintlevel +#undef hypre_structpfmgsetraptype +#undef hypre_structpfmgsetrelaxtype +#undef hypre_structpfmgsetrelchange +#undef hypre_structpfmgsetskiprelax +#undef hypre_structpfmgsettol +#undef hypre_structpfmgsetup +#undef hypre_structpfmgsetzeroguess +#undef hypre_structpfmgsolve +#undef hypre_structsetupinterpreter +#undef hypre_structsetupmatvec +#undef hypre_structsmgcreate +#undef hypre_structsmgdestroy +#undef hypre_structsmggetfinalrelative +#undef hypre_structsmggetlogging +#undef hypre_structsmggetmaxiter +#undef hypre_structsmggetmemoryuse +#undef hypre_structsmggetnumiterations +#undef hypre_structsmggetnumpostrelax +#undef hypre_structsmggetnumprerelax +#undef hypre_structsmggetprintlevel +#undef hypre_structsmggetrelchange +#undef hypre_structsmggettol +#undef hypre_structsmggetzeroguess +#undef hypre_structsmgsetlogging +#undef hypre_structsmgsetmaxiter +#undef hypre_structsmgsetmemoryuse +#undef hypre_structsmgsetnonzeroguess +#undef hypre_structsmgsetnumpostrelax +#undef hypre_structsmgsetnumprerelax +#undef hypre_structsmgsetprintlevel +#undef hypre_structsmgsetrelchange +#undef hypre_structsmgsettol +#undef hypre_structsmgsetup +#undef hypre_structsmgsetzeroguess +#undef hypre_structsmgsolve diff --git a/src/struct_ls/coarsen.c b/src/struct_ls/coarsen.c deleted file mode 100644 index 91e503f93a..0000000000 --- a/src/struct_ls/coarsen.c +++ /dev/null @@ -1,368 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other - * HYPRE Project Developers. See the top-level COPYRIGHT file for details. - * - * SPDX-License-Identifier: (Apache-2.0 OR MIT) - ******************************************************************************/ - -#define TIME_DEBUG 0 - -#if TIME_DEBUG -static HYPRE_Int s_coarsen_num = 0; -#endif - - -#include "_hypre_struct_ls.h" - -#define DEBUG 0 - -#if DEBUG -char filename[255]; -FILE *file; -static HYPRE_Int debug_count = 0; -#endif - -/*-------------------------------------------------------------------------- - * hypre_StructMapFineToCoarse - * - * NOTE: findex and cindex are indexes on the fine and coarse index space, and - * do not stand for "F-pt index" and "C-pt index". - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_StructMapFineToCoarse( hypre_Index findex, - hypre_Index index, - hypre_Index stride, - hypre_Index cindex ) -{ - hypre_IndexX(cindex) = - (hypre_IndexX(findex) - hypre_IndexX(index)) / hypre_IndexX(stride); - hypre_IndexY(cindex) = - (hypre_IndexY(findex) - hypre_IndexY(index)) / hypre_IndexY(stride); - hypre_IndexZ(cindex) = - (hypre_IndexZ(findex) - hypre_IndexZ(index)) / hypre_IndexZ(stride); - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - * hypre_StructMapCoarseToFine - * - * NOTE: findex and cindex are indexes on the fine and coarse index space, and - * do not stand for "F-pt index" and "C-pt index". - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_StructMapCoarseToFine( hypre_Index cindex, - hypre_Index index, - hypre_Index stride, - hypre_Index findex ) -{ - hypre_IndexX(findex) = - hypre_IndexX(cindex) * hypre_IndexX(stride) + hypre_IndexX(index); - hypre_IndexY(findex) = - hypre_IndexY(cindex) * hypre_IndexY(stride) + hypre_IndexY(index); - hypre_IndexZ(findex) = - hypre_IndexZ(cindex) * hypre_IndexZ(stride) + hypre_IndexZ(index); - - return hypre_error_flag; -} - -#define hypre_StructCoarsenBox(box, index, stride) \ - hypre_ProjectBox(box, index, stride); \ - hypre_StructMapFineToCoarse(hypre_BoxIMin(box), index, stride, \ - hypre_BoxIMin(box)); \ - hypre_StructMapFineToCoarse(hypre_BoxIMax(box), index, stride, \ - hypre_BoxIMax(box)) - -/*-------------------------------------------------------------------------- - * New version of hypre_StructCoarsen that uses the BoxManager (AHB 12/06) - * - * 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. - * - * 2. If "sufficient" neighbor information exists in the fine grid to be - * transferred to the coarse grid, then the coarse grid box manager can be - * created by simply coarsening all of the entries in the fine grid manager. - * ("Sufficient" is determined by checking max_distance in the fine grid.) - * - * 3. Otherwise, neighbor information will be collected during the - * StructGridAssemble according to the choosen value of max_distance for the - * coarse grid. - * - * 4. We do not need a separate version for the assumed partition case - * - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_StructCoarsen( hypre_StructGrid *fgrid, - hypre_Index index, - hypre_Index stride, - HYPRE_Int prune, - hypre_StructGrid **cgrid_ptr ) -{ - hypre_StructGrid *cgrid; - - MPI_Comm comm; - HYPRE_Int ndim; - - hypre_BoxArray *my_boxes; - - hypre_Index periodic; - hypre_Index ilower, iupper; - - hypre_Box *box; - hypre_Box *new_box; - hypre_Box *bounding_box; - - HYPRE_Int i, j, myid, count; - HYPRE_Int info_size, max_nentries; - HYPRE_Int num_entries; - HYPRE_Int *fids, *cids; - hypre_Index new_dist; - hypre_IndexRef max_distance; - HYPRE_Int proc, id; - HYPRE_Int coarsen_factor, known; - HYPRE_Int num, last_proc; -#if 0 - hypre_StructAssumedPart *fap = NULL, *cap = NULL; -#endif - hypre_BoxManager *fboxman, *cboxman; - - hypre_BoxManEntry *entries; - hypre_BoxManEntry *entry; - - void *entry_info = NULL; - -#if TIME_DEBUG - HYPRE_Int tindex; - char new_title[80]; - hypre_sprintf(new_title, "Coarsen.%d", s_coarsen_num); - tindex = hypre_InitializeTiming(new_title); - s_coarsen_num++; - - hypre_BeginTiming(tindex); -#endif - - hypre_SetIndex(ilower, 0); - hypre_SetIndex(iupper, 0); - - /* get relevant information from the fine grid */ - fids = hypre_StructGridIDs(fgrid); - fboxman = hypre_StructGridBoxMan(fgrid); - comm = hypre_StructGridComm(fgrid); - ndim = hypre_StructGridNDim(fgrid); - max_distance = hypre_StructGridMaxDistance(fgrid); - - /* initial */ - hypre_MPI_Comm_rank(comm, &myid ); - - /* create new coarse grid */ - hypre_StructGridCreate(comm, ndim, &cgrid); - - /* coarsen my boxes and create the coarse grid ids (same as fgrid) */ - my_boxes = hypre_BoxArrayDuplicate(hypre_StructGridBoxes(fgrid)); - cids = hypre_TAlloc(HYPRE_Int, hypre_BoxArraySize(my_boxes), HYPRE_MEMORY_HOST); - for (i = 0; i < hypre_BoxArraySize(my_boxes); i++) - { - box = hypre_BoxArrayBox(my_boxes, i); - hypre_StructCoarsenBox(box, index, stride); - cids[i] = fids[i]; - } - - /* prune? */ - /* zero volume boxes are needed when forming P and P^T */ - if (prune) - { - count = 0; - hypre_ForBoxI(i, my_boxes) - { - box = hypre_BoxArrayBox(my_boxes, i); - if (hypre_BoxVolume(box)) - { - hypre_CopyBox(box, hypre_BoxArrayBox(my_boxes, count)); - cids[count] = cids[i]; - count++; - } - } - hypre_BoxArraySetSize(my_boxes, count); - } - - /* set coarse grid boxes */ - hypre_StructGridSetBoxes(cgrid, my_boxes); - - /* 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_StructGridSetPeriodic(cgrid, periodic); - - /* Check the max_distance value of the fine grid to determine whether we will - need to re-gather information in the assemble. If we need to re-gather, - then the max_distance will be set to (0,0,0). Either way, we will create - and populate the box manager with the information from the fine grid. - - Note: if all global info is already known for a grid, the we do not need - to re-gather regardless of the max_distance values. */ - - for (i = 0; i < ndim; i++) - { - 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 */ - 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 */ - { - hypre_SetIndex(new_dist, 0); - hypre_StructGridSetMaxDistance(cgrid, new_dist); - } - - /* 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 */ - info_size = hypre_BoxManEntryInfoSize(fboxman); - max_nentries = hypre_BoxManMaxNEntries(fboxman); - 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); - - new_box = hypre_BoxCreate(ndim); - num = 0; - last_proc = -1; - - /* entries are sorted by (proc, id) pairs - may not have entries for all - processors, but for each processor represented, we do have all of its - boxes. We will keep them sorted in the new box manager - to avoid - re-sorting */ - for (i = 0; i < num_entries; i++) - { - entry = &entries[i]; - proc = hypre_BoxManEntryProc(entry); - - if (proc != myid) /* not my boxes */ - { - hypre_BoxManEntryGetExtents(entry, ilower, iupper); - hypre_BoxSetExtents(new_box, ilower, iupper); - hypre_StructCoarsenBox(new_box, index, stride); - id = hypre_BoxManEntryId(entry); - /* if there is pruning we need to adjust the ids if any boxes drop out - (we want these ids sequential - no gaps) - and zero boxes are not - kept in the box manager */ - if (prune) - { - if (proc != last_proc) - { - num = 0; - last_proc = proc; - } - if (hypre_BoxVolume(new_box)) - { - - hypre_BoxManAddEntry( cboxman, hypre_BoxIMin(new_box), - hypre_BoxIMax(new_box), proc, num, - entry_info); - num++; - } - } - else /* no pruning - just use id (note that size zero boxes will not be - saved in the box manager, so we will have gaps in the box - numbers) */ - { - 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) */ - { - if (proc != last_proc) /* just do this once (the first myid) */ - { - hypre_ForBoxI(j, my_boxes) - { - box = hypre_BoxArrayBox(my_boxes, j); - hypre_BoxManAddEntry( cboxman, hypre_BoxIMin(box), - hypre_BoxIMax(box), myid, j, - entry_info ); - } - last_proc = proc; - } - } - } /* loop through entries */ - - /* these entries are sorted */ - hypre_BoxManSetIsEntriesSort(cboxman, 1 ); - - hypre_BoxDestroy(new_box); - -#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 */ - - /* 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 */ - *cgrid_ptr = cgrid; - -#if TIME_DEBUG - hypre_EndTiming(tindex); -#endif - - return hypre_error_flag; -} - -#undef hypre_StructCoarsenBox diff --git a/src/struct_ls/cyclic_reduction.c b/src/struct_ls/cyclic_reduction.c index 7f045e5a96..583d441451 100644 --- a/src/struct_ls/cyclic_reduction.c +++ b/src/struct_ls/cyclic_reduction.c @@ -56,7 +56,6 @@ typedef struct HYPRE_Int num_levels; - HYPRE_Int ndim; HYPRE_Int cdir; /* coarsening direction */ hypre_Index base_index; hypre_Index base_stride; @@ -66,9 +65,6 @@ 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; hypre_StructVector **x_l; @@ -77,7 +73,7 @@ typedef struct HYPRE_Int time_index; HYPRE_BigInt solve_flops; - HYPRE_Int max_levels; + } hypre_CyclicReductionData; /*-------------------------------------------------------------------------- @@ -92,17 +88,13 @@ hypre_CyclicReductionCreate( MPI_Comm comm ) cyc_red_data = hypre_CTAlloc(hypre_CyclicReductionData, 1, HYPRE_MEMORY_HOST); (cyc_red_data -> comm) = comm; - (cyc_red_data -> ndim) = 3; (cyc_red_data -> cdir) = 0; (cyc_red_data -> time_index) = hypre_InitializeTiming("CyclicReduction"); - (cyc_red_data -> max_levels) = -1; /* set defaults */ 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; } @@ -127,13 +119,13 @@ hypre_CycRedCreateCoarseOp( hypre_StructMatrix *A, HYPRE_Int Ac_num_ghost[] = {0, 0, 0, 0, 0, 0}; HYPRE_Int i; - HYPRE_Int stencil_rank; + HYPRE_Int stencil_entry; /*----------------------------------------------- * Define Ac_stencil *-----------------------------------------------*/ - stencil_rank = 0; + stencil_entry = 0; /*----------------------------------------------- * non-symmetric case: @@ -147,10 +139,10 @@ hypre_CycRedCreateCoarseOp( hypre_StructMatrix *A, Ac_stencil_shape = hypre_CTAlloc(hypre_Index, Ac_stencil_size, HYPRE_MEMORY_HOST); for (i = -1; i < 2; i++) { - /* Storage for 3 elements (c,w,e) */ - hypre_SetIndex3(Ac_stencil_shape[stencil_rank], 0, 0, 0); - hypre_IndexD(Ac_stencil_shape[stencil_rank], cdir) = i; - stencil_rank++; + /* Storage for 3 entries (c,w,e) */ + hypre_SetIndex3(Ac_stencil_shape[stencil_entry], 0, 0, 0); + hypre_IndexD(Ac_stencil_shape[stencil_entry], cdir) = i; + stencil_entry++; } } @@ -170,11 +162,10 @@ hypre_CycRedCreateCoarseOp( hypre_StructMatrix *A, Ac_stencil_shape = hypre_CTAlloc(hypre_Index, Ac_stencil_size, HYPRE_MEMORY_HOST); for (i = -1; i < 1; i++) { - - /* Storage for 2 elements in (c,w) */ - hypre_SetIndex3(Ac_stencil_shape[stencil_rank], 0, 0, 0); - hypre_IndexD(Ac_stencil_shape[stencil_rank], cdir) = i; - stencil_rank++; + /* Storage for 2 entries in (c,w) */ + hypre_SetIndex3(Ac_stencil_shape[stencil_entry], 0, 0, 0); + hypre_IndexD(Ac_stencil_shape[stencil_entry], cdir) = i; + stencil_entry++; } } @@ -200,9 +191,7 @@ hypre_CycRedCreateCoarseOp( hypre_StructMatrix *A, { Ac_num_ghost[2 * cdir + 1] = 1; } - hypre_StructMatrixSetNumGhost(Ac, Ac_num_ghost); - - hypre_StructMatrixInitializeShell(Ac); + HYPRE_StructMatrixSetNumGhost(Ac, Ac_num_ghost); return Ac; } @@ -333,16 +322,28 @@ hypre_CycRedSetupCoarseOp( hypre_StructMatrix *A, A_dbox, fstart, stridef, iA, Ac_dbox, cstart, stridec, iAc); { - HYPRE_Int iAm1 = iA - offsetA; - HYPRE_Int iAp1 = iA + offsetA; + HYPRE_Int iAm1 = iA - offsetA; + HYPRE_Int iAp1 = iA + offsetA; - ac_cw[iAc] = -a_cw[iA] * a_cw[iAm1] / a_cc[iAm1]; + /* Avoid division by zero along domain boundaries */ + HYPRE_Real accm1 = 1.0; + HYPRE_Real accp1 = 1.0; + if (a_cc[iAm1] != 0.0) + { + accm1 = a_cc[iAm1]; + } + if (a_cc[iAp1] != 0.0) + { + accp1 = a_cc[iAp1]; + } - ac_cc[iAc] = a_cc[iA] - a_cw[iA] * a_ce[iAm1] / a_cc[iAm1] - - a_ce[iA] * a_cw[iAp1] / a_cc[iAp1]; + ac_cw[iAc] = - a_cw[iA] * a_cw[iAm1] / accm1; - ac_ce[iAc] = -a_ce[iA] * a_ce[iAp1] / a_cc[iAp1]; + ac_cc[iAc] = a_cc[iA] + - a_cw[iA] * a_ce[iAm1] / accm1 + - a_ce[iA] * a_cw[iAp1] / accp1; + ac_ce[iAc] = - a_ce[iA] * a_ce[iAp1] / accp1; } hypre_BoxLoop2End(iA, iAc); #undef DEVICE_VAR @@ -361,13 +362,26 @@ hypre_CycRedSetupCoarseOp( hypre_StructMatrix *A, A_dbox, fstart, stridef, iA, Ac_dbox, cstart, stridec, iAc); { - HYPRE_Int iAm1 = iA - offsetA; - HYPRE_Int iAp1 = iA + offsetA; + HYPRE_Int iAm1 = iA - offsetA; + HYPRE_Int iAp1 = iA + offsetA; - ac_cw[iAc] = -a_cw[iA] * a_cw[iAm1] / a_cc[iAm1]; + /* Avoid division by zero along domain boundaries */ + HYPRE_Real accm1 = 1.0; + HYPRE_Real accp1 = 1.0; + if (a_cc[iAm1] != 0.0) + { + accm1 = a_cc[iAm1]; + } + if (a_cc[iAp1] != 0.0) + { + accp1 = a_cc[iAp1]; + } - ac_cc[iAc] = a_cc[iA] - a_cw[iA] * a_ce[iAm1] / a_cc[iAm1] - - a_ce[iA] * a_cw[iAp1] / a_cc[iAp1]; + ac_cw[iAc] = - a_cw[iA] * a_cw[iAm1] / accm1; + + ac_cc[iAc] = a_cc[iA] + - a_cw[iA] * a_ce[iAm1] / accm1 + - a_ce[iA] * a_cw[iAp1] / accp1; } hypre_BoxLoop2End(iA, iAc); #undef DEVICE_VAR @@ -474,25 +488,22 @@ hypre_CyclicReductionSetup( void *cyc_red_vdata, hypre_CyclicReductionData *cyc_red_data = (hypre_CyclicReductionData *) cyc_red_vdata; + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(A); MPI_Comm comm = (cyc_red_data -> comm); HYPRE_Int cdir = (cyc_red_data -> cdir); hypre_IndexRef base_index = (cyc_red_data -> base_index); hypre_IndexRef base_stride = (cyc_red_data -> base_stride); HYPRE_Int num_levels; - HYPRE_Int max_levels = -1; hypre_StructGrid **grid_l; hypre_BoxArray *base_points; hypre_BoxArray **fine_points_l; - HYPRE_Real *data; - HYPRE_Real *data_const; - HYPRE_Int data_size = 0; - HYPRE_Int data_size_const = 0; hypre_StructMatrix **A_l; hypre_StructVector **x_l; hypre_ComputePkg **down_compute_pkg_l; hypre_ComputePkg **up_compute_pkg_l; hypre_ComputeInfo *compute_info; + hypre_Index ustride; hypre_Index cindex; hypre_Index findex; @@ -504,7 +515,7 @@ hypre_CyclicReductionSetup( void *cyc_red_vdata, HYPRE_Int flop_divisor; HYPRE_Int x_num_ghost[] = {0, 0, 0, 0, 0, 0}; - HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(A); + hypre_SetIndex(ustride, 1); /*----------------------------------------------------- * Set up coarse grids @@ -513,13 +524,8 @@ hypre_CyclicReductionSetup( void *cyc_red_vdata, grid = hypre_StructMatrixGrid(A); /* Compute a preliminary num_levels value based on the grid */ - cbox = hypre_BoxDuplicate(hypre_StructGridBoundingBox(grid)); + cbox = hypre_BoxClone(hypre_StructGridBoundingBox(grid)); num_levels = hypre_Log2(hypre_BoxSizeD(cbox, cdir)) + 2; - if (cyc_red_data -> max_levels > 0) - { - max_levels = (cyc_red_data -> max_levels); - } - grid_l = hypre_TAlloc(hypre_StructGrid *, num_levels, HYPRE_MEMORY_HOST); hypre_StructGridRef(grid, &grid_l[0]); @@ -534,8 +540,7 @@ hypre_CyclicReductionSetup( void *cyc_red_vdata, hypre_CycRedSetStride(base_index, base_stride, l, cdir, stride); /* check to see if we should coarsen */ - if ( hypre_BoxIMinD(cbox, cdir) == hypre_BoxIMaxD(cbox, cdir) || - (l == (max_levels - 1))) + if ( hypre_BoxIMinD(cbox, cdir) == hypre_BoxIMaxD(cbox, cdir) ) { /* stop coarsening */ break; @@ -550,6 +555,8 @@ hypre_CyclicReductionSetup( void *cyc_red_vdata, /* coarsen the grid */ hypre_StructCoarsen(grid_l[l], cindex, stride, 1, &grid_l[l + 1]); + hypre_StructGridAssemble(grid_l[l + 1]); + #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_StructGridDataLocation(grid_l[l + 1]) = data_location; #endif @@ -559,7 +566,6 @@ hypre_CyclicReductionSetup( void *cyc_red_vdata, /* free up some things */ hypre_BoxDestroy(cbox); - (cyc_red_data -> ndim) = hypre_StructGridNDim(grid); (cyc_red_data -> num_levels) = num_levels; (cyc_red_data -> grid_l) = grid_l; @@ -567,7 +573,7 @@ hypre_CyclicReductionSetup( void *cyc_red_vdata, * Set up base points *-----------------------------------------------------*/ - base_points = hypre_BoxArrayDuplicate(hypre_StructGridBoxes(grid_l[0])); + base_points = hypre_BoxArrayClone(hypre_StructGridBoxes(grid_l[0])); hypre_ProjectBoxArray(base_points, base_index, base_stride); (cyc_red_data -> base_points) = base_points; @@ -584,11 +590,11 @@ hypre_CyclicReductionSetup( void *cyc_red_vdata, hypre_CycRedSetFIndex(base_index, base_stride, l, cdir, findex); hypre_CycRedSetStride(base_index, base_stride, l, cdir, stride); - fine_points_l[l] = hypre_BoxArrayDuplicate(hypre_StructGridBoxes(grid_l[l])); + fine_points_l[l] = hypre_BoxArrayClone(hypre_StructGridBoxes(grid_l[l])); hypre_ProjectBoxArray(fine_points_l[l], findex, stride); } - fine_points_l[l] = hypre_BoxArrayDuplicate(hypre_StructGridBoxes(grid_l[l])); + fine_points_l[l] = hypre_BoxArrayClone(hypre_StructGridBoxes(grid_l[l])); if (num_levels == 1) { hypre_ProjectBoxArray(fine_points_l[l], base_index, base_stride); @@ -612,47 +618,12 @@ hypre_CyclicReductionSetup( void *cyc_red_vdata, for (l = 0; l < (num_levels - 1); l++) { 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]); + hypre_StructMatrixInitialize(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); - } - - 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]); - -#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]); - } - else - { - 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_StructVectorInitialize(x_l[l + 1], 1); hypre_StructVectorAssemble(x_l[l + 1]); - data += hypre_StructVectorDataSize(x_l[l + 1]); -#endif } (cyc_red_data -> A_l) = A_l; @@ -684,22 +655,22 @@ hypre_CyclicReductionSetup( void *cyc_red_vdata, hypre_CycRedSetStride(base_index, base_stride, l, cdir, stride); /* down-cycle */ - hypre_CreateComputeInfo(grid_l[l], hypre_StructMatrixStencil(A_l[l]), + hypre_CreateComputeInfo(grid_l[l], ustride, hypre_StructMatrixStencil(A_l[l]), &compute_info); hypre_ComputeInfoProjectSend(compute_info, findex, stride); hypre_ComputeInfoProjectRecv(compute_info, findex, stride); hypre_ComputeInfoProjectComp(compute_info, cindex, stride); - hypre_ComputePkgCreate(compute_info, + hypre_ComputePkgCreate(memory_location, compute_info, hypre_StructVectorDataSpace(x_l[l]), 1, grid_l[l], &down_compute_pkg_l[l]); /* up-cycle */ - hypre_CreateComputeInfo(grid_l[l], hypre_StructMatrixStencil(A_l[l]), + hypre_CreateComputeInfo(grid_l[l], ustride, hypre_StructMatrixStencil(A_l[l]), &compute_info); hypre_ComputeInfoProjectSend(compute_info, cindex, stride); hypre_ComputeInfoProjectRecv(compute_info, cindex, stride); hypre_ComputeInfoProjectComp(compute_info, findex, stride); - hypre_ComputePkgCreate(compute_info, + hypre_ComputePkgCreate(memory_location, compute_info, hypre_StructVectorDataSpace(x_l[l]), 1, grid_l[l], &up_compute_pkg_l[l]); } @@ -730,7 +701,6 @@ hypre_CyclicReductionSetup( void *cyc_red_vdata, hypre_StructVectorGlobalSize(x_l[l]) / 2; } - /*----------------------------------------------------- * Finalize some things *-----------------------------------------------------*/ @@ -1215,8 +1185,6 @@ 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]); @@ -1231,7 +1199,6 @@ hypre_CyclicReductionDestroy( void *cyc_red_vdata ) 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, 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); @@ -1245,17 +1212,3 @@ hypre_CyclicReductionDestroy( void *cyc_red_vdata ) return hypre_error_flag; } - -/*-------------------------------------------------------------------------- - * hypre_CyclicReductionDestroy - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_CyclicReductionSetMaxLevel( void *cyc_red_vdata, - HYPRE_Int max_level ) -{ - hypre_CyclicReductionData *cyc_red_data = (hypre_CyclicReductionData *)cyc_red_vdata; - (cyc_red_data -> max_levels) = max_level; - - return hypre_error_flag; -} diff --git a/src/struct_ls/diagscale.c b/src/struct_ls/diagscale.c new file mode 100644 index 0000000000..0a7bd30ace --- /dev/null +++ b/src/struct_ls/diagscale.c @@ -0,0 +1,79 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_ls.h" +#include "_hypre_struct_mv.hpp" + +/*-------------------------------------------------------------------------- + * x = D^{-1} y + * + * RDF TODO: This is partially updated to support non-unitary strides. + * Need to fix the matrix part of the code. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructDiagScale( hypre_StructMatrix *A, + hypre_StructVector *y, + hypre_StructVector *x ) +{ + HYPRE_Int ndim = hypre_StructVectorNDim(x); + + hypre_Box *A_data_box; + hypre_Box *y_data_box; + hypre_Box *x_data_box; + + HYPRE_Real *Ap; + HYPRE_Real *yp; + HYPRE_Real *xp; + + hypre_Index index; + + HYPRE_Int nboxes; + hypre_Box *loop_box; + hypre_Index loop_size; + hypre_IndexRef start; + hypre_Index ustride; + + HYPRE_Int i; + + nboxes = hypre_StructVectorNBoxes(x); + + loop_box = hypre_BoxCreate(ndim); + hypre_SetIndex(ustride, 1); + + for (i = 0; i < nboxes; i++) + { + hypre_StructVectorGridBoxCopy(x, i, loop_box); + start = hypre_BoxIMin(loop_box); + + A_data_box = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A), i); + x_data_box = hypre_StructVectorGridDataBox(x, i); + y_data_box = hypre_StructVectorGridDataBox(y, i); + + hypre_SetIndex(index, 0); + Ap = hypre_StructMatrixExtractPointerByIndex(A, i, index); + xp = hypre_StructVectorGridData(x, i); + yp = hypre_StructVectorGridData(y, i); + + hypre_BoxGetSize(loop_box, loop_size); + +#define DEVICE_VAR is_device_ptr(xp,yp,Ap) + hypre_BoxLoop3Begin(ndim, loop_size, + A_data_box, start, ustride, Ai, + x_data_box, start, ustride, xi, + y_data_box, start, ustride, yi); + { + xp[xi] = yp[yi] / Ap[Ai]; + } + hypre_BoxLoop3End(Ai, xi, yi); +#undef DEVICE_VAR + } + + hypre_BoxDestroy(loop_box); + + return hypre_error_flag; +} diff --git a/src/struct_ls/headers b/src/struct_ls/headers index 795d6943b2..6ad06c16d0 100755 --- a/src/struct_ls/headers +++ b/src/struct_ls/headers @@ -20,13 +20,15 @@ cat > $INTERNAL_HEADER <<@ #include "_hypre_utilities.h" #include "HYPRE_struct_ls.h" #include "_hypre_struct_mv.h" -#include "krylov.h" +#include "_hypre_krylov.h" -#include "temp_multivector.h" - /* ... needed to make sense of functions in HYPRE_parcsr_int.c */ -#include "HYPRE_MatvecFunctions.h" +#include "_hypre_lobpcg_temp_multivector.h" /* ... needed to make sense of functions in HYPRE_parcsr_int.c */ +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_struct_ls_mup_def.h" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -51,7 +53,17 @@ cat >> $INTERNAL_HEADER <<@ } #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_struct_ls_mup_undef.h" +#include "_hypre_struct_ls_mup.h" +#endif #endif -@ +#endif +@ diff --git a/src/struct_ls/jacobi.c b/src/struct_ls/jacobi.c index 29bf986de4..0b202204d7 100644 --- a/src/struct_ls/jacobi.c +++ b/src/struct_ls/jacobi.c @@ -6,32 +6,60 @@ ******************************************************************************/ #include "_hypre_struct_ls.h" +#include "_hypre_struct_mv.hpp" + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ typedef struct { - void *relax_data; + MPI_Comm comm; + + HYPRE_Real tol; /* tolerance, set =0 for no convergence testing */ + HYPRE_Real rresnorm; /* relative residual norm, computed only if tol>0.0 */ + HYPRE_Int max_iter; + HYPRE_Int rel_change; /* not yet used */ + HYPRE_Int zero_guess; + HYPRE_Real weight; + + hypre_StructMatrix *A; + hypre_StructVector *b; + hypre_StructVector *x; + hypre_StructVector *r; + + void *matvec_data; + + /* log info (always logged) */ + HYPRE_Int num_iterations; + HYPRE_Int time_index; + HYPRE_BigInt flops; -} hypre_JacobiData; +} hypre_StructJacobiData; /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ void * -hypre_JacobiCreate( MPI_Comm comm ) +hypre_StructJacobiCreate( MPI_Comm comm ) { - hypre_JacobiData *jacobi_data; - void *relax_data; - hypre_Index stride; - hypre_Index indices[1]; - - jacobi_data = hypre_CTAlloc(hypre_JacobiData, 1, HYPRE_MEMORY_HOST); - relax_data = hypre_PointRelaxCreate(comm); - hypre_PointRelaxSetNumPointsets(relax_data, 1); - 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); - (jacobi_data -> relax_data) = relax_data; + hypre_StructJacobiData *jacobi_data; + + jacobi_data = hypre_CTAlloc(hypre_StructJacobiData, 1, HYPRE_MEMORY_HOST); + + (jacobi_data -> comm) = comm; + (jacobi_data -> time_index) = hypre_InitializeTiming("Jacobi"); + + /* set defaults */ + (jacobi_data -> tol) = 0.0; /* tol=0 means no convergence testing */ + (jacobi_data -> rresnorm) = 0.0; + (jacobi_data -> max_iter) = 1000; + (jacobi_data -> rel_change) = 0; + (jacobi_data -> zero_guess) = 0; + (jacobi_data -> weight) = 1.0; + (jacobi_data -> A) = NULL; + (jacobi_data -> b) = NULL; + (jacobi_data -> x) = NULL; + (jacobi_data -> r) = NULL; return (void *) jacobi_data; } @@ -40,13 +68,19 @@ hypre_JacobiCreate( MPI_Comm comm ) *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_JacobiDestroy( void *jacobi_vdata ) +hypre_StructJacobiDestroy( void *jacobi_vdata ) { - hypre_JacobiData *jacobi_data = (hypre_JacobiData *)jacobi_vdata; + hypre_StructJacobiData *jacobi_data = (hypre_StructJacobiData *)jacobi_vdata; if (jacobi_data) { - hypre_PointRelaxDestroy(jacobi_data -> relax_data); + hypre_StructMatvecDestroy(jacobi_data -> matvec_data); + hypre_StructMatrixDestroy(jacobi_data -> A); + hypre_StructVectorDestroy(jacobi_data -> b); + hypre_StructVectorDestroy(jacobi_data -> x); + hypre_StructVectorDestroy(jacobi_data -> r); + + hypre_FinalizeTiming(jacobi_data -> time_index); hypre_TFree(jacobi_data, HYPRE_MEMORY_HOST); } @@ -57,30 +91,296 @@ hypre_JacobiDestroy( void *jacobi_vdata ) *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_JacobiSetup( void *jacobi_vdata, - hypre_StructMatrix *A, - hypre_StructVector *b, - hypre_StructVector *x ) +hypre_StructJacobiSetup( void *jacobi_vdata, + hypre_StructMatrix *A, + hypre_StructVector *b, + hypre_StructVector *x ) { - hypre_JacobiData *jacobi_data = (hypre_JacobiData *)jacobi_vdata; + hypre_StructJacobiData *jacobi_data = (hypre_StructJacobiData *)jacobi_vdata; + hypre_StructVector *r = (jacobi_data -> r); - hypre_PointRelaxSetup((jacobi_data -> relax_data), A, b, x); + /*---------------------------------------------------------- + * Set up the residual vector + *----------------------------------------------------------*/ + + if (r == NULL) + { + r = hypre_StructVectorClone(b); + (jacobi_data -> r) = r; + } + + /*---------------------------------------------------------- + * Set up matvec + *----------------------------------------------------------*/ + + (jacobi_data -> matvec_data) = hypre_StructMatvecCreate(); + hypre_StructMatvecSetup((jacobi_data -> matvec_data), A, x); + + /*---------------------------------------------------------- + * Set up the relax data structure + *----------------------------------------------------------*/ + + (jacobi_data -> A) = hypre_StructMatrixRef(A); + (jacobi_data -> x) = hypre_StructVectorRef(x); + (jacobi_data -> b) = hypre_StructVectorRef(b); + + /*----------------------------------------------------- + * Compute flops + *-----------------------------------------------------*/ + + (jacobi_data -> flops) = + (HYPRE_BigInt)(hypre_StructMatrixGlobalSize(A) + hypre_StructVectorGlobalSize(x)); return hypre_error_flag; } /*-------------------------------------------------------------------------- + * RDF TODO: Partially supports non-unitary strides. Need to fix matrix part. *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_JacobiSolve( void *jacobi_vdata, - hypre_StructMatrix *A, - hypre_StructVector *b, - hypre_StructVector *x ) +hypre_StructJacobiSolve( void *jacobi_vdata, + hypre_StructMatrix *A, + hypre_StructVector *b, + hypre_StructVector *x ) { - hypre_JacobiData *jacobi_data = (hypre_JacobiData *)jacobi_vdata; + hypre_StructJacobiData *jacobi_data = (hypre_StructJacobiData *) jacobi_vdata; + + void *matvec_data = (jacobi_data -> matvec_data); + HYPRE_Int max_iter = (jacobi_data -> max_iter); + HYPRE_Int zero_guess = (jacobi_data -> zero_guess); + HYPRE_Real weight = (jacobi_data -> weight); + hypre_StructVector *r = (jacobi_data -> r); + HYPRE_Real tol = (jacobi_data -> tol); + HYPRE_Real tol2 = tol * tol; + HYPRE_Int ndim = hypre_StructMatrixNDim(A); + + hypre_Box *A_data_box, *x_data_box, *r_data_box; + HYPRE_Real *Ap, *xp, *rp; + + HYPRE_Int nboxes; + hypre_Box *loop_box; + hypre_Index loop_size; + hypre_IndexRef start; + hypre_Index ustride; + + HYPRE_Int iter, i, stencil_diag; + HYPRE_Real bsumsq, rsumsq; + + /*---------------------------------------------------------- + * Initialize some things and deal with special cases + *----------------------------------------------------------*/ + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("Jacobi"); + hypre_BeginTiming(jacobi_data -> time_index); + + hypre_StructMatrixDestroy(jacobi_data -> A); + hypre_StructVectorDestroy(jacobi_data -> b); + hypre_StructVectorDestroy(jacobi_data -> x); + (jacobi_data -> A) = hypre_StructMatrixRef(A); + (jacobi_data -> x) = hypre_StructVectorRef(x); + (jacobi_data -> b) = hypre_StructVectorRef(b); + + (jacobi_data -> num_iterations) = 0; + + /* if max_iter is zero, return */ + if (max_iter == 0) + { + /* if using a zero initial guess, return zero */ + if (zero_guess) + { + hypre_StructVectorSetConstantValues(x, 0.0); + } + + hypre_EndTiming(jacobi_data -> time_index); + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; + } + + // hypre_StructVectorClearBoundGhostValues(x, 0); /* RDF: Shouldn't need this */ + + bsumsq = rsumsq = 0.0; + if (tol > 0.0) + { + bsumsq = hypre_StructInnerProd( b, b ); + } + + nboxes = hypre_StructVectorNBoxes(x); + stencil_diag = hypre_StructStencilDiagEntry(hypre_StructMatrixStencil(A)); + loop_box = hypre_BoxCreate(ndim); + hypre_SetIndex(ustride, 1); - hypre_PointRelax((jacobi_data -> relax_data), A, b, x); + /*---------------------------------------------------------- + * Do zero_guess iteration + *----------------------------------------------------------*/ + + iter = 0; + + if (zero_guess) + { + /* Compute x <-- weight D^-1 b */ + hypre_GpuProfilingPushRange("Dinv"); + for (i = 0; i < nboxes; i++) + { + hypre_StructVectorGridBoxCopy(x, i, loop_box); + start = hypre_BoxIMin(loop_box); + + A_data_box = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A), i); + x_data_box = hypre_StructVectorGridDataBox(x, i); + r_data_box = hypre_StructVectorGridDataBox(b, i); /* r = b */ + + Ap = hypre_StructMatrixBoxData(A, i, stencil_diag); + xp = hypre_StructVectorGridData(x, i); + rp = hypre_StructVectorGridData(b, i); /* r = b */ + + hypre_BoxGetSize(loop_box, loop_size); + + if (hypre_StructMatrixConstEntry(A, stencil_diag)) + { + /* Constant coefficient case */ + hypre_BoxLoop2Begin(ndim, loop_size, + x_data_box, start, ustride, xi, + r_data_box, start, ustride, ri); + { + xp[xi] = weight * rp[ri] / Ap[0]; + } + hypre_BoxLoop2End(xi, ri); + } + else + { + /* Variable coefficient case */ + hypre_BoxLoop3Begin(ndim, loop_size, + A_data_box, start, ustride, Ai, + x_data_box, start, ustride, xi, + r_data_box, start, ustride, ri); + { + xp[xi] = weight * rp[ri] / Ap[Ai]; + } + hypre_BoxLoop3End(Ai, xi, ri); + } + } + hypre_GpuProfilingPopRange(); + + iter = iter + 1; + + if (tol > 0.0) + { + /* Compute residual and check convergence */ + hypre_StructMatvecCompute(matvec_data, -1.0, A, x, 1.0, b, r); + rsumsq = hypre_StructInnerProd(r, r); + if ( (rsumsq / bsumsq) < tol2 ) + { + max_iter = iter; /* converged; reset max_iter to prevent more iterations */ + } + } + } + + /*---------------------------------------------------------- + * Do regular iterations + *----------------------------------------------------------*/ + + while (iter < max_iter) + { + /* Compute residual */ + hypre_StructMatvecCompute(matvec_data, -1.0, A, x, 1.0, b, r); + + /* Compute x <-- x + weight D^-1 r */ + hypre_GpuProfilingPushRange("Dinv"); + for (i = 0; i < nboxes; i++) + { + hypre_StructVectorGridBoxCopy(x, i, loop_box); + start = hypre_BoxIMin(loop_box); + + A_data_box = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A), i); + x_data_box = hypre_StructVectorGridDataBox(x, i); + r_data_box = hypre_StructVectorGridDataBox(r, i); + + Ap = hypre_StructMatrixBoxData(A, i, stencil_diag); + xp = hypre_StructVectorGridData(x, i); + rp = hypre_StructVectorGridData(r, i); + + hypre_BoxGetSize(loop_box, loop_size); + + if (hypre_StructMatrixConstEntry(A, stencil_diag)) + { + /* Constant coefficient case */ + hypre_BoxLoop2Begin(ndim, loop_size, + x_data_box, start, ustride, xi, + r_data_box, start, ustride, ri); + { + xp[xi] += weight * rp[ri] / Ap[0]; + } + hypre_BoxLoop2End(xi, ri); + } + else + { + /* Variable coefficient case */ + if (hypre_BoxesEqual(A_data_box, x_data_box) && + hypre_BoxesEqual(x_data_box, r_data_box)) + { + hypre_BoxLoop1Begin(ndim, loop_size, x_data_box, start, ustride, xi); + { + xp[xi] += weight * rp[xi] / Ap[xi]; + } + hypre_BoxLoop1End(xi); + } + else if (hypre_BoxesEqual(x_data_box, r_data_box)) + { + hypre_BoxLoop2Begin(ndim, loop_size, + A_data_box, start, ustride, Ai, + x_data_box, start, ustride, xi); + { + xp[xi] += weight * rp[xi] / Ap[Ai]; + } + hypre_BoxLoop2End(Ai, xi); + } + else + { + hypre_BoxLoop3Begin(ndim, loop_size, + A_data_box, start, ustride, Ai, + x_data_box, start, ustride, xi, + r_data_box, start, ustride, ri); + { + xp[xi] += weight * rp[ri] / Ap[Ai]; + } + hypre_BoxLoop3End(Ai, xi, ri); + } + } + } + hypre_GpuProfilingPopRange(); + + iter = iter + 1; + + if ( tol > 0.0 ) + { + /* Compute residual and check convergence */ + hypre_StructMatvecCompute(matvec_data, -1.0, A, x, 1.0, b, r); + rsumsq = hypre_StructInnerProd(r, r); + if ( (rsumsq / bsumsq) < tol2 ) + { + break; + } + } + } + + if ( tol > 0.0 ) + { + (jacobi_data -> rresnorm) = sqrt(rsumsq / bsumsq); + } + (jacobi_data -> num_iterations) = iter; + + hypre_BoxDestroy(loop_box); + + /*----------------------------------------------------------------------- + * Return + *-----------------------------------------------------------------------*/ + + hypre_IncFLOPCount(jacobi_data -> flops); + hypre_EndTiming(jacobi_data -> time_index); + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; return hypre_error_flag; } @@ -89,12 +389,12 @@ hypre_JacobiSolve( void *jacobi_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_JacobiSetTol( void *jacobi_vdata, - HYPRE_Real tol ) +hypre_StructJacobiSetTol( void *jacobi_vdata, + HYPRE_Real tol ) { - hypre_JacobiData *jacobi_data = (hypre_JacobiData *)jacobi_vdata; + hypre_StructJacobiData *jacobi_data = (hypre_StructJacobiData *)jacobi_vdata; - hypre_PointRelaxSetTol((jacobi_data -> relax_data), tol); + (jacobi_data -> tol) = tol; return hypre_error_flag; } @@ -103,12 +403,12 @@ hypre_JacobiSetTol( void *jacobi_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_JacobiGetTol( void *jacobi_vdata, - HYPRE_Real *tol ) +hypre_StructJacobiGetTol( void *jacobi_vdata, + HYPRE_Real *tol ) { - hypre_JacobiData *jacobi_data = (hypre_JacobiData *)jacobi_vdata; + hypre_StructJacobiData *jacobi_data = (hypre_StructJacobiData *)jacobi_vdata; - hypre_PointRelaxGetTol((jacobi_data -> relax_data), tol); + *tol = (jacobi_data -> tol); return hypre_error_flag; } @@ -117,26 +417,25 @@ hypre_JacobiGetTol( void *jacobi_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_JacobiSetMaxIter( void *jacobi_vdata, - HYPRE_Int max_iter ) +hypre_StructJacobiSetMaxIter( void *jacobi_vdata, + HYPRE_Int max_iter ) { - hypre_JacobiData *jacobi_data = (hypre_JacobiData *)jacobi_vdata; + hypre_StructJacobiData *jacobi_data = (hypre_StructJacobiData *)jacobi_vdata; - hypre_PointRelaxSetMaxIter((jacobi_data -> relax_data), max_iter); + (jacobi_data -> max_iter) = max_iter; return hypre_error_flag; } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ - HYPRE_Int -hypre_JacobiGetMaxIter( void *jacobi_vdata, - HYPRE_Int * max_iter ) +hypre_StructJacobiGetMaxIter( void *jacobi_vdata, + HYPRE_Int *max_iter ) { - hypre_JacobiData *jacobi_data = (hypre_JacobiData *)jacobi_vdata; + hypre_StructJacobiData *jacobi_data = (hypre_StructJacobiData *)jacobi_vdata; - hypre_PointRelaxGetMaxIter((jacobi_data -> relax_data), max_iter); + *max_iter = (jacobi_data -> max_iter); return hypre_error_flag; } @@ -145,12 +444,12 @@ hypre_JacobiGetMaxIter( void *jacobi_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_JacobiSetZeroGuess( void *jacobi_vdata, - HYPRE_Int zero_guess ) +hypre_StructJacobiSetZeroGuess( void *jacobi_vdata, + HYPRE_Int zero_guess ) { - hypre_JacobiData *jacobi_data = (hypre_JacobiData *)jacobi_vdata; + hypre_StructJacobiData *jacobi_data = (hypre_StructJacobiData *)jacobi_vdata; - hypre_PointRelaxSetZeroGuess((jacobi_data -> relax_data), zero_guess); + (jacobi_data -> zero_guess) = zero_guess; return hypre_error_flag; } @@ -159,26 +458,25 @@ hypre_JacobiSetZeroGuess( void *jacobi_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_JacobiGetZeroGuess( void *jacobi_vdata, - HYPRE_Int * zero_guess ) +hypre_StructJacobiGetZeroGuess( void *jacobi_vdata, + HYPRE_Int *zero_guess ) { - hypre_JacobiData *jacobi_data = (hypre_JacobiData *)jacobi_vdata; + hypre_StructJacobiData *jacobi_data = (hypre_StructJacobiData *)jacobi_vdata; - hypre_PointRelaxGetZeroGuess((jacobi_data -> relax_data), zero_guess); + *zero_guess = (jacobi_data -> zero_guess); return hypre_error_flag; } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ - HYPRE_Int -hypre_JacobiGetNumIterations( void *jacobi_vdata, - HYPRE_Int * num_iterations ) +hypre_StructJacobiGetNumIterations( void *jacobi_vdata, + HYPRE_Int *num_iterations ) { - hypre_JacobiData *jacobi_data = (hypre_JacobiData *)jacobi_vdata; + hypre_StructJacobiData *jacobi_data = (hypre_StructJacobiData *)jacobi_vdata; - hypre_PointRelaxGetNumIterations((jacobi_data -> relax_data), num_iterations ); + *num_iterations = (jacobi_data -> num_iterations); return hypre_error_flag; } @@ -187,25 +485,40 @@ hypre_JacobiGetNumIterations( void *jacobi_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_JacobiSetTempVec( void *jacobi_vdata, - hypre_StructVector *t ) +hypre_StructJacobiSetWeight( void *jacobi_vdata, + HYPRE_Real weight ) { - hypre_JacobiData *jacobi_data = (hypre_JacobiData *)jacobi_vdata; + hypre_StructJacobiData *jacobi_data = (hypre_StructJacobiData *)jacobi_vdata; - hypre_PointRelaxSetTempVec((jacobi_data -> relax_data), t); + (jacobi_data -> weight) = weight; return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructJacobiSetTempVec( void *jacobi_vdata, + hypre_StructVector *r ) +{ + hypre_StructJacobiData *jacobi_data = (hypre_StructJacobiData *)jacobi_vdata; + + hypre_StructVectorDestroy(jacobi_data -> r); + (jacobi_data -> r) = hypre_StructVectorRef(r); + + return hypre_error_flag; +} /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ -HYPRE_Int hypre_JacobiGetFinalRelativeResidualNorm( void * jacobi_vdata, - HYPRE_Real * norm ) +HYPRE_Int hypre_StructJacobiGetFinalRelativeResidualNorm( void *jacobi_vdata, + HYPRE_Real *norm ) { - hypre_JacobiData *jacobi_data = (hypre_JacobiData *)jacobi_vdata; - void *relax_data = jacobi_data -> relax_data; + hypre_StructJacobiData *jacobi_data = (hypre_StructJacobiData *)jacobi_vdata; + + *norm = jacobi_data -> rresnorm; - return hypre_PointRelaxGetFinalRelativeResidualNorm( relax_data, norm ); + return hypre_error_flag; } diff --git a/src/struct_ls/mup.fixed b/src/struct_ls/mup.fixed new file mode 100644 index 0000000000..b119a8d068 --- /dev/null +++ b/src/struct_ls/mup.fixed @@ -0,0 +1,428 @@ +hypre_CycRedCreateCoarseOp +hypre_CycRedSetupCoarseOp +hypre_CyclicReduction +hypre_CyclicReductionCreate +hypre_CyclicReductionDestroy +hypre_CyclicReductionSetBase +hypre_CyclicReductionSetCDir +hypre_CyclicReductionSetup +hypre_HybridCreate +hypre_HybridDestroy +hypre_HybridGetDSCGNumIterations +hypre_HybridGetFinalRelativeResidualNorm +hypre_HybridGetNumIterations +hypre_HybridGetPCGNumIterations +hypre_HybridGetRecomputeResidual +hypre_HybridGetRecomputeResidualP +hypre_HybridSetConvergenceTol +hypre_HybridSetDSCGMaxIter +hypre_HybridSetKDim +hypre_HybridSetLogging +hypre_HybridSetPCGAbsoluteTolFactor +hypre_HybridSetPCGMaxIter +hypre_HybridSetPrecond +hypre_HybridSetPrintLevel +hypre_HybridSetRecomputeResidual +hypre_HybridSetRecomputeResidualP +hypre_HybridSetRelChange +hypre_HybridSetSolverType +hypre_HybridSetStopCrit +hypre_HybridSetTol +hypre_HybridSetTwoNorm +hypre_HybridSetup +hypre_HybridSolve +hypre_HybridSolveUseBiCGSTAB +hypre_HybridSolveUseGMRES +hypre_HybridSolveUsePCG +hypre_PFMG2BuildRAPNoSym +hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC0 +hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC1 +hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC0 +hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC1 +hypre_PFMG2BuildRAPSym +hypre_PFMG2BuildRAPSym_onebox_FSS5_CC0 +hypre_PFMG2BuildRAPSym_onebox_FSS5_CC1 +hypre_PFMG2BuildRAPSym_onebox_FSS9_CC0 +hypre_PFMG2BuildRAPSym_onebox_FSS9_CC1 +hypre_PFMG2CreateRAPOp +hypre_PFMG3BuildRAPNoSym +hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC0 +hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC1 +hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC0 +hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC1 +hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC0 +hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC1 +hypre_PFMG3BuildRAPSym +hypre_PFMG3BuildRAPSym_onebox_FSS07_CC0 +hypre_PFMG3BuildRAPSym_onebox_FSS07_CC1 +hypre_PFMG3BuildRAPSym_onebox_FSS19_CC0 +hypre_PFMG3BuildRAPSym_onebox_FSS19_CC1 +hypre_PFMG3BuildRAPSym_onebox_FSS27_CC0 +hypre_PFMG3BuildRAPSym_onebox_FSS27_CC1 +hypre_PFMG3CreateRAPOp +hypre_PFMGBuildCoarseOp5 +hypre_PFMGBuildCoarseOp7 +hypre_PFMGCoarsen +hypre_PFMGComputeCxyz +hypre_PFMGComputeCxyz_core_CC +hypre_PFMGComputeCxyz_core_VC +hypre_PFMGComputeDxyz +hypre_PFMGComputeMaxLevels +hypre_PFMGCreate +hypre_PFMGCreateCoarseOp5 +hypre_PFMGCreateCoarseOp7 +hypre_PFMGCreateInterpOp +hypre_PFMGCreateRAPOp +hypre_PFMGDestroy +hypre_PFMGGetFinalRelativeResidualNorm +hypre_PFMGGetJacobiWeight +hypre_PFMGGetLogging +hypre_PFMGGetMatmultType +hypre_PFMGGetMaxIter +hypre_PFMGGetMaxLevels +hypre_PFMGGetNumIterations +hypre_PFMGGetNumPostRelax +hypre_PFMGGetNumPreRelax +hypre_PFMGGetPrintFreq +hypre_PFMGGetPrintLevel +hypre_PFMGGetRAPType +hypre_PFMGGetRelChange +hypre_PFMGGetRelaxType +hypre_PFMGGetSkipRelax +hypre_PFMGGetTol +hypre_PFMGGetZeroGuess +hypre_PFMGPrintLogging +hypre_PFMGRelax +hypre_PFMGRelaxCreate +hypre_PFMGRelaxDestroy +hypre_PFMGRelaxSetJacobiWeight +hypre_PFMGRelaxSetMaxIter +hypre_PFMGRelaxSetPostRelax +hypre_PFMGRelaxSetPreRelax +hypre_PFMGRelaxSetTempVec +hypre_PFMGRelaxSetTol +hypre_PFMGRelaxSetType +hypre_PFMGRelaxSetZeroGuess +hypre_PFMGRelaxSetup +hypre_PFMGSetDxyz +hypre_PFMGSetJacobiWeight +hypre_PFMGSetLogging +hypre_PFMGSetMatmultType +hypre_PFMGSetMaxIter +hypre_PFMGSetMaxLevels +hypre_PFMGSetNumPostRelax +hypre_PFMGSetNumPreRelax +hypre_PFMGSetPrintFreq +hypre_PFMGSetPrintLevel +hypre_PFMGSetRAPType +hypre_PFMGSetRelChange +hypre_PFMGSetRelaxType +hypre_PFMGSetSkipRelax +hypre_PFMGSetTol +hypre_PFMGSetZeroGuess +hypre_PFMGSetup +hypre_PFMGSetupInterpOp +hypre_PFMGSetupInterpOp_core_CC +hypre_PFMGSetupInterpOp_core_VC +hypre_PFMGSetupRAPOp +hypre_PFMGSolve +hypre_RedBlackConstantCoefGS +hypre_RedBlackGS +hypre_RedBlackGSCreate +hypre_RedBlackGSDestroy +hypre_RedBlackGSSetMaxIter +hypre_RedBlackGSSetStartBlack +hypre_RedBlackGSSetStartRed +hypre_RedBlackGSSetTol +hypre_RedBlackGSSetZeroGuess +hypre_RedBlackGSSetup +hypre_SMG2BuildRAPNoSym +hypre_SMG2BuildRAPSym +hypre_SMG2CreateRAPOp +hypre_SMG2RAPPeriodicNoSym +hypre_SMG2RAPPeriodicSym +hypre_SMG3BuildRAPNoSym +hypre_SMG3BuildRAPSym +hypre_SMG3CreateRAPOp +hypre_SMG3RAPPeriodicNoSym +hypre_SMG3RAPPeriodicSym +hypre_SMGAxpy +hypre_SMGCreate +hypre_SMGCreateInterpOp +hypre_SMGCreateRAPOp +hypre_SMGCreateRestrictOp +hypre_SMGDestroy +hypre_SMGGetFinalRelativeResidualNorm +hypre_SMGGetLogging +hypre_SMGGetMaxIter +hypre_SMGGetMemoryUse +hypre_SMGGetNumIterations +hypre_SMGGetNumPostRelax +hypre_SMGGetNumPreRelax +hypre_SMGGetPrintLevel +hypre_SMGGetRelChange +hypre_SMGGetTol +hypre_SMGGetZeroGuess +hypre_SMGPrintLogging +hypre_SMGRelax +hypre_SMGRelaxCreate +hypre_SMGRelaxDestroy +hypre_SMGRelaxDestroyARem +hypre_SMGRelaxDestroyASol +hypre_SMGRelaxDestroyTempVec +hypre_SMGRelaxSetBase +hypre_SMGRelaxSetMaxIter +hypre_SMGRelaxSetMaxLevel +hypre_SMGRelaxSetMemoryUse +hypre_SMGRelaxSetNewMatrixStencil +hypre_SMGRelaxSetNumPostRelax +hypre_SMGRelaxSetNumPreRelax +hypre_SMGRelaxSetNumPreSpaces +hypre_SMGRelaxSetNumRegSpaces +hypre_SMGRelaxSetNumSpaces +hypre_SMGRelaxSetPreSpaceRank +hypre_SMGRelaxSetRegSpaceRank +hypre_SMGRelaxSetSpace +hypre_SMGRelaxSetTempVec +hypre_SMGRelaxSetTol +hypre_SMGRelaxSetZeroGuess +hypre_SMGRelaxSetup +hypre_SMGRelaxSetupARem +hypre_SMGRelaxSetupASol +hypre_SMGRelaxSetupBaseBoxArray +hypre_SMGRelaxSetupTempVec +hypre_SMGResidual +hypre_SMGResidualCreate +hypre_SMGResidualDestroy +hypre_SMGResidualSetBase +hypre_SMGResidualSetup +hypre_SMGSetBase +hypre_SMGSetLogging +hypre_SMGSetMaxIter +hypre_SMGSetMaxLevel +hypre_SMGSetMemoryUse +hypre_SMGSetNumPostRelax +hypre_SMGSetNumPreRelax +hypre_SMGSetPrintLevel +hypre_SMGSetRelChange +hypre_SMGSetStructVectorConstantValues +hypre_SMGSetTol +hypre_SMGSetZeroGuess +hypre_SMGSetup +hypre_SMGSetupInterpOp +hypre_SMGSetupRAPOp +hypre_SMGSetupRestrictOp +hypre_SMGSolve +hypre_SemiBuildRAP +hypre_SemiCreateRAPOp +hypre_SemiInterp +hypre_SemiInterpCreate +hypre_SemiInterpDestroy +hypre_SemiInterpSetup +hypre_SemiRestrict +hypre_SemiRestrictCreate +hypre_SemiRestrictDestroy +hypre_SemiRestrictSetup +hypre_StructDiagScale +hypre_StructInterpAssemble +hypre_StructJacobiCreate +hypre_StructJacobiDestroy +hypre_StructJacobiGetFinalRelativeResidualNorm +hypre_StructJacobiGetMaxIter +hypre_StructJacobiGetNumIterations +hypre_StructJacobiGetTol +hypre_StructJacobiGetZeroGuess +hypre_StructJacobiSetMaxIter +hypre_StructJacobiSetTempVec +hypre_StructJacobiSetTol +hypre_StructJacobiSetWeight +hypre_StructJacobiSetZeroGuess +hypre_StructJacobiSetup +hypre_StructJacobiSolve +hypre_StructKrylovAxpy +hypre_StructKrylovCAlloc +hypre_StructKrylovClearVector +hypre_StructKrylovCommInfo +hypre_StructKrylovCopyVector +hypre_StructKrylovCreateVector +hypre_StructKrylovCreateVectorArray +hypre_StructKrylovDestroyVector +hypre_StructKrylovFree +hypre_StructKrylovIdentity +hypre_StructKrylovIdentitySetup +hypre_StructKrylovInnerProd +hypre_StructKrylovInnerProdTagged +hypre_StructKrylovMatvec +hypre_StructKrylovMatvecCreate +hypre_StructKrylovMatvecDestroy +hypre_StructKrylovScaleVector +hypre_StructKrylovSetRandomValues +hypre_structbicgstabcreate +hypre_structbicgstabdestroy +hypre_structbicgstabgetfinalrel +hypre_structbicgstabgetnumitera +hypre_structbicgstabgetresidual +hypre_structbicgstabsetabstol +hypre_structbicgstabsetlogging +hypre_structbicgstabsetmaxiter +hypre_structbicgstabsetprecond +hypre_structbicgstabsetprintlev +hypre_structbicgstabsettol +hypre_structbicgstabsetup +hypre_structbicgstabsolve +hypre_structcycredcreate +hypre_structcycreddestroy +hypre_structcycredsetbase +hypre_structcycredsettdim +hypre_structcycredsetup +hypre_structcycredsolve +hypre_structdiagscale +hypre_structdiagscalesetup +hypre_structfgmrescreate +hypre_structfgmresdestroy +hypre_structfgmresgetfinalrel +hypre_structfgmresgetnumiter +hypre_structfgmressetabstol +hypre_structfgmressetkdim +hypre_structfgmressetlogging +hypre_structfgmressetmaxiter +hypre_structfgmressetprecond +hypre_structfgmressetprintlevel +hypre_structfgmressettol +hypre_structfgmressetup +hypre_structfgmressolve +hypre_structgmrescreate +hypre_structgmresdestroy +hypre_structgmresgetfinalrelati +hypre_structgmresgetnumiteratio +hypre_structgmressetabstol +hypre_structgmressetkdim +hypre_structgmressetlogging +hypre_structgmressetmaxiter +hypre_structgmressetprecond +hypre_structgmressetprintlevel +hypre_structgmressettol +hypre_structgmressetup +hypre_structgmressolve +hypre_structhybridcreate +hypre_structhybriddestroy +hypre_structhybridgetdscgnumite +hypre_structhybridgetfinalrelat +hypre_structhybridgetnumiterati +hypre_structhybridgetpcgnumiter +hypre_structhybridsetconvergenc +hypre_structhybridsetdscgmaxite +hypre_structhybridsetkdim +hypre_structhybridsetlogging +hypre_structhybridsetpcgabsolut +hypre_structhybridsetpcgmaxiter +hypre_structhybridsetprecond +hypre_structhybridsetprintlevel +hypre_structhybridsetrelchange +hypre_structhybridsetsolvertype +hypre_structhybridsetstopcrit +hypre_structhybridsettol +hypre_structhybridsettwonorm +hypre_structhybridsetup +hypre_structhybridsolve +hypre_structjacobicreate +hypre_structjacobidestroy +hypre_structjacobigetfinalrelat +hypre_structjacobigetmaxiter +hypre_structjacobigetnumiterati +hypre_structjacobigettol +hypre_structjacobigetzeroguess +hypre_structjacobisetmaxiter +hypre_structjacobisetnonzerogue +hypre_structjacobisettol +hypre_structjacobisetup +hypre_structjacobisetzeroguess +hypre_structjacobisolve +hypre_structlgmrescreate +hypre_structlgmresdestroy +hypre_structlgmresgetfinalrel +hypre_structlgmresgetnumiter +hypre_structlgmressetabstol +hypre_structlgmressetaugdim +hypre_structlgmressetkdim +hypre_structlgmressetlogging +hypre_structlgmressetmaxiter +hypre_structlgmressetprecond +hypre_structlgmressetprintlevel +hypre_structlgmressettol +hypre_structlgmressetup +hypre_structlgmressolve +hypre_structpcgcreate +hypre_structpcgdestroy +hypre_structpcggetfinalrelative +hypre_structpcggetnumiterations +hypre_structpcgsetabstol +hypre_structpcgsetlogging +hypre_structpcgsetmaxiter +hypre_structpcgsetprecond +hypre_structpcgsetprintlevel +hypre_structpcgsetrelchange +hypre_structpcgsettol +hypre_structpcgsettwonorm +hypre_structpcgsetup +hypre_structpcgsolve +hypre_structpfmgcreate +hypre_structpfmgdestroy +hypre_structpfmggetfinalrelativ +hypre_structpfmggetlogging +hypre_structpfmggetmaxiter +hypre_structpfmggetmaxlevels +hypre_structpfmggetnumiteration +hypre_structpfmggetnumpostrelax +hypre_structpfmggetnumprerelax +hypre_structpfmggetprintlevel +hypre_structpfmggetraptype +hypre_structpfmggetrelaxtype +hypre_structpfmggetrelchange +hypre_structpfmggetskiprelax +hypre_structpfmggettol +hypre_structpfmggetzeroguess +hypre_structpfmgsetdxyz +hypre_structpfmgsetjacobiweigh +hypre_structpfmgsetlogging +hypre_structpfmgsetmaxiter +hypre_structpfmgsetmaxlevels +hypre_structpfmgsetnonzeroguess +hypre_structpfmgsetnumpostrelax +hypre_structpfmgsetnumprerelax +hypre_structpfmgsetprintlevel +hypre_structpfmgsetraptype +hypre_structpfmgsetrelaxtype +hypre_structpfmgsetrelchange +hypre_structpfmgsetskiprelax +hypre_structpfmgsettol +hypre_structpfmgsetup +hypre_structpfmgsetzeroguess +hypre_structpfmgsolve +hypre_structsetupinterpreter +hypre_structsetupmatvec +hypre_structsmgcreate +hypre_structsmgdestroy +hypre_structsmggetfinalrelative +hypre_structsmggetlogging +hypre_structsmggetmaxiter +hypre_structsmggetmemoryuse +hypre_structsmggetnumiterations +hypre_structsmggetnumpostrelax +hypre_structsmggetnumprerelax +hypre_structsmggetprintlevel +hypre_structsmggetrelchange +hypre_structsmggettol +hypre_structsmggetzeroguess +hypre_structsmgsetlogging +hypre_structsmgsetmaxiter +hypre_structsmgsetmemoryuse +hypre_structsmgsetnonzeroguess +hypre_structsmgsetnumpostrelax +hypre_structsmgsetnumprerelax +hypre_structsmgsetprintlevel +hypre_structsmgsetrelchange +hypre_structsmgsettol +hypre_structsmgsetup +hypre_structsmgsetzeroguess +hypre_structsmgsolve diff --git a/src/struct_ls/mup.functions b/src/struct_ls/mup.functions new file mode 100644 index 0000000000..d854232900 --- /dev/null +++ b/src/struct_ls/mup.functions @@ -0,0 +1,177 @@ +HYPRE_StructBiCGSTABCreate +HYPRE_StructBiCGSTABDestroy +HYPRE_StructBiCGSTABGetFinalRelativeResidualNorm +HYPRE_StructBiCGSTABGetNumIterations +HYPRE_StructBiCGSTABGetResidual +HYPRE_StructBiCGSTABSetAbsoluteTol +HYPRE_StructBiCGSTABSetLogging +HYPRE_StructBiCGSTABSetMaxIter +HYPRE_StructBiCGSTABSetPrecond +HYPRE_StructBiCGSTABSetPrintLevel +HYPRE_StructBiCGSTABSetTol +HYPRE_StructBiCGSTABSetup +HYPRE_StructBiCGSTABSolve +HYPRE_StructCycRedCreate +HYPRE_StructCycRedDestroy +HYPRE_StructCycRedSetBase +HYPRE_StructCycRedSetTDim +HYPRE_StructCycRedSetup +HYPRE_StructCycRedSolve +HYPRE_StructDiagScale +HYPRE_StructDiagScaleSetup +HYPRE_StructFlexGMRESCreate +HYPRE_StructFlexGMRESDestroy +HYPRE_StructFlexGMRESGetFinalRelativeResidualNorm +HYPRE_StructFlexGMRESGetNumIterations +HYPRE_StructFlexGMRESSetAbsoluteTol +HYPRE_StructFlexGMRESSetKDim +HYPRE_StructFlexGMRESSetLogging +HYPRE_StructFlexGMRESSetMaxIter +HYPRE_StructFlexGMRESSetModifyPC +HYPRE_StructFlexGMRESSetPrecond +HYPRE_StructFlexGMRESSetPrintLevel +HYPRE_StructFlexGMRESSetTol +HYPRE_StructFlexGMRESSetup +HYPRE_StructFlexGMRESSolve +HYPRE_StructGMRESCreate +HYPRE_StructGMRESDestroy +HYPRE_StructGMRESGetFinalRelativeResidualNorm +HYPRE_StructGMRESGetNumIterations +HYPRE_StructGMRESSetAbsoluteTol +HYPRE_StructGMRESSetKDim +HYPRE_StructGMRESSetLogging +HYPRE_StructGMRESSetMaxIter +HYPRE_StructGMRESSetPrecond +HYPRE_StructGMRESSetPrintLevel +HYPRE_StructGMRESSetTol +HYPRE_StructGMRESSetup +HYPRE_StructGMRESSolve +HYPRE_StructHybridCreate +HYPRE_StructHybridDestroy +HYPRE_StructHybridGetDSCGNumIterations +HYPRE_StructHybridGetFinalRelativeResidualNorm +HYPRE_StructHybridGetNumIterations +HYPRE_StructHybridGetPCGNumIterations +HYPRE_StructHybridGetRecomputeResidual +HYPRE_StructHybridGetRecomputeResidualP +HYPRE_StructHybridSetConvergenceTol +HYPRE_StructHybridSetDSCGMaxIter +HYPRE_StructHybridSetKDim +HYPRE_StructHybridSetLogging +HYPRE_StructHybridSetPCGAbsoluteTolFactor +HYPRE_StructHybridSetPCGMaxIter +HYPRE_StructHybridSetPrecond +HYPRE_StructHybridSetPrintLevel +HYPRE_StructHybridSetRecomputeResidual +HYPRE_StructHybridSetRecomputeResidualP +HYPRE_StructHybridSetRelChange +HYPRE_StructHybridSetSolverType +HYPRE_StructHybridSetStopCrit +HYPRE_StructHybridSetTol +HYPRE_StructHybridSetTwoNorm +HYPRE_StructHybridSetup +HYPRE_StructHybridSolve +HYPRE_StructJacobiCreate +HYPRE_StructJacobiDestroy +HYPRE_StructJacobiGetFinalRelativeResidualNorm +HYPRE_StructJacobiGetMaxIter +HYPRE_StructJacobiGetNumIterations +HYPRE_StructJacobiGetTol +HYPRE_StructJacobiGetZeroGuess +HYPRE_StructJacobiSetMaxIter +HYPRE_StructJacobiSetNonZeroGuess +HYPRE_StructJacobiSetTol +HYPRE_StructJacobiSetZeroGuess +HYPRE_StructJacobiSetup +HYPRE_StructJacobiSolve +HYPRE_StructLGMRESCreate +HYPRE_StructLGMRESDestroy +HYPRE_StructLGMRESGetFinalRelativeResidualNorm +HYPRE_StructLGMRESGetNumIterations +HYPRE_StructLGMRESSetAbsoluteTol +HYPRE_StructLGMRESSetAugDim +HYPRE_StructLGMRESSetKDim +HYPRE_StructLGMRESSetLogging +HYPRE_StructLGMRESSetMaxIter +HYPRE_StructLGMRESSetPrecond +HYPRE_StructLGMRESSetPrintLevel +HYPRE_StructLGMRESSetTol +HYPRE_StructLGMRESSetup +HYPRE_StructLGMRESSolve +HYPRE_StructPCGCreate +HYPRE_StructPCGDestroy +HYPRE_StructPCGGetFinalRelativeResidualNorm +HYPRE_StructPCGGetNumIterations +HYPRE_StructPCGSetAbsoluteTol +HYPRE_StructPCGSetLogging +HYPRE_StructPCGSetMaxIter +HYPRE_StructPCGSetPrecond +HYPRE_StructPCGSetPrintLevel +HYPRE_StructPCGSetRelChange +HYPRE_StructPCGSetTol +HYPRE_StructPCGSetTwoNorm +HYPRE_StructPCGSetup +HYPRE_StructPCGSolve +HYPRE_StructPFMGCreate +HYPRE_StructPFMGDestroy +HYPRE_StructPFMGGetFinalRelativeResidualNorm +HYPRE_StructPFMGGetJacobiWeight +HYPRE_StructPFMGGetLogging +HYPRE_StructPFMGGetMatmultType +HYPRE_StructPFMGGetMaxIter +HYPRE_StructPFMGGetMaxLevels +HYPRE_StructPFMGGetNumIterations +HYPRE_StructPFMGGetNumPostRelax +HYPRE_StructPFMGGetNumPreRelax +HYPRE_StructPFMGGetPrintLevel +HYPRE_StructPFMGGetRAPType +HYPRE_StructPFMGGetRelChange +HYPRE_StructPFMGGetRelaxType +HYPRE_StructPFMGGetSkipRelax +HYPRE_StructPFMGGetTol +HYPRE_StructPFMGGetZeroGuess +HYPRE_StructPFMGSetDxyz +HYPRE_StructPFMGSetJacobiWeight +HYPRE_StructPFMGSetLogging +HYPRE_StructPFMGSetMatmultType +HYPRE_StructPFMGSetMaxIter +HYPRE_StructPFMGSetMaxLevels +HYPRE_StructPFMGSetNonZeroGuess +HYPRE_StructPFMGSetNumPostRelax +HYPRE_StructPFMGSetNumPreRelax +HYPRE_StructPFMGSetPrintLevel +HYPRE_StructPFMGSetRAPType +HYPRE_StructPFMGSetRelChange +HYPRE_StructPFMGSetRelaxType +HYPRE_StructPFMGSetSkipRelax +HYPRE_StructPFMGSetTol +HYPRE_StructPFMGSetZeroGuess +HYPRE_StructPFMGSetup +HYPRE_StructPFMGSolve +HYPRE_StructSMGCreate +HYPRE_StructSMGDestroy +HYPRE_StructSMGGetFinalRelativeResidualNorm +HYPRE_StructSMGGetLogging +HYPRE_StructSMGGetMaxIter +HYPRE_StructSMGGetMemoryUse +HYPRE_StructSMGGetNumIterations +HYPRE_StructSMGGetNumPostRelax +HYPRE_StructSMGGetNumPreRelax +HYPRE_StructSMGGetPrintLevel +HYPRE_StructSMGGetRelChange +HYPRE_StructSMGGetTol +HYPRE_StructSMGGetZeroGuess +HYPRE_StructSMGSetLogging +HYPRE_StructSMGSetMaxIter +HYPRE_StructSMGSetMemoryUse +HYPRE_StructSMGSetNonZeroGuess +HYPRE_StructSMGSetNumPostRelax +HYPRE_StructSMGSetNumPreRelax +HYPRE_StructSMGSetPrintLevel +HYPRE_StructSMGSetRelChange +HYPRE_StructSMGSetTol +HYPRE_StructSMGSetZeroGuess +HYPRE_StructSMGSetup +HYPRE_StructSMGSolve +HYPRE_StructSetupInterpreter +HYPRE_StructSetupMatvec diff --git a/src/struct_ls/mup.methods b/src/struct_ls/mup.methods new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/struct_ls/mup_code b/src/struct_ls/mup_code new file mode 100755 index 0000000000..fa7b9ac363 --- /dev/null +++ b/src/struct_ls/mup_code @@ -0,0 +1,7 @@ +#!/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) + +../config/gen_code.sh HYPRE_struct_ls.h _hypre_struct_ls.h mup diff --git a/src/struct_ls/mup_fixed.c b/src/struct_ls/mup_fixed.c new file mode 100644 index 0000000000..82456ca5b7 --- /dev/null +++ b/src/struct_ls/mup_fixed.c @@ -0,0 +1,2043 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_struct_ls.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_StructMatrix * +hypre_CycRedCreateCoarseOp( hypre_StructMatrix *A, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CycRedCreateCoarseOp)( A, coarse_grid, cdir ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CycRedSetupCoarseOp( hypre_StructMatrix *A, hypre_StructMatrix *Ac, hypre_Index cindex, hypre_Index cstride, HYPRE_Int cdir ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CycRedSetupCoarseOp)( A, Ac, cindex, cstride, cdir ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CyclicReduction( void *cyc_red_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CyclicReduction)( cyc_red_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_CyclicReductionCreate( MPI_Comm comm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CyclicReductionCreate)( comm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CyclicReductionDestroy( void *cyc_red_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CyclicReductionDestroy)( cyc_red_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CyclicReductionSetBase( void *cyc_red_vdata, hypre_Index base_index, hypre_Index base_stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CyclicReductionSetBase)( cyc_red_vdata, base_index, base_stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CyclicReductionSetCDir( void *cyc_red_vdata, HYPRE_Int cdir ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CyclicReductionSetCDir)( cyc_red_vdata, cdir ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CyclicReductionSetup( void *cyc_red_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CyclicReductionSetup)( cyc_red_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_HybridCreate( MPI_Comm comm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_HybridCreate)( comm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_HybridDestroy( void *hybrid_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_HybridDestroy)( hybrid_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_HybridGetDSCGNumIterations( void *hybrid_vdata, HYPRE_Int *dscg_num_its ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_HybridGetDSCGNumIterations)( hybrid_vdata, dscg_num_its ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_HybridGetFinalRelativeResidualNorm( void *hybrid_vdata, HYPRE_Real *final_rel_res_norm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_HybridGetFinalRelativeResidualNorm)( hybrid_vdata, final_rel_res_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_HybridGetNumIterations( void *hybrid_vdata, HYPRE_Int *num_its ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_HybridGetNumIterations)( hybrid_vdata, num_its ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_HybridGetPCGNumIterations( void *hybrid_vdata, HYPRE_Int *pcg_num_its ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_HybridGetPCGNumIterations)( hybrid_vdata, pcg_num_its ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_HybridGetRecomputeResidual( void *hybrid_vdata, HYPRE_Int *recompute_residual ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_HybridGetRecomputeResidual)( hybrid_vdata, recompute_residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_HybridGetRecomputeResidualP( void *hybrid_vdata, HYPRE_Int *recompute_residual_p ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_HybridGetRecomputeResidualP)( hybrid_vdata, recompute_residual_p ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_HybridSetConvergenceTol( void *hybrid_vdata, HYPRE_Real cf_tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_HybridSetConvergenceTol)( hybrid_vdata, cf_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_HybridSetDSCGMaxIter( void *hybrid_vdata, HYPRE_Int dscg_max_its ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_HybridSetDSCGMaxIter)( hybrid_vdata, dscg_max_its ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_HybridSetKDim( void *hybrid_vdata, HYPRE_Int k_dim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_HybridSetKDim)( hybrid_vdata, k_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_HybridSetLogging( void *hybrid_vdata, HYPRE_Int logging ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_HybridSetLogging)( hybrid_vdata, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_HybridSetPCGAbsoluteTolFactor( void *hybrid_vdata, HYPRE_Real pcg_atolf ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_HybridSetPCGAbsoluteTolFactor)( hybrid_vdata, pcg_atolf ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_HybridSetPCGMaxIter( void *hybrid_vdata, HYPRE_Int pcg_max_its ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_HybridSetPCGMaxIter)( hybrid_vdata, pcg_max_its ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_HybridSetPrintLevel( void *hybrid_vdata, HYPRE_Int print_level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_HybridSetPrintLevel)( hybrid_vdata, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_HybridSetRecomputeResidual( void *hybrid_vdata, HYPRE_Int recompute_residual ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_HybridSetRecomputeResidual)( hybrid_vdata, recompute_residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_HybridSetRecomputeResidualP( void *hybrid_vdata, HYPRE_Int recompute_residual_p ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_HybridSetRecomputeResidualP)( hybrid_vdata, recompute_residual_p ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_HybridSetRelChange( void *hybrid_vdata, HYPRE_Int rel_change ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_HybridSetRelChange)( hybrid_vdata, rel_change ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_HybridSetSolverType( void *hybrid_vdata, HYPRE_Int solver_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_HybridSetSolverType)( hybrid_vdata, solver_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_HybridSetStopCrit( void *hybrid_vdata, HYPRE_Int stop_crit ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_HybridSetStopCrit)( hybrid_vdata, stop_crit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_HybridSetTol( void *hybrid_vdata, HYPRE_Real tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_HybridSetTol)( hybrid_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_HybridSetTwoNorm( void *hybrid_vdata, HYPRE_Int two_norm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_HybridSetTwoNorm)( hybrid_vdata, two_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_HybridSetup( void *hybrid_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_HybridSetup)( hybrid_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_HybridSolve( void *hybrid_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_HybridSolve)( hybrid_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMG2BuildRAPNoSym)( A, P, R, cdir, cindex, cstride, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC0)( ci, fi, A, P, R, cdir, cindex, cstride, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMG2BuildRAPNoSym_onebox_FSS5_CC1)( ci, fi, A, P, R, cdir, cindex, cstride, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC0)( ci, fi, A, P, R, cdir, cindex, cstride, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMG2BuildRAPNoSym_onebox_FSS9_CC1)( ci, fi, A, P, R, cdir, cindex, cstride, RAP ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMG2BuildRAPSym)( A, P, R, cdir, cindex, cstride, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMG2BuildRAPSym_onebox_FSS5_CC0)( ci, fi, A, P, R, cdir, cindex, cstride, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMG2BuildRAPSym_onebox_FSS5_CC1)( ci, fi, A, P, R, cdir, cindex, cstride, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMG2BuildRAPSym_onebox_FSS9_CC0)( ci, fi, A, P, R, cdir, cindex, cstride, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMG2BuildRAPSym_onebox_FSS9_CC1)( ci, fi, A, P, R, cdir, cindex, cstride, RAP ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_StructMatrix * +hypre_PFMG2CreateRAPOp( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMG2CreateRAPOp)( R, A, P, coarse_grid, cdir ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMG3BuildRAPNoSym)( A, P, R, cdir, cindex, cstride, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC0)( ci, fi, A, P, R, cdir, cindex, cstride, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMG3BuildRAPNoSym_onebox_FSS07_CC1)( ci, fi, A, P, R, cdir, cindex, cstride, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC0)( ci, fi, A, P, R, cdir, cindex, cstride, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMG3BuildRAPNoSym_onebox_FSS19_CC1)( ci, fi, A, P, R, cdir, cindex, cstride, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC0)( ci, fi, A, P, R, cdir, cindex, cstride, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMG3BuildRAPNoSym_onebox_FSS27_CC1)( ci, fi, A, P, R, cdir, cindex, cstride, RAP ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMG3BuildRAPSym)( A, P, R, cdir, cindex, cstride, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMG3BuildRAPSym_onebox_FSS07_CC0)( ci, fi, A, P, R, cdir, cindex, cstride, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMG3BuildRAPSym_onebox_FSS07_CC1)( ci, fi, A, P, R, cdir, cindex, cstride, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMG3BuildRAPSym_onebox_FSS19_CC0)( ci, fi, A, P, R, cdir, cindex, cstride, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMG3BuildRAPSym_onebox_FSS19_CC1)( ci, fi, A, P, R, cdir, cindex, cstride, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMG3BuildRAPSym_onebox_FSS27_CC0)( ci, fi, A, P, R, cdir, cindex, cstride, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMG3BuildRAPSym_onebox_FSS27_CC1)( ci, fi, A, P, R, cdir, cindex, cstride, RAP ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_StructMatrix * +hypre_PFMG3CreateRAPOp( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMG3CreateRAPOp)( R, A, P, coarse_grid, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGBuildCoarseOp5)( A, P, R, cdir, cindex, cstride, RAP ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGBuildCoarseOp7)( A, P, R, cdir, cindex, cstride, RAP ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGCoarsen( hypre_Box *cbox, hypre_Index periodic, HYPRE_Int max_levels, HYPRE_Int dxyz_flag, HYPRE_Real *dxyz, HYPRE_Int **cdir_l_ptr, HYPRE_Int **active_l_ptr, HYPRE_Real **relax_weights_ptr, HYPRE_Int *num_levels ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGCoarsen)( cbox, periodic, max_levels, dxyz_flag, dxyz, cdir_l_ptr, active_l_ptr, relax_weights_ptr, num_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGComputeCxyz( hypre_StructMatrix *A, HYPRE_Real *cxyz, HYPRE_Real *sqcxyz ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGComputeCxyz)( A, cxyz, sqcxyz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGComputeDxyz( hypre_StructMatrix *A, HYPRE_Real *dxyz, HYPRE_Int *dxyz_flag ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGComputeDxyz)( A, dxyz, dxyz_flag ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGComputeMaxLevels( hypre_StructGrid *grid, HYPRE_Int *max_levels_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGComputeMaxLevels)( grid, max_levels_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_PFMGCreate( MPI_Comm comm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGCreate)( comm ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_StructMatrix * +hypre_PFMGCreateCoarseOp5( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGCreateCoarseOp5)( R, A, P, coarse_grid, cdir ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_StructMatrix * +hypre_PFMGCreateCoarseOp7( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGCreateCoarseOp7)( R, A, P, coarse_grid, cdir ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_StructMatrix * +hypre_PFMGCreateInterpOp( hypre_StructMatrix *A, HYPRE_Int cdir, hypre_Index stride, HYPRE_Int rap_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGCreateInterpOp)( A, cdir, stride, rap_type ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_StructMatrix * +hypre_PFMGCreateRAPOp( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructGrid *coarse_grid, HYPRE_Int cdir, HYPRE_Int rap_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGCreateRAPOp)( R, A, P, coarse_grid, cdir, rap_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGDestroy( void *pfmg_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGDestroy)( pfmg_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGGetFinalRelativeResidualNorm( void *pfmg_vdata, HYPRE_Real *relative_residual_norm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGGetFinalRelativeResidualNorm)( pfmg_vdata, relative_residual_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGGetJacobiWeight( void *pfmg_vdata, HYPRE_Real *weight ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGGetJacobiWeight)( pfmg_vdata, weight ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGGetLogging( void *pfmg_vdata, HYPRE_Int *logging ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGGetLogging)( pfmg_vdata, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGGetMatmultType( void *pfmg_vdata, HYPRE_Int *matmult_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGGetMatmultType)( pfmg_vdata, matmult_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGGetMaxIter( void *pfmg_vdata, HYPRE_Int *max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGGetMaxIter)( pfmg_vdata, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGGetMaxLevels( void *pfmg_vdata, HYPRE_Int *max_levels ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGGetMaxLevels)( pfmg_vdata, max_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGGetNumIterations( void *pfmg_vdata, HYPRE_Int *num_iterations ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGGetNumIterations)( pfmg_vdata, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGGetNumPostRelax( void *pfmg_vdata, HYPRE_Int *num_post_relax ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGGetNumPostRelax)( pfmg_vdata, num_post_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGGetNumPreRelax( void *pfmg_vdata, HYPRE_Int *num_pre_relax ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGGetNumPreRelax)( pfmg_vdata, num_pre_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGGetPrintFreq( void *pfmg_vdata, HYPRE_Int *print_freq ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGGetPrintFreq)( pfmg_vdata, print_freq ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGGetPrintLevel( void *pfmg_vdata, HYPRE_Int *print_level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGGetPrintLevel)( pfmg_vdata, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGGetRAPType( void *pfmg_vdata, HYPRE_Int *rap_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGGetRAPType)( pfmg_vdata, rap_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGGetRelChange( void *pfmg_vdata, HYPRE_Int *rel_change ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGGetRelChange)( pfmg_vdata, rel_change ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGGetRelaxType( void *pfmg_vdata, HYPRE_Int *relax_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGGetRelaxType)( pfmg_vdata, relax_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGGetSkipRelax( void *pfmg_vdata, HYPRE_Int *skip_relax ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGGetSkipRelax)( pfmg_vdata, skip_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGGetTol( void *pfmg_vdata, HYPRE_Real *tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGGetTol)( pfmg_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGGetZeroGuess( void *pfmg_vdata, HYPRE_Int *zero_guess ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGGetZeroGuess)( pfmg_vdata, zero_guess ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGPrintLogging( void *pfmg_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGPrintLogging)( pfmg_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGRelax( void *pfmg_relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGRelax)( pfmg_relax_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_PFMGRelaxCreate( MPI_Comm comm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGRelaxCreate)( comm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGRelaxDestroy( void *pfmg_relax_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGRelaxDestroy)( pfmg_relax_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGRelaxSetJacobiWeight( void *pfmg_relax_vdata, HYPRE_Real weight ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGRelaxSetJacobiWeight)( pfmg_relax_vdata, weight ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGRelaxSetMaxIter( void *pfmg_relax_vdata, HYPRE_Int max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGRelaxSetMaxIter)( pfmg_relax_vdata, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGRelaxSetPostRelax( void *pfmg_relax_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGRelaxSetPostRelax)( pfmg_relax_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGRelaxSetPreRelax( void *pfmg_relax_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGRelaxSetPreRelax)( pfmg_relax_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGRelaxSetTempVec( void *pfmg_relax_vdata, hypre_StructVector *t ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGRelaxSetTempVec)( pfmg_relax_vdata, t ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGRelaxSetTol( void *pfmg_relax_vdata, HYPRE_Real tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGRelaxSetTol)( pfmg_relax_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGRelaxSetType( void *pfmg_relax_vdata, HYPRE_Int relax_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGRelaxSetType)( pfmg_relax_vdata, relax_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGRelaxSetZeroGuess( void *pfmg_relax_vdata, HYPRE_Int zero_guess ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGRelaxSetZeroGuess)( pfmg_relax_vdata, zero_guess ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGRelaxSetup( void *pfmg_relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGRelaxSetup)( pfmg_relax_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGSetDxyz( void *pfmg_vdata, HYPRE_Real *dxyz ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGSetDxyz)( pfmg_vdata, dxyz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGSetJacobiWeight( void *pfmg_vdata, HYPRE_Real weight ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGSetJacobiWeight)( pfmg_vdata, weight ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGSetLogging( void *pfmg_vdata, HYPRE_Int logging ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGSetLogging)( pfmg_vdata, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGSetMatmultType( void *pfmg_vdata, HYPRE_Int matmult_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGSetMatmultType)( pfmg_vdata, matmult_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGSetMaxIter( void *pfmg_vdata, HYPRE_Int max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGSetMaxIter)( pfmg_vdata, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGSetMaxLevels( void *pfmg_vdata, HYPRE_Int max_levels ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGSetMaxLevels)( pfmg_vdata, max_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGSetNumPostRelax( void *pfmg_vdata, HYPRE_Int num_post_relax ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGSetNumPostRelax)( pfmg_vdata, num_post_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGSetNumPreRelax( void *pfmg_vdata, HYPRE_Int num_pre_relax ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGSetNumPreRelax)( pfmg_vdata, num_pre_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGSetPrintFreq( void *pfmg_vdata, HYPRE_Int print_freq ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGSetPrintFreq)( pfmg_vdata, print_freq ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGSetPrintLevel( void *pfmg_vdata, HYPRE_Int print_level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGSetPrintLevel)( pfmg_vdata, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGSetRAPType( void *pfmg_vdata, HYPRE_Int rap_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGSetRAPType)( pfmg_vdata, rap_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGSetRelChange( void *pfmg_vdata, HYPRE_Int rel_change ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGSetRelChange)( pfmg_vdata, rel_change ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGSetRelaxType( void *pfmg_vdata, HYPRE_Int relax_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGSetRelaxType)( pfmg_vdata, relax_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGSetSkipRelax( void *pfmg_vdata, HYPRE_Int skip_relax ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGSetSkipRelax)( pfmg_vdata, skip_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGSetTol( void *pfmg_vdata, HYPRE_Real tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGSetTol)( pfmg_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGSetZeroGuess( void *pfmg_vdata, HYPRE_Int zero_guess ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGSetZeroGuess)( pfmg_vdata, zero_guess ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGSetup( void *pfmg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGSetup)( pfmg_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGSetupInterpOp( hypre_StructMatrix *P, hypre_StructMatrix *A, HYPRE_Int cdir ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGSetupInterpOp)( P, A, cdir ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGSetupInterpOp_core_CC( hypre_StructMatrix *P, hypre_StructMatrix *A, HYPRE_Int cdir, HYPRE_Complex *Pconst0_ptr, HYPRE_Complex *Pconst1_ptr, HYPRE_Complex *Pconst2_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGSetupInterpOp_core_CC)( P, A, cdir, Pconst0_ptr, Pconst1_ptr, Pconst2_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGSetupInterpOp_core_VC( hypre_StructMatrix *P, hypre_StructMatrix *A, HYPRE_Int cdir, HYPRE_Complex Pconst0, HYPRE_Complex Pconst1, HYPRE_Complex Pconst2 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGSetupInterpOp_core_VC)( P, A, cdir, Pconst0, Pconst1, Pconst2 ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGSetupRAPOp)( R, A, P, cdir, cindex, cstride, rap_type, Ac ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGSolve( void *pfmg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PFMGSolve)( pfmg_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_RedBlackConstantCoefGS( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_RedBlackConstantCoefGS)( relax_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_RedBlackGS( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_RedBlackGS)( relax_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_RedBlackGSCreate( MPI_Comm comm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_RedBlackGSCreate)( comm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_RedBlackGSDestroy( void *relax_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_RedBlackGSDestroy)( relax_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_RedBlackGSSetMaxIter( void *relax_vdata, HYPRE_Int max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_RedBlackGSSetMaxIter)( relax_vdata, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_RedBlackGSSetStartBlack( void *relax_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_RedBlackGSSetStartBlack)( relax_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_RedBlackGSSetStartRed( void *relax_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_RedBlackGSSetStartRed)( relax_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_RedBlackGSSetTol( void *relax_vdata, HYPRE_Real tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_RedBlackGSSetTol)( relax_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_RedBlackGSSetZeroGuess( void *relax_vdata, HYPRE_Int zero_guess ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_RedBlackGSSetZeroGuess)( relax_vdata, zero_guess ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_RedBlackGSSetup( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_RedBlackGSSetup)( relax_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMG2BuildRAPNoSym( hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructMatrix *R, hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMG2BuildRAPNoSym)( A, PT, R, RAP, cindex, cstride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMG2BuildRAPSym( hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructMatrix *R, hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMG2BuildRAPSym)( A, PT, R, RAP, cindex, cstride ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_StructMatrix * +hypre_SMG2CreateRAPOp( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructGrid *coarse_grid ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMG2CreateRAPOp)( R, A, PT, coarse_grid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMG2RAPPeriodicNoSym( hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMG2RAPPeriodicNoSym)( RAP, cindex, cstride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMG2RAPPeriodicSym( hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMG2RAPPeriodicSym)( RAP, cindex, cstride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMG3BuildRAPNoSym( hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructMatrix *R, hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMG3BuildRAPNoSym)( A, PT, R, RAP, cindex, cstride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMG3BuildRAPSym( hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructMatrix *R, hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMG3BuildRAPSym)( A, PT, R, RAP, cindex, cstride ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_StructMatrix * +hypre_SMG3CreateRAPOp( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructGrid *coarse_grid ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMG3CreateRAPOp)( R, A, PT, coarse_grid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMG3RAPPeriodicNoSym( hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMG3RAPPeriodicNoSym)( RAP, cindex, cstride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMG3RAPPeriodicSym( hypre_StructMatrix *RAP, hypre_Index cindex, hypre_Index cstride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMG3RAPPeriodicSym)( RAP, cindex, cstride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGAxpy( HYPRE_Real alpha, hypre_StructVector *x, hypre_StructVector *y, hypre_Index base_index, hypre_Index base_stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGAxpy)( alpha, x, y, base_index, base_stride ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_SMGCreate( MPI_Comm comm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGCreate)( comm ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_StructMatrix * +hypre_SMGCreateInterpOp( hypre_StructMatrix *A, hypre_StructGrid *cgrid, HYPRE_Int cdir ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGCreateInterpOp)( A, cgrid, cdir ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_StructMatrix * +hypre_SMGCreateRAPOp( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructGrid *coarse_grid ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGCreateRAPOp)( R, A, PT, coarse_grid ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_StructMatrix * +hypre_SMGCreateRestrictOp( hypre_StructMatrix *A, hypre_StructGrid *cgrid, HYPRE_Int cdir ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGCreateRestrictOp)( A, cgrid, cdir ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGDestroy( void *smg_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGDestroy)( smg_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGGetFinalRelativeResidualNorm( void *smg_vdata, HYPRE_Real *relative_residual_norm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGGetFinalRelativeResidualNorm)( smg_vdata, relative_residual_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGGetLogging( void *smg_vdata, HYPRE_Int *logging ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGGetLogging)( smg_vdata, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGGetMaxIter( void *smg_vdata, HYPRE_Int *max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGGetMaxIter)( smg_vdata, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGGetMemoryUse( void *smg_vdata, HYPRE_Int *memory_use ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGGetMemoryUse)( smg_vdata, memory_use ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGGetNumIterations( void *smg_vdata, HYPRE_Int *num_iterations ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGGetNumIterations)( smg_vdata, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGGetNumPostRelax( void *smg_vdata, HYPRE_Int *num_post_relax ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGGetNumPostRelax)( smg_vdata, num_post_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGGetNumPreRelax( void *smg_vdata, HYPRE_Int *num_pre_relax ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGGetNumPreRelax)( smg_vdata, num_pre_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGGetPrintLevel( void *smg_vdata, HYPRE_Int *print_level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGGetPrintLevel)( smg_vdata, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGGetRelChange( void *smg_vdata, HYPRE_Int *rel_change ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGGetRelChange)( smg_vdata, rel_change ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGGetTol( void *smg_vdata, HYPRE_Real *tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGGetTol)( smg_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGGetZeroGuess( void *smg_vdata, HYPRE_Int *zero_guess ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGGetZeroGuess)( smg_vdata, zero_guess ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGPrintLogging( void *smg_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGPrintLogging)( smg_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGRelax( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGRelax)( relax_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_SMGRelaxCreate( MPI_Comm comm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGRelaxCreate)( comm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGRelaxDestroy( void *relax_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGRelaxDestroy)( relax_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGRelaxDestroyARem( void *relax_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGRelaxDestroyARem)( relax_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGRelaxDestroyASol( void *relax_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGRelaxDestroyASol)( relax_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGRelaxDestroyTempVec( void *relax_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGRelaxDestroyTempVec)( relax_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGRelaxSetBase( void *relax_vdata, hypre_Index base_index, hypre_Index base_stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGRelaxSetBase)( relax_vdata, base_index, base_stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGRelaxSetMaxIter( void *relax_vdata, HYPRE_Int max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGRelaxSetMaxIter)( relax_vdata, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGRelaxSetMaxLevel( void *relax_vdata, HYPRE_Int num_max_level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGRelaxSetMaxLevel)( relax_vdata, num_max_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGRelaxSetMemoryUse( void *relax_vdata, HYPRE_Int memory_use ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGRelaxSetMemoryUse)( relax_vdata, memory_use ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGRelaxSetNewMatrixStencil( void *relax_vdata, hypre_StructStencil *diff_stencil ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGRelaxSetNewMatrixStencil)( relax_vdata, diff_stencil ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGRelaxSetNumPostRelax( void *relax_vdata, HYPRE_Int num_post_relax ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGRelaxSetNumPostRelax)( relax_vdata, num_post_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGRelaxSetNumPreRelax( void *relax_vdata, HYPRE_Int num_pre_relax ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGRelaxSetNumPreRelax)( relax_vdata, num_pre_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGRelaxSetNumPreSpaces( void *relax_vdata, HYPRE_Int num_pre_spaces ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGRelaxSetNumPreSpaces)( relax_vdata, num_pre_spaces ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGRelaxSetNumRegSpaces( void *relax_vdata, HYPRE_Int num_reg_spaces ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGRelaxSetNumRegSpaces)( relax_vdata, num_reg_spaces ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGRelaxSetNumSpaces( void *relax_vdata, HYPRE_Int num_spaces ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGRelaxSetNumSpaces)( relax_vdata, num_spaces ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGRelaxSetPreSpaceRank( void *relax_vdata, HYPRE_Int i, HYPRE_Int pre_space_rank ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGRelaxSetPreSpaceRank)( relax_vdata, i, pre_space_rank ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGRelaxSetRegSpaceRank( void *relax_vdata, HYPRE_Int i, HYPRE_Int reg_space_rank ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGRelaxSetRegSpaceRank)( relax_vdata, i, reg_space_rank ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGRelaxSetSpace( void *relax_vdata, HYPRE_Int i, HYPRE_Int space_index, HYPRE_Int space_stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGRelaxSetSpace)( relax_vdata, i, space_index, space_stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGRelaxSetTempVec( void *relax_vdata, hypre_StructVector *temp_vec ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGRelaxSetTempVec)( relax_vdata, temp_vec ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGRelaxSetTol( void *relax_vdata, HYPRE_Real tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGRelaxSetTol)( relax_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGRelaxSetZeroGuess( void *relax_vdata, HYPRE_Int zero_guess ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGRelaxSetZeroGuess)( relax_vdata, zero_guess ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGRelaxSetup( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGRelaxSetup)( relax_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGRelaxSetupARem( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGRelaxSetupARem)( relax_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGRelaxSetupASol( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGRelaxSetupASol)( relax_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGRelaxSetupBaseBoxArray( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGRelaxSetupBaseBoxArray)( relax_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGRelaxSetupTempVec( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGRelaxSetupTempVec)( relax_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGResidual( void *residual_vdata, hypre_StructMatrix *A, hypre_StructVector *x, hypre_StructVector *b, hypre_StructVector *r ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGResidual)( residual_vdata, A, x, b, r ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_SMGResidualCreate( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGResidualCreate)( ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGResidualDestroy( void *residual_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGResidualDestroy)( residual_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGResidualSetBase( void *residual_vdata, hypre_Index base_index, hypre_Index base_stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGResidualSetBase)( residual_vdata, base_index, base_stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGResidualSetup( void *residual_vdata, hypre_StructMatrix *A, hypre_StructVector *x, hypre_StructVector *b, hypre_StructVector *r ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGResidualSetup)( residual_vdata, A, x, b, r ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGSetBase( void *smg_vdata, hypre_Index base_index, hypre_Index base_stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGSetBase)( smg_vdata, base_index, base_stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGSetLogging( void *smg_vdata, HYPRE_Int logging ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGSetLogging)( smg_vdata, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGSetMaxIter( void *smg_vdata, HYPRE_Int max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGSetMaxIter)( smg_vdata, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGSetMaxLevel( void *smg_vdata, HYPRE_Int max_level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGSetMaxLevel)( smg_vdata, max_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGSetMemoryUse( void *smg_vdata, HYPRE_Int memory_use ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGSetMemoryUse)( smg_vdata, memory_use ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGSetNumPostRelax( void *smg_vdata, HYPRE_Int num_post_relax ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGSetNumPostRelax)( smg_vdata, num_post_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGSetNumPreRelax( void *smg_vdata, HYPRE_Int num_pre_relax ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGSetNumPreRelax)( smg_vdata, num_pre_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGSetPrintLevel( void *smg_vdata, HYPRE_Int print_level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGSetPrintLevel)( smg_vdata, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGSetRelChange( void *smg_vdata, HYPRE_Int rel_change ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGSetRelChange)( smg_vdata, rel_change ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGSetStructVectorConstantValues( hypre_StructVector *vector, HYPRE_Real values, hypre_BoxArray *box_array, hypre_Index stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGSetStructVectorConstantValues)( vector, values, box_array, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGSetTol( void *smg_vdata, HYPRE_Real tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGSetTol)( smg_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGSetZeroGuess( void *smg_vdata, HYPRE_Int zero_guess ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGSetZeroGuess)( smg_vdata, zero_guess ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGSetup( void *smg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGSetup)( smg_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGSetupInterpOp)( relax_data, A, b, x, PT, cdir, cindex, findex, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGSetupRAPOp( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *PT, hypre_StructMatrix *Ac, hypre_Index cindex, hypre_Index cstride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGSetupRAPOp)( R, A, PT, Ac, cindex, cstride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGSetupRestrictOp( hypre_StructMatrix *A, hypre_StructMatrix *R, hypre_StructVector *temp_vec, HYPRE_Int cdir, hypre_Index cindex, hypre_Index cstride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGSetupRestrictOp)( A, R, temp_vec, cdir, cindex, cstride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SMGSolve( void *smg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SMGSolve)( smg_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SemiBuildRAP)( A, P, R, cdir, cindex, cstride, P_stored_as_transpose, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SemiCreateRAPOp)( R, A, P, coarse_grid, cdir, P_stored_as_transpose ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SemiInterp( void *interp_vdata, hypre_StructMatrix *P, hypre_StructVector *xc, hypre_StructVector *e ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SemiInterp)( interp_vdata, P, xc, e ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_SemiInterpCreate( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SemiInterpCreate)( ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SemiInterpDestroy( void *interp_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SemiInterpDestroy)( interp_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SemiInterpSetup)( interp_vdata, P, P_stored_as_transpose, xc, e, cindex, findex, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SemiRestrict( void *restrict_vdata, hypre_StructMatrix *R, hypre_StructVector *r, hypre_StructVector *rc ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SemiRestrict)( restrict_vdata, R, r, rc ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_SemiRestrictCreate( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SemiRestrictCreate)( ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SemiRestrictDestroy( void *restrict_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SemiRestrictDestroy)( restrict_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SemiRestrictSetup)( restrict_vdata, R, R_stored_as_transpose, r, rc, cindex, findex, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructDiagScale( hypre_StructMatrix *A, hypre_StructVector *y, hypre_StructVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructDiagScale)( A, y, x ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructInterpAssemble)( A, P, P_stored_as_transpose, cdir, index, stride ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_StructJacobiCreate( MPI_Comm comm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructJacobiCreate)( comm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructJacobiDestroy( void *jacobi_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructJacobiDestroy)( jacobi_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructJacobiGetFinalRelativeResidualNorm( void *jacobi_vdata, HYPRE_Real *norm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructJacobiGetFinalRelativeResidualNorm)( jacobi_vdata, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructJacobiGetMaxIter( void *jacobi_vdata, HYPRE_Int *max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructJacobiGetMaxIter)( jacobi_vdata, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructJacobiGetNumIterations( void *jacobi_vdata, HYPRE_Int *num_iterations ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructJacobiGetNumIterations)( jacobi_vdata, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructJacobiGetTol( void *jacobi_vdata, HYPRE_Real *tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructJacobiGetTol)( jacobi_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructJacobiGetZeroGuess( void *jacobi_vdata, HYPRE_Int *zero_guess ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructJacobiGetZeroGuess)( jacobi_vdata, zero_guess ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructJacobiSetMaxIter( void *jacobi_vdata, HYPRE_Int max_iter ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructJacobiSetMaxIter)( jacobi_vdata, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructJacobiSetTempVec( void *jacobi_vdata, hypre_StructVector *t ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructJacobiSetTempVec)( jacobi_vdata, t ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructJacobiSetTol( void *jacobi_vdata, HYPRE_Real tol ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructJacobiSetTol)( jacobi_vdata, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructJacobiSetWeight( void *jacobi_vdata, HYPRE_Real weight ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructJacobiSetWeight)( jacobi_vdata, weight ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructJacobiSetZeroGuess( void *jacobi_vdata, HYPRE_Int zero_guess ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructJacobiSetZeroGuess)( jacobi_vdata, zero_guess ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructJacobiSetup( void *jacobi_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructJacobiSetup)( jacobi_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructJacobiSolve( void *jacobi_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructJacobiSolve)( jacobi_vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructKrylovAxpy( HYPRE_Complex alpha, void *x, void *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructKrylovAxpy)( alpha, x, y ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_StructKrylovCAlloc( size_t count, size_t elt_size, HYPRE_MemoryLocation location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructKrylovCAlloc)( count, elt_size, location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructKrylovClearVector( void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructKrylovClearVector)( x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructKrylovCommInfo( void *A, HYPRE_Int *my_id, HYPRE_Int *num_procs ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructKrylovCommInfo)( A, my_id, num_procs ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructKrylovCopyVector( void *x, void *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructKrylovCopyVector)( x, y ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_StructKrylovCreateVector( void *vvector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructKrylovCreateVector)( vvector ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_StructKrylovCreateVectorArray( HYPRE_Int n, void *vvector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructKrylovCreateVectorArray)( n, vvector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructKrylovDestroyVector( void *vvector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructKrylovDestroyVector)( vvector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructKrylovFree( void *ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructKrylovFree)( ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructKrylovIdentity( void *vdata, void *A, void *b, void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructKrylovIdentity)( vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructKrylovIdentitySetup( void *vdata, void *A, void *b, void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructKrylovIdentitySetup)( vdata, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +hypre_StructKrylovInnerProd( void *x, void *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructKrylovInnerProd)( x, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructKrylovInnerProdTagged( void *x, void *y, HYPRE_Int *num_tags_ptr, HYPRE_Complex **iprod_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructKrylovInnerProdTagged)( x, y, num_tags_ptr, iprod_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructKrylovMatvec( void *matvec_data, HYPRE_Complex alpha, void *A, void *x, HYPRE_Complex beta, void *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructKrylovMatvec)( matvec_data, alpha, A, x, beta, y ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_StructKrylovMatvecCreate( void *A, void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructKrylovMatvecCreate)( A, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructKrylovMatvecDestroy( void *matvec_data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructKrylovMatvecDestroy)( matvec_data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructKrylovScaleVector( HYPRE_Complex alpha, void *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructKrylovScaleVector)( alpha, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructKrylovSetRandomValues( void *x, HYPRE_Int seed ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructKrylovSetRandomValues)( x, seed ); +} + + +#endif + diff --git a/src/struct_ls/mup_functions.c b/src/struct_ls/mup_functions.c new file mode 100644 index 0000000000..f650a1e4fa --- /dev/null +++ b/src/struct_ls/mup_functions.c @@ -0,0 +1,1612 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_struct_ls.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_StructBiCGSTABCreate( MPI_Comm comm, HYPRE_StructSolver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructBiCGSTABCreate_pre( precision, comm, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructBiCGSTABDestroy( HYPRE_StructSolver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructBiCGSTABDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructBiCGSTABGetFinalRelativeResidualNorm( HYPRE_StructSolver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructBiCGSTABGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructBiCGSTABGetNumIterations( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructBiCGSTABGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructBiCGSTABGetResidual( HYPRE_StructSolver solver, void **residual ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructBiCGSTABGetResidual_pre( precision, solver, residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructBiCGSTABSetAbsoluteTol( HYPRE_StructSolver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructBiCGSTABSetAbsoluteTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructBiCGSTABSetLogging( HYPRE_StructSolver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructBiCGSTABSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructBiCGSTABSetMaxIter( HYPRE_StructSolver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructBiCGSTABSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructBiCGSTABSetPrecond( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructBiCGSTABSetPrecond_pre( precision, solver, precond, precond_setup, precond_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructBiCGSTABSetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructBiCGSTABSetPrintLevel_pre( precision, solver, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructBiCGSTABSetTol( HYPRE_StructSolver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructBiCGSTABSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructBiCGSTABSetup( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructBiCGSTABSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructBiCGSTABSolve( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructBiCGSTABSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructCycRedCreate( MPI_Comm comm, HYPRE_StructSolver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructCycRedCreate_pre( precision, comm, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructCycRedDestroy( HYPRE_StructSolver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructCycRedDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructCycRedSetBase( HYPRE_StructSolver solver, HYPRE_Int ndim, HYPRE_Int *base_index, HYPRE_Int *base_stride ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructCycRedSetBase_pre( precision, solver, ndim, base_index, base_stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructCycRedSetTDim( HYPRE_StructSolver solver, HYPRE_Int tdim ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructCycRedSetTDim_pre( precision, solver, tdim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructCycRedSetup( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructCycRedSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructCycRedSolve( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructCycRedSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructDiagScale( HYPRE_StructSolver solver, HYPRE_StructMatrix HA, HYPRE_StructVector Hy, HYPRE_StructVector Hx ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructDiagScale_pre( precision, solver, HA, Hy, Hx ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructDiagScaleSetup( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector y, HYPRE_StructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructDiagScaleSetup_pre( precision, solver, A, y, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructFlexGMRESCreate( MPI_Comm comm, HYPRE_StructSolver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructFlexGMRESCreate_pre( precision, comm, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructFlexGMRESDestroy( HYPRE_StructSolver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructFlexGMRESDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructFlexGMRESGetFinalRelativeResidualNorm( HYPRE_StructSolver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructFlexGMRESGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructFlexGMRESGetNumIterations( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructFlexGMRESGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructFlexGMRESSetAbsoluteTol( HYPRE_StructSolver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructFlexGMRESSetAbsoluteTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructFlexGMRESSetKDim( HYPRE_StructSolver solver, HYPRE_Int k_dim ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructFlexGMRESSetKDim_pre( precision, solver, k_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructFlexGMRESSetLogging( HYPRE_StructSolver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructFlexGMRESSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructFlexGMRESSetMaxIter( HYPRE_StructSolver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructFlexGMRESSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructFlexGMRESSetModifyPC( HYPRE_StructSolver solver, HYPRE_PtrToModifyPCFcn modify_pc ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructFlexGMRESSetModifyPC_pre( precision, solver, modify_pc ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructFlexGMRESSetPrecond( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructFlexGMRESSetPrecond_pre( precision, solver, precond, precond_setup, precond_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructFlexGMRESSetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructFlexGMRESSetPrintLevel_pre( precision, solver, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructFlexGMRESSetTol( HYPRE_StructSolver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructFlexGMRESSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructFlexGMRESSetup( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructFlexGMRESSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructFlexGMRESSolve( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructFlexGMRESSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGMRESCreate( MPI_Comm comm, HYPRE_StructSolver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructGMRESCreate_pre( precision, comm, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGMRESDestroy( HYPRE_StructSolver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructGMRESDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGMRESGetFinalRelativeResidualNorm( HYPRE_StructSolver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructGMRESGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGMRESGetNumIterations( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructGMRESGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGMRESSetAbsoluteTol( HYPRE_StructSolver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructGMRESSetAbsoluteTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGMRESSetKDim( HYPRE_StructSolver solver, HYPRE_Int k_dim ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructGMRESSetKDim_pre( precision, solver, k_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGMRESSetLogging( HYPRE_StructSolver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructGMRESSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGMRESSetMaxIter( HYPRE_StructSolver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructGMRESSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGMRESSetPrecond( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructGMRESSetPrecond_pre( precision, solver, precond, precond_setup, precond_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGMRESSetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructGMRESSetPrintLevel_pre( precision, solver, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGMRESSetTol( HYPRE_StructSolver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructGMRESSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGMRESSetup( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructGMRESSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGMRESSolve( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructGMRESSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridCreate( MPI_Comm comm, HYPRE_StructSolver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructHybridCreate_pre( precision, comm, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridDestroy( HYPRE_StructSolver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructHybridDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridGetDSCGNumIterations( HYPRE_StructSolver solver, HYPRE_Int *ds_num_its ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructHybridGetDSCGNumIterations_pre( precision, solver, ds_num_its ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridGetFinalRelativeResidualNorm( HYPRE_StructSolver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructHybridGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridGetNumIterations( HYPRE_StructSolver solver, HYPRE_Int *num_its ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructHybridGetNumIterations_pre( precision, solver, num_its ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridGetPCGNumIterations( HYPRE_StructSolver solver, HYPRE_Int *pre_num_its ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructHybridGetPCGNumIterations_pre( precision, solver, pre_num_its ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridGetRecomputeResidual( HYPRE_StructSolver solver, HYPRE_Int *recompute_residual ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructHybridGetRecomputeResidual_pre( precision, solver, recompute_residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridGetRecomputeResidualP( HYPRE_StructSolver solver, HYPRE_Int *recompute_residual_p ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructHybridGetRecomputeResidualP_pre( precision, solver, recompute_residual_p ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetConvergenceTol( HYPRE_StructSolver solver, hypre_long_double cf_tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructHybridSetConvergenceTol_pre( precision, solver, cf_tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetDSCGMaxIter( HYPRE_StructSolver solver, HYPRE_Int ds_max_its ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructHybridSetDSCGMaxIter_pre( precision, solver, ds_max_its ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetKDim( HYPRE_StructSolver solver, HYPRE_Int k_dim ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructHybridSetKDim_pre( precision, solver, k_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetLogging( HYPRE_StructSolver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructHybridSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetPCGAbsoluteTolFactor( HYPRE_StructSolver solver, hypre_long_double pcg_atolf ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructHybridSetPCGAbsoluteTolFactor_pre( precision, solver, pcg_atolf ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetPCGMaxIter( HYPRE_StructSolver solver, HYPRE_Int pre_max_its ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructHybridSetPCGMaxIter_pre( precision, solver, pre_max_its ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetPrecond( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructHybridSetPrecond_pre( precision, solver, precond, precond_setup, precond_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int print_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructHybridSetPrintLevel_pre( precision, solver, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetRecomputeResidual( HYPRE_StructSolver solver, HYPRE_Int recompute_residual ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructHybridSetRecomputeResidual_pre( precision, solver, recompute_residual ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetRecomputeResidualP( HYPRE_StructSolver solver, HYPRE_Int recompute_residual_p ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructHybridSetRecomputeResidualP_pre( precision, solver, recompute_residual_p ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetRelChange( HYPRE_StructSolver solver, HYPRE_Int rel_change ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructHybridSetRelChange_pre( precision, solver, rel_change ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetSolverType( HYPRE_StructSolver solver, HYPRE_Int solver_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructHybridSetSolverType_pre( precision, solver, solver_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetStopCrit( HYPRE_StructSolver solver, HYPRE_Int stop_crit ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructHybridSetStopCrit_pre( precision, solver, stop_crit ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetTol( HYPRE_StructSolver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructHybridSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetTwoNorm( HYPRE_StructSolver solver, HYPRE_Int two_norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructHybridSetTwoNorm_pre( precision, solver, two_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetup( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructHybridSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSolve( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructHybridSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructJacobiCreate( MPI_Comm comm, HYPRE_StructSolver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructJacobiCreate_pre( precision, comm, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructJacobiDestroy( HYPRE_StructSolver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructJacobiDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructJacobiGetFinalRelativeResidualNorm( HYPRE_StructSolver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructJacobiGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructJacobiGetMaxIter( HYPRE_StructSolver solver, HYPRE_Int *max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructJacobiGetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructJacobiGetNumIterations( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructJacobiGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructJacobiGetTol( HYPRE_StructSolver solver, void *tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructJacobiGetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructJacobiGetZeroGuess( HYPRE_StructSolver solver, HYPRE_Int *zeroguess ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructJacobiGetZeroGuess_pre( precision, solver, zeroguess ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructJacobiSetMaxIter( HYPRE_StructSolver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructJacobiSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructJacobiSetNonZeroGuess( HYPRE_StructSolver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructJacobiSetNonZeroGuess_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructJacobiSetTol( HYPRE_StructSolver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructJacobiSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructJacobiSetZeroGuess( HYPRE_StructSolver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructJacobiSetZeroGuess_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructJacobiSetup( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructJacobiSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructJacobiSolve( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructJacobiSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructLGMRESCreate( MPI_Comm comm, HYPRE_StructSolver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructLGMRESCreate_pre( precision, comm, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructLGMRESDestroy( HYPRE_StructSolver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructLGMRESDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructLGMRESGetFinalRelativeResidualNorm( HYPRE_StructSolver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructLGMRESGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructLGMRESGetNumIterations( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructLGMRESGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructLGMRESSetAbsoluteTol( HYPRE_StructSolver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructLGMRESSetAbsoluteTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructLGMRESSetAugDim( HYPRE_StructSolver solver, HYPRE_Int aug_dim ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructLGMRESSetAugDim_pre( precision, solver, aug_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructLGMRESSetKDim( HYPRE_StructSolver solver, HYPRE_Int k_dim ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructLGMRESSetKDim_pre( precision, solver, k_dim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructLGMRESSetLogging( HYPRE_StructSolver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructLGMRESSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructLGMRESSetMaxIter( HYPRE_StructSolver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructLGMRESSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructLGMRESSetPrecond( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructLGMRESSetPrecond_pre( precision, solver, precond, precond_setup, precond_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructLGMRESSetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructLGMRESSetPrintLevel_pre( precision, solver, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructLGMRESSetTol( HYPRE_StructSolver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructLGMRESSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructLGMRESSetup( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructLGMRESSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructLGMRESSolve( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructLGMRESSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPCGCreate( MPI_Comm comm, HYPRE_StructSolver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPCGCreate_pre( precision, comm, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPCGDestroy( HYPRE_StructSolver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPCGDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPCGGetFinalRelativeResidualNorm( HYPRE_StructSolver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPCGGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPCGGetNumIterations( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPCGGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPCGSetAbsoluteTol( HYPRE_StructSolver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPCGSetAbsoluteTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPCGSetLogging( HYPRE_StructSolver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPCGSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPCGSetMaxIter( HYPRE_StructSolver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPCGSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPCGSetPrecond( HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPCGSetPrecond_pre( precision, solver, precond, precond_setup, precond_solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPCGSetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPCGSetPrintLevel_pre( precision, solver, level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPCGSetRelChange( HYPRE_StructSolver solver, HYPRE_Int rel_change ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPCGSetRelChange_pre( precision, solver, rel_change ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPCGSetTol( HYPRE_StructSolver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPCGSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPCGSetTwoNorm( HYPRE_StructSolver solver, HYPRE_Int two_norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPCGSetTwoNorm_pre( precision, solver, two_norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPCGSetup( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPCGSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPCGSolve( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPCGSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGCreate( MPI_Comm comm, HYPRE_StructSolver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGCreate_pre( precision, comm, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGDestroy( HYPRE_StructSolver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetFinalRelativeResidualNorm( HYPRE_StructSolver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetJacobiWeight( HYPRE_StructSolver solver, void *weight ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGGetJacobiWeight_pre( precision, solver, weight ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetLogging( HYPRE_StructSolver solver, HYPRE_Int *logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGGetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetMatmultType( HYPRE_StructSolver solver, HYPRE_Int *matmult_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGGetMatmultType_pre( precision, solver, matmult_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetMaxIter( HYPRE_StructSolver solver, HYPRE_Int *max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGGetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetMaxLevels( HYPRE_StructSolver solver, HYPRE_Int *max_levels ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGGetMaxLevels_pre( precision, solver, max_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetNumIterations( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetNumPostRelax( HYPRE_StructSolver solver, HYPRE_Int *num_post_relax ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGGetNumPostRelax_pre( precision, solver, num_post_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetNumPreRelax( HYPRE_StructSolver solver, HYPRE_Int *num_pre_relax ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGGetNumPreRelax_pre( precision, solver, num_pre_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int *print_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGGetPrintLevel_pre( precision, solver, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetRAPType( HYPRE_StructSolver solver, HYPRE_Int *rap_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGGetRAPType_pre( precision, solver, rap_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetRelChange( HYPRE_StructSolver solver, HYPRE_Int *rel_change ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGGetRelChange_pre( precision, solver, rel_change ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetRelaxType( HYPRE_StructSolver solver, HYPRE_Int *relax_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGGetRelaxType_pre( precision, solver, relax_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetSkipRelax( HYPRE_StructSolver solver, HYPRE_Int *skip_relax ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGGetSkipRelax_pre( precision, solver, skip_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetTol( HYPRE_StructSolver solver, void *tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGGetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetZeroGuess( HYPRE_StructSolver solver, HYPRE_Int *zeroguess ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGGetZeroGuess_pre( precision, solver, zeroguess ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetDxyz( HYPRE_StructSolver solver, void *dxyz ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGSetDxyz_pre( precision, solver, dxyz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetJacobiWeight( HYPRE_StructSolver solver, hypre_long_double weight ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGSetJacobiWeight_pre( precision, solver, weight ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetLogging( HYPRE_StructSolver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetMatmultType( HYPRE_StructSolver solver, HYPRE_Int matmult_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGSetMatmultType_pre( precision, solver, matmult_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetMaxIter( HYPRE_StructSolver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetMaxLevels( HYPRE_StructSolver solver, HYPRE_Int max_levels ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGSetMaxLevels_pre( precision, solver, max_levels ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetNonZeroGuess( HYPRE_StructSolver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGSetNonZeroGuess_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetNumPostRelax( HYPRE_StructSolver solver, HYPRE_Int num_post_relax ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGSetNumPostRelax_pre( precision, solver, num_post_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetNumPreRelax( HYPRE_StructSolver solver, HYPRE_Int num_pre_relax ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGSetNumPreRelax_pre( precision, solver, num_pre_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int print_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGSetPrintLevel_pre( precision, solver, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetRAPType( HYPRE_StructSolver solver, HYPRE_Int rap_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGSetRAPType_pre( precision, solver, rap_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetRelChange( HYPRE_StructSolver solver, HYPRE_Int rel_change ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGSetRelChange_pre( precision, solver, rel_change ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetRelaxType( HYPRE_StructSolver solver, HYPRE_Int relax_type ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGSetRelaxType_pre( precision, solver, relax_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetSkipRelax( HYPRE_StructSolver solver, HYPRE_Int skip_relax ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGSetSkipRelax_pre( precision, solver, skip_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetTol( HYPRE_StructSolver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetZeroGuess( HYPRE_StructSolver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGSetZeroGuess_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetup( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSolve( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructPFMGSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGCreate( MPI_Comm comm, HYPRE_StructSolver *solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructSMGCreate_pre( precision, comm, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGDestroy( HYPRE_StructSolver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructSMGDestroy_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGGetFinalRelativeResidualNorm( HYPRE_StructSolver solver, void *norm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructSMGGetFinalRelativeResidualNorm_pre( precision, solver, norm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGGetLogging( HYPRE_StructSolver solver, HYPRE_Int *logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructSMGGetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGGetMaxIter( HYPRE_StructSolver solver, HYPRE_Int *max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructSMGGetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGGetMemoryUse( HYPRE_StructSolver solver, HYPRE_Int *memory_use ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructSMGGetMemoryUse_pre( precision, solver, memory_use ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGGetNumIterations( HYPRE_StructSolver solver, HYPRE_Int *num_iterations ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructSMGGetNumIterations_pre( precision, solver, num_iterations ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGGetNumPostRelax( HYPRE_StructSolver solver, HYPRE_Int *num_post_relax ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructSMGGetNumPostRelax_pre( precision, solver, num_post_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGGetNumPreRelax( HYPRE_StructSolver solver, HYPRE_Int *num_pre_relax ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructSMGGetNumPreRelax_pre( precision, solver, num_pre_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGGetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int *print_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructSMGGetPrintLevel_pre( precision, solver, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGGetRelChange( HYPRE_StructSolver solver, HYPRE_Int *rel_change ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructSMGGetRelChange_pre( precision, solver, rel_change ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGGetTol( HYPRE_StructSolver solver, void *tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructSMGGetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGGetZeroGuess( HYPRE_StructSolver solver, HYPRE_Int *zeroguess ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructSMGGetZeroGuess_pre( precision, solver, zeroguess ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGSetLogging( HYPRE_StructSolver solver, HYPRE_Int logging ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructSMGSetLogging_pre( precision, solver, logging ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGSetMaxIter( HYPRE_StructSolver solver, HYPRE_Int max_iter ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructSMGSetMaxIter_pre( precision, solver, max_iter ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGSetMemoryUse( HYPRE_StructSolver solver, HYPRE_Int memory_use ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructSMGSetMemoryUse_pre( precision, solver, memory_use ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGSetNonZeroGuess( HYPRE_StructSolver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructSMGSetNonZeroGuess_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGSetNumPostRelax( HYPRE_StructSolver solver, HYPRE_Int num_post_relax ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructSMGSetNumPostRelax_pre( precision, solver, num_post_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGSetNumPreRelax( HYPRE_StructSolver solver, HYPRE_Int num_pre_relax ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructSMGSetNumPreRelax_pre( precision, solver, num_pre_relax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGSetPrintLevel( HYPRE_StructSolver solver, HYPRE_Int print_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructSMGSetPrintLevel_pre( precision, solver, print_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGSetRelChange( HYPRE_StructSolver solver, HYPRE_Int rel_change ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructSMGSetRelChange_pre( precision, solver, rel_change ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGSetTol( HYPRE_StructSolver solver, hypre_long_double tol ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructSMGSetTol_pre( precision, solver, tol ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGSetZeroGuess( HYPRE_StructSolver solver ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructSMGSetZeroGuess_pre( precision, solver ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGSetup( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructSMGSetup_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGSolve( HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructSMGSolve_pre( precision, solver, A, b, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSetupInterpreter( mv_InterfaceInterpreter *i ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructSetupInterpreter_pre( precision, i ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSetupMatvec( HYPRE_MatvecFunctions *mv ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructSetupMatvec_pre( precision, mv ); +} + + + +#endif + diff --git a/src/struct_ls/mup_pre.c b/src/struct_ls/mup_pre.c new file mode 100644 index 0000000000..811558ef22 --- /dev/null +++ b/src/struct_ls/mup_pre.c @@ -0,0 +1,3205 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_struct_ls.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_StructBiCGSTABCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_StructSolver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructBiCGSTABCreate_flt( comm, solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructBiCGSTABCreate_dbl( comm, solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructBiCGSTABCreate_long_dbl( comm, solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructBiCGSTABDestroy_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructBiCGSTABDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructBiCGSTABDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructBiCGSTABDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructBiCGSTABGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructBiCGSTABGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructBiCGSTABGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructBiCGSTABGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructBiCGSTABGetNumIterations_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructBiCGSTABGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructBiCGSTABGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructBiCGSTABGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructBiCGSTABGetResidual_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, void **residual ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructBiCGSTABGetResidual_flt( solver, residual ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructBiCGSTABGetResidual_dbl( solver, residual ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructBiCGSTABGetResidual_long_dbl( solver, residual ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructBiCGSTABSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructBiCGSTABSetAbsoluteTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructBiCGSTABSetAbsoluteTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructBiCGSTABSetAbsoluteTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructBiCGSTABSetLogging_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructBiCGSTABSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructBiCGSTABSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructBiCGSTABSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructBiCGSTABSetMaxIter_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructBiCGSTABSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructBiCGSTABSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructBiCGSTABSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructBiCGSTABSetPrecond_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructBiCGSTABSetPrecond_flt( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructBiCGSTABSetPrecond_dbl( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructBiCGSTABSetPrecond_long_dbl( solver, precond, precond_setup, precond_solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructBiCGSTABSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructBiCGSTABSetPrintLevel_flt( solver, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructBiCGSTABSetPrintLevel_dbl( solver, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructBiCGSTABSetPrintLevel_long_dbl( solver, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructBiCGSTABSetTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructBiCGSTABSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructBiCGSTABSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructBiCGSTABSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructBiCGSTABSetup_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructBiCGSTABSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructBiCGSTABSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructBiCGSTABSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructBiCGSTABSolve_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructBiCGSTABSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructBiCGSTABSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructBiCGSTABSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructCycRedCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_StructSolver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructCycRedCreate_flt( comm, solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructCycRedCreate_dbl( comm, solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructCycRedCreate_long_dbl( comm, solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructCycRedDestroy_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructCycRedDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructCycRedDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructCycRedDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructCycRedSetBase_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int ndim, HYPRE_Int *base_index, HYPRE_Int *base_stride ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructCycRedSetBase_flt( solver, ndim, base_index, base_stride ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructCycRedSetBase_dbl( solver, ndim, base_index, base_stride ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructCycRedSetBase_long_dbl( solver, ndim, base_index, base_stride ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructCycRedSetTDim_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int tdim ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructCycRedSetTDim_flt( solver, tdim ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructCycRedSetTDim_dbl( solver, tdim ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructCycRedSetTDim_long_dbl( solver, tdim ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructCycRedSetup_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructCycRedSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructCycRedSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructCycRedSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructCycRedSolve_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructCycRedSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructCycRedSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructCycRedSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructDiagScale_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix HA, HYPRE_StructVector Hy, HYPRE_StructVector Hx ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructDiagScale_flt( solver, HA, Hy, Hx ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructDiagScale_dbl( solver, HA, Hy, Hx ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructDiagScale_long_dbl( solver, HA, Hy, Hx ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructDiagScaleSetup_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector y, HYPRE_StructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructDiagScaleSetup_flt( solver, A, y, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructDiagScaleSetup_dbl( solver, A, y, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructDiagScaleSetup_long_dbl( solver, A, y, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructFlexGMRESCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_StructSolver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructFlexGMRESCreate_flt( comm, solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructFlexGMRESCreate_dbl( comm, solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructFlexGMRESCreate_long_dbl( comm, solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructFlexGMRESDestroy_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructFlexGMRESDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructFlexGMRESDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructFlexGMRESDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructFlexGMRESGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructFlexGMRESGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructFlexGMRESGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructFlexGMRESGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructFlexGMRESGetNumIterations_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructFlexGMRESGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructFlexGMRESGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructFlexGMRESGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructFlexGMRESSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructFlexGMRESSetAbsoluteTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructFlexGMRESSetAbsoluteTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructFlexGMRESSetAbsoluteTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructFlexGMRESSetKDim_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int k_dim ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructFlexGMRESSetKDim_flt( solver, k_dim ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructFlexGMRESSetKDim_dbl( solver, k_dim ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructFlexGMRESSetKDim_long_dbl( solver, k_dim ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructFlexGMRESSetLogging_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructFlexGMRESSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructFlexGMRESSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructFlexGMRESSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructFlexGMRESSetMaxIter_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructFlexGMRESSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructFlexGMRESSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructFlexGMRESSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructFlexGMRESSetModifyPC_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_PtrToModifyPCFcn modify_pc ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructFlexGMRESSetModifyPC_flt( solver, modify_pc ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructFlexGMRESSetModifyPC_dbl( solver, modify_pc ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructFlexGMRESSetModifyPC_long_dbl( solver, modify_pc ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructFlexGMRESSetPrecond_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructFlexGMRESSetPrecond_flt( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructFlexGMRESSetPrecond_dbl( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructFlexGMRESSetPrecond_long_dbl( solver, precond, precond_setup, precond_solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructFlexGMRESSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructFlexGMRESSetPrintLevel_flt( solver, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructFlexGMRESSetPrintLevel_dbl( solver, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructFlexGMRESSetPrintLevel_long_dbl( solver, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructFlexGMRESSetTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructFlexGMRESSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructFlexGMRESSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructFlexGMRESSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructFlexGMRESSetup_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructFlexGMRESSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructFlexGMRESSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructFlexGMRESSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructFlexGMRESSolve_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructFlexGMRESSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructFlexGMRESSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructFlexGMRESSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGMRESCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_StructSolver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructGMRESCreate_flt( comm, solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructGMRESCreate_dbl( comm, solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructGMRESCreate_long_dbl( comm, solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGMRESDestroy_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructGMRESDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructGMRESDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructGMRESDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGMRESGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructGMRESGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructGMRESGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructGMRESGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGMRESGetNumIterations_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructGMRESGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructGMRESGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructGMRESGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGMRESSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructGMRESSetAbsoluteTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructGMRESSetAbsoluteTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructGMRESSetAbsoluteTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGMRESSetKDim_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int k_dim ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructGMRESSetKDim_flt( solver, k_dim ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructGMRESSetKDim_dbl( solver, k_dim ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructGMRESSetKDim_long_dbl( solver, k_dim ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGMRESSetLogging_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructGMRESSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructGMRESSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructGMRESSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGMRESSetMaxIter_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructGMRESSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructGMRESSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructGMRESSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGMRESSetPrecond_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructGMRESSetPrecond_flt( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructGMRESSetPrecond_dbl( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructGMRESSetPrecond_long_dbl( solver, precond, precond_setup, precond_solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGMRESSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructGMRESSetPrintLevel_flt( solver, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructGMRESSetPrintLevel_dbl( solver, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructGMRESSetPrintLevel_long_dbl( solver, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGMRESSetTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructGMRESSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructGMRESSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructGMRESSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGMRESSetup_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructGMRESSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructGMRESSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructGMRESSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGMRESSolve_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructGMRESSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructGMRESSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructGMRESSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_StructSolver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructHybridCreate_flt( comm, solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructHybridCreate_dbl( comm, solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructHybridCreate_long_dbl( comm, solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridDestroy_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructHybridDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructHybridDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructHybridDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridGetDSCGNumIterations_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *ds_num_its ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructHybridGetDSCGNumIterations_flt( solver, ds_num_its ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructHybridGetDSCGNumIterations_dbl( solver, ds_num_its ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructHybridGetDSCGNumIterations_long_dbl( solver, ds_num_its ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructHybridGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructHybridGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructHybridGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridGetNumIterations_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *num_its ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructHybridGetNumIterations_flt( solver, num_its ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructHybridGetNumIterations_dbl( solver, num_its ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructHybridGetNumIterations_long_dbl( solver, num_its ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridGetPCGNumIterations_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *pre_num_its ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructHybridGetPCGNumIterations_flt( solver, pre_num_its ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructHybridGetPCGNumIterations_dbl( solver, pre_num_its ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructHybridGetPCGNumIterations_long_dbl( solver, pre_num_its ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridGetRecomputeResidual_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *recompute_residual ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructHybridGetRecomputeResidual_flt( solver, recompute_residual ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructHybridGetRecomputeResidual_dbl( solver, recompute_residual ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructHybridGetRecomputeResidual_long_dbl( solver, recompute_residual ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridGetRecomputeResidualP_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *recompute_residual_p ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructHybridGetRecomputeResidualP_flt( solver, recompute_residual_p ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructHybridGetRecomputeResidualP_dbl( solver, recompute_residual_p ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructHybridGetRecomputeResidualP_long_dbl( solver, recompute_residual_p ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetConvergenceTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double cf_tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructHybridSetConvergenceTol_flt( solver, cf_tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructHybridSetConvergenceTol_dbl( solver, cf_tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructHybridSetConvergenceTol_long_dbl( solver, cf_tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetDSCGMaxIter_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int ds_max_its ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructHybridSetDSCGMaxIter_flt( solver, ds_max_its ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructHybridSetDSCGMaxIter_dbl( solver, ds_max_its ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructHybridSetDSCGMaxIter_long_dbl( solver, ds_max_its ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetKDim_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int k_dim ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructHybridSetKDim_flt( solver, k_dim ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructHybridSetKDim_dbl( solver, k_dim ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructHybridSetKDim_long_dbl( solver, k_dim ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetLogging_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructHybridSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructHybridSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructHybridSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetPCGAbsoluteTolFactor_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double pcg_atolf ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructHybridSetPCGAbsoluteTolFactor_flt( solver, pcg_atolf ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructHybridSetPCGAbsoluteTolFactor_dbl( solver, pcg_atolf ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructHybridSetPCGAbsoluteTolFactor_long_dbl( solver, pcg_atolf ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetPCGMaxIter_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int pre_max_its ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructHybridSetPCGMaxIter_flt( solver, pre_max_its ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructHybridSetPCGMaxIter_dbl( solver, pre_max_its ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructHybridSetPCGMaxIter_long_dbl( solver, pre_max_its ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetPrecond_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructHybridSetPrecond_flt( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructHybridSetPrecond_dbl( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructHybridSetPrecond_long_dbl( solver, precond, precond_setup, precond_solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int print_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructHybridSetPrintLevel_flt( solver, print_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructHybridSetPrintLevel_dbl( solver, print_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructHybridSetPrintLevel_long_dbl( solver, print_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetRecomputeResidual_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int recompute_residual ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructHybridSetRecomputeResidual_flt( solver, recompute_residual ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructHybridSetRecomputeResidual_dbl( solver, recompute_residual ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructHybridSetRecomputeResidual_long_dbl( solver, recompute_residual ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetRecomputeResidualP_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int recompute_residual_p ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructHybridSetRecomputeResidualP_flt( solver, recompute_residual_p ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructHybridSetRecomputeResidualP_dbl( solver, recompute_residual_p ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructHybridSetRecomputeResidualP_long_dbl( solver, recompute_residual_p ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetRelChange_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int rel_change ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructHybridSetRelChange_flt( solver, rel_change ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructHybridSetRelChange_dbl( solver, rel_change ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructHybridSetRelChange_long_dbl( solver, rel_change ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetSolverType_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int solver_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructHybridSetSolverType_flt( solver, solver_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructHybridSetSolverType_dbl( solver, solver_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructHybridSetSolverType_long_dbl( solver, solver_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetStopCrit_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int stop_crit ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructHybridSetStopCrit_flt( solver, stop_crit ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructHybridSetStopCrit_dbl( solver, stop_crit ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructHybridSetStopCrit_long_dbl( solver, stop_crit ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructHybridSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructHybridSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructHybridSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetTwoNorm_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int two_norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructHybridSetTwoNorm_flt( solver, two_norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructHybridSetTwoNorm_dbl( solver, two_norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructHybridSetTwoNorm_long_dbl( solver, two_norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSetup_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructHybridSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructHybridSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructHybridSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructHybridSolve_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructHybridSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructHybridSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructHybridSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructJacobiCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_StructSolver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructJacobiCreate_flt( comm, solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructJacobiCreate_dbl( comm, solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructJacobiCreate_long_dbl( comm, solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructJacobiDestroy_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructJacobiDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructJacobiDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructJacobiDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructJacobiGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructJacobiGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructJacobiGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructJacobiGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructJacobiGetMaxIter_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructJacobiGetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructJacobiGetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructJacobiGetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructJacobiGetNumIterations_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructJacobiGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructJacobiGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructJacobiGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructJacobiGetTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, void *tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructJacobiGetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructJacobiGetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructJacobiGetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructJacobiGetZeroGuess_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *zeroguess ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructJacobiGetZeroGuess_flt( solver, zeroguess ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructJacobiGetZeroGuess_dbl( solver, zeroguess ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructJacobiGetZeroGuess_long_dbl( solver, zeroguess ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructJacobiSetMaxIter_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructJacobiSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructJacobiSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructJacobiSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructJacobiSetNonZeroGuess_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructJacobiSetNonZeroGuess_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructJacobiSetNonZeroGuess_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructJacobiSetNonZeroGuess_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructJacobiSetTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructJacobiSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructJacobiSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructJacobiSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructJacobiSetZeroGuess_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructJacobiSetZeroGuess_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructJacobiSetZeroGuess_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructJacobiSetZeroGuess_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructJacobiSetup_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructJacobiSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructJacobiSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructJacobiSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructJacobiSolve_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructJacobiSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructJacobiSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructJacobiSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructLGMRESCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_StructSolver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructLGMRESCreate_flt( comm, solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructLGMRESCreate_dbl( comm, solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructLGMRESCreate_long_dbl( comm, solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructLGMRESDestroy_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructLGMRESDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructLGMRESDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructLGMRESDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructLGMRESGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructLGMRESGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructLGMRESGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructLGMRESGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructLGMRESGetNumIterations_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructLGMRESGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructLGMRESGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructLGMRESGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructLGMRESSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructLGMRESSetAbsoluteTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructLGMRESSetAbsoluteTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructLGMRESSetAbsoluteTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructLGMRESSetAugDim_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int aug_dim ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructLGMRESSetAugDim_flt( solver, aug_dim ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructLGMRESSetAugDim_dbl( solver, aug_dim ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructLGMRESSetAugDim_long_dbl( solver, aug_dim ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructLGMRESSetKDim_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int k_dim ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructLGMRESSetKDim_flt( solver, k_dim ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructLGMRESSetKDim_dbl( solver, k_dim ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructLGMRESSetKDim_long_dbl( solver, k_dim ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructLGMRESSetLogging_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructLGMRESSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructLGMRESSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructLGMRESSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructLGMRESSetMaxIter_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructLGMRESSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructLGMRESSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructLGMRESSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructLGMRESSetPrecond_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructLGMRESSetPrecond_flt( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructLGMRESSetPrecond_dbl( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructLGMRESSetPrecond_long_dbl( solver, precond, precond_setup, precond_solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructLGMRESSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructLGMRESSetPrintLevel_flt( solver, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructLGMRESSetPrintLevel_dbl( solver, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructLGMRESSetPrintLevel_long_dbl( solver, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructLGMRESSetTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructLGMRESSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructLGMRESSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructLGMRESSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructLGMRESSetup_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructLGMRESSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructLGMRESSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructLGMRESSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructLGMRESSolve_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructLGMRESSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructLGMRESSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructLGMRESSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPCGCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_StructSolver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPCGCreate_flt( comm, solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPCGCreate_dbl( comm, solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPCGCreate_long_dbl( comm, solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPCGDestroy_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPCGDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPCGDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPCGDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPCGGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPCGGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPCGGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPCGGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPCGGetNumIterations_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPCGGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPCGGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPCGGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPCGSetAbsoluteTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPCGSetAbsoluteTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPCGSetAbsoluteTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPCGSetAbsoluteTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPCGSetLogging_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPCGSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPCGSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPCGSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPCGSetMaxIter_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPCGSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPCGSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPCGSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPCGSetPrecond_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_PtrToStructSolverFcn precond, HYPRE_PtrToStructSolverFcn precond_setup, HYPRE_StructSolver precond_solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPCGSetPrecond_flt( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPCGSetPrecond_dbl( solver, precond, precond_setup, precond_solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPCGSetPrecond_long_dbl( solver, precond, precond_setup, precond_solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPCGSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPCGSetPrintLevel_flt( solver, level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPCGSetPrintLevel_dbl( solver, level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPCGSetPrintLevel_long_dbl( solver, level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPCGSetRelChange_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int rel_change ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPCGSetRelChange_flt( solver, rel_change ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPCGSetRelChange_dbl( solver, rel_change ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPCGSetRelChange_long_dbl( solver, rel_change ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPCGSetTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPCGSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPCGSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPCGSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPCGSetTwoNorm_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int two_norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPCGSetTwoNorm_flt( solver, two_norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPCGSetTwoNorm_dbl( solver, two_norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPCGSetTwoNorm_long_dbl( solver, two_norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPCGSetup_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPCGSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPCGSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPCGSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPCGSolve_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPCGSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPCGSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPCGSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_StructSolver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGCreate_flt( comm, solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGCreate_dbl( comm, solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGCreate_long_dbl( comm, solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGDestroy_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetJacobiWeight_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, void *weight ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGGetJacobiWeight_flt( solver, weight ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGGetJacobiWeight_dbl( solver, weight ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGGetJacobiWeight_long_dbl( solver, weight ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetLogging_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGGetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGGetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGGetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetMatmultType_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *matmult_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGGetMatmultType_flt( solver, matmult_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGGetMatmultType_dbl( solver, matmult_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGGetMatmultType_long_dbl( solver, matmult_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetMaxIter_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGGetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGGetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGGetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetMaxLevels_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *max_levels ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGGetMaxLevels_flt( solver, max_levels ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGGetMaxLevels_dbl( solver, max_levels ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGGetMaxLevels_long_dbl( solver, max_levels ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetNumIterations_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetNumPostRelax_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *num_post_relax ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGGetNumPostRelax_flt( solver, num_post_relax ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGGetNumPostRelax_dbl( solver, num_post_relax ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGGetNumPostRelax_long_dbl( solver, num_post_relax ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetNumPreRelax_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *num_pre_relax ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGGetNumPreRelax_flt( solver, num_pre_relax ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGGetNumPreRelax_dbl( solver, num_pre_relax ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGGetNumPreRelax_long_dbl( solver, num_pre_relax ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetPrintLevel_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *print_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGGetPrintLevel_flt( solver, print_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGGetPrintLevel_dbl( solver, print_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGGetPrintLevel_long_dbl( solver, print_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetRAPType_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *rap_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGGetRAPType_flt( solver, rap_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGGetRAPType_dbl( solver, rap_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGGetRAPType_long_dbl( solver, rap_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetRelChange_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *rel_change ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGGetRelChange_flt( solver, rel_change ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGGetRelChange_dbl( solver, rel_change ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGGetRelChange_long_dbl( solver, rel_change ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetRelaxType_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *relax_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGGetRelaxType_flt( solver, relax_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGGetRelaxType_dbl( solver, relax_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGGetRelaxType_long_dbl( solver, relax_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetSkipRelax_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *skip_relax ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGGetSkipRelax_flt( solver, skip_relax ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGGetSkipRelax_dbl( solver, skip_relax ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGGetSkipRelax_long_dbl( solver, skip_relax ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, void *tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGGetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGGetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGGetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGGetZeroGuess_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *zeroguess ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGGetZeroGuess_flt( solver, zeroguess ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGGetZeroGuess_dbl( solver, zeroguess ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGGetZeroGuess_long_dbl( solver, zeroguess ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetDxyz_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, void *dxyz ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGSetDxyz_flt( solver, dxyz ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGSetDxyz_dbl( solver, dxyz ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGSetDxyz_long_dbl( solver, dxyz ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetJacobiWeight_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double weight ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGSetJacobiWeight_flt( solver, weight ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGSetJacobiWeight_dbl( solver, weight ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGSetJacobiWeight_long_dbl( solver, weight ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetLogging_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetMatmultType_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int matmult_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGSetMatmultType_flt( solver, matmult_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGSetMatmultType_dbl( solver, matmult_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGSetMatmultType_long_dbl( solver, matmult_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetMaxIter_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetMaxLevels_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int max_levels ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGSetMaxLevels_flt( solver, max_levels ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGSetMaxLevels_dbl( solver, max_levels ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGSetMaxLevels_long_dbl( solver, max_levels ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetNonZeroGuess_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGSetNonZeroGuess_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGSetNonZeroGuess_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGSetNonZeroGuess_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetNumPostRelax_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int num_post_relax ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGSetNumPostRelax_flt( solver, num_post_relax ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGSetNumPostRelax_dbl( solver, num_post_relax ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGSetNumPostRelax_long_dbl( solver, num_post_relax ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetNumPreRelax_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int num_pre_relax ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGSetNumPreRelax_flt( solver, num_pre_relax ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGSetNumPreRelax_dbl( solver, num_pre_relax ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGSetNumPreRelax_long_dbl( solver, num_pre_relax ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int print_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGSetPrintLevel_flt( solver, print_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGSetPrintLevel_dbl( solver, print_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGSetPrintLevel_long_dbl( solver, print_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetRAPType_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int rap_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGSetRAPType_flt( solver, rap_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGSetRAPType_dbl( solver, rap_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGSetRAPType_long_dbl( solver, rap_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetRelChange_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int rel_change ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGSetRelChange_flt( solver, rel_change ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGSetRelChange_dbl( solver, rel_change ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGSetRelChange_long_dbl( solver, rel_change ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetRelaxType_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int relax_type ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGSetRelaxType_flt( solver, relax_type ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGSetRelaxType_dbl( solver, relax_type ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGSetRelaxType_long_dbl( solver, relax_type ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetSkipRelax_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int skip_relax ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGSetSkipRelax_flt( solver, skip_relax ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGSetSkipRelax_dbl( solver, skip_relax ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGSetSkipRelax_long_dbl( solver, skip_relax ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetZeroGuess_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGSetZeroGuess_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGSetZeroGuess_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGSetZeroGuess_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSetup_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructPFMGSolve_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructPFMGSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructPFMGSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructPFMGSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_StructSolver *solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructSMGCreate_flt( comm, solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructSMGCreate_dbl( comm, solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructSMGCreate_long_dbl( comm, solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGDestroy_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructSMGDestroy_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructSMGDestroy_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructSMGDestroy_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGGetFinalRelativeResidualNorm_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, void *norm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructSMGGetFinalRelativeResidualNorm_flt( solver, norm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructSMGGetFinalRelativeResidualNorm_dbl( solver, norm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructSMGGetFinalRelativeResidualNorm_long_dbl( solver, norm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGGetLogging_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructSMGGetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructSMGGetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructSMGGetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGGetMaxIter_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructSMGGetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructSMGGetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructSMGGetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGGetMemoryUse_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *memory_use ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructSMGGetMemoryUse_flt( solver, memory_use ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructSMGGetMemoryUse_dbl( solver, memory_use ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructSMGGetMemoryUse_long_dbl( solver, memory_use ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGGetNumIterations_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *num_iterations ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructSMGGetNumIterations_flt( solver, num_iterations ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructSMGGetNumIterations_dbl( solver, num_iterations ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructSMGGetNumIterations_long_dbl( solver, num_iterations ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGGetNumPostRelax_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *num_post_relax ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructSMGGetNumPostRelax_flt( solver, num_post_relax ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructSMGGetNumPostRelax_dbl( solver, num_post_relax ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructSMGGetNumPostRelax_long_dbl( solver, num_post_relax ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGGetNumPreRelax_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *num_pre_relax ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructSMGGetNumPreRelax_flt( solver, num_pre_relax ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructSMGGetNumPreRelax_dbl( solver, num_pre_relax ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructSMGGetNumPreRelax_long_dbl( solver, num_pre_relax ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGGetPrintLevel_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *print_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructSMGGetPrintLevel_flt( solver, print_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructSMGGetPrintLevel_dbl( solver, print_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructSMGGetPrintLevel_long_dbl( solver, print_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGGetRelChange_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *rel_change ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructSMGGetRelChange_flt( solver, rel_change ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructSMGGetRelChange_dbl( solver, rel_change ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructSMGGetRelChange_long_dbl( solver, rel_change ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGGetTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, void *tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructSMGGetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructSMGGetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructSMGGetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGGetZeroGuess_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int *zeroguess ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructSMGGetZeroGuess_flt( solver, zeroguess ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructSMGGetZeroGuess_dbl( solver, zeroguess ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructSMGGetZeroGuess_long_dbl( solver, zeroguess ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGSetLogging_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int logging ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructSMGSetLogging_flt( solver, logging ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructSMGSetLogging_dbl( solver, logging ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructSMGSetLogging_long_dbl( solver, logging ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGSetMaxIter_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int max_iter ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructSMGSetMaxIter_flt( solver, max_iter ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructSMGSetMaxIter_dbl( solver, max_iter ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructSMGSetMaxIter_long_dbl( solver, max_iter ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGSetMemoryUse_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int memory_use ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructSMGSetMemoryUse_flt( solver, memory_use ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructSMGSetMemoryUse_dbl( solver, memory_use ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructSMGSetMemoryUse_long_dbl( solver, memory_use ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGSetNonZeroGuess_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructSMGSetNonZeroGuess_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructSMGSetNonZeroGuess_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructSMGSetNonZeroGuess_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGSetNumPostRelax_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int num_post_relax ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructSMGSetNumPostRelax_flt( solver, num_post_relax ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructSMGSetNumPostRelax_dbl( solver, num_post_relax ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructSMGSetNumPostRelax_long_dbl( solver, num_post_relax ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGSetNumPreRelax_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int num_pre_relax ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructSMGSetNumPreRelax_flt( solver, num_pre_relax ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructSMGSetNumPreRelax_dbl( solver, num_pre_relax ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructSMGSetNumPreRelax_long_dbl( solver, num_pre_relax ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGSetPrintLevel_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int print_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructSMGSetPrintLevel_flt( solver, print_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructSMGSetPrintLevel_dbl( solver, print_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructSMGSetPrintLevel_long_dbl( solver, print_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGSetRelChange_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_Int rel_change ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructSMGSetRelChange_flt( solver, rel_change ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructSMGSetRelChange_dbl( solver, rel_change ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructSMGSetRelChange_long_dbl( solver, rel_change ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGSetTol_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, hypre_long_double tol ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructSMGSetTol_flt( solver, tol ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructSMGSetTol_dbl( solver, tol ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructSMGSetTol_long_dbl( solver, tol ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGSetZeroGuess_pre( HYPRE_Precision precision, HYPRE_StructSolver solver ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructSMGSetZeroGuess_flt( solver ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructSMGSetZeroGuess_dbl( solver ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructSMGSetZeroGuess_long_dbl( solver ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGSetup_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructSMGSetup_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructSMGSetup_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructSMGSetup_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSMGSolve_pre( HYPRE_Precision precision, HYPRE_StructSolver solver, HYPRE_StructMatrix A, HYPRE_StructVector b, HYPRE_StructVector x ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructSMGSolve_flt( solver, A, b, x ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructSMGSolve_dbl( solver, A, b, x ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructSMGSolve_long_dbl( solver, A, b, x ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSetupInterpreter_pre( HYPRE_Precision precision, mv_InterfaceInterpreter *i ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructSetupInterpreter_flt( i ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructSetupInterpreter_dbl( i ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructSetupInterpreter_long_dbl( i ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructSetupMatvec_pre( HYPRE_Precision precision, HYPRE_MatvecFunctions *mv ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructSetupMatvec_flt( mv ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructSetupMatvec_dbl( mv ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructSetupMatvec_long_dbl( mv ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + + + +#endif + diff --git a/src/struct_ls/pcg_struct.c b/src/struct_ls/pcg_struct.c index 20e26c7fb8..3f5c49ecb1 100644 --- a/src/struct_ls/pcg_struct.c +++ b/src/struct_ls/pcg_struct.c @@ -7,6 +7,9 @@ #include "_hypre_struct_ls.h" +/* TODO (VPM): should this file be renamed? + These routines are also used by other Krylov methods */ + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -42,7 +45,7 @@ hypre_StructKrylovCreateVector( void *vvector ) new_vector = hypre_StructVectorCreate( hypre_StructVectorComm(vector), hypre_StructVectorGrid(vector) ); hypre_StructVectorSetNumGhost(new_vector, num_ghost); - hypre_StructVectorInitialize(new_vector); + hypre_StructVectorInitialize(new_vector, 1); hypre_StructVectorAssemble(new_vector); return ( (void *) new_vector ); @@ -66,8 +69,8 @@ hypre_StructKrylovCreateVectorArray(HYPRE_Int n, void *vvector ) hypre_StructVectorGrid(vector), (HYPRE_StructVector *) &new_vector[i] ); hypre_StructVectorSetNumGhost(new_vector[i], num_ghost); - HYPRE_StructVectorInitialize((HYPRE_StructVector) new_vector[i]); - HYPRE_StructVectorAssemble((HYPRE_StructVector) new_vector[i]); + hypre_StructVectorInitialize(new_vector[i], 1); + hypre_StructVectorAssemble(new_vector[i]); } return ( (void *) new_vector ); @@ -115,6 +118,7 @@ hypre_StructKrylovMatvec( void *matvec_data, (hypre_StructMatrix *) A, (hypre_StructVector *) x, beta, + (hypre_StructVector *) y, (hypre_StructVector *) y ) ); } @@ -183,6 +187,17 @@ hypre_StructKrylovClearVector( void *x ) 0.0 ) ); } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructKrylovSetRandomValues( void *x, + HYPRE_Int seed ) +{ + return ( hypre_StructVectorSetRandomValues( (hypre_StructVector *) x, + seed ) ); +} + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -201,8 +216,13 @@ hypre_StructKrylovAxpy( HYPRE_Complex alpha, void *x, void *y ) { - return ( hypre_StructAxpy( alpha, (hypre_StructVector *) x, - (hypre_StructVector *) y ) ); + HYPRE_Complex beta = 1.0; + + return ( hypre_StructVectorAxpy( alpha, + (hypre_StructVector *) x, + beta, + (hypre_StructVector *) y, + (hypre_StructVector *) y ) ); } /*-------------------------------------------------------------------------- diff --git a/src/struct_ls/pfmg.c b/src/struct_ls/pfmg.c index ce91045f59..1edcba4602 100644 --- a/src/struct_ls/pfmg.c +++ b/src/struct_ls/pfmg.c @@ -16,7 +16,7 @@ hypre_PFMGCreate( MPI_Comm comm ) { hypre_PFMGData *pfmg_data; - pfmg_data = hypre_CTAlloc(hypre_PFMGData, 1, HYPRE_MEMORY_HOST); + pfmg_data = hypre_CTAlloc(hypre_PFMGData, 1, HYPRE_MEMORY_HOST); (pfmg_data -> comm) = comm; (pfmg_data -> time_index) = hypre_InitializeTiming("PFMG"); @@ -30,20 +30,24 @@ hypre_PFMGCreate( MPI_Comm comm ) (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 -> relax_type) = 1; /* weighted Jacobi */ (pfmg_data -> jacobi_weight) = 0.0; - (pfmg_data -> usr_jacobi_weight) = 0; /* no user Jacobi weight */ + (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()); + (pfmg_data -> print_freq) = 1; +#if defined (HYPRE_USING_GPU) + (pfmg_data -> matmult_type) = 1; +#else + (pfmg_data -> matmult_type) = 0; +#endif /* initialize */ - (pfmg_data -> num_levels) = -1; + (pfmg_data -> num_levels) = -1; return (void *) pfmg_data; } @@ -55,7 +59,6 @@ HYPRE_Int hypre_PFMGDestroy( void *pfmg_vdata ) { hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; - HYPRE_Int l; HYPRE_ANNOTATE_FUNC_BEGIN; @@ -68,8 +71,6 @@ 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++) @@ -82,8 +83,8 @@ hypre_PFMGDestroy( void *pfmg_vdata ) } for (l = 0; l < ((pfmg_data -> num_levels) - 1); l++) { - hypre_SemiRestrictDestroy(pfmg_data -> restrict_data_l[l]); - hypre_SemiInterpDestroy(pfmg_data -> interp_data_l[l]); + hypre_StructMatvecDestroy(pfmg_data -> restrict_data_l[l]); + hypre_StructMatvecDestroy(pfmg_data -> interp_data_l[l]); } hypre_TFree(pfmg_data -> relax_data_l, HYPRE_MEMORY_HOST); hypre_TFree(pfmg_data -> matvec_data_l, HYPRE_MEMORY_HOST); @@ -98,21 +99,15 @@ hypre_PFMGDestroy( void *pfmg_vdata ) 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_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_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 -> active_l, HYPRE_MEMORY_HOST); hypre_TFree(pfmg_data -> grid_l, HYPRE_MEMORY_HOST); - hypre_TFree(pfmg_data -> P_grid_l, HYPRE_MEMORY_HOST); hypre_TFree(pfmg_data -> A_l, HYPRE_MEMORY_HOST); hypre_TFree(pfmg_data -> P_l, HYPRE_MEMORY_HOST); hypre_TFree(pfmg_data -> RT_l, HYPRE_MEMORY_HOST); @@ -134,8 +129,8 @@ hypre_PFMGDestroy( void *pfmg_vdata ) *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_PFMGSetTol( void *pfmg_vdata, - HYPRE_Real tol ) +hypre_PFMGSetTol( void *pfmg_vdata, + HYPRE_Real tol ) { hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; @@ -145,8 +140,8 @@ hypre_PFMGSetTol( void *pfmg_vdata, } HYPRE_Int -hypre_PFMGGetTol( void *pfmg_vdata, - HYPRE_Real *tol ) +hypre_PFMGGetTol( void *pfmg_vdata, + HYPRE_Real *tol ) { hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; @@ -159,8 +154,8 @@ hypre_PFMGGetTol( void *pfmg_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_PFMGSetMaxIter( void *pfmg_vdata, - HYPRE_Int max_iter ) +hypre_PFMGSetMaxIter( void *pfmg_vdata, + HYPRE_Int max_iter ) { hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; @@ -170,8 +165,8 @@ hypre_PFMGSetMaxIter( void *pfmg_vdata, } HYPRE_Int -hypre_PFMGGetMaxIter( void *pfmg_vdata, - HYPRE_Int * max_iter ) +hypre_PFMGGetMaxIter( void *pfmg_vdata, + HYPRE_Int *max_iter ) { hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; @@ -184,8 +179,8 @@ hypre_PFMGGetMaxIter( void *pfmg_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_PFMGSetMaxLevels( void *pfmg_vdata, - HYPRE_Int max_levels ) +hypre_PFMGSetMaxLevels( void *pfmg_vdata, + HYPRE_Int max_levels ) { hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; @@ -195,8 +190,8 @@ hypre_PFMGSetMaxLevels( void *pfmg_vdata, } HYPRE_Int -hypre_PFMGGetMaxLevels( void *pfmg_vdata, - HYPRE_Int * max_levels ) +hypre_PFMGGetMaxLevels( void *pfmg_vdata, + HYPRE_Int *max_levels ) { hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; @@ -209,8 +204,8 @@ hypre_PFMGGetMaxLevels( void *pfmg_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_PFMGSetRelChange( void *pfmg_vdata, - HYPRE_Int rel_change ) +hypre_PFMGSetRelChange( void *pfmg_vdata, + HYPRE_Int rel_change ) { hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; @@ -220,8 +215,8 @@ hypre_PFMGSetRelChange( void *pfmg_vdata, } HYPRE_Int -hypre_PFMGGetRelChange( void *pfmg_vdata, - HYPRE_Int * rel_change ) +hypre_PFMGGetRelChange( void *pfmg_vdata, + HYPRE_Int *rel_change ) { hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; @@ -234,8 +229,8 @@ hypre_PFMGGetRelChange( void *pfmg_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_PFMGSetZeroGuess( void *pfmg_vdata, - HYPRE_Int zero_guess ) +hypre_PFMGSetZeroGuess( void *pfmg_vdata, + HYPRE_Int zero_guess ) { hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; @@ -245,8 +240,8 @@ hypre_PFMGSetZeroGuess( void *pfmg_vdata, } HYPRE_Int -hypre_PFMGGetZeroGuess( void *pfmg_vdata, - HYPRE_Int * zero_guess ) +hypre_PFMGGetZeroGuess( void *pfmg_vdata, + HYPRE_Int *zero_guess ) { hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; @@ -259,8 +254,8 @@ hypre_PFMGGetZeroGuess( void *pfmg_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_PFMGSetRelaxType( void *pfmg_vdata, - HYPRE_Int relax_type ) +hypre_PFMGSetRelaxType( void *pfmg_vdata, + HYPRE_Int relax_type ) { hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; @@ -270,8 +265,8 @@ hypre_PFMGSetRelaxType( void *pfmg_vdata, } HYPRE_Int -hypre_PFMGGetRelaxType( void *pfmg_vdata, - HYPRE_Int * relax_type ) +hypre_PFMGGetRelaxType( void *pfmg_vdata, + HYPRE_Int *relax_type ) { hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; @@ -283,8 +278,8 @@ hypre_PFMGGetRelaxType( void *pfmg_vdata, /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_PFMGSetJacobiWeight( void *pfmg_vdata, - HYPRE_Real weight ) +hypre_PFMGSetJacobiWeight( void *pfmg_vdata, + HYPRE_Real weight ) { hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; @@ -295,7 +290,7 @@ hypre_PFMGSetJacobiWeight( void *pfmg_vdata, } HYPRE_Int -hypre_PFMGGetJacobiWeight( void *pfmg_vdata, +hypre_PFMGGetJacobiWeight( void *pfmg_vdata, HYPRE_Real *weight ) { hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; @@ -310,8 +305,8 @@ hypre_PFMGGetJacobiWeight( void *pfmg_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_PFMGSetRAPType( void *pfmg_vdata, - HYPRE_Int rap_type ) +hypre_PFMGSetRAPType( void *pfmg_vdata, + HYPRE_Int rap_type ) { hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; @@ -321,8 +316,8 @@ hypre_PFMGSetRAPType( void *pfmg_vdata, } HYPRE_Int -hypre_PFMGGetRAPType( void *pfmg_vdata, - HYPRE_Int * rap_type ) +hypre_PFMGGetRAPType( void *pfmg_vdata, + HYPRE_Int *rap_type ) { hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; @@ -335,8 +330,33 @@ hypre_PFMGGetRAPType( void *pfmg_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_PFMGSetNumPreRelax( void *pfmg_vdata, - HYPRE_Int num_pre_relax ) +hypre_PFMGSetMatmultType( void *pfmg_vdata, + HYPRE_Int matmult_type ) +{ + hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; + + (pfmg_data -> matmult_type) = matmult_type; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_PFMGGetMatmultType( void *pfmg_vdata, + HYPRE_Int *matmult_type ) +{ + hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; + + *matmult_type = (pfmg_data -> matmult_type); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGSetNumPreRelax( void *pfmg_vdata, + HYPRE_Int num_pre_relax ) { hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; @@ -346,8 +366,8 @@ hypre_PFMGSetNumPreRelax( void *pfmg_vdata, } HYPRE_Int -hypre_PFMGGetNumPreRelax( void *pfmg_vdata, - HYPRE_Int * num_pre_relax ) +hypre_PFMGGetNumPreRelax( void *pfmg_vdata, + HYPRE_Int *num_pre_relax ) { hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; @@ -360,8 +380,8 @@ hypre_PFMGGetNumPreRelax( void *pfmg_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_PFMGSetNumPostRelax( void *pfmg_vdata, - HYPRE_Int num_post_relax ) +hypre_PFMGSetNumPostRelax( void *pfmg_vdata, + HYPRE_Int num_post_relax ) { hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; @@ -371,8 +391,8 @@ hypre_PFMGSetNumPostRelax( void *pfmg_vdata, } HYPRE_Int -hypre_PFMGGetNumPostRelax( void *pfmg_vdata, - HYPRE_Int * num_post_relax ) +hypre_PFMGGetNumPostRelax( void *pfmg_vdata, + HYPRE_Int *num_post_relax ) { hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; @@ -385,8 +405,8 @@ hypre_PFMGGetNumPostRelax( void *pfmg_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_PFMGSetSkipRelax( void *pfmg_vdata, - HYPRE_Int skip_relax ) +hypre_PFMGSetSkipRelax( void *pfmg_vdata, + HYPRE_Int skip_relax ) { hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; @@ -396,7 +416,7 @@ hypre_PFMGSetSkipRelax( void *pfmg_vdata, } HYPRE_Int -hypre_PFMGGetSkipRelax( void *pfmg_vdata, +hypre_PFMGGetSkipRelax( void *pfmg_vdata, HYPRE_Int *skip_relax ) { hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; @@ -410,8 +430,8 @@ hypre_PFMGGetSkipRelax( void *pfmg_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_PFMGSetDxyz( void *pfmg_vdata, - HYPRE_Real *dxyz ) +hypre_PFMGSetDxyz( void *pfmg_vdata, + HYPRE_Real *dxyz ) { hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; @@ -426,8 +446,8 @@ hypre_PFMGSetDxyz( void *pfmg_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_PFMGSetLogging( void *pfmg_vdata, - HYPRE_Int logging) +hypre_PFMGSetLogging( void *pfmg_vdata, + HYPRE_Int logging ) { hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; @@ -437,8 +457,8 @@ hypre_PFMGSetLogging( void *pfmg_vdata, } HYPRE_Int -hypre_PFMGGetLogging( void *pfmg_vdata, - HYPRE_Int * logging) +hypre_PFMGGetLogging( void *pfmg_vdata, + HYPRE_Int *logging ) { hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; @@ -451,8 +471,8 @@ hypre_PFMGGetLogging( void *pfmg_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_PFMGSetPrintLevel( void *pfmg_vdata, - HYPRE_Int print_level) +hypre_PFMGSetPrintLevel( void *pfmg_vdata, + HYPRE_Int print_level) { hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; @@ -462,8 +482,8 @@ hypre_PFMGSetPrintLevel( void *pfmg_vdata, } HYPRE_Int -hypre_PFMGGetPrintLevel( void *pfmg_vdata, - HYPRE_Int * print_level) +hypre_PFMGGetPrintLevel( void *pfmg_vdata, + HYPRE_Int *print_level) { hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; @@ -476,12 +496,23 @@ hypre_PFMGGetPrintLevel( void *pfmg_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_PFMGGetNumIterations( void *pfmg_vdata, - HYPRE_Int *num_iterations ) +hypre_PFMGSetPrintFreq( void *pfmg_vdata, + HYPRE_Int print_freq) { hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; - *num_iterations = (pfmg_data -> num_iterations); + (pfmg_data -> print_freq) = print_freq; + + return hypre_error_flag; +} + +HYPRE_Int +hypre_PFMGGetPrintFreq( void *pfmg_vdata, + HYPRE_Int *print_freq) +{ + hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; + + *print_freq = (pfmg_data -> print_freq); return hypre_error_flag; } @@ -490,28 +521,53 @@ hypre_PFMGGetNumIterations( void *pfmg_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_PFMGPrintLogging( void *pfmg_vdata, - HYPRE_Int myid) +hypre_PFMGGetNumIterations( void *pfmg_vdata, + HYPRE_Int *num_iterations ) { hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; - HYPRE_Int i; - HYPRE_Int num_iterations = (pfmg_data -> num_iterations); - HYPRE_Int logging = (pfmg_data -> logging); - HYPRE_Int print_level = (pfmg_data -> print_level); - HYPRE_Real *norms = (pfmg_data -> norms); - HYPRE_Real *rel_norms = (pfmg_data -> rel_norms); - if (myid == 0) + *num_iterations = (pfmg_data -> num_iterations); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGPrintLogging( void *pfmg_vdata ) +{ + hypre_PFMGData *pfmg_data = (hypre_PFMGData *) pfmg_vdata; + MPI_Comm comm = (pfmg_data -> comm); + HYPRE_Int num_iterations = (pfmg_data -> num_iterations); + HYPRE_Int max_iter = (pfmg_data -> max_iter); + HYPRE_Int logging = (pfmg_data -> logging); + HYPRE_Int print_level = (pfmg_data -> print_level); + HYPRE_Real *norms = (pfmg_data -> norms); + HYPRE_Real *rel_norms = (pfmg_data -> rel_norms); + HYPRE_Int myid, i; + HYPRE_Real convr = 1.0; + HYPRE_Real avg_convr; + + hypre_MPI_Comm_rank(comm, &myid); + + if ((myid == 0) && (logging > 0) && (print_level > 0)) { - if (print_level > 0) + hypre_printf("Iters ||r||_2 conv.rate ||r||_2/||b||_2\n"); + hypre_printf("% 5d %e %f %e\n", 0, norms[0], convr, rel_norms[0]); + for (i = 1; i <= num_iterations; i++) + { + convr = norms[i] / norms[i - 1]; + hypre_printf("% 5d %e %f %e\n", i, norms[i], convr, rel_norms[i]); + } + + if (max_iter > 1) { - if (logging > 0) + if (rel_norms[0] > 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]); - } + avg_convr = pow((rel_norms[num_iterations] / rel_norms[0]), + (1.0 / (HYPRE_Real) num_iterations)); + hypre_printf("\nAverage convergence factor = %f\n", avg_convr); } } } @@ -523,7 +579,7 @@ hypre_PFMGPrintLogging( void *pfmg_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_PFMGGetFinalRelativeResidualNorm( void *pfmg_vdata, +hypre_PFMGGetFinalRelativeResidualNorm( void *pfmg_vdata, HYPRE_Real *relative_residual_norm ) { hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; diff --git a/src/struct_ls/pfmg.h b/src/struct_ls/pfmg.h index 1291ffd62e..a007c4b008 100644 --- a/src/struct_ls/pfmg.h +++ b/src/struct_ls/pfmg.h @@ -14,8 +14,23 @@ #ifndef hypre_PFMG_HEADER #define hypre_PFMG_HEADER +//#define DEBUG_SETUP +//#define DEBUG_SOLVE + +#define hypre_PFMGSetCIndex(cdir, cindex) \ + { \ + hypre_SetIndex(cindex, 0); \ + hypre_IndexD(cindex, cdir) = 0; \ + } + +#define hypre_PFMGSetStride(cdir, stride) \ + { \ + hypre_SetIndex(stride, 1); \ + hypre_IndexD(stride, cdir) = 2; \ + } + /*-------------------------------------------------------------------------- - * hypre_PFMGData: + * hypre_PFMGData *--------------------------------------------------------------------------*/ typedef struct @@ -33,6 +48,7 @@ typedef struct HYPRE_Int usr_jacobi_weight; /* indicator flag for user weight */ HYPRE_Int rap_type; /* controls choice of RAP codes */ + HYPRE_Int matmult_type; /* controls choice of matrix-matrix mult. algorithm */ 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 */ @@ -46,10 +62,6 @@ 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; hypre_StructMatrix **P_l; hypre_StructMatrix **RT_l; @@ -69,8 +81,9 @@ typedef struct /* log info (always logged) */ HYPRE_Int num_iterations; HYPRE_Int time_index; - HYPRE_Int print_level; + HYPRE_Int print_freq; + /* additional log info (logged when `logging' > 0) */ HYPRE_Int logging; HYPRE_Real *norms; @@ -78,7 +91,6 @@ typedef struct #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) HYPRE_Int devicelevel; #endif - } hypre_PFMGData; #endif diff --git a/src/struct_ls/pfmg2_setup_rap.c b/src/struct_ls/pfmg2_setup_rap.c index 011f4f297c..9f16f9659a 100644 --- a/src/struct_ls/pfmg2_setup_rap.c +++ b/src/struct_ls/pfmg2_setup_rap.c @@ -46,7 +46,7 @@ hypre_PFMG2CreateRAPOp( hypre_StructMatrix *R, hypre_Index index_temp; HYPRE_Int j, i; - HYPRE_Int stencil_rank; + HYPRE_Int stencil_entry; RAP_stencil_dim = 2; @@ -54,7 +54,7 @@ hypre_PFMG2CreateRAPOp( hypre_StructMatrix *R, * Define RAP_stencil *-----------------------------------------------------------------------*/ - stencil_rank = 0; + stencil_entry = 0; /*----------------------------------------------------------------------- * non-symmetric case @@ -74,11 +74,11 @@ hypre_PFMG2CreateRAPOp( hypre_StructMatrix *R, { /*-------------------------------------------------------------- - * Storage for 9 elements (c,w,e,n,s,sw,se,nw,se) + * Storage for 9 entries (c,w,e,n,s,sw,se,nw,se) *--------------------------------------------------------------*/ hypre_SetIndex3(index_temp, i, j, 0); - MapIndex(index_temp, cdir, RAP_stencil_shape[stencil_rank]); - stencil_rank++; + MapIndex(index_temp, cdir, RAP_stencil_shape[stencil_entry]); + stencil_entry++; } } } @@ -104,13 +104,13 @@ hypre_PFMG2CreateRAPOp( hypre_StructMatrix *R, { /*-------------------------------------------------------------- - * Store 5 elements in (c,w,s,sw,se) + * Store 5 entries in (c,w,s,sw,se) *--------------------------------------------------------------*/ - if ( i + j <= 0 ) + if (i + j <= 0) { hypre_SetIndex3(index_temp, i, j, 0); - MapIndex(index_temp, cdir, RAP_stencil_shape[stencil_rank]); - stencil_rank++; + MapIndex(index_temp, cdir, RAP_stencil_shape[stencil_entry]); + stencil_entry++; } } } @@ -132,7 +132,7 @@ hypre_PFMG2CreateRAPOp( hypre_StructMatrix *R, /*----------------------------------------------------------------------- * Set number of ghost points - one one each boundary *-----------------------------------------------------------------------*/ - hypre_StructMatrixSetNumGhost(RAP, RAP_num_ghost); + HYPRE_StructMatrixSetNumGhost(RAP, RAP_num_ghost); return RAP; } diff --git a/src/struct_ls/pfmg3_setup_rap.c b/src/struct_ls/pfmg3_setup_rap.c index f508e11f13..aa3afaac2c 100644 --- a/src/struct_ls/pfmg3_setup_rap.c +++ b/src/struct_ls/pfmg3_setup_rap.c @@ -50,7 +50,7 @@ hypre_PFMG3CreateRAPOp( hypre_StructMatrix *R, hypre_Index index_temp; HYPRE_Int k, j, i; - HYPRE_Int stencil_rank; + HYPRE_Int stencil_entry; RAP_stencil_dim = 3; @@ -61,7 +61,7 @@ hypre_PFMG3CreateRAPOp( hypre_StructMatrix *R, * Define RAP_stencil *-----------------------------------------------------------------------*/ - stencil_rank = 0; + stencil_entry = 0; /*----------------------------------------------------------------------- * non-symmetric case @@ -70,7 +70,7 @@ hypre_PFMG3CreateRAPOp( hypre_StructMatrix *R, /*----------------------------------------------------------------------- * 7-point fine grid stencil produces 19 point RAP * - * Store all 27 elements except for the corners. + * Store all 27 entries except for the corners. * * For symmetric A, only store the lower triangular part, where * lower triangular means the lower triangular part on the matrix @@ -90,12 +90,12 @@ 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_entry < RAP_stencil_size)) { hypre_SetIndex3(index_temp, i, j, k); MapIndex(index_temp, cdir, - RAP_stencil_shape[stencil_rank]); - stencil_rank++; + RAP_stencil_shape[stencil_entry]); + stencil_entry++; } } } @@ -105,7 +105,7 @@ hypre_PFMG3CreateRAPOp( hypre_StructMatrix *R, /*----------------------------------------------------------------------- * 19 or 27 point fine grid stencil produces 27 point RAP * - * Store all 27 elements + * Store all 27 entries * * For symmetric A, only store the lower triangular part, where * lower triangular means the lower triangular part on the matrix @@ -125,12 +125,12 @@ hypre_PFMG3CreateRAPOp( hypre_StructMatrix *R, { for (i = -1; i < 2; i++) { - if (stencil_rank < RAP_stencil_size) + if (stencil_entry < RAP_stencil_size) { hypre_SetIndex3(index_temp, i, j, k); MapIndex(index_temp, cdir, - RAP_stencil_shape[stencil_rank]); - stencil_rank++; + RAP_stencil_shape[stencil_entry]); + stencil_entry++; } } } @@ -152,7 +152,7 @@ hypre_PFMG3CreateRAPOp( hypre_StructMatrix *R, /*----------------------------------------------------------------------- * Set number of ghost points - one one each boundary *-----------------------------------------------------------------------*/ - hypre_StructMatrixSetNumGhost(RAP, RAP_num_ghost); + HYPRE_StructMatrixSetNumGhost(RAP, RAP_num_ghost); return RAP; } diff --git a/src/struct_ls/pfmg_coarsen.c b/src/struct_ls/pfmg_coarsen.c new file mode 100644 index 0000000000..e1058a08c1 --- /dev/null +++ b/src/struct_ls/pfmg_coarsen.c @@ -0,0 +1,1301 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_ls.h" +#include "_hypre_struct_mv.hpp" +#include "pfmg.h" + +#if defined(HYPRE_UNROLL_MAXDEPTH) +#undef HYPRE_UNROLL_MAXDEPTH +#endif +#define HYPRE_UNROLL_MAXDEPTH 18 + +#define HYPRE_CXYZ_DEFINE_SIGN \ + HYPRE_Real sign = diag_is_constant ? \ + (A_diag[0] < 0.0 ? 1.0 : -1.0) : \ + (A_diag[Ai] < 0.0 ? 1.0 : -1.0) + +#define HYPRE_AP_DECLARE(n) \ + HYPRE_Real *Ap##n##_d = NULL, *Ap##n##_0 = NULL, *Ap##n##_1 = NULL, *Ap##n##_2 = NULL + +#define HYPRE_AP_LOAD(n, d) \ + Ap##n##_##d = hypre_StructMatrixBoxData(A, Ab, entries[d][k + n]) + +#define HYPRE_CAP_LOAD(n, d) \ + Ap##n##_##d = hypre_StructMatrixConstData(A, entries[d][k + n]) + +#define HYPRE_AP_EVAL(n, d) \ + Ap##n##_##d[Ai] + +#define HYPRE_CAP_EVAL(n, d) \ + Ap##n##_##d[0] + +#define HYPRE_AP_DECLARE_UP_TO_9 \ + HYPRE_AP_DECLARE(0); \ + HYPRE_AP_DECLARE(1); \ + HYPRE_AP_DECLARE(2); \ + HYPRE_AP_DECLARE(3); \ + HYPRE_AP_DECLARE(4); \ + HYPRE_AP_DECLARE(5); \ + HYPRE_AP_DECLARE(6); \ + HYPRE_AP_DECLARE(7); \ + HYPRE_AP_DECLARE(8) + +#define HYPRE_AP_DECLARE_UP_TO_10 \ + HYPRE_AP_DECLARE_UP_TO_9; \ + HYPRE_AP_DECLARE(9) + +#define HYPRE_AP_DECLARE_UP_TO_18 \ + HYPRE_AP_DECLARE_UP_TO_10; \ + HYPRE_AP_DECLARE(10); \ + HYPRE_AP_DECLARE(11); \ + HYPRE_AP_DECLARE(12); \ + HYPRE_AP_DECLARE(13); \ + HYPRE_AP_DECLARE(14); \ + HYPRE_AP_DECLARE(15); \ + HYPRE_AP_DECLARE(16); \ + HYPRE_AP_DECLARE(17) + +#define HYPRE_AP_LOAD_UP_TO_1(d) \ + HYPRE_AP_LOAD(0, d) + +#define HYPRE_AP_LOAD_UP_TO_2(d) \ + HYPRE_AP_LOAD_UP_TO_1(d); \ + HYPRE_AP_LOAD(1, d) + +#define HYPRE_AP_LOAD_UP_TO_3(d) \ + HYPRE_AP_LOAD_UP_TO_2(d); \ + HYPRE_AP_LOAD(2, d) + +#define HYPRE_AP_LOAD_UP_TO_4(d) \ + HYPRE_AP_LOAD_UP_TO_3(d); \ + HYPRE_AP_LOAD(3, d) + +#define HYPRE_AP_LOAD_UP_TO_5(d) \ + HYPRE_AP_LOAD_UP_TO_4(d); \ + HYPRE_AP_LOAD(4, d) + +#define HYPRE_AP_LOAD_UP_TO_6(d) \ + HYPRE_AP_LOAD_UP_TO_5(d); \ + HYPRE_AP_LOAD(5, d) + +#define HYPRE_AP_LOAD_UP_TO_7(d) \ + HYPRE_AP_LOAD_UP_TO_6(d); \ + HYPRE_AP_LOAD(6, d) + +#define HYPRE_AP_LOAD_UP_TO_8(d) \ + HYPRE_AP_LOAD_UP_TO_7(d); \ + HYPRE_AP_LOAD(7, d) + +#define HYPRE_AP_LOAD_UP_TO_9(d) \ + HYPRE_AP_LOAD_UP_TO_8(d); \ + HYPRE_AP_LOAD(8, d) + +#define HYPRE_AP_LOAD_UP_TO_10(d) \ + HYPRE_AP_LOAD_UP_TO_9(d); \ + HYPRE_AP_LOAD(9, d) + +#define HYPRE_AP_LOAD_UP_TO_11(d) \ + HYPRE_AP_LOAD_UP_TO_10(d); \ + HYPRE_AP_LOAD(10, d) + +#define HYPRE_AP_LOAD_UP_TO_12(d) \ + HYPRE_AP_LOAD_UP_TO_11(d); \ + HYPRE_AP_LOAD(11, d) + +#define HYPRE_AP_LOAD_UP_TO_13(d) \ + HYPRE_AP_LOAD_UP_TO_12(d); \ + HYPRE_AP_LOAD(12, d) + +#define HYPRE_AP_LOAD_UP_TO_14(d) \ + HYPRE_AP_LOAD_UP_TO_13(d); \ + HYPRE_AP_LOAD(13, d) + +#define HYPRE_AP_LOAD_UP_TO_15(d) \ + HYPRE_AP_LOAD_UP_TO_14(d); \ + HYPRE_AP_LOAD(14, d) + +#define HYPRE_AP_LOAD_UP_TO_16(d) \ + HYPRE_AP_LOAD_UP_TO_15(d); \ + HYPRE_AP_LOAD(15, d) + +#define HYPRE_AP_LOAD_UP_TO_17(d) \ + HYPRE_AP_LOAD_UP_TO_16(d); \ + HYPRE_AP_LOAD(16, d) + +#define HYPRE_AP_LOAD_UP_TO_18(d) \ + HYPRE_AP_LOAD_UP_TO_17(d); \ + HYPRE_AP_LOAD(17, d) + +#define HYPRE_CAP_LOAD_UP_TO_1(d) \ + HYPRE_CAP_LOAD(0, d) + +#define HYPRE_CAP_LOAD_UP_TO_2(d) \ + HYPRE_CAP_LOAD_UP_TO_1(d); \ + HYPRE_CAP_LOAD(1, d) + +#define HYPRE_CAP_LOAD_UP_TO_3(d) \ + HYPRE_CAP_LOAD_UP_TO_2(d); \ + HYPRE_CAP_LOAD(2, d) + +#define HYPRE_CAP_LOAD_UP_TO_4(d) \ + HYPRE_CAP_LOAD_UP_TO_3(d); \ + HYPRE_CAP_LOAD(3, d) + +#define HYPRE_CAP_LOAD_UP_TO_5(d) \ + HYPRE_CAP_LOAD_UP_TO_4(d); \ + HYPRE_CAP_LOAD(4, d) + +#define HYPRE_CAP_LOAD_UP_TO_6(d) \ + HYPRE_CAP_LOAD_UP_TO_5(d); \ + HYPRE_CAP_LOAD(5, d) + +#define HYPRE_CAP_LOAD_UP_TO_7(d) \ + HYPRE_CAP_LOAD_UP_TO_6(d); \ + HYPRE_CAP_LOAD(6, d) + +#define HYPRE_CAP_LOAD_UP_TO_8(d) \ + HYPRE_CAP_LOAD_UP_TO_7(d); \ + HYPRE_CAP_LOAD(7, d) + +#define HYPRE_CAP_LOAD_UP_TO_9(d) \ + HYPRE_CAP_LOAD_UP_TO_8(d); \ + HYPRE_CAP_LOAD(8, d) + +#define HYPRE_CAP_LOAD_UP_TO_10(d) \ + HYPRE_CAP_LOAD_UP_TO_9(d); \ + HYPRE_CAP_LOAD(9, d) + +#define HYPRE_CAP_LOAD_UP_TO_11(d) \ + HYPRE_CAP_LOAD_UP_TO_10(d); \ + HYPRE_CAP_LOAD(10, d) + +#define HYPRE_CAP_LOAD_UP_TO_12(d) \ + HYPRE_CAP_LOAD_UP_TO_11(d); \ + HYPRE_CAP_LOAD(11, d) + +#define HYPRE_CAP_LOAD_UP_TO_13(d) \ + HYPRE_CAP_LOAD_UP_TO_12(d); \ + HYPRE_CAP_LOAD(12, d) + +#define HYPRE_CAP_LOAD_UP_TO_14(d) \ + HYPRE_CAP_LOAD_UP_TO_13(d); \ + HYPRE_CAP_LOAD(13, d) + +#define HYPRE_CAP_LOAD_UP_TO_15(d) \ + HYPRE_CAP_LOAD_UP_TO_14(d); \ + HYPRE_CAP_LOAD(14, d) + +#define HYPRE_CAP_LOAD_UP_TO_16(d) \ + HYPRE_CAP_LOAD_UP_TO_15(d); \ + HYPRE_CAP_LOAD(15, d) + +#define HYPRE_CAP_LOAD_UP_TO_17(d) \ + HYPRE_CAP_LOAD_UP_TO_16(d); \ + HYPRE_CAP_LOAD(16, d) + +#define HYPRE_CAP_LOAD_UP_TO_18(d) \ + HYPRE_CAP_LOAD_UP_TO_17(d); \ + HYPRE_CAP_LOAD(17, d) + +#define HYPRE_AP_SUM_UP_TO_1(d) \ + HYPRE_AP_EVAL(0, d) + +#define HYPRE_AP_SUM_UP_TO_2(d) \ + HYPRE_AP_SUM_UP_TO_1(d) + \ + HYPRE_AP_EVAL(1, d) + +#define HYPRE_AP_SUM_UP_TO_3(d) \ + HYPRE_AP_SUM_UP_TO_2(d) + \ + HYPRE_AP_EVAL(2, d) + +#define HYPRE_AP_SUM_UP_TO_4(d) \ + HYPRE_AP_SUM_UP_TO_3(d) + \ + HYPRE_AP_EVAL(3, d) + +#define HYPRE_AP_SUM_UP_TO_5(d) \ + HYPRE_AP_SUM_UP_TO_4(d) + \ + HYPRE_AP_EVAL(4, d) + +#define HYPRE_AP_SUM_UP_TO_6(d) \ + HYPRE_AP_SUM_UP_TO_5(d) + \ + HYPRE_AP_EVAL(5, d) + +#define HYPRE_AP_SUM_UP_TO_7(d) \ + HYPRE_AP_SUM_UP_TO_6(d) + \ + HYPRE_AP_EVAL(6, d) + +#define HYPRE_AP_SUM_UP_TO_8(d) \ + HYPRE_AP_SUM_UP_TO_7(d) + \ + HYPRE_AP_EVAL(7, d) + +#define HYPRE_AP_SUM_UP_TO_9(d) \ + HYPRE_AP_SUM_UP_TO_8(d) + \ + HYPRE_AP_EVAL(8, d) + +#define HYPRE_AP_SUM_UP_TO_10(d) \ + HYPRE_AP_SUM_UP_TO_9(d) + \ + HYPRE_AP_EVAL(9, d) + +#define HYPRE_AP_SUM_UP_TO_11(d) \ + HYPRE_AP_SUM_UP_TO_10(d) + \ + HYPRE_AP_EVAL(10, d) + +#define HYPRE_AP_SUM_UP_TO_12(d) \ + HYPRE_AP_SUM_UP_TO_11(d) + \ + HYPRE_AP_EVAL(11, d) + +#define HYPRE_AP_SUM_UP_TO_13(d) \ + HYPRE_AP_SUM_UP_TO_12(d) + \ + HYPRE_AP_EVAL(12, d) + +#define HYPRE_AP_SUM_UP_TO_14(d) \ + HYPRE_AP_SUM_UP_TO_13(d) + \ + HYPRE_AP_EVAL(13, d) + +#define HYPRE_AP_SUM_UP_TO_15(d) \ + HYPRE_AP_SUM_UP_TO_14(d) + \ + HYPRE_AP_EVAL(14, d) + +#define HYPRE_AP_SUM_UP_TO_16(d) \ + HYPRE_AP_SUM_UP_TO_15(d) + \ + HYPRE_AP_EVAL(15, d) + +#define HYPRE_AP_SUM_UP_TO_17(d) \ + HYPRE_AP_SUM_UP_TO_16(d) + \ + HYPRE_AP_EVAL(16, d) + +#define HYPRE_AP_SUM_UP_TO_18(d) \ + HYPRE_AP_SUM_UP_TO_17(d) + \ + HYPRE_AP_EVAL(17, d) + +#define HYPRE_CAP_SUM_UP_TO_1(d) \ + HYPRE_CAP_EVAL(0, d) + +#define HYPRE_CAP_SUM_UP_TO_2(d) \ + HYPRE_CAP_SUM_UP_TO_1(d) + \ + HYPRE_CAP_EVAL(1, d) + +#define HYPRE_CAP_SUM_UP_TO_3(d) \ + HYPRE_CAP_SUM_UP_TO_2(d) + \ + HYPRE_CAP_EVAL(2, d) + +#define HYPRE_CAP_SUM_UP_TO_4(d) \ + HYPRE_CAP_SUM_UP_TO_3(d) + \ + HYPRE_CAP_EVAL(3, d) + +#define HYPRE_CAP_SUM_UP_TO_5(d) \ + HYPRE_CAP_SUM_UP_TO_4(d) + \ + HYPRE_CAP_EVAL(4, d) + +#define HYPRE_CAP_SUM_UP_TO_6(d) \ + HYPRE_CAP_SUM_UP_TO_5(d) + \ + HYPRE_CAP_EVAL(5, d) + +#define HYPRE_CAP_SUM_UP_TO_7(d) \ + HYPRE_CAP_SUM_UP_TO_6(d) + \ + HYPRE_CAP_EVAL(6, d) + +#define HYPRE_CAP_SUM_UP_TO_8(d) \ + HYPRE_CAP_SUM_UP_TO_7(d) + \ + HYPRE_CAP_EVAL(7, d) + +#define HYPRE_CAP_SUM_UP_TO_9(d) \ + HYPRE_CAP_SUM_UP_TO_8(d) + \ + HYPRE_CAP_EVAL(8, d) + +#define HYPRE_CAP_SUM_UP_TO_10(d) \ + HYPRE_CAP_SUM_UP_TO_9(d) + \ + HYPRE_CAP_EVAL(9, d) + +#define HYPRE_CAP_SUM_UP_TO_11(d) \ + HYPRE_CAP_SUM_UP_TO_10(d) + \ + HYPRE_CAP_EVAL(10, d) + +#define HYPRE_CAP_SUM_UP_TO_12(d) \ + HYPRE_CAP_SUM_UP_TO_11(d) + \ + HYPRE_CAP_EVAL(11, d) + +#define HYPRE_CAP_SUM_UP_TO_13(d) \ + HYPRE_CAP_SUM_UP_TO_12(d) + \ + HYPRE_CAP_EVAL(12, d) + +#define HYPRE_CAP_SUM_UP_TO_14(d) \ + HYPRE_CAP_SUM_UP_TO_13(d) + \ + HYPRE_CAP_EVAL(13, d) + +#define HYPRE_CAP_SUM_UP_TO_15(d) \ + HYPRE_CAP_SUM_UP_TO_14(d) + \ + HYPRE_CAP_EVAL(14, d) + +#define HYPRE_CAP_SUM_UP_TO_16(d) \ + HYPRE_CAP_SUM_UP_TO_15(d) + \ + HYPRE_CAP_EVAL(15, d) + +#define HYPRE_CAP_SUM_UP_TO_17(d) \ + HYPRE_CAP_SUM_UP_TO_16(d) + \ + HYPRE_CAP_EVAL(16, d) + +#define HYPRE_CAP_SUM_UP_TO_18(d) \ + HYPRE_CAP_SUM_UP_TO_17(d) + \ + HYPRE_CAP_EVAL(17, d) + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGComputeMaxLevels( hypre_StructGrid *grid, + HYPRE_Int *max_levels_ptr ) +{ + HYPRE_Int ndim = hypre_StructGridNDim(grid); + hypre_Box *bbox = hypre_StructGridBoundingBox(grid); + HYPRE_Int max_levels, d; + + max_levels = 1; + for (d = 0; d < ndim; d++) + { + max_levels += hypre_Log2(hypre_BoxSizeD(bbox, d)) + 2; + } + + *max_levels_ptr = max_levels; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_PFMGComputeCxyz_core_VC + * + * Core function for computing stencil collapsing for variable coefficients + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGComputeCxyz_core_VC(hypre_StructMatrix *A, + HYPRE_Int Ab, + HYPRE_Int diag_is_constant, + HYPRE_Int diag_entry, + HYPRE_Int *nentries, + HYPRE_Int **entries, + hypre_IndexRef start, + hypre_Index loop_size, + hypre_Box *A_dbox, + hypre_Box *w_dbox, + HYPRE_Real **w_data) +{ + HYPRE_Int ndim = hypre_StructMatrixNDim(A); + hypre_Index ustride; + HYPRE_Int k = 0, d, depth; + + HYPRE_Real *w_data_d, *w_data_0, *w_data_1, *w_data_2; + HYPRE_Real *A_diag = NULL; + HYPRE_AP_DECLARE_UP_TO_18; + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("VC"); + + hypre_SetIndex(ustride, 1); + + /* Set A_diag pointer */ + A_diag = (diag_is_constant) ? + hypre_StructMatrixConstData(A, diag_entry) : + hypre_StructMatrixBoxData(A, Ab, diag_entry); + + /* Set w_data pointers */ + switch (ndim) + { + case 3: + w_data_2 = w_data[2]; + HYPRE_FALLTHROUGH; + + case 2: + w_data_1 = w_data[1]; + HYPRE_FALLTHROUGH; + + case 1: + w_data_0 = w_data[0]; + break; + + default: + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Not implemented!"); + return hypre_error_flag; + } + +#ifdef HYPRE_CORE_CASE +#undef HYPRE_CORE_CASE +#endif +#define HYPRE_CORE_CASE(a0, a1, a2) \ + /* Load Ap pointers */ \ + HYPRE_AP_LOAD_UP_TO_##a0(0); \ + HYPRE_AP_LOAD_UP_TO_##a1(1); \ + HYPRE_AP_LOAD_UP_TO_##a2(2); \ + \ + /* Compute w_data */ \ + hypre_BoxLoop2Begin(ndim, loop_size, \ + A_dbox, start, ustride, Ai, \ + w_dbox, start, ustride, wi); \ + { \ + HYPRE_CXYZ_DEFINE_SIGN; \ + \ + w_data_0[wi] = sign * (HYPRE_AP_SUM_UP_TO_##a0(0)); \ + w_data_1[wi] = sign * (HYPRE_AP_SUM_UP_TO_##a1(1)); \ + w_data_2[wi] = sign * (HYPRE_AP_SUM_UP_TO_##a2(2)); \ + } \ + hypre_BoxLoop2End(Ai, wi) + + /* Compute w_data pointers by summing contributions from A. + Specialization is used for common stencil sizes to optimize for performance. + A generic fallback algorithm is used otherwise */ + if (ndim == 3 && nentries[0] == 18 && nentries[1] == 18 && nentries[2] == 18) + { + HYPRE_CORE_CASE(18, 18, 18); + } + else if (ndim == 3 && nentries[0] == 10 && nentries[1] == 10 && nentries[2] == 10) + { + HYPRE_CORE_CASE(10, 10, 10); + } + else if (ndim == 3 && nentries[0] == 9 && nentries[1] == 9 && nentries[2] == 9) + { + HYPRE_CORE_CASE(9, 9, 9); + } + else if (ndim == 3 && nentries[0] == 2 && nentries[1] == 2 && nentries[2] == 2) + { + HYPRE_CORE_CASE(2, 2, 2); + } + else + { + /* Fallback to general algorithm */ + for (d = 0; d < ndim; d++) + { + w_data_d = w_data[d]; + for (k = 0; k < nentries[d]; k += HYPRE_UNROLL_MAXDEPTH) + { + depth = hypre_min(HYPRE_UNROLL_MAXDEPTH, (nentries[d] - k)); + +#ifdef HYPRE_CORE_CASE +#undef HYPRE_CORE_CASE +#endif +#define HYPRE_CORE_CASE(n) \ + case n: \ + HYPRE_AP_LOAD_UP_TO_##n(d); \ + hypre_BoxLoop2Begin(ndim, loop_size, \ + A_dbox, start, ustride, Ai, \ + w_dbox, start, ustride, wi); \ + { \ + HYPRE_CXYZ_DEFINE_SIGN; \ + if (k < HYPRE_UNROLL_MAXDEPTH) { w_data_d[wi] = 0.0; } \ + \ + w_data_d[wi] += sign * (HYPRE_AP_SUM_UP_TO_##n(d)); \ + } \ + hypre_BoxLoop2End(Ai, wi); \ + break + + switch (depth) + { + HYPRE_CORE_CASE(18); + HYPRE_CORE_CASE(17); + HYPRE_CORE_CASE(16); + HYPRE_CORE_CASE(15); + HYPRE_CORE_CASE(14); + HYPRE_CORE_CASE(13); + HYPRE_CORE_CASE(12); + HYPRE_CORE_CASE(11); + HYPRE_CORE_CASE(10); + HYPRE_CORE_CASE(9); + HYPRE_CORE_CASE(8); + HYPRE_CORE_CASE(7); + HYPRE_CORE_CASE(6); + HYPRE_CORE_CASE(5); + HYPRE_CORE_CASE(4); + HYPRE_CORE_CASE(3); + HYPRE_CORE_CASE(2); + HYPRE_CORE_CASE(1); + + default: + break; + } + } + } + +#if defined(DEBUG_CXYZ) + hypre_printf("ndim = %d | nentries[0] = %d | nentries[1] = %d | nentries[2] = %d\n", + ndim, nentries[0], nentries[1], nentries[2]); +#endif + } + +#if defined(HYPRE_USING_GPU) + hypre_SyncComputeStream(); +#endif + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_PFMGComputeCxyz_core_CC + * + * Core function for computing stencil collapsing for constant coefficients. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGComputeCxyz_core_CC(hypre_StructMatrix *A, + HYPRE_Int Ab, + HYPRE_Int diag_is_constant, + HYPRE_Int diag_entry, + HYPRE_Int *nentries, + HYPRE_Int **entries, + hypre_IndexRef start, + hypre_Index loop_size, + hypre_Box *A_dbox, + hypre_Box *w_dbox, + HYPRE_Real **w_data) +{ + HYPRE_Int ndim = hypre_StructMatrixNDim(A); + hypre_Index ustride; + HYPRE_Int k = 0, d, depth, all_zero; + + HYPRE_Real *w_data_d, *w_data_0, *w_data_1, *w_data_2; + HYPRE_Real *A_diag = NULL; + HYPRE_AP_DECLARE_UP_TO_9; + + /* Exit if there are no constant coefficients */ + all_zero = 1; + for (d = 0; d < ndim; d++) + { + if (nentries[d] > 0) + { + all_zero = 0; + break; + } + } + if (all_zero) + { + return hypre_error_flag; + } + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("CC"); + + hypre_SetIndex(ustride, 1); + A_diag = (diag_is_constant) ? + hypre_StructMatrixConstData(A, diag_entry) : + hypre_StructMatrixBoxData(A, Ab, diag_entry); + + /* Set w_data pointers */ + switch (ndim) + { + case 3: + w_data_2 = w_data[2]; + HYPRE_FALLTHROUGH; + + case 2: + w_data_1 = w_data[1]; + HYPRE_FALLTHROUGH; + + case 1: + w_data_0 = w_data[0]; + break; + + default: + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Not implemented!"); + return hypre_error_flag; + } + +#ifdef HYPRE_CORE_CASE +#undef HYPRE_CORE_CASE +#endif +#define HYPRE_CORE_CASE(a0, a1, a2) \ + /* Load Ap pointers */ \ + HYPRE_CAP_LOAD_UP_TO_##a0(0); \ + HYPRE_CAP_LOAD_UP_TO_##a1(1); \ + HYPRE_CAP_LOAD_UP_TO_##a2(2); \ + \ + /* Compute w_data */ \ + hypre_BoxLoop2Begin(ndim, loop_size, \ + A_dbox, start, ustride, Ai, \ + w_dbox, start, ustride, wi); \ + { \ + HYPRE_CXYZ_DEFINE_SIGN; \ + \ + w_data_0[wi] = sign * (HYPRE_CAP_SUM_UP_TO_##a0(0)); \ + w_data_1[wi] = sign * (HYPRE_CAP_SUM_UP_TO_##a1(1)); \ + w_data_2[wi] = sign * (HYPRE_CAP_SUM_UP_TO_##a2(2)); \ + } \ + hypre_BoxLoop2End(Ai, wi) + + /* Compute w_data pointers by summing contributions from A. + Specialization is used for common stencil sizes to optimize for performance. + A generic fallback algorithm is used otherwise */ + if (ndim == 3 && nentries[0] == 9 && nentries[1] == 9 && nentries[2] == 9) + { + HYPRE_CORE_CASE(9, 9, 9); + } + else if (ndim == 3 && nentries[0] == 2 && nentries[1] == 2 && nentries[2] == 2) + { + HYPRE_CORE_CASE(2, 2, 2); + } + else + { + /* Fallback to generic algorithm */ + for (d = 0; d < ndim; d++) + { + w_data_d = w_data[d]; + + /* Compute row sums */ + for (k = 0; k < nentries[d]; k += HYPRE_UNROLL_MAXDEPTH) + { + depth = hypre_min(HYPRE_UNROLL_MAXDEPTH, (nentries[d] - k)); + +#ifdef HYPRE_CORE_CASE +#undef HYPRE_CORE_CASE +#endif +#define HYPRE_CORE_CASE(n) \ + case n: \ + HYPRE_CAP_LOAD_UP_TO_##n(d); \ + hypre_BoxLoop2Begin(ndim, loop_size, \ + A_dbox, start, ustride, Ai, \ + w_dbox, start, ustride, wi); \ + { \ + HYPRE_CXYZ_DEFINE_SIGN; \ + if (k < HYPRE_UNROLL_MAXDEPTH) { w_data_d[wi] = 0.0; } \ + \ + w_data_d[wi] += sign * (HYPRE_CAP_SUM_UP_TO_##n(d)); \ + } \ + hypre_BoxLoop2End(Ai, wi); \ + break + + switch (depth) + { + HYPRE_CORE_CASE(9); + HYPRE_CORE_CASE(8); + HYPRE_CORE_CASE(7); + HYPRE_CORE_CASE(6); + HYPRE_CORE_CASE(5); + HYPRE_CORE_CASE(4); + HYPRE_CORE_CASE(3); + HYPRE_CORE_CASE(2); + HYPRE_CORE_CASE(1); + + default: + break; + } /* switch (nentries) */ + } + +#if defined(HYPRE_USING_GPU) + hypre_SyncComputeStream(); +#endif + } /* for (d = 0; d < ndim; d++) */ + } + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_PFMGComputeCxyz + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGComputeCxyz( hypre_StructMatrix *A, + HYPRE_Real *cxyz, + HYPRE_Real *sqcxyz) +{ + MPI_Comm comm = hypre_StructMatrixComm(A); + HYPRE_Int ndim = hypre_StructMatrixNDim(A); + hypre_StructGrid *grid = hypre_StructMatrixGrid(A); + hypre_StructStencil *stencil = hypre_StructMatrixStencil(A); + HYPRE_Int *constant = hypre_StructMatrixConstant(A); + HYPRE_Int *const_indices = hypre_StructMatrixConstIndices(A); + hypre_Index *stencil_shape = hypre_StructStencilShape(stencil); + HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); + HYPRE_Int diag_entry = hypre_StructStencilDiagEntry(stencil); + hypre_BoxArray *compute_boxes = hypre_StructGridBoxes(grid); + + hypre_Box *A_dbox; + hypre_Box *compute_box; + hypre_Index loop_size, ustride; + hypre_IndexRef start; + + hypre_StructVector *work[HYPRE_MAXDIM]; + HYPRE_Real *w_data[HYPRE_MAXDIM]; + hypre_Box *w_dbox; + + HYPRE_Int d, i, k, si; + HYPRE_Int cdepth[HYPRE_MAXDIM]; + HYPRE_Int vdepth[HYPRE_MAXDIM]; + HYPRE_Int *entries[HYPRE_MAXDIM]; + HYPRE_Int csi[HYPRE_MAXDIM][HYPRE_MAX_MMTERMS]; + HYPRE_Int vsi[HYPRE_MAXDIM][HYPRE_MAX_MMTERMS]; + HYPRE_Int diag_is_constant; + + /* Sanity check */ + if (stencil_size >= HYPRE_MAX_MMTERMS) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Reached max. stencil size! Increase HYPRE_MAX_MMTERMS!"); + return hypre_error_flag; + } + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("PFMGComputeCxyz"); + + /*---------------------------------------------------------- + * Initialize data + *----------------------------------------------------------*/ + + hypre_SetIndex(ustride, 1); + for (d = 0; d < ndim; d++) + { + cxyz[d] = 0.0; + sqcxyz[d] = 0.0; + } + + /* Check if diagonal entry is constant (1) or variable (0) */ + diag_is_constant = constant[diag_entry] ? 1 : 0; + + /* Create work arrays */ + for (d = 0; d < ndim; d++) + { + work[d] = hypre_StructVectorCreate(comm, grid); + for (i = 0; i < 2 * ndim; i++) + { + hypre_StructVectorNumGhost(work[d])[i] = hypre_StructMatrixNumGhost(A)[i]; + } + hypre_StructVectorInitialize(work[d], 0); + } + + /* Initialize csi/vsi stencil pointers */ + for (d = 0; d < ndim; d++) + { + cdepth[d] = vdepth[d] = 0; + for (k = 0; k < stencil_size; k++) + { + csi[d][k] = vsi[d][k] = 0; + } + } + + /* Setup csi/vsi stencil pointers */ + for (si = 0; si < stencil_size; si++) + { + if (hypre_StructMatrixConstEntry(A, si)) + { + for (d = 0; d < ndim; d++) + { + if (hypre_IndexD(stencil_shape[si], d) != 0) + { + csi[d][cdepth[d]++] = const_indices[si]; + } + } + } + else + { + for (d = 0; d < ndim; d++) + { + if (hypre_IndexD(stencil_shape[si], d) != 0) + { + vsi[d][vdepth[d]++] = si; + } + } + } + } + + /*---------------------------------------------------------- + * Compute cxyz (use arithmetic mean) + *----------------------------------------------------------*/ + + hypre_ForBoxI(i, compute_boxes) + { + compute_box = hypre_BoxArrayBox(compute_boxes, i); + start = hypre_BoxIMin(compute_box); + hypre_BoxGetSize(compute_box, loop_size); + + A_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A), i); + w_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(work[0]), i); + for (d = 0; d < ndim; d++) + { + w_data[d] = hypre_StructVectorBoxData(work[d], i); + } + + /* Collect pointers to variable stencil entries */ + for (d = 0; d < ndim; d++) + { + entries[d] = vsi[d]; + } + + /* Compute variable coefficient contributions */ + hypre_PFMGComputeCxyz_core_VC(A, i, diag_is_constant, diag_entry, + vdepth, entries, start, loop_size, + A_dbox, w_dbox, w_data); + + /* Collect pointers to constant stencil entries */ + for (d = 0; d < ndim; d++) + { + entries[d] = csi[d]; + } + + /* Compute constant coefficient contributions */ + hypre_PFMGComputeCxyz_core_CC(A, i, diag_is_constant, diag_entry, + cdepth, entries, start, loop_size, + A_dbox, w_dbox, w_data); + + + /* Compute cxyz/sqcxyz */ + hypre_GpuProfilingPushRange("Reduction"); + if (ndim == 3) + { +#if defined(HYPRE_USING_KOKKOS) || defined(HYPRE_USING_SYCL) + /* TODO: Use a single BoxLoopReduction */ + HYPRE_Real cdb_0 = cxyz[0], cdb_1 = cxyz[1], cdb_2 = cxyz[2]; + HYPRE_Real sqcdb_0 = sqcxyz[0], sqcdb_1 = sqcxyz[1], sqcdb_2 = sqcxyz[2]; + + hypre_BoxLoop1ReductionBegin(ndim, loop_size, w_dbox, + start, ustride, wi, cdb_0) + { + cdb_0 += w_data[0][wi]; + } + hypre_BoxLoop1ReductionEnd(wi, cdb_0) + + hypre_BoxLoop1ReductionBegin(ndim, loop_size, w_dbox, + start, ustride, wi, cdb_1) + { + cdb_1 += w_data[1][wi]; + } + hypre_BoxLoop1ReductionEnd(wi, cdb_1) + + hypre_BoxLoop1ReductionBegin(ndim, loop_size, w_dbox, + start, ustride, wi, cdb_2) + { + cdb_2 += w_data[2][wi]; + } + hypre_BoxLoop1ReductionEnd(wi, cdb_2) + + hypre_BoxLoop1ReductionBegin(ndim, loop_size, w_dbox, + start, ustride, wi, sqcdb_0) + { + sqcdb_0 += hypre_squared(w_data[0][wi]); + } + hypre_BoxLoop1ReductionEnd(wi, sqcdb_0) + + hypre_BoxLoop1ReductionBegin(ndim, loop_size, w_dbox, + start, ustride, wi, sqcdb_1) + { + sqcdb_1 += hypre_squared(w_data[1][wi]); + } + hypre_BoxLoop1ReductionEnd(wi, sqcdb_1) + + hypre_BoxLoop1ReductionBegin(ndim, loop_size, w_dbox, + start, ustride, wi, sqcdb_2) + { + sqcdb_2 += hypre_squared(w_data[2][wi]); + } + hypre_BoxLoop1ReductionEnd(wi, sqcdb_2) +#else +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + HYPRE_Real6 d6(cxyz[0], cxyz[1], cxyz[2], sqcxyz[0], sqcxyz[1], sqcxyz[2]); + ReduceSum sum6(d6); +#else + HYPRE_Real cdb_0 = cxyz[0], cdb_1 = cxyz[1], cdb_2 = cxyz[2]; + HYPRE_Real sqcdb_0 = sqcxyz[0], sqcdb_1 = sqcxyz[1], sqcdb_2 = sqcxyz[2]; + +#if defined(HYPRE_BOX_REDUCTION) +#undef HYPRE_BOX_REDUCTION +#endif + +#if defined(HYPRE_USING_DEVICE_OPENMP) +#define HYPRE_BOX_REDUCTION map(tofrom:cdb_0,cdb_1,cdb_2,sqcdb_0,sqcdb_1,sqcdb_2) reduction(+:cdb_0,cdb_1,cdb_2,sqcdb_0,sqcdb_1,sqcdb_2) +#else +#define HYPRE_BOX_REDUCTION reduction(+:cdb_0,cdb_1,cdb_2,sqcdb_0,sqcdb_1,sqcdb_2) +#endif + +#endif + hypre_BoxLoop1ReductionBegin(ndim, loop_size, w_dbox, + start, ustride, wi, sum6) + { +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + HYPRE_Real6 temp6(w_data[0][wi], w_data[1][wi], w_data[2][wi], + hypre_squared(w_data[0][wi]), + hypre_squared(w_data[1][wi]), + hypre_squared(w_data[2][wi])); + sum6 += temp6; +#else + cdb_0 += w_data[0][wi]; + cdb_1 += w_data[1][wi]; + cdb_2 += w_data[2][wi]; + + sqcdb_0 += hypre_squared(w_data[0][wi]); + sqcdb_1 += hypre_squared(w_data[1][wi]); + sqcdb_2 += hypre_squared(w_data[2][wi]); +#endif + } + hypre_BoxLoop1ReductionEnd(wi, sum6) +#endif + +#if !defined(HYPRE_USING_KOKKOS) && (defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP)) + HYPRE_Real6 temp6 = (HYPRE_Real6) sum6; + cxyz[0] = temp6.u; + cxyz[1] = temp6.v; + cxyz[2] = temp6.w; + sqcxyz[0] = temp6.x; + sqcxyz[1] = temp6.y; + sqcxyz[2] = temp6.z; +#else + cxyz[0] = (HYPRE_Real) cdb_0; + cxyz[1] = (HYPRE_Real) cdb_1; + cxyz[2] = (HYPRE_Real) cdb_2; + sqcxyz[0] = (HYPRE_Real) sqcdb_0; + sqcxyz[1] = (HYPRE_Real) sqcdb_1; + sqcxyz[2] = (HYPRE_Real) sqcdb_2; +#endif + } + else + { + for (d = 0; d < ndim; d++) + { +#if defined(HYPRE_USING_KOKKOS) || defined(HYPRE_USING_SYCL) + HYPRE_Real cdb = cxyz[d]; + HYPRE_Real sqcdb = sqcxyz[d]; + + hypre_BoxLoop1ReductionBegin(ndim, loop_size, w_dbox, + start, ustride, wi, cdb) + { + cdb += w_data[d][wi]; + } + hypre_BoxLoop1ReductionEnd(wi, cdb) + + hypre_BoxLoop1ReductionBegin(ndim, loop_size, w_dbox, + start, ustride, wi, sqcdb) + { + sqcdb += hypre_squared(w_data[d][wi]); + } + hypre_BoxLoop1ReductionEnd(wi, sqcdb) +#else +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + HYPRE_Real2 d2(cxyz[d], sqcxyz[d]); + ReduceSum sum2(d2); +#else + HYPRE_Real cdb = cxyz[d]; + HYPRE_Real sqcdb = sqcxyz[d]; + +#if defined(HYPRE_BOX_REDUCTION) +#undef HYPRE_BOX_REDUCTION +#endif + +#if defined(HYPRE_USING_DEVICE_OPENMP) +#define HYPRE_BOX_REDUCTION map(tofrom:cdb,sqcdb) reduction(+:cdb,sqcdb) +#else +#define HYPRE_BOX_REDUCTION reduction(+:cdb,sqcdb) +#endif + +#endif + hypre_BoxLoop1ReductionBegin(ndim, loop_size, w_dbox, + start, ustride, wi, sum2) + { +#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + HYPRE_Real2 temp2(w_data[d][wi], hypre_squared(w_data[d][wi])); + sum2 += temp2; +#else + cdb += w_data[d][wi]; + sqcdb += hypre_squared(w_data[d][wi]); +#endif + } + hypre_BoxLoop1ReductionEnd(wi, sum2) +#endif + +#if !defined(HYPRE_USING_KOKKOS) && (defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP)) + HYPRE_Real2 temp2 = (HYPRE_Real2) sum2; + cxyz[d] = temp2.x; + sqcxyz[d] = temp2.y; +#else + cxyz[d] = (HYPRE_Real) cdb; + sqcxyz[d] = (HYPRE_Real) sqcdb; +#endif + } /* for (d = 0; d < ndim; d++) */ + } + hypre_GpuProfilingPopRange(); // "Reduction" + } /* hypre_ForBoxI(i, compute_boxes) */ + + /* Free work arrays */ + for (d = 0; d < ndim; d++) + { + hypre_StructVectorDestroy(work[d]); + } + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_PFMGComputeDxyz + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGComputeDxyz( hypre_StructMatrix *A, + HYPRE_Real *dxyz, + HYPRE_Int *dxyz_flag ) +{ + MPI_Comm comm = hypre_StructMatrixComm(A); + hypre_StructGrid *grid = hypre_StructMatrixGrid(A); + + HYPRE_Int cte_coeff; + HYPRE_Real cxyz_max; + HYPRE_Real cxyz[HYPRE_MAXDIM]; + HYPRE_Real sqcxyz[HYPRE_MAXDIM]; + HYPRE_Real tcxyz[HYPRE_MAXDIM]; + HYPRE_Real mean[HYPRE_MAXDIM]; + HYPRE_Real deviation[HYPRE_MAXDIM]; + + HYPRE_Int d, ndim; + HYPRE_BigInt global_size; + + HYPRE_ANNOTATE_FUNC_BEGIN; + + /*---------------------------------------------------------- + * Exit if user gives dxyz different than zero + *----------------------------------------------------------*/ + + if ((dxyz[0] != 0) && (dxyz[1] != 0) && (dxyz[2] != 0)) + { + *dxyz_flag = 0; + + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; + } + + /*---------------------------------------------------------- + * Initialize some things + *----------------------------------------------------------*/ + + ndim = hypre_StructMatrixNDim(A); + cte_coeff = hypre_StructMatrixConstantCoefficient(A); + global_size = hypre_StructGridGlobalSize(grid); + + /* Compute cxyz and sqcxyz arrays */ + hypre_PFMGComputeCxyz(A, cxyz, sqcxyz); + + /*---------------------------------------------------------- + * Compute dxyz + *----------------------------------------------------------*/ + + if (cte_coeff) + { + /* all coefficients constant or variable diagonal */ + global_size = 1; + } + else + { + /* all coefficients vary with space */ + for (d = 0; d < ndim; d++) + { + tcxyz[d] = cxyz[d]; + } + hypre_MPI_Allreduce(tcxyz, cxyz, ndim, HYPRE_MPI_REAL, hypre_MPI_SUM, comm); + + for (d = 0; d < ndim; d++) + { + tcxyz[d] = sqcxyz[d]; + } + hypre_MPI_Allreduce(tcxyz, sqcxyz, ndim, HYPRE_MPI_REAL, hypre_MPI_SUM, comm); + } + + for (d = 0; d < ndim; d++) + { + mean[d] = cxyz[d] / (HYPRE_Real) global_size; + deviation[d] = sqcxyz[d] / (HYPRE_Real) global_size; + } + + cxyz_max = 0.0; + for (d = 0; d < ndim; d++) + { + cxyz_max = hypre_max(cxyz_max, cxyz[d]); + } + + if (cxyz_max == 0.0) + { + /* Do isotropic coarsening */ + for (d = 0; d < ndim; d++) + { + cxyz[d] = 1.0; + } + cxyz_max = 1.0; + } + + /* Set dxyz values that are scaled appropriately for the coarsening routine */ + for (d = 0; d < ndim; d++) + { + HYPRE_Real max_anisotropy = HYPRE_REAL_MAX / 1000; + if (cxyz[d] > (cxyz_max / max_anisotropy)) + { + cxyz[d] /= cxyz_max; + dxyz[d] = hypre_sqrt(1.0 / cxyz[d]); + } + else + { + dxyz[d] = hypre_sqrt(max_anisotropy); + } + } + + /* Set 'dxyz_flag' if the matrix-coefficient variation is "too large". + * This is used later to set relaxation weights for Jacobi. + * + * Use the "square of the coefficient of variation" = (sigma/mu)^2, + * where sigma is the standard deviation and mu is the mean. This is + * equivalent to computing (d - mu^2)/mu^2 where d is the average of + * the squares of the coefficients stored in 'deviation'. Care is + * taken to avoid dividing by zero when the mean is zero. */ + + *dxyz_flag = 0; + for (d = 0; d < ndim; d++) + { + deviation[d] -= mean[d] * mean[d]; + if ( deviation[d] > 0.1 * (mean[d]*mean[d]) ) + { + *dxyz_flag = 1; + break; + } + } + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PFMGCoarsen( hypre_Box *cbox, + hypre_Index periodic, + HYPRE_Int max_levels, + HYPRE_Int dxyz_flag, + HYPRE_Real *dxyz, + HYPRE_Int **cdir_l_ptr, + HYPRE_Int **active_l_ptr, + HYPRE_Real **relax_weights_ptr, + HYPRE_Int *num_levels ) +{ + HYPRE_Int ndim = hypre_BoxNDim(cbox); + HYPRE_Int *cdir_l; + HYPRE_Int *active_l; + HYPRE_Real *relax_weights; + + hypre_Index coarsen; + hypre_Index cindex; + hypre_Index stride; + + HYPRE_Real alpha, beta, min_dxyz; + HYPRE_Int d, l, cdir; + + HYPRE_ANNOTATE_FUNC_BEGIN; + + /* Allocate data */ + cdir_l = hypre_TAlloc(HYPRE_Int, max_levels, HYPRE_MEMORY_HOST); + active_l = hypre_TAlloc(HYPRE_Int, max_levels, HYPRE_MEMORY_HOST); + relax_weights = hypre_CTAlloc(HYPRE_Real, max_levels, HYPRE_MEMORY_HOST); + + /* Force relaxation on finest grid */ + hypre_SetIndex(coarsen, 1); + for (l = 0; l < max_levels; l++) + { + /* Initialize min_dxyz */ + min_dxyz = 1; + for (d = 0; d < ndim; d++) + { + min_dxyz += dxyz[d]; + } + + /* Determine cdir */ + cdir = -1; + alpha = 0.0; + for (d = 0; d < ndim; d++) + { + if ((hypre_BoxIMaxD(cbox, d) > hypre_BoxIMinD(cbox, d)) && + (dxyz[d] < min_dxyz)) + { + min_dxyz = dxyz[d]; + cdir = d; + } + alpha += 1.0 / (dxyz[d] * dxyz[d]); + } + relax_weights[l] = 1.0; + + /* If it's possible to coarsen, change relax_weights */ + beta = 0.0; + if (cdir != -1) + { + if (dxyz_flag || (ndim == 1)) + { + relax_weights[l] = 2.0 / 3.0; + } + else + { + for (d = 0; d < ndim; d++) + { + if (d != cdir) + { + beta += 1.0 / (dxyz[d] * dxyz[d]); + } + } + + /* determine level Jacobi weights */ + relax_weights[l] = 2.0 / (3.0 - beta / alpha); + } + + /* don't coarsen if a periodic direction and not divisible by 2 + or don't coarsen if we've reached max_levels*/ + if (((periodic[cdir]) && (periodic[cdir] % 2)) || l == (max_levels - 1)) + { + cdir = -1; + } + } + + /* stop coarsening */ + if (cdir == -1) + { + active_l[l] = 1; /* forces relaxation on coarsest grid */ + break; + } + + cdir_l[l] = cdir; + + if (hypre_IndexD(coarsen, cdir) != 0) + { + /* coarsened previously in this direction, relax level l */ + active_l[l] = 1; + hypre_SetIndex(coarsen, 0); + } + else + { + active_l[l] = 0; + } + hypre_IndexD(coarsen, cdir) = 1; + + /* set cindex and stride */ + hypre_PFMGSetCIndex(cdir, cindex); + hypre_PFMGSetStride(cdir, stride); + + /* update dxyz and coarsen cbox*/ + dxyz[cdir] *= 2; + hypre_ProjectBox(cbox, cindex, stride); + hypre_StructMapFineToCoarse(hypre_BoxIMin(cbox), cindex, stride, hypre_BoxIMin(cbox)); + hypre_StructMapFineToCoarse(hypre_BoxIMax(cbox), cindex, stride, hypre_BoxIMax(cbox)); + + /* update periodic */ + periodic[cdir] /= 2; + } + *num_levels = l + 1; + + *cdir_l_ptr = cdir_l; + *active_l_ptr = active_l; + *relax_weights_ptr = relax_weights; + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} diff --git a/src/struct_ls/pfmg_relax.c b/src/struct_ls/pfmg_relax.c index 04394a3167..ae758a7010 100644 --- a/src/struct_ls/pfmg_relax.c +++ b/src/struct_ls/pfmg_relax.c @@ -23,14 +23,14 @@ typedef struct *--------------------------------------------------------------------------*/ void * -hypre_PFMGRelaxCreate( MPI_Comm comm ) +hypre_PFMGRelaxCreate( MPI_Comm comm ) { hypre_PFMGRelaxData *pfmg_relax_data; pfmg_relax_data = hypre_CTAlloc(hypre_PFMGRelaxData, 1, HYPRE_MEMORY_HOST); - (pfmg_relax_data -> relax_data) = hypre_PointRelaxCreate(comm); + (pfmg_relax_data -> relax_data) = hypre_StructJacobiCreate(comm); (pfmg_relax_data -> rb_relax_data) = hypre_RedBlackGSCreate(comm); - (pfmg_relax_data -> relax_type) = 0; /* Weighted Jacobi */ + (pfmg_relax_data -> relax_type) = 0; /* Weighted Jacobi */ (pfmg_relax_data -> jacobi_weight) = 0.0; return (void *) pfmg_relax_data; @@ -46,7 +46,7 @@ hypre_PFMGRelaxDestroy( void *pfmg_relax_vdata ) if (pfmg_relax_data) { - hypre_PointRelaxDestroy(pfmg_relax_data -> relax_data); + hypre_StructJacobiDestroy(pfmg_relax_data -> relax_data); hypre_RedBlackGSDestroy(pfmg_relax_data -> rb_relax_data); hypre_TFree(pfmg_relax_data, HYPRE_MEMORY_HOST); } @@ -61,24 +61,25 @@ HYPRE_Int hypre_PFMGRelax( void *pfmg_relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, - hypre_StructVector *x ) + hypre_StructVector *x ) { - 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_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_ANNOTATE_FUNC_BEGIN; switch (relax_type) { case 0: case 1: - hypre_PointRelax((pfmg_relax_data -> relax_data), A, b, x); + hypre_StructJacobiSolve((pfmg_relax_data -> relax_data), A, b, x); break; case 2: case 3: if (constant_coefficient) { - hypre_RedBlackConstantCoefGS((pfmg_relax_data -> rb_relax_data), - A, b, x); + hypre_RedBlackConstantCoefGS((pfmg_relax_data -> rb_relax_data), A, b, x); } else { @@ -88,6 +89,8 @@ hypre_PFMGRelax( void *pfmg_relax_vdata, break; } + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } @@ -98,17 +101,17 @@ HYPRE_Int hypre_PFMGRelaxSetup( void *pfmg_relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, - hypre_StructVector *x ) + hypre_StructVector *x ) { - 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_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); switch (relax_type) { case 0: case 1: - hypre_PointRelaxSetup((pfmg_relax_data -> relax_data), A, b, x); + hypre_StructJacobiSetup((pfmg_relax_data -> relax_data), A, b, x); break; case 2: case 3: @@ -118,7 +121,7 @@ hypre_PFMGRelaxSetup( void *pfmg_relax_vdata, if (relax_type == 1) { - hypre_PointRelaxSetWeight(pfmg_relax_data -> relax_data, jacobi_weight); + hypre_StructJacobiSetWeight(pfmg_relax_data -> relax_data, jacobi_weight); } return hypre_error_flag; @@ -128,11 +131,11 @@ hypre_PFMGRelaxSetup( void *pfmg_relax_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_PFMGRelaxSetType( void *pfmg_relax_vdata, - HYPRE_Int relax_type ) +hypre_PFMGRelaxSetType( void *pfmg_relax_vdata, + HYPRE_Int relax_type ) { hypre_PFMGRelaxData *pfmg_relax_data = (hypre_PFMGRelaxData *)pfmg_relax_vdata; - void *relax_data = (pfmg_relax_data -> relax_data); + void *relax_data = (pfmg_relax_data -> relax_data); (pfmg_relax_data -> relax_type) = relax_type; @@ -140,15 +143,7 @@ hypre_PFMGRelaxSetType( void *pfmg_relax_vdata, { case 0: /* Jacobi */ { - hypre_Index stride; - hypre_Index indices[1]; - - hypre_PointRelaxSetWeight(relax_data, 1.0); - hypre_PointRelaxSetNumPointsets(relax_data, 1); - - hypre_SetIndex3(stride, 1, 1, 1); - hypre_SetIndex3(indices[0], 0, 0, 0); - hypre_PointRelaxSetPointset(relax_data, 0, 1, stride, indices); + hypre_StructJacobiSetWeight(relax_data, 1.0); } break; @@ -164,12 +159,12 @@ hypre_PFMGRelaxSetType( void *pfmg_relax_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_PFMGRelaxSetJacobiWeight(void *pfmg_relax_vdata, - HYPRE_Real weight) +hypre_PFMGRelaxSetJacobiWeight( void *pfmg_relax_vdata, + HYPRE_Real weight ) { hypre_PFMGRelaxData *pfmg_relax_data = (hypre_PFMGRelaxData *)pfmg_relax_vdata; - (pfmg_relax_data -> jacobi_weight) = weight; + (pfmg_relax_data -> jacobi_weight) = weight; return hypre_error_flag; } @@ -178,10 +173,10 @@ hypre_PFMGRelaxSetJacobiWeight(void *pfmg_relax_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_PFMGRelaxSetPreRelax( void *pfmg_relax_vdata ) +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); + HYPRE_Int relax_type = (pfmg_relax_data -> relax_type); switch (relax_type) { @@ -205,10 +200,10 @@ hypre_PFMGRelaxSetPreRelax( void *pfmg_relax_vdata ) *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_PFMGRelaxSetPostRelax( void *pfmg_relax_vdata ) +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); + HYPRE_Int relax_type = (pfmg_relax_data -> relax_type); switch (relax_type) { @@ -232,12 +227,12 @@ hypre_PFMGRelaxSetPostRelax( void *pfmg_relax_vdata ) *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_PFMGRelaxSetTol( void *pfmg_relax_vdata, - HYPRE_Real tol ) +hypre_PFMGRelaxSetTol( void *pfmg_relax_vdata, + HYPRE_Real tol ) { hypre_PFMGRelaxData *pfmg_relax_data = (hypre_PFMGRelaxData *)pfmg_relax_vdata; - hypre_PointRelaxSetTol((pfmg_relax_data -> relax_data), tol); + hypre_StructJacobiSetTol((pfmg_relax_data -> relax_data), tol); hypre_RedBlackGSSetTol((pfmg_relax_data -> rb_relax_data), tol); return hypre_error_flag; @@ -247,12 +242,12 @@ hypre_PFMGRelaxSetTol( void *pfmg_relax_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_PFMGRelaxSetMaxIter( void *pfmg_relax_vdata, - HYPRE_Int max_iter ) +hypre_PFMGRelaxSetMaxIter( void *pfmg_relax_vdata, + HYPRE_Int max_iter ) { hypre_PFMGRelaxData *pfmg_relax_data = (hypre_PFMGRelaxData *)pfmg_relax_vdata; - hypre_PointRelaxSetMaxIter((pfmg_relax_data -> relax_data), max_iter); + hypre_StructJacobiSetMaxIter((pfmg_relax_data -> relax_data), max_iter); hypre_RedBlackGSSetMaxIter((pfmg_relax_data -> rb_relax_data), max_iter); return hypre_error_flag; @@ -262,12 +257,12 @@ hypre_PFMGRelaxSetMaxIter( void *pfmg_relax_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_PFMGRelaxSetZeroGuess( void *pfmg_relax_vdata, - HYPRE_Int zero_guess ) +hypre_PFMGRelaxSetZeroGuess( void *pfmg_relax_vdata, + HYPRE_Int zero_guess ) { hypre_PFMGRelaxData *pfmg_relax_data = (hypre_PFMGRelaxData *)pfmg_relax_vdata; - hypre_PointRelaxSetZeroGuess((pfmg_relax_data -> relax_data), zero_guess); + hypre_StructJacobiSetZeroGuess((pfmg_relax_data -> relax_data), zero_guess); hypre_RedBlackGSSetZeroGuess((pfmg_relax_data -> rb_relax_data), zero_guess); return hypre_error_flag; @@ -278,12 +273,11 @@ hypre_PFMGRelaxSetZeroGuess( void *pfmg_relax_vdata, HYPRE_Int hypre_PFMGRelaxSetTempVec( void *pfmg_relax_vdata, - hypre_StructVector *t ) + hypre_StructVector *t ) { hypre_PFMGRelaxData *pfmg_relax_data = (hypre_PFMGRelaxData *)pfmg_relax_vdata; - hypre_PointRelaxSetTempVec((pfmg_relax_data -> relax_data), t); + hypre_StructJacobiSetTempVec((pfmg_relax_data -> relax_data), t); return hypre_error_flag; } - diff --git a/src/struct_ls/pfmg_setup.c b/src/struct_ls/pfmg_setup.c index f6384d989a..3992e5e046 100644 --- a/src/struct_ls/pfmg_setup.c +++ b/src/struct_ls/pfmg_setup.c @@ -9,53 +9,6 @@ #include "_hypre_struct_mv.hpp" #include "pfmg.h" -#include -#define DEBUG 0 - -#define hypre_PFMGSetCIndex(cdir, cindex) \ - { \ - hypre_SetIndex3(cindex, 0, 0, 0); \ - hypre_IndexD(cindex, cdir) = 0; \ - } - -#define hypre_PFMGSetFIndex(cdir, findex) \ - { \ - hypre_SetIndex3(findex, 0, 0, 0); \ - hypre_IndexD(findex, cdir) = 1; \ - } - -#define hypre_PFMGSetStride(cdir, stride) \ - { \ - hypre_SetIndex3(stride, 1, 1, 1); \ - hypre_IndexD(stride, cdir) = 2; \ - } - -#ifdef MAX_DEPTH -#undef MAX_DEPTH -#endif -#define MAX_DEPTH 7 - -HYPRE_Int hypre_StructGetNonzeroDirection(hypre_Index shape) -{ - HYPRE_Int Astenc = 0; - /* x-direction */ - if (hypre_IndexD(shape, 0)) - { - Astenc += 1; - } - /* y-direction */ - else if (hypre_IndexD(shape, 1)) - { - Astenc += 10; - } - /* z-direction */ - else if (hypre_IndexD(shape, 2)) - { - Astenc += 100; - } - return Astenc; -} - /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -67,38 +20,27 @@ hypre_PFMGSetup( void *pfmg_vdata, { hypre_PFMGData *pfmg_data = (hypre_PFMGData *) pfmg_vdata; - MPI_Comm comm = (pfmg_data -> comm); - - HYPRE_Int relax_type = (pfmg_data -> relax_type); + 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_Real jacobi_weight = (pfmg_data -> jacobi_weight); - HYPRE_Int skip_relax = (pfmg_data -> skip_relax); - HYPRE_Real *dxyz = (pfmg_data -> dxyz); + HYPRE_Real jacobi_weight = (pfmg_data -> jacobi_weight); + HYPRE_Int skip_relax = (pfmg_data -> skip_relax); + HYPRE_Real *dxyz = (pfmg_data -> dxyz); + HYPRE_Int max_iter = (pfmg_data -> max_iter); + HYPRE_Int matmult_type = (pfmg_data -> matmult_type); HYPRE_Int rap_type; - - HYPRE_Int max_iter; HYPRE_Int max_levels; - HYPRE_Int num_levels; hypre_Index cindex; - hypre_Index findex; hypre_Index stride; - - hypre_Index coarsen; + hypre_Index periodic; HYPRE_Int *cdir_l; HYPRE_Int *active_l; hypre_StructGrid **grid_l; - hypre_StructGrid **P_grid_l; - HYPRE_Real *data; - HYPRE_Real *data_const; - HYPRE_Int data_size = 0; - HYPRE_Int data_size_const = 0; HYPRE_Real *relax_weights; - HYPRE_Real *mean, *deviation; - HYPRE_Real alpha, beta; hypre_StructMatrix **A_l; hypre_StructMatrix **P_l; @@ -106,6 +48,8 @@ hypre_PFMGSetup( void *pfmg_vdata, hypre_StructVector **b_l; hypre_StructVector **x_l; + hypre_StructMatmultData **Ammdata_l; + /* temp vectors */ hypre_StructVector **tx_l; hypre_StructVector **r_l; @@ -117,244 +61,77 @@ hypre_PFMGSetup( void *pfmg_vdata, void **interp_data_l; hypre_StructGrid *grid; - HYPRE_Int ndim; hypre_Box *cbox; - HYPRE_Real min_dxyz; - HYPRE_Int cdir, periodic, cmaxsize; - HYPRE_Int d, l; + HYPRE_Int cdir, cmaxsize; + HYPRE_Int l; HYPRE_Int dxyz_flag; HYPRE_Int b_num_ghost[] = {0, 0, 0, 0, 0, 0}; HYPRE_Int x_num_ghost[] = {1, 1, 1, 1, 1, 1}; + HYPRE_Int v_memory_mode = 2; + HYPRE_Int zero_init; + char region_name[1024]; #if DEBUG char filename[255]; #endif - HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(A); - HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_sprintf(region_name, "%s", "PFMG-Init"); + HYPRE_ANNOTATE_REGION_BEGIN("%s", region_name); + hypre_GpuProfilingPushRange(region_name); + hypre_MemoryPrintUsage(comm, hypre_HandleLogLevel(hypre_handle()), "PFMG setup begin", 0); - /*----------------------------------------------------- - * Set up coarse grids - *-----------------------------------------------------*/ - - grid = hypre_StructMatrixGrid(A); - ndim = hypre_StructGridNDim(grid); - - /* Compute a new max_levels value based on the grid */ - cbox = hypre_BoxDuplicate(hypre_StructGridBoundingBox(grid)); - max_levels = 1; - for (d = 0; d < ndim; d++) - { - max_levels += hypre_Log2(hypre_BoxSizeD(cbox, d)) + 2; - } - - if ((pfmg_data -> max_levels) > 0) + /* RDF: For now, set memory mode to 0 if using R/B GS relaxation */ + if (relax_type > 1) { - max_levels = hypre_min(max_levels, (pfmg_data -> max_levels)); + v_memory_mode = 0; } - (pfmg_data -> max_levels) = max_levels; - - /* compute dxyz */ - dxyz_flag = 0; - if ((dxyz[0] == 0) || (dxyz[1] == 0) || (dxyz[2] == 0)) - { - mean = hypre_CTAlloc(HYPRE_Real, 3, HYPRE_MEMORY_HOST); - deviation = hypre_CTAlloc(HYPRE_Real, 3, HYPRE_MEMORY_HOST); - hypre_PFMGComputeDxyz(A, dxyz, mean, deviation); - for (d = 0; d < ndim; d++) - { - /* Set 'dxyz_flag' if the matrix-coefficient variation is "too large". - * This is used later to set relaxation weights for Jacobi. - * - * Use the "square of the coefficient of variation" = (sigma/mu)^2, - * where sigma is the standard deviation and mu is the mean. This is - * equivalent to computing (d - mu^2)/mu^2 where d is the average of - * 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]) ) - { - dxyz_flag = 1; - break; - } - } + /* Set flag for initializing matrix/vector entries to zeroes - hypre_TFree(mean, HYPRE_MEMORY_HOST); - hypre_TFree(deviation, HYPRE_MEMORY_HOST); - } + TODO (VPM): due to TEST_struct regressions, this feature is + disabled internally despite the value of zero_init being set below */ +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1( hypre_StructMatrixMemoryLocation(A) ); - grid_l = hypre_TAlloc(hypre_StructGrid *, max_levels, HYPRE_MEMORY_HOST); - hypre_StructGridRef(grid, &grid_l[0]); - P_grid_l = hypre_TAlloc(hypre_StructGrid *, max_levels, HYPRE_MEMORY_HOST); - P_grid_l[0] = NULL; - cdir_l = hypre_TAlloc(HYPRE_Int, max_levels, HYPRE_MEMORY_HOST); - active_l = hypre_TAlloc(HYPRE_Int, max_levels, HYPRE_MEMORY_HOST); - relax_weights = hypre_CTAlloc(HYPRE_Real, max_levels, HYPRE_MEMORY_HOST); - hypre_SetIndex3(coarsen, 1, 1, 1); /* forces relaxation on finest grid */ - -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - data_location = hypre_StructGridDataLocation(grid); - if (data_location != HYPRE_MEMORY_HOST) + if (exec == HYPRE_EXEC_DEVICE) { - num_level_GPU = max_levels; + zero_init = 0; } else - { - num_level_GPU = 0; - device_level = 0; - } #endif - - for (l = 0; ; l++) { - /* determine cdir */ - min_dxyz = dxyz[0] + dxyz[1] + dxyz[2] + 1; - cdir = -1; - alpha = 0.0; - for (d = 0; d < ndim; d++) - { - if ((hypre_BoxIMaxD(cbox, d) > hypre_BoxIMinD(cbox, d)) && - (dxyz[d] < min_dxyz)) - { - min_dxyz = dxyz[d]; - cdir = d; - } - alpha += 1.0 / (dxyz[d] * dxyz[d]); - } - relax_weights[l] = 1.0; - - /* If it's possible to coarsen, change relax_weights */ - beta = 0.0; - if (cdir != -1) - { - if (dxyz_flag) - { - relax_weights[l] = 2.0 / 3.0; - } - - else - { - for (d = 0; d < ndim; d++) - { - if (d != cdir) - { - beta += 1.0 / (dxyz[d] * dxyz[d]); - } - } - if (beta == alpha) - { - alpha = 0.0; - } - else - { - alpha = beta / alpha; - } - - /* determine level Jacobi weights */ - if (ndim > 1) - { - relax_weights[l] = 2.0 / (3.0 - alpha); - } - else - { - relax_weights[l] = 2.0 / 3.0; /* always 2/3 for 1-d */ - } - } - } - - if (cdir != -1) - { - /* don't coarsen if a periodic direction and not divisible by 2 */ - periodic = hypre_IndexD(hypre_StructGridPeriodic(grid_l[l]), cdir); - if ((periodic) && (periodic % 2)) - { - cdir = -1; - } - - /* don't coarsen if we've reached max_levels */ - if (l == (max_levels - 1)) - { - cdir = -1; - } - } - - /* stop coarsening */ - if (cdir == -1) - { - active_l[l] = 1; /* forces relaxation on coarsest grid */ - cmaxsize = 0; - for (d = 0; d < ndim; d++) - { - cmaxsize = hypre_max(cmaxsize, hypre_BoxSizeD(cbox, d)); - } - - break; - } + zero_init = 1; + } - cdir_l[l] = cdir; + /*----------------------------------------------------- + * Set up coarse grids + *-----------------------------------------------------*/ - if (hypre_IndexD(coarsen, cdir) != 0) - { - /* coarsened previously in this direction, relax level l */ - active_l[l] = 1; - hypre_SetIndex3(coarsen, 0, 0, 0); - hypre_IndexD(coarsen, cdir) = 1; - } - else - { - active_l[l] = 0; - hypre_IndexD(coarsen, cdir) = 1; - } + grid = hypre_StructMatrixGrid(A); - /* set cindex, findex, and stride */ - hypre_PFMGSetCIndex(cdir, cindex); - hypre_PFMGSetFIndex(cdir, findex); - hypre_PFMGSetStride(cdir, stride); + /* Initialize periodic */ + hypre_CopyIndex(hypre_StructGridPeriodic(grid), periodic); - /* update dxyz and coarsen cbox*/ - dxyz[cdir] *= 2; - hypre_ProjectBox(cbox, cindex, stride); - hypre_StructMapFineToCoarse(hypre_BoxIMin(cbox), cindex, stride, - hypre_BoxIMin(cbox)); - hypre_StructMapFineToCoarse(hypre_BoxIMax(cbox), cindex, stride, - hypre_BoxIMax(cbox)); - - /* build the interpolation grid */ - 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]); -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - 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]); - if (max_box_size < HYPRE_MIN_GPU_SIZE) - { - 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) - { - num_level_GPU = l + 1; - data_location = HYPRE_MEMORY_HOST; - } - hypre_StructGridDataLocation(grid_l[l + 1]) = data_location; -#endif + /* Compute a new max_levels value based on the grid */ + hypre_PFMGComputeMaxLevels(grid, &max_levels); + if ((pfmg_data -> max_levels) > 0) + { + max_levels = hypre_min(max_levels, (pfmg_data -> max_levels)); } + (pfmg_data -> max_levels) = max_levels; - num_levels = l + 1; + /* compute dxyz */ + hypre_PFMGComputeDxyz(A, dxyz, &dxyz_flag); - /* free up some things */ + /* Run coarsening */ + cbox = hypre_BoxClone(hypre_StructGridBoundingBox(grid)); + hypre_PFMGCoarsen(cbox, periodic, max_levels, dxyz_flag, dxyz, + &cdir_l, &active_l, &relax_weights, &num_levels); + cmaxsize = hypre_BoxMaxSize(cbox); hypre_BoxDestroy(cbox); /* set all levels active if skip_relax = 0 */ @@ -366,210 +143,189 @@ hypre_PFMGSetup( void *pfmg_vdata, } } - (pfmg_data -> num_levels) = num_levels; - (pfmg_data -> cdir_l) = cdir_l; - (pfmg_data -> grid_l) = grid_l; - (pfmg_data -> P_grid_l) = P_grid_l; + (pfmg_data -> num_levels) = num_levels; + (pfmg_data -> cdir_l) = cdir_l; /*----------------------------------------------------- * Set up matrix and vector structures *-----------------------------------------------------*/ - /*----------------------------------------------------- - * Modify the rap_type if red-black Gauss-Seidel is - * used. Red-black gs is used only in the non-Galerkin - * case. - *-----------------------------------------------------*/ + /* RDF: Rework this for vectors to avoid data copies in Resize(), similar to + * what is being done for matrices. */ + + /* Modify the rap_type if red-black Gauss-Seidel is used. Red-black gs is + * used only in the non-Galerkin case. */ if (relax_type == 2 || relax_type == 3) /* red-black gs */ { (pfmg_data -> rap_type) = 1; } rap_type = (pfmg_data -> rap_type); - A_l = hypre_TAlloc(hypre_StructMatrix *, num_levels, HYPRE_MEMORY_HOST); - P_l = hypre_TAlloc(hypre_StructMatrix *, num_levels - 1, HYPRE_MEMORY_HOST); - RT_l = hypre_TAlloc(hypre_StructMatrix *, num_levels - 1, HYPRE_MEMORY_HOST); - b_l = hypre_TAlloc(hypre_StructVector *, num_levels, HYPRE_MEMORY_HOST); - x_l = hypre_TAlloc(hypre_StructVector *, num_levels, HYPRE_MEMORY_HOST); - tx_l = hypre_TAlloc(hypre_StructVector *, num_levels, HYPRE_MEMORY_HOST); - r_l = tx_l; - e_l = tx_l; + grid_l = hypre_TAlloc(hypre_StructGrid *, num_levels, HYPRE_MEMORY_HOST); + A_l = hypre_TAlloc(hypre_StructMatrix *, num_levels, HYPRE_MEMORY_HOST); + P_l = hypre_TAlloc(hypre_StructMatrix *, num_levels - 1, HYPRE_MEMORY_HOST); + RT_l = hypre_TAlloc(hypre_StructMatrix *, num_levels - 1, HYPRE_MEMORY_HOST); + b_l = hypre_TAlloc(hypre_StructVector *, num_levels, HYPRE_MEMORY_HOST); + x_l = hypre_TAlloc(hypre_StructVector *, num_levels, HYPRE_MEMORY_HOST); + tx_l = hypre_TAlloc(hypre_StructVector *, num_levels, HYPRE_MEMORY_HOST); + r_l = tx_l; + e_l = tx_l; + Ammdata_l = hypre_TAlloc(hypre_StructMatmultData *, num_levels, HYPRE_MEMORY_HOST); + + hypre_StructGridRef(grid, &grid_l[0]); A_l[0] = hypre_StructMatrixRef(A); b_l[0] = hypre_StructVectorRef(b); x_l[0] = hypre_StructVectorRef(x); + hypre_StructVectorSetMemoryMode(x_l[0], v_memory_mode); tx_l[0] = hypre_StructVectorCreate(comm, grid_l[0]); + hypre_StructVectorSetMemoryMode(tx_l[0], v_memory_mode); hypre_StructVectorSetNumGhost(tx_l[0], x_num_ghost); - hypre_StructVectorInitializeShell(tx_l[0]); + hypre_StructVectorInitialize(tx_l[0], zero_init); + hypre_StructVectorAssemble(tx_l[0]); + + // /* RDF AP Debug */ + // hypre_StructAssumedPartitionPrint("zAP", hypre_BoxManAssumedPartition( + // hypre_StructGridBoxMan(grid_l[0]))); - hypre_StructVectorSetDataSize(tx_l[0], &data_size, &data_size_const); + /* Use hypre_StructMatrixInitializeShell() and InitializeData() below to do + * PtAPSetup() (and RTtAPSetup) first, then use MatmulMultiply() to allocate + * data and complete the multiply. This will avoid copies. */ + + /* First set up the matrix shells (no data allocated) to adjust data spaces + * without requiring memory copies */ for (l = 0; l < (num_levels - 1); l++) { cdir = cdir_l[l]; - 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]); + hypre_PFMGSetCIndex(cdir, cindex); + hypre_PFMGSetStride(cdir, stride); + + /* set up interpolation and restriction operators */ + P_l[l] = hypre_PFMGCreateInterpOp(A_l[l], cdir, stride, rap_type); + RT_l[l] = P_l[l]; +#if 0 /* TODO: Allow RT != P */ + if (nonsymmetric_cycle) + { + RT_l[l] = hypre_PFMGCreateRestrictOp(A_l[l], cdir, stride); + } +#endif + HYPRE_StructMatrixSetTranspose(RT_l[l], 1); - if (hypre_StructMatrixSymmetric(A)) + if (rap_type == 0) { - RT_l[l] = P_l[l]; + hypre_StructMatrixInitializeShell(P_l[l]); +#if 0 /* TODO: Allow RT != P */ + if (nonsymmetric_cycle) + { + hypre_StructMatrixInitializeShell(RT_l[l]); + } +#endif + if (RT_l[l] != P_l[l]) + { + /* If restriction is not the same as interpolation, compute RAP */ + hypre_StructMatrixRTtAPSetup(matmult_type, RT_l[l], A_l[l], P_l[l], &Ammdata_l[l + 1], &A_l[l + 1]); + } + else + { + hypre_StructMatrixPtAPSetup(matmult_type, A_l[l], P_l[l], &Ammdata_l[l + 1], &A_l[l + 1]); + } + hypre_StructGridRef(hypre_StructMatrixGrid(A_l[l + 1]), &grid_l[l + 1]); } else { - RT_l[l] = P_l[l]; -#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); - hypre_StructMatrixInitializeShell(RT_l[l]); - data_size += hypre_StructMatrixDataSize(RT_l[l]); - data_size_const += hypre_StructMatrixDataConstSize(RT_l[l]); + hypre_StructMatrixInitializeShell(P_l[l]); + hypre_StructMatrixInitializeData(P_l[l], zero_init, NULL); + hypre_PFMGSetupInterpOp(P_l[l], A_l[l], cdir); +#if 0 /* TODO: Allow RT != P */ + if (nonsymmetric_cycle) + { + hypre_StructMatrixInitializeShell(RT_l[l]); + hypre_StructMatrixInitializeData(RT_l[l], zero_init, NULL); + hypre_PFMGSetupRestrictOp(RT_l[l], A_l[l], cdir); + } #endif + + /* RDF: The coarse grid should be computed in CreateRAPOp() */ + hypre_StructCoarsen(grid_l[l], cindex, stride, 1, &grid_l[l + 1]); + hypre_StructGridAssemble(grid_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]); + hypre_StructMatrixInitializeData(A_l[l + 1], zero_init, NULL); + hypre_PFMGSetupRAPOp(RT_l[l], A_l[l], P_l[l], + cdir, cindex, stride, rap_type, + A_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]); + // /* RDF AP Debug */ + // hypre_StructAssumedPartitionPrint("zAP", hypre_BoxManAssumedPartition( + // hypre_StructGridBoxMan(grid_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); + hypre_StructVectorInitialize(b_l[l + 1], zero_init); + hypre_StructVectorAssemble(b_l[l + 1]); x_l[l + 1] = hypre_StructVectorCreate(comm, grid_l[l + 1]); + hypre_StructVectorSetMemoryMode(x_l[l + 1], v_memory_mode); 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); + hypre_StructVectorInitialize(x_l[l + 1], zero_init); + hypre_StructVectorAssemble(x_l[l + 1]); tx_l[l + 1] = hypre_StructVectorCreate(comm, grid_l[l + 1]); + hypre_StructVectorSetMemoryMode(tx_l[l + 1], v_memory_mode); 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) - { - hypre_StructVectorSetDataSize(tx_l[l + 1], &data_size, &data_size_const); - } -#endif + hypre_StructVectorInitialize(tx_l[l + 1], zero_init); + hypre_StructVectorAssemble(tx_l[l + 1]); } + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_REGION_END("%s", region_name); - 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; - -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - data_location = hypre_StructGridDataLocation(grid_l[0]); - if (data_location != HYPRE_MEMORY_HOST) - { - hypre_StructVectorInitializeData(tx_l[0], data); - hypre_StructVectorAssemble(tx_l[0]); - data += hypre_StructVectorDataSize(tx_l[0]); - } - else - { - hypre_StructVectorInitializeData(tx_l[0], data_const); - hypre_StructVectorAssemble(tx_l[0]); - data_const += hypre_StructVectorDataSize(tx_l[0]); - } -#else - hypre_StructVectorInitializeData(tx_l[0], data); - hypre_StructVectorAssemble(tx_l[0]); - data += hypre_StructVectorDataSize(tx_l[0]); -#endif + hypre_sprintf(region_name, "%s", "PFMG-Setup"); + HYPRE_ANNOTATE_REGION_BEGIN("%s", region_name); + hypre_GpuProfilingPushRange(region_name); + /* Now finish up the matrices */ for (l = 0; l < (num_levels - 1); l++) { - hypre_StructMatrixInitializeData(P_l[l], data, data_const); - data += hypre_StructMatrixDataSize(P_l[l]); - data_const += hypre_StructMatrixDataConstSize(P_l[l]); - -#if 0 - /* Allow R != PT for non symmetric case */ - if (!hypre_StructMatrixSymmetric(A)) - { - hypre_StructMatrixInitializeData(RT_l[l], data, data_const); - data += hypre_StructMatrixDataSize(RT_l[l]); - data_const += hypre_StructMatrixDataConstSize(RT_l[l]); - } -#endif - -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - if (l + 1 == num_level_GPU) - { - data_location = HYPRE_MEMORY_HOST; - } -#endif + HYPRE_ANNOTATE_MGLEVEL_BEGIN(l); + hypre_sprintf(region_name, "%s-%d", "PFMG-Level", l); + hypre_GpuProfilingPushRange(region_name); - hypre_StructMatrixInitializeData(A_l[l + 1], data, data_const); - data += hypre_StructMatrixDataSize(A_l[l + 1]); - data_const += hypre_StructMatrixDataConstSize(A_l[l + 1]); + cdir = cdir_l[l]; -#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]); - } - else + if (rap_type == 0) { - 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_StructMatrixInitializeData(P_l[l], zero_init, NULL); + hypre_PFMGSetupInterpOp(P_l[l], A_l[l], cdir); +#if 0 /* TODO: Allow RT != P */ + if (nonsymmetric_cycle) { - hypre_StructVectorInitializeData(tx_l[l + 1], data_const); - hypre_StructVectorAssemble(tx_l[l + 1]); - data_const += hypre_StructVectorDataSize(tx_l[l + 1]); + hypre_StructMatrixInitializeData(RT_l[l], zero_init, NULL); + hypre_PFMGSetupRestrictOp(RT_l[l], A_l[l], cdir); } - hypre_StructVectorInitializeData(tx_l[l + 1], hypre_StructVectorData(tx_l[num_level_GPU])); - hypre_StructVectorAssemble(tx_l[l + 1]); +#endif + hypre_StructMatmultMultiply(Ammdata_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(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]); -#endif + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_MGLEVEL_END(l); } - (pfmg_data -> A_l) = A_l; - (pfmg_data -> P_l) = P_l; - (pfmg_data -> RT_l) = RT_l; - (pfmg_data -> b_l) = b_l; - (pfmg_data -> x_l) = x_l; - (pfmg_data -> tx_l) = tx_l; - (pfmg_data -> r_l) = r_l; - (pfmg_data -> e_l) = e_l; + hypre_TFree(Ammdata_l, HYPRE_MEMORY_HOST); + + (pfmg_data -> grid_l) = grid_l; + (pfmg_data -> A_l) = A_l; + (pfmg_data -> P_l) = P_l; + (pfmg_data -> RT_l) = RT_l; + (pfmg_data -> b_l) = b_l; + (pfmg_data -> x_l) = x_l; + (pfmg_data -> tx_l) = tx_l; + (pfmg_data -> r_l) = r_l; + (pfmg_data -> e_l) = e_l; /*----------------------------------------------------- * Set up multigrid operators and call setup routines @@ -583,74 +339,30 @@ 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) - { - hypre_SetDeviceOff(); - } -#endif cdir = cdir_l[l]; - hypre_PFMGSetCIndex(cdir, cindex); - hypre_PFMGSetFIndex(cdir, findex); - hypre_PFMGSetStride(cdir, stride); - - /* set up interpolation operator */ - hypre_PFMGSetupInterpOp(A_l[l], cdir, findex, stride, P_l[l], rap_type); + /* set up the interpolation operator */ + interp_data_l[l] = hypre_StructMatvecCreate(); + hypre_StructMatvecSetup(interp_data_l[l], P_l[l], x_l[l + 1]); /* set up the restriction operator */ -#if 0 - /* Allow R != PT for non symmetric case */ - if (!hypre_StructMatrixSymmetric(A)) - hypre_PFMGSetupRestrictOp(A_l[l], tx_l[l], - cdir, cindex, stride, RT_l[l]); -#endif - - /* 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]); - - /* 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], - 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], - cindex, findex, stride); + restrict_data_l[l] = hypre_StructMatvecCreate(); + hypre_StructMatvecSetTranspose(restrict_data_l[l], 1); + hypre_StructMatvecSetup(restrict_data_l[l], RT_l[l], r_l[l]); HYPRE_ANNOTATE_MGLEVEL_END(l); } -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - if (l == num_level_GPU) - { - hypre_SetDeviceOff(); - } -#endif - - /*----------------------------------------------------- - * Check for zero diagonal on coarsest grid, occurs with - * singular problems like full Neumann or full periodic. - * Note that a processor with zero diagonal will set - * active_l =0, other processors will not. This is OK - * as we only want to avoid the division by zero on the - * one processor which owns the single coarse grid - * point. - *-----------------------------------------------------*/ - - if ( hypre_ZeroDiagonal(A_l[l])) + /* Check for zero diagonal on coarsest grid, occurs with singular problems + * like full Neumann or full periodic. Note that a processor with zero + * diagonal will set active_l = 0, other processors will not. This is OK as + * we only want to avoid the division by zero on the one processor that owns + * the single coarse grid point. */ + if (hypre_StructMatrixZeroDiagonal(A_l[l])) { active_l[l] = 0; } -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - if (hypre_StructGridDataLocation(grid) != HYPRE_MEMORY_HOST) - { - hypre_SetDeviceOn(); - } -#endif /* set up fine grid relaxation */ relax_data_l[0] = hypre_PFMGRelaxCreate(comm); hypre_PFMGRelaxSetTol(relax_data_l[0], 0.0); @@ -693,15 +405,13 @@ hypre_PFMGSetup( void *pfmg_vdata, { HYPRE_Int maxwork, maxiter; 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; + /* do sweeps proportional to the coarsest grid size */ maxiter = hypre_min(maxwork, cmaxsize); -#if 0 - hypre_printf("maxwork = %d, cmaxsize = %d, maxiter = %d\n", - maxwork, cmaxsize, maxiter); -#endif hypre_PFMGRelaxSetMaxIter(relax_data_l[l], maxiter); } @@ -735,1521 +445,56 @@ hypre_PFMGSetup( void *pfmg_vdata, if ((pfmg_data -> logging) > 0) { - max_iter = (pfmg_data -> max_iter); - (pfmg_data -> norms) = hypre_TAlloc(HYPRE_Real, max_iter, HYPRE_MEMORY_HOST); - (pfmg_data -> rel_norms) = hypre_TAlloc(HYPRE_Real, max_iter, HYPRE_MEMORY_HOST); - } - -#if DEBUG - for (l = 0; l < (num_levels - 1); l++) - { - hypre_sprintf(filename, "zout_A.%02d", l); - hypre_StructMatrixPrint(filename, A_l[l], 0); - hypre_sprintf(filename, "zout_P.%02d", l); - hypre_StructMatrixPrint(filename, P_l[l], 0); + (pfmg_data -> norms) = hypre_TAlloc(HYPRE_Real, max_iter + 1, HYPRE_MEMORY_HOST); + (pfmg_data -> rel_norms) = hypre_TAlloc(HYPRE_Real, max_iter + 1, HYPRE_MEMORY_HOST); } - hypre_sprintf(filename, "zout_A.%02d", l); - hypre_StructMatrixPrint(filename, A_l[l], 0); -#endif + hypre_MemoryPrintUsage(comm, hypre_HandleLogLevel(hypre_handle()), "PFMG setup end", 0); + hypre_GpuProfilingPopRange(); + hypre_sprintf(region_name, "%s", "PFMG-Setup"); + HYPRE_ANNOTATE_REGION_END("%s", region_name); HYPRE_ANNOTATE_FUNC_END; - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_PFMGComputeDxyz( hypre_StructMatrix *A, - HYPRE_Real *dxyz, - HYPRE_Real *mean, - HYPRE_Real *deviation) -{ - hypre_BoxArray *compute_boxes; - HYPRE_Real cxyz[3], sqcxyz[3], tcxyz[3]; - HYPRE_Real cxyz_max; - HYPRE_Int tot_size; - hypre_StructStencil *stencil; - //hypre_Index *stencil_shape; - HYPRE_Int stencil_size; - HYPRE_Int constant_coefficient; - HYPRE_Int i, d; - - /*---------------------------------------------------------- - * Initialize some things - *----------------------------------------------------------*/ - stencil = hypre_StructMatrixStencil(A); - //stencil_shape = hypre_StructStencilShape(stencil); - stencil_size = hypre_StructStencilSize(stencil); - - /*---------------------------------------------------------- - * Compute cxyz (use arithmetic mean) - *----------------------------------------------------------*/ - cxyz[0] = cxyz[1] = cxyz[2] = 0.0; - sqcxyz[0] = sqcxyz[1] = sqcxyz[2] = 0.0; - - constant_coefficient = hypre_StructMatrixConstantCoefficient(A); - compute_boxes = hypre_StructGridBoxes(hypre_StructMatrixGrid(A)); - tot_size = hypre_StructGridGlobalSize(hypre_StructMatrixGrid(A)); - - hypre_ForBoxI(i, compute_boxes) +#ifdef DEBUG_SETUP { - /* all coefficients constant or variable diagonal */ - if ( constant_coefficient ) - { - hypre_PFMGComputeDxyz_CS(i, A, cxyz, sqcxyz); - } - /* constant_coefficient==0, all coefficients vary with space */ - else - { - switch (stencil_size) - { - case 5: - hypre_PFMGComputeDxyz_SS5 (i, A, cxyz, sqcxyz); - break; - case 9: - hypre_PFMGComputeDxyz_SS9 (i, A, cxyz, sqcxyz); - break; - case 7: - hypre_PFMGComputeDxyz_SS7 (i, A, cxyz, sqcxyz); - break; - case 19: - hypre_PFMGComputeDxyz_SS19(i, A, cxyz, sqcxyz); - break; - case 27: - hypre_PFMGComputeDxyz_SS27(i, A, cxyz, sqcxyz); - break; - default: - hypre_printf("hypre error: unsupported stencil size %d\n", stencil_size); - hypre_MPI_Abort(hypre_MPI_COMM_WORLD, 1); - } - } - } + hypre_StructVector *ones = NULL; + hypre_StructVector *Pones = NULL; + char filename[255]; - /*---------------------------------------------------------- - * Compute dxyz - *----------------------------------------------------------*/ + l = num_levels - 1; + hypre_sprintf(filename, "pfmg_A.l%02d", l); + hypre_StructMatrixPrint(filename, A_l[l], 0); - /* all coefficients constant or variable diagonal */ - if ( constant_coefficient ) - { - for (d = 0; d < 3; d++) - { - mean[d] = cxyz[d]; - deviation[d] = sqcxyz[d]; - } - } - /* constant_coefficient==0, all coefficients vary with space */ - else - { - tcxyz[0] = cxyz[0]; - tcxyz[1] = cxyz[1]; - tcxyz[2] = cxyz[2]; - hypre_MPI_Allreduce(tcxyz, cxyz, 3, HYPRE_MPI_REAL, hypre_MPI_SUM, - hypre_StructMatrixComm(A)); - - tcxyz[0] = sqcxyz[0]; - tcxyz[1] = sqcxyz[1]; - tcxyz[2] = sqcxyz[2]; - hypre_MPI_Allreduce(tcxyz, sqcxyz, 3, HYPRE_MPI_REAL, hypre_MPI_SUM, - hypre_StructMatrixComm(A)); - - for (d = 0; d < 3; d++) + for (l = 0; l < (num_levels - 1); l++) { - mean[d] = cxyz[d] / tot_size; - deviation[d] = sqcxyz[d] / tot_size; - } - } + hypre_sprintf(filename, "pfmg_A.l%02d", l); + hypre_StructMatrixPrint(filename, A_l[l], 0); + hypre_sprintf(filename, "pfmg_P.l%02d", l); + hypre_StructMatrixPrint(filename, P_l[l], 0); - cxyz_max = 0.0; - for (d = 0; d < 3; d++) - { - cxyz_max = hypre_max(cxyz_max, cxyz[d]); - } - if (cxyz_max == 0.0) - { - /* Do isotropic coarsening */ - for (d = 0; d < 3; d++) - { - cxyz[d] = 1.0; - } - cxyz_max = 1.0; - } + /* Check if P interpolates vector of ones */ + HYPRE_StructVectorCreate(comm, hypre_StructMatrixGrid(A_l[l + 1]), &ones); + HYPRE_StructVectorInitialize(ones); + HYPRE_StructVectorSetConstantValues(ones, 1.0); + HYPRE_StructVectorAssemble(ones); - /* 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)) - { - cxyz[d] /= cxyz_max; - dxyz[d] = hypre_sqrt(1.0 / cxyz[d]); - } - else - { - dxyz[d] = hypre_sqrt(max_anisotropy); - } - } + HYPRE_StructVectorCreate(comm, hypre_StructMatrixGrid(A_l[l]), &Pones); + HYPRE_StructVectorInitialize(Pones); + HYPRE_StructVectorAssemble(Pones); - return hypre_error_flag; -} + /* interpolate (x = P*e_c) */ + hypre_StructMatvec(1.0, P_l[l], ones, 0.0, Pones); -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ + hypre_sprintf(filename, "pfmg_ones.l%02d", l); + HYPRE_StructVectorPrint(filename, ones, 0); + hypre_sprintf(filename, "pfmg_Pones.l%02d", l); + HYPRE_StructVectorPrint(filename, Pones, 0); -HYPRE_Int -hypre_PFMGComputeDxyz_CS( HYPRE_Int i, - hypre_StructMatrix *A, - HYPRE_Real *cxyz, - HYPRE_Real *sqcxyz) -{ - hypre_StructStencil *stencil; - hypre_Index *stencil_shape; - HYPRE_Int stencil_size; - 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_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(A); - - stencil = hypre_StructMatrixStencil(A); - stencil_shape = hypre_StructStencilShape(stencil); - stencil_size = hypre_StructStencilSize(stencil); - - Ai = hypre_CCBoxIndexRank( A_dbox, start ); - constant_coefficient = hypre_StructMatrixConstantCoefficient(A); - - /* find diagonal stencil entry */ - for (si = 0; si < stencil_size; si++) - { - if ((hypre_IndexD(stencil_shape[si], 0) == 0) && - (hypre_IndexD(stencil_shape[si], 1) == 0) && - (hypre_IndexD(stencil_shape[si], 2) == 0)) - { - sdiag = si; - break; + HYPRE_StructVectorDestroy(ones); + HYPRE_StructVectorDestroy(Pones); } } - - tcx = cxyz[0]; - tcy = cxyz[1]; - tcz = cxyz[2]; - - /* get sign of diagonal */ - Ap = hypre_StructMatrixBoxData(A, i, sdiag); - if (constant_coefficient == 1) - { - Adiag = Ap[Ai]; - } - else if (constant_coefficient == 2) - { - hypre_TMemcpy(&Adiag, &Ap[Ai], HYPRE_Real, 1, HYPRE_MEMORY_HOST, memory_location); - } - - diag = 1.0; - if (Adiag < 0) - { - diag = -1.0; - } - - for (si = 0; si < stencil_size; si++) - { - Ap = hypre_StructMatrixBoxData(A, i, si); - - /* x-direction */ - Astenc = hypre_IndexD(stencil_shape[si], 0); - if (Astenc) - { - tcx -= Ap[Ai] * diag; - } - - /* y-direction */ - Astenc = hypre_IndexD(stencil_shape[si], 1); - if (Astenc) - { - tcy -= Ap[Ai] * diag; - } - - /* z-direction */ - Astenc = hypre_IndexD(stencil_shape[si], 2); - if (Astenc) - { - tcz -= Ap[Ai] * diag; - } - } - - cxyz[0] += tcx; - cxyz[1] += tcy; - cxyz[2] += tcz; - - sqcxyz[0] += tcx * tcx; - sqcxyz[1] += tcy * tcy; - sqcxyz[2] += tcz * tcz; - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_PFMGComputeDxyz_SS5( HYPRE_Int bi, - hypre_StructMatrix *A, - HYPRE_Real *cxyz, - HYPRE_Real *sqcxyz) -{ - hypre_BoxArray *compute_boxes; - hypre_Box *compute_box; - hypre_Box *A_dbox; - hypre_Index loop_size; - hypre_IndexRef start; - hypre_Index stride; - hypre_Index index; - 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) ); -#endif - - hypre_SetIndex3(stride, 1, 1, 1); - compute_boxes = hypre_StructGridBoxes(hypre_StructMatrixGrid(A)); - compute_box = hypre_BoxArrayBox(compute_boxes, bi); - A_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A), bi); - start = hypre_BoxIMin(compute_box); - hypre_BoxGetStrideSize(compute_box, stride, loop_size); - - /*----------------------------------------------------------------- - * Extract pointers for 5-point fine grid operator: - * - * a_cc is pointer for center coefficient (diag) - * a_cw is pointer for west coefficient - * a_ce is pointer for east coefficient - * a_cs is pointer for south coefficient - * a_cn is pointer for north coefficient - *-----------------------------------------------------------------*/ - - hypre_SetIndex3(index, 0, 0, 0); - a_cc = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, -1, 0, 0); - a_cw = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, 1, 0, 0); - a_ce = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, 0, -1, 0); - a_cs = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, 0, 1, 0); - a_cn = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - // 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, - 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]); - cxb += tcx; - } - hypre_BoxLoop1ReductionEnd(Ai, cxb) - - HYPRE_Real cyb = cxyz[1]; - hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, - A_dbox, start, stride, Ai, cyb) - { - HYPRE_Real diag = a_cc[Ai] < 0.0 ? -1.0 : 1.0; - HYPRE_Real tcy = -diag * (a_cn[Ai] + a_cs[Ai]); - cyb += tcy; - } - hypre_BoxLoop1ReductionEnd(Ai, cyb) - - HYPRE_Real sqcxb = sqcxyz[0]; - hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, - 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]); - sqcxb += tcx * tcx; - } - hypre_BoxLoop1ReductionEnd(Ai, sqcxb) - - HYPRE_Real sqcyb = sqcxyz[1]; - hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, - A_dbox, start, stride, Ai, sqcyb) - { - HYPRE_Real diag = a_cc[Ai] < 0.0 ? -1.0 : 1.0; - HYPRE_Real tcy = -diag * (a_cn[Ai] + a_cs[Ai]); - sqcyb += tcy * tcy; - } - hypre_BoxLoop1ReductionEnd(Ai, sqcyb) - -#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]); -#elif defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - HYPRE_double4 d4(cxyz[0], cxyz[1], sqcxyz[0], sqcxyz[1]); - ReduceSum sum4(d4); -#else - HYPRE_Real cxb, cyb, sqcxb, sqcyb; - cxb = cxyz[0]; - cyb = cxyz[1]; - sqcxb = sqcxyz[0]; - sqcyb = sqcxyz[1]; -#endif - -#ifdef HYPRE_BOX_REDUCTION -#undef HYPRE_BOX_REDUCTION -#endif - -#ifdef HYPRE_USING_DEVICE_OPENMP -#define HYPRE_BOX_REDUCTION map(tofrom:cxb,cyb,sqcxb,sqcyb) reduction(+:cxb,cyb,sqcxb,sqcyb) -#else -#define HYPRE_BOX_REDUCTION reduction(+:cxb,cyb,sqcxb,sqcyb) -#endif - -#define DEVICE_VAR is_device_ptr(a_cc,a_cw,a_ce,a_cn,a_cs) - 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; - - tcx = -diag * (a_cw[Ai] + a_ce[Ai]); - 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); - sum4 += tmp; -#else - cxb += tcx; - cyb += tcy; - sqcxb += tcx * tcx; - sqcyb += tcy * tcy; -#endif - } - hypre_BoxLoop1ReductionEnd(Ai, sum4) -#undef DEVICE_VAR - -#endif /* kokkos */ - -#if !defined(HYPRE_USING_RAJA) && !defined(HYPRE_USING_KOKKOS) && (defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP)) - HYPRE_double4 tmp = (HYPRE_double4) sum4; - cxyz[0] = tmp.x; - cxyz[1] = tmp.y; - sqcxyz[0] = tmp.z; - sqcxyz[1] = tmp.w; - //printf("1: %e %e %e %e\n", cxyz[0], cxyz[1], sqcxyz[0], sqcxyz[1]); -#else - cxyz[0] = (HYPRE_Real) cxb; - cxyz[1] = (HYPRE_Real) cyb; - sqcxyz[0] = (HYPRE_Real) sqcxb; - sqcxyz[1] = (HYPRE_Real) sqcyb; -#endif - - cxyz[2] = 0; - sqcxyz[2] = 0; - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_PFMGComputeDxyz_SS9( HYPRE_Int bi, - hypre_StructMatrix *A, - HYPRE_Real *cxyz, - HYPRE_Real *sqcxyz) -{ - hypre_BoxArray *compute_boxes; - hypre_Box *compute_box; - hypre_Box *A_dbox; - hypre_Index loop_size; - hypre_IndexRef start; - hypre_Index stride; - 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; -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - HYPRE_Int data_location = hypre_StructGridDataLocation( - hypre_StructMatrixGrid(A) ); -#endif - - hypre_SetIndex3(stride, 1, 1, 1); - compute_boxes = hypre_StructGridBoxes(hypre_StructMatrixGrid(A)); - compute_box = hypre_BoxArrayBox(compute_boxes, bi); - A_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A), bi); - start = hypre_BoxIMin(compute_box); - hypre_BoxGetStrideSize(compute_box, stride, loop_size); - - /*----------------------------------------------------------------- - * Extract pointers for 5-point grid operator: - * - * a_cc is pointer for center coefficient - * a_cw is pointer for west coefficient - * a_ce is pointer for east coefficient - * a_cs is pointer for south coefficient - * a_cn is pointer for north coefficient - *-----------------------------------------------------------------*/ - - hypre_SetIndex3(index, 0, 0, 0); - a_cc = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, -1, 0, 0); - a_cw = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, 1, 0, 0); - a_ce = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, 0, -1, 0); - a_cs = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, 0, 1, 0); - a_cn = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - /*----------------------------------------------------------------- - * Extract additional pointers for 9-point grid operator: - * - * a_csw is pointer for southwest coefficient - * a_cse is pointer for southeast coefficient - * a_cnw is pointer for northwest coefficient - * a_cne is pointer for northeast coefficient - *-----------------------------------------------------------------*/ - - hypre_SetIndex3(index, -1, -1, 0); - a_csw = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, 1, -1, 0); - a_cse = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - 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) || 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_csw[Ai] + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); - cxb += tcx; - } - hypre_BoxLoop1ReductionEnd(Ai, cxb) - - HYPRE_Real cyb = cxyz[1]; - hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, - 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_csw[Ai] + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); - cyb += tcy; - } - hypre_BoxLoop1ReductionEnd(Ai, cyb) - - HYPRE_Real sqcxb = sqcxyz[0]; - hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, - 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_csw[Ai] + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); - sqcxb += tcx * tcx; - } - hypre_BoxLoop1ReductionEnd(Ai, sqcxb) - - HYPRE_Real sqcyb = sqcxyz[1]; - hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, - 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_csw[Ai] + a_cse[Ai] + a_cnw[Ai] + a_cne[Ai]); - 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]); -#elif defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - HYPRE_double4 d4(cxyz[0], cxyz[1], sqcxyz[0], sqcxyz[1]); - ReduceSum sum4(d4); -#else - HYPRE_Real cxb, cyb, sqcxb, sqcyb; - cxb = cxyz[0]; - cyb = cxyz[1]; - sqcxb = sqcxyz[0]; - sqcyb = sqcxyz[1]; - -#ifdef HYPRE_BOX_REDUCTION -#undef HYPRE_BOX_REDUCTION -#endif - -#ifdef HYPRE_USING_DEVICE_OPENMP -#define HYPRE_BOX_REDUCTION map(tofrom:cxb,cyb,sqcxb,sqcyb) reduction(+:cxb,cyb,sqcxb,sqcyb) -#else -#define HYPRE_BOX_REDUCTION reduction(+:cxb,cyb,sqcxb,sqcyb) -#endif - -#endif - -#define DEVICE_VAR is_device_ptr(a_cc,a_cw,a_ce,a_csw,a_cse,a_cnw,a_cne,a_cs,a_cn) - 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; - - 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; -#else - cxb += tcx; - cyb += tcy; - sqcxb += tcx * tcx; - sqcyb += tcy * tcy; -#endif - } - hypre_BoxLoop1ReductionEnd(Ai, sum4) -#undef DEVICE_VAR - -#endif /* kokkos */ - -#if !defined(HYPRE_USING_RAJA) && !defined(HYPRE_USING_KOKKOS) && (defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP)) - HYPRE_double4 tmp = (HYPRE_double4) sum4; - cxyz[0] = tmp.x; - cxyz[1] = tmp.y; - sqcxyz[0] = tmp.z; - sqcxyz[1] = tmp.w; -#else - cxyz[0] = (HYPRE_Real) cxb; - cxyz[1] = (HYPRE_Real) cyb; - sqcxyz[0] = (HYPRE_Real) sqcxb; - sqcxyz[1] = (HYPRE_Real) sqcyb; -#endif - - cxyz[2] = 0; - sqcxyz[2] = 0; - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_PFMGComputeDxyz_SS7( HYPRE_Int bi, - hypre_StructMatrix *A, - HYPRE_Real *cxyz, - HYPRE_Real *sqcxyz) -{ - hypre_BoxArray *compute_boxes; - hypre_Box *compute_box; - hypre_Box *A_dbox; - hypre_Index loop_size; - hypre_IndexRef start; - hypre_Index stride; - hypre_Index index; - 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) ); -#endif - - hypre_SetIndex3(stride, 1, 1, 1); - compute_boxes = hypre_StructGridBoxes(hypre_StructMatrixGrid(A)); - compute_box = hypre_BoxArrayBox(compute_boxes, bi); - A_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A), bi); - start = hypre_BoxIMin(compute_box); - hypre_BoxGetStrideSize(compute_box, stride, loop_size); - - /*----------------------------------------------------------------- - * Extract pointers for 7-point grid operator: - * - * a_cc is pointer for center coefficient - * a_cw is pointer for west coefficient in same plane - * a_ce is pointer for east coefficient in same plane - * a_cs is pointer for south coefficient in same plane - * a_cn is pointer for north coefficient in same plane - * a_ac is pointer for center coefficient in plane above - * a_bc is pointer for center coefficient in plane below - *-----------------------------------------------------------------*/ - - hypre_SetIndex3(index, 0, 0, 0); - a_cc = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, -1, 0, 0); - a_cw = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, 1, 0, 0); - a_ce = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, 0, -1, 0); - a_cs = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, 0, 1, 0); - a_cn = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, 0, 0, 1); - a_ac = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - 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) || 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]); - cxb += tcx; - } - hypre_BoxLoop1ReductionEnd(Ai, cxb) - - HYPRE_Real cyb = cxyz[1]; - hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, - 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]); - cyb += tcy; - } - hypre_BoxLoop1ReductionEnd(Ai, cyb) - - HYPRE_Real czb = cxyz[2]; - hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, - 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]); - czb += tcz; - } - hypre_BoxLoop1ReductionEnd(Ai, czb) - - HYPRE_Real sqcxb = sqcxyz[0]; - hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, - 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]); - sqcxb += tcx * tcx; - } - hypre_BoxLoop1ReductionEnd(Ai, sqcxb) - - HYPRE_Real sqcyb = sqcxyz[1]; - hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, - 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]); - sqcyb += tcy * tcy; - } - hypre_BoxLoop1ReductionEnd(Ai, sqcyb) - - HYPRE_Real sqczb = sqcxyz[2]; - hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, - 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]); - 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]); -#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); -#else - HYPRE_Real cxb, cyb, czb, sqcxb, sqcyb, sqczb; - cxb = cxyz[0]; - cyb = cxyz[1]; - czb = cxyz[2]; - sqcxb = sqcxyz[0]; - sqcyb = sqcxyz[1]; - sqczb = sqcxyz[2]; - -#ifdef HYPRE_BOX_REDUCTION -#undef HYPRE_BOX_REDUCTION -#endif - -#ifdef HYPRE_USING_DEVICE_OPENMP -#define HYPRE_BOX_REDUCTION map(tofrom:cxb,cyb,czb,sqcxb,sqcyb,sqczb) reduction(+:cxb,cyb,czb,sqcxb,sqcyb,sqczb) -#else -#define HYPRE_BOX_REDUCTION reduction(+:cxb,cyb,czb,sqcxb,sqcyb,sqczb) -#endif - -#endif - -#define DEVICE_VAR is_device_ptr(a_cc,a_cw,a_ce,a_cs,a_cn,a_ac,a_bc) - hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, - A_dbox, start, stride, Ai, sum6) - { - 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]); - 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); - sum6 += tmp; -#else - cxb += tcx; - cyb += tcy; - czb += tcz; - sqcxb += tcx * tcx; - sqcyb += tcy * tcy; - sqczb += tcz * tcz; -#endif - } - hypre_BoxLoop1ReductionEnd(Ai, sum6) -#undef DEVICE_VAR - -#endif /* kokkos */ - -#if !defined(HYPRE_USING_RAJA) && !defined(HYPRE_USING_KOKKOS) && (defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP)) - HYPRE_double6 tmp = (HYPRE_double6) sum6; - cxyz[0] = tmp.x; - cxyz[1] = tmp.y; - cxyz[2] = tmp.z; - sqcxyz[0] = tmp.w; - sqcxyz[1] = tmp.u; - sqcxyz[2] = tmp.v; -#else - cxyz[0] = (HYPRE_Real) cxb; - cxyz[1] = (HYPRE_Real) cyb; - cxyz[2] = (HYPRE_Real) czb; - sqcxyz[0] = (HYPRE_Real) sqcxb; - sqcxyz[1] = (HYPRE_Real) sqcyb; - sqcxyz[2] = (HYPRE_Real) sqczb; -#endif +#endif return hypre_error_flag; } - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_PFMGComputeDxyz_SS19( HYPRE_Int bi, - hypre_StructMatrix *A, - HYPRE_Real *cxyz, - HYPRE_Real *sqcxyz) -{ - hypre_BoxArray *compute_boxes; - hypre_Box *compute_box; - hypre_Box *A_dbox; - hypre_Index loop_size; - hypre_IndexRef start; - hypre_Index stride; - 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; -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - HYPRE_Int data_location = hypre_StructGridDataLocation( - hypre_StructMatrixGrid(A) ); -#endif - - hypre_SetIndex3(stride, 1, 1, 1); - compute_boxes = hypre_StructGridBoxes(hypre_StructMatrixGrid(A)); - compute_box = hypre_BoxArrayBox(compute_boxes, bi); - A_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A), bi); - start = hypre_BoxIMin(compute_box); - hypre_BoxGetStrideSize(compute_box, stride, loop_size); - - /*----------------------------------------------------------------- - * Extract pointers for 7-point grid operator: - * - * a_cc is pointer for center coefficient - * a_cw is pointer for west coefficient in same plane - * a_ce is pointer for east coefficient in same plane - * a_cs is pointer for south coefficient in same plane - * a_cn is pointer for north coefficient in same plane - * a_ac is pointer for center coefficient in plane above - * a_bc is pointer for center coefficient in plane below - *-----------------------------------------------------------------*/ - - hypre_SetIndex3(index, 0, 0, 0); - a_cc = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, -1, 0, 0); - a_cw = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, 1, 0, 0); - a_ce = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, 0, -1, 0); - a_cs = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, 0, 1, 0); - a_cn = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, 0, 0, 1); - a_ac = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, 0, 0, -1); - a_bc = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - /*----------------------------------------------------------------- - * Extract additional pointers for 19-point fine grid operator: - * - * a_aw is pointer for west coefficient in plane above - * a_ae is pointer for east coefficient in plane above - * a_as is pointer for south coefficient in plane above - * a_an is pointer for north coefficient in plane above - * a_bw is pointer for west coefficient in plane below - * a_be is pointer for east coefficient in plane below - * a_bs is pointer for south coefficient in plane below - * a_bn is pointer for north coefficient in plane below - * a_csw is pointer for southwest coefficient in same plane - * a_cse is pointer for southeast coefficient in same plane - * a_cnw is pointer for northwest coefficient in same plane - * a_cne is pointer for northeast coefficient in same plane - *-----------------------------------------------------------------*/ - - 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); - 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); - a_bw = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, 1, 0, -1); - a_be = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, 0, -1, -1); - a_bs = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, 0, 1, -1); - a_bn = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, -1, -1, 0); - a_csw = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, 1, -1, 0); - a_cse = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - 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) || 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_BoxLoop1ReductionEnd(Ai, cxb) - - HYPRE_Real cyb = cxyz[1]; - hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, - 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]); - cyb += tcy; - } - hypre_BoxLoop1ReductionEnd(Ai, cyb) - - HYPRE_Real czb = cxyz[2]; - hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, - 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]); - czb += tcz; - } - hypre_BoxLoop1ReductionEnd(Ai, czb) - - HYPRE_Real sqcxb = sqcxyz[0]; - hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, - 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_BoxLoop1ReductionEnd(Ai, sqcxb) - - HYPRE_Real sqcyb = sqcxyz[1]; - hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, - 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_BoxLoop1ReductionEnd(Ai, sqcyb) - - HYPRE_Real sqczb = sqcxyz[2]; - hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, - 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_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]); -#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); -#else - HYPRE_Real cxb, cyb, czb, sqcxb, sqcyb, sqczb; - cxb = cxyz[0]; - cyb = cxyz[1]; - czb = cxyz[2]; - sqcxb = sqcxyz[0]; - sqcyb = sqcxyz[1]; - sqczb = sqcxyz[2]; - -#ifdef HYPRE_BOX_REDUCTION -#undef HYPRE_BOX_REDUCTION -#endif - -#ifdef HYPRE_USING_DEVICE_OPENMP -#define HYPRE_BOX_REDUCTION map(tofrom:cxb,cyb,czb,sqcxb,sqcyb,sqczb) reduction(+:cxb,cyb,czb,sqcxb,sqcyb,sqczb) -#else -#define HYPRE_BOX_REDUCTION reduction(+:cxb,cyb,czb,sqcxb,sqcyb,sqczb) -#endif - -#endif - -#define DEVICE_VAR is_device_ptr(a_cc,a_cw,a_ce,a_aw,a_ae,a_bw,a_be,a_csw,a_cse,a_cnw,a_cne,a_cs,a_cn,a_an,a_as,a_bn,a_bs,a_ac,a_bc) - hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, - A_dbox, start, stride, Ai, sum6) - { - 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]); - -#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); - sum6 += tmp; -#else - cxb += tcx; - cyb += tcy; - czb += tcz; - sqcxb += tcx * tcx; - sqcyb += tcy * tcy; - sqczb += tcz * tcz; -#endif - } - hypre_BoxLoop1ReductionEnd(Ai, sum6) -#undef DEVICE_VAR - -#endif /* kokkos */ - -#if !defined(HYPRE_USING_RAJA) && !defined(HYPRE_USING_KOKKOS) && (defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP)) - HYPRE_double6 tmp = (HYPRE_double6) sum6; - cxyz[0] = tmp.x; - cxyz[1] = tmp.y; - cxyz[2] = tmp.z; - sqcxyz[0] = tmp.w; - sqcxyz[1] = tmp.u; - sqcxyz[2] = tmp.v; -#else - cxyz[0] = (HYPRE_Real) cxb; - cxyz[1] = (HYPRE_Real) cyb; - cxyz[2] = (HYPRE_Real) czb; - sqcxyz[0] = (HYPRE_Real) sqcxb; - sqcxyz[1] = (HYPRE_Real) sqcyb; - sqcxyz[2] = (HYPRE_Real) sqczb; -#endif - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_PFMGComputeDxyz_SS27( HYPRE_Int bi, - hypre_StructMatrix *A, - HYPRE_Real *cxyz, - HYPRE_Real *sqcxyz) -{ - hypre_BoxArray *compute_boxes; - hypre_Box *compute_box; - hypre_Box *A_dbox; - hypre_Index loop_size; - hypre_IndexRef start; - hypre_Index stride; - 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; - -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - HYPRE_Int data_location = hypre_StructGridDataLocation( - hypre_StructMatrixGrid(A) ); -#endif - - hypre_SetIndex3(stride, 1, 1, 1); - compute_boxes = hypre_StructGridBoxes(hypre_StructMatrixGrid(A)); - compute_box = hypre_BoxArrayBox(compute_boxes, bi); - A_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A), bi); - start = hypre_BoxIMin(compute_box); - hypre_BoxGetStrideSize(compute_box, stride, loop_size); - - /*----------------------------------------------------------------- - * Extract pointers for 7-point grid operator: - * - * a_cc is pointer for center coefficient - * a_cw is pointer for west coefficient in same plane - * a_ce is pointer for east coefficient in same plane - * a_cs is pointer for south coefficient in same plane - * a_cn is pointer for north coefficient in same plane - * a_ac is pointer for center coefficient in plane above - * a_bc is pointer for center coefficient in plane below - *-----------------------------------------------------------------*/ - - hypre_SetIndex3(index, 0, 0, 0); - a_cc = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, -1, 0, 0); - a_cw = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, 1, 0, 0); - a_ce = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, 0, -1, 0); - a_cs = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, 0, 1, 0); - a_cn = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, 0, 0, 1); - a_ac = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, 0, 0, -1); - a_bc = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - /*----------------------------------------------------------------- - * Extract additional pointers for 19-point grid operator: - * - * a_aw is pointer for west coefficient in plane above - * a_ae is pointer for east coefficient in plane above - * a_as is pointer for south coefficient in plane above - * a_an is pointer for north coefficient in plane above - * a_bw is pointer for west coefficient in plane below - * a_be is pointer for east coefficient in plane below - * a_bs is pointer for south coefficient in plane below - * a_bn is pointer for north coefficient in plane below - * a_csw is pointer for southwest coefficient in same plane - * a_cse is pointer for southeast coefficient in same plane - * a_cnw is pointer for northwest coefficient in same plane - * a_cne is pointer for northeast coefficient in same plane - *-----------------------------------------------------------------*/ - - 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); - 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); - a_bw = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, 1, 0, -1); - a_be = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, 0, -1, -1); - a_bs = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, 0, 1, -1); - a_bn = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, -1, -1, 0); - a_csw = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, 1, -1, 0); - a_cse = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - 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); - - /*----------------------------------------------------------------- - * Extract additional pointers for 27-point fine grid operator: - * - * a_asw is pointer for southwest coefficient in plane above - * a_ase is pointer for southeast coefficient in plane above - * a_anw is pointer for northwest coefficient in plane above - * a_ane is pointer for northeast coefficient in plane above - * a_bsw is pointer for southwest coefficient in plane below - * a_bse is pointer for southeast coefficient in plane below - * a_bnw is pointer for northwest coefficient in plane below - * a_bne is pointer for northeast coefficient in plane below - *-----------------------------------------------------------------*/ - - hypre_SetIndex3(index, -1, -1, 1); - a_asw = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, 1, -1, 1); - a_ase = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - 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); - a_bsw = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, 1, -1, -1); - a_bse = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - hypre_SetIndex3(index, -1, 1, -1); - a_bnw = hypre_StructMatrixExtractPointerByIndex(A, bi, index); - - 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) || defined(HYPRE_USING_SYCL) - - HYPRE_Real cxb = cxyz[0]; - hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, - A_dbox, start, stride, Ai, cxb) - { - 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]); - cxb += tcx; - } - hypre_BoxLoop1ReductionEnd(Ai, cxb) - - HYPRE_Real cyb = cxyz[1]; - hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, - A_dbox, start, stride, Ai, cyb) - { - 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]); - cyb += tcy; - } - hypre_BoxLoop1ReductionEnd(Ai, cyb) - - HYPRE_Real czb = cxyz[2]; - hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, - A_dbox, start, stride, Ai, czb) - { - 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]); - czb += tcz; - } - hypre_BoxLoop1ReductionEnd(Ai, czb) - - HYPRE_Real sqcxb = sqcxyz[0]; - hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, - A_dbox, start, stride, Ai, sqcxb) - { - 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; - } - hypre_BoxLoop1ReductionEnd(Ai, sqcxb) - - HYPRE_Real sqcyb = sqcxyz[1]; - hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, - A_dbox, start, stride, Ai, sqcyb); - { - 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; - } - hypre_BoxLoop1ReductionEnd(Ai, sqcyb); - - HYPRE_Real sqczb = sqcxyz[2]; - hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, - A_dbox, start, stride, Ai, sqczb) - { - 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; - } - 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]); -#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); -#else - HYPRE_Real cxb, cyb, czb, sqcxb, sqcyb, sqczb; - cxb = cxyz[0]; - cyb = cxyz[1]; - czb = cxyz[2]; - sqcxb = sqcxyz[0]; - sqcyb = sqcxyz[1]; - sqczb = sqcxyz[2]; - -#ifdef HYPRE_BOX_REDUCTION -#undef HYPRE_BOX_REDUCTION -#endif - -#ifdef HYPRE_USING_DEVICE_OPENMP -#define HYPRE_BOX_REDUCTION map(tofrom:cxb,cyb,czb,sqcxb,sqcyb,sqczb) reduction(+:cxb,cyb,czb,sqcxb,sqcyb,sqczb) -#else -#define HYPRE_BOX_REDUCTION reduction(+:cxb,cyb,czb,sqcxb,sqcyb,sqczb) -#endif - -#endif - -#define DEVICE_VAR is_device_ptr(a_cc,a_cw,a_ce,a_aw,a_ae,a_bw,a_be,a_csw,a_cse,a_cnw,a_cne,a_asw,a_ase,a_anw,a_ane,a_bsw,a_bse,a_bnw,a_bne,a_cs,a_cn,a_an,a_as,a_bn,a_bs,a_ac,a_bc) - hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, - A_dbox, start, stride, Ai, sum6) - { - 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]); - - 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]); -#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); - sum6 += tmp; -#else - cxb += tcx; - cyb += tcy; - czb += tcz; - sqcxb += tcx * tcx; - sqcyb += tcy * tcy; - sqczb += tcz * tcz; -#endif - } - hypre_BoxLoop1ReductionEnd(Ai, sum6) -#undef DEVICE_VAR - -#endif /* kokkos */ - -#if !defined(HYPRE_USING_RAJA) && !defined(HYPRE_USING_KOKKOS) && (defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP)) - HYPRE_double6 tmp = (HYPRE_double6) sum6; - cxyz[0] = tmp.x; - cxyz[1] = tmp.y; - cxyz[2] = tmp.z; - sqcxyz[0] = tmp.w; - sqcxyz[1] = tmp.u; - sqcxyz[2] = tmp.v; -#else - cxyz[0] = (HYPRE_Real) cxb; - cxyz[1] = (HYPRE_Real) cyb; - cxyz[2] = (HYPRE_Real) czb; - sqcxyz[0] = (HYPRE_Real) sqcxb; - sqcxyz[1] = (HYPRE_Real) sqcyb; - sqcxyz[2] = (HYPRE_Real) sqczb; -#endif - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - * Returns 1 if there is a diagonal coefficient that is zero, - * otherwise returns 0. - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_ZeroDiagonal( hypre_StructMatrix *A ) -{ - hypre_BoxArray *compute_boxes; - hypre_Box *compute_box; - - hypre_Index loop_size; - hypre_IndexRef start; - hypre_Index stride; - - HYPRE_Real *Ap; - hypre_Box *A_dbox; - HYPRE_Int Ai; - - HYPRE_Int i; - - hypre_Index diag_index; - HYPRE_Real diag_product = 0.0; - HYPRE_Int zero_diag = 0; - - HYPRE_Int constant_coefficient; -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - HYPRE_Int data_location = hypre_StructGridDataLocation(hypre_StructMatrixGrid(A)); -#endif - - /*---------------------------------------------------------- - * Initialize some things - *----------------------------------------------------------*/ - - hypre_SetIndex3(stride, 1, 1, 1); - hypre_SetIndex3(diag_index, 0, 0, 0); - - /* Need to modify here */ - constant_coefficient = hypre_StructMatrixConstantCoefficient(A); - - compute_boxes = hypre_StructGridBoxes(hypre_StructMatrixGrid(A)); - hypre_ForBoxI(i, compute_boxes) - { - compute_box = hypre_BoxArrayBox(compute_boxes, i); - start = hypre_BoxIMin(compute_box); - A_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A), i); - Ap = hypre_StructMatrixExtractPointerByIndex(A, i, diag_index); - hypre_BoxGetStrideSize(compute_box, stride, loop_size); - - if ( constant_coefficient == 1 ) - { - Ai = hypre_CCBoxIndexRank( A_dbox, start ); - diag_product += Ap[Ai] == 0 ? 1 : 0; - } - else - { -#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); -#elif defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - ReduceSum diag_product_local(diag_product); -#else - HYPRE_Real diag_product_local = diag_product; -#endif - -#ifdef HYPRE_BOX_REDUCTION -#undef HYPRE_BOX_REDUCTION -#endif - -#if defined(HYPRE_USING_DEVICE_OPENMP) -#define HYPRE_BOX_REDUCTION map(tofrom:diag_product_local) reduction(+:diag_product_local) -#else -#define HYPRE_BOX_REDUCTION reduction(+:diag_product_local) -#endif - -#define DEVICE_VAR is_device_ptr(Ap) - hypre_BoxLoop1ReductionBegin(hypre_StructMatrixNDim(A), loop_size, - A_dbox, start, stride, Ai, diag_product_local); - { - HYPRE_Real one = 1.0; - HYPRE_Real zero = 0.0; - if (Ap[Ai] == 0.0) - { - diag_product_local += one; - } - else - { - diag_product_local += zero; - } - } - hypre_BoxLoop1ReductionEnd(Ai, diag_product_local); - - diag_product += (HYPRE_Real) diag_product_local; - } - } - - if (diag_product > 0) - { - zero_diag = 1; - } - - return zero_diag; -} diff --git a/src/struct_ls/pfmg_setup_interp.c b/src/struct_ls/pfmg_setup_interp.c index 5f382e7af3..51845093c2 100644 --- a/src/struct_ls/pfmg_setup_interp.c +++ b/src/struct_ls/pfmg_setup_interp.c @@ -9,72 +9,70 @@ #include "_hypre_struct_mv.hpp" #include "pfmg.h" -#ifdef MAX_DEPTH -#undef MAX_DEPTH -#endif -#define MAX_DEPTH 7 - -/* 2: the most explicit implementation, a function for each stencil size */ -#define CC0_IMPLEMENTATION 2 - /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ hypre_StructMatrix * hypre_PFMGCreateInterpOp( hypre_StructMatrix *A, - hypre_StructGrid *cgrid, HYPRE_Int cdir, + hypre_Index stride, HYPRE_Int rap_type ) { - hypre_StructMatrix *P; + MPI_Comm comm = hypre_StructMatrixComm(A); + HYPRE_Int ndim = hypre_StructMatrixNDim(A); + hypre_StructGrid *grid = hypre_StructMatrixGrid(A); + hypre_StructStencil *stencil = hypre_StructMatrixStencil(A); + hypre_Index *stencil_shape = hypre_StructStencilShape(stencil); + HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); + HYPRE_Int diag_entry = hypre_StructStencilDiagEntry(stencil); + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(A); - hypre_StructStencil *stencil; - hypre_Index *stencil_shape; - HYPRE_Int stencil_size; - HYPRE_Int stencil_dim; - - HYPRE_Int num_ghost[] = {1, 1, 1, 1, 1, 1}; - - HYPRE_Int i; - HYPRE_Int constant_coefficient; + hypre_StructMatrix *P; + HYPRE_Int centries[3] = {0, 1, 2}; + HYPRE_Int ncentries, i; - /* set up stencil */ - stencil_size = 2; - stencil_dim = hypre_StructStencilNDim(hypre_StructMatrixStencil(A)); - stencil_shape = hypre_CTAlloc(hypre_Index, stencil_size, HYPRE_MEMORY_HOST); + /* Figure out which entries to make constant (ncentries) */ + ncentries = 3; /* Make all entries in P constant by default */ for (i = 0; i < stencil_size; i++) { - hypre_SetIndex3(stencil_shape[i], 0, 0, 0); + /* Check for entries in A in direction cdir that are variable */ + if (hypre_IndexD(stencil_shape[i], cdir) != 0) + { + if (!hypre_StructMatrixConstEntry(A, i)) + { + ncentries = 1; /* Make only the diagonal of P constant */ + break; + } + } } - hypre_IndexD(stencil_shape[0], cdir) = -1; - hypre_IndexD(stencil_shape[1], cdir) = 1; - stencil = - hypre_StructStencilCreate(stencil_dim, stencil_size, stencil_shape); - /* set up matrix */ - P = hypre_StructMatrixCreate(hypre_StructMatrixComm(A), cgrid, stencil); - hypre_StructMatrixSetNumGhost(P, num_ghost); - - constant_coefficient = hypre_StructMatrixConstantCoefficient(A); - if ( constant_coefficient == 2 ) + /* If diagonal of A is not constant and using RAP, do variable interpolation. + * + * NOTE: This is important right now because of an issue with Matmult, where + * it computes constant stencil entries that may not truly be constant along + * grid boundaries. RDF: Remove this? I don't think it's needed anymore, + * because Matmult uses a mask. */ + if (!hypre_StructMatrixConstEntry(A, diag_entry) && (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. */ - hypre_StructMatrixSetConstantCoefficient(P, 1); - } + ncentries = 1; /* Make only the diagonal of P constant */ } - else + + /* Set up the stencil for P */ + stencil_size = 3; + stencil_shape = hypre_CTAlloc(hypre_Index, stencil_size, HYPRE_MEMORY_HOST); + for (i = 0; i < stencil_size; i++) { - /* constant_coefficient = 0 or 1: A is entirely constant or entirely - variable coefficient */ - hypre_StructMatrixSetConstantCoefficient( P, constant_coefficient ); + hypre_SetIndex(stencil_shape[i], 0); } + hypre_IndexD(stencil_shape[1], cdir) = -1; + hypre_IndexD(stencil_shape[2], cdir) = 1; + stencil = hypre_StructStencilCreate(ndim, stencil_size, stencil_shape); + + /* Set up the P matrix */ + P = hypre_StructMatrixCreate(comm, grid, stencil); + hypre_StructMatrixSetDomainStride(P, stride); + hypre_StructMatrixSetConstantEntries(P, ncentries, centries); + hypre_StructMatrixSetMemoryLocation(P, memory_location); hypre_StructStencilDestroy(stencil); @@ -82,1896 +80,654 @@ hypre_PFMGCreateInterpOp( hypre_StructMatrix *A, } /*-------------------------------------------------------------------------- + * hypre_PFMGSetupInterpOp_core_CC + * + * Core function to compute the constant part of the stencil collapse of the + * prolongation matrix. *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_PFMGSetupInterpOp( hypre_StructMatrix *A, - HYPRE_Int cdir, - hypre_Index findex, - hypre_Index stride, - hypre_StructMatrix *P, - HYPRE_Int rap_type ) +hypre_PFMGSetupInterpOp_core_CC( hypre_StructMatrix *P, + hypre_StructMatrix *A, + HYPRE_Int cdir, + HYPRE_Complex *Pconst0_ptr, + HYPRE_Complex *Pconst1_ptr, + HYPRE_Complex *Pconst2_ptr) { - hypre_BoxArray *compute_boxes; - hypre_Box *compute_box; - - hypre_Box *A_dbox; - hypre_Box *P_dbox; - - HYPRE_Real *Pp0, *Pp1; - HYPRE_Int constant_coefficient; - - hypre_StructStencil *stencil; - hypre_Index *stencil_shape; - HYPRE_Int stencil_size; - hypre_StructStencil *P_stencil; - hypre_Index *P_stencil_shape; - - HYPRE_Int Pstenc0, Pstenc1; - - hypre_Index loop_size; - hypre_Index start; - hypre_IndexRef startc; - hypre_Index stridec; - - HYPRE_Int i, si; - - HYPRE_Int si0, si1; - HYPRE_Int mrk0, mrk1; - HYPRE_Int d; - - /*---------------------------------------------------------- - * Initialize some things - *----------------------------------------------------------*/ + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(P); + HYPRE_ExecutionPolicy exec = hypre_GetExecPolicy1(memory_location); + HYPRE_Complex *A_data = hypre_StructMatrixData(A); + HYPRE_Int *A_const_indices = hypre_StructMatrixConstIndices(A); + hypre_StructStencil *A_stencil = hypre_StructMatrixStencil(A); + HYPRE_Int A_stencil_size = hypre_StructStencilSize(A_stencil); + hypre_Index *A_stencil_shape = hypre_StructStencilShape(A_stencil); + hypre_StructStencil *P_stencil = hypre_StructMatrixStencil(P); + hypre_Index *P_stencil_shape = hypre_StructStencilShape(P_stencil); + HYPRE_Int Pstenc1 = hypre_IndexD(P_stencil_shape[1], cdir); + HYPRE_Int Pstenc2 = hypre_IndexD(P_stencil_shape[2], cdir); + + HYPRE_Complex *A_const_data_h; + HYPRE_Complex Pconst0; + HYPRE_Complex Pconst1; + HYPRE_Complex Pconst2; + HYPRE_Int Astenc, si; HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("CC"); - stencil = hypre_StructMatrixStencil(A); - stencil_shape = hypre_StructStencilShape(stencil); - stencil_size = hypre_StructStencilSize(stencil); - - P_stencil = hypre_StructMatrixStencil(P); - P_stencil_shape = hypre_StructStencilShape(P_stencil); - - constant_coefficient = hypre_StructMatrixConstantCoefficient(A); - - /*---------------------------------------------------------- - * Find stencil enties in A corresponding to P - *----------------------------------------------------------*/ - - si0 = -1; - si1 = -1; - for (si = 0; si < stencil_size; si++) - { - mrk0 = 0; - mrk1 = 0; - for (d = 0; d < hypre_StructStencilNDim(stencil); d++) - { - if (hypre_IndexD(stencil_shape[si], d) == - hypre_IndexD(P_stencil_shape[0], d)) - { - mrk0++; - } - if (hypre_IndexD(stencil_shape[si], d) == - hypre_IndexD(P_stencil_shape[1], d)) - { - mrk1++; - } - } - if (mrk0 == hypre_StructStencilNDim(stencil)) - { - si0 = si; - } - if (mrk1 == hypre_StructStencilNDim(stencil)) - { - si1 = si; - } - } - - hypre_SetIndex3(stridec, 1, 1, 1); - - /*---------------------------------------------------------- - * Compute P - *----------------------------------------------------------*/ - - compute_boxes = hypre_StructGridBoxes(hypre_StructMatrixGrid(P)); - hypre_ForBoxI(i, compute_boxes) - { - compute_box = hypre_BoxArrayBox(compute_boxes, i); - - A_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A), i); - P_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(P), i); - - Pp0 = hypre_StructMatrixBoxData(P, i, 0); - Pp1 = hypre_StructMatrixBoxData(P, i, 1); - - Pstenc0 = hypre_IndexD(P_stencil_shape[0], cdir); - Pstenc1 = hypre_IndexD(P_stencil_shape[1], cdir); - - startc = hypre_BoxIMin(compute_box); - hypre_StructMapCoarseToFine(startc, findex, stride, start); - - hypre_BoxGetStrideSize(compute_box, stridec, loop_size); - - 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 ); - } - - 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 ); - } - - else - /* constant_coefficient == 0 , all coefficients in A vary */ - { -#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 ); -#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 ); - 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 ); - 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 ); - 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 ); - 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 ); - 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 ); - break; - default: - /* - hypre_PFMGSetupInterpOp_CC0 - ( i, A, A_dbox, cdir, stride, stridec, start, startc, loop_size, - P_dbox, Pstenc0, Pstenc1, Pp0, Pp1, rap_type, si0, si1 ); - */ - - hypre_printf("hypre error: unsupported stencil size %d\n", stencil_size); - hypre_MPI_Abort(hypre_MPI_COMM_WORLD, 1); - } -#endif - } - } - -#if 0 - hypre_StructMatrixAssemble(P); -#else - hypre_StructInterpAssemble(A, P, 0, cdir, findex, stride); -#endif - - HYPRE_ANNOTATE_FUNC_END; - - return hypre_error_flag; -} - -#if CC0_IMPLEMENTATION == 0 - -HYPRE_Int -hypre_PFMGSetupInterpOp_CC0 -( HYPRE_Int i, /* box index */ - 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_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) + /* Set host pointer to constant data entries in A */ + if (exec == HYPRE_EXEC_DEVICE) { - 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); + A_const_data_h = hypre_TAlloc(HYPRE_Complex, A_stencil_size, HYPRE_MEMORY_HOST); + hypre_TMemcpy(A_const_data_h, A_data, HYPRE_Complex, + A_stencil_size, HYPRE_MEMORY_HOST, memory_location); } else { - data_indices_boxi_d = data_indices[i]; - stencil_shape_d = stencil_shape; + A_const_data_h = A_data; } -#define DEVICE_VAR is_device_ptr(Pp0,Pp1,matrixA_data,stencil_shape_d,data_indices_boxi_d) - hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, - A_dbox, start, stride, Ai, - P_dbox, startc, stridec, Pi); + /* Compute the constant part of the stencil collapse (independent of boxes) */ + Pconst0 = 0.0; + Pconst1 = 0.0; + Pconst2 = 0.0; + for (si = 0; si < A_stencil_size; si++) { - HYPRE_Int si, mrk0, mrk1, Astenc; - HYPRE_Real center; - HYPRE_Real *Ap; - - center = 0.0; - Pp0[Pi] = 0.0; - Pp1[Pi] = 0.0; - mrk0 = 0; - mrk1 = 0; - - for (si = 0; si < stencil_size; si++) + if (hypre_StructMatrixConstEntry(A, si)) { -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - if (data_location != HYPRE_MEMORY_HOST) - { - Ap = matrixA_data + data_indices_boxi_d[si]; - Astenc = hypre_IndexD(stencil_shape_d[si], cdir); - } - else - { - Ap = hypre_StructMatrixBoxData(A, i, si); - Astenc = hypre_IndexD(stencil_shape[si], cdir); - } -#else - Ap = matrixA_data + data_indices_boxi_d[si]; - Astenc = hypre_IndexD(stencil_shape_d[si], cdir); -#endif + Astenc = hypre_IndexD(A_stencil_shape[si], cdir); if (Astenc == 0) { - center += Ap[Ai]; - } - else if (Astenc == Pstenc0) - { - Pp0[Pi] -= Ap[Ai]; + Pconst0 += A_const_data_h[A_const_indices[si]]; } else if (Astenc == Pstenc1) { - Pp1[Pi] -= Ap[Ai]; - } - - if (si == si0 && Ap[Ai] == 0.0) - { - mrk0++; + Pconst1 -= A_const_data_h[A_const_indices[si]]; } - if (si == si1 && Ap[Ai] == 0.0) + else if (Astenc == Pstenc2) { - mrk1++; + Pconst2 -= A_const_data_h[A_const_indices[si]]; } } - - if (!center) - { - //warning_cnt++; - Pp0[Pi] = 0.0; - Pp1[Pi] = 0.0; - } - else - { - Pp0[Pi] /= center; - Pp1[Pi] /= center; - } - - /*---------------------------------------------- - * Set interpolation weight to zero, if stencil - * entry in same direction is zero. Prevents - * interpolation and operator stencils reaching - * outside domain. - *----------------------------------------------*/ - if (mrk0 != 0) - { - Pp0[Pi] = 0.0; - } - if (mrk1 != 0) - { - Pp1[Pi] = 0.0; - } } - hypre_BoxLoop2End(Ai, Pi); -#undef DEVICE_VAR - if (warning_cnt) + /* Free memory */ + if (exec == HYPRE_EXEC_DEVICE) { - hypre_error_w_msg(HYPRE_ERROR_GENERIC, - "Warning 0 center in interpolation. Setting interp = 0."); + hypre_TFree(A_const_data_h, HYPRE_MEMORY_HOST); } - if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) - { - hypre_TFree(data_indices_boxi_d, memory_location); - hypre_TFree(stencil_shape_d, memory_location); - } + /* Set output pointers */ + *Pconst0_ptr = Pconst0; + *Pconst1_ptr = Pconst1; + *Pconst2_ptr = Pconst2; + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; return hypre_error_flag; } -#endif - -#if CC0_IMPLEMENTATION == 1 +/*-------------------------------------------------------------------------- + * hypre_PFMGSetupInterpOp_core_VC + * + * Core function to compute the variable part of the stencil collapse of the + * prolongation matrix. + *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_PFMGSetupInterpOp_CC0 -( HYPRE_Int i, /* box index */ - 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_PFMGSetupInterpOp_core_VC( hypre_StructMatrix *P, + hypre_StructMatrix *A, + HYPRE_Int cdir, + HYPRE_Complex Pconst0, + HYPRE_Complex Pconst1, + HYPRE_Complex Pconst2 ) { - 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 dim, si, loop_length = 1, Astenc; - HYPRE_Real *Ap, *center, *Ap0, *Ap1; - 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, memory_location); - - for (si = 0; si < stencil_size; si++) - { - Ap = hypre_StructMatrixBoxData(A, i, si); - Astenc = hypre_IndexD(stencil_shape[si], cdir); - - if (Astenc == 0) - { -#define DEVICE_VAR is_device_ptr(center, Ap) - hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, - A_dbox, start, stride, Ai, - P_dbox, startc, stridec, Pi) - center[idx] += Ap[Ai]; - hypre_BoxLoop2End(Ai, Pi) -#undef DEVICE_VAR - } - else if (Astenc == Pstenc0) - { -#define DEVICE_VAR is_device_ptr(Pp0, Ap) - hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, - A_dbox, start, stride, Ai, - P_dbox, startc, stridec, Pi) - Pp0[Pi] -= Ap[Ai]; - hypre_BoxLoop2End(Ai, Pi) -#undef DEVICE_VAR - } - else if (Astenc == Pstenc1) - { -#define DEVICE_VAR is_device_ptr(Pp1, Ap) - hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, - A_dbox, start, stride, Ai, - P_dbox, startc, stridec, Pi) - Pp1[Pi] -= Ap[Ai]; - hypre_BoxLoop2End(Ai, Pi) -#undef DEVICE_VAR - } - } - - Ap0 = hypre_StructMatrixBoxData(A, i, si0); - Ap1 = hypre_StructMatrixBoxData(A, i, si1); -#define DEVICE_VAR is_device_ptr(center, Pp0, Pp1, Ap0, Ap1) - 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; - } +#if defined(HYPRE_UNROLL_MAXDEPTH) +#undef HYPRE_UNROLL_MAXDEPTH +#endif +#define HYPRE_UNROLL_MAXDEPTH 9 +#define HYPRE_DECLARE_2VARS(n) \ + HYPRE_Complex *Ap##n = NULL; \ + HYPRE_Int As##n = 0 +#define HYPRE_UPDATE_VALUES(n) \ + do { \ + if ((As##n) == 0) mid[Pi] += Ap##n[Ai]; \ + else if ((As##n) == Pstenc1) Pp1[Pi] -= Ap##n[Ai]; \ + else if ((As##n) == Pstenc2) Pp2[Pi] -= Ap##n[Ai]; \ + } while (0) + + HYPRE_Int ndim = hypre_StructMatrixNDim(A); + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(P); + hypre_StructStencil *A_stencil = hypre_StructMatrixStencil(A); + HYPRE_Int A_stencil_size = hypre_StructStencilSize(A_stencil); + hypre_Index *A_stencil_shape = hypre_StructStencilShape(A_stencil); + hypre_StructStencil *P_stencil = hypre_StructMatrixStencil(P); + hypre_Index *P_stencil_shape = hypre_StructStencilShape(P_stencil); + HYPRE_Int Pstenc1 = hypre_IndexD(P_stencil_shape[1], cdir); + HYPRE_Int Pstenc2 = hypre_IndexD(P_stencil_shape[2], cdir); - if (Ap1[Ai] == 0.0 || cval == 0.0) - { - Pp1[Pi] = 0.0; - } - else - { - Pp1[Pi] /= cval; - } - hypre_BoxLoop2End(Ai, Pi) -#undef DEVICE_VAR + hypre_BoxArray *compute_boxes; + hypre_Box *compute_box; + hypre_Box *A_dbox; + hypre_Box *P_dbox; - if (warning_cnt) + HYPRE_Int P_dbox_volume; + HYPRE_Complex *Pp1, *Pp2, *mid; + + HYPRE_Complex *Ap_l0 = NULL, *Ap_r0 = NULL, *Ap_m0 = NULL; + HYPRE_Complex *Ap_l1 = NULL, *Ap_r1 = NULL, *Ap_m1 = NULL; + HYPRE_Complex *Ap_l2 = NULL, *Ap_r2 = NULL, *Ap_m2 = NULL; + HYPRE_Complex *Ap_l3 = NULL, *Ap_r3 = NULL, *Ap_m3 = NULL; + HYPRE_Complex *Ap_l4 = NULL, *Ap_r4 = NULL, *Ap_m4 = NULL; + HYPRE_Complex *Ap_l5 = NULL, *Ap_r5 = NULL, *Ap_m5 = NULL; + HYPRE_Complex *Ap_l6 = NULL, *Ap_r6 = NULL, *Ap_m6 = NULL; + HYPRE_Complex *Ap_l7 = NULL, *Ap_r7 = NULL, *Ap_m7 = NULL; + HYPRE_Complex *Ap_l8 = NULL, *Ap_r8 = NULL, *Ap_m8 = NULL; + + HYPRE_Int i, l, r, m, k, si; + HYPRE_Int depth, vdepth, vsi[HYPRE_UNROLL_MAXDEPTH]; + HYPRE_Int msi[HYPRE_MAX_MMTERMS]; + HYPRE_Int lsi[HYPRE_MAX_MMTERMS]; + HYPRE_Int rsi[HYPRE_MAX_MMTERMS]; + hypre_Index Astart, Astride, Pstart, Pstride; + hypre_Index origin, stride, loop_size; + HYPRE_DECLARE_2VARS(0); + HYPRE_DECLARE_2VARS(1); + HYPRE_DECLARE_2VARS(2); + HYPRE_DECLARE_2VARS(3); + HYPRE_DECLARE_2VARS(4); + HYPRE_DECLARE_2VARS(5); + HYPRE_DECLARE_2VARS(6); + HYPRE_DECLARE_2VARS(7); + HYPRE_DECLARE_2VARS(8); + + /* Sanity check */ + if (A_stencil_size >= HYPRE_MAX_MMTERMS) { hypre_error_w_msg(HYPRE_ERROR_GENERIC, - "Warning 0 center in interpolation. Setting interp = 0."); + "Reached max. stencil size! Increase HYPRE_MAX_MMTERMS!"); + return hypre_error_flag; } - hypre_TFree(center, memory_location); - - return hypre_error_flag; -} - -#endif - + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("VC"); -HYPRE_Int -hypre_PFMGSetupInterpOp_CC1 -( HYPRE_Int i, /* box index, doesn't matter */ - 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_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; - HYPRE_Real center; - HYPRE_Int Astenc; - HYPRE_Int mrk0, mrk1; - 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; - - Ai = hypre_CCBoxIndexRank(A_dbox, start ); - Pi = hypre_CCBoxIndexRank(P_dbox, startc); - - center = 0.0; - Pp0[Pi] = 0.0; - Pp1[Pi] = 0.0; - mrk0 = 0; - mrk1 = 0; - - for (si = 0; si < stencil_size; si++) + /* Gather stencil indices */ + for (i = 0, l = 0, r = 0, m = 0; i < A_stencil_size; i++) { - Ap = hypre_StructMatrixBoxData(A, i, si); - Astenc = hypre_IndexD(stencil_shape[si], cdir); - - if (Astenc == 0) - { - center += Ap[Ai]; - } - else if (Astenc == Pstenc0) - { - Pp0[Pi] -= Ap[Ai]; - } - else if (Astenc == Pstenc1) - { - Pp1[Pi] -= Ap[Ai]; - } - - if (si == si0 && Ap[Ai] == 0.0) + if (!hypre_StructMatrixConstEntry(A, i)) { - mrk0++; - } - if (si == si1 && Ap[Ai] == 0.0) - { - mrk1++; + if (hypre_IndexD(A_stencil_shape[i], cdir) == 0) + { + msi[m++] = i; + } + else if (hypre_IndexD(A_stencil_shape[i], cdir) == Pstenc1) + { + lsi[l++] = i; + } + else if (hypre_IndexD(A_stencil_shape[i], cdir) == Pstenc2) + { + rsi[r++] = i; + } } } - if (!center) - { - warning_cnt++; - Pp0[Pi] = 0.0; - Pp1[Pi] = 0.0; - } - else - { - Pp0[Pi] /= center; - Pp1[Pi] /= center; - } - /*---------------------------------------------- - * Set interpolation weight to zero, if stencil - * entry in same direction is zero. - * For variable coefficients, this was meant to prevent - * interpolation and operator stencils from reaching - * outside the domain. - * For constant coefficients it will hardly ever happen - * (means the stencil point shouldn't have been defined there) - * but it's possible and then it would still make sense to - * do this. - *----------------------------------------------*/ - if (mrk0 != 0) - { - Pp0[Pi] = 0.0; - } - if (mrk1 != 0) - { - Pp1[Pi] = 0.0; - } +#if defined(DEBUG_PFMG) + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "=== PFMG Interp Stencil ===\n"); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "Number of (left, right, middle) stencil. entries: (%d, %d, %d)\n", l ,r, m); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "=== PFMG Interp Stencil ===\n"); +#endif - if (warning_cnt) - { - hypre_error_w_msg( - HYPRE_ERROR_GENERIC, - "Warning 0 center in interpolation. Setting interp = 0."); - } + /* Off-diagonal entries are variable */ + compute_box = hypre_BoxCreate(ndim); - return hypre_error_flag; -} + /* Get the stencil space on the base grid for entry 1 of P (valid also for entry 2) */ + hypre_StructMatrixGetStencilSpace(P, 1, 0, origin, stride); -HYPRE_Int -hypre_PFMGSetupInterpOp_CC2 -( HYPRE_Int i, /* box index */ - 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 si; - HYPRE_Int Ai; - HYPRE_Int Pi; - HYPRE_Real *Ap; - HYPRE_Real P0, P1; - HYPRE_Real center_offd; - HYPRE_Int Astenc; - HYPRE_Int mrk0_offd, mrk1_offd; - hypre_StructStencil *stencil = hypre_StructMatrixStencil(A); - hypre_Index *stencil_shape = hypre_StructStencilShape(stencil); - HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); - hypre_Index diag_index; - HYPRE_Int diag_rank; - HYPRE_Int warning_cnt = 0; - - hypre_SetIndex3(diag_index, 0, 0, 0); - diag_rank = hypre_StructStencilElementRank(stencil, diag_index); - - if ( rap_type != 0 ) - { - /* simply force P to be constant coefficient, all 0.5's */ - Pi = hypre_CCBoxIndexRank(P_dbox, startc); - Pp0[Pi] = 0.5; - Pp1[Pi] = 0.5; - } - else + hypre_CopyToIndex(stride, ndim, Astride); + hypre_StructMatrixMapDataStride(A, Astride); + hypre_CopyToIndex(stride, ndim, Pstride); + hypre_StructMatrixMapDataStride(P, Pstride); + + compute_boxes = hypre_StructGridBoxes(hypre_StructMatrixGrid(P)); + hypre_ForBoxI(i, compute_boxes) { - /* Most coeffients of A go into P like for constant_coefficient=1. - But P is entirely variable coefficient, because the diagonal of A is - 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 ); - - center_offd = 0.0; - P0 = 0.0; - P1 = 0.0; - mrk0_offd = 0; - mrk1_offd = 0; - - for (si = 0; si < stencil_size; si++) - { - if ( si != diag_rank ) - { - Ap = hypre_StructMatrixBoxData(A, i, si); - Astenc = hypre_IndexD(stencil_shape[si], cdir); + hypre_CopyBox(hypre_BoxArrayBox(compute_boxes, i), compute_box); + hypre_ProjectBox(compute_box, origin, stride); + hypre_CopyToIndex(hypre_BoxIMin(compute_box), ndim, Astart); + hypre_StructMatrixMapDataIndex(A, Astart); + hypre_CopyToIndex(hypre_BoxIMin(compute_box), ndim, Pstart); + hypre_StructMatrixMapDataIndex(P, Pstart); - if (Astenc == 0) + A_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A), i); + P_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(P), i); + + Pp1 = hypre_StructMatrixBoxData(P, i, 1); + Pp2 = hypre_StructMatrixBoxData(P, i, 2); + + hypre_BoxGetStrideSize(compute_box, stride, loop_size); + + if (1 && l == 1 && r == 1 && m == 5) + { + /* Load data pointers - Left: 1 | Right: 1 | Middle: 5 */ + Ap_l0 = hypre_StructMatrixBoxData(A, i, lsi[0]); + Ap_r0 = hypre_StructMatrixBoxData(A, i, rsi[0]); + Ap_m0 = hypre_StructMatrixBoxData(A, i, msi[0]); + Ap_m1 = hypre_StructMatrixBoxData(A, i, msi[1]); + Ap_m2 = hypre_StructMatrixBoxData(A, i, msi[2]); + Ap_m3 = hypre_StructMatrixBoxData(A, i, msi[3]); + Ap_m4 = hypre_StructMatrixBoxData(A, i, msi[4]); + hypre_BoxLoop2Begin(ndim, loop_size, + A_dbox, Astart, Astride, Ai, + P_dbox, Pstart, Pstride, Pi); + { + HYPRE_Complex center = Pconst0 + Ap_m0[Ai] + Ap_m1[Ai] + Ap_m2[Ai] + Ap_m3[Ai] + Ap_m4[Ai]; + if (center) { - center_offd += Ap[Ai]; + Pp1[Pi] = (Pconst1 - Ap_l0[Ai]) / center; + Pp2[Pi] = (Pconst2 - Ap_r0[Ai]) / center; } - else if (Astenc == Pstenc0) + else { - P0 -= Ap[Ai]; + Pp1[Pi] = 0.0; + Pp2[Pi] = 0.0; } - else if (Astenc == Pstenc1) + } + hypre_BoxLoop2End(Ai, Pi); + } + else if (1 && l == 3 && r == 3 && m == 9) + { + /* Load data pointers - Left: 3 | Right: 3 | Middle: 9 */ + Ap_l0 = hypre_StructMatrixBoxData(A, i, lsi[0]); + Ap_l1 = hypre_StructMatrixBoxData(A, i, lsi[1]); + Ap_l2 = hypre_StructMatrixBoxData(A, i, lsi[2]); + Ap_r0 = hypre_StructMatrixBoxData(A, i, rsi[0]); + Ap_r1 = hypre_StructMatrixBoxData(A, i, rsi[1]); + Ap_r2 = hypre_StructMatrixBoxData(A, i, rsi[2]); + Ap_m0 = hypre_StructMatrixBoxData(A, i, msi[0]); + Ap_m1 = hypre_StructMatrixBoxData(A, i, msi[1]); + Ap_m2 = hypre_StructMatrixBoxData(A, i, msi[2]); + Ap_m3 = hypre_StructMatrixBoxData(A, i, msi[3]); + Ap_m4 = hypre_StructMatrixBoxData(A, i, msi[4]); + Ap_m5 = hypre_StructMatrixBoxData(A, i, msi[5]); + Ap_m6 = hypre_StructMatrixBoxData(A, i, msi[6]); + Ap_m7 = hypre_StructMatrixBoxData(A, i, msi[7]); + Ap_m8 = hypre_StructMatrixBoxData(A, i, msi[8]); + hypre_BoxLoop2Begin(ndim, loop_size, + A_dbox, Astart, Astride, Ai, + P_dbox, Pstart, Pstride, Pi); + { + HYPRE_Complex center = Pconst0 + Ap_m0[Ai] + Ap_m1[Ai] + Ap_m2[Ai] + Ap_m3[Ai] + + Ap_m4[Ai] + Ap_m5[Ai] + Ap_m6[Ai] + Ap_m7[Ai] + Ap_m8[Ai]; + + if (center) { - P1 -= Ap[Ai]; + Pp1[Pi] = (Pconst1 - Ap_l0[Ai] - Ap_l1[Ai] - Ap_l2[Ai]) / center; + Pp2[Pi] = (Pconst2 - Ap_r0[Ai] - Ap_r1[Ai] - Ap_r2[Ai]) / center; } - - if (si == si0 && Ap[Ai] == 0.0) + else + { + Pp1[Pi] = 0.0; + Pp2[Pi] = 0.0; + } + } + hypre_BoxLoop2End(Ai, Pi); + } + else if (1 && l == 9 && r == 9 && m == 9) + { + /* Load data pointers - Left: 9 | Right: 9 | Middle: 9 */ + Ap_l0 = hypre_StructMatrixBoxData(A, i, lsi[0]); + Ap_l1 = hypre_StructMatrixBoxData(A, i, lsi[1]); + Ap_l2 = hypre_StructMatrixBoxData(A, i, lsi[2]); + Ap_l3 = hypre_StructMatrixBoxData(A, i, lsi[3]); + Ap_l4 = hypre_StructMatrixBoxData(A, i, lsi[4]); + Ap_l5 = hypre_StructMatrixBoxData(A, i, lsi[5]); + Ap_l6 = hypre_StructMatrixBoxData(A, i, lsi[6]); + Ap_l7 = hypre_StructMatrixBoxData(A, i, lsi[7]); + Ap_l8 = hypre_StructMatrixBoxData(A, i, lsi[8]); + Ap_r0 = hypre_StructMatrixBoxData(A, i, rsi[0]); + Ap_r1 = hypre_StructMatrixBoxData(A, i, rsi[1]); + Ap_r2 = hypre_StructMatrixBoxData(A, i, rsi[2]); + Ap_r3 = hypre_StructMatrixBoxData(A, i, rsi[3]); + Ap_r4 = hypre_StructMatrixBoxData(A, i, rsi[4]); + Ap_r5 = hypre_StructMatrixBoxData(A, i, rsi[5]); + Ap_r6 = hypre_StructMatrixBoxData(A, i, rsi[6]); + Ap_r7 = hypre_StructMatrixBoxData(A, i, rsi[7]); + Ap_r8 = hypre_StructMatrixBoxData(A, i, rsi[8]); + Ap_m0 = hypre_StructMatrixBoxData(A, i, msi[0]); + Ap_m1 = hypre_StructMatrixBoxData(A, i, msi[1]); + Ap_m2 = hypre_StructMatrixBoxData(A, i, msi[2]); + Ap_m3 = hypre_StructMatrixBoxData(A, i, msi[3]); + Ap_m4 = hypre_StructMatrixBoxData(A, i, msi[4]); + Ap_m5 = hypre_StructMatrixBoxData(A, i, msi[5]); + Ap_m6 = hypre_StructMatrixBoxData(A, i, msi[6]); + Ap_m7 = hypre_StructMatrixBoxData(A, i, msi[7]); + Ap_m8 = hypre_StructMatrixBoxData(A, i, msi[8]); + hypre_BoxLoop2Begin(ndim, loop_size, + A_dbox, Astart, Astride, Ai, + P_dbox, Pstart, Pstride, Pi); + { + HYPRE_Complex center = Pconst0 + Ap_m0[Ai] + Ap_m1[Ai] + Ap_m2[Ai] + Ap_m3[Ai] + + Ap_m4[Ai] + Ap_m5[Ai] + Ap_m6[Ai] + Ap_m7[Ai] + Ap_m8[Ai]; + + if (center) { - mrk0_offd++; + Pp1[Pi] = (Pconst1 - Ap_l0[Ai] - Ap_l1[Ai] - Ap_l2[Ai] - Ap_l3[Ai] - + Ap_l4[Ai] - Ap_l5[Ai] - Ap_l6[Ai] - Ap_l7[Ai] - Ap_l8[Ai]) / center; + Pp2[Pi] = (Pconst2 - Ap_r0[Ai] - Ap_r1[Ai] - Ap_r2[Ai] - Ap_r3[Ai] - + Ap_r4[Ai] - Ap_r5[Ai] - Ap_r6[Ai] - Ap_r7[Ai] - Ap_r8[Ai]) / center; } - if (si == si1 && Ap[Ai] == 0.0) + else { - mrk1_offd++; + Pp1[Pi] = 0.0; + Pp2[Pi] = 0.0; } } + hypre_BoxLoop2End(Ai, Pi); } - - si = diag_rank; - - HYPRE_Real *Ap = hypre_StructMatrixBoxData(A, i, si); - -#define DEVICE_VAR is_device_ptr(Pp0,Pp1,Ap) - hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, - A_dbox, start, stride, Ai, - P_dbox, startc, stridec, Pi); + else { - HYPRE_Int mrk0, mrk1; - HYPRE_Real center; - HYPRE_Real p0val, p1val; - - p0val = P0; - p1val = P1; - center = center_offd; - mrk0 = mrk0_offd; - mrk1 = mrk1_offd; - - /* RL: Astenc is only needed for assertion, comment out - Astenc = hypre_IndexD(stencil_shape[si], cdir); - hypre_assert( Astenc==0 ); - */ - - center += Ap[Ai]; + /* Allocate array for storing center coefficient */ + P_dbox_volume = hypre_BoxVolume(P_dbox); + mid = hypre_TAlloc(HYPRE_Complex, P_dbox_volume, memory_location); - //if (si == si0 && Ap[Ai] == 0.0) - // mrk0++; - //if (si == si1 && Ap[Ai] == 0.0) - // mrk1++; - - if (!center) - { - //warning_cnt++; - p0val = 0.0; - p1val = 0.0; - } - else + /* Phase 1: Set initial coefficient values in P */ + hypre_BoxLoop1Begin(ndim, loop_size, P_dbox, Pstart, Pstride, Pi); { - p0val /= center; - p1val /= center; + mid[Pi] = Pconst0; + Pp1[Pi] = Pconst1; + Pp2[Pi] = Pconst2; } + hypre_BoxLoop1End(Pi); - /*---------------------------------------------- - * Set interpolation weight to zero, if stencil - * entry in same direction is zero. Prevents - * interpolation and operator stencils reaching - * outside domain. - *----------------------------------------------*/ - if (mrk0 != 0) - { - p0val = 0.0; - } - if (mrk1 != 0) + /* Phase 2: Update coefficients in P with variable coefficients from A */ + for (si = 0; si < A_stencil_size; si += HYPRE_UNROLL_MAXDEPTH) { - p1val = 0.0; - } - Pp0[Pi] = p0val; - Pp1[Pi] = p1val; - - } - hypre_BoxLoop2End(Ai, Pi); -#undef DEVICE_VAR - } + depth = hypre_min(HYPRE_UNROLL_MAXDEPTH, (A_stencil_size - si)); + for (k = 0, vdepth = 0; k < depth; k++) + { + if (!hypre_StructMatrixConstEntry(A, si + k)) + { + vsi[vdepth++] = si + k; + } + } - if (warning_cnt) - { - hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Warning 0 center in interpolation. Setting interp = 0."); - } + /* Exit loop if there are no variable stencil coefficients left */ + if (!vdepth) + { + continue; + } - return hypre_error_flag; -} + switch (vdepth) + { + case 9: + Ap8 = hypre_StructMatrixBoxData(A, i, vsi[8]); + As8 = hypre_IndexD(A_stencil_shape[vsi[8]], cdir); + HYPRE_FALLTHROUGH; + + case 8: + Ap7 = hypre_StructMatrixBoxData(A, i, vsi[7]); + As7 = hypre_IndexD(A_stencil_shape[vsi[7]], cdir); + HYPRE_FALLTHROUGH; + + case 7: + Ap6 = hypre_StructMatrixBoxData(A, i, vsi[6]); + As6 = hypre_IndexD(A_stencil_shape[vsi[6]], cdir); + HYPRE_FALLTHROUGH; + + case 6: + Ap5 = hypre_StructMatrixBoxData(A, i, vsi[5]); + As5 = hypre_IndexD(A_stencil_shape[vsi[5]], cdir); + HYPRE_FALLTHROUGH; + + case 5: + Ap4 = hypre_StructMatrixBoxData(A, i, vsi[4]); + As4 = hypre_IndexD(A_stencil_shape[vsi[4]], cdir); + HYPRE_FALLTHROUGH; + + case 4: + Ap3 = hypre_StructMatrixBoxData(A, i, vsi[3]); + As3 = hypre_IndexD(A_stencil_shape[vsi[3]], cdir); + HYPRE_FALLTHROUGH; + + case 3: + Ap2 = hypre_StructMatrixBoxData(A, i, vsi[2]); + As2 = hypre_IndexD(A_stencil_shape[vsi[2]], cdir); + HYPRE_FALLTHROUGH; + + case 2: + Ap1 = hypre_StructMatrixBoxData(A, i, vsi[1]); + As1 = hypre_IndexD(A_stencil_shape[vsi[1]], cdir); + HYPRE_FALLTHROUGH; -#if CC0_IMPLEMENTATION > 1 + case 1: + Ap0 = hypre_StructMatrixBoxData(A, i, vsi[0]); + As0 = hypre_IndexD(A_stencil_shape[vsi[0]], cdir); + } -HYPRE_Int -hypre_PFMGSetupInterpOp_CC0_SS5 -( HYPRE_Int i, /* box index */ - 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_UNUSED_VAR(rap_type); - HYPRE_UNUSED_VAR(Pstenc1); + switch (vdepth) + { + case 9: + hypre_BoxLoop2Begin(ndim, loop_size, + A_dbox, Astart, Astride, Ai, + P_dbox, Pstart, Pstride, Pi); + { + HYPRE_UPDATE_VALUES(8); + HYPRE_UPDATE_VALUES(7); + HYPRE_UPDATE_VALUES(6); + HYPRE_UPDATE_VALUES(5); + HYPRE_UPDATE_VALUES(4); + HYPRE_UPDATE_VALUES(3); + HYPRE_UPDATE_VALUES(2); + HYPRE_UPDATE_VALUES(1); + HYPRE_UPDATE_VALUES(0); + } + hypre_BoxLoop2End(Ai, Pi); + break; - //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; + case 8: + hypre_BoxLoop2Begin(ndim, loop_size, + A_dbox, Astart, Astride, Ai, + P_dbox, Pstart, Pstride, Pi); + { + HYPRE_UPDATE_VALUES(7); + HYPRE_UPDATE_VALUES(6); + HYPRE_UPDATE_VALUES(5); + HYPRE_UPDATE_VALUES(4); + HYPRE_UPDATE_VALUES(3); + HYPRE_UPDATE_VALUES(2); + HYPRE_UPDATE_VALUES(1); + HYPRE_UPDATE_VALUES(0); + } + hypre_BoxLoop2End(Ai, Pi); + break; - hypre_Index index; - HYPRE_Real *a_cc, *a_cw, *a_ce, *a_cs, *a_cn; - HYPRE_Real *p0, *p1; + case 7: + hypre_BoxLoop2Begin(ndim, loop_size, + A_dbox, Astart, Astride, Ai, + P_dbox, Pstart, Pstride, Pi); + { + HYPRE_UPDATE_VALUES(6); + HYPRE_UPDATE_VALUES(5); + HYPRE_UPDATE_VALUES(4); + HYPRE_UPDATE_VALUES(3); + HYPRE_UPDATE_VALUES(2); + HYPRE_UPDATE_VALUES(1); + HYPRE_UPDATE_VALUES(0); + } + hypre_BoxLoop2End(Ai, Pi); + break; - p0 = hypre_StructMatrixExtractPointerByIndex(A, i, P_stencil_shape[0]); - p1 = hypre_StructMatrixExtractPointerByIndex(A, i, P_stencil_shape[1]); + case 6: + hypre_BoxLoop2Begin(ndim, loop_size, + A_dbox, Astart, Astride, Ai, + P_dbox, Pstart, Pstride, Pi); + { + HYPRE_UPDATE_VALUES(5); + HYPRE_UPDATE_VALUES(4); + HYPRE_UPDATE_VALUES(3); + HYPRE_UPDATE_VALUES(2); + HYPRE_UPDATE_VALUES(1); + HYPRE_UPDATE_VALUES(0); + } + hypre_BoxLoop2End(Ai, Pi); + break; - /*----------------------------------------------------------------- - * Extract pointers for 5-point fine grid operator: - * - * a_cc is pointer for center coefficient - * a_cw is pointer for west coefficient - * a_ce is pointer for east coefficient - * a_cs is pointer for south coefficient - * a_cn is pointer for north coefficient - *-----------------------------------------------------------------*/ + case 5: + hypre_BoxLoop2Begin(ndim, loop_size, + A_dbox, Astart, Astride, Ai, + P_dbox, Pstart, Pstride, Pi); + { + HYPRE_UPDATE_VALUES(4); + HYPRE_UPDATE_VALUES(3); + HYPRE_UPDATE_VALUES(2); + HYPRE_UPDATE_VALUES(1); + HYPRE_UPDATE_VALUES(0); + } + hypre_BoxLoop2End(Ai, Pi); + break; - hypre_SetIndex3(index, 0, 0, 0); - a_cc = hypre_StructMatrixExtractPointerByIndex(A, i, index); + case 4: + hypre_BoxLoop2Begin(ndim, loop_size, + A_dbox, Astart, Astride, Ai, + P_dbox, Pstart, Pstride, Pi); + { + HYPRE_UPDATE_VALUES(3); + HYPRE_UPDATE_VALUES(2); + HYPRE_UPDATE_VALUES(1); + HYPRE_UPDATE_VALUES(0); + } + hypre_BoxLoop2End(Ai, Pi); + break; - hypre_SetIndex3(index, -1, 0, 0); - a_cw = hypre_StructMatrixExtractPointerByIndex(A, i, index); + case 3: + hypre_BoxLoop2Begin(ndim, loop_size, + A_dbox, Astart, Astride, Ai, + P_dbox, Pstart, Pstride, Pi); + { + HYPRE_UPDATE_VALUES(2); + HYPRE_UPDATE_VALUES(1); + HYPRE_UPDATE_VALUES(0); + } + hypre_BoxLoop2End(Ai, Pi); + break; - hypre_SetIndex3(index, 1, 0, 0); - a_ce = hypre_StructMatrixExtractPointerByIndex(A, i, index); + case 2: + hypre_BoxLoop2Begin(ndim, loop_size, + A_dbox, Astart, Astride, Ai, + P_dbox, Pstart, Pstride, Pi); + { + HYPRE_UPDATE_VALUES(1); + HYPRE_UPDATE_VALUES(0); + } + hypre_BoxLoop2End(Ai, Pi); + break; - hypre_SetIndex3(index, 0, -1, 0); - a_cs = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - 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) - hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, - A_dbox, start, stride, Ai, - P_dbox, startc, stridec, Pi); - { - 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]; - break; - case 1: default: - center = a_cc[Ai] + a_cw[Ai] + a_ce[Ai]; - left = -a_cs[Ai]; - right = -a_cn[Ai]; - break; - } - - if (!center) - { - //warning_cnt++; - Pp0[Pi] = 0.0; - Pp1[Pi] = 0.0; - } - else - { - switch (Pstenc0) - { - case -1: - Pp0[Pi] = left / center; - break; - case 1: - Pp0[Pi] = right / center; - break; - } - - switch (Pstenc1) - { - case -1: - Pp1[Pi] = left / center; - break; - case 1: - Pp1[Pi] = right / center; - break; - } - } - - 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 - * interpolation and operator stencils reaching - * outside domain. - *----------------------------------------------*/ - //if (mrk0 != 0) - // Pp0[Pi] = 0.0; - //if (mrk1 != 0) - // Pp1[Pi] = 0.0; - } - hypre_BoxLoop2End(Ai, Pi); -#undef DEVICE_VAR - - return hypre_error_flag; -} - -HYPRE_Int -hypre_PFMGSetupInterpOp_CC0_SS9 -( HYPRE_Int i, /* box index */ - 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_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; - - p0 = hypre_StructMatrixExtractPointerByIndex(A, i, P_stencil_shape[0]); - p1 = hypre_StructMatrixExtractPointerByIndex(A, i, P_stencil_shape[1]); - /*----------------------------------------------------------------- - * Extract pointers for 5-point grid operator: - * - * a_cc is pointer for center coefficient - * a_cw is pointer for west coefficient - * a_ce is pointer for east coefficient - * a_cs is pointer for south coefficient - * a_cn is pointer for north coefficient - *-----------------------------------------------------------------*/ - - hypre_SetIndex3(index, 0, 0, 0); - a_cc = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, -1, 0, 0); - a_cw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 1, 0, 0); - a_ce = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 0, -1, 0); - a_cs = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 0, 1, 0); - a_cn = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - /*----------------------------------------------------------------- - * Extract additional pointers for 9-point grid operator: - * - * a_csw is pointer for southwest coefficient - * a_cse is pointer for southeast coefficient - * a_cnw is pointer for northwest coefficient - * a_cne is pointer for northeast coefficient - *-----------------------------------------------------------------*/ - - hypre_SetIndex3(index, -1, -1, 0); - a_csw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 1, -1, 0); - a_cse = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, -1, 1, 0); - a_cnw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 1, 1, 0); - a_cne = hypre_StructMatrixExtractPointerByIndex(A, i, index); - -#define DEVICE_VAR is_device_ptr(a_cc,a_cs,a_cn,a_cw,a_csw,a_cnw,a_ce,a_cse,a_cne,Pp0,Pp1,p0,p1) - hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, - A_dbox, start, stride, Ai, - P_dbox, startc, stridec, Pi); - { - 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]; - break; - 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]; - break; - }; - - if (!center) - { - //warning_cnt++; - Pp0[Pi] = 0.0; - Pp1[Pi] = 0.0; - } - else - { - switch (Pstenc0) - { - case -1: - Pp0[Pi] = left / center; - Pp1[Pi] = right / center; - break; - case 1: - Pp0[Pi] = right / center; - Pp1[Pi] = left / center; - break; - }; - /* - switch (Pstenc1) - { - case -1: - Pp1[Pi] = left/center;break; - case 1: - Pp1[Pi] = right/center;break; - }; - */ - } - - 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 - - return hypre_error_flag; -} - -HYPRE_Int -hypre_PFMGSetupInterpOp_CC0_SS7 -( HYPRE_Int i, /* box index */ - 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_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; - - p0 = hypre_StructMatrixExtractPointerByIndex(A, i, P_stencil_shape[0]); - p1 = hypre_StructMatrixExtractPointerByIndex(A, i, P_stencil_shape[1]); - - /*----------------------------------------------------------------- - * Extract pointers for 7-point grid operator: - * - * a_cc is pointer for center coefficient - * a_cw is pointer for west coefficient in same plane - * a_ce is pointer for east coefficient in same plane - * a_cs is pointer for south coefficient in same plane - * a_cn is pointer for north coefficient in same plane - * a_ac is pointer for center coefficient in plane above - * a_bc is pointer for center coefficient in plane below - *-----------------------------------------------------------------*/ - - hypre_SetIndex3(index, 0, 0, 0); - a_cc = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, -1, 0, 0); - a_cw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 1, 0, 0); - a_ce = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 0, -1, 0); - a_cs = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 0, 1, 0); - a_cn = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 0, 0, 1); - a_ac = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - 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) - hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, - A_dbox, start, stride, Ai, - P_dbox, startc, stridec, Pi); - { - 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]; - 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]; - break; - 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]; - break; - }; - - if (!center) - { - Pp0[Pi] = 0.0; - Pp1[Pi] = 0.0; - } - else - { - switch (Pstenc0) - { - case -1: - Pp0[Pi] = left / center; - Pp1[Pi] = right / center; - break; - case 1: - Pp0[Pi] = right / center; - Pp1[Pi] = left / center; - break; - }; - /* - switch (Pstenc1) - { - case -1: - Pp1[Pi] = left/center;break; - case 1: - Pp1[Pi] = right/center;break; - }; - */ - } - - 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]); - } - hypre_BoxLoop2End(Ai, Pi); -#undef DEVICE_VAR - - return hypre_error_flag; -} - - -HYPRE_Int -hypre_PFMGSetupInterpOp_CC0_SS15 -( HYPRE_Int i, /* box index */ - 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_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; - - p0 = hypre_StructMatrixExtractPointerByIndex(A, i, P_stencil_shape[0]); - p1 = hypre_StructMatrixExtractPointerByIndex(A, i, P_stencil_shape[1]); - - /*----------------------------------------------------------------- - * Extract pointers for 7-point grid operator: - * - * a_cc is pointer for center coefficient - * a_cw is pointer for west coefficient in same plane - * a_ce is pointer for east coefficient in same plane - * a_cs is pointer for south coefficient in same plane - * a_cn is pointer for north coefficient in same plane - * a_ac is pointer for center coefficient in plane above - * a_bc is pointer for center coefficient in plane below - *-----------------------------------------------------------------*/ - - hypre_SetIndex3(index, 0, 0, 0); - a_cc = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, -1, 0, 0); - a_cw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 1, 0, 0); - a_ce = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 0, -1, 0); - a_cs = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 0, 1, 0); - a_cn = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 0, 0, 1); - a_ac = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 0, 0, -1); - a_bc = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - /*----------------------------------------------------------------- - * Extract additional pointers for 15-point fine grid operator: - * - * a_aw is pointer for west coefficient in plane above - * a_ae is pointer for east coefficient in plane above - * a_as is pointer for south coefficient in plane above - * a_an is pointer for north coefficient in plane above - * a_bw is pointer for west coefficient in plane below - * a_be is pointer for east coefficient in plane below - * a_bs is pointer for south coefficient in plane below - * a_bn is pointer for north coefficient in plane below - * a_csw is pointer for southwest coefficient in same plane - * a_cse is pointer for southeast coefficient in same plane - * a_cnw is pointer for northwest coefficient in same plane - * a_cne is pointer for northeast coefficient in same plane - *-----------------------------------------------------------------*/ - - 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); - 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); - a_bw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 1, 0, -1); - a_be = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 0, -1, -1); - a_bs = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 0, 1, -1); - a_bn = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, -1, -1, 0); - a_csw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 1, -1, 0); - a_cse = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, -1, 1, 0); - a_cnw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 1, 1, 0); - a_cne = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - if (a_csw) - { - if (a_as) - { - stencil_type15 = 1; - } - else - { - stencil_type15 = 0; - } - } - else - { - stencil_type15 = 2; - } - - //printf("loop_size %d %d %d, cdir %d, %p %p %p %p %p %p %p %p %p %p %p %p %p %p %p\n", loop_size[0], loop_size[1], loop_size[2], cdir, a_cc, a_cw, a_ce, a_ac, a_bc, a_cs, a_as, a_bs, a_csw, a_cse, a_cn, a_an, a_bn, a_cnw, a_cne); - -#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_ce,a_ae,a_be,a_cnw,a_cne,a_csw,a_cse,Pp0,Pp1,p0,p1) - if (stencil_type15 == 0) - { - hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, - A_dbox, start, stride, Ai, - P_dbox, startc, stridec, Pi); - { - 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] - 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_aw[Ai] + a_ae[Ai] + - a_bc[Ai] + a_bw[Ai] + a_be[Ai]; - 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: 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]; /* below */ - right = -a_ac[Ai] - a_aw[Ai] - a_ae[Ai]; /* above */ - break; - } - - if (!center) - { - Pp0[Pi] = 0.0; - Pp1[Pi] = 0.0; - } - else - { - switch (Pstenc0) - { - case -1: - Pp0[Pi] = left / center; - Pp1[Pi] = right / center; - break; case 1: - Pp0[Pi] = right / center; - Pp1[Pi] = left / center; + hypre_BoxLoop2Begin(ndim, loop_size, + A_dbox, Astart, Astride, Ai, + P_dbox, Pstart, Pstride, Pi); + { + HYPRE_UPDATE_VALUES(0); + } + hypre_BoxLoop2End(Ai, Pi); break; } } - if (p0[Ai] == 0.0) - { - Pp0[Pi] = 0.0; - } - if (p1[Ai] == 0.0) - { - Pp1[Pi] = 0.0; - } - } - hypre_BoxLoop2End(Ai, Pi); - } - else if (stencil_type15 == 1) - { - hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, - A_dbox, start, stride, Ai, - P_dbox, startc, stridec, Pi); - { - HYPRE_Real center, left, right; - - switch (cdir) - { - case 0: - center = a_cc[Ai] + a_cs[Ai] + a_cn[Ai] + a_ac[Ai] + a_as[Ai] + a_an[Ai] + - a_bc[Ai] + a_bs[Ai] + a_bn[Ai]; - left = -a_cw[Ai] - a_csw[Ai] - a_cnw[Ai]; - right = -a_ce[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]; - 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: 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 */ - right = -a_ac[Ai] - a_as[Ai] - a_an[Ai]; /* above */ - break; - } - - if (!center) + /* Phase 3: set final coefficients */ + hypre_BoxLoop1Begin(ndim, loop_size, P_dbox, Pstart, Pstride, Pi); { - Pp0[Pi] = 0.0; - Pp1[Pi] = 0.0; - } - else - { - switch (Pstenc0) + if (mid[Pi]) { - case -1: - Pp0[Pi] = left / center; - Pp1[Pi] = right / center; - break; - case 1: - Pp0[Pi] = right / center; - Pp1[Pi] = left / center; - break; + /* Average out prolongation coefficients */ + Pp1[Pi] /= mid[Pi]; + Pp2[Pi] /= mid[Pi]; + } + else + { + /* For some reason the interpolation coefficients sum to zero */ + Pp1[Pi] = 0.0; + Pp2[Pi] = 0.0; } } + hypre_BoxLoop1End(Pi); - if (p0[Ai] == 0.0) - { - Pp0[Pi] = 0.0; - } - if (p1[Ai] == 0.0) - { - Pp1[Pi] = 0.0; - } + /* Free memory */ + hypre_TFree(mid, memory_location); } - hypre_BoxLoop2End(Ai, Pi); } - else - { - hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, - A_dbox, start, stride, Ai, - P_dbox, startc, stridec, Pi); - { - HYPRE_Real center, left, right; - switch (cdir) - { - case 0: - center = a_cc[Ai] + a_cs[Ai] + a_cn[Ai] + a_ac[Ai] + a_as[Ai] + a_an[Ai] + - a_bc[Ai] + a_bs[Ai] + a_bn[Ai]; - left = -a_cw[Ai] - a_aw[Ai] - a_bw[Ai]; - right = -a_ce[Ai] - a_ae[Ai] - a_be[Ai]; - break; - case 1: - center = a_cc[Ai] + a_cw[Ai] + a_ce[Ai] + a_ac[Ai] + a_aw[Ai] + a_ae[Ai] + - a_bc[Ai] + a_bw[Ai] + a_be[Ai]; - 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: 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 */ - break; - } + /* Free memory */ + hypre_BoxDestroy(compute_box); - if (!center) - { - Pp0[Pi] = 0.0; - Pp1[Pi] = 0.0; - } - else - { - switch (Pstenc0) - { - case -1: - Pp0[Pi] = left / center; - Pp1[Pi] = right / center; - break; - case 1: - Pp0[Pi] = right / center; - Pp1[Pi] = left / center; - break; - } - } +#undef HYPRE_UPDATE_VALUES +#undef HYPRE_UNROLL_MAXDEPTH - 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 + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_PFMGSetupInterpOp_CC0_SS19 -( HYPRE_Int i, /* box index */ - 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_PFMGSetupInterpOp( hypre_StructMatrix *P, + hypre_StructMatrix *A, + HYPRE_Int cdir ) { - 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; - - p0 = hypre_StructMatrixExtractPointerByIndex(A, i, P_stencil_shape[0]); - p1 = hypre_StructMatrixExtractPointerByIndex(A, i, P_stencil_shape[1]); - - /*----------------------------------------------------------------- - * Extract pointers for 7-point grid operator: - * - * a_cc is pointer for center coefficient - * a_cw is pointer for west coefficient in same plane - * a_ce is pointer for east coefficient in same plane - * a_cs is pointer for south coefficient in same plane - * a_cn is pointer for north coefficient in same plane - * a_ac is pointer for center coefficient in plane above - * a_bc is pointer for center coefficient in plane below - *-----------------------------------------------------------------*/ - - hypre_SetIndex3(index, 0, 0, 0); - a_cc = hypre_StructMatrixExtractPointerByIndex(A, i, index); + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(P); + HYPRE_Int constant; - hypre_SetIndex3(index, -1, 0, 0); - a_cw = hypre_StructMatrixExtractPointerByIndex(A, i, index); + HYPRE_Complex Pconst0, Pconst1, Pconst2; + HYPRE_Complex one = 1.0; + HYPRE_Complex half = 0.5; - hypre_SetIndex3(index, 1, 0, 0); - a_ce = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 0, -1, 0); - a_cs = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 0, 1, 0); - a_cn = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 0, 0, 1); - a_ac = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 0, 0, -1); - a_bc = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - /*----------------------------------------------------------------- - * Extract additional pointers for 19-point fine grid operator: - * - * a_aw is pointer for west coefficient in plane above - * a_ae is pointer for east coefficient in plane above - * a_as is pointer for south coefficient in plane above - * a_an is pointer for north coefficient in plane above - * a_bw is pointer for west coefficient in plane below - * a_be is pointer for east coefficient in plane below - * a_bs is pointer for south coefficient in plane below - * a_bn is pointer for north coefficient in plane below - * a_csw is pointer for southwest coefficient in same plane - * a_cse is pointer for southeast coefficient in same plane - * a_cnw is pointer for northwest coefficient in same plane - * a_cne is pointer for northeast coefficient in same plane - *-----------------------------------------------------------------*/ - - 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); - 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); - a_bw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 1, 0, -1); - a_be = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 0, -1, -1); - a_bs = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 0, 1, -1); - a_bn = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, -1, -1, 0); - a_csw = hypre_StructMatrixExtractPointerByIndex(A, i, index); + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("PFMGSetupInterp"); - hypre_SetIndex3(index, 1, -1, 0); - a_cse = hypre_StructMatrixExtractPointerByIndex(A, i, index); + /* 0: Only the diagonal is constant + 1: All entries are constant */ + constant = (hypre_StructMatrixConstEntry(P, 1)) ? 1 : 0; - hypre_SetIndex3(index, -1, 1, 0); - a_cnw = hypre_StructMatrixExtractPointerByIndex(A, i, index); + /*---------------------------------------------------------- + * Compute Prolongation Matrix + *----------------------------------------------------------*/ - hypre_SetIndex3(index, 1, 1, 0); - a_cne = hypre_StructMatrixExtractPointerByIndex(A, i, index); + /* Set center (diagonal) coefficient to 1, since it is constant */ + hypre_TMemcpy(hypre_StructMatrixConstData(P, 0), &one, HYPRE_Complex, 1, + memory_location, HYPRE_MEMORY_HOST); -#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_ce,a_ae,a_be,a_cse,a_cne,Pp0,Pp1,p0,p1) - hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, - A_dbox, start, stride, Ai, - P_dbox, startc, stridec, Pi); + if (constant) { - 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]; - 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]; - 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]; - right = -a_ac[Ai] - a_aw[Ai] - a_ae[Ai] - a_as[Ai] - a_an[Ai]; - break; - }; - - if (!center) - { - Pp0[Pi] = 0.0; - Pp1[Pi] = 0.0; - } - else - { - switch (Pstenc0) - { - case -1: - Pp0[Pi] = left / center; - Pp1[Pi] = right / center; - break; - case 1: - Pp0[Pi] = right / center; - Pp1[Pi] = left / center; - break; - }; - /* - switch (Pstenc1) - { - case -1: - Pp1[Pi] = left/center;break; - case 1: - Pp1[Pi] = right/center;break; - }; - */ - } - - 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]); + /* Off-diagonal entries are constant */ + hypre_TMemcpy(hypre_StructMatrixConstData(P, 1), &half, HYPRE_Complex, 1, + memory_location, HYPRE_MEMORY_HOST); + hypre_TMemcpy(hypre_StructMatrixConstData(P, 2), &half, HYPRE_Complex, 1, + memory_location, HYPRE_MEMORY_HOST); } - hypre_BoxLoop2End(Ai, Pi); -#undef DEVICE_VAR - - return hypre_error_flag; -} - -HYPRE_Int -hypre_PFMGSetupInterpOp_CC0_SS27 -( HYPRE_Int i, /* box index */ - 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_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; - - p0 = hypre_StructMatrixExtractPointerByIndex(A, i, P_stencil_shape[0]); - p1 = hypre_StructMatrixExtractPointerByIndex(A, i, P_stencil_shape[1]); - - /*----------------------------------------------------------------- - * Extract pointers for 7-point grid operator: - * - * a_cc is pointer for center coefficient - * a_cw is pointer for west coefficient in same plane - * a_ce is pointer for east coefficient in same plane - * a_cs is pointer for south coefficient in same plane - * a_cn is pointer for north coefficient in same plane - * a_ac is pointer for center coefficient in plane above - * a_bc is pointer for center coefficient in plane below - *-----------------------------------------------------------------*/ - - hypre_SetIndex3(index, 0, 0, 0); - a_cc = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, -1, 0, 0); - a_cw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 1, 0, 0); - a_ce = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 0, -1, 0); - a_cs = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 0, 1, 0); - a_cn = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 0, 0, 1); - a_ac = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 0, 0, -1); - a_bc = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - /*----------------------------------------------------------------- - * Extract additional pointers for 19-point fine grid operator: - * - * a_aw is pointer for west coefficient in plane above - * a_ae is pointer for east coefficient in plane above - * a_as is pointer for south coefficient in plane above - * a_an is pointer for north coefficient in plane above - * a_bw is pointer for west coefficient in plane below - * a_be is pointer for east coefficient in plane below - * a_bs is pointer for south coefficient in plane below - * a_bn is pointer for north coefficient in plane below - * a_csw is pointer for southwest coefficient in same plane - * a_cse is pointer for southeast coefficient in same plane - * a_cnw is pointer for northwest coefficient in same plane - * a_cne is pointer for northeast coefficient in same plane - *-----------------------------------------------------------------*/ - - 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); - 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); - a_bw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 1, 0, -1); - a_be = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 0, -1, -1); - a_bs = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 0, 1, -1); - a_bn = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, -1, -1, 0); - a_csw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 1, -1, 0); - a_cse = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, -1, 1, 0); - a_cnw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 1, 1, 0); - a_cne = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - /*----------------------------------------------------------------- - * Extract additional pointers for 27-point fine grid operator: - * - * a_asw is pointer for southwest coefficient in plane above - * a_ase is pointer for southeast coefficient in plane above - * a_anw is pointer for northwest coefficient in plane above - * a_ane is pointer for northeast coefficient in plane above - * a_bsw is pointer for southwest coefficient in plane below - * a_bse is pointer for southeast coefficient in plane below - * a_bnw is pointer for northwest coefficient in plane below - * a_bne is pointer for northeast coefficient in plane below - *-----------------------------------------------------------------*/ - - hypre_SetIndex3(index, -1, -1, 1); - a_asw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 1, -1, 1); - a_ase = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - 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); - a_bsw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, 1, -1, -1); - a_bse = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - hypre_SetIndex3(index, -1, 1, -1); - a_bnw = hypre_StructMatrixExtractPointerByIndex(A, i, index); - - 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) - hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, - A_dbox, start, stride, Ai, - P_dbox, startc, stridec, Pi); + else { - HYPRE_Real center, left, right; + /* Set prolongation entries derived from constant coefficients in A */ + hypre_PFMGSetupInterpOp_core_CC(P, A, cdir, &Pconst0, &Pconst1, &Pconst2); - 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: 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; - }; + /* Set prolongation entries derived from variable coefficients in A */ + hypre_PFMGSetupInterpOp_core_VC(P, A, cdir, Pconst0, Pconst1, Pconst2); + } - if (!center) - { - //warning_cnt++; - Pp0[Pi] = 0.0; - Pp1[Pi] = 0.0; - } - else - { - switch (Pstenc0) - { - case -1: - Pp0[Pi] = left / center; - Pp1[Pi] = right / center; - break; - case 1: - Pp0[Pi] = right / center; - Pp1[Pi] = left / center; - break; - }; - /* - switch (Pstenc1) - { - case -1: - Pp1[Pi] = left/center;break; - case 1: - Pp1[Pi] = right/center;break; - }; - */ - } + /* Assemble prolongation matrix */ + hypre_StructMatrixAssemble(P); - 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); -#undef DEVICE_VAR + /* The following call is needed to prevent cases where interpolation reaches + * outside the boundary with nonzero coefficient */ + hypre_StructMatrixClearBoundary(P); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; return hypre_error_flag; } - -#endif diff --git a/src/struct_ls/pfmg_setup_rap.c b/src/struct_ls/pfmg_setup_rap.c index 2823f0072d..b137ab24e7 100644 --- a/src/struct_ls/pfmg_setup_rap.c +++ b/src/struct_ls/pfmg_setup_rap.c @@ -34,8 +34,8 @@ hypre_PFMGCreateRAPOp( hypre_StructMatrix *R, { hypre_StructMatrix *RAP = NULL; hypre_StructStencil *stencil; - HYPRE_Int P_stored_as_transpose = 0; HYPRE_Int constant_coefficient; + HYPRE_Int P_stored_as_transpose = 0; stencil = hypre_StructMatrixStencil(A); @@ -72,17 +72,35 @@ hypre_PFMGCreateRAPOp( hypre_StructMatrix *R, P_stored_as_transpose); } - + /* Set up constant stencil entries */ + /* Exclude the Galerkin case (rap_type == 0) when A has variable diagonal, + * because then RAP is entirely variable coefficient. */ constant_coefficient = hypre_StructMatrixConstantCoefficient(A); - 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 */ - hypre_StructMatrixSetConstantCoefficient( RAP, 0 ); - } - else + if ((constant_coefficient) && !(constant_coefficient == 2 && rap_type == 0)) { - hypre_StructMatrixSetConstantCoefficient( RAP, constant_coefficient ); + HYPRE_Int *entries, nentries, i; + + stencil = hypre_StructMatrixUserStencil(RAP); + nentries = hypre_StructStencilSize(stencil); + entries = hypre_TAlloc(HYPRE_Int, nentries, HYPRE_MEMORY_HOST); + for (i = 0; i < nentries; i++) + { + entries[i] = i; + } + if (constant_coefficient == 2) + { + HYPRE_Int stencil_diag_entry; + + /* Make the diagonal variable */ + stencil_diag_entry = hypre_StructStencilDiagEntry(stencil); + nentries -= 1; + for (i = stencil_diag_entry; i < nentries; i++) + { + entries[i] = entries[i + 1]; + } + } + hypre_StructMatrixSetConstantEntries(RAP, nentries, entries); + hypre_TFree(entries, HYPRE_MEMORY_HOST); } return RAP; @@ -241,4 +259,3 @@ hypre_PFMGSetupRAPOp( hypre_StructMatrix *R, return hypre_error_flag; } - diff --git a/src/struct_ls/pfmg_setup_rap5.c b/src/struct_ls/pfmg_setup_rap5.c index 48b8b8f14e..7783df2ca7 100644 --- a/src/struct_ls/pfmg_setup_rap5.c +++ b/src/struct_ls/pfmg_setup_rap5.c @@ -48,7 +48,7 @@ hypre_PFMGCreateCoarseOp5( hypre_StructMatrix *R, hypre_Index index_temp; HYPRE_Int j, i; - HYPRE_Int stencil_rank; + HYPRE_Int stencil_entry; RAP_stencil_dim = 2; @@ -56,7 +56,7 @@ hypre_PFMGCreateCoarseOp5( hypre_StructMatrix *R, * Define RAP_stencil *-----------------------------------------------------------------------*/ - stencil_rank = 0; + stencil_entry = 0; /*----------------------------------------------------------------------- * non-symmetric case @@ -76,13 +76,13 @@ hypre_PFMGCreateCoarseOp5( hypre_StructMatrix *R, { /*-------------------------------------------------------------- - * Storage for 5 elements (c,w,e,n,s) + * Storage for 5 entries (c,w,e,n,s) *--------------------------------------------------------------*/ if (i * j == 0) { hypre_SetIndex3(index_temp, i, j, 0); - MapIndex(index_temp, cdir, RAP_stencil_shape[stencil_rank]); - stencil_rank++; + MapIndex(index_temp, cdir, RAP_stencil_shape[stencil_entry]); + stencil_entry++; } } } @@ -109,13 +109,13 @@ hypre_PFMGCreateCoarseOp5( hypre_StructMatrix *R, { /*-------------------------------------------------------------- - * Store 3 elements in (c,w,s) + * Store 3 entries in (c,w,s) *--------------------------------------------------------------*/ - if ( i * j == 0 ) + if (i * j == 0) { hypre_SetIndex3(index_temp, i, j, 0); - MapIndex(index_temp, cdir, RAP_stencil_shape[stencil_rank]); - stencil_rank++; + MapIndex(index_temp, cdir, RAP_stencil_shape[stencil_entry]); + stencil_entry++; } } } @@ -137,7 +137,7 @@ hypre_PFMGCreateCoarseOp5( hypre_StructMatrix *R, /*----------------------------------------------------------------------- * Set number of ghost points - one one each boundary *-----------------------------------------------------------------------*/ - hypre_StructMatrixSetNumGhost(RAP, RAP_num_ghost); + HYPRE_StructMatrixSetNumGhost(RAP, RAP_num_ghost); return RAP; } @@ -160,6 +160,8 @@ hypre_PFMGBuildCoarseOp5( hypre_StructMatrix *A, hypre_Index cstride, hypre_StructMatrix *RAP ) { + HYPRE_UNUSED_VAR(R); + HYPRE_Int ndim = hypre_StructMatrixNDim(A); hypre_Index index; hypre_Index index_temp; @@ -194,8 +196,6 @@ hypre_PFMGBuildCoarseOp5( hypre_StructMatrix *A, HYPRE_Real *rap_cc, *rap_cw, *rap_ce; HYPRE_Real *rap_cb, *rap_ca; - HYPRE_Real center_int, center_bdy; - HYPRE_Int OffsetA; HYPRE_Int OffsetP; @@ -211,17 +211,18 @@ hypre_PFMGBuildCoarseOp5( hypre_StructMatrix *A, cgrid_ids = hypre_StructGridIDs(cgrid); constant_coefficient = hypre_StructMatrixConstantCoefficient(RAP); - hypre_assert( hypre_StructMatrixConstantCoefficient(A) == constant_coefficient ); - if ( constant_coefficient == 0 ) - { - hypre_assert( hypre_StructMatrixConstantCoefficient(R) == 0 ); - hypre_assert( hypre_StructMatrixConstantCoefficient(P) == 0 ); - } - else /* 1 or 2 */ - { - hypre_assert( hypre_StructMatrixConstantCoefficient(R) == 1 ); - hypre_assert( hypre_StructMatrixConstantCoefficient(P) == 1 ); - } + + /* hypre_assert( hypre_StructMatrixConstantCoefficient(A) == constant_coefficient ); */ + /* if ( constant_coefficient==0 ) */ + /* { */ + /* hypre_assert( hypre_StructMatrixConstantCoefficient(R) == 0 ); */ + /* hypre_assert( hypre_StructMatrixConstantCoefficient(P) == 0 ); */ + /* } */ + /* else /\* 1 or 2 *\/ */ + /* { */ + /* hypre_assert( hypre_StructMatrixConstantCoefficient(R) == 1 ); */ + /* hypre_assert( hypre_StructMatrixConstantCoefficient(P) == 1 ); */ + /* } */ fcbox = hypre_BoxCreate(ndim); bdy_boxes = hypre_BoxArrayCreate(0, ndim); @@ -379,11 +380,14 @@ hypre_PFMGBuildCoarseOp5( hypre_StructMatrix *A, 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_cc[0] = a_cc[0] - 2.0 * ( a_cw[0] - rap_cb[0] ); + hypre_LoopBegin(1, k) + { + HYPRE_UNUSED_VAR(k); + rap_cb[0] = rap_ca[0] = a_cb[0] * pa[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]); + } + hypre_LoopEnd() } else if ( constant_coefficient == 2 ) @@ -391,12 +395,13 @@ hypre_PFMGBuildCoarseOp5( hypre_StructMatrix *A, /* 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_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]); + hypre_LoopBegin(1, k) + { + HYPRE_UNUSED_VAR(k); + rap_cb[0] = rap_ca[0] = 0.5 * a_cb[0]; + rap_cw[0] = rap_ce[0] = 2.0 * a_cw[0]; + } + hypre_LoopEnd() hypre_BoxGetSize(cgrid_box, loop_size); @@ -405,7 +410,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] + 3.0 * a_cb[0]; } hypre_BoxLoop2End(iA, iAc); #undef DEVICE_VAR @@ -438,13 +443,12 @@ 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] + 0.5 * a_cb[0] + (a_cw[0] + a_cb[0]); } hypre_BoxLoop2End(iA, iAc); #undef DEVICE_VAR } } - } /* end ForBoxI */ hypre_BoxDestroy(fcbox); diff --git a/src/struct_ls/pfmg_setup_rap7.c b/src/struct_ls/pfmg_setup_rap7.c index a1f22849bb..239916c1a2 100644 --- a/src/struct_ls/pfmg_setup_rap7.c +++ b/src/struct_ls/pfmg_setup_rap7.c @@ -49,7 +49,7 @@ hypre_PFMGCreateCoarseOp7( hypre_StructMatrix *R, hypre_Index index_temp; HYPRE_Int k, j, i; - HYPRE_Int stencil_rank; + HYPRE_Int stencil_entry; RAP_stencil_dim = 3; @@ -57,7 +57,7 @@ hypre_PFMGCreateCoarseOp7( hypre_StructMatrix *R, * Define RAP_stencil *-----------------------------------------------------------------------*/ - stencil_rank = 0; + stencil_entry = 0; /*----------------------------------------------------------------------- * non-symmetric case @@ -79,13 +79,13 @@ hypre_PFMGCreateCoarseOp7( hypre_StructMatrix *R, { /*-------------------------------------------------------------- - * Storage for 7 elements (c,w,e,n,s,a,b) + * Storage for 7 entries (c,w,e,n,s,a,b) *--------------------------------------------------------------*/ if (i * j == 0 && i * k == 0 && j * k == 0) { hypre_SetIndex3(index_temp, i, j, k); - MapIndex(index_temp, cdir, RAP_stencil_shape[stencil_rank]); - stencil_rank++; + MapIndex(index_temp, cdir, RAP_stencil_shape[stencil_entry]); + stencil_entry++; } } } @@ -115,13 +115,13 @@ hypre_PFMGCreateCoarseOp7( hypre_StructMatrix *R, { /*-------------------------------------------------------------- - * Store 4 elements in (c,w,s,b) + * Store 4 entries in (c,w,s,b) *--------------------------------------------------------------*/ if (i * j == 0 && i * k == 0 && j * k == 0) { hypre_SetIndex3(index_temp, i, j, k); - MapIndex(index_temp, cdir, RAP_stencil_shape[stencil_rank]); - stencil_rank++; + MapIndex(index_temp, cdir, RAP_stencil_shape[stencil_entry]); + stencil_entry++; } } } @@ -144,7 +144,7 @@ hypre_PFMGCreateCoarseOp7( hypre_StructMatrix *R, /*----------------------------------------------------------------------- * Set number of ghost points - one one each boundary *-----------------------------------------------------------------------*/ - hypre_StructMatrixSetNumGhost(RAP, RAP_num_ghost); + HYPRE_StructMatrixSetNumGhost(RAP, RAP_num_ghost); return RAP; } @@ -167,6 +167,8 @@ hypre_PFMGBuildCoarseOp7( hypre_StructMatrix *A, hypre_Index cstride, hypre_StructMatrix *RAP ) { + HYPRE_UNUSED_VAR(R); + HYPRE_Int ndim = hypre_StructMatrixNDim(A); hypre_Index index; hypre_Index index_temp; @@ -200,7 +202,6 @@ hypre_PFMGBuildCoarseOp7( hypre_StructMatrix *A, HYPRE_Real *rap_cc, *rap_cw, *rap_ce, *rap_cs, *rap_cn; HYPRE_Real *rap_cb, *rap_ca; - HYPRE_Real center_int, center_bdy; HYPRE_Int OffsetA; HYPRE_Int OffsetP; @@ -217,17 +218,18 @@ hypre_PFMGBuildCoarseOp7( hypre_StructMatrix *A, cgrid_ids = hypre_StructGridIDs(cgrid); constant_coefficient = hypre_StructMatrixConstantCoefficient(RAP); - hypre_assert( hypre_StructMatrixConstantCoefficient(A) == constant_coefficient ); - if ( constant_coefficient == 0 ) - { - hypre_assert( hypre_StructMatrixConstantCoefficient(R) == 0 ); - hypre_assert( hypre_StructMatrixConstantCoefficient(P) == 0 ); - } - else /* 1 or 2 */ - { - hypre_assert( hypre_StructMatrixConstantCoefficient(R) == 1 ); - hypre_assert( hypre_StructMatrixConstantCoefficient(P) == 1 ); - } + + /* hypre_assert( hypre_StructMatrixConstantCoefficient(A) == constant_coefficient ); */ + /* if ( constant_coefficient==0 ) */ + /* { */ + /* hypre_assert( hypre_StructMatrixConstantCoefficient(R) == 0 ); */ + /* hypre_assert( hypre_StructMatrixConstantCoefficient(P) == 0 ); */ + /* } */ + /* else /\* 1 or 2 *\/ */ + /* { */ + /* hypre_assert( hypre_StructMatrixConstantCoefficient(R) == 1 ); */ + /* hypre_assert( hypre_StructMatrixConstantCoefficient(P) == 1 ); */ + /* } */ fcbox = hypre_BoxCreate(ndim); bdy_boxes = hypre_BoxArrayCreate(0, ndim); @@ -410,12 +412,15 @@ hypre_PFMGBuildCoarseOp7( hypre_StructMatrix *A, 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_cc[0] = a_cc[0] - 2.0 * ( a_cw[0] + a_cs[0] - rap_cb[0] ); + hypre_LoopBegin(1, k) + { + HYPRE_UNUSED_VAR(k); + 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_cc[0] = a_cc[0] - 2.0 * ( a_cw[0] + a_cs[0] - rap_cb[0] ); + } + hypre_LoopEnd() } else if ( constant_coefficient == 2 ) @@ -423,13 +428,14 @@ hypre_PFMGBuildCoarseOp7( hypre_StructMatrix *A, /* 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_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]); + hypre_LoopBegin(1, k) + { + HYPRE_UNUSED_VAR(k); + 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]; + } + hypre_LoopEnd() hypre_BoxGetSize(cgrid_box, loop_size); @@ -438,7 +444,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] + 3.0 * a_cb[0]; } hypre_BoxLoop2End(iA, iAc); #undef DEVICE_VAR @@ -472,13 +478,13 @@ 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] + 0.5 * a_cb[0] + + (a_cw[0] + a_cs[0] + a_cb[0]); } hypre_BoxLoop2End(iA, iAc); #undef DEVICE_VAR } } - } /* end ForBoxI */ hypre_BoxDestroy(fcbox); diff --git a/src/struct_ls/pfmg_solve.c b/src/struct_ls/pfmg_solve.c index 06c279a39d..4d073b763b 100644 --- a/src/struct_ls/pfmg_solve.c +++ b/src/struct_ls/pfmg_solve.c @@ -8,23 +8,14 @@ #include "_hypre_struct_ls.h" #include "pfmg.h" -#define DEBUG 0 - /*-------------------------------------------------------------------------- * hypre_PFMGSolve * * NOTE regarding hypre_StructVectorClearAllValues: - * * Since r_l and e_l point to the same temporary data, the boundary ghost values * are not guaranteed to stay clear as needed in the constant coefficient case. - * In addition, for the Galerkin case, the interpolation operator is set to be a - * variable coefficient operator. However, interpolation values that reach - * outside of the boundary are currently not always computed to be zero in this - * case, so we can't rewrite SemiRestrict and SemiInterp to faithfully zero out - * boundary ghost values only when needed because there isn't enough context. * So, below we clear the values of r_l and e_l before computing the residual * and calling interpolation. - * *--------------------------------------------------------------------------*/ HYPRE_Int @@ -33,7 +24,7 @@ hypre_PFMGSolve( void *pfmg_vdata, hypre_StructVector *b, hypre_StructVector *x ) { - hypre_PFMGData *pfmg_data = (hypre_PFMGData *)pfmg_vdata; + hypre_PFMGData *pfmg_data = (hypre_PFMGData *) pfmg_vdata; HYPRE_Real tol = (pfmg_data -> tol); HYPRE_Int max_iter = (pfmg_data -> max_iter); @@ -58,20 +49,24 @@ hypre_PFMGSolve( void *pfmg_vdata, HYPRE_Real *rel_norms = (pfmg_data -> rel_norms); HYPRE_Int *active_l = (pfmg_data -> active_l); - HYPRE_Real b_dot_b = 0, r_dot_r, eps = 0; - HYPRE_Real e_dot_e = 0.0, x_dot_x = 1.0; - HYPRE_Int i, l; HYPRE_Int constant_coefficient; + HYPRE_Real e_dot_e = 0.0, b_dot_b = 0.0, eps = 0.0; + HYPRE_Real r_dot_r = 0.0, x_dot_x = 0.0; + char marker_name[32]; -#if DEBUG +#ifdef DEBUG_SOLVE char filename[255]; + static HYPRE_Int g_iter = 0; #endif /*----------------------------------------------------- * Initialize some things and deal with special cases *-----------------------------------------------------*/ + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("PFMG-Solve"); + hypre_BeginTiming(pfmg_data -> time_index); constant_coefficient = hypre_StructMatrixConstantCoefficient(A); @@ -95,6 +90,8 @@ hypre_PFMGSolve( void *pfmg_vdata, } hypre_EndTiming(pfmg_data -> time_index); + + hypre_GpuProfilingPopRange(); HYPRE_ANNOTATE_FUNC_END; return hypre_error_flag; @@ -108,7 +105,7 @@ hypre_PFMGSolve( void *pfmg_vdata, eps = tol * tol; /* if rhs is zero, return a zero solution */ - if (b_dot_b == 0.0) + if (!(b_dot_b > 0.0)) { hypre_StructVectorSetConstantValues(x, 0.0); if (logging > 0) @@ -118,8 +115,8 @@ hypre_PFMGSolve( void *pfmg_vdata, } hypre_EndTiming(pfmg_data -> time_index); - HYPRE_ANNOTATE_FUNC_END; + hypre_GpuProfilingPopRange(); return hypre_error_flag; } } @@ -136,29 +133,46 @@ hypre_PFMGSolve( void *pfmg_vdata, *--------------------------------------------------*/ HYPRE_ANNOTATE_MGLEVEL_BEGIN(0); + hypre_sprintf(marker_name, "%s-%d", "PFMG Level", 0); + hypre_GpuProfilingPushRange(marker_name); if (constant_coefficient) { hypre_StructVectorClearAllValues(r_l[0]); } - /* fine grid pre-relaxation */ +#ifdef DEBUG_SOLVE + hypre_sprintf(filename, "pfmg_xdown.i%02d.l%02d", g_iter + i, 0); + hypre_StructVectorPrint(filename, x_l[0], 0); + hypre_sprintf(filename, "pfmg_b.i%02d.l%02d", g_iter + i, 1); + hypre_StructVectorPrint(filename, b_l[0], 0); +#endif + + /* Fine grid pre-relaxation */ HYPRE_ANNOTATE_REGION_BEGIN("%s", "Relaxation"); + hypre_GpuProfilingPushRange("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_GpuProfilingPopRange(); HYPRE_ANNOTATE_REGION_END("%s", "Relaxation"); - /* compute fine grid residual (b - Ax) */ + /* Compute fine grid residual (r = b - Ax) */ HYPRE_ANNOTATE_REGION_BEGIN("%s", "Residual"); - hypre_StructCopy(b_l[0], r_l[0]); + hypre_GpuProfilingPushRange("Residual"); + hypre_StructMatvecCompute(matvec_data_l[0], - -1.0, A_l[0], x_l[0], 1.0, r_l[0]); + -1.0, A_l[0], x_l[0], + 1.0, b_l[0], r_l[0]); + + hypre_GpuProfilingPopRange(); HYPRE_ANNOTATE_REGION_END("%s", "Residual"); - /* convergence check */ + /* Convergence check */ if (tol > 0.0) { r_dot_r = hypre_StructInnerProd(r_l[0], r_l[0]); @@ -176,11 +190,12 @@ hypre_PFMGSolve( void *pfmg_vdata, } } - /* always do at least 1 V-cycle */ + /* Always do at least 1 V-cycle */ if ((r_dot_r / b_dot_b < eps) && (i > 0)) { if ( ((rel_change) && (e_dot_e / x_dot_x) < eps) || (!rel_change) ) { + hypre_GpuProfilingPopRange(); HYPRE_ANNOTATE_MGLEVEL_END(0); break; } @@ -189,21 +204,33 @@ hypre_PFMGSolve( void *pfmg_vdata, if (num_levels > 1) { - /* restrict fine grid residual */ - hypre_SemiRestrict(restrict_data_l[0], RT_l[0], r_l[0], b_l[1]); -#if DEBUG - hypre_sprintf(filename, "zout_xdown.%02d", 0); + /* Restrict fine grid residual */ + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Restriction"); + hypre_GpuProfilingPushRange("Restriction"); + + hypre_StructMatvecCompute(restrict_data_l[0], + 1.0, RT_l[0], r_l[0], + 0.0, b_l[1], b_l[1]); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_REGION_END("%s", "Restriction"); + +#ifdef DEBUG_SOLVE + hypre_sprintf(filename, "pfmg_xdown.i%02d.l%02d", g_iter + i, 0); hypre_StructVectorPrint(filename, x_l[0], 0); - hypre_sprintf(filename, "zout_rdown.%02d", 0); + hypre_sprintf(filename, "pfmg_rdown.i%02d.l%02d", g_iter + i, 0); hypre_StructVectorPrint(filename, r_l[0], 0); - hypre_sprintf(filename, "zout_b.%02d", 1); + hypre_sprintf(filename, "pfmg_b.i%02d.l%02d", g_iter + i, 1); hypre_StructVectorPrint(filename, b_l[1], 0); #endif + hypre_GpuProfilingPopRange(); HYPRE_ANNOTATE_MGLEVEL_END(0); for (l = 1; l <= (num_levels - 2); l++) { HYPRE_ANNOTATE_MGLEVEL_BEGIN(l); + hypre_sprintf(marker_name, "%s-%d", "PFMG Level", l); + hypre_GpuProfilingPushRange(marker_name); #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) if (hypre_StructGridDataLocation(hypre_StructVectorGrid(r_l[l])) == HYPRE_MEMORY_HOST) @@ -218,48 +245,68 @@ hypre_PFMGSolve( void *pfmg_vdata, if (active_l[l]) { - /* pre-relaxation */ + /* Pre-relaxation */ HYPRE_ANNOTATE_REGION_BEGIN("%s", "Relaxation"); + hypre_GpuProfilingPushRange("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_GpuProfilingPopRange(); HYPRE_ANNOTATE_REGION_END("%s", "Relaxation"); - /* compute residual (b - Ax) */ + /* Compute residual (r = b - Ax) */ HYPRE_ANNOTATE_REGION_BEGIN("%s", "Residual"); - hypre_StructCopy(b_l[l], r_l[l]); + hypre_GpuProfilingPushRange("Residual"); + hypre_StructMatvecCompute(matvec_data_l[l], - -1.0, A_l[l], x_l[l], 1.0, r_l[l]); + -1.0, A_l[l], x_l[l], + 1.0, b_l[l], r_l[l]); + + hypre_GpuProfilingPopRange(); HYPRE_ANNOTATE_REGION_END("%s", "Residual"); } else { - /* inactive level, set x=0, so r=(b-Ax)=b */ + /* Inactive level, set x=0, so r = (b - Ax) = b */ hypre_StructVectorSetConstantValues(x_l[l], 0.0); hypre_StructCopy(b_l[l], r_l[l]); } - /* restrict residual */ - 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_sprintf(filename, "zout_xdown.%02d", l); + /* Restrict residual */ + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Restriction"); + hypre_GpuProfilingPushRange("Restriction"); + + hypre_StructMatvecCompute(restrict_data_l[l], + 1.0, RT_l[l], r_l[l], + 0.0, b_l[l + 1], b_l[l + 1]); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_REGION_END("%s", "Restriction"); + +#ifdef DEBUG_SOLVE + hypre_sprintf(filename, "pfmg_xdown.i%02d.l%02d", g_iter + i, l); hypre_StructVectorPrint(filename, x_l[l], 0); - hypre_sprintf(filename, "zout_rdown.%02d", l); + hypre_sprintf(filename, "pfmg_rdown.i%02d.l%02d", g_iter + i, l); hypre_StructVectorPrint(filename, r_l[l], 0); - hypre_sprintf(filename, "zout_b.%02d", l + 1); + hypre_sprintf(filename, "pfmg_b.i%02d.l%02d", g_iter + i, l + 1); hypre_StructVectorPrint(filename, b_l[l + 1], 0); #endif - + hypre_GpuProfilingPopRange(); HYPRE_ANNOTATE_MGLEVEL_END(l); } /*-------------------------------------------------- * Bottom *--------------------------------------------------*/ + HYPRE_ANNOTATE_MGLEVEL_BEGIN(num_levels - 1); + hypre_sprintf(marker_name, "%s-%d", "PFMG Level", num_levels - 1); + hypre_GpuProfilingPushRange(marker_name); + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Coarse solve"); if (active_l[l]) { HYPRE_ANNOTATE_REGION_BEGIN("%s", "Relaxation"); @@ -271,10 +318,12 @@ hypre_PFMGSolve( void *pfmg_vdata, { hypre_StructVectorSetConstantValues(x_l[l], 0.0); } -#if DEBUG - hypre_sprintf(filename, "zout_xbottom.%02d", l); + HYPRE_ANNOTATE_REGION_END("%s", "Coarse solve"); + +#ifdef DEBUG_SOLVE + hypre_sprintf(filename, "pfmg_xbottom.i%02d.l%02d", g_iter + i, 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: = %.30e\n", l, hypre_StructInnerProd(x_l[l], x_l[l])); #endif /*-------------------------------------------------- @@ -293,27 +342,44 @@ 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_StructAxpy(1.0, e_l[l], x_l[l]); + + /* Interpolate error and correct (x = x + Pe_c) */ + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Interpolation"); + hypre_GpuProfilingPushRange("Interpolation"); + + hypre_StructMatvecCompute(interp_data_l[l], + 1.0, P_l[l], x_l[l + 1], + 1.0, x_l[l], x_l[l]); + + hypre_GpuProfilingPopRange(); + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_REGION_END("%s", "Interpolation"); HYPRE_ANNOTATE_MGLEVEL_END(l + 1); -#if DEBUG - hypre_sprintf(filename, "zout_eup.%02d", l); + +#ifdef DEBUG_SOLVE + hypre_sprintf(filename, "pfmg_eup.i%02d.l%02d", g_iter + i, l); hypre_StructVectorPrint(filename, e_l[l], 0); - hypre_sprintf(filename, "zout_xup.%02d", l); + hypre_sprintf(filename, "pfmg_xup.i%02d.l%02d", g_iter + i, 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: = %.15e\n", l, hypre_StructInnerProd(x_l[l], x_l[l])); #endif + HYPRE_ANNOTATE_MGLEVEL_BEGIN(l); + hypre_sprintf(marker_name, "%s-%d", "PFMG Level", l); + hypre_GpuProfilingPushRange(marker_name); if (active_l[l]) { - /* post-relaxation */ HYPRE_ANNOTATE_REGION_BEGIN("%s", "Relaxation"); + hypre_GpuProfilingPushRange("Relaxation"); + + /* Post-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_GpuProfilingPopRange(); HYPRE_ANNOTATE_REGION_END("%s", "Relaxation"); } } @@ -327,21 +393,32 @@ hypre_PFMGSolve( void *pfmg_vdata, { hypre_StructVectorClearAllValues(e_l[0]); } - /* interpolate error and correct on fine grid (x = x + Pe_c) */ - hypre_SemiInterp(interp_data_l[0], P_l[0], x_l[1], e_l[0]); - hypre_StructAxpy(1.0, e_l[0], x_l[0]); + + /* Interpolate error and correct on fine grid (x = x + Pe_c) */ + HYPRE_ANNOTATE_REGION_BEGIN("%s", "Interpolation"); + hypre_GpuProfilingPushRange("Interpolation"); + + hypre_StructMatvecCompute(interp_data_l[0], + 1.0, P_l[0], x_l[1], + 1.0, x_l[0], x_l[0]); + + hypre_GpuProfilingPopRange(); + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_REGION_END("%s", "Interpolation"); HYPRE_ANNOTATE_MGLEVEL_END(1); -#if DEBUG - hypre_printf("Level 0: x_l = %.15e\n", hypre_StructInnerProd(x_l[0], x_l[0])); - hypre_sprintf(filename, "zout_eup.%02d", 0); + +#ifdef DEBUG_SOLVE + hypre_sprintf(filename, "pfmg_eup.i%02d.l%02d", g_iter + i, 0); hypre_StructVectorPrint(filename, e_l[0], 0); - hypre_sprintf(filename, "zout_xup.%02d", 0); + hypre_sprintf(filename, "pfmg_xup.i%02d.l%02d", g_iter + i, 0); hypre_StructVectorPrint(filename, x_l[0], 0); #endif HYPRE_ANNOTATE_MGLEVEL_BEGIN(0); + hypre_sprintf(marker_name, "%s-%d", "PFMG Level", 0); + hypre_GpuProfilingPushRange(marker_name); } - /* part of convergence check */ + /* Part of convergence check */ if ((tol > 0.0) && (rel_change)) { if (num_levels > 1) @@ -356,18 +433,31 @@ hypre_PFMGSolve( void *pfmg_vdata, } } + /* Fine grid post-relaxation */ HYPRE_ANNOTATE_REGION_BEGIN("%s", "Relaxation"); + hypre_GpuProfilingPushRange("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_GpuProfilingPopRange(); HYPRE_ANNOTATE_REGION_END("%s", "Relaxation"); + (pfmg_data -> num_iterations) = (i + 1); +#ifdef DEBUG_SOLVE + g_iter++; +#endif + hypre_GpuProfilingPopRange(); HYPRE_ANNOTATE_MGLEVEL_END(0); } hypre_EndTiming(pfmg_data -> time_index); + hypre_PFMGPrintLogging((void *) pfmg_data); + + hypre_GpuProfilingPopRange(); HYPRE_ANNOTATE_FUNC_END; return hypre_error_flag; diff --git a/src/struct_ls/point_relax.c b/src/struct_ls/point_relax.c deleted file mode 100644 index 2eb44bd251..0000000000 --- a/src/struct_ls/point_relax.c +++ /dev/null @@ -1,1598 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_ls.h" -#include "_hypre_struct_mv.hpp" - -/* this currently cannot be greater than 7 */ -#ifdef MAX_DEPTH -#undef MAX_DEPTH -#endif -#define MAX_DEPTH 7 - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -typedef struct -{ - MPI_Comm comm; - - HYPRE_Real tol; /* tolerance, set =0 for no convergence testing */ - HYPRE_Real rresnorm; /* relative residual norm, computed only if tol>0.0 */ - HYPRE_Int max_iter; - HYPRE_Int rel_change; /* not yet used */ - HYPRE_Int zero_guess; - HYPRE_Real weight; - - HYPRE_Int num_pointsets; - HYPRE_Int *pointset_sizes; - HYPRE_Int *pointset_ranks; - hypre_Index *pointset_strides; - hypre_Index **pointset_indices; - - hypre_StructMatrix *A; - hypre_StructVector *b; - hypre_StructVector *x; - hypre_StructVector *t; - - HYPRE_Int diag_rank; - - hypre_ComputePkg **compute_pkgs; - - /* log info (always logged) */ - HYPRE_Int num_iterations; - HYPRE_Int time_index; - HYPRE_BigInt flops; - -} hypre_PointRelaxData; - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -void * -hypre_PointRelaxCreate( MPI_Comm comm ) -{ - hypre_PointRelaxData *relax_data; - - hypre_Index stride; - hypre_Index indices[1]; - - relax_data = hypre_CTAlloc(hypre_PointRelaxData, 1, HYPRE_MEMORY_HOST); - - (relax_data -> comm) = comm; - (relax_data -> time_index) = hypre_InitializeTiming("PointRelax"); - - /* set defaults */ - (relax_data -> tol) = 0.0; /* tol=0 means no convergence testing */ - (relax_data -> rresnorm) = 0.0; - (relax_data -> max_iter) = 1000; - (relax_data -> rel_change) = 0; - (relax_data -> zero_guess) = 0; - (relax_data -> weight) = 1.0; - (relax_data -> num_pointsets) = 0; - (relax_data -> pointset_sizes) = NULL; - (relax_data -> pointset_ranks) = NULL; - (relax_data -> pointset_strides) = NULL; - (relax_data -> pointset_indices) = NULL; - (relax_data -> A) = NULL; - (relax_data -> b) = NULL; - (relax_data -> x) = NULL; - (relax_data -> t) = NULL; - (relax_data -> compute_pkgs) = NULL; - - hypre_SetIndex3(stride, 1, 1, 1); - hypre_SetIndex3(indices[0], 0, 0, 0); - hypre_PointRelaxSetNumPointsets((void *) relax_data, 1); - hypre_PointRelaxSetPointset((void *) relax_data, 0, 1, stride, indices); - - return (void *) relax_data; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_PointRelaxDestroy( void *relax_vdata ) -{ - hypre_PointRelaxData *relax_data = (hypre_PointRelaxData *)relax_vdata; - HYPRE_Int i; - - if (relax_data) - { - for (i = 0; i < (relax_data -> num_pointsets); i++) - { - hypre_TFree(relax_data -> pointset_indices[i], HYPRE_MEMORY_HOST); - } - if (relax_data -> compute_pkgs) - { - for (i = 0; i < (relax_data -> num_pointsets); i++) - { - hypre_ComputePkgDestroy(relax_data -> compute_pkgs[i]); - } - } - hypre_TFree(relax_data -> pointset_sizes, HYPRE_MEMORY_HOST); - hypre_TFree(relax_data -> pointset_ranks, HYPRE_MEMORY_HOST); - hypre_TFree(relax_data -> pointset_strides, HYPRE_MEMORY_HOST); - hypre_TFree(relax_data -> pointset_indices, HYPRE_MEMORY_HOST); - hypre_StructMatrixDestroy(relax_data -> A); - hypre_StructVectorDestroy(relax_data -> b); - hypre_StructVectorDestroy(relax_data -> x); - hypre_StructVectorDestroy(relax_data -> t); - hypre_TFree(relax_data -> compute_pkgs, HYPRE_MEMORY_HOST); - - hypre_FinalizeTiming(relax_data -> time_index); - hypre_TFree(relax_data, HYPRE_MEMORY_HOST); - } - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_PointRelaxSetup( void *relax_vdata, - hypre_StructMatrix *A, - hypre_StructVector *b, - hypre_StructVector *x ) -{ - hypre_PointRelaxData *relax_data = (hypre_PointRelaxData *)relax_vdata; - - HYPRE_Int num_pointsets = (relax_data -> num_pointsets); - HYPRE_Int *pointset_sizes = (relax_data -> pointset_sizes); - hypre_Index *pointset_strides = (relax_data -> pointset_strides); - hypre_Index **pointset_indices = (relax_data -> pointset_indices); - HYPRE_Int ndim = hypre_StructMatrixNDim(A); - hypre_StructVector *t; - HYPRE_Int diag_rank; - hypre_ComputeInfo *compute_info; - hypre_ComputePkg **compute_pkgs; - - hypre_Index diag_index; - hypre_IndexRef stride; - hypre_IndexRef index; - - hypre_StructGrid *grid; - hypre_StructStencil *stencil; - - hypre_BoxArrayArray *orig_indt_boxes; - hypre_BoxArrayArray *orig_dept_boxes; - hypre_BoxArrayArray *box_aa; - hypre_BoxArray *box_a; - hypre_Box *box; - HYPRE_Int box_aa_size; - HYPRE_Int box_a_size; - hypre_BoxArrayArray *new_box_aa; - hypre_BoxArray *new_box_a; - hypre_Box *new_box; - - HYPRE_Real scale; - HYPRE_Int frac; - - HYPRE_Int i, j, k, p, m, compute_i; - - /*---------------------------------------------------------- - * Set up the temp vector - *----------------------------------------------------------*/ - - if ((relax_data -> t) == NULL) - { - t = hypre_StructVectorCreate(hypre_StructVectorComm(b), - hypre_StructVectorGrid(b)); - hypre_StructVectorSetNumGhost(t, hypre_StructVectorNumGhost(b)); - hypre_StructVectorInitialize(t); - hypre_StructVectorAssemble(t); - (relax_data -> t) = t; - } - - /*---------------------------------------------------------- - * Find the matrix diagonal - *----------------------------------------------------------*/ - - grid = hypre_StructMatrixGrid(A); - stencil = hypre_StructMatrixStencil(A); - - hypre_SetIndex3(diag_index, 0, 0, 0); - diag_rank = hypre_StructStencilElementRank(stencil, diag_index); - - /*---------------------------------------------------------- - * Set up the compute packages - *----------------------------------------------------------*/ - - compute_pkgs = hypre_CTAlloc(hypre_ComputePkg *, num_pointsets, HYPRE_MEMORY_HOST); - - for (p = 0; p < num_pointsets; p++) - { - hypre_CreateComputeInfo(grid, stencil, &compute_info); - orig_indt_boxes = hypre_ComputeInfoIndtBoxes(compute_info); - orig_dept_boxes = hypre_ComputeInfoDeptBoxes(compute_info); - - stride = pointset_strides[p]; - - for (compute_i = 0; compute_i < 2; compute_i++) - { - switch (compute_i) - { - case 0: - box_aa = orig_indt_boxes; - break; - - case 1: - box_aa = orig_dept_boxes; - break; - } - box_aa_size = hypre_BoxArrayArraySize(box_aa); - new_box_aa = hypre_BoxArrayArrayCreate(box_aa_size, ndim); - - for (i = 0; i < box_aa_size; i++) - { - box_a = hypre_BoxArrayArrayBoxArray(box_aa, i); - box_a_size = hypre_BoxArraySize(box_a); - new_box_a = hypre_BoxArrayArrayBoxArray(new_box_aa, i); - hypre_BoxArraySetSize(new_box_a, box_a_size * pointset_sizes[p]); - - k = 0; - for (m = 0; m < pointset_sizes[p]; m++) - { - index = pointset_indices[p][m]; - - for (j = 0; j < box_a_size; j++) - { - box = hypre_BoxArrayBox(box_a, j); - new_box = hypre_BoxArrayBox(new_box_a, k); - - hypre_CopyBox(box, new_box); - hypre_ProjectBox(new_box, index, stride); - - k++; - } - } - } - - switch (compute_i) - { - case 0: - hypre_ComputeInfoIndtBoxes(compute_info) = new_box_aa; - break; - - case 1: - hypre_ComputeInfoDeptBoxes(compute_info) = new_box_aa; - break; - } - } - - hypre_CopyIndex(stride, hypre_ComputeInfoStride(compute_info)); - - hypre_ComputePkgCreate(compute_info, hypre_StructVectorDataSpace(x), 1, - grid, &compute_pkgs[p]); - - hypre_BoxArrayArrayDestroy(orig_indt_boxes); - hypre_BoxArrayArrayDestroy(orig_dept_boxes); - } - - /*---------------------------------------------------------- - * Set up the relax data structure - *----------------------------------------------------------*/ - - (relax_data -> A) = hypre_StructMatrixRef(A); - (relax_data -> x) = hypre_StructVectorRef(x); - (relax_data -> b) = hypre_StructVectorRef(b); - (relax_data -> diag_rank) = diag_rank; - (relax_data -> compute_pkgs) = compute_pkgs; - - /*----------------------------------------------------- - * Compute flops - *-----------------------------------------------------*/ - - scale = 0.0; - for (p = 0; p < num_pointsets; p++) - { - stride = pointset_strides[p]; - frac = hypre_IndexX(stride); - frac *= hypre_IndexY(stride); - frac *= hypre_IndexZ(stride); - scale += (pointset_sizes[p] / frac); - } - (relax_data -> flops) = (HYPRE_BigInt)scale * (hypre_StructMatrixGlobalSize(A) + - hypre_StructVectorGlobalSize(x)); - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_PointRelax( void *relax_vdata, - hypre_StructMatrix *A, - hypre_StructVector *b, - hypre_StructVector *x ) -{ - hypre_PointRelaxData *relax_data = (hypre_PointRelaxData *)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_pointsets = (relax_data -> num_pointsets); - HYPRE_Int *pointset_ranks = (relax_data -> pointset_ranks); - hypre_Index *pointset_strides = (relax_data -> pointset_strides); - hypre_StructVector *t = (relax_data -> t); - 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_ComputePkg *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 *b_data_box; - hypre_Box *x_data_box; - hypre_Box *t_data_box; - - HYPRE_Real *Ap; - HYPRE_Real AAp0; - HYPRE_Real *bp; - HYPRE_Real *xp; - HYPRE_Real *tp; - void *matvec_data = NULL; - - HYPRE_Int Ai; - - hypre_IndexRef stride; - hypre_IndexRef start; - hypre_Index loop_size; - - HYPRE_Int constant_coefficient; - - HYPRE_Int iter, p, compute_i, i, j; - HYPRE_Int pointset; - - HYPRE_Real bsumsq = 1.0, rsumsq; - - /*---------------------------------------------------------- - * Initialize some things and deal with special cases - *----------------------------------------------------------*/ - - hypre_BeginTiming(relax_data -> time_index); - - hypre_StructMatrixDestroy(relax_data -> A); - hypre_StructVectorDestroy(relax_data -> b); - hypre_StructVectorDestroy(relax_data -> x); - (relax_data -> A) = hypre_StructMatrixRef(A); - (relax_data -> x) = hypre_StructVectorRef(x); - (relax_data -> b) = hypre_StructVectorRef(b); - - (relax_data -> num_iterations) = 0; - - /* if max_iter is zero, return */ - if (max_iter == 0) - { - /* if using a zero initial guess, return zero */ - if (zero_guess) - { - hypre_StructVectorSetConstantValues(x, 0.0); - } - - hypre_EndTiming(relax_data -> time_index); - return hypre_error_flag; - } - - constant_coefficient = hypre_StructMatrixConstantCoefficient(A); - if (constant_coefficient) { hypre_StructVectorClearBoundGhostValues(x, 0); } - - rsumsq = 0.0; - if ( tol > 0.0 ) - { - bsumsq = hypre_StructInnerProd( b, b ); - } - - /*---------------------------------------------------------- - * Do zero_guess iteration - *----------------------------------------------------------*/ - - p = 0; - iter = 0; - if ( tol > 0.0) - { - matvec_data = hypre_StructMatvecCreate(); - hypre_StructMatvecSetup( matvec_data, A, x ); - } - - if (zero_guess) - { - if ( p == 0 ) { rsumsq = 0.0; } - if (num_pointsets > 1) - { - hypre_StructVectorSetConstantValues(x, 0.0); - } - pointset = pointset_ranks[p]; - compute_pkg = compute_pkgs[pointset]; - stride = pointset_strides[pointset]; - - for (compute_i = 0; compute_i < 2; compute_i++) - { - switch (compute_i) - { - case 0: - { - compute_box_aa = hypre_ComputePkgIndtBoxes(compute_pkg); - } - break; - - case 1: - { - compute_box_aa = hypre_ComputePkgDeptBoxes(compute_pkg); - } - break; - } - - hypre_ForBoxArrayI(i, compute_box_aa) - { - compute_box_a = hypre_BoxArrayArrayBoxArray(compute_box_aa, i); - - A_data_box = - hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A), i); - b_data_box = - hypre_BoxArrayBox(hypre_StructVectorDataSpace(b), i); - x_data_box = - hypre_BoxArrayBox(hypre_StructVectorDataSpace(x), i); - - Ap = hypre_StructMatrixBoxData(A, i, diag_rank); - bp = hypre_StructVectorBoxData(b, i); - xp = hypre_StructVectorBoxData(x, i); - - hypre_ForBoxI(j, compute_box_a) - { - compute_box = hypre_BoxArrayBox(compute_box_a, j); - - start = hypre_BoxIMin(compute_box); - hypre_BoxGetStrideSize(compute_box, stride, loop_size); - - /* all matrix coefficients are constant */ - if ( constant_coefficient == 1 ) - { - Ai = hypre_CCBoxIndexRank( A_data_box, start ); - 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, - x_data_box, start, stride, xi); - { - xp[xi] = bp[bi] * AAp0; - } - hypre_BoxLoop2End(bi, xi); -#undef DEVICE_VAR - } - /* constant_coefficent 0 (variable) or 2 (variable diagonal - only) are the same for the diagonal */ - else - { -#define DEVICE_VAR is_device_ptr(xp,bp,Ap) - hypre_BoxLoop3Begin(hypre_StructVectorNDim(x), loop_size, - A_data_box, start, stride, Ai, - b_data_box, start, stride, bi, - x_data_box, start, stride, xi); - { - xp[xi] = bp[bi] / Ap[Ai]; - } - hypre_BoxLoop3End(Ai, bi, xi); -#undef DEVICE_VAR - } - } - } - } - - if (weight != 1.0) - { - hypre_StructScale(weight, x); - } - - p = (p + 1) % num_pointsets; - iter = iter + (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. - The test is simply ||r||/||b|| */ - if ( rsumsq / bsumsq < tol2 ) { max_iter = iter; } /* converged; reset max_iter to prevent more iterations */ - } - } - - /*---------------------------------------------------------- - * Do regular iterations - *----------------------------------------------------------*/ - - while (iter < max_iter) - { - if ( p == 0 ) { rsumsq = 0.0; } - pointset = pointset_ranks[p]; - compute_pkg = compute_pkgs[pointset]; - stride = pointset_strides[pointset]; - - /*hypre_StructCopy(x, t); ... not needed as long as the copy at the end of the loop - is restricted to the current pointset (hypre_relax_copy, hypre_relax_wtx */ - - for (compute_i = 0; compute_i < 2; compute_i++) - { - switch (compute_i) - { - case 0: - { - xp = hypre_StructVectorData(x); - hypre_InitializeIndtComputations(compute_pkg, xp, &comm_handle); - compute_box_aa = hypre_ComputePkgIndtBoxes(compute_pkg); - } - break; - - case 1: - { - hypre_FinalizeIndtComputations(comm_handle); - compute_box_aa = hypre_ComputePkgDeptBoxes(compute_pkg); - } - break; - } - - hypre_ForBoxArrayI(i, compute_box_aa) - { - compute_box_a = hypre_BoxArrayArrayBoxArray(compute_box_aa, i); - - A_data_box = - hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A), i); - b_data_box = - hypre_BoxArrayBox(hypre_StructVectorDataSpace(b), i); - x_data_box = - hypre_BoxArrayBox(hypre_StructVectorDataSpace(x), i); - t_data_box = - hypre_BoxArrayBox(hypre_StructVectorDataSpace(t), i); - - bp = hypre_StructVectorBoxData(b, i); - xp = hypre_StructVectorBoxData(x, i); - tp = hypre_StructVectorBoxData(t, i); - - hypre_ForBoxI(j, compute_box_a) - { - compute_box = hypre_BoxArrayBox(compute_box_a, j); - - if ( constant_coefficient == 1 || constant_coefficient == 2 ) - { - hypre_PointRelax_core12( - relax_vdata, A, constant_coefficient, - compute_box, bp, xp, tp, i, - A_data_box, b_data_box, x_data_box, t_data_box, - stride - ); - } - - else - { - hypre_PointRelax_core0( - relax_vdata, A, constant_coefficient, - compute_box, bp, xp, tp, i, - A_data_box, b_data_box, x_data_box, t_data_box, - stride - ); - } - - Ap = hypre_StructMatrixBoxData(A, i, diag_rank); - - if ( constant_coefficient == 0 || constant_coefficient == 2 ) - /* divide by the variable diagonal */ - { - start = hypre_BoxIMin(compute_box); - hypre_BoxGetStrideSize(compute_box, stride, loop_size); -#define DEVICE_VAR is_device_ptr(tp,Ap) - hypre_BoxLoop2Begin(hypre_StructVectorNDim(x), loop_size, - A_data_box, start, stride, Ai, - t_data_box, start, stride, ti); - { - tp[ti] /= Ap[Ai]; - } - hypre_BoxLoop2End(Ai, ti); -#undef DEVICE_VAR - } - } - } - } - - - if (weight != 1.0) - { - /* hypre_StructScale((1.0 - weight), x); - hypre_StructAxpy(weight, t, x);*/ - hypre_relax_wtx( relax_data, pointset, t, x ); /* x=w*t+(1-w)*x on pointset */ - } - else - { - hypre_relax_copy( relax_data, pointset, t, x ); /* x=t on pointset */ - /* hypre_StructCopy(t, x);*/ - } - - p = (p + 1) % num_pointsets; - iter = iter + (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. - The test is simply ||r||/||b|| */ - if ( rsumsq / bsumsq < tol2 ) { break; } - } - } - - if ( tol > 0.0 ) - { - hypre_StructMatvecDestroy( matvec_data ); - } - - if ( tol > 0.0 ) { (relax_data -> rresnorm) = hypre_sqrt( rsumsq / bsumsq ); } - (relax_data -> num_iterations) = iter; - - /*----------------------------------------------------------------------- - * Return - *-----------------------------------------------------------------------*/ - - hypre_IncFLOPCount(relax_data -> flops); - hypre_EndTiming(relax_data -> time_index); - - return hypre_error_flag; -} - -/* for constant_coefficient==0, all coefficients may vary ...*/ -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_UNUSED_VAR(constant_coefficient); - - hypre_PointRelaxData *relax_data = (hypre_PointRelaxData *)relax_vdata; - - HYPRE_Real *Ap0; - HYPRE_Real *Ap1; - HYPRE_Real *Ap2; - HYPRE_Real *Ap3; - HYPRE_Real *Ap4; - HYPRE_Real *Ap5; - HYPRE_Real *Ap6; - - HYPRE_Int xoff0; - HYPRE_Int xoff1; - HYPRE_Int xoff2; - HYPRE_Int xoff3; - HYPRE_Int xoff4; - HYPRE_Int xoff5; - HYPRE_Int xoff6; - - hypre_StructStencil *stencil; - hypre_Index *stencil_shape; - HYPRE_Int stencil_size; - - HYPRE_Int diag_rank = (relax_data -> diag_rank); - hypre_IndexRef start; - hypre_Index loop_size; - HYPRE_Int si, sk, ssi[MAX_DEPTH], depth, k; - - stencil = hypre_StructMatrixStencil(A); - stencil_shape = hypre_StructStencilShape(stencil); - stencil_size = hypre_StructStencilSize(stencil); - - start = hypre_BoxIMin(compute_box); - hypre_BoxGetStrideSize(compute_box, stride, loop_size); - -#define DEVICE_VAR is_device_ptr(tp,bp) - hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, - b_data_box, start, stride, bi, - t_data_box, start, stride, ti); - { - tp[ti] = bp[bi]; - } - hypre_BoxLoop2End(bi, ti); -#undef DEVICE_VAR - - /* unroll up to depth MAX_DEPTH */ - for (si = 0; si < stencil_size; si += MAX_DEPTH) - { - depth = hypre_min(MAX_DEPTH, (stencil_size - si)); - - for (k = 0, sk = si; k < depth; sk++) - { - if (sk == diag_rank) - { - depth--; - } - else - { - ssi[k] = sk; - k++; - } - } - - switch (depth) - { - case 7: - Ap6 = hypre_StructMatrixBoxData(A, boxarray_id, 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]]); - /* fall through */ - - case 5: - Ap4 = hypre_StructMatrixBoxData(A, boxarray_id, 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]]); - /* fall through */ - - case 3: - Ap2 = hypre_StructMatrixBoxData(A, boxarray_id, 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]]); - /* fall through */ - - case 1: - Ap0 = hypre_StructMatrixBoxData(A, boxarray_id, ssi[0]); - xoff0 = hypre_BoxOffsetDistance(x_data_box, stencil_shape[ssi[0]]); - /* fall through */ - - case 0: - break; - } - - switch (depth) - { - case 7: -#define DEVICE_VAR is_device_ptr(tp,Ap0,Ap1,Ap2,Ap3,Ap4,Ap5,Ap6,xp) - hypre_BoxLoop3Begin(hypre_StructMatrixNDim(A), loop_size, - A_data_box, start, stride, Ai, - x_data_box, start, stride, xi, - t_data_box, start, stride, ti); - { - tp[ti] -= - Ap0[Ai] * xp[xi + xoff0] + - Ap1[Ai] * xp[xi + xoff1] + - Ap2[Ai] * xp[xi + xoff2] + - Ap3[Ai] * xp[xi + xoff3] + - Ap4[Ai] * xp[xi + xoff4] + - Ap5[Ai] * xp[xi + xoff5] + - Ap6[Ai] * xp[xi + xoff6]; - } - hypre_BoxLoop3End(Ai, xi, ti); -#undef DEVICE_VAR - break; - - case 6: -#define DEVICE_VAR is_device_ptr(tp,Ap0,Ap1,Ap2,Ap3,Ap4,Ap5,xp) - hypre_BoxLoop3Begin(hypre_StructMatrixNDim(A), loop_size, - A_data_box, start, stride, Ai, - x_data_box, start, stride, xi, - t_data_box, start, stride, ti); - { - tp[ti] -= - Ap0[Ai] * xp[xi + xoff0] + - Ap1[Ai] * xp[xi + xoff1] + - Ap2[Ai] * xp[xi + xoff2] + - Ap3[Ai] * xp[xi + xoff3] + - Ap4[Ai] * xp[xi + xoff4] + - Ap5[Ai] * xp[xi + xoff5]; - } - hypre_BoxLoop3End(Ai, xi, ti); -#undef DEVICE_VAR - break; - - case 5: -#define DEVICE_VAR is_device_ptr(tp,Ap0,Ap1,Ap2,Ap3,Ap4,xp) - hypre_BoxLoop3Begin(hypre_StructMatrixNDim(A), loop_size, - A_data_box, start, stride, Ai, - x_data_box, start, stride, xi, - t_data_box, start, stride, ti); - { - tp[ti] -= - Ap0[Ai] * xp[xi + xoff0] + - Ap1[Ai] * xp[xi + xoff1] + - Ap2[Ai] * xp[xi + xoff2] + - Ap3[Ai] * xp[xi + xoff3] + - Ap4[Ai] * xp[xi + xoff4]; - } - hypre_BoxLoop3End(Ai, xi, ti); -#undef DEVICE_VAR - break; - - case 4: -#define DEVICE_VAR is_device_ptr(tp,Ap0,Ap1,Ap2,Ap3,xp) - hypre_BoxLoop3Begin(hypre_StructMatrixNDim(A), loop_size, - A_data_box, start, stride, Ai, - x_data_box, start, stride, xi, - t_data_box, start, stride, ti); - { - tp[ti] -= - Ap0[Ai] * xp[xi + xoff0] + - Ap1[Ai] * xp[xi + xoff1] + - Ap2[Ai] * xp[xi + xoff2] + - Ap3[Ai] * xp[xi + xoff3]; - } - hypre_BoxLoop3End(Ai, xi, ti); -#undef DEVICE_VAR - break; - - case 3: -#define DEVICE_VAR is_device_ptr(tp,Ap0,Ap1,Ap2,xp) - hypre_BoxLoop3Begin(hypre_StructMatrixNDim(A), loop_size, - A_data_box, start, stride, Ai, - x_data_box, start, stride, xi, - t_data_box, start, stride, ti); - { - tp[ti] -= - Ap0[Ai] * xp[xi + xoff0] + - Ap1[Ai] * xp[xi + xoff1] + - Ap2[Ai] * xp[xi + xoff2]; - } - hypre_BoxLoop3End(Ai, xi, ti); -#undef DEVICE_VAR - break; - - case 2: -#define DEVICE_VAR is_device_ptr(tp,Ap0,Ap1,xp) - hypre_BoxLoop3Begin(hypre_StructMatrixNDim(A), loop_size, - A_data_box, start, stride, Ai, - x_data_box, start, stride, xi, - t_data_box, start, stride, ti); - { - tp[ti] -= - Ap0[Ai] * xp[xi + xoff0] + - Ap1[Ai] * xp[xi + xoff1]; - } - hypre_BoxLoop3End(Ai, xi, ti); -#undef DEVICE_VAR - break; - - case 1: -#define DEVICE_VAR is_device_ptr(tp,Ap0,xp) - hypre_BoxLoop3Begin(hypre_StructMatrixNDim(A), loop_size, - A_data_box, start, stride, Ai, - x_data_box, start, stride, xi, - t_data_box, start, stride, ti); - { - tp[ti] -= - Ap0[Ai] * xp[xi + xoff0]; - } - hypre_BoxLoop3End(Ai, xi, ti); -#undef DEVICE_VAR - break; - - case 0: - break; - } - } - - return hypre_error_flag; -} - - -/* for constant_coefficient==1 or 2, all offdiagonal coefficients constant over space ...*/ -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_UNUSED_VAR(A_data_box); - - hypre_PointRelaxData *relax_data = (hypre_PointRelaxData *)relax_vdata; - - HYPRE_Real *Apd; - HYPRE_Real *Ap0; - HYPRE_Real *Ap1; - HYPRE_Real *Ap2; - HYPRE_Real *Ap3; - HYPRE_Real *Ap4; - HYPRE_Real *Ap5; - HYPRE_Real *Ap6; - HYPRE_Real AAp0; - HYPRE_Real AAp1; - HYPRE_Real AAp2; - HYPRE_Real AAp3; - HYPRE_Real AAp4; - HYPRE_Real AAp5; - HYPRE_Real AAp6; - HYPRE_Real AApd; - - HYPRE_Int xoff0; - HYPRE_Int xoff1; - HYPRE_Int xoff2; - HYPRE_Int xoff3; - HYPRE_Int xoff4; - HYPRE_Int xoff5; - HYPRE_Int xoff6; - - hypre_StructStencil *stencil; - hypre_Index *stencil_shape; - HYPRE_Int stencil_size; - - HYPRE_Int diag_rank = (relax_data -> diag_rank); - hypre_IndexRef start; - hypre_Index loop_size; - HYPRE_Int si, sk, ssi[MAX_DEPTH], depth, k; - HYPRE_Int Ai; - - stencil = hypre_StructMatrixStencil(A); - stencil_shape = hypre_StructStencilShape(stencil); - stencil_size = hypre_StructStencilSize(stencil); - - start = hypre_BoxIMin(compute_box); - hypre_BoxGetStrideSize(compute_box, stride, loop_size); - - /* The standard (variable coefficient) algorithm initializes - tp=bp. Do it here, but for constant diagonal, also - divide by the diagonal (and set up AApd for other - division-equivalents. - For a variable diagonal, this diagonal division is done - at the end of the computation. */ - Ai = hypre_CCBoxIndexRank( A_data_box, start ); - -#define DEVICE_VAR is_device_ptr(tp,bp) - if ( constant_coefficient == 1 ) /* constant diagonal */ - { - Apd = hypre_StructMatrixBoxData(A, boxarray_id, diag_rank); - AApd = 1 / Apd[Ai]; - - hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, - b_data_box, start, stride, bi, - t_data_box, start, stride, ti); - { - tp[ti] = AApd * bp[bi]; - } - hypre_BoxLoop2End(bi, ti); - } - else /* constant_coefficient==2, variable diagonal */ - { - AApd = 1; - hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, - b_data_box, start, stride, bi, - t_data_box, start, stride, ti); - { - tp[ti] = bp[bi]; - } - hypre_BoxLoop2End(bi, ti); - } -#undef DEVICE_VAR - - /* unroll up to depth MAX_DEPTH */ - for (si = 0; si < stencil_size; si += MAX_DEPTH) - { - depth = hypre_min(MAX_DEPTH, (stencil_size - si)); - - for (k = 0, sk = si; k < depth; sk++) - { - if (sk == diag_rank) - { - depth--; - } - else - { - ssi[k] = sk; - k++; - } - } - - switch (depth) - { - case 7: - Ap6 = hypre_StructMatrixBoxData(A, boxarray_id, 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]]); - /* fall through */ - - case 5: - Ap4 = hypre_StructMatrixBoxData(A, boxarray_id, 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]]); - /* fall through */ - - case 3: - Ap2 = hypre_StructMatrixBoxData(A, boxarray_id, 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]]); - /* fall through */ - - case 1: - Ap0 = hypre_StructMatrixBoxData(A, boxarray_id, 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) - { - 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; - hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, - x_data_box, start, stride, xi, - t_data_box, start, stride, ti); - { - tp[ti] -= - AAp0 * xp[xi + xoff0] + - AAp1 * xp[xi + xoff1] + - AAp2 * xp[xi + xoff2] + - AAp3 * xp[xi + xoff3] + - AAp4 * xp[xi + xoff4] + - AAp5 * xp[xi + xoff5] + - AAp6 * xp[xi + xoff6]; - } - hypre_BoxLoop2End(xi, ti); - 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; - hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, - x_data_box, start, stride, xi, - t_data_box, start, stride, ti); - { - tp[ti] -= - AAp0 * xp[xi + xoff0] + - AAp1 * xp[xi + xoff1] + - AAp2 * xp[xi + xoff2] + - AAp3 * xp[xi + xoff3] + - AAp4 * xp[xi + xoff4] + - AAp5 * xp[xi + xoff5]; - } - hypre_BoxLoop2End(xi, ti); - break; - - case 5: - 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); - { - tp[ti] -= - AAp0 * xp[xi + xoff0] + - AAp1 * xp[xi + xoff1] + - AAp2 * xp[xi + xoff2] + - AAp3 * xp[xi + xoff3] + - AAp4 * xp[xi + xoff4]; - } - hypre_BoxLoop2End(xi, ti); - break; - - case 4: - 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); - { - tp[ti] -= - AAp0 * xp[xi + xoff0] + - AAp1 * xp[xi + xoff1] + - AAp2 * xp[xi + xoff2] + - AAp3 * xp[xi + xoff3]; - } - hypre_BoxLoop2End(xi, ti); - break; - - case 3: - 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); - { - tp[ti] -= - AAp0 * xp[xi + xoff0] + - AAp1 * xp[xi + xoff1] + - AAp2 * xp[xi + xoff2]; - } - hypre_BoxLoop2End(xi, ti); - break; - - case 2: - 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); - { - tp[ti] -= - AAp0 * xp[xi + xoff0] + - AAp1 * xp[xi + xoff1]; - } - hypre_BoxLoop2End(xi, ti); - break; - - case 1: - AAp0 = Ap0[Ai] * AApd; - hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, - x_data_box, start, stride, xi, - t_data_box, start, stride, ti); - { - tp[ti] -= - AAp0 * xp[xi + xoff0]; - } - hypre_BoxLoop2End(xi, ti); - break; - - case 0: - break; - } -#undef DEVICE_VAR - } - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_PointRelaxSetTol( void *relax_vdata, - HYPRE_Real tol ) -{ - hypre_PointRelaxData *relax_data = (hypre_PointRelaxData *)relax_vdata; - - (relax_data -> tol) = tol; - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_PointRelaxGetTol( void *relax_vdata, - HYPRE_Real *tol ) -{ - hypre_PointRelaxData *relax_data = (hypre_PointRelaxData *)relax_vdata; - - *tol = (relax_data -> tol); - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_PointRelaxSetMaxIter( void *relax_vdata, - HYPRE_Int max_iter ) -{ - hypre_PointRelaxData *relax_data = (hypre_PointRelaxData *)relax_vdata; - - (relax_data -> max_iter) = max_iter; - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_PointRelaxGetMaxIter( void *relax_vdata, - HYPRE_Int * max_iter ) -{ - hypre_PointRelaxData *relax_data = (hypre_PointRelaxData *)relax_vdata; - - *max_iter = (relax_data -> max_iter); - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_PointRelaxSetZeroGuess( void *relax_vdata, - HYPRE_Int zero_guess ) -{ - hypre_PointRelaxData *relax_data = (hypre_PointRelaxData *)relax_vdata; - - (relax_data -> zero_guess) = zero_guess; - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_PointRelaxGetZeroGuess( void *relax_vdata, - HYPRE_Int * zero_guess ) -{ - hypre_PointRelaxData *relax_data = (hypre_PointRelaxData *)relax_vdata; - - *zero_guess = (relax_data -> zero_guess); - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_PointRelaxGetNumIterations( void *relax_vdata, - HYPRE_Int * num_iterations ) -{ - hypre_PointRelaxData *relax_data = (hypre_PointRelaxData *)relax_vdata; - - *num_iterations = (relax_data -> num_iterations); - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_PointRelaxSetWeight( void *relax_vdata, - HYPRE_Real weight ) -{ - hypre_PointRelaxData *relax_data = (hypre_PointRelaxData *)relax_vdata; - - (relax_data -> weight) = weight; - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_PointRelaxSetNumPointsets( void *relax_vdata, - HYPRE_Int num_pointsets ) -{ - hypre_PointRelaxData *relax_data = (hypre_PointRelaxData *)relax_vdata; - HYPRE_Int i; - - /* free up old pointset memory */ - for (i = 0; i < (relax_data -> num_pointsets); i++) - { - hypre_TFree(relax_data -> pointset_indices[i], HYPRE_MEMORY_HOST); - } - hypre_TFree(relax_data -> pointset_sizes, HYPRE_MEMORY_HOST); - hypre_TFree(relax_data -> pointset_ranks, HYPRE_MEMORY_HOST); - hypre_TFree(relax_data -> pointset_strides, HYPRE_MEMORY_HOST); - hypre_TFree(relax_data -> pointset_indices, HYPRE_MEMORY_HOST); - - /* alloc new pointset memory */ - (relax_data -> num_pointsets) = num_pointsets; - (relax_data -> pointset_sizes) = hypre_TAlloc(HYPRE_Int, num_pointsets, HYPRE_MEMORY_HOST); - (relax_data -> pointset_ranks) = hypre_TAlloc(HYPRE_Int, num_pointsets, HYPRE_MEMORY_HOST); - (relax_data -> pointset_strides) = hypre_TAlloc(hypre_Index, num_pointsets, HYPRE_MEMORY_HOST); - (relax_data -> pointset_indices) = hypre_TAlloc(hypre_Index *, - num_pointsets, HYPRE_MEMORY_HOST); - for (i = 0; i < num_pointsets; i++) - { - (relax_data -> pointset_sizes[i]) = 0; - (relax_data -> pointset_ranks[i]) = i; - (relax_data -> pointset_indices[i]) = NULL; - } - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_PointRelaxSetPointset( void *relax_vdata, - HYPRE_Int pointset, - HYPRE_Int pointset_size, - hypre_Index pointset_stride, - hypre_Index *pointset_indices ) -{ - hypre_PointRelaxData *relax_data = (hypre_PointRelaxData *)relax_vdata; - HYPRE_Int i; - - /* free up old pointset memory */ - hypre_TFree(relax_data -> pointset_indices[pointset], HYPRE_MEMORY_HOST); - - /* alloc new pointset memory */ - (relax_data -> pointset_indices[pointset]) = - hypre_TAlloc(hypre_Index, pointset_size, HYPRE_MEMORY_HOST); - - (relax_data -> pointset_sizes[pointset]) = pointset_size; - hypre_CopyIndex(pointset_stride, - (relax_data -> pointset_strides[pointset])); - for (i = 0; i < pointset_size; i++) - { - hypre_CopyIndex(pointset_indices[i], - (relax_data -> pointset_indices[pointset][i])); - } - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_PointRelaxSetPointsetRank( void *relax_vdata, - HYPRE_Int pointset, - HYPRE_Int pointset_rank ) -{ - hypre_PointRelaxData *relax_data = (hypre_PointRelaxData *)relax_vdata; - - (relax_data -> pointset_ranks[pointset]) = pointset_rank; - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_PointRelaxSetTempVec( void *relax_vdata, - hypre_StructVector *t ) -{ - hypre_PointRelaxData *relax_data = (hypre_PointRelaxData *)relax_vdata; - - hypre_StructVectorDestroy(relax_data -> t); - (relax_data -> t) = hypre_StructVectorRef(t); - - return hypre_error_flag; -} - - - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -HYPRE_Int hypre_PointRelaxGetFinalRelativeResidualNorm( void * relax_vdata, HYPRE_Real * norm ) -{ - hypre_PointRelaxData *relax_data = (hypre_PointRelaxData *)relax_vdata; - - *norm = relax_data -> rresnorm; - return 0; -} - -/*-------------------------------------------------------------------------- - * Special vector operation for use in hypre_PointRelax - - * convex combination of vectors on specified pointsets. - *--------------------------------------------------------------------------*/ - -HYPRE_Int hypre_relax_wtx( void *relax_vdata, HYPRE_Int pointset, - hypre_StructVector *t, hypre_StructVector *x ) -/* Sets x to a convex combination of x and t, x = weight * t + (1-weight) * x, - but only in the specified pointset */ -{ - hypre_PointRelaxData *relax_data = (hypre_PointRelaxData *)relax_vdata; - HYPRE_Real weight = (relax_data -> weight); - hypre_Index *pointset_strides = (relax_data -> pointset_strides); - hypre_ComputePkg **compute_pkgs = (relax_data -> compute_pkgs); - hypre_ComputePkg *compute_pkg; - - hypre_IndexRef stride; - hypre_IndexRef start; - hypre_Index loop_size; - - HYPRE_Real weightc = 1 - weight; - HYPRE_Real *xp, *tp; - HYPRE_Int compute_i, i, j; - - hypre_BoxArrayArray *compute_box_aa; - hypre_BoxArray *compute_box_a; - hypre_Box *compute_box; - hypre_Box *x_data_box; - hypre_Box *t_data_box; - - compute_pkg = compute_pkgs[pointset]; - stride = pointset_strides[pointset]; - - for (compute_i = 0; compute_i < 2; compute_i++) - { - switch (compute_i) - { - case 0: - { - compute_box_aa = hypre_ComputePkgIndtBoxes(compute_pkg); - } - break; - - case 1: - { - compute_box_aa = hypre_ComputePkgDeptBoxes(compute_pkg); - } - break; - } - - hypre_ForBoxArrayI(i, compute_box_aa) - { - compute_box_a = hypre_BoxArrayArrayBoxArray(compute_box_aa, i); - - x_data_box = - hypre_BoxArrayBox(hypre_StructVectorDataSpace(x), i); - t_data_box = - hypre_BoxArrayBox(hypre_StructVectorDataSpace(t), i); - - xp = hypre_StructVectorBoxData(x, i); - tp = hypre_StructVectorBoxData(t, i); - - hypre_ForBoxI(j, compute_box_a) - { - compute_box = hypre_BoxArrayBox(compute_box_a, j); - - start = hypre_BoxIMin(compute_box); - hypre_BoxGetStrideSize(compute_box, stride, loop_size); - -#define DEVICE_VAR is_device_ptr(xp,tp) - hypre_BoxLoop2Begin(hypre_StructVectorNDim(x), loop_size, - x_data_box, start, stride, xi, - t_data_box, start, stride, ti); - { - xp[xi] = weight * tp[ti] + weightc * xp[xi]; - } - hypre_BoxLoop2End(xi, ti); -#undef DEVICE_VAR - } - } - } - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - * Special vector operation for use in hypre_PointRelax - - * vector copy on specified pointsets. - *--------------------------------------------------------------------------*/ - -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; - hypre_Index *pointset_strides = (relax_data -> pointset_strides); - hypre_ComputePkg **compute_pkgs = (relax_data -> compute_pkgs); - hypre_ComputePkg *compute_pkg; - - hypre_IndexRef stride; - hypre_IndexRef start; - hypre_Index loop_size; - - HYPRE_Real *xp, *tp; - HYPRE_Int compute_i, i, j; - - hypre_BoxArrayArray *compute_box_aa; - hypre_BoxArray *compute_box_a; - hypre_Box *compute_box; - hypre_Box *x_data_box; - hypre_Box *t_data_box; - - compute_pkg = compute_pkgs[pointset]; - stride = pointset_strides[pointset]; - - for (compute_i = 0; compute_i < 2; compute_i++) - { - switch (compute_i) - { - case 0: - { - compute_box_aa = hypre_ComputePkgIndtBoxes(compute_pkg); - } - break; - - case 1: - { - compute_box_aa = hypre_ComputePkgDeptBoxes(compute_pkg); - } - break; - } - - hypre_ForBoxArrayI(i, compute_box_aa) - { - compute_box_a = hypre_BoxArrayArrayBoxArray(compute_box_aa, i); - - x_data_box = - hypre_BoxArrayBox(hypre_StructVectorDataSpace(x), i); - t_data_box = - hypre_BoxArrayBox(hypre_StructVectorDataSpace(t), i); - - xp = hypre_StructVectorBoxData(x, i); - tp = hypre_StructVectorBoxData(t, i); - - hypre_ForBoxI(j, compute_box_a) - { - compute_box = hypre_BoxArrayBox(compute_box_a, j); - - start = hypre_BoxIMin(compute_box); - hypre_BoxGetStrideSize(compute_box, stride, loop_size); - -#define DEVICE_VAR is_device_ptr(xp,tp) - hypre_BoxLoop2Begin(hypre_StructVectorNDim(x), loop_size, - x_data_box, start, stride, xi, - t_data_box, start, stride, ti); - { - xp[xi] = tp[ti]; - } - hypre_BoxLoop2End(xi, ti); -#undef DEVICE_VAR - } - } - } - - return hypre_error_flag; -} diff --git a/src/struct_ls/protos.h b/src/struct_ls/protos.h index d2da3a0fae..bdd266a1f8 100644 --- a/src/struct_ls/protos.h +++ b/src/struct_ls/protos.h @@ -5,14 +5,6 @@ * 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, @@ -27,10 +19,6 @@ 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 ); - -/* general.c */ -HYPRE_Int hypre_Log2 ( HYPRE_Int p ); /* hybrid.c */ void *hypre_HybridCreate ( MPI_Comm comm ); @@ -63,29 +51,26 @@ HYPRE_Int hypre_HybridSetup ( void *hybrid_vdata, hypre_StructMatrix *A, hypre_S 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_struct_pfmg.c */ -HYPRE_Int hypre_PFMGSetDeviceLevel( void *pfmg_vdata, HYPRE_Int device_level ); +/* diagscale.c */ +HYPRE_Int hypre_StructDiagScale( hypre_StructMatrix *A, hypre_StructVector *y, hypre_StructVector *x ); /* 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 ); +void *hypre_StructJacobiCreate ( MPI_Comm comm ); +HYPRE_Int hypre_StructJacobiDestroy ( void *jacobi_vdata ); +HYPRE_Int hypre_StructJacobiSetup ( void *jacobi_vdata, hypre_StructMatrix *A, + hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int hypre_StructJacobiSolve ( void *jacobi_vdata, hypre_StructMatrix *A, + hypre_StructVector *b, hypre_StructVector *x ); +HYPRE_Int hypre_StructJacobiSetTol ( void *jacobi_vdata, HYPRE_Real tol ); +HYPRE_Int hypre_StructJacobiGetTol ( void *jacobi_vdata, HYPRE_Real *tol ); +HYPRE_Int hypre_StructJacobiSetMaxIter ( void *jacobi_vdata, HYPRE_Int max_iter ); +HYPRE_Int hypre_StructJacobiGetMaxIter ( void *jacobi_vdata, HYPRE_Int *max_iter ); +HYPRE_Int hypre_StructJacobiSetZeroGuess ( void *jacobi_vdata, HYPRE_Int zero_guess ); +HYPRE_Int hypre_StructJacobiGetZeroGuess ( void *jacobi_vdata, HYPRE_Int *zero_guess ); +HYPRE_Int hypre_StructJacobiGetNumIterations ( void *jacobi_vdata, HYPRE_Int *num_iterations ); +HYPRE_Int hypre_StructJacobiSetWeight ( void *jacobi_vdata, HYPRE_Real weight ); +HYPRE_Int hypre_StructJacobiSetTempVec ( void *jacobi_vdata, hypre_StructVector *t ); +HYPRE_Int hypre_StructJacobiGetFinalRelativeResidualNorm ( void *jacobi_vdata, HYPRE_Real *norm ); /* pcg_struct.c */ void *hypre_StructKrylovCAlloc ( size_t count, size_t elt_size, HYPRE_MemoryLocation location ); @@ -102,6 +87,7 @@ HYPRE_Int hypre_StructKrylovInnerProdTagged ( void *x, void *y, HYPRE_Int *num_t HYPRE_Complex **iprod_ptr ); HYPRE_Int hypre_StructKrylovCopyVector ( void *x, void *y ); HYPRE_Int hypre_StructKrylovClearVector ( void *x ); +HYPRE_Int hypre_StructKrylovSetRandomValues ( void *x, HYPRE_Int seed ); 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 ); @@ -207,6 +193,8 @@ 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_PFMGSetMatmultType ( void *pfmg_vdata, HYPRE_Int matmult_type ); +HYPRE_Int hypre_PFMGGetMatmultType ( void *pfmg_vdata, HYPRE_Int *matmult_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 ); @@ -218,11 +206,22 @@ 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_PFMGSetPrintFreq ( void *pfmg_vdata, HYPRE_Int print_freq ); +HYPRE_Int hypre_PFMGGetPrintFreq ( void *pfmg_vdata, HYPRE_Int *print_freq ); HYPRE_Int hypre_PFMGGetNumIterations ( void *pfmg_vdata, HYPRE_Int *num_iterations ); -HYPRE_Int hypre_PFMGPrintLogging ( void *pfmg_vdata, HYPRE_Int myid ); +HYPRE_Int hypre_PFMGPrintLogging ( void *pfmg_vdata ); HYPRE_Int hypre_PFMGGetFinalRelativeResidualNorm ( void *pfmg_vdata, HYPRE_Real *relative_residual_norm ); +/* pfmg_coarsen.c */ +HYPRE_Int hypre_PFMGComputeMaxLevels ( hypre_StructGrid *grid, HYPRE_Int *max_levels_ptr ); +HYPRE_Int hypre_PFMGComputeCxyz ( hypre_StructMatrix *A, HYPRE_Real *cxyz, HYPRE_Real *sqcxyz ); +HYPRE_Int hypre_PFMGComputeDxyz ( hypre_StructMatrix *A, HYPRE_Real *dxyz, HYPRE_Int *dxyz_flag ); +HYPRE_Int hypre_PFMGCoarsen ( hypre_Box *cbox, hypre_Index periodic, HYPRE_Int max_levels, + HYPRE_Int dxyz_flag, HYPRE_Real *dxyz, HYPRE_Int **cdir_l_ptr, + HYPRE_Int **active_l_ptr, HYPRE_Real **relax_weights_ptr, + HYPRE_Int *num_levels ); + /* pfmg_relax.c */ void *hypre_PFMGRelaxCreate ( MPI_Comm comm ); HYPRE_Int hypre_PFMGRelaxDestroy ( void *pfmg_relax_vdata ); @@ -240,83 +239,26 @@ HYPRE_Int hypre_PFMGRelaxSetZeroGuess ( void *pfmg_relax_vdata, HYPRE_Int zero_g 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_ZeroDiagonal ( hypre_StructMatrix *A ); +HYPRE_Int hypre_PFMGSetup ( void *pfmg_vdata, hypre_StructMatrix *A, + hypre_StructVector *b, hypre_StructVector *x ); /* 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_Int cdir, + hypre_Index stride, HYPRE_Int rap_type ); +HYPRE_Int hypre_PFMGSetupInterpOp ( hypre_StructMatrix *P, hypre_StructMatrix *A, HYPRE_Int cdir ); +HYPRE_Int hypre_PFMGSetupInterpOp_core_CC( hypre_StructMatrix *P, hypre_StructMatrix *A, + HYPRE_Int cdir, HYPRE_Complex *Pconst0_ptr, + HYPRE_Complex *Pconst1_ptr, HYPRE_Complex *Pconst2_ptr ); +HYPRE_Int hypre_PFMGSetupInterpOp_core_VC( hypre_StructMatrix *P, hypre_StructMatrix *A, + HYPRE_Int cdir, HYPRE_Complex Pconst0, + HYPRE_Complex Pconst1, HYPRE_Complex Pconst2 ); + /* 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 ); /* pfmg_setup_rap7.c */ hypre_StructMatrix *hypre_PFMGCreateCoarseOp7 ( hypre_StructMatrix *R, hypre_StructMatrix *A, @@ -336,41 +278,6 @@ HYPRE_Int hypre_PFMGSetupRAPOp ( hypre_StructMatrix *R, hypre_StructMatrix *A, 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 ); - /* red_black_constantcoef_gs.c */ HYPRE_Int hypre_RedBlackConstantCoefGS ( void *relax_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); @@ -469,12 +376,12 @@ 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_SMGPrintLogging ( void *smg_vdata ); 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 ); +HYPRE_Int hypre_SMGSetMaxLevel ( void *smg_vdata, HYPRE_Int max_level ); /* smg_relax.c */ void *hypre_SMGRelaxCreate ( MPI_Comm comm ); @@ -526,16 +433,6 @@ HYPRE_Int hypre_SMGResidualSetBase ( void *residual_vdata, hypre_Index base_inde 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_SMGResidualDestroy ( void *residual_vdata ); - /* smg_setup.c */ HYPRE_Int hypre_SMGSetup ( void *smg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, hypre_StructVector *x ); @@ -562,83 +459,3 @@ HYPRE_Int hypre_SMGSetupRestrictOp ( hypre_StructMatrix *A, hypre_StructMatrix * /* smg_solve.c */ 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 ); - -/* 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 ); - -/* 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 ); - -/* 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 ); - -/* 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_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_SparseMSGRestrictDestroy ( void *restrict_vdata ); - -/* sparse_msg_setup.c */ -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 ); - -/* sparse_msg_solve.c */ -HYPRE_Int hypre_SparseMSGSolve ( void *smsg_vdata, hypre_StructMatrix *A, hypre_StructVector *b, - hypre_StructVector *x ); diff --git a/src/struct_ls/red_black_constantcoef_gs.c b/src/struct_ls/red_black_constantcoef_gs.c index 63fd5fd61b..642c170746 100644 --- a/src/struct_ls/red_black_constantcoef_gs.c +++ b/src/struct_ls/red_black_constantcoef_gs.c @@ -9,10 +9,6 @@ #include "_hypre_struct_mv.hpp" #include "red_black_gs.h" -#ifndef hypre_abs -#define hypre_abs(a) (((a)>0) ? (a) : -(a)) -#endif - /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -22,14 +18,13 @@ hypre_RedBlackConstantCoefGS( void *relax_vdata, hypre_StructVector *b, hypre_StructVector *x ) { - hypre_RedBlackGSData *relax_data = (hypre_RedBlackGSData *)relax_vdata; + hypre_RedBlackGSData *relax_data = (hypre_RedBlackGSData *) relax_vdata; HYPRE_Int max_iter = (relax_data -> max_iter); HYPRE_Int zero_guess = (relax_data -> zero_guess); HYPRE_Int rb_start = (relax_data -> rb_start); - HYPRE_Int diag_rank = (relax_data -> diag_rank); hypre_ComputePkg *compute_pkg = (relax_data -> compute_pkg); - HYPRE_Int ndim = hypre_StructMatrixNDim(A); + HYPRE_Int ndim = hypre_StructMatrixNDim(A); hypre_CommHandle *comm_handle; @@ -41,21 +36,20 @@ hypre_RedBlackConstantCoefGS( void *relax_vdata, hypre_Box *b_dbox; hypre_Box *x_dbox; - HYPRE_Int Ai, Astart, Ani, Anj; + HYPRE_Int Astart, Ani, Anj; HYPRE_Int bstart, bni, bnj; HYPRE_Int xstart, xni, xnj; HYPRE_Int xoff0 = 0, xoff1 = 0, xoff2 = 0; HYPRE_Int xoff3 = 0, xoff4 = 0, xoff5 = 0; HYPRE_Real *Ap; - HYPRE_Real *App; HYPRE_Real *bp; HYPRE_Real *xp; /* constant coefficient */ 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_Real *App0 = NULL, *App1 = NULL, *App2 = NULL; + HYPRE_Real *App3 = NULL, *App4 = NULL, *App5 = NULL; hypre_IndexRef start; hypre_Index loop_size; @@ -63,6 +57,7 @@ hypre_RedBlackConstantCoefGS( void *relax_vdata, hypre_StructStencil *stencil; hypre_Index *stencil_shape; HYPRE_Int stencil_size; + HYPRE_Int stencil_diag_entry; HYPRE_Int offd[6]; HYPRE_Int iter, rb, redblack, d; @@ -101,12 +96,13 @@ hypre_RedBlackConstantCoefGS( void *relax_vdata, stencil = hypre_StructMatrixStencil(A); stencil_shape = hypre_StructStencilShape(stencil); stencil_size = hypre_StructStencilSize(stencil); + stencil_diag_entry = hypre_StructStencilDiagEntry(stencil); /* get off-diag entry ranks ready */ i = 0; for (j = 0; j < stencil_size; j++) { - if (j != diag_rank) + if (j != stencil_diag_entry) { offd[i] = j; i++; @@ -150,7 +146,7 @@ hypre_RedBlackConstantCoefGS( void *relax_vdata, b_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(b), i); x_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(x), i); - Ap = hypre_StructMatrixBoxData(A, i, diag_rank); + Ap = hypre_StructMatrixBoxData(A, i, stencil_diag_entry); bp = hypre_StructVectorBoxData(b, i); xp = hypre_StructVectorBoxData(x, i); @@ -189,9 +185,6 @@ hypre_RedBlackConstantCoefGS( void *relax_vdata, if (constant_coeff == 1) { - Ai = hypre_CCBoxIndexRank(A_dbox, start); - AApd = 1.0 / Ap[Ai]; - hypre_RedBlackLoopInit(); #define DEVICE_VAR is_device_ptr(xp,bp) @@ -199,7 +192,7 @@ hypre_RedBlackConstantCoefGS( void *relax_vdata, bstart, bni, bnj, bi, xstart, xni, xnj, xi); { - xp[xi] = bp[bi] * AApd; + xp[xi] = bp[bi] / Ap[0]; } hypre_RedBlackConstantcoefLoopEnd(); #undef DEVICE_VAR @@ -266,7 +259,7 @@ hypre_RedBlackConstantCoefGS( void *relax_vdata, b_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(b), i); x_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(x), i); - Ap = hypre_StructMatrixBoxData(A, i, diag_rank); + Ap = hypre_StructMatrixBoxData(A, i, stencil_diag_entry); bp = hypre_StructVectorBoxData(b, i); xp = hypre_StructVectorBoxData(x, i); @@ -294,7 +287,6 @@ hypre_RedBlackConstantCoefGS( void *relax_vdata, xni = hypre_BoxSizeX(x_dbox); bnj = hypre_BoxSizeY(b_dbox); xnj = hypre_BoxSizeY(x_dbox); - Ai = hypre_CCBoxIndexRank(A_dbox, start); if (ndim < 3) { nk = 1; @@ -307,43 +299,29 @@ hypre_RedBlackConstantCoefGS( void *relax_vdata, switch (stencil_size) { case 7: - App = hypre_StructMatrixBoxData(A, i, offd[5]); - App5 = App[Ai]; - App = hypre_StructMatrixBoxData(A, i, offd[4]); - App4 = App[Ai]; - xoff5 = hypre_BoxOffsetDistance( - x_dbox, stencil_shape[offd[5]]); - xoff4 = hypre_BoxOffsetDistance( - x_dbox, stencil_shape[offd[4]]); - /* fall through */ + App5 = hypre_StructMatrixBoxData(A, i, offd[5]); + App4 = hypre_StructMatrixBoxData(A, i, offd[4]); + xoff5 = hypre_BoxOffsetDistance(x_dbox, stencil_shape[offd[5]]); + xoff4 = hypre_BoxOffsetDistance(x_dbox, stencil_shape[offd[4]]); + HYPRE_FALLTHROUGH; case 5: - App = hypre_StructMatrixBoxData(A, i, offd[3]); - App3 = App[Ai]; - App = hypre_StructMatrixBoxData(A, i, offd[2]); - App2 = App[Ai]; - xoff3 = hypre_BoxOffsetDistance( - x_dbox, stencil_shape[offd[3]]); - xoff2 = hypre_BoxOffsetDistance( - x_dbox, stencil_shape[offd[2]]); - /* fall through */ + App3 = hypre_StructMatrixBoxData(A, i, offd[3]); + App2 = hypre_StructMatrixBoxData(A, i, offd[2]); + xoff3 = hypre_BoxOffsetDistance(x_dbox, stencil_shape[offd[3]]); + xoff2 = hypre_BoxOffsetDistance(x_dbox, stencil_shape[offd[2]]); + HYPRE_FALLTHROUGH; case 3: - App = hypre_StructMatrixBoxData(A, i, offd[1]); - App1 = App[Ai]; - App = hypre_StructMatrixBoxData(A, i, offd[0]); - App0 = App[Ai]; - xoff1 = hypre_BoxOffsetDistance( - x_dbox, stencil_shape[offd[1]]); - xoff0 = hypre_BoxOffsetDistance( - x_dbox, stencil_shape[offd[0]]); + App1 = hypre_StructMatrixBoxData(A, i, offd[1]); + App0 = hypre_StructMatrixBoxData(A, i, offd[0]); + xoff1 = hypre_BoxOffsetDistance(x_dbox, stencil_shape[offd[1]]); + xoff0 = hypre_BoxOffsetDistance(x_dbox, stencil_shape[offd[0]]); break; } if (constant_coeff == 1) { - AApd = 1 / Ap[Ai]; - switch (stencil_size) { case 7: @@ -355,12 +333,12 @@ hypre_RedBlackConstantCoefGS( void *relax_vdata, { 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[0] * xp[xi + xoff0] - + App1[0] * xp[xi + xoff1] - + App2[0] * xp[xi + xoff2] - + App3[0] * xp[xi + xoff3] - + App4[0] * xp[xi + xoff4] - + App5[0] * xp[xi + xoff5]) / Ap[0]; } hypre_RedBlackConstantcoefLoopEnd(); #undef DEVICE_VAR @@ -376,10 +354,10 @@ hypre_RedBlackConstantCoefGS( void *relax_vdata, { xp[xi] = (bp[bi] - - App0 * xp[xi + xoff0] - - App1 * xp[xi + xoff1] - - App2 * xp[xi + xoff2] - - App3 * xp[xi + xoff3]) * AApd; + App0[0] * xp[xi + xoff0] - + App1[0] * xp[xi + xoff1] - + App2[0] * xp[xi + xoff2] - + App3[0] * xp[xi + xoff3]) / Ap[0]; } hypre_RedBlackConstantcoefLoopEnd(); #undef DEVICE_VAR @@ -394,8 +372,8 @@ hypre_RedBlackConstantCoefGS( void *relax_vdata, { xp[xi] = (bp[bi] - - App0 * xp[xi + xoff0] - - App1 * xp[xi + xoff1]) * AApd; + App0[0] * xp[xi + xoff0] - + App1[0] * xp[xi + xoff1]) / Ap[0]; } hypre_RedBlackConstantcoefLoopEnd(); #undef DEVICE_VAR @@ -422,12 +400,12 @@ hypre_RedBlackConstantCoefGS( void *relax_vdata, { 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[0] * xp[xi + xoff0] - + App1[0] * xp[xi + xoff1] - + App2[0] * xp[xi + xoff2] - + App3[0] * xp[xi + xoff3] - + App4[0] * xp[xi + xoff4] - + App5[0] * xp[xi + xoff5]) / Ap[Ai]; } hypre_RedBlackLoopEnd(); #undef DEVICE_VAR @@ -443,10 +421,10 @@ hypre_RedBlackConstantCoefGS( void *relax_vdata, { xp[xi] = (bp[bi] - - App0 * xp[xi + xoff0] - - App1 * xp[xi + xoff1] - - App2 * xp[xi + xoff2] - - App3 * xp[xi + xoff3]) / Ap[Ai]; + App0[0] * xp[xi + xoff0] - + App1[0] * xp[xi + xoff1] - + App2[0] * xp[xi + xoff2] - + App3[0] * xp[xi + xoff3]) / Ap[Ai]; } hypre_RedBlackLoopEnd(); #undef DEVICE_VAR @@ -462,8 +440,8 @@ hypre_RedBlackConstantCoefGS( void *relax_vdata, { xp[xi] = (bp[bi] - - App0 * xp[xi + xoff0] - - App1 * xp[xi + xoff1]) / Ap[Ai]; + App0[0] * xp[xi + xoff0] - + App1[0] * xp[xi + xoff1]) / Ap[Ai]; } hypre_RedBlackLoopEnd(); #undef DEVICE_VAR diff --git a/src/struct_ls/red_black_gs.c b/src/struct_ls/red_black_gs.c index a2edbe35dc..505ffacd7d 100644 --- a/src/struct_ls/red_black_gs.c +++ b/src/struct_ls/red_black_gs.c @@ -74,32 +74,24 @@ hypre_RedBlackGSSetup( void *relax_vdata, hypre_StructVector *b, hypre_StructVector *x ) { + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(A); hypre_RedBlackGSData *relax_data = (hypre_RedBlackGSData *)relax_vdata; + hypre_StructGrid *grid = hypre_StructMatrixGrid(A); + hypre_StructStencil *stencil = hypre_StructMatrixStencil(A); - HYPRE_Int diag_rank; hypre_ComputePkg *compute_pkg; - - hypre_StructGrid *grid; - hypre_StructStencil *stencil; - hypre_Index diag_index; hypre_ComputeInfo *compute_info; + hypre_Index ustride; - /*---------------------------------------------------------- - * Find the matrix diagonal - *----------------------------------------------------------*/ - - grid = hypre_StructMatrixGrid(A); - stencil = hypre_StructMatrixStencil(A); - - hypre_SetIndex3(diag_index, 0, 0, 0); - diag_rank = hypre_StructStencilElementRank(stencil, diag_index); + hypre_SetIndex(ustride, 1); /*---------------------------------------------------------- * Set up the compute packages *----------------------------------------------------------*/ - hypre_CreateComputeInfo(grid, stencil, &compute_info); - hypre_ComputePkgCreate(compute_info, hypre_StructVectorDataSpace(x), 1, + hypre_CreateComputeInfo(grid, ustride, stencil, &compute_info); + hypre_ComputePkgCreate(memory_location, compute_info, + hypre_StructVectorDataSpace(x), 1, grid, &compute_pkg); /*---------------------------------------------------------- @@ -109,7 +101,6 @@ hypre_RedBlackGSSetup( void *relax_vdata, (relax_data -> A) = hypre_StructMatrixRef(A); (relax_data -> x) = hypre_StructVectorRef(x); (relax_data -> b) = hypre_StructVectorRef(b); - (relax_data -> diag_rank) = diag_rank; (relax_data -> compute_pkg) = compute_pkg; return hypre_error_flag; @@ -129,9 +120,8 @@ hypre_RedBlackGS( void *relax_vdata, HYPRE_Int max_iter = (relax_data -> max_iter); HYPRE_Int zero_guess = (relax_data -> zero_guess); HYPRE_Int rb_start = (relax_data -> rb_start); - HYPRE_Int diag_rank = (relax_data -> diag_rank); hypre_ComputePkg *compute_pkg = (relax_data -> compute_pkg); - HYPRE_Int ndim = hypre_StructMatrixNDim(A); + HYPRE_Int ndim = hypre_StructMatrixNDim(A); hypre_CommHandle *comm_handle; @@ -146,12 +136,13 @@ hypre_RedBlackGS( void *relax_vdata, HYPRE_Int 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 *Ap0, *Ap1, *Ap2, *Ap3, *Ap4, *Ap5; - HYPRE_Real *bp; - HYPRE_Real *xp; + HYPRE_Real *Ap = NULL; + HYPRE_Real *Ap0 = NULL, *Ap1 = NULL, *Ap2 = NULL; + HYPRE_Real *Ap3 = NULL, *Ap4 = NULL, *Ap5 = NULL; + HYPRE_Real *bp, *xp; hypre_IndexRef start; hypre_Index loop_size; @@ -159,6 +150,7 @@ hypre_RedBlackGS( void *relax_vdata, hypre_StructStencil *stencil; hypre_Index *stencil_shape; HYPRE_Int stencil_size; + HYPRE_Int stencil_diag_entry; HYPRE_Int offd[6]; HYPRE_Int iter, rb, redblack, d; @@ -197,12 +189,13 @@ hypre_RedBlackGS( void *relax_vdata, stencil = hypre_StructMatrixStencil(A); stencil_shape = hypre_StructStencilShape(stencil); stencil_size = hypre_StructStencilSize(stencil); + stencil_diag_entry = hypre_StructStencilDiagEntry(stencil); /* get off-diag entry ranks ready */ i = 0; for (j = 0; j < stencil_size; j++) { - if (j != diag_rank) + if (j != stencil_diag_entry) { offd[i] = j; i++; @@ -244,7 +237,7 @@ hypre_RedBlackGS( void *relax_vdata, b_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(b), i); x_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(x), i); - Ap = hypre_StructMatrixBoxData(A, i, diag_rank); + Ap = hypre_StructMatrixBoxData(A, i, stencil_diag_entry); bp = hypre_StructVectorBoxData(b, i); xp = hypre_StructVectorBoxData(x, i); @@ -337,7 +330,7 @@ hypre_RedBlackGS( void *relax_vdata, b_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(b), i); x_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(x), i); - Ap = hypre_StructMatrixBoxData(A, i, diag_rank); + Ap = hypre_StructMatrixBoxData(A, i, stencil_diag_entry); bp = hypre_StructVectorBoxData(b, i); xp = hypre_StructVectorBoxData(x, i); @@ -384,14 +377,14 @@ hypre_RedBlackGS( void *relax_vdata, 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]]); - // fall through + HYPRE_FALLTHROUGH; 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]]); - // fall through + HYPRE_FALLTHROUGH; case 3: Ap1 = hypre_StructMatrixBoxData(A, i, offd[1]); diff --git a/src/struct_ls/red_black_gs.h b/src/struct_ls/red_black_gs.h index 41c4008fe5..77fcbb0391 100644 --- a/src/struct_ls/red_black_gs.h +++ b/src/struct_ls/red_black_gs.h @@ -23,8 +23,6 @@ typedef struct hypre_StructVector *b; hypre_StructVector *x; - HYPRE_Int diag_rank; - hypre_ComputePkg *compute_pkg; /* log info (always logged) */ @@ -404,7 +402,7 @@ typedef struct ii = (hypre__kk + jj + redblack) % 2;\ bi = bstart + hypre__kk*bnj*bni + jj*bni + ii;\ xi = xstart + hypre__kk*xnj*xni + jj*xni + ii;\ - for (; ii < ni; ii+=2, Ai+=2, bi+=2, xi+=2)\ + for (; ii < ni; ii+=2, bi+=2, xi+=2)\ { #define hypre_RedBlackConstantcoefLoopEnd()\ diff --git a/src/struct_ls/semi.c b/src/struct_ls/semi.c index a891eeb3a0..5cae15c166 100644 --- a/src/struct_ls/semi.c +++ b/src/struct_ls/semi.c @@ -50,6 +50,8 @@ hypre_StructInterpAssemble( hypre_StructMatrix *A, hypre_CommInfo *comm_info; hypre_CommPkg *comm_pkg; hypre_CommHandle *comm_handle; + HYPRE_Complex *data; + hypre_Index ustride; HYPRE_Int num_ghost[] = {0, 0, 0, 0, 0, 0}; HYPRE_Int i, j, s, dim; @@ -59,6 +61,8 @@ hypre_StructInterpAssemble( hypre_StructMatrix *A, return hypre_error_flag; } + hypre_SetIndex(ustride, 1); + /* set num_ghost */ dim = hypre_StructGridNDim(grid); for (j = 0; j < dim; j++) @@ -74,7 +78,7 @@ hypre_StructInterpAssemble( hypre_StructMatrix *A, /* comm_info <-- From fine grid grown by num_ghost */ - hypre_CreateCommInfoFromNumGhost(grid, num_ghost, &comm_info); + hypre_CreateCommInfoFromNumGhost(grid, ustride, num_ghost, &comm_info); /* Project and map comm_info onto coarsened index space */ @@ -118,27 +122,19 @@ hypre_StructInterpAssemble( hypre_StructMatrix *A, } } - comm_pkg = hypre_StructMatrixCommPkg(P); - if (comm_pkg) - { - hypre_CommPkgDestroy(comm_pkg); - } - hypre_CommPkgCreate(comm_info, hypre_StructMatrixDataSpace(P), hypre_StructMatrixDataSpace(P), hypre_StructMatrixNumValues(P), NULL, 0, hypre_StructMatrixComm(P), + hypre_StructMatrixMemoryLocation(P), &comm_pkg); hypre_CommInfoDestroy(comm_info); - hypre_StructMatrixCommPkg(P) = comm_pkg; - - hypre_InitializeCommunication(comm_pkg, - hypre_StructMatrixStencilData(P)[0],//hypre_StructMatrixData(P), - hypre_StructMatrixStencilData(P)[0],//hypre_StructMatrixData(P), - 0, 0, - &comm_handle); - hypre_FinalizeCommunication(comm_handle); + + data = hypre_StructMatrixVData(P); + hypre_StructCommunicationInitialize(comm_pkg, &data, &data, 0, 0, &comm_handle); + hypre_StructCommunicationFinalize(comm_handle); + hypre_CommPkgDestroy(comm_pkg); return hypre_error_flag; } diff --git a/src/struct_ls/semi_interp.c b/src/struct_ls/semi_interp.c index 114a51f0b7..efed42b3f9 100644 --- a/src/struct_ls/semi_interp.c +++ b/src/struct_ls/semi_interp.c @@ -53,6 +53,7 @@ hypre_SemiInterpSetup( void *interp_vdata, { HYPRE_UNUSED_VAR(xc); + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(P); hypre_SemiInterpData *interp_data = (hypre_SemiInterpData *)interp_vdata; hypre_StructGrid *grid; @@ -60,21 +61,25 @@ hypre_SemiInterpSetup( void *interp_vdata, hypre_ComputeInfo *compute_info; hypre_ComputePkg *compute_pkg; + hypre_Index ustride; + + HYPRE_ANNOTATE_FUNC_BEGIN; + + hypre_SetIndex(ustride, 1); /*---------------------------------------------------------- * Set up the compute package *----------------------------------------------------------*/ - HYPRE_ANNOTATE_FUNC_BEGIN; - grid = hypre_StructVectorGrid(e); stencil = hypre_StructMatrixStencil(P); - hypre_CreateComputeInfo(grid, stencil, &compute_info); + hypre_CreateComputeInfo(grid, ustride, stencil, &compute_info); hypre_ComputeInfoProjectSend(compute_info, cindex, stride); hypre_ComputeInfoProjectRecv(compute_info, cindex, stride); hypre_ComputeInfoProjectComp(compute_info, findex, stride); - hypre_ComputePkgCreate(compute_info, hypre_StructVectorDataSpace(e), 1, + hypre_ComputePkgCreate(memory_location, compute_info, + hypre_StructVectorDataSpace(e), 1, grid, &compute_pkg); /*---------------------------------------------------------- diff --git a/src/struct_ls/semi_restrict.c b/src/struct_ls/semi_restrict.c index 5bda17025a..04d787f911 100644 --- a/src/struct_ls/semi_restrict.c +++ b/src/struct_ls/semi_restrict.c @@ -53,6 +53,7 @@ hypre_SemiRestrictSetup( void *restrict_vdata, { HYPRE_UNUSED_VAR(rc); + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(R); hypre_SemiRestrictData *restrict_data = (hypre_SemiRestrictData *)restrict_vdata; hypre_StructGrid *grid; @@ -60,21 +61,25 @@ hypre_SemiRestrictSetup( void *restrict_vdata, hypre_ComputeInfo *compute_info; hypre_ComputePkg *compute_pkg; + hypre_Index ustride; + + HYPRE_ANNOTATE_FUNC_BEGIN; + + hypre_SetIndex(ustride, 1); /*---------------------------------------------------------- * Set up the compute package *----------------------------------------------------------*/ - HYPRE_ANNOTATE_FUNC_BEGIN; - grid = hypre_StructVectorGrid(r); stencil = hypre_StructMatrixStencil(R); - hypre_CreateComputeInfo(grid, stencil, &compute_info); + hypre_CreateComputeInfo(grid, ustride, stencil, &compute_info); hypre_ComputeInfoProjectSend(compute_info, findex, stride); hypre_ComputeInfoProjectRecv(compute_info, findex, stride); hypre_ComputeInfoProjectComp(compute_info, cindex, stride); - hypre_ComputePkgCreate(compute_info, hypre_StructVectorDataSpace(r), 1, + hypre_ComputePkgCreate(memory_location, compute_info, + hypre_StructVectorDataSpace(r), 1, grid, &compute_pkg); /*---------------------------------------------------------- diff --git a/src/struct_ls/semi_setup_rap.c b/src/struct_ls/semi_setup_rap.c index 3cc57c4296..88d394560d 100644 --- a/src/struct_ls/semi_setup_rap.c +++ b/src/struct_ls/semi_setup_rap.c @@ -70,7 +70,7 @@ hypre_SemiCreateRAPOp( hypre_StructMatrix *R, HYPRE_Int j, i; HYPRE_Int d; - HYPRE_Int stencil_rank; + HYPRE_Int stencil_entry; HYPRE_Int *RAP_marker; HYPRE_Int RAP_marker_size; @@ -101,7 +101,7 @@ hypre_SemiCreateRAPOp( hypre_StructMatrix *R, hypre_SetIndex(indexRA, 0); hypre_SetIndex(indexRAP, 0); - stencil_rank = 0; + stencil_entry = 0; /*----------------------------------------------------------------------- * Calculate RAP stencil by symbolic computation of triple matrix @@ -242,13 +242,13 @@ hypre_SemiCreateRAPOp( hypre_StructMatrix *R, RAP_stencil_shape = hypre_CTAlloc(hypre_Index, RAP_stencil_size, HYPRE_MEMORY_HOST); - stencil_rank = 0; + stencil_entry = 0; for (i = 0; i < RAP_marker_size; i++) { - if ( RAP_marker[i] != 0 ) + if (RAP_marker[i] != 0) { - hypre_InverseMapRAPMarker(i, RAP_stencil_shape[stencil_rank]); - stencil_rank++; + hypre_InverseMapRAPMarker(i, RAP_stencil_shape[stencil_entry]); + stencil_entry++; } } @@ -267,7 +267,7 @@ hypre_SemiCreateRAPOp( hypre_StructMatrix *R, /*----------------------------------------------------------------------- * Set number of ghost points - one one each boundary *-----------------------------------------------------------------------*/ - hypre_StructMatrixSetNumGhost(RAP, RAP_num_ghost); + HYPRE_StructMatrixSetNumGhost(RAP, RAP_num_ghost); hypre_TFree(RAP_marker, HYPRE_MEMORY_HOST); @@ -293,7 +293,7 @@ hypre_SemiBuildRAP( hypre_StructMatrix *A, hypre_StructStencil *coarse_stencil; HYPRE_Int coarse_stencil_size; hypre_Index *coarse_stencil_shape; - HYPRE_Int *coarse_symm_elements; + HYPRE_Int *coarse_symm_entries; hypre_StructGrid *fgrid; HYPRE_Int *fgrid_ids; @@ -336,7 +336,7 @@ hypre_SemiBuildRAP( hypre_StructMatrix *A, coarse_stencil = hypre_StructMatrixStencil(RAP); coarse_stencil_size = hypre_StructStencilSize(coarse_stencil); - coarse_symm_elements = hypre_StructMatrixSymmElements(RAP); + coarse_symm_entries = hypre_StructMatrixSymmEntries(RAP); coarse_stencil_shape = hypre_StructStencilShape(coarse_stencil); dim = hypre_StructStencilNDim(coarse_stencil); @@ -477,7 +477,7 @@ hypre_SemiBuildRAP( hypre_StructMatrix *A, for (RAPloop = 0; RAPloop < coarse_stencil_size; RAPloop++) { - if (coarse_symm_elements[RAPloop] == -1) + if (coarse_symm_entries[RAPloop] == -1) { rap_ptrS = hypre_StructMatrixBoxData(RAP, ci, RAPloop); #define DEVICE_VAR is_device_ptr(rap_ptrS) @@ -499,7 +499,7 @@ hypre_SemiBuildRAP( hypre_StructMatrix *A, *-----------------------------------------------------------------*/ for (RAPloop = 0; RAPloop < coarse_stencil_size; RAPloop++) { - if (coarse_symm_elements[RAPloop] == -1) + if (coarse_symm_entries[RAPloop] == -1) { /*------------------------------------------------------------- * Get pointer for A that corresponds to the current RAP index. @@ -760,7 +760,7 @@ hypre_SemiBuildRAP( hypre_StructMatrix *A, } /* end of if a_ptr != NULL */ - } /* end if coarse_symm_element == -1 */ + } /* end if coarse_symm_entry == -1 */ } /* end of RAPloop */ @@ -787,7 +787,7 @@ hypre_SemiBuildRAP( hypre_StructMatrix *A, *-------------------------------------------------------------*/ for (RAPloop = 0; RAPloop < coarse_stencil_size; RAPloop++) { - if (coarse_symm_elements[RAPloop] == -1) + if (coarse_symm_entries[RAPloop] == -1) { hypre_CopyIndex(coarse_stencil_shape[RAPloop], index); switch (hypre_IndexD(index, cdir)) @@ -851,7 +851,7 @@ hypre_SemiBuildRAP( hypre_StructMatrix *A, } /* end of switch */ - } /* end if coarse_symm_element == -1 */ + } /* end if coarse_symm_entry == -1 */ } /* end of RAPloop */ diff --git a/src/struct_ls/smg.c b/src/struct_ls/smg.c index 6f3be07dac..3e6ad2ac41 100644 --- a/src/struct_ls/smg.c +++ b/src/struct_ls/smg.c @@ -398,29 +398,40 @@ hypre_SMGGetNumIterations( void *smg_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_SMGPrintLogging( void *smg_vdata, - HYPRE_Int myid) +hypre_SMGPrintLogging( void *smg_vdata ) { - hypre_SMGData *smg_data = (hypre_SMGData *)smg_vdata; - HYPRE_Int i; - HYPRE_Int num_iterations = (smg_data -> num_iterations); - HYPRE_Int logging = (smg_data -> logging); - HYPRE_Int print_level = (smg_data -> print_level); - HYPRE_Real *norms = (smg_data -> norms); - HYPRE_Real *rel_norms = (smg_data -> rel_norms); - - - if (myid == 0) + hypre_SMGData *smg_data = (hypre_SMGData *) smg_vdata; + MPI_Comm comm = (smg_data -> comm); + HYPRE_Int num_iterations = (smg_data -> num_iterations); + HYPRE_Int max_iter = (smg_data -> max_iter); + HYPRE_Int logging = (smg_data -> logging); + HYPRE_Int print_level = (smg_data -> print_level); + HYPRE_Real *norms = (smg_data -> norms); + HYPRE_Real *rel_norms = (smg_data -> rel_norms); + + HYPRE_Int myid, i; + HYPRE_Real convr = 1.0; + HYPRE_Real avg_convr; + + hypre_MPI_Comm_rank(comm, &myid); + + if ((myid == 0) && (logging > 0) && (print_level > 0)) { - if (print_level > 0) + hypre_printf("Iters ||r||_2 conv.rate ||r||_2/||b||_2\n"); + hypre_printf("% 5d %e %f %e\n", 0, norms[0], convr, rel_norms[0]); + for (i = 1; i <= num_iterations; i++) + { + convr = norms[i] / norms[i - 1]; + hypre_printf("% 5d %e %f %e\n", i, norms[i], convr, rel_norms[i]); + } + + if (max_iter > 1) { - if (logging > 0) + if (rel_norms[0] > 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]); - } + avg_convr = pow((rel_norms[num_iterations] / rel_norms[0]), + (1.0 / (HYPRE_Real) num_iterations)); + hypre_printf("\nAverage convergence factor = %f\n", avg_convr); } } } @@ -508,20 +519,23 @@ hypre_SMGSetStructVectorConstantValues( hypre_StructVector *vector, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_StructSMGSetMaxLevel( void *smg_vdata, - HYPRE_Int max_level ) +hypre_SMGSetMaxLevel( void *smg_vdata, + HYPRE_Int max_levels ) { hypre_SMGData *smg_data = (hypre_SMGData *)smg_vdata; - (smg_data -> max_levels) = max_level; + (smg_data -> max_levels) = max_levels; return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) HYPRE_Int -hypre_StructSMGSetDeviceLevel( void *smg_vdata, - HYPRE_Int device_level ) +hypre_StructSMGSetDeviceLevel( void *smg_vdata, + HYPRE_Int device_level ) { hypre_SMGData *smg_data = (hypre_SMGData *)smg_vdata; diff --git a/src/struct_ls/smg.h b/src/struct_ls/smg.h index 4273defe29..813a633552 100644 --- a/src/struct_ls/smg.h +++ b/src/struct_ls/smg.h @@ -45,7 +45,6 @@ typedef struct HYPRE_MemoryLocation memory_location; /* memory location of data */ HYPRE_Real *data; - HYPRE_Real *data_const; hypre_StructMatrix **A_l; hypre_StructMatrix **PT_l; hypre_StructMatrix **R_l; diff --git a/src/struct_ls/smg2_setup_rap.c b/src/struct_ls/smg2_setup_rap.c index 8b4ed3a2ba..4eb5745d7f 100644 --- a/src/struct_ls/smg2_setup_rap.c +++ b/src/struct_ls/smg2_setup_rap.c @@ -31,7 +31,7 @@ hypre_SMG2CreateRAPOp( hypre_StructMatrix *R, HYPRE_Int RAP_num_ghost[] = {1, 1, 1, 1, 0, 0}; HYPRE_Int j, i; - HYPRE_Int stencil_rank; + HYPRE_Int stencil_entry; RAP_stencil_dim = 2; @@ -39,7 +39,7 @@ hypre_SMG2CreateRAPOp( hypre_StructMatrix *R, * Define RAP_stencil *-----------------------------------------------------------------------*/ - stencil_rank = 0; + stencil_entry = 0; /*----------------------------------------------------------------------- * non-symmetric case @@ -59,10 +59,10 @@ hypre_SMG2CreateRAPOp( hypre_StructMatrix *R, { /*-------------------------------------------------------------- - * Storage for 9 elements (c,w,e,n,s,sw,se,nw,se) + * Storage for 9 entries (c,w,e,n,s,sw,se,nw,se) *--------------------------------------------------------------*/ - hypre_SetIndex3(RAP_stencil_shape[stencil_rank], i, j, 0); - stencil_rank++; + hypre_SetIndex3(RAP_stencil_shape[stencil_entry], i, j, 0); + stencil_entry++; } } } @@ -88,12 +88,12 @@ hypre_SMG2CreateRAPOp( hypre_StructMatrix *R, { /*-------------------------------------------------------------- - * Store 5 elements in (c,w,s,sw,se) + * Store 5 entries in (c,w,s,sw,se) *--------------------------------------------------------------*/ - if ( i + j <= 0 ) + if (i + j <= 0) { - hypre_SetIndex3(RAP_stencil_shape[stencil_rank], i, j, 0); - stencil_rank++; + hypre_SetIndex3(RAP_stencil_shape[stencil_entry], i, j, 0); + stencil_entry++; } } } @@ -120,7 +120,7 @@ hypre_SMG2CreateRAPOp( hypre_StructMatrix *R, RAP_num_ghost[1] = 0; RAP_num_ghost[3] = 0; } - hypre_StructMatrixSetNumGhost(RAP, RAP_num_ghost); + HYPRE_StructMatrixSetNumGhost(RAP, RAP_num_ghost); return RAP; } diff --git a/src/struct_ls/smg3_setup_rap.c b/src/struct_ls/smg3_setup_rap.c index 45812162d0..812a170441 100644 --- a/src/struct_ls/smg3_setup_rap.c +++ b/src/struct_ls/smg3_setup_rap.c @@ -34,7 +34,7 @@ hypre_SMG3CreateRAPOp( hypre_StructMatrix *R, HYPRE_Int A_stencil_size; HYPRE_Int k, j, i; - HYPRE_Int stencil_rank; + HYPRE_Int stencil_entry; RAP_stencil_dim = 3; @@ -45,7 +45,7 @@ hypre_SMG3CreateRAPOp( hypre_StructMatrix *R, * Define RAP_stencil *-----------------------------------------------------------------------*/ - stencil_rank = 0; + stencil_entry = 0; /*----------------------------------------------------------------------- * non-symmetric case @@ -69,12 +69,12 @@ hypre_SMG3CreateRAPOp( hypre_StructMatrix *R, { /*-------------------------------------------------------- - * Storage for c,w,e,n,s elements in each plane + * Storage for c,w,e,n,s entries in each plane *--------------------------------------------------------*/ - if ( i * j == 0 ) + if (i * j == 0) { - hypre_SetIndex3(RAP_stencil_shape[stencil_rank], i, j, k); - stencil_rank++; + hypre_SetIndex3(RAP_stencil_shape[stencil_entry], i, j, k); + stencil_entry++; } } } @@ -96,11 +96,11 @@ hypre_SMG3CreateRAPOp( hypre_StructMatrix *R, { /*-------------------------------------------------------- - * Storage for 9 elements (c,w,e,n,s,sw,se,nw,se) in + * Storage for 9 entries (c,w,e,n,s,sw,se,nw,se) in * each plane *--------------------------------------------------------*/ - hypre_SetIndex3(RAP_stencil_shape[stencil_rank], i, j, k); - stencil_rank++; + hypre_SetIndex3(RAP_stencil_shape[stencil_entry], i, j, k); + stencil_entry++; } } } @@ -132,13 +132,13 @@ 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) + * Store 5 entries in lower plane (c,w,e,s,n) + * and 3 entries 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); - stencil_rank++; + hypre_SetIndex3(RAP_stencil_shape[stencil_entry], i, j, k); + stencil_entry++; } } } @@ -163,13 +163,13 @@ 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) + * Store 9 entries in lower plane (c,w,e,s,n,sw,se,nw,ne) + * and 5 entries 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); - stencil_rank++; + hypre_SetIndex3(RAP_stencil_shape[stencil_entry], i, j, k); + stencil_entry++; } } } @@ -198,7 +198,7 @@ hypre_SMG3CreateRAPOp( hypre_StructMatrix *R, RAP_num_ghost[3] = 0; RAP_num_ghost[5] = 0; } - hypre_StructMatrixSetNumGhost(RAP, RAP_num_ghost); + HYPRE_StructMatrixSetNumGhost(RAP, RAP_num_ghost); return RAP; } @@ -1817,8 +1817,8 @@ hypre_SMG3RAPPeriodicNoSym( hypre_StructMatrix *RAP, HYPRE_Real *rap_bc, *rap_bw, *rap_be, *rap_bs, *rap_bn; HYPRE_Real *rap_cc, *rap_cw, *rap_ce, *rap_cs, *rap_cn; HYPRE_Real *rap_ac, *rap_aw, *rap_ae, *rap_as, *rap_an; - HYPRE_Real *rap_bsw, *rap_bse, *rap_bnw, *rap_bne; - HYPRE_Real *rap_csw, *rap_cse, *rap_cnw, *rap_cne; + HYPRE_Real *rap_bsw = NULL, *rap_bse, *rap_bnw, *rap_bne; + HYPRE_Real *rap_csw = NULL, *rap_cse, *rap_cnw, *rap_cne; HYPRE_Real *rap_asw, *rap_ase, *rap_anw, *rap_ane; HYPRE_Real zero = 0.0; diff --git a/src/struct_ls/smg_relax.c b/src/struct_ls/smg_relax.c index 9fc1f27e76..cd1015f4f8 100644 --- a/src/struct_ls/smg_relax.c +++ b/src/struct_ls/smg_relax.c @@ -99,7 +99,7 @@ hypre_SMGRelaxCreate( MPI_Comm comm ) (relax_data -> num_pre_relax) = 1; (relax_data -> num_post_relax) = 1; - (relax_data -> max_level) = -1; + return (void *) relax_data; } @@ -424,7 +424,7 @@ hypre_SMGRelaxSetupTempVec( void *relax_vdata, temp_vec = hypre_StructVectorCreate(hypre_StructVectorComm(b), hypre_StructVectorGrid(b)); hypre_StructVectorSetNumGhost(temp_vec, hypre_StructVectorNumGhost(b)); - hypre_StructVectorInitialize(temp_vec); + hypre_StructVectorInitialize(temp_vec, 1); hypre_StructVectorAssemble(temp_vec); (relax_data -> temp_vec) = temp_vec; } @@ -595,14 +595,13 @@ hypre_SMGRelaxSetupASol( void *relax_vdata, hypre_SMGSetMemoryUse(solve_data[i], (relax_data -> memory_use)); hypre_SMGSetTol(solve_data[i], 0.0); hypre_SMGSetMaxIter(solve_data[i], 1); - hypre_StructSMGSetMaxLevel(solve_data[i], (relax_data -> max_level)); + hypre_SMGSetMaxLevel(solve_data[i], (relax_data -> max_level)); hypre_SMGSetup(solve_data[i], A_sol, temp_vec, x); } else { solve_data[i] = hypre_CyclicReductionCreate(relax_data -> comm); hypre_CyclicReductionSetBase(solve_data[i], base_index, base_stride); - //hypre_CyclicReductionSetMaxLevel(solve_data[i], -1);//(relax_data -> max_level)+10); hypre_CyclicReductionSetup(solve_data[i], A_sol, temp_vec, x); } } @@ -938,7 +937,7 @@ hypre_SMGRelaxSetupBaseBoxArray( void *relax_vdata, grid = hypre_StructVectorGrid(x); boxes = hypre_StructGridBoxes(grid); - base_box_array = hypre_BoxArrayDuplicate(boxes); + base_box_array = hypre_BoxArrayClone(boxes); hypre_ProjectBoxArray(base_box_array, (relax_data -> base_index), (relax_data -> base_stride)); @@ -952,8 +951,8 @@ hypre_SMGRelaxSetupBaseBoxArray( void *relax_vdata, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_SMGRelaxSetMaxLevel( void *relax_vdata, - HYPRE_Int num_max_level ) +hypre_SMGRelaxSetMaxLevel( void *relax_vdata, + HYPRE_Int num_max_level ) { hypre_SMGRelaxData *relax_data = (hypre_SMGRelaxData *)relax_vdata; diff --git a/src/struct_ls/smg_residual.c b/src/struct_ls/smg_residual.c index 2a51cb33d8..441b6b9c1b 100644 --- a/src/struct_ls/smg_residual.c +++ b/src/struct_ls/smg_residual.c @@ -57,6 +57,7 @@ hypre_SMGResidualSetup( void *residual_vdata, hypre_StructVector *b, hypre_StructVector *r ) { + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(A); hypre_SMGResidualData *residual_data = (hypre_SMGResidualData *)residual_vdata; hypre_IndexRef base_index = (residual_data -> base_index); @@ -68,6 +69,9 @@ hypre_SMGResidualSetup( void *residual_vdata, hypre_BoxArray *base_points; hypre_ComputeInfo *compute_info; hypre_ComputePkg *compute_pkg; + hypre_Index ustride; + + hypre_SetIndex(ustride, 1); /*---------------------------------------------------------- * Set up base points and the compute package @@ -76,12 +80,13 @@ hypre_SMGResidualSetup( void *residual_vdata, grid = hypre_StructMatrixGrid(A); stencil = hypre_StructMatrixStencil(A); - base_points = hypre_BoxArrayDuplicate(hypre_StructGridBoxes(grid)); + base_points = hypre_BoxArrayClone(hypre_StructGridBoxes(grid)); hypre_ProjectBoxArray(base_points, base_index, base_stride); - hypre_CreateComputeInfo(grid, stencil, &compute_info); + hypre_CreateComputeInfo(grid, ustride, stencil, &compute_info); hypre_ComputeInfoProjectComp(compute_info, base_index, base_stride); - hypre_ComputePkgCreate(compute_info, hypre_StructVectorDataSpace(x), 1, + hypre_ComputePkgCreate(memory_location, compute_info, + hypre_StructVectorDataSpace(x), 1, grid, &compute_pkg); /*---------------------------------------------------------- @@ -305,4 +310,3 @@ hypre_SMGResidualDestroy( void *residual_vdata ) return hypre_error_flag; } - diff --git a/src/struct_ls/smg_residual_unrolled.c b/src/struct_ls/smg_residual_unrolled.c index 6e4682461c..94728bee35 100644 --- a/src/struct_ls/smg_residual_unrolled.c +++ b/src/struct_ls/smg_residual_unrolled.c @@ -65,7 +65,6 @@ hypre_SMGResidualSetup( void *residual_vdata, hypre_IndexRef base_index = (residual_data -> base_index); hypre_IndexRef base_stride = (residual_data -> base_stride); - hypre_Index unit_stride; hypre_StructGrid *grid; hypre_StructStencil *stencil; @@ -73,6 +72,9 @@ hypre_SMGResidualSetup( void *residual_vdata, hypre_BoxArray *base_points; hypre_ComputeInfo *compute_info; hypre_ComputePkg *compute_pkg; + hypre_Index ustride; + + hypre_SetIndex(ustride, 1); /*---------------------------------------------------------- * Set up base points and the compute package @@ -81,12 +83,12 @@ hypre_SMGResidualSetup( void *residual_vdata, grid = hypre_StructMatrixGrid(A); stencil = hypre_StructMatrixStencil(A); - hypre_SetIndex3(unit_stride, 1, 1, 1); + hypre_SetIndex3(ustride, 1, 1, 1); - base_points = hypre_BoxArrayDuplicate(hypre_StructGridBoxes(grid)); + base_points = hypre_BoxArrayClone(hypre_StructGridBoxes(grid)); hypre_ProjectBoxArray(base_points, base_index, base_stride); - hypre_CreateComputeInfo(grid, stencil, &compute_info); + hypre_CreateComputeInfo(grid, ustride, stencil, &compute_info); hypre_ComputeInfoProjectComp(compute_info, base_index, base_stride); hypre_ComputePkgCreate(compute_info, hypre_StructVectorDataSpace(x), 1, grid, &compute_pkg); diff --git a/src/struct_ls/smg_setup.c b/src/struct_ls/smg_setup.c index 20bd11bcfc..f5c3568ca4 100644 --- a/src/struct_ls/smg_setup.c +++ b/src/struct_ls/smg_setup.c @@ -9,6 +9,9 @@ #include "smg.h" #define DEBUG 0 +#if DEBUG +static HYPRE_Int static_print_debug = 0; +#endif /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -45,10 +48,7 @@ hypre_SMGSetup( void *smg_vdata, hypre_StructGrid **PT_grid_l; HYPRE_Real *data; - HYPRE_Real *data_const; HYPRE_Int data_size = 0; - HYPRE_Int data_size_const = 0; - hypre_StructMatrix **A_l; hypre_StructMatrix **PT_l; hypre_StructMatrix **R_l; @@ -79,6 +79,7 @@ hypre_SMGSetup( void *smg_vdata, #if DEBUG char filename[255]; + HYPRE_Int print_debug = static_print_debug++; #endif HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(A); @@ -99,7 +100,7 @@ hypre_SMGSetup( void *smg_vdata, grid = hypre_StructMatrixGrid(A); /* Compute a new max_levels value based on the grid */ - cbox = hypre_BoxDuplicate(hypre_StructGridBoundingBox(grid)); + cbox = hypre_BoxClone(hypre_StructGridBoundingBox(grid)); max_levels = hypre_Log2(hypre_BoxSizeD(cbox, cdir)) + 2; if ((smg_data -> max_levels) > 0) { @@ -152,8 +153,15 @@ hypre_SMGSetup( void *smg_vdata, /* build the interpolation grid */ hypre_StructCoarsen(grid_l[l], cindex, stride, 0, &PT_grid_l[l + 1]); + /* assemble the interpolation grid */ + hypre_StructGridAssemble(PT_grid_l[l + 1]); + /* build the coarse grid */ hypre_StructCoarsen(grid_l[l], cindex, stride, 1, &grid_l[l + 1]); + + /* assemble the interpolation grid */ + hypre_StructGridAssemble(grid_l[l + 1]); + #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) hypre_StructGridDataLocation(PT_grid_l[l + 1]) = data_location; if (device_level == -1 && num_level_GPU > 0) @@ -212,20 +220,18 @@ hypre_SMGSetup( void *smg_vdata, tb_l[0] = hypre_StructVectorCreate(comm, grid_l[0]); hypre_StructVectorSetNumGhost(tb_l[0], hypre_StructVectorNumGhost(b)); hypre_StructVectorInitializeShell(tb_l[0]); - hypre_StructVectorSetDataSize(tb_l[0], &data_size, &data_size_const); + data_size += hypre_StructVectorDataSize(tb_l[0]); tx_l[0] = hypre_StructVectorCreate(comm, grid_l[0]); hypre_StructVectorSetNumGhost(tx_l[0], hypre_StructVectorNumGhost(x)); hypre_StructVectorInitializeShell(tx_l[0]); - hypre_StructVectorSetDataSize(tx_l[0], &data_size, &data_size_const); + data_size += hypre_StructVectorDataSize(tx_l[0]); 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]); - data_size_const += hypre_StructMatrixDataConstSize(PT_l[l]); if (hypre_StructMatrixSymmetric(A)) { @@ -240,24 +246,22 @@ hypre_SMGSetup( void *smg_vdata, 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]); 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); + data_size += hypre_StructVectorDataSize(b_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); + data_size += hypre_StructVectorDataSize(x_l[l + 1]); tb_l[l + 1] = hypre_StructVectorCreate(comm, grid_l[l + 1]); hypre_StructVectorSetNumGhost(tb_l[l + 1], hypre_StructVectorNumGhost(b)); @@ -276,11 +280,9 @@ hypre_SMGSetup( void *smg_vdata, } 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; #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) //if (hypre_StructGridNDim(grid) == hypre_StructStencilNDim(hypre_StructMatrixStencil(A))) @@ -315,83 +317,23 @@ hypre_SMGSetup( void *smg_vdata, hypre_StructVectorAssemble(tx_l[0]); data += hypre_StructVectorDataSize(tx_l[0]); #endif + for (l = 0; l < (num_levels - 1); l++) { - hypre_StructMatrixInitializeData(PT_l[l], data, data_const); + hypre_StructMatrixInitializeData(PT_l[l], 1, data); data += hypre_StructMatrixDataSize(PT_l[l]); - data_const += hypre_StructMatrixDataConstSize(PT_l[l]); #if 0 /* Allow R != PT for non symmetric case */ if (!hypre_StructMatrixSymmetric(A)) { - hypre_StructMatrixInitializeData(R_l[l], data, data_const); + hypre_StructMatrixInitializeData(R_l[l], 1, data); data += hypre_StructMatrixDataSize(R_l[l]); - data_const += hypre_StructMatrixDataConstSize(R_l[l]); } #endif -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - if (l + 1 == num_level_GPU) - { - data_location = HYPRE_MEMORY_HOST; - } -#endif - - hypre_StructMatrixInitializeData(A_l[l + 1], data, data_const); + hypre_StructMatrixInitializeData(A_l[l + 1], 1, data); 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]); - //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(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(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]); @@ -408,7 +350,6 @@ hypre_SMGSetup( void *smg_vdata, hypre_StructVectorInitializeData(tx_l[l + 1], hypre_StructVectorData(tx_l[0])); hypre_StructVectorAssemble(tx_l[l + 1]); -#endif } (smg_data -> A_l) = A_l; @@ -476,7 +417,6 @@ hypre_SMGSetup( void *smg_vdata, hypre_SMGRelaxSetTempVec(relax_data_l[l], tb_l[l]); hypre_SMGRelaxSetNumPreRelax( relax_data_l[l], n_pre); hypre_SMGRelaxSetNumPostRelax( relax_data_l[l], n_post); - //hypre_SMGRelaxSetMaxLevel( relax_data_l[l], l+6); hypre_SMGRelaxSetup(relax_data_l[l], A_l[l], b_l[l], x_l[l]); hypre_SMGSetupInterpOp(relax_data_l[l], A_l[l], b_l[l], x_l[l], @@ -505,6 +445,7 @@ hypre_SMGSetup( void *smg_vdata, hypre_SMGSetupRestrictOp(A_l[l], R_l[l], tx_l[l], cdir, cindex, stride); #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], @@ -567,17 +508,19 @@ hypre_SMGSetup( void *smg_vdata, } #if DEBUG - if (hypre_StructGridNDim(grid_l[0]) == 3) + if (print_debug == 0) { for (l = 0; l < (num_levels - 1); l++) { - hypre_sprintf(filename, "zout_A.%02d", l); + hypre_sprintf(filename, "smg_A.%02d", l); hypre_StructMatrixPrint(filename, A_l[l], 0); - hypre_sprintf(filename, "zout_PT.%02d", l); + hypre_sprintf(filename, "smg_PT.%02d", l); hypre_StructMatrixPrint(filename, PT_l[l], 0); } - hypre_sprintf(filename, "zout_A.%02d", l); + hypre_sprintf(filename, "smg_A.%02d", l); hypre_StructMatrixPrint(filename, A_l[l], 0); + + print_debug = 0; } #endif diff --git a/src/struct_ls/smg_setup_interp.c b/src/struct_ls/smg_setup_interp.c index a377daa33b..49826f57b7 100644 --- a/src/struct_ls/smg_setup_interp.c +++ b/src/struct_ls/smg_setup_interp.c @@ -43,7 +43,7 @@ hypre_SMGCreateInterpOp( hypre_StructMatrix *A, /* set up matrix */ PT = hypre_StructMatrixCreate(hypre_StructMatrixComm(A), cgrid, stencil); - hypre_StructMatrixSetNumGhost(PT, num_ghost); + HYPRE_StructMatrixSetNumGhost(PT, num_ghost); hypre_StructStencilDestroy(stencil); @@ -78,6 +78,8 @@ hypre_SMGSetupInterpOp( void *relax_data, hypre_Index findex, hypre_Index stride ) { + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(A); + hypre_StructMatrix *A_mask; hypre_StructStencil *A_stencil; @@ -98,6 +100,7 @@ hypre_SMGSetupInterpOp( void *relax_data, HYPRE_Int compute_pkg_stencil_dim = 1; hypre_ComputePkg *compute_pkg; hypre_ComputeInfo *compute_info; + hypre_Index ustride; hypre_CommHandle *comm_handle; @@ -118,6 +121,8 @@ hypre_SMGSetupInterpOp( void *relax_data, HYPRE_Int si, sj, d; HYPRE_Int compute_i, i, j; + hypre_SetIndex(ustride, 1); + /*-------------------------------------------------------- * Initialize some things *--------------------------------------------------------*/ @@ -193,11 +198,12 @@ hypre_SMGSetupInterpOp( void *relax_data, *-----------------------------------------------------*/ hypre_CopyIndex(PT_stencil_shape[si], compute_pkg_stencil_shape[0]); - hypre_CreateComputeInfo(fgrid, compute_pkg_stencil, &compute_info); + hypre_CreateComputeInfo(fgrid, ustride, compute_pkg_stencil, &compute_info); hypre_ComputeInfoProjectSend(compute_info, findex, stride); hypre_ComputeInfoProjectRecv(compute_info, findex, stride); hypre_ComputeInfoProjectComp(compute_info, cindex, stride); - hypre_ComputePkgCreate(compute_info, hypre_StructVectorDataSpace(x), 1, + hypre_ComputePkgCreate(memory_location, compute_info, + hypre_StructVectorDataSpace(x), 1, fgrid, &compute_pkg); /*----------------------------------------------------- @@ -287,4 +293,3 @@ hypre_SMGSetupInterpOp( void *relax_data, return hypre_error_flag; } - diff --git a/src/struct_ls/smg_setup_rap.c b/src/struct_ls/smg_setup_rap.c index f9439e0a58..e53054254a 100644 --- a/src/struct_ls/smg_setup_rap.c +++ b/src/struct_ls/smg_setup_rap.c @@ -84,10 +84,11 @@ hypre_SMGSetupRAPOp( hypre_StructMatrix *R, #endif hypre_StructStencil *stencil; - hypre_StructMatrix *Ac_tmp; #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - HYPRE_MemoryLocation data_location_A = hypre_StructGridDataLocation(hypre_StructMatrixGrid(A)); - HYPRE_MemoryLocation data_location_Ac = hypre_StructGridDataLocation(hypre_StructMatrixGrid(Ac)); + hypre_StructMatrix *Ac_tmp; + HYPRE_MemoryLocation data_location_A = hypre_StructGridDataLocation(hypre_StructMatrixGrid(A)); + HYPRE_MemoryLocation data_location_Ac = hypre_StructGridDataLocation(hypre_StructMatrixGrid(Ac)); + if (data_location_A != data_location_Ac) { Ac_tmp = hypre_SMGCreateRAPOp(R, A, PT, hypre_StructMatrixGrid(Ac)); @@ -100,8 +101,6 @@ hypre_SMGSetupRAPOp( hypre_StructMatrix *R, { Ac_tmp = Ac; } -#else - Ac_tmp = Ac; #endif stencil = hypre_StructMatrixStencil(A); @@ -114,25 +113,25 @@ hypre_SMGSetupRAPOp( hypre_StructMatrix *R, /*-------------------------------------------------------------------- * Set lower triangular (+ diagonal) coefficients *--------------------------------------------------------------------*/ - hypre_SMG2BuildRAPSym(A, PT, R, Ac_tmp, cindex, cstride); + hypre_SMG2BuildRAPSym(A, PT, R, Ac, cindex, cstride); /*-------------------------------------------------------------------- * For non-symmetric A, set upper triangular coefficients as well *--------------------------------------------------------------------*/ if (!hypre_StructMatrixSymmetric(A)) { - hypre_SMG2BuildRAPNoSym(A, PT, R, Ac_tmp, cindex, cstride); + hypre_SMG2BuildRAPNoSym(A, PT, R, Ac, cindex, cstride); /*----------------------------------------------------------------- * Collapse stencil for periodic probems on coarsest grid. *-----------------------------------------------------------------*/ - hypre_SMG2RAPPeriodicNoSym(Ac_tmp, cindex, cstride); + hypre_SMG2RAPPeriodicNoSym(Ac, cindex, cstride); } else { /*----------------------------------------------------------------- * Collapse stencil for periodic problems on coarsest grid. *-----------------------------------------------------------------*/ - hypre_SMG2RAPPeriodicSym(Ac_tmp, cindex, cstride); + hypre_SMG2RAPPeriodicSym(Ac, cindex, cstride); } break; @@ -142,25 +141,25 @@ hypre_SMGSetupRAPOp( hypre_StructMatrix *R, /*-------------------------------------------------------------------- * Set lower triangular (+ diagonal) coefficients *--------------------------------------------------------------------*/ - hypre_SMG3BuildRAPSym(A, PT, R, Ac_tmp, cindex, cstride); + hypre_SMG3BuildRAPSym(A, PT, R, Ac, cindex, cstride); /*-------------------------------------------------------------------- * For non-symmetric A, set upper triangular coefficients as well *--------------------------------------------------------------------*/ if (!hypre_StructMatrixSymmetric(A)) { - hypre_SMG3BuildRAPNoSym(A, PT, R, Ac_tmp, cindex, cstride); + hypre_SMG3BuildRAPNoSym(A, PT, R, Ac, cindex, cstride); /*----------------------------------------------------------------- * Collapse stencil for periodic probems on coarsest grid. *-----------------------------------------------------------------*/ - hypre_SMG3RAPPeriodicNoSym(Ac_tmp, cindex, cstride); + hypre_SMG3RAPPeriodicNoSym(Ac, cindex, cstride); } else { /*----------------------------------------------------------------- * Collapse stencil for periodic problems on coarsest grid. *-----------------------------------------------------------------*/ - hypre_SMG3RAPPeriodicSym(Ac_tmp, cindex, cstride); + hypre_SMG3RAPPeriodicSym(Ac, cindex, cstride); } break; @@ -175,19 +174,19 @@ hypre_SMGSetupRAPOp( hypre_StructMatrix *R, case 2: cdir = 1; hypre_SemiBuildRAP(A, PT, R, cdir, cindex, cstride, - P_stored_as_transpose, Ac_tmp); + P_stored_as_transpose, Ac); break; case 3: cdir = 2; hypre_SemiBuildRAP(A, PT, R, cdir, cindex, cstride, - P_stored_as_transpose, Ac_tmp); + P_stored_as_transpose, Ac); break; } #endif - hypre_StructMatrixAssemble(Ac_tmp); + hypre_StructMatrixAssemble(Ac); #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) if (data_location_A != data_location_Ac) @@ -202,5 +201,6 @@ hypre_SMGSetupRAPOp( hypre_StructMatrix *R, hypre_StructMatrixDestroy(Ac_tmp); } #endif + return hypre_error_flag; } diff --git a/src/struct_ls/smg_solve.c b/src/struct_ls/smg_solve.c index b8d19a9628..37a931be19 100644 --- a/src/struct_ls/smg_solve.c +++ b/src/struct_ls/smg_solve.c @@ -49,7 +49,7 @@ hypre_SMGSolve( void *smg_vdata, hypre_StructVector *x ) { - hypre_SMGData *smg_data = (hypre_SMGData *)smg_vdata; + hypre_SMGData *smg_data = (hypre_SMGData *) smg_vdata; HYPRE_Real tol = (smg_data -> tol); HYPRE_Int max_iter = (smg_data -> max_iter); @@ -263,7 +263,8 @@ hypre_SMGSolve( void *smg_vdata, { /* 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_StructAxpy(1.0, e_l[l], x_l[l]); + hypre_StructVectorAxpy(1.0, e_l[l], 1.0, x_l[l], x_l[l]); + #if DEBUG if (hypre_StructStencilNDim(hypre_StructMatrixStencil(A)) == 3) { @@ -324,6 +325,7 @@ hypre_SMGSolve( void *smg_vdata, } hypre_EndTiming(smg_data -> time_index); + hypre_SMGPrintLogging(smg_vdata); HYPRE_ANNOTATE_FUNC_END; return hypre_error_flag; diff --git a/src/struct_ls/sparse_msg.c b/src/struct_ls/sparse_msg.c deleted file mode 100644 index 5e978920d6..0000000000 --- a/src/struct_ls/sparse_msg.c +++ /dev/null @@ -1,433 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_ls.h" -#include "sparse_msg.h" - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGCreate - *--------------------------------------------------------------------------*/ - -void * -hypre_SparseMSGCreate( MPI_Comm comm ) -{ - hypre_SparseMSGData *smsg_data; - - smsg_data = hypre_CTAlloc(hypre_SparseMSGData, 1, HYPRE_MEMORY_HOST); - - (smsg_data -> comm) = comm; - (smsg_data -> time_index) = hypre_InitializeTiming("SparseMSG"); - - /* set defaults */ - (smsg_data -> tol) = 1.0e-06; - (smsg_data -> max_iter) = 200; - (smsg_data -> rel_change) = 0; - (smsg_data -> zero_guess) = 0; - (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 -> num_pre_relax) = 1; - (smsg_data -> num_post_relax) = 1; - (smsg_data -> num_fine_relax) = 1; - (smsg_data -> logging) = 0; - (smsg_data -> print_level) = 0; - - /* initialize */ - (smsg_data -> num_grids[0]) = 1; - (smsg_data -> num_grids[1]) = 1; - (smsg_data -> num_grids[2]) = 1; - - (smsg_data -> memory_location) = hypre_HandleMemoryLocation(hypre_handle()); - - return (void *) smsg_data; -} - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGDestroy - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_SparseMSGDestroy( void *smsg_vdata ) -{ - HYPRE_Int ierr = 0; - - /* RDF */ -#if 0 - hypre_SparseMSGData *smsg_data = smsg_vdata; - - HYPRE_Int fi, l; - - if (smsg_data) - { - if ((smsg_data -> logging) > 0) - { - hypre_TFree(smsg_data -> norms, HYPRE_MEMORY_HOST); - hypre_TFree(smsg_data -> rel_norms, HYPRE_MEMORY_HOST); - } - - if ((smsg_data -> num_levels) > 1) - { - for (fi = 0; fi < (smsg_data -> num_all_grids); fi++) - { - hypre_PFMGRelaxDestroy(smsg_data -> relax_array[fi]); - hypre_StructMatvecDestroy(smsg_data -> matvec_array[fi]); - hypre_SemiRestrictDestroy(smsg_data -> restrictx_array[fi]); - hypre_SemiRestrictDestroy(smsg_data -> restricty_array[fi]); - hypre_SemiRestrictDestroy(smsg_data -> restrictz_array[fi]); - hypre_SemiInterpDestroy(smsg_data -> interpx_array[fi]); - hypre_SemiInterpDestroy(smsg_data -> interpy_array[fi]); - hypre_SemiInterpDestroy(smsg_data -> interpz_array[fi]); - hypre_StructMatrixDestroy(smsg_data -> A_array[fi]); - hypre_StructVectorDestroy(smsg_data -> b_array[fi]); - hypre_StructVectorDestroy(smsg_data -> x_array[fi]); - hypre_StructVectorDestroy(smsg_data -> t_array[fi]); - hypre_StructVectorDestroy(smsg_data -> r_array[fi]); - hypre_StructVectorDestroy(smsg_data -> visitx_array[fi]); - hypre_StructVectorDestroy(smsg_data -> visity_array[fi]); - hypre_StructVectorDestroy(smsg_data -> visitz_array[fi]); - hypre_StructGridDestroy(smsg_data -> grid_array[fi]); - } - - 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]); - } - 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]); - } - 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_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); - hypre_TFree(smsg_data -> restrictx_array, HYPRE_MEMORY_HOST); - hypre_TFree(smsg_data -> restricty_array, HYPRE_MEMORY_HOST); - hypre_TFree(smsg_data -> restrictz_array, HYPRE_MEMORY_HOST); - hypre_TFree(smsg_data -> interpx_array, HYPRE_MEMORY_HOST); - hypre_TFree(smsg_data -> interpy_array, HYPRE_MEMORY_HOST); - hypre_TFree(smsg_data -> interpz_array, HYPRE_MEMORY_HOST); - hypre_TFree(smsg_data -> A_array, HYPRE_MEMORY_HOST); - hypre_TFree(smsg_data -> Px_array, HYPRE_MEMORY_HOST); - hypre_TFree(smsg_data -> Py_array, HYPRE_MEMORY_HOST); - hypre_TFree(smsg_data -> Pz_array, HYPRE_MEMORY_HOST); - hypre_TFree(smsg_data -> RTx_array, HYPRE_MEMORY_HOST); - hypre_TFree(smsg_data -> RTy_array, HYPRE_MEMORY_HOST); - hypre_TFree(smsg_data -> RTz_array, HYPRE_MEMORY_HOST); - hypre_TFree(smsg_data -> b_array, HYPRE_MEMORY_HOST); - hypre_TFree(smsg_data -> x_array, HYPRE_MEMORY_HOST); - hypre_TFree(smsg_data -> t_array, HYPRE_MEMORY_HOST); - hypre_TFree(smsg_data -> r_array, HYPRE_MEMORY_HOST); - hypre_TFree(smsg_data -> grid_array, HYPRE_MEMORY_HOST); - hypre_TFree(smsg_data -> Px_grid_array, HYPRE_MEMORY_HOST); - 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 */ - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGSetTol - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_SparseMSGSetTol( void *smsg_vdata, - HYPRE_Real tol ) -{ - hypre_SparseMSGData *smsg_data = (hypre_SparseMSGData *)smsg_vdata; - HYPRE_Int ierr = 0; - - (smsg_data -> tol) = tol; - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGSetMaxIter - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_SparseMSGSetMaxIter( void *smsg_vdata, - HYPRE_Int max_iter ) -{ - hypre_SparseMSGData *smsg_data = (hypre_SparseMSGData *)smsg_vdata; - HYPRE_Int ierr = 0; - - (smsg_data -> max_iter) = max_iter; - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGSetJump - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_SparseMSGSetJump( void *smsg_vdata, - HYPRE_Int jump ) - -{ - hypre_SparseMSGData *smsg_data = (hypre_SparseMSGData *)smsg_vdata; - HYPRE_Int ierr = 0; - - (smsg_data -> jump) = jump; - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGSetRelChange - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_SparseMSGSetRelChange( void *smsg_vdata, - HYPRE_Int rel_change ) -{ - 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; -} - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGSetRelaxType - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_SparseMSGSetRelaxType( void *smsg_vdata, - HYPRE_Int relax_type ) -{ - hypre_SparseMSGData *smsg_data = (hypre_SparseMSGData *)smsg_vdata; - HYPRE_Int ierr = 0; - - (smsg_data -> relax_type) = relax_type; - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGSetJacobiWeight - *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_SparseMSGSetJacobiWeight( void *smsg_vdata, - HYPRE_Real weight ) -{ - hypre_SparseMSGData *smsg_data = (hypre_SparseMSGData *)smsg_vdata; - - (smsg_data -> jacobi_weight) = weight; - (smsg_data -> usr_jacobi_weight) = 1; - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGSetNumPreRelax - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_SparseMSGSetNumPreRelax( void *smsg_vdata, - HYPRE_Int num_pre_relax ) -{ - hypre_SparseMSGData *smsg_data = (hypre_SparseMSGData *)smsg_vdata; - HYPRE_Int ierr = 0; - - (smsg_data -> num_pre_relax) = num_pre_relax; - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGSetNumPostRelax - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_SparseMSGSetNumPostRelax( void *smsg_vdata, - HYPRE_Int num_post_relax ) -{ - hypre_SparseMSGData *smsg_data = (hypre_SparseMSGData *)smsg_vdata; - HYPRE_Int ierr = 0; - - (smsg_data -> num_post_relax) = num_post_relax; - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGSetNumFineRelax - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_SparseMSGSetNumFineRelax( void *smsg_vdata, - HYPRE_Int num_fine_relax ) -{ - hypre_SparseMSGData *smsg_data = (hypre_SparseMSGData *)smsg_vdata; - HYPRE_Int ierr = 0; - - (smsg_data -> num_fine_relax) = num_fine_relax; - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGSetLogging - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_SparseMSGSetLogging( void *smsg_vdata, - HYPRE_Int logging ) -{ - hypre_SparseMSGData *smsg_data = (hypre_SparseMSGData *)smsg_vdata; - HYPRE_Int ierr = 0; - - (smsg_data -> logging) = logging; - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGSetPrintLevel - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_SparseMSGSetPrintLevel( void *smsg_vdata, - HYPRE_Int print_level ) -{ - hypre_SparseMSGData *smsg_data = (hypre_SparseMSGData *)smsg_vdata; - HYPRE_Int ierr = 0; - - (smsg_data -> print_level) = print_level; - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGGetNumIterations - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_SparseMSGGetNumIterations( void *smsg_vdata, - HYPRE_Int *num_iterations ) -{ - hypre_SparseMSGData *smsg_data = (hypre_SparseMSGData *)smsg_vdata; - HYPRE_Int ierr = 0; - - *num_iterations = (smsg_data -> num_iterations); - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGPrintLogging - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_SparseMSGPrintLogging( void *smsg_vdata, - HYPRE_Int myid ) -{ - hypre_SparseMSGData *smsg_data = (hypre_SparseMSGData *)smsg_vdata; - HYPRE_Int ierr = 0; - HYPRE_Int i; - HYPRE_Int num_iterations = (smsg_data -> num_iterations); - HYPRE_Int logging = (smsg_data -> logging); - HYPRE_Int print_level = (smsg_data -> print_level); - HYPRE_Real *norms = (smsg_data -> norms); - HYPRE_Real *rel_norms = (smsg_data -> rel_norms); - - 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]); - } - } - } - } - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGGetFinalRelativeResidualNorm - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_SparseMSGGetFinalRelativeResidualNorm( void *smsg_vdata, - HYPRE_Real *relative_residual_norm ) -{ - hypre_SparseMSGData *smsg_data = (hypre_SparseMSGData *)smsg_vdata; - - HYPRE_Int max_iter = (smsg_data -> max_iter); - 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) - { - ierr = 1; - } - else if (num_iterations == max_iter) - { - *relative_residual_norm = rel_norms[num_iterations - 1]; - } - else - { - *relative_residual_norm = rel_norms[num_iterations]; - } - } - - return ierr; -} diff --git a/src/struct_ls/sparse_msg.h b/src/struct_ls/sparse_msg.h deleted file mode 100644 index c54ca289b1..0000000000 --- a/src/struct_ls/sparse_msg.h +++ /dev/null @@ -1,98 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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 SparseMSG solver - * - *****************************************************************************/ - -#ifndef hypre_SparseMSG_HEADER -#define hypre_SparseMSG_HEADER - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGData: - *--------------------------------------------------------------------------*/ - -typedef struct -{ - MPI_Comm comm; - - HYPRE_Real tol; - HYPRE_Int max_iter; - HYPRE_Int rel_change; - HYPRE_Int zero_guess; - HYPRE_Int jump; - - 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 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_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; - hypre_StructMatrix **Py_array; - hypre_StructMatrix **Pz_array; - hypre_StructMatrix **RTx_array; - hypre_StructMatrix **RTy_array; - hypre_StructMatrix **RTz_array; - hypre_StructVector **b_array; - hypre_StructVector **x_array; - - /* temp vectors */ - hypre_StructVector **t_array; - hypre_StructVector **r_array; - hypre_StructVector **e_array; - - hypre_StructVector **visitx_array; - hypre_StructVector **visity_array; - hypre_StructVector **visitz_array; - HYPRE_Int *grid_on; - - void **relax_array; - void **matvec_array; - void **restrictx_array; - void **restricty_array; - void **restrictz_array; - void **interpx_array; - void **interpy_array; - void **interpz_array; - - /* log info (always logged) */ - HYPRE_Int num_iterations; - HYPRE_Int time_index; - HYPRE_Int print_level; - - /* additional log info (logged when `logging' > 0) */ - HYPRE_Int logging; - HYPRE_Real *norms; - HYPRE_Real *rel_norms; - -} hypre_SparseMSGData; - -/*-------------------------------------------------------------------------- - * Utility routines: - *--------------------------------------------------------------------------*/ - -#define hypre_SparseMSGMapIndex(lx, ly, lz, nl, index) \ -index = (lx) + ((ly) * nl[0]) + ((lz) * nl[0] * nl[1]) - -#endif diff --git a/src/struct_ls/sparse_msg2_setup_rap.c b/src/struct_ls/sparse_msg2_setup_rap.c deleted file mode 100644 index a247a2bc36..0000000000 --- a/src/struct_ls/sparse_msg2_setup_rap.c +++ /dev/null @@ -1,804 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_ls.h" -#include "_hypre_struct_mv.hpp" - -/*-------------------------------------------------------------------------- - * Macro to "change coordinates". This routine is written as though - * coarsening is being done in the y-direction. This macro is used to - * allow for coarsening to be done in the x-direction also. - *--------------------------------------------------------------------------*/ - -#define MapIndex(in_index, cdir, out_index) \ - hypre_IndexD(out_index, 2) = hypre_IndexD(in_index, 2); \ - hypre_IndexD(out_index, cdir) = hypre_IndexD(in_index, 1); \ - cdir = (cdir + 1) % 2; \ - hypre_IndexD(out_index, cdir) = hypre_IndexD(in_index, 0); \ - cdir = (cdir + 1) % 2; - -/*-------------------------------------------------------------------------- - * hypre_SparseMSG2CreateRAPOp - * Sets up new coarse grid operator stucture. - *--------------------------------------------------------------------------*/ - -hypre_StructMatrix * -hypre_SparseMSG2CreateRAPOp( hypre_StructMatrix *R, - hypre_StructMatrix *A, - hypre_StructMatrix *P, - hypre_StructGrid *coarse_grid, - HYPRE_Int cdir ) -{ - HYPRE_UNUSED_VAR(R); - HYPRE_UNUSED_VAR(P); - - hypre_StructMatrix *RAP; - - hypre_Index *RAP_stencil_shape; - hypre_StructStencil *RAP_stencil; - HYPRE_Int RAP_stencil_size; - HYPRE_Int RAP_stencil_dim; - HYPRE_Int RAP_num_ghost[] = {1, 1, 1, 1, 1, 1}; - - hypre_Index index_temp; - HYPRE_Int j, i; - HYPRE_Int stencil_rank; - - RAP_stencil_dim = 2; - - /*----------------------------------------------------------------------- - * Define RAP_stencil - *-----------------------------------------------------------------------*/ - - stencil_rank = 0; - - /*----------------------------------------------------------------------- - * non-symmetric case - *-----------------------------------------------------------------------*/ - - if (!hypre_StructMatrixSymmetric(A)) - { - - /*-------------------------------------------------------------------- - * 5 or 9 point fine grid stencil produces 9 point RAP - *--------------------------------------------------------------------*/ - RAP_stencil_size = 9; - RAP_stencil_shape = hypre_CTAlloc(hypre_Index, RAP_stencil_size, HYPRE_MEMORY_HOST); - for (j = -1; j < 2; j++) - { - for (i = -1; i < 2; i++) - { - - /*-------------------------------------------------------------- - * Storage for 9 elements (c,w,e,n,s,sw,se,nw,se) - *--------------------------------------------------------------*/ - hypre_SetIndex3(index_temp, i, j, 0); - MapIndex(index_temp, cdir, RAP_stencil_shape[stencil_rank]); - stencil_rank++; - } - } - } - - /*----------------------------------------------------------------------- - * symmetric case - *-----------------------------------------------------------------------*/ - - else - { - - /*-------------------------------------------------------------------- - * 5 or 9 point fine grid stencil produces 9 point RAP - * Only store the lower triangular part + diagonal = 5 entries, - * lower triangular means the lower triangular part on the matrix - * in the standard lexicographic ordering. - *--------------------------------------------------------------------*/ - RAP_stencil_size = 5; - RAP_stencil_shape = hypre_CTAlloc(hypre_Index, RAP_stencil_size, HYPRE_MEMORY_HOST); - for (j = -1; j < 1; j++) - { - for (i = -1; i < 2; i++) - { - - /*-------------------------------------------------------------- - * Store 5 elements in (c,w,s,sw,se) - *--------------------------------------------------------------*/ - if ( i + j <= 0 ) - { - hypre_SetIndex3(index_temp, i, j, 0); - MapIndex(index_temp, cdir, RAP_stencil_shape[stencil_rank]); - stencil_rank++; - } - } - } - } - - RAP_stencil = hypre_StructStencilCreate(RAP_stencil_dim, RAP_stencil_size, - RAP_stencil_shape); - - RAP = hypre_StructMatrixCreate(hypre_StructMatrixComm(A), - coarse_grid, RAP_stencil); - - hypre_StructStencilDestroy(RAP_stencil); - - /*----------------------------------------------------------------------- - * Coarse operator in symmetric iff fine operator is - *-----------------------------------------------------------------------*/ - hypre_StructMatrixSymmetric(RAP) = hypre_StructMatrixSymmetric(A); - - /*----------------------------------------------------------------------- - * Set number of ghost points - one one each boundary - *-----------------------------------------------------------------------*/ - hypre_StructMatrixSetNumGhost(RAP, RAP_num_ghost); - - return RAP; -} - -/*-------------------------------------------------------------------------- - * Routines to build RAP. These routines are fairly general - * 1) No assumptions about symmetry of A - * 2) No assumption that R = transpose(P) - * 3) 5 or 9-point fine grid A - * - * I am, however, assuming that the c-to-c interpolation is the identity. - * - * I've written two routines - hypre_SparseMSG2BuildRAPSym to build the - * lower triangular part of RAP (including the diagonal) and - * hypre_SparseMSG2BuildRAPNoSym to build the upper triangular part of RAP - * (excluding the diagonal). So using symmetric storage, only the - * first routine would be called. With full storage both would need to - * be called. - * - *--------------------------------------------------------------------------*/ - -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_Index index; - hypre_Index index_temp; - - hypre_StructStencil *fine_stencil; - HYPRE_Int fine_stencil_size; - - hypre_StructGrid *fgrid; - HYPRE_Int *fgrid_ids; - hypre_StructGrid *cgrid; - hypre_BoxArray *cgrid_boxes; - HYPRE_Int *cgrid_ids; - hypre_Box *cgrid_box; - hypre_IndexRef cstart; - hypre_Index stridec; - hypre_Index fstart; - hypre_IndexRef stridef; - hypre_Index Pstart; - hypre_Index loop_size; - - HYPRE_Int fi, ci; - - hypre_Box *A_dbox; - hypre_Box *P_dbox; - hypre_Box *R_dbox; - hypre_Box *RAP_dbox; - - HYPRE_Real *pa, *pb; - HYPRE_Real *ra, *rb; - - HYPRE_Real *a_cc, *a_cw, *a_ce, *a_cs, *a_cn; - 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; - - HYPRE_Int yOffsetA; - HYPRE_Int xOffsetP; - HYPRE_Int yOffsetP; - - HYPRE_Int ierr = 0; - - fine_stencil = hypre_StructMatrixStencil(A); - fine_stencil_size = hypre_StructStencilSize(fine_stencil); - - stridef = cstride; - hypre_SetIndex3(stridec, 1, 1, 1); - - fgrid = hypre_StructMatrixGrid(A); - fgrid_ids = hypre_StructGridIDs(fgrid); - - cgrid = hypre_StructMatrixGrid(RAP); - cgrid_boxes = hypre_StructGridBoxes(cgrid); - cgrid_ids = hypre_StructGridIDs(cgrid); - - 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); - hypre_StructMapCoarseToFine(cstart, cindex, cstride, fstart); - hypre_StructMapCoarseToFine(cstart, cindex, stridePR, Pstart); - - A_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A), fi); - P_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(P), fi); - R_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(R), fi); - RAP_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(RAP), ci); - - /*----------------------------------------------------------------- - * Extract pointers for interpolation operator: - * pa is pointer for weight for f-point above c-point - * pb is pointer for weight for f-point below c-point - *-----------------------------------------------------------------*/ - - 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); - MapIndex(index_temp, cdir, index); - pb = hypre_StructMatrixExtractPointerByIndex(P, fi, index) - - hypre_BoxOffsetDistance(P_dbox, index); - - /*----------------------------------------------------------------- - * Extract pointers for restriction operator: - * ra is pointer for weight for f-point above c-point - * rb is pointer for weight for f-point below c-point - *-----------------------------------------------------------------*/ - - 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); - MapIndex(index_temp, cdir, index); - rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index) - - hypre_BoxOffsetDistance(R_dbox, index); - - /*----------------------------------------------------------------- - * Extract pointers for 5-point fine grid operator: - * - * a_cc is pointer for center coefficient - * a_cw is pointer for west coefficient - * a_ce is pointer for east coefficient - * a_cs is pointer for south coefficient - * a_cn is pointer for north coefficient - *-----------------------------------------------------------------*/ - - 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); - MapIndex(index_temp, cdir, index); - a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - - 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); - MapIndex(index_temp, cdir, index); - a_cs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - - hypre_SetIndex3(index_temp, 0, 1, 0); - MapIndex(index_temp, cdir, index); - a_cn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - - /*----------------------------------------------------------------- - * Extract additional pointers for 9-point fine grid operator: - * - * a_csw is pointer for southwest coefficient - * a_cse is pointer for southeast coefficient - * a_cnw is pointer for northwest coefficient - * a_cne is pointer for northeast coefficient - *-----------------------------------------------------------------*/ - - if (fine_stencil_size > 5) - { - 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); - MapIndex(index_temp, cdir, index); - a_cse = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - - hypre_SetIndex3(index_temp, -1, 1, 0); - MapIndex(index_temp, cdir, index); - a_cnw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - } - - /*----------------------------------------------------------------- - * Extract pointers for coarse grid operator - always 9-point: - * - * We build only the lower triangular part (plus diagonal). - * - * rap_cc is pointer for center coefficient (etc.) - *-----------------------------------------------------------------*/ - - 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); - MapIndex(index_temp, cdir, index); - rap_cw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - - 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); - MapIndex(index_temp, cdir, index); - rap_csw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - - hypre_SetIndex3(index_temp, 1, -1, 0); - MapIndex(index_temp, cdir, index); - rap_cse = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - - /*----------------------------------------------------------------- - * Define offsets for fine grid stencil and interpolation - * - * In the BoxLoop below I assume iA and iP refer to data associated - * with the point which we are building the stencil for. The below - * Offsets are used in refering to data associated with other points. - *-----------------------------------------------------------------*/ - - 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); - MapIndex(index_temp, cdir, index); - xOffsetP = hypre_BoxOffsetDistance(P_dbox, index); - - /*----------------------------------------------------------------- - * Switch statement to direct control to apropriate BoxLoop depending - * on stencil size. Default is full 9-point. - *-----------------------------------------------------------------*/ - - switch (fine_stencil_size) - { - - /*-------------------------------------------------------------- - * Loop for symmetric 5-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). - *--------------------------------------------------------------*/ - - case 5: - - hypre_BoxGetSize(cgrid_box, loop_size); - -#define DEVICE_VAR is_device_ptr(rap_csw,rb,a_cw,pa,rap_cs,a_cc,a_cs,rap_cse,a_ce,rap_cw,pb,ra,rap_cc,a_cn) - hypre_BoxLoop4Begin(hypre_StructMatrixNDim(A), loop_size, - P_dbox, Pstart, stridePR, iP, - R_dbox, Pstart, stridePR, iR, - A_dbox, fstart, stridef, iA, - RAP_dbox, cstart, stridec, iAc); - { - HYPRE_Int iAm1 = iA - yOffsetA; - HYPRE_Int iAp1 = iA + yOffsetA; - - HYPRE_Int iP1 = iP - yOffsetP - xOffsetP; - rap_csw[iAc] = rb[iR] * a_cw[iAm1] * 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]; - - 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]; - - 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]; - } - 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). - *--------------------------------------------------------------*/ - - default: - - hypre_BoxGetSize(cgrid_box, loop_size); - -#define DEVICE_VAR is_device_ptr(rap_csw,rb,a_cw,pa,a_csw,rap_cs,a_cc,a_cs,rap_cse,a_ce,a_cse,rap_cw,pb,ra,a_cnw,rap_cc,a_cn) - hypre_BoxLoop4Begin(hypre_StructMatrixNDim(A), loop_size, - P_dbox, Pstart, stridePR, iP, - R_dbox, Pstart, stridePR, iR, - A_dbox, fstart, stridef, iA, - RAP_dbox, cstart, stridec, iAc); - { - HYPRE_Int iAm1 = iA - yOffsetA; - HYPRE_Int iAp1 = iA + yOffsetA; - - 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]; - - iP1 = iP - yOffsetP; - rap_cs[iAc] = rb[iR] * a_cc[iAm1] * 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]; - - 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]; - - 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]; - - } - hypre_BoxLoop4End(iP, iR, iA, iAc); -#undef DEVICE_VAR - - break; - - } /* end switch statement */ - - } /* end ForBoxI */ - - return ierr; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -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_Index index; - hypre_Index index_temp; - - hypre_StructStencil *fine_stencil; - HYPRE_Int fine_stencil_size; - - hypre_StructGrid *fgrid; - HYPRE_Int *fgrid_ids; - hypre_StructGrid *cgrid; - hypre_BoxArray *cgrid_boxes; - HYPRE_Int *cgrid_ids; - hypre_Box *cgrid_box; - hypre_IndexRef cstart; - hypre_Index stridec; - hypre_Index fstart; - hypre_IndexRef stridef; - hypre_Index Pstart; - hypre_Index loop_size; - - HYPRE_Int fi, ci; - - hypre_Box *A_dbox; - hypre_Box *P_dbox; - hypre_Box *R_dbox; - hypre_Box *RAP_dbox; - - HYPRE_Real *pa, *pb; - HYPRE_Real *ra, *rb; - - 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; - - HYPRE_Int yOffsetA; - HYPRE_Int xOffsetP; - HYPRE_Int yOffsetP; - - HYPRE_Int ierr = 0; - - fine_stencil = hypre_StructMatrixStencil(A); - fine_stencil_size = hypre_StructStencilSize(fine_stencil); - - stridef = cstride; - hypre_SetIndex3(stridec, 1, 1, 1); - - fgrid = hypre_StructMatrixGrid(A); - fgrid_ids = hypre_StructGridIDs(fgrid); - - cgrid = hypre_StructMatrixGrid(RAP); - cgrid_boxes = hypre_StructGridBoxes(cgrid); - cgrid_ids = hypre_StructGridIDs(cgrid); - - 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); - hypre_StructMapCoarseToFine(cstart, cindex, cstride, fstart); - hypre_StructMapCoarseToFine(cstart, cindex, stridePR, Pstart); - - A_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A), fi); - P_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(P), fi); - R_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(R), fi); - RAP_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(RAP), ci); - - /*----------------------------------------------------------------- - * Extract pointers for interpolation operator: - * pa is pointer for weight for f-point above c-point - * pb is pointer for weight for f-point below c-point - *-----------------------------------------------------------------*/ - - 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); - MapIndex(index_temp, cdir, index); - pb = hypre_StructMatrixExtractPointerByIndex(P, fi, index) - - hypre_BoxOffsetDistance(P_dbox, index); - - /*----------------------------------------------------------------- - * Extract pointers for restriction operator: - * ra is pointer for weight for f-point above c-point - * rb is pointer for weight for f-point below c-point - *-----------------------------------------------------------------*/ - - 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); - MapIndex(index_temp, cdir, index); - rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index) - - hypre_BoxOffsetDistance(R_dbox, index); - - /*----------------------------------------------------------------- - * Extract pointers for 5-point fine grid operator: - * - * a_cc is pointer for center coefficient - * a_cw is pointer for west coefficient - * a_ce is pointer for east coefficient - * a_cs is pointer for south coefficient - * a_cn is pointer for north coefficient - *-----------------------------------------------------------------*/ - - 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); - MapIndex(index_temp, cdir, index); - a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - - 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); - MapIndex(index_temp, cdir, index); - a_cn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - - /*----------------------------------------------------------------- - * Extract additional pointers for 9-point fine grid operator: - * - * a_csw is pointer for southwest coefficient - * a_cse is pointer for southeast coefficient - * a_cnw is pointer for northwest coefficient - * a_cne is pointer for northeast coefficient - *-----------------------------------------------------------------*/ - - if (fine_stencil_size > 5) - { - 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); - MapIndex(index_temp, cdir, index); - a_cnw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - - hypre_SetIndex3(index_temp, 1, 1, 0); - MapIndex(index_temp, cdir, index); - a_cne = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - - } - - /*----------------------------------------------------------------- - * Extract pointers for coarse grid operator - always 9-point: - * - * We build only the upper triangular part. - * - * rap_ce is pointer for east coefficient (etc.) - *-----------------------------------------------------------------*/ - - 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); - MapIndex(index_temp, cdir, index); - rap_cn = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - - 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); - MapIndex(index_temp, cdir, index); - rap_cnw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - - /*----------------------------------------------------------------- - * Define offsets for fine grid stencil and interpolation - * - * In the BoxLoop below I assume iA and iP refer to data associated - * with the point which we are building the stencil for. The below - * Offsets are used in refering to data associated with other points. - *-----------------------------------------------------------------*/ - - 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); - MapIndex(index_temp, cdir, index); - xOffsetP = hypre_BoxOffsetDistance(P_dbox, index); - - /*----------------------------------------------------------------- - * Switch statement to direct control to appropriate BoxLoop depending - * on stencil size. Default is full 27-point. - *-----------------------------------------------------------------*/ - - switch (fine_stencil_size) - { - - /*-------------------------------------------------------------- - * Loop for 5-point fine grid operator; produces upper triangular - * part of 9-point coarse grid operator - excludes diagonal. - * stencil entries: (northeast, north, northwest, and east) - *--------------------------------------------------------------*/ - - case 5: - - hypre_BoxGetSize(cgrid_box, loop_size); - -#define DEVICE_VAR is_device_ptr(rap_cne,ra,a_ce,pb,rap_cn,a_cc,a_cn,rap_cnw,a_cw,rap_ce,rb,pa) - hypre_BoxLoop4Begin(hypre_StructMatrixNDim(A), loop_size, - P_dbox, Pstart, stridePR, iP, - R_dbox, Pstart, stridePR, iR, - A_dbox, fstart, stridef, iA, - RAP_dbox, cstart, stridec, iAc); - { - HYPRE_Int iAm1 = iA - yOffsetA; - HYPRE_Int iAp1 = iA + yOffsetA; - - HYPRE_Int iP1 = iP + yOffsetP + xOffsetP; - rap_cne[iAc] = ra[iR] * a_ce[iAp1] * 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]; - - 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]; - } - 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) - *--------------------------------------------------------------*/ - - default: - - hypre_BoxGetSize(cgrid_box, loop_size); - -#define DEVICE_VAR is_device_ptr(rap_cne,ra,a_ce,pb,a_cne,rap_cn,a_cc,a_cn,rap_cnw,a_cw,a_cnw,rap_ce,rb,pa,a_cse) - hypre_BoxLoop4Begin(hypre_StructMatrixNDim(A), loop_size, - P_dbox, Pstart, stridePR, iP, - R_dbox, Pstart, stridePR, iR, - A_dbox, fstart, stridef, iA, - RAP_dbox, cstart, stridec, iAc); - { - HYPRE_Int iAm1 = iA - yOffsetA; - HYPRE_Int iAp1 = iA + yOffsetA; - - 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]; - - iP1 = iP + yOffsetP; - rap_cn[iAc] = ra[iR] * a_cc[iAp1] * 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]; - - 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]; - } - hypre_BoxLoop4End(iP, iR, iA, iAc); -#undef DEVICE_VAR - - break; - - } /* end switch statement */ - - } /* end ForBoxI */ - - return ierr; -} diff --git a/src/struct_ls/sparse_msg3_setup_rap.c b/src/struct_ls/sparse_msg3_setup_rap.c deleted file mode 100644 index 6cd90a7ed2..0000000000 --- a/src/struct_ls/sparse_msg3_setup_rap.c +++ /dev/null @@ -1,1466 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_ls.h" -#include "_hypre_struct_mv.hpp" - -/*-------------------------------------------------------------------------- - * Macro to "change coordinates". This routine is written as though - * coarsening is being done in the z-direction. This macro is used to - * allow for coarsening to be done in the x- and y-directions also. - *--------------------------------------------------------------------------*/ - -#define MapIndex(in_index, cdir, out_index) \ - hypre_IndexD(out_index, cdir) = hypre_IndexD(in_index, 2); \ - cdir = (cdir + 1) % 3; \ - hypre_IndexD(out_index, cdir) = hypre_IndexD(in_index, 0); \ - cdir = (cdir + 1) % 3; \ - hypre_IndexD(out_index, cdir) = hypre_IndexD(in_index, 1); \ - cdir = (cdir + 1) % 3; - -/*-------------------------------------------------------------------------- - * hypre_SparseMSG3CreateRAPOp - * Sets up new coarse grid operator stucture. - *--------------------------------------------------------------------------*/ - -hypre_StructMatrix * -hypre_SparseMSG3CreateRAPOp( hypre_StructMatrix *R, - hypre_StructMatrix *A, - hypre_StructMatrix *P, - hypre_StructGrid *coarse_grid, - HYPRE_Int cdir ) -{ - HYPRE_UNUSED_VAR(R); - HYPRE_UNUSED_VAR(P); - - hypre_StructMatrix *RAP; - - hypre_Index *RAP_stencil_shape; - hypre_StructStencil *RAP_stencil; - HYPRE_Int RAP_stencil_size; - HYPRE_Int RAP_stencil_dim; - HYPRE_Int RAP_num_ghost[] = {1, 1, 1, 1, 1, 1}; - - hypre_StructStencil *A_stencil; - HYPRE_Int A_stencil_size; - - hypre_Index index_temp; - HYPRE_Int k, j, i; - HYPRE_Int stencil_rank; - - RAP_stencil_dim = 3; - - A_stencil = hypre_StructMatrixStencil(A); - A_stencil_size = hypre_StructStencilSize(A_stencil); - - /*----------------------------------------------------------------------- - * Define RAP_stencil - *-----------------------------------------------------------------------*/ - - stencil_rank = 0; - - /*----------------------------------------------------------------------- - * non-symmetric case - *-----------------------------------------------------------------------*/ - - /*----------------------------------------------------------------------- - * 7-point fine grid stencil produces 19 point RAP - * - * Store all 27 elements except for the corners. - * - * For symmetric A, only store the lower triangular part, where - * lower triangular means the lower triangular part on the matrix - * in the standard lexicographic ordering. - *-----------------------------------------------------------------------*/ - if ( A_stencil_size == 7) - { - RAP_stencil_size = 19; - if (hypre_StructMatrixSymmetric(A)) - { - RAP_stencil_size = (RAP_stencil_size + 1) / 2; - } - RAP_stencil_shape = hypre_CTAlloc(hypre_Index, RAP_stencil_size, HYPRE_MEMORY_HOST); - for (k = -1; k < 2; k++) - { - for (j = -1; j < 2; j++) - { - for (i = -1; i < 2; i++) - { - if ((i * j * k == 0) && (stencil_rank < RAP_stencil_size)) - { - hypre_SetIndex3(index_temp, i, j, k); - MapIndex(index_temp, cdir, - RAP_stencil_shape[stencil_rank]); - stencil_rank++; - } - } - } - } - } - - /*----------------------------------------------------------------------- - * 19 or 27 point fine grid stencil produces 27 point RAP - * - * Store all 27 elements - * - * For symmetric A, only store the lower triangular part, where - * lower triangular means the lower triangular part on the matrix - * in the standard lexicographic ordering. - *-----------------------------------------------------------------------*/ - else - { - RAP_stencil_size = 27; - if (hypre_StructMatrixSymmetric(A)) - { - RAP_stencil_size = (RAP_stencil_size + 1) / 2; - } - RAP_stencil_shape = hypre_CTAlloc(hypre_Index, RAP_stencil_size, HYPRE_MEMORY_HOST); - for (k = -1; k < 2; k++) - { - for (j = -1; j < 2; j++) - { - for (i = -1; i < 2; i++) - { - if (stencil_rank < RAP_stencil_size) - { - hypre_SetIndex3(index_temp, i, j, k); - MapIndex(index_temp, cdir, - RAP_stencil_shape[stencil_rank]); - stencil_rank++; - } - } - } - } - } - - RAP_stencil = hypre_StructStencilCreate(RAP_stencil_dim, RAP_stencil_size, - RAP_stencil_shape); - RAP = hypre_StructMatrixCreate(hypre_StructMatrixComm(A), - coarse_grid, RAP_stencil); - - hypre_StructStencilDestroy(RAP_stencil); - - /*----------------------------------------------------------------------- - * Coarse operator in symmetric iff fine operator is - *-----------------------------------------------------------------------*/ - hypre_StructMatrixSymmetric(RAP) = hypre_StructMatrixSymmetric(A); - - /*----------------------------------------------------------------------- - * Set number of ghost points - one one each boundary - *-----------------------------------------------------------------------*/ - hypre_StructMatrixSetNumGhost(RAP, RAP_num_ghost); - - return RAP; -} - -/*-------------------------------------------------------------------------- - * Routines to build RAP. These routines are fairly general - * 1) No assumptions about symmetry of A - * 2) No assumption that R = transpose(P) - * 3) 7, 19 or 27-point fine grid A - * - * I am, however, assuming that the c-to-c interpolation is the identity. - * - * I've written a two routines - hypre_SparseMSG3BuildRAPSym to build the lower - * triangular part of RAP (including the diagonal) and - * hypre_SparseMSG3BuildRAPNoSym to build the upper triangular part of RAP - * (excluding the diagonal). So using symmetric storage, only the first - * routine would be called. With full storage both would need to be called. - * - *--------------------------------------------------------------------------*/ - -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_Index index; - hypre_Index index_temp; - - hypre_StructStencil *fine_stencil; - HYPRE_Int fine_stencil_size; - - hypre_StructGrid *fgrid; - HYPRE_Int *fgrid_ids; - hypre_StructGrid *cgrid; - hypre_BoxArray *cgrid_boxes; - HYPRE_Int *cgrid_ids; - hypre_Box *cgrid_box; - hypre_IndexRef cstart; - hypre_Index stridec; - hypre_Index fstart; - hypre_IndexRef stridef; - hypre_Index Pstart; - hypre_Index loop_size; - - HYPRE_Int fi, ci; - - hypre_Box *A_dbox; - hypre_Box *P_dbox; - hypre_Box *R_dbox; - hypre_Box *RAP_dbox; - - HYPRE_Real *pa, *pb; - HYPRE_Real *ra, *rb; - - 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 = 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; - HYPRE_Int yOffsetP; - HYPRE_Int zOffsetP; - - HYPRE_Int ierr = 0; - - fine_stencil = hypre_StructMatrixStencil(A); - fine_stencil_size = hypre_StructStencilSize(fine_stencil); - - stridef = cstride; - hypre_SetIndex3(stridec, 1, 1, 1); - - fgrid = hypre_StructMatrixGrid(A); - fgrid_ids = hypre_StructGridIDs(fgrid); - - cgrid = hypre_StructMatrixGrid(RAP); - cgrid_boxes = hypre_StructGridBoxes(cgrid); - cgrid_ids = hypre_StructGridIDs(cgrid); - - 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); - hypre_StructMapCoarseToFine(cstart, cindex, cstride, fstart); - hypre_StructMapCoarseToFine(cstart, cindex, stridePR, Pstart); - - A_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A), fi); - P_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(P), fi); - R_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(R), fi); - RAP_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(RAP), ci); - - /*----------------------------------------------------------------- - * Extract pointers for interpolation operator: - * pa is pointer for weight for f-point above c-point - * pb is pointer for weight for f-point below c-point - *-----------------------------------------------------------------*/ - - 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); - MapIndex(index_temp, cdir, index); - pb = hypre_StructMatrixExtractPointerByIndex(P, fi, index) - - hypre_BoxOffsetDistance(P_dbox, index); - - /*----------------------------------------------------------------- - * Extract pointers for restriction operator: - * ra is pointer for weight for f-point above c-point - * rb is pointer for weight for f-point below c-point - *-----------------------------------------------------------------*/ - - 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); - MapIndex(index_temp, cdir, index); - rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index) - - hypre_BoxOffsetDistance(R_dbox, index); - - /*----------------------------------------------------------------- - * Extract pointers for 7-point fine grid operator: - * - * a_cc is pointer for center coefficient - * a_cw is pointer for west coefficient in same plane - * a_ce is pointer for east coefficient in same plane - * a_cs is pointer for south coefficient in same plane - * a_cn is pointer for north coefficient in same plane - * a_ac is pointer for center coefficient in plane above - * a_bc is pointer for center coefficient in plane below - *-----------------------------------------------------------------*/ - - 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); - MapIndex(index_temp, cdir, index); - a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - - 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); - MapIndex(index_temp, cdir, index); - a_cs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - - 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); - MapIndex(index_temp, cdir, index); - a_ac = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - - hypre_SetIndex3(index_temp, 0, 0, -1); - MapIndex(index_temp, cdir, index); - a_bc = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - - /*----------------------------------------------------------------- - * Extract additional pointers for 19-point fine grid operator: - * - * a_aw is pointer for west coefficient in plane above - * a_ae is pointer for east coefficient in plane above - * a_as is pointer for south coefficient in plane above - * a_an is pointer for north coefficient in plane above - * a_bw is pointer for west coefficient in plane below - * a_be is pointer for east coefficient in plane below - * a_bs is pointer for south coefficient in plane below - * a_bn is pointer for north coefficient in plane below - * a_csw is pointer for southwest coefficient in same plane - * a_cse is pointer for southeast coefficient in same plane - * a_cnw is pointer for northwest coefficient in same plane - * a_cne is pointer for northeast coefficient in same plane - *-----------------------------------------------------------------*/ - - if (fine_stencil_size > 7) - { - 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); - MapIndex(index_temp, cdir, index); - a_as = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - - 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); - MapIndex(index_temp, cdir, index); - a_be = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - - 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); - MapIndex(index_temp, cdir, index); - a_bn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - - 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); - MapIndex(index_temp, cdir, index); - a_cse = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - - 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); - MapIndex(index_temp, cdir, index); - a_cne = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - } - - /*----------------------------------------------------------------- - * Extract additional pointers for 27-point fine grid operator: - * - * a_asw is pointer for southwest coefficient in plane above - * a_ase is pointer for southeast coefficient in plane above - * a_anw is pointer for northwest coefficient in plane above - * a_ane is pointer for northeast coefficient in plane above - * a_bsw is pointer for southwest coefficient in plane below - * a_bse is pointer for southeast coefficient in plane below - * a_bnw is pointer for northwest coefficient in plane below - * a_bne is pointer for northeast coefficient in plane below - *-----------------------------------------------------------------*/ - - if (fine_stencil_size > 19) - { - 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); - MapIndex(index_temp, cdir, index); - a_ase = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - - 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); - MapIndex(index_temp, cdir, index); - a_bse = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - - 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); - MapIndex(index_temp, cdir, index); - a_bne = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - } - - /*----------------------------------------------------------------- - * Extract pointers for 19-point coarse grid operator: - * - * We build only the lower triangular part (plus diagonal). - * - * rap_cc is pointer for center coefficient (etc.) - *-----------------------------------------------------------------*/ - - 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); - MapIndex(index_temp, cdir, index); - rap_cw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - - 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); - MapIndex(index_temp, cdir, index); - rap_bc = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - - 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); - MapIndex(index_temp, cdir, index); - rap_be = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - - 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); - MapIndex(index_temp, cdir, index); - rap_bn = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - - 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); - MapIndex(index_temp, cdir, index); - rap_cse = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - - /*----------------------------------------------------------------- - * Extract additional pointers for 27-point coarse grid operator: - * - * A 27-point coarse grid operator is produced when the fine grid - * stencil is 19 or 27 point. - * - * We build only the lower triangular part. - * - * rap_csw is pointer for southwest coefficient in same plane (etc.) - *-----------------------------------------------------------------*/ - - if (fine_stencil_size > 7) - { - 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); - MapIndex(index_temp, cdir, index); - rap_bse = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - - 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); - MapIndex(index_temp, cdir, index); - rap_bne = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - } - - /*----------------------------------------------------------------- - * Define offsets for fine grid stencil and interpolation - * - * In the BoxLoop below I assume iA and iP refer to data associated - * with the point which we are building the stencil for. The below - * Offsets are used in refering to data associated with other points. - *-----------------------------------------------------------------*/ - - 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); - MapIndex(index_temp, cdir, 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); - - /*-------------------------------------------------------------------- - * Switch statement to direct control to apropriate BoxLoop depending - * on stencil size. Default is full 27-point. - *-----------------------------------------------------------------*/ - - switch (fine_stencil_size) - { - - /*-------------------------------------------------------------- - * Loop for symmetric 7-point fine grid operator; produces a - * symmetric 19-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 7: - - hypre_BoxGetSize(cgrid_box, loop_size); - -#define DEVICE_VAR is_device_ptr(rap_bs,rb,a_cs,pa,rap_bw,a_cw,rap_bc,a_bc,a_cc,rap_be,a_ce,rap_bn,a_cn,rap_cs,pb,ra,rap_cw,rap_csw,rap_cse,rap_cc,a_ac) - hypre_BoxLoop4Begin(hypre_StructMatrixNDim(A), loop_size, - P_dbox, Pstart, stridePR, iP, - R_dbox, Pstart, stridePR, iR, - A_dbox, fstart, stridef, iA, - RAP_dbox, cstart, stridec, iAc); - { - HYPRE_Int iAm1 = iA - zOffsetA; - HYPRE_Int iAp1 = iA + zOffsetA; - - HYPRE_Int iP1 = iP - zOffsetP - yOffsetP; - rap_bs[iAc] = rb[iR] * a_cs[iAm1] * pa[iP1]; - - iP1 = iP - zOffsetP - xOffsetP; - rap_bw[iAc] = rb[iR] * a_cw[iAm1] * 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]; - - iP1 = iP - zOffsetP + xOffsetP; - rap_be[iAc] = rb[iR] * a_ce[iAm1] * pa[iP1]; - - iP1 = iP - zOffsetP + yOffsetP; - rap_bn[iAc] = rb[iR] * a_cn[iAm1] * 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]; - - iP1 = iP - xOffsetP; - rap_cw[iAc] = a_cw[iA] - + 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]; - - } - hypre_BoxLoop4End(iP, iR, iA, iAc); -#undef DEVICE_VAR - - 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). - *--------------------------------------------------------------*/ - - case 19: - - hypre_BoxGetSize(cgrid_box, loop_size); - -#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, - P_dbox, Pstart, stridePR, iP, - R_dbox, Pstart, stridePR, iR, - A_dbox, fstart, stridef, iA, - RAP_dbox, cstart, stridec, iAc); - { - HYPRE_Int iAm1 = iA - zOffsetA; - HYPRE_Int iAp1 = iA + zOffsetA; - - HYPRE_Int iP1 = iP - zOffsetP - yOffsetP - xOffsetP; - rap_bsw[iAc] = rb[iR] * a_csw[iAm1] * 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]; - - 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]; - - iP1 = iP - zOffsetP; - rap_bc[iAc] = a_bc[iA] * pa[iP1] - + 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]; - - 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]; - - 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]; - - 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]; - - iP1 = iP - yOffsetP + xOffsetP; - rap_cse[iAc] = a_cse[iA] - + 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]; - - 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]; - - } - hypre_BoxLoop4End(iP, iR, iA, iAc); -#undef DEVICE_VAR - - 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). - *--------------------------------------------------------------*/ - - default: - - hypre_BoxGetSize(cgrid_box, loop_size); - -#define DEVICE_VAR is_device_ptr(rap_bsw,rb,a_csw,pa,a_bsw,rap_bs,a_cs,a_bs,rap_bse,a_cse,a_bse,rap_bw,a_cw,a_bw,rap_bc,a_bc,a_cc,rap_be,a_ce,a_be,rap_bnw,a_cnw,a_bnw,rap_bn,a_cn,a_bn,rap_bne,a_cne,a_bne,rap_csw,pb,ra,a_asw,rap_cs,a_as,rap_cse,a_ase,rap_cw,a_aw,rap_cc,a_ac) - hypre_BoxLoop4Begin(hypre_StructMatrixNDim(A), loop_size, - P_dbox, Pstart, stridePR, iP, - R_dbox, Pstart, stridePR, iR, - A_dbox, fstart, stridef, iA, - RAP_dbox, cstart, stridec, iAc); - { - HYPRE_Int iAm1 = iA - zOffsetA; - HYPRE_Int iAp1 = iA + zOffsetA; - - 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]; - - iP1 = iP - zOffsetP - yOffsetP; - rap_bs[iAc] = rb[iR] * a_cs[iAm1] * 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]; - - iP1 = iP - zOffsetP - xOffsetP; - rap_bw[iAc] = rb[iR] * a_cw[iAm1] * 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]; - - iP1 = iP - zOffsetP + xOffsetP; - rap_be[iAc] = rb[iR] * a_ce[iAm1] * 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]; - - iP1 = iP - zOffsetP + yOffsetP; - rap_bn[iAc] = rb[iR] * a_cn[iAm1] * 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]; - - 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]; - - 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]; - - 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]; - - 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]; - - 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]; - } - hypre_BoxLoop4End(iP, iR, iA, iAc); -#undef DEVICE_VAR - - break; - - } /* end switch statement */ - - } /* end ForBoxI */ - - return ierr; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -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_Index index; - hypre_Index index_temp; - - hypre_StructStencil *fine_stencil; - HYPRE_Int fine_stencil_size; - - hypre_StructGrid *fgrid; - HYPRE_Int *fgrid_ids; - hypre_StructGrid *cgrid; - hypre_BoxArray *cgrid_boxes; - HYPRE_Int *cgrid_ids; - hypre_Box *cgrid_box; - hypre_IndexRef cstart; - hypre_Index stridec; - hypre_Index fstart; - hypre_IndexRef stridef; - hypre_Index Pstart; - hypre_Index loop_size; - - HYPRE_Int fi, ci; - - hypre_Box *A_dbox; - hypre_Box *P_dbox; - hypre_Box *R_dbox; - hypre_Box *RAP_dbox; - - HYPRE_Real *pa, *pb; - HYPRE_Real *ra, *rb; - - 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 = 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; - HYPRE_Int yOffsetP; - HYPRE_Int zOffsetP; - - HYPRE_Int ierr = 0; - - fine_stencil = hypre_StructMatrixStencil(A); - fine_stencil_size = hypre_StructStencilSize(fine_stencil); - - stridef = cstride; - hypre_SetIndex3(stridec, 1, 1, 1); - - fgrid = hypre_StructMatrixGrid(A); - fgrid_ids = hypre_StructGridIDs(fgrid); - - cgrid = hypre_StructMatrixGrid(RAP); - cgrid_boxes = hypre_StructGridBoxes(cgrid); - cgrid_ids = hypre_StructGridIDs(cgrid); - - 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); - hypre_StructMapCoarseToFine(cstart, cindex, cstride, fstart); - hypre_StructMapCoarseToFine(cstart, cindex, stridePR, Pstart); - - A_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A), fi); - P_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(P), fi); - R_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(R), fi); - RAP_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(RAP), ci); - - /*----------------------------------------------------------------- - * Extract pointers for interpolation operator: - * pa is pointer for weight for f-point above c-point - * pb is pointer for weight for f-point below c-point - *-----------------------------------------------------------------*/ - - 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); - MapIndex(index_temp, cdir, index); - pb = hypre_StructMatrixExtractPointerByIndex(P, fi, index) - - hypre_BoxOffsetDistance(P_dbox, index); - - /*----------------------------------------------------------------- - * Extract pointers for restriction operator: - * ra is pointer for weight for f-point above c-point - * rb is pointer for weight for f-point below c-point - *-----------------------------------------------------------------*/ - - 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); - MapIndex(index_temp, cdir, index); - rb = hypre_StructMatrixExtractPointerByIndex(R, fi, index) - - hypre_BoxOffsetDistance(R_dbox, index); - - /*----------------------------------------------------------------- - * Extract pointers for 7-point fine grid operator: - * - * a_cc is pointer for center coefficient - * a_cw is pointer for west coefficient in same plane - * a_ce is pointer for east coefficient in same plane - * a_cs is pointer for south coefficient in same plane - * a_cn is pointer for north coefficient in same plane - * a_ac is pointer for center coefficient in plane above - * a_bc is pointer for center coefficient in plane below - *-----------------------------------------------------------------*/ - - 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); - MapIndex(index_temp, cdir, index); - a_cw = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - - 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); - MapIndex(index_temp, cdir, index); - a_cs = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - - 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); - MapIndex(index_temp, cdir, index); - a_ac = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - - /*----------------------------------------------------------------- - * Extract additional pointers for 19-point fine grid operator: - * - * a_aw is pointer for west coefficient in plane above - * a_ae is pointer for east coefficient in plane above - * a_as is pointer for south coefficient in plane above - * a_an is pointer for north coefficient in plane above - * a_bw is pointer for west coefficient in plane below - * a_be is pointer for east coefficient in plane below - * a_bs is pointer for south coefficient in plane below - * a_bn is pointer for north coefficient in plane below - * a_csw is pointer for southwest coefficient in same plane - * a_cse is pointer for southeast coefficient in same plane - * a_cnw is pointer for northwest coefficient in same plane - * a_cne is pointer for northeast coefficient in same plane - *-----------------------------------------------------------------*/ - - if (fine_stencil_size > 7) - { - 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); - MapIndex(index_temp, cdir, index); - a_ae = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - - 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); - MapIndex(index_temp, cdir, index); - a_an = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - - 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); - MapIndex(index_temp, cdir, index); - a_bn = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - - 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); - MapIndex(index_temp, cdir, index); - a_cse = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - - 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); - MapIndex(index_temp, cdir, index); - a_cne = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - } - - /*----------------------------------------------------------------- - * Extract additional pointers for 27-point fine grid operator: - * - * a_asw is pointer for southwest coefficient in plane above - * a_ase is pointer for southeast coefficient in plane above - * a_anw is pointer for northwest coefficient in plane above - * a_ane is pointer for northeast coefficient in plane above - * a_bsw is pointer for southwest coefficient in plane below - * a_bse is pointer for southeast coefficient in plane below - * a_bnw is pointer for northwest coefficient in plane below - * a_bne is pointer for northeast coefficient in plane below - *-----------------------------------------------------------------*/ - - if (fine_stencil_size > 19) - { - 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); - MapIndex(index_temp, cdir, index); - a_ase = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - - 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); - MapIndex(index_temp, cdir, index); - a_ane = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - - 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); - MapIndex(index_temp, cdir, index); - a_bne = hypre_StructMatrixExtractPointerByIndex(A, fi, index); - - } - - /*----------------------------------------------------------------- - * Extract pointers for 19-point coarse grid operator: - * - * We build only the upper triangular part (excluding diagonal). - * - * rap_ce is pointer for east coefficient in same plane (etc.) - *-----------------------------------------------------------------*/ - - 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); - MapIndex(index_temp, cdir, index); - rap_cn = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - - 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); - MapIndex(index_temp, cdir, index); - rap_aw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - - 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); - MapIndex(index_temp, cdir, index); - rap_as = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - - 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); - MapIndex(index_temp, cdir, index); - rap_cnw = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - - hypre_SetIndex3(index_temp, 1, 1, 0); - MapIndex(index_temp, cdir, index); - rap_cne = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - - /*----------------------------------------------------------------- - * Extract additional pointers for 27-point coarse grid operator: - * - * A 27-point coarse grid operator is produced when the fine grid - * stencil is 19 or 27 point. - * - * We build only the upper triangular part. - * - * rap_cnw is pointer for northwest coefficient in same plane (etc.) - *-----------------------------------------------------------------*/ - - if (fine_stencil_size > 7) - { - 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); - MapIndex(index_temp, cdir, index); - rap_ase = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - - 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); - MapIndex(index_temp, cdir, index); - rap_ane = hypre_StructMatrixExtractPointerByIndex(RAP, ci, index); - } - - /*----------------------------------------------------------------- - * Define offsets for fine grid stencil and interpolation - * - * In the BoxLoop below I assume iA and iP refer to data associated - * with the point which we are building the stencil for. The below - * Offsets are used in refering to data associated with other points. - *-----------------------------------------------------------------*/ - - 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); - MapIndex(index_temp, cdir, 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); - - /*----------------------------------------------------------------- - * Switch statement to direct control to apropriate BoxLoop depending - * on stencil size. Default is full 27-point. - *-----------------------------------------------------------------*/ - - switch (fine_stencil_size) - { - - /*-------------------------------------------------------------- - * Loop for 7-point fine grid operator; produces upper triangular - * part of 19-point coarse grid operator. stencil entries: - * (above-north, above-east, above-center, above-west, - * above-south, center-north, and center-east). - *--------------------------------------------------------------*/ - - case 7: - - hypre_BoxGetSize(cgrid_box, loop_size); - -#define DEVICE_VAR is_device_ptr(rap_an,ra,a_cn,pb,rap_ae,a_ce,rap_ac,a_ac,a_cc,rap_aw,a_cw,rap_as,a_cs,rap_cn,rb,pa,rap_ce,rap_cnw,rap_cne) - hypre_BoxLoop4Begin(hypre_StructMatrixNDim(A), loop_size, - P_dbox, Pstart, stridePR, iP, - R_dbox, Pstart, stridePR, iR, - A_dbox, fstart, stridef, iA, - RAP_dbox, cstart, stridec, iAc); - { - HYPRE_Int iAm1 = iA - zOffsetA; - HYPRE_Int iAp1 = iA + zOffsetA; - - HYPRE_Int iP1 = iP + zOffsetP + yOffsetP; - rap_an[iAc] = ra[iR] * a_cn[iAp1] * pb[iP1]; - - iP1 = iP + zOffsetP + xOffsetP; - rap_ae[iAc] = ra[iR] * a_ce[iAp1] * 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]; - - iP1 = iP + zOffsetP - xOffsetP; - rap_aw[iAc] = ra[iR] * a_cw[iAp1] * pb[iP1]; - - iP1 = iP + zOffsetP - yOffsetP; - rap_as[iAc] = ra[iR] * a_cs[iAp1] * 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]; - - iP1 = iP + xOffsetP; - rap_ce[iAc] = a_ce[iA] - + rb[iR] * a_ce[iAm1] * pb[iP1] - + ra[iR] * a_ce[iAp1] * pa[iP1]; - - rap_cnw[iAc] = 0.0; - - rap_cne[iAc] = 0.0; - } - hypre_BoxLoop4End(iP, iR, iA, iAc); -#undef DEVICE_VAR - - 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). - *--------------------------------------------------------------*/ - - case 19: - - hypre_BoxGetSize(cgrid_box, loop_size); - -#define DEVICE_VAR is_device_ptr(rap_ane,ra,a_cne,pb,rap_an,a_cn,a_an,rap_anw,a_cnw,rap_ae,a_ce,a_ae,rap_ac,a_ac,a_cc,rap_aw,a_cw,a_aw,rap_ase,a_cse,rap_as,a_cs,a_as,rap_asw,a_csw,rap_cne,rb,pa,rap_cn,a_bn,rap_cnw,rap_ce,a_be) - hypre_BoxLoop4Begin(hypre_StructMatrixNDim(A), loop_size, - P_dbox, Pstart, stridePR, iP, - R_dbox, Pstart, stridePR, iR, - A_dbox, fstart, stridef, iA, - RAP_dbox, cstart, stridec, iAc); - { - HYPRE_Int iAm1 = iA - zOffsetA; - HYPRE_Int iAp1 = iA + zOffsetA; - - HYPRE_Int iP1 = iP + zOffsetP + yOffsetP + xOffsetP; - rap_ane[iAc] = ra[iR] * a_cne[iAp1] * 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]; - - 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]; - - iP1 = iP + zOffsetP; - rap_ac[iAc] = a_ac[iA] * pb[iP1] - + 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]; - - 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]; - - 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]; - - 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]; - - iP1 = iP + yOffsetP - xOffsetP; - rap_cnw[iAc] = a_cnw[iA] - + 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]; - - } - hypre_BoxLoop4End(iP, iR, iA, iAc); -#undef DEVICE_VAR - - 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). - *--------------------------------------------------------------*/ - - default: - - hypre_BoxGetSize(cgrid_box, loop_size); - -#define DEVICE_VAR is_device_ptr(rap_ane,ra,a_cne,pb,a_ane,rap_an,a_cn,a_an,rap_anw,a_cnw,a_anw,rap_ae,a_ce,a_ae,rap_ac,a_ac,a_cc,rap_aw,a_cw,a_aw,rap_ase,a_cse,a_ase,rap_as,a_cs,a_as,rap_asw,a_csw,a_asw,rap_cne,rb,pa,a_bne,rap_cn,a_bn,rap_cnw,a_bnw,rap_ce,a_be) - hypre_BoxLoop4Begin(hypre_StructMatrixNDim(A), loop_size, - P_dbox, Pstart, stridePR, iP, - R_dbox, Pstart, stridePR, iR, - A_dbox, fstart, stridef, iA, - RAP_dbox, cstart, stridec, iAc); - { - HYPRE_Int iAm1 = iA - zOffsetA; - HYPRE_Int iAp1 = iA + zOffsetA; - - 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]; - - iP1 = iP + zOffsetP + yOffsetP; - rap_an[iAc] = ra[iR] * a_cn[iAp1] * 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]; - - iP1 = iP + zOffsetP + xOffsetP; - rap_ae[iAc] = ra[iR] * a_ce[iAp1] * 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]; - - iP1 = iP + zOffsetP - xOffsetP; - rap_aw[iAc] = ra[iR] * a_cw[iAp1] * 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]; - - iP1 = iP + zOffsetP - yOffsetP; - rap_as[iAc] = ra[iR] * a_cs[iAp1] * 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]; - - - 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]; - - 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]; - - 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]; - - 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]; - - } - hypre_BoxLoop4End(iP, iR, iA, iAc); -#undef DEVICE_VAR - - break; - - } /* end switch statement */ - - } /* end ForBoxI */ - - return ierr; -} diff --git a/src/struct_ls/sparse_msg_filter.c b/src/struct_ls/sparse_msg_filter.c deleted file mode 100644 index 11bfe4934f..0000000000 --- a/src/struct_ls/sparse_msg_filter.c +++ /dev/null @@ -1,551 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_ls.h" -#include "_hypre_struct_mv.hpp" - -#if 0 - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGFilterSetup - *--------------------------------------------------------------------------*/ - -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 ierr = 0; - - hypre_BoxArray *compute_boxes; - hypre_Box *compute_box; - - hypre_Box *A_dbox; - hypre_Box *v_dbox; - - HYPRE_Int Ai; - HYPRE_Int vi; - - HYPRE_Real *Ap; - HYPRE_Real *vxp; - HYPRE_Real *vyp; - HYPRE_Real *vzp; - HYPRE_Real lambdax; - HYPRE_Real lambday; - HYPRE_Real lambdaz; - HYPRE_Real lambda_max; - - hypre_StructStencil *stencil; - hypre_Index *stencil_shape; - HYPRE_Int stencil_size; - - HYPRE_Int Astenc; - - hypre_Index loop_size; - hypre_Index cindex; - hypre_IndexRef start; - hypre_Index startv; - hypre_Index stride; - hypre_Index stridev; - - HYPRE_Int i, si, dir, k, l; - - /*---------------------------------------------------------- - * Initialize some things - *----------------------------------------------------------*/ - - stencil = hypre_StructMatrixStencil(A); - stencil_shape = hypre_StructStencilShape(stencil); - stencil_size = hypre_StructStencilSize(stencil); - - /*----------------------------------------------------- - * Compute encoding digit and strides - *-----------------------------------------------------*/ - - hypre_SetIndex3(stride, 1, 1, 1); - - l = lx + ly + lz; - if ((l >= 1) && (l <= jump)) - { - k = 1 >> l; - hypre_SetIndex3(stridev, (1 >> lx), (1 >> ly), (1 >> lz)); - } - else - { - k = 1; - hypre_SetIndex3(stridev, 1, 1, 1); - - hypre_StructVectorSetConstantValues(visitx, 0.0); - hypre_StructVectorSetConstantValues(visity, 0.0); - hypre_StructVectorSetConstantValues(visitz, 0.0); - } - - /*----------------------------------------------------- - * Compute visit vectors - *-----------------------------------------------------*/ - - hypre_SetIndex3(cindex, 0, 0, 0); - - compute_boxes = hypre_StructGridBoxes(hypre_StructMatrixGrid(A)); - hypre_ForBoxI(i, compute_boxes) - { - compute_box = hypre_BoxArrayBox(compute_boxes, i); - - A_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A), i); - v_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(visitx), i); - - vxp = hypre_StructVectorBoxData(visitx, i); - vyp = hypre_StructVectorBoxData(visity, i); - vzp = hypre_StructVectorBoxData(visitz, i); - - start = hypre_BoxIMin(compute_box); - hypre_StructMapCoarseToFine(start, cindex, stridev, startv); - hypre_BoxGetSize(compute_box, loop_size); - - hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, - A_dbox, start, stride, Ai, - v_dbox, startv, stridev, vi); - { - HYPRE_Real lambdax = 0.0; - HYPRE_Real lambday = 0.0; - HYPRE_Real lambdaz = 0.0; - HYPRE_Int si, dir, Astenc; - HYPRE_Real *Ap, lambda_max; - - for (si = 0; si < stencil_size; si++) - { - Ap = hypre_StructMatrixBoxData(A, i, si); - - /* compute lambdax */ - Astenc = hypre_IndexD(stencil_shape[si], 0); - if (Astenc == 0) - { - lambdax += Ap[Ai]; - } - else - { - lambdax -= Ap[Ai]; - } - - /* compute lambday */ - Astenc = hypre_IndexD(stencil_shape[si], 1); - if (Astenc == 0) - { - lambday += Ap[Ai]; - } - else - { - lambday -= Ap[Ai]; - } - - /* compute lambdaz */ - Astenc = hypre_IndexD(stencil_shape[si], 2); - if (Astenc == 0) - { - lambdaz += Ap[Ai]; - } - else - { - lambdaz -= Ap[Ai]; - } - } - - lambdax *= lambdax; - lambday *= lambday; - lambdaz *= lambdaz; - - lambda_max = 0; - dir = -1; - if ((lx < num_grids[0] - 1) && (lambdax > lambda_max)) - { - lambda_max = lambdax; - dir = 0; - } - if ((ly < num_grids[1] - 1) && (lambday > lambda_max)) - { - lambda_max = lambday; - dir = 1; - } - if ((lz < num_grids[2] - 1) && (lambdaz > lambda_max)) - { - lambda_max = lambdaz; - dir = 2; - } - - if (dir == 0) - { - vxp[vi] = (HYPRE_Real) ( ((HYPRE_Int) vxp[vi]) | k ); - } - else if (dir == 1) - { - vyp[vi] = (HYPRE_Real) ( ((HYPRE_Int) vyp[vi]) | k ); - } - else if (dir == 2) - { - vzp[vi] = (HYPRE_Real) ( ((HYPRE_Int) vzp[vi]) | k ); - } - } - hypre_BoxLoop2End(Ai, vi); - } - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGFilter - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_SparseMSGFilter( hypre_StructVector *visit, - hypre_StructVector *e, - HYPRE_Int lx, - HYPRE_Int ly, - HYPRE_Int lz, - HYPRE_Int jump ) -{ - HYPRE_Int ierr = 0; - - hypre_BoxArray *compute_boxes; - hypre_Box *compute_box; - - hypre_Box *e_dbox; - hypre_Box *v_dbox; - - HYPRE_Int ei; - HYPRE_Int vi; - - HYPRE_Real *ep; - HYPRE_Real *vp; - - hypre_Index loop_size; - hypre_Index cindex; - hypre_IndexRef start; - hypre_Index startv; - hypre_Index stride; - hypre_Index stridev; - - HYPRE_Int i, k, l; - - /*----------------------------------------------------- - * Compute encoding digit and strides - *-----------------------------------------------------*/ - - hypre_SetIndex3(stride, 1, 1, 1); - - l = lx + ly + lz; - if ((l >= 1) && (l <= jump)) - { - k = 1 >> l; - hypre_SetIndex3(stridev, (1 >> lx), (1 >> ly), (1 >> lz)); - } - else - { - k = 1; - hypre_SetIndex3(stridev, 1, 1, 1); - } - - /*----------------------------------------------------- - * Filter interpolated error - *-----------------------------------------------------*/ - - hypre_SetIndex3(cindex, 0, 0, 0); - - compute_boxes = hypre_StructGridBoxes(hypre_StructVectorGrid(e)); - hypre_ForBoxI(i, compute_boxes) - { - compute_box = hypre_BoxArrayBox(compute_boxes, i); - - e_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(e), i); - v_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(visit), i); - - ep = hypre_StructVectorBoxData(e, i); - vp = hypre_StructVectorBoxData(visit, i); - - start = hypre_BoxIMin(compute_box); - hypre_StructMapCoarseToFine(start, cindex, stridev, startv); - hypre_BoxGetSize(compute_box, loop_size); - - hypre_BoxLoop2Begin(hypre_StructVectorNDim(e), loop_size, - e_dbox, start, stride, ei, - v_dbox, startv, stridev, vi); - { - if ( !(((HYPRE_Int) vp[vi]) & k) ) - { - ep[ei] = 0.0; - } - } - hypre_BoxLoop2End(ei, vi); - } - - return ierr; -} - -#else - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGFilterSetup - *--------------------------------------------------------------------------*/ - -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_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; - hypre_Box *compute_box; - - hypre_Box *A_dbox; - hypre_Box *v_dbox; - - HYPRE_Real *vxp; - HYPRE_Real *vyp; - HYPRE_Real *vzp; - - hypre_StructStencil *stencil; - hypre_Index *stencil_shape; - HYPRE_Int stencil_size; - - hypre_Index loop_size; - hypre_Index cindex; - hypre_IndexRef start; - hypre_Index startv; - hypre_Index stride; - hypre_Index stridev; - HYPRE_Int i; - HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(A); - - /*---------------------------------------------------------- - * Initialize some things - *----------------------------------------------------------*/ - - stencil = hypre_StructMatrixStencil(A); - stencil_shape = hypre_StructStencilShape(stencil); - stencil_size = hypre_StructStencilSize(stencil); - - /*----------------------------------------------------- - * Compute encoding digit and strides - *-----------------------------------------------------*/ - - hypre_SetIndex3(stride, 1, 1, 1); - hypre_SetIndex3(stridev, 1, 1, 1); - - /*----------------------------------------------------- - * Compute visit vectors - *-----------------------------------------------------*/ - - hypre_SetIndex3(cindex, 0, 0, 0); - - compute_boxes = hypre_StructGridBoxes(hypre_StructMatrixGrid(A)); - - HYPRE_Int **data_indices = hypre_StructMatrixDataIndices(A); - HYPRE_Complex *matrixA_data = hypre_StructMatrixData(A); - HYPRE_Int *data_indices_d; /* On device */ - hypre_Index *stencil_shape_d; - - 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, 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]; - stencil_shape_d = stencil_shape; - } - - hypre_ForBoxI(i, compute_boxes) - { - compute_box = hypre_BoxArrayBox(compute_boxes, i); - - A_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A), i); - v_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(visitx), i); - - vxp = hypre_StructVectorBoxData(visitx, i); - vyp = hypre_StructVectorBoxData(visity, i); - vzp = hypre_StructVectorBoxData(visitz, i); - - start = hypre_BoxIMin(compute_box); - hypre_StructMapCoarseToFine(start, cindex, stridev, startv); - hypre_BoxGetSize(compute_box, loop_size); - -#define DEVICE_VAR is_device_ptr(stencil_shape_d,vxp,vyp,vzp,data_indices_d,matrixA_data) - hypre_BoxLoop2Begin(hypre_StructMatrixNDim(A), loop_size, - A_dbox, start, stride, Ai, - v_dbox, startv, stridev, vi); - { - HYPRE_Real lambdax, lambday, lambdaz; - HYPRE_Real *Ap; - HYPRE_Int si, Astenc; - - lambdax = 0.0; - lambday = 0.0; - lambdaz = 0.0; - - for (si = 0; si < stencil_size; si++) - { - Ap = matrixA_data + data_indices_d[i * stencil_size + si]; - - /* compute lambdax */ - Astenc = hypre_IndexD(stencil_shape_d[si], 0); - if (Astenc == 0) - { - lambdax += Ap[Ai]; - } - else - { - lambdax -= Ap[Ai]; - } - - /* compute lambday */ - Astenc = hypre_IndexD(stencil_shape_d[si], 1); - if (Astenc == 0) - { - lambday += Ap[Ai]; - } - else - { - lambday -= Ap[Ai]; - } - - /* compute lambdaz */ - Astenc = hypre_IndexD(stencil_shape_d[si], 2); - if (Astenc == 0) - { - lambdaz += Ap[Ai]; - } - else - { - lambdaz -= Ap[Ai]; - } - } - - lambdax *= lambdax; - lambday *= lambday; - lambdaz *= lambdaz; - - vxp[vi] = lambdax / (lambdax + lambday + lambdaz); - vyp[vi] = lambday / (lambdax + lambday + lambdaz); - vzp[vi] = lambdaz / (lambdax + lambday + lambdaz); - } - hypre_BoxLoop2End(Ai, vi); -#undef DEVICE_VAR - } - - if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) - { - hypre_TFree(data_indices_d, memory_location); - hypre_TFree(stencil_shape_d, memory_location); - } - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGFilter - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_SparseMSGFilter( hypre_StructVector *visit, - hypre_StructVector *e, - HYPRE_Int lx, - HYPRE_Int ly, - 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; - hypre_Box *compute_box; - - hypre_Box *e_dbox; - hypre_Box *v_dbox; - - HYPRE_Real *ep; - HYPRE_Real *vp; - - hypre_Index loop_size; - hypre_Index cindex; - hypre_IndexRef start; - hypre_Index startv; - hypre_Index stride; - hypre_Index stridev; - - HYPRE_Int i; - - /*----------------------------------------------------- - * Compute encoding digit and strides - *-----------------------------------------------------*/ - - hypre_SetIndex3(stride, 1, 1, 1); - hypre_SetIndex3(stridev, 1, 1, 1); - - /*----------------------------------------------------- - * Filter interpolated error - *-----------------------------------------------------*/ - - hypre_SetIndex3(cindex, 0, 0, 0); - - compute_boxes = hypre_StructGridBoxes(hypre_StructVectorGrid(e)); - hypre_ForBoxI(i, compute_boxes) - { - compute_box = hypre_BoxArrayBox(compute_boxes, i); - - e_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(e), i); - v_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(visit), i); - - ep = hypre_StructVectorBoxData(e, i); - vp = hypre_StructVectorBoxData(visit, i); - - start = hypre_BoxIMin(compute_box); - hypre_StructMapCoarseToFine(start, cindex, stridev, startv); - hypre_BoxGetSize(compute_box, loop_size); - -#define DEVICE_VAR is_device_ptr(ep,vp) - hypre_BoxLoop2Begin(hypre_StructVectorNDim(e), loop_size, - e_dbox, start, stride, ei, - v_dbox, startv, stridev, vi); - { - ep[ei] *= vp[vi]; - } - hypre_BoxLoop2End(ei, vi); -#undef DEVICE_VAR - } - - return ierr; -} - -#endif diff --git a/src/struct_ls/sparse_msg_interp.c b/src/struct_ls/sparse_msg_interp.c deleted file mode 100644 index b8197038b1..0000000000 --- a/src/struct_ls/sparse_msg_interp.c +++ /dev/null @@ -1,298 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_ls.h" -#include "_hypre_struct_mv.hpp" - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGInterpData data structure - *--------------------------------------------------------------------------*/ - -typedef struct -{ - hypre_StructMatrix *P; - hypre_ComputePkg *compute_pkg; - hypre_Index cindex; - hypre_Index findex; - hypre_Index stride; - hypre_Index strideP; - - HYPRE_Int time_index; - -} hypre_SparseMSGInterpData; - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGInterpCreate - *--------------------------------------------------------------------------*/ - -void * -hypre_SparseMSGInterpCreate( void ) -{ - hypre_SparseMSGInterpData *interp_data; - - interp_data = hypre_CTAlloc(hypre_SparseMSGInterpData, 1, HYPRE_MEMORY_HOST); - (interp_data -> time_index) = hypre_InitializeTiming("SparseMSGInterp"); - - return (void *) interp_data; -} - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGInterpSetup - *--------------------------------------------------------------------------*/ - -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_UNUSED_VAR(xc); - - hypre_SparseMSGInterpData *interp_data = (hypre_SparseMSGInterpData *)interp_vdata; - - hypre_StructGrid *grid; - hypre_StructStencil *stencil; - - hypre_ComputeInfo *compute_info; - hypre_ComputePkg *compute_pkg; - - HYPRE_Int ierr = 0; - - /*---------------------------------------------------------- - * Set up the compute package - *----------------------------------------------------------*/ - - grid = hypre_StructVectorGrid(e); - stencil = hypre_StructMatrixStencil(P); - - hypre_CreateComputeInfo(grid, stencil, &compute_info); - hypre_ComputeInfoProjectSend(compute_info, cindex, stride); - hypre_ComputeInfoProjectRecv(compute_info, cindex, stride); - hypre_ComputeInfoProjectComp(compute_info, findex, stride); - hypre_ComputePkgCreate(compute_info, hypre_StructVectorDataSpace(e), 1, - grid, &compute_pkg); - - /*---------------------------------------------------------- - * Set up the interp data structure - *----------------------------------------------------------*/ - - (interp_data -> P) = hypre_StructMatrixRef(P); - (interp_data -> compute_pkg) = compute_pkg; - hypre_CopyIndex(cindex, (interp_data -> cindex)); - hypre_CopyIndex(findex, (interp_data -> findex)); - hypre_CopyIndex(stride, (interp_data -> stride)); - hypre_CopyIndex(strideP, (interp_data -> strideP)); - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGInterp: - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_SparseMSGInterp( void *interp_vdata, - hypre_StructMatrix *P, - hypre_StructVector *xc, - hypre_StructVector *e ) -{ - HYPRE_Int ierr = 0; - - hypre_SparseMSGInterpData *interp_data = (hypre_SparseMSGInterpData *)interp_vdata; - - hypre_ComputePkg *compute_pkg; - hypre_IndexRef cindex; - hypre_IndexRef findex; - hypre_IndexRef stride; - hypre_IndexRef strideP; - - hypre_StructGrid *fgrid; - HYPRE_Int *fgrid_ids; - hypre_StructGrid *cgrid; - hypre_BoxArray *cgrid_boxes; - HYPRE_Int *cgrid_ids; - - hypre_CommHandle *comm_handle; - - hypre_BoxArrayArray *compute_box_aa; - hypre_BoxArray *compute_box_a; - hypre_Box *compute_box; - - hypre_Box *P_dbox; - hypre_Box *xc_dbox; - hypre_Box *e_dbox; - - HYPRE_Real *Pp0, *Pp1; - HYPRE_Real *xcp; - HYPRE_Real *ep, *ep0, *ep1; - - hypre_Index loop_size; - hypre_Index start; - hypre_Index startc; - hypre_Index startP; - hypre_Index stridec; - - hypre_StructStencil *stencil; - hypre_Index *stencil_shape; - - HYPRE_Int compute_i, fi, ci, j; - - /*----------------------------------------------------------------------- - * Initialize some things - *-----------------------------------------------------------------------*/ - - hypre_BeginTiming(interp_data -> time_index); - - compute_pkg = (interp_data -> compute_pkg); - cindex = (interp_data -> cindex); - findex = (interp_data -> findex); - stride = (interp_data -> stride); - strideP = (interp_data -> strideP); - - stencil = hypre_StructMatrixStencil(P); - stencil_shape = hypre_StructStencilShape(stencil); - - hypre_SetIndex3(stridec, 1, 1, 1); - - /*----------------------------------------------------------------------- - * Compute e at coarse points (injection) - *-----------------------------------------------------------------------*/ - - fgrid = hypre_StructVectorGrid(e); - fgrid_ids = hypre_StructGridIDs(fgrid); - cgrid = hypre_StructVectorGrid(xc); - cgrid_boxes = hypre_StructGridBoxes(cgrid); - cgrid_ids = hypre_StructGridIDs(cgrid); - - fi = 0; - hypre_ForBoxI(ci, cgrid_boxes) - { - while (fgrid_ids[fi] != cgrid_ids[ci]) - { - fi++; - } - - compute_box = hypre_BoxArrayBox(cgrid_boxes, ci); - - hypre_CopyIndex(hypre_BoxIMin(compute_box), startc); - hypre_StructMapCoarseToFine(startc, cindex, stride, start); - - e_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(e), fi); - xc_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(xc), ci); - - ep = hypre_StructVectorBoxData(e, fi); - xcp = hypre_StructVectorBoxData(xc, ci); - - hypre_BoxGetSize(compute_box, loop_size); - -#define DEVICE_VAR is_device_ptr(ep,xcp) - hypre_BoxLoop2Begin(hypre_StructMatrixNDim(P), loop_size, - e_dbox, start, stride, ei, - xc_dbox, startc, stridec, xci); - { - ep[ei] = xcp[xci]; - } - hypre_BoxLoop2End(ei, xci); -#undef DEVICE_VAR - } - - /*----------------------------------------------------------------------- - * Compute e at fine points - *-----------------------------------------------------------------------*/ - - for (compute_i = 0; compute_i < 2; compute_i++) - { - switch (compute_i) - { - case 0: - { - ep = hypre_StructVectorData(e); - hypre_InitializeIndtComputations(compute_pkg, ep, &comm_handle); - compute_box_aa = hypre_ComputePkgIndtBoxes(compute_pkg); - } - break; - - case 1: - { - hypre_FinalizeIndtComputations(comm_handle); - compute_box_aa = hypre_ComputePkgDeptBoxes(compute_pkg); - } - break; - } - - hypre_ForBoxArrayI(fi, compute_box_aa) - { - compute_box_a = hypre_BoxArrayArrayBoxArray(compute_box_aa, fi); - - P_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(P), fi); - e_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(e), fi); - - Pp0 = hypre_StructMatrixBoxData(P, fi, 0); - Pp1 = hypre_StructMatrixBoxData(P, fi, 1); - ep = hypre_StructVectorBoxData(e, fi); - ep0 = ep + hypre_BoxOffsetDistance(e_dbox, stencil_shape[0]); - ep1 = ep + hypre_BoxOffsetDistance(e_dbox, stencil_shape[1]); - - hypre_ForBoxI(j, compute_box_a) - { - compute_box = hypre_BoxArrayBox(compute_box_a, j); - - hypre_CopyIndex(hypre_BoxIMin(compute_box), start); - hypre_StructMapFineToCoarse(start, findex, stride, startc); - hypre_StructMapCoarseToFine(startc, cindex, strideP, startP); - - hypre_BoxGetStrideSize(compute_box, stride, loop_size); - -#define DEVICE_VAR is_device_ptr(ep,Pp0,ep0,Pp1,ep1) - hypre_BoxLoop2Begin(hypre_StructMatrixNDim(P), loop_size, - P_dbox, startP, strideP, Pi, - e_dbox, start, stride, ei); - { - ep[ei] = (Pp0[Pi] * ep0[ei] + - Pp1[Pi] * ep1[ei]); - } - hypre_BoxLoop2End(Pi, ei); -#undef DEVICE_VAR - } - } - } - - /*----------------------------------------------------------------------- - * Return - *-----------------------------------------------------------------------*/ - - hypre_IncFLOPCount(3 * hypre_StructVectorGlobalSize(xc)); - hypre_EndTiming(interp_data -> time_index); - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGInterpDestroy - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_SparseMSGInterpDestroy( void *interp_vdata ) -{ - HYPRE_Int ierr = 0; - - hypre_SparseMSGInterpData *interp_data = (hypre_SparseMSGInterpData *)interp_vdata; - - if (interp_data) - { - hypre_StructMatrixDestroy(interp_data -> P); - hypre_ComputePkgDestroy(interp_data -> compute_pkg); - hypre_FinalizeTiming(interp_data -> time_index); - hypre_TFree(interp_data, HYPRE_MEMORY_HOST); - } - - return ierr; -} diff --git a/src/struct_ls/sparse_msg_restrict.c b/src/struct_ls/sparse_msg_restrict.c deleted file mode 100644 index f56352692b..0000000000 --- a/src/struct_ls/sparse_msg_restrict.c +++ /dev/null @@ -1,269 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_ls.h" -#include "_hypre_struct_mv.hpp" - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGRestrictData data structure - *--------------------------------------------------------------------------*/ - -typedef struct -{ - hypre_StructMatrix *R; - hypre_ComputePkg *compute_pkg; - hypre_Index cindex; - hypre_Index stride; - hypre_Index strideR; - - HYPRE_Int time_index; - -} hypre_SparseMSGRestrictData; - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGRestrictCreate - *--------------------------------------------------------------------------*/ - -void * -hypre_SparseMSGRestrictCreate( void ) -{ - hypre_SparseMSGRestrictData *restrict_data; - - restrict_data = hypre_CTAlloc(hypre_SparseMSGRestrictData, 1, HYPRE_MEMORY_HOST); - - (restrict_data -> time_index) = hypre_InitializeTiming("SparseMSGRestrict"); - - return (void *) restrict_data; -} - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGRestrictSetup - *--------------------------------------------------------------------------*/ - -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_UNUSED_VAR(rc); - - hypre_SparseMSGRestrictData *restrict_data = (hypre_SparseMSGRestrictData *)restrict_vdata; - - hypre_StructGrid *grid; - hypre_StructStencil *stencil; - - hypre_ComputeInfo *compute_info; - hypre_ComputePkg *compute_pkg; - - HYPRE_Int ierr = 0; - - /*---------------------------------------------------------- - * Set up the compute package - *----------------------------------------------------------*/ - - grid = hypre_StructVectorGrid(r); - stencil = hypre_StructMatrixStencil(R); - - hypre_CreateComputeInfo(grid, stencil, &compute_info); - hypre_ComputeInfoProjectSend(compute_info, findex, stride); - hypre_ComputeInfoProjectRecv(compute_info, findex, stride); - hypre_ComputeInfoProjectComp(compute_info, cindex, stride); - hypre_ComputePkgCreate(compute_info, hypre_StructVectorDataSpace(r), 1, - grid, &compute_pkg); - - /*---------------------------------------------------------- - * Set up the restrict data structure - *----------------------------------------------------------*/ - - (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)); - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGRestrict: - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_SparseMSGRestrict( void *restrict_vdata, - hypre_StructMatrix *R, - hypre_StructVector *r, - hypre_StructVector *rc ) -{ - HYPRE_Int ierr = 0; - - hypre_SparseMSGRestrictData *restrict_data = (hypre_SparseMSGRestrictData *)restrict_vdata; - - hypre_ComputePkg *compute_pkg; - hypre_IndexRef cindex; - hypre_IndexRef stride; - hypre_IndexRef strideR; - - hypre_StructGrid *fgrid; - HYPRE_Int *fgrid_ids; - hypre_StructGrid *cgrid; - hypre_BoxArray *cgrid_boxes; - HYPRE_Int *cgrid_ids; - - hypre_CommHandle *comm_handle; - - hypre_BoxArrayArray *compute_box_aa; - hypre_BoxArray *compute_box_a; - hypre_Box *compute_box; - - hypre_Box *R_dbox; - hypre_Box *r_dbox; - hypre_Box *rc_dbox; - - HYPRE_Real *Rp0, *Rp1; - HYPRE_Real *rp, *rp0, *rp1; - HYPRE_Real *rcp; - - hypre_Index loop_size; - hypre_IndexRef start; - hypre_Index startc; - hypre_Index startR; - hypre_Index stridec; - - hypre_StructStencil *stencil; - hypre_Index *stencil_shape; - - HYPRE_Int compute_i, fi, ci, j; - - /*----------------------------------------------------------------------- - * Initialize some things. - *-----------------------------------------------------------------------*/ - - hypre_BeginTiming(restrict_data -> time_index); - - compute_pkg = (restrict_data -> compute_pkg); - cindex = (restrict_data -> cindex); - stride = (restrict_data -> stride); - strideR = (restrict_data -> strideR); - - stencil = hypre_StructMatrixStencil(R); - stencil_shape = hypre_StructStencilShape(stencil); - - hypre_SetIndex3(stridec, 1, 1, 1); - - /*-------------------------------------------------------------------- - * Restrict the residual. - *--------------------------------------------------------------------*/ - - fgrid = hypre_StructVectorGrid(r); - fgrid_ids = hypre_StructGridIDs(fgrid); - cgrid = hypre_StructVectorGrid(rc); - cgrid_boxes = hypre_StructGridBoxes(cgrid); - cgrid_ids = hypre_StructGridIDs(cgrid); - - for (compute_i = 0; compute_i < 2; compute_i++) - { - switch (compute_i) - { - case 0: - { - rp = hypre_StructVectorData(r); - hypre_InitializeIndtComputations(compute_pkg, rp, &comm_handle); - compute_box_aa = hypre_ComputePkgIndtBoxes(compute_pkg); - } - break; - - case 1: - { - hypre_FinalizeIndtComputations(comm_handle); - compute_box_aa = hypre_ComputePkgDeptBoxes(compute_pkg); - } - break; - } - - fi = 0; - hypre_ForBoxI(ci, cgrid_boxes) - { - while (fgrid_ids[fi] != cgrid_ids[ci]) - { - fi++; - } - - compute_box_a = hypre_BoxArrayArrayBoxArray(compute_box_aa, fi); - - R_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(R), fi); - r_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(r), fi); - rc_dbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(rc), ci); - - Rp0 = hypre_StructMatrixBoxData(R, fi, 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]); - rp1 = rp + hypre_BoxOffsetDistance(r_dbox, stencil_shape[1]); - rcp = hypre_StructVectorBoxData(rc, ci); - - hypre_ForBoxI(j, compute_box_a) - { - compute_box = hypre_BoxArrayBox(compute_box_a, j); - - start = hypre_BoxIMin(compute_box); - hypre_StructMapFineToCoarse(start, cindex, stride, startc); - hypre_StructMapCoarseToFine(startc, cindex, strideR, startR); - - hypre_BoxGetStrideSize(compute_box, stride, loop_size); - -#define DEVICE_VAR is_device_ptr(rcp,rp,Rp0,rp0,Rp1,rp1) - hypre_BoxLoop3Begin(hypre_StructMatrixNDim(R), loop_size, - R_dbox, startR, strideR, Ri, - r_dbox, start, stride, ri, - rc_dbox, startc, stridec, rci); - { - rcp[rci] = rp[ri] + (Rp0[Ri] * rp0[ri] + - Rp1[Ri] * rp1[ri]); - } - hypre_BoxLoop3End(Ri, ri, rci); -#undef DEVICE_VAR - } - } - } - - /*----------------------------------------------------------------------- - * Return - *-----------------------------------------------------------------------*/ - - hypre_IncFLOPCount(4 * hypre_StructVectorGlobalSize(rc)); - hypre_EndTiming(restrict_data -> time_index); - - return ierr; -} - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGRestrictDestroy - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_SparseMSGRestrictDestroy( void *restrict_vdata ) -{ - HYPRE_Int ierr = 0; - - hypre_SparseMSGRestrictData *restrict_data = (hypre_SparseMSGRestrictData *)restrict_vdata; - - if (restrict_data) - { - hypre_StructMatrixDestroy(restrict_data -> R); - hypre_ComputePkgDestroy(restrict_data -> compute_pkg); - hypre_FinalizeTiming(restrict_data -> time_index); - hypre_TFree(restrict_data, HYPRE_MEMORY_HOST); - } - - return ierr; -} diff --git a/src/struct_ls/sparse_msg_setup.c b/src/struct_ls/sparse_msg_setup.c deleted file mode 100644 index d8f1fa45c0..0000000000 --- a/src/struct_ls/sparse_msg_setup.c +++ /dev/null @@ -1,833 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_ls.h" -#include "sparse_msg.h" - -#define DEBUG 0 - -#define GRID 0 - -#define hypre_SparseMSGSetCIndex(cdir, cindex) \ - { \ - hypre_SetIndex3(cindex, 0, 0, 0); \ - hypre_IndexD(cindex, cdir) = 0; \ - } - -#define hypre_SparseMSGSetFIndex(cdir, findex) \ - { \ - hypre_SetIndex3(findex, 0, 0, 0); \ - hypre_IndexD(findex, cdir) = 1; \ - } - -#define hypre_SparseMSGSetStride(cdir, stride) \ - { \ - hypre_SetIndex3(stride, 1, 1, 1); \ - hypre_IndexD(stride, cdir) = 2; \ - } - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGSetup - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_SparseMSGSetup( void *smsg_vdata, - hypre_StructMatrix *A, - hypre_StructVector *b, - hypre_StructVector *x ) -{ - 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_Real jacobi_weight = (smsg_data -> jacobi_weight); - HYPRE_Int *num_grids = (smsg_data -> num_grids); - HYPRE_Int num_all_grids; - HYPRE_Int num_levels; - - hypre_StructGrid **grid_a; - 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; - hypre_StructMatrix **A_a; - hypre_StructMatrix **Px_a; - hypre_StructMatrix **Py_a; - hypre_StructMatrix **Pz_a; - hypre_StructMatrix **RTx_a; - hypre_StructMatrix **RTy_a; - hypre_StructMatrix **RTz_a; - hypre_StructVector **b_a; - hypre_StructVector **x_a; - - /* temp vectors */ - hypre_StructVector **t_a; - hypre_StructVector **r_a; - hypre_StructVector **e_a; - - hypre_StructVector **visitx_a; - hypre_StructVector **visity_a; - hypre_StructVector **visitz_a; - HYPRE_Int *grid_on; - - void **relax_a; - void **matvec_a; - void **restrictx_a; - void **restricty_a; - void **restrictz_a; - void **interpx_a; - void **interpy_a; - void **interpz_a; - - hypre_Index cindex; - hypre_Index findex; - hypre_Index stride; - hypre_Index stridePR; - - hypre_StructGrid *grid; - HYPRE_Int dim; - 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 - - - /*----------------------------------------------------- - * Set up coarse grids - *-----------------------------------------------------*/ - - grid = hypre_StructMatrixGrid(A); - dim = hypre_StructGridNDim(grid); - - /* Determine num_grids[] and num_levels */ - num_levels = 1; - cbox = hypre_BoxDuplicate(hypre_StructGridBoundingBox(grid)); - for (d = 0; d < dim; d++) - { - while ( hypre_BoxIMaxD(cbox, d) > hypre_BoxIMinD(cbox, d) ) - { - /* set cindex, findex, and stride */ - hypre_SparseMSGSetCIndex(d, cindex); - hypre_SparseMSGSetFIndex(d, findex); - hypre_SparseMSGSetStride(d, stride); - - /* coarsen cbox */ - hypre_ProjectBox(cbox, cindex, stride); - hypre_StructMapFineToCoarse(hypre_BoxIMin(cbox), - cindex, stride, hypre_BoxIMin(cbox)); - hypre_StructMapFineToCoarse(hypre_BoxIMax(cbox), - cindex, stride, hypre_BoxIMax(cbox)); - - /* increment level counters */ - num_grids[d]++; - num_levels++; - } - } - -#if 0 - /* Restrict the semicoarsening to a particular direction */ - num_grids[1] = 1; - num_grids[2] = 1; - num_levels = num_grids[0]; -#endif - - /* Compute the num_all_grids based on num_grids[] */ - num_all_grids = num_grids[0] * num_grids[1] * num_grids[2]; - - /* Store some variables and clean up */ - hypre_BoxDestroy(cbox); - - (smsg_data -> num_all_grids) = num_all_grids; - (smsg_data -> num_levels) = num_levels; - - grid_a = hypre_TAlloc(hypre_StructGrid *, num_all_grids, HYPRE_MEMORY_HOST); - hypre_StructGridRef(grid, &grid_a[0]); - Px_grid_a = hypre_TAlloc(hypre_StructGrid *, num_grids[0], HYPRE_MEMORY_HOST); - Py_grid_a = hypre_TAlloc(hypre_StructGrid *, num_grids[1], HYPRE_MEMORY_HOST); - Pz_grid_a = hypre_TAlloc(hypre_StructGrid *, num_grids[2], HYPRE_MEMORY_HOST); - Px_grid_a[0] = NULL; - Py_grid_a[0] = NULL; - Pz_grid_a[0] = NULL; - - /*----------------------------------------- - * Compute coarse grids - *-----------------------------------------*/ - - if (num_levels > 1) - { - /* coarsen in x direction */ - hypre_SparseMSGSetCIndex(0, cindex); - hypre_SparseMSGSetStride(0, stride); - 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_StructCoarsen(grid_a[fi], cindex, stride, 1, - &grid_a[ci]); - } - - /* coarsen in y direction */ - hypre_SparseMSGSetCIndex(1, cindex); - hypre_SparseMSGSetStride(1, stride); - for (ly = 0; ly < num_grids[1] - 1; ly++) - { - 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_StructCoarsen(grid_a[fi], cindex, stride, 1, - &grid_a[ci]); - } - } - - /* coarsen in z direction */ - hypre_SparseMSGSetCIndex(2, cindex); - hypre_SparseMSGSetStride(2, stride); - for (lz = 0; lz < num_grids[2] - 1; lz++) - { - for (ly = 0; ly < num_grids[1]; ly++) - { - 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_StructCoarsen(grid_a[fi], cindex, stride, 1, - &grid_a[ci]); - } - } - } - } - - /*----------------------------------------- - * Compute interpolation grids - *-----------------------------------------*/ - - if (num_levels > 1) - { - /* coarsen in x direction */ - hypre_SparseMSGSetFIndex(0, findex); - hypre_SparseMSGSetStride(0, stride); - for (lx = 0; lx < num_grids[0] - 1; lx++) - { - hypre_SparseMSGMapIndex(lx, 0, 0, num_grids, fi); - hypre_StructCoarsen(grid_a[fi], findex, stride, 1, - &Px_grid_a[lx + 1]); - } - - /* coarsen in y direction */ - hypre_SparseMSGSetFIndex(1, findex); - hypre_SparseMSGSetStride(1, stride); - for (ly = 0; ly < num_grids[1] - 1; ly++) - { - hypre_SparseMSGMapIndex(0, ly, 0, num_grids, fi); - hypre_StructCoarsen(grid_a[fi], findex, stride, 1, - &Py_grid_a[ly + 1]); - } - - /* coarsen in z direction */ - hypre_SparseMSGSetFIndex(2, findex); - hypre_SparseMSGSetStride(2, stride); - for (lz = 0; lz < num_grids[2] - 1; lz++) - { - hypre_SparseMSGMapIndex(0, 0, lz, num_grids, fi); - hypre_StructCoarsen(grid_a[fi], findex, stride, 1, - &Pz_grid_a[lz + 1]); - } - } - - (smsg_data -> grid_array) = grid_a; - (smsg_data -> Px_grid_array) = Px_grid_a; - (smsg_data -> Py_grid_array) = Py_grid_a; - (smsg_data -> Pz_grid_array) = Pz_grid_a; - - /*------------------------------------------------------ - * Compute P, R, and A operators - * Compute visit arrays and turn grids off if possible - * - * Note: this is ordered to conserve memory - *-----------------------------------------------------*/ - - A_a = hypre_TAlloc(hypre_StructMatrix *, num_all_grids, HYPRE_MEMORY_HOST); - Px_a = hypre_TAlloc(hypre_StructMatrix *, num_grids[0] - 1, HYPRE_MEMORY_HOST); - Py_a = hypre_TAlloc(hypre_StructMatrix *, num_grids[1] - 1, HYPRE_MEMORY_HOST); - Pz_a = hypre_TAlloc(hypre_StructMatrix *, num_grids[2] - 1, HYPRE_MEMORY_HOST); - RTx_a = hypre_TAlloc(hypre_StructMatrix *, num_grids[0] - 1, HYPRE_MEMORY_HOST); - RTy_a = hypre_TAlloc(hypre_StructMatrix *, num_grids[1] - 1, HYPRE_MEMORY_HOST); - RTz_a = hypre_TAlloc(hypre_StructMatrix *, num_grids[2] - 1, HYPRE_MEMORY_HOST); - - visitx_a = hypre_CTAlloc(hypre_StructVector *, num_all_grids, HYPRE_MEMORY_HOST); - visity_a = hypre_CTAlloc(hypre_StructVector *, num_all_grids, HYPRE_MEMORY_HOST); - visitz_a = hypre_CTAlloc(hypre_StructVector *, num_all_grids, HYPRE_MEMORY_HOST); - grid_on = hypre_CTAlloc(HYPRE_Int, num_all_grids, HYPRE_MEMORY_HOST); - - - A_a[0] = hypre_StructMatrixRef(A); - - for (lz = 0; lz < num_grids[2]; lz++) - { - for (ly = 0; ly < num_grids[1]; ly++) - { - for (lx = 0; lx < num_grids[0]; lx++) - { - hypre_SparseMSGMapIndex(lx, ly, lz, num_grids, fi); - - /*------------------------------- - * create visit arrays - *-------------------------------*/ - - /* RDF */ -#if 0 - l = lx + ly + lz; - if ((l >= 1) && (l <= jump)) - { - visitx_a[fi] = visitx_a[0]; - visity_a[fi] = visity_a[0]; - visitz_a[fi] = visitz_a[0]; - } - else -#endif - /* RDF */ - { - visitx_a[fi] = hypre_StructVectorCreate(comm, grid_a[fi]); - visity_a[fi] = hypre_StructVectorCreate(comm, grid_a[fi]); - visitz_a[fi] = hypre_StructVectorCreate(comm, grid_a[fi]); - hypre_StructVectorSetNumGhost(visitx_a[fi], b_num_ghost); - hypre_StructVectorSetNumGhost(visity_a[fi], b_num_ghost); - hypre_StructVectorSetNumGhost(visitz_a[fi], b_num_ghost); - hypre_StructVectorInitialize(visitx_a[fi]); - hypre_StructVectorInitialize(visity_a[fi]); - hypre_StructVectorInitialize(visitz_a[fi]); - } - hypre_SparseMSGFilterSetup(A_a[fi], num_grids, lx, ly, lz, jump, - visitx_a[fi], - visity_a[fi], - visitz_a[fi]); -#if GRID - vx_dot_vx = hypre_StructInnerProd(visitx_a[fi], visitx_a[fi]); - vy_dot_vy = hypre_StructInnerProd(visity_a[fi], visity_a[fi]); - vz_dot_vz = hypre_StructInnerProd(visitz_a[fi], visitz_a[fi]); -#else - /* turn all grids on */ - grid_on[fi] = 1; -#endif - - /*------------------------------- - * compute Px, RTx, and A - *-------------------------------*/ - - if (lx < (num_grids[0] - 1)) - { - hypre_SparseMSGMapIndex(lx, ly, lz, num_grids, fi); - hypre_SparseMSGMapIndex((lx + 1), ly, lz, num_grids, ci); - - hypre_SparseMSGSetCIndex(0, cindex); - hypre_SparseMSGSetFIndex(0, findex); - hypre_SparseMSGSetStride(0, stride); - - /* compute x-transfer operator */ - if ((lz == 0) && (ly == 0)) - { - Px_a[lx] = hypre_PFMGCreateInterpOp(A_a[fi], - Px_grid_a[lx + 1], 0, 0); - hypre_StructMatrixInitialize(Px_a[lx]); - hypre_PFMGSetupInterpOp(A_a[fi], 0, findex, stride, - Px_a[lx], 0); - RTx_a[lx] = Px_a[lx]; - } - - /* compute coarse-operator with Px */ - A_a[ci] = - hypre_SparseMSGCreateRAPOp(RTx_a[lx], A_a[fi], Px_a[lx], - grid_a[ci], 0); - hypre_StructMatrixInitialize(A_a[ci]); - 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 */ -#if 0 - /* free up some coarse-operators to conserve memory */ - 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 */ - - /*------------------------------- - * compute Py, RTy, and A - *-------------------------------*/ - - if (ly < (num_grids[1] - 1)) - { - hypre_SparseMSGMapIndex(0, ly, lz, num_grids, fi); - hypre_SparseMSGMapIndex(0, (ly + 1), lz, num_grids, ci); - - hypre_SparseMSGSetCIndex(1, cindex); - hypre_SparseMSGSetFIndex(1, findex); - hypre_SparseMSGSetStride(1, stride); - - /* compute y-transfer operators */ - if (lz == 0) - { - Py_a[ly] = hypre_PFMGCreateInterpOp(A_a[fi], - Py_grid_a[ly + 1], 1, 0); - hypre_StructMatrixInitialize(Py_a[ly]); - hypre_PFMGSetupInterpOp(A_a[fi], 1, findex, stride, - Py_a[ly], 0); - RTy_a[ly] = Py_a[ly]; - } - - /* compute coarse-operator with Py */ - 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, hypre_pow2(lz)); - hypre_SparseMSGSetupRAPOp(RTy_a[ly], A_a[fi], Py_a[ly], - 1, cindex, stride, stridePR, A_a[ci]); - } - } - - /* RDF */ -#if 0 - /* free up some coarse-operators to conserve memory */ - 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 */ - - /*------------------------------- - * compute Pz, RTz, and A - *-------------------------------*/ - - if (lz < (num_grids[2] - 1)) - { - hypre_SparseMSGMapIndex(0, 0, lz, num_grids, fi); - 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); - hypre_StructMatrixInitialize(Pz_a[lz]); - hypre_PFMGSetupInterpOp(A_a[fi], 2, findex, stride, Pz_a[lz], 0); - RTz_a[lz] = Pz_a[lz]; - - /* compute coarse-operator with Pz */ - A_a[ci] = hypre_SparseMSGCreateRAPOp(RTz_a[lz], A_a[fi], Pz_a[lz], - grid_a[ci], 2); - hypre_StructMatrixInitialize(A_a[ci]); - hypre_SetIndex3(stridePR, 1, 1, 1); - hypre_SparseMSGSetupRAPOp(RTz_a[lz], A_a[fi], Pz_a[lz], - 2, cindex, stride, stridePR, A_a[ci]); - } - } - - /* RDF */ -#if 0 - /* free up some coarse-operators to conserve memory */ - 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 */ - - (smsg_data -> A_array) = A_a; - (smsg_data -> Px_array) = Px_a; - (smsg_data -> Py_array) = Py_a; - (smsg_data -> Pz_array) = Pz_a; - (smsg_data -> RTx_array) = RTx_a; - (smsg_data -> RTy_array) = RTy_a; - (smsg_data -> RTz_array) = RTz_a; - - (smsg_data -> visitx_array) = visitx_a; - (smsg_data -> visity_array) = visity_a; - (smsg_data -> visitz_array) = visitz_a; - (smsg_data -> grid_on) = grid_on; - - /*------------------------------------------------------ - * Set up vector structures - *-----------------------------------------------------*/ - - b_a = hypre_TAlloc(hypre_StructVector *, num_all_grids, HYPRE_MEMORY_HOST); - x_a = hypre_TAlloc(hypre_StructVector *, num_all_grids, HYPRE_MEMORY_HOST); - t_a = hypre_TAlloc(hypre_StructVector *, num_all_grids, HYPRE_MEMORY_HOST); - r_a = hypre_TAlloc(hypre_StructVector *, num_all_grids, HYPRE_MEMORY_HOST); - e_a = t_a; - - data_size = 0; - - b_a[0] = hypre_StructVectorRef(b); - x_a[0] = hypre_StructVectorRef(x); - - t_a[0] = hypre_StructVectorCreate(comm, grid_a[0]); - hypre_StructVectorSetNumGhost(t_a[0], x_num_ghost); - hypre_StructVectorInitializeShell(t_a[0]); - data_size += hypre_StructVectorDataSize(t_a[0]); - - r_a[0] = hypre_StructVectorCreate(comm, grid_a[0]); - hypre_StructVectorSetNumGhost(r_a[0], x_num_ghost); - hypre_StructVectorInitializeShell(r_a[0]); - data_size += hypre_StructVectorDataSize(r_a[0]); - - for (lz = 0; lz < num_grids[2]; lz++) - { - for (ly = 0; ly < num_grids[1]; ly++) - { - for (lx = 0; lx < num_grids[0]; lx++) - { - l = lx + ly + lz; - - if (l >= 1) - { - hypre_SparseMSGMapIndex(lx, ly, lz, num_grids, fi); - - x_a[fi] = hypre_StructVectorCreate(comm, grid_a[fi]); - hypre_StructVectorSetNumGhost(x_a[fi], x_num_ghost); - hypre_StructVectorInitializeShell(x_a[fi]); - data_size += hypre_StructVectorDataSize(x_a[fi]); - - t_a[fi] = hypre_StructVectorCreate(comm, grid_a[fi]); - hypre_StructVectorSetNumGhost(t_a[fi], x_num_ghost); - hypre_StructVectorInitializeShell(t_a[fi]); - - /* set vector structures in jump region */ - if (l <= jump) - { - b_a[fi] = x_a[fi]; - r_a[fi] = x_a[fi]; - } - - /* set vector structures outside of jump region */ - else - { - b_a[fi] = hypre_StructVectorCreate(comm, grid_a[fi]); - hypre_StructVectorSetNumGhost(b_a[fi], b_num_ghost); - hypre_StructVectorInitializeShell(b_a[fi]); - data_size += hypre_StructVectorDataSize(b_a[fi]); - - r_a[fi] = hypre_StructVectorCreate(comm, grid_a[fi]); - hypre_StructVectorSetNumGhost(r_a[fi], x_num_ghost); - hypre_StructVectorInitializeShell(r_a[fi]); - } - } - } - } - } - - 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]); - data += hypre_StructVectorDataSize(t_a[0]); - - hypre_StructVectorInitializeData(r_a[0], data); - hypre_StructVectorAssemble(r_a[0]); - data += hypre_StructVectorDataSize(r_a[0]); - - for (lz = 0; lz < num_grids[2]; lz++) - { - for (ly = 0; ly < num_grids[1]; ly++) - { - for (lx = 0; lx < num_grids[0]; lx++) - { - l = lx + ly + lz; - - if (l >= 1) - { - hypre_SparseMSGMapIndex(lx, ly, lz, num_grids, fi); - - hypre_StructVectorInitializeData(x_a[fi], data); - hypre_StructVectorAssemble(x_a[fi]); - data += hypre_StructVectorDataSize(x_a[fi]); - - tdata = hypre_StructVectorData(t_a[0]); - hypre_StructVectorInitializeData(t_a[fi], tdata); - - /* set vector structures outside of jump region */ - if (l > jump) - { - hypre_StructVectorInitializeData(b_a[fi], data); - hypre_StructVectorAssemble(b_a[fi]); - data += hypre_StructVectorDataSize(b_a[fi]); - - tdata = hypre_StructVectorData(r_a[0]); - hypre_StructVectorInitializeData(r_a[fi], tdata); - } - } - } - } - } - - (smsg_data -> b_array) = b_a; - (smsg_data -> x_array) = x_a; - (smsg_data -> t_array) = t_a; - (smsg_data -> r_array) = r_a; - (smsg_data -> e_array) = e_a; - - /*------------------------------------------------------ - * Call setup routines - *-----------------------------------------------------*/ - - relax_a = hypre_CTAlloc(void *, num_all_grids, HYPRE_MEMORY_HOST); - matvec_a = hypre_CTAlloc(void *, num_all_grids, HYPRE_MEMORY_HOST); - restrictx_a = hypre_CTAlloc(void *, num_all_grids, HYPRE_MEMORY_HOST); - restricty_a = hypre_CTAlloc(void *, num_all_grids, HYPRE_MEMORY_HOST); - restrictz_a = hypre_CTAlloc(void *, num_all_grids, HYPRE_MEMORY_HOST); - interpx_a = hypre_CTAlloc(void *, num_all_grids, HYPRE_MEMORY_HOST); - interpy_a = hypre_CTAlloc(void *, num_all_grids, HYPRE_MEMORY_HOST); - interpz_a = hypre_CTAlloc(void *, num_all_grids, HYPRE_MEMORY_HOST); - - /* set up x-transfer routines */ - for (lx = 0; lx < (num_grids[0] - 1); lx++) - { - hypre_SparseMSGSetCIndex(0, cindex); - hypre_SparseMSGSetFIndex(0, findex); - hypre_SparseMSGSetStride(0, stride); - - for (lz = 0; lz < num_grids[2]; lz++) - { - 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_SetIndex3(stridePR, 1, hypre_pow2(ly), hypre_pow2(lz)); - - interpx_a[fi] = hypre_SparseMSGInterpCreate(); - hypre_SparseMSGInterpSetup(interpx_a[fi], Px_a[lx], - x_a[ci], e_a[fi], - cindex, findex, stride, stridePR); - - restrictx_a[fi] = hypre_SparseMSGRestrictCreate(); - hypre_SparseMSGRestrictSetup(restrictx_a[fi], RTx_a[lx], - r_a[fi], b_a[ci], - cindex, findex, stride, stridePR); - } - } - } - - /* set up y-transfer routines */ - for (ly = 0; ly < (num_grids[1] - 1); ly++) - { - hypre_SparseMSGSetCIndex(1, cindex); - hypre_SparseMSGSetFIndex(1, findex); - hypre_SparseMSGSetStride(1, stride); - - for (lz = 0; lz < num_grids[2]; lz++) - { - 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_SetIndex3(stridePR, hypre_pow2(lx), 1, hypre_pow2(lz)); - - interpy_a[fi] = hypre_SparseMSGInterpCreate(); - hypre_SparseMSGInterpSetup(interpy_a[fi], Py_a[ly], - x_a[ci], e_a[fi], - cindex, findex, stride, stridePR); - - restricty_a[fi] = hypre_SparseMSGRestrictCreate(); - hypre_SparseMSGRestrictSetup(restricty_a[fi], RTy_a[ly], - r_a[fi], b_a[ci], - cindex, findex, stride, stridePR); - } - } - } - - /* set up z-transfer routines */ - for (lz = 0; lz < (num_grids[2] - 1); lz++) - { - hypre_SparseMSGSetCIndex(2, cindex); - hypre_SparseMSGSetFIndex(2, findex); - hypre_SparseMSGSetStride(2, stride); - - for (ly = 0; ly < num_grids[1]; ly++) - { - 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_SetIndex3(stridePR, hypre_pow2(lx), hypre_pow2(ly), 1); - - interpz_a[fi] = hypre_SparseMSGInterpCreate(); - hypre_SparseMSGInterpSetup(interpz_a[fi], Pz_a[lz], - x_a[ci], e_a[fi], - cindex, findex, stride, stridePR); - - restrictz_a[fi] = hypre_SparseMSGRestrictCreate(); - hypre_SparseMSGRestrictSetup(restrictz_a[fi], RTz_a[lz], - r_a[fi], b_a[ci], - cindex, findex, stride, stridePR); - } - } - } - - /* set up fine grid relaxation */ - relax_a[0] = hypre_PFMGRelaxCreate(comm); - hypre_PFMGRelaxSetTol(relax_a[0], 0.0); - hypre_PFMGRelaxSetType(relax_a[0], relax_type); - if (usr_jacobi_weight) - { - hypre_PFMGRelaxSetJacobiWeight(relax_a[0], jacobi_weight); - } - hypre_PFMGRelaxSetTempVec(relax_a[0], t_a[0]); - hypre_PFMGRelaxSetup(relax_a[0], A_a[0], b_a[0], x_a[0]); - /* set up the fine grid residual routine */ - matvec_a[0] = hypre_StructMatvecCreate(); - hypre_StructMatvecSetup(matvec_a[0], A_a[0], x_a[0]); - if (num_levels > 1) - { - for (lz = 0; lz < num_grids[2]; lz++) - { - for (ly = 0; ly < num_grids[1]; ly++) - { - for (lx = 0; lx < num_grids[0]; lx++) - { - l = lx + ly + lz; - - if ((l > jump) && (l < (num_levels - 1))) - { - hypre_SparseMSGMapIndex(lx, ly, lz, num_grids, fi); - - /* set up relaxation */ - relax_a[fi] = hypre_PFMGRelaxCreate(comm); - hypre_PFMGRelaxSetTol(relax_a[fi], 0.0); - hypre_PFMGRelaxSetType(relax_a[fi], relax_type); - if (usr_jacobi_weight) - { - hypre_PFMGRelaxSetJacobiWeight(relax_a[fi], jacobi_weight); - } - hypre_PFMGRelaxSetTempVec(relax_a[fi], t_a[fi]); - hypre_PFMGRelaxSetup(relax_a[fi], A_a[fi], b_a[fi], x_a[fi]); - - /* set up the residual routine */ - matvec_a[fi] = hypre_StructMatvecCreate(); - hypre_StructMatvecSetup(matvec_a[fi], A_a[fi], x_a[fi]); - } - } - } - } - /* set up coarsest grid relaxation */ - fi = num_all_grids - 1; - relax_a[fi] = hypre_PFMGRelaxCreate(comm); - hypre_PFMGRelaxSetTol(relax_a[fi], 0.0); - hypre_PFMGRelaxSetMaxIter(relax_a[fi], 1); - hypre_PFMGRelaxSetType(relax_a[fi], 0); - if (usr_jacobi_weight) - { - hypre_PFMGRelaxSetJacobiWeight(relax_a[fi], jacobi_weight); - } - hypre_PFMGRelaxSetTempVec(relax_a[fi], t_a[fi]); - hypre_PFMGRelaxSetup(relax_a[fi], A_a[fi], b_a[fi], x_a[fi]); - } - - (smsg_data -> relax_array) = relax_a; - (smsg_data -> matvec_array) = matvec_a; - (smsg_data -> restrictx_array) = restrictx_a; - (smsg_data -> restricty_array) = restricty_a; - (smsg_data -> restrictz_array) = restrictz_a; - (smsg_data -> interpx_array) = interpx_a; - (smsg_data -> interpy_array) = interpy_a; - (smsg_data -> interpz_array) = interpz_a; - - /*----------------------------------------------------- - * Allocate space for log info - *-----------------------------------------------------*/ - - if ((smsg_data -> logging) > 0) - { - max_iter = (smsg_data -> max_iter); - (smsg_data -> norms) = hypre_TAlloc(HYPRE_Real, max_iter, HYPRE_MEMORY_HOST); - (smsg_data -> rel_norms) = hypre_TAlloc(HYPRE_Real, max_iter, HYPRE_MEMORY_HOST); - } - -#if DEBUG - for (lz = 0; lz < num_grids[2]; lz++) - { - for (ly = 0; ly < num_grids[1]; ly++) - { - for (lx = 0; lx < num_grids[0]; lx++) - { - l = lx + ly + lz; - - if ((l == 0) || (l > jump)) - { - hypre_SparseMSGMapIndex(lx, ly, lz, num_grids, fi); - - hypre_sprintf(filename, "zoutSMSG_A.%d.%d.%d", lx, ly, lz); - hypre_StructMatrixPrint(filename, A_a[fi], 0); - - hypre_sprintf(filename, "zoutSMSG_visitx.%d.%d.%d", lx, ly, lz); - hypre_StructVectorPrint(filename, visitx_a[fi], 0); - hypre_sprintf(filename, "zoutSMSG_visity.%d.%d.%d", lx, ly, lz); - hypre_StructVectorPrint(filename, visity_a[fi], 0); - hypre_sprintf(filename, "zoutSMSG_visitz.%d.%d.%d", lx, ly, lz); - hypre_StructVectorPrint(filename, visitz_a[fi], 0); - } - } - } - } - for (lx = 0; lx < num_grids[0] - 1; lx++) - { - hypre_sprintf(filename, "zoutSMSG_Px.%d", lx); - hypre_StructMatrixPrint(filename, Px_a[lx], 0); - } - for (ly = 0; ly < num_grids[1] - 1; ly++) - { - hypre_sprintf(filename, "zoutSMSG_Py.%d", ly); - hypre_StructMatrixPrint(filename, Py_a[ly], 0); - } - for (lz = 0; lz < num_grids[2] - 1; lz++) - { - hypre_sprintf(filename, "zoutSMSG_Pz.%d", lz); - hypre_StructMatrixPrint(filename, Pz_a[lz], 0); - } -#endif - - return ierr; -} - diff --git a/src/struct_ls/sparse_msg_setup_rap.c b/src/struct_ls/sparse_msg_setup_rap.c deleted file mode 100644 index 45eb6e34b8..0000000000 --- a/src/struct_ls/sparse_msg_setup_rap.c +++ /dev/null @@ -1,113 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_ls.h" - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGCreateRAPOp - * - * Wrapper for 2 and 3d CreateRAPOp routines which set up new coarse - * grid structures. - *--------------------------------------------------------------------------*/ - -hypre_StructMatrix * -hypre_SparseMSGCreateRAPOp( hypre_StructMatrix *R, - hypre_StructMatrix *A, - hypre_StructMatrix *P, - hypre_StructGrid *coarse_grid, - HYPRE_Int cdir ) -{ - hypre_StructMatrix *RAP = NULL; - hypre_StructStencil *stencil; - - stencil = hypre_StructMatrixStencil(A); - - switch (hypre_StructStencilNDim(stencil)) - { - case 2: - RAP = hypre_SparseMSG2CreateRAPOp(R, A, P, coarse_grid, cdir); - break; - - case 3: - RAP = hypre_SparseMSG3CreateRAPOp(R, A, P, coarse_grid, cdir); - break; - } - - return RAP; -} - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGSetupRAPOp - * - * Wrapper for 2 and 3d, symmetric and non-symmetric routines to calculate - * entries in RAP. Incomplete error handling at the moment. - *--------------------------------------------------------------------------*/ - -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_Int ierr = 0; - - hypre_StructStencil *stencil; - - stencil = hypre_StructMatrixStencil(A); - - switch (hypre_StructStencilNDim(stencil)) - { - - case 2: - - /*-------------------------------------------------------------------- - * 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); - - break; - - case 3: - - /*-------------------------------------------------------------------- - * 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); - - break; - - } - - hypre_StructMatrixAssemble(Ac); - - return ierr; -} diff --git a/src/struct_ls/sparse_msg_solve.c b/src/struct_ls/sparse_msg_solve.c deleted file mode 100644 index 863374ae46..0000000000 --- a/src/struct_ls/sparse_msg_solve.c +++ /dev/null @@ -1,464 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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_ls.h" -#include "sparse_msg.h" - -#define DEBUG 0 - -/*-------------------------------------------------------------------------- - * hypre_SparseMSGSolve - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_SparseMSGSolve( void *smsg_vdata, - hypre_StructMatrix *A, - hypre_StructVector *b, - hypre_StructVector *x ) -{ - hypre_SparseMSGData *smsg_data = (hypre_SparseMSGData *)smsg_vdata; - - HYPRE_Real tol = (smsg_data -> tol); - HYPRE_Int max_iter = (smsg_data -> max_iter); - HYPRE_Int rel_change = (smsg_data -> rel_change); - HYPRE_Int zero_guess = (smsg_data -> zero_guess); - HYPRE_Int jump = (smsg_data -> jump); - HYPRE_Int num_pre_relax = (smsg_data -> num_pre_relax); - HYPRE_Int num_post_relax = (smsg_data -> num_post_relax); - HYPRE_Int num_fine_relax = (smsg_data -> num_fine_relax); - HYPRE_Int *num_grids = (smsg_data -> num_grids); - HYPRE_Int num_all_grids = (smsg_data -> num_all_grids); - HYPRE_Int num_levels = (smsg_data -> num_levels); - hypre_StructMatrix **A_array = (smsg_data -> A_array); - hypre_StructMatrix **Px_array = (smsg_data -> Px_array); - hypre_StructMatrix **Py_array = (smsg_data -> Py_array); - hypre_StructMatrix **Pz_array = (smsg_data -> Pz_array); - hypre_StructMatrix **RTx_array = (smsg_data -> RTx_array); - hypre_StructMatrix **RTy_array = (smsg_data -> RTy_array); - hypre_StructMatrix **RTz_array = (smsg_data -> RTz_array); - hypre_StructVector **b_array = (smsg_data -> b_array); - hypre_StructVector **x_array = (smsg_data -> x_array); - hypre_StructVector **t_array = (smsg_data -> t_array); - hypre_StructVector **r_array = (smsg_data -> r_array); - hypre_StructVector **e_array = (smsg_data -> e_array); - hypre_StructVector **visitx_array = (smsg_data -> visitx_array); - hypre_StructVector **visity_array = (smsg_data -> visity_array); - hypre_StructVector **visitz_array = (smsg_data -> visitz_array); - HYPRE_Int *grid_on = (smsg_data -> grid_on); - void **relax_array = (smsg_data -> relax_array); - void **matvec_array = (smsg_data -> matvec_array); - void **restrictx_array = (smsg_data -> restrictx_array); - void **restricty_array = (smsg_data -> restricty_array); - void **restrictz_array = (smsg_data -> restrictz_array); - void **interpx_array = (smsg_data -> interpx_array); - void **interpy_array = (smsg_data -> interpy_array); - void **interpz_array = (smsg_data -> interpz_array); - HYPRE_Int logging = (smsg_data -> logging); - HYPRE_Real *norms = (smsg_data -> norms); - HYPRE_Real *rel_norms = (smsg_data -> rel_norms); - - HYPRE_Int *restrict_count; - - 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 ierr = 0; - -#if DEBUG - char filename[255]; -#endif - - /*----------------------------------------------------- - * Initialize some things and deal with special cases - *-----------------------------------------------------*/ - - hypre_BeginTiming(smsg_data -> time_index); - - hypre_StructMatrixDestroy(A_array[0]); - hypre_StructVectorDestroy(b_array[0]); - hypre_StructVectorDestroy(x_array[0]); - A_array[0] = hypre_StructMatrixRef(A); - b_array[0] = hypre_StructVectorRef(b); - x_array[0] = hypre_StructVectorRef(x); - - (smsg_data -> num_iterations) = 0; - - /* if max_iter is zero, return */ - if (max_iter == 0) - { - /* if using a zero initial guess, return zero */ - if (zero_guess) - { - hypre_StructVectorSetConstantValues(x, 0.0); - } - - hypre_EndTiming(smsg_data -> time_index); - return ierr; - } - - /* part of convergence check */ - if (tol > 0.0) - { - /* eps = (tol^2) */ - b_dot_b = hypre_StructInnerProd(b_array[0], b_array[0]); - eps = tol * tol; - - /* if rhs is zero, return a zero solution */ - if (b_dot_b == 0.0) - { - hypre_StructVectorSetConstantValues(x, 0.0); - if (logging > 0) - { - norms[0] = 0.0; - rel_norms[0] = 0.0; - } - - hypre_EndTiming(smsg_data -> time_index); - return ierr; - } - } - - restrict_count = hypre_TAlloc(HYPRE_Int, num_all_grids, HYPRE_MEMORY_HOST); - - /*----------------------------------------------------- - * Do V-cycles: - * For each index l, "fine" = l, "coarse" = (l+1) - *-----------------------------------------------------*/ - - for (i = 0; i < max_iter; i++) - { - /*-------------------------------------------------- - * Down cycle: - * Note that r = b = x through the jump region - *--------------------------------------------------*/ - - /* fine grid pre-relaxation */ - hypre_PFMGRelaxSetPreRelax(relax_array[0]); - hypre_PFMGRelaxSetMaxIter(relax_array[0], num_fine_relax); - hypre_PFMGRelaxSetZeroGuess(relax_array[0], zero_guess); - hypre_PFMGRelax(relax_array[0], A_array[0], b_array[0], x_array[0]); - zero_guess = 0; - - /* compute fine grid residual (b - Ax) */ - hypre_StructCopy(b_array[0], r_array[0]); - hypre_StructMatvecCompute(matvec_array[0], - -1.0, A_array[0], x_array[0], 1.0, r_array[0]); - - /* convergence check */ - if (tol > 0.0) - { - r_dot_r = hypre_StructInnerProd(r_array[0], r_array[0]); - - if (logging > 0) - { - 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 */ -#if 0 - - 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 (rel_change) - { - if ((e_dot_e / x_dot_x) < eps) - { - break; - } - } - else - { - break; - } - } - } - - if (num_levels > 1) - { - /* initialize restrict_count */ - for (fi = 0; fi < num_all_grids; fi++) - { - restrict_count[fi] = 0; - } - - for (l = 0; l <= (num_levels - 2); l++) - { - lzmin = hypre_max((l - num_grids[1] - num_grids[0] + 2), 0); - lzmax = hypre_min((l), (num_grids[2] - 1)); - for (lz = lzmin; lz <= lzmax; lz++) - { - lymin = hypre_max((l - lz - num_grids[0] + 1), 0); - lymax = hypre_min((l - lz), (num_grids[1] - 1)); - for (ly = lymin; ly <= lymax; ly++) - { - lx = l - lz - ly; - - hypre_SparseMSGMapIndex(lx, ly, lz, num_grids, fi); - - if (!grid_on[fi]) - { - break; - } - - if (restrict_count[fi] > 1) - { - hypre_StructScale((1.0 / restrict_count[fi]), b_array[fi]); - } - - if (l > jump) - { - /* pre-relaxation */ - hypre_PFMGRelaxSetPreRelax(relax_array[fi]); - hypre_PFMGRelaxSetMaxIter(relax_array[fi], num_pre_relax); - hypre_PFMGRelaxSetZeroGuess(relax_array[fi], 1); - hypre_PFMGRelax(relax_array[fi], A_array[fi], b_array[fi], - x_array[fi]); - - /* compute residual (b - Ax) */ - hypre_StructCopy(b_array[fi], r_array[fi]); - hypre_StructMatvecCompute(matvec_array[fi], - -1.0, A_array[fi], x_array[fi], - 1.0, r_array[fi]); - } - - if ((lx + 1) < num_grids[0]) - { - /* restrict to ((lx+1), ly, lz) */ - hypre_SparseMSGMapIndex((lx + 1), ly, lz, num_grids, ci); - if (grid_on[ci]) - { - if (restrict_count[ci]) - { - hypre_SparseMSGRestrict(restrictx_array[fi], - RTx_array[lx], r_array[fi], - t_array[ci]); - hypre_StructAxpy(1.0, t_array[ci], b_array[ci]); - } - else - { - hypre_SparseMSGRestrict(restrictx_array[fi], - RTx_array[lx], r_array[fi], - b_array[ci]); - } - restrict_count[ci]++; - } - } - if ((ly + 1) < num_grids[1]) - { - /* restrict to (lx, (ly+1), lz) */ - hypre_SparseMSGMapIndex(lx, (ly + 1), lz, num_grids, ci); - if (grid_on[ci]) - { - if (restrict_count[ci]) - { - hypre_SparseMSGRestrict(restricty_array[fi], - RTy_array[ly], r_array[fi], - t_array[ci]); - hypre_StructAxpy(1.0, t_array[ci], b_array[ci]); - } - else - { - hypre_SparseMSGRestrict(restricty_array[fi], - RTy_array[ly], r_array[fi], - b_array[ci]); - } - restrict_count[ci]++; - } - } - if ((lz + 1) < num_grids[2]) - { - /* restrict to (lx, ly, (lz+1)) */ - hypre_SparseMSGMapIndex(lx, ly, (lz + 1), num_grids, ci); - if (grid_on[ci]) - { - if (restrict_count[ci]) - { - hypre_SparseMSGRestrict(restrictz_array[fi], - RTz_array[lz], r_array[fi], - t_array[ci]); - hypre_StructAxpy(1.0, t_array[ci], b_array[ci]); - } - else - { - hypre_SparseMSGRestrict(restrictz_array[fi], - RTz_array[lz], r_array[fi], - b_array[ci]); - } - restrict_count[ci]++; - } - } -#if DEBUG - hypre_sprintf(filename, "zoutSMSG_bdown.%d.%d.%d", lx, ly, lz); - hypre_StructVectorPrint(filename, b_array[fi], 0); - hypre_sprintf(filename, "zoutSMSG_xdown.%d.%d.%d", lx, ly, lz); - hypre_StructVectorPrint(filename, x_array[fi], 0); - hypre_sprintf(filename, "zoutSMSG_rdown.%d.%d.%d", lx, ly, lz); - hypre_StructVectorPrint(filename, r_array[fi], 0); -#endif - } - } - } - - /*-------------------------------------------------- - * Bottom - *--------------------------------------------------*/ - - fi = num_all_grids - 1; - - if (restrict_count[fi] > 1) - { - hypre_StructScale((1.0 / restrict_count[fi]), b_array[fi]); - } - - hypre_PFMGRelaxSetZeroGuess(relax_array[fi], 1); - hypre_PFMGRelax(relax_array[fi], A_array[fi], b_array[fi], - x_array[fi]); - -#if DEBUG - hypre_sprintf(filename, "zoutSMSG_bbottom.%d.%d.%d", lx, ly, lz); - hypre_StructVectorPrint(filename, b_array[fi], 0); - hypre_sprintf(filename, "zoutSMSG_xbottom.%d.%d.%d", lx, ly, lz); - hypre_StructVectorPrint(filename, x_array[fi], 0); -#endif - - /*-------------------------------------------------- - * Up cycle - * Note that r = b = x through the jump region - *--------------------------------------------------*/ - - for (l = (num_levels - 2); l >= 0; l--) - { - lzmin = hypre_max((l - num_grids[1] - num_grids[0] + 2), 0); - lzmax = hypre_min((l), (num_grids[2] - 1)); - for (lz = lzmax; lz >= lzmin; lz--) - { - lymin = hypre_max((l - lz - num_grids[0] + 1), 0); - lymax = hypre_min((l - lz), (num_grids[1] - 1)); - for (ly = lymax; ly >= lymin; ly--) - { - lx = l - lz - ly; - - hypre_SparseMSGMapIndex(lx, ly, lz, num_grids, fi); - - if (!grid_on[fi]) - { - break; - } - - if ((l >= 1) && (l <= jump)) - { - hypre_StructVectorSetConstantValues(x_array[fi], 0.0); - } - if ((lx + 1) < num_grids[0]) - { - /* interpolate from ((lx+1), ly, lz) */ - hypre_SparseMSGMapIndex((lx + 1), ly, lz, num_grids, ci); - if (grid_on[ci]) - { - hypre_SparseMSGInterp(interpx_array[fi], - Px_array[lx], x_array[ci], - e_array[fi]); - hypre_SparseMSGFilter(visitx_array[fi], e_array[fi], - lx, ly, lz, jump); - hypre_StructAxpy(1.0, e_array[fi], x_array[fi]); - } - } - if ((ly + 1) < num_grids[1]) - { - /* interpolate from (lx, (ly+1), lz) */ - hypre_SparseMSGMapIndex(lx, (ly + 1), lz, num_grids, ci); - if (grid_on[ci]) - { - hypre_SparseMSGInterp(interpy_array[fi], - Py_array[ly], x_array[ci], - e_array[fi]); - hypre_SparseMSGFilter(visity_array[fi], e_array[fi], - lx, ly, lz, jump); - hypre_StructAxpy(1.0, e_array[fi], x_array[fi]); - } - } - if ((lz + 1) < num_grids[2]) - { - /* interpolate from (lx, ly, (lz+1)) */ - hypre_SparseMSGMapIndex(lx, ly, (lz + 1), num_grids, ci); - if (grid_on[ci]) - { - hypre_SparseMSGInterp(interpz_array[fi], - Pz_array[lz], x_array[ci], - e_array[fi]); - hypre_SparseMSGFilter(visitz_array[fi], e_array[fi], - 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); -#endif - if (l > jump) - { - /* post-relaxation */ - hypre_PFMGRelaxSetPostRelax(relax_array[fi]); - hypre_PFMGRelaxSetMaxIter(relax_array[fi], - num_post_relax); - hypre_PFMGRelaxSetZeroGuess(relax_array[fi], 0); - hypre_PFMGRelax(relax_array[fi], A_array[fi], b_array[fi], - x_array[fi]); - } - } - } - } - } - - /* part of convergence check */ - if ((tol > 0.0) && (rel_change)) - { - if (num_levels > 1) - { - e_dot_e = hypre_StructInnerProd(e_array[0], e_array[0]); - x_dot_x = hypre_StructInnerProd(x_array[0], x_array[0]); - } - else - { - e_dot_e = 0.0; - x_dot_x = 1.0; - } - } - - /* fine grid post-relaxation */ - hypre_PFMGRelaxSetPostRelax(relax_array[0]); - hypre_PFMGRelaxSetMaxIter(relax_array[0], num_fine_relax); - hypre_PFMGRelaxSetZeroGuess(relax_array[0], 0); - hypre_PFMGRelax(relax_array[0], A_array[0], b_array[0], x_array[0]); - - (smsg_data -> num_iterations) = (i + 1); - } - - hypre_EndTiming(smsg_data -> time_index); - - return ierr; -} diff --git a/src/struct_mv/CMakeLists.txt b/src/struct_mv/CMakeLists.txt index 20e4dc1f59..03de8effde 100644 --- a/src/struct_mv/CMakeLists.txt +++ b/src/struct_mv/CMakeLists.txt @@ -6,14 +6,29 @@ set(HDRS HYPRE_struct_mv.h _hypre_struct_mv.h + _hypre_struct_mv.hpp ) -set(SRCS +# Add MUP headers when mixed precision is enabled +if(HYPRE_ENABLE_MIXED_PRECISION) + list(APPEND HDRS + HYPRE_struct_mv_mp.h + HYPRE_struct_mv_mup.h + _hypre_struct_mv_mup.h + _hypre_struct_mv_mup_def.h + _hypre_struct_mv_mup_undef.h + ) +endif() + +# Regular sources +set(REGULAR_SRCS assumed_part.c box_algebra.c box_boundary.c box.c + box_ds.c box_manager.c + coarsen.c communication_info.c computation.c F90_HYPRE_struct_grid.c @@ -25,33 +40,56 @@ set(SRCS HYPRE_struct_stencil.c HYPRE_struct_vector.c project.c + struct_grid.c + struct_io.c + struct_matrix_mask.c + struct_stencil.c struct_axpy.c struct_communication.c struct_copy.c + struct_data.c struct_grid.c struct_innerprod.c - struct_io.c struct_matrix.c - struct_matrix_mask.c struct_matvec.c + struct_matvec_core.c + struct_matmult.c + struct_matmult_core.c + struct_matmult_fuse.c + struct_matop.c + struct_stmatrix.c struct_scale.c - struct_stencil.c struct_vector.c ) -target_sources(${PROJECT_NAME} - PRIVATE ${SRCS} - ${HDRS} +# Mixed precision sources +set(MUP_SRCS + mup_fixed.c + mup_functions.c + mup_pre.c ) +if(HYPRE_ENABLE_MIXED_PRECISION) + setup_mixed_precision_compilation("struct_mv" SRCS "${REGULAR_SRCS}") + target_sources(${PROJECT_NAME} PRIVATE ${MUP_SRCS} ${HDRS}) +else() + target_sources(${PROJECT_NAME} PRIVATE ${REGULAR_SRCS} ${HDRS}) +endif() + if (HYPRE_USING_GPU) set(GPU_SRCS struct_axpy.c struct_communication.c struct_copy.c + struct_data.c struct_innerprod.c + struct_matmult.c + struct_matmult_core.c + struct_matmult_fuse.c + struct_matop.c struct_matrix.c struct_matvec.c + struct_matvec_core.c struct_scale.c struct_vector.c ) diff --git a/src/struct_mv/F90_HYPRE_struct_grid.c b/src/struct_mv/F90_HYPRE_struct_grid.c index 0136f7bfee..20ffe1c0ca 100644 --- a/src/struct_mv/F90_HYPRE_struct_grid.c +++ b/src/struct_mv/F90_HYPRE_struct_grid.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_struct_mv.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/struct_mv/F90_HYPRE_struct_matrix.c b/src/struct_mv/F90_HYPRE_struct_matrix.c index 1dbea175c1..87defeb5d9 100644 --- a/src/struct_mv/F90_HYPRE_struct_matrix.c +++ b/src/struct_mv/F90_HYPRE_struct_matrix.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_struct_mv.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/struct_mv/F90_HYPRE_struct_stencil.c b/src/struct_mv/F90_HYPRE_struct_stencil.c index a7f53ff5ed..c469da10ca 100644 --- a/src/struct_mv/F90_HYPRE_struct_stencil.c +++ b/src/struct_mv/F90_HYPRE_struct_stencil.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_struct_mv.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { @@ -36,7 +36,24 @@ hypre_F90_IFACE(hypre_structstencilcreate, HYPRE_STRUCTSTENCILCREATE) } /*-------------------------------------------------------------------------- - * HYPRE_StructStencilSetElement + * HYPRE_StructStencilSetEntry + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_structstencilsetentry, HYPRE_STRUCTSTENCILSETENTRY) +( hypre_F90_Obj *stencil, + hypre_F90_Int *entry, + hypre_F90_IntArray *offset, + hypre_F90_Int *ierr ) +{ + *ierr = (hypre_F90_Int) HYPRE_StructStencilSetEntry( + hypre_F90_PassObj (HYPRE_StructStencil, stencil), + hypre_F90_PassInt (entry), + hypre_F90_PassIntArray (offset) ); +} + +/*-------------------------------------------------------------------------- + * OBSOLETE. Use SetEntry. *--------------------------------------------------------------------------*/ void diff --git a/src/struct_mv/F90_HYPRE_struct_vector.c b/src/struct_mv/F90_HYPRE_struct_vector.c index b53e01b95d..bd9ce5e7f8 100644 --- a/src/struct_mv/F90_HYPRE_struct_vector.c +++ b/src/struct_mv/F90_HYPRE_struct_vector.c @@ -12,7 +12,7 @@ *****************************************************************************/ #include "_hypre_struct_mv.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { @@ -79,7 +79,7 @@ hypre_F90_IFACE(hypre_structvectorsetvalues, HYPRE_STRUCTVECTORSETVALUES) ( HYPRE_StructVectorSetValues( hypre_F90_PassObj (HYPRE_StructVector, vector), hypre_F90_PassIntArray (grid_index), - hypre_F90_PassComplex (values) ) ); + hypre_F90_PassComplexRef (values) ) ); } /*-------------------------------------------------------------------------- @@ -117,7 +117,7 @@ hypre_F90_IFACE(hypre_structvectoraddtovalues, HYPRE_STRUCTVECTORADDTOVALUES) ( HYPRE_StructVectorAddToValues( hypre_F90_PassObj (HYPRE_StructVector, vector), hypre_F90_PassIntArray (grid_index), - hypre_F90_PassComplex (values) ) ); + hypre_F90_PassComplexRef (values) ) ); } /*-------------------------------------------------------------------------- @@ -256,6 +256,22 @@ hypre_F90_IFACE(hypre_structvectorsetconstantva, HYPRE_STRUCTVECTORSETCONSTANTVA hypre_F90_PassComplex (values) ) ); } +/*-------------------------------------------------------------------------- + * HYPRE_StructVectorSetRandomValues + *--------------------------------------------------------------------------*/ + +void +hypre_F90_IFACE(hypre_structvectorsetrandomvalu, HYPRE_STRUCTVECTORSETRANDOMVALU) +(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_StructVectorGetMigrateCommPkg *--------------------------------------------------------------------------*/ diff --git a/src/struct_mv/HYPRE_struct_grid.c b/src/struct_mv/HYPRE_struct_grid.c index 27387260b2..0755c84d25 100644 --- a/src/struct_mv/HYPRE_struct_grid.c +++ b/src/struct_mv/HYPRE_struct_grid.c @@ -14,7 +14,6 @@ #include "_hypre_struct_mv.h" /*-------------------------------------------------------------------------- - * HYPRE_StructGridCreate *--------------------------------------------------------------------------*/ HYPRE_Int @@ -28,7 +27,6 @@ HYPRE_StructGridCreate( MPI_Comm comm, } /*-------------------------------------------------------------------------- - * HYPRE_StructGridDestroy *--------------------------------------------------------------------------*/ HYPRE_Int @@ -38,7 +36,6 @@ HYPRE_StructGridDestroy( HYPRE_StructGrid grid ) } /*-------------------------------------------------------------------------- - * HYPRE_StructGridSetExtents *--------------------------------------------------------------------------*/ HYPRE_Int @@ -63,7 +60,6 @@ HYPRE_StructGridSetExtents( HYPRE_StructGrid grid, } /*-------------------------------------------------------------------------- - * HYPRE_SetStructGridPeriodicity *--------------------------------------------------------------------------*/ HYPRE_Int @@ -84,7 +80,6 @@ HYPRE_StructGridSetPeriodic( HYPRE_StructGrid grid, } /*-------------------------------------------------------------------------- - * HYPRE_StructGridAssemble *--------------------------------------------------------------------------*/ HYPRE_Int @@ -94,17 +89,73 @@ HYPRE_StructGridAssemble( HYPRE_StructGrid grid ) } /*--------------------------------------------------------------------------- - * GEC0902 - * HYPRE_StructGridSetNumGhost - * to set the numghost array inside the struct_grid_struct using an internal - * function. This is just a wrapper. *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGridPrintVTK( const char *filename, + HYPRE_StructGrid grid ) +{ + return ( hypre_StructGridPrintVTK(filename, grid) ); +} + +/*--------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + HYPRE_Int -HYPRE_StructGridSetNumGhost( HYPRE_StructGrid grid, HYPRE_Int *num_ghost ) +HYPRE_StructGridSetNumGhost( HYPRE_StructGrid grid, + HYPRE_Int *num_ghost ) { return ( hypre_StructGridSetNumGhost(grid, num_ghost) ); } +/*--------------------------------------------------------------------------- + * HYPRE_StructGridCoarsen + * + * This function creates and assembles cgrid by coarsening an input grid. + * Note that, in contrast to the internal hypre_StructGridCoarsen function, + * it also assembled the resulting grid. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGridCoarsen(HYPRE_StructGrid grid, + HYPRE_Int *stride, + HYPRE_StructGrid *cgrid) +{ + hypre_Index origin; + + hypre_SetIndex(origin, 0); + hypre_StructCoarsen(grid, origin, stride, 1, cgrid); + hypre_StructGridAssemble(*cgrid); + + return hypre_error_flag; +} + +/*--------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGridProjectBox(HYPRE_StructGrid grid, + HYPRE_Int *ilower, + HYPRE_Int *iupper, + HYPRE_Int *origin, + HYPRE_Int *stride) +{ + hypre_Box *box; + + box = hypre_BoxCreate(hypre_StructGridNDim(grid)); + hypre_CopyIndex(ilower, hypre_BoxIMin(box)); + hypre_CopyIndex(iupper, hypre_BoxIMax(box)); + hypre_ProjectBox(box, origin, stride); + hypre_CopyIndex(hypre_BoxIMin(box), ilower); + hypre_CopyIndex(hypre_BoxIMax(box), iupper); + hypre_BoxDestroy(box); + + return hypre_error_flag; +} + +/*--------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) HYPRE_Int HYPRE_StructGridSetDataLocation( HYPRE_StructGrid grid, HYPRE_MemoryLocation data_location ) diff --git a/src/struct_mv/HYPRE_struct_matrix.c b/src/struct_mv/HYPRE_struct_matrix.c index 4538f87e3f..6031e367f8 100644 --- a/src/struct_mv/HYPRE_struct_matrix.c +++ b/src/struct_mv/HYPRE_struct_matrix.c @@ -36,6 +36,32 @@ HYPRE_StructMatrixDestroy( HYPRE_StructMatrix matrix ) return ( hypre_StructMatrixDestroy(matrix) ); } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +/* RDF: Need a good user interface for setting range/domain grids. Maybe a + * GridSetExtents approach would be the best approach. */ + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixSetRangeStride(HYPRE_StructMatrix matrix, + HYPRE_Int *range_stride) +{ + return ( hypre_StructMatrixSetRangeStride(matrix, range_stride) ); +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixSetDomainStride(HYPRE_StructMatrix matrix, + HYPRE_Int *domain_stride) +{ + return ( hypre_StructMatrixSetDomainStride(matrix, domain_stride) ); +} + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -216,8 +242,10 @@ HYPRE_StructMatrixSetConstantValues( HYPRE_StructMatrix matrix, HYPRE_Int *stencil_indices, HYPRE_Complex *values ) { - return hypre_StructMatrixSetConstantValues( - matrix, num_stencil_indices, stencil_indices, values, 0 ); + hypre_StructMatrixSetConstantValues(matrix, num_stencil_indices, + stencil_indices, values, 0 ); + + return hypre_error_flag; } /*-------------------------------------------------------------------------- @@ -310,8 +338,10 @@ HYPRE_StructMatrixAddToConstantValues( HYPRE_StructMatrix matrix, HYPRE_Int *stencil_indices, HYPRE_Complex *values ) { - return hypre_StructMatrixSetConstantValues( - matrix, num_stencil_indices, stencil_indices, values, 1 ); + hypre_StructMatrixSetConstantValues(matrix, num_stencil_indices, + stencil_indices, values, 1 ); + + return hypre_error_flag; } /*-------------------------------------------------------------------------- @@ -327,19 +357,23 @@ HYPRE_StructMatrixAssemble( HYPRE_StructMatrix matrix ) *--------------------------------------------------------------------------*/ HYPRE_Int -HYPRE_StructMatrixSetNumGhost( HYPRE_StructMatrix matrix, - HYPRE_Int *num_ghost ) +HYPRE_StructMatrixSetSymmetric( HYPRE_StructMatrix matrix, + HYPRE_Int symmetric ) { - return ( hypre_StructMatrixSetNumGhost(matrix, num_ghost) ); + hypre_StructMatrixSymmetric(matrix) = symmetric; + + return hypre_error_flag; } /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ HYPRE_Int -HYPRE_StructMatrixGetGrid( HYPRE_StructMatrix matrix, HYPRE_StructGrid *grid ) +HYPRE_StructMatrixSetConstantEntries( HYPRE_StructMatrix matrix, + HYPRE_Int nentries, + HYPRE_Int *entries ) { - *grid = hypre_StructMatrixGrid(matrix); + hypre_StructMatrixSetConstantEntries(matrix, nentries, entries); return hypre_error_flag; } @@ -348,34 +382,28 @@ HYPRE_StructMatrixGetGrid( HYPRE_StructMatrix matrix, HYPRE_StructGrid *grid ) *--------------------------------------------------------------------------*/ HYPRE_Int -HYPRE_StructMatrixSetSymmetric( HYPRE_StructMatrix matrix, - HYPRE_Int symmetric ) +HYPRE_StructMatrixSetTranspose( HYPRE_StructMatrix matrix, + HYPRE_Int transpose ) { - hypre_StructMatrixSymmetric(matrix) = symmetric; + HYPRE_Int resize; + + hypre_StructMatrixSetTranspose(matrix, transpose, &resize); return hypre_error_flag; } /*-------------------------------------------------------------------------- - * Call this function to declare that certain stencil points are constant - * throughout the mesh. - * - nentries is the number of array entries - * - Each HYPRE_Int entries[i] is an index into the shape array of the stencil of the - * matrix. - * In the present version, only three possibilites are recognized: - * - no entries constant (constant_coefficient==0) - * - all entries constant (constant_coefficient==1) - * - all but the diagonal entry constant (constant_coefficient==2) - * If something else is attempted, this function will return a nonzero error. - * In the present version, if this function is called more than once, only - * the last call will take effect. *--------------------------------------------------------------------------*/ -HYPRE_Int HYPRE_StructMatrixSetConstantEntries( HYPRE_StructMatrix matrix, - HYPRE_Int nentries, - HYPRE_Int *entries ) +HYPRE_Int +HYPRE_StructMatrixSetNumGhost( HYPRE_StructMatrix matrix, + HYPRE_Int *num_ghost ) { - return hypre_StructMatrixSetConstantEntries( matrix, nentries, entries ); + HYPRE_Int resize; + + hypre_StructMatrixSetNumGhost(matrix, num_ghost, &resize); + + return hypre_error_flag; } /*-------------------------------------------------------------------------- @@ -424,6 +452,63 @@ HYPRE_StructMatrixMatvec( HYPRE_Complex alpha, (hypre_StructVector *) y) ); } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixMatvecT( HYPRE_Complex alpha, + HYPRE_StructMatrix A, + HYPRE_StructVector x, + HYPRE_Complex beta, + HYPRE_StructVector y ) +{ + return ( hypre_StructMatvecT( alpha, (hypre_StructMatrix *) A, + (hypre_StructVector *) x, beta, + (hypre_StructVector *) y) ); +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixMatmat( HYPRE_StructMatrix A, + HYPRE_Int Atranspose, + HYPRE_StructMatrix B, + HYPRE_Int Btranspose, + HYPRE_StructMatrix *C ) +{ + HYPRE_Int nmatrices = 2; + hypre_StructMatrix *matrices[2] = {A, B}; + HYPRE_Int nterms = 2; + HYPRE_Int terms[2] = {0, 1}; + HYPRE_Int transposes[2] = {Atranspose, Btranspose}; +#if defined (HYPRE_USING_GPU) + HYPRE_Int kernel_type = 1; +#else + HYPRE_Int kernel_type = 0; +#endif + + if (A == B) + { + nmatrices = 1; + terms[1] = 0; + } + hypre_StructMatmult(kernel_type, nmatrices, matrices, nterms, terms, transposes, C); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixGetGrid( HYPRE_StructMatrix matrix, HYPRE_StructGrid *grid ) +{ + *grid = hypre_StructMatrixGrid(matrix); + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ diff --git a/src/struct_mv/HYPRE_struct_mv.h b/src/struct_mv/HYPRE_struct_mv.h index 5298abc990..8502d8a7fd 100644 --- a/src/struct_mv/HYPRE_struct_mv.h +++ b/src/struct_mv/HYPRE_struct_mv.h @@ -10,10 +10,22 @@ #include "HYPRE_utilities.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_struct_mv_mup_def.h" +#endif + #ifdef __cplusplus extern "C" { #endif +/*-------------------------------------------------------------------------- + * HYPRE_Index: public interface to hypre_Index, that is to define indices + * in index space, or dimension sizes of boxes. + *--------------------------------------------------------------------------*/ + +typedef HYPRE_Int HYPRE_Index[HYPRE_MAXDIM]; +typedef HYPRE_Int *HYPRE_IndexRef; + /* forward declarations */ #ifndef HYPRE_StructVector_defined #define HYPRE_StructVector_defined @@ -25,7 +37,7 @@ typedef struct hypre_StructVector_struct *HYPRE_StructVector; *--------------------------------------------------------------------------*/ /** - * @defgroup StructSystemInterface Struct System Interface + * @defgroup StructInterface Struct System and Object Interface * * A structured-grid conceptual interface. This interface represents a * structured-grid conceptual view of a linear system. @@ -52,9 +64,10 @@ 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 +HYPRE_StructGridCreate(MPI_Comm comm, + HYPRE_Int ndim, + HYPRE_StructGrid *grid); /** * Destroy a grid object. An object should be explicitly destroyed using this @@ -64,19 +77,29 @@ HYPRE_Int HYPRE_StructGridCreate(MPI_Comm comm, * internal package references to the object. The object will then be destroyed * when all internal reference counts go to zero. **/ -HYPRE_Int HYPRE_StructGridDestroy(HYPRE_StructGrid grid); +HYPRE_Int +HYPRE_StructGridDestroy(HYPRE_StructGrid grid); /** * Set the extents for a box on the grid. **/ -HYPRE_Int HYPRE_StructGridSetExtents(HYPRE_StructGrid grid, - HYPRE_Int *ilower, - HYPRE_Int *iupper); +HYPRE_Int +HYPRE_StructGridSetExtents(HYPRE_StructGrid grid, + HYPRE_Int *ilower, + HYPRE_Int *iupper); /** * Finalize the construction of the grid before using. **/ -HYPRE_Int HYPRE_StructGridAssemble(HYPRE_StructGrid grid); +HYPRE_Int +HYPRE_StructGridAssemble(HYPRE_StructGrid grid); + +/** + * Prints a grid in VTK format. + **/ +HYPRE_Int +HYPRE_StructGridPrintVTK(const char *filename, + HYPRE_StructGrid grid); /** * Set the periodicity for the grid. @@ -90,14 +113,38 @@ HYPRE_Int HYPRE_StructGridAssemble(HYPRE_StructGrid grid); * NOTE: Some of the solvers in hypre have power-of-two restrictions on the size * of the periodic dimensions. **/ -HYPRE_Int HYPRE_StructGridSetPeriodic(HYPRE_StructGrid grid, - HYPRE_Int *periodic); +HYPRE_Int +HYPRE_StructGridSetPeriodic(HYPRE_StructGrid grid, + HYPRE_Int *periodic); /** - * Set the ghost layer in the grid object + * Set the ghost layer in the grid object. **/ -HYPRE_Int HYPRE_StructGridSetNumGhost(HYPRE_StructGrid grid, - HYPRE_Int *num_ghost); +HYPRE_Int +HYPRE_StructGridSetNumGhost(HYPRE_StructGrid grid, + HYPRE_Int *num_ghost); + +/** + * Coarsen \e grid by factor \e stride to create \e cgrid. + **/ +HYPRE_Int +HYPRE_StructGridCoarsen(HYPRE_StructGrid grid, + HYPRE_Int *stride, + HYPRE_StructGrid *cgrid); + +/** + * Project the box described by \e ilower and \e iupper onto the strided + * index space that contains the index \e origin and has stride \e stride. + * This routine is useful in combination with \ref HYPRE_StructGridCoarsen when + * dealing with rectangular matrices. + **/ +HYPRE_Int +HYPRE_StructGridProjectBox(HYPRE_StructGrid grid, + HYPRE_Int *ilower, + HYPRE_Int *iupper, + HYPRE_Int *origin, + HYPRE_Int *stride); + /**@}*/ @@ -120,24 +167,32 @@ typedef struct hypre_StructStencil_struct *HYPRE_StructStencil; * Create a stencil object for the specified number of spatial dimensions and * stencil entries. **/ -HYPRE_Int HYPRE_StructStencilCreate(HYPRE_Int ndim, - HYPRE_Int size, - HYPRE_StructStencil *stencil); +HYPRE_Int +HYPRE_StructStencilCreate(HYPRE_Int ndim, + HYPRE_Int size, + HYPRE_StructStencil *stencil); /** * Destroy a stencil object. **/ -HYPRE_Int HYPRE_StructStencilDestroy(HYPRE_StructStencil stencil); +HYPRE_Int +HYPRE_StructStencilDestroy(HYPRE_StructStencil stencil); /** * Set a stencil entry. - * - * NOTE: The name of this routine will eventually be changed to \e - * HYPRE\_StructStencilSetEntry. **/ -HYPRE_Int HYPRE_StructStencilSetElement(HYPRE_StructStencil stencil, - HYPRE_Int entry, - HYPRE_Int *offset); +HYPRE_Int +HYPRE_StructStencilSetEntry(HYPRE_StructStencil stencil, + HYPRE_Int entry, + HYPRE_Int *offset); + +/* + * OBSOLETE. Use SetEntry instead. + **/ +HYPRE_Int +HYPRE_StructStencilSetElement(HYPRE_StructStencil stencil, + HYPRE_Int entry, + HYPRE_Int *offset); /**@}*/ @@ -157,22 +212,66 @@ struct hypre_StructMatrix_struct; typedef struct hypre_StructMatrix_struct *HYPRE_StructMatrix; /** - * Create a matrix object. + * Create a matrix object. Matrices may have different range and domain grids, + * that is, they need not be square. By default, the range and domain grids are + * the same as \e grid. In general, the range is a coarsening of \e grid + * as specified in \ref HYPRE_StructMatrixSetRangeStride, and similarly for the + * domain. Note that the range index space must either be a subspace of the + * domain index space or vice versa. Also, (currently) either the range or + * domain coarsening factor (or both) must be all ones (i.e., no coarsening). **/ -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); /** * Destroy a matrix object. **/ -HYPRE_Int HYPRE_StructMatrixDestroy(HYPRE_StructMatrix matrix); +HYPRE_Int +HYPRE_StructMatrixDestroy(HYPRE_StructMatrix matrix); + +#if 0 +/** + * (Optional) Set the domain grid. By default, the range and domain grids are + * the same as the argument \e grid in \ref HYPRE_StructMatrixCreate. Both + * grids live on a common fine index space and should have the same number of + * boxes. The actual range is a coarsening of the range grid with coarsening + * factor \e rstride specified in \ref HYPRE_StructMatrixSetRStride. + * Similarly, the actual domain is a coarsening of the domain grid with factor + * \e dstride specified in \ref HYPRE_StructMatrixSetDStride. Currently, + * either \e rstride or \e dstride or both must be all ones (i.e., no + * coarsening). + **/ +HYPRE_Int +HYPRE_StructMatrixSetDomainGrid(HYPRE_StructMatrix matrix, + HYPRE_StructGrid domain_grid); +#endif + +/* RDF: Need a good user interface for setting range/domain grids. */ + +/** + * (Optional) Set the range coarsening stride. For more information, see + * \ref HYPRE_StructMatrixCreate. + **/ +HYPRE_Int +HYPRE_StructMatrixSetRangeStride(HYPRE_StructMatrix matrix, + HYPRE_Int *range_stride); + +/** + * (Optional) Set the domain coarsening stride. For more information, see + * \ref HYPRE_StructMatrixCreate. + **/ +HYPRE_Int +HYPRE_StructMatrixSetDomainStride(HYPRE_StructMatrix matrix, + HYPRE_Int *domain_stride); /** * Prepare a matrix object for setting coefficient values. **/ -HYPRE_Int HYPRE_StructMatrixInitialize(HYPRE_StructMatrix matrix); +HYPRE_Int +HYPRE_StructMatrixInitialize(HYPRE_StructMatrix matrix); /** * Set matrix coefficients index by index. The \e values array is of length @@ -181,11 +280,12 @@ HYPRE_Int HYPRE_StructMatrixInitialize(HYPRE_StructMatrix matrix); * NOTE: For better efficiency, use \ref HYPRE_StructMatrixSetBoxValues to set * coefficients a box at a time. **/ -HYPRE_Int HYPRE_StructMatrixSetValues(HYPRE_StructMatrix matrix, - HYPRE_Int *index, - HYPRE_Int nentries, - HYPRE_Int *entries, - HYPRE_Complex *values); +HYPRE_Int +HYPRE_StructMatrixSetValues(HYPRE_StructMatrix matrix, + HYPRE_Int *index, + HYPRE_Int nentries, + HYPRE_Int *entries, + HYPRE_Complex *values); /** * Add to matrix coefficients index by index. The \e values array is of @@ -194,28 +294,32 @@ HYPRE_Int HYPRE_StructMatrixSetValues(HYPRE_StructMatrix matrix, * NOTE: For better efficiency, use \ref HYPRE_StructMatrixAddToBoxValues to * set coefficients a box at a time. **/ -HYPRE_Int HYPRE_StructMatrixAddToValues(HYPRE_StructMatrix matrix, - HYPRE_Int *index, - HYPRE_Int nentries, - HYPRE_Int *entries, - HYPRE_Complex *values); +HYPRE_Int +HYPRE_StructMatrixAddToValues(HYPRE_StructMatrix matrix, + HYPRE_Int *index, + HYPRE_Int nentries, + HYPRE_Int *entries, + HYPRE_Complex *values); /** * Set matrix coefficients which are constant over the grid. The \e values * array is of length \e nentries. **/ -HYPRE_Int HYPRE_StructMatrixSetConstantValues(HYPRE_StructMatrix matrix, - HYPRE_Int nentries, - HYPRE_Int *entries, - HYPRE_Complex *values); +HYPRE_Int +HYPRE_StructMatrixSetConstantValues(HYPRE_StructMatrix matrix, + HYPRE_Int nentries, + HYPRE_Int *entries, + HYPRE_Complex *values); + /** * Add to matrix coefficients which are constant over the grid. The \e * values array is of length \e nentries. **/ -HYPRE_Int HYPRE_StructMatrixAddToConstantValues(HYPRE_StructMatrix matrix, - HYPRE_Int nentries, - HYPRE_Int *entries, - HYPRE_Complex *values); +HYPRE_Int +HYPRE_StructMatrixAddToConstantValues(HYPRE_StructMatrix matrix, + HYPRE_Int nentries, + HYPRE_Int *entries, + HYPRE_Complex *values); /** * Set matrix coefficients a box at a time. The data in \e values is ordered @@ -233,22 +337,24 @@ HYPRE_Int HYPRE_StructMatrixAddToConstantValues(HYPRE_StructMatrix matrix, } \endverbatim **/ -HYPRE_Int HYPRE_StructMatrixSetBoxValues(HYPRE_StructMatrix matrix, - HYPRE_Int *ilower, - HYPRE_Int *iupper, - HYPRE_Int nentries, - HYPRE_Int *entries, - HYPRE_Complex *values); +HYPRE_Int +HYPRE_StructMatrixSetBoxValues(HYPRE_StructMatrix matrix, + HYPRE_Int *ilower, + HYPRE_Int *iupper, + HYPRE_Int nentries, + HYPRE_Int *entries, + HYPRE_Complex *values); /** * Add to matrix coefficients a box at a time. The data in \e values is * ordered as in \ref HYPRE_StructMatrixSetBoxValues. **/ -HYPRE_Int HYPRE_StructMatrixAddToBoxValues(HYPRE_StructMatrix matrix, - HYPRE_Int *ilower, - HYPRE_Int *iupper, - HYPRE_Int nentries, - HYPRE_Int *entries, - HYPRE_Complex *values); +HYPRE_Int +HYPRE_StructMatrixAddToBoxValues(HYPRE_StructMatrix matrix, + HYPRE_Int *ilower, + HYPRE_Int *iupper, + HYPRE_Int nentries, + HYPRE_Int *entries, + HYPRE_Complex *values); /** * Set matrix coefficients a box at a time. The \e values array is logically @@ -257,31 +363,34 @@ HYPRE_Int HYPRE_StructMatrixAddToBoxValues(HYPRE_StructMatrix matrix, * \e values array is ordered as in \ref HYPRE_StructMatrixSetBoxValues, but * based on the value-box extents. **/ -HYPRE_Int HYPRE_StructMatrixSetBoxValues2(HYPRE_StructMatrix matrix, - HYPRE_Int *ilower, - HYPRE_Int *iupper, - HYPRE_Int nentries, - HYPRE_Int *entries, - HYPRE_Int *vilower, - HYPRE_Int *viupper, - HYPRE_Complex *values); +HYPRE_Int +HYPRE_StructMatrixSetBoxValues2(HYPRE_StructMatrix matrix, + HYPRE_Int *ilower, + HYPRE_Int *iupper, + HYPRE_Int nentries, + HYPRE_Int *entries, + HYPRE_Int *vilower, + HYPRE_Int *viupper, + HYPRE_Complex *values); /** * Add to matrix coefficients a box at a time. The data in \e values is * ordered as in \ref HYPRE_StructMatrixSetBoxValues2. **/ -HYPRE_Int HYPRE_StructMatrixAddToBoxValues2(HYPRE_StructMatrix matrix, - HYPRE_Int *ilower, - HYPRE_Int *iupper, - HYPRE_Int nentries, - HYPRE_Int *entries, - HYPRE_Int *vilower, - HYPRE_Int *viupper, - HYPRE_Complex *values); +HYPRE_Int +HYPRE_StructMatrixAddToBoxValues2(HYPRE_StructMatrix matrix, + HYPRE_Int *ilower, + HYPRE_Int *iupper, + HYPRE_Int nentries, + HYPRE_Int *entries, + HYPRE_Int *vilower, + HYPRE_Int *viupper, + HYPRE_Complex *values); /** * Finalize the construction of the matrix before using. **/ -HYPRE_Int HYPRE_StructMatrixAssemble(HYPRE_StructMatrix matrix); +HYPRE_Int +HYPRE_StructMatrixAssemble(HYPRE_StructMatrix matrix); /** * Get matrix coefficients index by index. The \e values array is of length @@ -290,43 +399,47 @@ HYPRE_Int HYPRE_StructMatrixAssemble(HYPRE_StructMatrix matrix); * NOTE: For better efficiency, use \ref HYPRE_StructMatrixGetBoxValues to get * coefficients a box at a time. **/ -HYPRE_Int HYPRE_StructMatrixGetValues(HYPRE_StructMatrix matrix, - HYPRE_Int *index, - HYPRE_Int nentries, - HYPRE_Int *entries, - HYPRE_Complex *values); +HYPRE_Int +HYPRE_StructMatrixGetValues(HYPRE_StructMatrix matrix, + HYPRE_Int *index, + HYPRE_Int nentries, + HYPRE_Int *entries, + HYPRE_Complex *values); /** * Get matrix coefficients a box at a time. The data in \e values is * ordered as in \ref HYPRE_StructMatrixSetBoxValues. **/ -HYPRE_Int HYPRE_StructMatrixGetBoxValues(HYPRE_StructMatrix matrix, - HYPRE_Int *ilower, - HYPRE_Int *iupper, - HYPRE_Int nentries, - HYPRE_Int *entries, - HYPRE_Complex *values); +HYPRE_Int +HYPRE_StructMatrixGetBoxValues(HYPRE_StructMatrix matrix, + HYPRE_Int *ilower, + HYPRE_Int *iupper, + HYPRE_Int nentries, + HYPRE_Int *entries, + HYPRE_Complex *values); /** * Get matrix coefficients a box at a time. The data in \e values is * ordered as in \ref HYPRE_StructMatrixSetBoxValues2. **/ -HYPRE_Int HYPRE_StructMatrixGetBoxValues2(HYPRE_StructMatrix matrix, - HYPRE_Int *ilower, - HYPRE_Int *iupper, - HYPRE_Int nentries, - HYPRE_Int *entries, - HYPRE_Int *vilower, - HYPRE_Int *viupper, - HYPRE_Complex *values); +HYPRE_Int +HYPRE_StructMatrixGetBoxValues2(HYPRE_StructMatrix matrix, + HYPRE_Int *ilower, + HYPRE_Int *iupper, + HYPRE_Int nentries, + HYPRE_Int *entries, + HYPRE_Int *vilower, + HYPRE_Int *viupper, + HYPRE_Complex *values); /** * Define symmetry properties of the matrix. By default, matrices are assumed * to be nonsymmetric. Significant storage savings can be made if the matrix is * symmetric. **/ -HYPRE_Int HYPRE_StructMatrixSetSymmetric(HYPRE_StructMatrix matrix, - HYPRE_Int symmetric); +HYPRE_Int +HYPRE_StructMatrixSetSymmetric(HYPRE_StructMatrix matrix, + HYPRE_Int symmetric); /** * Specify which stencil entries are constant over the grid. Declaring entries @@ -339,42 +452,43 @@ HYPRE_Int HYPRE_StructMatrixSetSymmetric(HYPRE_StructMatrix matrix, * - all entries constant * - all but the diagonal entry constant **/ -HYPRE_Int HYPRE_StructMatrixSetConstantEntries( HYPRE_StructMatrix matrix, - HYPRE_Int nentries, - HYPRE_Int *entries ); +HYPRE_Int +HYPRE_StructMatrixSetConstantEntries(HYPRE_StructMatrix matrix, + HYPRE_Int nentries, + HYPRE_Int *entries); + +/** + * Indicate whether the transpose coefficients should also be stored. + **/ +HYPRE_Int +HYPRE_StructMatrixSetTranspose(HYPRE_StructMatrix matrix, + HYPRE_Int transpose); /** * Set the ghost layer in the matrix **/ -HYPRE_Int HYPRE_StructMatrixSetNumGhost(HYPRE_StructMatrix matrix, - HYPRE_Int *num_ghost); +HYPRE_Int +HYPRE_StructMatrixSetNumGhost(HYPRE_StructMatrix matrix, + HYPRE_Int *num_ghost); /** * Print the matrix to file. This is mainly for debugging purposes. **/ -HYPRE_Int HYPRE_StructMatrixPrint(const char *filename, - HYPRE_StructMatrix matrix, - HYPRE_Int all); +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 ); +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 - * \f$\alpha=1\f$ and \f$\beta=0\f$. - **/ -HYPRE_Int HYPRE_StructMatrixMatvec ( HYPRE_Complex alpha, - HYPRE_StructMatrix A, - HYPRE_StructVector x, - HYPRE_Complex beta, - HYPRE_StructVector y ); /**@}*/ @@ -396,21 +510,36 @@ typedef struct hypre_StructVector_struct *HYPRE_StructVector; #endif /** - * Create a vector object. + * Create a vector object. Similarly to matrices, the grid is in general a + * coarsening of \e grid as specified by \ref HYPRE_StructVectorSetStride. + * By default, the two are the same (the stride is one). **/ -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); /** * Destroy a vector object. **/ -HYPRE_Int HYPRE_StructVectorDestroy(HYPRE_StructVector vector); +HYPRE_Int +HYPRE_StructVectorDestroy(HYPRE_StructVector vector); + +/* RDF: Need a good user interface for setting the grid. */ + +/** + * (Optional) Set the coarsening stride. For more information, see + * \ref HYPRE_StructVectorCreate. + **/ +HYPRE_Int +HYPRE_StructVectorSetStride(HYPRE_StructVector vector, + HYPRE_Int *stride); /** * Prepare a vector object for setting coefficient values. **/ -HYPRE_Int HYPRE_StructVectorInitialize(HYPRE_StructVector vector); +HYPRE_Int +HYPRE_StructVectorInitialize(HYPRE_StructVector vector); /** * Set vector coefficients index by index. @@ -418,9 +547,25 @@ HYPRE_Int HYPRE_StructVectorInitialize(HYPRE_StructVector vector); * NOTE: For better efficiency, use \ref HYPRE_StructVectorSetBoxValues to set * coefficients a box at a time. **/ -HYPRE_Int HYPRE_StructVectorSetValues(HYPRE_StructVector vector, - HYPRE_Int *index, - HYPRE_Complex value); +HYPRE_Int +HYPRE_StructVectorSetValues(HYPRE_StructVector vector, + HYPRE_Int *index, + HYPRE_Complex *values); + +/** + * Set vector coefficients to a constant value over the grid. + **/ +HYPRE_Int +HYPRE_StructVectorSetConstantValues(HYPRE_StructVector vector, + HYPRE_Complex value); + +/** + * Set vector coefficients to random values between -1.0 and 1.0 over the grid. + * The parameter \e seed controls the generation of random numbers. + **/ +HYPRE_Int +HYPRE_StructVectorSetRandomValues(HYPRE_StructVector vector, + HYPRE_Int seed); /** * Add to vector coefficients index by index. @@ -428,9 +573,10 @@ HYPRE_Int HYPRE_StructVectorSetValues(HYPRE_StructVector vector, * NOTE: For better efficiency, use \ref HYPRE_StructVectorAddToBoxValues to * set coefficients a box at a time. **/ -HYPRE_Int HYPRE_StructVectorAddToValues(HYPRE_StructVector vector, - HYPRE_Int *index, - HYPRE_Complex value); +HYPRE_Int +HYPRE_StructVectorAddToValues(HYPRE_StructVector vector, + HYPRE_Int *index, + HYPRE_Complex *values); /** * Set vector coefficients a box at a time. The data in \e values is ordered @@ -447,18 +593,20 @@ HYPRE_Int HYPRE_StructVectorAddToValues(HYPRE_StructVector vector, } \endverbatim **/ -HYPRE_Int HYPRE_StructVectorSetBoxValues(HYPRE_StructVector vector, - HYPRE_Int *ilower, - HYPRE_Int *iupper, - HYPRE_Complex *values); +HYPRE_Int +HYPRE_StructVectorSetBoxValues(HYPRE_StructVector vector, + HYPRE_Int *ilower, + HYPRE_Int *iupper, + HYPRE_Complex *values); /** * Add to vector coefficients a box at a time. The data in \e values is * ordered as in \ref HYPRE_StructVectorSetBoxValues. **/ -HYPRE_Int HYPRE_StructVectorAddToBoxValues(HYPRE_StructVector vector, - HYPRE_Int *ilower, - HYPRE_Int *iupper, - HYPRE_Complex *values); +HYPRE_Int +HYPRE_StructVectorAddToBoxValues(HYPRE_StructVector vector, + HYPRE_Int *ilower, + HYPRE_Int *iupper, + HYPRE_Complex *values); /** * Set vector coefficients a box at a time. The \e values array is logically @@ -467,27 +615,30 @@ HYPRE_Int HYPRE_StructVectorAddToBoxValues(HYPRE_StructVector vector, * \e values array is ordered as in \ref HYPRE_StructVectorSetBoxValues, but * based on the value-box extents. **/ -HYPRE_Int HYPRE_StructVectorSetBoxValues2(HYPRE_StructVector vector, - HYPRE_Int *ilower, - HYPRE_Int *iupper, - HYPRE_Int *vilower, - HYPRE_Int *viupper, - HYPRE_Complex *values); +HYPRE_Int +HYPRE_StructVectorSetBoxValues2(HYPRE_StructVector vector, + HYPRE_Int *ilower, + HYPRE_Int *iupper, + HYPRE_Int *vilower, + HYPRE_Int *viupper, + HYPRE_Complex *values); /** * Add to vector coefficients a box at a time. The data in \e values is * ordered as in \ref HYPRE_StructVectorSetBoxValues2. **/ -HYPRE_Int HYPRE_StructVectorAddToBoxValues2(HYPRE_StructVector vector, - HYPRE_Int *ilower, - HYPRE_Int *iupper, - HYPRE_Int *vilower, - HYPRE_Int *viupper, - HYPRE_Complex *values); +HYPRE_Int +HYPRE_StructVectorAddToBoxValues2(HYPRE_StructVector vector, + HYPRE_Int *ilower, + HYPRE_Int *iupper, + HYPRE_Int *vilower, + HYPRE_Int *viupper, + HYPRE_Complex *values); /** * Finalize the construction of the vector before using. **/ -HYPRE_Int HYPRE_StructVectorAssemble(HYPRE_StructVector vector); +HYPRE_Int +HYPRE_StructVectorAssemble(HYPRE_StructVector vector); /** * Get vector coefficients index by index. @@ -495,84 +646,204 @@ HYPRE_Int HYPRE_StructVectorAssemble(HYPRE_StructVector vector); * NOTE: For better efficiency, use \ref HYPRE_StructVectorGetBoxValues to get * coefficients a box at a time. **/ -HYPRE_Int HYPRE_StructVectorGetValues(HYPRE_StructVector vector, - HYPRE_Int *index, - HYPRE_Complex *value); +HYPRE_Int +HYPRE_StructVectorGetValues(HYPRE_StructVector vector, + HYPRE_Int *index, + HYPRE_Complex *value); /** * Get vector coefficients a box at a time. The data in \e values is ordered * as in \ref HYPRE_StructVectorSetBoxValues. **/ -HYPRE_Int HYPRE_StructVectorGetBoxValues(HYPRE_StructVector vector, - HYPRE_Int *ilower, - HYPRE_Int *iupper, - HYPRE_Complex *values); +HYPRE_Int +HYPRE_StructVectorGetBoxValues(HYPRE_StructVector vector, + HYPRE_Int *ilower, + HYPRE_Int *iupper, + HYPRE_Complex *values); /** * Get vector coefficients a box at a time. The data in \e values is ordered * as in \ref HYPRE_StructVectorSetBoxValues2. **/ -HYPRE_Int HYPRE_StructVectorGetBoxValues2(HYPRE_StructVector vector, - HYPRE_Int *ilower, - HYPRE_Int *iupper, - HYPRE_Int *vilower, - HYPRE_Int *viupper, - HYPRE_Complex *values); +HYPRE_Int +HYPRE_StructVectorGetBoxValues2(HYPRE_StructVector vector, + HYPRE_Int *ilower, + HYPRE_Int *iupper, + HYPRE_Int *vilower, + HYPRE_Int *viupper, + HYPRE_Complex *values); /** * Print the vector to file. This is mainly for debugging purposes. **/ -HYPRE_Int HYPRE_StructVectorPrint(const char *filename, - HYPRE_StructVector vector, - HYPRE_Int all); +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 ); +HYPRE_Int +HYPRE_StructVectorRead(MPI_Comm comm, + const char *filename, + HYPRE_Int *num_ghost, + HYPRE_StructVector *vector); + +/** + * Clone a vector x. + **/ +HYPRE_Int +HYPRE_StructVectorClone(HYPRE_StructVector x, + HYPRE_StructVector *y_ptr); + -/**@}*/ /**@}*/ /*-------------------------------------------------------------------------- - * Miscellaneous: These probably do not belong in the interface. *--------------------------------------------------------------------------*/ -HYPRE_Int HYPRE_StructMatrixGetGrid(HYPRE_StructMatrix matrix, - HYPRE_StructGrid *grid); +/** + * @name Basic Matrix/vector routines + * + * @{ + **/ -struct hypre_CommPkg_struct; -typedef struct hypre_CommPkg_struct *HYPRE_CommPkg; +/** + * Copy vector x into y (\f$y \leftarrow x\f$). + **/ +HYPRE_Int +HYPRE_StructVectorCopy(HYPRE_StructVector x, + HYPRE_StructVector y); + +/** + * Scale a vector by \e alpha (\f$y \leftarrow \alpha y\f$). + **/ +HYPRE_Int +HYPRE_StructVectorScale(HYPRE_Complex alpha, + HYPRE_StructVector y); + +/** + * Compute \f$y = y + \alpha x\f$. + **/ +HYPRE_Int +HYPRE_StructVectorAxpy(HYPRE_Complex alpha, + HYPRE_StructVector x, + HYPRE_Complex beta, + HYPRE_StructVector y); -HYPRE_Int HYPRE_StructVectorSetNumGhost(HYPRE_StructVector vector, - HYPRE_Int *num_ghost); +/** + * Compute \e result, the inner product of vectors \e x and \e y. + **/ +HYPRE_Int +HYPRE_StructVectorInnerProd(HYPRE_StructVector x, + HYPRE_StructVector y, + HYPRE_Real *result); -HYPRE_Int HYPRE_StructVectorSetConstantValues(HYPRE_StructVector vector, - HYPRE_Complex values); +/** + * 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 + * \f$\alpha=1\f$ and \f$\beta=0\f$. + **/ -HYPRE_Int HYPRE_StructVectorGetMigrateCommPkg(HYPRE_StructVector from_vector, - HYPRE_StructVector to_vector, - HYPRE_CommPkg *comm_pkg); +HYPRE_Int +HYPRE_StructMatrixMatvec(HYPRE_Complex alpha, + HYPRE_StructMatrix A, + HYPRE_StructVector x, + HYPRE_Complex beta, + HYPRE_StructVector y); -HYPRE_Int HYPRE_StructVectorMigrate(HYPRE_CommPkg comm_pkg, - HYPRE_StructVector from_vector, - HYPRE_StructVector to_vector); +/** + * Matvec transpose operation. This operation is \f$y = \alpha A^T x + \beta y\f$. + * Note that you can do a simple matrix-vector multiply by setting \f$\alpha=1\f$ + * and \f$\beta=0\f$. + **/ +HYPRE_Int +HYPRE_StructMatrixMatvecT(HYPRE_Complex alpha, + HYPRE_StructMatrix A, + HYPRE_StructVector x, + HYPRE_Complex beta, + HYPRE_StructVector y); -HYPRE_Int HYPRE_CommPkgDestroy(HYPRE_CommPkg comm_pkg); +/** + * Matrix-matrix multiply. Returns \f$C=AB\f$, \f$C=A^TB\f$, \f$C=AB^T\f$, or + * \f$C=A^TB^T\f$, depending on the boolean arguments \e Atranspose and \e Btranspose. + **/ +HYPRE_Int +HYPRE_StructMatrixMatmat(HYPRE_StructMatrix A, + HYPRE_Int Atranspose, + HYPRE_StructMatrix B, + HYPRE_Int Btranspose, + HYPRE_StructMatrix *C); + +/**@}*/ /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ +/*===== BEGIN 1 - IGNORE CODE IN DOCS =====*/ /*! \cond */ + +/* Keep these for backward compatibility (for now) */ + +HYPRE_Int +HYPRE_StructVectorScaleValues(HYPRE_StructVector vector, + HYPRE_Complex factor); + +/* These probably do not belong in the interface */ + +HYPRE_Int +HYPRE_StructMatrixGetGrid(HYPRE_StructMatrix matrix, + HYPRE_StructGrid *grid); +HYPRE_Int +HYPRE_StructMatrixClearBoundary(HYPRE_StructMatrix matrix); + +struct hypre_CommPkg_struct; +typedef struct hypre_CommPkg_struct *HYPRE_CommPkg; + +HYPRE_Int +HYPRE_StructVectorSetNumGhost(HYPRE_StructVector vector, + HYPRE_Int *num_ghost); + +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); + + #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) HYPRE_Int -HYPRE_StructGridSetDataLocation( HYPRE_StructGrid grid, HYPRE_MemoryLocation data_location ); +HYPRE_StructGridSetDataLocation(HYPRE_StructGrid grid, HYPRE_MemoryLocation data_location); #endif +/*===== END 1 - IGNORE CODE IN DOCS =====*/ /*! \endcond */ + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +/**@}*/ + #ifdef __cplusplus } #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_struct_mv_mup_undef.h" +#include "HYPRE_struct_mv_mup.h" +#include "HYPRE_struct_mv_mp.h" +#endif +#endif + #endif diff --git a/src/struct_mv/HYPRE_struct_mv_mp.c b/src/struct_mv/HYPRE_struct_mv_mp.c new file mode 100644 index 0000000000..726ed7bea7 --- /dev/null +++ b/src/struct_mv/HYPRE_struct_mv_mp.c @@ -0,0 +1,32 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Struct interface mixed precision functions + * + *****************************************************************************/ + +#include "_hypre_struct_mv.h" + +#ifdef HYPRE_MIXED_PRECISION + +/*-------------------------------------------------------------------------- + * HYPRE_StructVectorCopy + * copies data from x to y + * y has its own data array, so this is a deep copy in that sense. + * The grid and other size information are not copied - they are + * assumed to be consistent already. + *--------------------------------------------------------------------------*/ +HYPRE_Int +HYPRE_StructVectorCopy_mp( HYPRE_StructVector x, HYPRE_StructVector y ) +{ + return ( hypre_StructVectorCopy_mp( (hypre_StructVector *)x, + (hypre_StructVector *)y ) ); +} + +#endif diff --git a/src/struct_mv/HYPRE_struct_mv_mp.h b/src/struct_mv/HYPRE_struct_mv_mp.h new file mode 100644 index 0000000000..eb3fd24ff6 --- /dev/null +++ b/src/struct_mv/HYPRE_struct_mv_mp.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) + ******************************************************************************/ + +/****************************************************************************** + * + * Header file for HYPRE_parcsr_mv library + * + *****************************************************************************/ + +#ifndef HYPRE_STRUCT_MV_MP_HEADER +#define HYPRE_STRUCT_MV_MP_HEADER + +#include "_hypre_struct_mv.h" + +#ifdef HYPRE_MIXED_PRECISION + +#ifdef __cplusplus +extern "C" { +#endif + +HYPRE_Int HYPRE_StructVectorCopy_mp( HYPRE_StructVector x, HYPRE_StructVector y ); + +#ifdef __cplusplus +} +#endif + +#endif + +#endif diff --git a/src/struct_mv/HYPRE_struct_mv_mup.h b/src/struct_mv/HYPRE_struct_mv_mup.h new file mode 100644 index 0000000000..e1ee6da929 --- /dev/null +++ b/src/struct_mv/HYPRE_struct_mv_mup.h @@ -0,0 +1,881 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#ifndef HYPRE_STRUCT_MV_MUP_HEADER +#define HYPRE_STRUCT_MV_MUP_HEADER + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (HYPRE_MIXED_PRECISION) + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_CommPkgDestroy_flt( HYPRE_CommPkg comm_pkg ); +HYPRE_Int +HYPRE_CommPkgDestroy_dbl( HYPRE_CommPkg comm_pkg ); +HYPRE_Int +HYPRE_CommPkgDestroy_long_dbl( HYPRE_CommPkg comm_pkg ); +HYPRE_Int +HYPRE_CommPkgDestroy( HYPRE_CommPkg comm_pkg ); + +HYPRE_Int +HYPRE_StructGridAssemble_flt( HYPRE_StructGrid grid ); +HYPRE_Int +HYPRE_StructGridAssemble_dbl( HYPRE_StructGrid grid ); +HYPRE_Int +HYPRE_StructGridAssemble_long_dbl( HYPRE_StructGrid grid ); +HYPRE_Int +HYPRE_StructGridAssemble( HYPRE_StructGrid grid ); + +HYPRE_Int +HYPRE_StructGridCoarsen_flt( HYPRE_StructGrid grid, HYPRE_Int *stride, HYPRE_StructGrid *cgrid ); +HYPRE_Int +HYPRE_StructGridCoarsen_dbl( HYPRE_StructGrid grid, HYPRE_Int *stride, HYPRE_StructGrid *cgrid ); +HYPRE_Int +HYPRE_StructGridCoarsen_long_dbl( HYPRE_StructGrid grid, HYPRE_Int *stride, HYPRE_StructGrid *cgrid ); +HYPRE_Int +HYPRE_StructGridCoarsen( HYPRE_StructGrid grid, HYPRE_Int *stride, HYPRE_StructGrid *cgrid ); + +HYPRE_Int +HYPRE_StructGridCreate_flt( MPI_Comm comm, HYPRE_Int ndim, HYPRE_StructGrid *grid ); +HYPRE_Int +HYPRE_StructGridCreate_dbl( MPI_Comm comm, HYPRE_Int ndim, HYPRE_StructGrid *grid ); +HYPRE_Int +HYPRE_StructGridCreate_long_dbl( MPI_Comm comm, HYPRE_Int ndim, HYPRE_StructGrid *grid ); +HYPRE_Int +HYPRE_StructGridCreate( MPI_Comm comm, HYPRE_Int ndim, HYPRE_StructGrid *grid ); + +HYPRE_Int +HYPRE_StructGridDestroy_flt( HYPRE_StructGrid grid ); +HYPRE_Int +HYPRE_StructGridDestroy_dbl( HYPRE_StructGrid grid ); +HYPRE_Int +HYPRE_StructGridDestroy_long_dbl( HYPRE_StructGrid grid ); +HYPRE_Int +HYPRE_StructGridDestroy( HYPRE_StructGrid grid ); + +HYPRE_Int +HYPRE_StructGridPrintVTK_flt( const char *filename, HYPRE_StructGrid grid ); +HYPRE_Int +HYPRE_StructGridPrintVTK_dbl( const char *filename, HYPRE_StructGrid grid ); +HYPRE_Int +HYPRE_StructGridPrintVTK_long_dbl( const char *filename, HYPRE_StructGrid grid ); +HYPRE_Int +HYPRE_StructGridPrintVTK( const char *filename, HYPRE_StructGrid grid ); + +HYPRE_Int +HYPRE_StructGridProjectBox_flt( HYPRE_StructGrid grid, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *origin, HYPRE_Int *stride ); +HYPRE_Int +HYPRE_StructGridProjectBox_dbl( HYPRE_StructGrid grid, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *origin, HYPRE_Int *stride ); +HYPRE_Int +HYPRE_StructGridProjectBox_long_dbl( HYPRE_StructGrid grid, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *origin, HYPRE_Int *stride ); +HYPRE_Int +HYPRE_StructGridProjectBox( HYPRE_StructGrid grid, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *origin, HYPRE_Int *stride ); + +HYPRE_Int +HYPRE_StructGridSetExtents_flt( HYPRE_StructGrid grid, HYPRE_Int *ilower, HYPRE_Int *iupper ); +HYPRE_Int +HYPRE_StructGridSetExtents_dbl( HYPRE_StructGrid grid, HYPRE_Int *ilower, HYPRE_Int *iupper ); +HYPRE_Int +HYPRE_StructGridSetExtents_long_dbl( HYPRE_StructGrid grid, HYPRE_Int *ilower, HYPRE_Int *iupper ); +HYPRE_Int +HYPRE_StructGridSetExtents( HYPRE_StructGrid grid, HYPRE_Int *ilower, HYPRE_Int *iupper ); + +HYPRE_Int +HYPRE_StructGridSetNumGhost_flt( HYPRE_StructGrid grid, HYPRE_Int *num_ghost ); +HYPRE_Int +HYPRE_StructGridSetNumGhost_dbl( HYPRE_StructGrid grid, HYPRE_Int *num_ghost ); +HYPRE_Int +HYPRE_StructGridSetNumGhost_long_dbl( HYPRE_StructGrid grid, HYPRE_Int *num_ghost ); +HYPRE_Int +HYPRE_StructGridSetNumGhost( HYPRE_StructGrid grid, HYPRE_Int *num_ghost ); + +HYPRE_Int +HYPRE_StructGridSetPeriodic_flt( HYPRE_StructGrid grid, HYPRE_Int *periodic ); +HYPRE_Int +HYPRE_StructGridSetPeriodic_dbl( HYPRE_StructGrid grid, HYPRE_Int *periodic ); +HYPRE_Int +HYPRE_StructGridSetPeriodic_long_dbl( HYPRE_StructGrid grid, HYPRE_Int *periodic ); +HYPRE_Int +HYPRE_StructGridSetPeriodic( HYPRE_StructGrid grid, HYPRE_Int *periodic ); + +HYPRE_Int +HYPRE_StructMatrixAddToBoxValues_flt( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, hypre_float *values ); +HYPRE_Int +HYPRE_StructMatrixAddToBoxValues_dbl( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, hypre_double *values ); +HYPRE_Int +HYPRE_StructMatrixAddToBoxValues_long_dbl( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, hypre_long_double *values ); +HYPRE_Int +HYPRE_StructMatrixAddToBoxValues( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, void *values ); + +HYPRE_Int +HYPRE_StructMatrixAddToBoxValues2_flt( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_float *values ); +HYPRE_Int +HYPRE_StructMatrixAddToBoxValues2_dbl( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_double *values ); +HYPRE_Int +HYPRE_StructMatrixAddToBoxValues2_long_dbl( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_long_double *values ); +HYPRE_Int +HYPRE_StructMatrixAddToBoxValues2( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ); + +HYPRE_Int +HYPRE_StructMatrixAddToConstantValues_flt( HYPRE_StructMatrix matrix, HYPRE_Int nentries, HYPRE_Int *entries, hypre_float *values ); +HYPRE_Int +HYPRE_StructMatrixAddToConstantValues_dbl( HYPRE_StructMatrix matrix, HYPRE_Int nentries, HYPRE_Int *entries, hypre_double *values ); +HYPRE_Int +HYPRE_StructMatrixAddToConstantValues_long_dbl( HYPRE_StructMatrix matrix, HYPRE_Int nentries, HYPRE_Int *entries, hypre_long_double *values ); +HYPRE_Int +HYPRE_StructMatrixAddToConstantValues( HYPRE_StructMatrix matrix, HYPRE_Int nentries, HYPRE_Int *entries, void *values ); + +HYPRE_Int +HYPRE_StructMatrixAddToValues_flt( HYPRE_StructMatrix matrix, HYPRE_Int *index, HYPRE_Int nentries, HYPRE_Int *entries, hypre_float *values ); +HYPRE_Int +HYPRE_StructMatrixAddToValues_dbl( HYPRE_StructMatrix matrix, HYPRE_Int *index, HYPRE_Int nentries, HYPRE_Int *entries, hypre_double *values ); +HYPRE_Int +HYPRE_StructMatrixAddToValues_long_dbl( HYPRE_StructMatrix matrix, HYPRE_Int *index, HYPRE_Int nentries, HYPRE_Int *entries, hypre_long_double *values ); +HYPRE_Int +HYPRE_StructMatrixAddToValues( HYPRE_StructMatrix matrix, HYPRE_Int *index, HYPRE_Int nentries, HYPRE_Int *entries, void *values ); + +HYPRE_Int +HYPRE_StructMatrixAssemble_flt( HYPRE_StructMatrix matrix ); +HYPRE_Int +HYPRE_StructMatrixAssemble_dbl( HYPRE_StructMatrix matrix ); +HYPRE_Int +HYPRE_StructMatrixAssemble_long_dbl( HYPRE_StructMatrix matrix ); +HYPRE_Int +HYPRE_StructMatrixAssemble( HYPRE_StructMatrix matrix ); + +HYPRE_Int +HYPRE_StructMatrixClearBoundary_flt( HYPRE_StructMatrix matrix ); +HYPRE_Int +HYPRE_StructMatrixClearBoundary_dbl( HYPRE_StructMatrix matrix ); +HYPRE_Int +HYPRE_StructMatrixClearBoundary_long_dbl( HYPRE_StructMatrix matrix ); +HYPRE_Int +HYPRE_StructMatrixClearBoundary( HYPRE_StructMatrix matrix ); + +HYPRE_Int +HYPRE_StructMatrixCreate_flt( MPI_Comm comm, HYPRE_StructGrid grid, HYPRE_StructStencil stencil, HYPRE_StructMatrix *matrix ); +HYPRE_Int +HYPRE_StructMatrixCreate_dbl( MPI_Comm comm, HYPRE_StructGrid grid, HYPRE_StructStencil stencil, HYPRE_StructMatrix *matrix ); +HYPRE_Int +HYPRE_StructMatrixCreate_long_dbl( 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_flt( HYPRE_StructMatrix matrix ); +HYPRE_Int +HYPRE_StructMatrixDestroy_dbl( HYPRE_StructMatrix matrix ); +HYPRE_Int +HYPRE_StructMatrixDestroy_long_dbl( HYPRE_StructMatrix matrix ); +HYPRE_Int +HYPRE_StructMatrixDestroy( HYPRE_StructMatrix matrix ); + +HYPRE_Int +HYPRE_StructMatrixGetBoxValues_flt( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, hypre_float *values ); +HYPRE_Int +HYPRE_StructMatrixGetBoxValues_dbl( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, hypre_double *values ); +HYPRE_Int +HYPRE_StructMatrixGetBoxValues_long_dbl( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, hypre_long_double *values ); +HYPRE_Int +HYPRE_StructMatrixGetBoxValues( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, void *values ); + +HYPRE_Int +HYPRE_StructMatrixGetBoxValues2_flt( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_float *values ); +HYPRE_Int +HYPRE_StructMatrixGetBoxValues2_dbl( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_double *values ); +HYPRE_Int +HYPRE_StructMatrixGetBoxValues2_long_dbl( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_long_double *values ); +HYPRE_Int +HYPRE_StructMatrixGetBoxValues2( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ); + +HYPRE_Int +HYPRE_StructMatrixGetGrid_flt( HYPRE_StructMatrix matrix, HYPRE_StructGrid *grid ); +HYPRE_Int +HYPRE_StructMatrixGetGrid_dbl( HYPRE_StructMatrix matrix, HYPRE_StructGrid *grid ); +HYPRE_Int +HYPRE_StructMatrixGetGrid_long_dbl( HYPRE_StructMatrix matrix, HYPRE_StructGrid *grid ); +HYPRE_Int +HYPRE_StructMatrixGetGrid( HYPRE_StructMatrix matrix, HYPRE_StructGrid *grid ); + +HYPRE_Int +HYPRE_StructMatrixGetValues_flt( HYPRE_StructMatrix matrix, HYPRE_Int *index, HYPRE_Int nentries, HYPRE_Int *entries, hypre_float *values ); +HYPRE_Int +HYPRE_StructMatrixGetValues_dbl( HYPRE_StructMatrix matrix, HYPRE_Int *index, HYPRE_Int nentries, HYPRE_Int *entries, hypre_double *values ); +HYPRE_Int +HYPRE_StructMatrixGetValues_long_dbl( HYPRE_StructMatrix matrix, HYPRE_Int *index, HYPRE_Int nentries, HYPRE_Int *entries, hypre_long_double *values ); +HYPRE_Int +HYPRE_StructMatrixGetValues( HYPRE_StructMatrix matrix, HYPRE_Int *index, HYPRE_Int nentries, HYPRE_Int *entries, void *values ); + +HYPRE_Int +HYPRE_StructMatrixInitialize_flt( HYPRE_StructMatrix matrix ); +HYPRE_Int +HYPRE_StructMatrixInitialize_dbl( HYPRE_StructMatrix matrix ); +HYPRE_Int +HYPRE_StructMatrixInitialize_long_dbl( HYPRE_StructMatrix matrix ); +HYPRE_Int +HYPRE_StructMatrixInitialize( HYPRE_StructMatrix matrix ); + +HYPRE_Int +HYPRE_StructMatrixMatmat_flt( HYPRE_StructMatrix A, HYPRE_Int Atranspose, HYPRE_StructMatrix B, HYPRE_Int Btranspose, HYPRE_StructMatrix *C ); +HYPRE_Int +HYPRE_StructMatrixMatmat_dbl( HYPRE_StructMatrix A, HYPRE_Int Atranspose, HYPRE_StructMatrix B, HYPRE_Int Btranspose, HYPRE_StructMatrix *C ); +HYPRE_Int +HYPRE_StructMatrixMatmat_long_dbl( HYPRE_StructMatrix A, HYPRE_Int Atranspose, HYPRE_StructMatrix B, HYPRE_Int Btranspose, HYPRE_StructMatrix *C ); +HYPRE_Int +HYPRE_StructMatrixMatmat( HYPRE_StructMatrix A, HYPRE_Int Atranspose, HYPRE_StructMatrix B, HYPRE_Int Btranspose, HYPRE_StructMatrix *C ); + +HYPRE_Int +HYPRE_StructMatrixMatvec_flt( hypre_float alpha, HYPRE_StructMatrix A, HYPRE_StructVector x, hypre_float beta, HYPRE_StructVector y ); +HYPRE_Int +HYPRE_StructMatrixMatvec_dbl( hypre_double alpha, HYPRE_StructMatrix A, HYPRE_StructVector x, hypre_double beta, HYPRE_StructVector y ); +HYPRE_Int +HYPRE_StructMatrixMatvec_long_dbl( hypre_long_double alpha, HYPRE_StructMatrix A, HYPRE_StructVector x, hypre_long_double beta, HYPRE_StructVector y ); +HYPRE_Int +HYPRE_StructMatrixMatvec( hypre_long_double alpha, HYPRE_StructMatrix A, HYPRE_StructVector x, hypre_long_double beta, HYPRE_StructVector y ); + +HYPRE_Int +HYPRE_StructMatrixMatvecT_flt( hypre_float alpha, HYPRE_StructMatrix A, HYPRE_StructVector x, hypre_float beta, HYPRE_StructVector y ); +HYPRE_Int +HYPRE_StructMatrixMatvecT_dbl( hypre_double alpha, HYPRE_StructMatrix A, HYPRE_StructVector x, hypre_double beta, HYPRE_StructVector y ); +HYPRE_Int +HYPRE_StructMatrixMatvecT_long_dbl( hypre_long_double alpha, HYPRE_StructMatrix A, HYPRE_StructVector x, hypre_long_double beta, HYPRE_StructVector y ); +HYPRE_Int +HYPRE_StructMatrixMatvecT( hypre_long_double alpha, HYPRE_StructMatrix A, HYPRE_StructVector x, hypre_long_double beta, HYPRE_StructVector y ); + +HYPRE_Int +HYPRE_StructMatrixPrint_flt( const char *filename, HYPRE_StructMatrix matrix, HYPRE_Int all ); +HYPRE_Int +HYPRE_StructMatrixPrint_dbl( const char *filename, HYPRE_StructMatrix matrix, HYPRE_Int all ); +HYPRE_Int +HYPRE_StructMatrixPrint_long_dbl( const char *filename, HYPRE_StructMatrix matrix, HYPRE_Int all ); +HYPRE_Int +HYPRE_StructMatrixPrint( const char *filename, HYPRE_StructMatrix matrix, HYPRE_Int all ); + +HYPRE_Int +HYPRE_StructMatrixRead_flt( MPI_Comm comm, const char *filename, HYPRE_Int *num_ghost, HYPRE_StructMatrix *matrix ); +HYPRE_Int +HYPRE_StructMatrixRead_dbl( MPI_Comm comm, const char *filename, HYPRE_Int *num_ghost, HYPRE_StructMatrix *matrix ); +HYPRE_Int +HYPRE_StructMatrixRead_long_dbl( MPI_Comm comm, const char *filename, HYPRE_Int *num_ghost, HYPRE_StructMatrix *matrix ); +HYPRE_Int +HYPRE_StructMatrixRead( MPI_Comm comm, const char *filename, HYPRE_Int *num_ghost, HYPRE_StructMatrix *matrix ); + +HYPRE_Int +HYPRE_StructMatrixSetBoxValues_flt( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, hypre_float *values ); +HYPRE_Int +HYPRE_StructMatrixSetBoxValues_dbl( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, hypre_double *values ); +HYPRE_Int +HYPRE_StructMatrixSetBoxValues_long_dbl( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, hypre_long_double *values ); +HYPRE_Int +HYPRE_StructMatrixSetBoxValues( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, void *values ); + +HYPRE_Int +HYPRE_StructMatrixSetBoxValues2_flt( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_float *values ); +HYPRE_Int +HYPRE_StructMatrixSetBoxValues2_dbl( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_double *values ); +HYPRE_Int +HYPRE_StructMatrixSetBoxValues2_long_dbl( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_long_double *values ); +HYPRE_Int +HYPRE_StructMatrixSetBoxValues2( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ); + +HYPRE_Int +HYPRE_StructMatrixSetConstantEntries_flt( HYPRE_StructMatrix matrix, HYPRE_Int nentries, HYPRE_Int *entries ); +HYPRE_Int +HYPRE_StructMatrixSetConstantEntries_dbl( HYPRE_StructMatrix matrix, HYPRE_Int nentries, HYPRE_Int *entries ); +HYPRE_Int +HYPRE_StructMatrixSetConstantEntries_long_dbl( HYPRE_StructMatrix matrix, HYPRE_Int nentries, HYPRE_Int *entries ); +HYPRE_Int +HYPRE_StructMatrixSetConstantEntries( HYPRE_StructMatrix matrix, HYPRE_Int nentries, HYPRE_Int *entries ); + +HYPRE_Int +HYPRE_StructMatrixSetConstantValues_flt( HYPRE_StructMatrix matrix, HYPRE_Int nentries, HYPRE_Int *entries, hypre_float *values ); +HYPRE_Int +HYPRE_StructMatrixSetConstantValues_dbl( HYPRE_StructMatrix matrix, HYPRE_Int nentries, HYPRE_Int *entries, hypre_double *values ); +HYPRE_Int +HYPRE_StructMatrixSetConstantValues_long_dbl( HYPRE_StructMatrix matrix, HYPRE_Int nentries, HYPRE_Int *entries, hypre_long_double *values ); +HYPRE_Int +HYPRE_StructMatrixSetConstantValues( HYPRE_StructMatrix matrix, HYPRE_Int nentries, HYPRE_Int *entries, void *values ); + +HYPRE_Int +HYPRE_StructMatrixSetDomainStride_flt( HYPRE_StructMatrix matrix, HYPRE_Int *domain_stride ); +HYPRE_Int +HYPRE_StructMatrixSetDomainStride_dbl( HYPRE_StructMatrix matrix, HYPRE_Int *domain_stride ); +HYPRE_Int +HYPRE_StructMatrixSetDomainStride_long_dbl( HYPRE_StructMatrix matrix, HYPRE_Int *domain_stride ); +HYPRE_Int +HYPRE_StructMatrixSetDomainStride( HYPRE_StructMatrix matrix, HYPRE_Int *domain_stride ); + +HYPRE_Int +HYPRE_StructMatrixSetNumGhost_flt( HYPRE_StructMatrix matrix, HYPRE_Int *num_ghost ); +HYPRE_Int +HYPRE_StructMatrixSetNumGhost_dbl( HYPRE_StructMatrix matrix, HYPRE_Int *num_ghost ); +HYPRE_Int +HYPRE_StructMatrixSetNumGhost_long_dbl( HYPRE_StructMatrix matrix, HYPRE_Int *num_ghost ); +HYPRE_Int +HYPRE_StructMatrixSetNumGhost( HYPRE_StructMatrix matrix, HYPRE_Int *num_ghost ); + +HYPRE_Int +HYPRE_StructMatrixSetRangeStride_flt( HYPRE_StructMatrix matrix, HYPRE_Int *range_stride ); +HYPRE_Int +HYPRE_StructMatrixSetRangeStride_dbl( HYPRE_StructMatrix matrix, HYPRE_Int *range_stride ); +HYPRE_Int +HYPRE_StructMatrixSetRangeStride_long_dbl( HYPRE_StructMatrix matrix, HYPRE_Int *range_stride ); +HYPRE_Int +HYPRE_StructMatrixSetRangeStride( HYPRE_StructMatrix matrix, HYPRE_Int *range_stride ); + +HYPRE_Int +HYPRE_StructMatrixSetSymmetric_flt( HYPRE_StructMatrix matrix, HYPRE_Int symmetric ); +HYPRE_Int +HYPRE_StructMatrixSetSymmetric_dbl( HYPRE_StructMatrix matrix, HYPRE_Int symmetric ); +HYPRE_Int +HYPRE_StructMatrixSetSymmetric_long_dbl( HYPRE_StructMatrix matrix, HYPRE_Int symmetric ); +HYPRE_Int +HYPRE_StructMatrixSetSymmetric( HYPRE_StructMatrix matrix, HYPRE_Int symmetric ); + +HYPRE_Int +HYPRE_StructMatrixSetTranspose_flt( HYPRE_StructMatrix matrix, HYPRE_Int transpose ); +HYPRE_Int +HYPRE_StructMatrixSetTranspose_dbl( HYPRE_StructMatrix matrix, HYPRE_Int transpose ); +HYPRE_Int +HYPRE_StructMatrixSetTranspose_long_dbl( HYPRE_StructMatrix matrix, HYPRE_Int transpose ); +HYPRE_Int +HYPRE_StructMatrixSetTranspose( HYPRE_StructMatrix matrix, HYPRE_Int transpose ); + +HYPRE_Int +HYPRE_StructMatrixSetValues_flt( HYPRE_StructMatrix matrix, HYPRE_Int *index, HYPRE_Int nentries, HYPRE_Int *entries, hypre_float *values ); +HYPRE_Int +HYPRE_StructMatrixSetValues_dbl( HYPRE_StructMatrix matrix, HYPRE_Int *index, HYPRE_Int nentries, HYPRE_Int *entries, hypre_double *values ); +HYPRE_Int +HYPRE_StructMatrixSetValues_long_dbl( HYPRE_StructMatrix matrix, HYPRE_Int *index, HYPRE_Int nentries, HYPRE_Int *entries, hypre_long_double *values ); +HYPRE_Int +HYPRE_StructMatrixSetValues( HYPRE_StructMatrix matrix, HYPRE_Int *index, HYPRE_Int nentries, HYPRE_Int *entries, void *values ); + +HYPRE_Int +HYPRE_StructStencilCreate_flt( HYPRE_Int ndim, HYPRE_Int size, HYPRE_StructStencil *stencil ); +HYPRE_Int +HYPRE_StructStencilCreate_dbl( HYPRE_Int ndim, HYPRE_Int size, HYPRE_StructStencil *stencil ); +HYPRE_Int +HYPRE_StructStencilCreate_long_dbl( HYPRE_Int ndim, HYPRE_Int size, HYPRE_StructStencil *stencil ); +HYPRE_Int +HYPRE_StructStencilCreate( HYPRE_Int ndim, HYPRE_Int size, HYPRE_StructStencil *stencil ); + +HYPRE_Int +HYPRE_StructStencilDestroy_flt( HYPRE_StructStencil stencil ); +HYPRE_Int +HYPRE_StructStencilDestroy_dbl( HYPRE_StructStencil stencil ); +HYPRE_Int +HYPRE_StructStencilDestroy_long_dbl( HYPRE_StructStencil stencil ); +HYPRE_Int +HYPRE_StructStencilDestroy( HYPRE_StructStencil stencil ); + +HYPRE_Int +HYPRE_StructStencilSetElement_flt( HYPRE_StructStencil stencil, HYPRE_Int entry, HYPRE_Int *offset ); +HYPRE_Int +HYPRE_StructStencilSetElement_dbl( HYPRE_StructStencil stencil, HYPRE_Int entry, HYPRE_Int *offset ); +HYPRE_Int +HYPRE_StructStencilSetElement_long_dbl( HYPRE_StructStencil stencil, HYPRE_Int entry, HYPRE_Int *offset ); +HYPRE_Int +HYPRE_StructStencilSetElement( HYPRE_StructStencil stencil, HYPRE_Int entry, HYPRE_Int *offset ); + +HYPRE_Int +HYPRE_StructStencilSetEntry_flt( HYPRE_StructStencil stencil, HYPRE_Int entry, HYPRE_Int *offset ); +HYPRE_Int +HYPRE_StructStencilSetEntry_dbl( HYPRE_StructStencil stencil, HYPRE_Int entry, HYPRE_Int *offset ); +HYPRE_Int +HYPRE_StructStencilSetEntry_long_dbl( HYPRE_StructStencil stencil, HYPRE_Int entry, HYPRE_Int *offset ); +HYPRE_Int +HYPRE_StructStencilSetEntry( HYPRE_StructStencil stencil, HYPRE_Int entry, HYPRE_Int *offset ); + +HYPRE_Int +HYPRE_StructVectorAddToBoxValues_flt( HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, hypre_float *values ); +HYPRE_Int +HYPRE_StructVectorAddToBoxValues_dbl( HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, hypre_double *values ); +HYPRE_Int +HYPRE_StructVectorAddToBoxValues_long_dbl( HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, hypre_long_double *values ); +HYPRE_Int +HYPRE_StructVectorAddToBoxValues( HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, void *values ); + +HYPRE_Int +HYPRE_StructVectorAddToBoxValues2_flt( HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_float *values ); +HYPRE_Int +HYPRE_StructVectorAddToBoxValues2_dbl( HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_double *values ); +HYPRE_Int +HYPRE_StructVectorAddToBoxValues2_long_dbl( HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_long_double *values ); +HYPRE_Int +HYPRE_StructVectorAddToBoxValues2( HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ); + +HYPRE_Int +HYPRE_StructVectorAddToValues_flt( HYPRE_StructVector vector, HYPRE_Int *index, hypre_float *values ); +HYPRE_Int +HYPRE_StructVectorAddToValues_dbl( HYPRE_StructVector vector, HYPRE_Int *index, hypre_double *values ); +HYPRE_Int +HYPRE_StructVectorAddToValues_long_dbl( HYPRE_StructVector vector, HYPRE_Int *index, hypre_long_double *values ); +HYPRE_Int +HYPRE_StructVectorAddToValues( HYPRE_StructVector vector, HYPRE_Int *index, void *values ); + +HYPRE_Int +HYPRE_StructVectorAssemble_flt( HYPRE_StructVector vector ); +HYPRE_Int +HYPRE_StructVectorAssemble_dbl( HYPRE_StructVector vector ); +HYPRE_Int +HYPRE_StructVectorAssemble_long_dbl( HYPRE_StructVector vector ); +HYPRE_Int +HYPRE_StructVectorAssemble( HYPRE_StructVector vector ); + +HYPRE_Int +HYPRE_StructVectorAxpy_flt( hypre_float alpha, HYPRE_StructVector x, hypre_float beta, HYPRE_StructVector y ); +HYPRE_Int +HYPRE_StructVectorAxpy_dbl( hypre_double alpha, HYPRE_StructVector x, hypre_double beta, HYPRE_StructVector y ); +HYPRE_Int +HYPRE_StructVectorAxpy_long_dbl( hypre_long_double alpha, HYPRE_StructVector x, hypre_long_double beta, HYPRE_StructVector y ); +HYPRE_Int +HYPRE_StructVectorAxpy( hypre_long_double alpha, HYPRE_StructVector x, hypre_long_double beta, HYPRE_StructVector y ); + +HYPRE_Int +HYPRE_StructVectorClone_flt( HYPRE_StructVector x, HYPRE_StructVector *y_ptr ); +HYPRE_Int +HYPRE_StructVectorClone_dbl( HYPRE_StructVector x, HYPRE_StructVector *y_ptr ); +HYPRE_Int +HYPRE_StructVectorClone_long_dbl( HYPRE_StructVector x, HYPRE_StructVector *y_ptr ); +HYPRE_Int +HYPRE_StructVectorClone( HYPRE_StructVector x, HYPRE_StructVector *y_ptr ); + +HYPRE_Int +HYPRE_StructVectorCopy_flt( HYPRE_StructVector x, HYPRE_StructVector y ); +HYPRE_Int +HYPRE_StructVectorCopy_dbl( HYPRE_StructVector x, HYPRE_StructVector y ); +HYPRE_Int +HYPRE_StructVectorCopy_long_dbl( HYPRE_StructVector x, HYPRE_StructVector y ); +HYPRE_Int +HYPRE_StructVectorCopy( HYPRE_StructVector x, HYPRE_StructVector y ); + +HYPRE_Int +HYPRE_StructVectorCreate_flt( MPI_Comm comm, HYPRE_StructGrid grid, HYPRE_StructVector *vector ); +HYPRE_Int +HYPRE_StructVectorCreate_dbl( MPI_Comm comm, HYPRE_StructGrid grid, HYPRE_StructVector *vector ); +HYPRE_Int +HYPRE_StructVectorCreate_long_dbl( 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_flt( HYPRE_StructVector vector ); +HYPRE_Int +HYPRE_StructVectorDestroy_dbl( HYPRE_StructVector vector ); +HYPRE_Int +HYPRE_StructVectorDestroy_long_dbl( HYPRE_StructVector vector ); +HYPRE_Int +HYPRE_StructVectorDestroy( HYPRE_StructVector vector ); + +HYPRE_Int +HYPRE_StructVectorGetBoxValues_flt( HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, hypre_float *values ); +HYPRE_Int +HYPRE_StructVectorGetBoxValues_dbl( HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, hypre_double *values ); +HYPRE_Int +HYPRE_StructVectorGetBoxValues_long_dbl( HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, hypre_long_double *values ); +HYPRE_Int +HYPRE_StructVectorGetBoxValues( HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, void *values ); + +HYPRE_Int +HYPRE_StructVectorGetBoxValues2_flt( HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_float *values ); +HYPRE_Int +HYPRE_StructVectorGetBoxValues2_dbl( HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_double *values ); +HYPRE_Int +HYPRE_StructVectorGetBoxValues2_long_dbl( HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_long_double *values ); +HYPRE_Int +HYPRE_StructVectorGetBoxValues2( HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ); + +HYPRE_Int +HYPRE_StructVectorGetMigrateCommPkg_flt( HYPRE_StructVector from_vector, HYPRE_StructVector to_vector, HYPRE_CommPkg *comm_pkg ); +HYPRE_Int +HYPRE_StructVectorGetMigrateCommPkg_dbl( HYPRE_StructVector from_vector, HYPRE_StructVector to_vector, HYPRE_CommPkg *comm_pkg ); +HYPRE_Int +HYPRE_StructVectorGetMigrateCommPkg_long_dbl( HYPRE_StructVector from_vector, HYPRE_StructVector to_vector, HYPRE_CommPkg *comm_pkg ); +HYPRE_Int +HYPRE_StructVectorGetMigrateCommPkg( HYPRE_StructVector from_vector, HYPRE_StructVector to_vector, HYPRE_CommPkg *comm_pkg ); + +HYPRE_Int +HYPRE_StructVectorGetValues_flt( HYPRE_StructVector vector, HYPRE_Int *index, hypre_float *value ); +HYPRE_Int +HYPRE_StructVectorGetValues_dbl( HYPRE_StructVector vector, HYPRE_Int *index, hypre_double *value ); +HYPRE_Int +HYPRE_StructVectorGetValues_long_dbl( HYPRE_StructVector vector, HYPRE_Int *index, hypre_long_double *value ); +HYPRE_Int +HYPRE_StructVectorGetValues( HYPRE_StructVector vector, HYPRE_Int *index, void *value ); + +HYPRE_Int +HYPRE_StructVectorInitialize_flt( HYPRE_StructVector vector ); +HYPRE_Int +HYPRE_StructVectorInitialize_dbl( HYPRE_StructVector vector ); +HYPRE_Int +HYPRE_StructVectorInitialize_long_dbl( HYPRE_StructVector vector ); +HYPRE_Int +HYPRE_StructVectorInitialize( HYPRE_StructVector vector ); + +HYPRE_Int +HYPRE_StructVectorInnerProd_flt( HYPRE_StructVector x, HYPRE_StructVector y, hypre_float *result ); +HYPRE_Int +HYPRE_StructVectorInnerProd_dbl( HYPRE_StructVector x, HYPRE_StructVector y, hypre_double *result ); +HYPRE_Int +HYPRE_StructVectorInnerProd_long_dbl( HYPRE_StructVector x, HYPRE_StructVector y, hypre_long_double *result ); +HYPRE_Int +HYPRE_StructVectorInnerProd( HYPRE_StructVector x, HYPRE_StructVector y, void *result ); + +HYPRE_Int +HYPRE_StructVectorMigrate_flt( HYPRE_CommPkg comm_pkg, HYPRE_StructVector from_vector, HYPRE_StructVector to_vector ); +HYPRE_Int +HYPRE_StructVectorMigrate_dbl( HYPRE_CommPkg comm_pkg, HYPRE_StructVector from_vector, HYPRE_StructVector to_vector ); +HYPRE_Int +HYPRE_StructVectorMigrate_long_dbl( HYPRE_CommPkg comm_pkg, 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_flt( const char *filename, HYPRE_StructVector vector, HYPRE_Int all ); +HYPRE_Int +HYPRE_StructVectorPrint_dbl( const char *filename, HYPRE_StructVector vector, HYPRE_Int all ); +HYPRE_Int +HYPRE_StructVectorPrint_long_dbl( const char *filename, HYPRE_StructVector vector, HYPRE_Int all ); +HYPRE_Int +HYPRE_StructVectorPrint( const char *filename, HYPRE_StructVector vector, HYPRE_Int all ); + +HYPRE_Int +HYPRE_StructVectorRead_flt( MPI_Comm comm, const char *filename, HYPRE_Int *num_ghost, HYPRE_StructVector *vector ); +HYPRE_Int +HYPRE_StructVectorRead_dbl( MPI_Comm comm, const char *filename, HYPRE_Int *num_ghost, HYPRE_StructVector *vector ); +HYPRE_Int +HYPRE_StructVectorRead_long_dbl( MPI_Comm comm, const char *filename, HYPRE_Int *num_ghost, HYPRE_StructVector *vector ); +HYPRE_Int +HYPRE_StructVectorRead( MPI_Comm comm, const char *filename, HYPRE_Int *num_ghost, HYPRE_StructVector *vector ); + +HYPRE_Int +HYPRE_StructVectorScale_flt( hypre_float alpha, HYPRE_StructVector y ); +HYPRE_Int +HYPRE_StructVectorScale_dbl( hypre_double alpha, HYPRE_StructVector y ); +HYPRE_Int +HYPRE_StructVectorScale_long_dbl( hypre_long_double alpha, HYPRE_StructVector y ); +HYPRE_Int +HYPRE_StructVectorScale( hypre_long_double alpha, HYPRE_StructVector y ); + +HYPRE_Int +HYPRE_StructVectorScaleValues_flt( HYPRE_StructVector vector, hypre_float factor ); +HYPRE_Int +HYPRE_StructVectorScaleValues_dbl( HYPRE_StructVector vector, hypre_double factor ); +HYPRE_Int +HYPRE_StructVectorScaleValues_long_dbl( HYPRE_StructVector vector, hypre_long_double factor ); +HYPRE_Int +HYPRE_StructVectorScaleValues( HYPRE_StructVector vector, hypre_long_double factor ); + +HYPRE_Int +HYPRE_StructVectorSetBoxValues_flt( HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, hypre_float *values ); +HYPRE_Int +HYPRE_StructVectorSetBoxValues_dbl( HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, hypre_double *values ); +HYPRE_Int +HYPRE_StructVectorSetBoxValues_long_dbl( HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, hypre_long_double *values ); +HYPRE_Int +HYPRE_StructVectorSetBoxValues( HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, void *values ); + +HYPRE_Int +HYPRE_StructVectorSetBoxValues2_flt( HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_float *values ); +HYPRE_Int +HYPRE_StructVectorSetBoxValues2_dbl( HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_double *values ); +HYPRE_Int +HYPRE_StructVectorSetBoxValues2_long_dbl( HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *vilower, HYPRE_Int *viupper, hypre_long_double *values ); +HYPRE_Int +HYPRE_StructVectorSetBoxValues2( HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ); + +HYPRE_Int +HYPRE_StructVectorSetConstantValues_flt( HYPRE_StructVector vector, hypre_float value ); +HYPRE_Int +HYPRE_StructVectorSetConstantValues_dbl( HYPRE_StructVector vector, hypre_double value ); +HYPRE_Int +HYPRE_StructVectorSetConstantValues_long_dbl( HYPRE_StructVector vector, hypre_long_double value ); +HYPRE_Int +HYPRE_StructVectorSetConstantValues( HYPRE_StructVector vector, hypre_long_double value ); + +HYPRE_Int +HYPRE_StructVectorSetNumGhost_flt( HYPRE_StructVector vector, HYPRE_Int *num_ghost ); +HYPRE_Int +HYPRE_StructVectorSetNumGhost_dbl( HYPRE_StructVector vector, HYPRE_Int *num_ghost ); +HYPRE_Int +HYPRE_StructVectorSetNumGhost_long_dbl( HYPRE_StructVector vector, HYPRE_Int *num_ghost ); +HYPRE_Int +HYPRE_StructVectorSetNumGhost( HYPRE_StructVector vector, HYPRE_Int *num_ghost ); + +HYPRE_Int +HYPRE_StructVectorSetRandomValues_flt( HYPRE_StructVector vector, HYPRE_Int seed ); +HYPRE_Int +HYPRE_StructVectorSetRandomValues_dbl( HYPRE_StructVector vector, HYPRE_Int seed ); +HYPRE_Int +HYPRE_StructVectorSetRandomValues_long_dbl( HYPRE_StructVector vector, HYPRE_Int seed ); +HYPRE_Int +HYPRE_StructVectorSetRandomValues( HYPRE_StructVector vector, HYPRE_Int seed ); + +HYPRE_Int +HYPRE_StructVectorSetStride_flt( HYPRE_StructVector vector, HYPRE_Int *stride ); +HYPRE_Int +HYPRE_StructVectorSetStride_dbl( HYPRE_StructVector vector, HYPRE_Int *stride ); +HYPRE_Int +HYPRE_StructVectorSetStride_long_dbl( HYPRE_StructVector vector, HYPRE_Int *stride ); +HYPRE_Int +HYPRE_StructVectorSetStride( HYPRE_StructVector vector, HYPRE_Int *stride ); + +HYPRE_Int +HYPRE_StructVectorSetValues_flt( HYPRE_StructVector vector, HYPRE_Int *index, hypre_float *values ); +HYPRE_Int +HYPRE_StructVectorSetValues_dbl( HYPRE_StructVector vector, HYPRE_Int *index, hypre_double *values ); +HYPRE_Int +HYPRE_StructVectorSetValues_long_dbl( HYPRE_StructVector vector, HYPRE_Int *index, hypre_long_double *values ); +HYPRE_Int +HYPRE_StructVectorSetValues( HYPRE_StructVector vector, HYPRE_Int *index, void *values ); + + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_CommPkgDestroy_pre( HYPRE_Precision precision, HYPRE_CommPkg comm_pkg ); + +HYPRE_Int +HYPRE_StructGridAssemble_pre( HYPRE_Precision precision, HYPRE_StructGrid grid ); + +HYPRE_Int +HYPRE_StructGridCoarsen_pre( HYPRE_Precision precision, HYPRE_StructGrid grid, HYPRE_Int *stride, HYPRE_StructGrid *cgrid ); + +HYPRE_Int +HYPRE_StructGridCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_Int ndim, HYPRE_StructGrid *grid ); + +HYPRE_Int +HYPRE_StructGridDestroy_pre( HYPRE_Precision precision, HYPRE_StructGrid grid ); + +HYPRE_Int +HYPRE_StructGridPrintVTK_pre( HYPRE_Precision precision, const char *filename, HYPRE_StructGrid grid ); + +HYPRE_Int +HYPRE_StructGridProjectBox_pre( HYPRE_Precision precision, HYPRE_StructGrid grid, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *origin, HYPRE_Int *stride ); + +HYPRE_Int +HYPRE_StructGridSetExtents_pre( HYPRE_Precision precision, HYPRE_StructGrid grid, HYPRE_Int *ilower, HYPRE_Int *iupper ); + +HYPRE_Int +HYPRE_StructGridSetNumGhost_pre( HYPRE_Precision precision, HYPRE_StructGrid grid, HYPRE_Int *num_ghost ); + +HYPRE_Int +HYPRE_StructGridSetPeriodic_pre( HYPRE_Precision precision, HYPRE_StructGrid grid, HYPRE_Int *periodic ); + +HYPRE_Int +HYPRE_StructMatrixAddToBoxValues_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, void *values ); + +HYPRE_Int +HYPRE_StructMatrixAddToBoxValues2_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ); + +HYPRE_Int +HYPRE_StructMatrixAddToConstantValues_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int nentries, HYPRE_Int *entries, void *values ); + +HYPRE_Int +HYPRE_StructMatrixAddToValues_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int *index, HYPRE_Int nentries, HYPRE_Int *entries, void *values ); + +HYPRE_Int +HYPRE_StructMatrixAssemble_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix ); + +HYPRE_Int +HYPRE_StructMatrixClearBoundary_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix ); + +HYPRE_Int +HYPRE_StructMatrixCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_StructGrid grid, HYPRE_StructStencil stencil, HYPRE_StructMatrix *matrix ); + +HYPRE_Int +HYPRE_StructMatrixDestroy_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix ); + +HYPRE_Int +HYPRE_StructMatrixGetBoxValues_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, void *values ); + +HYPRE_Int +HYPRE_StructMatrixGetBoxValues2_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ); + +HYPRE_Int +HYPRE_StructMatrixGetGrid_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_StructGrid *grid ); + +HYPRE_Int +HYPRE_StructMatrixGetValues_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int *index, HYPRE_Int nentries, HYPRE_Int *entries, void *values ); + +HYPRE_Int +HYPRE_StructMatrixInitialize_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix ); + +HYPRE_Int +HYPRE_StructMatrixMatmat_pre( HYPRE_Precision precision, HYPRE_StructMatrix A, HYPRE_Int Atranspose, HYPRE_StructMatrix B, HYPRE_Int Btranspose, HYPRE_StructMatrix *C ); + +HYPRE_Int +HYPRE_StructMatrixMatvec_pre( HYPRE_Precision precision, hypre_long_double alpha, HYPRE_StructMatrix A, HYPRE_StructVector x, hypre_long_double beta, HYPRE_StructVector y ); + +HYPRE_Int +HYPRE_StructMatrixMatvecT_pre( HYPRE_Precision precision, hypre_long_double alpha, HYPRE_StructMatrix A, HYPRE_StructVector x, hypre_long_double beta, HYPRE_StructVector y ); + +HYPRE_Int +HYPRE_StructMatrixPrint_pre( HYPRE_Precision precision, const char *filename, HYPRE_StructMatrix matrix, HYPRE_Int all ); + +HYPRE_Int +HYPRE_StructMatrixRead_pre( HYPRE_Precision precision, MPI_Comm comm, const char *filename, HYPRE_Int *num_ghost, HYPRE_StructMatrix *matrix ); + +HYPRE_Int +HYPRE_StructMatrixSetBoxValues_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, void *values ); + +HYPRE_Int +HYPRE_StructMatrixSetBoxValues2_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ); + +HYPRE_Int +HYPRE_StructMatrixSetConstantEntries_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int nentries, HYPRE_Int *entries ); + +HYPRE_Int +HYPRE_StructMatrixSetConstantValues_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int nentries, HYPRE_Int *entries, void *values ); + +HYPRE_Int +HYPRE_StructMatrixSetDomainStride_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int *domain_stride ); + +HYPRE_Int +HYPRE_StructMatrixSetNumGhost_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int *num_ghost ); + +HYPRE_Int +HYPRE_StructMatrixSetRangeStride_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int *range_stride ); + +HYPRE_Int +HYPRE_StructMatrixSetSymmetric_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int symmetric ); + +HYPRE_Int +HYPRE_StructMatrixSetTranspose_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int transpose ); + +HYPRE_Int +HYPRE_StructMatrixSetValues_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int *index, HYPRE_Int nentries, HYPRE_Int *entries, void *values ); + +HYPRE_Int +HYPRE_StructStencilCreate_pre( HYPRE_Precision precision, HYPRE_Int ndim, HYPRE_Int size, HYPRE_StructStencil *stencil ); + +HYPRE_Int +HYPRE_StructStencilDestroy_pre( HYPRE_Precision precision, HYPRE_StructStencil stencil ); + +HYPRE_Int +HYPRE_StructStencilSetElement_pre( HYPRE_Precision precision, HYPRE_StructStencil stencil, HYPRE_Int entry, HYPRE_Int *offset ); + +HYPRE_Int +HYPRE_StructStencilSetEntry_pre( HYPRE_Precision precision, HYPRE_StructStencil stencil, HYPRE_Int entry, HYPRE_Int *offset ); + +HYPRE_Int +HYPRE_StructVectorAddToBoxValues_pre( HYPRE_Precision precision, HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, void *values ); + +HYPRE_Int +HYPRE_StructVectorAddToBoxValues2_pre( HYPRE_Precision precision, HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ); + +HYPRE_Int +HYPRE_StructVectorAddToValues_pre( HYPRE_Precision precision, HYPRE_StructVector vector, HYPRE_Int *index, void *values ); + +HYPRE_Int +HYPRE_StructVectorAssemble_pre( HYPRE_Precision precision, HYPRE_StructVector vector ); + +HYPRE_Int +HYPRE_StructVectorAxpy_pre( HYPRE_Precision precision, hypre_long_double alpha, HYPRE_StructVector x, hypre_long_double beta, HYPRE_StructVector y ); + +HYPRE_Int +HYPRE_StructVectorClone_pre( HYPRE_Precision precision, HYPRE_StructVector x, HYPRE_StructVector *y_ptr ); + +HYPRE_Int +HYPRE_StructVectorCopy_pre( HYPRE_Precision precision, HYPRE_StructVector x, HYPRE_StructVector y ); + +HYPRE_Int +HYPRE_StructVectorCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_StructGrid grid, HYPRE_StructVector *vector ); + +HYPRE_Int +HYPRE_StructVectorDestroy_pre( HYPRE_Precision precision, HYPRE_StructVector vector ); + +HYPRE_Int +HYPRE_StructVectorGetBoxValues_pre( HYPRE_Precision precision, HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, void *values ); + +HYPRE_Int +HYPRE_StructVectorGetBoxValues2_pre( HYPRE_Precision precision, HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ); + +HYPRE_Int +HYPRE_StructVectorGetMigrateCommPkg_pre( HYPRE_Precision precision, HYPRE_StructVector from_vector, HYPRE_StructVector to_vector, HYPRE_CommPkg *comm_pkg ); + +HYPRE_Int +HYPRE_StructVectorGetValues_pre( HYPRE_Precision precision, HYPRE_StructVector vector, HYPRE_Int *index, void *value ); + +HYPRE_Int +HYPRE_StructVectorInitialize_pre( HYPRE_Precision precision, HYPRE_StructVector vector ); + +HYPRE_Int +HYPRE_StructVectorInnerProd_pre( HYPRE_Precision precision, HYPRE_StructVector x, HYPRE_StructVector y, void *result ); + +HYPRE_Int +HYPRE_StructVectorMigrate_pre( HYPRE_Precision precision, HYPRE_CommPkg comm_pkg, HYPRE_StructVector from_vector, HYPRE_StructVector to_vector ); + +HYPRE_Int +HYPRE_StructVectorPrint_pre( HYPRE_Precision precision, const char *filename, HYPRE_StructVector vector, HYPRE_Int all ); + +HYPRE_Int +HYPRE_StructVectorRead_pre( HYPRE_Precision precision, MPI_Comm comm, const char *filename, HYPRE_Int *num_ghost, HYPRE_StructVector *vector ); + +HYPRE_Int +HYPRE_StructVectorScale_pre( HYPRE_Precision precision, hypre_long_double alpha, HYPRE_StructVector y ); + +HYPRE_Int +HYPRE_StructVectorScaleValues_pre( HYPRE_Precision precision, HYPRE_StructVector vector, hypre_long_double factor ); + +HYPRE_Int +HYPRE_StructVectorSetBoxValues_pre( HYPRE_Precision precision, HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, void *values ); + +HYPRE_Int +HYPRE_StructVectorSetBoxValues2_pre( HYPRE_Precision precision, HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ); + +HYPRE_Int +HYPRE_StructVectorSetConstantValues_pre( HYPRE_Precision precision, HYPRE_StructVector vector, hypre_long_double value ); + +HYPRE_Int +HYPRE_StructVectorSetNumGhost_pre( HYPRE_Precision precision, HYPRE_StructVector vector, HYPRE_Int *num_ghost ); + +HYPRE_Int +HYPRE_StructVectorSetRandomValues_pre( HYPRE_Precision precision, HYPRE_StructVector vector, HYPRE_Int seed ); + +HYPRE_Int +HYPRE_StructVectorSetStride_pre( HYPRE_Precision precision, HYPRE_StructVector vector, HYPRE_Int *stride ); + +HYPRE_Int +HYPRE_StructVectorSetValues_pre( HYPRE_Precision precision, HYPRE_StructVector vector, HYPRE_Int *index, void *values ); + + +#endif + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/src/struct_mv/HYPRE_struct_stencil.c b/src/struct_mv/HYPRE_struct_stencil.c index b560821140..a40dd576d2 100644 --- a/src/struct_mv/HYPRE_struct_stencil.c +++ b/src/struct_mv/HYPRE_struct_stencil.c @@ -32,27 +32,51 @@ HYPRE_StructStencilCreate( HYPRE_Int dim, } /*-------------------------------------------------------------------------- - * HYPRE_StructStencilSetElement + * HYPRE_StructStencilSetEntry *--------------------------------------------------------------------------*/ HYPRE_Int -HYPRE_StructStencilSetElement( HYPRE_StructStencil stencil, - HYPRE_Int element_index, - HYPRE_Int *offset ) +HYPRE_StructStencilSetEntry( HYPRE_StructStencil stencil, + HYPRE_Int entry, + HYPRE_Int *offset ) { hypre_Index *shape; HYPRE_Int d; + HYPRE_Int is_diag = 1; shape = hypre_StructStencilShape(stencil); - hypre_SetIndex(shape[element_index], 0); + hypre_SetIndex(shape[entry], 0); for (d = 0; d < hypre_StructStencilNDim(stencil); d++) { - hypre_IndexD(shape[element_index], d) = offset[d]; + hypre_IndexD(shape[entry], d) = offset[d]; + + if (is_diag && offset[d] != 0) + { + is_diag = 0; + } + } + + if (is_diag) + { + hypre_StructStencilDiagEntry(stencil) = entry; } return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * OBSOLETE + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructStencilSetElement( HYPRE_StructStencil stencil, + HYPRE_Int entry, + HYPRE_Int *offset ) +{ + HYPRE_StructStencilSetEntry(stencil, entry, offset); + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- * HYPRE_StructStencilDestroy *--------------------------------------------------------------------------*/ @@ -62,4 +86,3 @@ HYPRE_StructStencilDestroy( HYPRE_StructStencil stencil ) { return ( hypre_StructStencilDestroy(stencil) ); } - diff --git a/src/struct_mv/HYPRE_struct_vector.c b/src/struct_mv/HYPRE_struct_vector.c index 66d567f8a0..e64e548fc0 100644 --- a/src/struct_mv/HYPRE_struct_vector.c +++ b/src/struct_mv/HYPRE_struct_vector.c @@ -37,6 +37,21 @@ HYPRE_StructVectorDestroy( HYPRE_StructVector struct_vector ) return ( hypre_StructVectorDestroy(struct_vector) ); } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +/* RDF: Need a good user interface for setting the grid. */ + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorSetStride(HYPRE_StructVector vector, + HYPRE_Int *stride) +{ + return ( hypre_StructVectorSetStride(vector, stride) ); +} + /*-------------------------------------------------------------------------- * HYPRE_StructVectorInitialize *--------------------------------------------------------------------------*/ @@ -44,7 +59,7 @@ HYPRE_StructVectorDestroy( HYPRE_StructVector struct_vector ) HYPRE_Int HYPRE_StructVectorInitialize( HYPRE_StructVector vector ) { - return ( hypre_StructVectorInitialize(vector) ); + return ( hypre_StructVectorInitialize(vector, 1) ); } /*-------------------------------------------------------------------------- @@ -54,7 +69,7 @@ HYPRE_StructVectorInitialize( HYPRE_StructVector vector ) HYPRE_Int HYPRE_StructVectorSetValues( HYPRE_StructVector vector, HYPRE_Int *grid_index, - HYPRE_Complex values ) + HYPRE_Complex *values ) { hypre_Index new_grid_index; @@ -66,7 +81,7 @@ HYPRE_StructVectorSetValues( HYPRE_StructVector vector, hypre_IndexD(new_grid_index, d) = grid_index[d]; } - hypre_StructVectorSetValues(vector, new_grid_index, &values, 0, -1, 0); + hypre_StructVectorSetValues(vector, new_grid_index, values, 0, -1, 0); return hypre_error_flag; } @@ -127,7 +142,7 @@ HYPRE_StructVectorSetBoxValues2( HYPRE_StructVector vector, HYPRE_Int HYPRE_StructVectorAddToValues( HYPRE_StructVector vector, HYPRE_Int *grid_index, - HYPRE_Complex values ) + HYPRE_Complex *values ) { hypre_Index new_grid_index; @@ -139,7 +154,7 @@ HYPRE_StructVectorAddToValues( HYPRE_StructVector vector, hypre_IndexD(new_grid_index, d) = grid_index[d]; } - hypre_StructVectorSetValues(vector, new_grid_index, &values, 1, -1, 0); + hypre_StructVectorSetValues(vector, new_grid_index, values, 1, -1, 0); return hypre_error_flag; } @@ -193,6 +208,30 @@ HYPRE_StructVectorAddToBoxValues2( HYPRE_StructVector vector, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * HYPRE_StructVectorAxpy + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorAxpy( HYPRE_Complex alpha, + HYPRE_StructVector x, + HYPRE_Complex beta, + HYPRE_StructVector y ) +{ + return hypre_StructVectorAxpy( alpha, x, beta, y, y ); +} + +/*-------------------------------------------------------------------------- + * HYPRE_StructVectorScaleValues + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorScale( HYPRE_Complex alpha, + HYPRE_StructVector y ) +{ + return hypre_StructVectorScaleValues( y, alpha ); +} + /*-------------------------------------------------------------------------- * HYPRE_StructVectorScaleValues *--------------------------------------------------------------------------*/ @@ -332,15 +371,12 @@ HYPRE_StructVectorSetNumGhost( HYPRE_StructVector vector, /*-------------------------------------------------------------------------- * HYPRE_StructVectorCopy - * copies data from x to y - * y has its own data array, so this is a deep copy in that sense. - * The grid and other size information are not copied - they are - * assumed to be consistent already. *--------------------------------------------------------------------------*/ + HYPRE_Int HYPRE_StructVectorCopy( HYPRE_StructVector x, HYPRE_StructVector y ) { - return ( hypre_StructVectorCopy( x, y ) ); + return ( hypre_StructCopy( x, y ) ); } /*-------------------------------------------------------------------------- @@ -349,9 +385,21 @@ HYPRE_StructVectorCopy( HYPRE_StructVector x, HYPRE_StructVector y ) HYPRE_Int HYPRE_StructVectorSetConstantValues( HYPRE_StructVector vector, - HYPRE_Complex values ) + HYPRE_Complex value ) +{ + return ( hypre_StructVectorSetConstantValues(vector, value) ); +} + + +/*-------------------------------------------------------------------------- + * HYPRE_StructVectorSetRandomValues + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorSetRandomValues( HYPRE_StructVector vector, + HYPRE_Int seed ) { - return ( hypre_StructVectorSetConstantValues(vector, values) ); + return ( hypre_StructVectorSetRandomValues(vector, seed) ); } /*-------------------------------------------------------------------------- @@ -402,3 +450,17 @@ HYPRE_StructVectorClone( HYPRE_StructVector x, return hypre_error_flag; } + +/*-------------------------------------------------------------------------- + * HYPRE_StructVectorInnerProd + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorInnerProd( HYPRE_StructVector x, + HYPRE_StructVector y, + HYPRE_Real *result ) +{ + *result = hypre_StructInnerProd(x, y); + + return hypre_error_flag; +} diff --git a/src/struct_mv/Makefile b/src/struct_mv/Makefile index 2092fa02be..dfb0c21590 100644 --- a/src/struct_mv/Makefile +++ b/src/struct_mv/Makefile @@ -20,20 +20,25 @@ HEADERS =\ _hypre_struct_mv.hpp\ assumed_part.h\ box.h\ + box_ds.h\ box_manager.h\ computation.h\ struct_communication.h\ struct_grid.h\ struct_matrix.h\ struct_stencil.h\ - struct_vector.h + struct_stmatrix.h\ + struct_vector.h\ + struct_matmult.h FILES =\ assumed_part.c\ box_algebra.c\ box_boundary.c\ box.c\ + box_ds.c\ box_manager.c\ + coarsen.c\ communication_info.c\ computation.c\ F90_HYPRE_struct_grid.c\ @@ -48,22 +53,52 @@ FILES =\ struct_grid.c\ struct_io.c\ struct_matrix_mask.c\ - struct_stencil.c + struct_stencil.c\ + struct_stmatrix.c CUFILES =\ struct_axpy.c\ struct_communication.c\ struct_copy.c\ + struct_data.c\ struct_innerprod.c\ + struct_matmult.c\ + struct_matmult_core.c\ + struct_matmult_fuse.c\ + struct_matop.c\ struct_matrix.c\ struct_matvec.c\ + struct_matvec_core.c\ struct_scale.c\ struct_vector.c +# Mixed precision files +MP_FILES = \ + mup_fixed.c\ + mup_functions.c\ + mup_pre.c\ + HYPRE_struct_mv_mp.c\ + struct_mv_mp.c + COBJS = ${FILES:.c=.o} CUOBJS = ${CUFILES:.c=.obj} OBJS = ${COBJS} ${CUOBJS} +ifeq (${MP_BUILD}, 1) + +COBJS_single = ${FILES:.c=.o_flt} +COBJS_double = ${FILES:.c=.o_dbl} +COBJS_longdouble = ${FILES:.c=.o_ldbl} +CUOBJS_single = ${CUFILES:.c=.obj_flt} +CUOBJS_double = ${CUFILES:.c=.obj_dbl} +CUOBJS_longdouble = ${CUFILES:.c=.obj_ldbl} +MP_COBJS = ${MP_FILES:.c=.o} + +OBJS = ${COBJS_single} ${COBJS_double} ${COBJS_longdouble} ${MP_COBJS} +OBJS += ${CUOBJS_single} ${CUOBJS_double} ${CUOBJS_longdouble} + +endif + SONAME = libHYPRE_struct_mv-${HYPRE_RELEASE_VERSION}${HYPRE_LIB_SUFFIX} ################################################################## @@ -72,17 +107,19 @@ SONAME = libHYPRE_struct_mv-${HYPRE_RELEASE_VERSION}${HYPRE_LIB_SUFFIX} all: libHYPRE_struct_mv${HYPRE_LIB_SUFFIX} cp -fR $(srcdir)/HYPRE_*.h $(HYPRE_BUILD_DIR)/include - cp -fR $(srcdir)/_hypre_struct_mv.h $(HYPRE_BUILD_DIR)/include + cp -fR $(srcdir)/_hypre_*.h $(HYPRE_BUILD_DIR)/include cp -fR $(srcdir)/_hypre_struct_mv.hpp $(HYPRE_BUILD_DIR)/include # cp -fR libHYPRE* $(HYPRE_BUILD_DIR)/lib install: libHYPRE_struct_mv${HYPRE_LIB_SUFFIX} cp -fR $(srcdir)/HYPRE_*.h $(HYPRE_INC_INSTALL) - cp -fR $(srcdir)/_hypre_struct_mv.h $(HYPRE_INC_INSTALL) + cp -fR $(srcdir)/_hypre_*.h $(HYPRE_INC_INSTALL) # cp -fR libHYPRE* $(HYPRE_LIB_INSTALL) clean: rm -f *.o *.obj libHYPRE* + rm -f *.o_flt *.o_dbl *.o_ldbl *.o_def + rm -f *.obj_flt *.obj_dbl *.obj_ldbl *.obj_def rm -rf pchdir tca.map *inslog* distclean: clean diff --git a/src/struct_mv/_hypre_struct_mv.h b/src/struct_mv/_hypre_struct_mv.h index 4086b648d7..375b20986e 100644 --- a/src/struct_mv/_hypre_struct_mv.h +++ b/src/struct_mv/_hypre_struct_mv.h @@ -12,6 +12,10 @@ #include "HYPRE_struct_mv.h" #include "_hypre_utilities.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_struct_mv_mup_def.h" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -73,6 +77,7 @@ typedef struct hypre_BoxArray_struct HYPRE_Int size; /* Size of box array */ HYPRE_Int alloc_size; /* Size of currently alloced space */ HYPRE_Int ndim; /* number of dimensions */ + HYPRE_Int *ids; /* box identifiers */ } hypre_BoxArray; @@ -88,7 +93,9 @@ typedef struct hypre_BoxArrayArray_struct { hypre_BoxArray **box_arrays; /* Array of pointers to box arrays */ HYPRE_Int size; /* Size of box array array */ + HYPRE_Int alloc_size; /* Size of currently alloced space */ HYPRE_Int ndim; /* number of dimensions */ + HYPRE_Int *ids; /* box array identifiers */ } hypre_BoxArrayArray; @@ -132,6 +139,17 @@ hypre_max(0, (hypre_BoxIMaxD(box, d) - hypre_BoxIMinD(box, d) + 1)) #define hypre_IndexDInBox(index, d, box) \ ( hypre_IndexD(index, d) >= hypre_BoxIMinD(box, d) && \ hypre_IndexD(index, d) <= hypre_BoxIMaxD(box, d) ) +#define hypre_BoxSpanIndex(box, index)\ +{\ + HYPRE_Int d;\ + for (d = 0; d < hypre_BoxNDim(box); d++)\ + {\ + hypre_BoxIMinD(box, d) =\ + hypre_min(hypre_BoxIMinD(box, d), hypre_IndexD(index, d));\ + hypre_BoxIMaxD(box, d) =\ + hypre_max(hypre_BoxIMaxD(box, d), hypre_IndexD(index, d));\ + }\ +} /* The first hypre_CCBoxIndexRank is better style because it is similar to hypre_BoxIndexRank. The second one sometimes avoids compiler warnings. */ @@ -154,6 +172,8 @@ hypre_max(0, (hypre_BoxIMaxD(box, d) - hypre_BoxIMinD(box, d) + 1)) #define hypre_BoxArraySize(box_array) ((box_array) -> size) #define hypre_BoxArrayAllocSize(box_array) ((box_array) -> alloc_size) #define hypre_BoxArrayNDim(box_array) ((box_array) -> ndim) +#define hypre_BoxArrayIDs(box_array) ((box_array) -> ids) +#define hypre_BoxArrayID(box_array, i) ((box_array) -> ids[i]) /*-------------------------------------------------------------------------- * Accessor macros: hypre_BoxArrayArray @@ -165,8 +185,14 @@ hypre_max(0, (hypre_BoxIMaxD(box, d) - hypre_BoxIMinD(box, d) + 1)) ((box_array_array) -> box_arrays[(i)]) #define hypre_BoxArrayArraySize(box_array_array) \ ((box_array_array) -> size) +#define hypre_BoxArrayArrayAllocSize(box_array_array) \ +((box_array_array) -> alloc_size) #define hypre_BoxArrayArrayNDim(box_array_array) \ ((box_array_array) -> ndim) +#define hypre_BoxArrayArrayIDs(box_array_array) \ +((box_array_array) -> ids) +#define hypre_BoxArrayArrayID(box_array_array, i) \ +((box_array_array) -> ids[i]) /*-------------------------------------------------------------------------- * Looping macros: @@ -288,7 +314,10 @@ for (hypre__d = 1; hypre__d < hypre__ndim; hypre__d++)\ } /* Use this before the For macros below to force only one block */ -#define zypre_BoxLoopSetOneBlock() hypre__num_blocks = 1 +#define zypre_BoxLoopSetOneBlock() \ +hypre__num_blocks = 1;\ +hypre__div = hypre__tot;\ +hypre__mod = 0; /* Use this to get the block iteration inside a BoxLoop */ #define zypre_BoxLoopBlock() hypre__block @@ -358,57 +387,63 @@ dbox1, start1, stride1, i1, * Idea 2: Simple version of Idea 3 below *----------------------------------------*/ -N = 1; -for (d = 0; d < ndim; d++) -{ -N *= n[d]; - i[d] = 0; - n[d] -= 2; /* this produces a simpler comparison below */ -} -i[ndim] = 0; -n[ndim] = 0; -for (I = 0; I < N; I++) +void Idea2() /* This function line allows astyle to indent the following correctly */ { -/* loop body */ - -for (d = 0; i[d] > n[d]; d++) + N = 1; + for (d = 0; d < ndim; d++) { + N *= n[d]; i[d] = 0; + n[d] -= 2; /* this produces a simpler comparison below */ + } + i[ndim] = 0; + n[ndim] = 0; + for (I = 0; I < N; I++) + { + /* loop body */ + + for (d = 0; i[d] > n[d]; d++) + { + i[d] = 0; + } + i[d]++; + i1 += s1[d]; /* NOTE: These are different from hypre__sx1, etc. above */ + i2 += s2[d]; /* The lengths of i, n, and s must be (ndim+1) */ } - i[d]++; - i1 += s1[d]; /* NOTE: These are different from hypre__sx1, etc. above */ - i2 += s2[d]; /* The lengths of i, n, and s must be (ndim+1) */ } /*---------------------------------------- * Idea 3: Approach used in the box loops *----------------------------------------*/ -N = 1; -for (d = 1; d < ndim; d++) -{ -N *= n[d]; - i[d] = 0; - n[d] -= 2; /* this produces a simpler comparison below */ -} -i[ndim] = 0; -n[ndim] = 0; -for (J = 0; J < N; J++) +void Idea3() /* This function line allows astyle to indent the following correctly */ { -for (I = 0; I < n[0]; I++) + N = 1; + for (d = 1; d < ndim; d++) { - /* loop body */ - - i1 += s1[0]; - i2 += s2[0]; + N *= n[d]; + i[d] = 0; + n[d] -= 2; /* this produces a simpler comparison below */ } - for (d = 1; i[d] > n[d]; d++) + i[ndim] = 0; + n[ndim] = 0; + for (J = 0; J < N; J++) { - i[d] = 0; + for (I = 0; I < n[0]; I++) + { + /* loop body */ + + i1 += s1[0]; + i2 += s2[0]; + } + for (d = 1; i[d] > n[d]; d++) + { + i[d] = 0; + } + i[d]++; + i1 += s1[d]; /* NOTE: These are different from hypre__sx1, etc. above */ + i2 += s2[d]; /* The lengths of i, n, and s must be (ndim+1) */ } - i[d]++; - i1 += s1[d]; /* NOTE: These are different from hypre__sx1, etc. above */ - i2 += s2[d]; /* The lengths of i, n, and s must be (ndim+1) */ } #endif @@ -420,6 +455,98 @@ for (I = 0; I < n[0]; I++) * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ +/****************************************************************************** + * + * Header info for different box data structures + * + * TODO: Move BoxArray here + * + *****************************************************************************/ + +#ifndef hypre_BOX_DS_HEADER +#define hypre_BOX_DS_HEADER + +/*-------------------------------------------------------------------------- + * hypre_BoxBTNode: + * + * Box binary tree node + *--------------------------------------------------------------------------*/ +typedef struct hypre_BoxBTNode_struct +{ + HYPRE_Int num_indices; + HYPRE_Int *indices[HYPRE_MAXDIM]; + hypre_Box *box; + struct hypre_BoxBTNode_struct *left; + struct hypre_BoxBTNode_struct *right; +} hypre_BoxBTNode; + +#define hypre_BoxBTNodeNDim(btnode) ((btnode) -> box -> ndim) +#define hypre_BoxBTNodeNumIndices(btnode) ((btnode) -> num_indices) +#define hypre_BoxBTNodeIndices(btnode, d) ((btnode) -> indices[d]) +#define hypre_BoxBTNodeIndex(btnode, d, i) ((btnode) -> indices[d][i]) +#define hypre_BoxBTNodeBox(btnode) ((btnode) -> box) +#define hypre_BoxBTNodeLeft(btnode) ((btnode) -> left) +#define hypre_BoxBTNodeRight(btnode) ((btnode) -> right) + +/*-------------------------------------------------------------------------- + * hypre_BoxBinTree: + * + * Box binary tree + *--------------------------------------------------------------------------*/ +typedef struct hypre_BoxBinTree_struct +{ + hypre_BoxBTNode *btroot; +} hypre_BoxBinTree; + +#define hypre_BoxBinTreeRoot(boxbt) ((boxbt) -> btroot) + +/*-------------------------------------------------------------------------- + * hypre_BoxBTStack: + * + * Stack of box binary tree nodes + *--------------------------------------------------------------------------*/ +typedef struct hypre_BoxBTStack_struct +{ + HYPRE_Int size; + HYPRE_Int capacity; + hypre_BoxBTNode **nodes; +} hypre_BoxBTStack; + +#define hypre_BoxBTStackSize(btstack) ((btstack) -> size) +#define hypre_BoxBTStackCapacity(btstack) ((btstack) -> capacity) +#define hypre_BoxBTStackNodes(btstack) ((btstack) -> nodes) +#define hypre_BoxBTStackNode(btstack, i) ((btstack) -> nodes[i]) +#define hypre_BoxBTStackNodePeek(btstack) ((btstack) -> nodes[(btstack) -> size - 1]) + +/*-------------------------------------------------------------------------- + * hypre_BoxBTQueue: + * + * Queue of box binary tree nodes + *--------------------------------------------------------------------------*/ +typedef struct hypre_BoxBTQueue_struct +{ + HYPRE_Int head; + HYPRE_Int tail; + HYPRE_Int size; + HYPRE_Int capacity; + hypre_BoxBTNode **nodes; +} hypre_BoxBTQueue; + +#define hypre_BoxBTQueueHead(btqueue) ((btqueue) -> head) +#define hypre_BoxBTQueueTail(btqueue) ((btqueue) -> tail) +#define hypre_BoxBTQueueSize(btqueue) ((btqueue) -> size) +#define hypre_BoxBTQueueCapacity(btqueue) ((btqueue) -> capacity) +#define hypre_BoxBTQueueNodes(btqueue) ((btqueue) -> nodes) +#define hypre_BoxBTQueueNode(btqueue, i) ((btqueue) -> nodes[i]) + +#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) + ******************************************************************************/ + /****************************************************************************** * * Header info for the struct assumed partition @@ -439,11 +566,13 @@ typedef struct (this is size num_regions +1) */ hypre_Index *divisions; /* number of proc divisions in each direction for each region */ + + hypre_Index origin, stride; /* coarsening parameters for the AP */ + /* these entries are specific to each proc */ hypre_BoxArray *my_partition; /* my portion of grid (at most 2) */ 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_alloc; HYPRE_Int my_partition_num_distinct_procs; @@ -460,16 +589,16 @@ typedef struct #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_StructAssumedPartOrigin(apart) ((apart)->origin) +#define hypre_StructAssumedPartStride(apart) ((apart)->stride) #define hypre_StructAssumedPartMyPartition(apart) ((apart)->my_partition) #define hypre_StructAssumedPartMyPartitionBoxes(apart) ((apart)->my_partition_boxes) #define hypre_StructAssumedPartMyPartitionProcIds(apart) ((apart)->my_partition_proc_ids) #define hypre_StructAssumedPartMyPartitionIdsSize(apart) ((apart)->my_partition_ids_size) #define hypre_StructAssumedPartMyPartitionIdsAlloc(apart) ((apart)->my_partition_ids_alloc) #define hypre_StructAssumedPartMyPartitionNumDistinctProcs(apart) ((apart)->my_partition_num_distinct_procs) -#define hypre_StructAssumedPartMyPartitionBoxnums(apart) ((apart)->my_partition_boxnums) - #define hypre_StructAssumedPartMyPartitionProcId(apart, i) ((apart)->my_partition_proc_ids[i]) -#define hypre_StructAssumedPartMyPartitionBoxnum(apart, i) ((apart)->my_partition_boxnums[i]) + #endif /****************************************************************************** * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other @@ -690,7 +819,7 @@ typedef struct hypre_StructGrid_struct HYPRE_Int ndim; /* Number of grid dimensions */ hypre_BoxArray *boxes; /* Array of boxes in this process */ - HYPRE_Int *ids; /* Unique IDs for boxes */ + HYPRE_Int *ids; /* Unique IDs for boxes - RDF TODO: Use boxes IDs instead */ hypre_Index max_distance; /* Neighborhood size - in each dimension*/ hypre_Box *bounding_box; /* Bounding box around grid */ @@ -703,14 +832,13 @@ typedef struct hypre_StructGrid_struct hypre_Index *pshifts; /* shifts of periodicity */ - HYPRE_Int ref_count; - HYPRE_Int ghlocal_size; /* Number of vars in box including ghosts */ HYPRE_Int num_ghost[2 * HYPRE_MAXDIM]; /* ghost layer size */ hypre_BoxManager *boxman; + } hypre_StructGrid; /*-------------------------------------------------------------------------- @@ -721,6 +849,7 @@ typedef struct hypre_StructGrid_struct #define hypre_StructGridNDim(grid) ((grid) -> ndim) #define hypre_StructGridBoxes(grid) ((grid) -> boxes) #define hypre_StructGridIDs(grid) ((grid) -> ids) +#define hypre_StructGridID(grid, i) ((grid) -> ids[i]) #define hypre_StructGridMaxDistance(grid) ((grid) -> max_distance) #define hypre_StructGridBoundingBox(grid) ((grid) -> bounding_box) #define hypre_StructGridLocalSize(grid) ((grid) -> local_size) @@ -741,6 +870,7 @@ typedef struct hypre_StructGrid_struct #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) #define hypre_StructGridDataLocation(grid) ((grid) -> data_location) #endif + /*-------------------------------------------------------------------------- * Looping macros: *--------------------------------------------------------------------------*/ @@ -777,12 +907,13 @@ typedef struct hypre_StructGrid_struct 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_Index *shape; /* Description of a stencil's shape */ + HYPRE_Int size; /* Number of stencil coefficients */ + HYPRE_Int ndim; /* Number of dimensions */ + HYPRE_Int diag_entry; /* Index of the diagonal entry (zero offset) */ HYPRE_Int ref_count; + } hypre_StructStencil; /*-------------------------------------------------------------------------- @@ -792,8 +923,11 @@ typedef struct hypre_StructStencil_struct #define hypre_StructStencilShape(stencil) ((stencil) -> shape) #define hypre_StructStencilSize(stencil) ((stencil) -> size) #define hypre_StructStencilNDim(stencil) ((stencil) -> ndim) +#define hypre_StructStencilDiagEntry(stencil) ((stencil) -> diag_entry) #define hypre_StructStencilRefCount(stencil) ((stencil) -> ref_count) -#define hypre_StructStencilElement(stencil, i) hypre_StructStencilShape(stencil)[i] + +#define hypre_StructStencilOffset(stencil, i) \ +hypre_StructStencilShape(stencil)[i] #endif /****************************************************************************** @@ -807,8 +941,20 @@ typedef struct hypre_StructStencil_struct #define hypre_COMMUNICATION_HEADER /*-------------------------------------------------------------------------- - * hypre_CommInfo: - * + *--------------------------------------------------------------------------*/ + +typedef struct hypre_CommStencil_struct +{ + HYPRE_Int ndim; + hypre_Box *box; /* extents of data array */ + HYPRE_Int *data; /* non-zero values indicate communication */ + hypre_Index stride; + HYPRE_Int mgrow[HYPRE_MAXDIM]; /* amount to grow in the minus direction */ + HYPRE_Int pgrow[HYPRE_MAXDIM]; /* amount to grow in the plus direction */ + +} hypre_CommStencil; + +/*-------------------------------------------------------------------------- * For "reverse" communication, send_transforms is not needed (may be NULL). * For "forward" communication, recv_transforms is not needed (may be NULL). *--------------------------------------------------------------------------*/ @@ -836,120 +982,126 @@ typedef struct hypre_CommInfo_struct HYPRE_Int boxes_match; /* true (>0) if each send box has a * matching box on the recv processor */ - } hypre_CommInfo; /*-------------------------------------------------------------------------- - * hypre_CommEntryType: + * Note: The dimension of the data represented by CommEntry will often be + * smaller than the original problem dimension. *--------------------------------------------------------------------------*/ -typedef struct hypre_CommEntryType_struct +typedef struct hypre_CommEntry_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 *order; /* order of last dim values */ + HYPRE_Int offset; /* offset for the data */ + HYPRE_Int ndim; /* dimension of the data */ + HYPRE_Int length_array[HYPRE_MAXDIM + 1]; + HYPRE_Int stride_array[HYPRE_MAXDIM + 1]; + HYPRE_Int *imap; /* index map for last dim values */ -} hypre_CommEntryType; +} hypre_CommEntry; /*-------------------------------------------------------------------------- - * hypre_CommType: *--------------------------------------------------------------------------*/ -typedef struct hypre_CommType_struct +typedef struct hypre_CommBlock_struct { - HYPRE_Int proc; - HYPRE_Int bufsize; /* message buffer size (in doubles) */ - HYPRE_Int num_entries; - hypre_CommEntryType *entries; + HYPRE_Int bufsize; /* message buffer size (in doubles) */ + HYPRE_Int pfxsize; /* message buffer prefix size (in doubles) */ + HYPRE_Int ndim; + HYPRE_Int num_values; + HYPRE_Int num_entries; + hypre_CommEntry *entries; + HYPRE_Int *imaps; /* length = (num_entries*num_values) */ + + /* This is only needed until first send buffer prefix is packed */ + HYPRE_Int *rem_boxnums; /* entry remote box numbers */ + hypre_Box *rem_boxes; /* entry remote boxes */ + HYPRE_Int *rem_orders; /* length = (num_entries*num_values) */ + +} hypre_CommBlock; - /* this is only needed until first send buffer prefix is packed */ - HYPRE_Int *rem_boxnums; /* entry remote box numbers */ - hypre_Box *rem_boxes; /* entry remote boxes */ +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +typedef struct hypre_CommType_struct +{ + HYPRE_Int first_comm; /* is this the first communication? */ + HYPRE_Int proc; + HYPRE_Int bufsize; /* message buffer size (in doubles) */ + HYPRE_Int ndim; + HYPRE_Int num_blocks; + hypre_CommBlock *blocks; } hypre_CommType; /*-------------------------------------------------------------------------- - * hypre_CommPkg: - * Structure containing information for doing communications *--------------------------------------------------------------------------*/ typedef struct hypre_CommPkg_struct { MPI_Comm comm; - - /* is this the first communication? */ - HYPRE_Int first_comm; + HYPRE_MemoryLocation memory_location; HYPRE_Int ndim; HYPRE_Int num_values; hypre_Index send_stride; hypre_Index recv_stride; - - /* 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 send_bufsize; /* total send buffer counts */ + HYPRE_Int recv_bufsize; /* total recv buffer counts */ 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; - /* 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; - /* num_orders x num_values */ - HYPRE_Int **orders; - - /* offsets into recv data (by box) */ - HYPRE_Int *recv_data_offsets; - /* recv data dimensions (by box) */ - hypre_BoxArray *recv_data_space; + /* needed for setting recv entries after the first communication */ + HYPRE_Int num_blocks; /* arrays below are num_blocks x ... */ + hypre_Index *recv_strides; + hypre_BoxArray **recv_data_spaces; /* recv data dimensions (by box) */ + HYPRE_Int **recv_data_offsets; /* offsets into recv data (by box) */ + HYPRE_Int *boxes_match; /* same meaning as in CommInfo */ hypre_Index identity_coord; hypre_Index identity_dir; HYPRE_Int *identity_order; + } hypre_CommPkg; /*-------------------------------------------------------------------------- - * CommHandle: *--------------------------------------------------------------------------*/ typedef struct hypre_CommHandle_struct { - hypre_CommPkg *comm_pkg; - HYPRE_Complex *send_data; - HYPRE_Complex *recv_data; - - HYPRE_Int num_requests; - hypre_MPI_Request *requests; - hypre_MPI_Status *status; + hypre_CommPkg *comm_pkg; + HYPRE_Complex **send_data; + HYPRE_Complex **recv_data; - HYPRE_Complex **send_buffers; - HYPRE_Complex **recv_buffers; + HYPRE_Int num_requests; + hypre_MPI_Request *requests; + hypre_MPI_Status *status; - HYPRE_Complex **send_buffers_mpi; - HYPRE_Complex **recv_buffers_mpi; + HYPRE_Complex **send_buffers; /* send buffer used for data packing */ + HYPRE_Complex **recv_buffers; /* recv buffer used for data unpacking */ + HYPRE_Complex **send_buffers_mpi; /* send buffer used in the actual MPI calls */ + HYPRE_Complex **recv_buffers_mpi; /* recv buffer used in the actual MPI calls */ - /* set = 0, add = 1 */ - HYPRE_Int action; + HYPRE_Int action; /* set = 0, add = 1 */ } hypre_CommHandle; /*-------------------------------------------------------------------------- - * Accessor macros: hypre_CommInto + * Accessor macros: hypre_CommStencil + *--------------------------------------------------------------------------*/ + +#define hypre_CommStencilNDim(cstenc) (cstenc -> ndim) +#define hypre_CommStencilBox(cstenc) (cstenc -> box) +#define hypre_CommStencilData(cstenc) (cstenc -> data) +#define hypre_CommStencilStride(cstenc) (cstenc -> stride) +#define hypre_CommStencilMGrow(cstenc) (cstenc -> mgrow) +#define hypre_CommStencilPGrow(cstenc) (cstenc -> pgrow) + +/*-------------------------------------------------------------------------- + * Accessor macros: hypre_CommInfo *--------------------------------------------------------------------------*/ #define hypre_CommInfoNDim(info) (info -> ndim) @@ -974,70 +1126,79 @@ typedef struct hypre_CommHandle_struct #define hypre_CommInfoBoxesMatch(info) (info -> boxes_match) /*-------------------------------------------------------------------------- - * Accessor macros: hypre_CommEntryType + * Accessor macros: hypre_CommEntry *--------------------------------------------------------------------------*/ -#define hypre_CommEntryTypeOffset(entry) (entry -> offset) -#define hypre_CommEntryTypeDim(entry) (entry -> dim) -#define hypre_CommEntryTypeLengthArray(entry) (entry -> length_array) -#define hypre_CommEntryTypeStrideArray(entry) (entry -> stride_array) -#define hypre_CommEntryTypeOrder(entry) (entry -> order) +#define hypre_CommEntryOffset(entry) (entry -> offset) +#define hypre_CommEntryNDim(entry) (entry -> ndim) +#define hypre_CommEntryLengthArray(entry) (entry -> length_array) +#define hypre_CommEntryStrideArray(entry) (entry -> stride_array) +#define hypre_CommEntryIMap(entry) (entry -> imap) + +/*-------------------------------------------------------------------------- + * Accessor macros: hypre_CommBlock + *--------------------------------------------------------------------------*/ + +#define hypre_CommBlockBufsize(blk) (blk -> bufsize) +#define hypre_CommBlockPfxsize(blk) (blk -> pfxsize) +#define hypre_CommBlockNDim(blk) (blk -> ndim) +#define hypre_CommBlockNumValues(blk) (blk -> num_values) +#define hypre_CommBlockNumEntries(blk) (blk -> num_entries) +#define hypre_CommBlockEntries(blk) (blk -> entries) +#define hypre_CommBlockEntry(blk, i) &(blk -> entries[i]) +#define hypre_CommBlockIMaps(blk) (blk -> imaps) +#define hypre_CommBlockIMap(blk, i) &(blk -> imaps[i * (blk -> num_values)]) + +#define hypre_CommBlockRemBoxnums(blk) (blk -> rem_boxnums) +#define hypre_CommBlockRemBoxnum(blk, i) (blk -> rem_boxnums[i]) +#define hypre_CommBlockRemBoxes(blk) (blk -> rem_boxes) +#define hypre_CommBlockRemBox(blk, i) &(blk -> rem_boxes[i]) +#define hypre_CommBlockRemOrders(blk) (blk -> rem_orders) +#define hypre_CommBlockRemOrder(blk, i) &(blk -> rem_orders[i * (blk -> num_values)]) /*-------------------------------------------------------------------------- * Accessor macros: hypre_CommType *--------------------------------------------------------------------------*/ +#define hypre_CommTypeFirstComm(type) (type -> first_comm) #define hypre_CommTypeProc(type) (type -> proc) #define hypre_CommTypeBufsize(type) (type -> bufsize) -#define hypre_CommTypeNumEntries(type) (type -> num_entries) -#define hypre_CommTypeEntries(type) (type -> entries) -#define hypre_CommTypeEntry(type, i) (&(type -> entries[i])) - -#define hypre_CommTypeRemBoxnums(type) (type -> rem_boxnums) -#define hypre_CommTypeRemBoxnum(type, i) (type -> rem_boxnums[i]) -#define hypre_CommTypeRemBoxes(type) (type -> rem_boxes) -#define hypre_CommTypeRemBox(type, i) (&(type -> rem_boxes[i])) +#define hypre_CommTypeNDim(type) (type -> ndim) +#define hypre_CommTypeNumBlocks(type) (type -> num_blocks) +#define hypre_CommTypeBlocks(type) (type -> blocks) +#define hypre_CommTypeBlock(type, i) &(type -> blocks[i]) /*-------------------------------------------------------------------------- * Accessor macros: hypre_CommPkg *--------------------------------------------------------------------------*/ -#define hypre_CommPkgComm(comm_pkg) (comm_pkg -> comm) - -#define hypre_CommPkgFirstComm(comm_pkg) (comm_pkg -> first_comm) - -#define hypre_CommPkgNDim(comm_pkg) (comm_pkg -> ndim) -#define hypre_CommPkgNumValues(comm_pkg) (comm_pkg -> num_values) -#define hypre_CommPkgSendStride(comm_pkg) (comm_pkg -> send_stride) -#define hypre_CommPkgRecvStride(comm_pkg) (comm_pkg -> recv_stride) -#define hypre_CommPkgSendBufsize(comm_pkg) (comm_pkg -> send_bufsize) -#define hypre_CommPkgRecvBufsize(comm_pkg) (comm_pkg -> recv_bufsize) -#define hypre_CommPkgSendBufsizeFirstComm(comm_pkg) (comm_pkg -> send_bufsize_first_comm) -#define hypre_CommPkgRecvBufsizeFirstComm(comm_pkg) (comm_pkg -> recv_bufsize_first_comm) - -#define hypre_CommPkgNumSends(comm_pkg) (comm_pkg -> num_sends) -#define hypre_CommPkgNumRecvs(comm_pkg) (comm_pkg -> num_recvs) -#define hypre_CommPkgSendTypes(comm_pkg) (comm_pkg -> send_types) -#define hypre_CommPkgSendType(comm_pkg, i) (&(comm_pkg -> send_types[i])) -#define hypre_CommPkgRecvTypes(comm_pkg) (comm_pkg -> recv_types) -#define hypre_CommPkgRecvType(comm_pkg, i) (&(comm_pkg -> recv_types[i])) - -#define hypre_CommPkgCopyFromType(comm_pkg) (comm_pkg -> copy_from_type) -#define hypre_CommPkgCopyToType(comm_pkg) (comm_pkg -> copy_to_type) - -#define hypre_CommPkgEntries(comm_pkg) (comm_pkg -> entries) -#define hypre_CommPkgRemBoxnums(comm_pkg) (comm_pkg -> rem_boxnums) -#define hypre_CommPkgRemBoxes(comm_pkg) (comm_pkg -> rem_boxes) - -#define hypre_CommPkgNumOrders(comm_pkg) (comm_pkg -> num_orders) -#define hypre_CommPkgOrders(comm_pkg) (comm_pkg -> orders) - -#define hypre_CommPkgRecvDataOffsets(comm_pkg) (comm_pkg -> recv_data_offsets) -#define hypre_CommPkgRecvDataSpace(comm_pkg) (comm_pkg -> recv_data_space) - -#define hypre_CommPkgIdentityCoord(comm_pkg) (comm_pkg -> identity_coord) -#define hypre_CommPkgIdentityDir(comm_pkg) (comm_pkg -> identity_dir) -#define hypre_CommPkgIdentityOrder(comm_pkg) (comm_pkg -> identity_order) +#define hypre_CommPkgComm(comm_pkg) (comm_pkg -> comm) +#define hypre_CommPkgMemoryLocation(comm_pkg) (comm_pkg -> memory_location) + +#define hypre_CommPkgNDim(comm_pkg) (comm_pkg -> ndim) +#define hypre_CommPkgNumValues(comm_pkg) (comm_pkg -> num_values) +#define hypre_CommPkgSendStride(comm_pkg) (comm_pkg -> send_stride) +#define hypre_CommPkgRecvStride(comm_pkg) (comm_pkg -> recv_stride) +#define hypre_CommPkgSendBufsize(comm_pkg) (comm_pkg -> send_bufsize) +#define hypre_CommPkgRecvBufsize(comm_pkg) (comm_pkg -> recv_bufsize) +#define hypre_CommPkgNumSends(comm_pkg) (comm_pkg -> num_sends) +#define hypre_CommPkgNumRecvs(comm_pkg) (comm_pkg -> num_recvs) +#define hypre_CommPkgSendTypes(comm_pkg) (comm_pkg -> send_types) +#define hypre_CommPkgSendType(comm_pkg, i) &(comm_pkg -> send_types[i]) +#define hypre_CommPkgRecvTypes(comm_pkg) (comm_pkg -> recv_types) +#define hypre_CommPkgRecvType(comm_pkg, i) &(comm_pkg -> recv_types[i]) +#define hypre_CommPkgCopyFromType(comm_pkg) (comm_pkg -> copy_from_type) +#define hypre_CommPkgCopyToType(comm_pkg) (comm_pkg -> copy_to_type) + +#define hypre_CommPkgNumBlocks(comm_pkg) (comm_pkg -> num_blocks) +#define hypre_CommPkgRecvStrides(comm_pkg) (comm_pkg -> recv_strides) +#define hypre_CommPkgRecvDataSpaces(comm_pkg) (comm_pkg -> recv_data_spaces) +#define hypre_CommPkgRecvDataOffsets(comm_pkg) (comm_pkg -> recv_data_offsets) +#define hypre_CommPkgBoxesMatch(comm_pkg) (comm_pkg -> boxes_match) + +#define hypre_CommPkgIdentityCoord(comm_pkg) (comm_pkg -> idenditity_coord) +#define hypre_CommPkgIdentityDir(comm_pkg) (comm_pkg -> idenditity_dir) +#define hypre_CommPkgIdentityOrder(comm_pkg) (comm_pkg -> idenditity_order) /*-------------------------------------------------------------------------- * Accessor macros: hypre_CommHandle @@ -1051,9 +1212,9 @@ typedef struct hypre_CommHandle_struct #define hypre_CommHandleStatus(comm_handle) (comm_handle -> status) #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_CommHandleSendBuffersMPI(comm_handle) (comm_handle -> send_buffers_mpi) #define hypre_CommHandleRecvBuffersMPI(comm_handle) (comm_handle -> recv_buffers_mpi) +#define hypre_CommHandleAction(comm_handle) (comm_handle -> action) #endif /****************************************************************************** @@ -1100,7 +1261,6 @@ typedef struct hypre_ComputePkg_struct hypre_Index stride; hypre_StructGrid *grid; - hypre_BoxArray *data_space; HYPRE_Int num_values; } hypre_ComputePkg; @@ -1118,15 +1278,172 @@ typedef struct hypre_ComputePkg_struct * Accessor macros: hypre_ComputePkg *--------------------------------------------------------------------------*/ -#define hypre_ComputePkgCommPkg(compute_pkg) (compute_pkg -> comm_pkg) +#define hypre_ComputePkgCommPkg(compute_pkg) (compute_pkg -> comm_pkg) +#define hypre_ComputePkgMemoryLocation(compute_pkg) (compute_pkg -> comm_pkg -> memory_location) -#define hypre_ComputePkgIndtBoxes(compute_pkg) (compute_pkg -> indt_boxes) -#define hypre_ComputePkgDeptBoxes(compute_pkg) (compute_pkg -> dept_boxes) -#define hypre_ComputePkgStride(compute_pkg) (compute_pkg -> stride) +#define hypre_ComputePkgIndtBoxes(compute_pkg) (compute_pkg -> indt_boxes) +#define hypre_ComputePkgDeptBoxes(compute_pkg) (compute_pkg -> dept_boxes) +#define hypre_ComputePkgStride(compute_pkg) (compute_pkg -> stride) -#define hypre_ComputePkgGrid(compute_pkg) (compute_pkg -> grid) -#define hypre_ComputePkgDataSpace(compute_pkg) (compute_pkg -> data_space) -#define hypre_ComputePkgNumValues(compute_pkg) (compute_pkg -> num_values) +#define hypre_ComputePkgGrid(compute_pkg) (compute_pkg -> grid) +#define hypre_ComputePkgNumValues(compute_pkg) (compute_pkg -> num_values) + +#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_STRUCT_STMATRIX_HEADER +#define hypre_STRUCT_STMATRIX_HEADER + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +typedef struct +{ + HYPRE_Int id; /* Stencil matrix id for this term */ + HYPRE_Int entry; /* Stencil entry number */ + hypre_Index shift; /* Stencil shift from center */ + +} hypre_StTerm; + +typedef struct coeff_link +{ + HYPRE_Int nterms; /* Number of terms */ + hypre_StTerm *terms; /* Array of terms */ + + struct coeff_link *prev; + struct coeff_link *next; + +} hypre_StCoeff; + +typedef struct +{ + HYPRE_Int id; /* Matrix ID */ + HYPRE_Int size; /* Number of stencil entries */ + + hypre_Index rmap; /* Range map */ + hypre_Index dmap; /* Domain map */ + + hypre_Index *shapes; /* Offsets describing the stencil's shape */ + hypre_StCoeff **coeffs; /* Description of coefficients */ + +} hypre_StMatrix; + +/*-------------------------------------------------------------------------- + * Accessor macros: + *--------------------------------------------------------------------------*/ + +#define hypre_StTermID(term) ((term) -> id) +#define hypre_StTermEntry(term) ((term) -> entry) +#define hypre_StTermShift(term) ((term) -> shift) + +#define hypre_StCoeffNTerms(coeff) ((coeff) -> nterms) +#define hypre_StCoeffTerms(coeff) ((coeff) -> terms) +#define hypre_StCoeffTerm(coeff, t) &((coeff) -> terms[t]) +#define hypre_StCoeffPrev(coeff) ((coeff) -> prev) +#define hypre_StCoeffNext(coeff) ((coeff) -> next) + +#define hypre_StMatrixID(stmat) ((stmat) -> id) +#define hypre_StMatrixSize(stmat) ((stmat) -> size) +#define hypre_StMatrixRMap(stmat) ((stmat) -> rmap) +#define hypre_StMatrixDMap(stmat) ((stmat) -> dmap) +#define hypre_StMatrixShapes(stmat) ((stmat) -> shapes) +#define hypre_StMatrixOffset(stmat, e) ((stmat) -> shapes[e]) +#define hypre_StMatrixCoeffs(stmat) ((stmat) -> coeffs) +#define hypre_StMatrixCoeff(stmat, e) ((stmat) -> coeffs[e]) + +/*-------------------------------------------------------------------------- + * Prototypes: + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StIndexCopy( hypre_Index index1, + hypre_Index index2, + HYPRE_Int ndim ); +HYPRE_Int +hypre_StIndexNegate( hypre_Index index, + HYPRE_Int ndim ); +HYPRE_Int +hypre_StIndexShift( hypre_Index index, + hypre_Index shift, + HYPRE_Int ndim ); +HYPRE_Int +hypre_StIndexPrint( hypre_Index index, + char lchar, + char rchar, + HYPRE_Int ndim ); +HYPRE_Int +hypre_StTermCopy( hypre_StTerm *term1, + hypre_StTerm *term2, + HYPRE_Int ndim ); +HYPRE_Int +hypre_StTermPrint( hypre_StTerm *term, + char *matnames, + HYPRE_Int ndim ); +HYPRE_Int +hypre_StCoeffCreate( HYPRE_Int nterms, + hypre_StCoeff **coeff_ptr ); +HYPRE_Int +hypre_StCoeffClone( hypre_StCoeff *coeff, + HYPRE_Int ndim, + hypre_StCoeff **clone_ptr ); +HYPRE_Int +hypre_StCoeffDestroy( hypre_StCoeff *coeff ); +HYPRE_Int +hypre_StCoeffShift( hypre_StCoeff *coeff, + hypre_Index shift, + HYPRE_Int ndim ); +HYPRE_Int +hypre_StCoeffPush( hypre_StCoeff **stack_ptr, + hypre_StCoeff *coeff ); +HYPRE_Int +hypre_StCoeffMult( hypre_StCoeff *Acoeff, + hypre_StCoeff *Bcoeff, + HYPRE_Int ndim, + hypre_StCoeff **Ccoeff_ptr ); +HYPRE_Int +hypre_StCoeffPrint( hypre_StCoeff *coeff, + char *matnames, + HYPRE_Int ndim ); +HYPRE_Int +hypre_StMatrixCreate( HYPRE_Int id, + HYPRE_Int size, + HYPRE_Int ndim, + hypre_StMatrix **matrix_ptr ); +HYPRE_Int +hypre_StMatrixClone( hypre_StMatrix *matrix, + HYPRE_Int ndim, + hypre_StMatrix **mclone_ptr ); +HYPRE_Int +hypre_StMatrixDestroy( hypre_StMatrix *matrix ); +HYPRE_Int +hypre_StMatrixTranspose( hypre_StMatrix *matrix, + HYPRE_Int ndim ); +HYPRE_Int +hypre_StMatrixMatmat( hypre_StMatrix *A, + hypre_StMatrix *B, + HYPRE_Int Cid, + HYPRE_Int ndim, + hypre_StMatrix **C_ptr ); +HYPRE_Int +hypre_StMatrixMatmult( HYPRE_Int nmatrices, + hypre_StMatrix **matrices, + HYPRE_Int *transposes, + HYPRE_Int Cid, + HYPRE_Int ndim, + hypre_StMatrix **C_ptr ); +HYPRE_Int +hypre_StMatrixPrint( hypre_StMatrix *matrix, + char *matnames, + HYPRE_Int ndim ); + +HYPRE_Int +hypre_StMatrixNEntryCoeffs( hypre_StMatrix *matrix, + HYPRE_Int entry ); #endif /****************************************************************************** @@ -1147,45 +1464,91 @@ typedef struct hypre_ComputePkg_struct /*-------------------------------------------------------------------------- * hypre_StructMatrix: + * + * Rectangular matrices have different range and domain grids, which are defined + * in terms of a common base grid and index space. The range grid consists of a + * coarsened subset of boxes in the base grid, as specified by the box numbers + * in 'ran_boxnums' and the coarsening factor 'ran_stride'. The domain grid is + * similarly defined via 'dom_boxnums' and 'dom_stride'. Either the range index + * space is a coarsening of the domain index space or vice-versa. The data + * storage is dictated by the coarsest grid as indicated (for convenience) by + * the two booleans 'range_is_coarse' and 'domain_is_coarse'. The stencil + * always represents a "row" stencil that operates on the domain grid and + * produces a value on the range grid. The data interface and accessor macros + * are also row-stencil based, regardless of the underlying storage. Each + * stencil entry can have either constant or variable coefficients as indicated + * by the stencil-sized array 'constant'. + * + * The 'data' pointer below has space at the beginning for constant stencil + * coefficient values followed by the stored variable coefficient values. + * Accessing coefficients is done via 'data_indices' through the interface + * routine hypre_StructMatrixBoxData(). The number of boxes in data_boxes, + * data_space, and data_indices is the same as in the base grid, even though + * both ran_nboxes and dom_nboxes may be smaller. + * + * The 'num_ghost' and 'sym_ghost' arrays are used to determine how many ghost + * layers of storage to keep. They determine the dimensions of 'data_space' and + * 'data_boxes', but they do not imply communication of any sort. That is, the + * values stored in the ghost layers will not be correct without triggering some + * additional communication either explicitly or by setting the 'symmetric' or + * 'transpose' flags. *--------------------------------------------------------------------------*/ typedef struct hypre_StructMatrix_struct { MPI_Comm comm; - hypre_StructGrid *grid; + hypre_StructGrid *grid; /* Base grid */ + HYPRE_Int ran_nboxes; /* Range grid number of boxes */ + HYPRE_Int *ran_boxnums; /* Range grid boxnums in base grid */ + hypre_Index ran_stride; /* Range grid coarsening stride */ + HYPRE_Int dom_nboxes; /* Domain grid number of boxes */ + HYPRE_Int *dom_boxnums; /* Domain grid boxnums in base grid */ + hypre_Index dom_stride; /* Domain grid coarsening stride */ + hypre_StructStencil *user_stencil; hypre_StructStencil *stencil; - HYPRE_Int num_values; /* Number of "stored" coefficients */ - - 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 */ - HYPRE_Int data_alloced; /* Boolean used for freeing data */ - HYPRE_Int data_size; /* Size of variable matrix data */ - HYPRE_Int data_const_size; /* Size of constant matrix data */ - HYPRE_Int **data_indices; /* num-boxes by stencil-size array - of indices into the data array. - data_indices[b][s] is the starting - index of matrix data corresponding - to box b and stencil coefficient s */ - HYPRE_Int constant_coefficient; /* normally 0; set to 1 for - constant coefficient matrices - or 2 for constant coefficient - with variable diagonal */ - - 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_BigInt global_size; /* Total number of nonzero coeffs */ - - hypre_CommPkg *comm_pkg; /* Info on how to update ghost data */ - - HYPRE_Int ref_count; + HYPRE_Int *constant; /* Which stencil entries are constant? */ + + HYPRE_MemoryLocation memory_location; /* Memory location of the data array */ + HYPRE_Complex *data; /* Pointer to matrix data */ + hypre_BoxArray *data_space; /* Layout of data (coarse index space) */ + hypre_BoxArray *data_boxes; /* Data extents on fine index space */ + HYPRE_Int **data_indices; /* Array of indices into the data array. + data_indices[b][s] is the starting index of + data for boxnum b and stencil coefficient s */ + HYPRE_Int data_alloced; /* Boolean used for freeing data */ + HYPRE_Int data_size; /* Size of matrix data */ + HYPRE_BigInt global_size; /* Total number of nonzero coeffs */ + HYPRE_Int *const_indices; /* Indices into the data array for constant data */ + HYPRE_Int vdata_offset; /* Offset to variable-coeff matrix data */ + HYPRE_Int num_values; /* Number of "stored" variable coeffs */ + HYPRE_Int num_cvalues; /* Number of "stored" constant coeffs */ + HYPRE_Int range_is_coarse; /* 1 -> the range is coarse */ + HYPRE_Int domain_is_coarse; /* 1 -> the domain is coarse */ + HYPRE_Int constant_coefficient; /* RDF: Phase this out in favor + of 'constant' array above. + Values can be {0, 1, 2} -> + {variable, constant, constant + with variable diagonal} */ + HYPRE_Int symmetric; /* Is the matrix symmetric */ + HYPRE_Int *symm_entries; /* Which entries are "symmetric" */ + HYPRE_Int transpose; /* Transpose stored also? */ + hypre_CommPkg *comm_pkg; /* Info on how to update ghost data */ + HYPRE_Int ref_count; /* Reference counter */ + + HYPRE_Int num_ghost[2 * HYPRE_MAXDIM]; /* Min num ghost layers */ + HYPRE_Int sym_ghost[2 * HYPRE_MAXDIM]; /* Ghost layers for symmetric */ + HYPRE_Int trn_ghost[2 * HYPRE_MAXDIM]; /* Ghost layers for transpose */ + + /* Information needed to Restore() after Resize() */ + HYPRE_Complex *save_data; + hypre_BoxArray *save_data_space; + HYPRE_Int save_data_size; + +#if defined(HYPRE_MIXED_PRECISION) + HYPRE_Precision matrix_precision; +#endif } hypre_StructMatrix; @@ -1193,44 +1556,69 @@ typedef struct hypre_StructMatrix_struct * Accessor macros: hypre_StructMatrix *--------------------------------------------------------------------------*/ + #define hypre_StructMatrixComm(matrix) ((matrix) -> comm) #define hypre_StructMatrixGrid(matrix) ((matrix) -> grid) +#define hypre_StructMatrixRanNBoxes(matrix) ((matrix) -> ran_nboxes) +#define hypre_StructMatrixRanBoxnums(matrix) ((matrix) -> ran_boxnums) +#define hypre_StructMatrixRanBoxnum(matrix, i) ((matrix) -> ran_boxnums[i]) +#define hypre_StructMatrixRanStride(matrix) ((matrix) -> ran_stride) +#define hypre_StructMatrixDomNBoxes(matrix) ((matrix) -> dom_nboxes) +#define hypre_StructMatrixDomBoxnums(matrix) ((matrix) -> dom_boxnums) +#define hypre_StructMatrixDomBoxnum(matrix, i) ((matrix) -> dom_boxnums[i]) +#define hypre_StructMatrixDomStride(matrix) ((matrix) -> dom_stride) #define hypre_StructMatrixUserStencil(matrix) ((matrix) -> user_stencil) #define hypre_StructMatrixStencil(matrix) ((matrix) -> stencil) -#define hypre_StructMatrixNumValues(matrix) ((matrix) -> num_values) -#define hypre_StructMatrixDataSpace(matrix) ((matrix) -> data_space) +#define hypre_StructMatrixConstant(matrix) ((matrix) -> constant) +#define hypre_StructMatrixConstEntry(matrix, s) ((matrix) -> constant[s]) #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) +#define hypre_StructMatrixDataSpace(matrix) ((matrix) -> data_space) +#define hypre_StructMatrixDataBoxes(matrix) ((matrix) -> data_boxes) +#define hypre_StructMatrixDataIndices(matrix) ((matrix) -> data_indices) #define hypre_StructMatrixDataAlloced(matrix) ((matrix) -> data_alloced) #define hypre_StructMatrixDataSize(matrix) ((matrix) -> data_size) -#define hypre_StructMatrixDataConstSize(matrix) ((matrix) -> data_const_size) -#define hypre_StructMatrixDataIndices(matrix) ((matrix) -> data_indices) +#define hypre_StructMatrixGlobalSize(matrix) ((matrix) -> global_size) +#define hypre_StructMatrixConstIndices(matrix) ((matrix) -> const_indices) +#define hypre_StructMatrixVDataOffset(matrix) ((matrix) -> vdata_offset) +#define hypre_StructMatrixNumValues(matrix) ((matrix) -> num_values) +#define hypre_StructMatrixNumCValues(matrix) ((matrix) -> num_cvalues) +#define hypre_StructMatrixRangeIsCoarse(matrix) ((matrix) -> range_is_coarse) +#define hypre_StructMatrixDomainIsCoarse(matrix) ((matrix) -> domain_is_coarse) #define hypre_StructMatrixConstantCoefficient(matrix) ((matrix) -> constant_coefficient) #define hypre_StructMatrixSymmetric(matrix) ((matrix) -> symmetric) -#define hypre_StructMatrixSymmElements(matrix) ((matrix) -> symm_elements) -#define hypre_StructMatrixNumGhost(matrix) ((matrix) -> num_ghost) -#define hypre_StructMatrixGlobalSize(matrix) ((matrix) -> global_size) +#define hypre_StructMatrixSymmEntries(matrix) ((matrix) -> symm_entries) +#define hypre_StructMatrixTranspose(matrix) ((matrix) -> transpose) #define hypre_StructMatrixCommPkg(matrix) ((matrix) -> comm_pkg) #define hypre_StructMatrixRefCount(matrix) ((matrix) -> ref_count) +#define hypre_StructMatrixNumGhost(matrix) ((matrix) -> num_ghost) +#define hypre_StructMatrixSymGhost(matrix) ((matrix) -> sym_ghost) +#define hypre_StructMatrixTrnGhost(matrix) ((matrix) -> trn_ghost) +#define hypre_StructMatrixSaveData(matrix) ((matrix) -> save_data) +#define hypre_StructMatrixSaveDataSpace(matrix) ((matrix) -> save_data_space) +#define hypre_StructMatrixSaveDataSize(matrix) ((matrix) -> save_data_size) + +#define hypre_StructMatrixBoxIDs(matrix) \ +hypre_BoxArrayIDs(hypre_StructMatrixDataSpace(matrix)) #define hypre_StructMatrixNDim(matrix) \ hypre_StructGridNDim(hypre_StructMatrixGrid(matrix)) -#define hypre_StructMatrixBox(matrix, b) \ -hypre_BoxArrayBox(hypre_StructMatrixDataSpace(matrix), b) +#define hypre_StructMatrixVData(matrix) \ +(hypre_StructMatrixData(matrix) + hypre_StructMatrixVDataOffset(matrix)) #define hypre_StructMatrixBoxData(matrix, b, s) \ -(hypre_StructMatrixStencilData(matrix)[s] + hypre_StructMatrixDataIndices(matrix)[b][s]) +(hypre_StructMatrixData(matrix) + hypre_StructMatrixDataIndices(matrix)[b][s]) -#define hypre_StructMatrixBoxDataValue(matrix, b, s, index) \ -(hypre_StructMatrixBoxData(matrix, b, s) + \ - hypre_BoxIndexRank(hypre_StructMatrixBox(matrix, b), index)) +#define hypre_StructMatrixBoxDataValue(matrix, b, s, data_box, index) \ +(hypre_StructMatrixBoxData(matrix, b, s) + hypre_BoxIndexRank(data_box, index)) -#define hypre_CCStructMatrixBoxDataValue(matrix, b, s, index) \ -(hypre_StructMatrixBoxData(matrix, b, s) + \ - hypre_CCBoxIndexRank(hypre_StructMatrixBox(matrix, b), index)) +#define hypre_StructMatrixConstData(matrix, s) \ +(hypre_StructMatrixData(matrix) + hypre_StructMatrixConstIndices(matrix)[s]) + +#if defined(HYPRE_MIXED_PRECISION) +#define hypre_StructMatrixPrecision(matrix) ((matrix) -> matrix_precision) +#endif #endif /****************************************************************************** @@ -1251,43 +1639,69 @@ hypre_BoxArrayBox(hypre_StructMatrixDataSpace(matrix), b) /*-------------------------------------------------------------------------- * hypre_StructVector: + * + * Most of the routines currently only work when the base grid and grid are the + * same (i.e., when nboxes equals the number of boxes in the grid and stride is + * the unit stride). The number of boxes in data_space and data_indices is the + * same as in the base grid, even though nboxes may be smaller. + * + * NOTE/TODO: The 'data_alloced=2' and 'save_data' aspects of the vector are + * only needed to support InitializeData(). Consider removing this feature, + * especially since it creates an issue with Forget(). *--------------------------------------------------------------------------*/ typedef struct hypre_StructVector_struct { MPI_Comm comm; - hypre_StructGrid *grid; - - hypre_BoxArray *data_space; + /* Note: nboxes and boxnums are computed from (grid, stride) */ + hypre_StructGrid *grid; /* Base grid */ + hypre_Index stride; /* Grid coarsening stride */ + HYPRE_Int nboxes; /* Grid number of boxes */ + HYPRE_Int *boxnums; /* Grid boxnums in base grid */ HYPRE_MemoryLocation memory_location; /* memory location of data */ + HYPRE_Int memory_mode; /* memory management mode */ + 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_alloced; /* TODO (VPM): change this to owns_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 *data_indices; /* Array of indices into the data array. + data_indices[b] is the starting index of + data for boxnum b. */ + 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_Int ref_count; + /* Information needed to Restore() after Rebase() and Resize() */ + hypre_StructGrid *save_grid; + hypre_Index save_stride; + HYPRE_Complex *save_data; /* Only needed to support InitializeData() */ + hypre_BoxArray *save_data_space; + HYPRE_Int save_data_size; + +#if defined(HYPRE_MIXED_PRECISION) + HYPRE_Precision vector_precision; +#endif + } hypre_StructVector; /*-------------------------------------------------------------------------- * Accessor macros: hypre_StructVector + * + * Notation: 'i' is a grid box index and 'b' is a base-grid box index *--------------------------------------------------------------------------*/ #define hypre_StructVectorComm(vector) ((vector) -> comm) #define hypre_StructVectorGrid(vector) ((vector) -> grid) -#define hypre_StructVectorDataSpace(vector) ((vector) -> data_space) +#define hypre_StructVectorStride(vector) ((vector) -> stride) +#define hypre_StructVectorNBoxes(vector) ((vector) -> nboxes) +#define hypre_StructVectorBoxnums(vector) ((vector) -> boxnums) +#define hypre_StructVectorBoxnum(vector, i) ((vector) -> boxnums[i]) #define hypre_StructVectorMemoryLocation(vector) ((vector) -> memory_location) +#define hypre_StructVectorMemoryMode(vector) ((vector) -> memory_mode) +#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) @@ -1296,11 +1710,21 @@ typedef struct hypre_StructVector_struct #define hypre_StructVectorBGhostNotClear(vector) ((vector) -> bghost_not_clear) #define hypre_StructVectorGlobalSize(vector) ((vector) -> global_size) #define hypre_StructVectorRefCount(vector) ((vector) -> ref_count) +#define hypre_StructVectorSaveGrid(vector) ((vector) -> save_grid) +#define hypre_StructVectorSaveStride(vector) ((vector) -> save_stride) +#define hypre_StructVectorSaveData(vector) ((vector) -> save_data) +#define hypre_StructVectorSaveDataSpace(vector) ((vector) -> save_data_space) +#define hypre_StructVectorSaveDataSize(vector) ((vector) -> save_data_size) + +#define hypre_StructVectorBoxIDs(vector) \ +hypre_BoxArrayIDs(hypre_StructVectorDataSpace(vector)) #define hypre_StructVectorNDim(vector) \ hypre_StructGridNDim(hypre_StructVectorGrid(vector)) -#define hypre_StructVectorBox(vector, b) \ +/* The following use a base-grid box index */ + +#define hypre_StructVectorDataSpaceBox(vector, b) \ hypre_BoxArrayBox(hypre_StructVectorDataSpace(vector), b) #define hypre_StructVectorBoxData(vector, b) \ @@ -1308,7 +1732,118 @@ hypre_BoxArrayBox(hypre_StructVectorDataSpace(vector), b) #define hypre_StructVectorBoxDataValue(vector, b, index) \ (hypre_StructVectorBoxData(vector, b) + \ - hypre_BoxIndexRank(hypre_StructVectorBox(vector, b), index)) + hypre_BoxIndexRank(hypre_StructVectorDataSpaceBox(vector, b), index)) + +/* The following "Grid" macros use a grid box index */ + +#define hypre_StructVectorGridBaseBox(vector, i) \ +hypre_StructGridBox(hypre_StructVectorGrid(vector), hypre_StructVectorBoxnum(vector, i)) + +#define hypre_StructVectorGridBoxCopy(vector, i, box) \ +hypre_CopyBox(hypre_StructVectorGridBaseBox(vector, i), box); /* on base-grid index space */ \ +hypre_StructVectorMapDataBox(vector, box); /* maps to data index space */ + +#define hypre_StructVectorGridDataBox(vector, i) \ +hypre_StructVectorDataSpaceBox(vector, hypre_StructVectorBoxnum(vector, i)) + +#define hypre_StructVectorGridData(vector, i) \ +hypre_StructVectorBoxData(vector, hypre_StructVectorBoxnum(vector, i)) + +#define hypre_StructVectorGridDataValue(vector, i, index) \ +hypre_StructVectorBoxDataValue(vector, hypre_StructVectorGridDataBox(vector, i), index) + +#if defined(HYPRE_MIXED_PRECISION) +#define hypre_StructVectorPrecision(vector) ((vector) -> vector_precision) +#endif + +#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) + ******************************************************************************/ + +/****************************************************************************** + * + * Header info for the struct matrix-matrix multiplication structures + * + *****************************************************************************/ + +#ifndef hypre_STRUCT_MATMULT_HEADER +#define hypre_STRUCT_MATMULT_HEADER + +/* Max. number of matrix-matrix multiplication terms */ +#ifndef HYPRE_MAX_MMTERMS +#define HYPRE_MAX_MMTERMS 512 +#endif + +/*-------------------------------------------------------------------------- + * StructMatmultDataMH data structure + * + * Note: Only up to 3 matrix terms are currently allowed in the product. + *--------------------------------------------------------------------------*/ + +/* product term used to compute the variable stencil entries in M */ +typedef struct hypre_StructMatmultDataMH_struct +{ + hypre_StTerm terms[3]; /* stencil info for each term */ + HYPRE_Int mentry; /* stencil entry for M */ + HYPRE_Complex cprod; /* product of the constant terms */ + HYPRE_Int types[3]; /* types of computations to do for each term */ + HYPRE_Complex *tptrs[3]; /* pointers to matrix data for each term */ + //HYPRE_Int offsets[3]; /* RDF: Not needed - keep for now */ + HYPRE_Complex *mptr; /* pointer to matrix data for M */ + +} hypre_StructMatmultDataMH; + +/*-------------------------------------------------------------------------- + * StructMatmultDataM data structure + *--------------------------------------------------------------------------*/ + +typedef struct hypre_StructMatmultDataM_struct +{ + HYPRE_Int nterms; /* number of terms in the matmult */ + HYPRE_Int *terms; /* matrix reference for each term */ + HYPRE_Int *transposes; /* transpose flag for each term */ + + hypre_StructMatrix *M; /* matmult matrix being computed */ + hypre_StMatrix *st_M; /* stencil matrix for M */ + + HYPRE_Int nc; /* size of array c */ + hypre_StructMatmultDataMH *c; /* helper for computing constant entries */ + HYPRE_Int na; /* size of array a */ + hypre_StructMatmultDataMH *a; /* helper for computing variable entries */ + +} hypre_StructMatmultDataM; + +/*-------------------------------------------------------------------------- + * StructMatmultData data structure + *--------------------------------------------------------------------------*/ + +typedef struct hypre_StructMatmultData_struct +{ + HYPRE_Int kernel_type; /* kernel type for computing matmult */ + HYPRE_Int nmatmults; /* number of matmults */ + hypre_StructMatmultDataM *matmults; /* data for each matmult */ + + HYPRE_Int nmatrices; /* number of matrices */ + hypre_StructMatrix **matrices; /* matrices we are multiplying */ + HYPRE_Int *mtypes; /* data-map type for each matrix (fine or coarse) */ + + hypre_IndexRef coarsen_stride; /* coarsening factor for M's grid */ + HYPRE_Int coarsen; /* indicates if M's grid is obtained by coarsening */ + hypre_IndexRef fstride; /* fine data-map stride (base index space) */ + hypre_IndexRef cstride; /* coarse data-map stride (base index space) */ + hypre_BoxArray *fdata_space; /* fine data space */ + hypre_BoxArray *cdata_space; /* coarse data space */ + + hypre_StructVector *mask; /* bit mask for mixed constant-variable coeff multiplies */ + hypre_CommPkg *comm_pkg; /* pointer to agglomerated communication package */ + HYPRE_Complex **comm_data; /* pointer to agglomerated communication data */ + hypre_CommStencil **comm_stencils; /* comm stencils used to define communication */ + +} hypre_StructMatmultData; #endif /****************************************************************************** @@ -1330,22 +1865,32 @@ HYPRE_Int hypre_APShrinkRegions ( hypre_BoxArray *region_array, hypre_BoxArray * 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 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, + HYPRE_Real global_boxes_size, + HYPRE_Int global_num_boxes, hypre_BoxArray *local_boxes, + 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 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 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_Box *box, + HYPRE_Int *num_proc_array, HYPRE_Int *size_alloc_proc_array, HYPRE_Int **p_proc_array ); +HYPRE_Int hypre_StructAssumedPartitionPrint ( const char *filename, hypre_StructAssumedPart *ap ); +HYPRE_Int hypre_StructCoarsenAP ( hypre_StructAssumedPart *ap, hypre_Index origin, + hypre_Index stride, + hypre_StructAssumedPart **new_ap_ptr ); /* box_algebra.c */ +HYPRE_Int hypre_BoxSplit ( hypre_Box *box, hypre_Index index, hypre_Box **lbox_ptr, + hypre_Box **rbox_ptr ); 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, @@ -1359,62 +1904,109 @@ HYPRE_Int hypre_BoxBoundaryIntersect ( hypre_Box *box, hypre_StructGrid *grid, H 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_GeneralBoxBoundaryIntersect ( hypre_Box *box, hypre_StructGrid *grid, + hypre_Index stencil_offset, 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_CopyIndex ( hypre_Index in_index, hypre_Index out_index ); +HYPRE_Int hypre_CopyToIndex ( hypre_Index in_index, HYPRE_Int ndim, 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_IndexMin ( hypre_Index index, HYPRE_Int ndim ); +HYPRE_Int hypre_IndexMax ( hypre_Index index, HYPRE_Int ndim ); +HYPRE_Int hypre_IndexElementMult ( 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_IndexesGreater ( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim ); +HYPRE_Int hypre_IndexesGreaterEqual ( 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_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_CopyBox ( hypre_Box *box1, hypre_Box *box2 ); +hypre_Box *hypre_BoxClone ( hypre_Box *box ); HYPRE_Int hypre_BoxVolume( hypre_Box *box ); -HYPRE_Real hypre_doubleBoxVolume( hypre_Box *box ); +HYPRE_Real hypre_doubleBoxVolume ( hypre_Box *box ); +HYPRE_Int hypre_BoxStrideVolume ( hypre_Box *box, hypre_Index stride ); +HYPRE_Int hypre_BoxPartialVolume ( hypre_Box *box, hypre_Index partial_volume); +HYPRE_Int hypre_BoxNnodes ( hypre_Box *box ); HYPRE_Int hypre_IndexInBox ( hypre_Index index, hypre_Box *box ); +HYPRE_Int hypre_BoxInBox ( hypre_Box *box1, hypre_Box *box2 ); +HYPRE_Int hypre_BoxesEqual ( hypre_Box *box1, hypre_Box *box2 ); +HYPRE_Int hypre_BoxMaxSize ( 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_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_BoxGrowByBox ( hypre_Box *box, hypre_Box *gbox ); HYPRE_Int hypre_BoxGrowByArray ( hypre_Box *box, HYPRE_Int *array ); HYPRE_Int hypre_BoxPrint ( FILE *file, hypre_Box *box ); +HYPRE_Int hypre_BoxPrintDebug( const char *prefix, 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_BoxArrayCreateFromIndices ( HYPRE_Int ndim, HYPRE_Int num_indices_in, + HYPRE_Int **indices_in, HYPRE_Real threshold, + hypre_BoxArray **box_array_ptr ); HYPRE_Int hypre_BoxArrayDestroy ( hypre_BoxArray *box_array ); +HYPRE_Int hypre_BoxArrayPrintToFile ( FILE *file, hypre_BoxArray *box_array ); +HYPRE_Int hypre_BoxArrayReadFromFile( FILE *file, hypre_BoxArray **box_array_ptr ); +HYPRE_Int hypre_BoxArrayPrint ( MPI_Comm comm, const char *filename, hypre_BoxArray *box_array ); HYPRE_Int hypre_BoxArraySetSize ( hypre_BoxArray *box_array, HYPRE_Int size ); -hypre_BoxArray *hypre_BoxArrayDuplicate ( hypre_BoxArray *box_array ); +hypre_BoxArray *hypre_BoxArrayClone ( 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_Int hypre_BoxArrayVolume ( hypre_BoxArray *box_array ); +HYPRE_Int hypre_BoxArrayInBoxArray ( hypre_BoxArray *box_array1, hypre_BoxArray *box_array2 ); +HYPRE_Int hypre_BoxArraysEqual ( hypre_BoxArray *box_array1, hypre_BoxArray *box_array2 ); 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 ); +hypre_BoxArrayArray *hypre_BoxArrayArrayClone ( hypre_BoxArrayArray *box_array_array ); +HYPRE_Int hypre_BoxArrayArrayPrintToFile ( FILE *file, hypre_BoxArrayArray *box_array_array ); +HYPRE_Int hypre_BoxArrayArrayPrint ( MPI_Comm comm, const char *filename, + hypre_BoxArrayArray *box_array_array ); + +/* box_ds.c */ +HYPRE_Int hypre_BoxBTNodeCreate ( HYPRE_Int ndim, hypre_BoxBTNode **btnode_ptr ); +HYPRE_Int hypre_BoxBTNodeSetIndices ( hypre_BoxBTNode *btnode, HYPRE_Int num_indices, + HYPRE_Int **indices ); +HYPRE_Int hypre_BoxBTNodeInitialize ( hypre_BoxBTNode *btnode, HYPRE_Int num_indices, + HYPRE_Int **indices, hypre_Box *box ); +HYPRE_Int hypre_BoxBTNodeDestroy ( hypre_BoxBTNode *btnode ); +HYPRE_Int hypre_BoxBinTreeCreate ( HYPRE_Int ndim, hypre_BoxBinTree **boxbt_ptr ); +HYPRE_Int hypre_BoxBinTreeInitialize ( hypre_BoxBinTree *boxbt, HYPRE_Int num_indices, + HYPRE_Int **indices, hypre_Box *box ); +HYPRE_Int hypre_BoxBinTreeDestroy ( hypre_BoxBinTree *boxbt ); +HYPRE_Int hypre_BoxBTStackCreate ( hypre_BoxBTStack **btstack_ptr ); +HYPRE_Int hypre_BoxBTStackInitialize ( HYPRE_Int capacity, hypre_BoxBTStack *btstack ); +HYPRE_Int hypre_BoxBTStackDestroy ( hypre_BoxBTStack *btstack ); +HYPRE_Int hypre_BoxBTStackInsert ( hypre_BoxBTNode *btnode, hypre_BoxBTStack *btstack ); +HYPRE_Int hypre_BoxBTStackDelete ( hypre_BoxBTStack *btstack, hypre_BoxBTNode **btnode_ptr ); +HYPRE_Int hypre_BoxBTQueueCreate ( hypre_BoxBTQueue **btqueue_ptr ); +HYPRE_Int hypre_BoxBTQueueInitialize ( HYPRE_Int capacity, hypre_BoxBTQueue *btqueue ); +HYPRE_Int hypre_BoxBTQueueDestroy ( hypre_BoxBTQueue *btqueue ); +HYPRE_Int hypre_BoxBTQueueInsert ( hypre_BoxBTNode *btnode, hypre_BoxBTQueue *btqueue ); +HYPRE_Int hypre_BoxBTQueueDelete ( hypre_BoxBTQueue *btqueue, hypre_BoxBTNode **btnode_ptr ); /* 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_BoxManEntryGetStride ( hypre_BoxManEntry *entry, hypre_Index stride ); 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 ); @@ -1456,7 +2048,45 @@ HYPRE_Int hypre_FillResponseBoxManAssemble2 ( void *p_recv_contact_buf, HYPRE_In HYPRE_Int contact_proc, void *ro, MPI_Comm comm, void **p_send_response_buf, HYPRE_Int *response_message_size ); +/* coarsen.c */ +HYPRE_Int hypre_MapToCoarseIndex ( hypre_Index index, hypre_IndexRef origin, hypre_Index stride, + HYPRE_Int ndim ); +HYPRE_Int hypre_MapToFineIndex ( hypre_Index index, hypre_IndexRef origin, hypre_Index stride, + HYPRE_Int ndim ); +HYPRE_Int hypre_StructMapFineToCoarse ( hypre_Index findex, hypre_Index origin, hypre_Index stride, + hypre_Index cindex ); +HYPRE_Int hypre_StructMapCoarseToFine ( hypre_Index cindex, hypre_Index origin, hypre_Index stride, + hypre_Index findex ); +HYPRE_Int +hypre_ComputeCoarseOriginStride ( hypre_Index coarse_origin, hypre_Index coarse_stride, + hypre_IndexRef origin, hypre_Index stride, HYPRE_Int ndim ); +HYPRE_Int hypre_CoarsenBox ( hypre_Box *box, hypre_IndexRef origin, hypre_Index stride ); +HYPRE_Int hypre_RefineBox ( hypre_Box *box, hypre_IndexRef origin, hypre_Index stride ); +HYPRE_Int hypre_CoarsenBoxArray ( hypre_BoxArray *box_array, hypre_IndexRef origin, + hypre_Index stride ); +HYPRE_Int hypre_RefineBoxArray ( hypre_BoxArray *box_array, hypre_IndexRef origin, + hypre_Index stride ); +HYPRE_Int hypre_CoarsenBoxArrayArray ( hypre_BoxArrayArray *box_array_array, hypre_IndexRef origin, + hypre_Index stride ); +HYPRE_Int hypre_RefineBoxArrayArray ( hypre_BoxArrayArray *box_array_array, hypre_IndexRef origin, + hypre_Index stride ); +HYPRE_Int +hypre_CoarsenBoxArrayArrayOutward( hypre_BoxArrayArray *boxaa, + hypre_BoxArray *refboxa, + hypre_IndexRef origin, + hypre_Index stride, + hypre_BoxArrayArray **new_boxaa_ptr ); +HYPRE_Int hypre_StructCoarsen ( hypre_StructGrid *fgrid, hypre_IndexRef origin, hypre_Index stride, + HYPRE_Int prune, hypre_StructGrid **cgrid_ptr ); + /* communication_info.c */ +hypre_CommStencil *hypre_CommStencilCreate ( HYPRE_Int ndim ); +HYPRE_Int hypre_CommStencilSetEntry ( hypre_CommStencil *comm_stencil, hypre_Index offset ); +HYPRE_Int hypre_CommStencilDestroy ( hypre_CommStencil *comm_stencil ); +HYPRE_Int hypre_StructStencilPrint( FILE *file, hypre_StructStencil *stencil ); +HYPRE_Int hypre_StructStencilRead( FILE *file, HYPRE_Int ndim, hypre_StructStencil **stencil_ptr ); +HYPRE_Int hypre_CommStencilCreateNumGhost ( hypre_CommStencil *comm_stencil, + HYPRE_Int **num_ghost_ptr ); 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, @@ -1469,11 +2099,47 @@ HYPRE_Int hypre_CommInfoProjectSend ( hypre_CommInfo *comm_info, hypre_Index ind hypre_Index stride ); HYPRE_Int hypre_CommInfoProjectRecv ( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ); +HYPRE_Int +hypre_CommInfoCoarsenSend( hypre_CommInfo *comm_info, + hypre_Index index, + hypre_Index stride ); +HYPRE_Int +hypre_CommInfoCoarsenRecv( hypre_CommInfo *comm_info, + hypre_Index index, + hypre_Index stride ); +HYPRE_Int +hypre_CommInfoRefineSend( hypre_CommInfo *comm_info, + hypre_Index index, + hypre_Index stride ); +HYPRE_Int +hypre_CommInfoRefineRecv( hypre_CommInfo *comm_info, + hypre_Index index, + hypre_Index stride ); +HYPRE_Int +hypre_CommInfoCoarsen( hypre_CommInfo *comm_info, + hypre_Index index, + hypre_Index stride ); +HYPRE_Int +hypre_CommInfoRefine( 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_CommInfoClone( hypre_CommInfo *comm_info, hypre_CommInfo **clone_ptr ); +HYPRE_Int +hypre_CreateCommInfo( hypre_StructGrid *bgrid, + hypre_Index stride, + hypre_CommStencil *comm_stencil, + hypre_CommInfo **comm_info_ptr ); +HYPRE_Int +hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, + hypre_Index stride, + hypre_StructStencil *stencil, + hypre_CommInfo **comm_info_ptr ); +HYPRE_Int +hypre_CreateCommInfoFromNumGhost( hypre_StructGrid *grid, + hypre_Index stride, + 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 ); @@ -1487,125 +2153,77 @@ HYPRE_Int hypre_ComputeInfoProjectRecv ( hypre_ComputeInfo *compute_info, hypre_ 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_Index stride, + hypre_StructStencil *stencil, + hypre_ComputeInfo **compute_info_ptr ); +HYPRE_Int hypre_ComputePkgCreate ( HYPRE_MemoryLocation memory_location, + 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_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_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_StructGridAssemble ( HYPRE_StructGrid grid ); -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_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_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_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_StructStencilDestroy ( HYPRE_StructStencil stencil ); - -/* HYPRE_struct_vector.c */ -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_StructVectorAssemble ( HYPRE_StructVector 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_Int hypre_SnapIndexPos ( hypre_Index index, hypre_IndexRef origin, hypre_Index stride, + HYPRE_Int ndim ); +HYPRE_Int hypre_SnapIndexNeg ( hypre_Index index, hypre_IndexRef origin, hypre_Index stride, + HYPRE_Int ndim ); +HYPRE_Int hypre_ConvertToCanonicalIndex ( hypre_Index index, hypre_Index stride, HYPRE_Int ndim ); +HYPRE_Int hypre_ProjectBox ( hypre_Box *box, hypre_IndexRef origin, hypre_Index stride ); +HYPRE_Int hypre_ProjectBoxArray ( hypre_BoxArray *box_array, hypre_IndexRef origin, hypre_Index stride ); -HYPRE_Int hypre_ProjectBoxArrayArray ( hypre_BoxArrayArray *box_array_array, hypre_Index index, +HYPRE_Int hypre_ProjectBoxArrayArray ( hypre_BoxArrayArray *box_array_array, hypre_IndexRef origin, hypre_Index stride ); /* struct_axpy.c */ -HYPRE_Int hypre_StructAxpy ( HYPRE_Complex alpha, hypre_StructVector *x, hypre_StructVector *y ); +HYPRE_Int hypre_StructVectorAxpy ( HYPRE_Complex alpha, hypre_StructVector *x, + HYPRE_Complex beta, hypre_StructVector *y, + hypre_StructVector *z ); +HYPRE_Int hypre_StructVectorPointwiseDivpy ( HYPRE_Complex alpha, hypre_StructVector *x, + hypre_StructVector *z, HYPRE_Complex beta, + hypre_StructVector *y ); +HYPRE_Int hypre_StructVectorPointwiseDivision ( hypre_StructVector *x, hypre_StructVector *y, + hypre_StructVector **z_ptr ); +HYPRE_Int hypre_StructVectorPointwiseProduct ( hypre_StructVector *x, hypre_StructVector *y, + hypre_StructVector **z_ptr ); +HYPRE_Int hypre_StructVectorPointwiseInverse ( hypre_StructVector *x, hypre_StructVector **y_ptr ); + /* 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_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_BoxArray *recv_data_space, HYPRE_Int num_values, + HYPRE_Int **orders, HYPRE_Int reverse, + MPI_Comm comm, HYPRE_MemoryLocation memory_location, + hypre_CommPkg **comm_pkg_ptr ); +HYPRE_Int hypre_CommBlockSetEntries ( hypre_CommBlock *comm_block, HYPRE_Int *boxnums, + hypre_Box *boxes, HYPRE_Int *orders, hypre_Index stride, + hypre_BoxArray *data_space, + HYPRE_Int *data_offsets ); +HYPRE_Int hypre_CommBlockSetEntry ( hypre_CommBlock *comm_block, HYPRE_Int comm_num, hypre_Box *box, + hypre_Index stride, hypre_Index coord, hypre_Index dir, + HYPRE_Int *order, HYPRE_Int *rem_order, + hypre_Box *data_box, HYPRE_Int data_box_offset ); +HYPRE_Int hypre_CommPkgSetPrefixSizes ( hypre_CommPkg *comm_pkg ); +HYPRE_Int hypre_CommPkgAgglomerate ( HYPRE_Int num_comm_pkgs, hypre_CommPkg **comm_pkgs, + hypre_CommPkg **agg_comm_pkg_ptr ); +HYPRE_Int hypre_CommPkgAgglomData( HYPRE_Int num_comm_pkgs, hypre_CommPkg **comm_pkg_a, + HYPRE_Complex ***comm_data_a, hypre_CommPkg *comm_pkg, + HYPRE_Complex ***agg_comm_data_ptr ); +HYPRE_Int hypre_CommPkgAgglomDestroy( HYPRE_Int num_comm_pkgs, hypre_CommPkg **comm_pkg_a, + HYPRE_Complex ***comm_data_a ); +HYPRE_Int hypre_StructCommunicationInitialize ( 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_StructCommunicationFinalize ( 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_CommPkgDestroy ( hypre_CommPkg *comm_pkg ); /* struct_copy.c */ @@ -1613,6 +2231,17 @@ 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_data.c */ +HYPRE_Int +hypre_StructDataCopy( HYPRE_Complex *fr_data, /* from */ + hypre_BoxArray *fr_data_space, + HYPRE_Complex *to_data, /* to */ + hypre_BoxArray *to_data_space, + HYPRE_Int ndim, + HYPRE_Int nval ); +HYPRE_Int hypre_StructNumGhostFromStencil ( hypre_StructStencil *stencil, + HYPRE_Int **num_ghost_ptr ); + /* 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 ); @@ -1625,10 +2254,14 @@ HYPRE_Int hypre_StructGridSetBoundingBox ( hypre_StructGrid *grid, hypre_Box *ne 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_StructGridComputeGlobalSize ( hypre_StructGrid *grid ); HYPRE_Int hypre_StructGridAssemble ( hypre_StructGrid *grid ); +HYPRE_Int hypre_StructGridComputeBoxnums ( hypre_StructGrid *grid, HYPRE_Int nboxes, + HYPRE_Int *boxnums, hypre_Index stride, HYPRE_Int *new_nboxes_ptr, HYPRE_Int **new_boxnums_ptr ); 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_StructGridPrintVTK ( const char *filename, hypre_StructGrid *grid ); 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 ); @@ -1638,32 +2271,229 @@ HYPRE_Int hypre_StructGridSetDataLocation( HYPRE_StructGrid grid, HYPRE_MemoryLocation data_location ); #endif /* struct_innerprod.c */ +HYPRE_Real hypre_StructInnerProdLocal ( 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_Int dim, hypre_BoxArray *box_array, + hypre_BoxArray *data_space, HYPRE_Int num_values, HYPRE_Int *value_ids, HYPRE_Complex *data ); +HYPRE_Int +hypre_ReadBoxArrayData( FILE *file, HYPRE_Int ndim, hypre_BoxArray *box_array, + HYPRE_Int *num_values_ptr, HYPRE_Int **value_ids_ptr, HYPRE_Complex **values_ptr ); + +/* struct_matmult.c */ +HYPRE_Int +hypre_StructMatmultCreate( HYPRE_Int max_matmults, + HYPRE_Int max_matrices, + hypre_StructMatmultData **mmdata_ptr ); +HYPRE_Int +hypre_StructMatmultDestroy( hypre_StructMatmultData *mmdata ); +HYPRE_Int +hypre_StructMatmultSetKernelType( hypre_StructMatmultData *mmdata, + HYPRE_Int kernel_type ); +HYPRE_Int +hypre_StructMatmultSetProduct( hypre_StructMatmultData *mmdata, + HYPRE_Int nmatrices_in, + hypre_StructMatrix **matrices_in, + HYPRE_Int nterms, + HYPRE_Int *terms_in, + HYPRE_Int *transposes_in, + HYPRE_Int *iM_ptr ); +HYPRE_Int +hypre_StructMatmultInitialize( hypre_StructMatmultData *mmdata, + HYPRE_Int assemble_grid ); +HYPRE_Int +hypre_StructMatmultCommSetup( hypre_StructMatmultData *mmdata ); +HYPRE_Int +hypre_StructMatmultCommunicate( hypre_StructMatmultData *mmdata ); +HYPRE_Int +hypre_StructMatmultCompute( hypre_StructMatmultData *mmdata, + HYPRE_Int iM ); +HYPRE_Int +hypre_StructMatmultCompute_core_generic( hypre_StructMatmultDataMH *a, + HYPRE_Int na, + HYPRE_Int nterms, + HYPRE_Int ndim, + hypre_Index loop_size, + hypre_Box *fdbox, + hypre_Index fdstart, + hypre_Index fdstride, + hypre_Box *cdbox, + hypre_Index cdstart, + hypre_Index cdstride, + hypre_Box *Mdbox, + hypre_Index Mdstart, + hypre_Index Mdstride ); +HYPRE_Int +hypre_StructMatmultGetMatrix( hypre_StructMatmultData *mmdata, + HYPRE_Int iM, + hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatmultSetup( HYPRE_Int type, + HYPRE_Int nmatrices, + hypre_StructMatrix **matrices, + HYPRE_Int nterms, + HYPRE_Int *terms, + HYPRE_Int *trans, + hypre_StructMatmultData **mmdata_ptr, + hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatmultMultiply( hypre_StructMatmultData *mmdata ); +HYPRE_Int hypre_StructMatmult ( HYPRE_Int type, HYPRE_Int nmatrices, hypre_StructMatrix **matrices, + HYPRE_Int nterms, HYPRE_Int *terms, HYPRE_Int *trans, + hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatmatSetup( hypre_StructMatrix *A, + hypre_StructMatrix *B, + hypre_StructMatmultData **mmdata_ptr, + hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatmat( hypre_StructMatrix *A, + hypre_StructMatrix *B, + hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatrixPtAPSetup( HYPRE_Int kernel_type, + hypre_StructMatrix *A, + hypre_StructMatrix *P, + hypre_StructMatmultData **mmdata_ptr, + hypre_StructMatrix **M_ptr); +HYPRE_Int +hypre_StructMatrixPtAP( hypre_StructMatrix *A, + hypre_StructMatrix *P, + hypre_StructMatrix **M_ptr); +HYPRE_Int +hypre_StructMatrixRAPSetup( HYPRE_Int kernel_type, + hypre_StructMatrix *R, + hypre_StructMatrix *A, + hypre_StructMatrix *P, + hypre_StructMatmultData **mmdata_ptr, + hypre_StructMatrix **M_ptr); +HYPRE_Int +hypre_StructMatrixRAP( hypre_StructMatrix *R, + hypre_StructMatrix *A, + hypre_StructMatrix *P, + hypre_StructMatrix **M_ptr); +HYPRE_Int +hypre_StructMatrixRTtAPSetup( HYPRE_Int kernel_type, + hypre_StructMatrix *RT, + hypre_StructMatrix *A, + hypre_StructMatrix *P, + hypre_StructMatmultData **mmdata_ptr, + hypre_StructMatrix **M_ptr); +HYPRE_Int +hypre_StructMatrixRTtAP( hypre_StructMatrix *RT, + hypre_StructMatrix *A, + hypre_StructMatrix *P, + hypre_StructMatrix **M_ptr); +HYPRE_Int +hypre_StructMatrixAddInit( HYPRE_Int nmatrices, + hypre_StructMatrix **matrices, + hypre_StructMatrix **A_ptr ); +HYPRE_Int +hypre_StructMatrixAddMat( hypre_StructMatrix *A, + HYPRE_Complex alpha, + hypre_StructMatrix *B ); + +/* struct_matmult_core.c */ +HYPRE_Int +hypre_StructMatmultCompute_core( HYPRE_Int nterms, + hypre_StructMatmultDataMH *a, + HYPRE_Int na, + HYPRE_Int ndim, + hypre_Index loop_size, + HYPRE_Int stencil_size, + hypre_Box *fdbox, + hypre_Index fdstart, + hypre_Index fdstride, + hypre_Box *cdbox, + hypre_Index cdstart, + hypre_Index cdstride, + hypre_Box *Mdbox, + hypre_Index Mdstart, + hypre_Index Mdstride ); + +/* struct_matmult_fuse.c */ +HYPRE_Int +hypre_StructMatmultCompute_fuse( HYPRE_Int nterms, + hypre_StructMatmultDataMH *a, + HYPRE_Int na, + HYPRE_Int ndim, + hypre_Index loop_size, + HYPRE_Int stencil_size, + hypre_Box *fdbox, + hypre_Index fdstart, + hypre_Index fdstride, + hypre_Box *cdbox, + hypre_Index cdstart, + hypre_Index cdstride, + hypre_Box *Mdbox, + hypre_Index Mdstart, + hypre_Index Mdstride, + hypre_StructMatrix *M ); + +/* struct_matop.c */ +HYPRE_Int hypre_StructMatrixZeroDiagonal( hypre_StructMatrix *A ); +HYPRE_Int hypre_StructMatrixComputeRowSum ( hypre_StructMatrix *A, HYPRE_Int type, + hypre_StructVector *rowsum ); /* struct_matrix.c */ +HYPRE_Int +hypre_StructMatrixGetFStride( hypre_StructMatrix *matrix, + hypre_IndexRef *fstride ); +HYPRE_Int +hypre_StructMatrixGetCStride( hypre_StructMatrix *matrix, + hypre_IndexRef *cstride ); +HYPRE_Int hypre_StructMatrixGetDataMapStride ( hypre_StructMatrix *matrix, hypre_IndexRef *stride ); +HYPRE_Int hypre_StructMatrixMapDataIndex ( hypre_StructMatrix *matrix, hypre_Index dindex ); +HYPRE_Int hypre_StructMatrixUnMapDataIndex ( hypre_StructMatrix *matrix, hypre_Index dindex ); +HYPRE_Int hypre_StructMatrixMapDataBox ( hypre_StructMatrix *matrix, hypre_Box *dbox ); +HYPRE_Int hypre_StructMatrixUnMapDataBox ( hypre_StructMatrix *matrix, hypre_Box *dbox ); +HYPRE_Int hypre_StructMatrixMapDataStride ( hypre_StructMatrix *matrix, hypre_Index dstride ); +HYPRE_Int hypre_StructMatrixUnMapDataStride ( hypre_StructMatrix *matrix, hypre_Index dstride ); +HYPRE_Int hypre_StructMatrixPlaceStencil ( hypre_StructMatrix *matrix, HYPRE_Int entry, + hypre_Index dindex, hypre_Index index ); +HYPRE_Int hypre_StructMatrixGetStencilStride ( hypre_StructMatrix *matrix, hypre_Index stride ); +HYPRE_Int hypre_StructMatrixGetStencilSpace ( hypre_StructMatrix *matrix, HYPRE_Int entry, + HYPRE_Int transpose, hypre_Index origin, hypre_Index stride ); +HYPRE_Int +hypre_StructMatrixGetStSpaces( hypre_StructMatrix *matrix, + HYPRE_Int transpose, + HYPRE_Int *num_sspaces_ptr, + HYPRE_Int **sentry_sspaces_ptr, + hypre_Index **sspace_origins_ptr, + hypre_Index stride ); +HYPRE_Int hypre_StructMatrixMapCommInfo ( hypre_StructMatrix *matrix, hypre_IndexRef origin, + hypre_Index stride, hypre_CommInfo *comm_info ); +HYPRE_Int hypre_StructMatrixCreateCommPkg ( hypre_StructMatrix *matrix, hypre_CommInfo *comm_info, + hypre_CommPkg **comm_pkg_ptr, HYPRE_Complex ***comm_data_ptr); 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_StructMatrixSetMemoryLocation( hypre_StructMatrix *matrix, + HYPRE_MemoryLocation memory_location ); +HYPRE_Int hypre_StructMatrixSetRangeStride ( hypre_StructMatrix *matrix, + hypre_IndexRef range_stride ); +HYPRE_Int hypre_StructMatrixSetDomainStride ( hypre_StructMatrix *matrix, + hypre_IndexRef domain_stride ); +HYPRE_Int +hypre_StructMatrixComputeDataSpace( hypre_StructMatrix *matrix, + HYPRE_Int *num_ghost, + hypre_BoxArray **data_space_ptr ); +HYPRE_Int +hypre_StructMatrixGrowDataSpace( hypre_StructMatrix *matrix, + HYPRE_Int *num_ghost, + hypre_BoxArray **data_space_ptr ); +HYPRE_Int +hypre_StructMatrixNeedResize( hypre_StructMatrix *matrix, + hypre_BoxArray *data_space ); +HYPRE_Int hypre_StructMatrixResize ( hypre_StructMatrix *matrix, hypre_BoxArray *data_space ); +HYPRE_Int hypre_StructMatrixRestore ( hypre_StructMatrix *matrix ); +HYPRE_Int hypre_StructMatrixForget ( 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_Int zero_init, HYPRE_Complex *data ); 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, @@ -1679,11 +2509,14 @@ HYPRE_Int hypre_StructMatrixClearValues ( hypre_StructMatrix *matrix, hypre_Inde 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_StructMatrixSetTranspose ( hypre_StructMatrix *matrix, HYPRE_Int transpose, + HYPRE_Int *resize ); +HYPRE_Int hypre_StructMatrixSetNumGhost ( hypre_StructMatrix *matrix, HYPRE_Int *num_ghost, + HYPRE_Int *resize ); +HYPRE_Int hypre_StructMatrixSetGhost ( hypre_StructMatrix *matrix, HYPRE_Int ghost, + HYPRE_Int *resize ); HYPRE_Int hypre_StructMatrixClearGhostValues ( hypre_StructMatrix *matrix ); HYPRE_Int hypre_StructMatrixPrintData ( FILE *file, hypre_StructMatrix *matrix, HYPRE_Int all ); HYPRE_Int hypre_StructMatrixReadData ( FILE *file, hypre_StructMatrix *matrix ); @@ -1693,7 +2526,8 @@ 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); +HYPRE_Int hypre_StructMatrixClearBoundary ( hypre_StructMatrix *matrix); +HYPRE_Int hypre_StructMatrixGetDiagonal ( hypre_StructMatrix *matrix, hypre_StructVector *diag ); /* struct_matrix_mask.c */ hypre_StructMatrix *hypre_StructMatrixCreateMask ( hypre_StructMatrix *matrix, @@ -1701,19 +2535,106 @@ hypre_StructMatrix *hypre_StructMatrixCreateMask ( hypre_StructMatrix *matrix, /* struct_matvec.c */ void *hypre_StructMatvecCreate ( void ); +HYPRE_Int hypre_StructMatvecSetTranspose ( void *matvec_vdata, HYPRE_Int transpose ); +HYPRE_Int hypre_StructMatvecSetActive ( void *matvec_vdata, HYPRE_Int active ); 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_StructMatvecCompute( void *matvec_vdata, + HYPRE_Complex alpha, + hypre_StructMatrix *A, + hypre_StructVector *x, + HYPRE_Complex beta, + hypre_StructVector *y, + hypre_StructVector *z ); 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_StructMatvecT ( HYPRE_Complex alpha, hypre_StructMatrix *A, hypre_StructVector *x, + HYPRE_Complex beta, hypre_StructVector *y ); + +/* struct_matvec_core.c */ +HYPRE_Int +hypre_StructMatvecCompute_core_CC( HYPRE_Complex alpha, + hypre_StructMatrix *A, + hypre_StructVector *x, + HYPRE_Complex beta, + hypre_StructVector *y, + hypre_StructVector *z, + HYPRE_Int Ab, + HYPRE_Int xb, + HYPRE_Int yb, + HYPRE_Int zb, + HYPRE_Int transpose, + HYPRE_Int nentries, + HYPRE_Int *entries, + hypre_IndexRef start, + hypre_IndexRef stride, + hypre_IndexRef loop_size, + hypre_IndexRef xfstride, + hypre_IndexRef ran_stride, + hypre_IndexRef xdstride, + hypre_IndexRef ydstride, + hypre_IndexRef zdstride, + hypre_Box *x_data_box, + hypre_Box *y_data_box, + hypre_Box *z_data_box); +HYPRE_Int +hypre_StructMatvecCompute_core_VC( HYPRE_Complex alpha, + hypre_StructMatrix *A, + hypre_StructVector *x, + HYPRE_Complex beta, + hypre_StructVector *y, + hypre_StructVector *z, + HYPRE_Int Ab, + HYPRE_Int xb, + HYPRE_Int yb, + HYPRE_Int zb, + HYPRE_Int transpose, + HYPRE_Int only_Ax, + HYPRE_Int nentries, + HYPRE_Int *entries, + hypre_IndexRef start, + hypre_IndexRef stride, + hypre_IndexRef loop_size, + hypre_IndexRef xfstride, + hypre_IndexRef ran_stride, + hypre_IndexRef Adstride, + hypre_IndexRef xdstride, + hypre_IndexRef ydstride, + hypre_IndexRef zdstride, + hypre_Box *A_data_box, + hypre_Box *x_data_box, + hypre_Box *y_data_box, + hypre_Box *z_data_box ); +HYPRE_Int +hypre_StructMatvecCompute_core_VCC( HYPRE_Complex alpha, + hypre_StructMatrix *A, + hypre_StructVector *x, + HYPRE_Complex beta, + hypre_StructVector *y, + hypre_StructVector *z, + HYPRE_Int Ab, + HYPRE_Int xb, + HYPRE_Int yb, + HYPRE_Int zb, + HYPRE_Int transpose, + HYPRE_Int centry, + HYPRE_Int nentries, + HYPRE_Int *entries, + hypre_IndexRef start, + hypre_IndexRef stride, + hypre_IndexRef loop_size, + hypre_IndexRef xfstride, + hypre_IndexRef ran_stride, + hypre_IndexRef Adstride, + hypre_IndexRef xdstride, + hypre_IndexRef ydstride, + hypre_IndexRef zdstride, + hypre_Box *A_data_box, + hypre_Box *x_data_box, + hypre_Box *y_data_box, + hypre_Box *z_data_box ); /* struct_scale.c */ HYPRE_Int hypre_StructScale ( HYPRE_Complex alpha, hypre_StructVector *y ); @@ -1723,18 +2644,44 @@ 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_StructStencilOffsetEntry ( hypre_StructStencil *stencil, + hypre_Index stencil_offset ); HYPRE_Int hypre_StructStencilSymmetrize ( hypre_StructStencil *stencil, - hypre_StructStencil **symm_stencil_ptr, HYPRE_Int **symm_elements_ptr ); + hypre_StructStencil **symm_stencil_ptr, HYPRE_Int **symm_offsets_ptr ); /* struct_vector.c */ +HYPRE_Int hypre_StructVectorMapDataIndex ( hypre_StructVector *vector, hypre_Index dindex ); +HYPRE_Int hypre_StructVectorMapDataBox ( hypre_StructVector *vector, hypre_Box *dbox ); +HYPRE_Int hypre_StructVectorMapDataStride ( hypre_StructVector *vector, hypre_Index dstride ); +HYPRE_Int hypre_StructVectorUnMapDataIndex ( hypre_StructVector *vector, hypre_Index dindex ); +HYPRE_Int hypre_StructVectorUnMapDataBox ( hypre_StructVector *vector, hypre_Box *dbox ); +HYPRE_Int hypre_StructVectorUnMapDataStride ( hypre_StructVector *vector, hypre_Index dstride ); +HYPRE_Int hypre_StructVectorMapCommInfo ( hypre_StructVector *vector, hypre_CommInfo *comm_info ); 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_StructVectorSetStride ( hypre_StructVector *vector, hypre_IndexRef stride ); +HYPRE_Int +hypre_StructVectorSetMemoryMode( hypre_StructVector *vector, + HYPRE_Int memory_mode ); +HYPRE_Int hypre_StructVectorRebase ( hypre_StructVector *vector, hypre_StructGrid *grid, + hypre_Index stride ); +HYPRE_Int +hypre_StructVectorComputeDataSpace( hypre_StructVector *vector, + hypre_IndexRef stride, + HYPRE_Int *num_ghost, + hypre_BoxArray **data_space_ptr ); +HYPRE_Int +hypre_StructVectorNeedResize( hypre_StructVector *vector, + hypre_BoxArray *data_space ); +HYPRE_Int +hypre_StructVectorResize( hypre_StructVector *vector, + hypre_BoxArray *data_space ); +HYPRE_Int hypre_StructVectorRestore ( hypre_StructVector *vector ); +HYPRE_Int hypre_StructVectorForget ( hypre_StructVector *vector ); HYPRE_Int hypre_StructVectorInitializeShell ( hypre_StructVector *vector ); -HYPRE_Int hypre_StructVectorInitializeData ( hypre_StructVector *vector, HYPRE_Complex *data); -HYPRE_Int hypre_StructVectorInitialize ( hypre_StructVector *vector ); +HYPRE_Int hypre_StructVectorInitializeData ( hypre_StructVector *vector, HYPRE_Complex *data ); +HYPRE_Int hypre_StructVectorInitialize ( hypre_StructVector *vector, HYPRE_Int zero_init ); 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, @@ -1749,8 +2696,8 @@ HYPRE_Int hypre_StructVectorSetNumGhost ( hypre_StructVector *vector, HYPRE_Int 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_StructVectorSetConstantValues ( hypre_StructVector *vector, HYPRE_Complex value ); +HYPRE_Int hypre_StructVectorSetRandomValues ( hypre_StructVector *vector, HYPRE_Int seed ); HYPRE_Int hypre_StructVectorSetFunctionValues ( hypre_StructVector *vector, HYPRE_Complex (*fcn )( HYPRE_Int, HYPRE_Int, HYPRE_Int )); HYPRE_Int hypre_StructVectorClearGhostValues ( hypre_StructVector *vector ); @@ -1760,16 +2707,31 @@ hypre_CommPkg *hypre_StructVectorGetMigrateCommPkg ( hypre_StructVector *from_ve hypre_StructVector *to_vector ); 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_StructVector *hypre_StructVectorRead ( MPI_Comm comm, const char *filename, HYPRE_Int *num_ghost ); +HYPRE_Int hypre_StructVectorMaxValue ( hypre_StructVector *vector, HYPRE_Real *max_value, + HYPRE_Int *max_index, hypre_Index max_xyz_index ); hypre_StructVector *hypre_StructVectorClone ( hypre_StructVector *vector ); -HYPRE_Int hypre_StructVectorPointwiseDivision ( hypre_StructVector *x, hypre_StructVector *y, - hypre_StructVector **z_ptr ); -HYPRE_Int hypre_StructVectorPointwiseProduct ( hypre_StructVector *x, hypre_StructVector *y, - hypre_StructVector **z_ptr ); -HYPRE_Int hypre_StructVectorPointwiseInverse ( hypre_StructVector *x, hypre_StructVector **y_ptr ); +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/* Mixed precision function protos */ +/* struct_mv_mp.c */ + +#if defined(HYPRE_MIXED_PRECISION) +HYPRE_Int +hypre_StructVectorCopy_mp( hypre_StructVector *x, + hypre_StructVector *y ); +#endif + /****************************************************************************** * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. @@ -2368,8 +3330,12 @@ hypre__J = hypre__thread; i1 = i2 = 0; \ #else #define Pragma(x) _Pragma(HYPRE_XSTR(x)) #endif +#ifndef OMP0 #define OMP0 Pragma(omp parallel for HYPRE_OMP_CLAUSE HYPRE_BOX_REDUCTION HYPRE_SMP_SCHEDULE) +#endif +#ifndef OMP1 #define OMP1 Pragma(omp parallel for private(HYPRE_BOX_PRIVATE) HYPRE_OMP_CLAUSE HYPRE_BOX_REDUCTION HYPRE_SMP_SCHEDULE) +#endif #else /* #if defined(HYPRE_USING_OPENMP) */ #define OMP0 #define OMP1 @@ -2735,10 +3701,20 @@ hypre__J = hypre__thread; i1 = i2 = 0; \ #endif /* #ifndef HYPRE_BOXLOOP_HOST_HEADER */ - #ifdef __cplusplus } #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_struct_mv_mup_undef.h" +#include "_hypre_struct_mv_mup.h" +#endif +#endif + #endif diff --git a/src/struct_mv/_hypre_struct_mv_mup.h b/src/struct_mv/_hypre_struct_mv_mup.h new file mode 100644 index 0000000000..aee788312e --- /dev/null +++ b/src/struct_mv/_hypre_struct_mv_mup.h @@ -0,0 +1,2741 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#ifndef hypre_STRUCT_MV_MUP_HEADER +#define hypre_STRUCT_MV_MUP_HEADER + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (HYPRE_MIXED_PRECISION) + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +hypre_APFillResponseStructAssumedPart_flt( 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_APFillResponseStructAssumedPart_dbl( 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_APFillResponseStructAssumedPart_long_dbl( 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_APFindMyBoxesInRegions_flt( hypre_BoxArray *region_array, hypre_BoxArray *my_box_array, HYPRE_Int **p_count_array, hypre_float **p_vol_array ); +HYPRE_Int +hypre_APFindMyBoxesInRegions_dbl( hypre_BoxArray *region_array, hypre_BoxArray *my_box_array, HYPRE_Int **p_count_array, hypre_double **p_vol_array ); +HYPRE_Int +hypre_APFindMyBoxesInRegions_long_dbl( hypre_BoxArray *region_array, hypre_BoxArray *my_box_array, HYPRE_Int **p_count_array, hypre_long_double **p_vol_array ); + +HYPRE_Int +hypre_APGetAllBoxesInRegions_flt( hypre_BoxArray *region_array, hypre_BoxArray *my_box_array, HYPRE_Int **p_count_array, hypre_float **p_vol_array, MPI_Comm comm ); +HYPRE_Int +hypre_APGetAllBoxesInRegions_dbl( hypre_BoxArray *region_array, hypre_BoxArray *my_box_array, HYPRE_Int **p_count_array, hypre_double **p_vol_array, MPI_Comm comm ); +HYPRE_Int +hypre_APGetAllBoxesInRegions_long_dbl( hypre_BoxArray *region_array, hypre_BoxArray *my_box_array, HYPRE_Int **p_count_array, hypre_long_double **p_vol_array, MPI_Comm comm ); + +HYPRE_Int +hypre_APPruneRegions_flt( hypre_BoxArray *region_array, HYPRE_Int **p_count_array, hypre_float **p_vol_array ); +HYPRE_Int +hypre_APPruneRegions_dbl( hypre_BoxArray *region_array, HYPRE_Int **p_count_array, hypre_double **p_vol_array ); +HYPRE_Int +hypre_APPruneRegions_long_dbl( hypre_BoxArray *region_array, HYPRE_Int **p_count_array, hypre_long_double **p_vol_array ); + +HYPRE_Int +hypre_APRefineRegionsByVol_flt( hypre_BoxArray *region_array, hypre_float *vol_array, HYPRE_Int max_regions, hypre_float gamma, HYPRE_Int dim, HYPRE_Int *return_code, MPI_Comm comm ); +HYPRE_Int +hypre_APRefineRegionsByVol_dbl( hypre_BoxArray *region_array, hypre_double *vol_array, HYPRE_Int max_regions, hypre_double gamma, HYPRE_Int dim, HYPRE_Int *return_code, MPI_Comm comm ); +HYPRE_Int +hypre_APRefineRegionsByVol_long_dbl( hypre_BoxArray *region_array, hypre_long_double *vol_array, HYPRE_Int max_regions, hypre_long_double gamma, HYPRE_Int dim, HYPRE_Int *return_code, MPI_Comm comm ); + +HYPRE_Int +hypre_APShrinkRegions_flt( hypre_BoxArray *region_array, hypre_BoxArray *my_box_array, MPI_Comm comm ); +HYPRE_Int +hypre_APShrinkRegions_dbl( hypre_BoxArray *region_array, hypre_BoxArray *my_box_array, MPI_Comm comm ); +HYPRE_Int +hypre_APShrinkRegions_long_dbl( hypre_BoxArray *region_array, hypre_BoxArray *my_box_array, MPI_Comm comm ); + +HYPRE_Int +hypre_APSubdivideRegion_flt( hypre_Box *region, HYPRE_Int dim, HYPRE_Int level, hypre_BoxArray *box_array, HYPRE_Int *num_new_boxes ); +HYPRE_Int +hypre_APSubdivideRegion_dbl( hypre_Box *region, HYPRE_Int dim, HYPRE_Int level, hypre_BoxArray *box_array, HYPRE_Int *num_new_boxes ); +HYPRE_Int +hypre_APSubdivideRegion_long_dbl( hypre_Box *region, HYPRE_Int dim, HYPRE_Int level, hypre_BoxArray *box_array, HYPRE_Int *num_new_boxes ); + +HYPRE_Int +hypre_AddIndexes_flt( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim, hypre_Index result ); +HYPRE_Int +hypre_AddIndexes_dbl( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim, hypre_Index result ); +HYPRE_Int +hypre_AddIndexes_long_dbl( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim, hypre_Index result ); + +HYPRE_Int +hypre_AppendBox_flt( hypre_Box *box, hypre_BoxArray *box_array ); +HYPRE_Int +hypre_AppendBox_dbl( hypre_Box *box, hypre_BoxArray *box_array ); +HYPRE_Int +hypre_AppendBox_long_dbl( hypre_Box *box, hypre_BoxArray *box_array ); + +HYPRE_Int +hypre_AppendBoxArray_flt( hypre_BoxArray *box_array_0, hypre_BoxArray *box_array_1 ); +HYPRE_Int +hypre_AppendBoxArray_dbl( hypre_BoxArray *box_array_0, hypre_BoxArray *box_array_1 ); +HYPRE_Int +hypre_AppendBoxArray_long_dbl( hypre_BoxArray *box_array_0, hypre_BoxArray *box_array_1 ); + +hypre_BoxArrayArray * +hypre_BoxArrayArrayClone_flt( hypre_BoxArrayArray *box_array_array ); +hypre_BoxArrayArray * +hypre_BoxArrayArrayClone_dbl( hypre_BoxArrayArray *box_array_array ); +hypre_BoxArrayArray * +hypre_BoxArrayArrayClone_long_dbl( hypre_BoxArrayArray *box_array_array ); + +hypre_BoxArrayArray * +hypre_BoxArrayArrayCreate_flt( HYPRE_Int size, HYPRE_Int ndim ); +hypre_BoxArrayArray * +hypre_BoxArrayArrayCreate_dbl( HYPRE_Int size, HYPRE_Int ndim ); +hypre_BoxArrayArray * +hypre_BoxArrayArrayCreate_long_dbl( HYPRE_Int size, HYPRE_Int ndim ); + +HYPRE_Int +hypre_BoxArrayArrayDestroy_flt( hypre_BoxArrayArray *box_array_array ); +HYPRE_Int +hypre_BoxArrayArrayDestroy_dbl( hypre_BoxArrayArray *box_array_array ); +HYPRE_Int +hypre_BoxArrayArrayDestroy_long_dbl( hypre_BoxArrayArray *box_array_array ); + +HYPRE_Int +hypre_BoxArrayArrayPrint_flt( MPI_Comm comm, const char *filename, hypre_BoxArrayArray *box_array_array ); +HYPRE_Int +hypre_BoxArrayArrayPrint_dbl( MPI_Comm comm, const char *filename, hypre_BoxArrayArray *box_array_array ); +HYPRE_Int +hypre_BoxArrayArrayPrint_long_dbl( MPI_Comm comm, const char *filename, hypre_BoxArrayArray *box_array_array ); + +HYPRE_Int +hypre_BoxArrayArrayPrintToFile_flt( FILE *file, hypre_BoxArrayArray *box_array_array ); +HYPRE_Int +hypre_BoxArrayArrayPrintToFile_dbl( FILE *file, hypre_BoxArrayArray *box_array_array ); +HYPRE_Int +hypre_BoxArrayArrayPrintToFile_long_dbl( FILE *file, hypre_BoxArrayArray *box_array_array ); + +hypre_BoxArray * +hypre_BoxArrayClone_flt( hypre_BoxArray *box_array ); +hypre_BoxArray * +hypre_BoxArrayClone_dbl( hypre_BoxArray *box_array ); +hypre_BoxArray * +hypre_BoxArrayClone_long_dbl( hypre_BoxArray *box_array ); + +hypre_BoxArray * +hypre_BoxArrayCreate_flt( HYPRE_Int size, HYPRE_Int ndim ); +hypre_BoxArray * +hypre_BoxArrayCreate_dbl( HYPRE_Int size, HYPRE_Int ndim ); +hypre_BoxArray * +hypre_BoxArrayCreate_long_dbl( HYPRE_Int size, HYPRE_Int ndim ); + +HYPRE_Int +hypre_BoxArrayCreateFromIndices_flt( HYPRE_Int ndim, HYPRE_Int num_indices_in, HYPRE_Int **indices_in, hypre_float threshold, hypre_BoxArray **box_array_ptr ); +HYPRE_Int +hypre_BoxArrayCreateFromIndices_dbl( HYPRE_Int ndim, HYPRE_Int num_indices_in, HYPRE_Int **indices_in, hypre_double threshold, hypre_BoxArray **box_array_ptr ); +HYPRE_Int +hypre_BoxArrayCreateFromIndices_long_dbl( HYPRE_Int ndim, HYPRE_Int num_indices_in, HYPRE_Int **indices_in, hypre_long_double threshold, hypre_BoxArray **box_array_ptr ); + +HYPRE_Int +hypre_BoxArrayDestroy_flt( hypre_BoxArray *box_array ); +HYPRE_Int +hypre_BoxArrayDestroy_dbl( hypre_BoxArray *box_array ); +HYPRE_Int +hypre_BoxArrayDestroy_long_dbl( hypre_BoxArray *box_array ); + +HYPRE_Int +hypre_BoxArrayInBoxArray_flt( hypre_BoxArray *box_array1, hypre_BoxArray *box_array2 ); +HYPRE_Int +hypre_BoxArrayInBoxArray_dbl( hypre_BoxArray *box_array1, hypre_BoxArray *box_array2 ); +HYPRE_Int +hypre_BoxArrayInBoxArray_long_dbl( hypre_BoxArray *box_array1, hypre_BoxArray *box_array2 ); + +HYPRE_Int +hypre_BoxArrayPrint_flt( MPI_Comm comm, const char *filename, hypre_BoxArray *box_array ); +HYPRE_Int +hypre_BoxArrayPrint_dbl( MPI_Comm comm, const char *filename, hypre_BoxArray *box_array ); +HYPRE_Int +hypre_BoxArrayPrint_long_dbl( MPI_Comm comm, const char *filename, hypre_BoxArray *box_array ); + +HYPRE_Int +hypre_BoxArrayPrintToFile_flt( FILE *file, hypre_BoxArray *box_array ); +HYPRE_Int +hypre_BoxArrayPrintToFile_dbl( FILE *file, hypre_BoxArray *box_array ); +HYPRE_Int +hypre_BoxArrayPrintToFile_long_dbl( FILE *file, hypre_BoxArray *box_array ); + +HYPRE_Int +hypre_BoxArrayReadFromFile_flt( FILE *file, hypre_BoxArray **box_array_ptr ); +HYPRE_Int +hypre_BoxArrayReadFromFile_dbl( FILE *file, hypre_BoxArray **box_array_ptr ); +HYPRE_Int +hypre_BoxArrayReadFromFile_long_dbl( FILE *file, hypre_BoxArray **box_array_ptr ); + +HYPRE_Int +hypre_BoxArraySetSize_flt( hypre_BoxArray *box_array, HYPRE_Int size ); +HYPRE_Int +hypre_BoxArraySetSize_dbl( hypre_BoxArray *box_array, HYPRE_Int size ); +HYPRE_Int +hypre_BoxArraySetSize_long_dbl( hypre_BoxArray *box_array, HYPRE_Int size ); + +HYPRE_Int +hypre_BoxArrayVolume_flt( hypre_BoxArray *box_array ); +HYPRE_Int +hypre_BoxArrayVolume_dbl( hypre_BoxArray *box_array ); +HYPRE_Int +hypre_BoxArrayVolume_long_dbl( hypre_BoxArray *box_array ); + +HYPRE_Int +hypre_BoxArraysEqual_flt( hypre_BoxArray *box_array1, hypre_BoxArray *box_array2 ); +HYPRE_Int +hypre_BoxArraysEqual_dbl( hypre_BoxArray *box_array1, hypre_BoxArray *box_array2 ); +HYPRE_Int +hypre_BoxArraysEqual_long_dbl( hypre_BoxArray *box_array1, hypre_BoxArray *box_array2 ); + +HYPRE_Int +hypre_BoxBTNodeCreate_flt( HYPRE_Int ndim, hypre_BoxBTNode **btnode_ptr ); +HYPRE_Int +hypre_BoxBTNodeCreate_dbl( HYPRE_Int ndim, hypre_BoxBTNode **btnode_ptr ); +HYPRE_Int +hypre_BoxBTNodeCreate_long_dbl( HYPRE_Int ndim, hypre_BoxBTNode **btnode_ptr ); + +HYPRE_Int +hypre_BoxBTNodeDestroy_flt( hypre_BoxBTNode *btnode ); +HYPRE_Int +hypre_BoxBTNodeDestroy_dbl( hypre_BoxBTNode *btnode ); +HYPRE_Int +hypre_BoxBTNodeDestroy_long_dbl( hypre_BoxBTNode *btnode ); + +HYPRE_Int +hypre_BoxBTNodeInitialize_flt( hypre_BoxBTNode *btnode, HYPRE_Int num_indices, HYPRE_Int **indices, hypre_Box *box ); +HYPRE_Int +hypre_BoxBTNodeInitialize_dbl( hypre_BoxBTNode *btnode, HYPRE_Int num_indices, HYPRE_Int **indices, hypre_Box *box ); +HYPRE_Int +hypre_BoxBTNodeInitialize_long_dbl( hypre_BoxBTNode *btnode, HYPRE_Int num_indices, HYPRE_Int **indices, hypre_Box *box ); + +HYPRE_Int +hypre_BoxBTNodeSetIndices_flt( hypre_BoxBTNode *btnode, HYPRE_Int num_indices, HYPRE_Int **indices ); +HYPRE_Int +hypre_BoxBTNodeSetIndices_dbl( hypre_BoxBTNode *btnode, HYPRE_Int num_indices, HYPRE_Int **indices ); +HYPRE_Int +hypre_BoxBTNodeSetIndices_long_dbl( hypre_BoxBTNode *btnode, HYPRE_Int num_indices, HYPRE_Int **indices ); + +HYPRE_Int +hypre_BoxBTQueueCreate_flt( hypre_BoxBTQueue **btqueue_ptr ); +HYPRE_Int +hypre_BoxBTQueueCreate_dbl( hypre_BoxBTQueue **btqueue_ptr ); +HYPRE_Int +hypre_BoxBTQueueCreate_long_dbl( hypre_BoxBTQueue **btqueue_ptr ); + +HYPRE_Int +hypre_BoxBTQueueDelete_flt( hypre_BoxBTQueue *btqueue, hypre_BoxBTNode **btnode_ptr ); +HYPRE_Int +hypre_BoxBTQueueDelete_dbl( hypre_BoxBTQueue *btqueue, hypre_BoxBTNode **btnode_ptr ); +HYPRE_Int +hypre_BoxBTQueueDelete_long_dbl( hypre_BoxBTQueue *btqueue, hypre_BoxBTNode **btnode_ptr ); + +HYPRE_Int +hypre_BoxBTQueueDestroy_flt( hypre_BoxBTQueue *btqueue ); +HYPRE_Int +hypre_BoxBTQueueDestroy_dbl( hypre_BoxBTQueue *btqueue ); +HYPRE_Int +hypre_BoxBTQueueDestroy_long_dbl( hypre_BoxBTQueue *btqueue ); + +HYPRE_Int +hypre_BoxBTQueueInitialize_flt( HYPRE_Int capacity, hypre_BoxBTQueue *btqueue ); +HYPRE_Int +hypre_BoxBTQueueInitialize_dbl( HYPRE_Int capacity, hypre_BoxBTQueue *btqueue ); +HYPRE_Int +hypre_BoxBTQueueInitialize_long_dbl( HYPRE_Int capacity, hypre_BoxBTQueue *btqueue ); + +HYPRE_Int +hypre_BoxBTQueueInsert_flt( hypre_BoxBTNode *btnode, hypre_BoxBTQueue *btqueue ); +HYPRE_Int +hypre_BoxBTQueueInsert_dbl( hypre_BoxBTNode *btnode, hypre_BoxBTQueue *btqueue ); +HYPRE_Int +hypre_BoxBTQueueInsert_long_dbl( hypre_BoxBTNode *btnode, hypre_BoxBTQueue *btqueue ); + +HYPRE_Int +hypre_BoxBTStackCreate_flt( hypre_BoxBTStack **btstack_ptr ); +HYPRE_Int +hypre_BoxBTStackCreate_dbl( hypre_BoxBTStack **btstack_ptr ); +HYPRE_Int +hypre_BoxBTStackCreate_long_dbl( hypre_BoxBTStack **btstack_ptr ); + +HYPRE_Int +hypre_BoxBTStackDelete_flt( hypre_BoxBTStack *btstack, hypre_BoxBTNode **btnode_ptr ); +HYPRE_Int +hypre_BoxBTStackDelete_dbl( hypre_BoxBTStack *btstack, hypre_BoxBTNode **btnode_ptr ); +HYPRE_Int +hypre_BoxBTStackDelete_long_dbl( hypre_BoxBTStack *btstack, hypre_BoxBTNode **btnode_ptr ); + +HYPRE_Int +hypre_BoxBTStackDestroy_flt( hypre_BoxBTStack *btstack ); +HYPRE_Int +hypre_BoxBTStackDestroy_dbl( hypre_BoxBTStack *btstack ); +HYPRE_Int +hypre_BoxBTStackDestroy_long_dbl( hypre_BoxBTStack *btstack ); + +HYPRE_Int +hypre_BoxBTStackInitialize_flt( HYPRE_Int capacity, hypre_BoxBTStack *btstack ); +HYPRE_Int +hypre_BoxBTStackInitialize_dbl( HYPRE_Int capacity, hypre_BoxBTStack *btstack ); +HYPRE_Int +hypre_BoxBTStackInitialize_long_dbl( HYPRE_Int capacity, hypre_BoxBTStack *btstack ); + +HYPRE_Int +hypre_BoxBTStackInsert_flt( hypre_BoxBTNode *btnode, hypre_BoxBTStack *btstack ); +HYPRE_Int +hypre_BoxBTStackInsert_dbl( hypre_BoxBTNode *btnode, hypre_BoxBTStack *btstack ); +HYPRE_Int +hypre_BoxBTStackInsert_long_dbl( hypre_BoxBTNode *btnode, hypre_BoxBTStack *btstack ); + +HYPRE_Int +hypre_BoxBinTreeCreate_flt( HYPRE_Int ndim, hypre_BoxBinTree **boxbt_ptr ); +HYPRE_Int +hypre_BoxBinTreeCreate_dbl( HYPRE_Int ndim, hypre_BoxBinTree **boxbt_ptr ); +HYPRE_Int +hypre_BoxBinTreeCreate_long_dbl( HYPRE_Int ndim, hypre_BoxBinTree **boxbt_ptr ); + +HYPRE_Int +hypre_BoxBinTreeDestroy_flt( hypre_BoxBinTree *boxbt ); +HYPRE_Int +hypre_BoxBinTreeDestroy_dbl( hypre_BoxBinTree *boxbt ); +HYPRE_Int +hypre_BoxBinTreeDestroy_long_dbl( hypre_BoxBinTree *boxbt ); + +HYPRE_Int +hypre_BoxBinTreeInitialize_flt( hypre_BoxBinTree *boxbt, HYPRE_Int num_indices, HYPRE_Int **indices, hypre_Box *box ); +HYPRE_Int +hypre_BoxBinTreeInitialize_dbl( hypre_BoxBinTree *boxbt, HYPRE_Int num_indices, HYPRE_Int **indices, hypre_Box *box ); +HYPRE_Int +hypre_BoxBinTreeInitialize_long_dbl( hypre_BoxBinTree *boxbt, HYPRE_Int num_indices, HYPRE_Int **indices, hypre_Box *box ); + +HYPRE_Int +hypre_BoxBoundaryDG_flt( hypre_Box *box, hypre_StructGrid *g, hypre_BoxArray *boundarym, hypre_BoxArray *boundaryp, HYPRE_Int d ); +HYPRE_Int +hypre_BoxBoundaryDG_dbl( hypre_Box *box, hypre_StructGrid *g, hypre_BoxArray *boundarym, hypre_BoxArray *boundaryp, HYPRE_Int d ); +HYPRE_Int +hypre_BoxBoundaryDG_long_dbl( hypre_Box *box, hypre_StructGrid *g, hypre_BoxArray *boundarym, hypre_BoxArray *boundaryp, HYPRE_Int d ); + +HYPRE_Int +hypre_BoxBoundaryG_flt( hypre_Box *box, hypre_StructGrid *g, hypre_BoxArray *boundary ); +HYPRE_Int +hypre_BoxBoundaryG_dbl( hypre_Box *box, hypre_StructGrid *g, hypre_BoxArray *boundary ); +HYPRE_Int +hypre_BoxBoundaryG_long_dbl( hypre_Box *box, hypre_StructGrid *g, hypre_BoxArray *boundary ); + +HYPRE_Int +hypre_BoxBoundaryIntersect_flt( hypre_Box *box, hypre_StructGrid *grid, HYPRE_Int d, HYPRE_Int dir, hypre_BoxArray *boundary ); +HYPRE_Int +hypre_BoxBoundaryIntersect_dbl( hypre_Box *box, hypre_StructGrid *grid, HYPRE_Int d, HYPRE_Int dir, hypre_BoxArray *boundary ); +HYPRE_Int +hypre_BoxBoundaryIntersect_long_dbl( hypre_Box *box, hypre_StructGrid *grid, HYPRE_Int d, HYPRE_Int dir, hypre_BoxArray *boundary ); + +hypre_Box * +hypre_BoxClone_flt( hypre_Box *box ); +hypre_Box * +hypre_BoxClone_dbl( hypre_Box *box ); +hypre_Box * +hypre_BoxClone_long_dbl( hypre_Box *box ); + +hypre_Box * +hypre_BoxCreate_flt( HYPRE_Int ndim ); +hypre_Box * +hypre_BoxCreate_dbl( HYPRE_Int ndim ); +hypre_Box * +hypre_BoxCreate_long_dbl( HYPRE_Int ndim ); + +HYPRE_Int +hypre_BoxDestroy_flt( hypre_Box *box ); +HYPRE_Int +hypre_BoxDestroy_dbl( hypre_Box *box ); +HYPRE_Int +hypre_BoxDestroy_long_dbl( hypre_Box *box ); + +HYPRE_Int +hypre_BoxGetSize_flt( hypre_Box *box, hypre_Index size ); +HYPRE_Int +hypre_BoxGetSize_dbl( hypre_Box *box, hypre_Index size ); +HYPRE_Int +hypre_BoxGetSize_long_dbl( hypre_Box *box, hypre_Index size ); + +HYPRE_Int +hypre_BoxGetStrideSize_flt( hypre_Box *box, hypre_Index stride, hypre_Index size ); +HYPRE_Int +hypre_BoxGetStrideSize_dbl( hypre_Box *box, hypre_Index stride, hypre_Index size ); +HYPRE_Int +hypre_BoxGetStrideSize_long_dbl( hypre_Box *box, hypre_Index stride, hypre_Index size ); + +HYPRE_Int +hypre_BoxGetStrideVolume_flt( hypre_Box *box, hypre_Index stride, HYPRE_Int *volume_ptr ); +HYPRE_Int +hypre_BoxGetStrideVolume_dbl( hypre_Box *box, hypre_Index stride, HYPRE_Int *volume_ptr ); +HYPRE_Int +hypre_BoxGetStrideVolume_long_dbl( hypre_Box *box, hypre_Index stride, HYPRE_Int *volume_ptr ); + +HYPRE_Int +hypre_BoxGrowByArray_flt( hypre_Box *box, HYPRE_Int *array ); +HYPRE_Int +hypre_BoxGrowByArray_dbl( hypre_Box *box, HYPRE_Int *array ); +HYPRE_Int +hypre_BoxGrowByArray_long_dbl( hypre_Box *box, HYPRE_Int *array ); + +HYPRE_Int +hypre_BoxGrowByBox_flt( hypre_Box *box, hypre_Box *gbox ); +HYPRE_Int +hypre_BoxGrowByBox_dbl( hypre_Box *box, hypre_Box *gbox ); +HYPRE_Int +hypre_BoxGrowByBox_long_dbl( hypre_Box *box, hypre_Box *gbox ); + +HYPRE_Int +hypre_BoxGrowByIndex_flt( hypre_Box *box, hypre_Index index ); +HYPRE_Int +hypre_BoxGrowByIndex_dbl( hypre_Box *box, hypre_Index index ); +HYPRE_Int +hypre_BoxGrowByIndex_long_dbl( hypre_Box *box, hypre_Index index ); + +HYPRE_Int +hypre_BoxGrowByValue_flt( hypre_Box *box, HYPRE_Int val ); +HYPRE_Int +hypre_BoxGrowByValue_dbl( hypre_Box *box, HYPRE_Int val ); +HYPRE_Int +hypre_BoxGrowByValue_long_dbl( hypre_Box *box, HYPRE_Int val ); + +HYPRE_Int +hypre_BoxInBox_flt( hypre_Box *box1, hypre_Box *box2 ); +HYPRE_Int +hypre_BoxInBox_dbl( hypre_Box *box1, hypre_Box *box2 ); +HYPRE_Int +hypre_BoxInBox_long_dbl( hypre_Box *box1, hypre_Box *box2 ); + +HYPRE_Int +hypre_BoxIndexRank_flt( hypre_Box *box, hypre_Index index ); +HYPRE_Int +hypre_BoxIndexRank_dbl( hypre_Box *box, hypre_Index index ); +HYPRE_Int +hypre_BoxIndexRank_long_dbl( hypre_Box *box, hypre_Index index ); + +HYPRE_Int +hypre_BoxInit_flt( hypre_Box *box, HYPRE_Int ndim ); +HYPRE_Int +hypre_BoxInit_dbl( hypre_Box *box, HYPRE_Int ndim ); +HYPRE_Int +hypre_BoxInit_long_dbl( hypre_Box *box, HYPRE_Int ndim ); + +HYPRE_Int +hypre_BoxManAddEntry_flt( hypre_BoxManager *manager, hypre_Index imin, hypre_Index imax, HYPRE_Int proc_id, HYPRE_Int box_id, void *info ); +HYPRE_Int +hypre_BoxManAddEntry_dbl( hypre_BoxManager *manager, hypre_Index imin, hypre_Index imax, HYPRE_Int proc_id, HYPRE_Int box_id, void *info ); +HYPRE_Int +hypre_BoxManAddEntry_long_dbl( hypre_BoxManager *manager, hypre_Index imin, hypre_Index imax, HYPRE_Int proc_id, HYPRE_Int box_id, void *info ); + +HYPRE_Int +hypre_BoxManAssemble_flt( hypre_BoxManager *manager ); +HYPRE_Int +hypre_BoxManAssemble_dbl( hypre_BoxManager *manager ); +HYPRE_Int +hypre_BoxManAssemble_long_dbl( hypre_BoxManager *manager ); + +HYPRE_Int +hypre_BoxManCreate_flt( 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_BoxManCreate_dbl( 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_BoxManCreate_long_dbl( 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_BoxManDeleteMultipleEntriesAndInfo_flt( hypre_BoxManager *manager, HYPRE_Int *indices, HYPRE_Int num ); +HYPRE_Int +hypre_BoxManDeleteMultipleEntriesAndInfo_dbl( hypre_BoxManager *manager, HYPRE_Int *indices, HYPRE_Int num ); +HYPRE_Int +hypre_BoxManDeleteMultipleEntriesAndInfo_long_dbl( hypre_BoxManager *manager, HYPRE_Int *indices, HYPRE_Int num ); + +HYPRE_Int +hypre_BoxManDestroy_flt( hypre_BoxManager *manager ); +HYPRE_Int +hypre_BoxManDestroy_dbl( hypre_BoxManager *manager ); +HYPRE_Int +hypre_BoxManDestroy_long_dbl( hypre_BoxManager *manager ); + +HYPRE_Int +hypre_BoxManEntryCopy_flt( hypre_BoxManEntry *fromentry, hypre_BoxManEntry *toentry ); +HYPRE_Int +hypre_BoxManEntryCopy_dbl( hypre_BoxManEntry *fromentry, hypre_BoxManEntry *toentry ); +HYPRE_Int +hypre_BoxManEntryCopy_long_dbl( hypre_BoxManEntry *fromentry, hypre_BoxManEntry *toentry ); + +HYPRE_Int +hypre_BoxManEntryGetExtents_flt( hypre_BoxManEntry *entry, hypre_Index imin, hypre_Index imax ); +HYPRE_Int +hypre_BoxManEntryGetExtents_dbl( hypre_BoxManEntry *entry, hypre_Index imin, hypre_Index imax ); +HYPRE_Int +hypre_BoxManEntryGetExtents_long_dbl( hypre_BoxManEntry *entry, hypre_Index imin, hypre_Index imax ); + +HYPRE_Int +hypre_BoxManEntryGetInfo_flt( hypre_BoxManEntry *entry, void **info_ptr ); +HYPRE_Int +hypre_BoxManEntryGetInfo_dbl( hypre_BoxManEntry *entry, void **info_ptr ); +HYPRE_Int +hypre_BoxManEntryGetInfo_long_dbl( hypre_BoxManEntry *entry, void **info_ptr ); + +HYPRE_Int +hypre_BoxManEntryGetStride_flt( hypre_BoxManEntry *entry, hypre_Index stride ); +HYPRE_Int +hypre_BoxManEntryGetStride_dbl( hypre_BoxManEntry *entry, hypre_Index stride ); +HYPRE_Int +hypre_BoxManEntryGetStride_long_dbl( hypre_BoxManEntry *entry, hypre_Index stride ); + +HYPRE_Int +hypre_BoxManGatherEntries_flt( hypre_BoxManager *manager, hypre_Index imin, hypre_Index imax ); +HYPRE_Int +hypre_BoxManGatherEntries_dbl( hypre_BoxManager *manager, hypre_Index imin, hypre_Index imax ); +HYPRE_Int +hypre_BoxManGatherEntries_long_dbl( hypre_BoxManager *manager, hypre_Index imin, hypre_Index imax ); + +HYPRE_Int +hypre_BoxManGetAllEntries_flt( hypre_BoxManager *manager, HYPRE_Int *num_entries, hypre_BoxManEntry **entries ); +HYPRE_Int +hypre_BoxManGetAllEntries_dbl( hypre_BoxManager *manager, HYPRE_Int *num_entries, hypre_BoxManEntry **entries ); +HYPRE_Int +hypre_BoxManGetAllEntries_long_dbl( hypre_BoxManager *manager, HYPRE_Int *num_entries, hypre_BoxManEntry **entries ); + +HYPRE_Int +hypre_BoxManGetAllEntriesBoxes_flt( hypre_BoxManager *manager, hypre_BoxArray *boxes ); +HYPRE_Int +hypre_BoxManGetAllEntriesBoxes_dbl( hypre_BoxManager *manager, hypre_BoxArray *boxes ); +HYPRE_Int +hypre_BoxManGetAllEntriesBoxes_long_dbl( hypre_BoxManager *manager, hypre_BoxArray *boxes ); + +HYPRE_Int +hypre_BoxManGetAllEntriesBoxesProc_flt( hypre_BoxManager *manager, hypre_BoxArray *boxes, HYPRE_Int **procs_ptr ); +HYPRE_Int +hypre_BoxManGetAllEntriesBoxesProc_dbl( hypre_BoxManager *manager, hypre_BoxArray *boxes, HYPRE_Int **procs_ptr ); +HYPRE_Int +hypre_BoxManGetAllEntriesBoxesProc_long_dbl( hypre_BoxManager *manager, hypre_BoxArray *boxes, HYPRE_Int **procs_ptr ); + +HYPRE_Int +hypre_BoxManGetAllGlobalKnown_flt( hypre_BoxManager *manager, HYPRE_Int *known ); +HYPRE_Int +hypre_BoxManGetAllGlobalKnown_dbl( hypre_BoxManager *manager, HYPRE_Int *known ); +HYPRE_Int +hypre_BoxManGetAllGlobalKnown_long_dbl( hypre_BoxManager *manager, HYPRE_Int *known ); + +HYPRE_Int +hypre_BoxManGetAssumedPartition_flt( hypre_BoxManager *manager, hypre_StructAssumedPart **assumed_partition ); +HYPRE_Int +hypre_BoxManGetAssumedPartition_dbl( hypre_BoxManager *manager, hypre_StructAssumedPart **assumed_partition ); +HYPRE_Int +hypre_BoxManGetAssumedPartition_long_dbl( hypre_BoxManager *manager, hypre_StructAssumedPart **assumed_partition ); + +HYPRE_Int +hypre_BoxManGetEntry_flt( hypre_BoxManager *manager, HYPRE_Int proc, HYPRE_Int id, hypre_BoxManEntry **entry_ptr ); +HYPRE_Int +hypre_BoxManGetEntry_dbl( hypre_BoxManager *manager, HYPRE_Int proc, HYPRE_Int id, hypre_BoxManEntry **entry_ptr ); +HYPRE_Int +hypre_BoxManGetEntry_long_dbl( hypre_BoxManager *manager, HYPRE_Int proc, HYPRE_Int id, hypre_BoxManEntry **entry_ptr ); + +HYPRE_Int +hypre_BoxManGetGlobalIsGatherCalled_flt( hypre_BoxManager *manager, MPI_Comm comm, HYPRE_Int *is_gather ); +HYPRE_Int +hypre_BoxManGetGlobalIsGatherCalled_dbl( hypre_BoxManager *manager, MPI_Comm comm, HYPRE_Int *is_gather ); +HYPRE_Int +hypre_BoxManGetGlobalIsGatherCalled_long_dbl( hypre_BoxManager *manager, MPI_Comm comm, HYPRE_Int *is_gather ); + +HYPRE_Int +hypre_BoxManGetIsEntriesSort_flt( hypre_BoxManager *manager, HYPRE_Int *is_sort ); +HYPRE_Int +hypre_BoxManGetIsEntriesSort_dbl( hypre_BoxManager *manager, HYPRE_Int *is_sort ); +HYPRE_Int +hypre_BoxManGetIsEntriesSort_long_dbl( hypre_BoxManager *manager, HYPRE_Int *is_sort ); + +HYPRE_Int +hypre_BoxManGetLocalEntriesBoxes_flt( hypre_BoxManager *manager, hypre_BoxArray *boxes ); +HYPRE_Int +hypre_BoxManGetLocalEntriesBoxes_dbl( hypre_BoxManager *manager, hypre_BoxArray *boxes ); +HYPRE_Int +hypre_BoxManGetLocalEntriesBoxes_long_dbl( hypre_BoxManager *manager, hypre_BoxArray *boxes ); + +HYPRE_Int +hypre_BoxManIncSize_flt( hypre_BoxManager *manager, HYPRE_Int inc_size ); +HYPRE_Int +hypre_BoxManIncSize_dbl( hypre_BoxManager *manager, HYPRE_Int inc_size ); +HYPRE_Int +hypre_BoxManIncSize_long_dbl( hypre_BoxManager *manager, HYPRE_Int inc_size ); + +HYPRE_Int +hypre_BoxManIntersect_flt( hypre_BoxManager *manager, hypre_Index ilower, hypre_Index iupper, hypre_BoxManEntry ***entries_ptr, HYPRE_Int *nentries_ptr ); +HYPRE_Int +hypre_BoxManIntersect_dbl( hypre_BoxManager *manager, hypre_Index ilower, hypre_Index iupper, hypre_BoxManEntry ***entries_ptr, HYPRE_Int *nentries_ptr ); +HYPRE_Int +hypre_BoxManIntersect_long_dbl( hypre_BoxManager *manager, hypre_Index ilower, hypre_Index iupper, hypre_BoxManEntry ***entries_ptr, HYPRE_Int *nentries_ptr ); + +HYPRE_Int +hypre_BoxManSetAllGlobalKnown_flt( hypre_BoxManager *manager, HYPRE_Int known ); +HYPRE_Int +hypre_BoxManSetAllGlobalKnown_dbl( hypre_BoxManager *manager, HYPRE_Int known ); +HYPRE_Int +hypre_BoxManSetAllGlobalKnown_long_dbl( hypre_BoxManager *manager, HYPRE_Int known ); + +HYPRE_Int +hypre_BoxManSetAssumedPartition_flt( hypre_BoxManager *manager, hypre_StructAssumedPart *assumed_partition ); +HYPRE_Int +hypre_BoxManSetAssumedPartition_dbl( hypre_BoxManager *manager, hypre_StructAssumedPart *assumed_partition ); +HYPRE_Int +hypre_BoxManSetAssumedPartition_long_dbl( hypre_BoxManager *manager, hypre_StructAssumedPart *assumed_partition ); + +HYPRE_Int +hypre_BoxManSetBoundingBox_flt( hypre_BoxManager *manager, hypre_Box *bounding_box ); +HYPRE_Int +hypre_BoxManSetBoundingBox_dbl( hypre_BoxManager *manager, hypre_Box *bounding_box ); +HYPRE_Int +hypre_BoxManSetBoundingBox_long_dbl( hypre_BoxManager *manager, hypre_Box *bounding_box ); + +HYPRE_Int +hypre_BoxManSetIsEntriesSort_flt( hypre_BoxManager *manager, HYPRE_Int is_sort ); +HYPRE_Int +hypre_BoxManSetIsEntriesSort_dbl( hypre_BoxManager *manager, HYPRE_Int is_sort ); +HYPRE_Int +hypre_BoxManSetIsEntriesSort_long_dbl( hypre_BoxManager *manager, HYPRE_Int is_sort ); + +HYPRE_Int +hypre_BoxManSetNumGhost_flt( hypre_BoxManager *manager, HYPRE_Int *num_ghost ); +HYPRE_Int +hypre_BoxManSetNumGhost_dbl( hypre_BoxManager *manager, HYPRE_Int *num_ghost ); +HYPRE_Int +hypre_BoxManSetNumGhost_long_dbl( hypre_BoxManager *manager, HYPRE_Int *num_ghost ); + +HYPRE_Int +hypre_BoxMaxSize_flt( hypre_Box *box ); +HYPRE_Int +hypre_BoxMaxSize_dbl( hypre_Box *box ); +HYPRE_Int +hypre_BoxMaxSize_long_dbl( hypre_Box *box ); + +HYPRE_Int +hypre_BoxNnodes_flt( hypre_Box *box ); +HYPRE_Int +hypre_BoxNnodes_dbl( hypre_Box *box ); +HYPRE_Int +hypre_BoxNnodes_long_dbl( hypre_Box *box ); + +HYPRE_Int +hypre_BoxOffsetDistance_flt( hypre_Box *box, hypre_Index index ); +HYPRE_Int +hypre_BoxOffsetDistance_dbl( hypre_Box *box, hypre_Index index ); +HYPRE_Int +hypre_BoxOffsetDistance_long_dbl( hypre_Box *box, hypre_Index index ); + +HYPRE_Int +hypre_BoxPartialVolume_flt( hypre_Box *box, hypre_Index partial_volume ); +HYPRE_Int +hypre_BoxPartialVolume_dbl( hypre_Box *box, hypre_Index partial_volume ); +HYPRE_Int +hypre_BoxPartialVolume_long_dbl( hypre_Box *box, hypre_Index partial_volume ); + +HYPRE_Int +hypre_BoxPrint_flt( FILE *file, hypre_Box *box ); +HYPRE_Int +hypre_BoxPrint_dbl( FILE *file, hypre_Box *box ); +HYPRE_Int +hypre_BoxPrint_long_dbl( FILE *file, hypre_Box *box ); + +HYPRE_Int +hypre_BoxPrintDebug_flt( const char *prefix, hypre_Box *box ); +HYPRE_Int +hypre_BoxPrintDebug_dbl( const char *prefix, hypre_Box *box ); +HYPRE_Int +hypre_BoxPrintDebug_long_dbl( const char *prefix, hypre_Box *box ); + +HYPRE_Int +hypre_BoxRankIndex_flt( hypre_Box *box, HYPRE_Int rank, hypre_Index index ); +HYPRE_Int +hypre_BoxRankIndex_dbl( hypre_Box *box, HYPRE_Int rank, hypre_Index index ); +HYPRE_Int +hypre_BoxRankIndex_long_dbl( hypre_Box *box, HYPRE_Int rank, hypre_Index index ); + +HYPRE_Int +hypre_BoxRead_flt( FILE *file, HYPRE_Int ndim, hypre_Box **box_ptr ); +HYPRE_Int +hypre_BoxRead_dbl( FILE *file, HYPRE_Int ndim, hypre_Box **box_ptr ); +HYPRE_Int +hypre_BoxRead_long_dbl( FILE *file, HYPRE_Int ndim, hypre_Box **box_ptr ); + +HYPRE_Int +hypre_BoxSetExtents_flt( hypre_Box *box, hypre_Index imin, hypre_Index imax ); +HYPRE_Int +hypre_BoxSetExtents_dbl( hypre_Box *box, hypre_Index imin, hypre_Index imax ); +HYPRE_Int +hypre_BoxSetExtents_long_dbl( hypre_Box *box, hypre_Index imin, hypre_Index imax ); + +HYPRE_Int +hypre_BoxShiftNeg_flt( hypre_Box *box, hypre_Index shift ); +HYPRE_Int +hypre_BoxShiftNeg_dbl( hypre_Box *box, hypre_Index shift ); +HYPRE_Int +hypre_BoxShiftNeg_long_dbl( hypre_Box *box, hypre_Index shift ); + +HYPRE_Int +hypre_BoxShiftPos_flt( hypre_Box *box, hypre_Index shift ); +HYPRE_Int +hypre_BoxShiftPos_dbl( hypre_Box *box, hypre_Index shift ); +HYPRE_Int +hypre_BoxShiftPos_long_dbl( hypre_Box *box, hypre_Index shift ); + +HYPRE_Int +hypre_BoxSplit_flt( hypre_Box *box, hypre_Index index, hypre_Box **lbox_ptr, hypre_Box **rbox_ptr ); +HYPRE_Int +hypre_BoxSplit_dbl( hypre_Box *box, hypre_Index index, hypre_Box **lbox_ptr, hypre_Box **rbox_ptr ); +HYPRE_Int +hypre_BoxSplit_long_dbl( hypre_Box *box, hypre_Index index, hypre_Box **lbox_ptr, hypre_Box **rbox_ptr ); + +HYPRE_Int +hypre_BoxStrideVolume_flt( hypre_Box *box, hypre_Index stride ); +HYPRE_Int +hypre_BoxStrideVolume_dbl( hypre_Box *box, hypre_Index stride ); +HYPRE_Int +hypre_BoxStrideVolume_long_dbl( hypre_Box *box, hypre_Index stride ); + +HYPRE_Int +hypre_BoxVolume_flt( hypre_Box *box ); +HYPRE_Int +hypre_BoxVolume_dbl( hypre_Box *box ); +HYPRE_Int +hypre_BoxVolume_long_dbl( hypre_Box *box ); + +HYPRE_Int +hypre_BoxesEqual_flt( hypre_Box *box1, hypre_Box *box2 ); +HYPRE_Int +hypre_BoxesEqual_dbl( hypre_Box *box1, hypre_Box *box2 ); +HYPRE_Int +hypre_BoxesEqual_long_dbl( hypre_Box *box1, hypre_Box *box2 ); + +HYPRE_Int +hypre_CoarsenBox_flt( hypre_Box *box, hypre_IndexRef origin, hypre_Index stride ); +HYPRE_Int +hypre_CoarsenBox_dbl( hypre_Box *box, hypre_IndexRef origin, hypre_Index stride ); +HYPRE_Int +hypre_CoarsenBox_long_dbl( hypre_Box *box, hypre_IndexRef origin, hypre_Index stride ); + +HYPRE_Int +hypre_CoarsenBoxArray_flt( hypre_BoxArray *box_array, hypre_IndexRef origin, hypre_Index stride ); +HYPRE_Int +hypre_CoarsenBoxArray_dbl( hypre_BoxArray *box_array, hypre_IndexRef origin, hypre_Index stride ); +HYPRE_Int +hypre_CoarsenBoxArray_long_dbl( hypre_BoxArray *box_array, hypre_IndexRef origin, hypre_Index stride ); + +HYPRE_Int +hypre_CoarsenBoxArrayArray_flt( hypre_BoxArrayArray *box_array_array, hypre_IndexRef origin, hypre_Index stride ); +HYPRE_Int +hypre_CoarsenBoxArrayArray_dbl( hypre_BoxArrayArray *box_array_array, hypre_IndexRef origin, hypre_Index stride ); +HYPRE_Int +hypre_CoarsenBoxArrayArray_long_dbl( hypre_BoxArrayArray *box_array_array, hypre_IndexRef origin, hypre_Index stride ); + +HYPRE_Int +hypre_CoarsenBoxArrayArrayOutward_flt( hypre_BoxArrayArray *boxaa, hypre_BoxArray *refboxa, hypre_IndexRef origin, hypre_Index stride, hypre_BoxArrayArray **new_boxaa_ptr ); +HYPRE_Int +hypre_CoarsenBoxArrayArrayOutward_dbl( hypre_BoxArrayArray *boxaa, hypre_BoxArray *refboxa, hypre_IndexRef origin, hypre_Index stride, hypre_BoxArrayArray **new_boxaa_ptr ); +HYPRE_Int +hypre_CoarsenBoxArrayArrayOutward_long_dbl( hypre_BoxArrayArray *boxaa, hypre_BoxArray *refboxa, hypre_IndexRef origin, hypre_Index stride, hypre_BoxArrayArray **new_boxaa_ptr ); + +HYPRE_Int +hypre_CommBlockSetEntries_flt( hypre_CommBlock *comm_block, HYPRE_Int *boxnums, hypre_Box *boxes, HYPRE_Int *orders, hypre_Index stride, hypre_BoxArray *data_space, HYPRE_Int *data_offsets ); +HYPRE_Int +hypre_CommBlockSetEntries_dbl( hypre_CommBlock *comm_block, HYPRE_Int *boxnums, hypre_Box *boxes, HYPRE_Int *orders, hypre_Index stride, hypre_BoxArray *data_space, HYPRE_Int *data_offsets ); +HYPRE_Int +hypre_CommBlockSetEntries_long_dbl( hypre_CommBlock *comm_block, HYPRE_Int *boxnums, hypre_Box *boxes, HYPRE_Int *orders, hypre_Index stride, hypre_BoxArray *data_space, HYPRE_Int *data_offsets ); + +HYPRE_Int +hypre_CommBlockSetEntry_flt( hypre_CommBlock *comm_block, HYPRE_Int comm_num, hypre_Box *box, hypre_Index stride, hypre_Index coord, hypre_Index dir, HYPRE_Int *order, HYPRE_Int *rem_order, hypre_Box *data_box, HYPRE_Int data_box_offset ); +HYPRE_Int +hypre_CommBlockSetEntry_dbl( hypre_CommBlock *comm_block, HYPRE_Int comm_num, hypre_Box *box, hypre_Index stride, hypre_Index coord, hypre_Index dir, HYPRE_Int *order, HYPRE_Int *rem_order, hypre_Box *data_box, HYPRE_Int data_box_offset ); +HYPRE_Int +hypre_CommBlockSetEntry_long_dbl( hypre_CommBlock *comm_block, HYPRE_Int comm_num, hypre_Box *box, hypre_Index stride, hypre_Index coord, hypre_Index dir, HYPRE_Int *order, HYPRE_Int *rem_order, hypre_Box *data_box, HYPRE_Int data_box_offset ); + +HYPRE_Int +hypre_CommInfoClone_flt( hypre_CommInfo *comm_info, hypre_CommInfo **clone_ptr ); +HYPRE_Int +hypre_CommInfoClone_dbl( hypre_CommInfo *comm_info, hypre_CommInfo **clone_ptr ); +HYPRE_Int +hypre_CommInfoClone_long_dbl( hypre_CommInfo *comm_info, hypre_CommInfo **clone_ptr ); + +HYPRE_Int +hypre_CommInfoCoarsen_flt( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ); +HYPRE_Int +hypre_CommInfoCoarsen_dbl( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ); +HYPRE_Int +hypre_CommInfoCoarsen_long_dbl( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ); + +HYPRE_Int +hypre_CommInfoCoarsenRecv_flt( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ); +HYPRE_Int +hypre_CommInfoCoarsenRecv_dbl( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ); +HYPRE_Int +hypre_CommInfoCoarsenRecv_long_dbl( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ); + +HYPRE_Int +hypre_CommInfoCoarsenSend_flt( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ); +HYPRE_Int +hypre_CommInfoCoarsenSend_dbl( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ); +HYPRE_Int +hypre_CommInfoCoarsenSend_long_dbl( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ); + +HYPRE_Int +hypre_CommInfoCreate_flt( 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_CommInfoCreate_dbl( 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_CommInfoCreate_long_dbl( 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_CommInfoDestroy_flt( hypre_CommInfo *comm_info ); +HYPRE_Int +hypre_CommInfoDestroy_dbl( hypre_CommInfo *comm_info ); +HYPRE_Int +hypre_CommInfoDestroy_long_dbl( hypre_CommInfo *comm_info ); + +HYPRE_Int +hypre_CommInfoGetTransforms_flt( hypre_CommInfo *comm_info, HYPRE_Int *num_transforms, hypre_Index **coords, hypre_Index **dirs ); +HYPRE_Int +hypre_CommInfoGetTransforms_dbl( hypre_CommInfo *comm_info, HYPRE_Int *num_transforms, hypre_Index **coords, hypre_Index **dirs ); +HYPRE_Int +hypre_CommInfoGetTransforms_long_dbl( hypre_CommInfo *comm_info, HYPRE_Int *num_transforms, hypre_Index **coords, hypre_Index **dirs ); + +HYPRE_Int +hypre_CommInfoProjectRecv_flt( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ); +HYPRE_Int +hypre_CommInfoProjectRecv_dbl( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ); +HYPRE_Int +hypre_CommInfoProjectRecv_long_dbl( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ); + +HYPRE_Int +hypre_CommInfoProjectSend_flt( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ); +HYPRE_Int +hypre_CommInfoProjectSend_dbl( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ); +HYPRE_Int +hypre_CommInfoProjectSend_long_dbl( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ); + +HYPRE_Int +hypre_CommInfoRefine_flt( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ); +HYPRE_Int +hypre_CommInfoRefine_dbl( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ); +HYPRE_Int +hypre_CommInfoRefine_long_dbl( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ); + +HYPRE_Int +hypre_CommInfoRefineRecv_flt( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ); +HYPRE_Int +hypre_CommInfoRefineRecv_dbl( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ); +HYPRE_Int +hypre_CommInfoRefineRecv_long_dbl( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ); + +HYPRE_Int +hypre_CommInfoRefineSend_flt( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ); +HYPRE_Int +hypre_CommInfoRefineSend_dbl( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ); +HYPRE_Int +hypre_CommInfoRefineSend_long_dbl( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ); + +HYPRE_Int +hypre_CommInfoSetTransforms_flt( 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_CommInfoSetTransforms_dbl( 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_CommInfoSetTransforms_long_dbl( 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_CommPkgAgglomData_flt( HYPRE_Int num_comm_pkgs, hypre_CommPkg **comm_pkg_a, hypre_float ***comm_data_a, hypre_CommPkg *comm_pkg, hypre_float ***agg_comm_data_ptr ); +HYPRE_Int +hypre_CommPkgAgglomData_dbl( HYPRE_Int num_comm_pkgs, hypre_CommPkg **comm_pkg_a, hypre_double ***comm_data_a, hypre_CommPkg *comm_pkg, hypre_double ***agg_comm_data_ptr ); +HYPRE_Int +hypre_CommPkgAgglomData_long_dbl( HYPRE_Int num_comm_pkgs, hypre_CommPkg **comm_pkg_a, hypre_long_double ***comm_data_a, hypre_CommPkg *comm_pkg, hypre_long_double ***agg_comm_data_ptr ); + +HYPRE_Int +hypre_CommPkgAgglomDestroy_flt( HYPRE_Int num_comm_pkgs, hypre_CommPkg **comm_pkg_a, hypre_float ***comm_data_a ); +HYPRE_Int +hypre_CommPkgAgglomDestroy_dbl( HYPRE_Int num_comm_pkgs, hypre_CommPkg **comm_pkg_a, hypre_double ***comm_data_a ); +HYPRE_Int +hypre_CommPkgAgglomDestroy_long_dbl( HYPRE_Int num_comm_pkgs, hypre_CommPkg **comm_pkg_a, hypre_long_double ***comm_data_a ); + +HYPRE_Int +hypre_CommPkgAgglomerate_flt( HYPRE_Int num_comm_pkgs, hypre_CommPkg **comm_pkgs, hypre_CommPkg **agg_comm_pkg_ptr ); +HYPRE_Int +hypre_CommPkgAgglomerate_dbl( HYPRE_Int num_comm_pkgs, hypre_CommPkg **comm_pkgs, hypre_CommPkg **agg_comm_pkg_ptr ); +HYPRE_Int +hypre_CommPkgAgglomerate_long_dbl( HYPRE_Int num_comm_pkgs, hypre_CommPkg **comm_pkgs, hypre_CommPkg **agg_comm_pkg_ptr ); + +HYPRE_Int +hypre_CommPkgCreate_flt( 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_MemoryLocation memory_location, hypre_CommPkg **comm_pkg_ptr ); +HYPRE_Int +hypre_CommPkgCreate_dbl( 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_MemoryLocation memory_location, hypre_CommPkg **comm_pkg_ptr ); +HYPRE_Int +hypre_CommPkgCreate_long_dbl( 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_MemoryLocation memory_location, hypre_CommPkg **comm_pkg_ptr ); + +HYPRE_Int +hypre_CommPkgDestroy_flt( hypre_CommPkg *comm_pkg ); +HYPRE_Int +hypre_CommPkgDestroy_dbl( hypre_CommPkg *comm_pkg ); +HYPRE_Int +hypre_CommPkgDestroy_long_dbl( hypre_CommPkg *comm_pkg ); + +HYPRE_Int +hypre_CommPkgSetPrefixSizes_flt( hypre_CommPkg *comm_pkg ); +HYPRE_Int +hypre_CommPkgSetPrefixSizes_dbl( hypre_CommPkg *comm_pkg ); +HYPRE_Int +hypre_CommPkgSetPrefixSizes_long_dbl( hypre_CommPkg *comm_pkg ); + +hypre_CommStencil * +hypre_CommStencilCreate_flt( HYPRE_Int ndim ); +hypre_CommStencil * +hypre_CommStencilCreate_dbl( HYPRE_Int ndim ); +hypre_CommStencil * +hypre_CommStencilCreate_long_dbl( HYPRE_Int ndim ); + +HYPRE_Int +hypre_CommStencilCreateNumGhost_flt( hypre_CommStencil *comm_stencil, HYPRE_Int **num_ghost_ptr ); +HYPRE_Int +hypre_CommStencilCreateNumGhost_dbl( hypre_CommStencil *comm_stencil, HYPRE_Int **num_ghost_ptr ); +HYPRE_Int +hypre_CommStencilCreateNumGhost_long_dbl( hypre_CommStencil *comm_stencil, HYPRE_Int **num_ghost_ptr ); + +HYPRE_Int +hypre_CommStencilDestroy_flt( hypre_CommStencil *comm_stencil ); +HYPRE_Int +hypre_CommStencilDestroy_dbl( hypre_CommStencil *comm_stencil ); +HYPRE_Int +hypre_CommStencilDestroy_long_dbl( hypre_CommStencil *comm_stencil ); + +HYPRE_Int +hypre_CommStencilSetEntry_flt( hypre_CommStencil *comm_stencil, hypre_Index offset ); +HYPRE_Int +hypre_CommStencilSetEntry_dbl( hypre_CommStencil *comm_stencil, hypre_Index offset ); +HYPRE_Int +hypre_CommStencilSetEntry_long_dbl( hypre_CommStencil *comm_stencil, hypre_Index offset ); + +HYPRE_Int +hypre_ComputeBoxnums_flt( hypre_BoxArray *boxes, HYPRE_Int *procs, HYPRE_Int **boxnums_ptr ); +HYPRE_Int +hypre_ComputeBoxnums_dbl( hypre_BoxArray *boxes, HYPRE_Int *procs, HYPRE_Int **boxnums_ptr ); +HYPRE_Int +hypre_ComputeBoxnums_long_dbl( hypre_BoxArray *boxes, HYPRE_Int *procs, HYPRE_Int **boxnums_ptr ); + +HYPRE_Int +hypre_ComputeCoarseOriginStride_flt( hypre_Index coarse_origin, hypre_Index coarse_stride, hypre_IndexRef origin, hypre_Index stride, HYPRE_Int ndim ); +HYPRE_Int +hypre_ComputeCoarseOriginStride_dbl( hypre_Index coarse_origin, hypre_Index coarse_stride, hypre_IndexRef origin, hypre_Index stride, HYPRE_Int ndim ); +HYPRE_Int +hypre_ComputeCoarseOriginStride_long_dbl( hypre_Index coarse_origin, hypre_Index coarse_stride, hypre_IndexRef origin, hypre_Index stride, HYPRE_Int ndim ); + +HYPRE_Int +hypre_ComputeInfoCreate_flt( hypre_CommInfo *comm_info, hypre_BoxArrayArray *indt_boxes, hypre_BoxArrayArray *dept_boxes, hypre_ComputeInfo **compute_info_ptr ); +HYPRE_Int +hypre_ComputeInfoCreate_dbl( hypre_CommInfo *comm_info, hypre_BoxArrayArray *indt_boxes, hypre_BoxArrayArray *dept_boxes, hypre_ComputeInfo **compute_info_ptr ); +HYPRE_Int +hypre_ComputeInfoCreate_long_dbl( hypre_CommInfo *comm_info, hypre_BoxArrayArray *indt_boxes, hypre_BoxArrayArray *dept_boxes, hypre_ComputeInfo **compute_info_ptr ); + +HYPRE_Int +hypre_ComputeInfoDestroy_flt( hypre_ComputeInfo *compute_info ); +HYPRE_Int +hypre_ComputeInfoDestroy_dbl( hypre_ComputeInfo *compute_info ); +HYPRE_Int +hypre_ComputeInfoDestroy_long_dbl( hypre_ComputeInfo *compute_info ); + +HYPRE_Int +hypre_ComputeInfoProjectComp_flt( hypre_ComputeInfo *compute_info, hypre_Index index, hypre_Index stride ); +HYPRE_Int +hypre_ComputeInfoProjectComp_dbl( hypre_ComputeInfo *compute_info, hypre_Index index, hypre_Index stride ); +HYPRE_Int +hypre_ComputeInfoProjectComp_long_dbl( hypre_ComputeInfo *compute_info, hypre_Index index, hypre_Index stride ); + +HYPRE_Int +hypre_ComputeInfoProjectRecv_flt( hypre_ComputeInfo *compute_info, hypre_Index index, hypre_Index stride ); +HYPRE_Int +hypre_ComputeInfoProjectRecv_dbl( hypre_ComputeInfo *compute_info, hypre_Index index, hypre_Index stride ); +HYPRE_Int +hypre_ComputeInfoProjectRecv_long_dbl( hypre_ComputeInfo *compute_info, hypre_Index index, hypre_Index stride ); + +HYPRE_Int +hypre_ComputeInfoProjectSend_flt( hypre_ComputeInfo *compute_info, hypre_Index index, hypre_Index stride ); +HYPRE_Int +hypre_ComputeInfoProjectSend_dbl( hypre_ComputeInfo *compute_info, hypre_Index index, hypre_Index stride ); +HYPRE_Int +hypre_ComputeInfoProjectSend_long_dbl( hypre_ComputeInfo *compute_info, hypre_Index index, hypre_Index stride ); + +HYPRE_Int +hypre_ComputePkgCreate_flt( HYPRE_MemoryLocation memory_location, hypre_ComputeInfo *compute_info, hypre_BoxArray *data_space, HYPRE_Int num_values, hypre_StructGrid *grid, hypre_ComputePkg **compute_pkg_ptr ); +HYPRE_Int +hypre_ComputePkgCreate_dbl( HYPRE_MemoryLocation memory_location, hypre_ComputeInfo *compute_info, hypre_BoxArray *data_space, HYPRE_Int num_values, hypre_StructGrid *grid, hypre_ComputePkg **compute_pkg_ptr ); +HYPRE_Int +hypre_ComputePkgCreate_long_dbl( HYPRE_MemoryLocation memory_location, hypre_ComputeInfo *compute_info, hypre_BoxArray *data_space, HYPRE_Int num_values, hypre_StructGrid *grid, hypre_ComputePkg **compute_pkg_ptr ); + +HYPRE_Int +hypre_ComputePkgDestroy_flt( hypre_ComputePkg *compute_pkg ); +HYPRE_Int +hypre_ComputePkgDestroy_dbl( hypre_ComputePkg *compute_pkg ); +HYPRE_Int +hypre_ComputePkgDestroy_long_dbl( hypre_ComputePkg *compute_pkg ); + +HYPRE_Int +hypre_ConvertToCanonicalIndex_flt( hypre_Index index, hypre_Index stride, HYPRE_Int ndim ); +HYPRE_Int +hypre_ConvertToCanonicalIndex_dbl( hypre_Index index, hypre_Index stride, HYPRE_Int ndim ); +HYPRE_Int +hypre_ConvertToCanonicalIndex_long_dbl( hypre_Index index, hypre_Index stride, HYPRE_Int ndim ); + +HYPRE_Int +hypre_CopyBox_flt( hypre_Box *box1, hypre_Box *box2 ); +HYPRE_Int +hypre_CopyBox_dbl( hypre_Box *box1, hypre_Box *box2 ); +HYPRE_Int +hypre_CopyBox_long_dbl( hypre_Box *box1, hypre_Box *box2 ); + +HYPRE_Int +hypre_CopyIndex_flt( hypre_Index in_index, hypre_Index out_index ); +HYPRE_Int +hypre_CopyIndex_dbl( hypre_Index in_index, hypre_Index out_index ); +HYPRE_Int +hypre_CopyIndex_long_dbl( hypre_Index in_index, hypre_Index out_index ); + +HYPRE_Int +hypre_CopyToCleanIndex_flt( hypre_Index in_index, HYPRE_Int ndim, hypre_Index out_index ); +HYPRE_Int +hypre_CopyToCleanIndex_dbl( hypre_Index in_index, HYPRE_Int ndim, hypre_Index out_index ); +HYPRE_Int +hypre_CopyToCleanIndex_long_dbl( hypre_Index in_index, HYPRE_Int ndim, hypre_Index out_index ); + +HYPRE_Int +hypre_CopyToIndex_flt( hypre_Index in_index, HYPRE_Int ndim, hypre_Index out_index ); +HYPRE_Int +hypre_CopyToIndex_dbl( hypre_Index in_index, HYPRE_Int ndim, hypre_Index out_index ); +HYPRE_Int +hypre_CopyToIndex_long_dbl( hypre_Index in_index, HYPRE_Int ndim, hypre_Index out_index ); + +HYPRE_Int +hypre_CreateCommInfo_flt( hypre_StructGrid *bgrid, hypre_Index stride, hypre_CommStencil *comm_stencil, hypre_CommInfo **comm_info_ptr ); +HYPRE_Int +hypre_CreateCommInfo_dbl( hypre_StructGrid *bgrid, hypre_Index stride, hypre_CommStencil *comm_stencil, hypre_CommInfo **comm_info_ptr ); +HYPRE_Int +hypre_CreateCommInfo_long_dbl( hypre_StructGrid *bgrid, hypre_Index stride, hypre_CommStencil *comm_stencil, hypre_CommInfo **comm_info_ptr ); + +HYPRE_Int +hypre_CreateCommInfoFromGrids_flt( hypre_StructGrid *from_grid, hypre_StructGrid *to_grid, hypre_CommInfo **comm_info_ptr ); +HYPRE_Int +hypre_CreateCommInfoFromGrids_dbl( hypre_StructGrid *from_grid, hypre_StructGrid *to_grid, hypre_CommInfo **comm_info_ptr ); +HYPRE_Int +hypre_CreateCommInfoFromGrids_long_dbl( hypre_StructGrid *from_grid, hypre_StructGrid *to_grid, hypre_CommInfo **comm_info_ptr ); + +HYPRE_Int +hypre_CreateCommInfoFromNumGhost_flt( hypre_StructGrid *grid, hypre_Index stride, HYPRE_Int *num_ghost, hypre_CommInfo **comm_info_ptr ); +HYPRE_Int +hypre_CreateCommInfoFromNumGhost_dbl( hypre_StructGrid *grid, hypre_Index stride, HYPRE_Int *num_ghost, hypre_CommInfo **comm_info_ptr ); +HYPRE_Int +hypre_CreateCommInfoFromNumGhost_long_dbl( hypre_StructGrid *grid, hypre_Index stride, HYPRE_Int *num_ghost, hypre_CommInfo **comm_info_ptr ); + +HYPRE_Int +hypre_CreateCommInfoFromStencil_flt( hypre_StructGrid *grid, hypre_Index stride, hypre_StructStencil *stencil, hypre_CommInfo **comm_info_ptr ); +HYPRE_Int +hypre_CreateCommInfoFromStencil_dbl( hypre_StructGrid *grid, hypre_Index stride, hypre_StructStencil *stencil, hypre_CommInfo **comm_info_ptr ); +HYPRE_Int +hypre_CreateCommInfoFromStencil_long_dbl( hypre_StructGrid *grid, hypre_Index stride, hypre_StructStencil *stencil, hypre_CommInfo **comm_info_ptr ); + +HYPRE_Int +hypre_CreateComputeInfo_flt( hypre_StructGrid *grid, hypre_Index stride, hypre_StructStencil *stencil, hypre_ComputeInfo **compute_info_ptr ); +HYPRE_Int +hypre_CreateComputeInfo_dbl( hypre_StructGrid *grid, hypre_Index stride, hypre_StructStencil *stencil, hypre_ComputeInfo **compute_info_ptr ); +HYPRE_Int +hypre_CreateComputeInfo_long_dbl( hypre_StructGrid *grid, hypre_Index stride, hypre_StructStencil *stencil, hypre_ComputeInfo **compute_info_ptr ); + +HYPRE_Int +hypre_DeleteBox_flt( hypre_BoxArray *box_array, HYPRE_Int index ); +HYPRE_Int +hypre_DeleteBox_dbl( hypre_BoxArray *box_array, HYPRE_Int index ); +HYPRE_Int +hypre_DeleteBox_long_dbl( hypre_BoxArray *box_array, HYPRE_Int index ); + +HYPRE_Int +hypre_DeleteMultipleBoxes_flt( hypre_BoxArray *box_array, HYPRE_Int *indices, HYPRE_Int num ); +HYPRE_Int +hypre_DeleteMultipleBoxes_dbl( hypre_BoxArray *box_array, HYPRE_Int *indices, HYPRE_Int num ); +HYPRE_Int +hypre_DeleteMultipleBoxes_long_dbl( hypre_BoxArray *box_array, HYPRE_Int *indices, HYPRE_Int num ); + +HYPRE_Int +hypre_ExchangeLocalData_flt( hypre_CommPkg *comm_pkg, hypre_float **send_data, hypre_float **recv_data, HYPRE_Int action ); +HYPRE_Int +hypre_ExchangeLocalData_dbl( hypre_CommPkg *comm_pkg, hypre_double **send_data, hypre_double **recv_data, HYPRE_Int action ); +HYPRE_Int +hypre_ExchangeLocalData_long_dbl( hypre_CommPkg *comm_pkg, hypre_long_double **send_data, hypre_long_double **recv_data, HYPRE_Int action ); + +HYPRE_Int +hypre_FillResponseBoxManAssemble1_flt( 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_FillResponseBoxManAssemble1_dbl( 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_FillResponseBoxManAssemble1_long_dbl( 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_flt( 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_dbl( 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_long_dbl( 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_FinalizeIndtComputations_flt( hypre_CommHandle *comm_handle ); +HYPRE_Int +hypre_FinalizeIndtComputations_dbl( hypre_CommHandle *comm_handle ); +HYPRE_Int +hypre_FinalizeIndtComputations_long_dbl( hypre_CommHandle *comm_handle ); + +HYPRE_Int +hypre_GatherAllBoxes_flt( 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_GatherAllBoxes_dbl( 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_GatherAllBoxes_long_dbl( 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_GeneralBoxBoundaryIntersect_flt( hypre_Box *box, hypre_StructGrid *grid, hypre_Index stencil_offset, hypre_BoxArray *boundary ); +HYPRE_Int +hypre_GeneralBoxBoundaryIntersect_dbl( hypre_Box *box, hypre_StructGrid *grid, hypre_Index stencil_offset, hypre_BoxArray *boundary ); +HYPRE_Int +hypre_GeneralBoxBoundaryIntersect_long_dbl( hypre_Box *box, hypre_StructGrid *grid, hypre_Index stencil_offset, hypre_BoxArray *boundary ); + +HYPRE_Int +hypre_IndexElementMult_flt( hypre_Index index, HYPRE_Int ndim ); +HYPRE_Int +hypre_IndexElementMult_dbl( hypre_Index index, HYPRE_Int ndim ); +HYPRE_Int +hypre_IndexElementMult_long_dbl( hypre_Index index, HYPRE_Int ndim ); + +HYPRE_Int +hypre_IndexEqual_flt( hypre_Index index, HYPRE_Int val, HYPRE_Int ndim ); +HYPRE_Int +hypre_IndexEqual_dbl( hypre_Index index, HYPRE_Int val, HYPRE_Int ndim ); +HYPRE_Int +hypre_IndexEqual_long_dbl( hypre_Index index, HYPRE_Int val, HYPRE_Int ndim ); + +HYPRE_Int +hypre_IndexInBox_flt( hypre_Index index, hypre_Box *box ); +HYPRE_Int +hypre_IndexInBox_dbl( hypre_Index index, hypre_Box *box ); +HYPRE_Int +hypre_IndexInBox_long_dbl( hypre_Index index, hypre_Box *box ); + +HYPRE_Int +hypre_IndexMax_flt( hypre_Index index, HYPRE_Int ndim ); +HYPRE_Int +hypre_IndexMax_dbl( hypre_Index index, HYPRE_Int ndim ); +HYPRE_Int +hypre_IndexMax_long_dbl( hypre_Index index, HYPRE_Int ndim ); + +HYPRE_Int +hypre_IndexMin_flt( hypre_Index index, HYPRE_Int ndim ); +HYPRE_Int +hypre_IndexMin_dbl( hypre_Index index, HYPRE_Int ndim ); +HYPRE_Int +hypre_IndexMin_long_dbl( hypre_Index index, HYPRE_Int ndim ); + +HYPRE_Int +hypre_IndexPrint_flt( FILE *file, HYPRE_Int ndim, hypre_Index index ); +HYPRE_Int +hypre_IndexPrint_dbl( FILE *file, HYPRE_Int ndim, hypre_Index index ); +HYPRE_Int +hypre_IndexPrint_long_dbl( FILE *file, HYPRE_Int ndim, hypre_Index index ); + +HYPRE_Int +hypre_IndexRead_flt( FILE *file, HYPRE_Int ndim, hypre_Index index ); +HYPRE_Int +hypre_IndexRead_dbl( FILE *file, HYPRE_Int ndim, hypre_Index index ); +HYPRE_Int +hypre_IndexRead_long_dbl( FILE *file, HYPRE_Int ndim, hypre_Index index ); + +HYPRE_Int +hypre_IndexesEqual_flt( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim ); +HYPRE_Int +hypre_IndexesEqual_dbl( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim ); +HYPRE_Int +hypre_IndexesEqual_long_dbl( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim ); + +HYPRE_Int +hypre_IndexesGreater_flt( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim ); +HYPRE_Int +hypre_IndexesGreater_dbl( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim ); +HYPRE_Int +hypre_IndexesGreater_long_dbl( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim ); + +HYPRE_Int +hypre_IndexesGreaterEqual_flt( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim ); +HYPRE_Int +hypre_IndexesGreaterEqual_dbl( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim ); +HYPRE_Int +hypre_IndexesGreaterEqual_long_dbl( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim ); + +HYPRE_Int +hypre_InitializeIndtComputations_flt( hypre_ComputePkg *compute_pkg, hypre_float *data, hypre_CommHandle **comm_handle_ptr ); +HYPRE_Int +hypre_InitializeIndtComputations_dbl( hypre_ComputePkg *compute_pkg, hypre_double *data, hypre_CommHandle **comm_handle_ptr ); +HYPRE_Int +hypre_InitializeIndtComputations_long_dbl( hypre_ComputePkg *compute_pkg, hypre_long_double *data, hypre_CommHandle **comm_handle_ptr ); + +HYPRE_Int +hypre_IntersectBoxes_flt( hypre_Box *box1, hypre_Box *box2, hypre_Box *ibox ); +HYPRE_Int +hypre_IntersectBoxes_dbl( hypre_Box *box1, hypre_Box *box2, hypre_Box *ibox ); +HYPRE_Int +hypre_IntersectBoxes_long_dbl( hypre_Box *box1, hypre_Box *box2, hypre_Box *ibox ); + +HYPRE_Int +hypre_MapToCoarseIndex_flt( hypre_Index index, hypre_IndexRef origin, hypre_Index stride, HYPRE_Int ndim ); +HYPRE_Int +hypre_MapToCoarseIndex_dbl( hypre_Index index, hypre_IndexRef origin, hypre_Index stride, HYPRE_Int ndim ); +HYPRE_Int +hypre_MapToCoarseIndex_long_dbl( hypre_Index index, hypre_IndexRef origin, hypre_Index stride, HYPRE_Int ndim ); + +HYPRE_Int +hypre_MapToFineIndex_flt( hypre_Index index, hypre_IndexRef origin, hypre_Index stride, HYPRE_Int ndim ); +HYPRE_Int +hypre_MapToFineIndex_dbl( hypre_Index index, hypre_IndexRef origin, hypre_Index stride, HYPRE_Int ndim ); +HYPRE_Int +hypre_MapToFineIndex_long_dbl( hypre_Index index, hypre_IndexRef origin, hypre_Index stride, HYPRE_Int ndim ); + +HYPRE_Int +hypre_MinUnionBoxes_flt( hypre_BoxArray *boxes ); +HYPRE_Int +hypre_MinUnionBoxes_dbl( hypre_BoxArray *boxes ); +HYPRE_Int +hypre_MinUnionBoxes_long_dbl( hypre_BoxArray *boxes ); + +HYPRE_Int +hypre_PrintBoxArrayData_flt( FILE *file, HYPRE_Int dim, hypre_BoxArray *box_array, hypre_BoxArray *data_space, HYPRE_Int num_values, HYPRE_Int *value_ids, hypre_float *data ); +HYPRE_Int +hypre_PrintBoxArrayData_dbl( FILE *file, HYPRE_Int dim, hypre_BoxArray *box_array, hypre_BoxArray *data_space, HYPRE_Int num_values, HYPRE_Int *value_ids, hypre_double *data ); +HYPRE_Int +hypre_PrintBoxArrayData_long_dbl( FILE *file, HYPRE_Int dim, hypre_BoxArray *box_array, hypre_BoxArray *data_space, HYPRE_Int num_values, HYPRE_Int *value_ids, hypre_long_double *data ); + +HYPRE_Int +hypre_ProjectBox_flt( hypre_Box *box, hypre_IndexRef origin, hypre_Index stride ); +HYPRE_Int +hypre_ProjectBox_dbl( hypre_Box *box, hypre_IndexRef origin, hypre_Index stride ); +HYPRE_Int +hypre_ProjectBox_long_dbl( hypre_Box *box, hypre_IndexRef origin, hypre_Index stride ); + +HYPRE_Int +hypre_ProjectBoxArray_flt( hypre_BoxArray *box_array, hypre_IndexRef origin, hypre_Index stride ); +HYPRE_Int +hypre_ProjectBoxArray_dbl( hypre_BoxArray *box_array, hypre_IndexRef origin, hypre_Index stride ); +HYPRE_Int +hypre_ProjectBoxArray_long_dbl( hypre_BoxArray *box_array, hypre_IndexRef origin, hypre_Index stride ); + +HYPRE_Int +hypre_ProjectBoxArrayArray_flt( hypre_BoxArrayArray *box_array_array, hypre_IndexRef origin, hypre_Index stride ); +HYPRE_Int +hypre_ProjectBoxArrayArray_dbl( hypre_BoxArrayArray *box_array_array, hypre_IndexRef origin, hypre_Index stride ); +HYPRE_Int +hypre_ProjectBoxArrayArray_long_dbl( hypre_BoxArrayArray *box_array_array, hypre_IndexRef origin, hypre_Index stride ); + +HYPRE_Int +hypre_ReadBoxArrayData_flt( FILE *file, HYPRE_Int ndim, hypre_BoxArray *box_array, HYPRE_Int *num_values_ptr, HYPRE_Int **value_ids_ptr, hypre_float **values_ptr ); +HYPRE_Int +hypre_ReadBoxArrayData_dbl( FILE *file, HYPRE_Int ndim, hypre_BoxArray *box_array, HYPRE_Int *num_values_ptr, HYPRE_Int **value_ids_ptr, hypre_double **values_ptr ); +HYPRE_Int +hypre_ReadBoxArrayData_long_dbl( FILE *file, HYPRE_Int ndim, hypre_BoxArray *box_array, HYPRE_Int *num_values_ptr, HYPRE_Int **value_ids_ptr, hypre_long_double **values_ptr ); + +HYPRE_Int +hypre_RefineBox_flt( hypre_Box *box, hypre_IndexRef origin, hypre_Index stride ); +HYPRE_Int +hypre_RefineBox_dbl( hypre_Box *box, hypre_IndexRef origin, hypre_Index stride ); +HYPRE_Int +hypre_RefineBox_long_dbl( hypre_Box *box, hypre_IndexRef origin, hypre_Index stride ); + +HYPRE_Int +hypre_RefineBoxArray_flt( hypre_BoxArray *box_array, hypre_IndexRef origin, hypre_Index stride ); +HYPRE_Int +hypre_RefineBoxArray_dbl( hypre_BoxArray *box_array, hypre_IndexRef origin, hypre_Index stride ); +HYPRE_Int +hypre_RefineBoxArray_long_dbl( hypre_BoxArray *box_array, hypre_IndexRef origin, hypre_Index stride ); + +HYPRE_Int +hypre_RefineBoxArrayArray_flt( hypre_BoxArrayArray *box_array_array, hypre_IndexRef origin, hypre_Index stride ); +HYPRE_Int +hypre_RefineBoxArrayArray_dbl( hypre_BoxArrayArray *box_array_array, hypre_IndexRef origin, hypre_Index stride ); +HYPRE_Int +hypre_RefineBoxArrayArray_long_dbl( hypre_BoxArrayArray *box_array_array, hypre_IndexRef origin, hypre_Index stride ); + +HYPRE_Int +hypre_SetIndex_flt( hypre_Index index, HYPRE_Int val ); +HYPRE_Int +hypre_SetIndex_dbl( hypre_Index index, HYPRE_Int val ); +HYPRE_Int +hypre_SetIndex_long_dbl( hypre_Index index, HYPRE_Int val ); + +HYPRE_Int +hypre_SnapIndexNeg_flt( hypre_Index index, hypre_IndexRef origin, hypre_Index stride, HYPRE_Int ndim ); +HYPRE_Int +hypre_SnapIndexNeg_dbl( hypre_Index index, hypre_IndexRef origin, hypre_Index stride, HYPRE_Int ndim ); +HYPRE_Int +hypre_SnapIndexNeg_long_dbl( hypre_Index index, hypre_IndexRef origin, hypre_Index stride, HYPRE_Int ndim ); + +HYPRE_Int +hypre_SnapIndexPos_flt( hypre_Index index, hypre_IndexRef origin, hypre_Index stride, HYPRE_Int ndim ); +HYPRE_Int +hypre_SnapIndexPos_dbl( hypre_Index index, hypre_IndexRef origin, hypre_Index stride, HYPRE_Int ndim ); +HYPRE_Int +hypre_SnapIndexPos_long_dbl( hypre_Index index, hypre_IndexRef origin, hypre_Index stride, HYPRE_Int ndim ); + +HYPRE_Int +hypre_StCoeffClone_flt( hypre_StCoeff *coeff, HYPRE_Int ndim, hypre_StCoeff **clone_ptr ); +HYPRE_Int +hypre_StCoeffClone_dbl( hypre_StCoeff *coeff, HYPRE_Int ndim, hypre_StCoeff **clone_ptr ); +HYPRE_Int +hypre_StCoeffClone_long_dbl( hypre_StCoeff *coeff, HYPRE_Int ndim, hypre_StCoeff **clone_ptr ); + +HYPRE_Int +hypre_StCoeffCreate_flt( HYPRE_Int nterms, hypre_StCoeff **coeff_ptr ); +HYPRE_Int +hypre_StCoeffCreate_dbl( HYPRE_Int nterms, hypre_StCoeff **coeff_ptr ); +HYPRE_Int +hypre_StCoeffCreate_long_dbl( HYPRE_Int nterms, hypre_StCoeff **coeff_ptr ); + +HYPRE_Int +hypre_StCoeffDestroy_flt( hypre_StCoeff *coeff ); +HYPRE_Int +hypre_StCoeffDestroy_dbl( hypre_StCoeff *coeff ); +HYPRE_Int +hypre_StCoeffDestroy_long_dbl( hypre_StCoeff *coeff ); + +HYPRE_Int +hypre_StCoeffMult_flt( hypre_StCoeff *Acoeff, hypre_StCoeff *Bcoeff, HYPRE_Int ndim, hypre_StCoeff **Ccoeff_ptr ); +HYPRE_Int +hypre_StCoeffMult_dbl( hypre_StCoeff *Acoeff, hypre_StCoeff *Bcoeff, HYPRE_Int ndim, hypre_StCoeff **Ccoeff_ptr ); +HYPRE_Int +hypre_StCoeffMult_long_dbl( hypre_StCoeff *Acoeff, hypre_StCoeff *Bcoeff, HYPRE_Int ndim, hypre_StCoeff **Ccoeff_ptr ); + +HYPRE_Int +hypre_StCoeffPrint_flt( hypre_StCoeff *coeff, char *matnames, HYPRE_Int ndim ); +HYPRE_Int +hypre_StCoeffPrint_dbl( hypre_StCoeff *coeff, char *matnames, HYPRE_Int ndim ); +HYPRE_Int +hypre_StCoeffPrint_long_dbl( hypre_StCoeff *coeff, char *matnames, HYPRE_Int ndim ); + +HYPRE_Int +hypre_StCoeffPush_flt( hypre_StCoeff **stack_ptr, hypre_StCoeff *coeff ); +HYPRE_Int +hypre_StCoeffPush_dbl( hypre_StCoeff **stack_ptr, hypre_StCoeff *coeff ); +HYPRE_Int +hypre_StCoeffPush_long_dbl( hypre_StCoeff **stack_ptr, hypre_StCoeff *coeff ); + +HYPRE_Int +hypre_StCoeffShift_flt( hypre_StCoeff *coeff, hypre_Index shift, HYPRE_Int ndim ); +HYPRE_Int +hypre_StCoeffShift_dbl( hypre_StCoeff *coeff, hypre_Index shift, HYPRE_Int ndim ); +HYPRE_Int +hypre_StCoeffShift_long_dbl( hypre_StCoeff *coeff, hypre_Index shift, HYPRE_Int ndim ); + +HYPRE_Int +hypre_StIndexCopy_flt( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim ); +HYPRE_Int +hypre_StIndexCopy_dbl( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim ); +HYPRE_Int +hypre_StIndexCopy_long_dbl( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim ); + +HYPRE_Int +hypre_StIndexNegate_flt( hypre_Index index, HYPRE_Int ndim ); +HYPRE_Int +hypre_StIndexNegate_dbl( hypre_Index index, HYPRE_Int ndim ); +HYPRE_Int +hypre_StIndexNegate_long_dbl( hypre_Index index, HYPRE_Int ndim ); + +HYPRE_Int +hypre_StIndexPrint_flt( hypre_Index index, char lchar, char rchar, HYPRE_Int ndim ); +HYPRE_Int +hypre_StIndexPrint_dbl( hypre_Index index, char lchar, char rchar, HYPRE_Int ndim ); +HYPRE_Int +hypre_StIndexPrint_long_dbl( hypre_Index index, char lchar, char rchar, HYPRE_Int ndim ); + +HYPRE_Int +hypre_StIndexShift_flt( hypre_Index index, hypre_Index shift, HYPRE_Int ndim ); +HYPRE_Int +hypre_StIndexShift_dbl( hypre_Index index, hypre_Index shift, HYPRE_Int ndim ); +HYPRE_Int +hypre_StIndexShift_long_dbl( hypre_Index index, hypre_Index shift, HYPRE_Int ndim ); + +HYPRE_Int +hypre_StMatrixClone_flt( hypre_StMatrix *matrix, HYPRE_Int ndim, hypre_StMatrix **mclone_ptr ); +HYPRE_Int +hypre_StMatrixClone_dbl( hypre_StMatrix *matrix, HYPRE_Int ndim, hypre_StMatrix **mclone_ptr ); +HYPRE_Int +hypre_StMatrixClone_long_dbl( hypre_StMatrix *matrix, HYPRE_Int ndim, hypre_StMatrix **mclone_ptr ); + +HYPRE_Int +hypre_StMatrixCreate_flt( HYPRE_Int id, HYPRE_Int size, HYPRE_Int ndim, hypre_StMatrix **matrix_ptr ); +HYPRE_Int +hypre_StMatrixCreate_dbl( HYPRE_Int id, HYPRE_Int size, HYPRE_Int ndim, hypre_StMatrix **matrix_ptr ); +HYPRE_Int +hypre_StMatrixCreate_long_dbl( HYPRE_Int id, HYPRE_Int size, HYPRE_Int ndim, hypre_StMatrix **matrix_ptr ); + +HYPRE_Int +hypre_StMatrixDestroy_flt( hypre_StMatrix *matrix ); +HYPRE_Int +hypre_StMatrixDestroy_dbl( hypre_StMatrix *matrix ); +HYPRE_Int +hypre_StMatrixDestroy_long_dbl( hypre_StMatrix *matrix ); + +HYPRE_Int +hypre_StMatrixMatmat_flt( hypre_StMatrix *A, hypre_StMatrix *B, HYPRE_Int Cid, HYPRE_Int ndim, hypre_StMatrix **C_ptr ); +HYPRE_Int +hypre_StMatrixMatmat_dbl( hypre_StMatrix *A, hypre_StMatrix *B, HYPRE_Int Cid, HYPRE_Int ndim, hypre_StMatrix **C_ptr ); +HYPRE_Int +hypre_StMatrixMatmat_long_dbl( hypre_StMatrix *A, hypre_StMatrix *B, HYPRE_Int Cid, HYPRE_Int ndim, hypre_StMatrix **C_ptr ); + +HYPRE_Int +hypre_StMatrixMatmult_flt( HYPRE_Int nmatrices, hypre_StMatrix **matrices, HYPRE_Int *transposes, HYPRE_Int Cid, HYPRE_Int ndim, hypre_StMatrix **C_ptr ); +HYPRE_Int +hypre_StMatrixMatmult_dbl( HYPRE_Int nmatrices, hypre_StMatrix **matrices, HYPRE_Int *transposes, HYPRE_Int Cid, HYPRE_Int ndim, hypre_StMatrix **C_ptr ); +HYPRE_Int +hypre_StMatrixMatmult_long_dbl( HYPRE_Int nmatrices, hypre_StMatrix **matrices, HYPRE_Int *transposes, HYPRE_Int Cid, HYPRE_Int ndim, hypre_StMatrix **C_ptr ); + +HYPRE_Int +hypre_StMatrixNEntryCoeffs_flt( hypre_StMatrix *matrix, HYPRE_Int entry ); +HYPRE_Int +hypre_StMatrixNEntryCoeffs_dbl( hypre_StMatrix *matrix, HYPRE_Int entry ); +HYPRE_Int +hypre_StMatrixNEntryCoeffs_long_dbl( hypre_StMatrix *matrix, HYPRE_Int entry ); + +HYPRE_Int +hypre_StMatrixPrint_flt( hypre_StMatrix *matrix, char *matnames, HYPRE_Int ndim ); +HYPRE_Int +hypre_StMatrixPrint_dbl( hypre_StMatrix *matrix, char *matnames, HYPRE_Int ndim ); +HYPRE_Int +hypre_StMatrixPrint_long_dbl( hypre_StMatrix *matrix, char *matnames, HYPRE_Int ndim ); + +HYPRE_Int +hypre_StMatrixTranspose_flt( hypre_StMatrix *matrix, HYPRE_Int ndim ); +HYPRE_Int +hypre_StMatrixTranspose_dbl( hypre_StMatrix *matrix, HYPRE_Int ndim ); +HYPRE_Int +hypre_StMatrixTranspose_long_dbl( hypre_StMatrix *matrix, HYPRE_Int ndim ); + +HYPRE_Int +hypre_StTermCopy_flt( hypre_StTerm *term1, hypre_StTerm *term2, HYPRE_Int ndim ); +HYPRE_Int +hypre_StTermCopy_dbl( hypre_StTerm *term1, hypre_StTerm *term2, HYPRE_Int ndim ); +HYPRE_Int +hypre_StTermCopy_long_dbl( hypre_StTerm *term1, hypre_StTerm *term2, HYPRE_Int ndim ); + +HYPRE_Int +hypre_StTermPrint_flt( hypre_StTerm *term, char *matnames, HYPRE_Int ndim ); +HYPRE_Int +hypre_StTermPrint_dbl( hypre_StTerm *term, char *matnames, HYPRE_Int ndim ); +HYPRE_Int +hypre_StTermPrint_long_dbl( hypre_StTerm *term, char *matnames, HYPRE_Int ndim ); + +HYPRE_Int +hypre_StructAssumedPartitionCreate_flt( HYPRE_Int dim, hypre_Box *bounding_box, hypre_float global_boxes_size, HYPRE_Int global_num_boxes, hypre_BoxArray *local_boxes, HYPRE_Int max_regions, HYPRE_Int max_refinements, hypre_float gamma, MPI_Comm comm, hypre_StructAssumedPart **p_assumed_partition ); +HYPRE_Int +hypre_StructAssumedPartitionCreate_dbl( HYPRE_Int dim, hypre_Box *bounding_box, hypre_double global_boxes_size, HYPRE_Int global_num_boxes, hypre_BoxArray *local_boxes, HYPRE_Int max_regions, HYPRE_Int max_refinements, hypre_double gamma, MPI_Comm comm, hypre_StructAssumedPart **p_assumed_partition ); +HYPRE_Int +hypre_StructAssumedPartitionCreate_long_dbl( HYPRE_Int dim, hypre_Box *bounding_box, hypre_long_double global_boxes_size, HYPRE_Int global_num_boxes, hypre_BoxArray *local_boxes, HYPRE_Int max_regions, HYPRE_Int max_refinements, hypre_long_double gamma, MPI_Comm comm, hypre_StructAssumedPart **p_assumed_partition ); + +HYPRE_Int +hypre_StructAssumedPartitionDestroy_flt( hypre_StructAssumedPart *assumed_part ); +HYPRE_Int +hypre_StructAssumedPartitionDestroy_dbl( hypre_StructAssumedPart *assumed_part ); +HYPRE_Int +hypre_StructAssumedPartitionDestroy_long_dbl( hypre_StructAssumedPart *assumed_part ); + +HYPRE_Int +hypre_StructAssumedPartitionGetProcsFromBox_flt( 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_StructAssumedPartitionGetProcsFromBox_dbl( 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_StructAssumedPartitionGetProcsFromBox_long_dbl( 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_StructAssumedPartitionGetRegionsFromProc_flt( hypre_StructAssumedPart *assumed_part, HYPRE_Int proc_id, hypre_BoxArray *assumed_regions ); +HYPRE_Int +hypre_StructAssumedPartitionGetRegionsFromProc_dbl( hypre_StructAssumedPart *assumed_part, HYPRE_Int proc_id, hypre_BoxArray *assumed_regions ); +HYPRE_Int +hypre_StructAssumedPartitionGetRegionsFromProc_long_dbl( hypre_StructAssumedPart *assumed_part, HYPRE_Int proc_id, hypre_BoxArray *assumed_regions ); + +HYPRE_Int +hypre_StructAssumedPartitionPrint_flt( const char *filename, hypre_StructAssumedPart *ap ); +HYPRE_Int +hypre_StructAssumedPartitionPrint_dbl( const char *filename, hypre_StructAssumedPart *ap ); +HYPRE_Int +hypre_StructAssumedPartitionPrint_long_dbl( const char *filename, hypre_StructAssumedPart *ap ); + +HYPRE_Int +hypre_StructCoarsen_flt( hypre_StructGrid *fgrid, hypre_IndexRef origin, hypre_Index stride, HYPRE_Int prune, hypre_StructGrid **cgrid_ptr ); +HYPRE_Int +hypre_StructCoarsen_dbl( hypre_StructGrid *fgrid, hypre_IndexRef origin, hypre_Index stride, HYPRE_Int prune, hypre_StructGrid **cgrid_ptr ); +HYPRE_Int +hypre_StructCoarsen_long_dbl( hypre_StructGrid *fgrid, hypre_IndexRef origin, hypre_Index stride, HYPRE_Int prune, hypre_StructGrid **cgrid_ptr ); + +HYPRE_Int +hypre_StructCoarsenAP_flt( hypre_StructAssumedPart *ap, hypre_Index origin, hypre_Index stride, hypre_StructAssumedPart **new_ap_ptr ); +HYPRE_Int +hypre_StructCoarsenAP_dbl( hypre_StructAssumedPart *ap, hypre_Index origin, hypre_Index stride, hypre_StructAssumedPart **new_ap_ptr ); +HYPRE_Int +hypre_StructCoarsenAP_long_dbl( hypre_StructAssumedPart *ap, hypre_Index origin, hypre_Index stride, hypre_StructAssumedPart **new_ap_ptr ); + +HYPRE_Int +hypre_StructCommunicationFinalize_flt( hypre_CommHandle *comm_handle ); +HYPRE_Int +hypre_StructCommunicationFinalize_dbl( hypre_CommHandle *comm_handle ); +HYPRE_Int +hypre_StructCommunicationFinalize_long_dbl( hypre_CommHandle *comm_handle ); + +HYPRE_Int +hypre_StructCommunicationInitialize_flt( hypre_CommPkg *comm_pkg, hypre_float **send_data, hypre_float **recv_data, HYPRE_Int action, HYPRE_Int tag, hypre_CommHandle **comm_handle_ptr ); +HYPRE_Int +hypre_StructCommunicationInitialize_dbl( hypre_CommPkg *comm_pkg, hypre_double **send_data, hypre_double **recv_data, HYPRE_Int action, HYPRE_Int tag, hypre_CommHandle **comm_handle_ptr ); +HYPRE_Int +hypre_StructCommunicationInitialize_long_dbl( hypre_CommPkg *comm_pkg, hypre_long_double **send_data, hypre_long_double **recv_data, HYPRE_Int action, HYPRE_Int tag, hypre_CommHandle **comm_handle_ptr ); + +HYPRE_Int +hypre_StructCopy_flt( hypre_StructVector *x, hypre_StructVector *y ); +HYPRE_Int +hypre_StructCopy_dbl( hypre_StructVector *x, hypre_StructVector *y ); +HYPRE_Int +hypre_StructCopy_long_dbl( hypre_StructVector *x, hypre_StructVector *y ); + +HYPRE_Int +hypre_StructDataCopy_flt( hypre_float *fr_data, /* from */ hypre_BoxArray *fr_data_space, hypre_float *to_data, /* to */ hypre_BoxArray *to_data_space, HYPRE_Int ndim, HYPRE_Int nval ); +HYPRE_Int +hypre_StructDataCopy_dbl( hypre_double *fr_data, /* from */ hypre_BoxArray *fr_data_space, hypre_double *to_data, /* to */ hypre_BoxArray *to_data_space, HYPRE_Int ndim, HYPRE_Int nval ); +HYPRE_Int +hypre_StructDataCopy_long_dbl( hypre_long_double *fr_data, /* from */ hypre_BoxArray *fr_data_space, hypre_long_double *to_data, /* to */ hypre_BoxArray *to_data_space, HYPRE_Int ndim, HYPRE_Int nval ); + +HYPRE_Int +hypre_StructGridAssemble_flt( hypre_StructGrid *grid ); +HYPRE_Int +hypre_StructGridAssemble_dbl( hypre_StructGrid *grid ); +HYPRE_Int +hypre_StructGridAssemble_long_dbl( hypre_StructGrid *grid ); + +HYPRE_Int +hypre_StructGridComputeBoxnums_flt( hypre_StructGrid *grid, HYPRE_Int nboxes, HYPRE_Int *boxnums, hypre_Index stride, HYPRE_Int *new_nboxes_ptr, HYPRE_Int **new_boxnums_ptr ); +HYPRE_Int +hypre_StructGridComputeBoxnums_dbl( hypre_StructGrid *grid, HYPRE_Int nboxes, HYPRE_Int *boxnums, hypre_Index stride, HYPRE_Int *new_nboxes_ptr, HYPRE_Int **new_boxnums_ptr ); +HYPRE_Int +hypre_StructGridComputeBoxnums_long_dbl( hypre_StructGrid *grid, HYPRE_Int nboxes, HYPRE_Int *boxnums, hypre_Index stride, HYPRE_Int *new_nboxes_ptr, HYPRE_Int **new_boxnums_ptr ); + +HYPRE_Int +hypre_StructGridComputeGlobalSize_flt( hypre_StructGrid *grid ); +HYPRE_Int +hypre_StructGridComputeGlobalSize_dbl( hypre_StructGrid *grid ); +HYPRE_Int +hypre_StructGridComputeGlobalSize_long_dbl( hypre_StructGrid *grid ); + +HYPRE_Int +hypre_StructGridCreate_flt( MPI_Comm comm, HYPRE_Int dim, hypre_StructGrid **grid_ptr ); +HYPRE_Int +hypre_StructGridCreate_dbl( MPI_Comm comm, HYPRE_Int dim, hypre_StructGrid **grid_ptr ); +HYPRE_Int +hypre_StructGridCreate_long_dbl( MPI_Comm comm, HYPRE_Int dim, hypre_StructGrid **grid_ptr ); + +HYPRE_Int +hypre_StructGridDestroy_flt( hypre_StructGrid *grid ); +HYPRE_Int +hypre_StructGridDestroy_dbl( hypre_StructGrid *grid ); +HYPRE_Int +hypre_StructGridDestroy_long_dbl( hypre_StructGrid *grid ); + +HYPRE_Int +hypre_StructGridGetMaxBoxSize_flt( hypre_StructGrid *grid ); +HYPRE_Int +hypre_StructGridGetMaxBoxSize_dbl( hypre_StructGrid *grid ); +HYPRE_Int +hypre_StructGridGetMaxBoxSize_long_dbl( hypre_StructGrid *grid ); + +HYPRE_Int +hypre_StructGridPrint_flt( FILE *file, hypre_StructGrid *grid ); +HYPRE_Int +hypre_StructGridPrint_dbl( FILE *file, hypre_StructGrid *grid ); +HYPRE_Int +hypre_StructGridPrint_long_dbl( FILE *file, hypre_StructGrid *grid ); + +HYPRE_Int +hypre_StructGridPrintVTK_flt( const char *filename, hypre_StructGrid *grid ); +HYPRE_Int +hypre_StructGridPrintVTK_dbl( const char *filename, hypre_StructGrid *grid ); +HYPRE_Int +hypre_StructGridPrintVTK_long_dbl( const char *filename, hypre_StructGrid *grid ); + +HYPRE_Int +hypre_StructGridRead_flt( MPI_Comm comm, FILE *file, hypre_StructGrid **grid_ptr ); +HYPRE_Int +hypre_StructGridRead_dbl( MPI_Comm comm, FILE *file, hypre_StructGrid **grid_ptr ); +HYPRE_Int +hypre_StructGridRead_long_dbl( MPI_Comm comm, FILE *file, hypre_StructGrid **grid_ptr ); + +HYPRE_Int +hypre_StructGridRef_flt( hypre_StructGrid *grid, hypre_StructGrid **grid_ref ); +HYPRE_Int +hypre_StructGridRef_dbl( hypre_StructGrid *grid, hypre_StructGrid **grid_ref ); +HYPRE_Int +hypre_StructGridRef_long_dbl( hypre_StructGrid *grid, hypre_StructGrid **grid_ref ); + +HYPRE_Int +hypre_StructGridSetBoundingBox_flt( hypre_StructGrid *grid, hypre_Box *new_bb ); +HYPRE_Int +hypre_StructGridSetBoundingBox_dbl( hypre_StructGrid *grid, hypre_Box *new_bb ); +HYPRE_Int +hypre_StructGridSetBoundingBox_long_dbl( hypre_StructGrid *grid, hypre_Box *new_bb ); + +HYPRE_Int +hypre_StructGridSetBoxManager_flt( hypre_StructGrid *grid, hypre_BoxManager *boxman ); +HYPRE_Int +hypre_StructGridSetBoxManager_dbl( hypre_StructGrid *grid, hypre_BoxManager *boxman ); +HYPRE_Int +hypre_StructGridSetBoxManager_long_dbl( hypre_StructGrid *grid, hypre_BoxManager *boxman ); + +HYPRE_Int +hypre_StructGridSetBoxes_flt( hypre_StructGrid *grid, hypre_BoxArray *boxes ); +HYPRE_Int +hypre_StructGridSetBoxes_dbl( hypre_StructGrid *grid, hypre_BoxArray *boxes ); +HYPRE_Int +hypre_StructGridSetBoxes_long_dbl( hypre_StructGrid *grid, hypre_BoxArray *boxes ); + +HYPRE_Int +hypre_StructGridSetExtents_flt( hypre_StructGrid *grid, hypre_Index ilower, hypre_Index iupper ); +HYPRE_Int +hypre_StructGridSetExtents_dbl( hypre_StructGrid *grid, hypre_Index ilower, hypre_Index iupper ); +HYPRE_Int +hypre_StructGridSetExtents_long_dbl( hypre_StructGrid *grid, hypre_Index ilower, hypre_Index iupper ); + +HYPRE_Int +hypre_StructGridSetIDs_flt( hypre_StructGrid *grid, HYPRE_Int *ids ); +HYPRE_Int +hypre_StructGridSetIDs_dbl( hypre_StructGrid *grid, HYPRE_Int *ids ); +HYPRE_Int +hypre_StructGridSetIDs_long_dbl( hypre_StructGrid *grid, HYPRE_Int *ids ); + +HYPRE_Int +hypre_StructGridSetMaxDistance_flt( hypre_StructGrid *grid, hypre_Index dist ); +HYPRE_Int +hypre_StructGridSetMaxDistance_dbl( hypre_StructGrid *grid, hypre_Index dist ); +HYPRE_Int +hypre_StructGridSetMaxDistance_long_dbl( hypre_StructGrid *grid, hypre_Index dist ); + +HYPRE_Int +hypre_StructGridSetNumGhost_flt( hypre_StructGrid *grid, HYPRE_Int *num_ghost ); +HYPRE_Int +hypre_StructGridSetNumGhost_dbl( hypre_StructGrid *grid, HYPRE_Int *num_ghost ); +HYPRE_Int +hypre_StructGridSetNumGhost_long_dbl( hypre_StructGrid *grid, HYPRE_Int *num_ghost ); + +HYPRE_Int +hypre_StructGridSetPeriodic_flt( hypre_StructGrid *grid, hypre_Index periodic ); +HYPRE_Int +hypre_StructGridSetPeriodic_dbl( hypre_StructGrid *grid, hypre_Index periodic ); +HYPRE_Int +hypre_StructGridSetPeriodic_long_dbl( hypre_StructGrid *grid, hypre_Index periodic ); + +HYPRE_Real +hypre_StructInnerProd_flt( hypre_StructVector *x, hypre_StructVector *y ); +HYPRE_Real +hypre_StructInnerProd_dbl( hypre_StructVector *x, hypre_StructVector *y ); +HYPRE_Real +hypre_StructInnerProd_long_dbl( hypre_StructVector *x, hypre_StructVector *y ); + +HYPRE_Real +hypre_StructInnerProdLocal_flt( hypre_StructVector *x, hypre_StructVector *y ); +HYPRE_Real +hypre_StructInnerProdLocal_dbl( hypre_StructVector *x, hypre_StructVector *y ); +HYPRE_Real +hypre_StructInnerProdLocal_long_dbl( hypre_StructVector *x, hypre_StructVector *y ); + +HYPRE_Int +hypre_StructMapCoarseToFine_flt( hypre_Index cindex, hypre_Index origin, hypre_Index stride, hypre_Index findex ); +HYPRE_Int +hypre_StructMapCoarseToFine_dbl( hypre_Index cindex, hypre_Index origin, hypre_Index stride, hypre_Index findex ); +HYPRE_Int +hypre_StructMapCoarseToFine_long_dbl( hypre_Index cindex, hypre_Index origin, hypre_Index stride, hypre_Index findex ); + +HYPRE_Int +hypre_StructMapFineToCoarse_flt( hypre_Index findex, hypre_Index origin, hypre_Index stride, hypre_Index cindex ); +HYPRE_Int +hypre_StructMapFineToCoarse_dbl( hypre_Index findex, hypre_Index origin, hypre_Index stride, hypre_Index cindex ); +HYPRE_Int +hypre_StructMapFineToCoarse_long_dbl( hypre_Index findex, hypre_Index origin, hypre_Index stride, hypre_Index cindex ); + +HYPRE_Int +hypre_StructMatmat_flt( hypre_StructMatrix *A, hypre_StructMatrix *B, hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatmat_dbl( hypre_StructMatrix *A, hypre_StructMatrix *B, hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatmat_long_dbl( hypre_StructMatrix *A, hypre_StructMatrix *B, hypre_StructMatrix **M_ptr ); + +HYPRE_Int +hypre_StructMatmatSetup_flt( hypre_StructMatrix *A, hypre_StructMatrix *B, hypre_StructMatmultData **mmdata_ptr, hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatmatSetup_dbl( hypre_StructMatrix *A, hypre_StructMatrix *B, hypre_StructMatmultData **mmdata_ptr, hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatmatSetup_long_dbl( hypre_StructMatrix *A, hypre_StructMatrix *B, hypre_StructMatmultData **mmdata_ptr, hypre_StructMatrix **M_ptr ); + +HYPRE_Int +hypre_StructMatmult_flt( HYPRE_Int type, HYPRE_Int nmatrices, hypre_StructMatrix **matrices, HYPRE_Int nterms, HYPRE_Int *terms, HYPRE_Int *trans, hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatmult_dbl( HYPRE_Int type, HYPRE_Int nmatrices, hypre_StructMatrix **matrices, HYPRE_Int nterms, HYPRE_Int *terms, HYPRE_Int *trans, hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatmult_long_dbl( HYPRE_Int type, HYPRE_Int nmatrices, hypre_StructMatrix **matrices, HYPRE_Int nterms, HYPRE_Int *terms, HYPRE_Int *trans, hypre_StructMatrix **M_ptr ); + +HYPRE_Int +hypre_StructMatmultCommSetup_flt( hypre_StructMatmultData *mmdata ); +HYPRE_Int +hypre_StructMatmultCommSetup_dbl( hypre_StructMatmultData *mmdata ); +HYPRE_Int +hypre_StructMatmultCommSetup_long_dbl( hypre_StructMatmultData *mmdata ); + +HYPRE_Int +hypre_StructMatmultCommunicate_flt( hypre_StructMatmultData *mmdata ); +HYPRE_Int +hypre_StructMatmultCommunicate_dbl( hypre_StructMatmultData *mmdata ); +HYPRE_Int +hypre_StructMatmultCommunicate_long_dbl( hypre_StructMatmultData *mmdata ); + +HYPRE_Int +hypre_StructMatmultCompute_flt( hypre_StructMatmultData *mmdata, HYPRE_Int iM ); +HYPRE_Int +hypre_StructMatmultCompute_dbl( hypre_StructMatmultData *mmdata, HYPRE_Int iM ); +HYPRE_Int +hypre_StructMatmultCompute_long_dbl( hypre_StructMatmultData *mmdata, HYPRE_Int iM ); + +HYPRE_Int +hypre_StructMatmultCompute_core_flt( HYPRE_Int nterms, hypre_StructMatmultDataMH *a, HYPRE_Int na, HYPRE_Int ndim, hypre_Index loop_size, HYPRE_Int stencil_size, hypre_Box *fdbox, hypre_Index fdstart, hypre_Index fdstride, hypre_Box *cdbox, hypre_Index cdstart, hypre_Index cdstride, hypre_Box *Mdbox, hypre_Index Mdstart, hypre_Index Mdstride ); +HYPRE_Int +hypre_StructMatmultCompute_core_dbl( HYPRE_Int nterms, hypre_StructMatmultDataMH *a, HYPRE_Int na, HYPRE_Int ndim, hypre_Index loop_size, HYPRE_Int stencil_size, hypre_Box *fdbox, hypre_Index fdstart, hypre_Index fdstride, hypre_Box *cdbox, hypre_Index cdstart, hypre_Index cdstride, hypre_Box *Mdbox, hypre_Index Mdstart, hypre_Index Mdstride ); +HYPRE_Int +hypre_StructMatmultCompute_core_long_dbl( HYPRE_Int nterms, hypre_StructMatmultDataMH *a, HYPRE_Int na, HYPRE_Int ndim, hypre_Index loop_size, HYPRE_Int stencil_size, hypre_Box *fdbox, hypre_Index fdstart, hypre_Index fdstride, hypre_Box *cdbox, hypre_Index cdstart, hypre_Index cdstride, hypre_Box *Mdbox, hypre_Index Mdstart, hypre_Index Mdstride ); + +HYPRE_Int +hypre_StructMatmultCompute_core_generic_flt( hypre_StructMatmultDataMH *a, HYPRE_Int na, HYPRE_Int nterms, HYPRE_Int ndim, hypre_Index loop_size, hypre_Box *fdbox, hypre_Index fdstart, hypre_Index fdstride, hypre_Box *cdbox, hypre_Index cdstart, hypre_Index cdstride, hypre_Box *Mdbox, hypre_Index Mdstart, hypre_Index Mdstride ); +HYPRE_Int +hypre_StructMatmultCompute_core_generic_dbl( hypre_StructMatmultDataMH *a, HYPRE_Int na, HYPRE_Int nterms, HYPRE_Int ndim, hypre_Index loop_size, hypre_Box *fdbox, hypre_Index fdstart, hypre_Index fdstride, hypre_Box *cdbox, hypre_Index cdstart, hypre_Index cdstride, hypre_Box *Mdbox, hypre_Index Mdstart, hypre_Index Mdstride ); +HYPRE_Int +hypre_StructMatmultCompute_core_generic_long_dbl( hypre_StructMatmultDataMH *a, HYPRE_Int na, HYPRE_Int nterms, HYPRE_Int ndim, hypre_Index loop_size, hypre_Box *fdbox, hypre_Index fdstart, hypre_Index fdstride, hypre_Box *cdbox, hypre_Index cdstart, hypre_Index cdstride, hypre_Box *Mdbox, hypre_Index Mdstart, hypre_Index Mdstride ); + +HYPRE_Int +hypre_StructMatmultCompute_fuse_flt( HYPRE_Int nterms, hypre_StructMatmultDataMH *a, HYPRE_Int na, HYPRE_Int ndim, hypre_Index loop_size, HYPRE_Int stencil_size, hypre_Box *fdbox, hypre_Index fdstart, hypre_Index fdstride, hypre_Box *cdbox, hypre_Index cdstart, hypre_Index cdstride, hypre_Box *Mdbox, hypre_Index Mdstart, hypre_Index Mdstride, hypre_StructMatrix *M ); +HYPRE_Int +hypre_StructMatmultCompute_fuse_dbl( HYPRE_Int nterms, hypre_StructMatmultDataMH *a, HYPRE_Int na, HYPRE_Int ndim, hypre_Index loop_size, HYPRE_Int stencil_size, hypre_Box *fdbox, hypre_Index fdstart, hypre_Index fdstride, hypre_Box *cdbox, hypre_Index cdstart, hypre_Index cdstride, hypre_Box *Mdbox, hypre_Index Mdstart, hypre_Index Mdstride, hypre_StructMatrix *M ); +HYPRE_Int +hypre_StructMatmultCompute_fuse_long_dbl( HYPRE_Int nterms, hypre_StructMatmultDataMH *a, HYPRE_Int na, HYPRE_Int ndim, hypre_Index loop_size, HYPRE_Int stencil_size, hypre_Box *fdbox, hypre_Index fdstart, hypre_Index fdstride, hypre_Box *cdbox, hypre_Index cdstart, hypre_Index cdstride, hypre_Box *Mdbox, hypre_Index Mdstart, hypre_Index Mdstride, hypre_StructMatrix *M ); + +HYPRE_Int +hypre_StructMatmultCreate_flt( HYPRE_Int max_matmults, HYPRE_Int max_matrices, hypre_StructMatmultData **mmdata_ptr ); +HYPRE_Int +hypre_StructMatmultCreate_dbl( HYPRE_Int max_matmults, HYPRE_Int max_matrices, hypre_StructMatmultData **mmdata_ptr ); +HYPRE_Int +hypre_StructMatmultCreate_long_dbl( HYPRE_Int max_matmults, HYPRE_Int max_matrices, hypre_StructMatmultData **mmdata_ptr ); + +HYPRE_Int +hypre_StructMatmultDestroy_flt( hypre_StructMatmultData *mmdata ); +HYPRE_Int +hypre_StructMatmultDestroy_dbl( hypre_StructMatmultData *mmdata ); +HYPRE_Int +hypre_StructMatmultDestroy_long_dbl( hypre_StructMatmultData *mmdata ); + +HYPRE_Int +hypre_StructMatmultGetMatrix_flt( hypre_StructMatmultData *mmdata, HYPRE_Int iM, hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatmultGetMatrix_dbl( hypre_StructMatmultData *mmdata, HYPRE_Int iM, hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatmultGetMatrix_long_dbl( hypre_StructMatmultData *mmdata, HYPRE_Int iM, hypre_StructMatrix **M_ptr ); + +HYPRE_Int +hypre_StructMatmultInitialize_flt( hypre_StructMatmultData *mmdata, HYPRE_Int assemble_grid ); +HYPRE_Int +hypre_StructMatmultInitialize_dbl( hypre_StructMatmultData *mmdata, HYPRE_Int assemble_grid ); +HYPRE_Int +hypre_StructMatmultInitialize_long_dbl( hypre_StructMatmultData *mmdata, HYPRE_Int assemble_grid ); + +HYPRE_Int +hypre_StructMatmultMultiply_flt( hypre_StructMatmultData *mmdata ); +HYPRE_Int +hypre_StructMatmultMultiply_dbl( hypre_StructMatmultData *mmdata ); +HYPRE_Int +hypre_StructMatmultMultiply_long_dbl( hypre_StructMatmultData *mmdata ); + +HYPRE_Int +hypre_StructMatmultSetKernelType_flt( hypre_StructMatmultData *mmdata, HYPRE_Int kernel_type ); +HYPRE_Int +hypre_StructMatmultSetKernelType_dbl( hypre_StructMatmultData *mmdata, HYPRE_Int kernel_type ); +HYPRE_Int +hypre_StructMatmultSetKernelType_long_dbl( hypre_StructMatmultData *mmdata, HYPRE_Int kernel_type ); + +HYPRE_Int +hypre_StructMatmultSetProduct_flt( hypre_StructMatmultData *mmdata, HYPRE_Int nmatrices_in, hypre_StructMatrix **matrices_in, HYPRE_Int nterms, HYPRE_Int *terms_in, HYPRE_Int *transposes_in, HYPRE_Int *iM_ptr ); +HYPRE_Int +hypre_StructMatmultSetProduct_dbl( hypre_StructMatmultData *mmdata, HYPRE_Int nmatrices_in, hypre_StructMatrix **matrices_in, HYPRE_Int nterms, HYPRE_Int *terms_in, HYPRE_Int *transposes_in, HYPRE_Int *iM_ptr ); +HYPRE_Int +hypre_StructMatmultSetProduct_long_dbl( hypre_StructMatmultData *mmdata, HYPRE_Int nmatrices_in, hypre_StructMatrix **matrices_in, HYPRE_Int nterms, HYPRE_Int *terms_in, HYPRE_Int *transposes_in, HYPRE_Int *iM_ptr ); + +HYPRE_Int +hypre_StructMatmultSetup_flt( HYPRE_Int type, HYPRE_Int nmatrices, hypre_StructMatrix **matrices, HYPRE_Int nterms, HYPRE_Int *terms, HYPRE_Int *trans, hypre_StructMatmultData **mmdata_ptr, hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatmultSetup_dbl( HYPRE_Int type, HYPRE_Int nmatrices, hypre_StructMatrix **matrices, HYPRE_Int nterms, HYPRE_Int *terms, HYPRE_Int *trans, hypre_StructMatmultData **mmdata_ptr, hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatmultSetup_long_dbl( HYPRE_Int type, HYPRE_Int nmatrices, hypre_StructMatrix **matrices, HYPRE_Int nterms, HYPRE_Int *terms, HYPRE_Int *trans, hypre_StructMatmultData **mmdata_ptr, hypre_StructMatrix **M_ptr ); + +HYPRE_Int +hypre_StructMatrixAddInit_flt( HYPRE_Int nmatrices, hypre_StructMatrix **matrices, hypre_StructMatrix **A_ptr ); +HYPRE_Int +hypre_StructMatrixAddInit_dbl( HYPRE_Int nmatrices, hypre_StructMatrix **matrices, hypre_StructMatrix **A_ptr ); +HYPRE_Int +hypre_StructMatrixAddInit_long_dbl( HYPRE_Int nmatrices, hypre_StructMatrix **matrices, hypre_StructMatrix **A_ptr ); + +HYPRE_Int +hypre_StructMatrixAddMat_flt( hypre_StructMatrix *A, hypre_float alpha, hypre_StructMatrix *B ); +HYPRE_Int +hypre_StructMatrixAddMat_dbl( hypre_StructMatrix *A, hypre_double alpha, hypre_StructMatrix *B ); +HYPRE_Int +hypre_StructMatrixAddMat_long_dbl( hypre_StructMatrix *A, hypre_long_double alpha, hypre_StructMatrix *B ); + +HYPRE_Int +hypre_StructMatrixAssemble_flt( hypre_StructMatrix *matrix ); +HYPRE_Int +hypre_StructMatrixAssemble_dbl( hypre_StructMatrix *matrix ); +HYPRE_Int +hypre_StructMatrixAssemble_long_dbl( hypre_StructMatrix *matrix ); + +HYPRE_Int +hypre_StructMatrixClearBoundary_flt( hypre_StructMatrix *matrix ); +HYPRE_Int +hypre_StructMatrixClearBoundary_dbl( hypre_StructMatrix *matrix ); +HYPRE_Int +hypre_StructMatrixClearBoundary_long_dbl( hypre_StructMatrix *matrix ); + +HYPRE_Int +hypre_StructMatrixClearBoxValues_flt( 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_StructMatrixClearBoxValues_dbl( 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_StructMatrixClearBoxValues_long_dbl( 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_StructMatrixClearGhostValues_flt( hypre_StructMatrix *matrix ); +HYPRE_Int +hypre_StructMatrixClearGhostValues_dbl( hypre_StructMatrix *matrix ); +HYPRE_Int +hypre_StructMatrixClearGhostValues_long_dbl( hypre_StructMatrix *matrix ); + +HYPRE_Int +hypre_StructMatrixClearValues_flt( 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_StructMatrixClearValues_dbl( 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_StructMatrixClearValues_long_dbl( 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_StructMatrixComputeDataSpace_flt( hypre_StructMatrix *matrix, HYPRE_Int *num_ghost, hypre_BoxArray **data_space_ptr ); +HYPRE_Int +hypre_StructMatrixComputeDataSpace_dbl( hypre_StructMatrix *matrix, HYPRE_Int *num_ghost, hypre_BoxArray **data_space_ptr ); +HYPRE_Int +hypre_StructMatrixComputeDataSpace_long_dbl( hypre_StructMatrix *matrix, HYPRE_Int *num_ghost, hypre_BoxArray **data_space_ptr ); + +HYPRE_Int +hypre_StructMatrixComputeRowSum_flt( hypre_StructMatrix *A, HYPRE_Int type, hypre_StructVector *rowsum ); +HYPRE_Int +hypre_StructMatrixComputeRowSum_dbl( hypre_StructMatrix *A, HYPRE_Int type, hypre_StructVector *rowsum ); +HYPRE_Int +hypre_StructMatrixComputeRowSum_long_dbl( hypre_StructMatrix *A, HYPRE_Int type, hypre_StructVector *rowsum ); + +hypre_StructMatrix * +hypre_StructMatrixCreate_flt( MPI_Comm comm, hypre_StructGrid *grid, hypre_StructStencil *user_stencil ); +hypre_StructMatrix * +hypre_StructMatrixCreate_dbl( MPI_Comm comm, hypre_StructGrid *grid, hypre_StructStencil *user_stencil ); +hypre_StructMatrix * +hypre_StructMatrixCreate_long_dbl( MPI_Comm comm, hypre_StructGrid *grid, hypre_StructStencil *user_stencil ); + +HYPRE_Int +hypre_StructMatrixCreateCommPkg_flt( hypre_StructMatrix *matrix, hypre_CommInfo *comm_info, hypre_CommPkg **comm_pkg_ptr, hypre_float ***comm_data_ptr ); +HYPRE_Int +hypre_StructMatrixCreateCommPkg_dbl( hypre_StructMatrix *matrix, hypre_CommInfo *comm_info, hypre_CommPkg **comm_pkg_ptr, hypre_double ***comm_data_ptr ); +HYPRE_Int +hypre_StructMatrixCreateCommPkg_long_dbl( hypre_StructMatrix *matrix, hypre_CommInfo *comm_info, hypre_CommPkg **comm_pkg_ptr, hypre_long_double ***comm_data_ptr ); + +hypre_StructMatrix * +hypre_StructMatrixCreateMask_flt( hypre_StructMatrix *matrix, HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices ); +hypre_StructMatrix * +hypre_StructMatrixCreateMask_dbl( hypre_StructMatrix *matrix, HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices ); +hypre_StructMatrix * +hypre_StructMatrixCreateMask_long_dbl( hypre_StructMatrix *matrix, HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices ); + +HYPRE_Int +hypre_StructMatrixDestroy_flt( hypre_StructMatrix *matrix ); +HYPRE_Int +hypre_StructMatrixDestroy_dbl( hypre_StructMatrix *matrix ); +HYPRE_Int +hypre_StructMatrixDestroy_long_dbl( hypre_StructMatrix *matrix ); + +HYPRE_Complex * +hypre_StructMatrixExtractPointerByIndex_flt( hypre_StructMatrix *matrix, HYPRE_Int b, hypre_Index index ); +HYPRE_Complex * +hypre_StructMatrixExtractPointerByIndex_dbl( hypre_StructMatrix *matrix, HYPRE_Int b, hypre_Index index ); +HYPRE_Complex * +hypre_StructMatrixExtractPointerByIndex_long_dbl( hypre_StructMatrix *matrix, HYPRE_Int b, hypre_Index index ); + +HYPRE_Int +hypre_StructMatrixForget_flt( hypre_StructMatrix *matrix ); +HYPRE_Int +hypre_StructMatrixForget_dbl( hypre_StructMatrix *matrix ); +HYPRE_Int +hypre_StructMatrixForget_long_dbl( hypre_StructMatrix *matrix ); + +HYPRE_Int +hypre_StructMatrixGetCStride_flt( hypre_StructMatrix *matrix, hypre_IndexRef *cstride ); +HYPRE_Int +hypre_StructMatrixGetCStride_dbl( hypre_StructMatrix *matrix, hypre_IndexRef *cstride ); +HYPRE_Int +hypre_StructMatrixGetCStride_long_dbl( hypre_StructMatrix *matrix, hypre_IndexRef *cstride ); + +HYPRE_Int +hypre_StructMatrixGetDataMapStride_flt( hypre_StructMatrix *matrix, hypre_IndexRef *stride ); +HYPRE_Int +hypre_StructMatrixGetDataMapStride_dbl( hypre_StructMatrix *matrix, hypre_IndexRef *stride ); +HYPRE_Int +hypre_StructMatrixGetDataMapStride_long_dbl( hypre_StructMatrix *matrix, hypre_IndexRef *stride ); + +HYPRE_Int +hypre_StructMatrixGetDiagonal_flt( hypre_StructMatrix *matrix, hypre_StructVector *diag ); +HYPRE_Int +hypre_StructMatrixGetDiagonal_dbl( hypre_StructMatrix *matrix, hypre_StructVector *diag ); +HYPRE_Int +hypre_StructMatrixGetDiagonal_long_dbl( hypre_StructMatrix *matrix, hypre_StructVector *diag ); + +HYPRE_Int +hypre_StructMatrixGetFStride_flt( hypre_StructMatrix *matrix, hypre_IndexRef *fstride ); +HYPRE_Int +hypre_StructMatrixGetFStride_dbl( hypre_StructMatrix *matrix, hypre_IndexRef *fstride ); +HYPRE_Int +hypre_StructMatrixGetFStride_long_dbl( hypre_StructMatrix *matrix, hypre_IndexRef *fstride ); + +HYPRE_Int +hypre_StructMatrixGetStSpaces_flt( hypre_StructMatrix *matrix, HYPRE_Int transpose, HYPRE_Int *num_sspaces_ptr, HYPRE_Int **sentry_sspaces_ptr, hypre_Index **sspace_origins_ptr, hypre_Index stride ); +HYPRE_Int +hypre_StructMatrixGetStSpaces_dbl( hypre_StructMatrix *matrix, HYPRE_Int transpose, HYPRE_Int *num_sspaces_ptr, HYPRE_Int **sentry_sspaces_ptr, hypre_Index **sspace_origins_ptr, hypre_Index stride ); +HYPRE_Int +hypre_StructMatrixGetStSpaces_long_dbl( hypre_StructMatrix *matrix, HYPRE_Int transpose, HYPRE_Int *num_sspaces_ptr, HYPRE_Int **sentry_sspaces_ptr, hypre_Index **sspace_origins_ptr, hypre_Index stride ); + +HYPRE_Int +hypre_StructMatrixGetStencilSpace_flt( hypre_StructMatrix *matrix, HYPRE_Int entry, HYPRE_Int transpose, hypre_Index origin, hypre_Index stride ); +HYPRE_Int +hypre_StructMatrixGetStencilSpace_dbl( hypre_StructMatrix *matrix, HYPRE_Int entry, HYPRE_Int transpose, hypre_Index origin, hypre_Index stride ); +HYPRE_Int +hypre_StructMatrixGetStencilSpace_long_dbl( hypre_StructMatrix *matrix, HYPRE_Int entry, HYPRE_Int transpose, hypre_Index origin, hypre_Index stride ); + +HYPRE_Int +hypre_StructMatrixGetStencilStride_flt( hypre_StructMatrix *matrix, hypre_Index stride ); +HYPRE_Int +hypre_StructMatrixGetStencilStride_dbl( hypre_StructMatrix *matrix, hypre_Index stride ); +HYPRE_Int +hypre_StructMatrixGetStencilStride_long_dbl( hypre_StructMatrix *matrix, hypre_Index stride ); + +HYPRE_Int +hypre_StructMatrixGrowDataSpace_flt( hypre_StructMatrix *matrix, HYPRE_Int *num_ghost, hypre_BoxArray **data_space_ptr ); +HYPRE_Int +hypre_StructMatrixGrowDataSpace_dbl( hypre_StructMatrix *matrix, HYPRE_Int *num_ghost, hypre_BoxArray **data_space_ptr ); +HYPRE_Int +hypre_StructMatrixGrowDataSpace_long_dbl( hypre_StructMatrix *matrix, HYPRE_Int *num_ghost, hypre_BoxArray **data_space_ptr ); + +HYPRE_Int +hypre_StructMatrixInitialize_flt( hypre_StructMatrix *matrix ); +HYPRE_Int +hypre_StructMatrixInitialize_dbl( hypre_StructMatrix *matrix ); +HYPRE_Int +hypre_StructMatrixInitialize_long_dbl( hypre_StructMatrix *matrix ); + +HYPRE_Int +hypre_StructMatrixInitializeData_flt( hypre_StructMatrix *matrix, HYPRE_Int zero_init, hypre_float *data ); +HYPRE_Int +hypre_StructMatrixInitializeData_dbl( hypre_StructMatrix *matrix, HYPRE_Int zero_init, hypre_double *data ); +HYPRE_Int +hypre_StructMatrixInitializeData_long_dbl( hypre_StructMatrix *matrix, HYPRE_Int zero_init, hypre_long_double *data ); + +HYPRE_Int +hypre_StructMatrixInitializeShell_flt( hypre_StructMatrix *matrix ); +HYPRE_Int +hypre_StructMatrixInitializeShell_dbl( hypre_StructMatrix *matrix ); +HYPRE_Int +hypre_StructMatrixInitializeShell_long_dbl( hypre_StructMatrix *matrix ); + +HYPRE_Int +hypre_StructMatrixMapCommInfo_flt( hypre_StructMatrix *matrix, hypre_IndexRef origin, hypre_Index stride, hypre_CommInfo *comm_info ); +HYPRE_Int +hypre_StructMatrixMapCommInfo_dbl( hypre_StructMatrix *matrix, hypre_IndexRef origin, hypre_Index stride, hypre_CommInfo *comm_info ); +HYPRE_Int +hypre_StructMatrixMapCommInfo_long_dbl( hypre_StructMatrix *matrix, hypre_IndexRef origin, hypre_Index stride, hypre_CommInfo *comm_info ); + +HYPRE_Int +hypre_StructMatrixMapDataBox_flt( hypre_StructMatrix *matrix, hypre_Box *dbox ); +HYPRE_Int +hypre_StructMatrixMapDataBox_dbl( hypre_StructMatrix *matrix, hypre_Box *dbox ); +HYPRE_Int +hypre_StructMatrixMapDataBox_long_dbl( hypre_StructMatrix *matrix, hypre_Box *dbox ); + +HYPRE_Int +hypre_StructMatrixMapDataIndex_flt( hypre_StructMatrix *matrix, hypre_Index dindex ); +HYPRE_Int +hypre_StructMatrixMapDataIndex_dbl( hypre_StructMatrix *matrix, hypre_Index dindex ); +HYPRE_Int +hypre_StructMatrixMapDataIndex_long_dbl( hypre_StructMatrix *matrix, hypre_Index dindex ); + +HYPRE_Int +hypre_StructMatrixMapDataStride_flt( hypre_StructMatrix *matrix, hypre_Index dstride ); +HYPRE_Int +hypre_StructMatrixMapDataStride_dbl( hypre_StructMatrix *matrix, hypre_Index dstride ); +HYPRE_Int +hypre_StructMatrixMapDataStride_long_dbl( hypre_StructMatrix *matrix, hypre_Index dstride ); + +HYPRE_Int +hypre_StructMatrixMigrate_flt( hypre_StructMatrix *from_matrix, hypre_StructMatrix *to_matrix ); +HYPRE_Int +hypre_StructMatrixMigrate_dbl( hypre_StructMatrix *from_matrix, hypre_StructMatrix *to_matrix ); +HYPRE_Int +hypre_StructMatrixMigrate_long_dbl( hypre_StructMatrix *from_matrix, hypre_StructMatrix *to_matrix ); + +HYPRE_Int +hypre_StructMatrixNeedResize_flt( hypre_StructMatrix *matrix, hypre_BoxArray *data_space ); +HYPRE_Int +hypre_StructMatrixNeedResize_dbl( hypre_StructMatrix *matrix, hypre_BoxArray *data_space ); +HYPRE_Int +hypre_StructMatrixNeedResize_long_dbl( hypre_StructMatrix *matrix, hypre_BoxArray *data_space ); + +HYPRE_Int +hypre_StructMatrixPlaceStencil_flt( hypre_StructMatrix *matrix, HYPRE_Int entry, hypre_Index dindex, hypre_Index index ); +HYPRE_Int +hypre_StructMatrixPlaceStencil_dbl( hypre_StructMatrix *matrix, HYPRE_Int entry, hypre_Index dindex, hypre_Index index ); +HYPRE_Int +hypre_StructMatrixPlaceStencil_long_dbl( hypre_StructMatrix *matrix, HYPRE_Int entry, hypre_Index dindex, hypre_Index index ); + +HYPRE_Int +hypre_StructMatrixPrint_flt( const char *filename, hypre_StructMatrix *matrix, HYPRE_Int all ); +HYPRE_Int +hypre_StructMatrixPrint_dbl( const char *filename, hypre_StructMatrix *matrix, HYPRE_Int all ); +HYPRE_Int +hypre_StructMatrixPrint_long_dbl( const char *filename, hypre_StructMatrix *matrix, HYPRE_Int all ); + +HYPRE_Int +hypre_StructMatrixPrintData_flt( FILE *file, hypre_StructMatrix *matrix, HYPRE_Int all ); +HYPRE_Int +hypre_StructMatrixPrintData_dbl( FILE *file, hypre_StructMatrix *matrix, HYPRE_Int all ); +HYPRE_Int +hypre_StructMatrixPrintData_long_dbl( FILE *file, hypre_StructMatrix *matrix, HYPRE_Int all ); + +HYPRE_Int +hypre_StructMatrixPtAP_flt( hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatrixPtAP_dbl( hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatrixPtAP_long_dbl( hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix **M_ptr ); + +HYPRE_Int +hypre_StructMatrixPtAPSetup_flt( HYPRE_Int kernel_type, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatmultData **mmdata_ptr, hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatrixPtAPSetup_dbl( HYPRE_Int kernel_type, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatmultData **mmdata_ptr, hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatrixPtAPSetup_long_dbl( HYPRE_Int kernel_type, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatmultData **mmdata_ptr, hypre_StructMatrix **M_ptr ); + +HYPRE_Int +hypre_StructMatrixRAP_flt( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatrixRAP_dbl( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatrixRAP_long_dbl( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix **M_ptr ); + +HYPRE_Int +hypre_StructMatrixRAPSetup_flt( HYPRE_Int kernel_type, hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatmultData **mmdata_ptr, hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatrixRAPSetup_dbl( HYPRE_Int kernel_type, hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatmultData **mmdata_ptr, hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatrixRAPSetup_long_dbl( HYPRE_Int kernel_type, hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatmultData **mmdata_ptr, hypre_StructMatrix **M_ptr ); + +HYPRE_Int +hypre_StructMatrixRTtAP_flt( hypre_StructMatrix *RT, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatrixRTtAP_dbl( hypre_StructMatrix *RT, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatrixRTtAP_long_dbl( hypre_StructMatrix *RT, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix **M_ptr ); + +HYPRE_Int +hypre_StructMatrixRTtAPSetup_flt( HYPRE_Int kernel_type, hypre_StructMatrix *RT, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatmultData **mmdata_ptr, hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatrixRTtAPSetup_dbl( HYPRE_Int kernel_type, hypre_StructMatrix *RT, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatmultData **mmdata_ptr, hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatrixRTtAPSetup_long_dbl( HYPRE_Int kernel_type, hypre_StructMatrix *RT, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatmultData **mmdata_ptr, hypre_StructMatrix **M_ptr ); + +hypre_StructMatrix * +hypre_StructMatrixRead_flt( MPI_Comm comm, const char *filename, HYPRE_Int *num_ghost ); +hypre_StructMatrix * +hypre_StructMatrixRead_dbl( MPI_Comm comm, const char *filename, HYPRE_Int *num_ghost ); +hypre_StructMatrix * +hypre_StructMatrixRead_long_dbl( MPI_Comm comm, const char *filename, HYPRE_Int *num_ghost ); + +HYPRE_Int +hypre_StructMatrixReadData_flt( FILE *file, hypre_StructMatrix *matrix ); +HYPRE_Int +hypre_StructMatrixReadData_dbl( FILE *file, hypre_StructMatrix *matrix ); +HYPRE_Int +hypre_StructMatrixReadData_long_dbl( FILE *file, hypre_StructMatrix *matrix ); + +hypre_StructMatrix * +hypre_StructMatrixRef_flt( hypre_StructMatrix *matrix ); +hypre_StructMatrix * +hypre_StructMatrixRef_dbl( hypre_StructMatrix *matrix ); +hypre_StructMatrix * +hypre_StructMatrixRef_long_dbl( hypre_StructMatrix *matrix ); + +HYPRE_Int +hypre_StructMatrixResize_flt( hypre_StructMatrix *matrix, hypre_BoxArray *data_space ); +HYPRE_Int +hypre_StructMatrixResize_dbl( hypre_StructMatrix *matrix, hypre_BoxArray *data_space ); +HYPRE_Int +hypre_StructMatrixResize_long_dbl( hypre_StructMatrix *matrix, hypre_BoxArray *data_space ); + +HYPRE_Int +hypre_StructMatrixRestore_flt( hypre_StructMatrix *matrix ); +HYPRE_Int +hypre_StructMatrixRestore_dbl( hypre_StructMatrix *matrix ); +HYPRE_Int +hypre_StructMatrixRestore_long_dbl( hypre_StructMatrix *matrix ); + +HYPRE_Int +hypre_StructMatrixSetBoxValues_flt( hypre_StructMatrix *matrix, hypre_Box *set_box, hypre_Box *value_box, HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, hypre_float *values, HYPRE_Int action, HYPRE_Int boxnum, HYPRE_Int outside ); +HYPRE_Int +hypre_StructMatrixSetBoxValues_dbl( hypre_StructMatrix *matrix, hypre_Box *set_box, hypre_Box *value_box, HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, hypre_double *values, HYPRE_Int action, HYPRE_Int boxnum, HYPRE_Int outside ); +HYPRE_Int +hypre_StructMatrixSetBoxValues_long_dbl( hypre_StructMatrix *matrix, hypre_Box *set_box, hypre_Box *value_box, HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, hypre_long_double *values, HYPRE_Int action, HYPRE_Int boxnum, HYPRE_Int outside ); + +HYPRE_Int +hypre_StructMatrixSetConstantEntries_flt( hypre_StructMatrix *matrix, HYPRE_Int nentries, HYPRE_Int *entries ); +HYPRE_Int +hypre_StructMatrixSetConstantEntries_dbl( hypre_StructMatrix *matrix, HYPRE_Int nentries, HYPRE_Int *entries ); +HYPRE_Int +hypre_StructMatrixSetConstantEntries_long_dbl( hypre_StructMatrix *matrix, HYPRE_Int nentries, HYPRE_Int *entries ); + +HYPRE_Int +hypre_StructMatrixSetConstantValues_flt( hypre_StructMatrix *matrix, HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, hypre_float *values, HYPRE_Int action ); +HYPRE_Int +hypre_StructMatrixSetConstantValues_dbl( hypre_StructMatrix *matrix, HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, hypre_double *values, HYPRE_Int action ); +HYPRE_Int +hypre_StructMatrixSetConstantValues_long_dbl( hypre_StructMatrix *matrix, HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, hypre_long_double *values, HYPRE_Int action ); + +HYPRE_Int +hypre_StructMatrixSetDomainStride_flt( hypre_StructMatrix *matrix, hypre_IndexRef domain_stride ); +HYPRE_Int +hypre_StructMatrixSetDomainStride_dbl( hypre_StructMatrix *matrix, hypre_IndexRef domain_stride ); +HYPRE_Int +hypre_StructMatrixSetDomainStride_long_dbl( hypre_StructMatrix *matrix, hypre_IndexRef domain_stride ); + +HYPRE_Int +hypre_StructMatrixSetGhost_flt( hypre_StructMatrix *matrix, HYPRE_Int ghost, HYPRE_Int *resize ); +HYPRE_Int +hypre_StructMatrixSetGhost_dbl( hypre_StructMatrix *matrix, HYPRE_Int ghost, HYPRE_Int *resize ); +HYPRE_Int +hypre_StructMatrixSetGhost_long_dbl( hypre_StructMatrix *matrix, HYPRE_Int ghost, HYPRE_Int *resize ); + +HYPRE_Int +hypre_StructMatrixSetMemoryLocation_flt( hypre_StructMatrix *matrix, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_StructMatrixSetMemoryLocation_dbl( hypre_StructMatrix *matrix, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_StructMatrixSetMemoryLocation_long_dbl( hypre_StructMatrix *matrix, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +hypre_StructMatrixSetNumGhost_flt( hypre_StructMatrix *matrix, HYPRE_Int *num_ghost, HYPRE_Int *resize ); +HYPRE_Int +hypre_StructMatrixSetNumGhost_dbl( hypre_StructMatrix *matrix, HYPRE_Int *num_ghost, HYPRE_Int *resize ); +HYPRE_Int +hypre_StructMatrixSetNumGhost_long_dbl( hypre_StructMatrix *matrix, HYPRE_Int *num_ghost, HYPRE_Int *resize ); + +HYPRE_Int +hypre_StructMatrixSetRangeStride_flt( hypre_StructMatrix *matrix, hypre_IndexRef range_stride ); +HYPRE_Int +hypre_StructMatrixSetRangeStride_dbl( hypre_StructMatrix *matrix, hypre_IndexRef range_stride ); +HYPRE_Int +hypre_StructMatrixSetRangeStride_long_dbl( hypre_StructMatrix *matrix, hypre_IndexRef range_stride ); + +HYPRE_Int +hypre_StructMatrixSetTranspose_flt( hypre_StructMatrix *matrix, HYPRE_Int transpose, HYPRE_Int *resize ); +HYPRE_Int +hypre_StructMatrixSetTranspose_dbl( hypre_StructMatrix *matrix, HYPRE_Int transpose, HYPRE_Int *resize ); +HYPRE_Int +hypre_StructMatrixSetTranspose_long_dbl( hypre_StructMatrix *matrix, HYPRE_Int transpose, HYPRE_Int *resize ); + +HYPRE_Int +hypre_StructMatrixSetValues_flt( hypre_StructMatrix *matrix, hypre_Index grid_index, HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, hypre_float *values, HYPRE_Int action, HYPRE_Int boxnum, HYPRE_Int outside ); +HYPRE_Int +hypre_StructMatrixSetValues_dbl( hypre_StructMatrix *matrix, hypre_Index grid_index, HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, hypre_double *values, HYPRE_Int action, HYPRE_Int boxnum, HYPRE_Int outside ); +HYPRE_Int +hypre_StructMatrixSetValues_long_dbl( hypre_StructMatrix *matrix, hypre_Index grid_index, HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, hypre_long_double *values, HYPRE_Int action, HYPRE_Int boxnum, HYPRE_Int outside ); + +HYPRE_Int +hypre_StructMatrixUnMapDataBox_flt( hypre_StructMatrix *matrix, hypre_Box *dbox ); +HYPRE_Int +hypre_StructMatrixUnMapDataBox_dbl( hypre_StructMatrix *matrix, hypre_Box *dbox ); +HYPRE_Int +hypre_StructMatrixUnMapDataBox_long_dbl( hypre_StructMatrix *matrix, hypre_Box *dbox ); + +HYPRE_Int +hypre_StructMatrixUnMapDataIndex_flt( hypre_StructMatrix *matrix, hypre_Index dindex ); +HYPRE_Int +hypre_StructMatrixUnMapDataIndex_dbl( hypre_StructMatrix *matrix, hypre_Index dindex ); +HYPRE_Int +hypre_StructMatrixUnMapDataIndex_long_dbl( hypre_StructMatrix *matrix, hypre_Index dindex ); + +HYPRE_Int +hypre_StructMatrixUnMapDataStride_flt( hypre_StructMatrix *matrix, hypre_Index dstride ); +HYPRE_Int +hypre_StructMatrixUnMapDataStride_dbl( hypre_StructMatrix *matrix, hypre_Index dstride ); +HYPRE_Int +hypre_StructMatrixUnMapDataStride_long_dbl( hypre_StructMatrix *matrix, hypre_Index dstride ); + +HYPRE_Int +hypre_StructMatrixZeroDiagonal_flt( hypre_StructMatrix *A ); +HYPRE_Int +hypre_StructMatrixZeroDiagonal_dbl( hypre_StructMatrix *A ); +HYPRE_Int +hypre_StructMatrixZeroDiagonal_long_dbl( hypre_StructMatrix *A ); + +HYPRE_Int +hypre_StructMatvec_flt( hypre_float alpha, hypre_StructMatrix *A, hypre_StructVector *x, hypre_float beta, hypre_StructVector *y ); +HYPRE_Int +hypre_StructMatvec_dbl( hypre_double alpha, hypre_StructMatrix *A, hypre_StructVector *x, hypre_double beta, hypre_StructVector *y ); +HYPRE_Int +hypre_StructMatvec_long_dbl( hypre_long_double alpha, hypre_StructMatrix *A, hypre_StructVector *x, hypre_long_double beta, hypre_StructVector *y ); + +HYPRE_Int +hypre_StructMatvecCompute_flt( void *matvec_vdata, hypre_float alpha, hypre_StructMatrix *A, hypre_StructVector *x, hypre_float beta, hypre_StructVector *y, hypre_StructVector *z ); +HYPRE_Int +hypre_StructMatvecCompute_dbl( void *matvec_vdata, hypre_double alpha, hypre_StructMatrix *A, hypre_StructVector *x, hypre_double beta, hypre_StructVector *y, hypre_StructVector *z ); +HYPRE_Int +hypre_StructMatvecCompute_long_dbl( void *matvec_vdata, hypre_long_double alpha, hypre_StructMatrix *A, hypre_StructVector *x, hypre_long_double beta, hypre_StructVector *y, hypre_StructVector *z ); + +HYPRE_Int +hypre_StructMatvecCompute_core_CC_flt( hypre_float alpha, hypre_StructMatrix *A, hypre_StructVector *x, hypre_float beta, hypre_StructVector *y, hypre_StructVector *z, HYPRE_Int Ab, HYPRE_Int xb, HYPRE_Int yb, HYPRE_Int zb, HYPRE_Int transpose, HYPRE_Int nentries, HYPRE_Int *entries, hypre_IndexRef start, hypre_IndexRef stride, hypre_IndexRef loop_size, hypre_IndexRef xfstride, hypre_IndexRef ran_stride, hypre_IndexRef xdstride, hypre_IndexRef ydstride, hypre_IndexRef zdstride, hypre_Box *x_data_box, hypre_Box *y_data_box, hypre_Box *z_data_box ); +HYPRE_Int +hypre_StructMatvecCompute_core_CC_dbl( hypre_double alpha, hypre_StructMatrix *A, hypre_StructVector *x, hypre_double beta, hypre_StructVector *y, hypre_StructVector *z, HYPRE_Int Ab, HYPRE_Int xb, HYPRE_Int yb, HYPRE_Int zb, HYPRE_Int transpose, HYPRE_Int nentries, HYPRE_Int *entries, hypre_IndexRef start, hypre_IndexRef stride, hypre_IndexRef loop_size, hypre_IndexRef xfstride, hypre_IndexRef ran_stride, hypre_IndexRef xdstride, hypre_IndexRef ydstride, hypre_IndexRef zdstride, hypre_Box *x_data_box, hypre_Box *y_data_box, hypre_Box *z_data_box ); +HYPRE_Int +hypre_StructMatvecCompute_core_CC_long_dbl( hypre_long_double alpha, hypre_StructMatrix *A, hypre_StructVector *x, hypre_long_double beta, hypre_StructVector *y, hypre_StructVector *z, HYPRE_Int Ab, HYPRE_Int xb, HYPRE_Int yb, HYPRE_Int zb, HYPRE_Int transpose, HYPRE_Int nentries, HYPRE_Int *entries, hypre_IndexRef start, hypre_IndexRef stride, hypre_IndexRef loop_size, hypre_IndexRef xfstride, hypre_IndexRef ran_stride, hypre_IndexRef xdstride, hypre_IndexRef ydstride, hypre_IndexRef zdstride, hypre_Box *x_data_box, hypre_Box *y_data_box, hypre_Box *z_data_box ); + +HYPRE_Int +hypre_StructMatvecCompute_core_VC_flt( hypre_float alpha, hypre_StructMatrix *A, hypre_StructVector *x, hypre_float beta, hypre_StructVector *y, hypre_StructVector *z, HYPRE_Int Ab, HYPRE_Int xb, HYPRE_Int yb, HYPRE_Int zb, HYPRE_Int transpose, HYPRE_Int only_Ax, HYPRE_Int nentries, HYPRE_Int *entries, hypre_IndexRef start, hypre_IndexRef stride, hypre_IndexRef loop_size, hypre_IndexRef xfstride, hypre_IndexRef ran_stride, hypre_IndexRef Adstride, hypre_IndexRef xdstride, hypre_IndexRef ydstride, hypre_IndexRef zdstride, hypre_Box *A_data_box, hypre_Box *x_data_box, hypre_Box *y_data_box, hypre_Box *z_data_box ); +HYPRE_Int +hypre_StructMatvecCompute_core_VC_dbl( hypre_double alpha, hypre_StructMatrix *A, hypre_StructVector *x, hypre_double beta, hypre_StructVector *y, hypre_StructVector *z, HYPRE_Int Ab, HYPRE_Int xb, HYPRE_Int yb, HYPRE_Int zb, HYPRE_Int transpose, HYPRE_Int only_Ax, HYPRE_Int nentries, HYPRE_Int *entries, hypre_IndexRef start, hypre_IndexRef stride, hypre_IndexRef loop_size, hypre_IndexRef xfstride, hypre_IndexRef ran_stride, hypre_IndexRef Adstride, hypre_IndexRef xdstride, hypre_IndexRef ydstride, hypre_IndexRef zdstride, hypre_Box *A_data_box, hypre_Box *x_data_box, hypre_Box *y_data_box, hypre_Box *z_data_box ); +HYPRE_Int +hypre_StructMatvecCompute_core_VC_long_dbl( hypre_long_double alpha, hypre_StructMatrix *A, hypre_StructVector *x, hypre_long_double beta, hypre_StructVector *y, hypre_StructVector *z, HYPRE_Int Ab, HYPRE_Int xb, HYPRE_Int yb, HYPRE_Int zb, HYPRE_Int transpose, HYPRE_Int only_Ax, HYPRE_Int nentries, HYPRE_Int *entries, hypre_IndexRef start, hypre_IndexRef stride, hypre_IndexRef loop_size, hypre_IndexRef xfstride, hypre_IndexRef ran_stride, hypre_IndexRef Adstride, hypre_IndexRef xdstride, hypre_IndexRef ydstride, hypre_IndexRef zdstride, hypre_Box *A_data_box, hypre_Box *x_data_box, hypre_Box *y_data_box, hypre_Box *z_data_box ); + +HYPRE_Int +hypre_StructMatvecCompute_core_VCC_flt( hypre_float alpha, hypre_StructMatrix *A, hypre_StructVector *x, hypre_float beta, hypre_StructVector *y, hypre_StructVector *z, HYPRE_Int Ab, HYPRE_Int xb, HYPRE_Int yb, HYPRE_Int zb, HYPRE_Int transpose, HYPRE_Int centry, HYPRE_Int nentries, HYPRE_Int *entries, hypre_IndexRef start, hypre_IndexRef stride, hypre_IndexRef loop_size, hypre_IndexRef xfstride, hypre_IndexRef ran_stride, hypre_IndexRef Adstride, hypre_IndexRef xdstride, hypre_IndexRef ydstride, hypre_IndexRef zdstride, hypre_Box *A_data_box, hypre_Box *x_data_box, hypre_Box *y_data_box, hypre_Box *z_data_box ); +HYPRE_Int +hypre_StructMatvecCompute_core_VCC_dbl( hypre_double alpha, hypre_StructMatrix *A, hypre_StructVector *x, hypre_double beta, hypre_StructVector *y, hypre_StructVector *z, HYPRE_Int Ab, HYPRE_Int xb, HYPRE_Int yb, HYPRE_Int zb, HYPRE_Int transpose, HYPRE_Int centry, HYPRE_Int nentries, HYPRE_Int *entries, hypre_IndexRef start, hypre_IndexRef stride, hypre_IndexRef loop_size, hypre_IndexRef xfstride, hypre_IndexRef ran_stride, hypre_IndexRef Adstride, hypre_IndexRef xdstride, hypre_IndexRef ydstride, hypre_IndexRef zdstride, hypre_Box *A_data_box, hypre_Box *x_data_box, hypre_Box *y_data_box, hypre_Box *z_data_box ); +HYPRE_Int +hypre_StructMatvecCompute_core_VCC_long_dbl( hypre_long_double alpha, hypre_StructMatrix *A, hypre_StructVector *x, hypre_long_double beta, hypre_StructVector *y, hypre_StructVector *z, HYPRE_Int Ab, HYPRE_Int xb, HYPRE_Int yb, HYPRE_Int zb, HYPRE_Int transpose, HYPRE_Int centry, HYPRE_Int nentries, HYPRE_Int *entries, hypre_IndexRef start, hypre_IndexRef stride, hypre_IndexRef loop_size, hypre_IndexRef xfstride, hypre_IndexRef ran_stride, hypre_IndexRef Adstride, hypre_IndexRef xdstride, hypre_IndexRef ydstride, hypre_IndexRef zdstride, hypre_Box *A_data_box, hypre_Box *x_data_box, hypre_Box *y_data_box, hypre_Box *z_data_box ); + +void * +hypre_StructMatvecCreate_flt( void ); +void * +hypre_StructMatvecCreate_dbl( void ); +void * +hypre_StructMatvecCreate_long_dbl( void ); + +HYPRE_Int +hypre_StructMatvecDestroy_flt( void *matvec_vdata ); +HYPRE_Int +hypre_StructMatvecDestroy_dbl( void *matvec_vdata ); +HYPRE_Int +hypre_StructMatvecDestroy_long_dbl( void *matvec_vdata ); + +HYPRE_Int +hypre_StructMatvecSetTranspose_flt( void *matvec_vdata, HYPRE_Int transpose ); +HYPRE_Int +hypre_StructMatvecSetTranspose_dbl( void *matvec_vdata, HYPRE_Int transpose ); +HYPRE_Int +hypre_StructMatvecSetTranspose_long_dbl( void *matvec_vdata, HYPRE_Int transpose ); + +HYPRE_Int +hypre_StructMatvecSetup_flt( void *matvec_vdata, hypre_StructMatrix *A, hypre_StructVector *x ); +HYPRE_Int +hypre_StructMatvecSetup_dbl( void *matvec_vdata, hypre_StructMatrix *A, hypre_StructVector *x ); +HYPRE_Int +hypre_StructMatvecSetup_long_dbl( void *matvec_vdata, hypre_StructMatrix *A, hypre_StructVector *x ); + +HYPRE_Int +hypre_StructMatvecT_flt( hypre_float alpha, hypre_StructMatrix *A, hypre_StructVector *x, hypre_float beta, hypre_StructVector *y ); +HYPRE_Int +hypre_StructMatvecT_dbl( hypre_double alpha, hypre_StructMatrix *A, hypre_StructVector *x, hypre_double beta, hypre_StructVector *y ); +HYPRE_Int +hypre_StructMatvecT_long_dbl( hypre_long_double alpha, hypre_StructMatrix *A, hypre_StructVector *x, hypre_long_double beta, hypre_StructVector *y ); + +HYPRE_Int +hypre_StructNumGhostFromStencil_flt( hypre_StructStencil *stencil, HYPRE_Int **num_ghost_ptr ); +HYPRE_Int +hypre_StructNumGhostFromStencil_dbl( hypre_StructStencil *stencil, HYPRE_Int **num_ghost_ptr ); +HYPRE_Int +hypre_StructNumGhostFromStencil_long_dbl( hypre_StructStencil *stencil, HYPRE_Int **num_ghost_ptr ); + +HYPRE_Int +hypre_StructPartialCopy_flt( hypre_StructVector *x, hypre_StructVector *y, hypre_BoxArrayArray *array_boxes ); +HYPRE_Int +hypre_StructPartialCopy_dbl( hypre_StructVector *x, hypre_StructVector *y, hypre_BoxArrayArray *array_boxes ); +HYPRE_Int +hypre_StructPartialCopy_long_dbl( hypre_StructVector *x, hypre_StructVector *y, hypre_BoxArrayArray *array_boxes ); + +HYPRE_Int +hypre_StructScale_flt( hypre_float alpha, hypre_StructVector *y ); +HYPRE_Int +hypre_StructScale_dbl( hypre_double alpha, hypre_StructVector *y ); +HYPRE_Int +hypre_StructScale_long_dbl( hypre_long_double alpha, hypre_StructVector *y ); + +hypre_StructStencil * +hypre_StructStencilCreate_flt( HYPRE_Int dim, HYPRE_Int size, hypre_Index *shape ); +hypre_StructStencil * +hypre_StructStencilCreate_dbl( HYPRE_Int dim, HYPRE_Int size, hypre_Index *shape ); +hypre_StructStencil * +hypre_StructStencilCreate_long_dbl( HYPRE_Int dim, HYPRE_Int size, hypre_Index *shape ); + +HYPRE_Int +hypre_StructStencilDestroy_flt( hypre_StructStencil *stencil ); +HYPRE_Int +hypre_StructStencilDestroy_dbl( hypre_StructStencil *stencil ); +HYPRE_Int +hypre_StructStencilDestroy_long_dbl( hypre_StructStencil *stencil ); + +HYPRE_Int +hypre_StructStencilOffsetEntry_flt( hypre_StructStencil *stencil, hypre_Index stencil_offset ); +HYPRE_Int +hypre_StructStencilOffsetEntry_dbl( hypre_StructStencil *stencil, hypre_Index stencil_offset ); +HYPRE_Int +hypre_StructStencilOffsetEntry_long_dbl( hypre_StructStencil *stencil, hypre_Index stencil_offset ); + +HYPRE_Int +hypre_StructStencilPrint_flt( FILE *file, hypre_StructStencil *stencil ); +HYPRE_Int +hypre_StructStencilPrint_dbl( FILE *file, hypre_StructStencil *stencil ); +HYPRE_Int +hypre_StructStencilPrint_long_dbl( FILE *file, hypre_StructStencil *stencil ); + +HYPRE_Int +hypre_StructStencilRead_flt( FILE *file, HYPRE_Int ndim, hypre_StructStencil **stencil_ptr ); +HYPRE_Int +hypre_StructStencilRead_dbl( FILE *file, HYPRE_Int ndim, hypre_StructStencil **stencil_ptr ); +HYPRE_Int +hypre_StructStencilRead_long_dbl( FILE *file, HYPRE_Int ndim, hypre_StructStencil **stencil_ptr ); + +hypre_StructStencil * +hypre_StructStencilRef_flt( hypre_StructStencil *stencil ); +hypre_StructStencil * +hypre_StructStencilRef_dbl( hypre_StructStencil *stencil ); +hypre_StructStencil * +hypre_StructStencilRef_long_dbl( hypre_StructStencil *stencil ); + +HYPRE_Int +hypre_StructStencilSymmetrize_flt( hypre_StructStencil *stencil, hypre_StructStencil **symm_stencil_ptr, HYPRE_Int **symm_offsets_ptr ); +HYPRE_Int +hypre_StructStencilSymmetrize_dbl( hypre_StructStencil *stencil, hypre_StructStencil **symm_stencil_ptr, HYPRE_Int **symm_offsets_ptr ); +HYPRE_Int +hypre_StructStencilSymmetrize_long_dbl( hypre_StructStencil *stencil, hypre_StructStencil **symm_stencil_ptr, HYPRE_Int **symm_offsets_ptr ); + +HYPRE_Int +hypre_StructVectorAssemble_flt( hypre_StructVector *vector ); +HYPRE_Int +hypre_StructVectorAssemble_dbl( hypre_StructVector *vector ); +HYPRE_Int +hypre_StructVectorAssemble_long_dbl( hypre_StructVector *vector ); + +HYPRE_Int +hypre_StructVectorAxpy_flt( hypre_float alpha, hypre_StructVector *x, hypre_float beta, hypre_StructVector *y, hypre_StructVector *z ); +HYPRE_Int +hypre_StructVectorAxpy_dbl( hypre_double alpha, hypre_StructVector *x, hypre_double beta, hypre_StructVector *y, hypre_StructVector *z ); +HYPRE_Int +hypre_StructVectorAxpy_long_dbl( hypre_long_double alpha, hypre_StructVector *x, hypre_long_double beta, hypre_StructVector *y, hypre_StructVector *z ); + +HYPRE_Int +hypre_StructVectorClearAllValues_flt( hypre_StructVector *vector ); +HYPRE_Int +hypre_StructVectorClearAllValues_dbl( hypre_StructVector *vector ); +HYPRE_Int +hypre_StructVectorClearAllValues_long_dbl( hypre_StructVector *vector ); + +HYPRE_Int +hypre_StructVectorClearBoundGhostValues_flt( hypre_StructVector *vector, HYPRE_Int force ); +HYPRE_Int +hypre_StructVectorClearBoundGhostValues_dbl( hypre_StructVector *vector, HYPRE_Int force ); +HYPRE_Int +hypre_StructVectorClearBoundGhostValues_long_dbl( hypre_StructVector *vector, HYPRE_Int force ); + +HYPRE_Int +hypre_StructVectorClearBoxValues_flt( hypre_StructVector *vector, hypre_Box *clear_box, HYPRE_Int boxnum, HYPRE_Int outside ); +HYPRE_Int +hypre_StructVectorClearBoxValues_dbl( hypre_StructVector *vector, hypre_Box *clear_box, HYPRE_Int boxnum, HYPRE_Int outside ); +HYPRE_Int +hypre_StructVectorClearBoxValues_long_dbl( hypre_StructVector *vector, hypre_Box *clear_box, HYPRE_Int boxnum, HYPRE_Int outside ); + +HYPRE_Int +hypre_StructVectorClearGhostValues_flt( hypre_StructVector *vector ); +HYPRE_Int +hypre_StructVectorClearGhostValues_dbl( hypre_StructVector *vector ); +HYPRE_Int +hypre_StructVectorClearGhostValues_long_dbl( hypre_StructVector *vector ); + +HYPRE_Int +hypre_StructVectorClearValues_flt( hypre_StructVector *vector, hypre_Index grid_index, HYPRE_Int boxnum, HYPRE_Int outside ); +HYPRE_Int +hypre_StructVectorClearValues_dbl( hypre_StructVector *vector, hypre_Index grid_index, HYPRE_Int boxnum, HYPRE_Int outside ); +HYPRE_Int +hypre_StructVectorClearValues_long_dbl( hypre_StructVector *vector, hypre_Index grid_index, HYPRE_Int boxnum, HYPRE_Int outside ); + +hypre_StructVector * +hypre_StructVectorClone_flt( hypre_StructVector *vector ); +hypre_StructVector * +hypre_StructVectorClone_dbl( hypre_StructVector *vector ); +hypre_StructVector * +hypre_StructVectorClone_long_dbl( hypre_StructVector *vector ); + +HYPRE_Int +hypre_StructVectorComputeDataSpace_flt( hypre_StructVector *vector, hypre_IndexRef stride, HYPRE_Int *num_ghost, hypre_BoxArray **data_space_ptr ); +HYPRE_Int +hypre_StructVectorComputeDataSpace_dbl( hypre_StructVector *vector, hypre_IndexRef stride, HYPRE_Int *num_ghost, hypre_BoxArray **data_space_ptr ); +HYPRE_Int +hypre_StructVectorComputeDataSpace_long_dbl( hypre_StructVector *vector, hypre_IndexRef stride, HYPRE_Int *num_ghost, hypre_BoxArray **data_space_ptr ); + +hypre_StructVector * +hypre_StructVectorCreate_flt( MPI_Comm comm, hypre_StructGrid *grid ); +hypre_StructVector * +hypre_StructVectorCreate_dbl( MPI_Comm comm, hypre_StructGrid *grid ); +hypre_StructVector * +hypre_StructVectorCreate_long_dbl( MPI_Comm comm, hypre_StructGrid *grid ); + +HYPRE_Int +hypre_StructVectorDestroy_flt( hypre_StructVector *vector ); +HYPRE_Int +hypre_StructVectorDestroy_dbl( hypre_StructVector *vector ); +HYPRE_Int +hypre_StructVectorDestroy_long_dbl( hypre_StructVector *vector ); + +HYPRE_Int +hypre_StructVectorForget_flt( hypre_StructVector *vector ); +HYPRE_Int +hypre_StructVectorForget_dbl( hypre_StructVector *vector ); +HYPRE_Int +hypre_StructVectorForget_long_dbl( hypre_StructVector *vector ); + +hypre_CommPkg * +hypre_StructVectorGetMigrateCommPkg_flt( hypre_StructVector *from_vector, hypre_StructVector *to_vector ); +hypre_CommPkg * +hypre_StructVectorGetMigrateCommPkg_dbl( hypre_StructVector *from_vector, hypre_StructVector *to_vector ); +hypre_CommPkg * +hypre_StructVectorGetMigrateCommPkg_long_dbl( hypre_StructVector *from_vector, hypre_StructVector *to_vector ); + +HYPRE_Int +hypre_StructVectorInitialize_flt( hypre_StructVector *vector, HYPRE_Int zero_init ); +HYPRE_Int +hypre_StructVectorInitialize_dbl( hypre_StructVector *vector, HYPRE_Int zero_init ); +HYPRE_Int +hypre_StructVectorInitialize_long_dbl( hypre_StructVector *vector, HYPRE_Int zero_init ); + +HYPRE_Int +hypre_StructVectorInitializeData_flt( hypre_StructVector *vector, hypre_float *data ); +HYPRE_Int +hypre_StructVectorInitializeData_dbl( hypre_StructVector *vector, hypre_double *data ); +HYPRE_Int +hypre_StructVectorInitializeData_long_dbl( hypre_StructVector *vector, hypre_long_double *data ); + +HYPRE_Int +hypre_StructVectorInitializeShell_flt( hypre_StructVector *vector ); +HYPRE_Int +hypre_StructVectorInitializeShell_dbl( hypre_StructVector *vector ); +HYPRE_Int +hypre_StructVectorInitializeShell_long_dbl( hypre_StructVector *vector ); + +HYPRE_Int +hypre_StructVectorMapCommInfo_flt( hypre_StructVector *vector, hypre_CommInfo *comm_info ); +HYPRE_Int +hypre_StructVectorMapCommInfo_dbl( hypre_StructVector *vector, hypre_CommInfo *comm_info ); +HYPRE_Int +hypre_StructVectorMapCommInfo_long_dbl( hypre_StructVector *vector, hypre_CommInfo *comm_info ); + +HYPRE_Int +hypre_StructVectorMapDataBox_flt( hypre_StructVector *vector, hypre_Box *dbox ); +HYPRE_Int +hypre_StructVectorMapDataBox_dbl( hypre_StructVector *vector, hypre_Box *dbox ); +HYPRE_Int +hypre_StructVectorMapDataBox_long_dbl( hypre_StructVector *vector, hypre_Box *dbox ); + +HYPRE_Int +hypre_StructVectorMapDataIndex_flt( hypre_StructVector *vector, hypre_Index dindex ); +HYPRE_Int +hypre_StructVectorMapDataIndex_dbl( hypre_StructVector *vector, hypre_Index dindex ); +HYPRE_Int +hypre_StructVectorMapDataIndex_long_dbl( hypre_StructVector *vector, hypre_Index dindex ); + +HYPRE_Int +hypre_StructVectorMapDataStride_flt( hypre_StructVector *vector, hypre_Index dstride ); +HYPRE_Int +hypre_StructVectorMapDataStride_dbl( hypre_StructVector *vector, hypre_Index dstride ); +HYPRE_Int +hypre_StructVectorMapDataStride_long_dbl( hypre_StructVector *vector, hypre_Index dstride ); + +HYPRE_Int +hypre_StructVectorMigrate_flt( hypre_CommPkg *comm_pkg, hypre_StructVector *from_vector, hypre_StructVector *to_vector ); +HYPRE_Int +hypre_StructVectorMigrate_dbl( hypre_CommPkg *comm_pkg, hypre_StructVector *from_vector, hypre_StructVector *to_vector ); +HYPRE_Int +hypre_StructVectorMigrate_long_dbl( hypre_CommPkg *comm_pkg, hypre_StructVector *from_vector, hypre_StructVector *to_vector ); + +HYPRE_Int +hypre_StructVectorNeedResize_flt( hypre_StructVector *vector, hypre_BoxArray *data_space ); +HYPRE_Int +hypre_StructVectorNeedResize_dbl( hypre_StructVector *vector, hypre_BoxArray *data_space ); +HYPRE_Int +hypre_StructVectorNeedResize_long_dbl( hypre_StructVector *vector, hypre_BoxArray *data_space ); + +HYPRE_Int +hypre_StructVectorPointwiseDivision_flt( hypre_StructVector *x, hypre_StructVector *y, hypre_StructVector **z_ptr ); +HYPRE_Int +hypre_StructVectorPointwiseDivision_dbl( hypre_StructVector *x, hypre_StructVector *y, hypre_StructVector **z_ptr ); +HYPRE_Int +hypre_StructVectorPointwiseDivision_long_dbl( hypre_StructVector *x, hypre_StructVector *y, hypre_StructVector **z_ptr ); + +HYPRE_Int +hypre_StructVectorPointwiseDivpy_flt( hypre_float alpha, hypre_StructVector *x, hypre_StructVector *z, hypre_float beta, hypre_StructVector *y ); +HYPRE_Int +hypre_StructVectorPointwiseDivpy_dbl( hypre_double alpha, hypre_StructVector *x, hypre_StructVector *z, hypre_double beta, hypre_StructVector *y ); +HYPRE_Int +hypre_StructVectorPointwiseDivpy_long_dbl( hypre_long_double alpha, hypre_StructVector *x, hypre_StructVector *z, hypre_long_double beta, hypre_StructVector *y ); + +HYPRE_Int +hypre_StructVectorPointwiseInverse_flt( hypre_StructVector *x, hypre_StructVector **y_ptr ); +HYPRE_Int +hypre_StructVectorPointwiseInverse_dbl( hypre_StructVector *x, hypre_StructVector **y_ptr ); +HYPRE_Int +hypre_StructVectorPointwiseInverse_long_dbl( hypre_StructVector *x, hypre_StructVector **y_ptr ); + +HYPRE_Int +hypre_StructVectorPointwiseProduct_flt( hypre_StructVector *x, hypre_StructVector *y, hypre_StructVector **z_ptr ); +HYPRE_Int +hypre_StructVectorPointwiseProduct_dbl( hypre_StructVector *x, hypre_StructVector *y, hypre_StructVector **z_ptr ); +HYPRE_Int +hypre_StructVectorPointwiseProduct_long_dbl( hypre_StructVector *x, hypre_StructVector *y, hypre_StructVector **z_ptr ); + +HYPRE_Int +hypre_StructVectorPrint_flt( const char *filename, hypre_StructVector *vector, HYPRE_Int all ); +HYPRE_Int +hypre_StructVectorPrint_dbl( const char *filename, hypre_StructVector *vector, HYPRE_Int all ); +HYPRE_Int +hypre_StructVectorPrint_long_dbl( const char *filename, hypre_StructVector *vector, HYPRE_Int all ); + +HYPRE_Int +hypre_StructVectorPrintData_flt( FILE *file, hypre_StructVector *vector, HYPRE_Int all ); +HYPRE_Int +hypre_StructVectorPrintData_dbl( FILE *file, hypre_StructVector *vector, HYPRE_Int all ); +HYPRE_Int +hypre_StructVectorPrintData_long_dbl( FILE *file, hypre_StructVector *vector, HYPRE_Int all ); + +hypre_StructVector * +hypre_StructVectorRead_flt( MPI_Comm comm, const char *filename, HYPRE_Int *num_ghost ); +hypre_StructVector * +hypre_StructVectorRead_dbl( MPI_Comm comm, const char *filename, HYPRE_Int *num_ghost ); +hypre_StructVector * +hypre_StructVectorRead_long_dbl( MPI_Comm comm, const char *filename, HYPRE_Int *num_ghost ); + +HYPRE_Int +hypre_StructVectorReadData_flt( FILE *file, hypre_StructVector *vector ); +HYPRE_Int +hypre_StructVectorReadData_dbl( FILE *file, hypre_StructVector *vector ); +HYPRE_Int +hypre_StructVectorReadData_long_dbl( FILE *file, hypre_StructVector *vector ); + +HYPRE_Int +hypre_StructVectorRebase_flt( hypre_StructVector *vector, hypre_StructGrid *grid, hypre_Index stride ); +HYPRE_Int +hypre_StructVectorRebase_dbl( hypre_StructVector *vector, hypre_StructGrid *grid, hypre_Index stride ); +HYPRE_Int +hypre_StructVectorRebase_long_dbl( hypre_StructVector *vector, hypre_StructGrid *grid, hypre_Index stride ); + +hypre_StructVector * +hypre_StructVectorRef_flt( hypre_StructVector *vector ); +hypre_StructVector * +hypre_StructVectorRef_dbl( hypre_StructVector *vector ); +hypre_StructVector * +hypre_StructVectorRef_long_dbl( hypre_StructVector *vector ); + +HYPRE_Int +hypre_StructVectorResize_flt( hypre_StructVector *vector, hypre_BoxArray *data_space ); +HYPRE_Int +hypre_StructVectorResize_dbl( hypre_StructVector *vector, hypre_BoxArray *data_space ); +HYPRE_Int +hypre_StructVectorResize_long_dbl( hypre_StructVector *vector, hypre_BoxArray *data_space ); + +HYPRE_Int +hypre_StructVectorRestore_flt( hypre_StructVector *vector ); +HYPRE_Int +hypre_StructVectorRestore_dbl( hypre_StructVector *vector ); +HYPRE_Int +hypre_StructVectorRestore_long_dbl( hypre_StructVector *vector ); + +HYPRE_Int +hypre_StructVectorScaleValues_flt( hypre_StructVector *vector, hypre_float factor ); +HYPRE_Int +hypre_StructVectorScaleValues_dbl( hypre_StructVector *vector, hypre_double factor ); +HYPRE_Int +hypre_StructVectorScaleValues_long_dbl( hypre_StructVector *vector, hypre_long_double factor ); + +HYPRE_Int +hypre_StructVectorSetBoxValues_flt( hypre_StructVector *vector, hypre_Box *set_box, hypre_Box *value_box, hypre_float *values, HYPRE_Int action, HYPRE_Int boxnum, HYPRE_Int outside ); +HYPRE_Int +hypre_StructVectorSetBoxValues_dbl( hypre_StructVector *vector, hypre_Box *set_box, hypre_Box *value_box, hypre_double *values, HYPRE_Int action, HYPRE_Int boxnum, HYPRE_Int outside ); +HYPRE_Int +hypre_StructVectorSetBoxValues_long_dbl( hypre_StructVector *vector, hypre_Box *set_box, hypre_Box *value_box, hypre_long_double *values, HYPRE_Int action, HYPRE_Int boxnum, HYPRE_Int outside ); + +HYPRE_Int +hypre_StructVectorSetConstantValues_flt( hypre_StructVector *vector, hypre_float value ); +HYPRE_Int +hypre_StructVectorSetConstantValues_dbl( hypre_StructVector *vector, hypre_double value ); +HYPRE_Int +hypre_StructVectorSetConstantValues_long_dbl( hypre_StructVector *vector, hypre_long_double value ); + +HYPRE_Int +hypre_StructVectorSetDataSize_flt( hypre_StructVector *vector, HYPRE_Int *data_size, HYPRE_Int *data_host_size ); +HYPRE_Int +hypre_StructVectorSetDataSize_dbl( hypre_StructVector *vector, HYPRE_Int *data_size, HYPRE_Int *data_host_size ); +HYPRE_Int +hypre_StructVectorSetDataSize_long_dbl( hypre_StructVector *vector, HYPRE_Int *data_size, HYPRE_Int *data_host_size ); + +HYPRE_Int +hypre_StructVectorSetMemoryMode_flt( hypre_StructVector *vector, HYPRE_Int memory_mode ); +HYPRE_Int +hypre_StructVectorSetMemoryMode_dbl( hypre_StructVector *vector, HYPRE_Int memory_mode ); +HYPRE_Int +hypre_StructVectorSetMemoryMode_long_dbl( hypre_StructVector *vector, HYPRE_Int memory_mode ); + +HYPRE_Int +hypre_StructVectorSetNumGhost_flt( hypre_StructVector *vector, HYPRE_Int *num_ghost ); +HYPRE_Int +hypre_StructVectorSetNumGhost_dbl( hypre_StructVector *vector, HYPRE_Int *num_ghost ); +HYPRE_Int +hypre_StructVectorSetNumGhost_long_dbl( hypre_StructVector *vector, HYPRE_Int *num_ghost ); + +HYPRE_Int +hypre_StructVectorSetRandomValues_flt( hypre_StructVector *vector, HYPRE_Int seed ); +HYPRE_Int +hypre_StructVectorSetRandomValues_dbl( hypre_StructVector *vector, HYPRE_Int seed ); +HYPRE_Int +hypre_StructVectorSetRandomValues_long_dbl( hypre_StructVector *vector, HYPRE_Int seed ); + +HYPRE_Int +hypre_StructVectorSetStride_flt( hypre_StructVector *vector, hypre_IndexRef stride ); +HYPRE_Int +hypre_StructVectorSetStride_dbl( hypre_StructVector *vector, hypre_IndexRef stride ); +HYPRE_Int +hypre_StructVectorSetStride_long_dbl( hypre_StructVector *vector, hypre_IndexRef stride ); + +HYPRE_Int +hypre_StructVectorSetValues_flt( hypre_StructVector *vector, hypre_Index grid_index, hypre_float *values, HYPRE_Int action, HYPRE_Int boxnum, HYPRE_Int outside ); +HYPRE_Int +hypre_StructVectorSetValues_dbl( hypre_StructVector *vector, hypre_Index grid_index, hypre_double *values, HYPRE_Int action, HYPRE_Int boxnum, HYPRE_Int outside ); +HYPRE_Int +hypre_StructVectorSetValues_long_dbl( hypre_StructVector *vector, hypre_Index grid_index, hypre_long_double *values, HYPRE_Int action, HYPRE_Int boxnum, HYPRE_Int outside ); + +HYPRE_Int +hypre_StructVectorUnMapDataBox_flt( hypre_StructVector *vector, hypre_Box *dbox ); +HYPRE_Int +hypre_StructVectorUnMapDataBox_dbl( hypre_StructVector *vector, hypre_Box *dbox ); +HYPRE_Int +hypre_StructVectorUnMapDataBox_long_dbl( hypre_StructVector *vector, hypre_Box *dbox ); + +HYPRE_Int +hypre_StructVectorUnMapDataIndex_flt( hypre_StructVector *vector, hypre_Index dindex ); +HYPRE_Int +hypre_StructVectorUnMapDataIndex_dbl( hypre_StructVector *vector, hypre_Index dindex ); +HYPRE_Int +hypre_StructVectorUnMapDataIndex_long_dbl( hypre_StructVector *vector, hypre_Index dindex ); + +HYPRE_Int +hypre_StructVectorUnMapDataStride_flt( hypre_StructVector *vector, hypre_Index dstride ); +HYPRE_Int +hypre_StructVectorUnMapDataStride_dbl( hypre_StructVector *vector, hypre_Index dstride ); +HYPRE_Int +hypre_StructVectorUnMapDataStride_long_dbl( hypre_StructVector *vector, hypre_Index dstride ); + +HYPRE_Int +hypre_SubtractBoxArrays_flt( hypre_BoxArray *box_array1, hypre_BoxArray *box_array2, hypre_BoxArray *tmp_box_array ); +HYPRE_Int +hypre_SubtractBoxArrays_dbl( hypre_BoxArray *box_array1, hypre_BoxArray *box_array2, hypre_BoxArray *tmp_box_array ); +HYPRE_Int +hypre_SubtractBoxArrays_long_dbl( hypre_BoxArray *box_array1, hypre_BoxArray *box_array2, hypre_BoxArray *tmp_box_array ); + +HYPRE_Int +hypre_SubtractBoxes_flt( hypre_Box *box1, hypre_Box *box2, hypre_BoxArray *box_array ); +HYPRE_Int +hypre_SubtractBoxes_dbl( hypre_Box *box1, hypre_Box *box2, hypre_BoxArray *box_array ); +HYPRE_Int +hypre_SubtractBoxes_long_dbl( hypre_Box *box1, hypre_Box *box2, hypre_BoxArray *box_array ); + +HYPRE_Int +hypre_SubtractIndexes_flt( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim, hypre_Index result ); +HYPRE_Int +hypre_SubtractIndexes_dbl( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim, hypre_Index result ); +HYPRE_Int +hypre_SubtractIndexes_long_dbl( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim, hypre_Index result ); + +HYPRE_Int +hypre_UnionBoxes_flt( hypre_BoxArray *boxes ); +HYPRE_Int +hypre_UnionBoxes_dbl( hypre_BoxArray *boxes ); +HYPRE_Int +hypre_UnionBoxes_long_dbl( hypre_BoxArray *boxes ); + +HYPRE_Real +hypre_doubleBoxVolume_flt( hypre_Box *box ); +HYPRE_Real +hypre_doubleBoxVolume_dbl( hypre_Box *box ); +HYPRE_Real +hypre_doubleBoxVolume_long_dbl( hypre_Box *box ); + + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + + + +#endif + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/src/struct_mv/_hypre_struct_mv_mup_def.h b/src/struct_mv/_hypre_struct_mv_mup_def.h new file mode 100644 index 0000000000..0c1b11190a --- /dev/null +++ b/src/struct_mv/_hypre_struct_mv_mup_def.h @@ -0,0 +1,544 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#ifndef hypre_STRUCT_MV_MUP_DEF_HEADER +#define hypre_STRUCT_MV_MUP_DEF_HEADER + +#include "_hypre_mup_def.h" + +#define HYPRE_CommPkgDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_CommPkgDestroy ) +#define HYPRE_StructGridAssemble HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructGridAssemble ) +#define HYPRE_StructGridCoarsen HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructGridCoarsen ) +#define HYPRE_StructGridCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructGridCreate ) +#define HYPRE_StructGridDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructGridDestroy ) +#define HYPRE_StructGridPrintVTK HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructGridPrintVTK ) +#define HYPRE_StructGridProjectBox HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructGridProjectBox ) +#define HYPRE_StructGridSetExtents HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructGridSetExtents ) +#define HYPRE_StructGridSetNumGhost HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructGridSetNumGhost ) +#define HYPRE_StructGridSetPeriodic HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructGridSetPeriodic ) +#define HYPRE_StructMatrixAddToBoxValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructMatrixAddToBoxValues ) +#define HYPRE_StructMatrixAddToBoxValues2 HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructMatrixAddToBoxValues2 ) +#define HYPRE_StructMatrixAddToConstantValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructMatrixAddToConstantValues ) +#define HYPRE_StructMatrixAddToValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructMatrixAddToValues ) +#define HYPRE_StructMatrixAssemble HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructMatrixAssemble ) +#define HYPRE_StructMatrixClearBoundary HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructMatrixClearBoundary ) +#define HYPRE_StructMatrixCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructMatrixCreate ) +#define HYPRE_StructMatrixDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructMatrixDestroy ) +#define HYPRE_StructMatrixGetBoxValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructMatrixGetBoxValues ) +#define HYPRE_StructMatrixGetBoxValues2 HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructMatrixGetBoxValues2 ) +#define HYPRE_StructMatrixGetGrid HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructMatrixGetGrid ) +#define HYPRE_StructMatrixGetValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructMatrixGetValues ) +#define HYPRE_StructMatrixInitialize HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructMatrixInitialize ) +#define HYPRE_StructMatrixMatmat HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructMatrixMatmat ) +#define HYPRE_StructMatrixMatvec HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructMatrixMatvec ) +#define HYPRE_StructMatrixMatvecT HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructMatrixMatvecT ) +#define HYPRE_StructMatrixPrint HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructMatrixPrint ) +#define HYPRE_StructMatrixRead HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructMatrixRead ) +#define HYPRE_StructMatrixSetBoxValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructMatrixSetBoxValues ) +#define HYPRE_StructMatrixSetBoxValues2 HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructMatrixSetBoxValues2 ) +#define HYPRE_StructMatrixSetConstantEntries HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructMatrixSetConstantEntries ) +#define HYPRE_StructMatrixSetConstantValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructMatrixSetConstantValues ) +#define HYPRE_StructMatrixSetDomainStride HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructMatrixSetDomainStride ) +#define HYPRE_StructMatrixSetNumGhost HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructMatrixSetNumGhost ) +#define HYPRE_StructMatrixSetRangeStride HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructMatrixSetRangeStride ) +#define HYPRE_StructMatrixSetSymmetric HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructMatrixSetSymmetric ) +#define HYPRE_StructMatrixSetTranspose HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructMatrixSetTranspose ) +#define HYPRE_StructMatrixSetValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructMatrixSetValues ) +#define HYPRE_StructStencilCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructStencilCreate ) +#define HYPRE_StructStencilDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructStencilDestroy ) +#define HYPRE_StructStencilSetElement HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructStencilSetElement ) +#define HYPRE_StructStencilSetEntry HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructStencilSetEntry ) +#define HYPRE_StructVectorAddToBoxValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructVectorAddToBoxValues ) +#define HYPRE_StructVectorAddToBoxValues2 HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructVectorAddToBoxValues2 ) +#define HYPRE_StructVectorAddToValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructVectorAddToValues ) +#define HYPRE_StructVectorAssemble HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructVectorAssemble ) +#define HYPRE_StructVectorAxpy HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructVectorAxpy ) +#define HYPRE_StructVectorClone HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructVectorClone ) +#define HYPRE_StructVectorCopy HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructVectorCopy ) +#define HYPRE_StructVectorCreate HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructVectorCreate ) +#define HYPRE_StructVectorDestroy HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructVectorDestroy ) +#define HYPRE_StructVectorGetBoxValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructVectorGetBoxValues ) +#define HYPRE_StructVectorGetBoxValues2 HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructVectorGetBoxValues2 ) +#define HYPRE_StructVectorGetMigrateCommPkg HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructVectorGetMigrateCommPkg ) +#define HYPRE_StructVectorGetValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructVectorGetValues ) +#define HYPRE_StructVectorInitialize HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructVectorInitialize ) +#define HYPRE_StructVectorInnerProd HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructVectorInnerProd ) +#define HYPRE_StructVectorMigrate HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructVectorMigrate ) +#define HYPRE_StructVectorPrint HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructVectorPrint ) +#define HYPRE_StructVectorRead HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructVectorRead ) +#define HYPRE_StructVectorScale HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructVectorScale ) +#define HYPRE_StructVectorScaleValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructVectorScaleValues ) +#define HYPRE_StructVectorSetBoxValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructVectorSetBoxValues ) +#define HYPRE_StructVectorSetBoxValues2 HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructVectorSetBoxValues2 ) +#define HYPRE_StructVectorSetConstantValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructVectorSetConstantValues ) +#define HYPRE_StructVectorSetNumGhost HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructVectorSetNumGhost ) +#define HYPRE_StructVectorSetRandomValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructVectorSetRandomValues ) +#define HYPRE_StructVectorSetStride HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructVectorSetStride ) +#define HYPRE_StructVectorSetValues HYPRE_MULTIPRECISION_FUNC ( HYPRE_StructVectorSetValues ) +#define hypre_APFillResponseStructAssumedPart HYPRE_FIXEDPRECISION_FUNC ( hypre_APFillResponseStructAssumedPart ) +#define hypre_APFindMyBoxesInRegions HYPRE_FIXEDPRECISION_FUNC ( hypre_APFindMyBoxesInRegions ) +#define hypre_APGetAllBoxesInRegions HYPRE_FIXEDPRECISION_FUNC ( hypre_APGetAllBoxesInRegions ) +#define hypre_APPruneRegions HYPRE_FIXEDPRECISION_FUNC ( hypre_APPruneRegions ) +#define hypre_APRefineRegionsByVol HYPRE_FIXEDPRECISION_FUNC ( hypre_APRefineRegionsByVol ) +#define hypre_APShrinkRegions HYPRE_FIXEDPRECISION_FUNC ( hypre_APShrinkRegions ) +#define hypre_APSubdivideRegion HYPRE_FIXEDPRECISION_FUNC ( hypre_APSubdivideRegion ) +#define hypre_AddIndexes HYPRE_FIXEDPRECISION_FUNC ( hypre_AddIndexes ) +#define hypre_AppendBox HYPRE_FIXEDPRECISION_FUNC ( hypre_AppendBox ) +#define hypre_AppendBoxArray HYPRE_FIXEDPRECISION_FUNC ( hypre_AppendBoxArray ) +#define hypre_BoxArrayArrayClone HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxArrayArrayClone ) +#define hypre_BoxArrayArrayCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxArrayArrayCreate ) +#define hypre_BoxArrayArrayDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxArrayArrayDestroy ) +#define hypre_BoxArrayArrayPrint HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxArrayArrayPrint ) +#define hypre_BoxArrayArrayPrintToFile HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxArrayArrayPrintToFile ) +#define hypre_BoxArrayClone HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxArrayClone ) +#define hypre_BoxArrayCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxArrayCreate ) +#define hypre_BoxArrayCreateFromIndices HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxArrayCreateFromIndices ) +#define hypre_BoxArrayDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxArrayDestroy ) +#define hypre_BoxArrayInBoxArray HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxArrayInBoxArray ) +#define hypre_BoxArrayPrint HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxArrayPrint ) +#define hypre_BoxArrayPrintToFile HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxArrayPrintToFile ) +#define hypre_BoxArrayReadFromFile HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxArrayReadFromFile ) +#define hypre_BoxArraySetSize HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxArraySetSize ) +#define hypre_BoxArrayVolume HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxArrayVolume ) +#define hypre_BoxArraysEqual HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxArraysEqual ) +#define hypre_BoxBTNodeCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxBTNodeCreate ) +#define hypre_BoxBTNodeDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxBTNodeDestroy ) +#define hypre_BoxBTNodeInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxBTNodeInitialize ) +#define hypre_BoxBTNodeSetIndices HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxBTNodeSetIndices ) +#define hypre_BoxBTQueueCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxBTQueueCreate ) +#define hypre_BoxBTQueueDelete HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxBTQueueDelete ) +#define hypre_BoxBTQueueDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxBTQueueDestroy ) +#define hypre_BoxBTQueueInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxBTQueueInitialize ) +#define hypre_BoxBTQueueInsert HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxBTQueueInsert ) +#define hypre_BoxBTStackCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxBTStackCreate ) +#define hypre_BoxBTStackDelete HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxBTStackDelete ) +#define hypre_BoxBTStackDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxBTStackDestroy ) +#define hypre_BoxBTStackInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxBTStackInitialize ) +#define hypre_BoxBTStackInsert HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxBTStackInsert ) +#define hypre_BoxBinTreeCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxBinTreeCreate ) +#define hypre_BoxBinTreeDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxBinTreeDestroy ) +#define hypre_BoxBinTreeInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxBinTreeInitialize ) +#define hypre_BoxBoundaryDG HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxBoundaryDG ) +#define hypre_BoxBoundaryG HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxBoundaryG ) +#define hypre_BoxBoundaryIntersect HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxBoundaryIntersect ) +#define hypre_BoxClone HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxClone ) +#define hypre_BoxCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxCreate ) +#define hypre_BoxDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxDestroy ) +#define hypre_BoxGetSize HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxGetSize ) +#define hypre_BoxGetStrideSize HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxGetStrideSize ) +#define hypre_BoxGetStrideVolume HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxGetStrideVolume ) +#define hypre_BoxGrowByArray HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxGrowByArray ) +#define hypre_BoxGrowByBox HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxGrowByBox ) +#define hypre_BoxGrowByIndex HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxGrowByIndex ) +#define hypre_BoxGrowByValue HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxGrowByValue ) +#define hypre_BoxInBox HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxInBox ) +#define hypre_BoxIndexRank HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxIndexRank ) +#define hypre_BoxInit HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxInit ) +#define hypre_BoxManAddEntry HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxManAddEntry ) +#define hypre_BoxManAssemble HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxManAssemble ) +#define hypre_BoxManCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxManCreate ) +#define hypre_BoxManDeleteMultipleEntriesAndInfo HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxManDeleteMultipleEntriesAndInfo ) +#define hypre_BoxManDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxManDestroy ) +#define hypre_BoxManEntryCopy HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxManEntryCopy ) +#define hypre_BoxManEntryGetExtents HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxManEntryGetExtents ) +#define hypre_BoxManEntryGetInfo HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxManEntryGetInfo ) +#define hypre_BoxManEntryGetStride HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxManEntryGetStride ) +#define hypre_BoxManGatherEntries HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxManGatherEntries ) +#define hypre_BoxManGetAllEntries HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxManGetAllEntries ) +#define hypre_BoxManGetAllEntriesBoxes HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxManGetAllEntriesBoxes ) +#define hypre_BoxManGetAllEntriesBoxesProc HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxManGetAllEntriesBoxesProc ) +#define hypre_BoxManGetAllGlobalKnown HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxManGetAllGlobalKnown ) +#define hypre_BoxManGetAssumedPartition HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxManGetAssumedPartition ) +#define hypre_BoxManGetEntry HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxManGetEntry ) +#define hypre_BoxManGetGlobalIsGatherCalled HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxManGetGlobalIsGatherCalled ) +#define hypre_BoxManGetIsEntriesSort HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxManGetIsEntriesSort ) +#define hypre_BoxManGetLocalEntriesBoxes HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxManGetLocalEntriesBoxes ) +#define hypre_BoxManIncSize HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxManIncSize ) +#define hypre_BoxManIntersect HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxManIntersect ) +#define hypre_BoxManSetAllGlobalKnown HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxManSetAllGlobalKnown ) +#define hypre_BoxManSetAssumedPartition HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxManSetAssumedPartition ) +#define hypre_BoxManSetBoundingBox HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxManSetBoundingBox ) +#define hypre_BoxManSetIsEntriesSort HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxManSetIsEntriesSort ) +#define hypre_BoxManSetNumGhost HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxManSetNumGhost ) +#define hypre_BoxMaxSize HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxMaxSize ) +#define hypre_BoxNnodes HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxNnodes ) +#define hypre_BoxOffsetDistance HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxOffsetDistance ) +#define hypre_BoxPartialVolume HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxPartialVolume ) +#define hypre_BoxPrint HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxPrint ) +#define hypre_BoxPrintDebug HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxPrintDebug ) +#define hypre_BoxRankIndex HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxRankIndex ) +#define hypre_BoxRead HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxRead ) +#define hypre_BoxSetExtents HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxSetExtents ) +#define hypre_BoxShiftNeg HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxShiftNeg ) +#define hypre_BoxShiftPos HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxShiftPos ) +#define hypre_BoxSplit HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxSplit ) +#define hypre_BoxStrideVolume HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxStrideVolume ) +#define hypre_BoxVolume HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxVolume ) +#define hypre_BoxesEqual HYPRE_FIXEDPRECISION_FUNC ( hypre_BoxesEqual ) +#define hypre_CoarsenBox HYPRE_FIXEDPRECISION_FUNC ( hypre_CoarsenBox ) +#define hypre_CoarsenBoxArray HYPRE_FIXEDPRECISION_FUNC ( hypre_CoarsenBoxArray ) +#define hypre_CoarsenBoxArrayArray HYPRE_FIXEDPRECISION_FUNC ( hypre_CoarsenBoxArrayArray ) +#define hypre_CoarsenBoxArrayArrayOutward HYPRE_FIXEDPRECISION_FUNC ( hypre_CoarsenBoxArrayArrayOutward ) +#define hypre_CommBlockSetEntries HYPRE_FIXEDPRECISION_FUNC ( hypre_CommBlockSetEntries ) +#define hypre_CommBlockSetEntry HYPRE_FIXEDPRECISION_FUNC ( hypre_CommBlockSetEntry ) +#define hypre_CommInfoClone HYPRE_FIXEDPRECISION_FUNC ( hypre_CommInfoClone ) +#define hypre_CommInfoCoarsen HYPRE_FIXEDPRECISION_FUNC ( hypre_CommInfoCoarsen ) +#define hypre_CommInfoCoarsenRecv HYPRE_FIXEDPRECISION_FUNC ( hypre_CommInfoCoarsenRecv ) +#define hypre_CommInfoCoarsenSend HYPRE_FIXEDPRECISION_FUNC ( hypre_CommInfoCoarsenSend ) +#define hypre_CommInfoCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_CommInfoCreate ) +#define hypre_CommInfoDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_CommInfoDestroy ) +#define hypre_CommInfoGetTransforms HYPRE_FIXEDPRECISION_FUNC ( hypre_CommInfoGetTransforms ) +#define hypre_CommInfoProjectRecv HYPRE_FIXEDPRECISION_FUNC ( hypre_CommInfoProjectRecv ) +#define hypre_CommInfoProjectSend HYPRE_FIXEDPRECISION_FUNC ( hypre_CommInfoProjectSend ) +#define hypre_CommInfoRefine HYPRE_FIXEDPRECISION_FUNC ( hypre_CommInfoRefine ) +#define hypre_CommInfoRefineRecv HYPRE_FIXEDPRECISION_FUNC ( hypre_CommInfoRefineRecv ) +#define hypre_CommInfoRefineSend HYPRE_FIXEDPRECISION_FUNC ( hypre_CommInfoRefineSend ) +#define hypre_CommInfoSetTransforms HYPRE_FIXEDPRECISION_FUNC ( hypre_CommInfoSetTransforms ) +#define hypre_CommPkgAgglomData HYPRE_FIXEDPRECISION_FUNC ( hypre_CommPkgAgglomData ) +#define hypre_CommPkgAgglomDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_CommPkgAgglomDestroy ) +#define hypre_CommPkgAgglomerate HYPRE_FIXEDPRECISION_FUNC ( hypre_CommPkgAgglomerate ) +#define hypre_CommPkgCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_CommPkgCreate ) +#define hypre_CommPkgDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_CommPkgDestroy ) +#define hypre_CommPkgSetPrefixSizes HYPRE_FIXEDPRECISION_FUNC ( hypre_CommPkgSetPrefixSizes ) +#define hypre_CommStencilCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_CommStencilCreate ) +#define hypre_CommStencilCreateNumGhost HYPRE_FIXEDPRECISION_FUNC ( hypre_CommStencilCreateNumGhost ) +#define hypre_CommStencilDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_CommStencilDestroy ) +#define hypre_CommStencilSetEntry HYPRE_FIXEDPRECISION_FUNC ( hypre_CommStencilSetEntry ) +#define hypre_ComputeBoxnums HYPRE_FIXEDPRECISION_FUNC ( hypre_ComputeBoxnums ) +#define hypre_ComputeCoarseOriginStride HYPRE_FIXEDPRECISION_FUNC ( hypre_ComputeCoarseOriginStride ) +#define hypre_ComputeInfoCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_ComputeInfoCreate ) +#define hypre_ComputeInfoDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_ComputeInfoDestroy ) +#define hypre_ComputeInfoProjectComp HYPRE_FIXEDPRECISION_FUNC ( hypre_ComputeInfoProjectComp ) +#define hypre_ComputeInfoProjectRecv HYPRE_FIXEDPRECISION_FUNC ( hypre_ComputeInfoProjectRecv ) +#define hypre_ComputeInfoProjectSend HYPRE_FIXEDPRECISION_FUNC ( hypre_ComputeInfoProjectSend ) +#define hypre_ComputePkgCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_ComputePkgCreate ) +#define hypre_ComputePkgDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_ComputePkgDestroy ) +#define hypre_ConvertToCanonicalIndex HYPRE_FIXEDPRECISION_FUNC ( hypre_ConvertToCanonicalIndex ) +#define hypre_CopyBox HYPRE_FIXEDPRECISION_FUNC ( hypre_CopyBox ) +#define hypre_CopyIndex HYPRE_FIXEDPRECISION_FUNC ( hypre_CopyIndex ) +#define hypre_CopyToCleanIndex HYPRE_FIXEDPRECISION_FUNC ( hypre_CopyToCleanIndex ) +#define hypre_CopyToIndex HYPRE_FIXEDPRECISION_FUNC ( hypre_CopyToIndex ) +#define hypre_CreateCommInfo HYPRE_FIXEDPRECISION_FUNC ( hypre_CreateCommInfo ) +#define hypre_CreateCommInfoFromGrids HYPRE_FIXEDPRECISION_FUNC ( hypre_CreateCommInfoFromGrids ) +#define hypre_CreateCommInfoFromNumGhost HYPRE_FIXEDPRECISION_FUNC ( hypre_CreateCommInfoFromNumGhost ) +#define hypre_CreateCommInfoFromStencil HYPRE_FIXEDPRECISION_FUNC ( hypre_CreateCommInfoFromStencil ) +#define hypre_CreateComputeInfo HYPRE_FIXEDPRECISION_FUNC ( hypre_CreateComputeInfo ) +#define hypre_DeleteBox HYPRE_FIXEDPRECISION_FUNC ( hypre_DeleteBox ) +#define hypre_DeleteMultipleBoxes HYPRE_FIXEDPRECISION_FUNC ( hypre_DeleteMultipleBoxes ) +#define hypre_ExchangeLocalData HYPRE_FIXEDPRECISION_FUNC ( hypre_ExchangeLocalData ) +#define hypre_FillResponseBoxManAssemble1 HYPRE_FIXEDPRECISION_FUNC ( hypre_FillResponseBoxManAssemble1 ) +#define hypre_FillResponseBoxManAssemble2 HYPRE_FIXEDPRECISION_FUNC ( hypre_FillResponseBoxManAssemble2 ) +#define hypre_FinalizeIndtComputations HYPRE_FIXEDPRECISION_FUNC ( hypre_FinalizeIndtComputations ) +#define hypre_GatherAllBoxes HYPRE_FIXEDPRECISION_FUNC ( hypre_GatherAllBoxes ) +#define hypre_GeneralBoxBoundaryIntersect HYPRE_FIXEDPRECISION_FUNC ( hypre_GeneralBoxBoundaryIntersect ) +#define hypre_IndexElementMult HYPRE_FIXEDPRECISION_FUNC ( hypre_IndexElementMult ) +#define hypre_IndexEqual HYPRE_FIXEDPRECISION_FUNC ( hypre_IndexEqual ) +#define hypre_IndexFromRank HYPRE_FIXEDPRECISION_FUNC ( hypre_IndexFromRank ) +#define hypre_IndexInBox HYPRE_FIXEDPRECISION_FUNC ( hypre_IndexInBox ) +#define hypre_IndexMax HYPRE_FIXEDPRECISION_FUNC ( hypre_IndexMax ) +#define hypre_IndexMin HYPRE_FIXEDPRECISION_FUNC ( hypre_IndexMin ) +#define hypre_IndexPrint HYPRE_FIXEDPRECISION_FUNC ( hypre_IndexPrint ) +#define hypre_IndexProd HYPRE_FIXEDPRECISION_FUNC ( hypre_IndexProd ) +#define hypre_IndexRead HYPRE_FIXEDPRECISION_FUNC ( hypre_IndexRead ) +#define hypre_IndexesEqual HYPRE_FIXEDPRECISION_FUNC ( hypre_IndexesEqual ) +#define hypre_IndexesGreater HYPRE_FIXEDPRECISION_FUNC ( hypre_IndexesGreater ) +#define hypre_IndexesGreaterEqual HYPRE_FIXEDPRECISION_FUNC ( hypre_IndexesGreaterEqual ) +#define hypre_InitializeIndtComputations HYPRE_FIXEDPRECISION_FUNC ( hypre_InitializeIndtComputations ) +#define hypre_IntersectBoxes HYPRE_FIXEDPRECISION_FUNC ( hypre_IntersectBoxes ) +#define hypre_MapToCoarseIndex HYPRE_FIXEDPRECISION_FUNC ( hypre_MapToCoarseIndex ) +#define hypre_MapToFineIndex HYPRE_FIXEDPRECISION_FUNC ( hypre_MapToFineIndex ) +#define hypre_MinUnionBoxes HYPRE_FIXEDPRECISION_FUNC ( hypre_MinUnionBoxes ) +#define hypre_PrintBoxArrayData HYPRE_FIXEDPRECISION_FUNC ( hypre_PrintBoxArrayData ) +#define hypre_ProjectBox HYPRE_FIXEDPRECISION_FUNC ( hypre_ProjectBox ) +#define hypre_ProjectBoxArray HYPRE_FIXEDPRECISION_FUNC ( hypre_ProjectBoxArray ) +#define hypre_ProjectBoxArrayArray HYPRE_FIXEDPRECISION_FUNC ( hypre_ProjectBoxArrayArray ) +#define hypre_ReadBoxArrayData HYPRE_FIXEDPRECISION_FUNC ( hypre_ReadBoxArrayData ) +#define hypre_RefineBox HYPRE_FIXEDPRECISION_FUNC ( hypre_RefineBox ) +#define hypre_RefineBoxArray HYPRE_FIXEDPRECISION_FUNC ( hypre_RefineBoxArray ) +#define hypre_RefineBoxArrayArray HYPRE_FIXEDPRECISION_FUNC ( hypre_RefineBoxArrayArray ) +#define hypre_SetIndex HYPRE_FIXEDPRECISION_FUNC ( hypre_SetIndex ) +#define hypre_SnapIndexNeg HYPRE_FIXEDPRECISION_FUNC ( hypre_SnapIndexNeg ) +#define hypre_SnapIndexPos HYPRE_FIXEDPRECISION_FUNC ( hypre_SnapIndexPos ) +#define hypre_StBoxRank HYPRE_FIXEDPRECISION_FUNC ( hypre_StBoxRank ) +#define hypre_StCoeffClone HYPRE_FIXEDPRECISION_FUNC ( hypre_StCoeffClone ) +#define hypre_StCoeffCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_StCoeffCreate ) +#define hypre_StCoeffDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_StCoeffDestroy ) +#define hypre_StCoeffMult HYPRE_FIXEDPRECISION_FUNC ( hypre_StCoeffMult ) +#define hypre_StCoeffPrint HYPRE_FIXEDPRECISION_FUNC ( hypre_StCoeffPrint ) +#define hypre_StCoeffPush HYPRE_FIXEDPRECISION_FUNC ( hypre_StCoeffPush ) +#define hypre_StCoeffShift HYPRE_FIXEDPRECISION_FUNC ( hypre_StCoeffShift ) +#define hypre_StIndexCopy HYPRE_FIXEDPRECISION_FUNC ( hypre_StIndexCopy ) +#define hypre_StIndexNegate HYPRE_FIXEDPRECISION_FUNC ( hypre_StIndexNegate ) +#define hypre_StIndexPrint HYPRE_FIXEDPRECISION_FUNC ( hypre_StIndexPrint ) +#define hypre_StIndexShift HYPRE_FIXEDPRECISION_FUNC ( hypre_StIndexShift ) +#define hypre_StMatrixClone HYPRE_FIXEDPRECISION_FUNC ( hypre_StMatrixClone ) +#define hypre_StMatrixCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_StMatrixCreate ) +#define hypre_StMatrixDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_StMatrixDestroy ) +#define hypre_StMatrixMatmat HYPRE_FIXEDPRECISION_FUNC ( hypre_StMatrixMatmat ) +#define hypre_StMatrixMatmult HYPRE_FIXEDPRECISION_FUNC ( hypre_StMatrixMatmult ) +#define hypre_StMatrixNEntryCoeffs HYPRE_FIXEDPRECISION_FUNC ( hypre_StMatrixNEntryCoeffs ) +#define hypre_StMatrixPrint HYPRE_FIXEDPRECISION_FUNC ( hypre_StMatrixPrint ) +#define hypre_StMatrixTranspose HYPRE_FIXEDPRECISION_FUNC ( hypre_StMatrixTranspose ) +#define hypre_StTermCopy HYPRE_FIXEDPRECISION_FUNC ( hypre_StTermCopy ) +#define hypre_StTermPrint HYPRE_FIXEDPRECISION_FUNC ( hypre_StTermPrint ) +#define hypre_StructAssumedPartitionCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_StructAssumedPartitionCreate ) +#define hypre_StructAssumedPartitionDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_StructAssumedPartitionDestroy ) +#define hypre_StructAssumedPartitionGetProcsFromBox HYPRE_FIXEDPRECISION_FUNC ( hypre_StructAssumedPartitionGetProcsFromBox ) +#define hypre_StructAssumedPartitionGetRegionsFromProc HYPRE_FIXEDPRECISION_FUNC ( hypre_StructAssumedPartitionGetRegionsFromProc ) +#define hypre_StructAssumedPartitionPrint HYPRE_FIXEDPRECISION_FUNC ( hypre_StructAssumedPartitionPrint ) +#define hypre_StructCoarsen HYPRE_FIXEDPRECISION_FUNC ( hypre_StructCoarsen ) +#define hypre_StructCoarsenAP HYPRE_FIXEDPRECISION_FUNC ( hypre_StructCoarsenAP ) +#define hypre_StructCommunicationFinalize HYPRE_FIXEDPRECISION_FUNC ( hypre_StructCommunicationFinalize ) +#define hypre_StructCommunicationGetBuffer HYPRE_FIXEDPRECISION_FUNC ( hypre_StructCommunicationGetBuffer ) +#define hypre_StructCommunicationInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_StructCommunicationInitialize ) +#define hypre_StructCommunicationReleaseBuffer HYPRE_FIXEDPRECISION_FUNC ( hypre_StructCommunicationReleaseBuffer ) +#define hypre_StructCopy HYPRE_FIXEDPRECISION_FUNC ( hypre_StructCopy ) +#define hypre_StructDataCopy HYPRE_FIXEDPRECISION_FUNC ( hypre_StructDataCopy ) +#define hypre_StructGridAssemble HYPRE_FIXEDPRECISION_FUNC ( hypre_StructGridAssemble ) +#define hypre_StructGridComputeBoxnums HYPRE_FIXEDPRECISION_FUNC ( hypre_StructGridComputeBoxnums ) +#define hypre_StructGridComputeGlobalSize HYPRE_FIXEDPRECISION_FUNC ( hypre_StructGridComputeGlobalSize ) +#define hypre_StructGridCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_StructGridCreate ) +#define hypre_StructGridDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_StructGridDestroy ) +#define hypre_StructGridGetMaxBoxSize HYPRE_FIXEDPRECISION_FUNC ( hypre_StructGridGetMaxBoxSize ) +#define hypre_StructGridPrint HYPRE_FIXEDPRECISION_FUNC ( hypre_StructGridPrint ) +#define hypre_StructGridPrintVTK HYPRE_FIXEDPRECISION_FUNC ( hypre_StructGridPrintVTK ) +#define hypre_StructGridRead HYPRE_FIXEDPRECISION_FUNC ( hypre_StructGridRead ) +#define hypre_StructGridRef HYPRE_FIXEDPRECISION_FUNC ( hypre_StructGridRef ) +#define hypre_StructGridSetBoundingBox HYPRE_FIXEDPRECISION_FUNC ( hypre_StructGridSetBoundingBox ) +#define hypre_StructGridSetBoxManager HYPRE_FIXEDPRECISION_FUNC ( hypre_StructGridSetBoxManager ) +#define hypre_StructGridSetBoxes HYPRE_FIXEDPRECISION_FUNC ( hypre_StructGridSetBoxes ) +#define hypre_StructGridSetExtents HYPRE_FIXEDPRECISION_FUNC ( hypre_StructGridSetExtents ) +#define hypre_StructGridSetIDs HYPRE_FIXEDPRECISION_FUNC ( hypre_StructGridSetIDs ) +#define hypre_StructGridSetMaxDistance HYPRE_FIXEDPRECISION_FUNC ( hypre_StructGridSetMaxDistance ) +#define hypre_StructGridSetNumGhost HYPRE_FIXEDPRECISION_FUNC ( hypre_StructGridSetNumGhost ) +#define hypre_StructGridSetPeriodic HYPRE_FIXEDPRECISION_FUNC ( hypre_StructGridSetPeriodic ) +#define hypre_StructInnerProd HYPRE_FIXEDPRECISION_FUNC ( hypre_StructInnerProd ) +#define hypre_StructInnerProdLocal HYPRE_FIXEDPRECISION_FUNC ( hypre_StructInnerProdLocal ) +#define hypre_StructMapCoarseToFine HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMapCoarseToFine ) +#define hypre_StructMapFineToCoarse HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMapFineToCoarse ) +#define hypre_StructMatmat HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmat ) +#define hypre_StructMatmatSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmatSetup ) +#define hypre_StructMatmult HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmult ) +#define hypre_StructMatmultCommSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmultCommSetup ) +#define hypre_StructMatmultCommunicate HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmultCommunicate ) +#define hypre_StructMatmultCompute HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmultCompute ) +#define hypre_StructMatmultCompute_core HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmultCompute_core ) +#define hypre_StructMatmultCompute_core_c HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmultCompute_core_c ) +#define hypre_StructMatmultCompute_core_cc HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmultCompute_core_cc ) +#define hypre_StructMatmultCompute_core_ccf HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmultCompute_core_ccf ) +#define hypre_StructMatmultCompute_core_cf HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmultCompute_core_cf ) +#define hypre_StructMatmultCompute_core_cff HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmultCompute_core_cff ) +#define hypre_StructMatmultCompute_core_f HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmultCompute_core_f ) +#define hypre_StructMatmultCompute_core_ff HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmultCompute_core_ff ) +#define hypre_StructMatmultCompute_core_fff HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmultCompute_core_fff ) +#define hypre_StructMatmultCompute_core_generic HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmultCompute_core_generic ) +#define hypre_StructMatmultCompute_fuse HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmultCompute_fuse ) +#define hypre_StructMatmultCompute_fuse_c HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmultCompute_fuse_c ) +#define hypre_StructMatmultCompute_fuse_cc HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmultCompute_fuse_cc ) +#define hypre_StructMatmultCompute_fuse_f HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmultCompute_fuse_f ) +#define hypre_StructMatmultCompute_fuse_fc HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmultCompute_fuse_fc ) +#define hypre_StructMatmultCompute_fuse_fcc HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmultCompute_fuse_fcc ) +#define hypre_StructMatmultCompute_fuse_ff HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmultCompute_fuse_ff ) +#define hypre_StructMatmultCompute_fuse_ffc HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmultCompute_fuse_ffc ) +#define hypre_StructMatmultCompute_fuse_fff HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmultCompute_fuse_fff ) +#define hypre_StructMatmultCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmultCreate ) +#define hypre_StructMatmultDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmultDestroy ) +#define hypre_StructMatmultGetMatrix HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmultGetMatrix ) +#define hypre_StructMatmultInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmultInitialize ) +#define hypre_StructMatmultMultiply HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmultMultiply ) +#define hypre_StructMatmultSetKernelType HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmultSetKernelType ) +#define hypre_StructMatmultSetProduct HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmultSetProduct ) +#define hypre_StructMatmultSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatmultSetup ) +#define hypre_StructMatrixAddInit HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixAddInit ) +#define hypre_StructMatrixAddMat HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixAddMat ) +#define hypre_StructMatrixAssemble HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixAssemble ) +#define hypre_StructMatrixClearBoundary HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixClearBoundary ) +#define hypre_StructMatrixClearBoxValues HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixClearBoxValues ) +#define hypre_StructMatrixClearGhostValues HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixClearGhostValues ) +#define hypre_StructMatrixClearValues HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixClearValues ) +#define hypre_StructMatrixComputeDataSpace HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixComputeDataSpace ) +#define hypre_StructMatrixComputeRowSum HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixComputeRowSum ) +#define hypre_StructMatrixComputeRowSum_core_CC HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixComputeRowSum_core_CC ) +#define hypre_StructMatrixComputeRowSum_core_VC HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixComputeRowSum_core_VC ) +#define hypre_StructMatrixCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixCreate ) +#define hypre_StructMatrixCreateCommPkg HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixCreateCommPkg ) +#define hypre_StructMatrixCreateMask HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixCreateMask ) +#define hypre_StructMatrixDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixDestroy ) +#define hypre_StructMatrixExtractPointerByIndex HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixExtractPointerByIndex ) +#define hypre_StructMatrixForget HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixForget ) +#define hypre_StructMatrixGetCStride HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixGetCStride ) +#define hypre_StructMatrixGetDataMapStride HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixGetDataMapStride ) +#define hypre_StructMatrixGetDiagonal HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixGetDiagonal ) +#define hypre_StructMatrixGetFStride HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixGetFStride ) +#define hypre_StructMatrixGetStSpaces HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixGetStSpaces ) +#define hypre_StructMatrixGetStencilSpace HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixGetStencilSpace ) +#define hypre_StructMatrixGetStencilStride HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixGetStencilStride ) +#define hypre_StructMatrixGrowDataSpace HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixGrowDataSpace ) +#define hypre_StructMatrixInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixInitialize ) +#define hypre_StructMatrixInitializeData HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixInitializeData ) +#define hypre_StructMatrixInitializeShell HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixInitializeShell ) +#define hypre_StructMatrixMapCommInfo HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixMapCommInfo ) +#define hypre_StructMatrixMapDataBox HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixMapDataBox ) +#define hypre_StructMatrixMapDataIndex HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixMapDataIndex ) +#define hypre_StructMatrixMapDataStride HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixMapDataStride ) +#define hypre_StructMatrixMigrate HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixMigrate ) +#define hypre_StructMatrixNeedResize HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixNeedResize ) +#define hypre_StructMatrixPlaceStencil HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixPlaceStencil ) +#define hypre_StructMatrixPrint HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixPrint ) +#define hypre_StructMatrixPrintData HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixPrintData ) +#define hypre_StructMatrixPtAP HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixPtAP ) +#define hypre_StructMatrixPtAPSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixPtAPSetup ) +#define hypre_StructMatrixRAP HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixRAP ) +#define hypre_StructMatrixRAPSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixRAPSetup ) +#define hypre_StructMatrixRTtAP HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixRTtAP ) +#define hypre_StructMatrixRTtAPSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixRTtAPSetup ) +#define hypre_StructMatrixRead HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixRead ) +#define hypre_StructMatrixReadData HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixReadData ) +#define hypre_StructMatrixRef HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixRef ) +#define hypre_StructMatrixResize HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixResize ) +#define hypre_StructMatrixRestore HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixRestore ) +#define hypre_StructMatrixSetBoxValues HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixSetBoxValues ) +#define hypre_StructMatrixSetConstantEntries HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixSetConstantEntries ) +#define hypre_StructMatrixSetConstantValues HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixSetConstantValues ) +#define hypre_StructMatrixSetDomainStride HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixSetDomainStride ) +#define hypre_StructMatrixSetGhost HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixSetGhost ) +#define hypre_StructMatrixSetMemoryLocation HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixSetMemoryLocation ) +#define hypre_StructMatrixSetNumGhost HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixSetNumGhost ) +#define hypre_StructMatrixSetRangeStride HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixSetRangeStride ) +#define hypre_StructMatrixSetTranspose HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixSetTranspose ) +#define hypre_StructMatrixSetValues HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixSetValues ) +#define hypre_StructMatrixUnMapDataBox HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixUnMapDataBox ) +#define hypre_StructMatrixUnMapDataIndex HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixUnMapDataIndex ) +#define hypre_StructMatrixUnMapDataStride HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixUnMapDataStride ) +#define hypre_StructMatrixZeroDiagonal HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatrixZeroDiagonal ) +#define hypre_StructMatvec HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatvec ) +#define hypre_StructMatvecCompute HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatvecCompute ) +#define hypre_StructMatvecCompute_core_CC HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatvecCompute_core_CC ) +#define hypre_StructMatvecCompute_core_VC HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatvecCompute_core_VC ) +#define hypre_StructMatvecCompute_core_VCC HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatvecCompute_core_VCC ) +#define hypre_StructMatvecCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatvecCreate ) +#define hypre_StructMatvecDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatvecDestroy ) +#define hypre_StructMatvecResize HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatvecResize ) +#define hypre_StructMatvecSetTranspose HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatvecSetTranspose ) +#define hypre_StructMatvecSetup HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatvecSetup ) +#define hypre_StructMatvecT HYPRE_FIXEDPRECISION_FUNC ( hypre_StructMatvecT ) +#define hypre_StructNumGhostFromStencil HYPRE_FIXEDPRECISION_FUNC ( hypre_StructNumGhostFromStencil ) +#define hypre_StructPartialCopy HYPRE_FIXEDPRECISION_FUNC ( hypre_StructPartialCopy ) +#define hypre_StructScale HYPRE_FIXEDPRECISION_FUNC ( hypre_StructScale ) +#define hypre_StructStencilCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_StructStencilCreate ) +#define hypre_StructStencilDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_StructStencilDestroy ) +#define hypre_StructStencilOffsetEntry HYPRE_FIXEDPRECISION_FUNC ( hypre_StructStencilOffsetEntry ) +#define hypre_StructStencilPrint HYPRE_FIXEDPRECISION_FUNC ( hypre_StructStencilPrint ) +#define hypre_StructStencilRead HYPRE_FIXEDPRECISION_FUNC ( hypre_StructStencilRead ) +#define hypre_StructStencilRef HYPRE_FIXEDPRECISION_FUNC ( hypre_StructStencilRef ) +#define hypre_StructStencilSymmetrize HYPRE_FIXEDPRECISION_FUNC ( hypre_StructStencilSymmetrize ) +#define hypre_StructVectorAssemble HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorAssemble ) +#define hypre_StructVectorAxpy HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorAxpy ) +#define hypre_StructVectorClearAllValues HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorClearAllValues ) +#define hypre_StructVectorClearBoundGhostValues HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorClearBoundGhostValues ) +#define hypre_StructVectorClearBoxValues HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorClearBoxValues ) +#define hypre_StructVectorClearGhostValues HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorClearGhostValues ) +#define hypre_StructVectorClearValues HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorClearValues ) +#define hypre_StructVectorClone HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorClone ) +#define hypre_StructVectorComputeDataSpace HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorComputeDataSpace ) +#define hypre_StructVectorCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorCreate ) +#define hypre_StructVectorDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorDestroy ) +#define hypre_StructVectorForget HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorForget ) +#define hypre_StructVectorGetMigrateCommPkg HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorGetMigrateCommPkg ) +#define hypre_StructVectorInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorInitialize ) +#define hypre_StructVectorInitializeData HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorInitializeData ) +#define hypre_StructVectorInitializeShell HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorInitializeShell ) +#define hypre_StructVectorMapCommInfo HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorMapCommInfo ) +#define hypre_StructVectorMapDataBox HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorMapDataBox ) +#define hypre_StructVectorMapDataIndex HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorMapDataIndex ) +#define hypre_StructVectorMapDataStride HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorMapDataStride ) +#define hypre_StructVectorMigrate HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorMigrate ) +#define hypre_StructVectorNeedResize HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorNeedResize ) +#define hypre_StructVectorPointwiseDivision HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorPointwiseDivision ) +#define hypre_StructVectorPointwiseDivpy HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorPointwiseDivpy ) +#define hypre_StructVectorPointwiseInverse HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorPointwiseInverse ) +#define hypre_StructVectorPointwiseProduct HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorPointwiseProduct ) +#define hypre_StructVectorPrint HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorPrint ) +#define hypre_StructVectorPrintData HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorPrintData ) +#define hypre_StructVectorRead HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorRead ) +#define hypre_StructVectorReadData HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorReadData ) +#define hypre_StructVectorRebase HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorRebase ) +#define hypre_StructVectorRef HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorRef ) +#define hypre_StructVectorResize HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorResize ) +#define hypre_StructVectorRestore HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorRestore ) +#define hypre_StructVectorScaleValues HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorScaleValues ) +#define hypre_StructVectorSetBoxValues HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorSetBoxValues ) +#define hypre_StructVectorSetConstantValues HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorSetConstantValues ) +#define hypre_StructVectorSetDataSize HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorSetDataSize ) +#define hypre_StructVectorSetMemoryMode HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorSetMemoryMode ) +#define hypre_StructVectorSetNumGhost HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorSetNumGhost ) +#define hypre_StructVectorSetRandomValues HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorSetRandomValues ) +#define hypre_StructVectorSetStride HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorSetStride ) +#define hypre_StructVectorSetValues HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorSetValues ) +#define hypre_StructVectorUnMapDataBox HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorUnMapDataBox ) +#define hypre_StructVectorUnMapDataIndex HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorUnMapDataIndex ) +#define hypre_StructVectorUnMapDataStride HYPRE_FIXEDPRECISION_FUNC ( hypre_StructVectorUnMapDataStride ) +#define hypre_SubtractBoxArrays HYPRE_FIXEDPRECISION_FUNC ( hypre_SubtractBoxArrays ) +#define hypre_SubtractBoxes HYPRE_FIXEDPRECISION_FUNC ( hypre_SubtractBoxes ) +#define hypre_SubtractIndexes HYPRE_FIXEDPRECISION_FUNC ( hypre_SubtractIndexes ) +#define hypre_UnionBoxes HYPRE_FIXEDPRECISION_FUNC ( hypre_UnionBoxes ) +#define hypre_destroycommpkg HYPRE_FIXEDPRECISION_FUNC ( hypre_destroycommpkg ) +#define hypre_doubleBoxVolume HYPRE_FIXEDPRECISION_FUNC ( hypre_doubleBoxVolume ) +#define hypre_entryqsort2 HYPRE_FIXEDPRECISION_FUNC ( hypre_entryqsort2 ) +#define hypre_entryswap2 HYPRE_FIXEDPRECISION_FUNC ( hypre_entryswap2 ) +#define hypre_structgridassemble HYPRE_FIXEDPRECISION_FUNC ( hypre_structgridassemble ) +#define hypre_structgridcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_structgridcreate ) +#define hypre_structgriddestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_structgriddestroy ) +#define hypre_structgridsetextents HYPRE_FIXEDPRECISION_FUNC ( hypre_structgridsetextents ) +#define hypre_structgridsetnumghost HYPRE_FIXEDPRECISION_FUNC ( hypre_structgridsetnumghost ) +#define hypre_structgridsetperiodic HYPRE_FIXEDPRECISION_FUNC ( hypre_structgridsetperiodic ) +#define hypre_structmatrixaddtoboxvalues HYPRE_FIXEDPRECISION_FUNC ( hypre_structmatrixaddtoboxvalues ) +#define hypre_structmatrixaddtoconstant HYPRE_FIXEDPRECISION_FUNC ( hypre_structmatrixaddtoconstant ) +#define hypre_structmatrixaddtovalues HYPRE_FIXEDPRECISION_FUNC ( hypre_structmatrixaddtovalues ) +#define hypre_structmatrixassemble HYPRE_FIXEDPRECISION_FUNC ( hypre_structmatrixassemble ) +#define hypre_structmatrixcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_structmatrixcreate ) +#define hypre_structmatrixdestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_structmatrixdestroy ) +#define hypre_structmatrixgetboxvalues HYPRE_FIXEDPRECISION_FUNC ( hypre_structmatrixgetboxvalues ) +#define hypre_structmatrixgetgrid HYPRE_FIXEDPRECISION_FUNC ( hypre_structmatrixgetgrid ) +#define hypre_structmatrixinitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_structmatrixinitialize ) +#define hypre_structmatrixmatvec HYPRE_FIXEDPRECISION_FUNC ( hypre_structmatrixmatvec ) +#define hypre_structmatrixprint HYPRE_FIXEDPRECISION_FUNC ( hypre_structmatrixprint ) +#define hypre_structmatrixsetboxvalues HYPRE_FIXEDPRECISION_FUNC ( hypre_structmatrixsetboxvalues ) +#define hypre_structmatrixsetconstanten HYPRE_FIXEDPRECISION_FUNC ( hypre_structmatrixsetconstanten ) +#define hypre_structmatrixsetconstantva HYPRE_FIXEDPRECISION_FUNC ( hypre_structmatrixsetconstantva ) +#define hypre_structmatrixsetnumghost HYPRE_FIXEDPRECISION_FUNC ( hypre_structmatrixsetnumghost ) +#define hypre_structmatrixsetsymmetric HYPRE_FIXEDPRECISION_FUNC ( hypre_structmatrixsetsymmetric ) +#define hypre_structmatrixsetvalues HYPRE_FIXEDPRECISION_FUNC ( hypre_structmatrixsetvalues ) +#define hypre_structstencilcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_structstencilcreate ) +#define hypre_structstencildestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_structstencildestroy ) +#define hypre_structstencilsetelement HYPRE_FIXEDPRECISION_FUNC ( hypre_structstencilsetelement ) +#define hypre_structstencilsetentry HYPRE_FIXEDPRECISION_FUNC ( hypre_structstencilsetentry ) +#define hypre_structvectoraddtoboxvalue HYPRE_FIXEDPRECISION_FUNC ( hypre_structvectoraddtoboxvalue ) +#define hypre_structvectoraddtovalues HYPRE_FIXEDPRECISION_FUNC ( hypre_structvectoraddtovalues ) +#define hypre_structvectorassemble HYPRE_FIXEDPRECISION_FUNC ( hypre_structvectorassemble ) +#define hypre_structvectorcopy HYPRE_FIXEDPRECISION_FUNC ( hypre_structvectorcopy ) +#define hypre_structvectorcreate HYPRE_FIXEDPRECISION_FUNC ( hypre_structvectorcreate ) +#define hypre_structvectordestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_structvectordestroy ) +#define hypre_structvectorgetboxvalues HYPRE_FIXEDPRECISION_FUNC ( hypre_structvectorgetboxvalues ) +#define hypre_structvectorgetmigratecom HYPRE_FIXEDPRECISION_FUNC ( hypre_structvectorgetmigratecom ) +#define hypre_structvectorgetvalues HYPRE_FIXEDPRECISION_FUNC ( hypre_structvectorgetvalues ) +#define hypre_structvectorinitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_structvectorinitialize ) +#define hypre_structvectormigrate HYPRE_FIXEDPRECISION_FUNC ( hypre_structvectormigrate ) +#define hypre_structvectorprint HYPRE_FIXEDPRECISION_FUNC ( hypre_structvectorprint ) +#define hypre_structvectorscalevalues HYPRE_FIXEDPRECISION_FUNC ( hypre_structvectorscalevalues ) +#define hypre_structvectorsetboxvalues HYPRE_FIXEDPRECISION_FUNC ( hypre_structvectorsetboxvalues ) +#define hypre_structvectorsetconstantva HYPRE_FIXEDPRECISION_FUNC ( hypre_structvectorsetconstantva ) +#define hypre_structvectorsetnumghost HYPRE_FIXEDPRECISION_FUNC ( hypre_structvectorsetnumghost ) +#define hypre_structvectorsetrandomvalu HYPRE_FIXEDPRECISION_FUNC ( hypre_structvectorsetrandomvalu ) +#define hypre_structvectorsetvalues HYPRE_FIXEDPRECISION_FUNC ( hypre_structvectorsetvalues ) + +#endif diff --git a/src/struct_mv/_hypre_struct_mv_mup_undef.h b/src/struct_mv/_hypre_struct_mv_mup_undef.h new file mode 100644 index 0000000000..59930ca7c2 --- /dev/null +++ b/src/struct_mv/_hypre_struct_mv_mup_undef.h @@ -0,0 +1,539 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#undef hypre_STRUCT_MV_MUP_DEF_HEADER + +#undef HYPRE_CommPkgDestroy +#undef HYPRE_StructGridAssemble +#undef HYPRE_StructGridCoarsen +#undef HYPRE_StructGridCreate +#undef HYPRE_StructGridDestroy +#undef HYPRE_StructGridPrintVTK +#undef HYPRE_StructGridProjectBox +#undef HYPRE_StructGridSetExtents +#undef HYPRE_StructGridSetNumGhost +#undef HYPRE_StructGridSetPeriodic +#undef HYPRE_StructMatrixAddToBoxValues +#undef HYPRE_StructMatrixAddToBoxValues2 +#undef HYPRE_StructMatrixAddToConstantValues +#undef HYPRE_StructMatrixAddToValues +#undef HYPRE_StructMatrixAssemble +#undef HYPRE_StructMatrixClearBoundary +#undef HYPRE_StructMatrixCreate +#undef HYPRE_StructMatrixDestroy +#undef HYPRE_StructMatrixGetBoxValues +#undef HYPRE_StructMatrixGetBoxValues2 +#undef HYPRE_StructMatrixGetGrid +#undef HYPRE_StructMatrixGetValues +#undef HYPRE_StructMatrixInitialize +#undef HYPRE_StructMatrixMatmat +#undef HYPRE_StructMatrixMatvec +#undef HYPRE_StructMatrixMatvecT +#undef HYPRE_StructMatrixPrint +#undef HYPRE_StructMatrixRead +#undef HYPRE_StructMatrixSetBoxValues +#undef HYPRE_StructMatrixSetBoxValues2 +#undef HYPRE_StructMatrixSetConstantEntries +#undef HYPRE_StructMatrixSetConstantValues +#undef HYPRE_StructMatrixSetDomainStride +#undef HYPRE_StructMatrixSetNumGhost +#undef HYPRE_StructMatrixSetRangeStride +#undef HYPRE_StructMatrixSetSymmetric +#undef HYPRE_StructMatrixSetTranspose +#undef HYPRE_StructMatrixSetValues +#undef HYPRE_StructStencilCreate +#undef HYPRE_StructStencilDestroy +#undef HYPRE_StructStencilSetElement +#undef HYPRE_StructStencilSetEntry +#undef HYPRE_StructVectorAddToBoxValues +#undef HYPRE_StructVectorAddToBoxValues2 +#undef HYPRE_StructVectorAddToValues +#undef HYPRE_StructVectorAssemble +#undef HYPRE_StructVectorAxpy +#undef HYPRE_StructVectorClone +#undef HYPRE_StructVectorCopy +#undef HYPRE_StructVectorCreate +#undef HYPRE_StructVectorDestroy +#undef HYPRE_StructVectorGetBoxValues +#undef HYPRE_StructVectorGetBoxValues2 +#undef HYPRE_StructVectorGetMigrateCommPkg +#undef HYPRE_StructVectorGetValues +#undef HYPRE_StructVectorInitialize +#undef HYPRE_StructVectorInnerProd +#undef HYPRE_StructVectorMigrate +#undef HYPRE_StructVectorPrint +#undef HYPRE_StructVectorRead +#undef HYPRE_StructVectorScale +#undef HYPRE_StructVectorScaleValues +#undef HYPRE_StructVectorSetBoxValues +#undef HYPRE_StructVectorSetBoxValues2 +#undef HYPRE_StructVectorSetConstantValues +#undef HYPRE_StructVectorSetNumGhost +#undef HYPRE_StructVectorSetRandomValues +#undef HYPRE_StructVectorSetStride +#undef HYPRE_StructVectorSetValues +#undef hypre_APFillResponseStructAssumedPart +#undef hypre_APFindMyBoxesInRegions +#undef hypre_APGetAllBoxesInRegions +#undef hypre_APPruneRegions +#undef hypre_APRefineRegionsByVol +#undef hypre_APShrinkRegions +#undef hypre_APSubdivideRegion +#undef hypre_AddIndexes +#undef hypre_AppendBox +#undef hypre_AppendBoxArray +#undef hypre_BoxArrayArrayClone +#undef hypre_BoxArrayArrayCreate +#undef hypre_BoxArrayArrayDestroy +#undef hypre_BoxArrayArrayPrint +#undef hypre_BoxArrayArrayPrintToFile +#undef hypre_BoxArrayClone +#undef hypre_BoxArrayCreate +#undef hypre_BoxArrayCreateFromIndices +#undef hypre_BoxArrayDestroy +#undef hypre_BoxArrayInBoxArray +#undef hypre_BoxArrayPrint +#undef hypre_BoxArrayPrintToFile +#undef hypre_BoxArrayReadFromFile +#undef hypre_BoxArraySetSize +#undef hypre_BoxArrayVolume +#undef hypre_BoxArraysEqual +#undef hypre_BoxBTNodeCreate +#undef hypre_BoxBTNodeDestroy +#undef hypre_BoxBTNodeInitialize +#undef hypre_BoxBTNodeSetIndices +#undef hypre_BoxBTQueueCreate +#undef hypre_BoxBTQueueDelete +#undef hypre_BoxBTQueueDestroy +#undef hypre_BoxBTQueueInitialize +#undef hypre_BoxBTQueueInsert +#undef hypre_BoxBTStackCreate +#undef hypre_BoxBTStackDelete +#undef hypre_BoxBTStackDestroy +#undef hypre_BoxBTStackInitialize +#undef hypre_BoxBTStackInsert +#undef hypre_BoxBinTreeCreate +#undef hypre_BoxBinTreeDestroy +#undef hypre_BoxBinTreeInitialize +#undef hypre_BoxBoundaryDG +#undef hypre_BoxBoundaryG +#undef hypre_BoxBoundaryIntersect +#undef hypre_BoxClone +#undef hypre_BoxCreate +#undef hypre_BoxDestroy +#undef hypre_BoxGetSize +#undef hypre_BoxGetStrideSize +#undef hypre_BoxGetStrideVolume +#undef hypre_BoxGrowByArray +#undef hypre_BoxGrowByBox +#undef hypre_BoxGrowByIndex +#undef hypre_BoxGrowByValue +#undef hypre_BoxInBox +#undef hypre_BoxIndexRank +#undef hypre_BoxInit +#undef hypre_BoxManAddEntry +#undef hypre_BoxManAssemble +#undef hypre_BoxManCreate +#undef hypre_BoxManDeleteMultipleEntriesAndInfo +#undef hypre_BoxManDestroy +#undef hypre_BoxManEntryCopy +#undef hypre_BoxManEntryGetExtents +#undef hypre_BoxManEntryGetInfo +#undef hypre_BoxManEntryGetStride +#undef hypre_BoxManGatherEntries +#undef hypre_BoxManGetAllEntries +#undef hypre_BoxManGetAllEntriesBoxes +#undef hypre_BoxManGetAllEntriesBoxesProc +#undef hypre_BoxManGetAllGlobalKnown +#undef hypre_BoxManGetAssumedPartition +#undef hypre_BoxManGetEntry +#undef hypre_BoxManGetGlobalIsGatherCalled +#undef hypre_BoxManGetIsEntriesSort +#undef hypre_BoxManGetLocalEntriesBoxes +#undef hypre_BoxManIncSize +#undef hypre_BoxManIntersect +#undef hypre_BoxManSetAllGlobalKnown +#undef hypre_BoxManSetAssumedPartition +#undef hypre_BoxManSetBoundingBox +#undef hypre_BoxManSetIsEntriesSort +#undef hypre_BoxManSetNumGhost +#undef hypre_BoxMaxSize +#undef hypre_BoxNnodes +#undef hypre_BoxOffsetDistance +#undef hypre_BoxPartialVolume +#undef hypre_BoxPrint +#undef hypre_BoxPrintDebug +#undef hypre_BoxRankIndex +#undef hypre_BoxRead +#undef hypre_BoxSetExtents +#undef hypre_BoxShiftNeg +#undef hypre_BoxShiftPos +#undef hypre_BoxSplit +#undef hypre_BoxStrideVolume +#undef hypre_BoxVolume +#undef hypre_BoxesEqual +#undef hypre_CoarsenBox +#undef hypre_CoarsenBoxArray +#undef hypre_CoarsenBoxArrayArray +#undef hypre_CoarsenBoxArrayArrayOutward +#undef hypre_CommBlockSetEntries +#undef hypre_CommBlockSetEntry +#undef hypre_CommInfoClone +#undef hypre_CommInfoCoarsen +#undef hypre_CommInfoCoarsenRecv +#undef hypre_CommInfoCoarsenSend +#undef hypre_CommInfoCreate +#undef hypre_CommInfoDestroy +#undef hypre_CommInfoGetTransforms +#undef hypre_CommInfoProjectRecv +#undef hypre_CommInfoProjectSend +#undef hypre_CommInfoRefine +#undef hypre_CommInfoRefineRecv +#undef hypre_CommInfoRefineSend +#undef hypre_CommInfoSetTransforms +#undef hypre_CommPkgAgglomData +#undef hypre_CommPkgAgglomDestroy +#undef hypre_CommPkgAgglomerate +#undef hypre_CommPkgCreate +#undef hypre_CommPkgDestroy +#undef hypre_CommPkgSetPrefixSizes +#undef hypre_CommStencilCreate +#undef hypre_CommStencilCreateNumGhost +#undef hypre_CommStencilDestroy +#undef hypre_CommStencilSetEntry +#undef hypre_ComputeBoxnums +#undef hypre_ComputeCoarseOriginStride +#undef hypre_ComputeInfoCreate +#undef hypre_ComputeInfoDestroy +#undef hypre_ComputeInfoProjectComp +#undef hypre_ComputeInfoProjectRecv +#undef hypre_ComputeInfoProjectSend +#undef hypre_ComputePkgCreate +#undef hypre_ComputePkgDestroy +#undef hypre_ConvertToCanonicalIndex +#undef hypre_CopyBox +#undef hypre_CopyIndex +#undef hypre_CopyToCleanIndex +#undef hypre_CopyToIndex +#undef hypre_CreateCommInfo +#undef hypre_CreateCommInfoFromGrids +#undef hypre_CreateCommInfoFromNumGhost +#undef hypre_CreateCommInfoFromStencil +#undef hypre_CreateComputeInfo +#undef hypre_DeleteBox +#undef hypre_DeleteMultipleBoxes +#undef hypre_ExchangeLocalData +#undef hypre_FillResponseBoxManAssemble1 +#undef hypre_FillResponseBoxManAssemble2 +#undef hypre_FinalizeIndtComputations +#undef hypre_GatherAllBoxes +#undef hypre_GeneralBoxBoundaryIntersect +#undef hypre_IndexElementMult +#undef hypre_IndexEqual +#undef hypre_IndexFromRank +#undef hypre_IndexInBox +#undef hypre_IndexMax +#undef hypre_IndexMin +#undef hypre_IndexPrint +#undef hypre_IndexProd +#undef hypre_IndexRead +#undef hypre_IndexesEqual +#undef hypre_IndexesGreater +#undef hypre_IndexesGreaterEqual +#undef hypre_InitializeIndtComputations +#undef hypre_IntersectBoxes +#undef hypre_MapToCoarseIndex +#undef hypre_MapToFineIndex +#undef hypre_MinUnionBoxes +#undef hypre_PrintBoxArrayData +#undef hypre_ProjectBox +#undef hypre_ProjectBoxArray +#undef hypre_ProjectBoxArrayArray +#undef hypre_ReadBoxArrayData +#undef hypre_RefineBox +#undef hypre_RefineBoxArray +#undef hypre_RefineBoxArrayArray +#undef hypre_SetIndex +#undef hypre_SnapIndexNeg +#undef hypre_SnapIndexPos +#undef hypre_StBoxRank +#undef hypre_StCoeffClone +#undef hypre_StCoeffCreate +#undef hypre_StCoeffDestroy +#undef hypre_StCoeffMult +#undef hypre_StCoeffPrint +#undef hypre_StCoeffPush +#undef hypre_StCoeffShift +#undef hypre_StIndexCopy +#undef hypre_StIndexNegate +#undef hypre_StIndexPrint +#undef hypre_StIndexShift +#undef hypre_StMatrixClone +#undef hypre_StMatrixCreate +#undef hypre_StMatrixDestroy +#undef hypre_StMatrixMatmat +#undef hypre_StMatrixMatmult +#undef hypre_StMatrixNEntryCoeffs +#undef hypre_StMatrixPrint +#undef hypre_StMatrixTranspose +#undef hypre_StTermCopy +#undef hypre_StTermPrint +#undef hypre_StructAssumedPartitionCreate +#undef hypre_StructAssumedPartitionDestroy +#undef hypre_StructAssumedPartitionGetProcsFromBox +#undef hypre_StructAssumedPartitionGetRegionsFromProc +#undef hypre_StructAssumedPartitionPrint +#undef hypre_StructCoarsen +#undef hypre_StructCoarsenAP +#undef hypre_StructCommunicationFinalize +#undef hypre_StructCommunicationGetBuffer +#undef hypre_StructCommunicationInitialize +#undef hypre_StructCommunicationReleaseBuffer +#undef hypre_StructCopy +#undef hypre_StructDataCopy +#undef hypre_StructGridAssemble +#undef hypre_StructGridComputeBoxnums +#undef hypre_StructGridComputeGlobalSize +#undef hypre_StructGridCreate +#undef hypre_StructGridDestroy +#undef hypre_StructGridGetMaxBoxSize +#undef hypre_StructGridPrint +#undef hypre_StructGridPrintVTK +#undef hypre_StructGridRead +#undef hypre_StructGridRef +#undef hypre_StructGridSetBoundingBox +#undef hypre_StructGridSetBoxManager +#undef hypre_StructGridSetBoxes +#undef hypre_StructGridSetExtents +#undef hypre_StructGridSetIDs +#undef hypre_StructGridSetMaxDistance +#undef hypre_StructGridSetNumGhost +#undef hypre_StructGridSetPeriodic +#undef hypre_StructInnerProd +#undef hypre_StructInnerProdLocal +#undef hypre_StructMapCoarseToFine +#undef hypre_StructMapFineToCoarse +#undef hypre_StructMatmat +#undef hypre_StructMatmatSetup +#undef hypre_StructMatmult +#undef hypre_StructMatmultCommSetup +#undef hypre_StructMatmultCommunicate +#undef hypre_StructMatmultCompute +#undef hypre_StructMatmultCompute_core +#undef hypre_StructMatmultCompute_core_c +#undef hypre_StructMatmultCompute_core_cc +#undef hypre_StructMatmultCompute_core_ccf +#undef hypre_StructMatmultCompute_core_cf +#undef hypre_StructMatmultCompute_core_cff +#undef hypre_StructMatmultCompute_core_f +#undef hypre_StructMatmultCompute_core_ff +#undef hypre_StructMatmultCompute_core_fff +#undef hypre_StructMatmultCompute_core_generic +#undef hypre_StructMatmultCompute_fuse +#undef hypre_StructMatmultCompute_fuse_c +#undef hypre_StructMatmultCompute_fuse_cc +#undef hypre_StructMatmultCompute_fuse_f +#undef hypre_StructMatmultCompute_fuse_fc +#undef hypre_StructMatmultCompute_fuse_fcc +#undef hypre_StructMatmultCompute_fuse_ff +#undef hypre_StructMatmultCompute_fuse_ffc +#undef hypre_StructMatmultCompute_fuse_fff +#undef hypre_StructMatmultCreate +#undef hypre_StructMatmultDestroy +#undef hypre_StructMatmultGetMatrix +#undef hypre_StructMatmultInitialize +#undef hypre_StructMatmultMultiply +#undef hypre_StructMatmultSetKernelType +#undef hypre_StructMatmultSetProduct +#undef hypre_StructMatmultSetup +#undef hypre_StructMatrixAddInit +#undef hypre_StructMatrixAddMat +#undef hypre_StructMatrixAssemble +#undef hypre_StructMatrixClearBoundary +#undef hypre_StructMatrixClearBoxValues +#undef hypre_StructMatrixClearGhostValues +#undef hypre_StructMatrixClearValues +#undef hypre_StructMatrixComputeDataSpace +#undef hypre_StructMatrixComputeRowSum +#undef hypre_StructMatrixComputeRowSum_core_CC +#undef hypre_StructMatrixComputeRowSum_core_VC +#undef hypre_StructMatrixCreate +#undef hypre_StructMatrixCreateCommPkg +#undef hypre_StructMatrixCreateMask +#undef hypre_StructMatrixDestroy +#undef hypre_StructMatrixExtractPointerByIndex +#undef hypre_StructMatrixForget +#undef hypre_StructMatrixGetCStride +#undef hypre_StructMatrixGetDataMapStride +#undef hypre_StructMatrixGetDiagonal +#undef hypre_StructMatrixGetFStride +#undef hypre_StructMatrixGetStSpaces +#undef hypre_StructMatrixGetStencilSpace +#undef hypre_StructMatrixGetStencilStride +#undef hypre_StructMatrixGrowDataSpace +#undef hypre_StructMatrixInitialize +#undef hypre_StructMatrixInitializeData +#undef hypre_StructMatrixInitializeShell +#undef hypre_StructMatrixMapCommInfo +#undef hypre_StructMatrixMapDataBox +#undef hypre_StructMatrixMapDataIndex +#undef hypre_StructMatrixMapDataStride +#undef hypre_StructMatrixMigrate +#undef hypre_StructMatrixNeedResize +#undef hypre_StructMatrixPlaceStencil +#undef hypre_StructMatrixPrint +#undef hypre_StructMatrixPrintData +#undef hypre_StructMatrixPtAP +#undef hypre_StructMatrixPtAPSetup +#undef hypre_StructMatrixRAP +#undef hypre_StructMatrixRAPSetup +#undef hypre_StructMatrixRTtAP +#undef hypre_StructMatrixRTtAPSetup +#undef hypre_StructMatrixRead +#undef hypre_StructMatrixReadData +#undef hypre_StructMatrixRef +#undef hypre_StructMatrixResize +#undef hypre_StructMatrixRestore +#undef hypre_StructMatrixSetBoxValues +#undef hypre_StructMatrixSetConstantEntries +#undef hypre_StructMatrixSetConstantValues +#undef hypre_StructMatrixSetDomainStride +#undef hypre_StructMatrixSetGhost +#undef hypre_StructMatrixSetMemoryLocation +#undef hypre_StructMatrixSetNumGhost +#undef hypre_StructMatrixSetRangeStride +#undef hypre_StructMatrixSetTranspose +#undef hypre_StructMatrixSetValues +#undef hypre_StructMatrixUnMapDataBox +#undef hypre_StructMatrixUnMapDataIndex +#undef hypre_StructMatrixUnMapDataStride +#undef hypre_StructMatrixZeroDiagonal +#undef hypre_StructMatvec +#undef hypre_StructMatvecCompute +#undef hypre_StructMatvecCompute_core_CC +#undef hypre_StructMatvecCompute_core_VC +#undef hypre_StructMatvecCompute_core_VCC +#undef hypre_StructMatvecCreate +#undef hypre_StructMatvecDestroy +#undef hypre_StructMatvecResize +#undef hypre_StructMatvecSetTranspose +#undef hypre_StructMatvecSetup +#undef hypre_StructMatvecT +#undef hypre_StructNumGhostFromStencil +#undef hypre_StructPartialCopy +#undef hypre_StructScale +#undef hypre_StructStencilCreate +#undef hypre_StructStencilDestroy +#undef hypre_StructStencilOffsetEntry +#undef hypre_StructStencilPrint +#undef hypre_StructStencilRead +#undef hypre_StructStencilRef +#undef hypre_StructStencilSymmetrize +#undef hypre_StructVectorAssemble +#undef hypre_StructVectorAxpy +#undef hypre_StructVectorClearAllValues +#undef hypre_StructVectorClearBoundGhostValues +#undef hypre_StructVectorClearBoxValues +#undef hypre_StructVectorClearGhostValues +#undef hypre_StructVectorClearValues +#undef hypre_StructVectorClone +#undef hypre_StructVectorComputeDataSpace +#undef hypre_StructVectorCreate +#undef hypre_StructVectorDestroy +#undef hypre_StructVectorForget +#undef hypre_StructVectorGetMigrateCommPkg +#undef hypre_StructVectorInitialize +#undef hypre_StructVectorInitializeData +#undef hypre_StructVectorInitializeShell +#undef hypre_StructVectorMapCommInfo +#undef hypre_StructVectorMapDataBox +#undef hypre_StructVectorMapDataIndex +#undef hypre_StructVectorMapDataStride +#undef hypre_StructVectorMigrate +#undef hypre_StructVectorNeedResize +#undef hypre_StructVectorPointwiseDivision +#undef hypre_StructVectorPointwiseDivpy +#undef hypre_StructVectorPointwiseInverse +#undef hypre_StructVectorPointwiseProduct +#undef hypre_StructVectorPrint +#undef hypre_StructVectorPrintData +#undef hypre_StructVectorRead +#undef hypre_StructVectorReadData +#undef hypre_StructVectorRebase +#undef hypre_StructVectorRef +#undef hypre_StructVectorResize +#undef hypre_StructVectorRestore +#undef hypre_StructVectorScaleValues +#undef hypre_StructVectorSetBoxValues +#undef hypre_StructVectorSetConstantValues +#undef hypre_StructVectorSetDataSize +#undef hypre_StructVectorSetMemoryMode +#undef hypre_StructVectorSetNumGhost +#undef hypre_StructVectorSetRandomValues +#undef hypre_StructVectorSetStride +#undef hypre_StructVectorSetValues +#undef hypre_StructVectorUnMapDataBox +#undef hypre_StructVectorUnMapDataIndex +#undef hypre_StructVectorUnMapDataStride +#undef hypre_SubtractBoxArrays +#undef hypre_SubtractBoxes +#undef hypre_SubtractIndexes +#undef hypre_UnionBoxes +#undef hypre_destroycommpkg +#undef hypre_doubleBoxVolume +#undef hypre_entryqsort2 +#undef hypre_entryswap2 +#undef hypre_structgridassemble +#undef hypre_structgridcreate +#undef hypre_structgriddestroy +#undef hypre_structgridsetextents +#undef hypre_structgridsetnumghost +#undef hypre_structgridsetperiodic +#undef hypre_structmatrixaddtoboxvalues +#undef hypre_structmatrixaddtoconstant +#undef hypre_structmatrixaddtovalues +#undef hypre_structmatrixassemble +#undef hypre_structmatrixcreate +#undef hypre_structmatrixdestroy +#undef hypre_structmatrixgetboxvalues +#undef hypre_structmatrixgetgrid +#undef hypre_structmatrixinitialize +#undef hypre_structmatrixmatvec +#undef hypre_structmatrixprint +#undef hypre_structmatrixsetboxvalues +#undef hypre_structmatrixsetconstanten +#undef hypre_structmatrixsetconstantva +#undef hypre_structmatrixsetnumghost +#undef hypre_structmatrixsetsymmetric +#undef hypre_structmatrixsetvalues +#undef hypre_structstencilcreate +#undef hypre_structstencildestroy +#undef hypre_structstencilsetelement +#undef hypre_structstencilsetentry +#undef hypre_structvectoraddtoboxvalue +#undef hypre_structvectoraddtovalues +#undef hypre_structvectorassemble +#undef hypre_structvectorcopy +#undef hypre_structvectorcreate +#undef hypre_structvectordestroy +#undef hypre_structvectorgetboxvalues +#undef hypre_structvectorgetmigratecom +#undef hypre_structvectorgetvalues +#undef hypre_structvectorinitialize +#undef hypre_structvectormigrate +#undef hypre_structvectorprint +#undef hypre_structvectorscalevalues +#undef hypre_structvectorsetboxvalues +#undef hypre_structvectorsetconstantva +#undef hypre_structvectorsetnumghost +#undef hypre_structvectorsetrandomvalu +#undef hypre_structvectorsetvalues diff --git a/src/struct_mv/assumed_part.c b/src/struct_mv/assumed_part.c index a7badb373a..a9ac9298f0 100644 --- a/src/struct_mv/assumed_part.c +++ b/src/struct_mv/assumed_part.c @@ -124,7 +124,7 @@ hypre_APSubdivideRegion( hypre_Box *region, } /* 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; @@ -294,11 +294,11 @@ hypre_APGetAllBoxesInRegions( hypre_BoxArray *region_array, /* First get a count and volume of my boxes in each region */ 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, + 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 */ - dbl_vol_and_count = hypre_CTAlloc(HYPRE_Real, num_regions * 2, + 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, @@ -358,8 +358,8 @@ hypre_APShrinkRegions( hypre_BoxArray *region_array, 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); @@ -513,7 +513,7 @@ hypre_APPruneRegions( hypre_BoxArray *region_array, vol_array = *p_vol_array; num_regions = hypre_BoxArraySize(region_array); - delete_indices = hypre_CTAlloc(HYPRE_Int, num_regions, HYPRE_MEMORY_HOST); + delete_indices = hypre_CTAlloc(HYPRE_Int, num_regions, HYPRE_MEMORY_HOST); count = 0; /* Delete regions with zero elements */ @@ -594,9 +594,9 @@ hypre_APRefineRegionsByVol( hypre_BoxArray *region_array, return hypre_error_flag; } - fraction_full = hypre_CTAlloc(HYPRE_Real, num_regions, HYPRE_MEMORY_HOST); - order = hypre_CTAlloc(HYPRE_Int, num_regions, HYPRE_MEMORY_HOST); - delete_indices = hypre_CTAlloc(HYPRE_Int, num_regions, HYPRE_MEMORY_HOST); + fraction_full = hypre_CTAlloc(HYPRE_Real, num_regions, HYPRE_MEMORY_HOST); + order = hypre_CTAlloc(HYPRE_Int, num_regions, HYPRE_MEMORY_HOST); + delete_indices = hypre_CTAlloc(HYPRE_Int, num_regions, HYPRE_MEMORY_HOST); for (i = 0; i < num_regions; i++) { @@ -721,9 +721,6 @@ hypre_APRefineRegionsByVol( hypre_BoxArray *region_array, /****************************************************************************** * Construct an assumed partition * - * 8/06 - Changed the assumption that the local boxes have boxnums 0 to - * num(local_boxes)-1 (now need to pass in ids). - * * 10/06 - Changed. No longer need to deal with negative boxes as this is used * through the box manager. * @@ -738,7 +735,6 @@ hypre_StructAssumedPartitionCreate( 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, @@ -779,6 +775,7 @@ hypre_StructAssumedPartitionCreate( HYPRE_Int *contact_boxinfo; HYPRE_Int index; + HYPRE_ANNOTATE_FUNC_BEGIN; hypre_MPI_Comm_size(comm, &num_procs); hypre_MPI_Comm_rank(comm, &myid); @@ -787,14 +784,14 @@ hypre_StructAssumedPartitionCreate( if (global_num_boxes == 0) { region_array = hypre_BoxArrayCreate(0, ndim); - assumed_part = hypre_TAlloc(hypre_StructAssumedPart, 1, HYPRE_MEMORY_HOST); + assumed_part = hypre_TAlloc(hypre_StructAssumedPart, 1, HYPRE_MEMORY_HOST); hypre_StructAssumedPartNDim(assumed_part) = ndim; hypre_StructAssumedPartRegions(assumed_part) = region_array; hypre_StructAssumedPartNumRegions(assumed_part) = 0; hypre_StructAssumedPartDivisions(assumed_part) = NULL; hypre_StructAssumedPartProcPartitions(assumed_part) = - hypre_CTAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); + hypre_CTAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); hypre_StructAssumedPartProcPartition(assumed_part, 0) = 0; hypre_StructAssumedPartMyPartition(assumed_part) = NULL; hypre_StructAssumedPartMyPartitionBoxes(assumed_part) @@ -802,10 +799,11 @@ hypre_StructAssumedPartitionCreate( hypre_StructAssumedPartMyPartitionIdsAlloc(assumed_part) = 0; hypre_StructAssumedPartMyPartitionIdsSize(assumed_part) = 0; hypre_StructAssumedPartMyPartitionNumDistinctProcs(assumed_part) = 0; - hypre_StructAssumedPartMyPartitionBoxnums(assumed_part) = NULL; hypre_StructAssumedPartMyPartitionProcIds(assumed_part) = NULL; *p_assumed_partition = assumed_part; + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } /* End special case of zero boxes */ @@ -884,8 +882,8 @@ hypre_StructAssumedPartitionCreate( /* Need space for count and volume */ size = hypre_BoxArraySize(region_array); count_array_size = size; /* Memory allocation size */ - count_array = hypre_CTAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); - vol_array = hypre_CTAlloc(HYPRE_Real, size, HYPRE_MEMORY_HOST); + count_array = hypre_CTAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); + vol_array = hypre_CTAlloc(HYPRE_Real, size, HYPRE_MEMORY_HOST); /* How many boxes are in each region (global count) and what is the volume */ hypre_APGetAllBoxesInRegions(region_array, local_boxes, &count_array, @@ -937,8 +935,8 @@ hypre_StructAssumedPartitionCreate( size = hypre_BoxArraySize(region_array); if (size > count_array_size) { - 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 = 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; } @@ -1010,16 +1008,16 @@ hypre_StructAssumedPartitionCreate( /* Now we have the regions - construct the assumed partition */ size = hypre_BoxArraySize(region_array); - assumed_part = hypre_TAlloc(hypre_StructAssumedPart, 1, HYPRE_MEMORY_HOST); + assumed_part = hypre_TAlloc(hypre_StructAssumedPart, 1, HYPRE_MEMORY_HOST); hypre_StructAssumedPartNDim(assumed_part) = ndim; hypre_StructAssumedPartRegions(assumed_part) = region_array; /* The above is aliased, so don't destroy region_array in this function */ hypre_StructAssumedPartNumRegions(assumed_part) = size; hypre_StructAssumedPartDivisions(assumed_part) = - hypre_CTAlloc(hypre_Index, size, HYPRE_MEMORY_HOST); + hypre_CTAlloc(hypre_Index, size, HYPRE_MEMORY_HOST); /* First determine which processors (how many) to assign to each region */ - proc_array = hypre_CTAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); + proc_array = hypre_CTAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); /* This is different than the total number of boxes as some boxes can be in more than one region */ total_boxes = 0; @@ -1122,7 +1120,7 @@ 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++) { @@ -1216,6 +1214,9 @@ hypre_StructAssumedPartitionCreate( #endif } /* End of FOR EACH REGION loop */ + hypre_SetIndex(hypre_StructAssumedPartOrigin(assumed_part), 0); + hypre_SetIndex(hypre_StructAssumedPartStride(assumed_part), 1); + /* NOW WE HAVE COMPLETED GLOBAL INFO - START FILLING IN LOCAL INFO */ /* We need to populate the assumed partition object with info specific to @@ -1247,7 +1248,7 @@ hypre_StructAssumedPartitionCreate( Use the exchange data functionality for this. */ proc_alloc = hypre_pow2(ndim); - proc_array = hypre_TReAlloc(proc_array, HYPRE_Int, proc_alloc, HYPRE_MEMORY_HOST); + proc_array = hypre_TReAlloc(proc_array, HYPRE_Int, proc_alloc, HYPRE_MEMORY_HOST); /* Probably there will mostly be one proc per box */ /* Don't want to allocate too much memory here */ @@ -1280,7 +1281,7 @@ hypre_StructAssumedPartitionCreate( for (j = 0; j < proc_count; j++) { tmp_proc_ids[count] = proc_array[j]; - tmp_box_nums[count] = local_boxnums[i]; + tmp_box_nums[count] = i; tmp_box_inds[count] = i; count++; } @@ -1289,7 +1290,7 @@ hypre_StructAssumedPartitionCreate( hypre_BoxDestroy(grow_box); /* Now we have two arrays: tmp_proc_ids and tmp_box_nums. These are - corresponding box numbers and proc ids. We need to sort the processor ids + corresponding proc ids and box numbers. We need to sort the processor ids and then create a new buffer to send to the exchange data function. */ /* Sort the proc_ids */ @@ -1299,10 +1300,10 @@ hypre_StructAssumedPartitionCreate( 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 * (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 = 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[0] = 0; proc_count = 0; @@ -1312,7 +1313,6 @@ hypre_StructAssumedPartitionCreate( { proc_array[0] = tmp_proc_ids[0]; - contact_boxinfo[index++] = tmp_box_nums[0]; box = hypre_BoxArrayBox(local_boxes, tmp_box_inds[0]); for (d = 0; d < ndim; d++) { @@ -1333,7 +1333,6 @@ hypre_StructAssumedPartitionCreate( /* These boxes are not copied in a particular order */ - contact_boxinfo[index++] = tmp_box_nums[i]; box = hypre_BoxArrayBox(local_boxes, tmp_box_inds[i]); for (d = 0; d < ndim; d++) { @@ -1358,8 +1357,6 @@ hypre_StructAssumedPartitionCreate( hypre_StructAssumedPartMyPartitionIdsAlloc(assumed_part) = box_count; hypre_StructAssumedPartMyPartitionProcIds(assumed_part) = hypre_CTAlloc(HYPRE_Int, box_count, HYPRE_MEMORY_HOST); - hypre_StructAssumedPartMyPartitionBoxnums(assumed_part) - = hypre_CTAlloc(HYPRE_Int, box_count, HYPRE_MEMORY_HOST); hypre_StructAssumedPartMyPartitionNumDistinctProcs(assumed_part) = 0; /* Set up for exchanging data */ @@ -1374,11 +1371,10 @@ hypre_StructAssumedPartitionCreate( max_response_size = 0; /* No response data - just confirmation */ - hypre_DataExchangeList(proc_count, proc_array, - contact_boxinfo, proc_array_starts, - (1 + 2 * ndim)*sizeof(HYPRE_Int), - sizeof(HYPRE_Int), &response_obj, max_response_size, 1, - comm, (void**) &response_buf, &response_buf_starts); + hypre_DataExchangeList(proc_count, proc_array, contact_boxinfo, proc_array_starts, + (2 * ndim)*sizeof(HYPRE_Int), sizeof(HYPRE_Int), + &response_obj, max_response_size, 1, comm, + (void**) &response_buf, &response_buf_starts); hypre_TFree(proc_array, HYPRE_MEMORY_HOST); hypre_TFree(proc_array_starts, HYPRE_MEMORY_HOST); @@ -1389,6 +1385,8 @@ hypre_StructAssumedPartitionCreate( /* Return vars */ *p_assumed_partition = assumed_part; + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } @@ -1407,7 +1405,6 @@ hypre_StructAssumedPartitionDestroy( hypre_StructAssumedPart *assumed_part ) hypre_BoxArrayDestroy( hypre_StructAssumedPartMyPartition(assumed_part)); hypre_BoxArrayDestroy( hypre_StructAssumedPartMyPartitionBoxes(assumed_part)); hypre_TFree(hypre_StructAssumedPartMyPartitionProcIds(assumed_part), HYPRE_MEMORY_HOST); - hypre_TFree( hypre_StructAssumedPartMyPartitionBoxnums(assumed_part), HYPRE_MEMORY_HOST); /* This goes last! */ hypre_TFree(assumed_part, HYPRE_MEMORY_HOST); @@ -1432,7 +1429,7 @@ hypre_APFillResponseStructAssumedPart(void *p_recv_contact_buf, HYPRE_UNUSED_VAR(p_send_response_buf); HYPRE_Int ndim, size, alloc_size, myid, i, d, index; - HYPRE_Int *ids, *boxnums; + HYPRE_Int *ids; HYPRE_Int *recv_contact_buf; hypre_Box *box; @@ -1447,7 +1444,6 @@ hypre_APFillResponseStructAssumedPart(void *p_recv_contact_buf, ndim = hypre_StructAssumedPartNDim(assumed_part); part_boxes = hypre_StructAssumedPartMyPartitionBoxes(assumed_part); ids = hypre_StructAssumedPartMyPartitionProcIds(assumed_part); - boxnums = hypre_StructAssumedPartMyPartitionBoxnums(assumed_part); size = hypre_StructAssumedPartMyPartitionIdsSize(assumed_part); alloc_size = hypre_StructAssumedPartMyPartitionIdsAlloc(assumed_part); @@ -1457,12 +1453,11 @@ hypre_APFillResponseStructAssumedPart(void *p_recv_contact_buf, /* Increment how many procs have contacted us */ hypre_StructAssumedPartMyPartitionNumDistinctProcs(assumed_part)++; - /* Check to see if we need to allocate more space for ids and boxnums */ + /* Check to see if we need to allocate more space for ids */ if ((size + contact_size) > alloc_size) { alloc_size = size + contact_size; - ids = hypre_TReAlloc(ids, HYPRE_Int, alloc_size, HYPRE_MEMORY_HOST); - boxnums = hypre_TReAlloc(boxnums, HYPRE_Int, alloc_size, HYPRE_MEMORY_HOST); + ids = hypre_TReAlloc(ids, HYPRE_Int, alloc_size, HYPRE_MEMORY_HOST); hypre_StructAssumedPartMyPartitionIdsAlloc(assumed_part) = alloc_size; } @@ -1473,7 +1468,6 @@ hypre_APFillResponseStructAssumedPart(void *p_recv_contact_buf, for (i = 0; i < contact_size; i++) { 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++]; @@ -1488,7 +1482,6 @@ hypre_APFillResponseStructAssumedPart(void *p_recv_contact_buf, /* In case more memory was allocated we have to assign these pointers back */ hypre_StructAssumedPartMyPartitionBoxes(assumed_part) = part_boxes; hypre_StructAssumedPartMyPartitionProcIds(assumed_part) = ids; - hypre_StructAssumedPartMyPartitionBoxnums(assumed_part) = boxnums; /* Output - no message to return (confirmation) */ *response_message_size = 0; @@ -1550,8 +1543,7 @@ hypre_StructAssumedPartitionGetRegionsFromProc( /* How many processors in that region? */ proc_count = proc_partitions[in_region + 1] - proc_partitions[in_region]; /* Get the region */ - region = hypre_BoxArrayBox(hypre_StructAssumedPartRegions(assumed_part), - in_region); + region = hypre_BoxArrayBox(hypre_StructAssumedPartRegions(assumed_part), in_region); /* Size of the regions */ hypre_BoxGetSize(region, rsize); /* Get the divisions in each dimension */ @@ -1642,12 +1634,18 @@ hypre_StructAssumedPartitionGetProcsFromBox( HYPRE_Int *proc_ids, num_proc_ids, size_proc_ids, ncorners; hypre_Box *region; - hypre_Box *result_box, *part_box, *part_dbox; + hypre_Box *mapped_box, *result_box, *part_box, *part_dbox; hypre_Index div, rsize, stride, loop_size; hypre_IndexRef start; hypre_BoxArray *region_array; HYPRE_Int *proc_partitions; + /* Map the box to the AP region grid */ + mapped_box = hypre_BoxCreate(ndim); + hypre_CopyBox(box, mapped_box); + hypre_RefineBox(mapped_box, hypre_StructAssumedPartOrigin(assumed_part), + hypre_StructAssumedPartStride(assumed_part)); + /* Need myid only for the hypre_printf statement */ hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &myid); @@ -1662,12 +1660,12 @@ hypre_StructAssumedPartitionGetProcsFromBox( result_box = hypre_BoxCreate(ndim); part_box = hypre_BoxCreate(ndim); part_dbox = hypre_BoxCreate(ndim); - which_regions = hypre_CTAlloc(HYPRE_Int, num_regions, HYPRE_MEMORY_HOST); + which_regions = hypre_CTAlloc(HYPRE_Int, num_regions, HYPRE_MEMORY_HOST); /* The number of corners in a box is a good initial size for proc_ids */ ncorners = hypre_pow2(ndim); size_proc_ids = ncorners; - proc_ids = hypre_CTAlloc(HYPRE_Int, size_proc_ids, HYPRE_MEMORY_HOST); + proc_ids = hypre_CTAlloc(HYPRE_Int, size_proc_ids, HYPRE_MEMORY_HOST); num_proc_ids = 0; /* which partition region(s) am i in? */ @@ -1675,38 +1673,14 @@ hypre_StructAssumedPartitionGetProcsFromBox( for (i = 0; i < num_regions; i++) { region = hypre_BoxArrayBox(region_array, i); - hypre_IntersectBoxes(box, region, result_box); - if ( hypre_BoxVolume(result_box) > 0 ) + hypre_IntersectBoxes(mapped_box, region, result_box); + if ( hypre_BoxVolume(result_box) > 0 ) { which_regions[in_regions] = i; in_regions++; } } -#if 0 - if (in_regions == 0) - { - /* 9/16/10 - In hypre_SStructGridAssembleBoxManagers we grow boxes by 1 - before we gather boxes because of shared variables, so we can get the - situation that the gather box is outside of the assumed region. */ - - if (hypre_BoxVolume(box) > 0) - { - hypre_error(HYPRE_ERROR_GENERIC); - hypre_printf("MY_ID = %d Error: positive volume box (%d, %d, %d) x " - "(%d, %d, %d) not in any assumed regions! (this should never" - " happen)\n", - myid, - hypre_BoxIMinX(box), - hypre_BoxIMinY(box), - hypre_BoxIMinZ(box), - hypre_BoxIMaxX(box), - hypre_BoxIMaxY(box), - hypre_BoxIMaxZ(box)); - } - } -#endif - /* For each region, who is assumed to own this box? Add the proc number to proc array. */ for (r = 0; r < in_regions; r++) @@ -1721,11 +1695,10 @@ hypre_StructAssumedPartitionGetProcsFromBox( /* Size of the regions */ hypre_BoxGetSize(region, rsize); /* Get the divisons in each dimension */ - hypre_CopyIndex(hypre_StructAssumedPartDivision(assumed_part, this_region), - div); + hypre_CopyIndex(hypre_StructAssumedPartDivision(assumed_part, this_region), div); /* Intersect box with region */ - hypre_IntersectBoxes(box, region, result_box); + hypre_IntersectBoxes(mapped_box, region, result_box); /* Compute part_box (the intersected assumed partitions) from result_box. Start part index number from 1 for convenience in BoxLoop below. */ @@ -1786,7 +1759,7 @@ hypre_StructAssumedPartitionGetProcsFromBox( if (num_proc_ids == size_proc_ids) { size_proc_ids += ncorners; - proc_ids = hypre_TReAlloc(proc_ids, HYPRE_Int, size_proc_ids, HYPRE_MEMORY_HOST); + proc_ids = hypre_TReAlloc(proc_ids, HYPRE_Int, size_proc_ids, HYPRE_MEMORY_HOST); } proc_ids[num_proc_ids] = adj_proc_id + proc_start; @@ -1805,7 +1778,7 @@ hypre_StructAssumedPartitionGetProcsFromBox( /* Make sure we have enough space from proc_array */ if (*size_alloc_proc_array < num_proc_ids) { - proc_array = hypre_TReAlloc(proc_array, HYPRE_Int, num_proc_ids, HYPRE_MEMORY_HOST); + proc_array = hypre_TReAlloc(proc_array, HYPRE_Int, num_proc_ids, HYPRE_MEMORY_HOST); *size_alloc_proc_array = num_proc_ids; } @@ -1831,6 +1804,7 @@ hypre_StructAssumedPartitionGetProcsFromBox( *num_proc_array = proc_array_count; /* Clean up*/ + hypre_BoxDestroy(mapped_box); hypre_BoxDestroy(result_box); hypre_BoxDestroy(part_box); hypre_BoxDestroy(part_dbox); @@ -1840,61 +1814,230 @@ hypre_StructAssumedPartitionGetProcsFromBox( return hypre_error_flag; } -#if 0 /****************************************************************************** - * UNFINISHED - * + * Print assumed partition (to help with debugging) + *****************************************************************************/ + +static HYPRE_Int hypre_AP_print_num = 0; + +HYPRE_Int +hypre_StructAssumedPartitionPrint(const char *filename, + hypre_StructAssumedPart *ap ) +{ + FILE *file; + char new_filename[255]; + HYPRE_Int myid, ndim, i, d; + hypre_BoxArray *boxes; + hypre_Box *box; + hypre_IndexRef index; + + /*---------------------------------------- + * Open file + *----------------------------------------*/ + + hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &myid ); + + hypre_sprintf(new_filename, "%s.%05d.%03d", filename, myid, hypre_AP_print_num); + hypre_AP_print_num++; + + if ((file = fopen(new_filename, "w")) == NULL) + { + hypre_printf("Error: can't open output file %s\n", new_filename); + exit(1); + } + + if (ap == NULL) + { + hypre_fprintf(file, "Assumed partition is NULL\n"); + fflush(file); + fclose(file); + + return hypre_error_flag; + } + + /*---------------------------------------- + * Print AP + *----------------------------------------*/ + + hypre_fprintf(file, "\n"); + + ndim = hypre_StructAssumedPartNDim(ap); + hypre_fprintf(file, "ndim = %d\n\n", ndim); + + hypre_fprintf(file, "num regions = %d\n\n", hypre_StructAssumedPartNumRegions(ap)); + { + HYPRE_Int *proc_partitions = hypre_StructAssumedPartProcPartitions(ap); + + boxes = hypre_StructAssumedPartRegions(ap); + hypre_ForBoxI(i, boxes) + { + box = hypre_BoxArrayBox(boxes, i); + hypre_fprintf(file, "region % 2d:", i); + index = hypre_BoxIMin(box); + hypre_fprintf(file, " ("); + for (d = 0; d < ndim; d++) + { + hypre_fprintf(file, " %d", hypre_IndexD(index, d)); + } + hypre_fprintf(file, " ) x ("); + index = hypre_BoxIMax(box); + for (d = 0; d < ndim; d++) + { + hypre_fprintf(file, " %d", hypre_IndexD(index, d)); + } + hypre_fprintf(file, " )"); + hypre_fprintf(file, " ; procs = %d %d", proc_partitions[i], proc_partitions[i + 1] - 1); + hypre_fprintf(file, " ; division = "); + index = hypre_StructAssumedPartDivision(ap, i); + for (d = 0; d < ndim; d++) + { + hypre_fprintf(file, " %d", hypre_IndexD(index, d)); + } + hypre_fprintf(file, "\n"); + } + } + hypre_fprintf(file, "\n"); + + { + boxes = hypre_StructAssumedPartMyPartition(ap); + for (i = 0; i < 2; i++) + { + box = hypre_BoxArrayBox(boxes, i); + hypre_fprintf(file, "partition %d:", i); + index = hypre_BoxIMin(box); + hypre_fprintf(file, " ("); + for (d = 0; d < ndim; d++) + { + hypre_fprintf(file, " %d", hypre_IndexD(index, d)); + } + hypre_fprintf(file, " ) x ("); + index = hypre_BoxIMax(box); + for (d = 0; d < ndim; d++) + { + hypre_fprintf(file, " %d", hypre_IndexD(index, d)); + } + hypre_fprintf(file, " )\n"); + } + } + hypre_fprintf(file, "\n"); + + index = hypre_StructAssumedPartOrigin(ap); + hypre_fprintf(file, "origin = ("); + for (d = 0; d < ndim; d++) + { + hypre_fprintf(file, " %d", hypre_IndexD(index, d)); + } + hypre_fprintf(file, " )\n"); + + index = hypre_StructAssumedPartStride(ap); + hypre_fprintf(file, "stride = ("); + for (d = 0; d < ndim; d++) + { + hypre_fprintf(file, " %d", hypre_IndexD(index, d)); + } + hypre_fprintf(file, " )\n\n"); + + hypre_fprintf(file, "my partition ids size = %d\n", + hypre_StructAssumedPartMyPartitionIdsSize(ap)); + hypre_fprintf(file, "my partition ids alloc size = %d\n", + hypre_StructAssumedPartMyPartitionIdsAlloc(ap)); + hypre_fprintf(file, "my partition num distinct procs = %d\n", + hypre_StructAssumedPartMyPartitionNumDistinctProcs(ap)); + hypre_fprintf(file, "\n"); + { + HYPRE_Int *proc_ids = hypre_StructAssumedPartMyPartitionProcIds(ap); + + boxes = hypre_StructAssumedPartMyPartitionBoxes(ap); + hypre_ForBoxI(i, boxes) + { + box = hypre_BoxArrayBox(boxes, i); + hypre_fprintf(file, "partition box %d:", i); + index = hypre_BoxIMin(box); + hypre_fprintf(file, " ("); + for (d = 0; d < ndim; d++) + { + hypre_fprintf(file, " %d", hypre_IndexD(index, d)); + } + hypre_fprintf(file, " ) x ("); + index = hypre_BoxIMax(box); + for (d = 0; d < ndim; d++) + { + hypre_fprintf(file, " %d", hypre_IndexD(index, d)); + } + hypre_fprintf(file, " )"); + hypre_fprintf(file, " ; proc id = %d\n", proc_ids[i]); + } + } + hypre_fprintf(file, "\n"); + + /*---------------------------------------- + * Close file + *----------------------------------------*/ + + fflush(file); + fclose(file); + + return hypre_error_flag; +} + +/****************************************************************************** * Create a new assumed partition by coarsening another assumed partition. - * - * Unfinished because of a problem: Can't figure out what the new id is since - * the zero boxes drop out, and we don't have all of the boxes from a particular - * processor in the AP. This may not be a problem any longer (see [issue708]). *****************************************************************************/ HYPRE_Int hypre_StructCoarsenAP(hypre_StructAssumedPart *ap, - hypre_Index index, + hypre_Index origin, hypre_Index stride, hypre_StructAssumedPart **new_ap_ptr ) { - HYPRE_Int num_regions; + HYPRE_Int ndim = hypre_StructAssumedPartNDim(ap); - hypre_BoxArray *coarse_boxes; - hypre_BoxArray *fine_boxes; - hypre_BoxArray *regions_array; - hypre_Box *box, *new_box; + HYPRE_Int num_regions, size, i; + hypre_BoxArray *regions, *new_regions; + hypre_BoxArray *boxes, *new_boxes; + hypre_Box *box, *new_box; + HYPRE_Int *proc_ids, *new_proc_ids; - hypre_StructAssumedPartition *new_ap; + hypre_StructAssumedPart *new_ap; /* Create new ap and copy global description information */ - new_ap = hypre_TAlloc(hypre_StructAssumedPart, 1, HYPRE_MEMORY_HOST); + new_ap = hypre_TAlloc(hypre_StructAssumedPart, 1, HYPRE_MEMORY_HOST); + + hypre_StructAssumedPartNDim(new_ap) = ndim; num_regions = hypre_StructAssumedPartNumRegions(ap); - regions_array = hypre_BoxArrayCreate(num_regions, ndim); + regions = hypre_StructAssumedPartRegions(ap); - hypre_StructAssumedPartRegions(new_ap) = regions_array; + new_regions = hypre_BoxArrayCreate(num_regions, ndim); + hypre_StructAssumedPartRegions(new_ap) = new_regions; 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); - - hypre_StructAssumedPartProcPartitions(new_ap)[0] = 0; + hypre_CTAlloc(hypre_Index, num_regions, HYPRE_MEMORY_HOST); + hypre_StructAssumedPartProcPartition(new_ap, 0) = hypre_StructAssumedPartProcPartition(ap, 0); for (i = 0; i < num_regions; i++) { - box = hypre_BoxArrayBox(hypre_StructAssumedPartRegions(ap), i); - - hypre_CopyBox(box, hypre_BoxArrayBox(regions_array, i)); + box = hypre_BoxArrayBox(regions, i); + new_box = hypre_BoxArrayBox(new_regions, i); + hypre_CopyBox(box, new_box); - hypre_StructAssumedPartDivision(new_ap, i) = - hypre_StructAssumedPartDivision(new_ap, i); + hypre_CopyIndex(hypre_StructAssumedPartDivision(ap, i), + hypre_StructAssumedPartDivision(new_ap, i)); hypre_StructAssumedPartProcPartition(new_ap, i + 1) = hypre_StructAssumedPartProcPartition(ap, i + 1); } - /* Copy my partition (at most 2 boxes)*/ + /* Compute new coarsening parameters for the AP */ + hypre_CopyIndex(hypre_StructAssumedPartOrigin(ap), hypre_StructAssumedPartOrigin(new_ap)); + hypre_CopyIndex(hypre_StructAssumedPartStride(ap), hypre_StructAssumedPartStride(new_ap)); + hypre_ComputeCoarseOriginStride(hypre_StructAssumedPartOrigin(new_ap), + hypre_StructAssumedPartStride(new_ap), + origin, stride, ndim); + + /* Copy my partition (at most 2 boxes) */ hypre_StructAssumedPartMyPartition(new_ap) = hypre_BoxArrayCreate(2, ndim); for (i = 0; i < 2; i++) { @@ -1903,41 +2046,40 @@ hypre_StructCoarsenAP(hypre_StructAssumedPart *ap, hypre_CopyBox(box, new_box); } - /* Create space for the boxes, ids and boxnums */ + /* Create space for the boxes and ids */ size = hypre_StructAssumedPartMyPartitionIdsSize(ap); - + hypre_StructAssumedPartMyPartitionBoxes(new_ap) = hypre_BoxArrayCreate(size, ndim); hypre_StructAssumedPartMyPartitionProcIds(new_ap) = - hypre_CTAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); - hypre_StructAssumedPartMyPartitionBoxnums(new_ap) = - hypre_CTAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); - - hypre_StructAssumedPartMyPartitionBoxes(new_ap) - = hypre_BoxArrayCreate(size, ndim); - - hypre_StructAssumedPartMyPartitionIdsAlloc(new_ap) = size; + hypre_CTAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); hypre_StructAssumedPartMyPartitionIdsSize(new_ap) = size; + hypre_StructAssumedPartMyPartitionIdsAlloc(new_ap) = size; /* Coarsen and copy the boxes. Need to prune size 0 boxes. */ - coarse_boxes = hypre_StructAssumedPartMyPartitionBoxes(new_ap); - fine_boxes = hypre_StructAssumedPartMyPartitionBoxes(ap); - - new_box = hypre_BoxCreate(ndim); - - hypre_ForBoxI(i, fine_boxes) + boxes = hypre_StructAssumedPartMyPartitionBoxes(ap); + new_boxes = hypre_StructAssumedPartMyPartitionBoxes(new_ap); + proc_ids = hypre_StructAssumedPartMyPartitionProcIds(ap); + new_proc_ids = hypre_StructAssumedPartMyPartitionProcIds(new_ap); + size = 0; + hypre_ForBoxI(i, boxes) { - box = hypre_BoxArrayBox(fine_boxes, i); + box = hypre_BoxArrayBox(boxes, i); + new_box = hypre_BoxArrayBox(new_boxes, size); hypre_CopyBox(box, new_box); - hypre_StructCoarsenBox(new_box, index, stride); - } + hypre_CoarsenBox(new_box, origin, stride); + new_proc_ids[size] = proc_ids[i]; - /* Unfinished because of a problem: Can't figure out what the new id is since - the zero boxes drop out, and we don't have all of the boxes from a - particular processor in the AP */ + if (hypre_BoxVolume(new_box)) + { + size++; + } + } + hypre_BoxArraySetSize(new_boxes, size); + hypre_StructAssumedPartMyPartitionIdsSize(new_ap) = size; - /* hypre_StructAssumedPartMyPartitionNumDistinctProcs(new_ap) */ + hypre_StructAssumedPartMyPartitionNumDistinctProcs(new_ap) = + hypre_StructAssumedPartMyPartitionNumDistinctProcs(ap); *new_ap_ptr = new_ap; return hypre_error_flag; } -#endif diff --git a/src/struct_mv/assumed_part.h b/src/struct_mv/assumed_part.h index 8ec5edd2cb..3607c3d146 100644 --- a/src/struct_mv/assumed_part.h +++ b/src/struct_mv/assumed_part.h @@ -24,11 +24,13 @@ typedef struct (this is size num_regions +1) */ hypre_Index *divisions; /* number of proc divisions in each direction for each region */ + + hypre_Index origin, stride; /* coarsening parameters for the AP */ + /* these entries are specific to each proc */ hypre_BoxArray *my_partition; /* my portion of grid (at most 2) */ 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_alloc; HYPRE_Int my_partition_num_distinct_procs; @@ -45,14 +47,14 @@ typedef struct #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_StructAssumedPartOrigin(apart) ((apart)->origin) +#define hypre_StructAssumedPartStride(apart) ((apart)->stride) #define hypre_StructAssumedPartMyPartition(apart) ((apart)->my_partition) #define hypre_StructAssumedPartMyPartitionBoxes(apart) ((apart)->my_partition_boxes) #define hypre_StructAssumedPartMyPartitionProcIds(apart) ((apart)->my_partition_proc_ids) #define hypre_StructAssumedPartMyPartitionIdsSize(apart) ((apart)->my_partition_ids_size) #define hypre_StructAssumedPartMyPartitionIdsAlloc(apart) ((apart)->my_partition_ids_alloc) #define hypre_StructAssumedPartMyPartitionNumDistinctProcs(apart) ((apart)->my_partition_num_distinct_procs) -#define hypre_StructAssumedPartMyPartitionBoxnums(apart) ((apart)->my_partition_boxnums) - #define hypre_StructAssumedPartMyPartitionProcId(apart, i) ((apart)->my_partition_proc_ids[i]) -#define hypre_StructAssumedPartMyPartitionBoxnum(apart, i) ((apart)->my_partition_boxnums[i]) + #endif diff --git a/src/struct_mv/box.c b/src/struct_mv/box.c index 4ce82449b7..d00f65721e 100644 --- a/src/struct_mv/box.c +++ b/src/struct_mv/box.c @@ -52,6 +52,23 @@ hypre_CopyIndex( hypre_Index in_index, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CopyToIndex( hypre_Index in_index, + HYPRE_Int ndim, + hypre_Index out_index ) +{ + HYPRE_Int d; + for (d = 0; d < ndim; d++) + { + hypre_IndexD(out_index, d) = hypre_IndexD(in_index, d); + } + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -138,6 +155,24 @@ hypre_IndexMax( hypre_Index index, return max; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IndexElementMult( hypre_Index index, + HYPRE_Int ndim ) +{ + HYPRE_Int d, mult; + + mult = 1; + for (d = 0; d < ndim; d++) + { + mult *= hypre_IndexD(index, d); + } + + return mult; +} + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -199,6 +234,52 @@ hypre_IndexesEqual( hypre_Index index1, return equal; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IndexesGreater( hypre_Index index1, + hypre_Index index2, + HYPRE_Int ndim ) +{ + HYPRE_Int d, greater; + + greater = 1; + for (d = 0; d < ndim; d++) + { + if ( !(hypre_IndexD(index1, d) > hypre_IndexD(index2, d)) ) + { + greater = 0; + break; + } + } + + return greater; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IndexesGreaterEqual( hypre_Index index1, + hypre_Index index2, + HYPRE_Int ndim ) +{ + HYPRE_Int d, greaterequal; + + greaterequal = 1; + for (d = 0; d < ndim; d++) + { + if ( !(hypre_IndexD(index1, d) >= hypre_IndexD(index2, d)) ) + { + greaterequal = 0; + break; + } + } + + return greaterequal; +} + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -209,12 +290,12 @@ hypre_IndexPrint( FILE *file, { HYPRE_Int d; - hypre_fprintf(file, "[%d", hypre_IndexD(index, 0)); + 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, ", %d", hypre_IndexD(index, d)); } - hypre_fprintf(file, "]"); + hypre_fprintf(file, ")"); return hypre_error_flag; } @@ -229,12 +310,12 @@ hypre_IndexRead( FILE *file, { HYPRE_Int d; - hypre_fscanf(file, "[%d", &hypre_IndexD(index, 0)); + 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, ", %d", &hypre_IndexD(index, d)); } - hypre_fscanf(file, "]"); + hypre_fscanf(file, ")"); for (d = ndim; d < HYPRE_MAXDIM; d++) { @@ -256,7 +337,7 @@ hypre_BoxCreate( HYPRE_Int ndim ) { hypre_Box *box; - box = hypre_CTAlloc(hypre_Box, 1, HYPRE_MEMORY_HOST); + box = hypre_CTAlloc(hypre_Box, 1, HYPRE_MEMORY_HOST); hypre_BoxNDim(box) = ndim; return box; @@ -322,7 +403,7 @@ hypre_CopyBox( hypre_Box *box1, *--------------------------------------------------------------------------*/ hypre_Box * -hypre_BoxDuplicate( hypre_Box *box ) +hypre_BoxClone( hypre_Box *box ) { hypre_Box *new_box; @@ -356,8 +437,8 @@ hypre_BoxVolume( hypre_Box *box ) HYPRE_Real hypre_doubleBoxVolume( hypre_Box *box ) { - HYPRE_Real volume; - HYPRE_Int d, ndim = hypre_BoxNDim(box); + HYPRE_Real volume; + HYPRE_Int d, ndim = hypre_BoxNDim(box); volume = 1.0; for (d = 0; d < ndim; d++) @@ -368,6 +449,65 @@ hypre_doubleBoxVolume( hypre_Box *box ) return volume; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxStrideVolume( hypre_Box *box, + hypre_Index stride) +{ + HYPRE_Int ndim = hypre_BoxNDim(box); + HYPRE_Int volume, d, s; + + volume = 1; + for (d = 0; d < ndim; d++) + { + s = hypre_BoxSizeD(box, d); + if (s > 0) + { + s = (s - 1) / hypre_IndexD(stride, d) + 1; + } + volume *= s; + } + + return volume; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxPartialVolume( hypre_Box *box, + hypre_Index partial_volume) +{ + HYPRE_Int d, ndim = hypre_BoxNDim(box); + + partial_volume[0] = hypre_BoxSizeD(box, 0); + for (d = 1; d < ndim; d++) + { + partial_volume[d] = partial_volume[d - 1] * hypre_BoxSizeD(box, d); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxNnodes( hypre_Box *box ) +{ + HYPRE_Int nnodes, d, ndim = hypre_BoxNDim(box); + + nnodes = 1; + for (d = 0; d < ndim; d++) + { + nnodes *= (hypre_BoxSizeD(box, d) + 1); + } + + return nnodes; +} + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -390,6 +530,61 @@ hypre_IndexInBox( hypre_Index index, return inbox; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxInBox( hypre_Box *box1, + hypre_Box *box2 ) +{ + HYPRE_Int inbox = 0; + + if ( hypre_IndexInBox(hypre_BoxIMin(box1), box2) && + hypre_IndexInBox(hypre_BoxIMax(box1), box2) ) + { + inbox = 1; + } + + return inbox; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxesEqual( hypre_Box *box1, + hypre_Box *box2 ) +{ + HYPRE_Int ndim = hypre_BoxNDim(box1); + HYPRE_Int equal = 0; + + if ( hypre_IndexesEqual(hypre_BoxIMin(box1), hypre_BoxIMin(box2), ndim) && + hypre_IndexesEqual(hypre_BoxIMax(box1), hypre_BoxIMax(box2), ndim) ) + { + equal = 1; + } + + return equal; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxMaxSize( hypre_Box *box) +{ + HYPRE_Int d, ndim = hypre_BoxNDim(box); + HYPRE_Int max; + + max = 0; + for (d = 0; d < ndim; d++) + { + max = hypre_max(max, hypre_BoxSizeD(box, d)); + } + + return max; +} + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -404,6 +599,11 @@ hypre_BoxGetSize( hypre_Box *box, hypre_IndexD(size, d) = hypre_BoxSizeD(box, d); } + for (d = ndim; d < HYPRE_MAXDIM; d++) + { + hypre_IndexD(size, d) = 0; + } + return hypre_error_flag; } @@ -427,6 +627,11 @@ hypre_BoxGetStrideSize( hypre_Box *box, hypre_IndexD(size, d) = s; } + for (d = ndim; d < HYPRE_MAXDIM; d++) + { + hypre_IndexD(size, d) = 0; + } + return hypre_error_flag; } @@ -608,6 +813,27 @@ hypre_BoxGrowByValue( hypre_Box *box, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * Grow a box outward to encompass a second box + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxGrowByBox( hypre_Box *box, + hypre_Box *gbox ) +{ + HYPRE_Int d, ndim = hypre_BoxNDim(box); + + for (d = 0; d < ndim; d++) + { + hypre_BoxIMinD(box, d) = + hypre_min(hypre_BoxIMinD(box, d), hypre_BoxIMinD(gbox, d)); + hypre_BoxIMaxD(box, d) = + hypre_max(hypre_BoxIMaxD(box, d), hypre_BoxIMaxD(gbox, d)); + } + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- * Grow a box as specified by array *--------------------------------------------------------------------------*/ @@ -656,6 +882,32 @@ hypre_BoxPrint( FILE *file, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * Print box info to stdout for debugging purposes + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxPrintDebug( const char *prefix, + hypre_Box *box ) +{ + HYPRE_Int d, ndim = hypre_BoxNDim(box); + + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "%s", prefix); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "(%d", hypre_BoxIMinD(box, 0)); + for (d = 1; d < ndim; d++) + { + hypre_ParPrintf(hypre_MPI_COMM_WORLD, ", %d", hypre_BoxIMinD(box, d)); + } + hypre_ParPrintf(hypre_MPI_COMM_WORLD, ") x (%d", hypre_BoxIMaxD(box, 0)); + for (d = 1; d < ndim; d++) + { + hypre_ParPrintf(hypre_MPI_COMM_WORLD, ", %d", hypre_BoxIMaxD(box, d)); + } + hypre_ParPrintf(hypre_MPI_COMM_WORLD, ") - volume: %d\n", hypre_BoxVolume(box)); + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- * Read a box from file *--------------------------------------------------------------------------*/ @@ -711,14 +963,16 @@ hypre_BoxArrayCreate( HYPRE_Int size, hypre_Box *box; hypre_BoxArray *box_array; - box_array = hypre_TAlloc(hypre_BoxArray, 1, HYPRE_MEMORY_HOST); + box_array = hypre_TAlloc(hypre_BoxArray, 1, HYPRE_MEMORY_HOST); - hypre_BoxArrayBoxes(box_array) = hypre_CTAlloc(hypre_Box, size, HYPRE_MEMORY_HOST); + hypre_BoxArrayBoxes(box_array) = hypre_CTAlloc(hypre_Box, size, HYPRE_MEMORY_HOST); hypre_BoxArraySize(box_array) = size; hypre_BoxArrayAllocSize(box_array) = size; hypre_BoxArrayNDim(box_array) = ndim; + hypre_BoxArrayIDs(box_array) = hypre_CTAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); for (i = 0; i < size; i++) { + hypre_BoxArrayID(box_array, i) = i; box = hypre_BoxArrayBox(box_array, i); hypre_BoxNDim(box) = ndim; } @@ -726,6 +980,356 @@ hypre_BoxArrayCreate( HYPRE_Int size, return box_array; } +/*-------------------------------------------------------------------------- + * hypre_BoxArrayCreateFromIndices + * + * Build an array of boxes [box_array_ptr] spanning input indices [indices_in] + * + * Notes: + * 1) indices_in is a (ndim x num_indices) two-dimensional array + * + * This is based on the Berger-Rigoutsos algorithm. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxArrayCreateFromIndices( HYPRE_Int ndim, + HYPRE_Int num_indices_in, + HYPRE_Int **indices_in, + HYPRE_Real threshold, + hypre_BoxArray **box_array_ptr ) +{ + /* Data structures */ + hypre_BoxBinTree *boxbt; + hypre_BoxBTNode *btnode; + hypre_BoxBTNode *lnode; + hypre_BoxBTNode *rnode; + hypre_BoxBTQueue *btqueue; + hypre_BoxArray *box_array; + + /* Local variables */ + HYPRE_Int *signature[HYPRE_MAXDIM]; + HYPRE_Int *laplacian[HYPRE_MAXDIM]; + HYPRE_Int cut[HYPRE_MAXDIM]; + HYPRE_Int direction[HYPRE_MAXDIM]; + HYPRE_Int sign[HYPRE_MAXDIM]; + HYPRE_Int signcoord[HYPRE_MAXDIM]; + + hypre_Box *box; + hypre_Box *bbox; + + HYPRE_Int *indices[HYPRE_MAXDIM]; + HYPRE_Int *lbox_indices[HYPRE_MAXDIM]; + HYPRE_Int *rbox_indices[HYPRE_MAXDIM]; + HYPRE_Int splitdir = 0; + HYPRE_Int dir, sign_change, d, i; + HYPRE_Int index, size, capacity, change; + HYPRE_Int num_indices; + HYPRE_Int num_lbox_indices, num_rbox_indices; + HYPRE_Int cut_by_hole; + HYPRE_Real box_efficiency; + HYPRE_Real box_dvolume; + HYPRE_Real box_minvol; + + /* Exit in trivial case */ + if (num_indices_in <= 0) + { + return hypre_error_flag; + } + + /* Set defaults */ + box_minvol = 1; + + /* Compute bounding box */ + bbox = hypre_BoxCreate(ndim); + for (d = 0; d < ndim; d++) + { + hypre_BoxIMinD(bbox, d) = HYPRE_INT_MAX; + hypre_BoxIMaxD(bbox, d) = - HYPRE_INT_MAX; + for (i = 0; i < num_indices_in; i++) + { + hypre_BoxIMinD(bbox, d) = hypre_min(hypre_BoxIMinD(bbox, d), + indices_in[d][i]); + hypre_BoxIMaxD(bbox, d) = hypre_max(hypre_BoxIMaxD(bbox, d), + indices_in[d][i]); + } + } + + /* Exit in the trivial case */ + box_dvolume = hypre_doubleBoxVolume(bbox); + box_efficiency = (HYPRE_Real) num_indices_in / box_dvolume; + if ((box_efficiency >= threshold) || (box_dvolume <= box_minvol)) + { + if (*box_array_ptr == NULL) + { + *box_array_ptr = hypre_BoxArrayCreate(0, ndim); + } + hypre_AppendBox(bbox, *box_array_ptr); + hypre_BoxDestroy(bbox); + + return hypre_error_flag; + } + + /* Allocate memory */ + capacity = 0; + for (d = 0; d < ndim; d++) + { + size = hypre_BoxSizeD(bbox, d); + signature[d] = hypre_CTAlloc(HYPRE_Int, size + 2, HYPRE_MEMORY_HOST); + laplacian[d] = hypre_CTAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); + lbox_indices[d] = hypre_CTAlloc(HYPRE_Int, num_indices_in, HYPRE_MEMORY_HOST); + rbox_indices[d] = hypre_CTAlloc(HYPRE_Int, num_indices_in, HYPRE_MEMORY_HOST); + capacity += hypre_Log2(size); + } + hypre_BoxBinTreeCreate(ndim, &boxbt); + hypre_BoxBTQueueCreate(&btqueue); + + /* Initialize data */ + hypre_BoxBinTreeInitialize(boxbt, num_indices_in, indices_in, bbox); + hypre_BoxBTQueueInitialize(capacity, btqueue); + hypre_BoxBTQueueInsert(hypre_BoxBinTreeRoot(boxbt), btqueue); + + /* Create output BoxArray */ + if (*box_array_ptr) + { + box_array = *box_array_ptr; + } + else + { + box_array = hypre_BoxArrayCreate(capacity, ndim); + hypre_BoxArraySetSize(box_array, 0); + } + + /* level order traversal */ + while (hypre_BoxBTQueueSize(btqueue) > 0) + { + /* Retrieve node data */ + hypre_BoxBTQueueDelete(btqueue, &btnode); + box = hypre_BoxBTNodeBox(btnode); + num_indices = hypre_BoxBTNodeNumIndices(btnode); + for (d = 0; d < ndim; d++) + { + indices[d] = hypre_BoxBTNodeIndices(btnode, d); + } + hypre_assert(num_indices > 0); + + /* Update bounding box */ + for (d = 0; d < ndim; d++) + { + hypre_BoxIMinD(box, d) = HYPRE_INT_MAX; + hypre_BoxIMaxD(box, d) = - HYPRE_INT_MAX; + for (i = 0; i < num_indices; i++) + { + hypre_BoxIMinD(box, d) = hypre_min(hypre_BoxIMinD(box, d), + indices[d][i]); + hypre_BoxIMaxD(box, d) = hypre_max(hypre_BoxIMaxD(box, d), + indices[d][i]); + } + } + + /* Compute box efficiency */ + box_dvolume = hypre_doubleBoxVolume(box); + if (box_dvolume > 0.0) + { + box_efficiency = (HYPRE_Real) num_indices / box_dvolume; + } + else + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Found non-positive box volume!"); + return hypre_error_flag; + } + + /* Decide wheter to split the box or not */ + if (box_efficiency < threshold && box_dvolume > box_minvol) + { + /* Build direction array */ + direction[0] = 0; + for (d = 1; d < ndim; d++) + { + size = hypre_BoxSizeD(box, d); + direction[d] = d; + for (i = 0; i < d; i++) + { + if (size > hypre_BoxSizeD(box, i)) + { + hypre_swap(direction, i, d); + } + } + } + + /* Compute signatures */ + for (d = 0; d < ndim; d++) + { + signature[d][0] = 0; + for (i = 0; i < num_indices; i++) + { + index = indices[d][i] - hypre_BoxIMinD(box, d); + signature[d][index + 1]++; + } + index = hypre_BoxSizeD(box, d); + signature[d][index + 1] = 0; + } + + /* Look for holes */ + hypre_SetIndex(cut, HYPRE_INT_MAX); + cut_by_hole = 0; + for (d = 0; d < ndim; d++) + { + dir = direction[d]; + for (i = 0; i < hypre_BoxSizeD(box, dir); i++) + { + if (signature[dir][i + 1] == 0) + { + hypre_IndexD(cut, dir) = i + hypre_BoxIMinD(box, dir); + splitdir = dir; + break; + } + } + if (hypre_IndexD(cut, dir) != HYPRE_INT_MAX) + { + cut_by_hole = 1; + break; + } + } + + /* Look for inflection points in the laplacian */ + if (!cut_by_hole) + { + hypre_SetIndex(sign, 0); + hypre_CopyToIndex(hypre_BoxIMin(box), ndim, signcoord); + + /* Compute laplacian */ + for (d = 0; d < ndim; d++) + { + for (i = 1; i < hypre_BoxSizeD(box, d) + 1; i++) + { + laplacian[d][i - 1] = signature[d][i - 1] + + signature[d][i + 1] - + 2 * signature[d][i]; + } + + /* Look for largest change in the current direction */ + for (i = 0; i < hypre_BoxSizeD(box, d) - 1; i++) + { + if ((laplacian[d][i + 1] >= 0) != (laplacian[d][i] >= 0)) + { + change = hypre_abs(laplacian[d][i + 1] - laplacian[d][i]); + if (change > hypre_IndexD(sign, d)) + { + hypre_IndexD(sign, d) = change; + hypre_IndexD(signcoord, d) = i + hypre_BoxIMinD(box, d); + } + } + } + } + + /* Look for largest sign change among all directions */ + dir = 0; + sign_change = 0; + for (d = 1; d < ndim; d++) + { + if (hypre_IndexD(sign, dir) < hypre_IndexD(sign, d)) + { + dir = d; + sign_change = 1; + } + } + + /* Set cut direction and coordinate */ + hypre_IndexD(cut, dir) = hypre_IndexD(signcoord, dir); + splitdir = dir; + + /* If no change of sign in the Laplacian was found, just cut the longest dim in half */ + if (!sign_change) + { + change = 0; + for (d = 0; d < ndim; d++) + { + if (change < hypre_BoxSizeD(box, d)) + { + change = hypre_BoxSizeD(box, d); + dir = d; + } + } + hypre_IndexD(cut, dir) = (hypre_BoxIMinD(box, dir) + hypre_BoxIMaxD(box, dir)) / 2; + splitdir = dir; + } + } + hypre_assert((splitdir >= 0) && (splitdir < ndim)); + + /* Create left/right nodes */ + hypre_BoxBTNodeCreate(ndim, &lnode); + hypre_BoxBTNodeCreate(ndim, &rnode); + hypre_BoxBTNodeLeft(btnode) = lnode; + hypre_BoxBTNodeRight(btnode) = rnode; + + /* Split indices */ + num_lbox_indices = 0; + num_rbox_indices = 0; + for (i = 0; i < num_indices; i++) + { + index = indices[splitdir][i]; + if (index <= hypre_IndexD(cut, splitdir)) + { + for (d = 0; d < ndim; d++) + { + lbox_indices[d][num_lbox_indices] = indices[d][i]; + } + num_lbox_indices++; + } + else + { + for (d = 0; d < ndim; d++) + { + rbox_indices[d][num_rbox_indices] = indices[d][i]; + } + num_rbox_indices++; + } + } + hypre_assert(num_lbox_indices > 0); + hypre_assert(num_rbox_indices > 0); + + /* Copy splitted indices to leaf nodes */ + hypre_BoxBTNodeSetIndices(lnode, num_lbox_indices, lbox_indices); + hypre_BoxBTNodeSetIndices(rnode, num_rbox_indices, rbox_indices); + + /* Insert newly created nodes to queue */ + hypre_BoxBTQueueInsert(lnode, btqueue); + hypre_BoxBTQueueInsert(rnode, btqueue); + + /* Reset signatures */ + for (d = 0; d < ndim; d++) + { + for (i = 0; i < num_indices; i++) + { + index = indices[d][i] - hypre_BoxIMinD(box, d); + signature[d][index + 1] = 0; + } + } + } + else + { + hypre_AppendBox(hypre_BoxBTNodeBox(btnode), box_array); + } /* if (box_efficiency < threshold) */ + } /* while (hypre_BoxBTQueueSize(btqueue) > 0) */ + + /* Set pointer to output */ + *box_array_ptr = box_array; + + /* Free memory */ + for (d = 0; d < ndim; d++) + { + hypre_TFree(signature[d], HYPRE_MEMORY_HOST); + hypre_TFree(laplacian[d], HYPRE_MEMORY_HOST); + hypre_TFree(lbox_indices[d], HYPRE_MEMORY_HOST); + hypre_TFree(rbox_indices[d], HYPRE_MEMORY_HOST); + } + hypre_BoxDestroy(bbox); + hypre_BoxBinTreeDestroy(boxbt); + hypre_BoxBTQueueDestroy(btqueue); + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -735,12 +1339,111 @@ hypre_BoxArrayDestroy( hypre_BoxArray *box_array ) if (box_array) { hypre_TFree(hypre_BoxArrayBoxes(box_array), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_BoxArrayIDs(box_array), HYPRE_MEMORY_HOST); hypre_TFree(box_array, HYPRE_MEMORY_HOST); } return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxArrayPrintToFile( FILE *file, + hypre_BoxArray *box_array ) +{ + hypre_Box *box; + + HYPRE_Int ndim; + HYPRE_Int size; + HYPRE_Int i; + + ndim = hypre_BoxArrayNDim(box_array); + hypre_fprintf(file, "%d\n", ndim); + + size = hypre_BoxArraySize(box_array); + hypre_fprintf(file, "%d\n", size); + + /* Print lines of the form: "%d: (%d, %d, %d) x (%d, %d, %d)\n" */ + hypre_ForBoxI(i, box_array) + { + box = hypre_BoxArrayBox(box_array, i); + hypre_fprintf(file, "%d: ", i); + hypre_IndexPrint(file, ndim, hypre_BoxIMin(box)); + hypre_fprintf(file, " x "); + hypre_IndexPrint(file, ndim, hypre_BoxIMax(box)); + hypre_fprintf(file, "\n"); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxArrayReadFromFile( FILE *file, + hypre_BoxArray **box_array_ptr ) +{ + hypre_BoxArray *box_array; + hypre_Box *box; + + HYPRE_Int ndim; + HYPRE_Int size; + HYPRE_Int i, idummy; + + hypre_fscanf(file, "%d\n", &ndim); + + hypre_fscanf(file, "%d\n", &size); + + box_array = hypre_BoxArrayCreate(size, ndim); + + /* Print lines of the form: "%d: (%d, %d, %d) x (%d, %d, %d)\n" */ + hypre_ForBoxI(i, box_array) + { + box = hypre_BoxArrayBox(box_array, i); + hypre_fscanf(file, "%d: ", &idummy); + hypre_IndexRead(file, ndim, hypre_BoxIMin(box)); + hypre_fscanf(file, " x "); + hypre_IndexRead(file, ndim, hypre_BoxIMax(box)); + hypre_fprintf(file, "\n"); + } + + *box_array_ptr = box_array; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxArrayPrint( MPI_Comm comm, + const char *filename, + hypre_BoxArray *box_array ) +{ + FILE *file; + char new_filename[255]; + + HYPRE_Int myid; + + 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); + exit(1); + } + + hypre_BoxArrayPrintToFile(file, box_array); + + fflush(file); + fclose(file); + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -759,8 +1462,10 @@ hypre_BoxArraySetSize( hypre_BoxArray *box_array, old_alloc_size = alloc_size; alloc_size = size + hypre_BoxArrayExcess; - hypre_BoxArrayBoxes(box_array) = - hypre_TReAlloc(hypre_BoxArrayBoxes(box_array), hypre_Box, alloc_size, HYPRE_MEMORY_HOST); + hypre_BoxArrayBoxes(box_array) = hypre_TReAlloc(hypre_BoxArrayBoxes(box_array), + hypre_Box, alloc_size, HYPRE_MEMORY_HOST); + hypre_BoxArrayIDs(box_array) = hypre_TReAlloc(hypre_BoxArrayIDs(box_array), + HYPRE_Int, alloc_size, HYPRE_MEMORY_HOST); hypre_BoxArrayAllocSize(box_array) = alloc_size; for (i = old_alloc_size; i < alloc_size; i++) @@ -780,18 +1485,23 @@ hypre_BoxArraySetSize( hypre_BoxArray *box_array, *--------------------------------------------------------------------------*/ hypre_BoxArray * -hypre_BoxArrayDuplicate( hypre_BoxArray *box_array ) +hypre_BoxArrayClone( hypre_BoxArray *box_array ) { hypre_BoxArray *new_box_array; - + HYPRE_Int size; + HYPRE_Int ndim; HYPRE_Int i; - new_box_array = hypre_BoxArrayCreate( - hypre_BoxArraySize(box_array), hypre_BoxArrayNDim(box_array)); + hypre_assert(box_array != NULL); + + ndim = hypre_BoxArrayNDim(box_array); + size = hypre_BoxArraySize(box_array); + new_box_array = hypre_BoxArrayCreate(size, ndim); hypre_ForBoxI(i, box_array) { hypre_CopyBox(hypre_BoxArrayBox(box_array, i), hypre_BoxArrayBox(new_box_array, i)); + hypre_BoxArrayID(new_box_array, i) = hypre_BoxArrayID(box_array, i); } return new_box_array; @@ -829,6 +1539,7 @@ hypre_DeleteBox( hypre_BoxArray *box_array, { hypre_CopyBox(hypre_BoxArrayBox(box_array, i + 1), hypre_BoxArrayBox(box_array, i)); + hypre_BoxArrayID(box_array, i) = hypre_BoxArrayID(box_array, i + 1); } hypre_BoxArraySize(box_array) --; @@ -843,8 +1554,8 @@ hypre_DeleteBox( hypre_BoxArray *box_array, HYPRE_Int hypre_DeleteMultipleBoxes( hypre_BoxArray *box_array, - HYPRE_Int* indices, - HYPRE_Int num ) + HYPRE_Int *indices, + HYPRE_Int num ) { HYPRE_Int i, j, start, array_size; @@ -868,10 +1579,11 @@ hypre_DeleteMultipleBoxes( hypre_BoxArray *box_array, } } - 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_BoxArrayBox(box_array, i)); + hypre_BoxArrayID(box_array, i) = hypre_BoxArrayID(box_array, i + j); } } @@ -906,6 +1618,81 @@ hypre_AppendBoxArray( hypre_BoxArray *box_array_0, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxArrayVolume( hypre_BoxArray *box_array ) +{ + HYPRE_Int volume, i; + + volume = 0; + hypre_ForBoxI(i, box_array) + { + volume += hypre_BoxVolume(hypre_BoxArrayBox(box_array, i)); + } + + return volume; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxArrayInBoxArray( hypre_BoxArray *box_array1, + hypre_BoxArray *box_array2 ) +{ + HYPRE_Int i, inboxarray = 1; + + if (hypre_BoxArraySize(box_array1) != hypre_BoxArraySize(box_array1)) + { + inboxarray = 0; + } + else + { + hypre_ForBoxI(i, box_array1) + { + if ( !hypre_BoxInBox(hypre_BoxArrayBox(box_array1, i), + hypre_BoxArrayBox(box_array2, i)) ) + { + inboxarray = 0; + break; + } + } + } + + return inboxarray; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxArraysEqual( hypre_BoxArray *box_array1, + hypre_BoxArray *box_array2 ) +{ + HYPRE_Int i, equal = 1; + + if (hypre_BoxArraySize(box_array1) != hypre_BoxArraySize(box_array1)) + { + equal = 0; + } + else + { + hypre_ForBoxI(i, box_array1) + { + if ( !hypre_BoxesEqual(hypre_BoxArrayBox(box_array1, i), + hypre_BoxArrayBox(box_array2, i)) ) + { + equal = 0; + break; + } + } + } + + return equal; +} + /*========================================================================== * Member functions: hypre_BoxArrayArray *==========================================================================*/ @@ -920,10 +1707,10 @@ hypre_BoxArrayArrayCreate( HYPRE_Int size, hypre_BoxArrayArray *box_array_array; HYPRE_Int i; - box_array_array = hypre_CTAlloc(hypre_BoxArrayArray, 1, HYPRE_MEMORY_HOST); + box_array_array = hypre_CTAlloc(hypre_BoxArrayArray, 1, HYPRE_MEMORY_HOST); hypre_BoxArrayArrayBoxArrays(box_array_array) = - hypre_CTAlloc(hypre_BoxArray *, size, HYPRE_MEMORY_HOST); + hypre_CTAlloc(hypre_BoxArray *, size, HYPRE_MEMORY_HOST); for (i = 0; i < size; i++) { @@ -931,7 +1718,10 @@ hypre_BoxArrayArrayCreate( HYPRE_Int size, hypre_BoxArrayCreate(0, ndim); } hypre_BoxArrayArraySize(box_array_array) = size; + hypre_BoxArrayArrayAllocSize(box_array_array) = size; hypre_BoxArrayArrayNDim(box_array_array) = ndim; + hypre_BoxArrayArrayIDs(box_array_array) = + hypre_CTAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); return box_array_array; } @@ -942,14 +1732,20 @@ hypre_BoxArrayArrayCreate( HYPRE_Int size, HYPRE_Int hypre_BoxArrayArrayDestroy( hypre_BoxArrayArray *box_array_array ) { + HYPRE_Int alloc_size; HYPRE_Int i; if (box_array_array) { - hypre_ForBoxArrayI(i, box_array_array) - hypre_BoxArrayDestroy( - hypre_BoxArrayArrayBoxArray(box_array_array, i)); + alloc_size = hypre_BoxArrayArrayAllocSize(box_array_array); + + for (i = 0; i < alloc_size; i++) + { + hypre_BoxArrayDestroy( + hypre_BoxArrayArrayBoxArray(box_array_array, i)); + } + hypre_TFree(hypre_BoxArrayArrayIDs(box_array_array), HYPRE_MEMORY_HOST); hypre_TFree(hypre_BoxArrayArrayBoxArrays(box_array_array), HYPRE_MEMORY_HOST); hypre_TFree(box_array_array, HYPRE_MEMORY_HOST); } @@ -962,7 +1758,7 @@ hypre_BoxArrayArrayDestroy( hypre_BoxArrayArray *box_array_array ) *--------------------------------------------------------------------------*/ hypre_BoxArrayArray * -hypre_BoxArrayArrayDuplicate( hypre_BoxArrayArray *box_array_array ) +hypre_BoxArrayArrayClone( hypre_BoxArrayArray *box_array_array ) { hypre_BoxArrayArray *new_box_array_array; hypre_BoxArray **new_box_arrays; @@ -983,8 +1779,71 @@ hypre_BoxArrayArrayDuplicate( hypre_BoxArrayArray *box_array_array ) for (i = 0; i < new_size; i++) { hypre_AppendBoxArray(box_arrays[i], new_box_arrays[i]); + hypre_BoxArrayArrayID(new_box_array_array, i) = + hypre_BoxArrayArrayID(box_array_array, i); } } return new_box_array_array; } + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxArrayArrayPrintToFile( FILE *file, + hypre_BoxArrayArray *box_array_array ) +{ + hypre_BoxArray *box_array; + + HYPRE_Int ndim; + HYPRE_Int size; + HYPRE_Int id; + HYPRE_Int i; + + ndim = hypre_BoxArrayArrayNDim(box_array_array); + hypre_fprintf(file, "%d\n", ndim); + + size = hypre_BoxArrayArraySize(box_array_array); + hypre_fprintf(file, "%d\n", size); + + hypre_ForBoxArrayI(i, box_array_array) + { + box_array = hypre_BoxArrayArrayBoxArray(box_array_array, i); + id = hypre_BoxArrayArrayID(box_array_array, i); + hypre_fprintf(file, "BoxArray %d, ID %d\n", i, id); + + hypre_BoxArrayPrintToFile(file, box_array); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxArrayArrayPrint( MPI_Comm comm, + const char *filename, + hypre_BoxArrayArray *box_array_array ) +{ + FILE *file; + char new_filename[255]; + + HYPRE_Int myid; + + 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); + exit(1); + } + + hypre_BoxArrayArrayPrintToFile(file, box_array_array); + + fflush(file); + fclose(file); + + return hypre_error_flag; +} diff --git a/src/struct_mv/box.h b/src/struct_mv/box.h index 8d4c97deef..f681b646c5 100644 --- a/src/struct_mv/box.h +++ b/src/struct_mv/box.h @@ -56,6 +56,7 @@ typedef struct hypre_BoxArray_struct HYPRE_Int size; /* Size of box array */ HYPRE_Int alloc_size; /* Size of currently alloced space */ HYPRE_Int ndim; /* number of dimensions */ + HYPRE_Int *ids; /* box identifiers */ } hypre_BoxArray; @@ -71,7 +72,9 @@ typedef struct hypre_BoxArrayArray_struct { hypre_BoxArray **box_arrays; /* Array of pointers to box arrays */ HYPRE_Int size; /* Size of box array array */ + HYPRE_Int alloc_size; /* Size of currently alloced space */ HYPRE_Int ndim; /* number of dimensions */ + HYPRE_Int *ids; /* box array identifiers */ } hypre_BoxArrayArray; @@ -115,6 +118,17 @@ hypre_max(0, (hypre_BoxIMaxD(box, d) - hypre_BoxIMinD(box, d) + 1)) #define hypre_IndexDInBox(index, d, box) \ ( hypre_IndexD(index, d) >= hypre_BoxIMinD(box, d) && \ hypre_IndexD(index, d) <= hypre_BoxIMaxD(box, d) ) +#define hypre_BoxSpanIndex(box, index)\ +{\ + HYPRE_Int d;\ + for (d = 0; d < hypre_BoxNDim(box); d++)\ + {\ + hypre_BoxIMinD(box, d) =\ + hypre_min(hypre_BoxIMinD(box, d), hypre_IndexD(index, d));\ + hypre_BoxIMaxD(box, d) =\ + hypre_max(hypre_BoxIMaxD(box, d), hypre_IndexD(index, d));\ + }\ +} /* The first hypre_CCBoxIndexRank is better style because it is similar to hypre_BoxIndexRank. The second one sometimes avoids compiler warnings. */ @@ -137,6 +151,8 @@ hypre_max(0, (hypre_BoxIMaxD(box, d) - hypre_BoxIMinD(box, d) + 1)) #define hypre_BoxArraySize(box_array) ((box_array) -> size) #define hypre_BoxArrayAllocSize(box_array) ((box_array) -> alloc_size) #define hypre_BoxArrayNDim(box_array) ((box_array) -> ndim) +#define hypre_BoxArrayIDs(box_array) ((box_array) -> ids) +#define hypre_BoxArrayID(box_array, i) ((box_array) -> ids[i]) /*-------------------------------------------------------------------------- * Accessor macros: hypre_BoxArrayArray @@ -148,8 +164,14 @@ hypre_max(0, (hypre_BoxIMaxD(box, d) - hypre_BoxIMinD(box, d) + 1)) ((box_array_array) -> box_arrays[(i)]) #define hypre_BoxArrayArraySize(box_array_array) \ ((box_array_array) -> size) +#define hypre_BoxArrayArrayAllocSize(box_array_array) \ +((box_array_array) -> alloc_size) #define hypre_BoxArrayArrayNDim(box_array_array) \ ((box_array_array) -> ndim) +#define hypre_BoxArrayArrayIDs(box_array_array) \ +((box_array_array) -> ids) +#define hypre_BoxArrayArrayID(box_array_array, i) \ +((box_array_array) -> ids[i]) /*-------------------------------------------------------------------------- * Looping macros: @@ -271,7 +293,10 @@ for (hypre__d = 1; hypre__d < hypre__ndim; hypre__d++)\ } /* Use this before the For macros below to force only one block */ -#define zypre_BoxLoopSetOneBlock() hypre__num_blocks = 1 +#define zypre_BoxLoopSetOneBlock() \ +hypre__num_blocks = 1;\ +hypre__div = hypre__tot;\ +hypre__mod = 0; /* Use this to get the block iteration inside a BoxLoop */ #define zypre_BoxLoopBlock() hypre__block @@ -341,57 +366,63 @@ dbox1, start1, stride1, i1, * Idea 2: Simple version of Idea 3 below *----------------------------------------*/ -N = 1; -for (d = 0; d < ndim; d++) -{ -N *= n[d]; - i[d] = 0; - n[d] -= 2; /* this produces a simpler comparison below */ -} -i[ndim] = 0; -n[ndim] = 0; -for (I = 0; I < N; I++) +void Idea2() /* This function line allows astyle to indent the following correctly */ { -/* loop body */ - -for (d = 0; i[d] > n[d]; d++) + N = 1; + for (d = 0; d < ndim; d++) { + N *= n[d]; i[d] = 0; + n[d] -= 2; /* this produces a simpler comparison below */ + } + i[ndim] = 0; + n[ndim] = 0; + for (I = 0; I < N; I++) + { + /* loop body */ + + for (d = 0; i[d] > n[d]; d++) + { + i[d] = 0; + } + i[d]++; + i1 += s1[d]; /* NOTE: These are different from hypre__sx1, etc. above */ + i2 += s2[d]; /* The lengths of i, n, and s must be (ndim+1) */ } - i[d]++; - i1 += s1[d]; /* NOTE: These are different from hypre__sx1, etc. above */ - i2 += s2[d]; /* The lengths of i, n, and s must be (ndim+1) */ } /*---------------------------------------- * Idea 3: Approach used in the box loops *----------------------------------------*/ -N = 1; -for (d = 1; d < ndim; d++) -{ -N *= n[d]; - i[d] = 0; - n[d] -= 2; /* this produces a simpler comparison below */ -} -i[ndim] = 0; -n[ndim] = 0; -for (J = 0; J < N; J++) +void Idea3() /* This function line allows astyle to indent the following correctly */ { -for (I = 0; I < n[0]; I++) + N = 1; + for (d = 1; d < ndim; d++) { - /* loop body */ - - i1 += s1[0]; - i2 += s2[0]; + N *= n[d]; + i[d] = 0; + n[d] -= 2; /* this produces a simpler comparison below */ } - for (d = 1; i[d] > n[d]; d++) + i[ndim] = 0; + n[ndim] = 0; + for (J = 0; J < N; J++) { - i[d] = 0; + for (I = 0; I < n[0]; I++) + { + /* loop body */ + + i1 += s1[0]; + i2 += s2[0]; + } + for (d = 1; i[d] > n[d]; d++) + { + i[d] = 0; + } + i[d]++; + i1 += s1[d]; /* NOTE: These are different from hypre__sx1, etc. above */ + i2 += s2[d]; /* The lengths of i, n, and s must be (ndim+1) */ } - i[d]++; - i1 += s1[d]; /* NOTE: These are different from hypre__sx1, etc. above */ - i2 += s2[d]; /* The lengths of i, n, and s must be (ndim+1) */ } #endif diff --git a/src/struct_mv/box_algebra.c b/src/struct_mv/box_algebra.c index 9b1756236a..04de3cc4b6 100644 --- a/src/struct_mv/box_algebra.c +++ b/src/struct_mv/box_algebra.c @@ -14,6 +14,95 @@ #include "_hypre_struct_mv.h" +/*-------------------------------------------------------------------------- + * hypre_BoxSplit + * + * Splits a box into two in the direction of the nonzero component of index + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxSplit( hypre_Box *box, + hypre_Index index, + hypre_Box **lbox_ptr, + hypre_Box **rbox_ptr ) +{ + HYPRE_Int ndim = hypre_BoxNDim(box); + + hypre_Box *lbox; + hypre_Box *rbox; + HYPRE_Int d, meaningful; + HYPRE_Int splitdir = 0; + + /* Find split direction */ + meaningful = 0; + for (d = 0; d < ndim; d++) + { + if (hypre_IndexD(index, d) != HYPRE_INT_MAX) + { + meaningful++; + splitdir = d; + } + } + + /* Check if index has a single meaningful component */ + if (meaningful != 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Several split directions found! Using last one"); + } + + /* Allocate lbox if needed */ + if (*lbox_ptr != NULL) + { + lbox = hypre_BoxCreate(ndim); + } + else + { + lbox = *lbox_ptr; + } + + /* Allocate rbox if needed */ + if (*rbox_ptr != NULL) + { + rbox = hypre_BoxCreate(ndim); + } + else + { + rbox = *rbox_ptr; + } + + /* Set 0 < d < splitdir */ + for (d = 0; d < splitdir; d++) + { + hypre_BoxIMinD(lbox, d) = hypre_BoxIMinD(box, d); + hypre_BoxIMaxD(lbox, d) = hypre_BoxIMaxD(box, d); + + hypre_BoxIMinD(rbox, d) = hypre_BoxIMinD(box, d); + hypre_BoxIMaxD(rbox, d) = hypre_BoxIMaxD(box, d); + } + + /* Set splitdir */ + hypre_BoxIMinD(lbox, splitdir) = hypre_BoxIMinD(box, splitdir); + hypre_BoxIMaxD(lbox, splitdir) = hypre_IndexD(index, splitdir) - 1; + hypre_BoxIMinD(rbox, splitdir) = hypre_IndexD(index, splitdir); + hypre_BoxIMaxD(rbox, splitdir) = hypre_BoxIMaxD(box, splitdir); + + /* Set splitdir < d < ndim */ + for (d = (splitdir + 1); d < ndim; d++) + { + hypre_BoxIMinD(lbox, d) = hypre_BoxIMinD(box, d); + hypre_BoxIMaxD(lbox, d) = hypre_BoxIMaxD(box, d); + + hypre_BoxIMinD(rbox, d) = hypre_BoxIMinD(box, d); + hypre_BoxIMaxD(rbox, d) = hypre_BoxIMaxD(box, d); + } + + /* Set pointer to boxes */ + *lbox_ptr = lbox; + *rbox_ptr = rbox; + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- * Intersect box1 and box2. * If the boxes do not intersect, the result is a box with zero volume. @@ -188,8 +277,9 @@ hypre_SubtractBoxArrays( hypre_BoxArray *box_array1, HYPRE_Int hypre_UnionBoxes( hypre_BoxArray *boxes ) { - hypre_Box *box; + HYPRE_Int ndim = hypre_BoxArrayNDim(boxes); + hypre_Box *box; HYPRE_Int *block_index[3]; HYPRE_Int block_sz[3], block_volume; HYPRE_Int *block; @@ -206,6 +296,16 @@ hypre_UnionBoxes( hypre_BoxArray *boxes ) HYPRE_Int index_not_there; + /*------------------------------------------------------ + * Sanity check + *------------------------------------------------------*/ + + if (ndim > 3) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "UnionBoxes works only for ndim <= 3"); + return hypre_error_flag; + } + /*------------------------------------------------------ * If the size of boxes is less than 2, return *------------------------------------------------------*/ @@ -220,7 +320,7 @@ hypre_UnionBoxes( hypre_BoxArray *boxes ) *------------------------------------------------------*/ i_tmp0 = 2 * hypre_BoxArraySize(boxes); - block_index[0] = hypre_TAlloc(HYPRE_Int, 3 * i_tmp0, HYPRE_MEMORY_HOST); + block_index[0] = hypre_TAlloc(HYPRE_Int, 3 * i_tmp0, HYPRE_MEMORY_HOST); block_sz[0] = 0; for (d = 1; d < 3; d++) { @@ -285,7 +385,7 @@ hypre_UnionBoxes( hypre_BoxArray *boxes ) * Set up the block array *------------------------------------------------------*/ - block = hypre_CTAlloc(HYPRE_Int, block_volume, HYPRE_MEMORY_HOST); + block = hypre_CTAlloc(HYPRE_Int, block_volume, HYPRE_MEMORY_HOST); hypre_ForBoxI(bi, boxes) { @@ -457,198 +557,107 @@ hypre_UnionBoxes( hypre_BoxArray *boxes ) HYPRE_Int hypre_MinUnionBoxes( hypre_BoxArray *boxes ) { - hypre_BoxArrayArray *rotated_array; - hypre_BoxArray *rotated_boxes; - hypre_Box *box, *rotated_box; - hypre_Index lower, upper; - - HYPRE_Int i, j, size, min_size, array; + HYPRE_Int ndim = hypre_BoxArrayNDim(boxes); + HYPRE_Int size = hypre_BoxArraySize(boxes); - size = hypre_BoxArraySize(boxes); - rotated_box = hypre_CTAlloc(hypre_Box, 1, HYPRE_MEMORY_HOST); - rotated_array = hypre_BoxArrayArrayCreate(5, hypre_BoxArrayNDim(boxes)); + hypre_BoxArrayArray *rotated_boxaa; + hypre_BoxArray *rotated_boxa; + hypre_Box *rotated_box; + hypre_Box *box; + hypre_Index lower, upper; - for (i = 0; i < 5; i++) + HYPRE_Int i, j, k, min_size; + HYPRE_Int idx[5][3] = { - rotated_boxes = hypre_BoxArrayArrayBoxArray(rotated_array, i); - switch (i) - { - case 0: - for (j = 0; j < size; j++) - { - box = hypre_BoxArrayBox(boxes, j); - hypre_SetIndex3(lower, hypre_BoxIMin(box)[0], hypre_BoxIMin(box)[2], - hypre_BoxIMin(box)[1]); - hypre_SetIndex3(upper, hypre_BoxIMax(box)[0], hypre_BoxIMax(box)[2], - hypre_BoxIMax(box)[1]); - hypre_BoxSetExtents(rotated_box, lower, upper); - hypre_AppendBox(rotated_box, rotated_boxes); - } - hypre_UnionBoxes(rotated_boxes); - break; - - case 1: - for (j = 0; j < size; j++) - { - box = hypre_BoxArrayBox(boxes, j); - hypre_SetIndex3(lower, hypre_BoxIMin(box)[1], hypre_BoxIMin(box)[2], - hypre_BoxIMin(box)[0]); - hypre_SetIndex3(upper, hypre_BoxIMax(box)[1], hypre_BoxIMax(box)[2], - hypre_BoxIMax(box)[0]); - hypre_BoxSetExtents(rotated_box, lower, upper); - hypre_AppendBox(rotated_box, rotated_boxes); - } - hypre_UnionBoxes(rotated_boxes); - break; + {0, 2, 1}, + {1, 2, 0}, + {1, 0, 2}, + {2, 0, 1}, + {2, 1, 0} + }; + HYPRE_Int rdx[5][3] = + { + {0, 2, 1}, + {2, 0, 1}, + {1, 0, 2}, + {1, 2, 0}, + {2, 1, 0} + }; - case 2: - for (j = 0; j < size; j++) - { - box = hypre_BoxArrayBox(boxes, j); - hypre_SetIndex3(lower, hypre_BoxIMin(box)[1], hypre_BoxIMin(box)[0], - hypre_BoxIMin(box)[2]); - hypre_SetIndex3(upper, hypre_BoxIMax(box)[1], hypre_BoxIMax(box)[0], - hypre_BoxIMax(box)[2]); - hypre_BoxSetExtents(rotated_box, lower, upper); - hypre_AppendBox(rotated_box, rotated_boxes); - } - hypre_UnionBoxes(rotated_boxes); - break; + /*------------------------------------------------------ + * Sanity check + *------------------------------------------------------*/ - case 3: - for (j = 0; j < size; j++) - { - box = hypre_BoxArrayBox(boxes, j); - hypre_SetIndex3(lower, hypre_BoxIMin(box)[2], hypre_BoxIMin(box)[0], - hypre_BoxIMin(box)[1]); - hypre_SetIndex3(upper, hypre_BoxIMax(box)[2], hypre_BoxIMax(box)[0], - hypre_BoxIMax(box)[1]); - hypre_BoxSetExtents(rotated_box, lower, upper); - hypre_AppendBox(rotated_box, rotated_boxes); - } - hypre_UnionBoxes(rotated_boxes); - break; + if (ndim > 3) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "MinUnionBoxes works only for ndim <= 3"); + return hypre_error_flag; + } - case 4: - for (j = 0; j < size; j++) - { - box = hypre_BoxArrayBox(boxes, j); - hypre_SetIndex3(lower, hypre_BoxIMin(box)[2], hypre_BoxIMin(box)[1], - hypre_BoxIMin(box)[0]); - hypre_SetIndex3(upper, hypre_BoxIMax(box)[2], hypre_BoxIMax(box)[1], - hypre_BoxIMax(box)[0]); - hypre_BoxSetExtents(rotated_box, lower, upper); - hypre_AppendBox(rotated_box, rotated_boxes); - } - hypre_UnionBoxes(rotated_boxes); - break; + /*------------------------------------------------------ + * Compute unions + *------------------------------------------------------*/ - } /*switch(i) */ - } /* for (i= 0; i< 5; i++) */ - hypre_TFree(rotated_box, HYPRE_MEMORY_HOST); + rotated_box = hypre_BoxCreate(ndim); + rotated_boxaa = hypre_BoxArrayArrayCreate(5, ndim); + for (i = 0; i < 5; i++) + { + rotated_boxa = hypre_BoxArrayArrayBoxArray(rotated_boxaa, i); + hypre_ForBoxI(j, boxes) + { + box = hypre_BoxArrayBox(boxes, j); + hypre_SetIndex3(lower, + hypre_BoxIMin(box)[idx[i][0]], + hypre_BoxIMin(box)[idx[i][1]], + hypre_BoxIMin(box)[idx[i][2]]); + hypre_SetIndex3(upper, + hypre_BoxIMax(box)[idx[i][0]], + hypre_BoxIMax(box)[idx[i][1]], + hypre_BoxIMax(box)[idx[i][2]]); + hypre_BoxSetExtents(rotated_box, lower, upper); + hypre_AppendBox(rotated_box, rotated_boxa); + } + hypre_UnionBoxes(rotated_boxa); + } + hypre_BoxDestroy(rotated_box); + /* six-th call (xyz) */ hypre_UnionBoxes(boxes); - array = 5; - min_size = hypre_BoxArraySize(boxes); - + /* Find call with minimum size */ + k = 5; + min_size = size; for (i = 0; i < 5; i++) { - rotated_boxes = hypre_BoxArrayArrayBoxArray(rotated_array, i); - if (hypre_BoxArraySize(rotated_boxes) < min_size) + rotated_boxa = hypre_BoxArrayArrayBoxArray(rotated_boxaa, i); + if (hypre_BoxArraySize(rotated_boxa) < min_size) { - min_size = hypre_BoxArraySize(rotated_boxes); - array = i; + min_size = hypre_BoxArraySize(rotated_boxa); + k = i; } } /* copy the box_array with the minimum number of boxes to boxes */ - if (array != 5) + if (k != 5) { - rotated_boxes = hypre_BoxArrayArrayBoxArray(rotated_array, array); + rotated_boxa = hypre_BoxArrayArrayBoxArray(rotated_boxaa, k); hypre_BoxArraySize(boxes) = min_size; - switch (array) + hypre_ForBoxI(j, rotated_boxa) { - case 0: - for (j = 0; j < min_size; 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_SetIndex3(upper, hypre_BoxIMax(rotated_box)[0], - 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++) - { - 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_SetIndex3(upper, hypre_BoxIMax(rotated_box)[2], - 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++) - { - 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_SetIndex3(upper, hypre_BoxIMax(rotated_box)[1], - 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++) - { - 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_SetIndex3(upper, hypre_BoxIMax(rotated_box)[1], - 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++) - { - 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_SetIndex3(upper, hypre_BoxIMax(rotated_box)[2], - hypre_BoxIMax(rotated_box)[1], - hypre_BoxIMax(rotated_box)[0]); - - hypre_BoxSetExtents( hypre_BoxArrayBox(boxes, j), lower, upper); - } - break; - - } /* switch(array) */ - } /* if (array != 5) */ - - hypre_BoxArrayArrayDestroy(rotated_array); + rotated_box = hypre_BoxArrayBox(rotated_boxa, j); + hypre_SetIndex3(lower, + hypre_BoxIMin(rotated_box)[rdx[k][0]], + hypre_BoxIMin(rotated_box)[rdx[k][1]], + hypre_BoxIMin(rotated_box)[rdx[k][2]]); + hypre_SetIndex3(upper, + hypre_BoxIMax(rotated_box)[rdx[k][0]], + hypre_BoxIMax(rotated_box)[rdx[k][1]], + hypre_BoxIMax(rotated_box)[rdx[k][2]]); + hypre_BoxSetExtents(hypre_BoxArrayBox(boxes, j), lower, upper); + } + } + hypre_BoxArrayArrayDestroy(rotated_boxaa); return hypre_error_flag; } diff --git a/src/struct_mv/box_boundary.c b/src/struct_mv/box_boundary.c index 9a2ebd2c7c..40c95e9cbd 100644 --- a/src/struct_mv/box_boundary.c +++ b/src/struct_mv/box_boundary.c @@ -5,24 +5,6 @@ * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ -/****************************************************************************** - * - * 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 - * sstruct_ls/maxwell_PNedelec_bdy.c - * - *****************************************************************************/ - #include "_hypre_struct_mv.h" /*-------------------------------------------------------------------------- @@ -137,9 +119,8 @@ hypre_BoxBoundaryDG( hypre_Box *box, return hypre_error_flag; } - /*-------------------------------------------------------------------------- - * Intersect a surface of 'box' with the physical boundary. A stencil element + * Intersect a surface of 'box' with the physical boundary. A stencil offset * indicates in which direction the surface should be determined. * * The result will be returned in the box array 'boundary'. Any boxes already @@ -147,69 +128,58 @@ hypre_BoxBoundaryDG( hypre_Box *box, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_GeneralBoxBoundaryIntersect( hypre_Box *box, +hypre_GeneralBoxBoundaryIntersect( hypre_Box *box, hypre_StructGrid *grid, - hypre_Index stencil_element, - hypre_BoxArray *boundary ) + hypre_Index offset, + hypre_BoxArray *boundary ) { - hypre_BoxManager *boxman; + hypre_BoxManager *boxman = hypre_StructGridBoxMan(grid); hypre_BoxManEntry **entries; hypre_BoxArray *int_boxes, *tmp_boxes; hypre_Box *bbox, *ibox; - HYPRE_Int nentries, i, j; - HYPRE_Int *dd; + hypre_IndexRef pshift; + HYPRE_Int nentries, nperiods, i, j, k; HYPRE_Int ndim; 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); - } - - /* set bbox to the box surface of interest */ + /* Initialize the boundary array to contain only the input box (bbox <-- box) */ hypre_BoxArraySetSize(boundary, 1); bbox = hypre_BoxArrayBox(boundary, 0); hypre_CopyBox(box, bbox); - /* temporarily shift bbox in direction dir and intersect with the grid */ - for (i = 0; i < ndim; i++) - { - hypre_BoxIMinD(bbox, i) += dd[i]; - hypre_BoxIMaxD(bbox, i) += dd[i]; - } + int_boxes = hypre_BoxArrayCreate(0, ndim); + tmp_boxes = hypre_BoxArrayCreate(0, ndim); - boxman = hypre_StructGridBoxMan(grid); - hypre_BoxManIntersect(boxman, hypre_BoxIMin(bbox), hypre_BoxIMax(bbox), - &entries, &nentries); - for (i = 0; i < ndim; i++) + /* Temporarily shift bbox in direction offset and intersect with the grid. + * Handle periodicity in a similar way by shifting based on the period. */ + j = 0; + nperiods = hypre_StructGridNumPeriods(grid); + hypre_BoxShiftPos(bbox, offset); /* bbox += offset */ + for (k = 0; k < nperiods; k++) { - hypre_BoxIMinD(bbox, i) -= dd[i]; - hypre_BoxIMaxD(bbox, i) -= dd[i]; - } - - /* shift intersected boxes in direction -dir and subtract from bbox */ - int_boxes = hypre_BoxArrayCreate(nentries, ndim); - tmp_boxes = hypre_BoxArrayCreate(0, ndim); - for (i = 0; i < nentries; i++) - { - ibox = hypre_BoxArrayBox(int_boxes, i); - hypre_BoxManEntryGetExtents( - entries[i], hypre_BoxIMin(ibox), hypre_BoxIMax(ibox)); - for (j = 0; j < ndim; j++) + pshift = hypre_StructGridPShift(grid, k); + hypre_BoxShiftPos(bbox, pshift); /* bbox += pshift */ + hypre_BoxManIntersect(boxman, hypre_BoxIMin(bbox), hypre_BoxIMax(bbox), &entries, &nentries); + hypre_BoxArraySetSize(int_boxes, j + nentries); + for (i = 0; i < nentries; i++) { - hypre_BoxIMinD(ibox, j) -= dd[j]; - hypre_BoxIMaxD(ibox, j) -= dd[j]; + ibox = hypre_BoxArrayBox(int_boxes, j); + hypre_BoxManEntryGetExtents(entries[i], hypre_BoxIMin(ibox), hypre_BoxIMax(ibox)); + hypre_BoxShiftNeg(ibox, pshift); /* bbox -= pshift */ + hypre_BoxShiftNeg(ibox, offset); /* bbox -= offset */ + j++; } + hypre_TFree(entries, HYPRE_MEMORY_HOST); + hypre_BoxShiftNeg(bbox, pshift); /* bbox -= pshift */ } + hypre_BoxShiftNeg(bbox, offset); /* bbox -= offset */ + + /* Subtract intersected boxman boxes from bbox (first entry of boundary array) */ hypre_SubtractBoxArrays(boundary, int_boxes, tmp_boxes); hypre_BoxArrayDestroy(int_boxes); hypre_BoxArrayDestroy(tmp_boxes); - hypre_TFree(entries, HYPRE_MEMORY_HOST); - hypre_TFree(dd, HYPRE_MEMORY_HOST); return hypre_error_flag; } - diff --git a/src/struct_mv/box_ds.c b/src/struct_mv/box_ds.c new file mode 100644 index 0000000000..2bc2031bc4 --- /dev/null +++ b/src/struct_mv/box_ds.c @@ -0,0 +1,513 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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" + +/*========================================================================== + * Member functions: hypre_BoxBTNode + *==========================================================================*/ + +/*-------------------------------------------------------------------------- + * hypre_BoxBTNodeCreate + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBTNodeCreate( HYPRE_Int ndim, + hypre_BoxBTNode **btnode_ptr ) +{ + hypre_BoxBTNode *btnode; + HYPRE_Int d; + + btnode = hypre_TAlloc(hypre_BoxBTNode, 1, HYPRE_MEMORY_HOST); + + hypre_BoxBTNodeNumIndices(btnode) = 0; + hypre_BoxBTNodeBox(btnode) = hypre_BoxCreate(ndim); + hypre_BoxBTNodeLeft(btnode) = NULL; + hypre_BoxBTNodeRight(btnode) = NULL; + for (d = 0; d < HYPRE_MAXDIM; d++) + { + hypre_BoxBTNodeIndices(btnode, d) = NULL; + } + + /* Set pointer */ + *btnode_ptr = btnode; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_BoxBTNodeSetIndices + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBTNodeSetIndices( hypre_BoxBTNode * btnode, + HYPRE_Int num_indices, + HYPRE_Int **indices ) +{ + HYPRE_Int ndim = hypre_BoxBTNodeNDim(btnode); + HYPRE_Int d, i; + + hypre_BoxBTNodeNumIndices(btnode) = num_indices; + for (d = 0; d < ndim; d++) + { + hypre_BoxBTNodeIndices(btnode, d) = hypre_TAlloc(HYPRE_Int, num_indices, HYPRE_MEMORY_HOST); + for (i = 0; i < num_indices; i++) + { + hypre_BoxBTNodeIndex(btnode, d, i) = indices[d][i]; + } + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_BoxBTNodeInitialize + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBTNodeInitialize( hypre_BoxBTNode *btnode, + HYPRE_Int num_indices, + HYPRE_Int **indices, + hypre_Box *box ) +{ + HYPRE_Int ndim = hypre_BoxNDim(box); + HYPRE_Int d; + + hypre_CopyBox(box, hypre_BoxBTNodeBox(btnode)); + hypre_BoxBTNodeNumIndices(btnode) = num_indices; + for (d = 0; d < ndim; d++) + { + hypre_BoxBTNodeIndices(btnode, d) = indices[d]; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_BoxBTNodeDestroy + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBTNodeDestroy( hypre_BoxBTNode *btnode ) +{ + HYPRE_Int d; + + if (btnode) + { + for (d = 0; d < HYPRE_MAXDIM; d++) + { + hypre_TFree(hypre_BoxBTNodeIndices(btnode, d), HYPRE_MEMORY_HOST); + } + + hypre_BoxDestroy(hypre_BoxBTNodeBox(btnode)); + //hypre_assert(hypre_BoxBTNodeLeft(btnode) == NULL); + //hypre_assert(hypre_BoxBTNodeRight(btnode) == NULL); + hypre_TFree(btnode, HYPRE_MEMORY_HOST); + } + + return hypre_error_flag; +} + +/*========================================================================== + * Member functions: hypre_BoxBinTree + *==========================================================================*/ + +/*-------------------------------------------------------------------------- + * hypre_BoxBinTreeCreate + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBinTreeCreate( HYPRE_Int ndim, + hypre_BoxBinTree **boxbt_ptr ) +{ + hypre_BoxBinTree *boxbt; + hypre_BoxBTNode *btroot; + + boxbt = hypre_TAlloc(hypre_BoxBinTree, 1, HYPRE_MEMORY_HOST); + + hypre_BoxBTNodeCreate(ndim, &btroot); + hypre_BoxBinTreeRoot(boxbt) = btroot; + + /* Set pointer */ + *boxbt_ptr = boxbt; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_BoxBinTreeInitialize + * + * Note: indices_in is copied to indices, which will be freed when + * calling hypre_BoxBinTreeDestroy + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBinTreeInitialize( hypre_BoxBinTree *boxbt, + HYPRE_Int num_indices, + HYPRE_Int **indices_in, + hypre_Box *box ) +{ + hypre_BoxBTNode *btroot; + HYPRE_Int *indices[HYPRE_MAXDIM]; + HYPRE_Int ndim = hypre_BoxNDim(box); + + HYPRE_Int d, i; + + for (d = 0; d < ndim; d++) + { + indices[d] = hypre_CTAlloc(HYPRE_Int, num_indices, HYPRE_MEMORY_HOST); + for (i = 0; i < num_indices; i++) + { + indices[d][i] = indices_in[d][i]; + } + } + + btroot = hypre_BoxBinTreeRoot(boxbt); + hypre_BoxBTNodeInitialize(btroot, num_indices, indices, box); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_BoxBinTreeDestroy + * + * Destroy a binary tree of boxes via iterative post-order tree traversal. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBinTreeDestroy( hypre_BoxBinTree *boxbt ) +{ + hypre_BoxBTNode *btwork; + hypre_BoxBTNode *btnode; + hypre_BoxBTNode *lnode; + hypre_BoxBTNode *rnode; + hypre_BoxBTStack *btstack; + + if (boxbt) + { + /* Allocate memory for stack */ + hypre_BoxBTStackCreate(&btstack); + hypre_BoxBTStackInitialize(16, btstack); + + /* Perform iterative post-order traversal */ + btnode = hypre_BoxBinTreeRoot(boxbt); + while ((btnode != NULL) || (hypre_BoxBTStackSize(btstack) > 0)) + { + /* Add nodes to stack */ + while (btnode) + { + lnode = hypre_BoxBTNodeLeft(btnode); + rnode = hypre_BoxBTNodeRight(btnode); + + if (rnode) + { + hypre_BoxBTStackInsert(rnode, btstack); + } + hypre_BoxBTStackInsert(btnode, btstack); + + /* Move to left-most node */ + btnode = lnode; + } + + /* Retrieve node from stack */ + hypre_BoxBTStackDelete(btstack, &btnode); + rnode = hypre_BoxBTNodeRight(btnode); + + if (rnode && + hypre_BoxBTStackSize(btstack) && + hypre_BoxBTStackNodePeek(btstack) == rnode) + { + /* Swap the two last nodes of stack */ + hypre_BoxBTStackDelete(btstack, &btwork); + hypre_BoxBTStackInsert(btnode, btstack); + btnode = rnode; + } + else + { + /* Free data associated with node */ + hypre_BoxBTNodeDestroy(btnode); + btnode = NULL; + } + } + + /* Free memory */ + hypre_BoxBTStackDestroy(btstack); + hypre_TFree(boxbt, HYPRE_MEMORY_HOST); + } + + return hypre_error_flag; +} + +/*========================================================================== + * Member functions: hypre_BoxBTStack + *==========================================================================*/ + +/*-------------------------------------------------------------------------- + * hypre_BoxBTStackCreate + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBTStackCreate( hypre_BoxBTStack **btstack_ptr ) +{ + hypre_BoxBTStack *btstack; + + btstack = hypre_TAlloc(hypre_BoxBTStack, 1, HYPRE_MEMORY_HOST); + + hypre_BoxBTStackNodes(btstack) = NULL; + hypre_BoxBTStackCapacity(btstack) = 0; + hypre_BoxBTStackSize(btstack) = 0; + + /* Set pointer */ + *btstack_ptr = btstack; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_BoxBTStackInitialize + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBTStackInitialize( HYPRE_Int capacity, + hypre_BoxBTStack *btstack ) +{ + HYPRE_Int i; + + hypre_BoxBTStackCapacity(btstack) = capacity; + hypre_BoxBTStackNodes(btstack) = hypre_TAlloc(hypre_BoxBTNode *, capacity, HYPRE_MEMORY_HOST); + for (i = 0; i < capacity; i++) + { + hypre_BoxBTStackNode(btstack, i) = NULL; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_BoxBTStackDestroy + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBTStackDestroy( hypre_BoxBTStack *btstack ) +{ + hypre_BoxBTNode **nodes = hypre_BoxBTStackNodes(btstack); + + hypre_TFree(nodes, HYPRE_MEMORY_HOST); + hypre_TFree(btstack, HYPRE_MEMORY_HOST); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_BoxBTStackInsert + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBTStackInsert( hypre_BoxBTNode *btnode, + hypre_BoxBTStack *btstack ) +{ + HYPRE_Int capacity = hypre_BoxBTStackCapacity(btstack); + HYPRE_Int size = hypre_BoxBTStackSize(btstack); + + /* Double the capacity if limit is reached */ + if (size == capacity) + { + capacity = hypre_max(1, 2 * capacity); + if (capacity < 0) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Integer overflow! Using capacity=INT_MAX"); + capacity = HYPRE_INT_MAX; + } + hypre_BoxBTStackCapacity(btstack) = capacity; + hypre_BoxBTStackNodes(btstack) = hypre_TReAlloc(hypre_BoxBTStackNodes(btstack), + hypre_BoxBTNode *, capacity, + HYPRE_MEMORY_HOST); + } + + hypre_BoxBTStackSize(btstack)++; + hypre_BoxBTStackNodePeek(btstack) = btnode; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_BoxBTStackDelete + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBTStackDelete( hypre_BoxBTStack *btstack, + hypre_BoxBTNode **btnode_ptr ) +{ + HYPRE_Int size = hypre_BoxBTStackSize(btstack); + + if (size > 0) + { + *btnode_ptr = hypre_BoxBTStackNodePeek(btstack); + hypre_BoxBTStackNodePeek(btstack) = NULL; + hypre_BoxBTStackSize(btstack)--; + } + else + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Empty stack!"); + *btnode_ptr = NULL; + } + + return hypre_error_flag; +} + +/*========================================================================== + * Member functions: hypre_BoxBTQueue + *==========================================================================*/ + +/*-------------------------------------------------------------------------- + * hypre_BoxBTQueueCreate + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBTQueueCreate( hypre_BoxBTQueue **btqueue_ptr ) +{ + hypre_BoxBTQueue *btqueue; + + btqueue = hypre_TAlloc(hypre_BoxBTQueue, 1, HYPRE_MEMORY_HOST); + + hypre_BoxBTQueueHead(btqueue) = 0; + hypre_BoxBTQueueTail(btqueue) = 0; + hypre_BoxBTQueueSize(btqueue) = 0; + hypre_BoxBTQueueCapacity(btqueue) = 0; + hypre_BoxBTQueueNodes(btqueue) = NULL; + + /* Set pointer */ + *btqueue_ptr = btqueue; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_BoxBTQueueInitialize + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBTQueueInitialize( HYPRE_Int capacity, + hypre_BoxBTQueue *btqueue ) +{ + HYPRE_Int i; + + hypre_BoxBTQueueCapacity(btqueue) = capacity; + hypre_BoxBTQueueNodes(btqueue) = hypre_TAlloc(hypre_BoxBTNode *, capacity, HYPRE_MEMORY_HOST); + for (i = 0; i < capacity; i++) + { + hypre_BoxBTQueueNode(btqueue, i) = NULL; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_BoxBTQueueDestroy + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBTQueueDestroy( hypre_BoxBTQueue *btqueue ) +{ + hypre_BoxBTNode **nodes = hypre_BoxBTQueueNodes(btqueue); + + hypre_TFree(nodes, HYPRE_MEMORY_HOST); + hypre_TFree(btqueue, HYPRE_MEMORY_HOST); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_BoxBTStackInsert + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBTQueueInsert( hypre_BoxBTNode *btnode, + hypre_BoxBTQueue *btqueue ) +{ + HYPRE_Int capacity = hypre_BoxBTQueueCapacity(btqueue); + HYPRE_Int size = hypre_BoxBTQueueSize(btqueue); + HYPRE_Int *tail = &hypre_BoxBTQueueTail(btqueue); + + HYPRE_Int i, offset; + + /* Double the capacity if limit is reached */ + if (capacity == size) + { + offset = capacity; + capacity += hypre_max(*tail, capacity); + if (capacity < 0) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Integer overflow! Using capacity=INT_MAX"); + capacity = HYPRE_INT_MAX; + } + hypre_BoxBTQueueCapacity(btqueue) = capacity; + hypre_BoxBTQueueNodes(btqueue) = hypre_TReAlloc(hypre_BoxBTQueueNodes(btqueue), + hypre_BoxBTNode *, capacity, + HYPRE_MEMORY_HOST); + + /* Reorganize items in the queue */ + for (i = 0; i < *tail; i++) + { + hypre_BoxBTQueueNode(btqueue, offset + i) = hypre_BoxBTQueueNode(btqueue, i); + hypre_BoxBTQueueNode(btqueue, i) = NULL; + } + for (i = *tail + offset; i < capacity; i++) + { + hypre_BoxBTQueueNode(btqueue, i) = NULL; + } + hypre_BoxBTQueueTail(btqueue) += offset; + } + + hypre_BoxBTQueueNode(btqueue, *tail) = btnode; + if (*tail == (capacity - 1)) + { + hypre_BoxBTQueueTail(btqueue) = 0; + } + else + { + hypre_BoxBTQueueTail(btqueue)++; + } + hypre_BoxBTQueueSize(btqueue)++; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * hypre_BoxBTStackDelete + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBTQueueDelete( hypre_BoxBTQueue *btqueue, + hypre_BoxBTNode **btnode_ptr ) +{ + HYPRE_Int capacity = hypre_BoxBTQueueCapacity(btqueue); + HYPRE_Int size = hypre_BoxBTQueueSize(btqueue); + HYPRE_Int head = hypre_BoxBTQueueHead(btqueue); + + if (size) + { + *btnode_ptr = hypre_BoxBTQueueNode(btqueue, head); + hypre_BoxBTQueueNode(btqueue, head) = NULL; + if (head == (capacity - 1)) + { + hypre_BoxBTQueueHead(btqueue) = 0; + } + else + { + hypre_BoxBTQueueHead(btqueue)++; + } + hypre_BoxBTQueueSize(btqueue)--; + } + else + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Empty queue!"); + *btnode_ptr = NULL; + } + + return hypre_error_flag; +} diff --git a/src/struct_mv/box_ds.h b/src/struct_mv/box_ds.h new file mode 100644 index 0000000000..5969ac8adf --- /dev/null +++ b/src/struct_mv/box_ds.h @@ -0,0 +1,92 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 different box data structures + * + * TODO: Move BoxArray here + * + *****************************************************************************/ + +#ifndef hypre_BOX_DS_HEADER +#define hypre_BOX_DS_HEADER + +/*-------------------------------------------------------------------------- + * hypre_BoxBTNode: + * + * Box binary tree node + *--------------------------------------------------------------------------*/ +typedef struct hypre_BoxBTNode_struct +{ + HYPRE_Int num_indices; + HYPRE_Int *indices[HYPRE_MAXDIM]; + hypre_Box *box; + struct hypre_BoxBTNode_struct *left; + struct hypre_BoxBTNode_struct *right; +} hypre_BoxBTNode; + +#define hypre_BoxBTNodeNDim(btnode) ((btnode) -> box -> ndim) +#define hypre_BoxBTNodeNumIndices(btnode) ((btnode) -> num_indices) +#define hypre_BoxBTNodeIndices(btnode, d) ((btnode) -> indices[d]) +#define hypre_BoxBTNodeIndex(btnode, d, i) ((btnode) -> indices[d][i]) +#define hypre_BoxBTNodeBox(btnode) ((btnode) -> box) +#define hypre_BoxBTNodeLeft(btnode) ((btnode) -> left) +#define hypre_BoxBTNodeRight(btnode) ((btnode) -> right) + +/*-------------------------------------------------------------------------- + * hypre_BoxBinTree: + * + * Box binary tree + *--------------------------------------------------------------------------*/ +typedef struct hypre_BoxBinTree_struct +{ + hypre_BoxBTNode *btroot; +} hypre_BoxBinTree; + +#define hypre_BoxBinTreeRoot(boxbt) ((boxbt) -> btroot) + +/*-------------------------------------------------------------------------- + * hypre_BoxBTStack: + * + * Stack of box binary tree nodes + *--------------------------------------------------------------------------*/ +typedef struct hypre_BoxBTStack_struct +{ + HYPRE_Int size; + HYPRE_Int capacity; + hypre_BoxBTNode **nodes; +} hypre_BoxBTStack; + +#define hypre_BoxBTStackSize(btstack) ((btstack) -> size) +#define hypre_BoxBTStackCapacity(btstack) ((btstack) -> capacity) +#define hypre_BoxBTStackNodes(btstack) ((btstack) -> nodes) +#define hypre_BoxBTStackNode(btstack, i) ((btstack) -> nodes[i]) +#define hypre_BoxBTStackNodePeek(btstack) ((btstack) -> nodes[(btstack) -> size - 1]) + +/*-------------------------------------------------------------------------- + * hypre_BoxBTQueue: + * + * Queue of box binary tree nodes + *--------------------------------------------------------------------------*/ +typedef struct hypre_BoxBTQueue_struct +{ + HYPRE_Int head; + HYPRE_Int tail; + HYPRE_Int size; + HYPRE_Int capacity; + hypre_BoxBTNode **nodes; +} hypre_BoxBTQueue; + +#define hypre_BoxBTQueueHead(btqueue) ((btqueue) -> head) +#define hypre_BoxBTQueueTail(btqueue) ((btqueue) -> tail) +#define hypre_BoxBTQueueSize(btqueue) ((btqueue) -> size) +#define hypre_BoxBTQueueCapacity(btqueue) ((btqueue) -> capacity) +#define hypre_BoxBTQueueNodes(btqueue) ((btqueue) -> nodes) +#define hypre_BoxBTQueueNode(btqueue, i) ((btqueue) -> nodes[i]) + +#endif diff --git a/src/struct_mv/box_manager.c b/src/struct_mv/box_manager.c index b0ac4cf6c5..af0e1188e6 100644 --- a/src/struct_mv/box_manager.c +++ b/src/struct_mv/box_manager.c @@ -107,21 +107,6 @@ hypre_entryqsort2( HYPRE_Int *v, hypre_entryqsort2(v, ent, last + 1, right); } -/*-------------------------------------------------------------------------- - * This is not used - *--------------------------------------------------------------------------*/ - -#if 0 -HYPRE_Int -hypre_BoxManEntrySetInfo ( hypre_BoxManEntry *entry, - void *info ) -{ - /* TO DO*/ - - return hypre_error_flag; -} -#endif - /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -162,6 +147,29 @@ hypre_BoxManEntryGetExtents ( hypre_BoxManEntry *entry, return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxManEntryGetStride ( hypre_BoxManEntry *entry, + hypre_Index stride) +{ + hypre_IndexRef entry_imin = hypre_BoxManEntryIMin(entry); + hypre_IndexRef entry_imax = hypre_BoxManEntryIMax(entry); + HYPRE_Int ndim = hypre_BoxManEntryNDim(entry); + + HYPRE_Int d; + + stride[0] = 1; + for (d = 1; d < ndim; d++) + { + stride[d] = hypre_IndexD(entry_imax, d - 1) - hypre_IndexD(entry_imin, d - 1) + 1; + stride[d] *= stride[d - 1]; + } + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- * Warning: This does not copy the position or info! *--------------------------------------------------------------------------*/ @@ -396,7 +404,7 @@ hypre_BoxManDeleteMultipleEntriesAndInfo( hypre_BoxManager *manager, to_ptr = hypre_BoxManInfoObject(manager, i); from_ptr = hypre_BoxManInfoObject(manager, i + j); - hypre_TMemcpy(to_ptr, from_ptr, char, info_size, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + hypre_TMemcpy(to_ptr, from_ptr, char, info_size, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); } } @@ -436,7 +444,7 @@ hypre_BoxManCreate( HYPRE_Int max_nentries, HYPRE_Int i, d; /* allocate object */ - manager = hypre_CTAlloc(hypre_BoxManager, 1, HYPRE_MEMORY_HOST); + manager = hypre_CTAlloc(hypre_BoxManager, 1, HYPRE_MEMORY_HOST); /* initialize */ hypre_BoxManComm(manager) = comm; @@ -451,16 +459,20 @@ hypre_BoxManCreate( HYPRE_Int max_nentries, } hypre_BoxManNEntries(manager) = 0; - hypre_BoxManEntries(manager) = hypre_CTAlloc(hypre_BoxManEntry, max_nentries, HYPRE_MEMORY_HOST); + 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); + hypre_BoxManIdsSort(manager) = hypre_CTAlloc(HYPRE_Int, max_nentries, + HYPRE_MEMORY_HOST); + hypre_BoxManProcsSort(manager) = hypre_CTAlloc(HYPRE_Int, max_nentries, + HYPRE_MEMORY_HOST); hypre_BoxManProcsSortOffsets(manager) = NULL; hypre_BoxManFirstLocal(manager) = 0; @@ -478,9 +490,9 @@ hypre_BoxManCreate( HYPRE_Int max_nentries, hypre_BoxManAssumedPartition(manager) = NULL; - hypre_BoxManMyIds(manager) = hypre_CTAlloc(HYPRE_Int, max_nentries, HYPRE_MEMORY_HOST); + hypre_BoxManMyIds(manager) = hypre_CTAlloc(HYPRE_Int, max_nentries, HYPRE_MEMORY_HOST); hypre_BoxManMyEntries(manager) = - hypre_CTAlloc(hypre_BoxManEntry *, max_nentries, HYPRE_MEMORY_HOST); + hypre_CTAlloc(hypre_BoxManEntry *, max_nentries, HYPRE_MEMORY_HOST); bbox = hypre_BoxCreate(ndim); hypre_BoxManBoundingBox(manager) = bbox; @@ -489,7 +501,7 @@ hypre_BoxManCreate( HYPRE_Int max_nentries, hypre_BoxManNextId(manager) = 0; - /* ghost points: we choose a default that will give zero everywhere..*/ + /* ghost points: we choose a default that will give zero everywhere */ for (i = 0; i < 2 * HYPRE_MAXDIM; i++) { hypre_BoxManNumGhost(manager)[i] = 0; @@ -526,10 +538,10 @@ hypre_BoxManIncSize ( hypre_BoxManager *manager, /* increase size */ max_nentries += inc_size; - 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); + 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 = hypre_TReAlloc(info, char, max_nentries * info_size, HYPRE_MEMORY_HOST); /* update manager */ hypre_BoxManMaxNEntries(manager) = max_nentries; @@ -540,14 +552,14 @@ hypre_BoxManIncSize ( hypre_BoxManager *manager, /* my ids temporary structure (destroyed in assemble) */ { - 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); + HYPRE_Int *my_ids = hypre_BoxManMyIds(manager); + hypre_BoxManEntry **my_entries = hypre_BoxManMyEntries(manager); - my_entries = hypre_TReAlloc(my_entries, hypre_BoxManEntry *, max_nentries, HYPRE_MEMORY_HOST); + 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_BoxManMyIds(manager) = my_ids; hypre_BoxManMyEntries(manager) = my_entries; } @@ -561,35 +573,28 @@ hypre_BoxManIncSize ( hypre_BoxManager *manager, HYPRE_Int hypre_BoxManDestroy( hypre_BoxManager *manager ) { - HYPRE_Int ndim = hypre_BoxManNDim(manager); - HYPRE_Int d; + HYPRE_Int d, ndim; if (manager) { + ndim = hypre_BoxManNDim(manager); + for (d = 0; d < ndim; d++) { - hypre_TFree(hypre_BoxManIndexesD(manager, d), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_BoxManIndexesD(manager, d), HYPRE_MEMORY_HOST); } 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); hypre_TFree(hypre_BoxManMyEntries(manager), HYPRE_MEMORY_HOST); - hypre_StructAssumedPartitionDestroy(hypre_BoxManAssumedPartition(manager)); - hypre_BoxDestroy(hypre_BoxManBoundingBox(manager)); - hypre_TFree(manager, HYPRE_MEMORY_HOST); } @@ -672,7 +677,7 @@ hypre_BoxManAddEntry( hypre_BoxManager *manager, entries = hypre_BoxManEntries(manager); } - /* we add this to the end entry list - get pointer to location*/ + /* 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); @@ -705,7 +710,7 @@ hypre_BoxManAddEntry( hypre_BoxManager *manager, /* this is the current position in the entries array */ hypre_BoxManEntryPosition(entry) = nentries; - /*this associates it with the box manager */ + /* this associates it with the box manager */ hypre_BoxManEntryBoxMan(entry) = (void *) manager; /* copy the info object */ @@ -715,7 +720,7 @@ hypre_BoxManAddEntry( hypre_BoxManager *manager, /*point in the info array */ index_ptr = hypre_BoxManInfoObject(manager, nentries); - hypre_TMemcpy(index_ptr, info, char, info_size, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + 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 @@ -792,7 +797,7 @@ hypre_BoxManGetEntry( hypre_BoxManager *manager, HYPRE_Int *ids_sort = hypre_BoxManIdsSort(manager); HYPRE_Int nentries = hypre_BoxManNEntries(manager); HYPRE_Int num_proc = hypre_BoxManNumProcsSort(manager); - HYPRE_Int *proc_offsets = hypre_BoxManProcsSortOffsets(manager); + HYPRE_Int *proc_offsets = hypre_BoxManProcsSortOffsets(manager); /* can only use after assembling */ if (!hypre_BoxManIsAssembled(manager)) @@ -806,13 +811,13 @@ hypre_BoxManGetEntry( hypre_BoxManager *manager, 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)*/ + * of the time (currently it is only used in this manner) */ if (proc == myid) { start = first_local; if (start >= 0 ) { - finish = proc_offsets[hypre_BoxManLocalProcOffset(manager) + 1]; + finish = proc_offsets[hypre_BoxManLocalProcOffset(manager) + 1]; } } @@ -836,7 +841,7 @@ hypre_BoxManGetEntry( hypre_BoxManager *manager, } if (start >= 0 ) { - /* now look for the id - returns -1 if not found*/ + /* now look for the id - returns -1 if not found */ location = hypre_BinarySearch(&ids_sort[start], id, finish - start); } else @@ -971,7 +976,7 @@ hypre_BoxManGetLocalEntriesBoxes( hypre_BoxManager *manager, return hypre_error_flag; } - /* set array size */ + /* set array size */ hypre_BoxArraySetSize(boxes, num_my_entries); finish = offsets[hypre_BoxManLocalProcOffset(manager) + 1]; @@ -1015,10 +1020,10 @@ hypre_BoxManGetAllEntriesBoxesProc( hypre_BoxManager *manager, return hypre_error_flag; } - /* set array size */ + /* 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++) { @@ -1137,7 +1142,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) HYPRE_Int i, j, k; HYPRE_Int need_to_sort = 1; /* default it to sort */ - //HYPRE_Int short_sort = 0; /*do abreviated sort */ + //HYPRE_Int short_sort = 0; /* do abreviated sort */ HYPRE_Int non_ap_gather = 1; /* default to gather w/out ap*/ @@ -1156,6 +1161,8 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) return hypre_error_flag; } + HYPRE_ANNOTATE_FUNC_BEGIN; + /* initilize */ hypre_MPI_Comm_rank(comm, &myid); hypre_MPI_Comm_size(comm, &nprocs); @@ -1167,8 +1174,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) ids_sort = hypre_BoxManIdsSort(manager); - /* do we need to gather entries - check to see if ANY processor called a - * gather? */ + /* do we need to gather entries - check if ANY processor called gather */ if (!hypre_BoxManAllGlobalKnown(manager)) { @@ -1190,7 +1196,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) global_is_gather = 0; } - /* ----------------------------GATHER? ------------------------------------*/ + /*----------------------------GATHER? ------------------------------------*/ if (global_is_gather) { @@ -1229,13 +1235,13 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) HYPRE_Int size; HYPRE_Int *tmp_proc_ids; HYPRE_Int proc_count, proc_alloc; - //HYPRE_Int max_proc_count; 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 non_info_size; + size_t entry_size_bytes; HYPRE_Int *neighbor_proc_ids = NULL; HYPRE_Int *response_buf_starts; HYPRE_Int *response_buf; @@ -1249,8 +1255,6 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) HYPRE_Int max_regions, max_refinements, ologp; - HYPRE_Int *local_boxnums; - HYPRE_Int statbuf[3]; HYPRE_Int send_statbuf[3]; @@ -1288,7 +1292,6 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) (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; @@ -1303,21 +1306,17 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) 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 */ local_volume += (HYPRE_Real) hypre_BoxVolume(box); - }/* end of local boxes */ + } /* 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_Allreduce(&sendbuf2, &recvbuf2, 2, HYPRE_MPI_REAL, hypre_MPI_SUM, comm); global_volume = recvbuf2[0]; global_num_boxes = (HYPRE_Int) recvbuf2[1]; @@ -1333,18 +1332,15 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) 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); + ndim, hypre_BoxManBoundingBox(manager), global_volume, global_num_boxes, + local_boxes, max_regions, max_refinements, gamma, comm, &ap); hypre_BoxManAssumedPartition(manager) = ap; hypre_BoxArrayDestroy(local_boxes); - hypre_TFree(local_boxnums, HYPRE_MEMORY_HOST); } else { @@ -1352,21 +1348,25 @@ hypre_BoxManAssemble( hypre_BoxManager *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!*/ - - if (global_num_boxes) + region they intersect - only do the rest if we have global boxes! */ + + /* The following 'if' does not work when 'ap' is not NULL and a gather + * is needed, because 'global_num_boxes' is not set to a correct value. + * We should never have a situation where there are no boxes on any of + * the processors, but I am leaving this simply commented out for now + * until more extensive testing is done. (RDF) */ + /* if (global_num_boxes) */ { 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); + proc_array = hypre_CTAlloc(HYPRE_Int, proc_alloc, HYPRE_MEMORY_HOST); - /* probably there will mostly be one proc per box - allocate space - * for 2 */ + /* probably there will be one proc per box - allocate space for 2 */ size = 2 * hypre_BoxArraySize(gather_regions); - tmp_proc_ids = hypre_CTAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); + tmp_proc_ids = hypre_CTAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); count = 0; /* loop through all boxes */ @@ -1378,9 +1378,8 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) if ((count + proc_count) > size) { - size = size + proc_count - + 2 * (hypre_BoxArraySize(gather_regions) - i); - tmp_proc_ids = hypre_TReAlloc(tmp_proc_ids, HYPRE_Int, size, HYPRE_MEMORY_HOST); + 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++) { @@ -1392,10 +1391,10 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) 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*/ + 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); + ap_proc_ids = hypre_CTAlloc(HYPRE_Int, count, HYPRE_MEMORY_HOST); if (count) { @@ -1420,39 +1419,34 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) (what is the max?) */ /* also get the max distinct AP procs and the max # of entries) */ send_statbuf[0] = proc_count; - send_statbuf[1] = - hypre_StructAssumedPartMyPartitionNumDistinctProcs(ap); + send_statbuf[1] = hypre_StructAssumedPartMyPartitionNumDistinctProcs(ap); send_statbuf[2] = num_my_entries; - hypre_MPI_Allreduce(send_statbuf, statbuf, 3, HYPRE_MPI_INT, - hypre_MPI_MAX, comm); - - //max_proc_count = statbuf[0]; + hypre_MPI_Allreduce(send_statbuf, statbuf, 3, HYPRE_MPI_INT, hypre_MPI_MAX, comm); +#if 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?*/ + much is too much? */ /* 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 */ + * large number of processors if box sizes are relatively similar */ -#if 0 - threshold = hypre_min(12 * ologp, nprocs); - - if ( max_proc_count >= threshold) { - /* too many! */ - /*if (myid == 0) - hypre_printf("TOO BIG: check 1: max_proc_count = %d\n", max_proc_count);*/ + HYPRE_Int max_proc_count = statbuf[0]; - /* change coarse midstream!- now we will just gather everything! */ - non_ap_gather = 1; + threshold = hypre_min(12 * ologp, nprocs); - /*clean up from above */ - hypre_TFree(ap_proc_ids, HYPRE_MEMORY_HOST); + if ( max_proc_count >= threshold) + { + /* change coarse midstream!- now we will just gather everything! */ + non_ap_gather = 1; + + /*clean up from above */ + hypre_TFree(ap_proc_ids, HYPRE_MEMORY_HOST); + } } #endif @@ -1478,45 +1472,41 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) (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*/ + * all of the procs with boxes in its AP region */ - /* build response object*/ + /* build response object */ response_obj.fill_response = hypre_FillResponseBoxManAssemble1; - response_obj.data1 = ap; /* needed to fill responses*/ + 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); + send_buf_starts = hypre_CTAlloc(HYPRE_Int, proc_count + 1, HYPRE_MEMORY_HOST); for (i = 0; i < proc_count + 1; i++) { send_buf_starts[i] = 0; } - response_buf = NULL; /*this and the next are allocated in + 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 */ + /* we expect back the proc id for each box owned */ size = sizeof(HYPRE_Int); /* 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 */ + 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, - comm, (void**) &response_buf, - &response_buf_starts); + 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? */ + /* how many items were returned? */ size = response_buf_starts[proc_count]; /* alias the response buffer */ neighbor_proc_ids = response_buf; - /*clean up*/ + /* 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); @@ -1528,7 +1518,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) hypre_qsort0(neighbor_proc_ids, 0, size - 1); /* new contact list: */ - contact_proc_ids = hypre_CTAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); + contact_proc_ids = hypre_CTAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); proc_count = 0; /* to determine the number of unique ids) */ last_id = -1; @@ -1580,14 +1570,13 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) else if (contact_id == known_id) { /* known already - remove from contact list - so go - to next i and spot*/ + to next i and spot */ proc_spot++; break; } else /* contact_id < known_id */ { - /* this contact_id is not known already - keep in - list*/ + /* this contact_id is not known yet - keep in list */ contact_proc_ids[new_count] = contact_id; new_count++; break; @@ -1611,7 +1600,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) } #endif - send_buf_starts = hypre_CTAlloc(HYPRE_Int, proc_count + 1, HYPRE_MEMORY_HOST); + send_buf_starts = hypre_CTAlloc(HYPRE_Int, proc_count + 1, HYPRE_MEMORY_HOST); for (i = 0; i < proc_count + 1; i++) { send_buf_starts[i] = 0; @@ -1619,15 +1608,14 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) send_buf = NULL; /* exchange #2 - now we contact processors (send nothing) and - that processor needs to send us all of their local entry - information*/ + that processor sends us their local entry information */ - entry_response_buf = NULL; /*this and the next are allocated + 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.data1 = manager; /* needed to fill responses */ response_obj2.data2 = NULL; /* How big is an entry? @@ -1640,34 +1628,32 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) 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); + entry_size_bytes = ((size_t) non_info_size) * sizeof(HYPRE_Int) + + (size_t) 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, - send_buf, send_buf_starts, sizeof(HYPRE_Int), - entry_size_bytes, &response_obj2, - max_response_size, 4, - comm, &entry_response_buf, - &response_buf_starts); + send_buf, send_buf_starts, + sizeof(HYPRE_Int), (HYPRE_Int) 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 */ + duplicates later */ - /*how many entries do we have?*/ + /* how many entries do we have? */ response_size = response_buf_starts[proc_count]; - /* do we need more storage ?*/ + /* do we need more storage? */ if (nentries + response_size > hypre_BoxManMaxNEntries(manager)) { HYPRE_Int inc_size; - inc_size = (response_size + nentries - - hypre_BoxManMaxNEntries(manager)); - hypre_BoxManIncSize ( manager, inc_size); + inc_size = response_size + nentries - hypre_BoxManMaxNEntries(manager); + hypre_BoxManIncSize(manager, inc_size); entries = hypre_BoxManEntries(manager); procs_sort = hypre_BoxManProcsSort(manager); @@ -1681,15 +1667,17 @@ 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 */ + /* 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; } @@ -1705,7 +1693,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) index_ptr = (void *) ((char *) index_ptr + size); /* the info object (now pointer to by index_ptr) - is copied by AddEntry*/ + is copied by AddEntry */ hypre_BoxManAddEntry(manager, imin, imax, proc, id, index_ptr); /* start of next entry */ @@ -1713,16 +1701,16 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) ((char *) index_ptr + hypre_BoxManEntryInfoSize(manager)); } - /* clean up from this section of code*/ + /* 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 nested non_ap_gather -exchange 1 */ - } /* end of if global boxes */ + } /* end of if global_num_boxes */ } /********** end of gathering for the AP case *****************/ @@ -1732,10 +1720,10 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) entries id = myid (not all of the entries in the table). Then we will just re-create the entries array instead of looking for duplicates and sorting */ - HYPRE_Int entry_size_bytes; - HYPRE_Int send_count, send_count_bytes; + size_t entry_size_bytes, send_count_bytes, recv_buf_size_bytes; + HYPRE_Int send_count; HYPRE_Int *displs, *recv_counts; - HYPRE_Int recv_buf_size, recv_buf_size_bytes; + HYPRE_Int recv_buf_size; HYPRE_Int d; HYPRE_Int size, non_info_size, position; HYPRE_Int proc, id; @@ -1764,18 +1752,18 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) 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); + entry_size_bytes = ((size_t) non_info_size) * sizeof(HYPRE_Int) + + (size_t) hypre_BoxManEntryInfoSize(manager); /* 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; - recv_counts = hypre_CTAlloc(HYPRE_Int, nprocs, HYPRE_MEMORY_HOST); + send_count_bytes = ((size_t) 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); - displs = hypre_CTAlloc(HYPRE_Int, nprocs, HYPRE_MEMORY_HOST); + displs = hypre_CTAlloc(HYPRE_Int, nprocs, HYPRE_MEMORY_HOST); displs[0] = 0; recv_buf_size_bytes = recv_counts[0]; for (i = 1; i < nprocs; i++) @@ -1783,7 +1771,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) 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 = (HYPRE_Int) (recv_buf_size_bytes / entry_size_bytes); /* mydispls = displs[myid]/entry_size_bytes; */ global_num_boxes = recv_buf_size; @@ -1806,7 +1794,8 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) 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); + hypre_TMemcpy( index_ptr, &tmp_int, HYPRE_Int, 1, + HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); index_ptr = (void *) ((char *) index_ptr + size); } @@ -1815,39 +1804,42 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) 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); + hypre_TMemcpy( index_ptr, &tmp_int, HYPRE_Int, 1, + HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); index_ptr = (void *) ((char *) index_ptr + size); } /* proc */ tmp_int = hypre_BoxManEntryProc(entry); - hypre_TMemcpy( index_ptr, &tmp_int, HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + hypre_TMemcpy( index_ptr, &tmp_int, HYPRE_Int, 1, + HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); index_ptr = (void *) ((char *) index_ptr + size); /* id */ tmp_int = hypre_BoxManEntryId(entry); - hypre_TMemcpy( index_ptr, &tmp_int, HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + hypre_TMemcpy( index_ptr, &tmp_int, HYPRE_Int, 1, + HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); index_ptr = (void *) ((char *) index_ptr + size); - /*info object*/ + /* info object*/ size = hypre_BoxManEntryInfoSize(manager); position = hypre_BoxManEntryPosition(entry); info = hypre_BoxManInfoObject(manager, position); - hypre_TMemcpy(index_ptr, info, char, size, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + 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! */ - hypre_MPI_Allgatherv(send_buf, send_count_bytes, hypre_MPI_BYTE, + hypre_MPI_Allgatherv(send_buf, (HYPRE_Int) send_count_bytes, hypre_MPI_BYTE, recv_buf, recv_counts, displs, hypre_MPI_BYTE, comm); /* 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)) { @@ -1875,15 +1867,17 @@ 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 */ + /* 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; } @@ -1891,21 +1885,18 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) /* proc */ tmp_int_ptr = (HYPRE_Int *) index_ptr; proc = *tmp_int_ptr; - index_ptr = (void *) ((char *) index_ptr + size); + 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); + 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, - index_ptr ); + hypre_BoxManAddEntry(manager, imin, imax, proc, id, index_ptr); /* start of next entry */ - index_ptr = (void *) ((char *) index_ptr + - hypre_BoxManEntryInfoSize(manager)); + index_ptr = (void *) ((char *) index_ptr + hypre_BoxManEntryInfoSize(manager)); } hypre_BoxManAllGlobalKnown(manager) = 1; @@ -1922,11 +1913,10 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) } /********* end of non-AP gather *****************/ - }/* end of if (gather entries) for both AP and non-AP */ + } /* end of if (gather entries) for both AP and non-AP */ else { - /* no gather - so check to see if the entries have been sorted by the user - - if so we don't need to sort! */ + /* no gather - so we don't need to sort! */ if (hypre_BoxManIsEntriesSort(manager)) { need_to_sort = 0; @@ -1941,7 +1931,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) hypre_BoxManMyIds(manager) = NULL; hypre_BoxManMyEntries(manager) = NULL; - /* -----------------------SORT--------------------------------------*/ + /*-----------------------SORT--------------------------------------*/ /* now everything we need is in entries, also ids and procs have * been added to procs_sort and ids_sort, but possibly not sorted. (check need_to_sort @@ -1951,7 +1941,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; @@ -1974,8 +1964,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) nentries = hypre_BoxManNEntries(manager); entries = hypre_BoxManEntries(manager); - /* these are negative if a proc does not have any local entries in the - manager */ + /* these are negative if a proc has no local entries in the manager */ first_local = -1; myoffset = -1; @@ -1993,11 +1982,11 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) } else { - /*stuff below */ + /* stuff below */ } #endif - order_index = hypre_CTAlloc(HYPRE_Int, nentries, HYPRE_MEMORY_HOST); - delete_array = hypre_CTAlloc(HYPRE_Int, nentries, HYPRE_MEMORY_HOST); + 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++) @@ -2014,14 +2003,14 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) num_procs_sort++; } - /* now sort on ids within each processor number*/ + /* now sort on ids within each processor number */ start = 0; for (i = 1; i < nentries; i++) { if (procs_sort[i] != tmp_id) { hypre_qsort2i(ids_sort, order_index, start, i - 1); - /*now find duplicate ids */ + /* now find duplicate ids */ for (j = start + 1; j < i; j++) { if (ids_sort[j] == ids_sort[j - 1]) @@ -2035,12 +2024,11 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) num_procs_sort++; } } - /* final sort and purge (the last group doesn't get caught in the above - loop) */ + /* final sort and purge (the last group isn't caught in above loop) */ if (nentries) { hypre_qsort2i(ids_sort, order_index, start, nentries - 1); - /*now find duplicate boxnums */ + /* now find duplicate boxnums */ for (j = start + 1; j < nentries; j++) { if (ids_sort[j] == ids_sort[j - 1]) @@ -2064,7 +2052,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) while ((i + j) == delete_array[j]) /* see if deleting * consec. items */ { - j++; /*increase the shift*/ + j++; /* increase the shift */ if (j == index) { break; } } } @@ -2087,7 +2075,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) void *info; size = nentries - index; - new_entries = hypre_CTAlloc(hypre_BoxManEntry, size, HYPRE_MEMORY_HOST); + new_entries = hypre_CTAlloc(hypre_BoxManEntry, size, HYPRE_MEMORY_HOST); new_info = hypre_TAlloc(char, size * info_size, HYPRE_MEMORY_HOST); index_ptr = new_info; @@ -2104,7 +2092,8 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) position = hypre_BoxManEntryPosition(&entries[order_index[i]]); info = hypre_BoxManInfoObject(manager, position); - hypre_TMemcpy(index_ptr, info, char, info_size, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + hypre_TMemcpy(index_ptr, info, char, info_size, + HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); index_ptr = (void *) ((char *) index_ptr + info_size); } @@ -2125,8 +2114,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) else { - /* no sorting - just get num_procs_sort by looping through procs_sort - array*/ + /* no sorting - get num_procs_sort by looping through procs_sort */ num_procs_sort = 0; if (nentries > 0) @@ -2148,7 +2136,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) /* finally, create proc_offsets (myoffset corresponds to local id position) first_local is the position in entries; */ - proc_offsets = hypre_CTAlloc(HYPRE_Int, num_procs_sort + 1, HYPRE_MEMORY_HOST); + proc_offsets = hypre_CTAlloc(HYPRE_Int, num_procs_sort + 1, HYPRE_MEMORY_HOST); proc_offsets[0] = 0; if (nentries > 0) { @@ -2184,7 +2172,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) hypre_TFree(delete_array, HYPRE_MEMORY_HOST); hypre_TFree(order_index, HYPRE_MEMORY_HOST); - }/* end bracket for all or the sorting stuff */ + } /* end bracket for all or the sorting stuff */ { /* for the assumed partition case, we can check to see if all the global @@ -2198,8 +2186,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) if (!hypre_BoxManAllGlobalKnown(manager) && global_is_gather) { - /*if every processor has its nentries = global_num_boxes, then all is - * known */ + /* if every proc has nentries = global_num_boxes, then all is known */ if (global_num_boxes == nentries) { all_known = 1; } hypre_MPI_Allreduce(&all_known, &global_all_known, 1, HYPRE_MPI_INT, @@ -2212,7 +2199,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) /*------------------------------INDEX TABLE ---------------------------*/ /* now build the index_table and indexes array */ - /* Note: for now we are using the same scheme as in BoxMap */ + /* Note: for now we are using the same scheme as in BoxMap */ { HYPRE_Int *indexes[HYPRE_MAXDIM]; HYPRE_Int size[HYPRE_MAXDIM]; @@ -2251,7 +2238,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 */ @@ -2275,14 +2262,12 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) if (!i) { - location = hypre_BinarySearch2(indexes[d], iminmax[i], 0, - size[d] - 1, &j); + location = hypre_BinarySearch2(indexes[d], iminmax[i], 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); + location = hypre_BinarySearch2(indexes[d], iminmax[i], j, size[d] - 1, &j); if (location != -1) { index_not_there = 0; } } @@ -2315,7 +2300,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) *------------------------------------------------------*/ /* allocate space for table */ - index_table = hypre_CTAlloc(hypre_BoxManEntry *, itsize, HYPRE_MEMORY_HOST); + index_table = hypre_CTAlloc(hypre_BoxManEntry *, itsize, HYPRE_MEMORY_HOST); index_box = hypre_BoxCreate(ndim); table_box = hypre_BoxCreate(ndim); @@ -2323,12 +2308,11 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) /* create a table_box for use below */ hypre_SetIndex(stride, 1); hypre_BoxSetExtents(table_box, stride, size); - hypre_BoxShiftNeg(table_box, stride); /* Want box to start at 0*/ + hypre_BoxShiftNeg(table_box, stride); /* Want box to start at 0 */ /* which are my entries? (on-processor) */ mystart = hypre_BoxManFirstLocal(manager); - if (mystart >= 0 ) /* we have local entries) because - firstlocal = -1 if no local entries */ + if (mystart >= 0 ) /* we have local entries) because firstlocal = -1 if no local entries */ { loop_num = 3; /* basically we have need to do the same code fragment repeated three @@ -2375,7 +2359,7 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) 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*/ + } /* now have imin and imax location in index array */ /* set up index table */ hypre_BoxSetExtents(index_box, imin, imax); @@ -2396,17 +2380,16 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) hypre_SerialBoxLoop1End(ii); } /* end of subset of entries */ - }/* end of three loops over subsets */ + } /* end of three loops over subsets */ - /* done with the index_table! */ - hypre_TFree( hypre_BoxManIndexTable(manager), HYPRE_MEMORY_HOST); /* in case this is a - re-assemble - shouldn't - be though */ + /* done with the index_table! (in case this is a re-assemble - shouldn't + * be though) */ + hypre_TFree( hypre_BoxManIndexTable(manager), HYPRE_MEMORY_HOST); hypre_BoxManIndexTable(manager) = index_table; for (d = 0; d < ndim; d++) { - hypre_TFree(hypre_BoxManIndexesD(manager, d), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_BoxManIndexesD(manager, d), HYPRE_MEMORY_HOST); hypre_BoxManIndexesD(manager, d) = indexes[d]; hypre_BoxManSizeD(manager, d) = size[d]; hypre_BoxManLastIndexD(manager, d) = 0; @@ -2428,6 +2411,8 @@ hypre_BoxManAssemble( hypre_BoxManager *manager ) hypre_BoxManIsAssembled(manager) = 1; + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } @@ -2498,7 +2483,7 @@ hypre_BoxManIntersect ( hypre_BoxManager *manager, man_indexes_d = hypre_BoxManIndexesD(manager, d); man_index_size_d = hypre_BoxManSizeD(manager, d); - /* -----find location of ilower[d] in indexes-----*/ + /*-----find location of ilower[d] in indexes-----*/ find_index_d = hypre_IndexD(ilower, d); /* Start looking in place indicated by last_index stored in map */ @@ -2529,7 +2514,7 @@ hypre_BoxManIntersect ( hypre_BoxManager *manager, man_ilower[d] = hypre_max(current_index_d, 0); } - /* -----find location of iupper[d] in indexes-----*/ + /*-----find location of iupper[d] in indexes-----*/ find_index_d = hypre_IndexD(iupper, d); @@ -2557,8 +2542,8 @@ hypre_BoxManIntersect ( hypre_BoxManager *manager, *-----------------------------------------------------------------*/ nentries = hypre_BoxManMaxNEntries(manager); - entries = hypre_CTAlloc(hypre_BoxManEntry *, nentries, HYPRE_MEMORY_HOST); /* realloc below */ - marker = hypre_CTAlloc(HYPRE_Int, nentries, HYPRE_MEMORY_HOST); + entries = hypre_CTAlloc(hypre_BoxManEntry *, nentries, HYPRE_MEMORY_HOST); /* realloc below */ + marker = hypre_CTAlloc(HYPRE_Int, nentries, HYPRE_MEMORY_HOST); index_table = hypre_BoxManIndexTable(manager); nentries = 0; @@ -2591,7 +2576,7 @@ hypre_BoxManIntersect ( hypre_BoxManager *manager, } hypre_SerialBoxLoop1End(ii); - entries = hypre_TReAlloc(entries, hypre_BoxManEntry *, nentries, HYPRE_MEMORY_HOST); + entries = hypre_TReAlloc(entries, hypre_BoxManEntry *, nentries, HYPRE_MEMORY_HOST); /* Reset the last index in the manager */ for (d = 0; d < ndim; d++) @@ -2649,9 +2634,9 @@ hypre_FillResponseBoxManAssemble1( void *p_recv_contact_buf, /* NOTE: in the AP, boxes with the same proc id are adjacent (but proc ids not in any sorted order) */ - /* how many boxes do we have in the AP?*/ + /* how many boxes do we have in the AP? */ num_boxes = hypre_StructAssumedPartMyPartitionIdsSize(ap); - /* how many procs do we have in the AP?*/ + /* how many procs do we have in the AP? (this is an upper bound) */ num_objects = hypre_StructAssumedPartMyPartitionNumDistinctProcs(ap); /* num_objects is then how much we need to send*/ @@ -2659,31 +2644,29 @@ hypre_FillResponseBoxManAssemble1( void *p_recv_contact_buf, /* 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 ) + if ( response_obj->send_response_storage < num_objects ) { - response_obj->send_response_storage = hypre_max(num_objects, 10); + 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); + send_response_buf = hypre_TReAlloc( send_response_buf, HYPRE_Int, size, HYPRE_MEMORY_HOST); *p_send_response_buf = send_response_buf; } - /* populate send_response_buf with distinct proc ids*/ + /* populate send_response_buf with distinct proc ids */ index = 0; - - if (num_objects > 0) + if (num_boxes > 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]) + for (i = 1; i < num_boxes; i++) { - send_response_buf[index++] = proc_ids[i]; + /* processor id */ + if (proc_ids[i] != proc_ids[i - 1]) + { + send_response_buf[index++] = proc_ids[i]; + } } } + num_objects = index; /* return variables */ *response_message_size = num_objects; @@ -2691,6 +2674,7 @@ hypre_FillResponseBoxManAssemble1( void *p_recv_contact_buf, return hypre_error_flag; } + /****************************************************************************** * contact message is null. the response needs to be the all our entries (with * id = myid). @@ -2718,7 +2702,7 @@ hypre_FillResponseBoxManAssemble2( void *p_recv_contact_buf, 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_BoxManager *manager = (hypre_BoxManager *)response_obj->data1; HYPRE_Int overhead = response_obj->send_response_overhead; HYPRE_Int ndim = hypre_BoxManNDim(manager); @@ -2733,11 +2717,11 @@ hypre_FillResponseBoxManAssemble2( void *p_recv_contact_buf, /* 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 ) + 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); - send_response_buf = hypre_TReAlloc( (char*)send_response_buf, char, size, HYPRE_MEMORY_HOST); + send_response_buf = hypre_TReAlloc(send_response_buf, char, size, HYPRE_MEMORY_HOST); *p_send_response_buf = send_response_buf; } @@ -2750,40 +2734,43 @@ hypre_FillResponseBoxManAssemble2( void *p_recv_contact_buf, /*pack response buffer with information */ size = sizeof(HYPRE_Int); + /* imin */ 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); + hypre_TMemcpy( index_ptr, &tmp_int, HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + index_ptr = (void *) ((char *) index_ptr + size); } + /* imax */ index = hypre_BoxManEntryIMax(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); + hypre_TMemcpy( index_ptr, &tmp_int, HYPRE_Int, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + index_ptr = (void *) ((char *) index_ptr + size); } + /* proc */ 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); + 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); + 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); info = hypre_BoxManInfoObject(manager, position); - hypre_TMemcpy(index_ptr, info, char, size, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + hypre_TMemcpy(index_ptr, info, char, size, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); - index_ptr = (void *) ((char *) index_ptr + size); + index_ptr = (void *) ((char *) index_ptr + size); } diff --git a/src/struct_mv/boxloop_host.h b/src/struct_mv/boxloop_host.h index 6b4672c324..4eb818d0ad 100644 --- a/src/struct_mv/boxloop_host.h +++ b/src/struct_mv/boxloop_host.h @@ -26,8 +26,12 @@ #else #define Pragma(x) _Pragma(HYPRE_XSTR(x)) #endif +#ifndef OMP0 #define OMP0 Pragma(omp parallel for HYPRE_OMP_CLAUSE HYPRE_BOX_REDUCTION HYPRE_SMP_SCHEDULE) +#endif +#ifndef OMP1 #define OMP1 Pragma(omp parallel for private(HYPRE_BOX_PRIVATE) HYPRE_OMP_CLAUSE HYPRE_BOX_REDUCTION HYPRE_SMP_SCHEDULE) +#endif #else /* #if defined(HYPRE_USING_OPENMP) */ #define OMP0 #define OMP1 @@ -392,4 +396,3 @@ #endif #endif /* #ifndef HYPRE_BOXLOOP_HOST_HEADER */ - diff --git a/src/struct_mv/coarsen.c b/src/struct_mv/coarsen.c new file mode 100644 index 0000000000..272feee642 --- /dev/null +++ b/src/struct_mv/coarsen.c @@ -0,0 +1,689 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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" + +#define DEBUG 0 +#define TIME_DEBUG 0 + +#if DEBUG +char filename[255]; +FILE *file; +static HYPRE_Int debug_count = 0; +#endif + +#if TIME_DEBUG +static HYPRE_Int s_coarsen_num = 0; +#endif + +/*-------------------------------------------------------------------------- + * If 'origin' is NULL, a zero origin is used. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MapToCoarseIndex( hypre_Index index, + hypre_IndexRef origin, + hypre_Index stride, + HYPRE_Int ndim ) +{ + HYPRE_Int d; + + for (d = 0; d < ndim; d++) + { + if (origin != NULL) + { + index[d] -= origin[d]; + } + if ((index[d] % stride[d]) != 0) + { + /* This index doesn't map directly to a coarse index */ + hypre_error(HYPRE_ERROR_GENERIC); + } + index[d] /= stride[d]; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * If 'origin' is NULL, a zero origin is used. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MapToFineIndex( hypre_Index index, + hypre_IndexRef origin, + hypre_Index stride, + HYPRE_Int ndim ) +{ + HYPRE_Int d; + + for (d = 0; d < ndim; d++) + { + index[d] *= stride[d]; + if (origin != NULL) + { + index[d] += origin[d]; + } + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * TODO: Start phasing out the following two routines. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMapFineToCoarse( hypre_Index findex, + hypre_Index origin, + hypre_Index stride, + hypre_Index cindex ) +{ + hypre_CopyToIndex(findex, 3, cindex); + hypre_MapToCoarseIndex(cindex, origin, stride, 3); + + return hypre_error_flag; +} + +HYPRE_Int +hypre_StructMapCoarseToFine( hypre_Index cindex, + hypre_Index origin, + hypre_Index stride, + hypre_Index findex ) +{ + hypre_CopyToIndex(cindex, 3, findex); + hypre_MapToFineIndex(findex, origin, stride, 3); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Compute a new coarse (origin, stride) pair from an old (origin, stride) pair. + * This new pair can be used with the RefineBox() function to map back to the + * finest grid with just one call, i.e., the following two lines of code are + * equivalent: + * + * RefineBox(box, origin_new, stride_new); + * RefineBox(box, origin, stride); RefineBox(box, origin_old, stride_old); + * + * NOTE: Need to check to see if this holds for CoarsenBox() also. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ComputeCoarseOriginStride( hypre_Index coarse_origin, + hypre_Index coarse_stride, + hypre_IndexRef origin, + hypre_Index stride, + HYPRE_Int ndim ) +{ + HYPRE_Int d; + + for (d = 0; d < ndim; d++) + { + if (origin != NULL) + { + coarse_origin[d] += origin[d] * coarse_stride[d]; + } + coarse_stride[d] *= stride[d]; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * This may produce an empty box, i.e., one with volume 0. + * If 'origin' is NULL, a zero origin is used. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CoarsenBox( hypre_Box *box, + hypre_IndexRef origin, + hypre_Index stride ) +{ + hypre_ProjectBox(box, origin, stride); + hypre_MapToCoarseIndex(hypre_BoxIMin(box), origin, stride, hypre_BoxNDim(box)); + hypre_MapToCoarseIndex(hypre_BoxIMax(box), origin, stride, hypre_BoxNDim(box)); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_RefineBox( hypre_Box *box, + hypre_IndexRef origin, + hypre_Index stride ) +{ + hypre_MapToFineIndex(hypre_BoxIMin(box), origin, stride, hypre_BoxNDim(box)); + hypre_MapToFineIndex(hypre_BoxIMax(box), origin, stride, hypre_BoxNDim(box)); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * The dimensions of the modified box array are not changed. + * It is possible to have boxes with volume 0. + * If 'origin' is NULL, a zero origin is used. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CoarsenBoxArray( hypre_BoxArray *box_array, + hypre_IndexRef origin, + hypre_Index stride ) +{ + HYPRE_Int i; + + hypre_ForBoxI(i, box_array) + { + hypre_CoarsenBox(hypre_BoxArrayBox(box_array, i), origin, stride); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_RefineBoxArray( hypre_BoxArray *box_array, + hypre_IndexRef origin, + hypre_Index stride ) +{ + HYPRE_Int i; + + hypre_ForBoxI(i, box_array) + { + hypre_RefineBox(hypre_BoxArrayBox(box_array, i), origin, stride); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * The dimensions of the modified box array-array are not changed. + * It is possible to have boxes with volume 0. + * If 'origin' is NULL, a zero origin is used. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CoarsenBoxArrayArray( hypre_BoxArrayArray *box_array_array, + hypre_IndexRef origin, + hypre_Index stride ) +{ + hypre_BoxArray *box_array; + HYPRE_Int i; + + hypre_ForBoxArrayI(i, box_array_array) + { + box_array = hypre_BoxArrayArrayBoxArray(box_array_array, i); + hypre_CoarsenBoxArray(box_array, origin, stride); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_RefineBoxArrayArray( hypre_BoxArrayArray *box_array_array, + hypre_IndexRef origin, + hypre_Index stride ) +{ + hypre_BoxArray *box_array; + HYPRE_Int i; + + hypre_ForBoxArrayI(i, box_array_array) + { + box_array = hypre_BoxArrayArrayBoxArray(box_array_array, i); + hypre_RefineBoxArray(box_array, origin, stride); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * RDF: This routine is currently only used to coarsen the part boundary boxes + * in the SStruct code. Consider renaming and moving it in the future. + * + * Each box is: grown by stride-1, coarsened, and intersected with a refbox. + * This has the effect of coarsening each box "outward" while ensuring that it + * is contained within a refbox. + * + * The dimensions of the new BoxArrayArray may change. + * It is not possible to have boxes with volume 0. + * If 'origin' is NULL, a zero origin is used. + * + * TODO: Substitute the BinarySearch for a loop over the largest BoxArray + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CoarsenBoxArrayArrayOutward( hypre_BoxArrayArray *boxaa, + hypre_BoxArray *refboxa, + hypre_IndexRef origin, + hypre_Index stride, + hypre_BoxArrayArray **new_boxaa_ptr ) +{ + HYPRE_Int ndim = hypre_BoxArrayArrayNDim(boxaa); + HYPRE_Int num_refboxes = hypre_BoxArraySize(refboxa); + HYPRE_Int *refbox_ids = hypre_BoxArrayIDs(refboxa); + + hypre_Box *box; + hypre_Box *refbox; + hypre_BoxArray *boxa; + hypre_BoxArray *new_boxa; + hypre_BoxArrayArray *new_boxaa; + + hypre_Index unit_index; + hypre_Index grow_index; + + HYPRE_Int count_box; + HYPRE_Int count_boxa; + HYPRE_Int box_id; + HYPRE_Int i, ii, j; + + /* Set grow_index = stride - unit_index */ + hypre_SetIndex(unit_index, 1); + hypre_SubtractIndexes(stride, unit_index, ndim, grow_index); + + /* Allocate box */ + box = hypre_BoxCreate(ndim); + + /* Find out how many BoxArrays will be coarsened */ + count_boxa = 0; + hypre_ForBoxArrayI(i, boxaa) + { + boxa = hypre_BoxArrayArrayBoxArray(boxaa, i); + box_id = hypre_BoxArrayArrayID(boxaa, i); + + ii = hypre_BinarySearch(refbox_ids, box_id, num_refboxes); + hypre_assert(ii > -1); + refbox = hypre_BoxArrayBox(refboxa, ii); + + hypre_ForBoxI(j, boxa) + { + hypre_CopyBox(hypre_BoxArrayBox(boxa, j), box); + hypre_BoxGrowByIndex(box, grow_index); + hypre_CoarsenBox(box, origin, stride); + hypre_IntersectBoxes(box, refbox, box); + if (hypre_BoxVolume(box)) + { + count_boxa++; + break; + } + } + } + + /* Allocate memory */ + new_boxaa = hypre_BoxArrayArrayCreate(count_boxa, ndim); + + /* Coarsen BoxArrayArray */ + count_boxa = 0; + hypre_ForBoxArrayI(i, boxaa) + { + boxa = hypre_BoxArrayArrayBoxArray(boxaa, i); + box_id = hypre_BoxArrayArrayID(boxaa, i); + + ii = hypre_BinarySearch(refbox_ids, box_id, num_refboxes); + refbox = hypre_BoxArrayBox(refboxa, ii); + + count_box = 0; + hypre_ForBoxI(j, boxa) + { + hypre_CopyBox(hypre_BoxArrayBox(boxa, j), box); + hypre_BoxGrowByIndex(box, grow_index); + hypre_CoarsenBox(box, origin, stride); + hypre_IntersectBoxes(box, refbox, box); + if (hypre_BoxVolume(box)) + { + count_box++; + } + } + + if (count_box) + { + new_boxa = hypre_BoxArrayArrayBoxArray(new_boxaa, count_boxa); + hypre_BoxArraySetSize(new_boxa, count_box); + + count_box = 0; + hypre_ForBoxI(j, boxa) + { + hypre_CopyBox(hypre_BoxArrayBox(boxa, j), box); + hypre_BoxGrowByIndex(box, grow_index); + hypre_CoarsenBox(box, origin, stride); + hypre_IntersectBoxes(box, refbox, box); + if (hypre_BoxVolume(box)) + { + hypre_CopyBox(box, hypre_BoxArrayBox(new_boxa, count_box)); + count_box++; + } + } + hypre_BoxArrayArrayID(new_boxaa, count_boxa) = hypre_BoxArrayArrayID(boxaa, i); + count_boxa++; + } + } + + /* Free memory */ + hypre_BoxDestroy(box); + + /* Set pointer to new_boxaa */ + *new_boxaa_ptr = new_boxaa; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * This routine coarsens the grid, 'fgrid', by the coarsening factor, 'stride', + * using the index mapping in 'hypre_MapToCoarseIndex'. + * + * 1. A coarse grid is created with boxes that result from coarsening the fine + * grid boxes, bounding box, and periodicity information. + * + * 2. If "sufficient" neighbor information exists in the fine grid to be + * transferred to the coarse grid, then the coarse grid box manager can be + * created by simply coarsening all of the entries in the fine grid manager. + * ("Sufficient" is determined by checking max_distance in the fine grid.) + * + * 3. Otherwise, neighbor information will be collected during the + * StructGridAssemble according to the chosen value of max_distance for the + * coarse grid. + * + * 4. We do not need a separate version for the assumed partition case + * + * 5. The coarse grid is returned in unassembled format to provide more + * control on MPI collective calls from the semi-struct interface. Thus, + * a grid created with this function must be assembled later. + * + * If 'origin' is NULL, a zero origin is used. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructCoarsen( hypre_StructGrid *fgrid, + hypre_IndexRef origin, + hypre_Index stride, + HYPRE_Int prune, + hypre_StructGrid **cgrid_ptr ) +{ + hypre_StructGrid *cgrid; + + MPI_Comm comm; + HYPRE_Int ndim; + + hypre_BoxArray *fboxes; + hypre_BoxArray *cboxes; + + hypre_Index periodic; + hypre_Index ilower, iupper; + + hypre_Box *box; + hypre_Box *new_box; + hypre_Box *bounding_box; + + HYPRE_Int i, j, myid, count; + HYPRE_Int info_size, max_nentries; + HYPRE_Int num_entries; + HYPRE_Int *fids, *cids; + hypre_Index new_dist; + hypre_IndexRef max_distance; + HYPRE_Int proc, id; + HYPRE_Int coarsen_factor, known; + HYPRE_Int num, last_proc; + hypre_BoxManager *fboxman, *cboxman; + + hypre_BoxManEntry *entries; + hypre_BoxManEntry *entry; + + void *entry_info = NULL; + +#if TIME_DEBUG + HYPRE_Int tindex; + char new_title[80]; + hypre_sprintf(new_title, "Coarsen.%d", s_coarsen_num); + tindex = hypre_InitializeTiming(new_title); + s_coarsen_num++; + + hypre_BeginTiming(tindex); +#endif + + HYPRE_ANNOTATE_FUNC_BEGIN; + + hypre_SetIndex(ilower, 0); + hypre_SetIndex(iupper, 0); + + /* get relevant information from the fine grid */ + fboxes = hypre_StructGridBoxes(fgrid); + fids = hypre_StructGridIDs(fgrid); + fboxman = hypre_StructGridBoxMan(fgrid); + comm = hypre_StructGridComm(fgrid); + ndim = hypre_StructGridNDim(fgrid); + max_distance = hypre_StructGridMaxDistance(fgrid); + + /* initial */ + hypre_MPI_Comm_rank(comm, &myid ); + + /* create new coarse grid */ + hypre_StructGridCreate(comm, ndim, &cgrid); + + /* Set global size to a number different than zero to + avoid its computation on hypre_StructGridAssemble. */ + hypre_StructGridGlobalSize(cgrid) = -1; + + /* RDF TODO: Inherit num ghost from fgrid here... */ + + /* coarsen boxes and create the coarse grid ids (same as fgrid) */ + /* TODO: Move this to hypre_CoarsenBoxArray */ + if (prune) + { + /* Compute number of active boxes in the coarse grid */ + box = hypre_BoxCreate(ndim); + count = 0; + hypre_ForBoxI(i, fboxes) + { + hypre_CopyBox(hypre_BoxArrayBox(fboxes, i), box); + hypre_CoarsenBox(box, origin, stride); + if (hypre_BoxVolume(box)) + { + count++; + } + } + + cboxes = hypre_BoxArrayCreate(count, ndim); + cids = hypre_TAlloc(HYPRE_Int, count, HYPRE_MEMORY_HOST); + count = 0; + hypre_ForBoxI(i, fboxes) + { + hypre_CopyBox(hypre_BoxArrayBox(fboxes, i), box); + hypre_CoarsenBox(box, origin, stride); + if (hypre_BoxVolume(box)) + { + hypre_CopyBox(box, hypre_BoxArrayBox(cboxes, count)); + cids[count] = fids[i]; + hypre_BoxArrayID(cboxes, count) = fids[i]; + count++; + } + } + hypre_BoxDestroy(box); + } + else + { + /* number of boxes in coarse and fine grids are equal */ + cboxes = hypre_BoxArrayClone(fboxes); + hypre_CoarsenBoxArray(cboxes, origin, stride); + cids = hypre_TAlloc(HYPRE_Int, hypre_BoxArraySize(fboxes), HYPRE_MEMORY_HOST); + hypre_ForBoxI(i, fboxes) + { + cids[i] = fids[i]; + } + } + + /* set coarse grid boxes */ + hypre_StructGridSetBoxes(cgrid, cboxes); + + /* 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_StructGridSetPeriodic(cgrid, periodic); + + /* Check the max_distance value of the fine grid to determine whether we will + need to re-gather information in the assemble. If we need to re-gather, + then the max_distance will be set to (0,0,0). Either way, we will create + and populate the box manager with the information from the fine grid. + + Note: if all global info is already known for a grid, the we do not need + to re-gather regardless of the max_distance values. */ + + // hypre_SetIndex(new_dist, 2); /* RDF: Is this needed with new MAXDIM stuff? */ + for (i = 0; i < ndim; i++) + { + coarsen_factor = hypre_IndexD(stride, i); + hypre_IndexD(new_dist, i) = hypre_IndexD(max_distance, i) / coarsen_factor; + } + + hypre_BoxManGetAllGlobalKnown(fboxman, &known); + + if ((hypre_IndexMin(new_dist, ndim) > 1) || known) + { + /* large enough - don't need to re-gather */ + if (!known) + { + /* update new max distance value 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 */ + hypre_SetIndex(new_dist, 0); + hypre_StructGridSetMaxDistance(cgrid, new_dist); + } + + /* update the new bounding box */ + bounding_box = hypre_BoxClone(hypre_StructGridBoundingBox(fgrid)); + hypre_CoarsenBox(bounding_box, origin, stride); + + hypre_StructGridSetBoundingBox(cgrid, bounding_box); + + /* 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, + 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); + + new_box = hypre_BoxCreate(ndim); + num = 0; + last_proc = -1; + + /* entries are sorted by (proc, id) pairs - may not have entries for all + processors, but for each processor represented, we do have all of its + boxes. We will keep them sorted in the new box manager - to avoid + re-sorting */ + for (i = 0; i < num_entries; i++) + { + entry = &entries[i]; + proc = hypre_BoxManEntryProc(entry); + + if (proc != myid) /* not my boxes */ + { + hypre_BoxManEntryGetExtents(entry, ilower, iupper); + hypre_BoxSetExtents(new_box, ilower, iupper); + hypre_CoarsenBox(new_box, origin, stride); + id = hypre_BoxManEntryId(entry); + /* if there is pruning we need to adjust the ids if any boxes drop out + (we want these ids sequential - no gaps) - and zero boxes are not + kept in the box manager */ + if (prune) + { + if (proc != last_proc) + { + num = 0; + last_proc = proc; + } + if (hypre_BoxVolume(new_box)) + { + hypre_BoxManAddEntry(cboxman, hypre_BoxIMin(new_box), + hypre_BoxIMax(new_box), proc, num, entry_info); + num++; + } + } + else /* no pruning - just use id (note that size zero boxes will not be + saved in the box manager, so we will have gaps in the box + numbers) */ + { + 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) */ + { + if (proc != last_proc) /* just do this once (the first myid) */ + { + hypre_ForBoxI(j, cboxes) + { + box = hypre_BoxArrayBox(cboxes, j); + hypre_BoxManAddEntry(cboxman, hypre_BoxIMin(box), + hypre_BoxIMax(box), myid, j, entry_info ); + } + last_proc = proc; + } + } + } /* loop through entries */ + + /* these entries are sorted */ + hypre_BoxManSetIsEntriesSort(cboxman, 1); + + hypre_BoxDestroy(new_box); + + // TODO: StructCoarsenAP breaks the regression tests +#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 */ + hypre_StructCoarsenAP(fap, origin, stride, &cap); + + /* set cap */ + hypre_BoxManSetAssumedPartition(cboxman, cap); + } +#endif + + /* assign new box manager */ + hypre_StructGridSetBoxManager(cgrid, cboxman); + + /* return the coarse grid */ + *cgrid_ptr = cgrid; + +#if TIME_DEBUG + hypre_EndTiming(tindex); +#endif + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} diff --git a/src/struct_mv/communication_info.c b/src/struct_mv/communication_info.c index 60eb4b0a61..c2d3212723 100644 --- a/src/struct_mv/communication_info.c +++ b/src/struct_mv/communication_info.c @@ -7,6 +7,125 @@ #include "_hypre_struct_mv.h" +/*-------------------------------------------------------------------------- + * See comments for CreateCommInfo() routine for more info on CommStencil + *--------------------------------------------------------------------------*/ + +hypre_CommStencil * +hypre_CommStencilCreate( HYPRE_Int ndim ) +{ + hypre_CommStencil *comm_stencil; + hypre_Box *csbox; + HYPRE_Int *csdata; + + comm_stencil = hypre_CTAlloc(hypre_CommStencil, 1, HYPRE_MEMORY_HOST); + + csbox = hypre_BoxCreate(ndim); + hypre_SetIndex(hypre_BoxIMin(csbox), 0); + hypre_SetIndex(hypre_BoxIMax(csbox), 2); + csdata = hypre_CTAlloc(HYPRE_Int, hypre_BoxVolume(csbox), HYPRE_MEMORY_HOST); + + hypre_CommStencilNDim(comm_stencil) = ndim; + hypre_CommStencilBox(comm_stencil) = csbox; + hypre_CommStencilData(comm_stencil) = csdata; + hypre_SetIndex(hypre_CommStencilStride(comm_stencil), 1); + + return comm_stencil; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommStencilSetEntry( hypre_CommStencil *comm_stencil, + hypre_Index offset ) +{ + HYPRE_Int ndim = hypre_CommStencilNDim(comm_stencil); + hypre_Box *csbox = hypre_CommStencilBox(comm_stencil); + HYPRE_Int *csdata = hypre_CommStencilData(comm_stencil); + hypre_IndexRef stride = hypre_CommStencilStride(comm_stencil); + HYPRE_Int *mgrow = hypre_CommStencilMGrow(comm_stencil); + HYPRE_Int *pgrow = hypre_CommStencilPGrow(comm_stencil); + + hypre_Box boxmem; + hypre_Box *box = &boxmem; + hypre_IndexRef imin = hypre_BoxIMin(box); + hypre_IndexRef imax = hypre_BoxIMax(box); + hypre_Index loop_size; + HYPRE_Int d, m; + + hypre_BoxInit(box, ndim); + + for (d = 0; d < ndim; d++) + { + m = offset[d]; + + imin[d] = 1; + imax[d] = 1; + + if (m < 0) + { + imin[d] = 0; + mgrow[d] = hypre_max(mgrow[d], -m); + } + else if (m > 0) + { + imax[d] = 2; + pgrow[d] = hypre_max(pgrow[d], m); + } + } + + /* update comm-stencil data */ + hypre_BoxGetSize(box, loop_size); + hypre_SerialBoxLoop1Begin(ndim, loop_size, + csbox, imin, stride, ii); + { + csdata[ii] = 1; + } + hypre_SerialBoxLoop1End(ii); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommStencilDestroy( hypre_CommStencil *comm_stencil ) +{ + hypre_BoxDestroy(hypre_CommStencilBox(comm_stencil)); + hypre_TFree(hypre_CommStencilData(comm_stencil), HYPRE_MEMORY_HOST); + hypre_TFree(comm_stencil, HYPRE_MEMORY_HOST); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommStencilCreateNumGhost( hypre_CommStencil *comm_stencil, + HYPRE_Int **num_ghost_ptr ) +{ + HYPRE_Int *num_ghost; + HYPRE_Int ndim = hypre_CommStencilNDim(comm_stencil); + HYPRE_Int *mgrow = hypre_CommStencilMGrow(comm_stencil); + HYPRE_Int *pgrow = hypre_CommStencilPGrow(comm_stencil); + HYPRE_Int d; + + num_ghost = hypre_CTAlloc(HYPRE_Int, 2 * ndim, HYPRE_MEMORY_HOST); + + for (d = 0; d < ndim; d++) + { + num_ghost[2 * d] = mgrow[d]; + num_ghost[2 * d + 1] = pgrow[d]; + } + + *num_ghost_ptr = num_ghost; + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- * Note that send_coords, recv_coords, send_dirs, recv_dirs may be NULL to * represent an identity transform. @@ -26,7 +145,7 @@ hypre_CommInfoCreate( hypre_BoxArrayArray *send_boxes, { hypre_CommInfo *comm_info; - comm_info = hypre_TAlloc(hypre_CommInfo, 1, HYPRE_MEMORY_HOST); + comm_info = hypre_TAlloc(hypre_CommInfo, 1, HYPRE_MEMORY_HOST); hypre_CommInfoNDim(comm_info) = hypre_BoxArrayArrayNDim(send_boxes); hypre_CommInfoSendBoxes(comm_info) = send_boxes; @@ -97,10 +216,8 @@ hypre_CommInfoProjectSend( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ) { - hypre_ProjectBoxArrayArray(hypre_CommInfoSendBoxes(comm_info), - index, stride); - hypre_ProjectBoxArrayArray(hypre_CommInfoSendRBoxes(comm_info), - index, stride); + hypre_ProjectBoxArrayArray(hypre_CommInfoSendBoxes(comm_info), index, stride); + hypre_ProjectBoxArrayArray(hypre_CommInfoSendRBoxes(comm_info), index, stride); hypre_CopyIndex(stride, hypre_CommInfoSendStride(comm_info)); return hypre_error_flag; @@ -114,15 +231,97 @@ hypre_CommInfoProjectRecv( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ) { - hypre_ProjectBoxArrayArray(hypre_CommInfoRecvBoxes(comm_info), - index, stride); - hypre_ProjectBoxArrayArray(hypre_CommInfoRecvRBoxes(comm_info), - index, stride); + hypre_ProjectBoxArrayArray(hypre_CommInfoRecvBoxes(comm_info), index, stride); + hypre_ProjectBoxArrayArray(hypre_CommInfoRecvRBoxes(comm_info), index, stride); hypre_CopyIndex(stride, hypre_CommInfoRecvStride(comm_info)); return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommInfoCoarsenSend( hypre_CommInfo *comm_info, + hypre_Index index, + hypre_Index stride ) +{ + hypre_CoarsenBoxArrayArray(hypre_CommInfoSendBoxes(comm_info), index, stride); + hypre_CoarsenBoxArrayArray(hypre_CommInfoSendRBoxes(comm_info), index, stride); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommInfoCoarsenRecv( hypre_CommInfo *comm_info, + hypre_Index index, + hypre_Index stride ) +{ + hypre_CoarsenBoxArrayArray(hypre_CommInfoRecvBoxes(comm_info), index, stride); + hypre_CoarsenBoxArrayArray(hypre_CommInfoRecvRBoxes(comm_info), index, stride); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommInfoRefineSend( hypre_CommInfo *comm_info, + hypre_Index index, + hypre_Index stride ) +{ + hypre_RefineBoxArrayArray(hypre_CommInfoSendBoxes(comm_info), index, stride); + hypre_RefineBoxArrayArray(hypre_CommInfoSendRBoxes(comm_info), index, stride); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommInfoRefineRecv( hypre_CommInfo *comm_info, + hypre_Index index, + hypre_Index stride ) +{ + hypre_RefineBoxArrayArray(hypre_CommInfoRecvBoxes(comm_info), index, stride); + hypre_RefineBoxArrayArray(hypre_CommInfoRecvRBoxes(comm_info), index, stride); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommInfoCoarsen( hypre_CommInfo *comm_info, + hypre_Index index, + hypre_Index stride ) +{ + hypre_CommInfoCoarsenSend(comm_info, index, stride); + hypre_CommInfoCoarsenRecv(comm_info, index, stride); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommInfoRefine( hypre_CommInfo *comm_info, + hypre_Index index, + hypre_Index stride ) +{ + hypre_CommInfoRefineSend(comm_info, index, stride); + hypre_CommInfoRefineRecv(comm_info, index, stride); + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -202,28 +401,181 @@ hypre_CommInfoDestroy( hypre_CommInfo *comm_info ) } /*-------------------------------------------------------------------------- - * NEW version that uses the box manager to find neighbors boxes. - * AHB 9/06 + * Clone a CommInfo structure. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommInfoClone( hypre_CommInfo *comm_info, + hypre_CommInfo **clone_ptr ) +{ + hypre_CommInfo *clone; + hypre_BoxArrayArray *comm_boxes, *clone_boxes; + hypre_IndexRef comm_stride, clone_stride; + HYPRE_Int **comm_processes, **clone_processes; + HYPRE_Int **comm_rboxnums, **clone_rboxnums; + hypre_BoxArrayArray *comm_rboxes, *clone_rboxes; + HYPRE_Int **comm_transforms, **clone_transforms; + hypre_Index *comm_coords, *clone_coords; + hypre_Index *comm_dirs, *clone_dirs; + HYPRE_Int i, j, k, size_aa, size_a, num_transforms; + + clone = hypre_TAlloc(hypre_CommInfo, 1, HYPRE_MEMORY_HOST); + + /* ndim */ + hypre_CommInfoNDim(clone) = hypre_CommInfoNDim(comm_info); + + for (k = 0; k < 2; k++) + { + switch (k) + { + case 0: /* Clone send info */ + comm_boxes = hypre_CommInfoSendBoxes(comm_info); + comm_stride = hypre_CommInfoSendStride(comm_info); + clone_stride = hypre_CommInfoSendStride(clone); /* Needs to be here, not below */ + comm_processes = hypre_CommInfoSendProcesses(comm_info); + comm_rboxnums = hypre_CommInfoSendRBoxnums(comm_info); + comm_rboxes = hypre_CommInfoSendRBoxes(comm_info); + comm_transforms = hypre_CommInfoSendTransforms(comm_info); + break; + + case 1: /* Clone recv info */ + comm_boxes = hypre_CommInfoRecvBoxes(comm_info); + comm_stride = hypre_CommInfoRecvStride(comm_info); + clone_stride = hypre_CommInfoRecvStride(clone); /* Needs to be here, not below */ + comm_processes = hypre_CommInfoRecvProcesses(comm_info); + comm_rboxnums = hypre_CommInfoRecvRBoxnums(comm_info); + comm_rboxes = hypre_CommInfoRecvRBoxes(comm_info); + comm_transforms = hypre_CommInfoRecvTransforms(comm_info); + break; + } + + size_aa = hypre_BoxArrayArraySize(comm_boxes); + clone_boxes = hypre_BoxArrayArrayClone(comm_boxes); + hypre_CopyIndex(comm_stride, clone_stride); + { + clone_processes = hypre_CTAlloc(HYPRE_Int *, size_aa, HYPRE_MEMORY_HOST); + for (i = 0; i < size_aa; i++) + { + size_a = hypre_BoxArraySize(hypre_BoxArrayArrayBoxArray(comm_boxes, i)); + clone_processes[i] = hypre_CTAlloc(HYPRE_Int, size_a, HYPRE_MEMORY_HOST); + for (j = 0; j < size_a; j++) + { + clone_processes[i][j] = comm_processes[i][j]; + } + } + } + clone_rboxnums = NULL; + if (comm_rboxnums != NULL) + { + clone_rboxnums = hypre_CTAlloc(HYPRE_Int *, size_aa, HYPRE_MEMORY_HOST); + for (i = 0; i < size_aa; i++) + { + size_a = hypre_BoxArraySize(hypre_BoxArrayArrayBoxArray(comm_boxes, i)); + clone_rboxnums[i] = hypre_CTAlloc(HYPRE_Int, size_a, HYPRE_MEMORY_HOST); + for (j = 0; j < size_a; j++) + { + clone_rboxnums[i][j] = comm_rboxnums[i][j]; + } + } + } + clone_rboxes = hypre_BoxArrayArrayClone(comm_rboxes); + clone_transforms = NULL; + if (comm_transforms != NULL) + { + clone_transforms = hypre_CTAlloc(HYPRE_Int *, size_aa, HYPRE_MEMORY_HOST); + for (i = 0; i < size_aa; i++) + { + size_a = hypre_BoxArraySize(hypre_BoxArrayArrayBoxArray(comm_boxes, i)); + clone_transforms[i] = hypre_CTAlloc(HYPRE_Int, size_a, HYPRE_MEMORY_HOST); + for (j = 0; j < size_a; j++) + { + clone_transforms[i][j] = comm_transforms[i][j]; + } + } + } + + switch (k) + { + case 0: /* Clone send info */ + hypre_CommInfoSendBoxes(clone) = clone_boxes; + hypre_CommInfoSendProcesses(clone) = clone_processes; + hypre_CommInfoSendRBoxnums(clone) = clone_rboxnums; + hypre_CommInfoSendRBoxes(clone) = clone_rboxes; + hypre_CommInfoSendTransforms(clone) = clone_transforms; + break; + + case 1: /* Clone recv info */ + hypre_CommInfoRecvBoxes(clone) = clone_boxes; + hypre_CommInfoRecvProcesses(clone) = clone_processes; + hypre_CommInfoRecvRBoxnums(clone) = clone_rboxnums; + hypre_CommInfoRecvRBoxes(clone) = clone_rboxes; + hypre_CommInfoRecvTransforms(clone) = clone_transforms; + break; + } + } + + num_transforms = hypre_CommInfoNumTransforms(comm_info); + comm_coords = hypre_CommInfoCoords(comm_info); + comm_dirs = hypre_CommInfoDirs(comm_info); + clone_coords = NULL; + clone_dirs = NULL; + if (num_transforms > 0) + { + clone_coords = hypre_CTAlloc(hypre_Index, num_transforms, HYPRE_MEMORY_HOST); + clone_dirs = hypre_CTAlloc(hypre_Index, num_transforms, HYPRE_MEMORY_HOST); + for (i = 0; i < num_transforms; i++) + { + hypre_CopyIndex(comm_coords[i], clone_coords[i]); + hypre_CopyIndex(comm_dirs[i], clone_dirs[i]); + } + } + hypre_CommInfoNumTransforms(clone) = num_transforms; + hypre_CommInfoCoords(clone) = clone_coords; + hypre_CommInfoDirs(clone) = clone_dirs; + + hypre_CommInfoBoxesMatch(clone) = hypre_CommInfoBoxesMatch(comm_info); + + *clone_ptr = clone; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Return descriptions of communications patterns for a given grid-stencil + * computation. These patterns are defined by intersecting the data + * dependencies of each grid box (including data dependencies within the box) + * with its neighbor boxes. + * + * An inconsistent ordering of the boxes in the send/recv data regions is + * returned. That is, the ordering of the boxes on process p for receives from + * process q is not guaranteed to be the same as the ordering of the boxes on + * process q for sends to process p. * - * Return descriptions of communications patterns for a given - * grid-stencil computation. These patterns are defined by - * intersecting the data dependencies of each box (including data - * dependencies within the box) with its neighbor boxes. + * The grid is defined by the triple (bgrid, origin, stride) where bgrid is a + * base grid coarsened by origin and stride. For now, the origin is assumed to + * be the zero origin. * - * An inconsistent ordering of the boxes in the send/recv data regions - * is returned. That is, the ordering of the boxes on process p for - * receives from process q is not guaranteed to be the same as the - * ordering of the boxes on process q for sends to process p. + * The comm_info structure is set up in terms of the box numbering in bgrid, + * even if a coarsened box is empty and does not participate in the computation. + * The main reason for doing this is because we need to use the box manager to + * get box number information for neighbors, and that is associated with bgrid. + * The overhead in the rest of the code for looping over these empty boxes is + * extremely small. * - * The routine uses a grow-the-box-and-intersect-with-neighbors style - * algorithm. + * The routine works on the index space for bgrid by using (origin, stride) to + * adjust bgrid box growth and ensure that box extents line up with the grid. + * The resulting comm_info is given on the index space for the grid. Note that + * the period of a periodic dimension must be evenly divisible by the stride in + * that dimension, so it is okay to adjust boxes before shifting by the period. + * + * The routine uses a grow-the-box-and-intersect-with-neighbors style algorithm. * * 1. The basic algorithm: * - * The basic algorithm is as follows, with one additional optimization - * discussed below that helps to minimize the number of communications - * that are done with neighbors (e.g., consider a 7-pt stencil and the - * difference between doing 26 communications versus 6): + * The basic algorithm is as follows, with one additional optimization discussed + * below that helps to minimize the number of communications that are done with + * neighbors (e.g., consider a 7-pt stencil and the difference between doing 26 + * communications versus 6): * * To compute send/recv regions, do * @@ -252,53 +604,55 @@ hypre_CommInfoDestroy( hypre_CommInfo *comm_info ) * * 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. + * 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 "distance index" and + * check the corresponding entry in the comm-stencil (described next) to decide + * whether or not to use the box. * - * The "stencil grid" is a 3x3x3 grid in 3D that is built from the + * The comm-stencil consists of a 3x3x3 array 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) * { - * mark all stencil grid entries in (1,1,1) x (1+i,1+j,1+k) - * // here (1,1,1) is the "center" entry in the stencil grid + * mark all comm-stencil entries in (1,1,1) x (1+i,1+j,1+k) + * // here (1,1,1) is the "center" entry in the comm-stencil * } * - * * 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. + * 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 + * 4. Box Manager (added by AHB on 9/2006) * - * The box manager is used to determine neighbors. It is assumed - * that the grid's box manager contains sufficient neighbor - * information. + * The box manager is used to determine neighbors. It is assumed that the + * bgrid's box manager contains sufficient neighbor information. * * 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). + * 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). *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, - hypre_StructStencil *stencil, - hypre_CommInfo **comm_info_ptr ) +hypre_CreateCommInfo( hypre_StructGrid *bgrid, + hypre_Index stride, + hypre_CommStencil *comm_stencil, + hypre_CommInfo **comm_info_ptr ) { - HYPRE_Int ndim = hypre_StructGridNDim(grid); + HYPRE_Int ndim = hypre_StructGridNDim(bgrid); + hypre_Box *csbox = hypre_CommStencilBox(comm_stencil); + HYPRE_Int *csdata = hypre_CommStencilData(comm_stencil); + HYPRE_Int *mgrow = hypre_CommStencilMGrow(comm_stencil); + HYPRE_Int *pgrow = hypre_CommStencilPGrow(comm_stencil); + hypre_Index csindex; + HYPRE_Int i, j, k, d, m, s, si; hypre_BoxArrayArray *send_boxes; @@ -315,9 +669,6 @@ 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; @@ -327,10 +678,6 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, 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; @@ -354,12 +701,7 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, 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; + HYPRE_Int num_periods, loc, box_id, id, proc_id, myid; MPI_Comm comm; @@ -367,79 +709,15 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, * Initializations *------------------------------------------------------*/ - hypre_SetIndex(ilower, 0); - hypre_SetIndex(iupper, 0); - hypre_SetIndex(istart, 0); - hypre_SetIndex(istop, 0); - hypre_SetIndex(sgindex, 0); - - local_boxes = hypre_StructGridBoxes(grid); + local_boxes = hypre_StructGridBoxes(bgrid); num_boxes = hypre_BoxArraySize(local_boxes); - num_periods = hypre_StructGridNumPeriods(grid); + num_periods = hypre_StructGridNumPeriods(bgrid); - boxman = hypre_StructGridBoxMan(grid); - comm = hypre_StructGridComm(grid); + boxman = hypre_StructGridBoxMan(bgrid); + comm = hypre_StructGridComm(bgrid); hypre_MPI_Comm_rank(comm, &myid); - stencil_box = hypre_BoxCreate(ndim); - hypre_SetIndex(hypre_BoxIMin(stencil_box), 0); - hypre_SetIndex(hypre_BoxIMax(stencil_box), 2); - - /* Set initial values to zero */ - stencil_grid = hypre_CTAlloc(HYPRE_Int, hypre_BoxVolume(stencil_box), HYPRE_MEMORY_HOST); - - sbox = hypre_BoxCreate(ndim); - hypre_SetIndex(stride, 1); - - /*------------------------------------------------------ - * Compute the "grow" information from the stencil - *------------------------------------------------------*/ - - stencil_shape = hypre_StructStencilShape(stencil); - - for (d = 0; d < ndim; d++) - { - grow[d][0] = 0; - grow[d][1] = 0; - } - - for (s = 0; s < hypre_StructStencilSize(stencil); s++) - { - stencil_offset = stencil_shape[s]; - - for (d = 0; d < ndim; d++) - { - m = stencil_offset[d]; - - istart[d] = 1; - istop[d] = 1; - - if (m < 0) - { - istart[d] = 0; - grow[d][0] = hypre_max(grow[d][0], -m); - } - else if (m > 0) - { - istop[d] = 2; - grow[d][1] = hypre_max(grow[d][1], m); - } - } - - /* update stencil grid from the grow_stencil */ - hypre_BoxSetExtents(sbox, istart, istop); - start = hypre_BoxIMin(sbox); - hypre_BoxGetSize(sbox, loop_size); - - hypre_SerialBoxLoop1Begin(ndim, loop_size, - stencil_box, start, stride, si); - { - stencil_grid[si] = 1; - } - hypre_SerialBoxLoop1End(si); - } - /*------------------------------------------------------ * Compute send/recv boxes and procs for each local box *------------------------------------------------------*/ @@ -448,37 +726,37 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, send_boxes = hypre_BoxArrayArrayCreate(num_boxes, ndim); recv_boxes = hypre_BoxArrayArrayCreate(num_boxes, ndim); - send_procs = hypre_CTAlloc(HYPRE_Int *, num_boxes, HYPRE_MEMORY_HOST); - recv_procs = hypre_CTAlloc(HYPRE_Int *, num_boxes, HYPRE_MEMORY_HOST); + send_procs = hypre_CTAlloc(HYPRE_Int *, num_boxes, HYPRE_MEMORY_HOST); + recv_procs = hypre_CTAlloc(HYPRE_Int *, num_boxes, HYPRE_MEMORY_HOST); /* Remote boxnums and boxes describe data on the opposing processor, so some shifting of boxes is needed below for periodic neighbor boxes. Remote box info is also needed for receives to allow for reverse communication. */ - send_rboxnums = hypre_CTAlloc(HYPRE_Int *, num_boxes, HYPRE_MEMORY_HOST); + send_rboxnums = hypre_CTAlloc(HYPRE_Int *, num_boxes, HYPRE_MEMORY_HOST); send_rboxes = hypre_BoxArrayArrayCreate(num_boxes, ndim); - recv_rboxnums = hypre_CTAlloc(HYPRE_Int *, num_boxes, HYPRE_MEMORY_HOST); + recv_rboxnums = hypre_CTAlloc(HYPRE_Int *, num_boxes, HYPRE_MEMORY_HOST); recv_rboxes = hypre_BoxArrayArrayCreate(num_boxes, ndim); - grow_box = hypre_BoxCreate(hypre_StructGridNDim(grid)); - extend_box = hypre_BoxCreate(hypre_StructGridNDim(grid)); - int_box = hypre_BoxCreate(hypre_StructGridNDim(grid)); - periodic_box = hypre_BoxCreate(hypre_StructGridNDim(grid)); + grow_box = hypre_BoxCreate(hypre_StructGridNDim(bgrid)); + extend_box = hypre_BoxCreate(hypre_StructGridNDim(bgrid)); + int_box = hypre_BoxCreate(hypre_StructGridNDim(bgrid)); + periodic_box = hypre_BoxCreate(hypre_StructGridNDim(bgrid)); /* 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); - neighbor_procs = hypre_CTAlloc(HYPRE_Int, neighbor_alloc, HYPRE_MEMORY_HOST); - neighbor_ids = hypre_CTAlloc(HYPRE_Int, neighbor_alloc, HYPRE_MEMORY_HOST); - neighbor_shifts = hypre_CTAlloc(HYPRE_Int, neighbor_alloc, HYPRE_MEMORY_HOST); + neighbor_procs = hypre_CTAlloc(HYPRE_Int, neighbor_alloc, HYPRE_MEMORY_HOST); + neighbor_ids = hypre_CTAlloc(HYPRE_Int, neighbor_alloc, HYPRE_MEMORY_HOST); + neighbor_shifts = hypre_CTAlloc(HYPRE_Int, neighbor_alloc, HYPRE_MEMORY_HOST); /* storage we will use to collect all of the intersected boxes (the send and recv regions for box i (this may not be enough in the case of periodic boxes, so we will have to check) */ cbox_alloc = hypre_BoxManNEntries(boxman); - cboxes_neighbor_location = hypre_CTAlloc(HYPRE_Int, cbox_alloc, HYPRE_MEMORY_HOST); - cboxes = hypre_CTAlloc(hypre_Box *, cbox_alloc, HYPRE_MEMORY_HOST); - cboxes_mem = hypre_CTAlloc(hypre_Box, cbox_alloc, HYPRE_MEMORY_HOST); + cboxes_neighbor_location = hypre_CTAlloc(HYPRE_Int, cbox_alloc, HYPRE_MEMORY_HOST); + cboxes = hypre_CTAlloc(hypre_Box *, cbox_alloc, HYPRE_MEMORY_HOST); + cboxes_mem = hypre_CTAlloc(hypre_Box, cbox_alloc, HYPRE_MEMORY_HOST); /******* loop through each local box **************/ @@ -488,30 +766,40 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, box = hypre_BoxArrayBox(local_boxes, i); box_id = i; - /* grow box local i according to the stencil*/ + /* grow_box - grow the local box according to the stencil */ hypre_CopyBox(box, grow_box); + hypre_ProjectBox(grow_box, NULL, stride); /* ensure box extents line up with the grid */ + /* check for an empty grid box (coarsened or projected bgrid box) */ + if (hypre_BoxVolume(grow_box) == 0) + { + /* skip the rest of this loop - no communication needed for this box */ + continue; + } for (d = 0; d < ndim; d++) { - hypre_BoxIMinD(grow_box, d) -= grow[d][0]; - hypre_BoxIMaxD(grow_box, d) += grow[d][1]; + /* adjust growth by stride */ + hypre_BoxIMinD(grow_box, d) -= stride[d] * mgrow[d]; + hypre_BoxIMaxD(grow_box, d) += stride[d] * pgrow[d]; } /* extend_box - to find the list of potential neighbors, we need to grow the local box a bit differently in case, for example, the stencil grows in one dimension [0] and not the other [1] */ hypre_CopyBox(box, extend_box); + hypre_ProjectBox(extend_box, NULL, stride); /* ensure box extents line up with the grid */ 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]); + /* adjust growth by stride */ + hypre_BoxIMinD(extend_box, d) -= stride[d] * hypre_max(mgrow[d], pgrow[d]); + hypre_BoxIMaxD(extend_box, d) += stride[d] * hypre_max(mgrow[d], pgrow[d]); } /*------------------------------------------------ * Determine the neighbors of box i *------------------------------------------------*/ - /* Do this by intersecting the extend box with the BoxManager. - We must also check for periodic neighbors. */ + /* Do this by intersecting the extend box with the BoxManager, and also + check for periodic neighbors */ neighbor_count = 0; hypre_BoxArraySetSize(neighbor_boxes, 0); @@ -519,12 +807,11 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, for (k = 0; k < num_periods; k++) { hypre_CopyBox(extend_box, periodic_box); - pshift = hypre_StructGridPShift(grid, k); + pshift = hypre_StructGridPShift(bgrid, k); hypre_BoxShiftPos(periodic_box, pshift); /* get the intersections */ - hypre_BoxManIntersect(boxman, hypre_BoxIMin(periodic_box), - hypre_BoxIMax(periodic_box), + 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? @@ -534,11 +821,12 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, if (neighbor_count + num_entries > neighbor_alloc) { neighbor_alloc = neighbor_count + num_entries + 5; - 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_alloc, HYPRE_MEMORY_HOST); + 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_alloc, HYPRE_MEMORY_HOST); } /* check storage for the array */ hypre_BoxArraySetSize(neighbor_boxes, neighbor_count + num_entries); @@ -558,13 +846,20 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, } hypre_BoxManEntryGetExtents(entry, ilower, iupper); - hypre_BoxSetExtents(hypre_BoxArrayBox(neighbor_boxes, neighbor_count), - ilower, iupper); + hood_box = hypre_BoxArrayBox(neighbor_boxes, neighbor_count); + hypre_BoxSetExtents(hood_box, ilower, iupper); /* shift the periodic boxes (needs to be the opposite of above) */ if (k) { - hypre_BoxShiftNeg( - hypre_BoxArrayBox(neighbor_boxes, neighbor_count), pshift); + hypre_BoxShiftNeg(hood_box, pshift); + } + + hypre_ProjectBox(hood_box, NULL, stride); /* ensure box extents line up with the grid */ + /* check for an empty hood_box */ + if (hypre_BoxVolume(hood_box) == 0) + { + /* don't keep this hood_box - no communication needed with it */ + continue; } neighbor_procs[neighbor_count] = proc_id; @@ -597,9 +892,9 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, { cbox_alloc = neighbor_count; 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); + 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); } /* Loop through each neighbor box. If the neighbor box intersects the @@ -612,27 +907,27 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, for (k = 0; k < neighbor_count; k++) { hood_box = hypre_BoxArrayBox(neighbor_boxes, k); - /* check the stencil grid to see if it makes sense to intersect */ + /* check the comm stencil to see if it makes sense to intersect */ for (d = 0; d < ndim; d++) { - sgindex[d] = 1; + csindex[d] = 1; s = hypre_BoxIMinD(hood_box, d) - hypre_BoxIMaxD(box, d); if (s > 0) { - sgindex[d] = 2; + csindex[d] = 2; } s = hypre_BoxIMinD(box, d) - hypre_BoxIMaxD(hood_box, d); if (s > 0) { - sgindex[d] = 0; + csindex[d] = 0; } } /* it makes sense only if we have at least one non-zero entry */ - si = hypre_BoxIndexRank(stencil_box, sgindex); - if (stencil_grid[si]) + si = hypre_BoxIndexRank(csbox, csindex); + if (csdata[si]) { - /* intersect - result is int_box */ + /* intersect - result is int_box - don't need to project hood_box */ hypre_IntersectBoxes(grow_box, hood_box, int_box); /* if we have a positive volume box, this is a recv region */ if (hypre_BoxVolume(int_box)) @@ -647,11 +942,11 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, } } /* end of loop through each neighbor */ - /* create recv_box_array and recv_procs for box i */ + /* create recv_box_array and recv_procs for box i - coarsen comm boxes here */ recv_box_array = hypre_BoxArrayArrayBoxArray(recv_boxes, i); hypre_BoxArraySetSize(recv_box_array, num_cboxes); - recv_procs[i] = hypre_CTAlloc(HYPRE_Int, num_cboxes, HYPRE_MEMORY_HOST); - recv_rboxnums[i] = hypre_CTAlloc(HYPRE_Int, num_cboxes, HYPRE_MEMORY_HOST); + recv_procs[i] = hypre_CTAlloc(HYPRE_Int, num_cboxes, HYPRE_MEMORY_HOST); + recv_rboxnums[i] = hypre_CTAlloc(HYPRE_Int, num_cboxes, HYPRE_MEMORY_HOST); recv_rbox_array = hypre_BoxArrayArrayBoxArray(recv_rboxes, i); hypre_BoxArraySetSize(recv_rbox_array, num_cboxes); @@ -661,14 +956,16 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, recv_procs[i][m] = neighbor_procs[loc]; recv_rboxnums[i][m] = neighbor_ids[loc]; hypre_CopyBox(cboxes[m], hypre_BoxArrayBox(recv_box_array, m)); + hypre_CoarsenBox(hypre_BoxArrayBox(recv_box_array, m), NULL, stride); /* if periodic, positive shift before copying to the rbox_array */ if (neighbor_shifts[loc]) /* periodic if shift != 0 */ { - pshift = hypre_StructGridPShift(grid, neighbor_shifts[loc]); + pshift = hypre_StructGridPShift(bgrid, neighbor_shifts[loc]); hypre_BoxShiftPos(cboxes[m], pshift); } hypre_CopyBox(cboxes[m], hypre_BoxArrayBox(recv_rbox_array, m)); + hypre_CoarsenBox(hypre_BoxArrayBox(recv_rbox_array, m), NULL, stride); cboxes[m] = NULL; } @@ -686,33 +983,36 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, for (k = 0; k < neighbor_count; k++) { hood_box = hypre_BoxArrayBox(neighbor_boxes, k); - /* check the stencil grid to see if it makes sense to intersect */ + /* check the comm stencil to see if it makes sense to intersect */ for (d = 0; d < ndim; d++) { - sgindex[d] = 1; + csindex[d] = 1; s = hypre_BoxIMinD(box, d) - hypre_BoxIMaxD(hood_box, d); if (s > 0) { - sgindex[d] = 2; + csindex[d] = 2; } s = hypre_BoxIMinD(hood_box, d) - hypre_BoxIMaxD(box, d); if (s > 0) { - sgindex[d] = 0; + csindex[d] = 0; } } /* it makes sense only if we have at least one non-zero entry */ - si = hypre_BoxIndexRank(stencil_box, sgindex); - if (stencil_grid[si]) + si = hypre_BoxIndexRank(csbox, csindex); + if (csdata[si]) { /* grow the neighbor box and intersect */ hypre_CopyBox(hood_box, grow_box); + hypre_ProjectBox(grow_box, NULL, stride); /* ensure box extents line up with the grid */ for (d = 0; d < ndim; d++) { - hypre_BoxIMinD(grow_box, d) -= grow[d][0]; - hypre_BoxIMaxD(grow_box, d) += grow[d][1]; + /* adjust growth by stride */ + hypre_BoxIMinD(grow_box, d) -= stride[d] * mgrow[d]; + hypre_BoxIMaxD(grow_box, d) += stride[d] * pgrow[d]; } + /* intersect - result is int_box - don't need to project box */ hypre_IntersectBoxes(box, grow_box, int_box); /* if we have a positive volume box, this is a send region */ if (hypre_BoxVolume(int_box)) @@ -727,11 +1027,11 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, } }/* end of loop through neighbors */ - /* create send_box_array and send_procs for box i */ + /* create send_box_array and send_procs for box i - coarsen comm boxes here */ send_box_array = hypre_BoxArrayArrayBoxArray(send_boxes, i); hypre_BoxArraySetSize(send_box_array, num_cboxes); - send_procs[i] = hypre_CTAlloc(HYPRE_Int, num_cboxes, HYPRE_MEMORY_HOST); - send_rboxnums[i] = hypre_CTAlloc(HYPRE_Int, num_cboxes, HYPRE_MEMORY_HOST); + send_procs[i] = hypre_CTAlloc(HYPRE_Int, num_cboxes, HYPRE_MEMORY_HOST); + send_rboxnums[i] = hypre_CTAlloc(HYPRE_Int, num_cboxes, HYPRE_MEMORY_HOST); send_rbox_array = hypre_BoxArrayArrayBoxArray(send_rboxes, i); hypre_BoxArraySetSize(send_rbox_array, num_cboxes); @@ -741,14 +1041,16 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, send_procs[i][m] = neighbor_procs[loc]; send_rboxnums[i][m] = neighbor_ids[loc]; hypre_CopyBox(cboxes[m], hypre_BoxArrayBox(send_box_array, m)); + hypre_CoarsenBox(hypre_BoxArrayBox(send_box_array, m), NULL, stride); /* if periodic, positive shift before copying to the rbox_array */ if (neighbor_shifts[loc]) /* periodic if shift != 0 */ { - pshift = hypre_StructGridPShift(grid, neighbor_shifts[loc]); + pshift = hypre_StructGridPShift(bgrid, neighbor_shifts[loc]); hypre_BoxShiftPos(cboxes[m], pshift); } hypre_CopyBox(cboxes[m], hypre_BoxArrayBox(send_rbox_array, m)); + hypre_CoarsenBox(hypre_BoxArrayBox(send_rbox_array, m), NULL, stride); cboxes[m] = NULL; } @@ -769,10 +1071,6 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, hypre_BoxDestroy(periodic_box); hypre_BoxDestroy(extend_box); - hypre_BoxDestroy(stencil_box); - hypre_BoxDestroy(sbox); - hypre_TFree(stencil_grid, HYPRE_MEMORY_HOST); - /*------------------------------------------------------ * Return *------------------------------------------------------*/ @@ -785,60 +1083,72 @@ hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, } /*-------------------------------------------------------------------------- - * Return descriptions of communications patterns for a given grid - * based on a specified number of "ghost zones". These patterns are - * defined by building a stencil and calling CommInfoFromStencil. + * Return communication-pattern descriptions for a grid-stencil computation. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, + hypre_Index stride, + hypre_StructStencil *stencil, + hypre_CommInfo **comm_info_ptr ) +{ + HYPRE_Int ndim = hypre_StructGridNDim(grid); + hypre_Index *stencil_shape = hypre_StructStencilShape(stencil); + hypre_IndexRef stencil_offset; + hypre_CommStencil *comm_stencil; + HYPRE_Int s; + + /* Set up the comm-stencil */ + comm_stencil = hypre_CommStencilCreate(ndim); + for (s = 0; s < hypre_StructStencilSize(stencil); s++) + { + stencil_offset = stencil_shape[s]; + hypre_CommStencilSetEntry(comm_stencil, stencil_offset); + } + + hypre_CreateCommInfo(grid, stride, comm_stencil, comm_info_ptr ); + hypre_CommStencilDestroy(comm_stencil); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Return communication-pattern descriptions for a given grid based on a + * specified number of "ghost zones". *--------------------------------------------------------------------------*/ HYPRE_Int hypre_CreateCommInfoFromNumGhost( hypre_StructGrid *grid, + hypre_Index stride, HYPRE_Int *num_ghost, hypre_CommInfo **comm_info_ptr ) { - HYPRE_Int ndim = hypre_StructGridNDim(grid); - hypre_StructStencil *stencil; - hypre_Index *stencil_shape; - hypre_Box *box; - hypre_Index ii, loop_size; - hypre_IndexRef start; - HYPRE_Int i, d, size; - - 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_Int ndim = hypre_StructGridNDim(grid); + hypre_CommStencil *comm_stencil; + hypre_Box *csbox; + HYPRE_Int *csdata; + HYPRE_Int *mgrow; + HYPRE_Int *pgrow; + HYPRE_Int d, ii; + + /* Set up the comm-stencil */ + comm_stencil = hypre_CommStencilCreate(ndim); + csbox = hypre_CommStencilBox(comm_stencil); + csdata = hypre_CommStencilData(comm_stencil); + mgrow = hypre_CommStencilMGrow(comm_stencil); + pgrow = hypre_CommStencilPGrow(comm_stencil); + for (ii = 0; ii < hypre_BoxVolume(csbox); ii++) { - hypre_BoxIMinD(box, d) = -(num_ghost[2 * d] ? 1 : 0); - hypre_BoxIMaxD(box, d) = (num_ghost[2 * d + 1] ? 1 : 0); + csdata[ii] = 1; } - - size = 0; - start = hypre_BoxIMin(box); - hypre_BoxGetSize(box, loop_size); - hypre_SerialBoxLoop0Begin(ndim, loop_size); + for (d = 0; d < ndim; d++) { - zypre_BoxLoopGetIndex(ii); - for (d = 0; d < ndim; d++) - { - i = ii[d] + start[d]; - if (i < 0) - { - stencil_shape[size][d] = -num_ghost[2 * d]; - } - else if (i > 0) - { - stencil_shape[size][d] = num_ghost[2 * d + 1]; - } - } - size++; + mgrow[d] = num_ghost[2 * d]; + pgrow[d] = num_ghost[2 * d + 1]; } - hypre_SerialBoxLoop0End(); - - hypre_BoxDestroy(box); - stencil = hypre_StructStencilCreate(ndim, size, stencil_shape); - hypre_CreateCommInfoFromStencil(grid, stencil, comm_info_ptr); - hypre_StructStencilDestroy(stencil); + hypre_CreateCommInfo(grid, stride, comm_stencil, comm_info_ptr); + hypre_CommStencilDestroy(comm_stencil); return hypre_error_flag; } @@ -918,8 +1228,9 @@ hypre_CreateCommInfoFromGrids( hypre_StructGrid *from_grid, &remote_all_boxnums); comm_boxes = hypre_BoxArrayArrayCreate(hypre_BoxArraySize(local_boxes), ndim); - comm_procs = hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(local_boxes), HYPRE_MEMORY_HOST); - comm_boxnums = hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(local_boxes), HYPRE_MEMORY_HOST); + comm_procs = hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(local_boxes), HYPRE_MEMORY_HOST); + comm_boxnums = hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(local_boxes), + HYPRE_MEMORY_HOST); comm_box = hypre_BoxCreate(ndim); hypre_ForBoxI(i, local_boxes) @@ -928,9 +1239,9 @@ hypre_CreateCommInfoFromGrids( hypre_StructGrid *from_grid, comm_box_array = hypre_BoxArrayArrayBoxArray(comm_boxes, i); comm_procs[i] = - hypre_CTAlloc(HYPRE_Int, hypre_BoxArraySize(remote_all_boxes), HYPRE_MEMORY_HOST); + hypre_CTAlloc(HYPRE_Int, hypre_BoxArraySize(remote_all_boxes), HYPRE_MEMORY_HOST); comm_boxnums[i] = - hypre_CTAlloc(HYPRE_Int, hypre_BoxArraySize(remote_all_boxes), HYPRE_MEMORY_HOST); + hypre_CTAlloc(HYPRE_Int, hypre_BoxArraySize(remote_all_boxes), HYPRE_MEMORY_HOST); hypre_ForBoxI(j, remote_all_boxes) { @@ -949,10 +1260,10 @@ hypre_CreateCommInfoFromGrids( hypre_StructGrid *from_grid, comm_procs[i] = hypre_TReAlloc(comm_procs[i], - HYPRE_Int, hypre_BoxArraySize(comm_box_array), HYPRE_MEMORY_HOST); + HYPRE_Int, hypre_BoxArraySize(comm_box_array), HYPRE_MEMORY_HOST); comm_boxnums[i] = hypre_TReAlloc(comm_boxnums[i], - HYPRE_Int, hypre_BoxArraySize(comm_box_array), HYPRE_MEMORY_HOST); + HYPRE_Int, hypre_BoxArraySize(comm_box_array), HYPRE_MEMORY_HOST); } hypre_BoxDestroy(comm_box); @@ -966,14 +1277,14 @@ hypre_CreateCommInfoFromGrids( hypre_StructGrid *from_grid, send_boxes = comm_boxes; send_procs = comm_procs; send_rboxnums = comm_boxnums; - send_rboxes = hypre_BoxArrayArrayDuplicate(comm_boxes); + send_rboxes = hypre_BoxArrayArrayClone(comm_boxes); break; case 1: recv_boxes = comm_boxes; recv_procs = comm_procs; recv_rboxnums = comm_boxnums; - recv_rboxes = hypre_BoxArrayArrayDuplicate(comm_boxes); + recv_rboxes = hypre_BoxArrayArrayClone(comm_boxes); break; } } diff --git a/src/struct_mv/computation.c b/src/struct_mv/computation.c index 6677f46d4f..d5d61e0bde 100644 --- a/src/struct_mv/computation.c +++ b/src/struct_mv/computation.c @@ -93,15 +93,18 @@ hypre_ComputeInfoDestroy( hypre_ComputeInfo *compute_info ) /*-------------------------------------------------------------------------- * Return descriptions of communications and computations patterns for - * a given grid-stencil computation. If HYPRE\_OVERLAP\_COMM\_COMP is + * a given grid-stencil computation. If HYPRE_OVERLAP_COMM_COMP is * defined, then the patterns are computed to allow for overlapping * communications and computations. The default is no overlap. * * Note: This routine assumes that the grid boxes do not overlap. + * + * RDF NOTE: HYPRE_OVERLAP_COMM_COMP does not yet support arbitrary stride. *--------------------------------------------------------------------------*/ HYPRE_Int hypre_CreateComputeInfo( hypre_StructGrid *grid, + hypre_Index stride, hypre_StructStencil *stencil, hypre_ComputeInfo **compute_info_ptr ) { @@ -135,10 +138,12 @@ hypre_CreateComputeInfo( hypre_StructGrid *grid, * Get communication info *------------------------------------------------------*/ - hypre_CreateCommInfoFromStencil(grid, stencil, &comm_info); + hypre_CreateCommInfoFromStencil(grid, stride, stencil, &comm_info); #ifdef HYPRE_OVERLAP_COMM_COMP + /* RDF NOTE: This ifdef code has not yet been ported to support non-unit stride */ + /*------------------------------------------------------ * Compute border info *------------------------------------------------------*/ @@ -249,6 +254,7 @@ hypre_CreateComputeInfo( hypre_StructGrid *grid, hypre_BoxArraySetSize(cbox_array, 1); cbox = hypre_BoxArrayBox(cbox_array, 0); hypre_CopyBox(hypre_BoxArrayBox(boxes, i), cbox); + hypre_CoarsenBox(cbox, NULL, stride); } #endif @@ -271,7 +277,8 @@ hypre_CreateComputeInfo( hypre_StructGrid *grid, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_ComputePkgCreate( hypre_ComputeInfo *compute_info, +hypre_ComputePkgCreate( HYPRE_MemoryLocation memory_location, + hypre_ComputeInfo *compute_info, hypre_BoxArray *data_space, HYPRE_Int num_values, hypre_StructGrid *grid, @@ -284,19 +291,16 @@ hypre_ComputePkgCreate( hypre_ComputeInfo *compute_info, hypre_CommPkgCreate(hypre_ComputeInfoCommInfo(compute_info), data_space, data_space, num_values, NULL, 0, - hypre_StructGridComm(grid), &comm_pkg); + hypre_StructGridComm(grid), + memory_location, &comm_pkg); hypre_CommInfoDestroy(hypre_ComputeInfoCommInfo(compute_info)); hypre_ComputePkgCommPkg(compute_pkg) = comm_pkg; - hypre_ComputePkgIndtBoxes(compute_pkg) = - hypre_ComputeInfoIndtBoxes(compute_info); - hypre_ComputePkgDeptBoxes(compute_pkg) = - hypre_ComputeInfoDeptBoxes(compute_info); - hypre_CopyIndex(hypre_ComputeInfoStride(compute_info), - hypre_ComputePkgStride(compute_pkg)); + hypre_ComputePkgIndtBoxes(compute_pkg) = hypre_ComputeInfoIndtBoxes(compute_info); + hypre_ComputePkgDeptBoxes(compute_pkg) = hypre_ComputeInfoDeptBoxes(compute_info); + hypre_CopyIndex(hypre_ComputeInfoStride(compute_info), hypre_ComputePkgStride(compute_pkg)); hypre_StructGridRef(grid, &hypre_ComputePkgGrid(compute_pkg)); - hypre_ComputePkgDataSpace(compute_pkg) = data_space; hypre_ComputePkgNumValues(compute_pkg) = num_values; hypre_ComputeInfoDestroy(compute_info); @@ -341,7 +345,7 @@ hypre_InitializeIndtComputations( hypre_ComputePkg *compute_pkg, { hypre_CommPkg *comm_pkg = hypre_ComputePkgCommPkg(compute_pkg); - hypre_InitializeCommunication(comm_pkg, data, data, 0, 0, comm_handle_ptr); + hypre_StructCommunicationInitialize(comm_pkg, &data, &data, 0, 0, comm_handle_ptr); return hypre_error_flag; } @@ -354,7 +358,7 @@ hypre_InitializeIndtComputations( hypre_ComputePkg *compute_pkg, HYPRE_Int hypre_FinalizeIndtComputations( hypre_CommHandle *comm_handle ) { - hypre_FinalizeCommunication(comm_handle ); + hypre_StructCommunicationFinalize(comm_handle ); return hypre_error_flag; } diff --git a/src/struct_mv/computation.h b/src/struct_mv/computation.h index eed2d7bd55..65993b27ad 100644 --- a/src/struct_mv/computation.h +++ b/src/struct_mv/computation.h @@ -42,7 +42,6 @@ typedef struct hypre_ComputePkg_struct hypre_Index stride; hypre_StructGrid *grid; - hypre_BoxArray *data_space; HYPRE_Int num_values; } hypre_ComputePkg; @@ -60,14 +59,14 @@ typedef struct hypre_ComputePkg_struct * Accessor macros: hypre_ComputePkg *--------------------------------------------------------------------------*/ -#define hypre_ComputePkgCommPkg(compute_pkg) (compute_pkg -> comm_pkg) +#define hypre_ComputePkgCommPkg(compute_pkg) (compute_pkg -> comm_pkg) +#define hypre_ComputePkgMemoryLocation(compute_pkg) (compute_pkg -> comm_pkg -> memory_location) -#define hypre_ComputePkgIndtBoxes(compute_pkg) (compute_pkg -> indt_boxes) -#define hypre_ComputePkgDeptBoxes(compute_pkg) (compute_pkg -> dept_boxes) -#define hypre_ComputePkgStride(compute_pkg) (compute_pkg -> stride) +#define hypre_ComputePkgIndtBoxes(compute_pkg) (compute_pkg -> indt_boxes) +#define hypre_ComputePkgDeptBoxes(compute_pkg) (compute_pkg -> dept_boxes) +#define hypre_ComputePkgStride(compute_pkg) (compute_pkg -> stride) -#define hypre_ComputePkgGrid(compute_pkg) (compute_pkg -> grid) -#define hypre_ComputePkgDataSpace(compute_pkg) (compute_pkg -> data_space) -#define hypre_ComputePkgNumValues(compute_pkg) (compute_pkg -> num_values) +#define hypre_ComputePkgGrid(compute_pkg) (compute_pkg -> grid) +#define hypre_ComputePkgNumValues(compute_pkg) (compute_pkg -> num_values) #endif diff --git a/src/struct_mv/headers b/src/struct_mv/headers index 0e3b688fbd..6a6e4cb97e 100755 --- a/src/struct_mv/headers +++ b/src/struct_mv/headers @@ -25,6 +25,10 @@ cat > $INTERNAL_HEADER <<@ #include "HYPRE_struct_mv.h" #include "_hypre_utilities.h" +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_struct_mv_mup_def.h" +#endif + @ cat >> $INTERNAL_HEADER <<@ @@ -38,19 +42,24 @@ extern "C" { #=========================================================================== cat box.h >> $INTERNAL_HEADER +cat box_ds.h >> $INTERNAL_HEADER cat assumed_part.h >> $INTERNAL_HEADER cat box_manager.h >> $INTERNAL_HEADER cat struct_grid.h >> $INTERNAL_HEADER cat struct_stencil.h >> $INTERNAL_HEADER cat struct_communication.h >> $INTERNAL_HEADER cat computation.h >> $INTERNAL_HEADER +cat struct_stmatrix.h >> $INTERNAL_HEADER cat struct_matrix.h >> $INTERNAL_HEADER cat struct_vector.h >> $INTERNAL_HEADER +cat struct_matmult.h >> $INTERNAL_HEADER cat protos.h >> $INTERNAL_HEADER +cat protos_mp.h >> $INTERNAL_HEADER #=========================================================================== # BoxLoops #=========================================================================== + cat boxloop_omp_device.h >> $INTERNAL_HEADER cat boxloop_host.h >> $INTERNAL_HEADER @@ -64,6 +73,17 @@ cat >> $INTERNAL_HEADER <<@ } #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_struct_mv_mup_undef.h" +#include "_hypre_struct_mv_mup.h" +#endif +#endif + #endif @ @@ -115,4 +135,3 @@ cat >> $INTERNAL_HEADER <<@ #endif @ - diff --git a/src/struct_mv/mup.fixed b/src/struct_mv/mup.fixed new file mode 100644 index 0000000000..90a5be739a --- /dev/null +++ b/src/struct_mv/mup.fixed @@ -0,0 +1,456 @@ +hypre_APFillResponseStructAssumedPart +hypre_APFindMyBoxesInRegions +hypre_APGetAllBoxesInRegions +hypre_APPruneRegions +hypre_APRefineRegionsByVol +hypre_APShrinkRegions +hypre_APSubdivideRegion +hypre_AddIndexes +hypre_AppendBox +hypre_AppendBoxArray +hypre_BoxArrayArrayClone +hypre_BoxArrayArrayCreate +hypre_BoxArrayArrayDestroy +hypre_BoxArrayArrayPrint +hypre_BoxArrayArrayPrintToFile +hypre_BoxArrayClone +hypre_BoxArrayCreate +hypre_BoxArrayCreateFromIndices +hypre_BoxArrayDestroy +hypre_BoxArrayInBoxArray +hypre_BoxArrayPrint +hypre_BoxArrayPrintToFile +hypre_BoxArrayReadFromFile +hypre_BoxArraySetSize +hypre_BoxArrayVolume +hypre_BoxArraysEqual +hypre_BoxBTNodeCreate +hypre_BoxBTNodeDestroy +hypre_BoxBTNodeInitialize +hypre_BoxBTNodeSetIndices +hypre_BoxBTQueueCreate +hypre_BoxBTQueueDelete +hypre_BoxBTQueueDestroy +hypre_BoxBTQueueInitialize +hypre_BoxBTQueueInsert +hypre_BoxBTStackCreate +hypre_BoxBTStackDelete +hypre_BoxBTStackDestroy +hypre_BoxBTStackInitialize +hypre_BoxBTStackInsert +hypre_BoxBinTreeCreate +hypre_BoxBinTreeDestroy +hypre_BoxBinTreeInitialize +hypre_BoxBoundaryDG +hypre_BoxBoundaryG +hypre_BoxBoundaryIntersect +hypre_BoxClone +hypre_BoxCreate +hypre_BoxDestroy +hypre_BoxGetSize +hypre_BoxGetStrideSize +hypre_BoxGetStrideVolume +hypre_BoxGrowByArray +hypre_BoxGrowByBox +hypre_BoxGrowByIndex +hypre_BoxGrowByValue +hypre_BoxInBox +hypre_BoxIndexRank +hypre_BoxInit +hypre_BoxManAddEntry +hypre_BoxManAssemble +hypre_BoxManCreate +hypre_BoxManDeleteMultipleEntriesAndInfo +hypre_BoxManDestroy +hypre_BoxManEntryCopy +hypre_BoxManEntryGetExtents +hypre_BoxManEntryGetInfo +hypre_BoxManEntryGetStride +hypre_BoxManGatherEntries +hypre_BoxManGetAllEntries +hypre_BoxManGetAllEntriesBoxes +hypre_BoxManGetAllEntriesBoxesProc +hypre_BoxManGetAllGlobalKnown +hypre_BoxManGetAssumedPartition +hypre_BoxManGetEntry +hypre_BoxManGetGlobalIsGatherCalled +hypre_BoxManGetIsEntriesSort +hypre_BoxManGetLocalEntriesBoxes +hypre_BoxManIncSize +hypre_BoxManIntersect +hypre_BoxManSetAllGlobalKnown +hypre_BoxManSetAssumedPartition +hypre_BoxManSetBoundingBox +hypre_BoxManSetIsEntriesSort +hypre_BoxManSetNumGhost +hypre_BoxMaxSize +hypre_BoxNnodes +hypre_BoxOffsetDistance +hypre_BoxPartialVolume +hypre_BoxPrint +hypre_BoxPrintDebug +hypre_BoxRankIndex +hypre_BoxRead +hypre_BoxSetExtents +hypre_BoxShiftNeg +hypre_BoxShiftPos +hypre_BoxSplit +hypre_BoxStrideVolume +hypre_BoxVolume +hypre_BoxesEqual +hypre_CoarsenBox +hypre_CoarsenBoxArray +hypre_CoarsenBoxArrayArray +hypre_CoarsenBoxArrayArrayOutward +hypre_CommBlockSetEntries +hypre_CommBlockSetEntry +hypre_CommInfoClone +hypre_CommInfoCoarsen +hypre_CommInfoCoarsenRecv +hypre_CommInfoCoarsenSend +hypre_CommInfoCreate +hypre_CommInfoDestroy +hypre_CommInfoGetTransforms +hypre_CommInfoProjectRecv +hypre_CommInfoProjectSend +hypre_CommInfoRefine +hypre_CommInfoRefineRecv +hypre_CommInfoRefineSend +hypre_CommInfoSetTransforms +hypre_CommPkgAgglomData +hypre_CommPkgAgglomDestroy +hypre_CommPkgAgglomerate +hypre_CommPkgCreate +hypre_CommPkgDestroy +hypre_CommPkgSetPrefixSizes +hypre_CommStencilCreate +hypre_CommStencilCreateNumGhost +hypre_CommStencilDestroy +hypre_CommStencilSetEntry +hypre_ComputeBoxnums +hypre_ComputeCoarseOriginStride +hypre_ComputeInfoCreate +hypre_ComputeInfoDestroy +hypre_ComputeInfoProjectComp +hypre_ComputeInfoProjectRecv +hypre_ComputeInfoProjectSend +hypre_ComputePkgCreate +hypre_ComputePkgDestroy +hypre_ConvertToCanonicalIndex +hypre_CopyBox +hypre_CopyIndex +hypre_CopyToCleanIndex +hypre_CopyToIndex +hypre_CreateCommInfo +hypre_CreateCommInfoFromGrids +hypre_CreateCommInfoFromNumGhost +hypre_CreateCommInfoFromStencil +hypre_CreateComputeInfo +hypre_DeleteBox +hypre_DeleteMultipleBoxes +hypre_ExchangeLocalData +hypre_FillResponseBoxManAssemble1 +hypre_FillResponseBoxManAssemble2 +hypre_FinalizeIndtComputations +hypre_GatherAllBoxes +hypre_GeneralBoxBoundaryIntersect +hypre_IndexElementMult +hypre_IndexEqual +hypre_IndexFromRank +hypre_IndexInBox +hypre_IndexMax +hypre_IndexMin +hypre_IndexPrint +hypre_IndexProd +hypre_IndexRead +hypre_IndexesEqual +hypre_IndexesGreater +hypre_IndexesGreaterEqual +hypre_InitializeIndtComputations +hypre_IntersectBoxes +hypre_MapToCoarseIndex +hypre_MapToFineIndex +hypre_MinUnionBoxes +hypre_PrintBoxArrayData +hypre_ProjectBox +hypre_ProjectBoxArray +hypre_ProjectBoxArrayArray +hypre_ReadBoxArrayData +hypre_RefineBox +hypre_RefineBoxArray +hypre_RefineBoxArrayArray +hypre_SetIndex +hypre_SnapIndexNeg +hypre_SnapIndexPos +hypre_StBoxRank +hypre_StCoeffClone +hypre_StCoeffCreate +hypre_StCoeffDestroy +hypre_StCoeffMult +hypre_StCoeffPrint +hypre_StCoeffPush +hypre_StCoeffShift +hypre_StIndexCopy +hypre_StIndexNegate +hypre_StIndexPrint +hypre_StIndexShift +hypre_StMatrixClone +hypre_StMatrixCreate +hypre_StMatrixDestroy +hypre_StMatrixMatmat +hypre_StMatrixMatmult +hypre_StMatrixNEntryCoeffs +hypre_StMatrixPrint +hypre_StMatrixTranspose +hypre_StTermCopy +hypre_StTermPrint +hypre_StructAssumedPartitionCreate +hypre_StructAssumedPartitionDestroy +hypre_StructAssumedPartitionGetProcsFromBox +hypre_StructAssumedPartitionGetRegionsFromProc +hypre_StructAssumedPartitionPrint +hypre_StructCoarsen +hypre_StructCoarsenAP +hypre_StructCommunicationFinalize +hypre_StructCommunicationGetBuffer +hypre_StructCommunicationInitialize +hypre_StructCommunicationReleaseBuffer +hypre_StructCopy +hypre_StructDataCopy +hypre_StructGridAssemble +hypre_StructGridComputeBoxnums +hypre_StructGridComputeGlobalSize +hypre_StructGridCreate +hypre_StructGridDestroy +hypre_StructGridGetMaxBoxSize +hypre_StructGridPrint +hypre_StructGridPrintVTK +hypre_StructGridRead +hypre_StructGridRef +hypre_StructGridSetBoundingBox +hypre_StructGridSetBoxManager +hypre_StructGridSetBoxes +hypre_StructGridSetExtents +hypre_StructGridSetIDs +hypre_StructGridSetMaxDistance +hypre_StructGridSetNumGhost +hypre_StructGridSetPeriodic +hypre_StructInnerProd +hypre_StructInnerProdLocal +hypre_StructMapCoarseToFine +hypre_StructMapFineToCoarse +hypre_StructMatmat +hypre_StructMatmatSetup +hypre_StructMatmult +hypre_StructMatmultCommSetup +hypre_StructMatmultCommunicate +hypre_StructMatmultCompute +hypre_StructMatmultCompute_core +hypre_StructMatmultCompute_core_c +hypre_StructMatmultCompute_core_cc +hypre_StructMatmultCompute_core_ccf +hypre_StructMatmultCompute_core_cf +hypre_StructMatmultCompute_core_cff +hypre_StructMatmultCompute_core_f +hypre_StructMatmultCompute_core_ff +hypre_StructMatmultCompute_core_fff +hypre_StructMatmultCompute_core_generic +hypre_StructMatmultCompute_fuse +hypre_StructMatmultCompute_fuse_c +hypre_StructMatmultCompute_fuse_cc +hypre_StructMatmultCompute_fuse_f +hypre_StructMatmultCompute_fuse_fc +hypre_StructMatmultCompute_fuse_fcc +hypre_StructMatmultCompute_fuse_ff +hypre_StructMatmultCompute_fuse_ffc +hypre_StructMatmultCompute_fuse_fff +hypre_StructMatmultCreate +hypre_StructMatmultDestroy +hypre_StructMatmultGetMatrix +hypre_StructMatmultInitialize +hypre_StructMatmultMultiply +hypre_StructMatmultSetKernelType +hypre_StructMatmultSetProduct +hypre_StructMatmultSetup +hypre_StructMatrixAddInit +hypre_StructMatrixAddMat +hypre_StructMatrixAssemble +hypre_StructMatrixClearBoundary +hypre_StructMatrixClearBoxValues +hypre_StructMatrixClearGhostValues +hypre_StructMatrixClearValues +hypre_StructMatrixComputeDataSpace +hypre_StructMatrixComputeRowSum +hypre_StructMatrixComputeRowSum_core_CC +hypre_StructMatrixComputeRowSum_core_VC +hypre_StructMatrixCreate +hypre_StructMatrixCreateCommPkg +hypre_StructMatrixCreateMask +hypre_StructMatrixDestroy +hypre_StructMatrixExtractPointerByIndex +hypre_StructMatrixForget +hypre_StructMatrixGetCStride +hypre_StructMatrixGetDataMapStride +hypre_StructMatrixGetDiagonal +hypre_StructMatrixGetFStride +hypre_StructMatrixGetStSpaces +hypre_StructMatrixGetStencilSpace +hypre_StructMatrixGetStencilStride +hypre_StructMatrixGrowDataSpace +hypre_StructMatrixInitialize +hypre_StructMatrixInitializeData +hypre_StructMatrixInitializeShell +hypre_StructMatrixMapCommInfo +hypre_StructMatrixMapDataBox +hypre_StructMatrixMapDataIndex +hypre_StructMatrixMapDataStride +hypre_StructMatrixMigrate +hypre_StructMatrixNeedResize +hypre_StructMatrixPlaceStencil +hypre_StructMatrixPrint +hypre_StructMatrixPrintData +hypre_StructMatrixPtAP +hypre_StructMatrixPtAPSetup +hypre_StructMatrixRAP +hypre_StructMatrixRAPSetup +hypre_StructMatrixRTtAP +hypre_StructMatrixRTtAPSetup +hypre_StructMatrixRead +hypre_StructMatrixReadData +hypre_StructMatrixRef +hypre_StructMatrixResize +hypre_StructMatrixRestore +hypre_StructMatrixSetBoxValues +hypre_StructMatrixSetConstantEntries +hypre_StructMatrixSetConstantValues +hypre_StructMatrixSetDomainStride +hypre_StructMatrixSetGhost +hypre_StructMatrixSetMemoryLocation +hypre_StructMatrixSetNumGhost +hypre_StructMatrixSetRangeStride +hypre_StructMatrixSetTranspose +hypre_StructMatrixSetValues +hypre_StructMatrixUnMapDataBox +hypre_StructMatrixUnMapDataIndex +hypre_StructMatrixUnMapDataStride +hypre_StructMatrixZeroDiagonal +hypre_StructMatvec +hypre_StructMatvecCompute +hypre_StructMatvecCompute_core_CC +hypre_StructMatvecCompute_core_VC +hypre_StructMatvecCompute_core_VCC +hypre_StructMatvecCreate +hypre_StructMatvecDestroy +hypre_StructMatvecResize +hypre_StructMatvecSetTranspose +hypre_StructMatvecSetup +hypre_StructMatvecT +hypre_StructNumGhostFromStencil +hypre_StructPartialCopy +hypre_StructScale +hypre_StructStencilCreate +hypre_StructStencilDestroy +hypre_StructStencilOffsetEntry +hypre_StructStencilPrint +hypre_StructStencilRead +hypre_StructStencilRef +hypre_StructStencilSymmetrize +hypre_StructVectorAssemble +hypre_StructVectorAxpy +hypre_StructVectorClearAllValues +hypre_StructVectorClearBoundGhostValues +hypre_StructVectorClearBoxValues +hypre_StructVectorClearGhostValues +hypre_StructVectorClearValues +hypre_StructVectorClone +hypre_StructVectorComputeDataSpace +hypre_StructVectorCreate +hypre_StructVectorDestroy +hypre_StructVectorForget +hypre_StructVectorGetMigrateCommPkg +hypre_StructVectorInitialize +hypre_StructVectorInitializeData +hypre_StructVectorInitializeShell +hypre_StructVectorMapCommInfo +hypre_StructVectorMapDataBox +hypre_StructVectorMapDataIndex +hypre_StructVectorMapDataStride +hypre_StructVectorMigrate +hypre_StructVectorNeedResize +hypre_StructVectorPointwiseDivision +hypre_StructVectorPointwiseDivpy +hypre_StructVectorPointwiseInverse +hypre_StructVectorPointwiseProduct +hypre_StructVectorPrint +hypre_StructVectorPrintData +hypre_StructVectorRead +hypre_StructVectorReadData +hypre_StructVectorRebase +hypre_StructVectorRef +hypre_StructVectorResize +hypre_StructVectorRestore +hypre_StructVectorScaleValues +hypre_StructVectorSetBoxValues +hypre_StructVectorSetConstantValues +hypre_StructVectorSetDataSize +hypre_StructVectorSetMemoryMode +hypre_StructVectorSetNumGhost +hypre_StructVectorSetRandomValues +hypre_StructVectorSetStride +hypre_StructVectorSetValues +hypre_StructVectorUnMapDataBox +hypre_StructVectorUnMapDataIndex +hypre_StructVectorUnMapDataStride +hypre_SubtractBoxArrays +hypre_SubtractBoxes +hypre_SubtractIndexes +hypre_UnionBoxes +hypre_destroycommpkg +hypre_doubleBoxVolume +hypre_entryqsort2 +hypre_entryswap2 +hypre_structgridassemble +hypre_structgridcreate +hypre_structgriddestroy +hypre_structgridsetextents +hypre_structgridsetnumghost +hypre_structgridsetperiodic +hypre_structmatrixaddtoboxvalues +hypre_structmatrixaddtoconstant +hypre_structmatrixaddtovalues +hypre_structmatrixassemble +hypre_structmatrixcreate +hypre_structmatrixdestroy +hypre_structmatrixgetboxvalues +hypre_structmatrixgetgrid +hypre_structmatrixinitialize +hypre_structmatrixmatvec +hypre_structmatrixprint +hypre_structmatrixsetboxvalues +hypre_structmatrixsetconstanten +hypre_structmatrixsetconstantva +hypre_structmatrixsetnumghost +hypre_structmatrixsetsymmetric +hypre_structmatrixsetvalues +hypre_structstencilcreate +hypre_structstencildestroy +hypre_structstencilsetelement +hypre_structstencilsetentry +hypre_structvectoraddtoboxvalue +hypre_structvectoraddtovalues +hypre_structvectorassemble +hypre_structvectorcopy +hypre_structvectorcreate +hypre_structvectordestroy +hypre_structvectorgetboxvalues +hypre_structvectorgetmigratecom +hypre_structvectorgetvalues +hypre_structvectorinitialize +hypre_structvectormigrate +hypre_structvectorprint +hypre_structvectorscalevalues +hypre_structvectorsetboxvalues +hypre_structvectorsetconstantva +hypre_structvectorsetnumghost +hypre_structvectorsetrandomvalu +hypre_structvectorsetvalues diff --git a/src/struct_mv/mup.functions b/src/struct_mv/mup.functions new file mode 100644 index 0000000000..da24118eb2 --- /dev/null +++ b/src/struct_mv/mup.functions @@ -0,0 +1,69 @@ +HYPRE_CommPkgDestroy +HYPRE_StructGridAssemble +HYPRE_StructGridCoarsen +HYPRE_StructGridCreate +HYPRE_StructGridDestroy +HYPRE_StructGridPrintVTK +HYPRE_StructGridProjectBox +HYPRE_StructGridSetExtents +HYPRE_StructGridSetNumGhost +HYPRE_StructGridSetPeriodic +HYPRE_StructMatrixAddToBoxValues +HYPRE_StructMatrixAddToBoxValues2 +HYPRE_StructMatrixAddToConstantValues +HYPRE_StructMatrixAddToValues +HYPRE_StructMatrixAssemble +HYPRE_StructMatrixClearBoundary +HYPRE_StructMatrixCreate +HYPRE_StructMatrixDestroy +HYPRE_StructMatrixGetBoxValues +HYPRE_StructMatrixGetBoxValues2 +HYPRE_StructMatrixGetGrid +HYPRE_StructMatrixGetValues +HYPRE_StructMatrixInitialize +HYPRE_StructMatrixMatmat +HYPRE_StructMatrixMatvec +HYPRE_StructMatrixMatvecT +HYPRE_StructMatrixPrint +HYPRE_StructMatrixRead +HYPRE_StructMatrixSetBoxValues +HYPRE_StructMatrixSetBoxValues2 +HYPRE_StructMatrixSetConstantEntries +HYPRE_StructMatrixSetConstantValues +HYPRE_StructMatrixSetDomainStride +HYPRE_StructMatrixSetNumGhost +HYPRE_StructMatrixSetRangeStride +HYPRE_StructMatrixSetSymmetric +HYPRE_StructMatrixSetTranspose +HYPRE_StructMatrixSetValues +HYPRE_StructStencilCreate +HYPRE_StructStencilDestroy +HYPRE_StructStencilSetElement +HYPRE_StructStencilSetEntry +HYPRE_StructVectorAddToBoxValues +HYPRE_StructVectorAddToBoxValues2 +HYPRE_StructVectorAddToValues +HYPRE_StructVectorAssemble +HYPRE_StructVectorAxpy +HYPRE_StructVectorClone +HYPRE_StructVectorCopy +HYPRE_StructVectorCreate +HYPRE_StructVectorDestroy +HYPRE_StructVectorGetBoxValues +HYPRE_StructVectorGetBoxValues2 +HYPRE_StructVectorGetMigrateCommPkg +HYPRE_StructVectorGetValues +HYPRE_StructVectorInitialize +HYPRE_StructVectorInnerProd +HYPRE_StructVectorMigrate +HYPRE_StructVectorPrint +HYPRE_StructVectorRead +HYPRE_StructVectorScale +HYPRE_StructVectorScaleValues +HYPRE_StructVectorSetBoxValues +HYPRE_StructVectorSetBoxValues2 +HYPRE_StructVectorSetConstantValues +HYPRE_StructVectorSetNumGhost +HYPRE_StructVectorSetRandomValues +HYPRE_StructVectorSetStride +HYPRE_StructVectorSetValues diff --git a/src/struct_mv/mup.methods b/src/struct_mv/mup.methods new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/struct_mv/mup_code b/src/struct_mv/mup_code new file mode 100755 index 0000000000..17de62b0df --- /dev/null +++ b/src/struct_mv/mup_code @@ -0,0 +1,7 @@ +#!/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) + +../config/gen_code.sh HYPRE_struct_mv.h _hypre_struct_mv.h mup diff --git a/src/struct_mv/mup_fixed.c b/src/struct_mv/mup_fixed.c new file mode 100644 index 0000000000..3476d2fb2f --- /dev/null +++ b/src/struct_mv/mup_fixed.c @@ -0,0 +1,3091 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_struct_mv.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_APFillResponseStructAssumedPart)( p_recv_contact_buf, contact_size, contact_proc, ro, comm, p_send_response_buf, response_message_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_APFindMyBoxesInRegions( hypre_BoxArray *region_array, hypre_BoxArray *my_box_array, HYPRE_Int **p_count_array, HYPRE_Real **p_vol_array ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_APFindMyBoxesInRegions)( region_array, my_box_array, p_count_array, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_APGetAllBoxesInRegions)( region_array, my_box_array, p_count_array, p_vol_array, comm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_APPruneRegions( hypre_BoxArray *region_array, HYPRE_Int **p_count_array, HYPRE_Real **p_vol_array ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_APPruneRegions)( region_array, p_count_array, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_APRefineRegionsByVol)( region_array, vol_array, max_regions, gamma, dim, return_code, comm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_APShrinkRegions( hypre_BoxArray *region_array, hypre_BoxArray *my_box_array, MPI_Comm comm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_APShrinkRegions)( region_array, my_box_array, comm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_APSubdivideRegion( hypre_Box *region, HYPRE_Int dim, HYPRE_Int level, hypre_BoxArray *box_array, HYPRE_Int *num_new_boxes ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_APSubdivideRegion)( region, dim, level, box_array, num_new_boxes ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AddIndexes( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim, hypre_Index result ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AddIndexes)( index1, index2, ndim, result ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AppendBox( hypre_Box *box, hypre_BoxArray *box_array ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AppendBox)( box, box_array ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_AppendBoxArray( hypre_BoxArray *box_array_0, hypre_BoxArray *box_array_1 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_AppendBoxArray)( box_array_0, box_array_1 ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_BoxArrayArray * +hypre_BoxArrayArrayClone( hypre_BoxArrayArray *box_array_array ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxArrayArrayClone)( box_array_array ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_BoxArrayArray * +hypre_BoxArrayArrayCreate( HYPRE_Int size, HYPRE_Int ndim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxArrayArrayCreate)( size, ndim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxArrayArrayDestroy( hypre_BoxArrayArray *box_array_array ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxArrayArrayDestroy)( box_array_array ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxArrayArrayPrint( MPI_Comm comm, const char *filename, hypre_BoxArrayArray *box_array_array ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxArrayArrayPrint)( comm, filename, box_array_array ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxArrayArrayPrintToFile( FILE *file, hypre_BoxArrayArray *box_array_array ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxArrayArrayPrintToFile)( file, box_array_array ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_BoxArray * +hypre_BoxArrayClone( hypre_BoxArray *box_array ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxArrayClone)( box_array ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_BoxArray * +hypre_BoxArrayCreate( HYPRE_Int size, HYPRE_Int ndim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxArrayCreate)( size, ndim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxArrayCreateFromIndices( HYPRE_Int ndim, HYPRE_Int num_indices_in, HYPRE_Int **indices_in, HYPRE_Real threshold, hypre_BoxArray **box_array_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxArrayCreateFromIndices)( ndim, num_indices_in, indices_in, threshold, box_array_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxArrayDestroy( hypre_BoxArray *box_array ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxArrayDestroy)( box_array ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxArrayInBoxArray( hypre_BoxArray *box_array1, hypre_BoxArray *box_array2 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxArrayInBoxArray)( box_array1, box_array2 ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxArrayPrint( MPI_Comm comm, const char *filename, hypre_BoxArray *box_array ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxArrayPrint)( comm, filename, box_array ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxArrayPrintToFile( FILE *file, hypre_BoxArray *box_array ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxArrayPrintToFile)( file, box_array ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxArrayReadFromFile( FILE *file, hypre_BoxArray **box_array_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxArrayReadFromFile)( file, box_array_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxArraySetSize( hypre_BoxArray *box_array, HYPRE_Int size ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxArraySetSize)( box_array, size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxArrayVolume( hypre_BoxArray *box_array ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxArrayVolume)( box_array ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxArraysEqual( hypre_BoxArray *box_array1, hypre_BoxArray *box_array2 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxArraysEqual)( box_array1, box_array2 ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBTNodeCreate( HYPRE_Int ndim, hypre_BoxBTNode **btnode_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxBTNodeCreate)( ndim, btnode_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBTNodeDestroy( hypre_BoxBTNode *btnode ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxBTNodeDestroy)( btnode ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBTNodeInitialize( hypre_BoxBTNode *btnode, HYPRE_Int num_indices, HYPRE_Int **indices, hypre_Box *box ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxBTNodeInitialize)( btnode, num_indices, indices, box ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBTNodeSetIndices( hypre_BoxBTNode *btnode, HYPRE_Int num_indices, HYPRE_Int **indices ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxBTNodeSetIndices)( btnode, num_indices, indices ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBTQueueCreate( hypre_BoxBTQueue **btqueue_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxBTQueueCreate)( btqueue_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBTQueueDelete( hypre_BoxBTQueue *btqueue, hypre_BoxBTNode **btnode_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxBTQueueDelete)( btqueue, btnode_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBTQueueDestroy( hypre_BoxBTQueue *btqueue ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxBTQueueDestroy)( btqueue ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBTQueueInitialize( HYPRE_Int capacity, hypre_BoxBTQueue *btqueue ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxBTQueueInitialize)( capacity, btqueue ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBTQueueInsert( hypre_BoxBTNode *btnode, hypre_BoxBTQueue *btqueue ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxBTQueueInsert)( btnode, btqueue ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBTStackCreate( hypre_BoxBTStack **btstack_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxBTStackCreate)( btstack_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBTStackDelete( hypre_BoxBTStack *btstack, hypre_BoxBTNode **btnode_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxBTStackDelete)( btstack, btnode_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBTStackDestroy( hypre_BoxBTStack *btstack ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxBTStackDestroy)( btstack ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBTStackInitialize( HYPRE_Int capacity, hypre_BoxBTStack *btstack ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxBTStackInitialize)( capacity, btstack ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBTStackInsert( hypre_BoxBTNode *btnode, hypre_BoxBTStack *btstack ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxBTStackInsert)( btnode, btstack ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBinTreeCreate( HYPRE_Int ndim, hypre_BoxBinTree **boxbt_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxBinTreeCreate)( ndim, boxbt_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBinTreeDestroy( hypre_BoxBinTree *boxbt ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxBinTreeDestroy)( boxbt ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBinTreeInitialize( hypre_BoxBinTree *boxbt, HYPRE_Int num_indices, HYPRE_Int **indices, hypre_Box *box ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxBinTreeInitialize)( boxbt, num_indices, indices, box ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBoundaryDG( hypre_Box *box, hypre_StructGrid *g, hypre_BoxArray *boundarym, hypre_BoxArray *boundaryp, HYPRE_Int d ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxBoundaryDG)( box, g, boundarym, boundaryp, d ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBoundaryG( hypre_Box *box, hypre_StructGrid *g, hypre_BoxArray *boundary ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxBoundaryG)( box, g, boundary ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxBoundaryIntersect( hypre_Box *box, hypre_StructGrid *grid, HYPRE_Int d, HYPRE_Int dir, hypre_BoxArray *boundary ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxBoundaryIntersect)( box, grid, d, dir, boundary ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_Box * +hypre_BoxClone( hypre_Box *box ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxClone)( box ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_Box * +hypre_BoxCreate( HYPRE_Int ndim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxCreate)( ndim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxDestroy( hypre_Box *box ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxDestroy)( box ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxGetSize( hypre_Box *box, hypre_Index size ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxGetSize)( box, size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxGetStrideSize( hypre_Box *box, hypre_Index stride, hypre_Index size ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxGetStrideSize)( box, stride, size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxGetStrideVolume( hypre_Box *box, hypre_Index stride, HYPRE_Int *volume_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxGetStrideVolume)( box, stride, volume_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxGrowByArray( hypre_Box *box, HYPRE_Int *array ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxGrowByArray)( box, array ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxGrowByBox( hypre_Box *box, hypre_Box *gbox ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxGrowByBox)( box, gbox ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxGrowByIndex( hypre_Box *box, hypre_Index index ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxGrowByIndex)( box, index ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxGrowByValue( hypre_Box *box, HYPRE_Int val ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxGrowByValue)( box, val ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxInBox( hypre_Box *box1, hypre_Box *box2 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxInBox)( box1, box2 ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxIndexRank( hypre_Box *box, hypre_Index index ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxIndexRank)( box, index ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxInit( hypre_Box *box, HYPRE_Int ndim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxInit)( box, ndim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxManAddEntry( hypre_BoxManager *manager, hypre_Index imin, hypre_Index imax, HYPRE_Int proc_id, HYPRE_Int box_id, void *info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxManAddEntry)( manager, imin, imax, proc_id, box_id, info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxManAssemble( hypre_BoxManager *manager ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxManAssemble)( manager ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxManCreate)( max_nentries, info_size, dim, bounding_box, comm, manager_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxManDeleteMultipleEntriesAndInfo( hypre_BoxManager *manager, HYPRE_Int *indices, HYPRE_Int num ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxManDeleteMultipleEntriesAndInfo)( manager, indices, num ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxManDestroy( hypre_BoxManager *manager ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxManDestroy)( manager ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxManEntryCopy( hypre_BoxManEntry *fromentry, hypre_BoxManEntry *toentry ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxManEntryCopy)( fromentry, toentry ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxManEntryGetExtents( hypre_BoxManEntry *entry, hypre_Index imin, hypre_Index imax ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxManEntryGetExtents)( entry, imin, imax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxManEntryGetInfo( hypre_BoxManEntry *entry, void **info_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxManEntryGetInfo)( entry, info_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxManEntryGetStride( hypre_BoxManEntry *entry, hypre_Index stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxManEntryGetStride)( entry, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxManGatherEntries( hypre_BoxManager *manager, hypre_Index imin, hypre_Index imax ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxManGatherEntries)( manager, imin, imax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxManGetAllEntries( hypre_BoxManager *manager, HYPRE_Int *num_entries, hypre_BoxManEntry **entries ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxManGetAllEntries)( manager, num_entries, entries ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxManGetAllEntriesBoxes( hypre_BoxManager *manager, hypre_BoxArray *boxes ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxManGetAllEntriesBoxes)( manager, boxes ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxManGetAllEntriesBoxesProc( hypre_BoxManager *manager, hypre_BoxArray *boxes, HYPRE_Int **procs_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxManGetAllEntriesBoxesProc)( manager, boxes, procs_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxManGetAllGlobalKnown( hypre_BoxManager *manager, HYPRE_Int *known ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxManGetAllGlobalKnown)( manager, known ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxManGetAssumedPartition( hypre_BoxManager *manager, hypre_StructAssumedPart **assumed_partition ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxManGetAssumedPartition)( manager, assumed_partition ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxManGetEntry( hypre_BoxManager *manager, HYPRE_Int proc, HYPRE_Int id, hypre_BoxManEntry **entry_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxManGetEntry)( manager, proc, id, entry_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxManGetGlobalIsGatherCalled( hypre_BoxManager *manager, MPI_Comm comm, HYPRE_Int *is_gather ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxManGetGlobalIsGatherCalled)( manager, comm, is_gather ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxManGetIsEntriesSort( hypre_BoxManager *manager, HYPRE_Int *is_sort ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxManGetIsEntriesSort)( manager, is_sort ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxManGetLocalEntriesBoxes( hypre_BoxManager *manager, hypre_BoxArray *boxes ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxManGetLocalEntriesBoxes)( manager, boxes ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxManIncSize( hypre_BoxManager *manager, HYPRE_Int inc_size ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxManIncSize)( manager, inc_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxManIntersect( hypre_BoxManager *manager, hypre_Index ilower, hypre_Index iupper, hypre_BoxManEntry ***entries_ptr, HYPRE_Int *nentries_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxManIntersect)( manager, ilower, iupper, entries_ptr, nentries_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxManSetAllGlobalKnown( hypre_BoxManager *manager, HYPRE_Int known ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxManSetAllGlobalKnown)( manager, known ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxManSetAssumedPartition( hypre_BoxManager *manager, hypre_StructAssumedPart *assumed_partition ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxManSetAssumedPartition)( manager, assumed_partition ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxManSetBoundingBox( hypre_BoxManager *manager, hypre_Box *bounding_box ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxManSetBoundingBox)( manager, bounding_box ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxManSetIsEntriesSort( hypre_BoxManager *manager, HYPRE_Int is_sort ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxManSetIsEntriesSort)( manager, is_sort ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxManSetNumGhost( hypre_BoxManager *manager, HYPRE_Int *num_ghost ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxManSetNumGhost)( manager, num_ghost ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxMaxSize( hypre_Box *box ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxMaxSize)( box ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxNnodes( hypre_Box *box ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxNnodes)( box ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxOffsetDistance( hypre_Box *box, hypre_Index index ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxOffsetDistance)( box, index ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxPartialVolume( hypre_Box *box, hypre_Index partial_volume ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxPartialVolume)( box, partial_volume ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxPrint( FILE *file, hypre_Box *box ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxPrint)( file, box ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxPrintDebug( const char *prefix, hypre_Box *box ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxPrintDebug)( prefix, box ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxRankIndex( hypre_Box *box, HYPRE_Int rank, hypre_Index index ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxRankIndex)( box, rank, index ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxRead( FILE *file, HYPRE_Int ndim, hypre_Box **box_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxRead)( file, ndim, box_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxSetExtents( hypre_Box *box, hypre_Index imin, hypre_Index imax ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxSetExtents)( box, imin, imax ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxShiftNeg( hypre_Box *box, hypre_Index shift ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxShiftNeg)( box, shift ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxShiftPos( hypre_Box *box, hypre_Index shift ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxShiftPos)( box, shift ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxSplit( hypre_Box *box, hypre_Index index, hypre_Box **lbox_ptr, hypre_Box **rbox_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxSplit)( box, index, lbox_ptr, rbox_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxStrideVolume( hypre_Box *box, hypre_Index stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxStrideVolume)( box, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxVolume( hypre_Box *box ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxVolume)( box ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BoxesEqual( hypre_Box *box1, hypre_Box *box2 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BoxesEqual)( box1, box2 ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CoarsenBox( hypre_Box *box, hypre_IndexRef origin, hypre_Index stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CoarsenBox)( box, origin, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CoarsenBoxArray( hypre_BoxArray *box_array, hypre_IndexRef origin, hypre_Index stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CoarsenBoxArray)( box_array, origin, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CoarsenBoxArrayArray( hypre_BoxArrayArray *box_array_array, hypre_IndexRef origin, hypre_Index stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CoarsenBoxArrayArray)( box_array_array, origin, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CoarsenBoxArrayArrayOutward( hypre_BoxArrayArray *boxaa, hypre_BoxArray *refboxa, hypre_IndexRef origin, hypre_Index stride, hypre_BoxArrayArray **new_boxaa_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CoarsenBoxArrayArrayOutward)( boxaa, refboxa, origin, stride, new_boxaa_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommBlockSetEntries( hypre_CommBlock *comm_block, HYPRE_Int *boxnums, hypre_Box *boxes, HYPRE_Int *orders, hypre_Index stride, hypre_BoxArray *data_space, HYPRE_Int *data_offsets ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CommBlockSetEntries)( comm_block, boxnums, boxes, orders, stride, data_space, data_offsets ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommBlockSetEntry( hypre_CommBlock *comm_block, HYPRE_Int comm_num, hypre_Box *box, hypre_Index stride, hypre_Index coord, hypre_Index dir, HYPRE_Int *order, HYPRE_Int *rem_order, hypre_Box *data_box, HYPRE_Int data_box_offset ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CommBlockSetEntry)( comm_block, comm_num, box, stride, coord, dir, order, rem_order, data_box, data_box_offset ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommInfoClone( hypre_CommInfo *comm_info, hypre_CommInfo **clone_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CommInfoClone)( comm_info, clone_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommInfoCoarsen( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CommInfoCoarsen)( comm_info, index, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommInfoCoarsenRecv( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CommInfoCoarsenRecv)( comm_info, index, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommInfoCoarsenSend( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CommInfoCoarsenSend)( comm_info, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CommInfoCreate)( send_boxes, recv_boxes, send_procs, recv_procs, send_rboxnums, recv_rboxnums, send_rboxes, recv_rboxes, boxes_match, comm_info_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommInfoDestroy( hypre_CommInfo *comm_info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CommInfoDestroy)( comm_info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommInfoGetTransforms( hypre_CommInfo *comm_info, HYPRE_Int *num_transforms, hypre_Index **coords, hypre_Index **dirs ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CommInfoGetTransforms)( comm_info, num_transforms, coords, dirs ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommInfoProjectRecv( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CommInfoProjectRecv)( comm_info, index, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommInfoProjectSend( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CommInfoProjectSend)( comm_info, index, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommInfoRefine( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CommInfoRefine)( comm_info, index, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommInfoRefineRecv( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CommInfoRefineRecv)( comm_info, index, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommInfoRefineSend( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CommInfoRefineSend)( comm_info, index, stride ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CommInfoSetTransforms)( comm_info, num_transforms, coords, dirs, send_transforms, recv_transforms ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommPkgAgglomData( HYPRE_Int num_comm_pkgs, hypre_CommPkg **comm_pkg_a, HYPRE_Complex ***comm_data_a, hypre_CommPkg *comm_pkg, HYPRE_Complex ***agg_comm_data_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CommPkgAgglomData)( num_comm_pkgs, comm_pkg_a, comm_data_a, comm_pkg, agg_comm_data_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommPkgAgglomDestroy( HYPRE_Int num_comm_pkgs, hypre_CommPkg **comm_pkg_a, HYPRE_Complex ***comm_data_a ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CommPkgAgglomDestroy)( num_comm_pkgs, comm_pkg_a, comm_data_a ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommPkgAgglomerate( HYPRE_Int num_comm_pkgs, hypre_CommPkg **comm_pkgs, hypre_CommPkg **agg_comm_pkg_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CommPkgAgglomerate)( num_comm_pkgs, comm_pkgs, agg_comm_pkg_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_MemoryLocation memory_location, hypre_CommPkg **comm_pkg_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CommPkgCreate)( comm_info, send_data_space, recv_data_space, num_values, orders, reverse, comm, memory_location, comm_pkg_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommPkgDestroy( hypre_CommPkg *comm_pkg ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CommPkgDestroy)( comm_pkg ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommPkgSetPrefixSizes( hypre_CommPkg *comm_pkg ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CommPkgSetPrefixSizes)( comm_pkg ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_CommStencil * +hypre_CommStencilCreate( HYPRE_Int ndim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CommStencilCreate)( ndim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommStencilCreateNumGhost( hypre_CommStencil *comm_stencil, HYPRE_Int **num_ghost_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CommStencilCreateNumGhost)( comm_stencil, num_ghost_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommStencilDestroy( hypre_CommStencil *comm_stencil ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CommStencilDestroy)( comm_stencil ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommStencilSetEntry( hypre_CommStencil *comm_stencil, hypre_Index offset ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CommStencilSetEntry)( comm_stencil, offset ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ComputeBoxnums( hypre_BoxArray *boxes, HYPRE_Int *procs, HYPRE_Int **boxnums_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ComputeBoxnums)( boxes, procs, boxnums_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ComputeCoarseOriginStride( hypre_Index coarse_origin, hypre_Index coarse_stride, hypre_IndexRef origin, hypre_Index stride, HYPRE_Int ndim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ComputeCoarseOriginStride)( coarse_origin, coarse_stride, origin, stride, ndim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ComputeInfoCreate( hypre_CommInfo *comm_info, hypre_BoxArrayArray *indt_boxes, hypre_BoxArrayArray *dept_boxes, hypre_ComputeInfo **compute_info_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ComputeInfoCreate)( comm_info, indt_boxes, dept_boxes, compute_info_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ComputeInfoDestroy( hypre_ComputeInfo *compute_info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ComputeInfoDestroy)( compute_info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ComputeInfoProjectComp( hypre_ComputeInfo *compute_info, hypre_Index index, hypre_Index stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ComputeInfoProjectComp)( compute_info, index, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ComputeInfoProjectRecv( hypre_ComputeInfo *compute_info, hypre_Index index, hypre_Index stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ComputeInfoProjectRecv)( compute_info, index, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ComputeInfoProjectSend( hypre_ComputeInfo *compute_info, hypre_Index index, hypre_Index stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ComputeInfoProjectSend)( compute_info, index, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ComputePkgCreate( HYPRE_MemoryLocation memory_location, hypre_ComputeInfo *compute_info, hypre_BoxArray *data_space, HYPRE_Int num_values, hypre_StructGrid *grid, hypre_ComputePkg **compute_pkg_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ComputePkgCreate)( memory_location, compute_info, data_space, num_values, grid, compute_pkg_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ComputePkgDestroy( hypre_ComputePkg *compute_pkg ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ComputePkgDestroy)( compute_pkg ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ConvertToCanonicalIndex( hypre_Index index, hypre_Index stride, HYPRE_Int ndim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ConvertToCanonicalIndex)( index, stride, ndim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CopyBox( hypre_Box *box1, hypre_Box *box2 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CopyBox)( box1, box2 ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CopyIndex( hypre_Index in_index, hypre_Index out_index ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CopyIndex)( in_index, out_index ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CopyToCleanIndex( hypre_Index in_index, HYPRE_Int ndim, hypre_Index out_index ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CopyToCleanIndex)( in_index, ndim, out_index ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CopyToIndex( hypre_Index in_index, HYPRE_Int ndim, hypre_Index out_index ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CopyToIndex)( in_index, ndim, out_index ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CreateCommInfo( hypre_StructGrid *bgrid, hypre_Index stride, hypre_CommStencil *comm_stencil, hypre_CommInfo **comm_info_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CreateCommInfo)( bgrid, stride, comm_stencil, comm_info_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CreateCommInfoFromGrids( hypre_StructGrid *from_grid, hypre_StructGrid *to_grid, hypre_CommInfo **comm_info_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CreateCommInfoFromGrids)( from_grid, to_grid, comm_info_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CreateCommInfoFromNumGhost( hypre_StructGrid *grid, hypre_Index stride, HYPRE_Int *num_ghost, hypre_CommInfo **comm_info_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CreateCommInfoFromNumGhost)( grid, stride, num_ghost, comm_info_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, hypre_Index stride, hypre_StructStencil *stencil, hypre_CommInfo **comm_info_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CreateCommInfoFromStencil)( grid, stride, stencil, comm_info_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CreateComputeInfo( hypre_StructGrid *grid, hypre_Index stride, hypre_StructStencil *stencil, hypre_ComputeInfo **compute_info_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CreateComputeInfo)( grid, stride, stencil, compute_info_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_DeleteBox( hypre_BoxArray *box_array, HYPRE_Int index ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_DeleteBox)( box_array, index ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_DeleteMultipleBoxes( hypre_BoxArray *box_array, HYPRE_Int *indices, HYPRE_Int num ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_DeleteMultipleBoxes)( box_array, indices, num ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ExchangeLocalData( hypre_CommPkg *comm_pkg, HYPRE_Complex **send_data, HYPRE_Complex **recv_data, HYPRE_Int action ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ExchangeLocalData)( comm_pkg, send_data, recv_data, action ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FillResponseBoxManAssemble1)( p_recv_contact_buf, contact_size, contact_proc, ro, comm, p_send_response_buf, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FillResponseBoxManAssemble2)( p_recv_contact_buf, contact_size, contact_proc, ro, comm, p_send_response_buf, response_message_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FinalizeIndtComputations( hypre_CommHandle *comm_handle ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FinalizeIndtComputations)( comm_handle ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GatherAllBoxes)( comm, boxes, dim, all_boxes_ptr, all_procs_ptr, first_local_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GeneralBoxBoundaryIntersect( hypre_Box *box, hypre_StructGrid *grid, hypre_Index stencil_offset, hypre_BoxArray *boundary ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GeneralBoxBoundaryIntersect)( box, grid, stencil_offset, boundary ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IndexElementMult( hypre_Index index, HYPRE_Int ndim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IndexElementMult)( index, ndim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IndexEqual( hypre_Index index, HYPRE_Int val, HYPRE_Int ndim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IndexEqual)( index, val, ndim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IndexInBox( hypre_Index index, hypre_Box *box ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IndexInBox)( index, box ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IndexMax( hypre_Index index, HYPRE_Int ndim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IndexMax)( index, ndim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IndexMin( hypre_Index index, HYPRE_Int ndim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IndexMin)( index, ndim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IndexPrint( FILE *file, HYPRE_Int ndim, hypre_Index index ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IndexPrint)( file, ndim, index ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IndexRead( FILE *file, HYPRE_Int ndim, hypre_Index index ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IndexRead)( file, ndim, index ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IndexesEqual( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IndexesEqual)( index1, index2, ndim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IndexesGreater( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IndexesGreater)( index1, index2, ndim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IndexesGreaterEqual( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IndexesGreaterEqual)( index1, index2, ndim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_InitializeIndtComputations( hypre_ComputePkg *compute_pkg, HYPRE_Complex *data, hypre_CommHandle **comm_handle_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_InitializeIndtComputations)( compute_pkg, data, comm_handle_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntersectBoxes( hypre_Box *box1, hypre_Box *box2, hypre_Box *ibox ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IntersectBoxes)( box1, box2, ibox ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MapToCoarseIndex( hypre_Index index, hypre_IndexRef origin, hypre_Index stride, HYPRE_Int ndim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MapToCoarseIndex)( index, origin, stride, ndim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MapToFineIndex( hypre_Index index, hypre_IndexRef origin, hypre_Index stride, HYPRE_Int ndim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MapToFineIndex)( index, origin, stride, ndim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MinUnionBoxes( hypre_BoxArray *boxes ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MinUnionBoxes)( boxes ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PrintBoxArrayData( FILE *file, HYPRE_Int dim, hypre_BoxArray *box_array, hypre_BoxArray *data_space, HYPRE_Int num_values, HYPRE_Int *value_ids, HYPRE_Complex *data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PrintBoxArrayData)( file, dim, box_array, data_space, num_values, value_ids, data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ProjectBox( hypre_Box *box, hypre_IndexRef origin, hypre_Index stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ProjectBox)( box, origin, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ProjectBoxArray( hypre_BoxArray *box_array, hypre_IndexRef origin, hypre_Index stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ProjectBoxArray)( box_array, origin, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ProjectBoxArrayArray( hypre_BoxArrayArray *box_array_array, hypre_IndexRef origin, hypre_Index stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ProjectBoxArrayArray)( box_array_array, origin, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ReadBoxArrayData( FILE *file, HYPRE_Int ndim, hypre_BoxArray *box_array, HYPRE_Int *num_values_ptr, HYPRE_Int **value_ids_ptr, HYPRE_Complex **values_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ReadBoxArrayData)( file, ndim, box_array, num_values_ptr, value_ids_ptr, values_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_RefineBox( hypre_Box *box, hypre_IndexRef origin, hypre_Index stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_RefineBox)( box, origin, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_RefineBoxArray( hypre_BoxArray *box_array, hypre_IndexRef origin, hypre_Index stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_RefineBoxArray)( box_array, origin, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_RefineBoxArrayArray( hypre_BoxArrayArray *box_array_array, hypre_IndexRef origin, hypre_Index stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_RefineBoxArrayArray)( box_array_array, origin, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SetIndex( hypre_Index index, HYPRE_Int val ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SetIndex)( index, val ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SnapIndexNeg( hypre_Index index, hypre_IndexRef origin, hypre_Index stride, HYPRE_Int ndim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SnapIndexNeg)( index, origin, stride, ndim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SnapIndexPos( hypre_Index index, hypre_IndexRef origin, hypre_Index stride, HYPRE_Int ndim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SnapIndexPos)( index, origin, stride, ndim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StCoeffClone( hypre_StCoeff *coeff, HYPRE_Int ndim, hypre_StCoeff **clone_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StCoeffClone)( coeff, ndim, clone_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StCoeffCreate( HYPRE_Int nterms, hypre_StCoeff **coeff_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StCoeffCreate)( nterms, coeff_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StCoeffDestroy( hypre_StCoeff *coeff ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StCoeffDestroy)( coeff ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StCoeffMult( hypre_StCoeff *Acoeff, hypre_StCoeff *Bcoeff, HYPRE_Int ndim, hypre_StCoeff **Ccoeff_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StCoeffMult)( Acoeff, Bcoeff, ndim, Ccoeff_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StCoeffPrint( hypre_StCoeff *coeff, char *matnames, HYPRE_Int ndim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StCoeffPrint)( coeff, matnames, ndim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StCoeffPush( hypre_StCoeff **stack_ptr, hypre_StCoeff *coeff ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StCoeffPush)( stack_ptr, coeff ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StCoeffShift( hypre_StCoeff *coeff, hypre_Index shift, HYPRE_Int ndim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StCoeffShift)( coeff, shift, ndim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StIndexCopy( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StIndexCopy)( index1, index2, ndim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StIndexNegate( hypre_Index index, HYPRE_Int ndim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StIndexNegate)( index, ndim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StIndexPrint( hypre_Index index, char lchar, char rchar, HYPRE_Int ndim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StIndexPrint)( index, lchar, rchar, ndim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StIndexShift( hypre_Index index, hypre_Index shift, HYPRE_Int ndim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StIndexShift)( index, shift, ndim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StMatrixClone( hypre_StMatrix *matrix, HYPRE_Int ndim, hypre_StMatrix **mclone_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StMatrixClone)( matrix, ndim, mclone_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StMatrixCreate( HYPRE_Int id, HYPRE_Int size, HYPRE_Int ndim, hypre_StMatrix **matrix_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StMatrixCreate)( id, size, ndim, matrix_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StMatrixDestroy( hypre_StMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StMatrixDestroy)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StMatrixMatmat( hypre_StMatrix *A, hypre_StMatrix *B, HYPRE_Int Cid, HYPRE_Int ndim, hypre_StMatrix **C_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StMatrixMatmat)( A, B, Cid, ndim, C_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StMatrixMatmult( HYPRE_Int nmatrices, hypre_StMatrix **matrices, HYPRE_Int *transposes, HYPRE_Int Cid, HYPRE_Int ndim, hypre_StMatrix **C_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StMatrixMatmult)( nmatrices, matrices, transposes, Cid, ndim, C_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StMatrixNEntryCoeffs( hypre_StMatrix *matrix, HYPRE_Int entry ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StMatrixNEntryCoeffs)( matrix, entry ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StMatrixPrint( hypre_StMatrix *matrix, char *matnames, HYPRE_Int ndim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StMatrixPrint)( matrix, matnames, ndim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StMatrixTranspose( hypre_StMatrix *matrix, HYPRE_Int ndim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StMatrixTranspose)( matrix, ndim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StTermCopy( hypre_StTerm *term1, hypre_StTerm *term2, HYPRE_Int ndim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StTermCopy)( term1, term2, ndim ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StTermPrint( hypre_StTerm *term, char *matnames, HYPRE_Int ndim ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StTermPrint)( term, matnames, ndim ); +} + +/*--------------------------------------------------------------------------*/ + +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 max_regions, HYPRE_Int max_refinements, HYPRE_Real gamma, MPI_Comm comm, hypre_StructAssumedPart **p_assumed_partition ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructAssumedPartitionCreate)( dim, bounding_box, global_boxes_size, global_num_boxes, local_boxes, max_regions, max_refinements, gamma, comm, p_assumed_partition ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructAssumedPartitionDestroy( hypre_StructAssumedPart *assumed_part ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructAssumedPartitionDestroy)( assumed_part ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructAssumedPartitionGetProcsFromBox)( assumed_part, box, num_proc_array, size_alloc_proc_array, p_proc_array ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructAssumedPartitionGetRegionsFromProc( hypre_StructAssumedPart *assumed_part, HYPRE_Int proc_id, hypre_BoxArray *assumed_regions ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructAssumedPartitionGetRegionsFromProc)( assumed_part, proc_id, assumed_regions ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructAssumedPartitionPrint( const char *filename, hypre_StructAssumedPart *ap ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructAssumedPartitionPrint)( filename, ap ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructCoarsen( hypre_StructGrid *fgrid, hypre_IndexRef origin, hypre_Index stride, HYPRE_Int prune, hypre_StructGrid **cgrid_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructCoarsen)( fgrid, origin, stride, prune, cgrid_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructCoarsenAP( hypre_StructAssumedPart *ap, hypre_Index origin, hypre_Index stride, hypre_StructAssumedPart **new_ap_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructCoarsenAP)( ap, origin, stride, new_ap_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructCommunicationFinalize( hypre_CommHandle *comm_handle ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructCommunicationFinalize)( comm_handle ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructCommunicationInitialize( hypre_CommPkg *comm_pkg, HYPRE_Complex **send_data, HYPRE_Complex **recv_data, HYPRE_Int action, HYPRE_Int tag, hypre_CommHandle **comm_handle_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructCommunicationInitialize)( comm_pkg, send_data, recv_data, action, tag, comm_handle_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructCopy( hypre_StructVector *x, hypre_StructVector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructCopy)( x, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructDataCopy( HYPRE_Complex *fr_data, /* from */ hypre_BoxArray *fr_data_space, HYPRE_Complex *to_data, /* to */ hypre_BoxArray *to_data_space, HYPRE_Int ndim, HYPRE_Int nval ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructDataCopy)( fr_data, fr_data_space, to_data, to_data_space, ndim, nval ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructGridAssemble( hypre_StructGrid *grid ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructGridAssemble)( grid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructGridComputeBoxnums( hypre_StructGrid *grid, HYPRE_Int nboxes, HYPRE_Int *boxnums, hypre_Index stride, HYPRE_Int *new_nboxes_ptr, HYPRE_Int **new_boxnums_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructGridComputeBoxnums)( grid, nboxes, boxnums, stride, new_nboxes_ptr, new_boxnums_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructGridComputeGlobalSize( hypre_StructGrid *grid ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructGridComputeGlobalSize)( grid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructGridCreate( MPI_Comm comm, HYPRE_Int dim, hypre_StructGrid **grid_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructGridCreate)( comm, dim, grid_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructGridDestroy( hypre_StructGrid *grid ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructGridDestroy)( grid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructGridGetMaxBoxSize( hypre_StructGrid *grid ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructGridGetMaxBoxSize)( grid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructGridPrint( FILE *file, hypre_StructGrid *grid ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructGridPrint)( file, grid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructGridPrintVTK( const char *filename, hypre_StructGrid *grid ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructGridPrintVTK)( filename, grid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructGridRead( MPI_Comm comm, FILE *file, hypre_StructGrid **grid_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructGridRead)( comm, file, grid_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructGridRef( hypre_StructGrid *grid, hypre_StructGrid **grid_ref ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructGridRef)( grid, grid_ref ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructGridSetBoundingBox( hypre_StructGrid *grid, hypre_Box *new_bb ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructGridSetBoundingBox)( grid, new_bb ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructGridSetBoxManager( hypre_StructGrid *grid, hypre_BoxManager *boxman ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructGridSetBoxManager)( grid, boxman ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructGridSetBoxes( hypre_StructGrid *grid, hypre_BoxArray *boxes ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructGridSetBoxes)( grid, boxes ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructGridSetExtents( hypre_StructGrid *grid, hypre_Index ilower, hypre_Index iupper ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructGridSetExtents)( grid, ilower, iupper ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructGridSetIDs( hypre_StructGrid *grid, HYPRE_Int *ids ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructGridSetIDs)( grid, ids ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructGridSetMaxDistance( hypre_StructGrid *grid, hypre_Index dist ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructGridSetMaxDistance)( grid, dist ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructGridSetNumGhost( hypre_StructGrid *grid, HYPRE_Int *num_ghost ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructGridSetNumGhost)( grid, num_ghost ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructGridSetPeriodic( hypre_StructGrid *grid, hypre_Index periodic ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructGridSetPeriodic)( grid, periodic ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +hypre_StructInnerProd( hypre_StructVector *x, hypre_StructVector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructInnerProd)( x, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +hypre_StructInnerProdLocal( hypre_StructVector *x, hypre_StructVector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructInnerProdLocal)( x, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMapCoarseToFine( hypre_Index cindex, hypre_Index origin, hypre_Index stride, hypre_Index findex ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMapCoarseToFine)( cindex, origin, stride, findex ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMapFineToCoarse( hypre_Index findex, hypre_Index origin, hypre_Index stride, hypre_Index cindex ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMapFineToCoarse)( findex, origin, stride, cindex ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmat( hypre_StructMatrix *A, hypre_StructMatrix *B, hypre_StructMatrix **M_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatmat)( A, B, M_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmatSetup( hypre_StructMatrix *A, hypre_StructMatrix *B, hypre_StructMatmultData **mmdata_ptr, hypre_StructMatrix **M_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatmatSetup)( A, B, mmdata_ptr, M_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmult( HYPRE_Int type, HYPRE_Int nmatrices, hypre_StructMatrix **matrices, HYPRE_Int nterms, HYPRE_Int *terms, HYPRE_Int *trans, hypre_StructMatrix **M_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatmult)( type, nmatrices, matrices, nterms, terms, trans, M_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultCommSetup( hypre_StructMatmultData *mmdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatmultCommSetup)( mmdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultCommunicate( hypre_StructMatmultData *mmdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatmultCommunicate)( mmdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultCompute( hypre_StructMatmultData *mmdata, HYPRE_Int iM ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatmultCompute)( mmdata, iM ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultCompute_core( HYPRE_Int nterms, hypre_StructMatmultDataMH *a, HYPRE_Int na, HYPRE_Int ndim, hypre_Index loop_size, HYPRE_Int stencil_size, hypre_Box *fdbox, hypre_Index fdstart, hypre_Index fdstride, hypre_Box *cdbox, hypre_Index cdstart, hypre_Index cdstride, hypre_Box *Mdbox, hypre_Index Mdstart, hypre_Index Mdstride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatmultCompute_core)( nterms, a, na, ndim, loop_size, stencil_size, fdbox, fdstart, fdstride, cdbox, cdstart, cdstride, Mdbox, Mdstart, Mdstride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultCompute_core_generic( hypre_StructMatmultDataMH *a, HYPRE_Int na, HYPRE_Int nterms, HYPRE_Int ndim, hypre_Index loop_size, hypre_Box *fdbox, hypre_Index fdstart, hypre_Index fdstride, hypre_Box *cdbox, hypre_Index cdstart, hypre_Index cdstride, hypre_Box *Mdbox, hypre_Index Mdstart, hypre_Index Mdstride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatmultCompute_core_generic)( a, na, nterms, ndim, loop_size, fdbox, fdstart, fdstride, cdbox, cdstart, cdstride, Mdbox, Mdstart, Mdstride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultCompute_fuse( HYPRE_Int nterms, hypre_StructMatmultDataMH *a, HYPRE_Int na, HYPRE_Int ndim, hypre_Index loop_size, HYPRE_Int stencil_size, hypre_Box *fdbox, hypre_Index fdstart, hypre_Index fdstride, hypre_Box *cdbox, hypre_Index cdstart, hypre_Index cdstride, hypre_Box *Mdbox, hypre_Index Mdstart, hypre_Index Mdstride, hypre_StructMatrix *M ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatmultCompute_fuse)( nterms, a, na, ndim, loop_size, stencil_size, fdbox, fdstart, fdstride, cdbox, cdstart, cdstride, Mdbox, Mdstart, Mdstride, M ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultCreate( HYPRE_Int max_matmults, HYPRE_Int max_matrices, hypre_StructMatmultData **mmdata_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatmultCreate)( max_matmults, max_matrices, mmdata_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultDestroy( hypre_StructMatmultData *mmdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatmultDestroy)( mmdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultGetMatrix( hypre_StructMatmultData *mmdata, HYPRE_Int iM, hypre_StructMatrix **M_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatmultGetMatrix)( mmdata, iM, M_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultInitialize( hypre_StructMatmultData *mmdata, HYPRE_Int assemble_grid ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatmultInitialize)( mmdata, assemble_grid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultMultiply( hypre_StructMatmultData *mmdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatmultMultiply)( mmdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultSetKernelType( hypre_StructMatmultData *mmdata, HYPRE_Int kernel_type ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatmultSetKernelType)( mmdata, kernel_type ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultSetProduct( hypre_StructMatmultData *mmdata, HYPRE_Int nmatrices_in, hypre_StructMatrix **matrices_in, HYPRE_Int nterms, HYPRE_Int *terms_in, HYPRE_Int *transposes_in, HYPRE_Int *iM_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatmultSetProduct)( mmdata, nmatrices_in, matrices_in, nterms, terms_in, transposes_in, iM_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultSetup( HYPRE_Int type, HYPRE_Int nmatrices, hypre_StructMatrix **matrices, HYPRE_Int nterms, HYPRE_Int *terms, HYPRE_Int *trans, hypre_StructMatmultData **mmdata_ptr, hypre_StructMatrix **M_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatmultSetup)( type, nmatrices, matrices, nterms, terms, trans, mmdata_ptr, M_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixAddInit( HYPRE_Int nmatrices, hypre_StructMatrix **matrices, hypre_StructMatrix **A_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixAddInit)( nmatrices, matrices, A_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixAddMat( hypre_StructMatrix *A, HYPRE_Complex alpha, hypre_StructMatrix *B ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixAddMat)( A, alpha, B ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixAssemble( hypre_StructMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixAssemble)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixClearBoundary( hypre_StructMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixClearBoundary)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixClearBoxValues)( matrix, clear_box, num_stencil_indices, stencil_indices, boxnum, outside ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixClearGhostValues( hypre_StructMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixClearGhostValues)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixClearValues)( matrix, grid_index, num_stencil_indices, stencil_indices, boxnum, outside ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixComputeDataSpace( hypre_StructMatrix *matrix, HYPRE_Int *num_ghost, hypre_BoxArray **data_space_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixComputeDataSpace)( matrix, num_ghost, data_space_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixComputeRowSum( hypre_StructMatrix *A, HYPRE_Int type, hypre_StructVector *rowsum ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixComputeRowSum)( A, type, rowsum ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_StructMatrix * +hypre_StructMatrixCreate( MPI_Comm comm, hypre_StructGrid *grid, hypre_StructStencil *user_stencil ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixCreate)( comm, grid, user_stencil ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixCreateCommPkg( hypre_StructMatrix *matrix, hypre_CommInfo *comm_info, hypre_CommPkg **comm_pkg_ptr, HYPRE_Complex ***comm_data_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixCreateCommPkg)( matrix, comm_info, comm_pkg_ptr, comm_data_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_StructMatrix * +hypre_StructMatrixCreateMask( hypre_StructMatrix *matrix, HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixCreateMask)( matrix, num_stencil_indices, stencil_indices ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixDestroy( hypre_StructMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixDestroy)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Complex * +hypre_StructMatrixExtractPointerByIndex( hypre_StructMatrix *matrix, HYPRE_Int b, hypre_Index index ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixExtractPointerByIndex)( matrix, b, index ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixForget( hypre_StructMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixForget)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixGetCStride( hypre_StructMatrix *matrix, hypre_IndexRef *cstride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixGetCStride)( matrix, cstride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixGetDataMapStride( hypre_StructMatrix *matrix, hypre_IndexRef *stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixGetDataMapStride)( matrix, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixGetDiagonal( hypre_StructMatrix *matrix, hypre_StructVector *diag ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixGetDiagonal)( matrix, diag ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixGetFStride( hypre_StructMatrix *matrix, hypre_IndexRef *fstride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixGetFStride)( matrix, fstride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixGetStSpaces( hypre_StructMatrix *matrix, HYPRE_Int transpose, HYPRE_Int *num_sspaces_ptr, HYPRE_Int **sentry_sspaces_ptr, hypre_Index **sspace_origins_ptr, hypre_Index stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixGetStSpaces)( matrix, transpose, num_sspaces_ptr, sentry_sspaces_ptr, sspace_origins_ptr, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixGetStencilSpace( hypre_StructMatrix *matrix, HYPRE_Int entry, HYPRE_Int transpose, hypre_Index origin, hypre_Index stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixGetStencilSpace)( matrix, entry, transpose, origin, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixGetStencilStride( hypre_StructMatrix *matrix, hypre_Index stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixGetStencilStride)( matrix, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixGrowDataSpace( hypre_StructMatrix *matrix, HYPRE_Int *num_ghost, hypre_BoxArray **data_space_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixGrowDataSpace)( matrix, num_ghost, data_space_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixInitialize( hypre_StructMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixInitialize)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixInitializeData( hypre_StructMatrix *matrix, HYPRE_Int zero_init, HYPRE_Complex *data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixInitializeData)( matrix, zero_init, data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixInitializeShell( hypre_StructMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixInitializeShell)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixMapCommInfo( hypre_StructMatrix *matrix, hypre_IndexRef origin, hypre_Index stride, hypre_CommInfo *comm_info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixMapCommInfo)( matrix, origin, stride, comm_info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixMapDataBox( hypre_StructMatrix *matrix, hypre_Box *dbox ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixMapDataBox)( matrix, dbox ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixMapDataIndex( hypre_StructMatrix *matrix, hypre_Index dindex ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixMapDataIndex)( matrix, dindex ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixMapDataStride( hypre_StructMatrix *matrix, hypre_Index dstride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixMapDataStride)( matrix, dstride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixMigrate( hypre_StructMatrix *from_matrix, hypre_StructMatrix *to_matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixMigrate)( from_matrix, to_matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixNeedResize( hypre_StructMatrix *matrix, hypre_BoxArray *data_space ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixNeedResize)( matrix, data_space ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixPlaceStencil( hypre_StructMatrix *matrix, HYPRE_Int entry, hypre_Index dindex, hypre_Index index ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixPlaceStencil)( matrix, entry, dindex, index ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixPrint( const char *filename, hypre_StructMatrix *matrix, HYPRE_Int all ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixPrint)( filename, matrix, all ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixPrintData( FILE *file, hypre_StructMatrix *matrix, HYPRE_Int all ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixPrintData)( file, matrix, all ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixPtAP( hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix **M_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixPtAP)( A, P, M_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixPtAPSetup( HYPRE_Int kernel_type, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatmultData **mmdata_ptr, hypre_StructMatrix **M_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixPtAPSetup)( kernel_type, A, P, mmdata_ptr, M_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixRAP( hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix **M_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixRAP)( R, A, P, M_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixRAPSetup( HYPRE_Int kernel_type, hypre_StructMatrix *R, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatmultData **mmdata_ptr, hypre_StructMatrix **M_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixRAPSetup)( kernel_type, R, A, P, mmdata_ptr, M_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixRTtAP( hypre_StructMatrix *RT, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatrix **M_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixRTtAP)( RT, A, P, M_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixRTtAPSetup( HYPRE_Int kernel_type, hypre_StructMatrix *RT, hypre_StructMatrix *A, hypre_StructMatrix *P, hypre_StructMatmultData **mmdata_ptr, hypre_StructMatrix **M_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixRTtAPSetup)( kernel_type, RT, A, P, mmdata_ptr, M_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_StructMatrix * +hypre_StructMatrixRead( MPI_Comm comm, const char *filename, HYPRE_Int *num_ghost ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixRead)( comm, filename, num_ghost ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixReadData( FILE *file, hypre_StructMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixReadData)( file, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_StructMatrix * +hypre_StructMatrixRef( hypre_StructMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixRef)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixResize( hypre_StructMatrix *matrix, hypre_BoxArray *data_space ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixResize)( matrix, data_space ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixRestore( hypre_StructMatrix *matrix ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixRestore)( matrix ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixSetBoxValues)( matrix, set_box, value_box, num_stencil_indices, stencil_indices, values, action, boxnum, outside ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixSetConstantEntries( hypre_StructMatrix *matrix, HYPRE_Int nentries, HYPRE_Int *entries ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixSetConstantEntries)( matrix, nentries, entries ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixSetConstantValues( hypre_StructMatrix *matrix, HYPRE_Int num_stencil_indices, HYPRE_Int *stencil_indices, HYPRE_Complex *values, HYPRE_Int action ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixSetConstantValues)( matrix, num_stencil_indices, stencil_indices, values, action ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixSetDomainStride( hypre_StructMatrix *matrix, hypre_IndexRef domain_stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixSetDomainStride)( matrix, domain_stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixSetGhost( hypre_StructMatrix *matrix, HYPRE_Int ghost, HYPRE_Int *resize ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixSetGhost)( matrix, ghost, resize ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixSetMemoryLocation( hypre_StructMatrix *matrix, HYPRE_MemoryLocation memory_location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixSetMemoryLocation)( matrix, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixSetNumGhost( hypre_StructMatrix *matrix, HYPRE_Int *num_ghost, HYPRE_Int *resize ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixSetNumGhost)( matrix, num_ghost, resize ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixSetRangeStride( hypre_StructMatrix *matrix, hypre_IndexRef range_stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixSetRangeStride)( matrix, range_stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixSetTranspose( hypre_StructMatrix *matrix, HYPRE_Int transpose, HYPRE_Int *resize ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixSetTranspose)( matrix, transpose, resize ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixSetValues)( matrix, grid_index, num_stencil_indices, stencil_indices, values, action, boxnum, outside ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixUnMapDataBox( hypre_StructMatrix *matrix, hypre_Box *dbox ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixUnMapDataBox)( matrix, dbox ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixUnMapDataIndex( hypre_StructMatrix *matrix, hypre_Index dindex ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixUnMapDataIndex)( matrix, dindex ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixUnMapDataStride( hypre_StructMatrix *matrix, hypre_Index dstride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixUnMapDataStride)( matrix, dstride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixZeroDiagonal( hypre_StructMatrix *A ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatrixZeroDiagonal)( A ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatvec( HYPRE_Complex alpha, hypre_StructMatrix *A, hypre_StructVector *x, HYPRE_Complex beta, hypre_StructVector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatvec)( alpha, A, x, beta, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatvecCompute( void *matvec_vdata, HYPRE_Complex alpha, hypre_StructMatrix *A, hypre_StructVector *x, HYPRE_Complex beta, hypre_StructVector *y, hypre_StructVector *z ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatvecCompute)( matvec_vdata, alpha, A, x, beta, y, z ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatvecCompute_core_CC( HYPRE_Complex alpha, hypre_StructMatrix *A, hypre_StructVector *x, HYPRE_Complex beta, hypre_StructVector *y, hypre_StructVector *z, HYPRE_Int Ab, HYPRE_Int xb, HYPRE_Int yb, HYPRE_Int zb, HYPRE_Int transpose, HYPRE_Int nentries, HYPRE_Int *entries, hypre_IndexRef start, hypre_IndexRef stride, hypre_IndexRef loop_size, hypre_IndexRef xfstride, hypre_IndexRef ran_stride, hypre_IndexRef xdstride, hypre_IndexRef ydstride, hypre_IndexRef zdstride, hypre_Box *x_data_box, hypre_Box *y_data_box, hypre_Box *z_data_box ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatvecCompute_core_CC)( alpha, A, x, beta, y, z, Ab, xb, yb, zb, transpose, nentries, entries, start, stride, loop_size, xfstride, ran_stride, xdstride, ydstride, zdstride, x_data_box, y_data_box, z_data_box ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatvecCompute_core_VC( HYPRE_Complex alpha, hypre_StructMatrix *A, hypre_StructVector *x, HYPRE_Complex beta, hypre_StructVector *y, hypre_StructVector *z, HYPRE_Int Ab, HYPRE_Int xb, HYPRE_Int yb, HYPRE_Int zb, HYPRE_Int transpose, HYPRE_Int only_Ax, HYPRE_Int nentries, HYPRE_Int *entries, hypre_IndexRef start, hypre_IndexRef stride, hypre_IndexRef loop_size, hypre_IndexRef xfstride, hypre_IndexRef ran_stride, hypre_IndexRef Adstride, hypre_IndexRef xdstride, hypre_IndexRef ydstride, hypre_IndexRef zdstride, hypre_Box *A_data_box, hypre_Box *x_data_box, hypre_Box *y_data_box, hypre_Box *z_data_box ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatvecCompute_core_VC)( alpha, A, x, beta, y, z, Ab, xb, yb, zb, transpose, only_Ax, nentries, entries, start, stride, loop_size, xfstride, ran_stride, Adstride, xdstride, ydstride, zdstride, A_data_box, x_data_box, y_data_box, z_data_box ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatvecCompute_core_VCC( HYPRE_Complex alpha, hypre_StructMatrix *A, hypre_StructVector *x, HYPRE_Complex beta, hypre_StructVector *y, hypre_StructVector *z, HYPRE_Int Ab, HYPRE_Int xb, HYPRE_Int yb, HYPRE_Int zb, HYPRE_Int transpose, HYPRE_Int centry, HYPRE_Int nentries, HYPRE_Int *entries, hypre_IndexRef start, hypre_IndexRef stride, hypre_IndexRef loop_size, hypre_IndexRef xfstride, hypre_IndexRef ran_stride, hypre_IndexRef Adstride, hypre_IndexRef xdstride, hypre_IndexRef ydstride, hypre_IndexRef zdstride, hypre_Box *A_data_box, hypre_Box *x_data_box, hypre_Box *y_data_box, hypre_Box *z_data_box ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatvecCompute_core_VCC)( alpha, A, x, beta, y, z, Ab, xb, yb, zb, transpose, centry, nentries, entries, start, stride, loop_size, xfstride, ran_stride, Adstride, xdstride, ydstride, zdstride, A_data_box, x_data_box, y_data_box, z_data_box ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_StructMatvecCreate( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatvecCreate)( ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatvecDestroy( void *matvec_vdata ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatvecDestroy)( matvec_vdata ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatvecSetTranspose( void *matvec_vdata, HYPRE_Int transpose ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatvecSetTranspose)( matvec_vdata, transpose ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatvecSetup( void *matvec_vdata, hypre_StructMatrix *A, hypre_StructVector *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatvecSetup)( matvec_vdata, A, x ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatvecT( HYPRE_Complex alpha, hypre_StructMatrix *A, hypre_StructVector *x, HYPRE_Complex beta, hypre_StructVector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructMatvecT)( alpha, A, x, beta, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructNumGhostFromStencil( hypre_StructStencil *stencil, HYPRE_Int **num_ghost_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructNumGhostFromStencil)( stencil, num_ghost_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructPartialCopy( hypre_StructVector *x, hypre_StructVector *y, hypre_BoxArrayArray *array_boxes ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructPartialCopy)( x, y, array_boxes ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructScale( HYPRE_Complex alpha, hypre_StructVector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructScale)( alpha, y ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_StructStencil * +hypre_StructStencilCreate( HYPRE_Int dim, HYPRE_Int size, hypre_Index *shape ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructStencilCreate)( dim, size, shape ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructStencilDestroy( hypre_StructStencil *stencil ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructStencilDestroy)( stencil ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructStencilOffsetEntry( hypre_StructStencil *stencil, hypre_Index stencil_offset ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructStencilOffsetEntry)( stencil, stencil_offset ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructStencilPrint( FILE *file, hypre_StructStencil *stencil ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructStencilPrint)( file, stencil ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructStencilRead( FILE *file, HYPRE_Int ndim, hypre_StructStencil **stencil_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructStencilRead)( file, ndim, stencil_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_StructStencil * +hypre_StructStencilRef( hypre_StructStencil *stencil ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructStencilRef)( stencil ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructStencilSymmetrize( hypre_StructStencil *stencil, hypre_StructStencil **symm_stencil_ptr, HYPRE_Int **symm_offsets_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructStencilSymmetrize)( stencil, symm_stencil_ptr, symm_offsets_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorAssemble( hypre_StructVector *vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorAssemble)( vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorAxpy( HYPRE_Complex alpha, hypre_StructVector *x, HYPRE_Complex beta, hypre_StructVector *y, hypre_StructVector *z ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorAxpy)( alpha, x, beta, y, z ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorClearAllValues( hypre_StructVector *vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorClearAllValues)( vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorClearBoundGhostValues( hypre_StructVector *vector, HYPRE_Int force ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorClearBoundGhostValues)( vector, force ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorClearBoxValues( hypre_StructVector *vector, hypre_Box *clear_box, HYPRE_Int boxnum, HYPRE_Int outside ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorClearBoxValues)( vector, clear_box, boxnum, outside ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorClearGhostValues( hypre_StructVector *vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorClearGhostValues)( vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorClearValues( hypre_StructVector *vector, hypre_Index grid_index, HYPRE_Int boxnum, HYPRE_Int outside ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorClearValues)( vector, grid_index, boxnum, outside ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_StructVector * +hypre_StructVectorClone( hypre_StructVector *vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorClone)( vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorComputeDataSpace( hypre_StructVector *vector, hypre_IndexRef stride, HYPRE_Int *num_ghost, hypre_BoxArray **data_space_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorComputeDataSpace)( vector, stride, num_ghost, data_space_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_StructVector * +hypre_StructVectorCreate( MPI_Comm comm, hypre_StructGrid *grid ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorCreate)( comm, grid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorDestroy( hypre_StructVector *vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorDestroy)( vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorForget( hypre_StructVector *vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorForget)( vector ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_CommPkg * +hypre_StructVectorGetMigrateCommPkg( hypre_StructVector *from_vector, hypre_StructVector *to_vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorGetMigrateCommPkg)( from_vector, to_vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorInitialize( hypre_StructVector *vector, HYPRE_Int zero_init ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorInitialize)( vector, zero_init ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorInitializeData( hypre_StructVector *vector, HYPRE_Complex *data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorInitializeData)( vector, data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorInitializeShell( hypre_StructVector *vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorInitializeShell)( vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorMapCommInfo( hypre_StructVector *vector, hypre_CommInfo *comm_info ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorMapCommInfo)( vector, comm_info ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorMapDataBox( hypre_StructVector *vector, hypre_Box *dbox ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorMapDataBox)( vector, dbox ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorMapDataIndex( hypre_StructVector *vector, hypre_Index dindex ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorMapDataIndex)( vector, dindex ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorMapDataStride( hypre_StructVector *vector, hypre_Index dstride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorMapDataStride)( vector, dstride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorMigrate( hypre_CommPkg *comm_pkg, hypre_StructVector *from_vector, hypre_StructVector *to_vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorMigrate)( comm_pkg, from_vector, to_vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorNeedResize( hypre_StructVector *vector, hypre_BoxArray *data_space ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorNeedResize)( vector, data_space ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorPointwiseDivision( hypre_StructVector *x, hypre_StructVector *y, hypre_StructVector **z_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorPointwiseDivision)( x, y, z_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorPointwiseDivpy( HYPRE_Complex alpha, hypre_StructVector *x, hypre_StructVector *z, HYPRE_Complex beta, hypre_StructVector *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorPointwiseDivpy)( alpha, x, z, beta, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorPointwiseInverse( hypre_StructVector *x, hypre_StructVector **y_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorPointwiseInverse)( x, y_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorPointwiseProduct( hypre_StructVector *x, hypre_StructVector *y, hypre_StructVector **z_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorPointwiseProduct)( x, y, z_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorPrint( const char *filename, hypre_StructVector *vector, HYPRE_Int all ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorPrint)( filename, vector, all ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorPrintData( FILE *file, hypre_StructVector *vector, HYPRE_Int all ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorPrintData)( file, vector, all ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_StructVector * +hypre_StructVectorRead( MPI_Comm comm, const char *filename, HYPRE_Int *num_ghost ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorRead)( comm, filename, num_ghost ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorReadData( FILE *file, hypre_StructVector *vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorReadData)( file, vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorRebase( hypre_StructVector *vector, hypre_StructGrid *grid, hypre_Index stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorRebase)( vector, grid, stride ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_StructVector * +hypre_StructVectorRef( hypre_StructVector *vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorRef)( vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorResize( hypre_StructVector *vector, hypre_BoxArray *data_space ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorResize)( vector, data_space ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorRestore( hypre_StructVector *vector ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorRestore)( vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorScaleValues( hypre_StructVector *vector, HYPRE_Complex factor ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorScaleValues)( vector, factor ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorSetBoxValues)( vector, set_box, value_box, values, action, boxnum, outside ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorSetConstantValues( hypre_StructVector *vector, HYPRE_Complex value ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorSetConstantValues)( vector, value ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorSetDataSize( hypre_StructVector *vector, HYPRE_Int *data_size, HYPRE_Int *data_host_size ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorSetDataSize)( vector, data_size, data_host_size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorSetMemoryMode( hypre_StructVector *vector, HYPRE_Int memory_mode ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorSetMemoryMode)( vector, memory_mode ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorSetNumGhost( hypre_StructVector *vector, HYPRE_Int *num_ghost ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorSetNumGhost)( vector, num_ghost ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorSetRandomValues( hypre_StructVector *vector, HYPRE_Int seed ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorSetRandomValues)( vector, seed ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorSetStride( hypre_StructVector *vector, hypre_IndexRef stride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorSetStride)( vector, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorSetValues( hypre_StructVector *vector, hypre_Index grid_index, HYPRE_Complex *values, HYPRE_Int action, HYPRE_Int boxnum, HYPRE_Int outside ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorSetValues)( vector, grid_index, values, action, boxnum, outside ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorUnMapDataBox( hypre_StructVector *vector, hypre_Box *dbox ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorUnMapDataBox)( vector, dbox ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorUnMapDataIndex( hypre_StructVector *vector, hypre_Index dindex ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorUnMapDataIndex)( vector, dindex ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorUnMapDataStride( hypre_StructVector *vector, hypre_Index dstride ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_StructVectorUnMapDataStride)( vector, dstride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SubtractBoxArrays( hypre_BoxArray *box_array1, hypre_BoxArray *box_array2, hypre_BoxArray *tmp_box_array ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SubtractBoxArrays)( box_array1, box_array2, tmp_box_array ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SubtractBoxes( hypre_Box *box1, hypre_Box *box2, hypre_BoxArray *box_array ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SubtractBoxes)( box1, box2, box_array ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SubtractIndexes( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim, hypre_Index result ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SubtractIndexes)( index1, index2, ndim, result ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_UnionBoxes( hypre_BoxArray *boxes ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_UnionBoxes)( boxes ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +hypre_doubleBoxVolume( hypre_Box *box ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_doubleBoxVolume)( box ); +} + + +#endif + diff --git a/src/struct_mv/mup_functions.c b/src/struct_mv/mup_functions.c new file mode 100644 index 0000000000..94b23efcbc --- /dev/null +++ b/src/struct_mv/mup_functions.c @@ -0,0 +1,640 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_struct_mv.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_CommPkgDestroy( HYPRE_CommPkg comm_pkg ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_CommPkgDestroy_pre( precision, comm_pkg ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGridAssemble( HYPRE_StructGrid grid ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructGridAssemble_pre( precision, grid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGridCoarsen( HYPRE_StructGrid grid, HYPRE_Int *stride, HYPRE_StructGrid *cgrid ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructGridCoarsen_pre( precision, grid, stride, cgrid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGridCreate( MPI_Comm comm, HYPRE_Int ndim, HYPRE_StructGrid *grid ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructGridCreate_pre( precision, comm, ndim, grid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGridDestroy( HYPRE_StructGrid grid ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructGridDestroy_pre( precision, grid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGridPrintVTK( const char *filename, HYPRE_StructGrid grid ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructGridPrintVTK_pre( precision, filename, grid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGridProjectBox( HYPRE_StructGrid grid, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *origin, HYPRE_Int *stride ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructGridProjectBox_pre( precision, grid, ilower, iupper, origin, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGridSetExtents( HYPRE_StructGrid grid, HYPRE_Int *ilower, HYPRE_Int *iupper ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructGridSetExtents_pre( precision, grid, ilower, iupper ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGridSetNumGhost( HYPRE_StructGrid grid, HYPRE_Int *num_ghost ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructGridSetNumGhost_pre( precision, grid, num_ghost ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGridSetPeriodic( HYPRE_StructGrid grid, HYPRE_Int *periodic ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructGridSetPeriodic_pre( precision, grid, periodic ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixAddToBoxValues( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructMatrixAddToBoxValues_pre( precision, matrix, ilower, iupper, nentries, entries, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixAddToBoxValues2( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructMatrixAddToBoxValues2_pre( precision, matrix, ilower, iupper, nentries, entries, vilower, viupper, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixAddToConstantValues( HYPRE_StructMatrix matrix, HYPRE_Int nentries, HYPRE_Int *entries, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructMatrixAddToConstantValues_pre( precision, matrix, nentries, entries, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixAddToValues( HYPRE_StructMatrix matrix, HYPRE_Int *index, HYPRE_Int nentries, HYPRE_Int *entries, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructMatrixAddToValues_pre( precision, matrix, index, nentries, entries, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixAssemble( HYPRE_StructMatrix matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructMatrixAssemble_pre( precision, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixClearBoundary( HYPRE_StructMatrix matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructMatrixClearBoundary_pre( precision, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixCreate( MPI_Comm comm, HYPRE_StructGrid grid, HYPRE_StructStencil stencil, HYPRE_StructMatrix *matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructMatrixCreate_pre( precision, comm, grid, stencil, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixDestroy( HYPRE_StructMatrix matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructMatrixDestroy_pre( precision, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixGetBoxValues( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructMatrixGetBoxValues_pre( precision, matrix, ilower, iupper, nentries, entries, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixGetBoxValues2( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructMatrixGetBoxValues2_pre( precision, matrix, ilower, iupper, nentries, entries, vilower, viupper, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixGetGrid( HYPRE_StructMatrix matrix, HYPRE_StructGrid *grid ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructMatrixGetGrid_pre( precision, matrix, grid ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixGetValues( HYPRE_StructMatrix matrix, HYPRE_Int *index, HYPRE_Int nentries, HYPRE_Int *entries, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructMatrixGetValues_pre( precision, matrix, index, nentries, entries, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixInitialize( HYPRE_StructMatrix matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructMatrixInitialize_pre( precision, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixMatmat( HYPRE_StructMatrix A, HYPRE_Int Atranspose, HYPRE_StructMatrix B, HYPRE_Int Btranspose, HYPRE_StructMatrix *C ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructMatrixMatmat_pre( precision, A, Atranspose, B, Btranspose, C ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixMatvec( hypre_long_double alpha, HYPRE_StructMatrix A, HYPRE_StructVector x, hypre_long_double beta, HYPRE_StructVector y ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructMatrixMatvec_pre( precision, alpha, A, x, beta, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixMatvecT( hypre_long_double alpha, HYPRE_StructMatrix A, HYPRE_StructVector x, hypre_long_double beta, HYPRE_StructVector y ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructMatrixMatvecT_pre( precision, alpha, A, x, beta, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixPrint( const char *filename, HYPRE_StructMatrix matrix, HYPRE_Int all ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructMatrixPrint_pre( precision, filename, matrix, all ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixRead( MPI_Comm comm, const char *filename, HYPRE_Int *num_ghost, HYPRE_StructMatrix *matrix ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructMatrixRead_pre( precision, comm, filename, num_ghost, matrix ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixSetBoxValues( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructMatrixSetBoxValues_pre( precision, matrix, ilower, iupper, nentries, entries, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixSetBoxValues2( HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructMatrixSetBoxValues2_pre( precision, matrix, ilower, iupper, nentries, entries, vilower, viupper, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixSetConstantEntries( HYPRE_StructMatrix matrix, HYPRE_Int nentries, HYPRE_Int *entries ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructMatrixSetConstantEntries_pre( precision, matrix, nentries, entries ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixSetConstantValues( HYPRE_StructMatrix matrix, HYPRE_Int nentries, HYPRE_Int *entries, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructMatrixSetConstantValues_pre( precision, matrix, nentries, entries, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixSetDomainStride( HYPRE_StructMatrix matrix, HYPRE_Int *domain_stride ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructMatrixSetDomainStride_pre( precision, matrix, domain_stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixSetNumGhost( HYPRE_StructMatrix matrix, HYPRE_Int *num_ghost ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructMatrixSetNumGhost_pre( precision, matrix, num_ghost ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixSetRangeStride( HYPRE_StructMatrix matrix, HYPRE_Int *range_stride ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructMatrixSetRangeStride_pre( precision, matrix, range_stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixSetSymmetric( HYPRE_StructMatrix matrix, HYPRE_Int symmetric ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructMatrixSetSymmetric_pre( precision, matrix, symmetric ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixSetTranspose( HYPRE_StructMatrix matrix, HYPRE_Int transpose ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructMatrixSetTranspose_pre( precision, matrix, transpose ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixSetValues( HYPRE_StructMatrix matrix, HYPRE_Int *index, HYPRE_Int nentries, HYPRE_Int *entries, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructMatrixSetValues_pre( precision, matrix, index, nentries, entries, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructStencilCreate( HYPRE_Int ndim, HYPRE_Int size, HYPRE_StructStencil *stencil ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructStencilCreate_pre( precision, ndim, size, stencil ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructStencilDestroy( HYPRE_StructStencil stencil ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructStencilDestroy_pre( precision, stencil ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructStencilSetElement( HYPRE_StructStencil stencil, HYPRE_Int entry, HYPRE_Int *offset ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructStencilSetElement_pre( precision, stencil, entry, offset ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructStencilSetEntry( HYPRE_StructStencil stencil, HYPRE_Int entry, HYPRE_Int *offset ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructStencilSetEntry_pre( precision, stencil, entry, offset ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorAddToBoxValues( HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructVectorAddToBoxValues_pre( precision, vector, ilower, iupper, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorAddToBoxValues2( HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructVectorAddToBoxValues2_pre( precision, vector, ilower, iupper, vilower, viupper, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorAddToValues( HYPRE_StructVector vector, HYPRE_Int *index, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructVectorAddToValues_pre( precision, vector, index, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorAssemble( HYPRE_StructVector vector ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructVectorAssemble_pre( precision, vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorAxpy( hypre_long_double alpha, HYPRE_StructVector x, hypre_long_double beta, HYPRE_StructVector y ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructVectorAxpy_pre( precision, alpha, x, beta, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorClone( HYPRE_StructVector x, HYPRE_StructVector *y_ptr ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructVectorClone_pre( precision, x, y_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorCopy( HYPRE_StructVector x, HYPRE_StructVector y ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructVectorCopy_pre( precision, x, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorCreate( MPI_Comm comm, HYPRE_StructGrid grid, HYPRE_StructVector *vector ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructVectorCreate_pre( precision, comm, grid, vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorDestroy( HYPRE_StructVector vector ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructVectorDestroy_pre( precision, vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorGetBoxValues( HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructVectorGetBoxValues_pre( precision, vector, ilower, iupper, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorGetBoxValues2( HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructVectorGetBoxValues2_pre( precision, vector, ilower, iupper, vilower, viupper, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorGetMigrateCommPkg( HYPRE_StructVector from_vector, HYPRE_StructVector to_vector, HYPRE_CommPkg *comm_pkg ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructVectorGetMigrateCommPkg_pre( precision, from_vector, to_vector, comm_pkg ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorGetValues( HYPRE_StructVector vector, HYPRE_Int *index, void *value ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructVectorGetValues_pre( precision, vector, index, value ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorInitialize( HYPRE_StructVector vector ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructVectorInitialize_pre( precision, vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorInnerProd( HYPRE_StructVector x, HYPRE_StructVector y, void *result ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructVectorInnerProd_pre( precision, x, y, result ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorMigrate( HYPRE_CommPkg comm_pkg, HYPRE_StructVector from_vector, HYPRE_StructVector to_vector ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructVectorMigrate_pre( precision, comm_pkg, from_vector, to_vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorPrint( const char *filename, HYPRE_StructVector vector, HYPRE_Int all ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructVectorPrint_pre( precision, filename, vector, all ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorRead( MPI_Comm comm, const char *filename, HYPRE_Int *num_ghost, HYPRE_StructVector *vector ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructVectorRead_pre( precision, comm, filename, num_ghost, vector ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorScale( hypre_long_double alpha, HYPRE_StructVector y ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructVectorScale_pre( precision, alpha, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorScaleValues( HYPRE_StructVector vector, hypre_long_double factor ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructVectorScaleValues_pre( precision, vector, factor ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorSetBoxValues( HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructVectorSetBoxValues_pre( precision, vector, ilower, iupper, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorSetBoxValues2( HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructVectorSetBoxValues2_pre( precision, vector, ilower, iupper, vilower, viupper, values ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorSetConstantValues( HYPRE_StructVector vector, hypre_long_double value ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructVectorSetConstantValues_pre( precision, vector, value ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorSetNumGhost( HYPRE_StructVector vector, HYPRE_Int *num_ghost ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructVectorSetNumGhost_pre( precision, vector, num_ghost ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorSetRandomValues( HYPRE_StructVector vector, HYPRE_Int seed ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructVectorSetRandomValues_pre( precision, vector, seed ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorSetStride( HYPRE_StructVector vector, HYPRE_Int *stride ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructVectorSetStride_pre( precision, vector, stride ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorSetValues( HYPRE_StructVector vector, HYPRE_Int *index, void *values ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_StructVectorSetValues_pre( precision, vector, index, values ); +} + + + +#endif + diff --git a/src/struct_mv/mup_pre.c b/src/struct_mv/mup_pre.c new file mode 100644 index 0000000000..0cbacb140a --- /dev/null +++ b/src/struct_mv/mup_pre.c @@ -0,0 +1,1261 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_struct_mv.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_CommPkgDestroy_pre( HYPRE_Precision precision, HYPRE_CommPkg comm_pkg ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_CommPkgDestroy_flt( comm_pkg ); + case HYPRE_REAL_DOUBLE: + return HYPRE_CommPkgDestroy_dbl( comm_pkg ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_CommPkgDestroy_long_dbl( comm_pkg ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGridAssemble_pre( HYPRE_Precision precision, HYPRE_StructGrid grid ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructGridAssemble_flt( grid ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructGridAssemble_dbl( grid ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructGridAssemble_long_dbl( grid ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGridCoarsen_pre( HYPRE_Precision precision, HYPRE_StructGrid grid, HYPRE_Int *stride, HYPRE_StructGrid *cgrid ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructGridCoarsen_flt( grid, stride, cgrid ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructGridCoarsen_dbl( grid, stride, cgrid ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructGridCoarsen_long_dbl( grid, stride, cgrid ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGridCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_Int ndim, HYPRE_StructGrid *grid ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructGridCreate_flt( comm, ndim, grid ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructGridCreate_dbl( comm, ndim, grid ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructGridCreate_long_dbl( comm, ndim, grid ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGridDestroy_pre( HYPRE_Precision precision, HYPRE_StructGrid grid ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructGridDestroy_flt( grid ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructGridDestroy_dbl( grid ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructGridDestroy_long_dbl( grid ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGridPrintVTK_pre( HYPRE_Precision precision, const char *filename, HYPRE_StructGrid grid ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructGridPrintVTK_flt( filename, grid ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructGridPrintVTK_dbl( filename, grid ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructGridPrintVTK_long_dbl( filename, grid ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGridProjectBox_pre( HYPRE_Precision precision, HYPRE_StructGrid grid, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *origin, HYPRE_Int *stride ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructGridProjectBox_flt( grid, ilower, iupper, origin, stride ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructGridProjectBox_dbl( grid, ilower, iupper, origin, stride ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructGridProjectBox_long_dbl( grid, ilower, iupper, origin, stride ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGridSetExtents_pre( HYPRE_Precision precision, HYPRE_StructGrid grid, HYPRE_Int *ilower, HYPRE_Int *iupper ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructGridSetExtents_flt( grid, ilower, iupper ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructGridSetExtents_dbl( grid, ilower, iupper ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructGridSetExtents_long_dbl( grid, ilower, iupper ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGridSetNumGhost_pre( HYPRE_Precision precision, HYPRE_StructGrid grid, HYPRE_Int *num_ghost ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructGridSetNumGhost_flt( grid, num_ghost ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructGridSetNumGhost_dbl( grid, num_ghost ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructGridSetNumGhost_long_dbl( grid, num_ghost ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructGridSetPeriodic_pre( HYPRE_Precision precision, HYPRE_StructGrid grid, HYPRE_Int *periodic ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructGridSetPeriodic_flt( grid, periodic ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructGridSetPeriodic_dbl( grid, periodic ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructGridSetPeriodic_long_dbl( grid, periodic ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixAddToBoxValues_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructMatrixAddToBoxValues_flt( matrix, ilower, iupper, nentries, entries, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructMatrixAddToBoxValues_dbl( matrix, ilower, iupper, nentries, entries, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructMatrixAddToBoxValues_long_dbl( matrix, ilower, iupper, nentries, entries, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixAddToBoxValues2_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructMatrixAddToBoxValues2_flt( matrix, ilower, iupper, nentries, entries, vilower, viupper, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructMatrixAddToBoxValues2_dbl( matrix, ilower, iupper, nentries, entries, vilower, viupper, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructMatrixAddToBoxValues2_long_dbl( matrix, ilower, iupper, nentries, entries, vilower, viupper, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixAddToConstantValues_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int nentries, HYPRE_Int *entries, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructMatrixAddToConstantValues_flt( matrix, nentries, entries, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructMatrixAddToConstantValues_dbl( matrix, nentries, entries, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructMatrixAddToConstantValues_long_dbl( matrix, nentries, entries, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixAddToValues_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int *index, HYPRE_Int nentries, HYPRE_Int *entries, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructMatrixAddToValues_flt( matrix, index, nentries, entries, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructMatrixAddToValues_dbl( matrix, index, nentries, entries, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructMatrixAddToValues_long_dbl( matrix, index, nentries, entries, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixAssemble_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructMatrixAssemble_flt( matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructMatrixAssemble_dbl( matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructMatrixAssemble_long_dbl( matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixClearBoundary_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructMatrixClearBoundary_flt( matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructMatrixClearBoundary_dbl( matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructMatrixClearBoundary_long_dbl( matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_StructGrid grid, HYPRE_StructStencil stencil, HYPRE_StructMatrix *matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructMatrixCreate_flt( comm, grid, stencil, matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructMatrixCreate_dbl( comm, grid, stencil, matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructMatrixCreate_long_dbl( comm, grid, stencil, matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixDestroy_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructMatrixDestroy_flt( matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructMatrixDestroy_dbl( matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructMatrixDestroy_long_dbl( matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixGetBoxValues_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructMatrixGetBoxValues_flt( matrix, ilower, iupper, nentries, entries, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructMatrixGetBoxValues_dbl( matrix, ilower, iupper, nentries, entries, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructMatrixGetBoxValues_long_dbl( matrix, ilower, iupper, nentries, entries, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixGetBoxValues2_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructMatrixGetBoxValues2_flt( matrix, ilower, iupper, nentries, entries, vilower, viupper, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructMatrixGetBoxValues2_dbl( matrix, ilower, iupper, nentries, entries, vilower, viupper, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructMatrixGetBoxValues2_long_dbl( matrix, ilower, iupper, nentries, entries, vilower, viupper, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixGetGrid_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_StructGrid *grid ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructMatrixGetGrid_flt( matrix, grid ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructMatrixGetGrid_dbl( matrix, grid ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructMatrixGetGrid_long_dbl( matrix, grid ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixGetValues_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int *index, HYPRE_Int nentries, HYPRE_Int *entries, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructMatrixGetValues_flt( matrix, index, nentries, entries, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructMatrixGetValues_dbl( matrix, index, nentries, entries, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructMatrixGetValues_long_dbl( matrix, index, nentries, entries, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixInitialize_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructMatrixInitialize_flt( matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructMatrixInitialize_dbl( matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructMatrixInitialize_long_dbl( matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixMatmat_pre( HYPRE_Precision precision, HYPRE_StructMatrix A, HYPRE_Int Atranspose, HYPRE_StructMatrix B, HYPRE_Int Btranspose, HYPRE_StructMatrix *C ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructMatrixMatmat_flt( A, Atranspose, B, Btranspose, C ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructMatrixMatmat_dbl( A, Atranspose, B, Btranspose, C ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructMatrixMatmat_long_dbl( A, Atranspose, B, Btranspose, C ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixMatvec_pre( HYPRE_Precision precision, hypre_long_double alpha, HYPRE_StructMatrix A, HYPRE_StructVector x, hypre_long_double beta, HYPRE_StructVector y ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructMatrixMatvec_flt( alpha, A, x, beta, y ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructMatrixMatvec_dbl( alpha, A, x, beta, y ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructMatrixMatvec_long_dbl( alpha, A, x, beta, y ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixMatvecT_pre( HYPRE_Precision precision, hypre_long_double alpha, HYPRE_StructMatrix A, HYPRE_StructVector x, hypre_long_double beta, HYPRE_StructVector y ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructMatrixMatvecT_flt( alpha, A, x, beta, y ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructMatrixMatvecT_dbl( alpha, A, x, beta, y ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructMatrixMatvecT_long_dbl( alpha, A, x, beta, y ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixPrint_pre( HYPRE_Precision precision, const char *filename, HYPRE_StructMatrix matrix, HYPRE_Int all ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructMatrixPrint_flt( filename, matrix, all ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructMatrixPrint_dbl( filename, matrix, all ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructMatrixPrint_long_dbl( filename, matrix, all ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixRead_pre( HYPRE_Precision precision, MPI_Comm comm, const char *filename, HYPRE_Int *num_ghost, HYPRE_StructMatrix *matrix ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructMatrixRead_flt( comm, filename, num_ghost, matrix ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructMatrixRead_dbl( comm, filename, num_ghost, matrix ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructMatrixRead_long_dbl( comm, filename, num_ghost, matrix ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixSetBoxValues_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructMatrixSetBoxValues_flt( matrix, ilower, iupper, nentries, entries, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructMatrixSetBoxValues_dbl( matrix, ilower, iupper, nentries, entries, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructMatrixSetBoxValues_long_dbl( matrix, ilower, iupper, nentries, entries, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixSetBoxValues2_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int nentries, HYPRE_Int *entries, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructMatrixSetBoxValues2_flt( matrix, ilower, iupper, nentries, entries, vilower, viupper, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructMatrixSetBoxValues2_dbl( matrix, ilower, iupper, nentries, entries, vilower, viupper, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructMatrixSetBoxValues2_long_dbl( matrix, ilower, iupper, nentries, entries, vilower, viupper, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixSetConstantEntries_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int nentries, HYPRE_Int *entries ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructMatrixSetConstantEntries_flt( matrix, nentries, entries ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructMatrixSetConstantEntries_dbl( matrix, nentries, entries ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructMatrixSetConstantEntries_long_dbl( matrix, nentries, entries ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixSetConstantValues_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int nentries, HYPRE_Int *entries, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructMatrixSetConstantValues_flt( matrix, nentries, entries, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructMatrixSetConstantValues_dbl( matrix, nentries, entries, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructMatrixSetConstantValues_long_dbl( matrix, nentries, entries, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixSetDomainStride_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int *domain_stride ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructMatrixSetDomainStride_flt( matrix, domain_stride ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructMatrixSetDomainStride_dbl( matrix, domain_stride ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructMatrixSetDomainStride_long_dbl( matrix, domain_stride ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixSetNumGhost_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int *num_ghost ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructMatrixSetNumGhost_flt( matrix, num_ghost ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructMatrixSetNumGhost_dbl( matrix, num_ghost ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructMatrixSetNumGhost_long_dbl( matrix, num_ghost ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixSetRangeStride_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int *range_stride ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructMatrixSetRangeStride_flt( matrix, range_stride ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructMatrixSetRangeStride_dbl( matrix, range_stride ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructMatrixSetRangeStride_long_dbl( matrix, range_stride ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixSetSymmetric_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int symmetric ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructMatrixSetSymmetric_flt( matrix, symmetric ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructMatrixSetSymmetric_dbl( matrix, symmetric ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructMatrixSetSymmetric_long_dbl( matrix, symmetric ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixSetTranspose_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int transpose ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructMatrixSetTranspose_flt( matrix, transpose ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructMatrixSetTranspose_dbl( matrix, transpose ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructMatrixSetTranspose_long_dbl( matrix, transpose ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructMatrixSetValues_pre( HYPRE_Precision precision, HYPRE_StructMatrix matrix, HYPRE_Int *index, HYPRE_Int nentries, HYPRE_Int *entries, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructMatrixSetValues_flt( matrix, index, nentries, entries, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructMatrixSetValues_dbl( matrix, index, nentries, entries, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructMatrixSetValues_long_dbl( matrix, index, nentries, entries, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructStencilCreate_pre( HYPRE_Precision precision, HYPRE_Int ndim, HYPRE_Int size, HYPRE_StructStencil *stencil ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructStencilCreate_flt( ndim, size, stencil ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructStencilCreate_dbl( ndim, size, stencil ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructStencilCreate_long_dbl( ndim, size, stencil ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructStencilDestroy_pre( HYPRE_Precision precision, HYPRE_StructStencil stencil ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructStencilDestroy_flt( stencil ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructStencilDestroy_dbl( stencil ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructStencilDestroy_long_dbl( stencil ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructStencilSetElement_pre( HYPRE_Precision precision, HYPRE_StructStencil stencil, HYPRE_Int entry, HYPRE_Int *offset ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructStencilSetElement_flt( stencil, entry, offset ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructStencilSetElement_dbl( stencil, entry, offset ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructStencilSetElement_long_dbl( stencil, entry, offset ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructStencilSetEntry_pre( HYPRE_Precision precision, HYPRE_StructStencil stencil, HYPRE_Int entry, HYPRE_Int *offset ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructStencilSetEntry_flt( stencil, entry, offset ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructStencilSetEntry_dbl( stencil, entry, offset ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructStencilSetEntry_long_dbl( stencil, entry, offset ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorAddToBoxValues_pre( HYPRE_Precision precision, HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructVectorAddToBoxValues_flt( vector, ilower, iupper, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructVectorAddToBoxValues_dbl( vector, ilower, iupper, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructVectorAddToBoxValues_long_dbl( vector, ilower, iupper, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorAddToBoxValues2_pre( HYPRE_Precision precision, HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructVectorAddToBoxValues2_flt( vector, ilower, iupper, vilower, viupper, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructVectorAddToBoxValues2_dbl( vector, ilower, iupper, vilower, viupper, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructVectorAddToBoxValues2_long_dbl( vector, ilower, iupper, vilower, viupper, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorAddToValues_pre( HYPRE_Precision precision, HYPRE_StructVector vector, HYPRE_Int *index, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructVectorAddToValues_flt( vector, index, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructVectorAddToValues_dbl( vector, index, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructVectorAddToValues_long_dbl( vector, index, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorAssemble_pre( HYPRE_Precision precision, HYPRE_StructVector vector ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructVectorAssemble_flt( vector ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructVectorAssemble_dbl( vector ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructVectorAssemble_long_dbl( vector ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorAxpy_pre( HYPRE_Precision precision, hypre_long_double alpha, HYPRE_StructVector x, hypre_long_double beta, HYPRE_StructVector y ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructVectorAxpy_flt( alpha, x, beta, y ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructVectorAxpy_dbl( alpha, x, beta, y ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructVectorAxpy_long_dbl( alpha, x, beta, y ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorClone_pre( HYPRE_Precision precision, HYPRE_StructVector x, HYPRE_StructVector *y_ptr ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructVectorClone_flt( x, y_ptr ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructVectorClone_dbl( x, y_ptr ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructVectorClone_long_dbl( x, y_ptr ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorCopy_pre( HYPRE_Precision precision, HYPRE_StructVector x, HYPRE_StructVector y ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructVectorCopy_flt( x, y ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructVectorCopy_dbl( x, y ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructVectorCopy_long_dbl( x, y ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorCreate_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_StructGrid grid, HYPRE_StructVector *vector ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructVectorCreate_flt( comm, grid, vector ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructVectorCreate_dbl( comm, grid, vector ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructVectorCreate_long_dbl( comm, grid, vector ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorDestroy_pre( HYPRE_Precision precision, HYPRE_StructVector vector ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructVectorDestroy_flt( vector ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructVectorDestroy_dbl( vector ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructVectorDestroy_long_dbl( vector ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorGetBoxValues_pre( HYPRE_Precision precision, HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructVectorGetBoxValues_flt( vector, ilower, iupper, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructVectorGetBoxValues_dbl( vector, ilower, iupper, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructVectorGetBoxValues_long_dbl( vector, ilower, iupper, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorGetBoxValues2_pre( HYPRE_Precision precision, HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructVectorGetBoxValues2_flt( vector, ilower, iupper, vilower, viupper, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructVectorGetBoxValues2_dbl( vector, ilower, iupper, vilower, viupper, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructVectorGetBoxValues2_long_dbl( vector, ilower, iupper, vilower, viupper, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorGetMigrateCommPkg_pre( HYPRE_Precision precision, HYPRE_StructVector from_vector, HYPRE_StructVector to_vector, HYPRE_CommPkg *comm_pkg ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructVectorGetMigrateCommPkg_flt( from_vector, to_vector, comm_pkg ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructVectorGetMigrateCommPkg_dbl( from_vector, to_vector, comm_pkg ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructVectorGetMigrateCommPkg_long_dbl( from_vector, to_vector, comm_pkg ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorGetValues_pre( HYPRE_Precision precision, HYPRE_StructVector vector, HYPRE_Int *index, void *value ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructVectorGetValues_flt( vector, index, value ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructVectorGetValues_dbl( vector, index, value ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructVectorGetValues_long_dbl( vector, index, value ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorInitialize_pre( HYPRE_Precision precision, HYPRE_StructVector vector ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructVectorInitialize_flt( vector ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructVectorInitialize_dbl( vector ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructVectorInitialize_long_dbl( vector ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorInnerProd_pre( HYPRE_Precision precision, HYPRE_StructVector x, HYPRE_StructVector y, void *result ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructVectorInnerProd_flt( x, y, result ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructVectorInnerProd_dbl( x, y, result ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructVectorInnerProd_long_dbl( x, y, result ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorMigrate_pre( HYPRE_Precision precision, HYPRE_CommPkg comm_pkg, HYPRE_StructVector from_vector, HYPRE_StructVector to_vector ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructVectorMigrate_flt( comm_pkg, from_vector, to_vector ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructVectorMigrate_dbl( comm_pkg, from_vector, to_vector ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructVectorMigrate_long_dbl( comm_pkg, from_vector, to_vector ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorPrint_pre( HYPRE_Precision precision, const char *filename, HYPRE_StructVector vector, HYPRE_Int all ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructVectorPrint_flt( filename, vector, all ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructVectorPrint_dbl( filename, vector, all ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructVectorPrint_long_dbl( filename, vector, all ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorRead_pre( HYPRE_Precision precision, MPI_Comm comm, const char *filename, HYPRE_Int *num_ghost, HYPRE_StructVector *vector ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructVectorRead_flt( comm, filename, num_ghost, vector ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructVectorRead_dbl( comm, filename, num_ghost, vector ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructVectorRead_long_dbl( comm, filename, num_ghost, vector ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorScale_pre( HYPRE_Precision precision, hypre_long_double alpha, HYPRE_StructVector y ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructVectorScale_flt( alpha, y ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructVectorScale_dbl( alpha, y ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructVectorScale_long_dbl( alpha, y ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorScaleValues_pre( HYPRE_Precision precision, HYPRE_StructVector vector, hypre_long_double factor ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructVectorScaleValues_flt( vector, factor ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructVectorScaleValues_dbl( vector, factor ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructVectorScaleValues_long_dbl( vector, factor ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorSetBoxValues_pre( HYPRE_Precision precision, HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructVectorSetBoxValues_flt( vector, ilower, iupper, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructVectorSetBoxValues_dbl( vector, ilower, iupper, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructVectorSetBoxValues_long_dbl( vector, ilower, iupper, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorSetBoxValues2_pre( HYPRE_Precision precision, HYPRE_StructVector vector, HYPRE_Int *ilower, HYPRE_Int *iupper, HYPRE_Int *vilower, HYPRE_Int *viupper, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructVectorSetBoxValues2_flt( vector, ilower, iupper, vilower, viupper, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructVectorSetBoxValues2_dbl( vector, ilower, iupper, vilower, viupper, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructVectorSetBoxValues2_long_dbl( vector, ilower, iupper, vilower, viupper, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorSetConstantValues_pre( HYPRE_Precision precision, HYPRE_StructVector vector, hypre_long_double value ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructVectorSetConstantValues_flt( vector, value ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructVectorSetConstantValues_dbl( vector, value ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructVectorSetConstantValues_long_dbl( vector, value ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorSetNumGhost_pre( HYPRE_Precision precision, HYPRE_StructVector vector, HYPRE_Int *num_ghost ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructVectorSetNumGhost_flt( vector, num_ghost ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructVectorSetNumGhost_dbl( vector, num_ghost ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructVectorSetNumGhost_long_dbl( vector, num_ghost ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorSetRandomValues_pre( HYPRE_Precision precision, HYPRE_StructVector vector, HYPRE_Int seed ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructVectorSetRandomValues_flt( vector, seed ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructVectorSetRandomValues_dbl( vector, seed ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructVectorSetRandomValues_long_dbl( vector, seed ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorSetStride_pre( HYPRE_Precision precision, HYPRE_StructVector vector, HYPRE_Int *stride ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructVectorSetStride_flt( vector, stride ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructVectorSetStride_dbl( vector, stride ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructVectorSetStride_long_dbl( vector, stride ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_StructVectorSetValues_pre( HYPRE_Precision precision, HYPRE_StructVector vector, HYPRE_Int *index, void *values ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_StructVectorSetValues_flt( vector, index, values ); + case HYPRE_REAL_DOUBLE: + return HYPRE_StructVectorSetValues_dbl( vector, index, values ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_StructVectorSetValues_long_dbl( vector, index, values ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + + + +#endif + diff --git a/src/struct_mv/project.c b/src/struct_mv/project.c index 3aad220052..5667551c7d 100644 --- a/src/struct_mv/project.c +++ b/src/struct_mv/project.c @@ -5,79 +5,147 @@ * SPDX-License-Identifier: (Apache-2.0 OR MIT) ******************************************************************************/ -/****************************************************************************** - * - * Projection routines. - * - *****************************************************************************/ - #include "_hypre_struct_mv.h" /*-------------------------------------------------------------------------- - * hypre_ProjectBox: - * Projects a box onto a strided index space that contains the - * index `index' and has stride `stride'. + * Snap 'index' in the positive direction to the nearest point in the strided + * index space that contains index 'origin' and has stride 'stride'. * - * Note: An "empty" projection is represented by a box with volume 0. + * If 'origin' is NULL, a zero origin is used. + * + * This is equivalent to: + * index = ceil( (index - origin) / stride ) * stride *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_ProjectBox( hypre_Box *box, - hypre_Index index, - hypre_Index stride ) +hypre_SnapIndexPos( hypre_Index index, + hypre_IndexRef origin, + hypre_Index stride, + HYPRE_Int ndim ) { - HYPRE_Int i, s, d, hl, hu, kl, ku, ndim = hypre_BoxNDim(box); - - /*------------------------------------------------------ - * project in all ndim dimensions - *------------------------------------------------------*/ + HYPRE_Int d, s; for (d = 0; d < ndim; d++) { + if (origin != NULL) + { + s = (index[d] - origin[d]) % stride[d]; + } + else + { + s = index[d] % stride[d]; + } + if (s > 0) + { + index[d] += -s + stride[d]; + } + else if (s < 0) + { + index[d] += -s; + } + } - i = hypre_IndexD(index, d); - s = hypre_IndexD(stride, d); + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Snap 'index' in the negative direction to the nearest point in the strided + * index space that contains index 'origin' and has stride 'stride'. + * + * If 'origin' is NULL, a zero origin is used. + * + * This is equivalent to: + * index = floor( (index - origin) / stride ) * stride + *--------------------------------------------------------------------------*/ - hl = hypre_BoxIMinD(box, d) - i; - hu = hypre_BoxIMaxD(box, d) - i; +HYPRE_Int +hypre_SnapIndexNeg( hypre_Index index, + hypre_IndexRef origin, + hypre_Index stride, + HYPRE_Int ndim ) +{ + HYPRE_Int d, s; - if ( hl <= 0 ) + for (d = 0; d < ndim; d++) + { + if (origin != NULL) { - kl = (HYPRE_Int) (hl / s); + s = (index[d] - origin[d]) % stride[d]; } else { - kl = (HYPRE_Int) ((hl + (s - 1)) / s); + s = index[d] % stride[d]; } - - if ( hu >= 0 ) + if (s > 0) { - ku = (HYPRE_Int) (hu / s); + index[d] += -s; } - else + else if (s < 0) { - ku = (HYPRE_Int) ((hu - (s - 1)) / s); + index[d] += -s - stride[d]; } + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Convert 'index' to a canonical index in the interval [0, 'stride'). + * + * If 'origin' is NULL, a zero origin is used. + *--------------------------------------------------------------------------*/ - hypre_BoxIMinD(box, d) = i + kl * s; - hypre_BoxIMaxD(box, d) = i + ku * s; +HYPRE_Int +hypre_ConvertToCanonicalIndex( hypre_Index index, + hypre_Index stride, + HYPRE_Int ndim ) +{ + HYPRE_Int d; + + for (d = 0; d < ndim; d++) + { + index[d] %= stride[d]; + if (index[d] < 0) + { + index[d] += stride[d]; + } } return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_ProjectBoxArray: + * Projects a box onto a strided index space that contains the index 'origin' + * and has stride 'stride'. * - * Note: The dimensions of the modified box array are not changed. - * So, it is possible to have boxes with volume 0. + * An "empty" projection is represented by a box with volume 0. + * If 'origin' is NULL, a zero origin is used. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ProjectBox( hypre_Box *box, + hypre_IndexRef origin, + hypre_Index stride ) +{ + HYPRE_Int ndim = hypre_BoxNDim(box); + + hypre_SnapIndexPos(hypre_BoxIMin(box), origin, stride, ndim); + hypre_SnapIndexNeg(hypre_BoxIMax(box), origin, stride, ndim); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * The dimensions of the modified box array are not changed. + * It is possible to have boxes with volume 0. + * If 'origin' is NULL, a zero origin is used. *--------------------------------------------------------------------------*/ HYPRE_Int hypre_ProjectBoxArray( hypre_BoxArray *box_array, - hypre_Index index, - hypre_Index stride ) + hypre_IndexRef origin, + hypre_Index stride ) { hypre_Box *box; HYPRE_Int i; @@ -85,23 +153,22 @@ hypre_ProjectBoxArray( hypre_BoxArray *box_array, hypre_ForBoxI(i, box_array) { box = hypre_BoxArrayBox(box_array, i); - hypre_ProjectBox(box, index, stride); + hypre_ProjectBox(box, origin, stride); } return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_ProjectBoxArrayArray: - * - * Note: The dimensions of the modified box array-array are not changed. - * So, it is possible to have boxes with volume 0. + * The dimensions of the modified box array-array are not changed. + * It is possible to have boxes with volume 0. + * If 'origin' is NULL, a zero origin is used. *--------------------------------------------------------------------------*/ HYPRE_Int hypre_ProjectBoxArrayArray( hypre_BoxArrayArray *box_array_array, - hypre_Index index, - hypre_Index stride ) + hypre_IndexRef origin, + hypre_Index stride ) { hypre_BoxArray *box_array; hypre_Box *box; @@ -113,10 +180,9 @@ hypre_ProjectBoxArrayArray( hypre_BoxArrayArray *box_array_array, hypre_ForBoxI(j, box_array) { box = hypre_BoxArrayBox(box_array, j); - hypre_ProjectBox(box, index, stride); + hypre_ProjectBox(box, origin, stride); } } return hypre_error_flag; } - diff --git a/src/struct_mv/protos.h b/src/struct_mv/protos.h index 1adabe15d6..c353b5f65a 100644 --- a/src/struct_mv/protos.h +++ b/src/struct_mv/protos.h @@ -17,22 +17,32 @@ HYPRE_Int hypre_APShrinkRegions ( hypre_BoxArray *region_array, hypre_BoxArray * 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 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, + HYPRE_Real global_boxes_size, + HYPRE_Int global_num_boxes, hypre_BoxArray *local_boxes, + 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 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 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_Box *box, + HYPRE_Int *num_proc_array, HYPRE_Int *size_alloc_proc_array, HYPRE_Int **p_proc_array ); +HYPRE_Int hypre_StructAssumedPartitionPrint ( const char *filename, hypre_StructAssumedPart *ap ); +HYPRE_Int hypre_StructCoarsenAP ( hypre_StructAssumedPart *ap, hypre_Index origin, + hypre_Index stride, + hypre_StructAssumedPart **new_ap_ptr ); /* box_algebra.c */ +HYPRE_Int hypre_BoxSplit ( hypre_Box *box, hypre_Index index, hypre_Box **lbox_ptr, + hypre_Box **rbox_ptr ); 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, @@ -46,62 +56,109 @@ HYPRE_Int hypre_BoxBoundaryIntersect ( hypre_Box *box, hypre_StructGrid *grid, H 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_GeneralBoxBoundaryIntersect ( hypre_Box *box, hypre_StructGrid *grid, + hypre_Index stencil_offset, 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_CopyIndex ( hypre_Index in_index, hypre_Index out_index ); +HYPRE_Int hypre_CopyToIndex ( hypre_Index in_index, HYPRE_Int ndim, 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_IndexMin ( hypre_Index index, HYPRE_Int ndim ); +HYPRE_Int hypre_IndexMax ( hypre_Index index, HYPRE_Int ndim ); +HYPRE_Int hypre_IndexElementMult ( 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_IndexesGreater ( hypre_Index index1, hypre_Index index2, HYPRE_Int ndim ); +HYPRE_Int hypre_IndexesGreaterEqual ( 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_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_CopyBox ( hypre_Box *box1, hypre_Box *box2 ); +hypre_Box *hypre_BoxClone ( hypre_Box *box ); HYPRE_Int hypre_BoxVolume( hypre_Box *box ); -HYPRE_Real hypre_doubleBoxVolume( hypre_Box *box ); +HYPRE_Real hypre_doubleBoxVolume ( hypre_Box *box ); +HYPRE_Int hypre_BoxStrideVolume ( hypre_Box *box, hypre_Index stride ); +HYPRE_Int hypre_BoxPartialVolume ( hypre_Box *box, hypre_Index partial_volume); +HYPRE_Int hypre_BoxNnodes ( hypre_Box *box ); HYPRE_Int hypre_IndexInBox ( hypre_Index index, hypre_Box *box ); +HYPRE_Int hypre_BoxInBox ( hypre_Box *box1, hypre_Box *box2 ); +HYPRE_Int hypre_BoxesEqual ( hypre_Box *box1, hypre_Box *box2 ); +HYPRE_Int hypre_BoxMaxSize ( 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_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_BoxGrowByBox ( hypre_Box *box, hypre_Box *gbox ); HYPRE_Int hypre_BoxGrowByArray ( hypre_Box *box, HYPRE_Int *array ); HYPRE_Int hypre_BoxPrint ( FILE *file, hypre_Box *box ); +HYPRE_Int hypre_BoxPrintDebug( const char *prefix, 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_BoxArrayCreateFromIndices ( HYPRE_Int ndim, HYPRE_Int num_indices_in, + HYPRE_Int **indices_in, HYPRE_Real threshold, + hypre_BoxArray **box_array_ptr ); HYPRE_Int hypre_BoxArrayDestroy ( hypre_BoxArray *box_array ); +HYPRE_Int hypre_BoxArrayPrintToFile ( FILE *file, hypre_BoxArray *box_array ); +HYPRE_Int hypre_BoxArrayReadFromFile( FILE *file, hypre_BoxArray **box_array_ptr ); +HYPRE_Int hypre_BoxArrayPrint ( MPI_Comm comm, const char *filename, hypre_BoxArray *box_array ); HYPRE_Int hypre_BoxArraySetSize ( hypre_BoxArray *box_array, HYPRE_Int size ); -hypre_BoxArray *hypre_BoxArrayDuplicate ( hypre_BoxArray *box_array ); +hypre_BoxArray *hypre_BoxArrayClone ( 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_Int hypre_BoxArrayVolume ( hypre_BoxArray *box_array ); +HYPRE_Int hypre_BoxArrayInBoxArray ( hypre_BoxArray *box_array1, hypre_BoxArray *box_array2 ); +HYPRE_Int hypre_BoxArraysEqual ( hypre_BoxArray *box_array1, hypre_BoxArray *box_array2 ); 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 ); +hypre_BoxArrayArray *hypre_BoxArrayArrayClone ( hypre_BoxArrayArray *box_array_array ); +HYPRE_Int hypre_BoxArrayArrayPrintToFile ( FILE *file, hypre_BoxArrayArray *box_array_array ); +HYPRE_Int hypre_BoxArrayArrayPrint ( MPI_Comm comm, const char *filename, + hypre_BoxArrayArray *box_array_array ); + +/* box_ds.c */ +HYPRE_Int hypre_BoxBTNodeCreate ( HYPRE_Int ndim, hypre_BoxBTNode **btnode_ptr ); +HYPRE_Int hypre_BoxBTNodeSetIndices ( hypre_BoxBTNode *btnode, HYPRE_Int num_indices, + HYPRE_Int **indices ); +HYPRE_Int hypre_BoxBTNodeInitialize ( hypre_BoxBTNode *btnode, HYPRE_Int num_indices, + HYPRE_Int **indices, hypre_Box *box ); +HYPRE_Int hypre_BoxBTNodeDestroy ( hypre_BoxBTNode *btnode ); +HYPRE_Int hypre_BoxBinTreeCreate ( HYPRE_Int ndim, hypre_BoxBinTree **boxbt_ptr ); +HYPRE_Int hypre_BoxBinTreeInitialize ( hypre_BoxBinTree *boxbt, HYPRE_Int num_indices, + HYPRE_Int **indices, hypre_Box *box ); +HYPRE_Int hypre_BoxBinTreeDestroy ( hypre_BoxBinTree *boxbt ); +HYPRE_Int hypre_BoxBTStackCreate ( hypre_BoxBTStack **btstack_ptr ); +HYPRE_Int hypre_BoxBTStackInitialize ( HYPRE_Int capacity, hypre_BoxBTStack *btstack ); +HYPRE_Int hypre_BoxBTStackDestroy ( hypre_BoxBTStack *btstack ); +HYPRE_Int hypre_BoxBTStackInsert ( hypre_BoxBTNode *btnode, hypre_BoxBTStack *btstack ); +HYPRE_Int hypre_BoxBTStackDelete ( hypre_BoxBTStack *btstack, hypre_BoxBTNode **btnode_ptr ); +HYPRE_Int hypre_BoxBTQueueCreate ( hypre_BoxBTQueue **btqueue_ptr ); +HYPRE_Int hypre_BoxBTQueueInitialize ( HYPRE_Int capacity, hypre_BoxBTQueue *btqueue ); +HYPRE_Int hypre_BoxBTQueueDestroy ( hypre_BoxBTQueue *btqueue ); +HYPRE_Int hypre_BoxBTQueueInsert ( hypre_BoxBTNode *btnode, hypre_BoxBTQueue *btqueue ); +HYPRE_Int hypre_BoxBTQueueDelete ( hypre_BoxBTQueue *btqueue, hypre_BoxBTNode **btnode_ptr ); /* 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_BoxManEntryGetStride ( hypre_BoxManEntry *entry, hypre_Index stride ); 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 ); @@ -143,7 +200,45 @@ HYPRE_Int hypre_FillResponseBoxManAssemble2 ( void *p_recv_contact_buf, HYPRE_In HYPRE_Int contact_proc, void *ro, MPI_Comm comm, void **p_send_response_buf, HYPRE_Int *response_message_size ); +/* coarsen.c */ +HYPRE_Int hypre_MapToCoarseIndex ( hypre_Index index, hypre_IndexRef origin, hypre_Index stride, + HYPRE_Int ndim ); +HYPRE_Int hypre_MapToFineIndex ( hypre_Index index, hypre_IndexRef origin, hypre_Index stride, + HYPRE_Int ndim ); +HYPRE_Int hypre_StructMapFineToCoarse ( hypre_Index findex, hypre_Index origin, hypre_Index stride, + hypre_Index cindex ); +HYPRE_Int hypre_StructMapCoarseToFine ( hypre_Index cindex, hypre_Index origin, hypre_Index stride, + hypre_Index findex ); +HYPRE_Int +hypre_ComputeCoarseOriginStride ( hypre_Index coarse_origin, hypre_Index coarse_stride, + hypre_IndexRef origin, hypre_Index stride, HYPRE_Int ndim ); +HYPRE_Int hypre_CoarsenBox ( hypre_Box *box, hypre_IndexRef origin, hypre_Index stride ); +HYPRE_Int hypre_RefineBox ( hypre_Box *box, hypre_IndexRef origin, hypre_Index stride ); +HYPRE_Int hypre_CoarsenBoxArray ( hypre_BoxArray *box_array, hypre_IndexRef origin, + hypre_Index stride ); +HYPRE_Int hypre_RefineBoxArray ( hypre_BoxArray *box_array, hypre_IndexRef origin, + hypre_Index stride ); +HYPRE_Int hypre_CoarsenBoxArrayArray ( hypre_BoxArrayArray *box_array_array, hypre_IndexRef origin, + hypre_Index stride ); +HYPRE_Int hypre_RefineBoxArrayArray ( hypre_BoxArrayArray *box_array_array, hypre_IndexRef origin, + hypre_Index stride ); +HYPRE_Int +hypre_CoarsenBoxArrayArrayOutward( hypre_BoxArrayArray *boxaa, + hypre_BoxArray *refboxa, + hypre_IndexRef origin, + hypre_Index stride, + hypre_BoxArrayArray **new_boxaa_ptr ); +HYPRE_Int hypre_StructCoarsen ( hypre_StructGrid *fgrid, hypre_IndexRef origin, hypre_Index stride, + HYPRE_Int prune, hypre_StructGrid **cgrid_ptr ); + /* communication_info.c */ +hypre_CommStencil *hypre_CommStencilCreate ( HYPRE_Int ndim ); +HYPRE_Int hypre_CommStencilSetEntry ( hypre_CommStencil *comm_stencil, hypre_Index offset ); +HYPRE_Int hypre_CommStencilDestroy ( hypre_CommStencil *comm_stencil ); +HYPRE_Int hypre_StructStencilPrint( FILE *file, hypre_StructStencil *stencil ); +HYPRE_Int hypre_StructStencilRead( FILE *file, HYPRE_Int ndim, hypre_StructStencil **stencil_ptr ); +HYPRE_Int hypre_CommStencilCreateNumGhost ( hypre_CommStencil *comm_stencil, + HYPRE_Int **num_ghost_ptr ); 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, @@ -156,11 +251,47 @@ HYPRE_Int hypre_CommInfoProjectSend ( hypre_CommInfo *comm_info, hypre_Index ind hypre_Index stride ); HYPRE_Int hypre_CommInfoProjectRecv ( hypre_CommInfo *comm_info, hypre_Index index, hypre_Index stride ); +HYPRE_Int +hypre_CommInfoCoarsenSend( hypre_CommInfo *comm_info, + hypre_Index index, + hypre_Index stride ); +HYPRE_Int +hypre_CommInfoCoarsenRecv( hypre_CommInfo *comm_info, + hypre_Index index, + hypre_Index stride ); +HYPRE_Int +hypre_CommInfoRefineSend( hypre_CommInfo *comm_info, + hypre_Index index, + hypre_Index stride ); +HYPRE_Int +hypre_CommInfoRefineRecv( hypre_CommInfo *comm_info, + hypre_Index index, + hypre_Index stride ); +HYPRE_Int +hypre_CommInfoCoarsen( hypre_CommInfo *comm_info, + hypre_Index index, + hypre_Index stride ); +HYPRE_Int +hypre_CommInfoRefine( 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_CommInfoClone( hypre_CommInfo *comm_info, hypre_CommInfo **clone_ptr ); +HYPRE_Int +hypre_CreateCommInfo( hypre_StructGrid *bgrid, + hypre_Index stride, + hypre_CommStencil *comm_stencil, + hypre_CommInfo **comm_info_ptr ); +HYPRE_Int +hypre_CreateCommInfoFromStencil( hypre_StructGrid *grid, + hypre_Index stride, + hypre_StructStencil *stencil, + hypre_CommInfo **comm_info_ptr ); +HYPRE_Int +hypre_CreateCommInfoFromNumGhost( hypre_StructGrid *grid, + hypre_Index stride, + 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 ); @@ -174,125 +305,77 @@ HYPRE_Int hypre_ComputeInfoProjectRecv ( hypre_ComputeInfo *compute_info, hypre_ 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_Index stride, + hypre_StructStencil *stencil, + hypre_ComputeInfo **compute_info_ptr ); +HYPRE_Int hypre_ComputePkgCreate ( HYPRE_MemoryLocation memory_location, + 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_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_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_StructGridAssemble ( HYPRE_StructGrid grid ); -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_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_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_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_StructStencilDestroy ( HYPRE_StructStencil stencil ); - -/* HYPRE_struct_vector.c */ -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_StructVectorAssemble ( HYPRE_StructVector 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_Int hypre_SnapIndexPos ( hypre_Index index, hypre_IndexRef origin, hypre_Index stride, + HYPRE_Int ndim ); +HYPRE_Int hypre_SnapIndexNeg ( hypre_Index index, hypre_IndexRef origin, hypre_Index stride, + HYPRE_Int ndim ); +HYPRE_Int hypre_ConvertToCanonicalIndex ( hypre_Index index, hypre_Index stride, HYPRE_Int ndim ); +HYPRE_Int hypre_ProjectBox ( hypre_Box *box, hypre_IndexRef origin, hypre_Index stride ); +HYPRE_Int hypre_ProjectBoxArray ( hypre_BoxArray *box_array, hypre_IndexRef origin, hypre_Index stride ); -HYPRE_Int hypre_ProjectBoxArrayArray ( hypre_BoxArrayArray *box_array_array, hypre_Index index, +HYPRE_Int hypre_ProjectBoxArrayArray ( hypre_BoxArrayArray *box_array_array, hypre_IndexRef origin, hypre_Index stride ); /* struct_axpy.c */ -HYPRE_Int hypre_StructAxpy ( HYPRE_Complex alpha, hypre_StructVector *x, hypre_StructVector *y ); +HYPRE_Int hypre_StructVectorAxpy ( HYPRE_Complex alpha, hypre_StructVector *x, + HYPRE_Complex beta, hypre_StructVector *y, + hypre_StructVector *z ); +HYPRE_Int hypre_StructVectorPointwiseDivpy ( HYPRE_Complex alpha, hypre_StructVector *x, + hypre_StructVector *z, HYPRE_Complex beta, + hypre_StructVector *y ); +HYPRE_Int hypre_StructVectorPointwiseDivision ( hypre_StructVector *x, hypre_StructVector *y, + hypre_StructVector **z_ptr ); +HYPRE_Int hypre_StructVectorPointwiseProduct ( hypre_StructVector *x, hypre_StructVector *y, + hypre_StructVector **z_ptr ); +HYPRE_Int hypre_StructVectorPointwiseInverse ( hypre_StructVector *x, hypre_StructVector **y_ptr ); + /* 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_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_BoxArray *recv_data_space, HYPRE_Int num_values, + HYPRE_Int **orders, HYPRE_Int reverse, + MPI_Comm comm, HYPRE_MemoryLocation memory_location, + hypre_CommPkg **comm_pkg_ptr ); +HYPRE_Int hypre_CommBlockSetEntries ( hypre_CommBlock *comm_block, HYPRE_Int *boxnums, + hypre_Box *boxes, HYPRE_Int *orders, hypre_Index stride, + hypre_BoxArray *data_space, + HYPRE_Int *data_offsets ); +HYPRE_Int hypre_CommBlockSetEntry ( hypre_CommBlock *comm_block, HYPRE_Int comm_num, hypre_Box *box, + hypre_Index stride, hypre_Index coord, hypre_Index dir, + HYPRE_Int *order, HYPRE_Int *rem_order, + hypre_Box *data_box, HYPRE_Int data_box_offset ); +HYPRE_Int hypre_CommPkgSetPrefixSizes ( hypre_CommPkg *comm_pkg ); +HYPRE_Int hypre_CommPkgAgglomerate ( HYPRE_Int num_comm_pkgs, hypre_CommPkg **comm_pkgs, + hypre_CommPkg **agg_comm_pkg_ptr ); +HYPRE_Int hypre_CommPkgAgglomData( HYPRE_Int num_comm_pkgs, hypre_CommPkg **comm_pkg_a, + HYPRE_Complex ***comm_data_a, hypre_CommPkg *comm_pkg, + HYPRE_Complex ***agg_comm_data_ptr ); +HYPRE_Int hypre_CommPkgAgglomDestroy( HYPRE_Int num_comm_pkgs, hypre_CommPkg **comm_pkg_a, + HYPRE_Complex ***comm_data_a ); +HYPRE_Int hypre_StructCommunicationInitialize ( 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_StructCommunicationFinalize ( 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_CommPkgDestroy ( hypre_CommPkg *comm_pkg ); /* struct_copy.c */ @@ -300,6 +383,17 @@ 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_data.c */ +HYPRE_Int +hypre_StructDataCopy( HYPRE_Complex *fr_data, /* from */ + hypre_BoxArray *fr_data_space, + HYPRE_Complex *to_data, /* to */ + hypre_BoxArray *to_data_space, + HYPRE_Int ndim, + HYPRE_Int nval ); +HYPRE_Int hypre_StructNumGhostFromStencil ( hypre_StructStencil *stencil, + HYPRE_Int **num_ghost_ptr ); + /* 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 ); @@ -312,10 +406,14 @@ HYPRE_Int hypre_StructGridSetBoundingBox ( hypre_StructGrid *grid, hypre_Box *ne 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_StructGridComputeGlobalSize ( hypre_StructGrid *grid ); HYPRE_Int hypre_StructGridAssemble ( hypre_StructGrid *grid ); +HYPRE_Int hypre_StructGridComputeBoxnums ( hypre_StructGrid *grid, HYPRE_Int nboxes, + HYPRE_Int *boxnums, hypre_Index stride, HYPRE_Int *new_nboxes_ptr, HYPRE_Int **new_boxnums_ptr ); 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_StructGridPrintVTK ( const char *filename, hypre_StructGrid *grid ); 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 ); @@ -325,32 +423,229 @@ HYPRE_Int hypre_StructGridSetDataLocation( HYPRE_StructGrid grid, HYPRE_MemoryLocation data_location ); #endif /* struct_innerprod.c */ +HYPRE_Real hypre_StructInnerProdLocal ( 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_Int dim, hypre_BoxArray *box_array, + hypre_BoxArray *data_space, HYPRE_Int num_values, HYPRE_Int *value_ids, HYPRE_Complex *data ); +HYPRE_Int +hypre_ReadBoxArrayData( FILE *file, HYPRE_Int ndim, hypre_BoxArray *box_array, + HYPRE_Int *num_values_ptr, HYPRE_Int **value_ids_ptr, HYPRE_Complex **values_ptr ); + +/* struct_matmult.c */ +HYPRE_Int +hypre_StructMatmultCreate( HYPRE_Int max_matmults, + HYPRE_Int max_matrices, + hypre_StructMatmultData **mmdata_ptr ); +HYPRE_Int +hypre_StructMatmultDestroy( hypre_StructMatmultData *mmdata ); +HYPRE_Int +hypre_StructMatmultSetKernelType( hypre_StructMatmultData *mmdata, + HYPRE_Int kernel_type ); +HYPRE_Int +hypre_StructMatmultSetProduct( hypre_StructMatmultData *mmdata, + HYPRE_Int nmatrices_in, + hypre_StructMatrix **matrices_in, + HYPRE_Int nterms, + HYPRE_Int *terms_in, + HYPRE_Int *transposes_in, + HYPRE_Int *iM_ptr ); +HYPRE_Int +hypre_StructMatmultInitialize( hypre_StructMatmultData *mmdata, + HYPRE_Int assemble_grid ); +HYPRE_Int +hypre_StructMatmultCommSetup( hypre_StructMatmultData *mmdata ); +HYPRE_Int +hypre_StructMatmultCommunicate( hypre_StructMatmultData *mmdata ); +HYPRE_Int +hypre_StructMatmultCompute( hypre_StructMatmultData *mmdata, + HYPRE_Int iM ); +HYPRE_Int +hypre_StructMatmultCompute_core_generic( hypre_StructMatmultDataMH *a, + HYPRE_Int na, + HYPRE_Int nterms, + HYPRE_Int ndim, + hypre_Index loop_size, + hypre_Box *fdbox, + hypre_Index fdstart, + hypre_Index fdstride, + hypre_Box *cdbox, + hypre_Index cdstart, + hypre_Index cdstride, + hypre_Box *Mdbox, + hypre_Index Mdstart, + hypre_Index Mdstride ); +HYPRE_Int +hypre_StructMatmultGetMatrix( hypre_StructMatmultData *mmdata, + HYPRE_Int iM, + hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatmultSetup( HYPRE_Int type, + HYPRE_Int nmatrices, + hypre_StructMatrix **matrices, + HYPRE_Int nterms, + HYPRE_Int *terms, + HYPRE_Int *trans, + hypre_StructMatmultData **mmdata_ptr, + hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatmultMultiply( hypre_StructMatmultData *mmdata ); +HYPRE_Int hypre_StructMatmult ( HYPRE_Int type, HYPRE_Int nmatrices, hypre_StructMatrix **matrices, + HYPRE_Int nterms, HYPRE_Int *terms, HYPRE_Int *trans, + hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatmatSetup( hypre_StructMatrix *A, + hypre_StructMatrix *B, + hypre_StructMatmultData **mmdata_ptr, + hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatmat( hypre_StructMatrix *A, + hypre_StructMatrix *B, + hypre_StructMatrix **M_ptr ); +HYPRE_Int +hypre_StructMatrixPtAPSetup( HYPRE_Int kernel_type, + hypre_StructMatrix *A, + hypre_StructMatrix *P, + hypre_StructMatmultData **mmdata_ptr, + hypre_StructMatrix **M_ptr); +HYPRE_Int +hypre_StructMatrixPtAP( hypre_StructMatrix *A, + hypre_StructMatrix *P, + hypre_StructMatrix **M_ptr); +HYPRE_Int +hypre_StructMatrixRAPSetup( HYPRE_Int kernel_type, + hypre_StructMatrix *R, + hypre_StructMatrix *A, + hypre_StructMatrix *P, + hypre_StructMatmultData **mmdata_ptr, + hypre_StructMatrix **M_ptr); +HYPRE_Int +hypre_StructMatrixRAP( hypre_StructMatrix *R, + hypre_StructMatrix *A, + hypre_StructMatrix *P, + hypre_StructMatrix **M_ptr); +HYPRE_Int +hypre_StructMatrixRTtAPSetup( HYPRE_Int kernel_type, + hypre_StructMatrix *RT, + hypre_StructMatrix *A, + hypre_StructMatrix *P, + hypre_StructMatmultData **mmdata_ptr, + hypre_StructMatrix **M_ptr); +HYPRE_Int +hypre_StructMatrixRTtAP( hypre_StructMatrix *RT, + hypre_StructMatrix *A, + hypre_StructMatrix *P, + hypre_StructMatrix **M_ptr); +HYPRE_Int +hypre_StructMatrixAddInit( HYPRE_Int nmatrices, + hypre_StructMatrix **matrices, + hypre_StructMatrix **A_ptr ); +HYPRE_Int +hypre_StructMatrixAddMat( hypre_StructMatrix *A, + HYPRE_Complex alpha, + hypre_StructMatrix *B ); + +/* struct_matmult_core.c */ +HYPRE_Int +hypre_StructMatmultCompute_core( HYPRE_Int nterms, + hypre_StructMatmultDataMH *a, + HYPRE_Int na, + HYPRE_Int ndim, + hypre_Index loop_size, + HYPRE_Int stencil_size, + hypre_Box *fdbox, + hypre_Index fdstart, + hypre_Index fdstride, + hypre_Box *cdbox, + hypre_Index cdstart, + hypre_Index cdstride, + hypre_Box *Mdbox, + hypre_Index Mdstart, + hypre_Index Mdstride ); + +/* struct_matmult_fuse.c */ +HYPRE_Int +hypre_StructMatmultCompute_fuse( HYPRE_Int nterms, + hypre_StructMatmultDataMH *a, + HYPRE_Int na, + HYPRE_Int ndim, + hypre_Index loop_size, + HYPRE_Int stencil_size, + hypre_Box *fdbox, + hypre_Index fdstart, + hypre_Index fdstride, + hypre_Box *cdbox, + hypre_Index cdstart, + hypre_Index cdstride, + hypre_Box *Mdbox, + hypre_Index Mdstart, + hypre_Index Mdstride, + hypre_StructMatrix *M ); + +/* struct_matop.c */ +HYPRE_Int hypre_StructMatrixZeroDiagonal( hypre_StructMatrix *A ); +HYPRE_Int hypre_StructMatrixComputeRowSum ( hypre_StructMatrix *A, HYPRE_Int type, + hypre_StructVector *rowsum ); /* struct_matrix.c */ +HYPRE_Int +hypre_StructMatrixGetFStride( hypre_StructMatrix *matrix, + hypre_IndexRef *fstride ); +HYPRE_Int +hypre_StructMatrixGetCStride( hypre_StructMatrix *matrix, + hypre_IndexRef *cstride ); +HYPRE_Int hypre_StructMatrixGetDataMapStride ( hypre_StructMatrix *matrix, hypre_IndexRef *stride ); +HYPRE_Int hypre_StructMatrixMapDataIndex ( hypre_StructMatrix *matrix, hypre_Index dindex ); +HYPRE_Int hypre_StructMatrixUnMapDataIndex ( hypre_StructMatrix *matrix, hypre_Index dindex ); +HYPRE_Int hypre_StructMatrixMapDataBox ( hypre_StructMatrix *matrix, hypre_Box *dbox ); +HYPRE_Int hypre_StructMatrixUnMapDataBox ( hypre_StructMatrix *matrix, hypre_Box *dbox ); +HYPRE_Int hypre_StructMatrixMapDataStride ( hypre_StructMatrix *matrix, hypre_Index dstride ); +HYPRE_Int hypre_StructMatrixUnMapDataStride ( hypre_StructMatrix *matrix, hypre_Index dstride ); +HYPRE_Int hypre_StructMatrixPlaceStencil ( hypre_StructMatrix *matrix, HYPRE_Int entry, + hypre_Index dindex, hypre_Index index ); +HYPRE_Int hypre_StructMatrixGetStencilStride ( hypre_StructMatrix *matrix, hypre_Index stride ); +HYPRE_Int hypre_StructMatrixGetStencilSpace ( hypre_StructMatrix *matrix, HYPRE_Int entry, + HYPRE_Int transpose, hypre_Index origin, hypre_Index stride ); +HYPRE_Int +hypre_StructMatrixGetStSpaces( hypre_StructMatrix *matrix, + HYPRE_Int transpose, + HYPRE_Int *num_sspaces_ptr, + HYPRE_Int **sentry_sspaces_ptr, + hypre_Index **sspace_origins_ptr, + hypre_Index stride ); +HYPRE_Int hypre_StructMatrixMapCommInfo ( hypre_StructMatrix *matrix, hypre_IndexRef origin, + hypre_Index stride, hypre_CommInfo *comm_info ); +HYPRE_Int hypre_StructMatrixCreateCommPkg ( hypre_StructMatrix *matrix, hypre_CommInfo *comm_info, + hypre_CommPkg **comm_pkg_ptr, HYPRE_Complex ***comm_data_ptr); 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_StructMatrixSetMemoryLocation( hypre_StructMatrix *matrix, + HYPRE_MemoryLocation memory_location ); +HYPRE_Int hypre_StructMatrixSetRangeStride ( hypre_StructMatrix *matrix, + hypre_IndexRef range_stride ); +HYPRE_Int hypre_StructMatrixSetDomainStride ( hypre_StructMatrix *matrix, + hypre_IndexRef domain_stride ); +HYPRE_Int +hypre_StructMatrixComputeDataSpace( hypre_StructMatrix *matrix, + HYPRE_Int *num_ghost, + hypre_BoxArray **data_space_ptr ); +HYPRE_Int +hypre_StructMatrixGrowDataSpace( hypre_StructMatrix *matrix, + HYPRE_Int *num_ghost, + hypre_BoxArray **data_space_ptr ); +HYPRE_Int +hypre_StructMatrixNeedResize( hypre_StructMatrix *matrix, + hypre_BoxArray *data_space ); +HYPRE_Int hypre_StructMatrixResize ( hypre_StructMatrix *matrix, hypre_BoxArray *data_space ); +HYPRE_Int hypre_StructMatrixRestore ( hypre_StructMatrix *matrix ); +HYPRE_Int hypre_StructMatrixForget ( 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_Int zero_init, HYPRE_Complex *data ); 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, @@ -366,11 +661,14 @@ HYPRE_Int hypre_StructMatrixClearValues ( hypre_StructMatrix *matrix, hypre_Inde 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_StructMatrixSetTranspose ( hypre_StructMatrix *matrix, HYPRE_Int transpose, + HYPRE_Int *resize ); +HYPRE_Int hypre_StructMatrixSetNumGhost ( hypre_StructMatrix *matrix, HYPRE_Int *num_ghost, + HYPRE_Int *resize ); +HYPRE_Int hypre_StructMatrixSetGhost ( hypre_StructMatrix *matrix, HYPRE_Int ghost, + HYPRE_Int *resize ); HYPRE_Int hypre_StructMatrixClearGhostValues ( hypre_StructMatrix *matrix ); HYPRE_Int hypre_StructMatrixPrintData ( FILE *file, hypre_StructMatrix *matrix, HYPRE_Int all ); HYPRE_Int hypre_StructMatrixReadData ( FILE *file, hypre_StructMatrix *matrix ); @@ -380,7 +678,8 @@ 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); +HYPRE_Int hypre_StructMatrixClearBoundary ( hypre_StructMatrix *matrix); +HYPRE_Int hypre_StructMatrixGetDiagonal ( hypre_StructMatrix *matrix, hypre_StructVector *diag ); /* struct_matrix_mask.c */ hypre_StructMatrix *hypre_StructMatrixCreateMask ( hypre_StructMatrix *matrix, @@ -388,19 +687,106 @@ hypre_StructMatrix *hypre_StructMatrixCreateMask ( hypre_StructMatrix *matrix, /* struct_matvec.c */ void *hypre_StructMatvecCreate ( void ); +HYPRE_Int hypre_StructMatvecSetTranspose ( void *matvec_vdata, HYPRE_Int transpose ); +HYPRE_Int hypre_StructMatvecSetActive ( void *matvec_vdata, HYPRE_Int active ); 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_StructMatvecCompute( void *matvec_vdata, + HYPRE_Complex alpha, + hypre_StructMatrix *A, + hypre_StructVector *x, + HYPRE_Complex beta, + hypre_StructVector *y, + hypre_StructVector *z ); 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_StructMatvecT ( HYPRE_Complex alpha, hypre_StructMatrix *A, hypre_StructVector *x, + HYPRE_Complex beta, hypre_StructVector *y ); + +/* struct_matvec_core.c */ +HYPRE_Int +hypre_StructMatvecCompute_core_CC( HYPRE_Complex alpha, + hypre_StructMatrix *A, + hypre_StructVector *x, + HYPRE_Complex beta, + hypre_StructVector *y, + hypre_StructVector *z, + HYPRE_Int Ab, + HYPRE_Int xb, + HYPRE_Int yb, + HYPRE_Int zb, + HYPRE_Int transpose, + HYPRE_Int nentries, + HYPRE_Int *entries, + hypre_IndexRef start, + hypre_IndexRef stride, + hypre_IndexRef loop_size, + hypre_IndexRef xfstride, + hypre_IndexRef ran_stride, + hypre_IndexRef xdstride, + hypre_IndexRef ydstride, + hypre_IndexRef zdstride, + hypre_Box *x_data_box, + hypre_Box *y_data_box, + hypre_Box *z_data_box); +HYPRE_Int +hypre_StructMatvecCompute_core_VC( HYPRE_Complex alpha, + hypre_StructMatrix *A, + hypre_StructVector *x, + HYPRE_Complex beta, + hypre_StructVector *y, + hypre_StructVector *z, + HYPRE_Int Ab, + HYPRE_Int xb, + HYPRE_Int yb, + HYPRE_Int zb, + HYPRE_Int transpose, + HYPRE_Int only_Ax, + HYPRE_Int nentries, + HYPRE_Int *entries, + hypre_IndexRef start, + hypre_IndexRef stride, + hypre_IndexRef loop_size, + hypre_IndexRef xfstride, + hypre_IndexRef ran_stride, + hypre_IndexRef Adstride, + hypre_IndexRef xdstride, + hypre_IndexRef ydstride, + hypre_IndexRef zdstride, + hypre_Box *A_data_box, + hypre_Box *x_data_box, + hypre_Box *y_data_box, + hypre_Box *z_data_box ); +HYPRE_Int +hypre_StructMatvecCompute_core_VCC( HYPRE_Complex alpha, + hypre_StructMatrix *A, + hypre_StructVector *x, + HYPRE_Complex beta, + hypre_StructVector *y, + hypre_StructVector *z, + HYPRE_Int Ab, + HYPRE_Int xb, + HYPRE_Int yb, + HYPRE_Int zb, + HYPRE_Int transpose, + HYPRE_Int centry, + HYPRE_Int nentries, + HYPRE_Int *entries, + hypre_IndexRef start, + hypre_IndexRef stride, + hypre_IndexRef loop_size, + hypre_IndexRef xfstride, + hypre_IndexRef ran_stride, + hypre_IndexRef Adstride, + hypre_IndexRef xdstride, + hypre_IndexRef ydstride, + hypre_IndexRef zdstride, + hypre_Box *A_data_box, + hypre_Box *x_data_box, + hypre_Box *y_data_box, + hypre_Box *z_data_box ); /* struct_scale.c */ HYPRE_Int hypre_StructScale ( HYPRE_Complex alpha, hypre_StructVector *y ); @@ -410,18 +796,44 @@ 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_StructStencilOffsetEntry ( hypre_StructStencil *stencil, + hypre_Index stencil_offset ); HYPRE_Int hypre_StructStencilSymmetrize ( hypre_StructStencil *stencil, - hypre_StructStencil **symm_stencil_ptr, HYPRE_Int **symm_elements_ptr ); + hypre_StructStencil **symm_stencil_ptr, HYPRE_Int **symm_offsets_ptr ); /* struct_vector.c */ +HYPRE_Int hypre_StructVectorMapDataIndex ( hypre_StructVector *vector, hypre_Index dindex ); +HYPRE_Int hypre_StructVectorMapDataBox ( hypre_StructVector *vector, hypre_Box *dbox ); +HYPRE_Int hypre_StructVectorMapDataStride ( hypre_StructVector *vector, hypre_Index dstride ); +HYPRE_Int hypre_StructVectorUnMapDataIndex ( hypre_StructVector *vector, hypre_Index dindex ); +HYPRE_Int hypre_StructVectorUnMapDataBox ( hypre_StructVector *vector, hypre_Box *dbox ); +HYPRE_Int hypre_StructVectorUnMapDataStride ( hypre_StructVector *vector, hypre_Index dstride ); +HYPRE_Int hypre_StructVectorMapCommInfo ( hypre_StructVector *vector, hypre_CommInfo *comm_info ); 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_StructVectorSetStride ( hypre_StructVector *vector, hypre_IndexRef stride ); +HYPRE_Int +hypre_StructVectorSetMemoryMode( hypre_StructVector *vector, + HYPRE_Int memory_mode ); +HYPRE_Int hypre_StructVectorRebase ( hypre_StructVector *vector, hypre_StructGrid *grid, + hypre_Index stride ); +HYPRE_Int +hypre_StructVectorComputeDataSpace( hypre_StructVector *vector, + hypre_IndexRef stride, + HYPRE_Int *num_ghost, + hypre_BoxArray **data_space_ptr ); +HYPRE_Int +hypre_StructVectorNeedResize( hypre_StructVector *vector, + hypre_BoxArray *data_space ); +HYPRE_Int +hypre_StructVectorResize( hypre_StructVector *vector, + hypre_BoxArray *data_space ); +HYPRE_Int hypre_StructVectorRestore ( hypre_StructVector *vector ); +HYPRE_Int hypre_StructVectorForget ( hypre_StructVector *vector ); HYPRE_Int hypre_StructVectorInitializeShell ( hypre_StructVector *vector ); -HYPRE_Int hypre_StructVectorInitializeData ( hypre_StructVector *vector, HYPRE_Complex *data); -HYPRE_Int hypre_StructVectorInitialize ( hypre_StructVector *vector ); +HYPRE_Int hypre_StructVectorInitializeData ( hypre_StructVector *vector, HYPRE_Complex *data ); +HYPRE_Int hypre_StructVectorInitialize ( hypre_StructVector *vector, HYPRE_Int zero_init ); 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, @@ -436,8 +848,8 @@ HYPRE_Int hypre_StructVectorSetNumGhost ( hypre_StructVector *vector, HYPRE_Int 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_StructVectorSetConstantValues ( hypre_StructVector *vector, HYPRE_Complex value ); +HYPRE_Int hypre_StructVectorSetRandomValues ( hypre_StructVector *vector, HYPRE_Int seed ); HYPRE_Int hypre_StructVectorSetFunctionValues ( hypre_StructVector *vector, HYPRE_Complex (*fcn )( HYPRE_Int, HYPRE_Int, HYPRE_Int )); HYPRE_Int hypre_StructVectorClearGhostValues ( hypre_StructVector *vector ); @@ -447,13 +859,12 @@ hypre_CommPkg *hypre_StructVectorGetMigrateCommPkg ( hypre_StructVector *from_ve hypre_StructVector *to_vector ); 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_StructVector *hypre_StructVectorRead ( MPI_Comm comm, const char *filename, HYPRE_Int *num_ghost ); +HYPRE_Int hypre_StructVectorMaxValue ( hypre_StructVector *vector, HYPRE_Real *max_value, + HYPRE_Int *max_index, hypre_Index max_xyz_index ); hypre_StructVector *hypre_StructVectorClone ( hypre_StructVector *vector ); -HYPRE_Int hypre_StructVectorPointwiseDivision ( hypre_StructVector *x, hypre_StructVector *y, - hypre_StructVector **z_ptr ); -HYPRE_Int hypre_StructVectorPointwiseProduct ( hypre_StructVector *x, hypre_StructVector *y, - hypre_StructVector **z_ptr ); -HYPRE_Int hypre_StructVectorPointwiseInverse ( hypre_StructVector *x, hypre_StructVector **y_ptr ); diff --git a/src/struct_mv/protos_mp.h b/src/struct_mv/protos_mp.h new file mode 100644 index 0000000000..fd66ea092a --- /dev/null +++ b/src/struct_mv/protos_mp.h @@ -0,0 +1,16 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/* Mixed precision function protos */ +/* struct_mv_mp.c */ + +#if defined(HYPRE_MIXED_PRECISION) +HYPRE_Int +hypre_StructVectorCopy_mp( hypre_StructVector *x, + hypre_StructVector *y ); +#endif + diff --git a/src/struct_mv/struct_axpy.c b/src/struct_mv/struct_axpy.c index e6b0cd5973..13afa785e7 100644 --- a/src/struct_mv/struct_axpy.c +++ b/src/struct_mv/struct_axpy.c @@ -15,69 +15,229 @@ #include "_hypre_struct_mv.hpp" /*-------------------------------------------------------------------------- - * hypre_StructAxpy + * z = alpha * x + beta * y + * + * The vectors x, y, and z may have different base grids, but the grid boxes + * for each vector (defined by grid, stride, nboxes, boxnums) must be the same. + * Only nboxes is checked, the rest is assumed to be true. *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_StructAxpy( HYPRE_Complex alpha, - hypre_StructVector *x, - hypre_StructVector *y ) +hypre_StructVectorAxpy( HYPRE_Complex alpha, + hypre_StructVector *x, + HYPRE_Complex beta, + hypre_StructVector *y, + hypre_StructVector *z ) { + HYPRE_Int ndim = hypre_StructVectorNDim(x); + HYPRE_Int nboxes = hypre_StructVectorNBoxes(x); + hypre_Box *x_data_box; hypre_Box *y_data_box; + hypre_Box *z_data_box; HYPRE_Complex *xp; HYPRE_Complex *yp; + HYPRE_Complex *zp; - hypre_BoxArray *boxes; - hypre_Box *box; + hypre_Box *loop_box; hypre_Index loop_size; hypre_IndexRef start; - hypre_Index unit_stride; + hypre_Index ustride; HYPRE_Int i; - hypre_SetIndex(unit_stride, 1); + /* Return if x, y, or z do not have the same numbers of boxes */ + if (hypre_StructVectorNBoxes(x) != hypre_StructVectorNBoxes(y) || + hypre_StructVectorNBoxes(x) != hypre_StructVectorNBoxes(z)) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "nboxes for x, y or z do not match!"); + return hypre_error_flag; + } + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("Axpy"); + + loop_box = hypre_BoxCreate(ndim); + hypre_SetIndex(ustride, 1); + for (i = 0; i < nboxes; i++) + { + hypre_StructVectorGridBoxCopy(x, i, loop_box); + start = hypre_BoxIMin(loop_box); + + x_data_box = hypre_StructVectorGridDataBox(x, i); + y_data_box = hypre_StructVectorGridDataBox(y, i); + z_data_box = hypre_StructVectorGridDataBox(z, i); + + xp = hypre_StructVectorGridData(x, i); + yp = hypre_StructVectorGridData(y, i); + zp = hypre_StructVectorGridData(z, i); + + hypre_BoxGetSize(loop_box, loop_size); + +#define DEVICE_VAR is_device_ptr(xp,yp,zp) + if (hypre_BoxesEqual(x_data_box, y_data_box) && + hypre_BoxesEqual(x_data_box, z_data_box)) + { + if (alpha != 0.0 && beta != 0.0) + { + hypre_BoxLoop1Begin(ndim, loop_size, x_data_box, start, ustride, xi) + { + zp[xi] = alpha * xp[xi] + beta * yp[xi]; + } + hypre_BoxLoop1End(xi); + } + else if (alpha != 0.0 && beta == 0.0) + { + hypre_BoxLoop1Begin(ndim, loop_size, x_data_box, start, ustride, xi) + { + zp[xi] = alpha * xp[xi]; + } + hypre_BoxLoop1End(xi); + } + else if (alpha == 0.0 && beta != 0.0) + { + hypre_BoxLoop1Begin(ndim, loop_size, x_data_box, start, ustride, xi) + { + zp[xi] = beta * yp[xi]; + } + hypre_BoxLoop1End(xi); + } + else if (alpha == 0.0 && beta == 0.0) + { + hypre_BoxLoop1Begin(ndim, loop_size, x_data_box, start, ustride, xi) + { + zp[xi] = 0.0; + } + hypre_BoxLoop1End(xi); + } + } + else + { + hypre_BoxLoop3Begin(ndim, loop_size, + x_data_box, start, ustride, xi, + y_data_box, start, ustride, yi, + z_data_box, start, ustride, zi) + { + zp[zi] = alpha * xp[xi] + beta * yp[yi]; + } + hypre_BoxLoop3End(xi, yi, zi); + } +#undef DEVICE_VAR + } + + hypre_BoxDestroy(loop_box); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} - boxes = hypre_StructGridBoxes(hypre_StructVectorGrid(y)); +/*-------------------------------------------------------------------------- + * y = alpha*x./z + beta*y + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorPointwiseDivpy( HYPRE_Complex alpha, + hypre_StructVector *x, + hypre_StructVector *z, + HYPRE_Complex beta, + hypre_StructVector *y ) +{ + HYPRE_Int ndim = hypre_StructVectorNDim(x); + hypre_StructGrid *xgrid = hypre_StructVectorGrid(x); + hypre_BoxArray *boxes = hypre_StructGridBoxes(xgrid); + + hypre_Box *xdbox, *ydbox, *zdbox; + HYPRE_Complex *xp, *yp, *zp; + + hypre_Box *box; + hypre_Index loop_size; + hypre_IndexRef start; + hypre_Index ustride; + + HYPRE_Int i; + + HYPRE_ANNOTATE_FUNC_BEGIN; + + hypre_SetIndex(ustride, 1); hypre_ForBoxI(i, boxes) { box = hypre_BoxArrayBox(boxes, i); start = hypre_BoxIMin(box); - x_data_box = hypre_BoxArrayBox(hypre_StructVectorDataSpace(x), i); - y_data_box = hypre_BoxArrayBox(hypre_StructVectorDataSpace(y), i); + xdbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(x), i); + ydbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(y), i); + zdbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(z), i); xp = hypre_StructVectorBoxData(x, i); yp = hypre_StructVectorBoxData(y, i); + zp = hypre_StructVectorBoxData(z, i); 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), +#define DEVICE_VAR is_device_ptr(zp, yp,xp) + hypre_BoxLoop3Begin(ndim, loop_size, + xdbox, start, ustride, xi, + ydbox, start, ustride, yi, + zdbox, start, ustride, zi); { - 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, - y_data_box, start, unit_stride, yi); - { - yp[yi] += alpha * xp[xi]; + yp[yi] = alpha * xp[xi] / zp[zi] + beta * yp[yi]; } - hypre_BoxLoop2End(xi, yi); + hypre_BoxLoop3End(xi, yi, zi); #undef DEVICE_VAR - -#endif } + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorPointwiseDivision( hypre_StructVector *x, + hypre_StructVector *y, + hypre_StructVector **z_ptr ) +{ + HYPRE_UNUSED_VAR(x); + HYPRE_UNUSED_VAR(y); + HYPRE_UNUSED_VAR(z_ptr); + + /* Not implemented yet */ + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorPointwiseProduct( hypre_StructVector *x, + hypre_StructVector *y, + hypre_StructVector **z_ptr ) +{ + HYPRE_UNUSED_VAR(x); + HYPRE_UNUSED_VAR(y); + HYPRE_UNUSED_VAR(z_ptr); + + /* Not implemented yet */ + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorPointwiseInverse( hypre_StructVector *x, + hypre_StructVector **y_ptr ) +{ + HYPRE_UNUSED_VAR(x); + HYPRE_UNUSED_VAR(y_ptr); + + /* Not implemented yet */ + + return hypre_error_flag; +} diff --git a/src/struct_mv/struct_communication.c b/src/struct_mv/struct_communication.c index a6ea8a8d7c..8ea28e25ed 100644 --- a/src/struct_mv/struct_communication.c +++ b/src/struct_mv/struct_communication.c @@ -9,6 +9,7 @@ #include "_hypre_struct_mv.hpp" #define DEBUG 0 +#define DEBUG_COMM_MAT 0 #if DEBUG char filename[255]; @@ -16,8 +17,8 @@ FILE *file; #endif /* this computes a (large enough) size (in doubles) for the message prefix */ -#define hypre_CommPrefixSize(ne) \ - ( (((1+ne)*sizeof(HYPRE_Int) + ne*sizeof(hypre_Box))/sizeof(HYPRE_Complex)) + 1 ) +#define hypre_CommPrefixSize(ne,nv) \ + ( ((((size_t) (1+ne+ne*nv))*sizeof(HYPRE_Int) + ((size_t) ne)*sizeof(hypre_Box))/sizeof(HYPRE_Complex)) + (size_t) 1 ) /*-------------------------------------------------------------------------- * Create a communication package. A grid-based description of a communication @@ -26,22 +27,31 @@ FILE *file; * intermediate processor-based description is used directly to pack and unpack * buffers during the communications. * - * The 'orders' argument is dimension 'num_transforms' x 'num_values' and should - * have a one-to-one correspondence with the transform data in 'comm_info'. + * The 'orders' argument is a number-of-orders x num_values array of integers. + * If orders is NULL, the incremental order from 0 to (num_values-1) is used. + * If orders is not NULL and there are no transforms in comm_info, then + * orders[0] is used. Otherwise, number-of-orders must equal the number of + * transforms and there should be a one-to-one correspondence with the transform + * data in comm_info. Negative order numbers indicate skipped indices, which + * allows a subset of values to be communicated. * * If 'reverse' is > 0, then the meaning of send/recv is reversed * + * RDF NOTE: The buffer size will be too large in the case where a subset of + * values is communicated using negative order numbers. + * *--------------------------------------------------------------------------*/ 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_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_MemoryLocation memory_location, + hypre_CommPkg **comm_pkg_ptr ) { HYPRE_Int ndim = hypre_CommInfoNDim(comm_info); hypre_BoxArrayArray *send_boxes; @@ -58,14 +68,12 @@ hypre_CommPkgCreate( hypre_CommInfo *comm_info, hypre_Index *coords; hypre_Index *dirs; HYPRE_Int **send_transforms; - HYPRE_Int **cp_orders; hypre_CommPkg *comm_pkg; hypre_CommType *comm_types; - hypre_CommType *comm_type; - hypre_CommEntryType *ct_entries; - HYPRE_Int *ct_rem_boxnums; - hypre_Box *ct_rem_boxes; + hypre_CommType *comm_type = NULL; + hypre_CommBlock *comm_block = NULL; + HYPRE_Int *cb_num_entries; HYPRE_Int *comm_boxes_p, *comm_boxes_i, *comm_boxes_j; HYPRE_Int num_boxes, num_entries, num_comms, comm_bufsize; @@ -76,10 +84,11 @@ hypre_CommPkgCreate( hypre_CommInfo *comm_info, hypre_Box *data_box; HYPRE_Int *data_offsets; HYPRE_Int data_offset; + hypre_Index identity_coord, identity_dir; hypre_IndexRef send_coord, send_dir; HYPRE_Int *send_order; - HYPRE_Int i, j, k, p, m, size, p_old, my_proc; + HYPRE_Int i, j, k, p, m, n, size, p_old, my_proc; /*------------------------------------------------------ *------------------------------------------------------*/ @@ -119,61 +128,41 @@ hypre_CommPkgCreate( hypre_CommInfo *comm_info, coords = hypre_CommInfoCoords(comm_info); /* may be NULL */ dirs = hypre_CommInfoDirs(comm_info); /* may be NULL */ - hypre_MPI_Comm_rank(comm, &my_proc ); + hypre_MPI_Comm_rank(comm, &my_proc); /*------------------------------------------------------ * Set up various entries in CommPkg *------------------------------------------------------*/ comm_pkg = hypre_CTAlloc(hypre_CommPkg, 1, HYPRE_MEMORY_HOST); + hypre_CommPkgComm(comm_pkg) = comm; + hypre_CommPkgNDim(comm_pkg) = ndim; + hypre_CommPkgMemoryLocation(comm_pkg) = memory_location; - hypre_CommPkgComm(comm_pkg) = comm; - hypre_CommPkgFirstComm(comm_pkg) = 1; - hypre_CommPkgNDim(comm_pkg) = ndim; - hypre_CommPkgNumValues(comm_pkg) = num_values; - hypre_CommPkgNumOrders(comm_pkg) = 0; - hypre_CommPkgOrders(comm_pkg) = NULL; - if ( (send_transforms != NULL) && (orders != NULL) ) - { - hypre_CommPkgNumOrders(comm_pkg) = num_transforms; - cp_orders = hypre_TAlloc(HYPRE_Int *, num_transforms, HYPRE_MEMORY_HOST); - for (i = 0; i < num_transforms; i++) - { - cp_orders[i] = hypre_TAlloc(HYPRE_Int, num_values, HYPRE_MEMORY_HOST); - for (j = 0; j < num_values; j++) - { - cp_orders[i][j] = orders[i][j]; - } - } - hypre_CommPkgOrders(comm_pkg) = cp_orders; - } - hypre_CopyIndex(send_stride, hypre_CommPkgSendStride(comm_pkg)); - hypre_CopyIndex(recv_stride, hypre_CommPkgRecvStride(comm_pkg)); - - /* set identity transform and send_coord/dir/order if needed below */ - hypre_CommPkgIdentityOrder(comm_pkg) = hypre_TAlloc(HYPRE_Int, num_values, HYPRE_MEMORY_HOST); - send_coord = hypre_CommPkgIdentityCoord(comm_pkg); - send_dir = hypre_CommPkgIdentityDir(comm_pkg); - send_order = hypre_CommPkgIdentityOrder(comm_pkg); + /* set up identity transform and order */ for (i = 0; i < ndim; i++) { - hypre_IndexD(send_coord, i) = i; - hypre_IndexD(send_dir, i) = 1; - } - for (i = 0; i < num_values; i++) - { - send_order[i] = i; + identity_coord[i] = i; + identity_dir[i] = 1; } /*------------------------------------------------------ * Set up send CommType information *------------------------------------------------------*/ - /* set data_offsets and compute num_boxes, num_entries */ + /* set the default send transform and order (may be changed below) */ + send_coord = identity_coord; + send_dir = identity_dir; + send_order = NULL; + if (orders != NULL) + { + /* use the order passed in */ + send_order = orders[0]; + } + + /* set data_offsets and compute num_boxes */ data_offsets = hypre_TAlloc(HYPRE_Int, hypre_BoxArraySize(send_data_space), HYPRE_MEMORY_HOST); - data_offset = 0; - num_boxes = 0; - num_entries = 0; + data_offset = num_boxes = 0; hypre_ForBoxI(i, send_data_space) { data_offsets[i] = data_offset; @@ -185,14 +174,6 @@ hypre_CommPkgCreate( hypre_CommInfo *comm_info, { box_array = hypre_BoxArrayArrayBoxArray(send_boxes, i); num_boxes += hypre_BoxArraySize(box_array); - hypre_ForBoxI(j, box_array) - { - box = hypre_BoxArrayBox(box_array, j); - if (hypre_BoxVolume(box) != 0) - { - num_entries++; - } - } } } @@ -200,7 +181,7 @@ hypre_CommPkgCreate( hypre_CommInfo *comm_info, comm_boxes_p = hypre_TAlloc(HYPRE_Int, num_boxes, HYPRE_MEMORY_HOST); comm_boxes_i = hypre_TAlloc(HYPRE_Int, num_boxes, HYPRE_MEMORY_HOST); comm_boxes_j = hypre_TAlloc(HYPRE_Int, num_boxes, HYPRE_MEMORY_HOST); - num_boxes = 0; + num_boxes = 0; hypre_ForBoxArrayI(i, send_boxes) { box_array = hypre_BoxArrayArrayBoxArray(send_boxes, i); @@ -214,18 +195,44 @@ hypre_CommPkgCreate( hypre_CommInfo *comm_info, } hypre_qsort3i(comm_boxes_p, comm_boxes_i, comm_boxes_j, 0, num_boxes - 1); + /* count cb_num_entries */ + cb_num_entries = hypre_TAlloc(HYPRE_Int, num_boxes, HYPRE_MEMORY_HOST); + n = p_old = -1; + for (m = 0; m < num_boxes; m++) + { + i = comm_boxes_i[m]; + j = comm_boxes_j[m]; + box_array = hypre_BoxArrayArrayBoxArray(send_boxes, i); + box = hypre_BoxArrayBox(box_array, j); + + if (hypre_BoxVolume(box) != 0) + { + p = comm_boxes_p[m]; + + /* start a new comm_type */ + if (p != p_old) + { + n++; + cb_num_entries[n] = 0; + p_old = p; + } + + cb_num_entries[n] ++; + } + } + /* compute comm_types */ /* make sure there is at least 1 comm_type allocated */ comm_types = hypre_CTAlloc(hypre_CommType, (num_boxes + 1), HYPRE_MEMORY_HOST); - ct_entries = hypre_TAlloc(hypre_CommEntryType, num_entries, HYPRE_MEMORY_HOST); - ct_rem_boxnums = hypre_TAlloc(HYPRE_Int, num_entries, HYPRE_MEMORY_HOST); - ct_rem_boxes = hypre_TAlloc(hypre_Box, num_entries, HYPRE_MEMORY_HOST); - hypre_CommPkgEntries(comm_pkg) = ct_entries; - hypre_CommPkgRemBoxnums(comm_pkg) = ct_rem_boxnums; - hypre_CommPkgRemBoxes(comm_pkg) = ct_rem_boxes; - - p_old = -1; + comm_type = &comm_types[0]; + hypre_CommTypeBufsize(comm_type) = 0; + hypre_CommTypeNDim(comm_type) = ndim; + hypre_CommTypeNumBlocks(comm_type) = 1; + hypre_CommTypeBlocks(comm_type) = hypre_CTAlloc(hypre_CommBlock, 1, HYPRE_MEMORY_HOST); + + k = 0; + n = p_old = -1; num_comms = 0; comm_bufsize = 0; comm_type = &comm_types[0]; @@ -245,62 +252,72 @@ hypre_CommPkgCreate( hypre_CommInfo *comm_info, /* start a new comm_type */ if (p != p_old) { + n++; + k = 0; + num_entries = cb_num_entries[n]; if (p != my_proc) { comm_type = &comm_types[num_comms + 1]; + hypre_CommTypeFirstComm(comm_type) = 1; + hypre_CommTypeProc(comm_type) = p; + hypre_CommTypeBufsize(comm_type) = 0; + hypre_CommTypeNDim(comm_type) = ndim; + hypre_CommTypeNumBlocks(comm_type) = 1; + hypre_CommTypeBlocks(comm_type) = hypre_CTAlloc(hypre_CommBlock, 1, + HYPRE_MEMORY_HOST); num_comms++; } else { comm_type = &comm_types[0]; } - hypre_CommTypeProc(comm_type) = p; - hypre_CommTypeBufsize(comm_type) = 0; - hypre_CommTypeNumEntries(comm_type) = 0; - hypre_CommTypeEntries(comm_type) = ct_entries; - hypre_CommTypeRemBoxnums(comm_type) = ct_rem_boxnums; - hypre_CommTypeRemBoxes(comm_type) = ct_rem_boxes; + comm_block = hypre_CommTypeBlock(comm_type, 0); + + hypre_CommBlockBufsize(comm_block) = 0; + hypre_CommBlockNDim(comm_block) = ndim; + hypre_CommBlockNumValues(comm_block) = num_values; + hypre_CommBlockNumEntries(comm_block) = num_entries; + hypre_CommBlockEntries(comm_block) = hypre_TAlloc(hypre_CommEntry, num_entries, + HYPRE_MEMORY_HOST); + hypre_CommBlockIMaps(comm_block) = hypre_TAlloc(HYPRE_Int, + num_entries * num_values, + HYPRE_MEMORY_HOST); + hypre_CommBlockRemBoxnums(comm_block) = hypre_TAlloc(HYPRE_Int, num_entries, + HYPRE_MEMORY_HOST); + hypre_CommBlockRemBoxes(comm_block) = hypre_TAlloc(hypre_Box, num_entries, + HYPRE_MEMORY_HOST); + hypre_CommBlockRemOrders(comm_block) = hypre_TAlloc(HYPRE_Int, + num_entries * num_values, + HYPRE_MEMORY_HOST); p_old = p; } - k = hypre_CommTypeNumEntries(comm_type); hypre_BoxGetStrideVolume(box, send_stride, &size); - hypre_CommTypeBufsize(comm_type) += (size * num_values); - comm_bufsize += (size * num_values); + hypre_CommBlockBufsize(comm_block) += (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) + if (num_transforms != 0) { send_coord = coords[send_transforms[i][j]]; send_dir = dirs[send_transforms[i][j]]; if (orders != NULL) { - send_order = cp_orders[send_transforms[i][j]]; + send_order = orders[send_transforms[i][j]]; } } - hypre_CommTypeSetEntry(box, send_stride, send_coord, send_dir, - send_order, data_box, data_offsets[i], - hypre_CommTypeEntry(comm_type, k)); - hypre_CommTypeRemBoxnum(comm_type, k) = send_rboxnums[i][j]; + hypre_CommBlockSetEntry(comm_block, k, + box, send_stride, send_coord, send_dir, + send_order, hypre_CommBlockRemOrder(comm_block, k), + data_box, data_offsets[i]); + hypre_CommBlockRemBoxnum(comm_block, k) = send_rboxnums[i][j]; hypre_CopyBox(hypre_BoxArrayBox(rbox_array, j), - hypre_CommTypeRemBox(comm_type, k)); - hypre_CommTypeNumEntries(comm_type) ++; - ct_entries ++; - ct_rem_boxnums ++; - ct_rem_boxes ++; + hypre_CommBlockRemBox(comm_block, k)); + k++; } } - /* add space for prefix info */ - for (m = 1; m < (num_comms + 1); m++) - { - comm_type = &comm_types[m]; - k = hypre_CommTypeNumEntries(comm_type); - size = hypre_CommPrefixSize(k); - hypre_CommTypeBufsize(comm_type) += size; - comm_bufsize += size; - } - /* set send info in comm_pkg */ comm_types = hypre_TReAlloc(comm_types, hypre_CommType, (num_comms + 1), HYPRE_MEMORY_HOST); hypre_CommPkgSendBufsize(comm_pkg) = comm_bufsize; @@ -308,8 +325,9 @@ hypre_CommPkgCreate( hypre_CommInfo *comm_info, hypre_CommPkgSendTypes(comm_pkg) = &comm_types[1]; hypre_CommPkgCopyFromType(comm_pkg) = &comm_types[0]; - /* free up data_offsets */ + /* free up data_offsets and cb_num_entries */ hypre_TFree(data_offsets, HYPRE_MEMORY_HOST); + hypre_TFree(cb_num_entries, HYPRE_MEMORY_HOST); /*------------------------------------------------------ * Set up recv CommType information @@ -317,8 +335,7 @@ hypre_CommPkgCreate( hypre_CommInfo *comm_info, /* set data_offsets and compute num_boxes */ data_offsets = hypre_TAlloc(HYPRE_Int, hypre_BoxArraySize(recv_data_space), HYPRE_MEMORY_HOST); - data_offset = 0; - num_boxes = 0; + data_offset = num_boxes = 0; hypre_ForBoxI(i, recv_data_space) { data_offsets[i] = data_offset; @@ -332,14 +349,35 @@ hypre_CommPkgCreate( hypre_CommInfo *comm_info, num_boxes += hypre_BoxArraySize(box_array); } } - hypre_CommPkgRecvDataOffsets(comm_pkg) = data_offsets; - hypre_CommPkgRecvDataSpace(comm_pkg) = hypre_BoxArrayDuplicate(recv_data_space); + + { + hypre_Index *recv_strides; + hypre_BoxArray **recv_data_spaces; + HYPRE_Int **recv_data_offsets; + HYPRE_Int *boxes_match; + + recv_strides = hypre_TAlloc(hypre_Index, 1, HYPRE_MEMORY_HOST); + recv_data_spaces = hypre_TAlloc(hypre_BoxArray *, 1, HYPRE_MEMORY_HOST); + recv_data_offsets = hypre_TAlloc(HYPRE_Int *, 1, HYPRE_MEMORY_HOST); + boxes_match = hypre_TAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); + + hypre_CopyIndex(recv_stride, recv_strides[0]); + recv_data_spaces[0] = hypre_BoxArrayClone(recv_data_space); + recv_data_offsets[0] = data_offsets; + boxes_match[0] = hypre_CommInfoBoxesMatch(comm_info); + + hypre_CommPkgNumBlocks(comm_pkg) = 1; + hypre_CommPkgRecvStrides(comm_pkg) = recv_strides; + hypre_CommPkgRecvDataSpaces(comm_pkg) = recv_data_spaces; + hypre_CommPkgRecvDataOffsets(comm_pkg) = recv_data_offsets; + hypre_CommPkgBoxesMatch(comm_pkg) = boxes_match; + } /* set up comm_boxes_[pij] */ comm_boxes_p = hypre_TReAlloc(comm_boxes_p, HYPRE_Int, num_boxes, HYPRE_MEMORY_HOST); comm_boxes_i = hypre_TReAlloc(comm_boxes_i, HYPRE_Int, num_boxes, HYPRE_MEMORY_HOST); comm_boxes_j = hypre_TReAlloc(comm_boxes_j, HYPRE_Int, num_boxes, HYPRE_MEMORY_HOST); - num_boxes = 0; + num_boxes = 0; hypre_ForBoxArrayI(i, recv_boxes) { box_array = hypre_BoxArrayArrayBoxArray(recv_boxes, i); @@ -357,11 +395,16 @@ hypre_CommPkgCreate( hypre_CommInfo *comm_info, /* make sure there is at least 1 comm_type allocated */ comm_types = hypre_CTAlloc(hypre_CommType, (num_boxes + 1), HYPRE_MEMORY_HOST); + comm_type = &comm_types[0]; + hypre_CommTypeBufsize(comm_type) = 0; + hypre_CommTypeNDim(comm_type) = ndim; + hypre_CommTypeNumBlocks(comm_type) = 1; + hypre_CommTypeBlocks(comm_type) = hypre_CTAlloc(hypre_CommBlock, 1, HYPRE_MEMORY_HOST); p_old = -1; - num_comms = 0; + num_comms = 0; comm_bufsize = 0; - comm_type = &comm_types[0]; + comm_type = &comm_types[0]; for (m = 0; m < num_boxes; m++) { i = comm_boxes_i[m]; @@ -381,36 +424,37 @@ hypre_CommPkgCreate( hypre_CommInfo *comm_info, if (p != my_proc) { comm_type = &comm_types[num_comms + 1]; + hypre_CommTypeFirstComm(comm_type) = 1; + hypre_CommTypeProc(comm_type) = p; + hypre_CommTypeBufsize(comm_type) = 0; + hypre_CommTypeNDim(comm_type) = ndim; + hypre_CommTypeNumBlocks(comm_type) = 1; + hypre_CommTypeBlocks(comm_type) = hypre_CTAlloc(hypre_CommBlock, 1, + HYPRE_MEMORY_HOST); num_comms++; } else { comm_type = &comm_types[0]; } - hypre_CommTypeProc(comm_type) = p; - hypre_CommTypeBufsize(comm_type) = 0; - hypre_CommTypeNumEntries(comm_type) = 0; + comm_block = hypre_CommTypeBlock(comm_type, 0); + + hypre_CommBlockBufsize(comm_block) = 0; + hypre_CommBlockNDim(comm_block) = ndim; + hypre_CommBlockNumValues(comm_block) = num_values; + hypre_CommBlockNumEntries(comm_block) = 0; p_old = p; } - k = hypre_CommTypeNumEntries(comm_type); + k = hypre_CommBlockNumEntries(comm_block); hypre_BoxGetStrideVolume(box, recv_stride, &size); - hypre_CommTypeBufsize(comm_type) += (size * num_values); - comm_bufsize += (size * num_values); - hypre_CommTypeNumEntries(comm_type) ++; + hypre_CommBlockBufsize(comm_block) += (size * num_values); + hypre_CommTypeBufsize(comm_type) += (size * num_values); + comm_bufsize += (size * num_values); + hypre_CommBlockNumEntries(comm_block) ++; } } - /* add space for prefix info */ - for (m = 1; m < (num_comms + 1); m++) - { - comm_type = &comm_types[m]; - k = hypre_CommTypeNumEntries(comm_type); - size = hypre_CommPrefixSize(k); - hypre_CommTypeBufsize(comm_type) += size; - comm_bufsize += size; - } - /* set recv info in comm_pkg */ comm_types = hypre_TReAlloc(comm_types, hypre_CommType, (num_comms + 1), HYPRE_MEMORY_HOST); hypre_CommPkgRecvBufsize(comm_pkg) = comm_bufsize; @@ -418,32 +462,40 @@ hypre_CommPkgCreate( hypre_CommInfo *comm_info, hypre_CommPkgRecvTypes(comm_pkg) = &comm_types[1]; hypre_CommPkgCopyToType(comm_pkg) = &comm_types[0]; - /* if CommInfo send/recv boxes don't match, compute a max bufsize */ - if ( !hypre_CommInfoBoxesMatch(comm_info) ) + /* set up CopyToType */ { - hypre_CommPkgRecvBufsize(comm_pkg) = 0; - for (i = 0; i < hypre_CommPkgNumRecvs(comm_pkg); i++) - { - comm_type = hypre_CommPkgRecvType(comm_pkg, i); - - /* subtract off old (incorrect) prefix size */ - num_entries = hypre_CommTypeNumEntries(comm_type); - hypre_CommTypeBufsize(comm_type) -= hypre_CommPrefixSize(num_entries); - - /* set num_entries to number of grid points and add new prefix size */ - num_entries = hypre_CommTypeBufsize(comm_type); - hypre_CommTypeNumEntries(comm_type) = num_entries; - size = hypre_CommPrefixSize(num_entries); - hypre_CommTypeBufsize(comm_type) += size; - hypre_CommPkgRecvBufsize(comm_pkg) += hypre_CommTypeBufsize(comm_type); - } + hypre_CommType *from_type, *to_type; + hypre_CommBlock *from_block, *to_block; + + from_type = hypre_CommPkgCopyFromType(comm_pkg); + to_type = hypre_CommPkgCopyToType(comm_pkg); + from_block = hypre_CommTypeBlock(from_type, 0); + to_block = hypre_CommTypeBlock(to_type, 0); + num_entries = hypre_CommBlockNumEntries(from_block); + hypre_CommBlockNumEntries(to_block) = num_entries; + hypre_CommBlockEntries(to_block) = hypre_TAlloc(hypre_CommEntry, num_entries, + HYPRE_MEMORY_HOST); + hypre_CommBlockIMaps(to_block) = hypre_TAlloc(HYPRE_Int, (num_entries * num_values), + HYPRE_MEMORY_HOST); + hypre_CommBlockSetEntries(to_block, + hypre_CommBlockRemBoxnums(from_block), + hypre_CommBlockRemBoxes(from_block), + hypre_CommBlockRemOrders(from_block), + recv_stride, recv_data_space, data_offsets); + hypre_TFree(hypre_CommBlockRemBoxnums(from_block), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_CommBlockRemBoxes(from_block), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_CommBlockRemOrders(from_block), HYPRE_MEMORY_HOST); } - hypre_CommPkgSendBufsizeFirstComm(comm_pkg) = hypre_CommPkgSendBufsize(comm_pkg); - hypre_CommPkgRecvBufsizeFirstComm(comm_pkg) = hypre_CommPkgRecvBufsize(comm_pkg); + /*------------------------------------------------------ + * Set buffer prefix sizes + *------------------------------------------------------*/ + + hypre_CommPkgSetPrefixSizes(comm_pkg); /*------------------------------------------------------ * Debugging stuff - ONLY WORKS FOR 3D + * - Also needs to be updated to use new data structures *------------------------------------------------------*/ #if DEBUG @@ -525,10 +577,10 @@ hypre_CommPkgCreate( hypre_CommInfo *comm_info, #if DEBUG { - hypre_CommEntryType *comm_entry; - HYPRE_Int offset, dim; - HYPRE_Int *length; - HYPRE_Int *stride; + hypre_CommEntry *comm_entry; + HYPRE_Int offset, ndim; + HYPRE_Int *length; + HYPRE_Int *stride; hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &my_proc); @@ -554,12 +606,12 @@ hypre_CommPkgCreate( hypre_CommInfo *comm_info, for (i = 0; i < hypre_CommTypeNumEntries(comm_type); i++) { comm_entry = hypre_CommTypeEntry(comm_type, i); - offset = hypre_CommEntryTypeOffset(comm_entry); - dim = hypre_CommEntryTypeDim(comm_entry); - length = hypre_CommEntryTypeLengthArray(comm_entry); - stride = hypre_CommEntryTypeStrideArray(comm_entry); + offset = hypre_CommEntryOffset(comm_entry); + dnim = hypre_CommEntryNDim(comm_entry); + length = hypre_CommEntryLengthArray(comm_entry); + stride = hypre_CommEntryStrideArray(comm_entry); hypre_fprintf(file, "%d: %d,%d,(%d,%d,%d,%d),(%d,%d,%d,%d)\n", - i, offset, dim, + i, offset, ndim, length[0], length[1], length[2], length[3], stride[0], stride[1], stride[2], stride[3]); } @@ -578,12 +630,12 @@ hypre_CommPkgCreate( hypre_CommInfo *comm_info, for (i = 0; i < hypre_CommTypeNumEntries(comm_type); i++) { comm_entry = hypre_CommTypeEntry(comm_type, i); - offset = hypre_CommEntryTypeOffset(comm_entry); - dim = hypre_CommEntryTypeDim(comm_entry); - length = hypre_CommEntryTypeLengthArray(comm_entry); - stride = hypre_CommEntryTypeStrideArray(comm_entry); + offset = hypre_CommEntryOffset(comm_entry); + ndim = hypre_CommEntryNDim(comm_entry); + length = hypre_CommEntryLengthArray(comm_entry); + stride = hypre_CommEntryStrideArray(comm_entry); hypre_fprintf(file, "%d: %d,%d,(%d,%d,%d,%d),(%d,%d,%d,%d)\n", - i, offset, dim, + i, offset, ndim, length[0], length[1], length[2], length[3], stride[0], stride[1], stride[2], stride[3]); } @@ -614,61 +666,79 @@ hypre_CommPkgCreate( hypre_CommInfo *comm_info, } /*-------------------------------------------------------------------------- - * Note that this routine assumes an identity coordinate transform + * Note that this routine uses an identity coordinate transform. *--------------------------------------------------------------------------*/ 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_CommBlockSetEntries( hypre_CommBlock *comm_block, + HYPRE_Int *boxnums, + hypre_Box *boxes, + HYPRE_Int *orders, + hypre_Index stride, + hypre_BoxArray *data_space, + HYPRE_Int *data_offsets ) { - HYPRE_Int num_entries = hypre_CommTypeNumEntries(comm_type); - hypre_CommEntryType *entries = hypre_CommTypeEntries(comm_type); + HYPRE_Int ndim = hypre_CommBlockNDim(comm_block); + HYPRE_Int num_values = hypre_CommBlockNumValues(comm_block); + HYPRE_Int num_entries = hypre_CommBlockNumEntries(comm_block); hypre_Box *box; hypre_Box *data_box; - HYPRE_Int i, j; + hypre_Index coord, dir; + HYPRE_Int *order; + HYPRE_Int i, j, k; + + /* set identity transform */ + for (i = 0; i < ndim; i++) + { + coord[i] = i; + dir[i] = 1; + } for (j = 0; j < num_entries; j++) { - i = boxnums[j]; + k = boxnums[j]; box = &boxes[j]; - data_box = hypre_BoxArrayBox(data_space, i); + order = &orders[j * num_values]; + data_box = hypre_BoxArrayBox(data_space, k); - hypre_CommTypeSetEntry(box, stride, coord, dir, order, - data_box, data_offsets[i], &entries[j]); + hypre_CommBlockSetEntry(comm_block, j, box, stride, coord, dir, + order, NULL, data_box, data_offsets[k]); } return hypre_error_flag; } /*-------------------------------------------------------------------------- + * If order is NULL, a natural incremental order is used. If rem_order is not + * NULL, then it is set to the equivalent remote ordering. *--------------------------------------------------------------------------*/ 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_CommBlockSetEntry( hypre_CommBlock *comm_block, + HYPRE_Int comm_num, + hypre_Box *box, + hypre_Index stride, + hypre_Index coord, + hypre_Index dir, + HYPRE_Int *order, + HYPRE_Int *rem_order, + hypre_Box *data_box, + HYPRE_Int data_box_offset ) { - HYPRE_Int dim, ndim = hypre_BoxNDim(box); - HYPRE_Int offset; - HYPRE_Int *length_array, tmp_length_array[HYPRE_MAXDIM]; - HYPRE_Int *stride_array, tmp_stride_array[HYPRE_MAXDIM]; - hypre_Index size; - HYPRE_Int i, j; + hypre_CommEntry *comm_entry = hypre_CommBlockEntry(comm_block, comm_num); + HYPRE_Int num_values = hypre_CommBlockNumValues(comm_block); - length_array = hypre_CommEntryTypeLengthArray(comm_entry); - stride_array = hypre_CommEntryTypeStrideArray(comm_entry); + HYPRE_Int ndim = hypre_BoxNDim(box); + HYPRE_Int dim; + HYPRE_Int offset; + HYPRE_Int *length_array, tmp_length_array[HYPRE_MAXDIM]; + HYPRE_Int *stride_array, tmp_stride_array[HYPRE_MAXDIM]; + HYPRE_Int *entry_imap; + hypre_Index size; + HYPRE_Int i, j; + + length_array = hypre_CommEntryLengthArray(comm_entry); + stride_array = hypre_CommEntryStrideArray(comm_entry); /* initialize offset */ offset = data_box_offset + hypre_BoxIndexRank(data_box, hypre_BoxIMin(box)); @@ -684,6 +754,7 @@ hypre_CommTypeSetEntry( hypre_Box *box, stride_array[i] *= hypre_BoxSizeD(data_box, j); } } + length_array[ndim] = num_values; stride_array[ndim] = hypre_BoxVolume(data_box); /* make adjustments for dir */ @@ -712,17 +783,17 @@ hypre_CommTypeSetEntry( hypre_Box *box, /* eliminate dimensions with length_array = 1 */ dim = ndim; i = 0; - while (i < dim) + while ((dim > 1) && (i < dim)) /* make sure dim is at least one */ { if (length_array[i] == 1) { - for (j = i; j < (dim - 1); j++) + for (j = i; j < dim; j++) { length_array[j] = length_array[j + 1]; stride_array[j] = stride_array[j + 1]; } - length_array[dim - 1] = 1; - stride_array[dim - 1] = 1; + length_array[dim] = 1; + stride_array[dim] = 1; dim--; } else @@ -751,40 +822,544 @@ hypre_CommTypeSetEntry( hypre_Box *box, } #endif - /* if every len was 1 we need to fix to communicate at least one */ - if (!dim) + hypre_CommEntryOffset(comm_entry) = offset; + hypre_CommEntryNDim(comm_entry) = dim; + entry_imap = hypre_CommBlockIMap(comm_block, comm_num); + if (order != NULL) { - dim = 1; + /* Set imap to order and compress */ + j = 0; + for (i = 0; i < num_values; i++) + { + if (order[i] > -1) + { + entry_imap[j++] = order[i]; + } + if (rem_order != NULL) + { + rem_order[i] = -1; + if (order[i] > -1) + { + rem_order[i] = i; + } + } + } + length_array[dim] = j; } + else + { + /* Set imap to natural incremental order */ + for (i = 0; i < num_values; i++) + { + entry_imap[i] = i; + if (rem_order != NULL) + { + rem_order[i] = i; + } + } + } + hypre_CommEntryIMap(comm_entry) = entry_imap; - hypre_CommEntryTypeOffset(comm_entry) = offset; - hypre_CommEntryTypeDim(comm_entry) = dim; - hypre_CommEntryTypeOrder(comm_entry) = order; + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommPkgSetPrefixSizes( hypre_CommPkg *comm_pkg ) +{ + HYPRE_Int num_sends = hypre_CommPkgNumSends(comm_pkg); + HYPRE_Int num_recvs = hypre_CommPkgNumRecvs(comm_pkg); + HYPRE_Int num_blocks = hypre_CommPkgNumBlocks(comm_pkg); + HYPRE_Int *boxes_match = hypre_CommPkgBoxesMatch(comm_pkg); + + hypre_CommType *comm_type; + hypre_CommBlock *comm_block; + HYPRE_Int i, b, num_values, num_entries; + size_t buffer_size; + + for (i = 0; i < num_sends; i++) + { + comm_type = hypre_CommPkgSendType(comm_pkg, i); + for (b = 0; b < num_blocks; b++) + { + comm_block = hypre_CommTypeBlock(comm_type, b); + num_values = hypre_CommBlockNumValues(comm_block); + num_entries = hypre_CommBlockNumEntries(comm_block); + buffer_size = hypre_CommPrefixSize(num_entries, num_values); + + hypre_CommBlockPfxsize(comm_block) = (HYPRE_Int) buffer_size; + hypre_CommPkgSendBufsize(comm_pkg) += (HYPRE_Int) buffer_size; + } + } + + for (i = 0; i < num_recvs; i++) + { + comm_type = hypre_CommPkgRecvType(comm_pkg, i); + for (b = 0; b < num_blocks; b++) + { + comm_block = hypre_CommTypeBlock(comm_type, b); + num_values = hypre_CommBlockNumValues(comm_block); + num_entries = hypre_CommBlockNumEntries(comm_block); + if ( !boxes_match[b] ) + { + num_entries = hypre_CommBlockBufsize(comm_block); + } + buffer_size = hypre_CommPrefixSize(num_entries, num_values); + hypre_CommBlockPfxsize(comm_block) = (HYPRE_Int) buffer_size; + hypre_CommPkgRecvBufsize(comm_pkg) += (HYPRE_Int) buffer_size; + } + } return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * Create a new CommPkg out of several others + * + * This assumes that the MPI communicators are all the same and that the + * first_comm arguments are all 1. The ordering of the agglomerated blocks + * starts with the blocks in comm_pkg[0] and continues with comm_pkg[1], etc. + * The original comm_pkgs are left intact so that they can be used separately. + * + * See companion functions CommPkgAgglomData() and CommPkgAgglomDestroy(). + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommPkgAgglomerate( HYPRE_Int num_comm_pkgs, + hypre_CommPkg **comm_pkgs, + hypre_CommPkg **agg_comm_pkg_ptr ) +{ + hypre_CommPkg *agg_comm_pkg; + + MPI_Comm comm = hypre_CommPkgComm(comm_pkgs[0]); + HYPRE_Int ndim = hypre_CommPkgNDim(comm_pkgs[0]); + + hypre_CommType *comm_types; + hypre_CommType *comm_type = NULL; + hypre_CommType *in_comm_type; + hypre_CommBlock *comm_block, *in_comm_block; + hypre_CommEntry *comm_entry; + HYPRE_Int *ctype_p, *ctype_i, *ctype_j; + HYPRE_Int num_ctypes, num_comms; + HYPRE_Int num_values, num_entries, num_ev; + HYPRE_Int num_blocks, *block_starts, in_num_blocks; + HYPRE_Int buffer_size; + + HYPRE_Int i, j, b, k, m, p, p_old, srcase, my_proc; + + /*------------------------------------------------------ + * TODO: + * - check possible NULL pointers in rem_boxnums, copy types, etc. + *------------------------------------------------------*/ + + /* Sanity check */ + if (num_comm_pkgs < 1) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Cannot agglomerate less than 1 comm. pkg"); + return hypre_error_flag; + } + + hypre_MPI_Comm_rank(comm, &my_proc); + + agg_comm_pkg = hypre_CTAlloc(hypre_CommPkg, 1, HYPRE_MEMORY_HOST); + hypre_CommPkgComm(agg_comm_pkg) = comm; + hypre_CommPkgNDim(agg_comm_pkg) = ndim; + hypre_CommPkgMemoryLocation(agg_comm_pkg) = hypre_CommPkgMemoryLocation(comm_pkgs[0]); + + block_starts = hypre_TAlloc(HYPRE_Int, num_comm_pkgs, HYPRE_MEMORY_HOST); + num_blocks = 0; + for (i = 0; i < num_comm_pkgs; i++) + { + block_starts[i] = num_blocks; + num_blocks += hypre_CommPkgNumBlocks(comm_pkgs[i]); + if (hypre_CommPkgMemoryLocation(agg_comm_pkg) != + hypre_CommPkgMemoryLocation(comm_pkgs[i])) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Cannot agglomerate comm. pkgs with different memory locations"); + return hypre_error_flag; + } + } + + /*------------------------------------------------------ + * Set up send/recv CommType information + *------------------------------------------------------*/ + + for (srcase = 0; srcase < 2; srcase++) + { + /* compute num_ctypes */ + num_ctypes = 0; + for (i = 0; i < num_comm_pkgs; i++) + { + switch (srcase) + { + case 0: + num_ctypes += hypre_CommPkgNumSends(comm_pkgs[i]) + 1; + break; + + case 1: + num_ctypes += hypre_CommPkgNumRecvs(comm_pkgs[i]) + 1; + break; + } + } + + /* set up ctypes_[pij] */ + ctype_p = hypre_TAlloc(HYPRE_Int, num_ctypes, HYPRE_MEMORY_HOST); + ctype_i = hypre_TAlloc(HYPRE_Int, num_ctypes, HYPRE_MEMORY_HOST); + ctype_j = hypre_TAlloc(HYPRE_Int, num_ctypes, HYPRE_MEMORY_HOST); + num_ctypes = 0; + for (i = 0; i < num_comm_pkgs; i++) + { + switch (srcase) + { + case 0: + num_comms = hypre_CommPkgNumSends(comm_pkgs[i]); + comm_types = hypre_CommPkgSendTypes(comm_pkgs[i]); + break; + + case 1: + num_comms = hypre_CommPkgNumRecvs(comm_pkgs[i]); + comm_types = hypre_CommPkgRecvTypes(comm_pkgs[i]); + break; + } + for (j = 0; j < num_comms; j++) + { + comm_type = &comm_types[j]; + ctype_p[num_ctypes] = hypre_CommTypeProc(comm_type); + ctype_i[num_ctypes] = i; + ctype_j[num_ctypes] = j; + num_ctypes++; + } + } + hypre_qsort3i(ctype_p, ctype_i, ctype_j, 0, num_ctypes - 1); + + /* Append copy_[from|to]_type here to simplify things below */ + for (i = 0; i < num_comm_pkgs; i++) + { + ctype_p[num_ctypes] = my_proc; + ctype_i[num_ctypes] = i; + ctype_j[num_ctypes] = -1; + num_ctypes++; + } + + /* Allocate memory for comm_types */ + comm_types = hypre_TAlloc(hypre_CommType, num_ctypes, HYPRE_MEMORY_HOST); + + p_old = -1; + num_comms = 0; + buffer_size = 0; + for (m = 0; m < num_ctypes; m++) + { + i = ctype_i[m]; + j = ctype_j[m]; + p = ctype_p[m]; + + /* start a new comm_type */ + if (p != p_old) + { + if (p != my_proc) + { + comm_type = &comm_types[num_comms + 1]; + num_comms++; + } + else + { + comm_type = &comm_types[0]; + } + + hypre_CommTypeFirstComm(comm_type) = 1; + hypre_CommTypeProc(comm_type) = p; + hypre_CommTypeBufsize(comm_type) = 0; + hypre_CommTypeNDim(comm_type) = ndim; + hypre_CommTypeNumBlocks(comm_type) = num_blocks; + hypre_CommTypeBlocks(comm_type) = hypre_CTAlloc(hypre_CommBlock, num_blocks, + HYPRE_MEMORY_HOST); + p_old = p; + } + + switch (srcase) + { + case 0: + in_comm_type = hypre_CommPkgSendType(comm_pkgs[i], j); + break; + + case 1: + in_comm_type = hypre_CommPkgRecvType(comm_pkgs[i], j); + break; + } + + in_num_blocks = hypre_CommTypeNumBlocks(in_comm_type); + for (b = 0; b < in_num_blocks; b++) + { + in_comm_block = hypre_CommTypeBlock(in_comm_type, b); + num_values = hypre_CommBlockNumValues(in_comm_block); + num_entries = hypre_CommBlockNumEntries(in_comm_block); + num_ev = num_entries * num_values; + + comm_block = hypre_CommTypeBlock(comm_type, block_starts[i] + b); + hypre_CommBlockBufsize(comm_block) = hypre_CommBlockBufsize(in_comm_block); + hypre_CommBlockNDim(comm_block) = ndim; + hypre_CommBlockNumValues(comm_block) = num_values; + hypre_CommBlockNumEntries(comm_block) = num_entries; + if (hypre_CommBlockEntries(in_comm_block) != NULL) + { + /* allocate arrays */ + hypre_CommBlockEntries(comm_block) = + hypre_TAlloc(hypre_CommEntry, num_entries, HYPRE_MEMORY_HOST); + hypre_CommBlockIMaps(comm_block) = + hypre_TAlloc(HYPRE_Int, num_ev, HYPRE_MEMORY_HOST); + + /* copy data into arrays */ + hypre_TMemcpy(hypre_CommBlockEntries(comm_block), + hypre_CommBlockEntries(in_comm_block), + hypre_CommEntry, num_entries, + HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + hypre_TMemcpy(hypre_CommBlockIMaps(comm_block), + hypre_CommBlockIMaps(in_comm_block), + HYPRE_Int, num_ev, + HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + + /* fix imap pointers */ + for (k = 0; k < num_entries; k++) + { + comm_entry = hypre_CommBlockEntry(comm_block, k); + hypre_CommEntryIMap(comm_entry) = + hypre_CommBlockIMap(comm_block, k); + } + } + if (hypre_CommBlockRemBoxnums(in_comm_block) != NULL) + { + /* allocate arrays */ + hypre_CommBlockRemBoxnums(comm_block) = + hypre_TAlloc(HYPRE_Int, num_entries, HYPRE_MEMORY_HOST); + hypre_CommBlockRemBoxes(comm_block) = + hypre_TAlloc(hypre_Box, num_entries, HYPRE_MEMORY_HOST); + hypre_CommBlockRemOrders(comm_block) = + hypre_TAlloc(HYPRE_Int, num_ev, HYPRE_MEMORY_HOST); + + /* copy data into arrays */ + hypre_TMemcpy(hypre_CommBlockRemBoxnums(comm_block), + hypre_CommBlockRemBoxnums(in_comm_block), + HYPRE_Int, num_entries, + HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + hypre_TMemcpy(hypre_CommBlockRemBoxes(comm_block), + hypre_CommBlockRemBoxes(in_comm_block), + hypre_Box, num_entries, + HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + hypre_TMemcpy(hypre_CommBlockRemOrders(comm_block), + hypre_CommBlockRemOrders(in_comm_block), + HYPRE_Int, num_ev, + HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + } + + hypre_CommTypeBufsize(comm_type) += hypre_CommBlockBufsize(comm_block); + buffer_size += hypre_CommBlockBufsize(comm_block); + } + } + + hypre_TFree(ctype_p, HYPRE_MEMORY_HOST); + hypre_TFree(ctype_i, HYPRE_MEMORY_HOST); + hypre_TFree(ctype_j, HYPRE_MEMORY_HOST); + + /* set send/recv info in comm_pkg */ + comm_types = hypre_TReAlloc(comm_types, hypre_CommType, (num_comms + 1), HYPRE_MEMORY_HOST); + switch (srcase) + { + case 0: + hypre_CommPkgNumSends(agg_comm_pkg) = num_comms; + hypre_CommPkgSendBufsize(agg_comm_pkg) = buffer_size; + hypre_CommPkgSendTypes(agg_comm_pkg) = &comm_types[1]; + hypre_CommPkgCopyFromType(agg_comm_pkg) = &comm_types[0]; + break; + + case 1: + hypre_CommPkgNumRecvs(agg_comm_pkg) = num_comms; + hypre_CommPkgRecvBufsize(agg_comm_pkg) = buffer_size; + hypre_CommPkgRecvTypes(agg_comm_pkg) = &comm_types[1]; + hypre_CommPkgCopyToType(agg_comm_pkg) = &comm_types[0]; + break; + } + } + + { + hypre_Index *recv_strides, *in_recv_strides; + hypre_BoxArray **recv_data_spaces, **in_recv_data_spaces; + HYPRE_Int **recv_data_offsets, **in_recv_data_offsets, size; + HYPRE_Int *boxes_match, *in_boxes_match; + + recv_strides = hypre_TAlloc(hypre_Index, num_blocks, HYPRE_MEMORY_HOST); + recv_data_spaces = hypre_TAlloc(hypre_BoxArray *, num_blocks, HYPRE_MEMORY_HOST); + recv_data_offsets = hypre_TAlloc(HYPRE_Int *, num_blocks, HYPRE_MEMORY_HOST); + boxes_match = hypre_TAlloc(HYPRE_Int, num_blocks, HYPRE_MEMORY_HOST); + for (i = 0; i < num_comm_pkgs; i++) + { + in_num_blocks = hypre_CommPkgNumBlocks(comm_pkgs[i]); + for (b = 0; b < in_num_blocks; b++) + { + in_recv_strides = hypre_CommPkgRecvStrides(comm_pkgs[i]); + in_recv_data_spaces = hypre_CommPkgRecvDataSpaces(comm_pkgs[i]); + in_recv_data_offsets = hypre_CommPkgRecvDataOffsets(comm_pkgs[i]); + in_boxes_match = hypre_CommPkgBoxesMatch(comm_pkgs[i]); + + j = block_starts[i] + b; + hypre_CopyIndex(in_recv_strides[b], recv_strides[j]); + recv_data_spaces[j] = hypre_BoxArrayClone(in_recv_data_spaces[b]); + size = hypre_BoxArraySize(in_recv_data_spaces[b]); + + recv_data_offsets[j] = hypre_TAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); + hypre_TMemcpy(recv_data_offsets[j], in_recv_data_offsets[b], + HYPRE_Int, size, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); + + boxes_match[j] = in_boxes_match[b]; + } + } + hypre_CommPkgNumBlocks(agg_comm_pkg) = num_blocks; + hypre_CommPkgRecvStrides(agg_comm_pkg) = recv_strides; + hypre_CommPkgRecvDataSpaces(agg_comm_pkg) = recv_data_spaces; + hypre_CommPkgRecvDataOffsets(agg_comm_pkg) = recv_data_offsets; + hypre_CommPkgBoxesMatch(agg_comm_pkg) = boxes_match; + } + + /*------------------------------------------------------ + * Set buffer prefix sizes + *------------------------------------------------------*/ + + hypre_CommPkgSetPrefixSizes(agg_comm_pkg); + + hypre_TFree(block_starts, HYPRE_MEMORY_HOST); + + *agg_comm_pkg_ptr = agg_comm_pkg; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Companion function to CommPkgAgglomerate() for agglomerating data pointers + * before communication. For any given agglomerated CommPkg, this function can + * be used multiple times to agglomerate new data pointers. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommPkgAgglomData( HYPRE_Int num_comm_pkgs, + hypre_CommPkg **comm_pkg_a, + HYPRE_Complex ***comm_data_a, + hypre_CommPkg *comm_pkg, + HYPRE_Complex ***agg_comm_data_ptr ) +{ + HYPRE_Complex **agg_comm_data = NULL; + HYPRE_Int i, j, nb; + + HYPRE_ANNOTATE_FUNC_BEGIN; + + if (num_comm_pkgs > 0) + { + agg_comm_data = hypre_TAlloc(HYPRE_Complex *, hypre_CommPkgNumBlocks(comm_pkg), + HYPRE_MEMORY_HOST); + nb = 0; + for (i = 0; i < num_comm_pkgs; i++) + { + for (j = 0; j < hypre_CommPkgNumBlocks(comm_pkg_a[i]); j++) + { + agg_comm_data[nb++] = comm_data_a[i][j]; + } + } + } + + *agg_comm_data_ptr = agg_comm_data; + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Free up CommPkg and/or CommPkg data arrays used in Agglomerate() function. + * Use NULL arguments to control which arrays to free. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CommPkgAgglomDestroy( HYPRE_Int num_comm_pkgs, + hypre_CommPkg **comm_pkg_a, + HYPRE_Complex ***comm_data_a ) +{ + HYPRE_Int i; + + HYPRE_ANNOTATE_FUNC_BEGIN; + + if (num_comm_pkgs > 0) + { + if (comm_pkg_a) + { + for (i = 0; i < num_comm_pkgs; i++) + { + hypre_CommPkgDestroy(comm_pkg_a[i]); + } + hypre_TFree(comm_pkg_a, HYPRE_MEMORY_HOST); + } + if (comm_data_a) + { + for (i = 0; i < num_comm_pkgs; i++) + { + hypre_TFree(comm_data_a[i], HYPRE_MEMORY_HOST); + } + hypre_TFree(comm_data_a, HYPRE_MEMORY_HOST); + } + } + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + HYPRE_Complex * hypre_StructCommunicationGetBuffer(HYPRE_MemoryLocation memory_location, - HYPRE_Int size) + HYPRE_Int size, + HYPRE_Int is_send) { HYPRE_Complex *ptr; #if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) + HYPRE_Int buffer_size; + HYPRE_Int new_size; + if (hypre_GetActualMemLocation(memory_location) != hypre_MEMORY_HOST) { - if (size > hypre_HandleStructCommSendBufferSize(hypre_handle())) + buffer_size = is_send ? + hypre_HandleStructCommSendBufferSize(hypre_handle()) : + hypre_HandleStructCommRecvBufferSize(hypre_handle()); + + if (size > buffer_size) { - 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); + new_size = 5 * size; + + if (is_send) + { + 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); + } + else + { + hypre_HandleStructCommRecvBufferSize(hypre_handle()) = new_size; + hypre_TFree(hypre_HandleStructCommRecvBuffer(hypre_handle()), memory_location); + hypre_HandleStructCommRecvBuffer(hypre_handle()) = + hypre_CTAlloc(HYPRE_Complex, new_size, memory_location); + } } - ptr = hypre_HandleStructCommSendBuffer(hypre_handle()); + ptr = is_send ? + hypre_HandleStructCommSendBuffer(hypre_handle()) : + hypre_HandleStructCommRecvBuffer(hypre_handle()); } else +#else + HYPRE_UNUSED_VAR(is_send); #endif { ptr = hypre_CTAlloc(HYPRE_Complex, size, memory_location); @@ -793,6 +1368,9 @@ hypre_StructCommunicationGetBuffer(HYPRE_MemoryLocation memory_location, return ptr; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_StructCommunicationReleaseBuffer(HYPRE_Complex *buffer, HYPRE_MemoryLocation memory_location) @@ -817,84 +1395,143 @@ hypre_StructCommunicationReleaseBuffer(HYPRE_Complex *buffer, *--------------------------------------------------------------------------*/ 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_StructCommunicationInitialize( 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; - - HYPRE_Int ndim = hypre_CommPkgNDim(comm_pkg); - HYPRE_Int num_values = hypre_CommPkgNumValues(comm_pkg); - HYPRE_Int num_sends = hypre_CommPkgNumSends(comm_pkg); - HYPRE_Int num_recvs = hypre_CommPkgNumRecvs(comm_pkg); - MPI_Comm comm = hypre_CommPkgComm(comm_pkg); + MPI_Comm comm = hypre_CommPkgComm(comm_pkg); + HYPRE_Int num_sends = hypre_CommPkgNumSends(comm_pkg); + HYPRE_Int num_recvs = hypre_CommPkgNumRecvs(comm_pkg); + HYPRE_Int num_blocks = hypre_CommPkgNumBlocks(comm_pkg); + HYPRE_MemoryLocation memory_location = hypre_CommPkgMemoryLocation(comm_pkg); + HYPRE_MemoryLocation memory_location_mpi; HYPRE_Int num_requests; hypre_MPI_Request *requests; hypre_MPI_Status *status; + HYPRE_Int *send_bufsizes; + HYPRE_Int *recv_bufsizes; HYPRE_Complex **send_buffers; HYPRE_Complex **recv_buffers; HYPRE_Complex **send_buffers_mpi; HYPRE_Complex **recv_buffers_mpi; + HYPRE_Complex **sdata; + HYPRE_Complex **rdata; - hypre_CommType *comm_type, *from_type, *to_type; - hypre_CommEntryType *comm_entry; - HYPRE_Int num_entries; + hypre_CommHandle *comm_handle; + hypre_CommType *comm_type; + hypre_CommBlock *comm_block; + hypre_CommEntry *comm_entry; + HYPRE_Int num_values, num_entries, offset; HYPRE_Int *length_array; - HYPRE_Int *stride_array, unitst_array[HYPRE_MAXDIM + 1]; - HYPRE_Int *order; + HYPRE_Int *stride_array; + HYPRE_Int unitst_array[HYPRE_MAXDIM + 1]; + HYPRE_Int *imap; HYPRE_Complex *dptr, *kptr, *lptr; HYPRE_Int *qptr; - HYPRE_Int i, j, d, ll; - HYPRE_Int size; + HYPRE_Int i, j, b, d, ll, ndim, size; - HYPRE_MemoryLocation memory_location = hypre_HandleMemoryLocation(hypre_handle()); - HYPRE_MemoryLocation memory_location_mpi = memory_location; + /* Set memory location for MPI buffers */ + memory_location_mpi = hypre_GetGpuAwareMPI() ? memory_location : HYPRE_MEMORY_HOST; + +#if DEBUG_COMM_MAT + /*-------------------------------------------------------------------- + * Check if communication matrix is symmetric + *--------------------------------------------------------------------*/ + HYPRE_Int *recvs, *sends; + + /* Set receives */ + recvs = hypre_CTAlloc(HYPRE_Int, num_recvs, HYPRE_MEMORY_HOST); + for (i = 0; i < num_recvs; i++) + { + comm_type = hypre_CommPkgRecvType(comm_pkg, i); + recvs[i] = hypre_CommTypeProc(comm_type); + } + + /* Set sends */ + sends = hypre_CTAlloc(HYPRE_Int, num_sends, HYPRE_MEMORY_HOST); + for (i = 0; i < num_sends; i++) + { + comm_type = hypre_CommPkgSendType(comm_pkg, i); + sends[i] = hypre_CommTypeProc(comm_type); + } + + hypre_MPI_CheckCommMatrix(comm, num_recvs, recvs, num_sends, sends); + + hypre_TFree(recvs, HYPRE_MEMORY_HOST); + hypre_TFree(sends, HYPRE_MEMORY_HOST); +#endif /*-------------------------------------------------------------------- * 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); + requests = hypre_CTAlloc(hypre_MPI_Request, num_requests, HYPRE_MEMORY_HOST); + status = hypre_CTAlloc(hypre_MPI_Status, num_requests, HYPRE_MEMORY_HOST); /*-------------------------------------------------------------------- * allocate buffers *--------------------------------------------------------------------*/ /* allocate send buffers */ - send_buffers = hypre_TAlloc(HYPRE_Complex *, num_sends, HYPRE_MEMORY_HOST); + send_buffers = hypre_TAlloc(HYPRE_Complex *, num_sends, HYPRE_MEMORY_HOST); + send_bufsizes = hypre_TAlloc(HYPRE_Int, num_sends, HYPRE_MEMORY_HOST); if (num_sends > 0) { size = hypre_CommPkgSendBufsize(comm_pkg); - send_buffers[0] = hypre_StructCommunicationGetBuffer(memory_location, size); - for (i = 1; i < num_sends; i++) + send_buffers[0] = hypre_StructCommunicationGetBuffer(memory_location, size, 1); + for (i = 0; i < num_sends; i++) { - comm_type = hypre_CommPkgSendType(comm_pkg, i - 1); + comm_type = hypre_CommPkgSendType(comm_pkg, i); size = hypre_CommTypeBufsize(comm_type); - send_buffers[i] = send_buffers[i - 1] + size; + if (hypre_CommTypeFirstComm(comm_type)) + { + for (b = 0; b < num_blocks; b++) + { + comm_block = hypre_CommTypeBlock(comm_type, b); + size += hypre_CommBlockPfxsize(comm_block); + } + } + send_bufsizes[i] = size; + if (i < num_sends - 1) + { + send_buffers[i + 1] = send_buffers[i] + size; + } } } /* allocate recv buffers */ - recv_buffers = hypre_TAlloc(HYPRE_Complex *, num_recvs, HYPRE_MEMORY_HOST); + recv_buffers = hypre_TAlloc(HYPRE_Complex *, num_recvs, HYPRE_MEMORY_HOST); + recv_bufsizes = hypre_TAlloc(HYPRE_Int, num_recvs, HYPRE_MEMORY_HOST); if (num_recvs > 0) { size = hypre_CommPkgRecvBufsize(comm_pkg); - recv_buffers[0] = hypre_StructCommunicationGetBuffer(memory_location, size); - for (i = 1; i < num_recvs; i++) + recv_buffers[0] = hypre_StructCommunicationGetBuffer(memory_location, size, 0); + for (i = 0; i < num_recvs; i++) { - comm_type = hypre_CommPkgRecvType(comm_pkg, i - 1); + comm_type = hypre_CommPkgRecvType(comm_pkg, i); size = hypre_CommTypeBufsize(comm_type); - recv_buffers[i] = recv_buffers[i - 1] + size; + if (hypre_CommTypeFirstComm(comm_type)) + { + for (b = 0; b < num_blocks; b++) + { + comm_block = hypre_CommTypeBlock(comm_type, b); + size += hypre_CommBlockPfxsize(comm_block); + } + } + recv_bufsizes[i] = size; + if (i < num_recvs - 1) + { + recv_buffers[i + 1] = recv_buffers[i] + size; + } } } @@ -905,76 +1542,91 @@ hypre_InitializeCommunication( hypre_CommPkg *comm_pkg, 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) ) + if (hypre_CommTypeFirstComm(comm_type)) { - dptr += hypre_CommPrefixSize(num_entries); + for (b = 0; b < num_blocks; b++) + { + comm_block = hypre_CommTypeBlock(comm_type, b); + num_values = hypre_CommBlockNumValues(comm_block); + num_entries = hypre_CommBlockNumEntries(comm_block); + + /* Shift dptr to the next block */ + dptr += hypre_CommPrefixSize(num_entries, num_values); + } } - for (j = 0; j < num_entries; j++) + for (b = 0; b < num_blocks; b++) { - comm_entry = hypre_CommTypeEntry(comm_type, j); - length_array = hypre_CommEntryTypeLengthArray(comm_entry); - stride_array = hypre_CommEntryTypeStrideArray(comm_entry); - order = hypre_CommEntryTypeOrder(comm_entry); - unitst_array[0] = 1; - for (d = 1; d <= ndim; d++) - { - unitst_array[d] = unitst_array[d - 1] * length_array[d - 1]; - } + comm_block = hypre_CommTypeBlock(comm_type, b); + num_values = hypre_CommBlockNumValues(comm_block); + num_entries = hypre_CommBlockNumEntries(comm_block); - lptr = send_data + hypre_CommEntryTypeOffset(comm_entry); - for (ll = 0; ll < num_values; ll++) + for (j = 0; j < num_entries; j++) { - if (order[ll] > -1) + comm_entry = hypre_CommBlockEntry(comm_block, j); + ndim = hypre_CommEntryNDim(comm_entry); + length_array = hypre_CommEntryLengthArray(comm_entry); + stride_array = hypre_CommEntryStrideArray(comm_entry); + imap = hypre_CommEntryIMap(comm_entry); + offset = hypre_CommEntryOffset(comm_entry); + + unitst_array[0] = 1; + for (d = 0; d < ndim; d++) { - kptr = lptr + order[ll] * stride_array[ndim]; + unitst_array[d + 1] = unitst_array[d] * length_array[d]; + } -#define DEVICE_VAR is_device_ptr(dptr,kptr) - hypre_BasicBoxLoop2Begin(ndim, length_array, - stride_array, ki, - unitst_array, di); + lptr = send_data[b] + offset; + for (ll = 0; ll < length_array[ndim]; ll++) + { + if (imap[ll] > -1) { - dptr[di] = kptr[ki]; - } - hypre_BoxLoop2End(ki, di); + kptr = lptr + imap[ll] * stride_array[ndim]; + +#define DEVICE_VAR is_device_ptr(dptr, kptr) + hypre_BasicBoxLoop2Begin(ndim, length_array, + stride_array, ki, + unitst_array, di); + { + dptr[di] = kptr[ki]; + } + hypre_BoxLoop2End(ki, di); #undef DEVICE_VAR - dptr += unitst_array[ndim]; - } - else - { - size = 1; - for (d = 0; d < ndim; d++) - { - size *= length_array[d]; + dptr += unitst_array[ndim]; } + else + { + size = 1; + for (d = 0; d < ndim; d++) + { + size *= length_array[d]; + } - hypre_Memset(dptr, 0, size * sizeof(HYPRE_Complex), memory_location); - - dptr += size; + hypre_Memset(dptr, 0, size * sizeof(HYPRE_Complex), memory_location); + dptr += size; + } } } } } #if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) + hypre_ForceSyncComputeStream(); + if (hypre_GetActualMemLocation(memory_location) != hypre_MEMORY_HOST) { if (hypre_GetGpuAwareMPI()) { -#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) { @@ -982,10 +1634,10 @@ hypre_InitializeCommunication( hypre_CommPkg *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]); + send_buffers_mpi[i] = send_buffers_mpi[i - 1] + send_bufsizes[i - 1]; } - hypre_TMemcpy(send_buffers_mpi[0], send_buffers[0], HYPRE_Complex, size, HYPRE_MEMORY_HOST, - memory_location); + 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); @@ -995,36 +1647,55 @@ hypre_InitializeCommunication( hypre_CommPkg *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]); + recv_buffers_mpi[i] = recv_buffers_mpi[i - 1] + recv_bufsizes[i - 1]; } } } } else -#endif +#endif /* if defined HYPRE_USING_GPU */ { send_buffers_mpi = send_buffers; recv_buffers_mpi = recv_buffers; } + /* Pack prefix data */ for (i = 0; i < num_sends; i++) { comm_type = hypre_CommPkgSendType(comm_pkg, i); - num_entries = hypre_CommTypeNumEntries(comm_type); - if ( hypre_CommPkgFirstComm(comm_pkg) ) + dptr = (HYPRE_Complex *) send_buffers_mpi[i]; + if (hypre_CommTypeFirstComm(comm_type)) { - 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, memory_location_mpi, HYPRE_MEMORY_HOST); - qptr += num_entries; - hypre_TMemcpy(qptr, hypre_CommTypeRemBoxes(comm_type), - hypre_Box, num_entries, memory_location_mpi, HYPRE_MEMORY_HOST); - hypre_CommTypeRemBoxnums(comm_type) = NULL; - hypre_CommTypeRemBoxes(comm_type) = NULL; + for (b = 0; b < num_blocks; b++) + { + comm_block = hypre_CommTypeBlock(comm_type, b); + num_values = hypre_CommBlockNumValues(comm_block); + num_entries = hypre_CommBlockNumEntries(comm_block); + + qptr = (HYPRE_Int *) dptr; + hypre_TMemcpy(qptr, &num_entries, HYPRE_Int, 1, + memory_location_mpi, HYPRE_MEMORY_HOST); + qptr ++; + hypre_TMemcpy(qptr, hypre_CommBlockRemOrders(comm_block), + HYPRE_Int, num_entries * num_values, + memory_location_mpi, HYPRE_MEMORY_HOST); + qptr += num_entries * num_values; + hypre_TMemcpy(qptr, hypre_CommBlockRemBoxnums(comm_block), + HYPRE_Int, num_entries, + memory_location_mpi, HYPRE_MEMORY_HOST); + qptr += num_entries; + hypre_TMemcpy(qptr, hypre_CommBlockRemBoxes(comm_block), + hypre_Box, num_entries, + memory_location_mpi, HYPRE_MEMORY_HOST); + + /* Shift dptr to the next block */ + dptr += hypre_CommPrefixSize(num_entries, num_values); + + hypre_TFree(hypre_CommBlockRemBoxnums(comm_block), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_CommBlockRemBoxes(comm_block), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_CommBlockRemOrders(comm_block), HYPRE_MEMORY_HOST); + } } } @@ -1033,61 +1704,33 @@ hypre_InitializeCommunication( hypre_CommPkg *comm_pkg, *--------------------------------------------------------------------*/ j = 0; - for (i = 0; i < num_recvs; i++) + for (i = 0 ; i < num_recvs; i++) { comm_type = hypre_CommPkgRecvType(comm_pkg, i); hypre_MPI_Irecv(recv_buffers_mpi[i], - hypre_CommTypeBufsize(comm_type)*sizeof(HYPRE_Complex), + recv_bufsizes[i] * sizeof(HYPRE_Complex), hypre_MPI_BYTE, hypre_CommTypeProc(comm_type), tag, comm, &requests[j++]); - if ( hypre_CommPkgFirstComm(comm_pkg) ) - { - size = hypre_CommPrefixSize(hypre_CommTypeNumEntries(comm_type)); - hypre_CommTypeBufsize(comm_type) -= size; - hypre_CommPkgRecvBufsize(comm_pkg) -= size; - } } + hypre_TFree(recv_bufsizes, HYPRE_MEMORY_HOST); for (i = 0; i < num_sends; i++) { comm_type = hypre_CommPkgSendType(comm_pkg, i); hypre_MPI_Isend(send_buffers_mpi[i], - hypre_CommTypeBufsize(comm_type)*sizeof(HYPRE_Complex), + send_bufsizes[i] * sizeof(HYPRE_Complex), hypre_MPI_BYTE, hypre_CommTypeProc(comm_type), tag, comm, &requests[j++]); - if ( hypre_CommPkgFirstComm(comm_pkg) ) - { - size = hypre_CommPrefixSize(hypre_CommTypeNumEntries(comm_type)); - hypre_CommTypeBufsize(comm_type) -= size; - hypre_CommPkgSendBufsize(comm_pkg) -= size; - } + + /* Reset first communication flag (send type) */ + hypre_CommTypeFirstComm(comm_type) = 0; } + hypre_TFree(send_bufsizes, HYPRE_MEMORY_HOST); /*-------------------------------------------------------------------- - * set up CopyToType and exchange local data + * exchange local data *--------------------------------------------------------------------*/ - if ( hypre_CommPkgFirstComm(comm_pkg) ) - { - from_type = hypre_CommPkgCopyFromType(comm_pkg); - to_type = hypre_CommPkgCopyToType(comm_pkg); - num_entries = hypre_CommTypeNumEntries(from_type); - hypre_CommTypeNumEntries(to_type) = num_entries; - hypre_CommTypeEntries(to_type) = - hypre_TAlloc(hypre_CommEntryType, num_entries, HYPRE_MEMORY_HOST); - hypre_CommTypeSetEntries(to_type, - hypre_CommTypeRemBoxnums(from_type), - hypre_CommTypeRemBoxes(from_type), - hypre_CommPkgRecvStride(comm_pkg), - hypre_CommPkgIdentityCoord(comm_pkg), - hypre_CommPkgIdentityDir(comm_pkg), - hypre_CommPkgIdentityOrder(comm_pkg), - hypre_CommPkgRecvDataSpace(comm_pkg), - hypre_CommPkgRecvDataOffsets(comm_pkg)); - hypre_TFree(hypre_CommPkgRemBoxnums(comm_pkg), HYPRE_MEMORY_HOST); - hypre_TFree(hypre_CommPkgRemBoxes(comm_pkg), HYPRE_MEMORY_HOST); - } - hypre_ExchangeLocalData(comm_pkg, send_data, recv_data, action); /*-------------------------------------------------------------------- @@ -1095,18 +1738,25 @@ hypre_InitializeCommunication( hypre_CommPkg *comm_pkg, *--------------------------------------------------------------------*/ comm_handle = hypre_TAlloc(hypre_CommHandle, 1, HYPRE_MEMORY_HOST); + sdata = hypre_TAlloc(HYPRE_Complex*, num_blocks, HYPRE_MEMORY_HOST); + rdata = hypre_TAlloc(HYPRE_Complex*, num_blocks, HYPRE_MEMORY_HOST); + for (b = 0; b < num_blocks; b++) + { + sdata[b] = send_data[b]; + rdata[b] = recv_data[b]; + } hypre_CommHandleCommPkg(comm_handle) = comm_pkg; - hypre_CommHandleSendData(comm_handle) = send_data; - hypre_CommHandleRecvData(comm_handle) = recv_data; + hypre_CommHandleSendData(comm_handle) = sdata; + hypre_CommHandleRecvData(comm_handle) = rdata; 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; + hypre_CommHandleAction(comm_handle) = action; *comm_handle_ptr = comm_handle; @@ -1114,7 +1764,7 @@ hypre_InitializeCommunication( hypre_CommPkg *comm_pkg, } /*-------------------------------------------------------------------------- - * Finalize a communication exchange. This routine blocks until all + * Finalize a communication exchange. This routine blocks until all * of the communication requests are completed. * * The communication requests are completed, and the receive buffer is @@ -1122,45 +1772,47 @@ hypre_InitializeCommunication( hypre_CommPkg *comm_pkg, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_FinalizeCommunication( hypre_CommHandle *comm_handle ) +hypre_StructCommunicationFinalize( 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_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); - HYPRE_Int num_sends = hypre_CommPkgNumSends(comm_pkg); - HYPRE_Int num_recvs = hypre_CommPkgNumRecvs(comm_pkg); + hypre_CommPkg *comm_pkg = hypre_CommHandleCommPkg(comm_handle); + HYPRE_Complex **recv_data = hypre_CommHandleRecvData(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 num_sends = hypre_CommPkgNumSends(comm_pkg); + HYPRE_Int num_recvs = hypre_CommPkgNumRecvs(comm_pkg); + HYPRE_Int num_blocks = hypre_CommPkgNumBlocks(comm_pkg); + HYPRE_Int recv_buf_size = hypre_CommPkgRecvBufsize(comm_pkg); + hypre_Index *recv_strides = hypre_CommPkgRecvStrides(comm_pkg); + hypre_BoxArray **recv_data_spaces = hypre_CommPkgRecvDataSpaces(comm_pkg); + HYPRE_Int **recv_data_offsets = hypre_CommPkgRecvDataOffsets(comm_pkg); + HYPRE_MemoryLocation memory_location = hypre_CommPkgMemoryLocation(comm_pkg); + HYPRE_MemoryLocation memory_location_mpi; - hypre_CommType *comm_type; - hypre_CommEntryType *comm_entry; - HYPRE_Int num_entries; + hypre_CommType *comm_type; + hypre_CommBlock *comm_block; + hypre_CommEntry *comm_entry; + HYPRE_Int num_values, num_entries, offset; - HYPRE_Int *length_array; - HYPRE_Int *stride_array, unitst_array[HYPRE_MAXDIM + 1]; + HYPRE_Int *length_array; + HYPRE_Int *stride_array, unitst_array[HYPRE_MAXDIM + 1]; + HYPRE_Int *imap; - HYPRE_Complex *kptr, *lptr; - HYPRE_Complex *dptr; - HYPRE_Int *qptr; + HYPRE_Complex *kptr, *lptr; + HYPRE_Complex *dptr; + HYPRE_Int *qptr; - HYPRE_Int *boxnums; - hypre_Box *boxes; + HYPRE_Int *boxnums; + hypre_Box *boxes; + HYPRE_Int *orders; - HYPRE_Int i, j, d, ll; + HYPRE_Int i, j, b, d, ll, ndim; - 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 + /* Set memory location for MPI buffers */ + memory_location_mpi = hypre_GetGpuAwareMPI() ? memory_location : HYPRE_MEMORY_HOST; /*-------------------------------------------------------------------- * finish communications @@ -1174,185 +1826,186 @@ hypre_FinalizeCommunication( hypre_CommHandle *comm_handle ) } /*-------------------------------------------------------------------- - * if FirstComm, unpack prefix information and set 'num_entries' and - * 'entries' for RecvType + * unpack receive buffer data *--------------------------------------------------------------------*/ - if ( hypre_CommPkgFirstComm(comm_pkg) ) + /* This can happen only with GPU runs without GPU-aware MPI */ + if ((recv_buffers != recv_buffers_mpi) && (num_recvs > 0)) { - 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_mpi[i]; - - hypre_TMemcpy(&hypre_CommTypeNumEntries(comm_type), qptr, - HYPRE_Int, 1, HYPRE_MEMORY_HOST, memory_location_mpi); + hypre_TMemcpy(recv_buffers[0], recv_buffers_mpi[0], + HYPRE_Complex, recv_buf_size, + memory_location, memory_location_mpi); + } - num_entries += hypre_CommTypeNumEntries(comm_type); - } + /* Unpack prefix information */ + for (i = 0; i < num_recvs; i++) + { + comm_type = hypre_CommPkgRecvType(comm_pkg, i); - /* allocate CommType entries 'ct_entries' */ - ct_entries = hypre_TAlloc(hypre_CommEntryType, num_entries, HYPRE_MEMORY_HOST); + /* We use recv_buffers_mpi to possibly avoid a redundant D2H transfer */ + dptr = (HYPRE_Complex *) recv_buffers_mpi[i]; - /* unpack prefix information and set RecvType entries */ - for (i = 0; i < num_recvs; i++) + if (hypre_CommTypeFirstComm(comm_type)) { - comm_type = hypre_CommPkgRecvType(comm_pkg, i); - - /* Assign the entries to the comm_type */ - hypre_CommTypeEntries(comm_type) = ct_entries; - num_entries = hypre_CommTypeNumEntries(comm_type); - ct_entries += num_entries; - - 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 + for (b = 0; b < num_blocks; b++) { - 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); - } + comm_block = hypre_CommTypeBlock(comm_type, b); + num_values = hypre_CommBlockNumValues(comm_block); - /* Set the entries for the comm_type */ - hypre_CommTypeSetEntries(comm_type, boxnums, boxes, - hypre_CommPkgRecvStride(comm_pkg), - hypre_CommPkgIdentityCoord(comm_pkg), - hypre_CommPkgIdentityDir(comm_pkg), - 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); - } - } - } + qptr = (HYPRE_Int *) dptr; - /*-------------------------------------------------------------------- - * unpack receive buffer data - *--------------------------------------------------------------------*/ - - /* Note: hypre_CommPkgRecvBufsize is different in the first comm */ - if (recv_buffers != recv_buffers_mpi) - { - if (num_recvs > 0) - { - HYPRE_Int recv_buf_size; - - recv_buf_size = hypre_CommPkgFirstComm(comm_pkg) ? hypre_CommPkgRecvBufsizeFirstComm(comm_pkg) : - hypre_CommPkgRecvBufsize(comm_pkg); + /* Set boxnums and boxes from MPI recv buffer */ + if (hypre_GetActualMemLocation(memory_location_mpi) != hypre_MEMORY_DEVICE) + { + num_entries = *qptr; + qptr ++; + orders = qptr; + qptr += num_entries * num_values; + boxnums = qptr; + qptr += num_entries; + boxes = (hypre_Box *) qptr; + } + else + { + hypre_TMemcpy(&num_entries, qptr, HYPRE_Int, 1, + HYPRE_MEMORY_HOST, memory_location_mpi); + qptr ++; + + orders = hypre_TAlloc(HYPRE_Int, num_entries * num_values, HYPRE_MEMORY_HOST); + hypre_TMemcpy(orders, qptr, HYPRE_Int, num_entries * num_values, + HYPRE_MEMORY_HOST, memory_location_mpi); + qptr += num_entries * num_values; + + 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); + } - hypre_TMemcpy(recv_buffers[0], recv_buffers_mpi[0], HYPRE_Complex, recv_buf_size, - memory_location, memory_location_mpi); + hypre_CommBlockNumEntries(comm_block) = num_entries; + hypre_CommBlockEntries(comm_block) = + hypre_TAlloc(hypre_CommEntry, num_entries, HYPRE_MEMORY_HOST); + hypre_CommBlockIMaps(comm_block) = + hypre_TAlloc(HYPRE_Int, (num_entries * num_values), HYPRE_MEMORY_HOST); + hypre_CommBlockSetEntries(comm_block, boxnums, boxes, orders, + recv_strides[b], + recv_data_spaces[b], + recv_data_offsets[b]); + + /* Shift dptr to the next block */ + dptr += hypre_CommPrefixSize(num_entries, num_values); + + /* Free work arrays */ + if (hypre_GetActualMemLocation(memory_location_mpi) == hypre_MEMORY_DEVICE) + { + hypre_TFree(boxes, HYPRE_MEMORY_HOST); + hypre_TFree(orders, HYPRE_MEMORY_HOST); + hypre_TFree(boxnums, HYPRE_MEMORY_HOST); + } + } } } + /* Unpack RecvType entries */ for (i = 0; i < num_recvs; i++) { comm_type = hypre_CommPkgRecvType(comm_pkg, i); - num_entries = hypre_CommTypeNumEntries(comm_type); dptr = (HYPRE_Complex *) recv_buffers[i]; - - if ( hypre_CommPkgFirstComm(comm_pkg) ) + if (hypre_CommTypeFirstComm(comm_type)) { - dptr += hypre_CommPrefixSize(num_entries); + for (b = 0; b < num_blocks; b++) + { + comm_block = hypre_CommTypeBlock(comm_type, b); + num_values = hypre_CommBlockNumValues(comm_block); + num_entries = hypre_CommBlockNumEntries(comm_block); + + /* Shift dptr to the next block */ + dptr += hypre_CommPrefixSize(num_entries, num_values); + } + + /* Reset first communication flag (recv type) */ + hypre_CommTypeFirstComm(comm_type) = 0; } - for (j = 0; j < num_entries; j++) + for (b = 0; b < num_blocks; b++) { - comm_entry = hypre_CommTypeEntry(comm_type, j); - length_array = hypre_CommEntryTypeLengthArray(comm_entry); - stride_array = hypre_CommEntryTypeStrideArray(comm_entry); - unitst_array[0] = 1; - for (d = 1; d <= ndim; d++) - { - unitst_array[d] = unitst_array[d - 1] * length_array[d - 1]; - } + comm_block = hypre_CommTypeBlock(comm_type, b); + num_entries = hypre_CommBlockNumEntries(comm_block); - lptr = hypre_CommHandleRecvData(comm_handle) + - hypre_CommEntryTypeOffset(comm_entry); - for (ll = 0; ll < num_values; ll++) + for (j = 0; j < num_entries; j++) { - kptr = lptr + ll * stride_array[ndim]; + comm_entry = hypre_CommBlockEntry(comm_block, j); + ndim = hypre_CommEntryNDim(comm_entry); + length_array = hypre_CommEntryLengthArray(comm_entry); + stride_array = hypre_CommEntryStrideArray(comm_entry); + imap = hypre_CommEntryIMap(comm_entry); + offset = hypre_CommEntryOffset(comm_entry); + + unitst_array[0] = 1; + for (d = 0; d < ndim; d++) + { + unitst_array[d + 1] = unitst_array[d] * length_array[d]; + } -#define DEVICE_VAR is_device_ptr(kptr,dptr) - hypre_BasicBoxLoop2Begin(ndim, length_array, - stride_array, ki, - unitst_array, di); + lptr = recv_data[b] + offset; + for (ll = 0; ll < length_array[ndim]; ll++) { - if (action > 0) - { - kptr[ki] += dptr[di]; - } - else + kptr = lptr + imap[ll] * stride_array[ndim]; + +#define DEVICE_VAR is_device_ptr(kptr,dptr) + hypre_BasicBoxLoop2Begin(ndim, length_array, + stride_array, ki, + unitst_array, di); { - kptr[ki] = dptr[di]; + kptr[ki] = (action > 0) ? kptr[ki] + dptr[di] : dptr[di]; } - } - hypre_BoxLoop2End(ki, di); + hypre_BoxLoop2End(ki, di); #undef DEVICE_VAR - dptr += unitst_array[ndim]; + dptr += unitst_array[ndim]; + } } } } - /*-------------------------------------------------------------------- - * turn off first communication indicator - *--------------------------------------------------------------------*/ - - hypre_CommPkgFirstComm(comm_pkg) = 0; +#if defined(HYPRE_USING_GPU) + hypre_ForceSyncComputeStream(); +#endif /*-------------------------------------------------------------------- * Free up communication handle *--------------------------------------------------------------------*/ - hypre_TFree(hypre_CommHandleRequests(comm_handle), HYPRE_MEMORY_HOST); - hypre_TFree(hypre_CommHandleStatus(comm_handle), HYPRE_MEMORY_HOST); - if (num_sends > 0) - { - hypre_StructCommunicationReleaseBuffer(send_buffers[0], memory_location); - } - if (num_recvs > 0) - { - hypre_StructCommunicationReleaseBuffer(recv_buffers[0], memory_location); - } - - hypre_TFree(comm_handle, HYPRE_MEMORY_HOST); - - if (send_buffers != send_buffers_mpi) + if (send_buffers_mpi != send_buffers) { hypre_TFree(send_buffers_mpi[0], memory_location_mpi); hypre_TFree(send_buffers_mpi, HYPRE_MEMORY_HOST); } - if (recv_buffers != recv_buffers_mpi) + if (recv_buffers_mpi != recv_buffers) { hypre_TFree(recv_buffers_mpi[0], memory_location_mpi); hypre_TFree(recv_buffers_mpi, HYPRE_MEMORY_HOST); } - + if (num_sends > 0) + { + hypre_StructCommunicationReleaseBuffer(send_buffers[0], memory_location); + } + if (num_recvs > 0) + { + hypre_StructCommunicationReleaseBuffer(recv_buffers[0], memory_location); + } hypre_TFree(send_buffers, HYPRE_MEMORY_HOST); hypre_TFree(recv_buffers, HYPRE_MEMORY_HOST); + hypre_TFree(hypre_CommHandleSendData(comm_handle), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_CommHandleRecvData(comm_handle), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_CommHandleRequests(comm_handle), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_CommHandleStatus(comm_handle), HYPRE_MEMORY_HOST); + hypre_TFree(comm_handle, HYPRE_MEMORY_HOST); return hypre_error_flag; } @@ -1362,28 +2015,29 @@ 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_ExchangeLocalData( hypre_CommPkg *comm_pkg, + HYPRE_Complex **send_data, + HYPRE_Complex **recv_data, + HYPRE_Int action ) { - HYPRE_Int ndim = hypre_CommPkgNDim(comm_pkg); - HYPRE_Int num_values = hypre_CommPkgNumValues(comm_pkg); - hypre_CommType *copy_fr_type; - hypre_CommType *copy_to_type; - hypre_CommEntryType *copy_fr_entry; - hypre_CommEntryType *copy_to_entry; - - HYPRE_Complex *fr_dp; - HYPRE_Int *fr_stride_array; - HYPRE_Complex *to_dp; - HYPRE_Int *to_stride_array; - HYPRE_Complex *fr_dpl, *to_dpl; + HYPRE_Int num_blocks = hypre_CommPkgNumBlocks(comm_pkg); - HYPRE_Int *length_array; - HYPRE_Int i, ll; + hypre_CommType *copy_fr_type; + hypre_CommType *copy_to_type; + hypre_CommBlock *copy_fr_block; + hypre_CommBlock *copy_to_block; + hypre_CommEntry *copy_fr_entry; + hypre_CommEntry *copy_to_entry; + + HYPRE_Complex *fr_dp, *fr_dpl; + HYPRE_Int *fr_stride_array; + HYPRE_Int *fr_imap; + HYPRE_Complex *to_dp, *to_dpl; + HYPRE_Int *to_stride_array; + HYPRE_Int *to_imap; - HYPRE_Int *order; + HYPRE_Int *length_array; + HYPRE_Int i, b, ll, ndim; /*-------------------------------------------------------------------- * copy local data @@ -1392,48 +2046,56 @@ hypre_ExchangeLocalData( hypre_CommPkg *comm_pkg, copy_fr_type = hypre_CommPkgCopyFromType(comm_pkg); copy_to_type = hypre_CommPkgCopyToType(comm_pkg); - for (i = 0; i < hypre_CommTypeNumEntries(copy_fr_type); i++) + for (b = 0; b < num_blocks; b++) { - copy_fr_entry = hypre_CommTypeEntry(copy_fr_type, i); - copy_to_entry = hypre_CommTypeEntry(copy_to_type, i); - - fr_dp = send_data + hypre_CommEntryTypeOffset(copy_fr_entry); - to_dp = recv_data + hypre_CommEntryTypeOffset(copy_to_entry); + copy_fr_block = hypre_CommTypeBlock(copy_fr_type, b); + copy_to_block = hypre_CommTypeBlock(copy_to_type, b); - /* copy data only when necessary */ - if (to_dp != fr_dp) + for (i = 0; i < hypre_CommBlockNumEntries(copy_fr_block); i++) { - length_array = hypre_CommEntryTypeLengthArray(copy_fr_entry); + copy_fr_entry = hypre_CommBlockEntry(copy_fr_block, i); + copy_to_entry = hypre_CommBlockEntry(copy_to_block, i); - fr_stride_array = hypre_CommEntryTypeStrideArray(copy_fr_entry); - to_stride_array = hypre_CommEntryTypeStrideArray(copy_to_entry); - order = hypre_CommEntryTypeOrder(copy_fr_entry); + fr_dp = send_data[b] + hypre_CommEntryOffset(copy_fr_entry); + to_dp = recv_data[b] + hypre_CommEntryOffset(copy_to_entry); - for (ll = 0; ll < num_values; ll++) + /* copy data only when necessary */ + if (to_dp != fr_dp) { - if (order[ll] > -1) + ndim = hypre_CommEntryNDim(copy_fr_entry); + length_array = hypre_CommEntryLengthArray(copy_fr_entry); + + fr_stride_array = hypre_CommEntryStrideArray(copy_fr_entry); + to_stride_array = hypre_CommEntryStrideArray(copy_to_entry); + fr_imap = hypre_CommEntryIMap(copy_fr_entry); + to_imap = hypre_CommEntryIMap(copy_to_entry); + + for (ll = 0; ll < length_array[ndim]; ll++) { - fr_dpl = fr_dp + (order[ll]) * fr_stride_array[ndim]; - to_dpl = to_dp + ( ll ) * to_stride_array[ndim]; + if (fr_imap[ll] > -1) + { + fr_dpl = fr_dp + (fr_imap[ll]) * fr_stride_array[ndim]; + to_dpl = to_dp + (to_imap[ll]) * to_stride_array[ndim]; #define DEVICE_VAR is_device_ptr(to_dpl,fr_dpl) - hypre_BasicBoxLoop2Begin(ndim, length_array, - fr_stride_array, fi, - to_stride_array, ti); - { - if (action > 0) - { - /* add the data to existing values in memory */ - to_dpl[ti] += fr_dpl[fi]; - } - else + hypre_BasicBoxLoop2Begin(ndim, length_array, + fr_stride_array, fi, + to_stride_array, ti); { - /* copy the data over existing values in memory */ - to_dpl[ti] = fr_dpl[fi]; + if (action > 0) + { + /* add the data to existing values in memory */ + to_dpl[ti] += fr_dpl[fi]; + } + else + { + /* copy the data over existing values in memory */ + to_dpl[ti] = fr_dpl[fi]; + } } - } - hypre_BoxLoop2End(fi, ti); + hypre_BoxLoop2End(fi, ti); #undef DEVICE_VAR + } } } } @@ -1448,40 +2110,92 @@ hypre_ExchangeLocalData( hypre_CommPkg *comm_pkg, HYPRE_Int hypre_CommPkgDestroy( hypre_CommPkg *comm_pkg ) { - hypre_CommType *comm_type; - HYPRE_Int **orders; - HYPRE_Int i; + hypre_CommType *comm_type; + hypre_CommBlock *comm_block; + HYPRE_Int i, b, num_comms, num_blocks; + hypre_Index *recv_strides; + hypre_BoxArray **recv_data_spaces; + HYPRE_Int **recv_data_offsets; + HYPRE_Int *boxes_match; if (comm_pkg) { - /* note that entries are allocated in two stages for To/Recv */ - if (hypre_CommPkgNumRecvs(comm_pkg) > 0) + num_blocks = hypre_CommPkgNumBlocks(comm_pkg); + recv_strides = hypre_CommPkgRecvStrides(comm_pkg); + recv_data_spaces = hypre_CommPkgRecvDataSpaces(comm_pkg); + recv_data_offsets = hypre_CommPkgRecvDataOffsets(comm_pkg); + boxes_match = hypre_CommPkgBoxesMatch(comm_pkg); + + /* Send */ + num_comms = hypre_CommPkgNumSends(comm_pkg); + for (i = 0; i < num_comms; i++) { - comm_type = hypre_CommPkgRecvType(comm_pkg, 0); - hypre_TFree(hypre_CommTypeEntries(comm_type), HYPRE_MEMORY_HOST); + comm_type = hypre_CommPkgSendType(comm_pkg, i); + for (b = 0; b < num_blocks; b++) + { + comm_block = hypre_CommTypeBlock(comm_type, b); + hypre_TFree(hypre_CommBlockEntries(comm_block), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_CommBlockIMaps(comm_block), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_CommBlockRemBoxnums(comm_block), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_CommBlockRemBoxes(comm_block), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_CommBlockRemOrders(comm_block), HYPRE_MEMORY_HOST); + } + hypre_TFree(hypre_CommTypeBlocks(comm_type), HYPRE_MEMORY_HOST); } - comm_type = hypre_CommPkgCopyToType(comm_pkg); - hypre_TFree(hypre_CommTypeEntries(comm_type), HYPRE_MEMORY_HOST); - hypre_TFree(comm_type, HYPRE_MEMORY_HOST); - comm_type = hypre_CommPkgCopyFromType(comm_pkg); - hypre_TFree(comm_type, HYPRE_MEMORY_HOST); + /* Recv */ + num_comms = hypre_CommPkgNumRecvs(comm_pkg); + for (i = 0; i < num_comms; i++) + { + comm_type = hypre_CommPkgRecvType(comm_pkg, i); - hypre_TFree(hypre_CommPkgEntries(comm_pkg), HYPRE_MEMORY_HOST); - hypre_TFree(hypre_CommPkgRemBoxnums(comm_pkg), HYPRE_MEMORY_HOST); - hypre_TFree(hypre_CommPkgRemBoxes(comm_pkg), HYPRE_MEMORY_HOST); + /* This is only set up if a communication is done */ + if (!hypre_CommTypeFirstComm(comm_type)) + { + for (b = 0; b < num_blocks; b++) + { + comm_block = hypre_CommTypeBlock(comm_type, b); + hypre_TFree(hypre_CommBlockEntries(comm_block), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_CommBlockIMaps(comm_block), HYPRE_MEMORY_HOST); + } + } + hypre_TFree(hypre_CommTypeBlocks(comm_type), HYPRE_MEMORY_HOST); + } - hypre_TFree(hypre_CommPkgRecvDataOffsets(comm_pkg), HYPRE_MEMORY_HOST); - hypre_BoxArrayDestroy(hypre_CommPkgRecvDataSpace(comm_pkg)); + /* CopyFrom */ + comm_type = hypre_CommPkgCopyFromType(comm_pkg); + for (b = 0; b < num_blocks; b++) + { + comm_block = hypre_CommTypeBlock(comm_type, b); + hypre_TFree(hypre_CommBlockEntries(comm_block), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_CommBlockIMaps(comm_block), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_CommBlockRemBoxnums(comm_block), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_CommBlockRemBoxes(comm_block), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_CommBlockRemOrders(comm_block), HYPRE_MEMORY_HOST); + } + hypre_TFree(hypre_CommTypeBlocks(comm_type), HYPRE_MEMORY_HOST); + hypre_TFree(comm_type, HYPRE_MEMORY_HOST); - orders = hypre_CommPkgOrders(comm_pkg); - for (i = 0; i < hypre_CommPkgNumOrders(comm_pkg); i++) + /* CopyTo */ + comm_type = hypre_CommPkgCopyToType(comm_pkg); + for (b = 0; b < num_blocks; b++) { - hypre_TFree(orders[i], HYPRE_MEMORY_HOST); + comm_block = hypre_CommTypeBlock(comm_type, b); + hypre_TFree(hypre_CommBlockEntries(comm_block), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_CommBlockIMaps(comm_block), HYPRE_MEMORY_HOST); } - hypre_TFree(orders, HYPRE_MEMORY_HOST); + hypre_TFree(hypre_CommTypeBlocks(comm_type), HYPRE_MEMORY_HOST); + hypre_TFree(comm_type, HYPRE_MEMORY_HOST); - hypre_TFree(hypre_CommPkgIdentityOrder(comm_pkg), HYPRE_MEMORY_HOST); + for (b = 0; b < num_blocks; b++) + { + hypre_BoxArrayDestroy(recv_data_spaces[b]); + hypre_TFree(recv_data_offsets[b], HYPRE_MEMORY_HOST); + } + hypre_TFree(recv_strides, HYPRE_MEMORY_HOST); + hypre_TFree(recv_data_spaces, HYPRE_MEMORY_HOST); + hypre_TFree(recv_data_offsets, HYPRE_MEMORY_HOST); + hypre_TFree(boxes_match, HYPRE_MEMORY_HOST); hypre_TFree(comm_pkg, HYPRE_MEMORY_HOST); } diff --git a/src/struct_mv/struct_communication.h b/src/struct_mv/struct_communication.h index fa5ddf1af7..3d9041a679 100644 --- a/src/struct_mv/struct_communication.h +++ b/src/struct_mv/struct_communication.h @@ -9,8 +9,20 @@ #define hypre_COMMUNICATION_HEADER /*-------------------------------------------------------------------------- - * hypre_CommInfo: - * + *--------------------------------------------------------------------------*/ + +typedef struct hypre_CommStencil_struct +{ + HYPRE_Int ndim; + hypre_Box *box; /* extents of data array */ + HYPRE_Int *data; /* non-zero values indicate communication */ + hypre_Index stride; + HYPRE_Int mgrow[HYPRE_MAXDIM]; /* amount to grow in the minus direction */ + HYPRE_Int pgrow[HYPRE_MAXDIM]; /* amount to grow in the plus direction */ + +} hypre_CommStencil; + +/*-------------------------------------------------------------------------- * For "reverse" communication, send_transforms is not needed (may be NULL). * For "forward" communication, recv_transforms is not needed (may be NULL). *--------------------------------------------------------------------------*/ @@ -38,120 +50,126 @@ typedef struct hypre_CommInfo_struct HYPRE_Int boxes_match; /* true (>0) if each send box has a * matching box on the recv processor */ - } hypre_CommInfo; /*-------------------------------------------------------------------------- - * hypre_CommEntryType: + * Note: The dimension of the data represented by CommEntry will often be + * smaller than the original problem dimension. *--------------------------------------------------------------------------*/ -typedef struct hypre_CommEntryType_struct +typedef struct hypre_CommEntry_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 *order; /* order of last dim values */ + HYPRE_Int offset; /* offset for the data */ + HYPRE_Int ndim; /* dimension of the data */ + HYPRE_Int length_array[HYPRE_MAXDIM + 1]; + HYPRE_Int stride_array[HYPRE_MAXDIM + 1]; + HYPRE_Int *imap; /* index map for last dim values */ -} hypre_CommEntryType; +} hypre_CommEntry; /*-------------------------------------------------------------------------- - * hypre_CommType: *--------------------------------------------------------------------------*/ -typedef struct hypre_CommType_struct +typedef struct hypre_CommBlock_struct { - HYPRE_Int proc; - HYPRE_Int bufsize; /* message buffer size (in doubles) */ - HYPRE_Int num_entries; - hypre_CommEntryType *entries; + HYPRE_Int bufsize; /* message buffer size (in doubles) */ + HYPRE_Int pfxsize; /* message buffer prefix size (in doubles) */ + HYPRE_Int ndim; + HYPRE_Int num_values; + HYPRE_Int num_entries; + hypre_CommEntry *entries; + HYPRE_Int *imaps; /* length = (num_entries*num_values) */ + + /* This is only needed until first send buffer prefix is packed */ + HYPRE_Int *rem_boxnums; /* entry remote box numbers */ + hypre_Box *rem_boxes; /* entry remote boxes */ + HYPRE_Int *rem_orders; /* length = (num_entries*num_values) */ + +} hypre_CommBlock; - /* this is only needed until first send buffer prefix is packed */ - HYPRE_Int *rem_boxnums; /* entry remote box numbers */ - hypre_Box *rem_boxes; /* entry remote boxes */ +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +typedef struct hypre_CommType_struct +{ + HYPRE_Int first_comm; /* is this the first communication? */ + HYPRE_Int proc; + HYPRE_Int bufsize; /* message buffer size (in doubles) */ + HYPRE_Int ndim; + HYPRE_Int num_blocks; + hypre_CommBlock *blocks; } hypre_CommType; /*-------------------------------------------------------------------------- - * hypre_CommPkg: - * Structure containing information for doing communications *--------------------------------------------------------------------------*/ typedef struct hypre_CommPkg_struct { MPI_Comm comm; - - /* is this the first communication? */ - HYPRE_Int first_comm; + HYPRE_MemoryLocation memory_location; HYPRE_Int ndim; HYPRE_Int num_values; hypre_Index send_stride; hypre_Index recv_stride; - - /* 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 send_bufsize; /* total send buffer counts */ + HYPRE_Int recv_bufsize; /* total recv buffer counts */ 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; - /* 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; - /* num_orders x num_values */ - HYPRE_Int **orders; - - /* offsets into recv data (by box) */ - HYPRE_Int *recv_data_offsets; - /* recv data dimensions (by box) */ - hypre_BoxArray *recv_data_space; + /* needed for setting recv entries after the first communication */ + HYPRE_Int num_blocks; /* arrays below are num_blocks x ... */ + hypre_Index *recv_strides; + hypre_BoxArray **recv_data_spaces; /* recv data dimensions (by box) */ + HYPRE_Int **recv_data_offsets; /* offsets into recv data (by box) */ + HYPRE_Int *boxes_match; /* same meaning as in CommInfo */ hypre_Index identity_coord; hypre_Index identity_dir; HYPRE_Int *identity_order; + } hypre_CommPkg; /*-------------------------------------------------------------------------- - * CommHandle: *--------------------------------------------------------------------------*/ typedef struct hypre_CommHandle_struct { - hypre_CommPkg *comm_pkg; - HYPRE_Complex *send_data; - HYPRE_Complex *recv_data; - - HYPRE_Int num_requests; - hypre_MPI_Request *requests; - hypre_MPI_Status *status; + hypre_CommPkg *comm_pkg; + HYPRE_Complex **send_data; + HYPRE_Complex **recv_data; - HYPRE_Complex **send_buffers; - HYPRE_Complex **recv_buffers; + HYPRE_Int num_requests; + hypre_MPI_Request *requests; + hypre_MPI_Status *status; - HYPRE_Complex **send_buffers_mpi; - HYPRE_Complex **recv_buffers_mpi; + HYPRE_Complex **send_buffers; /* send buffer used for data packing */ + HYPRE_Complex **recv_buffers; /* recv buffer used for data unpacking */ + HYPRE_Complex **send_buffers_mpi; /* send buffer used in the actual MPI calls */ + HYPRE_Complex **recv_buffers_mpi; /* recv buffer used in the actual MPI calls */ - /* set = 0, add = 1 */ - HYPRE_Int action; + HYPRE_Int action; /* set = 0, add = 1 */ } hypre_CommHandle; /*-------------------------------------------------------------------------- - * Accessor macros: hypre_CommInto + * Accessor macros: hypre_CommStencil + *--------------------------------------------------------------------------*/ + +#define hypre_CommStencilNDim(cstenc) (cstenc -> ndim) +#define hypre_CommStencilBox(cstenc) (cstenc -> box) +#define hypre_CommStencilData(cstenc) (cstenc -> data) +#define hypre_CommStencilStride(cstenc) (cstenc -> stride) +#define hypre_CommStencilMGrow(cstenc) (cstenc -> mgrow) +#define hypre_CommStencilPGrow(cstenc) (cstenc -> pgrow) + +/*-------------------------------------------------------------------------- + * Accessor macros: hypre_CommInfo *--------------------------------------------------------------------------*/ #define hypre_CommInfoNDim(info) (info -> ndim) @@ -176,70 +194,79 @@ typedef struct hypre_CommHandle_struct #define hypre_CommInfoBoxesMatch(info) (info -> boxes_match) /*-------------------------------------------------------------------------- - * Accessor macros: hypre_CommEntryType + * Accessor macros: hypre_CommEntry *--------------------------------------------------------------------------*/ -#define hypre_CommEntryTypeOffset(entry) (entry -> offset) -#define hypre_CommEntryTypeDim(entry) (entry -> dim) -#define hypre_CommEntryTypeLengthArray(entry) (entry -> length_array) -#define hypre_CommEntryTypeStrideArray(entry) (entry -> stride_array) -#define hypre_CommEntryTypeOrder(entry) (entry -> order) +#define hypre_CommEntryOffset(entry) (entry -> offset) +#define hypre_CommEntryNDim(entry) (entry -> ndim) +#define hypre_CommEntryLengthArray(entry) (entry -> length_array) +#define hypre_CommEntryStrideArray(entry) (entry -> stride_array) +#define hypre_CommEntryIMap(entry) (entry -> imap) + +/*-------------------------------------------------------------------------- + * Accessor macros: hypre_CommBlock + *--------------------------------------------------------------------------*/ + +#define hypre_CommBlockBufsize(blk) (blk -> bufsize) +#define hypre_CommBlockPfxsize(blk) (blk -> pfxsize) +#define hypre_CommBlockNDim(blk) (blk -> ndim) +#define hypre_CommBlockNumValues(blk) (blk -> num_values) +#define hypre_CommBlockNumEntries(blk) (blk -> num_entries) +#define hypre_CommBlockEntries(blk) (blk -> entries) +#define hypre_CommBlockEntry(blk, i) &(blk -> entries[i]) +#define hypre_CommBlockIMaps(blk) (blk -> imaps) +#define hypre_CommBlockIMap(blk, i) &(blk -> imaps[i * (blk -> num_values)]) + +#define hypre_CommBlockRemBoxnums(blk) (blk -> rem_boxnums) +#define hypre_CommBlockRemBoxnum(blk, i) (blk -> rem_boxnums[i]) +#define hypre_CommBlockRemBoxes(blk) (blk -> rem_boxes) +#define hypre_CommBlockRemBox(blk, i) &(blk -> rem_boxes[i]) +#define hypre_CommBlockRemOrders(blk) (blk -> rem_orders) +#define hypre_CommBlockRemOrder(blk, i) &(blk -> rem_orders[i * (blk -> num_values)]) /*-------------------------------------------------------------------------- * Accessor macros: hypre_CommType *--------------------------------------------------------------------------*/ +#define hypre_CommTypeFirstComm(type) (type -> first_comm) #define hypre_CommTypeProc(type) (type -> proc) #define hypre_CommTypeBufsize(type) (type -> bufsize) -#define hypre_CommTypeNumEntries(type) (type -> num_entries) -#define hypre_CommTypeEntries(type) (type -> entries) -#define hypre_CommTypeEntry(type, i) (&(type -> entries[i])) - -#define hypre_CommTypeRemBoxnums(type) (type -> rem_boxnums) -#define hypre_CommTypeRemBoxnum(type, i) (type -> rem_boxnums[i]) -#define hypre_CommTypeRemBoxes(type) (type -> rem_boxes) -#define hypre_CommTypeRemBox(type, i) (&(type -> rem_boxes[i])) +#define hypre_CommTypeNDim(type) (type -> ndim) +#define hypre_CommTypeNumBlocks(type) (type -> num_blocks) +#define hypre_CommTypeBlocks(type) (type -> blocks) +#define hypre_CommTypeBlock(type, i) &(type -> blocks[i]) /*-------------------------------------------------------------------------- * Accessor macros: hypre_CommPkg *--------------------------------------------------------------------------*/ -#define hypre_CommPkgComm(comm_pkg) (comm_pkg -> comm) - -#define hypre_CommPkgFirstComm(comm_pkg) (comm_pkg -> first_comm) - -#define hypre_CommPkgNDim(comm_pkg) (comm_pkg -> ndim) -#define hypre_CommPkgNumValues(comm_pkg) (comm_pkg -> num_values) -#define hypre_CommPkgSendStride(comm_pkg) (comm_pkg -> send_stride) -#define hypre_CommPkgRecvStride(comm_pkg) (comm_pkg -> recv_stride) -#define hypre_CommPkgSendBufsize(comm_pkg) (comm_pkg -> send_bufsize) -#define hypre_CommPkgRecvBufsize(comm_pkg) (comm_pkg -> recv_bufsize) -#define hypre_CommPkgSendBufsizeFirstComm(comm_pkg) (comm_pkg -> send_bufsize_first_comm) -#define hypre_CommPkgRecvBufsizeFirstComm(comm_pkg) (comm_pkg -> recv_bufsize_first_comm) - -#define hypre_CommPkgNumSends(comm_pkg) (comm_pkg -> num_sends) -#define hypre_CommPkgNumRecvs(comm_pkg) (comm_pkg -> num_recvs) -#define hypre_CommPkgSendTypes(comm_pkg) (comm_pkg -> send_types) -#define hypre_CommPkgSendType(comm_pkg, i) (&(comm_pkg -> send_types[i])) -#define hypre_CommPkgRecvTypes(comm_pkg) (comm_pkg -> recv_types) -#define hypre_CommPkgRecvType(comm_pkg, i) (&(comm_pkg -> recv_types[i])) - -#define hypre_CommPkgCopyFromType(comm_pkg) (comm_pkg -> copy_from_type) -#define hypre_CommPkgCopyToType(comm_pkg) (comm_pkg -> copy_to_type) - -#define hypre_CommPkgEntries(comm_pkg) (comm_pkg -> entries) -#define hypre_CommPkgRemBoxnums(comm_pkg) (comm_pkg -> rem_boxnums) -#define hypre_CommPkgRemBoxes(comm_pkg) (comm_pkg -> rem_boxes) - -#define hypre_CommPkgNumOrders(comm_pkg) (comm_pkg -> num_orders) -#define hypre_CommPkgOrders(comm_pkg) (comm_pkg -> orders) - -#define hypre_CommPkgRecvDataOffsets(comm_pkg) (comm_pkg -> recv_data_offsets) -#define hypre_CommPkgRecvDataSpace(comm_pkg) (comm_pkg -> recv_data_space) - -#define hypre_CommPkgIdentityCoord(comm_pkg) (comm_pkg -> identity_coord) -#define hypre_CommPkgIdentityDir(comm_pkg) (comm_pkg -> identity_dir) -#define hypre_CommPkgIdentityOrder(comm_pkg) (comm_pkg -> identity_order) +#define hypre_CommPkgComm(comm_pkg) (comm_pkg -> comm) +#define hypre_CommPkgMemoryLocation(comm_pkg) (comm_pkg -> memory_location) + +#define hypre_CommPkgNDim(comm_pkg) (comm_pkg -> ndim) +#define hypre_CommPkgNumValues(comm_pkg) (comm_pkg -> num_values) +#define hypre_CommPkgSendStride(comm_pkg) (comm_pkg -> send_stride) +#define hypre_CommPkgRecvStride(comm_pkg) (comm_pkg -> recv_stride) +#define hypre_CommPkgSendBufsize(comm_pkg) (comm_pkg -> send_bufsize) +#define hypre_CommPkgRecvBufsize(comm_pkg) (comm_pkg -> recv_bufsize) +#define hypre_CommPkgNumSends(comm_pkg) (comm_pkg -> num_sends) +#define hypre_CommPkgNumRecvs(comm_pkg) (comm_pkg -> num_recvs) +#define hypre_CommPkgSendTypes(comm_pkg) (comm_pkg -> send_types) +#define hypre_CommPkgSendType(comm_pkg, i) &(comm_pkg -> send_types[i]) +#define hypre_CommPkgRecvTypes(comm_pkg) (comm_pkg -> recv_types) +#define hypre_CommPkgRecvType(comm_pkg, i) &(comm_pkg -> recv_types[i]) +#define hypre_CommPkgCopyFromType(comm_pkg) (comm_pkg -> copy_from_type) +#define hypre_CommPkgCopyToType(comm_pkg) (comm_pkg -> copy_to_type) + +#define hypre_CommPkgNumBlocks(comm_pkg) (comm_pkg -> num_blocks) +#define hypre_CommPkgRecvStrides(comm_pkg) (comm_pkg -> recv_strides) +#define hypre_CommPkgRecvDataSpaces(comm_pkg) (comm_pkg -> recv_data_spaces) +#define hypre_CommPkgRecvDataOffsets(comm_pkg) (comm_pkg -> recv_data_offsets) +#define hypre_CommPkgBoxesMatch(comm_pkg) (comm_pkg -> boxes_match) + +#define hypre_CommPkgIdentityCoord(comm_pkg) (comm_pkg -> idenditity_coord) +#define hypre_CommPkgIdentityDir(comm_pkg) (comm_pkg -> idenditity_dir) +#define hypre_CommPkgIdentityOrder(comm_pkg) (comm_pkg -> idenditity_order) /*-------------------------------------------------------------------------- * Accessor macros: hypre_CommHandle @@ -253,8 +280,8 @@ typedef struct hypre_CommHandle_struct #define hypre_CommHandleStatus(comm_handle) (comm_handle -> status) #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_CommHandleSendBuffersMPI(comm_handle) (comm_handle -> send_buffers_mpi) #define hypre_CommHandleRecvBuffersMPI(comm_handle) (comm_handle -> recv_buffers_mpi) +#define hypre_CommHandleAction(comm_handle) (comm_handle -> action) #endif diff --git a/src/struct_mv/struct_copy.c b/src/struct_mv/struct_copy.c index 425fc64161..8faeeeb2d3 100644 --- a/src/struct_mv/struct_copy.c +++ b/src/struct_mv/struct_copy.c @@ -9,53 +9,80 @@ * * Structured copy routine * + * RDF TODO: The names for the vector class functions needs to be revisited. + * Should this be hypre_StructVectorCopy? What should our user interface + * conventions be for these routines? *****************************************************************************/ #include "_hypre_struct_mv.h" #include "_hypre_struct_mv.hpp" /*-------------------------------------------------------------------------- - * hypre_StructCopy + * The vectors x and y may have different base grids, but the grid boxes for + * each vector (defined by grid, stride, nboxes, boxnums) must be the same. + * Only nboxes is checked, the rest is assumed to be true. *--------------------------------------------------------------------------*/ HYPRE_Int hypre_StructCopy( hypre_StructVector *x, hypre_StructVector *y ) { + HYPRE_Int ndim = hypre_StructVectorNDim(x); + hypre_Box *x_data_box; hypre_Box *y_data_box; HYPRE_Complex *xp; HYPRE_Complex *yp; - hypre_BoxArray *boxes; - hypre_Box *box; + HYPRE_Int nboxes; + hypre_Box *loop_box; hypre_Index loop_size; hypre_IndexRef start; - hypre_Index unit_stride; + hypre_Index ustride; HYPRE_Int i; - hypre_SetIndex(unit_stride, 1); + HYPRE_ANNOTATE_FUNC_BEGIN; - boxes = hypre_StructGridBoxes(hypre_StructVectorGrid(y)); - hypre_ForBoxI(i, boxes) + nboxes = hypre_StructVectorNBoxes(x); + + /* Return if nboxes is not the same for x and y */ + if (nboxes != hypre_StructVectorNBoxes(y)) { - box = hypre_BoxArrayBox(boxes, i); - start = hypre_BoxIMin(box); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "StructCopy: nboxes for x and y do not match!"); - x_data_box = hypre_BoxArrayBox(hypre_StructVectorDataSpace(x), i); - y_data_box = hypre_BoxArrayBox(hypre_StructVectorDataSpace(y), i); + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; + } - xp = hypre_StructVectorBoxData(x, i); - yp = hypre_StructVectorBoxData(y, i); + /* Return if x and y point to the same hypre_StructVector */ + if (x == y) + { + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; + } + + loop_box = hypre_BoxCreate(ndim); + hypre_SetIndex(ustride, 1); + + for (i = 0; i < nboxes; i++) + { + hypre_StructVectorGridBoxCopy(x, i, loop_box); + start = hypre_BoxIMin(loop_box); + + x_data_box = hypre_StructVectorGridDataBox(x, i); + y_data_box = hypre_StructVectorGridDataBox(y, i); - hypre_BoxGetSize(box, loop_size); + xp = hypre_StructVectorGridData(x, i); + yp = hypre_StructVectorGridData(y, i); + + hypre_BoxGetSize(loop_box, loop_size); #define DEVICE_VAR is_device_ptr(yp,xp) hypre_BoxLoop2Begin(hypre_StructVectorNDim(x), loop_size, - x_data_box, start, unit_stride, xi, - y_data_box, start, unit_stride, yi); + x_data_box, start, ustride, xi, + y_data_box, start, ustride, yi); { yp[yi] = xp[xi]; } @@ -63,13 +90,21 @@ hypre_StructCopy( hypre_StructVector *x, #undef DEVICE_VAR } + hypre_BoxDestroy(loop_box); + + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_StructPartialCopy: copy only the components on a subset of the grid. + * Copy only the components on a subset of the grid. + * * A BoxArrayArray of boxes are needed- for each box of x, only an array * of subboxes (i.e., a boxarray for each box of x) are copied. + * + * RDF TODO: Remove this routine and the SStruct routine that calls it. Need to + * remove the FAC solver as well (it's the only thing that uses it). *--------------------------------------------------------------------------*/ HYPRE_Int @@ -87,11 +122,11 @@ hypre_StructPartialCopy( hypre_StructVector *x, hypre_Box *box; hypre_Index loop_size; hypre_IndexRef start; - hypre_Index unit_stride; + hypre_Index ustride; HYPRE_Int i, j ; - hypre_SetIndex(unit_stride, 1); + hypre_SetIndex(ustride, 1); hypre_ForBoxArrayI(i, array_boxes) { @@ -113,8 +148,8 @@ hypre_StructPartialCopy( hypre_StructVector *x, #define DEVICE_VAR is_device_ptr(yp,xp) hypre_BoxLoop2Begin(hypre_StructVectorNDim(x), loop_size, - x_data_box, start, unit_stride, xi, - y_data_box, start, unit_stride, yi); + x_data_box, start, ustride, xi, + y_data_box, start, ustride, yi); { yp[yi] = xp[xi]; } diff --git a/src/struct_mv/struct_data.c b/src/struct_mv/struct_data.c new file mode 100644 index 0000000000..2b08962f2e --- /dev/null +++ b/src/struct_mv/struct_data.c @@ -0,0 +1,142 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_StructData class. + * + *****************************************************************************/ + +#include "_hypre_struct_mv.h" +#include "_hypre_struct_mv.hpp" + +/*-------------------------------------------------------------------------- + * Copy struct data with possibly different data spaces. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructDataCopy( HYPRE_Complex *fr_data, /* from */ + hypre_BoxArray *fr_data_space, + HYPRE_Complex *to_data, /* to */ + hypre_BoxArray *to_data_space, + HYPRE_Int ndim, + HYPRE_Int nval ) +{ + HYPRE_Int fr_nboxes = hypre_BoxArraySize(fr_data_space); + HYPRE_Int to_nboxes = hypre_BoxArraySize(to_data_space); + HYPRE_Int *fr_ids = hypre_BoxArrayIDs(fr_data_space); + HYPRE_Int *to_ids = hypre_BoxArrayIDs(to_data_space); + hypre_Box *fr_data_box, *to_data_box; + HYPRE_Int fr_data_off, to_data_off; + HYPRE_Int fr_data_vol, to_data_vol; + HYPRE_Complex *fr_dp, *to_dp; + HYPRE_Int fb, tb, val; + hypre_Box *int_box; + hypre_IndexRef start; + hypre_Index stride, loop_size; + + if (fr_data == NULL || to_data == NULL) + { + return hypre_error_flag; + } + + HYPRE_ANNOTATE_FUNC_BEGIN; + + hypre_SetIndex(stride, 1); + int_box = hypre_BoxCreate(ndim); + + fb = 0; + fr_data_off = 0; + to_data_off = 0; + for (tb = 0; tb < to_nboxes; tb++) + { + to_data_box = hypre_BoxArrayBox(to_data_space, tb); + to_data_vol = hypre_BoxVolume(to_data_box); + + while ((fb < fr_nboxes) && (fr_ids[fb] < to_ids[tb])) + { + fr_data_box = hypre_BoxArrayBox(fr_data_space, fb); + fr_data_vol = hypre_BoxVolume(fr_data_box); + fr_data_off += nval * fr_data_vol; + fb++; + } + if ((fb < fr_nboxes) && (fr_ids[fb] == to_ids[tb])) + { + fr_data_box = hypre_BoxArrayBox(fr_data_space, fb); + fr_data_vol = hypre_BoxVolume(fr_data_box); + + hypre_IntersectBoxes(fr_data_box, to_data_box, int_box); + + start = hypre_BoxIMin(int_box); + hypre_BoxGetSize(int_box, loop_size); + + for (val = 0; val < nval; val++) + { + fr_dp = fr_data + fr_data_off + val * fr_data_vol; + to_dp = to_data + to_data_off + val * to_data_vol; + +#define DEVICE_VAR is_device_ptr(fr_dp, to_dp) + hypre_BoxLoop2Begin(ndim, loop_size, + fr_data_box, start, stride, fi, + to_data_box, start, stride, ti); + { + to_dp[ti] = fr_dp[fi]; + } + hypre_BoxLoop2End(fi, ti); +#undef DEVICE_VAR + } + } + + to_data_off += nval * to_data_vol; + } + + hypre_BoxDestroy(int_box); + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Compute num_ghost array from stencil + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructNumGhostFromStencil( hypre_StructStencil *stencil, + HYPRE_Int **num_ghost_ptr ) +{ + HYPRE_Int *num_ghost; + HYPRE_Int ndim = hypre_StructStencilNDim(stencil); + hypre_Index *stencil_shape = hypre_StructStencilShape(stencil); + hypre_IndexRef stencil_offset; + HYPRE_Int s, d, m; + + num_ghost = hypre_CTAlloc(HYPRE_Int, 2 * ndim, HYPRE_MEMORY_HOST); + + for (s = 0; s < hypre_StructStencilSize(stencil); s++) + { + stencil_offset = stencil_shape[s]; + + for (d = 0; d < ndim; d++) + { + m = stencil_offset[d]; + + if (m < 0) + { + num_ghost[2 * d] = hypre_max(num_ghost[2 * d], -m); + } + else if (m > 0) + { + num_ghost[2 * d + 1] = hypre_max(num_ghost[2 * d + 1], m); + } + } + } + + *num_ghost_ptr = num_ghost; + + return hypre_error_flag; +} diff --git a/src/struct_mv/struct_grid.c b/src/struct_mv/struct_grid.c index 254a47faea..47ffc75628 100644 --- a/src/struct_mv/struct_grid.c +++ b/src/struct_mv/struct_grid.c @@ -24,7 +24,6 @@ HYPRE_Int my_rank; static HYPRE_Int time_index = 0; /*-------------------------------------------------------------------------- - * hypre_StructGridCreate *--------------------------------------------------------------------------*/ HYPRE_Int @@ -33,9 +32,9 @@ hypre_StructGridCreate( MPI_Comm comm, hypre_StructGrid **grid_ptr) { hypre_StructGrid *grid; - HYPRE_Int i; + HYPRE_Int i; - grid = hypre_TAlloc(hypre_StructGrid, 1, HYPRE_MEMORY_HOST); + grid = hypre_TAlloc(hypre_StructGrid, 1, HYPRE_MEMORY_HOST); hypre_StructGridComm(grid) = comm; hypre_StructGridNDim(grid) = ndim; @@ -52,12 +51,18 @@ hypre_StructGridCreate( MPI_Comm comm, hypre_StructGridBoxMan(grid) = NULL; hypre_StructGridNumPeriods(grid) = 1; - hypre_StructGridPShifts(grid) = NULL; + hypre_StructGridPShifts(grid) = NULL; hypre_StructGridGhlocalSize(grid) = 0; - for (i = 0; i < 2 * ndim; i++) + for (i = 0; i < ndim; i++) + { + hypre_StructGridNumGhost(grid)[2 * i] = 1; + hypre_StructGridNumGhost(grid)[2 * i + 1] = 1; + } + for (i = ndim; i < HYPRE_MAXDIM; i++) { - hypre_StructGridNumGhost(grid)[i] = 1; + hypre_StructGridNumGhost(grid)[2 * i] = 0; + hypre_StructGridNumGhost(grid)[2 * i + 1] = 0; } *grid_ptr = grid; @@ -66,7 +71,6 @@ hypre_StructGridCreate( MPI_Comm comm, } /*-------------------------------------------------------------------------- - * hypre_StructGridRef *--------------------------------------------------------------------------*/ HYPRE_Int @@ -80,7 +84,6 @@ hypre_StructGridRef( hypre_StructGrid *grid, } /*-------------------------------------------------------------------------- - * hypre_StructGridDestroy *--------------------------------------------------------------------------*/ HYPRE_Int @@ -107,7 +110,6 @@ hypre_StructGridDestroy( hypre_StructGrid *grid ) /*-------------------------------------------------------------------------- - * hypre_StructGridSetPeriodic *--------------------------------------------------------------------------*/ HYPRE_Int @@ -120,7 +122,6 @@ hypre_StructGridSetPeriodic( hypre_StructGrid *grid, } /*-------------------------------------------------------------------------- - * hypre_StructGridSetExtents *--------------------------------------------------------------------------*/ HYPRE_Int @@ -139,7 +140,6 @@ hypre_StructGridSetExtents( hypre_StructGrid *grid, } /*-------------------------------------------------------------------------- - * hypre_StructGridSetBoxes *--------------------------------------------------------------------------*/ HYPRE_Int @@ -154,27 +154,25 @@ hypre_StructGridSetBoxes( hypre_StructGrid *grid, } /*-------------------------------------------------------------------------- - * hypre_StructGridSetBoundingBox *--------------------------------------------------------------------------*/ HYPRE_Int hypre_StructGridSetBoundingBox( hypre_StructGrid *grid, - hypre_Box *new_bb ) + hypre_Box *new_bb ) { hypre_BoxDestroy(hypre_StructGridBoundingBox(grid)); - hypre_StructGridBoundingBox(grid) = hypre_BoxDuplicate(new_bb); + hypre_StructGridBoundingBox(grid) = hypre_BoxClone(new_bb); return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_StructGridSetIDs *--------------------------------------------------------------------------*/ HYPRE_Int hypre_StructGridSetIDs( hypre_StructGrid *grid, - HYPRE_Int *ids ) + HYPRE_Int *ids ) { hypre_TFree(hypre_StructGridIDs(grid), HYPRE_MEMORY_HOST); hypre_StructGridIDs(grid) = ids; @@ -183,7 +181,6 @@ hypre_StructGridSetIDs( hypre_StructGrid *grid, } /*-------------------------------------------------------------------------- - * hypre_StructGridSetBoxManager *--------------------------------------------------------------------------*/ HYPRE_Int @@ -198,7 +195,6 @@ hypre_StructGridSetBoxManager( hypre_StructGrid *grid, } /*-------------------------------------------------------------------------- - * hypre_StructGridSetMaxDistance *--------------------------------------------------------------------------*/ HYPRE_Int @@ -211,49 +207,36 @@ hypre_StructGridSetMaxDistance( hypre_StructGrid *grid, } /*-------------------------------------------------------------------------- - * New - hypre_StructGridAssemble - * AHB 9/06 - * New assemble routine that uses the BoxManager structure - * - * Notes: - * 1. No longer need a different assemble for the assumed partition case - * 2. if this is called from StructCoarsen, then the Box Manager has already - * been created, and ids have been set - * + * Computes the global size of the grid if it has not been computed before. *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_StructGridAssemble( hypre_StructGrid *grid ) +hypre_StructGridComputeGlobalSize( hypre_StructGrid *grid ) { + MPI_Comm comm = hypre_StructGridComm(grid); + HYPRE_BigInt local_size = (HYPRE_BigInt) hypre_StructGridLocalSize(grid); + HYPRE_BigInt global_size = hypre_StructGridGlobalSize(grid); - HYPRE_Int d, k, p, i; - - HYPRE_Int is_boxman; - HYPRE_Int size, ghostsize; - HYPRE_Int num_local_boxes; - HYPRE_Int myid, num_procs; - HYPRE_BigInt global_size; - HYPRE_Int max_nentries; - HYPRE_Int info_size; - HYPRE_Int num_periods; - - HYPRE_Int *ids = NULL; - HYPRE_Int iperiodic, notcenter; - - HYPRE_Int sendbuf6[2 * HYPRE_MAXDIM], recvbuf6[2 * HYPRE_MAXDIM]; - - hypre_Box *box; - hypre_Box *ghostbox; - hypre_Box *grow_box; - hypre_Box *periodic_box; - hypre_Box *result_box; + if (!global_size) + { + hypre_MPI_Allreduce(&local_size, &global_size, 1, HYPRE_MPI_BIG_INT, + hypre_MPI_SUM, comm); + hypre_StructGridGlobalSize(grid) = global_size; + } - hypre_Index min_index, max_index, loop_size; - hypre_Index *pshifts; - hypre_IndexRef pshift; + return hypre_error_flag; +} - void *entry_info = NULL; +/*-------------------------------------------------------------------------- + * AHB 9/06 - New assemble routine that uses the BoxManager structure + * + * Notes: + * 1. No longer need a different assemble for the assumed partition case + *--------------------------------------------------------------------------*/ +HYPRE_Int +hypre_StructGridAssemble( hypre_StructGrid *grid ) +{ /* initialize info from the grid */ MPI_Comm comm = hypre_StructGridComm(grid); HYPRE_Int ndim = hypre_StructGridNDim(grid); @@ -262,7 +245,33 @@ hypre_StructGridAssemble( hypre_StructGrid *grid ) hypre_Box *bounding_box = hypre_StructGridBoundingBox(grid); hypre_IndexRef periodic = hypre_StructGridPeriodic(grid); hypre_BoxManager *boxman = hypre_StructGridBoxMan(grid); - HYPRE_Int *numghost = hypre_StructGridNumGhost(grid); + HYPRE_Int *num_ghost = hypre_StructGridNumGhost(grid); + + HYPRE_Int myid, num_procs; + HYPRE_Int *ids = NULL; + HYPRE_Int iperiodic, notcenter; + HYPRE_Int is_boxman; + HYPRE_Int size, ghost_size; + HYPRE_Int num_local_boxes; + HYPRE_Int box_volume; + HYPRE_Int max_nentries; + HYPRE_Int info_size; + HYPRE_Int num_periods; + HYPRE_Int d, k, p, i; + HYPRE_Int sendbuf6[2 * HYPRE_MAXDIM]; + HYPRE_Int recvbuf6[2 * HYPRE_MAXDIM]; + + hypre_Box *box; + hypre_Box *ghost_box; + hypre_Box *grow_box; + hypre_Box *periodic_box; + hypre_Box *result_box; + + hypre_Index min_index, max_index, loop_size; + hypre_Index *pshifts; + hypre_IndexRef pshift; + + void *entry_info = NULL; if (!time_index) { @@ -291,12 +300,20 @@ hypre_StructGridAssemble( hypre_StructGrid *grid ) to set them */ if (hypre_StructGridIDs(grid) == NULL) { - ids = hypre_CTAlloc(HYPRE_Int, num_local_boxes, HYPRE_MEMORY_HOST); + /* TODO: Move IDs to BoxArray data structure */ + ids = hypre_CTAlloc(HYPRE_Int, num_local_boxes, HYPRE_MEMORY_HOST); for (i = 0; i < num_local_boxes; i++) { ids[i] = i; } hypre_StructGridIDs(grid) = ids; + + hypre_BoxArrayIDs(local_boxes) = hypre_TReAlloc(hypre_BoxArrayIDs(local_boxes), HYPRE_Int, + num_local_boxes, HYPRE_MEMORY_HOST); + for (i = 0; i < num_local_boxes; i++) + { + hypre_BoxArrayID(local_boxes, i) = i; + } } else { @@ -314,7 +331,7 @@ hypre_StructGridAssemble( hypre_StructGrid *grid ) } num_periods = hypre_BoxVolume(box); - pshifts = hypre_CTAlloc(hypre_Index, num_periods, HYPRE_MEMORY_HOST); + pshifts = hypre_CTAlloc(hypre_Index, num_periods, HYPRE_MEMORY_HOST); pshift = pshifts[0]; hypre_SetIndex(pshift, 0); if (num_periods > 1) @@ -350,38 +367,33 @@ hypre_StructGridAssemble( hypre_StructGrid *grid ) /********calculate local size and the ghost size **************/ size = 0; - ghostsize = 0; - ghostbox = hypre_BoxCreate(ndim); + ghost_size = 0; + ghost_box = hypre_BoxCreate(ndim); hypre_ForBoxI(i, local_boxes) { box = hypre_BoxArrayBox(local_boxes, i); - size += hypre_BoxVolume(box); + box_volume = hypre_BoxVolume(box); + size += box_volume; - hypre_CopyBox(box, ghostbox); - hypre_BoxGrowByArray(ghostbox, numghost); - ghostsize += hypre_BoxVolume(ghostbox); + if (box_volume) + { + hypre_CopyBox(box, ghost_box); + hypre_BoxGrowByArray(ghost_box, num_ghost); + ghost_size += hypre_BoxVolume(ghost_box); + } } - hypre_StructGridLocalSize(grid) = size; - hypre_StructGridGhlocalSize(grid) = ghostsize; - hypre_BoxDestroy(ghostbox); + hypre_StructGridLocalSize(grid) = size; + hypre_StructGridGhlocalSize(grid) = ghost_size; + hypre_StructGridComputeGlobalSize(grid); + hypre_BoxDestroy(ghost_box); /* if the box manager has been created then we don't need to do the * following (because it was done through the coarsening routine) */ if (!is_boxman) { - /*************** set the global size *****************/ - - HYPRE_BigInt big_size = (HYPRE_BigInt)size; - hypre_MPI_Allreduce(&big_size, &global_size, 1, HYPRE_MPI_BIG_INT, - hypre_MPI_SUM, comm); - hypre_StructGridGlobalSize(grid) = global_size; /* TO DO: this HYPRE_Int - * could overflow! (used - * to calc flops) */ - /*************** set bounding box ***********/ - bounding_box = hypre_BoxCreate(ndim); if (num_local_boxes) @@ -398,7 +410,6 @@ hypre_StructGridAssemble( hypre_StructGrid *grid ) { box = hypre_BoxArrayBox(local_boxes, i); - /* find min and max box extents */ for (d = 0; d < ndim; d++) { @@ -410,7 +421,6 @@ hypre_StructGridAssemble( hypre_StructGrid *grid ) } /*set bounding box (this is still based on local info only) */ hypre_BoxSetExtents(bounding_box, min_index, max_index); - } else /* no boxes owned*/ { @@ -463,8 +473,7 @@ hypre_StructGridAssemble( hypre_StructGrid *grid ) hypre_ForBoxI(i, local_boxes) { box = hypre_BoxArrayBox(local_boxes, i); - /* add entry for each local box (the id is the boxnum, and should be - sequential */ + /* add entry for each local box (the id is the boxnum, and should be sequential */ hypre_BoxManAddEntry( boxman, hypre_BoxIMin(box), hypre_BoxIMax(box), myid, i, entry_info ); @@ -555,7 +564,58 @@ hypre_StructGridAssemble( hypre_StructGrid *grid ) } /*-------------------------------------------------------------------------- - * hypre_GatherAllBoxes + * Compute a list of boxnums based on a starting list and a stride, removing + * boxnums from the list whose corresponding boxes coarsen to size zero. + * + * If boxnums == NULL, start with all of the boxes in grid + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructGridComputeBoxnums( hypre_StructGrid *grid, + HYPRE_Int nboxes, + HYPRE_Int *boxnums, + hypre_Index stride, + HYPRE_Int *new_nboxes_ptr, + HYPRE_Int **new_boxnums_ptr ) +{ + HYPRE_Int new_nboxes, *new_boxnums, i, b; + hypre_Box *box; + + box = hypre_BoxCreate(hypre_StructGridNDim(grid)); + + if (boxnums == NULL) + { + nboxes = hypre_StructGridNumBoxes(grid); + } + + new_boxnums = hypre_TAlloc(HYPRE_Int, nboxes, HYPRE_MEMORY_HOST); + new_nboxes = 0; + for (i = 0; i < nboxes; i++) + { + if (boxnums == NULL) + { + b = i; + } + else + { + b = boxnums[i]; + } + hypre_CopyBox(hypre_StructGridBox(grid, b), box); + hypre_CoarsenBox(box, NULL, stride); + if (hypre_BoxVolume(box)) + { + new_boxnums[new_nboxes++] = b; + } + } + *new_nboxes_ptr = new_nboxes; + *new_boxnums_ptr = new_boxnums; + + hypre_BoxDestroy(box); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ HYPRE_Int @@ -597,8 +657,8 @@ hypre_GatherAllBoxes(MPI_Comm comm, /* compute recvcounts and displs */ 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); + 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, recvcounts, 1, HYPRE_MPI_INT, comm); displs[0] = 0; @@ -610,8 +670,8 @@ hypre_GatherAllBoxes(MPI_Comm comm, } /* allocate sendbuf and recvbuf */ - sendbuf = hypre_TAlloc(HYPRE_Int, sendcount, HYPRE_MEMORY_HOST); - recvbuf = hypre_TAlloc(HYPRE_Int, recvbuf_size, HYPRE_MEMORY_HOST); + sendbuf = hypre_TAlloc(HYPRE_Int, sendcount, HYPRE_MEMORY_HOST); + recvbuf = hypre_TAlloc(HYPRE_Int, recvbuf_size, HYPRE_MEMORY_HOST); /* put local box extents and process number into sendbuf */ i = 0; @@ -640,7 +700,7 @@ hypre_GatherAllBoxes(MPI_Comm comm, /* unpack recvbuf box info */ all_boxes_size = recvbuf_size / item_size; all_boxes = hypre_BoxArrayCreate(all_boxes_size, ndim); - all_procs = hypre_TAlloc(HYPRE_Int, all_boxes_size, HYPRE_MEMORY_HOST); + all_procs = hypre_TAlloc(HYPRE_Int, all_boxes_size, HYPRE_MEMORY_HOST); first_local = -1; i = 0; b = 0; @@ -682,14 +742,11 @@ hypre_GatherAllBoxes(MPI_Comm comm, } /*-------------------------------------------------------------------------- - * hypre_ComputeBoxnums - * * It is assumed that, for any process number in 'procs', all of that * processes local boxes appear in the 'boxes' array. * * It is assumed that the boxes in 'boxes' are ordered by associated * process number then by their local ordering on that process. - * *--------------------------------------------------------------------------*/ HYPRE_Int @@ -707,7 +764,7 @@ hypre_ComputeBoxnums(hypre_BoxArray *boxes, *-----------------------------------------------------*/ num_boxes = hypre_BoxArraySize(boxes); - boxnums = hypre_TAlloc(HYPRE_Int, num_boxes, HYPRE_MEMORY_HOST); + boxnums = hypre_TAlloc(HYPRE_Int, num_boxes, HYPRE_MEMORY_HOST); p = -1; for (b = 0; b < num_boxes; b++) @@ -728,54 +785,329 @@ hypre_ComputeBoxnums(hypre_BoxArray *boxes, } /*-------------------------------------------------------------------------- - * hypre_StructGridPrint + * Notes (VPM): + * 1) hypre_BoxNnodes may overflow?. Use BigInt from future. + * 2) It assumes that coordinates can be represented as Int32. + * 3) This is intended for debugging purposes, binary data should be + * used for large files. *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_StructGridPrint( FILE *file, - hypre_StructGrid *grid ) +hypre_StructGridPrintVTK( const char *filename, + hypre_StructGrid *grid ) { - - hypre_BoxArray *boxes; + MPI_Comm comm = hypre_StructGridComm(grid); + HYPRE_Int ndim = hypre_StructGridNDim(grid); + HYPRE_Int my_id, num_procs, i, j, d, n[8]; + HYPRE_Int grid_nnodes, grid_volume; + HYPRE_Int box_id, box_volume, offset_id; + char vtkfile[80]; + FILE *fp; hypre_Box *box; + hypre_BoxArray *boxes; + hypre_Index index, coords, partial_volume, loop_size; + HYPRE_Int growth_array[2 * HYPRE_MAXDIM]; + HYPRE_Int shrink_array[2 * HYPRE_MAXDIM]; + HYPRE_Int cell_type, cell_nnodes; + HYPRE_Int offset; - HYPRE_Int i, d, ndim; - - ndim = hypre_StructGridNDim(grid); - hypre_fprintf(file, "%d\n", ndim); + hypre_MPI_Comm_rank(comm, &my_id); + hypre_MPI_Comm_size(comm, &num_procs); + /* Compute total number of nodes of grid and its volume */ boxes = hypre_StructGridBoxes(grid); - hypre_fprintf(file, "%d\n", hypre_BoxArraySize(boxes)); + grid_nnodes = 0; grid_volume = 0; + hypre_ForBoxI(i, boxes) + { + box = hypre_BoxArrayBox(boxes, i); + grid_nnodes += hypre_BoxNnodes(box); + grid_volume += hypre_BoxVolume(box); + } + + /* Scan number of boxes */ + hypre_MPI_Scan(&hypre_BoxArraySize(boxes), &offset_id, 1, HYPRE_MPI_INT, hypre_MPI_SUM, comm); + offset_id = offset_id - hypre_BoxArraySize(boxes); - /* Print lines of the form: "%d: (%d, %d, %d) x (%d, %d, %d)\n" */ + /* Temporary stuff */ + for (d = 0; d < ndim; d++) + { + growth_array[2 * d] = 0; + growth_array[2 * d + 1] = 1; + shrink_array[2 * d] = 0; + shrink_array[2 * d + 1] = -1; + } + + /* Set VTK cell type */ + switch (ndim) + { + case 1: + cell_type = 4; /* VTK_POLY_LINE */ + cell_nnodes = 2; + break; + + case 2: + cell_type = 8; /* VTK_PIXEL */ + cell_nnodes = 4; + break; + + case 3: + cell_type = 11; /* VTK_VOXEL */ + cell_nnodes = 8; + break; + + default: + return hypre_error_flag; + /* TODO: Handle Error */ + } + + /* Write VTK XML data file */ + hypre_sprintf(vtkfile, "%s.vtu.%05d", filename, my_id); + fp = fopen(vtkfile, "w"); + hypre_fprintf(fp, "\n"); + hypre_fprintf(fp, "\n"); + hypre_fprintf(fp, "\t\n"); + hypre_fprintf(fp, "\t\t\n", grid_nnodes, + grid_volume); + hypre_fprintf(fp, "\t\t\t\n"); + hypre_fprintf(fp, "\t\t\t\t\n"); + switch (ndim) + { + case 1: + hypre_ForBoxI(i, boxes) + { + box = hypre_BoxArrayBox(boxes, i); + hypre_BoxGrowByArray(box, growth_array); + + hypre_BoxGetSize(box, loop_size); + hypre_SerialBoxLoop0Begin(ndim, loop_size); + { + zypre_BoxLoopGetIndex(index); + hypre_AddIndexes(index, hypre_BoxIMin(box), ndim, coords); + hypre_fprintf(fp, "\t\t\t\t\t%d 0 0\n", coords[0]); + } + hypre_SerialBoxLoop0End(); + + hypre_BoxGrowByArray(box, shrink_array); + } + break; + + case 2: + hypre_ForBoxI(i, boxes) + { + box = hypre_BoxArrayBox(boxes, i); + hypre_BoxGrowByArray(box, growth_array); + + hypre_BoxGetSize(box, loop_size); + hypre_SerialBoxLoop0Begin(ndim, loop_size); + { + zypre_BoxLoopGetIndex(index); + hypre_AddIndexes(index, hypre_BoxIMin(box), ndim, coords); + hypre_fprintf(fp, "\t\t\t\t\t%d %d 0\n", coords[0], coords[1]); + } + hypre_SerialBoxLoop0End(); + + hypre_BoxGrowByArray(box, shrink_array); + } + break; + + case 3: + hypre_ForBoxI(i, boxes) + { + box = hypre_BoxArrayBox(boxes, i); + hypre_BoxGrowByArray(box, growth_array); + + hypre_BoxGetSize(box, loop_size); + hypre_SerialBoxLoop0Begin(ndim, loop_size); + { + zypre_BoxLoopGetIndex(index); + hypre_AddIndexes(index, hypre_BoxIMin(box), ndim, coords); + hypre_fprintf(fp, "\t\t\t\t\t%d %d %d\n", coords[0], coords[1], coords[2]); + } + hypre_SerialBoxLoop0End(); + + hypre_BoxGrowByArray(box, shrink_array); + } + break; + } + hypre_fprintf(fp, "\t\t\t\t\n"); + hypre_fprintf(fp, "\t\t\t\n"); + + hypre_fprintf(fp, "\t\t\t\n"); + hypre_fprintf(fp, "\t\t\t\t\n"); + offset = 0; + switch (ndim) + { + case 1: + hypre_ForBoxI(i, boxes) + { + box = hypre_BoxArrayBox(boxes, i); + hypre_BoxGrowByArray(box, growth_array); + hypre_BoxPartialVolume(box, partial_volume); + hypre_BoxGrowByArray(box, shrink_array); + + hypre_BoxGetSize(box, loop_size); + hypre_SerialBoxLoop0Begin(ndim, loop_size); + { + zypre_BoxLoopGetIndex(index); + + n[0] = hypre_BoxOffsetDistance(box, index) + offset; + n[1] = n[0] + 1; + + hypre_fprintf(fp, "\t\t\t\t\t%d %d\n", n[0], n[1]); + } + hypre_SerialBoxLoop0End(); + + offset += partial_volume[0]; + } + break; + + case 2: + hypre_ForBoxI(i, boxes) + { + box = hypre_BoxArrayBox(boxes, i); + hypre_BoxGrowByArray(box, growth_array); + hypre_BoxPartialVolume(box, partial_volume); + hypre_BoxGrowByArray(box, shrink_array); + + hypre_BoxGetSize(box, loop_size); + hypre_SerialBoxLoop0Begin(ndim, loop_size); + { + zypre_BoxLoopGetIndex(index); + + n[0] = hypre_BoxOffsetDistance(box, index) + hypre_IndexD(index, 1) + offset; + n[1] = n[0] + 1; + n[2] = n[0] + partial_volume[0]; + n[3] = n[2] + 1; + + hypre_fprintf(fp, "\t\t\t\t\t"); + hypre_fprintf(fp, "%d", n[0]); + for (j = 1; j < cell_nnodes; j++) { hypre_fprintf(fp, " %d", n[j]); } + hypre_fprintf(fp, "\n"); + } + hypre_SerialBoxLoop0End(); + + offset += partial_volume[1]; + } + break; + + case 3: + hypre_ForBoxI(i, boxes) + { + box = hypre_BoxArrayBox(boxes, i); + hypre_BoxGrowByArray(box, growth_array); + hypre_BoxPartialVolume(box, partial_volume); + hypre_BoxGrowByArray(box, shrink_array); + + hypre_BoxGetSize(box, loop_size); + hypre_SerialBoxLoop0Begin(ndim, loop_size); + { + zypre_BoxLoopGetIndex(index); + + n[0] = hypre_BoxOffsetDistance(box, index) + offset; + n[0] += hypre_IndexD(index, 1); + n[0] += hypre_IndexD(index, 2) * (partial_volume[0] + hypre_BoxSizeD(box, 1)); + n[1] = n[0] + 1; + n[2] = n[0] + partial_volume[0]; + n[3] = n[2] + 1; + n[4] = n[0] + partial_volume[1]; + n[5] = n[4] + 1; + n[6] = n[4] + partial_volume[0]; + n[7] = n[6] + 1; + + hypre_fprintf(fp, "\t\t\t\t\t"); + hypre_fprintf(fp, "%d", n[0]); + for (j = 1; j < cell_nnodes; j++) { hypre_fprintf(fp, " %d", n[j]); } + hypre_fprintf(fp, "\n"); + } + hypre_SerialBoxLoop0End(); + + offset += partial_volume[2]; + } + } + hypre_fprintf(fp, "\t\t\t\t\n"); + hypre_fprintf(fp, "\t\t\t\t\n"); + for (i = 1; i <= grid_volume; i++) + { + hypre_fprintf(fp, "\t\t\t\t\t%d\n", cell_nnodes * i); + } + hypre_fprintf(fp, "\t\t\t\t\n"); + hypre_fprintf(fp, "\t\t\t\t\n"); + for (i = 0; i < grid_volume; i++) + { + hypre_fprintf(fp, "\t\t\t\t\t%d\n", cell_type); + } + hypre_fprintf(fp, "\t\t\t\t\n"); + hypre_fprintf(fp, "\t\t\t\n"); + hypre_fprintf(fp, "\t\t\t\n"); + hypre_fprintf(fp, "\t\t\t\t\n"); hypre_ForBoxI(i, boxes) { box = hypre_BoxArrayBox(boxes, i); - hypre_fprintf(file, "%d: (%d", i, hypre_BoxIMinD(box, 0)); - for (d = 1; d < ndim; d++) + box_id = hypre_StructGridID(grid, i); + box_volume = hypre_BoxVolume(box); + for (j = 0; j < box_volume; j++) { - hypre_fprintf(file, ", %d", hypre_BoxIMinD(box, d)); + hypre_fprintf(fp, "\t\t\t\t\t%d\n", box_id + offset_id); } - 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, ")\n"); } - /* Print line of the form: "Periodic: %d %d %d\n" */ - hypre_fprintf(file, "\nPeriodic:"); - for (d = 0; d < ndim; d++) + hypre_fprintf(fp, "\t\t\t\t\n"); + hypre_fprintf(fp, "\t\t\t\n"); + hypre_fprintf(fp, "\t\t\n"); + hypre_fprintf(fp, "\t\n"); + hypre_fprintf(fp, ""); + fclose(fp); + + /* Master process writes the parallel unstructured grid file */ + if (my_id == 0) { - hypre_fprintf(file, " %d", hypre_StructGridPeriodic(grid)[d]); + hypre_sprintf(vtkfile, "%s.pvtu", filename); + fp = fopen(vtkfile, "w"); + hypre_fprintf(fp, "\n"); + hypre_fprintf(fp, "\n"); + hypre_fprintf(fp, "\t\n"); + hypre_fprintf(fp, "\t\t\n"); + hypre_fprintf(fp, "\t\t\t\n"); + hypre_fprintf(fp, "\t\t\n"); + hypre_fprintf(fp, "\t\t\n"); + hypre_fprintf(fp, "\t\t\t\n"); + hypre_fprintf(fp, "\t\t\n"); + for (i = 0; i < num_procs; i++) + { + hypre_fprintf(fp, "\t\t\n", filename, i); + } + hypre_fprintf(fp, "\t\n"); + hypre_fprintf(fp, "\n"); + fclose(fp); } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructGridPrint( FILE *file, + hypre_StructGrid *grid ) +{ + HYPRE_Int ndim = hypre_StructGridNDim(grid); + + /* Print box array */ + hypre_BoxArrayPrintToFile(file, hypre_StructGridBoxes(grid)); + + /* Print line of the form: "Periodic: \n" */ + hypre_fprintf(file, "\nPeriodic: "); + hypre_IndexPrint(file, ndim, hypre_StructGridPeriodic(grid)); hypre_fprintf(file, "\n"); return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_StructGridRead *--------------------------------------------------------------------------*/ HYPRE_Int @@ -783,49 +1115,21 @@ hypre_StructGridRead( MPI_Comm comm, FILE *file, hypre_StructGrid **grid_ptr ) { - hypre_StructGrid *grid; - hypre_Index ilower; - hypre_Index iupper; - hypre_IndexRef periodic; + hypre_BoxArray *boxes; HYPRE_Int ndim; - HYPRE_Int num_boxes; - HYPRE_Int i, d, idummy; + hypre_BoxArrayReadFromFile(file, &boxes); - hypre_fscanf(file, "%d\n", &ndim); + ndim = hypre_BoxArrayNDim(boxes); hypre_StructGridCreate(comm, ndim, &grid); + hypre_StructGridSetBoxes(grid, boxes); - hypre_fscanf(file, "%d\n", &num_boxes); - - /* Read lines of the form: "%d: (%d, %d, %d) x (%d, %d, %d)\n" */ - for (i = 0; i < num_boxes; i++) - { - hypre_fscanf(file, "%d: (%d", &idummy, &hypre_IndexD(ilower, 0)); - for (d = 1; d < ndim; d++) - { - hypre_fscanf(file, ", %d", &hypre_IndexD(ilower, d)); - } - hypre_fscanf(file, ") x (%d", &hypre_IndexD(iupper, 0)); - for (d = 1; d < ndim; d++) - { - hypre_fscanf(file, ", %d", &hypre_IndexD(iupper, d)); - } - hypre_fscanf(file, ")\n"); - - hypre_StructGridSetExtents(grid, ilower, iupper); - } - - periodic = hypre_StructGridPeriodic(grid); - - /* Read line of the form: "Periodic: %d %d %d\n" */ - hypre_fscanf(file, "Periodic:"); - for (d = 0; d < ndim; d++) - { - hypre_fscanf(file, " %d", &hypre_IndexD(periodic, d)); - } + /* Read line of the form: "Periodic: \n" */ + hypre_fscanf(file, "\nPeriodic: "); + hypre_IndexRead(file, ndim, hypre_StructGridPeriodic(grid)); hypre_fscanf(file, "\n"); hypre_StructGridAssemble(grid); @@ -836,9 +1140,7 @@ hypre_StructGridRead( MPI_Comm comm, } /*------------------------------------------------------------------------------ - * GEC0902 hypre_StructGridSetNumGhost - * - * the purpose is to set num ghost in the structure grid. It is identical + * The purpose is to set num ghost in the structure grid. It is identical * to the function that is used in the structure vector entity. *-----------------------------------------------------------------------------*/ @@ -856,7 +1158,6 @@ hypre_StructGridSetNumGhost( hypre_StructGrid *grid, HYPRE_Int *num_ghost ) } /*-------------------------------------------------------------------------- - * hypre_StructGridGetMaxBoxSize *--------------------------------------------------------------------------*/ HYPRE_Int @@ -877,6 +1178,10 @@ hypre_StructGridGetMaxBoxSize( hypre_StructGrid *grid ) } #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_StructGridSetDataLocation( HYPRE_StructGrid grid, HYPRE_MemoryLocation data_location ) { diff --git a/src/struct_mv/struct_grid.h b/src/struct_mv/struct_grid.h index d22a4aca33..67f3c103f6 100644 --- a/src/struct_mv/struct_grid.h +++ b/src/struct_mv/struct_grid.h @@ -25,7 +25,7 @@ typedef struct hypre_StructGrid_struct HYPRE_Int ndim; /* Number of grid dimensions */ hypre_BoxArray *boxes; /* Array of boxes in this process */ - HYPRE_Int *ids; /* Unique IDs for boxes */ + HYPRE_Int *ids; /* Unique IDs for boxes - RDF TODO: Use boxes IDs instead */ hypre_Index max_distance; /* Neighborhood size - in each dimension*/ hypre_Box *bounding_box; /* Bounding box around grid */ @@ -38,14 +38,13 @@ typedef struct hypre_StructGrid_struct hypre_Index *pshifts; /* shifts of periodicity */ - HYPRE_Int ref_count; - HYPRE_Int ghlocal_size; /* Number of vars in box including ghosts */ HYPRE_Int num_ghost[2 * HYPRE_MAXDIM]; /* ghost layer size */ hypre_BoxManager *boxman; + } hypre_StructGrid; /*-------------------------------------------------------------------------- @@ -56,6 +55,7 @@ typedef struct hypre_StructGrid_struct #define hypre_StructGridNDim(grid) ((grid) -> ndim) #define hypre_StructGridBoxes(grid) ((grid) -> boxes) #define hypre_StructGridIDs(grid) ((grid) -> ids) +#define hypre_StructGridID(grid, i) ((grid) -> ids[i]) #define hypre_StructGridMaxDistance(grid) ((grid) -> max_distance) #define hypre_StructGridBoundingBox(grid) ((grid) -> bounding_box) #define hypre_StructGridLocalSize(grid) ((grid) -> local_size) @@ -76,6 +76,7 @@ typedef struct hypre_StructGrid_struct #if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) #define hypre_StructGridDataLocation(grid) ((grid) -> data_location) #endif + /*-------------------------------------------------------------------------- * Looping macros: *--------------------------------------------------------------------------*/ diff --git a/src/struct_mv/struct_innerprod.c b/src/struct_mv/struct_innerprod.c index d15b5cc0b8..f229cf58f0 100644 --- a/src/struct_mv/struct_innerprod.c +++ b/src/struct_mv/struct_innerprod.c @@ -15,15 +15,20 @@ #include "_hypre_struct_mv.hpp" /*-------------------------------------------------------------------------- - * hypre_StructInnerProd + * hypre_StructInnerProdLocal + * + * The vectors x and y may have different base grids, but the grid boxes for + * each vector (defined by grid, stride, nboxes, boxnums) must be the same. + * Only nboxes is checked, the rest is assumed to be true. *--------------------------------------------------------------------------*/ HYPRE_Real -hypre_StructInnerProd( hypre_StructVector *x, - hypre_StructVector *y ) +hypre_StructInnerProdLocal( hypre_StructVector *x, + hypre_StructVector *y ) { - HYPRE_Real final_innerprod_result; - HYPRE_Real process_result; + HYPRE_Int ndim = hypre_StructVectorNDim(x); + + HYPRE_Real result = 0.0; hypre_Box *x_data_box; hypre_Box *y_data_box; @@ -31,36 +36,39 @@ hypre_StructInnerProd( hypre_StructVector *x, HYPRE_Complex *xp; HYPRE_Complex *yp; - hypre_BoxArray *boxes; - hypre_Box *box; + HYPRE_Int nboxes; + hypre_Box *loop_box; hypre_Index loop_size; hypre_IndexRef start; - hypre_Index unit_stride; + hypre_Index ustride; - HYPRE_Int ndim = hypre_StructVectorNDim(x); HYPRE_Int i; -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - const HYPRE_Int data_location = hypre_StructGridDataLocation(hypre_StructVectorGrid(y)); -#endif + nboxes = hypre_StructVectorNBoxes(x); + + /* Return if nboxes is not the same for x and y */ + if (nboxes != hypre_StructVectorNBoxes(y)) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "StructInnerProd: nboxes for x and y do not match!"); - HYPRE_Real local_result = 0.0; + return hypre_error_flag; + } - hypre_SetIndex(unit_stride, 1); + loop_box = hypre_BoxCreate(ndim); + hypre_SetIndex(ustride, 1); - boxes = hypre_StructGridBoxes(hypre_StructVectorGrid(y)); - hypre_ForBoxI(i, boxes) + for (i = 0; i < nboxes; i++) { - box = hypre_BoxArrayBox(boxes, i); - start = hypre_BoxIMin(box); + hypre_StructVectorGridBoxCopy(x, i, loop_box); + start = hypre_BoxIMin(loop_box); - x_data_box = hypre_BoxArrayBox(hypre_StructVectorDataSpace(x), i); - y_data_box = hypre_BoxArrayBox(hypre_StructVectorDataSpace(y), i); + x_data_box = hypre_StructVectorGridDataBox(x, i); + y_data_box = hypre_StructVectorGridDataBox(y, i); - xp = hypre_StructVectorBoxData(x, i); - yp = hypre_StructVectorBoxData(y, i); + xp = hypre_StructVectorGridData(x, i); + yp = hypre_StructVectorGridData(y, i); - hypre_BoxGetSize(box, loop_size); + hypre_BoxGetSize(loop_box, loop_size); #if defined(HYPRE_USING_KOKKOS) || defined(HYPRE_USING_SYCL) HYPRE_Real box_sum = 0.0; @@ -84,8 +92,8 @@ hypre_StructInnerProd( hypre_StructVector *x, #define DEVICE_VAR is_device_ptr(yp,xp) hypre_BoxLoop2ReductionBegin(ndim, loop_size, - x_data_box, start, unit_stride, xi, - y_data_box, start, unit_stride, yi, + x_data_box, start, ustride, xi, + y_data_box, start, ustride, yi, box_sum) { HYPRE_Real tmp = xp[xi] * hypre_conj(yp[yi]); @@ -93,15 +101,37 @@ hypre_StructInnerProd( hypre_StructVector *x, } hypre_BoxLoop2ReductionEnd(xi, yi, box_sum); - local_result += (HYPRE_Real) box_sum; + result += (HYPRE_Real) box_sum; } - process_result = (HYPRE_Real) local_result; + hypre_BoxDestroy(loop_box); - hypre_MPI_Allreduce(&process_result, &final_innerprod_result, 1, - HYPRE_MPI_REAL, hypre_MPI_SUM, hypre_StructVectorComm(x)); + return result; +} + +/*-------------------------------------------------------------------------- + * hypre_StructInnerProd + *--------------------------------------------------------------------------*/ + +HYPRE_Real +hypre_StructInnerProd( hypre_StructVector *x, + hypre_StructVector *y ) +{ + HYPRE_Real local_result; + HYPRE_Real global_result; + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("InnerProd"); + + local_result = hypre_StructInnerProdLocal(x, y); + + hypre_MPI_Allreduce(&local_result, &global_result, 1, HYPRE_MPI_REAL, hypre_MPI_SUM, + hypre_StructVectorComm(x)); hypre_IncFLOPCount(2 * hypre_StructVectorGlobalSize(x)); - return final_innerprod_result; + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return global_result; } diff --git a/src/struct_mv/struct_io.c b/src/struct_mv/struct_io.c index 34046c4f6b..f4939796fe 100644 --- a/src/struct_mv/struct_io.c +++ b/src/struct_mv/struct_io.c @@ -12,19 +12,21 @@ *****************************************************************************/ #include "_hypre_struct_mv.h" +#ifdef HYPRE_COMPLEX +#include +#endif /*-------------------------------------------------------------------------- - * hypre_PrintBoxArrayData - * * Note: data array is expected to live on the host memory. *--------------------------------------------------------------------------*/ HYPRE_Int hypre_PrintBoxArrayData( FILE *file, + HYPRE_Int ndim, hypre_BoxArray *box_array, hypre_BoxArray *data_space, HYPRE_Int num_values, - HYPRE_Int dim, + HYPRE_Int *value_ids, HYPRE_Complex *data ) { hypre_Box *box; @@ -41,6 +43,7 @@ hypre_PrintBoxArrayData( FILE *file, HYPRE_Complex value; /* Print data from the host */ + hypre_fprintf(file, "%d\n", num_values); hypre_SetIndex(stride, 1); hypre_ForBoxI(i, box_array) { @@ -52,26 +55,30 @@ hypre_PrintBoxArrayData( FILE *file, hypre_BoxGetSize(box, loop_size); - hypre_SerialBoxLoop1Begin(dim, loop_size, + hypre_SerialBoxLoop1Begin(ndim, loop_size, data_box, start, stride, datai); { /* Print lines of the form: "%d: (%d, %d, %d; %d) %.14e\n" */ zypre_BoxLoopGetIndex(index); for (j = 0; j < num_values; j++) { - hypre_fprintf(file, "%d: (%d", - i, hypre_IndexD(start, 0) + hypre_IndexD(index, 0)); - for (d = 1; d < dim; d++) + hypre_fprintf(file, "%d: (%d", i, hypre_IndexD(start, 0) + hypre_IndexD(index, 0)); + for (d = 1; d < ndim; d++) { - hypre_fprintf(file, ", %d", - hypre_IndexD(start, d) + hypre_IndexD(index, d)); + hypre_fprintf(file, ", %d", hypre_IndexD(start, d) + hypre_IndexD(index, d)); } value = data[datai + j * data_box_volume]; + + /* Make zero values "positive" */ + if (value == 0.0) + { + value = 0.0; + } #ifdef HYPRE_COMPLEX hypre_fprintf(file, "; %d) %.14e , %.14e\n", - j, hypre_creal(value), hypre_cimag(value)); + value_ids[j], hypre_creal(value), hypre_cimag(value)); #else - hypre_fprintf(file, "; %d) %.14e\n", j, value); + hypre_fprintf(file, "; %d) %.14e\n", value_ids[j], value); #endif } } @@ -84,295 +91,73 @@ hypre_PrintBoxArrayData( FILE *file, } /*-------------------------------------------------------------------------- - * hypre_PrintCCVDBoxArrayData - * - * 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 -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_ReadBoxArrayData( FILE *file, + HYPRE_Int ndim, + hypre_BoxArray *box_array, + HYPRE_Int *num_values_ptr, + HYPRE_Int **value_ids_ptr, + HYPRE_Complex **values_ptr ) { - HYPRE_UNUSED_VAR(num_values); - HYPRE_UNUSED_VAR(data_space); + HYPRE_Int num_values; + HYPRE_Int *value_ids; + HYPRE_Complex *values; hypre_Box *box; - hypre_Box *data_box; - - HYPRE_Int data_box_volume; hypre_Index loop_size; hypre_IndexRef start; hypre_Index stride; - hypre_Index index; - HYPRE_Int i, j, d; HYPRE_Complex value; - - /*---------------------------------------- - * Print data - *----------------------------------------*/ - - hypre_SetIndex(stride, 1); - - /* First is the constant, off-diagonal, part of the matrix: */ - for (j = 0; j < stencil_size; j++) - { - if (symm_elements[j] < 0 && j != center_rank) - { #ifdef HYPRE_COMPLEX - hypre_fprintf( file, "*: (*, *, *; %d) %.14e , %.14e\n", - j, hypre_creal(data[0]), hypre_cimag(data[0])); -#else - hypre_fprintf( file, "*: (*, *, *; %d) %.14e\n", - j, data[0] ); + HYPRE_Complex rvalue, ivalue; #endif - } - ++data; - } - - /* Then each box has a variable, diagonal, part of the matrix: */ - hypre_ForBoxI(i, box_array) - { - box = hypre_BoxArrayBox(box_array, i); - data_box = hypre_BoxArrayBox(data_space, i); - - start = hypre_BoxIMin(box); - data_box_volume = hypre_BoxVolume(data_box); - - hypre_BoxGetSize(box, loop_size); - - hypre_SerialBoxLoop1Begin(dim, loop_size, - data_box, start, stride, datai); - { - /* Print line of the form: "%d: (%d, %d, %d; %d) %.14e\n" */ - zypre_BoxLoopGetIndex(index); - hypre_fprintf(file, "%d: (%d", - i, hypre_IndexD(start, 0) + hypre_IndexD(index, 0)); - for (d = 1; d < dim; d++) - { - hypre_fprintf(file, ", %d", - hypre_IndexD(start, d) + hypre_IndexD(index, d)); - } - value = data[datai]; -#ifdef HYPRE_COMPLEX - hypre_fprintf(file, "; %d) %.14e , %.14e\n", - center_rank, hypre_creal(value), hypre_cimag(value)); -#else - hypre_fprintf(file, "; %d) %.14e\n", center_rank, value); -#endif - } - hypre_SerialBoxLoop1End(datai); - data += data_box_volume; - } - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - * hypre_PrintCCBoxArrayData - * - * same as hypre_PrintBoxArrayData but for constant coefficients - * - * Note: data array is expected to live on the host memory. - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_PrintCCBoxArrayData( FILE *file, - hypre_BoxArray *box_array, - hypre_BoxArray *data_space, - HYPRE_Int num_values, - HYPRE_Complex *data ) -{ - HYPRE_UNUSED_VAR(data_space); - - HYPRE_Int datai; - - HYPRE_Int i, j; - HYPRE_Complex value; - - /*---------------------------------------- - * Print data - *----------------------------------------*/ - - hypre_ForBoxI(i, box_array) - { - datai = hypre_CCBoxIndexRank_noargs(); - - for (j = 0; j < num_values; j++) - { - value = data[datai + j]; -#ifdef HYPRE_COMPLEX - hypre_fprintf(file, "*: (*, *, *; %d) %.14e , %.14e\n", - j, hypre_creal(value), hypre_cimag(value)); -#else - hypre_fprintf(file, "*: (*, *, *; %d) %.14e\n", j, value); -#endif - } - - data += num_values; - } - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - * hypre_ReadBoxArrayData (for non-constant coefficients) - * - * Note: data array is expected to live on the host memory. - *--------------------------------------------------------------------------*/ - -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_Box *box; - hypre_Box *data_box; - - HYPRE_Int data_box_volume; - - hypre_Index loop_size; - hypre_IndexRef start; - hypre_Index stride; - - HYPRE_Int i, j, d, idummy; + HYPRE_Int i, j, vi, d, idummy; /* Read data on the host */ + hypre_fscanf(file, "%d\n", &num_values); hypre_SetIndex(stride, 1); + value_ids = hypre_TAlloc(HYPRE_Int, num_values, HYPRE_MEMORY_HOST); + values = hypre_TAlloc(HYPRE_Complex, + num_values * hypre_BoxArrayVolume(box_array), + HYPRE_MEMORY_HOST); + vi = 0; hypre_ForBoxI(i, box_array) { - box = hypre_BoxArrayBox(box_array, i); - data_box = hypre_BoxArrayBox(data_space, i); - + box = hypre_BoxArrayBox(box_array, i); start = hypre_BoxIMin(box); - data_box_volume = hypre_BoxVolume(data_box); - hypre_BoxGetSize(box, loop_size); - - hypre_SerialBoxLoop1Begin(dim, loop_size, - data_box, start, stride, datai); + hypre_SerialBoxLoop1Begin(ndim, loop_size, + box, start, stride, bi); { /* Read lines of the form: "%d: (%d, %d, %d; %d) %le\n" */ for (j = 0; j < num_values; j++) { hypre_fscanf(file, "%d: (%d", &idummy, &idummy); - for (d = 1; d < dim; d++) + for (d = 1; d < ndim; d++) { hypre_fscanf(file, ", %d", &idummy); } - hypre_fscanf(file, "; %d) %le\n", - &idummy, &data[datai + j * data_box_volume]); +#ifdef HYPRE_COMPLEX + hypre_fscanf(file, "; %d) %le , %le\n", &value_ids[j], &rvalue, &ivalue); + value = rvalue + I * ivalue; +#else + hypre_fscanf(file, "; %d) %le\n", &value_ids[j], &value); +#endif + values[vi + num_values * bi + j] = value; } } - hypre_SerialBoxLoop1End(datai); + hypre_SerialBoxLoop1End(bi); - data += num_values * data_box_volume; + vi += num_values * hypre_BoxVolume(box); } - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - * hypre_ReadBoxArrayData_CC (for when there are some constant coefficients) - * - * Note: data array is expected to live on the host memory. - *--------------------------------------------------------------------------*/ - -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_Box *box; - hypre_Box *data_box; - - HYPRE_Int data_box_volume; - HYPRE_Int constant_stencil_size; - - hypre_Index loop_size; - hypre_IndexRef start; - hypre_Index stride; - - HYPRE_Int i, j, d, idummy; - - /*---------------------------------------- - * Read data - *----------------------------------------*/ - - switch (constant_coefficient) - { - case 1: - constant_stencil_size = stencil_size; - break; - - case 2: - constant_stencil_size = stencil_size - 1; - break; - - default: - constant_stencil_size = 0; - break; - } - - hypre_SetIndex(stride, 1); - hypre_ForBoxI(i, box_array) - { - box = hypre_BoxArrayBox(box_array, i); - data_box = hypre_BoxArrayBox(data_space, i); - - start = hypre_BoxIMin(box); - data_box_volume = hypre_BoxVolume(data_box); - - hypre_BoxGetSize(box, loop_size); - - /* First entries will be the constant part of the matrix. - There is one entry for each constant stencil element, - excluding ones which are redundant due to symmetry.*/ - for (j = 0; j < constant_stencil_size; j++) - { - hypre_fscanf(file, "*: (*, *, *; %d) %le\n", &idummy, &data[j]); - } - - /* Next entries, if any, will be for a variable diagonal: */ - data += real_stencil_size; - - if (constant_coefficient == 2) - { - hypre_SerialBoxLoop1Begin(dim, loop_size, - data_box, start, stride, datai); - { - /* Read line of the form: "%d: (%d, %d, %d; %d) %.14e\n" */ - hypre_fscanf(file, "%d: (%d", &idummy, &idummy); - for (d = 1; d < dim; d++) - { - hypre_fscanf(file, ", %d", &idummy); - } - hypre_fscanf(file, "; %d) %le\n", &idummy, &data[datai]); - } - hypre_SerialBoxLoop1End(datai); - data += data_box_volume; - } - } + *num_values_ptr = num_values; + *value_ids_ptr = value_ids; + *values_ptr = values; return hypre_error_flag; } diff --git a/src/struct_mv/struct_matmult.c b/src/struct_mv/struct_matmult.c new file mode 100644 index 0000000000..c4130f451f --- /dev/null +++ b/src/struct_mv/struct_matmult.c @@ -0,0 +1,2006 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/****************************************************************************** + * + * Structured matrix-matrix multiply functions + * + *****************************************************************************/ + +#include "_hypre_struct_mv.h" +#include "_hypre_struct_mv.hpp" + +/*-------------------------------------------------------------------------- + * StructMatmult functions + * + * These functions compute a collection of matrix products (only up to 3 matrix + * terms are currently allowed in the product). + * + * The function SetKernelType() allows for selecting the kernel used for + * computing struct matrix-matrix multiplication (standard or fused). + * Each matrix product is specified by a call to the SetProduct() function. + * This provides additional context for optimizations (e.g., reducing + * communication overhead) in the subsequent functions, Initialize(), + * Communicate(), and Compute(). The low level API is as follows, where each + * function is called only once, except for SetProduct() and Compute(): + * + * MatmultCreate() + * MatmultSetKernelType() // (Optional) set matmult kernel type + * MatmultSetProduct() // call to specify each matrix product + * MatmultInitialize() // compute all matrix product shells (no data required) + * MatmultCommSetup() // setup all communication (optional, requires data) + * MatmultCommunicate() // communicate all ghost layer data + * MatmultCompute() // call to finish each matrix product + * MatmultDestroy() + * + * Higher level API for computing just one matrix product: + * + * MatmultSetup() // returns a matrix shell with no data allocated + * MatmultMultiply() // allocates data and completes the multiply + * + * Highest level API for computing just one matrix product: + * + * Matmult() + * + * For convenience, there are several other high level routines for computing + * just one matrix product: Matmat(), MatrixPtAP(), MatrixRAP(), MatrixRTtAP(). + * These are similar to Matmult() with a separate Setup() call that can be used + * in combination with MatmultMultiply(). For example, the following is the + * same as calling MatrixPtAP(): + * + * MatrixPtAPSetup() + * MatmultMultiply() + * + *--------------------------------------------------------------------------*/ + +/*-------------------------------------------------------------------------- + * General notes: + * + * The code uses the StMatrix routines to determine if the operation is + * allowable and to compute the stencil and stencil formulas for M. + * + * All of the matrices must be defined on a common base grid (fine index space), + * and each matrix must have a unitary stride for either its domain or range (or + * both). RDF: Need to remove the latter requirement. Think of P*C for + * example, where P is interpolation and C is a square matrix on the coarse + * grid. Another approach (maybe the most flexible) is to temporarily modify + * the matrices in this routine so that they have a common fine index space. + * This will require mapping the matrix strides, the grid extents, and the + * stencil offsets. This latter idea is the same as Rebase() for vectors. + * + * This routines assume there are only two data-map strides in the product. + * This means that at least two matrices can always be multiplied together + * (assuming it is a valid stencil matrix multiply), hence longer products can + * be broken up into smaller components (the latter is not yet implemented). + * The fine and coarse data-map strides are denoted by fstride and cstride. + * Note that both fstride and cstride are given on the same base index space and + * may be equal. The range and domain strides for M are denoted by ran_stride + * and dom_stride and are also given on the base index space. The grid for M is + * coarsened by factor coarsen_stride, which is the smaller of ran_stride and + * dom_stride. The computation for each stencil coefficient of M happens on the + * base index space with stride loop_stride, which is the larger of ran_stride + * and dom_stride. Since we require that either ran_stride or dom_stride is + * larger than all other matrix strides in the product (this is how we guarantee + * that M has only one stencil), and since the data-map stride for a matrix is + * currently the largest of its two strides, then we have loop_stride = cstride. + * In general, the data strides for the boxloop below are as follows: + * + * Mdstride = stride 1 + * cdstride = loop_stride / cstride (= stride 1) + * fdstride = loop_stride / fstride + * + * Here are some examples: + * + * fstride = 2, cstride = 6 + * ran_stride = 6, dom_stride = 6, coarsen_stride = 6, loop_stride = 6 + * Mdstride = 1, cdstride = 1, fdstride = 3 + * + * 6 6 6 2 2 2 2 6 <-- domain/range strides + * | | | | | | | | + * | M | = | R | | A | | P | + * | | | | | | | | + * | | | | + * | | | | + * | | | | + * + * fstride = 2, cstride = 6 + * ran_stride = 2, dom_stride = 6, coarsen_stride = 2, loop_stride = 6 + * Mdstride = 1, cdstride = 1, fdstride = 3 + * + * 2 6 2 6 6 6 + * | | | | | | + * | M | = | A | | B | + * | | | | | | + * | | | | + * | | | | + * | | | | + * + * fstride = 4, cstride = 8 + * ran_stride = 8, dom_stride = 2, coarsen_stride = 2, loop_stride = 8 + * Mdstride = 1, cdstride = 1, fdstride = 2 + * + * 8 2 8 4 4 2 + * | M | = | A | | | + * | B | + * | | + * + * The kernel computations are constructed from the stencil formulas for M. + * Each stencil coefficient for M is a sum of products of stencil coefficients, + * where each product has nterms terms (nterms is the number of matrices in the + * matrix product). For example, a stencil entry of M = A*B*C has the form + * + * m = a1*b1*c1 + a2*b2*c2 + a3*b3*c3 + ... + * + * where aj is a stencil entry of A with a grid shift (similarly for bj and cj). + * Each term in each product may be a constant or variable coefficient, and it + * may live on the fine or coarse data space. To handle this, the kernel is + * currently constructed from a product of nterms + 1 numbers. The leading + * number is a constant-coefficient contribution and the remaining nterms + * numbers are either stencil coefficients or a mask coefficient. The mask is a + * vector of ones and zeros that compensates for the fact that constant stencil + * entries that reach outside of the boundary should be zero. For example, + * considering M = A*B*C as above, we may have a term of the form + * + * a * b * c = (const,coarse) * (const,fine) * (variable,coarse) + * + * The corresponding kernel term might be set up as (note the reordering) + * + * cprod * t1[ci] * t2[fi] * t3[fi], where + * + * cprod = a*b + * t1[ci] = c (variable,coarse) -> coeff c on coarse data space + * t2[fi] = 0/1 (const,coarse) -> mask for a on fine data space + * t3[fi] = 0/1 (const,fine) -> mask for b on fine data space + * + * Note that the mask is on the fine data space. Although it may be possible to + * have masks for the fine and coarse data spaces, it's probably not useful. + * Consider, for example, the Galerkin RAP product in multigrid where the + * diagonal entry of P and R have constant value 1. We can have a coarse mask + * for P because its domain is coarse, but R would require a fine mask, which + * involves more memory than currently. + *--------------------------------------------------------------------------*/ + +/*-------------------------------------------------------------------------- + * Creates the initial data structure for the matmult collection. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultCreate( HYPRE_Int max_matmults, + HYPRE_Int max_matrices, + hypre_StructMatmultData **mmdata_ptr ) +{ + hypre_StructMatmultData *mmdata; + + /* Allocate data structure */ + mmdata = hypre_CTAlloc(hypre_StructMatmultData, 1, HYPRE_MEMORY_HOST); + + /* Initialize data members */ + (mmdata -> matmults) = hypre_CTAlloc(hypre_StructMatmultDataM, + max_matmults, + HYPRE_MEMORY_HOST); + (mmdata -> matrices) = hypre_CTAlloc(hypre_StructMatrix *, + max_matrices, + HYPRE_MEMORY_HOST); + (mmdata -> nmatmults) = 0; + (mmdata -> nmatrices) = 0; + (mmdata -> mtypes) = NULL; + (mmdata -> fstride) = NULL; + (mmdata -> cstride) = NULL; + (mmdata -> coarsen_stride) = NULL; + (mmdata -> coarsen) = 0; + (mmdata -> fdata_space) = NULL; + (mmdata -> cdata_space) = NULL; + (mmdata -> mask) = NULL; + (mmdata -> comm_pkg) = NULL; + (mmdata -> comm_data) = NULL; + (mmdata -> comm_stencils) = NULL; +#if defined (HYPRE_USING_GPU) + if (hypre_HandleDefaultExecPolicy(hypre_handle()) == HYPRE_EXEC_DEVICE) + { + (mmdata -> kernel_type) = 1; + } + else +#endif + { + (mmdata -> kernel_type) = 0; + } + + *mmdata_ptr = mmdata; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultDestroy( hypre_StructMatmultData *mmdata ) +{ + hypre_StructMatmultDataM *Mdata; + HYPRE_Int iM, m; + if (mmdata) + { + for (iM = 0; iM < (mmdata -> nmatmults); iM++) + { + Mdata = &(mmdata -> matmults[iM]); + hypre_TFree(Mdata -> terms, HYPRE_MEMORY_HOST); + hypre_TFree(Mdata -> transposes, HYPRE_MEMORY_HOST); + hypre_StructMatrixDestroy(Mdata -> M); + hypre_StMatrixDestroy(Mdata -> st_M); + hypre_TFree(Mdata -> c, HYPRE_MEMORY_HOST); + hypre_TFree(Mdata -> a, HYPRE_MEMORY_HOST); + } + hypre_TFree(mmdata -> matmults, HYPRE_MEMORY_HOST); + /* Restore the matrices */ + // RDF TODO: Add MemoryMode to Resize() then put this back in + // for (m = 0; m < (mmdata -> nmatrices); m++) + // { + // hypre_StructMatrixRestore(mmdata -> matrices[m]); + // } + if ((mmdata -> comm_stencils) != NULL) + { + for (m = 0; m < (mmdata -> nmatrices) + 1; m++) + { + hypre_CommStencilDestroy(mmdata -> comm_stencils[m]); + } + hypre_TFree(mmdata -> comm_stencils, HYPRE_MEMORY_HOST); + } + hypre_TFree(mmdata -> matrices, HYPRE_MEMORY_HOST); + hypre_TFree(mmdata -> mtypes, HYPRE_MEMORY_HOST); + + hypre_BoxArrayDestroy(mmdata -> fdata_space); + hypre_BoxArrayDestroy(mmdata -> cdata_space); + hypre_StructVectorDestroy(mmdata -> mask); + + hypre_CommPkgDestroy(mmdata -> comm_pkg); + hypre_TFree(mmdata -> comm_data, HYPRE_MEMORY_HOST); + + hypre_TFree(mmdata, HYPRE_MEMORY_HOST); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Set the kernel type used for computing matrix-matrix multiplications + * + * type = -1: proxy to the default depending on hypre's build type (CPU or GPU) + * type = 0: standard (core) implementation (default for CPUs) + * type = 1: fused implementation involving less BoxLoops (default for GPUs). + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultSetKernelType( hypre_StructMatmultData *mmdata, + HYPRE_Int kernel_type ) +{ + if (kernel_type == -1) + { +#if defined (HYPRE_USING_GPU) + if (hypre_HandleDefaultExecPolicy(hypre_handle()) == HYPRE_EXEC_DEVICE) + { + (mmdata -> kernel_type) = 1; + } + else +#endif + { + (mmdata -> kernel_type) = 0; + } + } + else if (kernel_type == 0 || kernel_type == 1) + { + (mmdata -> kernel_type) = kernel_type; + } + else + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unsupported kernel type!"); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * This routine is called successively for each matmult in the collection. + * + * Computes various information related to a specific matmult in the collection, + * creates an initial product matrix M, and returns an ID for M (iM). + * + * Each matmult has 'nterms' terms constructed from matrices in the 'matrices' + * array. Each term t is given by the matrix matrices[terms[t]] transposed + * according to the boolean transposes[t]. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultSetProduct( hypre_StructMatmultData *mmdata, + HYPRE_Int nmatrices_in, + hypre_StructMatrix **matrices_in, + HYPRE_Int nterms, + HYPRE_Int *terms_in, + HYPRE_Int *transposes_in, + HYPRE_Int *iM_ptr ) +{ + HYPRE_Int iM = (mmdata -> nmatmults); /* index for matmult */ + hypre_StructMatmultDataM *Mdata = &(mmdata -> matmults[iM]); + HYPRE_Int nmatrices = (mmdata -> nmatrices); + hypre_StructMatrix **matrices = (mmdata -> matrices); + hypre_IndexRef coarsen_stride; + HYPRE_Int coarsen; + + HYPRE_Int *terms; + HYPRE_Int *transposes; + hypre_StructMatrix *M; + hypre_StMatrix *st_M; + HYPRE_Int na; + + HYPRE_Int *matmap; + HYPRE_Int m, t, nu, u, unique, symmetric; + + hypre_StructStencil *Mstencil; + hypre_StructGrid *Mgrid; + hypre_Index Mran_stride, Mdom_stride; + + MPI_Comm comm; + HYPRE_Int ndim, size; + + hypre_StructMatrix *matrix; + hypre_StructStencil *stencil; + hypre_StructGrid *grid; + + hypre_StMatrix **st_matrices, *st_matrix; + hypre_StCoeff *st_coeff; + hypre_StTerm *st_term; + + hypre_IndexRef ran_stride; + hypre_IndexRef dom_stride; + hypre_Index offset; + HYPRE_Int d, i, e; + + HYPRE_ANNOTATE_FUNC_BEGIN; + + /* Update matrices array and create new terms and transposes arrays that only + * consider matrices actually involved in the multiply */ + terms = hypre_CTAlloc(HYPRE_Int, nterms, HYPRE_MEMORY_HOST); + transposes = hypre_CTAlloc(HYPRE_Int, nterms, HYPRE_MEMORY_HOST); + matmap = hypre_CTAlloc(HYPRE_Int, nmatrices_in, HYPRE_MEMORY_HOST); + for (t = 0; t < nterms; t++) + { + m = terms_in[t]; + matmap[m] = 1; + } + for (m = 0; m < nmatrices_in; m++) + { + if (matmap[m]) + { + matmap[m] = nmatrices; + nmatrices++; + } + } + for (t = 0; t < nterms; t++) + { + m = terms_in[t]; + matrices[matmap[m]] = matrices_in[m]; + terms[t] = matmap[m]; + transposes[t] = transposes_in[t]; + } + hypre_TFree(matmap, HYPRE_MEMORY_HOST); + + /* Make sure that each entry in matrices[] is unique */ + nu = (mmdata -> nmatrices); + for (m = nu; m < nmatrices; m++) + { + /* Check matrices[m] against the matrices already marked as unique */ + unique = 1; + for (u = 0; u < nu; u++) + { + if (matrices[m] == matrices[u]) + { + /* Not a unique matrix, so remove from matrices[] and adjust terms[] */ + for (t = 0; t < nterms; t++) + { + if (terms[t] == m) + { + terms[t] = u; + } + } + unique = 0; + break; + } + } + if (unique) + { + /* Unique matrix, so reposition in matrices[] and adjust terms[] */ + matrices[nu] = matrices[m]; + for (t = 0; t < nterms; t++) + { + if (terms[t] == m) + { + terms[t] = nu; + } + } + nu++; + } + } + nmatrices = nu; + + (mmdata -> nmatrices) = nmatrices; + (mmdata -> matrices) = matrices; + (Mdata -> nterms) = nterms; + (Mdata -> terms) = terms; + (Mdata -> transposes) = transposes; + + /* Set comm and ndim */ + matrix = matrices[0]; + comm = hypre_StructMatrixComm(matrix); + ndim = hypre_StructMatrixNDim(matrix); + + /* Create st_matrices from terms and matrices. This may sometimes create the + * same StMatrix more than once, but by doing it this way, we can set the ID + * to be the original term number so that we can tell whether a term in the + * final product corresponds to a transposed matrix (the StMatrixMatmult + * routine currently does not guarantee that terms in the final product will + * be ordered the same as originally). */ + st_matrices = hypre_CTAlloc(hypre_StMatrix *, nterms, HYPRE_MEMORY_HOST); + for (t = 0; t < nterms; t++) + { + m = terms[t]; + matrix = matrices[m]; + stencil = hypre_StructMatrixStencil(matrix); + size = hypre_StructStencilSize(stencil); + hypre_StMatrixCreate(m, size, ndim, &st_matrix); + hypre_CopyToIndex(hypre_StructMatrixRanStride(matrix), ndim, hypre_StMatrixRMap(st_matrix)); + hypre_CopyToIndex(hypre_StructMatrixDomStride(matrix), ndim, hypre_StMatrixDMap(st_matrix)); + for (e = 0; e < size; e++) + { + hypre_CopyToIndex(hypre_StructStencilOffset(stencil, e), ndim, + hypre_StMatrixOffset(st_matrix, e)); + hypre_StCoeffCreate(1, &st_coeff); + st_term = hypre_StCoeffTerm(st_coeff, 0); + hypre_StTermID(st_term) = t; + hypre_StTermEntry(st_term) = e; + hypre_StMatrixCoeff(st_matrix, e) = st_coeff; + } + st_matrices[t] = st_matrix; + } + + /* Multiply st_matrices */ + hypre_StMatrixMatmult(nterms, st_matrices, transposes, nterms, ndim, &st_M); + + /* Free up st_matrices */ + for (t = 0; t < nterms; t++) + { + hypre_StMatrixDestroy(st_matrices[t]); + } + hypre_TFree(st_matrices, HYPRE_MEMORY_HOST); + + /* Determine the coarsening factor for M's grid (the stride for either the + * range or the domain, whichever is smaller) */ + ran_stride = hypre_StMatrixRMap(st_M); + dom_stride = hypre_StMatrixDMap(st_M); + coarsen_stride = ran_stride; + for (d = 0; d < ndim; d++) + { + if (ran_stride[d] > dom_stride[d]) + { + coarsen_stride = dom_stride; + break; + } + } + /* RDF: Check to verify that coarsen_stride is the same for all matrix products? */ + (mmdata -> coarsen_stride) = coarsen_stride; + + /* This flag indicates whether Mgrid will be constructed by + coarsening the grid that belongs to matrices[0] or not */ + coarsen = 0; + for (d = 0; d < ndim; d++) + { + if (coarsen_stride[d] > 1) + { + coarsen = 1; + break; + } + } + (mmdata -> coarsen) = coarsen; + + /* Create Mgrid (the grid for M) */ + grid = hypre_StructMatrixGrid(matrices[0]); /* Same grid for all matrices */ + hypre_CopyToIndex(ran_stride, ndim, Mran_stride); + hypre_CopyToIndex(dom_stride, ndim, Mdom_stride); + if (coarsen) + { + /* Note: Mgrid may have fewer boxes than grid as a result of coarsening */ + hypre_StructCoarsen(grid, NULL, coarsen_stride, 1, &Mgrid); + hypre_MapToCoarseIndex(Mran_stride, NULL, coarsen_stride, ndim); + hypre_MapToCoarseIndex(Mdom_stride, NULL, coarsen_stride, ndim); + } + else + { + hypre_StructGridRef(grid, &Mgrid); + } + + /* Create Mstencil and compute an initial value for 'na' */ + size = hypre_StMatrixSize(st_M); + HYPRE_StructStencilCreate(ndim, size, &Mstencil); + na = 0; + for (e = 0; e < size; e++) + { + hypre_CopyToIndex(hypre_StMatrixOffset(st_M, e), ndim, offset); + if (coarsen) + { + hypre_MapToCoarseIndex(offset, NULL, coarsen_stride, ndim); + } + HYPRE_StructStencilSetEntry(Mstencil, e, offset); + na += hypre_StMatrixNEntryCoeffs(st_M, e); + } + + /* Create the matrix */ + HYPRE_StructMatrixCreate(comm, Mgrid, Mstencil, &M); + HYPRE_StructMatrixSetRangeStride(M, Mran_stride); + HYPRE_StructMatrixSetDomainStride(M, Mdom_stride); +#if 1 /* This should be set through the matmult interface somehow */ + { + HYPRE_Int num_ghost[2 * HYPRE_MAXDIM]; + for (i = 0; i < 2 * HYPRE_MAXDIM; i++) + { + num_ghost[i] = 0; + } + HYPRE_StructMatrixSetNumGhost(M, num_ghost); + } +#endif + + /* Determine if M is symmetric (RDF TODO: think about how to override this */ + symmetric = 1; + for (t = 0; t < ((nterms + 1) / 2); t++) + { + u = nterms - 1 - t; /* term t from the right */ + if (t < u) + { + if ((terms[t] != terms[u]) || (transposes[t] == transposes[u]) ) + { + /* These two matrices are not transposes of each other */ + symmetric = 0; + break; + } + } + else if (t == u) + { + m = terms[t]; + if (!hypre_StructMatrixSymmetric(matrices[m])) + { + /* This middle-term matrix is not symmetric */ + symmetric = 0; + break; + } + } + } + HYPRE_StructMatrixSetSymmetric(M, symmetric); + + /* Destroy Mstencil and Mgrid (they will still exist in matrix M) */ + HYPRE_StructStencilDestroy(Mstencil); + HYPRE_StructGridDestroy(Mgrid); + + (Mdata -> M) = hypre_StructMatrixRef(M); + (Mdata -> st_M) = st_M; + /* Allocate these arrays to be the maximum size possible. This uses twice + * the required memory, but simplifies the code somewhat. The arrays are + * grid independent anyway. */ + (Mdata -> nc) = na; + (Mdata -> c) = hypre_TAlloc(hypre_StructMatmultDataMH, na, HYPRE_MEMORY_HOST); + (Mdata -> na) = na; + (Mdata -> a) = hypre_TAlloc(hypre_StructMatmultDataMH, na, HYPRE_MEMORY_HOST); + + (mmdata -> nmatmults) ++; + + *iM_ptr = iM; + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * This routine is called once for the entire matmult collection. + * + * Computes additional information needed to do the matmults in the collection, + * including data spaces and communication packages. It resizes all of the + * matrices involved in the matmults and creates fully initialized shells for + * the product matrices M (no data allocated yet). + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultInitialize( hypre_StructMatmultData *mmdata, + HYPRE_Int assemble_grid ) +{ + HYPRE_Int nmatmults = (mmdata -> nmatmults); + HYPRE_Int nmatrices = (mmdata -> nmatrices); + hypre_StructMatrix **matrices = (mmdata -> matrices); + HYPRE_Int *mtypes = (mmdata -> mtypes); + HYPRE_Int coarsen = (mmdata -> coarsen); + hypre_IndexRef fstride; + hypre_IndexRef cstride; + hypre_BoxArray *fdata_space; + hypre_BoxArray *cdata_space; + hypre_StructVector *mask; + + HYPRE_Int nterms; + HYPRE_Int *terms; + HYPRE_Int *transposes; + hypre_StructMatrix *M; + hypre_StMatrix *st_M; + HYPRE_Int nconst; + HYPRE_Int *const_entries; + HYPRE_Int nc, na; + hypre_StructMatmultDataMH *c, *a; + + hypre_StructMatmultDataM *Mdata; + hypre_StructGrid *Mgrid; + + MPI_Comm comm; + HYPRE_Int ndim, size; + + hypre_StructMatrix *matrix; + hypre_StructStencil *stencil; + hypre_StructGrid *grid; + hypre_IndexRef stride; + HYPRE_Int nboxes; + HYPRE_Int *boxnums; + hypre_Box *box; + HYPRE_Int *symm; + + hypre_StCoeff *st_coeff; + hypre_StTerm *st_term; + + HYPRE_Int const_entry; /* boolean used to determine constant entries in M */ + + hypre_CommStencil **comm_stencils; + + HYPRE_Int need_mask; /* boolean indicating if a mask is needed */ + HYPRE_Int const_term, var_term; /* booleans used to determine 'need_mask' */ + HYPRE_Int all_const; /* boolean indicating all constant matmults */ + + HYPRE_Complex *maskptr; /* pointer to mask data */ + hypre_Index offset; /* CommStencil offset */ + hypre_IndexRef shift; /* stencil shift from center for st_term */ + hypre_IndexRef offsetref; + HYPRE_Int iM, d, i, j, m, t, e, b, id, entry; + + hypre_Box *loop_box; /* boxloop extents on the base index space */ + hypre_IndexRef loop_start; /* boxloop start index on the base index space */ + hypre_IndexRef loop_stride; /* boxloop stride on the base index space */ + hypre_Index loop_size; /* boxloop size */ + hypre_Index fdstart; /* boxloop data starts */ + hypre_Index fdstride; /* boxloop data strides */ + hypre_Box *fdbox; /* boxloop data boxes */ + + hypre_BoxArray **data_spaces; + hypre_BoxArray *data_space; + + HYPRE_ANNOTATE_FUNC_BEGIN; + + comm = hypre_StructMatrixComm(matrices[0]); + ndim = hypre_StructMatrixNDim(matrices[0]); + grid = hypre_StructMatrixGrid(matrices[0]); /* Same grid for all matrices */ + + /* Compute fstride and cstride (assumes only two data-map strides) */ + hypre_StructMatrixGetDataMapStride(matrices[0], &fstride); + cstride = fstride; + for (m = 1; m < nmatrices; m++) + { + hypre_StructMatrixGetDataMapStride(matrices[m], &stride); + for (d = 0; d < ndim; d++) + { + if (stride[d] > fstride[d]) + { + cstride = stride; + break; + } + else if (stride[d] < cstride[d]) + { + fstride = stride; + break; + } + } + } + (mmdata -> fstride) = fstride; + (mmdata -> cstride) = cstride; + + /* Compute mtypes (assumes only two data-map strides) */ + mtypes = hypre_CTAlloc(HYPRE_Int, nmatrices + 1, HYPRE_MEMORY_HOST); + for (m = 0; m < nmatrices; m++) + { + hypre_StructMatrixGetDataMapStride(matrices[m], &stride); + for (d = 0; d < ndim; d++) + { + if (stride[d] > fstride[d]) + { + mtypes[m] = 1; /* coarse data space (initially set to fine) */ + break; + } + } + } + (mmdata -> mtypes) = mtypes; + + /* Use st_M to compute information needed to build the matrices. + * + * This splits the computation into constant and variable computations as + * indicated by 'na' and 'nconst'. Variable computations are stored in 'a' + * and further split into constant and variable subcomponents, with constant + * contributions stored in 'a[i].cprod'. Communication stencils are also + * computed for each matrix (not each term, so matrices that appear in more + * than one term in the product are dealt with only once). Communication + * stencils are then used to determine new data spaces for resizing the + * matrices. Since we assume there are at most two data-map strides, only + * two data spaces are computed, one fine and one coarse. This simplifies + * the boxloops in Compute() and allows us to use a BoxLoop3. We add an + * extra entry to the end of 'comm_stencils' and 'data_spaces' for the mask, + * in case a mask is needed. */ + + /* Assemble the matmult grids. Assume they are all the same. */ + if (coarsen) + { + Mdata = &(mmdata -> matmults[0]); + M = (Mdata -> M); + Mgrid = hypre_StructMatrixGrid(M); + if (assemble_grid) /* RDF: Do we need this flag anymore? */ + { + /* Assemble the grid. Note: StructGridGlobalSize is updated to zero so that + * its computation is triggered in hypre_StructGridAssemble */ + hypre_StructGridGlobalSize(Mgrid) = 0; + hypre_StructGridAssemble(Mgrid); + } + for (iM = 1; iM < nmatmults; iM++) + { + Mdata = &(mmdata -> matmults[iM]); + M = (Mdata -> M); + hypre_StructGridDestroy(hypre_StructMatrixGrid(M)); + hypre_StructGridRef(Mgrid, &hypre_StructMatrixGrid(M)); + } + } + + /* Allocate memory for communication stencils */ + comm_stencils = hypre_TAlloc(hypre_CommStencil *, nmatrices + 1, HYPRE_MEMORY_HOST); + for (m = 0; m < nmatrices + 1; m++) + { + comm_stencils[m] = hypre_CommStencilCreate(ndim); + } + + /* Compute communication stencils, identify the constant entries, and + * determine if a mask is needed */ + need_mask = 0; + all_const = 1; + for (iM = 0; iM < nmatmults; iM++) + { + Mdata = &(mmdata -> matmults[iM]); + nterms = (Mdata -> nterms); + terms = (Mdata -> terms); + transposes = (Mdata -> transposes); + M = (Mdata -> M); + st_M = (Mdata -> st_M); + c = (Mdata -> c); + a = (Mdata -> a); + + size = hypre_StMatrixSize(st_M); + const_entries = hypre_TAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); + + nc = 0; + na = 0; + nconst = 0; + for (e = 0; e < size; e++) /* Loop over each stencil coefficient in st_M */ + { + i = 0; + const_entry = 1; + st_coeff = hypre_StMatrixCoeff(st_M, e); + while (st_coeff != NULL) + { + a[na + i].cprod = 1.0; + const_term = 0; /* Is there a constant term that requires a mask? */ + var_term = 0; /* Is there a variable term? */ + for (t = 0; t < nterms; t++) + { + st_term = hypre_StCoeffTerm(st_coeff, t); + a[na + i].terms[t] = *st_term; /* Copy st_term info into terms */ + st_term = &(a[na + i].terms[t]); + id = hypre_StTermID(st_term); + entry = hypre_StTermEntry(st_term); + shift = hypre_StTermShift(st_term); + m = terms[id]; + matrix = matrices[m]; + a[na + i].types[t] = mtypes[m]; + + hypre_CopyToIndex(shift, ndim, offset); + if (hypre_StructMatrixConstEntry(matrix, entry)) + { + /*** Constant term (type 2 or 3) ***/ + + stencil = hypre_StructMatrixStencil(matrix); + offsetref = hypre_StructStencilOffset(stencil, entry); + if ( hypre_IndexEqual(offsetref, 0, ndim) ) + { + /* This constant term DOES NOT require a mask. Since the + * stencil offset is zero, it can't reach cross a boundary. + * If its shift puts it outside the boundary, another term + * must either be variable or constant-with-a-mask, and it + * will ensure the product is zero. */ + a[na + i].types[t] = 3; + } + else + { + /* This constant term DOES require a mask */ + a[na + i].types[t] = 2; + /* If this is not a transpose coefficient, adjust offset */ + if (!transposes[id]) + { + hypre_AddIndexes(offset, offsetref, ndim, offset); + } + /* Update comm_stencil for the mask */ + hypre_CommStencilSetEntry(comm_stencils[nmatrices], offset); + + const_term = 1; /* This is a constant term that requires a mask */ + } + } + else + { + /*** Variable term (type 0 or 1) ***/ + + /* If this is not a stored symmetric coefficient, adjust offset */ + symm = hypre_StructMatrixSymmEntries(matrix); + if (!(symm[entry] < 0)) + { + stencil = hypre_StructMatrixStencil(matrix); + offsetref = hypre_StructStencilOffset(stencil, entry); + hypre_AddIndexes(offset, offsetref, ndim, offset); + } + /* Update comm_stencil for matrix m */ + hypre_CommStencilSetEntry(comm_stencils[m], offset); + + var_term = 1; /* This is a variable term */ + const_entry = 0; /* This can't be a constant entry of M */ + all_const = 0; /* This can't be an all-constant matrix M */ + } + } + + if (const_term && var_term) + { + need_mask = 1; + } + a[na + i].mentry = e; + + /* Visit next coeffcient */ + st_coeff = hypre_StCoeffNext(st_coeff); + i++; + } + + /* Keep track of constant stencil entries and values in M */ + if (const_entry) + { + const_entries[nconst] = e; + nconst++; + + /* This is a constant stencil entry for M: copy a entries into c */ + for (j = 0; j < i; j++) + { + c[nc + j] = a[na + j]; + } + nc += i; + } + else + { + /* This is a variable stencil entry for M: copy a entries as is */ + na += i; + } + } + + HYPRE_StructMatrixSetConstantEntries(M, nconst, const_entries); + hypre_StructMatrixInitializeShell(M); /* Data is initialized in Compute()*/ + + /* The above InitializeShell(M) call builds the symmetric entries + * information. Here, we re-arrange the c-array and a-array so only the + * stored symmetric entries are computed. */ + if (hypre_StructMatrixSymmetric(M)) + { + symm = hypre_StructMatrixSymmEntries(M); + + /* Update c-array */ + j = 0; + for (i = 0; i < nc; i++) + { + /* If this is a stored symmetric coefficient, keep the c-array entry */ + e = c[i].mentry; + if (symm[e] < 0) + { + c[j] = c[i]; + j++; + } + } + nc = j; + + /* Update a-array */ + j = 0; + for (i = 0; i < na; i++) + { + /* If this is a stored symmetric coefficient, keep the a-array entry */ + e = a[i].mentry; + if (symm[e] < 0) + { + a[j] = a[i]; + j++; + } + } + na = j; + } + + hypre_TFree(const_entries, HYPRE_MEMORY_HOST); + (Mdata -> nc) = nc; /* Update nc */ + (Mdata -> na) = na; /* Update na */ + + } /* end (iM < nmatmults) loop */ + + /* If all constant coefficients or no boxes in grid, return since no + * communication is needed and there is no variable data to compute */ + if (all_const || (hypre_StructGridNumBoxes(grid) == 0)) + { + /* Free up memory */ + for (m = 0; m < nmatrices + 1; m++) + { + hypre_CommStencilDestroy(comm_stencils[m]); + } + hypre_TFree(comm_stencils, HYPRE_MEMORY_HOST); + + /* Set na = 0 to skip out of Compute() more quickly */ + for (iM = 0; iM < nmatmults; iM++) + { + Mdata = &(mmdata -> matmults[iM]); + (Mdata -> na) = 0; + } + + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; + } + + (mmdata -> comm_stencils) = comm_stencils; + + /* Create a mask that stands in for each constant-valued matrix term to + * prevent incorrect contributions in the matrix product. The mask is a + * vector of ones and zeros and an updated ghost layer to account for + * parallelism and periodic boundary conditions. */ + + loop_box = hypre_BoxCreate(ndim); + + /* Compute initial data spaces for each matrix */ + data_spaces = hypre_CTAlloc(hypre_BoxArray *, nmatrices + 1, HYPRE_MEMORY_HOST); + for (m = 0; m < nmatrices; m++) + { + HYPRE_Int *num_ghost; + + matrix = matrices[m]; + + /* If matrix is all constant, num_ghost will be all zero */ + hypre_CommStencilCreateNumGhost(comm_stencils[m], &num_ghost); + hypre_StructMatrixGrowDataSpace(matrix, num_ghost, &data_spaces[m]); + //hypre_StructMatrixComputeDataSpace(matrix, num_ghost, &data_spaces[m]); + hypre_TFree(num_ghost, HYPRE_MEMORY_HOST); + } + + /* Compute initial mask data space */ + if (need_mask) + { + HYPRE_Int *num_ghost; + + HYPRE_StructVectorCreate(comm, grid, &mask); + HYPRE_StructVectorSetStride(mask, fstride); /* same stride as fine data-map stride */ + hypre_CommStencilCreateNumGhost(comm_stencils[nmatrices], &num_ghost); + hypre_StructVectorComputeDataSpace(mask, NULL, num_ghost, &data_spaces[nmatrices]); + hypre_TFree(num_ghost, HYPRE_MEMORY_HOST); + (mmdata -> mask) = mask; + } + + /* Compute fine and coarse data spaces */ + fdata_space = NULL; + cdata_space = NULL; + for (m = 0; m < nmatrices + 1; m++) + { + data_space = data_spaces[m]; + if (data_space != NULL) /* This can be NULL when there is no mask */ + { + switch (mtypes[m]) + { + case 0: /* fine data space */ + if (fdata_space == NULL) + { + fdata_space = data_space; + } + else + { + hypre_ForBoxI(b, fdata_space) + { + hypre_BoxGrowByBox(hypre_BoxArrayBox(fdata_space, b), + hypre_BoxArrayBox(data_space, b)); + } + hypre_BoxArrayDestroy(data_space); + } + break; + + case 1: /* coarse data space */ + if (cdata_space == NULL) + { + cdata_space = data_space; + } + else + { + hypre_ForBoxI(b, cdata_space) + { + hypre_BoxGrowByBox(hypre_BoxArrayBox(cdata_space, b), + hypre_BoxArrayBox(data_space, b)); + } + hypre_BoxArrayDestroy(data_space); + } + break; + } + } + } + (mmdata -> cdata_space) = cdata_space; + (mmdata -> fdata_space) = fdata_space; + + /* Resize the matrix data spaces */ + for (m = 0; m < nmatrices; m++) + { + switch (mtypes[m]) + { + case 0: /* fine data space */ + data_spaces[m] = hypre_BoxArrayClone(fdata_space); + break; + + case 1: /* coarse data space */ + data_spaces[m] = hypre_BoxArrayClone(cdata_space); + break; + } + if ( hypre_StructMatrixNeedResize(matrices[m], data_spaces[m]) ) + { + hypre_StructMatrixResize(matrices[m], data_spaces[m]); + hypre_StructMatrixForget(matrices[m]); // RDF: Add MemoryMode() to Resize() then remove this + } + else + { + hypre_BoxArrayDestroy(data_spaces[m]); + } + } + + /* Resize the mask data space and initialize */ + /* NOTE: We originally used a bit mask, but it's not needed. A bit mask may + * be a way to manage different variable types in pmatrices, but we require a + * common base grid with the current code. The Engwer trick gets around this + * issue so it's probably better to wait and continue to put inter-variable + * couplings in the unstructured matrix until then. */ + if (need_mask) + { + data_spaces[nmatrices] = hypre_BoxArrayClone(fdata_space); + hypre_StructVectorResize(mask, data_spaces[nmatrices]); + hypre_StructVectorInitialize(mask, 1); + + nboxes = hypre_StructVectorNBoxes(mask); + boxnums = hypre_StructVectorBoxnums(mask); + stride = hypre_StructVectorStride(mask); + + loop_stride = stride; + hypre_CopyToIndex(loop_stride, ndim, fdstride); + hypre_StructVectorMapDataStride(mask, fdstride); + for (j = 0; j < nboxes; j++) + { + b = boxnums[j]; + + box = hypre_StructGridBox(grid, b); + hypre_CopyBox(box, loop_box); + hypre_ProjectBox(loop_box, NULL, loop_stride); + loop_start = hypre_BoxIMin(loop_box); + hypre_BoxGetStrideSize(loop_box, loop_stride, loop_size); + + fdbox = hypre_BoxArrayBox(fdata_space, b); + hypre_CopyToIndex(loop_start, ndim, fdstart); + hypre_StructVectorMapDataIndex(mask, fdstart); + + maskptr = hypre_StructVectorBoxData(mask, b); + +#define DEVICE_VAR is_device_ptr(maskptr) + hypre_BoxLoop1Begin(ndim, loop_size, + fdbox, fdstart, fdstride, fi); + { + maskptr[fi] = 1.0; + } + hypre_BoxLoop1End(fi); +#undef DEVICE_VAR + } + } + + /* Free memory */ + hypre_BoxDestroy(loop_box); + hypre_TFree(data_spaces, HYPRE_MEMORY_HOST); + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * These routines are called once for the entire matmult collection. + * + * Communicates matrix and mask boundary data with a single comm_pkg. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultCommSetup( hypre_StructMatmultData *mmdata ) +{ + HYPRE_Int nmatrices = (mmdata -> nmatrices); + hypre_StructMatrix **matrices = (mmdata -> matrices); + hypre_IndexRef fstride = (mmdata -> fstride); + hypre_StructVector *mask = (mmdata -> mask); + hypre_CommPkg *comm_pkg = (mmdata -> comm_pkg); + HYPRE_Complex **comm_data = (mmdata -> comm_data); + hypre_CommStencil **comm_stencils = (mmdata -> comm_stencils); + + hypre_CommPkg **comm_pkg_a; + HYPRE_Complex ***comm_data_a; + HYPRE_Int num_comm_pkgs; + HYPRE_Int num_comm_blocks; + hypre_CommInfo *comm_info; + + hypre_StructMatrix *matrix; + hypre_StructGrid *grid; + HYPRE_Int m; + + /* If no communication, return */ + if (!comm_stencils) + { + return hypre_error_flag; + } + + HYPRE_ANNOTATE_FUNC_BEGIN; + + /* If it doesn't already exist, setup agglomerated communication package for + * matrices and mask ghost layers */ + if (!comm_pkg) + { + grid = hypre_StructMatrixGrid(matrices[0]); /* Same grid for all matrices */ + + comm_pkg_a = hypre_TAlloc(hypre_CommPkg *, nmatrices + 1, HYPRE_MEMORY_HOST); + comm_data_a = hypre_TAlloc(HYPRE_Complex **, nmatrices + 1, HYPRE_MEMORY_HOST); + + /* Initialize number of packages and blocks */ + num_comm_pkgs = num_comm_blocks = 0; + + /* Compute matrix communications */ + for (m = 0; m < nmatrices; m++) + { + matrix = matrices[m]; + + if (hypre_StructMatrixNumValues(matrix) > 0) + { + hypre_CreateCommInfo(grid, fstride, comm_stencils[m], &comm_info); + hypre_StructMatrixCreateCommPkg(matrix, comm_info, &comm_pkg_a[num_comm_pkgs], + &comm_data_a[num_comm_pkgs]); + num_comm_blocks += hypre_CommPkgNumBlocks(comm_pkg_a[num_comm_pkgs]); + num_comm_pkgs++; + } + } + + /* Compute mask communications */ + if (mask != NULL) + { + hypre_CreateCommInfo(grid, fstride, comm_stencils[nmatrices], &comm_info); + hypre_StructVectorMapCommInfo(mask, comm_info); + hypre_CommPkgCreate(comm_info, + hypre_StructVectorDataSpace(mask), + hypre_StructVectorDataSpace(mask), 1, NULL, 0, + hypre_StructVectorComm(mask), + hypre_StructVectorMemoryLocation(mask), + &comm_pkg_a[num_comm_pkgs]); + hypre_CommInfoDestroy(comm_info); + comm_data_a[num_comm_pkgs] = hypre_TAlloc(HYPRE_Complex *, 1, HYPRE_MEMORY_HOST); + comm_data_a[num_comm_pkgs][0] = hypre_StructVectorData(mask); + num_comm_blocks++; + num_comm_pkgs++; + } + + if (num_comm_pkgs > 0) + { + hypre_CommPkgAgglomerate(num_comm_pkgs, comm_pkg_a, &comm_pkg); + hypre_CommPkgAgglomData(num_comm_pkgs, comm_pkg_a, comm_data_a, comm_pkg, &comm_data); + hypre_CommPkgAgglomDestroy(num_comm_pkgs, comm_pkg_a, comm_data_a); + (mmdata -> comm_pkg) = comm_pkg; + (mmdata -> comm_data) = comm_data; + } + } + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultCommunicate( hypre_StructMatmultData *mmdata ) +{ + hypre_CommPkg *comm_pkg; + HYPRE_Complex **comm_data; + hypre_CommHandle *comm_handle; + + HYPRE_ANNOTATE_FUNC_BEGIN; + + hypre_StructMatmultCommSetup(mmdata); + + comm_pkg = (mmdata -> comm_pkg); + comm_data = (mmdata -> comm_data); + if (comm_pkg) + { + hypre_StructCommunicationInitialize(comm_pkg, comm_data, comm_data, 0, 0, &comm_handle); + hypre_StructCommunicationFinalize(comm_handle); + } + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * This routine is called successively for each matmult in the collection. + * + * Computes the coefficients for matmult M, indicated by ID iM. Data for M is + * allocated here, but M is not assembled (RDF: Why? We probably should.). + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultCompute( hypre_StructMatmultData *mmdata, + HYPRE_Int iM ) +{ + hypre_StructMatmultDataM *Mdata = &(mmdata -> matmults[iM]); + hypre_StructMatrix **matrices = (mmdata -> matrices); + HYPRE_Int nmatrices = (mmdata -> nmatrices); + HYPRE_Int kernel_type = (mmdata -> kernel_type); + hypre_IndexRef coarsen_stride = (mmdata -> coarsen_stride); + hypre_IndexRef fstride = (mmdata -> fstride); + hypre_IndexRef cstride = (mmdata -> cstride); + hypre_BoxArray *fdata_space = (mmdata -> fdata_space); + hypre_BoxArray *cdata_space = (mmdata -> cdata_space); + hypre_StructVector *mask = (mmdata -> mask); + + HYPRE_Int nterms = (Mdata -> nterms); + HYPRE_Int *terms = (Mdata -> terms); + HYPRE_Int *transposes = (Mdata -> transposes); + hypre_StructMatrix *M = (Mdata -> M); + HYPRE_Int nc = (Mdata -> nc); + hypre_StructMatmultDataMH *c = (Mdata -> c); + HYPRE_Int na = (Mdata -> na); + hypre_StructMatmultDataMH *a = (Mdata -> a); + HYPRE_Complex *constp; /* pointer to constant data */ + + /* Input matrices variables */ + HYPRE_Int ndim; + hypre_StructMatrix *matrix; + hypre_StructStencil *stencil; + hypre_StructGrid *grid; + HYPRE_Int *grid_ids; + HYPRE_Complex **A_const; + + /* M matrix variables */ + hypre_StTerm *st_term; /* Pointer to stencil info for each term in a */ + hypre_StructGrid *Mgrid = hypre_StructMatrixGrid(M); + HYPRE_Int *Mgrid_ids = hypre_StructGridIDs(Mgrid); + hypre_BoxArray *Mdata_space = hypre_StructMatrixDataSpace(M); + hypre_StructStencil *Mstencil = hypre_StructMatrixStencil(M); + HYPRE_Int stencil_size = hypre_StructStencilSize(Mstencil); + + /* Local variables */ + hypre_Index Mstart; /* M's stencil location on the base index space */ + hypre_Box *loop_box; /* boxloop extents on the base index space */ + hypre_IndexRef loop_start; /* boxloop start index on the base index space */ + hypre_IndexRef loop_stride; /* boxloop stride on the base index space */ + hypre_Index loop_size; /* boxloop size */ + hypre_Index Mstride; /* data-map stride (base index space) */ + hypre_IndexRef offsetref; /* offset for constant coefficient stencil entries */ + hypre_IndexRef shift; /* stencil shift from center for st_term */ + hypre_IndexRef stride; + HYPRE_Int zero_init; + + /* Boxloop variables */ + hypre_Index fdstart, cdstart, Mdstart; /* data starts */ + hypre_Index fdstride, cdstride, Mdstride; /* data strides */ + hypre_Box *fdbox, *cdbox, *Mdbox; /* data boxes */ + hypre_Index tdstart; + + /* Indices */ + HYPRE_Int entry, Mentry; + HYPRE_Int Mj, Mb; + HYPRE_Int b, i, id, m, t; + +#if defined(HYPRE_USING_GPU) + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(matrices[0]); + HYPRE_ExecutionPolicy exec_policy = hypre_GetExecPolicy1(memory_location); +#endif + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("StructMatmultCompute"); + + /* Set flag for initializing matrix/vector entries to zeroes */ +#if defined(HYPRE_USING_GPU) && defined(HYPRE_FUSE_FCC_FC_F) + if (exec_policy == HYPRE_EXEC_DEVICE) + { + /* Initialize to zeroes when NOT using the fused kernel implementation. */ + zero_init = !(nterms == 3 && kernel_type == 1); + } + else +#endif + { + zero_init = 1; + } + + /* Allocate the data for M */ + hypre_StructMatrixInitializeData(M, zero_init, NULL); + + /* Create work arrays on host memory for storing constant coefficients */ + A_const = hypre_TAlloc(HYPRE_Complex*, nmatrices + 1, HYPRE_MEMORY_HOST); +#if defined(HYPRE_USING_GPU) + if (exec_policy == HYPRE_EXEC_DEVICE) + { + for (m = 0; m < nmatrices; m++) + { + /* Copy constant coefficients to host memory */ + A_const[m] = hypre_TAlloc(HYPRE_Complex, + hypre_StructMatrixVDataOffset(matrices[m]), + HYPRE_MEMORY_HOST); + + hypre_TMemcpy(A_const[m], hypre_StructMatrixData(matrices[m]), + HYPRE_Complex, hypre_StructMatrixVDataOffset(matrices[m]), + HYPRE_MEMORY_HOST, memory_location); + } + A_const[nmatrices] = hypre_CTAlloc(HYPRE_Complex, + hypre_StructMatrixVDataOffset(M), + HYPRE_MEMORY_HOST); + } + else +#endif + { + for (m = 0; m < nmatrices; m++) + { + A_const[m] = hypre_StructMatrixData(matrices[m]); + } + A_const[nmatrices] = hypre_StructMatrixData(M); + } + + /* Compute constant entries of M */ + for (i = 0; i < nc; i++) + { + Mentry = c[i].mentry; + c[i].cprod = 1.0; + for (t = 0; t < nterms; t++) + { + st_term = &(c[i].terms[t]); + id = hypre_StTermID(st_term); + entry = hypre_StTermEntry(st_term); + m = terms[id]; + matrix = matrices[m]; + + //constp = hypre_StructMatrixConstData(matrix, entry); + constp = &A_const[m][hypre_StructMatrixConstIndices(matrix)[entry]]; + c[i].cprod *= constp[0]; + } + //constp = hypre_StructMatrixConstData(M, Mentry); + constp = &A_const[nmatrices][hypre_StructMatrixConstIndices(M)[Mentry]]; + constp[0] += c[i].cprod; + } + + /* Copy constant coefficients portion of M to the right memory location */ +#if defined(HYPRE_USING_GPU) + if (exec_policy == HYPRE_EXEC_DEVICE) + { + hypre_TMemcpy(hypre_StructMatrixData(M), A_const[nmatrices], + HYPRE_Complex, hypre_StructMatrixVDataOffset(M), + memory_location, HYPRE_MEMORY_HOST); + } +#endif + + /* If all constant coefficients or no boxes in grid, return */ + if (na == 0) + { + HYPRE_ANNOTATE_FUNC_END; + hypre_GpuProfilingPopRange(); +#if defined(HYPRE_USING_GPU) + if (exec_policy == HYPRE_EXEC_DEVICE) + { + for (m = 0; m < nmatrices + 1; m++) + { + hypre_TFree(A_const[m], HYPRE_MEMORY_HOST); + } + } +#endif + hypre_TFree(A_const, HYPRE_MEMORY_HOST); + + return hypre_error_flag; + } + + /* Initialize data */ + ndim = hypre_StructMatrixNDim(matrices[0]); + grid = hypre_StructMatrixGrid(matrices[0]); + grid_ids = hypre_StructGridIDs(grid); + loop_box = hypre_BoxCreate(ndim); + + /* Set Mstride */ + hypre_StructMatrixGetDataMapStride(M, &stride); + hypre_CopyToIndex(stride, ndim, Mstride); /* M's index space */ + hypre_MapToFineIndex(Mstride, NULL, coarsen_stride, ndim); /* base index space */ + + /* Set the loop_stride for the boxloop (the larger of ran_stride and dom_stride) */ + loop_stride = cstride; + + /* Set the data strides for the boxloop */ + hypre_CopyToIndex(loop_stride, ndim, Mdstride); + hypre_MapToCoarseIndex(Mdstride, NULL, Mstride, ndim); /* Should be Mdstride = 1 */ + hypre_CopyToIndex(loop_stride, ndim, fdstride); + hypre_MapToCoarseIndex(fdstride, NULL, fstride, ndim); + hypre_CopyToIndex(loop_stride, ndim, cdstride); + hypre_MapToCoarseIndex(cdstride, NULL, cstride, ndim); /* Should be cdstride = 1 */ + + for (b = 0, Mj = 0; Mj < hypre_StructMatrixRanNBoxes(M); Mj++) + { + Mb = hypre_StructMatrixRanBoxnum(M, Mj); + while (grid_ids[b] != Mgrid_ids[Mb]) + { + b++; + } + + /* This allows a full stencil computation without having to change the + * loop start and loop_size values (DomainIsCoarse case). It also + * ensures that the loop_box imin and imax are in the range space + * (RangeIsCoarse case). The loop_box is on the base index space. */ + hypre_CopyBox(hypre_StructGridBox(Mgrid, Mb), loop_box); + hypre_StructMatrixMapDataBox(M, loop_box); + hypre_StructMatrixUnMapDataBox(M, loop_box); + hypre_RefineBox(loop_box, NULL, coarsen_stride); /* Maps to the base index space */ + + /* Set the loop information in terms of the base index space */ + loop_start = hypre_BoxIMin(loop_box); + loop_stride = cstride; + hypre_BoxGetStrideSize(loop_box, loop_stride, loop_size); + + /* Set the data boxes and data start information for the boxloop. Note + * that neither MatrixMapDataIndex nor VectorMapDataIndex is used here, + * because we want to use both matrices and vectors in one boxloop. This + * is accounted for when setting the data pointer values a.tptrs[] below. */ + Mdbox = hypre_BoxArrayBox(Mdata_space, Mb); + fdbox = hypre_BoxArrayBox(fdata_space, b); + cdbox = hypre_BoxArrayBox(cdata_space, b); + hypre_CopyToIndex(loop_start, ndim, Mdstart); + hypre_MapToCoarseIndex(Mdstart, NULL, Mstride, ndim); /* at loop_start */ + hypre_CopyToIndex(hypre_BoxIMin(fdbox), ndim, fdstart); /* at beginning of databox */ + hypre_CopyToIndex(hypre_BoxIMin(cdbox), ndim, cdstart); /* at beginning of databox */ + + /* Set data pointers a.tptrs[] and a.mptr[]. For a.tptrs[], use Mstart to + * compute an offset from the beginning of the databox data. */ + for (i = 0; i < na; i++) + { + Mentry = a[i].mentry; + a[i].mptr = hypre_StructMatrixBoxData(M, Mb, Mentry); + a[i].cprod = 1.0; + + hypre_StructMatrixPlaceStencil(M, Mentry, Mdstart, Mstart); /* M's index space */ + hypre_MapToFineIndex(Mstart, NULL, coarsen_stride, ndim); /* base index space */ + for (t = 0; t < nterms; t++) + { + st_term = &(a[i].terms[t]); + id = hypre_StTermID(st_term); + entry = hypre_StTermEntry(st_term); + shift = hypre_StTermShift(st_term); + m = terms[id]; + matrix = matrices[m]; + + hypre_AddIndexes(Mstart, shift, ndim, tdstart); /* still on base index space */ + switch (a[i].types[t]) + { + case 0: /* variable coefficient on fine data space */ + hypre_StructMatrixMapDataIndex(matrix, tdstart); /* now on data space */ + a[i].tptrs[t] = hypre_StructMatrixBoxData(matrix, b, entry) + + hypre_BoxIndexRank(fdbox, tdstart); + //a[i].offsets[t] = hypre_StructMatrixDataIndices(matrix)[b][entry] + + // hypre_BoxIndexRank(fdbox, tdstart); + break; + + case 1: /* variable coefficient on coarse data space */ + hypre_StructMatrixMapDataIndex(matrix, tdstart); /* now on data space */ + a[i].tptrs[t] = hypre_StructMatrixBoxData(matrix, b, entry) + + hypre_BoxIndexRank(cdbox, tdstart); + //a[i].offsets[t] = hypre_StructMatrixDataIndices(matrix)[b][entry] + + // hypre_BoxIndexRank(cdbox, tdstart); + break; + + case 2: /* constant coefficient with a mask */ + //constp = hypre_StructMatrixConstData(matrix, entry); + constp = &A_const[m][hypre_StructMatrixConstIndices(matrix)[entry]]; + a[i].cprod *= constp[0]; + if (!transposes[id]) + { + stencil = hypre_StructMatrixStencil(matrix); + offsetref = hypre_StructStencilOffset(stencil, entry); + hypre_AddIndexes(tdstart, offsetref, ndim, tdstart); + } + hypre_StructVectorMapDataIndex(mask, tdstart); /* now on data space */ + a[i].tptrs[t] = hypre_StructVectorBoxData(mask, b) + + hypre_BoxIndexRank(fdbox, tdstart); + //a[i].offsets[t] = hypre_StructVectorDataIndices(mask)[b] + + // hypre_BoxIndexRank(fdbox, tdstart); + break; + + case 3: /* constant coefficient without a mask */ + //constp = hypre_StructMatrixConstData(matrix, entry); + constp = &A_const[m][hypre_StructMatrixConstIndices(matrix)[entry]]; + a[i].cprod *= constp[0]; + break; + } + } + } /* end loop over a entries */ + + /* Compute M coefficients for box Mb */ + switch (nterms) + { + case 2: + case 3: + if (kernel_type == 1) + { + hypre_StructMatmultCompute_fuse(nterms, a, na, ndim, + loop_size, stencil_size, + fdbox, fdstart, fdstride, + cdbox, cdstart, cdstride, + Mdbox, Mdstart, Mdstride, M); + } + else + { + hypre_StructMatmultCompute_core(nterms, a, na, ndim, + loop_size, stencil_size, + fdbox, fdstart, fdstride, + cdbox, cdstart, cdstride, + Mdbox, Mdstart, Mdstride); + } + break; + + default: + hypre_StructMatmultCompute_core_generic(a, na, nterms, ndim, loop_size, + fdbox, fdstart, fdstride, + cdbox, cdstart, cdstride, + Mdbox, Mdstart, Mdstride); + break; + } + } /* end loop over matrix M range boxes */ + + /* Trigger uninitialized values */ +#if defined (HYPRE_DEBUG) && !defined(HYPRE_USING_GPU) + for (i = 0; i < hypre_StructMatrixDataSize(M); i++) + { + hypre_assert(hypre_StructMatrixData(M)[i] == hypre_StructMatrixData(M)[i]); + } +#endif + + /* Free memory */ + hypre_BoxDestroy(loop_box); +#if defined(HYPRE_USING_GPU) + if (exec_policy == HYPRE_EXEC_DEVICE) + { + for (m = 0; m < nmatrices + 1; m++) + { + hypre_TFree(A_const[m], HYPRE_MEMORY_HOST); + } + } +#endif + hypre_TFree(A_const, HYPRE_MEMORY_HOST); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Core function for computing the product of "nterms" coefficients. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultCompute_core_generic( hypre_StructMatmultDataMH *a, + HYPRE_Int na, + HYPRE_Int nterms, + HYPRE_Int ndim, + hypre_Index loop_size, + hypre_Box *fdbox, + hypre_Index fdstart, + hypre_Index fdstride, + hypre_Box *cdbox, + hypre_Index cdstart, + hypre_Index cdstride, + hypre_Box *Mdbox, + hypre_Index Mdstart, + hypre_Index Mdstride ) +{ + /* TODO: add DEVICE_VAR */ + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Int i, t; + HYPRE_Complex prod; + HYPRE_Complex pprod = 0.0; + + for (i = 0; i < na; i++) + { + prod = a[i].cprod; + for (t = 0; t < nterms; t++) + { + switch (a[i].types[t]) + { + case 0: /* variable coefficient on fine data space */ + pprod = a[i].tptrs[t][fi]; + break; + + case 1: /* variable coefficient on coarse data space */ + pprod = a[i].tptrs[t][ci]; + break; + + case 2: /* constant coefficient with a mask - multiply by mask value */ + pprod = a[i].tptrs[t][fi]; + break; + + case 3: /* constant coefficient without a mask - do nothing */ + continue; + } + prod *= pprod; + } + a[i].mptr[Mi] += prod; + } + } + hypre_BoxLoop3End(Mi, fi, ci); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultGetMatrix( hypre_StructMatmultData *mmdata, + HYPRE_Int iM, + hypre_StructMatrix **M_ptr ) +{ + hypre_StructMatmultDataM *Mdata = &(mmdata -> matmults[iM]); + + *M_ptr = (Mdata -> M); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * The below matrix multiplication functions can all be split into two stages: + * 1. Setup() returns a matrix shell with no data allocated + * 2. MatmultMultiply() allocates data and completes the multiply + *--------------------------------------------------------------------------*/ + +/*-------------------------------------------------------------------------- + * Compute the product of several StructMatrix matrices + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultSetup( HYPRE_Int kernel_type, + HYPRE_Int nmatrices, + hypre_StructMatrix **matrices, + HYPRE_Int nterms, + HYPRE_Int *terms, + HYPRE_Int *trans, + hypre_StructMatmultData **mmdata_ptr, + hypre_StructMatrix **M_ptr ) +{ + hypre_StructMatmultData *mmdata; + hypre_StructMatrix *M; + HYPRE_Int iM; + + hypre_StructMatmultCreate(1, nmatrices, &mmdata); + hypre_StructMatmultSetKernelType(mmdata, kernel_type); + hypre_StructMatmultSetProduct(mmdata, nmatrices, matrices, nterms, terms, trans, &iM); + hypre_StructMatmultInitialize(mmdata, 1); + hypre_StructMatmultGetMatrix(mmdata, iM, &M); + + *mmdata_ptr = mmdata; + *M_ptr = M; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultMultiply( hypre_StructMatmultData *mmdata ) +{ + hypre_StructMatrix *M; + HYPRE_Int iM = (mmdata -> nmatmults) - 1; /* index for the matmult */ + + hypre_StructMatmultCommunicate(mmdata); + hypre_StructMatmultCompute(mmdata, iM); + hypre_StructMatmultGetMatrix(mmdata, iM, &M); + hypre_StructMatmultDestroy(mmdata); + + HYPRE_StructMatrixAssemble(M); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmult( HYPRE_Int kernel_type, + HYPRE_Int nmatrices, + hypre_StructMatrix **matrices, + HYPRE_Int nterms, + HYPRE_Int *terms, + HYPRE_Int *trans, + hypre_StructMatrix **M_ptr ) +{ + hypre_StructMatmultData *mmdata; + + hypre_StructMatmultSetup(kernel_type, nmatrices, matrices, + nterms, terms, trans, &mmdata, M_ptr); + hypre_StructMatmultMultiply(mmdata); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Compute the product of two StructMatrix matrices: M = A*B + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmatSetup( hypre_StructMatrix *A, + hypre_StructMatrix *B, + hypre_StructMatmultData **mmdata_ptr, + hypre_StructMatrix **M_ptr ) +{ + HYPRE_Int nmatrices = 2; + HYPRE_StructMatrix matrices[2] = {A, B}; + HYPRE_Int nterms = 2; + HYPRE_Int terms[3] = {0, 1}; + HYPRE_Int trans[2] = {0, 0}; + HYPRE_Int kernel_type; + +#if defined (HYPRE_USING_GPU) + if (hypre_HandleDefaultExecPolicy(hypre_handle()) == HYPRE_EXEC_DEVICE) + { + kernel_type = 1; + } + else +#endif + { + kernel_type = 0; + } + + hypre_StructMatmultSetup(kernel_type, nmatrices, matrices, + nterms, terms, trans, mmdata_ptr, M_ptr); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmat( hypre_StructMatrix *A, + hypre_StructMatrix *B, + hypre_StructMatrix **M_ptr ) +{ + hypre_StructMatmultData *mmdata; + + hypre_StructMatmatSetup(A, B, &mmdata, M_ptr); + hypre_StructMatmultMultiply(mmdata); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Compute M = P^T*A*P + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixPtAPSetup( HYPRE_Int kernel_type, + hypre_StructMatrix *A, + hypre_StructMatrix *P, + hypre_StructMatmultData **mmdata_ptr, + hypre_StructMatrix **M_ptr) +{ + HYPRE_Int nmatrices = 2; + HYPRE_StructMatrix matrices[2] = {A, P}; + HYPRE_Int nterms = 3; + HYPRE_Int terms[3] = {1, 0, 1}; + HYPRE_Int trans[3] = {1, 0, 0}; + + hypre_StructMatmultSetup(kernel_type, nmatrices, matrices, + nterms, terms, trans, mmdata_ptr, M_ptr); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixPtAP( hypre_StructMatrix *A, + hypre_StructMatrix *P, + hypre_StructMatrix **M_ptr) +{ + hypre_StructMatmultData *mmdata; + HYPRE_Int kernel_type; + +#if defined (HYPRE_USING_GPU) + if (hypre_HandleDefaultExecPolicy(hypre_handle()) == HYPRE_EXEC_DEVICE) + { + kernel_type = 1; + } + else +#endif + { + kernel_type = 0; + } + + hypre_StructMatrixPtAPSetup(kernel_type, A, P, &mmdata, M_ptr); + hypre_StructMatmultMultiply(mmdata); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Compute M = R*A*P + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixRAPSetup( HYPRE_Int kernel_type, + hypre_StructMatrix *R, + hypre_StructMatrix *A, + hypre_StructMatrix *P, + hypre_StructMatmultData **mmdata_ptr, + hypre_StructMatrix **M_ptr) +{ + HYPRE_Int nmatrices = 3; + HYPRE_StructMatrix matrices[3] = {A, P, R}; + HYPRE_Int nterms = 3; + HYPRE_Int terms[3] = {2, 0, 1}; + HYPRE_Int trans[3] = {0, 0, 0}; + + hypre_StructMatmultSetup(kernel_type, nmatrices, matrices, nterms, terms, trans, mmdata_ptr, M_ptr); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixRAP( hypre_StructMatrix *R, + hypre_StructMatrix *A, + hypre_StructMatrix *P, + hypre_StructMatrix **M_ptr) +{ + hypre_StructMatmultData *mmdata; + HYPRE_Int kernel_type; + +#if defined (HYPRE_USING_GPU) + if (hypre_HandleDefaultExecPolicy(hypre_handle()) == HYPRE_EXEC_DEVICE) + { + kernel_type = 1; + } + else +#endif + { + kernel_type = 0; + } + + hypre_StructMatrixRAPSetup(kernel_type, R, A, P, &mmdata, M_ptr); + hypre_StructMatmultMultiply(mmdata); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Compute M = RT^T*A*P + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixRTtAPSetup( HYPRE_Int kernel_type, + hypre_StructMatrix *RT, + hypre_StructMatrix *A, + hypre_StructMatrix *P, + hypre_StructMatmultData **mmdata_ptr, + hypre_StructMatrix **M_ptr) +{ + HYPRE_Int nmatrices = 3; + HYPRE_StructMatrix matrices[3] = {A, P, RT}; + HYPRE_Int nterms = 3; + HYPRE_Int terms[3] = {2, 0, 1}; + HYPRE_Int trans[3] = {1, 0, 0}; + + hypre_StructMatmultSetup(kernel_type, nmatrices, matrices, nterms, terms, trans, mmdata_ptr, M_ptr); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixRTtAP( hypre_StructMatrix *RT, + hypre_StructMatrix *A, + hypre_StructMatrix *P, + hypre_StructMatrix **M_ptr) +{ + hypre_StructMatmultData *mmdata; + HYPRE_Int kernel_type; + +#if defined (HYPRE_USING_GPU) + if (hypre_HandleDefaultExecPolicy(hypre_handle()) == HYPRE_EXEC_DEVICE) + { + kernel_type = 1; + } + else +#endif + { + kernel_type = 0; + } + + hypre_StructMatrixRTtAPSetup(kernel_type, RT, A, P, &mmdata, M_ptr); + hypre_StructMatmultMultiply(mmdata); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * StructMatrixAdd functions + * + * RDF: Implement this for more than just one matrix. + * RDF: Move this to another place later. + *--------------------------------------------------------------------------*/ + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixAddInit( HYPRE_Int nmatrices, + hypre_StructMatrix **matrices, + hypre_StructMatrix **A_ptr ) +{ + hypre_StructMatrix *A = NULL; + + /* RDF: Assume there is only one matrix (for now). This would normally + * compute a valid stencil for A and initialize it to zero. */ + + if (nmatrices > 0) + { + A = hypre_StructMatrixRef(matrices[0]); + } + + *A_ptr = A; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixAddMat( hypre_StructMatrix *A, + HYPRE_Complex alpha, + hypre_StructMatrix *B ) +{ + /* RDF: Assume there is only one matrix (for now) and alpha = 1 */ + + /* Compute A += alpha * B */ + HYPRE_UNUSED_VAR(A); + HYPRE_UNUSED_VAR(alpha); + HYPRE_UNUSED_VAR(B); + + return hypre_error_flag; +} diff --git a/src/struct_mv/struct_matmult.h b/src/struct_mv/struct_matmult.h new file mode 100644 index 0000000000..616450a575 --- /dev/null +++ b/src/struct_mv/struct_matmult.h @@ -0,0 +1,89 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 struct matrix-matrix multiplication structures + * + *****************************************************************************/ + +#ifndef hypre_STRUCT_MATMULT_HEADER +#define hypre_STRUCT_MATMULT_HEADER + +/* Max. number of matrix-matrix multiplication terms */ +#ifndef HYPRE_MAX_MMTERMS +#define HYPRE_MAX_MMTERMS 512 +#endif + +/*-------------------------------------------------------------------------- + * StructMatmultDataMH data structure + * + * Note: Only up to 3 matrix terms are currently allowed in the product. + *--------------------------------------------------------------------------*/ + +/* product term used to compute the variable stencil entries in M */ +typedef struct hypre_StructMatmultDataMH_struct +{ + hypre_StTerm terms[3]; /* stencil info for each term */ + HYPRE_Int mentry; /* stencil entry for M */ + HYPRE_Complex cprod; /* product of the constant terms */ + HYPRE_Int types[3]; /* types of computations to do for each term */ + HYPRE_Complex *tptrs[3]; /* pointers to matrix data for each term */ + //HYPRE_Int offsets[3]; /* RDF: Not needed - keep for now */ + HYPRE_Complex *mptr; /* pointer to matrix data for M */ + +} hypre_StructMatmultDataMH; + +/*-------------------------------------------------------------------------- + * StructMatmultDataM data structure + *--------------------------------------------------------------------------*/ + +typedef struct hypre_StructMatmultDataM_struct +{ + HYPRE_Int nterms; /* number of terms in the matmult */ + HYPRE_Int *terms; /* matrix reference for each term */ + HYPRE_Int *transposes; /* transpose flag for each term */ + + hypre_StructMatrix *M; /* matmult matrix being computed */ + hypre_StMatrix *st_M; /* stencil matrix for M */ + + HYPRE_Int nc; /* size of array c */ + hypre_StructMatmultDataMH *c; /* helper for computing constant entries */ + HYPRE_Int na; /* size of array a */ + hypre_StructMatmultDataMH *a; /* helper for computing variable entries */ + +} hypre_StructMatmultDataM; + +/*-------------------------------------------------------------------------- + * StructMatmultData data structure + *--------------------------------------------------------------------------*/ + +typedef struct hypre_StructMatmultData_struct +{ + HYPRE_Int kernel_type; /* kernel type for computing matmult */ + HYPRE_Int nmatmults; /* number of matmults */ + hypre_StructMatmultDataM *matmults; /* data for each matmult */ + + HYPRE_Int nmatrices; /* number of matrices */ + hypre_StructMatrix **matrices; /* matrices we are multiplying */ + HYPRE_Int *mtypes; /* data-map type for each matrix (fine or coarse) */ + + hypre_IndexRef coarsen_stride; /* coarsening factor for M's grid */ + HYPRE_Int coarsen; /* indicates if M's grid is obtained by coarsening */ + hypre_IndexRef fstride; /* fine data-map stride (base index space) */ + hypre_IndexRef cstride; /* coarse data-map stride (base index space) */ + hypre_BoxArray *fdata_space; /* fine data space */ + hypre_BoxArray *cdata_space; /* coarse data space */ + + hypre_StructVector *mask; /* bit mask for mixed constant-variable coeff multiplies */ + hypre_CommPkg *comm_pkg; /* pointer to agglomerated communication package */ + HYPRE_Complex **comm_data; /* pointer to agglomerated communication data */ + hypre_CommStencil **comm_stencils; /* comm stencils used to define communication */ + +} hypre_StructMatmultData; + +#endif diff --git a/src/struct_mv/struct_matmult_core.c b/src/struct_mv/struct_matmult_core.c new file mode 100644 index 0000000000..17f60f62a0 --- /dev/null +++ b/src/struct_mv/struct_matmult_core.c @@ -0,0 +1,1850 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/****************************************************************************** + * + * Structured matrix-matrix multiply kernel functions + * + *****************************************************************************/ + +#include "_hypre_struct_mv.h" +#include "_hypre_struct_mv.hpp" + +/*-------------------------------------------------------------------------- + * Defines used below + *--------------------------------------------------------------------------*/ + +#if defined(HYPRE_UNROLL_MAXDEPTH) +#undef HYPRE_UNROLL_MAXDEPTH +#endif +#define HYPRE_UNROLL_MAXDEPTH 7 +//#define DEBUG_MATMULT 2 + +typedef HYPRE_Complex *hypre_3Cptrs[3]; +typedef HYPRE_Complex *hypre_1Cptr; + +/*-------------------------------------------------------------------------- + * Matrix Multiplication Kernel Optimization Macros + * + * These macros implement an optimized framework for structured matrix-matrix + * multiplication kernels that handle different data access patterns. + * + * Overview: + * --------- + * F/C notation refers to fine/coarse data spaces. For example: + * - FFF: All three operands use fine grid data + * - CFF: First operand uses coarse data, others use fine data + * - CF: First operand uses coarse data, second uses fine data + * etc. + * + * Macro types and purpose: + * ------------------------ + * 1. Variable declaration macros: + * HYPRE_DECLARE_*VARS - Define local variables for efficient data access + * - 2VARS: Declares a coefficient (cprod) and one data pointer (tptrs) + * - 3VARS: Declares a coefficient (cprod) and two data pointers (tptrs) + * - 4VARS: Declares a coefficient (cprod) and three data pointers (tptrs) + * These are combined with HYPRE_DECLARE_ALL_*VARS to declare variables for + * up to 7 terms (defined by HYPRE_UNROLL_MAXDEPTH) + * + * 2. Data loading macros: + * HYPRE_SMMLOAD_*VARS - Load coefficient and pointer values from arrays + * - Basic versions (e.g., HYPRE_SMMLOAD_2VARS) serve as building blocks + * - _UP_TO macros load multiple terms up to a given depth + * - _IMPL_* macros provide the implementation details for each depth + * + * This design uses C99 variadic macros (..., __VA_ARGS__) to create a + * recursive implementation that minimizes code duplication. The variadic + * arguments allow macros to be chained together cleanly, with each depth + * building on the previous ones. + * + * The macro concatenation (##) is used to dispatch to the appropriate + * implementation based on the requested depth. This technique allows us + * to write generic code that selects the correct number of unrolled loops + * at compile time. + * + * 3. Computation core macros: + * HYPRE_SMMCORE_* - Define the actual multiplication operations + * - Different variants for different data space combinations (FFF, CFF, etc.) + * - Each computes a product of coefficient and data values + * + * HYPRE_SMMCORE_*_SUM_UP_TO_n - Create unrolled sums of multiple products at compile time + * - Direct entry points for generating compile-time sums of core computations + * - The n suffix determines how many terms to include (from 0 to n-1) + * - Used inside computation loops after loading variables with HYPRE_SMMLOAD_*_UP_TO + * + * Usage pattern in computation: + * ----------------------------- + * 1. Declare variables using HYPRE_DECLARE_ALL_*VARS + * 2. For each stencil entry: + * a. Load data using HYPRE_SMMLOAD_*VARS_UP_TO(k, n) where n is depth + * b. Compute products using HYPRE_SMMCORE_* macros via BoxLoops + * c. Accumulate results into the output pointer (mptr) + *--------------------------------------------------------------------------*/ + +#define HYPRE_DECLARE_2VARS(k) \ + HYPRE_Complex *tptrs_##k##_0, cprod_##k + +#define HYPRE_DECLARE_3VARS(k) \ + HYPRE_Complex *tptrs_##k##_0, *tptrs_##k##_1, cprod_##k + +#define HYPRE_DECLARE_4VARS(k) \ + HYPRE_Complex *tptrs_##k##_0, *tptrs_##k##_1, *tptrs_##k##_2, cprod_##k + +#define HYPRE_DECLARE_ALL_2VARS \ + HYPRE_DECLARE_2VARS(0); \ + HYPRE_DECLARE_2VARS(1); \ + HYPRE_DECLARE_2VARS(2); \ + HYPRE_DECLARE_2VARS(3); \ + HYPRE_DECLARE_2VARS(4); \ + HYPRE_DECLARE_2VARS(5); \ + HYPRE_DECLARE_2VARS(6) + +#define HYPRE_DECLARE_ALL_3VARS \ + HYPRE_DECLARE_3VARS(0); \ + HYPRE_DECLARE_3VARS(1); \ + HYPRE_DECLARE_3VARS(2); \ + HYPRE_DECLARE_3VARS(3); \ + HYPRE_DECLARE_3VARS(4); \ + HYPRE_DECLARE_3VARS(5); \ + HYPRE_DECLARE_3VARS(6) + +#define HYPRE_DECLARE_ALL_4VARS \ + HYPRE_DECLARE_4VARS(0); \ + HYPRE_DECLARE_4VARS(1); \ + HYPRE_DECLARE_4VARS(2); \ + HYPRE_DECLARE_4VARS(3); \ + HYPRE_DECLARE_4VARS(4); \ + HYPRE_DECLARE_4VARS(5); \ + HYPRE_DECLARE_4VARS(6) + +#define HYPRE_SMMLOAD_2VARS(k, m) \ + cprod_##m = cprod[(k + m)]; \ + tptrs_##m##_0 = tptrs[(k + m)][0] + +#define HYPRE_SMMLOAD_3VARS(k, m) \ + cprod_##m = cprod[(k + m)]; \ + tptrs_##m##_0 = tptrs[(k + m)][0]; \ + tptrs_##m##_1 = tptrs[(k + m)][1] + +#define HYPRE_SMMLOAD_4VARS(k, m) \ + cprod_##m = cprod[(k + m)]; \ + tptrs_##m##_0 = tptrs[(k + m)][0]; \ + tptrs_##m##_1 = tptrs[(k + m)][1]; \ + tptrs_##m##_2 = tptrs[(k + m)][2] + +/* For 4 variable types (cprod and tptrs[k][0], tptrs[k][1], tptrs[k][2]) */ +#define HYPRE_SMMLOAD_4VARS_UP_TO(k, n, ...) \ + HYPRE_SMMLOAD_4VARS_IMPL_##n(k, __VA_ARGS__) + +#define HYPRE_SMMLOAD_4VARS_IMPL_1(k, ...) \ + HYPRE_SMMLOAD_4VARS(k, 0) + +#define HYPRE_SMMLOAD_4VARS_IMPL_2(k, ...) \ + HYPRE_SMMLOAD_4VARS(k, 0); \ + HYPRE_SMMLOAD_4VARS(k, 1) + +#define HYPRE_SMMLOAD_4VARS_IMPL_3(k, ...) \ + HYPRE_SMMLOAD_4VARS_IMPL_2(k); \ + HYPRE_SMMLOAD_4VARS(k, 2) + +#define HYPRE_SMMLOAD_4VARS_IMPL_4(k, ...) \ + HYPRE_SMMLOAD_4VARS_IMPL_3(k); \ + HYPRE_SMMLOAD_4VARS(k, 3) + +#define HYPRE_SMMLOAD_4VARS_IMPL_5(k, ...) \ + HYPRE_SMMLOAD_4VARS_IMPL_4(k); \ + HYPRE_SMMLOAD_4VARS(k, 4) + +#define HYPRE_SMMLOAD_4VARS_IMPL_6(k, ...) \ + HYPRE_SMMLOAD_4VARS_IMPL_5(k); \ + HYPRE_SMMLOAD_4VARS(k, 5) + +#define HYPRE_SMMLOAD_4VARS_IMPL_7(k, ...) \ + HYPRE_SMMLOAD_4VARS_IMPL_6(k); \ + HYPRE_SMMLOAD_4VARS(k, 6) + +/* For 3 variable types (cprod and tptrs[k][0], tptrs[k][1]) */ +#define HYPRE_SMMLOAD_3VARS_UP_TO(k, n, ...) \ + HYPRE_SMMLOAD_3VARS_IMPL_##n(k, __VA_ARGS__) + +#define HYPRE_SMMLOAD_3VARS_IMPL_1(k, ...) \ + HYPRE_SMMLOAD_3VARS(k, 0) + +#define HYPRE_SMMLOAD_3VARS_IMPL_2(k, ...) \ + HYPRE_SMMLOAD_3VARS(k, 0); \ + HYPRE_SMMLOAD_3VARS(k, 1) + +#define HYPRE_SMMLOAD_3VARS_IMPL_3(k, ...) \ + HYPRE_SMMLOAD_3VARS_IMPL_2(k); \ + HYPRE_SMMLOAD_3VARS(k, 2) + +#define HYPRE_SMMLOAD_3VARS_IMPL_4(k, ...) \ + HYPRE_SMMLOAD_3VARS_IMPL_3(k); \ + HYPRE_SMMLOAD_3VARS(k, 3) + +#define HYPRE_SMMLOAD_3VARS_IMPL_5(k, ...) \ + HYPRE_SMMLOAD_3VARS_IMPL_4(k); \ + HYPRE_SMMLOAD_3VARS(k, 4) + +#define HYPRE_SMMLOAD_3VARS_IMPL_6(k, ...) \ + HYPRE_SMMLOAD_3VARS_IMPL_5(k); \ + HYPRE_SMMLOAD_3VARS(k, 5) + +#define HYPRE_SMMLOAD_3VARS_IMPL_7(k, ...) \ + HYPRE_SMMLOAD_3VARS_IMPL_6(k); \ + HYPRE_SMMLOAD_3VARS(k, 6) + +/* For 2 variable types (cprod and tptrs[k][0]) */ +#define HYPRE_SMMLOAD_2VARS_UP_TO(k, n, ...) \ + HYPRE_SMMLOAD_2VARS_IMPL_##n(k, __VA_ARGS__) + +#define HYPRE_SMMLOAD_2VARS_IMPL_1(k, ...) \ + HYPRE_SMMLOAD_2VARS(k, 0) + +#define HYPRE_SMMLOAD_2VARS_IMPL_2(k, ...) \ + HYPRE_SMMLOAD_2VARS(k, 0); \ + HYPRE_SMMLOAD_2VARS(k, 1) + +#define HYPRE_SMMLOAD_2VARS_IMPL_3(k, ...) \ + HYPRE_SMMLOAD_2VARS_IMPL_2(k); \ + HYPRE_SMMLOAD_2VARS(k, 2) + +#define HYPRE_SMMLOAD_2VARS_IMPL_4(k, ...) \ + HYPRE_SMMLOAD_2VARS_IMPL_3(k); \ + HYPRE_SMMLOAD_2VARS(k, 3) + +#define HYPRE_SMMLOAD_2VARS_IMPL_5(k, ...) \ + HYPRE_SMMLOAD_2VARS_IMPL_4(k); \ + HYPRE_SMMLOAD_2VARS(k, 4) + +#define HYPRE_SMMLOAD_2VARS_IMPL_6(k, ...) \ + HYPRE_SMMLOAD_2VARS_IMPL_5(k); \ + HYPRE_SMMLOAD_2VARS(k, 5) + +#define HYPRE_SMMLOAD_2VARS_IMPL_7(k, ...) \ + HYPRE_SMMLOAD_2VARS_IMPL_6(k); \ + HYPRE_SMMLOAD_2VARS(k, 6) + +#define HYPRE_SMMCORE_FFF(k) \ + cprod_##k * tptrs_##k##_0[fi] * tptrs_##k##_1[fi] * tptrs_##k##_2[fi] + +#define HYPRE_SMMCORE_CFF(k) \ + cprod_##k * tptrs_##k##_0[ci] * tptrs_##k##_1[fi] * tptrs_##k##_2[fi] + +#define HYPRE_SMMCORE_CCF(k) \ + cprod_##k * tptrs_##k##_0[ci] * tptrs_##k##_1[ci] * tptrs_##k##_2[fi] + +/* Don't need CCC */ + +#define HYPRE_SMMCORE_FF(k) \ + cprod_##k * tptrs_##k##_0[fi] * tptrs_##k##_1[fi] + +#define HYPRE_SMMCORE_CF(k) \ + cprod_##k * tptrs_##k##_0[ci] * tptrs_##k##_1[fi] + +#define HYPRE_SMMCORE_CC(k) \ + cprod_##k * tptrs_##k##_0[ci] * tptrs_##k##_1[ci] + +#define HYPRE_SMMCORE_F(k) \ + cprod_##k * tptrs_##k##_0[fi] + +#define HYPRE_SMMCORE_C(k) \ + cprod_##k * tptrs_##k##_0[ci] + +#define HYPRE_SMMCORE_FFF_SUM_UP_TO_1 \ + HYPRE_SMMCORE_FFF(0) + +#define HYPRE_SMMCORE_FFF_SUM_UP_TO_2 \ + HYPRE_SMMCORE_FFF(0) + \ + HYPRE_SMMCORE_FFF(1) + +#define HYPRE_SMMCORE_FFF_SUM_UP_TO_3 \ + HYPRE_SMMCORE_FFF_SUM_UP_TO_2 + \ + HYPRE_SMMCORE_FFF(2) + +#define HYPRE_SMMCORE_FFF_SUM_UP_TO_4 \ + HYPRE_SMMCORE_FFF_SUM_UP_TO_3 + \ + HYPRE_SMMCORE_FFF(3) + +#define HYPRE_SMMCORE_FFF_SUM_UP_TO_5 \ + HYPRE_SMMCORE_FFF_SUM_UP_TO_4 + \ + HYPRE_SMMCORE_FFF(4) + +#define HYPRE_SMMCORE_FFF_SUM_UP_TO_6 \ + HYPRE_SMMCORE_FFF_SUM_UP_TO_5 + \ + HYPRE_SMMCORE_FFF(5) + +#define HYPRE_SMMCORE_FFF_SUM_UP_TO_7 \ + HYPRE_SMMCORE_FFF_SUM_UP_TO_6 + \ + HYPRE_SMMCORE_FFF(6) + +#define HYPRE_SMMCORE_CFF_SUM_UP_TO_1 \ + HYPRE_SMMCORE_CFF(0) + +#define HYPRE_SMMCORE_CFF_SUM_UP_TO_2 \ + HYPRE_SMMCORE_CFF(0) + \ + HYPRE_SMMCORE_CFF(1) + +#define HYPRE_SMMCORE_CFF_SUM_UP_TO_3 \ + HYPRE_SMMCORE_CFF_SUM_UP_TO_2 + \ + HYPRE_SMMCORE_CFF(2) + +#define HYPRE_SMMCORE_CFF_SUM_UP_TO_4 \ + HYPRE_SMMCORE_CFF_SUM_UP_TO_3 + \ + HYPRE_SMMCORE_CFF(3) + +#define HYPRE_SMMCORE_CFF_SUM_UP_TO_5 \ + HYPRE_SMMCORE_CFF_SUM_UP_TO_4 + \ + HYPRE_SMMCORE_CFF(4) + +#define HYPRE_SMMCORE_CFF_SUM_UP_TO_6 \ + HYPRE_SMMCORE_CFF_SUM_UP_TO_5 + \ + HYPRE_SMMCORE_CFF(5) + +#define HYPRE_SMMCORE_CFF_SUM_UP_TO_7 \ + HYPRE_SMMCORE_CFF_SUM_UP_TO_6 + \ + HYPRE_SMMCORE_CFF(6) + +#define HYPRE_SMMCORE_CCF_SUM_UP_TO_1 \ + HYPRE_SMMCORE_CCF(0) + +#define HYPRE_SMMCORE_CCF_SUM_UP_TO_2 \ + HYPRE_SMMCORE_CCF(0) + \ + HYPRE_SMMCORE_CCF(1) + +#define HYPRE_SMMCORE_CCF_SUM_UP_TO_3 \ + HYPRE_SMMCORE_CCF_SUM_UP_TO_2 + \ + HYPRE_SMMCORE_CCF(2) + +#define HYPRE_SMMCORE_CCF_SUM_UP_TO_4 \ + HYPRE_SMMCORE_CCF_SUM_UP_TO_3 + \ + HYPRE_SMMCORE_CCF(3) + +#define HYPRE_SMMCORE_CCF_SUM_UP_TO_5 \ + HYPRE_SMMCORE_CCF_SUM_UP_TO_4 + \ + HYPRE_SMMCORE_CCF(4) + +#define HYPRE_SMMCORE_CCF_SUM_UP_TO_6 \ + HYPRE_SMMCORE_CCF_SUM_UP_TO_5 + \ + HYPRE_SMMCORE_CCF(5) + +#define HYPRE_SMMCORE_CCF_SUM_UP_TO_7 \ + HYPRE_SMMCORE_CCF_SUM_UP_TO_6 + \ + HYPRE_SMMCORE_CCF(6) + +#define HYPRE_SMMCORE_FF_SUM_UP_TO_1 \ + HYPRE_SMMCORE_FF(0) + +#define HYPRE_SMMCORE_FF_SUM_UP_TO_2 \ + HYPRE_SMMCORE_FF(0) + \ + HYPRE_SMMCORE_FF(1) + +#define HYPRE_SMMCORE_FF_SUM_UP_TO_3 \ + HYPRE_SMMCORE_FF_SUM_UP_TO_2 + \ + HYPRE_SMMCORE_FF(2) + +#define HYPRE_SMMCORE_FF_SUM_UP_TO_4 \ + HYPRE_SMMCORE_FF_SUM_UP_TO_3 + \ + HYPRE_SMMCORE_FF(3) + +#define HYPRE_SMMCORE_FF_SUM_UP_TO_5 \ + HYPRE_SMMCORE_FF_SUM_UP_TO_4 + \ + HYPRE_SMMCORE_FF(4) + +#define HYPRE_SMMCORE_FF_SUM_UP_TO_6 \ + HYPRE_SMMCORE_FF_SUM_UP_TO_5 + \ + HYPRE_SMMCORE_FF(5) + +#define HYPRE_SMMCORE_FF_SUM_UP_TO_7 \ + HYPRE_SMMCORE_FF_SUM_UP_TO_6 + \ + HYPRE_SMMCORE_FF(6) + +#define HYPRE_SMMCORE_CF_SUM_UP_TO_1 \ + HYPRE_SMMCORE_CF(0) + +#define HYPRE_SMMCORE_CF_SUM_UP_TO_2 \ + HYPRE_SMMCORE_CF(0) + \ + HYPRE_SMMCORE_CF(1) + +#define HYPRE_SMMCORE_CF_SUM_UP_TO_3 \ + HYPRE_SMMCORE_CF_SUM_UP_TO_2 + \ + HYPRE_SMMCORE_CF(2) + +#define HYPRE_SMMCORE_CF_SUM_UP_TO_4 \ + HYPRE_SMMCORE_CF_SUM_UP_TO_3 + \ + HYPRE_SMMCORE_CF(3) + +#define HYPRE_SMMCORE_CF_SUM_UP_TO_5 \ + HYPRE_SMMCORE_CF_SUM_UP_TO_4 + \ + HYPRE_SMMCORE_CF(4) + +#define HYPRE_SMMCORE_CF_SUM_UP_TO_6 \ + HYPRE_SMMCORE_CF_SUM_UP_TO_5 + \ + HYPRE_SMMCORE_CF(5) + +#define HYPRE_SMMCORE_CF_SUM_UP_TO_7 \ + HYPRE_SMMCORE_CF_SUM_UP_TO_6 + \ + HYPRE_SMMCORE_CF(6) + +#define HYPRE_SMMCORE_CC_SUM_UP_TO_1 \ + HYPRE_SMMCORE_CC(0) + +#define HYPRE_SMMCORE_CC_SUM_UP_TO_2 \ + HYPRE_SMMCORE_CC(0) + \ + HYPRE_SMMCORE_CC(1) + +#define HYPRE_SMMCORE_CC_SUM_UP_TO_3 \ + HYPRE_SMMCORE_CC_SUM_UP_TO_2 + \ + HYPRE_SMMCORE_CC(2) + +#define HYPRE_SMMCORE_CC_SUM_UP_TO_4 \ + HYPRE_SMMCORE_CC_SUM_UP_TO_3 + \ + HYPRE_SMMCORE_CC(3) + +#define HYPRE_SMMCORE_CC_SUM_UP_TO_5 \ + HYPRE_SMMCORE_CC_SUM_UP_TO_4 + \ + HYPRE_SMMCORE_CC(4) + +#define HYPRE_SMMCORE_CC_SUM_UP_TO_6 \ + HYPRE_SMMCORE_CC_SUM_UP_TO_5 + \ + HYPRE_SMMCORE_CC(5) + +#define HYPRE_SMMCORE_CC_SUM_UP_TO_7 \ + HYPRE_SMMCORE_CC_SUM_UP_TO_6 + \ + HYPRE_SMMCORE_CC(6) + +#define HYPRE_SMMCORE_F_SUM_UP_TO_1 \ + HYPRE_SMMCORE_F(0) + +#define HYPRE_SMMCORE_F_SUM_UP_TO_2 \ + HYPRE_SMMCORE_F(0) + \ + HYPRE_SMMCORE_F(1) + +#define HYPRE_SMMCORE_F_SUM_UP_TO_3 \ + HYPRE_SMMCORE_F_SUM_UP_TO_2 + \ + HYPRE_SMMCORE_F(2) + +#define HYPRE_SMMCORE_F_SUM_UP_TO_4 \ + HYPRE_SMMCORE_F_SUM_UP_TO_3 + \ + HYPRE_SMMCORE_F(3) + +#define HYPRE_SMMCORE_F_SUM_UP_TO_5 \ + HYPRE_SMMCORE_F_SUM_UP_TO_4 + \ + HYPRE_SMMCORE_F(4) + +#define HYPRE_SMMCORE_F_SUM_UP_TO_6 \ + HYPRE_SMMCORE_F_SUM_UP_TO_5 + \ + HYPRE_SMMCORE_F(5) + +#define HYPRE_SMMCORE_F_SUM_UP_TO_7 \ + HYPRE_SMMCORE_F_SUM_UP_TO_6 + \ + HYPRE_SMMCORE_F(6) + +#define HYPRE_SMMCORE_C_SUM_UP_TO_1 \ + HYPRE_SMMCORE_C(0) + +#define HYPRE_SMMCORE_C_SUM_UP_TO_2 \ + HYPRE_SMMCORE_C(0) + \ + HYPRE_SMMCORE_C(1) + +#define HYPRE_SMMCORE_C_SUM_UP_TO_3 \ + HYPRE_SMMCORE_C_SUM_UP_TO_2 + \ + HYPRE_SMMCORE_C(2) + +#define HYPRE_SMMCORE_C_SUM_UP_TO_4 \ + HYPRE_SMMCORE_C_SUM_UP_TO_3 + \ + HYPRE_SMMCORE_C(3) + +#define HYPRE_SMMCORE_C_SUM_UP_TO_5 \ + HYPRE_SMMCORE_C_SUM_UP_TO_4 + \ + HYPRE_SMMCORE_C(4) + +#define HYPRE_SMMCORE_C_SUM_UP_TO_6 \ + HYPRE_SMMCORE_C_SUM_UP_TO_5 + \ + HYPRE_SMMCORE_C(5) + +#define HYPRE_SMMCORE_C_SUM_UP_TO_7 \ + HYPRE_SMMCORE_C_SUM_UP_TO_6 + \ + HYPRE_SMMCORE_C(6) + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultCompute_core_fff( HYPRE_Int nprod, + HYPRE_Complex *cprod, + hypre_3Cptrs *tptrs, + hypre_1Cptr *mptrs, + HYPRE_Int ndim, + hypre_Index loop_size, + hypre_Box *fdbox, + hypre_Index fdstart, + hypre_Index fdstride, + hypre_Box *Mdbox, + hypre_Index Mdstart, + hypre_Index Mdstride ) +{ + HYPRE_Complex *mptr = mptrs[0]; /* Requires all pointers to be the same */ + HYPRE_Int k, depth; + + HYPRE_DECLARE_ALL_4VARS; + + if (nprod < 1) + { + return hypre_error_flag; + } + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("fff"); + + for (k = 0; k < nprod; k += HYPRE_UNROLL_MAXDEPTH) + { + depth = hypre_min(HYPRE_UNROLL_MAXDEPTH, (nprod - k)); + + switch (depth) + { + case 7: + HYPRE_SMMLOAD_4VARS_UP_TO(k, 7); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_Complex val = HYPRE_SMMCORE_FFF_SUM_UP_TO_7; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 6: + HYPRE_SMMLOAD_4VARS_UP_TO(k, 6); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_Complex val = HYPRE_SMMCORE_FFF_SUM_UP_TO_6; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 5: + HYPRE_SMMLOAD_4VARS_UP_TO(k, 5); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_Complex val = HYPRE_SMMCORE_FFF_SUM_UP_TO_5; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 4: + HYPRE_SMMLOAD_4VARS_UP_TO(k, 4); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_Complex val = HYPRE_SMMCORE_FFF_SUM_UP_TO_4; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 3: + HYPRE_SMMLOAD_4VARS_UP_TO(k, 3); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_Complex val = HYPRE_SMMCORE_FFF_SUM_UP_TO_3; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 2: + HYPRE_SMMLOAD_4VARS_UP_TO(k, 2); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_Complex val = HYPRE_SMMCORE_FFF_SUM_UP_TO_2; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 1: + HYPRE_SMMLOAD_4VARS_UP_TO(k, 1); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_Complex val = HYPRE_SMMCORE_FFF_SUM_UP_TO_1; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, fi); + break; + + default: + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unsupported depth of loop unrolling!"); + } + } + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultCompute_core_cff( HYPRE_Int nprod, + HYPRE_Complex *cprod, + hypre_3Cptrs *tptrs, + hypre_1Cptr *mptrs, + HYPRE_Int ndim, + hypre_Index loop_size, + hypre_Box *fdbox, + hypre_Index fdstart, + hypre_Index fdstride, + hypre_Box *cdbox, + hypre_Index cdstart, + hypre_Index cdstride, + hypre_Box *Mdbox, + hypre_Index Mdstart, + hypre_Index Mdstride ) +{ + HYPRE_Complex *mptr = mptrs[0]; /* Requires all pointers to be the same */ + HYPRE_Int k, depth; + + HYPRE_DECLARE_ALL_4VARS; + + if (nprod < 1) + { + return hypre_error_flag; + } + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("cff"); + + for (k = 0; k < nprod; k += HYPRE_UNROLL_MAXDEPTH) + { + depth = hypre_min(HYPRE_UNROLL_MAXDEPTH, (nprod - k)); + + switch (depth) + { + case 7: + HYPRE_SMMLOAD_4VARS_UP_TO(k, 7); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_CFF_SUM_UP_TO_7; + mptr[Mi] += val; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 6: + HYPRE_SMMLOAD_4VARS_UP_TO(k, 6); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_CFF_SUM_UP_TO_6; + mptr[Mi] += val; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 5: + HYPRE_SMMLOAD_4VARS_UP_TO(k, 5); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_CFF_SUM_UP_TO_5; + mptr[Mi] += val; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 4: + HYPRE_SMMLOAD_4VARS_UP_TO(k, 4); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_CFF_SUM_UP_TO_4; + mptr[Mi] += val; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 3: + HYPRE_SMMLOAD_4VARS_UP_TO(k, 3); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_CFF_SUM_UP_TO_3; + mptr[Mi] += val; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 2: + HYPRE_SMMLOAD_4VARS_UP_TO(k, 2); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_CFF_SUM_UP_TO_2; + mptr[Mi] += val; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 1: + HYPRE_SMMLOAD_4VARS_UP_TO(k, 1); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_CFF_SUM_UP_TO_1; + mptr[Mi] += val; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + default: + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unsupported depth of loop unrolling!"); + } + } + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultCompute_core_ccf( HYPRE_Int nprod, + HYPRE_Complex *cprod, + hypre_3Cptrs *tptrs, + hypre_1Cptr *mptrs, + HYPRE_Int ndim, + hypre_Index loop_size, + hypre_Box *fdbox, + hypre_Index fdstart, + hypre_Index fdstride, + hypre_Box *cdbox, + hypre_Index cdstart, + hypre_Index cdstride, + hypre_Box *Mdbox, + hypre_Index Mdstart, + hypre_Index Mdstride ) +{ + HYPRE_Complex *mptr = mptrs[0]; /* Requires all pointers to be the same */ + HYPRE_Int k, depth; + + HYPRE_DECLARE_ALL_4VARS; + + if (nprod < 1) + { + return hypre_error_flag; + } + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("ccf"); + + for (k = 0; k < nprod; k += HYPRE_UNROLL_MAXDEPTH) + { + depth = hypre_min(HYPRE_UNROLL_MAXDEPTH, (nprod - k)); + + switch (depth) + { + case 7: + HYPRE_SMMLOAD_4VARS_UP_TO(k, 7); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_CCF_SUM_UP_TO_7; + mptr[Mi] += val; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 6: + HYPRE_SMMLOAD_4VARS_UP_TO(k, 6); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_CCF_SUM_UP_TO_6; + mptr[Mi] += val; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 5: + HYPRE_SMMLOAD_4VARS_UP_TO(k, 5); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_CCF_SUM_UP_TO_5; + mptr[Mi] += val; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 4: + HYPRE_SMMLOAD_4VARS_UP_TO(k, 4); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_CCF_SUM_UP_TO_4; + mptr[Mi] += val; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 3: + HYPRE_SMMLOAD_4VARS_UP_TO(k, 3); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_CCF_SUM_UP_TO_3; + mptr[Mi] += val; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 2: + HYPRE_SMMLOAD_4VARS_UP_TO(k, 2); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_CCF_SUM_UP_TO_2; + mptr[Mi] += val; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 1: + HYPRE_SMMLOAD_4VARS_UP_TO(k, 1); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_CCF_SUM_UP_TO_1; + mptr[Mi] += val; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + default: + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unsupported depth of loop unrolling!"); + } + } + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultCompute_core_ff( HYPRE_Int nprod, + HYPRE_Complex *cprod, + hypre_3Cptrs *tptrs, + hypre_1Cptr *mptrs, + HYPRE_Int ndim, + hypre_Index loop_size, + hypre_Box *fdbox, + hypre_Index fdstart, + hypre_Index fdstride, + hypre_Box *Mdbox, + hypre_Index Mdstart, + hypre_Index Mdstride ) +{ + HYPRE_Complex *mptr = mptrs[0]; /* Requires all pointers to be the same */ + HYPRE_Int k, depth; + + HYPRE_DECLARE_ALL_3VARS; + + if (nprod < 1) + { + return hypre_error_flag; + } + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("ff"); + + for (k = 0; k < nprod; k += HYPRE_UNROLL_MAXDEPTH) + { + depth = hypre_min(HYPRE_UNROLL_MAXDEPTH, (nprod - k)); + + switch (depth) + { + case 7: + HYPRE_SMMLOAD_3VARS_UP_TO(k, 7); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_Complex val = HYPRE_SMMCORE_FF_SUM_UP_TO_7; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 6: + HYPRE_SMMLOAD_3VARS_UP_TO(k, 6); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_Complex val = HYPRE_SMMCORE_FF_SUM_UP_TO_6; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 5: + HYPRE_SMMLOAD_3VARS_UP_TO(k, 5); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_Complex val = HYPRE_SMMCORE_FF_SUM_UP_TO_5; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 4: + HYPRE_SMMLOAD_3VARS_UP_TO(k, 4); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_Complex val = HYPRE_SMMCORE_FF_SUM_UP_TO_4; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 3: + HYPRE_SMMLOAD_3VARS_UP_TO(k, 3); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_Complex val = HYPRE_SMMCORE_FF_SUM_UP_TO_3; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 2: + HYPRE_SMMLOAD_3VARS_UP_TO(k, 2); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_Complex val = HYPRE_SMMCORE_FF_SUM_UP_TO_2; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 1: + HYPRE_SMMLOAD_3VARS_UP_TO(k, 1); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_Complex val = HYPRE_SMMCORE_FF_SUM_UP_TO_1; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, fi); + break; + + default: + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unsupported depth of loop unrolling!"); + } + } + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultCompute_core_cf( HYPRE_Int nprod, + HYPRE_Complex *cprod, + hypre_3Cptrs *tptrs, + hypre_1Cptr *mptrs, + HYPRE_Int ndim, + hypre_Index loop_size, + hypre_Box *fdbox, + hypre_Index fdstart, + hypre_Index fdstride, + hypre_Box *cdbox, + hypre_Index cdstart, + hypre_Index cdstride, + hypre_Box *Mdbox, + hypre_Index Mdstart, + hypre_Index Mdstride ) +{ + HYPRE_Complex *mptr = mptrs[0]; /* Requires all pointers to be the same */ + HYPRE_Int k, depth; + + HYPRE_DECLARE_ALL_3VARS; + + if (nprod < 1) + { + return hypre_error_flag; + } + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("cf"); + + for (k = 0; k < nprod; k += HYPRE_UNROLL_MAXDEPTH) + { + depth = hypre_min(HYPRE_UNROLL_MAXDEPTH, (nprod - k)); + + switch (depth) + { + case 7: + HYPRE_SMMLOAD_3VARS_UP_TO(k, 7); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_CF_SUM_UP_TO_7; + mptr[Mi] += val; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 6: + HYPRE_SMMLOAD_3VARS_UP_TO(k, 6); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_CF_SUM_UP_TO_6; + mptr[Mi] += val; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 5: + HYPRE_SMMLOAD_3VARS_UP_TO(k, 5); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_CF_SUM_UP_TO_5; + mptr[Mi] += val; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 4: + HYPRE_SMMLOAD_3VARS_UP_TO(k, 4); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_CF_SUM_UP_TO_4; + mptr[Mi] += val; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 3: + HYPRE_SMMLOAD_3VARS_UP_TO(k, 3); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_CF_SUM_UP_TO_3; + mptr[Mi] += val; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 2: + HYPRE_SMMLOAD_3VARS_UP_TO(k, 2); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_CF_SUM_UP_TO_2; + mptr[Mi] += val; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 1: + HYPRE_SMMLOAD_3VARS_UP_TO(k, 1); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_CF_SUM_UP_TO_1; + mptr[Mi] += val; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + default: + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unsupported depth of loop unrolling!"); + } + } + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultCompute_core_cc( HYPRE_Int nprod, + HYPRE_Complex *cprod, + hypre_3Cptrs *tptrs, + hypre_1Cptr *mptrs, + HYPRE_Int ndim, + hypre_Index loop_size, + hypre_Box *cdbox, + hypre_Index cdstart, + hypre_Index cdstride, + hypre_Box *Mdbox, + hypre_Index Mdstart, + hypre_Index Mdstride ) +{ + HYPRE_Complex *mptr = mptrs[0]; /* Requires all pointers to be the same */ + HYPRE_Int k, depth; + + HYPRE_DECLARE_ALL_3VARS; + + if (nprod < 1) + { + return hypre_error_flag; + } + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("cc"); + + for (k = 0; k < nprod; k += HYPRE_UNROLL_MAXDEPTH) + { + depth = hypre_min(HYPRE_UNROLL_MAXDEPTH, (nprod - k)); + + switch (depth) + { + case 7: + HYPRE_SMMLOAD_3VARS_UP_TO(k, 7); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_CC_SUM_UP_TO_7; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 6: + HYPRE_SMMLOAD_3VARS_UP_TO(k, 6); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_CC_SUM_UP_TO_6; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 5: + HYPRE_SMMLOAD_3VARS_UP_TO(k, 5); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_CC_SUM_UP_TO_5; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 4: + HYPRE_SMMLOAD_3VARS_UP_TO(k, 4); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_CC_SUM_UP_TO_4; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 3: + HYPRE_SMMLOAD_3VARS_UP_TO(k, 3); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_CC_SUM_UP_TO_3; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 2: + HYPRE_SMMLOAD_3VARS_UP_TO(k, 2); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_CC_SUM_UP_TO_2; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 1: + HYPRE_SMMLOAD_3VARS_UP_TO(k, 1); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_CC_SUM_UP_TO_1; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, ci); + break; + + default: + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unsupported depth of loop unrolling!"); + } + } + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultCompute_core_f( HYPRE_Int nprod, + HYPRE_Complex *cprod, + hypre_3Cptrs *tptrs, + hypre_1Cptr *mptrs, + HYPRE_Int ndim, + hypre_Index loop_size, + hypre_Box *fdbox, + hypre_Index fdstart, + hypre_Index fdstride, + hypre_Box *Mdbox, + hypre_Index Mdstart, + hypre_Index Mdstride ) +{ + HYPRE_Complex *mptr = mptrs[0]; /* Requires all pointers to be the same */ + HYPRE_Int k, depth; + + HYPRE_DECLARE_ALL_2VARS; + + if (nprod < 1) + { + return hypre_error_flag; + } + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("f"); + + for (k = 0; k < nprod; k += HYPRE_UNROLL_MAXDEPTH) + { + depth = hypre_min(HYPRE_UNROLL_MAXDEPTH, (nprod - k)); + + switch (depth) + { + case 7: + HYPRE_SMMLOAD_2VARS_UP_TO(k, 7); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_Complex val = HYPRE_SMMCORE_F_SUM_UP_TO_7; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 6: + HYPRE_SMMLOAD_2VARS_UP_TO(k, 6); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_Complex val = HYPRE_SMMCORE_F_SUM_UP_TO_6; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 5: + HYPRE_SMMLOAD_2VARS_UP_TO(k, 5); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_Complex val = HYPRE_SMMCORE_F_SUM_UP_TO_5; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 4: + HYPRE_SMMLOAD_2VARS_UP_TO(k, 4); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_Complex val = HYPRE_SMMCORE_F_SUM_UP_TO_4; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 3: + HYPRE_SMMLOAD_2VARS_UP_TO(k, 3); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_Complex val = HYPRE_SMMCORE_F_SUM_UP_TO_3; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 2: + HYPRE_SMMLOAD_2VARS_UP_TO(k, 2); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_Complex val = HYPRE_SMMCORE_F_SUM_UP_TO_2; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 1: + HYPRE_SMMLOAD_2VARS_UP_TO(k, 1); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_Complex val = HYPRE_SMMCORE_F_SUM_UP_TO_1; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, fi); + break; + + default: + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unsupported depth of loop unrolling!"); + } + } + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultCompute_core_c( HYPRE_Int nprod, + HYPRE_Complex *cprod, + hypre_3Cptrs *tptrs, + hypre_1Cptr *mptrs, + HYPRE_Int ndim, + hypre_Index loop_size, + hypre_Box *cdbox, + hypre_Index cdstart, + hypre_Index cdstride, + hypre_Box *Mdbox, + hypre_Index Mdstart, + hypre_Index Mdstride ) +{ + HYPRE_Complex *mptr = mptrs[0]; /* Requires all pointers to be the same */ + HYPRE_Int k, depth; + + HYPRE_DECLARE_ALL_2VARS; + + if (nprod < 1) + { + return hypre_error_flag; + } + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("c"); + + for (k = 0; k < nprod; k += HYPRE_UNROLL_MAXDEPTH) + { + depth = hypre_min(HYPRE_UNROLL_MAXDEPTH, (nprod - k)); + + switch (depth) + { + case 7: + HYPRE_SMMLOAD_2VARS_UP_TO(k, 7); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_C_SUM_UP_TO_7; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 6: + HYPRE_SMMLOAD_2VARS_UP_TO(k, 6); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_C_SUM_UP_TO_6; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 5: + HYPRE_SMMLOAD_2VARS_UP_TO(k, 5); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_C_SUM_UP_TO_5; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 4: + HYPRE_SMMLOAD_2VARS_UP_TO(k, 4); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_C_SUM_UP_TO_4; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 3: + HYPRE_SMMLOAD_2VARS_UP_TO(k, 3); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_C_SUM_UP_TO_3; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 2: + HYPRE_SMMLOAD_2VARS_UP_TO(k, 2); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_C_SUM_UP_TO_2; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 1: + HYPRE_SMMLOAD_2VARS_UP_TO(k, 1); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_Complex val = HYPRE_SMMCORE_C_SUM_UP_TO_1; + mptr[Mi] += val; + } + hypre_BoxLoop2End(Mi, ci); + break; + + default: + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unsupported depth of loop unrolling!"); + } + } + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Core function for computing the nterms-product of coefficients. + * Here, nterms can only be 2 or 3. + * + * 8 refers to the max. number of core kernels that can be unrolled: + * FFF, CFF, CCF, FF, CF, CC, F, C. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultCompute_core( HYPRE_Int nterms, + hypre_StructMatmultDataMH *a, + HYPRE_Int na, + HYPRE_Int ndim, + hypre_Index loop_size, + HYPRE_Int stencil_size, + hypre_Box *fdbox, + hypre_Index fdstart, + hypre_Index fdstride, + hypre_Box *cdbox, + hypre_Index cdstart, + hypre_Index cdstride, + hypre_Box *Mdbox, + hypre_Index Mdstart, + hypre_Index Mdstride ) +{ + HYPRE_Int nprod[8]; + HYPRE_Complex cprod[8][HYPRE_MAX_MMTERMS]; + hypre_3Cptrs tptrs[8][HYPRE_MAX_MMTERMS]; + hypre_1Cptr mptrs[8][HYPRE_MAX_MMTERMS]; + + HYPRE_Int mentry, ptype = 0, nf, nc, nt; + HYPRE_Int e, p, i, k, t; + +#if defined(DEBUG_MATMULT) + HYPRE_Int c, nboxloops = 0; + HYPRE_Int nprodsum[8] = {0}; +#endif + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("core"); + + for (e = 0; e < stencil_size; e++) + { + /* Reset product counters */ + for (p = 0; p < 8; p++) + { + nprod[p] = 0; + } + + /* Build products arrays */ + for (i = 0; i < na; i++) + { + mentry = a[i].mentry; + if (mentry != e) + { + continue; + } + + /* Determine number of fine and coarse terms */ + nf = nc = 0; + for (t = 0; t < nterms; t++) + { + if (a[i].types[t] == 1) + { + /* Type 1 -> coarse data space */ + nc++; + } + else if (a[i].types[t] != 3) + { + /* Type 0 or 2 -> fine data space */ + nf++; + } + } + nt = nf + nc; + + /* Determine product type */ + switch (nt) + { + case 3: + switch (nc) + { + case 0: /* fff term (call core_fff) */ + ptype = 0; + break; + + case 1: /* cff term (call core_cff) */ + ptype = 1; + break; + + case 2: /* ccf term (call core_ccf) */ + ptype = 2; + break; + } + break; + + case 2: + switch (nc) + { + case 0: /* ff term (call core_ff) */ + ptype = 3; + break; + + case 1: /* cf term (call core_cf) */ + ptype = 4; + break; + + case 2: /* cc term (call core_cc) */ + ptype = 5; + break; + } + break; + + case 1: + switch (nc) + { + case 0: /* f term (call core_f) */ + ptype = 6; + break; + + case 1: /* c term (call core_c) */ + ptype = 7; + break; + } + break; + + default: + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Can't have zero terms in StructMatmult!"); + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; + } + + /* Retrieve product index */ + k = nprod[ptype]; + if (k >= HYPRE_MAX_MMTERMS) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Reached maximum allowed product index! Increase HYPRE_MAX_MMTERMS!"); + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; + } + + /* Set array values for k-th product of type "ptype" */ + cprod[ptype][k] = a[i].cprod; + nf = nc = 0; + for (t = 0; t < nterms; t++) + { + if (a[i].types[t] == 1) + { + /* Type 1 -> coarse data space */ + tptrs[ptype][k][nc] = a[i].tptrs[t]; /* put first */ + nc++; + } + else if (a[i].types[t] != 3) + { + /* Type 0 or 2 -> fine data space */ + tptrs[ptype][k][nt - 1 - nf] = a[i].tptrs[t]; /* put last */ + nf++; + } + } + mptrs[ptype][k] = a[i].mptr; + nprod[ptype]++; + } + +#if defined(DEBUG_MATMULT) && (DEBUG_MATMULT > 1) + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "\n=== CORE STENCIL ENTRY %d POINTERS ===\n", e); + + /* Show all products for this stencil entry across all types */ + const char* type_names[8] = {"FFF", "CFF", "CCF", "FF", "CF", "CC", "F", "C"}; + for (p = 0; p < 8; p++) + { + if (nprod[p] > 0) + { + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "%s Products (count: %d):\n", type_names[p], nprod[p]); + for (k = 0; k < nprod[p]; k++) + { + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " Product %d:\n", k); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " cprod = %p (value: %e)\n", + (void*)&cprod[p][k], cprod[p][k]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " mptr = %p\n", + (void*)mptrs[p][k]); + + /* Show tptrs based on product type */ + HYPRE_Int num_tptrs; + if (p <= 2) + { + num_tptrs = 3; /* FFF, CFF, CCF have 3 tptrs */ + } + else if (p <= 5) + { + num_tptrs = 2; /* FF, CF, CC have 2 tptrs */ + } + else + { + num_tptrs = 1; /* F, C have 1 tptr */ + } + + for (t = 0; t < num_tptrs; t++) + { + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " tptr[%d] = %p\n", + t, (void*)tptrs[p][k][t]); + } + } + } + } + + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "===============================\n"); +#endif + +#if defined(DEBUG_MATMULT) + for (c = 0; c < 8; c++) + { + nboxloops += hypre_ceildiv(nprod[c], HYPRE_UNROLL_MAXDEPTH); + nprodsum[c] += hypre_ceildiv(nprod[c], HYPRE_UNROLL_MAXDEPTH); + } + + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "stEntry: %02d | ", e); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, + "FFF: %d | CFF: %d | CCF: %d | ", + nprod[0], nprod[1], nprod[2]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, + "FF: %d | CF: %d | CC: %d | F: %d | C: %d | ", + nprod[3], nprod[4], nprod[5], + nprod[6], nprod[7]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "Tot: %d\n", + nprod[0] + nprod[1] + nprod[2] + \ + nprod[3] + nprod[4] + nprod[5] + \ + nprod[6] + nprod[7]); +#endif + + /* Call core functions */ + if (nterms > 2) + { + hypre_StructMatmultCompute_core_fff(nprod[0], cprod[0], tptrs[0], mptrs[0], + ndim, loop_size, + fdbox, fdstart, fdstride, + Mdbox, Mdstart, Mdstride); + + hypre_StructMatmultCompute_core_cff(nprod[1], cprod[1], tptrs[1], mptrs[1], + ndim, loop_size, + fdbox, fdstart, fdstride, + cdbox, cdstart, cdstride, + Mdbox, Mdstart, Mdstride); + + hypre_StructMatmultCompute_core_ccf(nprod[2], cprod[2], tptrs[2], mptrs[2], + ndim, loop_size, + fdbox, fdstart, fdstride, + cdbox, cdstart, cdstride, + Mdbox, Mdstart, Mdstride); + } + + hypre_StructMatmultCompute_core_ff(nprod[3], cprod[3], tptrs[3], mptrs[3], + ndim, loop_size, + fdbox, fdstart, fdstride, + Mdbox, Mdstart, Mdstride); + + hypre_StructMatmultCompute_core_cf(nprod[4], cprod[4], tptrs[4], mptrs[4], + ndim, loop_size, + fdbox, fdstart, fdstride, + cdbox, cdstart, cdstride, + Mdbox, Mdstart, Mdstride); + + hypre_StructMatmultCompute_core_cc(nprod[5], cprod[5], tptrs[5], mptrs[5], + ndim, loop_size, + cdbox, cdstart, cdstride, + Mdbox, Mdstart, Mdstride); + + hypre_StructMatmultCompute_core_f(nprod[6], cprod[6], tptrs[6], mptrs[6], + ndim, loop_size, + fdbox, fdstart, fdstride, + Mdbox, Mdstart, Mdstride); + + hypre_StructMatmultCompute_core_c(nprod[7], cprod[7], tptrs[7], mptrs[7], + ndim, loop_size, + cdbox, cdstart, cdstride, + Mdbox, Mdstart, Mdstride); + } /* loop on M stencil entries */ + +#if defined(DEBUG_MATMULT) + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "Number of box loops: "); + if (nprodsum[0] > 0) { hypre_ParPrintf(hypre_MPI_COMM_WORLD, "FFF: %d | ", nprodsum[0]); } + if (nprodsum[1] > 0) { hypre_ParPrintf(hypre_MPI_COMM_WORLD, "CFF: %d | ", nprodsum[1]); } + if (nprodsum[2] > 0) { hypre_ParPrintf(hypre_MPI_COMM_WORLD, "CCF: %d | ", nprodsum[2]); } + if (nprodsum[3] > 0) { hypre_ParPrintf(hypre_MPI_COMM_WORLD, "FF: %d | ", nprodsum[3]); } + if (nprodsum[4] > 0) { hypre_ParPrintf(hypre_MPI_COMM_WORLD, "CF: %d | ", nprodsum[4]); } + if (nprodsum[5] > 0) { hypre_ParPrintf(hypre_MPI_COMM_WORLD, "CC: %d | ", nprodsum[5]); } + if (nprodsum[6] > 0) { hypre_ParPrintf(hypre_MPI_COMM_WORLD, "F: %d | ", nprodsum[6]); } + if (nprodsum[7] > 0) { hypre_ParPrintf(hypre_MPI_COMM_WORLD, "C: %d | ", nprodsum[7]); } + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "Total: %d\n\n", nboxloops); +#endif + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} diff --git a/src/struct_mv/struct_matmult_fuse.c b/src/struct_mv/struct_matmult_fuse.c new file mode 100644 index 0000000000..d2082844fc --- /dev/null +++ b/src/struct_mv/struct_matmult_fuse.c @@ -0,0 +1,4784 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/****************************************************************************** + * + * Structured matrix-matrix multiply kernel functions + * + *****************************************************************************/ + +#include "_hypre_struct_mv.h" +#include "_hypre_struct_mv.hpp" + +/*-------------------------------------------------------------------------- + * Defines used below + *--------------------------------------------------------------------------*/ + +#define HYPRE_FUSE_MAXDEPTH 20 +//#define DEBUG_MATMULT 0 +//#define USE_FUSE_SORT 1 + +typedef HYPRE_Complex *hypre_3Cptrs[3]; +typedef HYPRE_Complex *hypre_1Cptr; + +/*-------------------------------------------------------------------------- + * Matrix Multiplication Kernel Fusion Macros + * + * This file implements a macro-based framework for fusing multiple structured + * matrix-matrix multiplication operations. The goal is to maximize throughput + * by unrolling and fusing multiple stencil product terms into a single BoxLoop. + * + * Macro types and purpose: + * ------------------------ + * 1. Variable declaration macros: + * HYPRE_SMMFUSE_DECLARE_*VARS - Declare local variables for each fused product. + * - 3VARS, 4VARS, 5VARS: For different product types (e.g., F, FF, FFF, etc.) + * - HYPRE_SMMFUSE_DECLARE_20_*VARS: Declare up to 20 sets of variables for unrolling. + * + * 2. Data loading macros: + * HYPRE_SMMFUSE_LOAD_*VARS - Load coefficients and data pointers for each product. + * - _UP_TO_N macros: Recursively load variables for up to N fused products. + * + * 3. Fused multiply-add (FMA) macros: + * HYPRE_SMMFUSE_* - Perform the actual fused multiply-add for each product type. + * - _UP_TO_N macros: Recursively expand to perform N fused operations in sequence. + * + * Usage pattern in computation: + * ----------------------------- + * 1. Declare variables for all fused products using the appropriate DECLARE macro. + * 2. For each block of products (up to HYPRE_FUSE_MAXDEPTH): + * a. Load variables using the LOAD_*VARS_UP_TO macro. + * b. Use a BoxLoop to iterate over the grid and apply the FMA sequence macro. + *--------------------------------------------------------------------------*/ + +/* Variable declaration macros */ +#define HYPRE_SMMFUSE_DECLARE_MPTR(k) \ + HYPRE_Complex *mptr_##k + +#define HYPRE_SMMFUSE_DECLARE_3VARS(k) \ + HYPRE_Complex *tptrs_##k##_0, cprod_##k, *mptr_##k + +#define HYPRE_SMMFUSE_DECLARE_3P(k, p) \ + HYPRE_Complex *tptrs_##p##_##k##_0, cprod_##p##_##k, *mptr_##p##_##k + +#define HYPRE_SMMFUSE_DECLARE_4VARS(k) \ + HYPRE_Complex *tptrs_##k##_0, *tptrs_##k##_1, cprod_##k, *mptr_##k + +#define HYPRE_SMMFUSE_DECLARE_4P(k, p) \ + HYPRE_Complex *tptrs_##p##_##k##_0, *tptrs_##p##_##k##_1; \ + HYPRE_Complex cprod_##p##_##k, *mptr_##p##_##k + +#define HYPRE_SMMFUSE_DECLARE_5VARS(k) \ + HYPRE_Complex *tptrs_##k##_0, *tptrs_##k##_1, *tptrs_##k##_2, cprod_##k, *mptr_##k + +#define HYPRE_SMMFUSE_DECLARE_5P(k, p) \ + HYPRE_Complex *tptrs_##p##_##k##_0, *tptrs_##p##_##k##_1, *tptrs_##p##_##k##_2; \ + HYPRE_Complex cprod_##p##_##k, *mptr_##p##_##k + +#define HYPRE_SMMFUSE_DECLARE_MPTRS_UP_TO_27 \ + HYPRE_SMMFUSE_DECLARE_MPTR(0); \ + HYPRE_SMMFUSE_DECLARE_MPTR(1); \ + HYPRE_SMMFUSE_DECLARE_MPTR(2); \ + HYPRE_SMMFUSE_DECLARE_MPTR(3); \ + HYPRE_SMMFUSE_DECLARE_MPTR(4); \ + HYPRE_SMMFUSE_DECLARE_MPTR(5); \ + HYPRE_SMMFUSE_DECLARE_MPTR(6); \ + HYPRE_SMMFUSE_DECLARE_MPTR(7); \ + HYPRE_SMMFUSE_DECLARE_MPTR(8); \ + HYPRE_SMMFUSE_DECLARE_MPTR(9); \ + HYPRE_SMMFUSE_DECLARE_MPTR(10); \ + HYPRE_SMMFUSE_DECLARE_MPTR(11); \ + HYPRE_SMMFUSE_DECLARE_MPTR(12); \ + HYPRE_SMMFUSE_DECLARE_MPTR(13); \ + HYPRE_SMMFUSE_DECLARE_MPTR(14); \ + HYPRE_SMMFUSE_DECLARE_MPTR(15); \ + HYPRE_SMMFUSE_DECLARE_MPTR(16); \ + HYPRE_SMMFUSE_DECLARE_MPTR(17); \ + HYPRE_SMMFUSE_DECLARE_MPTR(18); \ + HYPRE_SMMFUSE_DECLARE_MPTR(19); \ + HYPRE_SMMFUSE_DECLARE_MPTR(20); \ + HYPRE_SMMFUSE_DECLARE_MPTR(21); \ + HYPRE_SMMFUSE_DECLARE_MPTR(22); \ + HYPRE_SMMFUSE_DECLARE_MPTR(23); \ + HYPRE_SMMFUSE_DECLARE_MPTR(24); \ + HYPRE_SMMFUSE_DECLARE_MPTR(25); \ + HYPRE_SMMFUSE_DECLARE_MPTR(26) + +#define HYPRE_SMMFUSE_DECLARE_FCC_UP_TO_36 \ + HYPRE_SMMFUSE_DECLARE_5P(0, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(1, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(2, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(3, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(4, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(5, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(6, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(7, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(8, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(9, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(10, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(11, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(12, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(13, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(14, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(15, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(16, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(17, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(18, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(19, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(20, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(21, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(22, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(23, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(24, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(25, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(26, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(27, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(28, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(29, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(30, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(31, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(32, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(33, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(34, fcc); \ + HYPRE_SMMFUSE_DECLARE_5P(35, fcc) + +#define HYPRE_SMMFUSE_DECLARE_FC_UP_TO_72 \ + HYPRE_SMMFUSE_DECLARE_4P(0, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(1, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(2, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(3, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(4, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(5, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(6, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(7, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(8, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(9, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(10, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(11, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(12, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(13, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(14, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(15, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(16, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(17, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(18, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(19, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(20, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(21, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(22, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(23, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(24, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(25, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(26, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(27, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(28, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(29, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(30, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(31, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(32, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(33, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(34, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(35, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(36, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(37, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(38, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(39, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(40, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(41, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(42, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(43, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(44, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(45, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(46, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(47, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(48, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(49, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(50, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(51, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(52, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(53, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(54, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(55, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(56, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(57, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(58, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(59, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(60, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(61, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(62, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(63, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(64, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(65, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(66, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(67, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(68, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(69, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(70, fc); \ + HYPRE_SMMFUSE_DECLARE_4P(71, fc) + +#define HYPRE_SMMFUSE_DECLARE_F_UP_TO_9 \ + HYPRE_SMMFUSE_DECLARE_3P(0, f); \ + HYPRE_SMMFUSE_DECLARE_3P(1, f); \ + HYPRE_SMMFUSE_DECLARE_3P(2, f); \ + HYPRE_SMMFUSE_DECLARE_3P(3, f); \ + HYPRE_SMMFUSE_DECLARE_3P(4, f); \ + HYPRE_SMMFUSE_DECLARE_3P(5, f); \ + HYPRE_SMMFUSE_DECLARE_3P(6, f); \ + HYPRE_SMMFUSE_DECLARE_3P(7, f); \ + HYPRE_SMMFUSE_DECLARE_3P(8, f) + +#define HYPRE_SMMFUSE_DECLARE_20_3VARS \ + HYPRE_SMMFUSE_DECLARE_3VARS(0); \ + HYPRE_SMMFUSE_DECLARE_3VARS(1); \ + HYPRE_SMMFUSE_DECLARE_3VARS(2); \ + HYPRE_SMMFUSE_DECLARE_3VARS(3); \ + HYPRE_SMMFUSE_DECLARE_3VARS(4); \ + HYPRE_SMMFUSE_DECLARE_3VARS(5); \ + HYPRE_SMMFUSE_DECLARE_3VARS(6); \ + HYPRE_SMMFUSE_DECLARE_3VARS(7); \ + HYPRE_SMMFUSE_DECLARE_3VARS(8); \ + HYPRE_SMMFUSE_DECLARE_3VARS(9); \ + HYPRE_SMMFUSE_DECLARE_3VARS(10); \ + HYPRE_SMMFUSE_DECLARE_3VARS(11); \ + HYPRE_SMMFUSE_DECLARE_3VARS(12); \ + HYPRE_SMMFUSE_DECLARE_3VARS(13); \ + HYPRE_SMMFUSE_DECLARE_3VARS(14); \ + HYPRE_SMMFUSE_DECLARE_3VARS(15); \ + HYPRE_SMMFUSE_DECLARE_3VARS(16); \ + HYPRE_SMMFUSE_DECLARE_3VARS(17); \ + HYPRE_SMMFUSE_DECLARE_3VARS(18); \ + HYPRE_SMMFUSE_DECLARE_3VARS(19); + +#define HYPRE_SMMFUSE_DECLARE_20_4VARS \ + HYPRE_SMMFUSE_DECLARE_4VARS(0); \ + HYPRE_SMMFUSE_DECLARE_4VARS(1); \ + HYPRE_SMMFUSE_DECLARE_4VARS(2); \ + HYPRE_SMMFUSE_DECLARE_4VARS(3); \ + HYPRE_SMMFUSE_DECLARE_4VARS(4); \ + HYPRE_SMMFUSE_DECLARE_4VARS(5); \ + HYPRE_SMMFUSE_DECLARE_4VARS(6); \ + HYPRE_SMMFUSE_DECLARE_4VARS(7); \ + HYPRE_SMMFUSE_DECLARE_4VARS(8); \ + HYPRE_SMMFUSE_DECLARE_4VARS(9); \ + HYPRE_SMMFUSE_DECLARE_4VARS(10); \ + HYPRE_SMMFUSE_DECLARE_4VARS(11); \ + HYPRE_SMMFUSE_DECLARE_4VARS(12); \ + HYPRE_SMMFUSE_DECLARE_4VARS(13); \ + HYPRE_SMMFUSE_DECLARE_4VARS(14); \ + HYPRE_SMMFUSE_DECLARE_4VARS(15); \ + HYPRE_SMMFUSE_DECLARE_4VARS(16); \ + HYPRE_SMMFUSE_DECLARE_4VARS(17); \ + HYPRE_SMMFUSE_DECLARE_4VARS(18); \ + HYPRE_SMMFUSE_DECLARE_4VARS(19) + +#define HYPRE_SMMFUSE_DECLARE_20_5VARS \ + HYPRE_SMMFUSE_DECLARE_5VARS(0); \ + HYPRE_SMMFUSE_DECLARE_5VARS(1); \ + HYPRE_SMMFUSE_DECLARE_5VARS(2); \ + HYPRE_SMMFUSE_DECLARE_5VARS(3); \ + HYPRE_SMMFUSE_DECLARE_5VARS(4); \ + HYPRE_SMMFUSE_DECLARE_5VARS(5); \ + HYPRE_SMMFUSE_DECLARE_5VARS(6); \ + HYPRE_SMMFUSE_DECLARE_5VARS(7); \ + HYPRE_SMMFUSE_DECLARE_5VARS(8); \ + HYPRE_SMMFUSE_DECLARE_5VARS(9); \ + HYPRE_SMMFUSE_DECLARE_5VARS(10); \ + HYPRE_SMMFUSE_DECLARE_5VARS(11); \ + HYPRE_SMMFUSE_DECLARE_5VARS(12); \ + HYPRE_SMMFUSE_DECLARE_5VARS(13); \ + HYPRE_SMMFUSE_DECLARE_5VARS(14); \ + HYPRE_SMMFUSE_DECLARE_5VARS(15); \ + HYPRE_SMMFUSE_DECLARE_5VARS(16); \ + HYPRE_SMMFUSE_DECLARE_5VARS(17); \ + HYPRE_SMMFUSE_DECLARE_5VARS(18); \ + HYPRE_SMMFUSE_DECLARE_5VARS(19) + +/* Variable loading macros for different patterns */ +#define HYPRE_SMMFUSE_LOAD_5VARS(k, m) \ + cprod_##m = cprod[(k + m)]; \ + mptr_##m = mptrs[(k + m)]; \ + tptrs_##m##_0 = tptrs[(k + m)][0]; \ + tptrs_##m##_1 = tptrs[(k + m)][1]; \ + tptrs_##m##_2 = tptrs[(k + m)][2] + +#define HYPRE_SMMFUSE_LOAD_5P(k, p) \ + cprod_##p##_##k = cprod_##p[k]; \ + mptr_##p##_##k = mptrs_##p[k]; \ + tptrs_##p##_##k##_0 = tptrs_##p[k][0]; \ + tptrs_##p##_##k##_1 = tptrs_##p[k][1]; \ + tptrs_##p##_##k##_2 = tptrs_##p[k][2] + +#define HYPRE_SMMFUSE_LOAD_4VARS(k, m) \ + cprod_##m = cprod[(k + m)]; \ + mptr_##m = mptrs[(k + m)]; \ + tptrs_##m##_0 = tptrs[(k + m)][0]; \ + tptrs_##m##_1 = tptrs[(k + m)][1] + +#define HYPRE_SMMFUSE_LOAD_4P(k, p) \ + cprod_##p##_##k = cprod_##p[k]; \ + mptr_##p##_##k = mptrs_##p[k]; \ + tptrs_##p##_##k##_0 = tptrs_##p[k][0]; \ + tptrs_##p##_##k##_1 = tptrs_##p[k][1] + +#define HYPRE_SMMFUSE_LOAD_3VARS(k, m) \ + cprod_##m = cprod[(k + m)]; \ + mptr_##m = mptrs[(k + m)]; \ + tptrs_##m##_0 = tptrs[(k + m)][0] + +#define HYPRE_SMMFUSE_LOAD_3P(k, p) \ + cprod_##p##_##k = cprod_##p[k]; \ + mptr_##p##_##k = mptrs_##p[k]; \ + tptrs_##p##_##k##_0 = tptrs_##p[k][0] + +#define HYPRE_SMMFUSE_LOAD_MPTR(k) \ + mptr_##k = mptrs[k] + +#define HYPRE_SMMFUSE_LOAD_MPTRS_UP_TO_8 \ + HYPRE_SMMFUSE_LOAD_MPTR(0); \ + HYPRE_SMMFUSE_LOAD_MPTR(1); \ + HYPRE_SMMFUSE_LOAD_MPTR(2); \ + HYPRE_SMMFUSE_LOAD_MPTR(3); \ + HYPRE_SMMFUSE_LOAD_MPTR(4); \ + HYPRE_SMMFUSE_LOAD_MPTR(5); \ + HYPRE_SMMFUSE_LOAD_MPTR(6); \ + HYPRE_SMMFUSE_LOAD_MPTR(7) + +#define HYPRE_SMMFUSE_LOAD_MPTRS_UP_TO_14 \ + HYPRE_SMMFUSE_LOAD_MPTRS_UP_TO_8; \ + HYPRE_SMMFUSE_LOAD_MPTR(8); \ + HYPRE_SMMFUSE_LOAD_MPTR(9); \ + HYPRE_SMMFUSE_LOAD_MPTR(10); \ + HYPRE_SMMFUSE_LOAD_MPTR(11); \ + HYPRE_SMMFUSE_LOAD_MPTR(12); \ + HYPRE_SMMFUSE_LOAD_MPTR(13) + +#define HYPRE_SMMFUSE_LOAD_MPTRS_UP_TO_15 \ + HYPRE_SMMFUSE_LOAD_MPTRS_UP_TO_14; \ + HYPRE_SMMFUSE_LOAD_MPTR(14) + +#define HYPRE_SMMFUSE_LOAD_MPTRS_UP_TO_27 \ + HYPRE_SMMFUSE_LOAD_MPTRS_UP_TO_15; \ + HYPRE_SMMFUSE_LOAD_MPTR(15); \ + HYPRE_SMMFUSE_LOAD_MPTR(16); \ + HYPRE_SMMFUSE_LOAD_MPTR(17); \ + HYPRE_SMMFUSE_LOAD_MPTR(18); \ + HYPRE_SMMFUSE_LOAD_MPTR(19); \ + HYPRE_SMMFUSE_LOAD_MPTR(20); \ + HYPRE_SMMFUSE_LOAD_MPTR(21); \ + HYPRE_SMMFUSE_LOAD_MPTR(22); \ + HYPRE_SMMFUSE_LOAD_MPTR(23); \ + HYPRE_SMMFUSE_LOAD_MPTR(24); \ + HYPRE_SMMFUSE_LOAD_MPTR(25); \ + HYPRE_SMMFUSE_LOAD_MPTR(26) + +#define HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, n, ...) \ + HYPRE_SMMFUSE_LOAD_3VARS_IMPL_##n(k, __VA_ARGS__) + +#define HYPRE_SMMFUSE_LOAD_3VARS_IMPL_1(k, ...) \ + HYPRE_SMMFUSE_LOAD_3VARS(k, 0) + +#define HYPRE_SMMFUSE_LOAD_3VARS_IMPL_2(k, ...) \ + HYPRE_SMMFUSE_LOAD_3VARS(k, 0); \ + HYPRE_SMMFUSE_LOAD_3VARS(k, 1) + +#define HYPRE_SMMFUSE_LOAD_3VARS_IMPL_3(k, ...) \ + HYPRE_SMMFUSE_LOAD_3VARS_IMPL_2(k); \ + HYPRE_SMMFUSE_LOAD_3VARS(k, 2) + +#define HYPRE_SMMFUSE_LOAD_3VARS_IMPL_4(k, ...) \ + HYPRE_SMMFUSE_LOAD_3VARS_IMPL_3(k); \ + HYPRE_SMMFUSE_LOAD_3VARS(k, 3) + +#define HYPRE_SMMFUSE_LOAD_3VARS_IMPL_5(k, ...) \ + HYPRE_SMMFUSE_LOAD_3VARS_IMPL_4(k); \ + HYPRE_SMMFUSE_LOAD_3VARS(k, 4) + +#define HYPRE_SMMFUSE_LOAD_3VARS_IMPL_6(k, ...) \ + HYPRE_SMMFUSE_LOAD_3VARS_IMPL_5(k); \ + HYPRE_SMMFUSE_LOAD_3VARS(k, 5) + +#define HYPRE_SMMFUSE_LOAD_3VARS_IMPL_7(k, ...) \ + HYPRE_SMMFUSE_LOAD_3VARS_IMPL_6(k); \ + HYPRE_SMMFUSE_LOAD_3VARS(k, 6) + +#define HYPRE_SMMFUSE_LOAD_3VARS_IMPL_8(k, ...) \ + HYPRE_SMMFUSE_LOAD_3VARS_IMPL_7(k); \ + HYPRE_SMMFUSE_LOAD_3VARS(k, 7) + +#define HYPRE_SMMFUSE_LOAD_3VARS_IMPL_9(k, ...) \ + HYPRE_SMMFUSE_LOAD_3VARS_IMPL_8(k); \ + HYPRE_SMMFUSE_LOAD_3VARS(k, 8) + +#define HYPRE_SMMFUSE_LOAD_3VARS_IMPL_10(k, ...) \ + HYPRE_SMMFUSE_LOAD_3VARS_IMPL_9(k); \ + HYPRE_SMMFUSE_LOAD_3VARS(k, 9) + +#define HYPRE_SMMFUSE_LOAD_3VARS_IMPL_11(k, ...) \ + HYPRE_SMMFUSE_LOAD_3VARS_IMPL_10(k); \ + HYPRE_SMMFUSE_LOAD_3VARS(k, 10) + +#define HYPRE_SMMFUSE_LOAD_3VARS_IMPL_12(k, ...) \ + HYPRE_SMMFUSE_LOAD_3VARS_IMPL_11(k); \ + HYPRE_SMMFUSE_LOAD_3VARS(k, 11) + +#define HYPRE_SMMFUSE_LOAD_3VARS_IMPL_13(k, ...) \ + HYPRE_SMMFUSE_LOAD_3VARS_IMPL_12(k); \ + HYPRE_SMMFUSE_LOAD_3VARS(k, 12) + +#define HYPRE_SMMFUSE_LOAD_3VARS_IMPL_14(k, ...) \ + HYPRE_SMMFUSE_LOAD_3VARS_IMPL_13(k); \ + HYPRE_SMMFUSE_LOAD_3VARS(k, 13) + +#define HYPRE_SMMFUSE_LOAD_3VARS_IMPL_15(k, ...) \ + HYPRE_SMMFUSE_LOAD_3VARS_IMPL_14(k); \ + HYPRE_SMMFUSE_LOAD_3VARS(k, 14) + +#define HYPRE_SMMFUSE_LOAD_3VARS_IMPL_16(k, ...) \ + HYPRE_SMMFUSE_LOAD_3VARS_IMPL_15(k); \ + HYPRE_SMMFUSE_LOAD_3VARS(k, 15) + +#define HYPRE_SMMFUSE_LOAD_3VARS_IMPL_17(k, ...) \ + HYPRE_SMMFUSE_LOAD_3VARS_IMPL_16(k); \ + HYPRE_SMMFUSE_LOAD_3VARS(k, 16) + +#define HYPRE_SMMFUSE_LOAD_3VARS_IMPL_18(k, ...) \ + HYPRE_SMMFUSE_LOAD_3VARS_IMPL_17(k); \ + HYPRE_SMMFUSE_LOAD_3VARS(k, 17) + +#define HYPRE_SMMFUSE_LOAD_3VARS_IMPL_19(k, ...) \ + HYPRE_SMMFUSE_LOAD_3VARS_IMPL_18(k); \ + HYPRE_SMMFUSE_LOAD_3VARS(k, 18) + +#define HYPRE_SMMFUSE_LOAD_3VARS_IMPL_20(k, ...) \ + HYPRE_SMMFUSE_LOAD_3VARS_IMPL_19(k); \ + HYPRE_SMMFUSE_LOAD_3VARS(k, 19) + +#define HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, n, ...) \ + HYPRE_SMMFUSE_LOAD_4VARS_IMPL_##n(k, __VA_ARGS__) + +#define HYPRE_SMMFUSE_LOAD_4VARS_IMPL_1(k, ...) \ + HYPRE_SMMFUSE_LOAD_4VARS(k, 0) + +#define HYPRE_SMMFUSE_LOAD_4VARS_IMPL_2(k, ...) \ + HYPRE_SMMFUSE_LOAD_4VARS(k, 0); \ + HYPRE_SMMFUSE_LOAD_4VARS(k, 1) + +#define HYPRE_SMMFUSE_LOAD_4VARS_IMPL_3(k, ...) \ + HYPRE_SMMFUSE_LOAD_4VARS_IMPL_2(k); \ + HYPRE_SMMFUSE_LOAD_4VARS(k, 2) + +#define HYPRE_SMMFUSE_LOAD_4VARS_IMPL_4(k, ...) \ + HYPRE_SMMFUSE_LOAD_4VARS_IMPL_3(k); \ + HYPRE_SMMFUSE_LOAD_4VARS(k, 3) + +#define HYPRE_SMMFUSE_LOAD_4VARS_IMPL_5(k, ...) \ + HYPRE_SMMFUSE_LOAD_4VARS_IMPL_4(k); \ + HYPRE_SMMFUSE_LOAD_4VARS(k, 4) + +#define HYPRE_SMMFUSE_LOAD_4VARS_IMPL_6(k, ...) \ + HYPRE_SMMFUSE_LOAD_4VARS_IMPL_5(k); \ + HYPRE_SMMFUSE_LOAD_4VARS(k, 5) + +#define HYPRE_SMMFUSE_LOAD_4VARS_IMPL_7(k, ...) \ + HYPRE_SMMFUSE_LOAD_4VARS_IMPL_6(k); \ + HYPRE_SMMFUSE_LOAD_4VARS(k, 6) + +#define HYPRE_SMMFUSE_LOAD_4VARS_IMPL_8(k, ...) \ + HYPRE_SMMFUSE_LOAD_4VARS_IMPL_7(k); \ + HYPRE_SMMFUSE_LOAD_4VARS(k, 7) + +#define HYPRE_SMMFUSE_LOAD_4VARS_IMPL_9(k, ...) \ + HYPRE_SMMFUSE_LOAD_4VARS_IMPL_8(k); \ + HYPRE_SMMFUSE_LOAD_4VARS(k, 8) + +#define HYPRE_SMMFUSE_LOAD_4VARS_IMPL_10(k, ...) \ + HYPRE_SMMFUSE_LOAD_4VARS_IMPL_9(k); \ + HYPRE_SMMFUSE_LOAD_4VARS(k, 9) + +#define HYPRE_SMMFUSE_LOAD_4VARS_IMPL_11(k, ...) \ + HYPRE_SMMFUSE_LOAD_4VARS_IMPL_10(k); \ + HYPRE_SMMFUSE_LOAD_4VARS(k, 10) + +#define HYPRE_SMMFUSE_LOAD_4VARS_IMPL_12(k, ...) \ + HYPRE_SMMFUSE_LOAD_4VARS_IMPL_11(k); \ + HYPRE_SMMFUSE_LOAD_4VARS(k, 11) + +#define HYPRE_SMMFUSE_LOAD_4VARS_IMPL_13(k, ...) \ + HYPRE_SMMFUSE_LOAD_4VARS_IMPL_12(k); \ + HYPRE_SMMFUSE_LOAD_4VARS(k, 12) + +#define HYPRE_SMMFUSE_LOAD_4VARS_IMPL_14(k, ...) \ + HYPRE_SMMFUSE_LOAD_4VARS_IMPL_13(k); \ + HYPRE_SMMFUSE_LOAD_4VARS(k, 13) + +#define HYPRE_SMMFUSE_LOAD_4VARS_IMPL_15(k, ...) \ + HYPRE_SMMFUSE_LOAD_4VARS_IMPL_14(k); \ + HYPRE_SMMFUSE_LOAD_4VARS(k, 14) + +#define HYPRE_SMMFUSE_LOAD_4VARS_IMPL_16(k, ...) \ + HYPRE_SMMFUSE_LOAD_4VARS_IMPL_15(k); \ + HYPRE_SMMFUSE_LOAD_4VARS(k, 15) + +#define HYPRE_SMMFUSE_LOAD_4VARS_IMPL_17(k, ...) \ + HYPRE_SMMFUSE_LOAD_4VARS_IMPL_16(k); \ + HYPRE_SMMFUSE_LOAD_4VARS(k, 16) + +#define HYPRE_SMMFUSE_LOAD_4VARS_IMPL_18(k, ...) \ + HYPRE_SMMFUSE_LOAD_4VARS_IMPL_17(k); \ + HYPRE_SMMFUSE_LOAD_4VARS(k, 17) + +#define HYPRE_SMMFUSE_LOAD_4VARS_IMPL_19(k, ...) \ + HYPRE_SMMFUSE_LOAD_4VARS_IMPL_18(k); \ + HYPRE_SMMFUSE_LOAD_4VARS(k, 18) + +#define HYPRE_SMMFUSE_LOAD_4VARS_IMPL_20(k, ...) \ + HYPRE_SMMFUSE_LOAD_4VARS_IMPL_19(k); \ + HYPRE_SMMFUSE_LOAD_4VARS(k, 19) + +#define HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, n, ...) \ + HYPRE_SMMFUSE_LOAD_5VARS_IMPL_##n(k, __VA_ARGS__) + +#define HYPRE_SMMFUSE_LOAD_5VARS_IMPL_1(k, ...) \ + HYPRE_SMMFUSE_LOAD_5VARS(k, 0) + +#define HYPRE_SMMFUSE_LOAD_5VARS_IMPL_2(k, ...) \ + HYPRE_SMMFUSE_LOAD_5VARS(k, 0); \ + HYPRE_SMMFUSE_LOAD_5VARS(k, 1) + +#define HYPRE_SMMFUSE_LOAD_5VARS_IMPL_3(k, ...) \ + HYPRE_SMMFUSE_LOAD_5VARS_IMPL_2(k); \ + HYPRE_SMMFUSE_LOAD_5VARS(k, 2) + +#define HYPRE_SMMFUSE_LOAD_5VARS_IMPL_4(k, ...) \ + HYPRE_SMMFUSE_LOAD_5VARS_IMPL_3(k); \ + HYPRE_SMMFUSE_LOAD_5VARS(k, 3) + +#define HYPRE_SMMFUSE_LOAD_5VARS_IMPL_5(k, ...) \ + HYPRE_SMMFUSE_LOAD_5VARS_IMPL_4(k); \ + HYPRE_SMMFUSE_LOAD_5VARS(k, 4) + +#define HYPRE_SMMFUSE_LOAD_5VARS_IMPL_6(k, ...) \ + HYPRE_SMMFUSE_LOAD_5VARS_IMPL_5(k); \ + HYPRE_SMMFUSE_LOAD_5VARS(k, 5) + +#define HYPRE_SMMFUSE_LOAD_5VARS_IMPL_7(k, ...) \ + HYPRE_SMMFUSE_LOAD_5VARS_IMPL_6(k); \ + HYPRE_SMMFUSE_LOAD_5VARS(k, 6) + +#define HYPRE_SMMFUSE_LOAD_5VARS_IMPL_8(k, ...) \ + HYPRE_SMMFUSE_LOAD_5VARS_IMPL_7(k); \ + HYPRE_SMMFUSE_LOAD_5VARS(k, 7) + +#define HYPRE_SMMFUSE_LOAD_5VARS_IMPL_9(k, ...) \ + HYPRE_SMMFUSE_LOAD_5VARS_IMPL_8(k); \ + HYPRE_SMMFUSE_LOAD_5VARS(k, 8) + +#define HYPRE_SMMFUSE_LOAD_5VARS_IMPL_10(k, ...) \ + HYPRE_SMMFUSE_LOAD_5VARS_IMPL_9(k); \ + HYPRE_SMMFUSE_LOAD_5VARS(k, 9) + +#define HYPRE_SMMFUSE_LOAD_5VARS_IMPL_11(k, ...) \ + HYPRE_SMMFUSE_LOAD_5VARS_IMPL_10(k); \ + HYPRE_SMMFUSE_LOAD_5VARS(k, 10) + +#define HYPRE_SMMFUSE_LOAD_5VARS_IMPL_12(k, ...) \ + HYPRE_SMMFUSE_LOAD_5VARS_IMPL_11(k); \ + HYPRE_SMMFUSE_LOAD_5VARS(k, 11) + +#define HYPRE_SMMFUSE_LOAD_5VARS_IMPL_13(k, ...) \ + HYPRE_SMMFUSE_LOAD_5VARS_IMPL_12(k); \ + HYPRE_SMMFUSE_LOAD_5VARS(k, 12) + +#define HYPRE_SMMFUSE_LOAD_5VARS_IMPL_14(k, ...) \ + HYPRE_SMMFUSE_LOAD_5VARS_IMPL_13(k); \ + HYPRE_SMMFUSE_LOAD_5VARS(k, 13) + +#define HYPRE_SMMFUSE_LOAD_5VARS_IMPL_15(k, ...) \ + HYPRE_SMMFUSE_LOAD_5VARS_IMPL_14(k); \ + HYPRE_SMMFUSE_LOAD_5VARS(k, 14) + +#define HYPRE_SMMFUSE_LOAD_5VARS_IMPL_16(k, ...) \ + HYPRE_SMMFUSE_LOAD_5VARS_IMPL_15(k); \ + HYPRE_SMMFUSE_LOAD_5VARS(k, 15) + +#define HYPRE_SMMFUSE_LOAD_5VARS_IMPL_17(k, ...) \ + HYPRE_SMMFUSE_LOAD_5VARS_IMPL_16(k); \ + HYPRE_SMMFUSE_LOAD_5VARS(k, 16) + +#define HYPRE_SMMFUSE_LOAD_5VARS_IMPL_18(k, ...) \ + HYPRE_SMMFUSE_LOAD_5VARS_IMPL_17(k); \ + HYPRE_SMMFUSE_LOAD_5VARS(k, 17) + +#define HYPRE_SMMFUSE_LOAD_5VARS_IMPL_19(k, ...) \ + HYPRE_SMMFUSE_LOAD_5VARS_IMPL_18(k); \ + HYPRE_SMMFUSE_LOAD_5VARS(k, 18) + +#define HYPRE_SMMFUSE_LOAD_5VARS_IMPL_20(k, ...) \ + HYPRE_SMMFUSE_LOAD_5VARS_IMPL_19(k); \ + HYPRE_SMMFUSE_LOAD_5VARS(k, 19) + +#define HYPRE_SMMFUSE_LOAD_F_UP_TO_3 \ + HYPRE_SMMFUSE_LOAD_3P(0, f); \ + HYPRE_SMMFUSE_LOAD_3P(1, f); \ + HYPRE_SMMFUSE_LOAD_3P(2, f) + +#define HYPRE_SMMFUSE_LOAD_F_UP_TO_5 \ + HYPRE_SMMFUSE_LOAD_F_UP_TO_3; \ + HYPRE_SMMFUSE_LOAD_3P(3, f); \ + HYPRE_SMMFUSE_LOAD_3P(4, f) + +#define HYPRE_SMMFUSE_LOAD_F_UP_TO_9 \ + HYPRE_SMMFUSE_LOAD_F_UP_TO_5; \ + HYPRE_SMMFUSE_LOAD_3P(5, f); \ + HYPRE_SMMFUSE_LOAD_3P(6, f); \ + HYPRE_SMMFUSE_LOAD_3P(7, f); \ + HYPRE_SMMFUSE_LOAD_3P(8, f) + +#define HYPRE_SMMFUSE_LOAD_FC_UP_TO_6 \ + HYPRE_SMMFUSE_LOAD_4P(0, fc); \ + HYPRE_SMMFUSE_LOAD_4P(1, fc); \ + HYPRE_SMMFUSE_LOAD_4P(2, fc); \ + HYPRE_SMMFUSE_LOAD_4P(3, fc); \ + HYPRE_SMMFUSE_LOAD_4P(4, fc); \ + HYPRE_SMMFUSE_LOAD_4P(5, fc) + +#define HYPRE_SMMFUSE_LOAD_FC_UP_TO_8 \ + HYPRE_SMMFUSE_LOAD_FC_UP_TO_6; \ + HYPRE_SMMFUSE_LOAD_4P(6, fc); \ + HYPRE_SMMFUSE_LOAD_4P(7, fc) + +#define HYPRE_SMMFUSE_LOAD_FC_UP_TO_14 \ + HYPRE_SMMFUSE_LOAD_FC_UP_TO_8; \ + HYPRE_SMMFUSE_LOAD_4P(8, fc); \ + HYPRE_SMMFUSE_LOAD_4P(9, fc); \ + HYPRE_SMMFUSE_LOAD_4P(10, fc); \ + HYPRE_SMMFUSE_LOAD_4P(11, fc); \ + HYPRE_SMMFUSE_LOAD_4P(12, fc); \ + HYPRE_SMMFUSE_LOAD_4P(13, fc) + +#define HYPRE_SMMFUSE_LOAD_FC_UP_TO_24 \ + HYPRE_SMMFUSE_LOAD_FC_UP_TO_8; \ + HYPRE_SMMFUSE_LOAD_4P(8, fc); \ + HYPRE_SMMFUSE_LOAD_4P(9, fc); \ + HYPRE_SMMFUSE_LOAD_4P(10, fc); \ + HYPRE_SMMFUSE_LOAD_4P(11, fc); \ + HYPRE_SMMFUSE_LOAD_4P(12, fc); \ + HYPRE_SMMFUSE_LOAD_4P(13, fc); \ + HYPRE_SMMFUSE_LOAD_4P(14, fc); \ + HYPRE_SMMFUSE_LOAD_4P(15, fc); \ + HYPRE_SMMFUSE_LOAD_4P(16, fc); \ + HYPRE_SMMFUSE_LOAD_4P(17, fc); \ + HYPRE_SMMFUSE_LOAD_4P(18, fc); \ + HYPRE_SMMFUSE_LOAD_4P(19, fc); \ + HYPRE_SMMFUSE_LOAD_4P(20, fc); \ + HYPRE_SMMFUSE_LOAD_4P(21, fc); \ + HYPRE_SMMFUSE_LOAD_4P(22, fc); \ + HYPRE_SMMFUSE_LOAD_4P(23, fc) + +#define HYPRE_SMMFUSE_LOAD_FC_UP_TO_38 \ + HYPRE_SMMFUSE_LOAD_FC_UP_TO_24; \ + HYPRE_SMMFUSE_LOAD_4P(24, fc); \ + HYPRE_SMMFUSE_LOAD_4P(25, fc); \ + HYPRE_SMMFUSE_LOAD_4P(26, fc); \ + HYPRE_SMMFUSE_LOAD_4P(27, fc); \ + HYPRE_SMMFUSE_LOAD_4P(28, fc); \ + HYPRE_SMMFUSE_LOAD_4P(29, fc); \ + HYPRE_SMMFUSE_LOAD_4P(30, fc); \ + HYPRE_SMMFUSE_LOAD_4P(31, fc); \ + HYPRE_SMMFUSE_LOAD_4P(32, fc); \ + HYPRE_SMMFUSE_LOAD_4P(33, fc); \ + HYPRE_SMMFUSE_LOAD_4P(34, fc); \ + HYPRE_SMMFUSE_LOAD_4P(35, fc); \ + HYPRE_SMMFUSE_LOAD_4P(36, fc); \ + HYPRE_SMMFUSE_LOAD_4P(37, fc) + +#define HYPRE_SMMFUSE_LOAD_FC_UP_TO_72 \ + HYPRE_SMMFUSE_LOAD_FC_UP_TO_38; \ + HYPRE_SMMFUSE_LOAD_4P(38, fc); \ + HYPRE_SMMFUSE_LOAD_4P(39, fc); \ + HYPRE_SMMFUSE_LOAD_4P(40, fc); \ + HYPRE_SMMFUSE_LOAD_4P(41, fc); \ + HYPRE_SMMFUSE_LOAD_4P(42, fc); \ + HYPRE_SMMFUSE_LOAD_4P(43, fc); \ + HYPRE_SMMFUSE_LOAD_4P(44, fc); \ + HYPRE_SMMFUSE_LOAD_4P(45, fc); \ + HYPRE_SMMFUSE_LOAD_4P(46, fc); \ + HYPRE_SMMFUSE_LOAD_4P(47, fc); \ + HYPRE_SMMFUSE_LOAD_4P(48, fc); \ + HYPRE_SMMFUSE_LOAD_4P(49, fc); \ + HYPRE_SMMFUSE_LOAD_4P(50, fc); \ + HYPRE_SMMFUSE_LOAD_4P(51, fc); \ + HYPRE_SMMFUSE_LOAD_4P(52, fc); \ + HYPRE_SMMFUSE_LOAD_4P(53, fc); \ + HYPRE_SMMFUSE_LOAD_4P(54, fc); \ + HYPRE_SMMFUSE_LOAD_4P(55, fc); \ + HYPRE_SMMFUSE_LOAD_4P(56, fc); \ + HYPRE_SMMFUSE_LOAD_4P(57, fc); \ + HYPRE_SMMFUSE_LOAD_4P(58, fc); \ + HYPRE_SMMFUSE_LOAD_4P(59, fc); \ + HYPRE_SMMFUSE_LOAD_4P(60, fc); \ + HYPRE_SMMFUSE_LOAD_4P(61, fc); \ + HYPRE_SMMFUSE_LOAD_4P(62, fc); \ + HYPRE_SMMFUSE_LOAD_4P(63, fc); \ + HYPRE_SMMFUSE_LOAD_4P(64, fc); \ + HYPRE_SMMFUSE_LOAD_4P(65, fc); \ + HYPRE_SMMFUSE_LOAD_4P(66, fc); \ + HYPRE_SMMFUSE_LOAD_4P(67, fc); \ + HYPRE_SMMFUSE_LOAD_4P(68, fc); \ + HYPRE_SMMFUSE_LOAD_4P(69, fc); \ + HYPRE_SMMFUSE_LOAD_4P(70, fc); \ + HYPRE_SMMFUSE_LOAD_4P(71, fc) + +#define HYPRE_SMMFUSE_LOAD_FCC_UP_TO_11 \ + HYPRE_SMMFUSE_LOAD_5P(0, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(1, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(2, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(3, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(4, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(5, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(6, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(7, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(8, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(9, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(10, fcc) + +#define HYPRE_SMMFUSE_LOAD_FCC_UP_TO_19 \ + HYPRE_SMMFUSE_LOAD_FCC_UP_TO_11; \ + HYPRE_SMMFUSE_LOAD_5P(11, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(12, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(13, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(14, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(15, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(16, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(17, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(18, fcc) + +#define HYPRE_SMMFUSE_LOAD_FCC_UP_TO_20 \ + HYPRE_SMMFUSE_LOAD_FCC_UP_TO_19; \ + HYPRE_SMMFUSE_LOAD_5P(19, fcc) + +#define HYPRE_SMMFUSE_LOAD_FCC_UP_TO_36 \ + HYPRE_SMMFUSE_LOAD_FCC_UP_TO_20; \ + HYPRE_SMMFUSE_LOAD_5P(20, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(21, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(22, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(23, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(24, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(25, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(26, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(27, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(28, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(29, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(30, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(31, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(32, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(33, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(34, fcc); \ + HYPRE_SMMFUSE_LOAD_5P(35, fcc) + +/* Initialization macros */ +#define HYPRE_SMMFUSE_INIT_MPTR(k) \ + mptr_##k[Mi] = 0.0 + +#define HYPRE_SMMFUSE_INIT_MPTRS_UP_TO_8 \ + HYPRE_SMMFUSE_INIT_MPTR(0); \ + HYPRE_SMMFUSE_INIT_MPTR(1); \ + HYPRE_SMMFUSE_INIT_MPTR(2); \ + HYPRE_SMMFUSE_INIT_MPTR(3); \ + HYPRE_SMMFUSE_INIT_MPTR(4); \ + HYPRE_SMMFUSE_INIT_MPTR(5); \ + HYPRE_SMMFUSE_INIT_MPTR(6); \ + HYPRE_SMMFUSE_INIT_MPTR(7) + +#define HYPRE_SMMFUSE_INIT_MPTRS_UP_TO_14 \ + HYPRE_SMMFUSE_INIT_MPTRS_UP_TO_8; \ + HYPRE_SMMFUSE_INIT_MPTR(8); \ + HYPRE_SMMFUSE_INIT_MPTR(9); \ + HYPRE_SMMFUSE_INIT_MPTR(10); \ + HYPRE_SMMFUSE_INIT_MPTR(11); \ + HYPRE_SMMFUSE_INIT_MPTR(12); \ + HYPRE_SMMFUSE_INIT_MPTR(13) + +#define HYPRE_SMMFUSE_INIT_MPTRS_UP_TO_15 \ + HYPRE_SMMFUSE_INIT_MPTRS_UP_TO_14; \ + HYPRE_SMMFUSE_INIT_MPTR(14) + +#define HYPRE_SMMFUSE_INIT_MPTRS_UP_TO_27 \ + HYPRE_SMMFUSE_INIT_MPTRS_UP_TO_15; \ + HYPRE_SMMFUSE_INIT_MPTR(15); \ + HYPRE_SMMFUSE_INIT_MPTR(16); \ + HYPRE_SMMFUSE_INIT_MPTR(17); \ + HYPRE_SMMFUSE_INIT_MPTR(18); \ + HYPRE_SMMFUSE_INIT_MPTR(19); \ + HYPRE_SMMFUSE_INIT_MPTR(20); \ + HYPRE_SMMFUSE_INIT_MPTR(21); \ + HYPRE_SMMFUSE_INIT_MPTR(22); \ + HYPRE_SMMFUSE_INIT_MPTR(23); \ + HYPRE_SMMFUSE_INIT_MPTR(24); \ + HYPRE_SMMFUSE_INIT_MPTR(25); \ + HYPRE_SMMFUSE_INIT_MPTR(26) + +/* Individual fused multiply-add operations */ +#define HYPRE_SMMFUSE_FFF(k) \ + mptr_##k[Mi] += cprod_##k * tptrs_##k##_0[fi] * tptrs_##k##_1[fi] * tptrs_##k##_2[fi] + +#define HYPRE_SMMFUSE_FFC(k) \ + mptr_##k[Mi] += cprod_##k * tptrs_##k##_0[fi] * tptrs_##k##_1[fi] * tptrs_##k##_2[ci] + +#define HYPRE_SMMFUSE_FCC(k) \ + mptr_##k[Mi] += cprod_##k * tptrs_##k##_0[fi] * tptrs_##k##_1[ci] * tptrs_##k##_2[ci] + +#define HYPRE_SMMFUSE_FCC_P(k) \ + mptr_fcc_##k[Mi] += cprod_fcc_##k * tptrs_fcc_##k##_0[fi] * tptrs_fcc_##k##_1[ci] * tptrs_fcc_##k##_2[ci] + +#define HYPRE_SMMFUSE_FC(k) \ + mptr_##k[Mi] += cprod_##k * tptrs_##k##_0[fi] * tptrs_##k##_1[ci] + +#define HYPRE_SMMFUSE_FC_P(k) \ + mptr_fc_##k[Mi] += cprod_fc_##k * tptrs_fc_##k##_0[fi] * tptrs_fc_##k##_1[ci] + +#define HYPRE_SMMFUSE_CC(k) \ + mptr_##k[Mi] += cprod_##k * tptrs_##k##_0[ci] * tptrs_##k##_1[ci] + +#define HYPRE_SMMFUSE_FF(k) \ + mptr_##k[Mi] += cprod_##k * tptrs_##k##_0[fi] * tptrs_##k##_1[fi] + +#define HYPRE_SMMFUSE_F(k) \ + mptr_##k[Mi] += cprod_##k * tptrs_##k##_0[fi] + +#define HYPRE_SMMFUSE_F_P(k) \ + mptr_f_##k[Mi] += cprod_f_##k * tptrs_f_##k##_0[fi] + +#define HYPRE_SMMFUSE_C(k) \ + mptr_##k[Mi] += cprod_##k * tptrs_##k##_0[ci] + +/* Sequence macros for various fused multiply-add (FMA) operations */ +#define HYPRE_SMMFUSE_FFF_UP_TO_1 \ + HYPRE_SMMFUSE_FFF(0) + +#define HYPRE_SMMFUSE_FFF_UP_TO_2 \ + HYPRE_SMMFUSE_FFF(0); \ + HYPRE_SMMFUSE_FFF(1) + +#define HYPRE_SMMFUSE_FFF_UP_TO_3 \ + HYPRE_SMMFUSE_FFF_UP_TO_2; \ + HYPRE_SMMFUSE_FFF(2) + +#define HYPRE_SMMFUSE_FFF_UP_TO_4 \ + HYPRE_SMMFUSE_FFF_UP_TO_3; \ + HYPRE_SMMFUSE_FFF(3) + +#define HYPRE_SMMFUSE_FFF_UP_TO_5 \ + HYPRE_SMMFUSE_FFF_UP_TO_4; \ + HYPRE_SMMFUSE_FFF(4) + +#define HYPRE_SMMFUSE_FFF_UP_TO_6 \ + HYPRE_SMMFUSE_FFF_UP_TO_5; \ + HYPRE_SMMFUSE_FFF(5) + +#define HYPRE_SMMFUSE_FFF_UP_TO_7 \ + HYPRE_SMMFUSE_FFF_UP_TO_6; \ + HYPRE_SMMFUSE_FFF(6) + +#define HYPRE_SMMFUSE_FFF_UP_TO_8 \ + HYPRE_SMMFUSE_FFF_UP_TO_7; \ + HYPRE_SMMFUSE_FFF(7) + +#define HYPRE_SMMFUSE_FFF_UP_TO_9 \ + HYPRE_SMMFUSE_FFF_UP_TO_8; \ + HYPRE_SMMFUSE_FFF(8) + +#define HYPRE_SMMFUSE_FFF_UP_TO_10 \ + HYPRE_SMMFUSE_FFF_UP_TO_9; \ + HYPRE_SMMFUSE_FFF(9) + +#define HYPRE_SMMFUSE_FFF_UP_TO_11 \ + HYPRE_SMMFUSE_FFF_UP_TO_10; \ + HYPRE_SMMFUSE_FFF(10) + +#define HYPRE_SMMFUSE_FFF_UP_TO_12 \ + HYPRE_SMMFUSE_FFF_UP_TO_11; \ + HYPRE_SMMFUSE_FFF(11) + +#define HYPRE_SMMFUSE_FFF_UP_TO_13 \ + HYPRE_SMMFUSE_FFF_UP_TO_12; \ + HYPRE_SMMFUSE_FFF(12) + +#define HYPRE_SMMFUSE_FFF_UP_TO_14 \ + HYPRE_SMMFUSE_FFF_UP_TO_13; \ + HYPRE_SMMFUSE_FFF(13) + +#define HYPRE_SMMFUSE_FFF_UP_TO_15 \ + HYPRE_SMMFUSE_FFF_UP_TO_14; \ + HYPRE_SMMFUSE_FFF(14) + +#define HYPRE_SMMFUSE_FFF_UP_TO_16 \ + HYPRE_SMMFUSE_FFF_UP_TO_15; \ + HYPRE_SMMFUSE_FFF(15) + +#define HYPRE_SMMFUSE_FFF_UP_TO_17 \ + HYPRE_SMMFUSE_FFF_UP_TO_16; \ + HYPRE_SMMFUSE_FFF(16) + +#define HYPRE_SMMFUSE_FFF_UP_TO_18 \ + HYPRE_SMMFUSE_FFF_UP_TO_17; \ + HYPRE_SMMFUSE_FFF(17) + +#define HYPRE_SMMFUSE_FFF_UP_TO_19 \ + HYPRE_SMMFUSE_FFF_UP_TO_18; \ + HYPRE_SMMFUSE_FFF(18) + +#define HYPRE_SMMFUSE_FFF_UP_TO_20 \ + HYPRE_SMMFUSE_FFF_UP_TO_19; \ + HYPRE_SMMFUSE_FFF(19) + +#define HYPRE_SMMFUSE_FFC_UP_TO_1 \ + HYPRE_SMMFUSE_FFC(0) + +#define HYPRE_SMMFUSE_FFC_UP_TO_2 \ + HYPRE_SMMFUSE_FFC(0); \ + HYPRE_SMMFUSE_FFC(1) + +#define HYPRE_SMMFUSE_FFC_UP_TO_3 \ + HYPRE_SMMFUSE_FFC_UP_TO_2; \ + HYPRE_SMMFUSE_FFC(2) + +#define HYPRE_SMMFUSE_FFC_UP_TO_4 \ + HYPRE_SMMFUSE_FFC_UP_TO_3; \ + HYPRE_SMMFUSE_FFC(3) + +#define HYPRE_SMMFUSE_FFC_UP_TO_5 \ + HYPRE_SMMFUSE_FFC_UP_TO_4; \ + HYPRE_SMMFUSE_FFC(4) + +#define HYPRE_SMMFUSE_FFC_UP_TO_6 \ + HYPRE_SMMFUSE_FFC_UP_TO_5; \ + HYPRE_SMMFUSE_FFC(5) + +#define HYPRE_SMMFUSE_FFC_UP_TO_7 \ + HYPRE_SMMFUSE_FFC_UP_TO_6; \ + HYPRE_SMMFUSE_FFC(6) + +#define HYPRE_SMMFUSE_FFC_UP_TO_8 \ + HYPRE_SMMFUSE_FFC_UP_TO_7; \ + HYPRE_SMMFUSE_FFC(7) + +#define HYPRE_SMMFUSE_FFC_UP_TO_9 \ + HYPRE_SMMFUSE_FFC_UP_TO_8; \ + HYPRE_SMMFUSE_FFC(8) + +#define HYPRE_SMMFUSE_FFC_UP_TO_10 \ + HYPRE_SMMFUSE_FFC_UP_TO_9; \ + HYPRE_SMMFUSE_FFC(9) + +#define HYPRE_SMMFUSE_FFC_UP_TO_11 \ + HYPRE_SMMFUSE_FFC_UP_TO_10; \ + HYPRE_SMMFUSE_FFC(10) + +#define HYPRE_SMMFUSE_FFC_UP_TO_12 \ + HYPRE_SMMFUSE_FFC_UP_TO_11; \ + HYPRE_SMMFUSE_FFC(11) + +#define HYPRE_SMMFUSE_FFC_UP_TO_13 \ + HYPRE_SMMFUSE_FFC_UP_TO_12; \ + HYPRE_SMMFUSE_FFC(12) + +#define HYPRE_SMMFUSE_FFC_UP_TO_14 \ + HYPRE_SMMFUSE_FFC_UP_TO_13; \ + HYPRE_SMMFUSE_FFC(13) + +#define HYPRE_SMMFUSE_FFC_UP_TO_15 \ + HYPRE_SMMFUSE_FFC_UP_TO_14; \ + HYPRE_SMMFUSE_FFC(14) + +#define HYPRE_SMMFUSE_FFC_UP_TO_16 \ + HYPRE_SMMFUSE_FFC_UP_TO_15; \ + HYPRE_SMMFUSE_FFC(15) + +#define HYPRE_SMMFUSE_FFC_UP_TO_17 \ + HYPRE_SMMFUSE_FFC_UP_TO_16; \ + HYPRE_SMMFUSE_FFC(16) + +#define HYPRE_SMMFUSE_FFC_UP_TO_18 \ + HYPRE_SMMFUSE_FFC_UP_TO_17; \ + HYPRE_SMMFUSE_FFC(17) + +#define HYPRE_SMMFUSE_FFC_UP_TO_19 \ + HYPRE_SMMFUSE_FFC_UP_TO_18; \ + HYPRE_SMMFUSE_FFC(18) + +#define HYPRE_SMMFUSE_FFC_UP_TO_20 \ + HYPRE_SMMFUSE_FFC_UP_TO_19; \ + HYPRE_SMMFUSE_FFC(19) + +#define HYPRE_SMMFUSE_FCC_UP_TO_1 \ + HYPRE_SMMFUSE_FCC(0) + +#define HYPRE_SMMFUSE_FCC_UP_TO_2 \ + HYPRE_SMMFUSE_FCC(0); \ + HYPRE_SMMFUSE_FCC(1) + +#define HYPRE_SMMFUSE_FCC_UP_TO_3 \ + HYPRE_SMMFUSE_FCC_UP_TO_2; \ + HYPRE_SMMFUSE_FCC(2) + +#define HYPRE_SMMFUSE_FCC_UP_TO_4 \ + HYPRE_SMMFUSE_FCC_UP_TO_3; \ + HYPRE_SMMFUSE_FCC(3) + +#define HYPRE_SMMFUSE_FCC_UP_TO_5 \ + HYPRE_SMMFUSE_FCC_UP_TO_4; \ + HYPRE_SMMFUSE_FCC(4) + +#define HYPRE_SMMFUSE_FCC_UP_TO_6 \ + HYPRE_SMMFUSE_FCC_UP_TO_5; \ + HYPRE_SMMFUSE_FCC(5) + +#define HYPRE_SMMFUSE_FCC_UP_TO_7 \ + HYPRE_SMMFUSE_FCC_UP_TO_6; \ + HYPRE_SMMFUSE_FCC(6) + +#define HYPRE_SMMFUSE_FCC_UP_TO_8 \ + HYPRE_SMMFUSE_FCC_UP_TO_7; \ + HYPRE_SMMFUSE_FCC(7) + +#define HYPRE_SMMFUSE_FCC_UP_TO_9 \ + HYPRE_SMMFUSE_FCC_UP_TO_8; \ + HYPRE_SMMFUSE_FCC(8) + +#define HYPRE_SMMFUSE_FCC_UP_TO_10 \ + HYPRE_SMMFUSE_FCC_UP_TO_9; \ + HYPRE_SMMFUSE_FCC(9) + +#define HYPRE_SMMFUSE_FCC_UP_TO_11 \ + HYPRE_SMMFUSE_FCC_UP_TO_10; \ + HYPRE_SMMFUSE_FCC(10) + +#define HYPRE_SMMFUSE_FCC_UP_TO_12 \ + HYPRE_SMMFUSE_FCC_UP_TO_11; \ + HYPRE_SMMFUSE_FCC(11) + +#define HYPRE_SMMFUSE_FCC_UP_TO_13 \ + HYPRE_SMMFUSE_FCC_UP_TO_12; \ + HYPRE_SMMFUSE_FCC(12) + +#define HYPRE_SMMFUSE_FCC_UP_TO_14 \ + HYPRE_SMMFUSE_FCC_UP_TO_13; \ + HYPRE_SMMFUSE_FCC(13) + +#define HYPRE_SMMFUSE_FCC_UP_TO_15 \ + HYPRE_SMMFUSE_FCC_UP_TO_14; \ + HYPRE_SMMFUSE_FCC(14) + +#define HYPRE_SMMFUSE_FCC_UP_TO_16 \ + HYPRE_SMMFUSE_FCC_UP_TO_15; \ + HYPRE_SMMFUSE_FCC(15) + +#define HYPRE_SMMFUSE_FCC_UP_TO_17 \ + HYPRE_SMMFUSE_FCC_UP_TO_16; \ + HYPRE_SMMFUSE_FCC(16) + +#define HYPRE_SMMFUSE_FCC_UP_TO_18 \ + HYPRE_SMMFUSE_FCC_UP_TO_17; \ + HYPRE_SMMFUSE_FCC(17) + +#define HYPRE_SMMFUSE_FCC_UP_TO_19 \ + HYPRE_SMMFUSE_FCC_UP_TO_18; \ + HYPRE_SMMFUSE_FCC(18) + +#define HYPRE_SMMFUSE_FCC_UP_TO_20 \ + HYPRE_SMMFUSE_FCC_UP_TO_19; \ + HYPRE_SMMFUSE_FCC(19) + +#define HYPRE_SMMFUSE_CALC_F_UP_TO_3 \ + HYPRE_SMMFUSE_F(f_0); \ + HYPRE_SMMFUSE_F(f_1); \ + HYPRE_SMMFUSE_F(f_2) + +#define HYPRE_SMMFUSE_CALC_F_UP_TO_5 \ + HYPRE_SMMFUSE_CALC_F_UP_TO_3; \ + HYPRE_SMMFUSE_F(f_3); \ + HYPRE_SMMFUSE_F(f_4) + +#define HYPRE_SMMFUSE_CALC_F_UP_TO_9 \ + HYPRE_SMMFUSE_CALC_F_UP_TO_5; \ + HYPRE_SMMFUSE_F(f_5); \ + HYPRE_SMMFUSE_F(f_6); \ + HYPRE_SMMFUSE_F(f_7); \ + HYPRE_SMMFUSE_F(f_8) + +#define HYPRE_SMMFUSE_CALC_FC_UP_TO_6 \ + HYPRE_SMMFUSE_FC(fc_0); \ + HYPRE_SMMFUSE_FC(fc_1); \ + HYPRE_SMMFUSE_FC(fc_2); \ + HYPRE_SMMFUSE_FC(fc_3); \ + HYPRE_SMMFUSE_FC(fc_4); \ + HYPRE_SMMFUSE_FC(fc_5) + +#define HYPRE_SMMFUSE_CALC_FC_UP_TO_8 \ + HYPRE_SMMFUSE_CALC_FC_UP_TO_6; \ + HYPRE_SMMFUSE_FC(fc_6); \ + HYPRE_SMMFUSE_FC(fc_7) + +#define HYPRE_SMMFUSE_CALC_FC_UP_TO_14 \ + HYPRE_SMMFUSE_CALC_FC_UP_TO_8; \ + HYPRE_SMMFUSE_FC(fc_8); \ + HYPRE_SMMFUSE_FC(fc_9); \ + HYPRE_SMMFUSE_FC(fc_10); \ + HYPRE_SMMFUSE_FC(fc_11); \ + HYPRE_SMMFUSE_FC(fc_12); \ + HYPRE_SMMFUSE_FC(fc_13) + +#define HYPRE_SMMFUSE_CALC_FC_UP_TO_24 \ + HYPRE_SMMFUSE_CALC_FC_UP_TO_14; \ + HYPRE_SMMFUSE_FC(fc_14); \ + HYPRE_SMMFUSE_FC(fc_15); \ + HYPRE_SMMFUSE_FC(fc_16); \ + HYPRE_SMMFUSE_FC(fc_17); \ + HYPRE_SMMFUSE_FC(fc_18); \ + HYPRE_SMMFUSE_FC(fc_19); \ + HYPRE_SMMFUSE_FC(fc_20); \ + HYPRE_SMMFUSE_FC(fc_21); \ + HYPRE_SMMFUSE_FC(fc_22); \ + HYPRE_SMMFUSE_FC(fc_23) + +#define HYPRE_SMMFUSE_CALC_FC_UP_TO_38 \ + HYPRE_SMMFUSE_CALC_FC_UP_TO_24; \ + HYPRE_SMMFUSE_FC(fc_24); \ + HYPRE_SMMFUSE_FC(fc_25); \ + HYPRE_SMMFUSE_FC(fc_26); \ + HYPRE_SMMFUSE_FC(fc_27); \ + HYPRE_SMMFUSE_FC(fc_28); \ + HYPRE_SMMFUSE_FC(fc_29); \ + HYPRE_SMMFUSE_FC(fc_30); \ + HYPRE_SMMFUSE_FC(fc_31); \ + HYPRE_SMMFUSE_FC(fc_32); \ + HYPRE_SMMFUSE_FC(fc_33); \ + HYPRE_SMMFUSE_FC(fc_34); \ + HYPRE_SMMFUSE_FC(fc_35); \ + HYPRE_SMMFUSE_FC(fc_36); \ + HYPRE_SMMFUSE_FC(fc_37) + +#define HYPRE_SMMFUSE_CALC_FC_UP_TO_72 \ + HYPRE_SMMFUSE_CALC_FC_UP_TO_38; \ + HYPRE_SMMFUSE_FC(fc_38); \ + HYPRE_SMMFUSE_FC(fc_39); \ + HYPRE_SMMFUSE_FC(fc_40); \ + HYPRE_SMMFUSE_FC(fc_41); \ + HYPRE_SMMFUSE_FC(fc_42); \ + HYPRE_SMMFUSE_FC(fc_43); \ + HYPRE_SMMFUSE_FC(fc_44); \ + HYPRE_SMMFUSE_FC(fc_45); \ + HYPRE_SMMFUSE_FC(fc_46); \ + HYPRE_SMMFUSE_FC(fc_47); \ + HYPRE_SMMFUSE_FC(fc_48); \ + HYPRE_SMMFUSE_FC(fc_49); \ + HYPRE_SMMFUSE_FC(fc_50); \ + HYPRE_SMMFUSE_FC(fc_51); \ + HYPRE_SMMFUSE_FC(fc_52); \ + HYPRE_SMMFUSE_FC(fc_53); \ + HYPRE_SMMFUSE_FC(fc_54); \ + HYPRE_SMMFUSE_FC(fc_55); \ + HYPRE_SMMFUSE_FC(fc_56); \ + HYPRE_SMMFUSE_FC(fc_57); \ + HYPRE_SMMFUSE_FC(fc_58); \ + HYPRE_SMMFUSE_FC(fc_59); \ + HYPRE_SMMFUSE_FC(fc_60); \ + HYPRE_SMMFUSE_FC(fc_61); \ + HYPRE_SMMFUSE_FC(fc_62); \ + HYPRE_SMMFUSE_FC(fc_63); \ + HYPRE_SMMFUSE_FC(fc_64); \ + HYPRE_SMMFUSE_FC(fc_65); \ + HYPRE_SMMFUSE_FC(fc_66); \ + HYPRE_SMMFUSE_FC(fc_67); \ + HYPRE_SMMFUSE_FC(fc_68); \ + HYPRE_SMMFUSE_FC(fc_69); \ + HYPRE_SMMFUSE_FC(fc_70); \ + HYPRE_SMMFUSE_FC(fc_71) + +#define HYPRE_SMMFUSE_CALC_FCC_UP_TO_11 \ + HYPRE_SMMFUSE_FCC(fcc_0); \ + HYPRE_SMMFUSE_FCC(fcc_1); \ + HYPRE_SMMFUSE_FCC(fcc_2); \ + HYPRE_SMMFUSE_FCC(fcc_3); \ + HYPRE_SMMFUSE_FCC(fcc_4); \ + HYPRE_SMMFUSE_FCC(fcc_5); \ + HYPRE_SMMFUSE_FCC(fcc_6); \ + HYPRE_SMMFUSE_FCC(fcc_7); \ + HYPRE_SMMFUSE_FCC(fcc_8); \ + HYPRE_SMMFUSE_FCC(fcc_9); \ + HYPRE_SMMFUSE_FCC(fcc_10) + +#define HYPRE_SMMFUSE_CALC_FCC_UP_TO_19 \ + HYPRE_SMMFUSE_CALC_FCC_UP_TO_11; \ + HYPRE_SMMFUSE_FCC(fcc_11); \ + HYPRE_SMMFUSE_FCC(fcc_12); \ + HYPRE_SMMFUSE_FCC(fcc_13); \ + HYPRE_SMMFUSE_FCC(fcc_14); \ + HYPRE_SMMFUSE_FCC(fcc_15); \ + HYPRE_SMMFUSE_FCC(fcc_16); \ + HYPRE_SMMFUSE_FCC(fcc_17); \ + HYPRE_SMMFUSE_FCC(fcc_18) + +#define HYPRE_SMMFUSE_CALC_FCC_UP_TO_20 \ + HYPRE_SMMFUSE_CALC_FCC_UP_TO_19; \ + HYPRE_SMMFUSE_FCC(fcc_19) + +#define HYPRE_SMMFUSE_CALC_FCC_UP_TO_36 \ + HYPRE_SMMFUSE_CALC_FCC_UP_TO_20; \ + HYPRE_SMMFUSE_FCC(fcc_20); \ + HYPRE_SMMFUSE_FCC(fcc_21); \ + HYPRE_SMMFUSE_FCC(fcc_22); \ + HYPRE_SMMFUSE_FCC(fcc_23); \ + HYPRE_SMMFUSE_FCC(fcc_24); \ + HYPRE_SMMFUSE_FCC(fcc_25); \ + HYPRE_SMMFUSE_FCC(fcc_26); \ + HYPRE_SMMFUSE_FCC(fcc_27); \ + HYPRE_SMMFUSE_FCC(fcc_28); \ + HYPRE_SMMFUSE_FCC(fcc_29); \ + HYPRE_SMMFUSE_FCC(fcc_30); \ + HYPRE_SMMFUSE_FCC(fcc_31); \ + HYPRE_SMMFUSE_FCC(fcc_32); \ + HYPRE_SMMFUSE_FCC(fcc_33); \ + HYPRE_SMMFUSE_FCC(fcc_34); \ + HYPRE_SMMFUSE_FCC(fcc_35) + +#define HYPRE_SMMFUSE_FF_UP_TO_1 \ + HYPRE_SMMFUSE_FF(0) + +#define HYPRE_SMMFUSE_FF_UP_TO_2 \ + HYPRE_SMMFUSE_FF(0); \ + HYPRE_SMMFUSE_FF(1) + +#define HYPRE_SMMFUSE_FF_UP_TO_3 \ + HYPRE_SMMFUSE_FF_UP_TO_2; \ + HYPRE_SMMFUSE_FF(2) + +#define HYPRE_SMMFUSE_FF_UP_TO_4 \ + HYPRE_SMMFUSE_FF_UP_TO_3; \ + HYPRE_SMMFUSE_FF(3) + +#define HYPRE_SMMFUSE_FF_UP_TO_5 \ + HYPRE_SMMFUSE_FF_UP_TO_4; \ + HYPRE_SMMFUSE_FF(4) + +#define HYPRE_SMMFUSE_FF_UP_TO_6 \ + HYPRE_SMMFUSE_FF_UP_TO_5; \ + HYPRE_SMMFUSE_FF(5) + +#define HYPRE_SMMFUSE_FF_UP_TO_7 \ + HYPRE_SMMFUSE_FF_UP_TO_6; \ + HYPRE_SMMFUSE_FF(6) + +#define HYPRE_SMMFUSE_FF_UP_TO_8 \ + HYPRE_SMMFUSE_FF_UP_TO_7; \ + HYPRE_SMMFUSE_FF(7) + +#define HYPRE_SMMFUSE_FF_UP_TO_9 \ + HYPRE_SMMFUSE_FF_UP_TO_8; \ + HYPRE_SMMFUSE_FF(8) + +#define HYPRE_SMMFUSE_FF_UP_TO_10 \ + HYPRE_SMMFUSE_FF_UP_TO_9; \ + HYPRE_SMMFUSE_FF(9) + +#define HYPRE_SMMFUSE_FF_UP_TO_11 \ + HYPRE_SMMFUSE_FF_UP_TO_10; \ + HYPRE_SMMFUSE_FF(10) + +#define HYPRE_SMMFUSE_FF_UP_TO_12 \ + HYPRE_SMMFUSE_FF_UP_TO_11; \ + HYPRE_SMMFUSE_FF(11) + +#define HYPRE_SMMFUSE_FF_UP_TO_13 \ + HYPRE_SMMFUSE_FF_UP_TO_12; \ + HYPRE_SMMFUSE_FF(12) + +#define HYPRE_SMMFUSE_FF_UP_TO_14 \ + HYPRE_SMMFUSE_FF_UP_TO_13; \ + HYPRE_SMMFUSE_FF(13) + +#define HYPRE_SMMFUSE_FF_UP_TO_15 \ + HYPRE_SMMFUSE_FF_UP_TO_14; \ + HYPRE_SMMFUSE_FF(14) + +#define HYPRE_SMMFUSE_FF_UP_TO_16 \ + HYPRE_SMMFUSE_FF_UP_TO_15; \ + HYPRE_SMMFUSE_FF(15) + +#define HYPRE_SMMFUSE_FF_UP_TO_17 \ + HYPRE_SMMFUSE_FF_UP_TO_16; \ + HYPRE_SMMFUSE_FF(16) + +#define HYPRE_SMMFUSE_FF_UP_TO_18 \ + HYPRE_SMMFUSE_FF_UP_TO_17; \ + HYPRE_SMMFUSE_FF(17) + +#define HYPRE_SMMFUSE_FF_UP_TO_19 \ + HYPRE_SMMFUSE_FF_UP_TO_18; \ + HYPRE_SMMFUSE_FF(18) + +#define HYPRE_SMMFUSE_FF_UP_TO_20 \ + HYPRE_SMMFUSE_FF_UP_TO_19; \ + HYPRE_SMMFUSE_FF(19) + +#define HYPRE_SMMFUSE_FC_UP_TO_1 \ + HYPRE_SMMFUSE_FC(0) + +#define HYPRE_SMMFUSE_FC_UP_TO_2 \ + HYPRE_SMMFUSE_FC(0); \ + HYPRE_SMMFUSE_FC(1) + +#define HYPRE_SMMFUSE_FC_UP_TO_3 \ + HYPRE_SMMFUSE_FC_UP_TO_2; \ + HYPRE_SMMFUSE_FC(2) + +#define HYPRE_SMMFUSE_FC_UP_TO_4 \ + HYPRE_SMMFUSE_FC_UP_TO_3; \ + HYPRE_SMMFUSE_FC(3) + +#define HYPRE_SMMFUSE_FC_UP_TO_5 \ + HYPRE_SMMFUSE_FC_UP_TO_4; \ + HYPRE_SMMFUSE_FC(4) + +#define HYPRE_SMMFUSE_FC_UP_TO_6 \ + HYPRE_SMMFUSE_FC_UP_TO_5; \ + HYPRE_SMMFUSE_FC(5) + +#define HYPRE_SMMFUSE_FC_UP_TO_7 \ + HYPRE_SMMFUSE_FC_UP_TO_6; \ + HYPRE_SMMFUSE_FC(6) + +#define HYPRE_SMMFUSE_FC_UP_TO_8 \ + HYPRE_SMMFUSE_FC_UP_TO_7; \ + HYPRE_SMMFUSE_FC(7) + +#define HYPRE_SMMFUSE_FC_UP_TO_9 \ + HYPRE_SMMFUSE_FC_UP_TO_8; \ + HYPRE_SMMFUSE_FC(8) + +#define HYPRE_SMMFUSE_FC_UP_TO_10 \ + HYPRE_SMMFUSE_FC_UP_TO_9; \ + HYPRE_SMMFUSE_FC(9) + +#define HYPRE_SMMFUSE_FC_UP_TO_11 \ + HYPRE_SMMFUSE_FC_UP_TO_10; \ + HYPRE_SMMFUSE_FC(10) + +#define HYPRE_SMMFUSE_FC_UP_TO_12 \ + HYPRE_SMMFUSE_FC_UP_TO_11; \ + HYPRE_SMMFUSE_FC(11) + +#define HYPRE_SMMFUSE_FC_UP_TO_13 \ + HYPRE_SMMFUSE_FC_UP_TO_12; \ + HYPRE_SMMFUSE_FC(12) + +#define HYPRE_SMMFUSE_FC_UP_TO_14 \ + HYPRE_SMMFUSE_FC_UP_TO_13; \ + HYPRE_SMMFUSE_FC(13) + +#define HYPRE_SMMFUSE_FC_UP_TO_15 \ + HYPRE_SMMFUSE_FC_UP_TO_14; \ + HYPRE_SMMFUSE_FC(14) + +#define HYPRE_SMMFUSE_FC_UP_TO_16 \ + HYPRE_SMMFUSE_FC_UP_TO_15; \ + HYPRE_SMMFUSE_FC(15) + +#define HYPRE_SMMFUSE_FC_UP_TO_17 \ + HYPRE_SMMFUSE_FC_UP_TO_16; \ + HYPRE_SMMFUSE_FC(16) + +#define HYPRE_SMMFUSE_FC_UP_TO_18 \ + HYPRE_SMMFUSE_FC_UP_TO_17; \ + HYPRE_SMMFUSE_FC(17) + +#define HYPRE_SMMFUSE_FC_UP_TO_19 \ + HYPRE_SMMFUSE_FC_UP_TO_18; \ + HYPRE_SMMFUSE_FC(18) + +#define HYPRE_SMMFUSE_FC_UP_TO_20 \ + HYPRE_SMMFUSE_FC_UP_TO_19; \ + HYPRE_SMMFUSE_FC(19) + +#define HYPRE_SMMFUSE_CC_UP_TO_1 \ + HYPRE_SMMFUSE_CC(0) + +#define HYPRE_SMMFUSE_CC_UP_TO_2 \ + HYPRE_SMMFUSE_CC(0); \ + HYPRE_SMMFUSE_CC(1) + +#define HYPRE_SMMFUSE_CC_UP_TO_3 \ + HYPRE_SMMFUSE_CC_UP_TO_2; \ + HYPRE_SMMFUSE_CC(2) + +#define HYPRE_SMMFUSE_CC_UP_TO_4 \ + HYPRE_SMMFUSE_CC_UP_TO_3; \ + HYPRE_SMMFUSE_CC(3) + +#define HYPRE_SMMFUSE_CC_UP_TO_5 \ + HYPRE_SMMFUSE_CC_UP_TO_4; \ + HYPRE_SMMFUSE_CC(4) + +#define HYPRE_SMMFUSE_CC_UP_TO_6 \ + HYPRE_SMMFUSE_CC_UP_TO_5; \ + HYPRE_SMMFUSE_CC(5) + +#define HYPRE_SMMFUSE_CC_UP_TO_7 \ + HYPRE_SMMFUSE_CC_UP_TO_6; \ + HYPRE_SMMFUSE_CC(6) + +#define HYPRE_SMMFUSE_CC_UP_TO_8 \ + HYPRE_SMMFUSE_CC_UP_TO_7; \ + HYPRE_SMMFUSE_CC(7) + +#define HYPRE_SMMFUSE_CC_UP_TO_9 \ + HYPRE_SMMFUSE_CC_UP_TO_8; \ + HYPRE_SMMFUSE_CC(8) + +#define HYPRE_SMMFUSE_CC_UP_TO_10 \ + HYPRE_SMMFUSE_CC_UP_TO_9; \ + HYPRE_SMMFUSE_CC(9) + +#define HYPRE_SMMFUSE_CC_UP_TO_11 \ + HYPRE_SMMFUSE_CC_UP_TO_10; \ + HYPRE_SMMFUSE_CC(10) + +#define HYPRE_SMMFUSE_CC_UP_TO_12 \ + HYPRE_SMMFUSE_CC_UP_TO_11; \ + HYPRE_SMMFUSE_CC(11) + +#define HYPRE_SMMFUSE_CC_UP_TO_13 \ + HYPRE_SMMFUSE_CC_UP_TO_12; \ + HYPRE_SMMFUSE_CC(12) + +#define HYPRE_SMMFUSE_CC_UP_TO_14 \ + HYPRE_SMMFUSE_CC_UP_TO_13; \ + HYPRE_SMMFUSE_CC(13) + +#define HYPRE_SMMFUSE_CC_UP_TO_15 \ + HYPRE_SMMFUSE_CC_UP_TO_14; \ + HYPRE_SMMFUSE_CC(14) + +#define HYPRE_SMMFUSE_CC_UP_TO_16 \ + HYPRE_SMMFUSE_CC_UP_TO_15; \ + HYPRE_SMMFUSE_CC(15) + +#define HYPRE_SMMFUSE_CC_UP_TO_17 \ + HYPRE_SMMFUSE_CC_UP_TO_16; \ + HYPRE_SMMFUSE_CC(16) + +#define HYPRE_SMMFUSE_CC_UP_TO_18 \ + HYPRE_SMMFUSE_CC_UP_TO_17; \ + HYPRE_SMMFUSE_CC(17) + +#define HYPRE_SMMFUSE_CC_UP_TO_19 \ + HYPRE_SMMFUSE_CC_UP_TO_18; \ + HYPRE_SMMFUSE_CC(18) + +#define HYPRE_SMMFUSE_CC_UP_TO_20 \ + HYPRE_SMMFUSE_CC_UP_TO_19; \ + HYPRE_SMMFUSE_CC(19) + +#define HYPRE_SMMFUSE_F_UP_TO_1 \ + HYPRE_SMMFUSE_F(0) + +#define HYPRE_SMMFUSE_F_UP_TO_2 \ + HYPRE_SMMFUSE_F(0); \ + HYPRE_SMMFUSE_F(1) + +#define HYPRE_SMMFUSE_F_UP_TO_3 \ + HYPRE_SMMFUSE_F_UP_TO_2; \ + HYPRE_SMMFUSE_F(2) + +#define HYPRE_SMMFUSE_F_UP_TO_4 \ + HYPRE_SMMFUSE_F_UP_TO_3; \ + HYPRE_SMMFUSE_F(3) + +#define HYPRE_SMMFUSE_F_UP_TO_5 \ + HYPRE_SMMFUSE_F_UP_TO_4; \ + HYPRE_SMMFUSE_F(4) + +#define HYPRE_SMMFUSE_F_UP_TO_6 \ + HYPRE_SMMFUSE_F_UP_TO_5; \ + HYPRE_SMMFUSE_F(5) + +#define HYPRE_SMMFUSE_F_UP_TO_7 \ + HYPRE_SMMFUSE_F_UP_TO_6; \ + HYPRE_SMMFUSE_F(6) + +#define HYPRE_SMMFUSE_F_UP_TO_8 \ + HYPRE_SMMFUSE_F_UP_TO_7; \ + HYPRE_SMMFUSE_F(7) + +#define HYPRE_SMMFUSE_F_UP_TO_9 \ + HYPRE_SMMFUSE_F_UP_TO_8; \ + HYPRE_SMMFUSE_F(8) + +#define HYPRE_SMMFUSE_F_UP_TO_10 \ + HYPRE_SMMFUSE_F_UP_TO_9; \ + HYPRE_SMMFUSE_F(9) + +#define HYPRE_SMMFUSE_F_UP_TO_11 \ + HYPRE_SMMFUSE_F_UP_TO_10; \ + HYPRE_SMMFUSE_F(10) + +#define HYPRE_SMMFUSE_F_UP_TO_12 \ + HYPRE_SMMFUSE_F_UP_TO_11; \ + HYPRE_SMMFUSE_F(11) + +#define HYPRE_SMMFUSE_F_UP_TO_13 \ + HYPRE_SMMFUSE_F_UP_TO_12; \ + HYPRE_SMMFUSE_F(12) + +#define HYPRE_SMMFUSE_F_UP_TO_14 \ + HYPRE_SMMFUSE_F_UP_TO_13; \ + HYPRE_SMMFUSE_F(13) + +#define HYPRE_SMMFUSE_F_UP_TO_15 \ + HYPRE_SMMFUSE_F_UP_TO_14; \ + HYPRE_SMMFUSE_F(14) + +#define HYPRE_SMMFUSE_F_UP_TO_16 \ + HYPRE_SMMFUSE_F_UP_TO_15; \ + HYPRE_SMMFUSE_F(15) + +#define HYPRE_SMMFUSE_F_UP_TO_17 \ + HYPRE_SMMFUSE_F_UP_TO_16; \ + HYPRE_SMMFUSE_F(16) + +#define HYPRE_SMMFUSE_F_UP_TO_18 \ + HYPRE_SMMFUSE_F_UP_TO_17; \ + HYPRE_SMMFUSE_F(17) + +#define HYPRE_SMMFUSE_F_UP_TO_19 \ + HYPRE_SMMFUSE_F_UP_TO_18; \ + HYPRE_SMMFUSE_F(18) + +#define HYPRE_SMMFUSE_F_UP_TO_20 \ + HYPRE_SMMFUSE_F_UP_TO_19; \ + HYPRE_SMMFUSE_F(19) + +#define HYPRE_SMMFUSE_C_UP_TO_1 \ + HYPRE_SMMFUSE_C(0) + +#define HYPRE_SMMFUSE_C_UP_TO_2 \ + HYPRE_SMMFUSE_C(0); \ + HYPRE_SMMFUSE_C(1) + +#define HYPRE_SMMFUSE_C_UP_TO_3 \ + HYPRE_SMMFUSE_C_UP_TO_2; \ + HYPRE_SMMFUSE_C(2) + +#define HYPRE_SMMFUSE_C_UP_TO_4 \ + HYPRE_SMMFUSE_C_UP_TO_3; \ + HYPRE_SMMFUSE_C(3) + +#define HYPRE_SMMFUSE_C_UP_TO_5 \ + HYPRE_SMMFUSE_C_UP_TO_4; \ + HYPRE_SMMFUSE_C(4) + +#define HYPRE_SMMFUSE_C_UP_TO_6 \ + HYPRE_SMMFUSE_C_UP_TO_5; \ + HYPRE_SMMFUSE_C(5) + +#define HYPRE_SMMFUSE_C_UP_TO_7 \ + HYPRE_SMMFUSE_C_UP_TO_6; \ + HYPRE_SMMFUSE_C(6) + +#define HYPRE_SMMFUSE_C_UP_TO_8 \ + HYPRE_SMMFUSE_C_UP_TO_7; \ + HYPRE_SMMFUSE_C(7) + +#define HYPRE_SMMFUSE_C_UP_TO_9 \ + HYPRE_SMMFUSE_C_UP_TO_8; \ + HYPRE_SMMFUSE_C(8) + +#define HYPRE_SMMFUSE_C_UP_TO_10 \ + HYPRE_SMMFUSE_C_UP_TO_9; \ + HYPRE_SMMFUSE_C(9) + +#define HYPRE_SMMFUSE_C_UP_TO_11 \ + HYPRE_SMMFUSE_C_UP_TO_10; \ + HYPRE_SMMFUSE_C(10) + +#define HYPRE_SMMFUSE_C_UP_TO_12 \ + HYPRE_SMMFUSE_C_UP_TO_11; \ + HYPRE_SMMFUSE_C(11) + +#define HYPRE_SMMFUSE_C_UP_TO_13 \ + HYPRE_SMMFUSE_C_UP_TO_12; \ + HYPRE_SMMFUSE_C(12) + +#define HYPRE_SMMFUSE_C_UP_TO_14 \ + HYPRE_SMMFUSE_C_UP_TO_13; \ + HYPRE_SMMFUSE_C(13) + +#define HYPRE_SMMFUSE_C_UP_TO_15 \ + HYPRE_SMMFUSE_C_UP_TO_14; \ + HYPRE_SMMFUSE_C(14) + +#define HYPRE_SMMFUSE_C_UP_TO_16 \ + HYPRE_SMMFUSE_C_UP_TO_15; \ + HYPRE_SMMFUSE_C(15) + +#define HYPRE_SMMFUSE_C_UP_TO_17 \ + HYPRE_SMMFUSE_C_UP_TO_16; \ + HYPRE_SMMFUSE_C(16) + +#define HYPRE_SMMFUSE_C_UP_TO_18 \ + HYPRE_SMMFUSE_C_UP_TO_17; \ + HYPRE_SMMFUSE_C(17) + +#define HYPRE_SMMFUSE_C_UP_TO_19 \ + HYPRE_SMMFUSE_C_UP_TO_18; \ + HYPRE_SMMFUSE_C(18) + +#define HYPRE_SMMFUSE_C_UP_TO_20 \ + HYPRE_SMMFUSE_C_UP_TO_19; \ + HYPRE_SMMFUSE_C(19) + +/*-------------------------------------------------------------------------- + * Compute the fused product for FFF terms + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultCompute_fuse_fff( HYPRE_Int nprod, + HYPRE_Complex *cprod, + hypre_3Cptrs *tptrs, + hypre_1Cptr *mptrs, + HYPRE_Int *mentries, + HYPRE_Int ndim, + hypre_Index loop_size, + hypre_Box *fdbox, + hypre_Index fdstart, + hypre_Index fdstride, + hypre_Box *Mdbox, + hypre_Index Mdstart, + hypre_Index Mdstride ) + +{ + HYPRE_Int k, depth; + + /* Variable declarations for up to HYPRE_FUSE_MAXDEPTH variables */ + HYPRE_SMMFUSE_DECLARE_20_5VARS; + + if (nprod < 1) + { + return hypre_error_flag; + } + +#if defined(DEBUG_MATMULT) && (DEBUG_MATMULT > 1) + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "=== FUSE_FFF POINTERS ===\n"); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "Number of products (nprod): %d\n", nprod); + for (k = 0; k < nprod; k++) + { + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "Product %d:\n", k); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " cprod[%d] = %p (value: %e)\n", + k, (void*)&cprod[k], cprod[k]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " mptrs[%d] = %p (entry: %d)\n", + k, (void*)mptrs[k], mentries[k]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " tptrs[%d][0] = %p\n", + k, (void*)tptrs[k][0]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " tptrs[%d][1] = %p\n", + k, (void*)tptrs[k][1]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " tptrs[%d][2] = %p\n", + k, (void*)tptrs[k][2]); + } + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "========================\n"); +#else + HYPRE_UNUSED_VAR(mentries); +#endif + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("fff"); + + for (k = 0; k < nprod; k += HYPRE_FUSE_MAXDEPTH) + { + depth = hypre_min(HYPRE_FUSE_MAXDEPTH, (nprod - k)); + + switch (depth) + { + case 20: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 20); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FFF_UP_TO_20; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 19: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 19); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FFF_UP_TO_19; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 18: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 18); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FFF_UP_TO_18; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 17: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 17); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FFF_UP_TO_17; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 16: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 16); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FFF_UP_TO_16; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 15: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 15); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FFF_UP_TO_15; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 14: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 14); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FFF_UP_TO_14; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 13: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 13); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FFF_UP_TO_13; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 12: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 12); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FFF_UP_TO_12; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 11: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 11); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FFF_UP_TO_11; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 10: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 10); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FFF_UP_TO_10; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 9: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 9); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FFF_UP_TO_9; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 8: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 8); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FFF_UP_TO_8; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 7: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 7); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FFF_UP_TO_7; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 6: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 6); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FFF_UP_TO_6; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 5: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 5); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FFF_UP_TO_5; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 4: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 4); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FFF_UP_TO_4; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 3: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 3); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FFF_UP_TO_3; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 2: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 2); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FFF_UP_TO_2; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 1: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 1); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FFF_UP_TO_1; + } + hypre_BoxLoop2End(Mi, fi); + break; + + default: + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unsupported loop fusion depth!"); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; + } + +#if defined(HYPRE_USING_GPU) + hypre_SyncComputeStream(); +#endif + } + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Compute the fused product for FFC terms + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultCompute_fuse_ffc( HYPRE_Int nprod, + HYPRE_Complex *cprod, + hypre_3Cptrs *tptrs, + hypre_1Cptr *mptrs, + HYPRE_Int *mentries, + HYPRE_Int ndim, + hypre_Index loop_size, + hypre_Box *fdbox, + hypre_Index fdstart, + hypre_Index fdstride, + hypre_Box *cdbox, + hypre_Index cdstart, + hypre_Index cdstride, + hypre_Box *Mdbox, + hypre_Index Mdstart, + hypre_Index Mdstride ) +{ + HYPRE_Int k, depth; + + /* Variable declarations for up to HYPRE_FUSE_MAXDEPTH variables */ + HYPRE_SMMFUSE_DECLARE_20_5VARS; + + if (nprod < 1) + { + return hypre_error_flag; + } + +#if defined(DEBUG_MATMULT) && (DEBUG_MATMULT > 1) + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "=== FUSE_FFC POINTERS ===\n"); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "Number of products (nprod): %d\n", nprod); + for (k = 0; k < nprod; k++) + { + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "Product %d:\n", k); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " cprod[%d] = %p (value: %e)\n", + k, (void*)&cprod[k], cprod[k]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " mptrs[%d] = %p (entry: %d)\n", + k, (void*)mptrs[k], mentries[k]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " tptrs[%d][0] = %p\n", + k, (void*)tptrs[k][0]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " tptrs[%d][1] = %p\n", + k, (void*)tptrs[k][1]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " tptrs[%d][2] = %p\n", + k, (void*)tptrs[k][2]); + } + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "========================\n"); +#else + HYPRE_UNUSED_VAR(mentries); +#endif + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("ffc"); + + for (k = 0; k < nprod; k += HYPRE_FUSE_MAXDEPTH) + { + depth = hypre_min(HYPRE_FUSE_MAXDEPTH, (nprod - k)); + + switch (depth) + { + case 20: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 20); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FFC_UP_TO_20; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 19: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 19); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FFC_UP_TO_19; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 18: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 18); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FFC_UP_TO_18; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 17: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 17); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FFC_UP_TO_17; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 16: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 16); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FFC_UP_TO_16; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 15: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 15); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FFC_UP_TO_15; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 14: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 14); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FFC_UP_TO_14; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 13: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 13); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FFC_UP_TO_13; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 12: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 12); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FFC_UP_TO_12; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 11: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 11); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FFC_UP_TO_11; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 10: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 10); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FFC_UP_TO_10; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 9: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 9); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FFC_UP_TO_9; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 8: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 8); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FFC_UP_TO_8; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 7: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 7); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FFC_UP_TO_7; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 6: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 6); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FFC_UP_TO_6; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 5: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 5); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FFC_UP_TO_5; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 4: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 4); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FFC_UP_TO_4; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 3: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 3); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FFC_UP_TO_3; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 2: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 2); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FFC_UP_TO_2; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 1: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 1); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FFC_UP_TO_1; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + default: + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unsupported loop fusion depth!"); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; + } + +#if defined(HYPRE_USING_GPU) + hypre_SyncComputeStream(); +#endif + } + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Compute the fused product for FCC terms + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultCompute_fuse_fcc( HYPRE_Int nprod, + HYPRE_Complex *cprod, + hypre_3Cptrs *tptrs, + hypre_1Cptr *mptrs, + HYPRE_Int *mentries, + HYPRE_Int ndim, + hypre_Index loop_size, + hypre_Box *fdbox, + hypre_Index fdstart, + hypre_Index fdstride, + hypre_Box *cdbox, + hypre_Index cdstart, + hypre_Index cdstride, + hypre_Box *Mdbox, + hypre_Index Mdstart, + hypre_Index Mdstride ) +{ + HYPRE_Int k, depth; + + /* Variable declarations for up to HYPRE_FUSE_MAXDEPTH variables */ + HYPRE_SMMFUSE_DECLARE_20_5VARS; + + if (nprod < 1) + { + return hypre_error_flag; + } + +#if defined(DEBUG_MATMULT) && (DEBUG_MATMULT > 1) + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "=== FUSE_FCC POINTERS ===\n"); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "Number of products (nprod): %d\n", nprod); + for (k = 0; k < nprod; k++) + { + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "Product %d:\n", k); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " cprod[%d] = %p (value: %e)\n", + k, (void*)&cprod[k], cprod[k]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " mptrs[%d] = %p (entry: %d)\n", + k, (void*)mptrs[k], mentries[k]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " tptrs[%d][0] = %p\n", + k, (void*)tptrs[k][0]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " tptrs[%d][1] = %p\n", + k, (void*)tptrs[k][1]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " tptrs[%d][2] = %p\n", + k, (void*)tptrs[k][2]); + } + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "========================\n"); +#else + HYPRE_UNUSED_VAR(mentries); +#endif + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("fcc"); + + for (k = 0; k < nprod; k += HYPRE_FUSE_MAXDEPTH) + { + depth = hypre_min(HYPRE_FUSE_MAXDEPTH, (nprod - k)); + + switch (depth) + { + case 20: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 20); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FCC_UP_TO_20; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 19: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 19); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FCC_UP_TO_19; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 18: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 18); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FCC_UP_TO_18; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 17: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 17); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FCC_UP_TO_17; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 16: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 16); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FCC_UP_TO_16; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 15: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 15); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FCC_UP_TO_15; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 14: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 14); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FCC_UP_TO_14; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 13: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 13); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FCC_UP_TO_13; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 12: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 12); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FCC_UP_TO_12; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 11: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 11); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FCC_UP_TO_11; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 10: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 10); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FCC_UP_TO_10; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 9: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 9); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FCC_UP_TO_9; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 8: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 8); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FCC_UP_TO_8; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 7: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 7); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FCC_UP_TO_7; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 6: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 6); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FCC_UP_TO_6; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 5: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 5); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FCC_UP_TO_5; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 4: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 4); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FCC_UP_TO_4; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 3: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 3); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FCC_UP_TO_3; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 2: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 2); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FCC_UP_TO_2; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 1: + HYPRE_SMMFUSE_LOAD_5VARS_UP_TO(k, 1); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FCC_UP_TO_1; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + default: + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unsupported loop fusion depth!"); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; + } + +#if defined(HYPRE_USING_GPU) + hypre_SyncComputeStream(); +#endif + } + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Compute the fused product for FF terms + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultCompute_fuse_ff( HYPRE_Int nprod, + HYPRE_Complex *cprod, + hypre_3Cptrs *tptrs, + hypre_1Cptr *mptrs, + HYPRE_Int *mentries, + HYPRE_Int ndim, + hypre_Index loop_size, + hypre_Box *fdbox, + hypre_Index fdstart, + hypre_Index fdstride, + hypre_Box *Mdbox, + hypre_Index Mdstart, + hypre_Index Mdstride ) +{ + HYPRE_Int k, depth; + + /* Variable declarations for up to HYPRE_FUSE_MAXDEPTH variables */ + HYPRE_SMMFUSE_DECLARE_20_4VARS; + + if (nprod < 1) + { + return hypre_error_flag; + } + +#if defined(DEBUG_MATMULT) && (DEBUG_MATMULT > 1) + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "=== FUSE_FF POINTERS ===\n"); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "Number of products (nprod): %d\n", nprod); + for (k = 0; k < nprod; k++) + { + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "Product %d:\n", k); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " cprod[%d] = %p (value: %e)\n", + k, (void*)&cprod[k], cprod[k]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " mptrs[%d] = %p (entry: %d)\n", + k, (void*)mptrs[k], mentries[k]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " tptrs[%d][0] = %p\n", + k, (void*)tptrs[k][0]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " tptrs[%d][1] = %p\n", + k, (void*)tptrs[k][1]); + } + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "=====================\n"); +#else + HYPRE_UNUSED_VAR(mentries); +#endif + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("ff"); + + for (k = 0; k < nprod; k += HYPRE_FUSE_MAXDEPTH) + { + depth = hypre_min(HYPRE_FUSE_MAXDEPTH, (nprod - k)); + + switch (depth) + { + case 20: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 20); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FF_UP_TO_20; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 19: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 19); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FF_UP_TO_19; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 18: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 18); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FF_UP_TO_18; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 17: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 17); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FF_UP_TO_17; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 16: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 16); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FF_UP_TO_16; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 15: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 15); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FF_UP_TO_15; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 14: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 14); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FF_UP_TO_14; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 13: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 13); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FF_UP_TO_13; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 12: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 12); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FF_UP_TO_12; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 11: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 11); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FF_UP_TO_11; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 10: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 10); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FF_UP_TO_10; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 9: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 9); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FF_UP_TO_9; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 8: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 8); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FF_UP_TO_8; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 7: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 7); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FF_UP_TO_7; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 6: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 6); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FF_UP_TO_6; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 5: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 5); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FF_UP_TO_5; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 4: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 4); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FF_UP_TO_4; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 3: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 3); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FF_UP_TO_3; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 2: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 2); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FF_UP_TO_2; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 1: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 1); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_FF_UP_TO_1; + } + hypre_BoxLoop2End(Mi, fi); + break; + + default: + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unsupported loop fusion depth!"); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; + } + +#if defined(HYPRE_USING_GPU) + hypre_SyncComputeStream(); +#endif + } + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultCompute_fuse_fc( HYPRE_Int nprod, + HYPRE_Complex *cprod, + hypre_3Cptrs *tptrs, + hypre_1Cptr *mptrs, + HYPRE_Int *mentries, + HYPRE_Int ndim, + hypre_Index loop_size, + hypre_Box *fdbox, + hypre_Index fdstart, + hypre_Index fdstride, + hypre_Box *cdbox, + hypre_Index cdstart, + hypre_Index cdstride, + hypre_Box *Mdbox, + hypre_Index Mdstart, + hypre_Index Mdstride ) +{ + HYPRE_Int k, depth; + + /* Variable declarations for up to HYPRE_FUSE_MAXDEPTH variables */ + HYPRE_SMMFUSE_DECLARE_20_4VARS; + + if (nprod < 1) + { + return hypre_error_flag; + } + +#if defined(DEBUG_MATMULT) && (DEBUG_MATMULT > 1) + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "=== FUSE_FC POINTERS ===\n"); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "Number of products (nprod): %d\n", nprod); + for (k = 0; k < nprod; k++) + { + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "Product %d:\n", k); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " cprod[%d] = %p (value: %e)\n", + k, (void*)&cprod[k], cprod[k]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " mptrs[%d] = %p (entry: %d)\n", + k, (void*)mptrs[k], mentries[k]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " tptrs[%d][0] = %p\n", + k, (void*)tptrs[k][0]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " tptrs[%d][1] = %p\n", + k, (void*)tptrs[k][1]); + } + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "========================\n"); +#else + HYPRE_UNUSED_VAR(mentries); +#endif + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("fc"); + + for (k = 0; k < nprod; k += HYPRE_FUSE_MAXDEPTH) + { + depth = hypre_min(HYPRE_FUSE_MAXDEPTH, (nprod - k)); + + switch (depth) + { + case 20: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 20); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FC_UP_TO_20; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 19: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 19); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FC_UP_TO_19; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 18: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 18); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FC_UP_TO_18; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 17: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 17); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FC_UP_TO_17; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 16: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 16); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FC_UP_TO_16; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 15: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 15); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FC_UP_TO_15; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 14: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 14); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FC_UP_TO_14; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 13: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 13); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FC_UP_TO_13; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 12: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 12); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FC_UP_TO_12; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 11: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 11); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FC_UP_TO_11; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 10: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 10); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FC_UP_TO_10; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 9: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 9); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FC_UP_TO_9; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 8: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 8); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FC_UP_TO_8; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 7: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 7); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FC_UP_TO_7; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 6: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 6); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FC_UP_TO_6; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 5: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 5); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FC_UP_TO_5; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 4: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 4); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FC_UP_TO_4; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 3: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 3); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FC_UP_TO_3; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 2: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 2); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FC_UP_TO_2; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + case 1: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 1); + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_FC_UP_TO_1; + } + hypre_BoxLoop3End(Mi, fi, ci); + break; + + default: + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unsupported loop fusion depth!"); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; + } + +#if defined(HYPRE_USING_GPU) + hypre_SyncComputeStream(); +#endif + } + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Compute the fused product for CC terms + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultCompute_fuse_cc( HYPRE_Int nprod, + HYPRE_Complex *cprod, + hypre_3Cptrs *tptrs, + hypre_1Cptr *mptrs, + HYPRE_Int *mentries, + HYPRE_Int ndim, + hypre_Index loop_size, + hypre_Box *cdbox, + hypre_Index cdstart, + hypre_Index cdstride, + hypre_Box *Mdbox, + hypre_Index Mdstart, + hypre_Index Mdstride ) +{ + HYPRE_Int k, depth; + + /* Variable declarations for up to HYPRE_FUSE_MAXDEPTH variables */ + HYPRE_SMMFUSE_DECLARE_20_4VARS; + + if (nprod < 1) + { + return hypre_error_flag; + } + +#if defined(DEBUG_MATMULT) && (DEBUG_MATMULT > 1) + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "=== FUSE_CC POINTERS ===\n"); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "Number of products (nprod): %d\n", nprod); + for (k = 0; k < nprod; k++) + { + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "Product %d:\n", k); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " cprod[%d] = %p (value: %e)\n", + k, (void*)&cprod[k], cprod[k]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " mptrs[%d] = %p (entry: %d)\n", + k, (void*)mptrs[k], mentries[k]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " tptrs[%d][0] = %p\n", + k, (void*)tptrs[k][0]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " tptrs[%d][1] = %p\n", + k, (void*)tptrs[k][1]); + } + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "=====================\n"); +#else + HYPRE_UNUSED_VAR(mentries); +#endif + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("cc"); + + for (k = 0; k < nprod; k += HYPRE_FUSE_MAXDEPTH) + { + depth = hypre_min(HYPRE_FUSE_MAXDEPTH, (nprod - k)); + + switch (depth) + { + case 20: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 20); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_CC_UP_TO_20; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 19: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 19); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_CC_UP_TO_19; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 18: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 18); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_CC_UP_TO_18; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 17: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 17); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_CC_UP_TO_17; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 16: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 16); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_CC_UP_TO_16; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 15: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 15); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_CC_UP_TO_15; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 14: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 14); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_CC_UP_TO_14; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 13: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 13); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_CC_UP_TO_13; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 12: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 12); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_CC_UP_TO_12; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 11: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 11); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_CC_UP_TO_11; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 10: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 10); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_CC_UP_TO_10; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 9: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 9); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_CC_UP_TO_9; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 8: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 8); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_CC_UP_TO_8; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 7: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 7); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_CC_UP_TO_7; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 6: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 6); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_CC_UP_TO_6; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 5: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 5); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_CC_UP_TO_5; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 4: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 4); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_CC_UP_TO_4; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 3: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 3); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_CC_UP_TO_3; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 2: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 2); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_CC_UP_TO_2; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 1: + HYPRE_SMMFUSE_LOAD_4VARS_UP_TO(k, 1); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_CC_UP_TO_1; + } + hypre_BoxLoop2End(Mi, ci); + break; + + default: + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unsupported loop fusion depth!"); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; + } + +#if defined(HYPRE_USING_GPU) + hypre_SyncComputeStream(); +#endif + } + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultCompute_fuse_f( HYPRE_Int nprod, + HYPRE_Complex *cprod, + hypre_3Cptrs *tptrs, + hypre_1Cptr *mptrs, + HYPRE_Int *mentries, + HYPRE_Int ndim, + hypre_Index loop_size, + hypre_Box *fdbox, + hypre_Index fdstart, + hypre_Index fdstride, + hypre_Box *Mdbox, + hypre_Index Mdstart, + hypre_Index Mdstride ) +{ + HYPRE_Int k, depth; + + /* Variable declarations for up to HYPRE_FUSE_MAXDEPTH variables */ + HYPRE_SMMFUSE_DECLARE_20_3VARS; + + if (nprod < 1) + { + return hypre_error_flag; + } + +#if defined(DEBUG_MATMULT) && (DEBUG_MATMULT > 1) + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "=== FUSE_F POINTERS ===\n"); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "Number of products (nprod): %d\n", nprod); + for (k = 0; k < nprod; k++) + { + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "Product %d:\n", k); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " cprod[%d] = %p (value: %e)\n", + k, (void*)&cprod[k], cprod[k]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " mptrs[%d] = %p (entry: %d)\n", + k, (void*)mptrs[k], mentries[k]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " tptrs[%d][0] = %p\n", + k, (void*)tptrs[k]); + } + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "=====================\n"); +#else + HYPRE_UNUSED_VAR(mentries); +#endif + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("f"); + + for (k = 0; k < nprod; k += HYPRE_FUSE_MAXDEPTH) + { + depth = hypre_min(HYPRE_FUSE_MAXDEPTH, (nprod - k)); + + switch (depth) + { + case 20: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 20); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_F_UP_TO_20; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 19: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 19); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_F_UP_TO_19; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 18: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 18); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_F_UP_TO_18; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 17: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 17); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_F_UP_TO_17; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 16: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 16); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_F_UP_TO_16; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 15: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 15); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_F_UP_TO_15; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 14: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 14); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_F_UP_TO_14; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 13: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 13); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_F_UP_TO_13; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 12: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 12); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_F_UP_TO_12; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 11: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 11); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_F_UP_TO_11; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 10: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 10); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_F_UP_TO_10; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 9: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 9); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_F_UP_TO_9; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 8: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 8); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_F_UP_TO_8; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 7: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 7); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_F_UP_TO_7; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 6: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 6); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_F_UP_TO_6; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 5: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 5); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_F_UP_TO_5; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 4: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 4); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_F_UP_TO_4; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 3: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 3); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_F_UP_TO_3; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 2: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 2); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_F_UP_TO_2; + } + hypre_BoxLoop2End(Mi, fi); + break; + + case 1: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 1); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi); + { + HYPRE_SMMFUSE_F_UP_TO_1; + } + hypre_BoxLoop2End(Mi, fi); + break; + + default: + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unsupported loop fusion depth!"); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; + } + +#if defined(HYPRE_USING_GPU) + hypre_SyncComputeStream(); +#endif + } + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Compute the fused product for C terms + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultCompute_fuse_c( HYPRE_Int nprod, + HYPRE_Complex *cprod, + hypre_3Cptrs *tptrs, + hypre_1Cptr *mptrs, + HYPRE_Int *mentries, + HYPRE_Int ndim, + hypre_Index loop_size, + hypre_Box *cdbox, + hypre_Index cdstart, + hypre_Index cdstride, + hypre_Box *Mdbox, + hypre_Index Mdstart, + hypre_Index Mdstride ) +{ + HYPRE_Int k, depth; + + /* Variable declarations for up to HYPRE_FUSE_MAXDEPTH variables */ + HYPRE_SMMFUSE_DECLARE_20_3VARS; + + if (nprod < 1) + { + return hypre_error_flag; + } + +#if defined(DEBUG_MATMULT) && (DEBUG_MATMULT > 1) + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "=== FUSE_C POINTERS ===\n"); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "Number of products (nprod): %d\n", nprod); + for (k = 0; k < nprod; k++) + { + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "Product %d:\n", k); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " cprod[%d] = %p (value: %e)\n", + k, (void*)&cprod[k], cprod[k]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " mptrs[%d] = %p (entry: %d)\n", + k, (void*)mptrs[k], mentries[k]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " tptrs[%d][0] = %p\n", + k, (void*)tptrs[k][0]); + } + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "=====================\n"); +#else + HYPRE_UNUSED_VAR(mentries); +#endif + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("c"); + + for (k = 0; k < nprod; k += HYPRE_FUSE_MAXDEPTH) + { + depth = hypre_min(HYPRE_FUSE_MAXDEPTH, (nprod - k)); + + switch (depth) + { + case 20: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 20); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_C_UP_TO_20; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 19: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 19); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_C_UP_TO_19; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 18: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 18); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_C_UP_TO_18; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 17: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 17); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_C_UP_TO_17; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 16: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 16); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_C_UP_TO_16; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 15: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 15); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_C_UP_TO_15; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 14: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 14); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_C_UP_TO_14; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 13: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 13); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_C_UP_TO_13; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 12: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 12); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_C_UP_TO_12; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 11: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 11); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_C_UP_TO_11; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 10: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 10); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_C_UP_TO_10; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 9: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 9); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_C_UP_TO_9; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 8: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 8); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_C_UP_TO_8; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 7: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 7); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_C_UP_TO_7; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 6: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 6); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_C_UP_TO_6; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 5: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 5); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_C_UP_TO_5; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 4: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 4); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_C_UP_TO_4; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 3: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 3); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_C_UP_TO_3; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 2: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 2); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_C_UP_TO_2; + } + hypre_BoxLoop2End(Mi, ci); + break; + + case 1: + HYPRE_SMMFUSE_LOAD_3VARS_UP_TO(k, 1); + hypre_BoxLoop2Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_C_UP_TO_1; + } + hypre_BoxLoop2End(Mi, ci); + break; + + default: + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unsupported loop fusion depth!"); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; + } + +#if defined(HYPRE_USING_GPU) + hypre_SyncComputeStream(); +#endif + } + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +#if defined (HYPRE_FUSE_FCC_FC_F) + +/*-------------------------------------------------------------------------- + * Compute the fused product for FCC, FC and F terms combined + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultCompute_fuse_fcc_fc_f( HYPRE_Int nprod_fcc, + HYPRE_Complex *cprod_fcc, + hypre_3Cptrs *tptrs_fcc, + hypre_1Cptr *mptrs_fcc, + HYPRE_Int *mentries_fcc, + HYPRE_Int nprod_fc, + HYPRE_Complex *cprod_fc, + hypre_3Cptrs *tptrs_fc, + hypre_1Cptr *mptrs_fc, + HYPRE_Int *mentries_fc, + HYPRE_Int nprod_f, + HYPRE_Complex *cprod_f, + hypre_3Cptrs *tptrs_f, + hypre_1Cptr *mptrs_f, + HYPRE_Int *mentries_f, + HYPRE_Int ndim, + hypre_Index loop_size, + hypre_Box *fdbox, + hypre_Index fdstart, + hypre_Index fdstride, + hypre_Box *cdbox, + hypre_Index cdstart, + hypre_Index cdstride, + hypre_Box *Mdbox, + hypre_Index Mdstart, + hypre_Index Mdstride, + HYPRE_Int Mnum_values, + hypre_1Cptr *mptrs, + HYPRE_Int *combined_ptr) +{ + /* Declare Mptrs, FFC, FC, and F data pointers */ + HYPRE_SMMFUSE_DECLARE_MPTRS_UP_TO_27; + HYPRE_SMMFUSE_DECLARE_FCC_UP_TO_36; + HYPRE_SMMFUSE_DECLARE_FC_UP_TO_72; + HYPRE_SMMFUSE_DECLARE_F_UP_TO_9; + + /* Set flag for combined execution of FCC, FC, and F products */ + *combined_ptr = 0; + if ((nprod_fcc == 11 && nprod_fc == 6 && nprod_f == 3 && Mnum_values == 8) || + (nprod_fcc == 19 && nprod_fc == 14 && nprod_f == 5 && Mnum_values == 14) || + (nprod_fcc == 19 && nprod_fc == 38 && nprod_f == 5 && Mnum_values == 14) || + (nprod_fcc == 20 && nprod_fc == 8 && nprod_f == 5 && Mnum_values == 15) || + (nprod_fcc == 36 && nprod_fc == 24 && nprod_f == 9 && Mnum_values == 27) || + (nprod_fcc == 36 && nprod_fc == 72 && nprod_f == 9 && Mnum_values == 27)) + { + *combined_ptr = 1; + } + else + { + return hypre_error_flag; + } + +#if defined(DEBUG_MATMULT) && (DEBUG_MATMULT > 1) + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "=== FUSE_FCC_FC_F POINTERS ===\n"); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "Number of (FCC, FC, F) products: (%d, %d, %d)\n", + nprod_fcc, nprod_fc, nprod_f); + for (k = 0; k < nprod_fcc; k++) + { + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "FCC Product %d:\n", k); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " cprod[%d] = %p (value: %e)\n", + k, (void*)&cprod_fcc[k], cprod_fcc[k]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " mptrs[%d] = %p (entry: %d)\n", + k, (void*)mptrs_fcc[k], mentries_fcc[k]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " tptrs[%d][0] = %p\n", + k, (void*)tptrs_fcc[k][0]); + } + for (k = 0; k < nprod_fc; k++) + { + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "FC Product %d:\n", k); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " cprod[%d] = %p (value: %e)\n", + k, (void*)&cprod_fc[k], cprod_fc[k]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " mptrs[%d] = %p (entry: %d)\n", + k, (void*)mptrs_fc[k], mentries_fc[k]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " tptrs[%d][0] = %p\n", + k, (void*)tptrs_fc[k][0]); + } + for (k = 0; k < nprod_f; k++) + { + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "F Product %d:\n", k); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " cprod[%d] = %p (value: %e)\n", + k, (void*)&cprod_f[k], cprod_f[k]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " mptrs[%d] = %p (entry: %d)\n", + k, (void*)mptrs_f[k], mentries_f[k]); + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " tptrs[%d][0] = %p\n", + k, (void*)tptrs_f[k][0]); + } + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "=====================\n"); + +#else + HYPRE_UNUSED_VAR(mentries_f); + HYPRE_UNUSED_VAR(mentries_fc); + HYPRE_UNUSED_VAR(mentries_fcc); +#endif + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("fcc_fc_f"); + + if (nprod_fcc == 11 && nprod_fc == 6 && nprod_f == 3 && Mnum_values == 8) + { + /* Load Mptrs, FCC, FC, and F data pointers */ + HYPRE_SMMFUSE_LOAD_MPTRS_UP_TO_8; + HYPRE_SMMFUSE_LOAD_FCC_UP_TO_11; + HYPRE_SMMFUSE_LOAD_FC_UP_TO_6; + HYPRE_SMMFUSE_LOAD_F_UP_TO_3; + + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_INIT_MPTRS_UP_TO_8; + + HYPRE_SMMFUSE_CALC_FCC_UP_TO_11; + HYPRE_SMMFUSE_CALC_FC_UP_TO_6; + HYPRE_SMMFUSE_CALC_F_UP_TO_3; + } + hypre_BoxLoop3End(Mi, fi, ci); + } + else if (nprod_fcc == 19 && nprod_fc == 14 && nprod_f == 5 && Mnum_values == 14) + { + /* Load Mptrs, FCC, FC, and F data pointers */ + HYPRE_SMMFUSE_LOAD_MPTRS_UP_TO_14; + HYPRE_SMMFUSE_LOAD_FCC_UP_TO_19; + HYPRE_SMMFUSE_LOAD_FC_UP_TO_14; + HYPRE_SMMFUSE_LOAD_F_UP_TO_5; + + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_INIT_MPTRS_UP_TO_14; + + HYPRE_SMMFUSE_CALC_FCC_UP_TO_19; + HYPRE_SMMFUSE_CALC_FC_UP_TO_14; + HYPRE_SMMFUSE_CALC_F_UP_TO_5; + } + hypre_BoxLoop3End(Mi, fi, ci); + } + else if (nprod_fcc == 19 && nprod_fc == 38 && nprod_f == 5 && Mnum_values == 14) + { + /* Load Mptrs, FCC, FC, and F data pointers */ + HYPRE_SMMFUSE_LOAD_MPTRS_UP_TO_14; + HYPRE_SMMFUSE_LOAD_FCC_UP_TO_19; + HYPRE_SMMFUSE_LOAD_FC_UP_TO_38; + HYPRE_SMMFUSE_LOAD_F_UP_TO_5; + + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_INIT_MPTRS_UP_TO_14; + + HYPRE_SMMFUSE_CALC_FCC_UP_TO_19; + HYPRE_SMMFUSE_CALC_FC_UP_TO_38; + HYPRE_SMMFUSE_CALC_F_UP_TO_5; + } + hypre_BoxLoop3End(Mi, fi, ci); + } + else if (nprod_fcc == 20 && nprod_fc == 8 && nprod_f == 5 && Mnum_values == 15) + { + /* Load Mptrs, FCC, FC, and F data pointers */ + HYPRE_SMMFUSE_LOAD_MPTRS_UP_TO_15; + HYPRE_SMMFUSE_LOAD_FCC_UP_TO_20; + HYPRE_SMMFUSE_LOAD_FC_UP_TO_8; + HYPRE_SMMFUSE_LOAD_F_UP_TO_5; + + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_INIT_MPTRS_UP_TO_15; + + HYPRE_SMMFUSE_CALC_FCC_UP_TO_20; + HYPRE_SMMFUSE_CALC_FC_UP_TO_8; + HYPRE_SMMFUSE_CALC_F_UP_TO_5; + } + hypre_BoxLoop3End(Mi, fi, ci); + } + else if (nprod_fcc == 36 && nprod_fc == 24 && nprod_f == 9 && Mnum_values == 27) + { + /* Load Mptrs, FCC, FC, and F data pointers */ + HYPRE_SMMFUSE_LOAD_MPTRS_UP_TO_27; + HYPRE_SMMFUSE_LOAD_FCC_UP_TO_36; + HYPRE_SMMFUSE_LOAD_FC_UP_TO_24; + HYPRE_SMMFUSE_LOAD_F_UP_TO_9; + + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_INIT_MPTRS_UP_TO_27; + + HYPRE_SMMFUSE_CALC_FCC_UP_TO_36; + HYPRE_SMMFUSE_CALC_FC_UP_TO_24; + HYPRE_SMMFUSE_CALC_F_UP_TO_9; + } + hypre_BoxLoop3End(Mi, fi, ci); + } + else if (nprod_fcc == 36 && nprod_fc == 72 && nprod_f == 9 && Mnum_values == 27) + { + /* Load Mptrs, FCC, FC, and F data pointers */ + HYPRE_SMMFUSE_LOAD_MPTRS_UP_TO_27; + HYPRE_SMMFUSE_LOAD_FCC_UP_TO_36; + HYPRE_SMMFUSE_LOAD_FC_UP_TO_72; + HYPRE_SMMFUSE_LOAD_F_UP_TO_9; + + hypre_BoxLoop3Begin(ndim, loop_size, + Mdbox, Mdstart, Mdstride, Mi, + fdbox, fdstart, fdstride, fi, + cdbox, cdstart, cdstride, ci); + { + HYPRE_SMMFUSE_INIT_MPTRS_UP_TO_27; + + HYPRE_SMMFUSE_CALC_FCC_UP_TO_36; + HYPRE_SMMFUSE_CALC_FC_UP_TO_72; + HYPRE_SMMFUSE_CALC_F_UP_TO_9; + } + hypre_BoxLoop3End(Mi, fi, ci); + } + else + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Not implemented!"); + } + +#if defined(HYPRE_USING_GPU) + hypre_SyncComputeStream(); +#endif + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} +#endif + +#if defined(USE_FUSE_SORT) +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +static HYPRE_Int +hypre_fuse_order_bigints( HYPRE_Int nprod, + HYPRE_Int *order, + HYPRE_BigInt *bigints ) +{ + HYPRE_Int k; + HYPRE_BigInt tmp_bigints[HYPRE_MAX_MMTERMS]; + + if (nprod >= HYPRE_MAX_MMTERMS) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Reached maximum allowed product index! Increase HYPRE_MAX_MMTERMS!"); + return hypre_error_flag; + } + + for (k = 0; k < nprod; k++) + { + tmp_bigints[k] = bigints[order[k]]; + } + for (k = 0; k < nprod; k++) + { + bigints[k] = tmp_bigints[k]; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +static HYPRE_Int +hypre_fuse_order_ptrs( HYPRE_Int nprod, + HYPRE_Int *order, + hypre_3Cptrs *tptrs, + hypre_1Cptr *mptrs ) +{ + HYPRE_Int k, i; + hypre_3Cptrs tmp_tptrs[HYPRE_MAX_MMTERMS]; + hypre_1Cptr tmp_mptrs[HYPRE_MAX_MMTERMS]; + + if (nprod >= HYPRE_MAX_MMTERMS) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Reached maximum allowed product index! Increase HYPRE_MAX_MMTERMS!"); + return hypre_error_flag; + } + + for (k = 0; k < nprod; k++) + { + for (i = 0; i < 3; i++) + { + tmp_tptrs[k][i] = tptrs[order[k]][i]; + } + } + for (k = 0; k < nprod; k++) + { + for (i = 0; i < 3; i++) + { + tptrs[k][i] = tmp_tptrs[k][i]; + } + } + for (k = 0; k < nprod; k++) + { + tmp_mptrs[k] = mptrs[order[k]]; + } + for (k = 0; k < nprod; k++) + { + mptrs[k] = tmp_mptrs[k]; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +static HYPRE_Int +hypre_fuse_sort( HYPRE_Int nprod, + hypre_3Cptrs *tptrs, + hypre_1Cptr *mptrs ) +{ + HYPRE_Int approach = 1; + + HYPRE_Int k; + HYPRE_Complex *minptrs[4]; + HYPRE_BigInt distances[4][HYPRE_MAX_MMTERMS]; + HYPRE_Int order[HYPRE_MAX_MMTERMS]; + + if ((nprod < 1) || (approach == 0)) + { + return hypre_error_flag; + } + + if (nprod >= HYPRE_MAX_MMTERMS) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Reached maximum allowed product index! Increase HYPRE_MAX_MMTERMS!"); + return hypre_error_flag + } + + /* Get minimum pointer addresses */ + minptrs[0] = tptrs[0][0]; + minptrs[1] = tptrs[0][1]; + minptrs[2] = tptrs[0][2]; + minptrs[3] = mptrs[0]; + for (k = 1; k < nprod; k++) + { + minptrs[0] = hypre_min( minptrs[0], tptrs[k][0] ); + minptrs[1] = hypre_min( minptrs[1], tptrs[k][1] ); + minptrs[2] = hypre_min( minptrs[2], tptrs[k][2] ); + minptrs[3] = hypre_min( minptrs[3], mptrs[k] ); + } + + /* Compute pointer distances and order array */ + for (k = 0; k < nprod; k++) + { + distances[0][k] = (HYPRE_Int) (tptrs[k][0] - minptrs[0]); + distances[1][k] = (HYPRE_Int) (tptrs[k][1] - minptrs[1]); + distances[2][k] = (HYPRE_Int) (tptrs[k][2] - minptrs[2]); + distances[3][k] = (HYPRE_Int) (mptrs[k] - minptrs[3]); + order[k] = k; + } + +#if defined(DEBUG_MATMULT) + /* Print distances */ + for (k = 0; k < nprod; k++) + { + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "distances[%2d] %16d %16d %16d %16d\n", + k, distances[0][k], distances[1][k], distances[2][k], distances[3][k]); + } + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "\n"); +#endif + + /* Sort according to middle column (index 1) */ + hypre_BigQsortbi(distances[1], order, 0, nprod - 1); + +#if defined(DEBUG_MATMULT) + hypre_fuse_order_bigints(nprod, order, distances[0]); + hypre_fuse_order_bigints(nprod, order, distances[2]); + hypre_fuse_order_bigints(nprod, order, distances[3]); + + /* Print order array */ + for (k = 0; k < nprod; k++) + { + hypre_ParPrintf(hypre_MPI_COMM_WORLD, " %d", order[k]); + } + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "\n\n"); + + /* Print distances */ + for (k = 0; k < nprod; k++) + { + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "distances[%2d] %16b %16b %16b %16b\n", + k, distances[0][k], distances[1][k], distances[2][k], distances[3][k]); + } + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "\n"); +#endif + + /* Reorder data pointers */ + hypre_fuse_order_ptrs(nprod, order, tptrs, mptrs); + + return hypre_error_flag; +} +#endif + +/*-------------------------------------------------------------------------- + * Compute the fused product for all terms + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatmultCompute_fuse( HYPRE_Int nterms, + hypre_StructMatmultDataMH *a, + HYPRE_Int na, + HYPRE_Int ndim, + hypre_Index loop_size, + HYPRE_Int stencil_size, + hypre_Box *fdbox, + hypre_Index fdstart, + hypre_Index fdstride, + hypre_Box *cdbox, + hypre_Index cdstart, + hypre_Index cdstride, + hypre_Box *Mdbox, + hypre_Index Mdstart, + hypre_Index Mdstride, + hypre_StructMatrix *M ) +{ +#if defined(HYPRE_FUSE_FCC_FC_F) + HYPRE_Int Mnum_values = hypre_StructMatrixNumValues(M); + hypre_1Cptr mmptrs[HYPRE_MAX_MMTERMS]; +#else + HYPRE_UNUSED_VAR(M); + HYPRE_UNUSED_VAR(stencil_size); +#endif + + HYPRE_Int nprod[8] = {0}; + HYPRE_Complex cprod[8][HYPRE_MAX_MMTERMS]; + hypre_3Cptrs tptrs[8][HYPRE_MAX_MMTERMS]; + hypre_1Cptr mptrs[8][HYPRE_MAX_MMTERMS]; + HYPRE_Int mentries[8][HYPRE_MAX_MMTERMS]; + + HYPRE_Int ptype = 0, nf, nc, nt; + HYPRE_Int i, k, t; + HYPRE_Int combined_fcc_fc_f = 0; + + /* Sanity check */ + if (nterms > 3) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Can't have more than 3 terms in StructMatmultCompute_fuse!"); + return hypre_error_flag; + } + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("fuse"); + + /* Build product arrays */ + for (i = 0; i < na; i++) + { + /* Determine number of fine and coarse terms */ + nf = nc = 0; + for (t = 0; t < nterms; t++) + { + if (a[i].types[t] == 1) + { + /* Type 1 -> coarse data space */ + nc++; + } + else if (a[i].types[t] != 3) + { + /* Type 0 or 2 -> fine data space */ + nf++; + } + } + nt = nf + nc; + + /* Determine product type */ + switch (nt) + { + case 3: + switch (nc) + { + case 0: /* fff term (call fuse_fff) */ + ptype = 0; + break; + + case 1: /* ffc term (call fuse_ffc) */ + ptype = 1; + break; + + case 2: /* fcc term (call fuse_fcc) */ + ptype = 2; + break; + } + break; + + case 2: + switch (nc) + { + case 0: /* ff term (call core_ff) */ + ptype = 3; + break; + + case 1: /* cf term (call core_fc) */ + ptype = 4; + break; + + case 2: /* cc term (call core_cc) */ + ptype = 5; + break; + } + break; + + case 1: + switch (nc) + { + case 0: /* f term (call core_f) */ + ptype = 6; + break; + + case 1: /* c term (call core_c) */ + ptype = 7; + break; + } + break; + + default: + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Can't have zero terms in StructMatmult!"); + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; + } + + /* Retrieve product index */ + k = nprod[ptype]; + if (k >= HYPRE_MAX_MMTERMS) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Reached maximum allowed product index! Increase HYPRE_MAX_MMTERMS!"); + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; + } + + /* Set array values for k-th product of type "ptype" */ + cprod[ptype][k] = a[i].cprod; + for (t = 0; t < nterms; t++) + { + tptrs[ptype][k][t] = NULL; + } + for (nf = 0, nc = 0, t = 0; t < nterms; t++) + { + if (a[i].types[t] == 1) + { + /* Type 1 -> coarse data space */ + tptrs[ptype][k][nt - 1 - nc] = a[i].tptrs[t]; /* put last */ + nc++; + } + else if (a[i].types[t] != 3) + { + /* Type 0 or 2 -> fine data space */ + tptrs[ptype][k][nf] = a[i].tptrs[t]; /* put first */ + nf++; + } + } + mentries[ptype][k] = a[i].mentry; + mptrs[ptype][k] = a[i].mptr; + nprod[ptype]++; + } /* loop i < na*/ + +#if defined(USE_FUSE_SORT) + for (i = 0; i < 8; i++) + { + hypre_fuse_sort(nprod[i], tptrs[i], mptrs[i]); + } +#endif + +#if defined(DEBUG_MATMULT) + const char *cases[8] = {"FFF", "FFC", "FCC", "FF", "FC", "CC", "F", "C"}; + + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "Number of products - "); + for (t = 0, k = 0, i = 0; i < 8; i++) + { + if (nprod[i] > 0) + { + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "%s: %d | ", cases[i], nprod[i]); + } + t += nprod[i]; + k += hypre_ceildiv(nprod[i], HYPRE_FUSE_MAXDEPTH); + } + hypre_ParPrintf(hypre_MPI_COMM_WORLD, "Sum: %d (%d BoxLoops)\n", t, k); +#endif + +#if defined(HYPRE_FUSE_FCC_FC_F) + /* Build pointers to M data arrays */ + for (k = 0, t = 0; k < stencil_size; k++) + { + for (i = 0; i < na; i++) + { + if (a[i].mentry != k) + { + continue; + } + + mmptrs[t++] = a[i].mptr; + i = na; + } + } + + /* Call fully fused (combined) functions */ + hypre_StructMatmultCompute_fuse_fcc_fc_f(nprod[2], cprod[2], tptrs[2], mptrs[2], mentries[2], + nprod[4], cprod[4], tptrs[4], mptrs[4], mentries[4], + nprod[6], cprod[6], tptrs[6], mptrs[6], mentries[6], + ndim, loop_size, + fdbox, fdstart, fdstride, + cdbox, cdstart, cdstride, + Mdbox, Mdstart, Mdstride, + Mnum_values, mmptrs, + &combined_fcc_fc_f); +#endif + + /* Call individual fuse functions */ + if (!combined_fcc_fc_f) + { + hypre_StructMatmultCompute_fuse_fcc(nprod[2], cprod[2], tptrs[2], + mptrs[2], mentries[2], + ndim, loop_size, + fdbox, fdstart, fdstride, + cdbox, cdstart, cdstride, + Mdbox, Mdstart, Mdstride); + + hypre_StructMatmultCompute_fuse_fc(nprod[4], cprod[4], tptrs[4], + mptrs[4], mentries[4], + ndim, loop_size, + fdbox, fdstart, fdstride, + cdbox, cdstart, cdstride, + Mdbox, Mdstart, Mdstride); + + hypre_StructMatmultCompute_fuse_f(nprod[6], cprod[6], tptrs[6], + mptrs[6], mentries[6], + ndim, loop_size, + fdbox, fdstart, fdstride, + Mdbox, Mdstart, Mdstride); + } + + hypre_StructMatmultCompute_fuse_fff(nprod[0], cprod[0], tptrs[0], + mptrs[0], mentries[0], + ndim, loop_size, + fdbox, fdstart, fdstride, + Mdbox, Mdstart, Mdstride); + + hypre_StructMatmultCompute_fuse_ffc(nprod[1], cprod[1], tptrs[1], + mptrs[1], mentries[1], + ndim, loop_size, + fdbox, fdstart, fdstride, + cdbox, cdstart, cdstride, + Mdbox, Mdstart, Mdstride); + + hypre_StructMatmultCompute_fuse_ff(nprod[3], cprod[3], tptrs[3], + mptrs[3], mentries[3], + ndim, loop_size, + fdbox, fdstart, fdstride, + Mdbox, Mdstart, Mdstride); + + hypre_StructMatmultCompute_fuse_cc(nprod[5], cprod[5], tptrs[5], + mptrs[5], mentries[5], + ndim, loop_size, + cdbox, cdstart, cdstride, + Mdbox, Mdstart, Mdstride); + + hypre_StructMatmultCompute_fuse_c(nprod[7], cprod[7], tptrs[7], + mptrs[7], mentries[7], + ndim, loop_size, + cdbox, cdstart, cdstride, + Mdbox, Mdstart, Mdstride); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} diff --git a/src/struct_mv/struct_matop.c b/src/struct_mv/struct_matop.c new file mode 100644 index 0000000000..d744c2bd9f --- /dev/null +++ b/src/struct_mv/struct_matop.c @@ -0,0 +1,958 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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" +#include "_hypre_struct_mv.hpp" + +#define UNROLL_MAXDEPTH 9 + +/*-------------------------------------------------------------------------- + * Returns 1 if there is a zero on the diagonal, otherwise returns 0. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixZeroDiagonal( hypre_StructMatrix *A ) +{ + HYPRE_Int ndim = hypre_StructMatrixNDim(A); + hypre_StructStencil *stencil = hypre_StructMatrixStencil(A); + HYPRE_Int diag_entry = hypre_StructStencilDiagEntry(stencil); + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(A); + + hypre_BoxArray *compute_boxes; + hypre_Box *compute_box; + + hypre_Index loop_size; + hypre_IndexRef start; + hypre_Index ustride; + + HYPRE_Complex *Ap; + hypre_Box *A_dbox; + HYPRE_Int i; + HYPRE_Real diag_product = 0.0; + HYPRE_Int zero_diag = 0; + + /*---------------------------------------------------------- + * Initialize some things + *----------------------------------------------------------*/ + + hypre_SetIndex(ustride, 1); + + compute_boxes = hypre_StructGridBoxes(hypre_StructMatrixGrid(A)); + hypre_ForBoxI(i, compute_boxes) + { + compute_box = hypre_BoxArrayBox(compute_boxes, i); + start = hypre_BoxIMin(compute_box); + A_dbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A), i); + hypre_BoxGetStrideSize(compute_box, ustride, loop_size); + + Ap = hypre_StructMatrixBoxData(A, i, diag_entry); + if (hypre_StructMatrixConstEntry(A, diag_entry)) + { + hypre_TMemcpy(&diag_product, Ap, HYPRE_Complex, 1, + HYPRE_MEMORY_HOST, memory_location); + diag_product = diag_product == 0 ? 1 : 0; + } + else + { +#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); +#elif defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) + ReduceSum diag_product_local(diag_product); +#else + HYPRE_Real diag_product_local = diag_product; +#endif + +#ifdef HYPRE_BOX_REDUCTION +#undef HYPRE_BOX_REDUCTION +#endif + +#if defined(HYPRE_USING_DEVICE_OPENMP) +#define HYPRE_BOX_REDUCTION map(tofrom:diag_product_local) reduction(+:diag_product_local) +#else +#define HYPRE_BOX_REDUCTION reduction(+:diag_product_local) +#endif + +#define DEVICE_VAR is_device_ptr(Ap) + hypre_BoxLoop1ReductionBegin(ndim, loop_size, A_dbox, start, ustride, + Ai, diag_product_local); + { + HYPRE_Real one = 1.0; + HYPRE_Real zero = 0.0; + if (Ap[Ai] == 0.0) + { + diag_product_local += one; + } + else + { + diag_product_local += zero; + } + } + hypre_BoxLoop1ReductionEnd(Ai, diag_product_local); +#undef DEVICE_VAR +#undef HYPRE_BOX_REDUCTION +#define HYPRE_BOX_REDUCTION + + diag_product += (HYPRE_Real) diag_product_local; + } + } + + if (diag_product > 0) + { + zero_diag = 1; + } + + return zero_diag; +} + +/*-------------------------------------------------------------------------- + * Core function for computing rowsum for constant coeficients in A. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixComputeRowSum_core_CC(hypre_StructMatrix *A, + hypre_StructVector *rowsum, + HYPRE_Int box_id, + HYPRE_Int nentries, + HYPRE_Int *entries, + hypre_Box *box, + hypre_Box *rdbox, + HYPRE_Int type) +{ + HYPRE_Int ndim = hypre_StructMatrixNDim(A); + + hypre_Index loop_size, ustride; + hypre_IndexRef start; + + HYPRE_Complex *Ap0 = NULL, *Ap1 = NULL, *Ap2 = NULL; + HYPRE_Complex *Ap3 = NULL, *Ap4 = NULL, *Ap5 = NULL; + HYPRE_Complex *Ap6 = NULL, *Ap7 = NULL, *Ap8 = NULL; + HYPRE_Complex *rp; + + start = hypre_BoxIMin(box); + hypre_BoxGetSize(box, loop_size); + hypre_SetIndex(ustride, 1); + rp = hypre_StructVectorBoxData(rowsum, box_id); + + switch (nentries) + { + case 9: + Ap8 = hypre_StructMatrixBoxData(A, box_id, entries[8]); + HYPRE_FALLTHROUGH; + + case 8: + Ap7 = hypre_StructMatrixBoxData(A, box_id, entries[7]); + HYPRE_FALLTHROUGH; + + case 7: + Ap6 = hypre_StructMatrixBoxData(A, box_id, entries[6]); + HYPRE_FALLTHROUGH; + + case 6: + Ap5 = hypre_StructMatrixBoxData(A, box_id, entries[5]); + HYPRE_FALLTHROUGH; + + case 5: + Ap4 = hypre_StructMatrixBoxData(A, box_id, entries[4]); + HYPRE_FALLTHROUGH; + + case 4: + Ap3 = hypre_StructMatrixBoxData(A, box_id, entries[3]); + HYPRE_FALLTHROUGH; + + case 3: + Ap2 = hypre_StructMatrixBoxData(A, box_id, entries[2]); + HYPRE_FALLTHROUGH; + + case 2: + Ap1 = hypre_StructMatrixBoxData(A, box_id, entries[1]); + HYPRE_FALLTHROUGH; + + case 1: + Ap0 = hypre_StructMatrixBoxData(A, box_id, entries[0]); + HYPRE_FALLTHROUGH; + + case 0: + break; + } + + if (type == 0) + { + /* Compute row sums */ + switch (nentries) + { + case 9: + hypre_BoxLoop1Begin(ndim, loop_size, + rdbox, start, ustride, ri) + { + rp[ri] += Ap0[0] + Ap1[0] + Ap2[0] + + Ap3[0] + Ap4[0] + Ap5[0] + + Ap6[0] + Ap7[0] + Ap8[0]; + } + hypre_BoxLoop1End(ri); + break; + + case 8: + hypre_BoxLoop1Begin(ndim, loop_size, + rdbox, start, ustride, ri); + + { + rp[ri] += Ap0[0] + Ap1[0] + Ap2[0] + + Ap3[0] + Ap4[0] + Ap5[0] + + Ap6[0] + Ap7[0]; + } + hypre_BoxLoop1End(ri); + break; + + case 7: + hypre_BoxLoop1Begin(ndim, loop_size, + rdbox, start, ustride, ri); + { + rp[ri] += Ap0[0] + Ap1[0] + Ap2[0] + + Ap3[0] + Ap4[0] + Ap5[0] + + Ap6[0]; + } + hypre_BoxLoop1End(ri); + break; + + case 6: + hypre_BoxLoop1Begin(ndim, loop_size, + rdbox, start, ustride, ri); + { + rp[ri] += Ap0[0] + Ap1[0] + Ap2[0] + + Ap3[0] + Ap4[0] + Ap5[0]; + } + hypre_BoxLoop1End(ri); + break; + + case 5: + hypre_BoxLoop1Begin(ndim, loop_size, + rdbox, start, ustride, ri); + { + rp[ri] += Ap0[0] + Ap1[0] + Ap2[0] + + Ap3[0] + Ap4[0]; + } + hypre_BoxLoop1End(ri); + break; + + case 4: + hypre_BoxLoop1Begin(ndim, loop_size, + rdbox, start, ustride, ri); + { + rp[ri] += Ap0[0] + Ap1[0] + Ap2[0] + + Ap3[0]; + } + hypre_BoxLoop1End(ri); + break; + + case 3: + hypre_BoxLoop1Begin(ndim, loop_size, + rdbox, start, ustride, ri); + { + rp[ri] += Ap0[0] + Ap1[0] + Ap2[0]; + } + hypre_BoxLoop1End(ri); + break; + + case 2: + hypre_BoxLoop1Begin(ndim, loop_size, + rdbox, start, ustride, ri); + { + rp[ri] += Ap0[0] + Ap1[0]; + } + hypre_BoxLoop1End(ri); + break; + + case 1: + hypre_BoxLoop1Begin(ndim, loop_size, + rdbox, start, ustride, ri); + { + rp[ri] += Ap0[0]; + } + hypre_BoxLoop1End(ri); + break; + + case 0: + break; + } /* switch (nentries) */ + } + else if (type == 1) + { + /* Compute absolute row sums */ + switch (nentries) + { + case 9: + hypre_BoxLoop1Begin(ndim, loop_size, + rdbox, start, ustride, ri) + { + rp[ri] += hypre_cabs(Ap0[0]) + hypre_cabs(Ap1[0]) + hypre_cabs(Ap2[0]) + + hypre_cabs(Ap3[0]) + hypre_cabs(Ap4[0]) + hypre_cabs(Ap5[0]) + + hypre_cabs(Ap6[0]) + hypre_cabs(Ap7[0]) + hypre_cabs(Ap8[0]); + } + hypre_BoxLoop1End(ri); + break; + + case 8: + hypre_BoxLoop1Begin(ndim, loop_size, + rdbox, start, ustride, ri); + + { + rp[ri] += hypre_cabs(Ap0[0]) + hypre_cabs(Ap1[0]) + hypre_cabs(Ap2[0]) + + hypre_cabs(Ap3[0]) + hypre_cabs(Ap4[0]) + hypre_cabs(Ap5[0]) + + hypre_cabs(Ap6[0]) + hypre_cabs(Ap7[0]); + } + hypre_BoxLoop1End(ri); + break; + + case 7: + hypre_BoxLoop1Begin(ndim, loop_size, + rdbox, start, ustride, ri); + { + rp[ri] += hypre_cabs(Ap0[0]) + hypre_cabs(Ap1[0]) + hypre_cabs(Ap2[0]) + + hypre_cabs(Ap3[0]) + hypre_cabs(Ap4[0]) + hypre_cabs(Ap5[0]) + + hypre_cabs(Ap6[0]); + } + hypre_BoxLoop1End(ri); + break; + + case 6: + hypre_BoxLoop1Begin(ndim, loop_size, + rdbox, start, ustride, ri); + { + rp[ri] += hypre_cabs(Ap0[0]) + hypre_cabs(Ap1[0]) + hypre_cabs(Ap2[0]) + + hypre_cabs(Ap3[0]) + hypre_cabs(Ap4[0]) + hypre_cabs(Ap5[0]); + } + hypre_BoxLoop1End(ri); + break; + + case 5: + hypre_BoxLoop1Begin(ndim, loop_size, + rdbox, start, ustride, ri); + { + rp[ri] += hypre_cabs(Ap0[0]) + hypre_cabs(Ap1[0]) + hypre_cabs(Ap2[0]) + + hypre_cabs(Ap3[0]) + hypre_cabs(Ap4[0]); + } + hypre_BoxLoop1End(ri); + break; + + case 4: + hypre_BoxLoop1Begin(ndim, loop_size, + rdbox, start, ustride, ri); + { + rp[ri] += hypre_cabs(Ap0[0]) + hypre_cabs(Ap1[0]) + hypre_cabs(Ap2[0]) + + hypre_cabs(Ap3[0]); + } + hypre_BoxLoop1End(ri); + break; + + case 3: + hypre_BoxLoop1Begin(ndim, loop_size, + rdbox, start, ustride, ri); + { + rp[ri] += hypre_cabs(Ap0[0]) + hypre_cabs(Ap1[0]) + hypre_cabs(Ap2[0]); + } + hypre_BoxLoop1End(ri); + break; + + case 2: + hypre_BoxLoop1Begin(ndim, loop_size, + rdbox, start, ustride, ri); + { + rp[ri] += hypre_cabs(Ap0[0]) + hypre_cabs(Ap1[0]); + } + hypre_BoxLoop1End(ri); + break; + + case 1: + hypre_BoxLoop1Begin(ndim, loop_size, + rdbox, start, ustride, ri); + { + rp[ri] += hypre_cabs(Ap0[0]); + } + hypre_BoxLoop1End(ri); + break; + + case 0: + break; + } /* switch (nentries) */ + } + else if (type == 2) + { + /* Compute squared row sums */ + switch (nentries) + { + case 9: + hypre_BoxLoop1Begin(ndim, loop_size, + rdbox, start, ustride, ri) + { + rp[ri] += Ap0[0] * Ap0[0] + Ap1[0] * Ap1[0] + Ap2[0] * Ap2[0] + + Ap3[0] * Ap3[0] + Ap4[0] * Ap4[0] + Ap5[0] * Ap5[0] + + Ap6[0] * Ap6[0] + Ap7[0] * Ap7[0] + Ap8[0] * Ap8[0]; + } + hypre_BoxLoop1End(ri); + break; + + case 8: + hypre_BoxLoop1Begin(ndim, loop_size, + rdbox, start, ustride, ri); + + { + rp[ri] += Ap0[0] * Ap0[0] + Ap1[0] * Ap1[0] + Ap2[0] * Ap2[0] + + Ap3[0] * Ap3[0] + Ap4[0] * Ap4[0] + Ap5[0] * Ap5[0] + + Ap6[0] * Ap6[0] + Ap7[0] * Ap7[0]; + } + hypre_BoxLoop1End(ri); + break; + + case 7: + hypre_BoxLoop1Begin(ndim, loop_size, + rdbox, start, ustride, ri); + { + rp[ri] += Ap0[0] * Ap0[0] + Ap1[0] * Ap1[0] + Ap2[0] * Ap2[0] + + Ap3[0] * Ap3[0] + Ap4[0] * Ap4[0] + Ap5[0] * Ap5[0] + + Ap6[0] * Ap6[0]; + } + hypre_BoxLoop1End(ri); + break; + + case 6: + hypre_BoxLoop1Begin(ndim, loop_size, + rdbox, start, ustride, ri); + { + rp[ri] += Ap0[0] * Ap0[0] + Ap1[0] * Ap1[0] + Ap2[0] * Ap2[0] + + Ap3[0] * Ap3[0] + Ap4[0] * Ap4[0] + Ap5[0] * Ap5[0]; + } + hypre_BoxLoop1End(ri); + break; + + case 5: + hypre_BoxLoop1Begin(ndim, loop_size, + rdbox, start, ustride, ri); + { + rp[ri] += Ap0[0] * Ap0[0] + Ap1[0] * Ap1[0] + Ap2[0] * Ap2[0] + + Ap3[0] * Ap3[0] + Ap4[0] * Ap4[0]; + } + hypre_BoxLoop1End(ri); + break; + + case 4: + hypre_BoxLoop1Begin(ndim, loop_size, + rdbox, start, ustride, ri); + { + rp[ri] += Ap0[0] * Ap0[0] + Ap1[0] * Ap1[0] + Ap2[0] * Ap2[0] + + Ap3[0] * Ap3[0]; + } + hypre_BoxLoop1End(ri); + break; + + case 3: + hypre_BoxLoop1Begin(ndim, loop_size, + rdbox, start, ustride, ri); + { + rp[ri] += Ap0[0] * Ap0[0] + Ap1[0] * Ap1[0] + Ap2[0] * Ap2[0]; + } + hypre_BoxLoop1End(ri); + break; + + case 2: + hypre_BoxLoop1Begin(ndim, loop_size, + rdbox, start, ustride, ri); + { + rp[ri] += Ap0[0] * Ap0[0] + Ap1[0] * Ap1[0]; + } + hypre_BoxLoop1End(ri); + break; + + case 1: + hypre_BoxLoop1Begin(ndim, loop_size, + rdbox, start, ustride, ri); + { + rp[ri] += Ap0[0] * Ap0[0]; + } + hypre_BoxLoop1End(ri); + break; + + case 0: + break; + } /* switch (nentries) */ + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Core function for computing rowsum for variable coeficients in A. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixComputeRowSum_core_VC(hypre_StructMatrix *A, + hypre_StructVector *rowsum, + HYPRE_Int box_id, + HYPRE_Int nentries, + HYPRE_Int *entries, + hypre_Box *box, + hypre_Box *Adbox, + hypre_Box *rdbox, + HYPRE_Int type) +{ + HYPRE_Int ndim = hypre_StructMatrixNDim(A); + + hypre_Index loop_size, ustride; + hypre_IndexRef start; + + HYPRE_Complex *Ap0 = NULL, *Ap1 = NULL, *Ap2 = NULL; + HYPRE_Complex *Ap3 = NULL, *Ap4 = NULL, *Ap5 = NULL; + HYPRE_Complex *Ap6 = NULL, *Ap7 = NULL, *Ap8 = NULL; + HYPRE_Complex *rp = NULL; + + start = hypre_BoxIMin(box); + hypre_BoxGetSize(box, loop_size); + hypre_SetIndex(ustride, 1); + rp = hypre_StructVectorBoxData(rowsum, box_id); + + switch (nentries) + { + case 9: + Ap8 = hypre_StructMatrixBoxData(A, box_id, entries[8]); + HYPRE_FALLTHROUGH; + + case 8: + Ap7 = hypre_StructMatrixBoxData(A, box_id, entries[7]); + HYPRE_FALLTHROUGH; + + case 7: + Ap6 = hypre_StructMatrixBoxData(A, box_id, entries[6]); + HYPRE_FALLTHROUGH; + + case 6: + Ap5 = hypre_StructMatrixBoxData(A, box_id, entries[5]); + HYPRE_FALLTHROUGH; + + case 5: + Ap4 = hypre_StructMatrixBoxData(A, box_id, entries[4]); + HYPRE_FALLTHROUGH; + + case 4: + Ap3 = hypre_StructMatrixBoxData(A, box_id, entries[3]); + HYPRE_FALLTHROUGH; + + case 3: + Ap2 = hypre_StructMatrixBoxData(A, box_id, entries[2]); + HYPRE_FALLTHROUGH; + + case 2: + Ap1 = hypre_StructMatrixBoxData(A, box_id, entries[1]); + HYPRE_FALLTHROUGH; + + case 1: + Ap0 = hypre_StructMatrixBoxData(A, box_id, entries[0]); + HYPRE_FALLTHROUGH; + + case 0: + break; + } + + if (type == 0) + { + /* Compute row sums */ + switch (nentries) + { + case 9: + hypre_BoxLoop2Begin(ndim, loop_size, + Adbox, start, ustride, Ai, + rdbox, start, ustride, ri) + { + rp[ri] += Ap0[Ai] + Ap1[Ai] + Ap2[Ai] + + Ap3[Ai] + Ap4[Ai] + Ap5[Ai] + + Ap6[Ai] + Ap7[Ai] + Ap8[Ai]; + } + hypre_BoxLoop2End(Ai, ri); + break; + + case 8: + hypre_BoxLoop2Begin(ndim, loop_size, + Adbox, start, ustride, Ai, + rdbox, start, ustride, ri); + + { + rp[ri] += Ap0[Ai] + Ap1[Ai] + Ap2[Ai] + + Ap3[Ai] + Ap4[Ai] + Ap5[Ai] + + Ap6[Ai] + Ap7[Ai]; + } + hypre_BoxLoop2End(Ai, ri); + break; + + case 7: + hypre_BoxLoop2Begin(ndim, loop_size, + Adbox, start, ustride, Ai, + rdbox, start, ustride, ri); + { + rp[ri] += Ap0[Ai] + Ap1[Ai] + Ap2[Ai] + + Ap3[Ai] + Ap4[Ai] + Ap5[Ai] + + Ap6[Ai]; + } + hypre_BoxLoop2End(Ai, ri); + break; + + case 6: + hypre_BoxLoop2Begin(ndim, loop_size, + Adbox, start, ustride, Ai, + rdbox, start, ustride, ri); + { + rp[ri] += Ap0[Ai] + Ap1[Ai] + Ap2[Ai] + + Ap3[Ai] + Ap4[Ai] + Ap5[Ai]; + } + hypre_BoxLoop2End(Ai, ri); + break; + + case 5: + hypre_BoxLoop2Begin(ndim, loop_size, + Adbox, start, ustride, Ai, + rdbox, start, ustride, ri); + { + rp[ri] += Ap0[Ai] + Ap1[Ai] + Ap2[Ai] + + Ap3[Ai] + Ap4[Ai]; + } + hypre_BoxLoop2End(Ai, ri); + break; + + case 4: + hypre_BoxLoop2Begin(ndim, loop_size, + Adbox, start, ustride, Ai, + rdbox, start, ustride, ri); + { + rp[ri] += Ap0[Ai] + Ap1[Ai] + Ap2[Ai] + + Ap3[Ai]; + } + hypre_BoxLoop2End(Ai, ri); + break; + + case 3: + hypre_BoxLoop2Begin(ndim, loop_size, + Adbox, start, ustride, Ai, + rdbox, start, ustride, ri); + { + rp[ri] += Ap0[Ai] + Ap1[Ai] + Ap2[Ai]; + } + hypre_BoxLoop2End(Ai, ri); + break; + + case 2: + hypre_BoxLoop2Begin(ndim, loop_size, + Adbox, start, ustride, Ai, + rdbox, start, ustride, ri); + { + rp[ri] += Ap0[Ai] + Ap1[Ai]; + } + hypre_BoxLoop2End(Ai, ri); + break; + + case 1: + hypre_BoxLoop2Begin(ndim, loop_size, + Adbox, start, ustride, Ai, + rdbox, start, ustride, ri); + { + rp[ri] += Ap0[Ai]; + } + hypre_BoxLoop2End(Ai, ri); + break; + + case 0: + break; + } /* switch (nentries) */ + } + else if (type == 1) + { + /* Compute absolute row sums */ + switch (nentries) + { + case 9: + hypre_BoxLoop2Begin(ndim, loop_size, + Adbox, start, ustride, Ai, + rdbox, start, ustride, ri) + { + rp[ri] += hypre_cabs(Ap0[Ai]) + hypre_cabs(Ap1[Ai]) + hypre_cabs(Ap2[Ai]) + + hypre_cabs(Ap3[Ai]) + hypre_cabs(Ap4[Ai]) + hypre_cabs(Ap5[Ai]) + + hypre_cabs(Ap6[Ai]) + hypre_cabs(Ap7[Ai]) + hypre_cabs(Ap8[Ai]); + } + hypre_BoxLoop2End(Ai, ri); + break; + + case 8: + hypre_BoxLoop2Begin(ndim, loop_size, + Adbox, start, ustride, Ai, + rdbox, start, ustride, ri); + + { + rp[ri] += hypre_cabs(Ap0[Ai]) + hypre_cabs(Ap1[Ai]) + hypre_cabs(Ap2[Ai]) + + hypre_cabs(Ap3[Ai]) + hypre_cabs(Ap4[Ai]) + hypre_cabs(Ap5[Ai]) + + hypre_cabs(Ap6[Ai]) + hypre_cabs(Ap7[Ai]); + } + hypre_BoxLoop2End(Ai, ri); + break; + + case 7: + hypre_BoxLoop2Begin(ndim, loop_size, + Adbox, start, ustride, Ai, + rdbox, start, ustride, ri); + { + rp[ri] += hypre_cabs(Ap0[Ai]) + hypre_cabs(Ap1[Ai]) + hypre_cabs(Ap2[Ai]) + + hypre_cabs(Ap3[Ai]) + hypre_cabs(Ap4[Ai]) + hypre_cabs(Ap5[Ai]) + + hypre_cabs(Ap6[Ai]); + } + hypre_BoxLoop2End(Ai, ri); + break; + + case 6: + hypre_BoxLoop2Begin(ndim, loop_size, + Adbox, start, ustride, Ai, + rdbox, start, ustride, ri); + { + rp[ri] += hypre_cabs(Ap0[Ai]) + hypre_cabs(Ap1[Ai]) + hypre_cabs(Ap2[Ai]) + + hypre_cabs(Ap3[Ai]) + hypre_cabs(Ap4[Ai]) + hypre_cabs(Ap5[Ai]); + } + hypre_BoxLoop2End(Ai, ri); + break; + + case 5: + hypre_BoxLoop2Begin(ndim, loop_size, + Adbox, start, ustride, Ai, + rdbox, start, ustride, ri); + { + rp[ri] += hypre_cabs(Ap0[Ai]) + hypre_cabs(Ap1[Ai]) + hypre_cabs(Ap2[Ai]) + + hypre_cabs(Ap3[Ai]) + hypre_cabs(Ap4[Ai]); + } + hypre_BoxLoop2End(Ai, ri); + break; + + case 4: + hypre_BoxLoop2Begin(ndim, loop_size, + Adbox, start, ustride, Ai, + rdbox, start, ustride, ri); + { + rp[ri] += hypre_cabs(Ap0[Ai]) + hypre_cabs(Ap1[Ai]) + hypre_cabs(Ap2[Ai]) + + hypre_cabs(Ap3[Ai]); + } + hypre_BoxLoop2End(Ai, ri); + break; + + case 3: + hypre_BoxLoop2Begin(ndim, loop_size, + Adbox, start, ustride, Ai, + rdbox, start, ustride, ri); + { + rp[ri] += hypre_cabs(Ap0[Ai]) + hypre_cabs(Ap1[Ai]) + hypre_cabs(Ap2[Ai]); + } + hypre_BoxLoop2End(Ai, ri); + break; + + case 2: + hypre_BoxLoop2Begin(ndim, loop_size, + Adbox, start, ustride, Ai, + rdbox, start, ustride, ri); + { + rp[ri] += hypre_cabs(Ap0[Ai]) + hypre_cabs(Ap1[Ai]); + } + hypre_BoxLoop2End(Ai, ri); + break; + + case 1: + hypre_BoxLoop2Begin(ndim, loop_size, + Adbox, start, ustride, Ai, + rdbox, start, ustride, ri); + { + rp[ri] += hypre_cabs(Ap0[Ai]); + } + hypre_BoxLoop2End(Ai, ri); + break; + + case 0: + break; + } /* switch (nentries) */ + } + else if (type == 2) + { + /* Compute squared row sums */ + switch (nentries) + { + case 9: + hypre_BoxLoop2Begin(ndim, loop_size, + Adbox, start, ustride, Ai, + rdbox, start, ustride, ri) + { + rp[ri] += Ap0[Ai] * Ap0[Ai] + Ap1[Ai] * Ap1[Ai] + Ap2[Ai] * Ap2[Ai] + + Ap3[Ai] * Ap3[Ai] + Ap4[Ai] * Ap4[Ai] + Ap5[Ai] * Ap5[Ai] + + Ap6[Ai] * Ap6[Ai] + Ap7[Ai] * Ap7[Ai] + Ap8[Ai] * Ap8[Ai]; + } + hypre_BoxLoop2End(Ai, ri); + break; + + case 8: + hypre_BoxLoop2Begin(ndim, loop_size, + Adbox, start, ustride, Ai, + rdbox, start, ustride, ri); + + { + rp[ri] += Ap0[Ai] * Ap0[Ai] + Ap1[Ai] * Ap1[Ai] + Ap2[Ai] * Ap2[Ai] + + Ap3[Ai] * Ap3[Ai] + Ap4[Ai] * Ap4[Ai] + Ap5[Ai] * Ap5[Ai] + + Ap6[Ai] * Ap6[Ai] + Ap7[Ai] * Ap7[Ai]; + } + hypre_BoxLoop2End(Ai, ri); + break; + + case 7: + hypre_BoxLoop2Begin(ndim, loop_size, + Adbox, start, ustride, Ai, + rdbox, start, ustride, ri); + { + rp[ri] += Ap0[Ai] * Ap0[Ai] + Ap1[Ai] * Ap1[Ai] + Ap2[Ai] * Ap2[Ai] + + Ap3[Ai] * Ap3[Ai] + Ap4[Ai] * Ap4[Ai] + Ap5[Ai] * Ap5[Ai] + + Ap6[Ai] * Ap6[Ai]; + } + hypre_BoxLoop2End(Ai, ri); + break; + + case 6: + hypre_BoxLoop2Begin(ndim, loop_size, + Adbox, start, ustride, Ai, + rdbox, start, ustride, ri); + { + rp[ri] += Ap0[Ai] * Ap0[Ai] + Ap1[Ai] * Ap1[Ai] + Ap2[Ai] * Ap2[Ai] + + Ap3[Ai] * Ap3[Ai] + Ap4[Ai] * Ap4[Ai] + Ap5[Ai] * Ap5[Ai]; + } + hypre_BoxLoop2End(Ai, ri); + break; + + case 5: + hypre_BoxLoop2Begin(ndim, loop_size, + Adbox, start, ustride, Ai, + rdbox, start, ustride, ri); + { + rp[ri] += Ap0[Ai] * Ap0[Ai] + Ap1[Ai] * Ap1[Ai] + Ap2[Ai] * Ap2[Ai] + + Ap3[Ai] * Ap3[Ai] + Ap4[Ai] * Ap4[Ai]; + } + hypre_BoxLoop2End(Ai, ri); + break; + + case 4: + hypre_BoxLoop2Begin(ndim, loop_size, + Adbox, start, ustride, Ai, + rdbox, start, ustride, ri); + { + rp[ri] += Ap0[Ai] * Ap0[Ai] + Ap1[Ai] * Ap1[Ai] + Ap2[Ai] * Ap2[Ai] + + Ap3[Ai] * Ap3[Ai]; + } + hypre_BoxLoop2End(Ai, ri); + break; + + case 3: + hypre_BoxLoop2Begin(ndim, loop_size, + Adbox, start, ustride, Ai, + rdbox, start, ustride, ri); + { + rp[ri] += Ap0[Ai] * Ap0[Ai] + Ap1[Ai] * Ap1[Ai] + Ap2[Ai] * Ap2[Ai]; + } + hypre_BoxLoop2End(Ai, ri); + break; + + case 2: + hypre_BoxLoop2Begin(ndim, loop_size, + Adbox, start, ustride, Ai, + rdbox, start, ustride, ri); + { + rp[ri] += Ap0[Ai] * Ap0[Ai] + Ap1[Ai] * Ap1[Ai]; + } + hypre_BoxLoop2End(Ai, ri); + break; + + case 1: + hypre_BoxLoop2Begin(ndim, loop_size, + Adbox, start, ustride, Ai, + rdbox, start, ustride, ri); + { + rp[ri] += Ap0[Ai] * Ap0[Ai]; + } + hypre_BoxLoop2End(Ai, ri); + break; + + case 0: + break; + } /* switch (nentries) */ + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * RDF TODO: This routine should assume that the base grid for A and rowsum are + * the same. It should use the range boxes of A and work for general + * rectangular matrices. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixComputeRowSum( hypre_StructMatrix *A, + HYPRE_Int type, + hypre_StructVector *rowsum ) +{ + hypre_StructStencil *stencil = hypre_StructMatrixStencil(A); + hypre_StructGrid *grid = hypre_StructVectorGrid(A); + hypre_BoxArray *boxes = hypre_StructGridBoxes(grid); + HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); + + hypre_Box *box; + hypre_Box *rdbox; + hypre_Box *Adbox; + hypre_Index loop_size; + HYPRE_Int k, i, si; + HYPRE_Int depth, cdepth, vdepth; + HYPRE_Int csi[UNROLL_MAXDEPTH], vsi[UNROLL_MAXDEPTH]; + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("StructMatrixComputeRowSum"); + + hypre_ForBoxI(i, boxes) + { + box = hypre_BoxArrayBox(boxes, i); + hypre_BoxGetSize(box, loop_size); + + Adbox = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A), i); + rdbox = hypre_BoxArrayBox(hypre_StructVectorDataSpace(rowsum), i); + + /* unroll up to depth UNROLL_MAXDEPTH */ + for (si = 0; si < stencil_size; si += UNROLL_MAXDEPTH) + { + depth = hypre_min(UNROLL_MAXDEPTH, (stencil_size - si)); + + cdepth = vdepth = 0; + for (k = 0; k < depth; k++) + { + if (hypre_StructMatrixConstEntry(A, si + k)) + { + csi[cdepth++] = si + k; + } + else + { + vsi[vdepth++] = si + k; + } + } + + /* Operate on constant coefficients */ + hypre_StructMatrixComputeRowSum_core_CC(A, rowsum, i, cdepth, csi, + box, rdbox, type); + + /* Operate on variable coefficients */ + hypre_StructMatrixComputeRowSum_core_VC(A, rowsum, i, vdepth, vsi, + box, Adbox, rdbox, type); + } /* loop on stencil entries */ + } + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} diff --git a/src/struct_mv/struct_matrix.c b/src/struct_mv/struct_matrix.c index e4131e3a3c..0f7b970c08 100644 --- a/src/struct_mv/struct_matrix.c +++ b/src/struct_mv/struct_matrix.c @@ -13,12 +13,509 @@ #include "_hypre_struct_mv.h" #include "_hypre_struct_mv.hpp" +#ifdef HYPRE_COMPLEX +#include +#endif + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixGetFStride( hypre_StructMatrix *matrix, + hypre_IndexRef *fstride ) +{ + *fstride = hypre_StructMatrixRanStride(matrix); + if (hypre_StructMatrixRangeIsCoarse(matrix)) + { + *fstride = hypre_StructMatrixDomStride(matrix); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixGetCStride( hypre_StructMatrix *matrix, + hypre_IndexRef *cstride ) +{ + *cstride = hypre_StructMatrixRanStride(matrix); + if (hypre_StructMatrixDomainIsCoarse(matrix)) + { + *cstride = hypre_StructMatrixDomStride(matrix); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Matrix data is currently stored relative to the coarse matrix stride + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixGetDataMapStride( hypre_StructMatrix *matrix, + hypre_IndexRef *stride ) +{ + hypre_StructMatrixGetCStride(matrix, stride); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * This routine assumes that 'dindex' is in the range index space. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixMapDataIndex( hypre_StructMatrix *matrix, + hypre_Index dindex ) +{ + HYPRE_Int ndim = hypre_StructMatrixNDim(matrix); + hypre_IndexRef stride; + + hypre_StructMatrixGetDataMapStride(matrix, &stride); + if (hypre_StructMatrixDomainIsCoarse(matrix)) + { + hypre_SnapIndexNeg(dindex, NULL, stride, ndim); + } + hypre_MapToCoarseIndex(dindex, NULL, stride, ndim); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * This routine first ensures that the lower and upper indexes of 'dbox' are in + * the range index space. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixMapDataBox( hypre_StructMatrix *matrix, + hypre_Box *dbox ) +{ + if (hypre_StructMatrixRangeIsCoarse(matrix)) + { + hypre_ProjectBox(dbox, NULL, hypre_StructMatrixRanStride(matrix)); + } + hypre_StructMatrixMapDataIndex(matrix, hypre_BoxIMin(dbox)); + hypre_StructMatrixMapDataIndex(matrix, hypre_BoxIMax(dbox)); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixMapDataStride( hypre_StructMatrix *matrix, + hypre_Index dstride ) +{ + HYPRE_Int ndim = hypre_StructMatrixNDim(matrix); + hypre_IndexRef stride; + + hypre_StructMatrixGetDataMapStride(matrix, &stride); + hypre_MapToCoarseIndex(dstride, NULL, stride, ndim); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixUnMapDataIndex( hypre_StructMatrix *matrix, + hypre_Index dindex ) +{ + HYPRE_Int ndim = hypre_StructMatrixNDim(matrix); + hypre_IndexRef stride; + + hypre_StructMatrixGetDataMapStride(matrix, &stride); + hypre_MapToFineIndex(dindex, NULL, stride, ndim); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixUnMapDataBox( hypre_StructMatrix *matrix, + hypre_Box *dbox ) +{ + hypre_StructMatrixUnMapDataIndex(matrix, hypre_BoxIMin(dbox)); + hypre_StructMatrixUnMapDataIndex(matrix, hypre_BoxIMax(dbox)); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixUnMapDataStride( hypre_StructMatrix *matrix, + hypre_Index dstride ) +{ + HYPRE_Int ndim = hypre_StructMatrixNDim(matrix); + hypre_IndexRef stride; + + hypre_StructMatrixGetDataMapStride(matrix, &stride); + hypre_MapToFineIndex(dstride, NULL, stride, ndim); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Places the center of the stencil correctly on the base index space given a + * stencil entry and a data index. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixPlaceStencil( hypre_StructMatrix *matrix, + HYPRE_Int entry, + hypre_Index dindex, + hypre_Index index ) +{ + HYPRE_Int ndim = hypre_StructMatrixNDim(matrix); + + /* Map the data index to the base index space */ + hypre_CopyToIndex(dindex, ndim, index); + hypre_StructMatrixUnMapDataIndex(matrix, index); + + if (hypre_StructMatrixDomainIsCoarse(matrix)) + { + hypre_IndexRef stride = hypre_StructMatrixDomStride(matrix); + hypre_StructStencil *stencil = hypre_StructMatrixStencil(matrix); + hypre_IndexRef offset = hypre_StructStencilOffset(stencil, entry); + hypre_Index snapoffset; + + /* Shift to the right based on offset: index += (SnapIndexPos(offset) - offset) */ + hypre_CopyToIndex(offset, ndim, snapoffset); + hypre_SnapIndexPos(snapoffset, NULL, stride, ndim); + hypre_AddIndexes(index, snapoffset, ndim, index); /* + SnapIndexPos(offset) */ + hypre_SubtractIndexes(index, offset, ndim, index); /* - offset */ + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Same as hypre_StructMatrixGetStencilSpace(), but just returns the stride. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixGetStencilStride( hypre_StructMatrix *matrix, + hypre_Index stride ) +{ + HYPRE_Int ndim = hypre_StructMatrixNDim(matrix); + + if (hypre_StructMatrixDomainIsCoarse(matrix)) + { + hypre_CopyToIndex(hypre_StructMatrixDomStride(matrix), ndim, stride); + } + else + { + hypre_CopyToIndex(hypre_StructMatrixRanStride(matrix), ndim, stride); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Returns the (origin,stride) index space for a given stencil entry in a + * canonical representation with origin in the interval [0, stride). + * If transpose is set, the transpose of the matrix is used instead. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixGetStencilSpace( hypre_StructMatrix *matrix, + HYPRE_Int entry, + HYPRE_Int transpose, + hypre_Index origin, + hypre_Index stride ) +{ + HYPRE_Int ndim = hypre_StructMatrixNDim(matrix); + hypre_StructStencil *stencil = hypre_StructMatrixStencil(matrix); + hypre_IndexRef offset = hypre_StructStencilOffset(stencil, entry); + + /* Initialize origin */ + hypre_SetIndex(origin, 0); + + /* Note that if stride = 1, then ConvertToCanonicalIndex() below would always + * set origin = 0, so the 'if' checks for Domain/RangeIsCoarse only eliminate + * unecessary computations; they are not strictly needed. */ + hypre_StructMatrixGetStencilStride(matrix, stride); + if ( !transpose && hypre_StructMatrixDomainIsCoarse(matrix) ) + { + hypre_SubtractIndexes(origin, offset, ndim, origin); /* origin -= offset */ + /* Convert origin to a canonical representation in [0, stride) */ + hypre_ConvertToCanonicalIndex(origin, stride, ndim); + } + else if ( transpose && hypre_StructMatrixRangeIsCoarse(matrix) ) + { + hypre_AddIndexes(origin, offset, ndim, origin); /* origin += offset */ + /* Convert origin to a canonical representation in [0, stride) */ + hypre_ConvertToCanonicalIndex(origin, stride, ndim); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Compute the unique set of "stencil spaces", the stencil entries that belong + * to each space, and the corresponding origins and stride (only one). + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixGetStSpaces( hypre_StructMatrix *matrix, + HYPRE_Int transpose, + HYPRE_Int *num_sspaces_ptr, + HYPRE_Int **sentry_sspaces_ptr, + hypre_Index **sspace_origins_ptr, + hypre_Index stride ) +{ + HYPRE_Int ndim = hypre_StructMatrixNDim(matrix); + hypre_StructStencil *stencil = hypre_StructMatrixStencil(matrix); + HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); + + HYPRE_Int num_sspaces; + HYPRE_Int *sentry_sspaces; + hypre_Index *sspace_origins; + + hypre_Index origin; + HYPRE_Int e, s; + + sentry_sspaces = hypre_TAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); + sspace_origins = hypre_TAlloc(hypre_Index, stencil_size, HYPRE_MEMORY_HOST); + num_sspaces = 0; + for (e = 0; e < stencil_size; e++) + { + hypre_StructMatrixGetStencilSpace(matrix, e, transpose, origin, stride); + + for (s = 0; s < num_sspaces; s++) + { + /* Only check origin (assume that stride is always the same) */ + if ( hypre_IndexesEqual(origin, sspace_origins[s], ndim) ) + { + break; + } + } + sentry_sspaces[e] = s; + + if (s == num_sspaces) + { + /* This is a new space */ + hypre_CopyToIndex(origin, ndim, sspace_origins[s]); + num_sspaces++; + } + } + + /* Set return values */ + *num_sspaces_ptr = num_sspaces; + *sentry_sspaces_ptr = sentry_sspaces; + *sspace_origins_ptr = sspace_origins; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixMapCommInfo( hypre_StructMatrix *matrix, + hypre_IndexRef origin, + hypre_Index stride, + hypre_CommInfo *comm_info ) +{ + HYPRE_Int ndim = hypre_StructMatrixNDim(matrix); + hypre_IndexRef dmstride; + + /* Map the comm_info boxes only for non-unit stride */ + hypre_StructMatrixGetDataMapStride(matrix, &dmstride); + if ( !hypre_IndexEqual(stride, 1, ndim) || + !hypre_IndexEqual(dmstride, 1, ndim) ) + { + hypre_BoxArrayArray *boxaa; + hypre_BoxArray *boxa; + hypre_Box *box; + HYPRE_Int i, j; + + boxaa = hypre_CommInfoSendBoxes(comm_info); + hypre_ForBoxArrayI(i, boxaa) + { + boxa = hypre_BoxArrayArrayBoxArray(boxaa, i); + hypre_ForBoxI(j, boxa) + { + box = hypre_BoxArrayBox(boxa, j); + hypre_ProjectBox(box, origin, stride); + hypre_StructMatrixMapDataBox(matrix, box); + } + } + + boxaa = hypre_CommInfoSendRBoxes(comm_info); + hypre_ForBoxArrayI(i, boxaa) + { + boxa = hypre_BoxArrayArrayBoxArray(boxaa, i); + hypre_ForBoxI(j, boxa) + { + box = hypre_BoxArrayBox(boxa, j); + hypre_ProjectBox(box, origin, stride); + hypre_StructMatrixMapDataBox(matrix, box); + } + } + + boxaa = hypre_CommInfoRecvBoxes(comm_info); + hypre_ForBoxArrayI(i, boxaa) + { + boxa = hypre_BoxArrayArrayBoxArray(boxaa, i); + hypre_ForBoxI(j, boxa) + { + box = hypre_BoxArrayBox(boxa, j); + hypre_ProjectBox(box, origin, stride); + hypre_StructMatrixMapDataBox(matrix, box); + } + } + + boxaa = hypre_CommInfoRecvRBoxes(comm_info); + hypre_ForBoxArrayI(i, boxaa) + { + boxa = hypre_BoxArrayArrayBoxArray(boxaa, i); + hypre_ForBoxI(j, boxa) + { + box = hypre_BoxArrayBox(boxa, j); + hypre_ProjectBox(box, origin, stride); + hypre_StructMatrixMapDataBox(matrix, box); + } + } + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Create a matrix communication package from comm_info and destroy comm_info. + * + * When the domain is coarse, multiple intermediate communication packages are + * first created, then agglomerated into one. This is because only a subset of + * the stencil entries is valid for any given range-space index (for example, + * linear interpolation in 1D uses the east and west coefficients at F-points + * and the center coefficient at C-points). Hence, for a given send or receive + * box in 'comm_info', the corresponding data box may be different for different + * stencil entries. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixCreateCommPkg( hypre_StructMatrix *matrix, + hypre_CommInfo *comm_info, + hypre_CommPkg **comm_pkg_ptr, + HYPRE_Complex ***comm_data_ptr ) +{ + hypre_CommPkg *comm_pkg; + HYPRE_Complex **comm_data; + + HYPRE_Int num_values = hypre_StructMatrixNumValues(matrix); + + if (hypre_StructMatrixDomainIsCoarse(matrix)) + { + hypre_CommInfo *comm_info_clone; + hypre_CommPkg **comm_pkgs; + hypre_StructStencil *stencil = hypre_StructMatrixStencil(matrix); + HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); + HYPRE_Int *constant = hypre_StructMatrixConstant(matrix); + HYPRE_Int *symm = hypre_StructMatrixSymmEntries(matrix); + hypre_Index *origins, stride; + HYPRE_Int *v_to_s, *s_to_v, *order; + HYPRE_Int *stencil_spaces, num_spaces; + HYPRE_Int i, e, s; + + /* Compute mappings between "values" (v) and "stencil entries" (s). + * Consider pre-computing this and storing in the matrix itself. */ + v_to_s = hypre_TAlloc(HYPRE_Int, num_values, HYPRE_MEMORY_HOST); + s_to_v = hypre_TAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); + for (e = 0, i = 0; e < stencil_size; e++) + { + s_to_v[e] = -1; + if ((symm[e] < 0) && (!constant[e])) /* this is a stored variable coefficient */ + { + v_to_s[i] = e; + s_to_v[e] = i; + i++; + } + } + + /* Get the stencil spaces (each space may induce different data boxes for communication). */ + hypre_StructMatrixGetStSpaces(matrix, 0, &num_spaces, &stencil_spaces, &origins, stride); + + /* Compute communication packages for each stencil space */ + comm_pkgs = hypre_TAlloc(hypre_CommPkg *, num_spaces, HYPRE_MEMORY_HOST); + comm_data = hypre_TAlloc(HYPRE_Complex *, num_spaces, HYPRE_MEMORY_HOST); + order = hypre_TAlloc(HYPRE_Int, num_values, HYPRE_MEMORY_HOST); + for (s = 0; s < num_spaces; s++) + { + /* Set order[i] = -1 to skip values not in this stencil space */ + for (i = 0; i < num_values; i++) + { + order[i] = i; + if (stencil_spaces[v_to_s[i]] != s) + { + order[i] = -1; + } + } + hypre_CommInfoClone(comm_info, &comm_info_clone); + hypre_StructMatrixMapCommInfo(matrix, origins[s], stride, comm_info_clone); + hypre_CommPkgCreate(comm_info_clone, + hypre_StructMatrixDataSpace(matrix), + hypre_StructMatrixDataSpace(matrix), num_values, &order, 0, + hypre_StructMatrixComm(matrix), + hypre_StructMatrixMemoryLocation(matrix), + &comm_pkgs[s]); + comm_data[s] = hypre_StructMatrixVData(matrix); + hypre_CommInfoDestroy(comm_info_clone); + } + hypre_TFree(order, HYPRE_MEMORY_HOST); + hypre_TFree(stencil_spaces, HYPRE_MEMORY_HOST); + hypre_TFree(origins, HYPRE_MEMORY_HOST); + hypre_TFree(v_to_s, HYPRE_MEMORY_HOST); + hypre_TFree(s_to_v, HYPRE_MEMORY_HOST); + + /* Agglomerate comm_pkgs into one comm_pkg */ + comm_pkg = comm_pkgs[0]; + if (num_spaces > 1) + { + hypre_CommPkgAgglomerate(num_spaces, comm_pkgs, &comm_pkg); + for (s = 0; s < num_spaces; s++) + { + hypre_CommPkgDestroy(comm_pkgs[s]); + } + } + hypre_TFree(comm_pkgs, HYPRE_MEMORY_HOST); + } + else + { + hypre_IndexRef stride; + + comm_data = hypre_TAlloc(HYPRE_Complex *, 1, HYPRE_MEMORY_HOST); + hypre_StructMatrixGetDataMapStride(matrix, &stride); + hypre_StructMatrixMapCommInfo(matrix, NULL, stride, comm_info); + hypre_CommPkgCreate(comm_info, + hypre_StructMatrixDataSpace(matrix), + hypre_StructMatrixDataSpace(matrix), num_values, NULL, 0, + hypre_StructMatrixComm(matrix), + hypre_StructMatrixMemoryLocation(matrix), + &comm_pkg); + comm_data[0] = hypre_StructMatrixVData(matrix); + } + + hypre_CommInfoDestroy(comm_info); + + *comm_pkg_ptr = comm_pkg; + *comm_data_ptr = comm_data; + + return hypre_error_flag; +} /*-------------------------------------------------------------------------- - * hypre_StructMatrixExtractPointerByIndex - * Returns pointer to data for stencil entry coresponding to - * `index' in `matrix'. If the index does not exist in the matrix's - * stencil, the NULL pointer is returned. + * Returns a pointer to data in `matrix' coresponding to the stencil offset + * specified by `index'. If index does not exist in the matrix stencil, the NULL + * pointer is returned. *--------------------------------------------------------------------------*/ HYPRE_Complex * @@ -27,410 +524,760 @@ hypre_StructMatrixExtractPointerByIndex( hypre_StructMatrix *matrix, hypre_Index index ) { hypre_StructStencil *stencil; - HYPRE_Int rank; + HYPRE_Int entry; stencil = hypre_StructMatrixStencil(matrix); - rank = hypre_StructStencilElementRank( stencil, index ); + entry = hypre_StructStencilOffsetEntry( stencil, index ); + + if ( entry >= 0 ) + { + return hypre_StructMatrixBoxData(matrix, b, entry); + } + else + { + return NULL; /* error - invalid index */ + } +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +hypre_StructMatrix * +hypre_StructMatrixCreate( MPI_Comm comm, + hypre_StructGrid *grid, + hypre_StructStencil *user_stencil ) +{ + HYPRE_Int ndim = hypre_StructGridNDim(grid); + hypre_StructMatrix *matrix; + HYPRE_Int i; + + matrix = hypre_CTAlloc(hypre_StructMatrix, 1, HYPRE_MEMORY_HOST); + + hypre_StructMatrixComm(matrix) = comm; + hypre_StructGridRef(grid, &hypre_StructMatrixGrid(matrix)); + hypre_StructMatrixSetRangeStride(matrix, NULL); /* Set default stride */ + hypre_StructMatrixSetDomainStride(matrix, NULL); /* Set default stride */ + hypre_StructMatrixUserStencil(matrix) = + hypre_StructStencilRef(user_stencil); + hypre_StructMatrixConstant(matrix) = + hypre_CTAlloc(HYPRE_Int, hypre_StructStencilSize(user_stencil), HYPRE_MEMORY_HOST); + hypre_StructMatrixDataAlloced(matrix) = 1; + hypre_StructMatrixRefCount(matrix) = 1; + + /* set defaults */ + hypre_StructMatrixRangeIsCoarse(matrix) = 0; + hypre_StructMatrixDomainIsCoarse(matrix) = 0; + hypre_StructMatrixSymmetric(matrix) = 0; + hypre_StructMatrixConstantCoefficient(matrix) = 0; + + /* RDF TODO: Change to work with default num ghost of zero */ + for (i = 0; i < 2 * ndim; i++) + { + hypre_StructMatrixNumGhost(matrix)[i] = hypre_StructGridNumGhost(grid)[i]; + hypre_StructMatrixSymGhost(matrix)[i] = 0; + hypre_StructMatrixTrnGhost(matrix)[i] = 0; + } + + hypre_StructMatrixMemoryLocation(matrix) = hypre_HandleMemoryLocation(hypre_handle()); + +#if defined(HYPRE_MIXED_PRECISION) + hypre_StructMatrixPrecision(matrix) = HYPRE_OBJECT_PRECISION; +#endif + + return matrix; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +hypre_StructMatrix * +hypre_StructMatrixRef( hypre_StructMatrix *matrix ) +{ + hypre_StructMatrixRefCount(matrix) ++; + + return matrix; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixDestroy( hypre_StructMatrix *matrix ) +{ + HYPRE_Int i; + + if (matrix) + { + hypre_StructMatrixRefCount(matrix) --; + if (hypre_StructMatrixRefCount(matrix) == 0) + { + if (hypre_StructMatrixDataAlloced(matrix)) + { + hypre_TFree(hypre_StructMatrixData(matrix), hypre_StructMatrixMemoryLocation(matrix)); + } + + hypre_ForBoxI(i, hypre_StructMatrixDataSpace(matrix)) + { + hypre_TFree(hypre_StructMatrixDataIndices(matrix)[i], HYPRE_MEMORY_HOST); + } + hypre_TFree(hypre_StructMatrixDataIndices(matrix), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_StructMatrixConstIndices(matrix), HYPRE_MEMORY_HOST); + + hypre_BoxArrayDestroy(hypre_StructMatrixDataSpace(matrix)); + hypre_BoxArrayDestroy(hypre_StructMatrixDataBoxes(matrix)); + + hypre_TFree(hypre_StructMatrixSymmEntries(matrix), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_StructMatrixConstant(matrix), HYPRE_MEMORY_HOST); + hypre_StructStencilDestroy(hypre_StructMatrixUserStencil(matrix)); + hypre_StructStencilDestroy(hypre_StructMatrixStencil(matrix)); + hypre_TFree(hypre_StructMatrixDomBoxnums(matrix), HYPRE_MEMORY_HOST); + hypre_TFree(hypre_StructMatrixRanBoxnums(matrix), HYPRE_MEMORY_HOST); + hypre_StructGridDestroy(hypre_StructMatrixGrid(matrix)); + hypre_StructMatrixForget(matrix); + + hypre_TFree(matrix, HYPRE_MEMORY_HOST); + } + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixSetMemoryLocation( hypre_StructMatrix *matrix, + HYPRE_MemoryLocation memory_location ) +{ + hypre_StructMatrixMemoryLocation(matrix) = memory_location; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Set matrix ran_stride, ran_nboxes, and ran_boxnums. + * If range_stride == NULL, set default values. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixSetRangeStride( hypre_StructMatrix *matrix, + hypre_IndexRef range_stride ) +{ + HYPRE_Int ran_nboxes, *ran_boxnums, ndim = hypre_StructMatrixNDim(matrix); + + if (range_stride != NULL) + { + hypre_CopyToIndex(range_stride, ndim, hypre_StructMatrixRanStride(matrix)); + } + else + { + /* set default stride of 1 */ + hypre_SetIndex(hypre_StructMatrixRanStride(matrix), 1); + } + hypre_StructGridComputeBoxnums(hypre_StructMatrixGrid(matrix), 0, NULL, + hypre_StructMatrixRanStride(matrix), &ran_nboxes, &ran_boxnums); + hypre_TFree(hypre_StructMatrixRanBoxnums(matrix), HYPRE_MEMORY_HOST); + hypre_StructMatrixRanNBoxes(matrix) = ran_nboxes; + hypre_StructMatrixRanBoxnums(matrix) = ran_boxnums; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Set matrix dom_stride, dom_nboxes, and dom_boxnums. + * If domain_stride == NULL, set default values. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixSetDomainStride( hypre_StructMatrix *matrix, + hypre_IndexRef domain_stride ) +{ + HYPRE_Int dom_nboxes, *dom_boxnums, ndim = hypre_StructMatrixNDim(matrix); + + if (domain_stride != NULL) + { + hypre_CopyToIndex(domain_stride, ndim, hypre_StructMatrixDomStride(matrix)); + } + else + { + /* set default stride of 1 */ + hypre_SetIndex(hypre_StructMatrixDomStride(matrix), 1); + } + hypre_StructGridComputeBoxnums(hypre_StructMatrixGrid(matrix), 0, NULL, + hypre_StructMatrixDomStride(matrix), &dom_nboxes, &dom_boxnums); + hypre_TFree(hypre_StructMatrixDomBoxnums(matrix), HYPRE_MEMORY_HOST); + hypre_StructMatrixDomNBoxes(matrix) = dom_nboxes; + hypre_StructMatrixDomBoxnums(matrix) = dom_boxnums; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * This computes a matrix data space from a num_ghost array. If the num_ghost + * argument is NULL, the matrix num_ghost is used instead. The routine takes + * into account additional ghost values needed for symmetric matrices. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixComputeDataSpace( hypre_StructMatrix *matrix, + HYPRE_Int *num_ghost, + hypre_BoxArray **data_space_ptr ) +{ + HYPRE_Int ndim = hypre_StructMatrixNDim(matrix); + hypre_StructGrid *grid = hypre_StructMatrixGrid(matrix); + HYPRE_Int *sym_ghost = hypre_StructMatrixSymGhost(matrix); + HYPRE_Int *trn_ghost = hypre_StructMatrixTrnGhost(matrix); + hypre_BoxArray *data_space; + hypre_Box *data_box; + HYPRE_Int i, d, d2; + + if (num_ghost == NULL) + { + /* Use the matrix num_ghost */ + num_ghost = hypre_StructMatrixNumGhost(matrix); + } + + /* Add ghost layers and map the data space */ + data_space = hypre_BoxArrayClone(hypre_StructGridBoxes(grid)); + hypre_ForBoxI(i, data_space) + { + data_box = hypre_BoxArrayBox(data_space, i); + for (d = 0; d < ndim; d++) + { + d2 = d * 2; + hypre_BoxIMinD(data_box, d) -= hypre_max(num_ghost[d2] + sym_ghost[d2], trn_ghost[d2]); + d2 = d * 2 + 1; + hypre_BoxIMaxD(data_box, d) += hypre_max(num_ghost[d2] + sym_ghost[d2], trn_ghost[d2]); + } + hypre_StructMatrixMapDataBox(matrix, data_box); + } + + *data_space_ptr = data_space; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * This grows the current matrix data space (if needed) to support the minimum + * num_ghost array specified in the argument list. It is assumed that the + * current data space already accounts for symmetric or transpose matrices. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixGrowDataSpace( hypre_StructMatrix *matrix, + HYPRE_Int *num_ghost, + hypre_BoxArray **data_space_ptr ) +{ + HYPRE_Int ndim = hypre_StructMatrixNDim(matrix); + hypre_StructGrid *grid = hypre_StructMatrixGrid(matrix); + hypre_BoxArray *cdata_space = hypre_StructMatrixDataSpace(matrix); + hypre_BoxArray *data_space; + hypre_Box *data_box; + HYPRE_Int i, d, d2; + + /* Compute data space based only on num_ghost */ + data_space = hypre_BoxArrayClone(hypre_StructGridBoxes(grid)); + hypre_ForBoxI(i, data_space) + { + data_box = hypre_BoxArrayBox(data_space, i); + for (d = 0; d < ndim; d++) + { + d2 = d * 2; + hypre_BoxIMinD(data_box, d) -= num_ghost[d2]; + d2 = d * 2 + 1; + hypre_BoxIMaxD(data_box, d) += num_ghost[d2]; + } + hypre_StructMatrixMapDataBox(matrix, data_box); + hypre_BoxGrowByBox(data_box, hypre_BoxArrayBox(cdata_space, i)); + } + + *data_space_ptr = data_space; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Check to see if a resize is needed + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixNeedResize( hypre_StructMatrix *matrix, + hypre_BoxArray *data_space ) +{ + hypre_BoxArray *cdata_space = hypre_StructMatrixDataSpace(matrix); + HYPRE_Int need_resize = 0; + + if (cdata_space == NULL) + { + /* resize if no current data space (cdata_space) */ + need_resize = 1; + } + else if (!hypre_BoxArraysEqual(data_space, cdata_space)) + { + /* resize if data_space is no the same as cdata_space (note that we check + * equality here, which we need for StructMatmult()) */ + need_resize = 1; + } + + return need_resize; +} + +/*-------------------------------------------------------------------------- + * This routine takes new data space information and recomputes entries in the + * matrix that depend on it (e.g., data_indices and data_size). The routine + * will also re-allocate the matrix data if their was data to begin with. + * + * The boxes in the data_space argument may be larger (but not smaller) than + * those computed by the routine MatrixComputeDataSpace(). + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixResize( hypre_StructMatrix *matrix, + hypre_BoxArray *data_space ) +{ + HYPRE_Complex *old_data = hypre_StructMatrixData(matrix); + hypre_BoxArray *old_data_space = hypre_StructMatrixDataSpace(matrix); + hypre_BoxArray *old_data_boxes = hypre_StructMatrixDataBoxes(matrix); + HYPRE_Int old_data_size = hypre_StructMatrixDataSize(matrix); + HYPRE_Int **old_data_indices = hypre_StructMatrixDataIndices(matrix); + + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(matrix); + HYPRE_Int ndim = hypre_StructMatrixNDim(matrix); + hypre_StructStencil *stencil = hypre_StructMatrixStencil(matrix); + hypre_Index *stencil_shape = hypre_StructStencilShape(stencil); + HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); + HYPRE_Int *constant = hypre_StructMatrixConstant(matrix); + HYPRE_Int *symm_entries = hypre_StructMatrixSymmEntries(matrix); + + HYPRE_Complex *data; + hypre_BoxArray *data_boxes; + HYPRE_Int data_size; + HYPRE_Int **data_indices; + HYPRE_Int *const_indices; + + hypre_Box *data_box; + HYPRE_Int data_box_volume; + HYPRE_Int i, j; + + if (hypre_StructMatrixSaveDataSpace(matrix) != NULL) + { + /* Call Restore or Forget first */ + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Resize has already been called"); + return hypre_error_flag; + } + + /* Set up data_boxes */ + data_boxes = hypre_BoxArrayClone(data_space); + hypre_ForBoxI(i, data_boxes) + { + data_box = hypre_BoxArrayBox(data_boxes, i); + hypre_StructMatrixUnMapDataBox(matrix, data_box); + } + + /* Set up const_indices (constant values at the beginning of data array) */ + const_indices = hypre_StructMatrixConstIndices(matrix); + if (const_indices == NULL) + { + const_indices = hypre_CTAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); + for (j = 0; j < stencil_size; j++) + { + if (constant[j]) + { + if (symm_entries[j] < 0) + { + /* set pointers for "stored" coefficients */ + const_indices[j] = j; + } + else + { + /* set pointers for "symmetric" coefficients */ + const_indices[j] = symm_entries[j]; + } + } + } + } + + /* Set up data_indices and data_size (constant values at the beginning of data array) */ + data_indices = hypre_CTAlloc(HYPRE_Int *, hypre_BoxArraySize(data_space), HYPRE_MEMORY_HOST); + data_size = stencil_size; + hypre_ForBoxI(i, data_space) + { + data_box = hypre_BoxArrayBox(data_space, i); + data_box_volume = hypre_BoxVolume(data_box); + + data_indices[i] = hypre_CTAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); + + for (j = 0; j < stencil_size; j++) + { + /* set to const_indices initially */ + data_indices[i][j] = const_indices[j]; + + if ( !constant[j] && (symm_entries[j] < 0) ) + { + /* set pointers for "stored" coefficients */ + data_indices[i][j] = data_size; + data_size += data_box_volume; + } + } + for (j = 0; j < stencil_size; j++) + { + if ( !constant[j] && (symm_entries[j] >= 0) ) + { + /* set pointers for "symmetric" coefficients */ + data_indices[i][j] = data_indices[i][symm_entries[j]] + + hypre_BoxOffsetDistance(data_box, stencil_shape[j]); + } + } + } - if ( rank >= 0 ) + /* Copy or move old_data to data */ + data = NULL; + if (old_data != NULL) { - return hypre_StructMatrixBoxData(matrix, b, rank); + HYPRE_Int nval = hypre_StructMatrixNumValues(matrix); + + /* TODO (VPM): We should be able to just do hypre_TAlloc */ + data = hypre_CTAlloc(HYPRE_Complex, data_size, memory_location); + + /* Copy constant data values */ + hypre_TMemcpy(data, old_data, HYPRE_Complex, stencil_size, + memory_location, memory_location); + + /* Copy the data */ + hypre_StructDataCopy(old_data + stencil_size, old_data_space, + data + stencil_size, data_space, ndim, nval); + if (hypre_StructMatrixDataAlloced(matrix)) + { + hypre_TFree(old_data, memory_location); + } } - else + + hypre_StructMatrixData(matrix) = data; + hypre_StructMatrixDataSpace(matrix) = data_space; + hypre_StructMatrixDataBoxes(matrix) = data_boxes; + hypre_StructMatrixDataSize(matrix) = data_size; + hypre_StructMatrixDataIndices(matrix) = data_indices; + hypre_StructMatrixConstIndices(matrix) = const_indices; + hypre_StructMatrixVDataOffset(matrix) = stencil_size; + + /* Clean up and save data */ + if (old_data_space != NULL) { - return NULL; /* error - invalid index */ + hypre_BoxArrayDestroy(old_data_boxes); + hypre_ForBoxI(i, old_data_space) + { + hypre_TFree(old_data_indices[i], HYPRE_MEMORY_HOST); + } + hypre_TFree(old_data_indices, HYPRE_MEMORY_HOST); + + hypre_StructMatrixSaveData(matrix) = old_data; + hypre_StructMatrixSaveDataSpace(matrix) = old_data_space; + hypre_StructMatrixSaveDataSize(matrix) = old_data_size; } + + return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_StructMatrixCreate + * This routine restores the old data and data space. *--------------------------------------------------------------------------*/ -hypre_StructMatrix * -hypre_StructMatrixCreate( MPI_Comm comm, - hypre_StructGrid *grid, - hypre_StructStencil *user_stencil ) +HYPRE_Int +hypre_StructMatrixRestore( hypre_StructMatrix *matrix ) { - HYPRE_Int ndim = hypre_StructGridNDim(grid); - hypre_StructMatrix *matrix; - HYPRE_Int i; - - matrix = hypre_CTAlloc(hypre_StructMatrix, 1, HYPRE_MEMORY_HOST); + HYPRE_Complex *old_data = hypre_StructMatrixData(matrix); + hypre_BoxArray *old_data_space = hypre_StructMatrixDataSpace(matrix); + HYPRE_Complex *data = hypre_StructMatrixSaveData(matrix); + hypre_BoxArray *data_space = hypre_StructMatrixSaveDataSpace(matrix); + HYPRE_Int data_size = hypre_StructMatrixSaveDataSize(matrix); + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(matrix); + hypre_StructStencil *stencil = hypre_StructMatrixStencil(matrix); + HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); - hypre_StructMatrixComm(matrix) = comm; - hypre_StructGridRef(grid, &hypre_StructMatrixGrid(matrix)); - hypre_StructMatrixUserStencil(matrix) = hypre_StructStencilRef(user_stencil); - hypre_StructMatrixDataAlloced(matrix) = 1; - hypre_StructMatrixRefCount(matrix) = 1; + HYPRE_ANNOTATE_FUNC_BEGIN; - /* set defaults */ - hypre_StructMatrixSymmetric(matrix) = 0; - hypre_StructMatrixConstantCoefficient(matrix) = 0; - for (i = 0; i < 2 * ndim; i++) + if (data_space != NULL) { - hypre_StructMatrixNumGhost(matrix)[i] = hypre_StructGridNumGhost(grid)[i]; - } + HYPRE_Int ndim = hypre_StructMatrixNDim(matrix); + HYPRE_Int nval = hypre_StructMatrixNumValues(matrix); + HYPRE_Int i; - hypre_StructMatrixMemoryLocation(matrix) = hypre_HandleMemoryLocation(hypre_handle()); + /* Move the data */ + if (hypre_StructMatrixDataAlloced(matrix)) + { + data = hypre_TAlloc(HYPRE_Complex, data_size, memory_location); + } - return matrix; -} + /* Copy constant data values */ + for (i = 0; i < stencil_size; i++) + { + data[i] = old_data[i]; + } + hypre_StructDataCopy(old_data + stencil_size, old_data_space, + data + stencil_size, data_space, ndim, nval); + hypre_TFree(old_data, memory_location); -/*-------------------------------------------------------------------------- - * hypre_StructMatrixRef - *--------------------------------------------------------------------------*/ + /* Reset certain fields to enable the Resize call below */ + hypre_StructMatrixSaveData(matrix) = NULL; + hypre_StructMatrixSaveDataSpace(matrix) = NULL; + hypre_StructMatrixSaveDataSize(matrix) = 0; + hypre_StructMatrixData(matrix) = NULL; -hypre_StructMatrix * -hypre_StructMatrixRef( hypre_StructMatrix *matrix ) -{ - hypre_StructMatrixRefCount(matrix) ++; + /* Set the data space and recompute data_indices, etc. */ + hypre_StructMatrixResize(matrix, data_space); + hypre_StructMatrixForget(matrix); - return matrix; + /* Set the data pointer */ + hypre_StructMatrixData(matrix) = data; + } + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_StructMatrixDestroy + * This routine will clear data needed to do a Restore *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_StructMatrixDestroy( hypre_StructMatrix *matrix ) +hypre_StructMatrixForget( hypre_StructMatrix *matrix ) { - if (matrix) + hypre_BoxArray *save_data_space = hypre_StructMatrixSaveDataSpace(matrix); + + if (save_data_space != NULL) { - hypre_StructMatrixRefCount(matrix) --; - if (hypre_StructMatrixRefCount(matrix) == 0) - { - if (hypre_StructMatrixDataAlloced(matrix)) - { - hypre_TFree(hypre_StructMatrixData(matrix), hypre_StructMatrixMemoryLocation(matrix)); - hypre_TFree(hypre_StructMatrixDataConst(matrix), HYPRE_MEMORY_HOST); - } - hypre_TFree(hypre_StructMatrixStencilData(matrix), HYPRE_MEMORY_HOST); - hypre_CommPkgDestroy(hypre_StructMatrixCommPkg(matrix)); - if (hypre_BoxArraySize(hypre_StructMatrixDataSpace(matrix)) > 0) - { - hypre_TFree(hypre_StructMatrixDataIndices(matrix)[0], 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)); - hypre_StructStencilDestroy(hypre_StructMatrixStencil(matrix)); - hypre_StructGridDestroy(hypre_StructMatrixGrid(matrix)); - hypre_TFree(matrix, HYPRE_MEMORY_HOST); - } + hypre_BoxArrayDestroy(save_data_space); + hypre_StructMatrixSaveData(matrix) = NULL; + hypre_StructMatrixSaveDataSpace(matrix) = NULL; + hypre_StructMatrixSaveDataSize(matrix) = 0; } return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_StructMatrixInitializeShell + * NOTE: This currently assumes that either ran_stride or dom_stride is 1. *--------------------------------------------------------------------------*/ HYPRE_Int hypre_StructMatrixInitializeShell( hypre_StructMatrix *matrix ) { - HYPRE_Int ndim = hypre_StructMatrixNDim(matrix); - hypre_StructGrid *grid = hypre_StructMatrixGrid(matrix); + HYPRE_Int ndim = hypre_StructMatrixNDim(matrix); + hypre_StructGrid *grid = hypre_StructMatrixGrid(matrix); + HYPRE_Int *constant = hypre_StructMatrixConstant(matrix); + hypre_IndexRef ran_stride = hypre_StructMatrixRanStride(matrix); + hypre_IndexRef dom_stride = hypre_StructMatrixDomStride(matrix); + hypre_IndexRef periodic = hypre_StructGridPeriodic(grid); hypre_StructStencil *user_stencil; hypre_StructStencil *stencil; hypre_Index *stencil_shape; HYPRE_Int stencil_size; - HYPRE_Complex **stencil_data; - HYPRE_Int num_values; - HYPRE_Int *symm_elements; - HYPRE_Int constant_coefficient; - - HYPRE_Int *num_ghost; - HYPRE_Int extra_ghost[2 * HYPRE_MAXDIM]; - + HYPRE_Int num_values, num_cvalues; + HYPRE_Int *symm_entries; + HYPRE_Int domain_is_coarse; hypre_BoxArray *data_space; - hypre_BoxArray *boxes; - hypre_Box *box; - hypre_Box *data_box; - - HYPRE_Int **data_indices; - HYPRE_Int data_size; - HYPRE_Int data_const_size; - HYPRE_Int data_box_volume; - - HYPRE_Int i, j, d; + HYPRE_Int *sym_ghost; + HYPRE_Int i, j, d, resize; /*----------------------------------------------------------------------- - * Set up stencil and num_values: - * - * If the matrix is symmetric, then the stencil is a "symmetrized" - * version of the user's stencil. If the matrix is not symmetric, - * then the stencil is the same as the user's stencil. - * - * The `symm_elements' array is used to determine what data is - * explicitely stored (symm_elements[i] < 0) and what data does is - * not explicitely stored (symm_elements[i] >= 0), but is instead - * stored as the transpose coefficient at a neighboring grid point. + * First, check consistency of ran_stride, dom_stride, and symmetric. *-----------------------------------------------------------------------*/ - if (hypre_StructMatrixStencil(matrix) == NULL) + /* domain_is_coarse={0,1,-1,-2} -> coarse grid={range,domain,neither,error} */ + domain_is_coarse = -1; + for (d = 0; d < ndim; d++) { - user_stencil = hypre_StructMatrixUserStencil(matrix); - - if (hypre_StructMatrixSymmetric(matrix)) + if (ran_stride[d] > dom_stride[d]) { - /* store only symmetric stencil entry data */ - hypre_StructStencilSymmetrize(user_stencil, &stencil, &symm_elements); - num_values = ( hypre_StructStencilSize(stencil) + 1 ) / 2; + if ((domain_is_coarse == 1) || (ran_stride[d] % dom_stride[d] != 0)) + { + domain_is_coarse = -2; + break; + } + else + { + /* Range index space is coarsest */ + domain_is_coarse = 0; + } } - else + else if (dom_stride[d] > ran_stride[d]) { - /* store all stencil entry data */ - stencil = hypre_StructStencilRef(user_stencil); - num_values = hypre_StructStencilSize(stencil); - symm_elements = hypre_TAlloc(HYPRE_Int, num_values, HYPRE_MEMORY_HOST); - for (i = 0; i < num_values; i++) + if ((domain_is_coarse == 0) || (dom_stride[d] % ran_stride[d] != 0)) + { + domain_is_coarse = -2; + break; + } + else { - symm_elements[i] = -1; + /* Domain index space is coarsest */ + domain_is_coarse = 1; } } - - hypre_StructMatrixStencil(matrix) = stencil; - hypre_StructMatrixSymmElements(matrix) = symm_elements; - hypre_StructMatrixNumValues(matrix) = num_values; - } - - /*----------------------------------------------------------------------- - * Set ghost-layer size for symmetric storage - * - All stencil coeffs are to be available at each point in the - * grid, as well as in the user-specified ghost layer. - *-----------------------------------------------------------------------*/ - - num_ghost = hypre_StructMatrixNumGhost(matrix); - stencil = hypre_StructMatrixStencil(matrix); - stencil_shape = hypre_StructStencilShape(stencil); - stencil_size = hypre_StructStencilSize(stencil); - symm_elements = hypre_StructMatrixSymmElements(matrix); - - stencil_data = hypre_TAlloc(HYPRE_Complex*, stencil_size, HYPRE_MEMORY_HOST); - hypre_StructMatrixStencilData(matrix) = stencil_data; - - for (d = 0; d < 2 * ndim; d++) - { - extra_ghost[d] = 0; } - - for (i = 0; i < stencil_size; i++) + if (domain_is_coarse > -1) { - if (symm_elements[i] >= 0) + if (domain_is_coarse) { - 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) ); - } + /* Domain is coarse */ + hypre_StructMatrixDomainIsCoarse(matrix) = 1; + } + else + { + /* Range is coarse */ + hypre_StructMatrixRangeIsCoarse(matrix) = 1; } + /* Can't have a symmetric stencil for a rectangular matrix */ + hypre_StructMatrixSymmetric(matrix) = 0; } - - for (d = 0; d < ndim; d++) + if (domain_is_coarse == -2) { - num_ghost[2 * d] += extra_ghost[2 * d]; - num_ghost[2 * d + 1] += extra_ghost[2 * d + 1]; + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Invalid matrix domain and range strides"); + return hypre_error_flag; } /*----------------------------------------------------------------------- - * Set up data_space + * Now check consistency of ran_stride, dom_stride, and periodic. *-----------------------------------------------------------------------*/ - if (hypre_StructMatrixDataSpace(matrix) == NULL) + for (d = 0; d < ndim; d++) { - boxes = hypre_StructGridBoxes(grid); - data_space = hypre_BoxArrayCreate(hypre_BoxArraySize(boxes), ndim); - - hypre_ForBoxI(i, boxes) + if ( (periodic[d] % ran_stride[d]) || (periodic[d] % dom_stride[d]) ) { - box = hypre_BoxArrayBox(boxes, i); - data_box = hypre_BoxArrayBox(data_space, i); - - 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_error_w_msg(HYPRE_ERROR_GENERIC, + "Periodicity must be an integral multiple of the matrix domain and range strides"); + return hypre_error_flag; } - - hypre_StructMatrixDataSpace(matrix) = data_space; } /*----------------------------------------------------------------------- - * Set up data_indices array and data-size + * Set up stencil, num_values, and num_cvalues: + * + * If the matrix is symmetric, then the stencil is a "symmetrized" + * version of the user's stencil. If the matrix is not symmetric, + * then the stencil is the same as the user's stencil. + * + * The `symm_entries' array is used to determine what data is explicitely + * stored (symm_entries[i] < 0) and what data is not explicitely stored + * (symm_entries[i] >= 0), but is instead stored as the transpose + * coefficient at a neighboring grid point. *-----------------------------------------------------------------------*/ - if (hypre_StructMatrixDataIndices(matrix) == NULL) + if (hypre_StructMatrixStencil(matrix) == NULL) { - data_space = hypre_StructMatrixDataSpace(matrix); - data_indices = hypre_TAlloc(HYPRE_Int *, hypre_BoxArraySize(data_space), - HYPRE_MEMORY_HOST); - if (hypre_BoxArraySize(data_space) > 0) - { - data_indices[0] = hypre_TAlloc(HYPRE_Int, stencil_size * hypre_BoxArraySize(data_space), - HYPRE_MEMORY_HOST); - } - constant_coefficient = hypre_StructMatrixConstantCoefficient(matrix); + user_stencil = hypre_StructMatrixUserStencil(matrix); + symm_entries = NULL; - data_size = 0; - data_const_size = 0; - if ( constant_coefficient == 0 ) + if (hypre_StructMatrixSymmetric(matrix)) { - hypre_ForBoxI(i, data_space) + /* store only symmetric stencil entry data */ + hypre_StructStencilSymmetrize(user_stencil, &stencil, &symm_entries); + stencil_size = hypre_StructStencilSize(stencil); + constant = hypre_TReAlloc(constant, HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); + for (i = 0; i < stencil_size; i++) { - data_box = hypre_BoxArrayBox(data_space, i); - data_box_volume = hypre_BoxVolume(data_box); - - data_indices[i] = data_indices[0] + stencil_size * i; - - /* set pointers for "stored" coefficients */ - for (j = 0; j < stencil_size; j++) - { - if (symm_elements[j] < 0) - { - data_indices[i][j] = data_size; - data_size += data_box_volume; - } - } - - /* set pointers for "symmetric" coefficients */ - for (j = 0; j < stencil_size; j++) + if (symm_entries[i] >= 0) { - if (symm_elements[j] >= 0) - { - data_indices[i][j] = data_indices[i][symm_elements[j]] + - hypre_BoxOffsetDistance(data_box, stencil_shape[j]); - } + constant[i] = constant[symm_entries[i]]; } } } - else if ( constant_coefficient == 1 ) + else { - hypre_ForBoxI(i, data_space) + /* store all stencil entry data */ + stencil = hypre_StructStencilRef(user_stencil); + stencil_size = hypre_StructStencilSize(stencil); + symm_entries = hypre_TAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); + for (i = 0; i < stencil_size; i++) { - data_box = hypre_BoxArrayBox(data_space, i); - data_box_volume = hypre_BoxVolume(data_box); - - data_indices[i] = data_indices[0] + stencil_size * i; - /* set pointers for "stored" coefficients */ - for (j = 0; j < stencil_size; j++) - { - if (symm_elements[j] < 0) - { - data_indices[i][j] = data_const_size; - ++data_const_size; - } - } - - /* set pointers for "symmetric" coefficients */ - for (j = 0; j < stencil_size; j++) - { - if (symm_elements[j] >= 0) - { - data_indices[i][j] = data_indices[i][symm_elements[j]]; - } - } + symm_entries[i] = -1; } } - else + + /* Compute number of stored constant and variables coeffs */ + num_values = 0; + num_cvalues = 0; + for (j = 0; j < stencil_size; j++) { - hypre_assert( constant_coefficient == 2 ); - data_const_size += stencil_size; -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - if (hypre_StructGridDataLocation(grid) == HYPRE_MEMORY_HOST) + if (symm_entries[j] < 0) { - /* in this case, "data" is put on host using the space of - * "data_const". so, "data" need to be shifted by the size of - * const coeff */ - data_size += stencil_size;/* all constant coeffs at the beginning */ - } -#endif - /* ... this allocates a little more space than is absolutely necessary */ - hypre_ForBoxI(i, data_space) - { - data_box = hypre_BoxArrayBox(data_space, i); - data_box_volume = hypre_BoxVolume(data_box); - - data_indices[i] = data_indices[0] + stencil_size * i; - /* set pointers for "stored" coefficients */ - for (j = 0; j < stencil_size; j++) + if (constant[j]) { - if (symm_elements[j] < 0) - { - /* diagonal, variable coefficient */ - if (hypre_IndexEqual(stencil_shape[j], 0, ndim)) - { - data_indices[i][j] = data_size; - data_size += data_box_volume; - } - /* off-diagonal, constant coefficient */ - else - { - data_indices[i][j] = j; - } - } + num_cvalues++; } - - /* set pointers for "symmetric" coefficients */ - for (j = 0; j < stencil_size; j++) + else { - if (symm_elements[j] >= 0) - { - /* diagonal, variable coefficient */ - 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]); - } - /* off-diagonal, constant coefficient */ - else - { - data_indices[i][j] = data_indices[i][symm_elements[j]]; - } - } + num_values++; } } } - hypre_StructMatrixDataIndices(matrix) = data_indices; + hypre_StructMatrixStencil(matrix) = stencil; + hypre_StructMatrixConstant(matrix) = constant; + hypre_StructMatrixSymmEntries(matrix) = symm_entries; + hypre_StructMatrixNumValues(matrix) = num_values; + hypre_StructMatrixNumCValues(matrix) = num_cvalues; + } - /*----------------------------------------------------------------------- - * if data location has not been set outside, set up the data location - * based on the total number of - *-----------------------------------------------------------------------*/ -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - if (hypre_StructGridDataLocation(grid) == HYPRE_MEMORY_HOST) - { - data_const_size = data_size + data_const_size; - data_size = 0; - } -#endif - hypre_StructMatrixDataSize(matrix) = data_size; - hypre_StructMatrixDataConstSize(matrix) = data_const_size; + /*----------------------------------------------------------------------- + * Compute the needed additional ghost-layer size for symmetric storage + * (square matrices only). All stencil coeffs are to be available at each + * point in the grid, including the user-specified ghost layer. + *-----------------------------------------------------------------------*/ - /* - if (hypre_BoxArraySize(data_space) > 0) + sym_ghost = hypre_StructMatrixSymGhost(matrix); + stencil = hypre_StructMatrixStencil(matrix); + stencil_shape = hypre_StructStencilShape(stencil); + stencil_size = hypre_StructStencilSize(stencil); + symm_entries = hypre_StructMatrixSymmEntries(matrix); + + /* Initialize additional ghost size */ + for (d = 0; d < 2 * ndim; d++) + { + sym_ghost[d] = 0; + } + + /* Add ghost layers for symmetric storage */ + if (hypre_StructMatrixSymmetric(matrix)) + { + for (i = 0; i < stencil_size; i++) { - hypre_StructMatrixDataDeviceIndices(matrix) = data_indices[0]; + if (symm_entries[i] >= 0) + { + for (d = 0; d < ndim; d++) + { + j = hypre_IndexD(stencil_shape[i], d); + sym_ghost[2 * d] = hypre_max(sym_ghost[2 * d], -j); + sym_ghost[2 * d + 1] = hypre_max(sym_ghost[2 * d + 1], j); + } + } } - */ } /*----------------------------------------------------------------------- - * Set total number of nonzero coefficients - * For constant coefficients, this is unrelated to the amount of data - * actually stored. + * Compute the ghost layers needed for storing the transpose + *-----------------------------------------------------------------------*/ + + hypre_StructMatrixSetTranspose(matrix, hypre_StructMatrixTranspose(matrix), &resize); + + /*----------------------------------------------------------------------- + * Compute global size *-----------------------------------------------------------------------*/ hypre_StructMatrixGlobalSize(matrix) = hypre_StructGridGlobalSize(grid) * stencil_size; + /*----------------------------------------------------------------------- + * Set up information related to the data space and data storage + *-----------------------------------------------------------------------*/ + + if (hypre_StructMatrixDataSpace(matrix) == NULL) + { + hypre_StructMatrixComputeDataSpace(matrix, NULL, &data_space); + hypre_StructMatrixResize(matrix, data_space); + hypre_StructMatrixForget(matrix); + } + /*----------------------------------------------------------------------- * Return *-----------------------------------------------------------------------*/ @@ -439,109 +1286,47 @@ hypre_StructMatrixInitializeShell( hypre_StructMatrix *matrix ) } /*-------------------------------------------------------------------------- - * hypre_StructMatrixInitializeData *--------------------------------------------------------------------------*/ HYPRE_Int hypre_StructMatrixInitializeData( hypre_StructMatrix *matrix, - HYPRE_Complex *data, - HYPRE_Complex *data_const) + HYPRE_Int zero_init, + HYPRE_Complex *data ) { - HYPRE_Int ndim = hypre_StructMatrixNDim(matrix); - HYPRE_Int constant_coefficient; - hypre_StructStencil *stencil; - hypre_Index *stencil_shape; - HYPRE_Complex **stencil_data; - HYPRE_Int stencil_size, i; -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - hypre_StructGrid *grid = hypre_StructMatrixGrid(matrix); -#endif - hypre_StructMatrixData(matrix) = data; - hypre_StructMatrixDataConst(matrix) = data_const; - hypre_StructMatrixDataAlloced(matrix) = 0; - - stencil = hypre_StructMatrixStencil(matrix); - stencil_shape = hypre_StructStencilShape(stencil); - stencil_size = hypre_StructStencilSize(stencil); - stencil_data = hypre_StructMatrixStencilData(matrix); - - constant_coefficient = hypre_StructMatrixConstantCoefficient(matrix); - - if (constant_coefficient == 0) - { - for (i = 0; i < stencil_size; i++) - { -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - if (hypre_StructGridDataLocation(grid) != HYPRE_MEMORY_HOST) - { - stencil_data[i] = hypre_StructMatrixData(matrix); - } - else - { - stencil_data[i] = hypre_StructMatrixDataConst(matrix); - } -#else - stencil_data[i] = hypre_StructMatrixData(matrix); -#endif - } - } - else if (constant_coefficient == 1) + if (data == NULL) { - for (i = 0; i < stencil_size; i++) + if (zero_init) + { + data = hypre_CTAlloc(HYPRE_Complex, + hypre_StructMatrixDataSize(matrix), + hypre_StructMatrixMemoryLocation(matrix)); + } + else { - stencil_data[i] = hypre_StructMatrixDataConst(matrix); + /* TODO (VPM): TAlloc leads to regressions on TEST_struct/emptyproc */ + data = hypre_CTAlloc(HYPRE_Complex, + hypre_StructMatrixDataSize(matrix), + hypre_StructMatrixMemoryLocation(matrix)); } + hypre_StructMatrixDataAlloced(matrix) = 1; } else { - for (i = 0; i < stencil_size; i++) - { - /* diagonal, variable coefficient */ - if (hypre_IndexEqual(stencil_shape[i], 0, ndim)) - { -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - if (hypre_StructGridDataLocation(grid) != HYPRE_MEMORY_HOST) - { - stencil_data[i] = hypre_StructMatrixData(matrix); - } - else - { - stencil_data[i] = hypre_StructMatrixDataConst(matrix); - } -#else - stencil_data[i] = hypre_StructMatrixData(matrix); -#endif - } - /* off-diagonal, constant coefficient */ - else - { - stencil_data[i] = hypre_StructMatrixDataConst(matrix); - } - } + hypre_StructMatrixDataAlloced(matrix) = 0; } + hypre_StructMatrixData(matrix) = data; return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_StructMatrixInitialize *--------------------------------------------------------------------------*/ + HYPRE_Int hypre_StructMatrixInitialize( hypre_StructMatrix *matrix ) { - HYPRE_Complex *data; - HYPRE_Complex *data_const; - hypre_StructMatrixInitializeShell(matrix); - - 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); - hypre_StructMatrixDataAlloced(matrix) = 1; + hypre_StructMatrixInitializeData(matrix, 1, NULL); return hypre_error_flag; } @@ -550,9 +1335,10 @@ hypre_StructMatrixInitialize( hypre_StructMatrix *matrix ) * (action > 0): add-to values * (action = 0): set values * (action < 0): get values + * (action =-2): get values and zero out * - * should not be called to set a constant-coefficient part of the matrix, - * call hypre_StructMatrixSetConstantValues instead + * Should not be called to set a constant-coefficient part of the matrix. + * Call hypre_StructMatrixSetConstantValues instead. *--------------------------------------------------------------------------*/ HYPRE_Int @@ -565,34 +1351,30 @@ hypre_StructMatrixSetValues( hypre_StructMatrix *matrix, HYPRE_Int boxnum, HYPRE_Int outside ) { - hypre_BoxArray *grid_boxes; - hypre_Box *grid_box; - hypre_Index center_index; - hypre_StructStencil *stencil; - 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 + HYPRE_Int *constant = hypre_StructMatrixConstant(matrix); + HYPRE_Int *symm_entries = hypre_StructMatrixSymmEntries(matrix); + + hypre_BoxArray *grid_boxes; + hypre_Box *grid_box; + hypre_BoxArray *data_boxes; + hypre_Box *data_box; + HYPRE_Complex *matp; + + HYPRE_Int i, j, s, istart, istop; /*----------------------------------------------------------------------- * Initialize some things *-----------------------------------------------------------------------*/ - constant_coefficient = hypre_StructMatrixConstantCoefficient(matrix); - symm_elements = hypre_StructMatrixSymmElements(matrix); - if (outside > 0) { - grid_boxes = hypre_StructMatrixDataSpace(matrix); + grid_boxes = hypre_StructMatrixDataBoxes(matrix); } else { grid_boxes = hypre_StructGridBoxes(hypre_StructMatrixGrid(matrix)); } + data_boxes = hypre_StructMatrixDataBoxes(matrix); if (boxnum < 0) { @@ -609,45 +1391,41 @@ hypre_StructMatrixSetValues( hypre_StructMatrix *matrix, * Set the matrix coefficients *-----------------------------------------------------------------------*/ - center_rank = 0; - if ( constant_coefficient == 2 ) - { - hypre_SetIndex(center_index, 0); - stencil = hypre_StructMatrixStencil(matrix); - center_rank = hypre_StructStencilElementRank( stencil, center_index ); - } - for (i = istart; i < istop; i++) { grid_box = hypre_BoxArrayBox(grid_boxes, i); + data_box = hypre_BoxArrayBox(data_boxes, i); if (hypre_IndexInBox(grid_index, grid_box)) { + hypre_StructMatrixMapDataIndex(matrix, grid_index); + for (s = 0; s < num_stencil_indices; s++) { + j = stencil_indices[s]; + + /* call SetConstantValues instead */ + if (constant[j]) + { + hypre_error(HYPRE_ERROR_GENERIC); + } + /* only set stored stencil values */ - if (symm_elements[stencil_indices[s]] < 0) + if (symm_entries[j] < 0) { - if ( (constant_coefficient == 1) || - (constant_coefficient == 2 && stencil_indices[s] != center_rank) ) - { - /* call SetConstantValues instead */ - hypre_error(HYPRE_ERROR_GENERIC); - matp = hypre_StructMatrixBoxData(matrix, i, stencil_indices[s]); - } - else /* variable coefficient, constant_coefficient=0 */ - { - matp = hypre_StructMatrixBoxDataValue(matrix, i, stencil_indices[s], grid_index); - } + matp = hypre_StructMatrixBoxDataValue(matrix, i, j, data_box, grid_index); #if defined(HYPRE_USING_GPU) + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(matrix); + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) { if (action > 0) { -#define DEVICE_VAR is_device_ptr(matp,values) +#define DEVICE_VAR is_device_ptr(matp, values) hypre_LoopBegin(1, k) { + HYPRE_UNUSED_VAR(k); *matp += values[s]; } hypre_LoopEnd() @@ -655,11 +1433,17 @@ hypre_StructMatrixSetValues( hypre_StructMatrix *matrix, } else if (action > -1) { - hypre_TMemcpy(matp, values + s, HYPRE_Complex, 1, memory_location, memory_location); + hypre_TMemcpy(matp, values + s, HYPRE_Complex, 1, + memory_location, memory_location); } else /* action < 0 */ { - hypre_TMemcpy(values + s, matp, HYPRE_Complex, 1, memory_location, memory_location); + hypre_TMemcpy(values + s, matp, HYPRE_Complex, 1, + memory_location, memory_location); + if (action == -2) + { + hypre_Memset((void*) matp, 0.0, sizeof(HYPRE_Complex), memory_location); + } } } else @@ -676,12 +1460,16 @@ hypre_StructMatrixSetValues( hypre_StructMatrix *matrix, else /* action < 0 */ { values[s] = *matp; + if (action == -2) + { + *matp = 0; + } } - } - } - } - } - } + } /* if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) */ + } /* if (symm_entries[j] < 0) */ + } /* for (s = 0; s < num_stencil_indices; s++) */ + } /* if (hypre_IndexInBox(grid_index, grid_box)) */ + } /* for (i = istart; i < istop; i++) */ return hypre_error_flag; } @@ -692,8 +1480,8 @@ hypre_StructMatrixSetValues( hypre_StructMatrix *matrix, * (action < 0): get values * (action =-2): get values and zero out * - * should not be called to set a constant-coefficient part of the matrix, - * call hypre_StructMatrixSetConstantValues instead + * Should not be called to set a constant-coefficient part of the matrix. + * Call hypre_StructMatrixSetConstantValues instead. *--------------------------------------------------------------------------*/ HYPRE_Int @@ -707,21 +1495,18 @@ hypre_StructMatrixSetBoxValues( hypre_StructMatrix *matrix, HYPRE_Int boxnum, HYPRE_Int outside ) { + HYPRE_Int ndim = hypre_StructMatrixNDim(matrix); + HYPRE_Int *constant = hypre_StructMatrixConstant(matrix); + HYPRE_Int *symm_entries = hypre_StructMatrixSymmEntries(matrix); hypre_BoxArray *grid_boxes; hypre_Box *grid_box; hypre_Box *int_box; - hypre_Index center_index; - hypre_StructStencil *stencil; - HYPRE_Int center_rank = 0; - HYPRE_Int *symm_elements; hypre_BoxArray *data_space; hypre_Box *data_box; hypre_IndexRef data_start; hypre_Index data_stride; - HYPRE_Int datai; HYPRE_Complex *datap; - HYPRE_Int constant_coefficient; hypre_Box *dval_box; hypre_Index dval_start; @@ -729,19 +1514,15 @@ hypre_StructMatrixSetBoxValues( hypre_StructMatrix *matrix, HYPRE_Int dvali; hypre_Index loop_size; - - HYPRE_Int i, s, istart, istop; + HYPRE_Int i, j, s, istart, istop; /*----------------------------------------------------------------------- * Initialize some things *-----------------------------------------------------------------------*/ - constant_coefficient = hypre_StructMatrixConstantCoefficient(matrix); - symm_elements = hypre_StructMatrixSymmElements(matrix); - if (outside > 0) { - grid_boxes = hypre_StructMatrixDataSpace(matrix); + grid_boxes = hypre_StructMatrixDataBoxes(matrix); } else { @@ -766,8 +1547,9 @@ hypre_StructMatrixSetBoxValues( hypre_StructMatrix *matrix, hypre_SetIndex(data_stride, 1); - int_box = hypre_BoxCreate(hypre_StructMatrixNDim(matrix)); - dval_box = hypre_BoxDuplicate(value_box); + int_box = hypre_BoxCreate(ndim); + dval_box = hypre_BoxClone(value_box); + hypre_StructMatrixMapDataBox(matrix, dval_box); hypre_BoxIMinD(dval_box, 0) *= num_stencil_indices; hypre_BoxIMaxD(dval_box, 0) *= num_stencil_indices; hypre_BoxIMaxD(dval_box, 0) += num_stencil_indices - 1; @@ -784,65 +1566,58 @@ hypre_StructMatrixSetBoxValues( hypre_StructMatrix *matrix, /* if there was an intersection */ if (hypre_BoxVolume(int_box)) { + hypre_StructMatrixMapDataBox(matrix, int_box); + data_start = hypre_BoxIMin(int_box); hypre_CopyIndex(data_start, dval_start); hypre_IndexD(dval_start, 0) *= num_stencil_indices; - if (constant_coefficient == 2) - { - hypre_SetIndex(center_index, 0); - stencil = hypre_StructMatrixStencil(matrix); - center_rank = hypre_StructStencilElementRank(stencil, center_index); - } - for (s = 0; s < num_stencil_indices; s++) { + j = stencil_indices[s]; + /* only set stored stencil values */ - if (symm_elements[stencil_indices[s]] < 0) + if (symm_entries[j] < 0) { - datap = hypre_StructMatrixBoxData(matrix, i, stencil_indices[s]); + datap = hypre_StructMatrixBoxData(matrix, i, j); - if ( (constant_coefficient == 1) || - (constant_coefficient == 2 && stencil_indices[s] != center_rank )) - /* datap has only one data point for a given i and s */ + /* TODO: this is not the most efficient way of acessing constant entries. + Should use SetConstantValues instead. */ + if (constant[j]) { - /* should have called SetConstantValues */ - hypre_error(HYPRE_ERROR_GENERIC); - hypre_BoxGetSize(int_box, loop_size); + dvali = hypre_BoxIndexRank(dval_box, dval_start); if (action > 0) { - datai = hypre_CCBoxIndexRank(data_box, data_start); - dvali = hypre_BoxIndexRank(dval_box, dval_start); - datap[datai] += values[dvali]; + *datap += values[dvali]; } else if (action > -1) { - datai = hypre_CCBoxIndexRank(data_box, data_start); - dvali = hypre_BoxIndexRank(dval_box, dval_start); - datap[datai] = values[dvali]; + *datap = values[dvali]; } else { - datai = hypre_CCBoxIndexRank(data_box, data_start); - dvali = hypre_BoxIndexRank(dval_box, dval_start); - values[dvali] = datap[datai]; + hypre_BoxGetSize(int_box, loop_size); + hypre_BoxLoop1Begin(ndim, loop_size, + dval_box, dval_start, dval_stride, dvali); + { + values[dvali] = *datap; + } + hypre_BoxLoop1End(dvali); + if (action == -2) { - datap[datai] = 0; + *datap = 0; } } - } - else /* variable coefficient: constant_coefficient==0 - or diagonal with constant_coefficient==2 */ + else { -#define DEVICE_VAR is_device_ptr(datap,values) hypre_BoxGetSize(int_box, loop_size); if (action > 0) { - hypre_BoxLoop2Begin(hypre_StructMatrixNDim(matrix), loop_size, + hypre_BoxLoop2Begin(ndim, loop_size, data_box, data_start, data_stride, datai, dval_box, dval_start, dval_stride, dvali); { @@ -852,7 +1627,7 @@ hypre_StructMatrixSetBoxValues( hypre_StructMatrix *matrix, } else if (action > -1) { - hypre_BoxLoop2Begin(hypre_StructMatrixNDim(matrix), loop_size, + hypre_BoxLoop2Begin(ndim, loop_size, data_box, data_start, data_stride, datai, dval_box, dval_start, dval_stride, dvali); { @@ -860,30 +1635,22 @@ hypre_StructMatrixSetBoxValues( hypre_StructMatrix *matrix, } hypre_BoxLoop2End(datai, dvali); } - 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); - { - values[dvali] = datap[datai]; - datap[datai] = 0; - } - hypre_BoxLoop2End(datai, dvali); - } else { - hypre_BoxLoop2Begin(hypre_StructMatrixNDim(matrix), loop_size, + hypre_BoxLoop2Begin(ndim, loop_size, data_box, data_start, data_stride, datai, dval_box, dval_start, dval_stride, dvali); { values[dvali] = datap[datai]; + if (action == -2) + { + datap[datai] = 0; + } } hypre_BoxLoop2End(datai, dvali); } -#undef DEVICE_VAR - } - } /* end if (symm_elements) */ + } /* end if (constant) */ + } /* end if (symm_entries) */ hypre_IndexD(dval_start, 0) ++; } @@ -900,164 +1667,89 @@ hypre_StructMatrixSetBoxValues( hypre_StructMatrix *matrix, * (action > 0): add-to values * (action = 0): set values * (action < 0): get values - * (action =-2): get values and zero out (not implemented, just gets values) - * should be called to set a constant-coefficient part of the matrix + * (action =-2): get values and zero out + * + * Should be called to set a constant-coefficient part of the matrix. *--------------------------------------------------------------------------*/ HYPRE_Int hypre_StructMatrixSetConstantValues( hypre_StructMatrix *matrix, - HYPRE_Int num_stencil_indices, - HYPRE_Int *stencil_indices, - HYPRE_Complex *values, - HYPRE_Int action ) + HYPRE_Int num_stencil_indices, + HYPRE_Int *stencil_indices, + HYPRE_Complex *values, + HYPRE_Int action ) { - hypre_BoxArray *boxes; - hypre_Box *box; - hypre_Index center_index; - hypre_StructStencil *stencil; - HYPRE_Int center_rank; - HYPRE_Int constant_coefficient; +#if defined(HYPRE_USING_GPU) + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(matrix); +#endif + HYPRE_Int *constant = hypre_StructMatrixConstant(matrix); + HYPRE_Complex *matp; + HYPRE_Int j, s; - HYPRE_Complex *matp; + /*----------------------------------------------------------------------- + * Set the matrix coefficients + *-----------------------------------------------------------------------*/ - HYPRE_Int i, s; + for (s = 0; s < num_stencil_indices; s++) + { + j = stencil_indices[s]; - boxes = hypre_StructGridBoxes(hypre_StructMatrixGrid(matrix)); - constant_coefficient = hypre_StructMatrixConstantCoefficient(matrix); + matp = hypre_StructMatrixConstData(matrix, j); + if (!constant[j]) + { + hypre_error(HYPRE_ERROR_GENERIC); + } - if ( constant_coefficient == 1 ) - { - hypre_ForBoxI(i, boxes) +#if defined(HYPRE_USING_GPU) + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) { - box = hypre_BoxArrayBox(boxes, i); if (action > 0) { - for (s = 0; s < num_stencil_indices; s++) + hypre_LoopBegin(1, k) { - matp = hypre_StructMatrixBoxData(matrix, i, - stencil_indices[s]); + HYPRE_UNUSED_VAR(k); *matp += values[s]; } + hypre_LoopEnd() } else if (action > -1) { - for (s = 0; s < num_stencil_indices; s++) - { - matp = hypre_StructMatrixBoxData(matrix, i, - stencil_indices[s]); - *matp = values[s]; - } + hypre_TMemcpy(matp, values + s, HYPRE_Complex, 1, + memory_location, memory_location); } - else /* action < 0 */ + else /* action < 0 */ { - for (s = 0; s < num_stencil_indices; s++) + hypre_TMemcpy(values + s, matp, HYPRE_Complex, 1, + memory_location, memory_location); + if (action == -2) { - matp = hypre_StructMatrixBoxData(matrix, i, - stencil_indices[s]); - values[s] = *matp; + hypre_Memset((void*) matp, 0.0, sizeof(HYPRE_Complex), + memory_location); } } } - } - else if ( constant_coefficient == 2 ) - { - hypre_SetIndex(center_index, 0); - stencil = hypre_StructMatrixStencil(matrix); - center_rank = hypre_StructStencilElementRank( stencil, center_index ); - if ( action > 0 ) + else +#endif { - for (s = 0; s < num_stencil_indices; s++) + if (action > 0) { - if ( stencil_indices[s] == center_rank ) - { - /* 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) - { - box = hypre_BoxArrayBox(boxes, i); - hypre_StructMatrixSetBoxValues( matrix, box, box, - num_stencil_indices, - stencil_indices, - values, action, -1, 0 ); - } - } - else - { - /* non-center, like constant_coefficient==1 */ - matp = hypre_StructMatrixBoxData(matrix, 0, - stencil_indices[s]); - *matp += values[s]; - } + *matp += values[s]; } - } - else if ( action > -1 ) - { - for (s = 0; s < num_stencil_indices; s++) + else if (action > -1) { - if ( stencil_indices[s] == center_rank ) - { - /* 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) - { - box = hypre_BoxArrayBox(boxes, i); - hypre_StructMatrixSetBoxValues( matrix, box, box, - num_stencil_indices, - stencil_indices, - values, action, -1, 0 ); - } - } - else - { - /* non-center, like constant_coefficient==1 */ - matp = hypre_StructMatrixBoxData(matrix, 0, - stencil_indices[s]); - *matp += values[s]; - } + *matp = values[s]; } - } - else /* action<0 */ - { - for (s = 0; s < num_stencil_indices; s++) + else /* action < 0 */ { - if ( stencil_indices[s] == center_rank ) + values[s] = *matp; + if (action == -2) { - /* 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) - { - box = hypre_BoxArrayBox(boxes, i); - hypre_StructMatrixSetBoxValues( matrix, box, box, - num_stencil_indices, - stencil_indices, - values, -1, -1, 0 ); - } - } - else - { - /* non-center, like constant_coefficient==1 */ - matp = hypre_StructMatrixBoxData(matrix, 0, - stencil_indices[s]); - values[s] = *matp; + *matp = 0; } } } } - else /* constant_coefficient==0 */ - { - /* We consider this an error, but do the best we can. */ - hypre_error(HYPRE_ERROR_GENERIC); - hypre_ForBoxI(i, boxes) - { - box = hypre_BoxArrayBox(boxes, i); - hypre_StructMatrixSetBoxValues( matrix, box, box, - num_stencil_indices, stencil_indices, - values, action, -1, 0 ); - } - } + return hypre_error_flag; } @@ -1076,6 +1768,8 @@ hypre_StructMatrixClearValues( hypre_StructMatrix *matrix, { hypre_BoxArray *grid_boxes; hypre_Box *grid_box; + hypre_BoxArray *data_boxes; + hypre_Box *data_box; HYPRE_Complex *matp; @@ -1087,12 +1781,13 @@ hypre_StructMatrixClearValues( hypre_StructMatrix *matrix, if (outside > 0) { - grid_boxes = hypre_StructMatrixDataSpace(matrix); + grid_boxes = hypre_StructMatrixDataBoxes(matrix); } else { grid_boxes = hypre_StructGridBoxes(hypre_StructMatrixGrid(matrix)); } + data_boxes = hypre_StructMatrixDataBoxes(matrix); if (boxnum < 0) { @@ -1112,13 +1807,16 @@ hypre_StructMatrixClearValues( hypre_StructMatrix *matrix, for (i = istart; i < istop; i++) { grid_box = hypre_BoxArrayBox(grid_boxes, i); + data_box = hypre_BoxArrayBox(data_boxes, i); if (hypre_IndexInBox(grid_index, grid_box)) { + hypre_StructMatrixMapDataIndex(matrix, grid_index); + for (s = 0; s < num_stencil_indices; s++) { - matp = hypre_StructMatrixBoxDataValue(matrix, i, stencil_indices[s], - grid_index); + matp = hypre_StructMatrixBoxData(matrix, i, stencil_indices[s]) + + hypre_BoxIndexRank(data_box, grid_index); *matp = 0.0; } } @@ -1140,11 +1838,12 @@ hypre_StructMatrixClearBoxValues( hypre_StructMatrix *matrix, HYPRE_Int boxnum, HYPRE_Int outside ) { + HYPRE_Int ndim = hypre_StructMatrixNDim(matrix); hypre_BoxArray *grid_boxes; hypre_Box *grid_box; hypre_Box *int_box; - HYPRE_Int *symm_elements; + HYPRE_Int *symm_entries; hypre_BoxArray *data_space; hypre_Box *data_box; hypre_IndexRef data_start; @@ -1161,7 +1860,7 @@ hypre_StructMatrixClearBoxValues( hypre_StructMatrix *matrix, if (outside > 0) { - grid_boxes = hypre_StructMatrixDataSpace(matrix); + grid_boxes = hypre_StructMatrixDataBoxes(matrix); } else { @@ -1186,9 +1885,9 @@ hypre_StructMatrixClearBoxValues( hypre_StructMatrix *matrix, hypre_SetIndex(data_stride, 1); - symm_elements = hypre_StructMatrixSymmElements(matrix); + symm_entries = hypre_StructMatrixSymmEntries(matrix); - int_box = hypre_BoxCreate(hypre_StructMatrixNDim(matrix)); + int_box = hypre_BoxCreate(ndim); for (i = istart; i < istop; i++) { @@ -1200,354 +1899,245 @@ hypre_StructMatrixClearBoxValues( hypre_StructMatrix *matrix, /* if there was an intersection */ if (hypre_BoxVolume(int_box)) { - data_start = hypre_BoxIMin(int_box); - - for (s = 0; s < num_stencil_indices; s++) - { - /* only clear stencil entries that are explicitly stored */ - if (symm_elements[stencil_indices[s]] < 0) - { - datap = hypre_StructMatrixBoxData(matrix, i, - stencil_indices[s]); - - hypre_BoxGetSize(int_box, loop_size); - -#define DEVICE_VAR is_device_ptr(datap) - hypre_BoxLoop1Begin(hypre_StructMatrixNDim(matrix), loop_size, - data_box, data_start, data_stride, datai); - { - datap[datai] = 0.0; - } - hypre_BoxLoop1End(datai); -#undef DEVICE_VAR - } - } - } - } - - hypre_BoxDestroy(int_box); - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_StructMatrixAssemble( hypre_StructMatrix *matrix ) -{ - HYPRE_Int ndim = hypre_StructMatrixNDim(matrix); - HYPRE_Int *num_ghost = hypre_StructMatrixNumGhost(matrix); - - HYPRE_Int comm_num_values, mat_num_values, constant_coefficient; -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - HYPRE_Int stencil_size; - hypre_StructStencil *stencil; -#endif - hypre_CommInfo *comm_info; - hypre_CommPkg *comm_pkg; - - hypre_CommHandle *comm_handle; - - HYPRE_Complex *matrix_data = hypre_StructMatrixData(matrix); - - HYPRE_Complex *matrix_data_comm = matrix_data; - - /* BEGIN - variables for ghost layer identity code below */ - hypre_StructGrid *grid; - hypre_BoxManager *boxman; - hypre_BoxArray *data_space; - hypre_BoxArrayArray *boundary_boxes; - hypre_BoxArray *boundary_box_a; - hypre_BoxArray *entry_box_a; - hypre_BoxArray *tmp_box_a; - hypre_Box *data_box; - hypre_Box *boundary_box; - hypre_Box *entry_box; - hypre_BoxManEntry **entries; - hypre_Index loop_size; - hypre_Index index; - hypre_IndexRef start; - hypre_Index stride; - HYPRE_Complex *datap; - HYPRE_Int i, j, ei; - HYPRE_Int num_entries; - /* End - variables for ghost layer identity code below */ - - constant_coefficient = hypre_StructMatrixConstantCoefficient( matrix ); - - /*----------------------------------------------------------------------- - * Set ghost zones along the domain boundary to the identity to enable code - * simplifications elsewhere in hypre (e.g., CyclicReduction). - * - * Intersect each data box with the BoxMan to get neighbors, then subtract - * the neighbors from the box to get the boundary boxes. - *-----------------------------------------------------------------------*/ - - 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); - entry_box_a = hypre_BoxArrayCreate(0, ndim); - tmp_box_a = hypre_BoxArrayCreate(0, ndim); - hypre_ForBoxI(i, data_space) - { - /* copy data box to boundary_box_a */ - boundary_box_a = hypre_BoxArrayArrayBoxArray(boundary_boxes, i); - hypre_BoxArraySetSize(boundary_box_a, 1); - boundary_box = hypre_BoxArrayBox(boundary_box_a, 0); - hypre_CopyBox(hypre_BoxArrayBox(data_space, i), boundary_box); - - hypre_BoxManIntersect(boxman, - hypre_BoxIMin(boundary_box), - hypre_BoxIMax(boundary_box), - &entries, &num_entries); - - /* put neighbor boxes into entry_box_a */ - hypre_BoxArraySetSize(entry_box_a, num_entries); - for (ei = 0; ei < num_entries; ei++) - { - entry_box = hypre_BoxArrayBox(entry_box_a, ei); - hypre_BoxManEntryGetExtents(entries[ei], - hypre_BoxIMin(entry_box), - hypre_BoxIMax(entry_box)); - } - hypre_TFree(entries, HYPRE_MEMORY_HOST); - - /* subtract neighbor boxes (entry_box_a) from data box (boundary_box_a) */ - hypre_SubtractBoxArrays(boundary_box_a, entry_box_a, tmp_box_a); - } - hypre_BoxArrayDestroy(entry_box_a); - hypre_BoxArrayDestroy(tmp_box_a); - - /* set boundary ghost zones to the identity equation */ - - hypre_SetIndex(index, 0); - hypre_SetIndex(stride, 1); - data_space = hypre_StructMatrixDataSpace(matrix); - hypre_ForBoxI(i, data_space) - { - datap = hypre_StructMatrixExtractPointerByIndex(matrix, i, index); - - if (datap) - { - data_box = hypre_BoxArrayBox(data_space, i); - boundary_box_a = hypre_BoxArrayArrayBoxArray(boundary_boxes, i); - hypre_ForBoxI(j, boundary_box_a) - { - boundary_box = hypre_BoxArrayBox(boundary_box_a, j); - start = hypre_BoxIMin(boundary_box); - - hypre_BoxGetSize(boundary_box, loop_size); - -#define DEVICE_VAR is_device_ptr(datap) - hypre_BoxLoop1Begin(hypre_StructMatrixNDim(matrix), loop_size, - data_box, start, stride, datai); - { - datap[datai] = 1.0; - } - hypre_BoxLoop1End(datai); -#undef DEVICE_VAR - } - } - } - - hypre_BoxArrayArrayDestroy(boundary_boxes); - } - - /*----------------------------------------------------------------------- - * If the CommPkg has not been set up, set it up - * - * The matrix data array is assumed to have two segments - an initial - * segment of data constant over all space, followed by a segment with - * comm_num_values matrix entries for each mesh element. The mesh-dependent - * data is, of course, the only part relevent to communications. - * For constant_coefficient==0, all the data is mesh-dependent. - * For constant_coefficient==1, all data is constant. - * For constant_coefficient==2, both segments are non-null. - *-----------------------------------------------------------------------*/ - - mat_num_values = hypre_StructMatrixNumValues(matrix); - - if ( constant_coefficient == 0 ) - { - comm_num_values = mat_num_values; -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - if (hypre_StructGridDataLocation(grid) == HYPRE_MEMORY_HOST) - { - matrix_data_comm = hypre_StructMatrixDataConst(matrix); - } -#endif - } - else if ( constant_coefficient == 1 ) - { - comm_num_values = 0; - } - else /* constant_coefficient==2 */ - { - comm_num_values = 1; -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - if (hypre_StructGridDataLocation(grid) == HYPRE_MEMORY_HOST) - { - stencil = hypre_StructMatrixStencil(matrix); - stencil_size = hypre_StructStencilSize(stencil); - matrix_data_comm = hypre_StructMatrixDataConst(matrix) + stencil_size; - } -#endif - } - - comm_pkg = hypre_StructMatrixCommPkg(matrix); + hypre_StructMatrixMapDataBox(matrix, int_box); - if (!comm_pkg) - { - hypre_CreateCommInfoFromNumGhost(hypre_StructMatrixGrid(matrix), - num_ghost, &comm_info); - hypre_CommPkgCreate(comm_info, - hypre_StructMatrixDataSpace(matrix), - hypre_StructMatrixDataSpace(matrix), - comm_num_values, NULL, 0, - hypre_StructMatrixComm(matrix), &comm_pkg); - hypre_CommInfoDestroy(comm_info); + data_start = hypre_BoxIMin(int_box); - hypre_StructMatrixCommPkg(matrix) = comm_pkg; - } + for (s = 0; s < num_stencil_indices; s++) + { + /* only clear stencil entries that are explicitly stored */ + if (symm_entries[stencil_indices[s]] < 0) + { + datap = hypre_StructMatrixBoxData(matrix, i, stencil_indices[s]); - /*----------------------------------------------------------------------- - * Update the ghost data - * This takes care of the communication needs of all known functions - * referencing the matrix. - * - * At present this is the only place where matrix data gets communicated. - * However, comm_pkg is kept as long as the matrix is, in case some - * future version hypre has a use for it - e.g. if the user replaces - * a matrix with a very similar one, we may not want to recompute comm_pkg. - *-----------------------------------------------------------------------*/ + hypre_BoxGetSize(int_box, loop_size); - if ( constant_coefficient != 1 ) - { - hypre_InitializeCommunication( comm_pkg, - matrix_data_comm, - matrix_data_comm, 0, 0, - &comm_handle ); - hypre_FinalizeCommunication( comm_handle ); + hypre_BoxLoop1Begin(ndim, loop_size, + data_box, data_start, data_stride, datai); + { + datap[datai] = 0.0; + } + hypre_BoxLoop1End(datai); + } + } + } } + hypre_BoxDestroy(int_box); + return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_StructMatrixSetNumGhost *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_StructMatrixSetNumGhost( hypre_StructMatrix *matrix, - HYPRE_Int *num_ghost ) +hypre_StructMatrixAssemble( hypre_StructMatrix *matrix ) { - HYPRE_Int d, ndim = hypre_StructMatrixNDim(matrix); + HYPRE_Int num_values = hypre_StructMatrixNumValues(matrix); - for (d = 0; d < ndim; d++) + /*----------------------------------------------------------------------- + * Update the ghost data + * This takes care of the communication needs of all known functions + * referencing the matrix. + *-----------------------------------------------------------------------*/ + + if (num_values > 0) { - hypre_StructMatrixNumGhost(matrix)[2 * d] = num_ghost[2 * d]; - hypre_StructMatrixNumGhost(matrix)[2 * d + 1] = num_ghost[2 * d + 1]; - } + HYPRE_Int ndim = hypre_StructMatrixNDim(matrix); + HYPRE_Int *num_ghost = hypre_StructMatrixNumGhost(matrix); + HYPRE_Int *sym_ghost = hypre_StructMatrixSymGhost(matrix); + HYPRE_Int *trn_ghost = hypre_StructMatrixTrnGhost(matrix); + hypre_StructGrid *grid = hypre_StructMatrixGrid(matrix); - return hypre_error_flag; -} + hypre_CommInfo *comm_info; + hypre_CommPkg *comm_pkg; + hypre_CommHandle *comm_handle; + HYPRE_Complex **comm_data; + hypre_IndexRef fstride; + HYPRE_Int i, tot_num_ghost[2 * HYPRE_MAXDIM]; -/*-------------------------------------------------------------------------- - * hypre_StructMatrixSetConstantCoefficient - * deprecated in user interface, in favor of SetConstantEntries. - * left here for internal use - *--------------------------------------------------------------------------*/ + /* RDF TODO: Use CommStencil to do communication; don't forget to account + * for symmetric stencil entries */ + for (i = 0; i < 2 * ndim; i++) + { + tot_num_ghost[i] = hypre_max(num_ghost[i] + sym_ghost[i], trn_ghost[i]); + } -HYPRE_Int -hypre_StructMatrixSetConstantCoefficient( hypre_StructMatrix *matrix, - HYPRE_Int constant_coefficient ) -{ - hypre_StructMatrixConstantCoefficient(matrix) = constant_coefficient; + hypre_StructMatrixGetFStride(matrix, &fstride); + hypre_CreateCommInfoFromNumGhost(grid, fstride, tot_num_ghost, &comm_info); + hypre_StructMatrixCreateCommPkg(matrix, comm_info, &comm_pkg, &comm_data); + + hypre_StructCommunicationInitialize(comm_pkg, comm_data, comm_data, 0, 0, &comm_handle); + hypre_StructCommunicationFinalize(comm_handle); + hypre_CommPkgDestroy(comm_pkg); + hypre_TFree(comm_data, HYPRE_MEMORY_HOST); + } return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_StructMatrixSetConstantEntries - * - nentries is the number of array entries - * - Each HYPRE_Int entries[i] is an index into the shape array of the stencil - * of the matrix - * In the present version, only three possibilites are recognized: + * nentries - number of stencil entries + * entries - array of stencil entries + * + * The following four possibilites are supported for backward compatibility: * - no entries constant (constant_coefficient==0) * - all entries constant (constant_coefficient==1) * - all but the diagonal entry constant (constant_coefficient==2) - * If something else is attempted, this function will return a nonzero error. - * In the present version, if this function is called more than once, only - * the last call will take effect. + * - anything else (constant_coefficient==3) *--------------------------------------------------------------------------*/ -HYPRE_Int hypre_StructMatrixSetConstantEntries( hypre_StructMatrix *matrix, - HYPRE_Int nentries, - HYPRE_Int *entries ) +HYPRE_Int +hypre_StructMatrixSetConstantEntries( hypre_StructMatrix *matrix, + HYPRE_Int nentries, + HYPRE_Int *entries ) { - /* We make an array offdconst corresponding to the stencil's shape array, - and use "entries" to fill it with flags - 1 for constant, 0 otherwise. - By counting the nonzeros in offdconst, and by checking whether its - diagonal entry is nonzero, we can distinguish among the three - presently legal values of constant_coefficient, and detect input errors. - We do not need to treat duplicates in "entries" as an error condition. - */ - hypre_StructStencil *stencil = hypre_StructMatrixUserStencil(matrix); - /* ... Stencil doesn't exist yet */ - HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); - HYPRE_Int *offdconst = hypre_CTAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); - /* ... note: CTAlloc initializes to 0 (normally it works by calling calloc) */ - HYPRE_Int nconst = 0; - HYPRE_Int constant_coefficient, diag_rank; - hypre_Index diag_index; - HYPRE_Int i, j; + hypre_StructStencil *stencil = hypre_StructMatrixUserStencil(matrix); + HYPRE_Int *constant = hypre_StructMatrixConstant(matrix); + HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); + HYPRE_Int stencil_diag_entry = hypre_StructStencilDiagEntry(stencil); - for ( i = 0; i < nentries; ++i ) + HYPRE_Int i, j; + HYPRE_Int nconst; + HYPRE_Int constant_coefficient; + + /* By counting the nonzeros in constant, and by checking whether its diagonal + entry is nonzero, we can distinguish between the three legal values of + constant_coefficient, and detect input errors. We do not need to treat + duplicates in 'entries' as an error condition. */ + + for (i = 0; i < nentries; i++) { - offdconst[ entries[i] ] = 1; + constant[entries[i]] = 1; } - - for ( j = 0; j < stencil_size; ++j ) + nconst = 0; + for (j = 0; j < stencil_size; j++) { - nconst += offdconst[j]; + nconst += constant[j]; } - if ( nconst <= 0 ) + if (nconst == 0) { constant_coefficient = 0; } - else if ( nconst >= stencil_size ) + else if (nconst >= stencil_size) { constant_coefficient = 1; } + else if ( (constant[stencil_diag_entry] == 0) && (nconst == (stencil_size - 1)) ) + { + constant_coefficient = 2; + } else { - hypre_SetIndex(diag_index, 0); - diag_rank = hypre_StructStencilElementRank( stencil, diag_index ); - if ( offdconst[diag_rank] == 0 ) + constant_coefficient = 3; + /* TODO: Fix this for rectangular matrices */ + //hypre_error(HYPRE_ERROR_GENERIC); + } + + hypre_StructMatrixConstantCoefficient(matrix) = constant_coefficient; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * This routine may be called at any time. The boolean 'resize' is returned to + * indicate whether a MatrixResize() is needed. Because the matrix stencil is + * required to compute the correct ghost layer size for the transpose != 0 case, + * this routine is also called in the MatrixInitialize() routine. + * + * Use this routine exclusively to set hypre_StructMatrixTranspose(). + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixSetTranspose( hypre_StructMatrix *matrix, + HYPRE_Int transpose, + HYPRE_Int *resize ) +{ + HYPRE_Int ndim = hypre_StructMatrixNDim(matrix); + HYPRE_Int *trn_ghost = hypre_StructMatrixTrnGhost(matrix); + HYPRE_Int lghost, rghost, d, e; + + *resize = 0; + if (hypre_StructMatrixTranspose(matrix) != transpose) + { + for (d = 0; d < ndim; d++) { - constant_coefficient = 2; - if ( nconst != (stencil_size - 1) ) + lghost = 0; + rghost = 0; + if ((transpose) && (hypre_StructMatrixStencil(matrix) != NULL)) + { + hypre_StructStencil *stencil = hypre_StructMatrixStencil(matrix); + hypre_Index *stencil_shape = hypre_StructStencilShape(stencil); + HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); + + for (e = 0; e < stencil_size; e++) + { + lghost = hypre_max(lghost, -hypre_IndexD(stencil_shape[e], d)); + rghost = hypre_max(rghost, hypre_IndexD(stencil_shape[e], d)); + } + } + if (trn_ghost[2 * d] != lghost) + { + trn_ghost[2 * d] = lghost; + *resize = 1; + } + if (trn_ghost[2 * d + 1] != rghost) { - hypre_error(HYPRE_ERROR_GENERIC); + trn_ghost[2 * d + 1] = rghost; + *resize = 1; } } - else + + hypre_StructMatrixTranspose(matrix) = transpose; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * This routine may be called at any time. The boolean 'resize' is returned to + * indicate whether a MatrixResize() is needed. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixSetNumGhost( hypre_StructMatrix *matrix, + HYPRE_Int *num_ghost, + HYPRE_Int *resize ) +{ + HYPRE_Int i, ndim = hypre_StructMatrixNDim(matrix); + + *resize = 0; + for (i = 0; i < 2 * ndim; i++) + { + if (hypre_StructMatrixNumGhost(matrix)[i] != num_ghost[i]) { - constant_coefficient = 0; - hypre_error(HYPRE_ERROR_GENERIC); + hypre_StructMatrixNumGhost(matrix)[i] = num_ghost[i]; + *resize = 1; } } - hypre_StructMatrixSetConstantCoefficient( matrix, constant_coefficient ); + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixSetGhost( hypre_StructMatrix *matrix, + HYPRE_Int ghost, + HYPRE_Int *resize ) +{ + HYPRE_Int i, ndim = hypre_StructMatrixNDim(matrix); + HYPRE_Int num_ghost[2 * HYPRE_MAXDIM]; + + for (i = 0; i < 2 * ndim; i++) + { + num_ghost[i] = ghost; + } + hypre_StructMatrixSetNumGhost(matrix, num_ghost, resize); - hypre_TFree(offdconst, HYPRE_MEMORY_HOST); return hypre_error_flag; } @@ -1558,19 +2148,21 @@ HYPRE_Int hypre_StructMatrixClearGhostValues( hypre_StructMatrix *matrix ) { HYPRE_Int ndim = hypre_StructMatrixNDim(matrix); - hypre_Box *m_data_box; HYPRE_Complex *mp; hypre_StructStencil *stencil; - HYPRE_Int *symm_elements; - hypre_BoxArray *boxes; - hypre_Box *box; + HYPRE_Int *constant; + HYPRE_Int *symm_entries; + hypre_BoxArray *grid_boxes; + hypre_BoxArray *data_space; + hypre_Box *data_box; + hypre_Box *grid_data_box; hypre_BoxArray *diff_boxes; hypre_Box *diff_box; hypre_Index loop_size; hypre_IndexRef start; - hypre_Index unit_stride; + hypre_Index ustride; HYPRE_Int i, j, s; @@ -1578,23 +2170,30 @@ hypre_StructMatrixClearGhostValues( hypre_StructMatrix *matrix ) * Set the matrix coefficients *-----------------------------------------------------------------------*/ - hypre_SetIndex(unit_stride, 1); + hypre_SetIndex(ustride, 1); + + grid_data_box = hypre_BoxCreate(ndim); stencil = hypre_StructMatrixStencil(matrix); - symm_elements = hypre_StructMatrixSymmElements(matrix); - boxes = hypre_StructGridBoxes(hypre_StructMatrixGrid(matrix)); + constant = hypre_StructMatrixConstant(matrix); + symm_entries = hypre_StructMatrixSymmEntries(matrix); + grid_boxes = hypre_StructGridBoxes(hypre_StructMatrixGrid(matrix)); + //data_space = hypre_StructMatrixDataBoxes(matrix); + data_space = hypre_StructMatrixDataSpace(matrix); diff_boxes = hypre_BoxArrayCreate(0, ndim); - hypre_ForBoxI(i, boxes) + hypre_ForBoxI(i, grid_boxes) { - box = hypre_BoxArrayBox(boxes, i); - m_data_box = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(matrix), i); + hypre_CopyBox(hypre_BoxArrayBox(grid_boxes, i), grid_data_box); + data_box = hypre_BoxArrayBox(data_space, i); hypre_BoxArraySetSize(diff_boxes, 0); - hypre_SubtractBoxes(m_data_box, box, diff_boxes); + hypre_StructMatrixMapDataBox(matrix, grid_data_box); + hypre_SubtractBoxes(data_box, grid_data_box, diff_boxes); for (s = 0; s < hypre_StructStencilSize(stencil); s++) { - /* only clear stencil entries that are explicitly stored */ - if (symm_elements[s] < 0) + /* only clear stencil entries that are explicitly stored + and those regarding variable coefficients */ + if ((symm_entries[s] < 0) && !(constant[s])) { mp = hypre_StructMatrixBoxData(matrix, i, s); hypre_ForBoxI(j, diff_boxes) @@ -1604,19 +2203,18 @@ hypre_StructMatrixClearGhostValues( hypre_StructMatrix *matrix ) hypre_BoxGetSize(diff_box, loop_size); -#define DEVICE_VAR is_device_ptr(mp) - hypre_BoxLoop1Begin(hypre_StructMatrixNDim(matrix), loop_size, - m_data_box, start, unit_stride, mi); + hypre_BoxLoop1Begin(ndim, loop_size, + data_box, start, ustride, mi); { mp[mi] = 0.0; } hypre_BoxLoop1End(mi); -#undef DEVICE_VAR } } } } hypre_BoxArrayDestroy(diff_boxes); + hypre_BoxDestroy(grid_data_box); return hypre_error_flag; } @@ -1632,25 +2230,32 @@ hypre_StructMatrixPrintData( FILE *file, { HYPRE_Int ndim = hypre_StructMatrixNDim(matrix); HYPRE_Int num_values = hypre_StructMatrixNumValues(matrix); - HYPRE_Int ctecoef = hypre_StructMatrixConstantCoefficient(matrix); + HYPRE_Int num_cvalues = hypre_StructMatrixNumCValues(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_Int *symm_entries = hypre_StructMatrixSymmEntries(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_Int *const_indices = hypre_StructMatrixConstIndices(matrix); HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(matrix); + + HYPRE_Int i, ci, vi; + HYPRE_Int *value_ids; + HYPRE_Int *cvalue_ids; + hypre_BoxArray *boxes; - hypre_Index center_index; - HYPRE_Int center_rank; + hypre_Box *box; + hypre_Index data_origin; HYPRE_Complex *h_data; + HYPRE_Complex *h_vdata; + HYPRE_Complex value; /* 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); + h_data = hypre_TAlloc(HYPRE_Complex, data_size, HYPRE_MEMORY_HOST); hypre_TMemcpy(h_data, data, HYPRE_Complex, data_size, HYPRE_MEMORY_HOST, memory_location); } @@ -1659,31 +2264,82 @@ hypre_StructMatrixPrintData( FILE *file, h_data = data; } - /* Print ghost data (all) also or only real data? */ - boxes = (all) ? data_space : grid_boxes; + /* This assumes that zero maps to/from zero in the data space */ + hypre_SetIndex(data_origin, 0); + + /* Build constant and variable coefficient stencil indices */ + value_ids = hypre_TAlloc(HYPRE_Int, num_values, HYPRE_MEMORY_HOST); + cvalue_ids = hypre_TAlloc(HYPRE_Int, num_cvalues, HYPRE_MEMORY_HOST); + vi = ci = 0; + for (i = 0; i < stencil_size; i++) + { + if (symm_entries[i] < 0) + { + if (hypre_StructMatrixConstEntry(matrix, i)) + { + cvalue_ids[ci++] = i; + } + else + { + value_ids[vi++] = i; + } + } + } - /* Print data to file */ - if (ctecoef == 1) + /* Print ghost data (all) also or only real data? */ + if (all) { - hypre_PrintCCBoxArrayData(file, boxes, data_space, num_values, h_data); + boxes = data_space; } - else if (ctecoef == 2) + else { - hypre_SetIndex(center_index, 0); - center_rank = hypre_StructStencilElementRank(stencil, center_index); + boxes = hypre_BoxArrayClone(hypre_StructGridBoxes(grid)); + hypre_ForBoxI(i, boxes) + { + box = hypre_BoxArrayBox(boxes, i); + hypre_StructMatrixMapDataBox(matrix, box); + } + } - hypre_PrintCCVDBoxArrayData(file, boxes, data_space, num_values, - center_rank, stencil_size, symm_elements, - ndim, h_data); + /* Print constant data to file */ + hypre_fprintf(file, "\nConstant Data:\n"); + /* RDF: It looks like the following 'if' handles matrices with no data */ + if (hypre_StructMatrixDataSize(matrix) > 0) + { + hypre_fprintf(file, "%d\n", num_cvalues); + for (ci = 0; ci < num_cvalues; ci++) + { + i = cvalue_ids[ci]; + value = h_data[const_indices[i]]; +#ifdef HYPRE_COMPLEX + hypre_fprintf(file, "*: (*; %d) %.14e, %.14e\n", + i, hypre_creal(value), hypre_cimag(value)); +#else + hypre_fprintf(file, "*: (*; %d) %.14e\n", i, value); +#endif + } } - else + + /* Print variable data to file */ + hypre_fprintf(file, "\nVariable Data:\n"); + h_vdata = h_data + hypre_StructMatrixVDataOffset(matrix); + /* RDF: It looks like the following 'if' handles matrices with no data */ + if (hypre_StructMatrixDataSize(matrix) > 0) { - hypre_PrintBoxArrayData(file, boxes, data_space, num_values, - ndim, h_data); + hypre_PrintBoxArrayData(file, ndim, boxes, data_space, num_values, value_ids, h_vdata); } - /* Free memory */ - if (hypre_GetActualMemLocation(memory_location) != hypre_MEMORY_HOST) + /*---------------------------------------- + * Clean up + *----------------------------------------*/ + + hypre_TFree(value_ids, HYPRE_MEMORY_HOST); + hypre_TFree(cvalue_ids, HYPRE_MEMORY_HOST); + if (!all) + { + hypre_BoxArrayDestroy(boxes); + } + if (h_data != data) { hypre_TFree(h_data, HYPRE_MEMORY_HOST); } @@ -1692,98 +2348,117 @@ hypre_StructMatrixPrintData( FILE *file, } /*-------------------------------------------------------------------------- - * 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_Int ndim = hypre_StructMatrixNDim(matrix); + hypre_StructGrid *grid = hypre_StructMatrixGrid(matrix); + hypre_BoxArray *boxes = hypre_StructGridBoxes(grid); + + hypre_Box *box; + HYPRE_Int num_values, num_cvalues; + HYPRE_Complex *h_values, *values; + HYPRE_Complex *h_cvalues, *cvalues; + HYPRE_Complex value; +#ifdef HYPRE_COMPLEX + HYPRE_Complex rvalue, ivalue; +#endif + HYPRE_Int *value_ids, *cvalue_ids; + HYPRE_Int ci, i, vi; + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(matrix); - HYPRE_Complex *h_data; - HYPRE_Int real_stencil_size; +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec_policy = hypre_GetExecPolicy1(memory_location); +#endif - /* Allocate/Point to data on the host memory */ - if (hypre_GetActualMemLocation(memory_location) != hypre_MEMORY_HOST) + /* Read constant data from file */ + if (hypre_fscanf(file, "\nConstant Data:\n") != 0) { - h_data = hypre_CTAlloc(HYPRE_Complex, data_size, HYPRE_MEMORY_HOST); + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Detected wrong keyword!"); + return hypre_error_flag; } - else + hypre_fscanf(file, "%d\n", &num_cvalues); + cvalue_ids = hypre_TAlloc(HYPRE_Int, num_cvalues, HYPRE_MEMORY_HOST); + h_cvalues = hypre_TAlloc(HYPRE_Complex, num_cvalues, HYPRE_MEMORY_HOST); + for (ci = 0; ci < num_cvalues; ci++) { - h_data = data; +#ifdef HYPRE_COMPLEX + hypre_fscanf(file, "*: (*; %d) %le, %le\n", &i, &rvalue, &ivalue); + value = rvalue + I * ivalue; +#else + hypre_fscanf(file, "*: (*; %d) %le\n", &i, &value); +#endif + cvalue_ids[ci] = i; + h_cvalues[ci] = value; } - /* 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 + /* Read variable data from file */ + if (hypre_fscanf(file, "\nVariable Data:\n") != 0) { - real_stencil_size = stencil_size; + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Detected wrong keyword!"); + return hypre_error_flag; } + hypre_ReadBoxArrayData(file, ndim, boxes, &num_values, &value_ids, &h_values); - /* Read data from file */ - if (ctecoef == 0) + /* Move values to the device memory if necessary and free host values */ +#if defined(HYPRE_USING_GPU) + if (exec_policy == HYPRE_EXEC_DEVICE) { - hypre_ReadBoxArrayData(file, boxes, data_space, - num_values, ndim, h_data); + vi = hypre_BoxArrayVolume(boxes) * num_values; + values = hypre_TAlloc(HYPRE_Complex, vi, memory_location); + cvalues = hypre_TAlloc(HYPRE_Complex, num_cvalues, memory_location); + hypre_TMemcpy(values, h_values, HYPRE_Complex, vi, + memory_location, HYPRE_MEMORY_HOST); + hypre_TMemcpy(cvalues, h_cvalues, HYPRE_Complex, num_cvalues, + memory_location, HYPRE_MEMORY_HOST); + hypre_TFree(h_values, HYPRE_MEMORY_HOST); + hypre_TFree(h_cvalues, HYPRE_MEMORY_HOST); } else +#endif { - hypre_assert(ctecoef <= 2); - hypre_ReadBoxArrayData_CC(file, boxes, data_space, - stencil_size, real_stencil_size, - ctecoef, ndim, h_data); + values = h_values; + cvalues = h_cvalues; } - /* Move data to the device memory if necessary and free host data */ - if (hypre_GetActualMemLocation(memory_location) != hypre_MEMORY_HOST) + /* Set matrix values */ + HYPRE_StructMatrixSetConstantEntries(matrix, num_cvalues, cvalue_ids); + HYPRE_StructMatrixInitialize(matrix); + HYPRE_StructMatrixSetConstantValues(matrix, num_cvalues, cvalue_ids, cvalues); + vi = 0; + hypre_ForBoxI(i, boxes) { - hypre_TMemcpy(data, h_data, HYPRE_Complex, data_size, - memory_location, HYPRE_MEMORY_HOST); - hypre_TFree(h_data, HYPRE_MEMORY_HOST); + box = hypre_BoxArrayBox(boxes, i); + HYPRE_StructMatrixSetBoxValues(matrix, hypre_BoxIMin(box), hypre_BoxIMax(box), + num_values, value_ids, &values[vi]); + vi += num_values * hypre_BoxVolume(box); } + /* Clean up */ + hypre_TFree(cvalue_ids, HYPRE_MEMORY_HOST); + hypre_TFree(value_ids, HYPRE_MEMORY_HOST); + hypre_TFree(cvalues, memory_location); + hypre_TFree(values, memory_location); + return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_StructMatrixPrint *--------------------------------------------------------------------------*/ HYPRE_Int hypre_StructMatrixPrint( const char *filename, hypre_StructMatrix *matrix, - HYPRE_Int all ) + HYPRE_Int all ) { + HYPRE_Int ndim = hypre_StructMatrixNDim(matrix); + hypre_StructStencil *stencil = hypre_StructMatrixStencil(matrix); + FILE *file; char new_filename[255]; - - hypre_StructGrid *grid; - - hypre_StructStencil *stencil; - hypre_Index *stencil_shape; - HYPRE_Int stencil_size; - - HYPRE_Int ndim, num_values; - - HYPRE_Int *symm_elements; - - HYPRE_Int i, j, d; HYPRE_Int myid; /*---------------------------------------- @@ -1805,50 +2480,33 @@ hypre_StructMatrixPrint( const char *filename, *----------------------------------------*/ hypre_fprintf(file, "StructMatrix\n"); - hypre_fprintf(file, "\nSymmetric: %d\n", hypre_StructMatrixSymmetric(matrix)); hypre_fprintf(file, "\nConstantCoefficient: %d\n", hypre_StructMatrixConstantCoefficient(matrix)); /* print grid info */ hypre_fprintf(file, "\nGrid:\n"); - grid = hypre_StructMatrixGrid(matrix); - hypre_StructGridPrint(file, grid); + hypre_StructGridPrint(file, hypre_StructMatrixGrid(matrix)); - /* print stencil info */ - hypre_fprintf(file, "\nStencil:\n"); - stencil = hypre_StructMatrixStencil(matrix); - stencil_shape = hypre_StructStencilShape(stencil); + /* print ran_stride and dom_stride info */ + hypre_fprintf(file, "\nRange Stride: "); + hypre_IndexPrint(file, ndim, hypre_StructMatrixRanStride(matrix)); - ndim = hypre_StructMatrixNDim(matrix); - num_values = hypre_StructMatrixNumValues(matrix); - symm_elements = hypre_StructMatrixSymmElements(matrix); - hypre_fprintf(file, "%d\n", num_values); - stencil_size = hypre_StructStencilSize(stencil); - j = 0; - for (i = 0; i < stencil_size; i++) - { - if (symm_elements[i] < 0) - { - /* Print line of the form: "%d: %d %d %d\n" */ - hypre_fprintf(file, "%d:", j++); - for (d = 0; d < ndim; d++) - { - hypre_fprintf(file, " %d", hypre_IndexD(stencil_shape[i], d)); - } - hypre_fprintf(file, "\n"); - } - } + hypre_fprintf(file, "\nDomain Stride: "); + hypre_IndexPrint(file, ndim, hypre_StructMatrixDomStride(matrix)); + + /* print stencil info */ + hypre_fprintf(file, "\n\nStencil:\n"); + hypre_StructStencilPrint(file, stencil); /*---------------------------------------- * Print data *----------------------------------------*/ - hypre_fprintf(file, "\nData:\n"); hypre_StructMatrixPrintData(file, matrix, all); /*---------------------------------------- - * Close file + * Clean up *----------------------------------------*/ fflush(file); @@ -1858,7 +2516,8 @@ hypre_StructMatrixPrint( const char *filename, } /*-------------------------------------------------------------------------- - * hypre_StructMatrixRead + * NOTE: This will not read files with ghost values in them. + * RDF TODO: Fix this to use new matrix structure *--------------------------------------------------------------------------*/ hypre_StructMatrix * @@ -1875,12 +2534,10 @@ hypre_StructMatrixRead( MPI_Comm comm, HYPRE_Int ndim; hypre_StructStencil *stencil; - hypre_Index *stencil_shape; - HYPRE_Int stencil_size; HYPRE_Int symmetric; HYPRE_Int constant_coefficient; - - HYPRE_Int i, d, idummy; + hypre_Index ran_stride; + hypre_Index dom_stride; HYPRE_Int myid; @@ -1903,46 +2560,39 @@ hypre_StructMatrixRead( MPI_Comm comm, *----------------------------------------*/ hypre_fscanf(file, "StructMatrix\n"); - hypre_fscanf(file, "\nSymmetric: %d\n", &symmetric); hypre_fscanf(file, "\nConstantCoefficient: %d\n", &constant_coefficient); /* read grid info */ hypre_fscanf(file, "\nGrid:\n"); hypre_StructGridRead(comm, file, &grid); + ndim = hypre_StructGridNDim(grid); + + /* read ran_stride and dom_stride info */ + hypre_fscanf(file, "\nRange Stride: "); + hypre_IndexRead(file, ndim, ran_stride); + + hypre_fscanf(file, "\nDomain Stride: "); + hypre_IndexRead(file, ndim, dom_stride); /* read stencil info */ - hypre_fscanf(file, "\nStencil:\n"); - ndim = hypre_StructGridNDim(grid); - hypre_fscanf(file, "%d\n", &stencil_size); - stencil_shape = hypre_CTAlloc(hypre_Index, stencil_size, HYPRE_MEMORY_HOST); - for (i = 0; i < stencil_size; i++) - { - /* Read line of the form: "%d: %d %d %d\n" */ - hypre_fscanf(file, "%d:", &idummy); - for (d = 0; d < ndim; d++) - { - hypre_fscanf(file, " %d", &hypre_IndexD(stencil_shape[i], d)); - } - hypre_fscanf(file, "\n"); - } - stencil = hypre_StructStencilCreate(ndim, stencil_size, stencil_shape); + hypre_fscanf(file, "\n\nStencil:\n"); + hypre_StructStencilRead(file, ndim, &stencil); /*---------------------------------------- * Initialize the matrix *----------------------------------------*/ - matrix = hypre_StructMatrixCreate(comm, grid, stencil); - hypre_StructMatrixSymmetric(matrix) = symmetric; - hypre_StructMatrixConstantCoefficient(matrix) = constant_coefficient; - hypre_StructMatrixSetNumGhost(matrix, num_ghost); - hypre_StructMatrixInitialize(matrix); + HYPRE_StructMatrixCreate(comm, grid, stencil, &matrix); + HYPRE_StructMatrixSetNumGhost(matrix, num_ghost); // RDF Is this needed? + HYPRE_StructMatrixSetSymmetric(matrix, symmetric); + HYPRE_StructMatrixSetRangeStride(matrix, ran_stride); + HYPRE_StructMatrixSetDomainStride(matrix, dom_stride); /*---------------------------------------- * Read data *----------------------------------------*/ - hypre_fscanf(file, "\nData:\n"); hypre_StructMatrixReadData(file, matrix); /*---------------------------------------- @@ -1952,16 +2602,18 @@ hypre_StructMatrixRead( MPI_Comm comm, hypre_StructMatrixAssemble(matrix); /*---------------------------------------- - * Close file + * Clean up and close file *----------------------------------------*/ + HYPRE_StructGridDestroy(grid); + HYPRE_StructStencilDestroy(stencil); + fclose(file); return matrix; } /*-------------------------------------------------------------------------- - * hypre_StructMatrixMigrate *--------------------------------------------------------------------------*/ HYPRE_Int @@ -1975,7 +2627,7 @@ hypre_StructMatrixMigrate( hypre_StructMatrix *from_matrix, HYPRE_Int constant_coefficient, comm_num_values; HYPRE_Int stencil_size, mat_num_values; hypre_StructStencil *stencil; - + HYPRE_Int data_initial_offset = 0; HYPRE_Complex *matrix_data_from = hypre_StructMatrixData(from_matrix); HYPRE_Complex *matrix_data_to = hypre_StructMatrixData(to_matrix); HYPRE_Complex *matrix_data_comm_from = matrix_data_from; @@ -1989,7 +2641,7 @@ hypre_StructMatrixMigrate( hypre_StructMatrix *from_matrix, hypre_assert( constant_coefficient == hypre_StructMatrixConstantCoefficient( to_matrix ) ); mat_num_values = hypre_StructMatrixNumValues(from_matrix); - hypre_assert( mat_num_values == hypre_StructMatrixNumValues(to_matrix) ); + hypre_assert((mat_num_values == hypre_StructMatrixNumValues(to_matrix))); if ( constant_coefficient == 0 ) { @@ -2006,17 +2658,9 @@ hypre_StructMatrixMigrate( hypre_StructMatrix *from_matrix, stencil_size = hypre_StructStencilSize(stencil); hypre_assert(stencil_size == hypre_StructStencilSize( hypre_StructMatrixStencil(to_matrix) ) ); -#if 0 //defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) - if (hypre_StructGridDataLocation(hypre_StructMatrixGrid(from_matrix)) == HYPRE_MEMORY_HOST) - { - stencil = hypre_StructMatrixStencil(from_matrix); - stencil_size = hypre_StructStencilSize(stencil); - matrix_data_comm_from = hypre_StructMatrixDataConst(from_matrix) + stencil_size; - stencil = hypre_StructMatrixStencil(to_matrix); - stencil_size = hypre_StructStencilSize(stencil); - matrix_data_comm_to = hypre_StructMatrixDataConst(to_matrix) + stencil_size; - } -#endif + data_initial_offset = stencil_size; + matrix_data_comm_from = &( matrix_data_from[data_initial_offset] ); + matrix_data_comm_to = &( matrix_data_to[data_initial_offset] ); } hypre_CreateCommInfoFromGrids(hypre_StructMatrixGrid(from_matrix), @@ -2026,7 +2670,9 @@ hypre_StructMatrixMigrate( hypre_StructMatrix *from_matrix, hypre_StructMatrixDataSpace(from_matrix), hypre_StructMatrixDataSpace(to_matrix), comm_num_values, NULL, 0, - hypre_StructMatrixComm(from_matrix), &comm_pkg); + hypre_StructMatrixComm(from_matrix), + hypre_StructMatrixMemoryLocation(from_matrix), + &comm_pkg); hypre_CommInfoDestroy(comm_info); /* is this correct for periodic? */ @@ -2034,13 +2680,13 @@ hypre_StructMatrixMigrate( hypre_StructMatrix *from_matrix, * Migrate the matrix data *-----------------------------------------------------------------------*/ - if ( constant_coefficient != 1 ) + if (constant_coefficient != 1) { - hypre_InitializeCommunication( comm_pkg, - matrix_data_comm_from, - matrix_data_comm_to, 0, 0, - &comm_handle ); - hypre_FinalizeCommunication( comm_handle ); + hypre_StructCommunicationInitialize(comm_pkg, + &matrix_data_comm_from, + &matrix_data_comm_to, 0, 0, + &comm_handle); + hypre_StructCommunicationFinalize(comm_handle); } hypre_CommPkgDestroy(comm_pkg); @@ -2056,65 +2702,128 @@ hypre_StructMatrixClearBoundary( hypre_StructMatrix *matrix) { HYPRE_Int ndim = hypre_StructMatrixNDim(matrix); HYPRE_Complex *data; - hypre_BoxArray *grid_boxes; - hypre_BoxArray *data_space; - /*hypre_Box *box;*/ - hypre_Box *grid_box; - hypre_Box *data_box; - hypre_Box *tmp_box; + hypre_BoxArray *grid_boxes, *data_space, *boundary; + hypre_Box *box, *dbox, *tbox; hypre_Index *shape; - hypre_Index stencil_element; + hypre_Index stencil_offset; hypre_Index loop_size; - hypre_IndexRef start; - hypre_Index stride; + hypre_IndexRef dstart; + hypre_Index origin, stride, dstride; hypre_StructGrid *grid; hypre_StructStencil *stencil; - hypre_BoxArray *boundary; - HYPRE_Int i, i2, j; + HYPRE_Int i, j, e; /*----------------------------------------------------------------------- * Set the matrix coefficients *-----------------------------------------------------------------------*/ + box = hypre_BoxCreate(ndim); + grid = hypre_StructMatrixGrid(matrix); stencil = hypre_StructMatrixStencil(matrix); grid_boxes = hypre_StructGridBoxes(grid); ndim = hypre_StructStencilNDim(stencil); data_space = hypre_StructMatrixDataSpace(matrix); - hypre_SetIndex(stride, 1); + hypre_SetIndex(dstride, 1); shape = hypre_StructStencilShape(stencil); - for (j = 0; j < hypre_StructStencilSize(stencil); j++) + for (e = 0; e < hypre_StructStencilSize(stencil); e++) { - hypre_CopyIndex(shape[j], stencil_element); - if (!hypre_IndexEqual(stencil_element, 0, ndim)) + if (!hypre_StructMatrixConstEntry(matrix, e)) { - hypre_ForBoxI(i, grid_boxes) + hypre_CopyIndex(shape[e], stencil_offset); + if (!hypre_IndexEqual(stencil_offset, 0, ndim)) { - grid_box = hypre_BoxArrayBox(grid_boxes, i); - data_box = hypre_BoxArrayBox(data_space, i); - boundary = hypre_BoxArrayCreate( 0, ndim ); - hypre_GeneralBoxBoundaryIntersect(grid_box, grid, stencil_element, - boundary); - data = hypre_StructMatrixBoxData(matrix, i, j); - hypre_ForBoxI(i2, boundary) + hypre_ForBoxI(i, grid_boxes) { - tmp_box = hypre_BoxArrayBox(boundary, i2); - hypre_BoxGetSize(tmp_box, loop_size); - start = hypre_BoxIMin(tmp_box); -#define DEVICE_VAR is_device_ptr(data) - hypre_BoxLoop1Begin(ndim, loop_size, data_box, start, stride, ixyz); + hypre_CopyBox(hypre_BoxArrayBox(grid_boxes, i), box); + hypre_StructMatrixGetStencilSpace(matrix, e, 0, origin, stride); + /*hypre_ProjectBox(box, origin, stride);*/ + dbox = hypre_BoxArrayBox(data_space, i); + boundary = hypre_BoxArrayCreate(0, ndim); + hypre_GeneralBoxBoundaryIntersect(box, grid, stencil_offset, boundary); + data = hypre_StructMatrixBoxData(matrix, i, e); + hypre_ForBoxI(j, boundary) { - data[ixyz] = 0.0; + tbox = hypre_BoxArrayBox(boundary, j); + hypre_ProjectBox(tbox, origin, stride); + if (hypre_BoxVolume(tbox)) + { + hypre_StructMatrixMapDataBox(matrix, tbox); + hypre_BoxGetSize(tbox, loop_size); + dstart = hypre_BoxIMin(tbox); + hypre_BoxLoop1Begin(ndim, loop_size, dbox, dstart, dstride, di); + { + data[di] = 0.0; + } + hypre_BoxLoop1End(di); + } } - hypre_BoxLoop1End(ixyz); -#undef DEVICE_VAR + hypre_BoxArrayDestroy(boundary); } - hypre_BoxArrayDestroy(boundary); } } } + hypre_BoxDestroy(box); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Returns the diagonal of a square StructMatrix as a StructVector + * + * TODO: Create StructVector if diag is NULL + * + * RDF TODO: This routine should assume that the base grid for matrix and diag + * are the same. Extend it to work when the matrix has non-unitary stride. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatrixGetDiagonal( hypre_StructMatrix *matrix, + hypre_StructVector *diag ) +{ + HYPRE_Int ndim = hypre_StructMatrixNDim(matrix); + hypre_StructGrid *grid = hypre_StructMatrixGrid(matrix); + hypre_BoxArray *boxes = hypre_StructGridBoxes(grid); + hypre_StructStencil *stencil = hypre_StructMatrixStencil(matrix); + hypre_BoxArray *A_data_space = hypre_StructMatrixDataSpace(matrix); + hypre_BoxArray *x_data_space = hypre_StructVectorDataSpace(diag); + + hypre_IndexRef start; + hypre_Index ustride; + hypre_Index loop_size; + hypre_Box *box; + hypre_Box *A_data_box; + hypre_Box *d_data_box; + HYPRE_Int stencil_diag; + HYPRE_Int i; + HYPRE_Complex *Ap, *dp; + + hypre_SetIndex(ustride, 1); + hypre_ForBoxArrayI(i, boxes) + { + box = hypre_BoxArrayBox(boxes, i); + stencil_diag = hypre_StructStencilDiagEntry(stencil); + + A_data_box = hypre_BoxArrayBox(A_data_space, i); + d_data_box = hypre_BoxArrayBox(x_data_space, i); + + Ap = hypre_StructMatrixBoxData(matrix, i, stencil_diag); + dp = hypre_StructVectorBoxData(diag, i); + + start = hypre_BoxIMin(box); + hypre_BoxGetStrideSize(box, ustride, loop_size); + + hypre_BoxLoop2Begin(ndim, loop_size, + A_data_box, start, ustride, Ai, + d_data_box, start, ustride, di) + { + dp[di] = Ap[Ai]; + } + hypre_BoxLoop2End(Ai, di) + } + return hypre_error_flag; } diff --git a/src/struct_mv/struct_matrix.h b/src/struct_mv/struct_matrix.h index f6b086e54e..1a2c9e95c4 100644 --- a/src/struct_mv/struct_matrix.h +++ b/src/struct_mv/struct_matrix.h @@ -16,45 +16,91 @@ /*-------------------------------------------------------------------------- * hypre_StructMatrix: + * + * Rectangular matrices have different range and domain grids, which are defined + * in terms of a common base grid and index space. The range grid consists of a + * coarsened subset of boxes in the base grid, as specified by the box numbers + * in 'ran_boxnums' and the coarsening factor 'ran_stride'. The domain grid is + * similarly defined via 'dom_boxnums' and 'dom_stride'. Either the range index + * space is a coarsening of the domain index space or vice-versa. The data + * storage is dictated by the coarsest grid as indicated (for convenience) by + * the two booleans 'range_is_coarse' and 'domain_is_coarse'. The stencil + * always represents a "row" stencil that operates on the domain grid and + * produces a value on the range grid. The data interface and accessor macros + * are also row-stencil based, regardless of the underlying storage. Each + * stencil entry can have either constant or variable coefficients as indicated + * by the stencil-sized array 'constant'. + * + * The 'data' pointer below has space at the beginning for constant stencil + * coefficient values followed by the stored variable coefficient values. + * Accessing coefficients is done via 'data_indices' through the interface + * routine hypre_StructMatrixBoxData(). The number of boxes in data_boxes, + * data_space, and data_indices is the same as in the base grid, even though + * both ran_nboxes and dom_nboxes may be smaller. + * + * The 'num_ghost' and 'sym_ghost' arrays are used to determine how many ghost + * layers of storage to keep. They determine the dimensions of 'data_space' and + * 'data_boxes', but they do not imply communication of any sort. That is, the + * values stored in the ghost layers will not be correct without triggering some + * additional communication either explicitly or by setting the 'symmetric' or + * 'transpose' flags. *--------------------------------------------------------------------------*/ typedef struct hypre_StructMatrix_struct { MPI_Comm comm; - hypre_StructGrid *grid; + hypre_StructGrid *grid; /* Base grid */ + HYPRE_Int ran_nboxes; /* Range grid number of boxes */ + HYPRE_Int *ran_boxnums; /* Range grid boxnums in base grid */ + hypre_Index ran_stride; /* Range grid coarsening stride */ + HYPRE_Int dom_nboxes; /* Domain grid number of boxes */ + HYPRE_Int *dom_boxnums; /* Domain grid boxnums in base grid */ + hypre_Index dom_stride; /* Domain grid coarsening stride */ + hypre_StructStencil *user_stencil; hypre_StructStencil *stencil; - HYPRE_Int num_values; /* Number of "stored" coefficients */ - - 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 */ - HYPRE_Int data_alloced; /* Boolean used for freeing data */ - HYPRE_Int data_size; /* Size of variable matrix data */ - HYPRE_Int data_const_size; /* Size of constant matrix data */ - HYPRE_Int **data_indices; /* num-boxes by stencil-size array - of indices into the data array. - data_indices[b][s] is the starting - index of matrix data corresponding - to box b and stencil coefficient s */ - HYPRE_Int constant_coefficient; /* normally 0; set to 1 for - constant coefficient matrices - or 2 for constant coefficient - with variable diagonal */ - - 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_BigInt global_size; /* Total number of nonzero coeffs */ - - hypre_CommPkg *comm_pkg; /* Info on how to update ghost data */ - - HYPRE_Int ref_count; + HYPRE_Int *constant; /* Which stencil entries are constant? */ + + HYPRE_MemoryLocation memory_location; /* Memory location of the data array */ + HYPRE_Complex *data; /* Pointer to matrix data */ + hypre_BoxArray *data_space; /* Layout of data (coarse index space) */ + hypre_BoxArray *data_boxes; /* Data extents on fine index space */ + HYPRE_Int **data_indices; /* Array of indices into the data array. + data_indices[b][s] is the starting index of + data for boxnum b and stencil coefficient s */ + HYPRE_Int data_alloced; /* Boolean used for freeing data */ + HYPRE_Int data_size; /* Size of matrix data */ + HYPRE_BigInt global_size; /* Total number of nonzero coeffs */ + HYPRE_Int *const_indices; /* Indices into the data array for constant data */ + HYPRE_Int vdata_offset; /* Offset to variable-coeff matrix data */ + HYPRE_Int num_values; /* Number of "stored" variable coeffs */ + HYPRE_Int num_cvalues; /* Number of "stored" constant coeffs */ + HYPRE_Int range_is_coarse; /* 1 -> the range is coarse */ + HYPRE_Int domain_is_coarse; /* 1 -> the domain is coarse */ + HYPRE_Int constant_coefficient; /* RDF: Phase this out in favor + of 'constant' array above. + Values can be {0, 1, 2} -> + {variable, constant, constant + with variable diagonal} */ + HYPRE_Int symmetric; /* Is the matrix symmetric */ + HYPRE_Int *symm_entries; /* Which entries are "symmetric" */ + HYPRE_Int transpose; /* Transpose stored also? */ + hypre_CommPkg *comm_pkg; /* Info on how to update ghost data */ + HYPRE_Int ref_count; /* Reference counter */ + + HYPRE_Int num_ghost[2 * HYPRE_MAXDIM]; /* Min num ghost layers */ + HYPRE_Int sym_ghost[2 * HYPRE_MAXDIM]; /* Ghost layers for symmetric */ + HYPRE_Int trn_ghost[2 * HYPRE_MAXDIM]; /* Ghost layers for transpose */ + + /* Information needed to Restore() after Resize() */ + HYPRE_Complex *save_data; + hypre_BoxArray *save_data_space; + HYPRE_Int save_data_size; + +#if defined(HYPRE_MIXED_PRECISION) + HYPRE_Precision matrix_precision; +#endif } hypre_StructMatrix; @@ -62,43 +108,68 @@ typedef struct hypre_StructMatrix_struct * Accessor macros: hypre_StructMatrix *--------------------------------------------------------------------------*/ + #define hypre_StructMatrixComm(matrix) ((matrix) -> comm) #define hypre_StructMatrixGrid(matrix) ((matrix) -> grid) +#define hypre_StructMatrixRanNBoxes(matrix) ((matrix) -> ran_nboxes) +#define hypre_StructMatrixRanBoxnums(matrix) ((matrix) -> ran_boxnums) +#define hypre_StructMatrixRanBoxnum(matrix, i) ((matrix) -> ran_boxnums[i]) +#define hypre_StructMatrixRanStride(matrix) ((matrix) -> ran_stride) +#define hypre_StructMatrixDomNBoxes(matrix) ((matrix) -> dom_nboxes) +#define hypre_StructMatrixDomBoxnums(matrix) ((matrix) -> dom_boxnums) +#define hypre_StructMatrixDomBoxnum(matrix, i) ((matrix) -> dom_boxnums[i]) +#define hypre_StructMatrixDomStride(matrix) ((matrix) -> dom_stride) #define hypre_StructMatrixUserStencil(matrix) ((matrix) -> user_stencil) #define hypre_StructMatrixStencil(matrix) ((matrix) -> stencil) -#define hypre_StructMatrixNumValues(matrix) ((matrix) -> num_values) -#define hypre_StructMatrixDataSpace(matrix) ((matrix) -> data_space) +#define hypre_StructMatrixConstant(matrix) ((matrix) -> constant) +#define hypre_StructMatrixConstEntry(matrix, s) ((matrix) -> constant[s]) #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) +#define hypre_StructMatrixDataSpace(matrix) ((matrix) -> data_space) +#define hypre_StructMatrixDataBoxes(matrix) ((matrix) -> data_boxes) +#define hypre_StructMatrixDataIndices(matrix) ((matrix) -> data_indices) #define hypre_StructMatrixDataAlloced(matrix) ((matrix) -> data_alloced) #define hypre_StructMatrixDataSize(matrix) ((matrix) -> data_size) -#define hypre_StructMatrixDataConstSize(matrix) ((matrix) -> data_const_size) -#define hypre_StructMatrixDataIndices(matrix) ((matrix) -> data_indices) +#define hypre_StructMatrixGlobalSize(matrix) ((matrix) -> global_size) +#define hypre_StructMatrixConstIndices(matrix) ((matrix) -> const_indices) +#define hypre_StructMatrixVDataOffset(matrix) ((matrix) -> vdata_offset) +#define hypre_StructMatrixNumValues(matrix) ((matrix) -> num_values) +#define hypre_StructMatrixNumCValues(matrix) ((matrix) -> num_cvalues) +#define hypre_StructMatrixRangeIsCoarse(matrix) ((matrix) -> range_is_coarse) +#define hypre_StructMatrixDomainIsCoarse(matrix) ((matrix) -> domain_is_coarse) #define hypre_StructMatrixConstantCoefficient(matrix) ((matrix) -> constant_coefficient) #define hypre_StructMatrixSymmetric(matrix) ((matrix) -> symmetric) -#define hypre_StructMatrixSymmElements(matrix) ((matrix) -> symm_elements) -#define hypre_StructMatrixNumGhost(matrix) ((matrix) -> num_ghost) -#define hypre_StructMatrixGlobalSize(matrix) ((matrix) -> global_size) +#define hypre_StructMatrixSymmEntries(matrix) ((matrix) -> symm_entries) +#define hypre_StructMatrixTranspose(matrix) ((matrix) -> transpose) #define hypre_StructMatrixCommPkg(matrix) ((matrix) -> comm_pkg) #define hypre_StructMatrixRefCount(matrix) ((matrix) -> ref_count) +#define hypre_StructMatrixNumGhost(matrix) ((matrix) -> num_ghost) +#define hypre_StructMatrixSymGhost(matrix) ((matrix) -> sym_ghost) +#define hypre_StructMatrixTrnGhost(matrix) ((matrix) -> trn_ghost) +#define hypre_StructMatrixSaveData(matrix) ((matrix) -> save_data) +#define hypre_StructMatrixSaveDataSpace(matrix) ((matrix) -> save_data_space) +#define hypre_StructMatrixSaveDataSize(matrix) ((matrix) -> save_data_size) + +#define hypre_StructMatrixBoxIDs(matrix) \ +hypre_BoxArrayIDs(hypre_StructMatrixDataSpace(matrix)) #define hypre_StructMatrixNDim(matrix) \ hypre_StructGridNDim(hypre_StructMatrixGrid(matrix)) -#define hypre_StructMatrixBox(matrix, b) \ -hypre_BoxArrayBox(hypre_StructMatrixDataSpace(matrix), b) +#define hypre_StructMatrixVData(matrix) \ +(hypre_StructMatrixData(matrix) + hypre_StructMatrixVDataOffset(matrix)) #define hypre_StructMatrixBoxData(matrix, b, s) \ -(hypre_StructMatrixStencilData(matrix)[s] + hypre_StructMatrixDataIndices(matrix)[b][s]) +(hypre_StructMatrixData(matrix) + hypre_StructMatrixDataIndices(matrix)[b][s]) + +#define hypre_StructMatrixBoxDataValue(matrix, b, s, data_box, index) \ +(hypre_StructMatrixBoxData(matrix, b, s) + hypre_BoxIndexRank(data_box, index)) -#define hypre_StructMatrixBoxDataValue(matrix, b, s, index) \ -(hypre_StructMatrixBoxData(matrix, b, s) + \ - hypre_BoxIndexRank(hypre_StructMatrixBox(matrix, b), index)) +#define hypre_StructMatrixConstData(matrix, s) \ +(hypre_StructMatrixData(matrix) + hypre_StructMatrixConstIndices(matrix)[s]) -#define hypre_CCStructMatrixBoxDataValue(matrix, b, s, index) \ -(hypre_StructMatrixBoxData(matrix, b, s) + \ - hypre_CCBoxIndexRank(hypre_StructMatrixBox(matrix, b), index)) +#if defined(HYPRE_MIXED_PRECISION) +#define hypre_StructMatrixPrecision(matrix) ((matrix) -> matrix_precision) +#endif #endif diff --git a/src/struct_mv/struct_matrix_mask.c b/src/struct_mv/struct_matrix_mask.c index fda897558e..59617c02ef 100644 --- a/src/struct_mv/struct_matrix_mask.c +++ b/src/struct_mv/struct_matrix_mask.c @@ -14,7 +14,6 @@ #include "_hypre_struct_mv.h" /*-------------------------------------------------------------------------- - * hypre_StructMatrixCreateMask * This routine returns the matrix, `mask', containing pointers to * some of the data in the input matrix `matrix'. This can be useful, * for example, to construct "splittings" of a matrix for use in @@ -40,10 +39,8 @@ hypre_StructMatrixCreateMask( hypre_StructMatrix *matrix, hypre_StructStencil *stencil; hypre_Index *stencil_shape; HYPRE_Int stencil_size; - HYPRE_Complex **stencil_data; hypre_Index *mask_stencil_shape; HYPRE_Int mask_stencil_size; - HYPRE_Complex **mask_stencil_data; hypre_BoxArray *data_space; HYPRE_Int **data_indices; @@ -54,7 +51,6 @@ hypre_StructMatrixCreateMask( hypre_StructMatrix *matrix, stencil = hypre_StructMatrixStencil(matrix); stencil_shape = hypre_StructStencilShape(stencil); stencil_size = hypre_StructStencilSize(stencil); - stencil_data = hypre_StructMatrixStencilData(matrix); mask = hypre_CTAlloc(hypre_StructMatrix, 1, HYPRE_MEMORY_HOST); @@ -80,67 +76,48 @@ hypre_StructMatrixCreateMask( hypre_StructMatrix *matrix, hypre_StructMatrixNumValues(mask) = hypre_StructMatrixNumValues(matrix); - hypre_StructMatrixDataSpace(mask) = - hypre_BoxArrayDuplicate(hypre_StructMatrixDataSpace(matrix)); + hypre_StructMatrixDataSpace(mask) = hypre_BoxArrayClone(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); data_space = hypre_StructMatrixDataSpace(matrix); data_indices = hypre_StructMatrixDataIndices(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 = hypre_CTAlloc(HYPRE_Int *, 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] = hypre_TAlloc(HYPRE_Int, num_stencil_indices, HYPRE_MEMORY_HOST); for (j = 0; j < num_stencil_indices; j++) { mask_data_indices[i][j] = data_indices[i][stencil_indices[j]]; } } - for (i = 0; i < mask_stencil_size; i++) - { - mask_stencil_data[i] = stencil_data[stencil_indices[i]]; - } - hypre_StructMatrixStencilData(mask) = mask_stencil_data; - hypre_StructMatrixDataIndices(mask) = mask_data_indices; hypre_StructMatrixSymmetric(mask) = hypre_StructMatrixSymmetric(matrix); - hypre_StructMatrixSymmElements(mask) = hypre_TAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); + hypre_StructMatrixSymmEntries(mask) = hypre_TAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); for (i = 0; i < stencil_size; i++) { - hypre_StructMatrixSymmElements(mask)[i] = - hypre_StructMatrixSymmElements(matrix)[i]; + hypre_StructMatrixSymmEntries(mask)[i] = + hypre_StructMatrixSymmEntries(matrix)[i]; } for (i = 0; i < 2 * ndim; i++) { hypre_StructMatrixNumGhost(mask)[i] = hypre_StructMatrixNumGhost(matrix)[i]; + hypre_StructMatrixSymGhost(mask)[i] = + hypre_StructMatrixSymGhost(matrix)[i]; } hypre_StructMatrixGlobalSize(mask) = hypre_StructGridGlobalSize(hypre_StructMatrixGrid(mask)) * mask_stencil_size; - hypre_StructMatrixCommPkg(mask) = NULL; - hypre_StructMatrixRefCount(mask) = 1; return mask; } - diff --git a/src/struct_mv/struct_matvec.c b/src/struct_mv/struct_matvec.c index 7fd38a043d..a30a4f9150 100644 --- a/src/struct_mv/struct_matvec.c +++ b/src/struct_mv/struct_matvec.c @@ -14,26 +14,24 @@ #include "_hypre_struct_mv.h" #include "_hypre_struct_mv.hpp" -/* this currently cannot be greater than 7 */ -#ifdef MAX_DEPTH -#undef MAX_DEPTH -#endif -#define MAX_DEPTH 7 - /*-------------------------------------------------------------------------- - * hypre_StructMatvecData data structure + * Matvec data structure *--------------------------------------------------------------------------*/ typedef struct { hypre_StructMatrix *A; - hypre_StructVector *x; + hypre_Index xfstride; hypre_ComputePkg *compute_pkg; + hypre_BoxArray *data_space; + HYPRE_Int transpose; + + HYPRE_Int nentries; + HYPRE_Int *stentries; } hypre_StructMatvecData; /*-------------------------------------------------------------------------- - * hypre_StructMatvecCreate *--------------------------------------------------------------------------*/ void * @@ -41,244 +39,165 @@ hypre_StructMatvecCreate( void ) { hypre_StructMatvecData *matvec_data; - matvec_data = hypre_CTAlloc(hypre_StructMatvecData, 1, HYPRE_MEMORY_HOST); + matvec_data = hypre_CTAlloc(hypre_StructMatvecData, 1, HYPRE_MEMORY_HOST); + matvec_data -> stentries = NULL; return (void *) matvec_data; } /*-------------------------------------------------------------------------- - * hypre_StructMatvecSetup *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_StructMatvecSetup( void *matvec_vdata, - hypre_StructMatrix *A, - hypre_StructVector *x ) +hypre_StructMatvecDestroy( void *matvec_vdata ) { - hypre_StructMatvecData *matvec_data = (hypre_StructMatvecData *)matvec_vdata; - - hypre_StructGrid *grid; - hypre_StructStencil *stencil; - hypre_ComputeInfo *compute_info; - hypre_ComputePkg *compute_pkg; - - HYPRE_ANNOTATE_FUNC_BEGIN; - - /*---------------------------------------------------------- - * Set up the compute package - *----------------------------------------------------------*/ + hypre_StructMatvecData *matvec_data = (hypre_StructMatvecData *)matvec_vdata; - grid = hypre_StructMatrixGrid(A); - stencil = hypre_StructMatrixStencil(A); + if (matvec_data) + { + hypre_StructMatrixDestroy(matvec_data -> A); + hypre_ComputePkgDestroy(matvec_data -> compute_pkg); + hypre_BoxArrayDestroy(matvec_data -> data_space); + hypre_TFree(matvec_data -> stentries, HYPRE_MEMORY_HOST); + hypre_TFree(matvec_data, HYPRE_MEMORY_HOST); + } - hypre_CreateComputeInfo(grid, stencil, &compute_info); - hypre_ComputePkgCreate(compute_info, hypre_StructVectorDataSpace(x), 1, - grid, &compute_pkg); + return hypre_error_flag; +} - /*---------------------------------------------------------- - * Set up the matvec data structure - *----------------------------------------------------------*/ +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ - (matvec_data -> A) = hypre_StructMatrixRef(A); - (matvec_data -> x) = hypre_StructVectorRef(x); - (matvec_data -> compute_pkg) = compute_pkg; +HYPRE_Int +hypre_StructMatvecSetTranspose( void *matvec_vdata, + HYPRE_Int transpose ) +{ + hypre_StructMatvecData *matvec_data = (hypre_StructMatvecData *)matvec_vdata; - HYPRE_ANNOTATE_FUNC_END; + (matvec_data -> transpose) = transpose; return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_StructMatvecCompute + * If needed, resize x and set up the compute package. Assume that the same + * matrix is passed into setup and compute, but the vector x may change. *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_StructMatvecCompute( void *matvec_vdata, - HYPRE_Complex alpha, - hypre_StructMatrix *A, - hypre_StructVector *x, - HYPRE_Complex beta, - hypre_StructVector *y ) +hypre_StructMatvecResize( hypre_StructMatvecData *matvec_data, + hypre_StructVector *x ) { - hypre_StructMatvecData *matvec_data = (hypre_StructMatvecData *)matvec_vdata; + hypre_StructMatrix *A = (matvec_data -> A); + hypre_IndexRef xfstride = (matvec_data -> xfstride); + HYPRE_Int ndim = hypre_StructMatrixNDim(A); + HYPRE_MemoryLocation memloc = hypre_StructVectorMemoryLocation(x); + hypre_StructGrid *grid, *xgrid; + hypre_StructStencil *stencil; + hypre_ComputeInfo *compute_info; hypre_ComputePkg *compute_pkg; - - hypre_CommHandle *comm_handle; - - hypre_BoxArrayArray *compute_box_aa; - hypre_Box *y_data_box; - - HYPRE_Complex *xp; - HYPRE_Complex *yp; - - hypre_BoxArray *boxes; - hypre_Box *box; - hypre_Index loop_size; - hypre_IndexRef start; - hypre_IndexRef stride; - - HYPRE_Int constant_coefficient; - - HYPRE_Complex temp; - HYPRE_Int compute_i, i; - - hypre_StructVector *x_tmp = NULL; - - /*----------------------------------------------------------------------- - * Initialize some things - *-----------------------------------------------------------------------*/ + hypre_BoxArray *data_space; + HYPRE_Int *num_ghost; + hypre_IndexRef dom_stride, xstride, fstride; + HYPRE_Int d, need_resize, need_computepkg; HYPRE_ANNOTATE_FUNC_BEGIN; - constant_coefficient = hypre_StructMatrixConstantCoefficient(A); - if (constant_coefficient) { hypre_StructVectorClearBoundGhostValues(x, 0); } - - compute_pkg = (matvec_data -> compute_pkg); - - stride = hypre_ComputePkgStride(compute_pkg); - - /*----------------------------------------------------------------------- - * Do (alpha == 0.0) computation - *-----------------------------------------------------------------------*/ - - if (alpha == 0.0) + /* Ensure that the base grid for x is at least as fine as the one for A */ + grid = hypre_StructMatrixGrid(A); + if (matvec_data -> transpose) { - boxes = hypre_StructGridBoxes(hypre_StructMatrixGrid(A)); - hypre_ForBoxI(i, boxes) - { - box = hypre_BoxArrayBox(boxes, i); - start = hypre_BoxIMin(box); - - y_data_box = hypre_BoxArrayBox(hypre_StructVectorDataSpace(y), i); - yp = hypre_StructVectorBoxData(y, i); + dom_stride = hypre_StructMatrixRanStride(A); + } + else + { + dom_stride = hypre_StructMatrixDomStride(A); + } + hypre_StructVectorRebase(x, grid, dom_stride); + + /* Rebase may not change the base grid, so get the grid directly from x */ + xgrid = hypre_StructVectorGrid(x); + xstride = hypre_StructVectorStride(x); + + /* Matrix stencil offsets are on the index space of the finest grid */ + hypre_StructMatrixGetFStride(A, &fstride); + + /* Need to compute xfstride such that (xgrid, xfstride) has the same index + * space as (grid, fstride) where the stencil is applied. Can do this by + * using the fact that (xgrid, xstride) and (grid, dom_stride) have the same + * index spaces, and hence xfstride/fstride = xstride/dom_stride. Note that + * if A and x end up having the same base grids, then xstride = dom_stride + * and xfstride = fstride. */ + for (d = 0; d < ndim; d++) + { + xfstride[d] = fstride[d] * xstride[d] / dom_stride[d]; + } - hypre_BoxGetSize(box, loop_size); + /* Compute the minimal data_space needed to resize x */ + stencil = hypre_StructMatrixStencil(A); + hypre_StructNumGhostFromStencil(stencil, &num_ghost); + hypre_StructVectorComputeDataSpace(x, xfstride, num_ghost, &data_space); + hypre_TFree(num_ghost, HYPRE_MEMORY_HOST); -#define DEVICE_VAR is_device_ptr(yp) - hypre_BoxLoop1Begin(hypre_StructVectorNDim(x), loop_size, - y_data_box, start, stride, yi); - { - yp[yi] *= beta; - } - hypre_BoxLoop1End(yi); -#undef DEVICE_VAR - } + /* Determine if a resize is needed */ + need_resize = hypre_StructVectorNeedResize(x, data_space); - return hypre_error_flag; + /* Determine if a compute package needs to be created */ + need_computepkg = 0; + if ((matvec_data -> compute_pkg) == NULL) + { + /* compute package hasn't been created yet */ + need_computepkg = 1; } - - if (x == y) + else if (need_resize) { - x_tmp = hypre_StructVectorClone(y); - x = x_tmp; + /* a resize was needed */ + need_computepkg = 1; } - /*----------------------------------------------------------------------- - * Do (alpha != 0.0) computation - *-----------------------------------------------------------------------*/ - - for (compute_i = 0; compute_i < 2; compute_i++) + else if (!hypre_BoxArraysEqual(data_space, (matvec_data -> data_space))) { - switch (compute_i) - { - case 0: - { - xp = hypre_StructVectorData(x); - hypre_InitializeIndtComputations(compute_pkg, xp, &comm_handle); - compute_box_aa = hypre_ComputePkgIndtBoxes(compute_pkg); + /* the data space has changed */ + need_computepkg = 1; + } - /*-------------------------------------------------------------- - * initialize y= (beta/alpha)*y normally (where everything - * is multiplied by alpha at the end), - * beta*y for constant coefficient (where only Ax gets multiplied by alpha) - *--------------------------------------------------------------*/ + /* Resize if needed */ + if (need_resize) + { + hypre_StructVectorResize(x, data_space); + } + else + { + hypre_BoxArrayDestroy(data_space); + hypre_StructVectorRestore(x); + } - if ( constant_coefficient == 1 ) - { - temp = beta; - } - else - { - temp = beta / alpha; - } - if (temp != 1.0) - { - boxes = hypre_StructGridBoxes(hypre_StructMatrixGrid(A)); - hypre_ForBoxI(i, boxes) - { - box = hypre_BoxArrayBox(boxes, i); - start = hypre_BoxIMin(box); + /* Create a compute package if needed */ + if (need_computepkg) + { + /* Note: It's important to use the data_space in x in case there is no resize */ + data_space = hypre_StructVectorDataSpace(x); - y_data_box = - hypre_BoxArrayBox(hypre_StructVectorDataSpace(y), i); - yp = hypre_StructVectorBoxData(y, i); + /* This computes the communication pattern for the new x data_space */ + hypre_CreateComputeInfo(xgrid, xfstride, stencil, &compute_info); -#define DEVICE_VAR is_device_ptr(yp) - if (temp == 0.0) - { - hypre_BoxGetSize(box, loop_size); - - hypre_BoxLoop1Begin(hypre_StructVectorNDim(x), loop_size, - y_data_box, start, stride, yi); - { - yp[yi] = 0.0; - } - hypre_BoxLoop1End(yi); - } - else - { - hypre_BoxGetSize(box, loop_size); - - hypre_BoxLoop1Begin(hypre_StructVectorNDim(x), loop_size, - y_data_box, start, stride, yi); - { - yp[yi] *= temp; - } - hypre_BoxLoop1End(yi); - } -#undef DEVICE_VAR - } - } - } - break; + /* First refine commm_info to put it on the index space of xgrid, then map */ + /* NOTE: Compute boxes will be appropriately projected in MatvecCompute */ + hypre_CommInfoRefine(hypre_ComputeInfoCommInfo(compute_info), NULL, xfstride); + hypre_StructVectorMapCommInfo(x, hypre_ComputeInfoCommInfo(compute_info)); + hypre_ComputePkgCreate(memloc, compute_info, data_space, 1, grid, &compute_pkg); - case 1: - { - hypre_FinalizeIndtComputations(comm_handle); - compute_box_aa = hypre_ComputePkgDeptBoxes(compute_pkg); - } - break; + /* Save compute_pkg */ + if ((matvec_data -> compute_pkg) != NULL) + { + hypre_ComputePkgDestroy(matvec_data -> compute_pkg); } - - /*-------------------------------------------------------------------- - * y += A*x - *--------------------------------------------------------------------*/ - - switch ( constant_coefficient ) + if ((matvec_data -> data_space) != NULL) { - case 0: - { - hypre_StructMatvecCC0( alpha, A, x, y, compute_box_aa, stride ); - break; - } - case 1: - { - hypre_StructMatvecCC1( alpha, A, x, y, compute_box_aa, stride ); - break; - } - case 2: - { - hypre_StructMatvecCC2( alpha, A, x, y, compute_box_aa, stride ); - break; - } + hypre_BoxArrayDestroy(matvec_data -> data_space); } - - } - - if (x_tmp) - { - hypre_StructVectorDestroy(x_tmp); - x = y; + (matvec_data -> compute_pkg) = compute_pkg; + (matvec_data -> data_space) = hypre_BoxArrayClone(data_space); } HYPRE_ANNOTATE_FUNC_END; @@ -287,1136 +206,392 @@ hypre_StructMatvecCompute( void *matvec_vdata, } /*-------------------------------------------------------------------------- - * hypre_StructMatvecCC0 - * core of struct matvec computation, for the case constant_coefficient==0 - * (all coefficients are variable) *--------------------------------------------------------------------------*/ -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_StructMatvecSetup( void *matvec_vdata, + hypre_StructMatrix *A, + hypre_StructVector *x ) { - HYPRE_Int i, j, si; - HYPRE_Complex *Ap0; - HYPRE_Complex *Ap1; - HYPRE_Complex *Ap2; - HYPRE_Complex *Ap3; - HYPRE_Complex *Ap4; - HYPRE_Complex *Ap5; - HYPRE_Complex *Ap6; - HYPRE_Int xoff0; - HYPRE_Int xoff1; - HYPRE_Int xoff2; - HYPRE_Int xoff3; - HYPRE_Int xoff4; - HYPRE_Int xoff5; - HYPRE_Int xoff6; - hypre_BoxArray *compute_box_a; - hypre_Box *compute_box; + hypre_StructMatvecData *matvec_data = (hypre_StructMatvecData *)matvec_vdata; - hypre_Box *A_data_box; - hypre_Box *x_data_box; hypre_StructStencil *stencil; - hypre_Index *stencil_shape; + HYPRE_Int stencil_diag; HYPRE_Int stencil_size; + HYPRE_Int i; - hypre_Box *y_data_box; - HYPRE_Complex *xp; - HYPRE_Complex *yp; - HYPRE_Int depth; - hypre_Index loop_size; - hypre_IndexRef start; - HYPRE_Int ndim; + HYPRE_ANNOTATE_FUNC_BEGIN; - stencil = hypre_StructMatrixStencil(A); - stencil_shape = hypre_StructStencilShape(stencil); - stencil_size = hypre_StructStencilSize(stencil); - ndim = hypre_StructVectorNDim(x); + /* This is needed in MatvecResize() */ + (matvec_data -> A) = hypre_StructMatrixRef(A); - hypre_ForBoxArrayI(i, compute_box_aa) + /* Make sure that the transpose coefficients are stored in A (note that the + * resizing will provide no option to restore A to its previous state) */ + if (matvec_data -> transpose) { - compute_box_a = hypre_BoxArrayArrayBoxArray(compute_box_aa, i); - - A_data_box = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A), i); - x_data_box = hypre_BoxArrayBox(hypre_StructVectorDataSpace(x), i); - y_data_box = hypre_BoxArrayBox(hypre_StructVectorDataSpace(y), i); + HYPRE_Int resize; - xp = hypre_StructVectorBoxData(x, i); - yp = hypre_StructVectorBoxData(y, i); - - hypre_ForBoxI(j, compute_box_a) + hypre_StructMatrixSetTranspose(A, 1, &resize); + /* RDF: The following probably should go inside the MatrixSetTranspose + * routine to ensure it always gets done */ + if ( (resize) && (hypre_StructMatrixDataSpace(A) != NULL) ) { - compute_box = hypre_BoxArrayBox(compute_box_a, j); - - hypre_BoxGetSize(compute_box, loop_size); - start = hypre_BoxIMin(compute_box); - - /* unroll up to depth MAX_DEPTH */ - for (si = 0; si < stencil_size; si += MAX_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); - - xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 0]); - xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 1]); - xoff2 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 2]); - xoff3 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 3]); - xoff4 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 4]); - xoff5 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 5]); - xoff6 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 6]); - -#define DEVICE_VAR is_device_ptr(yp,Ap0,Ap1,Ap2,Ap3,Ap4,Ap5,Ap6,xp) - hypre_BoxLoop3Begin(ndim, loop_size, - A_data_box, start, stride, Ai, - x_data_box, start, stride, xi, - y_data_box, start, stride, yi); - { - yp[yi] += - Ap0[Ai] * xp[xi + xoff0] + - Ap1[Ai] * xp[xi + xoff1] + - Ap2[Ai] * xp[xi + xoff2] + - Ap3[Ai] * xp[xi + xoff3] + - Ap4[Ai] * xp[xi + xoff4] + - Ap5[Ai] * xp[xi + xoff5] + - Ap6[Ai] * xp[xi + xoff6]; - } - hypre_BoxLoop3End(Ai, xi, yi); -#undef DEVICE_VAR - - 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); - - xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 0]); - xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 1]); - xoff2 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 2]); - xoff3 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 3]); - xoff4 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 4]); - xoff5 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 5]); - -#define DEVICE_VAR is_device_ptr(yp,Ap0,Ap1,Ap2,Ap3,Ap4,Ap5,xp) - hypre_BoxLoop3Begin(ndim, loop_size, - A_data_box, start, stride, Ai, - x_data_box, start, stride, xi, - y_data_box, start, stride, yi); - { - yp[yi] += - Ap0[Ai] * xp[xi + xoff0] + - Ap1[Ai] * xp[xi + xoff1] + - Ap2[Ai] * xp[xi + xoff2] + - Ap3[Ai] * xp[xi + xoff3] + - Ap4[Ai] * xp[xi + xoff4] + - Ap5[Ai] * xp[xi + xoff5]; - } - hypre_BoxLoop3End(Ai, xi, yi); -#undef DEVICE_VAR - - 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); - - xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 0]); - xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 1]); - xoff2 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 2]); - xoff3 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 3]); - xoff4 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 4]); - -#define DEVICE_VAR is_device_ptr(yp,Ap0,Ap1,Ap2,Ap3,Ap4,xp) - hypre_BoxLoop3Begin(ndim, loop_size, - A_data_box, start, stride, Ai, - x_data_box, start, stride, xi, - y_data_box, start, stride, yi); - { - yp[yi] += - Ap0[Ai] * xp[xi + xoff0] + - Ap1[Ai] * xp[xi + xoff1] + - Ap2[Ai] * xp[xi + xoff2] + - Ap3[Ai] * xp[xi + xoff3] + - Ap4[Ai] * xp[xi + xoff4]; - } - hypre_BoxLoop3End(Ai, xi, yi); -#undef DEVICE_VAR - - 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); - - xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 0]); - xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 1]); - xoff2 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 2]); - xoff3 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 3]); - -#define DEVICE_VAR is_device_ptr(yp,Ap0,Ap1,Ap2,Ap3,xp) - hypre_BoxLoop3Begin(ndim, loop_size, - A_data_box, start, stride, Ai, - x_data_box, start, stride, xi, - y_data_box, start, stride, yi); - { - yp[yi] += - Ap0[Ai] * xp[xi + xoff0] + - Ap1[Ai] * xp[xi + xoff1] + - Ap2[Ai] * xp[xi + xoff2] + - Ap3[Ai] * xp[xi + xoff3]; - } - hypre_BoxLoop3End(Ai, xi, yi); -#undef DEVICE_VAR - - break; - - case 3: - 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]); - xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 1]); - xoff2 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 2]); - -#define DEVICE_VAR is_device_ptr(yp,Ap0,Ap1,Ap2,xp) - hypre_BoxLoop3Begin(ndim, loop_size, - A_data_box, start, stride, Ai, - x_data_box, start, stride, xi, - y_data_box, start, stride, yi); - { - yp[yi] += - Ap0[Ai] * xp[xi + xoff0] + - Ap1[Ai] * xp[xi + xoff1] + - Ap2[Ai] * xp[xi + xoff2]; - } - hypre_BoxLoop3End(Ai, xi, yi); -#undef DEVICE_VAR - - break; - - case 2: - Ap0 = hypre_StructMatrixBoxData(A, i, si + 0); - Ap1 = hypre_StructMatrixBoxData(A, i, si + 1); + hypre_BoxArray *data_space; - xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 0]); - xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 1]); - -#define DEVICE_VAR is_device_ptr(yp,Ap0,Ap1,xp) - hypre_BoxLoop3Begin(ndim, loop_size, - A_data_box, start, stride, Ai, - x_data_box, start, stride, xi, - y_data_box, start, stride, yi); - { - yp[yi] += - Ap0[Ai] * xp[xi + xoff0] + - Ap1[Ai] * xp[xi + xoff1]; - } - hypre_BoxLoop3End(Ai, xi, yi); -#undef DEVICE_VAR + hypre_StructMatrixComputeDataSpace(A, NULL, &data_space); + hypre_StructMatrixResize(A, data_space); + hypre_StructMatrixForget(A); /* No restore allowed (saves memory) */ + hypre_StructMatrixAssemble(A); + } + } - break; + /* Set active stencil entries if it hasn't been done yet */ + stencil = hypre_StructMatrixStencil(A); + stencil_size = hypre_StructStencilSize(stencil); + stencil_diag = hypre_StructStencilDiagEntry(stencil); + (matvec_data -> stentries) = hypre_TAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); + for (i = 0; i < stencil_size; i++) + { + (matvec_data -> stentries[i]) = i; + } - case 1: - Ap0 = hypre_StructMatrixBoxData(A, i, si + 0); + /* Move diagonal entry to first position */ + (matvec_data -> stentries[stencil_diag]) = (matvec_data -> stentries[0]); + (matvec_data -> stentries[0]) = stencil_diag; - xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 0]); + /* Set number of stencil entries used in StructMatvecCompute */ + (matvec_data -> nentries) = stencil_size; -#define DEVICE_VAR is_device_ptr(yp,Ap0,xp) - hypre_BoxLoop3Begin(ndim, loop_size, - A_data_box, start, stride, Ai, - x_data_box, start, stride, xi, - y_data_box, start, stride, yi); - { - yp[yi] += - Ap0[Ai] * xp[xi + xoff0]; - } - hypre_BoxLoop3End(Ai, xi, yi); -#undef DEVICE_VAR + /* If needed, resize and set up the compute package */ + hypre_StructMatvecResize(matvec_data, x); - break; - } - } + /* Restore the original grid and data layout (depending on VectorMemoryMode) */ + hypre_StructVectorRestore(x); - if (alpha != 1.0) - { -#define DEVICE_VAR is_device_ptr(yp) - hypre_BoxLoop1Begin(ndim, loop_size, - y_data_box, start, stride, yi); - { - yp[yi] *= alpha; - } - hypre_BoxLoop1End(yi); -#undef DEVICE_VAR - } - } - } + HYPRE_ANNOTATE_FUNC_END; return hypre_error_flag; } - /*-------------------------------------------------------------------------- - * hypre_StructMatvecCC1 - * core of struct matvec computation, for the case constant_coefficient==1 + * The grids for A, x, and y must be compatible with respect to matrix-vector + * multiply, but the initial grid boxes and strides may differ. The routines + * Rebase() and Resize() are called to convert the grid for the vector x to + * match the domain grid of the matrix A. As a result, both A and x have the + * same list of underlying boxes and the domain stride for A is the same as the + * stride for x. The grid for y is assumed to match the range grid for A, but + * with potentially different boxes and strides. The number of boxes and the + * corresponding box ids must match, however, so it is not necessary to search. + * Here are some examples (after Rebase() and Resize() have been called for x): + * + * RangeIsCoarse: DomainIsCoarse: + * Adstride = 1 Adstride = 1 + * xdstride = 3 xdstride = 1 + * ydstride = 1 ydstride = 3 + * + * 1 6 2 2 5 2 6 6 <-- domain/range strides + * | | | | | | | | | | | | + * |y| = | A | | | | | | | |x| + * | | | | |x| |y| = | A | | | + * | | | | | | + * | | | | | | + * | | | | | | + * + * It is assumed here that the data space for y corresponds to a coarsening of + * the base index space for A with range stride. So, we are circumventing the + * "MapData" routines in the matrix and vector classes to avoid making too many + * function calls. We could achieve the same goal by calling MapToCoarse(), + * MapToFine(), and MapData() in sequence to move base index values first to the + * range grid for A, then to the base index space and data space for y. + * + * RDF TODO: Consider modifications to the current DataMap interfaces to avoid + * making assumptions like the above. Look at the Matmult routine as well. *--------------------------------------------------------------------------*/ -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_StructMatvecCompute( void *matvec_vdata, + HYPRE_Complex alpha, + hypre_StructMatrix *A, + hypre_StructVector *x, + HYPRE_Complex beta, + hypre_StructVector *y, + hypre_StructVector *z ) { - HYPRE_Int i, j, si; - HYPRE_Complex *Ap0; - HYPRE_Complex *Ap1; - HYPRE_Complex *Ap2; - HYPRE_Complex *Ap3; - HYPRE_Complex *Ap4; - HYPRE_Complex *Ap5; - HYPRE_Complex *Ap6; - HYPRE_Complex AAp0; - HYPRE_Complex AAp1; - HYPRE_Complex AAp2; - HYPRE_Complex AAp3; - HYPRE_Complex AAp4; - HYPRE_Complex AAp5; - HYPRE_Complex AAp6; - HYPRE_Int xoff0; - HYPRE_Int xoff1; - HYPRE_Int xoff2; - HYPRE_Int xoff3; - HYPRE_Int xoff4; - HYPRE_Int xoff5; - HYPRE_Int xoff6; - HYPRE_Int Ai; + hypre_StructMatvecData *matvec_data = (hypre_StructMatvecData *)matvec_vdata; + + hypre_IndexRef xfstride = (matvec_data -> xfstride); + HYPRE_Int transpose = (matvec_data -> transpose); + HYPRE_Int nentries = (matvec_data -> nentries); + HYPRE_Int *stentries = (matvec_data -> stentries); + HYPRE_Int ndim = hypre_StructMatrixNDim(A); + + hypre_CommHandle *comm_handle; + hypre_ComputePkg *compute_pkg; + hypre_BoxArrayArray *compute_box_aa; hypre_BoxArray *compute_box_a; hypre_Box *compute_box; - hypre_Box *x_data_box; - hypre_StructStencil *stencil; - hypre_Index *stencil_shape; - HYPRE_Int stencil_size; - - hypre_Box *y_data_box; - HYPRE_Complex *xp; - HYPRE_Complex *yp; - HYPRE_Int depth; - hypre_Index loop_size; + hypre_Index loop_size, origin, stride; hypre_IndexRef start; - HYPRE_Int ndim; - stencil = hypre_StructMatrixStencil(A); - stencil_shape = hypre_StructStencilShape(stencil); - stencil_size = hypre_StructStencilSize(stencil); - ndim = hypre_StructVectorNDim(x); + HYPRE_Int compute_i, i, j, si, se; + HYPRE_Int cnentries, vnentries; + HYPRE_Int centries[HYPRE_MAX_MMTERMS], ventries[HYPRE_MAX_MMTERMS]; - hypre_ForBoxArrayI(i, compute_box_aa) - { - compute_box_a = hypre_BoxArrayArrayBoxArray(compute_box_aa, i); - - x_data_box = hypre_BoxArrayBox(hypre_StructVectorDataSpace(x), i); - y_data_box = hypre_BoxArrayBox(hypre_StructVectorDataSpace(y), i); + hypre_Box *A_data_box, *x_data_box, *y_data_box, *z_data_box; + HYPRE_Complex *xp; + HYPRE_Int Ab, xb, yb, zb; + hypre_Index Adstride, xdstride, ydstride, zdstride, ustride; - xp = hypre_StructVectorBoxData(x, i); - yp = hypre_StructVectorBoxData(y, i); + HYPRE_Int ran_nboxes; + HYPRE_Int *ran_boxnums; + hypre_IndexRef ran_stride; - hypre_ForBoxI(j, compute_box_a) - { - compute_box = hypre_BoxArrayBox(compute_box_a, j); + hypre_StructVector *x_tmp = NULL; - hypre_BoxGetSize(compute_box, loop_size); - start = hypre_BoxIMin(compute_box); + /*----------------------------------------------------------------------- + * Do (alpha == 0.0) computation + *-----------------------------------------------------------------------*/ - Ai = 0; + if (alpha == 0.0) + { + hypre_StructVectorAxpy(alpha, y, beta, y, z); + return hypre_error_flag; + } - /* unroll up to depth MAX_DEPTH */ - for (si = 0; si < stencil_size; si += MAX_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; - - xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 0]); - xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 1]); - xoff2 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 2]); - xoff3 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 3]); - xoff4 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 4]); - xoff5 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 5]); - xoff6 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 6]); - -#define DEVICE_VAR is_device_ptr(yp,xp) - hypre_BoxLoop2Begin(ndim, loop_size, - x_data_box, start, stride, xi, - y_data_box, start, stride, yi); - { - yp[yi] += - AAp0 * xp[xi + xoff0] + - AAp1 * xp[xi + xoff1] + - AAp2 * xp[xi + xoff2] + - AAp3 * xp[xi + xoff3] + - AAp4 * xp[xi + xoff4] + - AAp5 * xp[xi + xoff5] + - AAp6 * xp[xi + xoff6]; - } - hypre_BoxLoop2End(xi, yi); -#undef DEVICE_VAR - 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; - - xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 0]); - xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 1]); - xoff2 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 2]); - xoff3 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 3]); - xoff4 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 4]); - xoff5 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 5]); - -#define DEVICE_VAR is_device_ptr(yp,xp) - hypre_BoxLoop2Begin(ndim, loop_size, - x_data_box, start, stride, xi, - y_data_box, start, stride, yi); - { - yp[yi] += - AAp0 * xp[xi + xoff0] + - AAp1 * xp[xi + xoff1] + - AAp2 * xp[xi + xoff2] + - AAp3 * xp[xi + xoff3] + - AAp4 * xp[xi + xoff4] + - AAp5 * xp[xi + xoff5]; - } - hypre_BoxLoop2End(xi, yi); -#undef DEVICE_VAR - 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; - - xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 0]); - xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 1]); - xoff2 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 2]); - xoff3 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 3]); - xoff4 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 4]); - -#define DEVICE_VAR is_device_ptr(yp,xp) - hypre_BoxLoop2Begin(ndim, loop_size, - x_data_box, start, stride, xi, - y_data_box, start, stride, yi); - { - yp[yi] += - AAp0 * xp[xi + xoff0] + - AAp1 * xp[xi + xoff1] + - AAp2 * xp[xi + xoff2] + - AAp3 * xp[xi + xoff3] + - AAp4 * xp[xi + xoff4]; - } - hypre_BoxLoop2End(xi, yi); -#undef DEVICE_VAR - 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; - - xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 0]); - xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 1]); - xoff2 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 2]); - xoff3 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 3]); - -#define DEVICE_VAR is_device_ptr(yp,xp) - hypre_BoxLoop2Begin(ndim, loop_size, - x_data_box, start, stride, xi, - y_data_box, start, stride, yi); - { - yp[yi] += - AAp0 * xp[xi + xoff0] + - AAp1 * xp[xi + xoff1] + - AAp2 * xp[xi + xoff2] + - AAp3 * xp[xi + xoff3]; - } - hypre_BoxLoop2End(xi, yi); -#undef DEVICE_VAR - 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; - - xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 0]); - xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 1]); - xoff2 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 2]); - -#define DEVICE_VAR is_device_ptr(yp,xp) - hypre_BoxLoop2Begin(ndim, loop_size, - x_data_box, start, stride, xi, - y_data_box, start, stride, yi); - { - yp[yi] += - AAp0 * xp[xi + xoff0] + - AAp1 * xp[xi + xoff1] + - AAp2 * xp[xi + xoff2]; - } - hypre_BoxLoop2End(xi, yi); -#undef DEVICE_VAR - 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; - - xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 0]); - xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 1]); - -#define DEVICE_VAR is_device_ptr(yp,xp) - hypre_BoxLoop2Begin(ndim, loop_size, - x_data_box, start, stride, xi, - y_data_box, start, stride, yi); - { - yp[yi] += - AAp0 * xp[xi + xoff0] + - AAp1 * xp[xi + xoff1]; - } - hypre_BoxLoop2End(xi, yi); -#undef DEVICE_VAR - break; + /*----------------------------------------------------------------------- + * Initialize some things + *-----------------------------------------------------------------------*/ - case 1: - Ap0 = hypre_StructMatrixBoxData(A, i, si + 0); - AAp0 = Ap0[Ai] * alpha; + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("Matvec"); - xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 0]); +#if 0 + /* RDF: Should not need this if the boundaries were cleared initially */ + constant_coefficient = hypre_StructMatrixConstantCoefficient(A); + if (constant_coefficient) { hypre_StructVectorClearBoundGhostValues(x, 0); } +#endif -#define DEVICE_VAR is_device_ptr(yp,xp) - hypre_BoxLoop2Begin(ndim, loop_size, - x_data_box, start, stride, xi, - y_data_box, start, stride, yi); - { - yp[yi] += - AAp0 * xp[xi + xoff0]; - } - hypre_BoxLoop2End(xi, yi); -#undef DEVICE_VAR - } - } - } + /* Switch domain and range information if doing a transpose matvec */ + if (transpose) + { + ran_stride = hypre_StructMatrixDomStride(A); + ran_nboxes = hypre_StructMatrixDomNBoxes(A); + ran_boxnums = hypre_StructMatrixDomBoxnums(A); + } + else + { + ran_stride = hypre_StructMatrixRanStride(A); + ran_nboxes = hypre_StructMatrixRanNBoxes(A); + ran_boxnums = hypre_StructMatrixRanBoxnums(A); } - return hypre_error_flag; -} + compute_box = hypre_BoxCreate(ndim); + hypre_SetIndex(ustride, 1); + if (x == y) + { + x_tmp = hypre_StructVectorClone(y); + x = x_tmp; + } -/*-------------------------------------------------------------------------- - * hypre_StructMatvecCC2 - * core of struct matvec computation, for the case constant_coefficient==2 - *--------------------------------------------------------------------------*/ + /*----------------------------------------------------------------------- + * Do (alpha != 0.0) computation + *-----------------------------------------------------------------------*/ -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 i, j, si; - HYPRE_Complex *Ap0; - HYPRE_Complex *Ap1; - HYPRE_Complex *Ap2; - HYPRE_Complex *Ap3; - HYPRE_Complex *Ap4; - HYPRE_Complex *Ap5; - HYPRE_Complex *Ap6; - HYPRE_Complex AAp0; - HYPRE_Complex AAp1; - HYPRE_Complex AAp2; - HYPRE_Complex AAp3; - HYPRE_Complex AAp4; - HYPRE_Complex AAp5; - HYPRE_Complex AAp6; - HYPRE_Int xoff0; - HYPRE_Int xoff1; - HYPRE_Int xoff2; - HYPRE_Int xoff3; - HYPRE_Int xoff4; - HYPRE_Int xoff5; - HYPRE_Int xoff6; - HYPRE_Int si_center, center_rank; - hypre_Index center_index; - HYPRE_Int Ai_CC; - hypre_BoxArray *compute_box_a; - hypre_Box *compute_box; + /* If needed, resize and set up the compute package */ + hypre_StructMatvecResize(matvec_data, x); + compute_pkg = (matvec_data -> compute_pkg); - hypre_Box *A_data_box; - hypre_Box *x_data_box; - hypre_StructStencil *stencil; - hypre_Index *stencil_shape; - HYPRE_Int stencil_size; + for (compute_i = 0; compute_i < 2; compute_i++) + { + switch (compute_i) + { + case 0: + { + xp = hypre_StructVectorData(x); + hypre_InitializeIndtComputations(compute_pkg, xp, &comm_handle); + compute_box_aa = hypre_ComputePkgIndtBoxes(compute_pkg); + } + break; - hypre_Box *y_data_box; - HYPRE_Complex *xp; - HYPRE_Complex *yp; - HYPRE_Int depth; - hypre_Index loop_size; - hypre_IndexRef start; - HYPRE_Int ndim; - HYPRE_Complex zero[1] = {0}; + case 1: + { + hypre_FinalizeIndtComputations(comm_handle); + compute_box_aa = hypre_ComputePkgDeptBoxes(compute_pkg); + } + break; + } - stencil = hypre_StructMatrixStencil(A); - stencil_shape = hypre_StructStencilShape(stencil); - stencil_size = hypre_StructStencilSize(stencil); - ndim = hypre_StructVectorNDim(x); + /*-------------------------------------------------------------------- + * z = beta * y + alpha * A*x (or A^T*x) + *--------------------------------------------------------------------*/ - hypre_ForBoxArrayI(i, compute_box_aa) - { - compute_box_a = hypre_BoxArrayArrayBoxArray(compute_box_aa, i); + hypre_StructMatrixGetStencilStride(A, stride); + hypre_CopyToIndex(stride, ndim, Adstride); + hypre_StructMatrixMapDataStride(A, Adstride); + + hypre_CopyToIndex(stride, ndim, xdstride); + hypre_MapToFineIndex(xdstride, NULL, xfstride, ndim); + hypre_StructVectorMapDataStride(x, xdstride); - A_data_box = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A), i); - x_data_box = hypre_BoxArrayBox(hypre_StructVectorDataSpace(x), i); - y_data_box = hypre_BoxArrayBox(hypre_StructVectorDataSpace(y), i); + hypre_CopyToIndex(stride, ndim, ydstride); + hypre_MapToCoarseIndex(ydstride, NULL, ran_stride, ndim); - xp = hypre_StructVectorBoxData(x, i); - yp = hypre_StructVectorBoxData(y, i); + hypre_CopyToIndex(stride, ndim, zdstride); + hypre_MapToCoarseIndex(zdstride, NULL, ran_stride, ndim); - hypre_ForBoxI(j, compute_box_a) + xb = 0; + for (i = 0; i < ran_nboxes; i++) { - compute_box = hypre_BoxArrayBox(compute_box_a, j); + HYPRE_Int *Aids = hypre_StructMatrixBoxIDs(A); + HYPRE_Int *xids = hypre_StructVectorBoxIDs(x); + HYPRE_Int num_ss; + HYPRE_Int *se_sspaces; + hypre_Index *ss_origins; + HYPRE_Int s; + + /* The corresponding box IDs for the following boxnums should match */ + Ab = ran_boxnums[i]; + + /* Rebase ensures that all box ids in A are also in x */ + while (xids[xb] != Aids[Ab]) + { + xb++; + } + yb = hypre_StructVectorBoxnum(y, i); + zb = hypre_StructVectorBoxnum(z, i); - hypre_BoxGetSize(compute_box, loop_size); - start = hypre_BoxIMin(compute_box); + compute_box_a = hypre_BoxArrayArrayBoxArray(compute_box_aa, xb); - Ai_CC = hypre_CCBoxIndexRank( A_data_box, start ); + A_data_box = hypre_BoxArrayBox(hypre_StructMatrixDataSpace(A), Ab); + x_data_box = hypre_BoxArrayBox(hypre_StructVectorDataSpace(x), xb); + y_data_box = hypre_BoxArrayBox(hypre_StructVectorDataSpace(y), yb); + z_data_box = hypre_BoxArrayBox(hypre_StructVectorDataSpace(z), zb); - /* Find the stencil index for the center of the stencil, which - makes the matrix diagonal. This is the variable coefficient - part of the matrix, so will get different treatment...*/ - hypre_SetIndex(center_index, 0); - center_rank = hypre_StructStencilElementRank( stencil, center_index ); - si_center = center_rank; + /* Get stencil spaces - then do unrolling for entries in each */ + hypre_StructMatrixGetStSpaces(A, transpose, &num_ss, &se_sspaces, &ss_origins, stride); - /* 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 (s = 0; s < num_ss; s++) { - depth = hypre_min(MAX_DEPTH, (stencil_size - si)); - switch (depth) + /* Only compute with entries in stencil space s */ + cnentries = vnentries = 0; + for (si = 0; si < nentries; si++) { - 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) ) - { - switch ( si_center - si ) - { - case 0: Ap0 = zero; break; - case 1: Ap1 = zero; break; - case 2: Ap2 = zero; break; - case 3: Ap3 = zero; break; - case 4: Ap4 = zero; break; - case 5: Ap5 = zero; break; - case 6: Ap6 = zero; break; - } - } - - AAp0 = Ap0[Ai_CC]; - AAp1 = Ap1[Ai_CC]; - AAp2 = Ap2[Ai_CC]; - AAp3 = Ap3[Ai_CC]; - AAp4 = Ap4[Ai_CC]; - AAp5 = Ap5[Ai_CC]; - AAp6 = Ap6[Ai_CC]; - - - xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 0]); - xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 0]); - xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 1]); - xoff2 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 2]); - xoff3 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 3]); - xoff4 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 4]); - xoff5 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 5]); - xoff6 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 6]); - -#define DEVICE_VAR is_device_ptr(yp,xp) - hypre_BoxLoop2Begin(ndim, loop_size, - x_data_box, start, stride, xi, - y_data_box, start, stride, yi); - { - yp[yi] += - AAp0 * xp[xi + xoff0] + - AAp1 * xp[xi + xoff1] + - AAp2 * xp[xi + xoff2] + - AAp3 * xp[xi + xoff3] + - AAp4 * xp[xi + xoff4] + - AAp5 * xp[xi + xoff5] + - AAp6 * xp[xi + xoff6]; - } - hypre_BoxLoop2End(xi, yi); -#undef DEVICE_VAR - - 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) ) - { - switch ( si_center - si ) - { - case 0: Ap0 = zero; break; - case 1: Ap1 = zero; break; - case 2: Ap2 = zero; break; - case 3: Ap3 = zero; break; - case 4: Ap4 = zero; break; - case 5: Ap5 = zero; break; - } - } - AAp0 = Ap0[Ai_CC]; - AAp1 = Ap1[Ai_CC]; - AAp2 = Ap2[Ai_CC]; - AAp3 = Ap3[Ai_CC]; - AAp4 = Ap4[Ai_CC]; - AAp5 = Ap5[Ai_CC]; - - xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 0]); - xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 1]); - xoff2 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 2]); - xoff3 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 3]); - xoff4 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 4]); - xoff5 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 5]); - -#define DEVICE_VAR is_device_ptr(yp,xp) - hypre_BoxLoop2Begin(ndim, loop_size, - x_data_box, start, stride, xi, - y_data_box, start, stride, yi); - { - yp[yi] += - AAp0 * xp[xi + xoff0] + - AAp1 * xp[xi + xoff1] + - AAp2 * xp[xi + xoff2] + - AAp3 * xp[xi + xoff3] + - AAp4 * xp[xi + xoff4] + - AAp5 * xp[xi + xoff5]; - } - hypre_BoxLoop2End(xi, yi); -#undef DEVICE_VAR - 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) ) - { - switch ( si_center - si ) - { - case 0: Ap0 = zero; break; - case 1: Ap1 = zero; break; - case 2: Ap2 = zero; break; - case 3: Ap3 = zero; break; - case 4: Ap4 = zero; break; - } - } - AAp0 = Ap0[Ai_CC]; - AAp1 = Ap1[Ai_CC]; - AAp2 = Ap2[Ai_CC]; - AAp3 = Ap3[Ai_CC]; - AAp4 = Ap4[Ai_CC]; - - xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 0]); - xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 1]); - xoff2 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 2]); - xoff3 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 3]); - xoff4 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 4]); - -#define DEVICE_VAR is_device_ptr(yp,xp) - hypre_BoxLoop2Begin(ndim, loop_size, - x_data_box, start, stride, xi, - y_data_box, start, stride, yi); - { - yp[yi] += - AAp0 * xp[xi + xoff0] + - AAp1 * xp[xi + xoff1] + - AAp2 * xp[xi + xoff2] + - AAp3 * xp[xi + xoff3] + - AAp4 * xp[xi + xoff4]; - } - hypre_BoxLoop2End(xi, yi); -#undef DEVICE_VAR - 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) ) - { - switch ( si_center - si ) - { - case 0: Ap0 = zero; break; - case 1: Ap1 = zero; break; - case 2: Ap2 = zero; break; - case 3: Ap3 = zero; break; - } - } - AAp0 = Ap0[Ai_CC]; - AAp1 = Ap1[Ai_CC]; - AAp2 = Ap2[Ai_CC]; - AAp3 = Ap3[Ai_CC]; - - xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 0]); - xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 1]); - xoff2 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 2]); - xoff3 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 3]); - -#define DEVICE_VAR is_device_ptr(yp,xp) - hypre_BoxLoop2Begin(ndim, loop_size, - x_data_box, start, stride, xi, - y_data_box, start, stride, yi); - { - yp[yi] += - AAp0 * xp[xi + xoff0] + - AAp1 * xp[xi + xoff1] + - AAp2 * xp[xi + xoff2] + - AAp3 * xp[xi + xoff3]; - } - hypre_BoxLoop2End(xi, yi); -#undef DEVICE_VAR - 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) ) - { - switch ( si_center - si ) - { - case 0: Ap0 = zero; break; - case 1: Ap1 = zero; break; - case 2: Ap2 = zero; break; - } - } - AAp0 = Ap0[Ai_CC]; - AAp1 = Ap1[Ai_CC]; - AAp2 = Ap2[Ai_CC]; - - xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 0]); - xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 1]); - xoff2 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 2]); - -#define DEVICE_VAR is_device_ptr(yp,xp) - hypre_BoxLoop2Begin(ndim, loop_size, - x_data_box, start, stride, xi, - y_data_box, start, stride, yi); - { - yp[yi] += - AAp0 * xp[xi + xoff0] + - AAp1 * xp[xi + xoff1] + - AAp2 * xp[xi + xoff2]; - } - hypre_BoxLoop2End(xi, yi); -#undef DEVICE_VAR - 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) ) - { - switch ( si_center - si ) - { - case 0: Ap0 = zero; break; - case 1: Ap1 = zero; break; - } - } - AAp0 = Ap0[Ai_CC]; - AAp1 = Ap1[Ai_CC]; - - xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 0]); - xoff1 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 1]); - -#define DEVICE_VAR is_device_ptr(yp,xp) - hypre_BoxLoop2Begin(ndim, loop_size, - x_data_box, start, stride, xi, - y_data_box, start, stride, yi); - { - yp[yi] += - AAp0 * xp[xi + xoff0] + - AAp1 * xp[xi + xoff1]; - } - hypre_BoxLoop2End(xi, yi); -#undef DEVICE_VAR - break; - - case 1: - Ap0 = hypre_StructMatrixBoxData(A, i, si + 0); - if ( si_center - si == 0 ) + se = stentries[si]; + if (se_sspaces[se] == s) + { + if (hypre_StructMatrixConstEntry(A, se)) { - Ap0 = zero; + centries[cnentries++] = se; } - AAp0 = Ap0[Ai_CC]; - - xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si + 0]); - -#define DEVICE_VAR is_device_ptr(yp,xp) - hypre_BoxLoop2Begin(ndim, loop_size, - x_data_box, start, stride, xi, - y_data_box, start, stride, yi); + else { - yp[yi] += - AAp0 * xp[xi + xoff0]; + ventries[vnentries++] = se; } - hypre_BoxLoop2End(xi, yi); -#undef DEVICE_VAR - - break; + } } - } - Ap0 = hypre_StructMatrixBoxData(A, i, si_center); - xoff0 = hypre_BoxOffsetDistance(x_data_box, - stencil_shape[si_center]); - if (alpha != 1.0 ) - { -#define DEVICE_VAR is_device_ptr(yp,Ap0,xp) - hypre_BoxLoop3Begin(ndim, loop_size, - A_data_box, start, stride, Ai, - x_data_box, start, stride, xi, - y_data_box, start, stride, yi); - { - yp[yi] = alpha * ( yp[yi] + - Ap0[Ai] * xp[xi + xoff0] ); - } - hypre_BoxLoop3End(Ai, xi, yi); -#undef DEVICE_VAR - } - else - { -#define DEVICE_VAR is_device_ptr(yp,Ap0,xp) - hypre_BoxLoop3Begin(ndim, loop_size, - A_data_box, start, stride, Ai, - x_data_box, start, stride, xi, - y_data_box, start, stride, yi); + hypre_ForBoxI(j, compute_box_a) { - yp[yi] += - Ap0[Ai] * xp[xi + xoff0]; - } - hypre_BoxLoop3End(Ai, xi, yi); -#undef DEVICE_VAR - } + hypre_CopyBox(hypre_BoxArrayBox(compute_box_a, j), compute_box); + hypre_CopyToIndex(ss_origins[s], ndim, origin); + hypre_ProjectBox(compute_box, origin, stride); + start = hypre_BoxIMin(compute_box); + hypre_BoxGetStrideSize(compute_box, stride, loop_size); + if (cnentries == 1 && vnentries > 0) + { + /* One constant and an arbitrary number of variable coefficients */ + hypre_StructMatvecCompute_core_VCC(alpha, A, x, beta, y, z, + Ab, xb, yb, zb, transpose, + centries[0], vnentries, ventries, + start, stride, loop_size, xfstride, ran_stride, + Adstride, xdstride, ydstride, zdstride, + A_data_box, x_data_box, y_data_box, z_data_box); + } + else + { + /* Operate on constant coefficients */ + hypre_StructMatvecCompute_core_CC(alpha, A, x, beta, y, z, + Ab, xb, yb, zb, transpose, + cnentries, centries, + start, stride, loop_size, xfstride, ran_stride, + xdstride, ydstride, zdstride, + x_data_box, y_data_box, z_data_box); + + /* Operate on variable coefficients */ + hypre_StructMatvecCompute_core_VC(alpha, A, x, beta, y, z, + Ab, xb, yb, zb, transpose, + (cnentries > 0), vnentries, ventries, + start, stride, loop_size, xfstride, ran_stride, + Adstride, xdstride, ydstride, zdstride, + A_data_box, x_data_box, y_data_box, z_data_box); + } + } /* hypre_ForBoxI */ + } /* for stencil space s */ + + hypre_TFree(se_sspaces, HYPRE_MEMORY_HOST); + hypre_TFree(ss_origins, HYPRE_MEMORY_HOST); } } + if (x_tmp) + { + /* Reset x to be the same as y */ + hypre_StructVectorDestroy(x_tmp); + x = y; + } + else + { + /* Restore the original grid and data layout (depending on VectorMemoryMode) */ + hypre_StructVectorRestore(x); + } + hypre_BoxDestroy(compute_box); + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } - /*-------------------------------------------------------------------------- - * hypre_StructMatvecDestroy *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_StructMatvecDestroy( void *matvec_vdata ) +hypre_StructMatvec( HYPRE_Complex alpha, + hypre_StructMatrix *A, + hypre_StructVector *x, + HYPRE_Complex beta, + hypre_StructVector *y ) { - hypre_StructMatvecData *matvec_data = (hypre_StructMatvecData *)matvec_vdata; + void *matvec_data; - if (matvec_data) - { - hypre_StructMatrixDestroy(matvec_data -> A); - hypre_StructVectorDestroy(matvec_data -> x); - hypre_ComputePkgDestroy(matvec_data -> compute_pkg ); - hypre_TFree(matvec_data, HYPRE_MEMORY_HOST); - } + matvec_data = hypre_StructMatvecCreate(); + hypre_StructMatvecSetup(matvec_data, A, x); + hypre_StructMatvecCompute(matvec_data, alpha, A, x, beta, y, y); + hypre_StructMatvecDestroy(matvec_data); return hypre_error_flag; } /*-------------------------------------------------------------------------- - * hypre_StructMatvec *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_StructMatvec( HYPRE_Complex alpha, - hypre_StructMatrix *A, - hypre_StructVector *x, - HYPRE_Complex beta, - hypre_StructVector *y ) +hypre_StructMatvecT( HYPRE_Complex alpha, + hypre_StructMatrix *A, + hypre_StructVector *x, + HYPRE_Complex beta, + hypre_StructVector *y ) { void *matvec_data; matvec_data = hypre_StructMatvecCreate(); + hypre_StructMatvecSetTranspose(matvec_data, 1); hypre_StructMatvecSetup(matvec_data, A, x); - hypre_StructMatvecCompute(matvec_data, alpha, A, x, beta, y); + hypre_StructMatvecCompute(matvec_data, alpha, A, x, beta, y, y); hypre_StructMatvecDestroy(matvec_data); return hypre_error_flag; diff --git a/src/struct_mv/struct_matvec_core.c b/src/struct_mv/struct_matvec_core.c new file mode 100644 index 0000000000..666c0b35ed --- /dev/null +++ b/src/struct_mv/struct_matvec_core.c @@ -0,0 +1,1120 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/****************************************************************************** + * + * Structured matrix-vector multiply routine + * + *****************************************************************************/ + +#include "_hypre_struct_mv.h" +#include "_hypre_struct_mv.hpp" + +#if !defined(HYPRE_UNROLL_MAXDEPTH) ||\ + defined(HYPRE_UNROLL_MAXDEPTH) && HYPRE_UNROLL_MAXDEPTH > 27 +#if defined(HYPRE_USING_GPU) +#define HYPRE_UNROLL_MAXDEPTH 27 +#else +#define HYPRE_UNROLL_MAXDEPTH 21 +#endif +#endif + +/*-------------------------------------------------------------------------- + * Macros used in the kernel loops below + *--------------------------------------------------------------------------*/ + +#define HYPRE_DECLARE_OFFSETS(n) \ + HYPRE_Complex *Ap##n = NULL; \ + HYPRE_Int xoff##n = 0 + +#define HYPRE_MAP_A_OFFSET(offset) \ + hypre_StructMatrixMapDataIndex(A, offset); \ + hypre_SubtractIndexes(offset, Adstart, ndim, offset); + +#define HYPRE_MAP_X_OFFSET(offset) \ + hypre_MapToFineIndex(offset, NULL, xfstride, ndim); \ + hypre_StructVectorMapDataIndex(x, offset); \ + hypre_SubtractIndexes(offset, xdstart, ndim, offset); + +#define HYPRE_SET_CAX(Ap, xoff, entry) \ + Ap = hypre_StructMatrixBoxData(A, Ab, entry); \ + hypre_AddIndexes(start, stencil_shape[entry], ndim, offset); \ + HYPRE_MAP_X_OFFSET(offset); \ + xoff = hypre_BoxOffsetDistance(x_data_box, offset); + +#define HYPRE_SET_CAX_TRANS(Ap, xoff, entry) \ + Ap = hypre_StructMatrixBoxData(A, Ab, entry); \ + hypre_SubtractIndexes(start, stencil_shape[entry], ndim, offset); \ + HYPRE_MAP_X_OFFSET(offset); \ + xoff = hypre_BoxOffsetDistance(x_data_box, offset); + +#define HYPRE_SET_AX(Ap, xoff, entry) \ + HYPRE_SET_CAX(Ap, xoff, entry) + +#define HYPRE_SET_AX_TRANS(Ap, xoff, entry) \ + HYPRE_SET_CAX_TRANS(Ap, xoff, entry) \ + hypre_SubtractIndexes(start, stencil_shape[entry], ndim, offset); \ + HYPRE_MAP_A_OFFSET(offset); \ + Ap += hypre_BoxOffsetDistance(A_data_box, offset); + +#define HYPRE_LOAD_CAX(transpose, n) \ + if (transpose) { \ + HYPRE_SET_CAX_TRANS(Ap##n, xoff##n, entries[si + n]) \ + } else { \ + HYPRE_SET_CAX(Ap##n, xoff##n, entries[si + n]) \ + } + +#define HYPRE_LOAD_AX(transpose, n) \ + if (transpose) { \ + HYPRE_SET_AX_TRANS(Ap##n, xoff##n, entries[si + n]) \ + } else { \ + HYPRE_SET_AX(Ap##n, xoff##n, entries[si + n]) \ + } + +#define HYPRE_CALC_AX(n) \ + Ap##n[Ai] * xp[xi + xoff##n] + +#define HYPRE_CALC_AX_ADD(n) \ + Ap##n[Ai] * xp[xi + xoff##n] + + +#define HYPRE_CALC_CAX(n) \ + Ap##n[0] * xp[xi + xoff##n] + +#define HYPRE_CALC_CAX_ADD(n) \ + Ap##n[0] * xp[xi + xoff##n] + + +/* Sequence macros for declaring offset variables */ +#define HYPRE_DECLARE_OFFSETS_UP_TO_27 \ + HYPRE_DECLARE_OFFSETS(0); \ + HYPRE_DECLARE_OFFSETS(1); \ + HYPRE_DECLARE_OFFSETS(2); \ + HYPRE_DECLARE_OFFSETS(3); \ + HYPRE_DECLARE_OFFSETS(4); \ + HYPRE_DECLARE_OFFSETS(5); \ + HYPRE_DECLARE_OFFSETS(6); \ + HYPRE_DECLARE_OFFSETS(7); \ + HYPRE_DECLARE_OFFSETS(8); \ + HYPRE_DECLARE_OFFSETS(9); \ + HYPRE_DECLARE_OFFSETS(10); \ + HYPRE_DECLARE_OFFSETS(11); \ + HYPRE_DECLARE_OFFSETS(12); \ + HYPRE_DECLARE_OFFSETS(13); \ + HYPRE_DECLARE_OFFSETS(14); \ + HYPRE_DECLARE_OFFSETS(15); \ + HYPRE_DECLARE_OFFSETS(16); \ + HYPRE_DECLARE_OFFSETS(17); \ + HYPRE_DECLARE_OFFSETS(18); \ + HYPRE_DECLARE_OFFSETS(19); \ + HYPRE_DECLARE_OFFSETS(20); \ + HYPRE_DECLARE_OFFSETS(21); \ + HYPRE_DECLARE_OFFSETS(22); \ + HYPRE_DECLARE_OFFSETS(23); \ + HYPRE_DECLARE_OFFSETS(24); \ + HYPRE_DECLARE_OFFSETS(25); \ + HYPRE_DECLARE_OFFSETS(26) + +/* Sequence macros for loading matrix entries */ +#define HYPRE_LOAD_AX_UP_TO_1(t) \ + HYPRE_LOAD_AX(t, 0) \ + +#define HYPRE_LOAD_AX_UP_TO_2(t) \ + HYPRE_LOAD_AX(t, 1) \ + HYPRE_LOAD_AX_UP_TO_1(t) + +#define HYPRE_LOAD_AX_UP_TO_3(t) \ + HYPRE_LOAD_AX(t, 2) \ + HYPRE_LOAD_AX_UP_TO_2(t) + +#define HYPRE_LOAD_AX_UP_TO_4(t) \ + HYPRE_LOAD_AX(t, 3) \ + HYPRE_LOAD_AX_UP_TO_3(t) + +#define HYPRE_LOAD_AX_UP_TO_5(t) \ + HYPRE_LOAD_AX(t, 4) \ + HYPRE_LOAD_AX_UP_TO_4(t) + +#define HYPRE_LOAD_AX_UP_TO_6(t) \ + HYPRE_LOAD_AX(t, 5) \ + HYPRE_LOAD_AX_UP_TO_5(t) + +#define HYPRE_LOAD_AX_UP_TO_7(t) \ + HYPRE_LOAD_AX(t, 6) \ + HYPRE_LOAD_AX_UP_TO_6(t) + +#define HYPRE_LOAD_AX_UP_TO_8(t) \ + HYPRE_LOAD_AX(t, 7) \ + HYPRE_LOAD_AX_UP_TO_7(t) + +#define HYPRE_LOAD_AX_UP_TO_9(t) \ + HYPRE_LOAD_AX(t, 8) \ + HYPRE_LOAD_AX_UP_TO_8(t) + +#define HYPRE_LOAD_AX_UP_TO_10(t) \ + HYPRE_LOAD_AX(t, 9) \ + HYPRE_LOAD_AX_UP_TO_9(t) + +#define HYPRE_LOAD_AX_UP_TO_11(t) \ + HYPRE_LOAD_AX(t, 10) \ + HYPRE_LOAD_AX_UP_TO_10(t) + +#define HYPRE_LOAD_AX_UP_TO_12(t) \ + HYPRE_LOAD_AX(t, 11) \ + HYPRE_LOAD_AX_UP_TO_11(t) + +#define HYPRE_LOAD_AX_UP_TO_13(t) \ + HYPRE_LOAD_AX(t, 12) \ + HYPRE_LOAD_AX_UP_TO_12(t) + +#define HYPRE_LOAD_AX_UP_TO_14(t) \ + HYPRE_LOAD_AX(t, 13) \ + HYPRE_LOAD_AX_UP_TO_13(t) + +#define HYPRE_LOAD_AX_UP_TO_15(t) \ + HYPRE_LOAD_AX(t, 14) \ + HYPRE_LOAD_AX_UP_TO_14(t) + +#define HYPRE_LOAD_AX_UP_TO_16(t) \ + HYPRE_LOAD_AX(t, 15) \ + HYPRE_LOAD_AX_UP_TO_15(t) + +#define HYPRE_LOAD_AX_UP_TO_17(t) \ + HYPRE_LOAD_AX(t, 16) \ + HYPRE_LOAD_AX_UP_TO_16(t) + +#define HYPRE_LOAD_AX_UP_TO_18(t) \ + HYPRE_LOAD_AX(t, 17) \ + HYPRE_LOAD_AX_UP_TO_17(t) + +#define HYPRE_LOAD_AX_UP_TO_19(t) \ + HYPRE_LOAD_AX(t, 18) \ + HYPRE_LOAD_AX_UP_TO_18(t) + +#define HYPRE_LOAD_AX_UP_TO_20(t) \ + HYPRE_LOAD_AX(t, 19) \ + HYPRE_LOAD_AX_UP_TO_19(t) + +#define HYPRE_LOAD_AX_UP_TO_21(t) \ + HYPRE_LOAD_AX(t, 20) \ + HYPRE_LOAD_AX_UP_TO_20(t) + +#define HYPRE_LOAD_AX_UP_TO_22(t) \ + HYPRE_LOAD_AX(t, 21) \ + HYPRE_LOAD_AX_UP_TO_21(t) + +#define HYPRE_LOAD_AX_UP_TO_23(t) \ + HYPRE_LOAD_AX(t, 22) \ + HYPRE_LOAD_AX_UP_TO_22(t) + +#define HYPRE_LOAD_AX_UP_TO_24(t) \ + HYPRE_LOAD_AX(t, 23) \ + HYPRE_LOAD_AX_UP_TO_23(t) + +#define HYPRE_LOAD_AX_UP_TO_25(t) \ + HYPRE_LOAD_AX(t, 24) \ + HYPRE_LOAD_AX_UP_TO_24(t) + +#define HYPRE_LOAD_AX_UP_TO_26(t) \ + HYPRE_LOAD_AX(t, 25) \ + HYPRE_LOAD_AX_UP_TO_25(t) + +#define HYPRE_LOAD_AX_UP_TO_27(t) \ + HYPRE_LOAD_AX(t, 26) \ + HYPRE_LOAD_AX_UP_TO_26(t) + +#define HYPRE_LOAD_CAX_UP_TO_1(t) \ + HYPRE_LOAD_CAX(t, 0) \ + +#define HYPRE_LOAD_CAX_UP_TO_2(t) \ + HYPRE_LOAD_CAX(t, 1) \ + HYPRE_LOAD_CAX_UP_TO_1(t) + +#define HYPRE_LOAD_CAX_UP_TO_3(t) \ + HYPRE_LOAD_CAX(t, 2) \ + HYPRE_LOAD_CAX_UP_TO_2(t) + +#define HYPRE_LOAD_CAX_UP_TO_4(t) \ + HYPRE_LOAD_CAX(t, 3) \ + HYPRE_LOAD_CAX_UP_TO_3(t) + +#define HYPRE_LOAD_CAX_UP_TO_5(t) \ + HYPRE_LOAD_CAX(t, 4) \ + HYPRE_LOAD_CAX_UP_TO_4(t) + +#define HYPRE_LOAD_CAX_UP_TO_6(t) \ + HYPRE_LOAD_CAX(t, 5) \ + HYPRE_LOAD_CAX_UP_TO_5(t) + +#define HYPRE_LOAD_CAX_UP_TO_7(t) \ + HYPRE_LOAD_CAX(t, 6) \ + HYPRE_LOAD_CAX_UP_TO_6(t) + +#define HYPRE_LOAD_CAX_UP_TO_8(t) \ + HYPRE_LOAD_CAX(t, 7) \ + HYPRE_LOAD_CAX_UP_TO_7(t) + +#define HYPRE_LOAD_CAX_UP_TO_9(t) \ + HYPRE_LOAD_CAX(t, 8) \ + HYPRE_LOAD_CAX_UP_TO_8(t) + +#define HYPRE_LOAD_CAX_UP_TO_10(t) \ + HYPRE_LOAD_CAX(t, 9) \ + HYPRE_LOAD_CAX_UP_TO_9(t) + +#define HYPRE_LOAD_CAX_UP_TO_11(t) \ + HYPRE_LOAD_CAX(t, 10) \ + HYPRE_LOAD_CAX_UP_TO_10(t) + +#define HYPRE_LOAD_CAX_UP_TO_12(t) \ + HYPRE_LOAD_CAX(t, 11) \ + HYPRE_LOAD_CAX_UP_TO_11(t) + +#define HYPRE_LOAD_CAX_UP_TO_13(t) \ + HYPRE_LOAD_CAX(t, 12) \ + HYPRE_LOAD_CAX_UP_TO_12(t) + +#define HYPRE_LOAD_CAX_UP_TO_14(t) \ + HYPRE_LOAD_CAX(t, 13) \ + HYPRE_LOAD_CAX_UP_TO_13(t) + +#define HYPRE_LOAD_CAX_UP_TO_15(t) \ + HYPRE_LOAD_CAX(t, 14) \ + HYPRE_LOAD_CAX_UP_TO_14(t) + +#define HYPRE_LOAD_CAX_UP_TO_16(t) \ + HYPRE_LOAD_CAX(t, 15) \ + HYPRE_LOAD_CAX_UP_TO_15(t) + +#define HYPRE_LOAD_CAX_UP_TO_17(t) \ + HYPRE_LOAD_CAX(t, 16) \ + HYPRE_LOAD_CAX_UP_TO_16(t) + +#define HYPRE_LOAD_CAX_UP_TO_18(t) \ + HYPRE_LOAD_CAX(t, 17) \ + HYPRE_LOAD_CAX_UP_TO_17(t) + +#define HYPRE_LOAD_CAX_UP_TO_19(t) \ + HYPRE_LOAD_CAX(t, 18) \ + HYPRE_LOAD_CAX_UP_TO_18(t) + +#define HYPRE_LOAD_CAX_UP_TO_20(t) \ + HYPRE_LOAD_CAX(t, 19) \ + HYPRE_LOAD_CAX_UP_TO_19(t) + +#define HYPRE_LOAD_CAX_UP_TO_21(t) \ + HYPRE_LOAD_CAX(t, 20) \ + HYPRE_LOAD_CAX_UP_TO_20(t) + +#define HYPRE_LOAD_CAX_UP_TO_22(t) \ + HYPRE_LOAD_CAX(t, 21) \ + HYPRE_LOAD_CAX_UP_TO_21(t) + +#define HYPRE_LOAD_CAX_UP_TO_23(t) \ + HYPRE_LOAD_CAX(t, 22) \ + HYPRE_LOAD_CAX_UP_TO_22(t) + +#define HYPRE_LOAD_CAX_UP_TO_24(t) \ + HYPRE_LOAD_CAX(t, 23) \ + HYPRE_LOAD_CAX_UP_TO_23(t) + +#define HYPRE_LOAD_CAX_UP_TO_25(t) \ + HYPRE_LOAD_CAX(t, 24) \ + HYPRE_LOAD_CAX_UP_TO_24(t) + +#define HYPRE_LOAD_CAX_UP_TO_26(t) \ + HYPRE_LOAD_CAX(t, 25) \ + HYPRE_LOAD_CAX_UP_TO_25(t) + +#define HYPRE_LOAD_CAX_UP_TO_27(t) \ + HYPRE_LOAD_CAX(t, 26) \ + HYPRE_LOAD_CAX_UP_TO_26(t) + +/* Sequence macros for various matrix/vector multiplication components */ +#define HYPRE_CALC_AX_ADD_UP_TO_1 \ + HYPRE_CALC_AX(0) \ + +#define HYPRE_CALC_AX_ADD_UP_TO_2 \ + HYPRE_CALC_AX_ADD(1) \ + HYPRE_CALC_AX_ADD_UP_TO_1 + +#define HYPRE_CALC_AX_ADD_UP_TO_3 \ + HYPRE_CALC_AX_ADD(2) \ + HYPRE_CALC_AX_ADD_UP_TO_2 + +#define HYPRE_CALC_AX_ADD_UP_TO_4 \ + HYPRE_CALC_AX_ADD(3) \ + HYPRE_CALC_AX_ADD_UP_TO_3 + +#define HYPRE_CALC_AX_ADD_UP_TO_5 \ + HYPRE_CALC_AX_ADD(4) \ + HYPRE_CALC_AX_ADD_UP_TO_4 + +#define HYPRE_CALC_AX_ADD_UP_TO_6 \ + HYPRE_CALC_AX_ADD(5) \ + HYPRE_CALC_AX_ADD_UP_TO_5 + +#define HYPRE_CALC_AX_ADD_UP_TO_7 \ + HYPRE_CALC_AX_ADD(6) \ + HYPRE_CALC_AX_ADD_UP_TO_6 + +#define HYPRE_CALC_AX_ADD_UP_TO_8 \ + HYPRE_CALC_AX_ADD(7) \ + HYPRE_CALC_AX_ADD_UP_TO_7 + +#define HYPRE_CALC_AX_ADD_UP_TO_9 \ + HYPRE_CALC_AX_ADD(8) \ + HYPRE_CALC_AX_ADD_UP_TO_8 + +#define HYPRE_CALC_AX_ADD_UP_TO_10 \ + HYPRE_CALC_AX_ADD(9) \ + HYPRE_CALC_AX_ADD_UP_TO_9 + +#define HYPRE_CALC_AX_ADD_UP_TO_11 \ + HYPRE_CALC_AX_ADD(10) \ + HYPRE_CALC_AX_ADD_UP_TO_10 + +#define HYPRE_CALC_AX_ADD_UP_TO_12 \ + HYPRE_CALC_AX_ADD(11) \ + HYPRE_CALC_AX_ADD_UP_TO_11 + +#define HYPRE_CALC_AX_ADD_UP_TO_13 \ + HYPRE_CALC_AX_ADD(12) \ + HYPRE_CALC_AX_ADD_UP_TO_12 + +#define HYPRE_CALC_AX_ADD_UP_TO_14 \ + HYPRE_CALC_AX_ADD(13) \ + HYPRE_CALC_AX_ADD_UP_TO_13 + +#define HYPRE_CALC_AX_ADD_UP_TO_15 \ + HYPRE_CALC_AX_ADD(14) \ + HYPRE_CALC_AX_ADD_UP_TO_14 + +#define HYPRE_CALC_AX_ADD_UP_TO_16 \ + HYPRE_CALC_AX_ADD(15) \ + HYPRE_CALC_AX_ADD_UP_TO_15 + +#define HYPRE_CALC_AX_ADD_UP_TO_17 \ + HYPRE_CALC_AX_ADD(16) \ + HYPRE_CALC_AX_ADD_UP_TO_16 + +#define HYPRE_CALC_AX_ADD_UP_TO_18 \ + HYPRE_CALC_AX_ADD(17) \ + HYPRE_CALC_AX_ADD_UP_TO_17 + +#define HYPRE_CALC_AX_ADD_UP_TO_19 \ + HYPRE_CALC_AX_ADD(18) \ + HYPRE_CALC_AX_ADD_UP_TO_18 + +#define HYPRE_CALC_AX_ADD_UP_TO_20 \ + HYPRE_CALC_AX_ADD(19) \ + HYPRE_CALC_AX_ADD_UP_TO_19 + +#define HYPRE_CALC_AX_ADD_UP_TO_21 \ + HYPRE_CALC_AX_ADD(20) \ + HYPRE_CALC_AX_ADD_UP_TO_20 + +#define HYPRE_CALC_AX_ADD_UP_TO_22 \ + HYPRE_CALC_AX_ADD(21) \ + HYPRE_CALC_AX_ADD_UP_TO_21 + +#define HYPRE_CALC_AX_ADD_UP_TO_23 \ + HYPRE_CALC_AX_ADD(22) \ + HYPRE_CALC_AX_ADD_UP_TO_22 + +#define HYPRE_CALC_AX_ADD_UP_TO_24 \ + HYPRE_CALC_AX_ADD(23) \ + HYPRE_CALC_AX_ADD_UP_TO_23 + +#define HYPRE_CALC_AX_ADD_UP_TO_25 \ + HYPRE_CALC_AX_ADD(24) \ + HYPRE_CALC_AX_ADD_UP_TO_24 + +#define HYPRE_CALC_AX_ADD_UP_TO_26 \ + HYPRE_CALC_AX_ADD(25) \ + HYPRE_CALC_AX_ADD_UP_TO_25 + +#define HYPRE_CALC_AX_ADD_UP_TO_27 \ + HYPRE_CALC_AX_ADD(26) \ + HYPRE_CALC_AX_ADD_UP_TO_26 + +#define HYPRE_CALC_CAX_ADD_UP_TO_1 \ + HYPRE_CALC_CAX(0) \ + +#define HYPRE_CALC_CAX_ADD_UP_TO_2 \ + HYPRE_CALC_CAX_ADD(1) \ + HYPRE_CALC_CAX_ADD_UP_TO_1 + +#define HYPRE_CALC_CAX_ADD_UP_TO_3 \ + HYPRE_CALC_CAX_ADD(2) \ + HYPRE_CALC_CAX_ADD_UP_TO_2 + +#define HYPRE_CALC_CAX_ADD_UP_TO_4 \ + HYPRE_CALC_CAX_ADD(3) \ + HYPRE_CALC_CAX_ADD_UP_TO_3 + +#define HYPRE_CALC_CAX_ADD_UP_TO_5 \ + HYPRE_CALC_CAX_ADD(4) \ + HYPRE_CALC_CAX_ADD_UP_TO_4 + +#define HYPRE_CALC_CAX_ADD_UP_TO_6 \ + HYPRE_CALC_CAX_ADD(5) \ + HYPRE_CALC_CAX_ADD_UP_TO_5 + +#define HYPRE_CALC_CAX_ADD_UP_TO_7 \ + HYPRE_CALC_CAX_ADD(6) \ + HYPRE_CALC_CAX_ADD_UP_TO_6 + +#define HYPRE_CALC_CAX_ADD_UP_TO_8 \ + HYPRE_CALC_CAX_ADD(7) \ + HYPRE_CALC_CAX_ADD_UP_TO_7 + +#define HYPRE_CALC_CAX_ADD_UP_TO_9 \ + HYPRE_CALC_CAX_ADD(8) \ + HYPRE_CALC_CAX_ADD_UP_TO_8 + +#define HYPRE_CALC_CAX_ADD_UP_TO_10 \ + HYPRE_CALC_CAX_ADD(9) \ + HYPRE_CALC_CAX_ADD_UP_TO_9 + +#define HYPRE_CALC_CAX_ADD_UP_TO_11 \ + HYPRE_CALC_CAX_ADD(10) \ + HYPRE_CALC_CAX_ADD_UP_TO_10 + +#define HYPRE_CALC_CAX_ADD_UP_TO_12 \ + HYPRE_CALC_CAX_ADD(11) \ + HYPRE_CALC_CAX_ADD_UP_TO_11 + +#define HYPRE_CALC_CAX_ADD_UP_TO_13 \ + HYPRE_CALC_CAX_ADD(12) \ + HYPRE_CALC_CAX_ADD_UP_TO_12 + +#define HYPRE_CALC_CAX_ADD_UP_TO_14 \ + HYPRE_CALC_CAX_ADD(13) \ + HYPRE_CALC_CAX_ADD_UP_TO_13 + +#define HYPRE_CALC_CAX_ADD_UP_TO_15 \ + HYPRE_CALC_CAX_ADD(14) \ + HYPRE_CALC_CAX_ADD_UP_TO_14 + +#define HYPRE_CALC_CAX_ADD_UP_TO_16 \ + HYPRE_CALC_CAX_ADD(15) \ + HYPRE_CALC_CAX_ADD_UP_TO_15 + +#define HYPRE_CALC_CAX_ADD_UP_TO_17 \ + HYPRE_CALC_CAX_ADD(16) \ + HYPRE_CALC_CAX_ADD_UP_TO_16 + +#define HYPRE_CALC_CAX_ADD_UP_TO_18 \ + HYPRE_CALC_CAX_ADD(17) \ + HYPRE_CALC_CAX_ADD_UP_TO_17 + +#define HYPRE_CALC_CAX_ADD_UP_TO_19 \ + HYPRE_CALC_CAX_ADD(18) \ + HYPRE_CALC_CAX_ADD_UP_TO_18 + +#define HYPRE_CALC_CAX_ADD_UP_TO_20 \ + HYPRE_CALC_CAX_ADD(19) \ + HYPRE_CALC_CAX_ADD_UP_TO_19 + +#define HYPRE_CALC_CAX_ADD_UP_TO_21 \ + HYPRE_CALC_CAX_ADD(20) \ + HYPRE_CALC_CAX_ADD_UP_TO_20 + +#define HYPRE_CALC_CAX_ADD_UP_TO_22 \ + HYPRE_CALC_CAX_ADD(21) \ + HYPRE_CALC_CAX_ADD_UP_TO_21 + +#define HYPRE_CALC_CAX_ADD_UP_TO_23 \ + HYPRE_CALC_CAX_ADD(22) \ + HYPRE_CALC_CAX_ADD_UP_TO_22 + +#define HYPRE_CALC_CAX_ADD_UP_TO_24 \ + HYPRE_CALC_CAX_ADD(23) \ + HYPRE_CALC_CAX_ADD_UP_TO_23 + +#define HYPRE_CALC_CAX_ADD_UP_TO_25 \ + HYPRE_CALC_CAX_ADD(24) \ + HYPRE_CALC_CAX_ADD_UP_TO_24 + +#define HYPRE_CALC_CAX_ADD_UP_TO_26 \ + HYPRE_CALC_CAX_ADD(25) \ + HYPRE_CALC_CAX_ADD_UP_TO_25 + +#define HYPRE_CALC_CAX_ADD_UP_TO_27 \ + HYPRE_CALC_CAX_ADD(26) \ + HYPRE_CALC_CAX_ADD_UP_TO_26 + +/*-------------------------------------------------------------------------- + * z = beta * y + alpha * A*x + * + * StructMatrix/Vector multiplication core function for constant coeficients. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructMatvecCompute_core_CC( HYPRE_Complex alpha, + hypre_StructMatrix *A, + hypre_StructVector *x, + HYPRE_Complex beta, + hypre_StructVector *y, + hypre_StructVector *z, + HYPRE_Int Ab, + HYPRE_Int xb, + HYPRE_Int yb, + HYPRE_Int zb, + HYPRE_Int transpose, + HYPRE_Int nentries, + HYPRE_Int *entries, + hypre_IndexRef start, + hypre_IndexRef stride, + hypre_IndexRef loop_size, + hypre_IndexRef xfstride, + hypre_IndexRef ran_stride, + hypre_IndexRef xdstride, + hypre_IndexRef ydstride, + hypre_IndexRef zdstride, + hypre_Box *x_data_box, + hypre_Box *y_data_box, + hypre_Box *z_data_box) +{ +#define DEVICE_VAR is_device_ptr(yp,xp,Ap0,Ap1,Ap2,Ap3,Ap4,Ap5,Ap6,Ap7,Ap8,Ap9,Ap10,Ap11,Ap12,Ap13,Ap14,Ap15,Ap16,Ap17,Ap18,Ap19,Ap20,Ap21,Ap22,Ap23,Ap24,Ap25,Ap26) + HYPRE_Int ndim = hypre_StructMatrixNDim(A); + hypre_StructStencil *stencil = hypre_StructMatrixStencil(A); + hypre_Index *stencil_shape = hypre_StructStencilShape(stencil); + + hypre_Index xdstart, ydstart, zdstart; + hypre_Index offset; + HYPRE_Int si = 0, depth; + HYPRE_Complex *xp, *yp, *zp; + HYPRE_DECLARE_OFFSETS_UP_TO_27; + + /* Exit early if no stencil entries fall in this category */ + if (!nentries) + { + return hypre_error_flag; + } + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("CC"); + + xp = hypre_StructVectorBoxData(x, xb); + yp = hypre_StructVectorBoxData(y, yb); + zp = hypre_StructVectorBoxData(z, zb); + + hypre_CopyToIndex(start, ndim, xdstart); + + /* The next line is only used to avoid 'print error' messages. It ensures + * that xdstart is aligned with the vector data space before mapping. The + * choice, Neg vs Pos, doesn't matter because an offset will be used to index + * into the vector x (xoff = index - xdstart). */ + hypre_SnapIndexNeg(xdstart, NULL, stride, ndim); + hypre_MapToFineIndex(xdstart, NULL, xfstride, ndim); + hypre_StructVectorMapDataIndex(x, xdstart); + hypre_CopyToIndex(start, ndim, ydstart); + hypre_MapToCoarseIndex(ydstart, NULL, ran_stride, ndim); + hypre_CopyToIndex(start, ndim, zdstart); + hypre_MapToCoarseIndex(zdstart, NULL, ran_stride, ndim); + + /* Initialize output vector in the first pass */ +#ifdef HYPRE_CORE_CASE +#undef HYPRE_CORE_CASE +#endif +#define HYPRE_CORE_CASE(n) \ + case n: \ + HYPRE_LOAD_CAX_UP_TO_##n(transpose); \ + hypre_BoxLoop3Begin(ndim, loop_size, \ + x_data_box, xdstart, xdstride, xi, \ + y_data_box, ydstart, ydstride, yi, \ + z_data_box, zdstart, zdstride, zi); \ + { \ + zp[zi] = beta * yp[yi] + alpha * (HYPRE_CALC_CAX_ADD_UP_TO_##n); \ + } \ + hypre_BoxLoop3End(xi, yi, zi); \ + break; + + depth = hypre_min(HYPRE_UNROLL_MAXDEPTH, nentries); + switch (depth) + { + HYPRE_CORE_CASE(27); + HYPRE_CORE_CASE(26); + HYPRE_CORE_CASE(25); + HYPRE_CORE_CASE(24); + HYPRE_CORE_CASE(23); + HYPRE_CORE_CASE(22); + HYPRE_CORE_CASE(21); + HYPRE_CORE_CASE(20); + HYPRE_CORE_CASE(19); + HYPRE_CORE_CASE(18); + HYPRE_CORE_CASE(17); + HYPRE_CORE_CASE(16); + HYPRE_CORE_CASE(15); + HYPRE_CORE_CASE(14); + HYPRE_CORE_CASE(13); + HYPRE_CORE_CASE(12); + HYPRE_CORE_CASE(11); + HYPRE_CORE_CASE(10); + HYPRE_CORE_CASE(9); + HYPRE_CORE_CASE(8); + HYPRE_CORE_CASE(7); + HYPRE_CORE_CASE(6); + HYPRE_CORE_CASE(5); + HYPRE_CORE_CASE(4); + HYPRE_CORE_CASE(3); + HYPRE_CORE_CASE(2); + HYPRE_CORE_CASE(1); + + case 0: + break; + } + + /* Update output vector with remaining A*x components if any */ +#ifdef HYPRE_CORE_CASE +#undef HYPRE_CORE_CASE +#endif +#define HYPRE_CORE_CASE(n) \ + case n: \ + HYPRE_LOAD_CAX_UP_TO_##n(transpose); \ + hypre_BoxLoop2Begin(ndim, loop_size, \ + x_data_box, xdstart, xdstride, xi, \ + z_data_box, zdstart, zdstride, zi); \ + { \ + zp[zi] += alpha * (HYPRE_CALC_CAX_ADD_UP_TO_##n); \ + } \ + hypre_BoxLoop2End(xi, zi); \ + break; + + for (si = depth; si < nentries; si += HYPRE_UNROLL_MAXDEPTH) + { + depth = hypre_min(HYPRE_UNROLL_MAXDEPTH, (nentries - si)); + + switch (depth) + { + HYPRE_CORE_CASE(27); + HYPRE_CORE_CASE(26); + HYPRE_CORE_CASE(25); + HYPRE_CORE_CASE(24); + HYPRE_CORE_CASE(23); + HYPRE_CORE_CASE(22); + HYPRE_CORE_CASE(21); + HYPRE_CORE_CASE(20); + HYPRE_CORE_CASE(19); + HYPRE_CORE_CASE(18); + HYPRE_CORE_CASE(17); + HYPRE_CORE_CASE(16); + HYPRE_CORE_CASE(15); + HYPRE_CORE_CASE(14); + HYPRE_CORE_CASE(13); + HYPRE_CORE_CASE(12); + HYPRE_CORE_CASE(11); + HYPRE_CORE_CASE(10); + HYPRE_CORE_CASE(9); + HYPRE_CORE_CASE(8); + HYPRE_CORE_CASE(7); + HYPRE_CORE_CASE(6); + HYPRE_CORE_CASE(5); + HYPRE_CORE_CASE(4); + HYPRE_CORE_CASE(3); + HYPRE_CORE_CASE(2); + HYPRE_CORE_CASE(1); + + case 0: + break; + } /* switch (depth) */ + } /* for si */ +#undef DEVICE_VAR + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * z = beta * y + alpha * A*x + * + * StructMatrix/Vector multiplication core routine for variable coeficients. + *--------------------------------------------------------------------------*/ +HYPRE_Int +hypre_StructMatvecCompute_core_VC( HYPRE_Complex alpha, + hypre_StructMatrix *A, + hypre_StructVector *x, + HYPRE_Complex beta, + hypre_StructVector *y, + hypre_StructVector *z, + HYPRE_Int Ab, + HYPRE_Int xb, + HYPRE_Int yb, + HYPRE_Int zb, + HYPRE_Int transpose, + HYPRE_Int only_Ax, + HYPRE_Int nentries, + HYPRE_Int *entries, + hypre_IndexRef start, + hypre_IndexRef stride, + hypre_IndexRef loop_size, + hypre_IndexRef xfstride, + hypre_IndexRef ran_stride, + hypre_IndexRef Adstride, + hypre_IndexRef xdstride, + hypre_IndexRef ydstride, + hypre_IndexRef zdstride, + hypre_Box *A_data_box, + hypre_Box *x_data_box, + hypre_Box *y_data_box, + hypre_Box *z_data_box ) +{ +#define DEVICE_VAR is_device_ptr(yp,xp,Ap0,Ap1,Ap2,Ap3,Ap4,Ap5,Ap6,Ap7,Ap8,Ap9,Ap10,Ap11,Ap12,Ap13,Ap14,Ap15,Ap16,Ap17,Ap18,Ap19,Ap20,Ap21,Ap22,Ap23,Ap24,Ap25,Ap26) + HYPRE_Int ndim = hypre_StructMatrixNDim(A); + hypre_StructStencil *stencil = hypre_StructMatrixStencil(A); + hypre_Index *stencil_shape = hypre_StructStencilShape(stencil); + + hypre_Index Adstart, xdstart, ydstart, zdstart; + hypre_Index offset; + HYPRE_Int si = 0, depth; + HYPRE_Complex *xp, *yp, *zp; + HYPRE_DECLARE_OFFSETS_UP_TO_27; + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("VC"); + + xp = hypre_StructVectorBoxData(x, xb); + yp = hypre_StructVectorBoxData(y, yb); + zp = hypre_StructVectorBoxData(z, zb); + + hypre_CopyToIndex(start, ndim, Adstart); + + /* The next line is only used to avoid 'print error' messages. It ensures + * that Adstart is aligned with the matrix data space before mapping. The + * choice, Neg vs Pos, doesn't matter because the coefficient pointer will be + * offset (Ap += BoxOffsetDistance(index - Adstart)). */ + hypre_SnapIndexNeg(Adstart, NULL, stride, ndim); + hypre_StructMatrixMapDataIndex(A, Adstart); + hypre_CopyToIndex(start, ndim, xdstart); + + /* The next line is only used to avoid 'print error' messages. It ensures + * that xdstart is aligned with the vector data space before mapping. The + * choice, Neg vs Pos, doesn't matter because an offset will be used to index + * into the vector x (xoff = index - xdstart). */ + hypre_SnapIndexNeg(xdstart, NULL, stride, ndim); + hypre_MapToFineIndex(xdstart, NULL, xfstride, ndim); + hypre_StructVectorMapDataIndex(x, xdstart); + hypre_CopyToIndex(start, ndim, ydstart); + hypre_MapToCoarseIndex(ydstart, NULL, ran_stride, ndim); + hypre_CopyToIndex(start, ndim, zdstart); + hypre_MapToCoarseIndex(zdstart, NULL, ran_stride, ndim); + + /* Initialize output vector in the first pass */ +#ifdef HYPRE_CORE_CASE +#undef HYPRE_CORE_CASE +#endif +#define HYPRE_CORE_CASE(n) \ + case n: \ + HYPRE_LOAD_AX_UP_TO_##n(transpose); \ + hypre_BoxLoop4Begin(ndim, loop_size, \ + A_data_box, Adstart, Adstride, Ai, \ + x_data_box, xdstart, xdstride, xi, \ + y_data_box, ydstart, ydstride, yi, \ + z_data_box, zdstart, zdstride, zi) \ + { \ + zp[zi] = beta * yp[yi] + alpha * (HYPRE_CALC_AX_ADD_UP_TO_##n); \ + } \ + hypre_BoxLoop4End(Ai, xi, yi, zi) \ + break; + + /* The flag "only_Ax" indicates that "beta * yp" has been computed previously (by the CC kernel) */ + depth = only_Ax ? 0 : hypre_min(HYPRE_UNROLL_MAXDEPTH, nentries); + switch (depth) + { + HYPRE_CORE_CASE(27); + HYPRE_CORE_CASE(26); + HYPRE_CORE_CASE(25); + HYPRE_CORE_CASE(24); + HYPRE_CORE_CASE(23); + HYPRE_CORE_CASE(22); + HYPRE_CORE_CASE(21); + HYPRE_CORE_CASE(20); + HYPRE_CORE_CASE(19); + HYPRE_CORE_CASE(18); + HYPRE_CORE_CASE(17); + HYPRE_CORE_CASE(16); + HYPRE_CORE_CASE(15); + HYPRE_CORE_CASE(14); + HYPRE_CORE_CASE(13); + HYPRE_CORE_CASE(12); + HYPRE_CORE_CASE(11); + HYPRE_CORE_CASE(10); + HYPRE_CORE_CASE(9); + HYPRE_CORE_CASE(8); + HYPRE_CORE_CASE(7); + HYPRE_CORE_CASE(6); + HYPRE_CORE_CASE(5); + HYPRE_CORE_CASE(4); + HYPRE_CORE_CASE(3); + HYPRE_CORE_CASE(2); + HYPRE_CORE_CASE(1); + + case 0: + break; + } + + /* Update output vector with remaining A*x components if any */ +#ifdef HYPRE_CORE_CASE +#undef HYPRE_CORE_CASE +#endif +#define HYPRE_CORE_CASE(n) \ + case n: \ + HYPRE_LOAD_AX_UP_TO_##n(transpose); \ + hypre_BoxLoop3Begin(ndim, loop_size, \ + A_data_box, Adstart, Adstride, Ai, \ + x_data_box, xdstart, xdstride, xi, \ + z_data_box, zdstart, zdstride, zi); \ + { \ + zp[zi] += alpha * (HYPRE_CALC_AX_ADD_UP_TO_##n); \ + } \ + hypre_BoxLoop3End(Ai, xi, zi); \ + break; + + for (si = depth; si < nentries; si += HYPRE_UNROLL_MAXDEPTH) + { + depth = hypre_min(HYPRE_UNROLL_MAXDEPTH, (nentries - si)); + + switch (depth) + { + HYPRE_CORE_CASE(27); + HYPRE_CORE_CASE(26); + HYPRE_CORE_CASE(25); + HYPRE_CORE_CASE(24); + HYPRE_CORE_CASE(23); + HYPRE_CORE_CASE(22); + HYPRE_CORE_CASE(21); + HYPRE_CORE_CASE(20); + HYPRE_CORE_CASE(19); + HYPRE_CORE_CASE(18); + HYPRE_CORE_CASE(17); + HYPRE_CORE_CASE(16); + HYPRE_CORE_CASE(15); + HYPRE_CORE_CASE(14); + HYPRE_CORE_CASE(13); + HYPRE_CORE_CASE(12); + HYPRE_CORE_CASE(11); + HYPRE_CORE_CASE(10); + HYPRE_CORE_CASE(9); + HYPRE_CORE_CASE(8); + HYPRE_CORE_CASE(7); + HYPRE_CORE_CASE(6); + HYPRE_CORE_CASE(5); + HYPRE_CORE_CASE(4); + HYPRE_CORE_CASE(3); + HYPRE_CORE_CASE(2); + HYPRE_CORE_CASE(1); + + case 0: + break; + } /* switch (depth) */ + } /* for si */ +#undef DEVICE_VAR + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * z = beta * y + alpha * A*x + * + * StructMatrix/Vector multiplication core routine for one constant + * and an arbitrary number of variable coefficients + *--------------------------------------------------------------------------*/ +HYPRE_Int +hypre_StructMatvecCompute_core_VCC( HYPRE_Complex alpha, + hypre_StructMatrix *A, + hypre_StructVector *x, + HYPRE_Complex beta, + hypre_StructVector *y, + hypre_StructVector *z, + HYPRE_Int Ab, + HYPRE_Int xb, + HYPRE_Int yb, + HYPRE_Int zb, + HYPRE_Int transpose, + HYPRE_Int centry, + HYPRE_Int nentries, + HYPRE_Int *entries, + hypre_IndexRef start, + hypre_IndexRef stride, + hypre_IndexRef loop_size, + hypre_IndexRef xfstride, + hypre_IndexRef ran_stride, + hypre_IndexRef Adstride, + hypre_IndexRef xdstride, + hypre_IndexRef ydstride, + hypre_IndexRef zdstride, + hypre_Box *A_data_box, + hypre_Box *x_data_box, + hypre_Box *y_data_box, + hypre_Box *z_data_box ) +{ +#define DEVICE_VAR is_device_ptr(yp,xp,Ap0,Ap1,Ap2,Ap3,Ap4,Ap5,Ap6,Ap7,Ap8,Ap9,Ap10,Ap11,Ap12,Ap13,Ap14,Ap15,Ap16,Ap17,Ap18,Ap19,Ap20,Ap21,Ap22,Ap23,Ap24,Ap25,Ap26) + HYPRE_Int ndim = hypre_StructMatrixNDim(A); + hypre_StructStencil *stencil = hypre_StructMatrixStencil(A); + hypre_Index *stencil_shape = hypre_StructStencilShape(stencil); + + hypre_Index Adstart, xdstart, ydstart, zdstart; + hypre_Index offset; + HYPRE_Int si = 0, depth; + HYPRE_Complex *xp, *yp, *zp; + HYPRE_DECLARE_OFFSETS_UP_TO_27; + + HYPRE_ANNOTATE_FUNC_BEGIN; + hypre_GpuProfilingPushRange("VCC"); + + xp = hypre_StructVectorBoxData(x, xb); + yp = hypre_StructVectorBoxData(y, yb); + zp = hypre_StructVectorBoxData(z, zb); + + hypre_CopyToIndex(start, ndim, Adstart); + + /* The next line is only used to avoid 'print error' messages. It ensures + * that Adstart is aligned with the matrix data space before mapping. The + * choice, Neg vs Pos, doesn't matter because the coefficient pointer will be + * offset (Ap += BoxOffsetDistance(index - Adstart)). */ + hypre_SnapIndexNeg(Adstart, NULL, stride, ndim); + hypre_StructMatrixMapDataIndex(A, Adstart); + hypre_CopyToIndex(start, ndim, xdstart); + + /* The next line is only used to avoid 'print error' messages. It ensures + * that xdstart is aligned with the vector data space before mapping. The + * choice, Neg vs Pos, doesn't matter because an offset will be used to index + * into the vector x (xoff = index - xdstart). */ + hypre_SnapIndexNeg(xdstart, NULL, stride, ndim); + hypre_MapToFineIndex(xdstart, NULL, xfstride, ndim); + hypre_StructVectorMapDataIndex(x, xdstart); + hypre_CopyToIndex(start, ndim, ydstart); + hypre_MapToCoarseIndex(ydstart, NULL, ran_stride, ndim); + hypre_CopyToIndex(start, ndim, zdstart); + hypre_MapToCoarseIndex(zdstart, NULL, ran_stride, ndim); + + /* Initialize output vector in the first pass + - Ap26 refers to the constant coefficient entries + - Ap[0-25] refer to the variable coefficient entries */ +#ifdef HYPRE_CORE_CASE +#undef HYPRE_CORE_CASE +#endif +#define HYPRE_CORE_CASE(n) \ + case n: \ + if (transpose) { \ + HYPRE_SET_AX_TRANS(Ap26, xoff26, centry) \ + } else { \ + HYPRE_SET_AX(Ap26, xoff26, centry) \ + } \ + HYPRE_LOAD_AX_UP_TO_##n(transpose); \ + hypre_BoxLoop4Begin(ndim, loop_size, \ + A_data_box, Adstart, Adstride, Ai, \ + x_data_box, xdstart, xdstride, xi, \ + y_data_box, ydstart, ydstride, yi, \ + z_data_box, zdstart, zdstride, zi) \ + { \ + zp[zi] = beta * yp[yi] + alpha * (HYPRE_CALC_CAX_ADD(26) + HYPRE_CALC_AX_ADD_UP_TO_##n); \ + } \ + hypre_BoxLoop4End(Ai, xi, yi, zi) \ + break; + + /* We use "-1" to reserve space for the constant coefficient entry */ + depth = hypre_min(HYPRE_UNROLL_MAXDEPTH - 1, nentries); + switch (depth) + { + HYPRE_CORE_CASE(26); + HYPRE_CORE_CASE(25); + HYPRE_CORE_CASE(24); + HYPRE_CORE_CASE(23); + HYPRE_CORE_CASE(22); + HYPRE_CORE_CASE(21); + HYPRE_CORE_CASE(20); + HYPRE_CORE_CASE(19); + HYPRE_CORE_CASE(18); + HYPRE_CORE_CASE(17); + HYPRE_CORE_CASE(16); + HYPRE_CORE_CASE(15); + HYPRE_CORE_CASE(14); + HYPRE_CORE_CASE(13); + HYPRE_CORE_CASE(12); + HYPRE_CORE_CASE(11); + HYPRE_CORE_CASE(10); + HYPRE_CORE_CASE(9); + HYPRE_CORE_CASE(8); + HYPRE_CORE_CASE(7); + HYPRE_CORE_CASE(6); + HYPRE_CORE_CASE(5); + HYPRE_CORE_CASE(4); + HYPRE_CORE_CASE(3); + HYPRE_CORE_CASE(2); + HYPRE_CORE_CASE(1); + + case 0: + break; + } + + /* Update output vector with remaining A*x components if any */ +#ifdef HYPRE_CORE_CASE +#undef HYPRE_CORE_CASE +#endif +#define HYPRE_CORE_CASE(n) \ + case n: \ + HYPRE_LOAD_AX_UP_TO_##n(transpose); \ + hypre_BoxLoop3Begin(ndim, loop_size, \ + A_data_box, Adstart, Adstride, Ai, \ + x_data_box, xdstart, xdstride, xi, \ + z_data_box, zdstart, zdstride, zi); \ + { \ + zp[zi] += alpha * (HYPRE_CALC_AX_ADD_UP_TO_##n); \ + } \ + hypre_BoxLoop3End(Ai, xi, zi); \ + break; + + for (si = depth; si < nentries; si += (HYPRE_UNROLL_MAXDEPTH - 1)) + { + depth = hypre_min((HYPRE_UNROLL_MAXDEPTH - 1), (nentries - si)); + + switch (depth) + { + HYPRE_CORE_CASE(26); + HYPRE_CORE_CASE(25); + HYPRE_CORE_CASE(24); + HYPRE_CORE_CASE(23); + HYPRE_CORE_CASE(22); + HYPRE_CORE_CASE(21); + HYPRE_CORE_CASE(20); + HYPRE_CORE_CASE(19); + HYPRE_CORE_CASE(18); + HYPRE_CORE_CASE(17); + HYPRE_CORE_CASE(16); + HYPRE_CORE_CASE(15); + HYPRE_CORE_CASE(14); + HYPRE_CORE_CASE(13); + HYPRE_CORE_CASE(12); + HYPRE_CORE_CASE(11); + HYPRE_CORE_CASE(10); + HYPRE_CORE_CASE(9); + HYPRE_CORE_CASE(8); + HYPRE_CORE_CASE(7); + HYPRE_CORE_CASE(6); + HYPRE_CORE_CASE(5); + HYPRE_CORE_CASE(4); + HYPRE_CORE_CASE(3); + HYPRE_CORE_CASE(2); + HYPRE_CORE_CASE(1); + + case 0: + break; + } /* switch (depth) */ + } /* for si */ +#undef DEVICE_VAR + + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} diff --git a/src/struct_mv/struct_mv_mp.c b/src/struct_mv/struct_mv_mp.c new file mode 100644 index 0000000000..fe1775428a --- /dev/null +++ b/src/struct_mv/struct_mv_mp.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) + ******************************************************************************/ + +/****************************************************************************** + * + * hypre seq_mv mixed-precision interface + * + *****************************************************************************/ + +#include "_hypre_struct_mv.h" + +#if defined(HYPRE_MIXED_PRECISION) + +/****************************************************************************** + * + * Member functions for hypre_StructVector class. + * + *****************************************************************************/ + +/*-------------------------------------------------------------------------- + * Mixed precision hypre_StructVectorCopy -- -- TODO: Needs GPU support - DOK + * 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_StructVectorCopy_mp( hypre_StructVector *x, + hypre_StructVector *y ) +{ + /* determine type of output vector data ==> Precision of y. */ + HYPRE_Precision precision_y = hypre_StructVectorPrecision (y); + + /* Generic pointer type */ + void *xp, *yp; + + HYPRE_Int i, size; + + /* Call standard vector copy if precisions match. */ + if (precision_y == hypre_StructVectorPrecision (x)) + { + return HYPRE_StructVectorCopy_pre(precision_y, (HYPRE_StructVector)x, (HYPRE_StructVector)y); + } + + /*----------------------------------------------------------------------- + * Set the vector coefficients + *-----------------------------------------------------------------------*/ + + size = hypre_StructVectorDataSize(x); + + /* Implicit conversion to generic data type (void pointer) */ + xp = hypre_StructVectorData(x); + yp = hypre_StructVectorData(y); + + switch (hypre_StructVectorPrecision (x)) + { + case HYPRE_REAL_SINGLE: + switch (precision_y) + { + case HYPRE_REAL_DOUBLE: +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + { + ((hypre_double *)yp)[i] = (hypre_double)((hypre_float *)xp)[i]; + } + break; + case HYPRE_REAL_LONGDOUBLE: +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + { + ((hypre_long_double *)yp)[i] = (hypre_long_double)((hypre_float *)xp)[i]; + } + break; + default: + break; + } + break; + case HYPRE_REAL_DOUBLE: + switch (precision_y) + { + case HYPRE_REAL_SINGLE: +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + { + ((hypre_float *)yp)[i] = (hypre_float)((hypre_double *)xp)[i]; + } + break; + case HYPRE_REAL_LONGDOUBLE: +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + { + ((hypre_long_double *)yp)[i] = (hypre_long_double)((hypre_double *)xp)[i]; + } + break; + default: + break; + } + break; + case HYPRE_REAL_LONGDOUBLE: + switch (precision_y) + { + case HYPRE_REAL_SINGLE: +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + { + ((hypre_float *)yp)[i] = (hypre_float)((hypre_long_double *)xp)[i]; + } + break; + case HYPRE_REAL_DOUBLE: +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < size; i++) + { + ((hypre_double *)yp)[i] = (hypre_double)((hypre_long_double *)xp)[i]; + } + break; + default: + break; + } + default: + hypre_error_w_msg_mp(HYPRE_ERROR_GENERIC, "Error: Undefined precision type for Vector Copy!\n"); + break; + } + + /* + #ifdef HYPRE_PROFILE + hypre_profile_times[HYPRE_TIMER_ID_BLAS1] += hypre_MPI_Wtime(); + #endif + hypre_GpuProfilingPopRange(); + */ + return hypre_error_flag; +} + +#endif + diff --git a/src/struct_mv/struct_scale.c b/src/struct_mv/struct_scale.c index cdbdb117f5..ab95e81209 100644 --- a/src/struct_mv/struct_scale.c +++ b/src/struct_mv/struct_scale.c @@ -15,41 +15,50 @@ #include "_hypre_struct_mv.hpp" /*-------------------------------------------------------------------------- - * hypre_StructScale *--------------------------------------------------------------------------*/ HYPRE_Int hypre_StructScale( HYPRE_Complex alpha, hypre_StructVector *y ) { + HYPRE_Int ndim = hypre_StructVectorNDim(y); + hypre_Box *y_data_box; HYPRE_Complex *yp; - hypre_BoxArray *boxes; - hypre_Box *box; + HYPRE_Int nboxes; + hypre_Box *loop_box; hypre_Index loop_size; hypre_IndexRef start; - hypre_Index unit_stride; + hypre_Index ustride; HYPRE_Int i; - hypre_SetIndex(unit_stride, 1); + /* If alpha is 1.0, y does not change */ + if (alpha == 1.0) + { + return hypre_error_flag; + } + + nboxes = hypre_StructVectorNBoxes(y); + + loop_box = hypre_BoxCreate(ndim); + hypre_SetIndex(ustride, 1); - boxes = hypre_StructGridBoxes(hypre_StructVectorGrid(y)); - hypre_ForBoxI(i, boxes) + for (i = 0; i < nboxes; i++) { - box = hypre_BoxArrayBox(boxes, i); - start = hypre_BoxIMin(box); + hypre_StructVectorGridBoxCopy(y, i, loop_box); + start = hypre_BoxIMin(loop_box); - y_data_box = hypre_BoxArrayBox(hypre_StructVectorDataSpace(y), i); - yp = hypre_StructVectorBoxData(y, i); + y_data_box = hypre_StructVectorGridDataBox(y, i); + yp = hypre_StructVectorGridData(y, i); - hypre_BoxGetSize(box, loop_size); + hypre_BoxGetSize(loop_box, loop_size); #define DEVICE_VAR is_device_ptr(yp) hypre_BoxLoop1Begin(hypre_StructVectorNDim(y), loop_size, - y_data_box, start, unit_stride, yi); + y_data_box, start, ustride, yi); { yp[yi] *= alpha; } @@ -57,5 +66,7 @@ hypre_StructScale( HYPRE_Complex alpha, #undef DEVICE_VAR } + hypre_BoxDestroy(loop_box); + return hypre_error_flag; } diff --git a/src/struct_mv/struct_stencil.c b/src/struct_mv/struct_stencil.c index 25bd74f1e0..ea683af816 100644 --- a/src/struct_mv/struct_stencil.c +++ b/src/struct_mv/struct_stencil.c @@ -14,7 +14,6 @@ #include "_hypre_struct_mv.h" /*-------------------------------------------------------------------------- - * hypre_StructStencilCreate *--------------------------------------------------------------------------*/ hypre_StructStencil * @@ -24,18 +23,24 @@ hypre_StructStencilCreate( HYPRE_Int dim, { hypre_StructStencil *stencil; + hypre_Index diag_offset; + HYPRE_Int diag_entry; + stencil = hypre_TAlloc(hypre_StructStencil, 1, HYPRE_MEMORY_HOST); - hypre_StructStencilShape(stencil) = shape; - hypre_StructStencilSize(stencil) = size; + hypre_StructStencilShape(stencil) = shape; + hypre_StructStencilSize(stencil) = size; hypre_StructStencilNDim(stencil) = dim; - hypre_StructStencilRefCount(stencil) = 1; + hypre_StructStencilRefCount(stencil) = 1; + + hypre_SetIndex(diag_offset, 0); + diag_entry = hypre_StructStencilOffsetEntry(stencil, diag_offset); + hypre_StructStencilDiagEntry(stencil) = diag_entry; return stencil; } /*-------------------------------------------------------------------------- - * hypre_StructStencilRef *--------------------------------------------------------------------------*/ hypre_StructStencil * @@ -47,7 +52,6 @@ hypre_StructStencilRef( hypre_StructStencil *stencil ) } /*-------------------------------------------------------------------------- - * hypre_StructStencilDestroy *--------------------------------------------------------------------------*/ HYPRE_Int @@ -67,48 +71,99 @@ hypre_StructStencilDestroy( hypre_StructStencil *stencil ) } /*-------------------------------------------------------------------------- - * hypre_StructStencilElementRank - * Returns the rank of the `stencil_element' in `stencil'. - * If the element is not found, a -1 is returned. *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_StructStencilElementRank( hypre_StructStencil *stencil, - hypre_Index stencil_element ) +hypre_StructStencilPrint( FILE *file, + hypre_StructStencil *stencil ) +{ + hypre_Index *stencil_shape = hypre_StructStencilShape(stencil); + HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); + HYPRE_Int ndim = hypre_StructStencilNDim(stencil); + HYPRE_Int i; + + hypre_fprintf(file, "%d\n", stencil_size); + for (i = 0; i < stencil_size; i++) + { + /* Print line of the form: "%d: (%d %d %d)\n" */ + hypre_fprintf(file, "%d: ", i); + hypre_IndexPrint(file, ndim, stencil_shape[i]); + hypre_fprintf(file, "\n"); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructStencilRead( FILE *file, + HYPRE_Int ndim, + hypre_StructStencil **stencil_ptr ) +{ + hypre_StructStencil *stencil; + + hypre_Index *stencil_shape; + HYPRE_Int stencil_size; + HYPRE_Int i, idummy; + + hypre_fscanf(file, "%d\n", &stencil_size); + stencil_shape = hypre_CTAlloc(hypre_Index, stencil_size, HYPRE_MEMORY_HOST); + for (i = 0; i < stencil_size; i++) + { + /* Read line of the form: "%d: %d %d %d\n" */ + hypre_fscanf(file, "%d: ", &idummy); + hypre_IndexRead(file, ndim, stencil_shape[i]); + hypre_fscanf(file, "\n"); + } + stencil = hypre_StructStencilCreate(ndim, stencil_size, stencil_shape); + + *stencil_ptr = stencil; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Returns the entry number of the 'stencil_offset' in 'stencil'. If the offset + * is not found, a -1 is returned. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructStencilOffsetEntry( hypre_StructStencil *stencil, + hypre_Index stencil_offset ) { hypre_Index *stencil_shape; - HYPRE_Int rank; + HYPRE_Int entry; HYPRE_Int i, ndim; - rank = -1; + entry = -1; ndim = hypre_StructStencilNDim(stencil); stencil_shape = hypre_StructStencilShape(stencil); for (i = 0; i < hypre_StructStencilSize(stencil); i++) { - if (hypre_IndexesEqual(stencil_shape[i], stencil_element, ndim)) + if (hypre_IndexesEqual(stencil_shape[i], stencil_offset, ndim)) { - rank = i; + entry = i; break; } } - return rank; + return entry; } /*-------------------------------------------------------------------------- - * hypre_StructStencilSymmetrize: - * Computes a new "symmetrized" stencil. - * - * An integer array called `symm_elements' is also set up. A non-negative - * value of `symm_elements[i]' indicates that the `i'th stencil element - * is a "symmetric element". That is, this stencil element is the - * transpose element of an element that is not a "symmetric element". + * Computes a new "symmetrized" stencil. An integer array called 'symm_entries' + * is also set up. A non-negative value j = symm_entries[i] indicates that the + * ith stencil entry is a "symmetric entry" of the jth stencil entry, that is, + * stencil entry i is the transpose of stencil entry j (and symm_entries[j] is + * assigned a negative value). *--------------------------------------------------------------------------*/ HYPRE_Int hypre_StructStencilSymmetrize( hypre_StructStencil *stencil, hypre_StructStencil **symm_stencil_ptr, - HYPRE_Int **symm_elements_ptr ) + HYPRE_Int **symm_entries_ptr ) { hypre_Index *stencil_shape = hypre_StructStencilShape(stencil); HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); @@ -116,39 +171,39 @@ hypre_StructStencilSymmetrize( hypre_StructStencil *stencil, hypre_StructStencil *symm_stencil; hypre_Index *symm_stencil_shape; HYPRE_Int symm_stencil_size; - HYPRE_Int *symm_elements; + HYPRE_Int *symm_entries; - HYPRE_Int no_symmetric_stencil_element, symmetric; + HYPRE_Int no_symmetric_stencil_entry, symmetric; HYPRE_Int i, j, d, ndim; /*------------------------------------------------------ - * Copy stencil elements into `symm_stencil_shape' + * Copy stencil entrys 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]); } /*------------------------------------------------------ - * Create symmetric stencil elements and `symm_elements' + * Create symmetric stencil entries and 'symm_entries' *------------------------------------------------------*/ - symm_elements = hypre_CTAlloc(HYPRE_Int, 2 * stencil_size, HYPRE_MEMORY_HOST); + symm_entries = hypre_CTAlloc(HYPRE_Int, 2 * stencil_size, HYPRE_MEMORY_HOST); for (i = 0; i < 2 * stencil_size; i++) { - symm_elements[i] = -1; + symm_entries[i] = -1; } symm_stencil_size = stencil_size; for (i = 0; i < stencil_size; i++) { - if (symm_elements[i] < 0) + if (symm_entries[i] < 0) { - /* note: start at i to handle "center" element correctly */ - no_symmetric_stencil_element = 1; + /* note: start at i to handle "center" entry correctly */ + no_symmetric_stencil_entry = 1; for (j = i; j < stencil_size; j++) { symmetric = 1; @@ -163,25 +218,24 @@ hypre_StructStencilSymmetrize( hypre_StructStencil *stencil, } if (symmetric) { - /* only "off-center" elements have symmetric entries */ + /* only "off-center" entries have symmetric entries */ if (i != j) { - symm_elements[j] = i; + symm_entries[j] = i; } - no_symmetric_stencil_element = 0; + no_symmetric_stencil_entry = 0; } } - if (no_symmetric_stencil_element) + if (no_symmetric_stencil_entry) { - /* add symmetric stencil element to `symm_stencil' */ + /* add symmetric stencil entry to 'symm_stencil' */ for (d = 0; d < ndim; d++) { hypre_IndexD(symm_stencil_shape[symm_stencil_size], d) = -hypre_IndexD(symm_stencil_shape[i], d); } - - symm_elements[symm_stencil_size] = i; + symm_entries[symm_stencil_size] = i; symm_stencil_size++; } } @@ -191,9 +245,8 @@ hypre_StructStencilSymmetrize( hypre_StructStencil *stencil, symm_stencil_size, symm_stencil_shape); - *symm_stencil_ptr = symm_stencil; - *symm_elements_ptr = symm_elements; + *symm_stencil_ptr = symm_stencil; + *symm_entries_ptr = symm_entries; return hypre_error_flag; } - diff --git a/src/struct_mv/struct_stencil.h b/src/struct_mv/struct_stencil.h index 8c74313c76..9a35694e33 100644 --- a/src/struct_mv/struct_stencil.h +++ b/src/struct_mv/struct_stencil.h @@ -20,12 +20,13 @@ 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_Index *shape; /* Description of a stencil's shape */ + HYPRE_Int size; /* Number of stencil coefficients */ + HYPRE_Int ndim; /* Number of dimensions */ + HYPRE_Int diag_entry; /* Index of the diagonal entry (zero offset) */ HYPRE_Int ref_count; + } hypre_StructStencil; /*-------------------------------------------------------------------------- @@ -35,7 +36,10 @@ typedef struct hypre_StructStencil_struct #define hypre_StructStencilShape(stencil) ((stencil) -> shape) #define hypre_StructStencilSize(stencil) ((stencil) -> size) #define hypre_StructStencilNDim(stencil) ((stencil) -> ndim) +#define hypre_StructStencilDiagEntry(stencil) ((stencil) -> diag_entry) #define hypre_StructStencilRefCount(stencil) ((stencil) -> ref_count) -#define hypre_StructStencilElement(stencil, i) hypre_StructStencilShape(stencil)[i] + +#define hypre_StructStencilOffset(stencil, i) \ +hypre_StructStencilShape(stencil)[i] #endif diff --git a/src/struct_mv/struct_stmatrix.c b/src/struct_mv/struct_stmatrix.c new file mode 100644 index 0000000000..d46521fd81 --- /dev/null +++ b/src/struct_mv/struct_stmatrix.c @@ -0,0 +1,806 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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" + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StIndexCopy( hypre_Index index1, + hypre_Index index2, + HYPRE_Int ndim ) +{ + HYPRE_Int d; + + for (d = 0; d < ndim; d++) + { + index2[d] = index1[d]; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StIndexNegate( hypre_Index index, + HYPRE_Int ndim ) +{ + HYPRE_Int d; + + for (d = 0; d < ndim; d++) + { + index[d] = -index[d]; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StIndexShift( hypre_Index index, + hypre_Index shift, + HYPRE_Int ndim ) +{ + HYPRE_Int d; + + for (d = 0; d < ndim; d++) + { + index[d] += shift[d]; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StIndexPrint( hypre_Index index, + char lchar, + char rchar, + HYPRE_Int ndim ) +{ + HYPRE_Int d; + + /* hypre_printf("(% d", index[0]);*/ + hypre_printf("%c% d", lchar, index[0]); + for (d = 1; d < ndim; d++) + { + hypre_printf(",% d", index[d]); + } + /* hypre_printf(")");*/ + hypre_printf("%c", rchar); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StTermCopy( hypre_StTerm *term1, + hypre_StTerm *term2, + HYPRE_Int ndim ) +{ + HYPRE_Int d; + + (term2->id) = (term1->id); + (term2->entry) = (term1->entry); + for (d = 0; d < ndim; d++) + { + (term2->shift[d]) = (term1->shift[d]); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StTermPrint( hypre_StTerm *term, + char *matnames, + HYPRE_Int ndim ) +{ + hypre_printf("%c%d", matnames[(term->id)], (term->entry)); + hypre_StIndexPrint((term->shift), '(', ')', ndim); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StCoeffCreate( HYPRE_Int nterms, + hypre_StCoeff **coeff_ptr ) +{ + hypre_StCoeff *coeff; + + coeff = hypre_CTAlloc(hypre_StCoeff, 1, HYPRE_MEMORY_HOST); + (coeff->nterms) = nterms; + (coeff->terms) = hypre_CTAlloc(hypre_StTerm, nterms, HYPRE_MEMORY_HOST); + (coeff->prev) = NULL; + (coeff->next) = NULL; + + *coeff_ptr = coeff; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StCoeffClone( hypre_StCoeff *coeff, + HYPRE_Int ndim, + hypre_StCoeff **clone_ptr ) +{ + hypre_StCoeff *clone, *lastclone; + HYPRE_Int nterms, t; + + *clone_ptr = lastclone = NULL; + + while (coeff != NULL) + { + nterms = (coeff->nterms); + hypre_StCoeffCreate(nterms, &clone); + for (t = 0; t < nterms; t++) + { + hypre_StTermCopy(&(coeff->terms[t]), &(clone->terms[t]), ndim); + } + if (lastclone == NULL) + { + *clone_ptr = clone; + } + else + { + (lastclone->next) = clone; + (clone->prev) = lastclone; + } + lastclone = clone; + + coeff = (coeff->next); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StCoeffDestroy( hypre_StCoeff *coeff ) +{ + hypre_StCoeff *next; + + while (coeff != NULL) + { + next = (coeff->next); + hypre_TFree(coeff->terms, HYPRE_MEMORY_HOST); + hypre_TFree(coeff, HYPRE_MEMORY_HOST); + coeff = next; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StCoeffShift( hypre_StCoeff *coeff, + hypre_Index shift, + HYPRE_Int ndim ) +{ + hypre_StTerm *terms; + HYPRE_Int nterms, t; + + while (coeff != NULL) + { + nterms = (coeff->nterms); + terms = (coeff->terms); + for (t = 0; t < nterms; t++) + { + hypre_StIndexShift((terms[t].shift), shift, ndim); + } + + coeff = (coeff->next); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StCoeffPush( hypre_StCoeff **stack_ptr, + hypre_StCoeff *coeff ) +{ + hypre_StCoeff *stack; + + /* Keep a reference to the current stack */ + stack = *stack_ptr; + /* Make coeff the head of the new stack */ + *stack_ptr = coeff; + + /* Modify prev and next pointers in the linked list */ + (coeff->prev) = NULL; + while ((coeff->next) != NULL) + { + coeff = (coeff->next); + } + (coeff->next) = stack; + if (stack != NULL) + { + (stack->prev) = coeff; + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StCoeffMult( hypre_StCoeff *Acoeff, + hypre_StCoeff *Bcoeff, + HYPRE_Int ndim, + hypre_StCoeff **Ccoeff_ptr ) +{ + hypre_StCoeff *Bcoeffhead = Bcoeff; + hypre_StCoeff *Ccoeff = NULL; + hypre_StCoeff *coeff; + HYPRE_Int Ci, i; + + while (Acoeff != NULL) + { + Bcoeff = Bcoeffhead; + + while (Bcoeff != NULL) + { + hypre_StCoeffCreate( ((Acoeff->nterms) + (Bcoeff->nterms)), &coeff); + Ci = 0; + for (i = 0; i < (Acoeff->nterms); i++) + { + hypre_StTermCopy(&(Acoeff->terms[i]), &(coeff->terms[Ci++]), ndim); + } + for (i = 0; i < (Bcoeff->nterms); i++) + { + hypre_StTermCopy(&(Bcoeff->terms[i]), &(coeff->terms[Ci++]), ndim); + } + hypre_StCoeffPush(&Ccoeff, coeff); + + Bcoeff = (Bcoeff->next); + } + + Acoeff = (Acoeff->next); + } + + *Ccoeff_ptr = Ccoeff; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StCoeffPrint( hypre_StCoeff *coeff, + char *matnames, + HYPRE_Int ndim ) +{ + HYPRE_Int i; + + while (coeff != NULL) + { + hypre_StTermPrint(&(coeff->terms[0]), matnames, ndim); + for (i = 1; i < (coeff->nterms); i++) + { + hypre_printf("*"); + hypre_StTermPrint(&(coeff->terms[i]), matnames, ndim); + } + coeff = (coeff->next); + if (coeff != NULL) + { + hypre_printf(" + "); + } + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StMatrixCreate( HYPRE_Int id, + HYPRE_Int size, + HYPRE_Int ndim, + hypre_StMatrix **matrix_ptr ) +{ + hypre_StMatrix *matrix; + HYPRE_Int d; + + matrix = hypre_TAlloc(hypre_StMatrix, 1, HYPRE_MEMORY_HOST); + + (matrix->id) = id; + (matrix->size) = size; + for (d = 0; d < ndim; d++) + { + (matrix->rmap[d]) = 1; + (matrix->dmap[d]) = 1; + } + (matrix->shapes) = hypre_CTAlloc(hypre_Index, size, HYPRE_MEMORY_HOST); + (matrix->coeffs) = hypre_CTAlloc(hypre_StCoeff *, size, HYPRE_MEMORY_HOST); + + *matrix_ptr = matrix; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StMatrixClone( hypre_StMatrix *matrix, + HYPRE_Int ndim, + hypre_StMatrix **mclone_ptr ) +{ + hypre_StMatrix *mclone; + HYPRE_Int entry; + + hypre_StMatrixCreate((matrix->id), (matrix->size), ndim, &mclone); + + hypre_StIndexCopy((matrix->rmap), (mclone->rmap), ndim); + hypre_StIndexCopy((matrix->dmap), (mclone->dmap), ndim); + + for (entry = 0; entry < (matrix->size); entry++) + { + hypre_StIndexCopy((matrix->shapes[entry]), (mclone->shapes[entry]), ndim); + hypre_StCoeffClone((matrix->coeffs[entry]), ndim, &(mclone->coeffs[entry])); + } + + *mclone_ptr = mclone; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StMatrixDestroy( hypre_StMatrix *matrix ) +{ + HYPRE_Int entry; + + for (entry = 0; entry < (matrix->size); entry++) + { + hypre_StCoeffDestroy(matrix->coeffs[entry]); + } + hypre_TFree(matrix->shapes, HYPRE_MEMORY_HOST); + hypre_TFree(matrix->coeffs, HYPRE_MEMORY_HOST); + hypre_TFree(matrix, HYPRE_MEMORY_HOST); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StMatrixTranspose( hypre_StMatrix *matrix, + HYPRE_Int ndim ) +{ + HYPRE_Int size = (matrix->size); + hypre_Index *shapes = (matrix->shapes); + hypre_StCoeff **coeffs = (matrix->coeffs); + hypre_Index tmap; + HYPRE_Int entry; + + for (entry = 0; entry < size; entry++) + { + hypre_StIndexNegate(shapes[entry], ndim); + hypre_StCoeffShift(coeffs[entry], shapes[entry], ndim); + } + /* Swap maps */ + hypre_StIndexCopy((matrix->rmap), tmap, ndim); + hypre_StIndexCopy((matrix->dmap), (matrix->rmap), ndim); + hypre_StIndexCopy(tmap, (matrix->dmap), ndim); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StBoxRank( hypre_Index i, + hypre_Index lo, + hypre_Index hi, + HYPRE_Int ndim ) +{ + HYPRE_Int rank, size, d; + + rank = 0; + size = 1; + for (d = 0; d < ndim; d++) + { + rank += (i[d] - lo[d]) * size; + size *= (hi[d] - lo[d] + 1); + } + + return rank; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StMatrixMatmat( hypre_StMatrix *A, + hypre_StMatrix *B, + HYPRE_Int Cid, + HYPRE_Int ndim, + hypre_StMatrix **C_ptr ) +{ + hypre_StMatrix *C, *Aclone, *Bclone; + hypre_StCoeff *Acoeff; + HYPRE_Int Aentry, Asize, *Ashape; + hypre_StCoeff *Bcoeff; + HYPRE_Int Bentry, Bsize, *Bshape; + hypre_StCoeff *Ccoeff; + HYPRE_Int Centry, Csize, *Crmap, *Cdmap; + hypre_StCoeff *shiftcoeff; + hypre_Index ABoff, ABi, ABlo, ABhi; + HYPRE_Int *ABbox, ABboxsize, ABii; + HYPRE_Int d, lo, hi, off, isrowstencil, indomain; + + /* Check domain and range compatibility */ + /* isrowstencil = {1, 0, -1, -2} -> is stencil type {row, col, either, error} */ + isrowstencil = -1; + for (d = 0; d < ndim; d++) + { + HYPRE_Int m1 = (A->rmap[d]); + HYPRE_Int m2 = (A->dmap[d]); + HYPRE_Int m3 = (B->dmap[d]); + + if (m2 != (B->rmap[d])) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Domain and range mismatch"); + return hypre_error_flag; + } + + if ((m1 >= m2) && (m1 % m2 == 0) && (m1 >= m3) && (m1 % m3 == 0)) + { + if (m1 != m3) + { + if (isrowstencil == 0) + { + isrowstencil = -2; + break; + } + else + { + /* Range grid is a subset of domain grid */ + isrowstencil = 1; + } + } + } + else if ((m3 >= m2) && (m3 % m2 == 0) && (m3 >= m1) && (m3 % m1 == 0)) + { + if (m3 != m1) + { + if (isrowstencil == 1) + { + isrowstencil = -2; + break; + } + else + { + /* Domain grid is a subset of range grid */ + isrowstencil = 0; + } + } + } + else + { + isrowstencil = -2; + break; + } + } + if (isrowstencil == -2) + { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, + "Invalid or incompatible matrices in product"); + return hypre_error_flag; + } + /* If either stencil type is okay, choose row type */ + if (isrowstencil == -1) + { + isrowstencil = 1; + } + + /* Clone original matrices, then reset A and B pointers */ + hypre_StMatrixClone(A, ndim, &Aclone); + hypre_StMatrixClone(B, ndim, &Bclone); + if (isrowstencil) + { + A = Aclone; + B = Bclone; + hypre_StMatrixTranspose(B, ndim); + } + else + { + A = Bclone; + hypre_StMatrixTranspose(A, ndim); + B = Aclone; + } + Crmap = (A->rmap); + Cdmap = (B->rmap); + + /* Initialize some things */ + Asize = (A->size); + Bsize = (B->size); + + /* Compute box size info */ + ABboxsize = 1; + for (d = 0; d < ndim; d++) + { + lo = hi = 0; + for (Aentry = 0; Aentry < Asize; Aentry++) + { + off = (A->shapes[Aentry][d]); + lo = hypre_min(lo, off); + hi = hypre_max(hi, off); + } + ABlo[d] = lo; + ABhi[d] = hi; + + lo = hi = 0; + for (Bentry = 0; Bentry < Bsize; Bentry++) + { + off = -(B->shapes[Bentry][d]); + lo = hypre_min(lo, off); + hi = hypre_max(hi, off); + } + ABlo[d] += lo; + ABhi[d] += hi; + + /* Adjust lo and hi based on domain grid */ + ABlo[d] /= Cdmap[d]; + ABhi[d] /= Cdmap[d]; + + ABboxsize *= (ABhi[d] - ABlo[d] + 1); + } + + /* Compute stenc(AB) = B^T stenc(A) */ + ABbox = hypre_TAlloc(HYPRE_Int, ABboxsize, HYPRE_MEMORY_HOST); + for (ABii = 0; ABii < ABboxsize; ABii++) + { + ABbox[ABii] = -1; + } + hypre_StMatrixCreate(Cid, ABboxsize, ndim, &C); + hypre_StIndexCopy(Crmap, (C->rmap), ndim); + hypre_StIndexCopy(Cdmap, (C->dmap), ndim); + Csize = 0; + for (Bentry = 0; Bentry < Bsize; Bentry++) + { + Bshape = (B->shapes[Bentry]); + Bcoeff = (B->coeffs[Bentry]); + hypre_StIndexNegate(Bshape, ndim); + + for (Aentry = 0; Aentry < Asize; Aentry++) + { + Ashape = (A->shapes[Aentry]); + Acoeff = (A->coeffs[Aentry]); + + hypre_StIndexCopy(Ashape, ABoff, ndim); + hypre_StIndexShift(ABoff, Bshape, ndim); + /* Check first that ABoff is in the domain grid */ + indomain = 1; + for (d = 0; d < ndim; d++) + { + if (ABoff[d] % Cdmap[d] != 0) + { + indomain = 0; + break; + } + /* Adjust index based on domain grid */ + ABi[d] = ABoff[d] / Cdmap[d]; + } + if (indomain) + { + hypre_StCoeffClone(Bcoeff, ndim, &shiftcoeff); + hypre_StCoeffShift(shiftcoeff, ABoff, ndim); + hypre_StCoeffMult(shiftcoeff, Acoeff, ndim, &Ccoeff); + hypre_StCoeffDestroy(shiftcoeff); + ABii = hypre_StBoxRank(ABi, ABlo, ABhi, ndim); + Centry = ABbox[ABii]; + if (Centry < 0) + { + Centry = Csize; + Csize++; + ABbox[ABii] = Centry; + hypre_StIndexCopy(ABoff, (C->shapes[Centry]), ndim); + } + hypre_StCoeffPush(&(C->coeffs[Centry]), Ccoeff); + } + } + } + (C->size) = Csize; + (C->shapes) = hypre_TReAlloc((C->shapes), hypre_Index, Csize, HYPRE_MEMORY_HOST); + (C->coeffs) = hypre_TReAlloc((C->coeffs), hypre_StCoeff *, Csize, HYPRE_MEMORY_HOST); + if (!isrowstencil) + { + /* An StMatrix always has a row stencil */ + hypre_StMatrixTranspose(C, ndim); + } + + /* Simplify? */ + + /* Clean up */ + hypre_StMatrixDestroy(Aclone); + hypre_StMatrixDestroy(Bclone); + hypre_TFree(ABbox, HYPRE_MEMORY_HOST); + + *C_ptr = C; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StMatrixMatmult( HYPRE_Int nmatrices, + hypre_StMatrix **matrices, + HYPRE_Int *transposes, + HYPRE_Int Cid, + HYPRE_Int ndim, + hypre_StMatrix **C_ptr ) +{ + hypre_StMatrix *A, *B, *C; + HYPRE_Int i; + + hypre_StMatrixClone(matrices[0], ndim, &C); + if (transposes[0]) + { + hypre_StMatrixTranspose(C, ndim); + } + for (i = 1; i < nmatrices; i++) + { + A = C; + hypre_StMatrixClone(matrices[i], ndim, &B); + if (transposes[i]) + { + hypre_StMatrixTranspose(B, ndim); + } + hypre_StMatrixMatmat(A, B, Cid, ndim, &C); + hypre_StMatrixDestroy(A); + hypre_StMatrixDestroy(B); + } + + *C_ptr = C; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StMatrixPrint( hypre_StMatrix *matrix, + char *matnames, + HYPRE_Int ndim ) +{ + HYPRE_Int entry, d; + + hypre_printf("id = %d\n", (matrix->id)); + hypre_printf("size = %d\n", (matrix->size)); + + hypre_printf("rmap = "); + hypre_StIndexPrint((matrix->rmap), '(', ')', ndim); + hypre_printf("\n"); + + hypre_printf("dmap = "); + hypre_StIndexPrint((matrix->dmap), '(', ')', ndim); + hypre_printf("\n"); + + for (entry = 0; entry < (matrix->size); entry++) + { + hypre_printf("X%02d", entry); + hypre_StIndexPrint((matrix->shapes[entry]), '[', ']', ndim); + hypre_printf(" = "); + hypre_StCoeffPrint((matrix->coeffs[entry]), matnames, ndim); + hypre_printf("\n"); + } + hypre_printf("\n"); + + /* If 1D or 2D, print the stencil shape */ + if (ndim < 3) + { + hypre_Index boxi, boxlo, boxhi; + HYPRE_Int *box, boxsize, off, ii; + + boxsize = 1; + for (d = 0; d < ndim; d++) + { + boxlo[d] = boxhi[d] = 0; + for (entry = 0; entry < (matrix->size); entry++) + { + off = (matrix->shapes[entry][d]); + boxlo[d] = hypre_min(boxlo[d], off); + boxhi[d] = hypre_max(boxhi[d], off); + } + boxsize *= (boxhi[d] - boxlo[d] + 1); + } + for (d = ndim; d < 2; d++) + { + boxlo[d] = boxhi[d] = 0; + } + + box = hypre_TAlloc(HYPRE_Int, boxsize, HYPRE_MEMORY_HOST); + for (ii = 0; ii < boxsize; ii++) + { + box[ii] = -1; + } + for (entry = 0; entry < (matrix->size); entry++) + { + ii = hypre_StBoxRank((matrix->shapes[entry]), boxlo, boxhi, ndim); + box[ii] = entry; + } + + for (boxi[1] = boxhi[1]; boxi[1] >= boxlo[1]; boxi[1]--) + { + for (boxi[0] = boxlo[0]; boxi[0] <= boxhi[0]; boxi[0]++) + { + ii = hypre_StBoxRank(boxi, boxlo, boxhi, ndim); + entry = box[ii]; + if (entry > -1) + { + hypre_printf(" X%02d", entry); + } + else + { + hypre_printf(" "); + } + } + hypre_printf("\n"); + } + hypre_printf("\n"); + + hypre_TFree(box, HYPRE_MEMORY_HOST); + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StMatrixNEntryCoeffs( hypre_StMatrix *matrix, + HYPRE_Int entry ) +{ + HYPRE_Int ncoeffs = 0; + hypre_StCoeff *coeff; + + coeff = matrix->coeffs[entry]; + while (coeff != NULL) + { + ncoeffs++; + coeff = (coeff->next); + } + + return ncoeffs; +} diff --git a/src/struct_mv/struct_stmatrix.h b/src/struct_mv/struct_stmatrix.h new file mode 100644 index 0000000000..53d102e087 --- /dev/null +++ b/src/struct_mv/struct_stmatrix.h @@ -0,0 +1,157 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_STRUCT_STMATRIX_HEADER +#define hypre_STRUCT_STMATRIX_HEADER + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +typedef struct +{ + HYPRE_Int id; /* Stencil matrix id for this term */ + HYPRE_Int entry; /* Stencil entry number */ + hypre_Index shift; /* Stencil shift from center */ + +} hypre_StTerm; + +typedef struct coeff_link +{ + HYPRE_Int nterms; /* Number of terms */ + hypre_StTerm *terms; /* Array of terms */ + + struct coeff_link *prev; + struct coeff_link *next; + +} hypre_StCoeff; + +typedef struct +{ + HYPRE_Int id; /* Matrix ID */ + HYPRE_Int size; /* Number of stencil entries */ + + hypre_Index rmap; /* Range map */ + hypre_Index dmap; /* Domain map */ + + hypre_Index *shapes; /* Offsets describing the stencil's shape */ + hypre_StCoeff **coeffs; /* Description of coefficients */ + +} hypre_StMatrix; + +/*-------------------------------------------------------------------------- + * Accessor macros: + *--------------------------------------------------------------------------*/ + +#define hypre_StTermID(term) ((term) -> id) +#define hypre_StTermEntry(term) ((term) -> entry) +#define hypre_StTermShift(term) ((term) -> shift) + +#define hypre_StCoeffNTerms(coeff) ((coeff) -> nterms) +#define hypre_StCoeffTerms(coeff) ((coeff) -> terms) +#define hypre_StCoeffTerm(coeff, t) &((coeff) -> terms[t]) +#define hypre_StCoeffPrev(coeff) ((coeff) -> prev) +#define hypre_StCoeffNext(coeff) ((coeff) -> next) + +#define hypre_StMatrixID(stmat) ((stmat) -> id) +#define hypre_StMatrixSize(stmat) ((stmat) -> size) +#define hypre_StMatrixRMap(stmat) ((stmat) -> rmap) +#define hypre_StMatrixDMap(stmat) ((stmat) -> dmap) +#define hypre_StMatrixShapes(stmat) ((stmat) -> shapes) +#define hypre_StMatrixOffset(stmat, e) ((stmat) -> shapes[e]) +#define hypre_StMatrixCoeffs(stmat) ((stmat) -> coeffs) +#define hypre_StMatrixCoeff(stmat, e) ((stmat) -> coeffs[e]) + +/*-------------------------------------------------------------------------- + * Prototypes: + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StIndexCopy( hypre_Index index1, + hypre_Index index2, + HYPRE_Int ndim ); +HYPRE_Int +hypre_StIndexNegate( hypre_Index index, + HYPRE_Int ndim ); +HYPRE_Int +hypre_StIndexShift( hypre_Index index, + hypre_Index shift, + HYPRE_Int ndim ); +HYPRE_Int +hypre_StIndexPrint( hypre_Index index, + char lchar, + char rchar, + HYPRE_Int ndim ); +HYPRE_Int +hypre_StTermCopy( hypre_StTerm *term1, + hypre_StTerm *term2, + HYPRE_Int ndim ); +HYPRE_Int +hypre_StTermPrint( hypre_StTerm *term, + char *matnames, + HYPRE_Int ndim ); +HYPRE_Int +hypre_StCoeffCreate( HYPRE_Int nterms, + hypre_StCoeff **coeff_ptr ); +HYPRE_Int +hypre_StCoeffClone( hypre_StCoeff *coeff, + HYPRE_Int ndim, + hypre_StCoeff **clone_ptr ); +HYPRE_Int +hypre_StCoeffDestroy( hypre_StCoeff *coeff ); +HYPRE_Int +hypre_StCoeffShift( hypre_StCoeff *coeff, + hypre_Index shift, + HYPRE_Int ndim ); +HYPRE_Int +hypre_StCoeffPush( hypre_StCoeff **stack_ptr, + hypre_StCoeff *coeff ); +HYPRE_Int +hypre_StCoeffMult( hypre_StCoeff *Acoeff, + hypre_StCoeff *Bcoeff, + HYPRE_Int ndim, + hypre_StCoeff **Ccoeff_ptr ); +HYPRE_Int +hypre_StCoeffPrint( hypre_StCoeff *coeff, + char *matnames, + HYPRE_Int ndim ); +HYPRE_Int +hypre_StMatrixCreate( HYPRE_Int id, + HYPRE_Int size, + HYPRE_Int ndim, + hypre_StMatrix **matrix_ptr ); +HYPRE_Int +hypre_StMatrixClone( hypre_StMatrix *matrix, + HYPRE_Int ndim, + hypre_StMatrix **mclone_ptr ); +HYPRE_Int +hypre_StMatrixDestroy( hypre_StMatrix *matrix ); +HYPRE_Int +hypre_StMatrixTranspose( hypre_StMatrix *matrix, + HYPRE_Int ndim ); +HYPRE_Int +hypre_StMatrixMatmat( hypre_StMatrix *A, + hypre_StMatrix *B, + HYPRE_Int Cid, + HYPRE_Int ndim, + hypre_StMatrix **C_ptr ); +HYPRE_Int +hypre_StMatrixMatmult( HYPRE_Int nmatrices, + hypre_StMatrix **matrices, + HYPRE_Int *transposes, + HYPRE_Int Cid, + HYPRE_Int ndim, + hypre_StMatrix **C_ptr ); +HYPRE_Int +hypre_StMatrixPrint( hypre_StMatrix *matrix, + char *matnames, + HYPRE_Int ndim ); + +HYPRE_Int +hypre_StMatrixNEntryCoeffs( hypre_StMatrix *matrix, + HYPRE_Int entry ); + +#endif diff --git a/src/struct_mv/struct_vector.c b/src/struct_mv/struct_vector.c index b0b6b6178c..8404c771af 100644 --- a/src/struct_mv/struct_vector.c +++ b/src/struct_mv/struct_vector.c @@ -14,6 +14,98 @@ #include "_hypre_struct_mv.h" #include "_hypre_struct_mv.hpp" +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorMapDataIndex( hypre_StructVector *vector, + hypre_Index dindex ) +{ + hypre_MapToCoarseIndex(dindex, NULL, + hypre_StructVectorStride(vector), hypre_StructVectorNDim(vector)); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorUnMapDataIndex( hypre_StructVector *vector, + hypre_Index dindex ) +{ + hypre_MapToFineIndex(dindex, NULL, + hypre_StructVectorStride(vector), hypre_StructVectorNDim(vector)); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorMapDataBox( hypre_StructVector *vector, + hypre_Box *dbox ) +{ + hypre_CoarsenBox(dbox, NULL, hypre_StructVectorStride(vector)); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorUnMapDataBox( hypre_StructVector *vector, + hypre_Box *dbox ) +{ + hypre_RefineBox(dbox, NULL, hypre_StructVectorStride(vector)); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorMapDataStride( hypre_StructVector *vector, + hypre_Index dstride ) +{ + hypre_StructVectorMapDataIndex(vector, dstride); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorUnMapDataStride( hypre_StructVector *vector, + hypre_Index dstride ) +{ + hypre_StructVectorUnMapDataIndex(vector, dstride); + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorMapCommInfo( hypre_StructVector *vector, + hypre_CommInfo *comm_info ) +{ + HYPRE_Int ndim = hypre_StructVectorNDim(vector); + + /* Map the comm_info boxes only if the vector does not have a unit stride */ + if (!hypre_IndexEqual(hypre_StructVectorStride(vector), 1, ndim)) + { + hypre_CommInfoCoarsen(comm_info, NULL, hypre_StructVectorStride(vector)); + } + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ @@ -29,7 +121,9 @@ hypre_StructVectorCreate( MPI_Comm comm, hypre_StructVectorComm(vector) = comm; hypre_StructGridRef(grid, &hypre_StructVectorGrid(vector)); - hypre_StructVectorDataAlloced(vector) = 1; + hypre_StructVectorSetStride(vector, NULL); /* Set default stride */ + hypre_StructVectorSetMemoryMode(vector, 0); + hypre_StructVectorDataAlloced(vector) = 0; hypre_StructVectorBGhostNotClear(vector) = 0; hypre_StructVectorRefCount(vector) = 1; @@ -41,6 +135,10 @@ hypre_StructVectorCreate( MPI_Comm comm, hypre_StructVectorMemoryLocation(vector) = hypre_HandleMemoryLocation(hypre_handle()); +#if defined(HYPRE_MIXED_PRECISION) + hypre_StructVectorPrecision(vector) = HYPRE_OBJECT_PRECISION; +#endif + return vector; } @@ -66,14 +164,16 @@ hypre_StructVectorDestroy( hypre_StructVector *vector ) hypre_StructVectorRefCount(vector) --; if (hypre_StructVectorRefCount(vector) == 0) { - if (hypre_StructVectorDataAlloced(vector)) + if (hypre_StructVectorDataAlloced(vector) == 1) { hypre_TFree(hypre_StructVectorData(vector), hypre_StructVectorMemoryLocation(vector)); } hypre_TFree(hypre_StructVectorDataIndices(vector), HYPRE_MEMORY_HOST); hypre_BoxArrayDestroy(hypre_StructVectorDataSpace(vector)); + hypre_TFree(hypre_StructVectorBoxnums(vector), HYPRE_MEMORY_HOST); hypre_StructGridDestroy(hypre_StructVectorGrid(vector)); + hypre_StructVectorForget(vector); hypre_TFree(vector, HYPRE_MEMORY_HOST); } } @@ -82,85 +182,438 @@ hypre_StructVectorDestroy( hypre_StructVector *vector ) } /*-------------------------------------------------------------------------- + * Set vector stride, nboxes, and boxnums. + * If stride == NULL, set default values. *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_StructVectorInitializeShell( hypre_StructVector *vector ) +hypre_StructVectorSetStride( hypre_StructVector *vector, + hypre_IndexRef stride ) { - HYPRE_Int ndim = hypre_StructVectorNDim(vector); - hypre_StructGrid *grid; + HYPRE_Int nboxes, *boxnums, ndim = hypre_StructVectorNDim(vector); - HYPRE_Int *num_ghost; + if (stride != NULL) + { + hypre_CopyToIndex(stride, ndim, hypre_StructVectorStride(vector)); + } + else + { + /* set default stride of 1 */ + hypre_SetIndex(hypre_StructVectorStride(vector), 1); + } + hypre_StructGridComputeBoxnums(hypre_StructVectorGrid(vector), 0, NULL, + hypre_StructVectorStride(vector), &nboxes, &boxnums); + hypre_TFree(hypre_StructVectorBoxnums(vector), HYPRE_MEMORY_HOST); + hypre_StructVectorNBoxes(vector) = nboxes; + hypre_StructVectorBoxnums(vector) = boxnums; - hypre_BoxArray *data_space; - hypre_BoxArray *boxes; - hypre_Box *box; - hypre_Box *data_box; + return hypre_error_flag; +} - HYPRE_Int *data_indices; - HYPRE_Int data_size; +/*-------------------------------------------------------------------------- + * Set memory management approach, where valid memory_mode values are: + * 0 - set data space exactly, allow restore (default) + * 1 - set data space exactly, always forget + * 2 - only grow the data space, always forget + *--------------------------------------------------------------------------*/ - HYPRE_Int i, d; +HYPRE_Int +hypre_StructVectorSetMemoryMode( hypre_StructVector *vector, + HYPRE_Int memory_mode ) +{ + hypre_StructVectorMemoryMode(vector) = memory_mode; - /*----------------------------------------------------------------------- - * Set up data_space - *-----------------------------------------------------------------------*/ + return hypre_error_flag; +} - grid = hypre_StructVectorGrid(vector); +/*-------------------------------------------------------------------------- + * This routine changes the base grid. Before the vector can actually be used, + * hypre_StructVectorResize() must be called with an appropriate data space. + *--------------------------------------------------------------------------*/ - if (hypre_StructVectorDataSpace(vector) == NULL) +HYPRE_Int +hypre_StructVectorRebase( hypre_StructVector *vector, + hypre_StructGrid *grid, + hypre_Index stride ) +{ + hypre_StructGrid *old_grid = hypre_StructVectorGrid(vector); + hypre_IndexRef old_stride = hypre_StructVectorStride(vector); + + if (hypre_StructVectorSaveGrid(vector) != NULL) { - num_ghost = hypre_StructVectorNumGhost(vector); + /* Call Restore or Forget first */ + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Rebase has already been called"); + return hypre_error_flag; + } - boxes = hypre_StructGridBoxes(grid); - data_space = hypre_BoxArrayCreate(hypre_BoxArraySize(boxes), ndim); + if (hypre_StructVectorMemoryMode(vector) == 2) + { + /* If stride is not greater than the current stride, keep the current base grid */ + if ( !hypre_IndexesGreaterEqual(stride, old_stride, hypre_StructVectorNDim(vector)) ) + { + return hypre_error_flag; + } + } + hypre_StructVectorSaveGrid(vector) = old_grid; + hypre_CopyIndex(old_stride, hypre_StructVectorSaveStride(vector)); + hypre_StructGridRef(grid, &hypre_StructVectorGrid(vector)); + hypre_StructVectorSetStride(vector, stride); - hypre_ForBoxI(i, boxes) + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * This computes a vector data space from a num_ghost array. The num_ghost + * array applies to the coarse index space indicated by stride. If the stride + * argument is NULL, a unit stride is used. If the num_ghost argument is NULL, + * the vector num_ghost is used. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorComputeDataSpace( hypre_StructVector *vector, + hypre_IndexRef stride, + HYPRE_Int *num_ghost, + hypre_BoxArray **data_space_ptr ) +{ + HYPRE_Int ndim = hypre_StructVectorNDim(vector); + hypre_StructGrid *grid = hypre_StructVectorGrid(vector); + hypre_BoxArray *data_space, *cdata_space; + hypre_Box *data_box; + HYPRE_Int i, d; + + if (num_ghost == NULL) + { + /* Use the vector num_ghost */ + num_ghost = hypre_StructVectorNumGhost(vector); + } + + /* Add ghost layers and map the data space */ + data_space = hypre_BoxArrayClone(hypre_StructGridBoxes(grid)); + hypre_ForBoxI(i, data_space) + { + data_box = hypre_BoxArrayBox(data_space, i); + if (stride != NULL) + { + hypre_CoarsenBox(data_box, NULL, stride); + } + for (d = 0; d < ndim; d++) { - box = hypre_BoxArrayBox(boxes, i); - data_box = hypre_BoxArrayBox(data_space, i); + hypre_BoxIMinD(data_box, d) -= num_ghost[2 * d]; + hypre_BoxIMaxD(data_box, d) += num_ghost[2 * d + 1]; + } + if (stride != NULL) + { + hypre_RefineBox(data_box, NULL, stride); + } + hypre_StructVectorMapDataBox(vector, data_box); + } + + /* Assume that the index space for the vector base grid (grid) is at least as + * fine as that of the saved base grid (call it sgrid). Rebase ensures this. + * In other words, since the vector's grid is given by both (grid, stride) + * and (sgrid, sstride), we assume that stride >= sstride. As a consequence, + * we can assume that all box ids in cdata_space (the current data space) are + * also in data_space, and that cdata_space has at most as many boxes as + * data_space. */ + cdata_space = hypre_StructVectorDataSpace(vector); + if ((hypre_StructVectorMemoryMode(vector) == 2) && (cdata_space != NULL)) + { + HYPRE_Int *cids = hypre_BoxArrayIDs(cdata_space); + HYPRE_Int *ids = hypre_BoxArrayIDs(data_space); + HYPRE_Int ci; - hypre_CopyBox(box, data_box); - for (d = 0; d < ndim; d++) + i = 0; + hypre_ForBoxI(ci, cdata_space) + { + while (ids[i] != cids[ci]) { - hypre_BoxIMinD(data_box, d) -= num_ghost[2 * d]; - hypre_BoxIMaxD(data_box, d) += num_ghost[2 * d + 1]; + i++; } + hypre_BoxGrowByBox(hypre_BoxArrayBox(data_space, i), + hypre_BoxArrayBox(cdata_space, ci)); } + } + + *data_space_ptr = data_space; + + return hypre_error_flag; +} - hypre_StructVectorDataSpace(vector) = data_space; +/*-------------------------------------------------------------------------- + * Check to see if a resize is needed + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorNeedResize( hypre_StructVector *vector, + hypre_BoxArray *data_space ) +{ + hypre_BoxArray *cdata_space = hypre_StructVectorDataSpace(vector); + hypre_IndexRef stride = hypre_StructVectorStride(vector); + hypre_IndexRef sstride = hypre_StructVectorSaveStride(vector); + HYPRE_Int ndim = hypre_StructVectorNDim(vector); + HYPRE_Int need_resize = 0; + + if (cdata_space == NULL) + { + /* resize if no current data space (cdata_space) */ + need_resize = 1; + } + else if ( !hypre_IndexesEqual(stride, sstride, ndim) ) + { + /* resize if stride and saved stride are different */ + need_resize = 1; + } + else if ( !hypre_BoxArrayInBoxArray(data_space, cdata_space) ) + { + /* resize if data_space is not contained in cdata_space */ + need_resize = 1; } - /*----------------------------------------------------------------------- - * Set up data_indices array and data_size - *-----------------------------------------------------------------------*/ + return need_resize; +} + +/*-------------------------------------------------------------------------- + * This routine takes new data space information and recomputes entries in the + * vector that depend on it (e.g., data_indices and data_size). The routine + * will also re-allocate the vector data if there was data to begin with. + * + * The boxes in the data_space argument may be larger (but not smaller) than + * those computed by the routine VectorComputeDataSpace(). + * + * This routine serves to both "size" and a "re-size" a vector, so it can also + * be used to set the initial data space information. + * + * RDF NOTE: I'm not sure if this works correctly when DataAlloced = 0 because + * of the check for it in the second 'if' below. Look at this later. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorResize( hypre_StructVector *vector, + hypre_BoxArray *data_space ) +{ + HYPRE_Complex *old_data = hypre_StructVectorData(vector); + hypre_BoxArray *old_data_space = hypre_StructVectorDataSpace(vector); + HYPRE_Int old_data_size = hypre_StructVectorDataSize(vector); + HYPRE_Int *old_data_indices = hypre_StructVectorDataIndices(vector); + HYPRE_Int ndim = hypre_StructVectorNDim(vector); + HYPRE_MemoryLocation memory_location = hypre_StructVectorMemoryLocation(vector); + + HYPRE_Complex *data = NULL; + HYPRE_Int data_size; + HYPRE_Int *data_indices; + + hypre_Box *data_box; + HYPRE_Int i; + + HYPRE_ANNOTATE_FUNC_BEGIN; - if (hypre_StructVectorDataIndices(vector) == NULL) + if (hypre_StructVectorSaveDataSpace(vector) != NULL) { - data_space = hypre_StructVectorDataSpace(vector); - data_indices = hypre_CTAlloc(HYPRE_Int, hypre_BoxArraySize(data_space), HYPRE_MEMORY_HOST); + /* Call Restore or Forget first */ + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Resize has already been called"); - data_size = 0; - hypre_ForBoxI(i, data_space) + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; + } + + /* Set up data_indices and data_size */ + data_indices = hypre_CTAlloc(HYPRE_Int, hypre_BoxArraySize(data_space), HYPRE_MEMORY_HOST); + data_size = 0; + hypre_ForBoxI(i, data_space) + { + data_box = hypre_BoxArrayBox(data_space, i); + + data_indices[i] = data_size; + data_size += hypre_BoxVolume(data_box); + } + + /* Copy old_data to data and save old data; only do this if both the old data + * space and old data have been initialized */ + if ( (old_data_space != NULL) && (hypre_StructVectorDataAlloced(vector)) ) + { + /* If Rebase() has not been called, mimic it by saving a copy of grid/stride */ + if (hypre_StructVectorSaveGrid(vector) == NULL) + { + hypre_StructGridRef(hypre_StructVectorGrid(vector), &hypre_StructVectorSaveGrid(vector)); + hypre_CopyIndex(hypre_StructVectorStride(vector), hypre_StructVectorSaveStride(vector)); + } + + /* This will return NULL if data_size = 0 */ + data = hypre_CTAlloc(HYPRE_Complex, data_size, memory_location); + + /* Copy old_data to data */ + if ((old_data != NULL) && (data != NULL)) + { + /* At this point we have either called or mimiced Rebase(), so the + * saved grid corresponds to the old data */ + hypre_StructDataCopy(old_data, old_data_space, data, data_space, ndim, 1); + } + + /* Free up some things */ + if (hypre_StructVectorDataAlloced(vector) == 1) + { + hypre_TFree(old_data, memory_location); + } + hypre_TFree(old_data_indices, HYPRE_MEMORY_HOST); + + /* Save old data */ + hypre_StructVectorSaveData(vector) = old_data; + hypre_StructVectorSaveDataSpace(vector) = old_data_space; + hypre_StructVectorSaveDataSize(vector) = old_data_size; + } + else if (old_data_space != NULL) + { + hypre_TFree(old_data_indices, HYPRE_MEMORY_HOST); + hypre_BoxArrayDestroy(old_data_space); + } + + hypre_StructVectorData(vector) = data; + hypre_StructVectorDataSpace(vector) = data_space; + hypre_StructVectorDataSize(vector) = data_size; + hypre_StructVectorDataIndices(vector) = data_indices; + + /* For (MemoryMode > 0), don't restore */ + if (hypre_StructVectorMemoryMode(vector) > 0) + { + hypre_StructVectorForget(vector); + } + + HYPRE_ANNOTATE_FUNC_END; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * This routine restores the old data and data space. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorRestore( hypre_StructVector *vector ) +{ + hypre_StructGrid *old_grid = hypre_StructVectorGrid(vector); + HYPRE_Complex *old_data = hypre_StructVectorData(vector); + hypre_BoxArray *old_data_space = hypre_StructVectorDataSpace(vector); + hypre_StructGrid *grid = hypre_StructVectorSaveGrid(vector); + HYPRE_Complex *data = hypre_StructVectorSaveData(vector); + hypre_IndexRef stride = hypre_StructVectorSaveStride(vector); + hypre_BoxArray *data_space = hypre_StructVectorSaveDataSpace(vector); + HYPRE_Int data_size = hypre_StructVectorSaveDataSize(vector); + HYPRE_MemoryLocation memory_location = hypre_StructVectorMemoryLocation(vector); + + HYPRE_ANNOTATE_FUNC_BEGIN; + + if (data_space != NULL) + { + HYPRE_Int ndim = hypre_StructVectorNDim(vector); + + /* Move old_data to data */ + if (hypre_StructVectorDataAlloced(vector) == 1) + { + data = hypre_CTAlloc(HYPRE_Complex, data_size, memory_location); + } + hypre_StructDataCopy(old_data, old_data_space, data, data_space, ndim, 1); + hypre_TFree(old_data, memory_location); + + /* Reset certain fields to enable the Resize call below */ + hypre_StructVectorSaveGrid(vector) = NULL; + hypre_StructVectorSaveData(vector) = NULL; + hypre_StructVectorSaveDataSpace(vector) = NULL; + hypre_StructVectorSaveDataSize(vector) = 0; + + /* Set the grid and boxnums */ + hypre_StructGridDestroy(old_grid); + hypre_StructVectorGrid(vector) = grid; + hypre_StructVectorSetStride(vector, stride); + + /* Set the data space and recompute data_indices, etc. */ { - data_box = hypre_BoxArrayBox(data_space, i); + HYPRE_Int data_alloced = hypre_StructVectorDataAlloced(vector); - data_indices[i] = data_size; - data_size += hypre_BoxVolume(data_box); + hypre_StructVectorDataAlloced(vector) = 0; + hypre_StructVectorResize(vector, data_space); + hypre_StructVectorDataAlloced(vector) = data_alloced; + hypre_StructVectorForget(vector); } - hypre_StructVectorDataIndices(vector) = data_indices; + /* Set the data pointer */ + hypre_StructVectorData(vector) = data; + } + else if ((old_grid != NULL) && (grid != NULL)) + { + /* Only a Rebase was called */ + hypre_StructVectorSaveGrid(vector) = NULL; + hypre_StructGridDestroy(old_grid); + hypre_StructVectorGrid(vector) = grid; + hypre_StructVectorSetStride(vector, stride); + } + + HYPRE_ANNOTATE_FUNC_END; - hypre_StructVectorDataSize(vector) = data_size; + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * This routine will clear data needed to do a Restore + * + * Note: If InitializeData() was used to set the original data pointer, the + * pointer will be lost after a Resize()-and-Forget() and more memory will be + * used than is needed. Consider removing InitializeData() usage altogether. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorForget( hypre_StructVector *vector ) +{ + hypre_StructGrid *save_grid = hypre_StructVectorSaveGrid(vector); + hypre_BoxArray *save_data_space = hypre_StructVectorSaveDataSpace(vector); + if (save_data_space != NULL) + { + /* Only forget a Rebase if the companion Resize was also called */ + if (save_grid != NULL) + { + hypre_StructGridDestroy(save_grid); + hypre_StructVectorSaveGrid(vector) = NULL; + } + + hypre_BoxArrayDestroy(save_data_space); + hypre_StructVectorSaveData(vector) = NULL; + hypre_StructVectorSaveDataSpace(vector) = NULL; + hypre_StructVectorSaveDataSize(vector) = 0; } + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_StructVectorInitializeShell( hypre_StructVector *vector ) +{ + hypre_StructGrid *grid = hypre_StructVectorGrid(vector); + hypre_BoxArray *data_space; + /*----------------------------------------------------------------------- * Set total number of nonzero coefficients *-----------------------------------------------------------------------*/ hypre_StructVectorGlobalSize(vector) = hypre_StructGridGlobalSize(grid); + /*----------------------------------------------------------------------- + * Set up information related to the data space and data storage + *-----------------------------------------------------------------------*/ + + if (hypre_StructVectorDataSpace(vector) == NULL) + { + hypre_StructVectorComputeDataSpace(vector, NULL, NULL, &data_space); + hypre_StructVectorResize(vector, data_space); + hypre_StructVectorForget(vector); + } + + /*----------------------------------------------------------------------- + * Return + *-----------------------------------------------------------------------*/ + return hypre_error_flag; } @@ -169,10 +622,10 @@ hypre_StructVectorInitializeShell( hypre_StructVector *vector ) HYPRE_Int hypre_StructVectorInitializeData( hypre_StructVector *vector, - HYPRE_Complex *data) + HYPRE_Complex *data ) { hypre_StructVectorData(vector) = data; - hypre_StructVectorDataAlloced(vector) = 0; + hypre_StructVectorDataAlloced(vector) = 2; return hypre_error_flag; } @@ -181,14 +634,26 @@ hypre_StructVectorInitializeData( hypre_StructVector *vector, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_StructVectorInitialize( hypre_StructVector *vector ) +hypre_StructVectorInitialize( hypre_StructVector *vector, + HYPRE_Int zero_init ) { HYPRE_Complex *data; hypre_StructVectorInitializeShell(vector); - data = hypre_CTAlloc(HYPRE_Complex, hypre_StructVectorDataSize(vector), - hypre_StructVectorMemoryLocation(vector)); + if (zero_init) + { + data = hypre_CTAlloc(HYPRE_Complex, + hypre_StructVectorDataSize(vector), + hypre_StructVectorMemoryLocation(vector)); + } + else + { + /* TODO (VPM): TAlloc leads to regressions on TEST_struct/emptyproc */ + data = hypre_CTAlloc(HYPRE_Complex, + hypre_StructVectorDataSize(vector), + hypre_StructVectorMemoryLocation(vector)); + } hypre_StructVectorInitializeData(vector, data); hypre_StructVectorDataAlloced(vector) = 1; @@ -260,6 +725,7 @@ hypre_StructVectorSetValues( hypre_StructVector *vector, #define DEVICE_VAR is_device_ptr(vecp,values) hypre_LoopBegin(1, k) { + HYPRE_UNUSED_VAR(k); *vecp += *values; } hypre_LoopEnd() @@ -367,7 +833,7 @@ hypre_StructVectorSetBoxValues( hypre_StructVector *vector, hypre_SetIndex(data_stride, 1); int_box = hypre_BoxCreate(hypre_StructVectorNDim(vector)); - dval_box = hypre_BoxDuplicate(value_box); + dval_box = hypre_BoxClone(value_box); hypre_SetIndex(dval_stride, 1); for (i = istart; i < istop; i++) @@ -387,7 +853,7 @@ hypre_StructVectorSetBoxValues( hypre_StructVector *vector, hypre_BoxGetSize(int_box, loop_size); -#define DEVICE_VAR is_device_ptr(datap,values) +#define DEVICE_VAR is_device_ptr(datap, values) if (action > 0) { hypre_BoxLoop2Begin(hypre_StructVectorNDim(vector), loop_size, @@ -481,6 +947,7 @@ hypre_StructVectorClearValues( hypre_StructVector *vector, #define DEVICE_VAR is_device_ptr(vecp) hypre_LoopBegin(1, k) { + HYPRE_UNUSED_VAR(k); *vecp = 0.0; } hypre_LoopEnd() @@ -595,24 +1062,27 @@ hypre_StructVectorClearAllValues( hypre_StructVector *vector ) { HYPRE_Complex *data = hypre_StructVectorData(vector); HYPRE_Int data_size = hypre_StructVectorDataSize(vector); - hypre_Index imin, imax; - hypre_Box *box; + HYPRE_Int i; - box = hypre_BoxCreate(1); - hypre_IndexD(imin, 0) = 1; - hypre_IndexD(imax, 0) = data_size; - hypre_BoxSetExtents(box, imin, imax); - -#define DEVICE_VAR is_device_ptr(data) - hypre_BoxLoop1Begin(1, imax, - box, imin, imin, datai); +#if defined(HYPRE_USING_GPU) + HYPRE_MemoryLocation memory_location = hypre_StructVectorMemoryLocation(vector); + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) { - data[datai] = 0.0; + hypre_Memset((void*) data, 0.0, + (size_t) (data_size) * sizeof(HYPRE_Complex), + memory_location); + } + else +#endif + { +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE +#endif + for (i = 0; i < data_size; i++) + { + data[i] = 0.0; + } } - hypre_BoxLoop1End(datai); -#undef DEVICE_VAR - - hypre_BoxDestroy(box); return hypre_error_flag; } @@ -673,170 +1143,139 @@ hypre_StructVectorAssemble( hypre_StructVector *vector ) } /*-------------------------------------------------------------------------- - * copies data from x to y - * y has its own data array, so this is a deep copy in that sense. - * The grid and other size information are not copied - they are - * assumed to have already been set up to be consistent. *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_StructVectorCopy( hypre_StructVector *x, - hypre_StructVector *y ) +hypre_StructVectorSetConstantValues( hypre_StructVector *vector, + HYPRE_Complex value ) { - hypre_Box *x_data_box; + HYPRE_Int ndim = hypre_StructVectorNDim(vector); - HYPRE_Complex *xp, *yp; + hypre_Box *dbox; + HYPRE_Complex *vp; - hypre_BoxArray *boxes; - hypre_Box *box; + HYPRE_Int nboxes; + hypre_Box *loop_box; hypre_Index loop_size; hypre_IndexRef start; - hypre_Index unit_stride; - + hypre_Index ustride; HYPRE_Int i; - /*----------------------------------------------------------------------- - * Set the vector coefficients - *-----------------------------------------------------------------------*/ + nboxes = hypre_StructVectorNBoxes(vector); - hypre_SetIndex(unit_stride, 1); + loop_box = hypre_BoxCreate(ndim); + hypre_SetIndex(ustride, 1); - boxes = hypre_StructGridBoxes( hypre_StructVectorGrid(x) ); - hypre_ForBoxI(i, boxes) + for (i = 0; i < nboxes; i++) { - box = hypre_BoxArrayBox(boxes, i); - start = hypre_BoxIMin(box); + hypre_StructVectorGridBoxCopy(vector, i, loop_box); + start = hypre_BoxIMin(loop_box); - x_data_box = - hypre_BoxArrayBox(hypre_StructVectorDataSpace(x), i); - xp = hypre_StructVectorBoxData(x, i); - yp = hypre_StructVectorBoxData(y, i); + dbox = hypre_StructVectorGridDataBox(vector, i); + vp = hypre_StructVectorGridData(vector, i); - hypre_BoxGetSize(box, loop_size); + hypre_BoxGetSize(loop_box, loop_size); -#define DEVICE_VAR is_device_ptr(yp,xp) - hypre_BoxLoop1Begin(hypre_StructVectorNDim(x), loop_size, - x_data_box, start, unit_stride, vi); +#define DEVICE_VAR is_device_ptr(vp) + hypre_BoxLoop1Begin(ndim, loop_size, dbox, start, ustride, vi); { - yp[vi] = xp[vi]; + vp[vi] = value; } hypre_BoxLoop1End(vi); #undef DEVICE_VAR } + hypre_BoxDestroy(loop_box); + return hypre_error_flag; } /*-------------------------------------------------------------------------- + * hypre_StructVectorSetRandomValues + * + * builds a StructVector of values randomly distributed between -1.0 and +1.0 *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_StructVectorSetConstantValues( hypre_StructVector *vector, - HYPRE_Complex values ) +hypre_StructVectorSetRandomValues( hypre_StructVector *vector, + HYPRE_Int seed ) { - hypre_Box *v_data_box; + HYPRE_Int ndim = hypre_StructVectorNDim(vector); + hypre_Box *dbox; HYPRE_Complex *vp; - hypre_BoxArray *boxes; - hypre_Box *box; + HYPRE_Int nboxes; + hypre_Box *loop_box; hypre_Index loop_size; hypre_IndexRef start; - hypre_Index unit_stride; - + hypre_Index ustride; HYPRE_Int i; - /*----------------------------------------------------------------------- - * Set the vector coefficients - *-----------------------------------------------------------------------*/ + hypre_SeedRand(seed); - hypre_SetIndex(unit_stride, 1); + nboxes = hypre_StructVectorNBoxes(vector); - boxes = hypre_StructGridBoxes(hypre_StructVectorGrid(vector)); - hypre_ForBoxI(i, boxes) + loop_box = hypre_BoxCreate(ndim); + hypre_SetIndex(ustride, 1); + + for (i = 0; i < nboxes; i++) { - box = hypre_BoxArrayBox(boxes, i); - start = hypre_BoxIMin(box); + hypre_StructVectorGridBoxCopy(vector, i, loop_box); + start = hypre_BoxIMin(loop_box); - v_data_box = - hypre_BoxArrayBox(hypre_StructVectorDataSpace(vector), i); - vp = hypre_StructVectorBoxData(vector, i); + dbox = hypre_StructVectorGridDataBox(vector, i); + vp = hypre_StructVectorGridData(vector, i); - hypre_BoxGetSize(box, loop_size); + hypre_BoxGetSize(loop_box, loop_size); -#define DEVICE_VAR is_device_ptr(vp) - hypre_BoxLoop1Begin(hypre_StructVectorNDim(vector), loop_size, - v_data_box, start, unit_stride, vi); + /* 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++) { - vp[vi] = values; + loop_n *= loop_size[ii]; } - hypre_BoxLoop1End(vi); -#undef DEVICE_VAR - } - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - * Takes a function pointer of the form: HYPRE_Complex f(i,j,k) - * RDF: This function doesn't appear to be used anywhere. - *--------------------------------------------------------------------------*/ - -/* ONLY3D */ - -HYPRE_Int -hypre_StructVectorSetFunctionValues( hypre_StructVector *vector, - HYPRE_Complex (*fcn)(HYPRE_Int, HYPRE_Int, HYPRE_Int) ) -{ - hypre_Box *v_data_box; - - HYPRE_Complex *vp; - - hypre_BoxArray *boxes; - hypre_Box *box; - hypre_Index loop_size; - hypre_IndexRef start; - hypre_Index unit_stride; - - HYPRE_Int b, i, j, k; - - /*----------------------------------------------------------------------- - * Set the vector coefficients - *-----------------------------------------------------------------------*/ - hypre_SetIndex(unit_stride, 1); + 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); - boxes = hypre_StructGridBoxes(hypre_StructVectorGrid(vector)); - hypre_ForBoxI(b, boxes) - { - box = hypre_BoxArrayBox(boxes, b); - start = hypre_BoxIMin(box); - - v_data_box = - hypre_BoxArrayBox(hypre_StructVectorDataSpace(vector), b); - vp = hypre_StructVectorBoxData(vector, b); - - hypre_BoxGetSize(box, loop_size); - - i = hypre_IndexD(start, 0); - j = hypre_IndexD(start, 1); - k = hypre_IndexD(start, 2); + 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 - hypre_SerialBoxLoop1Begin(hypre_StructVectorNDim(vector), loop_size, - v_data_box, start, unit_stride, vi) +#define DEVICE_VAR is_device_ptr(vp, rand_device) + hypre_BoxLoop1Begin(hypre_StructVectorNDim(vector), loop_size, + dbox, start, ustride, vi); { - vp[vi] = fcn(i, j, k); - i++; - j++; - k++; +#if defined(HYPRE_USING_GPU) + vp[vi] = rand_device[idx]; +#else + vp[vi] = 2.0 * hypre_Rand() - 1.0; +#endif } - hypre_SerialBoxLoop1End(vi) + hypre_BoxLoop1End(vi); +#undef DEVICE_VAR + +#if defined(HYPRE_USING_GPU) + hypre_TFree(rand_device, HYPRE_MEMORY_DEVICE); + hypre_TFree(rand_host, HYPRE_MEMORY_HOST); +#endif } + hypre_BoxDestroy(loop_box); + return hypre_error_flag; } /*-------------------------------------------------------------------------- + * RDF TODO: Extend to allow non-unitary stride *--------------------------------------------------------------------------*/ HYPRE_Int @@ -853,7 +1292,7 @@ hypre_StructVectorClearGhostValues( hypre_StructVector *vector ) hypre_Box *diff_box; hypre_Index loop_size; hypre_IndexRef start; - hypre_Index unit_stride; + hypre_Index ustride; HYPRE_Int i, j; @@ -861,7 +1300,7 @@ hypre_StructVectorClearGhostValues( hypre_StructVector *vector ) * Set the vector coefficients *-----------------------------------------------------------------------*/ - hypre_SetIndex(unit_stride, 1); + hypre_SetIndex(ustride, 1); boxes = hypre_StructGridBoxes(hypre_StructVectorGrid(vector)); diff_boxes = hypre_BoxArrayCreate(0, ndim); @@ -882,12 +1321,12 @@ hypre_StructVectorClearGhostValues( hypre_StructVector *vector ) #define DEVICE_VAR is_device_ptr(vp) hypre_BoxLoop1Begin(hypre_StructVectorNDim(vector), loop_size, - v_data_box, start, unit_stride, vi); + v_data_box, start, ustride, vi); { vp[vi] = 0.0; } - hypre_BoxLoop1End(vi); #undef DEVICE_VAR + hypre_BoxLoop1End(vi); } } hypre_BoxArrayDestroy(diff_boxes); @@ -896,7 +1335,7 @@ hypre_StructVectorClearGhostValues( hypre_StructVector *vector ) } /*-------------------------------------------------------------------------- - * clears vector values on the physical boundaries + * RDF TODO: Extend to allow non-unitary stride *--------------------------------------------------------------------------*/ HYPRE_Int @@ -952,6 +1391,7 @@ hypre_StructVectorClearBoundGhostValues( hypre_StructVector *vector, bbox = hypre_BoxArrayBox(boundary_boxes, i2); hypre_BoxGetSize(bbox, loop_size); start = hypre_BoxIMin(bbox); + #define DEVICE_VAR is_device_ptr(vp) hypre_BoxLoop1Begin(hypre_StructVectorNDim(vector), loop_size, v_data_box, start, stride, vi); @@ -976,7 +1416,8 @@ hypre_StructVectorClearBoundGhostValues( hypre_StructVector *vector, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_StructVectorScaleValues( hypre_StructVector *vector, HYPRE_Complex factor ) +hypre_StructVectorScaleValues( hypre_StructVector *vector, + HYPRE_Complex factor ) { HYPRE_Complex *data; @@ -1031,7 +1472,9 @@ hypre_StructVectorGetMigrateCommPkg( hypre_StructVector *from_vector, hypre_CommPkgCreate(comm_info, hypre_StructVectorDataSpace(from_vector), hypre_StructVectorDataSpace(to_vector), 1, NULL, 0, - hypre_StructVectorComm(from_vector), &comm_pkg); + hypre_StructVectorComm(from_vector), + hypre_StructVectorMemoryLocation(from_vector), + &comm_pkg); hypre_CommInfoDestroy(comm_info); /* is this correct for periodic? */ @@ -1043,26 +1486,27 @@ hypre_StructVectorGetMigrateCommPkg( hypre_StructVector *from_vector, HYPRE_Int hypre_StructVectorMigrate( hypre_CommPkg *comm_pkg, - hypre_StructVector *from_vector, - hypre_StructVector *to_vector ) + hypre_StructVector *fr_vector, + hypre_StructVector *to_vector ) { - hypre_CommHandle *comm_handle; + hypre_CommHandle *comm_handle; + HYPRE_Complex *fr_data = hypre_StructVectorData(fr_vector); + HYPRE_Complex *to_data = hypre_StructVectorData(to_vector); /*----------------------------------------------------------------------- * Migrate the vector data *-----------------------------------------------------------------------*/ - hypre_InitializeCommunication(comm_pkg, - hypre_StructVectorData(from_vector), - hypre_StructVectorData(to_vector), 0, 0, - &comm_handle); - hypre_FinalizeCommunication(comm_handle); + hypre_StructCommunicationInitialize(comm_pkg, &fr_data, &to_data, 0, 0, &comm_handle); + hypre_StructCommunicationFinalize(comm_handle); return hypre_error_flag; } /*-------------------------------------------------------------------------- * hypre_StructVectorPrintData + * + * RDF TODO: Update to allow for non-unitary stride? *--------------------------------------------------------------------------*/ HYPRE_Int @@ -1070,15 +1514,19 @@ 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; + 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_Int num_values = 1; + HYPRE_Int value_ids[1] = {0}; + + hypre_BoxArray *boxes; + HYPRE_Complex *h_data; /* Allocate/Point to data on the host memory */ if (hypre_GetActualMemLocation(memory_location) != hypre_MEMORY_HOST) @@ -1096,7 +1544,7 @@ hypre_StructVectorPrintData( FILE *file, boxes = (all) ? data_space : grid_boxes; /* Print data to file */ - hypre_PrintBoxArrayData(file, boxes, data_space, 1, ndim, h_data); + hypre_PrintBoxArrayData(file, ndim, boxes, data_space, num_values, value_ids, h_data); /* Free memory */ if (hypre_GetActualMemLocation(memory_location) != hypre_MEMORY_HOST) @@ -1109,42 +1557,66 @@ hypre_StructVectorPrintData( FILE *file, /*-------------------------------------------------------------------------- * hypre_StructVectorReadData + * + * RDF TODO: Update to allow for non-unitary stride? *--------------------------------------------------------------------------*/ 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; + HYPRE_Int ndim = hypre_StructVectorNDim(vector); + hypre_StructGrid *grid = hypre_StructVectorGrid(vector); + hypre_BoxArray *boxes = hypre_StructGridBoxes(grid); - /* Allocate/Point to data on the host memory */ - if (hypre_GetActualMemLocation(memory_location) != hypre_MEMORY_HOST) + HYPRE_MemoryLocation memory_location = hypre_StructVectorMemoryLocation(vector); +#if defined(HYPRE_USING_GPU) + HYPRE_ExecutionPolicy exec_policy = hypre_GetExecPolicy1(memory_location); +#endif + + hypre_Box *box; + HYPRE_Int num_values; + HYPRE_Complex *h_values, *values; + HYPRE_Int *value_ids; + HYPRE_Int i, vi; + + /* Read data from file */ + hypre_fscanf(file, "\nData:\n"); + hypre_ReadBoxArrayData(file, ndim, boxes, &num_values, &value_ids, &h_values); + + /* Move data to the device memory if necessary and free host data */ +#if defined(HYPRE_USING_GPU) + if (exec_policy == HYPRE_EXEC_DEVICE) { - h_data = hypre_CTAlloc(HYPRE_Complex, data_size, HYPRE_MEMORY_HOST); + vi = hypre_BoxArrayVolume(boxes) * num_values; + values = hypre_TAlloc(HYPRE_Complex, vi, memory_location); + hypre_TMemcpy(values, h_values, HYPRE_Complex, vi, + memory_location, HYPRE_MEMORY_HOST); + hypre_TFree(h_values, HYPRE_MEMORY_HOST); } else +#endif { - h_data = data; + values = h_values; } - /* 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) + /* Set vector values */ + hypre_StructVectorInitialize(vector, 1); + vi = 0; + hypre_ForBoxI(i, boxes) { - hypre_TMemcpy(data, h_data, HYPRE_Complex, data_size, - memory_location, HYPRE_MEMORY_HOST); - hypre_TFree(h_data, HYPRE_MEMORY_HOST); + box = hypre_BoxArrayBox(boxes, i); + HYPRE_StructVectorSetBoxValues(vector, + hypre_BoxIMin(box), + hypre_BoxIMax(box), + &values[vi]); + vi += hypre_BoxVolume(box); } + /* Clean up */ + hypre_TFree(value_ids, HYPRE_MEMORY_HOST); + hypre_TFree(values, memory_location); + return hypre_error_flag; } @@ -1251,15 +1723,13 @@ hypre_StructVectorRead( MPI_Comm comm, * Initialize the vector *----------------------------------------*/ - vector = hypre_StructVectorCreate(comm, grid); - hypre_StructVectorSetNumGhost(vector, num_ghost); - hypre_StructVectorInitialize(vector); + HYPRE_StructVectorCreate(comm, grid, &vector); + hypre_StructVectorSetNumGhost(vector, num_ghost); // RDF Is this needed? /*---------------------------------------- * Read data *----------------------------------------*/ - hypre_fscanf(file, "\nData:\n"); hypre_StructVectorReadData(file, vector); /*---------------------------------------- @@ -1269,9 +1739,11 @@ hypre_StructVectorRead( MPI_Comm comm, hypre_StructVectorAssemble(vector); /*---------------------------------------- - * Close file + * Clean up and close file *----------------------------------------*/ + HYPRE_StructGridDestroy(grid); + fclose(file); return vector; @@ -1279,110 +1751,118 @@ hypre_StructVectorRead( MPI_Comm comm, /*-------------------------------------------------------------------------- * The following is used only as a debugging aid. - * - * 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) +// TODO (VPM): Fix for GPU support +#if 0 +HYPRE_Int +hypre_StructVectorMaxValue( hypre_StructVector *vector, + HYPRE_Real *max_value, HYPRE_Int *max_index, + hypre_Index max_xyz_index ) +/* Input: vector, and pointers to where to put returned data. + Return value: error flag, 0 means ok. + Finds the maximum value in a vector, puts it in max_value. + The corresponding index is put in max_index. + A hypre_Index corresponding to max_index is put in max_xyz_index. + We assume that there is only one box to deal with. */ { - 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_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_Real *data; - for (i = 0; i < data_space_size; i++) - { - hypre_StructVectorDataIndices(y)[i] = data_indices[i]; - } + hypre_Index imin; + hypre_BoxArray *boxes; + hypre_Box *box; + hypre_Index loop_size; + hypre_Index ustride; - hypre_StructVectorCopy( x, y ); + HYPRE_Int i, ndim; + HYPRE_Real maxvalue; + HYPRE_Int maxindex; - for (i = 0; i < 2 * ndim; i++) + ndim = hypre_StructVectorNDim(vector); + boxes = hypre_StructVectorDataSpace(vector); + if ( hypre_BoxArraySize(boxes) != 1 ) { - hypre_StructVectorNumGhost(y)[i] = hypre_StructVectorNumGhost(x)[i]; + /* if more than one box, the return system max_xyz_index is too simple + if needed, fix later */ + hypre_error(HYPRE_ERROR_GENERIC); + return hypre_error_flag; } + hypre_SetIndex(ustride, 1); + hypre_ForBoxI(i, boxes) + { + box = hypre_BoxArrayBox(boxes, i); + /*v_data_box = + hypre_BoxArrayBox(hypre_StructVectorDataSpace(vector), i);*/ + data = hypre_StructVectorBoxData(vector, i); + hypre_BoxGetSize(box, loop_size); + hypre_CopyIndex( hypre_BoxIMin(box), imin ); - hypre_StructVectorBGhostNotClear(y) = hypre_StructVectorBGhostNotClear(x); - hypre_StructVectorGlobalSize(y) = hypre_StructVectorGlobalSize(x); - - return y; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_StructVectorPointwiseDivpy( hypre_StructVector *x, - hypre_StructVector *b, - hypre_StructVector *y ) -{ - HYPRE_UNUSED_VAR(x); - HYPRE_UNUSED_VAR(b); - HYPRE_UNUSED_VAR(y); - - /* Not implemented yet */ - - return hypre_error_flag; -} - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ + maxindex = hypre_BoxIndexRank( box, imin ); + maxvalue = data[maxindex]; + hypre_SetIndex(max_xyz_index, 0); -HYPRE_Int -hypre_StructVectorPointwiseDivision( hypre_StructVector *x, - hypre_StructVector *y, - hypre_StructVector **z_ptr ) -{ - HYPRE_UNUSED_VAR(x); - HYPRE_UNUSED_VAR(y); - HYPRE_UNUSED_VAR(z_ptr); + hypre_SerialBoxLoop1Begin(ndim, loop_size, + box, imin, ustride, datai); + { + if ( data[datai] > maxvalue ) + { + maxvalue = data[datai]; + maxindex = datai; + hypre_BoxLoopGetIndex(max_xyz_index); + } + } + hypre_SerialBoxLoop1End(datai); + hypre_AddIndexes(max_xyz_index, imin, ndim, max_xyz_index); + } - /* Not implemented yet */ + *max_value = maxvalue; + *max_index = maxindex; return hypre_error_flag; } +#endif /*-------------------------------------------------------------------------- + * hypre_StructVectorClone + * Returns a complete copy of x - a deep copy, with its own copy of the data. *--------------------------------------------------------------------------*/ -HYPRE_Int -hypre_StructVectorPointwiseProduct( hypre_StructVector *x, - hypre_StructVector *y, - hypre_StructVector **z_ptr ) +hypre_StructVector * +hypre_StructVectorClone( hypre_StructVector *x ) { - HYPRE_UNUSED_VAR(x); - HYPRE_UNUSED_VAR(y); - HYPRE_UNUSED_VAR(z_ptr); + 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); - /* Not implemented yet */ + hypre_StructVector *y; + HYPRE_Int i; - return hypre_error_flag; -} + y = hypre_StructVectorCreate(comm, grid); + hypre_StructVectorSetStride(y, hypre_StructVectorStride(x)); -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -HYPRE_Int -hypre_StructVectorPointwiseInverse( hypre_StructVector *x, - hypre_StructVector **y_ptr ) -{ - HYPRE_UNUSED_VAR(x); - HYPRE_UNUSED_VAR(y_ptr); + hypre_StructVectorDataSize(y) = data_size; + hypre_StructVectorDataSpace(y) = hypre_BoxArrayClone(data_space); + hypre_StructVectorDataAlloced(y) = 1; + hypre_StructVectorData(y) = hypre_CTAlloc(HYPRE_Complex, data_size, memory_location); + hypre_StructVectorDataIndices(y) = hypre_CTAlloc(HYPRE_Int, data_space_size, + HYPRE_MEMORY_HOST); + for (i = 0; i < data_space_size; i++) + { + hypre_StructVectorDataIndices(y)[i] = data_indices[i]; + } + hypre_StructCopy(x, y); - /* Not implemented yet */ + 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 hypre_error_flag; + return y; } diff --git a/src/struct_mv/struct_vector.h b/src/struct_mv/struct_vector.h index 551a950509..4c64dc57bf 100644 --- a/src/struct_mv/struct_vector.h +++ b/src/struct_mv/struct_vector.h @@ -16,43 +16,69 @@ /*-------------------------------------------------------------------------- * hypre_StructVector: + * + * Most of the routines currently only work when the base grid and grid are the + * same (i.e., when nboxes equals the number of boxes in the grid and stride is + * the unit stride). The number of boxes in data_space and data_indices is the + * same as in the base grid, even though nboxes may be smaller. + * + * NOTE/TODO: The 'data_alloced=2' and 'save_data' aspects of the vector are + * only needed to support InitializeData(). Consider removing this feature, + * especially since it creates an issue with Forget(). *--------------------------------------------------------------------------*/ typedef struct hypre_StructVector_struct { MPI_Comm comm; - hypre_StructGrid *grid; - - hypre_BoxArray *data_space; + /* Note: nboxes and boxnums are computed from (grid, stride) */ + hypre_StructGrid *grid; /* Base grid */ + hypre_Index stride; /* Grid coarsening stride */ + HYPRE_Int nboxes; /* Grid number of boxes */ + HYPRE_Int *boxnums; /* Grid boxnums in base grid */ HYPRE_MemoryLocation memory_location; /* memory location of data */ + HYPRE_Int memory_mode; /* memory management mode */ + 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_alloced; /* TODO (VPM): change this to owns_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 *data_indices; /* Array of indices into the data array. + data_indices[b] is the starting index of + data for boxnum b. */ + 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_Int ref_count; + /* Information needed to Restore() after Rebase() and Resize() */ + hypre_StructGrid *save_grid; + hypre_Index save_stride; + HYPRE_Complex *save_data; /* Only needed to support InitializeData() */ + hypre_BoxArray *save_data_space; + HYPRE_Int save_data_size; + +#if defined(HYPRE_MIXED_PRECISION) + HYPRE_Precision vector_precision; +#endif + } hypre_StructVector; /*-------------------------------------------------------------------------- * Accessor macros: hypre_StructVector + * + * Notation: 'i' is a grid box index and 'b' is a base-grid box index *--------------------------------------------------------------------------*/ #define hypre_StructVectorComm(vector) ((vector) -> comm) #define hypre_StructVectorGrid(vector) ((vector) -> grid) -#define hypre_StructVectorDataSpace(vector) ((vector) -> data_space) +#define hypre_StructVectorStride(vector) ((vector) -> stride) +#define hypre_StructVectorNBoxes(vector) ((vector) -> nboxes) +#define hypre_StructVectorBoxnums(vector) ((vector) -> boxnums) +#define hypre_StructVectorBoxnum(vector, i) ((vector) -> boxnums[i]) #define hypre_StructVectorMemoryLocation(vector) ((vector) -> memory_location) +#define hypre_StructVectorMemoryMode(vector) ((vector) -> memory_mode) +#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) @@ -61,11 +87,21 @@ typedef struct hypre_StructVector_struct #define hypre_StructVectorBGhostNotClear(vector) ((vector) -> bghost_not_clear) #define hypre_StructVectorGlobalSize(vector) ((vector) -> global_size) #define hypre_StructVectorRefCount(vector) ((vector) -> ref_count) +#define hypre_StructVectorSaveGrid(vector) ((vector) -> save_grid) +#define hypre_StructVectorSaveStride(vector) ((vector) -> save_stride) +#define hypre_StructVectorSaveData(vector) ((vector) -> save_data) +#define hypre_StructVectorSaveDataSpace(vector) ((vector) -> save_data_space) +#define hypre_StructVectorSaveDataSize(vector) ((vector) -> save_data_size) + +#define hypre_StructVectorBoxIDs(vector) \ +hypre_BoxArrayIDs(hypre_StructVectorDataSpace(vector)) #define hypre_StructVectorNDim(vector) \ hypre_StructGridNDim(hypre_StructVectorGrid(vector)) -#define hypre_StructVectorBox(vector, b) \ +/* The following use a base-grid box index */ + +#define hypre_StructVectorDataSpaceBox(vector, b) \ hypre_BoxArrayBox(hypre_StructVectorDataSpace(vector), b) #define hypre_StructVectorBoxData(vector, b) \ @@ -73,6 +109,28 @@ hypre_BoxArrayBox(hypre_StructVectorDataSpace(vector), b) #define hypre_StructVectorBoxDataValue(vector, b, index) \ (hypre_StructVectorBoxData(vector, b) + \ - hypre_BoxIndexRank(hypre_StructVectorBox(vector, b), index)) + hypre_BoxIndexRank(hypre_StructVectorDataSpaceBox(vector, b), index)) + +/* The following "Grid" macros use a grid box index */ + +#define hypre_StructVectorGridBaseBox(vector, i) \ +hypre_StructGridBox(hypre_StructVectorGrid(vector), hypre_StructVectorBoxnum(vector, i)) + +#define hypre_StructVectorGridBoxCopy(vector, i, box) \ +hypre_CopyBox(hypre_StructVectorGridBaseBox(vector, i), box); /* on base-grid index space */ \ +hypre_StructVectorMapDataBox(vector, box); /* maps to data index space */ + +#define hypre_StructVectorGridDataBox(vector, i) \ +hypre_StructVectorDataSpaceBox(vector, hypre_StructVectorBoxnum(vector, i)) + +#define hypre_StructVectorGridData(vector, i) \ +hypre_StructVectorBoxData(vector, hypre_StructVectorBoxnum(vector, i)) + +#define hypre_StructVectorGridDataValue(vector, i, index) \ +hypre_StructVectorBoxDataValue(vector, hypre_StructVectorGridDataBox(vector, i), index) + +#if defined(HYPRE_MIXED_PRECISION) +#define hypre_StructVectorPrecision(vector) ((vector) -> vector_precision) +#endif #endif diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index 9c286cc2be..98b6d767ea 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -14,23 +14,57 @@ if(NOT DEFINED HYPRE_CHECK_TOL) set(HYPRE_CHECK_TOL 1.0e-6) endif() +# Define list of executables set(TEST_SRCS ij.c sstruct.c struct.c + structmat.c ams_driver.c - maxwell_unscaled.c struct_migrate.c - sstruct_fac.c ij_assembly.c ) -add_hypre_executables(TEST_SRCS) +# Mixed precision test executables (only built when mixed precision is enabled) +if(HYPRE_ENABLE_MIXED_PRECISION) + set(MP_TEST_SRCS + test_mp_pcg.c + test_mp_pcg_3d.c + ) + add_hypre_executables("${MP_TEST_SRCS}") +endif() + +# Build each executable +add_hypre_executables("${TEST_SRCS}") + +# Special treatment for sstructmat as it depends on sstruct_helpers (not an executable) +add_hypre_executable("sstructmat.c" "sstruct_helpers.c") # Copy test input files configure_file(${CMAKE_CURRENT_SOURCE_DIR}/TEST_sstruct/sstruct.in.default ${CMAKE_CURRENT_BINARY_DIR}/sstruct.in.default COPYONLY) +# Install test drivers in ${CMAKE_INSTALL_PREFIX}/bin when tests are enabled +if(HYPRE_BUILD_TESTS) + # Collect targets derived from source file names + set(HYPRE_TEST_DRIVER_TARGETS) + foreach(src_file ${TEST_SRCS}) + get_filename_component(exec_name ${src_file} NAME_WE) + list(APPEND HYPRE_TEST_DRIVER_TARGETS ${exec_name}) + endforeach() + + # Mixed precision drivers when enabled + if(HYPRE_ENABLE_MIXED_PRECISION) + foreach(src_file ${MP_TEST_SRCS}) + get_filename_component(exec_name ${src_file} NAME_WE) + list(APPEND HYPRE_TEST_DRIVER_TARGETS ${exec_name}) + endforeach() + endif() + + install(TARGETS ${HYPRE_TEST_DRIVER_TARGETS} + RUNTIME DESTINATION bin) +endif() + # Add check target find_program(BASH_PROGRAM bash) diff --git a/src/test/Makefile b/src/test/Makefile index 292313ebf8..624b0a4da0 100644 --- a/src/test/Makefile +++ b/src/test/Makefile @@ -64,13 +64,20 @@ HYPRE_DRIVERS =\ ij.c\ ij_assembly.c\ sstruct.c\ + sstructmat.c\ struct.c\ + structmat.c\ ams_driver.c\ - maxwell_unscaled.c\ struct_migrate.c\ - sstruct_fac.c\ ij_mm.c\ - zboxloop.c + zboxloop.c\ + +HYPRE_MP_DRIVERS =\ + ij_mp.c\ + test_mp.c\ + test_mp_pcg.c\ + test_mp_pcg_3d.c\ +# struct_mp.c\ HYPRE_DRIVERS_CXX =\ cxx_ij.cxx\ @@ -89,6 +96,9 @@ HYPRE_DRIVERS_F77 =\ f77_struct.f HYPRE_DRIVER_EXECS=${HYPRE_DRIVERS:.c=} +ifdef MP_BUILD + HYPRE_DRIVER_EXECS+=${HYPRE_MP_DRIVERS:.c=} +endif HYPRE_F77_EXAMPLES_DRIVER_EXECS=${HYPRE_F77_EXAMPLES_DRIVERS:.c=} HYPRE_DRIVER_F77_EXECS=${HYPRE_DRIVERS_F77:.f=} HYPRE_DRIVER_CXX_EXECS=${HYPRE_DRIVERS_CXX:.cxx=} @@ -112,8 +122,6 @@ distclean: clean rm -f ${HYPRE_DRIVER_CXX_EXECS} cxx_* rm -f TEST_examples/*.out* rm -f TEST_examples/*.err* - rm -f TEST_fac/*.out* - rm -f TEST_fac/*.err* rm -f TEST_ij/*.out* rm -f TEST_ij/*.err* rm -f TEST_ij/*.txt* @@ -122,14 +130,15 @@ distclean: clean rm -f TEST_sstruct/*.err* rm -f TEST_struct/*.out* rm -f TEST_struct/*.err* - rm -f ex1 ex2 ex3 ex4 ex5 ex5big ex5b ex5b77 ex6 ex7 ex8 ex9 ex15big ex18comp + rm -f TEST_structmat/*.out* + rm -f TEST_structmat/*.err* + ################################################################## # Rules ################################################################## # C - ij: ij.o @echo "Building" $@ "... " ${LINK_CC} -o $@ $< ${LFLAGS} @@ -138,27 +147,32 @@ ij_assembly: ij_assembly.o @echo "Building" $@ "... " ${LINK_CC} -o $@ $< ${LFLAGS} +# TODO (VPM): Update data structures on sstruct_helpers for GPUs +# sstruct: sstruct_helpers.o sstruct.o +# @echo "Building" $@ "... " +# ${LINK_CC} -o $@ $^ ${LFLAGS} + sstruct: sstruct.o @echo "Building" $@ "... " - ${LINK_CC} -o $@ $< ${LFLAGS} + ${LINK_CC} -o $@ $^ ${LFLAGS} -struct: struct.obj +sstructmat: sstruct_helpers.o sstructmat.o @echo "Building" $@ "... " - ${LINK_CC} -o $@ $< ${LFLAGS} + ${LINK_CC} -o $@ $^ ${LFLAGS} -ams_driver: ams_driver.o +struct: struct.obj @echo "Building" $@ "... " ${LINK_CC} -o $@ $< ${LFLAGS} -maxwell_unscaled: maxwell_unscaled.o +structmat: structmat.o @echo "Building" $@ "... " ${LINK_CC} -o $@ $< ${LFLAGS} -struct_migrate: struct_migrate.o +ams_driver: ams_driver.o @echo "Building" $@ "... " ${LINK_CC} -o $@ $< ${LFLAGS} -sstruct_fac: sstruct_fac.o +struct_migrate: struct_migrate.o @echo "Building" $@ "... " ${LINK_CC} -o $@ $< ${LFLAGS} @@ -178,6 +192,26 @@ struct_newboxloop: struct_newboxloop.o $(KOKKOS_LINK_DEPENDS) @echo "Building" $@ "... " ${LINK_CC} -o $@ $< ${LFLAGS} +ij_mp: ij_mp.o + @echo "Building" $@ "... " + ${LINK_CC} -o $@ $< ${LFLAGS} + +struct_mp: struct_mp.o + @echo "Building" $@ "... " + ${LINK_CC} -o $@ $< ${LFLAGS} + +test_mp: test_mp.o + @echo "Building" $@ "... " + ${LINK_CC} -o $@ $< ${LFLAGS} + +test_mp_pcg: test_mp_pcg.o + @echo "Building" $@ "... " + ${LINK_CC} -o $@ $< ${LFLAGS} + +test_mp_pcg_3d: test_mp_pcg_3d.o + @echo "Building" $@ "... " + ${LINK_CC} -o $@ $< ${LFLAGS} + # RDF: Keep these for now hypre_set_precond: hypre_set_precond.o @@ -255,10 +289,6 @@ ex7_for: fstruct_mv.o fstruct_ls.o fsstruct_mv.o fsstruct_ls.o ex7_for.o @echo "Building" $@ "... " ${LINK_CC} -o $@ fstruct_mv.o fstruct_ls.o fsstruct_mv.o fsstruct_ls.o $@.o ${LFLAGS} -for_maxwell: fparcsr_mv.o fsstruct_mv.o fsstruct_ls.o for_maxwell.o - @echo "Building" $@ "... " - ${LINK_CC} -o $@ fparcsr_mv.o fsstruct_mv.o fsstruct_ls.o $@.o ${LFLAGS} - fij_mv: fij_mv.f @echo "Building" $@ "... " ${LINK_FC} -c $@ diff --git a/src/test/TEST_bench/benchmark_ij.perf.saved.tioga b/src/test/TEST_bench/benchmark_ij.perf.saved.tioga index f335bba307..3061f6c629 100644 --- a/src/test/TEST_bench/benchmark_ij.perf.saved.tioga +++ b/src/test/TEST_bench/benchmark_ij.perf.saved.tioga @@ -53,7 +53,7 @@ PCG Solve wall clock time = 0.143477 seconds 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 Setup wall clock time = 0.321646 seconds PCG Solve wall clock time = 0.324065 seconds # Output file: benchmark_ij.out.20 PCG Setup wall clock time = 0.185776 seconds diff --git a/src/test/TEST_bench/benchmark_struct.perf.saved.lassen b/src/test/TEST_bench/benchmark_struct.perf.saved.lassen index 73f95744b9..b45450e90d 100644 --- a/src/test/TEST_bench/benchmark_struct.perf.saved.lassen +++ b/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.120866 seconds -PCG Solve wall clock time = 0.577228 seconds +PCG Setup wall clock time = 0.163378 seconds +PCG Solve wall clock time = 0.738233 seconds # Output file: benchmark_struct.out.2 -PCG Setup wall clock time = 0.139227 seconds -PCG Solve wall clock time = 0.769984 seconds +PCG Setup wall clock time = 0.183733 seconds +PCG Solve wall clock time = 0.968725 seconds # Output file: benchmark_struct.out.3 -PCG Setup wall clock time = 1.197938 seconds -PCG Solve wall clock time = 6.011690 seconds +PCG Setup wall clock time = 1.611975 seconds +PCG Solve wall clock time = 7.987299 seconds # Output file: benchmark_struct.out.4 -PCG Setup wall clock time = 1.791265 seconds -PCG Solve wall clock time = 9.300076 seconds +PCG Setup wall clock time = 2.471338 seconds +PCG Solve wall clock time = 12.595097 seconds # Output file: benchmark_struct.out.5 -PCG Setup wall clock time = 0.012325 seconds +PCG Setup wall clock time = 0.027258 seconds PCG Solve wall clock time = 0.138208 seconds # Output file: benchmark_struct.out.6 -PCG Setup wall clock time = 0.019830 seconds -PCG Solve wall clock time = 0.313756 seconds +PCG Setup wall clock time = 0.040711 seconds +PCG Solve wall clock time = 0.261663 seconds # Output file: benchmark_struct.out.7 -PCG Setup wall clock time = 0.050781 seconds -PCG Solve wall clock time = 0.408700 seconds +PCG Setup wall clock time = 0.089815 seconds +PCG Solve wall clock time = 0.346142 seconds # Output file: benchmark_struct.out.8 -PCG Setup wall clock time = 0.069028 seconds -PCG Solve wall clock time = 0.629209 seconds +PCG Setup wall clock time = 0.119177 seconds +PCG Solve wall clock time = 0.522697 seconds diff --git a/src/test/TEST_bench/benchmark_struct.perf.saved.tioga b/src/test/TEST_bench/benchmark_struct.perf.saved.tioga index 7703d652f0..db03907c61 100644 --- a/src/test/TEST_bench/benchmark_struct.perf.saved.tioga +++ b/src/test/TEST_bench/benchmark_struct.perf.saved.tioga @@ -1,24 +1,24 @@ # Output file: benchmark_struct.out.1 -PCG Setup wall clock time = 0.091983 seconds -PCG Solve wall clock time = 0.421361 seconds +PCG Setup wall clock time = 0.124131 seconds +PCG Solve wall clock time = 0.519646 seconds # Output file: benchmark_struct.out.2 -PCG Setup wall clock time = 0.114076 seconds -PCG Solve wall clock time = 0.568872 seconds +PCG Setup wall clock time = 0.154125 seconds +PCG Solve wall clock time = 0.677839 seconds # Output file: benchmark_struct.out.3 -PCG Setup wall clock time = 0.862025 seconds -PCG Solve wall clock time = 4.294343 seconds +PCG Setup wall clock time = 1.161438 seconds +PCG Solve wall clock time = 5.537959 seconds # Output file: benchmark_struct.out.4 -PCG Setup wall clock time = 1.412173 seconds -PCG Solve wall clock time = 7.285773 seconds +PCG Setup wall clock time = 1.771025 seconds +PCG Solve wall clock time = 8.591482 seconds # Output file: benchmark_struct.out.5 -PCG Setup wall clock time = 0.012046 seconds +PCG Setup wall clock time = 0.023313 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 +PCG Setup wall clock time = 0.038669 seconds +PCG Solve wall clock time = 0.202613 seconds # Output file: benchmark_struct.out.7 -PCG Setup wall clock time = 0.044571 seconds -PCG Solve wall clock time = 0.333274 seconds +PCG Setup wall clock time = 0.085711 seconds +PCG Solve wall clock time = 0.269730 seconds # Output file: benchmark_struct.out.8 -PCG Setup wall clock time = 0.071390 seconds -PCG Solve wall clock time = 0.519030 seconds +PCG Setup wall clock time = 0.124254 seconds +PCG Solve wall clock time = 0.384530 seconds diff --git a/src/test/TEST_error/error.saved b/src/test/TEST_error/error.saved index 4dbc335e2b..bbbdcc22d4 100644 --- a/src/test/TEST_error/error.saved +++ b/src/test/TEST_error/error.saved @@ -2,14 +2,14 @@ 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 @@ -17,13 +17,13 @@ Iters ||r||_2 conv.rate ||r||_2/||b||_2 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 @@ -37,7 +37,7 @@ Iters ||r||_2 conv.rate ||r||_2/||b||_2 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 @@ -51,7 +51,7 @@ Iters ||r||_2 conv.rate ||r||_2/||b||_2 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 @@ -80,13 +80,13 @@ Iters ||r||_2 conv.rate ||r||_2/||b||_2 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 +0: hypre error in file "pcg.c", line 1010, error code = 256 - Reached max iterations 2 in PCG before convergence +0: hypre error in file "pcg.c", line 1010, error code = 256 - Reached max iterations 2 in PCG before convergence +0: hypre error in file "pcg.c", line 1010, error code = 256 - Reached max iterations 2 in PCG before convergence +0: hypre error in file "pcg.c", line 1010, error code = 256 - Reached max iterations 2 in PCG before convergence +0: hypre error in file "pcg.c", line 869, error code = 256 - Negative or zero gamma value in PCG +0: hypre error in file "pcg.c", line 869, error code = 256 - Negative or zero gamma value in PCG +0: hypre error in file "pcg.c", line 869, error code = 256 - Negative or zero gamma value in PCG 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/src/test/TEST_error/error.saved.lassen b/src/test/TEST_error/error.saved.lassen index 08531529cf..b800f48623 100644 --- a/src/test/TEST_error/error.saved.lassen +++ b/src/test/TEST_error/error.saved.lassen @@ -2,14 +2,14 @@ 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 @@ -17,13 +17,13 @@ Iters ||r||_2 conv.rate ||r||_2/||b||_2 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 @@ -37,7 +37,7 @@ Iters ||r||_2 conv.rate ||r||_2/||b||_2 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 @@ -51,7 +51,7 @@ Iters ||r||_2 conv.rate ||r||_2/||b||_2 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 @@ -64,8 +64,8 @@ Iters ||r||_2 conv.rate ||r||_2/||b||_2 0: hypre error in file "par_amg.c", line 2025, error code = 20 0: hypre error in file "par_amg_solve.c", line 342, error code = 256 0: hypre error in file "par_amg_solve.c", line 342, 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 +0: hypre error in file "pcg.c", line 1010, error code = 256 - Reached max iterations 2 in PCG before convergence +0: hypre error in file "pcg.c", line 1010, error code = 256 - Reached max iterations 2 in PCG before convergence +0: hypre error in file "pcg.c", line 1010, error code = 256 - Reached max iterations 2 in PCG before convergence +0: hypre error in file "pcg.c", line 1010, error code = 256 - Reached max iterations 2 in PCG before convergence +0: hypre error in file "pcg.c", line 869, error code = 256 - Negative or zero gamma value in PCG diff --git a/src/test/TEST_fac/3lev.in b/src/test/TEST_fac/3lev.in deleted file mode 100644 index d13990429b..0000000000 --- a/src/test/TEST_fac/3lev.in +++ /dev/null @@ -1,231 +0,0 @@ -# Copyright (c) 1998 Lawrence Livermore 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 3 -############################################################# -# GridSetExtents: part ilower(ndim) iupper(ndim) -GridSetExtents: 0 (1- 1- 1-) (8+ 8+ 8+) -GridSetExtents: 1 (4- 4- 4-) (11+ 11+ 11+) -GridSetExtents: 2 (14- 14- 14-) (19+ 19+ 19+) -############################################################# - -# GridSetVariables: part nvars vartypes[nvars] -# CELL = 0 -# NODE = 1 -# XFACE = 2 -# YFACE = 3 -# ZFACE = 4 -# XEDGE = 5 -# YEDGE = 6 -# ZEDGE = 7 - -GridSetVariables: 0 1 [0] -GridSetVariables: 1 1 [0] -GridSetVariables: 2 1 [0] -############################################################# - -# StencilCreate: nstencils sizes[nstencils] -StencilCreate: 1 [7] -############################################################# - -# StencilSetEntry: stencil_num entry offset[ndim] var value -StencilSetEntry: 0 0 [ 0 0 0] 0 6.000000 -StencilSetEntry: 0 1 [-1 0 0] 0 -1.000000 -StencilSetEntry: 0 2 [ 1 0 0] 0 -1.000000 -StencilSetEntry: 0 3 [ 0 -1 0] 0 -1.000000 -StencilSetEntry: 0 4 [ 0 0 1] 0 -1.000000 -StencilSetEntry: 0 5 [ 0 0 -1] 0 -1.000000 -StencilSetEntry: 0 6 [ 0 1 0] 0 -1.000000 -############################################################# - -# GraphSetStencil: part var stencil_num -GraphSetStencil: 0 0 0 -GraphSetStencil: 1 0 0 -GraphSetStencil: 2 0 0 -############################################################# - -# GraphAddEntries: \ - -# part ilower(ndim) iupper(ndim) stride[ndim] var \ - -# to_part to_ilower(ndim) to_iupper(ndim) to_stride[ndim] to_var \ - -# index_map[ndim] entry value -GraphAddEntries: 0 (2- 2- 2-: -1 0 0) (2- 5+ 5+: -1 0 0) [1 1 1] 0 1 (4- 4- 4-: 0 0 1) (4- 11+ 11+: 0 -1 0) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: -1 0 0) (2- 5+ 5+: -1 0 0) [1 1 1] 0 1 (4- 4- 4-: 0 1 1) (4- 11+ 11+: 0 0 0) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: -1 0 0) (2- 5+ 5+: -1 0 0) [1 1 1] 0 1 (4- 4- 4-: 0 0 0) (4- 11+ 11+: 0 -1 -1) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: -1 0 0) (2- 5+ 5+: -1 0 0) [1 1 1] 0 1 (4- 4- 4-: 0 1 0) (4- 11+ 11+: 0 0 -1) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (5+ 2- 2-: 1 0 0) (5+ 5+ 5+: 1 0 0) [1 1 1] 0 1 (11+ 4- 4-: 0 0 0) (11+ 11+ 11+: 0 -1 -1) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (5+ 2- 2-: 1 0 0) (5+ 5+ 5+: 1 0 0) [1 1 1] 0 1 (11+ 4- 4-: 0 1 0) (11+ 11+ 11+: 0 0 -1) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (5+ 2- 2-: 1 0 0) (5+ 5+ 5+: 1 0 0) [1 1 1] 0 1 (11+ 4- 4-: 0 0 1) (11+ 11+ 11+: 0 -1 0) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (5+ 2- 2-: 1 0 0) (5+ 5+ 5+: 1 0 0) [1 1 1] 0 1 (11+ 4- 4-: 0 1 1) (11+ 11+ 11+: 0 0 0) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 -1 0) (5+ 2- 5+: 0 -1 0) [1 1 1] 0 1 (4- 4- 4-: 0 0 1) (11+ 4- 11+: -1 0 0) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 -1 0) (5+ 2- 5+: 0 -1 0) [1 1 1] 0 1 (4- 4- 4-: 0 0 0) (11+ 4- 11+: -1 0 -1) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 -1 0) (5+ 2- 5+: 0 -1 0) [1 1 1] 0 1 (4- 4- 4-: 1 0 1) (11+ 4- 11+: 0 0 0) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 -1 0) (5+ 2- 5+: 0 -1 0) [1 1 1] 0 1 (4- 4- 4-: 1 0 0) (11+ 4- 11+: 0 0 -1) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (2- 5+ 2-: 0 1 0) (5+ 5+ 5+: 0 1 0) [1 1 1] 0 1 (4- 11+ 4-: 0 0 0) (11+ 11+ 11+: -1 0 -1) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (2- 5+ 2-: 0 1 0) (5+ 5+ 5+: 0 1 0) [1 1 1] 0 1 (4- 11+ 4-: 0 0 1) (11+ 11+ 11+: -1 0 0) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (2- 5+ 2-: 0 1 0) (5+ 5+ 5+: 0 1 0) [1 1 1] 0 1 (4- 11+ 4-: 1 0 0) (11+ 11+ 11+: 0 0 -1) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (2- 5+ 2-: 0 1 0) (5+ 5+ 5+: 0 1 0) [1 1 1] 0 1 (4- 11+ 4-: 1 0 1) (11+ 11+ 11+: 0 0 0) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 0 -1) (5+ 5+ 2-: 0 0 -1) [1 1 1] 0 1 (4- 4- 4-: 0 0 0) (11+ 11+ 4-: -1 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 0 -1) (5+ 5+ 2-: 0 0 -1) [1 1 1] 0 1 (4- 4- 4-: 0 1 0) (11+ 11+ 4-: -1 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 0 -1) (5+ 5+ 2-: 0 0 -1) [1 1 1] 0 1 (4- 4- 4-: 1 0 0) (11+ 11+ 4-: 0 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 0 -1) (5+ 5+ 2-: 0 0 -1) [1 1 1] 0 1 (4- 4- 4-: 1 1 0) (11+ 11+ 4-: 0 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (2- 2- 5+: 0 0 1) (5+ 5+ 5+: 0 0 1) [1 1 1] 0 1 (4- 4- 11+: 1 0 0) (11+ 11+ 11+: 0 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (2- 2- 5+: 0 0 1) (5+ 5+ 5+: 0 0 1) [1 1 1] 0 1 (4- 4- 11+: 1 1 0) (11+ 11+ 11+: 0 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (2- 2- 5+: 0 0 1) (5+ 5+ 5+: 0 0 1) [1 1 1] 0 1 (4- 4- 11+: 0 0 0) (11+ 11+ 11+: -1 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (2- 2- 5+: 0 0 1) (5+ 5+ 5+: 0 0 1) [1 1 1] 0 1 (4- 4- 11+: 0 1 0) (11+ 11+ 11+: -1 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 1) (4- 11+ 11+: 0 -1 -2) [1 2 2] 0 0 (2- 2- 2-: -1 0 0) (2- 5+ 5+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 1 1) (4- 11+ 11+: 0 0 -2) [1 2 2] 0 0 (2- 2- 2-: -1 0 0) (2- 5+ 5+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 2) (4- 11+ 11+: 0 -1 -1) [1 2 2] 0 0 (2- 2- 2-: -1 0 1) (2- 5+ 5+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 1 2) (4- 11+ 11+: 0 0 -1) [1 2 2] 0 0 (2- 2- 2-: -1 0 1) (2- 5+ 5+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (11+ 4- 4-: 0 0 2) (11+ 11+ 11+: 0 -1 -1) [1 2 2] 0 0 (5+ 2- 2-: 1 0 1) (5+ 5+ 5+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (11+ 4- 4-: 0 1 2) (11+ 11+ 11+: 0 0 -1) [1 2 2] 0 0 (5+ 2- 2-: 1 0 1) (5+ 5+ 5+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (11+ 4- 4-: 0 0 1) (11+ 11+ 11+: 0 -1 -2) [1 2 2] 0 0 (5+ 2- 2-: 1 0 0) (5+ 5+ 5+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (11+ 4- 4-: 0 1 1) (11+ 11+ 11+: 0 0 -2) [1 2 2] 0 0 (5+ 2- 2-: 1 0 0) (5+ 5+ 5+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 2 0 1) (11+ 4- 11+: -1 0 -2) [2 1 2] 0 0 (2- 2- 2-: 1 -1 0) (5+ 2- 5+: 0 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 2 0 2) (11+ 4- 11+: -1 0 -1) [2 1 2] 0 0 (2- 2- 2-: 1 -1 1) (5+ 2- 5+: 0 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 1 0 1) (11+ 4- 11+: -2 0 -2) [2 1 2] 0 0 (2- 2- 2-: 0 -1 0) (5+ 2- 5+: -1 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 1 0 2) (11+ 4- 11+: -2 0 -1) [2 1 2] 0 0 (2- 2- 2-: 0 -1 1) (5+ 2- 5+: -1 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 11+ 4-: 2 0 2) (11+ 11+ 11+: -1 0 -1) [2 1 2] 0 0 (2- 5+ 2-: 1 1 1) (5+ 5+ 5+: 0 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 11+ 4-: 2 0 1) (11+ 11+ 11+: -1 0 -2) [2 1 2] 0 0 (2- 5+ 2-: 1 1 0) (5+ 5+ 5+: 0 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 11+ 4-: 1 0 2) (11+ 11+ 11+: -2 0 -1) [2 1 2] 0 0 (2- 5+ 2-: 0 1 1) (5+ 5+ 5+: -1 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 11+ 4-: 1 0 1) (11+ 11+ 11+: -2 0 -2) [2 1 2] 0 0 (2- 5+ 2-: 0 1 0) (5+ 5+ 5+: -1 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 0) (11+ 11+ 4-: -1 -1 0) [2 2 1] 0 0 (2- 2- 2-: 0 0 -1) (5+ 5+ 2-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 1 0) (11+ 11+ 4-: -1 0 0) [2 2 1] 0 0 (2- 2- 2-: 0 0 -1) (5+ 5+ 2-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 1 0 0) (11+ 11+ 4-: 0 -1 0) [2 2 1] 0 0 (2- 2- 2-: 0 0 -1) (5+ 5+ 2-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 1 1 0) (11+ 11+ 4-: 0 0 0) [2 2 1] 0 0 (2- 2- 2-: 0 0 -1) (5+ 5+ 2-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 11+: 1 0 0) (11+ 11+ 11+: 0 -1 0) [2 2 1] 0 0 (2- 2- 5+: 0 0 1) (5+ 5+ 5+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 11+: 1 1 0) (11+ 11+ 11+: 0 0 0) [2 2 1] 0 0 (2- 2- 5+: 0 0 1) (5+ 5+ 5+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 11+: 0 0 0) (11+ 11+ 11+: -1 -1 0) [2 2 1] 0 0 (2- 2- 5+: 0 0 1) (5+ 5+ 5+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 11+: 0 1 0) (11+ 11+ 11+: -1 0 0) [2 2 1] 0 0 (2- 2- 5+: 0 0 1) (5+ 5+ 5+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (7- 7- 7-: -1 0 0) (7- 9+ 9+: -1 0 0) [1 1 1] 0 2 (14- 14- 14-: 0 0 1) (14- 19+ 19+: 0 -1 0) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (7- 7- 7-: -1 0 0) (7- 9+ 9+: -1 0 0) [1 1 1] 0 2 (14- 14- 14-: 0 1 1) (14- 19+ 19+: 0 0 0) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (7- 7- 7-: -1 0 0) (7- 9+ 9+: -1 0 0) [1 1 1] 0 2 (14- 14- 14-: 0 0 0) (14- 19+ 19+: 0 -1 -1) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (7- 7- 7-: -1 0 0) (7- 9+ 9+: -1 0 0) [1 1 1] 0 2 (14- 14- 14-: 0 1 0) (14- 19+ 19+: 0 0 -1) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (9+ 7- 7-: 1 0 0) (9+ 9+ 9+: 1 0 0) [1 1 1] 0 2 (19+ 14- 14-: 0 0 0) (19+ 19+ 19+: 0 -1 -1) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (9+ 7- 7-: 1 0 0) (9+ 9+ 9+: 1 0 0) [1 1 1] 0 2 (19+ 14- 14-: 0 1 0) (19+ 19+ 19+: 0 0 -1) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (9+ 7- 7-: 1 0 0) (9+ 9+ 9+: 1 0 0) [1 1 1] 0 2 (19+ 14- 14-: 0 0 1) (19+ 19+ 19+: 0 -1 0) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (9+ 7- 7-: 1 0 0) (9+ 9+ 9+: 1 0 0) [1 1 1] 0 2 (19+ 14- 14-: 0 1 1) (19+ 19+ 19+: 0 0 0) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (7- 7- 7-: 0 -1 0) (9+ 7- 9+: 0 -1 0) [1 1 1] 0 2 (14- 14- 14-: 0 0 1) (19+ 14- 19+: -1 0 0) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (7- 7- 7-: 0 -1 0) (9+ 7- 9+: 0 -1 0) [1 1 1] 0 2 (14- 14- 14-: 0 0 0) (19+ 14- 19+: -1 0 -1) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (7- 7- 7-: 0 -1 0) (9+ 7- 9+: 0 -1 0) [1 1 1] 0 2 (14- 14- 14-: 1 0 1) (19+ 14- 19+: 0 0 0) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (7- 7- 7-: 0 -1 0) (9+ 7- 9+: 0 -1 0) [1 1 1] 0 2 (14- 14- 14-: 1 0 0) (19+ 14- 19+: 0 0 -1) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (7- 9+ 7-: 0 1 0) (9+ 9+ 9+: 0 1 0) [1 1 1] 0 2 (14- 19+ 14-: 0 0 0) (19+ 19+ 19+: -1 0 -1) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (7- 9+ 7-: 0 1 0) (9+ 9+ 9+: 0 1 0) [1 1 1] 0 2 (14- 19+ 14-: 0 0 1) (19+ 19+ 19+: -1 0 0) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (7- 9+ 7-: 0 1 0) (9+ 9+ 9+: 0 1 0) [1 1 1] 0 2 (14- 19+ 14-: 1 0 0) (19+ 19+ 19+: 0 0 -1) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (7- 9+ 7-: 0 1 0) (9+ 9+ 9+: 0 1 0) [1 1 1] 0 2 (14- 19+ 14-: 1 0 1) (19+ 19+ 19+: 0 0 0) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (7- 7- 7-: 0 0 -1) (9+ 9+ 7-: 0 0 -1) [1 1 1] 0 2 (14- 14- 14-: 0 0 0) (19+ 19+ 14-: -1 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (7- 7- 7-: 0 0 -1) (9+ 9+ 7-: 0 0 -1) [1 1 1] 0 2 (14- 14- 14-: 0 1 0) (19+ 19+ 14-: -1 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (7- 7- 7-: 0 0 -1) (9+ 9+ 7-: 0 0 -1) [1 1 1] 0 2 (14- 14- 14-: 1 0 0) (19+ 19+ 14-: 0 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (7- 7- 7-: 0 0 -1) (9+ 9+ 7-: 0 0 -1) [1 1 1] 0 2 (14- 14- 14-: 1 1 0) (19+ 19+ 14-: 0 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (7- 7- 9+: 0 0 1) (9+ 9+ 9+: 0 0 1) [1 1 1] 0 2 (14- 14- 19+: 1 0 0) (19+ 19+ 19+: 0 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (7- 7- 9+: 0 0 1) (9+ 9+ 9+: 0 0 1) [1 1 1] 0 2 (14- 14- 19+: 1 1 0) (19+ 19+ 19+: 0 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (7- 7- 9+: 0 0 1) (9+ 9+ 9+: 0 0 1) [1 1 1] 0 2 (14- 14- 19+: 0 0 0) (19+ 19+ 19+: -1 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (7- 7- 9+: 0 0 1) (9+ 9+ 9+: 0 0 1) [1 1 1] 0 2 (14- 14- 19+: 0 1 0) (19+ 19+ 19+: -1 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 0) (4- 11+ 4-: 0 -1 0) [1 2 1] 0 0 (2- 2- 2-: -1 0 0) (2- 5+ 2-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 1 0) (4- 11+ 4-: 0 0 0) [1 2 1] 0 0 (2- 2- 2-: -1 0 0) (2- 5+ 2-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (11+ 4- 11+: 0 0 0) (11+ 11+ 11+: 0 -1 0) [1 2 1] 0 0 (5+ 2- 5+: 1 0 0) (5+ 5+ 5+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (11+ 4- 11+: 0 1 0) (11+ 11+ 11+: 0 0 0) [1 2 1] 0 0 (5+ 2- 5+: 1 0 0) (5+ 5+ 5+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (11+ 4- 4-: 0 0 0) (11+ 11+ 4-: 0 -1 0) [1 2 1] 0 0 (5+ 2- 2-: 1 0 0) (5+ 5+ 2-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (11+ 4- 4-: 0 1 0) (11+ 11+ 4-: 0 0 0) [1 2 1] 0 0 (5+ 2- 2-: 1 0 0) (5+ 5+ 2-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 11+: 0 0 0) (4- 11+ 11+: 0 -1 0) [1 2 1] 0 0 (2- 2- 5+: -1 0 0) (2- 5+ 5+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 11+: 0 1 0) (4- 11+ 11+: 0 0 0) [1 2 1] 0 0 (2- 2- 5+: -1 0 0) (2- 5+ 5+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 2 0 0) (11+ 4- 4-: -1 0 0) [2 1 1] 0 0 (2- 2- 2-: 1 -1 0) (5+ 2- 2-: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 2) (4- 4- 11+: 0 0 -1) [1 1 2] 0 0 (2- 2- 2-: 0 -1 1) (2- 2- 5+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 11+: 2 0 0) (11+ 4- 11+: -1 0 0) [2 1 1] 0 0 (2- 2- 5+: 1 -1 0) (5+ 2- 5+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (11+ 4- 4-: 0 0 2) (11+ 4- 11+: 0 0 -1) [1 1 2] 0 0 (5+ 2- 2-: 0 -1 1) (5+ 2- 5+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 1 0 0) (11+ 4- 4-: -2 0 0) [2 1 1] 0 0 (2- 2- 2-: 0 -1 0) (5+ 2- 2-: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 1) (4- 4- 11+: 0 0 -2) [1 1 2] 0 0 (2- 2- 2-: 0 -1 0) (2- 2- 5+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 11+: 1 0 0) (11+ 4- 11+: -2 0 0) [2 1 1] 0 0 (2- 2- 5+: 0 -1 0) (5+ 2- 5+: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (11+ 4- 4-: 0 0 1) (11+ 4- 11+: 0 0 -2) [1 1 2] 0 0 (5+ 2- 2-: 0 -1 0) (5+ 2- 5+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 11+ 4-: 2 0 0) (11+ 11+ 4-: -1 0 0) [2 1 1] 0 0 (2- 5+ 2-: 1 1 0) (5+ 5+ 2-: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 11+ 4-: 0 0 2) (4- 11+ 11+: 0 0 -1) [1 1 2] 0 0 (2- 5+ 2-: 0 1 1) (2- 5+ 5+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 11+ 11+: 2 0 0) (11+ 11+ 11+: -1 0 0) [2 1 1] 0 0 (2- 5+ 5+: 1 1 0) (5+ 5+ 5+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (11+ 11+ 4-: 0 0 2) (11+ 11+ 11+: 0 0 -1) [1 1 2] 0 0 (5+ 5+ 2-: 0 1 1) (5+ 5+ 5+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 11+ 4-: 1 0 0) (11+ 11+ 4-: -2 0 0) [2 1 1] 0 0 (2- 5+ 2-: 0 1 0) (5+ 5+ 2-: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 11+ 4-: 0 0 1) (4- 11+ 11+: 0 0 -2) [1 1 2] 0 0 (2- 5+ 2-: 0 1 0) (2- 5+ 5+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 11+ 11+: 1 0 0) (11+ 11+ 11+: -2 0 0) [2 1 1] 0 0 (2- 5+ 5+: 0 1 0) (5+ 5+ 5+: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (11+ 11+ 4-: 0 0 1) (11+ 11+ 11+: 0 0 -2) [1 1 2] 0 0 (5+ 5+ 2-: 0 1 0) (5+ 5+ 5+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 0) (4- 4- 4-: 0 0 0) [1 1 1] 0 0 (2- 2- 2-: 0 -1 0) (2- 2- 2-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (11+ 4- 4-: 0 0 0) (11+ 4- 4-: 0 0 0) [1 1 1] 0 0 (5+ 2- 2-: 0 -1 0) (5+ 2- 2-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (4- 4- 11+: 0 0 0) (4- 4- 11+: 0 0 0) [1 1 1] 0 0 (2- 2- 5+: 0 -1 0) (2- 2- 5+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (11+ 4- 11+: 0 0 0) (11+ 4- 11+: 0 0 0) [1 1 1] 0 0 (5+ 2- 5+: 0 -1 0) (5+ 2- 5+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (4- 11+ 4-: 0 0 0) (4- 11+ 4-: 0 0 0) [1 1 1] 0 0 (2- 5+ 2-: 0 1 0) (2- 5+ 2-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (11+ 11+ 4-: 0 0 0) (11+ 11+ 4-: 0 0 0) [1 1 1] 0 0 (5+ 5+ 2-: 0 1 0) (5+ 5+ 2-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (4- 11+ 11+: 0 0 0) (4- 11+ 11+: 0 0 0) [1 1 1] 0 0 (2- 5+ 5+: 0 1 0) (2- 5+ 5+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (11+ 11+ 11+: 0 0 0) (11+ 11+ 11+: 0 0 0) [1 1 1] 0 0 (5+ 5+ 5+: 0 1 0) (5+ 5+ 5+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (14- 14- 14-: 0 0 1) (14- 19+ 19+: 0 -1 -2) [1 2 2] 0 1 (7- 7- 7-: -1 0 0) (7- 9+ 9+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (14- 14- 14-: 0 1 1) (14- 19+ 19+: 0 0 -2) [1 2 2] 0 1 (7- 7- 7-: -1 0 0) (7- 9+ 9+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (14- 14- 14-: 0 0 2) (14- 19+ 19+: 0 -1 -1) [1 2 2] 0 1 (7- 7- 7-: -1 0 1) (7- 9+ 9+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (14- 14- 14-: 0 1 2) (14- 19+ 19+: 0 0 -1) [1 2 2] 0 1 (7- 7- 7-: -1 0 1) (7- 9+ 9+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (19+ 14- 14-: 0 0 2) (19+ 19+ 19+: 0 -1 -1) [1 2 2] 0 1 (9+ 7- 7-: 1 0 1) (9+ 9+ 9+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (19+ 14- 14-: 0 1 2) (19+ 19+ 19+: 0 0 -1) [1 2 2] 0 1 (9+ 7- 7-: 1 0 1) (9+ 9+ 9+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (19+ 14- 14-: 0 0 1) (19+ 19+ 19+: 0 -1 -2) [1 2 2] 0 1 (9+ 7- 7-: 1 0 0) (9+ 9+ 9+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (19+ 14- 14-: 0 1 1) (19+ 19+ 19+: 0 0 -2) [1 2 2] 0 1 (9+ 7- 7-: 1 0 0) (9+ 9+ 9+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (14- 14- 14-: 2 0 1) (19+ 14- 19+: -1 0 -2) [2 1 2] 0 1 (7- 7- 7-: 1 -1 0) (9+ 7- 9+: 0 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (14- 14- 14-: 2 0 2) (19+ 14- 19+: -1 0 -1) [2 1 2] 0 1 (7- 7- 7-: 1 -1 1) (9+ 7- 9+: 0 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (14- 14- 14-: 1 0 1) (19+ 14- 19+: -2 0 -2) [2 1 2] 0 1 (7- 7- 7-: 0 -1 0) (9+ 7- 9+: -1 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (14- 14- 14-: 1 0 2) (19+ 14- 19+: -2 0 -1) [2 1 2] 0 1 (7- 7- 7-: 0 -1 1) (9+ 7- 9+: -1 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (14- 19+ 14-: 2 0 2) (19+ 19+ 19+: -1 0 -1) [2 1 2] 0 1 (7- 9+ 7-: 1 1 1) (9+ 9+ 9+: 0 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (14- 19+ 14-: 2 0 1) (19+ 19+ 19+: -1 0 -2) [2 1 2] 0 1 (7- 9+ 7-: 1 1 0) (9+ 9+ 9+: 0 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (14- 19+ 14-: 1 0 2) (19+ 19+ 19+: -2 0 -1) [2 1 2] 0 1 (7- 9+ 7-: 0 1 1) (9+ 9+ 9+: -1 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (14- 19+ 14-: 1 0 1) (19+ 19+ 19+: -2 0 -2) [2 1 2] 0 1 (7- 9+ 7-: 0 1 0) (9+ 9+ 9+: -1 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (14- 14- 14-: 0 0 0) (19+ 19+ 14-: -1 -1 0) [2 2 1] 0 1 (7- 7- 7-: 0 0 -1) (9+ 9+ 7-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (14- 14- 14-: 0 1 0) (19+ 19+ 14-: -1 0 0) [2 2 1] 0 1 (7- 7- 7-: 0 0 -1) (9+ 9+ 7-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (14- 14- 14-: 1 0 0) (19+ 19+ 14-: 0 -1 0) [2 2 1] 0 1 (7- 7- 7-: 0 0 -1) (9+ 9+ 7-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (14- 14- 14-: 1 1 0) (19+ 19+ 14-: 0 0 0) [2 2 1] 0 1 (7- 7- 7-: 0 0 -1) (9+ 9+ 7-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (14- 14- 19+: 1 0 0) (19+ 19+ 19+: 0 -1 0) [2 2 1] 0 1 (7- 7- 9+: 0 0 1) (9+ 9+ 9+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (14- 14- 19+: 1 1 0) (19+ 19+ 19+: 0 0 0) [2 2 1] 0 1 (7- 7- 9+: 0 0 1) (9+ 9+ 9+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (14- 14- 19+: 0 0 0) (19+ 19+ 19+: -1 -1 0) [2 2 1] 0 1 (7- 7- 9+: 0 0 1) (9+ 9+ 9+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (14- 14- 19+: 0 1 0) (19+ 19+ 19+: -1 0 0) [2 2 1] 0 1 (7- 7- 9+: 0 0 1) (9+ 9+ 9+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (14- 14- 14-: 0 0 0) (14- 19+ 14-: 0 -1 0) [1 2 1] 0 1 (7- 7- 7-: -1 0 0) (7- 9+ 7-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (14- 14- 14-: 0 1 0) (14- 19+ 14-: 0 0 0) [1 2 1] 0 1 (7- 7- 7-: -1 0 0) (7- 9+ 7-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (19+ 14- 19+: 0 0 0) (19+ 19+ 19+: 0 -1 0) [1 2 1] 0 1 (9+ 7- 9+: 1 0 0) (9+ 9+ 9+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (19+ 14- 19+: 0 1 0) (19+ 19+ 19+: 0 0 0) [1 2 1] 0 1 (9+ 7- 9+: 1 0 0) (9+ 9+ 9+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (19+ 14- 14-: 0 0 0) (19+ 19+ 14-: 0 -1 0) [1 2 1] 0 1 (9+ 7- 7-: 1 0 0) (9+ 9+ 7-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (19+ 14- 14-: 0 1 0) (19+ 19+ 14-: 0 0 0) [1 2 1] 0 1 (9+ 7- 7-: 1 0 0) (9+ 9+ 7-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (14- 14- 19+: 0 0 0) (14- 19+ 19+: 0 -1 0) [1 2 1] 0 1 (7- 7- 9+: -1 0 0) (7- 9+ 9+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (14- 14- 19+: 0 1 0) (14- 19+ 19+: 0 0 0) [1 2 1] 0 1 (7- 7- 9+: -1 0 0) (7- 9+ 9+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (14- 14- 14-: 2 0 0) (19+ 14- 14-: -1 0 0) [2 1 1] 0 1 (7- 7- 7-: 1 -1 0) (9+ 7- 7-: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (14- 14- 14-: 0 0 2) (14- 14- 19+: 0 0 -1) [1 1 2] 0 1 (7- 7- 7-: 0 -1 1) (7- 7- 9+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (14- 14- 19+: 2 0 0) (19+ 14- 19+: -1 0 0) [2 1 1] 0 1 (7- 7- 9+: 1 -1 0) (9+ 7- 9+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (19+ 14- 14-: 0 0 2) (19+ 14- 19+: 0 0 -1) [1 1 2] 0 1 (9+ 7- 7-: 0 -1 1) (9+ 7- 9+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (14- 14- 14-: 1 0 0) (19+ 14- 14-: -2 0 0) [2 1 1] 0 1 (7- 7- 7-: 0 -1 0) (9+ 7- 7-: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (14- 14- 14-: 0 0 1) (14- 14- 19+: 0 0 -2) [1 1 2] 0 1 (7- 7- 7-: 0 -1 0) (7- 7- 9+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (14- 14- 19+: 1 0 0) (19+ 14- 19+: -2 0 0) [2 1 1] 0 1 (7- 7- 9+: 0 -1 0) (9+ 7- 9+: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (19+ 14- 14-: 0 0 1) (19+ 14- 19+: 0 0 -2) [1 1 2] 0 1 (9+ 7- 7-: 0 -1 0) (9+ 7- 9+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (14- 19+ 14-: 2 0 0) (19+ 19+ 14-: -1 0 0) [2 1 1] 0 1 (7- 9+ 7-: 1 1 0) (9+ 9+ 7-: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (14- 19+ 14-: 0 0 2) (14- 19+ 19+: 0 0 -1) [1 1 2] 0 1 (7- 9+ 7-: 0 1 1) (7- 9+ 9+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (14- 19+ 19+: 2 0 0) (19+ 19+ 19+: -1 0 0) [2 1 1] 0 1 (7- 9+ 9+: 1 1 0) (9+ 9+ 9+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (19+ 19+ 14-: 0 0 2) (19+ 19+ 19+: 0 0 -1) [1 1 2] 0 1 (9+ 9+ 7-: 0 1 1) (9+ 9+ 9+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (14- 19+ 14-: 1 0 0) (19+ 19+ 14-: -2 0 0) [2 1 1] 0 1 (7- 9+ 7-: 0 1 0) (9+ 9+ 7-: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (14- 19+ 14-: 0 0 1) (14- 19+ 19+: 0 0 -2) [1 1 2] 0 1 (7- 9+ 7-: 0 1 0) (7- 9+ 9+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (14- 19+ 19+: 1 0 0) (19+ 19+ 19+: -2 0 0) [2 1 1] 0 1 (7- 9+ 9+: 0 1 0) (9+ 9+ 9+: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (19+ 19+ 14-: 0 0 1) (19+ 19+ 19+: 0 0 -2) [1 1 2] 0 1 (9+ 9+ 7-: 0 1 0) (9+ 9+ 9+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (14- 14- 14-: 0 0 0) (14- 14- 14-: 0 0 0) [1 1 1] 0 1 (7- 7- 7-: 0 -1 0) (7- 7- 7-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (19+ 14- 14-: 0 0 0) (19+ 14- 14-: 0 0 0) [1 1 1] 0 1 (9+ 7- 7-: 0 -1 0) (9+ 7- 7-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (14- 14- 19+: 0 0 0) (14- 14- 19+: 0 0 0) [1 1 1] 0 1 (7- 7- 9+: 0 -1 0) (7- 7- 9+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (19+ 14- 19+: 0 0 0) (19+ 14- 19+: 0 0 0) [1 1 1] 0 1 (9+ 7- 9+: 0 -1 0) (9+ 7- 9+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (14- 19+ 14-: 0 0 0) (14- 19+ 14-: 0 0 0) [1 1 1] 0 1 (7- 9+ 7-: 0 1 0) (7- 9+ 7-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (19+ 19+ 14-: 0 0 0) (19+ 19+ 14-: 0 0 0) [1 1 1] 0 1 (9+ 9+ 7-: 0 1 0) (9+ 9+ 7-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (14- 19+ 19+: 0 0 0) (14- 19+ 19+: 0 0 0) [1 1 1] 0 1 (7- 9+ 9+: 0 1 0) (7- 9+ 9+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (19+ 19+ 19+: 0 0 0) (19+ 19+ 19+: 0 0 0) [1 1 1] 0 1 (9+ 9+ 9+: 0 1 0) (9+ 9+ 9+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -############################################################# -FacParts: 0 0 [1 1 1] -FacParts: 1 1 [2 2 2] -FacParts: 2 2 [2 2 2] - -ProcessPoolCreate: 1 - -# ProcessPoolSetPart: pool part -ProcessPoolSetPart: 0 0 -ProcessPoolSetPart: 0 1 -ProcessPoolSetPart: 0 2 diff --git a/src/test/TEST_fac/3lev_multibox.in b/src/test/TEST_fac/3lev_multibox.in deleted file mode 100644 index fbd33db223..0000000000 --- a/src/test/TEST_fac/3lev_multibox.in +++ /dev/null @@ -1,394 +0,0 @@ -# Copyright (c) 1998 Lawrence Livermore 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 3 -############################################################# -# GridSetExtents: part ilower(ndim) iupper(ndim) -GridSetExtents: 0 (1- 1- 1-) (12+ 12+ 12+) -GridSetExtents: 1 (4- 4- 4-) (11+ 11+ 11+) -GridSetExtents: 1 (14- 14- 14-) (19+ 19+ 19+) -GridSetExtents: 2 (10- 10- 10-) (21+ 21+ 21+) -GridSetExtents: 2 (30- 30- 30-) (37+ 37+ 37+) -############################################################# - -# GridSetVariables: part nvars vartypes[nvars] -# CELL = 0 -# NODE = 1 -# XFACE = 2 -# YFACE = 3 -# ZFACE = 4 -# XEDGE = 5 -# YEDGE = 6 -# ZEDGE = 7 - -GridSetVariables: 0 1 [0] -GridSetVariables: 1 1 [0] -GridSetVariables: 2 1 [0] -############################################################# - -# StencilCreate: nstencils sizes[nstencils] -StencilCreate: 1 [7] -############################################################# - -# StencilSetEntry: stencil_num entry offset[ndim] var value -StencilSetEntry: 0 0 [ 0 0 0] 0 6.000000 -StencilSetEntry: 0 1 [-1 0 0] 0 -1.000000 -StencilSetEntry: 0 2 [ 1 0 0] 0 -1.000000 -StencilSetEntry: 0 3 [ 0 -1 0] 0 -1.000000 -StencilSetEntry: 0 4 [ 0 0 1] 0 -1.000000 -StencilSetEntry: 0 5 [ 0 0 -1] 0 -1.000000 -StencilSetEntry: 0 6 [ 0 1 0] 0 -1.000000 -############################################################# - -# GraphSetStencil: part var stencil_num -GraphSetStencil: 0 0 0 -GraphSetStencil: 1 0 0 -GraphSetStencil: 2 0 0 -############################################################# - -# GraphAddEntries: \ - -# part ilower(ndim) iupper(ndim) stride[ndim] var \ - -# to_part to_ilower(ndim) to_iupper(ndim) to_stride[ndim] to_var \ - -# index_map[ndim] entry value -GraphAddEntries: 0 (2- 2- 2-: -1 0 0) (2- 5+ 5+: -1 0 0) [1 1 1] 0 1 (4- 4- 4-: 0 0 1) (4- 11+ 11+: 0 -1 0) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: -1 0 0) (2- 5+ 5+: -1 0 0) [1 1 1] 0 1 (4- 4- 4-: 0 1 1) (4- 11+ 11+: 0 0 0) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: -1 0 0) (2- 5+ 5+: -1 0 0) [1 1 1] 0 1 (4- 4- 4-: 0 0 0) (4- 11+ 11+: 0 -1 -1) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: -1 0 0) (2- 5+ 5+: -1 0 0) [1 1 1] 0 1 (4- 4- 4-: 0 1 0) (4- 11+ 11+: 0 0 -1) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (7- 7- 7-: -1 0 0) (7- 9+ 9+: -1 0 0) [1 1 1] 0 1 (14- 14- 14-: 0 0 1) (14- 19+ 19+: 0 -1 0) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (7- 7- 7-: -1 0 0) (7- 9+ 9+: -1 0 0) [1 1 1] 0 1 (14- 14- 14-: 0 1 1) (14- 19+ 19+: 0 0 0) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (7- 7- 7-: -1 0 0) (7- 9+ 9+: -1 0 0) [1 1 1] 0 1 (14- 14- 14-: 0 0 0) (14- 19+ 19+: 0 -1 -1) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (7- 7- 7-: -1 0 0) (7- 9+ 9+: -1 0 0) [1 1 1] 0 1 (14- 14- 14-: 0 1 0) (14- 19+ 19+: 0 0 -1) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (5+ 2- 2-: 1 0 0) (5+ 5+ 5+: 1 0 0) [1 1 1] 0 1 (11+ 4- 4-: 0 0 0) (11+ 11+ 11+: 0 -1 -1) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (5+ 2- 2-: 1 0 0) (5+ 5+ 5+: 1 0 0) [1 1 1] 0 1 (11+ 4- 4-: 0 1 0) (11+ 11+ 11+: 0 0 -1) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (5+ 2- 2-: 1 0 0) (5+ 5+ 5+: 1 0 0) [1 1 1] 0 1 (11+ 4- 4-: 0 0 1) (11+ 11+ 11+: 0 -1 0) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (5+ 2- 2-: 1 0 0) (5+ 5+ 5+: 1 0 0) [1 1 1] 0 1 (11+ 4- 4-: 0 1 1) (11+ 11+ 11+: 0 0 0) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (9+ 7- 7-: 1 0 0) (9+ 9+ 9+: 1 0 0) [1 1 1] 0 1 (19+ 14- 14-: 0 0 0) (19+ 19+ 19+: 0 -1 -1) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (9+ 7- 7-: 1 0 0) (9+ 9+ 9+: 1 0 0) [1 1 1] 0 1 (19+ 14- 14-: 0 1 0) (19+ 19+ 19+: 0 0 -1) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (9+ 7- 7-: 1 0 0) (9+ 9+ 9+: 1 0 0) [1 1 1] 0 1 (19+ 14- 14-: 0 0 1) (19+ 19+ 19+: 0 -1 0) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (9+ 7- 7-: 1 0 0) (9+ 9+ 9+: 1 0 0) [1 1 1] 0 1 (19+ 14- 14-: 0 1 1) (19+ 19+ 19+: 0 0 0) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 -1 0) (5+ 2- 5+: 0 -1 0) [1 1 1] 0 1 (4- 4- 4-: 0 0 1) (11+ 4- 11+: -1 0 0) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 -1 0) (5+ 2- 5+: 0 -1 0) [1 1 1] 0 1 (4- 4- 4-: 0 0 0) (11+ 4- 11+: -1 0 -1) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 -1 0) (5+ 2- 5+: 0 -1 0) [1 1 1] 0 1 (4- 4- 4-: 1 0 1) (11+ 4- 11+: 0 0 0) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 -1 0) (5+ 2- 5+: 0 -1 0) [1 1 1] 0 1 (4- 4- 4-: 1 0 0) (11+ 4- 11+: 0 0 -1) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (7- 7- 7-: 0 -1 0) (9+ 7- 9+: 0 -1 0) [1 1 1] 0 1 (14- 14- 14-: 0 0 1) (19+ 14- 19+: -1 0 0) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (7- 7- 7-: 0 -1 0) (9+ 7- 9+: 0 -1 0) [1 1 1] 0 1 (14- 14- 14-: 0 0 0) (19+ 14- 19+: -1 0 -1) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (7- 7- 7-: 0 -1 0) (9+ 7- 9+: 0 -1 0) [1 1 1] 0 1 (14- 14- 14-: 1 0 1) (19+ 14- 19+: 0 0 0) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (7- 7- 7-: 0 -1 0) (9+ 7- 9+: 0 -1 0) [1 1 1] 0 1 (14- 14- 14-: 1 0 0) (19+ 14- 19+: 0 0 -1) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (2- 5+ 2-: 0 1 0) (5+ 5+ 5+: 0 1 0) [1 1 1] 0 1 (4- 11+ 4-: 0 0 0) (11+ 11+ 11+: -1 0 -1) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (2- 5+ 2-: 0 1 0) (5+ 5+ 5+: 0 1 0) [1 1 1] 0 1 (4- 11+ 4-: 0 0 1) (11+ 11+ 11+: -1 0 0) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (2- 5+ 2-: 0 1 0) (5+ 5+ 5+: 0 1 0) [1 1 1] 0 1 (4- 11+ 4-: 1 0 0) (11+ 11+ 11+: 0 0 -1) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (2- 5+ 2-: 0 1 0) (5+ 5+ 5+: 0 1 0) [1 1 1] 0 1 (4- 11+ 4-: 1 0 1) (11+ 11+ 11+: 0 0 0) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (7- 9+ 7-: 0 1 0) (9+ 9+ 9+: 0 1 0) [1 1 1] 0 1 (14- 19+ 14-: 0 0 0) (19+ 19+ 19+: -1 0 -1) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (7- 9+ 7-: 0 1 0) (9+ 9+ 9+: 0 1 0) [1 1 1] 0 1 (14- 19+ 14-: 0 0 1) (19+ 19+ 19+: -1 0 0) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (7- 9+ 7-: 0 1 0) (9+ 9+ 9+: 0 1 0) [1 1 1] 0 1 (14- 19+ 14-: 1 0 0) (19+ 19+ 19+: 0 0 -1) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (7- 9+ 7-: 0 1 0) (9+ 9+ 9+: 0 1 0) [1 1 1] 0 1 (14- 19+ 14-: 1 0 1) (19+ 19+ 19+: 0 0 0) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 0 -1) (5+ 5+ 2-: 0 0 -1) [1 1 1] 0 1 (4- 4- 4-: 0 0 0) (11+ 11+ 4-: -1 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 0 -1) (5+ 5+ 2-: 0 0 -1) [1 1 1] 0 1 (4- 4- 4-: 0 1 0) (11+ 11+ 4-: -1 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 0 -1) (5+ 5+ 2-: 0 0 -1) [1 1 1] 0 1 (4- 4- 4-: 1 0 0) (11+ 11+ 4-: 0 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 0 -1) (5+ 5+ 2-: 0 0 -1) [1 1 1] 0 1 (4- 4- 4-: 1 1 0) (11+ 11+ 4-: 0 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (7- 7- 7-: 0 0 -1) (9+ 9+ 7-: 0 0 -1) [1 1 1] 0 1 (14- 14- 14-: 0 0 0) (19+ 19+ 14-: -1 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (7- 7- 7-: 0 0 -1) (9+ 9+ 7-: 0 0 -1) [1 1 1] 0 1 (14- 14- 14-: 0 1 0) (19+ 19+ 14-: -1 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (7- 7- 7-: 0 0 -1) (9+ 9+ 7-: 0 0 -1) [1 1 1] 0 1 (14- 14- 14-: 1 0 0) (19+ 19+ 14-: 0 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (7- 7- 7-: 0 0 -1) (9+ 9+ 7-: 0 0 -1) [1 1 1] 0 1 (14- 14- 14-: 1 1 0) (19+ 19+ 14-: 0 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (2- 2- 5+: 0 0 1) (5+ 5+ 5+: 0 0 1) [1 1 1] 0 1 (4- 4- 11+: 1 0 0) (11+ 11+ 11+: 0 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (2- 2- 5+: 0 0 1) (5+ 5+ 5+: 0 0 1) [1 1 1] 0 1 (4- 4- 11+: 1 1 0) (11+ 11+ 11+: 0 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (2- 2- 5+: 0 0 1) (5+ 5+ 5+: 0 0 1) [1 1 1] 0 1 (4- 4- 11+: 0 0 0) (11+ 11+ 11+: -1 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (2- 2- 5+: 0 0 1) (5+ 5+ 5+: 0 0 1) [1 1 1] 0 1 (4- 4- 11+: 0 1 0) (11+ 11+ 11+: -1 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (7- 7- 9+: 0 0 1) (9+ 9+ 9+: 0 0 1) [1 1 1] 0 1 (14- 14- 19+: 1 0 0) (19+ 19+ 19+: 0 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (7- 7- 9+: 0 0 1) (9+ 9+ 9+: 0 0 1) [1 1 1] 0 1 (14- 14- 19+: 1 1 0) (19+ 19+ 19+: 0 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (7- 7- 9+: 0 0 1) (9+ 9+ 9+: 0 0 1) [1 1 1] 0 1 (14- 14- 19+: 0 0 0) (19+ 19+ 19+: -1 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (7- 7- 9+: 0 0 1) (9+ 9+ 9+: 0 0 1) [1 1 1] 0 1 (14- 14- 19+: 0 1 0) (19+ 19+ 19+: -1 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 1) (4- 11+ 11+: 0 -1 -2) [1 2 2] 0 0 (2- 2- 2-: -1 0 0) (2- 5+ 5+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 1 1) (4- 11+ 11+: 0 0 -2) [1 2 2] 0 0 (2- 2- 2-: -1 0 0) (2- 5+ 5+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 2) (4- 11+ 11+: 0 -1 -1) [1 2 2] 0 0 (2- 2- 2-: -1 0 1) (2- 5+ 5+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 1 2) (4- 11+ 11+: 0 0 -1) [1 2 2] 0 0 (2- 2- 2-: -1 0 1) (2- 5+ 5+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (14- 14- 14-: 0 0 1) (14- 19+ 19+: 0 -1 -2) [1 2 2] 0 0 (7- 7- 7-: -1 0 0) (7- 9+ 9+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (14- 14- 14-: 0 1 1) (14- 19+ 19+: 0 0 -2) [1 2 2] 0 0 (7- 7- 7-: -1 0 0) (7- 9+ 9+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (14- 14- 14-: 0 0 2) (14- 19+ 19+: 0 -1 -1) [1 2 2] 0 0 (7- 7- 7-: -1 0 1) (7- 9+ 9+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (14- 14- 14-: 0 1 2) (14- 19+ 19+: 0 0 -1) [1 2 2] 0 0 (7- 7- 7-: -1 0 1) (7- 9+ 9+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (11+ 4- 4-: 0 0 2) (11+ 11+ 11+: 0 -1 -1) [1 2 2] 0 0 (5+ 2- 2-: 1 0 1) (5+ 5+ 5+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (11+ 4- 4-: 0 1 2) (11+ 11+ 11+: 0 0 -1) [1 2 2] 0 0 (5+ 2- 2-: 1 0 1) (5+ 5+ 5+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (11+ 4- 4-: 0 0 1) (11+ 11+ 11+: 0 -1 -2) [1 2 2] 0 0 (5+ 2- 2-: 1 0 0) (5+ 5+ 5+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (11+ 4- 4-: 0 1 1) (11+ 11+ 11+: 0 0 -2) [1 2 2] 0 0 (5+ 2- 2-: 1 0 0) (5+ 5+ 5+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (19+ 14- 14-: 0 0 2) (19+ 19+ 19+: 0 -1 -1) [1 2 2] 0 0 (9+ 7- 7-: 1 0 1) (9+ 9+ 9+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (19+ 14- 14-: 0 1 2) (19+ 19+ 19+: 0 0 -1) [1 2 2] 0 0 (9+ 7- 7-: 1 0 1) (9+ 9+ 9+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (19+ 14- 14-: 0 0 1) (19+ 19+ 19+: 0 -1 -2) [1 2 2] 0 0 (9+ 7- 7-: 1 0 0) (9+ 9+ 9+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (19+ 14- 14-: 0 1 1) (19+ 19+ 19+: 0 0 -2) [1 2 2] 0 0 (9+ 7- 7-: 1 0 0) (9+ 9+ 9+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 2 0 1) (11+ 4- 11+: -1 0 -2) [2 1 2] 0 0 (2- 2- 2-: 1 -1 0) (5+ 2- 5+: 0 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 2 0 2) (11+ 4- 11+: -1 0 -1) [2 1 2] 0 0 (2- 2- 2-: 1 -1 1) (5+ 2- 5+: 0 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 1 0 1) (11+ 4- 11+: -2 0 -2) [2 1 2] 0 0 (2- 2- 2-: 0 -1 0) (5+ 2- 5+: -1 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 1 0 2) (11+ 4- 11+: -2 0 -1) [2 1 2] 0 0 (2- 2- 2-: 0 -1 1) (5+ 2- 5+: -1 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (14- 14- 14-: 2 0 1) (19+ 14- 19+: -1 0 -2) [2 1 2] 0 0 (7- 7- 7-: 1 -1 0) (9+ 7- 9+: 0 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (14- 14- 14-: 2 0 2) (19+ 14- 19+: -1 0 -1) [2 1 2] 0 0 (7- 7- 7-: 1 -1 1) (9+ 7- 9+: 0 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (14- 14- 14-: 1 0 1) (19+ 14- 19+: -2 0 -2) [2 1 2] 0 0 (7- 7- 7-: 0 -1 0) (9+ 7- 9+: -1 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (14- 14- 14-: 1 0 2) (19+ 14- 19+: -2 0 -1) [2 1 2] 0 0 (7- 7- 7-: 0 -1 1) (9+ 7- 9+: -1 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 11+ 4-: 2 0 2) (11+ 11+ 11+: -1 0 -1) [2 1 2] 0 0 (2- 5+ 2-: 1 1 1) (5+ 5+ 5+: 0 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 11+ 4-: 2 0 1) (11+ 11+ 11+: -1 0 -2) [2 1 2] 0 0 (2- 5+ 2-: 1 1 0) (5+ 5+ 5+: 0 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 11+ 4-: 1 0 2) (11+ 11+ 11+: -2 0 -1) [2 1 2] 0 0 (2- 5+ 2-: 0 1 1) (5+ 5+ 5+: -1 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 11+ 4-: 1 0 1) (11+ 11+ 11+: -2 0 -2) [2 1 2] 0 0 (2- 5+ 2-: 0 1 0) (5+ 5+ 5+: -1 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (14- 19+ 14-: 2 0 2) (19+ 19+ 19+: -1 0 -1) [2 1 2] 0 0 (7- 9+ 7-: 1 1 1) (9+ 9+ 9+: 0 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (14- 19+ 14-: 2 0 1) (19+ 19+ 19+: -1 0 -2) [2 1 2] 0 0 (7- 9+ 7-: 1 1 0) (9+ 9+ 9+: 0 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (14- 19+ 14-: 1 0 2) (19+ 19+ 19+: -2 0 -1) [2 1 2] 0 0 (7- 9+ 7-: 0 1 1) (9+ 9+ 9+: -1 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (14- 19+ 14-: 1 0 1) (19+ 19+ 19+: -2 0 -2) [2 1 2] 0 0 (7- 9+ 7-: 0 1 0) (9+ 9+ 9+: -1 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 0) (11+ 11+ 4-: -1 -1 0) [2 2 1] 0 0 (2- 2- 2-: 0 0 -1) (5+ 5+ 2-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 1 0) (11+ 11+ 4-: -1 0 0) [2 2 1] 0 0 (2- 2- 2-: 0 0 -1) (5+ 5+ 2-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 1 0 0) (11+ 11+ 4-: 0 -1 0) [2 2 1] 0 0 (2- 2- 2-: 0 0 -1) (5+ 5+ 2-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 1 1 0) (11+ 11+ 4-: 0 0 0) [2 2 1] 0 0 (2- 2- 2-: 0 0 -1) (5+ 5+ 2-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (14- 14- 14-: 0 0 0) (19+ 19+ 14-: -1 -1 0) [2 2 1] 0 0 (7- 7- 7-: 0 0 -1) (9+ 9+ 7-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (14- 14- 14-: 0 1 0) (19+ 19+ 14-: -1 0 0) [2 2 1] 0 0 (7- 7- 7-: 0 0 -1) (9+ 9+ 7-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (14- 14- 14-: 1 0 0) (19+ 19+ 14-: 0 -1 0) [2 2 1] 0 0 (7- 7- 7-: 0 0 -1) (9+ 9+ 7-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (14- 14- 14-: 1 1 0) (19+ 19+ 14-: 0 0 0) [2 2 1] 0 0 (7- 7- 7-: 0 0 -1) (9+ 9+ 7-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 11+: 1 0 0) (11+ 11+ 11+: 0 -1 0) [2 2 1] 0 0 (2- 2- 5+: 0 0 1) (5+ 5+ 5+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 11+: 1 1 0) (11+ 11+ 11+: 0 0 0) [2 2 1] 0 0 (2- 2- 5+: 0 0 1) (5+ 5+ 5+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 11+: 0 0 0) (11+ 11+ 11+: -1 -1 0) [2 2 1] 0 0 (2- 2- 5+: 0 0 1) (5+ 5+ 5+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 11+: 0 1 0) (11+ 11+ 11+: -1 0 0) [2 2 1] 0 0 (2- 2- 5+: 0 0 1) (5+ 5+ 5+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (14- 14- 19+: 1 0 0) (19+ 19+ 19+: 0 -1 0) [2 2 1] 0 0 (7- 7- 9+: 0 0 1) (9+ 9+ 9+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (14- 14- 19+: 1 1 0) (19+ 19+ 19+: 0 0 0) [2 2 1] 0 0 (7- 7- 9+: 0 0 1) (9+ 9+ 9+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (14- 14- 19+: 0 0 0) (19+ 19+ 19+: -1 -1 0) [2 2 1] 0 0 (7- 7- 9+: 0 0 1) (9+ 9+ 9+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (14- 14- 19+: 0 1 0) (19+ 19+ 19+: -1 0 0) [2 2 1] 0 0 (7- 7- 9+: 0 0 1) (9+ 9+ 9+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (5- 5- 5-: -1 0 0) (5- 10+ 10+: -1 0 0) [1 1 1] 0 2 (10- 10- 10-: 0 0 1) (10- 21+ 21+: 0 -1 0) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: -1 0 0) (5- 10+ 10+: -1 0 0) [1 1 1] 0 2 (10- 10- 10-: 0 1 1) (10- 21+ 21+: 0 0 0) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: -1 0 0) (5- 10+ 10+: -1 0 0) [1 1 1] 0 2 (10- 10- 10-: 0 0 0) (10- 21+ 21+: 0 -1 -1) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: -1 0 0) (5- 10+ 10+: -1 0 0) [1 1 1] 0 2 (10- 10- 10-: 0 1 0) (10- 21+ 21+: 0 0 -1) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (15- 15- 15-: -1 0 0) (15- 18+ 18+: -1 0 0) [1 1 1] 0 2 (30- 30- 30-: 0 0 1) (30- 37+ 37+: 0 -1 0) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (15- 15- 15-: -1 0 0) (15- 18+ 18+: -1 0 0) [1 1 1] 0 2 (30- 30- 30-: 0 1 1) (30- 37+ 37+: 0 0 0) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (15- 15- 15-: -1 0 0) (15- 18+ 18+: -1 0 0) [1 1 1] 0 2 (30- 30- 30-: 0 0 0) (30- 37+ 37+: 0 -1 -1) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (15- 15- 15-: -1 0 0) (15- 18+ 18+: -1 0 0) [1 1 1] 0 2 (30- 30- 30-: 0 1 0) (30- 37+ 37+: 0 0 -1) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (10+ 5- 5-: 1 0 0) (10+ 10+ 10+: 1 0 0) [1 1 1] 0 2 (21+ 10- 10-: 0 0 0) (21+ 21+ 21+: 0 -1 -1) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (10+ 5- 5-: 1 0 0) (10+ 10+ 10+: 1 0 0) [1 1 1] 0 2 (21+ 10- 10-: 0 1 0) (21+ 21+ 21+: 0 0 -1) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (10+ 5- 5-: 1 0 0) (10+ 10+ 10+: 1 0 0) [1 1 1] 0 2 (21+ 10- 10-: 0 0 1) (21+ 21+ 21+: 0 -1 0) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (10+ 5- 5-: 1 0 0) (10+ 10+ 10+: 1 0 0) [1 1 1] 0 2 (21+ 10- 10-: 0 1 1) (21+ 21+ 21+: 0 0 0) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (18+ 15- 15-: 1 0 0) (18+ 18+ 18+: 1 0 0) [1 1 1] 0 2 (37+ 30- 30-: 0 0 0) (37+ 37+ 37+: 0 -1 -1) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (18+ 15- 15-: 1 0 0) (18+ 18+ 18+: 1 0 0) [1 1 1] 0 2 (37+ 30- 30-: 0 1 0) (37+ 37+ 37+: 0 0 -1) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (18+ 15- 15-: 1 0 0) (18+ 18+ 18+: 1 0 0) [1 1 1] 0 2 (37+ 30- 30-: 0 0 1) (37+ 37+ 37+: 0 -1 0) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (18+ 15- 15-: 1 0 0) (18+ 18+ 18+: 1 0 0) [1 1 1] 0 2 (37+ 30- 30-: 0 1 1) (37+ 37+ 37+: 0 0 0) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 -1 0) (10+ 5- 10+: 0 -1 0) [1 1 1] 0 2 (10- 10- 10-: 0 0 1) (21+ 10- 21+: -1 0 0) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 -1 0) (10+ 5- 10+: 0 -1 0) [1 1 1] 0 2 (10- 10- 10-: 0 0 0) (21+ 10- 21+: -1 0 -1) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 -1 0) (10+ 5- 10+: 0 -1 0) [1 1 1] 0 2 (10- 10- 10-: 1 0 1) (21+ 10- 21+: 0 0 0) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 -1 0) (10+ 5- 10+: 0 -1 0) [1 1 1] 0 2 (10- 10- 10-: 1 0 0) (21+ 10- 21+: 0 0 -1) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (15- 15- 15-: 0 -1 0) (18+ 15- 18+: 0 -1 0) [1 1 1] 0 2 (30- 30- 30-: 0 0 1) (37+ 30- 37+: -1 0 0) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (15- 15- 15-: 0 -1 0) (18+ 15- 18+: 0 -1 0) [1 1 1] 0 2 (30- 30- 30-: 0 0 0) (37+ 30- 37+: -1 0 -1) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (15- 15- 15-: 0 -1 0) (18+ 15- 18+: 0 -1 0) [1 1 1] 0 2 (30- 30- 30-: 1 0 1) (37+ 30- 37+: 0 0 0) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (15- 15- 15-: 0 -1 0) (18+ 15- 18+: 0 -1 0) [1 1 1] 0 2 (30- 30- 30-: 1 0 0) (37+ 30- 37+: 0 0 -1) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (5- 10+ 5-: 0 1 0) (10+ 10+ 10+: 0 1 0) [1 1 1] 0 2 (10- 21+ 10-: 0 0 0) (21+ 21+ 21+: -1 0 -1) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (5- 10+ 5-: 0 1 0) (10+ 10+ 10+: 0 1 0) [1 1 1] 0 2 (10- 21+ 10-: 0 0 1) (21+ 21+ 21+: -1 0 0) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (5- 10+ 5-: 0 1 0) (10+ 10+ 10+: 0 1 0) [1 1 1] 0 2 (10- 21+ 10-: 1 0 0) (21+ 21+ 21+: 0 0 -1) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (5- 10+ 5-: 0 1 0) (10+ 10+ 10+: 0 1 0) [1 1 1] 0 2 (10- 21+ 10-: 1 0 1) (21+ 21+ 21+: 0 0 0) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (15- 18+ 15-: 0 1 0) (18+ 18+ 18+: 0 1 0) [1 1 1] 0 2 (30- 37+ 30-: 0 0 0) (37+ 37+ 37+: -1 0 -1) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (15- 18+ 15-: 0 1 0) (18+ 18+ 18+: 0 1 0) [1 1 1] 0 2 (30- 37+ 30-: 0 0 1) (37+ 37+ 37+: -1 0 0) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (15- 18+ 15-: 0 1 0) (18+ 18+ 18+: 0 1 0) [1 1 1] 0 2 (30- 37+ 30-: 1 0 0) (37+ 37+ 37+: 0 0 -1) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (15- 18+ 15-: 0 1 0) (18+ 18+ 18+: 0 1 0) [1 1 1] 0 2 (30- 37+ 30-: 1 0 1) (37+ 37+ 37+: 0 0 0) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 0 -1) (10+ 10+ 5-: 0 0 -1) [1 1 1] 0 2 (10- 10- 10-: 0 0 0) (21+ 21+ 10-: -1 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 0 -1) (10+ 10+ 5-: 0 0 -1) [1 1 1] 0 2 (10- 10- 10-: 0 1 0) (21+ 21+ 10-: -1 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 0 -1) (10+ 10+ 5-: 0 0 -1) [1 1 1] 0 2 (10- 10- 10-: 1 0 0) (21+ 21+ 10-: 0 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 0 -1) (10+ 10+ 5-: 0 0 -1) [1 1 1] 0 2 (10- 10- 10-: 1 1 0) (21+ 21+ 10-: 0 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (15- 15- 15-: 0 0 -1) (18+ 18+ 15-: 0 0 -1) [1 1 1] 0 2 (30- 30- 30-: 0 0 0) (37+ 37+ 30-: -1 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (15- 15- 15-: 0 0 -1) (18+ 18+ 15-: 0 0 -1) [1 1 1] 0 2 (30- 30- 30-: 0 1 0) (37+ 37+ 30-: -1 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (15- 15- 15-: 0 0 -1) (18+ 18+ 15-: 0 0 -1) [1 1 1] 0 2 (30- 30- 30-: 1 0 0) (37+ 37+ 30-: 0 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (15- 15- 15-: 0 0 -1) (18+ 18+ 15-: 0 0 -1) [1 1 1] 0 2 (30- 30- 30-: 1 1 0) (37+ 37+ 30-: 0 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (5- 5- 10+: 0 0 1) (10+ 10+ 10+: 0 0 1) [1 1 1] 0 2 (10- 10- 21+: 1 0 0) (21+ 21+ 21+: 0 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (5- 5- 10+: 0 0 1) (10+ 10+ 10+: 0 0 1) [1 1 1] 0 2 (10- 10- 21+: 1 1 0) (21+ 21+ 21+: 0 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (5- 5- 10+: 0 0 1) (10+ 10+ 10+: 0 0 1) [1 1 1] 0 2 (10- 10- 21+: 0 0 0) (21+ 21+ 21+: -1 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (5- 5- 10+: 0 0 1) (10+ 10+ 10+: 0 0 1) [1 1 1] 0 2 (10- 10- 21+: 0 1 0) (21+ 21+ 21+: -1 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (15- 15- 18+: 0 0 1) (18+ 18+ 18+: 0 0 1) [1 1 1] 0 2 (30- 30- 37+: 1 0 0) (37+ 37+ 37+: 0 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (15- 15- 18+: 0 0 1) (18+ 18+ 18+: 0 0 1) [1 1 1] 0 2 (30- 30- 37+: 1 1 0) (37+ 37+ 37+: 0 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (15- 15- 18+: 0 0 1) (18+ 18+ 18+: 0 0 1) [1 1 1] 0 2 (30- 30- 37+: 0 0 0) (37+ 37+ 37+: -1 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (15- 15- 18+: 0 0 1) (18+ 18+ 18+: 0 0 1) [1 1 1] 0 2 (30- 30- 37+: 0 1 0) (37+ 37+ 37+: -1 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 0) (4- 11+ 4-: 0 -1 0) [1 2 1] 0 0 (2- 2- 2-: -1 0 0) (2- 5+ 2-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 1 0) (4- 11+ 4-: 0 0 0) [1 2 1] 0 0 (2- 2- 2-: -1 0 0) (2- 5+ 2-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (11+ 4- 11+: 0 0 0) (11+ 11+ 11+: 0 -1 0) [1 2 1] 0 0 (5+ 2- 5+: 1 0 0) (5+ 5+ 5+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (11+ 4- 11+: 0 1 0) (11+ 11+ 11+: 0 0 0) [1 2 1] 0 0 (5+ 2- 5+: 1 0 0) (5+ 5+ 5+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (11+ 4- 4-: 0 0 0) (11+ 11+ 4-: 0 -1 0) [1 2 1] 0 0 (5+ 2- 2-: 1 0 0) (5+ 5+ 2-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (11+ 4- 4-: 0 1 0) (11+ 11+ 4-: 0 0 0) [1 2 1] 0 0 (5+ 2- 2-: 1 0 0) (5+ 5+ 2-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 11+: 0 0 0) (4- 11+ 11+: 0 -1 0) [1 2 1] 0 0 (2- 2- 5+: -1 0 0) (2- 5+ 5+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 11+: 0 1 0) (4- 11+ 11+: 0 0 0) [1 2 1] 0 0 (2- 2- 5+: -1 0 0) (2- 5+ 5+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (14- 14- 14-: 0 0 0) (14- 19+ 14-: 0 -1 0) [1 2 1] 0 0 (7- 7- 7-: -1 0 0) (7- 9+ 7-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (14- 14- 14-: 0 1 0) (14- 19+ 14-: 0 0 0) [1 2 1] 0 0 (7- 7- 7-: -1 0 0) (7- 9+ 7-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (19+ 14- 19+: 0 0 0) (19+ 19+ 19+: 0 -1 0) [1 2 1] 0 0 (9+ 7- 9+: 1 0 0) (9+ 9+ 9+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (19+ 14- 19+: 0 1 0) (19+ 19+ 19+: 0 0 0) [1 2 1] 0 0 (9+ 7- 9+: 1 0 0) (9+ 9+ 9+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (19+ 14- 14-: 0 0 0) (19+ 19+ 14-: 0 -1 0) [1 2 1] 0 0 (9+ 7- 7-: 1 0 0) (9+ 9+ 7-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (19+ 14- 14-: 0 1 0) (19+ 19+ 14-: 0 0 0) [1 2 1] 0 0 (9+ 7- 7-: 1 0 0) (9+ 9+ 7-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (14- 14- 19+: 0 0 0) (14- 19+ 19+: 0 -1 0) [1 2 1] 0 0 (7- 7- 9+: -1 0 0) (7- 9+ 9+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (14- 14- 19+: 0 1 0) (14- 19+ 19+: 0 0 0) [1 2 1] 0 0 (7- 7- 9+: -1 0 0) (7- 9+ 9+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 2 0 0) (11+ 4- 4-: -1 0 0) [2 1 1] 0 0 (2- 2- 2-: 1 -1 0) (5+ 2- 2-: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 2) (4- 4- 11+: 0 0 -1) [1 1 2] 0 0 (2- 2- 2-: 0 -1 1) (2- 2- 5+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 11+: 2 0 0) (11+ 4- 11+: -1 0 0) [2 1 1] 0 0 (2- 2- 5+: 1 -1 0) (5+ 2- 5+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (11+ 4- 4-: 0 0 2) (11+ 4- 11+: 0 0 -1) [1 1 2] 0 0 (5+ 2- 2-: 0 -1 1) (5+ 2- 5+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 1 0 0) (11+ 4- 4-: -2 0 0) [2 1 1] 0 0 (2- 2- 2-: 0 -1 0) (5+ 2- 2-: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 1) (4- 4- 11+: 0 0 -2) [1 1 2] 0 0 (2- 2- 2-: 0 -1 0) (2- 2- 5+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 11+: 1 0 0) (11+ 4- 11+: -2 0 0) [2 1 1] 0 0 (2- 2- 5+: 0 -1 0) (5+ 2- 5+: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (11+ 4- 4-: 0 0 1) (11+ 4- 11+: 0 0 -2) [1 1 2] 0 0 (5+ 2- 2-: 0 -1 0) (5+ 2- 5+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 11+ 4-: 2 0 0) (11+ 11+ 4-: -1 0 0) [2 1 1] 0 0 (2- 5+ 2-: 1 1 0) (5+ 5+ 2-: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 11+ 4-: 0 0 2) (4- 11+ 11+: 0 0 -1) [1 1 2] 0 0 (2- 5+ 2-: 0 1 1) (2- 5+ 5+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 11+ 11+: 2 0 0) (11+ 11+ 11+: -1 0 0) [2 1 1] 0 0 (2- 5+ 5+: 1 1 0) (5+ 5+ 5+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (11+ 11+ 4-: 0 0 2) (11+ 11+ 11+: 0 0 -1) [1 1 2] 0 0 (5+ 5+ 2-: 0 1 1) (5+ 5+ 5+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 11+ 4-: 1 0 0) (11+ 11+ 4-: -2 0 0) [2 1 1] 0 0 (2- 5+ 2-: 0 1 0) (5+ 5+ 2-: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 11+ 4-: 0 0 1) (4- 11+ 11+: 0 0 -2) [1 1 2] 0 0 (2- 5+ 2-: 0 1 0) (2- 5+ 5+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 11+ 11+: 1 0 0) (11+ 11+ 11+: -2 0 0) [2 1 1] 0 0 (2- 5+ 5+: 0 1 0) (5+ 5+ 5+: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (11+ 11+ 4-: 0 0 1) (11+ 11+ 11+: 0 0 -2) [1 1 2] 0 0 (5+ 5+ 2-: 0 1 0) (5+ 5+ 5+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (14- 14- 14-: 2 0 0) (19+ 14- 14-: -1 0 0) [2 1 1] 0 0 (7- 7- 7-: 1 -1 0) (9+ 7- 7-: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (14- 14- 14-: 0 0 2) (14- 14- 19+: 0 0 -1) [1 1 2] 0 0 (7- 7- 7-: 0 -1 1) (7- 7- 9+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (14- 14- 19+: 2 0 0) (19+ 14- 19+: -1 0 0) [2 1 1] 0 0 (7- 7- 9+: 1 -1 0) (9+ 7- 9+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (19+ 14- 14-: 0 0 2) (19+ 14- 19+: 0 0 -1) [1 1 2] 0 0 (9+ 7- 7-: 0 -1 1) (9+ 7- 9+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (14- 14- 14-: 1 0 0) (19+ 14- 14-: -2 0 0) [2 1 1] 0 0 (7- 7- 7-: 0 -1 0) (9+ 7- 7-: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (14- 14- 14-: 0 0 1) (14- 14- 19+: 0 0 -2) [1 1 2] 0 0 (7- 7- 7-: 0 -1 0) (7- 7- 9+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (14- 14- 19+: 1 0 0) (19+ 14- 19+: -2 0 0) [2 1 1] 0 0 (7- 7- 9+: 0 -1 0) (9+ 7- 9+: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (19+ 14- 14-: 0 0 1) (19+ 14- 19+: 0 0 -2) [1 1 2] 0 0 (9+ 7- 7-: 0 -1 0) (9+ 7- 9+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (14- 19+ 14-: 2 0 0) (19+ 19+ 14-: -1 0 0) [2 1 1] 0 0 (7- 9+ 7-: 1 1 0) (9+ 9+ 7-: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (14- 19+ 14-: 0 0 2) (14- 19+ 19+: 0 0 -1) [1 1 2] 0 0 (7- 9+ 7-: 0 1 1) (7- 9+ 9+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (14- 19+ 19+: 2 0 0) (19+ 19+ 19+: -1 0 0) [2 1 1] 0 0 (7- 9+ 9+: 1 1 0) (9+ 9+ 9+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (19+ 19+ 14-: 0 0 2) (19+ 19+ 19+: 0 0 -1) [1 1 2] 0 0 (9+ 9+ 7-: 0 1 1) (9+ 9+ 9+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (14- 19+ 14-: 1 0 0) (19+ 19+ 14-: -2 0 0) [2 1 1] 0 0 (7- 9+ 7-: 0 1 0) (9+ 9+ 7-: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (14- 19+ 14-: 0 0 1) (14- 19+ 19+: 0 0 -2) [1 1 2] 0 0 (7- 9+ 7-: 0 1 0) (7- 9+ 9+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (14- 19+ 19+: 1 0 0) (19+ 19+ 19+: -2 0 0) [2 1 1] 0 0 (7- 9+ 9+: 0 1 0) (9+ 9+ 9+: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (19+ 19+ 14-: 0 0 1) (19+ 19+ 19+: 0 0 -2) [1 1 2] 0 0 (9+ 9+ 7-: 0 1 0) (9+ 9+ 9+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 0) (4- 4- 4-: 0 0 0) [1 1 1] 0 0 (2- 2- 2-: 0 -1 0) (2- 2- 2-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (11+ 4- 4-: 0 0 0) (11+ 4- 4-: 0 0 0) [1 1 1] 0 0 (5+ 2- 2-: 0 -1 0) (5+ 2- 2-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (4- 4- 11+: 0 0 0) (4- 4- 11+: 0 0 0) [1 1 1] 0 0 (2- 2- 5+: 0 -1 0) (2- 2- 5+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (11+ 4- 11+: 0 0 0) (11+ 4- 11+: 0 0 0) [1 1 1] 0 0 (5+ 2- 5+: 0 -1 0) (5+ 2- 5+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (4- 11+ 4-: 0 0 0) (4- 11+ 4-: 0 0 0) [1 1 1] 0 0 (2- 5+ 2-: 0 1 0) (2- 5+ 2-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (11+ 11+ 4-: 0 0 0) (11+ 11+ 4-: 0 0 0) [1 1 1] 0 0 (5+ 5+ 2-: 0 1 0) (5+ 5+ 2-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (4- 11+ 11+: 0 0 0) (4- 11+ 11+: 0 0 0) [1 1 1] 0 0 (2- 5+ 5+: 0 1 0) (2- 5+ 5+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (11+ 11+ 11+: 0 0 0) (11+ 11+ 11+: 0 0 0) [1 1 1] 0 0 (5+ 5+ 5+: 0 1 0) (5+ 5+ 5+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (14- 14- 14-: 0 0 0) (14- 14- 14-: 0 0 0) [1 1 1] 0 0 (7- 7- 7-: 0 -1 0) (7- 7- 7-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (19+ 14- 14-: 0 0 0) (19+ 14- 14-: 0 0 0) [1 1 1] 0 0 (9+ 7- 7-: 0 -1 0) (9+ 7- 7-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (14- 14- 19+: 0 0 0) (14- 14- 19+: 0 0 0) [1 1 1] 0 0 (7- 7- 9+: 0 -1 0) (7- 7- 9+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (19+ 14- 19+: 0 0 0) (19+ 14- 19+: 0 0 0) [1 1 1] 0 0 (9+ 7- 9+: 0 -1 0) (9+ 7- 9+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (14- 19+ 14-: 0 0 0) (14- 19+ 14-: 0 0 0) [1 1 1] 0 0 (7- 9+ 7-: 0 1 0) (7- 9+ 7-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (19+ 19+ 14-: 0 0 0) (19+ 19+ 14-: 0 0 0) [1 1 1] 0 0 (9+ 9+ 7-: 0 1 0) (9+ 9+ 7-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (14- 19+ 19+: 0 0 0) (14- 19+ 19+: 0 0 0) [1 1 1] 0 0 (7- 9+ 9+: 0 1 0) (7- 9+ 9+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (19+ 19+ 19+: 0 0 0) (19+ 19+ 19+: 0 0 0) [1 1 1] 0 0 (9+ 9+ 9+: 0 1 0) (9+ 9+ 9+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 1) (10- 21+ 21+: 0 -1 -2) [1 2 2] 0 1 (5- 5- 5-: -1 0 0) (5- 10+ 10+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 1 1) (10- 21+ 21+: 0 0 -2) [1 2 2] 0 1 (5- 5- 5-: -1 0 0) (5- 10+ 10+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 2) (10- 21+ 21+: 0 -1 -1) [1 2 2] 0 1 (5- 5- 5-: -1 0 1) (5- 10+ 10+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 1 2) (10- 21+ 21+: 0 0 -1) [1 2 2] 0 1 (5- 5- 5-: -1 0 1) (5- 10+ 10+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (30- 30- 30-: 0 0 1) (30- 37+ 37+: 0 -1 -2) [1 2 2] 0 1 (15- 15- 15-: -1 0 0) (15- 18+ 18+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (30- 30- 30-: 0 1 1) (30- 37+ 37+: 0 0 -2) [1 2 2] 0 1 (15- 15- 15-: -1 0 0) (15- 18+ 18+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (30- 30- 30-: 0 0 2) (30- 37+ 37+: 0 -1 -1) [1 2 2] 0 1 (15- 15- 15-: -1 0 1) (15- 18+ 18+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (30- 30- 30-: 0 1 2) (30- 37+ 37+: 0 0 -1) [1 2 2] 0 1 (15- 15- 15-: -1 0 1) (15- 18+ 18+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (21+ 10- 10-: 0 0 2) (21+ 21+ 21+: 0 -1 -1) [1 2 2] 0 1 (10+ 5- 5-: 1 0 1) (10+ 10+ 10+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (21+ 10- 10-: 0 1 2) (21+ 21+ 21+: 0 0 -1) [1 2 2] 0 1 (10+ 5- 5-: 1 0 1) (10+ 10+ 10+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (21+ 10- 10-: 0 0 1) (21+ 21+ 21+: 0 -1 -2) [1 2 2] 0 1 (10+ 5- 5-: 1 0 0) (10+ 10+ 10+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (21+ 10- 10-: 0 1 1) (21+ 21+ 21+: 0 0 -2) [1 2 2] 0 1 (10+ 5- 5-: 1 0 0) (10+ 10+ 10+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (37+ 30- 30-: 0 0 2) (37+ 37+ 37+: 0 -1 -1) [1 2 2] 0 1 (18+ 15- 15-: 1 0 1) (18+ 18+ 18+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (37+ 30- 30-: 0 1 2) (37+ 37+ 37+: 0 0 -1) [1 2 2] 0 1 (18+ 15- 15-: 1 0 1) (18+ 18+ 18+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (37+ 30- 30-: 0 0 1) (37+ 37+ 37+: 0 -1 -2) [1 2 2] 0 1 (18+ 15- 15-: 1 0 0) (18+ 18+ 18+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (37+ 30- 30-: 0 1 1) (37+ 37+ 37+: 0 0 -2) [1 2 2] 0 1 (18+ 15- 15-: 1 0 0) (18+ 18+ 18+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 2 0 1) (21+ 10- 21+: -1 0 -2) [2 1 2] 0 1 (5- 5- 5-: 1 -1 0) (10+ 5- 10+: 0 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 2 0 2) (21+ 10- 21+: -1 0 -1) [2 1 2] 0 1 (5- 5- 5-: 1 -1 1) (10+ 5- 10+: 0 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 1 0 1) (21+ 10- 21+: -2 0 -2) [2 1 2] 0 1 (5- 5- 5-: 0 -1 0) (10+ 5- 10+: -1 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 1 0 2) (21+ 10- 21+: -2 0 -1) [2 1 2] 0 1 (5- 5- 5-: 0 -1 1) (10+ 5- 10+: -1 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (30- 30- 30-: 2 0 1) (37+ 30- 37+: -1 0 -2) [2 1 2] 0 1 (15- 15- 15-: 1 -1 0) (18+ 15- 18+: 0 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (30- 30- 30-: 2 0 2) (37+ 30- 37+: -1 0 -1) [2 1 2] 0 1 (15- 15- 15-: 1 -1 1) (18+ 15- 18+: 0 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (30- 30- 30-: 1 0 1) (37+ 30- 37+: -2 0 -2) [2 1 2] 0 1 (15- 15- 15-: 0 -1 0) (18+ 15- 18+: -1 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (30- 30- 30-: 1 0 2) (37+ 30- 37+: -2 0 -1) [2 1 2] 0 1 (15- 15- 15-: 0 -1 1) (18+ 15- 18+: -1 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 21+ 10-: 2 0 2) (21+ 21+ 21+: -1 0 -1) [2 1 2] 0 1 (5- 10+ 5-: 1 1 1) (10+ 10+ 10+: 0 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 21+ 10-: 2 0 1) (21+ 21+ 21+: -1 0 -2) [2 1 2] 0 1 (5- 10+ 5-: 1 1 0) (10+ 10+ 10+: 0 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 21+ 10-: 1 0 2) (21+ 21+ 21+: -2 0 -1) [2 1 2] 0 1 (5- 10+ 5-: 0 1 1) (10+ 10+ 10+: -1 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 21+ 10-: 1 0 1) (21+ 21+ 21+: -2 0 -2) [2 1 2] 0 1 (5- 10+ 5-: 0 1 0) (10+ 10+ 10+: -1 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (30- 37+ 30-: 2 0 2) (37+ 37+ 37+: -1 0 -1) [2 1 2] 0 1 (15- 18+ 15-: 1 1 1) (18+ 18+ 18+: 0 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (30- 37+ 30-: 2 0 1) (37+ 37+ 37+: -1 0 -2) [2 1 2] 0 1 (15- 18+ 15-: 1 1 0) (18+ 18+ 18+: 0 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (30- 37+ 30-: 1 0 2) (37+ 37+ 37+: -2 0 -1) [2 1 2] 0 1 (15- 18+ 15-: 0 1 1) (18+ 18+ 18+: -1 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (30- 37+ 30-: 1 0 1) (37+ 37+ 37+: -2 0 -2) [2 1 2] 0 1 (15- 18+ 15-: 0 1 0) (18+ 18+ 18+: -1 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 0) (21+ 21+ 10-: -1 -1 0) [2 2 1] 0 1 (5- 5- 5-: 0 0 -1) (10+ 10+ 5-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 1 0) (21+ 21+ 10-: -1 0 0) [2 2 1] 0 1 (5- 5- 5-: 0 0 -1) (10+ 10+ 5-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 1 0 0) (21+ 21+ 10-: 0 -1 0) [2 2 1] 0 1 (5- 5- 5-: 0 0 -1) (10+ 10+ 5-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 1 1 0) (21+ 21+ 10-: 0 0 0) [2 2 1] 0 1 (5- 5- 5-: 0 0 -1) (10+ 10+ 5-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (30- 30- 30-: 0 0 0) (37+ 37+ 30-: -1 -1 0) [2 2 1] 0 1 (15- 15- 15-: 0 0 -1) (18+ 18+ 15-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (30- 30- 30-: 0 1 0) (37+ 37+ 30-: -1 0 0) [2 2 1] 0 1 (15- 15- 15-: 0 0 -1) (18+ 18+ 15-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (30- 30- 30-: 1 0 0) (37+ 37+ 30-: 0 -1 0) [2 2 1] 0 1 (15- 15- 15-: 0 0 -1) (18+ 18+ 15-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (30- 30- 30-: 1 1 0) (37+ 37+ 30-: 0 0 0) [2 2 1] 0 1 (15- 15- 15-: 0 0 -1) (18+ 18+ 15-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 21+: 1 0 0) (21+ 21+ 21+: 0 -1 0) [2 2 1] 0 1 (5- 5- 10+: 0 0 1) (10+ 10+ 10+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 21+: 1 1 0) (21+ 21+ 21+: 0 0 0) [2 2 1] 0 1 (5- 5- 10+: 0 0 1) (10+ 10+ 10+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 21+: 0 0 0) (21+ 21+ 21+: -1 -1 0) [2 2 1] 0 1 (5- 5- 10+: 0 0 1) (10+ 10+ 10+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 21+: 0 1 0) (21+ 21+ 21+: -1 0 0) [2 2 1] 0 1 (5- 5- 10+: 0 0 1) (10+ 10+ 10+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (30- 30- 37+: 1 0 0) (37+ 37+ 37+: 0 -1 0) [2 2 1] 0 1 (15- 15- 18+: 0 0 1) (18+ 18+ 18+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (30- 30- 37+: 1 1 0) (37+ 37+ 37+: 0 0 0) [2 2 1] 0 1 (15- 15- 18+: 0 0 1) (18+ 18+ 18+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (30- 30- 37+: 0 0 0) (37+ 37+ 37+: -1 -1 0) [2 2 1] 0 1 (15- 15- 18+: 0 0 1) (18+ 18+ 18+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (30- 30- 37+: 0 1 0) (37+ 37+ 37+: -1 0 0) [2 2 1] 0 1 (15- 15- 18+: 0 0 1) (18+ 18+ 18+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 0) (10- 21+ 10-: 0 -1 0) [1 2 1] 0 1 (5- 5- 5-: -1 0 0) (5- 10+ 5-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 1 0) (10- 21+ 10-: 0 0 0) [1 2 1] 0 1 (5- 5- 5-: -1 0 0) (5- 10+ 5-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (21+ 10- 21+: 0 0 0) (21+ 21+ 21+: 0 -1 0) [1 2 1] 0 1 (10+ 5- 10+: 1 0 0) (10+ 10+ 10+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (21+ 10- 21+: 0 1 0) (21+ 21+ 21+: 0 0 0) [1 2 1] 0 1 (10+ 5- 10+: 1 0 0) (10+ 10+ 10+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (21+ 10- 10-: 0 0 0) (21+ 21+ 10-: 0 -1 0) [1 2 1] 0 1 (10+ 5- 5-: 1 0 0) (10+ 10+ 5-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (21+ 10- 10-: 0 1 0) (21+ 21+ 10-: 0 0 0) [1 2 1] 0 1 (10+ 5- 5-: 1 0 0) (10+ 10+ 5-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 21+: 0 0 0) (10- 21+ 21+: 0 -1 0) [1 2 1] 0 1 (5- 5- 10+: -1 0 0) (5- 10+ 10+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 21+: 0 1 0) (10- 21+ 21+: 0 0 0) [1 2 1] 0 1 (5- 5- 10+: -1 0 0) (5- 10+ 10+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (30- 30- 30-: 0 0 0) (30- 37+ 30-: 0 -1 0) [1 2 1] 0 1 (15- 15- 15-: -1 0 0) (15- 18+ 15-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (30- 30- 30-: 0 1 0) (30- 37+ 30-: 0 0 0) [1 2 1] 0 1 (15- 15- 15-: -1 0 0) (15- 18+ 15-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (37+ 30- 37+: 0 0 0) (37+ 37+ 37+: 0 -1 0) [1 2 1] 0 1 (18+ 15- 18+: 1 0 0) (18+ 18+ 18+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (37+ 30- 37+: 0 1 0) (37+ 37+ 37+: 0 0 0) [1 2 1] 0 1 (18+ 15- 18+: 1 0 0) (18+ 18+ 18+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (37+ 30- 30-: 0 0 0) (37+ 37+ 30-: 0 -1 0) [1 2 1] 0 1 (18+ 15- 15-: 1 0 0) (18+ 18+ 15-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (37+ 30- 30-: 0 1 0) (37+ 37+ 30-: 0 0 0) [1 2 1] 0 1 (18+ 15- 15-: 1 0 0) (18+ 18+ 15-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (30- 30- 37+: 0 0 0) (30- 37+ 37+: 0 -1 0) [1 2 1] 0 1 (15- 15- 18+: -1 0 0) (15- 18+ 18+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (30- 30- 37+: 0 1 0) (30- 37+ 37+: 0 0 0) [1 2 1] 0 1 (15- 15- 18+: -1 0 0) (15- 18+ 18+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 2 0 0) (21+ 10- 10-: -1 0 0) [2 1 1] 0 1 (5- 5- 5-: 1 -1 0) (10+ 5- 5-: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 2) (10- 10- 21+: 0 0 -1) [1 1 2] 0 1 (5- 5- 5-: 0 -1 1) (5- 5- 10+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 21+: 2 0 0) (21+ 10- 21+: -1 0 0) [2 1 1] 0 1 (5- 5- 10+: 1 -1 0) (10+ 5- 10+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (21+ 10- 10-: 0 0 2) (21+ 10- 21+: 0 0 -1) [1 1 2] 0 1 (10+ 5- 5-: 0 -1 1) (10+ 5- 10+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 1 0 0) (21+ 10- 10-: -2 0 0) [2 1 1] 0 1 (5- 5- 5-: 0 -1 0) (10+ 5- 5-: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 1) (10- 10- 21+: 0 0 -2) [1 1 2] 0 1 (5- 5- 5-: 0 -1 0) (5- 5- 10+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 21+: 1 0 0) (21+ 10- 21+: -2 0 0) [2 1 1] 0 1 (5- 5- 10+: 0 -1 0) (10+ 5- 10+: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (21+ 10- 10-: 0 0 1) (21+ 10- 21+: 0 0 -2) [1 1 2] 0 1 (10+ 5- 5-: 0 -1 0) (10+ 5- 10+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 21+ 10-: 2 0 0) (21+ 21+ 10-: -1 0 0) [2 1 1] 0 1 (5- 10+ 5-: 1 1 0) (10+ 10+ 5-: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 21+ 10-: 0 0 2) (10- 21+ 21+: 0 0 -1) [1 1 2] 0 1 (5- 10+ 5-: 0 1 1) (5- 10+ 10+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 21+ 21+: 2 0 0) (21+ 21+ 21+: -1 0 0) [2 1 1] 0 1 (5- 10+ 10+: 1 1 0) (10+ 10+ 10+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (21+ 21+ 10-: 0 0 2) (21+ 21+ 21+: 0 0 -1) [1 1 2] 0 1 (10+ 10+ 5-: 0 1 1) (10+ 10+ 10+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 21+ 10-: 1 0 0) (21+ 21+ 10-: -2 0 0) [2 1 1] 0 1 (5- 10+ 5-: 0 1 0) (10+ 10+ 5-: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 21+ 10-: 0 0 1) (10- 21+ 21+: 0 0 -2) [1 1 2] 0 1 (5- 10+ 5-: 0 1 0) (5- 10+ 10+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 21+ 21+: 1 0 0) (21+ 21+ 21+: -2 0 0) [2 1 1] 0 1 (5- 10+ 10+: 0 1 0) (10+ 10+ 10+: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (21+ 21+ 10-: 0 0 1) (21+ 21+ 21+: 0 0 -2) [1 1 2] 0 1 (10+ 10+ 5-: 0 1 0) (10+ 10+ 10+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (30- 30- 30-: 2 0 0) (37+ 30- 30-: -1 0 0) [2 1 1] 0 1 (15- 15- 15-: 1 -1 0) (18+ 15- 15-: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (30- 30- 30-: 0 0 2) (30- 30- 37+: 0 0 -1) [1 1 2] 0 1 (15- 15- 15-: 0 -1 1) (15- 15- 18+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (30- 30- 37+: 2 0 0) (37+ 30- 37+: -1 0 0) [2 1 1] 0 1 (15- 15- 18+: 1 -1 0) (18+ 15- 18+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (37+ 30- 30-: 0 0 2) (37+ 30- 37+: 0 0 -1) [1 1 2] 0 1 (18+ 15- 15-: 0 -1 1) (18+ 15- 18+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (30- 30- 30-: 1 0 0) (37+ 30- 30-: -2 0 0) [2 1 1] 0 1 (15- 15- 15-: 0 -1 0) (18+ 15- 15-: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (30- 30- 30-: 0 0 1) (30- 30- 37+: 0 0 -2) [1 1 2] 0 1 (15- 15- 15-: 0 -1 0) (15- 15- 18+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (30- 30- 37+: 1 0 0) (37+ 30- 37+: -2 0 0) [2 1 1] 0 1 (15- 15- 18+: 0 -1 0) (18+ 15- 18+: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (37+ 30- 30-: 0 0 1) (37+ 30- 37+: 0 0 -2) [1 1 2] 0 1 (18+ 15- 15-: 0 -1 0) (18+ 15- 18+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (30- 37+ 30-: 2 0 0) (37+ 37+ 30-: -1 0 0) [2 1 1] 0 1 (15- 18+ 15-: 1 1 0) (18+ 18+ 15-: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (30- 37+ 30-: 0 0 2) (30- 37+ 37+: 0 0 -1) [1 1 2] 0 1 (15- 18+ 15-: 0 1 1) (15- 18+ 18+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (30- 37+ 37+: 2 0 0) (37+ 37+ 37+: -1 0 0) [2 1 1] 0 1 (15- 18+ 18+: 1 1 0) (18+ 18+ 18+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (37+ 37+ 30-: 0 0 2) (37+ 37+ 37+: 0 0 -1) [1 1 2] 0 1 (18+ 18+ 15-: 0 1 1) (18+ 18+ 18+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (30- 37+ 30-: 1 0 0) (37+ 37+ 30-: -2 0 0) [2 1 1] 0 1 (15- 18+ 15-: 0 1 0) (18+ 18+ 15-: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (30- 37+ 30-: 0 0 1) (30- 37+ 37+: 0 0 -2) [1 1 2] 0 1 (15- 18+ 15-: 0 1 0) (15- 18+ 18+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (30- 37+ 37+: 1 0 0) (37+ 37+ 37+: -2 0 0) [2 1 1] 0 1 (15- 18+ 18+: 0 1 0) (18+ 18+ 18+: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (37+ 37+ 30-: 0 0 1) (37+ 37+ 37+: 0 0 -2) [1 1 2] 0 1 (18+ 18+ 15-: 0 1 0) (18+ 18+ 18+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 0) (10- 10- 10-: 0 0 0) [1 1 1] 0 1 (5- 5- 5-: 0 -1 0) (5- 5- 5-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (21+ 10- 10-: 0 0 0) (21+ 10- 10-: 0 0 0) [1 1 1] 0 1 (10+ 5- 5-: 0 -1 0) (10+ 5- 5-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (10- 10- 21+: 0 0 0) (10- 10- 21+: 0 0 0) [1 1 1] 0 1 (5- 5- 10+: 0 -1 0) (5- 5- 10+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (21+ 10- 21+: 0 0 0) (21+ 10- 21+: 0 0 0) [1 1 1] 0 1 (10+ 5- 10+: 0 -1 0) (10+ 5- 10+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (10- 21+ 10-: 0 0 0) (10- 21+ 10-: 0 0 0) [1 1 1] 0 1 (5- 10+ 5-: 0 1 0) (5- 10+ 5-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (21+ 21+ 10-: 0 0 0) (21+ 21+ 10-: 0 0 0) [1 1 1] 0 1 (10+ 10+ 5-: 0 1 0) (10+ 10+ 5-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (10- 21+ 21+: 0 0 0) (10- 21+ 21+: 0 0 0) [1 1 1] 0 1 (5- 10+ 10+: 0 1 0) (5- 10+ 10+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (21+ 21+ 21+: 0 0 0) (21+ 21+ 21+: 0 0 0) [1 1 1] 0 1 (10+ 10+ 10+: 0 1 0) (10+ 10+ 10+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (30- 30- 30-: 0 0 0) (30- 30- 30-: 0 0 0) [1 1 1] 0 1 (15- 15- 15-: 0 -1 0) (15- 15- 15-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (37+ 30- 30-: 0 0 0) (37+ 30- 30-: 0 0 0) [1 1 1] 0 1 (18+ 15- 15-: 0 -1 0) (18+ 15- 15-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (30- 30- 37+: 0 0 0) (30- 30- 37+: 0 0 0) [1 1 1] 0 1 (15- 15- 18+: 0 -1 0) (15- 15- 18+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (37+ 30- 37+: 0 0 0) (37+ 30- 37+: 0 0 0) [1 1 1] 0 1 (18+ 15- 18+: 0 -1 0) (18+ 15- 18+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (30- 37+ 30-: 0 0 0) (30- 37+ 30-: 0 0 0) [1 1 1] 0 1 (15- 18+ 15-: 0 1 0) (15- 18+ 15-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (37+ 37+ 30-: 0 0 0) (37+ 37+ 30-: 0 0 0) [1 1 1] 0 1 (18+ 18+ 15-: 0 1 0) (18+ 18+ 15-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (30- 37+ 37+: 0 0 0) (30- 37+ 37+: 0 0 0) [1 1 1] 0 1 (15- 18+ 18+: 0 1 0) (15- 18+ 18+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (37+ 37+ 37+: 0 0 0) (37+ 37+ 37+: 0 0 0) [1 1 1] 0 1 (18+ 18+ 18+: 0 1 0) (18+ 18+ 18+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -############################################################# - -FacParts: 0 0 [1 1 1] -FacParts: 1 1 [2 2 2] -FacParts: 2 2 [2 2 2] - -ProcessPoolCreate: 1 - -# ProcessPoolSetPart: pool part -ProcessPoolSetPart: 0 0 -ProcessPoolSetPart: 0 1 -ProcessPoolSetPart: 0 2 diff --git a/src/test/TEST_fac/4lev.in b/src/test/TEST_fac/4lev.in deleted file mode 100644 index 45af06ae9f..0000000000 --- a/src/test/TEST_fac/4lev.in +++ /dev/null @@ -1,317 +0,0 @@ -# Copyright (c) 1998 Lawrence Livermore 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 (1- 1- 1-) (12+ 12+ 12+) -GridSetExtents: 1 (4- 4- 4-) (21+ 21+ 21+) -GridSetExtents: 2 (10- 10- 10-) (31+ 31+ 31+) -GridSetExtents: 3 (22- 22- 22-) (57+ 57+ 57+) -############################################################# - -# GridSetVariables: part nvars vartypes[nvars] -# CELL = 0 -# NODE = 1 -# XFACE = 2 -# YFACE = 3 -# ZFACE = 4 -# XEDGE = 5 -# YEDGE = 6 -# ZEDGE = 7 - -GridSetVariables: 0 1 [0] -GridSetVariables: 1 1 [0] -GridSetVariables: 2 1 [0] -GridSetVariables: 3 1 [0] -############################################################# - -# StencilCreate: nstencils sizes[nstencils] -StencilCreate: 1 [7] -############################################################# - -# StencilSetEntry: stencil_num entry offset[ndim] var value -StencilSetEntry: 0 0 [ 0 0 0] 0 6.000000 -StencilSetEntry: 0 1 [-1 0 0] 0 -1.000000 -StencilSetEntry: 0 2 [ 1 0 0] 0 -1.000000 -StencilSetEntry: 0 3 [ 0 -1 0] 0 -1.000000 -StencilSetEntry: 0 4 [ 0 0 1] 0 -1.000000 -StencilSetEntry: 0 5 [ 0 0 -1] 0 -1.000000 -StencilSetEntry: 0 6 [ 0 1 0] 0 -1.000000 -############################################################# - -# GraphSetStencil: part var stencil_num -GraphSetStencil: 0 0 0 -GraphSetStencil: 1 0 0 -GraphSetStencil: 2 0 0 -GraphSetStencil: 3 0 0 -############################################################# - -# GraphAddEntries: \ - -# part ilower(ndim) iupper(ndim) stride[ndim] var \ - -# to_part to_ilower(ndim) to_iupper(ndim) to_stride[ndim] to_var \ - -# index_map[ndim] entry value -GraphAddEntries: 0 (2- 2- 2-: -1 0 0) (2- 10+ 10+: -1 0 0) [1 1 1] 0 1 (4- 4- 4-: 0 0 1) (4- 21+ 21+: 0 -1 0) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: -1 0 0) (2- 10+ 10+: -1 0 0) [1 1 1] 0 1 (4- 4- 4-: 0 1 1) (4- 21+ 21+: 0 0 0) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: -1 0 0) (2- 10+ 10+: -1 0 0) [1 1 1] 0 1 (4- 4- 4-: 0 0 0) (4- 21+ 21+: 0 -1 -1) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: -1 0 0) (2- 10+ 10+: -1 0 0) [1 1 1] 0 1 (4- 4- 4-: 0 1 0) (4- 21+ 21+: 0 0 -1) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (10+ 2- 2-: 1 0 0) (10+ 10+ 10+: 1 0 0) [1 1 1] 0 1 (21+ 4- 4-: 0 0 0) (21+ 21+ 21+: 0 -1 -1) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (10+ 2- 2-: 1 0 0) (10+ 10+ 10+: 1 0 0) [1 1 1] 0 1 (21+ 4- 4-: 0 1 0) (21+ 21+ 21+: 0 0 -1) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (10+ 2- 2-: 1 0 0) (10+ 10+ 10+: 1 0 0) [1 1 1] 0 1 (21+ 4- 4-: 0 0 1) (21+ 21+ 21+: 0 -1 0) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (10+ 2- 2-: 1 0 0) (10+ 10+ 10+: 1 0 0) [1 1 1] 0 1 (21+ 4- 4-: 0 1 1) (21+ 21+ 21+: 0 0 0) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 -1 0) (10+ 2- 10+: 0 -1 0) [1 1 1] 0 1 (4- 4- 4-: 0 0 1) (21+ 4- 21+: -1 0 0) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 -1 0) (10+ 2- 10+: 0 -1 0) [1 1 1] 0 1 (4- 4- 4-: 0 0 0) (21+ 4- 21+: -1 0 -1) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 -1 0) (10+ 2- 10+: 0 -1 0) [1 1 1] 0 1 (4- 4- 4-: 1 0 1) (21+ 4- 21+: 0 0 0) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 -1 0) (10+ 2- 10+: 0 -1 0) [1 1 1] 0 1 (4- 4- 4-: 1 0 0) (21+ 4- 21+: 0 0 -1) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (2- 10+ 2-: 0 1 0) (10+ 10+ 10+: 0 1 0) [1 1 1] 0 1 (4- 21+ 4-: 0 0 0) (21+ 21+ 21+: -1 0 -1) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (2- 10+ 2-: 0 1 0) (10+ 10+ 10+: 0 1 0) [1 1 1] 0 1 (4- 21+ 4-: 0 0 1) (21+ 21+ 21+: -1 0 0) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (2- 10+ 2-: 0 1 0) (10+ 10+ 10+: 0 1 0) [1 1 1] 0 1 (4- 21+ 4-: 1 0 0) (21+ 21+ 21+: 0 0 -1) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (2- 10+ 2-: 0 1 0) (10+ 10+ 10+: 0 1 0) [1 1 1] 0 1 (4- 21+ 4-: 1 0 1) (21+ 21+ 21+: 0 0 0) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 0 -1) (10+ 10+ 2-: 0 0 -1) [1 1 1] 0 1 (4- 4- 4-: 0 0 0) (21+ 21+ 4-: -1 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 0 -1) (10+ 10+ 2-: 0 0 -1) [1 1 1] 0 1 (4- 4- 4-: 0 1 0) (21+ 21+ 4-: -1 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 0 -1) (10+ 10+ 2-: 0 0 -1) [1 1 1] 0 1 (4- 4- 4-: 1 0 0) (21+ 21+ 4-: 0 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 0 -1) (10+ 10+ 2-: 0 0 -1) [1 1 1] 0 1 (4- 4- 4-: 1 1 0) (21+ 21+ 4-: 0 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (2- 2- 10+: 0 0 1) (10+ 10+ 10+: 0 0 1) [1 1 1] 0 1 (4- 4- 21+: 1 0 0) (21+ 21+ 21+: 0 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (2- 2- 10+: 0 0 1) (10+ 10+ 10+: 0 0 1) [1 1 1] 0 1 (4- 4- 21+: 1 1 0) (21+ 21+ 21+: 0 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (2- 2- 10+: 0 0 1) (10+ 10+ 10+: 0 0 1) [1 1 1] 0 1 (4- 4- 21+: 0 0 0) (21+ 21+ 21+: -1 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (2- 2- 10+: 0 0 1) (10+ 10+ 10+: 0 0 1) [1 1 1] 0 1 (4- 4- 21+: 0 1 0) (21+ 21+ 21+: -1 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 1) (4- 21+ 21+: 0 -1 -2) [1 2 2] 0 0 (2- 2- 2-: -1 0 0) (2- 10+ 10+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 1 1) (4- 21+ 21+: 0 0 -2) [1 2 2] 0 0 (2- 2- 2-: -1 0 0) (2- 10+ 10+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 2) (4- 21+ 21+: 0 -1 -1) [1 2 2] 0 0 (2- 2- 2-: -1 0 1) (2- 10+ 10+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 1 2) (4- 21+ 21+: 0 0 -1) [1 2 2] 0 0 (2- 2- 2-: -1 0 1) (2- 10+ 10+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (21+ 4- 4-: 0 0 2) (21+ 21+ 21+: 0 -1 -1) [1 2 2] 0 0 (10+ 2- 2-: 1 0 1) (10+ 10+ 10+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (21+ 4- 4-: 0 1 2) (21+ 21+ 21+: 0 0 -1) [1 2 2] 0 0 (10+ 2- 2-: 1 0 1) (10+ 10+ 10+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (21+ 4- 4-: 0 0 1) (21+ 21+ 21+: 0 -1 -2) [1 2 2] 0 0 (10+ 2- 2-: 1 0 0) (10+ 10+ 10+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (21+ 4- 4-: 0 1 1) (21+ 21+ 21+: 0 0 -2) [1 2 2] 0 0 (10+ 2- 2-: 1 0 0) (10+ 10+ 10+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 2 0 1) (21+ 4- 21+: -1 0 -2) [2 1 2] 0 0 (2- 2- 2-: 1 -1 0) (10+ 2- 10+: 0 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 2 0 2) (21+ 4- 21+: -1 0 -1) [2 1 2] 0 0 (2- 2- 2-: 1 -1 1) (10+ 2- 10+: 0 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 1 0 1) (21+ 4- 21+: -2 0 -2) [2 1 2] 0 0 (2- 2- 2-: 0 -1 0) (10+ 2- 10+: -1 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 1 0 2) (21+ 4- 21+: -2 0 -1) [2 1 2] 0 0 (2- 2- 2-: 0 -1 1) (10+ 2- 10+: -1 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 21+ 4-: 2 0 2) (21+ 21+ 21+: -1 0 -1) [2 1 2] 0 0 (2- 10+ 2-: 1 1 1) (10+ 10+ 10+: 0 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 21+ 4-: 2 0 1) (21+ 21+ 21+: -1 0 -2) [2 1 2] 0 0 (2- 10+ 2-: 1 1 0) (10+ 10+ 10+: 0 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 21+ 4-: 1 0 2) (21+ 21+ 21+: -2 0 -1) [2 1 2] 0 0 (2- 10+ 2-: 0 1 1) (10+ 10+ 10+: -1 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 21+ 4-: 1 0 1) (21+ 21+ 21+: -2 0 -2) [2 1 2] 0 0 (2- 10+ 2-: 0 1 0) (10+ 10+ 10+: -1 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 0) (21+ 21+ 4-: -1 -1 0) [2 2 1] 0 0 (2- 2- 2-: 0 0 -1) (10+ 10+ 2-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 1 0) (21+ 21+ 4-: -1 0 0) [2 2 1] 0 0 (2- 2- 2-: 0 0 -1) (10+ 10+ 2-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 1 0 0) (21+ 21+ 4-: 0 -1 0) [2 2 1] 0 0 (2- 2- 2-: 0 0 -1) (10+ 10+ 2-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 1 1 0) (21+ 21+ 4-: 0 0 0) [2 2 1] 0 0 (2- 2- 2-: 0 0 -1) (10+ 10+ 2-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 21+: 1 0 0) (21+ 21+ 21+: 0 -1 0) [2 2 1] 0 0 (2- 2- 10+: 0 0 1) (10+ 10+ 10+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 21+: 1 1 0) (21+ 21+ 21+: 0 0 0) [2 2 1] 0 0 (2- 2- 10+: 0 0 1) (10+ 10+ 10+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 21+: 0 0 0) (21+ 21+ 21+: -1 -1 0) [2 2 1] 0 0 (2- 2- 10+: 0 0 1) (10+ 10+ 10+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 21+: 0 1 0) (21+ 21+ 21+: -1 0 0) [2 2 1] 0 0 (2- 2- 10+: 0 0 1) (10+ 10+ 10+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (5- 5- 5-: -1 0 0) (5- 15+ 15+: -1 0 0) [1 1 1] 0 2 (10- 10- 10-: 0 0 1) (10- 31+ 31+: 0 -1 0) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: -1 0 0) (5- 15+ 15+: -1 0 0) [1 1 1] 0 2 (10- 10- 10-: 0 1 1) (10- 31+ 31+: 0 0 0) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: -1 0 0) (5- 15+ 15+: -1 0 0) [1 1 1] 0 2 (10- 10- 10-: 0 0 0) (10- 31+ 31+: 0 -1 -1) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: -1 0 0) (5- 15+ 15+: -1 0 0) [1 1 1] 0 2 (10- 10- 10-: 0 1 0) (10- 31+ 31+: 0 0 -1) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (15+ 5- 5-: 1 0 0) (15+ 15+ 15+: 1 0 0) [1 1 1] 0 2 (31+ 10- 10-: 0 0 0) (31+ 31+ 31+: 0 -1 -1) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (15+ 5- 5-: 1 0 0) (15+ 15+ 15+: 1 0 0) [1 1 1] 0 2 (31+ 10- 10-: 0 1 0) (31+ 31+ 31+: 0 0 -1) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (15+ 5- 5-: 1 0 0) (15+ 15+ 15+: 1 0 0) [1 1 1] 0 2 (31+ 10- 10-: 0 0 1) (31+ 31+ 31+: 0 -1 0) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (15+ 5- 5-: 1 0 0) (15+ 15+ 15+: 1 0 0) [1 1 1] 0 2 (31+ 10- 10-: 0 1 1) (31+ 31+ 31+: 0 0 0) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 -1 0) (15+ 5- 15+: 0 -1 0) [1 1 1] 0 2 (10- 10- 10-: 0 0 1) (31+ 10- 31+: -1 0 0) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 -1 0) (15+ 5- 15+: 0 -1 0) [1 1 1] 0 2 (10- 10- 10-: 0 0 0) (31+ 10- 31+: -1 0 -1) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 -1 0) (15+ 5- 15+: 0 -1 0) [1 1 1] 0 2 (10- 10- 10-: 1 0 1) (31+ 10- 31+: 0 0 0) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 -1 0) (15+ 5- 15+: 0 -1 0) [1 1 1] 0 2 (10- 10- 10-: 1 0 0) (31+ 10- 31+: 0 0 -1) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (5- 15+ 5-: 0 1 0) (15+ 15+ 15+: 0 1 0) [1 1 1] 0 2 (10- 31+ 10-: 0 0 0) (31+ 31+ 31+: -1 0 -1) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (5- 15+ 5-: 0 1 0) (15+ 15+ 15+: 0 1 0) [1 1 1] 0 2 (10- 31+ 10-: 0 0 1) (31+ 31+ 31+: -1 0 0) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (5- 15+ 5-: 0 1 0) (15+ 15+ 15+: 0 1 0) [1 1 1] 0 2 (10- 31+ 10-: 1 0 0) (31+ 31+ 31+: 0 0 -1) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (5- 15+ 5-: 0 1 0) (15+ 15+ 15+: 0 1 0) [1 1 1] 0 2 (10- 31+ 10-: 1 0 1) (31+ 31+ 31+: 0 0 0) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 0 -1) (15+ 15+ 5-: 0 0 -1) [1 1 1] 0 2 (10- 10- 10-: 0 0 0) (31+ 31+ 10-: -1 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 0 -1) (15+ 15+ 5-: 0 0 -1) [1 1 1] 0 2 (10- 10- 10-: 0 1 0) (31+ 31+ 10-: -1 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 0 -1) (15+ 15+ 5-: 0 0 -1) [1 1 1] 0 2 (10- 10- 10-: 1 0 0) (31+ 31+ 10-: 0 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 0 -1) (15+ 15+ 5-: 0 0 -1) [1 1 1] 0 2 (10- 10- 10-: 1 1 0) (31+ 31+ 10-: 0 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (5- 5- 15+: 0 0 1) (15+ 15+ 15+: 0 0 1) [1 1 1] 0 2 (10- 10- 31+: 1 0 0) (31+ 31+ 31+: 0 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (5- 5- 15+: 0 0 1) (15+ 15+ 15+: 0 0 1) [1 1 1] 0 2 (10- 10- 31+: 1 1 0) (31+ 31+ 31+: 0 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (5- 5- 15+: 0 0 1) (15+ 15+ 15+: 0 0 1) [1 1 1] 0 2 (10- 10- 31+: 0 0 0) (31+ 31+ 31+: -1 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (5- 5- 15+: 0 0 1) (15+ 15+ 15+: 0 0 1) [1 1 1] 0 2 (10- 10- 31+: 0 1 0) (31+ 31+ 31+: -1 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 0) (4- 21+ 4-: 0 -1 0) [1 2 1] 0 0 (2- 2- 2-: -1 0 0) (2- 10+ 2-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 1 0) (4- 21+ 4-: 0 0 0) [1 2 1] 0 0 (2- 2- 2-: -1 0 0) (2- 10+ 2-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (21+ 4- 21+: 0 0 0) (21+ 21+ 21+: 0 -1 0) [1 2 1] 0 0 (10+ 2- 10+: 1 0 0) (10+ 10+ 10+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (21+ 4- 21+: 0 1 0) (21+ 21+ 21+: 0 0 0) [1 2 1] 0 0 (10+ 2- 10+: 1 0 0) (10+ 10+ 10+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (21+ 4- 4-: 0 0 0) (21+ 21+ 4-: 0 -1 0) [1 2 1] 0 0 (10+ 2- 2-: 1 0 0) (10+ 10+ 2-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (21+ 4- 4-: 0 1 0) (21+ 21+ 4-: 0 0 0) [1 2 1] 0 0 (10+ 2- 2-: 1 0 0) (10+ 10+ 2-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 21+: 0 0 0) (4- 21+ 21+: 0 -1 0) [1 2 1] 0 0 (2- 2- 10+: -1 0 0) (2- 10+ 10+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 21+: 0 1 0) (4- 21+ 21+: 0 0 0) [1 2 1] 0 0 (2- 2- 10+: -1 0 0) (2- 10+ 10+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 2 0 0) (21+ 4- 4-: -1 0 0) [2 1 1] 0 0 (2- 2- 2-: 1 -1 0) (10+ 2- 2-: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 2) (4- 4- 21+: 0 0 -1) [1 1 2] 0 0 (2- 2- 2-: 0 -1 1) (2- 2- 10+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 21+: 2 0 0) (21+ 4- 21+: -1 0 0) [2 1 1] 0 0 (2- 2- 10+: 1 -1 0) (10+ 2- 10+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (21+ 4- 4-: 0 0 2) (21+ 4- 21+: 0 0 -1) [1 1 2] 0 0 (10+ 2- 2-: 0 -1 1) (10+ 2- 10+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 1 0 0) (21+ 4- 4-: -2 0 0) [2 1 1] 0 0 (2- 2- 2-: 0 -1 0) (10+ 2- 2-: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 1) (4- 4- 21+: 0 0 -2) [1 1 2] 0 0 (2- 2- 2-: 0 -1 0) (2- 2- 10+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 21+: 1 0 0) (21+ 4- 21+: -2 0 0) [2 1 1] 0 0 (2- 2- 10+: 0 -1 0) (10+ 2- 10+: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (21+ 4- 4-: 0 0 1) (21+ 4- 21+: 0 0 -2) [1 1 2] 0 0 (10+ 2- 2-: 0 -1 0) (10+ 2- 10+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 21+ 4-: 2 0 0) (21+ 21+ 4-: -1 0 0) [2 1 1] 0 0 (2- 10+ 2-: 1 1 0) (10+ 10+ 2-: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 21+ 4-: 0 0 2) (4- 21+ 21+: 0 0 -1) [1 1 2] 0 0 (2- 10+ 2-: 0 1 1) (2- 10+ 10+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 21+ 21+: 2 0 0) (21+ 21+ 21+: -1 0 0) [2 1 1] 0 0 (2- 10+ 10+: 1 1 0) (10+ 10+ 10+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (21+ 21+ 4-: 0 0 2) (21+ 21+ 21+: 0 0 -1) [1 1 2] 0 0 (10+ 10+ 2-: 0 1 1) (10+ 10+ 10+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 21+ 4-: 1 0 0) (21+ 21+ 4-: -2 0 0) [2 1 1] 0 0 (2- 10+ 2-: 0 1 0) (10+ 10+ 2-: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 21+ 4-: 0 0 1) (4- 21+ 21+: 0 0 -2) [1 1 2] 0 0 (2- 10+ 2-: 0 1 0) (2- 10+ 10+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 21+ 21+: 1 0 0) (21+ 21+ 21+: -2 0 0) [2 1 1] 0 0 (2- 10+ 10+: 0 1 0) (10+ 10+ 10+: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (21+ 21+ 4-: 0 0 1) (21+ 21+ 21+: 0 0 -2) [1 1 2] 0 0 (10+ 10+ 2-: 0 1 0) (10+ 10+ 10+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 0) (4- 4- 4-: 0 0 0) [1 1 1] 0 0 (2- 2- 2-: 0 -1 0) (2- 2- 2-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (21+ 4- 4-: 0 0 0) (21+ 4- 4-: 0 0 0) [1 1 1] 0 0 (10+ 2- 2-: 0 -1 0) (10+ 2- 2-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (4- 4- 21+: 0 0 0) (4- 4- 21+: 0 0 0) [1 1 1] 0 0 (2- 2- 10+: 0 -1 0) (2- 2- 10+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (21+ 4- 21+: 0 0 0) (21+ 4- 21+: 0 0 0) [1 1 1] 0 0 (10+ 2- 10+: 0 -1 0) (10+ 2- 10+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (4- 21+ 4-: 0 0 0) (4- 21+ 4-: 0 0 0) [1 1 1] 0 0 (2- 10+ 2-: 0 1 0) (2- 10+ 2-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (21+ 21+ 4-: 0 0 0) (21+ 21+ 4-: 0 0 0) [1 1 1] 0 0 (10+ 10+ 2-: 0 1 0) (10+ 10+ 2-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (4- 21+ 21+: 0 0 0) (4- 21+ 21+: 0 0 0) [1 1 1] 0 0 (2- 10+ 10+: 0 1 0) (2- 10+ 10+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (21+ 21+ 21+: 0 0 0) (21+ 21+ 21+: 0 0 0) [1 1 1] 0 0 (10+ 10+ 10+: 0 1 0) (10+ 10+ 10+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 1) (10- 31+ 31+: 0 -1 -2) [1 2 2] 0 1 (5- 5- 5-: -1 0 0) (5- 15+ 15+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 1 1) (10- 31+ 31+: 0 0 -2) [1 2 2] 0 1 (5- 5- 5-: -1 0 0) (5- 15+ 15+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 2) (10- 31+ 31+: 0 -1 -1) [1 2 2] 0 1 (5- 5- 5-: -1 0 1) (5- 15+ 15+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 1 2) (10- 31+ 31+: 0 0 -1) [1 2 2] 0 1 (5- 5- 5-: -1 0 1) (5- 15+ 15+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (31+ 10- 10-: 0 0 2) (31+ 31+ 31+: 0 -1 -1) [1 2 2] 0 1 (15+ 5- 5-: 1 0 1) (15+ 15+ 15+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (31+ 10- 10-: 0 1 2) (31+ 31+ 31+: 0 0 -1) [1 2 2] 0 1 (15+ 5- 5-: 1 0 1) (15+ 15+ 15+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (31+ 10- 10-: 0 0 1) (31+ 31+ 31+: 0 -1 -2) [1 2 2] 0 1 (15+ 5- 5-: 1 0 0) (15+ 15+ 15+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (31+ 10- 10-: 0 1 1) (31+ 31+ 31+: 0 0 -2) [1 2 2] 0 1 (15+ 5- 5-: 1 0 0) (15+ 15+ 15+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 2 0 1) (31+ 10- 31+: -1 0 -2) [2 1 2] 0 1 (5- 5- 5-: 1 -1 0) (15+ 5- 15+: 0 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 2 0 2) (31+ 10- 31+: -1 0 -1) [2 1 2] 0 1 (5- 5- 5-: 1 -1 1) (15+ 5- 15+: 0 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 1 0 1) (31+ 10- 31+: -2 0 -2) [2 1 2] 0 1 (5- 5- 5-: 0 -1 0) (15+ 5- 15+: -1 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 1 0 2) (31+ 10- 31+: -2 0 -1) [2 1 2] 0 1 (5- 5- 5-: 0 -1 1) (15+ 5- 15+: -1 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 31+ 10-: 2 0 2) (31+ 31+ 31+: -1 0 -1) [2 1 2] 0 1 (5- 15+ 5-: 1 1 1) (15+ 15+ 15+: 0 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 31+ 10-: 2 0 1) (31+ 31+ 31+: -1 0 -2) [2 1 2] 0 1 (5- 15+ 5-: 1 1 0) (15+ 15+ 15+: 0 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 31+ 10-: 1 0 2) (31+ 31+ 31+: -2 0 -1) [2 1 2] 0 1 (5- 15+ 5-: 0 1 1) (15+ 15+ 15+: -1 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 31+ 10-: 1 0 1) (31+ 31+ 31+: -2 0 -2) [2 1 2] 0 1 (5- 15+ 5-: 0 1 0) (15+ 15+ 15+: -1 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 0) (31+ 31+ 10-: -1 -1 0) [2 2 1] 0 1 (5- 5- 5-: 0 0 -1) (15+ 15+ 5-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 1 0) (31+ 31+ 10-: -1 0 0) [2 2 1] 0 1 (5- 5- 5-: 0 0 -1) (15+ 15+ 5-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 1 0 0) (31+ 31+ 10-: 0 -1 0) [2 2 1] 0 1 (5- 5- 5-: 0 0 -1) (15+ 15+ 5-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 1 1 0) (31+ 31+ 10-: 0 0 0) [2 2 1] 0 1 (5- 5- 5-: 0 0 -1) (15+ 15+ 5-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 31+: 1 0 0) (31+ 31+ 31+: 0 -1 0) [2 2 1] 0 1 (5- 5- 15+: 0 0 1) (15+ 15+ 15+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 31+: 1 1 0) (31+ 31+ 31+: 0 0 0) [2 2 1] 0 1 (5- 5- 15+: 0 0 1) (15+ 15+ 15+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 31+: 0 0 0) (31+ 31+ 31+: -1 -1 0) [2 2 1] 0 1 (5- 5- 15+: 0 0 1) (15+ 15+ 15+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 31+: 0 1 0) (31+ 31+ 31+: -1 0 0) [2 2 1] 0 1 (5- 5- 15+: 0 0 1) (15+ 15+ 15+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (11- 11- 11-: -1 0 0) (11- 28+ 28+: -1 0 0) [1 1 1] 0 3 (22- 22- 22-: 0 0 1) (22- 57+ 57+: 0 -1 0) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: -1 0 0) (11- 28+ 28+: -1 0 0) [1 1 1] 0 3 (22- 22- 22-: 0 1 1) (22- 57+ 57+: 0 0 0) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: -1 0 0) (11- 28+ 28+: -1 0 0) [1 1 1] 0 3 (22- 22- 22-: 0 0 0) (22- 57+ 57+: 0 -1 -1) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: -1 0 0) (11- 28+ 28+: -1 0 0) [1 1 1] 0 3 (22- 22- 22-: 0 1 0) (22- 57+ 57+: 0 0 -1) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 2 (28+ 11- 11-: 1 0 0) (28+ 28+ 28+: 1 0 0) [1 1 1] 0 3 (57+ 22- 22-: 0 0 0) (57+ 57+ 57+: 0 -1 -1) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 2 (28+ 11- 11-: 1 0 0) (28+ 28+ 28+: 1 0 0) [1 1 1] 0 3 (57+ 22- 22-: 0 1 0) (57+ 57+ 57+: 0 0 -1) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 2 (28+ 11- 11-: 1 0 0) (28+ 28+ 28+: 1 0 0) [1 1 1] 0 3 (57+ 22- 22-: 0 0 1) (57+ 57+ 57+: 0 -1 0) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 2 (28+ 11- 11-: 1 0 0) (28+ 28+ 28+: 1 0 0) [1 1 1] 0 3 (57+ 22- 22-: 0 1 1) (57+ 57+ 57+: 0 0 0) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 -1 0) (28+ 11- 28+: 0 -1 0) [1 1 1] 0 3 (22- 22- 22-: 0 0 1) (57+ 22- 57+: -1 0 0) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 -1 0) (28+ 11- 28+: 0 -1 0) [1 1 1] 0 3 (22- 22- 22-: 0 0 0) (57+ 22- 57+: -1 0 -1) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 -1 0) (28+ 11- 28+: 0 -1 0) [1 1 1] 0 3 (22- 22- 22-: 1 0 1) (57+ 22- 57+: 0 0 0) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 -1 0) (28+ 11- 28+: 0 -1 0) [1 1 1] 0 3 (22- 22- 22-: 1 0 0) (57+ 22- 57+: 0 0 -1) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 2 (11- 28+ 11-: 0 1 0) (28+ 28+ 28+: 0 1 0) [1 1 1] 0 3 (22- 57+ 22-: 0 0 0) (57+ 57+ 57+: -1 0 -1) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 2 (11- 28+ 11-: 0 1 0) (28+ 28+ 28+: 0 1 0) [1 1 1] 0 3 (22- 57+ 22-: 0 0 1) (57+ 57+ 57+: -1 0 0) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 2 (11- 28+ 11-: 0 1 0) (28+ 28+ 28+: 0 1 0) [1 1 1] 0 3 (22- 57+ 22-: 1 0 0) (57+ 57+ 57+: 0 0 -1) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 2 (11- 28+ 11-: 0 1 0) (28+ 28+ 28+: 0 1 0) [1 1 1] 0 3 (22- 57+ 22-: 1 0 1) (57+ 57+ 57+: 0 0 0) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 0 -1) (28+ 28+ 11-: 0 0 -1) [1 1 1] 0 3 (22- 22- 22-: 0 0 0) (57+ 57+ 22-: -1 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 0 -1) (28+ 28+ 11-: 0 0 -1) [1 1 1] 0 3 (22- 22- 22-: 0 1 0) (57+ 57+ 22-: -1 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 0 -1) (28+ 28+ 11-: 0 0 -1) [1 1 1] 0 3 (22- 22- 22-: 1 0 0) (57+ 57+ 22-: 0 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 0 -1) (28+ 28+ 11-: 0 0 -1) [1 1 1] 0 3 (22- 22- 22-: 1 1 0) (57+ 57+ 22-: 0 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 2 (11- 11- 28+: 0 0 1) (28+ 28+ 28+: 0 0 1) [1 1 1] 0 3 (22- 22- 57+: 1 0 0) (57+ 57+ 57+: 0 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 2 (11- 11- 28+: 0 0 1) (28+ 28+ 28+: 0 0 1) [1 1 1] 0 3 (22- 22- 57+: 1 1 0) (57+ 57+ 57+: 0 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 2 (11- 11- 28+: 0 0 1) (28+ 28+ 28+: 0 0 1) [1 1 1] 0 3 (22- 22- 57+: 0 0 0) (57+ 57+ 57+: -1 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 2 (11- 11- 28+: 0 0 1) (28+ 28+ 28+: 0 0 1) [1 1 1] 0 3 (22- 22- 57+: 0 1 0) (57+ 57+ 57+: -1 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 0) (10- 31+ 10-: 0 -1 0) [1 2 1] 0 1 (5- 5- 5-: -1 0 0) (5- 15+ 5-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 1 0) (10- 31+ 10-: 0 0 0) [1 2 1] 0 1 (5- 5- 5-: -1 0 0) (5- 15+ 5-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (31+ 10- 31+: 0 0 0) (31+ 31+ 31+: 0 -1 0) [1 2 1] 0 1 (15+ 5- 15+: 1 0 0) (15+ 15+ 15+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (31+ 10- 31+: 0 1 0) (31+ 31+ 31+: 0 0 0) [1 2 1] 0 1 (15+ 5- 15+: 1 0 0) (15+ 15+ 15+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (31+ 10- 10-: 0 0 0) (31+ 31+ 10-: 0 -1 0) [1 2 1] 0 1 (15+ 5- 5-: 1 0 0) (15+ 15+ 5-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (31+ 10- 10-: 0 1 0) (31+ 31+ 10-: 0 0 0) [1 2 1] 0 1 (15+ 5- 5-: 1 0 0) (15+ 15+ 5-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 31+: 0 0 0) (10- 31+ 31+: 0 -1 0) [1 2 1] 0 1 (5- 5- 15+: -1 0 0) (5- 15+ 15+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 31+: 0 1 0) (10- 31+ 31+: 0 0 0) [1 2 1] 0 1 (5- 5- 15+: -1 0 0) (5- 15+ 15+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 2 0 0) (31+ 10- 10-: -1 0 0) [2 1 1] 0 1 (5- 5- 5-: 1 -1 0) (15+ 5- 5-: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 2) (10- 10- 31+: 0 0 -1) [1 1 2] 0 1 (5- 5- 5-: 0 -1 1) (5- 5- 15+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 31+: 2 0 0) (31+ 10- 31+: -1 0 0) [2 1 1] 0 1 (5- 5- 15+: 1 -1 0) (15+ 5- 15+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (31+ 10- 10-: 0 0 2) (31+ 10- 31+: 0 0 -1) [1 1 2] 0 1 (15+ 5- 5-: 0 -1 1) (15+ 5- 15+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 1 0 0) (31+ 10- 10-: -2 0 0) [2 1 1] 0 1 (5- 5- 5-: 0 -1 0) (15+ 5- 5-: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 1) (10- 10- 31+: 0 0 -2) [1 1 2] 0 1 (5- 5- 5-: 0 -1 0) (5- 5- 15+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 31+: 1 0 0) (31+ 10- 31+: -2 0 0) [2 1 1] 0 1 (5- 5- 15+: 0 -1 0) (15+ 5- 15+: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (31+ 10- 10-: 0 0 1) (31+ 10- 31+: 0 0 -2) [1 1 2] 0 1 (15+ 5- 5-: 0 -1 0) (15+ 5- 15+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 31+ 10-: 2 0 0) (31+ 31+ 10-: -1 0 0) [2 1 1] 0 1 (5- 15+ 5-: 1 1 0) (15+ 15+ 5-: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 31+ 10-: 0 0 2) (10- 31+ 31+: 0 0 -1) [1 1 2] 0 1 (5- 15+ 5-: 0 1 1) (5- 15+ 15+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 31+ 31+: 2 0 0) (31+ 31+ 31+: -1 0 0) [2 1 1] 0 1 (5- 15+ 15+: 1 1 0) (15+ 15+ 15+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (31+ 31+ 10-: 0 0 2) (31+ 31+ 31+: 0 0 -1) [1 1 2] 0 1 (15+ 15+ 5-: 0 1 1) (15+ 15+ 15+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 31+ 10-: 1 0 0) (31+ 31+ 10-: -2 0 0) [2 1 1] 0 1 (5- 15+ 5-: 0 1 0) (15+ 15+ 5-: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 31+ 10-: 0 0 1) (10- 31+ 31+: 0 0 -2) [1 1 2] 0 1 (5- 15+ 5-: 0 1 0) (5- 15+ 15+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 31+ 31+: 1 0 0) (31+ 31+ 31+: -2 0 0) [2 1 1] 0 1 (5- 15+ 15+: 0 1 0) (15+ 15+ 15+: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (31+ 31+ 10-: 0 0 1) (31+ 31+ 31+: 0 0 -2) [1 1 2] 0 1 (15+ 15+ 5-: 0 1 0) (15+ 15+ 15+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 0) (10- 10- 10-: 0 0 0) [1 1 1] 0 1 (5- 5- 5-: 0 -1 0) (5- 5- 5-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (31+ 10- 10-: 0 0 0) (31+ 10- 10-: 0 0 0) [1 1 1] 0 1 (15+ 5- 5-: 0 -1 0) (15+ 5- 5-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (10- 10- 31+: 0 0 0) (10- 10- 31+: 0 0 0) [1 1 1] 0 1 (5- 5- 15+: 0 -1 0) (5- 5- 15+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (31+ 10- 31+: 0 0 0) (31+ 10- 31+: 0 0 0) [1 1 1] 0 1 (15+ 5- 15+: 0 -1 0) (15+ 5- 15+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (10- 31+ 10-: 0 0 0) (10- 31+ 10-: 0 0 0) [1 1 1] 0 1 (5- 15+ 5-: 0 1 0) (5- 15+ 5-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (31+ 31+ 10-: 0 0 0) (31+ 31+ 10-: 0 0 0) [1 1 1] 0 1 (15+ 15+ 5-: 0 1 0) (15+ 15+ 5-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (10- 31+ 31+: 0 0 0) (10- 31+ 31+: 0 0 0) [1 1 1] 0 1 (5- 15+ 15+: 0 1 0) (5- 15+ 15+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (31+ 31+ 31+: 0 0 0) (31+ 31+ 31+: 0 0 0) [1 1 1] 0 1 (15+ 15+ 15+: 0 1 0) (15+ 15+ 15+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 0 1) (22- 57+ 57+: 0 -1 -2) [1 2 2] 0 2 (11- 11- 11-: -1 0 0) (11- 28+ 28+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 1 1) (22- 57+ 57+: 0 0 -2) [1 2 2] 0 2 (11- 11- 11-: -1 0 0) (11- 28+ 28+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 0 2) (22- 57+ 57+: 0 -1 -1) [1 2 2] 0 2 (11- 11- 11-: -1 0 1) (11- 28+ 28+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 1 2) (22- 57+ 57+: 0 0 -1) [1 2 2] 0 2 (11- 11- 11-: -1 0 1) (11- 28+ 28+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (57+ 22- 22-: 0 0 2) (57+ 57+ 57+: 0 -1 -1) [1 2 2] 0 2 (28+ 11- 11-: 1 0 1) (28+ 28+ 28+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (57+ 22- 22-: 0 1 2) (57+ 57+ 57+: 0 0 -1) [1 2 2] 0 2 (28+ 11- 11-: 1 0 1) (28+ 28+ 28+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (57+ 22- 22-: 0 0 1) (57+ 57+ 57+: 0 -1 -2) [1 2 2] 0 2 (28+ 11- 11-: 1 0 0) (28+ 28+ 28+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (57+ 22- 22-: 0 1 1) (57+ 57+ 57+: 0 0 -2) [1 2 2] 0 2 (28+ 11- 11-: 1 0 0) (28+ 28+ 28+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 2 0 1) (57+ 22- 57+: -1 0 -2) [2 1 2] 0 2 (11- 11- 11-: 1 -1 0) (28+ 11- 28+: 0 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 2 0 2) (57+ 22- 57+: -1 0 -1) [2 1 2] 0 2 (11- 11- 11-: 1 -1 1) (28+ 11- 28+: 0 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 1 0 1) (57+ 22- 57+: -2 0 -2) [2 1 2] 0 2 (11- 11- 11-: 0 -1 0) (28+ 11- 28+: -1 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 1 0 2) (57+ 22- 57+: -2 0 -1) [2 1 2] 0 2 (11- 11- 11-: 0 -1 1) (28+ 11- 28+: -1 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 57+ 22-: 2 0 2) (57+ 57+ 57+: -1 0 -1) [2 1 2] 0 2 (11- 28+ 11-: 1 1 1) (28+ 28+ 28+: 0 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 57+ 22-: 2 0 1) (57+ 57+ 57+: -1 0 -2) [2 1 2] 0 2 (11- 28+ 11-: 1 1 0) (28+ 28+ 28+: 0 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 57+ 22-: 1 0 2) (57+ 57+ 57+: -2 0 -1) [2 1 2] 0 2 (11- 28+ 11-: 0 1 1) (28+ 28+ 28+: -1 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 57+ 22-: 1 0 1) (57+ 57+ 57+: -2 0 -2) [2 1 2] 0 2 (11- 28+ 11-: 0 1 0) (28+ 28+ 28+: -1 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 0 0) (57+ 57+ 22-: -1 -1 0) [2 2 1] 0 2 (11- 11- 11-: 0 0 -1) (28+ 28+ 11-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 1 0) (57+ 57+ 22-: -1 0 0) [2 2 1] 0 2 (11- 11- 11-: 0 0 -1) (28+ 28+ 11-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 1 0 0) (57+ 57+ 22-: 0 -1 0) [2 2 1] 0 2 (11- 11- 11-: 0 0 -1) (28+ 28+ 11-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 1 1 0) (57+ 57+ 22-: 0 0 0) [2 2 1] 0 2 (11- 11- 11-: 0 0 -1) (28+ 28+ 11-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 57+: 1 0 0) (57+ 57+ 57+: 0 -1 0) [2 2 1] 0 2 (11- 11- 28+: 0 0 1) (28+ 28+ 28+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 57+: 1 1 0) (57+ 57+ 57+: 0 0 0) [2 2 1] 0 2 (11- 11- 28+: 0 0 1) (28+ 28+ 28+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 57+: 0 0 0) (57+ 57+ 57+: -1 -1 0) [2 2 1] 0 2 (11- 11- 28+: 0 0 1) (28+ 28+ 28+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 57+: 0 1 0) (57+ 57+ 57+: -1 0 0) [2 2 1] 0 2 (11- 11- 28+: 0 0 1) (28+ 28+ 28+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 0 0) (22- 57+ 22-: 0 -1 0) [1 2 1] 0 2 (11- 11- 11-: -1 0 0) (11- 28+ 11-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 1 0) (22- 57+ 22-: 0 0 0) [1 2 1] 0 2 (11- 11- 11-: -1 0 0) (11- 28+ 11-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (57+ 22- 57+: 0 0 0) (57+ 57+ 57+: 0 -1 0) [1 2 1] 0 2 (28+ 11- 28+: 1 0 0) (28+ 28+ 28+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (57+ 22- 57+: 0 1 0) (57+ 57+ 57+: 0 0 0) [1 2 1] 0 2 (28+ 11- 28+: 1 0 0) (28+ 28+ 28+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (57+ 22- 22-: 0 0 0) (57+ 57+ 22-: 0 -1 0) [1 2 1] 0 2 (28+ 11- 11-: 1 0 0) (28+ 28+ 11-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (57+ 22- 22-: 0 1 0) (57+ 57+ 22-: 0 0 0) [1 2 1] 0 2 (28+ 11- 11-: 1 0 0) (28+ 28+ 11-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 57+: 0 0 0) (22- 57+ 57+: 0 -1 0) [1 2 1] 0 2 (11- 11- 28+: -1 0 0) (11- 28+ 28+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 57+: 0 1 0) (22- 57+ 57+: 0 0 0) [1 2 1] 0 2 (11- 11- 28+: -1 0 0) (11- 28+ 28+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 2 0 0) (57+ 22- 22-: -1 0 0) [2 1 1] 0 2 (11- 11- 11-: 1 -1 0) (28+ 11- 11-: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 0 2) (22- 22- 57+: 0 0 -1) [1 1 2] 0 2 (11- 11- 11-: 0 -1 1) (11- 11- 28+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 57+: 2 0 0) (57+ 22- 57+: -1 0 0) [2 1 1] 0 2 (11- 11- 28+: 1 -1 0) (28+ 11- 28+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (57+ 22- 22-: 0 0 2) (57+ 22- 57+: 0 0 -1) [1 1 2] 0 2 (28+ 11- 11-: 0 -1 1) (28+ 11- 28+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 1 0 0) (57+ 22- 22-: -2 0 0) [2 1 1] 0 2 (11- 11- 11-: 0 -1 0) (28+ 11- 11-: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 0 1) (22- 22- 57+: 0 0 -2) [1 1 2] 0 2 (11- 11- 11-: 0 -1 0) (11- 11- 28+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 57+: 1 0 0) (57+ 22- 57+: -2 0 0) [2 1 1] 0 2 (11- 11- 28+: 0 -1 0) (28+ 11- 28+: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (57+ 22- 22-: 0 0 1) (57+ 22- 57+: 0 0 -2) [1 1 2] 0 2 (28+ 11- 11-: 0 -1 0) (28+ 11- 28+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 57+ 22-: 2 0 0) (57+ 57+ 22-: -1 0 0) [2 1 1] 0 2 (11- 28+ 11-: 1 1 0) (28+ 28+ 11-: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 57+ 22-: 0 0 2) (22- 57+ 57+: 0 0 -1) [1 1 2] 0 2 (11- 28+ 11-: 0 1 1) (11- 28+ 28+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 57+ 57+: 2 0 0) (57+ 57+ 57+: -1 0 0) [2 1 1] 0 2 (11- 28+ 28+: 1 1 0) (28+ 28+ 28+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (57+ 57+ 22-: 0 0 2) (57+ 57+ 57+: 0 0 -1) [1 1 2] 0 2 (28+ 28+ 11-: 0 1 1) (28+ 28+ 28+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 57+ 22-: 1 0 0) (57+ 57+ 22-: -2 0 0) [2 1 1] 0 2 (11- 28+ 11-: 0 1 0) (28+ 28+ 11-: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 57+ 22-: 0 0 1) (22- 57+ 57+: 0 0 -2) [1 1 2] 0 2 (11- 28+ 11-: 0 1 0) (11- 28+ 28+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 57+ 57+: 1 0 0) (57+ 57+ 57+: -2 0 0) [2 1 1] 0 2 (11- 28+ 28+: 0 1 0) (28+ 28+ 28+: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (57+ 57+ 22-: 0 0 1) (57+ 57+ 57+: 0 0 -2) [1 1 2] 0 2 (28+ 28+ 11-: 0 1 0) (28+ 28+ 28+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 0 0) (22- 22- 22-: 0 0 0) [1 1 1] 0 2 (11- 11- 11-: 0 -1 0) (11- 11- 11-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (57+ 22- 22-: 0 0 0) (57+ 22- 22-: 0 0 0) [1 1 1] 0 2 (28+ 11- 11-: 0 -1 0) (28+ 11- 11-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (22- 22- 57+: 0 0 0) (22- 22- 57+: 0 0 0) [1 1 1] 0 2 (11- 11- 28+: 0 -1 0) (11- 11- 28+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (57+ 22- 57+: 0 0 0) (57+ 22- 57+: 0 0 0) [1 1 1] 0 2 (28+ 11- 28+: 0 -1 0) (28+ 11- 28+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (22- 57+ 22-: 0 0 0) (22- 57+ 22-: 0 0 0) [1 1 1] 0 2 (11- 28+ 11-: 0 1 0) (11- 28+ 11-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (57+ 57+ 22-: 0 0 0) (57+ 57+ 22-: 0 0 0) [1 1 1] 0 2 (28+ 28+ 11-: 0 1 0) (28+ 28+ 11-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (22- 57+ 57+: 0 0 0) (22- 57+ 57+: 0 0 0) [1 1 1] 0 2 (11- 28+ 28+: 0 1 0) (11- 28+ 28+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (57+ 57+ 57+: 0 0 0) (57+ 57+ 57+: 0 0 0) [1 1 1] 0 2 (28+ 28+ 28+: 0 1 0) (28+ 28+ 28+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -############################################################# - -FacParts: 0 0 [1 1 1] -FacParts: 1 1 [2 2 2] -FacParts: 2 2 [2 2 2] -FacParts: 3 3 [2 2 2] - -ProcessPoolCreate: 1 - -# ProcessPoolSetPart: pool part -ProcessPoolSetPart: 0 0 -ProcessPoolSetPart: 0 1 -ProcessPoolSetPart: 0 2 -ProcessPoolSetPart: 0 3 diff --git a/src/test/TEST_fac/5lev.in b/src/test/TEST_fac/5lev.in deleted file mode 100644 index 2c04e7cbee..0000000000 --- a/src/test/TEST_fac/5lev.in +++ /dev/null @@ -1,402 +0,0 @@ -# Copyright (c) 1998 Lawrence Livermore 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 5 -############################################################# -# GridSetExtents: part ilower(ndim) iupper(ndim) -GridSetExtents: 0 (1- 1- 1-) (12+ 12+ 12+) -GridSetExtents: 1 (4- 4- 4-) (21+ 21+ 21+) -GridSetExtents: 2 (10- 10- 10-) (31+ 31+ 31+) -GridSetExtents: 3 (22- 22- 22-) (57+ 57+ 57+) -GridSetExtents: 4 (46- 46- 46-) (103+ 103+ 103+) -############################################################# - -# GridSetVariables: part nvars vartypes[nvars] -# CELL = 0 -# NODE = 1 -# XFACE = 2 -# YFACE = 3 -# ZFACE = 4 -# XEDGE = 5 -# YEDGE = 6 -# ZEDGE = 7 - -GridSetVariables: 0 1 [0] -GridSetVariables: 1 1 [0] -GridSetVariables: 2 1 [0] -GridSetVariables: 3 1 [0] -GridSetVariables: 4 1 [0] -############################################################# - -# StencilCreate: nstencils sizes[nstencils] -StencilCreate: 1 [7] -############################################################# - -# StencilSetEntry: stencil_num entry offset[ndim] var value -StencilSetEntry: 0 0 [ 0 0 0] 0 6.000000 -StencilSetEntry: 0 1 [-1 0 0] 0 -1.000000 -StencilSetEntry: 0 2 [ 1 0 0] 0 -1.000000 -StencilSetEntry: 0 3 [ 0 -1 0] 0 -1.000000 -StencilSetEntry: 0 4 [ 0 0 1] 0 -1.000000 -StencilSetEntry: 0 5 [ 0 0 -1] 0 -1.000000 -StencilSetEntry: 0 6 [ 0 1 0] 0 -1.000000 -############################################################# - -# GraphSetStencil: part var stencil_num -GraphSetStencil: 0 0 0 -GraphSetStencil: 1 0 0 -GraphSetStencil: 2 0 0 -GraphSetStencil: 3 0 0 -GraphSetStencil: 4 0 0 -############################################################# - -# GraphAddEntries: \ - -# part ilower(ndim) iupper(ndim) stride[ndim] var \ - -# to_part to_ilower(ndim) to_iupper(ndim) to_stride[ndim] to_var \ - -# index_map[ndim] entry value -GraphAddEntries: 0 (2- 2- 2-: -1 0 0) (2- 10+ 10+: -1 0 0) [1 1 1] 0 1 (4- 4- 4-: 0 0 1) (4- 21+ 21+: 0 -1 0) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: -1 0 0) (2- 10+ 10+: -1 0 0) [1 1 1] 0 1 (4- 4- 4-: 0 1 1) (4- 21+ 21+: 0 0 0) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: -1 0 0) (2- 10+ 10+: -1 0 0) [1 1 1] 0 1 (4- 4- 4-: 0 0 0) (4- 21+ 21+: 0 -1 -1) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: -1 0 0) (2- 10+ 10+: -1 0 0) [1 1 1] 0 1 (4- 4- 4-: 0 1 0) (4- 21+ 21+: 0 0 -1) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (10+ 2- 2-: 1 0 0) (10+ 10+ 10+: 1 0 0) [1 1 1] 0 1 (21+ 4- 4-: 0 0 0) (21+ 21+ 21+: 0 -1 -1) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (10+ 2- 2-: 1 0 0) (10+ 10+ 10+: 1 0 0) [1 1 1] 0 1 (21+ 4- 4-: 0 1 0) (21+ 21+ 21+: 0 0 -1) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (10+ 2- 2-: 1 0 0) (10+ 10+ 10+: 1 0 0) [1 1 1] 0 1 (21+ 4- 4-: 0 0 1) (21+ 21+ 21+: 0 -1 0) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (10+ 2- 2-: 1 0 0) (10+ 10+ 10+: 1 0 0) [1 1 1] 0 1 (21+ 4- 4-: 0 1 1) (21+ 21+ 21+: 0 0 0) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 -1 0) (10+ 2- 10+: 0 -1 0) [1 1 1] 0 1 (4- 4- 4-: 0 0 1) (21+ 4- 21+: -1 0 0) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 -1 0) (10+ 2- 10+: 0 -1 0) [1 1 1] 0 1 (4- 4- 4-: 0 0 0) (21+ 4- 21+: -1 0 -1) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 -1 0) (10+ 2- 10+: 0 -1 0) [1 1 1] 0 1 (4- 4- 4-: 1 0 1) (21+ 4- 21+: 0 0 0) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 -1 0) (10+ 2- 10+: 0 -1 0) [1 1 1] 0 1 (4- 4- 4-: 1 0 0) (21+ 4- 21+: 0 0 -1) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (2- 10+ 2-: 0 1 0) (10+ 10+ 10+: 0 1 0) [1 1 1] 0 1 (4- 21+ 4-: 0 0 0) (21+ 21+ 21+: -1 0 -1) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (2- 10+ 2-: 0 1 0) (10+ 10+ 10+: 0 1 0) [1 1 1] 0 1 (4- 21+ 4-: 0 0 1) (21+ 21+ 21+: -1 0 0) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (2- 10+ 2-: 0 1 0) (10+ 10+ 10+: 0 1 0) [1 1 1] 0 1 (4- 21+ 4-: 1 0 0) (21+ 21+ 21+: 0 0 -1) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (2- 10+ 2-: 0 1 0) (10+ 10+ 10+: 0 1 0) [1 1 1] 0 1 (4- 21+ 4-: 1 0 1) (21+ 21+ 21+: 0 0 0) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 0 -1) (10+ 10+ 2-: 0 0 -1) [1 1 1] 0 1 (4- 4- 4-: 0 0 0) (21+ 21+ 4-: -1 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 0 -1) (10+ 10+ 2-: 0 0 -1) [1 1 1] 0 1 (4- 4- 4-: 0 1 0) (21+ 21+ 4-: -1 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 0 -1) (10+ 10+ 2-: 0 0 -1) [1 1 1] 0 1 (4- 4- 4-: 1 0 0) (21+ 21+ 4-: 0 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 0 -1) (10+ 10+ 2-: 0 0 -1) [1 1 1] 0 1 (4- 4- 4-: 1 1 0) (21+ 21+ 4-: 0 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (2- 2- 10+: 0 0 1) (10+ 10+ 10+: 0 0 1) [1 1 1] 0 1 (4- 4- 21+: 1 0 0) (21+ 21+ 21+: 0 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (2- 2- 10+: 0 0 1) (10+ 10+ 10+: 0 0 1) [1 1 1] 0 1 (4- 4- 21+: 1 1 0) (21+ 21+ 21+: 0 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (2- 2- 10+: 0 0 1) (10+ 10+ 10+: 0 0 1) [1 1 1] 0 1 (4- 4- 21+: 0 0 0) (21+ 21+ 21+: -1 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (2- 2- 10+: 0 0 1) (10+ 10+ 10+: 0 0 1) [1 1 1] 0 1 (4- 4- 21+: 0 1 0) (21+ 21+ 21+: -1 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 1) (4- 21+ 21+: 0 -1 -2) [1 2 2] 0 0 (2- 2- 2-: -1 0 0) (2- 10+ 10+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 1 1) (4- 21+ 21+: 0 0 -2) [1 2 2] 0 0 (2- 2- 2-: -1 0 0) (2- 10+ 10+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 2) (4- 21+ 21+: 0 -1 -1) [1 2 2] 0 0 (2- 2- 2-: -1 0 1) (2- 10+ 10+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 1 2) (4- 21+ 21+: 0 0 -1) [1 2 2] 0 0 (2- 2- 2-: -1 0 1) (2- 10+ 10+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (21+ 4- 4-: 0 0 2) (21+ 21+ 21+: 0 -1 -1) [1 2 2] 0 0 (10+ 2- 2-: 1 0 1) (10+ 10+ 10+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (21+ 4- 4-: 0 1 2) (21+ 21+ 21+: 0 0 -1) [1 2 2] 0 0 (10+ 2- 2-: 1 0 1) (10+ 10+ 10+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (21+ 4- 4-: 0 0 1) (21+ 21+ 21+: 0 -1 -2) [1 2 2] 0 0 (10+ 2- 2-: 1 0 0) (10+ 10+ 10+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (21+ 4- 4-: 0 1 1) (21+ 21+ 21+: 0 0 -2) [1 2 2] 0 0 (10+ 2- 2-: 1 0 0) (10+ 10+ 10+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 2 0 1) (21+ 4- 21+: -1 0 -2) [2 1 2] 0 0 (2- 2- 2-: 1 -1 0) (10+ 2- 10+: 0 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 2 0 2) (21+ 4- 21+: -1 0 -1) [2 1 2] 0 0 (2- 2- 2-: 1 -1 1) (10+ 2- 10+: 0 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 1 0 1) (21+ 4- 21+: -2 0 -2) [2 1 2] 0 0 (2- 2- 2-: 0 -1 0) (10+ 2- 10+: -1 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 1 0 2) (21+ 4- 21+: -2 0 -1) [2 1 2] 0 0 (2- 2- 2-: 0 -1 1) (10+ 2- 10+: -1 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 21+ 4-: 2 0 2) (21+ 21+ 21+: -1 0 -1) [2 1 2] 0 0 (2- 10+ 2-: 1 1 1) (10+ 10+ 10+: 0 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 21+ 4-: 2 0 1) (21+ 21+ 21+: -1 0 -2) [2 1 2] 0 0 (2- 10+ 2-: 1 1 0) (10+ 10+ 10+: 0 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 21+ 4-: 1 0 2) (21+ 21+ 21+: -2 0 -1) [2 1 2] 0 0 (2- 10+ 2-: 0 1 1) (10+ 10+ 10+: -1 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 21+ 4-: 1 0 1) (21+ 21+ 21+: -2 0 -2) [2 1 2] 0 0 (2- 10+ 2-: 0 1 0) (10+ 10+ 10+: -1 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 0) (21+ 21+ 4-: -1 -1 0) [2 2 1] 0 0 (2- 2- 2-: 0 0 -1) (10+ 10+ 2-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 1 0) (21+ 21+ 4-: -1 0 0) [2 2 1] 0 0 (2- 2- 2-: 0 0 -1) (10+ 10+ 2-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 1 0 0) (21+ 21+ 4-: 0 -1 0) [2 2 1] 0 0 (2- 2- 2-: 0 0 -1) (10+ 10+ 2-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 1 1 0) (21+ 21+ 4-: 0 0 0) [2 2 1] 0 0 (2- 2- 2-: 0 0 -1) (10+ 10+ 2-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 21+: 1 0 0) (21+ 21+ 21+: 0 -1 0) [2 2 1] 0 0 (2- 2- 10+: 0 0 1) (10+ 10+ 10+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 21+: 1 1 0) (21+ 21+ 21+: 0 0 0) [2 2 1] 0 0 (2- 2- 10+: 0 0 1) (10+ 10+ 10+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 21+: 0 0 0) (21+ 21+ 21+: -1 -1 0) [2 2 1] 0 0 (2- 2- 10+: 0 0 1) (10+ 10+ 10+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 21+: 0 1 0) (21+ 21+ 21+: -1 0 0) [2 2 1] 0 0 (2- 2- 10+: 0 0 1) (10+ 10+ 10+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (5- 5- 5-: -1 0 0) (5- 15+ 15+: -1 0 0) [1 1 1] 0 2 (10- 10- 10-: 0 0 1) (10- 31+ 31+: 0 -1 0) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: -1 0 0) (5- 15+ 15+: -1 0 0) [1 1 1] 0 2 (10- 10- 10-: 0 1 1) (10- 31+ 31+: 0 0 0) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: -1 0 0) (5- 15+ 15+: -1 0 0) [1 1 1] 0 2 (10- 10- 10-: 0 0 0) (10- 31+ 31+: 0 -1 -1) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: -1 0 0) (5- 15+ 15+: -1 0 0) [1 1 1] 0 2 (10- 10- 10-: 0 1 0) (10- 31+ 31+: 0 0 -1) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (15+ 5- 5-: 1 0 0) (15+ 15+ 15+: 1 0 0) [1 1 1] 0 2 (31+ 10- 10-: 0 0 0) (31+ 31+ 31+: 0 -1 -1) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (15+ 5- 5-: 1 0 0) (15+ 15+ 15+: 1 0 0) [1 1 1] 0 2 (31+ 10- 10-: 0 1 0) (31+ 31+ 31+: 0 0 -1) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (15+ 5- 5-: 1 0 0) (15+ 15+ 15+: 1 0 0) [1 1 1] 0 2 (31+ 10- 10-: 0 0 1) (31+ 31+ 31+: 0 -1 0) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (15+ 5- 5-: 1 0 0) (15+ 15+ 15+: 1 0 0) [1 1 1] 0 2 (31+ 10- 10-: 0 1 1) (31+ 31+ 31+: 0 0 0) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 -1 0) (15+ 5- 15+: 0 -1 0) [1 1 1] 0 2 (10- 10- 10-: 0 0 1) (31+ 10- 31+: -1 0 0) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 -1 0) (15+ 5- 15+: 0 -1 0) [1 1 1] 0 2 (10- 10- 10-: 0 0 0) (31+ 10- 31+: -1 0 -1) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 -1 0) (15+ 5- 15+: 0 -1 0) [1 1 1] 0 2 (10- 10- 10-: 1 0 1) (31+ 10- 31+: 0 0 0) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 -1 0) (15+ 5- 15+: 0 -1 0) [1 1 1] 0 2 (10- 10- 10-: 1 0 0) (31+ 10- 31+: 0 0 -1) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (5- 15+ 5-: 0 1 0) (15+ 15+ 15+: 0 1 0) [1 1 1] 0 2 (10- 31+ 10-: 0 0 0) (31+ 31+ 31+: -1 0 -1) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (5- 15+ 5-: 0 1 0) (15+ 15+ 15+: 0 1 0) [1 1 1] 0 2 (10- 31+ 10-: 0 0 1) (31+ 31+ 31+: -1 0 0) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (5- 15+ 5-: 0 1 0) (15+ 15+ 15+: 0 1 0) [1 1 1] 0 2 (10- 31+ 10-: 1 0 0) (31+ 31+ 31+: 0 0 -1) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (5- 15+ 5-: 0 1 0) (15+ 15+ 15+: 0 1 0) [1 1 1] 0 2 (10- 31+ 10-: 1 0 1) (31+ 31+ 31+: 0 0 0) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 0 -1) (15+ 15+ 5-: 0 0 -1) [1 1 1] 0 2 (10- 10- 10-: 0 0 0) (31+ 31+ 10-: -1 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 0 -1) (15+ 15+ 5-: 0 0 -1) [1 1 1] 0 2 (10- 10- 10-: 0 1 0) (31+ 31+ 10-: -1 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 0 -1) (15+ 15+ 5-: 0 0 -1) [1 1 1] 0 2 (10- 10- 10-: 1 0 0) (31+ 31+ 10-: 0 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 0 -1) (15+ 15+ 5-: 0 0 -1) [1 1 1] 0 2 (10- 10- 10-: 1 1 0) (31+ 31+ 10-: 0 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (5- 5- 15+: 0 0 1) (15+ 15+ 15+: 0 0 1) [1 1 1] 0 2 (10- 10- 31+: 1 0 0) (31+ 31+ 31+: 0 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (5- 5- 15+: 0 0 1) (15+ 15+ 15+: 0 0 1) [1 1 1] 0 2 (10- 10- 31+: 1 1 0) (31+ 31+ 31+: 0 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (5- 5- 15+: 0 0 1) (15+ 15+ 15+: 0 0 1) [1 1 1] 0 2 (10- 10- 31+: 0 0 0) (31+ 31+ 31+: -1 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (5- 5- 15+: 0 0 1) (15+ 15+ 15+: 0 0 1) [1 1 1] 0 2 (10- 10- 31+: 0 1 0) (31+ 31+ 31+: -1 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 0) (4- 21+ 4-: 0 -1 0) [1 2 1] 0 0 (2- 2- 2-: -1 0 0) (2- 10+ 2-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 1 0) (4- 21+ 4-: 0 0 0) [1 2 1] 0 0 (2- 2- 2-: -1 0 0) (2- 10+ 2-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (21+ 4- 21+: 0 0 0) (21+ 21+ 21+: 0 -1 0) [1 2 1] 0 0 (10+ 2- 10+: 1 0 0) (10+ 10+ 10+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (21+ 4- 21+: 0 1 0) (21+ 21+ 21+: 0 0 0) [1 2 1] 0 0 (10+ 2- 10+: 1 0 0) (10+ 10+ 10+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (21+ 4- 4-: 0 0 0) (21+ 21+ 4-: 0 -1 0) [1 2 1] 0 0 (10+ 2- 2-: 1 0 0) (10+ 10+ 2-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (21+ 4- 4-: 0 1 0) (21+ 21+ 4-: 0 0 0) [1 2 1] 0 0 (10+ 2- 2-: 1 0 0) (10+ 10+ 2-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 21+: 0 0 0) (4- 21+ 21+: 0 -1 0) [1 2 1] 0 0 (2- 2- 10+: -1 0 0) (2- 10+ 10+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 21+: 0 1 0) (4- 21+ 21+: 0 0 0) [1 2 1] 0 0 (2- 2- 10+: -1 0 0) (2- 10+ 10+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 2 0 0) (21+ 4- 4-: -1 0 0) [2 1 1] 0 0 (2- 2- 2-: 1 -1 0) (10+ 2- 2-: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 2) (4- 4- 21+: 0 0 -1) [1 1 2] 0 0 (2- 2- 2-: 0 -1 1) (2- 2- 10+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 21+: 2 0 0) (21+ 4- 21+: -1 0 0) [2 1 1] 0 0 (2- 2- 10+: 1 -1 0) (10+ 2- 10+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (21+ 4- 4-: 0 0 2) (21+ 4- 21+: 0 0 -1) [1 1 2] 0 0 (10+ 2- 2-: 0 -1 1) (10+ 2- 10+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 1 0 0) (21+ 4- 4-: -2 0 0) [2 1 1] 0 0 (2- 2- 2-: 0 -1 0) (10+ 2- 2-: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 1) (4- 4- 21+: 0 0 -2) [1 1 2] 0 0 (2- 2- 2-: 0 -1 0) (2- 2- 10+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 21+: 1 0 0) (21+ 4- 21+: -2 0 0) [2 1 1] 0 0 (2- 2- 10+: 0 -1 0) (10+ 2- 10+: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (21+ 4- 4-: 0 0 1) (21+ 4- 21+: 0 0 -2) [1 1 2] 0 0 (10+ 2- 2-: 0 -1 0) (10+ 2- 10+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 21+ 4-: 2 0 0) (21+ 21+ 4-: -1 0 0) [2 1 1] 0 0 (2- 10+ 2-: 1 1 0) (10+ 10+ 2-: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 21+ 4-: 0 0 2) (4- 21+ 21+: 0 0 -1) [1 1 2] 0 0 (2- 10+ 2-: 0 1 1) (2- 10+ 10+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 21+ 21+: 2 0 0) (21+ 21+ 21+: -1 0 0) [2 1 1] 0 0 (2- 10+ 10+: 1 1 0) (10+ 10+ 10+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (21+ 21+ 4-: 0 0 2) (21+ 21+ 21+: 0 0 -1) [1 1 2] 0 0 (10+ 10+ 2-: 0 1 1) (10+ 10+ 10+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 21+ 4-: 1 0 0) (21+ 21+ 4-: -2 0 0) [2 1 1] 0 0 (2- 10+ 2-: 0 1 0) (10+ 10+ 2-: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 21+ 4-: 0 0 1) (4- 21+ 21+: 0 0 -2) [1 1 2] 0 0 (2- 10+ 2-: 0 1 0) (2- 10+ 10+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 21+ 21+: 1 0 0) (21+ 21+ 21+: -2 0 0) [2 1 1] 0 0 (2- 10+ 10+: 0 1 0) (10+ 10+ 10+: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (21+ 21+ 4-: 0 0 1) (21+ 21+ 21+: 0 0 -2) [1 1 2] 0 0 (10+ 10+ 2-: 0 1 0) (10+ 10+ 10+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 0) (4- 4- 4-: 0 0 0) [1 1 1] 0 0 (2- 2- 2-: 0 -1 0) (2- 2- 2-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (21+ 4- 4-: 0 0 0) (21+ 4- 4-: 0 0 0) [1 1 1] 0 0 (10+ 2- 2-: 0 -1 0) (10+ 2- 2-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (4- 4- 21+: 0 0 0) (4- 4- 21+: 0 0 0) [1 1 1] 0 0 (2- 2- 10+: 0 -1 0) (2- 2- 10+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (21+ 4- 21+: 0 0 0) (21+ 4- 21+: 0 0 0) [1 1 1] 0 0 (10+ 2- 10+: 0 -1 0) (10+ 2- 10+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (4- 21+ 4-: 0 0 0) (4- 21+ 4-: 0 0 0) [1 1 1] 0 0 (2- 10+ 2-: 0 1 0) (2- 10+ 2-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (21+ 21+ 4-: 0 0 0) (21+ 21+ 4-: 0 0 0) [1 1 1] 0 0 (10+ 10+ 2-: 0 1 0) (10+ 10+ 2-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (4- 21+ 21+: 0 0 0) (4- 21+ 21+: 0 0 0) [1 1 1] 0 0 (2- 10+ 10+: 0 1 0) (2- 10+ 10+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (21+ 21+ 21+: 0 0 0) (21+ 21+ 21+: 0 0 0) [1 1 1] 0 0 (10+ 10+ 10+: 0 1 0) (10+ 10+ 10+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 1) (10- 31+ 31+: 0 -1 -2) [1 2 2] 0 1 (5- 5- 5-: -1 0 0) (5- 15+ 15+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 1 1) (10- 31+ 31+: 0 0 -2) [1 2 2] 0 1 (5- 5- 5-: -1 0 0) (5- 15+ 15+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 2) (10- 31+ 31+: 0 -1 -1) [1 2 2] 0 1 (5- 5- 5-: -1 0 1) (5- 15+ 15+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 1 2) (10- 31+ 31+: 0 0 -1) [1 2 2] 0 1 (5- 5- 5-: -1 0 1) (5- 15+ 15+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (31+ 10- 10-: 0 0 2) (31+ 31+ 31+: 0 -1 -1) [1 2 2] 0 1 (15+ 5- 5-: 1 0 1) (15+ 15+ 15+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (31+ 10- 10-: 0 1 2) (31+ 31+ 31+: 0 0 -1) [1 2 2] 0 1 (15+ 5- 5-: 1 0 1) (15+ 15+ 15+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (31+ 10- 10-: 0 0 1) (31+ 31+ 31+: 0 -1 -2) [1 2 2] 0 1 (15+ 5- 5-: 1 0 0) (15+ 15+ 15+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (31+ 10- 10-: 0 1 1) (31+ 31+ 31+: 0 0 -2) [1 2 2] 0 1 (15+ 5- 5-: 1 0 0) (15+ 15+ 15+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 2 0 1) (31+ 10- 31+: -1 0 -2) [2 1 2] 0 1 (5- 5- 5-: 1 -1 0) (15+ 5- 15+: 0 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 2 0 2) (31+ 10- 31+: -1 0 -1) [2 1 2] 0 1 (5- 5- 5-: 1 -1 1) (15+ 5- 15+: 0 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 1 0 1) (31+ 10- 31+: -2 0 -2) [2 1 2] 0 1 (5- 5- 5-: 0 -1 0) (15+ 5- 15+: -1 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 1 0 2) (31+ 10- 31+: -2 0 -1) [2 1 2] 0 1 (5- 5- 5-: 0 -1 1) (15+ 5- 15+: -1 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 31+ 10-: 2 0 2) (31+ 31+ 31+: -1 0 -1) [2 1 2] 0 1 (5- 15+ 5-: 1 1 1) (15+ 15+ 15+: 0 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 31+ 10-: 2 0 1) (31+ 31+ 31+: -1 0 -2) [2 1 2] 0 1 (5- 15+ 5-: 1 1 0) (15+ 15+ 15+: 0 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 31+ 10-: 1 0 2) (31+ 31+ 31+: -2 0 -1) [2 1 2] 0 1 (5- 15+ 5-: 0 1 1) (15+ 15+ 15+: -1 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 31+ 10-: 1 0 1) (31+ 31+ 31+: -2 0 -2) [2 1 2] 0 1 (5- 15+ 5-: 0 1 0) (15+ 15+ 15+: -1 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 0) (31+ 31+ 10-: -1 -1 0) [2 2 1] 0 1 (5- 5- 5-: 0 0 -1) (15+ 15+ 5-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 1 0) (31+ 31+ 10-: -1 0 0) [2 2 1] 0 1 (5- 5- 5-: 0 0 -1) (15+ 15+ 5-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 1 0 0) (31+ 31+ 10-: 0 -1 0) [2 2 1] 0 1 (5- 5- 5-: 0 0 -1) (15+ 15+ 5-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 1 1 0) (31+ 31+ 10-: 0 0 0) [2 2 1] 0 1 (5- 5- 5-: 0 0 -1) (15+ 15+ 5-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 31+: 1 0 0) (31+ 31+ 31+: 0 -1 0) [2 2 1] 0 1 (5- 5- 15+: 0 0 1) (15+ 15+ 15+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 31+: 1 1 0) (31+ 31+ 31+: 0 0 0) [2 2 1] 0 1 (5- 5- 15+: 0 0 1) (15+ 15+ 15+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 31+: 0 0 0) (31+ 31+ 31+: -1 -1 0) [2 2 1] 0 1 (5- 5- 15+: 0 0 1) (15+ 15+ 15+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 31+: 0 1 0) (31+ 31+ 31+: -1 0 0) [2 2 1] 0 1 (5- 5- 15+: 0 0 1) (15+ 15+ 15+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (11- 11- 11-: -1 0 0) (11- 28+ 28+: -1 0 0) [1 1 1] 0 3 (22- 22- 22-: 0 0 1) (22- 57+ 57+: 0 -1 0) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: -1 0 0) (11- 28+ 28+: -1 0 0) [1 1 1] 0 3 (22- 22- 22-: 0 1 1) (22- 57+ 57+: 0 0 0) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: -1 0 0) (11- 28+ 28+: -1 0 0) [1 1 1] 0 3 (22- 22- 22-: 0 0 0) (22- 57+ 57+: 0 -1 -1) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: -1 0 0) (11- 28+ 28+: -1 0 0) [1 1 1] 0 3 (22- 22- 22-: 0 1 0) (22- 57+ 57+: 0 0 -1) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 2 (28+ 11- 11-: 1 0 0) (28+ 28+ 28+: 1 0 0) [1 1 1] 0 3 (57+ 22- 22-: 0 0 0) (57+ 57+ 57+: 0 -1 -1) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 2 (28+ 11- 11-: 1 0 0) (28+ 28+ 28+: 1 0 0) [1 1 1] 0 3 (57+ 22- 22-: 0 1 0) (57+ 57+ 57+: 0 0 -1) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 2 (28+ 11- 11-: 1 0 0) (28+ 28+ 28+: 1 0 0) [1 1 1] 0 3 (57+ 22- 22-: 0 0 1) (57+ 57+ 57+: 0 -1 0) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 2 (28+ 11- 11-: 1 0 0) (28+ 28+ 28+: 1 0 0) [1 1 1] 0 3 (57+ 22- 22-: 0 1 1) (57+ 57+ 57+: 0 0 0) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 -1 0) (28+ 11- 28+: 0 -1 0) [1 1 1] 0 3 (22- 22- 22-: 0 0 1) (57+ 22- 57+: -1 0 0) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 -1 0) (28+ 11- 28+: 0 -1 0) [1 1 1] 0 3 (22- 22- 22-: 0 0 0) (57+ 22- 57+: -1 0 -1) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 -1 0) (28+ 11- 28+: 0 -1 0) [1 1 1] 0 3 (22- 22- 22-: 1 0 1) (57+ 22- 57+: 0 0 0) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 -1 0) (28+ 11- 28+: 0 -1 0) [1 1 1] 0 3 (22- 22- 22-: 1 0 0) (57+ 22- 57+: 0 0 -1) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 2 (11- 28+ 11-: 0 1 0) (28+ 28+ 28+: 0 1 0) [1 1 1] 0 3 (22- 57+ 22-: 0 0 0) (57+ 57+ 57+: -1 0 -1) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 2 (11- 28+ 11-: 0 1 0) (28+ 28+ 28+: 0 1 0) [1 1 1] 0 3 (22- 57+ 22-: 0 0 1) (57+ 57+ 57+: -1 0 0) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 2 (11- 28+ 11-: 0 1 0) (28+ 28+ 28+: 0 1 0) [1 1 1] 0 3 (22- 57+ 22-: 1 0 0) (57+ 57+ 57+: 0 0 -1) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 2 (11- 28+ 11-: 0 1 0) (28+ 28+ 28+: 0 1 0) [1 1 1] 0 3 (22- 57+ 22-: 1 0 1) (57+ 57+ 57+: 0 0 0) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 0 -1) (28+ 28+ 11-: 0 0 -1) [1 1 1] 0 3 (22- 22- 22-: 0 0 0) (57+ 57+ 22-: -1 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 0 -1) (28+ 28+ 11-: 0 0 -1) [1 1 1] 0 3 (22- 22- 22-: 0 1 0) (57+ 57+ 22-: -1 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 0 -1) (28+ 28+ 11-: 0 0 -1) [1 1 1] 0 3 (22- 22- 22-: 1 0 0) (57+ 57+ 22-: 0 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 0 -1) (28+ 28+ 11-: 0 0 -1) [1 1 1] 0 3 (22- 22- 22-: 1 1 0) (57+ 57+ 22-: 0 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 2 (11- 11- 28+: 0 0 1) (28+ 28+ 28+: 0 0 1) [1 1 1] 0 3 (22- 22- 57+: 1 0 0) (57+ 57+ 57+: 0 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 2 (11- 11- 28+: 0 0 1) (28+ 28+ 28+: 0 0 1) [1 1 1] 0 3 (22- 22- 57+: 1 1 0) (57+ 57+ 57+: 0 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 2 (11- 11- 28+: 0 0 1) (28+ 28+ 28+: 0 0 1) [1 1 1] 0 3 (22- 22- 57+: 0 0 0) (57+ 57+ 57+: -1 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 2 (11- 11- 28+: 0 0 1) (28+ 28+ 28+: 0 0 1) [1 1 1] 0 3 (22- 22- 57+: 0 1 0) (57+ 57+ 57+: -1 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 0) (10- 31+ 10-: 0 -1 0) [1 2 1] 0 1 (5- 5- 5-: -1 0 0) (5- 15+ 5-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 1 0) (10- 31+ 10-: 0 0 0) [1 2 1] 0 1 (5- 5- 5-: -1 0 0) (5- 15+ 5-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (31+ 10- 31+: 0 0 0) (31+ 31+ 31+: 0 -1 0) [1 2 1] 0 1 (15+ 5- 15+: 1 0 0) (15+ 15+ 15+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (31+ 10- 31+: 0 1 0) (31+ 31+ 31+: 0 0 0) [1 2 1] 0 1 (15+ 5- 15+: 1 0 0) (15+ 15+ 15+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (31+ 10- 10-: 0 0 0) (31+ 31+ 10-: 0 -1 0) [1 2 1] 0 1 (15+ 5- 5-: 1 0 0) (15+ 15+ 5-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (31+ 10- 10-: 0 1 0) (31+ 31+ 10-: 0 0 0) [1 2 1] 0 1 (15+ 5- 5-: 1 0 0) (15+ 15+ 5-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 31+: 0 0 0) (10- 31+ 31+: 0 -1 0) [1 2 1] 0 1 (5- 5- 15+: -1 0 0) (5- 15+ 15+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 31+: 0 1 0) (10- 31+ 31+: 0 0 0) [1 2 1] 0 1 (5- 5- 15+: -1 0 0) (5- 15+ 15+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 2 0 0) (31+ 10- 10-: -1 0 0) [2 1 1] 0 1 (5- 5- 5-: 1 -1 0) (15+ 5- 5-: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 2) (10- 10- 31+: 0 0 -1) [1 1 2] 0 1 (5- 5- 5-: 0 -1 1) (5- 5- 15+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 31+: 2 0 0) (31+ 10- 31+: -1 0 0) [2 1 1] 0 1 (5- 5- 15+: 1 -1 0) (15+ 5- 15+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (31+ 10- 10-: 0 0 2) (31+ 10- 31+: 0 0 -1) [1 1 2] 0 1 (15+ 5- 5-: 0 -1 1) (15+ 5- 15+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 1 0 0) (31+ 10- 10-: -2 0 0) [2 1 1] 0 1 (5- 5- 5-: 0 -1 0) (15+ 5- 5-: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 1) (10- 10- 31+: 0 0 -2) [1 1 2] 0 1 (5- 5- 5-: 0 -1 0) (5- 5- 15+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 31+: 1 0 0) (31+ 10- 31+: -2 0 0) [2 1 1] 0 1 (5- 5- 15+: 0 -1 0) (15+ 5- 15+: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (31+ 10- 10-: 0 0 1) (31+ 10- 31+: 0 0 -2) [1 1 2] 0 1 (15+ 5- 5-: 0 -1 0) (15+ 5- 15+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 31+ 10-: 2 0 0) (31+ 31+ 10-: -1 0 0) [2 1 1] 0 1 (5- 15+ 5-: 1 1 0) (15+ 15+ 5-: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 31+ 10-: 0 0 2) (10- 31+ 31+: 0 0 -1) [1 1 2] 0 1 (5- 15+ 5-: 0 1 1) (5- 15+ 15+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 31+ 31+: 2 0 0) (31+ 31+ 31+: -1 0 0) [2 1 1] 0 1 (5- 15+ 15+: 1 1 0) (15+ 15+ 15+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (31+ 31+ 10-: 0 0 2) (31+ 31+ 31+: 0 0 -1) [1 1 2] 0 1 (15+ 15+ 5-: 0 1 1) (15+ 15+ 15+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 31+ 10-: 1 0 0) (31+ 31+ 10-: -2 0 0) [2 1 1] 0 1 (5- 15+ 5-: 0 1 0) (15+ 15+ 5-: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 31+ 10-: 0 0 1) (10- 31+ 31+: 0 0 -2) [1 1 2] 0 1 (5- 15+ 5-: 0 1 0) (5- 15+ 15+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 31+ 31+: 1 0 0) (31+ 31+ 31+: -2 0 0) [2 1 1] 0 1 (5- 15+ 15+: 0 1 0) (15+ 15+ 15+: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (31+ 31+ 10-: 0 0 1) (31+ 31+ 31+: 0 0 -2) [1 1 2] 0 1 (15+ 15+ 5-: 0 1 0) (15+ 15+ 15+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 0) (10- 10- 10-: 0 0 0) [1 1 1] 0 1 (5- 5- 5-: 0 -1 0) (5- 5- 5-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (31+ 10- 10-: 0 0 0) (31+ 10- 10-: 0 0 0) [1 1 1] 0 1 (15+ 5- 5-: 0 -1 0) (15+ 5- 5-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (10- 10- 31+: 0 0 0) (10- 10- 31+: 0 0 0) [1 1 1] 0 1 (5- 5- 15+: 0 -1 0) (5- 5- 15+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (31+ 10- 31+: 0 0 0) (31+ 10- 31+: 0 0 0) [1 1 1] 0 1 (15+ 5- 15+: 0 -1 0) (15+ 5- 15+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (10- 31+ 10-: 0 0 0) (10- 31+ 10-: 0 0 0) [1 1 1] 0 1 (5- 15+ 5-: 0 1 0) (5- 15+ 5-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (31+ 31+ 10-: 0 0 0) (31+ 31+ 10-: 0 0 0) [1 1 1] 0 1 (15+ 15+ 5-: 0 1 0) (15+ 15+ 5-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (10- 31+ 31+: 0 0 0) (10- 31+ 31+: 0 0 0) [1 1 1] 0 1 (5- 15+ 15+: 0 1 0) (5- 15+ 15+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (31+ 31+ 31+: 0 0 0) (31+ 31+ 31+: 0 0 0) [1 1 1] 0 1 (15+ 15+ 15+: 0 1 0) (15+ 15+ 15+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 0 1) (22- 57+ 57+: 0 -1 -2) [1 2 2] 0 2 (11- 11- 11-: -1 0 0) (11- 28+ 28+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 1 1) (22- 57+ 57+: 0 0 -2) [1 2 2] 0 2 (11- 11- 11-: -1 0 0) (11- 28+ 28+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 0 2) (22- 57+ 57+: 0 -1 -1) [1 2 2] 0 2 (11- 11- 11-: -1 0 1) (11- 28+ 28+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 1 2) (22- 57+ 57+: 0 0 -1) [1 2 2] 0 2 (11- 11- 11-: -1 0 1) (11- 28+ 28+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (57+ 22- 22-: 0 0 2) (57+ 57+ 57+: 0 -1 -1) [1 2 2] 0 2 (28+ 11- 11-: 1 0 1) (28+ 28+ 28+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (57+ 22- 22-: 0 1 2) (57+ 57+ 57+: 0 0 -1) [1 2 2] 0 2 (28+ 11- 11-: 1 0 1) (28+ 28+ 28+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (57+ 22- 22-: 0 0 1) (57+ 57+ 57+: 0 -1 -2) [1 2 2] 0 2 (28+ 11- 11-: 1 0 0) (28+ 28+ 28+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (57+ 22- 22-: 0 1 1) (57+ 57+ 57+: 0 0 -2) [1 2 2] 0 2 (28+ 11- 11-: 1 0 0) (28+ 28+ 28+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 2 0 1) (57+ 22- 57+: -1 0 -2) [2 1 2] 0 2 (11- 11- 11-: 1 -1 0) (28+ 11- 28+: 0 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 2 0 2) (57+ 22- 57+: -1 0 -1) [2 1 2] 0 2 (11- 11- 11-: 1 -1 1) (28+ 11- 28+: 0 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 1 0 1) (57+ 22- 57+: -2 0 -2) [2 1 2] 0 2 (11- 11- 11-: 0 -1 0) (28+ 11- 28+: -1 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 1 0 2) (57+ 22- 57+: -2 0 -1) [2 1 2] 0 2 (11- 11- 11-: 0 -1 1) (28+ 11- 28+: -1 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 57+ 22-: 2 0 2) (57+ 57+ 57+: -1 0 -1) [2 1 2] 0 2 (11- 28+ 11-: 1 1 1) (28+ 28+ 28+: 0 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 57+ 22-: 2 0 1) (57+ 57+ 57+: -1 0 -2) [2 1 2] 0 2 (11- 28+ 11-: 1 1 0) (28+ 28+ 28+: 0 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 57+ 22-: 1 0 2) (57+ 57+ 57+: -2 0 -1) [2 1 2] 0 2 (11- 28+ 11-: 0 1 1) (28+ 28+ 28+: -1 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 57+ 22-: 1 0 1) (57+ 57+ 57+: -2 0 -2) [2 1 2] 0 2 (11- 28+ 11-: 0 1 0) (28+ 28+ 28+: -1 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 0 0) (57+ 57+ 22-: -1 -1 0) [2 2 1] 0 2 (11- 11- 11-: 0 0 -1) (28+ 28+ 11-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 1 0) (57+ 57+ 22-: -1 0 0) [2 2 1] 0 2 (11- 11- 11-: 0 0 -1) (28+ 28+ 11-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 1 0 0) (57+ 57+ 22-: 0 -1 0) [2 2 1] 0 2 (11- 11- 11-: 0 0 -1) (28+ 28+ 11-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 1 1 0) (57+ 57+ 22-: 0 0 0) [2 2 1] 0 2 (11- 11- 11-: 0 0 -1) (28+ 28+ 11-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 57+: 1 0 0) (57+ 57+ 57+: 0 -1 0) [2 2 1] 0 2 (11- 11- 28+: 0 0 1) (28+ 28+ 28+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 57+: 1 1 0) (57+ 57+ 57+: 0 0 0) [2 2 1] 0 2 (11- 11- 28+: 0 0 1) (28+ 28+ 28+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 57+: 0 0 0) (57+ 57+ 57+: -1 -1 0) [2 2 1] 0 2 (11- 11- 28+: 0 0 1) (28+ 28+ 28+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 57+: 0 1 0) (57+ 57+ 57+: -1 0 0) [2 2 1] 0 2 (11- 11- 28+: 0 0 1) (28+ 28+ 28+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (23- 23- 23-: -1 0 0) (23- 51+ 51+: -1 0 0) [1 1 1] 0 4 (46- 46- 46-: 0 0 1) (46- 103+ 103+: 0 -1 0) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: -1 0 0) (23- 51+ 51+: -1 0 0) [1 1 1] 0 4 (46- 46- 46-: 0 1 1) (46- 103+ 103+: 0 0 0) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: -1 0 0) (23- 51+ 51+: -1 0 0) [1 1 1] 0 4 (46- 46- 46-: 0 0 0) (46- 103+ 103+: 0 -1 -1) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: -1 0 0) (23- 51+ 51+: -1 0 0) [1 1 1] 0 4 (46- 46- 46-: 0 1 0) (46- 103+ 103+: 0 0 -1) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 3 (51+ 23- 23-: 1 0 0) (51+ 51+ 51+: 1 0 0) [1 1 1] 0 4 (103+ 46- 46-: 0 0 0) (103+ 103+ 103+: 0 -1 -1) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 3 (51+ 23- 23-: 1 0 0) (51+ 51+ 51+: 1 0 0) [1 1 1] 0 4 (103+ 46- 46-: 0 1 0) (103+ 103+ 103+: 0 0 -1) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 3 (51+ 23- 23-: 1 0 0) (51+ 51+ 51+: 1 0 0) [1 1 1] 0 4 (103+ 46- 46-: 0 0 1) (103+ 103+ 103+: 0 -1 0) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 3 (51+ 23- 23-: 1 0 0) (51+ 51+ 51+: 1 0 0) [1 1 1] 0 4 (103+ 46- 46-: 0 1 1) (103+ 103+ 103+: 0 0 0) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: 0 -1 0) (51+ 23- 51+: 0 -1 0) [1 1 1] 0 4 (46- 46- 46-: 0 0 1) (103+ 46- 103+: -1 0 0) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: 0 -1 0) (51+ 23- 51+: 0 -1 0) [1 1 1] 0 4 (46- 46- 46-: 0 0 0) (103+ 46- 103+: -1 0 -1) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: 0 -1 0) (51+ 23- 51+: 0 -1 0) [1 1 1] 0 4 (46- 46- 46-: 1 0 1) (103+ 46- 103+: 0 0 0) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: 0 -1 0) (51+ 23- 51+: 0 -1 0) [1 1 1] 0 4 (46- 46- 46-: 1 0 0) (103+ 46- 103+: 0 0 -1) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 3 (23- 51+ 23-: 0 1 0) (51+ 51+ 51+: 0 1 0) [1 1 1] 0 4 (46- 103+ 46-: 0 0 0) (103+ 103+ 103+: -1 0 -1) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 3 (23- 51+ 23-: 0 1 0) (51+ 51+ 51+: 0 1 0) [1 1 1] 0 4 (46- 103+ 46-: 0 0 1) (103+ 103+ 103+: -1 0 0) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 3 (23- 51+ 23-: 0 1 0) (51+ 51+ 51+: 0 1 0) [1 1 1] 0 4 (46- 103+ 46-: 1 0 0) (103+ 103+ 103+: 0 0 -1) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 3 (23- 51+ 23-: 0 1 0) (51+ 51+ 51+: 0 1 0) [1 1 1] 0 4 (46- 103+ 46-: 1 0 1) (103+ 103+ 103+: 0 0 0) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: 0 0 -1) (51+ 51+ 23-: 0 0 -1) [1 1 1] 0 4 (46- 46- 46-: 0 0 0) (103+ 103+ 46-: -1 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: 0 0 -1) (51+ 51+ 23-: 0 0 -1) [1 1 1] 0 4 (46- 46- 46-: 0 1 0) (103+ 103+ 46-: -1 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: 0 0 -1) (51+ 51+ 23-: 0 0 -1) [1 1 1] 0 4 (46- 46- 46-: 1 0 0) (103+ 103+ 46-: 0 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: 0 0 -1) (51+ 51+ 23-: 0 0 -1) [1 1 1] 0 4 (46- 46- 46-: 1 1 0) (103+ 103+ 46-: 0 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 3 (23- 23- 51+: 0 0 1) (51+ 51+ 51+: 0 0 1) [1 1 1] 0 4 (46- 46- 103+: 1 0 0) (103+ 103+ 103+: 0 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 3 (23- 23- 51+: 0 0 1) (51+ 51+ 51+: 0 0 1) [1 1 1] 0 4 (46- 46- 103+: 1 1 0) (103+ 103+ 103+: 0 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 3 (23- 23- 51+: 0 0 1) (51+ 51+ 51+: 0 0 1) [1 1 1] 0 4 (46- 46- 103+: 0 0 0) (103+ 103+ 103+: -1 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 3 (23- 23- 51+: 0 0 1) (51+ 51+ 51+: 0 0 1) [1 1 1] 0 4 (46- 46- 103+: 0 1 0) (103+ 103+ 103+: -1 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 3 (22- 22- 22-: 0 0 0) (22- 57+ 22-: 0 -1 0) [1 2 1] 0 2 (11- 11- 11-: -1 0 0) (11- 28+ 11-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 1 0) (22- 57+ 22-: 0 0 0) [1 2 1] 0 2 (11- 11- 11-: -1 0 0) (11- 28+ 11-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (57+ 22- 57+: 0 0 0) (57+ 57+ 57+: 0 -1 0) [1 2 1] 0 2 (28+ 11- 28+: 1 0 0) (28+ 28+ 28+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (57+ 22- 57+: 0 1 0) (57+ 57+ 57+: 0 0 0) [1 2 1] 0 2 (28+ 11- 28+: 1 0 0) (28+ 28+ 28+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (57+ 22- 22-: 0 0 0) (57+ 57+ 22-: 0 -1 0) [1 2 1] 0 2 (28+ 11- 11-: 1 0 0) (28+ 28+ 11-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (57+ 22- 22-: 0 1 0) (57+ 57+ 22-: 0 0 0) [1 2 1] 0 2 (28+ 11- 11-: 1 0 0) (28+ 28+ 11-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 57+: 0 0 0) (22- 57+ 57+: 0 -1 0) [1 2 1] 0 2 (11- 11- 28+: -1 0 0) (11- 28+ 28+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 57+: 0 1 0) (22- 57+ 57+: 0 0 0) [1 2 1] 0 2 (11- 11- 28+: -1 0 0) (11- 28+ 28+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 2 0 0) (57+ 22- 22-: -1 0 0) [2 1 1] 0 2 (11- 11- 11-: 1 -1 0) (28+ 11- 11-: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 0 2) (22- 22- 57+: 0 0 -1) [1 1 2] 0 2 (11- 11- 11-: 0 -1 1) (11- 11- 28+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 57+: 2 0 0) (57+ 22- 57+: -1 0 0) [2 1 1] 0 2 (11- 11- 28+: 1 -1 0) (28+ 11- 28+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (57+ 22- 22-: 0 0 2) (57+ 22- 57+: 0 0 -1) [1 1 2] 0 2 (28+ 11- 11-: 0 -1 1) (28+ 11- 28+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 1 0 0) (57+ 22- 22-: -2 0 0) [2 1 1] 0 2 (11- 11- 11-: 0 -1 0) (28+ 11- 11-: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 0 1) (22- 22- 57+: 0 0 -2) [1 1 2] 0 2 (11- 11- 11-: 0 -1 0) (11- 11- 28+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 57+: 1 0 0) (57+ 22- 57+: -2 0 0) [2 1 1] 0 2 (11- 11- 28+: 0 -1 0) (28+ 11- 28+: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (57+ 22- 22-: 0 0 1) (57+ 22- 57+: 0 0 -2) [1 1 2] 0 2 (28+ 11- 11-: 0 -1 0) (28+ 11- 28+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 57+ 22-: 2 0 0) (57+ 57+ 22-: -1 0 0) [2 1 1] 0 2 (11- 28+ 11-: 1 1 0) (28+ 28+ 11-: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 57+ 22-: 0 0 2) (22- 57+ 57+: 0 0 -1) [1 1 2] 0 2 (11- 28+ 11-: 0 1 1) (11- 28+ 28+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 57+ 57+: 2 0 0) (57+ 57+ 57+: -1 0 0) [2 1 1] 0 2 (11- 28+ 28+: 1 1 0) (28+ 28+ 28+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (57+ 57+ 22-: 0 0 2) (57+ 57+ 57+: 0 0 -1) [1 1 2] 0 2 (28+ 28+ 11-: 0 1 1) (28+ 28+ 28+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 57+ 22-: 1 0 0) (57+ 57+ 22-: -2 0 0) [2 1 1] 0 2 (11- 28+ 11-: 0 1 0) (28+ 28+ 11-: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 57+ 22-: 0 0 1) (22- 57+ 57+: 0 0 -2) [1 1 2] 0 2 (11- 28+ 11-: 0 1 0) (11- 28+ 28+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 57+ 57+: 1 0 0) (57+ 57+ 57+: -2 0 0) [2 1 1] 0 2 (11- 28+ 28+: 0 1 0) (28+ 28+ 28+: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (57+ 57+ 22-: 0 0 1) (57+ 57+ 57+: 0 0 -2) [1 1 2] 0 2 (28+ 28+ 11-: 0 1 0) (28+ 28+ 28+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 0 0) (22- 22- 22-: 0 0 0) [1 1 1] 0 2 (11- 11- 11-: 0 -1 0) (11- 11- 11-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (57+ 22- 22-: 0 0 0) (57+ 22- 22-: 0 0 0) [1 1 1] 0 2 (28+ 11- 11-: 0 -1 0) (28+ 11- 11-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (22- 22- 57+: 0 0 0) (22- 22- 57+: 0 0 0) [1 1 1] 0 2 (11- 11- 28+: 0 -1 0) (11- 11- 28+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (57+ 22- 57+: 0 0 0) (57+ 22- 57+: 0 0 0) [1 1 1] 0 2 (28+ 11- 28+: 0 -1 0) (28+ 11- 28+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (22- 57+ 22-: 0 0 0) (22- 57+ 22-: 0 0 0) [1 1 1] 0 2 (11- 28+ 11-: 0 1 0) (11- 28+ 11-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (57+ 57+ 22-: 0 0 0) (57+ 57+ 22-: 0 0 0) [1 1 1] 0 2 (28+ 28+ 11-: 0 1 0) (28+ 28+ 11-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (22- 57+ 57+: 0 0 0) (22- 57+ 57+: 0 0 0) [1 1 1] 0 2 (11- 28+ 28+: 0 1 0) (11- 28+ 28+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (57+ 57+ 57+: 0 0 0) (57+ 57+ 57+: 0 0 0) [1 1 1] 0 2 (28+ 28+ 28+: 0 1 0) (28+ 28+ 28+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 0 0 1) (46- 103+ 103+: 0 -1 -2) [1 2 2] 0 3 (23- 23- 23-: -1 0 0) (23- 51+ 51+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 0 1 1) (46- 103+ 103+: 0 0 -2) [1 2 2] 0 3 (23- 23- 23-: -1 0 0) (23- 51+ 51+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 0 0 2) (46- 103+ 103+: 0 -1 -1) [1 2 2] 0 3 (23- 23- 23-: -1 0 1) (23- 51+ 51+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 0 1 2) (46- 103+ 103+: 0 0 -1) [1 2 2] 0 3 (23- 23- 23-: -1 0 1) (23- 51+ 51+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (103+ 46- 46-: 0 0 2) (103+ 103+ 103+: 0 -1 -1) [1 2 2] 0 3 (51+ 23- 23-: 1 0 1) (51+ 51+ 51+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (103+ 46- 46-: 0 1 2) (103+ 103+ 103+: 0 0 -1) [1 2 2] 0 3 (51+ 23- 23-: 1 0 1) (51+ 51+ 51+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (103+ 46- 46-: 0 0 1) (103+ 103+ 103+: 0 -1 -2) [1 2 2] 0 3 (51+ 23- 23-: 1 0 0) (51+ 51+ 51+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (103+ 46- 46-: 0 1 1) (103+ 103+ 103+: 0 0 -2) [1 2 2] 0 3 (51+ 23- 23-: 1 0 0) (51+ 51+ 51+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 2 0 1) (103+ 46- 103+: -1 0 -2) [2 1 2] 0 3 (23- 23- 23-: 1 -1 0) (51+ 23- 51+: 0 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 2 0 2) (103+ 46- 103+: -1 0 -1) [2 1 2] 0 3 (23- 23- 23-: 1 -1 1) (51+ 23- 51+: 0 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 1 0 1) (103+ 46- 103+: -2 0 -2) [2 1 2] 0 3 (23- 23- 23-: 0 -1 0) (51+ 23- 51+: -1 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 1 0 2) (103+ 46- 103+: -2 0 -1) [2 1 2] 0 3 (23- 23- 23-: 0 -1 1) (51+ 23- 51+: -1 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 103+ 46-: 2 0 2) (103+ 103+ 103+: -1 0 -1) [2 1 2] 0 3 (23- 51+ 23-: 1 1 1) (51+ 51+ 51+: 0 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 103+ 46-: 2 0 1) (103+ 103+ 103+: -1 0 -2) [2 1 2] 0 3 (23- 51+ 23-: 1 1 0) (51+ 51+ 51+: 0 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 103+ 46-: 1 0 2) (103+ 103+ 103+: -2 0 -1) [2 1 2] 0 3 (23- 51+ 23-: 0 1 1) (51+ 51+ 51+: -1 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 103+ 46-: 1 0 1) (103+ 103+ 103+: -2 0 -2) [2 1 2] 0 3 (23- 51+ 23-: 0 1 0) (51+ 51+ 51+: -1 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 0 0 0) (103+ 103+ 46-: -1 -1 0) [2 2 1] 0 3 (23- 23- 23-: 0 0 -1) (51+ 51+ 23-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 0 1 0) (103+ 103+ 46-: -1 0 0) [2 2 1] 0 3 (23- 23- 23-: 0 0 -1) (51+ 51+ 23-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 1 0 0) (103+ 103+ 46-: 0 -1 0) [2 2 1] 0 3 (23- 23- 23-: 0 0 -1) (51+ 51+ 23-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 1 1 0) (103+ 103+ 46-: 0 0 0) [2 2 1] 0 3 (23- 23- 23-: 0 0 -1) (51+ 51+ 23-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 103+: 1 0 0) (103+ 103+ 103+: 0 -1 0) [2 2 1] 0 3 (23- 23- 51+: 0 0 1) (51+ 51+ 51+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 103+: 1 1 0) (103+ 103+ 103+: 0 0 0) [2 2 1] 0 3 (23- 23- 51+: 0 0 1) (51+ 51+ 51+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 103+: 0 0 0) (103+ 103+ 103+: -1 -1 0) [2 2 1] 0 3 (23- 23- 51+: 0 0 1) (51+ 51+ 51+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 103+: 0 1 0) (103+ 103+ 103+: -1 0 0) [2 2 1] 0 3 (23- 23- 51+: 0 0 1) (51+ 51+ 51+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 0 0 0) (46- 103+ 46-: 0 -1 0) [1 2 1] 0 3 (23- 23- 23-: -1 0 0) (23- 51+ 23-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 0 1 0) (46- 103+ 46-: 0 0 0) [1 2 1] 0 3 (23- 23- 23-: -1 0 0) (23- 51+ 23-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (103+ 46- 103+: 0 0 0) (103+ 103+ 103+: 0 -1 0) [1 2 1] 0 3 (51+ 23- 51+: 1 0 0) (51+ 51+ 51+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (103+ 46- 103+: 0 1 0) (103+ 103+ 103+: 0 0 0) [1 2 1] 0 3 (51+ 23- 51+: 1 0 0) (51+ 51+ 51+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (103+ 46- 46-: 0 0 0) (103+ 103+ 46-: 0 -1 0) [1 2 1] 0 3 (51+ 23- 23-: 1 0 0) (51+ 51+ 23-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (103+ 46- 46-: 0 1 0) (103+ 103+ 46-: 0 0 0) [1 2 1] 0 3 (51+ 23- 23-: 1 0 0) (51+ 51+ 23-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 46- 103+: 0 0 0) (46- 103+ 103+: 0 -1 0) [1 2 1] 0 3 (23- 23- 51+: -1 0 0) (23- 51+ 51+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 46- 103+: 0 1 0) (46- 103+ 103+: 0 0 0) [1 2 1] 0 3 (23- 23- 51+: -1 0 0) (23- 51+ 51+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 2 0 0) (103+ 46- 46-: -1 0 0) [2 1 1] 0 3 (23- 23- 23-: 1 -1 0) (51+ 23- 23-: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 0 0 2) (46- 46- 103+: 0 0 -1) [1 1 2] 0 3 (23- 23- 23-: 0 -1 1) (23- 23- 51+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 46- 103+: 2 0 0) (103+ 46- 103+: -1 0 0) [2 1 1] 0 3 (23- 23- 51+: 1 -1 0) (51+ 23- 51+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (103+ 46- 46-: 0 0 2) (103+ 46- 103+: 0 0 -1) [1 1 2] 0 3 (51+ 23- 23-: 0 -1 1) (51+ 23- 51+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 1 0 0) (103+ 46- 46-: -2 0 0) [2 1 1] 0 3 (23- 23- 23-: 0 -1 0) (51+ 23- 23-: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 0 0 1) (46- 46- 103+: 0 0 -2) [1 1 2] 0 3 (23- 23- 23-: 0 -1 0) (23- 23- 51+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 46- 103+: 1 0 0) (103+ 46- 103+: -2 0 0) [2 1 1] 0 3 (23- 23- 51+: 0 -1 0) (51+ 23- 51+: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (103+ 46- 46-: 0 0 1) (103+ 46- 103+: 0 0 -2) [1 1 2] 0 3 (51+ 23- 23-: 0 -1 0) (51+ 23- 51+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 103+ 46-: 2 0 0) (103+ 103+ 46-: -1 0 0) [2 1 1] 0 3 (23- 51+ 23-: 1 1 0) (51+ 51+ 23-: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 103+ 46-: 0 0 2) (46- 103+ 103+: 0 0 -1) [1 1 2] 0 3 (23- 51+ 23-: 0 1 1) (23- 51+ 51+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 103+ 103+: 2 0 0) (103+ 103+ 103+: -1 0 0) [2 1 1] 0 3 (23- 51+ 51+: 1 1 0) (51+ 51+ 51+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (103+ 103+ 46-: 0 0 2) (103+ 103+ 103+: 0 0 -1) [1 1 2] 0 3 (51+ 51+ 23-: 0 1 1) (51+ 51+ 51+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 103+ 46-: 1 0 0) (103+ 103+ 46-: -2 0 0) [2 1 1] 0 3 (23- 51+ 23-: 0 1 0) (51+ 51+ 23-: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 103+ 46-: 0 0 1) (46- 103+ 103+: 0 0 -2) [1 1 2] 0 3 (23- 51+ 23-: 0 1 0) (23- 51+ 51+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 103+ 103+: 1 0 0) (103+ 103+ 103+: -2 0 0) [2 1 1] 0 3 (23- 51+ 51+: 0 1 0) (51+ 51+ 51+: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (103+ 103+ 46-: 0 0 1) (103+ 103+ 103+: 0 0 -2) [1 1 2] 0 3 (51+ 51+ 23-: 0 1 0) (51+ 51+ 51+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 0 0 0) (46- 46- 46-: 0 0 0) [1 1 1] 0 3 (23- 23- 23-: 0 -1 0) (23- 23- 23-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 4 (103+ 46- 46-: 0 0 0) (103+ 46- 46-: 0 0 0) [1 1 1] 0 3 (51+ 23- 23-: 0 -1 0) (51+ 23- 23-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 4 (46- 46- 103+: 0 0 0) (46- 46- 103+: 0 0 0) [1 1 1] 0 3 (23- 23- 51+: 0 -1 0) (23- 23- 51+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 4 (103+ 46- 103+: 0 0 0) (103+ 46- 103+: 0 0 0) [1 1 1] 0 3 (51+ 23- 51+: 0 -1 0) (51+ 23- 51+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 4 (46- 103+ 46-: 0 0 0) (46- 103+ 46-: 0 0 0) [1 1 1] 0 3 (23- 51+ 23-: 0 1 0) (23- 51+ 23-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 4 (103+ 103+ 46-: 0 0 0) (103+ 103+ 46-: 0 0 0) [1 1 1] 0 3 (51+ 51+ 23-: 0 1 0) (51+ 51+ 23-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 4 (46- 103+ 103+: 0 0 0) (46- 103+ 103+: 0 0 0) [1 1 1] 0 3 (23- 51+ 51+: 0 1 0) (23- 51+ 51+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 4 (103+ 103+ 103+: 0 0 0) (103+ 103+ 103+: 0 0 0) [1 1 1] 0 3 (51+ 51+ 51+: 0 1 0) (51+ 51+ 51+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -############################################################# -FacParts: 0 0 [1 1 1] -FacParts: 1 1 [2 2 2] -FacParts: 2 2 [2 2 2] -FacParts: 3 3 [2 2 2] -FacParts: 4 4 [2 2 2] - -ProcessPoolCreate: 1 - -# ProcessPoolSetPart: pool part -ProcessPoolSetPart: 0 0 -ProcessPoolSetPart: 0 1 -ProcessPoolSetPart: 0 2 -ProcessPoolSetPart: 0 3 -ProcessPoolSetPart: 0 4 - diff --git a/src/test/TEST_fac/6lev.in b/src/test/TEST_fac/6lev.in deleted file mode 100644 index 4a553f0c02..0000000000 --- a/src/test/TEST_fac/6lev.in +++ /dev/null @@ -1,486 +0,0 @@ -# Copyright (c) 1998 Lawrence Livermore 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 6 -############################################################# -# GridSetExtents: part ilower(ndim) iupper(ndim) -GridSetExtents: 0 (1- 1- 1-) (8+ 8+ 8+) -GridSetExtents: 1 (4- 4- 4-) (13+ 13+ 13+) -GridSetExtents: 2 (10- 10- 10-) (23+ 23+ 23+) -GridSetExtents: 3 (22- 22- 22-) (43+ 43+ 43+) -GridSetExtents: 4 (46- 46- 46-) (81+ 81+ 81+) -GridSetExtents: 5 (98- 98- 98-) (121+ 121+ 121+) -############################################################# - -# GridSetVariables: part nvars vartypes[nvars] -# CELL = 0 -# NODE = 1 -# XFACE = 2 -# YFACE = 3 -# ZFACE = 4 -# XEDGE = 5 -# YEDGE = 6 -# ZEDGE = 7 - -GridSetVariables: 0 1 [0] -GridSetVariables: 1 1 [0] -GridSetVariables: 2 1 [0] -GridSetVariables: 3 1 [0] -GridSetVariables: 4 1 [0] -GridSetVariables: 5 1 [0] -############################################################# - -# StencilCreate: nstencils sizes[nstencils] -StencilCreate: 1 [7] -############################################################# - -# StencilSetEntry: stencil_num entry offset[ndim] var value -StencilSetEntry: 0 0 [ 0 0 0] 0 6.000000 -StencilSetEntry: 0 1 [-1 0 0] 0 -1.000000 -StencilSetEntry: 0 2 [ 1 0 0] 0 -1.000000 -StencilSetEntry: 0 3 [ 0 -1 0] 0 -1.000000 -StencilSetEntry: 0 4 [ 0 0 1] 0 -1.000000 -StencilSetEntry: 0 5 [ 0 0 -1] 0 -1.000000 -StencilSetEntry: 0 6 [ 0 1 0] 0 -1.000000 -############################################################# - -# GraphSetStencil: part var stencil_num -GraphSetStencil: 0 0 0 -GraphSetStencil: 1 0 0 -GraphSetStencil: 2 0 0 -GraphSetStencil: 3 0 0 -GraphSetStencil: 4 0 0 -GraphSetStencil: 5 0 0 -############################################################# - -# GraphAddEntries: \ - -# part ilower(ndim) iupper(ndim) stride[ndim] var \ - -# to_part to_ilower(ndim) to_iupper(ndim) to_stride[ndim] to_var \ - -# index_map[ndim] entry value -GraphAddEntries: 0 (2- 2- 2-: -1 0 0) (2- 6+ 6+: -1 0 0) [1 1 1] 0 1 (4- 4- 4-: 0 0 1) (4- 13+ 13+: 0 -1 0) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: -1 0 0) (2- 6+ 6+: -1 0 0) [1 1 1] 0 1 (4- 4- 4-: 0 1 1) (4- 13+ 13+: 0 0 0) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: -1 0 0) (2- 6+ 6+: -1 0 0) [1 1 1] 0 1 (4- 4- 4-: 0 0 0) (4- 13+ 13+: 0 -1 -1) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: -1 0 0) (2- 6+ 6+: -1 0 0) [1 1 1] 0 1 (4- 4- 4-: 0 1 0) (4- 13+ 13+: 0 0 -1) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (6+ 2- 2-: 1 0 0) (6+ 6+ 6+: 1 0 0) [1 1 1] 0 1 (13+ 4- 4-: 0 0 0) (13+ 13+ 13+: 0 -1 -1) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (6+ 2- 2-: 1 0 0) (6+ 6+ 6+: 1 0 0) [1 1 1] 0 1 (13+ 4- 4-: 0 1 0) (13+ 13+ 13+: 0 0 -1) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (6+ 2- 2-: 1 0 0) (6+ 6+ 6+: 1 0 0) [1 1 1] 0 1 (13+ 4- 4-: 0 0 1) (13+ 13+ 13+: 0 -1 0) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (6+ 2- 2-: 1 0 0) (6+ 6+ 6+: 1 0 0) [1 1 1] 0 1 (13+ 4- 4-: 0 1 1) (13+ 13+ 13+: 0 0 0) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 -1 0) (6+ 2- 6+: 0 -1 0) [1 1 1] 0 1 (4- 4- 4-: 0 0 1) (13+ 4- 13+: -1 0 0) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 -1 0) (6+ 2- 6+: 0 -1 0) [1 1 1] 0 1 (4- 4- 4-: 0 0 0) (13+ 4- 13+: -1 0 -1) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 -1 0) (6+ 2- 6+: 0 -1 0) [1 1 1] 0 1 (4- 4- 4-: 1 0 1) (13+ 4- 13+: 0 0 0) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 -1 0) (6+ 2- 6+: 0 -1 0) [1 1 1] 0 1 (4- 4- 4-: 1 0 0) (13+ 4- 13+: 0 0 -1) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (2- 6+ 2-: 0 1 0) (6+ 6+ 6+: 0 1 0) [1 1 1] 0 1 (4- 13+ 4-: 0 0 0) (13+ 13+ 13+: -1 0 -1) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (2- 6+ 2-: 0 1 0) (6+ 6+ 6+: 0 1 0) [1 1 1] 0 1 (4- 13+ 4-: 0 0 1) (13+ 13+ 13+: -1 0 0) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (2- 6+ 2-: 0 1 0) (6+ 6+ 6+: 0 1 0) [1 1 1] 0 1 (4- 13+ 4-: 1 0 0) (13+ 13+ 13+: 0 0 -1) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (2- 6+ 2-: 0 1 0) (6+ 6+ 6+: 0 1 0) [1 1 1] 0 1 (4- 13+ 4-: 1 0 1) (13+ 13+ 13+: 0 0 0) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 0 -1) (6+ 6+ 2-: 0 0 -1) [1 1 1] 0 1 (4- 4- 4-: 0 0 0) (13+ 13+ 4-: -1 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 0 -1) (6+ 6+ 2-: 0 0 -1) [1 1 1] 0 1 (4- 4- 4-: 0 1 0) (13+ 13+ 4-: -1 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 0 -1) (6+ 6+ 2-: 0 0 -1) [1 1 1] 0 1 (4- 4- 4-: 1 0 0) (13+ 13+ 4-: 0 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 0 -1) (6+ 6+ 2-: 0 0 -1) [1 1 1] 0 1 (4- 4- 4-: 1 1 0) (13+ 13+ 4-: 0 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (2- 2- 6+: 0 0 1) (6+ 6+ 6+: 0 0 1) [1 1 1] 0 1 (4- 4- 13+: 1 0 0) (13+ 13+ 13+: 0 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (2- 2- 6+: 0 0 1) (6+ 6+ 6+: 0 0 1) [1 1 1] 0 1 (4- 4- 13+: 1 1 0) (13+ 13+ 13+: 0 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (2- 2- 6+: 0 0 1) (6+ 6+ 6+: 0 0 1) [1 1 1] 0 1 (4- 4- 13+: 0 0 0) (13+ 13+ 13+: -1 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (2- 2- 6+: 0 0 1) (6+ 6+ 6+: 0 0 1) [1 1 1] 0 1 (4- 4- 13+: 0 1 0) (13+ 13+ 13+: -1 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 1) (4- 13+ 13+: 0 -1 -2) [1 2 2] 0 0 (2- 2- 2-: -1 0 0) (2- 6+ 6+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 1 1) (4- 13+ 13+: 0 0 -2) [1 2 2] 0 0 (2- 2- 2-: -1 0 0) (2- 6+ 6+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 2) (4- 13+ 13+: 0 -1 -1) [1 2 2] 0 0 (2- 2- 2-: -1 0 1) (2- 6+ 6+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 1 2) (4- 13+ 13+: 0 0 -1) [1 2 2] 0 0 (2- 2- 2-: -1 0 1) (2- 6+ 6+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (13+ 4- 4-: 0 0 2) (13+ 13+ 13+: 0 -1 -1) [1 2 2] 0 0 (6+ 2- 2-: 1 0 1) (6+ 6+ 6+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (13+ 4- 4-: 0 1 2) (13+ 13+ 13+: 0 0 -1) [1 2 2] 0 0 (6+ 2- 2-: 1 0 1) (6+ 6+ 6+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (13+ 4- 4-: 0 0 1) (13+ 13+ 13+: 0 -1 -2) [1 2 2] 0 0 (6+ 2- 2-: 1 0 0) (6+ 6+ 6+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (13+ 4- 4-: 0 1 1) (13+ 13+ 13+: 0 0 -2) [1 2 2] 0 0 (6+ 2- 2-: 1 0 0) (6+ 6+ 6+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 2 0 1) (13+ 4- 13+: -1 0 -2) [2 1 2] 0 0 (2- 2- 2-: 1 -1 0) (6+ 2- 6+: 0 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 2 0 2) (13+ 4- 13+: -1 0 -1) [2 1 2] 0 0 (2- 2- 2-: 1 -1 1) (6+ 2- 6+: 0 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 1 0 1) (13+ 4- 13+: -2 0 -2) [2 1 2] 0 0 (2- 2- 2-: 0 -1 0) (6+ 2- 6+: -1 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 1 0 2) (13+ 4- 13+: -2 0 -1) [2 1 2] 0 0 (2- 2- 2-: 0 -1 1) (6+ 2- 6+: -1 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 13+ 4-: 2 0 2) (13+ 13+ 13+: -1 0 -1) [2 1 2] 0 0 (2- 6+ 2-: 1 1 1) (6+ 6+ 6+: 0 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 13+ 4-: 2 0 1) (13+ 13+ 13+: -1 0 -2) [2 1 2] 0 0 (2- 6+ 2-: 1 1 0) (6+ 6+ 6+: 0 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 13+ 4-: 1 0 2) (13+ 13+ 13+: -2 0 -1) [2 1 2] 0 0 (2- 6+ 2-: 0 1 1) (6+ 6+ 6+: -1 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 13+ 4-: 1 0 1) (13+ 13+ 13+: -2 0 -2) [2 1 2] 0 0 (2- 6+ 2-: 0 1 0) (6+ 6+ 6+: -1 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 0) (13+ 13+ 4-: -1 -1 0) [2 2 1] 0 0 (2- 2- 2-: 0 0 -1) (6+ 6+ 2-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 1 0) (13+ 13+ 4-: -1 0 0) [2 2 1] 0 0 (2- 2- 2-: 0 0 -1) (6+ 6+ 2-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 1 0 0) (13+ 13+ 4-: 0 -1 0) [2 2 1] 0 0 (2- 2- 2-: 0 0 -1) (6+ 6+ 2-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 1 1 0) (13+ 13+ 4-: 0 0 0) [2 2 1] 0 0 (2- 2- 2-: 0 0 -1) (6+ 6+ 2-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 13+: 1 0 0) (13+ 13+ 13+: 0 -1 0) [2 2 1] 0 0 (2- 2- 6+: 0 0 1) (6+ 6+ 6+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 13+: 1 1 0) (13+ 13+ 13+: 0 0 0) [2 2 1] 0 0 (2- 2- 6+: 0 0 1) (6+ 6+ 6+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 13+: 0 0 0) (13+ 13+ 13+: -1 -1 0) [2 2 1] 0 0 (2- 2- 6+: 0 0 1) (6+ 6+ 6+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 13+: 0 1 0) (13+ 13+ 13+: -1 0 0) [2 2 1] 0 0 (2- 2- 6+: 0 0 1) (6+ 6+ 6+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (5- 5- 5-: -1 0 0) (5- 11+ 11+: -1 0 0) [1 1 1] 0 2 (10- 10- 10-: 0 0 1) (10- 23+ 23+: 0 -1 0) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: -1 0 0) (5- 11+ 11+: -1 0 0) [1 1 1] 0 2 (10- 10- 10-: 0 1 1) (10- 23+ 23+: 0 0 0) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: -1 0 0) (5- 11+ 11+: -1 0 0) [1 1 1] 0 2 (10- 10- 10-: 0 0 0) (10- 23+ 23+: 0 -1 -1) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: -1 0 0) (5- 11+ 11+: -1 0 0) [1 1 1] 0 2 (10- 10- 10-: 0 1 0) (10- 23+ 23+: 0 0 -1) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (11+ 5- 5-: 1 0 0) (11+ 11+ 11+: 1 0 0) [1 1 1] 0 2 (23+ 10- 10-: 0 0 0) (23+ 23+ 23+: 0 -1 -1) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (11+ 5- 5-: 1 0 0) (11+ 11+ 11+: 1 0 0) [1 1 1] 0 2 (23+ 10- 10-: 0 1 0) (23+ 23+ 23+: 0 0 -1) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (11+ 5- 5-: 1 0 0) (11+ 11+ 11+: 1 0 0) [1 1 1] 0 2 (23+ 10- 10-: 0 0 1) (23+ 23+ 23+: 0 -1 0) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (11+ 5- 5-: 1 0 0) (11+ 11+ 11+: 1 0 0) [1 1 1] 0 2 (23+ 10- 10-: 0 1 1) (23+ 23+ 23+: 0 0 0) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 -1 0) (11+ 5- 11+: 0 -1 0) [1 1 1] 0 2 (10- 10- 10-: 0 0 1) (23+ 10- 23+: -1 0 0) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 -1 0) (11+ 5- 11+: 0 -1 0) [1 1 1] 0 2 (10- 10- 10-: 0 0 0) (23+ 10- 23+: -1 0 -1) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 -1 0) (11+ 5- 11+: 0 -1 0) [1 1 1] 0 2 (10- 10- 10-: 1 0 1) (23+ 10- 23+: 0 0 0) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 -1 0) (11+ 5- 11+: 0 -1 0) [1 1 1] 0 2 (10- 10- 10-: 1 0 0) (23+ 10- 23+: 0 0 -1) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (5- 11+ 5-: 0 1 0) (11+ 11+ 11+: 0 1 0) [1 1 1] 0 2 (10- 23+ 10-: 0 0 0) (23+ 23+ 23+: -1 0 -1) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (5- 11+ 5-: 0 1 0) (11+ 11+ 11+: 0 1 0) [1 1 1] 0 2 (10- 23+ 10-: 0 0 1) (23+ 23+ 23+: -1 0 0) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (5- 11+ 5-: 0 1 0) (11+ 11+ 11+: 0 1 0) [1 1 1] 0 2 (10- 23+ 10-: 1 0 0) (23+ 23+ 23+: 0 0 -1) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (5- 11+ 5-: 0 1 0) (11+ 11+ 11+: 0 1 0) [1 1 1] 0 2 (10- 23+ 10-: 1 0 1) (23+ 23+ 23+: 0 0 0) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 0 -1) (11+ 11+ 5-: 0 0 -1) [1 1 1] 0 2 (10- 10- 10-: 0 0 0) (23+ 23+ 10-: -1 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 0 -1) (11+ 11+ 5-: 0 0 -1) [1 1 1] 0 2 (10- 10- 10-: 0 1 0) (23+ 23+ 10-: -1 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 0 -1) (11+ 11+ 5-: 0 0 -1) [1 1 1] 0 2 (10- 10- 10-: 1 0 0) (23+ 23+ 10-: 0 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 0 -1) (11+ 11+ 5-: 0 0 -1) [1 1 1] 0 2 (10- 10- 10-: 1 1 0) (23+ 23+ 10-: 0 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (5- 5- 11+: 0 0 1) (11+ 11+ 11+: 0 0 1) [1 1 1] 0 2 (10- 10- 23+: 1 0 0) (23+ 23+ 23+: 0 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (5- 5- 11+: 0 0 1) (11+ 11+ 11+: 0 0 1) [1 1 1] 0 2 (10- 10- 23+: 1 1 0) (23+ 23+ 23+: 0 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (5- 5- 11+: 0 0 1) (11+ 11+ 11+: 0 0 1) [1 1 1] 0 2 (10- 10- 23+: 0 0 0) (23+ 23+ 23+: -1 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (5- 5- 11+: 0 0 1) (11+ 11+ 11+: 0 0 1) [1 1 1] 0 2 (10- 10- 23+: 0 1 0) (23+ 23+ 23+: -1 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 0) (4- 13+ 4-: 0 -1 0) [1 2 1] 0 0 (2- 2- 2-: -1 0 0) (2- 6+ 2-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 1 0) (4- 13+ 4-: 0 0 0) [1 2 1] 0 0 (2- 2- 2-: -1 0 0) (2- 6+ 2-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (13+ 4- 13+: 0 0 0) (13+ 13+ 13+: 0 -1 0) [1 2 1] 0 0 (6+ 2- 6+: 1 0 0) (6+ 6+ 6+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (13+ 4- 13+: 0 1 0) (13+ 13+ 13+: 0 0 0) [1 2 1] 0 0 (6+ 2- 6+: 1 0 0) (6+ 6+ 6+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (13+ 4- 4-: 0 0 0) (13+ 13+ 4-: 0 -1 0) [1 2 1] 0 0 (6+ 2- 2-: 1 0 0) (6+ 6+ 2-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (13+ 4- 4-: 0 1 0) (13+ 13+ 4-: 0 0 0) [1 2 1] 0 0 (6+ 2- 2-: 1 0 0) (6+ 6+ 2-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 13+: 0 0 0) (4- 13+ 13+: 0 -1 0) [1 2 1] 0 0 (2- 2- 6+: -1 0 0) (2- 6+ 6+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 13+: 0 1 0) (4- 13+ 13+: 0 0 0) [1 2 1] 0 0 (2- 2- 6+: -1 0 0) (2- 6+ 6+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 2 0 0) (13+ 4- 4-: -1 0 0) [2 1 1] 0 0 (2- 2- 2-: 1 -1 0) (6+ 2- 2-: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 2) (4- 4- 13+: 0 0 -1) [1 1 2] 0 0 (2- 2- 2-: 0 -1 1) (2- 2- 6+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 13+: 2 0 0) (13+ 4- 13+: -1 0 0) [2 1 1] 0 0 (2- 2- 6+: 1 -1 0) (6+ 2- 6+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (13+ 4- 4-: 0 0 2) (13+ 4- 13+: 0 0 -1) [1 1 2] 0 0 (6+ 2- 2-: 0 -1 1) (6+ 2- 6+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 1 0 0) (13+ 4- 4-: -2 0 0) [2 1 1] 0 0 (2- 2- 2-: 0 -1 0) (6+ 2- 2-: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 1) (4- 4- 13+: 0 0 -2) [1 1 2] 0 0 (2- 2- 2-: 0 -1 0) (2- 2- 6+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 13+: 1 0 0) (13+ 4- 13+: -2 0 0) [2 1 1] 0 0 (2- 2- 6+: 0 -1 0) (6+ 2- 6+: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (13+ 4- 4-: 0 0 1) (13+ 4- 13+: 0 0 -2) [1 1 2] 0 0 (6+ 2- 2-: 0 -1 0) (6+ 2- 6+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 13+ 4-: 2 0 0) (13+ 13+ 4-: -1 0 0) [2 1 1] 0 0 (2- 6+ 2-: 1 1 0) (6+ 6+ 2-: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 13+ 4-: 0 0 2) (4- 13+ 13+: 0 0 -1) [1 1 2] 0 0 (2- 6+ 2-: 0 1 1) (2- 6+ 6+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 13+ 13+: 2 0 0) (13+ 13+ 13+: -1 0 0) [2 1 1] 0 0 (2- 6+ 6+: 1 1 0) (6+ 6+ 6+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (13+ 13+ 4-: 0 0 2) (13+ 13+ 13+: 0 0 -1) [1 1 2] 0 0 (6+ 6+ 2-: 0 1 1) (6+ 6+ 6+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 13+ 4-: 1 0 0) (13+ 13+ 4-: -2 0 0) [2 1 1] 0 0 (2- 6+ 2-: 0 1 0) (6+ 6+ 2-: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 13+ 4-: 0 0 1) (4- 13+ 13+: 0 0 -2) [1 1 2] 0 0 (2- 6+ 2-: 0 1 0) (2- 6+ 6+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 13+ 13+: 1 0 0) (13+ 13+ 13+: -2 0 0) [2 1 1] 0 0 (2- 6+ 6+: 0 1 0) (6+ 6+ 6+: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (13+ 13+ 4-: 0 0 1) (13+ 13+ 13+: 0 0 -2) [1 1 2] 0 0 (6+ 6+ 2-: 0 1 0) (6+ 6+ 6+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 0) (4- 4- 4-: 0 0 0) [1 1 1] 0 0 (2- 2- 2-: 0 -1 0) (2- 2- 2-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (13+ 4- 4-: 0 0 0) (13+ 4- 4-: 0 0 0) [1 1 1] 0 0 (6+ 2- 2-: 0 -1 0) (6+ 2- 2-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (4- 4- 13+: 0 0 0) (4- 4- 13+: 0 0 0) [1 1 1] 0 0 (2- 2- 6+: 0 -1 0) (2- 2- 6+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (13+ 4- 13+: 0 0 0) (13+ 4- 13+: 0 0 0) [1 1 1] 0 0 (6+ 2- 6+: 0 -1 0) (6+ 2- 6+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (4- 13+ 4-: 0 0 0) (4- 13+ 4-: 0 0 0) [1 1 1] 0 0 (2- 6+ 2-: 0 1 0) (2- 6+ 2-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (13+ 13+ 4-: 0 0 0) (13+ 13+ 4-: 0 0 0) [1 1 1] 0 0 (6+ 6+ 2-: 0 1 0) (6+ 6+ 2-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (4- 13+ 13+: 0 0 0) (4- 13+ 13+: 0 0 0) [1 1 1] 0 0 (2- 6+ 6+: 0 1 0) (2- 6+ 6+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (13+ 13+ 13+: 0 0 0) (13+ 13+ 13+: 0 0 0) [1 1 1] 0 0 (6+ 6+ 6+: 0 1 0) (6+ 6+ 6+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 1) (10- 23+ 23+: 0 -1 -2) [1 2 2] 0 1 (5- 5- 5-: -1 0 0) (5- 11+ 11+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 1 1) (10- 23+ 23+: 0 0 -2) [1 2 2] 0 1 (5- 5- 5-: -1 0 0) (5- 11+ 11+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 2) (10- 23+ 23+: 0 -1 -1) [1 2 2] 0 1 (5- 5- 5-: -1 0 1) (5- 11+ 11+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 1 2) (10- 23+ 23+: 0 0 -1) [1 2 2] 0 1 (5- 5- 5-: -1 0 1) (5- 11+ 11+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (23+ 10- 10-: 0 0 2) (23+ 23+ 23+: 0 -1 -1) [1 2 2] 0 1 (11+ 5- 5-: 1 0 1) (11+ 11+ 11+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (23+ 10- 10-: 0 1 2) (23+ 23+ 23+: 0 0 -1) [1 2 2] 0 1 (11+ 5- 5-: 1 0 1) (11+ 11+ 11+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (23+ 10- 10-: 0 0 1) (23+ 23+ 23+: 0 -1 -2) [1 2 2] 0 1 (11+ 5- 5-: 1 0 0) (11+ 11+ 11+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (23+ 10- 10-: 0 1 1) (23+ 23+ 23+: 0 0 -2) [1 2 2] 0 1 (11+ 5- 5-: 1 0 0) (11+ 11+ 11+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 2 0 1) (23+ 10- 23+: -1 0 -2) [2 1 2] 0 1 (5- 5- 5-: 1 -1 0) (11+ 5- 11+: 0 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 2 0 2) (23+ 10- 23+: -1 0 -1) [2 1 2] 0 1 (5- 5- 5-: 1 -1 1) (11+ 5- 11+: 0 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 1 0 1) (23+ 10- 23+: -2 0 -2) [2 1 2] 0 1 (5- 5- 5-: 0 -1 0) (11+ 5- 11+: -1 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 1 0 2) (23+ 10- 23+: -2 0 -1) [2 1 2] 0 1 (5- 5- 5-: 0 -1 1) (11+ 5- 11+: -1 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 23+ 10-: 2 0 2) (23+ 23+ 23+: -1 0 -1) [2 1 2] 0 1 (5- 11+ 5-: 1 1 1) (11+ 11+ 11+: 0 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 23+ 10-: 2 0 1) (23+ 23+ 23+: -1 0 -2) [2 1 2] 0 1 (5- 11+ 5-: 1 1 0) (11+ 11+ 11+: 0 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 23+ 10-: 1 0 2) (23+ 23+ 23+: -2 0 -1) [2 1 2] 0 1 (5- 11+ 5-: 0 1 1) (11+ 11+ 11+: -1 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 23+ 10-: 1 0 1) (23+ 23+ 23+: -2 0 -2) [2 1 2] 0 1 (5- 11+ 5-: 0 1 0) (11+ 11+ 11+: -1 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 0) (23+ 23+ 10-: -1 -1 0) [2 2 1] 0 1 (5- 5- 5-: 0 0 -1) (11+ 11+ 5-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 1 0) (23+ 23+ 10-: -1 0 0) [2 2 1] 0 1 (5- 5- 5-: 0 0 -1) (11+ 11+ 5-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 1 0 0) (23+ 23+ 10-: 0 -1 0) [2 2 1] 0 1 (5- 5- 5-: 0 0 -1) (11+ 11+ 5-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 1 1 0) (23+ 23+ 10-: 0 0 0) [2 2 1] 0 1 (5- 5- 5-: 0 0 -1) (11+ 11+ 5-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 23+: 1 0 0) (23+ 23+ 23+: 0 -1 0) [2 2 1] 0 1 (5- 5- 11+: 0 0 1) (11+ 11+ 11+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 23+: 1 1 0) (23+ 23+ 23+: 0 0 0) [2 2 1] 0 1 (5- 5- 11+: 0 0 1) (11+ 11+ 11+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 23+: 0 0 0) (23+ 23+ 23+: -1 -1 0) [2 2 1] 0 1 (5- 5- 11+: 0 0 1) (11+ 11+ 11+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 23+: 0 1 0) (23+ 23+ 23+: -1 0 0) [2 2 1] 0 1 (5- 5- 11+: 0 0 1) (11+ 11+ 11+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (11- 11- 11-: -1 0 0) (11- 21+ 21+: -1 0 0) [1 1 1] 0 3 (22- 22- 22-: 0 0 1) (22- 43+ 43+: 0 -1 0) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: -1 0 0) (11- 21+ 21+: -1 0 0) [1 1 1] 0 3 (22- 22- 22-: 0 1 1) (22- 43+ 43+: 0 0 0) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: -1 0 0) (11- 21+ 21+: -1 0 0) [1 1 1] 0 3 (22- 22- 22-: 0 0 0) (22- 43+ 43+: 0 -1 -1) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: -1 0 0) (11- 21+ 21+: -1 0 0) [1 1 1] 0 3 (22- 22- 22-: 0 1 0) (22- 43+ 43+: 0 0 -1) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 2 (21+ 11- 11-: 1 0 0) (21+ 21+ 21+: 1 0 0) [1 1 1] 0 3 (43+ 22- 22-: 0 0 0) (43+ 43+ 43+: 0 -1 -1) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 2 (21+ 11- 11-: 1 0 0) (21+ 21+ 21+: 1 0 0) [1 1 1] 0 3 (43+ 22- 22-: 0 1 0) (43+ 43+ 43+: 0 0 -1) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 2 (21+ 11- 11-: 1 0 0) (21+ 21+ 21+: 1 0 0) [1 1 1] 0 3 (43+ 22- 22-: 0 0 1) (43+ 43+ 43+: 0 -1 0) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 2 (21+ 11- 11-: 1 0 0) (21+ 21+ 21+: 1 0 0) [1 1 1] 0 3 (43+ 22- 22-: 0 1 1) (43+ 43+ 43+: 0 0 0) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 -1 0) (21+ 11- 21+: 0 -1 0) [1 1 1] 0 3 (22- 22- 22-: 0 0 1) (43+ 22- 43+: -1 0 0) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 -1 0) (21+ 11- 21+: 0 -1 0) [1 1 1] 0 3 (22- 22- 22-: 0 0 0) (43+ 22- 43+: -1 0 -1) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 -1 0) (21+ 11- 21+: 0 -1 0) [1 1 1] 0 3 (22- 22- 22-: 1 0 1) (43+ 22- 43+: 0 0 0) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 -1 0) (21+ 11- 21+: 0 -1 0) [1 1 1] 0 3 (22- 22- 22-: 1 0 0) (43+ 22- 43+: 0 0 -1) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 2 (11- 21+ 11-: 0 1 0) (21+ 21+ 21+: 0 1 0) [1 1 1] 0 3 (22- 43+ 22-: 0 0 0) (43+ 43+ 43+: -1 0 -1) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 2 (11- 21+ 11-: 0 1 0) (21+ 21+ 21+: 0 1 0) [1 1 1] 0 3 (22- 43+ 22-: 0 0 1) (43+ 43+ 43+: -1 0 0) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 2 (11- 21+ 11-: 0 1 0) (21+ 21+ 21+: 0 1 0) [1 1 1] 0 3 (22- 43+ 22-: 1 0 0) (43+ 43+ 43+: 0 0 -1) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 2 (11- 21+ 11-: 0 1 0) (21+ 21+ 21+: 0 1 0) [1 1 1] 0 3 (22- 43+ 22-: 1 0 1) (43+ 43+ 43+: 0 0 0) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 0 -1) (21+ 21+ 11-: 0 0 -1) [1 1 1] 0 3 (22- 22- 22-: 0 0 0) (43+ 43+ 22-: -1 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 0 -1) (21+ 21+ 11-: 0 0 -1) [1 1 1] 0 3 (22- 22- 22-: 0 1 0) (43+ 43+ 22-: -1 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 0 -1) (21+ 21+ 11-: 0 0 -1) [1 1 1] 0 3 (22- 22- 22-: 1 0 0) (43+ 43+ 22-: 0 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 0 -1) (21+ 21+ 11-: 0 0 -1) [1 1 1] 0 3 (22- 22- 22-: 1 1 0) (43+ 43+ 22-: 0 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 2 (11- 11- 21+: 0 0 1) (21+ 21+ 21+: 0 0 1) [1 1 1] 0 3 (22- 22- 43+: 1 0 0) (43+ 43+ 43+: 0 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 2 (11- 11- 21+: 0 0 1) (21+ 21+ 21+: 0 0 1) [1 1 1] 0 3 (22- 22- 43+: 1 1 0) (43+ 43+ 43+: 0 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 2 (11- 11- 21+: 0 0 1) (21+ 21+ 21+: 0 0 1) [1 1 1] 0 3 (22- 22- 43+: 0 0 0) (43+ 43+ 43+: -1 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 2 (11- 11- 21+: 0 0 1) (21+ 21+ 21+: 0 0 1) [1 1 1] 0 3 (22- 22- 43+: 0 1 0) (43+ 43+ 43+: -1 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 0) (10- 23+ 10-: 0 -1 0) [1 2 1] 0 1 (5- 5- 5-: -1 0 0) (5- 11+ 5-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 1 0) (10- 23+ 10-: 0 0 0) [1 2 1] 0 1 (5- 5- 5-: -1 0 0) (5- 11+ 5-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (23+ 10- 23+: 0 0 0) (23+ 23+ 23+: 0 -1 0) [1 2 1] 0 1 (11+ 5- 11+: 1 0 0) (11+ 11+ 11+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (23+ 10- 23+: 0 1 0) (23+ 23+ 23+: 0 0 0) [1 2 1] 0 1 (11+ 5- 11+: 1 0 0) (11+ 11+ 11+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (23+ 10- 10-: 0 0 0) (23+ 23+ 10-: 0 -1 0) [1 2 1] 0 1 (11+ 5- 5-: 1 0 0) (11+ 11+ 5-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (23+ 10- 10-: 0 1 0) (23+ 23+ 10-: 0 0 0) [1 2 1] 0 1 (11+ 5- 5-: 1 0 0) (11+ 11+ 5-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 23+: 0 0 0) (10- 23+ 23+: 0 -1 0) [1 2 1] 0 1 (5- 5- 11+: -1 0 0) (5- 11+ 11+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 23+: 0 1 0) (10- 23+ 23+: 0 0 0) [1 2 1] 0 1 (5- 5- 11+: -1 0 0) (5- 11+ 11+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 2 0 0) (23+ 10- 10-: -1 0 0) [2 1 1] 0 1 (5- 5- 5-: 1 -1 0) (11+ 5- 5-: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 2) (10- 10- 23+: 0 0 -1) [1 1 2] 0 1 (5- 5- 5-: 0 -1 1) (5- 5- 11+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 23+: 2 0 0) (23+ 10- 23+: -1 0 0) [2 1 1] 0 1 (5- 5- 11+: 1 -1 0) (11+ 5- 11+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (23+ 10- 10-: 0 0 2) (23+ 10- 23+: 0 0 -1) [1 1 2] 0 1 (11+ 5- 5-: 0 -1 1) (11+ 5- 11+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 1 0 0) (23+ 10- 10-: -2 0 0) [2 1 1] 0 1 (5- 5- 5-: 0 -1 0) (11+ 5- 5-: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 1) (10- 10- 23+: 0 0 -2) [1 1 2] 0 1 (5- 5- 5-: 0 -1 0) (5- 5- 11+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 23+: 1 0 0) (23+ 10- 23+: -2 0 0) [2 1 1] 0 1 (5- 5- 11+: 0 -1 0) (11+ 5- 11+: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (23+ 10- 10-: 0 0 1) (23+ 10- 23+: 0 0 -2) [1 1 2] 0 1 (11+ 5- 5-: 0 -1 0) (11+ 5- 11+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 23+ 10-: 2 0 0) (23+ 23+ 10-: -1 0 0) [2 1 1] 0 1 (5- 11+ 5-: 1 1 0) (11+ 11+ 5-: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 23+ 10-: 0 0 2) (10- 23+ 23+: 0 0 -1) [1 1 2] 0 1 (5- 11+ 5-: 0 1 1) (5- 11+ 11+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 23+ 23+: 2 0 0) (23+ 23+ 23+: -1 0 0) [2 1 1] 0 1 (5- 11+ 11+: 1 1 0) (11+ 11+ 11+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (23+ 23+ 10-: 0 0 2) (23+ 23+ 23+: 0 0 -1) [1 1 2] 0 1 (11+ 11+ 5-: 0 1 1) (11+ 11+ 11+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 23+ 10-: 1 0 0) (23+ 23+ 10-: -2 0 0) [2 1 1] 0 1 (5- 11+ 5-: 0 1 0) (11+ 11+ 5-: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 23+ 10-: 0 0 1) (10- 23+ 23+: 0 0 -2) [1 1 2] 0 1 (5- 11+ 5-: 0 1 0) (5- 11+ 11+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 23+ 23+: 1 0 0) (23+ 23+ 23+: -2 0 0) [2 1 1] 0 1 (5- 11+ 11+: 0 1 0) (11+ 11+ 11+: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (23+ 23+ 10-: 0 0 1) (23+ 23+ 23+: 0 0 -2) [1 1 2] 0 1 (11+ 11+ 5-: 0 1 0) (11+ 11+ 11+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 0) (10- 10- 10-: 0 0 0) [1 1 1] 0 1 (5- 5- 5-: 0 -1 0) (5- 5- 5-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (23+ 10- 10-: 0 0 0) (23+ 10- 10-: 0 0 0) [1 1 1] 0 1 (11+ 5- 5-: 0 -1 0) (11+ 5- 5-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (10- 10- 23+: 0 0 0) (10- 10- 23+: 0 0 0) [1 1 1] 0 1 (5- 5- 11+: 0 -1 0) (5- 5- 11+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (23+ 10- 23+: 0 0 0) (23+ 10- 23+: 0 0 0) [1 1 1] 0 1 (11+ 5- 11+: 0 -1 0) (11+ 5- 11+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (10- 23+ 10-: 0 0 0) (10- 23+ 10-: 0 0 0) [1 1 1] 0 1 (5- 11+ 5-: 0 1 0) (5- 11+ 5-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (23+ 23+ 10-: 0 0 0) (23+ 23+ 10-: 0 0 0) [1 1 1] 0 1 (11+ 11+ 5-: 0 1 0) (11+ 11+ 5-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (10- 23+ 23+: 0 0 0) (10- 23+ 23+: 0 0 0) [1 1 1] 0 1 (5- 11+ 11+: 0 1 0) (5- 11+ 11+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (23+ 23+ 23+: 0 0 0) (23+ 23+ 23+: 0 0 0) [1 1 1] 0 1 (11+ 11+ 11+: 0 1 0) (11+ 11+ 11+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 0 1) (22- 43+ 43+: 0 -1 -2) [1 2 2] 0 2 (11- 11- 11-: -1 0 0) (11- 21+ 21+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 1 1) (22- 43+ 43+: 0 0 -2) [1 2 2] 0 2 (11- 11- 11-: -1 0 0) (11- 21+ 21+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 0 2) (22- 43+ 43+: 0 -1 -1) [1 2 2] 0 2 (11- 11- 11-: -1 0 1) (11- 21+ 21+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 1 2) (22- 43+ 43+: 0 0 -1) [1 2 2] 0 2 (11- 11- 11-: -1 0 1) (11- 21+ 21+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (43+ 22- 22-: 0 0 2) (43+ 43+ 43+: 0 -1 -1) [1 2 2] 0 2 (21+ 11- 11-: 1 0 1) (21+ 21+ 21+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (43+ 22- 22-: 0 1 2) (43+ 43+ 43+: 0 0 -1) [1 2 2] 0 2 (21+ 11- 11-: 1 0 1) (21+ 21+ 21+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (43+ 22- 22-: 0 0 1) (43+ 43+ 43+: 0 -1 -2) [1 2 2] 0 2 (21+ 11- 11-: 1 0 0) (21+ 21+ 21+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (43+ 22- 22-: 0 1 1) (43+ 43+ 43+: 0 0 -2) [1 2 2] 0 2 (21+ 11- 11-: 1 0 0) (21+ 21+ 21+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 2 0 1) (43+ 22- 43+: -1 0 -2) [2 1 2] 0 2 (11- 11- 11-: 1 -1 0) (21+ 11- 21+: 0 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 2 0 2) (43+ 22- 43+: -1 0 -1) [2 1 2] 0 2 (11- 11- 11-: 1 -1 1) (21+ 11- 21+: 0 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 1 0 1) (43+ 22- 43+: -2 0 -2) [2 1 2] 0 2 (11- 11- 11-: 0 -1 0) (21+ 11- 21+: -1 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 1 0 2) (43+ 22- 43+: -2 0 -1) [2 1 2] 0 2 (11- 11- 11-: 0 -1 1) (21+ 11- 21+: -1 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 43+ 22-: 2 0 2) (43+ 43+ 43+: -1 0 -1) [2 1 2] 0 2 (11- 21+ 11-: 1 1 1) (21+ 21+ 21+: 0 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 43+ 22-: 2 0 1) (43+ 43+ 43+: -1 0 -2) [2 1 2] 0 2 (11- 21+ 11-: 1 1 0) (21+ 21+ 21+: 0 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 43+ 22-: 1 0 2) (43+ 43+ 43+: -2 0 -1) [2 1 2] 0 2 (11- 21+ 11-: 0 1 1) (21+ 21+ 21+: -1 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 43+ 22-: 1 0 1) (43+ 43+ 43+: -2 0 -2) [2 1 2] 0 2 (11- 21+ 11-: 0 1 0) (21+ 21+ 21+: -1 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 0 0) (43+ 43+ 22-: -1 -1 0) [2 2 1] 0 2 (11- 11- 11-: 0 0 -1) (21+ 21+ 11-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 1 0) (43+ 43+ 22-: -1 0 0) [2 2 1] 0 2 (11- 11- 11-: 0 0 -1) (21+ 21+ 11-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 1 0 0) (43+ 43+ 22-: 0 -1 0) [2 2 1] 0 2 (11- 11- 11-: 0 0 -1) (21+ 21+ 11-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 1 1 0) (43+ 43+ 22-: 0 0 0) [2 2 1] 0 2 (11- 11- 11-: 0 0 -1) (21+ 21+ 11-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 43+: 1 0 0) (43+ 43+ 43+: 0 -1 0) [2 2 1] 0 2 (11- 11- 21+: 0 0 1) (21+ 21+ 21+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 43+: 1 1 0) (43+ 43+ 43+: 0 0 0) [2 2 1] 0 2 (11- 11- 21+: 0 0 1) (21+ 21+ 21+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 43+: 0 0 0) (43+ 43+ 43+: -1 -1 0) [2 2 1] 0 2 (11- 11- 21+: 0 0 1) (21+ 21+ 21+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 43+: 0 1 0) (43+ 43+ 43+: -1 0 0) [2 2 1] 0 2 (11- 11- 21+: 0 0 1) (21+ 21+ 21+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (23- 23- 23-: -1 0 0) (23- 40+ 40+: -1 0 0) [1 1 1] 0 4 (46- 46- 46-: 0 0 1) (46- 81+ 81+: 0 -1 0) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: -1 0 0) (23- 40+ 40+: -1 0 0) [1 1 1] 0 4 (46- 46- 46-: 0 1 1) (46- 81+ 81+: 0 0 0) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: -1 0 0) (23- 40+ 40+: -1 0 0) [1 1 1] 0 4 (46- 46- 46-: 0 0 0) (46- 81+ 81+: 0 -1 -1) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: -1 0 0) (23- 40+ 40+: -1 0 0) [1 1 1] 0 4 (46- 46- 46-: 0 1 0) (46- 81+ 81+: 0 0 -1) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 3 (40+ 23- 23-: 1 0 0) (40+ 40+ 40+: 1 0 0) [1 1 1] 0 4 (81+ 46- 46-: 0 0 0) (81+ 81+ 81+: 0 -1 -1) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 3 (40+ 23- 23-: 1 0 0) (40+ 40+ 40+: 1 0 0) [1 1 1] 0 4 (81+ 46- 46-: 0 1 0) (81+ 81+ 81+: 0 0 -1) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 3 (40+ 23- 23-: 1 0 0) (40+ 40+ 40+: 1 0 0) [1 1 1] 0 4 (81+ 46- 46-: 0 0 1) (81+ 81+ 81+: 0 -1 0) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 3 (40+ 23- 23-: 1 0 0) (40+ 40+ 40+: 1 0 0) [1 1 1] 0 4 (81+ 46- 46-: 0 1 1) (81+ 81+ 81+: 0 0 0) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: 0 -1 0) (40+ 23- 40+: 0 -1 0) [1 1 1] 0 4 (46- 46- 46-: 0 0 1) (81+ 46- 81+: -1 0 0) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: 0 -1 0) (40+ 23- 40+: 0 -1 0) [1 1 1] 0 4 (46- 46- 46-: 0 0 0) (81+ 46- 81+: -1 0 -1) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: 0 -1 0) (40+ 23- 40+: 0 -1 0) [1 1 1] 0 4 (46- 46- 46-: 1 0 1) (81+ 46- 81+: 0 0 0) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: 0 -1 0) (40+ 23- 40+: 0 -1 0) [1 1 1] 0 4 (46- 46- 46-: 1 0 0) (81+ 46- 81+: 0 0 -1) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 3 (23- 40+ 23-: 0 1 0) (40+ 40+ 40+: 0 1 0) [1 1 1] 0 4 (46- 81+ 46-: 0 0 0) (81+ 81+ 81+: -1 0 -1) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 3 (23- 40+ 23-: 0 1 0) (40+ 40+ 40+: 0 1 0) [1 1 1] 0 4 (46- 81+ 46-: 0 0 1) (81+ 81+ 81+: -1 0 0) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 3 (23- 40+ 23-: 0 1 0) (40+ 40+ 40+: 0 1 0) [1 1 1] 0 4 (46- 81+ 46-: 1 0 0) (81+ 81+ 81+: 0 0 -1) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 3 (23- 40+ 23-: 0 1 0) (40+ 40+ 40+: 0 1 0) [1 1 1] 0 4 (46- 81+ 46-: 1 0 1) (81+ 81+ 81+: 0 0 0) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: 0 0 -1) (40+ 40+ 23-: 0 0 -1) [1 1 1] 0 4 (46- 46- 46-: 0 0 0) (81+ 81+ 46-: -1 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: 0 0 -1) (40+ 40+ 23-: 0 0 -1) [1 1 1] 0 4 (46- 46- 46-: 0 1 0) (81+ 81+ 46-: -1 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: 0 0 -1) (40+ 40+ 23-: 0 0 -1) [1 1 1] 0 4 (46- 46- 46-: 1 0 0) (81+ 81+ 46-: 0 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: 0 0 -1) (40+ 40+ 23-: 0 0 -1) [1 1 1] 0 4 (46- 46- 46-: 1 1 0) (81+ 81+ 46-: 0 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 3 (23- 23- 40+: 0 0 1) (40+ 40+ 40+: 0 0 1) [1 1 1] 0 4 (46- 46- 81+: 1 0 0) (81+ 81+ 81+: 0 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 3 (23- 23- 40+: 0 0 1) (40+ 40+ 40+: 0 0 1) [1 1 1] 0 4 (46- 46- 81+: 1 1 0) (81+ 81+ 81+: 0 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 3 (23- 23- 40+: 0 0 1) (40+ 40+ 40+: 0 0 1) [1 1 1] 0 4 (46- 46- 81+: 0 0 0) (81+ 81+ 81+: -1 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 3 (23- 23- 40+: 0 0 1) (40+ 40+ 40+: 0 0 1) [1 1 1] 0 4 (46- 46- 81+: 0 1 0) (81+ 81+ 81+: -1 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 3 (22- 22- 22-: 0 0 0) (22- 43+ 22-: 0 -1 0) [1 2 1] 0 2 (11- 11- 11-: -1 0 0) (11- 21+ 11-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 1 0) (22- 43+ 22-: 0 0 0) [1 2 1] 0 2 (11- 11- 11-: -1 0 0) (11- 21+ 11-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (43+ 22- 43+: 0 0 0) (43+ 43+ 43+: 0 -1 0) [1 2 1] 0 2 (21+ 11- 21+: 1 0 0) (21+ 21+ 21+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (43+ 22- 43+: 0 1 0) (43+ 43+ 43+: 0 0 0) [1 2 1] 0 2 (21+ 11- 21+: 1 0 0) (21+ 21+ 21+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (43+ 22- 22-: 0 0 0) (43+ 43+ 22-: 0 -1 0) [1 2 1] 0 2 (21+ 11- 11-: 1 0 0) (21+ 21+ 11-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (43+ 22- 22-: 0 1 0) (43+ 43+ 22-: 0 0 0) [1 2 1] 0 2 (21+ 11- 11-: 1 0 0) (21+ 21+ 11-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 43+: 0 0 0) (22- 43+ 43+: 0 -1 0) [1 2 1] 0 2 (11- 11- 21+: -1 0 0) (11- 21+ 21+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 43+: 0 1 0) (22- 43+ 43+: 0 0 0) [1 2 1] 0 2 (11- 11- 21+: -1 0 0) (11- 21+ 21+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 2 0 0) (43+ 22- 22-: -1 0 0) [2 1 1] 0 2 (11- 11- 11-: 1 -1 0) (21+ 11- 11-: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 0 2) (22- 22- 43+: 0 0 -1) [1 1 2] 0 2 (11- 11- 11-: 0 -1 1) (11- 11- 21+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 43+: 2 0 0) (43+ 22- 43+: -1 0 0) [2 1 1] 0 2 (11- 11- 21+: 1 -1 0) (21+ 11- 21+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (43+ 22- 22-: 0 0 2) (43+ 22- 43+: 0 0 -1) [1 1 2] 0 2 (21+ 11- 11-: 0 -1 1) (21+ 11- 21+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 1 0 0) (43+ 22- 22-: -2 0 0) [2 1 1] 0 2 (11- 11- 11-: 0 -1 0) (21+ 11- 11-: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 0 1) (22- 22- 43+: 0 0 -2) [1 1 2] 0 2 (11- 11- 11-: 0 -1 0) (11- 11- 21+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 43+: 1 0 0) (43+ 22- 43+: -2 0 0) [2 1 1] 0 2 (11- 11- 21+: 0 -1 0) (21+ 11- 21+: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (43+ 22- 22-: 0 0 1) (43+ 22- 43+: 0 0 -2) [1 1 2] 0 2 (21+ 11- 11-: 0 -1 0) (21+ 11- 21+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 43+ 22-: 2 0 0) (43+ 43+ 22-: -1 0 0) [2 1 1] 0 2 (11- 21+ 11-: 1 1 0) (21+ 21+ 11-: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 43+ 22-: 0 0 2) (22- 43+ 43+: 0 0 -1) [1 1 2] 0 2 (11- 21+ 11-: 0 1 1) (11- 21+ 21+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 43+ 43+: 2 0 0) (43+ 43+ 43+: -1 0 0) [2 1 1] 0 2 (11- 21+ 21+: 1 1 0) (21+ 21+ 21+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (43+ 43+ 22-: 0 0 2) (43+ 43+ 43+: 0 0 -1) [1 1 2] 0 2 (21+ 21+ 11-: 0 1 1) (21+ 21+ 21+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 43+ 22-: 1 0 0) (43+ 43+ 22-: -2 0 0) [2 1 1] 0 2 (11- 21+ 11-: 0 1 0) (21+ 21+ 11-: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 43+ 22-: 0 0 1) (22- 43+ 43+: 0 0 -2) [1 1 2] 0 2 (11- 21+ 11-: 0 1 0) (11- 21+ 21+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 43+ 43+: 1 0 0) (43+ 43+ 43+: -2 0 0) [2 1 1] 0 2 (11- 21+ 21+: 0 1 0) (21+ 21+ 21+: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (43+ 43+ 22-: 0 0 1) (43+ 43+ 43+: 0 0 -2) [1 1 2] 0 2 (21+ 21+ 11-: 0 1 0) (21+ 21+ 21+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 0 0) (22- 22- 22-: 0 0 0) [1 1 1] 0 2 (11- 11- 11-: 0 -1 0) (11- 11- 11-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (43+ 22- 22-: 0 0 0) (43+ 22- 22-: 0 0 0) [1 1 1] 0 2 (21+ 11- 11-: 0 -1 0) (21+ 11- 11-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (22- 22- 43+: 0 0 0) (22- 22- 43+: 0 0 0) [1 1 1] 0 2 (11- 11- 21+: 0 -1 0) (11- 11- 21+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (43+ 22- 43+: 0 0 0) (43+ 22- 43+: 0 0 0) [1 1 1] 0 2 (21+ 11- 21+: 0 -1 0) (21+ 11- 21+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (22- 43+ 22-: 0 0 0) (22- 43+ 22-: 0 0 0) [1 1 1] 0 2 (11- 21+ 11-: 0 1 0) (11- 21+ 11-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (43+ 43+ 22-: 0 0 0) (43+ 43+ 22-: 0 0 0) [1 1 1] 0 2 (21+ 21+ 11-: 0 1 0) (21+ 21+ 11-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (22- 43+ 43+: 0 0 0) (22- 43+ 43+: 0 0 0) [1 1 1] 0 2 (11- 21+ 21+: 0 1 0) (11- 21+ 21+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (43+ 43+ 43+: 0 0 0) (43+ 43+ 43+: 0 0 0) [1 1 1] 0 2 (21+ 21+ 21+: 0 1 0) (21+ 21+ 21+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 0 0 1) (46- 81+ 81+: 0 -1 -2) [1 2 2] 0 3 (23- 23- 23-: -1 0 0) (23- 40+ 40+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 0 1 1) (46- 81+ 81+: 0 0 -2) [1 2 2] 0 3 (23- 23- 23-: -1 0 0) (23- 40+ 40+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 0 0 2) (46- 81+ 81+: 0 -1 -1) [1 2 2] 0 3 (23- 23- 23-: -1 0 1) (23- 40+ 40+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 0 1 2) (46- 81+ 81+: 0 0 -1) [1 2 2] 0 3 (23- 23- 23-: -1 0 1) (23- 40+ 40+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (81+ 46- 46-: 0 0 2) (81+ 81+ 81+: 0 -1 -1) [1 2 2] 0 3 (40+ 23- 23-: 1 0 1) (40+ 40+ 40+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (81+ 46- 46-: 0 1 2) (81+ 81+ 81+: 0 0 -1) [1 2 2] 0 3 (40+ 23- 23-: 1 0 1) (40+ 40+ 40+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (81+ 46- 46-: 0 0 1) (81+ 81+ 81+: 0 -1 -2) [1 2 2] 0 3 (40+ 23- 23-: 1 0 0) (40+ 40+ 40+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (81+ 46- 46-: 0 1 1) (81+ 81+ 81+: 0 0 -2) [1 2 2] 0 3 (40+ 23- 23-: 1 0 0) (40+ 40+ 40+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 2 0 1) (81+ 46- 81+: -1 0 -2) [2 1 2] 0 3 (23- 23- 23-: 1 -1 0) (40+ 23- 40+: 0 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 2 0 2) (81+ 46- 81+: -1 0 -1) [2 1 2] 0 3 (23- 23- 23-: 1 -1 1) (40+ 23- 40+: 0 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 1 0 1) (81+ 46- 81+: -2 0 -2) [2 1 2] 0 3 (23- 23- 23-: 0 -1 0) (40+ 23- 40+: -1 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 1 0 2) (81+ 46- 81+: -2 0 -1) [2 1 2] 0 3 (23- 23- 23-: 0 -1 1) (40+ 23- 40+: -1 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 81+ 46-: 2 0 2) (81+ 81+ 81+: -1 0 -1) [2 1 2] 0 3 (23- 40+ 23-: 1 1 1) (40+ 40+ 40+: 0 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 81+ 46-: 2 0 1) (81+ 81+ 81+: -1 0 -2) [2 1 2] 0 3 (23- 40+ 23-: 1 1 0) (40+ 40+ 40+: 0 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 81+ 46-: 1 0 2) (81+ 81+ 81+: -2 0 -1) [2 1 2] 0 3 (23- 40+ 23-: 0 1 1) (40+ 40+ 40+: -1 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 81+ 46-: 1 0 1) (81+ 81+ 81+: -2 0 -2) [2 1 2] 0 3 (23- 40+ 23-: 0 1 0) (40+ 40+ 40+: -1 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 0 0 0) (81+ 81+ 46-: -1 -1 0) [2 2 1] 0 3 (23- 23- 23-: 0 0 -1) (40+ 40+ 23-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 0 1 0) (81+ 81+ 46-: -1 0 0) [2 2 1] 0 3 (23- 23- 23-: 0 0 -1) (40+ 40+ 23-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 1 0 0) (81+ 81+ 46-: 0 -1 0) [2 2 1] 0 3 (23- 23- 23-: 0 0 -1) (40+ 40+ 23-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 1 1 0) (81+ 81+ 46-: 0 0 0) [2 2 1] 0 3 (23- 23- 23-: 0 0 -1) (40+ 40+ 23-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 81+: 1 0 0) (81+ 81+ 81+: 0 -1 0) [2 2 1] 0 3 (23- 23- 40+: 0 0 1) (40+ 40+ 40+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 81+: 1 1 0) (81+ 81+ 81+: 0 0 0) [2 2 1] 0 3 (23- 23- 40+: 0 0 1) (40+ 40+ 40+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 81+: 0 0 0) (81+ 81+ 81+: -1 -1 0) [2 2 1] 0 3 (23- 23- 40+: 0 0 1) (40+ 40+ 40+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 81+: 0 1 0) (81+ 81+ 81+: -1 0 0) [2 2 1] 0 3 (23- 23- 40+: 0 0 1) (40+ 40+ 40+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (49- 49- 49-: -1 0 0) (49- 60+ 60+: -1 0 0) [1 1 1] 0 5 (98- 98- 98-: 0 0 1) (98- 121+ 121+: 0 -1 0) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 4 (49- 49- 49-: -1 0 0) (49- 60+ 60+: -1 0 0) [1 1 1] 0 5 (98- 98- 98-: 0 1 1) (98- 121+ 121+: 0 0 0) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 4 (49- 49- 49-: -1 0 0) (49- 60+ 60+: -1 0 0) [1 1 1] 0 5 (98- 98- 98-: 0 0 0) (98- 121+ 121+: 0 -1 -1) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 4 (49- 49- 49-: -1 0 0) (49- 60+ 60+: -1 0 0) [1 1 1] 0 5 (98- 98- 98-: 0 1 0) (98- 121+ 121+: 0 0 -1) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 4 (60+ 49- 49-: 1 0 0) (60+ 60+ 60+: 1 0 0) [1 1 1] 0 5 (121+ 98- 98-: 0 0 0) (121+ 121+ 121+: 0 -1 -1) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 4 (60+ 49- 49-: 1 0 0) (60+ 60+ 60+: 1 0 0) [1 1 1] 0 5 (121+ 98- 98-: 0 1 0) (121+ 121+ 121+: 0 0 -1) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 4 (60+ 49- 49-: 1 0 0) (60+ 60+ 60+: 1 0 0) [1 1 1] 0 5 (121+ 98- 98-: 0 0 1) (121+ 121+ 121+: 0 -1 0) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 4 (60+ 49- 49-: 1 0 0) (60+ 60+ 60+: 1 0 0) [1 1 1] 0 5 (121+ 98- 98-: 0 1 1) (121+ 121+ 121+: 0 0 0) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 4 (49- 49- 49-: 0 -1 0) (60+ 49- 60+: 0 -1 0) [1 1 1] 0 5 (98- 98- 98-: 0 0 1) (121+ 98- 121+: -1 0 0) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 4 (49- 49- 49-: 0 -1 0) (60+ 49- 60+: 0 -1 0) [1 1 1] 0 5 (98- 98- 98-: 0 0 0) (121+ 98- 121+: -1 0 -1) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 4 (49- 49- 49-: 0 -1 0) (60+ 49- 60+: 0 -1 0) [1 1 1] 0 5 (98- 98- 98-: 1 0 1) (121+ 98- 121+: 0 0 0) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 4 (49- 49- 49-: 0 -1 0) (60+ 49- 60+: 0 -1 0) [1 1 1] 0 5 (98- 98- 98-: 1 0 0) (121+ 98- 121+: 0 0 -1) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 4 (49- 60+ 49-: 0 1 0) (60+ 60+ 60+: 0 1 0) [1 1 1] 0 5 (98- 121+ 98-: 0 0 0) (121+ 121+ 121+: -1 0 -1) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 4 (49- 60+ 49-: 0 1 0) (60+ 60+ 60+: 0 1 0) [1 1 1] 0 5 (98- 121+ 98-: 0 0 1) (121+ 121+ 121+: -1 0 0) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 4 (49- 60+ 49-: 0 1 0) (60+ 60+ 60+: 0 1 0) [1 1 1] 0 5 (98- 121+ 98-: 1 0 0) (121+ 121+ 121+: 0 0 -1) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 4 (49- 60+ 49-: 0 1 0) (60+ 60+ 60+: 0 1 0) [1 1 1] 0 5 (98- 121+ 98-: 1 0 1) (121+ 121+ 121+: 0 0 0) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 4 (49- 49- 49-: 0 0 -1) (60+ 60+ 49-: 0 0 -1) [1 1 1] 0 5 (98- 98- 98-: 0 0 0) (121+ 121+ 98-: -1 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 4 (49- 49- 49-: 0 0 -1) (60+ 60+ 49-: 0 0 -1) [1 1 1] 0 5 (98- 98- 98-: 0 1 0) (121+ 121+ 98-: -1 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 4 (49- 49- 49-: 0 0 -1) (60+ 60+ 49-: 0 0 -1) [1 1 1] 0 5 (98- 98- 98-: 1 0 0) (121+ 121+ 98-: 0 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 4 (49- 49- 49-: 0 0 -1) (60+ 60+ 49-: 0 0 -1) [1 1 1] 0 5 (98- 98- 98-: 1 1 0) (121+ 121+ 98-: 0 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 4 (49- 49- 60+: 0 0 1) (60+ 60+ 60+: 0 0 1) [1 1 1] 0 5 (98- 98- 121+: 1 0 0) (121+ 121+ 121+: 0 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 4 (49- 49- 60+: 0 0 1) (60+ 60+ 60+: 0 0 1) [1 1 1] 0 5 (98- 98- 121+: 1 1 0) (121+ 121+ 121+: 0 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 4 (49- 49- 60+: 0 0 1) (60+ 60+ 60+: 0 0 1) [1 1 1] 0 5 (98- 98- 121+: 0 0 0) (121+ 121+ 121+: -1 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 4 (49- 49- 60+: 0 0 1) (60+ 60+ 60+: 0 0 1) [1 1 1] 0 5 (98- 98- 121+: 0 1 0) (121+ 121+ 121+: -1 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 4 (46- 46- 46-: 0 0 0) (46- 81+ 46-: 0 -1 0) [1 2 1] 0 3 (23- 23- 23-: -1 0 0) (23- 40+ 23-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 0 1 0) (46- 81+ 46-: 0 0 0) [1 2 1] 0 3 (23- 23- 23-: -1 0 0) (23- 40+ 23-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (81+ 46- 81+: 0 0 0) (81+ 81+ 81+: 0 -1 0) [1 2 1] 0 3 (40+ 23- 40+: 1 0 0) (40+ 40+ 40+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (81+ 46- 81+: 0 1 0) (81+ 81+ 81+: 0 0 0) [1 2 1] 0 3 (40+ 23- 40+: 1 0 0) (40+ 40+ 40+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (81+ 46- 46-: 0 0 0) (81+ 81+ 46-: 0 -1 0) [1 2 1] 0 3 (40+ 23- 23-: 1 0 0) (40+ 40+ 23-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (81+ 46- 46-: 0 1 0) (81+ 81+ 46-: 0 0 0) [1 2 1] 0 3 (40+ 23- 23-: 1 0 0) (40+ 40+ 23-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 46- 81+: 0 0 0) (46- 81+ 81+: 0 -1 0) [1 2 1] 0 3 (23- 23- 40+: -1 0 0) (23- 40+ 40+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 46- 81+: 0 1 0) (46- 81+ 81+: 0 0 0) [1 2 1] 0 3 (23- 23- 40+: -1 0 0) (23- 40+ 40+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 2 0 0) (81+ 46- 46-: -1 0 0) [2 1 1] 0 3 (23- 23- 23-: 1 -1 0) (40+ 23- 23-: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 0 0 2) (46- 46- 81+: 0 0 -1) [1 1 2] 0 3 (23- 23- 23-: 0 -1 1) (23- 23- 40+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 46- 81+: 2 0 0) (81+ 46- 81+: -1 0 0) [2 1 1] 0 3 (23- 23- 40+: 1 -1 0) (40+ 23- 40+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (81+ 46- 46-: 0 0 2) (81+ 46- 81+: 0 0 -1) [1 1 2] 0 3 (40+ 23- 23-: 0 -1 1) (40+ 23- 40+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 1 0 0) (81+ 46- 46-: -2 0 0) [2 1 1] 0 3 (23- 23- 23-: 0 -1 0) (40+ 23- 23-: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 0 0 1) (46- 46- 81+: 0 0 -2) [1 1 2] 0 3 (23- 23- 23-: 0 -1 0) (23- 23- 40+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 46- 81+: 1 0 0) (81+ 46- 81+: -2 0 0) [2 1 1] 0 3 (23- 23- 40+: 0 -1 0) (40+ 23- 40+: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (81+ 46- 46-: 0 0 1) (81+ 46- 81+: 0 0 -2) [1 1 2] 0 3 (40+ 23- 23-: 0 -1 0) (40+ 23- 40+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 81+ 46-: 2 0 0) (81+ 81+ 46-: -1 0 0) [2 1 1] 0 3 (23- 40+ 23-: 1 1 0) (40+ 40+ 23-: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 81+ 46-: 0 0 2) (46- 81+ 81+: 0 0 -1) [1 1 2] 0 3 (23- 40+ 23-: 0 1 1) (23- 40+ 40+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 81+ 81+: 2 0 0) (81+ 81+ 81+: -1 0 0) [2 1 1] 0 3 (23- 40+ 40+: 1 1 0) (40+ 40+ 40+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (81+ 81+ 46-: 0 0 2) (81+ 81+ 81+: 0 0 -1) [1 1 2] 0 3 (40+ 40+ 23-: 0 1 1) (40+ 40+ 40+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 81+ 46-: 1 0 0) (81+ 81+ 46-: -2 0 0) [2 1 1] 0 3 (23- 40+ 23-: 0 1 0) (40+ 40+ 23-: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 81+ 46-: 0 0 1) (46- 81+ 81+: 0 0 -2) [1 1 2] 0 3 (23- 40+ 23-: 0 1 0) (23- 40+ 40+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 81+ 81+: 1 0 0) (81+ 81+ 81+: -2 0 0) [2 1 1] 0 3 (23- 40+ 40+: 0 1 0) (40+ 40+ 40+: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (81+ 81+ 46-: 0 0 1) (81+ 81+ 81+: 0 0 -2) [1 1 2] 0 3 (40+ 40+ 23-: 0 1 0) (40+ 40+ 40+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 0 0 0) (46- 46- 46-: 0 0 0) [1 1 1] 0 3 (23- 23- 23-: 0 -1 0) (23- 23- 23-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 4 (81+ 46- 46-: 0 0 0) (81+ 46- 46-: 0 0 0) [1 1 1] 0 3 (40+ 23- 23-: 0 -1 0) (40+ 23- 23-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 4 (46- 46- 81+: 0 0 0) (46- 46- 81+: 0 0 0) [1 1 1] 0 3 (23- 23- 40+: 0 -1 0) (23- 23- 40+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 4 (81+ 46- 81+: 0 0 0) (81+ 46- 81+: 0 0 0) [1 1 1] 0 3 (40+ 23- 40+: 0 -1 0) (40+ 23- 40+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 4 (46- 81+ 46-: 0 0 0) (46- 81+ 46-: 0 0 0) [1 1 1] 0 3 (23- 40+ 23-: 0 1 0) (23- 40+ 23-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 4 (81+ 81+ 46-: 0 0 0) (81+ 81+ 46-: 0 0 0) [1 1 1] 0 3 (40+ 40+ 23-: 0 1 0) (40+ 40+ 23-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 4 (46- 81+ 81+: 0 0 0) (46- 81+ 81+: 0 0 0) [1 1 1] 0 3 (23- 40+ 40+: 0 1 0) (23- 40+ 40+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 4 (81+ 81+ 81+: 0 0 0) (81+ 81+ 81+: 0 0 0) [1 1 1] 0 3 (40+ 40+ 40+: 0 1 0) (40+ 40+ 40+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 0 0 1) (98- 121+ 121+: 0 -1 -2) [1 2 2] 0 4 (49- 49- 49-: -1 0 0) (49- 60+ 60+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 0 1 1) (98- 121+ 121+: 0 0 -2) [1 2 2] 0 4 (49- 49- 49-: -1 0 0) (49- 60+ 60+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 0 0 2) (98- 121+ 121+: 0 -1 -1) [1 2 2] 0 4 (49- 49- 49-: -1 0 1) (49- 60+ 60+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 0 1 2) (98- 121+ 121+: 0 0 -1) [1 2 2] 0 4 (49- 49- 49-: -1 0 1) (49- 60+ 60+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (121+ 98- 98-: 0 0 2) (121+ 121+ 121+: 0 -1 -1) [1 2 2] 0 4 (60+ 49- 49-: 1 0 1) (60+ 60+ 60+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (121+ 98- 98-: 0 1 2) (121+ 121+ 121+: 0 0 -1) [1 2 2] 0 4 (60+ 49- 49-: 1 0 1) (60+ 60+ 60+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (121+ 98- 98-: 0 0 1) (121+ 121+ 121+: 0 -1 -2) [1 2 2] 0 4 (60+ 49- 49-: 1 0 0) (60+ 60+ 60+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (121+ 98- 98-: 0 1 1) (121+ 121+ 121+: 0 0 -2) [1 2 2] 0 4 (60+ 49- 49-: 1 0 0) (60+ 60+ 60+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 2 0 1) (121+ 98- 121+: -1 0 -2) [2 1 2] 0 4 (49- 49- 49-: 1 -1 0) (60+ 49- 60+: 0 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 2 0 2) (121+ 98- 121+: -1 0 -1) [2 1 2] 0 4 (49- 49- 49-: 1 -1 1) (60+ 49- 60+: 0 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 1 0 1) (121+ 98- 121+: -2 0 -2) [2 1 2] 0 4 (49- 49- 49-: 0 -1 0) (60+ 49- 60+: -1 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 1 0 2) (121+ 98- 121+: -2 0 -1) [2 1 2] 0 4 (49- 49- 49-: 0 -1 1) (60+ 49- 60+: -1 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 121+ 98-: 2 0 2) (121+ 121+ 121+: -1 0 -1) [2 1 2] 0 4 (49- 60+ 49-: 1 1 1) (60+ 60+ 60+: 0 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 121+ 98-: 2 0 1) (121+ 121+ 121+: -1 0 -2) [2 1 2] 0 4 (49- 60+ 49-: 1 1 0) (60+ 60+ 60+: 0 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 121+ 98-: 1 0 2) (121+ 121+ 121+: -2 0 -1) [2 1 2] 0 4 (49- 60+ 49-: 0 1 1) (60+ 60+ 60+: -1 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 121+ 98-: 1 0 1) (121+ 121+ 121+: -2 0 -2) [2 1 2] 0 4 (49- 60+ 49-: 0 1 0) (60+ 60+ 60+: -1 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 0 0 0) (121+ 121+ 98-: -1 -1 0) [2 2 1] 0 4 (49- 49- 49-: 0 0 -1) (60+ 60+ 49-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 0 1 0) (121+ 121+ 98-: -1 0 0) [2 2 1] 0 4 (49- 49- 49-: 0 0 -1) (60+ 60+ 49-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 1 0 0) (121+ 121+ 98-: 0 -1 0) [2 2 1] 0 4 (49- 49- 49-: 0 0 -1) (60+ 60+ 49-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 1 1 0) (121+ 121+ 98-: 0 0 0) [2 2 1] 0 4 (49- 49- 49-: 0 0 -1) (60+ 60+ 49-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 98- 121+: 1 0 0) (121+ 121+ 121+: 0 -1 0) [2 2 1] 0 4 (49- 49- 60+: 0 0 1) (60+ 60+ 60+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 98- 121+: 1 1 0) (121+ 121+ 121+: 0 0 0) [2 2 1] 0 4 (49- 49- 60+: 0 0 1) (60+ 60+ 60+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 98- 121+: 0 0 0) (121+ 121+ 121+: -1 -1 0) [2 2 1] 0 4 (49- 49- 60+: 0 0 1) (60+ 60+ 60+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 98- 121+: 0 1 0) (121+ 121+ 121+: -1 0 0) [2 2 1] 0 4 (49- 49- 60+: 0 0 1) (60+ 60+ 60+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 0 0 0) (98- 121+ 98-: 0 -1 0) [1 2 1] 0 4 (49- 49- 49-: -1 0 0) (49- 60+ 49-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 0 1 0) (98- 121+ 98-: 0 0 0) [1 2 1] 0 4 (49- 49- 49-: -1 0 0) (49- 60+ 49-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (121+ 98- 121+: 0 0 0) (121+ 121+ 121+: 0 -1 0) [1 2 1] 0 4 (60+ 49- 60+: 1 0 0) (60+ 60+ 60+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (121+ 98- 121+: 0 1 0) (121+ 121+ 121+: 0 0 0) [1 2 1] 0 4 (60+ 49- 60+: 1 0 0) (60+ 60+ 60+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (121+ 98- 98-: 0 0 0) (121+ 121+ 98-: 0 -1 0) [1 2 1] 0 4 (60+ 49- 49-: 1 0 0) (60+ 60+ 49-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (121+ 98- 98-: 0 1 0) (121+ 121+ 98-: 0 0 0) [1 2 1] 0 4 (60+ 49- 49-: 1 0 0) (60+ 60+ 49-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 98- 121+: 0 0 0) (98- 121+ 121+: 0 -1 0) [1 2 1] 0 4 (49- 49- 60+: -1 0 0) (49- 60+ 60+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 98- 121+: 0 1 0) (98- 121+ 121+: 0 0 0) [1 2 1] 0 4 (49- 49- 60+: -1 0 0) (49- 60+ 60+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 2 0 0) (121+ 98- 98-: -1 0 0) [2 1 1] 0 4 (49- 49- 49-: 1 -1 0) (60+ 49- 49-: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 0 0 2) (98- 98- 121+: 0 0 -1) [1 1 2] 0 4 (49- 49- 49-: 0 -1 1) (49- 49- 60+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 98- 121+: 2 0 0) (121+ 98- 121+: -1 0 0) [2 1 1] 0 4 (49- 49- 60+: 1 -1 0) (60+ 49- 60+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (121+ 98- 98-: 0 0 2) (121+ 98- 121+: 0 0 -1) [1 1 2] 0 4 (60+ 49- 49-: 0 -1 1) (60+ 49- 60+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 1 0 0) (121+ 98- 98-: -2 0 0) [2 1 1] 0 4 (49- 49- 49-: 0 -1 0) (60+ 49- 49-: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 0 0 1) (98- 98- 121+: 0 0 -2) [1 1 2] 0 4 (49- 49- 49-: 0 -1 0) (49- 49- 60+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 98- 121+: 1 0 0) (121+ 98- 121+: -2 0 0) [2 1 1] 0 4 (49- 49- 60+: 0 -1 0) (60+ 49- 60+: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (121+ 98- 98-: 0 0 1) (121+ 98- 121+: 0 0 -2) [1 1 2] 0 4 (60+ 49- 49-: 0 -1 0) (60+ 49- 60+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 121+ 98-: 2 0 0) (121+ 121+ 98-: -1 0 0) [2 1 1] 0 4 (49- 60+ 49-: 1 1 0) (60+ 60+ 49-: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 121+ 98-: 0 0 2) (98- 121+ 121+: 0 0 -1) [1 1 2] 0 4 (49- 60+ 49-: 0 1 1) (49- 60+ 60+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 121+ 121+: 2 0 0) (121+ 121+ 121+: -1 0 0) [2 1 1] 0 4 (49- 60+ 60+: 1 1 0) (60+ 60+ 60+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (121+ 121+ 98-: 0 0 2) (121+ 121+ 121+: 0 0 -1) [1 1 2] 0 4 (60+ 60+ 49-: 0 1 1) (60+ 60+ 60+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 121+ 98-: 1 0 0) (121+ 121+ 98-: -2 0 0) [2 1 1] 0 4 (49- 60+ 49-: 0 1 0) (60+ 60+ 49-: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 121+ 98-: 0 0 1) (98- 121+ 121+: 0 0 -2) [1 1 2] 0 4 (49- 60+ 49-: 0 1 0) (49- 60+ 60+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 121+ 121+: 1 0 0) (121+ 121+ 121+: -2 0 0) [2 1 1] 0 4 (49- 60+ 60+: 0 1 0) (60+ 60+ 60+: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (121+ 121+ 98-: 0 0 1) (121+ 121+ 121+: 0 0 -2) [1 1 2] 0 4 (60+ 60+ 49-: 0 1 0) (60+ 60+ 60+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 0 0 0) (98- 98- 98-: 0 0 0) [1 1 1] 0 4 (49- 49- 49-: 0 -1 0) (49- 49- 49-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 5 (121+ 98- 98-: 0 0 0) (121+ 98- 98-: 0 0 0) [1 1 1] 0 4 (60+ 49- 49-: 0 -1 0) (60+ 49- 49-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 5 (98- 98- 121+: 0 0 0) (98- 98- 121+: 0 0 0) [1 1 1] 0 4 (49- 49- 60+: 0 -1 0) (49- 49- 60+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 5 (121+ 98- 121+: 0 0 0) (121+ 98- 121+: 0 0 0) [1 1 1] 0 4 (60+ 49- 60+: 0 -1 0) (60+ 49- 60+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 5 (98- 121+ 98-: 0 0 0) (98- 121+ 98-: 0 0 0) [1 1 1] 0 4 (49- 60+ 49-: 0 1 0) (49- 60+ 49-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 5 (121+ 121+ 98-: 0 0 0) (121+ 121+ 98-: 0 0 0) [1 1 1] 0 4 (60+ 60+ 49-: 0 1 0) (60+ 60+ 49-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 5 (98- 121+ 121+: 0 0 0) (98- 121+ 121+: 0 0 0) [1 1 1] 0 4 (49- 60+ 60+: 0 1 0) (49- 60+ 60+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 5 (121+ 121+ 121+: 0 0 0) (121+ 121+ 121+: 0 0 0) [1 1 1] 0 4 (60+ 60+ 60+: 0 1 0) (60+ 60+ 60+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -############################################################# -FacParts: 0 0 [1 1 1] -FacParts: 1 1 [2 2 2] -FacParts: 2 2 [2 2 2] -FacParts: 3 3 [2 2 2] -FacParts: 4 4 [2 2 2] -FacParts: 5 5 [2 2 2] - -ProcessPoolCreate: 1 - -# ProcessPoolSetPart: pool part -ProcessPoolSetPart: 0 0 -ProcessPoolSetPart: 0 1 -ProcessPoolSetPart: 0 2 -ProcessPoolSetPart: 0 3 -ProcessPoolSetPart: 0 4 -ProcessPoolSetPart: 0 5 diff --git a/src/test/TEST_fac/7lev.in b/src/test/TEST_fac/7lev.in deleted file mode 100644 index b01a036e71..0000000000 --- a/src/test/TEST_fac/7lev.in +++ /dev/null @@ -1,572 +0,0 @@ -# Copyright (c) 1998 Lawrence Livermore 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 7 -############################################################# -# GridSetExtents: part ilower(ndim) iupper(ndim) -GridSetExtents: 0 (1- 1- 1-) (8+ 8+ 8+) -GridSetExtents: 1 (4- 4- 4-) (13+ 13+ 13+) -GridSetExtents: 2 (10- 10- 10-) (23+ 23+ 23+) -GridSetExtents: 3 (22- 22- 22-) (43+ 43+ 43+) -GridSetExtents: 4 (46- 46- 46-) (81+ 81+ 81+) -GridSetExtents: 5 (98- 98- 98-) (121+ 121+ 121+) -GridSetExtents: 6 (200- 200- 200-) (231+ 231+ 231+) -############################################################# - -# GridSetVariables: part nvars vartypes[nvars] -# CELL = 0 -# NODE = 1 -# XFACE = 2 -# YFACE = 3 -# ZFACE = 4 -# XEDGE = 5 -# YEDGE = 6 -# ZEDGE = 7 - -GridSetVariables: 0 1 [0] -GridSetVariables: 1 1 [0] -GridSetVariables: 2 1 [0] -GridSetVariables: 3 1 [0] -GridSetVariables: 4 1 [0] -GridSetVariables: 5 1 [0] -GridSetVariables: 6 1 [0] -############################################################# - -# StencilCreate: nstencils sizes[nstencils] -StencilCreate: 1 [7] -############################################################# - -# StencilSetEntry: stencil_num entry offset[ndim] var value -StencilSetEntry: 0 0 [ 0 0 0] 0 6.000000 -StencilSetEntry: 0 1 [-1 0 0] 0 -1.000000 -StencilSetEntry: 0 2 [ 1 0 0] 0 -1.000000 -StencilSetEntry: 0 3 [ 0 -1 0] 0 -1.000000 -StencilSetEntry: 0 4 [ 0 0 1] 0 -1.000000 -StencilSetEntry: 0 5 [ 0 0 -1] 0 -1.000000 -StencilSetEntry: 0 6 [ 0 1 0] 0 -1.000000 -############################################################# - -# GraphSetStencil: part var stencil_num -GraphSetStencil: 0 0 0 -GraphSetStencil: 1 0 0 -GraphSetStencil: 2 0 0 -GraphSetStencil: 3 0 0 -GraphSetStencil: 4 0 0 -GraphSetStencil: 5 0 0 -GraphSetStencil: 6 0 0 -############################################################# - -# GraphAddEntries: \ - -# part ilower(ndim) iupper(ndim) stride[ndim] var \ - -# to_part to_ilower(ndim) to_iupper(ndim) to_stride[ndim] to_var \ - -# index_map[ndim] entry value -GraphAddEntries: 0 (2- 2- 2-: -1 0 0) (2- 6+ 6+: -1 0 0) [1 1 1] 0 1 (4- 4- 4-: 0 0 1) (4- 13+ 13+: 0 -1 0) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: -1 0 0) (2- 6+ 6+: -1 0 0) [1 1 1] 0 1 (4- 4- 4-: 0 1 1) (4- 13+ 13+: 0 0 0) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: -1 0 0) (2- 6+ 6+: -1 0 0) [1 1 1] 0 1 (4- 4- 4-: 0 0 0) (4- 13+ 13+: 0 -1 -1) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: -1 0 0) (2- 6+ 6+: -1 0 0) [1 1 1] 0 1 (4- 4- 4-: 0 1 0) (4- 13+ 13+: 0 0 -1) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (6+ 2- 2-: 1 0 0) (6+ 6+ 6+: 1 0 0) [1 1 1] 0 1 (13+ 4- 4-: 0 0 0) (13+ 13+ 13+: 0 -1 -1) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (6+ 2- 2-: 1 0 0) (6+ 6+ 6+: 1 0 0) [1 1 1] 0 1 (13+ 4- 4-: 0 1 0) (13+ 13+ 13+: 0 0 -1) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (6+ 2- 2-: 1 0 0) (6+ 6+ 6+: 1 0 0) [1 1 1] 0 1 (13+ 4- 4-: 0 0 1) (13+ 13+ 13+: 0 -1 0) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (6+ 2- 2-: 1 0 0) (6+ 6+ 6+: 1 0 0) [1 1 1] 0 1 (13+ 4- 4-: 0 1 1) (13+ 13+ 13+: 0 0 0) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 -1 0) (6+ 2- 6+: 0 -1 0) [1 1 1] 0 1 (4- 4- 4-: 0 0 1) (13+ 4- 13+: -1 0 0) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 -1 0) (6+ 2- 6+: 0 -1 0) [1 1 1] 0 1 (4- 4- 4-: 0 0 0) (13+ 4- 13+: -1 0 -1) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 -1 0) (6+ 2- 6+: 0 -1 0) [1 1 1] 0 1 (4- 4- 4-: 1 0 1) (13+ 4- 13+: 0 0 0) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 -1 0) (6+ 2- 6+: 0 -1 0) [1 1 1] 0 1 (4- 4- 4-: 1 0 0) (13+ 4- 13+: 0 0 -1) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (2- 6+ 2-: 0 1 0) (6+ 6+ 6+: 0 1 0) [1 1 1] 0 1 (4- 13+ 4-: 0 0 0) (13+ 13+ 13+: -1 0 -1) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (2- 6+ 2-: 0 1 0) (6+ 6+ 6+: 0 1 0) [1 1 1] 0 1 (4- 13+ 4-: 0 0 1) (13+ 13+ 13+: -1 0 0) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (2- 6+ 2-: 0 1 0) (6+ 6+ 6+: 0 1 0) [1 1 1] 0 1 (4- 13+ 4-: 1 0 0) (13+ 13+ 13+: 0 0 -1) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (2- 6+ 2-: 0 1 0) (6+ 6+ 6+: 0 1 0) [1 1 1] 0 1 (4- 13+ 4-: 1 0 1) (13+ 13+ 13+: 0 0 0) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 0 -1) (6+ 6+ 2-: 0 0 -1) [1 1 1] 0 1 (4- 4- 4-: 0 0 0) (13+ 13+ 4-: -1 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 0 -1) (6+ 6+ 2-: 0 0 -1) [1 1 1] 0 1 (4- 4- 4-: 0 1 0) (13+ 13+ 4-: -1 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 0 -1) (6+ 6+ 2-: 0 0 -1) [1 1 1] 0 1 (4- 4- 4-: 1 0 0) (13+ 13+ 4-: 0 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (2- 2- 2-: 0 0 -1) (6+ 6+ 2-: 0 0 -1) [1 1 1] 0 1 (4- 4- 4-: 1 1 0) (13+ 13+ 4-: 0 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 0 (2- 2- 6+: 0 0 1) (6+ 6+ 6+: 0 0 1) [1 1 1] 0 1 (4- 4- 13+: 1 0 0) (13+ 13+ 13+: 0 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 0 (2- 2- 6+: 0 0 1) (6+ 6+ 6+: 0 0 1) [1 1 1] 0 1 (4- 4- 13+: 1 1 0) (13+ 13+ 13+: 0 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 0 (2- 2- 6+: 0 0 1) (6+ 6+ 6+: 0 0 1) [1 1 1] 0 1 (4- 4- 13+: 0 0 0) (13+ 13+ 13+: -1 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 0 (2- 2- 6+: 0 0 1) (6+ 6+ 6+: 0 0 1) [1 1 1] 0 1 (4- 4- 13+: 0 1 0) (13+ 13+ 13+: -1 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 1) (4- 13+ 13+: 0 -1 -2) [1 2 2] 0 0 (2- 2- 2-: -1 0 0) (2- 6+ 6+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 1 1) (4- 13+ 13+: 0 0 -2) [1 2 2] 0 0 (2- 2- 2-: -1 0 0) (2- 6+ 6+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 2) (4- 13+ 13+: 0 -1 -1) [1 2 2] 0 0 (2- 2- 2-: -1 0 1) (2- 6+ 6+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 1 2) (4- 13+ 13+: 0 0 -1) [1 2 2] 0 0 (2- 2- 2-: -1 0 1) (2- 6+ 6+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (13+ 4- 4-: 0 0 2) (13+ 13+ 13+: 0 -1 -1) [1 2 2] 0 0 (6+ 2- 2-: 1 0 1) (6+ 6+ 6+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (13+ 4- 4-: 0 1 2) (13+ 13+ 13+: 0 0 -1) [1 2 2] 0 0 (6+ 2- 2-: 1 0 1) (6+ 6+ 6+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (13+ 4- 4-: 0 0 1) (13+ 13+ 13+: 0 -1 -2) [1 2 2] 0 0 (6+ 2- 2-: 1 0 0) (6+ 6+ 6+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (13+ 4- 4-: 0 1 1) (13+ 13+ 13+: 0 0 -2) [1 2 2] 0 0 (6+ 2- 2-: 1 0 0) (6+ 6+ 6+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 2 0 1) (13+ 4- 13+: -1 0 -2) [2 1 2] 0 0 (2- 2- 2-: 1 -1 0) (6+ 2- 6+: 0 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 2 0 2) (13+ 4- 13+: -1 0 -1) [2 1 2] 0 0 (2- 2- 2-: 1 -1 1) (6+ 2- 6+: 0 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 1 0 1) (13+ 4- 13+: -2 0 -2) [2 1 2] 0 0 (2- 2- 2-: 0 -1 0) (6+ 2- 6+: -1 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 1 0 2) (13+ 4- 13+: -2 0 -1) [2 1 2] 0 0 (2- 2- 2-: 0 -1 1) (6+ 2- 6+: -1 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 13+ 4-: 2 0 2) (13+ 13+ 13+: -1 0 -1) [2 1 2] 0 0 (2- 6+ 2-: 1 1 1) (6+ 6+ 6+: 0 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 13+ 4-: 2 0 1) (13+ 13+ 13+: -1 0 -2) [2 1 2] 0 0 (2- 6+ 2-: 1 1 0) (6+ 6+ 6+: 0 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 13+ 4-: 1 0 2) (13+ 13+ 13+: -2 0 -1) [2 1 2] 0 0 (2- 6+ 2-: 0 1 1) (6+ 6+ 6+: -1 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 13+ 4-: 1 0 1) (13+ 13+ 13+: -2 0 -2) [2 1 2] 0 0 (2- 6+ 2-: 0 1 0) (6+ 6+ 6+: -1 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 0) (13+ 13+ 4-: -1 -1 0) [2 2 1] 0 0 (2- 2- 2-: 0 0 -1) (6+ 6+ 2-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 1 0) (13+ 13+ 4-: -1 0 0) [2 2 1] 0 0 (2- 2- 2-: 0 0 -1) (6+ 6+ 2-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 1 0 0) (13+ 13+ 4-: 0 -1 0) [2 2 1] 0 0 (2- 2- 2-: 0 0 -1) (6+ 6+ 2-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 1 1 0) (13+ 13+ 4-: 0 0 0) [2 2 1] 0 0 (2- 2- 2-: 0 0 -1) (6+ 6+ 2-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 13+: 1 0 0) (13+ 13+ 13+: 0 -1 0) [2 2 1] 0 0 (2- 2- 6+: 0 0 1) (6+ 6+ 6+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 13+: 1 1 0) (13+ 13+ 13+: 0 0 0) [2 2 1] 0 0 (2- 2- 6+: 0 0 1) (6+ 6+ 6+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 13+: 0 0 0) (13+ 13+ 13+: -1 -1 0) [2 2 1] 0 0 (2- 2- 6+: 0 0 1) (6+ 6+ 6+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (4- 4- 13+: 0 1 0) (13+ 13+ 13+: -1 0 0) [2 2 1] 0 0 (2- 2- 6+: 0 0 1) (6+ 6+ 6+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 1 (5- 5- 5-: -1 0 0) (5- 11+ 11+: -1 0 0) [1 1 1] 0 2 (10- 10- 10-: 0 0 1) (10- 23+ 23+: 0 -1 0) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: -1 0 0) (5- 11+ 11+: -1 0 0) [1 1 1] 0 2 (10- 10- 10-: 0 1 1) (10- 23+ 23+: 0 0 0) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: -1 0 0) (5- 11+ 11+: -1 0 0) [1 1 1] 0 2 (10- 10- 10-: 0 0 0) (10- 23+ 23+: 0 -1 -1) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: -1 0 0) (5- 11+ 11+: -1 0 0) [1 1 1] 0 2 (10- 10- 10-: 0 1 0) (10- 23+ 23+: 0 0 -1) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (11+ 5- 5-: 1 0 0) (11+ 11+ 11+: 1 0 0) [1 1 1] 0 2 (23+ 10- 10-: 0 0 0) (23+ 23+ 23+: 0 -1 -1) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (11+ 5- 5-: 1 0 0) (11+ 11+ 11+: 1 0 0) [1 1 1] 0 2 (23+ 10- 10-: 0 1 0) (23+ 23+ 23+: 0 0 -1) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (11+ 5- 5-: 1 0 0) (11+ 11+ 11+: 1 0 0) [1 1 1] 0 2 (23+ 10- 10-: 0 0 1) (23+ 23+ 23+: 0 -1 0) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (11+ 5- 5-: 1 0 0) (11+ 11+ 11+: 1 0 0) [1 1 1] 0 2 (23+ 10- 10-: 0 1 1) (23+ 23+ 23+: 0 0 0) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 -1 0) (11+ 5- 11+: 0 -1 0) [1 1 1] 0 2 (10- 10- 10-: 0 0 1) (23+ 10- 23+: -1 0 0) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 -1 0) (11+ 5- 11+: 0 -1 0) [1 1 1] 0 2 (10- 10- 10-: 0 0 0) (23+ 10- 23+: -1 0 -1) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 -1 0) (11+ 5- 11+: 0 -1 0) [1 1 1] 0 2 (10- 10- 10-: 1 0 1) (23+ 10- 23+: 0 0 0) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 -1 0) (11+ 5- 11+: 0 -1 0) [1 1 1] 0 2 (10- 10- 10-: 1 0 0) (23+ 10- 23+: 0 0 -1) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (5- 11+ 5-: 0 1 0) (11+ 11+ 11+: 0 1 0) [1 1 1] 0 2 (10- 23+ 10-: 0 0 0) (23+ 23+ 23+: -1 0 -1) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (5- 11+ 5-: 0 1 0) (11+ 11+ 11+: 0 1 0) [1 1 1] 0 2 (10- 23+ 10-: 0 0 1) (23+ 23+ 23+: -1 0 0) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (5- 11+ 5-: 0 1 0) (11+ 11+ 11+: 0 1 0) [1 1 1] 0 2 (10- 23+ 10-: 1 0 0) (23+ 23+ 23+: 0 0 -1) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (5- 11+ 5-: 0 1 0) (11+ 11+ 11+: 0 1 0) [1 1 1] 0 2 (10- 23+ 10-: 1 0 1) (23+ 23+ 23+: 0 0 0) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 0 -1) (11+ 11+ 5-: 0 0 -1) [1 1 1] 0 2 (10- 10- 10-: 0 0 0) (23+ 23+ 10-: -1 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 0 -1) (11+ 11+ 5-: 0 0 -1) [1 1 1] 0 2 (10- 10- 10-: 0 1 0) (23+ 23+ 10-: -1 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 0 -1) (11+ 11+ 5-: 0 0 -1) [1 1 1] 0 2 (10- 10- 10-: 1 0 0) (23+ 23+ 10-: 0 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (5- 5- 5-: 0 0 -1) (11+ 11+ 5-: 0 0 -1) [1 1 1] 0 2 (10- 10- 10-: 1 1 0) (23+ 23+ 10-: 0 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (5- 5- 11+: 0 0 1) (11+ 11+ 11+: 0 0 1) [1 1 1] 0 2 (10- 10- 23+: 1 0 0) (23+ 23+ 23+: 0 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 1 (5- 5- 11+: 0 0 1) (11+ 11+ 11+: 0 0 1) [1 1 1] 0 2 (10- 10- 23+: 1 1 0) (23+ 23+ 23+: 0 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 1 (5- 5- 11+: 0 0 1) (11+ 11+ 11+: 0 0 1) [1 1 1] 0 2 (10- 10- 23+: 0 0 0) (23+ 23+ 23+: -1 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 1 (5- 5- 11+: 0 0 1) (11+ 11+ 11+: 0 0 1) [1 1 1] 0 2 (10- 10- 23+: 0 1 0) (23+ 23+ 23+: -1 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 0) (4- 13+ 4-: 0 -1 0) [1 2 1] 0 0 (2- 2- 2-: -1 0 0) (2- 6+ 2-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 1 0) (4- 13+ 4-: 0 0 0) [1 2 1] 0 0 (2- 2- 2-: -1 0 0) (2- 6+ 2-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (13+ 4- 13+: 0 0 0) (13+ 13+ 13+: 0 -1 0) [1 2 1] 0 0 (6+ 2- 6+: 1 0 0) (6+ 6+ 6+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (13+ 4- 13+: 0 1 0) (13+ 13+ 13+: 0 0 0) [1 2 1] 0 0 (6+ 2- 6+: 1 0 0) (6+ 6+ 6+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (13+ 4- 4-: 0 0 0) (13+ 13+ 4-: 0 -1 0) [1 2 1] 0 0 (6+ 2- 2-: 1 0 0) (6+ 6+ 2-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (13+ 4- 4-: 0 1 0) (13+ 13+ 4-: 0 0 0) [1 2 1] 0 0 (6+ 2- 2-: 1 0 0) (6+ 6+ 2-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 13+: 0 0 0) (4- 13+ 13+: 0 -1 0) [1 2 1] 0 0 (2- 2- 6+: -1 0 0) (2- 6+ 6+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 13+: 0 1 0) (4- 13+ 13+: 0 0 0) [1 2 1] 0 0 (2- 2- 6+: -1 0 0) (2- 6+ 6+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 2 0 0) (13+ 4- 4-: -1 0 0) [2 1 1] 0 0 (2- 2- 2-: 1 -1 0) (6+ 2- 2-: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 2) (4- 4- 13+: 0 0 -1) [1 1 2] 0 0 (2- 2- 2-: 0 -1 1) (2- 2- 6+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 13+: 2 0 0) (13+ 4- 13+: -1 0 0) [2 1 1] 0 0 (2- 2- 6+: 1 -1 0) (6+ 2- 6+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (13+ 4- 4-: 0 0 2) (13+ 4- 13+: 0 0 -1) [1 1 2] 0 0 (6+ 2- 2-: 0 -1 1) (6+ 2- 6+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 1 0 0) (13+ 4- 4-: -2 0 0) [2 1 1] 0 0 (2- 2- 2-: 0 -1 0) (6+ 2- 2-: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 1) (4- 4- 13+: 0 0 -2) [1 1 2] 0 0 (2- 2- 2-: 0 -1 0) (2- 2- 6+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 13+: 1 0 0) (13+ 4- 13+: -2 0 0) [2 1 1] 0 0 (2- 2- 6+: 0 -1 0) (6+ 2- 6+: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (13+ 4- 4-: 0 0 1) (13+ 4- 13+: 0 0 -2) [1 1 2] 0 0 (6+ 2- 2-: 0 -1 0) (6+ 2- 6+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 13+ 4-: 2 0 0) (13+ 13+ 4-: -1 0 0) [2 1 1] 0 0 (2- 6+ 2-: 1 1 0) (6+ 6+ 2-: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 13+ 4-: 0 0 2) (4- 13+ 13+: 0 0 -1) [1 1 2] 0 0 (2- 6+ 2-: 0 1 1) (2- 6+ 6+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 13+ 13+: 2 0 0) (13+ 13+ 13+: -1 0 0) [2 1 1] 0 0 (2- 6+ 6+: 1 1 0) (6+ 6+ 6+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (13+ 13+ 4-: 0 0 2) (13+ 13+ 13+: 0 0 -1) [1 1 2] 0 0 (6+ 6+ 2-: 0 1 1) (6+ 6+ 6+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 13+ 4-: 1 0 0) (13+ 13+ 4-: -2 0 0) [2 1 1] 0 0 (2- 6+ 2-: 0 1 0) (6+ 6+ 2-: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 13+ 4-: 0 0 1) (4- 13+ 13+: 0 0 -2) [1 1 2] 0 0 (2- 6+ 2-: 0 1 0) (2- 6+ 6+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 13+ 13+: 1 0 0) (13+ 13+ 13+: -2 0 0) [2 1 1] 0 0 (2- 6+ 6+: 0 1 0) (6+ 6+ 6+: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (13+ 13+ 4-: 0 0 1) (13+ 13+ 13+: 0 0 -2) [1 1 2] 0 0 (6+ 6+ 2-: 0 1 0) (6+ 6+ 6+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 1 (4- 4- 4-: 0 0 0) (4- 4- 4-: 0 0 0) [1 1 1] 0 0 (2- 2- 2-: 0 -1 0) (2- 2- 2-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (13+ 4- 4-: 0 0 0) (13+ 4- 4-: 0 0 0) [1 1 1] 0 0 (6+ 2- 2-: 0 -1 0) (6+ 2- 2-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (4- 4- 13+: 0 0 0) (4- 4- 13+: 0 0 0) [1 1 1] 0 0 (2- 2- 6+: 0 -1 0) (2- 2- 6+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (13+ 4- 13+: 0 0 0) (13+ 4- 13+: 0 0 0) [1 1 1] 0 0 (6+ 2- 6+: 0 -1 0) (6+ 2- 6+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (4- 13+ 4-: 0 0 0) (4- 13+ 4-: 0 0 0) [1 1 1] 0 0 (2- 6+ 2-: 0 1 0) (2- 6+ 2-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (13+ 13+ 4-: 0 0 0) (13+ 13+ 4-: 0 0 0) [1 1 1] 0 0 (6+ 6+ 2-: 0 1 0) (6+ 6+ 2-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (4- 13+ 13+: 0 0 0) (4- 13+ 13+: 0 0 0) [1 1 1] 0 0 (2- 6+ 6+: 0 1 0) (2- 6+ 6+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 1 (13+ 13+ 13+: 0 0 0) (13+ 13+ 13+: 0 0 0) [1 1 1] 0 0 (6+ 6+ 6+: 0 1 0) (6+ 6+ 6+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 1) (10- 23+ 23+: 0 -1 -2) [1 2 2] 0 1 (5- 5- 5-: -1 0 0) (5- 11+ 11+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 1 1) (10- 23+ 23+: 0 0 -2) [1 2 2] 0 1 (5- 5- 5-: -1 0 0) (5- 11+ 11+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 2) (10- 23+ 23+: 0 -1 -1) [1 2 2] 0 1 (5- 5- 5-: -1 0 1) (5- 11+ 11+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 1 2) (10- 23+ 23+: 0 0 -1) [1 2 2] 0 1 (5- 5- 5-: -1 0 1) (5- 11+ 11+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (23+ 10- 10-: 0 0 2) (23+ 23+ 23+: 0 -1 -1) [1 2 2] 0 1 (11+ 5- 5-: 1 0 1) (11+ 11+ 11+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (23+ 10- 10-: 0 1 2) (23+ 23+ 23+: 0 0 -1) [1 2 2] 0 1 (11+ 5- 5-: 1 0 1) (11+ 11+ 11+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (23+ 10- 10-: 0 0 1) (23+ 23+ 23+: 0 -1 -2) [1 2 2] 0 1 (11+ 5- 5-: 1 0 0) (11+ 11+ 11+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (23+ 10- 10-: 0 1 1) (23+ 23+ 23+: 0 0 -2) [1 2 2] 0 1 (11+ 5- 5-: 1 0 0) (11+ 11+ 11+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 2 0 1) (23+ 10- 23+: -1 0 -2) [2 1 2] 0 1 (5- 5- 5-: 1 -1 0) (11+ 5- 11+: 0 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 2 0 2) (23+ 10- 23+: -1 0 -1) [2 1 2] 0 1 (5- 5- 5-: 1 -1 1) (11+ 5- 11+: 0 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 1 0 1) (23+ 10- 23+: -2 0 -2) [2 1 2] 0 1 (5- 5- 5-: 0 -1 0) (11+ 5- 11+: -1 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 1 0 2) (23+ 10- 23+: -2 0 -1) [2 1 2] 0 1 (5- 5- 5-: 0 -1 1) (11+ 5- 11+: -1 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 23+ 10-: 2 0 2) (23+ 23+ 23+: -1 0 -1) [2 1 2] 0 1 (5- 11+ 5-: 1 1 1) (11+ 11+ 11+: 0 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 23+ 10-: 2 0 1) (23+ 23+ 23+: -1 0 -2) [2 1 2] 0 1 (5- 11+ 5-: 1 1 0) (11+ 11+ 11+: 0 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 23+ 10-: 1 0 2) (23+ 23+ 23+: -2 0 -1) [2 1 2] 0 1 (5- 11+ 5-: 0 1 1) (11+ 11+ 11+: -1 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 23+ 10-: 1 0 1) (23+ 23+ 23+: -2 0 -2) [2 1 2] 0 1 (5- 11+ 5-: 0 1 0) (11+ 11+ 11+: -1 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 0) (23+ 23+ 10-: -1 -1 0) [2 2 1] 0 1 (5- 5- 5-: 0 0 -1) (11+ 11+ 5-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 1 0) (23+ 23+ 10-: -1 0 0) [2 2 1] 0 1 (5- 5- 5-: 0 0 -1) (11+ 11+ 5-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 1 0 0) (23+ 23+ 10-: 0 -1 0) [2 2 1] 0 1 (5- 5- 5-: 0 0 -1) (11+ 11+ 5-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 1 1 0) (23+ 23+ 10-: 0 0 0) [2 2 1] 0 1 (5- 5- 5-: 0 0 -1) (11+ 11+ 5-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 23+: 1 0 0) (23+ 23+ 23+: 0 -1 0) [2 2 1] 0 1 (5- 5- 11+: 0 0 1) (11+ 11+ 11+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 23+: 1 1 0) (23+ 23+ 23+: 0 0 0) [2 2 1] 0 1 (5- 5- 11+: 0 0 1) (11+ 11+ 11+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 23+: 0 0 0) (23+ 23+ 23+: -1 -1 0) [2 2 1] 0 1 (5- 5- 11+: 0 0 1) (11+ 11+ 11+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (10- 10- 23+: 0 1 0) (23+ 23+ 23+: -1 0 0) [2 2 1] 0 1 (5- 5- 11+: 0 0 1) (11+ 11+ 11+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 2 (11- 11- 11-: -1 0 0) (11- 21+ 21+: -1 0 0) [1 1 1] 0 3 (22- 22- 22-: 0 0 1) (22- 43+ 43+: 0 -1 0) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: -1 0 0) (11- 21+ 21+: -1 0 0) [1 1 1] 0 3 (22- 22- 22-: 0 1 1) (22- 43+ 43+: 0 0 0) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: -1 0 0) (11- 21+ 21+: -1 0 0) [1 1 1] 0 3 (22- 22- 22-: 0 0 0) (22- 43+ 43+: 0 -1 -1) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: -1 0 0) (11- 21+ 21+: -1 0 0) [1 1 1] 0 3 (22- 22- 22-: 0 1 0) (22- 43+ 43+: 0 0 -1) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 2 (21+ 11- 11-: 1 0 0) (21+ 21+ 21+: 1 0 0) [1 1 1] 0 3 (43+ 22- 22-: 0 0 0) (43+ 43+ 43+: 0 -1 -1) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 2 (21+ 11- 11-: 1 0 0) (21+ 21+ 21+: 1 0 0) [1 1 1] 0 3 (43+ 22- 22-: 0 1 0) (43+ 43+ 43+: 0 0 -1) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 2 (21+ 11- 11-: 1 0 0) (21+ 21+ 21+: 1 0 0) [1 1 1] 0 3 (43+ 22- 22-: 0 0 1) (43+ 43+ 43+: 0 -1 0) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 2 (21+ 11- 11-: 1 0 0) (21+ 21+ 21+: 1 0 0) [1 1 1] 0 3 (43+ 22- 22-: 0 1 1) (43+ 43+ 43+: 0 0 0) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 -1 0) (21+ 11- 21+: 0 -1 0) [1 1 1] 0 3 (22- 22- 22-: 0 0 1) (43+ 22- 43+: -1 0 0) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 -1 0) (21+ 11- 21+: 0 -1 0) [1 1 1] 0 3 (22- 22- 22-: 0 0 0) (43+ 22- 43+: -1 0 -1) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 -1 0) (21+ 11- 21+: 0 -1 0) [1 1 1] 0 3 (22- 22- 22-: 1 0 1) (43+ 22- 43+: 0 0 0) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 -1 0) (21+ 11- 21+: 0 -1 0) [1 1 1] 0 3 (22- 22- 22-: 1 0 0) (43+ 22- 43+: 0 0 -1) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 2 (11- 21+ 11-: 0 1 0) (21+ 21+ 21+: 0 1 0) [1 1 1] 0 3 (22- 43+ 22-: 0 0 0) (43+ 43+ 43+: -1 0 -1) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 2 (11- 21+ 11-: 0 1 0) (21+ 21+ 21+: 0 1 0) [1 1 1] 0 3 (22- 43+ 22-: 0 0 1) (43+ 43+ 43+: -1 0 0) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 2 (11- 21+ 11-: 0 1 0) (21+ 21+ 21+: 0 1 0) [1 1 1] 0 3 (22- 43+ 22-: 1 0 0) (43+ 43+ 43+: 0 0 -1) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 2 (11- 21+ 11-: 0 1 0) (21+ 21+ 21+: 0 1 0) [1 1 1] 0 3 (22- 43+ 22-: 1 0 1) (43+ 43+ 43+: 0 0 0) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 0 -1) (21+ 21+ 11-: 0 0 -1) [1 1 1] 0 3 (22- 22- 22-: 0 0 0) (43+ 43+ 22-: -1 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 0 -1) (21+ 21+ 11-: 0 0 -1) [1 1 1] 0 3 (22- 22- 22-: 0 1 0) (43+ 43+ 22-: -1 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 0 -1) (21+ 21+ 11-: 0 0 -1) [1 1 1] 0 3 (22- 22- 22-: 1 0 0) (43+ 43+ 22-: 0 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 2 (11- 11- 11-: 0 0 -1) (21+ 21+ 11-: 0 0 -1) [1 1 1] 0 3 (22- 22- 22-: 1 1 0) (43+ 43+ 22-: 0 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 2 (11- 11- 21+: 0 0 1) (21+ 21+ 21+: 0 0 1) [1 1 1] 0 3 (22- 22- 43+: 1 0 0) (43+ 43+ 43+: 0 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 2 (11- 11- 21+: 0 0 1) (21+ 21+ 21+: 0 0 1) [1 1 1] 0 3 (22- 22- 43+: 1 1 0) (43+ 43+ 43+: 0 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 2 (11- 11- 21+: 0 0 1) (21+ 21+ 21+: 0 0 1) [1 1 1] 0 3 (22- 22- 43+: 0 0 0) (43+ 43+ 43+: -1 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 2 (11- 11- 21+: 0 0 1) (21+ 21+ 21+: 0 0 1) [1 1 1] 0 3 (22- 22- 43+: 0 1 0) (43+ 43+ 43+: -1 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 0) (10- 23+ 10-: 0 -1 0) [1 2 1] 0 1 (5- 5- 5-: -1 0 0) (5- 11+ 5-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 1 0) (10- 23+ 10-: 0 0 0) [1 2 1] 0 1 (5- 5- 5-: -1 0 0) (5- 11+ 5-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (23+ 10- 23+: 0 0 0) (23+ 23+ 23+: 0 -1 0) [1 2 1] 0 1 (11+ 5- 11+: 1 0 0) (11+ 11+ 11+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (23+ 10- 23+: 0 1 0) (23+ 23+ 23+: 0 0 0) [1 2 1] 0 1 (11+ 5- 11+: 1 0 0) (11+ 11+ 11+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (23+ 10- 10-: 0 0 0) (23+ 23+ 10-: 0 -1 0) [1 2 1] 0 1 (11+ 5- 5-: 1 0 0) (11+ 11+ 5-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (23+ 10- 10-: 0 1 0) (23+ 23+ 10-: 0 0 0) [1 2 1] 0 1 (11+ 5- 5-: 1 0 0) (11+ 11+ 5-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 23+: 0 0 0) (10- 23+ 23+: 0 -1 0) [1 2 1] 0 1 (5- 5- 11+: -1 0 0) (5- 11+ 11+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 23+: 0 1 0) (10- 23+ 23+: 0 0 0) [1 2 1] 0 1 (5- 5- 11+: -1 0 0) (5- 11+ 11+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 2 0 0) (23+ 10- 10-: -1 0 0) [2 1 1] 0 1 (5- 5- 5-: 1 -1 0) (11+ 5- 5-: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 2) (10- 10- 23+: 0 0 -1) [1 1 2] 0 1 (5- 5- 5-: 0 -1 1) (5- 5- 11+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 23+: 2 0 0) (23+ 10- 23+: -1 0 0) [2 1 1] 0 1 (5- 5- 11+: 1 -1 0) (11+ 5- 11+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (23+ 10- 10-: 0 0 2) (23+ 10- 23+: 0 0 -1) [1 1 2] 0 1 (11+ 5- 5-: 0 -1 1) (11+ 5- 11+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 1 0 0) (23+ 10- 10-: -2 0 0) [2 1 1] 0 1 (5- 5- 5-: 0 -1 0) (11+ 5- 5-: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 1) (10- 10- 23+: 0 0 -2) [1 1 2] 0 1 (5- 5- 5-: 0 -1 0) (5- 5- 11+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 23+: 1 0 0) (23+ 10- 23+: -2 0 0) [2 1 1] 0 1 (5- 5- 11+: 0 -1 0) (11+ 5- 11+: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (23+ 10- 10-: 0 0 1) (23+ 10- 23+: 0 0 -2) [1 1 2] 0 1 (11+ 5- 5-: 0 -1 0) (11+ 5- 11+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 23+ 10-: 2 0 0) (23+ 23+ 10-: -1 0 0) [2 1 1] 0 1 (5- 11+ 5-: 1 1 0) (11+ 11+ 5-: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 23+ 10-: 0 0 2) (10- 23+ 23+: 0 0 -1) [1 1 2] 0 1 (5- 11+ 5-: 0 1 1) (5- 11+ 11+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 23+ 23+: 2 0 0) (23+ 23+ 23+: -1 0 0) [2 1 1] 0 1 (5- 11+ 11+: 1 1 0) (11+ 11+ 11+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (23+ 23+ 10-: 0 0 2) (23+ 23+ 23+: 0 0 -1) [1 1 2] 0 1 (11+ 11+ 5-: 0 1 1) (11+ 11+ 11+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 23+ 10-: 1 0 0) (23+ 23+ 10-: -2 0 0) [2 1 1] 0 1 (5- 11+ 5-: 0 1 0) (11+ 11+ 5-: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 23+ 10-: 0 0 1) (10- 23+ 23+: 0 0 -2) [1 1 2] 0 1 (5- 11+ 5-: 0 1 0) (5- 11+ 11+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 23+ 23+: 1 0 0) (23+ 23+ 23+: -2 0 0) [2 1 1] 0 1 (5- 11+ 11+: 0 1 0) (11+ 11+ 11+: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (23+ 23+ 10-: 0 0 1) (23+ 23+ 23+: 0 0 -2) [1 1 2] 0 1 (11+ 11+ 5-: 0 1 0) (11+ 11+ 11+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 2 (10- 10- 10-: 0 0 0) (10- 10- 10-: 0 0 0) [1 1 1] 0 1 (5- 5- 5-: 0 -1 0) (5- 5- 5-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (23+ 10- 10-: 0 0 0) (23+ 10- 10-: 0 0 0) [1 1 1] 0 1 (11+ 5- 5-: 0 -1 0) (11+ 5- 5-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (10- 10- 23+: 0 0 0) (10- 10- 23+: 0 0 0) [1 1 1] 0 1 (5- 5- 11+: 0 -1 0) (5- 5- 11+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (23+ 10- 23+: 0 0 0) (23+ 10- 23+: 0 0 0) [1 1 1] 0 1 (11+ 5- 11+: 0 -1 0) (11+ 5- 11+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (10- 23+ 10-: 0 0 0) (10- 23+ 10-: 0 0 0) [1 1 1] 0 1 (5- 11+ 5-: 0 1 0) (5- 11+ 5-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (23+ 23+ 10-: 0 0 0) (23+ 23+ 10-: 0 0 0) [1 1 1] 0 1 (11+ 11+ 5-: 0 1 0) (11+ 11+ 5-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (10- 23+ 23+: 0 0 0) (10- 23+ 23+: 0 0 0) [1 1 1] 0 1 (5- 11+ 11+: 0 1 0) (5- 11+ 11+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 2 (23+ 23+ 23+: 0 0 0) (23+ 23+ 23+: 0 0 0) [1 1 1] 0 1 (11+ 11+ 11+: 0 1 0) (11+ 11+ 11+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 0 1) (22- 43+ 43+: 0 -1 -2) [1 2 2] 0 2 (11- 11- 11-: -1 0 0) (11- 21+ 21+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 1 1) (22- 43+ 43+: 0 0 -2) [1 2 2] 0 2 (11- 11- 11-: -1 0 0) (11- 21+ 21+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 0 2) (22- 43+ 43+: 0 -1 -1) [1 2 2] 0 2 (11- 11- 11-: -1 0 1) (11- 21+ 21+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 1 2) (22- 43+ 43+: 0 0 -1) [1 2 2] 0 2 (11- 11- 11-: -1 0 1) (11- 21+ 21+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (43+ 22- 22-: 0 0 2) (43+ 43+ 43+: 0 -1 -1) [1 2 2] 0 2 (21+ 11- 11-: 1 0 1) (21+ 21+ 21+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (43+ 22- 22-: 0 1 2) (43+ 43+ 43+: 0 0 -1) [1 2 2] 0 2 (21+ 11- 11-: 1 0 1) (21+ 21+ 21+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (43+ 22- 22-: 0 0 1) (43+ 43+ 43+: 0 -1 -2) [1 2 2] 0 2 (21+ 11- 11-: 1 0 0) (21+ 21+ 21+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (43+ 22- 22-: 0 1 1) (43+ 43+ 43+: 0 0 -2) [1 2 2] 0 2 (21+ 11- 11-: 1 0 0) (21+ 21+ 21+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 2 0 1) (43+ 22- 43+: -1 0 -2) [2 1 2] 0 2 (11- 11- 11-: 1 -1 0) (21+ 11- 21+: 0 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 2 0 2) (43+ 22- 43+: -1 0 -1) [2 1 2] 0 2 (11- 11- 11-: 1 -1 1) (21+ 11- 21+: 0 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 1 0 1) (43+ 22- 43+: -2 0 -2) [2 1 2] 0 2 (11- 11- 11-: 0 -1 0) (21+ 11- 21+: -1 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 1 0 2) (43+ 22- 43+: -2 0 -1) [2 1 2] 0 2 (11- 11- 11-: 0 -1 1) (21+ 11- 21+: -1 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 43+ 22-: 2 0 2) (43+ 43+ 43+: -1 0 -1) [2 1 2] 0 2 (11- 21+ 11-: 1 1 1) (21+ 21+ 21+: 0 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 43+ 22-: 2 0 1) (43+ 43+ 43+: -1 0 -2) [2 1 2] 0 2 (11- 21+ 11-: 1 1 0) (21+ 21+ 21+: 0 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 43+ 22-: 1 0 2) (43+ 43+ 43+: -2 0 -1) [2 1 2] 0 2 (11- 21+ 11-: 0 1 1) (21+ 21+ 21+: -1 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 43+ 22-: 1 0 1) (43+ 43+ 43+: -2 0 -2) [2 1 2] 0 2 (11- 21+ 11-: 0 1 0) (21+ 21+ 21+: -1 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 0 0) (43+ 43+ 22-: -1 -1 0) [2 2 1] 0 2 (11- 11- 11-: 0 0 -1) (21+ 21+ 11-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 1 0) (43+ 43+ 22-: -1 0 0) [2 2 1] 0 2 (11- 11- 11-: 0 0 -1) (21+ 21+ 11-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 1 0 0) (43+ 43+ 22-: 0 -1 0) [2 2 1] 0 2 (11- 11- 11-: 0 0 -1) (21+ 21+ 11-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 1 1 0) (43+ 43+ 22-: 0 0 0) [2 2 1] 0 2 (11- 11- 11-: 0 0 -1) (21+ 21+ 11-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 43+: 1 0 0) (43+ 43+ 43+: 0 -1 0) [2 2 1] 0 2 (11- 11- 21+: 0 0 1) (21+ 21+ 21+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 43+: 1 1 0) (43+ 43+ 43+: 0 0 0) [2 2 1] 0 2 (11- 11- 21+: 0 0 1) (21+ 21+ 21+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 43+: 0 0 0) (43+ 43+ 43+: -1 -1 0) [2 2 1] 0 2 (11- 11- 21+: 0 0 1) (21+ 21+ 21+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (22- 22- 43+: 0 1 0) (43+ 43+ 43+: -1 0 0) [2 2 1] 0 2 (11- 11- 21+: 0 0 1) (21+ 21+ 21+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 3 (23- 23- 23-: -1 0 0) (23- 40+ 40+: -1 0 0) [1 1 1] 0 4 (46- 46- 46-: 0 0 1) (46- 81+ 81+: 0 -1 0) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: -1 0 0) (23- 40+ 40+: -1 0 0) [1 1 1] 0 4 (46- 46- 46-: 0 1 1) (46- 81+ 81+: 0 0 0) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: -1 0 0) (23- 40+ 40+: -1 0 0) [1 1 1] 0 4 (46- 46- 46-: 0 0 0) (46- 81+ 81+: 0 -1 -1) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: -1 0 0) (23- 40+ 40+: -1 0 0) [1 1 1] 0 4 (46- 46- 46-: 0 1 0) (46- 81+ 81+: 0 0 -1) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 3 (40+ 23- 23-: 1 0 0) (40+ 40+ 40+: 1 0 0) [1 1 1] 0 4 (81+ 46- 46-: 0 0 0) (81+ 81+ 81+: 0 -1 -1) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 3 (40+ 23- 23-: 1 0 0) (40+ 40+ 40+: 1 0 0) [1 1 1] 0 4 (81+ 46- 46-: 0 1 0) (81+ 81+ 81+: 0 0 -1) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 3 (40+ 23- 23-: 1 0 0) (40+ 40+ 40+: 1 0 0) [1 1 1] 0 4 (81+ 46- 46-: 0 0 1) (81+ 81+ 81+: 0 -1 0) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 3 (40+ 23- 23-: 1 0 0) (40+ 40+ 40+: 1 0 0) [1 1 1] 0 4 (81+ 46- 46-: 0 1 1) (81+ 81+ 81+: 0 0 0) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: 0 -1 0) (40+ 23- 40+: 0 -1 0) [1 1 1] 0 4 (46- 46- 46-: 0 0 1) (81+ 46- 81+: -1 0 0) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: 0 -1 0) (40+ 23- 40+: 0 -1 0) [1 1 1] 0 4 (46- 46- 46-: 0 0 0) (81+ 46- 81+: -1 0 -1) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: 0 -1 0) (40+ 23- 40+: 0 -1 0) [1 1 1] 0 4 (46- 46- 46-: 1 0 1) (81+ 46- 81+: 0 0 0) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: 0 -1 0) (40+ 23- 40+: 0 -1 0) [1 1 1] 0 4 (46- 46- 46-: 1 0 0) (81+ 46- 81+: 0 0 -1) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 3 (23- 40+ 23-: 0 1 0) (40+ 40+ 40+: 0 1 0) [1 1 1] 0 4 (46- 81+ 46-: 0 0 0) (81+ 81+ 81+: -1 0 -1) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 3 (23- 40+ 23-: 0 1 0) (40+ 40+ 40+: 0 1 0) [1 1 1] 0 4 (46- 81+ 46-: 0 0 1) (81+ 81+ 81+: -1 0 0) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 3 (23- 40+ 23-: 0 1 0) (40+ 40+ 40+: 0 1 0) [1 1 1] 0 4 (46- 81+ 46-: 1 0 0) (81+ 81+ 81+: 0 0 -1) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 3 (23- 40+ 23-: 0 1 0) (40+ 40+ 40+: 0 1 0) [1 1 1] 0 4 (46- 81+ 46-: 1 0 1) (81+ 81+ 81+: 0 0 0) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: 0 0 -1) (40+ 40+ 23-: 0 0 -1) [1 1 1] 0 4 (46- 46- 46-: 0 0 0) (81+ 81+ 46-: -1 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: 0 0 -1) (40+ 40+ 23-: 0 0 -1) [1 1 1] 0 4 (46- 46- 46-: 0 1 0) (81+ 81+ 46-: -1 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: 0 0 -1) (40+ 40+ 23-: 0 0 -1) [1 1 1] 0 4 (46- 46- 46-: 1 0 0) (81+ 81+ 46-: 0 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 3 (23- 23- 23-: 0 0 -1) (40+ 40+ 23-: 0 0 -1) [1 1 1] 0 4 (46- 46- 46-: 1 1 0) (81+ 81+ 46-: 0 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 3 (23- 23- 40+: 0 0 1) (40+ 40+ 40+: 0 0 1) [1 1 1] 0 4 (46- 46- 81+: 1 0 0) (81+ 81+ 81+: 0 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 3 (23- 23- 40+: 0 0 1) (40+ 40+ 40+: 0 0 1) [1 1 1] 0 4 (46- 46- 81+: 1 1 0) (81+ 81+ 81+: 0 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 3 (23- 23- 40+: 0 0 1) (40+ 40+ 40+: 0 0 1) [1 1 1] 0 4 (46- 46- 81+: 0 0 0) (81+ 81+ 81+: -1 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 3 (23- 23- 40+: 0 0 1) (40+ 40+ 40+: 0 0 1) [1 1 1] 0 4 (46- 46- 81+: 0 1 0) (81+ 81+ 81+: -1 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 3 (22- 22- 22-: 0 0 0) (22- 43+ 22-: 0 -1 0) [1 2 1] 0 2 (11- 11- 11-: -1 0 0) (11- 21+ 11-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 1 0) (22- 43+ 22-: 0 0 0) [1 2 1] 0 2 (11- 11- 11-: -1 0 0) (11- 21+ 11-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (43+ 22- 43+: 0 0 0) (43+ 43+ 43+: 0 -1 0) [1 2 1] 0 2 (21+ 11- 21+: 1 0 0) (21+ 21+ 21+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (43+ 22- 43+: 0 1 0) (43+ 43+ 43+: 0 0 0) [1 2 1] 0 2 (21+ 11- 21+: 1 0 0) (21+ 21+ 21+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (43+ 22- 22-: 0 0 0) (43+ 43+ 22-: 0 -1 0) [1 2 1] 0 2 (21+ 11- 11-: 1 0 0) (21+ 21+ 11-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (43+ 22- 22-: 0 1 0) (43+ 43+ 22-: 0 0 0) [1 2 1] 0 2 (21+ 11- 11-: 1 0 0) (21+ 21+ 11-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 43+: 0 0 0) (22- 43+ 43+: 0 -1 0) [1 2 1] 0 2 (11- 11- 21+: -1 0 0) (11- 21+ 21+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 43+: 0 1 0) (22- 43+ 43+: 0 0 0) [1 2 1] 0 2 (11- 11- 21+: -1 0 0) (11- 21+ 21+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 2 0 0) (43+ 22- 22-: -1 0 0) [2 1 1] 0 2 (11- 11- 11-: 1 -1 0) (21+ 11- 11-: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 0 2) (22- 22- 43+: 0 0 -1) [1 1 2] 0 2 (11- 11- 11-: 0 -1 1) (11- 11- 21+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 43+: 2 0 0) (43+ 22- 43+: -1 0 0) [2 1 1] 0 2 (11- 11- 21+: 1 -1 0) (21+ 11- 21+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (43+ 22- 22-: 0 0 2) (43+ 22- 43+: 0 0 -1) [1 1 2] 0 2 (21+ 11- 11-: 0 -1 1) (21+ 11- 21+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 1 0 0) (43+ 22- 22-: -2 0 0) [2 1 1] 0 2 (11- 11- 11-: 0 -1 0) (21+ 11- 11-: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 0 1) (22- 22- 43+: 0 0 -2) [1 1 2] 0 2 (11- 11- 11-: 0 -1 0) (11- 11- 21+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 43+: 1 0 0) (43+ 22- 43+: -2 0 0) [2 1 1] 0 2 (11- 11- 21+: 0 -1 0) (21+ 11- 21+: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (43+ 22- 22-: 0 0 1) (43+ 22- 43+: 0 0 -2) [1 1 2] 0 2 (21+ 11- 11-: 0 -1 0) (21+ 11- 21+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 43+ 22-: 2 0 0) (43+ 43+ 22-: -1 0 0) [2 1 1] 0 2 (11- 21+ 11-: 1 1 0) (21+ 21+ 11-: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 43+ 22-: 0 0 2) (22- 43+ 43+: 0 0 -1) [1 1 2] 0 2 (11- 21+ 11-: 0 1 1) (11- 21+ 21+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 43+ 43+: 2 0 0) (43+ 43+ 43+: -1 0 0) [2 1 1] 0 2 (11- 21+ 21+: 1 1 0) (21+ 21+ 21+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (43+ 43+ 22-: 0 0 2) (43+ 43+ 43+: 0 0 -1) [1 1 2] 0 2 (21+ 21+ 11-: 0 1 1) (21+ 21+ 21+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 43+ 22-: 1 0 0) (43+ 43+ 22-: -2 0 0) [2 1 1] 0 2 (11- 21+ 11-: 0 1 0) (21+ 21+ 11-: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 43+ 22-: 0 0 1) (22- 43+ 43+: 0 0 -2) [1 1 2] 0 2 (11- 21+ 11-: 0 1 0) (11- 21+ 21+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 43+ 43+: 1 0 0) (43+ 43+ 43+: -2 0 0) [2 1 1] 0 2 (11- 21+ 21+: 0 1 0) (21+ 21+ 21+: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (43+ 43+ 22-: 0 0 1) (43+ 43+ 43+: 0 0 -2) [1 1 2] 0 2 (21+ 21+ 11-: 0 1 0) (21+ 21+ 21+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 3 (22- 22- 22-: 0 0 0) (22- 22- 22-: 0 0 0) [1 1 1] 0 2 (11- 11- 11-: 0 -1 0) (11- 11- 11-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (43+ 22- 22-: 0 0 0) (43+ 22- 22-: 0 0 0) [1 1 1] 0 2 (21+ 11- 11-: 0 -1 0) (21+ 11- 11-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (22- 22- 43+: 0 0 0) (22- 22- 43+: 0 0 0) [1 1 1] 0 2 (11- 11- 21+: 0 -1 0) (11- 11- 21+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (43+ 22- 43+: 0 0 0) (43+ 22- 43+: 0 0 0) [1 1 1] 0 2 (21+ 11- 21+: 0 -1 0) (21+ 11- 21+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (22- 43+ 22-: 0 0 0) (22- 43+ 22-: 0 0 0) [1 1 1] 0 2 (11- 21+ 11-: 0 1 0) (11- 21+ 11-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (43+ 43+ 22-: 0 0 0) (43+ 43+ 22-: 0 0 0) [1 1 1] 0 2 (21+ 21+ 11-: 0 1 0) (21+ 21+ 11-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (22- 43+ 43+: 0 0 0) (22- 43+ 43+: 0 0 0) [1 1 1] 0 2 (11- 21+ 21+: 0 1 0) (11- 21+ 21+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 3 (43+ 43+ 43+: 0 0 0) (43+ 43+ 43+: 0 0 0) [1 1 1] 0 2 (21+ 21+ 21+: 0 1 0) (21+ 21+ 21+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 0 0 1) (46- 81+ 81+: 0 -1 -2) [1 2 2] 0 3 (23- 23- 23-: -1 0 0) (23- 40+ 40+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 0 1 1) (46- 81+ 81+: 0 0 -2) [1 2 2] 0 3 (23- 23- 23-: -1 0 0) (23- 40+ 40+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 0 0 2) (46- 81+ 81+: 0 -1 -1) [1 2 2] 0 3 (23- 23- 23-: -1 0 1) (23- 40+ 40+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 0 1 2) (46- 81+ 81+: 0 0 -1) [1 2 2] 0 3 (23- 23- 23-: -1 0 1) (23- 40+ 40+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (81+ 46- 46-: 0 0 2) (81+ 81+ 81+: 0 -1 -1) [1 2 2] 0 3 (40+ 23- 23-: 1 0 1) (40+ 40+ 40+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (81+ 46- 46-: 0 1 2) (81+ 81+ 81+: 0 0 -1) [1 2 2] 0 3 (40+ 23- 23-: 1 0 1) (40+ 40+ 40+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (81+ 46- 46-: 0 0 1) (81+ 81+ 81+: 0 -1 -2) [1 2 2] 0 3 (40+ 23- 23-: 1 0 0) (40+ 40+ 40+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (81+ 46- 46-: 0 1 1) (81+ 81+ 81+: 0 0 -2) [1 2 2] 0 3 (40+ 23- 23-: 1 0 0) (40+ 40+ 40+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 2 0 1) (81+ 46- 81+: -1 0 -2) [2 1 2] 0 3 (23- 23- 23-: 1 -1 0) (40+ 23- 40+: 0 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 2 0 2) (81+ 46- 81+: -1 0 -1) [2 1 2] 0 3 (23- 23- 23-: 1 -1 1) (40+ 23- 40+: 0 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 1 0 1) (81+ 46- 81+: -2 0 -2) [2 1 2] 0 3 (23- 23- 23-: 0 -1 0) (40+ 23- 40+: -1 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 1 0 2) (81+ 46- 81+: -2 0 -1) [2 1 2] 0 3 (23- 23- 23-: 0 -1 1) (40+ 23- 40+: -1 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 81+ 46-: 2 0 2) (81+ 81+ 81+: -1 0 -1) [2 1 2] 0 3 (23- 40+ 23-: 1 1 1) (40+ 40+ 40+: 0 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 81+ 46-: 2 0 1) (81+ 81+ 81+: -1 0 -2) [2 1 2] 0 3 (23- 40+ 23-: 1 1 0) (40+ 40+ 40+: 0 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 81+ 46-: 1 0 2) (81+ 81+ 81+: -2 0 -1) [2 1 2] 0 3 (23- 40+ 23-: 0 1 1) (40+ 40+ 40+: -1 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 81+ 46-: 1 0 1) (81+ 81+ 81+: -2 0 -2) [2 1 2] 0 3 (23- 40+ 23-: 0 1 0) (40+ 40+ 40+: -1 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 0 0 0) (81+ 81+ 46-: -1 -1 0) [2 2 1] 0 3 (23- 23- 23-: 0 0 -1) (40+ 40+ 23-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 0 1 0) (81+ 81+ 46-: -1 0 0) [2 2 1] 0 3 (23- 23- 23-: 0 0 -1) (40+ 40+ 23-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 1 0 0) (81+ 81+ 46-: 0 -1 0) [2 2 1] 0 3 (23- 23- 23-: 0 0 -1) (40+ 40+ 23-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 1 1 0) (81+ 81+ 46-: 0 0 0) [2 2 1] 0 3 (23- 23- 23-: 0 0 -1) (40+ 40+ 23-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 81+: 1 0 0) (81+ 81+ 81+: 0 -1 0) [2 2 1] 0 3 (23- 23- 40+: 0 0 1) (40+ 40+ 40+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 81+: 1 1 0) (81+ 81+ 81+: 0 0 0) [2 2 1] 0 3 (23- 23- 40+: 0 0 1) (40+ 40+ 40+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 81+: 0 0 0) (81+ 81+ 81+: -1 -1 0) [2 2 1] 0 3 (23- 23- 40+: 0 0 1) (40+ 40+ 40+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (46- 46- 81+: 0 1 0) (81+ 81+ 81+: -1 0 0) [2 2 1] 0 3 (23- 23- 40+: 0 0 1) (40+ 40+ 40+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 4 (49- 49- 49-: -1 0 0) (49- 60+ 60+: -1 0 0) [1 1 1] 0 5 (98- 98- 98-: 0 0 1) (98- 121+ 121+: 0 -1 0) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 4 (49- 49- 49-: -1 0 0) (49- 60+ 60+: -1 0 0) [1 1 1] 0 5 (98- 98- 98-: 0 1 1) (98- 121+ 121+: 0 0 0) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 4 (49- 49- 49-: -1 0 0) (49- 60+ 60+: -1 0 0) [1 1 1] 0 5 (98- 98- 98-: 0 0 0) (98- 121+ 121+: 0 -1 -1) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 4 (49- 49- 49-: -1 0 0) (49- 60+ 60+: -1 0 0) [1 1 1] 0 5 (98- 98- 98-: 0 1 0) (98- 121+ 121+: 0 0 -1) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 4 (60+ 49- 49-: 1 0 0) (60+ 60+ 60+: 1 0 0) [1 1 1] 0 5 (121+ 98- 98-: 0 0 0) (121+ 121+ 121+: 0 -1 -1) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 4 (60+ 49- 49-: 1 0 0) (60+ 60+ 60+: 1 0 0) [1 1 1] 0 5 (121+ 98- 98-: 0 1 0) (121+ 121+ 121+: 0 0 -1) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 4 (60+ 49- 49-: 1 0 0) (60+ 60+ 60+: 1 0 0) [1 1 1] 0 5 (121+ 98- 98-: 0 0 1) (121+ 121+ 121+: 0 -1 0) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 4 (60+ 49- 49-: 1 0 0) (60+ 60+ 60+: 1 0 0) [1 1 1] 0 5 (121+ 98- 98-: 0 1 1) (121+ 121+ 121+: 0 0 0) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 4 (49- 49- 49-: 0 -1 0) (60+ 49- 60+: 0 -1 0) [1 1 1] 0 5 (98- 98- 98-: 0 0 1) (121+ 98- 121+: -1 0 0) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 4 (49- 49- 49-: 0 -1 0) (60+ 49- 60+: 0 -1 0) [1 1 1] 0 5 (98- 98- 98-: 0 0 0) (121+ 98- 121+: -1 0 -1) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 4 (49- 49- 49-: 0 -1 0) (60+ 49- 60+: 0 -1 0) [1 1 1] 0 5 (98- 98- 98-: 1 0 1) (121+ 98- 121+: 0 0 0) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 4 (49- 49- 49-: 0 -1 0) (60+ 49- 60+: 0 -1 0) [1 1 1] 0 5 (98- 98- 98-: 1 0 0) (121+ 98- 121+: 0 0 -1) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 4 (49- 60+ 49-: 0 1 0) (60+ 60+ 60+: 0 1 0) [1 1 1] 0 5 (98- 121+ 98-: 0 0 0) (121+ 121+ 121+: -1 0 -1) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 4 (49- 60+ 49-: 0 1 0) (60+ 60+ 60+: 0 1 0) [1 1 1] 0 5 (98- 121+ 98-: 0 0 1) (121+ 121+ 121+: -1 0 0) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 4 (49- 60+ 49-: 0 1 0) (60+ 60+ 60+: 0 1 0) [1 1 1] 0 5 (98- 121+ 98-: 1 0 0) (121+ 121+ 121+: 0 0 -1) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 4 (49- 60+ 49-: 0 1 0) (60+ 60+ 60+: 0 1 0) [1 1 1] 0 5 (98- 121+ 98-: 1 0 1) (121+ 121+ 121+: 0 0 0) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 4 (49- 49- 49-: 0 0 -1) (60+ 60+ 49-: 0 0 -1) [1 1 1] 0 5 (98- 98- 98-: 0 0 0) (121+ 121+ 98-: -1 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 4 (49- 49- 49-: 0 0 -1) (60+ 60+ 49-: 0 0 -1) [1 1 1] 0 5 (98- 98- 98-: 0 1 0) (121+ 121+ 98-: -1 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 4 (49- 49- 49-: 0 0 -1) (60+ 60+ 49-: 0 0 -1) [1 1 1] 0 5 (98- 98- 98-: 1 0 0) (121+ 121+ 98-: 0 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 4 (49- 49- 49-: 0 0 -1) (60+ 60+ 49-: 0 0 -1) [1 1 1] 0 5 (98- 98- 98-: 1 1 0) (121+ 121+ 98-: 0 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 4 (49- 49- 60+: 0 0 1) (60+ 60+ 60+: 0 0 1) [1 1 1] 0 5 (98- 98- 121+: 1 0 0) (121+ 121+ 121+: 0 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 4 (49- 49- 60+: 0 0 1) (60+ 60+ 60+: 0 0 1) [1 1 1] 0 5 (98- 98- 121+: 1 1 0) (121+ 121+ 121+: 0 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 4 (49- 49- 60+: 0 0 1) (60+ 60+ 60+: 0 0 1) [1 1 1] 0 5 (98- 98- 121+: 0 0 0) (121+ 121+ 121+: -1 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 4 (49- 49- 60+: 0 0 1) (60+ 60+ 60+: 0 0 1) [1 1 1] 0 5 (98- 98- 121+: 0 1 0) (121+ 121+ 121+: -1 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 4 (46- 46- 46-: 0 0 0) (46- 81+ 46-: 0 -1 0) [1 2 1] 0 3 (23- 23- 23-: -1 0 0) (23- 40+ 23-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 0 1 0) (46- 81+ 46-: 0 0 0) [1 2 1] 0 3 (23- 23- 23-: -1 0 0) (23- 40+ 23-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (81+ 46- 81+: 0 0 0) (81+ 81+ 81+: 0 -1 0) [1 2 1] 0 3 (40+ 23- 40+: 1 0 0) (40+ 40+ 40+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (81+ 46- 81+: 0 1 0) (81+ 81+ 81+: 0 0 0) [1 2 1] 0 3 (40+ 23- 40+: 1 0 0) (40+ 40+ 40+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (81+ 46- 46-: 0 0 0) (81+ 81+ 46-: 0 -1 0) [1 2 1] 0 3 (40+ 23- 23-: 1 0 0) (40+ 40+ 23-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (81+ 46- 46-: 0 1 0) (81+ 81+ 46-: 0 0 0) [1 2 1] 0 3 (40+ 23- 23-: 1 0 0) (40+ 40+ 23-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 46- 81+: 0 0 0) (46- 81+ 81+: 0 -1 0) [1 2 1] 0 3 (23- 23- 40+: -1 0 0) (23- 40+ 40+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 46- 81+: 0 1 0) (46- 81+ 81+: 0 0 0) [1 2 1] 0 3 (23- 23- 40+: -1 0 0) (23- 40+ 40+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 2 0 0) (81+ 46- 46-: -1 0 0) [2 1 1] 0 3 (23- 23- 23-: 1 -1 0) (40+ 23- 23-: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 0 0 2) (46- 46- 81+: 0 0 -1) [1 1 2] 0 3 (23- 23- 23-: 0 -1 1) (23- 23- 40+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 46- 81+: 2 0 0) (81+ 46- 81+: -1 0 0) [2 1 1] 0 3 (23- 23- 40+: 1 -1 0) (40+ 23- 40+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (81+ 46- 46-: 0 0 2) (81+ 46- 81+: 0 0 -1) [1 1 2] 0 3 (40+ 23- 23-: 0 -1 1) (40+ 23- 40+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 1 0 0) (81+ 46- 46-: -2 0 0) [2 1 1] 0 3 (23- 23- 23-: 0 -1 0) (40+ 23- 23-: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 0 0 1) (46- 46- 81+: 0 0 -2) [1 1 2] 0 3 (23- 23- 23-: 0 -1 0) (23- 23- 40+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 46- 81+: 1 0 0) (81+ 46- 81+: -2 0 0) [2 1 1] 0 3 (23- 23- 40+: 0 -1 0) (40+ 23- 40+: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (81+ 46- 46-: 0 0 1) (81+ 46- 81+: 0 0 -2) [1 1 2] 0 3 (40+ 23- 23-: 0 -1 0) (40+ 23- 40+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 81+ 46-: 2 0 0) (81+ 81+ 46-: -1 0 0) [2 1 1] 0 3 (23- 40+ 23-: 1 1 0) (40+ 40+ 23-: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 81+ 46-: 0 0 2) (46- 81+ 81+: 0 0 -1) [1 1 2] 0 3 (23- 40+ 23-: 0 1 1) (23- 40+ 40+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 81+ 81+: 2 0 0) (81+ 81+ 81+: -1 0 0) [2 1 1] 0 3 (23- 40+ 40+: 1 1 0) (40+ 40+ 40+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (81+ 81+ 46-: 0 0 2) (81+ 81+ 81+: 0 0 -1) [1 1 2] 0 3 (40+ 40+ 23-: 0 1 1) (40+ 40+ 40+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 81+ 46-: 1 0 0) (81+ 81+ 46-: -2 0 0) [2 1 1] 0 3 (23- 40+ 23-: 0 1 0) (40+ 40+ 23-: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 81+ 46-: 0 0 1) (46- 81+ 81+: 0 0 -2) [1 1 2] 0 3 (23- 40+ 23-: 0 1 0) (23- 40+ 40+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 81+ 81+: 1 0 0) (81+ 81+ 81+: -2 0 0) [2 1 1] 0 3 (23- 40+ 40+: 0 1 0) (40+ 40+ 40+: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (81+ 81+ 46-: 0 0 1) (81+ 81+ 81+: 0 0 -2) [1 1 2] 0 3 (40+ 40+ 23-: 0 1 0) (40+ 40+ 40+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 4 (46- 46- 46-: 0 0 0) (46- 46- 46-: 0 0 0) [1 1 1] 0 3 (23- 23- 23-: 0 -1 0) (23- 23- 23-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 4 (81+ 46- 46-: 0 0 0) (81+ 46- 46-: 0 0 0) [1 1 1] 0 3 (40+ 23- 23-: 0 -1 0) (40+ 23- 23-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 4 (46- 46- 81+: 0 0 0) (46- 46- 81+: 0 0 0) [1 1 1] 0 3 (23- 23- 40+: 0 -1 0) (23- 23- 40+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 4 (81+ 46- 81+: 0 0 0) (81+ 46- 81+: 0 0 0) [1 1 1] 0 3 (40+ 23- 40+: 0 -1 0) (40+ 23- 40+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 4 (46- 81+ 46-: 0 0 0) (46- 81+ 46-: 0 0 0) [1 1 1] 0 3 (23- 40+ 23-: 0 1 0) (23- 40+ 23-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 4 (81+ 81+ 46-: 0 0 0) (81+ 81+ 46-: 0 0 0) [1 1 1] 0 3 (40+ 40+ 23-: 0 1 0) (40+ 40+ 23-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 4 (46- 81+ 81+: 0 0 0) (46- 81+ 81+: 0 0 0) [1 1 1] 0 3 (23- 40+ 40+: 0 1 0) (23- 40+ 40+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 4 (81+ 81+ 81+: 0 0 0) (81+ 81+ 81+: 0 0 0) [1 1 1] 0 3 (40+ 40+ 40+: 0 1 0) (40+ 40+ 40+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 0 0 1) (98- 121+ 121+: 0 -1 -2) [1 2 2] 0 4 (49- 49- 49-: -1 0 0) (49- 60+ 60+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 0 1 1) (98- 121+ 121+: 0 0 -2) [1 2 2] 0 4 (49- 49- 49-: -1 0 0) (49- 60+ 60+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 0 0 2) (98- 121+ 121+: 0 -1 -1) [1 2 2] 0 4 (49- 49- 49-: -1 0 1) (49- 60+ 60+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 0 1 2) (98- 121+ 121+: 0 0 -1) [1 2 2] 0 4 (49- 49- 49-: -1 0 1) (49- 60+ 60+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (121+ 98- 98-: 0 0 2) (121+ 121+ 121+: 0 -1 -1) [1 2 2] 0 4 (60+ 49- 49-: 1 0 1) (60+ 60+ 60+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (121+ 98- 98-: 0 1 2) (121+ 121+ 121+: 0 0 -1) [1 2 2] 0 4 (60+ 49- 49-: 1 0 1) (60+ 60+ 60+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (121+ 98- 98-: 0 0 1) (121+ 121+ 121+: 0 -1 -2) [1 2 2] 0 4 (60+ 49- 49-: 1 0 0) (60+ 60+ 60+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (121+ 98- 98-: 0 1 1) (121+ 121+ 121+: 0 0 -2) [1 2 2] 0 4 (60+ 49- 49-: 1 0 0) (60+ 60+ 60+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 2 0 1) (121+ 98- 121+: -1 0 -2) [2 1 2] 0 4 (49- 49- 49-: 1 -1 0) (60+ 49- 60+: 0 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 2 0 2) (121+ 98- 121+: -1 0 -1) [2 1 2] 0 4 (49- 49- 49-: 1 -1 1) (60+ 49- 60+: 0 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 1 0 1) (121+ 98- 121+: -2 0 -2) [2 1 2] 0 4 (49- 49- 49-: 0 -1 0) (60+ 49- 60+: -1 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 1 0 2) (121+ 98- 121+: -2 0 -1) [2 1 2] 0 4 (49- 49- 49-: 0 -1 1) (60+ 49- 60+: -1 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 121+ 98-: 2 0 2) (121+ 121+ 121+: -1 0 -1) [2 1 2] 0 4 (49- 60+ 49-: 1 1 1) (60+ 60+ 60+: 0 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 121+ 98-: 2 0 1) (121+ 121+ 121+: -1 0 -2) [2 1 2] 0 4 (49- 60+ 49-: 1 1 0) (60+ 60+ 60+: 0 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 121+ 98-: 1 0 2) (121+ 121+ 121+: -2 0 -1) [2 1 2] 0 4 (49- 60+ 49-: 0 1 1) (60+ 60+ 60+: -1 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 121+ 98-: 1 0 1) (121+ 121+ 121+: -2 0 -2) [2 1 2] 0 4 (49- 60+ 49-: 0 1 0) (60+ 60+ 60+: -1 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 0 0 0) (121+ 121+ 98-: -1 -1 0) [2 2 1] 0 4 (49- 49- 49-: 0 0 -1) (60+ 60+ 49-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 0 1 0) (121+ 121+ 98-: -1 0 0) [2 2 1] 0 4 (49- 49- 49-: 0 0 -1) (60+ 60+ 49-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 1 0 0) (121+ 121+ 98-: 0 -1 0) [2 2 1] 0 4 (49- 49- 49-: 0 0 -1) (60+ 60+ 49-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 1 1 0) (121+ 121+ 98-: 0 0 0) [2 2 1] 0 4 (49- 49- 49-: 0 0 -1) (60+ 60+ 49-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 98- 121+: 1 0 0) (121+ 121+ 121+: 0 -1 0) [2 2 1] 0 4 (49- 49- 60+: 0 0 1) (60+ 60+ 60+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 98- 121+: 1 1 0) (121+ 121+ 121+: 0 0 0) [2 2 1] 0 4 (49- 49- 60+: 0 0 1) (60+ 60+ 60+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 98- 121+: 0 0 0) (121+ 121+ 121+: -1 -1 0) [2 2 1] 0 4 (49- 49- 60+: 0 0 1) (60+ 60+ 60+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (98- 98- 121+: 0 1 0) (121+ 121+ 121+: -1 0 0) [2 2 1] 0 4 (49- 49- 60+: 0 0 1) (60+ 60+ 60+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 5 (100- 100- 100-: -1 0 0) (100- 115+ 115+: -1 0 0) [1 1 1] 0 6 (200- 200- 200-: 0 0 1) (200- 231+ 231+: 0 -1 0) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 5 (100- 100- 100-: -1 0 0) (100- 115+ 115+: -1 0 0) [1 1 1] 0 6 (200- 200- 200-: 0 1 1) (200- 231+ 231+: 0 0 0) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 5 (100- 100- 100-: -1 0 0) (100- 115+ 115+: -1 0 0) [1 1 1] 0 6 (200- 200- 200-: 0 0 0) (200- 231+ 231+: 0 -1 -1) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 5 (100- 100- 100-: -1 0 0) (100- 115+ 115+: -1 0 0) [1 1 1] 0 6 (200- 200- 200-: 0 1 0) (200- 231+ 231+: 0 0 -1) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 5 (115+ 100- 100-: 1 0 0) (115+ 115+ 115+: 1 0 0) [1 1 1] 0 6 (231+ 200- 200-: 0 0 0) (231+ 231+ 231+: 0 -1 -1) [1 2 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 5 (115+ 100- 100-: 1 0 0) (115+ 115+ 115+: 1 0 0) [1 1 1] 0 6 (231+ 200- 200-: 0 1 0) (231+ 231+ 231+: 0 0 -1) [1 2 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 5 (115+ 100- 100-: 1 0 0) (115+ 115+ 115+: 1 0 0) [1 1 1] 0 6 (231+ 200- 200-: 0 0 1) (231+ 231+ 231+: 0 -1 0) [1 2 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 5 (115+ 100- 100-: 1 0 0) (115+ 115+ 115+: 1 0 0) [1 1 1] 0 6 (231+ 200- 200-: 0 1 1) (231+ 231+ 231+: 0 0 0) [1 2 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 5 (100- 100- 100-: 0 -1 0) (115+ 100- 115+: 0 -1 0) [1 1 1] 0 6 (200- 200- 200-: 0 0 1) (231+ 200- 231+: -1 0 0) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 5 (100- 100- 100-: 0 -1 0) (115+ 100- 115+: 0 -1 0) [1 1 1] 0 6 (200- 200- 200-: 0 0 0) (231+ 200- 231+: -1 0 -1) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 5 (100- 100- 100-: 0 -1 0) (115+ 100- 115+: 0 -1 0) [1 1 1] 0 6 (200- 200- 200-: 1 0 1) (231+ 200- 231+: 0 0 0) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 5 (100- 100- 100-: 0 -1 0) (115+ 100- 115+: 0 -1 0) [1 1 1] 0 6 (200- 200- 200-: 1 0 0) (231+ 200- 231+: 0 0 -1) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 5 (100- 115+ 100-: 0 1 0) (115+ 115+ 115+: 0 1 0) [1 1 1] 0 6 (200- 231+ 200-: 0 0 0) (231+ 231+ 231+: -1 0 -1) [2 1 2] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 5 (100- 115+ 100-: 0 1 0) (115+ 115+ 115+: 0 1 0) [1 1 1] 0 6 (200- 231+ 200-: 0 0 1) (231+ 231+ 231+: -1 0 0) [2 1 2] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 5 (100- 115+ 100-: 0 1 0) (115+ 115+ 115+: 0 1 0) [1 1 1] 0 6 (200- 231+ 200-: 1 0 0) (231+ 231+ 231+: 0 0 -1) [2 1 2] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 5 (100- 115+ 100-: 0 1 0) (115+ 115+ 115+: 0 1 0) [1 1 1] 0 6 (200- 231+ 200-: 1 0 1) (231+ 231+ 231+: 0 0 0) [2 1 2] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 5 (100- 100- 100-: 0 0 -1) (115+ 115+ 100-: 0 0 -1) [1 1 1] 0 6 (200- 200- 200-: 0 0 0) (231+ 231+ 200-: -1 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 5 (100- 100- 100-: 0 0 -1) (115+ 115+ 100-: 0 0 -1) [1 1 1] 0 6 (200- 200- 200-: 0 1 0) (231+ 231+ 200-: -1 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 5 (100- 100- 100-: 0 0 -1) (115+ 115+ 100-: 0 0 -1) [1 1 1] 0 6 (200- 200- 200-: 1 0 0) (231+ 231+ 200-: 0 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 5 (100- 100- 100-: 0 0 -1) (115+ 115+ 100-: 0 0 -1) [1 1 1] 0 6 (200- 200- 200-: 1 1 0) (231+ 231+ 200-: 0 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 5 (100- 100- 115+: 0 0 1) (115+ 115+ 115+: 0 0 1) [1 1 1] 0 6 (200- 200- 231+: 1 0 0) (231+ 231+ 231+: 0 -1 0) [2 2 1] 0 [0 1 2] 7 -0.250000 -GraphAddEntries: 5 (100- 100- 115+: 0 0 1) (115+ 115+ 115+: 0 0 1) [1 1 1] 0 6 (200- 200- 231+: 1 1 0) (231+ 231+ 231+: 0 0 0) [2 2 1] 0 [0 1 2] 8 -0.250000 -GraphAddEntries: 5 (100- 100- 115+: 0 0 1) (115+ 115+ 115+: 0 0 1) [1 1 1] 0 6 (200- 200- 231+: 0 0 0) (231+ 231+ 231+: -1 -1 0) [2 2 1] 0 [0 1 2] 9 -0.250000 -GraphAddEntries: 5 (100- 100- 115+: 0 0 1) (115+ 115+ 115+: 0 0 1) [1 1 1] 0 6 (200- 200- 231+: 0 1 0) (231+ 231+ 231+: -1 0 0) [2 2 1] 0 [0 1 2] 10 -0.250000 -GraphAddEntries: 5 (98- 98- 98-: 0 0 0) (98- 121+ 98-: 0 -1 0) [1 2 1] 0 4 (49- 49- 49-: -1 0 0) (49- 60+ 49-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 0 1 0) (98- 121+ 98-: 0 0 0) [1 2 1] 0 4 (49- 49- 49-: -1 0 0) (49- 60+ 49-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (121+ 98- 121+: 0 0 0) (121+ 121+ 121+: 0 -1 0) [1 2 1] 0 4 (60+ 49- 60+: 1 0 0) (60+ 60+ 60+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (121+ 98- 121+: 0 1 0) (121+ 121+ 121+: 0 0 0) [1 2 1] 0 4 (60+ 49- 60+: 1 0 0) (60+ 60+ 60+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (121+ 98- 98-: 0 0 0) (121+ 121+ 98-: 0 -1 0) [1 2 1] 0 4 (60+ 49- 49-: 1 0 0) (60+ 60+ 49-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (121+ 98- 98-: 0 1 0) (121+ 121+ 98-: 0 0 0) [1 2 1] 0 4 (60+ 49- 49-: 1 0 0) (60+ 60+ 49-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 98- 121+: 0 0 0) (98- 121+ 121+: 0 -1 0) [1 2 1] 0 4 (49- 49- 60+: -1 0 0) (49- 60+ 60+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 98- 121+: 0 1 0) (98- 121+ 121+: 0 0 0) [1 2 1] 0 4 (49- 49- 60+: -1 0 0) (49- 60+ 60+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 2 0 0) (121+ 98- 98-: -1 0 0) [2 1 1] 0 4 (49- 49- 49-: 1 -1 0) (60+ 49- 49-: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 0 0 2) (98- 98- 121+: 0 0 -1) [1 1 2] 0 4 (49- 49- 49-: 0 -1 1) (49- 49- 60+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 98- 121+: 2 0 0) (121+ 98- 121+: -1 0 0) [2 1 1] 0 4 (49- 49- 60+: 1 -1 0) (60+ 49- 60+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (121+ 98- 98-: 0 0 2) (121+ 98- 121+: 0 0 -1) [1 1 2] 0 4 (60+ 49- 49-: 0 -1 1) (60+ 49- 60+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 1 0 0) (121+ 98- 98-: -2 0 0) [2 1 1] 0 4 (49- 49- 49-: 0 -1 0) (60+ 49- 49-: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 0 0 1) (98- 98- 121+: 0 0 -2) [1 1 2] 0 4 (49- 49- 49-: 0 -1 0) (49- 49- 60+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 98- 121+: 1 0 0) (121+ 98- 121+: -2 0 0) [2 1 1] 0 4 (49- 49- 60+: 0 -1 0) (60+ 49- 60+: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (121+ 98- 98-: 0 0 1) (121+ 98- 121+: 0 0 -2) [1 1 2] 0 4 (60+ 49- 49-: 0 -1 0) (60+ 49- 60+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 121+ 98-: 2 0 0) (121+ 121+ 98-: -1 0 0) [2 1 1] 0 4 (49- 60+ 49-: 1 1 0) (60+ 60+ 49-: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 121+ 98-: 0 0 2) (98- 121+ 121+: 0 0 -1) [1 1 2] 0 4 (49- 60+ 49-: 0 1 1) (49- 60+ 60+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 121+ 121+: 2 0 0) (121+ 121+ 121+: -1 0 0) [2 1 1] 0 4 (49- 60+ 60+: 1 1 0) (60+ 60+ 60+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (121+ 121+ 98-: 0 0 2) (121+ 121+ 121+: 0 0 -1) [1 1 2] 0 4 (60+ 60+ 49-: 0 1 1) (60+ 60+ 60+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 121+ 98-: 1 0 0) (121+ 121+ 98-: -2 0 0) [2 1 1] 0 4 (49- 60+ 49-: 0 1 0) (60+ 60+ 49-: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 121+ 98-: 0 0 1) (98- 121+ 121+: 0 0 -2) [1 1 2] 0 4 (49- 60+ 49-: 0 1 0) (49- 60+ 60+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 121+ 121+: 1 0 0) (121+ 121+ 121+: -2 0 0) [2 1 1] 0 4 (49- 60+ 60+: 0 1 0) (60+ 60+ 60+: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (121+ 121+ 98-: 0 0 1) (121+ 121+ 121+: 0 0 -2) [1 1 2] 0 4 (60+ 60+ 49-: 0 1 0) (60+ 60+ 60+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 5 (98- 98- 98-: 0 0 0) (98- 98- 98-: 0 0 0) [1 1 1] 0 4 (49- 49- 49-: 0 -1 0) (49- 49- 49-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 5 (121+ 98- 98-: 0 0 0) (121+ 98- 98-: 0 0 0) [1 1 1] 0 4 (60+ 49- 49-: 0 -1 0) (60+ 49- 49-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 5 (98- 98- 121+: 0 0 0) (98- 98- 121+: 0 0 0) [1 1 1] 0 4 (49- 49- 60+: 0 -1 0) (49- 49- 60+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 5 (121+ 98- 121+: 0 0 0) (121+ 98- 121+: 0 0 0) [1 1 1] 0 4 (60+ 49- 60+: 0 -1 0) (60+ 49- 60+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 5 (98- 121+ 98-: 0 0 0) (98- 121+ 98-: 0 0 0) [1 1 1] 0 4 (49- 60+ 49-: 0 1 0) (49- 60+ 49-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 5 (121+ 121+ 98-: 0 0 0) (121+ 121+ 98-: 0 0 0) [1 1 1] 0 4 (60+ 60+ 49-: 0 1 0) (60+ 60+ 49-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 5 (98- 121+ 121+: 0 0 0) (98- 121+ 121+: 0 0 0) [1 1 1] 0 4 (49- 60+ 60+: 0 1 0) (49- 60+ 60+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 5 (121+ 121+ 121+: 0 0 0) (121+ 121+ 121+: 0 0 0) [1 1 1] 0 4 (60+ 60+ 60+: 0 1 0) (60+ 60+ 60+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 6 (200- 200- 200-: 0 0 1) (200- 231+ 231+: 0 -1 -2) [1 2 2] 0 5 (100- 100- 100-: -1 0 0) (100- 115+ 115+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 6 (200- 200- 200-: 0 1 1) (200- 231+ 231+: 0 0 -2) [1 2 2] 0 5 (100- 100- 100-: -1 0 0) (100- 115+ 115+: -1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 6 (200- 200- 200-: 0 0 2) (200- 231+ 231+: 0 -1 -1) [1 2 2] 0 5 (100- 100- 100-: -1 0 1) (100- 115+ 115+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 6 (200- 200- 200-: 0 1 2) (200- 231+ 231+: 0 0 -1) [1 2 2] 0 5 (100- 100- 100-: -1 0 1) (100- 115+ 115+: -1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 6 (231+ 200- 200-: 0 0 2) (231+ 231+ 231+: 0 -1 -1) [1 2 2] 0 5 (115+ 100- 100-: 1 0 1) (115+ 115+ 115+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 6 (231+ 200- 200-: 0 1 2) (231+ 231+ 231+: 0 0 -1) [1 2 2] 0 5 (115+ 100- 100-: 1 0 1) (115+ 115+ 115+: 1 0 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 6 (231+ 200- 200-: 0 0 1) (231+ 231+ 231+: 0 -1 -2) [1 2 2] 0 5 (115+ 100- 100-: 1 0 0) (115+ 115+ 115+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 6 (231+ 200- 200-: 0 1 1) (231+ 231+ 231+: 0 0 -2) [1 2 2] 0 5 (115+ 100- 100-: 1 0 0) (115+ 115+ 115+: 1 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 6 (200- 200- 200-: 2 0 1) (231+ 200- 231+: -1 0 -2) [2 1 2] 0 5 (100- 100- 100-: 1 -1 0) (115+ 100- 115+: 0 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 6 (200- 200- 200-: 2 0 2) (231+ 200- 231+: -1 0 -1) [2 1 2] 0 5 (100- 100- 100-: 1 -1 1) (115+ 100- 115+: 0 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 6 (200- 200- 200-: 1 0 1) (231+ 200- 231+: -2 0 -2) [2 1 2] 0 5 (100- 100- 100-: 0 -1 0) (115+ 100- 115+: -1 -1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 6 (200- 200- 200-: 1 0 2) (231+ 200- 231+: -2 0 -1) [2 1 2] 0 5 (100- 100- 100-: 0 -1 1) (115+ 100- 115+: -1 -1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 6 (200- 231+ 200-: 2 0 2) (231+ 231+ 231+: -1 0 -1) [2 1 2] 0 5 (100- 115+ 100-: 1 1 1) (115+ 115+ 115+: 0 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 6 (200- 231+ 200-: 2 0 1) (231+ 231+ 231+: -1 0 -2) [2 1 2] 0 5 (100- 115+ 100-: 1 1 0) (115+ 115+ 115+: 0 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 6 (200- 231+ 200-: 1 0 2) (231+ 231+ 231+: -2 0 -1) [2 1 2] 0 5 (100- 115+ 100-: 0 1 1) (115+ 115+ 115+: -1 1 0) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 6 (200- 231+ 200-: 1 0 1) (231+ 231+ 231+: -2 0 -2) [2 1 2] 0 5 (100- 115+ 100-: 0 1 0) (115+ 115+ 115+: -1 1 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 6 (200- 200- 200-: 0 0 0) (231+ 231+ 200-: -1 -1 0) [2 2 1] 0 5 (100- 100- 100-: 0 0 -1) (115+ 115+ 100-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 6 (200- 200- 200-: 0 1 0) (231+ 231+ 200-: -1 0 0) [2 2 1] 0 5 (100- 100- 100-: 0 0 -1) (115+ 115+ 100-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 6 (200- 200- 200-: 1 0 0) (231+ 231+ 200-: 0 -1 0) [2 2 1] 0 5 (100- 100- 100-: 0 0 -1) (115+ 115+ 100-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 6 (200- 200- 200-: 1 1 0) (231+ 231+ 200-: 0 0 0) [2 2 1] 0 5 (100- 100- 100-: 0 0 -1) (115+ 115+ 100-: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 6 (200- 200- 231+: 1 0 0) (231+ 231+ 231+: 0 -1 0) [2 2 1] 0 5 (100- 100- 115+: 0 0 1) (115+ 115+ 115+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 6 (200- 200- 231+: 1 1 0) (231+ 231+ 231+: 0 0 0) [2 2 1] 0 5 (100- 100- 115+: 0 0 1) (115+ 115+ 115+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 6 (200- 200- 231+: 0 0 0) (231+ 231+ 231+: -1 -1 0) [2 2 1] 0 5 (100- 100- 115+: 0 0 1) (115+ 115+ 115+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 6 (200- 200- 231+: 0 1 0) (231+ 231+ 231+: -1 0 0) [2 2 1] 0 5 (100- 100- 115+: 0 0 1) (115+ 115+ 115+: 0 0 1) [1 1 1] 0 [0 1 2] 7 -1.000000 -GraphAddEntries: 6 (200- 200- 200-: 0 0 0) (200- 231+ 200-: 0 -1 0) [1 2 1] 0 5 (100- 100- 100-: -1 0 0) (100- 115+ 100-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 6 (200- 200- 200-: 0 1 0) (200- 231+ 200-: 0 0 0) [1 2 1] 0 5 (100- 100- 100-: -1 0 0) (100- 115+ 100-: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 6 (231+ 200- 231+: 0 0 0) (231+ 231+ 231+: 0 -1 0) [1 2 1] 0 5 (115+ 100- 115+: 1 0 0) (115+ 115+ 115+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 6 (231+ 200- 231+: 0 1 0) (231+ 231+ 231+: 0 0 0) [1 2 1] 0 5 (115+ 100- 115+: 1 0 0) (115+ 115+ 115+: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 6 (231+ 200- 200-: 0 0 0) (231+ 231+ 200-: 0 -1 0) [1 2 1] 0 5 (115+ 100- 100-: 1 0 0) (115+ 115+ 100-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 6 (231+ 200- 200-: 0 1 0) (231+ 231+ 200-: 0 0 0) [1 2 1] 0 5 (115+ 100- 100-: 1 0 0) (115+ 115+ 100-: 1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 6 (200- 200- 231+: 0 0 0) (200- 231+ 231+: 0 -1 0) [1 2 1] 0 5 (100- 100- 115+: -1 0 0) (100- 115+ 115+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 6 (200- 200- 231+: 0 1 0) (200- 231+ 231+: 0 0 0) [1 2 1] 0 5 (100- 100- 115+: -1 0 0) (100- 115+ 115+: -1 0 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 6 (200- 200- 200-: 2 0 0) (231+ 200- 200-: -1 0 0) [2 1 1] 0 5 (100- 100- 100-: 1 -1 0) (115+ 100- 100-: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 6 (200- 200- 200-: 0 0 2) (200- 200- 231+: 0 0 -1) [1 1 2] 0 5 (100- 100- 100-: 0 -1 1) (100- 100- 115+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 6 (200- 200- 231+: 2 0 0) (231+ 200- 231+: -1 0 0) [2 1 1] 0 5 (100- 100- 115+: 1 -1 0) (115+ 100- 115+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 6 (231+ 200- 200-: 0 0 2) (231+ 200- 231+: 0 0 -1) [1 1 2] 0 5 (115+ 100- 100-: 0 -1 1) (115+ 100- 115+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 6 (200- 200- 200-: 1 0 0) (231+ 200- 200-: -2 0 0) [2 1 1] 0 5 (100- 100- 100-: 0 -1 0) (115+ 100- 100-: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 6 (200- 200- 200-: 0 0 1) (200- 200- 231+: 0 0 -2) [1 1 2] 0 5 (100- 100- 100-: 0 -1 0) (100- 100- 115+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 6 (200- 200- 231+: 1 0 0) (231+ 200- 231+: -2 0 0) [2 1 1] 0 5 (100- 100- 115+: 0 -1 0) (115+ 100- 115+: -1 -1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 6 (231+ 200- 200-: 0 0 1) (231+ 200- 231+: 0 0 -2) [1 1 2] 0 5 (115+ 100- 100-: 0 -1 0) (115+ 100- 115+: 0 -1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 6 (200- 231+ 200-: 2 0 0) (231+ 231+ 200-: -1 0 0) [2 1 1] 0 5 (100- 115+ 100-: 1 1 0) (115+ 115+ 100-: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 6 (200- 231+ 200-: 0 0 2) (200- 231+ 231+: 0 0 -1) [1 1 2] 0 5 (100- 115+ 100-: 0 1 1) (100- 115+ 115+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 6 (200- 231+ 231+: 2 0 0) (231+ 231+ 231+: -1 0 0) [2 1 1] 0 5 (100- 115+ 115+: 1 1 0) (115+ 115+ 115+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 6 (231+ 231+ 200-: 0 0 2) (231+ 231+ 231+: 0 0 -1) [1 1 2] 0 5 (115+ 115+ 100-: 0 1 1) (115+ 115+ 115+: 0 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 6 (200- 231+ 200-: 1 0 0) (231+ 231+ 200-: -2 0 0) [2 1 1] 0 5 (100- 115+ 100-: 0 1 0) (115+ 115+ 100-: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 6 (200- 231+ 200-: 0 0 1) (200- 231+ 231+: 0 0 -2) [1 1 2] 0 5 (100- 115+ 100-: 0 1 0) (100- 115+ 115+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 6 (200- 231+ 231+: 1 0 0) (231+ 231+ 231+: -2 0 0) [2 1 1] 0 5 (100- 115+ 115+: 0 1 0) (115+ 115+ 115+: -1 1 0) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 6 (231+ 231+ 200-: 0 0 1) (231+ 231+ 231+: 0 0 -2) [1 1 2] 0 5 (115+ 115+ 100-: 0 1 0) (115+ 115+ 115+: 0 1 -1) [1 1 1] 0 [0 1 2] 8 -1.000000 -GraphAddEntries: 6 (200- 200- 200-: 0 0 0) (200- 200- 200-: 0 0 0) [1 1 1] 0 5 (100- 100- 100-: 0 -1 0) (100- 100- 100-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 6 (231+ 200- 200-: 0 0 0) (231+ 200- 200-: 0 0 0) [1 1 1] 0 5 (115+ 100- 100-: 0 -1 0) (115+ 100- 100-: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 6 (200- 200- 231+: 0 0 0) (200- 200- 231+: 0 0 0) [1 1 1] 0 5 (100- 100- 115+: 0 -1 0) (100- 100- 115+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 6 (231+ 200- 231+: 0 0 0) (231+ 200- 231+: 0 0 0) [1 1 1] 0 5 (115+ 100- 115+: 0 -1 0) (115+ 100- 115+: 0 -1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 6 (200- 231+ 200-: 0 0 0) (200- 231+ 200-: 0 0 0) [1 1 1] 0 5 (100- 115+ 100-: 0 1 0) (100- 115+ 100-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 6 (231+ 231+ 200-: 0 0 0) (231+ 231+ 200-: 0 0 0) [1 1 1] 0 5 (115+ 115+ 100-: 0 1 0) (115+ 115+ 100-: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 6 (200- 231+ 231+: 0 0 0) (200- 231+ 231+: 0 0 0) [1 1 1] 0 5 (100- 115+ 115+: 0 1 0) (100- 115+ 115+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -GraphAddEntries: 6 (231+ 231+ 231+: 0 0 0) (231+ 231+ 231+: 0 0 0) [1 1 1] 0 5 (115+ 115+ 115+: 0 1 0) (115+ 115+ 115+: 0 1 0) [1 1 1] 0 [0 1 2] 9 -1.000000 -############################################################# - -FacParts: 0 0 [1 1 1] -FacParts: 1 1 [2 2 2] -FacParts: 2 2 [2 2 2] -FacParts: 3 3 [2 2 2] -FacParts: 4 4 [2 2 2] -FacParts: 5 5 [2 2 2] -FacParts: 6 6 [2 2 2] - -ProcessPoolCreate: 1 - -# ProcessPoolSetPart: pool part -ProcessPoolSetPart: 0 0 -ProcessPoolSetPart: 0 1 -ProcessPoolSetPart: 0 2 -ProcessPoolSetPart: 0 3 -ProcessPoolSetPart: 0 4 -ProcessPoolSetPart: 0 5 -ProcessPoolSetPart: 0 6 diff --git a/src/test/TEST_fac/sstruct_fac.jobs b/src/test/TEST_fac/sstruct_fac.jobs deleted file mode 100755 index d3ae37e7ad..0000000000 --- a/src/test/TEST_fac/sstruct_fac.jobs +++ /dev/null @@ -1,35 +0,0 @@ -#!/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) - -#============================================================================= -# sstruct_fac: test suites for FAC solver. -#============================================================================= - -mpirun -np 1 ./sstruct_fac -in 3lev.in -solver 99 -r 2 1 1 > sstruct_fac.out.0 -mpirun -np 2 ./sstruct_fac -in 3lev.in -solver 99 -P 2 1 1 > sstruct_fac.out.1 - -# RDF: There is something wrong with the FAC code; these currently don't work -# mpirun -np 1 ./sstruct_fac -in 3lev_multibox.in -solver 99 -r 2 3 1 \ -# > sstruct_fac.out.2 -# mpirun -np 6 ./sstruct_fac -in 3lev_multibox.in -solver 99 -P 2 3 1 \ -# > sstruct_fac.out.3 - -# 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 - -# 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 -#mpirun -np 4 ./sstruct_fac -in 6lev.in -solver 99 -P 2 1 2 > sstruct_fac.out.9 - -mpirun -np 1 ./sstruct_fac -in 7lev.in -solver 99 -r 1 1 2 > sstruct_fac.out.10 -mpirun -np 2 ./sstruct_fac -in 7lev.in -solver 99 -P 1 1 2 > sstruct_fac.out.11 - - diff --git a/src/test/TEST_fac/sstruct_fac.saved b/src/test/TEST_fac/sstruct_fac.saved deleted file mode 100644 index 58746e20da..0000000000 --- a/src/test/TEST_fac/sstruct_fac.saved +++ /dev/null @@ -1,16 +0,0 @@ -# Output file: sstruct_fac.out.0 -Iterations = 14 -Final Relative Residual Norm = 9.546812e-07 - -# Output file: sstruct_fac.out.1 -Iterations = 14 -Final Relative Residual Norm = 9.546812e-07 - -# Output file: sstruct_fac.out.10 -Iterations = 14 -Final Relative Residual Norm = 7.049377e-07 - -# Output file: sstruct_fac.out.11 -Iterations = 14 -Final Relative Residual Norm = 7.049377e-07 - diff --git a/src/test/TEST_fac/sstruct_fac.sh b/src/test/TEST_fac/sstruct_fac.sh deleted file mode 100755 index ad4f0f7402..0000000000 --- a/src/test/TEST_fac/sstruct_fac.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/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` - -#============================================================================= -# sstruct_fac: Tests the sstruct_fac solver -#============================================================================= - -tail -3 ${TNAME}.out.0 > ${TNAME}.testdata -tail -3 ${TNAME}.out.1 > ${TNAME}.testdata.temp -diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 - -#============================================================================= - -# tail -3 ${TNAME}.out.2 > ${TNAME}.testdata -# tail -3 ${TNAME}.out.3 > ${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.8 > ${TNAME}.testdata -#tail -3 ${TNAME}.out.9 > ${TNAME}.testdata.temp -#diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 - -#============================================================================= - -tail -3 ${TNAME}.out.10 > ${TNAME}.testdata -tail -3 ${TNAME}.out.11 > ${TNAME}.testdata.temp -diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 - -#============================================================================= -# compare with baseline case -#============================================================================= - -FILES="\ - ${TNAME}.out.0\ - ${TNAME}.out.1\ - ${TNAME}.out.10\ - ${TNAME}.out.11\ -" -# ${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 -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 -f ${TNAME}.testdata* diff --git a/src/test/TEST_ij/coarsening.saved.lassen b/src/test/TEST_ij/coarsening.saved.lassen index e4e1f69a30..72a090f789 100644 --- a/src/test/TEST_ij/coarsening.saved.lassen +++ b/src/test/TEST_ij/coarsening.saved.lassen @@ -58,7 +58,7 @@ Final Relative Residual Norm = 9.673887e-09 # Output file: coarsening.out.11 BoomerAMG Iterations = 20 -Final Relative Residual Norm = 9.665671e-09 +Final Relative Residual Norm = 9.665672e-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.339080e-09 +Final Relative Residual Norm = 9.339079e-09 # Output file: coarsening.out.14 BoomerAMG Iterations = 10 diff --git a/src/test/TEST_ij/elast.saved.lassen b/src/test/TEST_ij/elast.saved.lassen index 98b7c2d262..14be7c6d13 100644 --- a/src/test/TEST_ij/elast.saved.lassen +++ b/src/test/TEST_ij/elast.saved.lassen @@ -1,6 +1,6 @@ # Output file: elast.out.0 Iterations = 15 -Final Relative Residual Norm = 3.696508e-09 +Final Relative Residual Norm = 3.696512e-09 # Output file: elast.out.1 Iterations = 19 @@ -24,7 +24,7 @@ Final Relative Residual Norm = 1.733122e-09 # Output file: elast.out.6 Iterations = 14 -Final Relative Residual Norm = 7.092333e-10 +Final Relative Residual Norm = 7.092339e-10 # Output file: elast.out.7 Iterations = 17 @@ -48,7 +48,7 @@ Final Relative Residual Norm = 5.897597e-09 # Output file: elast.out.12 Iterations = 15 -Final Relative Residual Norm = 3.696508e-09 +Final Relative Residual Norm = 3.696512e-09 # Output file: elast.out.13 Iterations = 19 @@ -56,7 +56,7 @@ Final Relative Residual Norm = 5.280302e-09 # Output file: elast.out.14 Iterations = 21 -Final Relative Residual Norm = 3.749017e-09 +Final Relative Residual Norm = 3.749018e-09 # Output file: elast.out.15 Iterations = 21 @@ -76,7 +76,7 @@ Final Relative Residual Norm = 2.390385e-09 # Output file: elast.out.19 Iterations = 21 -Final Relative Residual Norm = 3.749017e-09 +Final Relative Residual Norm = 3.749018e-09 # Output file: elast.out.20 Iterations = 29 diff --git a/src/test/TEST_ij/ilu.saved.lassen b/src/test/TEST_ij/ilu.saved.lassen index ba77e78517..b5f52d2a80 100644 --- a/src/test/TEST_ij/ilu.saved.lassen +++ b/src/test/TEST_ij/ilu.saved.lassen @@ -1,104 +1,104 @@ -# Output file: solvers.out.300 +# Output file: ilu.out.300 hypre_ILU Iterations = 85 Final Relative Residual Norm = 9.266244e-09 -# Output file: solvers.out.301 +# Output file: ilu.out.301 hypre_ILU Iterations = 40 Final Relative Residual Norm = 9.772377e-09 -# Output file: solvers.out.302 +# Output file: ilu.out.302 hypre_ILU Iterations = 23 Final Relative Residual Norm = 5.512717e-09 -# Output file: solvers.out.303 +# Output file: ilu.out.303 hypre_ILU Iterations = 64 Final Relative Residual Norm = 8.558467e-09 -# Output file: solvers.out.304 +# Output file: ilu.out.304 hypre_ILU Iterations = 52 Final Relative Residual Norm = 9.189235e-09 -# Output file: solvers.out.305 +# Output file: ilu.out.305 hypre_ILU Iterations = 39 -Final Relative Residual Norm = 8.838452e-09 +Final Relative Residual Norm = 8.838453e-09 -# Output file: solvers.out.306 +# Output file: ilu.out.306 hypre_ILU Iterations = 27 Final Relative Residual Norm = 6.194020e-09 -# Output file: solvers.out.307 +# Output file: ilu.out.307 hypre_ILU Iterations = 39 Final Relative Residual Norm = 6.866281e-09 -# Output file: solvers.out.308 +# Output file: ilu.out.308 hypre_ILU Iterations = 27 Final Relative Residual Norm = 9.107681e-09 -# Output file: solvers.out.309 +# Output file: ilu.out.309 hypre_ILU Iterations = 49 Final Relative Residual Norm = 7.072947e-09 -# Output file: solvers.out.310 +# Output file: ilu.out.310 hypre_ILU Iterations = 42 Final Relative Residual Norm = 6.699477e-09 -# Output file: solvers.out.311 -hypre_ILU Iterations = 35 +# Output file: ilu.out.311 +hypre_ILU Iterations = 36 Final Relative Residual Norm = 6.392185e-09 -# Output file: solvers.out.312 -hypre_ILU Iterations = 23 +# Output file: ilu.out.312 +hypre_ILU Iterations = 24 Final Relative Residual Norm = 5.953652e-09 -# Output file: solvers.out.313 +# Output file: ilu.out.313 GMRES Iterations = 25 Final GMRES Relative Residual Norm = 3.968804e-09 -# Output file: solvers.out.314 +# Output file: ilu.out.314 GMRES Iterations = 19 Final GMRES Relative Residual Norm = 7.026445e-09 -# Output file: solvers.out.315 +# Output file: ilu.out.315 GMRES Iterations = 20 Final GMRES Relative Residual Norm = 7.908624e-09 -# Output file: solvers.out.316 +# Output file: ilu.out.316 GMRES Iterations = 13 Final GMRES Relative Residual Norm = 7.969372e-09 -# Output file: solvers.out.317 +# Output file: ilu.out.317 FlexGMRES Iterations = 17 Final FlexGMRES Relative Residual Norm = 7.140004e-09 -# Output file: solvers.out.318 +# Output file: ilu.out.318 FlexGMRES Iterations = 9 Final FlexGMRES Relative Residual Norm = 9.362787e-09 -# Output file: solvers.out.319 +# Output file: ilu.out.319 FlexGMRES Iterations = 17 Final FlexGMRES Relative Residual Norm = 8.299377e-09 -# Output file: solvers.out.320 +# Output file: ilu.out.320 FlexGMRES Iterations = 9 Final FlexGMRES Relative Residual Norm = 3.716965e-09 -# Output file: solvers.out.321 +# Output file: ilu.out.321 FlexGMRES Iterations = 17 Final FlexGMRES Relative Residual Norm = 4.489256e-09 -# Output file: solvers.out.322 -FlexGMRES Iterations = 9 +# Output file: ilu.out.322 +FlexGMRES Iterations = 8 Final FlexGMRES Relative Residual Norm = 3.082447e-09 -# Output file: solvers.out.323 +# Output file: ilu.out.323 FlexGMRES Iterations = 18 Final FlexGMRES Relative Residual Norm = 3.782082e-09 -# Output file: solvers.out.324 +# Output file: ilu.out.324 BoomerAMG Iterations = 11 -Final Relative Residual Norm = 3.641397e-09 +Final Relative Residual Norm = 3.641398e-09 -# Output file: solvers.out.325 +# Output file: ilu.out.325 BoomerAMG Iterations = 9 Final Relative Residual Norm = 3.551558e-09 diff --git a/src/test/TEST_ij/mgr.jobs b/src/test/TEST_ij/mgr.jobs new file mode 100644 index 0000000000..21d8aba1d6 --- /dev/null +++ b/src/test/TEST_ij/mgr.jobs @@ -0,0 +1,31 @@ +#!/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) + +# MGR and MGR-PCG +# +# coarse grid solver checks (1-level MGR == AMG (or coarse grid solver)) +# Also checks for keeping coarse nodes to coarsest level +# coarse grid size in output should be ~ mgr_num_reserved_nodes +mpirun -np 2 ./ij -solver 70 -mgr_nlevels 0 -mgr_bsize 2 -mgr_num_reserved_nodes 0 > mgr.out.200 +mpirun -np 2 ./ij -solver 70 -mgr_nlevels 0 -mgr_bsize 2 -mgr_num_reserved_nodes 100 > mgr.out.201 +mpirun -np 2 ./ij -solver 70 -mgr_nlevels 1 -mgr_bsize 1 -mgr_num_reserved_nodes 0 > mgr.out.202 +mpirun -np 2 ./ij -solver 70 -mgr_nlevels 1 -mgr_bsize 1 -mgr_num_reserved_nodes 100 > mgr.out.203 +# multi level MGR tests with different coarse grid type strategies +# Fix non C points to F points with different F-relaxation methods (single/multilevel F-relaxation) +# with/ without reserved coarse nodes +mpirun -np 2 ./ij -solver 70 -mgr_nlevels 1 -mgr_bsize 2 -mgr_non_c_to_f 1 -mgr_frelax_method 0 -mgr_num_reserved_nodes 0 > mgr.out.204 +mpirun -np 2 ./ij -solver 70 -mgr_nlevels 1 -mgr_bsize 2 -mgr_non_c_to_f 1 -mgr_frelax_method 0 -mgr_num_reserved_nodes 100 > mgr.out.205 +mpirun -np 2 ./ij -solver 70 -mgr_nlevels 1 -mgr_bsize 2 -mgr_non_c_to_f 1 -mgr_frelax_method 1 -mgr_num_reserved_nodes 0 > mgr.out.206 +mpirun -np 2 ./ij -solver 70 -mgr_nlevels 1 -mgr_bsize 2 -mgr_non_c_to_f 1 -mgr_frelax_method 1 -mgr_num_reserved_nodes 100 > mgr.out.207 +# Not fixed non C points to F points with different F-relaxation methods (single/multilevel F-relaxation) +# with/ without reserved coarse nodes +mpirun -np 2 ./ij -solver 70 -mgr_nlevels 5 -mgr_bsize 2 -mgr_non_c_to_f 0 -mgr_frelax_method 0 -mgr_num_reserved_nodes 0 > mgr.out.208 +mpirun -np 2 ./ij -solver 70 -mgr_nlevels 5 -mgr_bsize 2 -mgr_non_c_to_f 0 -mgr_frelax_method 0 -mgr_num_reserved_nodes 100 > mgr.out.209 +mpirun -np 2 ./ij -solver 70 -mgr_nlevels 5 -mgr_bsize 2 -mgr_non_c_to_f 0 -mgr_frelax_method 1 -mgr_num_reserved_nodes 0 > mgr.out.210 +mpirun -np 2 ./ij -solver 70 -mgr_nlevels 5 -mgr_bsize 2 -mgr_non_c_to_f 0 -mgr_frelax_method 1 -mgr_num_reserved_nodes 100 > mgr.out.211 +# MGR-PCG tests +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 > mgr.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 > mgr.out.213 diff --git a/src/test/TEST_ij/mgr.saved b/src/test/TEST_ij/mgr.saved new file mode 100644 index 0000000000..26e43a3d79 --- /dev/null +++ b/src/test/TEST_ij/mgr.saved @@ -0,0 +1,55 @@ +# 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 diff --git a/src/test/TEST_ij/mgr.saved.aurora b/src/test/TEST_ij/mgr.saved.aurora new file mode 100644 index 0000000000..a13d68d62d --- /dev/null +++ b/src/test/TEST_ij/mgr.saved.aurora @@ -0,0 +1,55 @@ +# 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 diff --git a/src/test/TEST_ij/mgr.saved.lassen b/src/test/TEST_ij/mgr.saved.lassen new file mode 100644 index 0000000000..1dcac8663a --- /dev/null +++ b/src/test/TEST_ij/mgr.saved.lassen @@ -0,0 +1,55 @@ +# Output file: solvers.out.200 +MGR Iterations = 9 +Final Relative Residual Norm = 1.190910e-09 + +# Output file: solvers.out.201 +MGR Iterations = 8 +Final Relative Residual Norm = 8.020893e-09 + +# Output file: solvers.out.202 +MGR Iterations = 9 +Final Relative Residual Norm = 1.190910e-09 + +# Output file: solvers.out.203 +MGR Iterations = 8 +Final Relative Residual Norm = 8.020893e-09 + +# Output file: solvers.out.204 +MGR Iterations = 74 +Final Relative Residual Norm = 9.138946e-09 + +# Output file: solvers.out.205 +MGR Iterations = 70 +Final Relative Residual Norm = 9.891106e-09 + +# Output file: solvers.out.206 +MGR Iterations = 36 +Final Relative Residual Norm = 6.705837e-09 + +# Output file: solvers.out.207 +MGR Iterations = 35 +Final Relative Residual Norm = 5.956428e-09 + +# Output file: solvers.out.208 +MGR Iterations = 46 +Final Relative Residual Norm = 7.265172e-09 + +# Output file: solvers.out.209 +MGR Iterations = 44 +Final Relative Residual Norm = 6.813070e-09 + +# Output file: solvers.out.210 +MGR Iterations = 31 +Final Relative Residual Norm = 6.919435e-09 + +# Output file: solvers.out.211 +MGR Iterations = 29 +Final Relative Residual Norm = 6.915185e-09 + +# Output file: solvers.out.212 +Iterations = 35 +Final Relative Residual Norm = 9.984248e-09 + +# Output file: solvers.out.213 +Iterations = 26 +Final Relative Residual Norm = 9.220161e-09 diff --git a/src/test/TEST_ij/mgr.saved.lassen_cpu b/src/test/TEST_ij/mgr.saved.lassen_cpu new file mode 100644 index 0000000000..26e43a3d79 --- /dev/null +++ b/src/test/TEST_ij/mgr.saved.lassen_cpu @@ -0,0 +1,55 @@ +# 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 diff --git a/src/test/TEST_sstruct/maxwell.sh b/src/test/TEST_ij/mgr.sh similarity index 57% rename from src/test/TEST_sstruct/maxwell.sh rename to src/test/TEST_ij/mgr.sh index b5389bd1f2..2c327b379c 100755 --- a/src/test/TEST_sstruct/maxwell.sh +++ b/src/test/TEST_ij/mgr.sh @@ -9,34 +9,51 @@ RTOL=$1 ATOL=$2 #============================================================================= -# no test comparison for now. Just a holder file with fake tests. Hard to -# develop tests because of the coarsening scheme. +# IJ: MGR case nlevels < 1 and bsize < 2 should be the same +# compare results #============================================================================= -tail -3 ${TNAME}.out.0 > ${TNAME}.testdata -tail -3 ${TNAME}.out.0 > ${TNAME}.testdata.temp -(../runcheck.sh ${TNAME}.testdata ${TNAME}.testdata.temp $RTOL $ATOL) >&2 +tail -17 ${TNAME}.out.200 | head -6 > ${TNAME}.mgr_testdata #============================================================================= -tail -3 ${TNAME}.out.1 > ${TNAME}.testdata -tail -3 ${TNAME}.out.1 > ${TNAME}.testdata.temp -(../runcheck.sh ${TNAME}.testdata ${TNAME}.testdata.temp $RTOL $ATOL) >&2 -#============================================================================= -tail -3 ${TNAME}.out.2 > ${TNAME}.testdata -tail -3 ${TNAME}.out.2 > ${TNAME}.testdata.temp -(../runcheck.sh ${TNAME}.testdata ${TNAME}.testdata.temp $RTOL $ATOL) >&2 +tail -17 ${TNAME}.out.202 | head -6 > ${TNAME}.mgr_testdata.temp +diff ${TNAME}.mgr_testdata ${TNAME}.mgr_testdata.temp >&2 #============================================================================= # compare with baseline case #============================================================================= FILES="\ - ${TNAME}.out.0\ - ${TNAME}.out.1\ - ${TNAME}.out.2\ + ${TNAME}.out.200\ + ${TNAME}.out.201\ + ${TNAME}.out.202\ + ${TNAME}.out.203\ + ${TNAME}.out.204\ + ${TNAME}.out.205\ + ${TNAME}.out.206\ + ${TNAME}.out.207\ + ${TNAME}.out.208\ + ${TNAME}.out.209\ + ${TNAME}.out.210\ + ${TNAME}.out.211\ + ${TNAME}.out.212\ + ${TNAME}.out.213\ " +for i in $FILES +do + echo "# Output file: $i" + tail -3 $i +done > ${TNAME}.out.e + +# Make sure that the output file is reasonable +RUNCOUNT=`echo $FILES | wc -w` +OUTCOUNT=`grep "Iterations" ${TNAME}.out.e | wc -l` +if [ "$OUTCOUNT" != "$RUNCOUNT" ]; then + echo "Incorrect number of runs in ${TNAME}.out" >&2 +fi + for i in $FILES do echo "# Output file: $i" @@ -54,4 +71,4 @@ fi # remove temporary files #============================================================================= -rm -f ${TNAME}.testdata* +rm -r ${TNAME}.mgr_testdata* diff --git a/src/test/TEST_ij/solvers.jobs b/src/test/TEST_ij/solvers.jobs index c3f06e80f0..4f0a6c61d4 100755 --- a/src/test/TEST_ij/solvers.jobs +++ b/src/test/TEST_ij/solvers.jobs @@ -105,33 +105,6 @@ mpirun -np 8 ./ij -n 40 40 40 -P 2 2 2 -nongalerk_tol 3 0.0 0.01 0.05 > solvers. mpirun -np 8 ./ij -n 40 40 40 -P 2 2 2 -solver 3 -rap 0 > solvers.out.116 mpirun -np 8 ./ij -n 40 40 40 -P 2 2 2 -solver 3 -rap 1 > solvers.out.117 -# -# MGR and MGR-PCG -# -# coarse grid solver checks (1-level MGR == AMG (or coarse grid solver)) -# Also checks for keeping coarse nodes to coarsest level -# coarse grid size in output should be ~ mgr_num_reserved_nodes -mpirun -np 2 ./ij -solver 70 -mgr_nlevels 0 -mgr_bsize 2 -mgr_num_reserved_nodes 0 > solvers.out.200 -mpirun -np 2 ./ij -solver 70 -mgr_nlevels 0 -mgr_bsize 2 -mgr_num_reserved_nodes 100 > solvers.out.201 -mpirun -np 2 ./ij -solver 70 -mgr_nlevels 1 -mgr_bsize 1 -mgr_num_reserved_nodes 0 > solvers.out.202 -mpirun -np 2 ./ij -solver 70 -mgr_nlevels 1 -mgr_bsize 1 -mgr_num_reserved_nodes 100 > solvers.out.203 -# multi level MGR tests with different coarse grid type strategies -# Fix non C points to F points with different F-relaxation methods (single/multilevel F-relaxation) -# with/ without reserved coarse nodes -mpirun -np 2 ./ij -solver 70 -mgr_nlevels 1 -mgr_bsize 2 -mgr_non_c_to_f 1 -mgr_frelax_method 0 -mgr_num_reserved_nodes 0 > solvers.out.204 -mpirun -np 2 ./ij -solver 70 -mgr_nlevels 1 -mgr_bsize 2 -mgr_non_c_to_f 1 -mgr_frelax_method 0 -mgr_num_reserved_nodes 100 > solvers.out.205 -mpirun -np 2 ./ij -solver 70 -mgr_nlevels 1 -mgr_bsize 2 -mgr_non_c_to_f 1 -mgr_frelax_method 1 -mgr_num_reserved_nodes 0 > solvers.out.206 -mpirun -np 2 ./ij -solver 70 -mgr_nlevels 1 -mgr_bsize 2 -mgr_non_c_to_f 1 -mgr_frelax_method 1 -mgr_num_reserved_nodes 100 > solvers.out.207 -# Not fixed non C points to F points with different F-relaxation methods (single/multilevel F-relaxation) -# with/ without reserved coarse nodes -mpirun -np 2 ./ij -solver 70 -mgr_nlevels 5 -mgr_bsize 2 -mgr_non_c_to_f 0 -mgr_frelax_method 0 -mgr_num_reserved_nodes 0 > solvers.out.208 -mpirun -np 2 ./ij -solver 70 -mgr_nlevels 5 -mgr_bsize 2 -mgr_non_c_to_f 0 -mgr_frelax_method 0 -mgr_num_reserved_nodes 100 > solvers.out.209 -mpirun -np 2 ./ij -solver 70 -mgr_nlevels 5 -mgr_bsize 2 -mgr_non_c_to_f 0 -mgr_frelax_method 1 -mgr_num_reserved_nodes 0 > solvers.out.210 -mpirun -np 2 ./ij -solver 70 -mgr_nlevels 5 -mgr_bsize 2 -mgr_non_c_to_f 0 -mgr_frelax_method 1 -mgr_num_reserved_nodes 100 > solvers.out.211 -# MGR-PCG tests -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 - ## 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/src/test/TEST_ij/solvers.saved b/src/test/TEST_ij/solvers.saved index 1e202b3872..834f169cbe 100644 --- a/src/test/TEST_ij/solvers.saved +++ b/src/test/TEST_ij/solvers.saved @@ -261,62 +261,6 @@ Final GMRES Relative Residual Norm = 3.995718e-09 GMRES Iterations = 17 Final GMRES Relative Residual Norm = 3.995718e-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 diff --git a/src/test/TEST_ij/solvers.saved.aurora b/src/test/TEST_ij/solvers.saved.aurora index 4c1d3a97c1..0c92fa0bbb 100644 --- a/src/test/TEST_ij/solvers.saved.aurora +++ b/src/test/TEST_ij/solvers.saved.aurora @@ -261,62 +261,6 @@ Final GMRES Relative Residual Norm = 9.374280e-09 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 diff --git a/src/test/TEST_ij/solvers.saved.lassen b/src/test/TEST_ij/solvers.saved.lassen index efeca760ba..6d338d70a8 100644 --- a/src/test/TEST_ij/solvers.saved.lassen +++ b/src/test/TEST_ij/solvers.saved.lassen @@ -261,62 +261,6 @@ Final GMRES Relative Residual Norm = 5.040776e-09 GMRES Iterations = 19 Final GMRES Relative Residual Norm = 5.041386e-09 -# Output file: solvers.out.200 -MGR Iterations = 8 -Final Relative Residual Norm = 7.317392e-09 - -# Output file: solvers.out.201 -MGR Iterations = 9 -Final Relative Residual Norm = 1.802890e-09 - -# Output file: solvers.out.202 -MGR Iterations = 8 -Final Relative Residual Norm = 7.317392e-09 - -# Output file: solvers.out.203 -MGR Iterations = 9 -Final Relative Residual Norm = 1.802890e-09 - -# Output file: solvers.out.204 -MGR Iterations = 74 -Final Relative Residual Norm = 9.563442e-09 - -# Output file: solvers.out.205 -MGR Iterations = 71 -Final Relative Residual Norm = 8.505703e-09 - -# Output file: solvers.out.206 -MGR Iterations = 52 -Final Relative Residual Norm = 8.514201e-09 - -# Output file: solvers.out.207 -MGR Iterations = 50 -Final Relative Residual Norm = 9.941525e-09 - -# Output file: solvers.out.208 -MGR Iterations = 16 -Final Relative Residual Norm = 5.064272e-09 - -# Output file: solvers.out.209 -MGR Iterations = 15 -Final Relative Residual Norm = 7.693914e-09 - -# Output file: solvers.out.210 -MGR Iterations = 23 -Final Relative Residual Norm = 4.625304e-09 - -# Output file: solvers.out.211 -MGR Iterations = 29 -Final Relative Residual Norm = 8.665192e-09 - -# Output file: solvers.out.212 -Iterations = 11 -Final Relative Residual Norm = 3.738613e-09 - -# Output file: solvers.out.213 -Iterations = 29 -Final Relative Residual Norm = 5.268647e-09 - # Output file: solvers.out.404 Iterations = 28 Final Relative Residual Norm = 8.548826e-09 diff --git a/src/test/TEST_ij/solvers.saved.lassen_cpu b/src/test/TEST_ij/solvers.saved.lassen_cpu index e568c208ab..089b160a3a 100644 --- a/src/test/TEST_ij/solvers.saved.lassen_cpu +++ b/src/test/TEST_ij/solvers.saved.lassen_cpu @@ -261,62 +261,6 @@ Final GMRES Relative Residual Norm = 3.995718e-09 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 diff --git a/src/test/TEST_ij/solvers.sh b/src/test/TEST_ij/solvers.sh index ecdf3b3999..6cd6dd2dc3 100755 --- a/src/test/TEST_ij/solvers.sh +++ b/src/test/TEST_ij/solvers.sh @@ -20,18 +20,6 @@ tail -17 ${TNAME}.out.109 | head -6 > ${TNAME}.testdata tail -17 ${TNAME}.out.110 | head -6 > ${TNAME}.testdata.temp diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 -#============================================================================= -# IJ: MGR case nlevels < 1 and bsize < 2 should be the same -# compare results -#============================================================================= - -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 - #============================================================================= # compare with baseline case #============================================================================= @@ -157,20 +145,6 @@ if [ "$OUTCOUNT" != "$RUNCOUNT" ]; then fi FILES="\ - ${TNAME}.out.200\ - ${TNAME}.out.201\ - ${TNAME}.out.202\ - ${TNAME}.out.203\ - ${TNAME}.out.204\ - ${TNAME}.out.205\ - ${TNAME}.out.206\ - ${TNAME}.out.207\ - ${TNAME}.out.208\ - ${TNAME}.out.209\ - ${TNAME}.out.210\ - ${TNAME}.out.211\ - ${TNAME}.out.212\ - ${TNAME}.out.213\ ${TNAME}.out.404\ ${TNAME}.out.405\ " @@ -248,4 +222,3 @@ cat ${TNAME}.out.[a-z] > ${TNAME}.out #============================================================================= rm -f ${TNAME}.testdata* -rm -r ${TNAME}.mgr_testdata* diff --git a/src/test/TEST_lobpcg/sstruct.jobs b/src/test/TEST_lobpcg/sstruct.jobs index 7910745f9a..ae59fedc1a 100755 --- a/src/test/TEST_lobpcg/sstruct.jobs +++ b/src/test/TEST_lobpcg/sstruct.jobs @@ -13,21 +13,21 @@ #============================================================================= # PCG run... LOBPCG run for one eigenpair ... LOBPCG run for 4 eigenpairs -mpirun -np 2 ./sstruct -P 1 1 2 -solver 10 -tol 1.e-6 > sstruct.out.10.lobpcg -mpirun -np 2 ./sstruct -P 1 1 2 -lobpcg -solver 10 -tol 1.e-6 -pcgitr 0 -seed 1 -vrand 1 > sstruct.out.10.lobpcg.1 -mpirun -np 2 ./sstruct -P 1 1 2 -lobpcg -solver 10 -tol 1.e-6 -pcgitr 0 -seed 1 -vrand 4 > sstruct.out.10.lobpcg.4 +mpirun -np 2 ./sstruct -in sstruct.in.default -P 1 1 2 -solver 10 -tol 1.e-6 > sstruct.out.10.lobpcg +mpirun -np 2 ./sstruct -in sstruct.in.default -P 1 1 2 -lobpcg -solver 10 -tol 1.e-6 -pcgitr 0 -seed 1 -vrand 1 > sstruct.out.10.lobpcg.1 +mpirun -np 2 ./sstruct -in sstruct.in.default -P 1 1 2 -lobpcg -solver 10 -tol 1.e-6 -pcgitr 0 -seed 1 -vrand 4 > sstruct.out.10.lobpcg.4 # PCG run... LOBPCG run for one eigenpair ... LOBPCG run for 4 eigenpairs -mpirun -np 2 ./sstruct -P 1 1 2 -solver 11 -tol 1.e-6 > sstruct.out.11.lobpcg -mpirun -np 2 ./sstruct -P 1 1 2 -lobpcg -solver 11 -tol 1.e-6 -pcgitr 0 -seed 1 -vrand 1 > sstruct.out.11.lobpcg.1 -mpirun -np 2 ./sstruct -P 1 1 2 -lobpcg -solver 11 -tol 1.e-6 -pcgitr 0 -seed 1 -vrand 4 > sstruct.out.11.lobpcg.4 +mpirun -np 2 ./sstruct -in sstruct.in.default -P 1 1 2 -solver 11 -tol 1.e-6 > sstruct.out.11.lobpcg +mpirun -np 2 ./sstruct -in sstruct.in.default -P 1 1 2 -lobpcg -solver 11 -tol 1.e-6 -pcgitr 0 -seed 1 -vrand 1 > sstruct.out.11.lobpcg.1 +mpirun -np 2 ./sstruct -in sstruct.in.default -P 1 1 2 -lobpcg -solver 11 -tol 1.e-6 -pcgitr 0 -seed 1 -vrand 4 > sstruct.out.11.lobpcg.4 # PCG run... LOBPCG run for one eigenpair ... LOBPCG run for 4 eigenpairs -mpirun -np 2 ./sstruct -P 1 1 2 -solver 18 > sstruct.out.18.lobpcg -mpirun -np 2 ./sstruct -P 1 1 2 -lobpcg -solver 18 -tol 1.e-6 -pcgitr 10 -seed 1 -vrand 1 > sstruct.out.18.lobpcg.1 -mpirun -np 2 ./sstruct -P 1 1 2 -lobpcg -solver 18 -tol 1.e-6 -pcgitr 10 -seed 1 -vrand 4 > sstruct.out.18.lobpcg.4 +mpirun -np 2 ./sstruct -in sstruct.in.default -P 1 1 2 -solver 18 > sstruct.out.18.lobpcg +mpirun -np 2 ./sstruct -in sstruct.in.default -P 1 1 2 -lobpcg -solver 18 -tol 1.e-6 -pcgitr 10 -seed 1 -vrand 1 > sstruct.out.18.lobpcg.1 +mpirun -np 2 ./sstruct -in sstruct.in.default -P 1 1 2 -lobpcg -solver 18 -tol 1.e-6 -pcgitr 10 -seed 1 -vrand 4 > sstruct.out.18.lobpcg.4 # PCG run... LOBPCG run for one eigenpair ... LOBPCG run for 4 eigenpairs -mpirun -np 2 ./sstruct -P 1 1 2 -solver 19 > sstruct.out.19.lobpcg -mpirun -np 2 ./sstruct -P 1 1 2 -lobpcg -solver 19 -tol 1.e-6 -pcgitr 10 -seed 1 -vrand 1 > sstruct.out.19.lobpcg.1 -mpirun -np 2 ./sstruct -P 1 1 2 -lobpcg -solver 19 -tol 1.e-6 -pcgitr 10 -seed 1 -vrand 4 > sstruct.out.19.lobpcg.4 +mpirun -np 2 ./sstruct -in sstruct.in.default -P 1 1 2 -solver 19 > sstruct.out.19.lobpcg +mpirun -np 2 ./sstruct -in sstruct.in.default -P 1 1 2 -lobpcg -solver 19 -tol 1.e-6 -pcgitr 10 -seed 1 -vrand 1 > sstruct.out.19.lobpcg.1 +mpirun -np 2 ./sstruct -in sstruct.in.default -P 1 1 2 -lobpcg -solver 19 -tol 1.e-6 -pcgitr 10 -seed 1 -vrand 4 > sstruct.out.19.lobpcg.4 diff --git a/src/test/TEST_lobpcg/sstruct.saved b/src/test/TEST_lobpcg/sstruct.saved index 4bcd512592..6774eef323 100644 --- a/src/test/TEST_lobpcg/sstruct.saved +++ b/src/test/TEST_lobpcg/sstruct.saved @@ -3,70 +3,70 @@ Iterations = 24 Final Relative Residual Norm = 6.429522e-07 # Output file: sstruct.out.10.lobpcg.1 -Eigenvalue lambda 1.34880853089918e+00 -Residual 1.40515754419491e-04 +Eigenvalue lambda 1.34880851291473e+00 +Residual 1.13196753319469e-04 # Output file: sstruct.out.10.lobpcg.4 Eigenvalue lambda 1.34880848246852e+00 -Eigenvalue lambda 1.36560847743334e+00 -Eigenvalue lambda 1.47908699641636e+00 -Eigenvalue lambda 1.49589925873578e+00 -Residual 1.88411068757809e-06 -Residual 1.92352730596892e-06 -Residual 2.62402461132032e-06 -Residual 5.33772292781341e-06 +Eigenvalue lambda 1.36560847743297e+00 +Eigenvalue lambda 1.47908699641157e+00 +Eigenvalue lambda 1.49589925873675e+00 +Residual 2.14854604026010e-06 +Residual 1.89806100160513e-06 +Residual 2.46922306733655e-06 +Residual 5.84373095134963e-06 # Output file: sstruct.out.11.lobpcg Iterations = 24 -Final Relative Residual Norm = 6.654613e-07 +Final Relative Residual Norm = 6.481534e-07 # Output file: sstruct.out.11.lobpcg.1 -Eigenvalue lambda 1.34880853049719e+00 -Residual 1.27609473238620e-04 +Eigenvalue lambda 1.34880851659709e+00 +Residual 1.22612932523255e-04 # Output file: sstruct.out.11.lobpcg.4 -Eigenvalue lambda 1.34880848246868e+00 -Eigenvalue lambda 1.36560847743149e+00 -Eigenvalue lambda 1.47908699638228e+00 -Eigenvalue lambda 1.49589925867103e+00 -Residual 2.34138563461796e-06 -Residual 2.11050112612293e-06 -Residual 2.34272528133832e-06 -Residual 4.55132485053271e-06 +Eigenvalue lambda 1.34880848246889e+00 +Eigenvalue lambda 1.36560847743071e+00 +Eigenvalue lambda 1.47908699641205e+00 +Eigenvalue lambda 1.49589925867474e+00 +Residual 1.73448122329495e-06 +Residual 2.12909870577413e-06 +Residual 2.40566912021764e-06 +Residual 4.35706514638339e-06 # Output file: sstruct.out.18.lobpcg Iterations = 25 Final Relative Residual Norm = 9.124482e-07 # Output file: sstruct.out.18.lobpcg.1 -Eigenvalue lambda 1.34880848247421e+00 -Residual 1.68760664468992e-06 +Eigenvalue lambda 1.34880848247212e+00 +Residual 1.17777152772256e-06 # Output file: sstruct.out.18.lobpcg.4 -Eigenvalue lambda 1.34880848246833e+00 -Eigenvalue lambda 1.36560847743301e+00 -Eigenvalue lambda 1.47908699641137e+00 -Eigenvalue lambda 1.49589925871590e+00 -Residual 7.29467860779249e-07 -Residual 9.62135023675930e-07 -Residual 1.05238502112812e-06 -Residual 1.42836272383011e-06 +Eigenvalue lambda 1.34880848246843e+00 +Eigenvalue lambda 1.36560847743469e+00 +Eigenvalue lambda 1.47908699642327e+00 +Eigenvalue lambda 1.49589925872068e+00 +Residual 2.18677284345479e-06 +Residual 1.21745237775613e-06 +Residual 1.94409509845416e-06 +Residual 2.29794079627551e-06 # Output file: sstruct.out.19.lobpcg Iterations = 25 Final Relative Residual Norm = 9.124482e-07 # Output file: sstruct.out.19.lobpcg.1 -Eigenvalue lambda 1.34880848247421e+00 -Residual 1.68760664640186e-06 +Eigenvalue lambda 1.34880848247213e+00 +Residual 1.17777152797459e-06 # Output file: sstruct.out.19.lobpcg.4 -Eigenvalue lambda 1.34880848246915e+00 -Eigenvalue lambda 1.36560847743475e+00 -Eigenvalue lambda 1.47908699641975e+00 -Eigenvalue lambda 1.49589925875392e+00 -Residual 7.29467866482847e-07 -Residual 9.62135024900930e-07 -Residual 1.05238500241244e-06 -Residual 1.42836275555007e-06 +Eigenvalue lambda 1.34880848246839e+00 +Eigenvalue lambda 1.36560847743003e+00 +Eigenvalue lambda 1.47908699641827e+00 +Eigenvalue lambda 1.49589925871966e+00 +Residual 2.18677282105352e-06 +Residual 1.21745237200013e-06 +Residual 1.94409507254891e-06 +Residual 2.29794060640330e-06 diff --git a/src/test/TEST_lobpcg/struct.jobs b/src/test/TEST_lobpcg/struct.jobs index 6def4bf517..e12b145cdf 100755 --- a/src/test/TEST_lobpcg/struct.jobs +++ b/src/test/TEST_lobpcg/struct.jobs @@ -15,8 +15,8 @@ # PCG run... LOBPCG with one eigenpair .... LOBPCG with 5 eigenpairs mpirun -np 2 ./struct -solver 10 -tol 1.e-6 > struct.out.10.lobpcg -mpirun -np 2 ./struct -lobpcg -solver 10 -tol 1.e-6 -pcgitr 0 -seed 1 -vrand 1 > struct.out.10.lobpcg.1 -mpirun -np 2 ./struct -lobpcg -solver 10 -tol 1.e-6 -pcgitr 0 -seed 1 -vrand 5 > struct.out.10.lobpcg.5 +mpirun -np 2 ./struct -lobpcg -solver 10 -tol 1.e-6 -pcgitr 0 -seed 1 -vrand 1 > struct.out.10.lobpcg.1 +mpirun -np 2 ./struct -lobpcg -solver 10 -tol 1.e-6 -pcgitr 0 -seed 1 -vrand 5 > struct.out.10.lobpcg.5 # PCG run... LOBPCG with one eigenpair .... LOBPCG with 5 eigenpairs mpirun -np 2 ./struct -solver 11 -tol 1.e-6 > struct.out.11.lobpcg diff --git a/src/test/TEST_lobpcg/struct.saved b/src/test/TEST_lobpcg/struct.saved index 472dc5e61a..6cdee31a60 100644 --- a/src/test/TEST_lobpcg/struct.saved +++ b/src/test/TEST_lobpcg/struct.saved @@ -4,59 +4,59 @@ Final Relative Residual Norm = 1.355288e-07 # Output file: struct.out.10.lobpcg.1 Eigenvalue lambda 1.84366453091860e-01 -Residual 4.52048636947317e-07 +Residual 4.52048636955569e-07 # Output file: struct.out.10.lobpcg.5 Eigenvalue lambda 1.84366453091770e-01 -Eigenvalue lambda 2.50882493969728e-01 +Eigenvalue lambda 2.50882493969732e-01 Eigenvalue lambda 3.60090369737200e-01 Eigenvalue lambda 4.20845334658571e-01 -Eigenvalue lambda 4.20845334658890e-01 -Residual 3.35930189890736e-07 -Residual 3.11260814535858e-07 -Residual 7.33053164875689e-07 -Residual 5.14259223167152e-07 -Residual 7.32161520953280e-07 +Eigenvalue lambda 4.20845334658893e-01 +Residual 3.35930189896917e-07 +Residual 3.11260813990546e-07 +Residual 7.33053165535950e-07 +Residual 5.14260012363237e-07 +Residual 7.32169048210362e-07 # Output file: struct.out.11.lobpcg Iterations = 8 Final Relative Residual Norm = 4.807900e-07 # Output file: struct.out.11.lobpcg.1 -Eigenvalue lambda 1.84366453092321e-01 -Residual 1.05361158867902e-06 +Eigenvalue lambda 1.84366453092320e-01 +Residual 1.05361158874624e-06 # Output file: struct.out.11.lobpcg.5 Eigenvalue lambda 1.84366453091757e-01 -Eigenvalue lambda 2.50882493969850e-01 -Eigenvalue lambda 3.60090369737248e-01 -Eigenvalue lambda 4.20845334660032e-01 -Eigenvalue lambda 4.20845334660335e-01 -Residual 1.94648827548280e-07 -Residual 1.22160192296946e-06 -Residual 7.71834587887496e-07 -Residual 1.28057007298605e-06 -Residual 1.26140377965945e-06 +Eigenvalue lambda 2.50882493969852e-01 +Eigenvalue lambda 3.60090369737247e-01 +Eigenvalue lambda 4.20845334660033e-01 +Eigenvalue lambda 4.20845334660336e-01 +Residual 1.94648827517382e-07 +Residual 1.22160192268050e-06 +Residual 7.71834587945219e-07 +Residual 1.28057062320059e-06 +Residual 1.26086900595451e-06 # Output file: struct.out.17.lobpcg Iterations = 17 Final Relative Residual Norm = 8.241147e-07 # Output file: struct.out.17.lobpcg.1 -Eigenvalue lambda 1.84366453091822e-01 -Residual 2.74559569275018e-07 +Eigenvalue lambda 1.84366453091821e-01 +Residual 2.74559569029292e-07 # Output file: struct.out.17.lobpcg.5 -Eigenvalue lambda 1.84366453091761e-01 -Eigenvalue lambda 2.50882493969754e-01 -Eigenvalue lambda 3.60090369737181e-01 +Eigenvalue lambda 1.84366453091760e-01 +Eigenvalue lambda 2.50882493969753e-01 +Eigenvalue lambda 3.60090369737182e-01 Eigenvalue lambda 4.20845334658550e-01 -Eigenvalue lambda 4.20845334658985e-01 -Residual 2.50212530703055e-07 -Residual 1.21296920560361e-06 -Residual 7.17050537726402e-07 -Residual 8.69189255964679e-07 -Residual 8.69185724273522e-07 +Eigenvalue lambda 4.20845334658984e-01 +Residual 2.50212530624533e-07 +Residual 1.21296920486114e-06 +Residual 7.17050537511296e-07 +Residual 8.69169706389194e-07 +Residual 8.69081951002182e-07 # Output file: struct.out.18.lobpcg Iterations = 32 @@ -64,19 +64,19 @@ Final Relative Residual Norm = 8.259590e-07 # Output file: struct.out.18.lobpcg.1 Eigenvalue lambda 1.84366453091920e-01 -Residual 4.04811751101852e-07 +Residual 4.04811750786028e-07 # Output file: struct.out.18.lobpcg.5 Eigenvalue lambda 1.84366453091760e-01 -Eigenvalue lambda 2.50882493969440e-01 -Eigenvalue lambda 3.60090369737180e-01 -Eigenvalue lambda 4.20845334658791e-01 -Eigenvalue lambda 4.20845334659400e-01 -Residual 6.51620151548372e-07 -Residual 1.04113397676966e-06 -Residual 1.05795257133655e-06 -Residual 1.01625954175797e-06 -Residual 1.09288008877697e-06 +Eigenvalue lambda 2.50882493969379e-01 +Eigenvalue lambda 3.60090369737170e-01 +Eigenvalue lambda 4.20845334658731e-01 +Eigenvalue lambda 4.20845334659261e-01 +Residual 6.51620151787217e-07 +Residual 1.04113397708666e-06 +Residual 1.05795257648820e-06 +Residual 1.01626142838499e-06 +Residual 1.09712229812556e-06 # Output file: struct.out.19.lobpcg Iterations = 32 @@ -84,17 +84,17 @@ Final Relative Residual Norm = 8.259590e-07 # Output file: struct.out.19.lobpcg.1 Eigenvalue lambda 1.84366453091920e-01 -Residual 4.04811751079993e-07 +Residual 4.04811750898001e-07 # Output file: struct.out.19.lobpcg.5 Eigenvalue lambda 1.84366453091760e-01 -Eigenvalue lambda 2.50882493969706e-01 -Eigenvalue lambda 3.60090369737178e-01 -Eigenvalue lambda 4.20845334658819e-01 -Eigenvalue lambda 4.20845334659484e-01 -Residual 6.51620151941224e-07 -Residual 1.04113396974827e-06 -Residual 1.05795252287838e-06 -Residual 1.01635836602686e-06 -Residual 1.09013903468312e-06 +Eigenvalue lambda 2.50882493968795e-01 +Eigenvalue lambda 3.60090369737133e-01 +Eigenvalue lambda 4.20845334658629e-01 +Eigenvalue lambda 4.20845334659096e-01 +Residual 6.51620151087293e-07 +Residual 1.04113397934724e-06 +Residual 1.05795257595568e-06 +Residual 1.01623338757989e-06 +Residual 1.10057403941947e-06 diff --git a/src/test/TEST_longdouble/solvers_struct.jobs b/src/test/TEST_longdouble/solvers_struct.jobs index 19d8a40e82..df45096f8c 100644 --- a/src/test/TEST_longdouble/solvers_struct.jobs +++ b/src/test/TEST_longdouble/solvers_struct.jobs @@ -26,8 +26,8 @@ mpirun -np 1 ./struct -P 1 1 1 -solver 19 -tol 1.0e-16 > solvers_struct.out.4 # PCG run... LOBPCG with one eigenpair .... LOBPCG with 5 eigenpairs mpirun -np 2 ./struct -solver 10 -tol 1.e-16 > solvers_struct.out.10.lobpcg -mpirun -np 2 ./struct -lobpcg -solver 10 -tol 1.e-16 -pcgitr 0 -seed 1 -vrand 1 > solvers_struct.out.10.lobpcg.1 -mpirun -np 2 ./struct -lobpcg -solver 10 -tol 1.e-16 -pcgitr 0 -seed 1 -vrand 5 > solvers_struct.out.10.lobpcg.5 +mpirun -np 2 ./struct -lobpcg -solver 10 -tol 1.e-16 -pcgitr 0 -seed 1 -vrand 1 > solvers_struct.out.10.lobpcg.1 +mpirun -np 2 ./struct -lobpcg -solver 10 -tol 1.e-16 -pcgitr 0 -seed 1 -vrand 5 > solvers_struct.out.10.lobpcg.5 # PCG run... LOBPCG with one eigenpair .... LOBPCG with 5 eigenpairs mpirun -np 2 ./struct -solver 11 -tol 1.e-16 > solvers_struct.out.11.lobpcg diff --git a/src/test/TEST_longdouble/solvers_struct.saved b/src/test/TEST_longdouble/solvers_struct.saved index a54b4e7ba5..f950f9e01b 100644 --- a/src/test/TEST_longdouble/solvers_struct.saved +++ b/src/test/TEST_longdouble/solvers_struct.saved @@ -12,11 +12,11 @@ Final Relative Residual Norm = 7.177049e-17 # Output file: solvers_struct.out.3 Iterations = 34 -Final Relative Residual Norm = 3.265691e-18 +Final Relative Residual Norm = 3.262683e-18 # Output file: solvers_struct.out.4 Iterations = 34 -Final Relative Residual Norm = 3.219688e-18 +Final Relative Residual Norm = 3.224130e-18 # Output file: solvers_struct.out.10.lobpcg Iterations = 9 @@ -24,7 +24,7 @@ Final Relative Residual Norm = 8.224720e-17 # Output file: solvers_struct.out.10.lobpcg.1 Eigenvalue lambda 1.84366453091756e-01 -Residual 6.51777159501743e-08 +Residual 6.51777159501751e-08 # Output file: solvers_struct.out.10.lobpcg.5 Eigenvalue lambda 1.84366453091754e-01 @@ -32,11 +32,11 @@ Eigenvalue lambda 2.50882493969729e-01 Eigenvalue lambda 3.60090369737174e-01 Eigenvalue lambda 4.20845334658399e-01 Eigenvalue lambda 4.20845334658517e-01 -Residual 3.01898591710117e-08 -Residual 4.55422767371506e-08 -Residual 3.17971068849731e-07 -Residual 1.36018481189308e-07 -Residual 3.39522268990133e-07 +Residual 3.01898591710090e-08 +Residual 4.55422767372537e-08 +Residual 3.17971068849285e-07 +Residual 1.36018532748849e-07 +Residual 3.39522279147376e-07 # Output file: solvers_struct.out.11.lobpcg Iterations = 20 @@ -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.90808378148877e-08 +Residual 5.90808378148917e-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.21720429474187e-08 -Residual 6.44224703497146e-08 -Residual 2.42812454193411e-07 -Residual 3.37502154312378e-07 -Residual 3.28950912831126e-07 +Residual 3.21720429474248e-08 +Residual 6.44224703498851e-08 +Residual 2.42812454193569e-07 +Residual 3.37502160808541e-07 +Residual 3.28951018321284e-07 # Output file: solvers_struct.out.17.lobpcg Iterations = 34 @@ -64,7 +64,7 @@ Final Relative Residual Norm = 4.087402e-17 # Output file: solvers_struct.out.17.lobpcg.1 Eigenvalue lambda 1.84366453091770e-01 -Residual 1.03034775753859e-07 +Residual 1.03034775753946e-07 # Output file: solvers_struct.out.17.lobpcg.5 Eigenvalue lambda 1.84366453091753e-01 @@ -72,19 +72,19 @@ Eigenvalue lambda 2.50882493969729e-01 Eigenvalue lambda 3.60090369737173e-01 Eigenvalue lambda 4.20845334658410e-01 Eigenvalue lambda 4.20845334658418e-01 -Residual 2.01876274958806e-08 -Residual 2.36598865456373e-07 -Residual 1.80211166022567e-07 -Residual 1.64172205059144e-07 -Residual 1.88447274083737e-07 +Residual 2.01876274959029e-08 +Residual 2.36598865456335e-07 +Residual 1.80211166023210e-07 +Residual 1.64172367702148e-07 +Residual 1.88447055849666e-07 # Output file: solvers_struct.out.18.lobpcg Iterations = 59 -Final Relative Residual Norm = 5.038238e-17 +Final Relative Residual Norm = 5.066008e-17 # Output file: solvers_struct.out.18.lobpcg.1 Eigenvalue lambda 1.84366453091755e-01 -Residual 8.10727379998635e-08 +Residual 8.10727379997171e-08 # Output file: solvers_struct.out.18.lobpcg.5 Eigenvalue lambda 1.84366453091753e-01 @@ -92,11 +92,11 @@ Eigenvalue lambda 2.50882493969729e-01 Eigenvalue lambda 3.60090369737172e-01 Eigenvalue lambda 4.20845334658451e-01 Eigenvalue lambda 4.20845334658495e-01 -Residual 9.97341733992902e-08 -Residual 1.68228046062857e-07 -Residual 1.17106600356615e-07 -Residual 3.61346668971189e-07 -Residual 3.12170077450817e-07 +Residual 9.97341733993702e-08 +Residual 1.68228046058535e-07 +Residual 1.17106600373109e-07 +Residual 3.61346840290564e-07 +Residual 3.12152685943787e-07 # Output file: solvers_struct.out.19.lobpcg Iterations = 32 @@ -104,17 +104,17 @@ Final Relative Residual Norm = 8.259590e-07 # Output file: solvers_struct.out.19.lobpcg.1 Eigenvalue lambda 1.84366453091755e-01 -Residual 8.10727379998105e-08 +Residual 8.10727379996923e-08 # Output file: solvers_struct.out.19.lobpcg.5 Eigenvalue lambda 1.84366453091753e-01 -Eigenvalue lambda 2.50882493969730e-01 +Eigenvalue lambda 2.50882493969729e-01 Eigenvalue lambda 3.60090369737172e-01 Eigenvalue lambda 4.20845334658451e-01 Eigenvalue lambda 4.20845334658495e-01 -Residual 9.97341733991334e-08 -Residual 1.68228046056442e-07 -Residual 1.17106600356972e-07 -Residual 3.61346507824777e-07 -Residual 3.12150570425402e-07 +Residual 9.97341733994106e-08 +Residual 1.68228046061944e-07 +Residual 1.17106600327722e-07 +Residual 3.61346609095005e-07 +Residual 3.12243598373865e-07 diff --git a/src/test/TEST_single/solvers_ij.saved.lassen b/src/test/TEST_single/solvers_ij.saved.lassen index 7d4294617b..21530eb360 100644 --- a/src/test/TEST_single/solvers_ij.saved.lassen +++ b/src/test/TEST_single/solvers_ij.saved.lassen @@ -129,15 +129,15 @@ Final GMRES Relative Residual Norm = 9.875665e-05 # Output file: solvers_ij.out.114 BoomerAMG Iterations = 17 -Final Relative Residual Norm = 8.243789e-05 +Final Relative Residual Norm = 8.275850e-05 # Output file: solvers_ij.out.115 BoomerAMG Iterations = 17 -Final Relative Residual Norm = 8.901364e-05 +Final Relative Residual Norm = 8.906254e-05 # Output file: solvers_ij.out.116 GMRES Iterations = 8 -Final GMRES Relative Residual Norm = 8.284889e-05 +Final GMRES Relative Residual Norm = 8.283921e-05 # Output file: solvers_ij.out.117 GMRES Iterations = 8 diff --git a/src/test/TEST_single/solvers_struct.jobs b/src/test/TEST_single/solvers_struct.jobs index 0cd9629eb1..5cd72d6e3f 100755 --- a/src/test/TEST_single/solvers_struct.jobs +++ b/src/test/TEST_single/solvers_struct.jobs @@ -26,8 +26,8 @@ mpirun -np 1 ./struct -P 1 1 1 -solver 19 -tol 1.0e-4 > solvers_struct.out.4 # PCG run... LOBPCG with one eigenpair .... LOBPCG with 3 eigenpairs mpirun -np 2 ./struct -solver 10 -tol 1.e-4 > solvers_struct.out.10.lobpcg -mpirun -np 2 ./struct -lobpcg -solver 10 -tol 1.e-4 -pcgitr 0 -seed 1 -vrand 1 > solvers_struct.out.10.lobpcg.1 -mpirun -np 2 ./struct -lobpcg -solver 10 -tol 1.e-4 -pcgitr 0 -seed 1 -vrand 3 > solvers_struct.out.10.lobpcg.3 +mpirun -np 2 ./struct -lobpcg -solver 10 -tol 1.e-4 -pcgitr 0 -seed 1 -vrand 1 > solvers_struct.out.10.lobpcg.1 +mpirun -np 2 ./struct -lobpcg -solver 10 -tol 1.e-4 -pcgitr 0 -seed 1 -vrand 3 > solvers_struct.out.10.lobpcg.3 # PCG run... LOBPCG with one eigenpair .... LOBPCG with 3 eigenpairs mpirun -np 2 ./struct -solver 11 -tol 1.e-4 > solvers_struct.out.11.lobpcg diff --git a/src/test/TEST_single/solvers_struct.saved b/src/test/TEST_single/solvers_struct.saved index ee14fceab2..16cdb6911f 100644 --- a/src/test/TEST_single/solvers_struct.saved +++ b/src/test/TEST_single/solvers_struct.saved @@ -1,120 +1,120 @@ # Output file: solvers_struct.out.0 Iterations = 3 -Final Relative Residual Norm = 3.246673e-05 +Final Relative Residual Norm = 3.246704e-05 # Output file: solvers_struct.out.1 Iterations = 6 -Final Relative Residual Norm = 2.055850e-05 +Final Relative Residual Norm = 2.055851e-05 # Output file: solvers_struct.out.2 Iterations = 16 -Final Relative Residual Norm = 5.377689e-05 +Final Relative Residual Norm = 5.377669e-05 # Output file: solvers_struct.out.3 Iterations = 16 -Final Relative Residual Norm = 3.726248e-05 +Final Relative Residual Norm = 3.727179e-05 # Output file: solvers_struct.out.4 Iterations = 16 -Final Relative Residual Norm = 3.718718e-05 +Final Relative Residual Norm = 3.718507e-05 # Output file: solvers_struct.out.10.lobpcg Iterations = 3 -Final Relative Residual Norm = 6.275783e-06 +Final Relative Residual Norm = 6.275914e-06 # Output file: solvers_struct.out.10.lobpcg.1 -Eigenvalue lambda 1.84366211295128e-01 -Residual 2.48430933424970e-05 +Eigenvalue lambda 1.84366136789322e-01 +Residual 2.48442192969378e-05 # Output file: solvers_struct.out.10.lobpcg.3 -Iteration 10 bsize 2 maxres 4.35155990999192e-04 -Iteration 11 bsize 1 maxres 2.05302669201046e-04 -Iteration 12 bsize 1 maxres 8.52039884193800e-05 +Iteration 10 bsize 2 maxres 4.35333378845826e-04 +Iteration 11 bsize 1 maxres 2.05604679649696e-04 +Iteration 12 bsize 1 maxres 8.54813406476751e-05 -Eigenvalue lambda 1.84366419911385e-01 -Eigenvalue lambda 2.50882804393768e-01 -Eigenvalue lambda 3.60089868307114e-01 -Residual 7.40827381378040e-05 -Residual 4.10445172747131e-05 -Residual 8.52039884193800e-05 +Eigenvalue lambda 1.84366464614868e-01 +Eigenvalue lambda 2.50883907079697e-01 +Eigenvalue lambda 3.60091775655746e-01 +Residual 7.42115298635326e-05 +Residual 4.07928964705206e-05 +Residual 8.54813406476751e-05 # Output file: solvers_struct.out.11.lobpcg Iterations = 6 -Final Relative Residual Norm = 2.112817e-05 +Final Relative Residual Norm = 2.112821e-05 # Output file: solvers_struct.out.11.lobpcg.1 -Eigenvalue lambda 1.84366181492805e-01 -Residual 3.16434197884519e-05 +Eigenvalue lambda 1.84366434812546e-01 +Residual 3.15644319925923e-05 # Output file: solvers_struct.out.11.lobpcg.3 -Iteration 11 bsize 2 maxres 6.89531618263572e-04 -Iteration 12 bsize 2 maxres 2.52014782745391e-04 -Iteration 13 bsize 1 maxres 7.00048913131468e-05 +Iteration 11 bsize 2 maxres 6.88053027261049e-04 +Iteration 12 bsize 2 maxres 2.51662218943238e-04 +Iteration 13 bsize 1 maxres 6.98720104992390e-05 -Eigenvalue lambda 1.84366345405579e-01 -Eigenvalue lambda 2.50880867242813e-01 -Eigenvalue lambda 3.60090494155884e-01 -Residual 5.61281849513762e-05 -Residual 2.61230034084292e-05 -Residual 7.00048913131468e-05 +Eigenvalue lambda 1.84366494417191e-01 +Eigenvalue lambda 2.50884115695953e-01 +Eigenvalue lambda 3.60091507434845e-01 +Residual 5.57673010916915e-05 +Residual 2.61096829490270e-05 +Residual 6.98720104992390e-05 # Output file: solvers_struct.out.17.lobpcg -Iterations = 20 -Final Relative Residual Norm = 4.194806e-07 +Iterations = 17 +Final Relative Residual Norm = 9.749539e-07 # Output file: solvers_struct.out.17.lobpcg.1 -Eigenvalue lambda 1.84366390109062e-01 -Residual 1.95900083781453e-05 +Eigenvalue lambda 1.84366345405579e-01 +Residual 1.95330776477931e-05 # Output file: solvers_struct.out.17.lobpcg.3 -Iteration 10 bsize 2 maxres 3.62457707524300e-04 -Iteration 11 bsize 1 maxres 1.69860562891699e-04 -Iteration 12 bsize 1 maxres 7.12833571014926e-05 +Iteration 10 bsize 2 maxres 3.62920662155375e-04 +Iteration 11 bsize 1 maxres 1.70175146195106e-04 +Iteration 12 bsize 1 maxres 7.14479174348526e-05 -Eigenvalue lambda 1.84366583824158e-01 -Eigenvalue lambda 2.50883996486664e-01 -Eigenvalue lambda 3.60090583562851e-01 -Residual 5.53683385078330e-05 -Residual 3.08582348225173e-05 -Residual 7.12833571014926e-05 +Eigenvalue lambda 1.84366241097450e-01 +Eigenvalue lambda 2.50882238149643e-01 +Eigenvalue lambda 3.60089480876923e-01 +Residual 5.56299673917238e-05 +Residual 3.08002199744806e-05 +Residual 7.14479174348526e-05 # Output file: solvers_struct.out.18.lobpcg Iterations = 33 -Final Relative Residual Norm = 8.027236e-07 +Final Relative Residual Norm = 8.093600e-07 # Output file: solvers_struct.out.18.lobpcg.1 -Eigenvalue lambda 1.84366077184677e-01 -Residual 4.44860852439888e-05 +Eigenvalue lambda 1.84366568922997e-01 +Residual 4.45298028353136e-05 # Output file: solvers_struct.out.18.lobpcg.3 -Iteration 10 bsize 2 maxres 5.79534214921296e-04 -Iteration 11 bsize 1 maxres 1.98537352844141e-04 -Iteration 12 bsize 1 maxres 9.26745269680396e-05 +Iteration 10 bsize 2 maxres 5.80445164814591e-04 +Iteration 11 bsize 1 maxres 1.97831162950024e-04 +Iteration 12 bsize 1 maxres 9.35689749894664e-05 -Eigenvalue lambda 1.84366509318352e-01 -Eigenvalue lambda 2.50894546508789e-01 -Eigenvalue lambda 3.60091388225555e-01 -Residual 9.26745269680396e-05 -Residual 8.93285541678779e-05 -Residual 5.54441285203211e-05 +Eigenvalue lambda 1.84366449713707e-01 +Eigenvalue lambda 2.50901401042938e-01 +Eigenvalue lambda 3.60089927911758e-01 +Residual 9.29713205550797e-05 +Residual 9.35689749894664e-05 +Residual 5.50725271750707e-05 # Output file: solvers_struct.out.19.lobpcg Iterations = 25 -Final Relative Residual Norm = 7.712499e-05 +Final Relative Residual Norm = 7.712607e-05 # Output file: solvers_struct.out.19.lobpcg.1 -Eigenvalue lambda 1.84366524219513e-01 -Residual 4.43533899670001e-05 +Eigenvalue lambda 1.84366717934608e-01 +Residual 4.44915640400723e-05 # Output file: solvers_struct.out.19.lobpcg.3 -Iteration 10 bsize 2 maxres 5.82181091886014e-04 -Iteration 11 bsize 1 maxres 1.99127141968347e-04 -Iteration 12 bsize 1 maxres 9.26545544643886e-05 +Iteration 10 bsize 2 maxres 5.79324376303703e-04 +Iteration 11 bsize 1 maxres 1.97897577891126e-04 +Iteration 12 bsize 1 maxres 9.27571236388758e-05 -Eigenvalue lambda 1.84366345405579e-01 -Eigenvalue lambda 2.50889092683792e-01 -Eigenvalue lambda 3.60089659690857e-01 -Residual 9.26545544643886e-05 -Residual 8.75688710948452e-05 -Residual 5.51430639461614e-05 +Eigenvalue lambda 1.84366390109062e-01 +Eigenvalue lambda 2.50874042510986e-01 +Eigenvalue lambda 3.60090672969818e-01 +Residual 9.27571236388758e-05 +Residual 8.82312815519981e-05 +Residual 5.52800047444180e-05 diff --git a/src/test/TEST_single/solvers_struct.saved.lassen b/src/test/TEST_single/solvers_struct.saved.lassen index d32a9369eb..00ccc3eea7 100644 --- a/src/test/TEST_single/solvers_struct.saved.lassen +++ b/src/test/TEST_single/solvers_struct.saved.lassen @@ -4,117 +4,117 @@ Final Relative Residual Norm = 3.246689e-05 # Output file: solvers_struct.out.1 Iterations = 6 -Final Relative Residual Norm = 2.055851e-05 +Final Relative Residual Norm = 2.055850e-05 # Output file: solvers_struct.out.2 Iterations = 16 -Final Relative Residual Norm = 5.377654e-05 +Final Relative Residual Norm = 5.377653e-05 # Output file: solvers_struct.out.3 Iterations = 16 -Final Relative Residual Norm = 3.718371e-05 +Final Relative Residual Norm = 3.718374e-05 # Output file: solvers_struct.out.4 Iterations = 16 -Final Relative Residual Norm = 3.718370e-05 +Final Relative Residual Norm = 3.718369e-05 # Output file: solvers_struct.out.10.lobpcg Iterations = 3 -Final Relative Residual Norm = 6.275833e-06 +Final Relative Residual Norm = 6.275822e-06 # Output file: solvers_struct.out.10.lobpcg.1 -Eigenvalue lambda 1.84366509318352e-01 -Residual 2.48082087637158e-05 +Eigenvalue lambda 1.84366554021835e-01 +Residual 2.48218384513166e-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 +Iteration 10 bsize 2 maxres 4.33600886026397e-04 +Iteration 11 bsize 1 maxres 2.04839656362310e-04 +Iteration 12 bsize 1 maxres 8.51535878609866e-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 +Eigenvalue lambda 1.84366583824158e-01 +Eigenvalue lambda 2.50882089138031e-01 +Eigenvalue lambda 3.60091567039490e-01 +Residual 7.42075280868448e-05 +Residual 4.08234154747333e-05 +Residual 8.51535878609866e-05 # Output file: solvers_struct.out.11.lobpcg Iterations = 6 -Final Relative Residual Norm = 2.112819e-05 +Final Relative Residual Norm = 2.112820e-05 # Output file: solvers_struct.out.11.lobpcg.1 -Eigenvalue lambda 1.84366583824158e-01 -Residual 3.15948745992500e-05 +Eigenvalue lambda 1.84366330504417e-01 +Residual 3.16044315695763e-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 +Iteration 11 bsize 2 maxres 6.88984349835664e-04 +Iteration 12 bsize 2 maxres 2.51727673457935e-04 +Iteration 13 bsize 1 maxres 6.99064185027964e-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 +Eigenvalue lambda 1.84366524219513e-01 +Eigenvalue lambda 2.50882416963577e-01 +Eigenvalue lambda 3.60091209411621e-01 +Residual 5.58797510166187e-05 +Residual 2.59445005212910e-05 +Residual 6.99064185027964e-05 # Output file: solvers_struct.out.17.lobpcg Iterations = 17 -Final Relative Residual Norm = 8.241194e-07 +Final Relative Residual Norm = 8.242159e-07 # Output file: solvers_struct.out.17.lobpcg.1 -Eigenvalue lambda 1.84366509318352e-01 -Residual 1.95705306396121e-05 +Eigenvalue lambda 1.84366330504417e-01 +Residual 1.95527190953726e-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 +Iteration 10 bsize 2 maxres 3.60503268893808e-04 +Iteration 11 bsize 1 maxres 1.69319653650746e-04 +Iteration 12 bsize 1 maxres 7.10454114596359e-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 +Eigenvalue lambda 1.84366464614868e-01 +Eigenvalue lambda 2.50882416963577e-01 +Eigenvalue lambda 3.60090196132660e-01 +Residual 5.52674828213640e-05 +Residual 3.08437047351617e-05 +Residual 7.10454114596359e-05 # Output file: solvers_struct.out.18.lobpcg Iterations = 32 -Final Relative Residual Norm = 8.266953e-07 +Final Relative Residual Norm = 8.264704e-07 # Output file: solvers_struct.out.18.lobpcg.1 -Eigenvalue lambda 1.84366241097450e-01 -Residual 4.44491524831392e-05 +Eigenvalue lambda 1.84366568922997e-01 +Residual 4.44411634816788e-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 +Iteration 10 bsize 2 maxres 5.82537380978465e-04 +Iteration 11 bsize 1 maxres 1.99037196580321e-04 +Iteration 12 bsize 1 maxres 9.26901775528677e-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 +Eigenvalue lambda 1.84366509318352e-01 +Eigenvalue lambda 2.50879466533661e-01 +Eigenvalue lambda 3.60090672969818e-01 +Residual 9.26901775528677e-05 +Residual 8.73394674272276e-05 +Residual 5.52645469724666e-05 # Output file: solvers_struct.out.19.lobpcg Iterations = 25 -Final Relative Residual Norm = 7.712439e-05 +Final Relative Residual Norm = 7.712438e-05 # Output file: solvers_struct.out.19.lobpcg.1 -Eigenvalue lambda 1.84366539120674e-01 -Residual 4.44510842498858e-05 +Eigenvalue lambda 1.84366717934608e-01 +Residual 4.44462348241359e-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 +Iteration 10 bsize 2 maxres 5.81462169066072e-04 +Iteration 11 bsize 1 maxres 1.99069327209145e-04 +Iteration 12 bsize 1 maxres 9.26528882700950e-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 +Eigenvalue lambda 1.84366449713707e-01 +Eigenvalue lambda 2.50894010066986e-01 +Eigenvalue lambda 3.60090911388397e-01 +Residual 9.26528882700950e-05 +Residual 8.92711541382596e-05 +Residual 5.55204424017575e-05 diff --git a/src/test/TEST_sstruct/addtovalues.saved b/src/test/TEST_sstruct/addtovalues.saved index b126689d5a..cdc3dce3e9 100644 --- a/src/test/TEST_sstruct/addtovalues.saved +++ b/src/test/TEST_sstruct/addtovalues.saved @@ -1,10 +1,10 @@ # Output file: addtovalues.out.0 -Iterations = 9 -Final Relative Residual Norm = 7.226958e-07 +Iterations = 8 +Final Relative Residual Norm = 9.531730e-07 # Output file: addtovalues.out.1 -Iterations = 9 -Final Relative Residual Norm = 7.226958e-07 +Iterations = 8 +Final Relative Residual Norm = 9.531730e-07 # Output file: addtovalues.out.2 Iterations = 34 @@ -15,12 +15,12 @@ Iterations = 34 Final Relative Residual Norm = 5.437407e-07 # Output file: addtovalues.out.4 -Iterations = 11 -Final Relative Residual Norm = 9.051371e-07 +Iterations = 9 +Final Relative Residual Norm = 4.767660e-07 # Output file: addtovalues.out.5 -Iterations = 11 -Final Relative Residual Norm = 9.051371e-07 +Iterations = 9 +Final Relative Residual Norm = 4.767660e-07 # Output file: addtovalues.out.6 Iterations = 44 diff --git a/src/test/TEST_sstruct/addtovalues.saved.lassen b/src/test/TEST_sstruct/addtovalues.saved.lassen index 7e261d6268..67df1cad02 100644 --- a/src/test/TEST_sstruct/addtovalues.saved.lassen +++ b/src/test/TEST_sstruct/addtovalues.saved.lassen @@ -1,32 +1,32 @@ # Output file: addtovalues.out.0 -Iterations = 9 -Final Relative Residual Norm = 7.226958e-07 +Iterations = 8 +Final Relative Residual Norm = 9.531730e-07 # Output file: addtovalues.out.1 -Iterations = 9 -Final Relative Residual Norm = 7.226958e-07 +Iterations = 8 +Final Relative Residual Norm = 9.531730e-07 # Output file: addtovalues.out.2 Iterations = 83 -Final Relative Residual Norm = 9.421346e-07 +Final Relative Residual Norm = 9.421342e-07 # Output file: addtovalues.out.3 Iterations = 83 -Final Relative Residual Norm = 9.421346e-07 +Final Relative Residual Norm = 9.421342e-07 # Output file: addtovalues.out.4 -Iterations = 11 -Final Relative Residual Norm = 9.051371e-07 +Iterations = 9 +Final Relative Residual Norm = 4.767660e-07 # Output file: addtovalues.out.5 -Iterations = 11 -Final Relative Residual Norm = 9.051371e-07 +Iterations = 9 +Final Relative Residual Norm = 4.767660e-07 # Output file: addtovalues.out.6 Iterations = 92 -Final Relative Residual Norm = 8.697370e-07 +Final Relative Residual Norm = 8.697362e-07 # Output file: addtovalues.out.7 Iterations = 92 -Final Relative Residual Norm = 8.697370e-07 +Final Relative Residual Norm = 8.697362e-07 diff --git a/src/test/TEST_sstruct/addtovalues.saved.lassen_cpu b/src/test/TEST_sstruct/addtovalues.saved.lassen_cpu index b126689d5a..cdc3dce3e9 100644 --- a/src/test/TEST_sstruct/addtovalues.saved.lassen_cpu +++ b/src/test/TEST_sstruct/addtovalues.saved.lassen_cpu @@ -1,10 +1,10 @@ # Output file: addtovalues.out.0 -Iterations = 9 -Final Relative Residual Norm = 7.226958e-07 +Iterations = 8 +Final Relative Residual Norm = 9.531730e-07 # Output file: addtovalues.out.1 -Iterations = 9 -Final Relative Residual Norm = 7.226958e-07 +Iterations = 8 +Final Relative Residual Norm = 9.531730e-07 # Output file: addtovalues.out.2 Iterations = 34 @@ -15,12 +15,12 @@ Iterations = 34 Final Relative Residual Norm = 5.437407e-07 # Output file: addtovalues.out.4 -Iterations = 11 -Final Relative Residual Norm = 9.051371e-07 +Iterations = 9 +Final Relative Residual Norm = 4.767660e-07 # Output file: addtovalues.out.5 -Iterations = 11 -Final Relative Residual Norm = 9.051371e-07 +Iterations = 9 +Final Relative Residual Norm = 4.767660e-07 # Output file: addtovalues.out.6 Iterations = 44 diff --git a/src/test/TEST_sstruct/amr2d.jobs b/src/test/TEST_sstruct/amr2d.jobs index 81141db29c..b76086192f 100755 --- a/src/test/TEST_sstruct/amr2d.jobs +++ b/src/test/TEST_sstruct/amr2d.jobs @@ -35,3 +35,16 @@ mpirun -np 1 ./sstruct -in sstruct.in.amr.graphadd -solver 28 -r 1 2 1 -pooldis > amr2d.out.12 mpirun -np 4 ./sstruct -in sstruct.in.amr.graphadd -solver 28 -P 1 2 1 -pooldist 1 \ > amr2d.out.13 + +mpirun -np 1 ./sstruct -in sstruct.in.amr2D_center_lev2 -solver 4 -r 4 4 1 -pooldist 0 \ + > amr2d.out.14 +mpirun -np 2 ./sstruct -in sstruct.in.amr2D_center_lev2 -solver 4 -r 4 4 1 -pooldist 1 \ + > amr2d.out.15 +mpirun -np 1 ./sstruct -in sstruct.in.amr2D_center_lev2 -solver 14 -r 4 4 1 -pooldist 0 \ + > amr2d.out.16 +mpirun -np 2 ./sstruct -in sstruct.in.amr2D_center_lev2 -solver 14 -r 4 4 1 -pooldist 1 \ + > amr2d.out.17 +mpirun -np 1 ./sstruct -in sstruct.in.amr2D_center_lev2 -solver 20 -r 4 4 1 -pooldist 0 \ + > amr2d.out.18 +mpirun -np 2 ./sstruct -in sstruct.in.amr2D_center_lev2 -solver 20 -r 4 4 1 -pooldist 1 \ + > amr2d.out.19 diff --git a/src/test/TEST_sstruct/amr2d.saved b/src/test/TEST_sstruct/amr2d.saved index 42a57fa521..40372494ed 100644 --- a/src/test/TEST_sstruct/amr2d.saved +++ b/src/test/TEST_sstruct/amr2d.saved @@ -50,3 +50,27 @@ Final Relative Residual Norm = 5.252407e-07 Iterations = 18 Final Relative Residual Norm = 5.252407e-07 +# Output file: amr2d.out.14 +Iterations = 37 +Final Relative Residual Norm = 8.012871e-07 + +# Output file: amr2d.out.15 +Iterations = 37 +Final Relative Residual Norm = 8.008509e-07 + +# Output file: amr2d.out.16 +Iterations = 11 +Final Relative Residual Norm = 8.590605e-07 + +# Output file: amr2d.out.17 +Iterations = 11 +Final Relative Residual Norm = 8.589008e-07 + +# Output file: amr2d.out.18 +Iterations = 6 +Final Relative Residual Norm = 9.552005e-08 + +# Output file: amr2d.out.19 +Iterations = 6 +Final Relative Residual Norm = 3.452407e-07 + diff --git a/src/test/TEST_sstruct/amr2d.saved.lassen b/src/test/TEST_sstruct/amr2d.saved.lassen index a544659bca..1d4e869efb 100644 --- a/src/test/TEST_sstruct/amr2d.saved.lassen +++ b/src/test/TEST_sstruct/amr2d.saved.lassen @@ -50,3 +50,27 @@ Final Relative Residual Norm = 5.252407e-07 Iterations = 18 Final Relative Residual Norm = 5.252407e-07 +# Output file: amr2d.out.14 +Iterations = 38 +Final Relative Residual Norm = 8.737577e-07 + +# Output file: amr2d.out.15 +Iterations = 38 +Final Relative Residual Norm = 8.677316e-07 + +# Output file: amr2d.out.16 +Iterations = 11 +Final Relative Residual Norm = 9.335230e-07 + +# Output file: amr2d.out.17 +Iterations = 11 +Final Relative Residual Norm = 9.300705e-07 + +# Output file: amr2d.out.18 +Iterations = 9 +Final Relative Residual Norm = 5.946410e-07 + +# Output file: amr2d.out.19 +Iterations = 10 +Final Relative Residual Norm = 2.352751e-07 + diff --git a/src/test/TEST_sstruct/amr2d.saved.lassen_cpu b/src/test/TEST_sstruct/amr2d.saved.lassen_cpu index 42a57fa521..40372494ed 100644 --- a/src/test/TEST_sstruct/amr2d.saved.lassen_cpu +++ b/src/test/TEST_sstruct/amr2d.saved.lassen_cpu @@ -50,3 +50,27 @@ Final Relative Residual Norm = 5.252407e-07 Iterations = 18 Final Relative Residual Norm = 5.252407e-07 +# Output file: amr2d.out.14 +Iterations = 37 +Final Relative Residual Norm = 8.012871e-07 + +# Output file: amr2d.out.15 +Iterations = 37 +Final Relative Residual Norm = 8.008509e-07 + +# Output file: amr2d.out.16 +Iterations = 11 +Final Relative Residual Norm = 8.590605e-07 + +# Output file: amr2d.out.17 +Iterations = 11 +Final Relative Residual Norm = 8.589008e-07 + +# Output file: amr2d.out.18 +Iterations = 6 +Final Relative Residual Norm = 9.552005e-08 + +# Output file: amr2d.out.19 +Iterations = 6 +Final Relative Residual Norm = 3.452407e-07 + diff --git a/src/test/TEST_sstruct/amr2d.sh b/src/test/TEST_sstruct/amr2d.sh index a0806aa226..90dbf3fb53 100755 --- a/src/test/TEST_sstruct/amr2d.sh +++ b/src/test/TEST_sstruct/amr2d.sh @@ -33,6 +33,12 @@ FILES="\ ${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\ " for i in $FILES diff --git a/src/test/TEST_sstruct/amr3d.jobs b/src/test/TEST_sstruct/amr3d.jobs new file mode 100644 index 0000000000..b74f94ec9c --- /dev/null +++ b/src/test/TEST_sstruct/amr3d.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) + +#============================================================================= + +mpirun -np 1 ./sstruct -in sstruct.in.amr3D_center_lev2 -solver 4 -r 4 4 1 -pooldist 0 \ + > amr3d.out.0 +mpirun -np 2 ./sstruct -in sstruct.in.amr3D_center_lev2 -solver 4 -r 4 4 1 -pooldist 1 \ + > amr3d.out.1 +mpirun -np 1 ./sstruct -in sstruct.in.amr3D_center_lev2 -solver 14 -r 4 4 1 -pooldist 0 \ + > amr3d.out.2 +mpirun -np 2 ./sstruct -in sstruct.in.amr3D_center_lev2 -solver 14 -r 4 4 1 -pooldist 1 \ + > amr3d.out.3 +mpirun -np 1 ./sstruct -in sstruct.in.amr3D_center_lev2 -solver 20 -r 4 4 1 -pooldist 0 \ + > amr3d.out.4 +mpirun -np 2 ./sstruct -in sstruct.in.amr3D_center_lev2 -solver 20 -r 4 4 1 -pooldist 1 \ + > amr3d.out.5 diff --git a/src/test/TEST_sstruct/amr3d.saved b/src/test/TEST_sstruct/amr3d.saved new file mode 100644 index 0000000000..39d51c024b --- /dev/null +++ b/src/test/TEST_sstruct/amr3d.saved @@ -0,0 +1,24 @@ +# Output file: amr3d.out.0 +Iterations = 21 +Final Relative Residual Norm = 6.233588e-07 + +# Output file: amr3d.out.1 +Iterations = 21 +Final Relative Residual Norm = 6.233107e-07 + +# Output file: amr3d.out.2 +Iterations = 10 +Final Relative Residual Norm = 3.377895e-07 + +# Output file: amr3d.out.3 +Iterations = 10 +Final Relative Residual Norm = 3.378690e-07 + +# Output file: amr3d.out.4 +Iterations = 6 +Final Relative Residual Norm = 2.224093e-07 + +# Output file: amr3d.out.5 +Iterations = 6 +Final Relative Residual Norm = 3.967662e-07 + diff --git a/src/test/TEST_sstruct/amr3d.sh b/src/test/TEST_sstruct/amr3d.sh new file mode 100755 index 0000000000..d97b2e2f7f --- /dev/null +++ b/src/test/TEST_sstruct/amr3d.sh @@ -0,0 +1,35 @@ +#!/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\ +" + +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/src/test/TEST_sstruct/emptyProc.jobs b/src/test/TEST_sstruct/emptyProc.jobs index 16af1aa2ea..d8cc305422 100755 --- a/src/test/TEST_sstruct/emptyProc.jobs +++ b/src/test/TEST_sstruct/emptyProc.jobs @@ -4,160 +4,84 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) #============================================================================= -# sstruct: Run 3d problem with one proc empty. Two types of tests: -# struct solvers and sys_pfmg require the first part to be full -# => compare runs with two refinements -# other solvers: switch the empty proc, run 1= proc 2 empty -# run 2= proc 1 empty +# Run a single-part 3d problem on one proc (run 1) +# Run it again on two procs with proc 2 empty (run 2) +# Compare the output #============================================================================= -##### -##### -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -r 1 1 1 -rhsone -solver 3 \ - > emptyProc.out.00 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -rhsone -solver 10 \ - > emptyProc.out.01 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -rhsone -solver 11 \ - > emptyProc.out.02 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -r 1 1 1 -rhsone -solver 13 \ - > emptyProc.out.03 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -rhsone -solver 18 \ - > emptyProc.out.04 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -rhsone -solver 20 \ - > emptyProc.out.05 -#mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -rhsone -solver 22 \ -# > emptyProc.out.06 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -rhsone -solver 28 \ - > emptyProc.out.08 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -rhsone -solver 30 \ - > emptyProc.out.09 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -rhsone -solver 31 \ - > emptyProc.out.10 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -rhsone -solver 38 \ - > emptyProc.out.11 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -rhsone -solver 40 \ - > emptyProc.out.12 -#mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -rhsone -solver 42 \ -# > emptyProc.out.14 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -rhsone -solver 50 \ - > emptyProc.out.15 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -rhsone -solver 51 \ - > emptyProc.out.16 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -rhsone -solver 58 \ - > emptyProc.out.17 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -rhsone -solver 60 \ - > emptyProc.out.18 -#mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -rhsone -solver 62 \ -# > emptyProc.out.20 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -rhsone -solver 120 \ - > emptyProc.out.21 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -r 1 1 1 -rhsone -solver 200 \ - > emptyProc.out.22 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -r 1 1 1 -rhsone -solver 201 \ - > emptyProc.out.23 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -r 1 1 1 -rhsone -solver 203 \ - > emptyProc.out.24 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -r 1 1 1 -rhsone -solver 210 \ - > emptyProc.out.25 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -r 1 1 1 -rhsone -solver 211 \ - > emptyProc.out.26 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -r 1 1 1 -rhsone -solver 217 \ - > emptyProc.out.27 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -r 1 1 1 -rhsone -solver 218 \ - > emptyProc.out.28 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -r 1 1 1 -rhsone -solver 220 \ - > emptyProc.out.29 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -r 1 1 1 -rhsone -solver 221 \ - > emptyProc.out.30 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -r 1 1 1 -rhsone -solver 230 \ - > emptyProc.out.31 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -r 1 1 1 -rhsone -solver 231 \ - > emptyProc.out.32 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -r 1 1 1 -rhsone -solver 237 \ - > emptyProc.out.33 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -r 1 1 1 -rhsone -solver 238 \ - > emptyProc.out.34 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -r 1 1 1 -rhsone -solver 240 \ - > emptyProc.out.35 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -r 1 1 1 -rhsone -solver 241 \ - > emptyProc.out.36 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -r 1 1 1 -rhsone -solver 247 \ - > emptyProc.out.37 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -r 1 1 1 -rhsone -solver 248 \ - > emptyProc.out.38 +#============================================================================= +# run 1 +#============================================================================= + +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 3 > emptyProc.out.00 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 10 > emptyProc.out.01 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 11 > emptyProc.out.02 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 13 > emptyProc.out.03 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 18 > emptyProc.out.04 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 20 > emptyProc.out.05 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 28 > emptyProc.out.08 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 30 > emptyProc.out.09 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 31 > emptyProc.out.10 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 38 > emptyProc.out.11 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 40 > emptyProc.out.12 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 50 > emptyProc.out.15 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 51 > emptyProc.out.16 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 58 > emptyProc.out.17 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 60 > emptyProc.out.18 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 120 > emptyProc.out.21 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 200 > emptyProc.out.22 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 201 > emptyProc.out.23 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 203 > emptyProc.out.24 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 210 > emptyProc.out.25 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 211 > emptyProc.out.26 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 217 > emptyProc.out.27 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 218 > emptyProc.out.28 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 220 > emptyProc.out.29 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 221 > emptyProc.out.30 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 230 > emptyProc.out.31 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 231 > emptyProc.out.32 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 237 > emptyProc.out.33 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 238 > emptyProc.out.34 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 240 > emptyProc.out.35 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 241 > emptyProc.out.36 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 247 > emptyProc.out.37 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 248 > emptyProc.out.38 #============================================================================= # run 2 #============================================================================= -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc2 -r 2 2 2 -rhsone -solver 3 \ - > emptyProc.out.100 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc3 -rhsone -solver 10 \ - > emptyProc.out.101 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc3 -rhsone -solver 11 \ - > emptyProc.out.102 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc2 -r 2 2 2 -rhsone -solver 13 \ - > emptyProc.out.103 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc3 -rhsone -solver 18 \ - > emptyProc.out.104 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc3 -rhsone -solver 20 \ - > emptyProc.out.105 -#mpirun -np 2 ./sstruct -in sstruct.in.emptyProc3 -rhsone -solver 22 \ -# > emptyProc.out.106 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc3 -rhsone -solver 28 \ - > emptyProc.out.108 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc3 -rhsone -solver 30 \ - > emptyProc.out.109 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc3 -rhsone -solver 31 \ - > emptyProc.out.110 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc3 -rhsone -solver 38 \ - > emptyProc.out.111 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc3 -rhsone -solver 40 \ - > emptyProc.out.112 -#mpirun -np 2 ./sstruct -in sstruct.in.emptyProc3 -rhsone -solver 42 \ -# > emptyProc.out.114 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc3 -rhsone -solver 50 \ - > emptyProc.out.115 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc3 -rhsone -solver 51 \ - > emptyProc.out.116 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc3 -rhsone -solver 58 \ - > emptyProc.out.117 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc3 -rhsone -solver 60 \ - > emptyProc.out.118 -#mpirun -np 2 ./sstruct -in sstruct.in.emptyProc3 -rhsone -solver 62 \ -# > emptyProc.out.120 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc3 -rhsone -solver 120 \ - > emptyProc.out.121 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc2 -r 2 2 2 -rhsone -solver 200 \ - > emptyProc.out.122 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc2 -r 2 2 2 -rhsone -solver 201 \ - > emptyProc.out.123 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc2 -r 2 2 2 -rhsone -solver 203 \ - > emptyProc.out.124 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc2 -r 2 2 2 -rhsone -solver 210 \ - > emptyProc.out.125 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc2 -r 2 2 2 -rhsone -solver 211 \ - > emptyProc.out.126 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc2 -r 2 2 2 -rhsone -solver 217 \ - > emptyProc.out.127 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc2 -r 2 2 2 -rhsone -solver 218 \ - > emptyProc.out.128 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc2 -r 2 2 2 -rhsone -solver 220 \ - > emptyProc.out.129 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc2 -r 2 2 2 -rhsone -solver 221 \ - > emptyProc.out.130 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc2 -r 2 2 2 -rhsone -solver 230 \ - > emptyProc.out.131 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc2 -r 2 2 2 -rhsone -solver 231 \ - > emptyProc.out.132 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc2 -r 2 2 2 -rhsone -solver 237 \ - > emptyProc.out.133 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc2 -r 2 2 2 -rhsone -solver 238 \ - > emptyProc.out.134 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc2 -r 2 2 2 -rhsone -solver 240 \ - > emptyProc.out.135 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc2 -r 2 2 2 -rhsone -solver 241 \ - > emptyProc.out.136 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc2 -r 2 2 2 -rhsone -solver 247 \ - > emptyProc.out.137 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc2 -r 2 2 2 -rhsone -solver 248 \ - > emptyProc.out.138 + +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 3 > emptyProc.out.100 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 10 > emptyProc.out.101 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 11 > emptyProc.out.102 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 13 > emptyProc.out.103 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 18 > emptyProc.out.104 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 20 > emptyProc.out.105 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 28 > emptyProc.out.108 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 30 > emptyProc.out.109 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 31 > emptyProc.out.110 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 38 > emptyProc.out.111 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 40 > emptyProc.out.112 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 50 > emptyProc.out.115 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 51 > emptyProc.out.116 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 58 > emptyProc.out.117 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 60 > emptyProc.out.118 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 120 > emptyProc.out.121 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 200 > emptyProc.out.122 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 201 > emptyProc.out.123 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 203 > emptyProc.out.124 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 210 > emptyProc.out.125 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 211 > emptyProc.out.126 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 217 > emptyProc.out.127 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 218 > emptyProc.out.128 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 220 > emptyProc.out.129 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 221 > emptyProc.out.130 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 230 > emptyProc.out.131 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 231 > emptyProc.out.132 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 237 > emptyProc.out.133 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 238 > emptyProc.out.134 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 240 > emptyProc.out.135 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 241 > emptyProc.out.136 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 247 > emptyProc.out.137 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 248 > emptyProc.out.138 + diff --git a/src/test/TEST_sstruct/emptyProc.saved b/src/test/TEST_sstruct/emptyProc.saved index f64f90bab0..ea3f4dfd70 100644 --- a/src/test/TEST_sstruct/emptyProc.saved +++ b/src/test/TEST_sstruct/emptyProc.saved @@ -1,18 +1,18 @@ # Output file: emptyProc.out.00 Iterations = 16 -Final Relative Residual Norm = 4.728437e-07 +Final Relative Residual Norm = 5.185152e-07 # Output file: emptyProc.out.01 Iterations = 4 Final Relative Residual Norm = 1.228720e-07 # Output file: emptyProc.out.02 -Iterations = 27 -Final Relative Residual Norm = 9.010838e-07 +Iterations = 9 +Final Relative Residual Norm = 2.723273e-07 # Output file: emptyProc.out.03 -Iterations = 7 -Final Relative Residual Norm = 8.654509e-07 +Iterations = 8 +Final Relative Residual Norm = 3.134748e-07 # Output file: emptyProc.out.04 Iterations = 20 @@ -22,10 +22,6 @@ Final Relative Residual Norm = 5.962015e-07 Iterations = 6 Final Relative Residual Norm = 2.350489e-07 -# Output file: emptyProc.out.06 -#Iterations = 15 -#Final Relative Residual Norm = 6.369593e-07 - # Output file: emptyProc.out.08 Iterations = 20 Final Relative Residual Norm = 5.962015e-07 @@ -36,7 +32,7 @@ Final Relative Residual Norm = 1.175679e-07 # Output file: emptyProc.out.10 Iterations = 9 -Final Relative Residual Norm = 8.346689e-07 +Final Relative Residual Norm = 4.322584e-07 # Output file: emptyProc.out.11 Iterations = 64 @@ -46,17 +42,13 @@ Final Relative Residual Norm = 9.962554e-07 Iterations = 6 Final Relative Residual Norm = 3.354751e-07 -# Output file: emptyProc.out.14 -#Iterations = 17 -#Final Relative Residual Norm = 6.043891e-07 - # Output file: emptyProc.out.15 Iterations = 2 Final Relative Residual Norm = 1.699553e-07 # Output file: emptyProc.out.16 Iterations = 5 -Final Relative Residual Norm = 8.505453e-07 +Final Relative Residual Norm = 1.651794e-07 # Output file: emptyProc.out.17 Iterations = 14 @@ -66,10 +58,6 @@ Final Relative Residual Norm = 6.421347e-07 Iterations = 3 Final Relative Residual Norm = 8.029310e-07 -# Output file: emptyProc.out.20 -#Iterations = 8 -#Final Relative Residual Norm = 7.771825e-07 - # Output file: emptyProc.out.21 Iterations = 20 Final Relative Residual Norm = 5.962015e-07 @@ -80,19 +68,19 @@ Final Relative Residual Norm = 1.375560e-07 # Output file: emptyProc.out.23 Iterations = 16 -Final Relative Residual Norm = 9.983250e-07 +Final Relative Residual Norm = 5.185152e-07 # Output file: emptyProc.out.24 Iterations = 16 -Final Relative Residual Norm = 9.983250e-07 +Final Relative Residual Norm = 5.185152e-07 # Output file: emptyProc.out.25 Iterations = 4 Final Relative Residual Norm = 1.228720e-07 # Output file: emptyProc.out.26 -Iterations = 13 -Final Relative Residual Norm = 7.358735e-07 +Iterations = 8 +Final Relative Residual Norm = 3.134748e-07 # Output file: emptyProc.out.27 Iterations = 11 @@ -116,7 +104,7 @@ Final Relative Residual Norm = 1.175679e-07 # Output file: emptyProc.out.32 Iterations = 9 -Final Relative Residual Norm = 3.889426e-07 +Final Relative Residual Norm = 1.247312e-07 # Output file: emptyProc.out.33 Iterations = 20 @@ -131,8 +119,8 @@ Iterations = 2 Final Relative Residual Norm = 1.699553e-07 # Output file: emptyProc.out.36 -Iterations = 5 -Final Relative Residual Norm = 8.876781e-08 +Iterations = 4 +Final Relative Residual Norm = 9.386203e-07 # Output file: emptyProc.out.37 Iterations = 8 diff --git a/src/test/TEST_sstruct/emptyProc.saved.lassen b/src/test/TEST_sstruct/emptyProc.saved.lassen index b03b94a9d5..4592336bb5 100644 --- a/src/test/TEST_sstruct/emptyProc.saved.lassen +++ b/src/test/TEST_sstruct/emptyProc.saved.lassen @@ -1,18 +1,18 @@ # Output file: emptyProc.out.00 Iterations = 16 -Final Relative Residual Norm = 4.728437e-07 +Final Relative Residual Norm = 5.185152e-07 # Output file: emptyProc.out.01 Iterations = 4 Final Relative Residual Norm = 1.228720e-07 # Output file: emptyProc.out.02 -Iterations = 27 -Final Relative Residual Norm = 9.010838e-07 +Iterations = 9 +Final Relative Residual Norm = 2.723273e-07 # Output file: emptyProc.out.03 -Iterations = 7 -Final Relative Residual Norm = 8.654509e-07 +Iterations = 8 +Final Relative Residual Norm = 3.134748e-07 # Output file: emptyProc.out.04 Iterations = 20 @@ -32,7 +32,7 @@ Final Relative Residual Norm = 1.175679e-07 # Output file: emptyProc.out.10 Iterations = 9 -Final Relative Residual Norm = 8.346689e-07 +Final Relative Residual Norm = 4.322584e-07 # Output file: emptyProc.out.11 Iterations = 64 @@ -48,7 +48,7 @@ Final Relative Residual Norm = 1.699553e-07 # Output file: emptyProc.out.16 Iterations = 5 -Final Relative Residual Norm = 8.505453e-07 +Final Relative Residual Norm = 1.651794e-07 # Output file: emptyProc.out.17 Iterations = 14 @@ -68,19 +68,19 @@ Final Relative Residual Norm = 1.375560e-07 # Output file: emptyProc.out.23 Iterations = 16 -Final Relative Residual Norm = 9.983250e-07 +Final Relative Residual Norm = 5.185152e-07 # Output file: emptyProc.out.24 Iterations = 16 -Final Relative Residual Norm = 9.983250e-07 +Final Relative Residual Norm = 5.185152e-07 # Output file: emptyProc.out.25 Iterations = 4 Final Relative Residual Norm = 1.228720e-07 # Output file: emptyProc.out.26 -Iterations = 13 -Final Relative Residual Norm = 7.358735e-07 +Iterations = 8 +Final Relative Residual Norm = 3.134748e-07 # Output file: emptyProc.out.27 Iterations = 11 @@ -104,7 +104,7 @@ Final Relative Residual Norm = 1.175679e-07 # Output file: emptyProc.out.32 Iterations = 9 -Final Relative Residual Norm = 3.889426e-07 +Final Relative Residual Norm = 1.247312e-07 # Output file: emptyProc.out.33 Iterations = 20 @@ -119,8 +119,8 @@ Iterations = 2 Final Relative Residual Norm = 1.699553e-07 # Output file: emptyProc.out.36 -Iterations = 5 -Final Relative Residual Norm = 8.876781e-08 +Iterations = 4 +Final Relative Residual Norm = 9.386203e-07 # Output file: emptyProc.out.37 Iterations = 8 diff --git a/src/test/TEST_sstruct/emptyProc.saved.lassen_cpu b/src/test/TEST_sstruct/emptyProc.saved.lassen_cpu index 391ff4dcde..bdb9c9d731 100644 --- a/src/test/TEST_sstruct/emptyProc.saved.lassen_cpu +++ b/src/test/TEST_sstruct/emptyProc.saved.lassen_cpu @@ -1,18 +1,18 @@ # Output file: emptyProc.out.00 Iterations = 16 -Final Relative Residual Norm = 4.728437e-07 +Final Relative Residual Norm = 5.185152e-07 # Output file: emptyProc.out.01 Iterations = 4 Final Relative Residual Norm = 1.228720e-07 # Output file: emptyProc.out.02 -Iterations = 27 -Final Relative Residual Norm = 9.010838e-07 +Iterations = 9 +Final Relative Residual Norm = 2.723273e-07 # Output file: emptyProc.out.03 -Iterations = 7 -Final Relative Residual Norm = 8.654509e-07 +Iterations = 8 +Final Relative Residual Norm = 3.134748e-07 # Output file: emptyProc.out.04 Iterations = 20 @@ -32,7 +32,7 @@ Final Relative Residual Norm = 1.175679e-07 # Output file: emptyProc.out.10 Iterations = 9 -Final Relative Residual Norm = 8.346689e-07 +Final Relative Residual Norm = 4.322584e-07 # Output file: emptyProc.out.11 Iterations = 64 @@ -48,7 +48,7 @@ Final Relative Residual Norm = 1.699553e-07 # Output file: emptyProc.out.16 Iterations = 5 -Final Relative Residual Norm = 8.505453e-07 +Final Relative Residual Norm = 1.651794e-07 # Output file: emptyProc.out.17 Iterations = 14 @@ -68,19 +68,19 @@ Final Relative Residual Norm = 1.375560e-07 # Output file: emptyProc.out.23 Iterations = 16 -Final Relative Residual Norm = 9.983250e-07 +Final Relative Residual Norm = 5.185152e-07 # Output file: emptyProc.out.24 Iterations = 16 -Final Relative Residual Norm = 9.983250e-07 +Final Relative Residual Norm = 5.185152e-07 # Output file: emptyProc.out.25 Iterations = 4 Final Relative Residual Norm = 1.228720e-07 # Output file: emptyProc.out.26 -Iterations = 13 -Final Relative Residual Norm = 7.358735e-07 +Iterations = 8 +Final Relative Residual Norm = 3.134748e-07 # Output file: emptyProc.out.27 Iterations = 11 @@ -104,7 +104,7 @@ Final Relative Residual Norm = 1.175679e-07 # Output file: emptyProc.out.32 Iterations = 9 -Final Relative Residual Norm = 3.889426e-07 +Final Relative Residual Norm = 1.247312e-07 # Output file: emptyProc.out.33 Iterations = 20 @@ -119,8 +119,8 @@ Iterations = 2 Final Relative Residual Norm = 1.699553e-07 # Output file: emptyProc.out.36 -Iterations = 5 -Final Relative Residual Norm = 8.876781e-08 +Iterations = 4 +Final Relative Residual Norm = 9.386203e-07 # Output file: emptyProc.out.37 Iterations = 8 @@ -129,4 +129,3 @@ Final Relative Residual Norm = 2.986671e-08 # Output file: emptyProc.out.38 Iterations = 14 Final Relative Residual Norm = 6.421347e-07 - diff --git a/src/test/TEST_sstruct/io.jobs b/src/test/TEST_sstruct/io.jobs index 71aa56578c..b811a96887 100644 --- a/src/test/TEST_sstruct/io.jobs +++ b/src/test/TEST_sstruct/io.jobs @@ -17,8 +17,10 @@ mpirun -np 1 ./sstruct -fromfile sstruct.out.A -rhsfromfile sstruct.out.b -x0fro 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 +# There is a memory problem here related to the -print option (it's clean without it). +# It looks like HYPRE_SStructMatrixToIJMatrix() needs to be extended to work with multiple vars +#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 @@ -45,8 +47,9 @@ mpirun -np 4 ./sstruct -fromfile sstruct.out.A -rhsfromfile sstruct.out.b -x0fro 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 +# See comment above about -print option +#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 diff --git a/src/test/TEST_sstruct/io.saved b/src/test/TEST_sstruct/io.saved index f7ec817731..aeb5f52d66 100644 --- a/src/test/TEST_sstruct/io.saved +++ b/src/test/TEST_sstruct/io.saved @@ -23,13 +23,7 @@ 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 @@ -87,13 +81,7 @@ 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 @@ -124,4 +112,5 @@ 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 +Final Relative Residual Norm = 4.507162e-07 + diff --git a/src/test/TEST_sstruct/io.saved.lassen b/src/test/TEST_sstruct/io.saved.lassen index 1c44c5aa21..aeb5f52d66 100644 --- a/src/test/TEST_sstruct/io.saved.lassen +++ b/src/test/TEST_sstruct/io.saved.lassen @@ -23,13 +23,7 @@ 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 @@ -87,13 +81,7 @@ 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 diff --git a/src/test/TEST_sstruct/io.saved.lassen_cpu b/src/test/TEST_sstruct/io.saved.lassen_cpu index 1c44c5aa21..aeb5f52d66 100644 --- a/src/test/TEST_sstruct/io.saved.lassen_cpu +++ b/src/test/TEST_sstruct/io.saved.lassen_cpu @@ -23,13 +23,7 @@ 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 @@ -87,13 +81,7 @@ 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 diff --git a/src/test/TEST_sstruct/io.sh b/src/test/TEST_sstruct/io.sh index 17c2f99863..cb66b37110 100755 --- a/src/test/TEST_sstruct/io.sh +++ b/src/test/TEST_sstruct/io.sh @@ -19,8 +19,6 @@ FILES="\ ${TNAME}.out.1R\ ${TNAME}.out.2P\ ${TNAME}.out.2R\ - ${TNAME}.out.3P\ - ${TNAME}.out.3R\ ${TNAME}.out.4P\ ${TNAME}.out.4R\ ${TNAME}.out.5P\ @@ -35,8 +33,6 @@ FILES="\ ${TNAME}.out.101R\ ${TNAME}.out.102P\ ${TNAME}.out.102R\ - ${TNAME}.out.103P\ - ${TNAME}.out.103R\ ${TNAME}.out.104P\ ${TNAME}.out.104R\ ${TNAME}.out.105P\ diff --git a/src/test/TEST_sstruct/maxwell.jobs b/src/test/TEST_sstruct/maxwell.jobs deleted file mode 100755 index d4fa39187e..0000000000 --- a/src/test/TEST_sstruct/maxwell.jobs +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other -# HYPRE Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -#============================================================================= -# no test comparison at this time -#============================================================================= - -mpirun -np 1 ./maxwell_unscaled -in sstruct.in.maxwell3d_unscaled -solver 1 \ - > maxwell.out.0 -mpirun -np 2 ./maxwell_unscaled -in sstruct.in.maxwell3d_unscaled -solver 1 \ - -P 2 1 1 > maxwell.out.1 -mpirun -np 2 ./maxwell_unscaled -in sstruct.in.maxwell3d_unscaled -solver 1 \ - -P 2 1 1 -r 2 3 1 > maxwell.out.2 - diff --git a/src/test/TEST_sstruct/maxwell.saved b/src/test/TEST_sstruct/maxwell.saved deleted file mode 100644 index 1631b5062a..0000000000 --- a/src/test/TEST_sstruct/maxwell.saved +++ /dev/null @@ -1,12 +0,0 @@ -# Output file: maxwell.out.0 -Iterations = 10 -Final Relative Residual Norm = 2.477002e-09 - -# Output file: maxwell.out.1 -Iterations = 10 -Final Relative Residual Norm = 3.772486e-09 - -# Output file: maxwell.out.2 -Iterations = 10 -Final Relative Residual Norm = 7.155830e-09 - diff --git a/src/test/TEST_sstruct/maxwell.saved.lassen b/src/test/TEST_sstruct/maxwell.saved.lassen deleted file mode 100644 index 28eb56248b..0000000000 --- a/src/test/TEST_sstruct/maxwell.saved.lassen +++ /dev/null @@ -1,12 +0,0 @@ -# Output file: maxwell.out.0 -Iterations = 10 -Final Relative Residual Norm = 2.480102e-09 - -# Output file: maxwell.out.1 -Iterations = 10 -Final Relative Residual Norm = 3.782219e-09 - -# Output file: maxwell.out.2 -Iterations = 10 -Final Relative Residual Norm = 7.164797e-09 - diff --git a/src/test/TEST_sstruct/maxwell.saved.lassen_cpu b/src/test/TEST_sstruct/maxwell.saved.lassen_cpu deleted file mode 100644 index 3c0b326e44..0000000000 --- a/src/test/TEST_sstruct/maxwell.saved.lassen_cpu +++ /dev/null @@ -1,12 +0,0 @@ -# Output file: maxwell.out.0 -Iterations = 10 -Final Relative Residual Norm = 2.476905e-09 - -# Output file: maxwell.out.1 -Iterations = 10 -Final Relative Residual Norm = 3.773173e-09 - -# Output file: maxwell.out.2 -Iterations = 10 -Final Relative Residual Norm = 7.155215e-09 - diff --git a/src/test/TEST_sstruct/miller.jobs b/src/test/TEST_sstruct/miller.jobs index 984fc0df84..94966aec6c 100755 --- a/src/test/TEST_sstruct/miller.jobs +++ b/src/test/TEST_sstruct/miller.jobs @@ -12,19 +12,43 @@ mpirun -np 2 ./sstruct -in sstruct.in.miller_2blk -r 5 10 1 -P 2 1 1 \ -solver 11 > miller.out.0 mpirun -np 2 ./sstruct -in sstruct.in.miller_2blk -r 5 10 1 -P 2 1 1 \ -solver 20 -old_default > miller.out.1 +mpirun -np 2 ./sstruct -in sstruct.in.miller_2blk -r 5 10 1 -P 2 1 1 \ + -solver 4 > miller.out.2 +mpirun -np 2 ./sstruct -in sstruct.in.miller_2blk -r 5 10 1 -P 2 1 1 \ + -solver 14 > miller.out.3 + +mpirun -np 2 ./sstruct -in sstruct.in.miller_2blk1 -r 5 10 1 -P 2 1 1 \ + -solver 11 > miller.out.10 mpirun -np 2 ./sstruct -in sstruct.in.miller_2blk1 -r 5 10 1 -P 2 1 1 \ - -solver 11 > miller.out.2 + -solver 20 > miller.out.11 mpirun -np 2 ./sstruct -in sstruct.in.miller_2blk1 -r 5 10 1 -P 2 1 1 \ - -solver 20 > miller.out.3 + -solver 4 > miller.out.12 +mpirun -np 2 ./sstruct -in sstruct.in.miller_2blk1 -r 5 10 1 -P 2 1 1 \ + -solver 14 > miller.out.13 + +mpirun -np 2 ./sstruct -in sstruct.in.miller_2stk -r 5 10 1 -P 2 1 1 \ + -solver 11 > miller.out.20 mpirun -np 2 ./sstruct -in sstruct.in.miller_2stk -r 5 10 1 -P 2 1 1 \ - -solver 11 > miller.out.4 + -solver 20 -old_default > miller.out.21 mpirun -np 2 ./sstruct -in sstruct.in.miller_2stk -r 5 10 1 -P 2 1 1 \ - -solver 20 -old_default > miller.out.5 + -solver 4 > miller.out.22 +mpirun -np 2 ./sstruct -in sstruct.in.miller_2stk -r 5 10 1 -P 2 1 1 \ + -solver 14 > miller.out.23 + +mpirun -np 2 ./sstruct -in sstruct.in.miller_3blk -r 5 10 1 -P 2 1 1 \ + -solver 11 > miller.out.30 +mpirun -np 2 ./sstruct -in sstruct.in.miller_3blk -r 5 10 1 -P 2 1 1 \ + -solver 20 -old_default > miller.out.31 mpirun -np 2 ./sstruct -in sstruct.in.miller_3blk -r 5 10 1 -P 2 1 1 \ - -solver 11 > miller.out.6 + -solver 4 > miller.out.32 mpirun -np 2 ./sstruct -in sstruct.in.miller_3blk -r 5 10 1 -P 2 1 1 \ - -solver 20 -old_default > miller.out.7 + -solver 14 > miller.out.33 + +mpirun -np 2 ./sstruct -in sstruct.in.miller_diag -r 10 20 1 -P 2 1 1 \ + -solver 11 > miller.out.40 +mpirun -np 2 ./sstruct -in sstruct.in.miller_diag -r 10 20 1 -P 2 1 1 \ + -solver 20 > miller.out.41 mpirun -np 2 ./sstruct -in sstruct.in.miller_diag -r 10 20 1 -P 2 1 1 \ - -solver 11 > miller.out.8 + -solver 4 > miller.out.42 mpirun -np 2 ./sstruct -in sstruct.in.miller_diag -r 10 20 1 -P 2 1 1 \ - -solver 20 > miller.out.9 + -solver 14 > miller.out.43 diff --git a/src/test/TEST_sstruct/miller.saved b/src/test/TEST_sstruct/miller.saved index 1acfb9aae2..f256c55ce1 100644 --- a/src/test/TEST_sstruct/miller.saved +++ b/src/test/TEST_sstruct/miller.saved @@ -7,34 +7,73 @@ Iterations = 6 Final Relative Residual Norm = 9.625406e-08 # Output file: miller.out.2 +Iterations = 19 +Final Relative Residual Norm = 6.037448e-07 + +# Output file: miller.out.3 +Iterations = 9 +Final Relative Residual Norm = 2.315749e-07 + +# Output file: miller.out.10 Iterations = 15 Final Relative Residual Norm = 6.496892e-07 -# Output file: miller.out.3 +# Output file: miller.out.11 Iterations = 5 Final Relative Residual Norm = 4.230245e-07 -# Output file: miller.out.4 +# Output file: miller.out.12 +Iterations = 15 +Final Relative Residual Norm = 6.811593e-07 + +# Output file: miller.out.13 +Iterations = 7 +Final Relative Residual Norm = 6.183517e-07 + +# Output file: miller.out.20 Iterations = 18 Final Relative Residual Norm = 3.006677e-07 -# Output file: miller.out.5 +# Output file: miller.out.21 Iterations = 6 Final Relative Residual Norm = 8.758757e-08 -# Output file: miller.out.6 +# Output file: miller.out.22 +Iterations = 14 +Final Relative Residual Norm = 8.087236e-07 + +# Output file: miller.out.23 +Iterations = 8 +Final Relative Residual Norm = 1.681888e-07 + +# Output file: miller.out.30 Iterations = 37 Final Relative Residual Norm = 6.181674e-07 -# Output file: miller.out.7 +# Output file: miller.out.31 Iterations = 5 Final Relative Residual Norm = 8.323418e-07 -# Output file: miller.out.8 +# Output file: miller.out.32 +Iterations = 34 +Final Relative Residual Norm = 8.598582e-07 + +# Output file: miller.out.33 +Iterations = 11 +Final Relative Residual Norm = 2.675699e-07 + +# Output file: miller.out.40 Iterations = 3 Final Relative Residual Norm = 4.822192e-07 -# Output file: miller.out.9 +# Output file: miller.out.41 Iterations = 2 Final Relative Residual Norm = 2.571870e-07 +# Output file: miller.out.42 +Iterations = 4 +Final Relative Residual Norm = 4.398907e-07 + +# Output file: miller.out.43 +Iterations = 3 +Final Relative Residual Norm = 3.093709e-07 diff --git a/src/test/TEST_sstruct/miller.saved.lassen b/src/test/TEST_sstruct/miller.saved.lassen index 3766d36b1d..b0fced60c3 100644 --- a/src/test/TEST_sstruct/miller.saved.lassen +++ b/src/test/TEST_sstruct/miller.saved.lassen @@ -7,34 +7,73 @@ Iterations = 7 Final Relative Residual Norm = 3.361152e-07 # Output file: miller.out.2 +Iterations = 19 +Final Relative Residual Norm = 6.037878e-07 + +# Output file: miller.out.3 +Iterations = 9 +Final Relative Residual Norm = 2.315852e-07 + +# Output file: miller.out.10 Iterations = 15 Final Relative Residual Norm = 6.496892e-07 -# Output file: miller.out.3 +# Output file: miller.out.11 Iterations = 9 Final Relative Residual Norm = 4.304655e-07 -# Output file: miller.out.4 +# Output file: miller.out.12 +Iterations = 15 +Final Relative Residual Norm = 6.812253e-07 + +# Output file: miller.out.13 +Iterations = 7 +Final Relative Residual Norm = 6.184673e-07 + +# Output file: miller.out.20 Iterations = 18 Final Relative Residual Norm = 3.006677e-07 -# Output file: miller.out.5 +# Output file: miller.out.21 Iterations = 7 Final Relative Residual Norm = 1.958737e-07 -# Output file: miller.out.6 +# Output file: miller.out.22 +Iterations = 14 +Final Relative Residual Norm = 9.194802e-07 + +# Output file: miller.out.23 +Iterations = 8 +Final Relative Residual Norm = 1.733470e-07 + +# Output file: miller.out.30 Iterations = 37 Final Relative Residual Norm = 6.181674e-07 -# Output file: miller.out.7 +# Output file: miller.out.31 Iterations = 7 Final Relative Residual Norm = 7.661617e-07 -# Output file: miller.out.8 +# Output file: miller.out.32 +Iterations = 34 +Final Relative Residual Norm = 8.759786e-07 + +# Output file: miller.out.33 +Iterations = 11 +Final Relative Residual Norm = 2.673316e-07 + +# Output file: miller.out.40 Iterations = 3 Final Relative Residual Norm = 4.822192e-07 -# Output file: miller.out.9 +# Output file: miller.out.41 Iterations = 2 Final Relative Residual Norm = 2.571870e-07 +# Output file: miller.out.42 +Iterations = 4 +Final Relative Residual Norm = 4.398907e-07 + +# Output file: miller.out.43 +Iterations = 3 +Final Relative Residual Norm = 3.093709e-07 diff --git a/src/test/TEST_sstruct/miller.saved.lassen_cpu b/src/test/TEST_sstruct/miller.saved.lassen_cpu index 5c7bcc98fa..27ecd3b767 100644 --- a/src/test/TEST_sstruct/miller.saved.lassen_cpu +++ b/src/test/TEST_sstruct/miller.saved.lassen_cpu @@ -7,34 +7,73 @@ Iterations = 6 Final Relative Residual Norm = 9.625406e-08 # Output file: miller.out.2 +Iterations = 19 +Final Relative Residual Norm = 6.037448e-07 + +# Output file: miller.out.3 +Iterations = 9 +Final Relative Residual Norm = 2.315749e-07 + +# Output file: miller.out.10 Iterations = 15 Final Relative Residual Norm = 6.496892e-07 -# Output file: miller.out.3 +# Output file: miller.out.11 Iterations = 5 Final Relative Residual Norm = 4.213555e-07 -# Output file: miller.out.4 +# Output file: miller.out.12 +Iterations = 15 +Final Relative Residual Norm = 6.811593e-07 + +# Output file: miller.out.13 +Iterations = 7 +Final Relative Residual Norm = 6.183517e-07 + +# Output file: miller.out.20 Iterations = 18 Final Relative Residual Norm = 3.006677e-07 -# Output file: miller.out.5 +# Output file: miller.out.21 Iterations = 6 Final Relative Residual Norm = 8.758757e-08 -# Output file: miller.out.6 +# Output file: miller.out.22 +Iterations = 14 +Final Relative Residual Norm = 8.087236e-07 + +# Output file: miller.out.23 +Iterations = 8 +Final Relative Residual Norm = 1.681888e-07 + +# Output file: miller.out.30 Iterations = 37 Final Relative Residual Norm = 6.181674e-07 -# Output file: miller.out.7 +# Output file: miller.out.31 Iterations = 5 Final Relative Residual Norm = 8.323418e-07 -# Output file: miller.out.8 +# Output file: miller.out.32 +Iterations = 34 +Final Relative Residual Norm = 8.598582e-07 + +# Output file: miller.out.33 +Iterations = 11 +Final Relative Residual Norm = 2.675699e-07 + +# Output file: miller.out.40 Iterations = 3 Final Relative Residual Norm = 4.822192e-07 -# Output file: miller.out.9 +# Output file: miller.out.41 Iterations = 2 Final Relative Residual Norm = 2.571870e-07 +# Output file: miller.out.42 +Iterations = 4 +Final Relative Residual Norm = 4.398907e-07 + +# Output file: miller.out.43 +Iterations = 3 +Final Relative Residual Norm = 3.093709e-07 diff --git a/src/test/TEST_sstruct/miller.sh b/src/test/TEST_sstruct/miller.sh index fc9015c472..ec0c14264a 100755 --- a/src/test/TEST_sstruct/miller.sh +++ b/src/test/TEST_sstruct/miller.sh @@ -17,12 +17,22 @@ 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.20\ + ${TNAME}.out.21\ + ${TNAME}.out.22\ + ${TNAME}.out.23\ + ${TNAME}.out.30\ + ${TNAME}.out.31\ + ${TNAME}.out.32\ + ${TNAME}.out.33\ + ${TNAME}.out.40\ + ${TNAME}.out.41\ + ${TNAME}.out.42\ + ${TNAME}.out.43\ " for i in $FILES diff --git a/src/test/TEST_sstruct/nonmixedint.jobs b/src/test/TEST_sstruct/nonmixedint.jobs index 4b9ffe7558..ba4287e79d 100755 --- a/src/test/TEST_sstruct/nonmixedint.jobs +++ b/src/test/TEST_sstruct/nonmixedint.jobs @@ -18,13 +18,16 @@ # 16: emptyProc.out.120 #============================================================================= +# solvers.jobs tests mpirun -np 2 ./sstruct -P 1 1 2 -solver 21 > nonmixedint.out.0 mpirun -np 2 ./sstruct -P 1 1 2 -solver 22 > nonmixedint.out.1 mpirun -np 2 ./sstruct -P 1 1 2 -solver 41 > nonmixedint.out.2 mpirun -np 2 ./sstruct -P 1 1 2 -solver 42 > nonmixedint.out.3 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -rhsone -solver 22 > nonmixedint.out.4 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc3 -rhsone -solver 22 > nonmixedint.out.14 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -rhsone -solver 42 > nonmixedint.out.5 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc3 -rhsone -solver 42 > nonmixedint.out.15 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc1 -rhsone -solver 62 > nonmixedint.out.6 -mpirun -np 2 ./sstruct -in sstruct.in.emptyProc3 -rhsone -solver 62 > nonmixedint.out.16 + +# emptyProc.jobs tests +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 22 > nonmixedint.out.4 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 22 > nonmixedint.out.14 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 42 > nonmixedint.out.5 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 42 > nonmixedint.out.15 +mpirun -np 1 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 62 > nonmixedint.out.6 +mpirun -np 2 ./sstruct -in sstruct.in.cube -r 5 5 5 -rhsone -solver 62 > nonmixedint.out.16 diff --git a/src/test/TEST_sstruct/nonmixedint.saved b/src/test/TEST_sstruct/nonmixedint.saved index 080362fce2..ed3862f98b 100644 --- a/src/test/TEST_sstruct/nonmixedint.saved +++ b/src/test/TEST_sstruct/nonmixedint.saved @@ -25,3 +25,4 @@ Final Relative Residual Norm = 6.043891e-07 # Output file: nonmixedint.out.6 Iterations = 8 Final Relative Residual Norm = 7.771825e-07 + diff --git a/src/test/TEST_sstruct/periodic.saved b/src/test/TEST_sstruct/periodic.saved index 5578d5597d..94066c4156 100644 --- a/src/test/TEST_sstruct/periodic.saved +++ b/src/test/TEST_sstruct/periodic.saved @@ -16,15 +16,15 @@ Final Relative Residual Norm = 7.560049e-07 # Output file: periodic.out.40 Iterations = 13 -Final Relative Residual Norm = 3.737885e-07 +Final Relative Residual Norm = 3.737891e-07 # Output file: periodic.out.41 Iterations = 13 -Final Relative Residual Norm = 3.737885e-07 +Final Relative Residual Norm = 3.737891e-07 # Output file: periodic.out.42 Iterations = 13 -Final Relative Residual Norm = 3.737885e-07 +Final Relative Residual Norm = 3.737891e-07 # Output file: periodic.out.50 Iterations = 12 diff --git a/src/test/TEST_sstruct/periodic.saved.lassen b/src/test/TEST_sstruct/periodic.saved.lassen index 8baf35f258..9206147dd6 100644 --- a/src/test/TEST_sstruct/periodic.saved.lassen +++ b/src/test/TEST_sstruct/periodic.saved.lassen @@ -16,15 +16,15 @@ Final Relative Residual Norm = 7.560049e-07 # Output file: periodic.out.40 Iterations = 13 -Final Relative Residual Norm = 3.737885e-07 +Final Relative Residual Norm = 3.737891e-07 # Output file: periodic.out.41 Iterations = 13 -Final Relative Residual Norm = 3.737885e-07 +Final Relative Residual Norm = 3.737891e-07 # Output file: periodic.out.42 Iterations = 13 -Final Relative Residual Norm = 3.737885e-07 +Final Relative Residual Norm = 3.737891e-07 # Output file: periodic.out.50 Iterations = 12 diff --git a/src/test/TEST_sstruct/periodic.saved.lassen_cpu b/src/test/TEST_sstruct/periodic.saved.lassen_cpu index 8baf35f258..9206147dd6 100644 --- a/src/test/TEST_sstruct/periodic.saved.lassen_cpu +++ b/src/test/TEST_sstruct/periodic.saved.lassen_cpu @@ -16,15 +16,15 @@ Final Relative Residual Norm = 7.560049e-07 # Output file: periodic.out.40 Iterations = 13 -Final Relative Residual Norm = 3.737885e-07 +Final Relative Residual Norm = 3.737891e-07 # Output file: periodic.out.41 Iterations = 13 -Final Relative Residual Norm = 3.737885e-07 +Final Relative Residual Norm = 3.737891e-07 # Output file: periodic.out.42 Iterations = 13 -Final Relative Residual Norm = 3.737885e-07 +Final Relative Residual Norm = 3.737891e-07 # Output file: periodic.out.50 Iterations = 12 diff --git a/src/test/TEST_sstruct/solvers.jobs b/src/test/TEST_sstruct/solvers.jobs index 01e35154a0..7cce9cfe55 100755 --- a/src/test/TEST_sstruct/solvers.jobs +++ b/src/test/TEST_sstruct/solvers.jobs @@ -30,3 +30,70 @@ mpirun -np 2 ./sstruct -P 1 1 2 -solver 78 > solvers.out.18 mpirun -np 2 ./sstruct -P 1 1 2 -solver 80 > solvers.out.19 mpirun -np 2 ./sstruct -P 1 1 2 -solver 90 > solvers.out.20 +# SSAMG +mpirun -np 1 ./sstruct -in sstruct.in.cube -P 1 1 1 -r 4 4 4 -solver 4 > solvers.out.21 +mpirun -np 8 ./sstruct -in sstruct.in.cube -P 2 2 2 -r 2 2 2 -solver 4 > solvers.out.22 +mpirun -np 8 ./sstruct -in sstruct.in.cube -P 2 2 2 -r 2 2 2 -solver 4 -skip 1 > solvers.out.23 +mpirun -np 1 ./sstruct -in sstruct.in.cube21 -r 2 2 2 -solver 4 > solvers.out.24 +mpirun -np 8 ./sstruct -in sstruct.in.cube21 -P 2 2 2 -r 1 1 1 -solver 4 > solvers.out.25 +mpirun -np 8 ./sstruct -in sstruct.in.cube21 -P 2 2 2 -r 1 1 1 -solver 4 -skip 1 > solvers.out.26 +mpirun -np 1 ./sstruct -in sstruct.in.cubes4_7pt -r 2 2 2 -solver 4 -pooldist 1 > solvers.out.27 +mpirun -np 4 ./sstruct -in sstruct.in.cubes4_7pt -r 2 2 2 -solver 4 -pooldist 0 > solvers.out.28 +mpirun -np 4 ./sstruct -in sstruct.in.cubes4_7pt -r 2 2 2 -solver 4 -pooldist 0 -skip 1 > solvers.out.29 +mpirun -np 1 ./sstruct -in sstruct.in.cubes4_27pt -r 2 2 2 -solver 4 -pooldist 1 > solvers.out.30 +mpirun -np 4 ./sstruct -in sstruct.in.cubes4_27pt -r 2 2 2 -solver 4 -pooldist 0 > solvers.out.31 +mpirun -np 4 ./sstruct -in sstruct.in.cubes4_27pt -r 2 2 2 -solver 4 -pooldist 0 -skip 1 > solvers.out.32 +mpirun -np 1 ./sstruct -in sstruct.in.cubes2_aniso -r 4 4 4 -solver 4 -pooldist 1 > solvers.out.33 +mpirun -np 2 ./sstruct -in sstruct.in.cubes2_aniso -r 4 4 4 -solver 4 -pooldist 0 > solvers.out.34 +mpirun -np 2 ./sstruct -in sstruct.in.cubes2_aniso -r 4 4 4 -solver 4 -pooldist 0 -skip 1 > solvers.out.35 +mpirun -np 1 ./sstruct -in sstruct.in.marinak -P 1 1 1 -solver 4 > solvers.out.36 +mpirun -np 8 ./sstruct -in sstruct.in.marinak -P 1 1 1 -solver 4 -pooldist 1 > solvers.out.37 +mpirun -np 1 ./sstruct -in sstruct.in.miller_3blk -r 4 4 1 -solver 4 -pooldist 0 > solvers.out.38 +mpirun -np 3 ./sstruct -in sstruct.in.miller_3blk -r 4 4 1 -solver 4 -pooldist 1 > solvers.out.39 +mpirun -np 3 ./sstruct -in sstruct.in.miller_3blk -r 4 4 1 -solver 4 -pooldist 1 -skip 1 > solvers.out.40 +mpirun -np 1 ./sstruct -in sstruct.in.cubes2 -r 4 4 4 -solver 4 -pooldist 1 > solvers.out.41 +mpirun -np 2 ./sstruct -in sstruct.in.cubes2 -r 4 4 4 -solver 4 -pooldist 0 > solvers.out.42 +mpirun -np 2 ./sstruct -in sstruct.in.cubes2 -r 4 4 4 -solver 4 -pooldist 0 -skip 1 > solvers.out.43 + +# SSAMG with unstructured interpolation +mpirun -np 1 ./sstruct -in sstruct.in.cube -P 1 1 1 -r 4 4 4 -solver 4 -interp 0 > solvers.out.44 +mpirun -np 8 ./sstruct -in sstruct.in.cube -P 2 2 2 -r 2 2 2 -solver 4 -interp 0 > solvers.out.45 +mpirun -np 1 ./sstruct -in sstruct.in.cube21 -r 2 2 2 -solver 4 -interp 0 > solvers.out.46 +mpirun -np 8 ./sstruct -in sstruct.in.cube21 -P 2 2 2 -r 1 1 1 -solver 4 -interp 0 > solvers.out.47 +mpirun -np 1 ./sstruct -in sstruct.in.cubes4_7pt -r 2 2 2 -solver 4 -pooldist 1 -interp 0 > solvers.out.48 +mpirun -np 4 ./sstruct -in sstruct.in.cubes4_7pt -r 2 2 2 -solver 4 -pooldist 0 -interp 0 > solvers.out.49 +mpirun -np 1 ./sstruct -in sstruct.in.cubes4_27pt -r 2 2 2 -solver 4 -pooldist 1 -interp 0 > solvers.out.50 +#mpirun -np 4 ./sstruct -in sstruct.in.cubes4_27pt -r 2 2 2 -solver 4 -pooldist 0 -interp 0 > solvers.out.51 +mpirun -np 1 ./sstruct -in sstruct.in.cubes2_aniso -r 4 4 4 -solver 4 -pooldist 1 -interp 0 > solvers.out.52 +mpirun -np 2 ./sstruct -in sstruct.in.cubes2_aniso -r 4 4 4 -solver 4 -pooldist 0 -interp 0 > solvers.out.53 +#mpirun -np 1 ./sstruct -in sstruct.in.marinak -P 1 1 1 -solver 4 -interp 0 > solvers.out.54 +#mpirun -np 8 ./sstruct -in sstruct.in.marinak -P 1 1 1 -solver 4 -pooldist 1 -interp 0 > solvers.out.55 +mpirun -np 1 ./sstruct -in sstruct.in.miller_3blk -r 4 4 1 -solver 4 -pooldist 0 -interp 0 > solvers.out.56 +mpirun -np 3 ./sstruct -in sstruct.in.miller_3blk -r 4 4 1 -solver 4 -pooldist 1 -interp 0 > solvers.out.57 +mpirun -np 1 ./sstruct -in sstruct.in.cubes2 -r 4 4 4 -solver 4 -pooldist 1 -interp 0 > solvers.out.58 +mpirun -np 2 ./sstruct -in sstruct.in.cubes2 -r 4 4 4 -solver 4 -pooldist 0 -interp 0 > solvers.out.59 + +# SSAMG-PCG +mpirun -np 1 ./sstruct -in sstruct.in.cube -P 1 1 1 -r 4 4 4 -solver 14 > solvers.out.121 +mpirun -np 8 ./sstruct -in sstruct.in.cube -P 2 2 2 -r 2 2 2 -solver 14 > solvers.out.122 +mpirun -np 8 ./sstruct -in sstruct.in.cube -P 2 2 2 -r 2 2 2 -solver 14 -skip 1 > solvers.out.123 +mpirun -np 1 ./sstruct -in sstruct.in.cube21 -r 2 2 2 -solver 14 > solvers.out.124 +mpirun -np 8 ./sstruct -in sstruct.in.cube21 -P 2 2 2 -r 1 1 1 -solver 14 > solvers.out.125 +mpirun -np 8 ./sstruct -in sstruct.in.cube21 -P 2 2 2 -r 1 1 1 -solver 14 -skip 1 > solvers.out.126 +mpirun -np 1 ./sstruct -in sstruct.in.cubes4_7pt -r 2 2 2 -solver 14 -pooldist 1 > solvers.out.127 +mpirun -np 4 ./sstruct -in sstruct.in.cubes4_7pt -r 2 2 2 -solver 14 -pooldist 0 > solvers.out.128 +mpirun -np 1 ./sstruct -in sstruct.in.cubes4_27pt -r 2 2 2 -solver 14 -pooldist 1 > solvers.out.129 +mpirun -np 4 ./sstruct -in sstruct.in.cubes4_27pt -r 2 2 2 -solver 14 -pooldist 0 > solvers.out.130 +mpirun -np 4 ./sstruct -in sstruct.in.cubes4_27pt -r 2 2 2 -solver 14 -pooldist 0 -skip 1 > solvers.out.131 +mpirun -np 1 ./sstruct -in sstruct.in.cubes2_aniso -r 4 4 4 -solver 14 -pooldist 1 > solvers.out.132 +mpirun -np 2 ./sstruct -in sstruct.in.cubes2_aniso -r 4 4 4 -solver 14 -pooldist 0 > solvers.out.133 +mpirun -np 2 ./sstruct -in sstruct.in.cubes2_aniso -r 4 4 4 -solver 14 -pooldist 0 -skip 1 > solvers.out.134 +mpirun -np 1 ./sstruct -in sstruct.in.marinak -P 1 1 1 -solver 14 > solvers.out.135 +mpirun -np 8 ./sstruct -in sstruct.in.marinak -P 1 1 1 -solver 14 -pooldist 1 > solvers.out.136 +mpirun -np 8 ./sstruct -in sstruct.in.marinak -P 1 1 1 -solver 14 -pooldist 1 -skip 1 > solvers.out.137 +mpirun -np 1 ./sstruct -in sstruct.in.miller_3blk -r 4 4 1 -solver 14 -pooldist 0 > solvers.out.138 +mpirun -np 3 ./sstruct -in sstruct.in.miller_3blk -r 4 4 1 -solver 14 -pooldist 1 > solvers.out.139 +mpirun -np 3 ./sstruct -in sstruct.in.miller_3blk -r 4 4 1 -solver 14 -pooldist 1 -skip 1 > solvers.out.140 +mpirun -np 1 ./sstruct -in sstruct.in.cubes2 -r 4 4 4 -solver 14 -pooldist 1 > solvers.out.141 +mpirun -np 2 ./sstruct -in sstruct.in.cubes2 -r 4 4 4 -solver 14 -pooldist 0 > solvers.out.142 +mpirun -np 2 ./sstruct -in sstruct.in.cubes2 -r 4 4 4 -solver 14 -pooldist 0 -skip 1 > solvers.out.143 diff --git a/src/test/TEST_sstruct/solvers.saved b/src/test/TEST_sstruct/solvers.saved index 98a00b4794..13df3f2fb8 100644 --- a/src/test/TEST_sstruct/solvers.saved +++ b/src/test/TEST_sstruct/solvers.saved @@ -4,7 +4,7 @@ Final Relative Residual Norm = 6.429522e-07 # Output file: solvers.out.1 Iterations = 24 -Final Relative Residual Norm = 6.654613e-07 +Final Relative Residual Norm = 6.494002e-07 # Output file: solvers.out.2 Iterations = 25 @@ -18,21 +18,13 @@ Final Relative Residual Norm = 9.124482e-07 Iterations = 4 Final Relative Residual Norm = 9.533464e-07 -# Output file: solvers.out.5 -#Iterations = 7 -#Final Relative Residual Norm = 2.672054e-07 - -# Output file: solvers.out.6 -#Iterations = 25 -#Final Relative Residual Norm = 9.124482e-07 - # Output file: solvers.out.7 Iterations = 28 Final Relative Residual Norm = 7.409212e-07 # Output file: solvers.out.8 Iterations = 28 -Final Relative Residual Norm = 7.485693e-07 +Final Relative Residual Norm = 7.222836e-07 # Output file: solvers.out.9 Iterations = 30 @@ -46,14 +38,6 @@ Final Relative Residual Norm = 9.036190e-07 Iterations = 4 Final Relative Residual Norm = 9.340817e-07 -# Output file: solvers.out.12 -#Iterations = 7 -#Final Relative Residual Norm = 3.319145e-07 - -# Output file: solvers.out.13 -#Iterations = 31 -#Final Relative Residual Norm = 7.336388e-07 - # Output file: solvers.out.14 Iterations = 11 Final Relative Residual Norm = 8.131824e-07 @@ -68,7 +52,7 @@ Final Relative Residual Norm = 7.409212e-07 # Output file: solvers.out.17 Iterations = 28 -Final Relative Residual Norm = 7.485693e-07 +Final Relative Residual Norm = 7.222836e-07 # Output file: solvers.out.18 Iterations = 30 @@ -82,3 +66,239 @@ Final Relative Residual Norm = 9.340817e-07 Iterations = 4 Final Relative Residual Norm = 9.340817e-07 +# Output file: solvers.out.21 +Iterations = 16 +Final Relative Residual Norm = 5.860172e-07 + +# Output file: solvers.out.22 +Iterations = 16 +Final Relative Residual Norm = 5.860172e-07 + +# Output file: solvers.out.23 +Iterations = 19 +Final Relative Residual Norm = 5.410660e-07 + +# Output file: solvers.out.24 +Iterations = 5 +Final Relative Residual Norm = 3.620491e-07 + +# Output file: solvers.out.25 +Iterations = 5 +Final Relative Residual Norm = 3.620491e-07 + +# Output file: solvers.out.26 +Iterations = 8 +Final Relative Residual Norm = 3.073550e-07 + +# Output file: solvers.out.27 +Iterations = 20 +Final Relative Residual Norm = 8.064992e-07 + +# Output file: solvers.out.28 +Iterations = 20 +Final Relative Residual Norm = 8.065630e-07 + +# Output file: solvers.out.29 +Iterations = 27 +Final Relative Residual Norm = 9.862452e-07 + +# Output file: solvers.out.30 +Iterations = 10 +Final Relative Residual Norm = 8.494308e-07 + +# Output file: solvers.out.31 +Iterations = 10 +Final Relative Residual Norm = 8.495113e-07 + +# Output file: solvers.out.32 +Iterations = 16 +Final Relative Residual Norm = 6.449814e-07 + +# Output file: solvers.out.33 +Iterations = 11 +Final Relative Residual Norm = 9.305172e-07 + +# Output file: solvers.out.34 +Iterations = 11 +Final Relative Residual Norm = 9.305172e-07 + +# Output file: solvers.out.35 +Iterations = 15 +Final Relative Residual Norm = 6.735600e-07 + +# Output file: solvers.out.36 +Iterations = 33 +Final Relative Residual Norm = 9.815193e-07 + +# Output file: solvers.out.37 +Iterations = 33 +Final Relative Residual Norm = 9.815193e-07 + +# Output file: solvers.out.38 +Iterations = 20 +Final Relative Residual Norm = 7.298161e-07 + +# Output file: solvers.out.39 +Iterations = 20 +Final Relative Residual Norm = 6.920001e-07 + +# Output file: solvers.out.40 +Iterations = 28 +Final Relative Residual Norm = 9.245643e-07 + +# Output file: solvers.out.41 +Iterations = 17 +Final Relative Residual Norm = 7.137571e-07 + +# Output file: solvers.out.42 +Iterations = 17 +Final Relative Residual Norm = 7.137571e-07 + +# Output file: solvers.out.43 +Iterations = 19 +Final Relative Residual Norm = 8.795265e-07 + +# Output file: solvers.out.44 +Iterations = 16 +Final Relative Residual Norm = 5.860172e-07 + +# Output file: solvers.out.45 +Iterations = 16 +Final Relative Residual Norm = 5.860172e-07 + +# Output file: solvers.out.46 +Iterations = 5 +Final Relative Residual Norm = 3.620491e-07 + +# Output file: solvers.out.47 +Iterations = 5 +Final Relative Residual Norm = 3.620491e-07 + +# Output file: solvers.out.48 +Iterations = 19 +Final Relative Residual Norm = 9.434680e-07 + +# Output file: solvers.out.49 +Iterations = 19 +Final Relative Residual Norm = 9.434675e-07 + +# Output file: solvers.out.50 +Iterations = 9 +Final Relative Residual Norm = 5.708657e-07 + +# Output file: solvers.out.52 +Iterations = 10 +Final Relative Residual Norm = 5.546960e-07 + +# Output file: solvers.out.53 +Iterations = 10 +Final Relative Residual Norm = 5.546960e-07 + +# Output file: solvers.out.56 +Iterations = 9 +Final Relative Residual Norm = 4.299808e-07 + +# Output file: solvers.out.57 +Iterations = 9 +Final Relative Residual Norm = 4.639955e-07 + +# Output file: solvers.out.58 +Iterations = 15 +Final Relative Residual Norm = 7.581157e-07 + +# Output file: solvers.out.59 +Iterations = 15 +Final Relative Residual Norm = 7.581157e-07 + +# Output file: solvers.out.121 +Iterations = 8 +Final Relative Residual Norm = 1.773482e-07 + +# Output file: solvers.out.122 +Iterations = 8 +Final Relative Residual Norm = 1.773482e-07 + +# Output file: solvers.out.123 +Iterations = 8 +Final Relative Residual Norm = 5.357507e-07 + +# Output file: solvers.out.124 +Iterations = 4 +Final Relative Residual Norm = 9.477770e-07 + +# Output file: solvers.out.125 +Iterations = 4 +Final Relative Residual Norm = 9.477770e-07 + +# Output file: solvers.out.126 +Iterations = 6 +Final Relative Residual Norm = 9.016110e-08 + +# Output file: solvers.out.127 +Iterations = 9 +Final Relative Residual Norm = 4.581734e-07 + +# Output file: solvers.out.128 +Iterations = 9 +Final Relative Residual Norm = 4.581776e-07 + +# Output file: solvers.out.129 +Iterations = 6 +Final Relative Residual Norm = 4.953666e-07 + +# Output file: solvers.out.130 +Iterations = 6 +Final Relative Residual Norm = 4.954254e-07 + +# Output file: solvers.out.131 +Iterations = 8 +Final Relative Residual Norm = 3.397928e-07 + +# Output file: solvers.out.132 +Iterations = 7 +Final Relative Residual Norm = 1.153410e-07 + +# Output file: solvers.out.133 +Iterations = 7 +Final Relative Residual Norm = 1.153410e-07 + +# Output file: solvers.out.134 +Iterations = 8 +Final Relative Residual Norm = 3.862981e-07 + +# Output file: solvers.out.135 +Iterations = 11 +Final Relative Residual Norm = 5.085202e-07 + +# Output file: solvers.out.136 +Iterations = 11 +Final Relative Residual Norm = 5.085202e-07 + +# Output file: solvers.out.137 +Iterations = 14 +Final Relative Residual Norm = 4.469909e-07 + +# Output file: solvers.out.138 +Iterations = 9 +Final Relative Residual Norm = 4.624732e-07 + +# Output file: solvers.out.139 +Iterations = 9 +Final Relative Residual Norm = 4.577062e-07 + +# Output file: solvers.out.140 +Iterations = 11 +Final Relative Residual Norm = 2.703015e-07 + +# Output file: solvers.out.141 +Iterations = 8 +Final Relative Residual Norm = 3.969852e-07 + +# Output file: solvers.out.142 +Iterations = 8 +Final Relative Residual Norm = 3.969852e-07 + +# Output file: solvers.out.143 +Iterations = 9 +Final Relative Residual Norm = 6.839878e-07 + diff --git a/src/test/TEST_sstruct/solvers.saved.lassen b/src/test/TEST_sstruct/solvers.saved.lassen index a27b62381a..9d8c535427 100644 --- a/src/test/TEST_sstruct/solvers.saved.lassen +++ b/src/test/TEST_sstruct/solvers.saved.lassen @@ -4,7 +4,7 @@ Final Relative Residual Norm = 6.429522e-07 # Output file: solvers.out.1 Iterations = 24 -Final Relative Residual Norm = 6.654613e-07 +Final Relative Residual Norm = 6.494002e-07 # Output file: solvers.out.2 Iterations = 25 @@ -24,7 +24,7 @@ Final Relative Residual Norm = 7.409212e-07 # Output file: solvers.out.8 Iterations = 28 -Final Relative Residual Norm = 7.485693e-07 +Final Relative Residual Norm = 7.222836e-07 # Output file: solvers.out.9 Iterations = 30 @@ -52,7 +52,7 @@ Final Relative Residual Norm = 7.409212e-07 # Output file: solvers.out.17 Iterations = 28 -Final Relative Residual Norm = 7.485693e-07 +Final Relative Residual Norm = 7.222836e-07 # Output file: solvers.out.18 Iterations = 30 @@ -64,5 +64,241 @@ Final Relative Residual Norm = 4.151604e-07 # Output file: solvers.out.20 Iterations = 8 -Final Relative Residual Norm = 3.335606e-07 +Final Relative Residual Norm = 4.151604e-07 + +# Output file: solvers.out.21 +Iterations = 16 +Final Relative Residual Norm = 5.860172e-07 + +# Output file: solvers.out.22 +Iterations = 16 +Final Relative Residual Norm = 5.860172e-07 + +# Output file: solvers.out.23 +Iterations = 19 +Final Relative Residual Norm = 5.410660e-07 + +# Output file: solvers.out.24 +Iterations = 5 +Final Relative Residual Norm = 3.620491e-07 + +# Output file: solvers.out.25 +Iterations = 5 +Final Relative Residual Norm = 3.620491e-07 + +# Output file: solvers.out.26 +Iterations = 8 +Final Relative Residual Norm = 3.073550e-07 + +# Output file: solvers.out.27 +Iterations = 20 +Final Relative Residual Norm = 8.067336e-07 + +# Output file: solvers.out.28 +Iterations = 20 +Final Relative Residual Norm = 8.064134e-07 + +# Output file: solvers.out.29 +Iterations = 27 +Final Relative Residual Norm = 9.804282e-07 + +# Output file: solvers.out.30 +Iterations = 10 +Final Relative Residual Norm = 8.496499e-07 + +# Output file: solvers.out.31 +Iterations = 10 +Final Relative Residual Norm = 8.496523e-07 + +# Output file: solvers.out.32 +Iterations = 16 +Final Relative Residual Norm = 6.483051e-07 + +# Output file: solvers.out.33 +Iterations = 11 +Final Relative Residual Norm = 9.305172e-07 + +# Output file: solvers.out.34 +Iterations = 11 +Final Relative Residual Norm = 9.305172e-07 + +# Output file: solvers.out.35 +Iterations = 15 +Final Relative Residual Norm = 6.735600e-07 + +# Output file: solvers.out.36 +Iterations = 33 +Final Relative Residual Norm = 9.815193e-07 + +# Output file: solvers.out.37 +Iterations = 33 +Final Relative Residual Norm = 9.815193e-07 + +# Output file: solvers.out.38 +Iterations = 20 +Final Relative Residual Norm = 7.473693e-07 + +# Output file: solvers.out.39 +Iterations = 20 +Final Relative Residual Norm = 5.943143e-07 + +# Output file: solvers.out.40 +Iterations = 28 +Final Relative Residual Norm = 7.278757e-07 + +# Output file: solvers.out.41 +Iterations = 17 +Final Relative Residual Norm = 7.137571e-07 + +# Output file: solvers.out.42 +Iterations = 17 +Final Relative Residual Norm = 7.137571e-07 + +# Output file: solvers.out.43 +Iterations = 19 +Final Relative Residual Norm = 8.794135e-07 + +# Output file: solvers.out.44 +Iterations = 16 +Final Relative Residual Norm = 5.860172e-07 + +# Output file: solvers.out.45 +Iterations = 16 +Final Relative Residual Norm = 5.860172e-07 + +# Output file: solvers.out.46 +Iterations = 5 +Final Relative Residual Norm = 3.620491e-07 + +# Output file: solvers.out.47 +Iterations = 5 +Final Relative Residual Norm = 3.620491e-07 + +# Output file: solvers.out.48 +Iterations = 19 +Final Relative Residual Norm = 9.442201e-07 + +# Output file: solvers.out.49 +Iterations = 19 +Final Relative Residual Norm = 9.442196e-07 + +# Output file: solvers.out.50 +Iterations = 9 +Final Relative Residual Norm = 3.648929e-07 + +# Output file: solvers.out.52 +Iterations = 10 +Final Relative Residual Norm = 5.460732e-07 + +# Output file: solvers.out.53 +Iterations = 10 +Final Relative Residual Norm = 5.501592e-07 + +# Output file: solvers.out.56 +Iterations = 9 +Final Relative Residual Norm = 2.912484e-07 + +# Output file: solvers.out.57 +Iterations = 9 +Final Relative Residual Norm = 2.831967e-07 + +# Output file: solvers.out.58 +Iterations = 15 +Final Relative Residual Norm = 7.580173e-07 + +# Output file: solvers.out.59 +Iterations = 15 +Final Relative Residual Norm = 7.582357e-07 + +# Output file: solvers.out.121 +Iterations = 8 +Final Relative Residual Norm = 1.773482e-07 + +# Output file: solvers.out.122 +Iterations = 8 +Final Relative Residual Norm = 1.773482e-07 + +# Output file: solvers.out.123 +Iterations = 8 +Final Relative Residual Norm = 5.357507e-07 + +# Output file: solvers.out.124 +Iterations = 4 +Final Relative Residual Norm = 9.477770e-07 + +# Output file: solvers.out.125 +Iterations = 4 +Final Relative Residual Norm = 9.477770e-07 + +# Output file: solvers.out.126 +Iterations = 6 +Final Relative Residual Norm = 9.016110e-08 + +# Output file: solvers.out.127 +Iterations = 9 +Final Relative Residual Norm = 4.581595e-07 + +# Output file: solvers.out.128 +Iterations = 9 +Final Relative Residual Norm = 4.582013e-07 + +# Output file: solvers.out.129 +Iterations = 6 +Final Relative Residual Norm = 4.955338e-07 + +# Output file: solvers.out.130 +Iterations = 6 +Final Relative Residual Norm = 4.954970e-07 + +# Output file: solvers.out.131 +Iterations = 8 +Final Relative Residual Norm = 3.403388e-07 + +# Output file: solvers.out.132 +Iterations = 7 +Final Relative Residual Norm = 1.153410e-07 + +# Output file: solvers.out.133 +Iterations = 7 +Final Relative Residual Norm = 1.153410e-07 + +# Output file: solvers.out.134 +Iterations = 8 +Final Relative Residual Norm = 3.862981e-07 + +# Output file: solvers.out.135 +Iterations = 11 +Final Relative Residual Norm = 5.085202e-07 + +# Output file: solvers.out.136 +Iterations = 11 +Final Relative Residual Norm = 5.085202e-07 + +# Output file: solvers.out.137 +Iterations = 14 +Final Relative Residual Norm = 4.469909e-07 + +# Output file: solvers.out.138 +Iterations = 9 +Final Relative Residual Norm = 4.653532e-07 + +# Output file: solvers.out.139 +Iterations = 9 +Final Relative Residual Norm = 4.437146e-07 + +# Output file: solvers.out.140 +Iterations = 11 +Final Relative Residual Norm = 2.586452e-07 + +# Output file: solvers.out.141 +Iterations = 8 +Final Relative Residual Norm = 3.969852e-07 + +# Output file: solvers.out.142 +Iterations = 8 +Final Relative Residual Norm = 3.969852e-07 + +# Output file: solvers.out.143 +Iterations = 9 +Final Relative Residual Norm = 6.839719e-07 diff --git a/src/test/TEST_sstruct/solvers.saved.lassen_cpu b/src/test/TEST_sstruct/solvers.saved.lassen_cpu index 61d07df184..8d9b37d7a9 100644 --- a/src/test/TEST_sstruct/solvers.saved.lassen_cpu +++ b/src/test/TEST_sstruct/solvers.saved.lassen_cpu @@ -4,7 +4,7 @@ Final Relative Residual Norm = 6.429522e-07 # Output file: solvers.out.1 Iterations = 24 -Final Relative Residual Norm = 6.654613e-07 +Final Relative Residual Norm = 6.494002e-07 # Output file: solvers.out.2 Iterations = 25 @@ -24,7 +24,7 @@ Final Relative Residual Norm = 7.409212e-07 # Output file: solvers.out.8 Iterations = 28 -Final Relative Residual Norm = 7.485693e-07 +Final Relative Residual Norm = 7.222836e-07 # Output file: solvers.out.9 Iterations = 30 @@ -52,7 +52,7 @@ Final Relative Residual Norm = 7.409212e-07 # Output file: solvers.out.17 Iterations = 28 -Final Relative Residual Norm = 7.485693e-07 +Final Relative Residual Norm = 7.222836e-07 # Output file: solvers.out.18 Iterations = 30 @@ -66,3 +66,238 @@ Final Relative Residual Norm = 9.340843e-07 Iterations = 4 Final Relative Residual Norm = 9.340843e-07 +# Output file: solvers.out.21 +Iterations = 16 +Final Relative Residual Norm = 5.860172e-07 + +# Output file: solvers.out.22 +Iterations = 16 +Final Relative Residual Norm = 5.860172e-07 + +# Output file: solvers.out.23 +Iterations = 19 +Final Relative Residual Norm = 5.410660e-07 + +# Output file: solvers.out.24 +Iterations = 5 +Final Relative Residual Norm = 3.620491e-07 + +# Output file: solvers.out.25 +Iterations = 5 +Final Relative Residual Norm = 3.620491e-07 + +# Output file: solvers.out.26 +Iterations = 8 +Final Relative Residual Norm = 3.073550e-07 + +# Output file: solvers.out.27 +Iterations = 20 +Final Relative Residual Norm = 8.064992e-07 + +# Output file: solvers.out.28 +Iterations = 20 +Final Relative Residual Norm = 8.065630e-07 + +# Output file: solvers.out.29 +Iterations = 27 +Final Relative Residual Norm = 9.862452e-07 + +# Output file: solvers.out.30 +Iterations = 10 +Final Relative Residual Norm = 8.494308e-07 + +# Output file: solvers.out.31 +Iterations = 10 +Final Relative Residual Norm = 8.495113e-07 + +# Output file: solvers.out.32 +Iterations = 16 +Final Relative Residual Norm = 6.449814e-07 + +# Output file: solvers.out.33 +Iterations = 11 +Final Relative Residual Norm = 9.305172e-07 + +# Output file: solvers.out.34 +Iterations = 11 +Final Relative Residual Norm = 9.305172e-07 + +# Output file: solvers.out.35 +Iterations = 15 +Final Relative Residual Norm = 6.735600e-07 + +# Output file: solvers.out.36 +Iterations = 33 +Final Relative Residual Norm = 9.815193e-07 + +# Output file: solvers.out.37 +Iterations = 33 +Final Relative Residual Norm = 9.815193e-07 + +# Output file: solvers.out.38 +Iterations = 20 +Final Relative Residual Norm = 7.298161e-07 + +# Output file: solvers.out.39 +Iterations = 20 +Final Relative Residual Norm = 6.920001e-07 + +# Output file: solvers.out.40 +Iterations = 28 +Final Relative Residual Norm = 9.245643e-07 + +# Output file: solvers.out.41 +Iterations = 17 +Final Relative Residual Norm = 7.137571e-07 + +# Output file: solvers.out.42 +Iterations = 17 +Final Relative Residual Norm = 7.137571e-07 + +# Output file: solvers.out.43 +Iterations = 19 +Final Relative Residual Norm = 8.795265e-07 + +# Output file: solvers.out.44 +Iterations = 16 +Final Relative Residual Norm = 5.860172e-07 + +# Output file: solvers.out.45 +Iterations = 16 +Final Relative Residual Norm = 5.860172e-07 + +# Output file: solvers.out.46 +Iterations = 5 +Final Relative Residual Norm = 3.620491e-07 + +# Output file: solvers.out.47 +Iterations = 5 +Final Relative Residual Norm = 3.620491e-07 + +# Output file: solvers.out.48 +Iterations = 19 +Final Relative Residual Norm = 9.434680e-07 + +# Output file: solvers.out.49 +Iterations = 19 +Final Relative Residual Norm = 9.434675e-07 + +# Output file: solvers.out.50 +Iterations = 9 +Final Relative Residual Norm = 5.708657e-07 + +# Output file: solvers.out.52 +Iterations = 10 +Final Relative Residual Norm = 5.546960e-07 + +# Output file: solvers.out.53 +Iterations = 10 +Final Relative Residual Norm = 5.546960e-07 + +# Output file: solvers.out.56 +Iterations = 9 +Final Relative Residual Norm = 4.299808e-07 + +# Output file: solvers.out.57 +Iterations = 9 +Final Relative Residual Norm = 4.639955e-07 + +# Output file: solvers.out.58 +Iterations = 15 +Final Relative Residual Norm = 7.581157e-07 + +# Output file: solvers.out.59 +Iterations = 15 +Final Relative Residual Norm = 7.581157e-07 + +# Output file: solvers.out.121 +Iterations = 8 +Final Relative Residual Norm = 1.773482e-07 + +# Output file: solvers.out.122 +Iterations = 8 +Final Relative Residual Norm = 1.773482e-07 + +# Output file: solvers.out.123 +Iterations = 8 +Final Relative Residual Norm = 5.357507e-07 + +# Output file: solvers.out.124 +Iterations = 4 +Final Relative Residual Norm = 9.477770e-07 + +# Output file: solvers.out.125 +Iterations = 4 +Final Relative Residual Norm = 9.477770e-07 + +# Output file: solvers.out.126 +Iterations = 6 +Final Relative Residual Norm = 9.016110e-08 + +# Output file: solvers.out.127 +Iterations = 9 +Final Relative Residual Norm = 4.581734e-07 + +# Output file: solvers.out.128 +Iterations = 9 +Final Relative Residual Norm = 4.581776e-07 + +# Output file: solvers.out.129 +Iterations = 6 +Final Relative Residual Norm = 4.953666e-07 + +# Output file: solvers.out.130 +Iterations = 6 +Final Relative Residual Norm = 4.954254e-07 + +# Output file: solvers.out.131 +Iterations = 8 +Final Relative Residual Norm = 3.397928e-07 + +# Output file: solvers.out.132 +Iterations = 7 +Final Relative Residual Norm = 1.153410e-07 + +# Output file: solvers.out.133 +Iterations = 7 +Final Relative Residual Norm = 1.153410e-07 + +# Output file: solvers.out.134 +Iterations = 8 +Final Relative Residual Norm = 3.862981e-07 + +# Output file: solvers.out.135 +Iterations = 11 +Final Relative Residual Norm = 5.085202e-07 + +# Output file: solvers.out.136 +Iterations = 11 +Final Relative Residual Norm = 5.085202e-07 + +# Output file: solvers.out.137 +Iterations = 14 +Final Relative Residual Norm = 4.469909e-07 + +# Output file: solvers.out.138 +Iterations = 9 +Final Relative Residual Norm = 4.624732e-07 + +# Output file: solvers.out.139 +Iterations = 9 +Final Relative Residual Norm = 4.577062e-07 + +# Output file: solvers.out.140 +Iterations = 11 +Final Relative Residual Norm = 2.703015e-07 + +# Output file: solvers.out.141 +Iterations = 8 +Final Relative Residual Norm = 3.969852e-07 + +# Output file: solvers.out.142 +Iterations = 8 +Final Relative Residual Norm = 3.969852e-07 + +# Output file: solvers.out.143 +Iterations = 9 +Final Relative Residual Norm = 6.839878e-07 diff --git a/src/test/TEST_sstruct/solvers.sh b/src/test/TEST_sstruct/solvers.sh index a37e32691f..f548972f1c 100755 --- a/src/test/TEST_sstruct/solvers.sh +++ b/src/test/TEST_sstruct/solvers.sh @@ -30,11 +30,74 @@ FILES="\ ${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\ + ${TNAME}.out.37\ + ${TNAME}.out.38\ + ${TNAME}.out.39\ + ${TNAME}.out.40\ + ${TNAME}.out.41\ + ${TNAME}.out.42\ + ${TNAME}.out.43\ + ${TNAME}.out.44\ + ${TNAME}.out.45\ + ${TNAME}.out.46\ + ${TNAME}.out.47\ + ${TNAME}.out.48\ + ${TNAME}.out.49\ + ${TNAME}.out.50\ + ${TNAME}.out.52\ + ${TNAME}.out.53\ + ${TNAME}.out.56\ + ${TNAME}.out.57\ + ${TNAME}.out.58\ + ${TNAME}.out.59\ + ${TNAME}.out.121\ + ${TNAME}.out.122\ + ${TNAME}.out.123\ + ${TNAME}.out.124\ + ${TNAME}.out.125\ + ${TNAME}.out.126\ + ${TNAME}.out.127\ + ${TNAME}.out.128\ + ${TNAME}.out.129\ + ${TNAME}.out.130\ + ${TNAME}.out.131\ + ${TNAME}.out.132\ + ${TNAME}.out.133\ + ${TNAME}.out.134\ + ${TNAME}.out.135\ + ${TNAME}.out.136\ + ${TNAME}.out.137\ + ${TNAME}.out.138\ + ${TNAME}.out.139\ + ${TNAME}.out.140\ + ${TNAME}.out.141\ + ${TNAME}.out.142\ + ${TNAME}.out.143\ " # ${TNAME}.out.5\ # ${TNAME}.out.6\ # ${TNAME}.out.12\ # ${TNAME}.out.13\ +# ${TNAME}.out.14\ +# ${TNAME}.out.51\ +# ${TNAME}.out.54\ +# ${TNAME}.out.55\ for i in $FILES do diff --git a/src/test/TEST_sstruct/sstruct.in.addtoval_cellcentre b/src/test/TEST_sstruct/sstruct.in.addtoval_cellcentre index 1dcf5ad3ec..e5e5de1fc6 100644 --- a/src/test/TEST_sstruct/sstruct.in.addtoval_cellcentre +++ b/src/test/TEST_sstruct/sstruct.in.addtoval_cellcentre @@ -25,10 +25,10 @@ StencilCreate: 1 [7] StencilSetEntry: 0 0 [ 0 0 0] 0 0.0 StencilSetEntry: 0 1 [-1 0 0] 0 0.0 StencilSetEntry: 0 2 [ 1 0 0] 0 0.0 -StencilSetEntry: 0 3 [ 0 1 0] 0 0.0 -StencilSetEntry: 0 4 [ 0 -1 0] 0 0.0 -StencilSetEntry: 0 5 [ 0 0 1] 0 0.0 -StencilSetEntry: 0 6 [ 0 0 -1] 0 0.0 +StencilSetEntry: 0 3 [ 0 -1 0] 0 0.0 +StencilSetEntry: 0 4 [ 0 1 0] 0 0.0 +StencilSetEntry: 0 5 [ 0 0 -1] 0 0.0 +StencilSetEntry: 0 6 [ 0 0 1] 0 0.0 ########################################################### @@ -43,6 +43,14 @@ GraphSetStencil: 0 0 0 MatrixAddToValues: 0 (1- 1- 1-) (4+ 4+ 4+) 0 4 [0 1 2 3] [6.0 -1.0 -1.0 -1.0] MatrixAddToValues: 0 (1- 1- 1-) (4+ 4+ 4+) 0 3 [ 4 5 6] [ -1.0 -1.0 -1.0] +# Adjust boundary +MatrixAddToValues: 0 (1- 1- 1-) (1- 4+ 4+) 0 1 [1] [1.0] +MatrixAddToValues: 0 (4+ 1- 1-) (4+ 4+ 4+) 0 1 [2] [1.0] +MatrixAddToValues: 0 (1- 1- 1-) (4+ 1- 4+) 0 1 [3] [1.0] +MatrixAddToValues: 0 (1- 4+ 1-) (4+ 4+ 4+) 0 1 [4] [1.0] +MatrixAddToValues: 0 (1- 1- 1-) (4+ 4+ 1-) 0 1 [5] [1.0] +MatrixAddToValues: 0 (1- 1- 4+) (4+ 4+ 4+) 0 1 [6] [1.0] + ########################################################### # ProcessPoolCreate: num_pools diff --git a/src/test/TEST_sstruct/sstruct.in.amr2D_center_lev2 b/src/test/TEST_sstruct/sstruct.in.amr2D_center_lev2 new file mode 100644 index 0000000000..70e5e1d24f --- /dev/null +++ b/src/test/TEST_sstruct/sstruct.in.amr2D_center_lev2 @@ -0,0 +1,146 @@ +# Copyright (c) 1998 Lawrence Livermore 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: 2 2 + +# GridSetExtents: part ilower(ndim) iupper(ndim) +GridSetExtents: 0 (0- 0-) (5+ 5+) +GridSetExtents: 1 (0- 0-) (3+ 3+) + +# GridSetVariables: part nvars vartypes[nvars] +GridSetVariables: 0 1 [0] +GridSetVariables: 1 1 [0] + +########################################################### + +# StencilCreate: nstencils sizes[nstencils] +StencilCreate: 1 [5] + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 0 0 [ 0 0] 0 4.0 +StencilSetEntry: 0 1 [-1 0] 0 -1.0 +StencilSetEntry: 0 2 [ 1 0] 0 -1.0 +StencilSetEntry: 0 3 [ 0 -1] 0 -1.0 +StencilSetEntry: 0 4 [ 0 1] 0 -1.0 + +########################################################### + +# GraphSetStencil: part var stencil_num +GraphSetStencil: 0 0 0 +GraphSetStencil: 1 0 0 + +# GraphAddEntries: \ +# part ilower(ndim) iupper(ndim) stride[ndim] var \ +# to_part to_ilower(ndim) to_iupper(ndim) to_stride[ndim] to_var \ +# index_map[ndim] entry value +# South +GraphAddEntries: 0 (2- 1+ : 0 0) (3+ 1+ : 0 0) [1 1] 0 1 (0- 0- : 0 0) (3+ 0- : -1 0) [2 2] 0 [0 1] 5 -0.666666666666666 +GraphAddEntries: 0 (2- 1+ : 0 0) (3+ 1+ : 0 0) [1 1] 0 1 (0- 0- : 1 0) (3+ 0- : 0 0) [2 2] 0 [0 1] 6 -0.666666666666666 +GraphAddEntries: 1 (0- 0- : 0 0) (3+ 0- : -1 0) [2 2] 0 0 (2- 1+ : 0 0) (3+ 1+ : 0 0) [1 1] 0 [0 1] 5 -0.666666666666666 +GraphAddEntries: 1 (0- 0- : 1 0) (3+ 0- : 0 0) [2 2] 0 0 (2- 1+ : 0 0) (3+ 1+ : 0 0) [1 1] 0 [0 1] 5 -0.666666666666666 + +# North +GraphAddEntries: 0 (2- 4- : 0 0) (3+ 4- : 0 0) [1 1] 0 1 (0- 3+ : 0 0) (3+ 3+ : -1 0) [2 2] 0 [0 1] 5 -0.666666666666666 +GraphAddEntries: 0 (2- 4- : 0 0) (3+ 4- : 0 0) [1 1] 0 1 (0- 3+ : 1 0) (3+ 3+ : 0 0) [2 2] 0 [0 1] 6 -0.666666666666666 +GraphAddEntries: 1 (0- 3+ : 0 0) (3+ 3+ : -1 0) [2 2] 0 0 (2- 4- : 0 0) (3+ 4- : 0 0) [1 1] 0 [0 1] 5 -0.666666666666666 +GraphAddEntries: 1 (0- 3+ : 1 0) (3+ 3+ : 0 0) [2 2] 0 0 (2- 4- : 0 0) (3+ 4- : 0 0) [1 1] 0 [0 1] 5 -0.666666666666666 + +# West +GraphAddEntries: 0 (1+ 2- : 0 0) (1+ 3+ : 0 0) [1 1] 0 1 (0- 0- : 0 0) (0- 3+ : 0 -1) [2 2] 0 [0 1] 5 -0.666666666666666 +GraphAddEntries: 0 (1+ 2- : 0 0) (1+ 3+ : 0 0) [1 1] 0 1 (0- 0- : 0 1) (0- 3+ : 0 0) [2 2] 0 [0 1] 6 -0.666666666666666 +GraphAddEntries: 1 (0- 0- : 0 2) (0- 3+ : 0 -1) [2 2] 0 0 (1+ 2- : 0 1) (1+ 3+ : 0 0) [1 1] 0 [0 1] 5 -0.666666666666666 +GraphAddEntries: 1 (0- 0- : 0 1) (0- 3+ : 0 -1) [2 2] 0 0 (1+ 2- : 0 0) (1+ 3+ : 0 0) [1 1] 0 [0 1] 5 -0.666666666666666 +GraphAddEntries: 1 (0- 0- : 0 0) (0- 0- : 0 0) [1 1] 0 0 (1+ 2- : 0 0) (1+ 2- : 0 0) [1 1] 0 [0 1] 6 -0.666666666666666 +GraphAddEntries: 1 (0- 3+ : 0 0) (0- 3+ : 0 0) [1 1] 0 0 (1+ 3+ : 0 0) (1+ 3+ : 0 0) [1 1] 0 [0 1] 6 -0.666666666666666 + +# East +GraphAddEntries: 0 (4- 2- : 0 0) (4- 3+ : 0 0) [1 1] 0 1 (3+ 0- : 0 0) (3+ 3+ : 0 -1) [2 2] 0 [0 1] 5 -0.666666666666666 +GraphAddEntries: 0 (4- 2- : 0 0) (4- 3+ : 0 0) [1 1] 0 1 (3+ 0- : 0 1) (3+ 3+ : 0 0) [2 2] 0 [0 1] 6 -0.666666666666666 +GraphAddEntries: 1 (3+ 0- : 0 2) (3+ 3+ : 0 -1) [2 2] 0 0 (4- 2- : 0 1) (4- 3+ : 0 0) [1 1] 0 [0 1] 5 -0.666666666666666 +GraphAddEntries: 1 (3+ 0- : 0 1) (3+ 3+ : 0 -1) [2 2] 0 0 (4- 2- : 0 0) (4- 2+ : 0 0) [1 1] 0 [0 1] 5 -0.666666666666666 +GraphAddEntries: 1 (3+ 0- : 0 0) (3+ 0- : 0 0) [1 1] 0 0 (4- 2- : 0 0) (4- 2- : 0 0) [1 1] 0 [0 1] 6 -0.666666666666666 +GraphAddEntries: 1 (3+ 3+ : 0 0) (3+ 3+ : 0 0) [1 1] 0 0 (4- 3+ : 0 0) (4- 3+ : 0 0) [1 1] 0 [0 1] 6 -0.666666666666666 + +############################################################ + +# MatrixSetValues: Zero out dummy unknowns +# part ilower(ndim) iupper(ndim) stride[ndim] var entry value +MatrixSetValues: 0 (2- 2-) (3+ 3+) [1 1] 0 0 1.0 +MatrixSetValues: 0 (2- 2-) (3+ 3+) [1 1] 0 1 0.0 +MatrixSetValues: 0 (2- 2-) (3+ 3+) [1 1] 0 2 0.0 +MatrixSetValues: 0 (2- 2-) (3+ 3+) [1 1] 0 3 0.0 +MatrixSetValues: 0 (2- 2-) (3+ 3+) [1 1] 0 4 0.0 + +# MatrixSetValues: Zero out off-diagonal stencil couplings at fine/coarse interface +# part ilower(ndim) iupper(ndim) stride[ndim] var entry value +# North +MatrixSetValues: 0 (2- 1+) (3+ 1+) [1 1] 0 4 0.0 + +# South +MatrixSetValues: 0 (2- 4-) (3+ 4-) [1 1] 0 3 0.0 + +# East +MatrixSetValues: 0 (1+ 2-) (1+ 3+) [1 1] 0 2 0.0 + +# West +MatrixSetValues: 0 (4- 2-) (4- 3+) [1 1] 0 1 0.0 + +# MatrixSetValues: Fix diagonal entries at part boundaries +# part ilower(ndim) iupper(ndim) stride[ndim] var entry value +# Coarse part borders +MatrixSetValues: 0 (1+ 2-) (1+ 3+) [1 1] 0 0 4.333333333333333 +MatrixSetValues: 0 (4- 2-) (4- 3+) [1 1] 0 0 4.333333333333333 +MatrixSetValues: 0 (2- 1+) (3+ 1+) [1 1] 0 0 4.333333333333333 +MatrixSetValues: 0 (2- 4-) (3+ 4-) [1 1] 0 0 4.333333333333333 + +# Fine part borders +MatrixSetValues: 1 (0- 0- : 0 1) (0- 3+ : 0 -1) [1 1] 0 0 3.666666666666666 +MatrixSetValues: 1 (3+ 0- : 0 1) (3+ 3+ : 0 -1) [1 1] 0 0 3.666666666666666 +MatrixSetValues: 1 (0- 0- : 1 0) (3+ 0- : -1 0) [1 1] 0 0 3.666666666666666 +MatrixSetValues: 1 (0- 3+ : 1 0) (3+ 3+ : -1 0) [1 1] 0 0 3.666666666666666 + +# Fine part corners +MatrixSetValues: 1 (0- 0-) (0- 0-) [1 1] 0 0 3.333333333333333 +MatrixSetValues: 1 (0- 3+) (0- 3+) [1 1] 0 0 3.333333333333333 +MatrixSetValues: 1 (3+ 3+) (3+ 3+) [1 1] 0 0 3.333333333333333 +MatrixSetValues: 1 (3+ 0-) (3+ 0-) [1 1] 0 0 3.333333333333333 + +# MatrixSetValues: Set boundary conditions +# part ilower(ndim) iupper(ndim) stride[ndim] var entry value +# North +MatrixSetValues: 0 (0- 5+) (5+ 5+) [1 1] 0 4 0.0 +MatrixSetValues: 1 (0- 3+) (3+ 3+) [1 1] 0 4 0.0 + +# South +MatrixSetValues: 0 (0- 0-) (5+ 0-) [1 1] 0 3 0.0 +MatrixSetValues: 1 (0- 0-) (3+ 0-) [1 1] 0 3 0.0 + +# East +MatrixSetValues: 0 (5+ 0-) (5+ 5+) [1 1] 0 2 0.0 +MatrixSetValues: 1 (3+ 0-) (3+ 3+) [1 1] 0 2 0.0 + +# West +MatrixSetValues: 0 (0- 0-) (0- 5+) [1 1] 0 1 0.0 +MatrixSetValues: 1 (0- 0-) (0- 3+) [1 1] 0 1 0.0 + +############################################################ + +# ProcessPoolCreate: num_pools +ProcessPoolCreate: 1 + +# ProcessPoolSetPart: pool part +ProcessPoolSetPart: 0 0 +ProcessPoolSetPart: 0 1 + +# ProcessPoolCreate: num_pools +ProcessPoolCreate: 2 + +# ProcessPoolSetPart: pool part +ProcessPoolSetPart: 0 0 +ProcessPoolSetPart: 1 1 diff --git a/src/test/TEST_sstruct/sstruct.in.amr3D_center_lev2 b/src/test/TEST_sstruct/sstruct.in.amr3D_center_lev2 new file mode 100644 index 0000000000..a45b174a78 --- /dev/null +++ b/src/test/TEST_sstruct/sstruct.in.amr3D_center_lev2 @@ -0,0 +1,268 @@ +# Copyright (c) 1998 Lawrence Livermore 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-) (3+ 3+ 3+) +GridSetExtents: 1 (0- 0- 0-) (3+ 3+ 3+) + +# GridSetVariables: part nvars vartypes[nvars] +GridSetVariables: 0 1 [0] +GridSetVariables: 1 1 [0] + +########################################################### + +# StencilCreate: nstencils sizes[nstencils] +StencilCreate: 1 [7] + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 0 0 [ 0 0 0] 0 6.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 -1.0 +StencilSetEntry: 0 4 [ 0 1 0] 0 -1.0 +StencilSetEntry: 0 5 [ 0 0 -1] 0 -1.0 +StencilSetEntry: 0 6 [ 0 0 1] 0 -1.0 + +########################################################### + +# GraphSetStencil: part var stencil_num +GraphSetStencil: 0 0 0 +GraphSetStencil: 1 0 0 + +# GraphAddEntries: \ +# part ilower(ndim) iupper(ndim) stride[ndim] var \ +# to_part to_ilower(ndim) to_iupper(ndim) to_stride[ndim] to_var \ +# index_map[ndim] entry value +# Bottom +GraphAddEntries: 0 (1- 1- 0+: 0 0 0) (2+ 2+ 0+: 0 0 0) [1 1 1] 0 1 (0- 0- 0-: 0 0 0) (3+ 3+ 0-: -1 -1 0) [2 2 2] 0 [0 1 2] 7 -0.666666666666666 +GraphAddEntries: 0 (1- 1- 0+: 0 0 0) (2+ 2+ 0+: 0 0 0) [1 1 1] 0 1 (0- 0- 0-: 1 0 0) (3+ 3+ 0-: 0 -1 0) [2 2 2] 0 [0 1 2] 8 -0.666666666666666 +GraphAddEntries: 0 (1- 1- 0+: 0 0 0) (2+ 2+ 0+: 0 0 0) [1 1 1] 0 1 (0- 0- 0-: 0 1 0) (3+ 3+ 0-: -1 0 0) [2 2 2] 0 [0 1 2] 9 -0.666666666666666 +GraphAddEntries: 0 (1- 1- 0+: 0 0 0) (2+ 2+ 0+: 0 0 0) [1 1 1] 0 1 (0- 0- 0-: 1 1 0) (3+ 3+ 0-: 0 0 0) [2 2 2] 0 [0 1 2] 10 -0.666666666666666 +GraphAddEntries: 1 (0- 0- 0-: 0 0 0) (3+ 3+ 0-: -1 -1 0) [2 2 2] 0 0 (1- 1- 0+: 0 0 0) (2+ 2+ 0+: 0 0 0) [1 1 1] 0 [0 1 2] 7 -0.666666666666666 +GraphAddEntries: 1 (0- 0- 0-: 1 0 0) (3+ 3+ 0-: 0 -1 0) [2 2 2] 0 0 (1- 1- 0+: 0 0 0) (2+ 2+ 0+: 0 0 0) [1 1 1] 0 [0 1 2] 7 -0.666666666666666 +GraphAddEntries: 1 (0- 0- 0-: 0 1 0) (3+ 3+ 0-: -1 0 0) [2 2 2] 0 0 (1- 1- 0+: 0 0 0) (2+ 2+ 0+: 0 0 0) [1 1 1] 0 [0 1 2] 7 -0.666666666666666 +GraphAddEntries: 1 (0- 0- 0-: 1 1 0) (3+ 3+ 0-: 0 0 0) [2 2 2] 0 0 (1- 1- 0+: 0 0 0) (2+ 2+ 0+: 0 0 0) [1 1 1] 0 [0 1 2] 7 -0.666666666666666 + +# Top +GraphAddEntries: 0 (1- 1- 3-: 0 0 0) (2+ 2+ 3-: 0 0 0) [1 1 1] 0 1 (0- 0- 3+: 0 0 0) (3+ 3+ 3+: -1 -1 0) [2 2 2] 0 [0 1 2] 7 -0.666666666666666 +GraphAddEntries: 0 (1- 1- 3-: 0 0 0) (2+ 2+ 3-: 0 0 0) [1 1 1] 0 1 (0- 0- 3+: 1 0 0) (3+ 3+ 3+: 0 -1 0) [2 2 2] 0 [0 1 2] 8 -0.666666666666666 +GraphAddEntries: 0 (1- 1- 3-: 0 0 0) (2+ 2+ 3-: 0 0 0) [1 1 1] 0 1 (0- 0- 3+: 0 1 0) (3+ 3+ 3+: -1 0 0) [2 2 2] 0 [0 1 2] 9 -0.666666666666666 +GraphAddEntries: 0 (1- 1- 3-: 0 0 0) (2+ 2+ 3-: 0 0 0) [1 1 1] 0 1 (0- 0- 3+: 1 1 0) (3+ 3+ 3+: 0 0 0) [2 2 2] 0 [0 1 2] 10 -0.666666666666666 +GraphAddEntries: 1 (0- 0- 3+: 0 0 0) (3+ 3+ 3+: -1 -1 0) [2 2 2] 0 0 (1- 1- 3-: 0 0 0) (2+ 2+ 3-: 0 0 0) [1 1 1] 0 [0 1 2] 7 -0.666666666666666 +GraphAddEntries: 1 (0- 0- 3+: 1 0 0) (3+ 3+ 3+: 0 -1 0) [2 2 2] 0 0 (1- 1- 3-: 0 0 0) (2+ 2+ 3-: 0 0 0) [1 1 1] 0 [0 1 2] 7 -0.666666666666666 +GraphAddEntries: 1 (0- 0- 3+: 0 1 0) (3+ 3+ 3+: -1 0 0) [2 2 2] 0 0 (1- 1- 3-: 0 0 0) (2+ 2+ 3-: 0 0 0) [1 1 1] 0 [0 1 2] 7 -0.666666666666666 +GraphAddEntries: 1 (0- 0- 3+: 1 1 0) (3+ 3+ 3+: 0 0 0) [2 2 2] 0 0 (1- 1- 3-: 0 0 0) (2+ 2+ 3-: 0 0 0) [1 1 1] 0 [0 1 2] 7 -0.666666666666666 + +# South +GraphAddEntries: 0 (1- 0+ 1-: 0 0 0) (2+ 0+ 2+: 0 0 0) [1 1 1] 0 1 (0- 0- 0-: 0 0 0) (3+ 0- 3+: -1 0 -1) [2 2 2] 0 [0 1 2] 7 -0.666666666666666 +GraphAddEntries: 0 (1- 0+ 1-: 0 0 0) (2+ 0+ 2+: 0 0 0) [1 1 1] 0 1 (0- 0- 0-: 1 0 0) (3+ 0- 3+: 0 0 -1) [2 2 2] 0 [0 1 2] 8 -0.666666666666666 +GraphAddEntries: 0 (1- 0+ 1-: 0 0 0) (2+ 0+ 2+: 0 0 0) [1 1 1] 0 1 (0- 0- 0-: 0 0 1) (3+ 0- 3+: -1 0 0) [2 2 2] 0 [0 1 2] 9 -0.666666666666666 +GraphAddEntries: 0 (1- 0+ 1-: 0 0 0) (2+ 0+ 2+: 0 0 0) [1 1 1] 0 1 (0- 0- 0-: 1 0 1) (3+ 0- 3+: 0 0 0) [2 2 2] 0 [0 1 2] 10 -0.666666666666666 +GraphAddEntries: 1 (0- 0- 0-: 0 0 2) (3+ 0- 3+: -1 0 -1) [2 2 2] 0 0 (1- 0+ 1-: 0 0 1) (2+ 0+ 2+: 0 0 0) [1 1 1] 0 [0 1 2] 7 -0.666666666666666 +GraphAddEntries: 1 (0- 0- 0-: 1 0 2) (3+ 0- 3+: 0 0 -1) [2 2 2] 0 0 (1- 0+ 1-: 0 0 1) (2+ 0+ 2+: 0 0 0) [1 1 1] 0 [0 1 2] 7 -0.666666666666666 +GraphAddEntries: 1 (0- 0- 0-: 0 0 1) (3+ 0- 3+: -1 0 -2) [2 2 2] 0 0 (1- 0+ 1-: 0 0 0) (2+ 0+ 2+: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -0.666666666666666 +GraphAddEntries: 1 (0- 0- 0-: 1 0 1) (3+ 0- 3+: 0 0 -2) [2 2 2] 0 0 (1- 0+ 1-: 0 0 0) (2+ 0+ 2+: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -0.666666666666666 +GraphAddEntries: 1 (0- 0- 0-: 0 0 0) (3+ 0- 0-: -1 0 0) [2 2 2] 0 0 (1- 0+ 1-: 0 0 0) (2+ 0+ 1-: 0 0 0) [1 1 1] 0 [0 1 2] 8 -0.666666666666666 +GraphAddEntries: 1 (0- 0- 0-: 1 0 0) (3+ 0- 0-: 0 0 0) [2 2 2] 0 0 (1- 0+ 1-: 0 0 0) (2+ 0+ 1-: 0 0 0) [1 1 1] 0 [0 1 2] 8 -0.666666666666666 +GraphAddEntries: 1 (0- 0- 3+: 0 0 0) (3+ 0- 3+: -1 0 0) [2 2 2] 0 0 (1- 0+ 2+: 0 0 0) (2+ 0+ 2+: 0 0 0) [1 1 1] 0 [0 1 2] 8 -0.666666666666666 +GraphAddEntries: 1 (0- 0- 3+: 1 0 0) (3+ 0- 3+: 0 0 0) [2 2 2] 0 0 (1- 0+ 2+: 0 0 0) (2+ 0+ 2+: 0 0 0) [1 1 1] 0 [0 1 2] 8 -0.666666666666666 + +# North +GraphAddEntries: 0 (1- 3- 1-: 0 0 0) (2+ 3- 2+: 0 0 0) [1 1 1] 0 1 (0- 3+ 0-: 0 0 0) (3+ 3+ 3+: -1 0 -1) [2 2 2] 0 [0 1 2] 7 -0.666666666666666 +GraphAddEntries: 0 (1- 3- 1-: 0 0 0) (2+ 3- 2+: 0 0 0) [1 1 1] 0 1 (0- 3+ 0-: 1 0 0) (3+ 3+ 3+: 0 0 -1) [2 2 2] 0 [0 1 2] 8 -0.666666666666666 +GraphAddEntries: 0 (1- 3- 1-: 0 0 0) (2+ 3- 2+: 0 0 0) [1 1 1] 0 1 (0- 3+ 0-: 0 0 1) (3+ 3+ 3+: -1 0 0) [2 2 2] 0 [0 1 2] 9 -0.666666666666666 +GraphAddEntries: 0 (1- 3- 1-: 0 0 0) (2+ 3- 2+: 0 0 0) [1 1 1] 0 1 (0- 3+ 0-: 1 0 1) (3+ 3+ 3+: 0 0 0) [2 2 2] 0 [0 1 2] 10 -0.666666666666666 +GraphAddEntries: 1 (0- 3+ 0-: 0 0 2) (3+ 3+ 3+: -1 0 -1) [2 2 2] 0 0 (1- 3- 1-: 0 0 1) (2+ 3- 2+: 0 0 0) [1 1 1] 0 [0 1 2] 7 -0.666666666666666 +GraphAddEntries: 1 (0- 3+ 0-: 1 0 2) (3+ 3+ 3+: 0 0 -1) [2 2 2] 0 0 (1- 3- 1-: 0 0 1) (2+ 3- 2+: 0 0 0) [1 1 1] 0 [0 1 2] 7 -0.666666666666666 +GraphAddEntries: 1 (0- 3+ 0-: 0 0 1) (3+ 3+ 3+: -1 0 -2) [2 2 2] 0 0 (1- 3- 1-: 0 0 0) (2+ 3- 2+: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -0.666666666666666 +GraphAddEntries: 1 (0- 3+ 0-: 1 0 1) (3+ 3+ 3+: 0 0 -2) [2 2 2] 0 0 (1- 3- 1-: 0 0 0) (2+ 3- 2+: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -0.666666666666666 +GraphAddEntries: 1 (0- 3+ 0-: 0 0 0) (3+ 3+ 0-: -1 0 0) [2 2 2] 0 0 (1- 3- 1-: 0 0 0) (2+ 3- 1-: 0 0 0) [1 1 1] 0 [0 1 2] 8 -0.666666666666666 +GraphAddEntries: 1 (0- 3+ 0-: 1 0 0) (3+ 3+ 0-: 0 0 0) [2 2 2] 0 0 (1- 3- 1-: 0 0 0) (2+ 3- 1-: 0 0 0) [1 1 1] 0 [0 1 2] 8 -0.666666666666666 +GraphAddEntries: 1 (0- 3+ 3+: 0 0 0) (3+ 3+ 3+: -1 0 0) [2 2 2] 0 0 (1- 3- 2+: 0 0 0) (2+ 3- 2+: 0 0 0) [1 1 1] 0 [0 1 2] 8 -0.666666666666666 +GraphAddEntries: 1 (0- 3+ 3+: 1 0 0) (3+ 3+ 3+: 0 0 0) [2 2 2] 0 0 (1- 3- 2+: 0 0 0) (2+ 3- 2+: 0 0 0) [1 1 1] 0 [0 1 2] 8 -0.666666666666666 + +# West +GraphAddEntries: 0 (0+ 1- 1-: 0 0 0) (0+ 2+ 2+: 0 0 0) [1 1 1] 0 1 (0- 0- 0-: 0 0 0) (0- 3+ 3+: 0 -1 -1) [2 2 2] 0 [0 1 2] 7 -0.666666666666666 +GraphAddEntries: 0 (0+ 1- 1-: 0 0 0) (0+ 2+ 2+: 0 0 0) [1 1 1] 0 1 (0- 0- 0-: 0 1 0) (0- 3+ 3+: 0 0 -1) [2 2 2] 0 [0 1 2] 8 -0.666666666666666 +GraphAddEntries: 0 (0+ 1- 1-: 0 0 0) (0+ 2+ 2+: 0 0 0) [1 1 1] 0 1 (0- 0- 0-: 0 0 1) (0- 3+ 3+: 0 -1 0) [2 2 2] 0 [0 1 2] 9 -0.666666666666666 +GraphAddEntries: 0 (0+ 1- 1-: 0 0 0) (0+ 2+ 2+: 0 0 0) [1 1 1] 0 1 (0- 0- 0-: 0 1 1) (0- 3+ 3+: 0 0 0) [2 2 2] 0 [0 1 2] 10 -0.666666666666666 +GraphAddEntries: 1 (0- 0- 0-: 0 1 1) (0- 3+ 3+: 0 -2 -2) [2 2 2] 0 0 (0+ 1- 1-: 0 0 0) (0+ 2+ 2+: 0 -1 -1) [1 1 1] 0 [0 1 2] 7 -0.666666666666666 +GraphAddEntries: 1 (0- 0- 0-: 0 2 1) (0- 3+ 3+: 0 -1 -2) [2 2 2] 0 0 (0+ 1- 1-: 0 1 0) (0+ 2+ 2+: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -0.666666666666666 +GraphAddEntries: 1 (0- 0- 0-: 0 1 2) (0- 3+ 3+: 0 -2 -1) [2 2 2] 0 0 (0+ 1- 1-: 0 0 1) (0+ 2+ 2+: 0 -1 0) [1 1 1] 0 [0 1 2] 7 -0.666666666666666 +GraphAddEntries: 1 (0- 0- 0-: 0 2 2) (0- 3+ 3+: 0 -1 -1) [2 2 2] 0 0 (0+ 1- 1-: 0 1 1) (0+ 2+ 2+: 0 0 0) [1 1 1] 0 [0 1 2] 7 -0.666666666666666 + +# West 1D corners +GraphAddEntries: 1 (0- 0- 0-: 0 0 2) (0- 0- 3+: 0 0 -1) [2 2 2] 0 0 (0+ 1- 1-: 0 0 1) (0+ 1- 2+: 0 0 0) [1 1 1] 0 [0 1 2] 8 -0.666666666666666 +GraphAddEntries: 1 (0- 3+ 0-: 0 0 1) (0- 3+ 3+: 0 0 -2) [2 2 2] 0 0 (0+ 2+ 1-: 0 0 0) (0+ 2+ 2+: 0 0 -1) [1 1 1] 0 [0 1 2] 8 -0.666666666666666 +GraphAddEntries: 1 (0- 3+ 0-: 0 0 2) (0- 3+ 3+: 0 0 -1) [2 2 2] 0 0 (0+ 2+ 1-: 0 0 1) (0+ 2+ 2+: 0 0 0) [1 1 1] 0 [0 1 2] 8 -0.666666666666666 +GraphAddEntries: 1 (0- 0- 0-: 0 0 1) (0- 0- 3+: 0 0 -2) [2 2 2] 0 0 (0+ 1- 1-: 0 0 0) (0+ 1- 2+: 0 0 -1) [1 1 1] 0 [0 1 2] 8 -0.666666666666666 +GraphAddEntries: 1 (0- 0- 0-: 0 2 0) (0- 3+ 0-: 0 -1 0) [2 2 2] 0 0 (0+ 1- 1-: 0 1 0) (0+ 2+ 1-: 0 0 0) [1 1 1] 0 [0 1 2] 8 -0.666666666666666 +GraphAddEntries: 1 (0- 0- 3+: 0 1 0) (0- 3+ 3+: 0 -2 0) [2 2 2] 0 0 (0+ 1- 2+: 0 0 0) (0+ 2+ 2+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -0.666666666666666 +GraphAddEntries: 1 (0- 0- 3+: 0 2 0) (0- 3+ 3+: 0 -1 0) [2 2 2] 0 0 (0+ 1- 2+: 0 1 0) (0+ 2+ 2+: 0 0 0) [1 1 1] 0 [0 1 2] 8 -0.666666666666666 +GraphAddEntries: 1 (0- 0- 0-: 0 1 0) (0- 3+ 0-: 0 -2 0) [2 2 2] 0 0 (0+ 1- 1-: 0 0 0) (0+ 2+ 1-: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -0.666666666666666 + +# West 0D corners +GraphAddEntries: 1 (0- 0- 0-: 0 0 0) (0- 0- 0-: 0 0 0) [1 1 1] 0 0 (0+ 1- 1-: 0 0 0) (0+ 1- 1-: 0 0 0) [1 1 1] 0 [0 1 2] 9 -0.666666666666666 +GraphAddEntries: 1 (0- 3+ 0-: 0 0 0) (0- 3+ 0-: 0 0 0) [1 1 1] 0 0 (0+ 2+ 1-: 0 0 0) (0+ 2+ 1-: 0 0 0) [1 1 1] 0 [0 1 2] 9 -0.666666666666666 +GraphAddEntries: 1 (0- 0- 3+: 0 0 0) (0- 0- 3+: 0 0 0) [1 1 1] 0 0 (0+ 1- 2+: 0 0 0) (0+ 1- 2+: 0 0 0) [1 1 1] 0 [0 1 2] 9 -0.666666666666666 +GraphAddEntries: 1 (0- 3+ 3+: 0 0 0) (0- 3+ 3+: 0 0 0) [1 1 1] 0 0 (0+ 2+ 2+: 0 0 0) (0+ 2+ 2+: 0 0 0) [1 1 1] 0 [0 1 2] 9 -0.666666666666666 + +# East +GraphAddEntries: 0 (3- 1- 1-: 0 0 0) (3- 2+ 2+: 0 0 0) [1 1 1] 0 1 (3+ 0- 0-: 0 0 0) (3+ 3+ 3+: 0 -1 -1) [2 2 2] 0 [0 1 2] 7 -0.666666666666666 +GraphAddEntries: 0 (3- 1- 1-: 0 0 0) (3- 2+ 2+: 0 0 0) [1 1 1] 0 1 (3+ 0- 0-: 0 1 0) (3+ 3+ 3+: 0 0 -1) [2 2 2] 0 [0 1 2] 8 -0.666666666666666 +GraphAddEntries: 0 (3- 1- 1-: 0 0 0) (3- 2+ 2+: 0 0 0) [1 1 1] 0 1 (3+ 0- 0-: 0 0 1) (3+ 3+ 3+: 0 -1 0) [2 2 2] 0 [0 1 2] 9 -0.666666666666666 +GraphAddEntries: 0 (3- 1- 1-: 0 0 0) (3- 2+ 2+: 0 0 0) [1 1 1] 0 1 (3+ 0- 0-: 0 1 1) (3+ 3+ 3+: 0 0 0) [2 2 2] 0 [0 1 2] 10 -0.666666666666666 +GraphAddEntries: 1 (3+ 0- 0-: 0 1 1) (3+ 3+ 3+: 0 -2 -2) [2 2 2] 0 0 (3- 1- 1-: 0 0 0) (3- 2+ 2+: 0 -1 -1) [1 1 1] 0 [0 1 2] 7 -0.666666666666666 +GraphAddEntries: 1 (3+ 0- 0-: 0 2 1) (3+ 3+ 3+: 0 -1 -2) [2 2 2] 0 0 (3- 1- 1-: 0 1 0) (3- 2+ 2+: 0 0 -1) [1 1 1] 0 [0 1 2] 7 -0.666666666666666 +GraphAddEntries: 1 (3+ 0- 0-: 0 1 2) (3+ 3+ 3+: 0 -2 -1) [2 2 2] 0 0 (3- 1- 1-: 0 0 1) (3- 2+ 2+: 0 -1 0) [1 1 1] 0 [0 1 2] 7 -0.666666666666666 +GraphAddEntries: 1 (3+ 0- 0-: 0 2 2) (3+ 3+ 3+: 0 -1 -1) [2 2 2] 0 0 (3- 1- 1-: 0 1 1) (3- 2+ 2+: 0 0 0) [1 1 1] 0 [0 1 2] 7 -0.666666666666666 + +# East 1D corners +GraphAddEntries: 1 (3+ 0- 0-: 0 0 2) (3+ 0- 3+: 0 0 -1) [2 2 2] 0 0 (3- 1- 1-: 0 0 1) (3- 1- 2+: 0 0 0) [1 1 1] 0 [0 1 2] 8 -0.666666666666666 +GraphAddEntries: 1 (3+ 3+ 0-: 0 0 1) (3+ 3+ 3+: 0 0 -2) [2 2 2] 0 0 (3- 2+ 1-: 0 0 0) (3- 2+ 2+: 0 0 -1) [1 1 1] 0 [0 1 2] 8 -0.666666666666666 +GraphAddEntries: 1 (3+ 3+ 0-: 0 0 2) (3+ 3+ 3+: 0 0 -1) [2 2 2] 0 0 (3- 2+ 1-: 0 0 1) (3- 2+ 2+: 0 0 0) [1 1 1] 0 [0 1 2] 8 -0.666666666666666 +GraphAddEntries: 1 (3+ 0- 0-: 0 0 1) (3+ 0- 3+: 0 0 -2) [2 2 2] 0 0 (3- 1- 1-: 0 0 0) (3- 1- 2+: 0 0 -1) [1 1 1] 0 [0 1 2] 8 -0.666666666666666 +GraphAddEntries: 1 (3+ 0- 0-: 0 2 0) (3+ 3+ 0-: 0 -1 0) [2 2 2] 0 0 (3- 1- 1-: 0 1 0) (3- 2+ 1-: 0 0 0) [1 1 1] 0 [0 1 2] 8 -0.666666666666666 +GraphAddEntries: 1 (3+ 0- 3+: 0 1 0) (3+ 3+ 3+: 0 -2 0) [2 2 2] 0 0 (3- 1- 2+: 0 0 0) (3- 2+ 2+: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -0.666666666666666 +GraphAddEntries: 1 (3+ 0- 3+: 0 2 0) (3+ 3+ 3+: 0 -1 0) [2 2 2] 0 0 (3- 1- 2+: 0 1 0) (3- 2+ 2+: 0 0 0) [1 1 1] 0 [0 1 2] 8 -0.666666666666666 +GraphAddEntries: 1 (3+ 0- 0-: 0 1 0) (3+ 3+ 0-: 0 -2 0) [2 2 2] 0 0 (3- 1- 1-: 0 0 0) (3- 2+ 1-: 0 -1 0) [1 1 1] 0 [0 1 2] 8 -0.666666666666666 + +# East 0D corners +GraphAddEntries: 1 (3+ 0- 0-: 0 0 0) (3+ 0- 0-: 0 0 0) [1 1 1] 0 0 (3- 1- 1-: 0 0 0) (3- 1- 1-: 0 0 0) [1 1 1] 0 [0 1 2] 9 -0.666666666666666 +GraphAddEntries: 1 (3+ 3+ 0-: 0 0 0) (3+ 3+ 0-: 0 0 0) [1 1 1] 0 0 (3- 2+ 1-: 0 0 0) (3- 2+ 1-: 0 0 0) [1 1 1] 0 [0 1 2] 9 -0.666666666666666 +GraphAddEntries: 1 (3+ 0- 3+: 0 0 0) (3+ 0- 3+: 0 0 0) [1 1 1] 0 0 (3- 1- 2+: 0 0 0) (3- 1- 2+: 0 0 0) [1 1 1] 0 [0 1 2] 9 -0.666666666666666 +GraphAddEntries: 1 (3+ 3+ 3+: 0 0 0) (3+ 3+ 3+: 0 0 0) [1 1 1] 0 0 (3- 2+ 2+: 0 0 0) (3- 2+ 2+: 0 0 0) [1 1 1] 0 [0 1 2] 9 -0.666666666666666 + +############################################################ + +# MatrixSetValues: Zero out dummy unknowns +# part ilower(ndim) iupper(ndim) stride[ndim] var entry value +MatrixSetValues: 0 (1- 1- 1-) (2+ 2+ 2+) [1 1 1] 0 0 1.0 +MatrixSetValues: 0 (1- 1- 1-) (2+ 2+ 2+) [1 1 1] 0 1 0.0 +MatrixSetValues: 0 (1- 1- 1-) (2+ 2+ 2+) [1 1 1] 0 2 0.0 +MatrixSetValues: 0 (1- 1- 1-) (2+ 2+ 2+) [1 1 1] 0 3 0.0 +MatrixSetValues: 0 (1- 1- 1-) (2+ 2+ 2+) [1 1 1] 0 4 0.0 +MatrixSetValues: 0 (1- 1- 1-) (2+ 2+ 2+) [1 1 1] 0 5 0.0 +MatrixSetValues: 0 (1- 1- 1-) (2+ 2+ 2+) [1 1 1] 0 6 0.0 + +# MatrixSetValues: Zero out off-diagonal stencil couplings at fine/coarse interface +# part ilower(ndim) iupper(ndim) stride[ndim] var entry value +# Top +MatrixSetValues: 0 (1- 1- 0+) (2+ 2+ 0+) [1 1 1] 0 6 0.0 + +# Bottom +MatrixSetValues: 0 (1- 1- 3-) (2+ 2+ 3-) [1 1 1] 0 5 0.0 + +# North +MatrixSetValues: 0 (1- 0+ 1-) (2+ 0+ 2+) [1 1 1] 0 4 0.0 + +# South +MatrixSetValues: 0 (1- 3- 1-) (2+ 3- 2+) [1 1 1] 0 3 0.0 + +# East +MatrixSetValues: 0 (0+ 1- 1-) (0+ 2+ 2+) [1 1 1] 0 2 0.0 + +# West +MatrixSetValues: 0 (3- 1- 1-) (3- 2+ 2+) [1 1 1] 0 1 0.0 + +# MatrixSetValues: Fix diagonal entries at part boundaries +# part ilower(ndim) iupper(ndim) stride[ndim] var entry value +# Coarse/Fine West border +MatrixSetValues: 0 (0+ 1- 1-) (0+ 2+ 2+) [1 1 1] 0 0 7.666666666666666 + +# Coarse/Fine East border +MatrixSetValues: 0 (3- 1- 1-) (3- 2+ 2+) [1 1 1] 0 0 7.666666666666666 + +# Coarse/Fine South border +MatrixSetValues: 0 (1- 0+ 1-) (2+ 0+ 2+) [1 1 1] 0 0 7.666666666666666 + +# Coarse/Fine North border +MatrixSetValues: 0 (1- 3- 1-) (2+ 3- 2+) [1 1 1] 0 0 7.666666666666666 + +# Coarse/Fine Bottom border +MatrixSetValues: 0 (1- 1- 0+) (2+ 2+ 0+) [1 1 1] 0 0 7.666666666666666 + +# Coarse/Fine Top border +MatrixSetValues: 0 (1- 1- 3-) (2+ 2+ 3-) [1 1 1] 0 0 7.666666666666666 + +# Fine part 2D borders +MatrixSetValues: 1 (0- 0- 0- : 0 1 1) (0- 3+ 3+: 0 -1 -1) [1 1 1] 0 0 5.666666666666666 +MatrixSetValues: 1 (3+ 0- 0- : 0 1 1) (3+ 3+ 3+: 0 -1 -1) [1 1 1] 0 0 5.666666666666666 +MatrixSetValues: 1 (0- 0- 0- : 1 0 1) (3+ 0- 3+: -1 0 -1) [1 1 1] 0 0 5.666666666666666 +MatrixSetValues: 1 (0- 3+ 0- : 1 0 1) (3+ 3+ 3+: -1 0 -1) [1 1 1] 0 0 5.666666666666666 +MatrixSetValues: 1 (0- 0- 0- : 1 1 0) (3+ 3+ 0-: -1 -1 0) [1 1 1] 0 0 5.666666666666666 +MatrixSetValues: 1 (0- 0- 3+ : 1 1 0) (3+ 3+ 3+: -1 -1 0) [1 1 1] 0 0 5.666666666666666 + +# Fine part 1D borders +MatrixSetValues: 1 (0- 0- 0- : 0 1 0) (0- 3+ 0-: 0 -1 0) [1 1 1] 0 0 5.333333333333333 +MatrixSetValues: 1 (0- 0- 3+ : 0 1 0) (0- 3+ 3+: 0 -1 0) [1 1 1] 0 0 5.333333333333333 +MatrixSetValues: 1 (0- 0- 0- : 0 0 1) (0- 0- 3+: 0 0 -1) [1 1 1] 0 0 5.333333333333333 +MatrixSetValues: 1 (0- 3+ 0- : 0 0 1) (0- 3+ 3+: 0 0 -1) [1 1 1] 0 0 5.333333333333333 +MatrixSetValues: 1 (3+ 0- 0- : 0 1 0) (3+ 3+ 0-: 0 -1 0) [1 1 1] 0 0 5.333333333333333 +MatrixSetValues: 1 (3+ 0- 3+ : 0 1 0) (3+ 3+ 3+: 0 -1 0) [1 1 1] 0 0 5.333333333333333 +MatrixSetValues: 1 (3+ 0- 0- : 0 0 1) (3+ 0- 3+: 0 0 -1) [1 1 1] 0 0 5.333333333333333 +MatrixSetValues: 1 (3+ 3+ 0- : 0 0 1) (3+ 3+ 3+: 0 0 -1) [1 1 1] 0 0 5.333333333333333 +MatrixSetValues: 1 (0- 0- 0- : 1 0 0) (3+ 0- 0-: -1 0 0) [1 1 1] 0 0 5.333333333333333 +MatrixSetValues: 1 (0- 3+ 0- : 1 0 0) (3+ 3+ 0-: -1 0 0) [1 1 1] 0 0 5.333333333333333 +MatrixSetValues: 1 (0- 3+ 3+ : 1 0 0) (3+ 3+ 3+: -1 0 0) [1 1 1] 0 0 5.333333333333333 +MatrixSetValues: 1 (0- 0- 3+ : 1 0 0) (3+ 0- 3+: -1 0 0) [1 1 1] 0 0 5.333333333333333 + +# Fine part 0D borders +MatrixSetValues: 1 (0- 0- 0-) (0- 0- 0-) [1 1 1] 0 0 5.0 +MatrixSetValues: 1 (3+ 0- 0-) (3+ 0- 0-) [1 1 1] 0 0 5.0 +MatrixSetValues: 1 (0- 3+ 0-) (0- 3+ 0-) [1 1 1] 0 0 5.0 +MatrixSetValues: 1 (3+ 3+ 0-) (3+ 3+ 0-) [1 1 1] 0 0 5.0 +MatrixSetValues: 1 (0- 0- 3+) (0- 0- 3+) [1 1 1] 0 0 5.0 +MatrixSetValues: 1 (3+ 0- 3+) (3+ 0- 3+) [1 1 1] 0 0 5.0 +MatrixSetValues: 1 (0- 3+ 3+) (0- 3+ 3+) [1 1 1] 0 0 5.0 +MatrixSetValues: 1 (3+ 3+ 3+) (3+ 3+ 3+) [1 1 1] 0 0 5.0 + +# MatrixSetValues: Set boundary conditions +# part ilower(ndim) iupper(ndim) stride[ndim] var entry value +# Top +MatrixSetValues: 0 (0- 0- 3+) (3+ 3+ 3+) [1 1 1] 0 6 0.0 +MatrixSetValues: 1 (0- 0- 3+) (3+ 3+ 3+) [1 1 1] 0 6 0.0 + +# Bottom +MatrixSetValues: 0 (0- 0- 0-) (3+ 3+ 0-) [1 1 1] 0 5 0.0 +MatrixSetValues: 1 (0- 0- 0-) (3+ 3+ 0-) [1 1 1] 0 5 0.0 + +# North +MatrixSetValues: 0 (0- 3+ 0-) (3+ 3+ 3+) [1 1 1] 0 4 0.0 +MatrixSetValues: 1 (0- 3+ 0-) (3+ 3+ 3+) [1 1 1] 0 4 0.0 + +# South +MatrixSetValues: 0 (0- 0- 0-) (3+ 0- 3+) [1 1 1] 0 3 0.0 +MatrixSetValues: 1 (0- 0- 0-) (3+ 0- 3+) [1 1 1] 0 3 0.0 + +# East +MatrixSetValues: 0 (3+ 0- 0-) (3+ 3+ 3+) [1 1 1] 0 2 0.0 +MatrixSetValues: 1 (3+ 0- 0-) (3+ 3+ 3+) [1 1 1] 0 2 0.0 + +# West +MatrixSetValues: 0 (0- 0- 0-) (0- 3+ 3+) [1 1 1] 0 1 0.0 +MatrixSetValues: 1 (0- 0- 0-) (0- 3+ 3+) [1 1 1] 0 1 0.0 + +############################################################ + +# ProcessPoolCreate: num_pools +ProcessPoolCreate: 1 + +# ProcessPoolSetPart: pool part +ProcessPoolSetPart: 0 0 +ProcessPoolSetPart: 0 1 + +# ProcessPoolCreate: num_pools +ProcessPoolCreate: 2 + +# ProcessPoolSetPart: pool part +ProcessPoolSetPart: 0 0 +ProcessPoolSetPart: 1 1 diff --git a/src/test/TEST_sstruct/sstruct.in.cube_anisoA b/src/test/TEST_sstruct/sstruct.in.cube_anisoA new file mode 100644 index 0000000000..3fb807fa60 --- /dev/null +++ b/src/test/TEST_sstruct/sstruct.in.cube_anisoA @@ -0,0 +1,76 @@ +# Copyright (c) 1998 Lawrence Livermore 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 (0- 0- 0-) (7+ 7+ 4+) + +# GridSetVariables: part nvars vartypes[nvars] +GridSetVariables: 0 1 [0] + +############################################################ + +# StencilCreate: nstencils sizes[nstencils] +StencilCreate: 1 [7] + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 0 0 [ 0 0 0] 0 204.0 +StencilSetEntry: 0 1 [-1 0 0] 0 -100.0 +StencilSetEntry: 0 2 [ 1 0 0] 0 -100.0 +StencilSetEntry: 0 3 [ 0 -1 0] 0 -1.0 +StencilSetEntry: 0 4 [ 0 1 0] 0 -1.0 +StencilSetEntry: 0 5 [ 0 0 -1] 0 -1.0 +StencilSetEntry: 0 6 [ 0 0 1] 0 -1.0 + +############################################################ + +# GraphSetStencil: part var stencil_num +GraphSetStencil: 0 0 0 + +########################################################### + +# RhsSet: value +RhsSet: 0.0 + +# RhsAddToValues: \ +# part ilower(ndim) iupper(ndim) var value +RhsAddToValues: 0 (0- 0- 0-) (7+ 7+ 0-) 0 1.0 + +############################################################ + +# MatrixSetValues: boundary conditions +# part ilower(ndim) iupper(ndim) stride[ndim] var entry value +# Top BCs +MatrixSetValues: 0 (0- 0- 3+) (7+ 7+ 3+) [1 1 1] 0 6 0.0 + +# Bottom BCs +MatrixSetValues: 0 (0- 0- 0-) (7+ 7+ 0-) [1 1 1] 0 5 0.0 + +# North BCs +MatrixSetValues: 0 (0- 7+ 0-) (7+ 7+ 3+) [1 1 1] 0 4 0.0 + +# South BCs +MatrixSetValues: 0 (0- 0- 0-) (7+ 0- 3+) [1 1 1] 0 3 0.0 + +# East BCs +MatrixSetValues: 0 (7+ 0- 0-) (7+ 7+ 3+) [1 1 1] 0 2 0.0 + +# West BCs +MatrixSetValues: 0 (0- 0- 0-) (0- 7+ 3+) [1 1 1] 0 1 0.0 + +############################################################ + +# ProcessPoolCreate: num_pools +ProcessPoolCreate: 1 + +# ProcessPoolSetPart: pool part +ProcessPoolSetPart: 0 0 + +############################################################ diff --git a/src/test/TEST_sstruct/sstruct.in.cubes2 b/src/test/TEST_sstruct/sstruct.in.cubes2 new file mode 100644 index 0000000000..d1a1acb3bb --- /dev/null +++ b/src/test/TEST_sstruct/sstruct.in.cubes2 @@ -0,0 +1,90 @@ +# Copyright (c) 1998 Lawrence Livermore 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: 1 [7] + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 0 0 [ 0 0 0] 0 6.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 -1.0 +StencilSetEntry: 0 4 [ 0 1 0] 0 -1.0 +StencilSetEntry: 0 5 [ 0 0 -1] 0 -1.0 +StencilSetEntry: 0 6 [ 0 0 1] 0 -1.0 + +############################################################ + +# GraphSetStencil: part var stencil_num +GraphSetStencil: 0 0 0 +GraphSetStencil: 1 0 0 + +############################################################ + +# 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/src/test/TEST_sstruct/sstruct.in.cubes4_7pt b/src/test/TEST_sstruct/sstruct.in.cubes4_7pt new file mode 100644 index 0000000000..12e7e3e512 --- /dev/null +++ b/src/test/TEST_sstruct/sstruct.in.cubes4_7pt @@ -0,0 +1,116 @@ +# Copyright (c) 1998 Lawrence Livermore 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 [7] + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 0 0 [ 0 0 0] 0 6.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 -1.0 +StencilSetEntry: 0 4 [ 0 1 0] 0 -1.0 +StencilSetEntry: 0 5 [ 0 0 -1] 0 -1.0 +StencilSetEntry: 0 6 [ 0 0 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 6 0.0 +MatrixSetValues: 1 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 6 0.0 +MatrixSetValues: 2 (0- 0- 3+) (1+ 1+ 3+) [1 1 1] 0 6 0.0 +MatrixSetValues: 3 (0- 0- 3+) (1+ 1+ 3+) [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 +MatrixSetValues: 2 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 5 0.0 +MatrixSetValues: 3 (0- 0- 0-) (1+ 1+ 0-) [1 1 1] 0 5 0.0 + +# North BCs +MatrixSetValues: 2 (0- 1+ 0-) (1+ 1+ 3+) [1 1 1] 0 4 0.0 +MatrixSetValues: 3 (0- 1+ 0-) (1+ 1+ 3+) [1 1 1] 0 4 0.0 + +# South BCs +MatrixSetValues: 0 (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 3 0.0 + +# East BCs +MatrixSetValues: 1 (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 2 0.0 + +# West BCs +MatrixSetValues: 0 (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 1 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/src/test/TEST_sstruct/sstruct.in.cubes4_anisoA b/src/test/TEST_sstruct/sstruct.in.cubes4_anisoA new file mode 100644 index 0000000000..4aaab6a69b --- /dev/null +++ b/src/test/TEST_sstruct/sstruct.in.cubes4_anisoA @@ -0,0 +1,128 @@ +# Copyright (c) 1998 Lawrence Livermore 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-) (3+ 3+ 3+) +GridSetExtents: 1 (0- 0- 0-) (3+ 3+ 3+) +GridSetExtents: 2 (0- 0- 0-) (3+ 3+ 3+) +GridSetExtents: 3 (0- 0- 0-) (3+ 3+ 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- 3+ 0- : 0 1 0) (3+ 3+ 3+ : 0 1 0) 2 (0- 0- 0-) (3+ 0- 3+) [0 1 2] [1 1 1] +GridSetNeighborPart: 1 (0- 3+ 0- : 0 1 0) (3+ 3+ 3+ : 0 1 0) 3 (0- 0- 0-) (3+ 0- 3+) [0 1 2] [1 1 1] + +# South neighbors +GridSetNeighborPart: 2 (0- 0- 0- : 0 -1 0) (3+ 0- 3+ : 0 -1 0) 0 (0- 3+ 0-) (3+ 3+ 3+) [0 1 2] [1 1 1] +GridSetNeighborPart: 3 (0- 0- 0- : 0 -1 0) (3+ 0- 3+ : 0 -1 0) 1 (0- 3+ 0-) (3+ 3+ 3+) [0 1 2] [1 1 1] + +# East neighbors +GridSetNeighborPart: 0 (3+ 0- 0- : 1 0 0) (3+ 3+ 3+ : 1 0 0) 1 (0- 0- 0-) (0- 3+ 3+) [0 1 2] [1 1 1] +GridSetNeighborPart: 2 (3+ 0- 0- : 1 0 0) (3+ 3+ 3+ : 1 0 0) 3 (0- 0- 0-) (0- 3+ 3+) [0 1 2] [1 1 1] + +# West neighbors +GridSetNeighborPart: 1 (0- 0- 0- : -1 0 0) (0- 3+ 3+ : -1 0 0) 0 (3+ 0- 0-) (3+ 3+ 3+) [0 1 2] [1 1 1] +GridSetNeighborPart: 3 (0- 0- 0- : -1 0 0) (0- 3+ 3+ : -1 0 0) 2 (3+ 0- 0-) (3+ 3+ 3+) [0 1 2] [1 1 1] + +############################################################ + +# StencilCreate: nstencils sizes[nstencils] +StencilCreate: 1 [7] + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 0 0 [ 0 0 0] 0 204.0 +StencilSetEntry: 0 1 [-1 0 0] 0 -100.0 +StencilSetEntry: 0 2 [ 1 0 0] 0 -100.0 +StencilSetEntry: 0 3 [ 0 -1 0] 0 -1.0 +StencilSetEntry: 0 4 [ 0 1 0] 0 -1.0 +StencilSetEntry: 0 5 [ 0 0 -1] 0 -1.0 +StencilSetEntry: 0 6 [ 0 0 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 + +########################################################### + +# RhsSet: value +RhsSet: 0.0 + +# RhsAddToValues: \ +# part ilower(ndim) iupper(ndim) var value +RhsAddToValues: 0 (0- 0- 0-) (3+ 3+ 0-) 0 1.0 +RhsAddToValues: 1 (0- 0- 0-) (3+ 3+ 0-) 0 1.0 +RhsAddToValues: 2 (0- 0- 0-) (3+ 3+ 0-) 0 1.0 +RhsAddToValues: 3 (0- 0- 0-) (3+ 3+ 0-) 0 1.0 + +############################################################ + +# MatrixSetValues: boundary conditions +# part ilower(ndim) iupper(ndim) stride[ndim] var entry value +# Top BCs +MatrixSetValues: 0 (0- 0- 3+) (3+ 3+ 3+) [1 1 1] 0 6 0.0 +MatrixSetValues: 1 (0- 0- 3+) (3+ 3+ 3+) [1 1 1] 0 6 0.0 +MatrixSetValues: 2 (0- 0- 3+) (3+ 3+ 3+) [1 1 1] 0 6 0.0 +MatrixSetValues: 3 (0- 0- 3+) (3+ 3+ 3+) [1 1 1] 0 6 0.0 + +# Bottom BCs +MatrixSetValues: 0 (0- 0- 0-) (3+ 3+ 0-) [1 1 1] 0 5 0.0 +MatrixSetValues: 1 (0- 0- 0-) (3+ 3+ 0-) [1 1 1] 0 5 0.0 +MatrixSetValues: 2 (0- 0- 0-) (3+ 3+ 0-) [1 1 1] 0 5 0.0 +MatrixSetValues: 3 (0- 0- 0-) (3+ 3+ 0-) [1 1 1] 0 5 0.0 + +# North BCs +MatrixSetValues: 2 (0- 3+ 0-) (3+ 3+ 3+) [1 1 1] 0 4 0.0 +MatrixSetValues: 3 (0- 3+ 0-) (3+ 3+ 3+) [1 1 1] 0 4 0.0 + +# South BCs +MatrixSetValues: 0 (0- 0- 0-) (3+ 0- 3+) [1 1 1] 0 3 0.0 +MatrixSetValues: 1 (0- 0- 0-) (3+ 0- 3+) [1 1 1] 0 3 0.0 + +# East BCs +MatrixSetValues: 1 (3+ 0- 0-) (3+ 3+ 3+) [1 1 1] 0 2 0.0 +MatrixSetValues: 3 (3+ 0- 0-) (3+ 3+ 3+) [1 1 1] 0 2 0.0 + +# West BCs +MatrixSetValues: 0 (0- 0- 0-) (0- 3+ 3+) [1 1 1] 0 1 0.0 +MatrixSetValues: 2 (0- 0- 0-) (0- 3+ 3+) [1 1 1] 0 1 0.0 + +############################################################ + +# ProcessPoolCreate: num_pools +ProcessPoolCreate: 1 + +# ProcessPoolSetPart: pool part +ProcessPoolSetPart: 0 0 +ProcessPoolSetPart: 0 1 +ProcessPoolSetPart: 0 2 +ProcessPoolSetPart: 0 3 + +# ProcessPoolCreate: num_pools +ProcessPoolCreate: 4 + +# ProcessPoolSetPart: pool part +ProcessPoolSetPart: 0 0 +ProcessPoolSetPart: 1 1 +ProcessPoolSetPart: 2 2 +ProcessPoolSetPart: 3 3 +############################################################ diff --git a/src/test/TEST_sstruct/sstruct.in.cubes4_anisoB b/src/test/TEST_sstruct/sstruct.in.cubes4_anisoB new file mode 100644 index 0000000000..1a65b6fb76 --- /dev/null +++ b/src/test/TEST_sstruct/sstruct.in.cubes4_anisoB @@ -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) + + +############################################################ + +# GridCreate: ndim nparts +GridCreate: 3 4 + +# GridSetExtents: part ilower(ndim) iupper(ndim) +GridSetExtents: 0 (0- 0- 0-) (3+ 3+ 3+) +GridSetExtents: 1 (0- 0- 0-) (3+ 3+ 3+) +GridSetExtents: 2 (0- 0- 0-) (3+ 3+ 3+) +GridSetExtents: 3 (0- 0- 0-) (3+ 3+ 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- 3+ 0- : 0 1 0) (3+ 3+ 3+ : 0 1 0) 2 (0- 0- 0-) (3+ 0- 3+) [0 1 2] [1 1 1] +GridSetNeighborPart: 1 (0- 3+ 0- : 0 1 0) (3+ 3+ 3+ : 0 1 0) 3 (0- 0- 0-) (3+ 0- 3+) [0 1 2] [1 1 1] + +# South neighbors +GridSetNeighborPart: 2 (0- 0- 0- : 0 -1 0) (3+ 0- 3+ : 0 -1 0) 0 (0- 3+ 0-) (3+ 3+ 3+) [0 1 2] [1 1 1] +GridSetNeighborPart: 3 (0- 0- 0- : 0 -1 0) (3+ 0- 3+ : 0 -1 0) 1 (0- 3+ 0-) (3+ 3+ 3+) [0 1 2] [1 1 1] + +# East neighbors +GridSetNeighborPart: 0 (3+ 0- 0- : 1 0 0) (3+ 3+ 3+ : 1 0 0) 1 (0- 0- 0-) (0- 3+ 3+) [0 1 2] [1 1 1] +GridSetNeighborPart: 2 (3+ 0- 0- : 1 0 0) (3+ 3+ 3+ : 1 0 0) 3 (0- 0- 0-) (0- 3+ 3+) [0 1 2] [1 1 1] + +# West neighbors +GridSetNeighborPart: 1 (0- 0- 0- : -1 0 0) (0- 3+ 3+ : -1 0 0) 0 (3+ 0- 0-) (3+ 3+ 3+) [0 1 2] [1 1 1] +GridSetNeighborPart: 3 (0- 0- 0- : -1 0 0) (0- 3+ 3+ : -1 0 0) 2 (3+ 0- 0-) (3+ 3+ 3+) [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 204.0 +StencilSetEntry: 0 1 [-1 0 0] 0 -100.0 +StencilSetEntry: 0 2 [ 1 0 0] 0 -100.0 +StencilSetEntry: 0 3 [ 0 -1 0] 0 -1.0 +StencilSetEntry: 0 4 [ 0 1 0] 0 -1.0 +StencilSetEntry: 0 5 [ 0 0 -1] 0 -1.0 +StencilSetEntry: 0 6 [ 0 0 1] 0 -1.0 + +StencilSetEntry: 1 0 [ 0 0 0] 0 20400.0 +StencilSetEntry: 1 1 [-1 0 0] 0 -100.0 +StencilSetEntry: 1 2 [ 1 0 0] 0 -100.0 +StencilSetEntry: 1 3 [ 0 -1 0] 0 -10000.0 +StencilSetEntry: 1 4 [ 0 1 0] 0 -10000.0 +StencilSetEntry: 1 5 [ 0 0 -1] 0 -100.0 +StencilSetEntry: 1 6 [ 0 0 1] 0 -100.0 + +############################################################ + +# GraphSetStencil: part var stencil_num +GraphSetStencil: 0 0 0 +GraphSetStencil: 1 0 1 +GraphSetStencil: 2 0 0 +GraphSetStencil: 3 0 1 + +########################################################### + +# RhsSet: value +RhsSet: 0.0 + +# RhsAddToValues: \ +# part ilower(ndim) iupper(ndim) var value +RhsAddToValues: 0 (0- 0- 0-) (3+ 3+ 0-) 0 1.0 +RhsAddToValues: 1 (0- 0- 0-) (3+ 3+ 0-) 0 1.0 +RhsAddToValues: 2 (0- 0- 0-) (3+ 3+ 0-) 0 1.0 +RhsAddToValues: 3 (0- 0- 0-) (3+ 3+ 0-) 0 1.0 + +############################################################ + +# MatrixSetValues: boundary conditions +# part ilower(ndim) iupper(ndim) stride[ndim] var entry value +# Top BCs +MatrixSetValues: 0 (0- 0- 3+) (3+ 3+ 3+) [1 1 1] 0 6 0.0 +MatrixSetValues: 1 (0- 0- 3+) (3+ 3+ 3+) [1 1 1] 0 6 0.0 +MatrixSetValues: 2 (0- 0- 3+) (3+ 3+ 3+) [1 1 1] 0 6 0.0 +MatrixSetValues: 3 (0- 0- 3+) (3+ 3+ 3+) [1 1 1] 0 6 0.0 + +# Bottom BCs +MatrixSetValues: 0 (0- 0- 0-) (3+ 3+ 0-) [1 1 1] 0 5 0.0 +MatrixSetValues: 1 (0- 0- 0-) (3+ 3+ 0-) [1 1 1] 0 5 0.0 +MatrixSetValues: 2 (0- 0- 0-) (3+ 3+ 0-) [1 1 1] 0 5 0.0 +MatrixSetValues: 3 (0- 0- 0-) (3+ 3+ 0-) [1 1 1] 0 5 0.0 + +# North BCs +MatrixSetValues: 2 (0- 3+ 0-) (3+ 3+ 3+) [1 1 1] 0 4 0.0 +MatrixSetValues: 3 (0- 3+ 0-) (3+ 3+ 3+) [1 1 1] 0 4 0.0 + +# South BCs +MatrixSetValues: 0 (0- 0- 0-) (3+ 0- 3+) [1 1 1] 0 3 0.0 +MatrixSetValues: 1 (0- 0- 0-) (3+ 0- 3+) [1 1 1] 0 3 0.0 + +# East BCs +MatrixSetValues: 1 (3+ 0- 0-) (3+ 3+ 3+) [1 1 1] 0 2 0.0 +MatrixSetValues: 3 (3+ 0- 0-) (3+ 3+ 3+) [1 1 1] 0 2 0.0 + +# West BCs +MatrixSetValues: 0 (0- 0- 0-) (0- 3+ 3+) [1 1 1] 0 1 0.0 +MatrixSetValues: 2 (0- 0- 0-) (0- 3+ 3+) [1 1 1] 0 1 0.0 + +############################################################ + +# ProcessPoolCreate: num_pools +ProcessPoolCreate: 1 + +# ProcessPoolSetPart: pool part +ProcessPoolSetPart: 0 0 +ProcessPoolSetPart: 0 1 +ProcessPoolSetPart: 0 2 +ProcessPoolSetPart: 0 3 + +# ProcessPoolCreate: num_pools +ProcessPoolCreate: 4 + +# ProcessPoolSetPart: pool part +ProcessPoolSetPart: 0 0 +ProcessPoolSetPart: 1 1 +ProcessPoolSetPart: 2 2 +ProcessPoolSetPart: 3 3 +############################################################ diff --git a/src/test/TEST_sstruct/sstruct.in.cubes4_anisoC b/src/test/TEST_sstruct/sstruct.in.cubes4_anisoC new file mode 100644 index 0000000000..ffcfceb16d --- /dev/null +++ b/src/test/TEST_sstruct/sstruct.in.cubes4_anisoC @@ -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) + + +############################################################ + +# GridCreate: ndim nparts +GridCreate: 3 4 + +# GridSetExtents: part ilower(ndim) iupper(ndim) +GridSetExtents: 0 (0- 0- 0-) (3+ 3+ 3+) +GridSetExtents: 1 (0- 0- 0-) (3+ 3+ 3+) +GridSetExtents: 2 (0- 0- 0-) (3+ 3+ 3+) +GridSetExtents: 3 (0- 0- 0-) (3+ 3+ 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- 3+ 0- : 0 1 0) (3+ 3+ 3+ : 0 1 0) 2 (0- 0- 0-) (3+ 0- 3+) [0 1 2] [1 1 1] +GridSetNeighborPart: 1 (0- 3+ 0- : 0 1 0) (3+ 3+ 3+ : 0 1 0) 3 (0- 0- 0-) (3+ 0- 3+) [0 1 2] [1 1 1] + +# South neighbors +GridSetNeighborPart: 2 (0- 0- 0- : 0 -1 0) (3+ 0- 3+ : 0 -1 0) 0 (0- 3+ 0-) (3+ 3+ 3+) [0 1 2] [1 1 1] +GridSetNeighborPart: 3 (0- 0- 0- : 0 -1 0) (3+ 0- 3+ : 0 -1 0) 1 (0- 3+ 0-) (3+ 3+ 3+) [0 1 2] [1 1 1] + +# East neighbors +GridSetNeighborPart: 0 (3+ 0- 0- : 1 0 0) (3+ 3+ 3+ : 1 0 0) 1 (0- 0- 0-) (0- 3+ 3+) [0 1 2] [1 1 1] +GridSetNeighborPart: 2 (3+ 0- 0- : 1 0 0) (3+ 3+ 3+ : 1 0 0) 3 (0- 0- 0-) (0- 3+ 3+) [0 1 2] [1 1 1] + +# West neighbors +GridSetNeighborPart: 1 (0- 0- 0- : -1 0 0) (0- 3+ 3+ : -1 0 0) 0 (3+ 0- 0-) (3+ 3+ 3+) [0 1 2] [1 1 1] +GridSetNeighborPart: 3 (0- 0- 0- : -1 0 0) (0- 3+ 3+ : -1 0 0) 2 (3+ 0- 0-) (3+ 3+ 3+) [0 1 2] [1 1 1] + +############################################################ + +# StencilCreate: nstencils sizes[nstencils] +StencilCreate: 4 [7 7 7 7] + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 0 0 [ 0 0 0] 0 204.0 +StencilSetEntry: 0 1 [-1 0 0] 0 -100.0 +StencilSetEntry: 0 2 [ 1 0 0] 0 -100.0 +StencilSetEntry: 0 3 [ 0 -1 0] 0 -1.0 +StencilSetEntry: 0 4 [ 0 1 0] 0 -1.0 +StencilSetEntry: 0 5 [ 0 0 -1] 0 -1.0 +StencilSetEntry: 0 6 [ 0 0 1] 0 -1.0 + +StencilSetEntry: 1 0 [ 0 0 0] 0 20400.0 +StencilSetEntry: 1 1 [-1 0 0] 0 -100.0 +StencilSetEntry: 1 2 [ 1 0 0] 0 -100.0 +StencilSetEntry: 1 3 [ 0 -1 0] 0 -100.0 +StencilSetEntry: 1 4 [ 0 1 0] 0 -100.0 +StencilSetEntry: 1 5 [ 0 0 -1] 0 -10000.0 +StencilSetEntry: 1 6 [ 0 0 1] 0 -10000.0 + +StencilSetEntry: 2 0 [ 0 0 0] 0 204.0 +StencilSetEntry: 2 1 [-1 0 0] 0 -1.0 +StencilSetEntry: 2 2 [ 1 0 0] 0 -1.0 +StencilSetEntry: 2 3 [ 0 -1 0] 0 -1.0 +StencilSetEntry: 2 4 [ 0 1 0] 0 -1.0 +StencilSetEntry: 2 5 [ 0 0 -1] 0 -100.0 +StencilSetEntry: 2 6 [ 0 0 1] 0 -100.0 + +StencilSetEntry: 3 0 [ 0 0 0] 0 204.0 +StencilSetEntry: 3 1 [-1 0 0] 0 -1.0 +StencilSetEntry: 3 2 [ 1 0 0] 0 -1.0 +StencilSetEntry: 3 3 [ 0 -1 0] 0 -100.0 +StencilSetEntry: 3 4 [ 0 1 0] 0 -100.0 +StencilSetEntry: 3 5 [ 0 0 -1] 0 -1.0 +StencilSetEntry: 3 6 [ 0 0 1] 0 -1.0 + +############################################################ + +# GraphSetStencil: part var stencil_num +GraphSetStencil: 0 0 0 +GraphSetStencil: 1 0 1 +GraphSetStencil: 2 0 2 +GraphSetStencil: 3 0 3 + +########################################################### + +# RhsSet: value +RhsSet: 0.0 + +# RhsAddToValues: \ +# part ilower(ndim) iupper(ndim) var value +RhsAddToValues: 0 (0- 0- 0-) (3+ 3+ 0-) 0 1.0 +RhsAddToValues: 1 (0- 0- 0-) (3+ 3+ 0-) 0 1.0 +RhsAddToValues: 2 (0- 0- 0-) (3+ 3+ 0-) 0 1.0 +RhsAddToValues: 3 (0- 0- 0-) (3+ 3+ 0-) 0 1.0 + +############################################################ + +# MatrixSetValues: boundary conditions +# part ilower(ndim) iupper(ndim) stride[ndim] var entry value +# Top BCs +MatrixSetValues: 0 (0- 0- 3+) (3+ 3+ 3+) [1 1 1] 0 6 0.0 +MatrixSetValues: 1 (0- 0- 3+) (3+ 3+ 3+) [1 1 1] 0 6 0.0 +MatrixSetValues: 2 (0- 0- 3+) (3+ 3+ 3+) [1 1 1] 0 6 0.0 +MatrixSetValues: 3 (0- 0- 3+) (3+ 3+ 3+) [1 1 1] 0 6 0.0 + +# Bottom BCs +MatrixSetValues: 0 (0- 0- 0-) (3+ 3+ 0-) [1 1 1] 0 5 0.0 +MatrixSetValues: 1 (0- 0- 0-) (3+ 3+ 0-) [1 1 1] 0 5 0.0 +MatrixSetValues: 2 (0- 0- 0-) (3+ 3+ 0-) [1 1 1] 0 5 0.0 +MatrixSetValues: 3 (0- 0- 0-) (3+ 3+ 0-) [1 1 1] 0 5 0.0 + +# North BCs +MatrixSetValues: 2 (0- 3+ 0-) (3+ 3+ 3+) [1 1 1] 0 4 0.0 +MatrixSetValues: 3 (0- 3+ 0-) (3+ 3+ 3+) [1 1 1] 0 4 0.0 + +# South BCs +MatrixSetValues: 0 (0- 0- 0-) (3+ 0- 3+) [1 1 1] 0 3 0.0 +MatrixSetValues: 1 (0- 0- 0-) (3+ 0- 3+) [1 1 1] 0 3 0.0 + +# East BCs +MatrixSetValues: 1 (3+ 0- 0-) (3+ 3+ 3+) [1 1 1] 0 2 0.0 +MatrixSetValues: 3 (3+ 0- 0-) (3+ 3+ 3+) [1 1 1] 0 2 0.0 + +# West BCs +MatrixSetValues: 0 (0- 0- 0-) (0- 3+ 3+) [1 1 1] 0 1 0.0 +MatrixSetValues: 2 (0- 0- 0-) (0- 3+ 3+) [1 1 1] 0 1 0.0 + +############################################################ + +# ProcessPoolCreate: num_pools +ProcessPoolCreate: 1 + +# ProcessPoolSetPart: pool part +ProcessPoolSetPart: 0 0 +ProcessPoolSetPart: 0 1 +ProcessPoolSetPart: 0 2 +ProcessPoolSetPart: 0 3 + +# ProcessPoolCreate: num_pools +ProcessPoolCreate: 4 + +# ProcessPoolSetPart: pool part +ProcessPoolSetPart: 0 0 +ProcessPoolSetPart: 1 1 +ProcessPoolSetPart: 2 2 +ProcessPoolSetPart: 3 3 +############################################################ diff --git a/src/test/TEST_sstruct/sstruct.in.default b/src/test/TEST_sstruct/sstruct.in.default index 6567356c5a..c321acbf65 100644 --- a/src/test/TEST_sstruct/sstruct.in.default +++ b/src/test/TEST_sstruct/sstruct.in.default @@ -75,6 +75,38 @@ GraphAddEntries: 1 ( 1- 1- 1-) ( 1- 10+ 10+) [1 1 1] 0 0 (10+ 1- 1-) (10+ 10+ 10 ########################################################### +# MatrixSetValues: \ +# part ilower(ndim) iupper(ndim) stride[ndim] var entry value +MatrixSetValues: 0 ( 1- 1- 1-) ( 1- 10+ 10+) [1 1 1] 0 1 0.0 +MatrixSetValues: 0 (10+ 1- 1-) (10+ 10+ 10+) [1 1 1] 0 2 0.0 +MatrixSetValues: 0 ( 1- 1- 1-) (10+ 1- 10+) [1 1 1] 0 3 0.0 +MatrixSetValues: 0 ( 1- 10+ 1-) (10+ 10+ 10+) [1 1 1] 0 4 0.0 +MatrixSetValues: 0 ( 1- 1- 1-) (10+ 10+ 1-) [1 1 1] 0 5 0.0 +MatrixSetValues: 0 ( 1- 1- 10+) (10+ 10+ 10+) [1 1 1] 0 6 0.0 + +MatrixSetValues: 0 ( 0+ 0+ 0+) ( 0+ 10+ 10+) [1 1 1] 1 1 0.0 +MatrixSetValues: 0 (10+ 0+ 0+) (10+ 10+ 10+) [1 1 1] 1 2 0.0 +MatrixSetValues: 0 ( 0+ 0+ 0+) (10+ 0+ 10+) [1 1 1] 1 3 0.0 +MatrixSetValues: 0 ( 0+ 10+ 0+) (10+ 10+ 10+) [1 1 1] 1 4 0.0 +MatrixSetValues: 0 ( 0+ 0+ 0+) (10+ 10+ 0+) [1 1 1] 1 5 0.0 +MatrixSetValues: 0 ( 0+ 0+ 10+) (10+ 10+ 10+) [1 1 1] 1 6 0.0 + +MatrixSetValues: 1 ( 1- 1- 1-) ( 1- 10+ 10+) [1 1 1] 0 1 0.0 +MatrixSetValues: 1 (10+ 1- 1-) (10+ 10+ 10+) [1 1 1] 0 2 0.0 +MatrixSetValues: 1 ( 1- 1- 1-) (10+ 1- 10+) [1 1 1] 0 3 0.0 +MatrixSetValues: 1 ( 1- 10+ 1-) (10+ 10+ 10+) [1 1 1] 0 4 0.0 +MatrixSetValues: 1 ( 1- 1- 1-) (10+ 10+ 1-) [1 1 1] 0 5 0.0 +MatrixSetValues: 1 ( 1- 1- 10+) (10+ 10+ 10+) [1 1 1] 0 6 0.0 + +MatrixSetValues: 1 ( 0+ 0+ 0+) ( 0+ 10+ 10+) [1 1 1] 1 1 0.0 +MatrixSetValues: 1 (10+ 0+ 0+) (10+ 10+ 10+) [1 1 1] 1 2 0.0 +MatrixSetValues: 1 ( 0+ 0+ 0+) (10+ 0+ 10+) [1 1 1] 1 3 0.0 +MatrixSetValues: 1 ( 0+ 10+ 0+) (10+ 10+ 10+) [1 1 1] 1 4 0.0 +MatrixSetValues: 1 ( 0+ 0+ 0+) (10+ 10+ 0+) [1 1 1] 1 5 0.0 +MatrixSetValues: 1 ( 0+ 0+ 10+) (10+ 10+ 10+) [1 1 1] 1 6 0.0 + +########################################################### + # ProcessPoolCreate: num_pools ProcessPoolCreate: 1 diff --git a/src/test/TEST_sstruct/sstruct.in.emptyProc1 b/src/test/TEST_sstruct/sstruct.in.emptyProc1 deleted file mode 100644 index 71a67764b2..0000000000 --- a/src/test/TEST_sstruct/sstruct.in.emptyProc1 +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) 1998 Lawrence Livermore 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 (2- 2- 2-) (11+ 11+ 11+) -GridSetExtents: 1 (2- 2- 2-) (11+ 11+ 11+) - -# GridSetVariables: part nvars vartypes[nvars] -# CELL = 0 -GridSetVariables: 0 1 [0] - -########################################################### - -# StencilCreate: nstencils sizes[nstencils] -StencilCreate: 1 [7] - -# StencilSetEntry: stencil_num entry offset[ndim] var value -StencilSetEntry: 0 0 [ 0 0 0] 0 6.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 -1.0 -StencilSetEntry: 0 4 [ 0 1 0] 0 -1.0 -StencilSetEntry: 0 5 [ 0 0 -1] 0 -1.0 -StencilSetEntry: 0 6 [ 0 0 1] 0 -1.0 - -########################################################### - -# GraphSetStencil: part var stencil_num -GraphSetStencil: 0 0 0 - -########################################################### - -# ProcessPoolCreate: num_pools -ProcessPoolCreate: 2 - -# ProcessPoolSetPart: pool part -ProcessPoolSetPart: 0 0 -ProcessPoolSetPart: 1 1 - -########################################################### - diff --git a/src/test/TEST_sstruct/sstruct.in.emptyProc2 b/src/test/TEST_sstruct/sstruct.in.emptyProc2 deleted file mode 100644 index b8ff900ac2..0000000000 --- a/src/test/TEST_sstruct/sstruct.in.emptyProc2 +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) 1998 Lawrence Livermore 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 (1- 1- 1-) (5+ 5+ 5+) -GridSetExtents: 1 (1- 1- 1-) (5+ 5+ 5+) - -# GridSetVariables: part nvars vartypes[nvars] -# CELL = 0 -GridSetVariables: 0 1 [0] - -########################################################### - -# StencilCreate: nstencils sizes[nstencils] -StencilCreate: 1 [7] - -# StencilSetEntry: stencil_num entry offset[ndim] var value -StencilSetEntry: 0 0 [ 0 0 0] 0 6.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 -1.0 -StencilSetEntry: 0 4 [ 0 1 0] 0 -1.0 -StencilSetEntry: 0 5 [ 0 0 -1] 0 -1.0 -StencilSetEntry: 0 6 [ 0 0 1] 0 -1.0 - -########################################################### - -# GraphSetStencil: part var stencil_num -GraphSetStencil: 0 0 0 - -########################################################### - -# ProcessPoolCreate: num_pools -ProcessPoolCreate: 2 - -# ProcessPoolSetPart: pool part -ProcessPoolSetPart: 0 0 -ProcessPoolSetPart: 1 1 - -########################################################### - diff --git a/src/test/TEST_sstruct/sstruct.in.emptyProc3 b/src/test/TEST_sstruct/sstruct.in.emptyProc3 deleted file mode 100644 index 4df2344a75..0000000000 --- a/src/test/TEST_sstruct/sstruct.in.emptyProc3 +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) 1998 Lawrence Livermore 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 (2- 2- 2-) (11+ 11+ 11+) -GridSetExtents: 1 (2- 2- 2-) (11+ 11+ 11+) - -# GridSetVariables: part nvars vartypes[nvars] -# CELL = 0 -GridSetVariables: 1 1 [0] - -########################################################### - -# StencilCreate: nstencils sizes[nstencils] -StencilCreate: 1 [7] - -# StencilSetEntry: stencil_num entry offset[ndim] var value -StencilSetEntry: 0 0 [ 0 0 0] 0 6.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 -1.0 -StencilSetEntry: 0 4 [ 0 1 0] 0 -1.0 -StencilSetEntry: 0 5 [ 0 0 -1] 0 -1.0 -StencilSetEntry: 0 6 [ 0 0 1] 0 -1.0 - -########################################################### - -# GraphSetStencil: part var stencil_num -GraphSetStencil: 1 0 0 - -########################################################### - -# ProcessPoolCreate: num_pools -ProcessPoolCreate: 2 - -# ProcessPoolSetPart: pool part -ProcessPoolSetPart: 0 0 -ProcessPoolSetPart: 1 1 - -########################################################### - diff --git a/src/test/TEST_sstruct/sstruct.in.miller_3D b/src/test/TEST_sstruct/sstruct.in.miller_3D new file mode 100644 index 0000000000..ffd36b8854 --- /dev/null +++ b/src/test/TEST_sstruct/sstruct.in.miller_3D @@ -0,0 +1,132 @@ +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +########################################################### +# +# -------------------------------- +# | /| +# | / | +# | / | +# | part 1 / | +# | / | +# | j / | +# | | / | +# | ---i / | +# --------------- part 2 | +# | | | +# | part 0 | | +# | | | +# | j | j | +# | | | | | +# | ---i | ---i | +# -------------------------------- +# +########################################################### + +# GridCreate: ndim nparts +GridCreate: 3 3 + +# GridSetExtents: part ilower(ndim) iupper(ndim) +GridSetExtents: 0 (0- 0- 0-) (4+ 4+ 4+) +GridSetExtents: 1 (0- 0- 0-) (4+ 4+ 4+) +GridSetExtents: 2 (0- 0- 0-) (4+ 4+ 4+) + +# GridSetVariables: part nvars vartypes[nvars] +# CELL = 0 +GridSetVariables: 0 1 [0] +GridSetVariables: 1 1 [0] +GridSetVariables: 2 1 [0] + +# GridSetNeighborPart: part ilower(ndim) iupper(ndim) \ +# nbor_part nbor_ilower(ndim) nbor_iupper(ndim) \ +# index_map[ndim] index_dir[ndim] +GridSetNeighborPart: 0 (0- 4+ 0- : 0 1 0) (4+ 4+ 4+ : 0 1 0) 1 (0- 0- 0-) (4+ 0- 4+) [0 1 2] [1 1 1] +GridSetNeighborPart: 0 (4+ 0- 0- : 1 0 0) (4+ 4+ 4+ : 1 0 0) 2 (0- 0- 0-) (0- 4+ 4+) [0 1 2] [1 1 1] + +GridSetNeighborPart: 1 (0- 0- 0- : 0 -1 0) (4+ 0- 4+ : 0 -1 0) 0 (0- 4+ 0-) (4+ 4+ 4+) [0 1 2] [1 1 1] +GridSetNeighborPart: 1 (4+ 0- 0- : 1 0 0) (4+ 4+ 4+ : 1 0 0) 2 (0- 4+ 0-) (4+ 4+ 4+) [1 0 2] [1 1 1] + +GridSetNeighborPart: 2 (0- 0- 0- : -1 0 0) (0- 4+ 4+ : -1 0 0) 0 (4+ 0- 0-) (4+ 4+ 4+) [0 1 2] [1 1 1] +GridSetNeighborPart: 2 (0- 4+ 0- : 0 1 0) (4+ 4+ 4+ : 0 1 0) 1 (4+ 0- 0-) (4+ 4+ 4+) [1 0 2] [1 1 1] + +########################################################### + +# StencilCreate: nstencils sizes[nstencils] +StencilCreate: 1 [7] + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 0 0 [ 0 0 0] 0 6.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 -1.0 +StencilSetEntry: 0 4 [ 0 1 0] 0 -1.0 +StencilSetEntry: 0 5 [ 0 0 -1] 0 -1.0 +StencilSetEntry: 0 6 [ 0 0 1] 0 -1.0 + +########################################################### + +# GraphSetStencil: part var stencil_num +GraphSetStencil: 0 0 0 +GraphSetStencil: 1 0 0 +GraphSetStencil: 2 0 0 + +########################################################### + +# RhsSet: value +RhsSet: 0.0 + +# RhsAddToValues: \ +# part ilower(ndim) iupper(ndim) var value +RhsAddToValues: 0 (0- 0- 0-) (4+ 4+ 0-) 0 1.0 +RhsAddToValues: 1 (0- 0- 0-) (4+ 4+ 0-) 0 1.0 +RhsAddToValues: 2 (0- 0- 0-) (4+ 4+ 0-) 0 1.0 + +########################################################### + +# MatrixSetValues: \ +# part ilower(ndim) iupper(ndim) stride[ndim] var entry value +# Top BCs +MatrixSetValues: 0 (0- 0- 4+) (4+ 4+ 4+) [1 1 1] 0 6 0.0 +MatrixSetValues: 1 (0- 0- 4+) (4+ 4+ 4+) [1 1 1] 0 6 0.0 +MatrixSetValues: 2 (0- 0- 4+) (4+ 4+ 4+) [1 1 1] 0 6 0.0 + +# Bottom BCs +MatrixSetValues: 0 (0- 0- 0-) (4+ 4+ 0-) [1 1 1] 0 5 0.0 +MatrixSetValues: 1 (0- 0- 0-) (4+ 4+ 0-) [1 1 1] 0 5 0.0 +MatrixSetValues: 2 (0- 0- 0-) (4+ 4+ 0-) [1 1 1] 0 5 0.0 + +# North BCs +MatrixSetValues: 1 (0- 4+ 0-) (4+ 4+ 4+) [1 1 1] 0 4 0.0 + +# South BCs +MatrixSetValues: 0 (0- 0- 0-) (4+ 0- 4+) [1 1 1] 0 3 0.0 +MatrixSetValues: 2 (0- 0- 0-) (4+ 0- 4+) [1 1 1] 0 3 0.0 + +# East BCs +MatrixSetValues: 2 (4+ 0- 0-) (4+ 4+ 4+) [1 1 1] 0 2 0.0 + +# West BCs +MatrixSetValues: 0 (0- 0- 0-) (0- 4+ 4+) [1 1 1] 0 1 0.0 +MatrixSetValues: 1 (0- 0- 0-) (0- 4+ 4+) [1 1 1] 0 1 0.0 + +########################################################### + +# ProcessPoolCreate: num_pools +ProcessPoolCreate: 1 + +# ProcessPoolSetPart: pool part +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/src/test/TEST_sstruct/sstruct.in.noaddtoval_cellcentre b/src/test/TEST_sstruct/sstruct.in.noaddtoval_cellcentre index 8dcfc4f35a..d262c5afbc 100644 --- a/src/test/TEST_sstruct/sstruct.in.noaddtoval_cellcentre +++ b/src/test/TEST_sstruct/sstruct.in.noaddtoval_cellcentre @@ -25,10 +25,10 @@ StencilCreate: 1 [7] StencilSetEntry: 0 0 [ 0 0 0] 0 6.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 -1.0 -StencilSetEntry: 0 4 [ 0 -1 0] 0 -1.0 -StencilSetEntry: 0 5 [ 0 0 1] 0 -1.0 -StencilSetEntry: 0 6 [ 0 0 -1] 0 -1.0 +StencilSetEntry: 0 3 [ 0 -1 0] 0 -1.0 +StencilSetEntry: 0 4 [ 0 1 0] 0 -1.0 +StencilSetEntry: 0 5 [ 0 0 -1] 0 -1.0 +StencilSetEntry: 0 6 [ 0 0 1] 0 -1.0 ########################################################### @@ -37,6 +37,17 @@ GraphSetStencil: 0 0 0 ########################################################### +# MatrixSetValues: \ +# part ilower(ndim) iupper(ndim) stride[ndim] var entry value +MatrixSetValues: 0 (1- 1- 1-) (1- 4+ 4+) [1 1 1] 0 1 0.0 +MatrixSetValues: 0 (4+ 1- 1-) (4+ 4+ 4+) [1 1 1] 0 2 0.0 +MatrixSetValues: 0 (1- 1- 1-) (4+ 1- 4+) [1 1 1] 0 3 0.0 +MatrixSetValues: 0 (1- 4+ 1-) (4+ 4+ 4+) [1 1 1] 0 4 0.0 +MatrixSetValues: 0 (1- 1- 1-) (4+ 4+ 1-) [1 1 1] 0 5 0.0 +MatrixSetValues: 0 (1- 1- 4+) (4+ 4+ 4+) [1 1 1] 0 6 0.0 + +########################################################### + # ProcessPoolCreate: num_pools ProcessPoolCreate: 1 diff --git a/src/test/TEST_sstructmat/sstructmat.in.1cubeA b/src/test/TEST_sstructmat/sstructmat.in.1cubeA new file mode 100644 index 0000000000..a088a18863 --- /dev/null +++ b/src/test/TEST_sstructmat/sstructmat.in.1cubeA @@ -0,0 +1,74 @@ +# Copyright (c) 1998 Lawrence Livermore 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 (0- 0- 0-) (1+ 1+ 1+) + +# GridSetVariables: part nvars vartypes[nvars] +GridSetVariables: 0 1 [0] + +############################################################ + +# StencilCreate: nstencils sizes[nstencils] +StencilCreate: 1 [7] + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 0 0 [ 0 0 0] 0 6.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 -1.0 +StencilSetEntry: 0 4 [ 0 1 0] 0 -1.0 +StencilSetEntry: 0 5 [ 0 0 -1] 0 -1.0 +StencilSetEntry: 0 6 [ 0 0 1] 0 -1.0 + +############################################################ + +# GraphSetStencil: part var stencil_num +GraphSetStencil: 0 0 0 + +############################################################ + +# MatrixSetDomainStride: part stride[ndim] +MatrixSetDomainStride: 0 [1 1 1] + +# MatrixSetRangeStride: part stride[ndim] +MatrixSetRangeStride: 0 [1 1 1] + +# MatrixSetConstantEntries: part num_centries centries(num_centries) + +# 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 + +# Bottom BCs +MatrixSetValues: 0 (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 + +# South BCs +MatrixSetValues: 0 (0- 0- 0-) (1+ 0- 1+) [1 1 1] 0 3 0.0 + +# East BCs +MatrixSetValues: 0 (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: 1 + +# ProcessPoolSetPart: pool part +ProcessPoolSetPart: 0 0 +############################################################ diff --git a/src/test/TEST_sstructmat/sstructmat.in.1cubePx b/src/test/TEST_sstructmat/sstructmat.in.1cubePx new file mode 100644 index 0000000000..f887dacaf8 --- /dev/null +++ b/src/test/TEST_sstructmat/sstructmat.in.1cubePx @@ -0,0 +1,51 @@ +# Copyright (c) 1998 Lawrence Livermore 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 (0- 0- 0-) (1+ 1+ 1+) + +# GridSetVariables: part nvars vartypes[nvars] +GridSetVariables: 0 1 [0] + +############################################################ + +# StencilCreate: nstencils sizes[nstencils] +StencilCreate: 1 [3] + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 0 0 [ 0 0 0] 0 1.0 +StencilSetEntry: 0 1 [-1 0 0] 0 0.5 +StencilSetEntry: 0 2 [ 1 0 0] 0 0.5 + +############################################################ + +# GraphSetStencil: part var stencil_num +GraphSetStencil: 0 0 0 + +############################################################ + +# MatrixSetDomainStride: part stride[ndim] +MatrixSetDomainStride: 0 [2 1 1] + +# MatrixSetRangeStride: part stride[ndim] +MatrixSetRangeStride: 0 [1 1 1] + +# MatrixSetConstantEntries: part nentries entries(nentries) +MatrixSetConstantEntries: 0 1 [0] + +############################################################ + +# ProcessPoolCreate: num_pools +ProcessPoolCreate: 1 + +# ProcessPoolSetPart: pool part +ProcessPoolSetPart: 0 0 +############################################################ diff --git a/src/test/TEST_sstructmat/sstructmat.in.1cubePx.allv b/src/test/TEST_sstructmat/sstructmat.in.1cubePx.allv new file mode 100644 index 0000000000..d72726aedf --- /dev/null +++ b/src/test/TEST_sstructmat/sstructmat.in.1cubePx.allv @@ -0,0 +1,48 @@ +# Copyright (c) 1998 Lawrence Livermore 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 (0- 0- 0-) (1+ 1+ 1+) + +# GridSetVariables: part nvars vartypes[nvars] +GridSetVariables: 0 1 [0] + +############################################################ + +# StencilCreate: nstencils sizes[nstencils] +StencilCreate: 1 [3] + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 0 0 [ 0 0 0] 0 1.0 +StencilSetEntry: 0 1 [-1 0 0] 0 0.5 +StencilSetEntry: 0 2 [ 1 0 0] 0 0.5 + +############################################################ + +# GraphSetStencil: part var stencil_num +GraphSetStencil: 0 0 0 + +############################################################ + +# MatrixSetDomainStride: part stride[ndim] +MatrixSetDomainStride: 0 [2 1 1] + +# MatrixSetRangeStride: part stride[ndim] +MatrixSetRangeStride: 0 [1 1 1] + +############################################################ + +# ProcessPoolCreate: num_pools +ProcessPoolCreate: 1 + +# ProcessPoolSetPart: pool part +ProcessPoolSetPart: 0 0 +############################################################ diff --git a/src/test/TEST_sstructmat/sstructmat.in.1quadA b/src/test/TEST_sstructmat/sstructmat.in.1quadA new file mode 100644 index 0000000000..1028343490 --- /dev/null +++ b/src/test/TEST_sstructmat/sstructmat.in.1quadA @@ -0,0 +1,87 @@ +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +# +# Grid sketch: +# +# ------------------------- +# | | | +# | | | +# | * | (1,1) | +# | | | +# | | | +# ------------------------- +# | | | +# | | | +# | (0,0) | * | +# | | | +# | | | +# ------------------------- +# +# (Part 0) +# +# Matrix: 5-pt Laplacian with variable coefficients +# +############################################################ + +# GridCreate: ndim nparts +GridCreate: 2 1 + +# GridSetExtents: part ilower(ndim) iupper(ndim) +GridSetExtents: 0 (0- 0-) (1+ 1+) + +# GridSetVariables: part nvars vartypes[nvars] +GridSetVariables: 0 1 [0] + +############################################################ + +# StencilCreate: nstencils sizes[nstencils] +StencilCreate: 1 [5] + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 0 0 [ 0 0] 0 4.0 +StencilSetEntry: 0 1 [-1 0] 0 -1.0 +StencilSetEntry: 0 2 [ 1 0] 0 -1.0 +StencilSetEntry: 0 3 [ 0 -1] 0 -1.0 +StencilSetEntry: 0 4 [ 0 1] 0 -1.0 + +############################################################ + +# GraphSetStencil: part var stencil_num +GraphSetStencil: 0 0 0 + +############################################################ + +# MatrixSetDomainStride: part stride[ndim] +MatrixSetDomainStride: 0 [1 1] + +# MatrixSetRangeStride: part stride[ndim] +MatrixSetRangeStride: 0 [1 1] + +# MatrixSetConstantEntries: part num_centries centries(num_centries) + +# MatrixSetValues: boundary conditions +# part ilower(ndim) iupper(ndim) stride[ndim] var entry value +# North BCs +MatrixSetValues: 0 (0- 1+) (1+ 1+) [1 1] 0 4 0.0 + +# South BCs +MatrixSetValues: 0 (0- 0-) (1+ 0-) [1 1] 0 3 0.0 + +# East BCs +MatrixSetValues: 0 (1+ 0-) (1+ 1+) [1 1] 0 2 0.0 + +# West BCs +MatrixSetValues: 0 (0- 0-) (0- 1+) [1 1] 0 1 0.0 + +############################################################ + +# ProcessPoolCreate: num_pools +ProcessPoolCreate: 1 + +# ProcessPoolSetPart: pool part +ProcessPoolSetPart: 0 0 +############################################################ diff --git a/src/test/TEST_sstructmat/sstructmat.in.1quadP b/src/test/TEST_sstructmat/sstructmat.in.1quadP new file mode 100644 index 0000000000..03a1cdeb60 --- /dev/null +++ b/src/test/TEST_sstructmat/sstructmat.in.1quadP @@ -0,0 +1,80 @@ +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +# +# Range/domain grid sketch: +# +# ------------------------- ------------- +# | | | | | +# | | | | | +# | * | (1,1) | | (0,1) | +# | | | | | +# | | | | | +# ------------------------- ------------- +# | | | | | +# | | | | | +# | (0,0) | * | | (0,0) | +# | | | | | +# | | | | | +# ------------------------- ------------- +# +# (Part 0) (Part 0) +# +# Matrix: 3-pt with variable off-diagonal coefficients and constant diagonal +# +############################################################ + +# GridCreate: ndim nparts +GridCreate: 2 1 + +# GridSetExtents: part ilower(ndim) iupper(ndim) +GridSetExtents: 0 (0- 0-) (1+ 1+) + +# GridSetVariables: part nvars vartypes[nvars] +GridSetVariables: 0 1 [0] + +############################################################ + +# StencilCreate: nstencils sizes[nstencils] +StencilCreate: 1 [3] + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 0 0 [ 0 0] 0 1.0 +StencilSetEntry: 0 1 [-1 0] 0 0.5 +StencilSetEntry: 0 2 [ 1 0] 0 0.5 + +############################################################ + +# GraphSetStencil: part var stencil_num +GraphSetStencil: 0 0 0 + +############################################################ + +# MatrixSetDomainStride: part stride[ndim] +MatrixSetDomainStride: 0 [2 1] + +# MatrixSetRangeStride: part stride[ndim] +MatrixSetRangeStride: 0 [1 1] + +# MatrixSetConstantEntries: part nentries entries(nentries) +MatrixSetConstantEntries: 0 1 [0] + +# MatrixSetValues: boundary conditions +# part ilower(ndim) iupper(ndim) stride[ndim] var entry value +# East BCs +#MatrixSetValues: 1 (1+ 0-) (1+ 1+) [1 1] 0 2 0.0 + +# West BCs +#MatrixSetValues: 0 (0- 0-) (0- 1+) [1 1] 0 1 0.0 + +############################################################ + +# ProcessPoolCreate: num_pools +ProcessPoolCreate: 1 + +# ProcessPoolSetPart: pool part +ProcessPoolSetPart: 0 0 +############################################################ diff --git a/src/test/TEST_sstructmat/sstructmat.in.2cubesA b/src/test/TEST_sstructmat/sstructmat.in.2cubesA new file mode 100644 index 0000000000..f397689288 --- /dev/null +++ b/src/test/TEST_sstructmat/sstructmat.in.2cubesA @@ -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) + + +############################################################ + +# 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: 1 [7] + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 0 0 [ 0 0 0] 0 6.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 -1.0 +StencilSetEntry: 0 4 [ 0 1 0] 0 -1.0 +StencilSetEntry: 0 5 [ 0 0 -1] 0 -1.0 +StencilSetEntry: 0 6 [ 0 0 1] 0 -1.0 + +############################################################ + +# GraphSetStencil: part var stencil_num +GraphSetStencil: 0 0 0 +GraphSetStencil: 1 0 0 + +############################################################ + +# MatrixSetDomainStride: part stride[ndim] +MatrixSetDomainStride: 0 [1 1 1] +MatrixSetDomainStride: 1 [1 1 1] + +# MatrixSetRangeStride: part stride[ndim] +MatrixSetRangeStride: 0 [1 1 1] +MatrixSetRangeStride: 1 [1 1 1] + +# MatrixSetConstantEntries: part num_centries centries(num_centries) + +# 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/src/test/TEST_sstructmat/sstructmat.in.2cubesPx b/src/test/TEST_sstructmat/sstructmat.in.2cubesPx new file mode 100644 index 0000000000..c9b2ade25d --- /dev/null +++ b/src/test/TEST_sstructmat/sstructmat.in.2cubesPx @@ -0,0 +1,74 @@ +# Copyright (c) 1998 Lawrence Livermore 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: 1 [3] + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 0 0 [ 0 0 0] 0 1.0 +StencilSetEntry: 0 1 [-1 0 0] 0 0.5 +StencilSetEntry: 0 2 [ 1 0 0] 0 0.5 + +############################################################ + +# GraphSetStencil: part var stencil_num +GraphSetStencil: 0 0 0 +GraphSetStencil: 1 0 0 + +############################################################ + +# MatrixSetDomainStride: part stride[ndim] +MatrixSetDomainStride: 0 [2 1 1] +MatrixSetDomainStride: 1 [2 1 1] + +# MatrixSetRangeStride: part stride[ndim] +MatrixSetRangeStride: 0 [1 1 1] +MatrixSetRangeStride: 1 [1 1 1] + +# MatrixSetConstantEntries: part nentries entries(nentries) +MatrixSetConstantEntries: 0 1 [0] +MatrixSetConstantEntries: 1 1 [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/src/test/TEST_sstructmat/sstructmat.in.2cubesPxy b/src/test/TEST_sstructmat/sstructmat.in.2cubesPxy new file mode 100644 index 0000000000..3096ede821 --- /dev/null +++ b/src/test/TEST_sstructmat/sstructmat.in.2cubesPxy @@ -0,0 +1,78 @@ +# Copyright (c) 1998 Lawrence Livermore 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 [3 3] + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 0 0 [ 0 0 0] 0 1.0 +StencilSetEntry: 0 1 [-1 0 0] 0 0.5 +StencilSetEntry: 0 2 [ 1 0 0] 0 0.5 + +StencilSetEntry: 1 0 [ 0 0 0] 0 1.0 +StencilSetEntry: 1 1 [ 0 -1 0] 0 0.5 +StencilSetEntry: 1 2 [ 0 1 0] 0 0.5 + +############################################################ + +# GraphSetStencil: part var stencil_num +GraphSetStencil: 0 0 0 +GraphSetStencil: 1 0 1 + +############################################################ + +# MatrixSetDomainStride: part stride[ndim] +MatrixSetDomainStride: 0 [2 1 1] +MatrixSetDomainStride: 1 [1 2 1] + +# MatrixSetRangeStride: part stride[ndim] +MatrixSetRangeStride: 0 [1 1 1] +MatrixSetRangeStride: 1 [1 1 1] + +# MatrixSetConstantEntries: part nentries entries(nentries) +MatrixSetConstantEntries: 0 1 [0] +MatrixSetConstantEntries: 1 1 [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/src/test/TEST_sstructmat/sstructmat.in.2cubesPxz b/src/test/TEST_sstructmat/sstructmat.in.2cubesPxz new file mode 100644 index 0000000000..efed141a04 --- /dev/null +++ b/src/test/TEST_sstructmat/sstructmat.in.2cubesPxz @@ -0,0 +1,78 @@ +# Copyright (c) 1998 Lawrence Livermore 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 [3 3] + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 0 0 [ 0 0 0] 0 1.0 +StencilSetEntry: 0 1 [-1 0 0] 0 0.5 +StencilSetEntry: 0 2 [ 1 0 0] 0 0.5 + +StencilSetEntry: 1 0 [ 0 0 0] 0 1.0 +StencilSetEntry: 1 1 [ 0 0 -1] 0 0.5 +StencilSetEntry: 1 2 [ 0 0 1] 0 0.5 + +############################################################ + +# GraphSetStencil: part var stencil_num +GraphSetStencil: 0 0 0 +GraphSetStencil: 1 0 1 + +############################################################ + +# MatrixSetDomainStride: part stride[ndim] +MatrixSetDomainStride: 0 [2 1 1] +MatrixSetDomainStride: 1 [1 1 2] + +# MatrixSetRangeStride: part stride[ndim] +MatrixSetRangeStride: 0 [1 1 1] +MatrixSetRangeStride: 1 [1 1 1] + +# MatrixSetConstantEntries: part nentries entries(nentries) +MatrixSetConstantEntries: 0 1 [0] +MatrixSetConstantEntries: 1 1 [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/src/test/TEST_sstructmat/sstructmat.in.2cubesPy b/src/test/TEST_sstructmat/sstructmat.in.2cubesPy new file mode 100644 index 0000000000..8040cf1f8a --- /dev/null +++ b/src/test/TEST_sstructmat/sstructmat.in.2cubesPy @@ -0,0 +1,74 @@ +# Copyright (c) 1998 Lawrence Livermore 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: 1 [3] + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 0 0 [ 0 0 0] 0 1.0 +StencilSetEntry: 0 1 [ 0 -1 0] 0 0.5 +StencilSetEntry: 0 2 [ 0 1 0] 0 0.5 + +############################################################ + +# GraphSetStencil: part var stencil_num +GraphSetStencil: 0 0 0 +GraphSetStencil: 1 0 0 + +############################################################ + +# MatrixSetDomainStride: part stride[ndim] +MatrixSetDomainStride: 0 [1 2 1] +MatrixSetDomainStride: 1 [1 2 1] + +# MatrixSetRangeStride: part stride[ndim] +MatrixSetRangeStride: 0 [1 1 1] +MatrixSetRangeStride: 1 [1 1 1] + +# MatrixSetConstantEntries: part nentries entries(nentries) +MatrixSetConstantEntries: 0 1 [0] +MatrixSetConstantEntries: 1 1 [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/src/test/TEST_sstructmat/sstructmat.in.2cubesPz b/src/test/TEST_sstructmat/sstructmat.in.2cubesPz new file mode 100644 index 0000000000..9f5dcfe6ee --- /dev/null +++ b/src/test/TEST_sstructmat/sstructmat.in.2cubesPz @@ -0,0 +1,74 @@ +# Copyright (c) 1998 Lawrence Livermore 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: 1 [3] + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 0 0 [ 0 0 0] 0 1.0 +StencilSetEntry: 0 1 [ 0 0 -1] 0 0.5 +StencilSetEntry: 0 2 [ 0 0 1] 0 0.5 + +############################################################ + +# GraphSetStencil: part var stencil_num +GraphSetStencil: 0 0 0 +GraphSetStencil: 1 0 0 + +############################################################ + +# MatrixSetDomainStride: part stride[ndim] +MatrixSetDomainStride: 0 [1 1 2] +MatrixSetDomainStride: 1 [1 1 2] + +# MatrixSetRangeStride: part stride[ndim] +MatrixSetRangeStride: 0 [1 1 1] +MatrixSetRangeStride: 1 [1 1 1] + +# MatrixSetConstantEntries: part nentries entries(nentries) +MatrixSetConstantEntries: 0 1 [0] +MatrixSetConstantEntries: 1 1 [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/src/test/TEST_sstructmat/sstructmat.in.2quadsA b/src/test/TEST_sstructmat/sstructmat.in.2quadsA new file mode 100644 index 0000000000..9ae8a3b453 --- /dev/null +++ b/src/test/TEST_sstructmat/sstructmat.in.2quadsA @@ -0,0 +1,108 @@ +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +# +# Grid sketch: +# +# ------------------------- ------------------------- +# | | | | | | +# | | | | | | +# | * | (1,1) | | * | (1,1) | +# | | | | | | +# | | | | | | +# ------------------------- ------------------------- +# | | | | | | +# | | | | | | +# | (0,0) | * | | (0,0) | * | +# | | | | | | +# | | | | | | +# ------------------------- ------------------------- +# +# (Part 0) (Part 1) +############################################################ + +# GridCreate: ndim nparts +GridCreate: 2 2 + +# GridSetExtents: part ilower(ndim) iupper(ndim) +GridSetExtents: 0 (0- 0-) (1+ 1+) +GridSetExtents: 1 (0- 0-) (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- : 1 0) (1+ 1+ : 1 0) 1 (0- 0-) (0- 1+) [0 1] [1 1] + +# West neighbors +GridSetNeighborPart: 1 (0- 0- : -1 0) (0- 1+ : -1 0) 0 (1+ 0-) (1+ 1+) [0 1] [1 1] + +############################################################ + +# StencilCreate: nstencils sizes[nstencils] +StencilCreate: 1 [5] + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 0 0 [ 0 0] 0 4.0 +StencilSetEntry: 0 1 [-1 0] 0 -1.0 +StencilSetEntry: 0 2 [ 1 0] 0 -1.0 +StencilSetEntry: 0 3 [ 0 -1] 0 -1.0 +StencilSetEntry: 0 4 [ 0 1] 0 -1.0 + +############################################################ + +# GraphSetStencil: part var stencil_num +GraphSetStencil: 0 0 0 +GraphSetStencil: 1 0 0 + +############################################################ + +# MatrixSetDomainStride: part stride[ndim] +MatrixSetDomainStride: 0 [1 1] +MatrixSetDomainStride: 1 [1 1] + +# MatrixSetRangeStride: part stride[ndim] +MatrixSetRangeStride: 0 [1 1] +MatrixSetRangeStride: 1 [1 1] + +# MatrixSetConstantEntries: part num_centries centries(num_centries) + +# MatrixSetValues: boundary conditions +# part ilower(ndim) iupper(ndim) stride[ndim] var entry value +# North BCs +MatrixSetValues: 0 (0- 1+) (1+ 1+) [1 1] 0 4 0.0 +MatrixSetValues: 1 (0- 1+) (1+ 1+) [1 1] 0 4 0.0 + +# South BCs +MatrixSetValues: 0 (0- 0-) (1+ 0-) [1 1] 0 3 0.0 +MatrixSetValues: 1 (0- 0-) (1+ 0-) [1 1] 0 3 0.0 + +# East BCs +MatrixSetValues: 1 (1+ 0-) (1+ 1+) [1 1] 0 2 0.0 + +# West BCs +MatrixSetValues: 0 (0- 0-) (0- 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/src/test/TEST_sstructmat/sstructmat.in.2quadsA.CC b/src/test/TEST_sstructmat/sstructmat.in.2quadsA.CC new file mode 100644 index 0000000000..3df56f155f --- /dev/null +++ b/src/test/TEST_sstructmat/sstructmat.in.2quadsA.CC @@ -0,0 +1,108 @@ +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +# +# Grid sketch: +# +# ------------------------- ------------------------- +# | | | | | | +# | | | | | | +# | * | (2,1) | | * | (1,1) | +# | | | | | | +# | | | | | | +# ------------------------- ------------------------- +# | | | | | | +# | | | | | | +# | (1,0) | * | | (0,0) | * | +# | | | | | | +# | | | | | | +# ------------------------- ------------------------- +# +# (Part 0) (Part 1) +############################################################ + +# GridCreate: ndim nparts +GridCreate: 2 2 + +# GridSetExtents: part ilower(ndim) iupper(ndim) +GridSetExtents: 0 (1- 0-) (2+ 1+) +GridSetExtents: 1 (0- 0-) (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 (2+ 0- : 1 0) (2+ 1+ : 1 0) 1 (0- 0-) (0- 1+) [0 1] [1 1] + +# West neighbors +GridSetNeighborPart: 1 (0- 0- : -1 0) (0- 1+ : -1 0) 0 (2+ 0-) (2+ 1+) [0 1] [1 1] + +############################################################ + +# StencilCreate: nstencils sizes[nstencils] +StencilCreate: 1 [5] + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 0 0 [ 0 0] 0 4.0 +StencilSetEntry: 0 1 [-1 0] 0 -1.0 +StencilSetEntry: 0 2 [ 1 0] 0 -1.0 +StencilSetEntry: 0 3 [ 0 -1] 0 -1.0 +StencilSetEntry: 0 4 [ 0 1] 0 -1.0 + +############################################################ + +# GraphSetStencil: part var stencil_num +GraphSetStencil: 0 0 0 +GraphSetStencil: 1 0 0 + +############################################################ + +# MatrixSetDomainStride: part stride[ndim] +MatrixSetDomainStride: 0 [1 1] +MatrixSetDomainStride: 1 [1 1] + +# MatrixSetRangeStride: part stride[ndim] +MatrixSetRangeStride: 0 [1 1] +MatrixSetRangeStride: 1 [1 1] + +# MatrixSetConstantEntries: part num_centries centries(num_centries) + +# MatrixSetValues: boundary conditions +# part ilower(ndim) iupper(ndim) stride[ndim] var entry value +# North BCs +MatrixSetValues: 0 (1- 1+) (2+ 1+) [1 1] 0 4 0.0 +MatrixSetValues: 1 (0- 1+) (1+ 1+) [1 1] 0 4 0.0 + +# South BCs +MatrixSetValues: 0 (1- 0-) (2+ 0-) [1 1] 0 3 0.0 +MatrixSetValues: 1 (0- 0-) (1+ 0-) [1 1] 0 3 0.0 + +# East BCs +MatrixSetValues: 1 (1+ 0-) (1+ 1+) [1 1] 0 2 0.0 + +# West BCs +MatrixSetValues: 0 (1- 0-) (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/src/test/TEST_sstructmat/sstructmat.in.2quadsA.FF b/src/test/TEST_sstructmat/sstructmat.in.2quadsA.FF new file mode 100644 index 0000000000..087d7be618 --- /dev/null +++ b/src/test/TEST_sstructmat/sstructmat.in.2quadsA.FF @@ -0,0 +1,111 @@ +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +# +# Grid sketch: +# +# ------------------------- ------------------------- +# | | | | | | +# | | | | | | +# | * | (1,1) | | * | (2,1) | +# | | | | | | +# | | | | | | +# ------------------------- ------------------------- +# | | | | | | +# | | | | | | +# | (0,0) | * | | (1,0) | * | +# | | | | | | +# | | | | | | +# ------------------------- ------------------------- +# +# (Part 0) (Part 1) +# +# Note: both part boundaries are F points when coarsened in +# the x-direction +############################################################ + +# GridCreate: ndim nparts +GridCreate: 2 2 + +# GridSetExtents: part ilower(ndim) iupper(ndim) +GridSetExtents: 0 (0- 0-) (1+ 1+) +GridSetExtents: 1 (1- 0-) (2+ 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- : 1 0) (1+ 1+ : 1 0) 1 (1- 0-) (1- 1+) [0 1] [1 1] + +# West neighbors +GridSetNeighborPart: 1 (1- 0- : -1 0) (1- 1+ : -1 0) 0 (1+ 0-) (1+ 1+) [0 1] [1 1] + +############################################################ + +# StencilCreate: nstencils sizes[nstencils] +StencilCreate: 1 [5] + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 0 0 [ 0 0] 0 4.0 +StencilSetEntry: 0 1 [-1 0] 0 -1.0 +StencilSetEntry: 0 2 [ 1 0] 0 -1.0 +StencilSetEntry: 0 3 [ 0 -1] 0 -1.0 +StencilSetEntry: 0 4 [ 0 1] 0 -1.0 + +############################################################ + +# GraphSetStencil: part var stencil_num +GraphSetStencil: 0 0 0 +GraphSetStencil: 1 0 0 + +############################################################ + +# MatrixSetDomainStride: part stride[ndim] +MatrixSetDomainStride: 0 [1 1] +MatrixSetDomainStride: 1 [1 1] + +# MatrixSetRangeStride: part stride[ndim] +MatrixSetRangeStride: 0 [1 1] +MatrixSetRangeStride: 1 [1 1] + +# MatrixSetConstantEntries: part num_centries centries(num_centries) + +# MatrixSetValues: boundary conditions +# part ilower(ndim) iupper(ndim) stride[ndim] var entry value +# North BCs +MatrixSetValues: 0 (0- 1+) (1+ 1+) [1 1] 0 4 0.0 +MatrixSetValues: 1 (1- 1+) (2+ 1+) [1 1] 0 4 0.0 + +# South BCs +MatrixSetValues: 0 (0- 0-) (1+ 0-) [1 1] 0 3 0.0 +MatrixSetValues: 1 (1- 0-) (2+ 0-) [1 1] 0 3 0.0 + +# East BCs +MatrixSetValues: 1 (2+ 0-) (2+ 1+) [1 1] 0 2 0.0 + +# West BCs +MatrixSetValues: 0 (1- 0-) (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/src/test/TEST_sstructmat/sstructmat.in.2quadsPx b/src/test/TEST_sstructmat/sstructmat.in.2quadsPx new file mode 100644 index 0000000000..c1ca8485fb --- /dev/null +++ b/src/test/TEST_sstructmat/sstructmat.in.2quadsPx @@ -0,0 +1,82 @@ +# Copyright (c) 1998 Lawrence Livermore 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: 2 2 + +# GridSetExtents: part ilower(ndim) iupper(ndim) +GridSetExtents: 0 (0- 0-) (1+ 1+) +GridSetExtents: 1 (0- 0-) (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- : 1 0) (1+ 1+ : 1 0) 1 (0- 0-) (0- 1+) [0 1] [1 1] + +# West neighbors +GridSetNeighborPart: 1 (0- 0- : -1 0) (0- 1+ : -1 0) 0 (1+ 0-) (1+ 1+) [0 1] [1 1] + +############################################################ + +# StencilCreate: nstencils sizes[nstencils] +StencilCreate: 1 [3] + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 0 0 [ 0 0] 0 1.0 +StencilSetEntry: 0 1 [-1 0] 0 0.5 +StencilSetEntry: 0 2 [ 1 0] 0 0.5 + +############################################################ + +# GraphSetStencil: part var stencil_num +GraphSetStencil: 0 0 0 +GraphSetStencil: 1 0 0 + +############################################################ + +# MatrixSetDomainStride: part stride[ndim] +MatrixSetDomainStride: 0 [2 1] +MatrixSetDomainStride: 1 [2 1] + +# MatrixSetRangeStride: part stride[ndim] +MatrixSetRangeStride: 0 [1 1] +MatrixSetRangeStride: 1 [1 1] + +# MatrixSetConstantEntries: part nentries entries(nentries) +MatrixSetConstantEntries: 0 1 [0] +MatrixSetConstantEntries: 1 1 [0] + +# MatrixSetValues: boundary conditions +# part ilower(ndim) iupper(ndim) stride[ndim] var entry value +# East BCs +#MatrixSetValues: 1 (1+ 0-) (1+ 1+) [1 1] 0 2 0.0 + +# West BCs +#MatrixSetValues: 0 (0- 0-) (0- 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/src/test/TEST_sstructmat/sstructmat.in.2quadsPx.CC b/src/test/TEST_sstructmat/sstructmat.in.2quadsPx.CC new file mode 100644 index 0000000000..1d88e62ad2 --- /dev/null +++ b/src/test/TEST_sstructmat/sstructmat.in.2quadsPx.CC @@ -0,0 +1,74 @@ +# Copyright (c) 1998 Lawrence Livermore 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: 2 2 + +# GridSetExtents: part ilower(ndim) iupper(ndim) +GridSetExtents: 0 (1- 0-) (2+ 1+) +GridSetExtents: 1 (0- 0-) (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 (2+ 0- : 1 0) (2+ 1+ : 1 0) 1 (0- 0-) (0- 1+) [0 1] [1 1] + +# West neighbors +GridSetNeighborPart: 1 (0- 0- : -1 0) (0- 1+ : -1 0) 0 (2+ 0-) (2+ 1+) [0 1] [1 1] + +############################################################ + +# StencilCreate: nstencils sizes[nstencils] +StencilCreate: 1 [3] + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 0 0 [ 0 0] 0 1.0 +StencilSetEntry: 0 1 [-1 0] 0 0.5 +StencilSetEntry: 0 2 [ 1 0] 0 0.5 + +############################################################ + +# GraphSetStencil: part var stencil_num +GraphSetStencil: 0 0 0 +GraphSetStencil: 1 0 0 + +############################################################ + +# MatrixSetDomainStride: part stride[ndim] +MatrixSetDomainStride: 0 [2 1] +MatrixSetDomainStride: 1 [2 1] + +# MatrixSetRangeStride: part stride[ndim] +MatrixSetRangeStride: 0 [1 1] +MatrixSetRangeStride: 1 [1 1] + +# MatrixSetConstantEntries: part nentries entries(nentries) +MatrixSetConstantEntries: 0 1 [0] +MatrixSetConstantEntries: 1 1 [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/src/test/TEST_sstructmat/sstructmat.in.2quadsPx.FF b/src/test/TEST_sstructmat/sstructmat.in.2quadsPx.FF new file mode 100644 index 0000000000..d36f0cefa5 --- /dev/null +++ b/src/test/TEST_sstructmat/sstructmat.in.2quadsPx.FF @@ -0,0 +1,74 @@ +# Copyright (c) 1998 Lawrence Livermore 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: 2 2 + +# GridSetExtents: part ilower(ndim) iupper(ndim) +GridSetExtents: 0 (0- 0-) (1+ 1+) +GridSetExtents: 1 (1- 0-) (2+ 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- : 1 0) (1+ 1+ : 1 0) 1 (1- 0-) (1- 1+) [0 1] [1 1] + +# West neighbors +GridSetNeighborPart: 1 (1- 0- : -1 0) (1- 1+ : -1 0) 0 (1+ 0-) (1+ 1+) [0 1] [1 1] + +############################################################ + +# StencilCreate: nstencils sizes[nstencils] +StencilCreate: 1 [3] + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 0 0 [ 0 0] 0 1.0 +StencilSetEntry: 0 1 [-1 0] 0 0.5 +StencilSetEntry: 0 2 [ 1 0] 0 0.5 + +############################################################ + +# GraphSetStencil: part var stencil_num +GraphSetStencil: 0 0 0 +GraphSetStencil: 1 0 0 + +############################################################ + +# MatrixSetDomainStride: part stride[ndim] +MatrixSetDomainStride: 0 [2 1] +MatrixSetDomainStride: 1 [2 1] + +# MatrixSetRangeStride: part stride[ndim] +MatrixSetRangeStride: 0 [1 1] +MatrixSetRangeStride: 1 [1 1] + +# MatrixSetConstantEntries: part nentries entries(nentries) +MatrixSetConstantEntries: 0 1 [0] +MatrixSetConstantEntries: 1 1 [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/src/test/TEST_sstructmat/sstructmat.in.2quadsPxy b/src/test/TEST_sstructmat/sstructmat.in.2quadsPxy new file mode 100644 index 0000000000..4c22751682 --- /dev/null +++ b/src/test/TEST_sstructmat/sstructmat.in.2quadsPxy @@ -0,0 +1,77 @@ +# Copyright (c) 1998 Lawrence Livermore 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: 2 2 + +# GridSetExtents: part ilower(ndim) iupper(ndim) +GridSetExtents: 0 (0- 0-) (1+ 1+) +GridSetExtents: 1 (0- 0-) (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- : 1 0) (1+ 1+ : 1 0) 1 (0- 0-) (0- 1+) [0 1] [1 1] + +# West neighbors +GridSetNeighborPart: 1 (0- 0- : -1 0) (0- 1+ : -1 0) 0 (1+ 0-) (1+ 1+) [0 1] [1 1] + +############################################################ + +# StencilCreate: nstencils sizes[nstencils] +StencilCreate: 2 [3 3] + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 0 0 [ 0 0] 0 1.0 +StencilSetEntry: 0 1 [-1 0] 0 0.5 +StencilSetEntry: 0 2 [ 1 0] 0 0.5 +StencilSetEntry: 1 0 [ 0 0] 0 1.0 +StencilSetEntry: 1 1 [ 0 -1] 0 0.5 +StencilSetEntry: 1 2 [ 0 1] 0 0.5 + +############################################################ + +# GraphSetStencil: part var stencil_num +GraphSetStencil: 0 0 0 +GraphSetStencil: 1 0 1 + +############################################################ + +# MatrixSetDomainStride: part stride[ndim] +MatrixSetDomainStride: 0 [2 1] +MatrixSetDomainStride: 1 [1 2] + +# MatrixSetRangeStride: part stride[ndim] +MatrixSetRangeStride: 0 [1 1] +MatrixSetRangeStride: 1 [1 1] + +# MatrixSetConstantEntries: part nentries entries(nentries) +MatrixSetConstantEntries: 0 1 [0] +MatrixSetConstantEntries: 1 1 [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/src/test/TEST_sstructmat/sstructmat.in.2quadsPy b/src/test/TEST_sstructmat/sstructmat.in.2quadsPy new file mode 100644 index 0000000000..64ea11d672 --- /dev/null +++ b/src/test/TEST_sstructmat/sstructmat.in.2quadsPy @@ -0,0 +1,74 @@ +# Copyright (c) 1998 Lawrence Livermore 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: 2 2 + +# GridSetExtents: part ilower(ndim) iupper(ndim) +GridSetExtents: 0 (0- 0-) (1+ 1+) +GridSetExtents: 1 (0- 0-) (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- : 1 0) (1+ 1+ : 1 0) 1 (0- 0-) (0- 1+) [0 1] [1 1] + +# West neighbors +GridSetNeighborPart: 1 (0- 0- : -1 0) (0- 1+ : -1 0) 0 (1+ 0-) (1+ 1+) [0 1] [1 1] + +############################################################ + +# StencilCreate: nstencils sizes[nstencils] +StencilCreate: 1 [3] + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 0 0 [ 0 0] 0 1.0 +StencilSetEntry: 0 1 [ 0 -1] 0 0.5 +StencilSetEntry: 0 2 [ 0 1] 0 0.5 + +############################################################ + +# GraphSetStencil: part var stencil_num +GraphSetStencil: 0 0 0 +GraphSetStencil: 1 0 0 + +############################################################ + +# MatrixSetDomainStride: part stride[ndim] +MatrixSetDomainStride: 0 [1 2] +MatrixSetDomainStride: 1 [1 2] + +# MatrixSetRangeStride: part stride[ndim] +MatrixSetRangeStride: 0 [1 1] +MatrixSetRangeStride: 1 [1 1] + +# MatrixSetConstantEntries: part nentries entries(nentries) +MatrixSetConstantEntries: 0 1 [0] +MatrixSetConstantEntries: 1 1 [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/src/test/TEST_sstructmat/sstructmat.in.3quadsA.idle b/src/test/TEST_sstructmat/sstructmat.in.3quadsA.idle new file mode 100644 index 0000000000..5500dd42c5 --- /dev/null +++ b/src/test/TEST_sstructmat/sstructmat.in.3quadsA.idle @@ -0,0 +1,117 @@ +# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other +# HYPRE Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +# +# Grid sketch: +# +# ------------------------- ------------------------- +# | | | | | | +# | | | | | | +# | * | (1,1) | | * | (1,1) | +# | | | | | | +# | | | | | | +# ------------------------- ------------------------- +# | | | | | | +# | | | | | | +# | (0,0) | * | | (0,0) | * | +# | | | | | | +# | | | | | | +# ------------------------- ------------------------- +# +# (Part 0) (Part 1) +# +# Note: Part 2 is empty +############################################################ + +# GridCreate: ndim nparts +GridCreate: 2 3 + +# GridSetExtents: part ilower(ndim) iupper(ndim) +GridSetExtents: 0 (0- 0-) (1+ 1+) +GridSetExtents: 1 (0- 0-) (1+ 1+) +#GridSetExtents: 2 (0- 0-) (0+ 0+) + +# GridSetVariables: part nvars vartypes[nvars] +GridSetVariables: 0 1 [0] +GridSetVariables: 1 1 [0] +GridSetVariables: 2 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- : 1 0) (1+ 1+ : 1 0) 1 (0- 0-) (0- 1+) [0 1] [1 1] + +# West neighbors +GridSetNeighborPart: 1 (0- 0- : -1 0) (0- 1+ : -1 0) 0 (1+ 0-) (1+ 1+) [0 1] [1 1] + +############################################################ + +# StencilCreate: nstencils sizes[nstencils] +StencilCreate: 1 [5] + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 0 0 [ 0 0] 0 4.0 +StencilSetEntry: 0 1 [-1 0] 0 -1.0 +StencilSetEntry: 0 2 [ 1 0] 0 -1.0 +StencilSetEntry: 0 3 [ 0 -1] 0 -1.0 +StencilSetEntry: 0 4 [ 0 1] 0 -1.0 + +############################################################ + +# GraphSetStencil: part var stencil_num +GraphSetStencil: 0 0 0 +GraphSetStencil: 1 0 0 +GraphSetStencil: 2 0 0 + +############################################################ + +# MatrixSetDomainStride: part stride[ndim] +MatrixSetDomainStride: 0 [1 1] +MatrixSetDomainStride: 1 [1 1] +MatrixSetDomainStride: 2 [1 1] + +# MatrixSetRangeStride: part stride[ndim] +MatrixSetRangeStride: 0 [1 1] +MatrixSetRangeStride: 1 [1 1] +MatrixSetRangeStride: 2 [1 1] + +# MatrixSetConstantEntries: part num_centries centries(num_centries) + +# MatrixSetValues: boundary conditions +# part ilower(ndim) iupper(ndim) stride[ndim] var entry value +# North BCs +MatrixSetValues: 0 (0- 1+) (1+ 1+) [1 1] 0 4 0.0 +MatrixSetValues: 1 (0- 1+) (1+ 1+) [1 1] 0 4 0.0 + +# South BCs +MatrixSetValues: 0 (0- 0-) (1+ 0-) [1 1] 0 3 0.0 +MatrixSetValues: 1 (0- 0-) (1+ 0-) [1 1] 0 3 0.0 + +# East BCs +MatrixSetValues: 1 (1+ 0-) (1+ 1+) [1 1] 0 2 0.0 + +# West BCs +MatrixSetValues: 0 (0- 0-) (0- 1+) [1 1] 0 1 0.0 + +############################################################ + +# ProcessPoolCreate: num_pools +ProcessPoolCreate: 3 + +# ProcessPoolSetPart: pool part +ProcessPoolSetPart: 0 0 +ProcessPoolSetPart: 1 1 +ProcessPoolSetPart: 2 2 + +# ProcessPoolCreate: num_pools +ProcessPoolCreate: 1 + +# ProcessPoolSetPart: pool part +ProcessPoolSetPart: 0 0 +ProcessPoolSetPart: 0 1 +ProcessPoolSetPart: 0 2 +############################################################ diff --git a/src/test/TEST_sstructmat/sstructmat.in.3quadsPx.idle b/src/test/TEST_sstructmat/sstructmat.in.3quadsPx.idle new file mode 100644 index 0000000000..75f1396047 --- /dev/null +++ b/src/test/TEST_sstructmat/sstructmat.in.3quadsPx.idle @@ -0,0 +1,82 @@ +# Copyright (c) 1998 Lawrence Livermore 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: 2 3 + +# GridSetExtents: part ilower(ndim) iupper(ndim) +GridSetExtents: 0 (0- 0-) (1+ 1+) +GridSetExtents: 1 (0- 0-) (1+ 1+) +#GridSetExtents: 2 (0- 0-) (0+ 0+) + +# GridSetVariables: part nvars vartypes[nvars] +GridSetVariables: 0 1 [0] +GridSetVariables: 1 1 [0] +GridSetVariables: 2 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- : 1 0) (1+ 1+ : 1 0) 1 (0- 0-) (0- 1+) [0 1] [1 1] + +# West neighbors +GridSetNeighborPart: 1 (0- 0- : -1 0) (0- 1+ : -1 0) 0 (1+ 0-) (1+ 1+) [0 1] [1 1] + +############################################################ + +# StencilCreate: nstencils sizes[nstencils] +StencilCreate: 1 [3] + +# StencilSetEntry: stencil_num entry offset[ndim] var value +StencilSetEntry: 0 0 [ 0 0] 0 1.0 +StencilSetEntry: 0 1 [-1 0] 0 0.5 +StencilSetEntry: 0 2 [ 1 0] 0 0.5 + +############################################################ + +# GraphSetStencil: part var stencil_num +GraphSetStencil: 0 0 0 +GraphSetStencil: 1 0 0 +GraphSetStencil: 2 0 0 + +############################################################ + +# MatrixSetDomainStride: part stride[ndim] +MatrixSetDomainStride: 0 [2 1] +MatrixSetDomainStride: 1 [2 1] +MatrixSetDomainStride: 2 [2 1] + +# MatrixSetRangeStride: part stride[ndim] +MatrixSetRangeStride: 0 [1 1] +MatrixSetRangeStride: 1 [1 1] +MatrixSetRangeStride: 2 [1 1] + +# MatrixSetConstantEntries: part nentries entries(nentries) +MatrixSetConstantEntries: 0 1 [0] +MatrixSetConstantEntries: 1 1 [0] +MatrixSetConstantEntries: 2 1 [0] + +############################################################ + +# ProcessPoolCreate: num_pools +ProcessPoolCreate: 3 + +# ProcessPoolSetPart: pool part +ProcessPoolSetPart: 0 0 +ProcessPoolSetPart: 1 1 +ProcessPoolSetPart: 2 2 + +# ProcessPoolCreate: num_pools +ProcessPoolCreate: 1 + +# ProcessPoolSetPart: pool part +ProcessPoolSetPart: 0 0 +ProcessPoolSetPart: 0 1 +ProcessPoolSetPart: 0 2 +############################################################ diff --git a/src/test/TEST_sstructmat/sstructmat.jobs b/src/test/TEST_sstructmat/sstructmat.jobs new file mode 100755 index 0000000000..8206de51a1 --- /dev/null +++ b/src/test/TEST_sstructmat/sstructmat.jobs @@ -0,0 +1,66 @@ +#!/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) + +#============================================================================= +# 2D one proc RAP - 5 to 9 points +#============================================================================= + +# interpolate in x direction +mpirun -np 1 ./sstructmat -in 2 sstructmat.in.2quadsA sstructmat.in.2quadsPx -mat-mat 3 1T 0 1 -r 8 8 1 -pooldist 1 > sstructmat.out.2quadsRAPx +mpirun -np 1 ./sstructmat -in 2 sstructmat.in.2quadsA.FF sstructmat.in.2quadsPx.FF -mat-mat 3 1T 0 1 -r 8 8 1 -pooldist 1 > sstructmat.out.2quadsRAPx.FF +mpirun -np 1 ./sstructmat -in 2 sstructmat.in.2quadsA.CC sstructmat.in.2quadsPx.CC -mat-mat 3 1T 0 1 -r 8 8 1 -pooldist 1 > sstructmat.out.2quadsRAPx.CC + +# interpolate in y direction +mpirun -np 1 ./sstructmat -in 2 sstructmat.in.2quadsA sstructmat.in.2quadsPy -mat-mat 3 1T 0 1 -r 8 8 1 -pooldist 1 > sstructmat.out.2quadsRAPy + +# interpolate in x direction (part 0) and y direction (part 1) +mpirun -np 1 ./sstructmat -in 2 sstructmat.in.2quadsA sstructmat.in.2quadsPxy -mat-mat 3 1T 0 1 -r 8 8 1 -pooldist 1 > sstructmat.out.2quadsRAPxy + +#============================================================================= +# 2D two procs RAP - 5 to 9 points +#============================================================================= + +# interpolate in x direction +mpirun -np 2 ./sstructmat -in 2 sstructmat.in.2quadsA sstructmat.in.2quadsPx -mat-mat 3 1T 0 1 -r 8 8 1 -pooldist 0 > sstructmat.out.2quadsRAPx.2procs +mpirun -np 2 ./sstructmat -in 2 sstructmat.in.2quadsA.FF sstructmat.in.2quadsPx.FF -mat-mat 3 1T 0 1 -r 8 8 1 -pooldist 0 > sstructmat.out.2quadsRAPx.FF.2procs +mpirun -np 2 ./sstructmat -in 2 sstructmat.in.2quadsA.CC sstructmat.in.2quadsPx.CC -mat-mat 3 1T 0 1 -r 8 8 1 -pooldist 0 > sstructmat.out.2quadsRAPx.CC.2procs + +# interpolate in y direction +mpirun -np 2 ./sstructmat -in 2 sstructmat.in.2quadsA sstructmat.in.2quadsPy -mat-mat 3 1T 0 1 -r 8 8 1 -pooldist 0 > sstructmat.out.2quadsRAPy.2procs + +# interpolate in x direction (part 0) and y direction (part 1) +mpirun -np 2 ./sstructmat -in 2 sstructmat.in.2quadsA sstructmat.in.2quadsPxy -mat-mat 3 1T 0 1 -r 8 8 1 -pooldist 0 > sstructmat.out.2quadsRAPxy.2procs + +#============================================================================= +# 2D idle parts RAP - 5 to 9 points +#============================================================================= + +mpirun -np 1 ./sstructmat -in 2 sstructmat.in.3quadsA.idle sstructmat.in.3quadsPx.idle -mat-mat 3 1T 0 1 -r 8 8 1 -pooldist 1 > sstructmat.out.3quadsRAPx.idle +mpirun -np 3 ./sstructmat -in 2 sstructmat.in.3quadsA.idle sstructmat.in.3quadsPx.idle -mat-mat 3 1T 0 1 -r 8 8 1 -pooldist 0 > sstructmat.out.3quadsRAPx.idle.3procs + +#============================================================================= +# 3D RAP - 7 to 15 points +#============================================================================= + +# interpolate in x direction +mpirun -np 1 ./sstructmat -in 2 sstructmat.in.2cubesA sstructmat.in.2cubesPx -mat-mat 3 1T 0 1 -r 8 8 8 -pooldist 1 > sstructmat.out.2cubesRAPx +mpirun -np 2 ./sstructmat -in 2 sstructmat.in.2cubesA sstructmat.in.2cubesPx -mat-mat 3 1T 0 1 -r 8 8 8 -pooldist 0 > sstructmat.out.2cubesRAPx.2procs + +# interpolate in y direction +mpirun -np 1 ./sstructmat -in 2 sstructmat.in.2cubesA sstructmat.in.2cubesPy -mat-mat 3 1T 0 1 -r 8 8 8 -pooldist 1 > sstructmat.out.2cubesRAPy +mpirun -np 2 ./sstructmat -in 2 sstructmat.in.2cubesA sstructmat.in.2cubesPy -mat-mat 3 1T 0 1 -r 8 8 8 -pooldist 0 > sstructmat.out.2cubesRAPy.2procs + +# interpolate in z direction +mpirun -np 1 ./sstructmat -in 2 sstructmat.in.2cubesA sstructmat.in.2cubesPz -mat-mat 3 1T 0 1 -r 8 8 8 -pooldist 1 > sstructmat.out.2cubesRAPz +mpirun -np 2 ./sstructmat -in 2 sstructmat.in.2cubesA sstructmat.in.2cubesPz -mat-mat 3 1T 0 1 -r 8 8 8 -pooldist 0 > sstructmat.out.2cubesRAPz.2procs + +# interpolate in x direction (part 0) and y direction (part 1) +mpirun -np 1 ./sstructmat -in 2 sstructmat.in.2cubesA sstructmat.in.2cubesPxy -mat-mat 3 1T 0 1 -r 8 8 8 -pooldist 1 > sstructmat.out.2cubesRAPxy +mpirun -np 2 ./sstructmat -in 2 sstructmat.in.2cubesA sstructmat.in.2cubesPxy -mat-mat 3 1T 0 1 -r 8 8 8 -pooldist 0 > sstructmat.out.2cubesRAPxy.2procs + +# interpolate in x direction (part 0) and z direction (part 1) +mpirun -np 1 ./sstructmat -in 2 sstructmat.in.2cubesA sstructmat.in.2cubesPxz -mat-mat 3 1T 0 1 -r 8 8 8 -pooldist 1 > sstructmat.out.2cubesRAPxz +mpirun -np 2 ./sstructmat -in 2 sstructmat.in.2cubesA sstructmat.in.2cubesPxz -mat-mat 3 1T 0 1 -r 8 8 8 -pooldist 0 > sstructmat.out.2cubesRAPxz.2procs diff --git a/src/test/TEST_sstructmat/sstructmat.sh b/src/test/TEST_sstructmat/sstructmat.sh new file mode 100755 index 0000000000..9d54e28f55 --- /dev/null +++ b/src/test/TEST_sstructmat/sstructmat.sh @@ -0,0 +1,48 @@ +#!/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` + +#============================================================================= +#============================================================================= + +FILESmatmat="\ + ${TNAME}.out.2quadsRAPx\ + ${TNAME}.out.2quadsRAPx.FF\ + ${TNAME}.out.2quadsRAPx.CC\ + ${TNAME}.out.2quadsRAPy\ + ${TNAME}.out.2quadsRAPxy\ + ${TNAME}.out.2quadsRAPx.2procs\ + ${TNAME}.out.2quadsRAPx.FF.2procs\ + ${TNAME}.out.2quadsRAPx.CC.2procs\ + ${TNAME}.out.2quadsRAPy.2procs\ + ${TNAME}.out.2quadsRAPxy.2procs\ + ${TNAME}.out.3quadsRAPx.idle\ + ${TNAME}.out.3quadsRAPx.idle.3procs\ + ${TNAME}.out.2cubesRAPx\ + ${TNAME}.out.2cubesRAPx.2procs\ + ${TNAME}.out.2cubesRAPy\ + ${TNAME}.out.2cubesRAPy.2procs\ + ${TNAME}.out.2cubesRAPz\ + ${TNAME}.out.2cubesRAPz.2procs\ + ${TNAME}.out.2cubesRAPxy\ + ${TNAME}.out.2cubesRAPxy.2procs\ + ${TNAME}.out.2cubesRAPxz\ + ${TNAME}.out.2cubesRAPxz.2procs\ +" +#============================================================================= +# Find failed tests +#============================================================================= + +# Matmat tests +for i in $FILESmatmat +do + FAILED=`grep "[test_SStructMatmult]: failed" $i | wc -l` + if [ "$FAILED" -gt "0" ] + then + echo "[test_SStructMatmult]: failed at $i" >&2 + fi +done diff --git a/src/test/TEST_struct/cgpfmg3d.saved.florentia b/src/test/TEST_struct/cgpfmg3d.saved.aurora similarity index 100% rename from src/test/TEST_struct/cgpfmg3d.saved.florentia rename to src/test/TEST_struct/cgpfmg3d.saved.aurora diff --git a/src/test/TEST_struct/emptyproc.saved b/src/test/TEST_struct/emptyproc.saved index 4d3786f591..f1cf469b20 100644 --- a/src/test/TEST_struct/emptyproc.saved +++ b/src/test/TEST_struct/emptyproc.saved @@ -19,8 +19,8 @@ Iterations = 20 Final Relative Residual Norm = 6.594761e-07 # Output file: emptyproc.out.04a -Iterations = 15 -Final Relative Residual Norm = 9.712834e-07 +Iterations = 16 +Final Relative Residual Norm = 4.959904e-07 # Output file: emptyproc.out.04b Iterations = 15 @@ -36,7 +36,7 @@ Final Relative Residual Norm = 3.054686e-07 # Output file: emptyproc.out.14a Iterations = 8 -Final Relative Residual Norm = 6.561630e-07 +Final Relative Residual Norm = 7.454892e-07 # Output file: emptyproc.out.17a Iterations = 20 diff --git a/src/test/TEST_struct/emptyproc.saved.florentia b/src/test/TEST_struct/emptyproc.saved.aurora similarity index 93% rename from src/test/TEST_struct/emptyproc.saved.florentia rename to src/test/TEST_struct/emptyproc.saved.aurora index 4d3786f591..f1cf469b20 100644 --- a/src/test/TEST_struct/emptyproc.saved.florentia +++ b/src/test/TEST_struct/emptyproc.saved.aurora @@ -19,8 +19,8 @@ Iterations = 20 Final Relative Residual Norm = 6.594761e-07 # Output file: emptyproc.out.04a -Iterations = 15 -Final Relative Residual Norm = 9.712834e-07 +Iterations = 16 +Final Relative Residual Norm = 4.959904e-07 # Output file: emptyproc.out.04b Iterations = 15 @@ -36,7 +36,7 @@ Final Relative Residual Norm = 3.054686e-07 # Output file: emptyproc.out.14a Iterations = 8 -Final Relative Residual Norm = 6.561630e-07 +Final Relative Residual Norm = 7.454892e-07 # Output file: emptyproc.out.17a Iterations = 20 diff --git a/src/test/TEST_struct/emptyproc.saved.lassen b/src/test/TEST_struct/emptyproc.saved.lassen index 4d3786f591..f1cf469b20 100644 --- a/src/test/TEST_struct/emptyproc.saved.lassen +++ b/src/test/TEST_struct/emptyproc.saved.lassen @@ -19,8 +19,8 @@ Iterations = 20 Final Relative Residual Norm = 6.594761e-07 # Output file: emptyproc.out.04a -Iterations = 15 -Final Relative Residual Norm = 9.712834e-07 +Iterations = 16 +Final Relative Residual Norm = 4.959904e-07 # Output file: emptyproc.out.04b Iterations = 15 @@ -36,7 +36,7 @@ Final Relative Residual Norm = 3.054686e-07 # Output file: emptyproc.out.14a Iterations = 8 -Final Relative Residual Norm = 6.561630e-07 +Final Relative Residual Norm = 7.454892e-07 # Output file: emptyproc.out.17a Iterations = 20 diff --git a/src/test/TEST_struct/emptyproc.saved.lassen_cpu b/src/test/TEST_struct/emptyproc.saved.lassen_cpu index 4d3786f591..f1cf469b20 100644 --- a/src/test/TEST_struct/emptyproc.saved.lassen_cpu +++ b/src/test/TEST_struct/emptyproc.saved.lassen_cpu @@ -19,8 +19,8 @@ Iterations = 20 Final Relative Residual Norm = 6.594761e-07 # Output file: emptyproc.out.04a -Iterations = 15 -Final Relative Residual Norm = 9.712834e-07 +Iterations = 16 +Final Relative Residual Norm = 4.959904e-07 # Output file: emptyproc.out.04b Iterations = 15 @@ -36,7 +36,7 @@ Final Relative Residual Norm = 3.054686e-07 # Output file: emptyproc.out.14a Iterations = 8 -Final Relative Residual Norm = 6.561630e-07 +Final Relative Residual Norm = 7.454892e-07 # Output file: emptyproc.out.17a Iterations = 20 diff --git a/src/test/TEST_struct/emptyproc.saved.tioga b/src/test/TEST_struct/emptyproc.saved.tioga index 4d3786f591..f1cf469b20 100644 --- a/src/test/TEST_struct/emptyproc.saved.tioga +++ b/src/test/TEST_struct/emptyproc.saved.tioga @@ -19,8 +19,8 @@ Iterations = 20 Final Relative Residual Norm = 6.594761e-07 # Output file: emptyproc.out.04a -Iterations = 15 -Final Relative Residual Norm = 9.712834e-07 +Iterations = 16 +Final Relative Residual Norm = 4.959904e-07 # Output file: emptyproc.out.04b Iterations = 15 @@ -36,7 +36,7 @@ Final Relative Residual Norm = 3.054686e-07 # Output file: emptyproc.out.14a Iterations = 8 -Final Relative Residual Norm = 6.561630e-07 +Final Relative Residual Norm = 7.454892e-07 # Output file: emptyproc.out.17a Iterations = 20 diff --git a/src/test/TEST_struct/hybrid.saved.florentia b/src/test/TEST_struct/hybrid.saved.aurora similarity index 100% rename from src/test/TEST_struct/hybrid.saved.florentia rename to src/test/TEST_struct/hybrid.saved.aurora diff --git a/src/test/TEST_struct/hybridswitch.saved.florentia b/src/test/TEST_struct/hybridswitch.saved.aurora similarity index 100% rename from src/test/TEST_struct/hybridswitch.saved.florentia rename to src/test/TEST_struct/hybridswitch.saved.aurora diff --git a/src/test/TEST_struct/io.jobs b/src/test/TEST_struct/io.jobs new file mode 100755 index 0000000000..f1c05e25a0 --- /dev/null +++ b/src/test/TEST_struct/io.jobs @@ -0,0 +1,38 @@ +#!/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 ./struct -solver 1 -print > io.out.1P +mpirun -np 1 ./struct -solver 1 -fromfile struct.out.A > io.out.1RA +mpirun -np 1 ./struct -solver 1 -fromfile struct.out.A -rhsfromfile struct.out.b > io.out.1RAb +mpirun -np 1 ./struct -solver 1 -fromfile struct.out.A -rhsfromfile struct.out.b -x0fromfile struct.out.x0 > io.out.1RAbx + +mpirun -np 1 ./struct -solver 3 -print > io.out.3P +mpirun -np 1 ./struct -solver 3 -fromfile struct.out.A > io.out.3RA +mpirun -np 1 ./struct -solver 3 -fromfile struct.out.A -rhsfromfile struct.out.b > io.out.3RAb +mpirun -np 1 ./struct -solver 3 -fromfile struct.out.A -rhsfromfile struct.out.b -x0fromfile struct.out.x0 > io.out.3RAbx + +mpirun -np 1 ./struct -solver 4 -print > io.out.4P +mpirun -np 1 ./struct -solver 4 -fromfile struct.out.A > io.out.4RA +mpirun -np 1 ./struct -solver 4 -fromfile struct.out.A -rhsfromfile struct.out.b > io.out.4RAb +mpirun -np 1 ./struct -solver 4 -fromfile struct.out.A -rhsfromfile struct.out.b -x0fromfile struct.out.x0 > io.out.4RAbx + +#============================================================================= +# Parallel I/O tests +#============================================================================= + +mpirun -np 8 ./struct -solver 1 -print > io.out.101P +mpirun -np 8 ./struct -solver 1 -fromfile struct.out.A -rhsfromfile struct.out.b > io.out.101RAb + +mpirun -np 8 ./struct -solver 3 -print > io.out.103P +mpirun -np 8 ./struct -solver 3 -fromfile struct.out.A -rhsfromfile struct.out.b > io.out.103RAb + +mpirun -np 8 ./struct -solver 4 -print > io.out.104P +mpirun -np 8 ./struct -solver 4 -fromfile struct.out.A -rhsfromfile struct.out.b > io.out.104RAb + diff --git a/src/test/TEST_struct/io.saved b/src/test/TEST_struct/io.saved new file mode 100644 index 0000000000..df7d1d66a8 --- /dev/null +++ b/src/test/TEST_struct/io.saved @@ -0,0 +1,72 @@ +# Output file: io.out.1P +Iterations = 16 +Final Relative Residual Norm = 5.185152e-07 + +# Output file: io.out.1RA +Iterations = 16 +Final Relative Residual Norm = 5.185152e-07 + +# Output file: io.out.1RAb +Iterations = 16 +Final Relative Residual Norm = 5.185152e-07 + +# Output file: io.out.1RAbx +Iterations = 16 +Final Relative Residual Norm = 5.185152e-07 + +# Output file: io.out.3P +Iterations = 15 +Final Relative Residual Norm = 7.006196e-07 + +# Output file: io.out.3RA +Iterations = 15 +Final Relative Residual Norm = 7.006196e-07 + +# Output file: io.out.3RAb +Iterations = 15 +Final Relative Residual Norm = 7.006196e-07 + +# Output file: io.out.3RAbx +Iterations = 15 +Final Relative Residual Norm = 7.006196e-07 + +# Output file: io.out.4P +Iterations = 16 +Final Relative Residual Norm = 4.897881e-07 + +# Output file: io.out.4RA +Iterations = 16 +Final Relative Residual Norm = 4.897881e-07 + +# Output file: io.out.4RAb +Iterations = 16 +Final Relative Residual Norm = 4.897881e-07 + +# Output file: io.out.4RAbx +Iterations = 16 +Final Relative Residual Norm = 4.897881e-07 + +# Output file: io.out.101P +Iterations = 14 +Final Relative Residual Norm = 8.228245e-07 + +# Output file: io.out.101RAb +Iterations = 14 +Final Relative Residual Norm = 8.228245e-07 + +# Output file: io.out.103P +Iterations = 14 +Final Relative Residual Norm = 5.777016e-07 + +# Output file: io.out.103RAb +Iterations = 14 +Final Relative Residual Norm = 5.777016e-07 + +# Output file: io.out.104P +Iterations = 14 +Final Relative Residual Norm = 6.551070e-07 + +# Output file: io.out.104RAb +Iterations = 14 +Final Relative Residual Norm = 6.551070e-07 + diff --git a/src/test/TEST_struct/io.sh b/src/test/TEST_struct/io.sh new file mode 100755 index 0000000000..37ccf64078 --- /dev/null +++ b/src/test/TEST_struct/io.sh @@ -0,0 +1,93 @@ +#!/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 + +#============================================================================= +# Check read-from-file runs against driver-only runs +#============================================================================= + +tail -3 ${TNAME}.out.1P > ${TNAME}.testdata +tail -3 ${TNAME}.out.1RA > ${TNAME}.testdata.temp +diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 +tail -3 ${TNAME}.out.1RAb > ${TNAME}.testdata.temp +diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 +tail -3 ${TNAME}.out.1RAbx > ${TNAME}.testdata.temp +diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 + +tail -3 ${TNAME}.out.3P > ${TNAME}.testdata +tail -3 ${TNAME}.out.3RA > ${TNAME}.testdata.temp +diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 +tail -3 ${TNAME}.out.3RAb > ${TNAME}.testdata.temp +diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 +tail -3 ${TNAME}.out.3RAbx > ${TNAME}.testdata.temp +diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 + +tail -3 ${TNAME}.out.4P > ${TNAME}.testdata +tail -3 ${TNAME}.out.4RA > ${TNAME}.testdata.temp +diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 +tail -3 ${TNAME}.out.4RAb > ${TNAME}.testdata.temp +diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 +tail -3 ${TNAME}.out.4RAbx > ${TNAME}.testdata.temp +diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 + +tail -3 ${TNAME}.out.101P > ${TNAME}.testdata +tail -3 ${TNAME}.out.101RAb > ${TNAME}.testdata.temp +diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 + +tail -3 ${TNAME}.out.103P > ${TNAME}.testdata +tail -3 ${TNAME}.out.103RAb > ${TNAME}.testdata.temp +diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 + +tail -3 ${TNAME}.out.104P > ${TNAME}.testdata +tail -3 ${TNAME}.out.104RAb > ${TNAME}.testdata.temp +diff ${TNAME}.testdata ${TNAME}.testdata.temp >&2 + +#============================================================================= +# compare with baseline case +#============================================================================= + +FILES="\ + ${TNAME}.out.1P\ + ${TNAME}.out.1RA\ + ${TNAME}.out.1RAb\ + ${TNAME}.out.1RAbx\ + ${TNAME}.out.3P\ + ${TNAME}.out.3RA\ + ${TNAME}.out.3RAb\ + ${TNAME}.out.3RAbx\ + ${TNAME}.out.4P\ + ${TNAME}.out.4RA\ + ${TNAME}.out.4RAb\ + ${TNAME}.out.4RAbx\ + ${TNAME}.out.101P\ + ${TNAME}.out.101RAb\ + ${TNAME}.out.103P\ + ${TNAME}.out.103RAb\ + ${TNAME}.out.104P\ + ${TNAME}.out.104RAb\ +" + +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 -f ${TNAME}.testdata* diff --git a/src/test/TEST_struct/migrate.saved.florentia b/src/test/TEST_struct/migrate.saved.aurora similarity index 100% rename from src/test/TEST_struct/migrate.saved.florentia rename to src/test/TEST_struct/migrate.saved.aurora diff --git a/src/test/TEST_struct/parflow.saved.florentia b/src/test/TEST_struct/parflow.saved.aurora similarity index 100% rename from src/test/TEST_struct/parflow.saved.florentia rename to src/test/TEST_struct/parflow.saved.aurora diff --git a/src/test/TEST_struct/periodic.jobs b/src/test/TEST_struct/periodic.jobs index 6aedb57980..34c5ee16df 100755 --- a/src/test/TEST_struct/periodic.jobs +++ b/src/test/TEST_struct/periodic.jobs @@ -43,5 +43,3 @@ mpirun -np 2 ./struct -n 8 16 16 -p 16 0 16 -P 2 1 1 -solver 0 > periodic.out.5 mpirun -np 4 ./struct -n 8 8 16 -p 16 0 16 -P 2 2 1 -solver 0 > periodic.out.52 mpirun -np 4 ./struct -n 16 8 8 -p 16 0 16 -P 1 2 2 -solver 0 > periodic.out.53 -# non-power-of-two -mpirun -np 3 ./struct -n 10 10 10 -p 0 0 30 -P 1 1 3 -solver 0 > periodic.out.60 diff --git a/src/test/TEST_struct/periodic.saved b/src/test/TEST_struct/periodic.saved index 98abb67ae6..dab694fac4 100644 --- a/src/test/TEST_struct/periodic.saved +++ b/src/test/TEST_struct/periodic.saved @@ -61,7 +61,3 @@ 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/src/test/TEST_struct/periodic.saved.florentia b/src/test/TEST_struct/periodic.saved.aurora similarity index 94% rename from src/test/TEST_struct/periodic.saved.florentia rename to src/test/TEST_struct/periodic.saved.aurora index 98abb67ae6..dab694fac4 100644 --- a/src/test/TEST_struct/periodic.saved.florentia +++ b/src/test/TEST_struct/periodic.saved.aurora @@ -61,7 +61,3 @@ 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/src/test/TEST_struct/periodic.saved.lassen b/src/test/TEST_struct/periodic.saved.lassen index 98abb67ae6..dab694fac4 100644 --- a/src/test/TEST_struct/periodic.saved.lassen +++ b/src/test/TEST_struct/periodic.saved.lassen @@ -61,7 +61,3 @@ 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/src/test/TEST_struct/periodic.saved.lassen_cpu b/src/test/TEST_struct/periodic.saved.lassen_cpu index 7873f99247..dab694fac4 100644 --- a/src/test/TEST_struct/periodic.saved.lassen_cpu +++ b/src/test/TEST_struct/periodic.saved.lassen_cpu @@ -61,8 +61,3 @@ 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/src/test/TEST_struct/periodic.saved.tioga b/src/test/TEST_struct/periodic.saved.tioga index 7873f99247..dab694fac4 100644 --- a/src/test/TEST_struct/periodic.saved.tioga +++ b/src/test/TEST_struct/periodic.saved.tioga @@ -61,8 +61,3 @@ 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/src/test/TEST_struct/periodic.sh b/src/test/TEST_struct/periodic.sh index cc0eb18dd7..744910eab5 100755 --- a/src/test/TEST_struct/periodic.sh +++ b/src/test/TEST_struct/periodic.sh @@ -69,7 +69,6 @@ FILES="\ ${TNAME}.out.51\ ${TNAME}.out.52\ ${TNAME}.out.53\ - ${TNAME}.out.60\ " for i in $FILES diff --git a/src/test/TEST_struct/pfmgbase1d.saved.florentia b/src/test/TEST_struct/pfmgbase1d.saved.aurora similarity index 100% rename from src/test/TEST_struct/pfmgbase1d.saved.florentia rename to src/test/TEST_struct/pfmgbase1d.saved.aurora diff --git a/src/test/TEST_struct/pfmgbase2d.saved.florentia b/src/test/TEST_struct/pfmgbase2d.saved.aurora similarity index 100% rename from src/test/TEST_struct/pfmgbase2d.saved.florentia rename to src/test/TEST_struct/pfmgbase2d.saved.aurora diff --git a/src/test/TEST_struct/pfmgbase3d.saved.florentia b/src/test/TEST_struct/pfmgbase3d.saved.aurora similarity index 100% rename from src/test/TEST_struct/pfmgbase3d.saved.florentia rename to src/test/TEST_struct/pfmgbase3d.saved.aurora diff --git a/src/test/TEST_struct/pfmgconstcoeffmp.saved b/src/test/TEST_struct/pfmgconstcoeffmp.saved index 15eade03f5..6daf6dbfd0 100644 --- a/src/test/TEST_struct/pfmgconstcoeffmp.saved +++ b/src/test/TEST_struct/pfmgconstcoeffmp.saved @@ -31,12 +31,12 @@ Iterations = 15 Final Relative Residual Norm = 8.833880e-07 # Output file: pfmgconstcoeffmp.out.30 -Iterations = 200 -Final Relative Residual Norm = 1.095973e+00 +Iterations = 100 +Final Relative Residual Norm = 1.165472e+00 # Output file: pfmgconstcoeffmp.out.31 -Iterations = 200 -Final Relative Residual Norm = 1.095973e+00 +Iterations = 100 +Final Relative Residual Norm = 1.165472e+00 # Output file: pfmgconstcoeffmp.out.32 Iterations = 43 @@ -64,11 +64,11 @@ Final Relative Residual Norm = 8.028630e-07 # Output file: pfmgconstcoeffmp.out.42 Iterations = 16 -Final Relative Residual Norm = 6.371573e-07 +Final Relative Residual Norm = 6.851366e-07 # Output file: pfmgconstcoeffmp.out.43 Iterations = 16 -Final Relative Residual Norm = 6.371573e-07 +Final Relative Residual Norm = 6.851366e-07 # Output file: pfmgconstcoeffmp.out.44 Iterations = 13 diff --git a/src/test/TEST_struct/pfmgconstcoeffmp.saved.florentia b/src/test/TEST_struct/pfmgconstcoeffmp.saved.aurora similarity index 89% rename from src/test/TEST_struct/pfmgconstcoeffmp.saved.florentia rename to src/test/TEST_struct/pfmgconstcoeffmp.saved.aurora index 15eade03f5..6daf6dbfd0 100644 --- a/src/test/TEST_struct/pfmgconstcoeffmp.saved.florentia +++ b/src/test/TEST_struct/pfmgconstcoeffmp.saved.aurora @@ -31,12 +31,12 @@ Iterations = 15 Final Relative Residual Norm = 8.833880e-07 # Output file: pfmgconstcoeffmp.out.30 -Iterations = 200 -Final Relative Residual Norm = 1.095973e+00 +Iterations = 100 +Final Relative Residual Norm = 1.165472e+00 # Output file: pfmgconstcoeffmp.out.31 -Iterations = 200 -Final Relative Residual Norm = 1.095973e+00 +Iterations = 100 +Final Relative Residual Norm = 1.165472e+00 # Output file: pfmgconstcoeffmp.out.32 Iterations = 43 @@ -64,11 +64,11 @@ Final Relative Residual Norm = 8.028630e-07 # Output file: pfmgconstcoeffmp.out.42 Iterations = 16 -Final Relative Residual Norm = 6.371573e-07 +Final Relative Residual Norm = 6.851366e-07 # Output file: pfmgconstcoeffmp.out.43 Iterations = 16 -Final Relative Residual Norm = 6.371573e-07 +Final Relative Residual Norm = 6.851366e-07 # Output file: pfmgconstcoeffmp.out.44 Iterations = 13 diff --git a/src/test/TEST_struct/pfmgconstcoeffmp.saved.lassen b/src/test/TEST_struct/pfmgconstcoeffmp.saved.lassen index 15eade03f5..6daf6dbfd0 100644 --- a/src/test/TEST_struct/pfmgconstcoeffmp.saved.lassen +++ b/src/test/TEST_struct/pfmgconstcoeffmp.saved.lassen @@ -31,12 +31,12 @@ Iterations = 15 Final Relative Residual Norm = 8.833880e-07 # Output file: pfmgconstcoeffmp.out.30 -Iterations = 200 -Final Relative Residual Norm = 1.095973e+00 +Iterations = 100 +Final Relative Residual Norm = 1.165472e+00 # Output file: pfmgconstcoeffmp.out.31 -Iterations = 200 -Final Relative Residual Norm = 1.095973e+00 +Iterations = 100 +Final Relative Residual Norm = 1.165472e+00 # Output file: pfmgconstcoeffmp.out.32 Iterations = 43 @@ -64,11 +64,11 @@ Final Relative Residual Norm = 8.028630e-07 # Output file: pfmgconstcoeffmp.out.42 Iterations = 16 -Final Relative Residual Norm = 6.371573e-07 +Final Relative Residual Norm = 6.851366e-07 # Output file: pfmgconstcoeffmp.out.43 Iterations = 16 -Final Relative Residual Norm = 6.371573e-07 +Final Relative Residual Norm = 6.851366e-07 # Output file: pfmgconstcoeffmp.out.44 Iterations = 13 diff --git a/src/test/TEST_struct/pfmgconstcoeffmp.saved.lassen_cpu b/src/test/TEST_struct/pfmgconstcoeffmp.saved.lassen_cpu index 15eade03f5..6daf6dbfd0 100644 --- a/src/test/TEST_struct/pfmgconstcoeffmp.saved.lassen_cpu +++ b/src/test/TEST_struct/pfmgconstcoeffmp.saved.lassen_cpu @@ -31,12 +31,12 @@ Iterations = 15 Final Relative Residual Norm = 8.833880e-07 # Output file: pfmgconstcoeffmp.out.30 -Iterations = 200 -Final Relative Residual Norm = 1.095973e+00 +Iterations = 100 +Final Relative Residual Norm = 1.165472e+00 # Output file: pfmgconstcoeffmp.out.31 -Iterations = 200 -Final Relative Residual Norm = 1.095973e+00 +Iterations = 100 +Final Relative Residual Norm = 1.165472e+00 # Output file: pfmgconstcoeffmp.out.32 Iterations = 43 @@ -64,11 +64,11 @@ Final Relative Residual Norm = 8.028630e-07 # Output file: pfmgconstcoeffmp.out.42 Iterations = 16 -Final Relative Residual Norm = 6.371573e-07 +Final Relative Residual Norm = 6.851366e-07 # Output file: pfmgconstcoeffmp.out.43 Iterations = 16 -Final Relative Residual Norm = 6.371573e-07 +Final Relative Residual Norm = 6.851366e-07 # Output file: pfmgconstcoeffmp.out.44 Iterations = 13 diff --git a/src/test/TEST_struct/pfmgconstcoeffmp.saved.tioga b/src/test/TEST_struct/pfmgconstcoeffmp.saved.tioga index 15eade03f5..6daf6dbfd0 100644 --- a/src/test/TEST_struct/pfmgconstcoeffmp.saved.tioga +++ b/src/test/TEST_struct/pfmgconstcoeffmp.saved.tioga @@ -31,12 +31,12 @@ Iterations = 15 Final Relative Residual Norm = 8.833880e-07 # Output file: pfmgconstcoeffmp.out.30 -Iterations = 200 -Final Relative Residual Norm = 1.095973e+00 +Iterations = 100 +Final Relative Residual Norm = 1.165472e+00 # Output file: pfmgconstcoeffmp.out.31 -Iterations = 200 -Final Relative Residual Norm = 1.095973e+00 +Iterations = 100 +Final Relative Residual Norm = 1.165472e+00 # Output file: pfmgconstcoeffmp.out.32 Iterations = 43 @@ -64,11 +64,11 @@ Final Relative Residual Norm = 8.028630e-07 # Output file: pfmgconstcoeffmp.out.42 Iterations = 16 -Final Relative Residual Norm = 6.371573e-07 +Final Relative Residual Norm = 6.851366e-07 # Output file: pfmgconstcoeffmp.out.43 Iterations = 16 -Final Relative Residual Norm = 6.371573e-07 +Final Relative Residual Norm = 6.851366e-07 # Output file: pfmgconstcoeffmp.out.44 Iterations = 13 diff --git a/src/test/TEST_struct/pfmgorient.saved.florentia b/src/test/TEST_struct/pfmgorient.saved.aurora similarity index 100% rename from src/test/TEST_struct/pfmgorient.saved.florentia rename to src/test/TEST_struct/pfmgorient.saved.aurora diff --git a/src/test/TEST_struct/pfmgtest1d.saved.florentia b/src/test/TEST_struct/pfmgtest1d.saved.aurora similarity index 100% rename from src/test/TEST_struct/pfmgtest1d.saved.florentia rename to src/test/TEST_struct/pfmgtest1d.saved.aurora diff --git a/src/test/TEST_struct/pfmgvcycle.saved.florentia b/src/test/TEST_struct/pfmgvcycle.saved.aurora similarity index 100% rename from src/test/TEST_struct/pfmgvcycle.saved.florentia rename to src/test/TEST_struct/pfmgvcycle.saved.aurora diff --git a/src/test/TEST_struct/psmgbase3d.saved.florentia b/src/test/TEST_struct/psmgbase3d.saved.aurora similarity index 100% rename from src/test/TEST_struct/psmgbase3d.saved.florentia rename to src/test/TEST_struct/psmgbase3d.saved.aurora diff --git a/src/test/TEST_struct/psmgtest3d.saved.florentia b/src/test/TEST_struct/psmgtest3d.saved.aurora similarity index 100% rename from src/test/TEST_struct/psmgtest3d.saved.florentia rename to src/test/TEST_struct/psmgtest3d.saved.aurora diff --git a/src/test/TEST_struct/smgbase1d.saved.florentia b/src/test/TEST_struct/smgbase1d.saved.aurora similarity index 100% rename from src/test/TEST_struct/smgbase1d.saved.florentia rename to src/test/TEST_struct/smgbase1d.saved.aurora diff --git a/src/test/TEST_struct/smgbase2d.saved.florentia b/src/test/TEST_struct/smgbase2d.saved.aurora similarity index 100% rename from src/test/TEST_struct/smgbase2d.saved.florentia rename to src/test/TEST_struct/smgbase2d.saved.aurora diff --git a/src/test/TEST_struct/smgbase3d.saved.florentia b/src/test/TEST_struct/smgbase3d.saved.aurora similarity index 100% rename from src/test/TEST_struct/smgbase3d.saved.florentia rename to src/test/TEST_struct/smgbase3d.saved.aurora diff --git a/src/test/TEST_struct/smgtest1d.saved.florentia b/src/test/TEST_struct/smgtest1d.saved.aurora similarity index 100% rename from src/test/TEST_struct/smgtest1d.saved.florentia rename to src/test/TEST_struct/smgtest1d.saved.aurora diff --git a/src/test/TEST_struct/smgvcycle.saved.florentia b/src/test/TEST_struct/smgvcycle.saved.aurora similarity index 100% rename from src/test/TEST_struct/smgvcycle.saved.florentia rename to src/test/TEST_struct/smgvcycle.saved.aurora diff --git a/src/test/TEST_struct/solvers.saved.florentia b/src/test/TEST_struct/solvers.saved.aurora similarity index 100% rename from src/test/TEST_struct/solvers.saved.florentia rename to src/test/TEST_struct/solvers.saved.aurora diff --git a/src/test/TEST_struct/vcpfmgRedBlackGS.saved.florentia b/src/test/TEST_struct/vcpfmgRedBlackGS.saved.aurora similarity index 100% rename from src/test/TEST_struct/vcpfmgRedBlackGS.saved.florentia rename to src/test/TEST_struct/vcpfmgRedBlackGS.saved.aurora diff --git a/src/test/TEST_struct/vdpfmgRedBlackGS.saved.florentia b/src/test/TEST_struct/vdpfmgRedBlackGS.saved.aurora similarity index 100% rename from src/test/TEST_struct/vdpfmgRedBlackGS.saved.florentia rename to src/test/TEST_struct/vdpfmgRedBlackGS.saved.aurora diff --git a/src/test/TEST_structmat/structmat.in.2D0 b/src/test/TEST_structmat/structmat.in.2D0 new file mode 100644 index 0000000000..a9557db010 --- /dev/null +++ b/src/test/TEST_structmat/structmat.in.2D0 @@ -0,0 +1,163 @@ +# Copyright (c) 1998 Lawrence Livermore 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 defines the following matrices and vectors: +# +# A(0): 5-pt Laplacian ; constant coefficients +# P(1): 3-pt x-interpolation ; constant coefficients +# R(2): 3-pt x-restriction ; constant coefficients +# P(3): 3-pt y-interpolation ; constant coefficients +# R(4): 3-pt y-restriction ; constant coefficients +# A(5): 5-pt Laplacian ; constant coefficients ; symmetric +# +# x (0): fine grid vector ; value = 1 +# xc(1): x-coarse grid vector ; value = 1 +# xc(2): y-coarse grid vector ; value = 1 +# y (3): fine grid vector ; value = 0 +# yc(4): x-coarse grid vector ; value = 0 +# yc(5): y-coarse grid vector ; value = 0 +# +############################################################################## + +# For this driver, there is only one grid + +# GridCreate: ndim nboxes +GridCreate: 2 1 + +# GridSetExtents: boxnum ilower(ndim) iupper(ndim) +GridSetExtents: 0 (0 0) (0 0) + +# GridSetPeriodic: periodic(ndim) +GridSetPeriodic: (1 0) + +########################################################### + +# Matrix: nmatrices +Matrix: 6 + +##### Matrix A (0) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 0 5 (1 1) (1 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 0 0 ( 0 0) 4.0 +MatrixSetCoeff: 0 1 (-1 0) -1.0 +MatrixSetCoeff: 0 2 ( 1 0) -1.0 +MatrixSetCoeff: 0 3 ( 0 -1) -1.0 +MatrixSetCoeff: 0 4 ( 0 1) -1.0 + +# MatrixSetConstant: matnum nentries entries(nentries) +MatrixSetConstant: 0 5 (0 1 2 3 4) + +# MatrixSetSymmetric: matnum symmetric +MatrixSetSymmetric: 0 0 + +##### Matrix P (1) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 1 3 (1 1) (2 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 1 0 ( 0 0) 1.0 +MatrixSetCoeff: 1 1 (-1 0) 0.5 +MatrixSetCoeff: 1 2 ( 1 0) 0.5 + +# MatrixSetConstant: matnum nentries entries(nentries) +MatrixSetConstant: 1 3 (0 1 2) + +##### Matrix R (2) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 2 3 (2 1) (1 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 2 0 ( 0 0) 1.0 +MatrixSetCoeff: 2 1 (-1 0) 0.5 +MatrixSetCoeff: 2 2 ( 1 0) 0.5 + +# MatrixSetConstant: matnum nentries entries(nentries) +MatrixSetConstant: 2 3 (0 1 2) + +##### Matrix P (3) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 3 3 (1 1) (1 2) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 3 0 ( 0 0) 1.0 +MatrixSetCoeff: 3 1 ( 0 -1) 0.5 +MatrixSetCoeff: 3 2 ( 0 1) 0.5 + +# MatrixSetConstant: matnum nentries entries(nentries) +MatrixSetConstant: 3 3 (0 1 2) + +##### Matrix R (4) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 4 3 (1 2) (1 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 4 0 ( 0 0) 1.0 +MatrixSetCoeff: 4 1 ( 0 -1) 0.5 +MatrixSetCoeff: 4 2 ( 0 1) 0.5 + +# MatrixSetConstant: matnum nentries entries(nentries) +MatrixSetConstant: 4 3 (0 1 2) + +##### Matrix A (5) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 5 4 (1 1) (1 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 5 0 ( 0 0) 4.0 +MatrixSetCoeff: 5 1 (-1 0) -1.0 +MatrixSetCoeff: 5 2 ( 1 0) -1.0 +MatrixSetCoeff: 5 3 ( 0 -1) -1.0 +#MatrixSetCoeff: 5 4 ( 0 1) -1.0 # Note subset of full stencil + +# MatrixSetConstant: matnum nentries entries(nentries) +MatrixSetConstant: 5 4 (0 1 2 3) # Note subset of full stencil + +# MatrixSetSymmetric: matnum symmetric +MatrixSetSymmetric: 5 1 + +########################################################### + +# Vector: nvectors +Vector: 6 + +##### Vector x (0) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 0 (1 1) 1.0 + +##### Vector xc (1) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 1 (2 1) 1.0 + +##### Vector xc (2) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 2 (1 2) 1.0 + +##### Vector y (3) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 3 (1 1) 0.0 + +##### Vector yc (4) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 4 (2 1) 0.0 + +##### Vector yc (5) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 5 (1 2) 0.0 diff --git a/src/test/TEST_structmat/structmat.in.2D1 b/src/test/TEST_structmat/structmat.in.2D1 new file mode 100644 index 0000000000..60b3d31ba8 --- /dev/null +++ b/src/test/TEST_structmat/structmat.in.2D1 @@ -0,0 +1,163 @@ +# Copyright (c) 1998 Lawrence Livermore 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 defines the following matrices and vectors: +# +# A(0): 5-pt Laplacian ; variable coefficients +# P(1): 3-pt x-interpolation ; variable coefficients +# R(2): 3-pt x-restriction ; variable coefficients +# P(3): 3-pt y-interpolation ; variable coefficients +# R(4): 3-pt y-restriction ; variable coefficients +# A(5): 5-pt Laplacian ; variable coefficients ; symmetric +# +# x (0): fine grid vector ; value = 1 +# xc(1): x-coarse grid vector ; value = 1 +# xc(2): y-coarse grid vector ; value = 1 +# y (3): fine grid vector ; value = 0 +# yc(4): x-coarse grid vector ; value = 0 +# yc(5): y-coarse grid vector ; value = 0 +# +############################################################################## + +# For this driver, there is only one grid + +# GridCreate: ndim nboxes +GridCreate: 2 1 + +# GridSetExtents: boxnum ilower(ndim) iupper(ndim) +GridSetExtents: 0 (0 0) (0 0) + +# GridSetPeriodic: periodic(ndim) +GridSetPeriodic: (1 0) + +########################################################### + +# Matrix: nmatrices +Matrix: 6 + +##### Matrix A (0) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 0 5 (1 1) (1 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 0 0 ( 0 0) 4.0 +MatrixSetCoeff: 0 1 (-1 0) -1.0 +MatrixSetCoeff: 0 2 ( 1 0) -1.0 +MatrixSetCoeff: 0 3 ( 0 -1) -1.0 +MatrixSetCoeff: 0 4 ( 0 1) -1.0 + +# MatrixSetConstant: matnum nentries entries(nentries) +#MatrixSetConstant: 0 5 (0 1 2 3 4) + +# MatrixSetSymmetric: matnum symmetric +MatrixSetSymmetric: 0 0 + +##### Matrix P (1) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 1 3 (1 1) (2 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 1 0 ( 0 0) 1.0 +MatrixSetCoeff: 1 1 (-1 0) 0.5 +MatrixSetCoeff: 1 2 ( 1 0) 0.5 + +# MatrixSetConstant: matnum nentries entries(nentries) +#MatrixSetConstant: 1 3 (0 1 2) + +##### Matrix R (2) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 2 3 (2 1) (1 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 2 0 ( 0 0) 1.0 +MatrixSetCoeff: 2 1 (-1 0) 0.5 +MatrixSetCoeff: 2 2 ( 1 0) 0.5 + +# MatrixSetConstant: matnum nentries entries(nentries) +#MatrixSetConstant: 2 3 (0 1 2) + +##### Matrix P (3) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 3 3 (1 1) (1 2) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 3 0 ( 0 0) 1.0 +MatrixSetCoeff: 3 1 ( 0 -1) 0.5 +MatrixSetCoeff: 3 2 ( 0 1) 0.5 + +# MatrixSetConstant: matnum nentries entries(nentries) +#MatrixSetConstant: 3 3 (0 1 2) + +##### Matrix R (4) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 4 3 (1 2) (1 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 4 0 ( 0 0) 1.0 +MatrixSetCoeff: 4 1 ( 0 -1) 0.5 +MatrixSetCoeff: 4 2 ( 0 1) 0.5 + +# MatrixSetConstant: matnum nentries entries(nentries) +#MatrixSetConstant: 4 3 (0 1 2) + +##### Matrix A (5) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 5 4 (1 1) (1 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 5 0 ( 0 0) 4.0 +MatrixSetCoeff: 5 1 (-1 0) -1.0 +MatrixSetCoeff: 5 2 ( 1 0) -1.0 +MatrixSetCoeff: 5 3 ( 0 -1) -1.0 +#MatrixSetCoeff: 5 4 ( 0 1) -1.0 # Note subset of full stencil + +# MatrixSetConstant: matnum nentries entries(nentries) +#MatrixSetConstant: 5 4 (0 1 2 3) # Note subset of full stencil + +# MatrixSetSymmetric: matnum symmetric +MatrixSetSymmetric: 5 1 + +########################################################### + +# Vector: nvectors +Vector: 6 + +##### Vector x (0) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 0 (1 1) 1.0 + +##### Vector xc (1) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 1 (2 1) 1.0 + +##### Vector xc (2) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 2 (1 2) 1.0 + +##### Vector y (3) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 3 (1 1) 0.0 + +##### Vector yc (4) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 4 (2 1) 0.0 + +##### Vector yc (5) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 5 (1 2) 0.0 diff --git a/src/test/TEST_structmat/structmat.in.2D2 b/src/test/TEST_structmat/structmat.in.2D2 new file mode 100644 index 0000000000..beaf6b5df8 --- /dev/null +++ b/src/test/TEST_structmat/structmat.in.2D2 @@ -0,0 +1,163 @@ +# Copyright (c) 1998 Lawrence Livermore 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 defines the following matrices and vectors: +# +# A(0): 5-pt Laplacian ; variable coefficients +# P(1): 3-pt x-interpolation ; constant coefficients +# R(2): 3-pt x-restriction ; constant coefficients +# P(3): 3-pt y-interpolation ; constant coefficients +# R(4): 3-pt y-restriction ; constant coefficients +# A(5): 5-pt Laplacian ; variable coefficients ; symmetric +# +# x (0): fine grid vector ; value = 1 +# xc(1): x-coarse grid vector ; value = 1 +# xc(2): y-coarse grid vector ; value = 1 +# y (3): fine grid vector ; value = 0 +# yc(4): x-coarse grid vector ; value = 0 +# yc(5): y-coarse grid vector ; value = 0 +# +############################################################################## + +# For this driver, there is only one grid + +# GridCreate: ndim nboxes +GridCreate: 2 1 + +# GridSetExtents: boxnum ilower(ndim) iupper(ndim) +GridSetExtents: 0 (0 0) (0 0) + +# GridSetPeriodic: periodic(ndim) +GridSetPeriodic: (1 0) + +########################################################### + +# Matrix: nmatrices +Matrix: 6 + +##### Matrix A (0) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 0 5 (1 1) (1 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 0 0 ( 0 0) 4.0 +MatrixSetCoeff: 0 1 (-1 0) -1.0 +MatrixSetCoeff: 0 2 ( 1 0) -1.0 +MatrixSetCoeff: 0 3 ( 0 -1) -1.0 +MatrixSetCoeff: 0 4 ( 0 1) -1.0 + +# MatrixSetConstant: matnum nentries entries(nentries) +#MatrixSetConstant: 0 5 (0 1 2 3 4) + +# MatrixSetSymmetric: matnum symmetric +MatrixSetSymmetric: 0 0 + +##### Matrix P (1) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 1 3 (1 1) (2 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 1 0 ( 0 0) 1.0 +MatrixSetCoeff: 1 1 (-1 0) 0.5 +MatrixSetCoeff: 1 2 ( 1 0) 0.5 + +# MatrixSetConstant: matnum nentries entries(nentries) +MatrixSetConstant: 1 3 (0 1 2) + +##### Matrix R (2) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 2 3 (2 1) (1 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 2 0 ( 0 0) 1.0 +MatrixSetCoeff: 2 1 (-1 0) 0.5 +MatrixSetCoeff: 2 2 ( 1 0) 0.5 + +# MatrixSetConstant: matnum nentries entries(nentries) +MatrixSetConstant: 2 3 (0 1 2) + +##### Matrix P (3) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 3 3 (1 1) (1 2) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 3 0 ( 0 0) 1.0 +MatrixSetCoeff: 3 1 ( 0 -1) 0.5 +MatrixSetCoeff: 3 2 ( 0 1) 0.5 + +# MatrixSetConstant: matnum nentries entries(nentries) +MatrixSetConstant: 3 3 (0 1 2) + +##### Matrix R (4) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 4 3 (1 2) (1 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 4 0 ( 0 0) 1.0 +MatrixSetCoeff: 4 1 ( 0 -1) 0.5 +MatrixSetCoeff: 4 2 ( 0 1) 0.5 + +# MatrixSetConstant: matnum nentries entries(nentries) +MatrixSetConstant: 4 3 (0 1 2) + +##### Matrix A (5) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 5 4 (1 1) (1 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 5 0 ( 0 0) 4.0 +MatrixSetCoeff: 5 1 (-1 0) -1.0 +MatrixSetCoeff: 5 2 ( 1 0) -1.0 +MatrixSetCoeff: 5 3 ( 0 -1) -1.0 +#MatrixSetCoeff: 5 4 ( 0 1) -1.0 # Note subset of full stencil + +# MatrixSetConstant: matnum nentries entries(nentries) +#MatrixSetConstant: 5 4 (0 1 2 3) # Note subset of full stencil + +# MatrixSetSymmetric: matnum symmetric +MatrixSetSymmetric: 5 1 + +########################################################### + +# Vector: nvectors +Vector: 6 + +##### Vector x (0) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 0 (1 1) 1.0 + +##### Vector xc (1) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 1 (2 1) 1.0 + +##### Vector xc (2) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 2 (1 2) 1.0 + +##### Vector y (3) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 3 (1 1) 0.0 + +##### Vector yc (4) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 4 (2 1) 0.0 + +##### Vector yc (5) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 5 (1 2) 0.0 diff --git a/src/test/TEST_structmat/structmat.in.2D3 b/src/test/TEST_structmat/structmat.in.2D3 new file mode 100644 index 0000000000..fe76eee16e --- /dev/null +++ b/src/test/TEST_structmat/structmat.in.2D3 @@ -0,0 +1,163 @@ +# Copyright (c) 1998 Lawrence Livermore 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 defines the following matrices and vectors: +# +# A(0): 5-pt Laplacian ; variable diagonal +# P(1): 3-pt x-interpolation ; constant coefficients +# R(2): 3-pt x-restriction ; constant coefficients +# P(3): 3-pt y-interpolation ; constant coefficients +# R(4): 3-pt y-restriction ; constant coefficients +# A(5): 5-pt Laplacian ; variable diagonal ; symmetric +# +# x (0): fine grid vector ; value = 1 +# xc(1): x-coarse grid vector ; value = 1 +# xc(2): y-coarse grid vector ; value = 1 +# y (3): fine grid vector ; value = 0 +# yc(4): x-coarse grid vector ; value = 0 +# yc(5): y-coarse grid vector ; value = 0 +# +############################################################################## + +# For this driver, there is only one grid + +# GridCreate: ndim nboxes +GridCreate: 2 1 + +# GridSetExtents: boxnum ilower(ndim) iupper(ndim) +GridSetExtents: 0 (0 0) (0 0) + +# GridSetPeriodic: periodic(ndim) +GridSetPeriodic: (1 0) + +########################################################### + +# Matrix: nmatrices +Matrix: 6 + +##### Matrix A (0) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 0 5 (1 1) (1 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 0 0 ( 0 0) 4.0 +MatrixSetCoeff: 0 1 (-1 0) -1.0 +MatrixSetCoeff: 0 2 ( 1 0) -1.0 +MatrixSetCoeff: 0 3 ( 0 -1) -1.0 +MatrixSetCoeff: 0 4 ( 0 1) -1.0 + +# MatrixSetConstant: matnum nentries entries(nentries) +MatrixSetConstant: 0 4 (1 2 3 4) + +# MatrixSetSymmetric: matnum symmetric +MatrixSetSymmetric: 0 0 + +##### Matrix P (1) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 1 3 (1 1) (2 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 1 0 ( 0 0) 1.0 +MatrixSetCoeff: 1 1 (-1 0) 0.5 +MatrixSetCoeff: 1 2 ( 1 0) 0.5 + +# MatrixSetConstant: matnum nentries entries(nentries) +MatrixSetConstant: 1 3 (0 1 2) + +##### Matrix R (2) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 2 3 (2 1) (1 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 2 0 ( 0 0) 1.0 +MatrixSetCoeff: 2 1 (-1 0) 0.5 +MatrixSetCoeff: 2 2 ( 1 0) 0.5 + +# MatrixSetConstant: matnum nentries entries(nentries) +MatrixSetConstant: 2 3 (0 1 2) + +##### Matrix P (3) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 3 3 (1 1) (1 2) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 3 0 ( 0 0) 1.0 +MatrixSetCoeff: 3 1 ( 0 -1) 0.5 +MatrixSetCoeff: 3 2 ( 0 1) 0.5 + +# MatrixSetConstant: matnum nentries entries(nentries) +MatrixSetConstant: 3 3 (0 1 2) + +##### Matrix R (4) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 4 3 (1 2) (1 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 4 0 ( 0 0) 1.0 +MatrixSetCoeff: 4 1 ( 0 -1) 0.5 +MatrixSetCoeff: 4 2 ( 0 1) 0.5 + +# MatrixSetConstant: matnum nentries entries(nentries) +MatrixSetConstant: 4 3 (0 1 2) + +##### Matrix A (5) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 5 4 (1 1) (1 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 5 0 ( 0 0) 4.0 +MatrixSetCoeff: 5 1 (-1 0) -1.0 +MatrixSetCoeff: 5 2 ( 1 0) -1.0 +MatrixSetCoeff: 5 3 ( 0 -1) -1.0 +#MatrixSetCoeff: 5 4 ( 0 1) -1.0 # Note subset of full stencil + +# MatrixSetConstant: matnum nentries entries(nentries) +MatrixSetConstant: 5 3 (1 2 3) # Note subset of full stencil + +# MatrixSetSymmetric: matnum symmetric +MatrixSetSymmetric: 5 1 + +########################################################### + +# Vector: nvectors +Vector: 6 + +##### Vector x (0) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 0 (1 1) 1.0 + +##### Vector xc (1) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 1 (2 1) 1.0 + +##### Vector xc (2) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 2 (1 2) 1.0 + +##### Vector y (3) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 3 (1 1) 0.0 + +##### Vector yc (4) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 4 (2 1) 0.0 + +##### Vector yc (5) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 5 (1 2) 0.0 diff --git a/src/test/TEST_structmat/structmat.in.3D1 b/src/test/TEST_structmat/structmat.in.3D1 new file mode 100644 index 0000000000..e296cdabb1 --- /dev/null +++ b/src/test/TEST_structmat/structmat.in.3D1 @@ -0,0 +1,146 @@ +# Copyright (c) 1998 Lawrence Livermore 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 defines the following matrices and vectors: +# +# A(0): 7-pt Laplacian ; variable coefficients +# P(1): 3-pt x-interpolation ; variable coefficients +# R(2): 3-pt x-restriction ; variable coefficients +# P(3): 3-pt y-interpolation ; variable coefficients +# R(4): 3-pt y-restriction ; variable coefficients +# A(5): 7-pt Laplacian ; variable coefficients ; symmetric +# +# x (0): fine grid vector ; value = 1 +# xc(1): x-coarse grid vector ; value = 1 +# xc(2): y-coarse grid vector ; value = 1 +# y (3): fine grid vector ; value = 0 +# yc(4): x-coarse grid vector ; value = 0 +# yc(5): y-coarse grid vector ; value = 0 +# +############################################################################## + +# For this driver, there is only one grid + +# GridCreate: ndim nboxes +GridCreate: 3 1 + +# GridSetExtents: boxnum ilower(ndim) iupper(ndim) +GridSetExtents: 0 (0 0 0) (1 1 1) + +########################################################### + +# Matrix: nmatrices +Matrix: 6 + +##### Matrix A (0) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 0 7 (1 1 1) (1 1 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 0 0 ( 0 0 0) 6.0 +MatrixSetCoeff: 0 1 (-1 0 0) -1.0 +MatrixSetCoeff: 0 2 ( 1 0 0) -1.0 +MatrixSetCoeff: 0 3 ( 0 -1 0) -1.0 +MatrixSetCoeff: 0 4 ( 0 1 0) -1.0 +MatrixSetCoeff: 0 5 ( 0 0 -1) -1.0 +MatrixSetCoeff: 0 6 ( 0 0 1) -1.0 + +# MatrixSetSymmetric: matnum symmetric +MatrixSetSymmetric: 0 0 + +##### Matrix P (1) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 1 3 (1 1 1) (2 1 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 1 0 ( 0 0 0) 1.0 +MatrixSetCoeff: 1 1 (-1 0 0) 0.5 +MatrixSetCoeff: 1 2 ( 1 0 0) 0.5 + +##### Matrix R (2) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 2 3 (2 1 1) (1 1 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 2 0 ( 0 0 0) 1.0 +MatrixSetCoeff: 2 1 (-1 0 0) 0.5 +MatrixSetCoeff: 2 2 ( 1 0 0) 0.5 + +##### Matrix P (3) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 3 3 (1 1 1) (1 2 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 3 0 ( 0 0 0) 1.0 +MatrixSetCoeff: 3 1 ( 0 -1 0) 0.5 +MatrixSetCoeff: 3 2 ( 0 1 0) 0.5 + +##### Matrix R (4) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 4 3 (1 2 1) (1 1 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 4 0 ( 0 0 0) 1.0 +MatrixSetCoeff: 4 1 ( 0 -1 0) 0.5 +MatrixSetCoeff: 4 2 ( 0 1 0) 0.5 + +##### Matrix A (5) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 5 6 (1 1 1) (1 1 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 5 0 ( 0 0 0) 6.0 +MatrixSetCoeff: 5 1 (-1 0 0) -1.0 +MatrixSetCoeff: 5 2 ( 1 0 0) -1.0 +MatrixSetCoeff: 5 3 ( 0 -1 0) -1.0 +MatrixSetCoeff: 5 4 ( 0 1 0) -1.0 +MatrixSetCoeff: 5 5 ( 0 0 -1) -1.0 +#MatrixSetCoeff: 5 6 ( 0 0 1) -1.0 # Note subset of full stencil + +# MatrixSetSymmetric: matnum symmetric +MatrixSetSymmetric: 5 1 + +########################################################### + +# Vector: nvectors +Vector: 6 + +##### Vector x (0) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 0 (1 1 1) 1.0 + +##### Vector xc (1) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 1 (2 1 1) 1.0 + +##### Vector xc (2) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 2 (1 2 1) 1.0 + +##### Vector y (3) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 3 (1 1 1) 0.0 + +##### Vector yc (4) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 4 (2 1 1) 0.0 + +##### Vector yc (5) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 5 (1 2 1) 0.0 diff --git a/src/test/TEST_structmat/structmat.jobs b/src/test/TEST_structmat/structmat.jobs new file mode 100755 index 0000000000..a4eea3c1de --- /dev/null +++ b/src/test/TEST_structmat/structmat.jobs @@ -0,0 +1,243 @@ +#!/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) + +#============================================================================= +# 2D one proc RAP +#============================================================================= + +# interpolate in x direction +mpirun -np 1 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.x -mat-mat 3 1T 0 1 -r 10 10 > structmat.out.2D0.x +mpirun -np 1 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.x -mat-mat 3 1T 0 1 -r 10 10 > structmat.out.2D1.x +mpirun -np 1 ./structmat -in structmat.in.2D2 -out structmat.out.2D2.x -mat-mat 3 1T 0 1 -r 10 10 > structmat.out.2D2.x +mpirun -np 1 ./structmat -in structmat.in.2D3 -out structmat.out.2D3.x -mat-mat 3 1T 0 1 -r 10 10 > structmat.out.2D3.x + +# interpolate in y direction +mpirun -np 1 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.y -mat-mat 3 3T 0 3 -r 10 10 > structmat.out.2D0.y +mpirun -np 1 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.y -mat-mat 3 3T 0 3 -r 10 10 > structmat.out.2D1.y +mpirun -np 1 ./structmat -in structmat.in.2D2 -out structmat.out.2D2.y -mat-mat 3 3T 0 3 -r 10 10 > structmat.out.2D2.y +mpirun -np 1 ./structmat -in structmat.in.2D3 -out structmat.out.2D3.y -mat-mat 3 3T 0 3 -r 10 10 > structmat.out.2D3.y + +#============================================================================= +# 2D four procs RAP +#============================================================================= + +# interpolate in x direction +mpirun -np 4 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.x.4 -mat-mat 3 1T 0 1 -r 5 5 -P 2 2 > structmat.out.2D0.x.4 +mpirun -np 4 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.x.4 -mat-mat 3 1T 0 1 -r 5 5 -P 2 2 > structmat.out.2D1.x.4 +mpirun -np 4 ./structmat -in structmat.in.2D2 -out structmat.out.2D2.x.4 -mat-mat 3 1T 0 1 -r 5 5 -P 2 2 > structmat.out.2D2.x.4 +mpirun -np 4 ./structmat -in structmat.in.2D3 -out structmat.out.2D3.x.4 -mat-mat 3 1T 0 1 -r 5 5 -P 2 2 > structmat.out.2D3.x.4 + +# interpolate in y direction +mpirun -np 4 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.y.4 -mat-mat 3 3T 0 3 -r 5 5 -P 2 2 > structmat.out.2D0.y.4 +mpirun -np 4 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.y.4 -mat-mat 3 3T 0 3 -r 5 5 -P 2 2 > structmat.out.2D1.y.4 +mpirun -np 4 ./structmat -in structmat.in.2D2 -out structmat.out.2D2.y.4 -mat-mat 3 3T 0 3 -r 5 5 -P 2 2 > structmat.out.2D2.y.4 +mpirun -np 4 ./structmat -in structmat.in.2D3 -out structmat.out.2D3.y.4 -mat-mat 3 3T 0 3 -r 5 5 -P 2 2 > structmat.out.2D3.y.4 + +#============================================================================= +# 2D idle procs RAP +#============================================================================= + +mpirun -np 1 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.xidle -mat-mat 3 1T 0 1 -r 4 4 -P 1 1 > structmat.out.2D1.xidle +mpirun -np 4 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.xidle.4 -mat-mat 3 1T 0 1 -r 1 4 -P 4 1 > structmat.out.2D1.xidle.4 +mpirun -np 1 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.yidle -mat-mat 3 3T 0 3 -r 4 5 -P 1 1 > structmat.out.2D1.yidle +mpirun -np 5 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.yidle.5 -mat-mat 3 3T 0 3 -r 4 1 -P 1 5 > structmat.out.2D1.yidle.5 + +#============================================================================= +# 2D one proc RA and AP (to test the print routine) +#============================================================================= + +# RA (interpolate in x direction) +mpirun -np 1 ./structmat -in structmat.in.2D3 -out structmat.out.2D3.x.RA -mat-mat 2 1T 0 -r 10 10 > structmat.out.2D3.x.RA +# AP (interpolate in x direction) +mpirun -np 1 ./structmat -in structmat.in.2D3 -out structmat.out.2D3.x.AP -mat-mat 2 0 1 -r 10 10 > structmat.out.2D3.x.AP + +#============================================================================= +# 2D one proc Matvec +#============================================================================= + +# all constant coefficients +mpirun -np 1 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mv0 -mat-vec 0 0 3 -r 10 10 > structmat.out.2D0.mv0 +mpirun -np 1 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mv1 -mat-vec 1 1 3 -r 10 10 > structmat.out.2D0.mv1 +mpirun -np 1 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mv2 -mat-vec 2 0 4 -r 10 10 > structmat.out.2D0.mv2 +mpirun -np 1 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mv3 -mat-vec 3 2 3 -r 10 10 > structmat.out.2D0.mv3 +mpirun -np 1 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mv4 -mat-vec 4 0 5 -r 10 10 > structmat.out.2D0.mv4 + +# all variable coefficients +mpirun -np 1 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mv0 -mat-vec 0 0 3 -r 10 10 > structmat.out.2D1.mv0 +mpirun -np 1 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mv1 -mat-vec 1 1 3 -r 10 10 > structmat.out.2D1.mv1 +mpirun -np 1 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mv2 -mat-vec 2 0 4 -r 10 10 > structmat.out.2D1.mv2 +mpirun -np 1 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mv3 -mat-vec 3 2 3 -r 10 10 > structmat.out.2D1.mv3 +mpirun -np 1 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mv4 -mat-vec 4 0 5 -r 10 10 > structmat.out.2D1.mv4 + +# variable diagonal +mpirun -np 1 ./structmat -in structmat.in.2D3 -out structmat.out.2D3.mv0 -mat-vec 0 0 3 -r 10 10 > structmat.out.2D3.mv0 + +# Test x==y and beta=0 by comparing to results above +mpirun -np 1 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mv0.zzz -mat-vec 0 0 0 -r 10 10 -ab 1 0 > structmat.out.2D0.mv0.zzz +mpirun -np 1 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mv1.zzz -mat-vec 1 1 0 -r 10 10 -ab 1 0 > structmat.out.2D0.mv1.zzz +mpirun -np 1 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mv2.zzz -mat-vec 2 0 1 -r 10 10 -ab 1 0 > structmat.out.2D0.mv2.zzz +mpirun -np 1 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mv0.zzz -mat-vec 0 0 0 -r 10 10 -ab 1 0 > structmat.out.2D1.mv0.zzz +mpirun -np 1 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mv1.zzz -mat-vec 1 1 0 -r 10 10 -ab 1 0 > structmat.out.2D1.mv1.zzz +mpirun -np 1 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mv2.zzz -mat-vec 2 0 1 -r 10 10 -ab 1 0 > structmat.out.2D1.mv2.zzz +mpirun -np 1 ./structmat -in structmat.in.2D3 -out structmat.out.2D3.mv0.zzz -mat-vec 0 0 0 -r 10 10 -ab 1 0 > structmat.out.2D3.mv0.zzz + +#============================================================================= +# 2D four procs Matvec +#============================================================================= + +# all constant coefficients +mpirun -np 4 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mv0.4 -mat-vec 0 0 3 -r 5 5 -P 2 2 > structmat.out.2D0.mv0.4 +mpirun -np 4 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mv1.4 -mat-vec 1 1 3 -r 5 5 -P 2 2 > structmat.out.2D0.mv1.4 +mpirun -np 4 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mv2.4 -mat-vec 2 0 4 -r 5 5 -P 2 2 > structmat.out.2D0.mv2.4 +mpirun -np 4 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mv3.4 -mat-vec 3 2 3 -r 5 5 -P 2 2 > structmat.out.2D0.mv3.4 +mpirun -np 4 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mv4.4 -mat-vec 4 0 5 -r 5 5 -P 2 2 > structmat.out.2D0.mv4.4 + +# all variable coefficients +mpirun -np 4 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mv0.4 -mat-vec 0 0 3 -r 5 5 -P 2 2 > structmat.out.2D1.mv0.4 +mpirun -np 4 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mv1.4 -mat-vec 1 1 3 -r 5 5 -P 2 2 > structmat.out.2D1.mv1.4 +mpirun -np 4 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mv2.4 -mat-vec 2 0 4 -r 5 5 -P 2 2 > structmat.out.2D1.mv2.4 +mpirun -np 4 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mv3.4 -mat-vec 3 2 3 -r 5 5 -P 2 2 > structmat.out.2D1.mv3.4 +mpirun -np 4 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mv4.4 -mat-vec 4 0 5 -r 5 5 -P 2 2 > structmat.out.2D1.mv4.4 + +# variable diagonal +mpirun -np 4 ./structmat -in structmat.in.2D3 -out structmat.out.2D3.mv0.4 -mat-vec 0 0 3 -r 5 5 -P 2 2 > structmat.out.2D3.mv0.4 + +# Test x==y and beta=0 by comparing to results above +mpirun -np 4 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mv0.4.zzz -mat-vec 0 0 0 -r 5 5 -P 2 2 -ab 1 0 > structmat.out.2D0.mv0.4.zzz +mpirun -np 4 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mv1.4.zzz -mat-vec 1 1 0 -r 5 5 -P 2 2 -ab 1 0 > structmat.out.2D0.mv1.4.zzz +mpirun -np 4 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mv2.4.zzz -mat-vec 2 0 1 -r 5 5 -P 2 2 -ab 1 0 > structmat.out.2D0.mv2.4.zzz +mpirun -np 4 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mv0.4.zzz -mat-vec 0 0 0 -r 5 5 -P 2 2 -ab 1 0 > structmat.out.2D1.mv0.4.zzz +mpirun -np 4 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mv1.4.zzz -mat-vec 1 1 0 -r 5 5 -P 2 2 -ab 1 0 > structmat.out.2D1.mv1.4.zzz +mpirun -np 4 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mv2.4.zzz -mat-vec 2 0 1 -r 5 5 -P 2 2 -ab 1 0 > structmat.out.2D1.mv2.4.zzz +mpirun -np 4 ./structmat -in structmat.in.2D3 -out structmat.out.2D3.mv0.4.zzz -mat-vec 0 0 0 -r 5 5 -P 2 2 -ab 1 0 > structmat.out.2D3.mv0.4.zzz + +#============================================================================= +# 2D one proc MatvecT +#============================================================================= + +# all constant coefficients +mpirun -np 1 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mvT0 -matTvec 0 0 3 -r 10 10 > structmat.out.2D0.mvT0 +mpirun -np 1 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mvT1 -matTvec 2 1 3 -r 10 10 > structmat.out.2D0.mvT1 +mpirun -np 1 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mvT2 -matTvec 1 0 4 -r 10 10 > structmat.out.2D0.mvT2 +mpirun -np 1 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mvT3 -matTvec 4 2 3 -r 10 10 > structmat.out.2D0.mvT3 +mpirun -np 1 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mvT4 -matTvec 3 0 5 -r 10 10 > structmat.out.2D0.mvT4 + +# all variable coefficients +mpirun -np 1 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mvT0 -matTvec 0 0 3 -r 10 10 > structmat.out.2D1.mvT0 +mpirun -np 1 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mvT1 -matTvec 2 1 3 -r 10 10 > structmat.out.2D1.mvT1 +mpirun -np 1 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mvT2 -matTvec 1 0 4 -r 10 10 > structmat.out.2D1.mvT2 +mpirun -np 1 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mvT3 -matTvec 4 2 3 -r 10 10 > structmat.out.2D1.mvT3 +mpirun -np 1 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mvT4 -matTvec 3 0 5 -r 10 10 > structmat.out.2D1.mvT4 + +# variable diagonal +mpirun -np 1 ./structmat -in structmat.in.2D3 -out structmat.out.2D3.mvT0 -matTvec 0 0 3 -r 10 10 > structmat.out.2D3.mvT0 + +# Test x==y and beta=0 by comparing to results above +mpirun -np 1 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mvT0.zzz -matTvec 0 0 0 -r 10 10 -ab 1 0 > structmat.out.2D0.mvT0.zzz +mpirun -np 1 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mvT1.zzz -matTvec 2 1 0 -r 10 10 -ab 1 0 > structmat.out.2D0.mvT1.zzz +mpirun -np 1 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mvT2.zzz -matTvec 1 0 1 -r 10 10 -ab 1 0 > structmat.out.2D0.mvT2.zzz +mpirun -np 1 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mvT0.zzz -matTvec 0 0 0 -r 10 10 -ab 1 0 > structmat.out.2D1.mvT0.zzz +mpirun -np 1 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mvT1.zzz -matTvec 2 1 0 -r 10 10 -ab 1 0 > structmat.out.2D1.mvT1.zzz +mpirun -np 1 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mvT2.zzz -matTvec 1 0 1 -r 10 10 -ab 1 0 > structmat.out.2D1.mvT2.zzz +mpirun -np 1 ./structmat -in structmat.in.2D3 -out structmat.out.2D3.mvT0.zzz -matTvec 0 0 0 -r 10 10 -ab 1 0 > structmat.out.2D3.mvT0.zzz + +#============================================================================= +# 2D four procs MatvecT +#============================================================================= + +# all constant coefficients +mpirun -np 4 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mvT0.4 -matTvec 0 0 3 -r 5 5 -P 2 2 > structmat.out.2D0.mvT0.4 +mpirun -np 4 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mvT1.4 -matTvec 2 1 3 -r 5 5 -P 2 2 > structmat.out.2D0.mvT1.4 +mpirun -np 4 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mvT2.4 -matTvec 1 0 4 -r 5 5 -P 2 2 > structmat.out.2D0.mvT2.4 +mpirun -np 4 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mvT3.4 -matTvec 4 2 3 -r 5 5 -P 2 2 > structmat.out.2D0.mvT3.4 +mpirun -np 4 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mvT4.4 -matTvec 3 0 5 -r 5 5 -P 2 2 > structmat.out.2D0.mvT4.4 + +# all variable coefficients +mpirun -np 4 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mvT0.4 -matTvec 0 0 3 -r 5 5 -P 2 2 > structmat.out.2D1.mvT0.4 +mpirun -np 4 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mvT1.4 -matTvec 2 1 3 -r 5 5 -P 2 2 > structmat.out.2D1.mvT1.4 +mpirun -np 4 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mvT2.4 -matTvec 1 0 4 -r 5 5 -P 2 2 > structmat.out.2D1.mvT2.4 +mpirun -np 4 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mvT3.4 -matTvec 4 2 3 -r 5 5 -P 2 2 > structmat.out.2D1.mvT3.4 +mpirun -np 4 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mvT4.4 -matTvec 3 0 5 -r 5 5 -P 2 2 > structmat.out.2D1.mvT4.4 + +# variable diagonal +mpirun -np 4 ./structmat -in structmat.in.2D3 -out structmat.out.2D3.mvT0.4 -matTvec 0 0 3 -r 5 5 -P 2 2 > structmat.out.2D3.mvT0.4 + +# Test x==y and beta=0 by comparing to results above +mpirun -np 4 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mvT0.4.zzz -matTvec 0 0 0 -r 5 5 -P 2 2 -ab 1 0 > structmat.out.2D0.mvT0.4.zzz +mpirun -np 4 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mvT1.4.zzz -matTvec 2 1 0 -r 5 5 -P 2 2 -ab 1 0 > structmat.out.2D0.mvT1.4.zzz +mpirun -np 4 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.mvT2.4.zzz -matTvec 1 0 1 -r 5 5 -P 2 2 -ab 1 0 > structmat.out.2D0.mvT2.4.zzz +mpirun -np 4 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mvT0.4.zzz -matTvec 0 0 0 -r 5 5 -P 2 2 -ab 1 0 > structmat.out.2D1.mvT0.4.zzz +mpirun -np 4 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mvT1.4.zzz -matTvec 2 1 0 -r 5 5 -P 2 2 -ab 1 0 > structmat.out.2D1.mvT1.4.zzz +mpirun -np 4 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.mvT2.4.zzz -matTvec 1 0 1 -r 5 5 -P 2 2 -ab 1 0 > structmat.out.2D1.mvT2.4.zzz +mpirun -np 4 ./structmat -in structmat.in.2D3 -out structmat.out.2D3.mvT0.4.zzz -matTvec 0 0 0 -r 5 5 -P 2 2 -ab 1 0 > structmat.out.2D3.mvT0.4.zzz + +#============================================================================= +# 2D one proc constant Matvec alpha/beta tests +# +# NOTE: Don't need to test variable coefficient, multi-proc, or MatvecT +# NOTE: First dimension must be even because the problem is periodic in x +#============================================================================= + +# alpha = 0, beta = 0 +mpirun -np 1 ./structmat -in structmat.in.2D0 -out structmat.out.ab0.mv0 -mat-vec 0 0 3 -r 8 7 -ab 0 0 > structmat.out.ab0.mv0 +mpirun -np 1 ./structmat -in structmat.in.2D0 -out structmat.out.ab0.mv1 -mat-vec 1 1 3 -r 8 7 -ab 0 0 > structmat.out.ab0.mv1 +mpirun -np 1 ./structmat -in structmat.in.2D0 -out structmat.out.ab0.mv2 -mat-vec 2 0 4 -r 8 7 -ab 0 0 > structmat.out.ab0.mv2 + +# alpha = 0, beta = 2 +mpirun -np 1 ./structmat -in structmat.in.2D0 -out structmat.out.ab1.mv0 -mat-vec 0 0 0 -r 8 7 -ab 0 2 > structmat.out.ab1.mv0 +mpirun -np 1 ./structmat -in structmat.in.2D0 -out structmat.out.ab1.mv1 -mat-vec 1 1 0 -r 8 7 -ab 0 2 > structmat.out.ab1.mv1 +mpirun -np 1 ./structmat -in structmat.in.2D0 -out structmat.out.ab1.mv2 -mat-vec 2 0 1 -r 8 7 -ab 0 2 > structmat.out.ab1.mv2 + +# alpha = -0.3, beta = 1.7 +mpirun -np 1 ./structmat -in structmat.in.2D0 -out structmat.out.ab2.mv0 -mat-vec 0 0 0 -r 8 7 -ab -0.3 1.7 > structmat.out.ab2.mv0 +mpirun -np 1 ./structmat -in structmat.in.2D0 -out structmat.out.ab2.mv1 -mat-vec 1 1 0 -r 8 7 -ab -0.3 1.7 > structmat.out.ab2.mv1 +mpirun -np 1 ./structmat -in structmat.in.2D0 -out structmat.out.ab2.mv2 -mat-vec 2 0 1 -r 8 7 -ab -0.3 1.7 > structmat.out.ab2.mv2 + +#============================================================================= +# Symmetric A - 2D one proc RAP +#============================================================================= + +# interpolate in x direction +mpirun -np 1 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.sym.x -mat-mat 3 1T 5 1 -r 10 10 > structmat.out.2D0.sym.x +mpirun -np 1 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.sym.x -mat-mat 3 1T 5 1 -r 10 10 > structmat.out.2D1.sym.x +mpirun -np 1 ./structmat -in structmat.in.2D2 -out structmat.out.2D2.sym.x -mat-mat 3 1T 5 1 -r 10 10 > structmat.out.2D2.sym.x +mpirun -np 1 ./structmat -in structmat.in.2D3 -out structmat.out.2D3.sym.x -mat-mat 3 1T 5 1 -r 10 10 > structmat.out.2D3.sym.x + +#============================================================================= +# Symmetric A - 2D four procs RAP +#============================================================================= + +# interpolate in x direction +mpirun -np 4 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.sym.x.4 -mat-mat 3 1T 5 1 -r 5 5 -P 2 2 > structmat.out.2D0.sym.x.4 +mpirun -np 4 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.sym.x.4 -mat-mat 3 1T 5 1 -r 5 5 -P 2 2 > structmat.out.2D1.sym.x.4 +mpirun -np 4 ./structmat -in structmat.in.2D2 -out structmat.out.2D2.sym.x.4 -mat-mat 3 1T 5 1 -r 5 5 -P 2 2 > structmat.out.2D2.sym.x.4 +mpirun -np 4 ./structmat -in structmat.in.2D3 -out structmat.out.2D3.sym.x.4 -mat-mat 3 1T 5 1 -r 5 5 -P 2 2 > structmat.out.2D3.sym.x.4 + +#============================================================================= +# Symmetric A - 2D four procs Matvec +#============================================================================= + +# all constant coefficients +mpirun -np 4 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.sym.mv0.4 -mat-vec 5 0 3 -r 5 5 -P 2 2 > structmat.out.2D0.mv0.4 + +# all variable coefficients +mpirun -np 4 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.sym.mv0.4 -mat-vec 5 0 3 -r 5 5 -P 2 2 > structmat.out.2D1.mv0.4 + +# variable diagonal +mpirun -np 4 ./structmat -in structmat.in.2D3 -out structmat.out.2D3.sym.mv0.4 -mat-vec 5 0 3 -r 5 5 -P 2 2 > structmat.out.2D3.mv0.4 + +#============================================================================= +# Symmetric A - 2D four procs MatvecT +#============================================================================= + +# all constant coefficients +mpirun -np 4 ./structmat -in structmat.in.2D0 -out structmat.out.2D0.sym.mvT0.4 -matTvec 5 0 3 -r 5 5 -P 2 2 > structmat.out.2D0.mvT0.4 + +# all variable coefficients +mpirun -np 4 ./structmat -in structmat.in.2D1 -out structmat.out.2D1.sym.mvT0.4 -matTvec 5 0 3 -r 5 5 -P 2 2 > structmat.out.2D1.mvT0.4 + +# variable diagonal +mpirun -np 4 ./structmat -in structmat.in.2D3 -out structmat.out.2D3.sym.mvT0.4 -matTvec 5 0 3 -r 5 5 -P 2 2 > structmat.out.2D3.mvT0.4 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.mv0.4.matvec.00000 b/src/test/TEST_structmat/structmat.saved.2D0.mv0.4.matvec.00000 new file mode 100644 index 0000000000..90984bf2ce --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.mv0.4.matvec.00000 @@ -0,0 +1,36 @@ +StructVector + +Grid: +2 +1 +0: (0, 0) x (4, 4) + +Periodic: (10, 0) + +Data: +1 +0: (0, 0; 0) 1.00000000000000e+00 +0: (1, 0; 0) 1.00000000000000e+00 +0: (2, 0; 0) 1.00000000000000e+00 +0: (3, 0; 0) 1.00000000000000e+00 +0: (4, 0; 0) 1.00000000000000e+00 +0: (0, 1; 0) 0.00000000000000e+00 +0: (1, 1; 0) 0.00000000000000e+00 +0: (2, 1; 0) 0.00000000000000e+00 +0: (3, 1; 0) 0.00000000000000e+00 +0: (4, 1; 0) 0.00000000000000e+00 +0: (0, 2; 0) 0.00000000000000e+00 +0: (1, 2; 0) 0.00000000000000e+00 +0: (2, 2; 0) 0.00000000000000e+00 +0: (3, 2; 0) 0.00000000000000e+00 +0: (4, 2; 0) 0.00000000000000e+00 +0: (0, 3; 0) 0.00000000000000e+00 +0: (1, 3; 0) 0.00000000000000e+00 +0: (2, 3; 0) 0.00000000000000e+00 +0: (3, 3; 0) 0.00000000000000e+00 +0: (4, 3; 0) 0.00000000000000e+00 +0: (0, 4; 0) 0.00000000000000e+00 +0: (1, 4; 0) 0.00000000000000e+00 +0: (2, 4; 0) 0.00000000000000e+00 +0: (3, 4; 0) 0.00000000000000e+00 +0: (4, 4; 0) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.mv0.4.matvec.00001 b/src/test/TEST_structmat/structmat.saved.2D0.mv0.4.matvec.00001 new file mode 100644 index 0000000000..0170838785 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.mv0.4.matvec.00001 @@ -0,0 +1,36 @@ +StructVector + +Grid: +2 +1 +0: (5, 0) x (9, 4) + +Periodic: (10, 0) + +Data: +1 +0: (5, 0; 0) 1.00000000000000e+00 +0: (6, 0; 0) 1.00000000000000e+00 +0: (7, 0; 0) 1.00000000000000e+00 +0: (8, 0; 0) 1.00000000000000e+00 +0: (9, 0; 0) 1.00000000000000e+00 +0: (5, 1; 0) 0.00000000000000e+00 +0: (6, 1; 0) 0.00000000000000e+00 +0: (7, 1; 0) 0.00000000000000e+00 +0: (8, 1; 0) 0.00000000000000e+00 +0: (9, 1; 0) 0.00000000000000e+00 +0: (5, 2; 0) 0.00000000000000e+00 +0: (6, 2; 0) 0.00000000000000e+00 +0: (7, 2; 0) 0.00000000000000e+00 +0: (8, 2; 0) 0.00000000000000e+00 +0: (9, 2; 0) 0.00000000000000e+00 +0: (5, 3; 0) 0.00000000000000e+00 +0: (6, 3; 0) 0.00000000000000e+00 +0: (7, 3; 0) 0.00000000000000e+00 +0: (8, 3; 0) 0.00000000000000e+00 +0: (9, 3; 0) 0.00000000000000e+00 +0: (5, 4; 0) 0.00000000000000e+00 +0: (6, 4; 0) 0.00000000000000e+00 +0: (7, 4; 0) 0.00000000000000e+00 +0: (8, 4; 0) 0.00000000000000e+00 +0: (9, 4; 0) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.mv0.4.matvec.00002 b/src/test/TEST_structmat/structmat.saved.2D0.mv0.4.matvec.00002 new file mode 100644 index 0000000000..f472868a1a --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.mv0.4.matvec.00002 @@ -0,0 +1,36 @@ +StructVector + +Grid: +2 +1 +0: (0, 5) x (4, 9) + +Periodic: (10, 0) + +Data: +1 +0: (0, 5; 0) 0.00000000000000e+00 +0: (1, 5; 0) 0.00000000000000e+00 +0: (2, 5; 0) 0.00000000000000e+00 +0: (3, 5; 0) 0.00000000000000e+00 +0: (4, 5; 0) 0.00000000000000e+00 +0: (0, 6; 0) 0.00000000000000e+00 +0: (1, 6; 0) 0.00000000000000e+00 +0: (2, 6; 0) 0.00000000000000e+00 +0: (3, 6; 0) 0.00000000000000e+00 +0: (4, 6; 0) 0.00000000000000e+00 +0: (0, 7; 0) 0.00000000000000e+00 +0: (1, 7; 0) 0.00000000000000e+00 +0: (2, 7; 0) 0.00000000000000e+00 +0: (3, 7; 0) 0.00000000000000e+00 +0: (4, 7; 0) 0.00000000000000e+00 +0: (0, 8; 0) 0.00000000000000e+00 +0: (1, 8; 0) 0.00000000000000e+00 +0: (2, 8; 0) 0.00000000000000e+00 +0: (3, 8; 0) 0.00000000000000e+00 +0: (4, 8; 0) 0.00000000000000e+00 +0: (0, 9; 0) 1.00000000000000e+00 +0: (1, 9; 0) 1.00000000000000e+00 +0: (2, 9; 0) 1.00000000000000e+00 +0: (3, 9; 0) 1.00000000000000e+00 +0: (4, 9; 0) 1.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.mv0.4.matvec.00003 b/src/test/TEST_structmat/structmat.saved.2D0.mv0.4.matvec.00003 new file mode 100644 index 0000000000..4806742901 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.mv0.4.matvec.00003 @@ -0,0 +1,36 @@ +StructVector + +Grid: +2 +1 +0: (5, 5) x (9, 9) + +Periodic: (10, 0) + +Data: +1 +0: (5, 5; 0) 0.00000000000000e+00 +0: (6, 5; 0) 0.00000000000000e+00 +0: (7, 5; 0) 0.00000000000000e+00 +0: (8, 5; 0) 0.00000000000000e+00 +0: (9, 5; 0) 0.00000000000000e+00 +0: (5, 6; 0) 0.00000000000000e+00 +0: (6, 6; 0) 0.00000000000000e+00 +0: (7, 6; 0) 0.00000000000000e+00 +0: (8, 6; 0) 0.00000000000000e+00 +0: (9, 6; 0) 0.00000000000000e+00 +0: (5, 7; 0) 0.00000000000000e+00 +0: (6, 7; 0) 0.00000000000000e+00 +0: (7, 7; 0) 0.00000000000000e+00 +0: (8, 7; 0) 0.00000000000000e+00 +0: (9, 7; 0) 0.00000000000000e+00 +0: (5, 8; 0) 0.00000000000000e+00 +0: (6, 8; 0) 0.00000000000000e+00 +0: (7, 8; 0) 0.00000000000000e+00 +0: (8, 8; 0) 0.00000000000000e+00 +0: (9, 8; 0) 0.00000000000000e+00 +0: (5, 9; 0) 1.00000000000000e+00 +0: (6, 9; 0) 1.00000000000000e+00 +0: (7, 9; 0) 1.00000000000000e+00 +0: (8, 9; 0) 1.00000000000000e+00 +0: (9, 9; 0) 1.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.mv0.matvec.00000 b/src/test/TEST_structmat/structmat.saved.2D0.mv0.matvec.00000 new file mode 100644 index 0000000000..3d14f5c264 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.mv0.matvec.00000 @@ -0,0 +1,111 @@ +StructVector + +Grid: +2 +1 +0: (0, 0) x (9, 9) + +Periodic: (10, 0) + +Data: +1 +0: (0, 0; 0) 1.00000000000000e+00 +0: (1, 0; 0) 1.00000000000000e+00 +0: (2, 0; 0) 1.00000000000000e+00 +0: (3, 0; 0) 1.00000000000000e+00 +0: (4, 0; 0) 1.00000000000000e+00 +0: (5, 0; 0) 1.00000000000000e+00 +0: (6, 0; 0) 1.00000000000000e+00 +0: (7, 0; 0) 1.00000000000000e+00 +0: (8, 0; 0) 1.00000000000000e+00 +0: (9, 0; 0) 1.00000000000000e+00 +0: (0, 1; 0) 0.00000000000000e+00 +0: (1, 1; 0) 0.00000000000000e+00 +0: (2, 1; 0) 0.00000000000000e+00 +0: (3, 1; 0) 0.00000000000000e+00 +0: (4, 1; 0) 0.00000000000000e+00 +0: (5, 1; 0) 0.00000000000000e+00 +0: (6, 1; 0) 0.00000000000000e+00 +0: (7, 1; 0) 0.00000000000000e+00 +0: (8, 1; 0) 0.00000000000000e+00 +0: (9, 1; 0) 0.00000000000000e+00 +0: (0, 2; 0) 0.00000000000000e+00 +0: (1, 2; 0) 0.00000000000000e+00 +0: (2, 2; 0) 0.00000000000000e+00 +0: (3, 2; 0) 0.00000000000000e+00 +0: (4, 2; 0) 0.00000000000000e+00 +0: (5, 2; 0) 0.00000000000000e+00 +0: (6, 2; 0) 0.00000000000000e+00 +0: (7, 2; 0) 0.00000000000000e+00 +0: (8, 2; 0) 0.00000000000000e+00 +0: (9, 2; 0) 0.00000000000000e+00 +0: (0, 3; 0) 0.00000000000000e+00 +0: (1, 3; 0) 0.00000000000000e+00 +0: (2, 3; 0) 0.00000000000000e+00 +0: (3, 3; 0) 0.00000000000000e+00 +0: (4, 3; 0) 0.00000000000000e+00 +0: (5, 3; 0) 0.00000000000000e+00 +0: (6, 3; 0) 0.00000000000000e+00 +0: (7, 3; 0) 0.00000000000000e+00 +0: (8, 3; 0) 0.00000000000000e+00 +0: (9, 3; 0) 0.00000000000000e+00 +0: (0, 4; 0) 0.00000000000000e+00 +0: (1, 4; 0) 0.00000000000000e+00 +0: (2, 4; 0) 0.00000000000000e+00 +0: (3, 4; 0) 0.00000000000000e+00 +0: (4, 4; 0) 0.00000000000000e+00 +0: (5, 4; 0) 0.00000000000000e+00 +0: (6, 4; 0) 0.00000000000000e+00 +0: (7, 4; 0) 0.00000000000000e+00 +0: (8, 4; 0) 0.00000000000000e+00 +0: (9, 4; 0) 0.00000000000000e+00 +0: (0, 5; 0) 0.00000000000000e+00 +0: (1, 5; 0) 0.00000000000000e+00 +0: (2, 5; 0) 0.00000000000000e+00 +0: (3, 5; 0) 0.00000000000000e+00 +0: (4, 5; 0) 0.00000000000000e+00 +0: (5, 5; 0) 0.00000000000000e+00 +0: (6, 5; 0) 0.00000000000000e+00 +0: (7, 5; 0) 0.00000000000000e+00 +0: (8, 5; 0) 0.00000000000000e+00 +0: (9, 5; 0) 0.00000000000000e+00 +0: (0, 6; 0) 0.00000000000000e+00 +0: (1, 6; 0) 0.00000000000000e+00 +0: (2, 6; 0) 0.00000000000000e+00 +0: (3, 6; 0) 0.00000000000000e+00 +0: (4, 6; 0) 0.00000000000000e+00 +0: (5, 6; 0) 0.00000000000000e+00 +0: (6, 6; 0) 0.00000000000000e+00 +0: (7, 6; 0) 0.00000000000000e+00 +0: (8, 6; 0) 0.00000000000000e+00 +0: (9, 6; 0) 0.00000000000000e+00 +0: (0, 7; 0) 0.00000000000000e+00 +0: (1, 7; 0) 0.00000000000000e+00 +0: (2, 7; 0) 0.00000000000000e+00 +0: (3, 7; 0) 0.00000000000000e+00 +0: (4, 7; 0) 0.00000000000000e+00 +0: (5, 7; 0) 0.00000000000000e+00 +0: (6, 7; 0) 0.00000000000000e+00 +0: (7, 7; 0) 0.00000000000000e+00 +0: (8, 7; 0) 0.00000000000000e+00 +0: (9, 7; 0) 0.00000000000000e+00 +0: (0, 8; 0) 0.00000000000000e+00 +0: (1, 8; 0) 0.00000000000000e+00 +0: (2, 8; 0) 0.00000000000000e+00 +0: (3, 8; 0) 0.00000000000000e+00 +0: (4, 8; 0) 0.00000000000000e+00 +0: (5, 8; 0) 0.00000000000000e+00 +0: (6, 8; 0) 0.00000000000000e+00 +0: (7, 8; 0) 0.00000000000000e+00 +0: (8, 8; 0) 0.00000000000000e+00 +0: (9, 8; 0) 0.00000000000000e+00 +0: (0, 9; 0) 1.00000000000000e+00 +0: (1, 9; 0) 1.00000000000000e+00 +0: (2, 9; 0) 1.00000000000000e+00 +0: (3, 9; 0) 1.00000000000000e+00 +0: (4, 9; 0) 1.00000000000000e+00 +0: (5, 9; 0) 1.00000000000000e+00 +0: (6, 9; 0) 1.00000000000000e+00 +0: (7, 9; 0) 1.00000000000000e+00 +0: (8, 9; 0) 1.00000000000000e+00 +0: (9, 9; 0) 1.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.mv1.4.matvec.00000 b/src/test/TEST_structmat/structmat.saved.2D0.mv1.4.matvec.00000 new file mode 100644 index 0000000000..4648fa984f --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.mv1.4.matvec.00000 @@ -0,0 +1,36 @@ +StructVector + +Grid: +2 +1 +0: (0, 0) x (4, 4) + +Periodic: (10, 0) + +Data: +1 +0: (0, 0; 0) 1.00000000000000e+00 +0: (1, 0; 0) 1.00000000000000e+00 +0: (2, 0; 0) 1.00000000000000e+00 +0: (3, 0; 0) 1.00000000000000e+00 +0: (4, 0; 0) 1.00000000000000e+00 +0: (0, 1; 0) 1.00000000000000e+00 +0: (1, 1; 0) 1.00000000000000e+00 +0: (2, 1; 0) 1.00000000000000e+00 +0: (3, 1; 0) 1.00000000000000e+00 +0: (4, 1; 0) 1.00000000000000e+00 +0: (0, 2; 0) 1.00000000000000e+00 +0: (1, 2; 0) 1.00000000000000e+00 +0: (2, 2; 0) 1.00000000000000e+00 +0: (3, 2; 0) 1.00000000000000e+00 +0: (4, 2; 0) 1.00000000000000e+00 +0: (0, 3; 0) 1.00000000000000e+00 +0: (1, 3; 0) 1.00000000000000e+00 +0: (2, 3; 0) 1.00000000000000e+00 +0: (3, 3; 0) 1.00000000000000e+00 +0: (4, 3; 0) 1.00000000000000e+00 +0: (0, 4; 0) 1.00000000000000e+00 +0: (1, 4; 0) 1.00000000000000e+00 +0: (2, 4; 0) 1.00000000000000e+00 +0: (3, 4; 0) 1.00000000000000e+00 +0: (4, 4; 0) 1.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.mv1.4.matvec.00001 b/src/test/TEST_structmat/structmat.saved.2D0.mv1.4.matvec.00001 new file mode 100644 index 0000000000..f2621e1750 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.mv1.4.matvec.00001 @@ -0,0 +1,36 @@ +StructVector + +Grid: +2 +1 +0: (5, 0) x (9, 4) + +Periodic: (10, 0) + +Data: +1 +0: (5, 0; 0) 1.00000000000000e+00 +0: (6, 0; 0) 1.00000000000000e+00 +0: (7, 0; 0) 1.00000000000000e+00 +0: (8, 0; 0) 1.00000000000000e+00 +0: (9, 0; 0) 1.00000000000000e+00 +0: (5, 1; 0) 1.00000000000000e+00 +0: (6, 1; 0) 1.00000000000000e+00 +0: (7, 1; 0) 1.00000000000000e+00 +0: (8, 1; 0) 1.00000000000000e+00 +0: (9, 1; 0) 1.00000000000000e+00 +0: (5, 2; 0) 1.00000000000000e+00 +0: (6, 2; 0) 1.00000000000000e+00 +0: (7, 2; 0) 1.00000000000000e+00 +0: (8, 2; 0) 1.00000000000000e+00 +0: (9, 2; 0) 1.00000000000000e+00 +0: (5, 3; 0) 1.00000000000000e+00 +0: (6, 3; 0) 1.00000000000000e+00 +0: (7, 3; 0) 1.00000000000000e+00 +0: (8, 3; 0) 1.00000000000000e+00 +0: (9, 3; 0) 1.00000000000000e+00 +0: (5, 4; 0) 1.00000000000000e+00 +0: (6, 4; 0) 1.00000000000000e+00 +0: (7, 4; 0) 1.00000000000000e+00 +0: (8, 4; 0) 1.00000000000000e+00 +0: (9, 4; 0) 1.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.mv1.4.matvec.00002 b/src/test/TEST_structmat/structmat.saved.2D0.mv1.4.matvec.00002 new file mode 100644 index 0000000000..21f5742260 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.mv1.4.matvec.00002 @@ -0,0 +1,36 @@ +StructVector + +Grid: +2 +1 +0: (0, 5) x (4, 9) + +Periodic: (10, 0) + +Data: +1 +0: (0, 5; 0) 1.00000000000000e+00 +0: (1, 5; 0) 1.00000000000000e+00 +0: (2, 5; 0) 1.00000000000000e+00 +0: (3, 5; 0) 1.00000000000000e+00 +0: (4, 5; 0) 1.00000000000000e+00 +0: (0, 6; 0) 1.00000000000000e+00 +0: (1, 6; 0) 1.00000000000000e+00 +0: (2, 6; 0) 1.00000000000000e+00 +0: (3, 6; 0) 1.00000000000000e+00 +0: (4, 6; 0) 1.00000000000000e+00 +0: (0, 7; 0) 1.00000000000000e+00 +0: (1, 7; 0) 1.00000000000000e+00 +0: (2, 7; 0) 1.00000000000000e+00 +0: (3, 7; 0) 1.00000000000000e+00 +0: (4, 7; 0) 1.00000000000000e+00 +0: (0, 8; 0) 1.00000000000000e+00 +0: (1, 8; 0) 1.00000000000000e+00 +0: (2, 8; 0) 1.00000000000000e+00 +0: (3, 8; 0) 1.00000000000000e+00 +0: (4, 8; 0) 1.00000000000000e+00 +0: (0, 9; 0) 1.00000000000000e+00 +0: (1, 9; 0) 1.00000000000000e+00 +0: (2, 9; 0) 1.00000000000000e+00 +0: (3, 9; 0) 1.00000000000000e+00 +0: (4, 9; 0) 1.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.mv1.4.matvec.00003 b/src/test/TEST_structmat/structmat.saved.2D0.mv1.4.matvec.00003 new file mode 100644 index 0000000000..a820bfca22 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.mv1.4.matvec.00003 @@ -0,0 +1,36 @@ +StructVector + +Grid: +2 +1 +0: (5, 5) x (9, 9) + +Periodic: (10, 0) + +Data: +1 +0: (5, 5; 0) 1.00000000000000e+00 +0: (6, 5; 0) 1.00000000000000e+00 +0: (7, 5; 0) 1.00000000000000e+00 +0: (8, 5; 0) 1.00000000000000e+00 +0: (9, 5; 0) 1.00000000000000e+00 +0: (5, 6; 0) 1.00000000000000e+00 +0: (6, 6; 0) 1.00000000000000e+00 +0: (7, 6; 0) 1.00000000000000e+00 +0: (8, 6; 0) 1.00000000000000e+00 +0: (9, 6; 0) 1.00000000000000e+00 +0: (5, 7; 0) 1.00000000000000e+00 +0: (6, 7; 0) 1.00000000000000e+00 +0: (7, 7; 0) 1.00000000000000e+00 +0: (8, 7; 0) 1.00000000000000e+00 +0: (9, 7; 0) 1.00000000000000e+00 +0: (5, 8; 0) 1.00000000000000e+00 +0: (6, 8; 0) 1.00000000000000e+00 +0: (7, 8; 0) 1.00000000000000e+00 +0: (8, 8; 0) 1.00000000000000e+00 +0: (9, 8; 0) 1.00000000000000e+00 +0: (5, 9; 0) 1.00000000000000e+00 +0: (6, 9; 0) 1.00000000000000e+00 +0: (7, 9; 0) 1.00000000000000e+00 +0: (8, 9; 0) 1.00000000000000e+00 +0: (9, 9; 0) 1.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.mv1.matvec.00000 b/src/test/TEST_structmat/structmat.saved.2D0.mv1.matvec.00000 new file mode 100644 index 0000000000..f0a4eb8ad8 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.mv1.matvec.00000 @@ -0,0 +1,111 @@ +StructVector + +Grid: +2 +1 +0: (0, 0) x (9, 9) + +Periodic: (10, 0) + +Data: +1 +0: (0, 0; 0) 1.00000000000000e+00 +0: (1, 0; 0) 1.00000000000000e+00 +0: (2, 0; 0) 1.00000000000000e+00 +0: (3, 0; 0) 1.00000000000000e+00 +0: (4, 0; 0) 1.00000000000000e+00 +0: (5, 0; 0) 1.00000000000000e+00 +0: (6, 0; 0) 1.00000000000000e+00 +0: (7, 0; 0) 1.00000000000000e+00 +0: (8, 0; 0) 1.00000000000000e+00 +0: (9, 0; 0) 1.00000000000000e+00 +0: (0, 1; 0) 1.00000000000000e+00 +0: (1, 1; 0) 1.00000000000000e+00 +0: (2, 1; 0) 1.00000000000000e+00 +0: (3, 1; 0) 1.00000000000000e+00 +0: (4, 1; 0) 1.00000000000000e+00 +0: (5, 1; 0) 1.00000000000000e+00 +0: (6, 1; 0) 1.00000000000000e+00 +0: (7, 1; 0) 1.00000000000000e+00 +0: (8, 1; 0) 1.00000000000000e+00 +0: (9, 1; 0) 1.00000000000000e+00 +0: (0, 2; 0) 1.00000000000000e+00 +0: (1, 2; 0) 1.00000000000000e+00 +0: (2, 2; 0) 1.00000000000000e+00 +0: (3, 2; 0) 1.00000000000000e+00 +0: (4, 2; 0) 1.00000000000000e+00 +0: (5, 2; 0) 1.00000000000000e+00 +0: (6, 2; 0) 1.00000000000000e+00 +0: (7, 2; 0) 1.00000000000000e+00 +0: (8, 2; 0) 1.00000000000000e+00 +0: (9, 2; 0) 1.00000000000000e+00 +0: (0, 3; 0) 1.00000000000000e+00 +0: (1, 3; 0) 1.00000000000000e+00 +0: (2, 3; 0) 1.00000000000000e+00 +0: (3, 3; 0) 1.00000000000000e+00 +0: (4, 3; 0) 1.00000000000000e+00 +0: (5, 3; 0) 1.00000000000000e+00 +0: (6, 3; 0) 1.00000000000000e+00 +0: (7, 3; 0) 1.00000000000000e+00 +0: (8, 3; 0) 1.00000000000000e+00 +0: (9, 3; 0) 1.00000000000000e+00 +0: (0, 4; 0) 1.00000000000000e+00 +0: (1, 4; 0) 1.00000000000000e+00 +0: (2, 4; 0) 1.00000000000000e+00 +0: (3, 4; 0) 1.00000000000000e+00 +0: (4, 4; 0) 1.00000000000000e+00 +0: (5, 4; 0) 1.00000000000000e+00 +0: (6, 4; 0) 1.00000000000000e+00 +0: (7, 4; 0) 1.00000000000000e+00 +0: (8, 4; 0) 1.00000000000000e+00 +0: (9, 4; 0) 1.00000000000000e+00 +0: (0, 5; 0) 1.00000000000000e+00 +0: (1, 5; 0) 1.00000000000000e+00 +0: (2, 5; 0) 1.00000000000000e+00 +0: (3, 5; 0) 1.00000000000000e+00 +0: (4, 5; 0) 1.00000000000000e+00 +0: (5, 5; 0) 1.00000000000000e+00 +0: (6, 5; 0) 1.00000000000000e+00 +0: (7, 5; 0) 1.00000000000000e+00 +0: (8, 5; 0) 1.00000000000000e+00 +0: (9, 5; 0) 1.00000000000000e+00 +0: (0, 6; 0) 1.00000000000000e+00 +0: (1, 6; 0) 1.00000000000000e+00 +0: (2, 6; 0) 1.00000000000000e+00 +0: (3, 6; 0) 1.00000000000000e+00 +0: (4, 6; 0) 1.00000000000000e+00 +0: (5, 6; 0) 1.00000000000000e+00 +0: (6, 6; 0) 1.00000000000000e+00 +0: (7, 6; 0) 1.00000000000000e+00 +0: (8, 6; 0) 1.00000000000000e+00 +0: (9, 6; 0) 1.00000000000000e+00 +0: (0, 7; 0) 1.00000000000000e+00 +0: (1, 7; 0) 1.00000000000000e+00 +0: (2, 7; 0) 1.00000000000000e+00 +0: (3, 7; 0) 1.00000000000000e+00 +0: (4, 7; 0) 1.00000000000000e+00 +0: (5, 7; 0) 1.00000000000000e+00 +0: (6, 7; 0) 1.00000000000000e+00 +0: (7, 7; 0) 1.00000000000000e+00 +0: (8, 7; 0) 1.00000000000000e+00 +0: (9, 7; 0) 1.00000000000000e+00 +0: (0, 8; 0) 1.00000000000000e+00 +0: (1, 8; 0) 1.00000000000000e+00 +0: (2, 8; 0) 1.00000000000000e+00 +0: (3, 8; 0) 1.00000000000000e+00 +0: (4, 8; 0) 1.00000000000000e+00 +0: (5, 8; 0) 1.00000000000000e+00 +0: (6, 8; 0) 1.00000000000000e+00 +0: (7, 8; 0) 1.00000000000000e+00 +0: (8, 8; 0) 1.00000000000000e+00 +0: (9, 8; 0) 1.00000000000000e+00 +0: (0, 9; 0) 1.00000000000000e+00 +0: (1, 9; 0) 1.00000000000000e+00 +0: (2, 9; 0) 1.00000000000000e+00 +0: (3, 9; 0) 1.00000000000000e+00 +0: (4, 9; 0) 1.00000000000000e+00 +0: (5, 9; 0) 1.00000000000000e+00 +0: (6, 9; 0) 1.00000000000000e+00 +0: (7, 9; 0) 1.00000000000000e+00 +0: (8, 9; 0) 1.00000000000000e+00 +0: (9, 9; 0) 1.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.mv2.4.matvec.00000 b/src/test/TEST_structmat/structmat.saved.2D0.mv2.4.matvec.00000 new file mode 100644 index 0000000000..61aeb3d272 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.mv2.4.matvec.00000 @@ -0,0 +1,26 @@ +StructVector + +Grid: +2 +1 +0: (0, 0) x (2, 4) + +Periodic: (5, 0) + +Data: +1 +0: (0, 0; 0) 2.00000000000000e+00 +0: (1, 0; 0) 2.00000000000000e+00 +0: (2, 0; 0) 2.00000000000000e+00 +0: (0, 1; 0) 2.00000000000000e+00 +0: (1, 1; 0) 2.00000000000000e+00 +0: (2, 1; 0) 2.00000000000000e+00 +0: (0, 2; 0) 2.00000000000000e+00 +0: (1, 2; 0) 2.00000000000000e+00 +0: (2, 2; 0) 2.00000000000000e+00 +0: (0, 3; 0) 2.00000000000000e+00 +0: (1, 3; 0) 2.00000000000000e+00 +0: (2, 3; 0) 2.00000000000000e+00 +0: (0, 4; 0) 2.00000000000000e+00 +0: (1, 4; 0) 2.00000000000000e+00 +0: (2, 4; 0) 2.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.mv2.4.matvec.00001 b/src/test/TEST_structmat/structmat.saved.2D0.mv2.4.matvec.00001 new file mode 100644 index 0000000000..1b62f095ca --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.mv2.4.matvec.00001 @@ -0,0 +1,21 @@ +StructVector + +Grid: +2 +1 +0: (3, 0) x (4, 4) + +Periodic: (5, 0) + +Data: +1 +0: (3, 0; 0) 2.00000000000000e+00 +0: (4, 0; 0) 2.00000000000000e+00 +0: (3, 1; 0) 2.00000000000000e+00 +0: (4, 1; 0) 2.00000000000000e+00 +0: (3, 2; 0) 2.00000000000000e+00 +0: (4, 2; 0) 2.00000000000000e+00 +0: (3, 3; 0) 2.00000000000000e+00 +0: (4, 3; 0) 2.00000000000000e+00 +0: (3, 4; 0) 2.00000000000000e+00 +0: (4, 4; 0) 2.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.mv2.4.matvec.00002 b/src/test/TEST_structmat/structmat.saved.2D0.mv2.4.matvec.00002 new file mode 100644 index 0000000000..8ca564a3bb --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.mv2.4.matvec.00002 @@ -0,0 +1,26 @@ +StructVector + +Grid: +2 +1 +0: (0, 5) x (2, 9) + +Periodic: (5, 0) + +Data: +1 +0: (0, 5; 0) 2.00000000000000e+00 +0: (1, 5; 0) 2.00000000000000e+00 +0: (2, 5; 0) 2.00000000000000e+00 +0: (0, 6; 0) 2.00000000000000e+00 +0: (1, 6; 0) 2.00000000000000e+00 +0: (2, 6; 0) 2.00000000000000e+00 +0: (0, 7; 0) 2.00000000000000e+00 +0: (1, 7; 0) 2.00000000000000e+00 +0: (2, 7; 0) 2.00000000000000e+00 +0: (0, 8; 0) 2.00000000000000e+00 +0: (1, 8; 0) 2.00000000000000e+00 +0: (2, 8; 0) 2.00000000000000e+00 +0: (0, 9; 0) 2.00000000000000e+00 +0: (1, 9; 0) 2.00000000000000e+00 +0: (2, 9; 0) 2.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.mv2.4.matvec.00003 b/src/test/TEST_structmat/structmat.saved.2D0.mv2.4.matvec.00003 new file mode 100644 index 0000000000..77321e7bc7 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.mv2.4.matvec.00003 @@ -0,0 +1,21 @@ +StructVector + +Grid: +2 +1 +0: (3, 5) x (4, 9) + +Periodic: (5, 0) + +Data: +1 +0: (3, 5; 0) 2.00000000000000e+00 +0: (4, 5; 0) 2.00000000000000e+00 +0: (3, 6; 0) 2.00000000000000e+00 +0: (4, 6; 0) 2.00000000000000e+00 +0: (3, 7; 0) 2.00000000000000e+00 +0: (4, 7; 0) 2.00000000000000e+00 +0: (3, 8; 0) 2.00000000000000e+00 +0: (4, 8; 0) 2.00000000000000e+00 +0: (3, 9; 0) 2.00000000000000e+00 +0: (4, 9; 0) 2.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.mv2.matvec.00000 b/src/test/TEST_structmat/structmat.saved.2D0.mv2.matvec.00000 new file mode 100644 index 0000000000..5ceed23c70 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.mv2.matvec.00000 @@ -0,0 +1,61 @@ +StructVector + +Grid: +2 +1 +0: (0, 0) x (4, 9) + +Periodic: (5, 0) + +Data: +1 +0: (0, 0; 0) 2.00000000000000e+00 +0: (1, 0; 0) 2.00000000000000e+00 +0: (2, 0; 0) 2.00000000000000e+00 +0: (3, 0; 0) 2.00000000000000e+00 +0: (4, 0; 0) 2.00000000000000e+00 +0: (0, 1; 0) 2.00000000000000e+00 +0: (1, 1; 0) 2.00000000000000e+00 +0: (2, 1; 0) 2.00000000000000e+00 +0: (3, 1; 0) 2.00000000000000e+00 +0: (4, 1; 0) 2.00000000000000e+00 +0: (0, 2; 0) 2.00000000000000e+00 +0: (1, 2; 0) 2.00000000000000e+00 +0: (2, 2; 0) 2.00000000000000e+00 +0: (3, 2; 0) 2.00000000000000e+00 +0: (4, 2; 0) 2.00000000000000e+00 +0: (0, 3; 0) 2.00000000000000e+00 +0: (1, 3; 0) 2.00000000000000e+00 +0: (2, 3; 0) 2.00000000000000e+00 +0: (3, 3; 0) 2.00000000000000e+00 +0: (4, 3; 0) 2.00000000000000e+00 +0: (0, 4; 0) 2.00000000000000e+00 +0: (1, 4; 0) 2.00000000000000e+00 +0: (2, 4; 0) 2.00000000000000e+00 +0: (3, 4; 0) 2.00000000000000e+00 +0: (4, 4; 0) 2.00000000000000e+00 +0: (0, 5; 0) 2.00000000000000e+00 +0: (1, 5; 0) 2.00000000000000e+00 +0: (2, 5; 0) 2.00000000000000e+00 +0: (3, 5; 0) 2.00000000000000e+00 +0: (4, 5; 0) 2.00000000000000e+00 +0: (0, 6; 0) 2.00000000000000e+00 +0: (1, 6; 0) 2.00000000000000e+00 +0: (2, 6; 0) 2.00000000000000e+00 +0: (3, 6; 0) 2.00000000000000e+00 +0: (4, 6; 0) 2.00000000000000e+00 +0: (0, 7; 0) 2.00000000000000e+00 +0: (1, 7; 0) 2.00000000000000e+00 +0: (2, 7; 0) 2.00000000000000e+00 +0: (3, 7; 0) 2.00000000000000e+00 +0: (4, 7; 0) 2.00000000000000e+00 +0: (0, 8; 0) 2.00000000000000e+00 +0: (1, 8; 0) 2.00000000000000e+00 +0: (2, 8; 0) 2.00000000000000e+00 +0: (3, 8; 0) 2.00000000000000e+00 +0: (4, 8; 0) 2.00000000000000e+00 +0: (0, 9; 0) 2.00000000000000e+00 +0: (1, 9; 0) 2.00000000000000e+00 +0: (2, 9; 0) 2.00000000000000e+00 +0: (3, 9; 0) 2.00000000000000e+00 +0: (4, 9; 0) 2.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.mv3.4.matvec.00000 b/src/test/TEST_structmat/structmat.saved.2D0.mv3.4.matvec.00000 new file mode 100644 index 0000000000..4648fa984f --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.mv3.4.matvec.00000 @@ -0,0 +1,36 @@ +StructVector + +Grid: +2 +1 +0: (0, 0) x (4, 4) + +Periodic: (10, 0) + +Data: +1 +0: (0, 0; 0) 1.00000000000000e+00 +0: (1, 0; 0) 1.00000000000000e+00 +0: (2, 0; 0) 1.00000000000000e+00 +0: (3, 0; 0) 1.00000000000000e+00 +0: (4, 0; 0) 1.00000000000000e+00 +0: (0, 1; 0) 1.00000000000000e+00 +0: (1, 1; 0) 1.00000000000000e+00 +0: (2, 1; 0) 1.00000000000000e+00 +0: (3, 1; 0) 1.00000000000000e+00 +0: (4, 1; 0) 1.00000000000000e+00 +0: (0, 2; 0) 1.00000000000000e+00 +0: (1, 2; 0) 1.00000000000000e+00 +0: (2, 2; 0) 1.00000000000000e+00 +0: (3, 2; 0) 1.00000000000000e+00 +0: (4, 2; 0) 1.00000000000000e+00 +0: (0, 3; 0) 1.00000000000000e+00 +0: (1, 3; 0) 1.00000000000000e+00 +0: (2, 3; 0) 1.00000000000000e+00 +0: (3, 3; 0) 1.00000000000000e+00 +0: (4, 3; 0) 1.00000000000000e+00 +0: (0, 4; 0) 1.00000000000000e+00 +0: (1, 4; 0) 1.00000000000000e+00 +0: (2, 4; 0) 1.00000000000000e+00 +0: (3, 4; 0) 1.00000000000000e+00 +0: (4, 4; 0) 1.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.mv3.4.matvec.00001 b/src/test/TEST_structmat/structmat.saved.2D0.mv3.4.matvec.00001 new file mode 100644 index 0000000000..f2621e1750 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.mv3.4.matvec.00001 @@ -0,0 +1,36 @@ +StructVector + +Grid: +2 +1 +0: (5, 0) x (9, 4) + +Periodic: (10, 0) + +Data: +1 +0: (5, 0; 0) 1.00000000000000e+00 +0: (6, 0; 0) 1.00000000000000e+00 +0: (7, 0; 0) 1.00000000000000e+00 +0: (8, 0; 0) 1.00000000000000e+00 +0: (9, 0; 0) 1.00000000000000e+00 +0: (5, 1; 0) 1.00000000000000e+00 +0: (6, 1; 0) 1.00000000000000e+00 +0: (7, 1; 0) 1.00000000000000e+00 +0: (8, 1; 0) 1.00000000000000e+00 +0: (9, 1; 0) 1.00000000000000e+00 +0: (5, 2; 0) 1.00000000000000e+00 +0: (6, 2; 0) 1.00000000000000e+00 +0: (7, 2; 0) 1.00000000000000e+00 +0: (8, 2; 0) 1.00000000000000e+00 +0: (9, 2; 0) 1.00000000000000e+00 +0: (5, 3; 0) 1.00000000000000e+00 +0: (6, 3; 0) 1.00000000000000e+00 +0: (7, 3; 0) 1.00000000000000e+00 +0: (8, 3; 0) 1.00000000000000e+00 +0: (9, 3; 0) 1.00000000000000e+00 +0: (5, 4; 0) 1.00000000000000e+00 +0: (6, 4; 0) 1.00000000000000e+00 +0: (7, 4; 0) 1.00000000000000e+00 +0: (8, 4; 0) 1.00000000000000e+00 +0: (9, 4; 0) 1.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.mv3.4.matvec.00002 b/src/test/TEST_structmat/structmat.saved.2D0.mv3.4.matvec.00002 new file mode 100644 index 0000000000..3aaa29a69f --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.mv3.4.matvec.00002 @@ -0,0 +1,36 @@ +StructVector + +Grid: +2 +1 +0: (0, 5) x (4, 9) + +Periodic: (10, 0) + +Data: +1 +0: (0, 5; 0) 1.00000000000000e+00 +0: (1, 5; 0) 1.00000000000000e+00 +0: (2, 5; 0) 1.00000000000000e+00 +0: (3, 5; 0) 1.00000000000000e+00 +0: (4, 5; 0) 1.00000000000000e+00 +0: (0, 6; 0) 1.00000000000000e+00 +0: (1, 6; 0) 1.00000000000000e+00 +0: (2, 6; 0) 1.00000000000000e+00 +0: (3, 6; 0) 1.00000000000000e+00 +0: (4, 6; 0) 1.00000000000000e+00 +0: (0, 7; 0) 1.00000000000000e+00 +0: (1, 7; 0) 1.00000000000000e+00 +0: (2, 7; 0) 1.00000000000000e+00 +0: (3, 7; 0) 1.00000000000000e+00 +0: (4, 7; 0) 1.00000000000000e+00 +0: (0, 8; 0) 1.00000000000000e+00 +0: (1, 8; 0) 1.00000000000000e+00 +0: (2, 8; 0) 1.00000000000000e+00 +0: (3, 8; 0) 1.00000000000000e+00 +0: (4, 8; 0) 1.00000000000000e+00 +0: (0, 9; 0) 5.00000000000000e-01 +0: (1, 9; 0) 5.00000000000000e-01 +0: (2, 9; 0) 5.00000000000000e-01 +0: (3, 9; 0) 5.00000000000000e-01 +0: (4, 9; 0) 5.00000000000000e-01 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.mv3.4.matvec.00003 b/src/test/TEST_structmat/structmat.saved.2D0.mv3.4.matvec.00003 new file mode 100644 index 0000000000..2fa0a4d1a9 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.mv3.4.matvec.00003 @@ -0,0 +1,36 @@ +StructVector + +Grid: +2 +1 +0: (5, 5) x (9, 9) + +Periodic: (10, 0) + +Data: +1 +0: (5, 5; 0) 1.00000000000000e+00 +0: (6, 5; 0) 1.00000000000000e+00 +0: (7, 5; 0) 1.00000000000000e+00 +0: (8, 5; 0) 1.00000000000000e+00 +0: (9, 5; 0) 1.00000000000000e+00 +0: (5, 6; 0) 1.00000000000000e+00 +0: (6, 6; 0) 1.00000000000000e+00 +0: (7, 6; 0) 1.00000000000000e+00 +0: (8, 6; 0) 1.00000000000000e+00 +0: (9, 6; 0) 1.00000000000000e+00 +0: (5, 7; 0) 1.00000000000000e+00 +0: (6, 7; 0) 1.00000000000000e+00 +0: (7, 7; 0) 1.00000000000000e+00 +0: (8, 7; 0) 1.00000000000000e+00 +0: (9, 7; 0) 1.00000000000000e+00 +0: (5, 8; 0) 1.00000000000000e+00 +0: (6, 8; 0) 1.00000000000000e+00 +0: (7, 8; 0) 1.00000000000000e+00 +0: (8, 8; 0) 1.00000000000000e+00 +0: (9, 8; 0) 1.00000000000000e+00 +0: (5, 9; 0) 5.00000000000000e-01 +0: (6, 9; 0) 5.00000000000000e-01 +0: (7, 9; 0) 5.00000000000000e-01 +0: (8, 9; 0) 5.00000000000000e-01 +0: (9, 9; 0) 5.00000000000000e-01 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.mv3.matvec.00000 b/src/test/TEST_structmat/structmat.saved.2D0.mv3.matvec.00000 new file mode 100644 index 0000000000..a669618426 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.mv3.matvec.00000 @@ -0,0 +1,111 @@ +StructVector + +Grid: +2 +1 +0: (0, 0) x (9, 9) + +Periodic: (10, 0) + +Data: +1 +0: (0, 0; 0) 1.00000000000000e+00 +0: (1, 0; 0) 1.00000000000000e+00 +0: (2, 0; 0) 1.00000000000000e+00 +0: (3, 0; 0) 1.00000000000000e+00 +0: (4, 0; 0) 1.00000000000000e+00 +0: (5, 0; 0) 1.00000000000000e+00 +0: (6, 0; 0) 1.00000000000000e+00 +0: (7, 0; 0) 1.00000000000000e+00 +0: (8, 0; 0) 1.00000000000000e+00 +0: (9, 0; 0) 1.00000000000000e+00 +0: (0, 1; 0) 1.00000000000000e+00 +0: (1, 1; 0) 1.00000000000000e+00 +0: (2, 1; 0) 1.00000000000000e+00 +0: (3, 1; 0) 1.00000000000000e+00 +0: (4, 1; 0) 1.00000000000000e+00 +0: (5, 1; 0) 1.00000000000000e+00 +0: (6, 1; 0) 1.00000000000000e+00 +0: (7, 1; 0) 1.00000000000000e+00 +0: (8, 1; 0) 1.00000000000000e+00 +0: (9, 1; 0) 1.00000000000000e+00 +0: (0, 2; 0) 1.00000000000000e+00 +0: (1, 2; 0) 1.00000000000000e+00 +0: (2, 2; 0) 1.00000000000000e+00 +0: (3, 2; 0) 1.00000000000000e+00 +0: (4, 2; 0) 1.00000000000000e+00 +0: (5, 2; 0) 1.00000000000000e+00 +0: (6, 2; 0) 1.00000000000000e+00 +0: (7, 2; 0) 1.00000000000000e+00 +0: (8, 2; 0) 1.00000000000000e+00 +0: (9, 2; 0) 1.00000000000000e+00 +0: (0, 3; 0) 1.00000000000000e+00 +0: (1, 3; 0) 1.00000000000000e+00 +0: (2, 3; 0) 1.00000000000000e+00 +0: (3, 3; 0) 1.00000000000000e+00 +0: (4, 3; 0) 1.00000000000000e+00 +0: (5, 3; 0) 1.00000000000000e+00 +0: (6, 3; 0) 1.00000000000000e+00 +0: (7, 3; 0) 1.00000000000000e+00 +0: (8, 3; 0) 1.00000000000000e+00 +0: (9, 3; 0) 1.00000000000000e+00 +0: (0, 4; 0) 1.00000000000000e+00 +0: (1, 4; 0) 1.00000000000000e+00 +0: (2, 4; 0) 1.00000000000000e+00 +0: (3, 4; 0) 1.00000000000000e+00 +0: (4, 4; 0) 1.00000000000000e+00 +0: (5, 4; 0) 1.00000000000000e+00 +0: (6, 4; 0) 1.00000000000000e+00 +0: (7, 4; 0) 1.00000000000000e+00 +0: (8, 4; 0) 1.00000000000000e+00 +0: (9, 4; 0) 1.00000000000000e+00 +0: (0, 5; 0) 1.00000000000000e+00 +0: (1, 5; 0) 1.00000000000000e+00 +0: (2, 5; 0) 1.00000000000000e+00 +0: (3, 5; 0) 1.00000000000000e+00 +0: (4, 5; 0) 1.00000000000000e+00 +0: (5, 5; 0) 1.00000000000000e+00 +0: (6, 5; 0) 1.00000000000000e+00 +0: (7, 5; 0) 1.00000000000000e+00 +0: (8, 5; 0) 1.00000000000000e+00 +0: (9, 5; 0) 1.00000000000000e+00 +0: (0, 6; 0) 1.00000000000000e+00 +0: (1, 6; 0) 1.00000000000000e+00 +0: (2, 6; 0) 1.00000000000000e+00 +0: (3, 6; 0) 1.00000000000000e+00 +0: (4, 6; 0) 1.00000000000000e+00 +0: (5, 6; 0) 1.00000000000000e+00 +0: (6, 6; 0) 1.00000000000000e+00 +0: (7, 6; 0) 1.00000000000000e+00 +0: (8, 6; 0) 1.00000000000000e+00 +0: (9, 6; 0) 1.00000000000000e+00 +0: (0, 7; 0) 1.00000000000000e+00 +0: (1, 7; 0) 1.00000000000000e+00 +0: (2, 7; 0) 1.00000000000000e+00 +0: (3, 7; 0) 1.00000000000000e+00 +0: (4, 7; 0) 1.00000000000000e+00 +0: (5, 7; 0) 1.00000000000000e+00 +0: (6, 7; 0) 1.00000000000000e+00 +0: (7, 7; 0) 1.00000000000000e+00 +0: (8, 7; 0) 1.00000000000000e+00 +0: (9, 7; 0) 1.00000000000000e+00 +0: (0, 8; 0) 1.00000000000000e+00 +0: (1, 8; 0) 1.00000000000000e+00 +0: (2, 8; 0) 1.00000000000000e+00 +0: (3, 8; 0) 1.00000000000000e+00 +0: (4, 8; 0) 1.00000000000000e+00 +0: (5, 8; 0) 1.00000000000000e+00 +0: (6, 8; 0) 1.00000000000000e+00 +0: (7, 8; 0) 1.00000000000000e+00 +0: (8, 8; 0) 1.00000000000000e+00 +0: (9, 8; 0) 1.00000000000000e+00 +0: (0, 9; 0) 5.00000000000000e-01 +0: (1, 9; 0) 5.00000000000000e-01 +0: (2, 9; 0) 5.00000000000000e-01 +0: (3, 9; 0) 5.00000000000000e-01 +0: (4, 9; 0) 5.00000000000000e-01 +0: (5, 9; 0) 5.00000000000000e-01 +0: (6, 9; 0) 5.00000000000000e-01 +0: (7, 9; 0) 5.00000000000000e-01 +0: (8, 9; 0) 5.00000000000000e-01 +0: (9, 9; 0) 5.00000000000000e-01 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.mv4.4.matvec.00000 b/src/test/TEST_structmat/structmat.saved.2D0.mv4.4.matvec.00000 new file mode 100644 index 0000000000..ac48879194 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.mv4.4.matvec.00000 @@ -0,0 +1,26 @@ +StructVector + +Grid: +2 +1 +0: (0, 0) x (4, 2) + +Periodic: (10, 0) + +Data: +1 +0: (0, 0; 0) 1.50000000000000e+00 +0: (1, 0; 0) 1.50000000000000e+00 +0: (2, 0; 0) 1.50000000000000e+00 +0: (3, 0; 0) 1.50000000000000e+00 +0: (4, 0; 0) 1.50000000000000e+00 +0: (0, 1; 0) 2.00000000000000e+00 +0: (1, 1; 0) 2.00000000000000e+00 +0: (2, 1; 0) 2.00000000000000e+00 +0: (3, 1; 0) 2.00000000000000e+00 +0: (4, 1; 0) 2.00000000000000e+00 +0: (0, 2; 0) 2.00000000000000e+00 +0: (1, 2; 0) 2.00000000000000e+00 +0: (2, 2; 0) 2.00000000000000e+00 +0: (3, 2; 0) 2.00000000000000e+00 +0: (4, 2; 0) 2.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.mv4.4.matvec.00001 b/src/test/TEST_structmat/structmat.saved.2D0.mv4.4.matvec.00001 new file mode 100644 index 0000000000..4e30453b4f --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.mv4.4.matvec.00001 @@ -0,0 +1,26 @@ +StructVector + +Grid: +2 +1 +0: (5, 0) x (9, 2) + +Periodic: (10, 0) + +Data: +1 +0: (5, 0; 0) 1.50000000000000e+00 +0: (6, 0; 0) 1.50000000000000e+00 +0: (7, 0; 0) 1.50000000000000e+00 +0: (8, 0; 0) 1.50000000000000e+00 +0: (9, 0; 0) 1.50000000000000e+00 +0: (5, 1; 0) 2.00000000000000e+00 +0: (6, 1; 0) 2.00000000000000e+00 +0: (7, 1; 0) 2.00000000000000e+00 +0: (8, 1; 0) 2.00000000000000e+00 +0: (9, 1; 0) 2.00000000000000e+00 +0: (5, 2; 0) 2.00000000000000e+00 +0: (6, 2; 0) 2.00000000000000e+00 +0: (7, 2; 0) 2.00000000000000e+00 +0: (8, 2; 0) 2.00000000000000e+00 +0: (9, 2; 0) 2.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.mv4.4.matvec.00002 b/src/test/TEST_structmat/structmat.saved.2D0.mv4.4.matvec.00002 new file mode 100644 index 0000000000..62ba7fc924 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.mv4.4.matvec.00002 @@ -0,0 +1,21 @@ +StructVector + +Grid: +2 +1 +0: (0, 3) x (4, 4) + +Periodic: (10, 0) + +Data: +1 +0: (0, 3; 0) 2.00000000000000e+00 +0: (1, 3; 0) 2.00000000000000e+00 +0: (2, 3; 0) 2.00000000000000e+00 +0: (3, 3; 0) 2.00000000000000e+00 +0: (4, 3; 0) 2.00000000000000e+00 +0: (0, 4; 0) 2.00000000000000e+00 +0: (1, 4; 0) 2.00000000000000e+00 +0: (2, 4; 0) 2.00000000000000e+00 +0: (3, 4; 0) 2.00000000000000e+00 +0: (4, 4; 0) 2.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.mv4.4.matvec.00003 b/src/test/TEST_structmat/structmat.saved.2D0.mv4.4.matvec.00003 new file mode 100644 index 0000000000..c400b74a8b --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.mv4.4.matvec.00003 @@ -0,0 +1,21 @@ +StructVector + +Grid: +2 +1 +0: (5, 3) x (9, 4) + +Periodic: (10, 0) + +Data: +1 +0: (5, 3; 0) 2.00000000000000e+00 +0: (6, 3; 0) 2.00000000000000e+00 +0: (7, 3; 0) 2.00000000000000e+00 +0: (8, 3; 0) 2.00000000000000e+00 +0: (9, 3; 0) 2.00000000000000e+00 +0: (5, 4; 0) 2.00000000000000e+00 +0: (6, 4; 0) 2.00000000000000e+00 +0: (7, 4; 0) 2.00000000000000e+00 +0: (8, 4; 0) 2.00000000000000e+00 +0: (9, 4; 0) 2.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.mv4.matvec.00000 b/src/test/TEST_structmat/structmat.saved.2D0.mv4.matvec.00000 new file mode 100644 index 0000000000..5edd8be383 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.mv4.matvec.00000 @@ -0,0 +1,61 @@ +StructVector + +Grid: +2 +1 +0: (0, 0) x (9, 4) + +Periodic: (10, 0) + +Data: +1 +0: (0, 0; 0) 1.50000000000000e+00 +0: (1, 0; 0) 1.50000000000000e+00 +0: (2, 0; 0) 1.50000000000000e+00 +0: (3, 0; 0) 1.50000000000000e+00 +0: (4, 0; 0) 1.50000000000000e+00 +0: (5, 0; 0) 1.50000000000000e+00 +0: (6, 0; 0) 1.50000000000000e+00 +0: (7, 0; 0) 1.50000000000000e+00 +0: (8, 0; 0) 1.50000000000000e+00 +0: (9, 0; 0) 1.50000000000000e+00 +0: (0, 1; 0) 2.00000000000000e+00 +0: (1, 1; 0) 2.00000000000000e+00 +0: (2, 1; 0) 2.00000000000000e+00 +0: (3, 1; 0) 2.00000000000000e+00 +0: (4, 1; 0) 2.00000000000000e+00 +0: (5, 1; 0) 2.00000000000000e+00 +0: (6, 1; 0) 2.00000000000000e+00 +0: (7, 1; 0) 2.00000000000000e+00 +0: (8, 1; 0) 2.00000000000000e+00 +0: (9, 1; 0) 2.00000000000000e+00 +0: (0, 2; 0) 2.00000000000000e+00 +0: (1, 2; 0) 2.00000000000000e+00 +0: (2, 2; 0) 2.00000000000000e+00 +0: (3, 2; 0) 2.00000000000000e+00 +0: (4, 2; 0) 2.00000000000000e+00 +0: (5, 2; 0) 2.00000000000000e+00 +0: (6, 2; 0) 2.00000000000000e+00 +0: (7, 2; 0) 2.00000000000000e+00 +0: (8, 2; 0) 2.00000000000000e+00 +0: (9, 2; 0) 2.00000000000000e+00 +0: (0, 3; 0) 2.00000000000000e+00 +0: (1, 3; 0) 2.00000000000000e+00 +0: (2, 3; 0) 2.00000000000000e+00 +0: (3, 3; 0) 2.00000000000000e+00 +0: (4, 3; 0) 2.00000000000000e+00 +0: (5, 3; 0) 2.00000000000000e+00 +0: (6, 3; 0) 2.00000000000000e+00 +0: (7, 3; 0) 2.00000000000000e+00 +0: (8, 3; 0) 2.00000000000000e+00 +0: (9, 3; 0) 2.00000000000000e+00 +0: (0, 4; 0) 2.00000000000000e+00 +0: (1, 4; 0) 2.00000000000000e+00 +0: (2, 4; 0) 2.00000000000000e+00 +0: (3, 4; 0) 2.00000000000000e+00 +0: (4, 4; 0) 2.00000000000000e+00 +0: (5, 4; 0) 2.00000000000000e+00 +0: (6, 4; 0) 2.00000000000000e+00 +0: (7, 4; 0) 2.00000000000000e+00 +0: (8, 4; 0) 2.00000000000000e+00 +0: (9, 4; 0) 2.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.sym.x.4.matmat.00000 b/src/test/TEST_structmat/structmat.saved.2D0.sym.x.4.matmat.00000 new file mode 100644 index 0000000000..29658d8588 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.sym.x.4.matmat.00000 @@ -0,0 +1,38 @@ +StructMatrix + +Symmetric: 1 + +ConstantCoefficient: 1 + +Grid: +2 +1 +0: (0, 0) x (2, 4) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +5 +*: (*; 0) 4.00000000000000e+00 +*: (*; 1) 0.00000000000000e+00 +*: (*; 3) -1.50000000000000e+00 +*: (*; 5) -2.50000000000000e-01 +*: (*; 6) -2.50000000000000e-01 + +Variable Data: +0 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.sym.x.4.matmat.00001 b/src/test/TEST_structmat/structmat.saved.2D0.sym.x.4.matmat.00001 new file mode 100644 index 0000000000..16ad876b9d --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.sym.x.4.matmat.00001 @@ -0,0 +1,38 @@ +StructMatrix + +Symmetric: 1 + +ConstantCoefficient: 1 + +Grid: +2 +1 +0: (3, 0) x (4, 4) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +5 +*: (*; 0) 4.00000000000000e+00 +*: (*; 1) 0.00000000000000e+00 +*: (*; 3) -1.50000000000000e+00 +*: (*; 5) -2.50000000000000e-01 +*: (*; 6) -2.50000000000000e-01 + +Variable Data: +0 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.sym.x.4.matmat.00002 b/src/test/TEST_structmat/structmat.saved.2D0.sym.x.4.matmat.00002 new file mode 100644 index 0000000000..05784f4e91 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.sym.x.4.matmat.00002 @@ -0,0 +1,38 @@ +StructMatrix + +Symmetric: 1 + +ConstantCoefficient: 1 + +Grid: +2 +1 +0: (0, 5) x (2, 9) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +5 +*: (*; 0) 4.00000000000000e+00 +*: (*; 1) 0.00000000000000e+00 +*: (*; 3) -1.50000000000000e+00 +*: (*; 5) -2.50000000000000e-01 +*: (*; 6) -2.50000000000000e-01 + +Variable Data: +0 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.sym.x.4.matmat.00003 b/src/test/TEST_structmat/structmat.saved.2D0.sym.x.4.matmat.00003 new file mode 100644 index 0000000000..a450d87e6a --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.sym.x.4.matmat.00003 @@ -0,0 +1,38 @@ +StructMatrix + +Symmetric: 1 + +ConstantCoefficient: 1 + +Grid: +2 +1 +0: (3, 5) x (4, 9) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +5 +*: (*; 0) 4.00000000000000e+00 +*: (*; 1) 0.00000000000000e+00 +*: (*; 3) -1.50000000000000e+00 +*: (*; 5) -2.50000000000000e-01 +*: (*; 6) -2.50000000000000e-01 + +Variable Data: +0 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.sym.x.matmat.00000 b/src/test/TEST_structmat/structmat.saved.2D0.sym.x.matmat.00000 new file mode 100644 index 0000000000..baf2ee9526 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.sym.x.matmat.00000 @@ -0,0 +1,38 @@ +StructMatrix + +Symmetric: 1 + +ConstantCoefficient: 1 + +Grid: +2 +1 +0: (0, 0) x (4, 9) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +5 +*: (*; 0) 4.00000000000000e+00 +*: (*; 1) 0.00000000000000e+00 +*: (*; 3) -1.50000000000000e+00 +*: (*; 5) -2.50000000000000e-01 +*: (*; 6) -2.50000000000000e-01 + +Variable Data: +0 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.x.4.matmat.00000 b/src/test/TEST_structmat/structmat.saved.2D0.x.4.matmat.00000 new file mode 100644 index 0000000000..b74bd3f96e --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.x.4.matmat.00000 @@ -0,0 +1,42 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 1 + +Grid: +2 +1 +0: (0, 0) x (2, 4) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +9 +*: (*; 0) 4.00000000000000e+00 +*: (*; 1) 0.00000000000000e+00 +*: (*; 2) 0.00000000000000e+00 +*: (*; 3) -1.50000000000000e+00 +*: (*; 4) -1.50000000000000e+00 +*: (*; 5) -2.50000000000000e-01 +*: (*; 6) -2.50000000000000e-01 +*: (*; 7) -2.50000000000000e-01 +*: (*; 8) -2.50000000000000e-01 + +Variable Data: +0 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.x.4.matmat.00001 b/src/test/TEST_structmat/structmat.saved.2D0.x.4.matmat.00001 new file mode 100644 index 0000000000..ff73c5c452 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.x.4.matmat.00001 @@ -0,0 +1,42 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 1 + +Grid: +2 +1 +0: (3, 0) x (4, 4) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +9 +*: (*; 0) 4.00000000000000e+00 +*: (*; 1) 0.00000000000000e+00 +*: (*; 2) 0.00000000000000e+00 +*: (*; 3) -1.50000000000000e+00 +*: (*; 4) -1.50000000000000e+00 +*: (*; 5) -2.50000000000000e-01 +*: (*; 6) -2.50000000000000e-01 +*: (*; 7) -2.50000000000000e-01 +*: (*; 8) -2.50000000000000e-01 + +Variable Data: +0 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.x.4.matmat.00002 b/src/test/TEST_structmat/structmat.saved.2D0.x.4.matmat.00002 new file mode 100644 index 0000000000..1e0adafa83 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.x.4.matmat.00002 @@ -0,0 +1,42 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 1 + +Grid: +2 +1 +0: (0, 5) x (2, 9) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +9 +*: (*; 0) 4.00000000000000e+00 +*: (*; 1) 0.00000000000000e+00 +*: (*; 2) 0.00000000000000e+00 +*: (*; 3) -1.50000000000000e+00 +*: (*; 4) -1.50000000000000e+00 +*: (*; 5) -2.50000000000000e-01 +*: (*; 6) -2.50000000000000e-01 +*: (*; 7) -2.50000000000000e-01 +*: (*; 8) -2.50000000000000e-01 + +Variable Data: +0 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.x.4.matmat.00003 b/src/test/TEST_structmat/structmat.saved.2D0.x.4.matmat.00003 new file mode 100644 index 0000000000..41264d6535 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.x.4.matmat.00003 @@ -0,0 +1,42 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 1 + +Grid: +2 +1 +0: (3, 5) x (4, 9) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +9 +*: (*; 0) 4.00000000000000e+00 +*: (*; 1) 0.00000000000000e+00 +*: (*; 2) 0.00000000000000e+00 +*: (*; 3) -1.50000000000000e+00 +*: (*; 4) -1.50000000000000e+00 +*: (*; 5) -2.50000000000000e-01 +*: (*; 6) -2.50000000000000e-01 +*: (*; 7) -2.50000000000000e-01 +*: (*; 8) -2.50000000000000e-01 + +Variable Data: +0 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.x.matmat.00000 b/src/test/TEST_structmat/structmat.saved.2D0.x.matmat.00000 new file mode 100644 index 0000000000..715176d99f --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.x.matmat.00000 @@ -0,0 +1,42 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 1 + +Grid: +2 +1 +0: (0, 0) x (4, 9) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +9 +*: (*; 0) 4.00000000000000e+00 +*: (*; 1) 0.00000000000000e+00 +*: (*; 2) 0.00000000000000e+00 +*: (*; 3) -1.50000000000000e+00 +*: (*; 4) -1.50000000000000e+00 +*: (*; 5) -2.50000000000000e-01 +*: (*; 6) -2.50000000000000e-01 +*: (*; 7) -2.50000000000000e-01 +*: (*; 8) -2.50000000000000e-01 + +Variable Data: +0 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.y.4.matmat.00000 b/src/test/TEST_structmat/structmat.saved.2D0.y.4.matmat.00000 new file mode 100644 index 0000000000..e2dc8eb79f --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.y.4.matmat.00000 @@ -0,0 +1,42 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 1 + +Grid: +2 +1 +0: (0, 0) x (4, 2) + +Periodic: (10, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (1, -1) +7: (-1, 1) +8: (1, 1) + +Constant Data: +9 +*: (*; 0) 4.00000000000000e+00 +*: (*; 1) -1.50000000000000e+00 +*: (*; 2) -1.50000000000000e+00 +*: (*; 3) 0.00000000000000e+00 +*: (*; 4) 0.00000000000000e+00 +*: (*; 5) -2.50000000000000e-01 +*: (*; 6) -2.50000000000000e-01 +*: (*; 7) -2.50000000000000e-01 +*: (*; 8) -2.50000000000000e-01 + +Variable Data: +0 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.y.4.matmat.00001 b/src/test/TEST_structmat/structmat.saved.2D0.y.4.matmat.00001 new file mode 100644 index 0000000000..da9c609faf --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.y.4.matmat.00001 @@ -0,0 +1,42 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 1 + +Grid: +2 +1 +0: (5, 0) x (9, 2) + +Periodic: (10, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (1, -1) +7: (-1, 1) +8: (1, 1) + +Constant Data: +9 +*: (*; 0) 4.00000000000000e+00 +*: (*; 1) -1.50000000000000e+00 +*: (*; 2) -1.50000000000000e+00 +*: (*; 3) 0.00000000000000e+00 +*: (*; 4) 0.00000000000000e+00 +*: (*; 5) -2.50000000000000e-01 +*: (*; 6) -2.50000000000000e-01 +*: (*; 7) -2.50000000000000e-01 +*: (*; 8) -2.50000000000000e-01 + +Variable Data: +0 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.y.4.matmat.00002 b/src/test/TEST_structmat/structmat.saved.2D0.y.4.matmat.00002 new file mode 100644 index 0000000000..b37688f36d --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.y.4.matmat.00002 @@ -0,0 +1,42 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 1 + +Grid: +2 +1 +0: (0, 3) x (4, 4) + +Periodic: (10, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (1, -1) +7: (-1, 1) +8: (1, 1) + +Constant Data: +9 +*: (*; 0) 4.00000000000000e+00 +*: (*; 1) -1.50000000000000e+00 +*: (*; 2) -1.50000000000000e+00 +*: (*; 3) 0.00000000000000e+00 +*: (*; 4) 0.00000000000000e+00 +*: (*; 5) -2.50000000000000e-01 +*: (*; 6) -2.50000000000000e-01 +*: (*; 7) -2.50000000000000e-01 +*: (*; 8) -2.50000000000000e-01 + +Variable Data: +0 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.y.4.matmat.00003 b/src/test/TEST_structmat/structmat.saved.2D0.y.4.matmat.00003 new file mode 100644 index 0000000000..cecd1ae03a --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.y.4.matmat.00003 @@ -0,0 +1,42 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 1 + +Grid: +2 +1 +0: (5, 3) x (9, 4) + +Periodic: (10, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (1, -1) +7: (-1, 1) +8: (1, 1) + +Constant Data: +9 +*: (*; 0) 4.00000000000000e+00 +*: (*; 1) -1.50000000000000e+00 +*: (*; 2) -1.50000000000000e+00 +*: (*; 3) 0.00000000000000e+00 +*: (*; 4) 0.00000000000000e+00 +*: (*; 5) -2.50000000000000e-01 +*: (*; 6) -2.50000000000000e-01 +*: (*; 7) -2.50000000000000e-01 +*: (*; 8) -2.50000000000000e-01 + +Variable Data: +0 diff --git a/src/test/TEST_structmat/structmat.saved.2D0.y.matmat.00000 b/src/test/TEST_structmat/structmat.saved.2D0.y.matmat.00000 new file mode 100644 index 0000000000..774651f491 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D0.y.matmat.00000 @@ -0,0 +1,42 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 1 + +Grid: +2 +1 +0: (0, 0) x (9, 4) + +Periodic: (10, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (1, -1) +7: (-1, 1) +8: (1, 1) + +Constant Data: +9 +*: (*; 0) 4.00000000000000e+00 +*: (*; 1) -1.50000000000000e+00 +*: (*; 2) -1.50000000000000e+00 +*: (*; 3) 0.00000000000000e+00 +*: (*; 4) 0.00000000000000e+00 +*: (*; 5) -2.50000000000000e-01 +*: (*; 6) -2.50000000000000e-01 +*: (*; 7) -2.50000000000000e-01 +*: (*; 8) -2.50000000000000e-01 + +Variable Data: +0 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.mv0.4.matvec.00000 b/src/test/TEST_structmat/structmat.saved.2D1.mv0.4.matvec.00000 new file mode 100644 index 0000000000..90984bf2ce --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.mv0.4.matvec.00000 @@ -0,0 +1,36 @@ +StructVector + +Grid: +2 +1 +0: (0, 0) x (4, 4) + +Periodic: (10, 0) + +Data: +1 +0: (0, 0; 0) 1.00000000000000e+00 +0: (1, 0; 0) 1.00000000000000e+00 +0: (2, 0; 0) 1.00000000000000e+00 +0: (3, 0; 0) 1.00000000000000e+00 +0: (4, 0; 0) 1.00000000000000e+00 +0: (0, 1; 0) 0.00000000000000e+00 +0: (1, 1; 0) 0.00000000000000e+00 +0: (2, 1; 0) 0.00000000000000e+00 +0: (3, 1; 0) 0.00000000000000e+00 +0: (4, 1; 0) 0.00000000000000e+00 +0: (0, 2; 0) 0.00000000000000e+00 +0: (1, 2; 0) 0.00000000000000e+00 +0: (2, 2; 0) 0.00000000000000e+00 +0: (3, 2; 0) 0.00000000000000e+00 +0: (4, 2; 0) 0.00000000000000e+00 +0: (0, 3; 0) 0.00000000000000e+00 +0: (1, 3; 0) 0.00000000000000e+00 +0: (2, 3; 0) 0.00000000000000e+00 +0: (3, 3; 0) 0.00000000000000e+00 +0: (4, 3; 0) 0.00000000000000e+00 +0: (0, 4; 0) 0.00000000000000e+00 +0: (1, 4; 0) 0.00000000000000e+00 +0: (2, 4; 0) 0.00000000000000e+00 +0: (3, 4; 0) 0.00000000000000e+00 +0: (4, 4; 0) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.mv0.4.matvec.00001 b/src/test/TEST_structmat/structmat.saved.2D1.mv0.4.matvec.00001 new file mode 100644 index 0000000000..0170838785 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.mv0.4.matvec.00001 @@ -0,0 +1,36 @@ +StructVector + +Grid: +2 +1 +0: (5, 0) x (9, 4) + +Periodic: (10, 0) + +Data: +1 +0: (5, 0; 0) 1.00000000000000e+00 +0: (6, 0; 0) 1.00000000000000e+00 +0: (7, 0; 0) 1.00000000000000e+00 +0: (8, 0; 0) 1.00000000000000e+00 +0: (9, 0; 0) 1.00000000000000e+00 +0: (5, 1; 0) 0.00000000000000e+00 +0: (6, 1; 0) 0.00000000000000e+00 +0: (7, 1; 0) 0.00000000000000e+00 +0: (8, 1; 0) 0.00000000000000e+00 +0: (9, 1; 0) 0.00000000000000e+00 +0: (5, 2; 0) 0.00000000000000e+00 +0: (6, 2; 0) 0.00000000000000e+00 +0: (7, 2; 0) 0.00000000000000e+00 +0: (8, 2; 0) 0.00000000000000e+00 +0: (9, 2; 0) 0.00000000000000e+00 +0: (5, 3; 0) 0.00000000000000e+00 +0: (6, 3; 0) 0.00000000000000e+00 +0: (7, 3; 0) 0.00000000000000e+00 +0: (8, 3; 0) 0.00000000000000e+00 +0: (9, 3; 0) 0.00000000000000e+00 +0: (5, 4; 0) 0.00000000000000e+00 +0: (6, 4; 0) 0.00000000000000e+00 +0: (7, 4; 0) 0.00000000000000e+00 +0: (8, 4; 0) 0.00000000000000e+00 +0: (9, 4; 0) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.mv0.4.matvec.00002 b/src/test/TEST_structmat/structmat.saved.2D1.mv0.4.matvec.00002 new file mode 100644 index 0000000000..f472868a1a --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.mv0.4.matvec.00002 @@ -0,0 +1,36 @@ +StructVector + +Grid: +2 +1 +0: (0, 5) x (4, 9) + +Periodic: (10, 0) + +Data: +1 +0: (0, 5; 0) 0.00000000000000e+00 +0: (1, 5; 0) 0.00000000000000e+00 +0: (2, 5; 0) 0.00000000000000e+00 +0: (3, 5; 0) 0.00000000000000e+00 +0: (4, 5; 0) 0.00000000000000e+00 +0: (0, 6; 0) 0.00000000000000e+00 +0: (1, 6; 0) 0.00000000000000e+00 +0: (2, 6; 0) 0.00000000000000e+00 +0: (3, 6; 0) 0.00000000000000e+00 +0: (4, 6; 0) 0.00000000000000e+00 +0: (0, 7; 0) 0.00000000000000e+00 +0: (1, 7; 0) 0.00000000000000e+00 +0: (2, 7; 0) 0.00000000000000e+00 +0: (3, 7; 0) 0.00000000000000e+00 +0: (4, 7; 0) 0.00000000000000e+00 +0: (0, 8; 0) 0.00000000000000e+00 +0: (1, 8; 0) 0.00000000000000e+00 +0: (2, 8; 0) 0.00000000000000e+00 +0: (3, 8; 0) 0.00000000000000e+00 +0: (4, 8; 0) 0.00000000000000e+00 +0: (0, 9; 0) 1.00000000000000e+00 +0: (1, 9; 0) 1.00000000000000e+00 +0: (2, 9; 0) 1.00000000000000e+00 +0: (3, 9; 0) 1.00000000000000e+00 +0: (4, 9; 0) 1.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.mv0.4.matvec.00003 b/src/test/TEST_structmat/structmat.saved.2D1.mv0.4.matvec.00003 new file mode 100644 index 0000000000..4806742901 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.mv0.4.matvec.00003 @@ -0,0 +1,36 @@ +StructVector + +Grid: +2 +1 +0: (5, 5) x (9, 9) + +Periodic: (10, 0) + +Data: +1 +0: (5, 5; 0) 0.00000000000000e+00 +0: (6, 5; 0) 0.00000000000000e+00 +0: (7, 5; 0) 0.00000000000000e+00 +0: (8, 5; 0) 0.00000000000000e+00 +0: (9, 5; 0) 0.00000000000000e+00 +0: (5, 6; 0) 0.00000000000000e+00 +0: (6, 6; 0) 0.00000000000000e+00 +0: (7, 6; 0) 0.00000000000000e+00 +0: (8, 6; 0) 0.00000000000000e+00 +0: (9, 6; 0) 0.00000000000000e+00 +0: (5, 7; 0) 0.00000000000000e+00 +0: (6, 7; 0) 0.00000000000000e+00 +0: (7, 7; 0) 0.00000000000000e+00 +0: (8, 7; 0) 0.00000000000000e+00 +0: (9, 7; 0) 0.00000000000000e+00 +0: (5, 8; 0) 0.00000000000000e+00 +0: (6, 8; 0) 0.00000000000000e+00 +0: (7, 8; 0) 0.00000000000000e+00 +0: (8, 8; 0) 0.00000000000000e+00 +0: (9, 8; 0) 0.00000000000000e+00 +0: (5, 9; 0) 1.00000000000000e+00 +0: (6, 9; 0) 1.00000000000000e+00 +0: (7, 9; 0) 1.00000000000000e+00 +0: (8, 9; 0) 1.00000000000000e+00 +0: (9, 9; 0) 1.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.mv0.matvec.00000 b/src/test/TEST_structmat/structmat.saved.2D1.mv0.matvec.00000 new file mode 100644 index 0000000000..3d14f5c264 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.mv0.matvec.00000 @@ -0,0 +1,111 @@ +StructVector + +Grid: +2 +1 +0: (0, 0) x (9, 9) + +Periodic: (10, 0) + +Data: +1 +0: (0, 0; 0) 1.00000000000000e+00 +0: (1, 0; 0) 1.00000000000000e+00 +0: (2, 0; 0) 1.00000000000000e+00 +0: (3, 0; 0) 1.00000000000000e+00 +0: (4, 0; 0) 1.00000000000000e+00 +0: (5, 0; 0) 1.00000000000000e+00 +0: (6, 0; 0) 1.00000000000000e+00 +0: (7, 0; 0) 1.00000000000000e+00 +0: (8, 0; 0) 1.00000000000000e+00 +0: (9, 0; 0) 1.00000000000000e+00 +0: (0, 1; 0) 0.00000000000000e+00 +0: (1, 1; 0) 0.00000000000000e+00 +0: (2, 1; 0) 0.00000000000000e+00 +0: (3, 1; 0) 0.00000000000000e+00 +0: (4, 1; 0) 0.00000000000000e+00 +0: (5, 1; 0) 0.00000000000000e+00 +0: (6, 1; 0) 0.00000000000000e+00 +0: (7, 1; 0) 0.00000000000000e+00 +0: (8, 1; 0) 0.00000000000000e+00 +0: (9, 1; 0) 0.00000000000000e+00 +0: (0, 2; 0) 0.00000000000000e+00 +0: (1, 2; 0) 0.00000000000000e+00 +0: (2, 2; 0) 0.00000000000000e+00 +0: (3, 2; 0) 0.00000000000000e+00 +0: (4, 2; 0) 0.00000000000000e+00 +0: (5, 2; 0) 0.00000000000000e+00 +0: (6, 2; 0) 0.00000000000000e+00 +0: (7, 2; 0) 0.00000000000000e+00 +0: (8, 2; 0) 0.00000000000000e+00 +0: (9, 2; 0) 0.00000000000000e+00 +0: (0, 3; 0) 0.00000000000000e+00 +0: (1, 3; 0) 0.00000000000000e+00 +0: (2, 3; 0) 0.00000000000000e+00 +0: (3, 3; 0) 0.00000000000000e+00 +0: (4, 3; 0) 0.00000000000000e+00 +0: (5, 3; 0) 0.00000000000000e+00 +0: (6, 3; 0) 0.00000000000000e+00 +0: (7, 3; 0) 0.00000000000000e+00 +0: (8, 3; 0) 0.00000000000000e+00 +0: (9, 3; 0) 0.00000000000000e+00 +0: (0, 4; 0) 0.00000000000000e+00 +0: (1, 4; 0) 0.00000000000000e+00 +0: (2, 4; 0) 0.00000000000000e+00 +0: (3, 4; 0) 0.00000000000000e+00 +0: (4, 4; 0) 0.00000000000000e+00 +0: (5, 4; 0) 0.00000000000000e+00 +0: (6, 4; 0) 0.00000000000000e+00 +0: (7, 4; 0) 0.00000000000000e+00 +0: (8, 4; 0) 0.00000000000000e+00 +0: (9, 4; 0) 0.00000000000000e+00 +0: (0, 5; 0) 0.00000000000000e+00 +0: (1, 5; 0) 0.00000000000000e+00 +0: (2, 5; 0) 0.00000000000000e+00 +0: (3, 5; 0) 0.00000000000000e+00 +0: (4, 5; 0) 0.00000000000000e+00 +0: (5, 5; 0) 0.00000000000000e+00 +0: (6, 5; 0) 0.00000000000000e+00 +0: (7, 5; 0) 0.00000000000000e+00 +0: (8, 5; 0) 0.00000000000000e+00 +0: (9, 5; 0) 0.00000000000000e+00 +0: (0, 6; 0) 0.00000000000000e+00 +0: (1, 6; 0) 0.00000000000000e+00 +0: (2, 6; 0) 0.00000000000000e+00 +0: (3, 6; 0) 0.00000000000000e+00 +0: (4, 6; 0) 0.00000000000000e+00 +0: (5, 6; 0) 0.00000000000000e+00 +0: (6, 6; 0) 0.00000000000000e+00 +0: (7, 6; 0) 0.00000000000000e+00 +0: (8, 6; 0) 0.00000000000000e+00 +0: (9, 6; 0) 0.00000000000000e+00 +0: (0, 7; 0) 0.00000000000000e+00 +0: (1, 7; 0) 0.00000000000000e+00 +0: (2, 7; 0) 0.00000000000000e+00 +0: (3, 7; 0) 0.00000000000000e+00 +0: (4, 7; 0) 0.00000000000000e+00 +0: (5, 7; 0) 0.00000000000000e+00 +0: (6, 7; 0) 0.00000000000000e+00 +0: (7, 7; 0) 0.00000000000000e+00 +0: (8, 7; 0) 0.00000000000000e+00 +0: (9, 7; 0) 0.00000000000000e+00 +0: (0, 8; 0) 0.00000000000000e+00 +0: (1, 8; 0) 0.00000000000000e+00 +0: (2, 8; 0) 0.00000000000000e+00 +0: (3, 8; 0) 0.00000000000000e+00 +0: (4, 8; 0) 0.00000000000000e+00 +0: (5, 8; 0) 0.00000000000000e+00 +0: (6, 8; 0) 0.00000000000000e+00 +0: (7, 8; 0) 0.00000000000000e+00 +0: (8, 8; 0) 0.00000000000000e+00 +0: (9, 8; 0) 0.00000000000000e+00 +0: (0, 9; 0) 1.00000000000000e+00 +0: (1, 9; 0) 1.00000000000000e+00 +0: (2, 9; 0) 1.00000000000000e+00 +0: (3, 9; 0) 1.00000000000000e+00 +0: (4, 9; 0) 1.00000000000000e+00 +0: (5, 9; 0) 1.00000000000000e+00 +0: (6, 9; 0) 1.00000000000000e+00 +0: (7, 9; 0) 1.00000000000000e+00 +0: (8, 9; 0) 1.00000000000000e+00 +0: (9, 9; 0) 1.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.mv1.4.matvec.00000 b/src/test/TEST_structmat/structmat.saved.2D1.mv1.4.matvec.00000 new file mode 100644 index 0000000000..4648fa984f --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.mv1.4.matvec.00000 @@ -0,0 +1,36 @@ +StructVector + +Grid: +2 +1 +0: (0, 0) x (4, 4) + +Periodic: (10, 0) + +Data: +1 +0: (0, 0; 0) 1.00000000000000e+00 +0: (1, 0; 0) 1.00000000000000e+00 +0: (2, 0; 0) 1.00000000000000e+00 +0: (3, 0; 0) 1.00000000000000e+00 +0: (4, 0; 0) 1.00000000000000e+00 +0: (0, 1; 0) 1.00000000000000e+00 +0: (1, 1; 0) 1.00000000000000e+00 +0: (2, 1; 0) 1.00000000000000e+00 +0: (3, 1; 0) 1.00000000000000e+00 +0: (4, 1; 0) 1.00000000000000e+00 +0: (0, 2; 0) 1.00000000000000e+00 +0: (1, 2; 0) 1.00000000000000e+00 +0: (2, 2; 0) 1.00000000000000e+00 +0: (3, 2; 0) 1.00000000000000e+00 +0: (4, 2; 0) 1.00000000000000e+00 +0: (0, 3; 0) 1.00000000000000e+00 +0: (1, 3; 0) 1.00000000000000e+00 +0: (2, 3; 0) 1.00000000000000e+00 +0: (3, 3; 0) 1.00000000000000e+00 +0: (4, 3; 0) 1.00000000000000e+00 +0: (0, 4; 0) 1.00000000000000e+00 +0: (1, 4; 0) 1.00000000000000e+00 +0: (2, 4; 0) 1.00000000000000e+00 +0: (3, 4; 0) 1.00000000000000e+00 +0: (4, 4; 0) 1.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.mv1.4.matvec.00001 b/src/test/TEST_structmat/structmat.saved.2D1.mv1.4.matvec.00001 new file mode 100644 index 0000000000..f2621e1750 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.mv1.4.matvec.00001 @@ -0,0 +1,36 @@ +StructVector + +Grid: +2 +1 +0: (5, 0) x (9, 4) + +Periodic: (10, 0) + +Data: +1 +0: (5, 0; 0) 1.00000000000000e+00 +0: (6, 0; 0) 1.00000000000000e+00 +0: (7, 0; 0) 1.00000000000000e+00 +0: (8, 0; 0) 1.00000000000000e+00 +0: (9, 0; 0) 1.00000000000000e+00 +0: (5, 1; 0) 1.00000000000000e+00 +0: (6, 1; 0) 1.00000000000000e+00 +0: (7, 1; 0) 1.00000000000000e+00 +0: (8, 1; 0) 1.00000000000000e+00 +0: (9, 1; 0) 1.00000000000000e+00 +0: (5, 2; 0) 1.00000000000000e+00 +0: (6, 2; 0) 1.00000000000000e+00 +0: (7, 2; 0) 1.00000000000000e+00 +0: (8, 2; 0) 1.00000000000000e+00 +0: (9, 2; 0) 1.00000000000000e+00 +0: (5, 3; 0) 1.00000000000000e+00 +0: (6, 3; 0) 1.00000000000000e+00 +0: (7, 3; 0) 1.00000000000000e+00 +0: (8, 3; 0) 1.00000000000000e+00 +0: (9, 3; 0) 1.00000000000000e+00 +0: (5, 4; 0) 1.00000000000000e+00 +0: (6, 4; 0) 1.00000000000000e+00 +0: (7, 4; 0) 1.00000000000000e+00 +0: (8, 4; 0) 1.00000000000000e+00 +0: (9, 4; 0) 1.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.mv1.4.matvec.00002 b/src/test/TEST_structmat/structmat.saved.2D1.mv1.4.matvec.00002 new file mode 100644 index 0000000000..21f5742260 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.mv1.4.matvec.00002 @@ -0,0 +1,36 @@ +StructVector + +Grid: +2 +1 +0: (0, 5) x (4, 9) + +Periodic: (10, 0) + +Data: +1 +0: (0, 5; 0) 1.00000000000000e+00 +0: (1, 5; 0) 1.00000000000000e+00 +0: (2, 5; 0) 1.00000000000000e+00 +0: (3, 5; 0) 1.00000000000000e+00 +0: (4, 5; 0) 1.00000000000000e+00 +0: (0, 6; 0) 1.00000000000000e+00 +0: (1, 6; 0) 1.00000000000000e+00 +0: (2, 6; 0) 1.00000000000000e+00 +0: (3, 6; 0) 1.00000000000000e+00 +0: (4, 6; 0) 1.00000000000000e+00 +0: (0, 7; 0) 1.00000000000000e+00 +0: (1, 7; 0) 1.00000000000000e+00 +0: (2, 7; 0) 1.00000000000000e+00 +0: (3, 7; 0) 1.00000000000000e+00 +0: (4, 7; 0) 1.00000000000000e+00 +0: (0, 8; 0) 1.00000000000000e+00 +0: (1, 8; 0) 1.00000000000000e+00 +0: (2, 8; 0) 1.00000000000000e+00 +0: (3, 8; 0) 1.00000000000000e+00 +0: (4, 8; 0) 1.00000000000000e+00 +0: (0, 9; 0) 1.00000000000000e+00 +0: (1, 9; 0) 1.00000000000000e+00 +0: (2, 9; 0) 1.00000000000000e+00 +0: (3, 9; 0) 1.00000000000000e+00 +0: (4, 9; 0) 1.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.mv1.4.matvec.00003 b/src/test/TEST_structmat/structmat.saved.2D1.mv1.4.matvec.00003 new file mode 100644 index 0000000000..a820bfca22 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.mv1.4.matvec.00003 @@ -0,0 +1,36 @@ +StructVector + +Grid: +2 +1 +0: (5, 5) x (9, 9) + +Periodic: (10, 0) + +Data: +1 +0: (5, 5; 0) 1.00000000000000e+00 +0: (6, 5; 0) 1.00000000000000e+00 +0: (7, 5; 0) 1.00000000000000e+00 +0: (8, 5; 0) 1.00000000000000e+00 +0: (9, 5; 0) 1.00000000000000e+00 +0: (5, 6; 0) 1.00000000000000e+00 +0: (6, 6; 0) 1.00000000000000e+00 +0: (7, 6; 0) 1.00000000000000e+00 +0: (8, 6; 0) 1.00000000000000e+00 +0: (9, 6; 0) 1.00000000000000e+00 +0: (5, 7; 0) 1.00000000000000e+00 +0: (6, 7; 0) 1.00000000000000e+00 +0: (7, 7; 0) 1.00000000000000e+00 +0: (8, 7; 0) 1.00000000000000e+00 +0: (9, 7; 0) 1.00000000000000e+00 +0: (5, 8; 0) 1.00000000000000e+00 +0: (6, 8; 0) 1.00000000000000e+00 +0: (7, 8; 0) 1.00000000000000e+00 +0: (8, 8; 0) 1.00000000000000e+00 +0: (9, 8; 0) 1.00000000000000e+00 +0: (5, 9; 0) 1.00000000000000e+00 +0: (6, 9; 0) 1.00000000000000e+00 +0: (7, 9; 0) 1.00000000000000e+00 +0: (8, 9; 0) 1.00000000000000e+00 +0: (9, 9; 0) 1.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.mv1.matvec.00000 b/src/test/TEST_structmat/structmat.saved.2D1.mv1.matvec.00000 new file mode 100644 index 0000000000..f0a4eb8ad8 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.mv1.matvec.00000 @@ -0,0 +1,111 @@ +StructVector + +Grid: +2 +1 +0: (0, 0) x (9, 9) + +Periodic: (10, 0) + +Data: +1 +0: (0, 0; 0) 1.00000000000000e+00 +0: (1, 0; 0) 1.00000000000000e+00 +0: (2, 0; 0) 1.00000000000000e+00 +0: (3, 0; 0) 1.00000000000000e+00 +0: (4, 0; 0) 1.00000000000000e+00 +0: (5, 0; 0) 1.00000000000000e+00 +0: (6, 0; 0) 1.00000000000000e+00 +0: (7, 0; 0) 1.00000000000000e+00 +0: (8, 0; 0) 1.00000000000000e+00 +0: (9, 0; 0) 1.00000000000000e+00 +0: (0, 1; 0) 1.00000000000000e+00 +0: (1, 1; 0) 1.00000000000000e+00 +0: (2, 1; 0) 1.00000000000000e+00 +0: (3, 1; 0) 1.00000000000000e+00 +0: (4, 1; 0) 1.00000000000000e+00 +0: (5, 1; 0) 1.00000000000000e+00 +0: (6, 1; 0) 1.00000000000000e+00 +0: (7, 1; 0) 1.00000000000000e+00 +0: (8, 1; 0) 1.00000000000000e+00 +0: (9, 1; 0) 1.00000000000000e+00 +0: (0, 2; 0) 1.00000000000000e+00 +0: (1, 2; 0) 1.00000000000000e+00 +0: (2, 2; 0) 1.00000000000000e+00 +0: (3, 2; 0) 1.00000000000000e+00 +0: (4, 2; 0) 1.00000000000000e+00 +0: (5, 2; 0) 1.00000000000000e+00 +0: (6, 2; 0) 1.00000000000000e+00 +0: (7, 2; 0) 1.00000000000000e+00 +0: (8, 2; 0) 1.00000000000000e+00 +0: (9, 2; 0) 1.00000000000000e+00 +0: (0, 3; 0) 1.00000000000000e+00 +0: (1, 3; 0) 1.00000000000000e+00 +0: (2, 3; 0) 1.00000000000000e+00 +0: (3, 3; 0) 1.00000000000000e+00 +0: (4, 3; 0) 1.00000000000000e+00 +0: (5, 3; 0) 1.00000000000000e+00 +0: (6, 3; 0) 1.00000000000000e+00 +0: (7, 3; 0) 1.00000000000000e+00 +0: (8, 3; 0) 1.00000000000000e+00 +0: (9, 3; 0) 1.00000000000000e+00 +0: (0, 4; 0) 1.00000000000000e+00 +0: (1, 4; 0) 1.00000000000000e+00 +0: (2, 4; 0) 1.00000000000000e+00 +0: (3, 4; 0) 1.00000000000000e+00 +0: (4, 4; 0) 1.00000000000000e+00 +0: (5, 4; 0) 1.00000000000000e+00 +0: (6, 4; 0) 1.00000000000000e+00 +0: (7, 4; 0) 1.00000000000000e+00 +0: (8, 4; 0) 1.00000000000000e+00 +0: (9, 4; 0) 1.00000000000000e+00 +0: (0, 5; 0) 1.00000000000000e+00 +0: (1, 5; 0) 1.00000000000000e+00 +0: (2, 5; 0) 1.00000000000000e+00 +0: (3, 5; 0) 1.00000000000000e+00 +0: (4, 5; 0) 1.00000000000000e+00 +0: (5, 5; 0) 1.00000000000000e+00 +0: (6, 5; 0) 1.00000000000000e+00 +0: (7, 5; 0) 1.00000000000000e+00 +0: (8, 5; 0) 1.00000000000000e+00 +0: (9, 5; 0) 1.00000000000000e+00 +0: (0, 6; 0) 1.00000000000000e+00 +0: (1, 6; 0) 1.00000000000000e+00 +0: (2, 6; 0) 1.00000000000000e+00 +0: (3, 6; 0) 1.00000000000000e+00 +0: (4, 6; 0) 1.00000000000000e+00 +0: (5, 6; 0) 1.00000000000000e+00 +0: (6, 6; 0) 1.00000000000000e+00 +0: (7, 6; 0) 1.00000000000000e+00 +0: (8, 6; 0) 1.00000000000000e+00 +0: (9, 6; 0) 1.00000000000000e+00 +0: (0, 7; 0) 1.00000000000000e+00 +0: (1, 7; 0) 1.00000000000000e+00 +0: (2, 7; 0) 1.00000000000000e+00 +0: (3, 7; 0) 1.00000000000000e+00 +0: (4, 7; 0) 1.00000000000000e+00 +0: (5, 7; 0) 1.00000000000000e+00 +0: (6, 7; 0) 1.00000000000000e+00 +0: (7, 7; 0) 1.00000000000000e+00 +0: (8, 7; 0) 1.00000000000000e+00 +0: (9, 7; 0) 1.00000000000000e+00 +0: (0, 8; 0) 1.00000000000000e+00 +0: (1, 8; 0) 1.00000000000000e+00 +0: (2, 8; 0) 1.00000000000000e+00 +0: (3, 8; 0) 1.00000000000000e+00 +0: (4, 8; 0) 1.00000000000000e+00 +0: (5, 8; 0) 1.00000000000000e+00 +0: (6, 8; 0) 1.00000000000000e+00 +0: (7, 8; 0) 1.00000000000000e+00 +0: (8, 8; 0) 1.00000000000000e+00 +0: (9, 8; 0) 1.00000000000000e+00 +0: (0, 9; 0) 1.00000000000000e+00 +0: (1, 9; 0) 1.00000000000000e+00 +0: (2, 9; 0) 1.00000000000000e+00 +0: (3, 9; 0) 1.00000000000000e+00 +0: (4, 9; 0) 1.00000000000000e+00 +0: (5, 9; 0) 1.00000000000000e+00 +0: (6, 9; 0) 1.00000000000000e+00 +0: (7, 9; 0) 1.00000000000000e+00 +0: (8, 9; 0) 1.00000000000000e+00 +0: (9, 9; 0) 1.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.mv2.4.matvec.00000 b/src/test/TEST_structmat/structmat.saved.2D1.mv2.4.matvec.00000 new file mode 100644 index 0000000000..61aeb3d272 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.mv2.4.matvec.00000 @@ -0,0 +1,26 @@ +StructVector + +Grid: +2 +1 +0: (0, 0) x (2, 4) + +Periodic: (5, 0) + +Data: +1 +0: (0, 0; 0) 2.00000000000000e+00 +0: (1, 0; 0) 2.00000000000000e+00 +0: (2, 0; 0) 2.00000000000000e+00 +0: (0, 1; 0) 2.00000000000000e+00 +0: (1, 1; 0) 2.00000000000000e+00 +0: (2, 1; 0) 2.00000000000000e+00 +0: (0, 2; 0) 2.00000000000000e+00 +0: (1, 2; 0) 2.00000000000000e+00 +0: (2, 2; 0) 2.00000000000000e+00 +0: (0, 3; 0) 2.00000000000000e+00 +0: (1, 3; 0) 2.00000000000000e+00 +0: (2, 3; 0) 2.00000000000000e+00 +0: (0, 4; 0) 2.00000000000000e+00 +0: (1, 4; 0) 2.00000000000000e+00 +0: (2, 4; 0) 2.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.mv2.4.matvec.00001 b/src/test/TEST_structmat/structmat.saved.2D1.mv2.4.matvec.00001 new file mode 100644 index 0000000000..1b62f095ca --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.mv2.4.matvec.00001 @@ -0,0 +1,21 @@ +StructVector + +Grid: +2 +1 +0: (3, 0) x (4, 4) + +Periodic: (5, 0) + +Data: +1 +0: (3, 0; 0) 2.00000000000000e+00 +0: (4, 0; 0) 2.00000000000000e+00 +0: (3, 1; 0) 2.00000000000000e+00 +0: (4, 1; 0) 2.00000000000000e+00 +0: (3, 2; 0) 2.00000000000000e+00 +0: (4, 2; 0) 2.00000000000000e+00 +0: (3, 3; 0) 2.00000000000000e+00 +0: (4, 3; 0) 2.00000000000000e+00 +0: (3, 4; 0) 2.00000000000000e+00 +0: (4, 4; 0) 2.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.mv2.4.matvec.00002 b/src/test/TEST_structmat/structmat.saved.2D1.mv2.4.matvec.00002 new file mode 100644 index 0000000000..8ca564a3bb --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.mv2.4.matvec.00002 @@ -0,0 +1,26 @@ +StructVector + +Grid: +2 +1 +0: (0, 5) x (2, 9) + +Periodic: (5, 0) + +Data: +1 +0: (0, 5; 0) 2.00000000000000e+00 +0: (1, 5; 0) 2.00000000000000e+00 +0: (2, 5; 0) 2.00000000000000e+00 +0: (0, 6; 0) 2.00000000000000e+00 +0: (1, 6; 0) 2.00000000000000e+00 +0: (2, 6; 0) 2.00000000000000e+00 +0: (0, 7; 0) 2.00000000000000e+00 +0: (1, 7; 0) 2.00000000000000e+00 +0: (2, 7; 0) 2.00000000000000e+00 +0: (0, 8; 0) 2.00000000000000e+00 +0: (1, 8; 0) 2.00000000000000e+00 +0: (2, 8; 0) 2.00000000000000e+00 +0: (0, 9; 0) 2.00000000000000e+00 +0: (1, 9; 0) 2.00000000000000e+00 +0: (2, 9; 0) 2.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.mv2.4.matvec.00003 b/src/test/TEST_structmat/structmat.saved.2D1.mv2.4.matvec.00003 new file mode 100644 index 0000000000..77321e7bc7 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.mv2.4.matvec.00003 @@ -0,0 +1,21 @@ +StructVector + +Grid: +2 +1 +0: (3, 5) x (4, 9) + +Periodic: (5, 0) + +Data: +1 +0: (3, 5; 0) 2.00000000000000e+00 +0: (4, 5; 0) 2.00000000000000e+00 +0: (3, 6; 0) 2.00000000000000e+00 +0: (4, 6; 0) 2.00000000000000e+00 +0: (3, 7; 0) 2.00000000000000e+00 +0: (4, 7; 0) 2.00000000000000e+00 +0: (3, 8; 0) 2.00000000000000e+00 +0: (4, 8; 0) 2.00000000000000e+00 +0: (3, 9; 0) 2.00000000000000e+00 +0: (4, 9; 0) 2.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.mv2.matvec.00000 b/src/test/TEST_structmat/structmat.saved.2D1.mv2.matvec.00000 new file mode 100644 index 0000000000..5ceed23c70 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.mv2.matvec.00000 @@ -0,0 +1,61 @@ +StructVector + +Grid: +2 +1 +0: (0, 0) x (4, 9) + +Periodic: (5, 0) + +Data: +1 +0: (0, 0; 0) 2.00000000000000e+00 +0: (1, 0; 0) 2.00000000000000e+00 +0: (2, 0; 0) 2.00000000000000e+00 +0: (3, 0; 0) 2.00000000000000e+00 +0: (4, 0; 0) 2.00000000000000e+00 +0: (0, 1; 0) 2.00000000000000e+00 +0: (1, 1; 0) 2.00000000000000e+00 +0: (2, 1; 0) 2.00000000000000e+00 +0: (3, 1; 0) 2.00000000000000e+00 +0: (4, 1; 0) 2.00000000000000e+00 +0: (0, 2; 0) 2.00000000000000e+00 +0: (1, 2; 0) 2.00000000000000e+00 +0: (2, 2; 0) 2.00000000000000e+00 +0: (3, 2; 0) 2.00000000000000e+00 +0: (4, 2; 0) 2.00000000000000e+00 +0: (0, 3; 0) 2.00000000000000e+00 +0: (1, 3; 0) 2.00000000000000e+00 +0: (2, 3; 0) 2.00000000000000e+00 +0: (3, 3; 0) 2.00000000000000e+00 +0: (4, 3; 0) 2.00000000000000e+00 +0: (0, 4; 0) 2.00000000000000e+00 +0: (1, 4; 0) 2.00000000000000e+00 +0: (2, 4; 0) 2.00000000000000e+00 +0: (3, 4; 0) 2.00000000000000e+00 +0: (4, 4; 0) 2.00000000000000e+00 +0: (0, 5; 0) 2.00000000000000e+00 +0: (1, 5; 0) 2.00000000000000e+00 +0: (2, 5; 0) 2.00000000000000e+00 +0: (3, 5; 0) 2.00000000000000e+00 +0: (4, 5; 0) 2.00000000000000e+00 +0: (0, 6; 0) 2.00000000000000e+00 +0: (1, 6; 0) 2.00000000000000e+00 +0: (2, 6; 0) 2.00000000000000e+00 +0: (3, 6; 0) 2.00000000000000e+00 +0: (4, 6; 0) 2.00000000000000e+00 +0: (0, 7; 0) 2.00000000000000e+00 +0: (1, 7; 0) 2.00000000000000e+00 +0: (2, 7; 0) 2.00000000000000e+00 +0: (3, 7; 0) 2.00000000000000e+00 +0: (4, 7; 0) 2.00000000000000e+00 +0: (0, 8; 0) 2.00000000000000e+00 +0: (1, 8; 0) 2.00000000000000e+00 +0: (2, 8; 0) 2.00000000000000e+00 +0: (3, 8; 0) 2.00000000000000e+00 +0: (4, 8; 0) 2.00000000000000e+00 +0: (0, 9; 0) 2.00000000000000e+00 +0: (1, 9; 0) 2.00000000000000e+00 +0: (2, 9; 0) 2.00000000000000e+00 +0: (3, 9; 0) 2.00000000000000e+00 +0: (4, 9; 0) 2.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.mv3.4.matvec.00000 b/src/test/TEST_structmat/structmat.saved.2D1.mv3.4.matvec.00000 new file mode 100644 index 0000000000..4648fa984f --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.mv3.4.matvec.00000 @@ -0,0 +1,36 @@ +StructVector + +Grid: +2 +1 +0: (0, 0) x (4, 4) + +Periodic: (10, 0) + +Data: +1 +0: (0, 0; 0) 1.00000000000000e+00 +0: (1, 0; 0) 1.00000000000000e+00 +0: (2, 0; 0) 1.00000000000000e+00 +0: (3, 0; 0) 1.00000000000000e+00 +0: (4, 0; 0) 1.00000000000000e+00 +0: (0, 1; 0) 1.00000000000000e+00 +0: (1, 1; 0) 1.00000000000000e+00 +0: (2, 1; 0) 1.00000000000000e+00 +0: (3, 1; 0) 1.00000000000000e+00 +0: (4, 1; 0) 1.00000000000000e+00 +0: (0, 2; 0) 1.00000000000000e+00 +0: (1, 2; 0) 1.00000000000000e+00 +0: (2, 2; 0) 1.00000000000000e+00 +0: (3, 2; 0) 1.00000000000000e+00 +0: (4, 2; 0) 1.00000000000000e+00 +0: (0, 3; 0) 1.00000000000000e+00 +0: (1, 3; 0) 1.00000000000000e+00 +0: (2, 3; 0) 1.00000000000000e+00 +0: (3, 3; 0) 1.00000000000000e+00 +0: (4, 3; 0) 1.00000000000000e+00 +0: (0, 4; 0) 1.00000000000000e+00 +0: (1, 4; 0) 1.00000000000000e+00 +0: (2, 4; 0) 1.00000000000000e+00 +0: (3, 4; 0) 1.00000000000000e+00 +0: (4, 4; 0) 1.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.mv3.4.matvec.00001 b/src/test/TEST_structmat/structmat.saved.2D1.mv3.4.matvec.00001 new file mode 100644 index 0000000000..f2621e1750 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.mv3.4.matvec.00001 @@ -0,0 +1,36 @@ +StructVector + +Grid: +2 +1 +0: (5, 0) x (9, 4) + +Periodic: (10, 0) + +Data: +1 +0: (5, 0; 0) 1.00000000000000e+00 +0: (6, 0; 0) 1.00000000000000e+00 +0: (7, 0; 0) 1.00000000000000e+00 +0: (8, 0; 0) 1.00000000000000e+00 +0: (9, 0; 0) 1.00000000000000e+00 +0: (5, 1; 0) 1.00000000000000e+00 +0: (6, 1; 0) 1.00000000000000e+00 +0: (7, 1; 0) 1.00000000000000e+00 +0: (8, 1; 0) 1.00000000000000e+00 +0: (9, 1; 0) 1.00000000000000e+00 +0: (5, 2; 0) 1.00000000000000e+00 +0: (6, 2; 0) 1.00000000000000e+00 +0: (7, 2; 0) 1.00000000000000e+00 +0: (8, 2; 0) 1.00000000000000e+00 +0: (9, 2; 0) 1.00000000000000e+00 +0: (5, 3; 0) 1.00000000000000e+00 +0: (6, 3; 0) 1.00000000000000e+00 +0: (7, 3; 0) 1.00000000000000e+00 +0: (8, 3; 0) 1.00000000000000e+00 +0: (9, 3; 0) 1.00000000000000e+00 +0: (5, 4; 0) 1.00000000000000e+00 +0: (6, 4; 0) 1.00000000000000e+00 +0: (7, 4; 0) 1.00000000000000e+00 +0: (8, 4; 0) 1.00000000000000e+00 +0: (9, 4; 0) 1.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.mv3.4.matvec.00002 b/src/test/TEST_structmat/structmat.saved.2D1.mv3.4.matvec.00002 new file mode 100644 index 0000000000..3aaa29a69f --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.mv3.4.matvec.00002 @@ -0,0 +1,36 @@ +StructVector + +Grid: +2 +1 +0: (0, 5) x (4, 9) + +Periodic: (10, 0) + +Data: +1 +0: (0, 5; 0) 1.00000000000000e+00 +0: (1, 5; 0) 1.00000000000000e+00 +0: (2, 5; 0) 1.00000000000000e+00 +0: (3, 5; 0) 1.00000000000000e+00 +0: (4, 5; 0) 1.00000000000000e+00 +0: (0, 6; 0) 1.00000000000000e+00 +0: (1, 6; 0) 1.00000000000000e+00 +0: (2, 6; 0) 1.00000000000000e+00 +0: (3, 6; 0) 1.00000000000000e+00 +0: (4, 6; 0) 1.00000000000000e+00 +0: (0, 7; 0) 1.00000000000000e+00 +0: (1, 7; 0) 1.00000000000000e+00 +0: (2, 7; 0) 1.00000000000000e+00 +0: (3, 7; 0) 1.00000000000000e+00 +0: (4, 7; 0) 1.00000000000000e+00 +0: (0, 8; 0) 1.00000000000000e+00 +0: (1, 8; 0) 1.00000000000000e+00 +0: (2, 8; 0) 1.00000000000000e+00 +0: (3, 8; 0) 1.00000000000000e+00 +0: (4, 8; 0) 1.00000000000000e+00 +0: (0, 9; 0) 5.00000000000000e-01 +0: (1, 9; 0) 5.00000000000000e-01 +0: (2, 9; 0) 5.00000000000000e-01 +0: (3, 9; 0) 5.00000000000000e-01 +0: (4, 9; 0) 5.00000000000000e-01 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.mv3.4.matvec.00003 b/src/test/TEST_structmat/structmat.saved.2D1.mv3.4.matvec.00003 new file mode 100644 index 0000000000..2fa0a4d1a9 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.mv3.4.matvec.00003 @@ -0,0 +1,36 @@ +StructVector + +Grid: +2 +1 +0: (5, 5) x (9, 9) + +Periodic: (10, 0) + +Data: +1 +0: (5, 5; 0) 1.00000000000000e+00 +0: (6, 5; 0) 1.00000000000000e+00 +0: (7, 5; 0) 1.00000000000000e+00 +0: (8, 5; 0) 1.00000000000000e+00 +0: (9, 5; 0) 1.00000000000000e+00 +0: (5, 6; 0) 1.00000000000000e+00 +0: (6, 6; 0) 1.00000000000000e+00 +0: (7, 6; 0) 1.00000000000000e+00 +0: (8, 6; 0) 1.00000000000000e+00 +0: (9, 6; 0) 1.00000000000000e+00 +0: (5, 7; 0) 1.00000000000000e+00 +0: (6, 7; 0) 1.00000000000000e+00 +0: (7, 7; 0) 1.00000000000000e+00 +0: (8, 7; 0) 1.00000000000000e+00 +0: (9, 7; 0) 1.00000000000000e+00 +0: (5, 8; 0) 1.00000000000000e+00 +0: (6, 8; 0) 1.00000000000000e+00 +0: (7, 8; 0) 1.00000000000000e+00 +0: (8, 8; 0) 1.00000000000000e+00 +0: (9, 8; 0) 1.00000000000000e+00 +0: (5, 9; 0) 5.00000000000000e-01 +0: (6, 9; 0) 5.00000000000000e-01 +0: (7, 9; 0) 5.00000000000000e-01 +0: (8, 9; 0) 5.00000000000000e-01 +0: (9, 9; 0) 5.00000000000000e-01 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.mv3.matvec.00000 b/src/test/TEST_structmat/structmat.saved.2D1.mv3.matvec.00000 new file mode 100644 index 0000000000..a669618426 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.mv3.matvec.00000 @@ -0,0 +1,111 @@ +StructVector + +Grid: +2 +1 +0: (0, 0) x (9, 9) + +Periodic: (10, 0) + +Data: +1 +0: (0, 0; 0) 1.00000000000000e+00 +0: (1, 0; 0) 1.00000000000000e+00 +0: (2, 0; 0) 1.00000000000000e+00 +0: (3, 0; 0) 1.00000000000000e+00 +0: (4, 0; 0) 1.00000000000000e+00 +0: (5, 0; 0) 1.00000000000000e+00 +0: (6, 0; 0) 1.00000000000000e+00 +0: (7, 0; 0) 1.00000000000000e+00 +0: (8, 0; 0) 1.00000000000000e+00 +0: (9, 0; 0) 1.00000000000000e+00 +0: (0, 1; 0) 1.00000000000000e+00 +0: (1, 1; 0) 1.00000000000000e+00 +0: (2, 1; 0) 1.00000000000000e+00 +0: (3, 1; 0) 1.00000000000000e+00 +0: (4, 1; 0) 1.00000000000000e+00 +0: (5, 1; 0) 1.00000000000000e+00 +0: (6, 1; 0) 1.00000000000000e+00 +0: (7, 1; 0) 1.00000000000000e+00 +0: (8, 1; 0) 1.00000000000000e+00 +0: (9, 1; 0) 1.00000000000000e+00 +0: (0, 2; 0) 1.00000000000000e+00 +0: (1, 2; 0) 1.00000000000000e+00 +0: (2, 2; 0) 1.00000000000000e+00 +0: (3, 2; 0) 1.00000000000000e+00 +0: (4, 2; 0) 1.00000000000000e+00 +0: (5, 2; 0) 1.00000000000000e+00 +0: (6, 2; 0) 1.00000000000000e+00 +0: (7, 2; 0) 1.00000000000000e+00 +0: (8, 2; 0) 1.00000000000000e+00 +0: (9, 2; 0) 1.00000000000000e+00 +0: (0, 3; 0) 1.00000000000000e+00 +0: (1, 3; 0) 1.00000000000000e+00 +0: (2, 3; 0) 1.00000000000000e+00 +0: (3, 3; 0) 1.00000000000000e+00 +0: (4, 3; 0) 1.00000000000000e+00 +0: (5, 3; 0) 1.00000000000000e+00 +0: (6, 3; 0) 1.00000000000000e+00 +0: (7, 3; 0) 1.00000000000000e+00 +0: (8, 3; 0) 1.00000000000000e+00 +0: (9, 3; 0) 1.00000000000000e+00 +0: (0, 4; 0) 1.00000000000000e+00 +0: (1, 4; 0) 1.00000000000000e+00 +0: (2, 4; 0) 1.00000000000000e+00 +0: (3, 4; 0) 1.00000000000000e+00 +0: (4, 4; 0) 1.00000000000000e+00 +0: (5, 4; 0) 1.00000000000000e+00 +0: (6, 4; 0) 1.00000000000000e+00 +0: (7, 4; 0) 1.00000000000000e+00 +0: (8, 4; 0) 1.00000000000000e+00 +0: (9, 4; 0) 1.00000000000000e+00 +0: (0, 5; 0) 1.00000000000000e+00 +0: (1, 5; 0) 1.00000000000000e+00 +0: (2, 5; 0) 1.00000000000000e+00 +0: (3, 5; 0) 1.00000000000000e+00 +0: (4, 5; 0) 1.00000000000000e+00 +0: (5, 5; 0) 1.00000000000000e+00 +0: (6, 5; 0) 1.00000000000000e+00 +0: (7, 5; 0) 1.00000000000000e+00 +0: (8, 5; 0) 1.00000000000000e+00 +0: (9, 5; 0) 1.00000000000000e+00 +0: (0, 6; 0) 1.00000000000000e+00 +0: (1, 6; 0) 1.00000000000000e+00 +0: (2, 6; 0) 1.00000000000000e+00 +0: (3, 6; 0) 1.00000000000000e+00 +0: (4, 6; 0) 1.00000000000000e+00 +0: (5, 6; 0) 1.00000000000000e+00 +0: (6, 6; 0) 1.00000000000000e+00 +0: (7, 6; 0) 1.00000000000000e+00 +0: (8, 6; 0) 1.00000000000000e+00 +0: (9, 6; 0) 1.00000000000000e+00 +0: (0, 7; 0) 1.00000000000000e+00 +0: (1, 7; 0) 1.00000000000000e+00 +0: (2, 7; 0) 1.00000000000000e+00 +0: (3, 7; 0) 1.00000000000000e+00 +0: (4, 7; 0) 1.00000000000000e+00 +0: (5, 7; 0) 1.00000000000000e+00 +0: (6, 7; 0) 1.00000000000000e+00 +0: (7, 7; 0) 1.00000000000000e+00 +0: (8, 7; 0) 1.00000000000000e+00 +0: (9, 7; 0) 1.00000000000000e+00 +0: (0, 8; 0) 1.00000000000000e+00 +0: (1, 8; 0) 1.00000000000000e+00 +0: (2, 8; 0) 1.00000000000000e+00 +0: (3, 8; 0) 1.00000000000000e+00 +0: (4, 8; 0) 1.00000000000000e+00 +0: (5, 8; 0) 1.00000000000000e+00 +0: (6, 8; 0) 1.00000000000000e+00 +0: (7, 8; 0) 1.00000000000000e+00 +0: (8, 8; 0) 1.00000000000000e+00 +0: (9, 8; 0) 1.00000000000000e+00 +0: (0, 9; 0) 5.00000000000000e-01 +0: (1, 9; 0) 5.00000000000000e-01 +0: (2, 9; 0) 5.00000000000000e-01 +0: (3, 9; 0) 5.00000000000000e-01 +0: (4, 9; 0) 5.00000000000000e-01 +0: (5, 9; 0) 5.00000000000000e-01 +0: (6, 9; 0) 5.00000000000000e-01 +0: (7, 9; 0) 5.00000000000000e-01 +0: (8, 9; 0) 5.00000000000000e-01 +0: (9, 9; 0) 5.00000000000000e-01 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.mv4.4.matvec.00000 b/src/test/TEST_structmat/structmat.saved.2D1.mv4.4.matvec.00000 new file mode 100644 index 0000000000..ac48879194 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.mv4.4.matvec.00000 @@ -0,0 +1,26 @@ +StructVector + +Grid: +2 +1 +0: (0, 0) x (4, 2) + +Periodic: (10, 0) + +Data: +1 +0: (0, 0; 0) 1.50000000000000e+00 +0: (1, 0; 0) 1.50000000000000e+00 +0: (2, 0; 0) 1.50000000000000e+00 +0: (3, 0; 0) 1.50000000000000e+00 +0: (4, 0; 0) 1.50000000000000e+00 +0: (0, 1; 0) 2.00000000000000e+00 +0: (1, 1; 0) 2.00000000000000e+00 +0: (2, 1; 0) 2.00000000000000e+00 +0: (3, 1; 0) 2.00000000000000e+00 +0: (4, 1; 0) 2.00000000000000e+00 +0: (0, 2; 0) 2.00000000000000e+00 +0: (1, 2; 0) 2.00000000000000e+00 +0: (2, 2; 0) 2.00000000000000e+00 +0: (3, 2; 0) 2.00000000000000e+00 +0: (4, 2; 0) 2.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.mv4.4.matvec.00001 b/src/test/TEST_structmat/structmat.saved.2D1.mv4.4.matvec.00001 new file mode 100644 index 0000000000..4e30453b4f --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.mv4.4.matvec.00001 @@ -0,0 +1,26 @@ +StructVector + +Grid: +2 +1 +0: (5, 0) x (9, 2) + +Periodic: (10, 0) + +Data: +1 +0: (5, 0; 0) 1.50000000000000e+00 +0: (6, 0; 0) 1.50000000000000e+00 +0: (7, 0; 0) 1.50000000000000e+00 +0: (8, 0; 0) 1.50000000000000e+00 +0: (9, 0; 0) 1.50000000000000e+00 +0: (5, 1; 0) 2.00000000000000e+00 +0: (6, 1; 0) 2.00000000000000e+00 +0: (7, 1; 0) 2.00000000000000e+00 +0: (8, 1; 0) 2.00000000000000e+00 +0: (9, 1; 0) 2.00000000000000e+00 +0: (5, 2; 0) 2.00000000000000e+00 +0: (6, 2; 0) 2.00000000000000e+00 +0: (7, 2; 0) 2.00000000000000e+00 +0: (8, 2; 0) 2.00000000000000e+00 +0: (9, 2; 0) 2.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.mv4.4.matvec.00002 b/src/test/TEST_structmat/structmat.saved.2D1.mv4.4.matvec.00002 new file mode 100644 index 0000000000..62ba7fc924 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.mv4.4.matvec.00002 @@ -0,0 +1,21 @@ +StructVector + +Grid: +2 +1 +0: (0, 3) x (4, 4) + +Periodic: (10, 0) + +Data: +1 +0: (0, 3; 0) 2.00000000000000e+00 +0: (1, 3; 0) 2.00000000000000e+00 +0: (2, 3; 0) 2.00000000000000e+00 +0: (3, 3; 0) 2.00000000000000e+00 +0: (4, 3; 0) 2.00000000000000e+00 +0: (0, 4; 0) 2.00000000000000e+00 +0: (1, 4; 0) 2.00000000000000e+00 +0: (2, 4; 0) 2.00000000000000e+00 +0: (3, 4; 0) 2.00000000000000e+00 +0: (4, 4; 0) 2.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.mv4.4.matvec.00003 b/src/test/TEST_structmat/structmat.saved.2D1.mv4.4.matvec.00003 new file mode 100644 index 0000000000..c400b74a8b --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.mv4.4.matvec.00003 @@ -0,0 +1,21 @@ +StructVector + +Grid: +2 +1 +0: (5, 3) x (9, 4) + +Periodic: (10, 0) + +Data: +1 +0: (5, 3; 0) 2.00000000000000e+00 +0: (6, 3; 0) 2.00000000000000e+00 +0: (7, 3; 0) 2.00000000000000e+00 +0: (8, 3; 0) 2.00000000000000e+00 +0: (9, 3; 0) 2.00000000000000e+00 +0: (5, 4; 0) 2.00000000000000e+00 +0: (6, 4; 0) 2.00000000000000e+00 +0: (7, 4; 0) 2.00000000000000e+00 +0: (8, 4; 0) 2.00000000000000e+00 +0: (9, 4; 0) 2.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.mv4.matvec.00000 b/src/test/TEST_structmat/structmat.saved.2D1.mv4.matvec.00000 new file mode 100644 index 0000000000..5edd8be383 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.mv4.matvec.00000 @@ -0,0 +1,61 @@ +StructVector + +Grid: +2 +1 +0: (0, 0) x (9, 4) + +Periodic: (10, 0) + +Data: +1 +0: (0, 0; 0) 1.50000000000000e+00 +0: (1, 0; 0) 1.50000000000000e+00 +0: (2, 0; 0) 1.50000000000000e+00 +0: (3, 0; 0) 1.50000000000000e+00 +0: (4, 0; 0) 1.50000000000000e+00 +0: (5, 0; 0) 1.50000000000000e+00 +0: (6, 0; 0) 1.50000000000000e+00 +0: (7, 0; 0) 1.50000000000000e+00 +0: (8, 0; 0) 1.50000000000000e+00 +0: (9, 0; 0) 1.50000000000000e+00 +0: (0, 1; 0) 2.00000000000000e+00 +0: (1, 1; 0) 2.00000000000000e+00 +0: (2, 1; 0) 2.00000000000000e+00 +0: (3, 1; 0) 2.00000000000000e+00 +0: (4, 1; 0) 2.00000000000000e+00 +0: (5, 1; 0) 2.00000000000000e+00 +0: (6, 1; 0) 2.00000000000000e+00 +0: (7, 1; 0) 2.00000000000000e+00 +0: (8, 1; 0) 2.00000000000000e+00 +0: (9, 1; 0) 2.00000000000000e+00 +0: (0, 2; 0) 2.00000000000000e+00 +0: (1, 2; 0) 2.00000000000000e+00 +0: (2, 2; 0) 2.00000000000000e+00 +0: (3, 2; 0) 2.00000000000000e+00 +0: (4, 2; 0) 2.00000000000000e+00 +0: (5, 2; 0) 2.00000000000000e+00 +0: (6, 2; 0) 2.00000000000000e+00 +0: (7, 2; 0) 2.00000000000000e+00 +0: (8, 2; 0) 2.00000000000000e+00 +0: (9, 2; 0) 2.00000000000000e+00 +0: (0, 3; 0) 2.00000000000000e+00 +0: (1, 3; 0) 2.00000000000000e+00 +0: (2, 3; 0) 2.00000000000000e+00 +0: (3, 3; 0) 2.00000000000000e+00 +0: (4, 3; 0) 2.00000000000000e+00 +0: (5, 3; 0) 2.00000000000000e+00 +0: (6, 3; 0) 2.00000000000000e+00 +0: (7, 3; 0) 2.00000000000000e+00 +0: (8, 3; 0) 2.00000000000000e+00 +0: (9, 3; 0) 2.00000000000000e+00 +0: (0, 4; 0) 2.00000000000000e+00 +0: (1, 4; 0) 2.00000000000000e+00 +0: (2, 4; 0) 2.00000000000000e+00 +0: (3, 4; 0) 2.00000000000000e+00 +0: (4, 4; 0) 2.00000000000000e+00 +0: (5, 4; 0) 2.00000000000000e+00 +0: (6, 4; 0) 2.00000000000000e+00 +0: (7, 4; 0) 2.00000000000000e+00 +0: (8, 4; 0) 2.00000000000000e+00 +0: (9, 4; 0) 2.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.sym.x.4.matmat.00000 b/src/test/TEST_structmat/structmat.saved.2D1.sym.x.4.matmat.00000 new file mode 100644 index 0000000000..8b1b1fa36a --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.sym.x.4.matmat.00000 @@ -0,0 +1,108 @@ +StructMatrix + +Symmetric: 1 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (0, 0) x (2, 4) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +5 +0: (0, 0; 0) 4.00000000000000e+00 +0: (0, 0; 1) 0.00000000000000e+00 +0: (0, 0; 3) 0.00000000000000e+00 +0: (0, 0; 5) 0.00000000000000e+00 +0: (0, 0; 6) -2.50000000000000e-01 +0: (1, 0; 0) 4.00000000000000e+00 +0: (1, 0; 1) 0.00000000000000e+00 +0: (1, 0; 3) 0.00000000000000e+00 +0: (1, 0; 5) 0.00000000000000e+00 +0: (1, 0; 6) -2.50000000000000e-01 +0: (2, 0; 0) 4.00000000000000e+00 +0: (2, 0; 1) 0.00000000000000e+00 +0: (2, 0; 3) 0.00000000000000e+00 +0: (2, 0; 5) 0.00000000000000e+00 +0: (2, 0; 6) -2.50000000000000e-01 +0: (0, 1; 0) 4.00000000000000e+00 +0: (0, 1; 1) 0.00000000000000e+00 +0: (0, 1; 3) -1.50000000000000e+00 +0: (0, 1; 5) -2.50000000000000e-01 +0: (0, 1; 6) -2.50000000000000e-01 +0: (1, 1; 0) 4.00000000000000e+00 +0: (1, 1; 1) 0.00000000000000e+00 +0: (1, 1; 3) -1.50000000000000e+00 +0: (1, 1; 5) -2.50000000000000e-01 +0: (1, 1; 6) -2.50000000000000e-01 +0: (2, 1; 0) 4.00000000000000e+00 +0: (2, 1; 1) 0.00000000000000e+00 +0: (2, 1; 3) -1.50000000000000e+00 +0: (2, 1; 5) -2.50000000000000e-01 +0: (2, 1; 6) -2.50000000000000e-01 +0: (0, 2; 0) 4.00000000000000e+00 +0: (0, 2; 1) 0.00000000000000e+00 +0: (0, 2; 3) -1.50000000000000e+00 +0: (0, 2; 5) -2.50000000000000e-01 +0: (0, 2; 6) -2.50000000000000e-01 +0: (1, 2; 0) 4.00000000000000e+00 +0: (1, 2; 1) 0.00000000000000e+00 +0: (1, 2; 3) -1.50000000000000e+00 +0: (1, 2; 5) -2.50000000000000e-01 +0: (1, 2; 6) -2.50000000000000e-01 +0: (2, 2; 0) 4.00000000000000e+00 +0: (2, 2; 1) 0.00000000000000e+00 +0: (2, 2; 3) -1.50000000000000e+00 +0: (2, 2; 5) -2.50000000000000e-01 +0: (2, 2; 6) -2.50000000000000e-01 +0: (0, 3; 0) 4.00000000000000e+00 +0: (0, 3; 1) 0.00000000000000e+00 +0: (0, 3; 3) -1.50000000000000e+00 +0: (0, 3; 5) -2.50000000000000e-01 +0: (0, 3; 6) -2.50000000000000e-01 +0: (1, 3; 0) 4.00000000000000e+00 +0: (1, 3; 1) 0.00000000000000e+00 +0: (1, 3; 3) -1.50000000000000e+00 +0: (1, 3; 5) -2.50000000000000e-01 +0: (1, 3; 6) -2.50000000000000e-01 +0: (2, 3; 0) 4.00000000000000e+00 +0: (2, 3; 1) 0.00000000000000e+00 +0: (2, 3; 3) -1.50000000000000e+00 +0: (2, 3; 5) -2.50000000000000e-01 +0: (2, 3; 6) -2.50000000000000e-01 +0: (0, 4; 0) 4.00000000000000e+00 +0: (0, 4; 1) 0.00000000000000e+00 +0: (0, 4; 3) -1.50000000000000e+00 +0: (0, 4; 5) -2.50000000000000e-01 +0: (0, 4; 6) -2.50000000000000e-01 +0: (1, 4; 0) 4.00000000000000e+00 +0: (1, 4; 1) 0.00000000000000e+00 +0: (1, 4; 3) -1.50000000000000e+00 +0: (1, 4; 5) -2.50000000000000e-01 +0: (1, 4; 6) -2.50000000000000e-01 +0: (2, 4; 0) 4.00000000000000e+00 +0: (2, 4; 1) 0.00000000000000e+00 +0: (2, 4; 3) -1.50000000000000e+00 +0: (2, 4; 5) -2.50000000000000e-01 +0: (2, 4; 6) -2.50000000000000e-01 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.sym.x.4.matmat.00001 b/src/test/TEST_structmat/structmat.saved.2D1.sym.x.4.matmat.00001 new file mode 100644 index 0000000000..6abad0889b --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.sym.x.4.matmat.00001 @@ -0,0 +1,83 @@ +StructMatrix + +Symmetric: 1 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (3, 0) x (4, 4) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +5 +0: (3, 0; 0) 4.00000000000000e+00 +0: (3, 0; 1) 0.00000000000000e+00 +0: (3, 0; 3) 0.00000000000000e+00 +0: (3, 0; 5) 0.00000000000000e+00 +0: (3, 0; 6) -2.50000000000000e-01 +0: (4, 0; 0) 4.00000000000000e+00 +0: (4, 0; 1) 0.00000000000000e+00 +0: (4, 0; 3) 0.00000000000000e+00 +0: (4, 0; 5) 0.00000000000000e+00 +0: (4, 0; 6) -2.50000000000000e-01 +0: (3, 1; 0) 4.00000000000000e+00 +0: (3, 1; 1) 0.00000000000000e+00 +0: (3, 1; 3) -1.50000000000000e+00 +0: (3, 1; 5) -2.50000000000000e-01 +0: (3, 1; 6) -2.50000000000000e-01 +0: (4, 1; 0) 4.00000000000000e+00 +0: (4, 1; 1) 0.00000000000000e+00 +0: (4, 1; 3) -1.50000000000000e+00 +0: (4, 1; 5) -2.50000000000000e-01 +0: (4, 1; 6) -2.50000000000000e-01 +0: (3, 2; 0) 4.00000000000000e+00 +0: (3, 2; 1) 0.00000000000000e+00 +0: (3, 2; 3) -1.50000000000000e+00 +0: (3, 2; 5) -2.50000000000000e-01 +0: (3, 2; 6) -2.50000000000000e-01 +0: (4, 2; 0) 4.00000000000000e+00 +0: (4, 2; 1) 0.00000000000000e+00 +0: (4, 2; 3) -1.50000000000000e+00 +0: (4, 2; 5) -2.50000000000000e-01 +0: (4, 2; 6) -2.50000000000000e-01 +0: (3, 3; 0) 4.00000000000000e+00 +0: (3, 3; 1) 0.00000000000000e+00 +0: (3, 3; 3) -1.50000000000000e+00 +0: (3, 3; 5) -2.50000000000000e-01 +0: (3, 3; 6) -2.50000000000000e-01 +0: (4, 3; 0) 4.00000000000000e+00 +0: (4, 3; 1) 0.00000000000000e+00 +0: (4, 3; 3) -1.50000000000000e+00 +0: (4, 3; 5) -2.50000000000000e-01 +0: (4, 3; 6) -2.50000000000000e-01 +0: (3, 4; 0) 4.00000000000000e+00 +0: (3, 4; 1) 0.00000000000000e+00 +0: (3, 4; 3) -1.50000000000000e+00 +0: (3, 4; 5) -2.50000000000000e-01 +0: (3, 4; 6) -2.50000000000000e-01 +0: (4, 4; 0) 4.00000000000000e+00 +0: (4, 4; 1) 0.00000000000000e+00 +0: (4, 4; 3) -1.50000000000000e+00 +0: (4, 4; 5) -2.50000000000000e-01 +0: (4, 4; 6) -2.50000000000000e-01 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.sym.x.4.matmat.00002 b/src/test/TEST_structmat/structmat.saved.2D1.sym.x.4.matmat.00002 new file mode 100644 index 0000000000..81f34185d9 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.sym.x.4.matmat.00002 @@ -0,0 +1,108 @@ +StructMatrix + +Symmetric: 1 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (0, 5) x (2, 9) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +5 +0: (0, 5; 0) 4.00000000000000e+00 +0: (0, 5; 1) 0.00000000000000e+00 +0: (0, 5; 3) -1.50000000000000e+00 +0: (0, 5; 5) -2.50000000000000e-01 +0: (0, 5; 6) -2.50000000000000e-01 +0: (1, 5; 0) 4.00000000000000e+00 +0: (1, 5; 1) 0.00000000000000e+00 +0: (1, 5; 3) -1.50000000000000e+00 +0: (1, 5; 5) -2.50000000000000e-01 +0: (1, 5; 6) -2.50000000000000e-01 +0: (2, 5; 0) 4.00000000000000e+00 +0: (2, 5; 1) 0.00000000000000e+00 +0: (2, 5; 3) -1.50000000000000e+00 +0: (2, 5; 5) -2.50000000000000e-01 +0: (2, 5; 6) -2.50000000000000e-01 +0: (0, 6; 0) 4.00000000000000e+00 +0: (0, 6; 1) 0.00000000000000e+00 +0: (0, 6; 3) -1.50000000000000e+00 +0: (0, 6; 5) -2.50000000000000e-01 +0: (0, 6; 6) -2.50000000000000e-01 +0: (1, 6; 0) 4.00000000000000e+00 +0: (1, 6; 1) 0.00000000000000e+00 +0: (1, 6; 3) -1.50000000000000e+00 +0: (1, 6; 5) -2.50000000000000e-01 +0: (1, 6; 6) -2.50000000000000e-01 +0: (2, 6; 0) 4.00000000000000e+00 +0: (2, 6; 1) 0.00000000000000e+00 +0: (2, 6; 3) -1.50000000000000e+00 +0: (2, 6; 5) -2.50000000000000e-01 +0: (2, 6; 6) -2.50000000000000e-01 +0: (0, 7; 0) 4.00000000000000e+00 +0: (0, 7; 1) 0.00000000000000e+00 +0: (0, 7; 3) -1.50000000000000e+00 +0: (0, 7; 5) -2.50000000000000e-01 +0: (0, 7; 6) -2.50000000000000e-01 +0: (1, 7; 0) 4.00000000000000e+00 +0: (1, 7; 1) 0.00000000000000e+00 +0: (1, 7; 3) -1.50000000000000e+00 +0: (1, 7; 5) -2.50000000000000e-01 +0: (1, 7; 6) -2.50000000000000e-01 +0: (2, 7; 0) 4.00000000000000e+00 +0: (2, 7; 1) 0.00000000000000e+00 +0: (2, 7; 3) -1.50000000000000e+00 +0: (2, 7; 5) -2.50000000000000e-01 +0: (2, 7; 6) -2.50000000000000e-01 +0: (0, 8; 0) 4.00000000000000e+00 +0: (0, 8; 1) 0.00000000000000e+00 +0: (0, 8; 3) -1.50000000000000e+00 +0: (0, 8; 5) -2.50000000000000e-01 +0: (0, 8; 6) -2.50000000000000e-01 +0: (1, 8; 0) 4.00000000000000e+00 +0: (1, 8; 1) 0.00000000000000e+00 +0: (1, 8; 3) -1.50000000000000e+00 +0: (1, 8; 5) -2.50000000000000e-01 +0: (1, 8; 6) -2.50000000000000e-01 +0: (2, 8; 0) 4.00000000000000e+00 +0: (2, 8; 1) 0.00000000000000e+00 +0: (2, 8; 3) -1.50000000000000e+00 +0: (2, 8; 5) -2.50000000000000e-01 +0: (2, 8; 6) -2.50000000000000e-01 +0: (0, 9; 0) 4.00000000000000e+00 +0: (0, 9; 1) 0.00000000000000e+00 +0: (0, 9; 3) -1.50000000000000e+00 +0: (0, 9; 5) -2.50000000000000e-01 +0: (0, 9; 6) 0.00000000000000e+00 +0: (1, 9; 0) 4.00000000000000e+00 +0: (1, 9; 1) 0.00000000000000e+00 +0: (1, 9; 3) -1.50000000000000e+00 +0: (1, 9; 5) -2.50000000000000e-01 +0: (1, 9; 6) 0.00000000000000e+00 +0: (2, 9; 0) 4.00000000000000e+00 +0: (2, 9; 1) 0.00000000000000e+00 +0: (2, 9; 3) -1.50000000000000e+00 +0: (2, 9; 5) -2.50000000000000e-01 +0: (2, 9; 6) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.sym.x.4.matmat.00003 b/src/test/TEST_structmat/structmat.saved.2D1.sym.x.4.matmat.00003 new file mode 100644 index 0000000000..0ac5cf2823 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.sym.x.4.matmat.00003 @@ -0,0 +1,83 @@ +StructMatrix + +Symmetric: 1 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (3, 5) x (4, 9) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +5 +0: (3, 5; 0) 4.00000000000000e+00 +0: (3, 5; 1) 0.00000000000000e+00 +0: (3, 5; 3) -1.50000000000000e+00 +0: (3, 5; 5) -2.50000000000000e-01 +0: (3, 5; 6) -2.50000000000000e-01 +0: (4, 5; 0) 4.00000000000000e+00 +0: (4, 5; 1) 0.00000000000000e+00 +0: (4, 5; 3) -1.50000000000000e+00 +0: (4, 5; 5) -2.50000000000000e-01 +0: (4, 5; 6) -2.50000000000000e-01 +0: (3, 6; 0) 4.00000000000000e+00 +0: (3, 6; 1) 0.00000000000000e+00 +0: (3, 6; 3) -1.50000000000000e+00 +0: (3, 6; 5) -2.50000000000000e-01 +0: (3, 6; 6) -2.50000000000000e-01 +0: (4, 6; 0) 4.00000000000000e+00 +0: (4, 6; 1) 0.00000000000000e+00 +0: (4, 6; 3) -1.50000000000000e+00 +0: (4, 6; 5) -2.50000000000000e-01 +0: (4, 6; 6) -2.50000000000000e-01 +0: (3, 7; 0) 4.00000000000000e+00 +0: (3, 7; 1) 0.00000000000000e+00 +0: (3, 7; 3) -1.50000000000000e+00 +0: (3, 7; 5) -2.50000000000000e-01 +0: (3, 7; 6) -2.50000000000000e-01 +0: (4, 7; 0) 4.00000000000000e+00 +0: (4, 7; 1) 0.00000000000000e+00 +0: (4, 7; 3) -1.50000000000000e+00 +0: (4, 7; 5) -2.50000000000000e-01 +0: (4, 7; 6) -2.50000000000000e-01 +0: (3, 8; 0) 4.00000000000000e+00 +0: (3, 8; 1) 0.00000000000000e+00 +0: (3, 8; 3) -1.50000000000000e+00 +0: (3, 8; 5) -2.50000000000000e-01 +0: (3, 8; 6) -2.50000000000000e-01 +0: (4, 8; 0) 4.00000000000000e+00 +0: (4, 8; 1) 0.00000000000000e+00 +0: (4, 8; 3) -1.50000000000000e+00 +0: (4, 8; 5) -2.50000000000000e-01 +0: (4, 8; 6) -2.50000000000000e-01 +0: (3, 9; 0) 4.00000000000000e+00 +0: (3, 9; 1) 0.00000000000000e+00 +0: (3, 9; 3) -1.50000000000000e+00 +0: (3, 9; 5) -2.50000000000000e-01 +0: (3, 9; 6) 0.00000000000000e+00 +0: (4, 9; 0) 4.00000000000000e+00 +0: (4, 9; 1) 0.00000000000000e+00 +0: (4, 9; 3) -1.50000000000000e+00 +0: (4, 9; 5) -2.50000000000000e-01 +0: (4, 9; 6) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.sym.x.matmat.00000 b/src/test/TEST_structmat/structmat.saved.2D1.sym.x.matmat.00000 new file mode 100644 index 0000000000..34b9ebffb3 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.sym.x.matmat.00000 @@ -0,0 +1,283 @@ +StructMatrix + +Symmetric: 1 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (0, 0) x (4, 9) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +5 +0: (0, 0; 0) 4.00000000000000e+00 +0: (0, 0; 1) 0.00000000000000e+00 +0: (0, 0; 3) 0.00000000000000e+00 +0: (0, 0; 5) 0.00000000000000e+00 +0: (0, 0; 6) -2.50000000000000e-01 +0: (1, 0; 0) 4.00000000000000e+00 +0: (1, 0; 1) 0.00000000000000e+00 +0: (1, 0; 3) 0.00000000000000e+00 +0: (1, 0; 5) 0.00000000000000e+00 +0: (1, 0; 6) -2.50000000000000e-01 +0: (2, 0; 0) 4.00000000000000e+00 +0: (2, 0; 1) 0.00000000000000e+00 +0: (2, 0; 3) 0.00000000000000e+00 +0: (2, 0; 5) 0.00000000000000e+00 +0: (2, 0; 6) -2.50000000000000e-01 +0: (3, 0; 0) 4.00000000000000e+00 +0: (3, 0; 1) 0.00000000000000e+00 +0: (3, 0; 3) 0.00000000000000e+00 +0: (3, 0; 5) 0.00000000000000e+00 +0: (3, 0; 6) -2.50000000000000e-01 +0: (4, 0; 0) 4.00000000000000e+00 +0: (4, 0; 1) 0.00000000000000e+00 +0: (4, 0; 3) 0.00000000000000e+00 +0: (4, 0; 5) 0.00000000000000e+00 +0: (4, 0; 6) -2.50000000000000e-01 +0: (0, 1; 0) 4.00000000000000e+00 +0: (0, 1; 1) 0.00000000000000e+00 +0: (0, 1; 3) -1.50000000000000e+00 +0: (0, 1; 5) -2.50000000000000e-01 +0: (0, 1; 6) -2.50000000000000e-01 +0: (1, 1; 0) 4.00000000000000e+00 +0: (1, 1; 1) 0.00000000000000e+00 +0: (1, 1; 3) -1.50000000000000e+00 +0: (1, 1; 5) -2.50000000000000e-01 +0: (1, 1; 6) -2.50000000000000e-01 +0: (2, 1; 0) 4.00000000000000e+00 +0: (2, 1; 1) 0.00000000000000e+00 +0: (2, 1; 3) -1.50000000000000e+00 +0: (2, 1; 5) -2.50000000000000e-01 +0: (2, 1; 6) -2.50000000000000e-01 +0: (3, 1; 0) 4.00000000000000e+00 +0: (3, 1; 1) 0.00000000000000e+00 +0: (3, 1; 3) -1.50000000000000e+00 +0: (3, 1; 5) -2.50000000000000e-01 +0: (3, 1; 6) -2.50000000000000e-01 +0: (4, 1; 0) 4.00000000000000e+00 +0: (4, 1; 1) 0.00000000000000e+00 +0: (4, 1; 3) -1.50000000000000e+00 +0: (4, 1; 5) -2.50000000000000e-01 +0: (4, 1; 6) -2.50000000000000e-01 +0: (0, 2; 0) 4.00000000000000e+00 +0: (0, 2; 1) 0.00000000000000e+00 +0: (0, 2; 3) -1.50000000000000e+00 +0: (0, 2; 5) -2.50000000000000e-01 +0: (0, 2; 6) -2.50000000000000e-01 +0: (1, 2; 0) 4.00000000000000e+00 +0: (1, 2; 1) 0.00000000000000e+00 +0: (1, 2; 3) -1.50000000000000e+00 +0: (1, 2; 5) -2.50000000000000e-01 +0: (1, 2; 6) -2.50000000000000e-01 +0: (2, 2; 0) 4.00000000000000e+00 +0: (2, 2; 1) 0.00000000000000e+00 +0: (2, 2; 3) -1.50000000000000e+00 +0: (2, 2; 5) -2.50000000000000e-01 +0: (2, 2; 6) -2.50000000000000e-01 +0: (3, 2; 0) 4.00000000000000e+00 +0: (3, 2; 1) 0.00000000000000e+00 +0: (3, 2; 3) -1.50000000000000e+00 +0: (3, 2; 5) -2.50000000000000e-01 +0: (3, 2; 6) -2.50000000000000e-01 +0: (4, 2; 0) 4.00000000000000e+00 +0: (4, 2; 1) 0.00000000000000e+00 +0: (4, 2; 3) -1.50000000000000e+00 +0: (4, 2; 5) -2.50000000000000e-01 +0: (4, 2; 6) -2.50000000000000e-01 +0: (0, 3; 0) 4.00000000000000e+00 +0: (0, 3; 1) 0.00000000000000e+00 +0: (0, 3; 3) -1.50000000000000e+00 +0: (0, 3; 5) -2.50000000000000e-01 +0: (0, 3; 6) -2.50000000000000e-01 +0: (1, 3; 0) 4.00000000000000e+00 +0: (1, 3; 1) 0.00000000000000e+00 +0: (1, 3; 3) -1.50000000000000e+00 +0: (1, 3; 5) -2.50000000000000e-01 +0: (1, 3; 6) -2.50000000000000e-01 +0: (2, 3; 0) 4.00000000000000e+00 +0: (2, 3; 1) 0.00000000000000e+00 +0: (2, 3; 3) -1.50000000000000e+00 +0: (2, 3; 5) -2.50000000000000e-01 +0: (2, 3; 6) -2.50000000000000e-01 +0: (3, 3; 0) 4.00000000000000e+00 +0: (3, 3; 1) 0.00000000000000e+00 +0: (3, 3; 3) -1.50000000000000e+00 +0: (3, 3; 5) -2.50000000000000e-01 +0: (3, 3; 6) -2.50000000000000e-01 +0: (4, 3; 0) 4.00000000000000e+00 +0: (4, 3; 1) 0.00000000000000e+00 +0: (4, 3; 3) -1.50000000000000e+00 +0: (4, 3; 5) -2.50000000000000e-01 +0: (4, 3; 6) -2.50000000000000e-01 +0: (0, 4; 0) 4.00000000000000e+00 +0: (0, 4; 1) 0.00000000000000e+00 +0: (0, 4; 3) -1.50000000000000e+00 +0: (0, 4; 5) -2.50000000000000e-01 +0: (0, 4; 6) -2.50000000000000e-01 +0: (1, 4; 0) 4.00000000000000e+00 +0: (1, 4; 1) 0.00000000000000e+00 +0: (1, 4; 3) -1.50000000000000e+00 +0: (1, 4; 5) -2.50000000000000e-01 +0: (1, 4; 6) -2.50000000000000e-01 +0: (2, 4; 0) 4.00000000000000e+00 +0: (2, 4; 1) 0.00000000000000e+00 +0: (2, 4; 3) -1.50000000000000e+00 +0: (2, 4; 5) -2.50000000000000e-01 +0: (2, 4; 6) -2.50000000000000e-01 +0: (3, 4; 0) 4.00000000000000e+00 +0: (3, 4; 1) 0.00000000000000e+00 +0: (3, 4; 3) -1.50000000000000e+00 +0: (3, 4; 5) -2.50000000000000e-01 +0: (3, 4; 6) -2.50000000000000e-01 +0: (4, 4; 0) 4.00000000000000e+00 +0: (4, 4; 1) 0.00000000000000e+00 +0: (4, 4; 3) -1.50000000000000e+00 +0: (4, 4; 5) -2.50000000000000e-01 +0: (4, 4; 6) -2.50000000000000e-01 +0: (0, 5; 0) 4.00000000000000e+00 +0: (0, 5; 1) 0.00000000000000e+00 +0: (0, 5; 3) -1.50000000000000e+00 +0: (0, 5; 5) -2.50000000000000e-01 +0: (0, 5; 6) -2.50000000000000e-01 +0: (1, 5; 0) 4.00000000000000e+00 +0: (1, 5; 1) 0.00000000000000e+00 +0: (1, 5; 3) -1.50000000000000e+00 +0: (1, 5; 5) -2.50000000000000e-01 +0: (1, 5; 6) -2.50000000000000e-01 +0: (2, 5; 0) 4.00000000000000e+00 +0: (2, 5; 1) 0.00000000000000e+00 +0: (2, 5; 3) -1.50000000000000e+00 +0: (2, 5; 5) -2.50000000000000e-01 +0: (2, 5; 6) -2.50000000000000e-01 +0: (3, 5; 0) 4.00000000000000e+00 +0: (3, 5; 1) 0.00000000000000e+00 +0: (3, 5; 3) -1.50000000000000e+00 +0: (3, 5; 5) -2.50000000000000e-01 +0: (3, 5; 6) -2.50000000000000e-01 +0: (4, 5; 0) 4.00000000000000e+00 +0: (4, 5; 1) 0.00000000000000e+00 +0: (4, 5; 3) -1.50000000000000e+00 +0: (4, 5; 5) -2.50000000000000e-01 +0: (4, 5; 6) -2.50000000000000e-01 +0: (0, 6; 0) 4.00000000000000e+00 +0: (0, 6; 1) 0.00000000000000e+00 +0: (0, 6; 3) -1.50000000000000e+00 +0: (0, 6; 5) -2.50000000000000e-01 +0: (0, 6; 6) -2.50000000000000e-01 +0: (1, 6; 0) 4.00000000000000e+00 +0: (1, 6; 1) 0.00000000000000e+00 +0: (1, 6; 3) -1.50000000000000e+00 +0: (1, 6; 5) -2.50000000000000e-01 +0: (1, 6; 6) -2.50000000000000e-01 +0: (2, 6; 0) 4.00000000000000e+00 +0: (2, 6; 1) 0.00000000000000e+00 +0: (2, 6; 3) -1.50000000000000e+00 +0: (2, 6; 5) -2.50000000000000e-01 +0: (2, 6; 6) -2.50000000000000e-01 +0: (3, 6; 0) 4.00000000000000e+00 +0: (3, 6; 1) 0.00000000000000e+00 +0: (3, 6; 3) -1.50000000000000e+00 +0: (3, 6; 5) -2.50000000000000e-01 +0: (3, 6; 6) -2.50000000000000e-01 +0: (4, 6; 0) 4.00000000000000e+00 +0: (4, 6; 1) 0.00000000000000e+00 +0: (4, 6; 3) -1.50000000000000e+00 +0: (4, 6; 5) -2.50000000000000e-01 +0: (4, 6; 6) -2.50000000000000e-01 +0: (0, 7; 0) 4.00000000000000e+00 +0: (0, 7; 1) 0.00000000000000e+00 +0: (0, 7; 3) -1.50000000000000e+00 +0: (0, 7; 5) -2.50000000000000e-01 +0: (0, 7; 6) -2.50000000000000e-01 +0: (1, 7; 0) 4.00000000000000e+00 +0: (1, 7; 1) 0.00000000000000e+00 +0: (1, 7; 3) -1.50000000000000e+00 +0: (1, 7; 5) -2.50000000000000e-01 +0: (1, 7; 6) -2.50000000000000e-01 +0: (2, 7; 0) 4.00000000000000e+00 +0: (2, 7; 1) 0.00000000000000e+00 +0: (2, 7; 3) -1.50000000000000e+00 +0: (2, 7; 5) -2.50000000000000e-01 +0: (2, 7; 6) -2.50000000000000e-01 +0: (3, 7; 0) 4.00000000000000e+00 +0: (3, 7; 1) 0.00000000000000e+00 +0: (3, 7; 3) -1.50000000000000e+00 +0: (3, 7; 5) -2.50000000000000e-01 +0: (3, 7; 6) -2.50000000000000e-01 +0: (4, 7; 0) 4.00000000000000e+00 +0: (4, 7; 1) 0.00000000000000e+00 +0: (4, 7; 3) -1.50000000000000e+00 +0: (4, 7; 5) -2.50000000000000e-01 +0: (4, 7; 6) -2.50000000000000e-01 +0: (0, 8; 0) 4.00000000000000e+00 +0: (0, 8; 1) 0.00000000000000e+00 +0: (0, 8; 3) -1.50000000000000e+00 +0: (0, 8; 5) -2.50000000000000e-01 +0: (0, 8; 6) -2.50000000000000e-01 +0: (1, 8; 0) 4.00000000000000e+00 +0: (1, 8; 1) 0.00000000000000e+00 +0: (1, 8; 3) -1.50000000000000e+00 +0: (1, 8; 5) -2.50000000000000e-01 +0: (1, 8; 6) -2.50000000000000e-01 +0: (2, 8; 0) 4.00000000000000e+00 +0: (2, 8; 1) 0.00000000000000e+00 +0: (2, 8; 3) -1.50000000000000e+00 +0: (2, 8; 5) -2.50000000000000e-01 +0: (2, 8; 6) -2.50000000000000e-01 +0: (3, 8; 0) 4.00000000000000e+00 +0: (3, 8; 1) 0.00000000000000e+00 +0: (3, 8; 3) -1.50000000000000e+00 +0: (3, 8; 5) -2.50000000000000e-01 +0: (3, 8; 6) -2.50000000000000e-01 +0: (4, 8; 0) 4.00000000000000e+00 +0: (4, 8; 1) 0.00000000000000e+00 +0: (4, 8; 3) -1.50000000000000e+00 +0: (4, 8; 5) -2.50000000000000e-01 +0: (4, 8; 6) -2.50000000000000e-01 +0: (0, 9; 0) 4.00000000000000e+00 +0: (0, 9; 1) 0.00000000000000e+00 +0: (0, 9; 3) -1.50000000000000e+00 +0: (0, 9; 5) -2.50000000000000e-01 +0: (0, 9; 6) 0.00000000000000e+00 +0: (1, 9; 0) 4.00000000000000e+00 +0: (1, 9; 1) 0.00000000000000e+00 +0: (1, 9; 3) -1.50000000000000e+00 +0: (1, 9; 5) -2.50000000000000e-01 +0: (1, 9; 6) 0.00000000000000e+00 +0: (2, 9; 0) 4.00000000000000e+00 +0: (2, 9; 1) 0.00000000000000e+00 +0: (2, 9; 3) -1.50000000000000e+00 +0: (2, 9; 5) -2.50000000000000e-01 +0: (2, 9; 6) 0.00000000000000e+00 +0: (3, 9; 0) 4.00000000000000e+00 +0: (3, 9; 1) 0.00000000000000e+00 +0: (3, 9; 3) -1.50000000000000e+00 +0: (3, 9; 5) -2.50000000000000e-01 +0: (3, 9; 6) 0.00000000000000e+00 +0: (4, 9; 0) 4.00000000000000e+00 +0: (4, 9; 1) 0.00000000000000e+00 +0: (4, 9; 3) -1.50000000000000e+00 +0: (4, 9; 5) -2.50000000000000e-01 +0: (4, 9; 6) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.x.4.matmat.00000 b/src/test/TEST_structmat/structmat.saved.2D1.x.4.matmat.00000 new file mode 100644 index 0000000000..8db6de7207 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.x.4.matmat.00000 @@ -0,0 +1,168 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (0, 0) x (2, 4) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +9 +0: (0, 0; 0) 4.00000000000000e+00 +0: (0, 0; 1) 0.00000000000000e+00 +0: (0, 0; 2) 0.00000000000000e+00 +0: (0, 0; 3) 0.00000000000000e+00 +0: (0, 0; 4) -1.50000000000000e+00 +0: (0, 0; 5) 0.00000000000000e+00 +0: (0, 0; 6) -2.50000000000000e-01 +0: (0, 0; 7) 0.00000000000000e+00 +0: (0, 0; 8) -2.50000000000000e-01 +0: (1, 0; 0) 4.00000000000000e+00 +0: (1, 0; 1) 0.00000000000000e+00 +0: (1, 0; 2) 0.00000000000000e+00 +0: (1, 0; 3) 0.00000000000000e+00 +0: (1, 0; 4) -1.50000000000000e+00 +0: (1, 0; 5) 0.00000000000000e+00 +0: (1, 0; 6) -2.50000000000000e-01 +0: (1, 0; 7) 0.00000000000000e+00 +0: (1, 0; 8) -2.50000000000000e-01 +0: (2, 0; 0) 4.00000000000000e+00 +0: (2, 0; 1) 0.00000000000000e+00 +0: (2, 0; 2) 0.00000000000000e+00 +0: (2, 0; 3) 0.00000000000000e+00 +0: (2, 0; 4) -1.50000000000000e+00 +0: (2, 0; 5) 0.00000000000000e+00 +0: (2, 0; 6) -2.50000000000000e-01 +0: (2, 0; 7) 0.00000000000000e+00 +0: (2, 0; 8) -2.50000000000000e-01 +0: (0, 1; 0) 4.00000000000000e+00 +0: (0, 1; 1) 0.00000000000000e+00 +0: (0, 1; 2) 0.00000000000000e+00 +0: (0, 1; 3) -1.50000000000000e+00 +0: (0, 1; 4) -1.50000000000000e+00 +0: (0, 1; 5) -2.50000000000000e-01 +0: (0, 1; 6) -2.50000000000000e-01 +0: (0, 1; 7) -2.50000000000000e-01 +0: (0, 1; 8) -2.50000000000000e-01 +0: (1, 1; 0) 4.00000000000000e+00 +0: (1, 1; 1) 0.00000000000000e+00 +0: (1, 1; 2) 0.00000000000000e+00 +0: (1, 1; 3) -1.50000000000000e+00 +0: (1, 1; 4) -1.50000000000000e+00 +0: (1, 1; 5) -2.50000000000000e-01 +0: (1, 1; 6) -2.50000000000000e-01 +0: (1, 1; 7) -2.50000000000000e-01 +0: (1, 1; 8) -2.50000000000000e-01 +0: (2, 1; 0) 4.00000000000000e+00 +0: (2, 1; 1) 0.00000000000000e+00 +0: (2, 1; 2) 0.00000000000000e+00 +0: (2, 1; 3) -1.50000000000000e+00 +0: (2, 1; 4) -1.50000000000000e+00 +0: (2, 1; 5) -2.50000000000000e-01 +0: (2, 1; 6) -2.50000000000000e-01 +0: (2, 1; 7) -2.50000000000000e-01 +0: (2, 1; 8) -2.50000000000000e-01 +0: (0, 2; 0) 4.00000000000000e+00 +0: (0, 2; 1) 0.00000000000000e+00 +0: (0, 2; 2) 0.00000000000000e+00 +0: (0, 2; 3) -1.50000000000000e+00 +0: (0, 2; 4) -1.50000000000000e+00 +0: (0, 2; 5) -2.50000000000000e-01 +0: (0, 2; 6) -2.50000000000000e-01 +0: (0, 2; 7) -2.50000000000000e-01 +0: (0, 2; 8) -2.50000000000000e-01 +0: (1, 2; 0) 4.00000000000000e+00 +0: (1, 2; 1) 0.00000000000000e+00 +0: (1, 2; 2) 0.00000000000000e+00 +0: (1, 2; 3) -1.50000000000000e+00 +0: (1, 2; 4) -1.50000000000000e+00 +0: (1, 2; 5) -2.50000000000000e-01 +0: (1, 2; 6) -2.50000000000000e-01 +0: (1, 2; 7) -2.50000000000000e-01 +0: (1, 2; 8) -2.50000000000000e-01 +0: (2, 2; 0) 4.00000000000000e+00 +0: (2, 2; 1) 0.00000000000000e+00 +0: (2, 2; 2) 0.00000000000000e+00 +0: (2, 2; 3) -1.50000000000000e+00 +0: (2, 2; 4) -1.50000000000000e+00 +0: (2, 2; 5) -2.50000000000000e-01 +0: (2, 2; 6) -2.50000000000000e-01 +0: (2, 2; 7) -2.50000000000000e-01 +0: (2, 2; 8) -2.50000000000000e-01 +0: (0, 3; 0) 4.00000000000000e+00 +0: (0, 3; 1) 0.00000000000000e+00 +0: (0, 3; 2) 0.00000000000000e+00 +0: (0, 3; 3) -1.50000000000000e+00 +0: (0, 3; 4) -1.50000000000000e+00 +0: (0, 3; 5) -2.50000000000000e-01 +0: (0, 3; 6) -2.50000000000000e-01 +0: (0, 3; 7) -2.50000000000000e-01 +0: (0, 3; 8) -2.50000000000000e-01 +0: (1, 3; 0) 4.00000000000000e+00 +0: (1, 3; 1) 0.00000000000000e+00 +0: (1, 3; 2) 0.00000000000000e+00 +0: (1, 3; 3) -1.50000000000000e+00 +0: (1, 3; 4) -1.50000000000000e+00 +0: (1, 3; 5) -2.50000000000000e-01 +0: (1, 3; 6) -2.50000000000000e-01 +0: (1, 3; 7) -2.50000000000000e-01 +0: (1, 3; 8) -2.50000000000000e-01 +0: (2, 3; 0) 4.00000000000000e+00 +0: (2, 3; 1) 0.00000000000000e+00 +0: (2, 3; 2) 0.00000000000000e+00 +0: (2, 3; 3) -1.50000000000000e+00 +0: (2, 3; 4) -1.50000000000000e+00 +0: (2, 3; 5) -2.50000000000000e-01 +0: (2, 3; 6) -2.50000000000000e-01 +0: (2, 3; 7) -2.50000000000000e-01 +0: (2, 3; 8) -2.50000000000000e-01 +0: (0, 4; 0) 4.00000000000000e+00 +0: (0, 4; 1) 0.00000000000000e+00 +0: (0, 4; 2) 0.00000000000000e+00 +0: (0, 4; 3) -1.50000000000000e+00 +0: (0, 4; 4) -1.50000000000000e+00 +0: (0, 4; 5) -2.50000000000000e-01 +0: (0, 4; 6) -2.50000000000000e-01 +0: (0, 4; 7) -2.50000000000000e-01 +0: (0, 4; 8) -2.50000000000000e-01 +0: (1, 4; 0) 4.00000000000000e+00 +0: (1, 4; 1) 0.00000000000000e+00 +0: (1, 4; 2) 0.00000000000000e+00 +0: (1, 4; 3) -1.50000000000000e+00 +0: (1, 4; 4) -1.50000000000000e+00 +0: (1, 4; 5) -2.50000000000000e-01 +0: (1, 4; 6) -2.50000000000000e-01 +0: (1, 4; 7) -2.50000000000000e-01 +0: (1, 4; 8) -2.50000000000000e-01 +0: (2, 4; 0) 4.00000000000000e+00 +0: (2, 4; 1) 0.00000000000000e+00 +0: (2, 4; 2) 0.00000000000000e+00 +0: (2, 4; 3) -1.50000000000000e+00 +0: (2, 4; 4) -1.50000000000000e+00 +0: (2, 4; 5) -2.50000000000000e-01 +0: (2, 4; 6) -2.50000000000000e-01 +0: (2, 4; 7) -2.50000000000000e-01 +0: (2, 4; 8) -2.50000000000000e-01 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.x.4.matmat.00001 b/src/test/TEST_structmat/structmat.saved.2D1.x.4.matmat.00001 new file mode 100644 index 0000000000..2dcc80efb6 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.x.4.matmat.00001 @@ -0,0 +1,123 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (3, 0) x (4, 4) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +9 +0: (3, 0; 0) 4.00000000000000e+00 +0: (3, 0; 1) 0.00000000000000e+00 +0: (3, 0; 2) 0.00000000000000e+00 +0: (3, 0; 3) 0.00000000000000e+00 +0: (3, 0; 4) -1.50000000000000e+00 +0: (3, 0; 5) 0.00000000000000e+00 +0: (3, 0; 6) -2.50000000000000e-01 +0: (3, 0; 7) 0.00000000000000e+00 +0: (3, 0; 8) -2.50000000000000e-01 +0: (4, 0; 0) 4.00000000000000e+00 +0: (4, 0; 1) 0.00000000000000e+00 +0: (4, 0; 2) 0.00000000000000e+00 +0: (4, 0; 3) 0.00000000000000e+00 +0: (4, 0; 4) -1.50000000000000e+00 +0: (4, 0; 5) 0.00000000000000e+00 +0: (4, 0; 6) -2.50000000000000e-01 +0: (4, 0; 7) 0.00000000000000e+00 +0: (4, 0; 8) -2.50000000000000e-01 +0: (3, 1; 0) 4.00000000000000e+00 +0: (3, 1; 1) 0.00000000000000e+00 +0: (3, 1; 2) 0.00000000000000e+00 +0: (3, 1; 3) -1.50000000000000e+00 +0: (3, 1; 4) -1.50000000000000e+00 +0: (3, 1; 5) -2.50000000000000e-01 +0: (3, 1; 6) -2.50000000000000e-01 +0: (3, 1; 7) -2.50000000000000e-01 +0: (3, 1; 8) -2.50000000000000e-01 +0: (4, 1; 0) 4.00000000000000e+00 +0: (4, 1; 1) 0.00000000000000e+00 +0: (4, 1; 2) 0.00000000000000e+00 +0: (4, 1; 3) -1.50000000000000e+00 +0: (4, 1; 4) -1.50000000000000e+00 +0: (4, 1; 5) -2.50000000000000e-01 +0: (4, 1; 6) -2.50000000000000e-01 +0: (4, 1; 7) -2.50000000000000e-01 +0: (4, 1; 8) -2.50000000000000e-01 +0: (3, 2; 0) 4.00000000000000e+00 +0: (3, 2; 1) 0.00000000000000e+00 +0: (3, 2; 2) 0.00000000000000e+00 +0: (3, 2; 3) -1.50000000000000e+00 +0: (3, 2; 4) -1.50000000000000e+00 +0: (3, 2; 5) -2.50000000000000e-01 +0: (3, 2; 6) -2.50000000000000e-01 +0: (3, 2; 7) -2.50000000000000e-01 +0: (3, 2; 8) -2.50000000000000e-01 +0: (4, 2; 0) 4.00000000000000e+00 +0: (4, 2; 1) 0.00000000000000e+00 +0: (4, 2; 2) 0.00000000000000e+00 +0: (4, 2; 3) -1.50000000000000e+00 +0: (4, 2; 4) -1.50000000000000e+00 +0: (4, 2; 5) -2.50000000000000e-01 +0: (4, 2; 6) -2.50000000000000e-01 +0: (4, 2; 7) -2.50000000000000e-01 +0: (4, 2; 8) -2.50000000000000e-01 +0: (3, 3; 0) 4.00000000000000e+00 +0: (3, 3; 1) 0.00000000000000e+00 +0: (3, 3; 2) 0.00000000000000e+00 +0: (3, 3; 3) -1.50000000000000e+00 +0: (3, 3; 4) -1.50000000000000e+00 +0: (3, 3; 5) -2.50000000000000e-01 +0: (3, 3; 6) -2.50000000000000e-01 +0: (3, 3; 7) -2.50000000000000e-01 +0: (3, 3; 8) -2.50000000000000e-01 +0: (4, 3; 0) 4.00000000000000e+00 +0: (4, 3; 1) 0.00000000000000e+00 +0: (4, 3; 2) 0.00000000000000e+00 +0: (4, 3; 3) -1.50000000000000e+00 +0: (4, 3; 4) -1.50000000000000e+00 +0: (4, 3; 5) -2.50000000000000e-01 +0: (4, 3; 6) -2.50000000000000e-01 +0: (4, 3; 7) -2.50000000000000e-01 +0: (4, 3; 8) -2.50000000000000e-01 +0: (3, 4; 0) 4.00000000000000e+00 +0: (3, 4; 1) 0.00000000000000e+00 +0: (3, 4; 2) 0.00000000000000e+00 +0: (3, 4; 3) -1.50000000000000e+00 +0: (3, 4; 4) -1.50000000000000e+00 +0: (3, 4; 5) -2.50000000000000e-01 +0: (3, 4; 6) -2.50000000000000e-01 +0: (3, 4; 7) -2.50000000000000e-01 +0: (3, 4; 8) -2.50000000000000e-01 +0: (4, 4; 0) 4.00000000000000e+00 +0: (4, 4; 1) 0.00000000000000e+00 +0: (4, 4; 2) 0.00000000000000e+00 +0: (4, 4; 3) -1.50000000000000e+00 +0: (4, 4; 4) -1.50000000000000e+00 +0: (4, 4; 5) -2.50000000000000e-01 +0: (4, 4; 6) -2.50000000000000e-01 +0: (4, 4; 7) -2.50000000000000e-01 +0: (4, 4; 8) -2.50000000000000e-01 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.x.4.matmat.00002 b/src/test/TEST_structmat/structmat.saved.2D1.x.4.matmat.00002 new file mode 100644 index 0000000000..74cce31d8e --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.x.4.matmat.00002 @@ -0,0 +1,168 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (0, 5) x (2, 9) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +9 +0: (0, 5; 0) 4.00000000000000e+00 +0: (0, 5; 1) 0.00000000000000e+00 +0: (0, 5; 2) 0.00000000000000e+00 +0: (0, 5; 3) -1.50000000000000e+00 +0: (0, 5; 4) -1.50000000000000e+00 +0: (0, 5; 5) -2.50000000000000e-01 +0: (0, 5; 6) -2.50000000000000e-01 +0: (0, 5; 7) -2.50000000000000e-01 +0: (0, 5; 8) -2.50000000000000e-01 +0: (1, 5; 0) 4.00000000000000e+00 +0: (1, 5; 1) 0.00000000000000e+00 +0: (1, 5; 2) 0.00000000000000e+00 +0: (1, 5; 3) -1.50000000000000e+00 +0: (1, 5; 4) -1.50000000000000e+00 +0: (1, 5; 5) -2.50000000000000e-01 +0: (1, 5; 6) -2.50000000000000e-01 +0: (1, 5; 7) -2.50000000000000e-01 +0: (1, 5; 8) -2.50000000000000e-01 +0: (2, 5; 0) 4.00000000000000e+00 +0: (2, 5; 1) 0.00000000000000e+00 +0: (2, 5; 2) 0.00000000000000e+00 +0: (2, 5; 3) -1.50000000000000e+00 +0: (2, 5; 4) -1.50000000000000e+00 +0: (2, 5; 5) -2.50000000000000e-01 +0: (2, 5; 6) -2.50000000000000e-01 +0: (2, 5; 7) -2.50000000000000e-01 +0: (2, 5; 8) -2.50000000000000e-01 +0: (0, 6; 0) 4.00000000000000e+00 +0: (0, 6; 1) 0.00000000000000e+00 +0: (0, 6; 2) 0.00000000000000e+00 +0: (0, 6; 3) -1.50000000000000e+00 +0: (0, 6; 4) -1.50000000000000e+00 +0: (0, 6; 5) -2.50000000000000e-01 +0: (0, 6; 6) -2.50000000000000e-01 +0: (0, 6; 7) -2.50000000000000e-01 +0: (0, 6; 8) -2.50000000000000e-01 +0: (1, 6; 0) 4.00000000000000e+00 +0: (1, 6; 1) 0.00000000000000e+00 +0: (1, 6; 2) 0.00000000000000e+00 +0: (1, 6; 3) -1.50000000000000e+00 +0: (1, 6; 4) -1.50000000000000e+00 +0: (1, 6; 5) -2.50000000000000e-01 +0: (1, 6; 6) -2.50000000000000e-01 +0: (1, 6; 7) -2.50000000000000e-01 +0: (1, 6; 8) -2.50000000000000e-01 +0: (2, 6; 0) 4.00000000000000e+00 +0: (2, 6; 1) 0.00000000000000e+00 +0: (2, 6; 2) 0.00000000000000e+00 +0: (2, 6; 3) -1.50000000000000e+00 +0: (2, 6; 4) -1.50000000000000e+00 +0: (2, 6; 5) -2.50000000000000e-01 +0: (2, 6; 6) -2.50000000000000e-01 +0: (2, 6; 7) -2.50000000000000e-01 +0: (2, 6; 8) -2.50000000000000e-01 +0: (0, 7; 0) 4.00000000000000e+00 +0: (0, 7; 1) 0.00000000000000e+00 +0: (0, 7; 2) 0.00000000000000e+00 +0: (0, 7; 3) -1.50000000000000e+00 +0: (0, 7; 4) -1.50000000000000e+00 +0: (0, 7; 5) -2.50000000000000e-01 +0: (0, 7; 6) -2.50000000000000e-01 +0: (0, 7; 7) -2.50000000000000e-01 +0: (0, 7; 8) -2.50000000000000e-01 +0: (1, 7; 0) 4.00000000000000e+00 +0: (1, 7; 1) 0.00000000000000e+00 +0: (1, 7; 2) 0.00000000000000e+00 +0: (1, 7; 3) -1.50000000000000e+00 +0: (1, 7; 4) -1.50000000000000e+00 +0: (1, 7; 5) -2.50000000000000e-01 +0: (1, 7; 6) -2.50000000000000e-01 +0: (1, 7; 7) -2.50000000000000e-01 +0: (1, 7; 8) -2.50000000000000e-01 +0: (2, 7; 0) 4.00000000000000e+00 +0: (2, 7; 1) 0.00000000000000e+00 +0: (2, 7; 2) 0.00000000000000e+00 +0: (2, 7; 3) -1.50000000000000e+00 +0: (2, 7; 4) -1.50000000000000e+00 +0: (2, 7; 5) -2.50000000000000e-01 +0: (2, 7; 6) -2.50000000000000e-01 +0: (2, 7; 7) -2.50000000000000e-01 +0: (2, 7; 8) -2.50000000000000e-01 +0: (0, 8; 0) 4.00000000000000e+00 +0: (0, 8; 1) 0.00000000000000e+00 +0: (0, 8; 2) 0.00000000000000e+00 +0: (0, 8; 3) -1.50000000000000e+00 +0: (0, 8; 4) -1.50000000000000e+00 +0: (0, 8; 5) -2.50000000000000e-01 +0: (0, 8; 6) -2.50000000000000e-01 +0: (0, 8; 7) -2.50000000000000e-01 +0: (0, 8; 8) -2.50000000000000e-01 +0: (1, 8; 0) 4.00000000000000e+00 +0: (1, 8; 1) 0.00000000000000e+00 +0: (1, 8; 2) 0.00000000000000e+00 +0: (1, 8; 3) -1.50000000000000e+00 +0: (1, 8; 4) -1.50000000000000e+00 +0: (1, 8; 5) -2.50000000000000e-01 +0: (1, 8; 6) -2.50000000000000e-01 +0: (1, 8; 7) -2.50000000000000e-01 +0: (1, 8; 8) -2.50000000000000e-01 +0: (2, 8; 0) 4.00000000000000e+00 +0: (2, 8; 1) 0.00000000000000e+00 +0: (2, 8; 2) 0.00000000000000e+00 +0: (2, 8; 3) -1.50000000000000e+00 +0: (2, 8; 4) -1.50000000000000e+00 +0: (2, 8; 5) -2.50000000000000e-01 +0: (2, 8; 6) -2.50000000000000e-01 +0: (2, 8; 7) -2.50000000000000e-01 +0: (2, 8; 8) -2.50000000000000e-01 +0: (0, 9; 0) 4.00000000000000e+00 +0: (0, 9; 1) 0.00000000000000e+00 +0: (0, 9; 2) 0.00000000000000e+00 +0: (0, 9; 3) -1.50000000000000e+00 +0: (0, 9; 4) 0.00000000000000e+00 +0: (0, 9; 5) -2.50000000000000e-01 +0: (0, 9; 6) 0.00000000000000e+00 +0: (0, 9; 7) -2.50000000000000e-01 +0: (0, 9; 8) 0.00000000000000e+00 +0: (1, 9; 0) 4.00000000000000e+00 +0: (1, 9; 1) 0.00000000000000e+00 +0: (1, 9; 2) 0.00000000000000e+00 +0: (1, 9; 3) -1.50000000000000e+00 +0: (1, 9; 4) 0.00000000000000e+00 +0: (1, 9; 5) -2.50000000000000e-01 +0: (1, 9; 6) 0.00000000000000e+00 +0: (1, 9; 7) -2.50000000000000e-01 +0: (1, 9; 8) 0.00000000000000e+00 +0: (2, 9; 0) 4.00000000000000e+00 +0: (2, 9; 1) 0.00000000000000e+00 +0: (2, 9; 2) 0.00000000000000e+00 +0: (2, 9; 3) -1.50000000000000e+00 +0: (2, 9; 4) 0.00000000000000e+00 +0: (2, 9; 5) -2.50000000000000e-01 +0: (2, 9; 6) 0.00000000000000e+00 +0: (2, 9; 7) -2.50000000000000e-01 +0: (2, 9; 8) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.x.4.matmat.00003 b/src/test/TEST_structmat/structmat.saved.2D1.x.4.matmat.00003 new file mode 100644 index 0000000000..e08817fc54 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.x.4.matmat.00003 @@ -0,0 +1,123 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (3, 5) x (4, 9) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +9 +0: (3, 5; 0) 4.00000000000000e+00 +0: (3, 5; 1) 0.00000000000000e+00 +0: (3, 5; 2) 0.00000000000000e+00 +0: (3, 5; 3) -1.50000000000000e+00 +0: (3, 5; 4) -1.50000000000000e+00 +0: (3, 5; 5) -2.50000000000000e-01 +0: (3, 5; 6) -2.50000000000000e-01 +0: (3, 5; 7) -2.50000000000000e-01 +0: (3, 5; 8) -2.50000000000000e-01 +0: (4, 5; 0) 4.00000000000000e+00 +0: (4, 5; 1) 0.00000000000000e+00 +0: (4, 5; 2) 0.00000000000000e+00 +0: (4, 5; 3) -1.50000000000000e+00 +0: (4, 5; 4) -1.50000000000000e+00 +0: (4, 5; 5) -2.50000000000000e-01 +0: (4, 5; 6) -2.50000000000000e-01 +0: (4, 5; 7) -2.50000000000000e-01 +0: (4, 5; 8) -2.50000000000000e-01 +0: (3, 6; 0) 4.00000000000000e+00 +0: (3, 6; 1) 0.00000000000000e+00 +0: (3, 6; 2) 0.00000000000000e+00 +0: (3, 6; 3) -1.50000000000000e+00 +0: (3, 6; 4) -1.50000000000000e+00 +0: (3, 6; 5) -2.50000000000000e-01 +0: (3, 6; 6) -2.50000000000000e-01 +0: (3, 6; 7) -2.50000000000000e-01 +0: (3, 6; 8) -2.50000000000000e-01 +0: (4, 6; 0) 4.00000000000000e+00 +0: (4, 6; 1) 0.00000000000000e+00 +0: (4, 6; 2) 0.00000000000000e+00 +0: (4, 6; 3) -1.50000000000000e+00 +0: (4, 6; 4) -1.50000000000000e+00 +0: (4, 6; 5) -2.50000000000000e-01 +0: (4, 6; 6) -2.50000000000000e-01 +0: (4, 6; 7) -2.50000000000000e-01 +0: (4, 6; 8) -2.50000000000000e-01 +0: (3, 7; 0) 4.00000000000000e+00 +0: (3, 7; 1) 0.00000000000000e+00 +0: (3, 7; 2) 0.00000000000000e+00 +0: (3, 7; 3) -1.50000000000000e+00 +0: (3, 7; 4) -1.50000000000000e+00 +0: (3, 7; 5) -2.50000000000000e-01 +0: (3, 7; 6) -2.50000000000000e-01 +0: (3, 7; 7) -2.50000000000000e-01 +0: (3, 7; 8) -2.50000000000000e-01 +0: (4, 7; 0) 4.00000000000000e+00 +0: (4, 7; 1) 0.00000000000000e+00 +0: (4, 7; 2) 0.00000000000000e+00 +0: (4, 7; 3) -1.50000000000000e+00 +0: (4, 7; 4) -1.50000000000000e+00 +0: (4, 7; 5) -2.50000000000000e-01 +0: (4, 7; 6) -2.50000000000000e-01 +0: (4, 7; 7) -2.50000000000000e-01 +0: (4, 7; 8) -2.50000000000000e-01 +0: (3, 8; 0) 4.00000000000000e+00 +0: (3, 8; 1) 0.00000000000000e+00 +0: (3, 8; 2) 0.00000000000000e+00 +0: (3, 8; 3) -1.50000000000000e+00 +0: (3, 8; 4) -1.50000000000000e+00 +0: (3, 8; 5) -2.50000000000000e-01 +0: (3, 8; 6) -2.50000000000000e-01 +0: (3, 8; 7) -2.50000000000000e-01 +0: (3, 8; 8) -2.50000000000000e-01 +0: (4, 8; 0) 4.00000000000000e+00 +0: (4, 8; 1) 0.00000000000000e+00 +0: (4, 8; 2) 0.00000000000000e+00 +0: (4, 8; 3) -1.50000000000000e+00 +0: (4, 8; 4) -1.50000000000000e+00 +0: (4, 8; 5) -2.50000000000000e-01 +0: (4, 8; 6) -2.50000000000000e-01 +0: (4, 8; 7) -2.50000000000000e-01 +0: (4, 8; 8) -2.50000000000000e-01 +0: (3, 9; 0) 4.00000000000000e+00 +0: (3, 9; 1) 0.00000000000000e+00 +0: (3, 9; 2) 0.00000000000000e+00 +0: (3, 9; 3) -1.50000000000000e+00 +0: (3, 9; 4) 0.00000000000000e+00 +0: (3, 9; 5) -2.50000000000000e-01 +0: (3, 9; 6) 0.00000000000000e+00 +0: (3, 9; 7) -2.50000000000000e-01 +0: (3, 9; 8) 0.00000000000000e+00 +0: (4, 9; 0) 4.00000000000000e+00 +0: (4, 9; 1) 0.00000000000000e+00 +0: (4, 9; 2) 0.00000000000000e+00 +0: (4, 9; 3) -1.50000000000000e+00 +0: (4, 9; 4) 0.00000000000000e+00 +0: (4, 9; 5) -2.50000000000000e-01 +0: (4, 9; 6) 0.00000000000000e+00 +0: (4, 9; 7) -2.50000000000000e-01 +0: (4, 9; 8) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.x.matmat.00000 b/src/test/TEST_structmat/structmat.saved.2D1.x.matmat.00000 new file mode 100644 index 0000000000..fe4df077f4 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.x.matmat.00000 @@ -0,0 +1,483 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (0, 0) x (4, 9) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +9 +0: (0, 0; 0) 4.00000000000000e+00 +0: (0, 0; 1) 0.00000000000000e+00 +0: (0, 0; 2) 0.00000000000000e+00 +0: (0, 0; 3) 0.00000000000000e+00 +0: (0, 0; 4) -1.50000000000000e+00 +0: (0, 0; 5) 0.00000000000000e+00 +0: (0, 0; 6) -2.50000000000000e-01 +0: (0, 0; 7) 0.00000000000000e+00 +0: (0, 0; 8) -2.50000000000000e-01 +0: (1, 0; 0) 4.00000000000000e+00 +0: (1, 0; 1) 0.00000000000000e+00 +0: (1, 0; 2) 0.00000000000000e+00 +0: (1, 0; 3) 0.00000000000000e+00 +0: (1, 0; 4) -1.50000000000000e+00 +0: (1, 0; 5) 0.00000000000000e+00 +0: (1, 0; 6) -2.50000000000000e-01 +0: (1, 0; 7) 0.00000000000000e+00 +0: (1, 0; 8) -2.50000000000000e-01 +0: (2, 0; 0) 4.00000000000000e+00 +0: (2, 0; 1) 0.00000000000000e+00 +0: (2, 0; 2) 0.00000000000000e+00 +0: (2, 0; 3) 0.00000000000000e+00 +0: (2, 0; 4) -1.50000000000000e+00 +0: (2, 0; 5) 0.00000000000000e+00 +0: (2, 0; 6) -2.50000000000000e-01 +0: (2, 0; 7) 0.00000000000000e+00 +0: (2, 0; 8) -2.50000000000000e-01 +0: (3, 0; 0) 4.00000000000000e+00 +0: (3, 0; 1) 0.00000000000000e+00 +0: (3, 0; 2) 0.00000000000000e+00 +0: (3, 0; 3) 0.00000000000000e+00 +0: (3, 0; 4) -1.50000000000000e+00 +0: (3, 0; 5) 0.00000000000000e+00 +0: (3, 0; 6) -2.50000000000000e-01 +0: (3, 0; 7) 0.00000000000000e+00 +0: (3, 0; 8) -2.50000000000000e-01 +0: (4, 0; 0) 4.00000000000000e+00 +0: (4, 0; 1) 0.00000000000000e+00 +0: (4, 0; 2) 0.00000000000000e+00 +0: (4, 0; 3) 0.00000000000000e+00 +0: (4, 0; 4) -1.50000000000000e+00 +0: (4, 0; 5) 0.00000000000000e+00 +0: (4, 0; 6) -2.50000000000000e-01 +0: (4, 0; 7) 0.00000000000000e+00 +0: (4, 0; 8) -2.50000000000000e-01 +0: (0, 1; 0) 4.00000000000000e+00 +0: (0, 1; 1) 0.00000000000000e+00 +0: (0, 1; 2) 0.00000000000000e+00 +0: (0, 1; 3) -1.50000000000000e+00 +0: (0, 1; 4) -1.50000000000000e+00 +0: (0, 1; 5) -2.50000000000000e-01 +0: (0, 1; 6) -2.50000000000000e-01 +0: (0, 1; 7) -2.50000000000000e-01 +0: (0, 1; 8) -2.50000000000000e-01 +0: (1, 1; 0) 4.00000000000000e+00 +0: (1, 1; 1) 0.00000000000000e+00 +0: (1, 1; 2) 0.00000000000000e+00 +0: (1, 1; 3) -1.50000000000000e+00 +0: (1, 1; 4) -1.50000000000000e+00 +0: (1, 1; 5) -2.50000000000000e-01 +0: (1, 1; 6) -2.50000000000000e-01 +0: (1, 1; 7) -2.50000000000000e-01 +0: (1, 1; 8) -2.50000000000000e-01 +0: (2, 1; 0) 4.00000000000000e+00 +0: (2, 1; 1) 0.00000000000000e+00 +0: (2, 1; 2) 0.00000000000000e+00 +0: (2, 1; 3) -1.50000000000000e+00 +0: (2, 1; 4) -1.50000000000000e+00 +0: (2, 1; 5) -2.50000000000000e-01 +0: (2, 1; 6) -2.50000000000000e-01 +0: (2, 1; 7) -2.50000000000000e-01 +0: (2, 1; 8) -2.50000000000000e-01 +0: (3, 1; 0) 4.00000000000000e+00 +0: (3, 1; 1) 0.00000000000000e+00 +0: (3, 1; 2) 0.00000000000000e+00 +0: (3, 1; 3) -1.50000000000000e+00 +0: (3, 1; 4) -1.50000000000000e+00 +0: (3, 1; 5) -2.50000000000000e-01 +0: (3, 1; 6) -2.50000000000000e-01 +0: (3, 1; 7) -2.50000000000000e-01 +0: (3, 1; 8) -2.50000000000000e-01 +0: (4, 1; 0) 4.00000000000000e+00 +0: (4, 1; 1) 0.00000000000000e+00 +0: (4, 1; 2) 0.00000000000000e+00 +0: (4, 1; 3) -1.50000000000000e+00 +0: (4, 1; 4) -1.50000000000000e+00 +0: (4, 1; 5) -2.50000000000000e-01 +0: (4, 1; 6) -2.50000000000000e-01 +0: (4, 1; 7) -2.50000000000000e-01 +0: (4, 1; 8) -2.50000000000000e-01 +0: (0, 2; 0) 4.00000000000000e+00 +0: (0, 2; 1) 0.00000000000000e+00 +0: (0, 2; 2) 0.00000000000000e+00 +0: (0, 2; 3) -1.50000000000000e+00 +0: (0, 2; 4) -1.50000000000000e+00 +0: (0, 2; 5) -2.50000000000000e-01 +0: (0, 2; 6) -2.50000000000000e-01 +0: (0, 2; 7) -2.50000000000000e-01 +0: (0, 2; 8) -2.50000000000000e-01 +0: (1, 2; 0) 4.00000000000000e+00 +0: (1, 2; 1) 0.00000000000000e+00 +0: (1, 2; 2) 0.00000000000000e+00 +0: (1, 2; 3) -1.50000000000000e+00 +0: (1, 2; 4) -1.50000000000000e+00 +0: (1, 2; 5) -2.50000000000000e-01 +0: (1, 2; 6) -2.50000000000000e-01 +0: (1, 2; 7) -2.50000000000000e-01 +0: (1, 2; 8) -2.50000000000000e-01 +0: (2, 2; 0) 4.00000000000000e+00 +0: (2, 2; 1) 0.00000000000000e+00 +0: (2, 2; 2) 0.00000000000000e+00 +0: (2, 2; 3) -1.50000000000000e+00 +0: (2, 2; 4) -1.50000000000000e+00 +0: (2, 2; 5) -2.50000000000000e-01 +0: (2, 2; 6) -2.50000000000000e-01 +0: (2, 2; 7) -2.50000000000000e-01 +0: (2, 2; 8) -2.50000000000000e-01 +0: (3, 2; 0) 4.00000000000000e+00 +0: (3, 2; 1) 0.00000000000000e+00 +0: (3, 2; 2) 0.00000000000000e+00 +0: (3, 2; 3) -1.50000000000000e+00 +0: (3, 2; 4) -1.50000000000000e+00 +0: (3, 2; 5) -2.50000000000000e-01 +0: (3, 2; 6) -2.50000000000000e-01 +0: (3, 2; 7) -2.50000000000000e-01 +0: (3, 2; 8) -2.50000000000000e-01 +0: (4, 2; 0) 4.00000000000000e+00 +0: (4, 2; 1) 0.00000000000000e+00 +0: (4, 2; 2) 0.00000000000000e+00 +0: (4, 2; 3) -1.50000000000000e+00 +0: (4, 2; 4) -1.50000000000000e+00 +0: (4, 2; 5) -2.50000000000000e-01 +0: (4, 2; 6) -2.50000000000000e-01 +0: (4, 2; 7) -2.50000000000000e-01 +0: (4, 2; 8) -2.50000000000000e-01 +0: (0, 3; 0) 4.00000000000000e+00 +0: (0, 3; 1) 0.00000000000000e+00 +0: (0, 3; 2) 0.00000000000000e+00 +0: (0, 3; 3) -1.50000000000000e+00 +0: (0, 3; 4) -1.50000000000000e+00 +0: (0, 3; 5) -2.50000000000000e-01 +0: (0, 3; 6) -2.50000000000000e-01 +0: (0, 3; 7) -2.50000000000000e-01 +0: (0, 3; 8) -2.50000000000000e-01 +0: (1, 3; 0) 4.00000000000000e+00 +0: (1, 3; 1) 0.00000000000000e+00 +0: (1, 3; 2) 0.00000000000000e+00 +0: (1, 3; 3) -1.50000000000000e+00 +0: (1, 3; 4) -1.50000000000000e+00 +0: (1, 3; 5) -2.50000000000000e-01 +0: (1, 3; 6) -2.50000000000000e-01 +0: (1, 3; 7) -2.50000000000000e-01 +0: (1, 3; 8) -2.50000000000000e-01 +0: (2, 3; 0) 4.00000000000000e+00 +0: (2, 3; 1) 0.00000000000000e+00 +0: (2, 3; 2) 0.00000000000000e+00 +0: (2, 3; 3) -1.50000000000000e+00 +0: (2, 3; 4) -1.50000000000000e+00 +0: (2, 3; 5) -2.50000000000000e-01 +0: (2, 3; 6) -2.50000000000000e-01 +0: (2, 3; 7) -2.50000000000000e-01 +0: (2, 3; 8) -2.50000000000000e-01 +0: (3, 3; 0) 4.00000000000000e+00 +0: (3, 3; 1) 0.00000000000000e+00 +0: (3, 3; 2) 0.00000000000000e+00 +0: (3, 3; 3) -1.50000000000000e+00 +0: (3, 3; 4) -1.50000000000000e+00 +0: (3, 3; 5) -2.50000000000000e-01 +0: (3, 3; 6) -2.50000000000000e-01 +0: (3, 3; 7) -2.50000000000000e-01 +0: (3, 3; 8) -2.50000000000000e-01 +0: (4, 3; 0) 4.00000000000000e+00 +0: (4, 3; 1) 0.00000000000000e+00 +0: (4, 3; 2) 0.00000000000000e+00 +0: (4, 3; 3) -1.50000000000000e+00 +0: (4, 3; 4) -1.50000000000000e+00 +0: (4, 3; 5) -2.50000000000000e-01 +0: (4, 3; 6) -2.50000000000000e-01 +0: (4, 3; 7) -2.50000000000000e-01 +0: (4, 3; 8) -2.50000000000000e-01 +0: (0, 4; 0) 4.00000000000000e+00 +0: (0, 4; 1) 0.00000000000000e+00 +0: (0, 4; 2) 0.00000000000000e+00 +0: (0, 4; 3) -1.50000000000000e+00 +0: (0, 4; 4) -1.50000000000000e+00 +0: (0, 4; 5) -2.50000000000000e-01 +0: (0, 4; 6) -2.50000000000000e-01 +0: (0, 4; 7) -2.50000000000000e-01 +0: (0, 4; 8) -2.50000000000000e-01 +0: (1, 4; 0) 4.00000000000000e+00 +0: (1, 4; 1) 0.00000000000000e+00 +0: (1, 4; 2) 0.00000000000000e+00 +0: (1, 4; 3) -1.50000000000000e+00 +0: (1, 4; 4) -1.50000000000000e+00 +0: (1, 4; 5) -2.50000000000000e-01 +0: (1, 4; 6) -2.50000000000000e-01 +0: (1, 4; 7) -2.50000000000000e-01 +0: (1, 4; 8) -2.50000000000000e-01 +0: (2, 4; 0) 4.00000000000000e+00 +0: (2, 4; 1) 0.00000000000000e+00 +0: (2, 4; 2) 0.00000000000000e+00 +0: (2, 4; 3) -1.50000000000000e+00 +0: (2, 4; 4) -1.50000000000000e+00 +0: (2, 4; 5) -2.50000000000000e-01 +0: (2, 4; 6) -2.50000000000000e-01 +0: (2, 4; 7) -2.50000000000000e-01 +0: (2, 4; 8) -2.50000000000000e-01 +0: (3, 4; 0) 4.00000000000000e+00 +0: (3, 4; 1) 0.00000000000000e+00 +0: (3, 4; 2) 0.00000000000000e+00 +0: (3, 4; 3) -1.50000000000000e+00 +0: (3, 4; 4) -1.50000000000000e+00 +0: (3, 4; 5) -2.50000000000000e-01 +0: (3, 4; 6) -2.50000000000000e-01 +0: (3, 4; 7) -2.50000000000000e-01 +0: (3, 4; 8) -2.50000000000000e-01 +0: (4, 4; 0) 4.00000000000000e+00 +0: (4, 4; 1) 0.00000000000000e+00 +0: (4, 4; 2) 0.00000000000000e+00 +0: (4, 4; 3) -1.50000000000000e+00 +0: (4, 4; 4) -1.50000000000000e+00 +0: (4, 4; 5) -2.50000000000000e-01 +0: (4, 4; 6) -2.50000000000000e-01 +0: (4, 4; 7) -2.50000000000000e-01 +0: (4, 4; 8) -2.50000000000000e-01 +0: (0, 5; 0) 4.00000000000000e+00 +0: (0, 5; 1) 0.00000000000000e+00 +0: (0, 5; 2) 0.00000000000000e+00 +0: (0, 5; 3) -1.50000000000000e+00 +0: (0, 5; 4) -1.50000000000000e+00 +0: (0, 5; 5) -2.50000000000000e-01 +0: (0, 5; 6) -2.50000000000000e-01 +0: (0, 5; 7) -2.50000000000000e-01 +0: (0, 5; 8) -2.50000000000000e-01 +0: (1, 5; 0) 4.00000000000000e+00 +0: (1, 5; 1) 0.00000000000000e+00 +0: (1, 5; 2) 0.00000000000000e+00 +0: (1, 5; 3) -1.50000000000000e+00 +0: (1, 5; 4) -1.50000000000000e+00 +0: (1, 5; 5) -2.50000000000000e-01 +0: (1, 5; 6) -2.50000000000000e-01 +0: (1, 5; 7) -2.50000000000000e-01 +0: (1, 5; 8) -2.50000000000000e-01 +0: (2, 5; 0) 4.00000000000000e+00 +0: (2, 5; 1) 0.00000000000000e+00 +0: (2, 5; 2) 0.00000000000000e+00 +0: (2, 5; 3) -1.50000000000000e+00 +0: (2, 5; 4) -1.50000000000000e+00 +0: (2, 5; 5) -2.50000000000000e-01 +0: (2, 5; 6) -2.50000000000000e-01 +0: (2, 5; 7) -2.50000000000000e-01 +0: (2, 5; 8) -2.50000000000000e-01 +0: (3, 5; 0) 4.00000000000000e+00 +0: (3, 5; 1) 0.00000000000000e+00 +0: (3, 5; 2) 0.00000000000000e+00 +0: (3, 5; 3) -1.50000000000000e+00 +0: (3, 5; 4) -1.50000000000000e+00 +0: (3, 5; 5) -2.50000000000000e-01 +0: (3, 5; 6) -2.50000000000000e-01 +0: (3, 5; 7) -2.50000000000000e-01 +0: (3, 5; 8) -2.50000000000000e-01 +0: (4, 5; 0) 4.00000000000000e+00 +0: (4, 5; 1) 0.00000000000000e+00 +0: (4, 5; 2) 0.00000000000000e+00 +0: (4, 5; 3) -1.50000000000000e+00 +0: (4, 5; 4) -1.50000000000000e+00 +0: (4, 5; 5) -2.50000000000000e-01 +0: (4, 5; 6) -2.50000000000000e-01 +0: (4, 5; 7) -2.50000000000000e-01 +0: (4, 5; 8) -2.50000000000000e-01 +0: (0, 6; 0) 4.00000000000000e+00 +0: (0, 6; 1) 0.00000000000000e+00 +0: (0, 6; 2) 0.00000000000000e+00 +0: (0, 6; 3) -1.50000000000000e+00 +0: (0, 6; 4) -1.50000000000000e+00 +0: (0, 6; 5) -2.50000000000000e-01 +0: (0, 6; 6) -2.50000000000000e-01 +0: (0, 6; 7) -2.50000000000000e-01 +0: (0, 6; 8) -2.50000000000000e-01 +0: (1, 6; 0) 4.00000000000000e+00 +0: (1, 6; 1) 0.00000000000000e+00 +0: (1, 6; 2) 0.00000000000000e+00 +0: (1, 6; 3) -1.50000000000000e+00 +0: (1, 6; 4) -1.50000000000000e+00 +0: (1, 6; 5) -2.50000000000000e-01 +0: (1, 6; 6) -2.50000000000000e-01 +0: (1, 6; 7) -2.50000000000000e-01 +0: (1, 6; 8) -2.50000000000000e-01 +0: (2, 6; 0) 4.00000000000000e+00 +0: (2, 6; 1) 0.00000000000000e+00 +0: (2, 6; 2) 0.00000000000000e+00 +0: (2, 6; 3) -1.50000000000000e+00 +0: (2, 6; 4) -1.50000000000000e+00 +0: (2, 6; 5) -2.50000000000000e-01 +0: (2, 6; 6) -2.50000000000000e-01 +0: (2, 6; 7) -2.50000000000000e-01 +0: (2, 6; 8) -2.50000000000000e-01 +0: (3, 6; 0) 4.00000000000000e+00 +0: (3, 6; 1) 0.00000000000000e+00 +0: (3, 6; 2) 0.00000000000000e+00 +0: (3, 6; 3) -1.50000000000000e+00 +0: (3, 6; 4) -1.50000000000000e+00 +0: (3, 6; 5) -2.50000000000000e-01 +0: (3, 6; 6) -2.50000000000000e-01 +0: (3, 6; 7) -2.50000000000000e-01 +0: (3, 6; 8) -2.50000000000000e-01 +0: (4, 6; 0) 4.00000000000000e+00 +0: (4, 6; 1) 0.00000000000000e+00 +0: (4, 6; 2) 0.00000000000000e+00 +0: (4, 6; 3) -1.50000000000000e+00 +0: (4, 6; 4) -1.50000000000000e+00 +0: (4, 6; 5) -2.50000000000000e-01 +0: (4, 6; 6) -2.50000000000000e-01 +0: (4, 6; 7) -2.50000000000000e-01 +0: (4, 6; 8) -2.50000000000000e-01 +0: (0, 7; 0) 4.00000000000000e+00 +0: (0, 7; 1) 0.00000000000000e+00 +0: (0, 7; 2) 0.00000000000000e+00 +0: (0, 7; 3) -1.50000000000000e+00 +0: (0, 7; 4) -1.50000000000000e+00 +0: (0, 7; 5) -2.50000000000000e-01 +0: (0, 7; 6) -2.50000000000000e-01 +0: (0, 7; 7) -2.50000000000000e-01 +0: (0, 7; 8) -2.50000000000000e-01 +0: (1, 7; 0) 4.00000000000000e+00 +0: (1, 7; 1) 0.00000000000000e+00 +0: (1, 7; 2) 0.00000000000000e+00 +0: (1, 7; 3) -1.50000000000000e+00 +0: (1, 7; 4) -1.50000000000000e+00 +0: (1, 7; 5) -2.50000000000000e-01 +0: (1, 7; 6) -2.50000000000000e-01 +0: (1, 7; 7) -2.50000000000000e-01 +0: (1, 7; 8) -2.50000000000000e-01 +0: (2, 7; 0) 4.00000000000000e+00 +0: (2, 7; 1) 0.00000000000000e+00 +0: (2, 7; 2) 0.00000000000000e+00 +0: (2, 7; 3) -1.50000000000000e+00 +0: (2, 7; 4) -1.50000000000000e+00 +0: (2, 7; 5) -2.50000000000000e-01 +0: (2, 7; 6) -2.50000000000000e-01 +0: (2, 7; 7) -2.50000000000000e-01 +0: (2, 7; 8) -2.50000000000000e-01 +0: (3, 7; 0) 4.00000000000000e+00 +0: (3, 7; 1) 0.00000000000000e+00 +0: (3, 7; 2) 0.00000000000000e+00 +0: (3, 7; 3) -1.50000000000000e+00 +0: (3, 7; 4) -1.50000000000000e+00 +0: (3, 7; 5) -2.50000000000000e-01 +0: (3, 7; 6) -2.50000000000000e-01 +0: (3, 7; 7) -2.50000000000000e-01 +0: (3, 7; 8) -2.50000000000000e-01 +0: (4, 7; 0) 4.00000000000000e+00 +0: (4, 7; 1) 0.00000000000000e+00 +0: (4, 7; 2) 0.00000000000000e+00 +0: (4, 7; 3) -1.50000000000000e+00 +0: (4, 7; 4) -1.50000000000000e+00 +0: (4, 7; 5) -2.50000000000000e-01 +0: (4, 7; 6) -2.50000000000000e-01 +0: (4, 7; 7) -2.50000000000000e-01 +0: (4, 7; 8) -2.50000000000000e-01 +0: (0, 8; 0) 4.00000000000000e+00 +0: (0, 8; 1) 0.00000000000000e+00 +0: (0, 8; 2) 0.00000000000000e+00 +0: (0, 8; 3) -1.50000000000000e+00 +0: (0, 8; 4) -1.50000000000000e+00 +0: (0, 8; 5) -2.50000000000000e-01 +0: (0, 8; 6) -2.50000000000000e-01 +0: (0, 8; 7) -2.50000000000000e-01 +0: (0, 8; 8) -2.50000000000000e-01 +0: (1, 8; 0) 4.00000000000000e+00 +0: (1, 8; 1) 0.00000000000000e+00 +0: (1, 8; 2) 0.00000000000000e+00 +0: (1, 8; 3) -1.50000000000000e+00 +0: (1, 8; 4) -1.50000000000000e+00 +0: (1, 8; 5) -2.50000000000000e-01 +0: (1, 8; 6) -2.50000000000000e-01 +0: (1, 8; 7) -2.50000000000000e-01 +0: (1, 8; 8) -2.50000000000000e-01 +0: (2, 8; 0) 4.00000000000000e+00 +0: (2, 8; 1) 0.00000000000000e+00 +0: (2, 8; 2) 0.00000000000000e+00 +0: (2, 8; 3) -1.50000000000000e+00 +0: (2, 8; 4) -1.50000000000000e+00 +0: (2, 8; 5) -2.50000000000000e-01 +0: (2, 8; 6) -2.50000000000000e-01 +0: (2, 8; 7) -2.50000000000000e-01 +0: (2, 8; 8) -2.50000000000000e-01 +0: (3, 8; 0) 4.00000000000000e+00 +0: (3, 8; 1) 0.00000000000000e+00 +0: (3, 8; 2) 0.00000000000000e+00 +0: (3, 8; 3) -1.50000000000000e+00 +0: (3, 8; 4) -1.50000000000000e+00 +0: (3, 8; 5) -2.50000000000000e-01 +0: (3, 8; 6) -2.50000000000000e-01 +0: (3, 8; 7) -2.50000000000000e-01 +0: (3, 8; 8) -2.50000000000000e-01 +0: (4, 8; 0) 4.00000000000000e+00 +0: (4, 8; 1) 0.00000000000000e+00 +0: (4, 8; 2) 0.00000000000000e+00 +0: (4, 8; 3) -1.50000000000000e+00 +0: (4, 8; 4) -1.50000000000000e+00 +0: (4, 8; 5) -2.50000000000000e-01 +0: (4, 8; 6) -2.50000000000000e-01 +0: (4, 8; 7) -2.50000000000000e-01 +0: (4, 8; 8) -2.50000000000000e-01 +0: (0, 9; 0) 4.00000000000000e+00 +0: (0, 9; 1) 0.00000000000000e+00 +0: (0, 9; 2) 0.00000000000000e+00 +0: (0, 9; 3) -1.50000000000000e+00 +0: (0, 9; 4) 0.00000000000000e+00 +0: (0, 9; 5) -2.50000000000000e-01 +0: (0, 9; 6) 0.00000000000000e+00 +0: (0, 9; 7) -2.50000000000000e-01 +0: (0, 9; 8) 0.00000000000000e+00 +0: (1, 9; 0) 4.00000000000000e+00 +0: (1, 9; 1) 0.00000000000000e+00 +0: (1, 9; 2) 0.00000000000000e+00 +0: (1, 9; 3) -1.50000000000000e+00 +0: (1, 9; 4) 0.00000000000000e+00 +0: (1, 9; 5) -2.50000000000000e-01 +0: (1, 9; 6) 0.00000000000000e+00 +0: (1, 9; 7) -2.50000000000000e-01 +0: (1, 9; 8) 0.00000000000000e+00 +0: (2, 9; 0) 4.00000000000000e+00 +0: (2, 9; 1) 0.00000000000000e+00 +0: (2, 9; 2) 0.00000000000000e+00 +0: (2, 9; 3) -1.50000000000000e+00 +0: (2, 9; 4) 0.00000000000000e+00 +0: (2, 9; 5) -2.50000000000000e-01 +0: (2, 9; 6) 0.00000000000000e+00 +0: (2, 9; 7) -2.50000000000000e-01 +0: (2, 9; 8) 0.00000000000000e+00 +0: (3, 9; 0) 4.00000000000000e+00 +0: (3, 9; 1) 0.00000000000000e+00 +0: (3, 9; 2) 0.00000000000000e+00 +0: (3, 9; 3) -1.50000000000000e+00 +0: (3, 9; 4) 0.00000000000000e+00 +0: (3, 9; 5) -2.50000000000000e-01 +0: (3, 9; 6) 0.00000000000000e+00 +0: (3, 9; 7) -2.50000000000000e-01 +0: (3, 9; 8) 0.00000000000000e+00 +0: (4, 9; 0) 4.00000000000000e+00 +0: (4, 9; 1) 0.00000000000000e+00 +0: (4, 9; 2) 0.00000000000000e+00 +0: (4, 9; 3) -1.50000000000000e+00 +0: (4, 9; 4) 0.00000000000000e+00 +0: (4, 9; 5) -2.50000000000000e-01 +0: (4, 9; 6) 0.00000000000000e+00 +0: (4, 9; 7) -2.50000000000000e-01 +0: (4, 9; 8) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.xidle.4.matmat.00000 b/src/test/TEST_structmat/structmat.saved.2D1.xidle.4.matmat.00000 new file mode 100644 index 0000000000..a5ce72dbcb --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.xidle.4.matmat.00000 @@ -0,0 +1,69 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (0, 0) x (0, 3) + +Periodic: (2, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +9 +0: (0, 0; 0) 4.00000000000000e+00 +0: (0, 0; 1) 0.00000000000000e+00 +0: (0, 0; 2) 0.00000000000000e+00 +0: (0, 0; 3) 0.00000000000000e+00 +0: (0, 0; 4) -1.50000000000000e+00 +0: (0, 0; 5) 0.00000000000000e+00 +0: (0, 0; 6) -2.50000000000000e-01 +0: (0, 0; 7) 0.00000000000000e+00 +0: (0, 0; 8) -2.50000000000000e-01 +0: (0, 1; 0) 4.00000000000000e+00 +0: (0, 1; 1) 0.00000000000000e+00 +0: (0, 1; 2) 0.00000000000000e+00 +0: (0, 1; 3) -1.50000000000000e+00 +0: (0, 1; 4) -1.50000000000000e+00 +0: (0, 1; 5) -2.50000000000000e-01 +0: (0, 1; 6) -2.50000000000000e-01 +0: (0, 1; 7) -2.50000000000000e-01 +0: (0, 1; 8) -2.50000000000000e-01 +0: (0, 2; 0) 4.00000000000000e+00 +0: (0, 2; 1) 0.00000000000000e+00 +0: (0, 2; 2) 0.00000000000000e+00 +0: (0, 2; 3) -1.50000000000000e+00 +0: (0, 2; 4) -1.50000000000000e+00 +0: (0, 2; 5) -2.50000000000000e-01 +0: (0, 2; 6) -2.50000000000000e-01 +0: (0, 2; 7) -2.50000000000000e-01 +0: (0, 2; 8) -2.50000000000000e-01 +0: (0, 3; 0) 4.00000000000000e+00 +0: (0, 3; 1) 0.00000000000000e+00 +0: (0, 3; 2) 0.00000000000000e+00 +0: (0, 3; 3) -1.50000000000000e+00 +0: (0, 3; 4) 0.00000000000000e+00 +0: (0, 3; 5) -2.50000000000000e-01 +0: (0, 3; 6) 0.00000000000000e+00 +0: (0, 3; 7) -2.50000000000000e-01 +0: (0, 3; 8) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.xidle.4.matmat.00001 b/src/test/TEST_structmat/structmat.saved.2D1.xidle.4.matmat.00001 new file mode 100644 index 0000000000..dc2d6f9c51 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.xidle.4.matmat.00001 @@ -0,0 +1,32 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 0 + +Grid: +2 +0 + +Periodic: (2, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +9 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.xidle.4.matmat.00002 b/src/test/TEST_structmat/structmat.saved.2D1.xidle.4.matmat.00002 new file mode 100644 index 0000000000..f0ab0f4590 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.xidle.4.matmat.00002 @@ -0,0 +1,69 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (1, 0) x (1, 3) + +Periodic: (2, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +9 +0: (1, 0; 0) 4.00000000000000e+00 +0: (1, 0; 1) 0.00000000000000e+00 +0: (1, 0; 2) 0.00000000000000e+00 +0: (1, 0; 3) 0.00000000000000e+00 +0: (1, 0; 4) -1.50000000000000e+00 +0: (1, 0; 5) 0.00000000000000e+00 +0: (1, 0; 6) -2.50000000000000e-01 +0: (1, 0; 7) 0.00000000000000e+00 +0: (1, 0; 8) -2.50000000000000e-01 +0: (1, 1; 0) 4.00000000000000e+00 +0: (1, 1; 1) 0.00000000000000e+00 +0: (1, 1; 2) 0.00000000000000e+00 +0: (1, 1; 3) -1.50000000000000e+00 +0: (1, 1; 4) -1.50000000000000e+00 +0: (1, 1; 5) -2.50000000000000e-01 +0: (1, 1; 6) -2.50000000000000e-01 +0: (1, 1; 7) -2.50000000000000e-01 +0: (1, 1; 8) -2.50000000000000e-01 +0: (1, 2; 0) 4.00000000000000e+00 +0: (1, 2; 1) 0.00000000000000e+00 +0: (1, 2; 2) 0.00000000000000e+00 +0: (1, 2; 3) -1.50000000000000e+00 +0: (1, 2; 4) -1.50000000000000e+00 +0: (1, 2; 5) -2.50000000000000e-01 +0: (1, 2; 6) -2.50000000000000e-01 +0: (1, 2; 7) -2.50000000000000e-01 +0: (1, 2; 8) -2.50000000000000e-01 +0: (1, 3; 0) 4.00000000000000e+00 +0: (1, 3; 1) 0.00000000000000e+00 +0: (1, 3; 2) 0.00000000000000e+00 +0: (1, 3; 3) -1.50000000000000e+00 +0: (1, 3; 4) 0.00000000000000e+00 +0: (1, 3; 5) -2.50000000000000e-01 +0: (1, 3; 6) 0.00000000000000e+00 +0: (1, 3; 7) -2.50000000000000e-01 +0: (1, 3; 8) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.xidle.4.matmat.00003 b/src/test/TEST_structmat/structmat.saved.2D1.xidle.4.matmat.00003 new file mode 100644 index 0000000000..dc2d6f9c51 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.xidle.4.matmat.00003 @@ -0,0 +1,32 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 0 + +Grid: +2 +0 + +Periodic: (2, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +9 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.xidle.matmat.00000 b/src/test/TEST_structmat/structmat.saved.2D1.xidle.matmat.00000 new file mode 100644 index 0000000000..0ae76d137a --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.xidle.matmat.00000 @@ -0,0 +1,105 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (0, 0) x (1, 3) + +Periodic: (2, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +9 +0: (0, 0; 0) 4.00000000000000e+00 +0: (0, 0; 1) 0.00000000000000e+00 +0: (0, 0; 2) 0.00000000000000e+00 +0: (0, 0; 3) 0.00000000000000e+00 +0: (0, 0; 4) -1.50000000000000e+00 +0: (0, 0; 5) 0.00000000000000e+00 +0: (0, 0; 6) -2.50000000000000e-01 +0: (0, 0; 7) 0.00000000000000e+00 +0: (0, 0; 8) -2.50000000000000e-01 +0: (1, 0; 0) 4.00000000000000e+00 +0: (1, 0; 1) 0.00000000000000e+00 +0: (1, 0; 2) 0.00000000000000e+00 +0: (1, 0; 3) 0.00000000000000e+00 +0: (1, 0; 4) -1.50000000000000e+00 +0: (1, 0; 5) 0.00000000000000e+00 +0: (1, 0; 6) -2.50000000000000e-01 +0: (1, 0; 7) 0.00000000000000e+00 +0: (1, 0; 8) -2.50000000000000e-01 +0: (0, 1; 0) 4.00000000000000e+00 +0: (0, 1; 1) 0.00000000000000e+00 +0: (0, 1; 2) 0.00000000000000e+00 +0: (0, 1; 3) -1.50000000000000e+00 +0: (0, 1; 4) -1.50000000000000e+00 +0: (0, 1; 5) -2.50000000000000e-01 +0: (0, 1; 6) -2.50000000000000e-01 +0: (0, 1; 7) -2.50000000000000e-01 +0: (0, 1; 8) -2.50000000000000e-01 +0: (1, 1; 0) 4.00000000000000e+00 +0: (1, 1; 1) 0.00000000000000e+00 +0: (1, 1; 2) 0.00000000000000e+00 +0: (1, 1; 3) -1.50000000000000e+00 +0: (1, 1; 4) -1.50000000000000e+00 +0: (1, 1; 5) -2.50000000000000e-01 +0: (1, 1; 6) -2.50000000000000e-01 +0: (1, 1; 7) -2.50000000000000e-01 +0: (1, 1; 8) -2.50000000000000e-01 +0: (0, 2; 0) 4.00000000000000e+00 +0: (0, 2; 1) 0.00000000000000e+00 +0: (0, 2; 2) 0.00000000000000e+00 +0: (0, 2; 3) -1.50000000000000e+00 +0: (0, 2; 4) -1.50000000000000e+00 +0: (0, 2; 5) -2.50000000000000e-01 +0: (0, 2; 6) -2.50000000000000e-01 +0: (0, 2; 7) -2.50000000000000e-01 +0: (0, 2; 8) -2.50000000000000e-01 +0: (1, 2; 0) 4.00000000000000e+00 +0: (1, 2; 1) 0.00000000000000e+00 +0: (1, 2; 2) 0.00000000000000e+00 +0: (1, 2; 3) -1.50000000000000e+00 +0: (1, 2; 4) -1.50000000000000e+00 +0: (1, 2; 5) -2.50000000000000e-01 +0: (1, 2; 6) -2.50000000000000e-01 +0: (1, 2; 7) -2.50000000000000e-01 +0: (1, 2; 8) -2.50000000000000e-01 +0: (0, 3; 0) 4.00000000000000e+00 +0: (0, 3; 1) 0.00000000000000e+00 +0: (0, 3; 2) 0.00000000000000e+00 +0: (0, 3; 3) -1.50000000000000e+00 +0: (0, 3; 4) 0.00000000000000e+00 +0: (0, 3; 5) -2.50000000000000e-01 +0: (0, 3; 6) 0.00000000000000e+00 +0: (0, 3; 7) -2.50000000000000e-01 +0: (0, 3; 8) 0.00000000000000e+00 +0: (1, 3; 0) 4.00000000000000e+00 +0: (1, 3; 1) 0.00000000000000e+00 +0: (1, 3; 2) 0.00000000000000e+00 +0: (1, 3; 3) -1.50000000000000e+00 +0: (1, 3; 4) 0.00000000000000e+00 +0: (1, 3; 5) -2.50000000000000e-01 +0: (1, 3; 6) 0.00000000000000e+00 +0: (1, 3; 7) -2.50000000000000e-01 +0: (1, 3; 8) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.y.4.matmat.00000 b/src/test/TEST_structmat/structmat.saved.2D1.y.4.matmat.00000 new file mode 100644 index 0000000000..529cf8b07a --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.y.4.matmat.00000 @@ -0,0 +1,168 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (0, 0) x (4, 2) + +Periodic: (10, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (1, -1) +7: (-1, 1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +9 +0: (0, 0; 0) 4.00000000000000e+00 +0: (0, 0; 1) -1.25000000000000e+00 +0: (0, 0; 2) -1.25000000000000e+00 +0: (0, 0; 3) 0.00000000000000e+00 +0: (0, 0; 4) 0.00000000000000e+00 +0: (0, 0; 5) 0.00000000000000e+00 +0: (0, 0; 6) 0.00000000000000e+00 +0: (0, 0; 7) -2.50000000000000e-01 +0: (0, 0; 8) -2.50000000000000e-01 +0: (1, 0; 0) 4.00000000000000e+00 +0: (1, 0; 1) -1.25000000000000e+00 +0: (1, 0; 2) -1.25000000000000e+00 +0: (1, 0; 3) 0.00000000000000e+00 +0: (1, 0; 4) 0.00000000000000e+00 +0: (1, 0; 5) 0.00000000000000e+00 +0: (1, 0; 6) 0.00000000000000e+00 +0: (1, 0; 7) -2.50000000000000e-01 +0: (1, 0; 8) -2.50000000000000e-01 +0: (2, 0; 0) 4.00000000000000e+00 +0: (2, 0; 1) -1.25000000000000e+00 +0: (2, 0; 2) -1.25000000000000e+00 +0: (2, 0; 3) 0.00000000000000e+00 +0: (2, 0; 4) 0.00000000000000e+00 +0: (2, 0; 5) 0.00000000000000e+00 +0: (2, 0; 6) 0.00000000000000e+00 +0: (2, 0; 7) -2.50000000000000e-01 +0: (2, 0; 8) -2.50000000000000e-01 +0: (3, 0; 0) 4.00000000000000e+00 +0: (3, 0; 1) -1.25000000000000e+00 +0: (3, 0; 2) -1.25000000000000e+00 +0: (3, 0; 3) 0.00000000000000e+00 +0: (3, 0; 4) 0.00000000000000e+00 +0: (3, 0; 5) 0.00000000000000e+00 +0: (3, 0; 6) 0.00000000000000e+00 +0: (3, 0; 7) -2.50000000000000e-01 +0: (3, 0; 8) -2.50000000000000e-01 +0: (4, 0; 0) 4.00000000000000e+00 +0: (4, 0; 1) -1.25000000000000e+00 +0: (4, 0; 2) -1.25000000000000e+00 +0: (4, 0; 3) 0.00000000000000e+00 +0: (4, 0; 4) 0.00000000000000e+00 +0: (4, 0; 5) 0.00000000000000e+00 +0: (4, 0; 6) 0.00000000000000e+00 +0: (4, 0; 7) -2.50000000000000e-01 +0: (4, 0; 8) -2.50000000000000e-01 +0: (0, 1; 0) 4.00000000000000e+00 +0: (0, 1; 1) -1.50000000000000e+00 +0: (0, 1; 2) -1.50000000000000e+00 +0: (0, 1; 3) 0.00000000000000e+00 +0: (0, 1; 4) 0.00000000000000e+00 +0: (0, 1; 5) -2.50000000000000e-01 +0: (0, 1; 6) -2.50000000000000e-01 +0: (0, 1; 7) -2.50000000000000e-01 +0: (0, 1; 8) -2.50000000000000e-01 +0: (1, 1; 0) 4.00000000000000e+00 +0: (1, 1; 1) -1.50000000000000e+00 +0: (1, 1; 2) -1.50000000000000e+00 +0: (1, 1; 3) 0.00000000000000e+00 +0: (1, 1; 4) 0.00000000000000e+00 +0: (1, 1; 5) -2.50000000000000e-01 +0: (1, 1; 6) -2.50000000000000e-01 +0: (1, 1; 7) -2.50000000000000e-01 +0: (1, 1; 8) -2.50000000000000e-01 +0: (2, 1; 0) 4.00000000000000e+00 +0: (2, 1; 1) -1.50000000000000e+00 +0: (2, 1; 2) -1.50000000000000e+00 +0: (2, 1; 3) 0.00000000000000e+00 +0: (2, 1; 4) 0.00000000000000e+00 +0: (2, 1; 5) -2.50000000000000e-01 +0: (2, 1; 6) -2.50000000000000e-01 +0: (2, 1; 7) -2.50000000000000e-01 +0: (2, 1; 8) -2.50000000000000e-01 +0: (3, 1; 0) 4.00000000000000e+00 +0: (3, 1; 1) -1.50000000000000e+00 +0: (3, 1; 2) -1.50000000000000e+00 +0: (3, 1; 3) 0.00000000000000e+00 +0: (3, 1; 4) 0.00000000000000e+00 +0: (3, 1; 5) -2.50000000000000e-01 +0: (3, 1; 6) -2.50000000000000e-01 +0: (3, 1; 7) -2.50000000000000e-01 +0: (3, 1; 8) -2.50000000000000e-01 +0: (4, 1; 0) 4.00000000000000e+00 +0: (4, 1; 1) -1.50000000000000e+00 +0: (4, 1; 2) -1.50000000000000e+00 +0: (4, 1; 3) 0.00000000000000e+00 +0: (4, 1; 4) 0.00000000000000e+00 +0: (4, 1; 5) -2.50000000000000e-01 +0: (4, 1; 6) -2.50000000000000e-01 +0: (4, 1; 7) -2.50000000000000e-01 +0: (4, 1; 8) -2.50000000000000e-01 +0: (0, 2; 0) 4.00000000000000e+00 +0: (0, 2; 1) -1.50000000000000e+00 +0: (0, 2; 2) -1.50000000000000e+00 +0: (0, 2; 3) 0.00000000000000e+00 +0: (0, 2; 4) 0.00000000000000e+00 +0: (0, 2; 5) -2.50000000000000e-01 +0: (0, 2; 6) -2.50000000000000e-01 +0: (0, 2; 7) -2.50000000000000e-01 +0: (0, 2; 8) -2.50000000000000e-01 +0: (1, 2; 0) 4.00000000000000e+00 +0: (1, 2; 1) -1.50000000000000e+00 +0: (1, 2; 2) -1.50000000000000e+00 +0: (1, 2; 3) 0.00000000000000e+00 +0: (1, 2; 4) 0.00000000000000e+00 +0: (1, 2; 5) -2.50000000000000e-01 +0: (1, 2; 6) -2.50000000000000e-01 +0: (1, 2; 7) -2.50000000000000e-01 +0: (1, 2; 8) -2.50000000000000e-01 +0: (2, 2; 0) 4.00000000000000e+00 +0: (2, 2; 1) -1.50000000000000e+00 +0: (2, 2; 2) -1.50000000000000e+00 +0: (2, 2; 3) 0.00000000000000e+00 +0: (2, 2; 4) 0.00000000000000e+00 +0: (2, 2; 5) -2.50000000000000e-01 +0: (2, 2; 6) -2.50000000000000e-01 +0: (2, 2; 7) -2.50000000000000e-01 +0: (2, 2; 8) -2.50000000000000e-01 +0: (3, 2; 0) 4.00000000000000e+00 +0: (3, 2; 1) -1.50000000000000e+00 +0: (3, 2; 2) -1.50000000000000e+00 +0: (3, 2; 3) 0.00000000000000e+00 +0: (3, 2; 4) 0.00000000000000e+00 +0: (3, 2; 5) -2.50000000000000e-01 +0: (3, 2; 6) -2.50000000000000e-01 +0: (3, 2; 7) -2.50000000000000e-01 +0: (3, 2; 8) -2.50000000000000e-01 +0: (4, 2; 0) 4.00000000000000e+00 +0: (4, 2; 1) -1.50000000000000e+00 +0: (4, 2; 2) -1.50000000000000e+00 +0: (4, 2; 3) 0.00000000000000e+00 +0: (4, 2; 4) 0.00000000000000e+00 +0: (4, 2; 5) -2.50000000000000e-01 +0: (4, 2; 6) -2.50000000000000e-01 +0: (4, 2; 7) -2.50000000000000e-01 +0: (4, 2; 8) -2.50000000000000e-01 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.y.4.matmat.00001 b/src/test/TEST_structmat/structmat.saved.2D1.y.4.matmat.00001 new file mode 100644 index 0000000000..570e9939ac --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.y.4.matmat.00001 @@ -0,0 +1,168 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (5, 0) x (9, 2) + +Periodic: (10, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (1, -1) +7: (-1, 1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +9 +0: (5, 0; 0) 4.00000000000000e+00 +0: (5, 0; 1) -1.25000000000000e+00 +0: (5, 0; 2) -1.25000000000000e+00 +0: (5, 0; 3) 0.00000000000000e+00 +0: (5, 0; 4) 0.00000000000000e+00 +0: (5, 0; 5) 0.00000000000000e+00 +0: (5, 0; 6) 0.00000000000000e+00 +0: (5, 0; 7) -2.50000000000000e-01 +0: (5, 0; 8) -2.50000000000000e-01 +0: (6, 0; 0) 4.00000000000000e+00 +0: (6, 0; 1) -1.25000000000000e+00 +0: (6, 0; 2) -1.25000000000000e+00 +0: (6, 0; 3) 0.00000000000000e+00 +0: (6, 0; 4) 0.00000000000000e+00 +0: (6, 0; 5) 0.00000000000000e+00 +0: (6, 0; 6) 0.00000000000000e+00 +0: (6, 0; 7) -2.50000000000000e-01 +0: (6, 0; 8) -2.50000000000000e-01 +0: (7, 0; 0) 4.00000000000000e+00 +0: (7, 0; 1) -1.25000000000000e+00 +0: (7, 0; 2) -1.25000000000000e+00 +0: (7, 0; 3) 0.00000000000000e+00 +0: (7, 0; 4) 0.00000000000000e+00 +0: (7, 0; 5) 0.00000000000000e+00 +0: (7, 0; 6) 0.00000000000000e+00 +0: (7, 0; 7) -2.50000000000000e-01 +0: (7, 0; 8) -2.50000000000000e-01 +0: (8, 0; 0) 4.00000000000000e+00 +0: (8, 0; 1) -1.25000000000000e+00 +0: (8, 0; 2) -1.25000000000000e+00 +0: (8, 0; 3) 0.00000000000000e+00 +0: (8, 0; 4) 0.00000000000000e+00 +0: (8, 0; 5) 0.00000000000000e+00 +0: (8, 0; 6) 0.00000000000000e+00 +0: (8, 0; 7) -2.50000000000000e-01 +0: (8, 0; 8) -2.50000000000000e-01 +0: (9, 0; 0) 4.00000000000000e+00 +0: (9, 0; 1) -1.25000000000000e+00 +0: (9, 0; 2) -1.25000000000000e+00 +0: (9, 0; 3) 0.00000000000000e+00 +0: (9, 0; 4) 0.00000000000000e+00 +0: (9, 0; 5) 0.00000000000000e+00 +0: (9, 0; 6) 0.00000000000000e+00 +0: (9, 0; 7) -2.50000000000000e-01 +0: (9, 0; 8) -2.50000000000000e-01 +0: (5, 1; 0) 4.00000000000000e+00 +0: (5, 1; 1) -1.50000000000000e+00 +0: (5, 1; 2) -1.50000000000000e+00 +0: (5, 1; 3) 0.00000000000000e+00 +0: (5, 1; 4) 0.00000000000000e+00 +0: (5, 1; 5) -2.50000000000000e-01 +0: (5, 1; 6) -2.50000000000000e-01 +0: (5, 1; 7) -2.50000000000000e-01 +0: (5, 1; 8) -2.50000000000000e-01 +0: (6, 1; 0) 4.00000000000000e+00 +0: (6, 1; 1) -1.50000000000000e+00 +0: (6, 1; 2) -1.50000000000000e+00 +0: (6, 1; 3) 0.00000000000000e+00 +0: (6, 1; 4) 0.00000000000000e+00 +0: (6, 1; 5) -2.50000000000000e-01 +0: (6, 1; 6) -2.50000000000000e-01 +0: (6, 1; 7) -2.50000000000000e-01 +0: (6, 1; 8) -2.50000000000000e-01 +0: (7, 1; 0) 4.00000000000000e+00 +0: (7, 1; 1) -1.50000000000000e+00 +0: (7, 1; 2) -1.50000000000000e+00 +0: (7, 1; 3) 0.00000000000000e+00 +0: (7, 1; 4) 0.00000000000000e+00 +0: (7, 1; 5) -2.50000000000000e-01 +0: (7, 1; 6) -2.50000000000000e-01 +0: (7, 1; 7) -2.50000000000000e-01 +0: (7, 1; 8) -2.50000000000000e-01 +0: (8, 1; 0) 4.00000000000000e+00 +0: (8, 1; 1) -1.50000000000000e+00 +0: (8, 1; 2) -1.50000000000000e+00 +0: (8, 1; 3) 0.00000000000000e+00 +0: (8, 1; 4) 0.00000000000000e+00 +0: (8, 1; 5) -2.50000000000000e-01 +0: (8, 1; 6) -2.50000000000000e-01 +0: (8, 1; 7) -2.50000000000000e-01 +0: (8, 1; 8) -2.50000000000000e-01 +0: (9, 1; 0) 4.00000000000000e+00 +0: (9, 1; 1) -1.50000000000000e+00 +0: (9, 1; 2) -1.50000000000000e+00 +0: (9, 1; 3) 0.00000000000000e+00 +0: (9, 1; 4) 0.00000000000000e+00 +0: (9, 1; 5) -2.50000000000000e-01 +0: (9, 1; 6) -2.50000000000000e-01 +0: (9, 1; 7) -2.50000000000000e-01 +0: (9, 1; 8) -2.50000000000000e-01 +0: (5, 2; 0) 4.00000000000000e+00 +0: (5, 2; 1) -1.50000000000000e+00 +0: (5, 2; 2) -1.50000000000000e+00 +0: (5, 2; 3) 0.00000000000000e+00 +0: (5, 2; 4) 0.00000000000000e+00 +0: (5, 2; 5) -2.50000000000000e-01 +0: (5, 2; 6) -2.50000000000000e-01 +0: (5, 2; 7) -2.50000000000000e-01 +0: (5, 2; 8) -2.50000000000000e-01 +0: (6, 2; 0) 4.00000000000000e+00 +0: (6, 2; 1) -1.50000000000000e+00 +0: (6, 2; 2) -1.50000000000000e+00 +0: (6, 2; 3) 0.00000000000000e+00 +0: (6, 2; 4) 0.00000000000000e+00 +0: (6, 2; 5) -2.50000000000000e-01 +0: (6, 2; 6) -2.50000000000000e-01 +0: (6, 2; 7) -2.50000000000000e-01 +0: (6, 2; 8) -2.50000000000000e-01 +0: (7, 2; 0) 4.00000000000000e+00 +0: (7, 2; 1) -1.50000000000000e+00 +0: (7, 2; 2) -1.50000000000000e+00 +0: (7, 2; 3) 0.00000000000000e+00 +0: (7, 2; 4) 0.00000000000000e+00 +0: (7, 2; 5) -2.50000000000000e-01 +0: (7, 2; 6) -2.50000000000000e-01 +0: (7, 2; 7) -2.50000000000000e-01 +0: (7, 2; 8) -2.50000000000000e-01 +0: (8, 2; 0) 4.00000000000000e+00 +0: (8, 2; 1) -1.50000000000000e+00 +0: (8, 2; 2) -1.50000000000000e+00 +0: (8, 2; 3) 0.00000000000000e+00 +0: (8, 2; 4) 0.00000000000000e+00 +0: (8, 2; 5) -2.50000000000000e-01 +0: (8, 2; 6) -2.50000000000000e-01 +0: (8, 2; 7) -2.50000000000000e-01 +0: (8, 2; 8) -2.50000000000000e-01 +0: (9, 2; 0) 4.00000000000000e+00 +0: (9, 2; 1) -1.50000000000000e+00 +0: (9, 2; 2) -1.50000000000000e+00 +0: (9, 2; 3) 0.00000000000000e+00 +0: (9, 2; 4) 0.00000000000000e+00 +0: (9, 2; 5) -2.50000000000000e-01 +0: (9, 2; 6) -2.50000000000000e-01 +0: (9, 2; 7) -2.50000000000000e-01 +0: (9, 2; 8) -2.50000000000000e-01 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.y.4.matmat.00002 b/src/test/TEST_structmat/structmat.saved.2D1.y.4.matmat.00002 new file mode 100644 index 0000000000..29d492e6c8 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.y.4.matmat.00002 @@ -0,0 +1,123 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (0, 3) x (4, 4) + +Periodic: (10, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (1, -1) +7: (-1, 1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +9 +0: (0, 3; 0) 4.00000000000000e+00 +0: (0, 3; 1) -1.50000000000000e+00 +0: (0, 3; 2) -1.50000000000000e+00 +0: (0, 3; 3) 0.00000000000000e+00 +0: (0, 3; 4) 0.00000000000000e+00 +0: (0, 3; 5) -2.50000000000000e-01 +0: (0, 3; 6) -2.50000000000000e-01 +0: (0, 3; 7) -2.50000000000000e-01 +0: (0, 3; 8) -2.50000000000000e-01 +0: (1, 3; 0) 4.00000000000000e+00 +0: (1, 3; 1) -1.50000000000000e+00 +0: (1, 3; 2) -1.50000000000000e+00 +0: (1, 3; 3) 0.00000000000000e+00 +0: (1, 3; 4) 0.00000000000000e+00 +0: (1, 3; 5) -2.50000000000000e-01 +0: (1, 3; 6) -2.50000000000000e-01 +0: (1, 3; 7) -2.50000000000000e-01 +0: (1, 3; 8) -2.50000000000000e-01 +0: (2, 3; 0) 4.00000000000000e+00 +0: (2, 3; 1) -1.50000000000000e+00 +0: (2, 3; 2) -1.50000000000000e+00 +0: (2, 3; 3) 0.00000000000000e+00 +0: (2, 3; 4) 0.00000000000000e+00 +0: (2, 3; 5) -2.50000000000000e-01 +0: (2, 3; 6) -2.50000000000000e-01 +0: (2, 3; 7) -2.50000000000000e-01 +0: (2, 3; 8) -2.50000000000000e-01 +0: (3, 3; 0) 4.00000000000000e+00 +0: (3, 3; 1) -1.50000000000000e+00 +0: (3, 3; 2) -1.50000000000000e+00 +0: (3, 3; 3) 0.00000000000000e+00 +0: (3, 3; 4) 0.00000000000000e+00 +0: (3, 3; 5) -2.50000000000000e-01 +0: (3, 3; 6) -2.50000000000000e-01 +0: (3, 3; 7) -2.50000000000000e-01 +0: (3, 3; 8) -2.50000000000000e-01 +0: (4, 3; 0) 4.00000000000000e+00 +0: (4, 3; 1) -1.50000000000000e+00 +0: (4, 3; 2) -1.50000000000000e+00 +0: (4, 3; 3) 0.00000000000000e+00 +0: (4, 3; 4) 0.00000000000000e+00 +0: (4, 3; 5) -2.50000000000000e-01 +0: (4, 3; 6) -2.50000000000000e-01 +0: (4, 3; 7) -2.50000000000000e-01 +0: (4, 3; 8) -2.50000000000000e-01 +0: (0, 4; 0) 4.00000000000000e+00 +0: (0, 4; 1) -1.50000000000000e+00 +0: (0, 4; 2) -1.50000000000000e+00 +0: (0, 4; 3) 0.00000000000000e+00 +0: (0, 4; 4) 0.00000000000000e+00 +0: (0, 4; 5) -2.50000000000000e-01 +0: (0, 4; 6) -2.50000000000000e-01 +0: (0, 4; 7) 0.00000000000000e+00 +0: (0, 4; 8) 0.00000000000000e+00 +0: (1, 4; 0) 4.00000000000000e+00 +0: (1, 4; 1) -1.50000000000000e+00 +0: (1, 4; 2) -1.50000000000000e+00 +0: (1, 4; 3) 0.00000000000000e+00 +0: (1, 4; 4) 0.00000000000000e+00 +0: (1, 4; 5) -2.50000000000000e-01 +0: (1, 4; 6) -2.50000000000000e-01 +0: (1, 4; 7) 0.00000000000000e+00 +0: (1, 4; 8) 0.00000000000000e+00 +0: (2, 4; 0) 4.00000000000000e+00 +0: (2, 4; 1) -1.50000000000000e+00 +0: (2, 4; 2) -1.50000000000000e+00 +0: (2, 4; 3) 0.00000000000000e+00 +0: (2, 4; 4) 0.00000000000000e+00 +0: (2, 4; 5) -2.50000000000000e-01 +0: (2, 4; 6) -2.50000000000000e-01 +0: (2, 4; 7) 0.00000000000000e+00 +0: (2, 4; 8) 0.00000000000000e+00 +0: (3, 4; 0) 4.00000000000000e+00 +0: (3, 4; 1) -1.50000000000000e+00 +0: (3, 4; 2) -1.50000000000000e+00 +0: (3, 4; 3) 0.00000000000000e+00 +0: (3, 4; 4) 0.00000000000000e+00 +0: (3, 4; 5) -2.50000000000000e-01 +0: (3, 4; 6) -2.50000000000000e-01 +0: (3, 4; 7) 0.00000000000000e+00 +0: (3, 4; 8) 0.00000000000000e+00 +0: (4, 4; 0) 4.00000000000000e+00 +0: (4, 4; 1) -1.50000000000000e+00 +0: (4, 4; 2) -1.50000000000000e+00 +0: (4, 4; 3) 0.00000000000000e+00 +0: (4, 4; 4) 0.00000000000000e+00 +0: (4, 4; 5) -2.50000000000000e-01 +0: (4, 4; 6) -2.50000000000000e-01 +0: (4, 4; 7) 0.00000000000000e+00 +0: (4, 4; 8) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.y.4.matmat.00003 b/src/test/TEST_structmat/structmat.saved.2D1.y.4.matmat.00003 new file mode 100644 index 0000000000..50da4520f0 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.y.4.matmat.00003 @@ -0,0 +1,123 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (5, 3) x (9, 4) + +Periodic: (10, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (1, -1) +7: (-1, 1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +9 +0: (5, 3; 0) 4.00000000000000e+00 +0: (5, 3; 1) -1.50000000000000e+00 +0: (5, 3; 2) -1.50000000000000e+00 +0: (5, 3; 3) 0.00000000000000e+00 +0: (5, 3; 4) 0.00000000000000e+00 +0: (5, 3; 5) -2.50000000000000e-01 +0: (5, 3; 6) -2.50000000000000e-01 +0: (5, 3; 7) -2.50000000000000e-01 +0: (5, 3; 8) -2.50000000000000e-01 +0: (6, 3; 0) 4.00000000000000e+00 +0: (6, 3; 1) -1.50000000000000e+00 +0: (6, 3; 2) -1.50000000000000e+00 +0: (6, 3; 3) 0.00000000000000e+00 +0: (6, 3; 4) 0.00000000000000e+00 +0: (6, 3; 5) -2.50000000000000e-01 +0: (6, 3; 6) -2.50000000000000e-01 +0: (6, 3; 7) -2.50000000000000e-01 +0: (6, 3; 8) -2.50000000000000e-01 +0: (7, 3; 0) 4.00000000000000e+00 +0: (7, 3; 1) -1.50000000000000e+00 +0: (7, 3; 2) -1.50000000000000e+00 +0: (7, 3; 3) 0.00000000000000e+00 +0: (7, 3; 4) 0.00000000000000e+00 +0: (7, 3; 5) -2.50000000000000e-01 +0: (7, 3; 6) -2.50000000000000e-01 +0: (7, 3; 7) -2.50000000000000e-01 +0: (7, 3; 8) -2.50000000000000e-01 +0: (8, 3; 0) 4.00000000000000e+00 +0: (8, 3; 1) -1.50000000000000e+00 +0: (8, 3; 2) -1.50000000000000e+00 +0: (8, 3; 3) 0.00000000000000e+00 +0: (8, 3; 4) 0.00000000000000e+00 +0: (8, 3; 5) -2.50000000000000e-01 +0: (8, 3; 6) -2.50000000000000e-01 +0: (8, 3; 7) -2.50000000000000e-01 +0: (8, 3; 8) -2.50000000000000e-01 +0: (9, 3; 0) 4.00000000000000e+00 +0: (9, 3; 1) -1.50000000000000e+00 +0: (9, 3; 2) -1.50000000000000e+00 +0: (9, 3; 3) 0.00000000000000e+00 +0: (9, 3; 4) 0.00000000000000e+00 +0: (9, 3; 5) -2.50000000000000e-01 +0: (9, 3; 6) -2.50000000000000e-01 +0: (9, 3; 7) -2.50000000000000e-01 +0: (9, 3; 8) -2.50000000000000e-01 +0: (5, 4; 0) 4.00000000000000e+00 +0: (5, 4; 1) -1.50000000000000e+00 +0: (5, 4; 2) -1.50000000000000e+00 +0: (5, 4; 3) 0.00000000000000e+00 +0: (5, 4; 4) 0.00000000000000e+00 +0: (5, 4; 5) -2.50000000000000e-01 +0: (5, 4; 6) -2.50000000000000e-01 +0: (5, 4; 7) 0.00000000000000e+00 +0: (5, 4; 8) 0.00000000000000e+00 +0: (6, 4; 0) 4.00000000000000e+00 +0: (6, 4; 1) -1.50000000000000e+00 +0: (6, 4; 2) -1.50000000000000e+00 +0: (6, 4; 3) 0.00000000000000e+00 +0: (6, 4; 4) 0.00000000000000e+00 +0: (6, 4; 5) -2.50000000000000e-01 +0: (6, 4; 6) -2.50000000000000e-01 +0: (6, 4; 7) 0.00000000000000e+00 +0: (6, 4; 8) 0.00000000000000e+00 +0: (7, 4; 0) 4.00000000000000e+00 +0: (7, 4; 1) -1.50000000000000e+00 +0: (7, 4; 2) -1.50000000000000e+00 +0: (7, 4; 3) 0.00000000000000e+00 +0: (7, 4; 4) 0.00000000000000e+00 +0: (7, 4; 5) -2.50000000000000e-01 +0: (7, 4; 6) -2.50000000000000e-01 +0: (7, 4; 7) 0.00000000000000e+00 +0: (7, 4; 8) 0.00000000000000e+00 +0: (8, 4; 0) 4.00000000000000e+00 +0: (8, 4; 1) -1.50000000000000e+00 +0: (8, 4; 2) -1.50000000000000e+00 +0: (8, 4; 3) 0.00000000000000e+00 +0: (8, 4; 4) 0.00000000000000e+00 +0: (8, 4; 5) -2.50000000000000e-01 +0: (8, 4; 6) -2.50000000000000e-01 +0: (8, 4; 7) 0.00000000000000e+00 +0: (8, 4; 8) 0.00000000000000e+00 +0: (9, 4; 0) 4.00000000000000e+00 +0: (9, 4; 1) -1.50000000000000e+00 +0: (9, 4; 2) -1.50000000000000e+00 +0: (9, 4; 3) 0.00000000000000e+00 +0: (9, 4; 4) 0.00000000000000e+00 +0: (9, 4; 5) -2.50000000000000e-01 +0: (9, 4; 6) -2.50000000000000e-01 +0: (9, 4; 7) 0.00000000000000e+00 +0: (9, 4; 8) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.y.matmat.00000 b/src/test/TEST_structmat/structmat.saved.2D1.y.matmat.00000 new file mode 100644 index 0000000000..d3fcc1e8e8 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.y.matmat.00000 @@ -0,0 +1,483 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (0, 0) x (9, 4) + +Periodic: (10, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (1, -1) +7: (-1, 1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +9 +0: (0, 0; 0) 4.00000000000000e+00 +0: (0, 0; 1) -1.25000000000000e+00 +0: (0, 0; 2) -1.25000000000000e+00 +0: (0, 0; 3) 0.00000000000000e+00 +0: (0, 0; 4) 0.00000000000000e+00 +0: (0, 0; 5) 0.00000000000000e+00 +0: (0, 0; 6) 0.00000000000000e+00 +0: (0, 0; 7) -2.50000000000000e-01 +0: (0, 0; 8) -2.50000000000000e-01 +0: (1, 0; 0) 4.00000000000000e+00 +0: (1, 0; 1) -1.25000000000000e+00 +0: (1, 0; 2) -1.25000000000000e+00 +0: (1, 0; 3) 0.00000000000000e+00 +0: (1, 0; 4) 0.00000000000000e+00 +0: (1, 0; 5) 0.00000000000000e+00 +0: (1, 0; 6) 0.00000000000000e+00 +0: (1, 0; 7) -2.50000000000000e-01 +0: (1, 0; 8) -2.50000000000000e-01 +0: (2, 0; 0) 4.00000000000000e+00 +0: (2, 0; 1) -1.25000000000000e+00 +0: (2, 0; 2) -1.25000000000000e+00 +0: (2, 0; 3) 0.00000000000000e+00 +0: (2, 0; 4) 0.00000000000000e+00 +0: (2, 0; 5) 0.00000000000000e+00 +0: (2, 0; 6) 0.00000000000000e+00 +0: (2, 0; 7) -2.50000000000000e-01 +0: (2, 0; 8) -2.50000000000000e-01 +0: (3, 0; 0) 4.00000000000000e+00 +0: (3, 0; 1) -1.25000000000000e+00 +0: (3, 0; 2) -1.25000000000000e+00 +0: (3, 0; 3) 0.00000000000000e+00 +0: (3, 0; 4) 0.00000000000000e+00 +0: (3, 0; 5) 0.00000000000000e+00 +0: (3, 0; 6) 0.00000000000000e+00 +0: (3, 0; 7) -2.50000000000000e-01 +0: (3, 0; 8) -2.50000000000000e-01 +0: (4, 0; 0) 4.00000000000000e+00 +0: (4, 0; 1) -1.25000000000000e+00 +0: (4, 0; 2) -1.25000000000000e+00 +0: (4, 0; 3) 0.00000000000000e+00 +0: (4, 0; 4) 0.00000000000000e+00 +0: (4, 0; 5) 0.00000000000000e+00 +0: (4, 0; 6) 0.00000000000000e+00 +0: (4, 0; 7) -2.50000000000000e-01 +0: (4, 0; 8) -2.50000000000000e-01 +0: (5, 0; 0) 4.00000000000000e+00 +0: (5, 0; 1) -1.25000000000000e+00 +0: (5, 0; 2) -1.25000000000000e+00 +0: (5, 0; 3) 0.00000000000000e+00 +0: (5, 0; 4) 0.00000000000000e+00 +0: (5, 0; 5) 0.00000000000000e+00 +0: (5, 0; 6) 0.00000000000000e+00 +0: (5, 0; 7) -2.50000000000000e-01 +0: (5, 0; 8) -2.50000000000000e-01 +0: (6, 0; 0) 4.00000000000000e+00 +0: (6, 0; 1) -1.25000000000000e+00 +0: (6, 0; 2) -1.25000000000000e+00 +0: (6, 0; 3) 0.00000000000000e+00 +0: (6, 0; 4) 0.00000000000000e+00 +0: (6, 0; 5) 0.00000000000000e+00 +0: (6, 0; 6) 0.00000000000000e+00 +0: (6, 0; 7) -2.50000000000000e-01 +0: (6, 0; 8) -2.50000000000000e-01 +0: (7, 0; 0) 4.00000000000000e+00 +0: (7, 0; 1) -1.25000000000000e+00 +0: (7, 0; 2) -1.25000000000000e+00 +0: (7, 0; 3) 0.00000000000000e+00 +0: (7, 0; 4) 0.00000000000000e+00 +0: (7, 0; 5) 0.00000000000000e+00 +0: (7, 0; 6) 0.00000000000000e+00 +0: (7, 0; 7) -2.50000000000000e-01 +0: (7, 0; 8) -2.50000000000000e-01 +0: (8, 0; 0) 4.00000000000000e+00 +0: (8, 0; 1) -1.25000000000000e+00 +0: (8, 0; 2) -1.25000000000000e+00 +0: (8, 0; 3) 0.00000000000000e+00 +0: (8, 0; 4) 0.00000000000000e+00 +0: (8, 0; 5) 0.00000000000000e+00 +0: (8, 0; 6) 0.00000000000000e+00 +0: (8, 0; 7) -2.50000000000000e-01 +0: (8, 0; 8) -2.50000000000000e-01 +0: (9, 0; 0) 4.00000000000000e+00 +0: (9, 0; 1) -1.25000000000000e+00 +0: (9, 0; 2) -1.25000000000000e+00 +0: (9, 0; 3) 0.00000000000000e+00 +0: (9, 0; 4) 0.00000000000000e+00 +0: (9, 0; 5) 0.00000000000000e+00 +0: (9, 0; 6) 0.00000000000000e+00 +0: (9, 0; 7) -2.50000000000000e-01 +0: (9, 0; 8) -2.50000000000000e-01 +0: (0, 1; 0) 4.00000000000000e+00 +0: (0, 1; 1) -1.50000000000000e+00 +0: (0, 1; 2) -1.50000000000000e+00 +0: (0, 1; 3) 0.00000000000000e+00 +0: (0, 1; 4) 0.00000000000000e+00 +0: (0, 1; 5) -2.50000000000000e-01 +0: (0, 1; 6) -2.50000000000000e-01 +0: (0, 1; 7) -2.50000000000000e-01 +0: (0, 1; 8) -2.50000000000000e-01 +0: (1, 1; 0) 4.00000000000000e+00 +0: (1, 1; 1) -1.50000000000000e+00 +0: (1, 1; 2) -1.50000000000000e+00 +0: (1, 1; 3) 0.00000000000000e+00 +0: (1, 1; 4) 0.00000000000000e+00 +0: (1, 1; 5) -2.50000000000000e-01 +0: (1, 1; 6) -2.50000000000000e-01 +0: (1, 1; 7) -2.50000000000000e-01 +0: (1, 1; 8) -2.50000000000000e-01 +0: (2, 1; 0) 4.00000000000000e+00 +0: (2, 1; 1) -1.50000000000000e+00 +0: (2, 1; 2) -1.50000000000000e+00 +0: (2, 1; 3) 0.00000000000000e+00 +0: (2, 1; 4) 0.00000000000000e+00 +0: (2, 1; 5) -2.50000000000000e-01 +0: (2, 1; 6) -2.50000000000000e-01 +0: (2, 1; 7) -2.50000000000000e-01 +0: (2, 1; 8) -2.50000000000000e-01 +0: (3, 1; 0) 4.00000000000000e+00 +0: (3, 1; 1) -1.50000000000000e+00 +0: (3, 1; 2) -1.50000000000000e+00 +0: (3, 1; 3) 0.00000000000000e+00 +0: (3, 1; 4) 0.00000000000000e+00 +0: (3, 1; 5) -2.50000000000000e-01 +0: (3, 1; 6) -2.50000000000000e-01 +0: (3, 1; 7) -2.50000000000000e-01 +0: (3, 1; 8) -2.50000000000000e-01 +0: (4, 1; 0) 4.00000000000000e+00 +0: (4, 1; 1) -1.50000000000000e+00 +0: (4, 1; 2) -1.50000000000000e+00 +0: (4, 1; 3) 0.00000000000000e+00 +0: (4, 1; 4) 0.00000000000000e+00 +0: (4, 1; 5) -2.50000000000000e-01 +0: (4, 1; 6) -2.50000000000000e-01 +0: (4, 1; 7) -2.50000000000000e-01 +0: (4, 1; 8) -2.50000000000000e-01 +0: (5, 1; 0) 4.00000000000000e+00 +0: (5, 1; 1) -1.50000000000000e+00 +0: (5, 1; 2) -1.50000000000000e+00 +0: (5, 1; 3) 0.00000000000000e+00 +0: (5, 1; 4) 0.00000000000000e+00 +0: (5, 1; 5) -2.50000000000000e-01 +0: (5, 1; 6) -2.50000000000000e-01 +0: (5, 1; 7) -2.50000000000000e-01 +0: (5, 1; 8) -2.50000000000000e-01 +0: (6, 1; 0) 4.00000000000000e+00 +0: (6, 1; 1) -1.50000000000000e+00 +0: (6, 1; 2) -1.50000000000000e+00 +0: (6, 1; 3) 0.00000000000000e+00 +0: (6, 1; 4) 0.00000000000000e+00 +0: (6, 1; 5) -2.50000000000000e-01 +0: (6, 1; 6) -2.50000000000000e-01 +0: (6, 1; 7) -2.50000000000000e-01 +0: (6, 1; 8) -2.50000000000000e-01 +0: (7, 1; 0) 4.00000000000000e+00 +0: (7, 1; 1) -1.50000000000000e+00 +0: (7, 1; 2) -1.50000000000000e+00 +0: (7, 1; 3) 0.00000000000000e+00 +0: (7, 1; 4) 0.00000000000000e+00 +0: (7, 1; 5) -2.50000000000000e-01 +0: (7, 1; 6) -2.50000000000000e-01 +0: (7, 1; 7) -2.50000000000000e-01 +0: (7, 1; 8) -2.50000000000000e-01 +0: (8, 1; 0) 4.00000000000000e+00 +0: (8, 1; 1) -1.50000000000000e+00 +0: (8, 1; 2) -1.50000000000000e+00 +0: (8, 1; 3) 0.00000000000000e+00 +0: (8, 1; 4) 0.00000000000000e+00 +0: (8, 1; 5) -2.50000000000000e-01 +0: (8, 1; 6) -2.50000000000000e-01 +0: (8, 1; 7) -2.50000000000000e-01 +0: (8, 1; 8) -2.50000000000000e-01 +0: (9, 1; 0) 4.00000000000000e+00 +0: (9, 1; 1) -1.50000000000000e+00 +0: (9, 1; 2) -1.50000000000000e+00 +0: (9, 1; 3) 0.00000000000000e+00 +0: (9, 1; 4) 0.00000000000000e+00 +0: (9, 1; 5) -2.50000000000000e-01 +0: (9, 1; 6) -2.50000000000000e-01 +0: (9, 1; 7) -2.50000000000000e-01 +0: (9, 1; 8) -2.50000000000000e-01 +0: (0, 2; 0) 4.00000000000000e+00 +0: (0, 2; 1) -1.50000000000000e+00 +0: (0, 2; 2) -1.50000000000000e+00 +0: (0, 2; 3) 0.00000000000000e+00 +0: (0, 2; 4) 0.00000000000000e+00 +0: (0, 2; 5) -2.50000000000000e-01 +0: (0, 2; 6) -2.50000000000000e-01 +0: (0, 2; 7) -2.50000000000000e-01 +0: (0, 2; 8) -2.50000000000000e-01 +0: (1, 2; 0) 4.00000000000000e+00 +0: (1, 2; 1) -1.50000000000000e+00 +0: (1, 2; 2) -1.50000000000000e+00 +0: (1, 2; 3) 0.00000000000000e+00 +0: (1, 2; 4) 0.00000000000000e+00 +0: (1, 2; 5) -2.50000000000000e-01 +0: (1, 2; 6) -2.50000000000000e-01 +0: (1, 2; 7) -2.50000000000000e-01 +0: (1, 2; 8) -2.50000000000000e-01 +0: (2, 2; 0) 4.00000000000000e+00 +0: (2, 2; 1) -1.50000000000000e+00 +0: (2, 2; 2) -1.50000000000000e+00 +0: (2, 2; 3) 0.00000000000000e+00 +0: (2, 2; 4) 0.00000000000000e+00 +0: (2, 2; 5) -2.50000000000000e-01 +0: (2, 2; 6) -2.50000000000000e-01 +0: (2, 2; 7) -2.50000000000000e-01 +0: (2, 2; 8) -2.50000000000000e-01 +0: (3, 2; 0) 4.00000000000000e+00 +0: (3, 2; 1) -1.50000000000000e+00 +0: (3, 2; 2) -1.50000000000000e+00 +0: (3, 2; 3) 0.00000000000000e+00 +0: (3, 2; 4) 0.00000000000000e+00 +0: (3, 2; 5) -2.50000000000000e-01 +0: (3, 2; 6) -2.50000000000000e-01 +0: (3, 2; 7) -2.50000000000000e-01 +0: (3, 2; 8) -2.50000000000000e-01 +0: (4, 2; 0) 4.00000000000000e+00 +0: (4, 2; 1) -1.50000000000000e+00 +0: (4, 2; 2) -1.50000000000000e+00 +0: (4, 2; 3) 0.00000000000000e+00 +0: (4, 2; 4) 0.00000000000000e+00 +0: (4, 2; 5) -2.50000000000000e-01 +0: (4, 2; 6) -2.50000000000000e-01 +0: (4, 2; 7) -2.50000000000000e-01 +0: (4, 2; 8) -2.50000000000000e-01 +0: (5, 2; 0) 4.00000000000000e+00 +0: (5, 2; 1) -1.50000000000000e+00 +0: (5, 2; 2) -1.50000000000000e+00 +0: (5, 2; 3) 0.00000000000000e+00 +0: (5, 2; 4) 0.00000000000000e+00 +0: (5, 2; 5) -2.50000000000000e-01 +0: (5, 2; 6) -2.50000000000000e-01 +0: (5, 2; 7) -2.50000000000000e-01 +0: (5, 2; 8) -2.50000000000000e-01 +0: (6, 2; 0) 4.00000000000000e+00 +0: (6, 2; 1) -1.50000000000000e+00 +0: (6, 2; 2) -1.50000000000000e+00 +0: (6, 2; 3) 0.00000000000000e+00 +0: (6, 2; 4) 0.00000000000000e+00 +0: (6, 2; 5) -2.50000000000000e-01 +0: (6, 2; 6) -2.50000000000000e-01 +0: (6, 2; 7) -2.50000000000000e-01 +0: (6, 2; 8) -2.50000000000000e-01 +0: (7, 2; 0) 4.00000000000000e+00 +0: (7, 2; 1) -1.50000000000000e+00 +0: (7, 2; 2) -1.50000000000000e+00 +0: (7, 2; 3) 0.00000000000000e+00 +0: (7, 2; 4) 0.00000000000000e+00 +0: (7, 2; 5) -2.50000000000000e-01 +0: (7, 2; 6) -2.50000000000000e-01 +0: (7, 2; 7) -2.50000000000000e-01 +0: (7, 2; 8) -2.50000000000000e-01 +0: (8, 2; 0) 4.00000000000000e+00 +0: (8, 2; 1) -1.50000000000000e+00 +0: (8, 2; 2) -1.50000000000000e+00 +0: (8, 2; 3) 0.00000000000000e+00 +0: (8, 2; 4) 0.00000000000000e+00 +0: (8, 2; 5) -2.50000000000000e-01 +0: (8, 2; 6) -2.50000000000000e-01 +0: (8, 2; 7) -2.50000000000000e-01 +0: (8, 2; 8) -2.50000000000000e-01 +0: (9, 2; 0) 4.00000000000000e+00 +0: (9, 2; 1) -1.50000000000000e+00 +0: (9, 2; 2) -1.50000000000000e+00 +0: (9, 2; 3) 0.00000000000000e+00 +0: (9, 2; 4) 0.00000000000000e+00 +0: (9, 2; 5) -2.50000000000000e-01 +0: (9, 2; 6) -2.50000000000000e-01 +0: (9, 2; 7) -2.50000000000000e-01 +0: (9, 2; 8) -2.50000000000000e-01 +0: (0, 3; 0) 4.00000000000000e+00 +0: (0, 3; 1) -1.50000000000000e+00 +0: (0, 3; 2) -1.50000000000000e+00 +0: (0, 3; 3) 0.00000000000000e+00 +0: (0, 3; 4) 0.00000000000000e+00 +0: (0, 3; 5) -2.50000000000000e-01 +0: (0, 3; 6) -2.50000000000000e-01 +0: (0, 3; 7) -2.50000000000000e-01 +0: (0, 3; 8) -2.50000000000000e-01 +0: (1, 3; 0) 4.00000000000000e+00 +0: (1, 3; 1) -1.50000000000000e+00 +0: (1, 3; 2) -1.50000000000000e+00 +0: (1, 3; 3) 0.00000000000000e+00 +0: (1, 3; 4) 0.00000000000000e+00 +0: (1, 3; 5) -2.50000000000000e-01 +0: (1, 3; 6) -2.50000000000000e-01 +0: (1, 3; 7) -2.50000000000000e-01 +0: (1, 3; 8) -2.50000000000000e-01 +0: (2, 3; 0) 4.00000000000000e+00 +0: (2, 3; 1) -1.50000000000000e+00 +0: (2, 3; 2) -1.50000000000000e+00 +0: (2, 3; 3) 0.00000000000000e+00 +0: (2, 3; 4) 0.00000000000000e+00 +0: (2, 3; 5) -2.50000000000000e-01 +0: (2, 3; 6) -2.50000000000000e-01 +0: (2, 3; 7) -2.50000000000000e-01 +0: (2, 3; 8) -2.50000000000000e-01 +0: (3, 3; 0) 4.00000000000000e+00 +0: (3, 3; 1) -1.50000000000000e+00 +0: (3, 3; 2) -1.50000000000000e+00 +0: (3, 3; 3) 0.00000000000000e+00 +0: (3, 3; 4) 0.00000000000000e+00 +0: (3, 3; 5) -2.50000000000000e-01 +0: (3, 3; 6) -2.50000000000000e-01 +0: (3, 3; 7) -2.50000000000000e-01 +0: (3, 3; 8) -2.50000000000000e-01 +0: (4, 3; 0) 4.00000000000000e+00 +0: (4, 3; 1) -1.50000000000000e+00 +0: (4, 3; 2) -1.50000000000000e+00 +0: (4, 3; 3) 0.00000000000000e+00 +0: (4, 3; 4) 0.00000000000000e+00 +0: (4, 3; 5) -2.50000000000000e-01 +0: (4, 3; 6) -2.50000000000000e-01 +0: (4, 3; 7) -2.50000000000000e-01 +0: (4, 3; 8) -2.50000000000000e-01 +0: (5, 3; 0) 4.00000000000000e+00 +0: (5, 3; 1) -1.50000000000000e+00 +0: (5, 3; 2) -1.50000000000000e+00 +0: (5, 3; 3) 0.00000000000000e+00 +0: (5, 3; 4) 0.00000000000000e+00 +0: (5, 3; 5) -2.50000000000000e-01 +0: (5, 3; 6) -2.50000000000000e-01 +0: (5, 3; 7) -2.50000000000000e-01 +0: (5, 3; 8) -2.50000000000000e-01 +0: (6, 3; 0) 4.00000000000000e+00 +0: (6, 3; 1) -1.50000000000000e+00 +0: (6, 3; 2) -1.50000000000000e+00 +0: (6, 3; 3) 0.00000000000000e+00 +0: (6, 3; 4) 0.00000000000000e+00 +0: (6, 3; 5) -2.50000000000000e-01 +0: (6, 3; 6) -2.50000000000000e-01 +0: (6, 3; 7) -2.50000000000000e-01 +0: (6, 3; 8) -2.50000000000000e-01 +0: (7, 3; 0) 4.00000000000000e+00 +0: (7, 3; 1) -1.50000000000000e+00 +0: (7, 3; 2) -1.50000000000000e+00 +0: (7, 3; 3) 0.00000000000000e+00 +0: (7, 3; 4) 0.00000000000000e+00 +0: (7, 3; 5) -2.50000000000000e-01 +0: (7, 3; 6) -2.50000000000000e-01 +0: (7, 3; 7) -2.50000000000000e-01 +0: (7, 3; 8) -2.50000000000000e-01 +0: (8, 3; 0) 4.00000000000000e+00 +0: (8, 3; 1) -1.50000000000000e+00 +0: (8, 3; 2) -1.50000000000000e+00 +0: (8, 3; 3) 0.00000000000000e+00 +0: (8, 3; 4) 0.00000000000000e+00 +0: (8, 3; 5) -2.50000000000000e-01 +0: (8, 3; 6) -2.50000000000000e-01 +0: (8, 3; 7) -2.50000000000000e-01 +0: (8, 3; 8) -2.50000000000000e-01 +0: (9, 3; 0) 4.00000000000000e+00 +0: (9, 3; 1) -1.50000000000000e+00 +0: (9, 3; 2) -1.50000000000000e+00 +0: (9, 3; 3) 0.00000000000000e+00 +0: (9, 3; 4) 0.00000000000000e+00 +0: (9, 3; 5) -2.50000000000000e-01 +0: (9, 3; 6) -2.50000000000000e-01 +0: (9, 3; 7) -2.50000000000000e-01 +0: (9, 3; 8) -2.50000000000000e-01 +0: (0, 4; 0) 4.00000000000000e+00 +0: (0, 4; 1) -1.50000000000000e+00 +0: (0, 4; 2) -1.50000000000000e+00 +0: (0, 4; 3) 0.00000000000000e+00 +0: (0, 4; 4) 0.00000000000000e+00 +0: (0, 4; 5) -2.50000000000000e-01 +0: (0, 4; 6) -2.50000000000000e-01 +0: (0, 4; 7) 0.00000000000000e+00 +0: (0, 4; 8) 0.00000000000000e+00 +0: (1, 4; 0) 4.00000000000000e+00 +0: (1, 4; 1) -1.50000000000000e+00 +0: (1, 4; 2) -1.50000000000000e+00 +0: (1, 4; 3) 0.00000000000000e+00 +0: (1, 4; 4) 0.00000000000000e+00 +0: (1, 4; 5) -2.50000000000000e-01 +0: (1, 4; 6) -2.50000000000000e-01 +0: (1, 4; 7) 0.00000000000000e+00 +0: (1, 4; 8) 0.00000000000000e+00 +0: (2, 4; 0) 4.00000000000000e+00 +0: (2, 4; 1) -1.50000000000000e+00 +0: (2, 4; 2) -1.50000000000000e+00 +0: (2, 4; 3) 0.00000000000000e+00 +0: (2, 4; 4) 0.00000000000000e+00 +0: (2, 4; 5) -2.50000000000000e-01 +0: (2, 4; 6) -2.50000000000000e-01 +0: (2, 4; 7) 0.00000000000000e+00 +0: (2, 4; 8) 0.00000000000000e+00 +0: (3, 4; 0) 4.00000000000000e+00 +0: (3, 4; 1) -1.50000000000000e+00 +0: (3, 4; 2) -1.50000000000000e+00 +0: (3, 4; 3) 0.00000000000000e+00 +0: (3, 4; 4) 0.00000000000000e+00 +0: (3, 4; 5) -2.50000000000000e-01 +0: (3, 4; 6) -2.50000000000000e-01 +0: (3, 4; 7) 0.00000000000000e+00 +0: (3, 4; 8) 0.00000000000000e+00 +0: (4, 4; 0) 4.00000000000000e+00 +0: (4, 4; 1) -1.50000000000000e+00 +0: (4, 4; 2) -1.50000000000000e+00 +0: (4, 4; 3) 0.00000000000000e+00 +0: (4, 4; 4) 0.00000000000000e+00 +0: (4, 4; 5) -2.50000000000000e-01 +0: (4, 4; 6) -2.50000000000000e-01 +0: (4, 4; 7) 0.00000000000000e+00 +0: (4, 4; 8) 0.00000000000000e+00 +0: (5, 4; 0) 4.00000000000000e+00 +0: (5, 4; 1) -1.50000000000000e+00 +0: (5, 4; 2) -1.50000000000000e+00 +0: (5, 4; 3) 0.00000000000000e+00 +0: (5, 4; 4) 0.00000000000000e+00 +0: (5, 4; 5) -2.50000000000000e-01 +0: (5, 4; 6) -2.50000000000000e-01 +0: (5, 4; 7) 0.00000000000000e+00 +0: (5, 4; 8) 0.00000000000000e+00 +0: (6, 4; 0) 4.00000000000000e+00 +0: (6, 4; 1) -1.50000000000000e+00 +0: (6, 4; 2) -1.50000000000000e+00 +0: (6, 4; 3) 0.00000000000000e+00 +0: (6, 4; 4) 0.00000000000000e+00 +0: (6, 4; 5) -2.50000000000000e-01 +0: (6, 4; 6) -2.50000000000000e-01 +0: (6, 4; 7) 0.00000000000000e+00 +0: (6, 4; 8) 0.00000000000000e+00 +0: (7, 4; 0) 4.00000000000000e+00 +0: (7, 4; 1) -1.50000000000000e+00 +0: (7, 4; 2) -1.50000000000000e+00 +0: (7, 4; 3) 0.00000000000000e+00 +0: (7, 4; 4) 0.00000000000000e+00 +0: (7, 4; 5) -2.50000000000000e-01 +0: (7, 4; 6) -2.50000000000000e-01 +0: (7, 4; 7) 0.00000000000000e+00 +0: (7, 4; 8) 0.00000000000000e+00 +0: (8, 4; 0) 4.00000000000000e+00 +0: (8, 4; 1) -1.50000000000000e+00 +0: (8, 4; 2) -1.50000000000000e+00 +0: (8, 4; 3) 0.00000000000000e+00 +0: (8, 4; 4) 0.00000000000000e+00 +0: (8, 4; 5) -2.50000000000000e-01 +0: (8, 4; 6) -2.50000000000000e-01 +0: (8, 4; 7) 0.00000000000000e+00 +0: (8, 4; 8) 0.00000000000000e+00 +0: (9, 4; 0) 4.00000000000000e+00 +0: (9, 4; 1) -1.50000000000000e+00 +0: (9, 4; 2) -1.50000000000000e+00 +0: (9, 4; 3) 0.00000000000000e+00 +0: (9, 4; 4) 0.00000000000000e+00 +0: (9, 4; 5) -2.50000000000000e-01 +0: (9, 4; 6) -2.50000000000000e-01 +0: (9, 4; 7) 0.00000000000000e+00 +0: (9, 4; 8) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.yidle.5.matmat.00000 b/src/test/TEST_structmat/structmat.saved.2D1.yidle.5.matmat.00000 new file mode 100644 index 0000000000..4e8902f207 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.yidle.5.matmat.00000 @@ -0,0 +1,69 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (0, 0) x (3, 0) + +Periodic: (4, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (1, -1) +7: (-1, 1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +9 +0: (0, 0; 0) 4.00000000000000e+00 +0: (0, 0; 1) -1.25000000000000e+00 +0: (0, 0; 2) -1.25000000000000e+00 +0: (0, 0; 3) 0.00000000000000e+00 +0: (0, 0; 4) 0.00000000000000e+00 +0: (0, 0; 5) 0.00000000000000e+00 +0: (0, 0; 6) 0.00000000000000e+00 +0: (0, 0; 7) -2.50000000000000e-01 +0: (0, 0; 8) -2.50000000000000e-01 +0: (1, 0; 0) 4.00000000000000e+00 +0: (1, 0; 1) -1.25000000000000e+00 +0: (1, 0; 2) -1.25000000000000e+00 +0: (1, 0; 3) 0.00000000000000e+00 +0: (1, 0; 4) 0.00000000000000e+00 +0: (1, 0; 5) 0.00000000000000e+00 +0: (1, 0; 6) 0.00000000000000e+00 +0: (1, 0; 7) -2.50000000000000e-01 +0: (1, 0; 8) -2.50000000000000e-01 +0: (2, 0; 0) 4.00000000000000e+00 +0: (2, 0; 1) -1.25000000000000e+00 +0: (2, 0; 2) -1.25000000000000e+00 +0: (2, 0; 3) 0.00000000000000e+00 +0: (2, 0; 4) 0.00000000000000e+00 +0: (2, 0; 5) 0.00000000000000e+00 +0: (2, 0; 6) 0.00000000000000e+00 +0: (2, 0; 7) -2.50000000000000e-01 +0: (2, 0; 8) -2.50000000000000e-01 +0: (3, 0; 0) 4.00000000000000e+00 +0: (3, 0; 1) -1.25000000000000e+00 +0: (3, 0; 2) -1.25000000000000e+00 +0: (3, 0; 3) 0.00000000000000e+00 +0: (3, 0; 4) 0.00000000000000e+00 +0: (3, 0; 5) 0.00000000000000e+00 +0: (3, 0; 6) 0.00000000000000e+00 +0: (3, 0; 7) -2.50000000000000e-01 +0: (3, 0; 8) -2.50000000000000e-01 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.yidle.5.matmat.00001 b/src/test/TEST_structmat/structmat.saved.2D1.yidle.5.matmat.00001 new file mode 100644 index 0000000000..cd6a5a8eab --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.yidle.5.matmat.00001 @@ -0,0 +1,32 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 0 + +Grid: +2 +0 + +Periodic: (4, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (1, -1) +7: (-1, 1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +9 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.yidle.5.matmat.00002 b/src/test/TEST_structmat/structmat.saved.2D1.yidle.5.matmat.00002 new file mode 100644 index 0000000000..db53318567 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.yidle.5.matmat.00002 @@ -0,0 +1,69 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (0, 1) x (3, 1) + +Periodic: (4, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (1, -1) +7: (-1, 1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +9 +0: (0, 1; 0) 4.00000000000000e+00 +0: (0, 1; 1) -1.50000000000000e+00 +0: (0, 1; 2) -1.50000000000000e+00 +0: (0, 1; 3) 0.00000000000000e+00 +0: (0, 1; 4) 0.00000000000000e+00 +0: (0, 1; 5) -2.50000000000000e-01 +0: (0, 1; 6) -2.50000000000000e-01 +0: (0, 1; 7) -2.50000000000000e-01 +0: (0, 1; 8) -2.50000000000000e-01 +0: (1, 1; 0) 4.00000000000000e+00 +0: (1, 1; 1) -1.50000000000000e+00 +0: (1, 1; 2) -1.50000000000000e+00 +0: (1, 1; 3) 0.00000000000000e+00 +0: (1, 1; 4) 0.00000000000000e+00 +0: (1, 1; 5) -2.50000000000000e-01 +0: (1, 1; 6) -2.50000000000000e-01 +0: (1, 1; 7) -2.50000000000000e-01 +0: (1, 1; 8) -2.50000000000000e-01 +0: (2, 1; 0) 4.00000000000000e+00 +0: (2, 1; 1) -1.50000000000000e+00 +0: (2, 1; 2) -1.50000000000000e+00 +0: (2, 1; 3) 0.00000000000000e+00 +0: (2, 1; 4) 0.00000000000000e+00 +0: (2, 1; 5) -2.50000000000000e-01 +0: (2, 1; 6) -2.50000000000000e-01 +0: (2, 1; 7) -2.50000000000000e-01 +0: (2, 1; 8) -2.50000000000000e-01 +0: (3, 1; 0) 4.00000000000000e+00 +0: (3, 1; 1) -1.50000000000000e+00 +0: (3, 1; 2) -1.50000000000000e+00 +0: (3, 1; 3) 0.00000000000000e+00 +0: (3, 1; 4) 0.00000000000000e+00 +0: (3, 1; 5) -2.50000000000000e-01 +0: (3, 1; 6) -2.50000000000000e-01 +0: (3, 1; 7) -2.50000000000000e-01 +0: (3, 1; 8) -2.50000000000000e-01 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.yidle.5.matmat.00003 b/src/test/TEST_structmat/structmat.saved.2D1.yidle.5.matmat.00003 new file mode 100644 index 0000000000..cd6a5a8eab --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.yidle.5.matmat.00003 @@ -0,0 +1,32 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 0 + +Grid: +2 +0 + +Periodic: (4, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (1, -1) +7: (-1, 1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +9 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.yidle.5.matmat.00004 b/src/test/TEST_structmat/structmat.saved.2D1.yidle.5.matmat.00004 new file mode 100644 index 0000000000..0f849516d2 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.yidle.5.matmat.00004 @@ -0,0 +1,69 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (0, 2) x (3, 2) + +Periodic: (4, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (1, -1) +7: (-1, 1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +9 +0: (0, 2; 0) 4.00000000000000e+00 +0: (0, 2; 1) -1.25000000000000e+00 +0: (0, 2; 2) -1.25000000000000e+00 +0: (0, 2; 3) 0.00000000000000e+00 +0: (0, 2; 4) 0.00000000000000e+00 +0: (0, 2; 5) -2.50000000000000e-01 +0: (0, 2; 6) -2.50000000000000e-01 +0: (0, 2; 7) 0.00000000000000e+00 +0: (0, 2; 8) 0.00000000000000e+00 +0: (1, 2; 0) 4.00000000000000e+00 +0: (1, 2; 1) -1.25000000000000e+00 +0: (1, 2; 2) -1.25000000000000e+00 +0: (1, 2; 3) 0.00000000000000e+00 +0: (1, 2; 4) 0.00000000000000e+00 +0: (1, 2; 5) -2.50000000000000e-01 +0: (1, 2; 6) -2.50000000000000e-01 +0: (1, 2; 7) 0.00000000000000e+00 +0: (1, 2; 8) 0.00000000000000e+00 +0: (2, 2; 0) 4.00000000000000e+00 +0: (2, 2; 1) -1.25000000000000e+00 +0: (2, 2; 2) -1.25000000000000e+00 +0: (2, 2; 3) 0.00000000000000e+00 +0: (2, 2; 4) 0.00000000000000e+00 +0: (2, 2; 5) -2.50000000000000e-01 +0: (2, 2; 6) -2.50000000000000e-01 +0: (2, 2; 7) 0.00000000000000e+00 +0: (2, 2; 8) 0.00000000000000e+00 +0: (3, 2; 0) 4.00000000000000e+00 +0: (3, 2; 1) -1.25000000000000e+00 +0: (3, 2; 2) -1.25000000000000e+00 +0: (3, 2; 3) 0.00000000000000e+00 +0: (3, 2; 4) 0.00000000000000e+00 +0: (3, 2; 5) -2.50000000000000e-01 +0: (3, 2; 6) -2.50000000000000e-01 +0: (3, 2; 7) 0.00000000000000e+00 +0: (3, 2; 8) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D1.yidle.matmat.00000 b/src/test/TEST_structmat/structmat.saved.2D1.yidle.matmat.00000 new file mode 100644 index 0000000000..651714c27b --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D1.yidle.matmat.00000 @@ -0,0 +1,141 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (0, 0) x (3, 2) + +Periodic: (4, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (1, -1) +7: (-1, 1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +9 +0: (0, 0; 0) 4.00000000000000e+00 +0: (0, 0; 1) -1.25000000000000e+00 +0: (0, 0; 2) -1.25000000000000e+00 +0: (0, 0; 3) 0.00000000000000e+00 +0: (0, 0; 4) 0.00000000000000e+00 +0: (0, 0; 5) 0.00000000000000e+00 +0: (0, 0; 6) 0.00000000000000e+00 +0: (0, 0; 7) -2.50000000000000e-01 +0: (0, 0; 8) -2.50000000000000e-01 +0: (1, 0; 0) 4.00000000000000e+00 +0: (1, 0; 1) -1.25000000000000e+00 +0: (1, 0; 2) -1.25000000000000e+00 +0: (1, 0; 3) 0.00000000000000e+00 +0: (1, 0; 4) 0.00000000000000e+00 +0: (1, 0; 5) 0.00000000000000e+00 +0: (1, 0; 6) 0.00000000000000e+00 +0: (1, 0; 7) -2.50000000000000e-01 +0: (1, 0; 8) -2.50000000000000e-01 +0: (2, 0; 0) 4.00000000000000e+00 +0: (2, 0; 1) -1.25000000000000e+00 +0: (2, 0; 2) -1.25000000000000e+00 +0: (2, 0; 3) 0.00000000000000e+00 +0: (2, 0; 4) 0.00000000000000e+00 +0: (2, 0; 5) 0.00000000000000e+00 +0: (2, 0; 6) 0.00000000000000e+00 +0: (2, 0; 7) -2.50000000000000e-01 +0: (2, 0; 8) -2.50000000000000e-01 +0: (3, 0; 0) 4.00000000000000e+00 +0: (3, 0; 1) -1.25000000000000e+00 +0: (3, 0; 2) -1.25000000000000e+00 +0: (3, 0; 3) 0.00000000000000e+00 +0: (3, 0; 4) 0.00000000000000e+00 +0: (3, 0; 5) 0.00000000000000e+00 +0: (3, 0; 6) 0.00000000000000e+00 +0: (3, 0; 7) -2.50000000000000e-01 +0: (3, 0; 8) -2.50000000000000e-01 +0: (0, 1; 0) 4.00000000000000e+00 +0: (0, 1; 1) -1.50000000000000e+00 +0: (0, 1; 2) -1.50000000000000e+00 +0: (0, 1; 3) 0.00000000000000e+00 +0: (0, 1; 4) 0.00000000000000e+00 +0: (0, 1; 5) -2.50000000000000e-01 +0: (0, 1; 6) -2.50000000000000e-01 +0: (0, 1; 7) -2.50000000000000e-01 +0: (0, 1; 8) -2.50000000000000e-01 +0: (1, 1; 0) 4.00000000000000e+00 +0: (1, 1; 1) -1.50000000000000e+00 +0: (1, 1; 2) -1.50000000000000e+00 +0: (1, 1; 3) 0.00000000000000e+00 +0: (1, 1; 4) 0.00000000000000e+00 +0: (1, 1; 5) -2.50000000000000e-01 +0: (1, 1; 6) -2.50000000000000e-01 +0: (1, 1; 7) -2.50000000000000e-01 +0: (1, 1; 8) -2.50000000000000e-01 +0: (2, 1; 0) 4.00000000000000e+00 +0: (2, 1; 1) -1.50000000000000e+00 +0: (2, 1; 2) -1.50000000000000e+00 +0: (2, 1; 3) 0.00000000000000e+00 +0: (2, 1; 4) 0.00000000000000e+00 +0: (2, 1; 5) -2.50000000000000e-01 +0: (2, 1; 6) -2.50000000000000e-01 +0: (2, 1; 7) -2.50000000000000e-01 +0: (2, 1; 8) -2.50000000000000e-01 +0: (3, 1; 0) 4.00000000000000e+00 +0: (3, 1; 1) -1.50000000000000e+00 +0: (3, 1; 2) -1.50000000000000e+00 +0: (3, 1; 3) 0.00000000000000e+00 +0: (3, 1; 4) 0.00000000000000e+00 +0: (3, 1; 5) -2.50000000000000e-01 +0: (3, 1; 6) -2.50000000000000e-01 +0: (3, 1; 7) -2.50000000000000e-01 +0: (3, 1; 8) -2.50000000000000e-01 +0: (0, 2; 0) 4.00000000000000e+00 +0: (0, 2; 1) -1.25000000000000e+00 +0: (0, 2; 2) -1.25000000000000e+00 +0: (0, 2; 3) 0.00000000000000e+00 +0: (0, 2; 4) 0.00000000000000e+00 +0: (0, 2; 5) -2.50000000000000e-01 +0: (0, 2; 6) -2.50000000000000e-01 +0: (0, 2; 7) 0.00000000000000e+00 +0: (0, 2; 8) 0.00000000000000e+00 +0: (1, 2; 0) 4.00000000000000e+00 +0: (1, 2; 1) -1.25000000000000e+00 +0: (1, 2; 2) -1.25000000000000e+00 +0: (1, 2; 3) 0.00000000000000e+00 +0: (1, 2; 4) 0.00000000000000e+00 +0: (1, 2; 5) -2.50000000000000e-01 +0: (1, 2; 6) -2.50000000000000e-01 +0: (1, 2; 7) 0.00000000000000e+00 +0: (1, 2; 8) 0.00000000000000e+00 +0: (2, 2; 0) 4.00000000000000e+00 +0: (2, 2; 1) -1.25000000000000e+00 +0: (2, 2; 2) -1.25000000000000e+00 +0: (2, 2; 3) 0.00000000000000e+00 +0: (2, 2; 4) 0.00000000000000e+00 +0: (2, 2; 5) -2.50000000000000e-01 +0: (2, 2; 6) -2.50000000000000e-01 +0: (2, 2; 7) 0.00000000000000e+00 +0: (2, 2; 8) 0.00000000000000e+00 +0: (3, 2; 0) 4.00000000000000e+00 +0: (3, 2; 1) -1.25000000000000e+00 +0: (3, 2; 2) -1.25000000000000e+00 +0: (3, 2; 3) 0.00000000000000e+00 +0: (3, 2; 4) 0.00000000000000e+00 +0: (3, 2; 5) -2.50000000000000e-01 +0: (3, 2; 6) -2.50000000000000e-01 +0: (3, 2; 7) 0.00000000000000e+00 +0: (3, 2; 8) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D2.sym.x.4.matmat.00000 b/src/test/TEST_structmat/structmat.saved.2D2.sym.x.4.matmat.00000 new file mode 100644 index 0000000000..8b1b1fa36a --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D2.sym.x.4.matmat.00000 @@ -0,0 +1,108 @@ +StructMatrix + +Symmetric: 1 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (0, 0) x (2, 4) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +5 +0: (0, 0; 0) 4.00000000000000e+00 +0: (0, 0; 1) 0.00000000000000e+00 +0: (0, 0; 3) 0.00000000000000e+00 +0: (0, 0; 5) 0.00000000000000e+00 +0: (0, 0; 6) -2.50000000000000e-01 +0: (1, 0; 0) 4.00000000000000e+00 +0: (1, 0; 1) 0.00000000000000e+00 +0: (1, 0; 3) 0.00000000000000e+00 +0: (1, 0; 5) 0.00000000000000e+00 +0: (1, 0; 6) -2.50000000000000e-01 +0: (2, 0; 0) 4.00000000000000e+00 +0: (2, 0; 1) 0.00000000000000e+00 +0: (2, 0; 3) 0.00000000000000e+00 +0: (2, 0; 5) 0.00000000000000e+00 +0: (2, 0; 6) -2.50000000000000e-01 +0: (0, 1; 0) 4.00000000000000e+00 +0: (0, 1; 1) 0.00000000000000e+00 +0: (0, 1; 3) -1.50000000000000e+00 +0: (0, 1; 5) -2.50000000000000e-01 +0: (0, 1; 6) -2.50000000000000e-01 +0: (1, 1; 0) 4.00000000000000e+00 +0: (1, 1; 1) 0.00000000000000e+00 +0: (1, 1; 3) -1.50000000000000e+00 +0: (1, 1; 5) -2.50000000000000e-01 +0: (1, 1; 6) -2.50000000000000e-01 +0: (2, 1; 0) 4.00000000000000e+00 +0: (2, 1; 1) 0.00000000000000e+00 +0: (2, 1; 3) -1.50000000000000e+00 +0: (2, 1; 5) -2.50000000000000e-01 +0: (2, 1; 6) -2.50000000000000e-01 +0: (0, 2; 0) 4.00000000000000e+00 +0: (0, 2; 1) 0.00000000000000e+00 +0: (0, 2; 3) -1.50000000000000e+00 +0: (0, 2; 5) -2.50000000000000e-01 +0: (0, 2; 6) -2.50000000000000e-01 +0: (1, 2; 0) 4.00000000000000e+00 +0: (1, 2; 1) 0.00000000000000e+00 +0: (1, 2; 3) -1.50000000000000e+00 +0: (1, 2; 5) -2.50000000000000e-01 +0: (1, 2; 6) -2.50000000000000e-01 +0: (2, 2; 0) 4.00000000000000e+00 +0: (2, 2; 1) 0.00000000000000e+00 +0: (2, 2; 3) -1.50000000000000e+00 +0: (2, 2; 5) -2.50000000000000e-01 +0: (2, 2; 6) -2.50000000000000e-01 +0: (0, 3; 0) 4.00000000000000e+00 +0: (0, 3; 1) 0.00000000000000e+00 +0: (0, 3; 3) -1.50000000000000e+00 +0: (0, 3; 5) -2.50000000000000e-01 +0: (0, 3; 6) -2.50000000000000e-01 +0: (1, 3; 0) 4.00000000000000e+00 +0: (1, 3; 1) 0.00000000000000e+00 +0: (1, 3; 3) -1.50000000000000e+00 +0: (1, 3; 5) -2.50000000000000e-01 +0: (1, 3; 6) -2.50000000000000e-01 +0: (2, 3; 0) 4.00000000000000e+00 +0: (2, 3; 1) 0.00000000000000e+00 +0: (2, 3; 3) -1.50000000000000e+00 +0: (2, 3; 5) -2.50000000000000e-01 +0: (2, 3; 6) -2.50000000000000e-01 +0: (0, 4; 0) 4.00000000000000e+00 +0: (0, 4; 1) 0.00000000000000e+00 +0: (0, 4; 3) -1.50000000000000e+00 +0: (0, 4; 5) -2.50000000000000e-01 +0: (0, 4; 6) -2.50000000000000e-01 +0: (1, 4; 0) 4.00000000000000e+00 +0: (1, 4; 1) 0.00000000000000e+00 +0: (1, 4; 3) -1.50000000000000e+00 +0: (1, 4; 5) -2.50000000000000e-01 +0: (1, 4; 6) -2.50000000000000e-01 +0: (2, 4; 0) 4.00000000000000e+00 +0: (2, 4; 1) 0.00000000000000e+00 +0: (2, 4; 3) -1.50000000000000e+00 +0: (2, 4; 5) -2.50000000000000e-01 +0: (2, 4; 6) -2.50000000000000e-01 diff --git a/src/test/TEST_structmat/structmat.saved.2D2.sym.x.4.matmat.00001 b/src/test/TEST_structmat/structmat.saved.2D2.sym.x.4.matmat.00001 new file mode 100644 index 0000000000..6abad0889b --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D2.sym.x.4.matmat.00001 @@ -0,0 +1,83 @@ +StructMatrix + +Symmetric: 1 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (3, 0) x (4, 4) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +5 +0: (3, 0; 0) 4.00000000000000e+00 +0: (3, 0; 1) 0.00000000000000e+00 +0: (3, 0; 3) 0.00000000000000e+00 +0: (3, 0; 5) 0.00000000000000e+00 +0: (3, 0; 6) -2.50000000000000e-01 +0: (4, 0; 0) 4.00000000000000e+00 +0: (4, 0; 1) 0.00000000000000e+00 +0: (4, 0; 3) 0.00000000000000e+00 +0: (4, 0; 5) 0.00000000000000e+00 +0: (4, 0; 6) -2.50000000000000e-01 +0: (3, 1; 0) 4.00000000000000e+00 +0: (3, 1; 1) 0.00000000000000e+00 +0: (3, 1; 3) -1.50000000000000e+00 +0: (3, 1; 5) -2.50000000000000e-01 +0: (3, 1; 6) -2.50000000000000e-01 +0: (4, 1; 0) 4.00000000000000e+00 +0: (4, 1; 1) 0.00000000000000e+00 +0: (4, 1; 3) -1.50000000000000e+00 +0: (4, 1; 5) -2.50000000000000e-01 +0: (4, 1; 6) -2.50000000000000e-01 +0: (3, 2; 0) 4.00000000000000e+00 +0: (3, 2; 1) 0.00000000000000e+00 +0: (3, 2; 3) -1.50000000000000e+00 +0: (3, 2; 5) -2.50000000000000e-01 +0: (3, 2; 6) -2.50000000000000e-01 +0: (4, 2; 0) 4.00000000000000e+00 +0: (4, 2; 1) 0.00000000000000e+00 +0: (4, 2; 3) -1.50000000000000e+00 +0: (4, 2; 5) -2.50000000000000e-01 +0: (4, 2; 6) -2.50000000000000e-01 +0: (3, 3; 0) 4.00000000000000e+00 +0: (3, 3; 1) 0.00000000000000e+00 +0: (3, 3; 3) -1.50000000000000e+00 +0: (3, 3; 5) -2.50000000000000e-01 +0: (3, 3; 6) -2.50000000000000e-01 +0: (4, 3; 0) 4.00000000000000e+00 +0: (4, 3; 1) 0.00000000000000e+00 +0: (4, 3; 3) -1.50000000000000e+00 +0: (4, 3; 5) -2.50000000000000e-01 +0: (4, 3; 6) -2.50000000000000e-01 +0: (3, 4; 0) 4.00000000000000e+00 +0: (3, 4; 1) 0.00000000000000e+00 +0: (3, 4; 3) -1.50000000000000e+00 +0: (3, 4; 5) -2.50000000000000e-01 +0: (3, 4; 6) -2.50000000000000e-01 +0: (4, 4; 0) 4.00000000000000e+00 +0: (4, 4; 1) 0.00000000000000e+00 +0: (4, 4; 3) -1.50000000000000e+00 +0: (4, 4; 5) -2.50000000000000e-01 +0: (4, 4; 6) -2.50000000000000e-01 diff --git a/src/test/TEST_structmat/structmat.saved.2D2.sym.x.4.matmat.00002 b/src/test/TEST_structmat/structmat.saved.2D2.sym.x.4.matmat.00002 new file mode 100644 index 0000000000..81f34185d9 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D2.sym.x.4.matmat.00002 @@ -0,0 +1,108 @@ +StructMatrix + +Symmetric: 1 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (0, 5) x (2, 9) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +5 +0: (0, 5; 0) 4.00000000000000e+00 +0: (0, 5; 1) 0.00000000000000e+00 +0: (0, 5; 3) -1.50000000000000e+00 +0: (0, 5; 5) -2.50000000000000e-01 +0: (0, 5; 6) -2.50000000000000e-01 +0: (1, 5; 0) 4.00000000000000e+00 +0: (1, 5; 1) 0.00000000000000e+00 +0: (1, 5; 3) -1.50000000000000e+00 +0: (1, 5; 5) -2.50000000000000e-01 +0: (1, 5; 6) -2.50000000000000e-01 +0: (2, 5; 0) 4.00000000000000e+00 +0: (2, 5; 1) 0.00000000000000e+00 +0: (2, 5; 3) -1.50000000000000e+00 +0: (2, 5; 5) -2.50000000000000e-01 +0: (2, 5; 6) -2.50000000000000e-01 +0: (0, 6; 0) 4.00000000000000e+00 +0: (0, 6; 1) 0.00000000000000e+00 +0: (0, 6; 3) -1.50000000000000e+00 +0: (0, 6; 5) -2.50000000000000e-01 +0: (0, 6; 6) -2.50000000000000e-01 +0: (1, 6; 0) 4.00000000000000e+00 +0: (1, 6; 1) 0.00000000000000e+00 +0: (1, 6; 3) -1.50000000000000e+00 +0: (1, 6; 5) -2.50000000000000e-01 +0: (1, 6; 6) -2.50000000000000e-01 +0: (2, 6; 0) 4.00000000000000e+00 +0: (2, 6; 1) 0.00000000000000e+00 +0: (2, 6; 3) -1.50000000000000e+00 +0: (2, 6; 5) -2.50000000000000e-01 +0: (2, 6; 6) -2.50000000000000e-01 +0: (0, 7; 0) 4.00000000000000e+00 +0: (0, 7; 1) 0.00000000000000e+00 +0: (0, 7; 3) -1.50000000000000e+00 +0: (0, 7; 5) -2.50000000000000e-01 +0: (0, 7; 6) -2.50000000000000e-01 +0: (1, 7; 0) 4.00000000000000e+00 +0: (1, 7; 1) 0.00000000000000e+00 +0: (1, 7; 3) -1.50000000000000e+00 +0: (1, 7; 5) -2.50000000000000e-01 +0: (1, 7; 6) -2.50000000000000e-01 +0: (2, 7; 0) 4.00000000000000e+00 +0: (2, 7; 1) 0.00000000000000e+00 +0: (2, 7; 3) -1.50000000000000e+00 +0: (2, 7; 5) -2.50000000000000e-01 +0: (2, 7; 6) -2.50000000000000e-01 +0: (0, 8; 0) 4.00000000000000e+00 +0: (0, 8; 1) 0.00000000000000e+00 +0: (0, 8; 3) -1.50000000000000e+00 +0: (0, 8; 5) -2.50000000000000e-01 +0: (0, 8; 6) -2.50000000000000e-01 +0: (1, 8; 0) 4.00000000000000e+00 +0: (1, 8; 1) 0.00000000000000e+00 +0: (1, 8; 3) -1.50000000000000e+00 +0: (1, 8; 5) -2.50000000000000e-01 +0: (1, 8; 6) -2.50000000000000e-01 +0: (2, 8; 0) 4.00000000000000e+00 +0: (2, 8; 1) 0.00000000000000e+00 +0: (2, 8; 3) -1.50000000000000e+00 +0: (2, 8; 5) -2.50000000000000e-01 +0: (2, 8; 6) -2.50000000000000e-01 +0: (0, 9; 0) 4.00000000000000e+00 +0: (0, 9; 1) 0.00000000000000e+00 +0: (0, 9; 3) -1.50000000000000e+00 +0: (0, 9; 5) -2.50000000000000e-01 +0: (0, 9; 6) 0.00000000000000e+00 +0: (1, 9; 0) 4.00000000000000e+00 +0: (1, 9; 1) 0.00000000000000e+00 +0: (1, 9; 3) -1.50000000000000e+00 +0: (1, 9; 5) -2.50000000000000e-01 +0: (1, 9; 6) 0.00000000000000e+00 +0: (2, 9; 0) 4.00000000000000e+00 +0: (2, 9; 1) 0.00000000000000e+00 +0: (2, 9; 3) -1.50000000000000e+00 +0: (2, 9; 5) -2.50000000000000e-01 +0: (2, 9; 6) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D2.sym.x.4.matmat.00003 b/src/test/TEST_structmat/structmat.saved.2D2.sym.x.4.matmat.00003 new file mode 100644 index 0000000000..0ac5cf2823 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D2.sym.x.4.matmat.00003 @@ -0,0 +1,83 @@ +StructMatrix + +Symmetric: 1 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (3, 5) x (4, 9) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +5 +0: (3, 5; 0) 4.00000000000000e+00 +0: (3, 5; 1) 0.00000000000000e+00 +0: (3, 5; 3) -1.50000000000000e+00 +0: (3, 5; 5) -2.50000000000000e-01 +0: (3, 5; 6) -2.50000000000000e-01 +0: (4, 5; 0) 4.00000000000000e+00 +0: (4, 5; 1) 0.00000000000000e+00 +0: (4, 5; 3) -1.50000000000000e+00 +0: (4, 5; 5) -2.50000000000000e-01 +0: (4, 5; 6) -2.50000000000000e-01 +0: (3, 6; 0) 4.00000000000000e+00 +0: (3, 6; 1) 0.00000000000000e+00 +0: (3, 6; 3) -1.50000000000000e+00 +0: (3, 6; 5) -2.50000000000000e-01 +0: (3, 6; 6) -2.50000000000000e-01 +0: (4, 6; 0) 4.00000000000000e+00 +0: (4, 6; 1) 0.00000000000000e+00 +0: (4, 6; 3) -1.50000000000000e+00 +0: (4, 6; 5) -2.50000000000000e-01 +0: (4, 6; 6) -2.50000000000000e-01 +0: (3, 7; 0) 4.00000000000000e+00 +0: (3, 7; 1) 0.00000000000000e+00 +0: (3, 7; 3) -1.50000000000000e+00 +0: (3, 7; 5) -2.50000000000000e-01 +0: (3, 7; 6) -2.50000000000000e-01 +0: (4, 7; 0) 4.00000000000000e+00 +0: (4, 7; 1) 0.00000000000000e+00 +0: (4, 7; 3) -1.50000000000000e+00 +0: (4, 7; 5) -2.50000000000000e-01 +0: (4, 7; 6) -2.50000000000000e-01 +0: (3, 8; 0) 4.00000000000000e+00 +0: (3, 8; 1) 0.00000000000000e+00 +0: (3, 8; 3) -1.50000000000000e+00 +0: (3, 8; 5) -2.50000000000000e-01 +0: (3, 8; 6) -2.50000000000000e-01 +0: (4, 8; 0) 4.00000000000000e+00 +0: (4, 8; 1) 0.00000000000000e+00 +0: (4, 8; 3) -1.50000000000000e+00 +0: (4, 8; 5) -2.50000000000000e-01 +0: (4, 8; 6) -2.50000000000000e-01 +0: (3, 9; 0) 4.00000000000000e+00 +0: (3, 9; 1) 0.00000000000000e+00 +0: (3, 9; 3) -1.50000000000000e+00 +0: (3, 9; 5) -2.50000000000000e-01 +0: (3, 9; 6) 0.00000000000000e+00 +0: (4, 9; 0) 4.00000000000000e+00 +0: (4, 9; 1) 0.00000000000000e+00 +0: (4, 9; 3) -1.50000000000000e+00 +0: (4, 9; 5) -2.50000000000000e-01 +0: (4, 9; 6) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D2.sym.x.matmat.00000 b/src/test/TEST_structmat/structmat.saved.2D2.sym.x.matmat.00000 new file mode 100644 index 0000000000..34b9ebffb3 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D2.sym.x.matmat.00000 @@ -0,0 +1,283 @@ +StructMatrix + +Symmetric: 1 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (0, 0) x (4, 9) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +5 +0: (0, 0; 0) 4.00000000000000e+00 +0: (0, 0; 1) 0.00000000000000e+00 +0: (0, 0; 3) 0.00000000000000e+00 +0: (0, 0; 5) 0.00000000000000e+00 +0: (0, 0; 6) -2.50000000000000e-01 +0: (1, 0; 0) 4.00000000000000e+00 +0: (1, 0; 1) 0.00000000000000e+00 +0: (1, 0; 3) 0.00000000000000e+00 +0: (1, 0; 5) 0.00000000000000e+00 +0: (1, 0; 6) -2.50000000000000e-01 +0: (2, 0; 0) 4.00000000000000e+00 +0: (2, 0; 1) 0.00000000000000e+00 +0: (2, 0; 3) 0.00000000000000e+00 +0: (2, 0; 5) 0.00000000000000e+00 +0: (2, 0; 6) -2.50000000000000e-01 +0: (3, 0; 0) 4.00000000000000e+00 +0: (3, 0; 1) 0.00000000000000e+00 +0: (3, 0; 3) 0.00000000000000e+00 +0: (3, 0; 5) 0.00000000000000e+00 +0: (3, 0; 6) -2.50000000000000e-01 +0: (4, 0; 0) 4.00000000000000e+00 +0: (4, 0; 1) 0.00000000000000e+00 +0: (4, 0; 3) 0.00000000000000e+00 +0: (4, 0; 5) 0.00000000000000e+00 +0: (4, 0; 6) -2.50000000000000e-01 +0: (0, 1; 0) 4.00000000000000e+00 +0: (0, 1; 1) 0.00000000000000e+00 +0: (0, 1; 3) -1.50000000000000e+00 +0: (0, 1; 5) -2.50000000000000e-01 +0: (0, 1; 6) -2.50000000000000e-01 +0: (1, 1; 0) 4.00000000000000e+00 +0: (1, 1; 1) 0.00000000000000e+00 +0: (1, 1; 3) -1.50000000000000e+00 +0: (1, 1; 5) -2.50000000000000e-01 +0: (1, 1; 6) -2.50000000000000e-01 +0: (2, 1; 0) 4.00000000000000e+00 +0: (2, 1; 1) 0.00000000000000e+00 +0: (2, 1; 3) -1.50000000000000e+00 +0: (2, 1; 5) -2.50000000000000e-01 +0: (2, 1; 6) -2.50000000000000e-01 +0: (3, 1; 0) 4.00000000000000e+00 +0: (3, 1; 1) 0.00000000000000e+00 +0: (3, 1; 3) -1.50000000000000e+00 +0: (3, 1; 5) -2.50000000000000e-01 +0: (3, 1; 6) -2.50000000000000e-01 +0: (4, 1; 0) 4.00000000000000e+00 +0: (4, 1; 1) 0.00000000000000e+00 +0: (4, 1; 3) -1.50000000000000e+00 +0: (4, 1; 5) -2.50000000000000e-01 +0: (4, 1; 6) -2.50000000000000e-01 +0: (0, 2; 0) 4.00000000000000e+00 +0: (0, 2; 1) 0.00000000000000e+00 +0: (0, 2; 3) -1.50000000000000e+00 +0: (0, 2; 5) -2.50000000000000e-01 +0: (0, 2; 6) -2.50000000000000e-01 +0: (1, 2; 0) 4.00000000000000e+00 +0: (1, 2; 1) 0.00000000000000e+00 +0: (1, 2; 3) -1.50000000000000e+00 +0: (1, 2; 5) -2.50000000000000e-01 +0: (1, 2; 6) -2.50000000000000e-01 +0: (2, 2; 0) 4.00000000000000e+00 +0: (2, 2; 1) 0.00000000000000e+00 +0: (2, 2; 3) -1.50000000000000e+00 +0: (2, 2; 5) -2.50000000000000e-01 +0: (2, 2; 6) -2.50000000000000e-01 +0: (3, 2; 0) 4.00000000000000e+00 +0: (3, 2; 1) 0.00000000000000e+00 +0: (3, 2; 3) -1.50000000000000e+00 +0: (3, 2; 5) -2.50000000000000e-01 +0: (3, 2; 6) -2.50000000000000e-01 +0: (4, 2; 0) 4.00000000000000e+00 +0: (4, 2; 1) 0.00000000000000e+00 +0: (4, 2; 3) -1.50000000000000e+00 +0: (4, 2; 5) -2.50000000000000e-01 +0: (4, 2; 6) -2.50000000000000e-01 +0: (0, 3; 0) 4.00000000000000e+00 +0: (0, 3; 1) 0.00000000000000e+00 +0: (0, 3; 3) -1.50000000000000e+00 +0: (0, 3; 5) -2.50000000000000e-01 +0: (0, 3; 6) -2.50000000000000e-01 +0: (1, 3; 0) 4.00000000000000e+00 +0: (1, 3; 1) 0.00000000000000e+00 +0: (1, 3; 3) -1.50000000000000e+00 +0: (1, 3; 5) -2.50000000000000e-01 +0: (1, 3; 6) -2.50000000000000e-01 +0: (2, 3; 0) 4.00000000000000e+00 +0: (2, 3; 1) 0.00000000000000e+00 +0: (2, 3; 3) -1.50000000000000e+00 +0: (2, 3; 5) -2.50000000000000e-01 +0: (2, 3; 6) -2.50000000000000e-01 +0: (3, 3; 0) 4.00000000000000e+00 +0: (3, 3; 1) 0.00000000000000e+00 +0: (3, 3; 3) -1.50000000000000e+00 +0: (3, 3; 5) -2.50000000000000e-01 +0: (3, 3; 6) -2.50000000000000e-01 +0: (4, 3; 0) 4.00000000000000e+00 +0: (4, 3; 1) 0.00000000000000e+00 +0: (4, 3; 3) -1.50000000000000e+00 +0: (4, 3; 5) -2.50000000000000e-01 +0: (4, 3; 6) -2.50000000000000e-01 +0: (0, 4; 0) 4.00000000000000e+00 +0: (0, 4; 1) 0.00000000000000e+00 +0: (0, 4; 3) -1.50000000000000e+00 +0: (0, 4; 5) -2.50000000000000e-01 +0: (0, 4; 6) -2.50000000000000e-01 +0: (1, 4; 0) 4.00000000000000e+00 +0: (1, 4; 1) 0.00000000000000e+00 +0: (1, 4; 3) -1.50000000000000e+00 +0: (1, 4; 5) -2.50000000000000e-01 +0: (1, 4; 6) -2.50000000000000e-01 +0: (2, 4; 0) 4.00000000000000e+00 +0: (2, 4; 1) 0.00000000000000e+00 +0: (2, 4; 3) -1.50000000000000e+00 +0: (2, 4; 5) -2.50000000000000e-01 +0: (2, 4; 6) -2.50000000000000e-01 +0: (3, 4; 0) 4.00000000000000e+00 +0: (3, 4; 1) 0.00000000000000e+00 +0: (3, 4; 3) -1.50000000000000e+00 +0: (3, 4; 5) -2.50000000000000e-01 +0: (3, 4; 6) -2.50000000000000e-01 +0: (4, 4; 0) 4.00000000000000e+00 +0: (4, 4; 1) 0.00000000000000e+00 +0: (4, 4; 3) -1.50000000000000e+00 +0: (4, 4; 5) -2.50000000000000e-01 +0: (4, 4; 6) -2.50000000000000e-01 +0: (0, 5; 0) 4.00000000000000e+00 +0: (0, 5; 1) 0.00000000000000e+00 +0: (0, 5; 3) -1.50000000000000e+00 +0: (0, 5; 5) -2.50000000000000e-01 +0: (0, 5; 6) -2.50000000000000e-01 +0: (1, 5; 0) 4.00000000000000e+00 +0: (1, 5; 1) 0.00000000000000e+00 +0: (1, 5; 3) -1.50000000000000e+00 +0: (1, 5; 5) -2.50000000000000e-01 +0: (1, 5; 6) -2.50000000000000e-01 +0: (2, 5; 0) 4.00000000000000e+00 +0: (2, 5; 1) 0.00000000000000e+00 +0: (2, 5; 3) -1.50000000000000e+00 +0: (2, 5; 5) -2.50000000000000e-01 +0: (2, 5; 6) -2.50000000000000e-01 +0: (3, 5; 0) 4.00000000000000e+00 +0: (3, 5; 1) 0.00000000000000e+00 +0: (3, 5; 3) -1.50000000000000e+00 +0: (3, 5; 5) -2.50000000000000e-01 +0: (3, 5; 6) -2.50000000000000e-01 +0: (4, 5; 0) 4.00000000000000e+00 +0: (4, 5; 1) 0.00000000000000e+00 +0: (4, 5; 3) -1.50000000000000e+00 +0: (4, 5; 5) -2.50000000000000e-01 +0: (4, 5; 6) -2.50000000000000e-01 +0: (0, 6; 0) 4.00000000000000e+00 +0: (0, 6; 1) 0.00000000000000e+00 +0: (0, 6; 3) -1.50000000000000e+00 +0: (0, 6; 5) -2.50000000000000e-01 +0: (0, 6; 6) -2.50000000000000e-01 +0: (1, 6; 0) 4.00000000000000e+00 +0: (1, 6; 1) 0.00000000000000e+00 +0: (1, 6; 3) -1.50000000000000e+00 +0: (1, 6; 5) -2.50000000000000e-01 +0: (1, 6; 6) -2.50000000000000e-01 +0: (2, 6; 0) 4.00000000000000e+00 +0: (2, 6; 1) 0.00000000000000e+00 +0: (2, 6; 3) -1.50000000000000e+00 +0: (2, 6; 5) -2.50000000000000e-01 +0: (2, 6; 6) -2.50000000000000e-01 +0: (3, 6; 0) 4.00000000000000e+00 +0: (3, 6; 1) 0.00000000000000e+00 +0: (3, 6; 3) -1.50000000000000e+00 +0: (3, 6; 5) -2.50000000000000e-01 +0: (3, 6; 6) -2.50000000000000e-01 +0: (4, 6; 0) 4.00000000000000e+00 +0: (4, 6; 1) 0.00000000000000e+00 +0: (4, 6; 3) -1.50000000000000e+00 +0: (4, 6; 5) -2.50000000000000e-01 +0: (4, 6; 6) -2.50000000000000e-01 +0: (0, 7; 0) 4.00000000000000e+00 +0: (0, 7; 1) 0.00000000000000e+00 +0: (0, 7; 3) -1.50000000000000e+00 +0: (0, 7; 5) -2.50000000000000e-01 +0: (0, 7; 6) -2.50000000000000e-01 +0: (1, 7; 0) 4.00000000000000e+00 +0: (1, 7; 1) 0.00000000000000e+00 +0: (1, 7; 3) -1.50000000000000e+00 +0: (1, 7; 5) -2.50000000000000e-01 +0: (1, 7; 6) -2.50000000000000e-01 +0: (2, 7; 0) 4.00000000000000e+00 +0: (2, 7; 1) 0.00000000000000e+00 +0: (2, 7; 3) -1.50000000000000e+00 +0: (2, 7; 5) -2.50000000000000e-01 +0: (2, 7; 6) -2.50000000000000e-01 +0: (3, 7; 0) 4.00000000000000e+00 +0: (3, 7; 1) 0.00000000000000e+00 +0: (3, 7; 3) -1.50000000000000e+00 +0: (3, 7; 5) -2.50000000000000e-01 +0: (3, 7; 6) -2.50000000000000e-01 +0: (4, 7; 0) 4.00000000000000e+00 +0: (4, 7; 1) 0.00000000000000e+00 +0: (4, 7; 3) -1.50000000000000e+00 +0: (4, 7; 5) -2.50000000000000e-01 +0: (4, 7; 6) -2.50000000000000e-01 +0: (0, 8; 0) 4.00000000000000e+00 +0: (0, 8; 1) 0.00000000000000e+00 +0: (0, 8; 3) -1.50000000000000e+00 +0: (0, 8; 5) -2.50000000000000e-01 +0: (0, 8; 6) -2.50000000000000e-01 +0: (1, 8; 0) 4.00000000000000e+00 +0: (1, 8; 1) 0.00000000000000e+00 +0: (1, 8; 3) -1.50000000000000e+00 +0: (1, 8; 5) -2.50000000000000e-01 +0: (1, 8; 6) -2.50000000000000e-01 +0: (2, 8; 0) 4.00000000000000e+00 +0: (2, 8; 1) 0.00000000000000e+00 +0: (2, 8; 3) -1.50000000000000e+00 +0: (2, 8; 5) -2.50000000000000e-01 +0: (2, 8; 6) -2.50000000000000e-01 +0: (3, 8; 0) 4.00000000000000e+00 +0: (3, 8; 1) 0.00000000000000e+00 +0: (3, 8; 3) -1.50000000000000e+00 +0: (3, 8; 5) -2.50000000000000e-01 +0: (3, 8; 6) -2.50000000000000e-01 +0: (4, 8; 0) 4.00000000000000e+00 +0: (4, 8; 1) 0.00000000000000e+00 +0: (4, 8; 3) -1.50000000000000e+00 +0: (4, 8; 5) -2.50000000000000e-01 +0: (4, 8; 6) -2.50000000000000e-01 +0: (0, 9; 0) 4.00000000000000e+00 +0: (0, 9; 1) 0.00000000000000e+00 +0: (0, 9; 3) -1.50000000000000e+00 +0: (0, 9; 5) -2.50000000000000e-01 +0: (0, 9; 6) 0.00000000000000e+00 +0: (1, 9; 0) 4.00000000000000e+00 +0: (1, 9; 1) 0.00000000000000e+00 +0: (1, 9; 3) -1.50000000000000e+00 +0: (1, 9; 5) -2.50000000000000e-01 +0: (1, 9; 6) 0.00000000000000e+00 +0: (2, 9; 0) 4.00000000000000e+00 +0: (2, 9; 1) 0.00000000000000e+00 +0: (2, 9; 3) -1.50000000000000e+00 +0: (2, 9; 5) -2.50000000000000e-01 +0: (2, 9; 6) 0.00000000000000e+00 +0: (3, 9; 0) 4.00000000000000e+00 +0: (3, 9; 1) 0.00000000000000e+00 +0: (3, 9; 3) -1.50000000000000e+00 +0: (3, 9; 5) -2.50000000000000e-01 +0: (3, 9; 6) 0.00000000000000e+00 +0: (4, 9; 0) 4.00000000000000e+00 +0: (4, 9; 1) 0.00000000000000e+00 +0: (4, 9; 3) -1.50000000000000e+00 +0: (4, 9; 5) -2.50000000000000e-01 +0: (4, 9; 6) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D2.x.4.matmat.00000 b/src/test/TEST_structmat/structmat.saved.2D2.x.4.matmat.00000 new file mode 100644 index 0000000000..8db6de7207 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D2.x.4.matmat.00000 @@ -0,0 +1,168 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (0, 0) x (2, 4) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +9 +0: (0, 0; 0) 4.00000000000000e+00 +0: (0, 0; 1) 0.00000000000000e+00 +0: (0, 0; 2) 0.00000000000000e+00 +0: (0, 0; 3) 0.00000000000000e+00 +0: (0, 0; 4) -1.50000000000000e+00 +0: (0, 0; 5) 0.00000000000000e+00 +0: (0, 0; 6) -2.50000000000000e-01 +0: (0, 0; 7) 0.00000000000000e+00 +0: (0, 0; 8) -2.50000000000000e-01 +0: (1, 0; 0) 4.00000000000000e+00 +0: (1, 0; 1) 0.00000000000000e+00 +0: (1, 0; 2) 0.00000000000000e+00 +0: (1, 0; 3) 0.00000000000000e+00 +0: (1, 0; 4) -1.50000000000000e+00 +0: (1, 0; 5) 0.00000000000000e+00 +0: (1, 0; 6) -2.50000000000000e-01 +0: (1, 0; 7) 0.00000000000000e+00 +0: (1, 0; 8) -2.50000000000000e-01 +0: (2, 0; 0) 4.00000000000000e+00 +0: (2, 0; 1) 0.00000000000000e+00 +0: (2, 0; 2) 0.00000000000000e+00 +0: (2, 0; 3) 0.00000000000000e+00 +0: (2, 0; 4) -1.50000000000000e+00 +0: (2, 0; 5) 0.00000000000000e+00 +0: (2, 0; 6) -2.50000000000000e-01 +0: (2, 0; 7) 0.00000000000000e+00 +0: (2, 0; 8) -2.50000000000000e-01 +0: (0, 1; 0) 4.00000000000000e+00 +0: (0, 1; 1) 0.00000000000000e+00 +0: (0, 1; 2) 0.00000000000000e+00 +0: (0, 1; 3) -1.50000000000000e+00 +0: (0, 1; 4) -1.50000000000000e+00 +0: (0, 1; 5) -2.50000000000000e-01 +0: (0, 1; 6) -2.50000000000000e-01 +0: (0, 1; 7) -2.50000000000000e-01 +0: (0, 1; 8) -2.50000000000000e-01 +0: (1, 1; 0) 4.00000000000000e+00 +0: (1, 1; 1) 0.00000000000000e+00 +0: (1, 1; 2) 0.00000000000000e+00 +0: (1, 1; 3) -1.50000000000000e+00 +0: (1, 1; 4) -1.50000000000000e+00 +0: (1, 1; 5) -2.50000000000000e-01 +0: (1, 1; 6) -2.50000000000000e-01 +0: (1, 1; 7) -2.50000000000000e-01 +0: (1, 1; 8) -2.50000000000000e-01 +0: (2, 1; 0) 4.00000000000000e+00 +0: (2, 1; 1) 0.00000000000000e+00 +0: (2, 1; 2) 0.00000000000000e+00 +0: (2, 1; 3) -1.50000000000000e+00 +0: (2, 1; 4) -1.50000000000000e+00 +0: (2, 1; 5) -2.50000000000000e-01 +0: (2, 1; 6) -2.50000000000000e-01 +0: (2, 1; 7) -2.50000000000000e-01 +0: (2, 1; 8) -2.50000000000000e-01 +0: (0, 2; 0) 4.00000000000000e+00 +0: (0, 2; 1) 0.00000000000000e+00 +0: (0, 2; 2) 0.00000000000000e+00 +0: (0, 2; 3) -1.50000000000000e+00 +0: (0, 2; 4) -1.50000000000000e+00 +0: (0, 2; 5) -2.50000000000000e-01 +0: (0, 2; 6) -2.50000000000000e-01 +0: (0, 2; 7) -2.50000000000000e-01 +0: (0, 2; 8) -2.50000000000000e-01 +0: (1, 2; 0) 4.00000000000000e+00 +0: (1, 2; 1) 0.00000000000000e+00 +0: (1, 2; 2) 0.00000000000000e+00 +0: (1, 2; 3) -1.50000000000000e+00 +0: (1, 2; 4) -1.50000000000000e+00 +0: (1, 2; 5) -2.50000000000000e-01 +0: (1, 2; 6) -2.50000000000000e-01 +0: (1, 2; 7) -2.50000000000000e-01 +0: (1, 2; 8) -2.50000000000000e-01 +0: (2, 2; 0) 4.00000000000000e+00 +0: (2, 2; 1) 0.00000000000000e+00 +0: (2, 2; 2) 0.00000000000000e+00 +0: (2, 2; 3) -1.50000000000000e+00 +0: (2, 2; 4) -1.50000000000000e+00 +0: (2, 2; 5) -2.50000000000000e-01 +0: (2, 2; 6) -2.50000000000000e-01 +0: (2, 2; 7) -2.50000000000000e-01 +0: (2, 2; 8) -2.50000000000000e-01 +0: (0, 3; 0) 4.00000000000000e+00 +0: (0, 3; 1) 0.00000000000000e+00 +0: (0, 3; 2) 0.00000000000000e+00 +0: (0, 3; 3) -1.50000000000000e+00 +0: (0, 3; 4) -1.50000000000000e+00 +0: (0, 3; 5) -2.50000000000000e-01 +0: (0, 3; 6) -2.50000000000000e-01 +0: (0, 3; 7) -2.50000000000000e-01 +0: (0, 3; 8) -2.50000000000000e-01 +0: (1, 3; 0) 4.00000000000000e+00 +0: (1, 3; 1) 0.00000000000000e+00 +0: (1, 3; 2) 0.00000000000000e+00 +0: (1, 3; 3) -1.50000000000000e+00 +0: (1, 3; 4) -1.50000000000000e+00 +0: (1, 3; 5) -2.50000000000000e-01 +0: (1, 3; 6) -2.50000000000000e-01 +0: (1, 3; 7) -2.50000000000000e-01 +0: (1, 3; 8) -2.50000000000000e-01 +0: (2, 3; 0) 4.00000000000000e+00 +0: (2, 3; 1) 0.00000000000000e+00 +0: (2, 3; 2) 0.00000000000000e+00 +0: (2, 3; 3) -1.50000000000000e+00 +0: (2, 3; 4) -1.50000000000000e+00 +0: (2, 3; 5) -2.50000000000000e-01 +0: (2, 3; 6) -2.50000000000000e-01 +0: (2, 3; 7) -2.50000000000000e-01 +0: (2, 3; 8) -2.50000000000000e-01 +0: (0, 4; 0) 4.00000000000000e+00 +0: (0, 4; 1) 0.00000000000000e+00 +0: (0, 4; 2) 0.00000000000000e+00 +0: (0, 4; 3) -1.50000000000000e+00 +0: (0, 4; 4) -1.50000000000000e+00 +0: (0, 4; 5) -2.50000000000000e-01 +0: (0, 4; 6) -2.50000000000000e-01 +0: (0, 4; 7) -2.50000000000000e-01 +0: (0, 4; 8) -2.50000000000000e-01 +0: (1, 4; 0) 4.00000000000000e+00 +0: (1, 4; 1) 0.00000000000000e+00 +0: (1, 4; 2) 0.00000000000000e+00 +0: (1, 4; 3) -1.50000000000000e+00 +0: (1, 4; 4) -1.50000000000000e+00 +0: (1, 4; 5) -2.50000000000000e-01 +0: (1, 4; 6) -2.50000000000000e-01 +0: (1, 4; 7) -2.50000000000000e-01 +0: (1, 4; 8) -2.50000000000000e-01 +0: (2, 4; 0) 4.00000000000000e+00 +0: (2, 4; 1) 0.00000000000000e+00 +0: (2, 4; 2) 0.00000000000000e+00 +0: (2, 4; 3) -1.50000000000000e+00 +0: (2, 4; 4) -1.50000000000000e+00 +0: (2, 4; 5) -2.50000000000000e-01 +0: (2, 4; 6) -2.50000000000000e-01 +0: (2, 4; 7) -2.50000000000000e-01 +0: (2, 4; 8) -2.50000000000000e-01 diff --git a/src/test/TEST_structmat/structmat.saved.2D2.x.4.matmat.00001 b/src/test/TEST_structmat/structmat.saved.2D2.x.4.matmat.00001 new file mode 100644 index 0000000000..2dcc80efb6 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D2.x.4.matmat.00001 @@ -0,0 +1,123 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (3, 0) x (4, 4) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +9 +0: (3, 0; 0) 4.00000000000000e+00 +0: (3, 0; 1) 0.00000000000000e+00 +0: (3, 0; 2) 0.00000000000000e+00 +0: (3, 0; 3) 0.00000000000000e+00 +0: (3, 0; 4) -1.50000000000000e+00 +0: (3, 0; 5) 0.00000000000000e+00 +0: (3, 0; 6) -2.50000000000000e-01 +0: (3, 0; 7) 0.00000000000000e+00 +0: (3, 0; 8) -2.50000000000000e-01 +0: (4, 0; 0) 4.00000000000000e+00 +0: (4, 0; 1) 0.00000000000000e+00 +0: (4, 0; 2) 0.00000000000000e+00 +0: (4, 0; 3) 0.00000000000000e+00 +0: (4, 0; 4) -1.50000000000000e+00 +0: (4, 0; 5) 0.00000000000000e+00 +0: (4, 0; 6) -2.50000000000000e-01 +0: (4, 0; 7) 0.00000000000000e+00 +0: (4, 0; 8) -2.50000000000000e-01 +0: (3, 1; 0) 4.00000000000000e+00 +0: (3, 1; 1) 0.00000000000000e+00 +0: (3, 1; 2) 0.00000000000000e+00 +0: (3, 1; 3) -1.50000000000000e+00 +0: (3, 1; 4) -1.50000000000000e+00 +0: (3, 1; 5) -2.50000000000000e-01 +0: (3, 1; 6) -2.50000000000000e-01 +0: (3, 1; 7) -2.50000000000000e-01 +0: (3, 1; 8) -2.50000000000000e-01 +0: (4, 1; 0) 4.00000000000000e+00 +0: (4, 1; 1) 0.00000000000000e+00 +0: (4, 1; 2) 0.00000000000000e+00 +0: (4, 1; 3) -1.50000000000000e+00 +0: (4, 1; 4) -1.50000000000000e+00 +0: (4, 1; 5) -2.50000000000000e-01 +0: (4, 1; 6) -2.50000000000000e-01 +0: (4, 1; 7) -2.50000000000000e-01 +0: (4, 1; 8) -2.50000000000000e-01 +0: (3, 2; 0) 4.00000000000000e+00 +0: (3, 2; 1) 0.00000000000000e+00 +0: (3, 2; 2) 0.00000000000000e+00 +0: (3, 2; 3) -1.50000000000000e+00 +0: (3, 2; 4) -1.50000000000000e+00 +0: (3, 2; 5) -2.50000000000000e-01 +0: (3, 2; 6) -2.50000000000000e-01 +0: (3, 2; 7) -2.50000000000000e-01 +0: (3, 2; 8) -2.50000000000000e-01 +0: (4, 2; 0) 4.00000000000000e+00 +0: (4, 2; 1) 0.00000000000000e+00 +0: (4, 2; 2) 0.00000000000000e+00 +0: (4, 2; 3) -1.50000000000000e+00 +0: (4, 2; 4) -1.50000000000000e+00 +0: (4, 2; 5) -2.50000000000000e-01 +0: (4, 2; 6) -2.50000000000000e-01 +0: (4, 2; 7) -2.50000000000000e-01 +0: (4, 2; 8) -2.50000000000000e-01 +0: (3, 3; 0) 4.00000000000000e+00 +0: (3, 3; 1) 0.00000000000000e+00 +0: (3, 3; 2) 0.00000000000000e+00 +0: (3, 3; 3) -1.50000000000000e+00 +0: (3, 3; 4) -1.50000000000000e+00 +0: (3, 3; 5) -2.50000000000000e-01 +0: (3, 3; 6) -2.50000000000000e-01 +0: (3, 3; 7) -2.50000000000000e-01 +0: (3, 3; 8) -2.50000000000000e-01 +0: (4, 3; 0) 4.00000000000000e+00 +0: (4, 3; 1) 0.00000000000000e+00 +0: (4, 3; 2) 0.00000000000000e+00 +0: (4, 3; 3) -1.50000000000000e+00 +0: (4, 3; 4) -1.50000000000000e+00 +0: (4, 3; 5) -2.50000000000000e-01 +0: (4, 3; 6) -2.50000000000000e-01 +0: (4, 3; 7) -2.50000000000000e-01 +0: (4, 3; 8) -2.50000000000000e-01 +0: (3, 4; 0) 4.00000000000000e+00 +0: (3, 4; 1) 0.00000000000000e+00 +0: (3, 4; 2) 0.00000000000000e+00 +0: (3, 4; 3) -1.50000000000000e+00 +0: (3, 4; 4) -1.50000000000000e+00 +0: (3, 4; 5) -2.50000000000000e-01 +0: (3, 4; 6) -2.50000000000000e-01 +0: (3, 4; 7) -2.50000000000000e-01 +0: (3, 4; 8) -2.50000000000000e-01 +0: (4, 4; 0) 4.00000000000000e+00 +0: (4, 4; 1) 0.00000000000000e+00 +0: (4, 4; 2) 0.00000000000000e+00 +0: (4, 4; 3) -1.50000000000000e+00 +0: (4, 4; 4) -1.50000000000000e+00 +0: (4, 4; 5) -2.50000000000000e-01 +0: (4, 4; 6) -2.50000000000000e-01 +0: (4, 4; 7) -2.50000000000000e-01 +0: (4, 4; 8) -2.50000000000000e-01 diff --git a/src/test/TEST_structmat/structmat.saved.2D2.x.4.matmat.00002 b/src/test/TEST_structmat/structmat.saved.2D2.x.4.matmat.00002 new file mode 100644 index 0000000000..74cce31d8e --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D2.x.4.matmat.00002 @@ -0,0 +1,168 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (0, 5) x (2, 9) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +9 +0: (0, 5; 0) 4.00000000000000e+00 +0: (0, 5; 1) 0.00000000000000e+00 +0: (0, 5; 2) 0.00000000000000e+00 +0: (0, 5; 3) -1.50000000000000e+00 +0: (0, 5; 4) -1.50000000000000e+00 +0: (0, 5; 5) -2.50000000000000e-01 +0: (0, 5; 6) -2.50000000000000e-01 +0: (0, 5; 7) -2.50000000000000e-01 +0: (0, 5; 8) -2.50000000000000e-01 +0: (1, 5; 0) 4.00000000000000e+00 +0: (1, 5; 1) 0.00000000000000e+00 +0: (1, 5; 2) 0.00000000000000e+00 +0: (1, 5; 3) -1.50000000000000e+00 +0: (1, 5; 4) -1.50000000000000e+00 +0: (1, 5; 5) -2.50000000000000e-01 +0: (1, 5; 6) -2.50000000000000e-01 +0: (1, 5; 7) -2.50000000000000e-01 +0: (1, 5; 8) -2.50000000000000e-01 +0: (2, 5; 0) 4.00000000000000e+00 +0: (2, 5; 1) 0.00000000000000e+00 +0: (2, 5; 2) 0.00000000000000e+00 +0: (2, 5; 3) -1.50000000000000e+00 +0: (2, 5; 4) -1.50000000000000e+00 +0: (2, 5; 5) -2.50000000000000e-01 +0: (2, 5; 6) -2.50000000000000e-01 +0: (2, 5; 7) -2.50000000000000e-01 +0: (2, 5; 8) -2.50000000000000e-01 +0: (0, 6; 0) 4.00000000000000e+00 +0: (0, 6; 1) 0.00000000000000e+00 +0: (0, 6; 2) 0.00000000000000e+00 +0: (0, 6; 3) -1.50000000000000e+00 +0: (0, 6; 4) -1.50000000000000e+00 +0: (0, 6; 5) -2.50000000000000e-01 +0: (0, 6; 6) -2.50000000000000e-01 +0: (0, 6; 7) -2.50000000000000e-01 +0: (0, 6; 8) -2.50000000000000e-01 +0: (1, 6; 0) 4.00000000000000e+00 +0: (1, 6; 1) 0.00000000000000e+00 +0: (1, 6; 2) 0.00000000000000e+00 +0: (1, 6; 3) -1.50000000000000e+00 +0: (1, 6; 4) -1.50000000000000e+00 +0: (1, 6; 5) -2.50000000000000e-01 +0: (1, 6; 6) -2.50000000000000e-01 +0: (1, 6; 7) -2.50000000000000e-01 +0: (1, 6; 8) -2.50000000000000e-01 +0: (2, 6; 0) 4.00000000000000e+00 +0: (2, 6; 1) 0.00000000000000e+00 +0: (2, 6; 2) 0.00000000000000e+00 +0: (2, 6; 3) -1.50000000000000e+00 +0: (2, 6; 4) -1.50000000000000e+00 +0: (2, 6; 5) -2.50000000000000e-01 +0: (2, 6; 6) -2.50000000000000e-01 +0: (2, 6; 7) -2.50000000000000e-01 +0: (2, 6; 8) -2.50000000000000e-01 +0: (0, 7; 0) 4.00000000000000e+00 +0: (0, 7; 1) 0.00000000000000e+00 +0: (0, 7; 2) 0.00000000000000e+00 +0: (0, 7; 3) -1.50000000000000e+00 +0: (0, 7; 4) -1.50000000000000e+00 +0: (0, 7; 5) -2.50000000000000e-01 +0: (0, 7; 6) -2.50000000000000e-01 +0: (0, 7; 7) -2.50000000000000e-01 +0: (0, 7; 8) -2.50000000000000e-01 +0: (1, 7; 0) 4.00000000000000e+00 +0: (1, 7; 1) 0.00000000000000e+00 +0: (1, 7; 2) 0.00000000000000e+00 +0: (1, 7; 3) -1.50000000000000e+00 +0: (1, 7; 4) -1.50000000000000e+00 +0: (1, 7; 5) -2.50000000000000e-01 +0: (1, 7; 6) -2.50000000000000e-01 +0: (1, 7; 7) -2.50000000000000e-01 +0: (1, 7; 8) -2.50000000000000e-01 +0: (2, 7; 0) 4.00000000000000e+00 +0: (2, 7; 1) 0.00000000000000e+00 +0: (2, 7; 2) 0.00000000000000e+00 +0: (2, 7; 3) -1.50000000000000e+00 +0: (2, 7; 4) -1.50000000000000e+00 +0: (2, 7; 5) -2.50000000000000e-01 +0: (2, 7; 6) -2.50000000000000e-01 +0: (2, 7; 7) -2.50000000000000e-01 +0: (2, 7; 8) -2.50000000000000e-01 +0: (0, 8; 0) 4.00000000000000e+00 +0: (0, 8; 1) 0.00000000000000e+00 +0: (0, 8; 2) 0.00000000000000e+00 +0: (0, 8; 3) -1.50000000000000e+00 +0: (0, 8; 4) -1.50000000000000e+00 +0: (0, 8; 5) -2.50000000000000e-01 +0: (0, 8; 6) -2.50000000000000e-01 +0: (0, 8; 7) -2.50000000000000e-01 +0: (0, 8; 8) -2.50000000000000e-01 +0: (1, 8; 0) 4.00000000000000e+00 +0: (1, 8; 1) 0.00000000000000e+00 +0: (1, 8; 2) 0.00000000000000e+00 +0: (1, 8; 3) -1.50000000000000e+00 +0: (1, 8; 4) -1.50000000000000e+00 +0: (1, 8; 5) -2.50000000000000e-01 +0: (1, 8; 6) -2.50000000000000e-01 +0: (1, 8; 7) -2.50000000000000e-01 +0: (1, 8; 8) -2.50000000000000e-01 +0: (2, 8; 0) 4.00000000000000e+00 +0: (2, 8; 1) 0.00000000000000e+00 +0: (2, 8; 2) 0.00000000000000e+00 +0: (2, 8; 3) -1.50000000000000e+00 +0: (2, 8; 4) -1.50000000000000e+00 +0: (2, 8; 5) -2.50000000000000e-01 +0: (2, 8; 6) -2.50000000000000e-01 +0: (2, 8; 7) -2.50000000000000e-01 +0: (2, 8; 8) -2.50000000000000e-01 +0: (0, 9; 0) 4.00000000000000e+00 +0: (0, 9; 1) 0.00000000000000e+00 +0: (0, 9; 2) 0.00000000000000e+00 +0: (0, 9; 3) -1.50000000000000e+00 +0: (0, 9; 4) 0.00000000000000e+00 +0: (0, 9; 5) -2.50000000000000e-01 +0: (0, 9; 6) 0.00000000000000e+00 +0: (0, 9; 7) -2.50000000000000e-01 +0: (0, 9; 8) 0.00000000000000e+00 +0: (1, 9; 0) 4.00000000000000e+00 +0: (1, 9; 1) 0.00000000000000e+00 +0: (1, 9; 2) 0.00000000000000e+00 +0: (1, 9; 3) -1.50000000000000e+00 +0: (1, 9; 4) 0.00000000000000e+00 +0: (1, 9; 5) -2.50000000000000e-01 +0: (1, 9; 6) 0.00000000000000e+00 +0: (1, 9; 7) -2.50000000000000e-01 +0: (1, 9; 8) 0.00000000000000e+00 +0: (2, 9; 0) 4.00000000000000e+00 +0: (2, 9; 1) 0.00000000000000e+00 +0: (2, 9; 2) 0.00000000000000e+00 +0: (2, 9; 3) -1.50000000000000e+00 +0: (2, 9; 4) 0.00000000000000e+00 +0: (2, 9; 5) -2.50000000000000e-01 +0: (2, 9; 6) 0.00000000000000e+00 +0: (2, 9; 7) -2.50000000000000e-01 +0: (2, 9; 8) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D2.x.4.matmat.00003 b/src/test/TEST_structmat/structmat.saved.2D2.x.4.matmat.00003 new file mode 100644 index 0000000000..e08817fc54 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D2.x.4.matmat.00003 @@ -0,0 +1,123 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (3, 5) x (4, 9) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +9 +0: (3, 5; 0) 4.00000000000000e+00 +0: (3, 5; 1) 0.00000000000000e+00 +0: (3, 5; 2) 0.00000000000000e+00 +0: (3, 5; 3) -1.50000000000000e+00 +0: (3, 5; 4) -1.50000000000000e+00 +0: (3, 5; 5) -2.50000000000000e-01 +0: (3, 5; 6) -2.50000000000000e-01 +0: (3, 5; 7) -2.50000000000000e-01 +0: (3, 5; 8) -2.50000000000000e-01 +0: (4, 5; 0) 4.00000000000000e+00 +0: (4, 5; 1) 0.00000000000000e+00 +0: (4, 5; 2) 0.00000000000000e+00 +0: (4, 5; 3) -1.50000000000000e+00 +0: (4, 5; 4) -1.50000000000000e+00 +0: (4, 5; 5) -2.50000000000000e-01 +0: (4, 5; 6) -2.50000000000000e-01 +0: (4, 5; 7) -2.50000000000000e-01 +0: (4, 5; 8) -2.50000000000000e-01 +0: (3, 6; 0) 4.00000000000000e+00 +0: (3, 6; 1) 0.00000000000000e+00 +0: (3, 6; 2) 0.00000000000000e+00 +0: (3, 6; 3) -1.50000000000000e+00 +0: (3, 6; 4) -1.50000000000000e+00 +0: (3, 6; 5) -2.50000000000000e-01 +0: (3, 6; 6) -2.50000000000000e-01 +0: (3, 6; 7) -2.50000000000000e-01 +0: (3, 6; 8) -2.50000000000000e-01 +0: (4, 6; 0) 4.00000000000000e+00 +0: (4, 6; 1) 0.00000000000000e+00 +0: (4, 6; 2) 0.00000000000000e+00 +0: (4, 6; 3) -1.50000000000000e+00 +0: (4, 6; 4) -1.50000000000000e+00 +0: (4, 6; 5) -2.50000000000000e-01 +0: (4, 6; 6) -2.50000000000000e-01 +0: (4, 6; 7) -2.50000000000000e-01 +0: (4, 6; 8) -2.50000000000000e-01 +0: (3, 7; 0) 4.00000000000000e+00 +0: (3, 7; 1) 0.00000000000000e+00 +0: (3, 7; 2) 0.00000000000000e+00 +0: (3, 7; 3) -1.50000000000000e+00 +0: (3, 7; 4) -1.50000000000000e+00 +0: (3, 7; 5) -2.50000000000000e-01 +0: (3, 7; 6) -2.50000000000000e-01 +0: (3, 7; 7) -2.50000000000000e-01 +0: (3, 7; 8) -2.50000000000000e-01 +0: (4, 7; 0) 4.00000000000000e+00 +0: (4, 7; 1) 0.00000000000000e+00 +0: (4, 7; 2) 0.00000000000000e+00 +0: (4, 7; 3) -1.50000000000000e+00 +0: (4, 7; 4) -1.50000000000000e+00 +0: (4, 7; 5) -2.50000000000000e-01 +0: (4, 7; 6) -2.50000000000000e-01 +0: (4, 7; 7) -2.50000000000000e-01 +0: (4, 7; 8) -2.50000000000000e-01 +0: (3, 8; 0) 4.00000000000000e+00 +0: (3, 8; 1) 0.00000000000000e+00 +0: (3, 8; 2) 0.00000000000000e+00 +0: (3, 8; 3) -1.50000000000000e+00 +0: (3, 8; 4) -1.50000000000000e+00 +0: (3, 8; 5) -2.50000000000000e-01 +0: (3, 8; 6) -2.50000000000000e-01 +0: (3, 8; 7) -2.50000000000000e-01 +0: (3, 8; 8) -2.50000000000000e-01 +0: (4, 8; 0) 4.00000000000000e+00 +0: (4, 8; 1) 0.00000000000000e+00 +0: (4, 8; 2) 0.00000000000000e+00 +0: (4, 8; 3) -1.50000000000000e+00 +0: (4, 8; 4) -1.50000000000000e+00 +0: (4, 8; 5) -2.50000000000000e-01 +0: (4, 8; 6) -2.50000000000000e-01 +0: (4, 8; 7) -2.50000000000000e-01 +0: (4, 8; 8) -2.50000000000000e-01 +0: (3, 9; 0) 4.00000000000000e+00 +0: (3, 9; 1) 0.00000000000000e+00 +0: (3, 9; 2) 0.00000000000000e+00 +0: (3, 9; 3) -1.50000000000000e+00 +0: (3, 9; 4) 0.00000000000000e+00 +0: (3, 9; 5) -2.50000000000000e-01 +0: (3, 9; 6) 0.00000000000000e+00 +0: (3, 9; 7) -2.50000000000000e-01 +0: (3, 9; 8) 0.00000000000000e+00 +0: (4, 9; 0) 4.00000000000000e+00 +0: (4, 9; 1) 0.00000000000000e+00 +0: (4, 9; 2) 0.00000000000000e+00 +0: (4, 9; 3) -1.50000000000000e+00 +0: (4, 9; 4) 0.00000000000000e+00 +0: (4, 9; 5) -2.50000000000000e-01 +0: (4, 9; 6) 0.00000000000000e+00 +0: (4, 9; 7) -2.50000000000000e-01 +0: (4, 9; 8) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D2.x.matmat.00000 b/src/test/TEST_structmat/structmat.saved.2D2.x.matmat.00000 new file mode 100644 index 0000000000..fe4df077f4 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D2.x.matmat.00000 @@ -0,0 +1,483 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (0, 0) x (4, 9) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +9 +0: (0, 0; 0) 4.00000000000000e+00 +0: (0, 0; 1) 0.00000000000000e+00 +0: (0, 0; 2) 0.00000000000000e+00 +0: (0, 0; 3) 0.00000000000000e+00 +0: (0, 0; 4) -1.50000000000000e+00 +0: (0, 0; 5) 0.00000000000000e+00 +0: (0, 0; 6) -2.50000000000000e-01 +0: (0, 0; 7) 0.00000000000000e+00 +0: (0, 0; 8) -2.50000000000000e-01 +0: (1, 0; 0) 4.00000000000000e+00 +0: (1, 0; 1) 0.00000000000000e+00 +0: (1, 0; 2) 0.00000000000000e+00 +0: (1, 0; 3) 0.00000000000000e+00 +0: (1, 0; 4) -1.50000000000000e+00 +0: (1, 0; 5) 0.00000000000000e+00 +0: (1, 0; 6) -2.50000000000000e-01 +0: (1, 0; 7) 0.00000000000000e+00 +0: (1, 0; 8) -2.50000000000000e-01 +0: (2, 0; 0) 4.00000000000000e+00 +0: (2, 0; 1) 0.00000000000000e+00 +0: (2, 0; 2) 0.00000000000000e+00 +0: (2, 0; 3) 0.00000000000000e+00 +0: (2, 0; 4) -1.50000000000000e+00 +0: (2, 0; 5) 0.00000000000000e+00 +0: (2, 0; 6) -2.50000000000000e-01 +0: (2, 0; 7) 0.00000000000000e+00 +0: (2, 0; 8) -2.50000000000000e-01 +0: (3, 0; 0) 4.00000000000000e+00 +0: (3, 0; 1) 0.00000000000000e+00 +0: (3, 0; 2) 0.00000000000000e+00 +0: (3, 0; 3) 0.00000000000000e+00 +0: (3, 0; 4) -1.50000000000000e+00 +0: (3, 0; 5) 0.00000000000000e+00 +0: (3, 0; 6) -2.50000000000000e-01 +0: (3, 0; 7) 0.00000000000000e+00 +0: (3, 0; 8) -2.50000000000000e-01 +0: (4, 0; 0) 4.00000000000000e+00 +0: (4, 0; 1) 0.00000000000000e+00 +0: (4, 0; 2) 0.00000000000000e+00 +0: (4, 0; 3) 0.00000000000000e+00 +0: (4, 0; 4) -1.50000000000000e+00 +0: (4, 0; 5) 0.00000000000000e+00 +0: (4, 0; 6) -2.50000000000000e-01 +0: (4, 0; 7) 0.00000000000000e+00 +0: (4, 0; 8) -2.50000000000000e-01 +0: (0, 1; 0) 4.00000000000000e+00 +0: (0, 1; 1) 0.00000000000000e+00 +0: (0, 1; 2) 0.00000000000000e+00 +0: (0, 1; 3) -1.50000000000000e+00 +0: (0, 1; 4) -1.50000000000000e+00 +0: (0, 1; 5) -2.50000000000000e-01 +0: (0, 1; 6) -2.50000000000000e-01 +0: (0, 1; 7) -2.50000000000000e-01 +0: (0, 1; 8) -2.50000000000000e-01 +0: (1, 1; 0) 4.00000000000000e+00 +0: (1, 1; 1) 0.00000000000000e+00 +0: (1, 1; 2) 0.00000000000000e+00 +0: (1, 1; 3) -1.50000000000000e+00 +0: (1, 1; 4) -1.50000000000000e+00 +0: (1, 1; 5) -2.50000000000000e-01 +0: (1, 1; 6) -2.50000000000000e-01 +0: (1, 1; 7) -2.50000000000000e-01 +0: (1, 1; 8) -2.50000000000000e-01 +0: (2, 1; 0) 4.00000000000000e+00 +0: (2, 1; 1) 0.00000000000000e+00 +0: (2, 1; 2) 0.00000000000000e+00 +0: (2, 1; 3) -1.50000000000000e+00 +0: (2, 1; 4) -1.50000000000000e+00 +0: (2, 1; 5) -2.50000000000000e-01 +0: (2, 1; 6) -2.50000000000000e-01 +0: (2, 1; 7) -2.50000000000000e-01 +0: (2, 1; 8) -2.50000000000000e-01 +0: (3, 1; 0) 4.00000000000000e+00 +0: (3, 1; 1) 0.00000000000000e+00 +0: (3, 1; 2) 0.00000000000000e+00 +0: (3, 1; 3) -1.50000000000000e+00 +0: (3, 1; 4) -1.50000000000000e+00 +0: (3, 1; 5) -2.50000000000000e-01 +0: (3, 1; 6) -2.50000000000000e-01 +0: (3, 1; 7) -2.50000000000000e-01 +0: (3, 1; 8) -2.50000000000000e-01 +0: (4, 1; 0) 4.00000000000000e+00 +0: (4, 1; 1) 0.00000000000000e+00 +0: (4, 1; 2) 0.00000000000000e+00 +0: (4, 1; 3) -1.50000000000000e+00 +0: (4, 1; 4) -1.50000000000000e+00 +0: (4, 1; 5) -2.50000000000000e-01 +0: (4, 1; 6) -2.50000000000000e-01 +0: (4, 1; 7) -2.50000000000000e-01 +0: (4, 1; 8) -2.50000000000000e-01 +0: (0, 2; 0) 4.00000000000000e+00 +0: (0, 2; 1) 0.00000000000000e+00 +0: (0, 2; 2) 0.00000000000000e+00 +0: (0, 2; 3) -1.50000000000000e+00 +0: (0, 2; 4) -1.50000000000000e+00 +0: (0, 2; 5) -2.50000000000000e-01 +0: (0, 2; 6) -2.50000000000000e-01 +0: (0, 2; 7) -2.50000000000000e-01 +0: (0, 2; 8) -2.50000000000000e-01 +0: (1, 2; 0) 4.00000000000000e+00 +0: (1, 2; 1) 0.00000000000000e+00 +0: (1, 2; 2) 0.00000000000000e+00 +0: (1, 2; 3) -1.50000000000000e+00 +0: (1, 2; 4) -1.50000000000000e+00 +0: (1, 2; 5) -2.50000000000000e-01 +0: (1, 2; 6) -2.50000000000000e-01 +0: (1, 2; 7) -2.50000000000000e-01 +0: (1, 2; 8) -2.50000000000000e-01 +0: (2, 2; 0) 4.00000000000000e+00 +0: (2, 2; 1) 0.00000000000000e+00 +0: (2, 2; 2) 0.00000000000000e+00 +0: (2, 2; 3) -1.50000000000000e+00 +0: (2, 2; 4) -1.50000000000000e+00 +0: (2, 2; 5) -2.50000000000000e-01 +0: (2, 2; 6) -2.50000000000000e-01 +0: (2, 2; 7) -2.50000000000000e-01 +0: (2, 2; 8) -2.50000000000000e-01 +0: (3, 2; 0) 4.00000000000000e+00 +0: (3, 2; 1) 0.00000000000000e+00 +0: (3, 2; 2) 0.00000000000000e+00 +0: (3, 2; 3) -1.50000000000000e+00 +0: (3, 2; 4) -1.50000000000000e+00 +0: (3, 2; 5) -2.50000000000000e-01 +0: (3, 2; 6) -2.50000000000000e-01 +0: (3, 2; 7) -2.50000000000000e-01 +0: (3, 2; 8) -2.50000000000000e-01 +0: (4, 2; 0) 4.00000000000000e+00 +0: (4, 2; 1) 0.00000000000000e+00 +0: (4, 2; 2) 0.00000000000000e+00 +0: (4, 2; 3) -1.50000000000000e+00 +0: (4, 2; 4) -1.50000000000000e+00 +0: (4, 2; 5) -2.50000000000000e-01 +0: (4, 2; 6) -2.50000000000000e-01 +0: (4, 2; 7) -2.50000000000000e-01 +0: (4, 2; 8) -2.50000000000000e-01 +0: (0, 3; 0) 4.00000000000000e+00 +0: (0, 3; 1) 0.00000000000000e+00 +0: (0, 3; 2) 0.00000000000000e+00 +0: (0, 3; 3) -1.50000000000000e+00 +0: (0, 3; 4) -1.50000000000000e+00 +0: (0, 3; 5) -2.50000000000000e-01 +0: (0, 3; 6) -2.50000000000000e-01 +0: (0, 3; 7) -2.50000000000000e-01 +0: (0, 3; 8) -2.50000000000000e-01 +0: (1, 3; 0) 4.00000000000000e+00 +0: (1, 3; 1) 0.00000000000000e+00 +0: (1, 3; 2) 0.00000000000000e+00 +0: (1, 3; 3) -1.50000000000000e+00 +0: (1, 3; 4) -1.50000000000000e+00 +0: (1, 3; 5) -2.50000000000000e-01 +0: (1, 3; 6) -2.50000000000000e-01 +0: (1, 3; 7) -2.50000000000000e-01 +0: (1, 3; 8) -2.50000000000000e-01 +0: (2, 3; 0) 4.00000000000000e+00 +0: (2, 3; 1) 0.00000000000000e+00 +0: (2, 3; 2) 0.00000000000000e+00 +0: (2, 3; 3) -1.50000000000000e+00 +0: (2, 3; 4) -1.50000000000000e+00 +0: (2, 3; 5) -2.50000000000000e-01 +0: (2, 3; 6) -2.50000000000000e-01 +0: (2, 3; 7) -2.50000000000000e-01 +0: (2, 3; 8) -2.50000000000000e-01 +0: (3, 3; 0) 4.00000000000000e+00 +0: (3, 3; 1) 0.00000000000000e+00 +0: (3, 3; 2) 0.00000000000000e+00 +0: (3, 3; 3) -1.50000000000000e+00 +0: (3, 3; 4) -1.50000000000000e+00 +0: (3, 3; 5) -2.50000000000000e-01 +0: (3, 3; 6) -2.50000000000000e-01 +0: (3, 3; 7) -2.50000000000000e-01 +0: (3, 3; 8) -2.50000000000000e-01 +0: (4, 3; 0) 4.00000000000000e+00 +0: (4, 3; 1) 0.00000000000000e+00 +0: (4, 3; 2) 0.00000000000000e+00 +0: (4, 3; 3) -1.50000000000000e+00 +0: (4, 3; 4) -1.50000000000000e+00 +0: (4, 3; 5) -2.50000000000000e-01 +0: (4, 3; 6) -2.50000000000000e-01 +0: (4, 3; 7) -2.50000000000000e-01 +0: (4, 3; 8) -2.50000000000000e-01 +0: (0, 4; 0) 4.00000000000000e+00 +0: (0, 4; 1) 0.00000000000000e+00 +0: (0, 4; 2) 0.00000000000000e+00 +0: (0, 4; 3) -1.50000000000000e+00 +0: (0, 4; 4) -1.50000000000000e+00 +0: (0, 4; 5) -2.50000000000000e-01 +0: (0, 4; 6) -2.50000000000000e-01 +0: (0, 4; 7) -2.50000000000000e-01 +0: (0, 4; 8) -2.50000000000000e-01 +0: (1, 4; 0) 4.00000000000000e+00 +0: (1, 4; 1) 0.00000000000000e+00 +0: (1, 4; 2) 0.00000000000000e+00 +0: (1, 4; 3) -1.50000000000000e+00 +0: (1, 4; 4) -1.50000000000000e+00 +0: (1, 4; 5) -2.50000000000000e-01 +0: (1, 4; 6) -2.50000000000000e-01 +0: (1, 4; 7) -2.50000000000000e-01 +0: (1, 4; 8) -2.50000000000000e-01 +0: (2, 4; 0) 4.00000000000000e+00 +0: (2, 4; 1) 0.00000000000000e+00 +0: (2, 4; 2) 0.00000000000000e+00 +0: (2, 4; 3) -1.50000000000000e+00 +0: (2, 4; 4) -1.50000000000000e+00 +0: (2, 4; 5) -2.50000000000000e-01 +0: (2, 4; 6) -2.50000000000000e-01 +0: (2, 4; 7) -2.50000000000000e-01 +0: (2, 4; 8) -2.50000000000000e-01 +0: (3, 4; 0) 4.00000000000000e+00 +0: (3, 4; 1) 0.00000000000000e+00 +0: (3, 4; 2) 0.00000000000000e+00 +0: (3, 4; 3) -1.50000000000000e+00 +0: (3, 4; 4) -1.50000000000000e+00 +0: (3, 4; 5) -2.50000000000000e-01 +0: (3, 4; 6) -2.50000000000000e-01 +0: (3, 4; 7) -2.50000000000000e-01 +0: (3, 4; 8) -2.50000000000000e-01 +0: (4, 4; 0) 4.00000000000000e+00 +0: (4, 4; 1) 0.00000000000000e+00 +0: (4, 4; 2) 0.00000000000000e+00 +0: (4, 4; 3) -1.50000000000000e+00 +0: (4, 4; 4) -1.50000000000000e+00 +0: (4, 4; 5) -2.50000000000000e-01 +0: (4, 4; 6) -2.50000000000000e-01 +0: (4, 4; 7) -2.50000000000000e-01 +0: (4, 4; 8) -2.50000000000000e-01 +0: (0, 5; 0) 4.00000000000000e+00 +0: (0, 5; 1) 0.00000000000000e+00 +0: (0, 5; 2) 0.00000000000000e+00 +0: (0, 5; 3) -1.50000000000000e+00 +0: (0, 5; 4) -1.50000000000000e+00 +0: (0, 5; 5) -2.50000000000000e-01 +0: (0, 5; 6) -2.50000000000000e-01 +0: (0, 5; 7) -2.50000000000000e-01 +0: (0, 5; 8) -2.50000000000000e-01 +0: (1, 5; 0) 4.00000000000000e+00 +0: (1, 5; 1) 0.00000000000000e+00 +0: (1, 5; 2) 0.00000000000000e+00 +0: (1, 5; 3) -1.50000000000000e+00 +0: (1, 5; 4) -1.50000000000000e+00 +0: (1, 5; 5) -2.50000000000000e-01 +0: (1, 5; 6) -2.50000000000000e-01 +0: (1, 5; 7) -2.50000000000000e-01 +0: (1, 5; 8) -2.50000000000000e-01 +0: (2, 5; 0) 4.00000000000000e+00 +0: (2, 5; 1) 0.00000000000000e+00 +0: (2, 5; 2) 0.00000000000000e+00 +0: (2, 5; 3) -1.50000000000000e+00 +0: (2, 5; 4) -1.50000000000000e+00 +0: (2, 5; 5) -2.50000000000000e-01 +0: (2, 5; 6) -2.50000000000000e-01 +0: (2, 5; 7) -2.50000000000000e-01 +0: (2, 5; 8) -2.50000000000000e-01 +0: (3, 5; 0) 4.00000000000000e+00 +0: (3, 5; 1) 0.00000000000000e+00 +0: (3, 5; 2) 0.00000000000000e+00 +0: (3, 5; 3) -1.50000000000000e+00 +0: (3, 5; 4) -1.50000000000000e+00 +0: (3, 5; 5) -2.50000000000000e-01 +0: (3, 5; 6) -2.50000000000000e-01 +0: (3, 5; 7) -2.50000000000000e-01 +0: (3, 5; 8) -2.50000000000000e-01 +0: (4, 5; 0) 4.00000000000000e+00 +0: (4, 5; 1) 0.00000000000000e+00 +0: (4, 5; 2) 0.00000000000000e+00 +0: (4, 5; 3) -1.50000000000000e+00 +0: (4, 5; 4) -1.50000000000000e+00 +0: (4, 5; 5) -2.50000000000000e-01 +0: (4, 5; 6) -2.50000000000000e-01 +0: (4, 5; 7) -2.50000000000000e-01 +0: (4, 5; 8) -2.50000000000000e-01 +0: (0, 6; 0) 4.00000000000000e+00 +0: (0, 6; 1) 0.00000000000000e+00 +0: (0, 6; 2) 0.00000000000000e+00 +0: (0, 6; 3) -1.50000000000000e+00 +0: (0, 6; 4) -1.50000000000000e+00 +0: (0, 6; 5) -2.50000000000000e-01 +0: (0, 6; 6) -2.50000000000000e-01 +0: (0, 6; 7) -2.50000000000000e-01 +0: (0, 6; 8) -2.50000000000000e-01 +0: (1, 6; 0) 4.00000000000000e+00 +0: (1, 6; 1) 0.00000000000000e+00 +0: (1, 6; 2) 0.00000000000000e+00 +0: (1, 6; 3) -1.50000000000000e+00 +0: (1, 6; 4) -1.50000000000000e+00 +0: (1, 6; 5) -2.50000000000000e-01 +0: (1, 6; 6) -2.50000000000000e-01 +0: (1, 6; 7) -2.50000000000000e-01 +0: (1, 6; 8) -2.50000000000000e-01 +0: (2, 6; 0) 4.00000000000000e+00 +0: (2, 6; 1) 0.00000000000000e+00 +0: (2, 6; 2) 0.00000000000000e+00 +0: (2, 6; 3) -1.50000000000000e+00 +0: (2, 6; 4) -1.50000000000000e+00 +0: (2, 6; 5) -2.50000000000000e-01 +0: (2, 6; 6) -2.50000000000000e-01 +0: (2, 6; 7) -2.50000000000000e-01 +0: (2, 6; 8) -2.50000000000000e-01 +0: (3, 6; 0) 4.00000000000000e+00 +0: (3, 6; 1) 0.00000000000000e+00 +0: (3, 6; 2) 0.00000000000000e+00 +0: (3, 6; 3) -1.50000000000000e+00 +0: (3, 6; 4) -1.50000000000000e+00 +0: (3, 6; 5) -2.50000000000000e-01 +0: (3, 6; 6) -2.50000000000000e-01 +0: (3, 6; 7) -2.50000000000000e-01 +0: (3, 6; 8) -2.50000000000000e-01 +0: (4, 6; 0) 4.00000000000000e+00 +0: (4, 6; 1) 0.00000000000000e+00 +0: (4, 6; 2) 0.00000000000000e+00 +0: (4, 6; 3) -1.50000000000000e+00 +0: (4, 6; 4) -1.50000000000000e+00 +0: (4, 6; 5) -2.50000000000000e-01 +0: (4, 6; 6) -2.50000000000000e-01 +0: (4, 6; 7) -2.50000000000000e-01 +0: (4, 6; 8) -2.50000000000000e-01 +0: (0, 7; 0) 4.00000000000000e+00 +0: (0, 7; 1) 0.00000000000000e+00 +0: (0, 7; 2) 0.00000000000000e+00 +0: (0, 7; 3) -1.50000000000000e+00 +0: (0, 7; 4) -1.50000000000000e+00 +0: (0, 7; 5) -2.50000000000000e-01 +0: (0, 7; 6) -2.50000000000000e-01 +0: (0, 7; 7) -2.50000000000000e-01 +0: (0, 7; 8) -2.50000000000000e-01 +0: (1, 7; 0) 4.00000000000000e+00 +0: (1, 7; 1) 0.00000000000000e+00 +0: (1, 7; 2) 0.00000000000000e+00 +0: (1, 7; 3) -1.50000000000000e+00 +0: (1, 7; 4) -1.50000000000000e+00 +0: (1, 7; 5) -2.50000000000000e-01 +0: (1, 7; 6) -2.50000000000000e-01 +0: (1, 7; 7) -2.50000000000000e-01 +0: (1, 7; 8) -2.50000000000000e-01 +0: (2, 7; 0) 4.00000000000000e+00 +0: (2, 7; 1) 0.00000000000000e+00 +0: (2, 7; 2) 0.00000000000000e+00 +0: (2, 7; 3) -1.50000000000000e+00 +0: (2, 7; 4) -1.50000000000000e+00 +0: (2, 7; 5) -2.50000000000000e-01 +0: (2, 7; 6) -2.50000000000000e-01 +0: (2, 7; 7) -2.50000000000000e-01 +0: (2, 7; 8) -2.50000000000000e-01 +0: (3, 7; 0) 4.00000000000000e+00 +0: (3, 7; 1) 0.00000000000000e+00 +0: (3, 7; 2) 0.00000000000000e+00 +0: (3, 7; 3) -1.50000000000000e+00 +0: (3, 7; 4) -1.50000000000000e+00 +0: (3, 7; 5) -2.50000000000000e-01 +0: (3, 7; 6) -2.50000000000000e-01 +0: (3, 7; 7) -2.50000000000000e-01 +0: (3, 7; 8) -2.50000000000000e-01 +0: (4, 7; 0) 4.00000000000000e+00 +0: (4, 7; 1) 0.00000000000000e+00 +0: (4, 7; 2) 0.00000000000000e+00 +0: (4, 7; 3) -1.50000000000000e+00 +0: (4, 7; 4) -1.50000000000000e+00 +0: (4, 7; 5) -2.50000000000000e-01 +0: (4, 7; 6) -2.50000000000000e-01 +0: (4, 7; 7) -2.50000000000000e-01 +0: (4, 7; 8) -2.50000000000000e-01 +0: (0, 8; 0) 4.00000000000000e+00 +0: (0, 8; 1) 0.00000000000000e+00 +0: (0, 8; 2) 0.00000000000000e+00 +0: (0, 8; 3) -1.50000000000000e+00 +0: (0, 8; 4) -1.50000000000000e+00 +0: (0, 8; 5) -2.50000000000000e-01 +0: (0, 8; 6) -2.50000000000000e-01 +0: (0, 8; 7) -2.50000000000000e-01 +0: (0, 8; 8) -2.50000000000000e-01 +0: (1, 8; 0) 4.00000000000000e+00 +0: (1, 8; 1) 0.00000000000000e+00 +0: (1, 8; 2) 0.00000000000000e+00 +0: (1, 8; 3) -1.50000000000000e+00 +0: (1, 8; 4) -1.50000000000000e+00 +0: (1, 8; 5) -2.50000000000000e-01 +0: (1, 8; 6) -2.50000000000000e-01 +0: (1, 8; 7) -2.50000000000000e-01 +0: (1, 8; 8) -2.50000000000000e-01 +0: (2, 8; 0) 4.00000000000000e+00 +0: (2, 8; 1) 0.00000000000000e+00 +0: (2, 8; 2) 0.00000000000000e+00 +0: (2, 8; 3) -1.50000000000000e+00 +0: (2, 8; 4) -1.50000000000000e+00 +0: (2, 8; 5) -2.50000000000000e-01 +0: (2, 8; 6) -2.50000000000000e-01 +0: (2, 8; 7) -2.50000000000000e-01 +0: (2, 8; 8) -2.50000000000000e-01 +0: (3, 8; 0) 4.00000000000000e+00 +0: (3, 8; 1) 0.00000000000000e+00 +0: (3, 8; 2) 0.00000000000000e+00 +0: (3, 8; 3) -1.50000000000000e+00 +0: (3, 8; 4) -1.50000000000000e+00 +0: (3, 8; 5) -2.50000000000000e-01 +0: (3, 8; 6) -2.50000000000000e-01 +0: (3, 8; 7) -2.50000000000000e-01 +0: (3, 8; 8) -2.50000000000000e-01 +0: (4, 8; 0) 4.00000000000000e+00 +0: (4, 8; 1) 0.00000000000000e+00 +0: (4, 8; 2) 0.00000000000000e+00 +0: (4, 8; 3) -1.50000000000000e+00 +0: (4, 8; 4) -1.50000000000000e+00 +0: (4, 8; 5) -2.50000000000000e-01 +0: (4, 8; 6) -2.50000000000000e-01 +0: (4, 8; 7) -2.50000000000000e-01 +0: (4, 8; 8) -2.50000000000000e-01 +0: (0, 9; 0) 4.00000000000000e+00 +0: (0, 9; 1) 0.00000000000000e+00 +0: (0, 9; 2) 0.00000000000000e+00 +0: (0, 9; 3) -1.50000000000000e+00 +0: (0, 9; 4) 0.00000000000000e+00 +0: (0, 9; 5) -2.50000000000000e-01 +0: (0, 9; 6) 0.00000000000000e+00 +0: (0, 9; 7) -2.50000000000000e-01 +0: (0, 9; 8) 0.00000000000000e+00 +0: (1, 9; 0) 4.00000000000000e+00 +0: (1, 9; 1) 0.00000000000000e+00 +0: (1, 9; 2) 0.00000000000000e+00 +0: (1, 9; 3) -1.50000000000000e+00 +0: (1, 9; 4) 0.00000000000000e+00 +0: (1, 9; 5) -2.50000000000000e-01 +0: (1, 9; 6) 0.00000000000000e+00 +0: (1, 9; 7) -2.50000000000000e-01 +0: (1, 9; 8) 0.00000000000000e+00 +0: (2, 9; 0) 4.00000000000000e+00 +0: (2, 9; 1) 0.00000000000000e+00 +0: (2, 9; 2) 0.00000000000000e+00 +0: (2, 9; 3) -1.50000000000000e+00 +0: (2, 9; 4) 0.00000000000000e+00 +0: (2, 9; 5) -2.50000000000000e-01 +0: (2, 9; 6) 0.00000000000000e+00 +0: (2, 9; 7) -2.50000000000000e-01 +0: (2, 9; 8) 0.00000000000000e+00 +0: (3, 9; 0) 4.00000000000000e+00 +0: (3, 9; 1) 0.00000000000000e+00 +0: (3, 9; 2) 0.00000000000000e+00 +0: (3, 9; 3) -1.50000000000000e+00 +0: (3, 9; 4) 0.00000000000000e+00 +0: (3, 9; 5) -2.50000000000000e-01 +0: (3, 9; 6) 0.00000000000000e+00 +0: (3, 9; 7) -2.50000000000000e-01 +0: (3, 9; 8) 0.00000000000000e+00 +0: (4, 9; 0) 4.00000000000000e+00 +0: (4, 9; 1) 0.00000000000000e+00 +0: (4, 9; 2) 0.00000000000000e+00 +0: (4, 9; 3) -1.50000000000000e+00 +0: (4, 9; 4) 0.00000000000000e+00 +0: (4, 9; 5) -2.50000000000000e-01 +0: (4, 9; 6) 0.00000000000000e+00 +0: (4, 9; 7) -2.50000000000000e-01 +0: (4, 9; 8) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D2.y.4.matmat.00000 b/src/test/TEST_structmat/structmat.saved.2D2.y.4.matmat.00000 new file mode 100644 index 0000000000..529cf8b07a --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D2.y.4.matmat.00000 @@ -0,0 +1,168 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (0, 0) x (4, 2) + +Periodic: (10, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (1, -1) +7: (-1, 1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +9 +0: (0, 0; 0) 4.00000000000000e+00 +0: (0, 0; 1) -1.25000000000000e+00 +0: (0, 0; 2) -1.25000000000000e+00 +0: (0, 0; 3) 0.00000000000000e+00 +0: (0, 0; 4) 0.00000000000000e+00 +0: (0, 0; 5) 0.00000000000000e+00 +0: (0, 0; 6) 0.00000000000000e+00 +0: (0, 0; 7) -2.50000000000000e-01 +0: (0, 0; 8) -2.50000000000000e-01 +0: (1, 0; 0) 4.00000000000000e+00 +0: (1, 0; 1) -1.25000000000000e+00 +0: (1, 0; 2) -1.25000000000000e+00 +0: (1, 0; 3) 0.00000000000000e+00 +0: (1, 0; 4) 0.00000000000000e+00 +0: (1, 0; 5) 0.00000000000000e+00 +0: (1, 0; 6) 0.00000000000000e+00 +0: (1, 0; 7) -2.50000000000000e-01 +0: (1, 0; 8) -2.50000000000000e-01 +0: (2, 0; 0) 4.00000000000000e+00 +0: (2, 0; 1) -1.25000000000000e+00 +0: (2, 0; 2) -1.25000000000000e+00 +0: (2, 0; 3) 0.00000000000000e+00 +0: (2, 0; 4) 0.00000000000000e+00 +0: (2, 0; 5) 0.00000000000000e+00 +0: (2, 0; 6) 0.00000000000000e+00 +0: (2, 0; 7) -2.50000000000000e-01 +0: (2, 0; 8) -2.50000000000000e-01 +0: (3, 0; 0) 4.00000000000000e+00 +0: (3, 0; 1) -1.25000000000000e+00 +0: (3, 0; 2) -1.25000000000000e+00 +0: (3, 0; 3) 0.00000000000000e+00 +0: (3, 0; 4) 0.00000000000000e+00 +0: (3, 0; 5) 0.00000000000000e+00 +0: (3, 0; 6) 0.00000000000000e+00 +0: (3, 0; 7) -2.50000000000000e-01 +0: (3, 0; 8) -2.50000000000000e-01 +0: (4, 0; 0) 4.00000000000000e+00 +0: (4, 0; 1) -1.25000000000000e+00 +0: (4, 0; 2) -1.25000000000000e+00 +0: (4, 0; 3) 0.00000000000000e+00 +0: (4, 0; 4) 0.00000000000000e+00 +0: (4, 0; 5) 0.00000000000000e+00 +0: (4, 0; 6) 0.00000000000000e+00 +0: (4, 0; 7) -2.50000000000000e-01 +0: (4, 0; 8) -2.50000000000000e-01 +0: (0, 1; 0) 4.00000000000000e+00 +0: (0, 1; 1) -1.50000000000000e+00 +0: (0, 1; 2) -1.50000000000000e+00 +0: (0, 1; 3) 0.00000000000000e+00 +0: (0, 1; 4) 0.00000000000000e+00 +0: (0, 1; 5) -2.50000000000000e-01 +0: (0, 1; 6) -2.50000000000000e-01 +0: (0, 1; 7) -2.50000000000000e-01 +0: (0, 1; 8) -2.50000000000000e-01 +0: (1, 1; 0) 4.00000000000000e+00 +0: (1, 1; 1) -1.50000000000000e+00 +0: (1, 1; 2) -1.50000000000000e+00 +0: (1, 1; 3) 0.00000000000000e+00 +0: (1, 1; 4) 0.00000000000000e+00 +0: (1, 1; 5) -2.50000000000000e-01 +0: (1, 1; 6) -2.50000000000000e-01 +0: (1, 1; 7) -2.50000000000000e-01 +0: (1, 1; 8) -2.50000000000000e-01 +0: (2, 1; 0) 4.00000000000000e+00 +0: (2, 1; 1) -1.50000000000000e+00 +0: (2, 1; 2) -1.50000000000000e+00 +0: (2, 1; 3) 0.00000000000000e+00 +0: (2, 1; 4) 0.00000000000000e+00 +0: (2, 1; 5) -2.50000000000000e-01 +0: (2, 1; 6) -2.50000000000000e-01 +0: (2, 1; 7) -2.50000000000000e-01 +0: (2, 1; 8) -2.50000000000000e-01 +0: (3, 1; 0) 4.00000000000000e+00 +0: (3, 1; 1) -1.50000000000000e+00 +0: (3, 1; 2) -1.50000000000000e+00 +0: (3, 1; 3) 0.00000000000000e+00 +0: (3, 1; 4) 0.00000000000000e+00 +0: (3, 1; 5) -2.50000000000000e-01 +0: (3, 1; 6) -2.50000000000000e-01 +0: (3, 1; 7) -2.50000000000000e-01 +0: (3, 1; 8) -2.50000000000000e-01 +0: (4, 1; 0) 4.00000000000000e+00 +0: (4, 1; 1) -1.50000000000000e+00 +0: (4, 1; 2) -1.50000000000000e+00 +0: (4, 1; 3) 0.00000000000000e+00 +0: (4, 1; 4) 0.00000000000000e+00 +0: (4, 1; 5) -2.50000000000000e-01 +0: (4, 1; 6) -2.50000000000000e-01 +0: (4, 1; 7) -2.50000000000000e-01 +0: (4, 1; 8) -2.50000000000000e-01 +0: (0, 2; 0) 4.00000000000000e+00 +0: (0, 2; 1) -1.50000000000000e+00 +0: (0, 2; 2) -1.50000000000000e+00 +0: (0, 2; 3) 0.00000000000000e+00 +0: (0, 2; 4) 0.00000000000000e+00 +0: (0, 2; 5) -2.50000000000000e-01 +0: (0, 2; 6) -2.50000000000000e-01 +0: (0, 2; 7) -2.50000000000000e-01 +0: (0, 2; 8) -2.50000000000000e-01 +0: (1, 2; 0) 4.00000000000000e+00 +0: (1, 2; 1) -1.50000000000000e+00 +0: (1, 2; 2) -1.50000000000000e+00 +0: (1, 2; 3) 0.00000000000000e+00 +0: (1, 2; 4) 0.00000000000000e+00 +0: (1, 2; 5) -2.50000000000000e-01 +0: (1, 2; 6) -2.50000000000000e-01 +0: (1, 2; 7) -2.50000000000000e-01 +0: (1, 2; 8) -2.50000000000000e-01 +0: (2, 2; 0) 4.00000000000000e+00 +0: (2, 2; 1) -1.50000000000000e+00 +0: (2, 2; 2) -1.50000000000000e+00 +0: (2, 2; 3) 0.00000000000000e+00 +0: (2, 2; 4) 0.00000000000000e+00 +0: (2, 2; 5) -2.50000000000000e-01 +0: (2, 2; 6) -2.50000000000000e-01 +0: (2, 2; 7) -2.50000000000000e-01 +0: (2, 2; 8) -2.50000000000000e-01 +0: (3, 2; 0) 4.00000000000000e+00 +0: (3, 2; 1) -1.50000000000000e+00 +0: (3, 2; 2) -1.50000000000000e+00 +0: (3, 2; 3) 0.00000000000000e+00 +0: (3, 2; 4) 0.00000000000000e+00 +0: (3, 2; 5) -2.50000000000000e-01 +0: (3, 2; 6) -2.50000000000000e-01 +0: (3, 2; 7) -2.50000000000000e-01 +0: (3, 2; 8) -2.50000000000000e-01 +0: (4, 2; 0) 4.00000000000000e+00 +0: (4, 2; 1) -1.50000000000000e+00 +0: (4, 2; 2) -1.50000000000000e+00 +0: (4, 2; 3) 0.00000000000000e+00 +0: (4, 2; 4) 0.00000000000000e+00 +0: (4, 2; 5) -2.50000000000000e-01 +0: (4, 2; 6) -2.50000000000000e-01 +0: (4, 2; 7) -2.50000000000000e-01 +0: (4, 2; 8) -2.50000000000000e-01 diff --git a/src/test/TEST_structmat/structmat.saved.2D2.y.4.matmat.00001 b/src/test/TEST_structmat/structmat.saved.2D2.y.4.matmat.00001 new file mode 100644 index 0000000000..570e9939ac --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D2.y.4.matmat.00001 @@ -0,0 +1,168 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (5, 0) x (9, 2) + +Periodic: (10, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (1, -1) +7: (-1, 1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +9 +0: (5, 0; 0) 4.00000000000000e+00 +0: (5, 0; 1) -1.25000000000000e+00 +0: (5, 0; 2) -1.25000000000000e+00 +0: (5, 0; 3) 0.00000000000000e+00 +0: (5, 0; 4) 0.00000000000000e+00 +0: (5, 0; 5) 0.00000000000000e+00 +0: (5, 0; 6) 0.00000000000000e+00 +0: (5, 0; 7) -2.50000000000000e-01 +0: (5, 0; 8) -2.50000000000000e-01 +0: (6, 0; 0) 4.00000000000000e+00 +0: (6, 0; 1) -1.25000000000000e+00 +0: (6, 0; 2) -1.25000000000000e+00 +0: (6, 0; 3) 0.00000000000000e+00 +0: (6, 0; 4) 0.00000000000000e+00 +0: (6, 0; 5) 0.00000000000000e+00 +0: (6, 0; 6) 0.00000000000000e+00 +0: (6, 0; 7) -2.50000000000000e-01 +0: (6, 0; 8) -2.50000000000000e-01 +0: (7, 0; 0) 4.00000000000000e+00 +0: (7, 0; 1) -1.25000000000000e+00 +0: (7, 0; 2) -1.25000000000000e+00 +0: (7, 0; 3) 0.00000000000000e+00 +0: (7, 0; 4) 0.00000000000000e+00 +0: (7, 0; 5) 0.00000000000000e+00 +0: (7, 0; 6) 0.00000000000000e+00 +0: (7, 0; 7) -2.50000000000000e-01 +0: (7, 0; 8) -2.50000000000000e-01 +0: (8, 0; 0) 4.00000000000000e+00 +0: (8, 0; 1) -1.25000000000000e+00 +0: (8, 0; 2) -1.25000000000000e+00 +0: (8, 0; 3) 0.00000000000000e+00 +0: (8, 0; 4) 0.00000000000000e+00 +0: (8, 0; 5) 0.00000000000000e+00 +0: (8, 0; 6) 0.00000000000000e+00 +0: (8, 0; 7) -2.50000000000000e-01 +0: (8, 0; 8) -2.50000000000000e-01 +0: (9, 0; 0) 4.00000000000000e+00 +0: (9, 0; 1) -1.25000000000000e+00 +0: (9, 0; 2) -1.25000000000000e+00 +0: (9, 0; 3) 0.00000000000000e+00 +0: (9, 0; 4) 0.00000000000000e+00 +0: (9, 0; 5) 0.00000000000000e+00 +0: (9, 0; 6) 0.00000000000000e+00 +0: (9, 0; 7) -2.50000000000000e-01 +0: (9, 0; 8) -2.50000000000000e-01 +0: (5, 1; 0) 4.00000000000000e+00 +0: (5, 1; 1) -1.50000000000000e+00 +0: (5, 1; 2) -1.50000000000000e+00 +0: (5, 1; 3) 0.00000000000000e+00 +0: (5, 1; 4) 0.00000000000000e+00 +0: (5, 1; 5) -2.50000000000000e-01 +0: (5, 1; 6) -2.50000000000000e-01 +0: (5, 1; 7) -2.50000000000000e-01 +0: (5, 1; 8) -2.50000000000000e-01 +0: (6, 1; 0) 4.00000000000000e+00 +0: (6, 1; 1) -1.50000000000000e+00 +0: (6, 1; 2) -1.50000000000000e+00 +0: (6, 1; 3) 0.00000000000000e+00 +0: (6, 1; 4) 0.00000000000000e+00 +0: (6, 1; 5) -2.50000000000000e-01 +0: (6, 1; 6) -2.50000000000000e-01 +0: (6, 1; 7) -2.50000000000000e-01 +0: (6, 1; 8) -2.50000000000000e-01 +0: (7, 1; 0) 4.00000000000000e+00 +0: (7, 1; 1) -1.50000000000000e+00 +0: (7, 1; 2) -1.50000000000000e+00 +0: (7, 1; 3) 0.00000000000000e+00 +0: (7, 1; 4) 0.00000000000000e+00 +0: (7, 1; 5) -2.50000000000000e-01 +0: (7, 1; 6) -2.50000000000000e-01 +0: (7, 1; 7) -2.50000000000000e-01 +0: (7, 1; 8) -2.50000000000000e-01 +0: (8, 1; 0) 4.00000000000000e+00 +0: (8, 1; 1) -1.50000000000000e+00 +0: (8, 1; 2) -1.50000000000000e+00 +0: (8, 1; 3) 0.00000000000000e+00 +0: (8, 1; 4) 0.00000000000000e+00 +0: (8, 1; 5) -2.50000000000000e-01 +0: (8, 1; 6) -2.50000000000000e-01 +0: (8, 1; 7) -2.50000000000000e-01 +0: (8, 1; 8) -2.50000000000000e-01 +0: (9, 1; 0) 4.00000000000000e+00 +0: (9, 1; 1) -1.50000000000000e+00 +0: (9, 1; 2) -1.50000000000000e+00 +0: (9, 1; 3) 0.00000000000000e+00 +0: (9, 1; 4) 0.00000000000000e+00 +0: (9, 1; 5) -2.50000000000000e-01 +0: (9, 1; 6) -2.50000000000000e-01 +0: (9, 1; 7) -2.50000000000000e-01 +0: (9, 1; 8) -2.50000000000000e-01 +0: (5, 2; 0) 4.00000000000000e+00 +0: (5, 2; 1) -1.50000000000000e+00 +0: (5, 2; 2) -1.50000000000000e+00 +0: (5, 2; 3) 0.00000000000000e+00 +0: (5, 2; 4) 0.00000000000000e+00 +0: (5, 2; 5) -2.50000000000000e-01 +0: (5, 2; 6) -2.50000000000000e-01 +0: (5, 2; 7) -2.50000000000000e-01 +0: (5, 2; 8) -2.50000000000000e-01 +0: (6, 2; 0) 4.00000000000000e+00 +0: (6, 2; 1) -1.50000000000000e+00 +0: (6, 2; 2) -1.50000000000000e+00 +0: (6, 2; 3) 0.00000000000000e+00 +0: (6, 2; 4) 0.00000000000000e+00 +0: (6, 2; 5) -2.50000000000000e-01 +0: (6, 2; 6) -2.50000000000000e-01 +0: (6, 2; 7) -2.50000000000000e-01 +0: (6, 2; 8) -2.50000000000000e-01 +0: (7, 2; 0) 4.00000000000000e+00 +0: (7, 2; 1) -1.50000000000000e+00 +0: (7, 2; 2) -1.50000000000000e+00 +0: (7, 2; 3) 0.00000000000000e+00 +0: (7, 2; 4) 0.00000000000000e+00 +0: (7, 2; 5) -2.50000000000000e-01 +0: (7, 2; 6) -2.50000000000000e-01 +0: (7, 2; 7) -2.50000000000000e-01 +0: (7, 2; 8) -2.50000000000000e-01 +0: (8, 2; 0) 4.00000000000000e+00 +0: (8, 2; 1) -1.50000000000000e+00 +0: (8, 2; 2) -1.50000000000000e+00 +0: (8, 2; 3) 0.00000000000000e+00 +0: (8, 2; 4) 0.00000000000000e+00 +0: (8, 2; 5) -2.50000000000000e-01 +0: (8, 2; 6) -2.50000000000000e-01 +0: (8, 2; 7) -2.50000000000000e-01 +0: (8, 2; 8) -2.50000000000000e-01 +0: (9, 2; 0) 4.00000000000000e+00 +0: (9, 2; 1) -1.50000000000000e+00 +0: (9, 2; 2) -1.50000000000000e+00 +0: (9, 2; 3) 0.00000000000000e+00 +0: (9, 2; 4) 0.00000000000000e+00 +0: (9, 2; 5) -2.50000000000000e-01 +0: (9, 2; 6) -2.50000000000000e-01 +0: (9, 2; 7) -2.50000000000000e-01 +0: (9, 2; 8) -2.50000000000000e-01 diff --git a/src/test/TEST_structmat/structmat.saved.2D2.y.4.matmat.00002 b/src/test/TEST_structmat/structmat.saved.2D2.y.4.matmat.00002 new file mode 100644 index 0000000000..29d492e6c8 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D2.y.4.matmat.00002 @@ -0,0 +1,123 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (0, 3) x (4, 4) + +Periodic: (10, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (1, -1) +7: (-1, 1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +9 +0: (0, 3; 0) 4.00000000000000e+00 +0: (0, 3; 1) -1.50000000000000e+00 +0: (0, 3; 2) -1.50000000000000e+00 +0: (0, 3; 3) 0.00000000000000e+00 +0: (0, 3; 4) 0.00000000000000e+00 +0: (0, 3; 5) -2.50000000000000e-01 +0: (0, 3; 6) -2.50000000000000e-01 +0: (0, 3; 7) -2.50000000000000e-01 +0: (0, 3; 8) -2.50000000000000e-01 +0: (1, 3; 0) 4.00000000000000e+00 +0: (1, 3; 1) -1.50000000000000e+00 +0: (1, 3; 2) -1.50000000000000e+00 +0: (1, 3; 3) 0.00000000000000e+00 +0: (1, 3; 4) 0.00000000000000e+00 +0: (1, 3; 5) -2.50000000000000e-01 +0: (1, 3; 6) -2.50000000000000e-01 +0: (1, 3; 7) -2.50000000000000e-01 +0: (1, 3; 8) -2.50000000000000e-01 +0: (2, 3; 0) 4.00000000000000e+00 +0: (2, 3; 1) -1.50000000000000e+00 +0: (2, 3; 2) -1.50000000000000e+00 +0: (2, 3; 3) 0.00000000000000e+00 +0: (2, 3; 4) 0.00000000000000e+00 +0: (2, 3; 5) -2.50000000000000e-01 +0: (2, 3; 6) -2.50000000000000e-01 +0: (2, 3; 7) -2.50000000000000e-01 +0: (2, 3; 8) -2.50000000000000e-01 +0: (3, 3; 0) 4.00000000000000e+00 +0: (3, 3; 1) -1.50000000000000e+00 +0: (3, 3; 2) -1.50000000000000e+00 +0: (3, 3; 3) 0.00000000000000e+00 +0: (3, 3; 4) 0.00000000000000e+00 +0: (3, 3; 5) -2.50000000000000e-01 +0: (3, 3; 6) -2.50000000000000e-01 +0: (3, 3; 7) -2.50000000000000e-01 +0: (3, 3; 8) -2.50000000000000e-01 +0: (4, 3; 0) 4.00000000000000e+00 +0: (4, 3; 1) -1.50000000000000e+00 +0: (4, 3; 2) -1.50000000000000e+00 +0: (4, 3; 3) 0.00000000000000e+00 +0: (4, 3; 4) 0.00000000000000e+00 +0: (4, 3; 5) -2.50000000000000e-01 +0: (4, 3; 6) -2.50000000000000e-01 +0: (4, 3; 7) -2.50000000000000e-01 +0: (4, 3; 8) -2.50000000000000e-01 +0: (0, 4; 0) 4.00000000000000e+00 +0: (0, 4; 1) -1.50000000000000e+00 +0: (0, 4; 2) -1.50000000000000e+00 +0: (0, 4; 3) 0.00000000000000e+00 +0: (0, 4; 4) 0.00000000000000e+00 +0: (0, 4; 5) -2.50000000000000e-01 +0: (0, 4; 6) -2.50000000000000e-01 +0: (0, 4; 7) 0.00000000000000e+00 +0: (0, 4; 8) 0.00000000000000e+00 +0: (1, 4; 0) 4.00000000000000e+00 +0: (1, 4; 1) -1.50000000000000e+00 +0: (1, 4; 2) -1.50000000000000e+00 +0: (1, 4; 3) 0.00000000000000e+00 +0: (1, 4; 4) 0.00000000000000e+00 +0: (1, 4; 5) -2.50000000000000e-01 +0: (1, 4; 6) -2.50000000000000e-01 +0: (1, 4; 7) 0.00000000000000e+00 +0: (1, 4; 8) 0.00000000000000e+00 +0: (2, 4; 0) 4.00000000000000e+00 +0: (2, 4; 1) -1.50000000000000e+00 +0: (2, 4; 2) -1.50000000000000e+00 +0: (2, 4; 3) 0.00000000000000e+00 +0: (2, 4; 4) 0.00000000000000e+00 +0: (2, 4; 5) -2.50000000000000e-01 +0: (2, 4; 6) -2.50000000000000e-01 +0: (2, 4; 7) 0.00000000000000e+00 +0: (2, 4; 8) 0.00000000000000e+00 +0: (3, 4; 0) 4.00000000000000e+00 +0: (3, 4; 1) -1.50000000000000e+00 +0: (3, 4; 2) -1.50000000000000e+00 +0: (3, 4; 3) 0.00000000000000e+00 +0: (3, 4; 4) 0.00000000000000e+00 +0: (3, 4; 5) -2.50000000000000e-01 +0: (3, 4; 6) -2.50000000000000e-01 +0: (3, 4; 7) 0.00000000000000e+00 +0: (3, 4; 8) 0.00000000000000e+00 +0: (4, 4; 0) 4.00000000000000e+00 +0: (4, 4; 1) -1.50000000000000e+00 +0: (4, 4; 2) -1.50000000000000e+00 +0: (4, 4; 3) 0.00000000000000e+00 +0: (4, 4; 4) 0.00000000000000e+00 +0: (4, 4; 5) -2.50000000000000e-01 +0: (4, 4; 6) -2.50000000000000e-01 +0: (4, 4; 7) 0.00000000000000e+00 +0: (4, 4; 8) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D2.y.4.matmat.00003 b/src/test/TEST_structmat/structmat.saved.2D2.y.4.matmat.00003 new file mode 100644 index 0000000000..50da4520f0 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D2.y.4.matmat.00003 @@ -0,0 +1,123 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (5, 3) x (9, 4) + +Periodic: (10, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (1, -1) +7: (-1, 1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +9 +0: (5, 3; 0) 4.00000000000000e+00 +0: (5, 3; 1) -1.50000000000000e+00 +0: (5, 3; 2) -1.50000000000000e+00 +0: (5, 3; 3) 0.00000000000000e+00 +0: (5, 3; 4) 0.00000000000000e+00 +0: (5, 3; 5) -2.50000000000000e-01 +0: (5, 3; 6) -2.50000000000000e-01 +0: (5, 3; 7) -2.50000000000000e-01 +0: (5, 3; 8) -2.50000000000000e-01 +0: (6, 3; 0) 4.00000000000000e+00 +0: (6, 3; 1) -1.50000000000000e+00 +0: (6, 3; 2) -1.50000000000000e+00 +0: (6, 3; 3) 0.00000000000000e+00 +0: (6, 3; 4) 0.00000000000000e+00 +0: (6, 3; 5) -2.50000000000000e-01 +0: (6, 3; 6) -2.50000000000000e-01 +0: (6, 3; 7) -2.50000000000000e-01 +0: (6, 3; 8) -2.50000000000000e-01 +0: (7, 3; 0) 4.00000000000000e+00 +0: (7, 3; 1) -1.50000000000000e+00 +0: (7, 3; 2) -1.50000000000000e+00 +0: (7, 3; 3) 0.00000000000000e+00 +0: (7, 3; 4) 0.00000000000000e+00 +0: (7, 3; 5) -2.50000000000000e-01 +0: (7, 3; 6) -2.50000000000000e-01 +0: (7, 3; 7) -2.50000000000000e-01 +0: (7, 3; 8) -2.50000000000000e-01 +0: (8, 3; 0) 4.00000000000000e+00 +0: (8, 3; 1) -1.50000000000000e+00 +0: (8, 3; 2) -1.50000000000000e+00 +0: (8, 3; 3) 0.00000000000000e+00 +0: (8, 3; 4) 0.00000000000000e+00 +0: (8, 3; 5) -2.50000000000000e-01 +0: (8, 3; 6) -2.50000000000000e-01 +0: (8, 3; 7) -2.50000000000000e-01 +0: (8, 3; 8) -2.50000000000000e-01 +0: (9, 3; 0) 4.00000000000000e+00 +0: (9, 3; 1) -1.50000000000000e+00 +0: (9, 3; 2) -1.50000000000000e+00 +0: (9, 3; 3) 0.00000000000000e+00 +0: (9, 3; 4) 0.00000000000000e+00 +0: (9, 3; 5) -2.50000000000000e-01 +0: (9, 3; 6) -2.50000000000000e-01 +0: (9, 3; 7) -2.50000000000000e-01 +0: (9, 3; 8) -2.50000000000000e-01 +0: (5, 4; 0) 4.00000000000000e+00 +0: (5, 4; 1) -1.50000000000000e+00 +0: (5, 4; 2) -1.50000000000000e+00 +0: (5, 4; 3) 0.00000000000000e+00 +0: (5, 4; 4) 0.00000000000000e+00 +0: (5, 4; 5) -2.50000000000000e-01 +0: (5, 4; 6) -2.50000000000000e-01 +0: (5, 4; 7) 0.00000000000000e+00 +0: (5, 4; 8) 0.00000000000000e+00 +0: (6, 4; 0) 4.00000000000000e+00 +0: (6, 4; 1) -1.50000000000000e+00 +0: (6, 4; 2) -1.50000000000000e+00 +0: (6, 4; 3) 0.00000000000000e+00 +0: (6, 4; 4) 0.00000000000000e+00 +0: (6, 4; 5) -2.50000000000000e-01 +0: (6, 4; 6) -2.50000000000000e-01 +0: (6, 4; 7) 0.00000000000000e+00 +0: (6, 4; 8) 0.00000000000000e+00 +0: (7, 4; 0) 4.00000000000000e+00 +0: (7, 4; 1) -1.50000000000000e+00 +0: (7, 4; 2) -1.50000000000000e+00 +0: (7, 4; 3) 0.00000000000000e+00 +0: (7, 4; 4) 0.00000000000000e+00 +0: (7, 4; 5) -2.50000000000000e-01 +0: (7, 4; 6) -2.50000000000000e-01 +0: (7, 4; 7) 0.00000000000000e+00 +0: (7, 4; 8) 0.00000000000000e+00 +0: (8, 4; 0) 4.00000000000000e+00 +0: (8, 4; 1) -1.50000000000000e+00 +0: (8, 4; 2) -1.50000000000000e+00 +0: (8, 4; 3) 0.00000000000000e+00 +0: (8, 4; 4) 0.00000000000000e+00 +0: (8, 4; 5) -2.50000000000000e-01 +0: (8, 4; 6) -2.50000000000000e-01 +0: (8, 4; 7) 0.00000000000000e+00 +0: (8, 4; 8) 0.00000000000000e+00 +0: (9, 4; 0) 4.00000000000000e+00 +0: (9, 4; 1) -1.50000000000000e+00 +0: (9, 4; 2) -1.50000000000000e+00 +0: (9, 4; 3) 0.00000000000000e+00 +0: (9, 4; 4) 0.00000000000000e+00 +0: (9, 4; 5) -2.50000000000000e-01 +0: (9, 4; 6) -2.50000000000000e-01 +0: (9, 4; 7) 0.00000000000000e+00 +0: (9, 4; 8) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D2.y.matmat.00000 b/src/test/TEST_structmat/structmat.saved.2D2.y.matmat.00000 new file mode 100644 index 0000000000..d3fcc1e8e8 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D2.y.matmat.00000 @@ -0,0 +1,483 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 0 + +Grid: +2 +1 +0: (0, 0) x (9, 4) + +Periodic: (10, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (1, -1) +7: (-1, 1) +8: (1, 1) + +Constant Data: +0 + +Variable Data: +9 +0: (0, 0; 0) 4.00000000000000e+00 +0: (0, 0; 1) -1.25000000000000e+00 +0: (0, 0; 2) -1.25000000000000e+00 +0: (0, 0; 3) 0.00000000000000e+00 +0: (0, 0; 4) 0.00000000000000e+00 +0: (0, 0; 5) 0.00000000000000e+00 +0: (0, 0; 6) 0.00000000000000e+00 +0: (0, 0; 7) -2.50000000000000e-01 +0: (0, 0; 8) -2.50000000000000e-01 +0: (1, 0; 0) 4.00000000000000e+00 +0: (1, 0; 1) -1.25000000000000e+00 +0: (1, 0; 2) -1.25000000000000e+00 +0: (1, 0; 3) 0.00000000000000e+00 +0: (1, 0; 4) 0.00000000000000e+00 +0: (1, 0; 5) 0.00000000000000e+00 +0: (1, 0; 6) 0.00000000000000e+00 +0: (1, 0; 7) -2.50000000000000e-01 +0: (1, 0; 8) -2.50000000000000e-01 +0: (2, 0; 0) 4.00000000000000e+00 +0: (2, 0; 1) -1.25000000000000e+00 +0: (2, 0; 2) -1.25000000000000e+00 +0: (2, 0; 3) 0.00000000000000e+00 +0: (2, 0; 4) 0.00000000000000e+00 +0: (2, 0; 5) 0.00000000000000e+00 +0: (2, 0; 6) 0.00000000000000e+00 +0: (2, 0; 7) -2.50000000000000e-01 +0: (2, 0; 8) -2.50000000000000e-01 +0: (3, 0; 0) 4.00000000000000e+00 +0: (3, 0; 1) -1.25000000000000e+00 +0: (3, 0; 2) -1.25000000000000e+00 +0: (3, 0; 3) 0.00000000000000e+00 +0: (3, 0; 4) 0.00000000000000e+00 +0: (3, 0; 5) 0.00000000000000e+00 +0: (3, 0; 6) 0.00000000000000e+00 +0: (3, 0; 7) -2.50000000000000e-01 +0: (3, 0; 8) -2.50000000000000e-01 +0: (4, 0; 0) 4.00000000000000e+00 +0: (4, 0; 1) -1.25000000000000e+00 +0: (4, 0; 2) -1.25000000000000e+00 +0: (4, 0; 3) 0.00000000000000e+00 +0: (4, 0; 4) 0.00000000000000e+00 +0: (4, 0; 5) 0.00000000000000e+00 +0: (4, 0; 6) 0.00000000000000e+00 +0: (4, 0; 7) -2.50000000000000e-01 +0: (4, 0; 8) -2.50000000000000e-01 +0: (5, 0; 0) 4.00000000000000e+00 +0: (5, 0; 1) -1.25000000000000e+00 +0: (5, 0; 2) -1.25000000000000e+00 +0: (5, 0; 3) 0.00000000000000e+00 +0: (5, 0; 4) 0.00000000000000e+00 +0: (5, 0; 5) 0.00000000000000e+00 +0: (5, 0; 6) 0.00000000000000e+00 +0: (5, 0; 7) -2.50000000000000e-01 +0: (5, 0; 8) -2.50000000000000e-01 +0: (6, 0; 0) 4.00000000000000e+00 +0: (6, 0; 1) -1.25000000000000e+00 +0: (6, 0; 2) -1.25000000000000e+00 +0: (6, 0; 3) 0.00000000000000e+00 +0: (6, 0; 4) 0.00000000000000e+00 +0: (6, 0; 5) 0.00000000000000e+00 +0: (6, 0; 6) 0.00000000000000e+00 +0: (6, 0; 7) -2.50000000000000e-01 +0: (6, 0; 8) -2.50000000000000e-01 +0: (7, 0; 0) 4.00000000000000e+00 +0: (7, 0; 1) -1.25000000000000e+00 +0: (7, 0; 2) -1.25000000000000e+00 +0: (7, 0; 3) 0.00000000000000e+00 +0: (7, 0; 4) 0.00000000000000e+00 +0: (7, 0; 5) 0.00000000000000e+00 +0: (7, 0; 6) 0.00000000000000e+00 +0: (7, 0; 7) -2.50000000000000e-01 +0: (7, 0; 8) -2.50000000000000e-01 +0: (8, 0; 0) 4.00000000000000e+00 +0: (8, 0; 1) -1.25000000000000e+00 +0: (8, 0; 2) -1.25000000000000e+00 +0: (8, 0; 3) 0.00000000000000e+00 +0: (8, 0; 4) 0.00000000000000e+00 +0: (8, 0; 5) 0.00000000000000e+00 +0: (8, 0; 6) 0.00000000000000e+00 +0: (8, 0; 7) -2.50000000000000e-01 +0: (8, 0; 8) -2.50000000000000e-01 +0: (9, 0; 0) 4.00000000000000e+00 +0: (9, 0; 1) -1.25000000000000e+00 +0: (9, 0; 2) -1.25000000000000e+00 +0: (9, 0; 3) 0.00000000000000e+00 +0: (9, 0; 4) 0.00000000000000e+00 +0: (9, 0; 5) 0.00000000000000e+00 +0: (9, 0; 6) 0.00000000000000e+00 +0: (9, 0; 7) -2.50000000000000e-01 +0: (9, 0; 8) -2.50000000000000e-01 +0: (0, 1; 0) 4.00000000000000e+00 +0: (0, 1; 1) -1.50000000000000e+00 +0: (0, 1; 2) -1.50000000000000e+00 +0: (0, 1; 3) 0.00000000000000e+00 +0: (0, 1; 4) 0.00000000000000e+00 +0: (0, 1; 5) -2.50000000000000e-01 +0: (0, 1; 6) -2.50000000000000e-01 +0: (0, 1; 7) -2.50000000000000e-01 +0: (0, 1; 8) -2.50000000000000e-01 +0: (1, 1; 0) 4.00000000000000e+00 +0: (1, 1; 1) -1.50000000000000e+00 +0: (1, 1; 2) -1.50000000000000e+00 +0: (1, 1; 3) 0.00000000000000e+00 +0: (1, 1; 4) 0.00000000000000e+00 +0: (1, 1; 5) -2.50000000000000e-01 +0: (1, 1; 6) -2.50000000000000e-01 +0: (1, 1; 7) -2.50000000000000e-01 +0: (1, 1; 8) -2.50000000000000e-01 +0: (2, 1; 0) 4.00000000000000e+00 +0: (2, 1; 1) -1.50000000000000e+00 +0: (2, 1; 2) -1.50000000000000e+00 +0: (2, 1; 3) 0.00000000000000e+00 +0: (2, 1; 4) 0.00000000000000e+00 +0: (2, 1; 5) -2.50000000000000e-01 +0: (2, 1; 6) -2.50000000000000e-01 +0: (2, 1; 7) -2.50000000000000e-01 +0: (2, 1; 8) -2.50000000000000e-01 +0: (3, 1; 0) 4.00000000000000e+00 +0: (3, 1; 1) -1.50000000000000e+00 +0: (3, 1; 2) -1.50000000000000e+00 +0: (3, 1; 3) 0.00000000000000e+00 +0: (3, 1; 4) 0.00000000000000e+00 +0: (3, 1; 5) -2.50000000000000e-01 +0: (3, 1; 6) -2.50000000000000e-01 +0: (3, 1; 7) -2.50000000000000e-01 +0: (3, 1; 8) -2.50000000000000e-01 +0: (4, 1; 0) 4.00000000000000e+00 +0: (4, 1; 1) -1.50000000000000e+00 +0: (4, 1; 2) -1.50000000000000e+00 +0: (4, 1; 3) 0.00000000000000e+00 +0: (4, 1; 4) 0.00000000000000e+00 +0: (4, 1; 5) -2.50000000000000e-01 +0: (4, 1; 6) -2.50000000000000e-01 +0: (4, 1; 7) -2.50000000000000e-01 +0: (4, 1; 8) -2.50000000000000e-01 +0: (5, 1; 0) 4.00000000000000e+00 +0: (5, 1; 1) -1.50000000000000e+00 +0: (5, 1; 2) -1.50000000000000e+00 +0: (5, 1; 3) 0.00000000000000e+00 +0: (5, 1; 4) 0.00000000000000e+00 +0: (5, 1; 5) -2.50000000000000e-01 +0: (5, 1; 6) -2.50000000000000e-01 +0: (5, 1; 7) -2.50000000000000e-01 +0: (5, 1; 8) -2.50000000000000e-01 +0: (6, 1; 0) 4.00000000000000e+00 +0: (6, 1; 1) -1.50000000000000e+00 +0: (6, 1; 2) -1.50000000000000e+00 +0: (6, 1; 3) 0.00000000000000e+00 +0: (6, 1; 4) 0.00000000000000e+00 +0: (6, 1; 5) -2.50000000000000e-01 +0: (6, 1; 6) -2.50000000000000e-01 +0: (6, 1; 7) -2.50000000000000e-01 +0: (6, 1; 8) -2.50000000000000e-01 +0: (7, 1; 0) 4.00000000000000e+00 +0: (7, 1; 1) -1.50000000000000e+00 +0: (7, 1; 2) -1.50000000000000e+00 +0: (7, 1; 3) 0.00000000000000e+00 +0: (7, 1; 4) 0.00000000000000e+00 +0: (7, 1; 5) -2.50000000000000e-01 +0: (7, 1; 6) -2.50000000000000e-01 +0: (7, 1; 7) -2.50000000000000e-01 +0: (7, 1; 8) -2.50000000000000e-01 +0: (8, 1; 0) 4.00000000000000e+00 +0: (8, 1; 1) -1.50000000000000e+00 +0: (8, 1; 2) -1.50000000000000e+00 +0: (8, 1; 3) 0.00000000000000e+00 +0: (8, 1; 4) 0.00000000000000e+00 +0: (8, 1; 5) -2.50000000000000e-01 +0: (8, 1; 6) -2.50000000000000e-01 +0: (8, 1; 7) -2.50000000000000e-01 +0: (8, 1; 8) -2.50000000000000e-01 +0: (9, 1; 0) 4.00000000000000e+00 +0: (9, 1; 1) -1.50000000000000e+00 +0: (9, 1; 2) -1.50000000000000e+00 +0: (9, 1; 3) 0.00000000000000e+00 +0: (9, 1; 4) 0.00000000000000e+00 +0: (9, 1; 5) -2.50000000000000e-01 +0: (9, 1; 6) -2.50000000000000e-01 +0: (9, 1; 7) -2.50000000000000e-01 +0: (9, 1; 8) -2.50000000000000e-01 +0: (0, 2; 0) 4.00000000000000e+00 +0: (0, 2; 1) -1.50000000000000e+00 +0: (0, 2; 2) -1.50000000000000e+00 +0: (0, 2; 3) 0.00000000000000e+00 +0: (0, 2; 4) 0.00000000000000e+00 +0: (0, 2; 5) -2.50000000000000e-01 +0: (0, 2; 6) -2.50000000000000e-01 +0: (0, 2; 7) -2.50000000000000e-01 +0: (0, 2; 8) -2.50000000000000e-01 +0: (1, 2; 0) 4.00000000000000e+00 +0: (1, 2; 1) -1.50000000000000e+00 +0: (1, 2; 2) -1.50000000000000e+00 +0: (1, 2; 3) 0.00000000000000e+00 +0: (1, 2; 4) 0.00000000000000e+00 +0: (1, 2; 5) -2.50000000000000e-01 +0: (1, 2; 6) -2.50000000000000e-01 +0: (1, 2; 7) -2.50000000000000e-01 +0: (1, 2; 8) -2.50000000000000e-01 +0: (2, 2; 0) 4.00000000000000e+00 +0: (2, 2; 1) -1.50000000000000e+00 +0: (2, 2; 2) -1.50000000000000e+00 +0: (2, 2; 3) 0.00000000000000e+00 +0: (2, 2; 4) 0.00000000000000e+00 +0: (2, 2; 5) -2.50000000000000e-01 +0: (2, 2; 6) -2.50000000000000e-01 +0: (2, 2; 7) -2.50000000000000e-01 +0: (2, 2; 8) -2.50000000000000e-01 +0: (3, 2; 0) 4.00000000000000e+00 +0: (3, 2; 1) -1.50000000000000e+00 +0: (3, 2; 2) -1.50000000000000e+00 +0: (3, 2; 3) 0.00000000000000e+00 +0: (3, 2; 4) 0.00000000000000e+00 +0: (3, 2; 5) -2.50000000000000e-01 +0: (3, 2; 6) -2.50000000000000e-01 +0: (3, 2; 7) -2.50000000000000e-01 +0: (3, 2; 8) -2.50000000000000e-01 +0: (4, 2; 0) 4.00000000000000e+00 +0: (4, 2; 1) -1.50000000000000e+00 +0: (4, 2; 2) -1.50000000000000e+00 +0: (4, 2; 3) 0.00000000000000e+00 +0: (4, 2; 4) 0.00000000000000e+00 +0: (4, 2; 5) -2.50000000000000e-01 +0: (4, 2; 6) -2.50000000000000e-01 +0: (4, 2; 7) -2.50000000000000e-01 +0: (4, 2; 8) -2.50000000000000e-01 +0: (5, 2; 0) 4.00000000000000e+00 +0: (5, 2; 1) -1.50000000000000e+00 +0: (5, 2; 2) -1.50000000000000e+00 +0: (5, 2; 3) 0.00000000000000e+00 +0: (5, 2; 4) 0.00000000000000e+00 +0: (5, 2; 5) -2.50000000000000e-01 +0: (5, 2; 6) -2.50000000000000e-01 +0: (5, 2; 7) -2.50000000000000e-01 +0: (5, 2; 8) -2.50000000000000e-01 +0: (6, 2; 0) 4.00000000000000e+00 +0: (6, 2; 1) -1.50000000000000e+00 +0: (6, 2; 2) -1.50000000000000e+00 +0: (6, 2; 3) 0.00000000000000e+00 +0: (6, 2; 4) 0.00000000000000e+00 +0: (6, 2; 5) -2.50000000000000e-01 +0: (6, 2; 6) -2.50000000000000e-01 +0: (6, 2; 7) -2.50000000000000e-01 +0: (6, 2; 8) -2.50000000000000e-01 +0: (7, 2; 0) 4.00000000000000e+00 +0: (7, 2; 1) -1.50000000000000e+00 +0: (7, 2; 2) -1.50000000000000e+00 +0: (7, 2; 3) 0.00000000000000e+00 +0: (7, 2; 4) 0.00000000000000e+00 +0: (7, 2; 5) -2.50000000000000e-01 +0: (7, 2; 6) -2.50000000000000e-01 +0: (7, 2; 7) -2.50000000000000e-01 +0: (7, 2; 8) -2.50000000000000e-01 +0: (8, 2; 0) 4.00000000000000e+00 +0: (8, 2; 1) -1.50000000000000e+00 +0: (8, 2; 2) -1.50000000000000e+00 +0: (8, 2; 3) 0.00000000000000e+00 +0: (8, 2; 4) 0.00000000000000e+00 +0: (8, 2; 5) -2.50000000000000e-01 +0: (8, 2; 6) -2.50000000000000e-01 +0: (8, 2; 7) -2.50000000000000e-01 +0: (8, 2; 8) -2.50000000000000e-01 +0: (9, 2; 0) 4.00000000000000e+00 +0: (9, 2; 1) -1.50000000000000e+00 +0: (9, 2; 2) -1.50000000000000e+00 +0: (9, 2; 3) 0.00000000000000e+00 +0: (9, 2; 4) 0.00000000000000e+00 +0: (9, 2; 5) -2.50000000000000e-01 +0: (9, 2; 6) -2.50000000000000e-01 +0: (9, 2; 7) -2.50000000000000e-01 +0: (9, 2; 8) -2.50000000000000e-01 +0: (0, 3; 0) 4.00000000000000e+00 +0: (0, 3; 1) -1.50000000000000e+00 +0: (0, 3; 2) -1.50000000000000e+00 +0: (0, 3; 3) 0.00000000000000e+00 +0: (0, 3; 4) 0.00000000000000e+00 +0: (0, 3; 5) -2.50000000000000e-01 +0: (0, 3; 6) -2.50000000000000e-01 +0: (0, 3; 7) -2.50000000000000e-01 +0: (0, 3; 8) -2.50000000000000e-01 +0: (1, 3; 0) 4.00000000000000e+00 +0: (1, 3; 1) -1.50000000000000e+00 +0: (1, 3; 2) -1.50000000000000e+00 +0: (1, 3; 3) 0.00000000000000e+00 +0: (1, 3; 4) 0.00000000000000e+00 +0: (1, 3; 5) -2.50000000000000e-01 +0: (1, 3; 6) -2.50000000000000e-01 +0: (1, 3; 7) -2.50000000000000e-01 +0: (1, 3; 8) -2.50000000000000e-01 +0: (2, 3; 0) 4.00000000000000e+00 +0: (2, 3; 1) -1.50000000000000e+00 +0: (2, 3; 2) -1.50000000000000e+00 +0: (2, 3; 3) 0.00000000000000e+00 +0: (2, 3; 4) 0.00000000000000e+00 +0: (2, 3; 5) -2.50000000000000e-01 +0: (2, 3; 6) -2.50000000000000e-01 +0: (2, 3; 7) -2.50000000000000e-01 +0: (2, 3; 8) -2.50000000000000e-01 +0: (3, 3; 0) 4.00000000000000e+00 +0: (3, 3; 1) -1.50000000000000e+00 +0: (3, 3; 2) -1.50000000000000e+00 +0: (3, 3; 3) 0.00000000000000e+00 +0: (3, 3; 4) 0.00000000000000e+00 +0: (3, 3; 5) -2.50000000000000e-01 +0: (3, 3; 6) -2.50000000000000e-01 +0: (3, 3; 7) -2.50000000000000e-01 +0: (3, 3; 8) -2.50000000000000e-01 +0: (4, 3; 0) 4.00000000000000e+00 +0: (4, 3; 1) -1.50000000000000e+00 +0: (4, 3; 2) -1.50000000000000e+00 +0: (4, 3; 3) 0.00000000000000e+00 +0: (4, 3; 4) 0.00000000000000e+00 +0: (4, 3; 5) -2.50000000000000e-01 +0: (4, 3; 6) -2.50000000000000e-01 +0: (4, 3; 7) -2.50000000000000e-01 +0: (4, 3; 8) -2.50000000000000e-01 +0: (5, 3; 0) 4.00000000000000e+00 +0: (5, 3; 1) -1.50000000000000e+00 +0: (5, 3; 2) -1.50000000000000e+00 +0: (5, 3; 3) 0.00000000000000e+00 +0: (5, 3; 4) 0.00000000000000e+00 +0: (5, 3; 5) -2.50000000000000e-01 +0: (5, 3; 6) -2.50000000000000e-01 +0: (5, 3; 7) -2.50000000000000e-01 +0: (5, 3; 8) -2.50000000000000e-01 +0: (6, 3; 0) 4.00000000000000e+00 +0: (6, 3; 1) -1.50000000000000e+00 +0: (6, 3; 2) -1.50000000000000e+00 +0: (6, 3; 3) 0.00000000000000e+00 +0: (6, 3; 4) 0.00000000000000e+00 +0: (6, 3; 5) -2.50000000000000e-01 +0: (6, 3; 6) -2.50000000000000e-01 +0: (6, 3; 7) -2.50000000000000e-01 +0: (6, 3; 8) -2.50000000000000e-01 +0: (7, 3; 0) 4.00000000000000e+00 +0: (7, 3; 1) -1.50000000000000e+00 +0: (7, 3; 2) -1.50000000000000e+00 +0: (7, 3; 3) 0.00000000000000e+00 +0: (7, 3; 4) 0.00000000000000e+00 +0: (7, 3; 5) -2.50000000000000e-01 +0: (7, 3; 6) -2.50000000000000e-01 +0: (7, 3; 7) -2.50000000000000e-01 +0: (7, 3; 8) -2.50000000000000e-01 +0: (8, 3; 0) 4.00000000000000e+00 +0: (8, 3; 1) -1.50000000000000e+00 +0: (8, 3; 2) -1.50000000000000e+00 +0: (8, 3; 3) 0.00000000000000e+00 +0: (8, 3; 4) 0.00000000000000e+00 +0: (8, 3; 5) -2.50000000000000e-01 +0: (8, 3; 6) -2.50000000000000e-01 +0: (8, 3; 7) -2.50000000000000e-01 +0: (8, 3; 8) -2.50000000000000e-01 +0: (9, 3; 0) 4.00000000000000e+00 +0: (9, 3; 1) -1.50000000000000e+00 +0: (9, 3; 2) -1.50000000000000e+00 +0: (9, 3; 3) 0.00000000000000e+00 +0: (9, 3; 4) 0.00000000000000e+00 +0: (9, 3; 5) -2.50000000000000e-01 +0: (9, 3; 6) -2.50000000000000e-01 +0: (9, 3; 7) -2.50000000000000e-01 +0: (9, 3; 8) -2.50000000000000e-01 +0: (0, 4; 0) 4.00000000000000e+00 +0: (0, 4; 1) -1.50000000000000e+00 +0: (0, 4; 2) -1.50000000000000e+00 +0: (0, 4; 3) 0.00000000000000e+00 +0: (0, 4; 4) 0.00000000000000e+00 +0: (0, 4; 5) -2.50000000000000e-01 +0: (0, 4; 6) -2.50000000000000e-01 +0: (0, 4; 7) 0.00000000000000e+00 +0: (0, 4; 8) 0.00000000000000e+00 +0: (1, 4; 0) 4.00000000000000e+00 +0: (1, 4; 1) -1.50000000000000e+00 +0: (1, 4; 2) -1.50000000000000e+00 +0: (1, 4; 3) 0.00000000000000e+00 +0: (1, 4; 4) 0.00000000000000e+00 +0: (1, 4; 5) -2.50000000000000e-01 +0: (1, 4; 6) -2.50000000000000e-01 +0: (1, 4; 7) 0.00000000000000e+00 +0: (1, 4; 8) 0.00000000000000e+00 +0: (2, 4; 0) 4.00000000000000e+00 +0: (2, 4; 1) -1.50000000000000e+00 +0: (2, 4; 2) -1.50000000000000e+00 +0: (2, 4; 3) 0.00000000000000e+00 +0: (2, 4; 4) 0.00000000000000e+00 +0: (2, 4; 5) -2.50000000000000e-01 +0: (2, 4; 6) -2.50000000000000e-01 +0: (2, 4; 7) 0.00000000000000e+00 +0: (2, 4; 8) 0.00000000000000e+00 +0: (3, 4; 0) 4.00000000000000e+00 +0: (3, 4; 1) -1.50000000000000e+00 +0: (3, 4; 2) -1.50000000000000e+00 +0: (3, 4; 3) 0.00000000000000e+00 +0: (3, 4; 4) 0.00000000000000e+00 +0: (3, 4; 5) -2.50000000000000e-01 +0: (3, 4; 6) -2.50000000000000e-01 +0: (3, 4; 7) 0.00000000000000e+00 +0: (3, 4; 8) 0.00000000000000e+00 +0: (4, 4; 0) 4.00000000000000e+00 +0: (4, 4; 1) -1.50000000000000e+00 +0: (4, 4; 2) -1.50000000000000e+00 +0: (4, 4; 3) 0.00000000000000e+00 +0: (4, 4; 4) 0.00000000000000e+00 +0: (4, 4; 5) -2.50000000000000e-01 +0: (4, 4; 6) -2.50000000000000e-01 +0: (4, 4; 7) 0.00000000000000e+00 +0: (4, 4; 8) 0.00000000000000e+00 +0: (5, 4; 0) 4.00000000000000e+00 +0: (5, 4; 1) -1.50000000000000e+00 +0: (5, 4; 2) -1.50000000000000e+00 +0: (5, 4; 3) 0.00000000000000e+00 +0: (5, 4; 4) 0.00000000000000e+00 +0: (5, 4; 5) -2.50000000000000e-01 +0: (5, 4; 6) -2.50000000000000e-01 +0: (5, 4; 7) 0.00000000000000e+00 +0: (5, 4; 8) 0.00000000000000e+00 +0: (6, 4; 0) 4.00000000000000e+00 +0: (6, 4; 1) -1.50000000000000e+00 +0: (6, 4; 2) -1.50000000000000e+00 +0: (6, 4; 3) 0.00000000000000e+00 +0: (6, 4; 4) 0.00000000000000e+00 +0: (6, 4; 5) -2.50000000000000e-01 +0: (6, 4; 6) -2.50000000000000e-01 +0: (6, 4; 7) 0.00000000000000e+00 +0: (6, 4; 8) 0.00000000000000e+00 +0: (7, 4; 0) 4.00000000000000e+00 +0: (7, 4; 1) -1.50000000000000e+00 +0: (7, 4; 2) -1.50000000000000e+00 +0: (7, 4; 3) 0.00000000000000e+00 +0: (7, 4; 4) 0.00000000000000e+00 +0: (7, 4; 5) -2.50000000000000e-01 +0: (7, 4; 6) -2.50000000000000e-01 +0: (7, 4; 7) 0.00000000000000e+00 +0: (7, 4; 8) 0.00000000000000e+00 +0: (8, 4; 0) 4.00000000000000e+00 +0: (8, 4; 1) -1.50000000000000e+00 +0: (8, 4; 2) -1.50000000000000e+00 +0: (8, 4; 3) 0.00000000000000e+00 +0: (8, 4; 4) 0.00000000000000e+00 +0: (8, 4; 5) -2.50000000000000e-01 +0: (8, 4; 6) -2.50000000000000e-01 +0: (8, 4; 7) 0.00000000000000e+00 +0: (8, 4; 8) 0.00000000000000e+00 +0: (9, 4; 0) 4.00000000000000e+00 +0: (9, 4; 1) -1.50000000000000e+00 +0: (9, 4; 2) -1.50000000000000e+00 +0: (9, 4; 3) 0.00000000000000e+00 +0: (9, 4; 4) 0.00000000000000e+00 +0: (9, 4; 5) -2.50000000000000e-01 +0: (9, 4; 6) -2.50000000000000e-01 +0: (9, 4; 7) 0.00000000000000e+00 +0: (9, 4; 8) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D3.mv0.4.matvec.00000 b/src/test/TEST_structmat/structmat.saved.2D3.mv0.4.matvec.00000 new file mode 100644 index 0000000000..90984bf2ce --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D3.mv0.4.matvec.00000 @@ -0,0 +1,36 @@ +StructVector + +Grid: +2 +1 +0: (0, 0) x (4, 4) + +Periodic: (10, 0) + +Data: +1 +0: (0, 0; 0) 1.00000000000000e+00 +0: (1, 0; 0) 1.00000000000000e+00 +0: (2, 0; 0) 1.00000000000000e+00 +0: (3, 0; 0) 1.00000000000000e+00 +0: (4, 0; 0) 1.00000000000000e+00 +0: (0, 1; 0) 0.00000000000000e+00 +0: (1, 1; 0) 0.00000000000000e+00 +0: (2, 1; 0) 0.00000000000000e+00 +0: (3, 1; 0) 0.00000000000000e+00 +0: (4, 1; 0) 0.00000000000000e+00 +0: (0, 2; 0) 0.00000000000000e+00 +0: (1, 2; 0) 0.00000000000000e+00 +0: (2, 2; 0) 0.00000000000000e+00 +0: (3, 2; 0) 0.00000000000000e+00 +0: (4, 2; 0) 0.00000000000000e+00 +0: (0, 3; 0) 0.00000000000000e+00 +0: (1, 3; 0) 0.00000000000000e+00 +0: (2, 3; 0) 0.00000000000000e+00 +0: (3, 3; 0) 0.00000000000000e+00 +0: (4, 3; 0) 0.00000000000000e+00 +0: (0, 4; 0) 0.00000000000000e+00 +0: (1, 4; 0) 0.00000000000000e+00 +0: (2, 4; 0) 0.00000000000000e+00 +0: (3, 4; 0) 0.00000000000000e+00 +0: (4, 4; 0) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D3.mv0.4.matvec.00001 b/src/test/TEST_structmat/structmat.saved.2D3.mv0.4.matvec.00001 new file mode 100644 index 0000000000..0170838785 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D3.mv0.4.matvec.00001 @@ -0,0 +1,36 @@ +StructVector + +Grid: +2 +1 +0: (5, 0) x (9, 4) + +Periodic: (10, 0) + +Data: +1 +0: (5, 0; 0) 1.00000000000000e+00 +0: (6, 0; 0) 1.00000000000000e+00 +0: (7, 0; 0) 1.00000000000000e+00 +0: (8, 0; 0) 1.00000000000000e+00 +0: (9, 0; 0) 1.00000000000000e+00 +0: (5, 1; 0) 0.00000000000000e+00 +0: (6, 1; 0) 0.00000000000000e+00 +0: (7, 1; 0) 0.00000000000000e+00 +0: (8, 1; 0) 0.00000000000000e+00 +0: (9, 1; 0) 0.00000000000000e+00 +0: (5, 2; 0) 0.00000000000000e+00 +0: (6, 2; 0) 0.00000000000000e+00 +0: (7, 2; 0) 0.00000000000000e+00 +0: (8, 2; 0) 0.00000000000000e+00 +0: (9, 2; 0) 0.00000000000000e+00 +0: (5, 3; 0) 0.00000000000000e+00 +0: (6, 3; 0) 0.00000000000000e+00 +0: (7, 3; 0) 0.00000000000000e+00 +0: (8, 3; 0) 0.00000000000000e+00 +0: (9, 3; 0) 0.00000000000000e+00 +0: (5, 4; 0) 0.00000000000000e+00 +0: (6, 4; 0) 0.00000000000000e+00 +0: (7, 4; 0) 0.00000000000000e+00 +0: (8, 4; 0) 0.00000000000000e+00 +0: (9, 4; 0) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D3.mv0.4.matvec.00002 b/src/test/TEST_structmat/structmat.saved.2D3.mv0.4.matvec.00002 new file mode 100644 index 0000000000..f472868a1a --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D3.mv0.4.matvec.00002 @@ -0,0 +1,36 @@ +StructVector + +Grid: +2 +1 +0: (0, 5) x (4, 9) + +Periodic: (10, 0) + +Data: +1 +0: (0, 5; 0) 0.00000000000000e+00 +0: (1, 5; 0) 0.00000000000000e+00 +0: (2, 5; 0) 0.00000000000000e+00 +0: (3, 5; 0) 0.00000000000000e+00 +0: (4, 5; 0) 0.00000000000000e+00 +0: (0, 6; 0) 0.00000000000000e+00 +0: (1, 6; 0) 0.00000000000000e+00 +0: (2, 6; 0) 0.00000000000000e+00 +0: (3, 6; 0) 0.00000000000000e+00 +0: (4, 6; 0) 0.00000000000000e+00 +0: (0, 7; 0) 0.00000000000000e+00 +0: (1, 7; 0) 0.00000000000000e+00 +0: (2, 7; 0) 0.00000000000000e+00 +0: (3, 7; 0) 0.00000000000000e+00 +0: (4, 7; 0) 0.00000000000000e+00 +0: (0, 8; 0) 0.00000000000000e+00 +0: (1, 8; 0) 0.00000000000000e+00 +0: (2, 8; 0) 0.00000000000000e+00 +0: (3, 8; 0) 0.00000000000000e+00 +0: (4, 8; 0) 0.00000000000000e+00 +0: (0, 9; 0) 1.00000000000000e+00 +0: (1, 9; 0) 1.00000000000000e+00 +0: (2, 9; 0) 1.00000000000000e+00 +0: (3, 9; 0) 1.00000000000000e+00 +0: (4, 9; 0) 1.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D3.mv0.4.matvec.00003 b/src/test/TEST_structmat/structmat.saved.2D3.mv0.4.matvec.00003 new file mode 100644 index 0000000000..4806742901 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D3.mv0.4.matvec.00003 @@ -0,0 +1,36 @@ +StructVector + +Grid: +2 +1 +0: (5, 5) x (9, 9) + +Periodic: (10, 0) + +Data: +1 +0: (5, 5; 0) 0.00000000000000e+00 +0: (6, 5; 0) 0.00000000000000e+00 +0: (7, 5; 0) 0.00000000000000e+00 +0: (8, 5; 0) 0.00000000000000e+00 +0: (9, 5; 0) 0.00000000000000e+00 +0: (5, 6; 0) 0.00000000000000e+00 +0: (6, 6; 0) 0.00000000000000e+00 +0: (7, 6; 0) 0.00000000000000e+00 +0: (8, 6; 0) 0.00000000000000e+00 +0: (9, 6; 0) 0.00000000000000e+00 +0: (5, 7; 0) 0.00000000000000e+00 +0: (6, 7; 0) 0.00000000000000e+00 +0: (7, 7; 0) 0.00000000000000e+00 +0: (8, 7; 0) 0.00000000000000e+00 +0: (9, 7; 0) 0.00000000000000e+00 +0: (5, 8; 0) 0.00000000000000e+00 +0: (6, 8; 0) 0.00000000000000e+00 +0: (7, 8; 0) 0.00000000000000e+00 +0: (8, 8; 0) 0.00000000000000e+00 +0: (9, 8; 0) 0.00000000000000e+00 +0: (5, 9; 0) 1.00000000000000e+00 +0: (6, 9; 0) 1.00000000000000e+00 +0: (7, 9; 0) 1.00000000000000e+00 +0: (8, 9; 0) 1.00000000000000e+00 +0: (9, 9; 0) 1.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D3.mv0.matvec.00000 b/src/test/TEST_structmat/structmat.saved.2D3.mv0.matvec.00000 new file mode 100644 index 0000000000..3d14f5c264 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D3.mv0.matvec.00000 @@ -0,0 +1,111 @@ +StructVector + +Grid: +2 +1 +0: (0, 0) x (9, 9) + +Periodic: (10, 0) + +Data: +1 +0: (0, 0; 0) 1.00000000000000e+00 +0: (1, 0; 0) 1.00000000000000e+00 +0: (2, 0; 0) 1.00000000000000e+00 +0: (3, 0; 0) 1.00000000000000e+00 +0: (4, 0; 0) 1.00000000000000e+00 +0: (5, 0; 0) 1.00000000000000e+00 +0: (6, 0; 0) 1.00000000000000e+00 +0: (7, 0; 0) 1.00000000000000e+00 +0: (8, 0; 0) 1.00000000000000e+00 +0: (9, 0; 0) 1.00000000000000e+00 +0: (0, 1; 0) 0.00000000000000e+00 +0: (1, 1; 0) 0.00000000000000e+00 +0: (2, 1; 0) 0.00000000000000e+00 +0: (3, 1; 0) 0.00000000000000e+00 +0: (4, 1; 0) 0.00000000000000e+00 +0: (5, 1; 0) 0.00000000000000e+00 +0: (6, 1; 0) 0.00000000000000e+00 +0: (7, 1; 0) 0.00000000000000e+00 +0: (8, 1; 0) 0.00000000000000e+00 +0: (9, 1; 0) 0.00000000000000e+00 +0: (0, 2; 0) 0.00000000000000e+00 +0: (1, 2; 0) 0.00000000000000e+00 +0: (2, 2; 0) 0.00000000000000e+00 +0: (3, 2; 0) 0.00000000000000e+00 +0: (4, 2; 0) 0.00000000000000e+00 +0: (5, 2; 0) 0.00000000000000e+00 +0: (6, 2; 0) 0.00000000000000e+00 +0: (7, 2; 0) 0.00000000000000e+00 +0: (8, 2; 0) 0.00000000000000e+00 +0: (9, 2; 0) 0.00000000000000e+00 +0: (0, 3; 0) 0.00000000000000e+00 +0: (1, 3; 0) 0.00000000000000e+00 +0: (2, 3; 0) 0.00000000000000e+00 +0: (3, 3; 0) 0.00000000000000e+00 +0: (4, 3; 0) 0.00000000000000e+00 +0: (5, 3; 0) 0.00000000000000e+00 +0: (6, 3; 0) 0.00000000000000e+00 +0: (7, 3; 0) 0.00000000000000e+00 +0: (8, 3; 0) 0.00000000000000e+00 +0: (9, 3; 0) 0.00000000000000e+00 +0: (0, 4; 0) 0.00000000000000e+00 +0: (1, 4; 0) 0.00000000000000e+00 +0: (2, 4; 0) 0.00000000000000e+00 +0: (3, 4; 0) 0.00000000000000e+00 +0: (4, 4; 0) 0.00000000000000e+00 +0: (5, 4; 0) 0.00000000000000e+00 +0: (6, 4; 0) 0.00000000000000e+00 +0: (7, 4; 0) 0.00000000000000e+00 +0: (8, 4; 0) 0.00000000000000e+00 +0: (9, 4; 0) 0.00000000000000e+00 +0: (0, 5; 0) 0.00000000000000e+00 +0: (1, 5; 0) 0.00000000000000e+00 +0: (2, 5; 0) 0.00000000000000e+00 +0: (3, 5; 0) 0.00000000000000e+00 +0: (4, 5; 0) 0.00000000000000e+00 +0: (5, 5; 0) 0.00000000000000e+00 +0: (6, 5; 0) 0.00000000000000e+00 +0: (7, 5; 0) 0.00000000000000e+00 +0: (8, 5; 0) 0.00000000000000e+00 +0: (9, 5; 0) 0.00000000000000e+00 +0: (0, 6; 0) 0.00000000000000e+00 +0: (1, 6; 0) 0.00000000000000e+00 +0: (2, 6; 0) 0.00000000000000e+00 +0: (3, 6; 0) 0.00000000000000e+00 +0: (4, 6; 0) 0.00000000000000e+00 +0: (5, 6; 0) 0.00000000000000e+00 +0: (6, 6; 0) 0.00000000000000e+00 +0: (7, 6; 0) 0.00000000000000e+00 +0: (8, 6; 0) 0.00000000000000e+00 +0: (9, 6; 0) 0.00000000000000e+00 +0: (0, 7; 0) 0.00000000000000e+00 +0: (1, 7; 0) 0.00000000000000e+00 +0: (2, 7; 0) 0.00000000000000e+00 +0: (3, 7; 0) 0.00000000000000e+00 +0: (4, 7; 0) 0.00000000000000e+00 +0: (5, 7; 0) 0.00000000000000e+00 +0: (6, 7; 0) 0.00000000000000e+00 +0: (7, 7; 0) 0.00000000000000e+00 +0: (8, 7; 0) 0.00000000000000e+00 +0: (9, 7; 0) 0.00000000000000e+00 +0: (0, 8; 0) 0.00000000000000e+00 +0: (1, 8; 0) 0.00000000000000e+00 +0: (2, 8; 0) 0.00000000000000e+00 +0: (3, 8; 0) 0.00000000000000e+00 +0: (4, 8; 0) 0.00000000000000e+00 +0: (5, 8; 0) 0.00000000000000e+00 +0: (6, 8; 0) 0.00000000000000e+00 +0: (7, 8; 0) 0.00000000000000e+00 +0: (8, 8; 0) 0.00000000000000e+00 +0: (9, 8; 0) 0.00000000000000e+00 +0: (0, 9; 0) 1.00000000000000e+00 +0: (1, 9; 0) 1.00000000000000e+00 +0: (2, 9; 0) 1.00000000000000e+00 +0: (3, 9; 0) 1.00000000000000e+00 +0: (4, 9; 0) 1.00000000000000e+00 +0: (5, 9; 0) 1.00000000000000e+00 +0: (6, 9; 0) 1.00000000000000e+00 +0: (7, 9; 0) 1.00000000000000e+00 +0: (8, 9; 0) 1.00000000000000e+00 +0: (9, 9; 0) 1.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D3.sym.x.4.matmat.00000 b/src/test/TEST_structmat/structmat.saved.2D3.sym.x.4.matmat.00000 new file mode 100644 index 0000000000..312568bf61 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D3.sym.x.4.matmat.00000 @@ -0,0 +1,66 @@ +StructMatrix + +Symmetric: 1 + +ConstantCoefficient: 3 + +Grid: +2 +1 +0: (0, 0) x (2, 4) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +3 +*: (*; 3) -1.50000000000000e+00 +*: (*; 5) -2.50000000000000e-01 +*: (*; 6) -2.50000000000000e-01 + +Variable Data: +2 +0: (0, 0; 0) 4.00000000000000e+00 +0: (0, 0; 1) 0.00000000000000e+00 +0: (1, 0; 0) 4.00000000000000e+00 +0: (1, 0; 1) 0.00000000000000e+00 +0: (2, 0; 0) 4.00000000000000e+00 +0: (2, 0; 1) 0.00000000000000e+00 +0: (0, 1; 0) 4.00000000000000e+00 +0: (0, 1; 1) 0.00000000000000e+00 +0: (1, 1; 0) 4.00000000000000e+00 +0: (1, 1; 1) 0.00000000000000e+00 +0: (2, 1; 0) 4.00000000000000e+00 +0: (2, 1; 1) 0.00000000000000e+00 +0: (0, 2; 0) 4.00000000000000e+00 +0: (0, 2; 1) 0.00000000000000e+00 +0: (1, 2; 0) 4.00000000000000e+00 +0: (1, 2; 1) 0.00000000000000e+00 +0: (2, 2; 0) 4.00000000000000e+00 +0: (2, 2; 1) 0.00000000000000e+00 +0: (0, 3; 0) 4.00000000000000e+00 +0: (0, 3; 1) 0.00000000000000e+00 +0: (1, 3; 0) 4.00000000000000e+00 +0: (1, 3; 1) 0.00000000000000e+00 +0: (2, 3; 0) 4.00000000000000e+00 +0: (2, 3; 1) 0.00000000000000e+00 +0: (0, 4; 0) 4.00000000000000e+00 +0: (0, 4; 1) 0.00000000000000e+00 +0: (1, 4; 0) 4.00000000000000e+00 +0: (1, 4; 1) 0.00000000000000e+00 +0: (2, 4; 0) 4.00000000000000e+00 +0: (2, 4; 1) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D3.sym.x.4.matmat.00001 b/src/test/TEST_structmat/structmat.saved.2D3.sym.x.4.matmat.00001 new file mode 100644 index 0000000000..83e49df478 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D3.sym.x.4.matmat.00001 @@ -0,0 +1,56 @@ +StructMatrix + +Symmetric: 1 + +ConstantCoefficient: 3 + +Grid: +2 +1 +0: (3, 0) x (4, 4) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +3 +*: (*; 3) -1.50000000000000e+00 +*: (*; 5) -2.50000000000000e-01 +*: (*; 6) -2.50000000000000e-01 + +Variable Data: +2 +0: (3, 0; 0) 4.00000000000000e+00 +0: (3, 0; 1) 0.00000000000000e+00 +0: (4, 0; 0) 4.00000000000000e+00 +0: (4, 0; 1) 0.00000000000000e+00 +0: (3, 1; 0) 4.00000000000000e+00 +0: (3, 1; 1) 0.00000000000000e+00 +0: (4, 1; 0) 4.00000000000000e+00 +0: (4, 1; 1) 0.00000000000000e+00 +0: (3, 2; 0) 4.00000000000000e+00 +0: (3, 2; 1) 0.00000000000000e+00 +0: (4, 2; 0) 4.00000000000000e+00 +0: (4, 2; 1) 0.00000000000000e+00 +0: (3, 3; 0) 4.00000000000000e+00 +0: (3, 3; 1) 0.00000000000000e+00 +0: (4, 3; 0) 4.00000000000000e+00 +0: (4, 3; 1) 0.00000000000000e+00 +0: (3, 4; 0) 4.00000000000000e+00 +0: (3, 4; 1) 0.00000000000000e+00 +0: (4, 4; 0) 4.00000000000000e+00 +0: (4, 4; 1) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D3.sym.x.4.matmat.00002 b/src/test/TEST_structmat/structmat.saved.2D3.sym.x.4.matmat.00002 new file mode 100644 index 0000000000..abf0823c16 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D3.sym.x.4.matmat.00002 @@ -0,0 +1,66 @@ +StructMatrix + +Symmetric: 1 + +ConstantCoefficient: 3 + +Grid: +2 +1 +0: (0, 5) x (2, 9) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +3 +*: (*; 3) -1.50000000000000e+00 +*: (*; 5) -2.50000000000000e-01 +*: (*; 6) -2.50000000000000e-01 + +Variable Data: +2 +0: (0, 5; 0) 4.00000000000000e+00 +0: (0, 5; 1) 0.00000000000000e+00 +0: (1, 5; 0) 4.00000000000000e+00 +0: (1, 5; 1) 0.00000000000000e+00 +0: (2, 5; 0) 4.00000000000000e+00 +0: (2, 5; 1) 0.00000000000000e+00 +0: (0, 6; 0) 4.00000000000000e+00 +0: (0, 6; 1) 0.00000000000000e+00 +0: (1, 6; 0) 4.00000000000000e+00 +0: (1, 6; 1) 0.00000000000000e+00 +0: (2, 6; 0) 4.00000000000000e+00 +0: (2, 6; 1) 0.00000000000000e+00 +0: (0, 7; 0) 4.00000000000000e+00 +0: (0, 7; 1) 0.00000000000000e+00 +0: (1, 7; 0) 4.00000000000000e+00 +0: (1, 7; 1) 0.00000000000000e+00 +0: (2, 7; 0) 4.00000000000000e+00 +0: (2, 7; 1) 0.00000000000000e+00 +0: (0, 8; 0) 4.00000000000000e+00 +0: (0, 8; 1) 0.00000000000000e+00 +0: (1, 8; 0) 4.00000000000000e+00 +0: (1, 8; 1) 0.00000000000000e+00 +0: (2, 8; 0) 4.00000000000000e+00 +0: (2, 8; 1) 0.00000000000000e+00 +0: (0, 9; 0) 4.00000000000000e+00 +0: (0, 9; 1) 0.00000000000000e+00 +0: (1, 9; 0) 4.00000000000000e+00 +0: (1, 9; 1) 0.00000000000000e+00 +0: (2, 9; 0) 4.00000000000000e+00 +0: (2, 9; 1) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D3.sym.x.4.matmat.00003 b/src/test/TEST_structmat/structmat.saved.2D3.sym.x.4.matmat.00003 new file mode 100644 index 0000000000..150ab00e7c --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D3.sym.x.4.matmat.00003 @@ -0,0 +1,56 @@ +StructMatrix + +Symmetric: 1 + +ConstantCoefficient: 3 + +Grid: +2 +1 +0: (3, 5) x (4, 9) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +3 +*: (*; 3) -1.50000000000000e+00 +*: (*; 5) -2.50000000000000e-01 +*: (*; 6) -2.50000000000000e-01 + +Variable Data: +2 +0: (3, 5; 0) 4.00000000000000e+00 +0: (3, 5; 1) 0.00000000000000e+00 +0: (4, 5; 0) 4.00000000000000e+00 +0: (4, 5; 1) 0.00000000000000e+00 +0: (3, 6; 0) 4.00000000000000e+00 +0: (3, 6; 1) 0.00000000000000e+00 +0: (4, 6; 0) 4.00000000000000e+00 +0: (4, 6; 1) 0.00000000000000e+00 +0: (3, 7; 0) 4.00000000000000e+00 +0: (3, 7; 1) 0.00000000000000e+00 +0: (4, 7; 0) 4.00000000000000e+00 +0: (4, 7; 1) 0.00000000000000e+00 +0: (3, 8; 0) 4.00000000000000e+00 +0: (3, 8; 1) 0.00000000000000e+00 +0: (4, 8; 0) 4.00000000000000e+00 +0: (4, 8; 1) 0.00000000000000e+00 +0: (3, 9; 0) 4.00000000000000e+00 +0: (3, 9; 1) 0.00000000000000e+00 +0: (4, 9; 0) 4.00000000000000e+00 +0: (4, 9; 1) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D3.sym.x.matmat.00000 b/src/test/TEST_structmat/structmat.saved.2D3.sym.x.matmat.00000 new file mode 100644 index 0000000000..09782814bc --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D3.sym.x.matmat.00000 @@ -0,0 +1,136 @@ +StructMatrix + +Symmetric: 1 + +ConstantCoefficient: 3 + +Grid: +2 +1 +0: (0, 0) x (4, 9) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +3 +*: (*; 3) -1.50000000000000e+00 +*: (*; 5) -2.50000000000000e-01 +*: (*; 6) -2.50000000000000e-01 + +Variable Data: +2 +0: (0, 0; 0) 4.00000000000000e+00 +0: (0, 0; 1) 0.00000000000000e+00 +0: (1, 0; 0) 4.00000000000000e+00 +0: (1, 0; 1) 0.00000000000000e+00 +0: (2, 0; 0) 4.00000000000000e+00 +0: (2, 0; 1) 0.00000000000000e+00 +0: (3, 0; 0) 4.00000000000000e+00 +0: (3, 0; 1) 0.00000000000000e+00 +0: (4, 0; 0) 4.00000000000000e+00 +0: (4, 0; 1) 0.00000000000000e+00 +0: (0, 1; 0) 4.00000000000000e+00 +0: (0, 1; 1) 0.00000000000000e+00 +0: (1, 1; 0) 4.00000000000000e+00 +0: (1, 1; 1) 0.00000000000000e+00 +0: (2, 1; 0) 4.00000000000000e+00 +0: (2, 1; 1) 0.00000000000000e+00 +0: (3, 1; 0) 4.00000000000000e+00 +0: (3, 1; 1) 0.00000000000000e+00 +0: (4, 1; 0) 4.00000000000000e+00 +0: (4, 1; 1) 0.00000000000000e+00 +0: (0, 2; 0) 4.00000000000000e+00 +0: (0, 2; 1) 0.00000000000000e+00 +0: (1, 2; 0) 4.00000000000000e+00 +0: (1, 2; 1) 0.00000000000000e+00 +0: (2, 2; 0) 4.00000000000000e+00 +0: (2, 2; 1) 0.00000000000000e+00 +0: (3, 2; 0) 4.00000000000000e+00 +0: (3, 2; 1) 0.00000000000000e+00 +0: (4, 2; 0) 4.00000000000000e+00 +0: (4, 2; 1) 0.00000000000000e+00 +0: (0, 3; 0) 4.00000000000000e+00 +0: (0, 3; 1) 0.00000000000000e+00 +0: (1, 3; 0) 4.00000000000000e+00 +0: (1, 3; 1) 0.00000000000000e+00 +0: (2, 3; 0) 4.00000000000000e+00 +0: (2, 3; 1) 0.00000000000000e+00 +0: (3, 3; 0) 4.00000000000000e+00 +0: (3, 3; 1) 0.00000000000000e+00 +0: (4, 3; 0) 4.00000000000000e+00 +0: (4, 3; 1) 0.00000000000000e+00 +0: (0, 4; 0) 4.00000000000000e+00 +0: (0, 4; 1) 0.00000000000000e+00 +0: (1, 4; 0) 4.00000000000000e+00 +0: (1, 4; 1) 0.00000000000000e+00 +0: (2, 4; 0) 4.00000000000000e+00 +0: (2, 4; 1) 0.00000000000000e+00 +0: (3, 4; 0) 4.00000000000000e+00 +0: (3, 4; 1) 0.00000000000000e+00 +0: (4, 4; 0) 4.00000000000000e+00 +0: (4, 4; 1) 0.00000000000000e+00 +0: (0, 5; 0) 4.00000000000000e+00 +0: (0, 5; 1) 0.00000000000000e+00 +0: (1, 5; 0) 4.00000000000000e+00 +0: (1, 5; 1) 0.00000000000000e+00 +0: (2, 5; 0) 4.00000000000000e+00 +0: (2, 5; 1) 0.00000000000000e+00 +0: (3, 5; 0) 4.00000000000000e+00 +0: (3, 5; 1) 0.00000000000000e+00 +0: (4, 5; 0) 4.00000000000000e+00 +0: (4, 5; 1) 0.00000000000000e+00 +0: (0, 6; 0) 4.00000000000000e+00 +0: (0, 6; 1) 0.00000000000000e+00 +0: (1, 6; 0) 4.00000000000000e+00 +0: (1, 6; 1) 0.00000000000000e+00 +0: (2, 6; 0) 4.00000000000000e+00 +0: (2, 6; 1) 0.00000000000000e+00 +0: (3, 6; 0) 4.00000000000000e+00 +0: (3, 6; 1) 0.00000000000000e+00 +0: (4, 6; 0) 4.00000000000000e+00 +0: (4, 6; 1) 0.00000000000000e+00 +0: (0, 7; 0) 4.00000000000000e+00 +0: (0, 7; 1) 0.00000000000000e+00 +0: (1, 7; 0) 4.00000000000000e+00 +0: (1, 7; 1) 0.00000000000000e+00 +0: (2, 7; 0) 4.00000000000000e+00 +0: (2, 7; 1) 0.00000000000000e+00 +0: (3, 7; 0) 4.00000000000000e+00 +0: (3, 7; 1) 0.00000000000000e+00 +0: (4, 7; 0) 4.00000000000000e+00 +0: (4, 7; 1) 0.00000000000000e+00 +0: (0, 8; 0) 4.00000000000000e+00 +0: (0, 8; 1) 0.00000000000000e+00 +0: (1, 8; 0) 4.00000000000000e+00 +0: (1, 8; 1) 0.00000000000000e+00 +0: (2, 8; 0) 4.00000000000000e+00 +0: (2, 8; 1) 0.00000000000000e+00 +0: (3, 8; 0) 4.00000000000000e+00 +0: (3, 8; 1) 0.00000000000000e+00 +0: (4, 8; 0) 4.00000000000000e+00 +0: (4, 8; 1) 0.00000000000000e+00 +0: (0, 9; 0) 4.00000000000000e+00 +0: (0, 9; 1) 0.00000000000000e+00 +0: (1, 9; 0) 4.00000000000000e+00 +0: (1, 9; 1) 0.00000000000000e+00 +0: (2, 9; 0) 4.00000000000000e+00 +0: (2, 9; 1) 0.00000000000000e+00 +0: (3, 9; 0) 4.00000000000000e+00 +0: (3, 9; 1) 0.00000000000000e+00 +0: (4, 9; 0) 4.00000000000000e+00 +0: (4, 9; 1) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D3.x.4.matmat.00000 b/src/test/TEST_structmat/structmat.saved.2D3.x.4.matmat.00000 new file mode 100644 index 0000000000..83fbb816ff --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D3.x.4.matmat.00000 @@ -0,0 +1,84 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 3 + +Grid: +2 +1 +0: (0, 0) x (2, 4) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +6 +*: (*; 3) -1.50000000000000e+00 +*: (*; 4) -1.50000000000000e+00 +*: (*; 5) -2.50000000000000e-01 +*: (*; 6) -2.50000000000000e-01 +*: (*; 7) -2.50000000000000e-01 +*: (*; 8) -2.50000000000000e-01 + +Variable Data: +3 +0: (0, 0; 0) 4.00000000000000e+00 +0: (0, 0; 1) 0.00000000000000e+00 +0: (0, 0; 2) 0.00000000000000e+00 +0: (1, 0; 0) 4.00000000000000e+00 +0: (1, 0; 1) 0.00000000000000e+00 +0: (1, 0; 2) 0.00000000000000e+00 +0: (2, 0; 0) 4.00000000000000e+00 +0: (2, 0; 1) 0.00000000000000e+00 +0: (2, 0; 2) 0.00000000000000e+00 +0: (0, 1; 0) 4.00000000000000e+00 +0: (0, 1; 1) 0.00000000000000e+00 +0: (0, 1; 2) 0.00000000000000e+00 +0: (1, 1; 0) 4.00000000000000e+00 +0: (1, 1; 1) 0.00000000000000e+00 +0: (1, 1; 2) 0.00000000000000e+00 +0: (2, 1; 0) 4.00000000000000e+00 +0: (2, 1; 1) 0.00000000000000e+00 +0: (2, 1; 2) 0.00000000000000e+00 +0: (0, 2; 0) 4.00000000000000e+00 +0: (0, 2; 1) 0.00000000000000e+00 +0: (0, 2; 2) 0.00000000000000e+00 +0: (1, 2; 0) 4.00000000000000e+00 +0: (1, 2; 1) 0.00000000000000e+00 +0: (1, 2; 2) 0.00000000000000e+00 +0: (2, 2; 0) 4.00000000000000e+00 +0: (2, 2; 1) 0.00000000000000e+00 +0: (2, 2; 2) 0.00000000000000e+00 +0: (0, 3; 0) 4.00000000000000e+00 +0: (0, 3; 1) 0.00000000000000e+00 +0: (0, 3; 2) 0.00000000000000e+00 +0: (1, 3; 0) 4.00000000000000e+00 +0: (1, 3; 1) 0.00000000000000e+00 +0: (1, 3; 2) 0.00000000000000e+00 +0: (2, 3; 0) 4.00000000000000e+00 +0: (2, 3; 1) 0.00000000000000e+00 +0: (2, 3; 2) 0.00000000000000e+00 +0: (0, 4; 0) 4.00000000000000e+00 +0: (0, 4; 1) 0.00000000000000e+00 +0: (0, 4; 2) 0.00000000000000e+00 +0: (1, 4; 0) 4.00000000000000e+00 +0: (1, 4; 1) 0.00000000000000e+00 +0: (1, 4; 2) 0.00000000000000e+00 +0: (2, 4; 0) 4.00000000000000e+00 +0: (2, 4; 1) 0.00000000000000e+00 +0: (2, 4; 2) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D3.x.4.matmat.00001 b/src/test/TEST_structmat/structmat.saved.2D3.x.4.matmat.00001 new file mode 100644 index 0000000000..6e31dcbdca --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D3.x.4.matmat.00001 @@ -0,0 +1,69 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 3 + +Grid: +2 +1 +0: (3, 0) x (4, 4) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +6 +*: (*; 3) -1.50000000000000e+00 +*: (*; 4) -1.50000000000000e+00 +*: (*; 5) -2.50000000000000e-01 +*: (*; 6) -2.50000000000000e-01 +*: (*; 7) -2.50000000000000e-01 +*: (*; 8) -2.50000000000000e-01 + +Variable Data: +3 +0: (3, 0; 0) 4.00000000000000e+00 +0: (3, 0; 1) 0.00000000000000e+00 +0: (3, 0; 2) 0.00000000000000e+00 +0: (4, 0; 0) 4.00000000000000e+00 +0: (4, 0; 1) 0.00000000000000e+00 +0: (4, 0; 2) 0.00000000000000e+00 +0: (3, 1; 0) 4.00000000000000e+00 +0: (3, 1; 1) 0.00000000000000e+00 +0: (3, 1; 2) 0.00000000000000e+00 +0: (4, 1; 0) 4.00000000000000e+00 +0: (4, 1; 1) 0.00000000000000e+00 +0: (4, 1; 2) 0.00000000000000e+00 +0: (3, 2; 0) 4.00000000000000e+00 +0: (3, 2; 1) 0.00000000000000e+00 +0: (3, 2; 2) 0.00000000000000e+00 +0: (4, 2; 0) 4.00000000000000e+00 +0: (4, 2; 1) 0.00000000000000e+00 +0: (4, 2; 2) 0.00000000000000e+00 +0: (3, 3; 0) 4.00000000000000e+00 +0: (3, 3; 1) 0.00000000000000e+00 +0: (3, 3; 2) 0.00000000000000e+00 +0: (4, 3; 0) 4.00000000000000e+00 +0: (4, 3; 1) 0.00000000000000e+00 +0: (4, 3; 2) 0.00000000000000e+00 +0: (3, 4; 0) 4.00000000000000e+00 +0: (3, 4; 1) 0.00000000000000e+00 +0: (3, 4; 2) 0.00000000000000e+00 +0: (4, 4; 0) 4.00000000000000e+00 +0: (4, 4; 1) 0.00000000000000e+00 +0: (4, 4; 2) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D3.x.4.matmat.00002 b/src/test/TEST_structmat/structmat.saved.2D3.x.4.matmat.00002 new file mode 100644 index 0000000000..2da7386343 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D3.x.4.matmat.00002 @@ -0,0 +1,84 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 3 + +Grid: +2 +1 +0: (0, 5) x (2, 9) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +6 +*: (*; 3) -1.50000000000000e+00 +*: (*; 4) -1.50000000000000e+00 +*: (*; 5) -2.50000000000000e-01 +*: (*; 6) -2.50000000000000e-01 +*: (*; 7) -2.50000000000000e-01 +*: (*; 8) -2.50000000000000e-01 + +Variable Data: +3 +0: (0, 5; 0) 4.00000000000000e+00 +0: (0, 5; 1) 0.00000000000000e+00 +0: (0, 5; 2) 0.00000000000000e+00 +0: (1, 5; 0) 4.00000000000000e+00 +0: (1, 5; 1) 0.00000000000000e+00 +0: (1, 5; 2) 0.00000000000000e+00 +0: (2, 5; 0) 4.00000000000000e+00 +0: (2, 5; 1) 0.00000000000000e+00 +0: (2, 5; 2) 0.00000000000000e+00 +0: (0, 6; 0) 4.00000000000000e+00 +0: (0, 6; 1) 0.00000000000000e+00 +0: (0, 6; 2) 0.00000000000000e+00 +0: (1, 6; 0) 4.00000000000000e+00 +0: (1, 6; 1) 0.00000000000000e+00 +0: (1, 6; 2) 0.00000000000000e+00 +0: (2, 6; 0) 4.00000000000000e+00 +0: (2, 6; 1) 0.00000000000000e+00 +0: (2, 6; 2) 0.00000000000000e+00 +0: (0, 7; 0) 4.00000000000000e+00 +0: (0, 7; 1) 0.00000000000000e+00 +0: (0, 7; 2) 0.00000000000000e+00 +0: (1, 7; 0) 4.00000000000000e+00 +0: (1, 7; 1) 0.00000000000000e+00 +0: (1, 7; 2) 0.00000000000000e+00 +0: (2, 7; 0) 4.00000000000000e+00 +0: (2, 7; 1) 0.00000000000000e+00 +0: (2, 7; 2) 0.00000000000000e+00 +0: (0, 8; 0) 4.00000000000000e+00 +0: (0, 8; 1) 0.00000000000000e+00 +0: (0, 8; 2) 0.00000000000000e+00 +0: (1, 8; 0) 4.00000000000000e+00 +0: (1, 8; 1) 0.00000000000000e+00 +0: (1, 8; 2) 0.00000000000000e+00 +0: (2, 8; 0) 4.00000000000000e+00 +0: (2, 8; 1) 0.00000000000000e+00 +0: (2, 8; 2) 0.00000000000000e+00 +0: (0, 9; 0) 4.00000000000000e+00 +0: (0, 9; 1) 0.00000000000000e+00 +0: (0, 9; 2) 0.00000000000000e+00 +0: (1, 9; 0) 4.00000000000000e+00 +0: (1, 9; 1) 0.00000000000000e+00 +0: (1, 9; 2) 0.00000000000000e+00 +0: (2, 9; 0) 4.00000000000000e+00 +0: (2, 9; 1) 0.00000000000000e+00 +0: (2, 9; 2) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D3.x.4.matmat.00003 b/src/test/TEST_structmat/structmat.saved.2D3.x.4.matmat.00003 new file mode 100644 index 0000000000..f42de1923b --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D3.x.4.matmat.00003 @@ -0,0 +1,69 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 3 + +Grid: +2 +1 +0: (3, 5) x (4, 9) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +6 +*: (*; 3) -1.50000000000000e+00 +*: (*; 4) -1.50000000000000e+00 +*: (*; 5) -2.50000000000000e-01 +*: (*; 6) -2.50000000000000e-01 +*: (*; 7) -2.50000000000000e-01 +*: (*; 8) -2.50000000000000e-01 + +Variable Data: +3 +0: (3, 5; 0) 4.00000000000000e+00 +0: (3, 5; 1) 0.00000000000000e+00 +0: (3, 5; 2) 0.00000000000000e+00 +0: (4, 5; 0) 4.00000000000000e+00 +0: (4, 5; 1) 0.00000000000000e+00 +0: (4, 5; 2) 0.00000000000000e+00 +0: (3, 6; 0) 4.00000000000000e+00 +0: (3, 6; 1) 0.00000000000000e+00 +0: (3, 6; 2) 0.00000000000000e+00 +0: (4, 6; 0) 4.00000000000000e+00 +0: (4, 6; 1) 0.00000000000000e+00 +0: (4, 6; 2) 0.00000000000000e+00 +0: (3, 7; 0) 4.00000000000000e+00 +0: (3, 7; 1) 0.00000000000000e+00 +0: (3, 7; 2) 0.00000000000000e+00 +0: (4, 7; 0) 4.00000000000000e+00 +0: (4, 7; 1) 0.00000000000000e+00 +0: (4, 7; 2) 0.00000000000000e+00 +0: (3, 8; 0) 4.00000000000000e+00 +0: (3, 8; 1) 0.00000000000000e+00 +0: (3, 8; 2) 0.00000000000000e+00 +0: (4, 8; 0) 4.00000000000000e+00 +0: (4, 8; 1) 0.00000000000000e+00 +0: (4, 8; 2) 0.00000000000000e+00 +0: (3, 9; 0) 4.00000000000000e+00 +0: (3, 9; 1) 0.00000000000000e+00 +0: (3, 9; 2) 0.00000000000000e+00 +0: (4, 9; 0) 4.00000000000000e+00 +0: (4, 9; 1) 0.00000000000000e+00 +0: (4, 9; 2) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D3.x.AP.matmat.00000 b/src/test/TEST_structmat/structmat.saved.2D3.x.AP.matmat.00000 new file mode 100644 index 0000000000..c112b59236 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D3.x.AP.matmat.00000 @@ -0,0 +1,193 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 3 + +Grid: +2 +1 +0: (0, 0) x (9, 9) + +Periodic: (10, 0) + +Range Stride: (1, 1) +Domain Stride: (2, 1) + +Stencil: +11 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (-2, 0) +4: (2, 0) +5: (0, -1) +6: (-1, -1) +7: (1, -1) +8: (0, 1) +9: (-1, 1) +10: (1, 1) + +Constant Data: +8 +*: (*; 3) -5.00000000000000e-01 +*: (*; 4) -5.00000000000000e-01 +*: (*; 5) -1.00000000000000e+00 +*: (*; 6) -5.00000000000000e-01 +*: (*; 7) -5.00000000000000e-01 +*: (*; 8) -1.00000000000000e+00 +*: (*; 9) -5.00000000000000e-01 +*: (*; 10) -5.00000000000000e-01 + +Variable Data: +3 +0: (0, 0; 0) 3.00000000000000e+00 +0: (0, 0; 1) 1.00000000000000e+00 +0: (0, 0; 2) 1.00000000000000e+00 +0: (1, 0; 0) 3.00000000000000e+00 +0: (1, 0; 1) 1.00000000000000e+00 +0: (1, 0; 2) 1.00000000000000e+00 +0: (2, 0; 0) 3.00000000000000e+00 +0: (2, 0; 1) 1.00000000000000e+00 +0: (2, 0; 2) 1.00000000000000e+00 +0: (3, 0; 0) 3.00000000000000e+00 +0: (3, 0; 1) 1.00000000000000e+00 +0: (3, 0; 2) 1.00000000000000e+00 +0: (4, 0; 0) 3.00000000000000e+00 +0: (4, 0; 1) 1.00000000000000e+00 +0: (4, 0; 2) 1.00000000000000e+00 +0: (0, 1; 0) 3.00000000000000e+00 +0: (0, 1; 1) 1.00000000000000e+00 +0: (0, 1; 2) 1.00000000000000e+00 +0: (1, 1; 0) 3.00000000000000e+00 +0: (1, 1; 1) 1.00000000000000e+00 +0: (1, 1; 2) 1.00000000000000e+00 +0: (2, 1; 0) 3.00000000000000e+00 +0: (2, 1; 1) 1.00000000000000e+00 +0: (2, 1; 2) 1.00000000000000e+00 +0: (3, 1; 0) 3.00000000000000e+00 +0: (3, 1; 1) 1.00000000000000e+00 +0: (3, 1; 2) 1.00000000000000e+00 +0: (4, 1; 0) 3.00000000000000e+00 +0: (4, 1; 1) 1.00000000000000e+00 +0: (4, 1; 2) 1.00000000000000e+00 +0: (0, 2; 0) 3.00000000000000e+00 +0: (0, 2; 1) 1.00000000000000e+00 +0: (0, 2; 2) 1.00000000000000e+00 +0: (1, 2; 0) 3.00000000000000e+00 +0: (1, 2; 1) 1.00000000000000e+00 +0: (1, 2; 2) 1.00000000000000e+00 +0: (2, 2; 0) 3.00000000000000e+00 +0: (2, 2; 1) 1.00000000000000e+00 +0: (2, 2; 2) 1.00000000000000e+00 +0: (3, 2; 0) 3.00000000000000e+00 +0: (3, 2; 1) 1.00000000000000e+00 +0: (3, 2; 2) 1.00000000000000e+00 +0: (4, 2; 0) 3.00000000000000e+00 +0: (4, 2; 1) 1.00000000000000e+00 +0: (4, 2; 2) 1.00000000000000e+00 +0: (0, 3; 0) 3.00000000000000e+00 +0: (0, 3; 1) 1.00000000000000e+00 +0: (0, 3; 2) 1.00000000000000e+00 +0: (1, 3; 0) 3.00000000000000e+00 +0: (1, 3; 1) 1.00000000000000e+00 +0: (1, 3; 2) 1.00000000000000e+00 +0: (2, 3; 0) 3.00000000000000e+00 +0: (2, 3; 1) 1.00000000000000e+00 +0: (2, 3; 2) 1.00000000000000e+00 +0: (3, 3; 0) 3.00000000000000e+00 +0: (3, 3; 1) 1.00000000000000e+00 +0: (3, 3; 2) 1.00000000000000e+00 +0: (4, 3; 0) 3.00000000000000e+00 +0: (4, 3; 1) 1.00000000000000e+00 +0: (4, 3; 2) 1.00000000000000e+00 +0: (0, 4; 0) 3.00000000000000e+00 +0: (0, 4; 1) 1.00000000000000e+00 +0: (0, 4; 2) 1.00000000000000e+00 +0: (1, 4; 0) 3.00000000000000e+00 +0: (1, 4; 1) 1.00000000000000e+00 +0: (1, 4; 2) 1.00000000000000e+00 +0: (2, 4; 0) 3.00000000000000e+00 +0: (2, 4; 1) 1.00000000000000e+00 +0: (2, 4; 2) 1.00000000000000e+00 +0: (3, 4; 0) 3.00000000000000e+00 +0: (3, 4; 1) 1.00000000000000e+00 +0: (3, 4; 2) 1.00000000000000e+00 +0: (4, 4; 0) 3.00000000000000e+00 +0: (4, 4; 1) 1.00000000000000e+00 +0: (4, 4; 2) 1.00000000000000e+00 +0: (0, 5; 0) 3.00000000000000e+00 +0: (0, 5; 1) 1.00000000000000e+00 +0: (0, 5; 2) 1.00000000000000e+00 +0: (1, 5; 0) 3.00000000000000e+00 +0: (1, 5; 1) 1.00000000000000e+00 +0: (1, 5; 2) 1.00000000000000e+00 +0: (2, 5; 0) 3.00000000000000e+00 +0: (2, 5; 1) 1.00000000000000e+00 +0: (2, 5; 2) 1.00000000000000e+00 +0: (3, 5; 0) 3.00000000000000e+00 +0: (3, 5; 1) 1.00000000000000e+00 +0: (3, 5; 2) 1.00000000000000e+00 +0: (4, 5; 0) 3.00000000000000e+00 +0: (4, 5; 1) 1.00000000000000e+00 +0: (4, 5; 2) 1.00000000000000e+00 +0: (0, 6; 0) 3.00000000000000e+00 +0: (0, 6; 1) 1.00000000000000e+00 +0: (0, 6; 2) 1.00000000000000e+00 +0: (1, 6; 0) 3.00000000000000e+00 +0: (1, 6; 1) 1.00000000000000e+00 +0: (1, 6; 2) 1.00000000000000e+00 +0: (2, 6; 0) 3.00000000000000e+00 +0: (2, 6; 1) 1.00000000000000e+00 +0: (2, 6; 2) 1.00000000000000e+00 +0: (3, 6; 0) 3.00000000000000e+00 +0: (3, 6; 1) 1.00000000000000e+00 +0: (3, 6; 2) 1.00000000000000e+00 +0: (4, 6; 0) 3.00000000000000e+00 +0: (4, 6; 1) 1.00000000000000e+00 +0: (4, 6; 2) 1.00000000000000e+00 +0: (0, 7; 0) 3.00000000000000e+00 +0: (0, 7; 1) 1.00000000000000e+00 +0: (0, 7; 2) 1.00000000000000e+00 +0: (1, 7; 0) 3.00000000000000e+00 +0: (1, 7; 1) 1.00000000000000e+00 +0: (1, 7; 2) 1.00000000000000e+00 +0: (2, 7; 0) 3.00000000000000e+00 +0: (2, 7; 1) 1.00000000000000e+00 +0: (2, 7; 2) 1.00000000000000e+00 +0: (3, 7; 0) 3.00000000000000e+00 +0: (3, 7; 1) 1.00000000000000e+00 +0: (3, 7; 2) 1.00000000000000e+00 +0: (4, 7; 0) 3.00000000000000e+00 +0: (4, 7; 1) 1.00000000000000e+00 +0: (4, 7; 2) 1.00000000000000e+00 +0: (0, 8; 0) 3.00000000000000e+00 +0: (0, 8; 1) 1.00000000000000e+00 +0: (0, 8; 2) 1.00000000000000e+00 +0: (1, 8; 0) 3.00000000000000e+00 +0: (1, 8; 1) 1.00000000000000e+00 +0: (1, 8; 2) 1.00000000000000e+00 +0: (2, 8; 0) 3.00000000000000e+00 +0: (2, 8; 1) 1.00000000000000e+00 +0: (2, 8; 2) 1.00000000000000e+00 +0: (3, 8; 0) 3.00000000000000e+00 +0: (3, 8; 1) 1.00000000000000e+00 +0: (3, 8; 2) 1.00000000000000e+00 +0: (4, 8; 0) 3.00000000000000e+00 +0: (4, 8; 1) 1.00000000000000e+00 +0: (4, 8; 2) 1.00000000000000e+00 +0: (0, 9; 0) 3.00000000000000e+00 +0: (0, 9; 1) 1.00000000000000e+00 +0: (0, 9; 2) 1.00000000000000e+00 +0: (1, 9; 0) 3.00000000000000e+00 +0: (1, 9; 1) 1.00000000000000e+00 +0: (1, 9; 2) 1.00000000000000e+00 +0: (2, 9; 0) 3.00000000000000e+00 +0: (2, 9; 1) 1.00000000000000e+00 +0: (2, 9; 2) 1.00000000000000e+00 +0: (3, 9; 0) 3.00000000000000e+00 +0: (3, 9; 1) 1.00000000000000e+00 +0: (3, 9; 2) 1.00000000000000e+00 +0: (4, 9; 0) 3.00000000000000e+00 +0: (4, 9; 1) 1.00000000000000e+00 +0: (4, 9; 2) 1.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D3.x.RA.matmat.00000 b/src/test/TEST_structmat/structmat.saved.2D3.x.RA.matmat.00000 new file mode 100644 index 0000000000..db155ac459 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D3.x.RA.matmat.00000 @@ -0,0 +1,193 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 3 + +Grid: +2 +1 +0: (0, 0) x (9, 9) + +Periodic: (10, 0) + +Range Stride: (2, 1) +Domain Stride: (1, 1) + +Stencil: +11 +0: (0, 0) +1: (1, 0) +2: (-1, 0) +3: (-2, 0) +4: (2, 0) +5: (0, -1) +6: (1, -1) +7: (-1, -1) +8: (0, 1) +9: (1, 1) +10: (-1, 1) + +Constant Data: +8 +*: (*; 3) -5.00000000000000e-01 +*: (*; 4) -5.00000000000000e-01 +*: (*; 5) -1.00000000000000e+00 +*: (*; 6) -5.00000000000000e-01 +*: (*; 7) -5.00000000000000e-01 +*: (*; 8) -1.00000000000000e+00 +*: (*; 9) -5.00000000000000e-01 +*: (*; 10) -5.00000000000000e-01 + +Variable Data: +3 +0: (0, 0; 0) 3.00000000000000e+00 +0: (0, 0; 1) 1.00000000000000e+00 +0: (0, 0; 2) 1.00000000000000e+00 +0: (1, 0; 0) 3.00000000000000e+00 +0: (1, 0; 1) 1.00000000000000e+00 +0: (1, 0; 2) 1.00000000000000e+00 +0: (2, 0; 0) 3.00000000000000e+00 +0: (2, 0; 1) 1.00000000000000e+00 +0: (2, 0; 2) 1.00000000000000e+00 +0: (3, 0; 0) 3.00000000000000e+00 +0: (3, 0; 1) 1.00000000000000e+00 +0: (3, 0; 2) 1.00000000000000e+00 +0: (4, 0; 0) 3.00000000000000e+00 +0: (4, 0; 1) 1.00000000000000e+00 +0: (4, 0; 2) 1.00000000000000e+00 +0: (0, 1; 0) 3.00000000000000e+00 +0: (0, 1; 1) 1.00000000000000e+00 +0: (0, 1; 2) 1.00000000000000e+00 +0: (1, 1; 0) 3.00000000000000e+00 +0: (1, 1; 1) 1.00000000000000e+00 +0: (1, 1; 2) 1.00000000000000e+00 +0: (2, 1; 0) 3.00000000000000e+00 +0: (2, 1; 1) 1.00000000000000e+00 +0: (2, 1; 2) 1.00000000000000e+00 +0: (3, 1; 0) 3.00000000000000e+00 +0: (3, 1; 1) 1.00000000000000e+00 +0: (3, 1; 2) 1.00000000000000e+00 +0: (4, 1; 0) 3.00000000000000e+00 +0: (4, 1; 1) 1.00000000000000e+00 +0: (4, 1; 2) 1.00000000000000e+00 +0: (0, 2; 0) 3.00000000000000e+00 +0: (0, 2; 1) 1.00000000000000e+00 +0: (0, 2; 2) 1.00000000000000e+00 +0: (1, 2; 0) 3.00000000000000e+00 +0: (1, 2; 1) 1.00000000000000e+00 +0: (1, 2; 2) 1.00000000000000e+00 +0: (2, 2; 0) 3.00000000000000e+00 +0: (2, 2; 1) 1.00000000000000e+00 +0: (2, 2; 2) 1.00000000000000e+00 +0: (3, 2; 0) 3.00000000000000e+00 +0: (3, 2; 1) 1.00000000000000e+00 +0: (3, 2; 2) 1.00000000000000e+00 +0: (4, 2; 0) 3.00000000000000e+00 +0: (4, 2; 1) 1.00000000000000e+00 +0: (4, 2; 2) 1.00000000000000e+00 +0: (0, 3; 0) 3.00000000000000e+00 +0: (0, 3; 1) 1.00000000000000e+00 +0: (0, 3; 2) 1.00000000000000e+00 +0: (1, 3; 0) 3.00000000000000e+00 +0: (1, 3; 1) 1.00000000000000e+00 +0: (1, 3; 2) 1.00000000000000e+00 +0: (2, 3; 0) 3.00000000000000e+00 +0: (2, 3; 1) 1.00000000000000e+00 +0: (2, 3; 2) 1.00000000000000e+00 +0: (3, 3; 0) 3.00000000000000e+00 +0: (3, 3; 1) 1.00000000000000e+00 +0: (3, 3; 2) 1.00000000000000e+00 +0: (4, 3; 0) 3.00000000000000e+00 +0: (4, 3; 1) 1.00000000000000e+00 +0: (4, 3; 2) 1.00000000000000e+00 +0: (0, 4; 0) 3.00000000000000e+00 +0: (0, 4; 1) 1.00000000000000e+00 +0: (0, 4; 2) 1.00000000000000e+00 +0: (1, 4; 0) 3.00000000000000e+00 +0: (1, 4; 1) 1.00000000000000e+00 +0: (1, 4; 2) 1.00000000000000e+00 +0: (2, 4; 0) 3.00000000000000e+00 +0: (2, 4; 1) 1.00000000000000e+00 +0: (2, 4; 2) 1.00000000000000e+00 +0: (3, 4; 0) 3.00000000000000e+00 +0: (3, 4; 1) 1.00000000000000e+00 +0: (3, 4; 2) 1.00000000000000e+00 +0: (4, 4; 0) 3.00000000000000e+00 +0: (4, 4; 1) 1.00000000000000e+00 +0: (4, 4; 2) 1.00000000000000e+00 +0: (0, 5; 0) 3.00000000000000e+00 +0: (0, 5; 1) 1.00000000000000e+00 +0: (0, 5; 2) 1.00000000000000e+00 +0: (1, 5; 0) 3.00000000000000e+00 +0: (1, 5; 1) 1.00000000000000e+00 +0: (1, 5; 2) 1.00000000000000e+00 +0: (2, 5; 0) 3.00000000000000e+00 +0: (2, 5; 1) 1.00000000000000e+00 +0: (2, 5; 2) 1.00000000000000e+00 +0: (3, 5; 0) 3.00000000000000e+00 +0: (3, 5; 1) 1.00000000000000e+00 +0: (3, 5; 2) 1.00000000000000e+00 +0: (4, 5; 0) 3.00000000000000e+00 +0: (4, 5; 1) 1.00000000000000e+00 +0: (4, 5; 2) 1.00000000000000e+00 +0: (0, 6; 0) 3.00000000000000e+00 +0: (0, 6; 1) 1.00000000000000e+00 +0: (0, 6; 2) 1.00000000000000e+00 +0: (1, 6; 0) 3.00000000000000e+00 +0: (1, 6; 1) 1.00000000000000e+00 +0: (1, 6; 2) 1.00000000000000e+00 +0: (2, 6; 0) 3.00000000000000e+00 +0: (2, 6; 1) 1.00000000000000e+00 +0: (2, 6; 2) 1.00000000000000e+00 +0: (3, 6; 0) 3.00000000000000e+00 +0: (3, 6; 1) 1.00000000000000e+00 +0: (3, 6; 2) 1.00000000000000e+00 +0: (4, 6; 0) 3.00000000000000e+00 +0: (4, 6; 1) 1.00000000000000e+00 +0: (4, 6; 2) 1.00000000000000e+00 +0: (0, 7; 0) 3.00000000000000e+00 +0: (0, 7; 1) 1.00000000000000e+00 +0: (0, 7; 2) 1.00000000000000e+00 +0: (1, 7; 0) 3.00000000000000e+00 +0: (1, 7; 1) 1.00000000000000e+00 +0: (1, 7; 2) 1.00000000000000e+00 +0: (2, 7; 0) 3.00000000000000e+00 +0: (2, 7; 1) 1.00000000000000e+00 +0: (2, 7; 2) 1.00000000000000e+00 +0: (3, 7; 0) 3.00000000000000e+00 +0: (3, 7; 1) 1.00000000000000e+00 +0: (3, 7; 2) 1.00000000000000e+00 +0: (4, 7; 0) 3.00000000000000e+00 +0: (4, 7; 1) 1.00000000000000e+00 +0: (4, 7; 2) 1.00000000000000e+00 +0: (0, 8; 0) 3.00000000000000e+00 +0: (0, 8; 1) 1.00000000000000e+00 +0: (0, 8; 2) 1.00000000000000e+00 +0: (1, 8; 0) 3.00000000000000e+00 +0: (1, 8; 1) 1.00000000000000e+00 +0: (1, 8; 2) 1.00000000000000e+00 +0: (2, 8; 0) 3.00000000000000e+00 +0: (2, 8; 1) 1.00000000000000e+00 +0: (2, 8; 2) 1.00000000000000e+00 +0: (3, 8; 0) 3.00000000000000e+00 +0: (3, 8; 1) 1.00000000000000e+00 +0: (3, 8; 2) 1.00000000000000e+00 +0: (4, 8; 0) 3.00000000000000e+00 +0: (4, 8; 1) 1.00000000000000e+00 +0: (4, 8; 2) 1.00000000000000e+00 +0: (0, 9; 0) 3.00000000000000e+00 +0: (0, 9; 1) 1.00000000000000e+00 +0: (0, 9; 2) 1.00000000000000e+00 +0: (1, 9; 0) 3.00000000000000e+00 +0: (1, 9; 1) 1.00000000000000e+00 +0: (1, 9; 2) 1.00000000000000e+00 +0: (2, 9; 0) 3.00000000000000e+00 +0: (2, 9; 1) 1.00000000000000e+00 +0: (2, 9; 2) 1.00000000000000e+00 +0: (3, 9; 0) 3.00000000000000e+00 +0: (3, 9; 1) 1.00000000000000e+00 +0: (3, 9; 2) 1.00000000000000e+00 +0: (4, 9; 0) 3.00000000000000e+00 +0: (4, 9; 1) 1.00000000000000e+00 +0: (4, 9; 2) 1.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D3.x.matmat.00000 b/src/test/TEST_structmat/structmat.saved.2D3.x.matmat.00000 new file mode 100644 index 0000000000..f60a9d7e24 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D3.x.matmat.00000 @@ -0,0 +1,189 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 3 + +Grid: +2 +1 +0: (0, 0) x (4, 9) + +Periodic: (5, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (-1, 1) +7: (1, -1) +8: (1, 1) + +Constant Data: +6 +*: (*; 3) -1.50000000000000e+00 +*: (*; 4) -1.50000000000000e+00 +*: (*; 5) -2.50000000000000e-01 +*: (*; 6) -2.50000000000000e-01 +*: (*; 7) -2.50000000000000e-01 +*: (*; 8) -2.50000000000000e-01 + +Variable Data: +3 +0: (0, 0; 0) 4.00000000000000e+00 +0: (0, 0; 1) 0.00000000000000e+00 +0: (0, 0; 2) 0.00000000000000e+00 +0: (1, 0; 0) 4.00000000000000e+00 +0: (1, 0; 1) 0.00000000000000e+00 +0: (1, 0; 2) 0.00000000000000e+00 +0: (2, 0; 0) 4.00000000000000e+00 +0: (2, 0; 1) 0.00000000000000e+00 +0: (2, 0; 2) 0.00000000000000e+00 +0: (3, 0; 0) 4.00000000000000e+00 +0: (3, 0; 1) 0.00000000000000e+00 +0: (3, 0; 2) 0.00000000000000e+00 +0: (4, 0; 0) 4.00000000000000e+00 +0: (4, 0; 1) 0.00000000000000e+00 +0: (4, 0; 2) 0.00000000000000e+00 +0: (0, 1; 0) 4.00000000000000e+00 +0: (0, 1; 1) 0.00000000000000e+00 +0: (0, 1; 2) 0.00000000000000e+00 +0: (1, 1; 0) 4.00000000000000e+00 +0: (1, 1; 1) 0.00000000000000e+00 +0: (1, 1; 2) 0.00000000000000e+00 +0: (2, 1; 0) 4.00000000000000e+00 +0: (2, 1; 1) 0.00000000000000e+00 +0: (2, 1; 2) 0.00000000000000e+00 +0: (3, 1; 0) 4.00000000000000e+00 +0: (3, 1; 1) 0.00000000000000e+00 +0: (3, 1; 2) 0.00000000000000e+00 +0: (4, 1; 0) 4.00000000000000e+00 +0: (4, 1; 1) 0.00000000000000e+00 +0: (4, 1; 2) 0.00000000000000e+00 +0: (0, 2; 0) 4.00000000000000e+00 +0: (0, 2; 1) 0.00000000000000e+00 +0: (0, 2; 2) 0.00000000000000e+00 +0: (1, 2; 0) 4.00000000000000e+00 +0: (1, 2; 1) 0.00000000000000e+00 +0: (1, 2; 2) 0.00000000000000e+00 +0: (2, 2; 0) 4.00000000000000e+00 +0: (2, 2; 1) 0.00000000000000e+00 +0: (2, 2; 2) 0.00000000000000e+00 +0: (3, 2; 0) 4.00000000000000e+00 +0: (3, 2; 1) 0.00000000000000e+00 +0: (3, 2; 2) 0.00000000000000e+00 +0: (4, 2; 0) 4.00000000000000e+00 +0: (4, 2; 1) 0.00000000000000e+00 +0: (4, 2; 2) 0.00000000000000e+00 +0: (0, 3; 0) 4.00000000000000e+00 +0: (0, 3; 1) 0.00000000000000e+00 +0: (0, 3; 2) 0.00000000000000e+00 +0: (1, 3; 0) 4.00000000000000e+00 +0: (1, 3; 1) 0.00000000000000e+00 +0: (1, 3; 2) 0.00000000000000e+00 +0: (2, 3; 0) 4.00000000000000e+00 +0: (2, 3; 1) 0.00000000000000e+00 +0: (2, 3; 2) 0.00000000000000e+00 +0: (3, 3; 0) 4.00000000000000e+00 +0: (3, 3; 1) 0.00000000000000e+00 +0: (3, 3; 2) 0.00000000000000e+00 +0: (4, 3; 0) 4.00000000000000e+00 +0: (4, 3; 1) 0.00000000000000e+00 +0: (4, 3; 2) 0.00000000000000e+00 +0: (0, 4; 0) 4.00000000000000e+00 +0: (0, 4; 1) 0.00000000000000e+00 +0: (0, 4; 2) 0.00000000000000e+00 +0: (1, 4; 0) 4.00000000000000e+00 +0: (1, 4; 1) 0.00000000000000e+00 +0: (1, 4; 2) 0.00000000000000e+00 +0: (2, 4; 0) 4.00000000000000e+00 +0: (2, 4; 1) 0.00000000000000e+00 +0: (2, 4; 2) 0.00000000000000e+00 +0: (3, 4; 0) 4.00000000000000e+00 +0: (3, 4; 1) 0.00000000000000e+00 +0: (3, 4; 2) 0.00000000000000e+00 +0: (4, 4; 0) 4.00000000000000e+00 +0: (4, 4; 1) 0.00000000000000e+00 +0: (4, 4; 2) 0.00000000000000e+00 +0: (0, 5; 0) 4.00000000000000e+00 +0: (0, 5; 1) 0.00000000000000e+00 +0: (0, 5; 2) 0.00000000000000e+00 +0: (1, 5; 0) 4.00000000000000e+00 +0: (1, 5; 1) 0.00000000000000e+00 +0: (1, 5; 2) 0.00000000000000e+00 +0: (2, 5; 0) 4.00000000000000e+00 +0: (2, 5; 1) 0.00000000000000e+00 +0: (2, 5; 2) 0.00000000000000e+00 +0: (3, 5; 0) 4.00000000000000e+00 +0: (3, 5; 1) 0.00000000000000e+00 +0: (3, 5; 2) 0.00000000000000e+00 +0: (4, 5; 0) 4.00000000000000e+00 +0: (4, 5; 1) 0.00000000000000e+00 +0: (4, 5; 2) 0.00000000000000e+00 +0: (0, 6; 0) 4.00000000000000e+00 +0: (0, 6; 1) 0.00000000000000e+00 +0: (0, 6; 2) 0.00000000000000e+00 +0: (1, 6; 0) 4.00000000000000e+00 +0: (1, 6; 1) 0.00000000000000e+00 +0: (1, 6; 2) 0.00000000000000e+00 +0: (2, 6; 0) 4.00000000000000e+00 +0: (2, 6; 1) 0.00000000000000e+00 +0: (2, 6; 2) 0.00000000000000e+00 +0: (3, 6; 0) 4.00000000000000e+00 +0: (3, 6; 1) 0.00000000000000e+00 +0: (3, 6; 2) 0.00000000000000e+00 +0: (4, 6; 0) 4.00000000000000e+00 +0: (4, 6; 1) 0.00000000000000e+00 +0: (4, 6; 2) 0.00000000000000e+00 +0: (0, 7; 0) 4.00000000000000e+00 +0: (0, 7; 1) 0.00000000000000e+00 +0: (0, 7; 2) 0.00000000000000e+00 +0: (1, 7; 0) 4.00000000000000e+00 +0: (1, 7; 1) 0.00000000000000e+00 +0: (1, 7; 2) 0.00000000000000e+00 +0: (2, 7; 0) 4.00000000000000e+00 +0: (2, 7; 1) 0.00000000000000e+00 +0: (2, 7; 2) 0.00000000000000e+00 +0: (3, 7; 0) 4.00000000000000e+00 +0: (3, 7; 1) 0.00000000000000e+00 +0: (3, 7; 2) 0.00000000000000e+00 +0: (4, 7; 0) 4.00000000000000e+00 +0: (4, 7; 1) 0.00000000000000e+00 +0: (4, 7; 2) 0.00000000000000e+00 +0: (0, 8; 0) 4.00000000000000e+00 +0: (0, 8; 1) 0.00000000000000e+00 +0: (0, 8; 2) 0.00000000000000e+00 +0: (1, 8; 0) 4.00000000000000e+00 +0: (1, 8; 1) 0.00000000000000e+00 +0: (1, 8; 2) 0.00000000000000e+00 +0: (2, 8; 0) 4.00000000000000e+00 +0: (2, 8; 1) 0.00000000000000e+00 +0: (2, 8; 2) 0.00000000000000e+00 +0: (3, 8; 0) 4.00000000000000e+00 +0: (3, 8; 1) 0.00000000000000e+00 +0: (3, 8; 2) 0.00000000000000e+00 +0: (4, 8; 0) 4.00000000000000e+00 +0: (4, 8; 1) 0.00000000000000e+00 +0: (4, 8; 2) 0.00000000000000e+00 +0: (0, 9; 0) 4.00000000000000e+00 +0: (0, 9; 1) 0.00000000000000e+00 +0: (0, 9; 2) 0.00000000000000e+00 +0: (1, 9; 0) 4.00000000000000e+00 +0: (1, 9; 1) 0.00000000000000e+00 +0: (1, 9; 2) 0.00000000000000e+00 +0: (2, 9; 0) 4.00000000000000e+00 +0: (2, 9; 1) 0.00000000000000e+00 +0: (2, 9; 2) 0.00000000000000e+00 +0: (3, 9; 0) 4.00000000000000e+00 +0: (3, 9; 1) 0.00000000000000e+00 +0: (3, 9; 2) 0.00000000000000e+00 +0: (4, 9; 0) 4.00000000000000e+00 +0: (4, 9; 1) 0.00000000000000e+00 +0: (4, 9; 2) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D3.y.4.matmat.00000 b/src/test/TEST_structmat/structmat.saved.2D3.y.4.matmat.00000 new file mode 100644 index 0000000000..209d0dbd61 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D3.y.4.matmat.00000 @@ -0,0 +1,84 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 3 + +Grid: +2 +1 +0: (0, 0) x (4, 2) + +Periodic: (10, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (1, -1) +7: (-1, 1) +8: (1, 1) + +Constant Data: +6 +*: (*; 1) -1.50000000000000e+00 +*: (*; 2) -1.50000000000000e+00 +*: (*; 5) -2.50000000000000e-01 +*: (*; 6) -2.50000000000000e-01 +*: (*; 7) -2.50000000000000e-01 +*: (*; 8) -2.50000000000000e-01 + +Variable Data: +3 +0: (0, 0; 0) 4.00000000000000e+00 +0: (0, 0; 3) 0.00000000000000e+00 +0: (0, 0; 4) 0.00000000000000e+00 +0: (1, 0; 0) 4.00000000000000e+00 +0: (1, 0; 3) 0.00000000000000e+00 +0: (1, 0; 4) 0.00000000000000e+00 +0: (2, 0; 0) 4.00000000000000e+00 +0: (2, 0; 3) 0.00000000000000e+00 +0: (2, 0; 4) 0.00000000000000e+00 +0: (3, 0; 0) 4.00000000000000e+00 +0: (3, 0; 3) 0.00000000000000e+00 +0: (3, 0; 4) 0.00000000000000e+00 +0: (4, 0; 0) 4.00000000000000e+00 +0: (4, 0; 3) 0.00000000000000e+00 +0: (4, 0; 4) 0.00000000000000e+00 +0: (0, 1; 0) 4.00000000000000e+00 +0: (0, 1; 3) 0.00000000000000e+00 +0: (0, 1; 4) 0.00000000000000e+00 +0: (1, 1; 0) 4.00000000000000e+00 +0: (1, 1; 3) 0.00000000000000e+00 +0: (1, 1; 4) 0.00000000000000e+00 +0: (2, 1; 0) 4.00000000000000e+00 +0: (2, 1; 3) 0.00000000000000e+00 +0: (2, 1; 4) 0.00000000000000e+00 +0: (3, 1; 0) 4.00000000000000e+00 +0: (3, 1; 3) 0.00000000000000e+00 +0: (3, 1; 4) 0.00000000000000e+00 +0: (4, 1; 0) 4.00000000000000e+00 +0: (4, 1; 3) 0.00000000000000e+00 +0: (4, 1; 4) 0.00000000000000e+00 +0: (0, 2; 0) 4.00000000000000e+00 +0: (0, 2; 3) 0.00000000000000e+00 +0: (0, 2; 4) 0.00000000000000e+00 +0: (1, 2; 0) 4.00000000000000e+00 +0: (1, 2; 3) 0.00000000000000e+00 +0: (1, 2; 4) 0.00000000000000e+00 +0: (2, 2; 0) 4.00000000000000e+00 +0: (2, 2; 3) 0.00000000000000e+00 +0: (2, 2; 4) 0.00000000000000e+00 +0: (3, 2; 0) 4.00000000000000e+00 +0: (3, 2; 3) 0.00000000000000e+00 +0: (3, 2; 4) 0.00000000000000e+00 +0: (4, 2; 0) 4.00000000000000e+00 +0: (4, 2; 3) 0.00000000000000e+00 +0: (4, 2; 4) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D3.y.4.matmat.00001 b/src/test/TEST_structmat/structmat.saved.2D3.y.4.matmat.00001 new file mode 100644 index 0000000000..015f4e5a23 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D3.y.4.matmat.00001 @@ -0,0 +1,84 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 3 + +Grid: +2 +1 +0: (5, 0) x (9, 2) + +Periodic: (10, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (1, -1) +7: (-1, 1) +8: (1, 1) + +Constant Data: +6 +*: (*; 1) -1.50000000000000e+00 +*: (*; 2) -1.50000000000000e+00 +*: (*; 5) -2.50000000000000e-01 +*: (*; 6) -2.50000000000000e-01 +*: (*; 7) -2.50000000000000e-01 +*: (*; 8) -2.50000000000000e-01 + +Variable Data: +3 +0: (5, 0; 0) 4.00000000000000e+00 +0: (5, 0; 3) 0.00000000000000e+00 +0: (5, 0; 4) 0.00000000000000e+00 +0: (6, 0; 0) 4.00000000000000e+00 +0: (6, 0; 3) 0.00000000000000e+00 +0: (6, 0; 4) 0.00000000000000e+00 +0: (7, 0; 0) 4.00000000000000e+00 +0: (7, 0; 3) 0.00000000000000e+00 +0: (7, 0; 4) 0.00000000000000e+00 +0: (8, 0; 0) 4.00000000000000e+00 +0: (8, 0; 3) 0.00000000000000e+00 +0: (8, 0; 4) 0.00000000000000e+00 +0: (9, 0; 0) 4.00000000000000e+00 +0: (9, 0; 3) 0.00000000000000e+00 +0: (9, 0; 4) 0.00000000000000e+00 +0: (5, 1; 0) 4.00000000000000e+00 +0: (5, 1; 3) 0.00000000000000e+00 +0: (5, 1; 4) 0.00000000000000e+00 +0: (6, 1; 0) 4.00000000000000e+00 +0: (6, 1; 3) 0.00000000000000e+00 +0: (6, 1; 4) 0.00000000000000e+00 +0: (7, 1; 0) 4.00000000000000e+00 +0: (7, 1; 3) 0.00000000000000e+00 +0: (7, 1; 4) 0.00000000000000e+00 +0: (8, 1; 0) 4.00000000000000e+00 +0: (8, 1; 3) 0.00000000000000e+00 +0: (8, 1; 4) 0.00000000000000e+00 +0: (9, 1; 0) 4.00000000000000e+00 +0: (9, 1; 3) 0.00000000000000e+00 +0: (9, 1; 4) 0.00000000000000e+00 +0: (5, 2; 0) 4.00000000000000e+00 +0: (5, 2; 3) 0.00000000000000e+00 +0: (5, 2; 4) 0.00000000000000e+00 +0: (6, 2; 0) 4.00000000000000e+00 +0: (6, 2; 3) 0.00000000000000e+00 +0: (6, 2; 4) 0.00000000000000e+00 +0: (7, 2; 0) 4.00000000000000e+00 +0: (7, 2; 3) 0.00000000000000e+00 +0: (7, 2; 4) 0.00000000000000e+00 +0: (8, 2; 0) 4.00000000000000e+00 +0: (8, 2; 3) 0.00000000000000e+00 +0: (8, 2; 4) 0.00000000000000e+00 +0: (9, 2; 0) 4.00000000000000e+00 +0: (9, 2; 3) 0.00000000000000e+00 +0: (9, 2; 4) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D3.y.4.matmat.00002 b/src/test/TEST_structmat/structmat.saved.2D3.y.4.matmat.00002 new file mode 100644 index 0000000000..4b7efb0d9a --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D3.y.4.matmat.00002 @@ -0,0 +1,69 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 3 + +Grid: +2 +1 +0: (0, 3) x (4, 4) + +Periodic: (10, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (1, -1) +7: (-1, 1) +8: (1, 1) + +Constant Data: +6 +*: (*; 1) -1.50000000000000e+00 +*: (*; 2) -1.50000000000000e+00 +*: (*; 5) -2.50000000000000e-01 +*: (*; 6) -2.50000000000000e-01 +*: (*; 7) -2.50000000000000e-01 +*: (*; 8) -2.50000000000000e-01 + +Variable Data: +3 +0: (0, 3; 0) 4.00000000000000e+00 +0: (0, 3; 3) 0.00000000000000e+00 +0: (0, 3; 4) 0.00000000000000e+00 +0: (1, 3; 0) 4.00000000000000e+00 +0: (1, 3; 3) 0.00000000000000e+00 +0: (1, 3; 4) 0.00000000000000e+00 +0: (2, 3; 0) 4.00000000000000e+00 +0: (2, 3; 3) 0.00000000000000e+00 +0: (2, 3; 4) 0.00000000000000e+00 +0: (3, 3; 0) 4.00000000000000e+00 +0: (3, 3; 3) 0.00000000000000e+00 +0: (3, 3; 4) 0.00000000000000e+00 +0: (4, 3; 0) 4.00000000000000e+00 +0: (4, 3; 3) 0.00000000000000e+00 +0: (4, 3; 4) 0.00000000000000e+00 +0: (0, 4; 0) 4.00000000000000e+00 +0: (0, 4; 3) 0.00000000000000e+00 +0: (0, 4; 4) 0.00000000000000e+00 +0: (1, 4; 0) 4.00000000000000e+00 +0: (1, 4; 3) 0.00000000000000e+00 +0: (1, 4; 4) 0.00000000000000e+00 +0: (2, 4; 0) 4.00000000000000e+00 +0: (2, 4; 3) 0.00000000000000e+00 +0: (2, 4; 4) 0.00000000000000e+00 +0: (3, 4; 0) 4.00000000000000e+00 +0: (3, 4; 3) 0.00000000000000e+00 +0: (3, 4; 4) 0.00000000000000e+00 +0: (4, 4; 0) 4.00000000000000e+00 +0: (4, 4; 3) 0.00000000000000e+00 +0: (4, 4; 4) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D3.y.4.matmat.00003 b/src/test/TEST_structmat/structmat.saved.2D3.y.4.matmat.00003 new file mode 100644 index 0000000000..4b138adae9 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D3.y.4.matmat.00003 @@ -0,0 +1,69 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 3 + +Grid: +2 +1 +0: (5, 3) x (9, 4) + +Periodic: (10, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (1, -1) +7: (-1, 1) +8: (1, 1) + +Constant Data: +6 +*: (*; 1) -1.50000000000000e+00 +*: (*; 2) -1.50000000000000e+00 +*: (*; 5) -2.50000000000000e-01 +*: (*; 6) -2.50000000000000e-01 +*: (*; 7) -2.50000000000000e-01 +*: (*; 8) -2.50000000000000e-01 + +Variable Data: +3 +0: (5, 3; 0) 4.00000000000000e+00 +0: (5, 3; 3) 0.00000000000000e+00 +0: (5, 3; 4) 0.00000000000000e+00 +0: (6, 3; 0) 4.00000000000000e+00 +0: (6, 3; 3) 0.00000000000000e+00 +0: (6, 3; 4) 0.00000000000000e+00 +0: (7, 3; 0) 4.00000000000000e+00 +0: (7, 3; 3) 0.00000000000000e+00 +0: (7, 3; 4) 0.00000000000000e+00 +0: (8, 3; 0) 4.00000000000000e+00 +0: (8, 3; 3) 0.00000000000000e+00 +0: (8, 3; 4) 0.00000000000000e+00 +0: (9, 3; 0) 4.00000000000000e+00 +0: (9, 3; 3) 0.00000000000000e+00 +0: (9, 3; 4) 0.00000000000000e+00 +0: (5, 4; 0) 4.00000000000000e+00 +0: (5, 4; 3) 0.00000000000000e+00 +0: (5, 4; 4) 0.00000000000000e+00 +0: (6, 4; 0) 4.00000000000000e+00 +0: (6, 4; 3) 0.00000000000000e+00 +0: (6, 4; 4) 0.00000000000000e+00 +0: (7, 4; 0) 4.00000000000000e+00 +0: (7, 4; 3) 0.00000000000000e+00 +0: (7, 4; 4) 0.00000000000000e+00 +0: (8, 4; 0) 4.00000000000000e+00 +0: (8, 4; 3) 0.00000000000000e+00 +0: (8, 4; 4) 0.00000000000000e+00 +0: (9, 4; 0) 4.00000000000000e+00 +0: (9, 4; 3) 0.00000000000000e+00 +0: (9, 4; 4) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.2D3.y.matmat.00000 b/src/test/TEST_structmat/structmat.saved.2D3.y.matmat.00000 new file mode 100644 index 0000000000..b80372381d --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.2D3.y.matmat.00000 @@ -0,0 +1,189 @@ +StructMatrix + +Symmetric: 0 + +ConstantCoefficient: 3 + +Grid: +2 +1 +0: (0, 0) x (9, 4) + +Periodic: (10, 0) + +Range Stride: (1, 1) +Domain Stride: (1, 1) + +Stencil: +9 +0: (0, 0) +1: (-1, 0) +2: (1, 0) +3: (0, -1) +4: (0, 1) +5: (-1, -1) +6: (1, -1) +7: (-1, 1) +8: (1, 1) + +Constant Data: +6 +*: (*; 1) -1.50000000000000e+00 +*: (*; 2) -1.50000000000000e+00 +*: (*; 5) -2.50000000000000e-01 +*: (*; 6) -2.50000000000000e-01 +*: (*; 7) -2.50000000000000e-01 +*: (*; 8) -2.50000000000000e-01 + +Variable Data: +3 +0: (0, 0; 0) 4.00000000000000e+00 +0: (0, 0; 3) 0.00000000000000e+00 +0: (0, 0; 4) 0.00000000000000e+00 +0: (1, 0; 0) 4.00000000000000e+00 +0: (1, 0; 3) 0.00000000000000e+00 +0: (1, 0; 4) 0.00000000000000e+00 +0: (2, 0; 0) 4.00000000000000e+00 +0: (2, 0; 3) 0.00000000000000e+00 +0: (2, 0; 4) 0.00000000000000e+00 +0: (3, 0; 0) 4.00000000000000e+00 +0: (3, 0; 3) 0.00000000000000e+00 +0: (3, 0; 4) 0.00000000000000e+00 +0: (4, 0; 0) 4.00000000000000e+00 +0: (4, 0; 3) 0.00000000000000e+00 +0: (4, 0; 4) 0.00000000000000e+00 +0: (5, 0; 0) 4.00000000000000e+00 +0: (5, 0; 3) 0.00000000000000e+00 +0: (5, 0; 4) 0.00000000000000e+00 +0: (6, 0; 0) 4.00000000000000e+00 +0: (6, 0; 3) 0.00000000000000e+00 +0: (6, 0; 4) 0.00000000000000e+00 +0: (7, 0; 0) 4.00000000000000e+00 +0: (7, 0; 3) 0.00000000000000e+00 +0: (7, 0; 4) 0.00000000000000e+00 +0: (8, 0; 0) 4.00000000000000e+00 +0: (8, 0; 3) 0.00000000000000e+00 +0: (8, 0; 4) 0.00000000000000e+00 +0: (9, 0; 0) 4.00000000000000e+00 +0: (9, 0; 3) 0.00000000000000e+00 +0: (9, 0; 4) 0.00000000000000e+00 +0: (0, 1; 0) 4.00000000000000e+00 +0: (0, 1; 3) 0.00000000000000e+00 +0: (0, 1; 4) 0.00000000000000e+00 +0: (1, 1; 0) 4.00000000000000e+00 +0: (1, 1; 3) 0.00000000000000e+00 +0: (1, 1; 4) 0.00000000000000e+00 +0: (2, 1; 0) 4.00000000000000e+00 +0: (2, 1; 3) 0.00000000000000e+00 +0: (2, 1; 4) 0.00000000000000e+00 +0: (3, 1; 0) 4.00000000000000e+00 +0: (3, 1; 3) 0.00000000000000e+00 +0: (3, 1; 4) 0.00000000000000e+00 +0: (4, 1; 0) 4.00000000000000e+00 +0: (4, 1; 3) 0.00000000000000e+00 +0: (4, 1; 4) 0.00000000000000e+00 +0: (5, 1; 0) 4.00000000000000e+00 +0: (5, 1; 3) 0.00000000000000e+00 +0: (5, 1; 4) 0.00000000000000e+00 +0: (6, 1; 0) 4.00000000000000e+00 +0: (6, 1; 3) 0.00000000000000e+00 +0: (6, 1; 4) 0.00000000000000e+00 +0: (7, 1; 0) 4.00000000000000e+00 +0: (7, 1; 3) 0.00000000000000e+00 +0: (7, 1; 4) 0.00000000000000e+00 +0: (8, 1; 0) 4.00000000000000e+00 +0: (8, 1; 3) 0.00000000000000e+00 +0: (8, 1; 4) 0.00000000000000e+00 +0: (9, 1; 0) 4.00000000000000e+00 +0: (9, 1; 3) 0.00000000000000e+00 +0: (9, 1; 4) 0.00000000000000e+00 +0: (0, 2; 0) 4.00000000000000e+00 +0: (0, 2; 3) 0.00000000000000e+00 +0: (0, 2; 4) 0.00000000000000e+00 +0: (1, 2; 0) 4.00000000000000e+00 +0: (1, 2; 3) 0.00000000000000e+00 +0: (1, 2; 4) 0.00000000000000e+00 +0: (2, 2; 0) 4.00000000000000e+00 +0: (2, 2; 3) 0.00000000000000e+00 +0: (2, 2; 4) 0.00000000000000e+00 +0: (3, 2; 0) 4.00000000000000e+00 +0: (3, 2; 3) 0.00000000000000e+00 +0: (3, 2; 4) 0.00000000000000e+00 +0: (4, 2; 0) 4.00000000000000e+00 +0: (4, 2; 3) 0.00000000000000e+00 +0: (4, 2; 4) 0.00000000000000e+00 +0: (5, 2; 0) 4.00000000000000e+00 +0: (5, 2; 3) 0.00000000000000e+00 +0: (5, 2; 4) 0.00000000000000e+00 +0: (6, 2; 0) 4.00000000000000e+00 +0: (6, 2; 3) 0.00000000000000e+00 +0: (6, 2; 4) 0.00000000000000e+00 +0: (7, 2; 0) 4.00000000000000e+00 +0: (7, 2; 3) 0.00000000000000e+00 +0: (7, 2; 4) 0.00000000000000e+00 +0: (8, 2; 0) 4.00000000000000e+00 +0: (8, 2; 3) 0.00000000000000e+00 +0: (8, 2; 4) 0.00000000000000e+00 +0: (9, 2; 0) 4.00000000000000e+00 +0: (9, 2; 3) 0.00000000000000e+00 +0: (9, 2; 4) 0.00000000000000e+00 +0: (0, 3; 0) 4.00000000000000e+00 +0: (0, 3; 3) 0.00000000000000e+00 +0: (0, 3; 4) 0.00000000000000e+00 +0: (1, 3; 0) 4.00000000000000e+00 +0: (1, 3; 3) 0.00000000000000e+00 +0: (1, 3; 4) 0.00000000000000e+00 +0: (2, 3; 0) 4.00000000000000e+00 +0: (2, 3; 3) 0.00000000000000e+00 +0: (2, 3; 4) 0.00000000000000e+00 +0: (3, 3; 0) 4.00000000000000e+00 +0: (3, 3; 3) 0.00000000000000e+00 +0: (3, 3; 4) 0.00000000000000e+00 +0: (4, 3; 0) 4.00000000000000e+00 +0: (4, 3; 3) 0.00000000000000e+00 +0: (4, 3; 4) 0.00000000000000e+00 +0: (5, 3; 0) 4.00000000000000e+00 +0: (5, 3; 3) 0.00000000000000e+00 +0: (5, 3; 4) 0.00000000000000e+00 +0: (6, 3; 0) 4.00000000000000e+00 +0: (6, 3; 3) 0.00000000000000e+00 +0: (6, 3; 4) 0.00000000000000e+00 +0: (7, 3; 0) 4.00000000000000e+00 +0: (7, 3; 3) 0.00000000000000e+00 +0: (7, 3; 4) 0.00000000000000e+00 +0: (8, 3; 0) 4.00000000000000e+00 +0: (8, 3; 3) 0.00000000000000e+00 +0: (8, 3; 4) 0.00000000000000e+00 +0: (9, 3; 0) 4.00000000000000e+00 +0: (9, 3; 3) 0.00000000000000e+00 +0: (9, 3; 4) 0.00000000000000e+00 +0: (0, 4; 0) 4.00000000000000e+00 +0: (0, 4; 3) 0.00000000000000e+00 +0: (0, 4; 4) 0.00000000000000e+00 +0: (1, 4; 0) 4.00000000000000e+00 +0: (1, 4; 3) 0.00000000000000e+00 +0: (1, 4; 4) 0.00000000000000e+00 +0: (2, 4; 0) 4.00000000000000e+00 +0: (2, 4; 3) 0.00000000000000e+00 +0: (2, 4; 4) 0.00000000000000e+00 +0: (3, 4; 0) 4.00000000000000e+00 +0: (3, 4; 3) 0.00000000000000e+00 +0: (3, 4; 4) 0.00000000000000e+00 +0: (4, 4; 0) 4.00000000000000e+00 +0: (4, 4; 3) 0.00000000000000e+00 +0: (4, 4; 4) 0.00000000000000e+00 +0: (5, 4; 0) 4.00000000000000e+00 +0: (5, 4; 3) 0.00000000000000e+00 +0: (5, 4; 4) 0.00000000000000e+00 +0: (6, 4; 0) 4.00000000000000e+00 +0: (6, 4; 3) 0.00000000000000e+00 +0: (6, 4; 4) 0.00000000000000e+00 +0: (7, 4; 0) 4.00000000000000e+00 +0: (7, 4; 3) 0.00000000000000e+00 +0: (7, 4; 4) 0.00000000000000e+00 +0: (8, 4; 0) 4.00000000000000e+00 +0: (8, 4; 3) 0.00000000000000e+00 +0: (8, 4; 4) 0.00000000000000e+00 +0: (9, 4; 0) 4.00000000000000e+00 +0: (9, 4; 3) 0.00000000000000e+00 +0: (9, 4; 4) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.ab0.mv0.matvec.00000 b/src/test/TEST_structmat/structmat.saved.ab0.mv0.matvec.00000 new file mode 100644 index 0000000000..46d6b5b4e2 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.ab0.mv0.matvec.00000 @@ -0,0 +1,67 @@ +StructVector + +Grid: +2 +1 +0: (0, 0) x (7, 6) + +Periodic: (8, 0) + +Data: +1 +0: (0, 0; 0) 0.00000000000000e+00 +0: (1, 0; 0) 0.00000000000000e+00 +0: (2, 0; 0) 0.00000000000000e+00 +0: (3, 0; 0) 0.00000000000000e+00 +0: (4, 0; 0) 0.00000000000000e+00 +0: (5, 0; 0) 0.00000000000000e+00 +0: (6, 0; 0) 0.00000000000000e+00 +0: (7, 0; 0) 0.00000000000000e+00 +0: (0, 1; 0) 0.00000000000000e+00 +0: (1, 1; 0) 0.00000000000000e+00 +0: (2, 1; 0) 0.00000000000000e+00 +0: (3, 1; 0) 0.00000000000000e+00 +0: (4, 1; 0) 0.00000000000000e+00 +0: (5, 1; 0) 0.00000000000000e+00 +0: (6, 1; 0) 0.00000000000000e+00 +0: (7, 1; 0) 0.00000000000000e+00 +0: (0, 2; 0) 0.00000000000000e+00 +0: (1, 2; 0) 0.00000000000000e+00 +0: (2, 2; 0) 0.00000000000000e+00 +0: (3, 2; 0) 0.00000000000000e+00 +0: (4, 2; 0) 0.00000000000000e+00 +0: (5, 2; 0) 0.00000000000000e+00 +0: (6, 2; 0) 0.00000000000000e+00 +0: (7, 2; 0) 0.00000000000000e+00 +0: (0, 3; 0) 0.00000000000000e+00 +0: (1, 3; 0) 0.00000000000000e+00 +0: (2, 3; 0) 0.00000000000000e+00 +0: (3, 3; 0) 0.00000000000000e+00 +0: (4, 3; 0) 0.00000000000000e+00 +0: (5, 3; 0) 0.00000000000000e+00 +0: (6, 3; 0) 0.00000000000000e+00 +0: (7, 3; 0) 0.00000000000000e+00 +0: (0, 4; 0) 0.00000000000000e+00 +0: (1, 4; 0) 0.00000000000000e+00 +0: (2, 4; 0) 0.00000000000000e+00 +0: (3, 4; 0) 0.00000000000000e+00 +0: (4, 4; 0) 0.00000000000000e+00 +0: (5, 4; 0) 0.00000000000000e+00 +0: (6, 4; 0) 0.00000000000000e+00 +0: (7, 4; 0) 0.00000000000000e+00 +0: (0, 5; 0) 0.00000000000000e+00 +0: (1, 5; 0) 0.00000000000000e+00 +0: (2, 5; 0) 0.00000000000000e+00 +0: (3, 5; 0) 0.00000000000000e+00 +0: (4, 5; 0) 0.00000000000000e+00 +0: (5, 5; 0) 0.00000000000000e+00 +0: (6, 5; 0) 0.00000000000000e+00 +0: (7, 5; 0) 0.00000000000000e+00 +0: (0, 6; 0) 0.00000000000000e+00 +0: (1, 6; 0) 0.00000000000000e+00 +0: (2, 6; 0) 0.00000000000000e+00 +0: (3, 6; 0) 0.00000000000000e+00 +0: (4, 6; 0) 0.00000000000000e+00 +0: (5, 6; 0) 0.00000000000000e+00 +0: (6, 6; 0) 0.00000000000000e+00 +0: (7, 6; 0) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.ab0.mv1.matvec.00000 b/src/test/TEST_structmat/structmat.saved.ab0.mv1.matvec.00000 new file mode 100644 index 0000000000..46d6b5b4e2 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.ab0.mv1.matvec.00000 @@ -0,0 +1,67 @@ +StructVector + +Grid: +2 +1 +0: (0, 0) x (7, 6) + +Periodic: (8, 0) + +Data: +1 +0: (0, 0; 0) 0.00000000000000e+00 +0: (1, 0; 0) 0.00000000000000e+00 +0: (2, 0; 0) 0.00000000000000e+00 +0: (3, 0; 0) 0.00000000000000e+00 +0: (4, 0; 0) 0.00000000000000e+00 +0: (5, 0; 0) 0.00000000000000e+00 +0: (6, 0; 0) 0.00000000000000e+00 +0: (7, 0; 0) 0.00000000000000e+00 +0: (0, 1; 0) 0.00000000000000e+00 +0: (1, 1; 0) 0.00000000000000e+00 +0: (2, 1; 0) 0.00000000000000e+00 +0: (3, 1; 0) 0.00000000000000e+00 +0: (4, 1; 0) 0.00000000000000e+00 +0: (5, 1; 0) 0.00000000000000e+00 +0: (6, 1; 0) 0.00000000000000e+00 +0: (7, 1; 0) 0.00000000000000e+00 +0: (0, 2; 0) 0.00000000000000e+00 +0: (1, 2; 0) 0.00000000000000e+00 +0: (2, 2; 0) 0.00000000000000e+00 +0: (3, 2; 0) 0.00000000000000e+00 +0: (4, 2; 0) 0.00000000000000e+00 +0: (5, 2; 0) 0.00000000000000e+00 +0: (6, 2; 0) 0.00000000000000e+00 +0: (7, 2; 0) 0.00000000000000e+00 +0: (0, 3; 0) 0.00000000000000e+00 +0: (1, 3; 0) 0.00000000000000e+00 +0: (2, 3; 0) 0.00000000000000e+00 +0: (3, 3; 0) 0.00000000000000e+00 +0: (4, 3; 0) 0.00000000000000e+00 +0: (5, 3; 0) 0.00000000000000e+00 +0: (6, 3; 0) 0.00000000000000e+00 +0: (7, 3; 0) 0.00000000000000e+00 +0: (0, 4; 0) 0.00000000000000e+00 +0: (1, 4; 0) 0.00000000000000e+00 +0: (2, 4; 0) 0.00000000000000e+00 +0: (3, 4; 0) 0.00000000000000e+00 +0: (4, 4; 0) 0.00000000000000e+00 +0: (5, 4; 0) 0.00000000000000e+00 +0: (6, 4; 0) 0.00000000000000e+00 +0: (7, 4; 0) 0.00000000000000e+00 +0: (0, 5; 0) 0.00000000000000e+00 +0: (1, 5; 0) 0.00000000000000e+00 +0: (2, 5; 0) 0.00000000000000e+00 +0: (3, 5; 0) 0.00000000000000e+00 +0: (4, 5; 0) 0.00000000000000e+00 +0: (5, 5; 0) 0.00000000000000e+00 +0: (6, 5; 0) 0.00000000000000e+00 +0: (7, 5; 0) 0.00000000000000e+00 +0: (0, 6; 0) 0.00000000000000e+00 +0: (1, 6; 0) 0.00000000000000e+00 +0: (2, 6; 0) 0.00000000000000e+00 +0: (3, 6; 0) 0.00000000000000e+00 +0: (4, 6; 0) 0.00000000000000e+00 +0: (5, 6; 0) 0.00000000000000e+00 +0: (6, 6; 0) 0.00000000000000e+00 +0: (7, 6; 0) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.ab0.mv2.matvec.00000 b/src/test/TEST_structmat/structmat.saved.ab0.mv2.matvec.00000 new file mode 100644 index 0000000000..e8b63009b1 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.ab0.mv2.matvec.00000 @@ -0,0 +1,39 @@ +StructVector + +Grid: +2 +1 +0: (0, 0) x (3, 6) + +Periodic: (4, 0) + +Data: +1 +0: (0, 0; 0) 0.00000000000000e+00 +0: (1, 0; 0) 0.00000000000000e+00 +0: (2, 0; 0) 0.00000000000000e+00 +0: (3, 0; 0) 0.00000000000000e+00 +0: (0, 1; 0) 0.00000000000000e+00 +0: (1, 1; 0) 0.00000000000000e+00 +0: (2, 1; 0) 0.00000000000000e+00 +0: (3, 1; 0) 0.00000000000000e+00 +0: (0, 2; 0) 0.00000000000000e+00 +0: (1, 2; 0) 0.00000000000000e+00 +0: (2, 2; 0) 0.00000000000000e+00 +0: (3, 2; 0) 0.00000000000000e+00 +0: (0, 3; 0) 0.00000000000000e+00 +0: (1, 3; 0) 0.00000000000000e+00 +0: (2, 3; 0) 0.00000000000000e+00 +0: (3, 3; 0) 0.00000000000000e+00 +0: (0, 4; 0) 0.00000000000000e+00 +0: (1, 4; 0) 0.00000000000000e+00 +0: (2, 4; 0) 0.00000000000000e+00 +0: (3, 4; 0) 0.00000000000000e+00 +0: (0, 5; 0) 0.00000000000000e+00 +0: (1, 5; 0) 0.00000000000000e+00 +0: (2, 5; 0) 0.00000000000000e+00 +0: (3, 5; 0) 0.00000000000000e+00 +0: (0, 6; 0) 0.00000000000000e+00 +0: (1, 6; 0) 0.00000000000000e+00 +0: (2, 6; 0) 0.00000000000000e+00 +0: (3, 6; 0) 0.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.ab1.mv0.matvec.00000 b/src/test/TEST_structmat/structmat.saved.ab1.mv0.matvec.00000 new file mode 100644 index 0000000000..8fecf28579 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.ab1.mv0.matvec.00000 @@ -0,0 +1,67 @@ +StructVector + +Grid: +2 +1 +0: (0, 0) x (7, 6) + +Periodic: (8, 0) + +Data: +1 +0: (0, 0; 0) 2.00000000000000e+00 +0: (1, 0; 0) 2.00000000000000e+00 +0: (2, 0; 0) 2.00000000000000e+00 +0: (3, 0; 0) 2.00000000000000e+00 +0: (4, 0; 0) 2.00000000000000e+00 +0: (5, 0; 0) 2.00000000000000e+00 +0: (6, 0; 0) 2.00000000000000e+00 +0: (7, 0; 0) 2.00000000000000e+00 +0: (0, 1; 0) 2.00000000000000e+00 +0: (1, 1; 0) 2.00000000000000e+00 +0: (2, 1; 0) 2.00000000000000e+00 +0: (3, 1; 0) 2.00000000000000e+00 +0: (4, 1; 0) 2.00000000000000e+00 +0: (5, 1; 0) 2.00000000000000e+00 +0: (6, 1; 0) 2.00000000000000e+00 +0: (7, 1; 0) 2.00000000000000e+00 +0: (0, 2; 0) 2.00000000000000e+00 +0: (1, 2; 0) 2.00000000000000e+00 +0: (2, 2; 0) 2.00000000000000e+00 +0: (3, 2; 0) 2.00000000000000e+00 +0: (4, 2; 0) 2.00000000000000e+00 +0: (5, 2; 0) 2.00000000000000e+00 +0: (6, 2; 0) 2.00000000000000e+00 +0: (7, 2; 0) 2.00000000000000e+00 +0: (0, 3; 0) 2.00000000000000e+00 +0: (1, 3; 0) 2.00000000000000e+00 +0: (2, 3; 0) 2.00000000000000e+00 +0: (3, 3; 0) 2.00000000000000e+00 +0: (4, 3; 0) 2.00000000000000e+00 +0: (5, 3; 0) 2.00000000000000e+00 +0: (6, 3; 0) 2.00000000000000e+00 +0: (7, 3; 0) 2.00000000000000e+00 +0: (0, 4; 0) 2.00000000000000e+00 +0: (1, 4; 0) 2.00000000000000e+00 +0: (2, 4; 0) 2.00000000000000e+00 +0: (3, 4; 0) 2.00000000000000e+00 +0: (4, 4; 0) 2.00000000000000e+00 +0: (5, 4; 0) 2.00000000000000e+00 +0: (6, 4; 0) 2.00000000000000e+00 +0: (7, 4; 0) 2.00000000000000e+00 +0: (0, 5; 0) 2.00000000000000e+00 +0: (1, 5; 0) 2.00000000000000e+00 +0: (2, 5; 0) 2.00000000000000e+00 +0: (3, 5; 0) 2.00000000000000e+00 +0: (4, 5; 0) 2.00000000000000e+00 +0: (5, 5; 0) 2.00000000000000e+00 +0: (6, 5; 0) 2.00000000000000e+00 +0: (7, 5; 0) 2.00000000000000e+00 +0: (0, 6; 0) 2.00000000000000e+00 +0: (1, 6; 0) 2.00000000000000e+00 +0: (2, 6; 0) 2.00000000000000e+00 +0: (3, 6; 0) 2.00000000000000e+00 +0: (4, 6; 0) 2.00000000000000e+00 +0: (5, 6; 0) 2.00000000000000e+00 +0: (6, 6; 0) 2.00000000000000e+00 +0: (7, 6; 0) 2.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.ab1.mv1.matvec.00000 b/src/test/TEST_structmat/structmat.saved.ab1.mv1.matvec.00000 new file mode 100644 index 0000000000..8fecf28579 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.ab1.mv1.matvec.00000 @@ -0,0 +1,67 @@ +StructVector + +Grid: +2 +1 +0: (0, 0) x (7, 6) + +Periodic: (8, 0) + +Data: +1 +0: (0, 0; 0) 2.00000000000000e+00 +0: (1, 0; 0) 2.00000000000000e+00 +0: (2, 0; 0) 2.00000000000000e+00 +0: (3, 0; 0) 2.00000000000000e+00 +0: (4, 0; 0) 2.00000000000000e+00 +0: (5, 0; 0) 2.00000000000000e+00 +0: (6, 0; 0) 2.00000000000000e+00 +0: (7, 0; 0) 2.00000000000000e+00 +0: (0, 1; 0) 2.00000000000000e+00 +0: (1, 1; 0) 2.00000000000000e+00 +0: (2, 1; 0) 2.00000000000000e+00 +0: (3, 1; 0) 2.00000000000000e+00 +0: (4, 1; 0) 2.00000000000000e+00 +0: (5, 1; 0) 2.00000000000000e+00 +0: (6, 1; 0) 2.00000000000000e+00 +0: (7, 1; 0) 2.00000000000000e+00 +0: (0, 2; 0) 2.00000000000000e+00 +0: (1, 2; 0) 2.00000000000000e+00 +0: (2, 2; 0) 2.00000000000000e+00 +0: (3, 2; 0) 2.00000000000000e+00 +0: (4, 2; 0) 2.00000000000000e+00 +0: (5, 2; 0) 2.00000000000000e+00 +0: (6, 2; 0) 2.00000000000000e+00 +0: (7, 2; 0) 2.00000000000000e+00 +0: (0, 3; 0) 2.00000000000000e+00 +0: (1, 3; 0) 2.00000000000000e+00 +0: (2, 3; 0) 2.00000000000000e+00 +0: (3, 3; 0) 2.00000000000000e+00 +0: (4, 3; 0) 2.00000000000000e+00 +0: (5, 3; 0) 2.00000000000000e+00 +0: (6, 3; 0) 2.00000000000000e+00 +0: (7, 3; 0) 2.00000000000000e+00 +0: (0, 4; 0) 2.00000000000000e+00 +0: (1, 4; 0) 2.00000000000000e+00 +0: (2, 4; 0) 2.00000000000000e+00 +0: (3, 4; 0) 2.00000000000000e+00 +0: (4, 4; 0) 2.00000000000000e+00 +0: (5, 4; 0) 2.00000000000000e+00 +0: (6, 4; 0) 2.00000000000000e+00 +0: (7, 4; 0) 2.00000000000000e+00 +0: (0, 5; 0) 2.00000000000000e+00 +0: (1, 5; 0) 2.00000000000000e+00 +0: (2, 5; 0) 2.00000000000000e+00 +0: (3, 5; 0) 2.00000000000000e+00 +0: (4, 5; 0) 2.00000000000000e+00 +0: (5, 5; 0) 2.00000000000000e+00 +0: (6, 5; 0) 2.00000000000000e+00 +0: (7, 5; 0) 2.00000000000000e+00 +0: (0, 6; 0) 2.00000000000000e+00 +0: (1, 6; 0) 2.00000000000000e+00 +0: (2, 6; 0) 2.00000000000000e+00 +0: (3, 6; 0) 2.00000000000000e+00 +0: (4, 6; 0) 2.00000000000000e+00 +0: (5, 6; 0) 2.00000000000000e+00 +0: (6, 6; 0) 2.00000000000000e+00 +0: (7, 6; 0) 2.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.ab1.mv2.matvec.00000 b/src/test/TEST_structmat/structmat.saved.ab1.mv2.matvec.00000 new file mode 100644 index 0000000000..f44398f1b2 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.ab1.mv2.matvec.00000 @@ -0,0 +1,39 @@ +StructVector + +Grid: +2 +1 +0: (0, 0) x (3, 6) + +Periodic: (4, 0) + +Data: +1 +0: (0, 0; 0) 2.00000000000000e+00 +0: (1, 0; 0) 2.00000000000000e+00 +0: (2, 0; 0) 2.00000000000000e+00 +0: (3, 0; 0) 2.00000000000000e+00 +0: (0, 1; 0) 2.00000000000000e+00 +0: (1, 1; 0) 2.00000000000000e+00 +0: (2, 1; 0) 2.00000000000000e+00 +0: (3, 1; 0) 2.00000000000000e+00 +0: (0, 2; 0) 2.00000000000000e+00 +0: (1, 2; 0) 2.00000000000000e+00 +0: (2, 2; 0) 2.00000000000000e+00 +0: (3, 2; 0) 2.00000000000000e+00 +0: (0, 3; 0) 2.00000000000000e+00 +0: (1, 3; 0) 2.00000000000000e+00 +0: (2, 3; 0) 2.00000000000000e+00 +0: (3, 3; 0) 2.00000000000000e+00 +0: (0, 4; 0) 2.00000000000000e+00 +0: (1, 4; 0) 2.00000000000000e+00 +0: (2, 4; 0) 2.00000000000000e+00 +0: (3, 4; 0) 2.00000000000000e+00 +0: (0, 5; 0) 2.00000000000000e+00 +0: (1, 5; 0) 2.00000000000000e+00 +0: (2, 5; 0) 2.00000000000000e+00 +0: (3, 5; 0) 2.00000000000000e+00 +0: (0, 6; 0) 2.00000000000000e+00 +0: (1, 6; 0) 2.00000000000000e+00 +0: (2, 6; 0) 2.00000000000000e+00 +0: (3, 6; 0) 2.00000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.ab2.mv0.matvec.00000 b/src/test/TEST_structmat/structmat.saved.ab2.mv0.matvec.00000 new file mode 100644 index 0000000000..fef0192618 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.ab2.mv0.matvec.00000 @@ -0,0 +1,67 @@ +StructVector + +Grid: +2 +1 +0: (0, 0) x (7, 6) + +Periodic: (8, 0) + +Data: +1 +0: (0, 0; 0) 1.40000000000000e+00 +0: (1, 0; 0) 1.40000000000000e+00 +0: (2, 0; 0) 1.40000000000000e+00 +0: (3, 0; 0) 1.40000000000000e+00 +0: (4, 0; 0) 1.40000000000000e+00 +0: (5, 0; 0) 1.40000000000000e+00 +0: (6, 0; 0) 1.40000000000000e+00 +0: (7, 0; 0) 1.40000000000000e+00 +0: (0, 1; 0) 1.70000000000000e+00 +0: (1, 1; 0) 1.70000000000000e+00 +0: (2, 1; 0) 1.70000000000000e+00 +0: (3, 1; 0) 1.70000000000000e+00 +0: (4, 1; 0) 1.70000000000000e+00 +0: (5, 1; 0) 1.70000000000000e+00 +0: (6, 1; 0) 1.70000000000000e+00 +0: (7, 1; 0) 1.70000000000000e+00 +0: (0, 2; 0) 1.70000000000000e+00 +0: (1, 2; 0) 1.70000000000000e+00 +0: (2, 2; 0) 1.70000000000000e+00 +0: (3, 2; 0) 1.70000000000000e+00 +0: (4, 2; 0) 1.70000000000000e+00 +0: (5, 2; 0) 1.70000000000000e+00 +0: (6, 2; 0) 1.70000000000000e+00 +0: (7, 2; 0) 1.70000000000000e+00 +0: (0, 3; 0) 1.70000000000000e+00 +0: (1, 3; 0) 1.70000000000000e+00 +0: (2, 3; 0) 1.70000000000000e+00 +0: (3, 3; 0) 1.70000000000000e+00 +0: (4, 3; 0) 1.70000000000000e+00 +0: (5, 3; 0) 1.70000000000000e+00 +0: (6, 3; 0) 1.70000000000000e+00 +0: (7, 3; 0) 1.70000000000000e+00 +0: (0, 4; 0) 1.70000000000000e+00 +0: (1, 4; 0) 1.70000000000000e+00 +0: (2, 4; 0) 1.70000000000000e+00 +0: (3, 4; 0) 1.70000000000000e+00 +0: (4, 4; 0) 1.70000000000000e+00 +0: (5, 4; 0) 1.70000000000000e+00 +0: (6, 4; 0) 1.70000000000000e+00 +0: (7, 4; 0) 1.70000000000000e+00 +0: (0, 5; 0) 1.70000000000000e+00 +0: (1, 5; 0) 1.70000000000000e+00 +0: (2, 5; 0) 1.70000000000000e+00 +0: (3, 5; 0) 1.70000000000000e+00 +0: (4, 5; 0) 1.70000000000000e+00 +0: (5, 5; 0) 1.70000000000000e+00 +0: (6, 5; 0) 1.70000000000000e+00 +0: (7, 5; 0) 1.70000000000000e+00 +0: (0, 6; 0) 1.40000000000000e+00 +0: (1, 6; 0) 1.40000000000000e+00 +0: (2, 6; 0) 1.40000000000000e+00 +0: (3, 6; 0) 1.40000000000000e+00 +0: (4, 6; 0) 1.40000000000000e+00 +0: (5, 6; 0) 1.40000000000000e+00 +0: (6, 6; 0) 1.40000000000000e+00 +0: (7, 6; 0) 1.40000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.ab2.mv1.matvec.00000 b/src/test/TEST_structmat/structmat.saved.ab2.mv1.matvec.00000 new file mode 100644 index 0000000000..1a11acc440 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.ab2.mv1.matvec.00000 @@ -0,0 +1,67 @@ +StructVector + +Grid: +2 +1 +0: (0, 0) x (7, 6) + +Periodic: (8, 0) + +Data: +1 +0: (0, 0; 0) 1.40000000000000e+00 +0: (1, 0; 0) 1.40000000000000e+00 +0: (2, 0; 0) 1.40000000000000e+00 +0: (3, 0; 0) 1.40000000000000e+00 +0: (4, 0; 0) 1.40000000000000e+00 +0: (5, 0; 0) 1.40000000000000e+00 +0: (6, 0; 0) 1.40000000000000e+00 +0: (7, 0; 0) 1.40000000000000e+00 +0: (0, 1; 0) 1.40000000000000e+00 +0: (1, 1; 0) 1.40000000000000e+00 +0: (2, 1; 0) 1.40000000000000e+00 +0: (3, 1; 0) 1.40000000000000e+00 +0: (4, 1; 0) 1.40000000000000e+00 +0: (5, 1; 0) 1.40000000000000e+00 +0: (6, 1; 0) 1.40000000000000e+00 +0: (7, 1; 0) 1.40000000000000e+00 +0: (0, 2; 0) 1.40000000000000e+00 +0: (1, 2; 0) 1.40000000000000e+00 +0: (2, 2; 0) 1.40000000000000e+00 +0: (3, 2; 0) 1.40000000000000e+00 +0: (4, 2; 0) 1.40000000000000e+00 +0: (5, 2; 0) 1.40000000000000e+00 +0: (6, 2; 0) 1.40000000000000e+00 +0: (7, 2; 0) 1.40000000000000e+00 +0: (0, 3; 0) 1.40000000000000e+00 +0: (1, 3; 0) 1.40000000000000e+00 +0: (2, 3; 0) 1.40000000000000e+00 +0: (3, 3; 0) 1.40000000000000e+00 +0: (4, 3; 0) 1.40000000000000e+00 +0: (5, 3; 0) 1.40000000000000e+00 +0: (6, 3; 0) 1.40000000000000e+00 +0: (7, 3; 0) 1.40000000000000e+00 +0: (0, 4; 0) 1.40000000000000e+00 +0: (1, 4; 0) 1.40000000000000e+00 +0: (2, 4; 0) 1.40000000000000e+00 +0: (3, 4; 0) 1.40000000000000e+00 +0: (4, 4; 0) 1.40000000000000e+00 +0: (5, 4; 0) 1.40000000000000e+00 +0: (6, 4; 0) 1.40000000000000e+00 +0: (7, 4; 0) 1.40000000000000e+00 +0: (0, 5; 0) 1.40000000000000e+00 +0: (1, 5; 0) 1.40000000000000e+00 +0: (2, 5; 0) 1.40000000000000e+00 +0: (3, 5; 0) 1.40000000000000e+00 +0: (4, 5; 0) 1.40000000000000e+00 +0: (5, 5; 0) 1.40000000000000e+00 +0: (6, 5; 0) 1.40000000000000e+00 +0: (7, 5; 0) 1.40000000000000e+00 +0: (0, 6; 0) 1.40000000000000e+00 +0: (1, 6; 0) 1.40000000000000e+00 +0: (2, 6; 0) 1.40000000000000e+00 +0: (3, 6; 0) 1.40000000000000e+00 +0: (4, 6; 0) 1.40000000000000e+00 +0: (5, 6; 0) 1.40000000000000e+00 +0: (6, 6; 0) 1.40000000000000e+00 +0: (7, 6; 0) 1.40000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.saved.ab2.mv2.matvec.00000 b/src/test/TEST_structmat/structmat.saved.ab2.mv2.matvec.00000 new file mode 100644 index 0000000000..bc3ccde929 --- /dev/null +++ b/src/test/TEST_structmat/structmat.saved.ab2.mv2.matvec.00000 @@ -0,0 +1,39 @@ +StructVector + +Grid: +2 +1 +0: (0, 0) x (3, 6) + +Periodic: (4, 0) + +Data: +1 +0: (0, 0; 0) 1.10000000000000e+00 +0: (1, 0; 0) 1.10000000000000e+00 +0: (2, 0; 0) 1.10000000000000e+00 +0: (3, 0; 0) 1.10000000000000e+00 +0: (0, 1; 0) 1.10000000000000e+00 +0: (1, 1; 0) 1.10000000000000e+00 +0: (2, 1; 0) 1.10000000000000e+00 +0: (3, 1; 0) 1.10000000000000e+00 +0: (0, 2; 0) 1.10000000000000e+00 +0: (1, 2; 0) 1.10000000000000e+00 +0: (2, 2; 0) 1.10000000000000e+00 +0: (3, 2; 0) 1.10000000000000e+00 +0: (0, 3; 0) 1.10000000000000e+00 +0: (1, 3; 0) 1.10000000000000e+00 +0: (2, 3; 0) 1.10000000000000e+00 +0: (3, 3; 0) 1.10000000000000e+00 +0: (0, 4; 0) 1.10000000000000e+00 +0: (1, 4; 0) 1.10000000000000e+00 +0: (2, 4; 0) 1.10000000000000e+00 +0: (3, 4; 0) 1.10000000000000e+00 +0: (0, 5; 0) 1.10000000000000e+00 +0: (1, 5; 0) 1.10000000000000e+00 +0: (2, 5; 0) 1.10000000000000e+00 +0: (3, 5; 0) 1.10000000000000e+00 +0: (0, 6; 0) 1.10000000000000e+00 +0: (1, 6; 0) 1.10000000000000e+00 +0: (2, 6; 0) 1.10000000000000e+00 +0: (3, 6; 0) 1.10000000000000e+00 diff --git a/src/test/TEST_structmat/structmat.sh b/src/test/TEST_structmat/structmat.sh new file mode 100755 index 0000000000..0d5274370a --- /dev/null +++ b/src/test/TEST_structmat/structmat.sh @@ -0,0 +1,172 @@ +#!/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` + +#============================================================================= +#============================================================================= + +FILESmatmat="\ + ${TNAME}.out.2D0.x\ + ${TNAME}.out.2D1.x\ + ${TNAME}.out.2D2.x\ + ${TNAME}.out.2D3.x\ + ${TNAME}.out.2D0.y\ + ${TNAME}.out.2D1.y\ + ${TNAME}.out.2D2.y\ + ${TNAME}.out.2D3.y\ + ${TNAME}.out.2D0.x.4\ + ${TNAME}.out.2D1.x.4\ + ${TNAME}.out.2D2.x.4\ + ${TNAME}.out.2D3.x.4\ + ${TNAME}.out.2D0.y.4\ + ${TNAME}.out.2D1.y.4\ + ${TNAME}.out.2D2.y.4\ + ${TNAME}.out.2D3.y.4\ + ${TNAME}.out.2D1.xidle\ + ${TNAME}.out.2D1.xidle.4\ + ${TNAME}.out.2D1.yidle\ + ${TNAME}.out.2D1.yidle.5\ + ${TNAME}.out.2D3.x.RA\ + ${TNAME}.out.2D3.x.AP\ +" +FILESmatmatsym="\ + ${TNAME}.out.2D0.sym.x\ + ${TNAME}.out.2D1.sym.x\ + ${TNAME}.out.2D2.sym.x\ + ${TNAME}.out.2D3.sym.x\ + ${TNAME}.out.2D0.sym.x.4\ + ${TNAME}.out.2D1.sym.x.4\ + ${TNAME}.out.2D2.sym.x.4\ + ${TNAME}.out.2D3.sym.x.4\ +" +FILESmatvec="\ + ${TNAME}.out.2D0.mv0\ + ${TNAME}.out.2D0.mv1\ + ${TNAME}.out.2D0.mv2\ + ${TNAME}.out.2D0.mv3\ + ${TNAME}.out.2D0.mv4\ + ${TNAME}.out.2D1.mv0\ + ${TNAME}.out.2D1.mv1\ + ${TNAME}.out.2D1.mv2\ + ${TNAME}.out.2D1.mv3\ + ${TNAME}.out.2D1.mv4\ + ${TNAME}.out.2D3.mv0\ + ${TNAME}.out.2D0.mv0.4\ + ${TNAME}.out.2D0.mv1.4\ + ${TNAME}.out.2D0.mv2.4\ + ${TNAME}.out.2D0.mv3.4\ + ${TNAME}.out.2D0.mv4.4\ + ${TNAME}.out.2D1.mv0.4\ + ${TNAME}.out.2D1.mv1.4\ + ${TNAME}.out.2D1.mv2.4\ + ${TNAME}.out.2D1.mv3.4\ + ${TNAME}.out.2D1.mv4.4\ + ${TNAME}.out.2D3.mv0.4\ +" +FILESmatvecsym="\ + ${TNAME}.out.2D0.mv0.4\ + ${TNAME}.out.2D1.mv0.4\ + ${TNAME}.out.2D3.mv0.4\ +" +FILESab="\ + ${TNAME}.out.ab0.mv0\ + ${TNAME}.out.ab0.mv1\ + ${TNAME}.out.ab0.mv2\ + ${TNAME}.out.ab1.mv0\ + ${TNAME}.out.ab1.mv1\ + ${TNAME}.out.ab1.mv2\ + ${TNAME}.out.ab2.mv0\ + ${TNAME}.out.ab2.mv1\ + ${TNAME}.out.ab2.mv2\ +" + +#============================================================================= +# Diff the output with the saved output +#============================================================================= + +# Matmat tests +for i in $FILESmatmat +do + for j in ${i}.matmat.* + do + saved=`echo $j | sed 's/.out/.saved/'` + diff -U3 -bI"time" $j $saved >&2 + done +done + +# Matvec tests +for i in $FILESmatvec +do + for j in ${i}.matvec.* + do + saved=`echo $j | sed 's/.out/.saved/'` + diff -U3 -bI"time" $j $saved >&2 + done +done + +# MatvecT tests +for i in $FILESmatvec +do + for j in ${i}.matvec.* + do + matvecT=`echo $j | sed 's/mv/mvT/' | sed 's/matvec/matvecT/'` + saved=`echo $j | sed 's/.out/.saved/'` + diff -U3 -bI"time" $matvecT $saved >&2 + done +done + +# Check the x==y and beta=0 tests (compare to appropriate saved files) +for i in ${TNAME}.out.*zzz.matvec* +do + zfile=`echo $i | sed 's/.zzz//'` + diff -U3 -bI"time" $i $zfile >&2 +done + +# Matvec alpha/beta tests +for i in $FILESab +do + for j in ${i}.matvec.* + do + saved=`echo $j | sed 's/.out/.saved/'` + diff -U3 -bI"time" $j $saved >&2 + done +done + +# Symmetric Matmat tests +for i in $FILESmatmatsym +do + for j in ${i}.matmat.* + do + saved=`echo $j | sed 's/.out/.saved/'` + diff -U3 -bI"time" $j $saved >&2 + done +done + +# Symmetric Matvec tests +for i in $FILESmatvec +do + for j in ${i}.matvec.* + do + saved=`echo $j | sed 's/.out/.saved/' | sed 's/.sym//'` + diff -U3 -bI"time" $j $saved >&2 + done +done + +# Symmetric MatvecT tests +for i in $FILESmatvec +do + for j in ${i}.matvec.* + do + matvecT=`echo $j | sed 's/mv/mvT/' | sed 's/matvec/matvecT/'` + saved=`echo $j | sed 's/.out/.saved/' | sed 's/.sym//'` + diff -U3 -bI"time" $matvecT $saved >&2 + done +done + +#============================================================================= +# remove temporary files +#============================================================================= diff --git a/src/test/checktest.sh b/src/test/checktest.sh index f7ea0ab0cd..28a24ed05c 100755 --- a/src/test/checktest.sh +++ b/src/test/checktest.sh @@ -4,6 +4,8 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +summary=0 + # Echo usage information case $1 in -h|-help) @@ -26,6 +28,10 @@ cat < -#include -#include - -#include "_hypre_utilities.h" -#include "HYPRE_sstruct_ls.h" -#include "HYPRE_krylov.h" -#include "_hypre_sstruct_mv.h" -#include "_hypre_sstruct_ls.h" - -#define DEBUG 0 - -/* include fortran headers */ -#ifdef HYPRE_FORTRAN -#include "fortran.h" -#include "hypre_sstruct_fortran_test.h" -#endif -/*-------------------------------------------------------------------------- - * Data structures - *--------------------------------------------------------------------------*/ - -char infile_default[50] = "sstruct.in.default"; - -typedef HYPRE_Int Index[3]; -typedef HYPRE_Int ProblemIndex[9]; - -typedef struct -{ - /* for GridSetExtents */ - HYPRE_Int nboxes; - ProblemIndex *ilowers; - ProblemIndex *iuppers; - HYPRE_Int *boxsizes; - HYPRE_Int max_boxsize; - - /* for GridSetVariables */ - HYPRE_Int nvars; -#ifdef HYPRE_FORTRAN - hypre_F90_Obj *vartypes; -#else - HYPRE_SStructVariable *vartypes; -#endif - - /* for GridAddVariables */ - HYPRE_Int add_nvars; - ProblemIndex *add_indexes; -#ifdef HYPRE_FORTRAN - hypre_F90_Obj *add_vartypes; -#else - HYPRE_SStructVariable *add_vartypes; -#endif - - /* for GridSetNeighborBox */ - HYPRE_Int glue_nboxes; - ProblemIndex *glue_ilowers; - ProblemIndex *glue_iuppers; - HYPRE_Int *glue_nbor_parts; - ProblemIndex *glue_nbor_ilowers; - ProblemIndex *glue_nbor_iuppers; - Index *glue_index_maps; - - /* for GraphSetStencil */ - HYPRE_Int *stencil_num; - - /* for GraphAddEntries */ - HYPRE_Int graph_nentries; - ProblemIndex *graph_ilowers; - ProblemIndex *graph_iuppers; - Index *graph_strides; - HYPRE_Int *graph_vars; - HYPRE_Int *graph_to_parts; - ProblemIndex *graph_to_ilowers; - ProblemIndex *graph_to_iuppers; - Index *graph_to_strides; - HYPRE_Int *graph_to_vars; - Index *graph_index_maps; - Index *graph_index_signs; - HYPRE_Int *graph_entries; - HYPRE_Real *graph_values; - HYPRE_Int *graph_boxsizes; - - HYPRE_Int matrix_nentries; - ProblemIndex *matrix_ilowers; - ProblemIndex *matrix_iuppers; - Index *matrix_strides; - HYPRE_Int *matrix_vars; - HYPRE_Int *matrix_entries; - HYPRE_Real *matrix_values; - - Index periodic; - -} ProblemPartData; - -typedef struct -{ - HYPRE_Int ndim; - HYPRE_Int nparts; - ProblemPartData *pdata; - HYPRE_Int max_boxsize; - - HYPRE_Int nstencils; - HYPRE_Int *stencil_sizes; - Index **stencil_offsets; - HYPRE_Int **stencil_vars; - HYPRE_Real **stencil_values; - - HYPRE_Int symmetric_nentries; - HYPRE_Int *symmetric_parts; - HYPRE_Int *symmetric_vars; - HYPRE_Int *symmetric_to_vars; - HYPRE_Int *symmetric_booleans; - - HYPRE_Int ns_symmetric; - - Index rfactor; - - HYPRE_Int npools; - HYPRE_Int *pools; /* array of size nparts */ - -} ProblemData; - -/*-------------------------------------------------------------------------- - * Read routines - *--------------------------------------------------------------------------*/ - -HYPRE_Int -SScanIntArray( char *sdata_ptr, - char **sdata_ptr_ptr, - HYPRE_Int size, - HYPRE_Int *array ) -{ - HYPRE_Int i; - - sdata_ptr += strspn(sdata_ptr, " \t\n["); - for (i = 0; i < size; i++) - { - array[i] = strtol(sdata_ptr, &sdata_ptr, 10); - } - sdata_ptr += strcspn(sdata_ptr, "]") + 1; - - *sdata_ptr_ptr = sdata_ptr; - return 0; -} - -HYPRE_Int -SScanProblemIndex( char *sdata_ptr, - char **sdata_ptr_ptr, - HYPRE_Int ndim, - ProblemIndex index ) -{ - HYPRE_Int i; - char sign[3]; - - /* initialize index array */ - for (i = 0; i < 9; i++) - { - index[i] = 0; - } - - sdata_ptr += strspn(sdata_ptr, " \t\n("); - switch (ndim) - { - case 1: - 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; - - 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; - } - sdata_ptr += strcspn(sdata_ptr, ":)"); - if ( *sdata_ptr == ':' ) - { - /* read in optional shift */ - sdata_ptr += 1; - switch (ndim) - { - case 1: - hypre_sscanf(sdata_ptr, "%d", &index[6]); - break; - - case 2: - hypre_sscanf(sdata_ptr, "%d%d", &index[6], &index[7]); - break; - - case 3: - hypre_sscanf(sdata_ptr, "%d%d%d", &index[6], &index[7], &index[8]); - break; - } - /* pre-shift the index */ - for (i = 0; i < ndim; i++) - { - index[i] += index[i + 6]; - } - } - sdata_ptr += strcspn(sdata_ptr, ")") + 1; - - for (i = 0; i < ndim; i++) - { - if (sign[i] == '+') - { - index[i + 3] = 1; - } - } - - *sdata_ptr_ptr = sdata_ptr; - return 0; -} - -HYPRE_Int -ReadData( char *filename, - ProblemData *data_ptr ) -{ - ProblemData data; - ProblemPartData pdata; - - HYPRE_Int myid; - FILE *file; - - char *sdata = NULL; - char *sdata_line; - char *sdata_ptr; - HYPRE_Int sdata_size; - HYPRE_Int size; - HYPRE_Int memchunk = 10000; - HYPRE_Int maxline = 250; - - char key[250]; - - HYPRE_Int part, var, entry, s, i, il, iu; - - /*----------------------------------------------------------- - * Read data file from process 0, then broadcast - *-----------------------------------------------------------*/ - - hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &myid); - - if (myid == 0) - { - if ((file = fopen(filename, "r")) == NULL) - { - hypre_printf("Error: can't open input file %s\n", filename); - exit(1); - } - - /* allocate initial space, and read first input line */ - sdata_size = 0; - sdata = hypre_TAlloc(char, memchunk, HYPRE_MEMORY_HOST); - sdata_line = fgets(sdata, maxline, file); - - s = 0; - while (sdata_line != NULL) - { - sdata_size += strlen(sdata_line) + 1; - - /* allocate more space, if necessary */ - if ((sdata_size + maxline) > s) - { - sdata = hypre_TReAlloc(sdata, char, (sdata_size + memchunk), HYPRE_MEMORY_HOST); - s = sdata_size + memchunk; - } - - /* read the next input line */ - sdata_line = fgets((sdata + sdata_size), maxline, file); - } - } - - /* broadcast the data size */ - hypre_MPI_Bcast(&sdata_size, 1, HYPRE_MPI_INT, 0, hypre_MPI_COMM_WORLD); - - /* broadcast the data */ - sdata = hypre_TReAlloc(sdata, char, sdata_size, HYPRE_MEMORY_HOST); - hypre_MPI_Bcast(sdata, sdata_size, hypre_MPI_CHAR, 0, hypre_MPI_COMM_WORLD); - - /*----------------------------------------------------------- - * Parse the data and fill ProblemData structure - *-----------------------------------------------------------*/ - - data.max_boxsize = 0; - data.symmetric_nentries = 0; - data.symmetric_parts = NULL; - data.symmetric_vars = NULL; - data.symmetric_to_vars = NULL; - data.symmetric_booleans = NULL; - data.ns_symmetric = 0; - - sdata_line = sdata; - 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"); - - if ( strcmp(key, "GridCreate:") == 0 ) - { - data.ndim = strtol(sdata_ptr, &sdata_ptr, 10); - data.nparts = strtol(sdata_ptr, &sdata_ptr, 10); - data.pdata = hypre_CTAlloc(ProblemPartData, data.nparts, HYPRE_MEMORY_HOST); - } - else if ( strcmp(key, "GridSetExtents:") == 0 ) - { - part = strtol(sdata_ptr, &sdata_ptr, 10); - pdata = data.pdata[part]; - if ((pdata.nboxes % 10) == 0) - { - size = pdata.nboxes + 10; - pdata.ilowers = - hypre_TReAlloc(pdata.ilowers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.iuppers = - hypre_TReAlloc(pdata.iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.boxsizes = - hypre_TReAlloc(pdata.boxsizes, HYPRE_Int, size, HYPRE_MEMORY_HOST); - } - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.ilowers[pdata.nboxes]); - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.iuppers[pdata.nboxes]); - /* check use of +- in GridSetExtents */ - il = 1; - iu = 1; - for (i = 0; i < data.ndim; i++) - { - il *= pdata.ilowers[pdata.nboxes][i + 3]; - iu *= pdata.iuppers[pdata.nboxes][i + 3]; - } - if ( (il != 0) || (iu != 1) ) - { - hypre_printf("Error: Invalid use of `+-' in GridSetExtents\n"); - exit(1); - } - pdata.boxsizes[pdata.nboxes] = 1; - for (i = 0; i < 3; i++) - { - pdata.boxsizes[pdata.nboxes] *= - (pdata.iuppers[pdata.nboxes][i] - - pdata.ilowers[pdata.nboxes][i] + 2); - } - pdata.max_boxsize = - hypre_max(pdata.max_boxsize, pdata.boxsizes[pdata.nboxes]); - pdata.nboxes++; - data.pdata[part] = pdata; - } - else if ( strcmp(key, "GridSetVariables:") == 0 ) - { - part = strtol(sdata_ptr, &sdata_ptr, 10); - pdata = data.pdata[part]; - pdata.nvars = strtol(sdata_ptr, &sdata_ptr, 10); -#ifdef HYPRE_FORTRAN - pdata.vartypes = hypre_CTAlloc(hypre_F90_Obj, pdata.nvars, HYPRE_MEMORY_HOST); -#else - pdata.vartypes = hypre_CTAlloc(HYPRE_SStructVariable, pdata.nvars, HYPRE_MEMORY_HOST); -#endif - SScanIntArray(sdata_ptr, &sdata_ptr, - pdata.nvars, (HYPRE_Int *) pdata.vartypes); - data.pdata[part] = pdata; - } - else if ( strcmp(key, "GridAddVariables:") == 0 ) - { - /* TODO */ - hypre_printf("GridAddVariables not yet implemented!\n"); - exit(1); - } - else if ( strcmp(key, "GridSetNeighborBox:") == 0 ) - { - part = strtol(sdata_ptr, &sdata_ptr, 10); - pdata = data.pdata[part]; - if ((pdata.glue_nboxes % 10) == 0) - { - size = pdata.glue_nboxes + 10; - pdata.glue_ilowers = - hypre_TReAlloc(pdata.glue_ilowers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.glue_iuppers = - hypre_TReAlloc(pdata.glue_iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.glue_nbor_parts = - hypre_TReAlloc(pdata.glue_nbor_parts, HYPRE_Int, size, HYPRE_MEMORY_HOST); - pdata.glue_nbor_ilowers = - hypre_TReAlloc(pdata.glue_nbor_ilowers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.glue_nbor_iuppers = - hypre_TReAlloc(pdata.glue_nbor_iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.glue_index_maps = - hypre_TReAlloc(pdata.glue_index_maps, Index, size, HYPRE_MEMORY_HOST); - } - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.glue_ilowers[pdata.glue_nboxes]); - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.glue_iuppers[pdata.glue_nboxes]); - pdata.glue_nbor_parts[pdata.glue_nboxes] = - strtol(sdata_ptr, &sdata_ptr, 10); - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.glue_nbor_ilowers[pdata.glue_nboxes]); - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.glue_nbor_iuppers[pdata.glue_nboxes]); - SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, - pdata.glue_index_maps[pdata.glue_nboxes]); - for (i = data.ndim; i < 3; i++) - { - pdata.glue_index_maps[pdata.glue_nboxes][i] = i; - } - pdata.glue_nboxes++; - data.pdata[part] = pdata; - } - else if ( strcmp(key, "GridSetPeriodic:") == 0 ) - { - part = strtol(sdata_ptr, &sdata_ptr, 10); - pdata = data.pdata[part]; - SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, pdata.periodic); - for (i = data.ndim; i < 3; i++) - { - pdata.periodic[i] = 0; - } - data.pdata[part] = pdata; - } - else if ( strcmp(key, "StencilCreate:") == 0 ) - { - data.nstencils = strtol(sdata_ptr, &sdata_ptr, 10); - data.stencil_sizes = hypre_CTAlloc(HYPRE_Int, data.nstencils, HYPRE_MEMORY_HOST); - data.stencil_offsets = hypre_CTAlloc(Index *, data.nstencils, HYPRE_MEMORY_HOST); - data.stencil_vars = hypre_CTAlloc(HYPRE_Int *, data.nstencils, HYPRE_MEMORY_HOST); - data.stencil_values = hypre_CTAlloc(HYPRE_Real *, data.nstencils, HYPRE_MEMORY_HOST); - SScanIntArray(sdata_ptr, &sdata_ptr, - data.nstencils, data.stencil_sizes); - for (s = 0; s < data.nstencils; s++) - { - data.stencil_offsets[s] = - hypre_CTAlloc(Index, data.stencil_sizes[s], HYPRE_MEMORY_HOST); - data.stencil_vars[s] = - hypre_CTAlloc(HYPRE_Int, data.stencil_sizes[s], HYPRE_MEMORY_HOST); - data.stencil_values[s] = - hypre_CTAlloc(HYPRE_Real, data.stencil_sizes[s], HYPRE_MEMORY_HOST); - } - } - else if ( strcmp(key, "StencilSetEntry:") == 0 ) - { - s = strtol(sdata_ptr, &sdata_ptr, 10); - entry = strtol(sdata_ptr, &sdata_ptr, 10); - SScanIntArray(sdata_ptr, &sdata_ptr, - data.ndim, data.stencil_offsets[s][entry]); - for (i = data.ndim; i < 3; i++) - { - data.stencil_offsets[s][entry][i] = 0; - } - data.stencil_vars[s][entry] = strtol(sdata_ptr, &sdata_ptr, 10); - data.stencil_values[s][entry] = (HYPRE_Real)strtod(sdata_ptr, &sdata_ptr); - } - else if ( strcmp(key, "GraphSetStencil:") == 0 ) - { - part = strtol(sdata_ptr, &sdata_ptr, 10); - var = strtol(sdata_ptr, &sdata_ptr, 10); - s = strtol(sdata_ptr, &sdata_ptr, 10); - pdata = data.pdata[part]; - if (pdata.stencil_num == NULL) - { - pdata.stencil_num = hypre_CTAlloc(HYPRE_Int, pdata.nvars, HYPRE_MEMORY_HOST); - } - pdata.stencil_num[var] = s; - data.pdata[part] = pdata; - } - else if ( strcmp(key, "GraphAddEntries:") == 0 ) - { - part = strtol(sdata_ptr, &sdata_ptr, 10); - pdata = data.pdata[part]; - if ((pdata.graph_nentries % 10) == 0) - { - size = pdata.graph_nentries + 10; - pdata.graph_ilowers = - hypre_TReAlloc(pdata.graph_ilowers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.graph_iuppers = - hypre_TReAlloc(pdata.graph_iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.graph_strides = - hypre_TReAlloc(pdata.graph_strides, Index, size, HYPRE_MEMORY_HOST); - pdata.graph_vars = - hypre_TReAlloc(pdata.graph_vars, HYPRE_Int, size, HYPRE_MEMORY_HOST); - pdata.graph_to_parts = - hypre_TReAlloc(pdata.graph_to_parts, HYPRE_Int, size, HYPRE_MEMORY_HOST); - pdata.graph_to_ilowers = - hypre_TReAlloc(pdata.graph_to_ilowers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.graph_to_iuppers = - hypre_TReAlloc(pdata.graph_to_iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.graph_to_strides = - hypre_TReAlloc(pdata.graph_to_strides, Index, size, HYPRE_MEMORY_HOST); - pdata.graph_to_vars = - hypre_TReAlloc(pdata.graph_to_vars, HYPRE_Int, size, HYPRE_MEMORY_HOST); - pdata.graph_index_maps = - hypre_TReAlloc(pdata.graph_index_maps, Index, size, HYPRE_MEMORY_HOST); - pdata.graph_index_signs = - hypre_TReAlloc(pdata.graph_index_signs, Index, size, HYPRE_MEMORY_HOST); - pdata.graph_entries = - hypre_TReAlloc(pdata.graph_entries, HYPRE_Int, size, HYPRE_MEMORY_HOST); - pdata.graph_values = - hypre_TReAlloc(pdata.graph_values, HYPRE_Real, size, HYPRE_MEMORY_HOST); - pdata.graph_boxsizes = - hypre_TReAlloc(pdata.graph_boxsizes, HYPRE_Int, size, HYPRE_MEMORY_HOST); - } - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.graph_ilowers[pdata.graph_nentries]); - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.graph_iuppers[pdata.graph_nentries]); - SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, - pdata.graph_strides[pdata.graph_nentries]); - for (i = data.ndim; i < 3; i++) - { - pdata.graph_strides[pdata.graph_nentries][i] = 1; - } - pdata.graph_vars[pdata.graph_nentries] = - strtol(sdata_ptr, &sdata_ptr, 10); - pdata.graph_to_parts[pdata.graph_nentries] = - strtol(sdata_ptr, &sdata_ptr, 10); - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.graph_to_ilowers[pdata.graph_nentries]); - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.graph_to_iuppers[pdata.graph_nentries]); - SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, - pdata.graph_to_strides[pdata.graph_nentries]); - for (i = data.ndim; i < 3; i++) - { - pdata.graph_to_strides[pdata.graph_nentries][i] = 1; - } - pdata.graph_to_vars[pdata.graph_nentries] = - strtol(sdata_ptr, &sdata_ptr, 10); - SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, - pdata.graph_index_maps[pdata.graph_nentries]); - for (i = data.ndim; i < 3; i++) - { - pdata.graph_index_maps[pdata.graph_nentries][i] = i; - } - for (i = 0; i < 3; i++) - { - pdata.graph_index_signs[pdata.graph_nentries][i] = 1; - if ( pdata.graph_to_iuppers[pdata.graph_nentries][i] < - pdata.graph_to_ilowers[pdata.graph_nentries][i] ) - { - pdata.graph_index_signs[pdata.graph_nentries][i] = -1; - } - } - pdata.graph_entries[pdata.graph_nentries] = - strtol(sdata_ptr, &sdata_ptr, 10); - pdata.graph_values[pdata.graph_nentries] = - (HYPRE_Real)strtod(sdata_ptr, &sdata_ptr); - pdata.graph_boxsizes[pdata.graph_nentries] = 1; - for (i = 0; i < 3; i++) - { - pdata.graph_boxsizes[pdata.graph_nentries] *= - (pdata.graph_iuppers[pdata.graph_nentries][i] - - pdata.graph_ilowers[pdata.graph_nentries][i] + 1); - } - pdata.graph_nentries++; - data.pdata[part] = pdata; - } - else if ( strcmp(key, "MatrixSetSymmetric:") == 0 ) - { - if ((data.symmetric_nentries % 10) == 0) - { - size = data.symmetric_nentries + 10; - data.symmetric_parts = - hypre_TReAlloc(data.symmetric_parts, HYPRE_Int, size, HYPRE_MEMORY_HOST); - data.symmetric_vars = - hypre_TReAlloc(data.symmetric_vars, HYPRE_Int, size, HYPRE_MEMORY_HOST); - data.symmetric_to_vars = - hypre_TReAlloc(data.symmetric_to_vars, HYPRE_Int, size, HYPRE_MEMORY_HOST); - data.symmetric_booleans = - hypre_TReAlloc(data.symmetric_booleans, HYPRE_Int, size, HYPRE_MEMORY_HOST); - } - data.symmetric_parts[data.symmetric_nentries] = - strtol(sdata_ptr, &sdata_ptr, 10); - data.symmetric_vars[data.symmetric_nentries] = - strtol(sdata_ptr, &sdata_ptr, 10); - data.symmetric_to_vars[data.symmetric_nentries] = - strtol(sdata_ptr, &sdata_ptr, 10); - data.symmetric_booleans[data.symmetric_nentries] = - strtol(sdata_ptr, &sdata_ptr, 10); - data.symmetric_nentries++; - } - else if ( strcmp(key, "MatrixSetNSSymmetric:") == 0 ) - { - data.ns_symmetric = strtol(sdata_ptr, &sdata_ptr, 10); - } - else if ( strcmp(key, "MatrixSetValues:") == 0 ) - { - part = strtol(sdata_ptr, &sdata_ptr, 10); - pdata = data.pdata[part]; - if ((pdata.matrix_nentries % 10) == 0) - { - size = pdata.matrix_nentries + 10; - pdata.matrix_ilowers = - hypre_TReAlloc(pdata.matrix_ilowers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.matrix_iuppers = - hypre_TReAlloc(pdata.matrix_iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.matrix_strides = - hypre_TReAlloc(pdata.matrix_strides, Index, size, HYPRE_MEMORY_HOST); - pdata.matrix_vars = - hypre_TReAlloc(pdata.matrix_vars, HYPRE_Int, size, HYPRE_MEMORY_HOST); - pdata.matrix_entries = - hypre_TReAlloc(pdata.matrix_entries, HYPRE_Int, size, HYPRE_MEMORY_HOST); - pdata.matrix_values = - hypre_TReAlloc(pdata.matrix_values, HYPRE_Real, size, HYPRE_MEMORY_HOST); - } - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.matrix_ilowers[pdata.matrix_nentries]); - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.matrix_iuppers[pdata.matrix_nentries]); - SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, - pdata.matrix_strides[pdata.matrix_nentries]); - for (i = data.ndim; i < 3; i++) - { - pdata.matrix_strides[pdata.matrix_nentries][i] = 1; - } - pdata.matrix_vars[pdata.matrix_nentries] = - strtol(sdata_ptr, &sdata_ptr, 10); - pdata.matrix_entries[pdata.matrix_nentries] = - strtol(sdata_ptr, &sdata_ptr, 10); - pdata.matrix_values[pdata.matrix_nentries] = - (HYPRE_Real)strtod(sdata_ptr, &sdata_ptr); - pdata.matrix_nentries++; - data.pdata[part] = pdata; - } - - else if ( strcmp(key, "rfactor:") == 0 ) - { - SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, data.rfactor); - for (i = data.ndim; i < 3; i++) - { - data.rfactor[i] = 1; - } - } - - else if ( strcmp(key, "ProcessPoolCreate:") == 0 ) - { - data.npools = strtol(sdata_ptr, &sdata_ptr, 10); - data.pools = hypre_CTAlloc(HYPRE_Int, data.nparts, HYPRE_MEMORY_HOST); - } - else if ( strcmp(key, "ProcessPoolSetPart:") == 0 ) - { - i = strtol(sdata_ptr, &sdata_ptr, 10); - part = strtol(sdata_ptr, &sdata_ptr, 10); - data.pools[part] = i; - } - } - - sdata_line += strlen(sdata_line) + 1; - } - - data.max_boxsize = 0; - for (part = 0; part < data.nparts; part++) - { - data.max_boxsize = - hypre_max(data.max_boxsize, data.pdata[part].max_boxsize); - } - - hypre_TFree(sdata, HYPRE_MEMORY_HOST); - - *data_ptr = data; - return 0; -} - -/*-------------------------------------------------------------------------- - * Distribute routines - *--------------------------------------------------------------------------*/ - -HYPRE_Int -MapProblemIndex( ProblemIndex index, - Index m ) -{ - /* un-shift the index */ - index[0] -= index[6]; - 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]; - /* pre-shift the new mapped index */ - index[0] += index[6]; - index[1] += index[7]; - index[2] += index[8]; - - return 0; -} - -HYPRE_Int -IntersectBoxes( ProblemIndex ilower1, - ProblemIndex iupper1, - ProblemIndex ilower2, - ProblemIndex iupper2, - ProblemIndex int_ilower, - ProblemIndex int_iupper ) -{ - HYPRE_Int d, size; - - size = 1; - for (d = 0; d < 3; d++) - { - int_ilower[d] = hypre_max(ilower1[d], ilower2[d]); - int_iupper[d] = hypre_min(iupper1[d], iupper2[d]); - size *= hypre_max(0, (int_iupper[d] - int_ilower[d] + 1)); - } - - return size; -} - -HYPRE_Int -DistributeData( ProblemData global_data, - Index *refine, - Index *distribute, - Index *block, - HYPRE_Int num_procs, - HYPRE_Int myid, - ProblemData *data_ptr ) -{ - ProblemData data = global_data; - ProblemPartData pdata; - HYPRE_Int *pool_procs; - HYPRE_Int np, pid; - HYPRE_Int pool, part, box, entry, p, q, r, i, d, dmap, sign, size; - Index m, mmap, n; - ProblemIndex int_ilower, int_iupper; - - /* determine first process number in each pool */ - pool_procs = hypre_CTAlloc(HYPRE_Int, (data.npools + 1), HYPRE_MEMORY_HOST); - for (part = 0; part < data.nparts; part++) - { - pool = data.pools[part] + 1; - np = distribute[part][0] * distribute[part][1] * distribute[part][2]; - pool_procs[pool] = hypre_max(pool_procs[pool], np); - - } - pool_procs[0] = 0; - for (pool = 1; pool < (data.npools + 1); pool++) - { - pool_procs[pool] = pool_procs[pool - 1] + pool_procs[pool]; - } - - /* check number of processes */ - if (pool_procs[data.npools] != num_procs) - { - hypre_printf("Error: Invalid number of processes or process topology \n"); - exit(1); - } - - /* modify part data */ - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - pool = data.pools[part]; - np = distribute[part][0] * distribute[part][1] * distribute[part][2]; - pid = myid - pool_procs[pool]; - - if ( (pid < 0) || (pid >= np) ) - { - /* none of this part data lives on this process */ - pdata.nboxes = 0; - pdata.glue_nboxes = 0; - pdata.graph_nentries = 0; - pdata.matrix_nentries = 0; - } - else - { - /* refine boxes */ - m[0] = refine[part][0]; - m[1] = refine[part][1]; - m[2] = refine[part][2]; - if ( (m[0] * m[1] * m[2]) > 1) - { - for (box = 0; box < pdata.nboxes; box++) - { - MapProblemIndex(pdata.ilowers[box], m); - MapProblemIndex(pdata.iuppers[box], m); - } - - for (entry = 0; entry < pdata.graph_nentries; entry++) - { - MapProblemIndex(pdata.graph_ilowers[entry], m); - MapProblemIndex(pdata.graph_iuppers[entry], m); - mmap[0] = m[pdata.graph_index_maps[entry][0]]; - mmap[1] = m[pdata.graph_index_maps[entry][1]]; - mmap[2] = m[pdata.graph_index_maps[entry][2]]; - MapProblemIndex(pdata.graph_to_ilowers[entry], mmap); - MapProblemIndex(pdata.graph_to_iuppers[entry], mmap); - } - for (entry = 0; entry < pdata.matrix_nentries; entry++) - { - MapProblemIndex(pdata.matrix_ilowers[entry], m); - MapProblemIndex(pdata.matrix_iuppers[entry], m); - } - } - - /* refine and distribute boxes */ - m[0] = distribute[part][0]; - m[1] = distribute[part][1]; - m[2] = distribute[part][2]; - if ( (m[0] * m[1] * m[2]) > 1) - { - p = pid % m[0]; - q = ((pid - p) / m[0]) % m[1]; - r = (pid - p - q * m[0]) / (m[0] * m[1]); - - for (box = 0; box < pdata.nboxes; box++) - { - n[0] = pdata.iuppers[box][0] - pdata.ilowers[box][0] + 1; - n[1] = pdata.iuppers[box][1] - pdata.ilowers[box][1] + 1; - n[2] = pdata.iuppers[box][2] - pdata.ilowers[box][2] + 1; - - MapProblemIndex(pdata.ilowers[box], m); - MapProblemIndex(pdata.iuppers[box], m); - pdata.iuppers[box][0] = pdata.ilowers[box][0] + n[0] - 1; - 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]; - } - - i = 0; - for (entry = 0; entry < pdata.graph_nentries; entry++) - { - MapProblemIndex(pdata.graph_ilowers[entry], m); - MapProblemIndex(pdata.graph_iuppers[entry], m); - mmap[0] = m[pdata.graph_index_maps[entry][0]]; - mmap[1] = m[pdata.graph_index_maps[entry][1]]; - mmap[2] = m[pdata.graph_index_maps[entry][2]]; - MapProblemIndex(pdata.graph_to_ilowers[entry], mmap); - MapProblemIndex(pdata.graph_to_iuppers[entry], mmap); - - for (box = 0; box < pdata.nboxes; box++) - { - size = IntersectBoxes(pdata.graph_ilowers[entry], - pdata.graph_iuppers[entry], - pdata.ilowers[box], - pdata.iuppers[box], - int_ilower, int_iupper); - if (size > 0) - { - /* if there is an intersection, it is the only one */ - for (d = 0; d < 3; d++) - { - dmap = pdata.graph_index_maps[entry][d]; - sign = pdata.graph_index_signs[entry][d]; - pdata.graph_to_iuppers[i][dmap] = - pdata.graph_to_ilowers[entry][dmap] + sign * - (int_iupper[d] - pdata.graph_ilowers[entry][d]); - pdata.graph_to_ilowers[i][dmap] = - pdata.graph_to_ilowers[entry][dmap] + sign * - (int_ilower[d] - pdata.graph_ilowers[entry][d]); - pdata.graph_ilowers[i][d] = int_ilower[d]; - pdata.graph_iuppers[i][d] = int_iupper[d]; - pdata.graph_strides[i][d] = - pdata.graph_strides[entry][d]; - pdata.graph_to_strides[i][d] = - pdata.graph_to_strides[entry][d]; - pdata.graph_index_maps[i][d] = dmap; - pdata.graph_index_signs[i][d] = sign; - } - for (d = 3; d < 9; d++) - { - pdata.graph_ilowers[i][d] = - pdata.graph_ilowers[entry][d]; - pdata.graph_iuppers[i][d] = - pdata.graph_iuppers[entry][d]; - pdata.graph_to_ilowers[i][d] = - pdata.graph_to_ilowers[entry][d]; - pdata.graph_to_iuppers[i][d] = - pdata.graph_to_iuppers[entry][d]; - } - pdata.graph_vars[i] = pdata.graph_vars[entry]; - pdata.graph_to_parts[i] = pdata.graph_to_parts[entry]; - pdata.graph_to_vars[i] = pdata.graph_to_vars[entry]; - pdata.graph_entries[i] = pdata.graph_entries[entry]; - pdata.graph_values[i] = pdata.graph_values[entry]; - i++; - break; - } - } - } - pdata.graph_nentries = i; - - i = 0; - for (entry = 0; entry < pdata.matrix_nentries; entry++) - { - MapProblemIndex(pdata.matrix_ilowers[entry], m); - MapProblemIndex(pdata.matrix_iuppers[entry], m); - - for (box = 0; box < pdata.nboxes; box++) - { - size = IntersectBoxes(pdata.matrix_ilowers[entry], - pdata.matrix_iuppers[entry], - pdata.ilowers[box], - pdata.iuppers[box], - int_ilower, int_iupper); - if (size > 0) - { - /* if there is an intersection, it is the only one */ - for (d = 0; d < 3; d++) - { - pdata.matrix_ilowers[i][d] = int_ilower[d]; - pdata.matrix_iuppers[i][d] = int_iupper[d]; - pdata.matrix_strides[i][d] = - pdata.matrix_strides[entry][d]; - } - for (d = 3; d < 9; d++) - { - pdata.matrix_ilowers[i][d] = - pdata.matrix_ilowers[entry][d]; - pdata.matrix_iuppers[i][d] = - pdata.matrix_iuppers[entry][d]; - } - pdata.matrix_vars[i] = pdata.matrix_vars[entry]; - pdata.matrix_entries[i] = pdata.matrix_entries[entry]; - pdata.matrix_values[i] = pdata.matrix_values[entry]; - i++; - break; - } - } - } - pdata.matrix_nentries = i; - } - - /* refine and block boxes */ - m[0] = block[part][0]; - m[1] = block[part][1]; - 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); - for (box = 0; box < pdata.nboxes; box++) - { - n[0] = pdata.iuppers[box][0] - pdata.ilowers[box][0] + 1; - n[1] = pdata.iuppers[box][1] - pdata.ilowers[box][1] + 1; - n[2] = pdata.iuppers[box][2] - pdata.ilowers[box][2] + 1; - - MapProblemIndex(pdata.ilowers[box], m); - - MapProblemIndex(pdata.iuppers[box], m); - pdata.iuppers[box][0] = pdata.ilowers[box][0] + n[0] - 1; - pdata.iuppers[box][1] = pdata.ilowers[box][1] + n[1] - 1; - pdata.iuppers[box][2] = pdata.ilowers[box][2] + n[2] - 1; - - i = box; - for (r = 0; r < m[2]; r++) - { - for (q = 0; q < m[1]; q++) - { - 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]; - for (d = 3; d < 9; d++) - { - pdata.ilowers[i][d] = pdata.ilowers[box][d]; - pdata.iuppers[i][d] = pdata.iuppers[box][d]; - } - i += pdata.nboxes; - } - } - } - } - pdata.nboxes *= m[0] * m[1] * m[2]; - - for (entry = 0; entry < pdata.graph_nentries; entry++) - { - MapProblemIndex(pdata.graph_ilowers[entry], m); - MapProblemIndex(pdata.graph_iuppers[entry], m); - mmap[0] = m[pdata.graph_index_maps[entry][0]]; - mmap[1] = m[pdata.graph_index_maps[entry][1]]; - mmap[2] = m[pdata.graph_index_maps[entry][2]]; - MapProblemIndex(pdata.graph_to_ilowers[entry], mmap); - MapProblemIndex(pdata.graph_to_iuppers[entry], mmap); - } - for (entry = 0; entry < pdata.matrix_nentries; entry++) - { - MapProblemIndex(pdata.matrix_ilowers[entry], m); - MapProblemIndex(pdata.matrix_iuppers[entry], m); - } - } - - /* map remaining ilowers & iuppers */ - m[0] = refine[part][0] * block[part][0] * distribute[part][0]; - m[1] = refine[part][1] * block[part][1] * distribute[part][1]; - m[2] = refine[part][2] * block[part][2] * distribute[part][2]; - if ( (m[0] * m[1] * m[2]) > 1) - { - for (box = 0; box < pdata.glue_nboxes; box++) - { - MapProblemIndex(pdata.glue_ilowers[box], m); - MapProblemIndex(pdata.glue_iuppers[box], m); - mmap[0] = m[pdata.glue_index_maps[box][0]]; - mmap[1] = m[pdata.glue_index_maps[box][1]]; - mmap[2] = m[pdata.glue_index_maps[box][2]]; - MapProblemIndex(pdata.glue_nbor_ilowers[box], mmap); - MapProblemIndex(pdata.glue_nbor_iuppers[box], mmap); - } - } - - /* compute box sizes, etc. */ - pdata.max_boxsize = 0; - for (box = 0; box < pdata.nboxes; box++) - { - pdata.boxsizes[box] = 1; - for (i = 0; i < 3; i++) - { - pdata.boxsizes[box] *= - (pdata.iuppers[box][i] - pdata.ilowers[box][i] + 2); - } - pdata.max_boxsize = - hypre_max(pdata.max_boxsize, pdata.boxsizes[box]); - } - for (box = 0; box < pdata.graph_nentries; box++) - { - pdata.graph_boxsizes[box] = 1; - for (i = 0; i < 3; i++) - { - pdata.graph_boxsizes[box] *= - (pdata.graph_iuppers[box][i] - - pdata.graph_ilowers[box][i] + 1); - } - } - } - - if (pdata.nboxes == 0) - { - hypre_TFree(pdata.ilowers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.iuppers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.boxsizes, HYPRE_MEMORY_HOST); - pdata.max_boxsize = 0; - } - - if (pdata.glue_nboxes == 0) - { - hypre_TFree(pdata.glue_ilowers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.glue_iuppers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.glue_nbor_parts, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.glue_nbor_ilowers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.glue_nbor_iuppers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.glue_index_maps, HYPRE_MEMORY_HOST); - } - - if (pdata.graph_nentries == 0) - { - hypre_TFree(pdata.graph_ilowers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_iuppers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_strides, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_vars, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_to_parts, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_to_ilowers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_to_iuppers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_to_strides, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_to_vars, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_index_maps, HYPRE_MEMORY_HOST); - 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.graph_boxsizes, HYPRE_MEMORY_HOST); - } - - 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); - } - - data.pdata[part] = pdata; - } - - data.max_boxsize = 0; - for (part = 0; part < data.nparts; part++) - { - data.max_boxsize = - hypre_max(data.max_boxsize, data.pdata[part].max_boxsize); - } - - hypre_TFree(pool_procs, HYPRE_MEMORY_HOST); - - *data_ptr = data; - return 0; -} - -/*-------------------------------------------------------------------------- - * Destroy data - *--------------------------------------------------------------------------*/ - -HYPRE_Int -DestroyData( ProblemData data ) -{ - ProblemPartData pdata; - HYPRE_Int part, s; - - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - - if (pdata.nboxes > 0) - { - hypre_TFree(pdata.ilowers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.iuppers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.boxsizes, HYPRE_MEMORY_HOST); - } - - if (pdata.nvars > 0) - { - hypre_TFree(pdata.vartypes, HYPRE_MEMORY_HOST); - } - - if (pdata.add_nvars > 0) - { - hypre_TFree(pdata.add_indexes, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.add_vartypes, HYPRE_MEMORY_HOST); - } - - if (pdata.glue_nboxes > 0) - { - hypre_TFree(pdata.glue_ilowers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.glue_iuppers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.glue_nbor_parts, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.glue_nbor_ilowers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.glue_nbor_iuppers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.glue_index_maps, HYPRE_MEMORY_HOST); - } - - if (pdata.nvars > 0) - { - hypre_TFree(pdata.stencil_num, HYPRE_MEMORY_HOST); - } - - if (pdata.graph_nentries > 0) - { - hypre_TFree(pdata.graph_ilowers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_iuppers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_strides, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_vars, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_to_parts, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_to_ilowers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_to_iuppers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_to_strides, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_to_vars, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_index_maps, HYPRE_MEMORY_HOST); - 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.graph_boxsizes, HYPRE_MEMORY_HOST); - } - - 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(data.pdata, HYPRE_MEMORY_HOST); - - for (s = 0; s < data.nstencils; s++) - { - hypre_TFree(data.stencil_offsets[s], HYPRE_MEMORY_HOST); - hypre_TFree(data.stencil_vars[s], HYPRE_MEMORY_HOST); - hypre_TFree(data.stencil_values[s], HYPRE_MEMORY_HOST); - } - hypre_TFree(data.stencil_sizes, HYPRE_MEMORY_HOST); - hypre_TFree(data.stencil_offsets, HYPRE_MEMORY_HOST); - hypre_TFree(data.stencil_vars, HYPRE_MEMORY_HOST); - hypre_TFree(data.stencil_values, HYPRE_MEMORY_HOST); - - if (data.symmetric_nentries > 0) - { - hypre_TFree(data.symmetric_parts, HYPRE_MEMORY_HOST); - hypre_TFree(data.symmetric_vars, HYPRE_MEMORY_HOST); - hypre_TFree(data.symmetric_to_vars, HYPRE_MEMORY_HOST); - hypre_TFree(data.symmetric_booleans, HYPRE_MEMORY_HOST); - } - - hypre_TFree(data.pools, HYPRE_MEMORY_HOST); - - return 0; -} - -/*-------------------------------------------------------------------------- - * Compute new box based on variable type - *--------------------------------------------------------------------------*/ - -HYPRE_Int -GetVariableBox( Index cell_ilower, - Index cell_iupper, - HYPRE_Int int_vartype, - Index var_ilower, - Index var_iupper ) -{ - HYPRE_Int ierr = 0; -#ifdef HYPRE_FORTRAN - hypre_F90_Obj vartype = (hypre_F90_Obj) int_vartype; -#else - HYPRE_SStructVariable vartype = (HYPRE_SStructVariable) int_vartype; -#endif - - var_ilower[0] = cell_ilower[0]; - var_ilower[1] = cell_ilower[1]; - var_ilower[2] = cell_ilower[2]; - var_iupper[0] = cell_iupper[0]; - var_iupper[1] = cell_iupper[1]; - var_iupper[2] = cell_iupper[2]; - - switch (vartype) - { - case HYPRE_SSTRUCT_VARIABLE_CELL: - 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; - case HYPRE_SSTRUCT_VARIABLE_XFACE: - 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; - case HYPRE_SSTRUCT_VARIABLE_ZFACE: - 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; - case HYPRE_SSTRUCT_VARIABLE_YEDGE: - 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; - case HYPRE_SSTRUCT_VARIABLE_UNDEFINED: - break; - } - - return ierr; -} -/*-------------------------------------------------------------------------- - * Print usage info - *--------------------------------------------------------------------------*/ - -HYPRE_Int -PrintUsage( char *progname, - HYPRE_Int myid ) -{ - if ( myid == 0 ) - { - hypre_printf("\n"); - hypre_printf("Usage: %s []\n", progname); - hypre_printf("\n"); - hypre_printf(" -in : input file (default is `%s')\n", - infile_default); - hypre_printf("\n"); - hypre_printf(" -pt ... : set part(s) for subsequent options\n"); - hypre_printf(" -r : refine part(s)\n"); - hypre_printf(" -P : refine and distribute part(s)\n"); - hypre_printf(" -b : refine and block part(s)\n"); - hypre_printf(" -solver : solver ID (default = 39)\n"); - hypre_printf(" -print : print out the system\n"); - hypre_printf(" -v : SysPFMG and Struct- # of pre and post relax\n"); - hypre_printf(" -sym : Struct- symmetric storage (1) or not (0)\n"); - - hypre_printf("\n"); - } - - return 0; -} - -/*-------------------------------------------------------------------------- - * Test driver for semi-structured matrix interface - *--------------------------------------------------------------------------*/ - -HYPRE_Int -main( HYPRE_Int argc, - char *argv[] ) -{ - char *infile; - ProblemData global_data; - ProblemData data; - ProblemPartData pdata; - HYPRE_Int nparts; - HYPRE_Int *parts; - Index *refine; - Index *distribute; - Index *block; - HYPRE_Int solver_id; - HYPRE_Int print_system; - -#ifdef HYPRE_FORTRAN - hypre_F90_Obj grid; - hypre_F90_Obj *stencils; - hypre_F90_Obj graph; - hypre_F90_Obj A; - hypre_F90_Obj T, parA; - hypre_F90_Obj b; - hypre_F90_Obj x; - hypre_F90_Obj parb, parx; - hypre_F90_Obj solver; - - hypre_F90_Obj cell_grid; -#else - HYPRE_SStructGrid grid; - HYPRE_SStructStencil *stencils; - HYPRE_SStructGraph graph; - HYPRE_SStructMatrix A; - HYPRE_ParCSRMatrix T, parA; - HYPRE_SStructVector b; - HYPRE_SStructVector x; - HYPRE_ParVector parb, parx; - HYPRE_SStructSolver solver; - - HYPRE_StructGrid cell_grid; -#endif - - hypre_Box *bounding_box; - HYPRE_Real h; - - HYPRE_Int **bdryRanks, *bdryRanksCnt; - - Index ilower, iupper; - Index index, to_index; - HYPRE_Real *values; - - 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; - -#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_Real ftol = 1.e-8; -#endif - - /*----------------------------------------------------------- - * 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); - - /*----------------------------------------------------------- - * Read input file - *-----------------------------------------------------------*/ - - arg_index = 1; - - /* parse command line for input file name */ - infile = infile_default; - if (argc > 1) - { - if ( strcmp(argv[arg_index], "-in") == 0 ) - { - arg_index++; - infile = argv[arg_index++]; - } - } - - ReadData(infile, &global_data); - - /*----------------------------------------------------------- - * Set defaults - *-----------------------------------------------------------*/ - - 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; - } - } - - print_system = 0; - - n_pre = 1; - n_post = 1; - - /*----------------------------------------------------------- - * Parse command line - *-----------------------------------------------------------*/ - - while (arg_index < argc) - { - if ( strcmp(argv[arg_index], "-pt") == 0 ) - { - arg_index++; - nparts = 0; - while ( strncmp(argv[arg_index], "-", 1) != 0 ) - { - parts[nparts++] = atoi(argv[arg_index++]); - } - } - else if ( strcmp(argv[arg_index], "-r") == 0 ) - { - arg_index++; - for (i = 0; i < nparts; i++) - { - part = parts[i]; - k = arg_index; - for (j = 0; j < 3; j++) - { - refine[part][j] = atoi(argv[k++]); - } - } - arg_index += 3; - } - else if ( strcmp(argv[arg_index], "-P") == 0 ) - { - arg_index++; - for (i = 0; i < nparts; i++) - { - part = parts[i]; - k = arg_index; - for (j = 0; j < 3; j++) - { - distribute[part][j] = atoi(argv[k++]); - } - } - arg_index += 3; - } - else if ( strcmp(argv[arg_index], "-b") == 0 ) - { - arg_index++; - for (i = 0; i < nparts; i++) - { - part = parts[i]; - k = arg_index; - for (j = 0; j < 3; j++) - { - block[part][j] = atoi(argv[k++]); - } - } - arg_index += 3; - } - 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], "-v") == 0 ) - { - arg_index++; - n_pre = atoi(argv[arg_index++]); - n_post = atoi(argv[arg_index++]); - } - else if ( strcmp(argv[arg_index], "-help") == 0 ) - { - PrintUsage(argv[0], myid); - exit(1); - break; - } - else - { - break; - } - } - - /*----------------------------------------------------------- - * Distribute data - *-----------------------------------------------------------*/ - - DistributeData(global_data, refine, distribute, block, - num_procs, myid, &data); - - /*----------------------------------------------------------- - * Synchronize so that timings make sense - *-----------------------------------------------------------*/ - - hypre_MPI_Barrier(hypre_MPI_COMM_WORLD); - - /*----------------------------------------------------------- - * Set up the grid - *-----------------------------------------------------------*/ - -#ifdef HYPRE_FORTRAN - temp_COMM = (HYPRE_Int) hypre_MPI_COMM_WORLD; - long_temp_COMM = (hypre_F90_Obj) hypre_MPI_COMM_WORLD; -#endif - - time_index = hypre_InitializeTiming("SStruct Interface"); - hypre_BeginTiming(time_index); - -#ifdef HYPRE_FORTRAN - HYPRE_SStructGridCreate(&temp_COMM, &data.ndim, &data.nparts, &grid); -#else - HYPRE_SStructGridCreate(hypre_MPI_COMM_WORLD, data.ndim, data.nparts, &grid); -#endif - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - for (box = 0; box < pdata.nboxes; box++) - { -#ifdef HYPRE_FORTRAN - HYPRE_SStructGridSetExtents(&grid, &part, - pdata.ilowers[box], pdata.iuppers[box]); -#else - HYPRE_SStructGridSetExtents(grid, part, - pdata.ilowers[box], pdata.iuppers[box]); -#endif - } - -#ifdef HYPRE_FORTRAN - HYPRE_SStructGridSetVariables(&grid, &part, &pdata.nvars, pdata.vartypes); -#else - HYPRE_SStructGridSetVariables(grid, part, pdata.nvars, pdata.vartypes); -#endif - - /* GridAddVariabes */ - - /* GridSetNeighborBox */ - for (box = 0; box < pdata.glue_nboxes; box++) - { -#ifdef HYPRE_FORTRAN - HYPRE_SStructGridSetNeighborBox(&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]); -#else - HYPRE_SStructGridSetNeighborBox(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]); -#endif - } - -#ifdef HYPRE_FORTRAN - HYPRE_SStructGridSetPeriodic(&grid, &part, pdata.periodic); -#else - HYPRE_SStructGridSetPeriodic(grid, part, pdata.periodic); -#endif - } - -#ifdef HYPRE_FORTRAN - HYPRE_SStructGridAssemble(&grid); -#else - HYPRE_SStructGridAssemble(grid); -#endif - - /*----------------------------------------------------------- - * Set up the stencils - *-----------------------------------------------------------*/ - -#ifdef HYPRE_FORTRAN - stencils = hypre_CTAlloc(hypre_F90_Obj, data.nstencils, HYPRE_MEMORY_HOST); -#else - stencils = hypre_CTAlloc(HYPRE_SStructStencil, data.nstencils, HYPRE_MEMORY_HOST); -#endif - for (s = 0; s < data.nstencils; s++) - { -#ifdef HYPRE_FORTRAN - HYPRE_SStructStencilCreate(&data.ndim, &data.stencil_sizes[s], - &stencils[s]); -#else - HYPRE_SStructStencilCreate(data.ndim, data.stencil_sizes[s], - &stencils[s]); -#endif - for (i = 0; i < data.stencil_sizes[s]; i++) - { -#ifdef HYPRE_FORTRAN - HYPRE_SStructStencilSetEntry(&stencils[s], &i, - data.stencil_offsets[s][i], - &data.stencil_vars[s][i]); -#else - HYPRE_SStructStencilSetEntry(stencils[s], i, - data.stencil_offsets[s][i], - data.stencil_vars[s][i]); -#endif - } - } - - /*----------------------------------------------------------- - * Set up the graph - *-----------------------------------------------------------*/ - -#ifdef HYPRE_FORTRAN - HYPRE_SStructGraphCreate(&temp_COMM, &grid, &graph); - HYPRE_SStructGraphSetObjectType(&graph, &for_HYPRE_PARCSR); -#else - HYPRE_SStructGraphCreate(hypre_MPI_COMM_WORLD, grid, &graph); - HYPRE_SStructGraphSetObjectType(graph, HYPRE_PARCSR); -#endif - - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - - /* set stencils */ - for (var = 0; var < pdata.nvars; var++) - { -#ifdef HYPRE_FORTRAN - HYPRE_SStructGraphSetStencil(&graph, &part, &var, - &stencils[pdata.stencil_num[var]]); -#else - HYPRE_SStructGraphSetStencil(graph, part, var, - stencils[pdata.stencil_num[var]]); -#endif - } - - /* add entries */ - for (entry = 0; entry < pdata.graph_nentries; entry++) - { - for (index[2] = pdata.graph_ilowers[entry][2]; - index[2] <= pdata.graph_iuppers[entry][2]; - index[2] += pdata.graph_strides[entry][2]) - { - for (index[1] = pdata.graph_ilowers[entry][1]; - index[1] <= pdata.graph_iuppers[entry][1]; - index[1] += pdata.graph_strides[entry][1]) - { - for (index[0] = pdata.graph_ilowers[entry][0]; - index[0] <= pdata.graph_iuppers[entry][0]; - index[0] += pdata.graph_strides[entry][0]) - { - for (i = 0; i < 3; i++) - { - j = pdata.graph_index_maps[entry][i]; - k = index[i] - pdata.graph_ilowers[entry][i]; - 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]; - } -#ifdef HYPRE_FORTRAN - HYPRE_SStructGraphAddEntries(&graph, &part, index, - &pdata.graph_vars[entry], - &pdata.graph_to_parts[entry], - to_index, - &pdata.graph_to_vars[entry]); -#else - HYPRE_SStructGraphAddEntries(graph, part, index, - pdata.graph_vars[entry], - pdata.graph_to_parts[entry], - to_index, - pdata.graph_to_vars[entry]); -#endif - } - } - } - } - } - -#ifdef HYPRE_FORTRAN - HYPRE_SStructGraphAssemble(&graph); -#else - HYPRE_SStructGraphAssemble(graph); -#endif - - /*----------------------------------------------------------- - * Set up the matrix - *-----------------------------------------------------------*/ - - values = hypre_TAlloc(HYPRE_Real, data.max_boxsize, HYPRE_MEMORY_HOST); - -#ifdef HYPRE_FORTRAN - HYPRE_SStructMatrixCreate(&temp_COMM, &graph, &A); -#else - HYPRE_SStructMatrixCreate(hypre_MPI_COMM_WORLD, graph, &A); -#endif - - /* TODO HYPRE_SStructMatrixSetSymmetric(A, 1); */ - for (entry = 0; entry < data.symmetric_nentries; entry++) - { -#ifdef HYPRE_FORTRAN - HYPRE_SStructMatrixSetSymmetric(&A, - &data.symmetric_parts[entry], - &data.symmetric_vars[entry], - &data.symmetric_to_vars[entry], - &data.symmetric_booleans[entry]); -#else - HYPRE_SStructMatrixSetSymmetric(A, - data.symmetric_parts[entry], - data.symmetric_vars[entry], - data.symmetric_to_vars[entry], - data.symmetric_booleans[entry]); -#endif - } - -#ifdef HYPRE_FORTRAN - HYPRE_SStructMatrixSetNSSymmetric(&A, &data.ns_symmetric); - - HYPRE_SStructMatrixSetObjectType(&A, &for_HYPRE_PARCSR); - HYPRE_SStructMatrixInitialize(&A); -#else - HYPRE_SStructMatrixSetNSSymmetric(A, data.ns_symmetric); - - HYPRE_SStructMatrixSetObjectType(A, HYPRE_PARCSR); - HYPRE_SStructMatrixInitialize(A); -#endif - - 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); - - 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) - { - h = (HYPRE_Real) (hypre_BoxIMax(bounding_box)[i] - hypre_BoxIMin(bounding_box)[i]); - } - } - h = 1.0 / h; - - /* set stencil values */ - for (var = 0; var < pdata.nvars; var++) - { - s = pdata.stencil_num[var]; - for (i = 0; i < data.stencil_sizes[s]; i++) - { - for (j = 0; j < pdata.max_boxsize; j++) - { - 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; - } - } - - for (box = 0; box < pdata.nboxes; box++) - { - GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], - pdata.vartypes[var], ilower, iupper); -#ifdef HYPRE_FORTRAN - HYPRE_SStructMatrixSetBoxValues(&A, &part, &ilower[0], &iupper[0], - &var, &one, &i, &values[0]); -#else - HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, - var, 1, &i, values); -#endif - } - } - } - - /* set non-stencil entries */ - for (entry = 0; entry < pdata.graph_nentries; entry++) - { - for (index[2] = pdata.graph_ilowers[entry][2]; - index[2] <= pdata.graph_iuppers[entry][2]; - index[2] += pdata.graph_strides[entry][2]) - { - for (index[1] = pdata.graph_ilowers[entry][1]; - index[1] <= pdata.graph_iuppers[entry][1]; - index[1] += pdata.graph_strides[entry][1]) - { - for (index[0] = pdata.graph_ilowers[entry][0]; - index[0] <= pdata.graph_iuppers[entry][0]; - index[0] += pdata.graph_strides[entry][0]) - { -#ifdef HYPRE_FORTRAN - HYPRE_SStructMatrixSetValues(&A, &part, index, - &pdata.graph_vars[entry], - &one, &pdata.graph_entries[entry], - &pdata.graph_values[entry]); -#else - HYPRE_SStructMatrixSetValues(A, part, index, - pdata.graph_vars[entry], - 1, &pdata.graph_entries[entry], - &pdata.graph_values[entry]); -#endif - } - } - } - } - } - - /* reset matrix values: - * NOTE THAT THE matrix_ilowers & matrix_iuppers MUST BE IN TERMS OF THE - * CHOOSEN VAR_TYPE INDICES, UNLIKE THE EXTENTS OF THE GRID< WHICH ARE - * IN TERMS OF THE CELL VARTYPE INDICES. - */ - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - for (entry = 0; entry < pdata.matrix_nentries; entry++) - { - for (index[2] = pdata.matrix_ilowers[entry][2]; - index[2] <= pdata.matrix_iuppers[entry][2]; - index[2] += pdata.matrix_strides[entry][2]) - { - for (index[1] = pdata.matrix_ilowers[entry][1]; - index[1] <= pdata.matrix_iuppers[entry][1]; - index[1] += pdata.matrix_strides[entry][1]) - { - for (index[0] = pdata.matrix_ilowers[entry][0]; - index[0] <= pdata.matrix_iuppers[entry][0]; - index[0] += pdata.matrix_strides[entry][0]) - { -#ifdef HYPRE_FORTRAN - HYPRE_SStructMatrixSetValues(&A, &part, index, - &pdata.matrix_vars[entry], - &one, &pdata.matrix_entries[entry], - &pdata.matrix_values[entry]); -#else - HYPRE_SStructMatrixSetValues(A, part, index, - pdata.matrix_vars[entry], - 1, &pdata.matrix_entries[entry], - &pdata.matrix_values[entry]); -#endif - } - } - } - } - } - -#ifdef HYPRE_FORTRAN - HYPRE_SStructMatrixAssemble(&A); - HYPRE_MaxwellGrad(&grid, &T); -#else - HYPRE_SStructMatrixAssemble(A); - HYPRE_MaxwellGrad(grid, &T); -#endif - - /* eliminate the physical boundary points */ -#ifdef HYPRE_FORTRAN - HYPRE_SStructMatrixGetObject(&A, &parA); - HYPRE_SStructMaxwellPhysBdy(&grid, &one, &data.rfactor[0], - &bdryRanks[0][0], &bdryRanksCnt[0]); - - HYPRE_ParCSRMatrixEliminateRowsCols(&parA, &bdryRanksCnt[0], &bdryRanks[0]); - - HYPRE_ParCSRMatrixEliminateRowsCols(&parA, &bdryRanksCnt[0], &bdryRanks[0]); -#else - HYPRE_SStructMatrixGetObject(A, (void **) &parA); - HYPRE_SStructMaxwellPhysBdy(&grid, 1, data.rfactor, - &bdryRanks, &bdryRanksCnt); - - HYPRE_ParCSRMatrixEliminateRowsCols(parA, bdryRanksCnt[0], bdryRanks[0]); - - 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++) - { - hypre_MaxwellOffProcRowDestroy((void *) OffProcRows[j]); - } - hypre_TFree(OffProcRows, HYPRE_MEMORY_HOST); - } - - /*----------------------------------------------------------- - * Set up the linear system - *-----------------------------------------------------------*/ - -#ifdef HYPRE_FORTRAN - HYPRE_SStructVectorCreate(&temp_COMM, &grid, &b); - HYPRE_SStructVectorSetObjectType(&b, &for_HYPRE_PARCSR); - - HYPRE_SStructVectorInitialize(&b); -#else - HYPRE_SStructVectorCreate(hypre_MPI_COMM_WORLD, grid, &b); - HYPRE_SStructVectorSetObjectType(b, HYPRE_PARCSR); - - HYPRE_SStructVectorInitialize(b); -#endif - - for (j = 0; j < data.max_boxsize; 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++) - { - 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); -#ifdef HYPRE_FORTRAN - HYPRE_SStructVectorSetBoxValues(&b, &part, &ilower[0], &iupper[0], - &var, &values[0]); -#else - HYPRE_SStructVectorSetBoxValues(b, part, ilower, iupper, - var, values); -#endif - } - } - } -#ifdef HYPRE_FORTRAN - HYPRE_SStructVectorAssemble(&b); -#else - HYPRE_SStructVectorAssemble(b); -#endif - -#ifdef HYPRE_FORTRAN - HYPRE_SStructVectorCreate(&temp_COMM, &grid, &x); - HYPRE_SStructVectorSetObjectType(&x, &for_HYPRE_PARCSR); - - HYPRE_SStructVectorInitialize(&x); -#else - HYPRE_SStructVectorCreate(hypre_MPI_COMM_WORLD, grid, x); - HYPRE_SStructVectorSetObjectType(x, HYPRE_PARCSR); - - HYPRE_SStructVectorInitialize(x); -#endif - - for (j = 0; j < data.max_boxsize; j++) - { - values[j] = 0.0; - } - 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); -#ifdef HYPRE_FORTRAN - HYPRE_SStructVectorSetBoxValues(&x, &part, &ilower[0], &iupper[0], - &var, &values[0]); -#else - HYPRE_SStructVectorSetBoxValues(x, part, ilower, iupper, - var, values); -#endif - } - } - } -#ifdef HYPRE_FORTRAN - HYPRE_SStructVectorAssemble(&x); - - HYPRE_SStructVectorGetObject(&x, &parx); - HYPRE_SStructVectorGetObject(&b, &parb); -#else - HYPRE_SStructVectorAssemble(x); - - HYPRE_SStructVectorGetObject(x, (void **) &parx); - HYPRE_SStructVectorGetObject(b, (void **) &parb); -#endif - - hypre_ParVectorZeroBCValues((hypre_ParVector *) parx, bdryRanks[0], - bdryRanksCnt[0]); - hypre_ParVectorZeroBCValues((hypre_ParVector *) parb, bdryRanks[0], - bdryRanksCnt[0]); - - hypre_TFree(bdryRanks[0], HYPRE_MEMORY_HOST); - hypre_TFree(bdryRanks, HYPRE_MEMORY_HOST); - hypre_TFree(bdryRanksCnt, HYPRE_MEMORY_HOST); - - hypre_EndTiming(time_index); - hypre_PrintTiming("SStruct Interface", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - - /*----------------------------------------------------------- - * Print out the system and initial guess - *-----------------------------------------------------------*/ - - if (print_system) - { -#ifdef HYPRE_FORTRAN - HYPRE_SStructMatrixPrint("sstruct.out.A", &A, &zero); - HYPRE_SStructVectorPrint("sstruct.out.b", &b, &zero); - HYPRE_SStructVectorPrint("sstruct.out.x0", &x, &zero); -#else - HYPRE_SStructMatrixPrint("sstruct.out.A", A, 0); - HYPRE_SStructVectorPrint("sstruct.out.b", b, 0); - HYPRE_SStructVectorPrint("sstruct.out.x0", x, 0); -#endif - } - - /*----------------------------------------------------------- - * Debugging code - *-----------------------------------------------------------*/ - - hypre_TFree(values, HYPRE_MEMORY_HOST); - - if (solver_id == 1) - { - time_index = hypre_InitializeTiming("Maxwell Setup"); - hypre_BeginTiming(time_index); - -#ifdef HYPRE_FORTRAN - HYPRE_SStructMaxwellCreate(&long_temp_COMM, &solver); - HYPRE_SStructMaxwellSetMaxIter(&solver, &twenty); - HYPRE_SStructMaxwellSetTol(&solver, &ftol); - HYPRE_SStructMaxwellSetRelChange(&solver, &zero); - HYPRE_SStructMaxwellSetNumPreRelax(&solver, &one); - HYPRE_SStructMaxwellSetNumPostRelax(&solver, &one); - HYPRE_SStructMaxwellSetRfactors(&solver, &data.rfactor[0]); - HYPRE_SStructMaxwellSetGrad(&solver, &T); - /*HYPRE_SStructMaxwellSetConstantCoef(solver, 1);*/ - HYPRE_SStructMaxwellSetPrintLevel(&solver, &one); - HYPRE_SStructMaxwellSetLogging(&solver, &one); - HYPRE_SStructMaxwellSetup(&solver, &A, &b, &x); -#else - HYPRE_SStructMaxwellCreate(hypre_MPI_COMM_WORLD, &solver); - HYPRE_SStructMaxwellSetMaxIter(solver, 20); - HYPRE_SStructMaxwellSetTol(solver, 1.0e-8); - HYPRE_SStructMaxwellSetRelChange(solver, 0); - HYPRE_SStructMaxwellSetNumPreRelax(solver, 1); - HYPRE_SStructMaxwellSetNumPostRelax(solver, 1); - HYPRE_SStructMaxwellSetRfactors(solver, data.rfactor); - HYPRE_SStructMaxwellSetGrad(solver, T); - /*HYPRE_SStructMaxwellSetConstantCoef(solver, 1);*/ - HYPRE_SStructMaxwellSetPrintLevel(solver, 1); - HYPRE_SStructMaxwellSetLogging(solver, 1); - HYPRE_SStructMaxwellSetup(solver, A, b, x); -#endif - - hypre_EndTiming(time_index); - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - - time_index = hypre_InitializeTiming("Maxwell Solve"); - hypre_BeginTiming(time_index); - -#ifdef HYPRE_FORTRAN - HYPRE_SStructMaxwellSolve(&solver, &A, &b, &x); -#else - HYPRE_SStructMaxwellSolve(solver, A, b, x); -#endif - - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - -#ifdef HYPRE_FORTRAN - HYPRE_SStructMaxwellGetNumIterations(&solver, &num_iterations); - HYPRE_SStructMaxwellGetFinalRelativeResidualNorm(&solver, &final_res_norm); - HYPRE_SStructMaxwellDestroy(&solver); -#else - HYPRE_SStructMaxwellGetNumIterations(solver, &num_iterations); - HYPRE_SStructMaxwellGetFinalRelativeResidualNorm( - solver, &final_res_norm); - HYPRE_SStructMaxwellDestroy(solver); -#endif - } - -#ifdef HYPRE_FORTRAN - HYPRE_SStructVectorGather(&x); -#else - HYPRE_SStructVectorGather(x); -#endif - - /*----------------------------------------------------------- - * Print the solution and other info - *-----------------------------------------------------------*/ - - if (print_system) - { -#ifdef HYPRE_FORTRAN - HYPRE_SStructVectorPrint("sstruct.out.x", &x, &zero); -#else - HYPRE_SStructVectorPrint("sstruct.out.x", x, 0); -#endif - } - - 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"); - } - - /*----------------------------------------------------------- - * Finalize things - *-----------------------------------------------------------*/ - -#ifdef HYPRE_FORTRAN - HYPRE_SStructGridDestroy(&grid); -#else - HYPRE_SStructGridDestroy(grid); -#endif - - for (s = 0; s < data.nstencils; s++) - { -#ifdef HYPRE_FORTRAN - HYPRE_SStructStencilDestroy(&stencils[s]); -#else - HYPRE_SStructStencilDestroy(stencils[s]); -#endif - } - hypre_TFree(stencils, HYPRE_MEMORY_HOST); - -#ifdef HYPRE_FORTRAN - HYPRE_SStructGraphDestroy(&graph); - HYPRE_SStructMatrixDestroy(&A); - HYPRE_ParCSRMatrixDestroy(&T); - HYPRE_SStructVectorDestroy(&b); - HYPRE_SStructVectorDestroy(&x); -#else - HYPRE_SStructGraphDestroy(graph); - HYPRE_SStructMatrixDestroy(A); - HYPRE_ParCSRMatrixDestroy(T); - HYPRE_SStructVectorDestroy(b); - HYPRE_SStructVectorDestroy(x); -#endif - - - DestroyData(data); - - hypre_TFree(parts, HYPRE_MEMORY_HOST); - hypre_TFree(refine, HYPRE_MEMORY_HOST); - hypre_TFree(distribute, HYPRE_MEMORY_HOST); - hypre_TFree(block, HYPRE_MEMORY_HOST); - - /* Finalize MPI */ - hypre_MPI_Finalize(); - - return (0); -} diff --git a/src/test/fsstruct_ls.f b/src/test/fsstruct_ls.f index 0230cfd765..3070097aa2 100644 --- a/src/test/fsstruct_ls.f +++ b/src/test/fsstruct_ls.f @@ -236,11 +236,11 @@ subroutine fhypre_sstructbicgstabgetnumite(fsolver, fnumiter) integer fnumiter integer*8 fsolver - call HYPRE_SStructBiCGSTABGetNumIter(fsolver, fnumiter, + call HYPRE_SStructBiCGSTABGetNumIter(fsolver, fnumiter, 1 ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructbicgstabgetnumiterations error = ', + print *, 'fhypre_sstructbicgstabgetnumiterations error = ', 1 ierr endif @@ -471,7 +471,7 @@ subroutine fhypre_sstructgmressetstopcrit(fsolver, fstop_crit) !-------------------------------------------------------------------------- ! HYPRE_SStructGMRESSetPrecond !-------------------------------------------------------------------------- - subroutine fhypre_sstructgmressetprecond(fsolver, fprecond_id, + subroutine fhypre_sstructgmressetprecond(fsolver, fprecond_id, 1 fprecond) integer ierr @@ -687,24 +687,23 @@ subroutine fhypre_sstructsetupmatvec(fsolver) - !**************************************************************************** -! HYPRE_SStructFAC routines +! HYPRE_SStructPCG routines !**************************************************************************** !-------------------------------------------------------------------------- -! HYPRE_SStructFACCreate +! HYPRE_SStructPCGCreate !-------------------------------------------------------------------------- - subroutine fhypre_sstructfaccreate(fcomm, fsolver) + subroutine fhypre_sstructpcgcreate(fcomm, fsolver) integer ierr integer*8 fcomm integer*8 fsolver - call HYPRE_SStructFACCreate(fcomm, fsolver, ierr) + call HYPRE_SStructPCGCreate(fcomm, fsolver, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructfaccreate error = ', ierr + print *, 'fhypre_sstructpcgcreate error = ', ierr endif return @@ -712,17 +711,17 @@ subroutine fhypre_sstructfaccreate(fcomm, fsolver) !-------------------------------------------------------------------------- -! HYPRE_SStructFACDestroy2 +! HYPRE_SStructPCGDestroy !-------------------------------------------------------------------------- - subroutine fhypre_sstructfacdestroy2(fsolver) + subroutine fhypre_sstructpcgdestroy(fsolver) integer ierr integer*8 fsolver - call HYPRE_SStructFACDestroy2(fsolver, ierr) + call HYPRE_SStructPCGDestroy(fsolver, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructfacdestroy2 error = ', ierr + print *, 'fhypre_sstructpcgdestroy error = ', ierr endif return @@ -730,9 +729,9 @@ subroutine fhypre_sstructfacdestroy2(fsolver) !-------------------------------------------------------------------------- -! HYPRE_SStructFACSetup2 +! HYPRE_SStructPCGSetup !-------------------------------------------------------------------------- - subroutine fhypre_sstructfacsetup2(fsolver, fA, fb, fx) + subroutine fhypre_sstructpcgsetup(fsolver, fA, fb, fx) integer ierr integer*8 fsolver @@ -740,10 +739,10 @@ subroutine fhypre_sstructfacsetup2(fsolver, fA, fb, fx) integer*8 fb integer*8 fx - call HYPRE_SStructFACSetup2(fsolver, fA, fb, fx, ierr) + call HYPRE_SStructPCGSetup(fsolver, fA, fb, fx, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructfacsetup2 error = ', ierr + print *, 'fhypre_sstructpcgsetup error = ', ierr endif return @@ -751,9 +750,9 @@ subroutine fhypre_sstructfacsetup2(fsolver, fA, fb, fx) !-------------------------------------------------------------------------- -! HYPRE_SStructFACSolve3 +! HYPRE_SStructPCGSolve !-------------------------------------------------------------------------- - subroutine fhypre_sstructfacsolve3(fsolver, fA, fb, fx) + subroutine fhypre_sstructpcgsolve(fsolver, fA, fb, fx) integer ierr integer*8 fsolver @@ -761,10 +760,10 @@ subroutine fhypre_sstructfacsolve3(fsolver, fA, fb, fx) integer*8 fb integer*8 fx - call HYPRE_SStructFACSolve3(fsolver, fA, fb, fx, ierr) + call HYPRE_SStructPCGSolve(fsolver, fA, fb, fx, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructfacsolve3 error = ', ierr + print *, 'fhypre_sstructpcgsolve error = ', ierr endif return @@ -772,18 +771,18 @@ subroutine fhypre_sstructfacsolve3(fsolver, fA, fb, fx) !-------------------------------------------------------------------------- -! HYPRE_SStructFACSetTol +! HYPRE_SStructPCGSetTol !-------------------------------------------------------------------------- - subroutine fhypre_sstructfacsettol(fsolver, ftol) + subroutine fhypre_sstructpcgsettol(fsolver, ftol) integer ierr integer*8 fsolver - integer*8 ftol + double precision ftol - call HYPRE_SStructFACSetTol(fsolver, ftol, ierr) + call HYPRE_SStructPCGSetTol(fsolver, ftol, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructfacsettol error = ', ierr + print *, 'fhypre_sstructpcgsettol error = ', ierr endif return @@ -791,19 +790,18 @@ subroutine fhypre_sstructfacsettol(fsolver, ftol) !-------------------------------------------------------------------------- -! HYPRE_SStructFACSetPLevels +! HYPRE_SStructPCGSetMaxIter !-------------------------------------------------------------------------- - subroutine fhypre_sstructfacsetplevels(fsolver, fnparts, fplevels) + subroutine fhypre_sstructpcgsetmaxiter(fsolver, fmax_iter) integer ierr + integer fmax_iter integer*8 fsolver - integer*8 fnparts - integer*8 fplevels - call HYPRE_SStructFACSetPLevels(fsolver, fnparts, fplevels, ierr) + call HYPRE_SStructPCGSetMaxIter(fsolver, fmax_iter, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructfacsetplevels error = ', ierr + print *, 'fhypre_sstructpcgsetmaxiter error = ', ierr endif return @@ -811,21 +809,18 @@ subroutine fhypre_sstructfacsetplevels(fsolver, fnparts, fplevels) !-------------------------------------------------------------------------- -! HYPRE_SStructFACSetPRefinements +! HYPRE_SStructPCGSetTwoNorm !-------------------------------------------------------------------------- - subroutine fhypre_sstructfacsetprefinement(fsolver, fnparts, - 1 frfactors) + subroutine fhypre_sstructpcgsettwonorm(fsolver, ftwo_norm) integer ierr + integer ftwo_norm integer*8 fsolver - integer*8 fnparts - integer*8 frfactors(3) - call HYPRE_SStructFACSetPRefinements(fsolver, fnparts, frfactors, - 1 ierr) + call HYPRE_SStructPCGSetTwoNorm(fsolver, ftwo_norm, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructfacsetprefinements error = ', ierr + print *, 'fhypre_sstructpcgsettwonorm error = ', ierr endif return @@ -833,18 +828,18 @@ subroutine fhypre_sstructfacsetprefinement(fsolver, fnparts, !-------------------------------------------------------------------------- -! HYPRE_SStructFACSetMaxLevels +! HYPRE_SStructPCGSetRelChange !-------------------------------------------------------------------------- - subroutine fhypre_sstructfacsetmaxlevels(fsolver, fmaxlevels) + subroutine fhypre_sstructpcgsetrelchange(fsolver, frel_change) integer ierr + integer frel_change integer*8 fsolver - integer*8 fmaxlevels - call HYPRE_SStructFACSetMaxLevels(fsolver, fmaxlevels, ierr) + call HYPRE_SStructPCGSetRelChange(fsolver, frel_change, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructfacsetmaxlevels error = ', ierr + print *, 'fhypre_sstructpcgsetrelchange error = ', ierr endif return @@ -852,18 +847,21 @@ subroutine fhypre_sstructfacsetmaxlevels(fsolver, fmaxlevels) !-------------------------------------------------------------------------- -! HYPRE_SStructFACSetMaxIter +! HYPRE_SStructPCGSetPrecond !-------------------------------------------------------------------------- - subroutine fhypre_sstructfacsetmaxiter(fsolver, fmaxiter) + subroutine fhypre_sstructpcgsetprecond(fsolver, fprecond_id, + 1 fprecond) integer ierr + integer fprecond_id integer*8 fsolver - integer*8 fmaxiter + integer*8 fprecond - call HYPRE_SStructFACSetMaxIter(fsolver, fmaxiter, ierr) + call HYPRE_SStructPCGSetPrecond(fsolver, fprecond_id, fprecond, + 1 ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructfacsetmaxiter error = ', ierr + print *, 'fhypre_sstructpcgsetprecond error = ', ierr endif return @@ -871,18 +869,18 @@ subroutine fhypre_sstructfacsetmaxiter(fsolver, fmaxiter) !-------------------------------------------------------------------------- -! HYPRE_SStructFACSetRelChange +! HYPRE_SStructPCGSetLogging !-------------------------------------------------------------------------- - subroutine fhypre_sstructfacsetrelchange(fsolver, frelchange) + subroutine fhypre_sstructpcgsetlogging(fsolver, flog) integer ierr + integer flog integer*8 fsolver - integer*8 frelchange - call HYPRE_SStructFACSetRelChange(fsolver, frelchange, ierr) + call HYPRE_SStructPCGSetLogging(fsolver, flog, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructfacsetrelchange error = ', ierr + print *, 'fhypre_sstructpcgsetlogging error = ', ierr endif return @@ -890,17 +888,18 @@ subroutine fhypre_sstructfacsetrelchange(fsolver, frelchange) !-------------------------------------------------------------------------- -! HYPRE_SStructFACSetZeroGuess +! HYPRE_SStructPCGSetPrintLevel !-------------------------------------------------------------------------- - subroutine fhypre_sstructfacsetzeroguess(fsolver) + subroutine fhypre_sstructpcgsetprintlevel(fsolver, flevel) integer ierr + integer flevel integer*8 fsolver - call HYPRE_SStructFACSetZeroGuess(fsolver, ierr) + call HYPRE_SStructPCGSetPrintLevel(fsolver, flevel, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructfacsetzeroguess error = ', ierr + print *, 'fhypre_sstructpcgsetprintlevel error = ', ierr endif return @@ -908,17 +907,18 @@ subroutine fhypre_sstructfacsetzeroguess(fsolver) !-------------------------------------------------------------------------- -! HYPRE_SStructFACSetNonZeroGuess +! HYPRE_SStructPCGGetNumIterations !-------------------------------------------------------------------------- - subroutine fhypre_sstructfacsetnonzerogues(fsolver) + subroutine fhypre_sstructpcggetnumiteratio(fsolver, fnumiter) integer ierr + integer fnumiter integer*8 fsolver - call HYPRE_SStructFACSetNonZeroGuess(fsolver, ierr) + call HYPRE_SStructPCGGetNumIteration(fsolver, fnumiter, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructfacsetnonzeroguess error = ', ierr + print *, 'fhypre_sstructpcggetnumiteration error = ', ierr endif return @@ -926,18 +926,18 @@ subroutine fhypre_sstructfacsetnonzerogues(fsolver) !-------------------------------------------------------------------------- -! HYPRE_SStructFACSetRelaxType +! HYPRE_SStructPCGGetFinalRelativeResidualNorm !-------------------------------------------------------------------------- - subroutine fhypre_sstructfacsetrelaxtype(fsolver, frelaxtype) + subroutine fhypre_sstructpcggetfinalrelati(fsolver, fnorm) integer ierr integer*8 fsolver - integer*8 frelaxtype + double precision fnorm - call HYPRE_SStructFACSetRelaxType(fsolver, frelaxtype, ierr) + call HYPRE_SStructPCGGetFinalRelativ(fsolver, fnorm, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructfacsetrelaxtype error = ', ierr + print *, 'fhypre_sstructpcggetfinalrelative error = ', ierr endif return @@ -945,18 +945,18 @@ subroutine fhypre_sstructfacsetrelaxtype(fsolver, frelaxtype) !-------------------------------------------------------------------------- -! HYPRE_SStructFACSetNumPreRelax +! HYPRE_SStructPCGGetResidual !-------------------------------------------------------------------------- - subroutine fhypre_sstructfacsetnumprerelax(fsolver, fnumprerelax) + subroutine fhypre_sstructpcggetresidual(fsolver, fresidual) integer ierr integer*8 fsolver - integer*8 fnumprerelax + integer*8 fresidual - call HYPRE_SStructFACSetNumPreRelax(fsolver, fnumprerelax, ierr) + call HYPRE_SStructPCGGetResidual(fsolver, fresidual, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructfacsetnumprerelax error = ', ierr + print *, 'fhypre_sstructpcggetresidual error = ', ierr endif return @@ -964,19 +964,20 @@ subroutine fhypre_sstructfacsetnumprerelax(fsolver, fnumprerelax) !-------------------------------------------------------------------------- -! HYPRE_SStructFACSetNumPostRelax +! HYPRE_SStructDiagScaleSetup !-------------------------------------------------------------------------- - subroutine fhypre_sstructfacsetnumpostrela(fsolver, - 1 fnumpostrelax) + subroutine fhypre_sstructdiagscalesetup(fsolver, fA, fy, fx) integer ierr integer*8 fsolver - integer*8 fnumpostrelax + integer*8 fA + integer*8 fy + integer*8 fx - call HYPRE_SStructFACSetNumPostRelax(fsolver, fnumpostrelax, ierr) + call HYPRE_SStructDiagScaleSetup(fsolver, fA, fy, fx, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructfacsetnumpostrelax error = ', ierr + print *, 'fhypre_sstructdiagscalesetup error = ', ierr endif return @@ -984,39 +985,46 @@ subroutine fhypre_sstructfacsetnumpostrela(fsolver, !-------------------------------------------------------------------------- -! HYPRE_SStructFACSetCoarseSolverType +! HYPRE_SStructDiagScale !-------------------------------------------------------------------------- - subroutine fhypre_sstructfacsetcoarsesolve(fsolver, - 1 fcsolvertype) + subroutine fhypre_sstructdiagscale(fsolver, fA, fy, fx) integer ierr integer*8 fsolver - integer*8 fcsolvertype + integer*8 fA + integer*8 fy + integer*8 fx - call HYPRE_SStructFACSetCoarseSolver(fsolver, fcsolvertype, - 1 ierr) + call HYPRE_SStructDiagScale(fsolver, fA, fy, fx, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructfacsetcoarsesolvertype error = ', ierr + print *, 'fhypre_sstructdiagscale error = ', ierr endif return end + + + +!**************************************************************************** +! HYPRE_SStructSplit routines +!**************************************************************************** + !-------------------------------------------------------------------------- -! HYPRE_SStructFACSetLogging +! HYPRE_SStructSplitCreate !-------------------------------------------------------------------------- - subroutine fhypre_sstructfacsetlogging(fsolver, flog) + subroutine fhypre_sstructsplitcreate(fcomm, fsolver) integer ierr - integer flog + integer*8 fcomm integer*8 fsolver - call HYPRE_SStructFACSetLogging(fsolver, flog, ierr) + call HYPRE_SStructSplitCreate(fcomm, fsolver, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructfacsetlogging error = ', ierr + print *, 'fhypre_sstructsplitcreate error = ', ierr endif return @@ -1024,18 +1032,17 @@ subroutine fhypre_sstructfacsetlogging(fsolver, flog) !-------------------------------------------------------------------------- -! HYPRE_SStructFACGetNumIterations +! HYPRE_SStructSplitDestroy !-------------------------------------------------------------------------- - subroutine fhypre_sstructfacgetnumiteratio(fsolver, fnumiter) + subroutine fhypre_sstructsplitdestroy(fsolver) integer ierr - integer fnumiter integer*8 fsolver - call HYPRE_SStructFACGetNumIteration(fsolver, fnumiter, ierr) + call HYPRE_SStructSplitDestroy(fsolver, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructfacgetnumiteration error = ', ierr + print *, 'fhypre_sstructsplitdestroy error = ', ierr endif return @@ -1043,44 +1050,41 @@ subroutine fhypre_sstructfacgetnumiteratio(fsolver, fnumiter) !-------------------------------------------------------------------------- -! HYPRE_SStructFACGetFinalRelativeResidualNorm +! HYPRE_SStructSplitSetup !-------------------------------------------------------------------------- - subroutine fhypre_sstructfacgetfinalrelati(fsolver, fnorm) + subroutine fhypre_sstructsplitsetup(fsolver, fA, fb, fx) integer ierr integer*8 fsolver - double precision fnorm + integer*8 fA + integer*8 fb + integer*8 fx - call HYPRE_SStructFACGetFinalRelativ(fsolver, fnorm, ierr) + call HYPRE_SStructSplitSetup(fsolver, fA, fb, fx, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructfacgetfinalrelative error = ', ierr + print *, 'fhypre_sstructsplitsetup error = ', ierr endif return end - - - -!**************************************************************************** -! HYPRE_SStructPCG routines -!**************************************************************************** - !-------------------------------------------------------------------------- -! HYPRE_SStructPCGCreate +! HYPRE_SStructSplitSolve !-------------------------------------------------------------------------- - subroutine fhypre_sstructpcgcreate(fcomm, fsolver) + subroutine fhypre_sstructsplitsolve(fsolver, fA, fb, fx) integer ierr - integer*8 fcomm integer*8 fsolver + integer*8 fA + integer*8 fb + integer*8 fx - call HYPRE_SStructPCGCreate(fcomm, fsolver, ierr) + call HYPRE_SStructSplitSolve(fsolver, fA, fb, fx, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructpcgcreate error = ', ierr + print *, 'fhypre_sstructsplitsolve error = ', ierr endif return @@ -1088,17 +1092,18 @@ subroutine fhypre_sstructpcgcreate(fcomm, fsolver) !-------------------------------------------------------------------------- -! HYPRE_SStructPCGDestroy +! HYPRE_SStructSplitSetTol !-------------------------------------------------------------------------- - subroutine fhypre_sstructpcgdestroy(fsolver) + subroutine fhypre_sstructsplitsettol(fsolver, ftol) integer ierr integer*8 fsolver + double precision ftol - call HYPRE_SStructPCGDestroy(fsolver, ierr) + call HYPRE_SStructSplitSetTol(fsolver, ftol, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructpcgdestroy error = ', ierr + print *, 'fhypre_sstructsplitsettol error = ', ierr endif return @@ -1106,20 +1111,18 @@ subroutine fhypre_sstructpcgdestroy(fsolver) !-------------------------------------------------------------------------- -! HYPRE_SStructPCGSetup +! HYPRE_SStructSplitSetMaxIter !-------------------------------------------------------------------------- - subroutine fhypre_sstructpcgsetup(fsolver, fA, fb, fx) + subroutine fhypre_sstructsplitsetmaxiter(fsolver, fmax_iter) integer ierr + integer fmax_iter integer*8 fsolver - integer*8 fA - integer*8 fb - integer*8 fx - call HYPRE_SStructPCGSetup(fsolver, fA, fb, fx, ierr) + call HYPRE_SStructSplitSetMaxIter(fsolver, fmax_iter, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructpcgsetup error = ', ierr + print *, 'fhypre_sstructsplitsetmaxiter error = ', ierr endif return @@ -1127,20 +1130,17 @@ subroutine fhypre_sstructpcgsetup(fsolver, fA, fb, fx) !-------------------------------------------------------------------------- -! HYPRE_SStructPCGSolve +! HYPRE_SStructSplitSetZeroGuess !-------------------------------------------------------------------------- - subroutine fhypre_sstructpcgsolve(fsolver, fA, fb, fx) + subroutine fhypre_sstructsplitsetzeroguess(fsolver) integer ierr integer*8 fsolver - integer*8 fA - integer*8 fb - integer*8 fx - call HYPRE_SStructPCGSolve(fsolver, fA, fb, fx, ierr) + call HYPRE_SStructSplitSetZeroGuess(fsolver, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructpcgsolve error = ', ierr + print *, 'fhypre_sstructsplitsetzeroguess error = ', ierr endif return @@ -1148,18 +1148,17 @@ subroutine fhypre_sstructpcgsolve(fsolver, fA, fb, fx) !-------------------------------------------------------------------------- -! HYPRE_SStructPCGSetTol +! HYPRE_SStructSplitSetNonZeroGuess !-------------------------------------------------------------------------- - subroutine fhypre_sstructpcgsettol(fsolver, ftol) + subroutine fhypre_sstructsplitsetnonzerogu(fsolver) integer ierr integer*8 fsolver - double precision ftol - call HYPRE_SStructPCGSetTol(fsolver, ftol, ierr) + call HYPRE_SStructSplitSetNonZeroGue(fsolver, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructpcgsettol error = ', ierr + print *, 'fhypre_sstructsplitsetnonzeroguess error = ', ierr endif return @@ -1167,18 +1166,18 @@ subroutine fhypre_sstructpcgsettol(fsolver, ftol) !-------------------------------------------------------------------------- -! HYPRE_SStructPCGSetMaxIter +! HYPRE_SStructSplitSetStructSolver !-------------------------------------------------------------------------- - subroutine fhypre_sstructpcgsetmaxiter(fsolver, fmax_iter) + subroutine fhypre_sstructsplitsetstructsol(fsolver, fssolver) integer ierr - integer fmax_iter + integer fssolver integer*8 fsolver - call HYPRE_SStructPCGSetMaxIter(fsolver, fmax_iter, ierr) + call HYPRE_SStructSplitSetStructSolv(fsolver, fssolver, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructpcgsetmaxiter error = ', ierr + print *, 'fhypre_sstructsplitsetstructsolve error = ', ierr endif return @@ -1186,18 +1185,18 @@ subroutine fhypre_sstructpcgsetmaxiter(fsolver, fmax_iter) !-------------------------------------------------------------------------- -! HYPRE_SStructPCGSetTwoNorm +! HYPRE_SStructSplitGetNumIterations !-------------------------------------------------------------------------- - subroutine fhypre_sstructpcgsettwonorm(fsolver, ftwo_norm) + subroutine fhypre_sstructsplitgetnumiterat(fsolver, fnumiter) integer ierr - integer ftwo_norm + integer fnumiter integer*8 fsolver - call HYPRE_SStructPCGSetTwoNorm(fsolver, ftwo_norm, ierr) + call HYPRE_SStructSplitGetNumIterati(fsolver, fnumiter, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructpcgsettwonorm error = ', ierr + print *, 'fhypre_sstructsplitgetnumiteration error = ', ierr endif return @@ -1205,40 +1204,44 @@ subroutine fhypre_sstructpcgsettwonorm(fsolver, ftwo_norm) !-------------------------------------------------------------------------- -! HYPRE_SStructPCGSetRelChange +! HYPRE_SStructSplitGetFinalRelativeResidualNorm !-------------------------------------------------------------------------- - subroutine fhypre_sstructpcgsetrelchange(fsolver, frel_change) + subroutine fhypre_sstructsplitgetfinalrela(fsolver, fnorm) integer ierr - integer frel_change integer*8 fsolver + double precision fnorm - call HYPRE_SStructPCGSetRelChange(fsolver, frel_change, ierr) + call HYPRE_SStructSplitGetFinalRelat(fsolver, fnorm, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructpcgsetrelchange error = ', ierr + print *, 'fhypre_sstructsplitgetfinalrelative error = ', ierr endif return end + + + +!**************************************************************************** +! HYPRE_SStructSYSPFMG routines +!**************************************************************************** + !-------------------------------------------------------------------------- -! HYPRE_SStructPCGSetPrecond +! HYPRE_SStructSysPFMGCreate !-------------------------------------------------------------------------- - subroutine fhypre_sstructpcgsetprecond(fsolver, fprecond_id, - 1 fprecond) + subroutine fhypre_sstructsyspfmgcreate(fcomm, fsolver) integer ierr - integer fprecond_id + integer*8 fcomm integer*8 fsolver - integer*8 fprecond - call HYPRE_SStructPCGSetPrecond(fsolver, fprecond_id, fprecond, - 1 ierr) + call HYPRE_SStructSysPFMGCreate(fcomm, fsolver, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructpcgsetprecond error = ', ierr + print *, 'fhypre_sstructsyspfmgcreate error = ', ierr endif return @@ -1246,18 +1249,17 @@ subroutine fhypre_sstructpcgsetprecond(fsolver, fprecond_id, !-------------------------------------------------------------------------- -! HYPRE_SStructPCGSetLogging +! HYPRE_SStructSysPFMGDestroy !-------------------------------------------------------------------------- - subroutine fhypre_sstructpcgsetlogging(fsolver, flog) + subroutine fhypre_sstructsyspfmgdestroy(fsolver) integer ierr - integer flog integer*8 fsolver - call HYPRE_SStructPCGSetLogging(fsolver, flog, ierr) + call HYPRE_SStructSysPFMGDestroy(fsolver, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructpcgsetlogging error = ', ierr + print *, 'fhypre_sstructsyspfmgdestroy error = ', ierr endif return @@ -1265,18 +1267,20 @@ subroutine fhypre_sstructpcgsetlogging(fsolver, flog) !-------------------------------------------------------------------------- -! HYPRE_SStructPCGSetPrintLevel +! HYPRE_SStructSysPFMGSetup !-------------------------------------------------------------------------- - subroutine fhypre_sstructpcgsetprintlevel(fsolver, flevel) + subroutine fhypre_sstructsyspfmgsetup(fsolver, fA, fb, fx) integer ierr - integer flevel integer*8 fsolver + integer*8 fA + integer*8 fb + integer*8 fx - call HYPRE_SStructPCGSetPrintLevel(fsolver, flevel, ierr) + call HYPRE_SStructSysPFMGSetup(fsolver, fA, fb, fx, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructpcgsetprintlevel error = ', ierr + print *, 'fhypre_sstructsyspfmgsetup error = ', ierr endif return @@ -1284,18 +1288,20 @@ subroutine fhypre_sstructpcgsetprintlevel(fsolver, flevel) !-------------------------------------------------------------------------- -! HYPRE_SStructPCGGetNumIterations +! HYPRE_SStructSysPFMGSolve !-------------------------------------------------------------------------- - subroutine fhypre_sstructpcggetnumiteratio(fsolver, fnumiter) + subroutine fhypre_sstructsyspfmgsolve(fsolver, fA, fb, fx) integer ierr - integer fnumiter integer*8 fsolver + integer*8 fA + integer*8 fb + integer*8 fx - call HYPRE_SStructPCGGetNumIteration(fsolver, fnumiter, ierr) + call HYPRE_SStructSysPFMGSolve(fsolver, fA, fb, fx, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructpcggetnumiteration error = ', ierr + print *, 'fhypre_sstructsyspfmgsolve error = ', ierr endif return @@ -1303,37 +1309,18 @@ subroutine fhypre_sstructpcggetnumiteratio(fsolver, fnumiter) !-------------------------------------------------------------------------- -! HYPRE_SStructPCGGetFinalRelativeResidualNorm -!-------------------------------------------------------------------------- - subroutine fhypre_sstructpcggetfinalrelati(fsolver, fnorm) - - integer ierr - integer*8 fsolver - double precision fnorm - - call HYPRE_SStructPCGGetFinalRelativ(fsolver, fnorm, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructpcggetfinalrelative error = ', ierr - endif - - return - end - - -!-------------------------------------------------------------------------- -! HYPRE_SStructPCGGetResidual +! HYPRE_SStructSysPFMGSetTol !-------------------------------------------------------------------------- - subroutine fhypre_sstructpcggetresidual(fsolver, fresidual) + subroutine fhypre_sstructsyspfmgsettol(fsolver, ftol) integer ierr integer*8 fsolver - integer*8 fresidual + double precision ftol - call HYPRE_SStructPCGGetResidual(fsolver, fresidual, ierr) + call HYPRE_SStructSysPFMGSetTol(fsolver, ftol, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructpcggetresidual error = ', ierr + print *, 'fhypre_sstructsyspfmgsettol error = ', ierr endif return @@ -1341,20 +1328,18 @@ subroutine fhypre_sstructpcggetresidual(fsolver, fresidual) !-------------------------------------------------------------------------- -! HYPRE_SStructDiagScaleSetup +! HYPRE_SStructSysPFMGSetMaxIter !-------------------------------------------------------------------------- - subroutine fhypre_sstructdiagscalesetup(fsolver, fA, fy, fx) + subroutine fhypre_sstructsyspfmgsetmaxiter(fsolver, fmax_iter) integer ierr + integer fmax_iter integer*8 fsolver - integer*8 fA - integer*8 fy - integer*8 fx - call HYPRE_SStructDiagScaleSetup(fsolver, fA, fy, fx, ierr) + call HYPRE_SStructSysPFMGSetMaxIter(fsolver, fmax_iter, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructdiagscalesetup error = ', ierr + print *, 'fhypre_sstructsyspfmgsetmaxiter error = ', ierr endif return @@ -1362,46 +1347,36 @@ subroutine fhypre_sstructdiagscalesetup(fsolver, fA, fy, fx) !-------------------------------------------------------------------------- -! HYPRE_SStructDiagScale +! HYPRE_SStructSysPFMGSetRelChange !-------------------------------------------------------------------------- - subroutine fhypre_sstructdiagscale(fsolver, fA, fy, fx) + subroutine fhypre_sstructsyspfmgsetrelchang(fsolver, frel_change) integer ierr + integer frel_change integer*8 fsolver - integer*8 fA - integer*8 fy - integer*8 fx - call HYPRE_SStructDiagScale(fsolver, fA, fy, fx, ierr) + call HYPRE_SStructSysPFMGSetRelChang(fsolver, frel_change, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructdiagscale error = ', ierr + print *, 'fhypre_sstructsyspfmgsetrelchange error = ', ierr endif return end - - - -!**************************************************************************** -! HYPRE_SStructSplit routines -!**************************************************************************** - !-------------------------------------------------------------------------- -! HYPRE_SStructSplitCreate +! HYPRE_SStructSysPFMGSetZeroGuess !-------------------------------------------------------------------------- - subroutine fhypre_sstructsplitcreate(fcomm, fsolver) + subroutine fhypre_sstructsyspfmgsetzerogue(fsolver) integer ierr - integer*8 fcomm integer*8 fsolver - call HYPRE_SStructSplitCreate(fcomm, fsolver, ierr) + call HYPRE_SStructSysPFMGSetZeroGues(fsolver, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructsplitcreate error = ', ierr + print *, 'fhypre_sstructsyspfmgsetzeroguess error = ', ierr endif return @@ -1409,17 +1384,17 @@ subroutine fhypre_sstructsplitcreate(fcomm, fsolver) !-------------------------------------------------------------------------- -! HYPRE_SStructSplitDestroy +! HYPRE_SStructSysPFMGSetNonZeroGuess !-------------------------------------------------------------------------- - subroutine fhypre_sstructsplitdestroy(fsolver) + subroutine fhypre_sstructsyspfmgsetnonzero(fsolver) integer ierr integer*8 fsolver - call HYPRE_SStructSplitDestroy(fsolver, ierr) + call HYPRE_SStructSysPFMGSetNonZeroG(fsolver, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructsplitdestroy error = ', ierr + print *, 'fhypre_sstructsyspfmgsetnonzeroguess error = ', ierr endif return @@ -1427,20 +1402,18 @@ subroutine fhypre_sstructsplitdestroy(fsolver) !-------------------------------------------------------------------------- -! HYPRE_SStructSplitSetup +! HYPRE_SStructSysPFMGSetRelaxType !-------------------------------------------------------------------------- - subroutine fhypre_sstructsplitsetup(fsolver, fA, fb, fx) + subroutine fhypre_sstructsyspfmgsetrelaxty(fsolver, frelax_type) integer ierr + integer frelax_type integer*8 fsolver - integer*8 fA - integer*8 fb - integer*8 fx - call HYPRE_SStructSplitSetup(fsolver, fA, fb, fx, ierr) + call HYPRE_SStructSysPFMGSetRelaxTyp(fsolver, frelax_type, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructsplitsetup error = ', ierr + print *, 'fhypre_sstructsyspfmgsetrelaxtype error = ', ierr endif return @@ -1448,20 +1421,20 @@ subroutine fhypre_sstructsplitsetup(fsolver, fA, fb, fx) !-------------------------------------------------------------------------- -! HYPRE_SStructSplitSolve +! HYPRE_SStructSysPFMGSetNumPreRelax !-------------------------------------------------------------------------- - subroutine fhypre_sstructsplitsolve(fsolver, fA, fb, fx) + subroutine fhypre_sstructsyspfmgsetnumprer(fsolver, + 1 fnum_pre_relax) integer ierr + integer fnum_pre_relax integer*8 fsolver - integer*8 fA - integer*8 fb - integer*8 fx - call HYPRE_SStructSplitSolve(fsolver, fA, fb, fx, ierr) + call HYPRE_SStructSysPFMGSetNumPreRe(fsolver, fnum_pre_relax, + 1 ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructsplitsolve error = ', ierr + print *, 'fhypre_sstructsyspfmgsetnumprerelax error = ', ierr endif return @@ -1469,18 +1442,20 @@ subroutine fhypre_sstructsplitsolve(fsolver, fA, fb, fx) !-------------------------------------------------------------------------- -! HYPRE_SStructSplitSetTol +! HYPRE_SStructSysPFMGSetNumPostRelax !-------------------------------------------------------------------------- - subroutine fhypre_sstructsplitsettol(fsolver, ftol) + subroutine fhypre_sstructsyspfmgsetnumpost(fsolver, + 1 fnum_post_relax) integer ierr + integer fnum_post_relax integer*8 fsolver - double precision ftol - call HYPRE_SStructSplitSetTol(fsolver, ftol, ierr) + call HYPRE_SStructSysPFMGSetNumPostR(fsolver, fnum_post_relax, + 1 ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructsplitsettol error = ', ierr + print *, 'fhypre_sstructsyspfmgsetnumpostrelax error = ', ierr endif return @@ -1488,18 +1463,18 @@ subroutine fhypre_sstructsplitsettol(fsolver, ftol) !-------------------------------------------------------------------------- -! HYPRE_SStructSplitSetMaxIter +! HYPRE_SStructSysPFMGSetSkipRelax !-------------------------------------------------------------------------- - subroutine fhypre_sstructsplitsetmaxiter(fsolver, fmax_iter) + subroutine fhypre_sstructsyspfmgsetskiprel(fsolver, fskip_relax) integer ierr - integer fmax_iter + integer fskip_relax integer*8 fsolver - call HYPRE_SStructSplitSetMaxIter(fsolver, fmax_iter, ierr) + call HYPRE_SStructSysPFMGSetSkipRela(fsolver, fskip_relax, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructsplitsetmaxiter error = ', ierr + print *, 'fhypre_sstructsyspfmgsetskiprelax error = ', ierr endif return @@ -1507,17 +1482,18 @@ subroutine fhypre_sstructsplitsetmaxiter(fsolver, fmax_iter) !-------------------------------------------------------------------------- -! HYPRE_SStructSplitSetZeroGuess +! HYPRE_SStructSysPFMGSetDxyz !-------------------------------------------------------------------------- - subroutine fhypre_sstructsplitsetzeroguess(fsolver) + subroutine fhypre_sstructsyspfmgsetdxyz(fsolver, fdxyz) integer ierr integer*8 fsolver + double precision fdxyz - call HYPRE_SStructSplitSetZeroGuess(fsolver, ierr) + call HYPRE_SStructSysPFMGSetDxyz(fsolver, fdxyz, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructsplitsetzeroguess error = ', ierr + print *, 'fhypre_sstructsyspfmgsetdxyz error = ', ierr endif return @@ -1525,17 +1501,18 @@ subroutine fhypre_sstructsplitsetzeroguess(fsolver) !-------------------------------------------------------------------------- -! HYPRE_SStructSplitSetNonZeroGuess +! HYPRE_SStructSysPFMGSetLogging !-------------------------------------------------------------------------- - subroutine fhypre_sstructsplitsetnonzerogu(fsolver) + subroutine fhypre_sstructsyspfmgsetlogging(fsolver, flog) integer ierr + integer flog integer*8 fsolver - call HYPRE_SStructSplitSetNonZeroGue(fsolver, ierr) + call HYPRE_SStructSysPFMGSetLogging(fsolver, flog, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructsplitsetnonzeroguess error = ', ierr + print *, 'fhypre_sstructsyspfmgsetlogging error = ', ierr endif return @@ -1543,18 +1520,19 @@ subroutine fhypre_sstructsplitsetnonzerogu(fsolver) !-------------------------------------------------------------------------- -! HYPRE_SStructSplitSetStructSolver +! HYPRE_SStructSysPFMGSetPrintLevel !-------------------------------------------------------------------------- - subroutine fhypre_sstructsplitsetstructsol(fsolver, fssolver) + subroutine fhypre_sstructsyspfmgsetprintle(fsolver, fprint_level) integer ierr - integer fssolver + integer fprint_level integer*8 fsolver - call HYPRE_SStructSplitSetStructSolv(fsolver, fssolver, ierr) + call HYPRE_SStructSysPFMGSetPrintLev(fsolver, fprint_level, + 1 ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructsplitsetstructsolve error = ', ierr + print *, 'fhypre_sstructsyspfmgsetprintlevel error = ', ierr endif return @@ -1562,18 +1540,18 @@ subroutine fhypre_sstructsplitsetstructsol(fsolver, fssolver) !-------------------------------------------------------------------------- -! HYPRE_SStructSplitGetNumIterations +! HYPRE_SStructSysPFMGGetNumIterations !-------------------------------------------------------------------------- - subroutine fhypre_sstructsplitgetnumiterat(fsolver, fnumiter) + subroutine fhypre_sstructsyspfmggetnumiter(fsolver, fnumiter) integer ierr integer fnumiter integer*8 fsolver - call HYPRE_SStructSplitGetNumIterati(fsolver, fnumiter, ierr) + call HYPRE_SStructSysPFMGGetNumItera(fsolver, fnumiter, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructsplitgetnumiteration error = ', ierr + print *, 'fhypre_sstructsyspfmggetnumiteration error = ', ierr endif return @@ -1581,823 +1559,18 @@ subroutine fhypre_sstructsplitgetnumiterat(fsolver, fnumiter) !-------------------------------------------------------------------------- -! HYPRE_SStructSplitGetFinalRelativeResidualNorm +! HYPRE_SStructSysPFMGGetFinalRelativeResidualNorm !-------------------------------------------------------------------------- - subroutine fhypre_sstructsplitgetfinalrela(fsolver, fnorm) + subroutine fhypre_sstructsyspfmggetfinalre(fsolver, fnorm) integer ierr integer*8 fsolver double precision fnorm - call HYPRE_SStructSplitGetFinalRelat(fsolver, fnorm, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructsplitgetfinalrelative error = ', ierr - endif - - return - end - - - - - -!**************************************************************************** -! HYPRE_SStructSYSPFMG routines -!**************************************************************************** - -!-------------------------------------------------------------------------- -! HYPRE_SStructSysPFMGCreate -!-------------------------------------------------------------------------- - subroutine fhypre_sstructsyspfmgcreate(fcomm, fsolver) - - integer ierr - integer*8 fcomm - integer*8 fsolver - - call HYPRE_SStructSysPFMGCreate(fcomm, fsolver, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructsyspfmgcreate error = ', ierr - endif - - return - end - - -!-------------------------------------------------------------------------- -! HYPRE_SStructSysPFMGDestroy -!-------------------------------------------------------------------------- - subroutine fhypre_sstructsyspfmgdestroy(fsolver) - - integer ierr - integer*8 fsolver - - call HYPRE_SStructSysPFMGDestroy(fsolver, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructsyspfmgdestroy error = ', ierr - endif - - return - end - - -!-------------------------------------------------------------------------- -! HYPRE_SStructSysPFMGSetup -!-------------------------------------------------------------------------- - subroutine fhypre_sstructsyspfmgsetup(fsolver, fA, fb, fx) - - integer ierr - integer*8 fsolver - integer*8 fA - integer*8 fb - integer*8 fx - - call HYPRE_SStructSysPFMGSetup(fsolver, fA, fb, fx, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructsyspfmgsetup error = ', ierr - endif - - return - end - - -!-------------------------------------------------------------------------- -! HYPRE_SStructSysPFMGSolve -!-------------------------------------------------------------------------- - subroutine fhypre_sstructsyspfmgsolve(fsolver, fA, fb, fx) - - integer ierr - integer*8 fsolver - integer*8 fA - integer*8 fb - integer*8 fx - - call HYPRE_SStructSysPFMGSolve(fsolver, fA, fb, fx, ierr) + call HYPRE_SStructSysPFMGGetFinalRel(fsolver, fnorm, ierr) if(ierr .ne. 0) then - print *, 'fhypre_sstructsyspfmgsolve error = ', ierr - endif - - return - end - - -!-------------------------------------------------------------------------- -! HYPRE_SStructSysPFMGSetTol -!-------------------------------------------------------------------------- - subroutine fhypre_sstructsyspfmgsettol(fsolver, ftol) - - integer ierr - integer*8 fsolver - double precision ftol - - call HYPRE_SStructSysPFMGSetTol(fsolver, ftol, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructsyspfmgsettol error = ', ierr - endif - - return - end - - -!-------------------------------------------------------------------------- -! HYPRE_SStructSysPFMGSetMaxIter -!-------------------------------------------------------------------------- - subroutine fhypre_sstructsyspfmgsetmaxiter(fsolver, fmax_iter) - - integer ierr - integer fmax_iter - integer*8 fsolver - - call HYPRE_SStructSysPFMGSetMaxIter(fsolver, fmax_iter, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructsyspfmgsetmaxiter error = ', ierr - endif - - return - end - - -!-------------------------------------------------------------------------- -! HYPRE_SStructSysPFMGSetRelChange -!-------------------------------------------------------------------------- - subroutine fhypre_sstructsyspfmgsetrelchang(fsolver, frel_change) - - integer ierr - integer frel_change - integer*8 fsolver - - call HYPRE_SStructSysPFMGSetRelChang(fsolver, frel_change, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructsyspfmgsetrelchange error = ', ierr - endif - - return - end - - -!-------------------------------------------------------------------------- -! HYPRE_SStructSysPFMGSetZeroGuess -!-------------------------------------------------------------------------- - subroutine fhypre_sstructsyspfmgsetzerogue(fsolver) - - integer ierr - integer*8 fsolver - - call HYPRE_SStructSysPFMGSetZeroGues(fsolver, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructsyspfmgsetzeroguess error = ', ierr - endif - - return - end - - -!-------------------------------------------------------------------------- -! HYPRE_SStructSysPFMGSetNonZeroGuess -!-------------------------------------------------------------------------- - subroutine fhypre_sstructsyspfmgsetnonzero(fsolver) - - integer ierr - integer*8 fsolver - - call HYPRE_SStructSysPFMGSetNonZeroG(fsolver, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructsyspfmgsetnonzeroguess error = ', ierr - endif - - return - end - - -!-------------------------------------------------------------------------- -! HYPRE_SStructSysPFMGSetRelaxType -!-------------------------------------------------------------------------- - subroutine fhypre_sstructsyspfmgsetrelaxty(fsolver, frelax_type) - - integer ierr - integer frelax_type - integer*8 fsolver - - call HYPRE_SStructSysPFMGSetRelaxTyp(fsolver, frelax_type, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructsyspfmgsetrelaxtype error = ', ierr - endif - - return - end - - -!-------------------------------------------------------------------------- -! HYPRE_SStructSysPFMGSetNumPreRelax -!-------------------------------------------------------------------------- - subroutine fhypre_sstructsyspfmgsetnumprer(fsolver, - 1 fnum_pre_relax) - - integer ierr - integer fnum_pre_relax - integer*8 fsolver - - call HYPRE_SStructSysPFMGSetNumPreRe(fsolver, fnum_pre_relax, - 1 ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructsyspfmgsetnumprerelax error = ', ierr - endif - - return - end - - -!-------------------------------------------------------------------------- -! HYPRE_SStructSysPFMGSetNumPostRelax -!-------------------------------------------------------------------------- - subroutine fhypre_sstructsyspfmgsetnumpost(fsolver, - 1 fnum_post_relax) - - integer ierr - integer fnum_post_relax - integer*8 fsolver - - call HYPRE_SStructSysPFMGSetNumPostR(fsolver, fnum_post_relax, - 1 ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructsyspfmgsetnumpostrelax error = ', ierr - endif - - return - end - - -!-------------------------------------------------------------------------- -! HYPRE_SStructSysPFMGSetSkipRelax -!-------------------------------------------------------------------------- - subroutine fhypre_sstructsyspfmgsetskiprel(fsolver, fskip_relax) - - integer ierr - integer fskip_relax - integer*8 fsolver - - call HYPRE_SStructSysPFMGSetSkipRela(fsolver, fskip_relax, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructsyspfmgsetskiprelax error = ', ierr - endif - - return - end - - -!-------------------------------------------------------------------------- -! HYPRE_SStructSysPFMGSetDxyz -!-------------------------------------------------------------------------- - subroutine fhypre_sstructsyspfmgsetdxyz(fsolver, fdxyz) - - integer ierr - integer*8 fsolver - double precision fdxyz - - call HYPRE_SStructSysPFMGSetDxyz(fsolver, fdxyz, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructsyspfmgsetdxyz error = ', ierr - endif - - return - end - - -!-------------------------------------------------------------------------- -! HYPRE_SStructSysPFMGSetLogging -!-------------------------------------------------------------------------- - subroutine fhypre_sstructsyspfmgsetlogging(fsolver, flog) - - integer ierr - integer flog - integer*8 fsolver - - call HYPRE_SStructSysPFMGSetLogging(fsolver, flog, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructsyspfmgsetlogging error = ', ierr - endif - - return - end - - -!-------------------------------------------------------------------------- -! HYPRE_SStructSysPFMGSetPrintLevel -!-------------------------------------------------------------------------- - subroutine fhypre_sstructsyspfmgsetprintle(fsolver, fprint_level) - - integer ierr - integer fprint_level - integer*8 fsolver - - call HYPRE_SStructSysPFMGSetPrintLev(fsolver, fprint_level, - 1 ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructsyspfmgsetprintlevel error = ', ierr - endif - - return - end - - -!-------------------------------------------------------------------------- -! HYPRE_SStructSysPFMGGetNumIterations -!-------------------------------------------------------------------------- - subroutine fhypre_sstructsyspfmggetnumiter(fsolver, fnumiter) - - integer ierr - integer fnumiter - integer*8 fsolver - - call HYPRE_SStructSysPFMGGetNumItera(fsolver, fnumiter, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructsyspfmggetnumiteration error = ', ierr - endif - - return - end - - -!-------------------------------------------------------------------------- -! HYPRE_SStructSysPFMGGetFinalRelativeResidualNorm -!-------------------------------------------------------------------------- - subroutine fhypre_sstructsyspfmggetfinalre(fsolver, fnorm) - - integer ierr - integer*8 fsolver - double precision fnorm - - call HYPRE_SStructSysPFMGGetFinalRel(fsolver, fnorm, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructsyspfmggetfinalrelative error = ', ierr - endif - - return - end - - -!***************************************************************************** -!* -!* HYPRE_SStructMaxwell interface -!* -!***************************************************************************** - -!*-------------------------------------------------------------------------- -!* HYPRE_SStructMaxwellCreate -!*-------------------------------------------------------------------------- - subroutine fhypre_sstructmaxwellcreate(fcomm, fsolver) - - integer ierr - integer*8 fcomm - integer*8 fsolver - - call HYPRE_SStructMaxwellCreate(fcomm, fsolver, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructmaxwellcreate = ', ierr - endif - - return - end - - -!*-------------------------------------------------------------------------- -!* HYPRE_SStructMaxwellDestroy -!*-------------------------------------------------------------------------- - subroutine fhypre_sstructmaxwelldestroy(fsolver) - - integer ierr - integer*8 fsolver - - call HYPRE_SStructMaxwellDestroy(fsolver, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructmaxwelldestroy = ', ierr - endif - - return - end - - -!*-------------------------------------------------------------------------- -!* HYPRE_SStructMaxwellSetup -!*-------------------------------------------------------------------------- - subroutine fhypre_sstructmaxwellsetup (fsolver, fA, fb, fx) - - integer ierr - integer*8 fsolver - integer*8 fA - integer*8 fb - integer*8 fx - - call HYPRE_SStructMaxwellSetup(fsolver, fA, fb, fx, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructmaxwellsetup = ', ierr - endif - - return - end - - -!*-------------------------------------------------------------------------- -!* HYPRE_SStructMaxwellSolve -!*-------------------------------------------------------------------------- - subroutine fhypre_sstructmaxwellsolve (fsolver, fA, fb, fx) - - integer ierr - integer*8 fsolver - integer*8 fA - integer*8 fb - integer*8 fx - - call HYPRE_SStructMaxwellSolve(fsolver, fA, fb, fx, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructmaxwellsolve = ', ierr - endif - - return - end - - -!*-------------------------------------------------------------------------- -!* HYPRE_SStructMaxwellSolve2 -!*-------------------------------------------------------------------------- - subroutine fhypre_sstructmaxwellsolve2(fsolver, fA, fb, fx) - - integer ierr - integer*8 fsolver - integer*8 fA - integer*8 fb - integer*8 fx - - call HYPRE_SStructMaxwellSolve2(fsolver, fA, fb, fx, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructmaxwellsolve2 = ', ierr - endif - - return - end - - -!*-------------------------------------------------------------------------- -!* HYPRE_MaxwellGrad -!*-------------------------------------------------------------------------- - subroutine fhypre_maxwellgrad (fgrid, fT) - - integer ierr - integer*8 fgrid - integer*8 fT - - call HYPRE_MaxwellGrad(fgrid, fT, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructmaxwellgrad = ', ierr - endif - - return - end - - -!*-------------------------------------------------------------------------- -!* HYPRE_SStructMaxwellSetGrad -!*-------------------------------------------------------------------------- - subroutine fhypre_sstructmaxwellsetgrad (fsolver, fT) - - integer ierr - integer*8 fsolver - integer*8 fT - - call HYPRE_SStructMaxwellSetGrad(fsolver, fT, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructmaxwellsetgrad = ', ierr - endif - - return - end - - -!*-------------------------------------------------------------------------- -!* HYPRE_SStructMaxwellSetRfactors -!*-------------------------------------------------------------------------- - subroutine fhypre_sstructmaxwellsetrfactor (fsolver,frfactors) - - integer ierr - integer*8 fsolver - integer*8 frfactors(3) - - call HYPRE_SStructMaxwellSetRfactors(fsolver, frfactors, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructmaxwellsetrfactors = ', ierr - endif - - return - end - - -!*-------------------------------------------------------------------------- -!* HYPRE_SStructMaxwellSetTol -!*-------------------------------------------------------------------------- - subroutine fhypre_sstructmaxwellsettol (fsolver, ftol) - - integer ierr - integer*8 fsolver - double precision ftol - - call HYPRE_SStructMaxwellSetTol(fsolver, ftol, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructmaxwellsettol = ', ierr - endif - - return - end - - -!*-------------------------------------------------------------------------- -!* HYPRE_SStructMaxwellSetConstantCoef -!*-------------------------------------------------------------------------- - subroutine fhypre_sstructmaxwellsetconstan (fsolver, - 1 fconstant_coef) - - integer ierr - integer*8 fsolver - integer fconstant_coef - - call HYPRE_SStructMaxwellSetConstant(fsolver, fconstant_coef, - 1 ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructmaxwellsetconstantcoef = ', ierr - endif - - return - end - - -!*-------------------------------------------------------------------------- -!* HYPRE_SStructMaxwellSetMaxIter -!*-------------------------------------------------------------------------- - subroutine fhypre_sstructmaxwellsetmaxiter (fsolver, fmax_iter) - - integer ierr - integer*8 fsolver - integer fmax_iter - - call HYPRE_SStructMaxwellSetMaxIter(fsolver, fmax_iter, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructmaxwellsetmaxiter = ', ierr - endif - - return - end - - -!*-------------------------------------------------------------------------- -!* HYPRE_SStructMaxwellSetRelChange -!*-------------------------------------------------------------------------- - subroutine fhypre_sstructmaxwellsetrelchan (fsolver, frel_change) - - integer ierr - integer*8 fsolver - integer frel_change - - call HYPRE_SStructMaxwellSetRelChang(fsolver, frel_change, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructmaxwellsetrelchange = ', ierr - endif - - return - end - - -!*-------------------------------------------------------------------------- -!* HYPRE_SStructMaxwellSetNumPreRelax -!*-------------------------------------------------------------------------- - subroutine fhypre_sstructmaxwellsetnumprer (fsolver, - 1 fnum_pre_relax) - - integer ierr - integer*8 fsolver - integer fnum_pre_relax - - call HYPRE_SStructMaxwellSetNumPreRe(fsolver, fnum_pre_relax, - 1 ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructmaxwellsetnumprerelax = ', ierr - endif - - return - end - - -!*-------------------------------------------------------------------------- -!* HYPRE_SStructMaxwellSetNumPostRelax -!*-------------------------------------------------------------------------- - subroutine fhypre_sstructmaxwellsetnumpost (fsolver, - 1 fnum_post_relax) - - integer ierr - integer*8 fsolver - integer fnum_post_relax - - call HYPRE_SStructMaxwellSetNumPostR(fsolver, fnum_post_relax, - 1 ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructmaxwellsetnumpostrelax = ', ierr - endif - - return - end - - -!*-------------------------------------------------------------------------- -!* HYPRE_SStructMaxwellSetLogging -!*-------------------------------------------------------------------------- - subroutine fhypre_sstructmaxwellsetlogging (fsolver, flogging) - - integer ierr - integer*8 fsolver - integer flogging - - call HYPRE_SStructMaxwellSetLogging(fsolver, flogging, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructmaxwellsetlogging = ', ierr - endif - - return - end - - -!*-------------------------------------------------------------------------- -!* HYPRE_SStructMaxwellSetPrintLevel -!*-------------------------------------------------------------------------- - subroutine fhypre_sstructmaxwellsetprintle (fsolver, fprint_level) - - integer ierr - integer*8 fsolver - integer flogging - - call HYPRE_SStructMaxwellSetPrintLev(fsolver, fprint_level, - 1 ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructmaxwellsetprintlevel = ', ierr - endif - - return - end - - -!*-------------------------------------------------------------------------- -!* HYPRE_SStructMaxwellPrintLogging -!*-------------------------------------------------------------------------- - subroutine fhypre_sstructmaxwellprintloggi (fsolver, fmyid) - - integer ierr - integer*8 fsolver - integer flogging - - call HYPRE_SStructMaxwellPrintLoggin(fsolver, fmyid, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructmaxwellprintlogging = ', ierr - endif - - return - end - - -!*-------------------------------------------------------------------------- -!* HYPRE_SStructMaxwellGetNumIterations -!*-------------------------------------------------------------------------- - subroutine fhypre_sstructmaxwellgetnumiter (fsolver, - 1 fnum_iterations) - - integer ierr - integer*8 fsolver - integer fnum_iterations - - call HYPRE_SStructMaxwellGetNumItera(fsolver, - 1 fnum_iterations, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructmaxwellgetnumiterations = ', ierr - endif - - return - end - - -!*-------------------------------------------------------------------------- -!* HYPRE_SStructMaxwellGetFinalRelativeResidualNorm -!*-------------------------------------------------------------------------- - subroutine fhypre_sstructmaxwellgetfinalre (fsolver, fnorm) - - integer ierr - integer*8 fsolver - double precision fnorm - - call HYPRE_SStructMaxwellGetFinalRel(fsolver, fnorm, ierr) - - if(ierr .ne. 0) then - print *, - 1 'fhypre_sstructmaxwellgetfinalrelativeresidualnorm = ', ierr - endif - - return - end - - -!*-------------------------------------------------------------------------- -!* HYPRE_SStructMaxwellPhysBdy -!*-------------------------------------------------------------------------- - subroutine fhypre_sstructmaxwellphysbdy (fgrid_l, fnum_levels, - 1 frfactors, - 2 fBdryRanks_ptr, - 3 fBdryRanksCnt_ptr) - - integer ierr - integer*8 fgrid_l - integer*8 frfactors - integer*8 fBdryRanks_ptr - integer*8 fBdryRanksCnt_ptr - integer fnum_levels - - call HYPRE_SStructMaxwellPhysBdy(fgrid_l, fnum_levels, frfactors, - 1 fBdryRanks_ptr, - 2 fBdryRanksCnt_ptr, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructmaxwellphysbdy = ', ierr - endif - - return - end - - -!*-------------------------------------------------------------------------- -!* HYPRE_SStructMaxwellEliminateRowsCols -!*-------------------------------------------------------------------------- - subroutine fhypre_sstructmaxwelleliminater (fparA, fnrows, frows) - - integer ierr - integer*8 fparA - integer*8 frows - integer*8 fnrows - - call HYPRE_SStructMaxwellEliminateRo(fparA, fnrows, frows, - 1 ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructmaxwelleliminaterows = ', ierr - endif - - return - end - - -!*-------------------------------------------------------------------------- -!* HYPRE_SStructMaxwellZeroVector -!*-------------------------------------------------------------------------- - subroutine fhypre_sstructmaxwellzerovector (fb, frows, fnrows) - - integer ierr - integer*8 fb - integer*8 frows - integer*8 fnrows - - call HYPRE_SStructMaxwellZeroVector(fb, frows, fnrows, ierr) - - if(ierr .ne. 0) then - print *, 'fhypre_sstructmaxwellzerovector = ', ierr + print *, 'fhypre_sstructsyspfmggetfinalrelative error = ', ierr endif return diff --git a/src/test/fstruct_ls.f b/src/test/fstruct_ls.f index 183748ea8a..d65c9ed16e 100644 --- a/src/test/fstruct_ls.f +++ b/src/test/fstruct_ls.f @@ -775,23 +775,6 @@ subroutine fhypre_structvectorsetrandomvalu(fvector, fseed) end -!*********************************************************************** -! fhypre_structsetrandomvalues -!*********************************************************************** - subroutine fhypre_structsetrandomvalues(fvector, fseed) - integer ierr - integer fseed - integer*8 fvector - - call hypre_StructSetRandomValues(fvector, fseed, ierr) - if (ierr .ne. 0) then - print *, 'fhypre_structsetrandomvalues: err = ', ierr - endif - - return - end - - !*********************************************************************** ! fhypre_structsetupinterpreter !*********************************************************************** @@ -2230,299 +2213,3 @@ subroutine fhypre_structsmggetprintlevel(fsolver, fprintlevel) return end - - - - -!*********************************************************************** -! HYPRE_StructSparseMSG routines -!*********************************************************************** - -!*********************************************************************** -! fhypre_structsparsemsgcreate -!*********************************************************************** - subroutine fhypre_structsparsemsgcreate(fcomm, fsolver) - integer ierr - integer fcomm - integer*8 fsolver - - call HYPRE_StructSparseMSGCreate(fcomm, fsolver, ierr) - if (ierr .ne. 0) then - print *, 'fhypre_structsparsemsgcreate: err = ', ierr - endif - - return - end - -!*********************************************************************** -! fhypre_structsparsemsgdestroy -!*********************************************************************** - subroutine fhypre_structsparsemsgdestroy(fsolver) - integer ierr - integer*8 fsolver - - call HYPRE_StructSparseMSGDestroy(fsolver, ierr) - if (ierr .ne. 0) then - print *, 'fhypre_structsparsemsgdestroy: err = ', ierr - endif - - return - end - -!*********************************************************************** -! fhypre_structsparsemsgsetup -!*********************************************************************** - subroutine fhypre_structsparsemsgsetup(fsolver, fA, fb, fx) - integer ierr - integer*8 fsolver - integer*8 fA - integer*8 fb - integer*8 fx - - call HYPRE_StructSparseMSGSetup(fsolver, fA, fb, fx, ierr) - if (ierr .ne. 0) then - print *, 'fhypre_structsparsemsgsetup: err = ', ierr - endif - - return - end - -!*********************************************************************** -! fhypre_structsparsemsgsolve -!*********************************************************************** - subroutine fhypre_structsparsemsgsolve(fsolver, fA, fb, fx) - integer ierr - integer*8 fsolver - integer*8 fA - integer*8 fb - integer*8 fx - - call HYPRE_StructSparseMSGSolve(fsolver, fA, fb, fx, ierr) - if (ierr .ne. 0) then - print *, 'fhypre_structsparsemsgsolve: err = ', ierr - endif - - return - end - -!*********************************************************************** -! fhypre_structsparsemsgsetjump -!*********************************************************************** - subroutine fhypre_structsparsemsgsetjump(fsolver, fjump) - integer ierr - integer fjump - integer*8 fsolver - - call HYPRE_StructSparseMSGSetJump(fsolver, fjump, ierr) - if (ierr .ne. 0) then - print *, 'fhypre_structsparsemsgsetjump: err = ', ierr - endif - - return - end - -!*********************************************************************** -! fhypre_structsparsemsgsettol -!*********************************************************************** - subroutine fhypre_structsparsemsgsettol(fsolver, ftol) - integer ierr - integer*8 fsolver - double precision ftol - - call HYPRE_StructSparseMSGSetTol(fsolver, ftol, ierr) - if (ierr .ne. 0) then - print *, 'fhypre_structsparsemsgsettol: err = ', ierr - endif - - return - end - -!*********************************************************************** -! fhypre_structsparsemsgsetmaxiter -!*********************************************************************** - subroutine fhypre_structsparsemsgsetmaxite(fsolver, fmaxiter) - integer ierr - integer fmaxiter - integer*8 fsolver - - call HYPRE_StructSparseMSGSetMaxIter(fsolver, fmaxiter, ierr) - if (ierr .ne. 0) then - print *, 'fhypre_structsparsemsgsetmaxite: err = ', ierr - endif - - return - end - -!*********************************************************************** -! fhypre_structsparsemsgsetrelchange -!*********************************************************************** - subroutine fhypre_structsparsemsgsetrelcha(fsolver, frelchange) - integer ierr - integer frelchange - integer*8 fsolver - - call HYPRE_StructSparseMSGSetRelChan(fsolver, frelchange, ierr) - if (ierr .ne. 0) then - print *, 'fhypre_structsparsemsgsetrelcha: err = ', ierr - endif - - return - end - -!*********************************************************************** -! fhypre_structsparsemsgsetzeroguess -!*********************************************************************** - subroutine fhypre_structsparsemsgsetzerogu(fsolver) - integer ierr - integer*8 fsolver - - call HYPRE_StructSparseMSGSetZeroGue(fsolver, ierr) - if (ierr .ne. 0) then - print *, 'fhypre_structsparsemsgsetzerogu: err = ', ierr - endif - - return - end - -!*********************************************************************** -! fhypre_structsparsemsgsetnonzeroguess -!*********************************************************************** - subroutine fhypre_structsparsemsgsetnonzer(fsolver) - integer ierr - integer*8 fsolver - - call HYPRE_StructSparseMSGSetNonZero(fsolver, ierr) - if (ierr .ne. 0) then - print *, 'fhypre_structsparsemsgsetnonzer: err = ', ierr - endif - - return - end - -!*********************************************************************** -! fhypre_structsparsemsggetnumiterations -!*********************************************************************** - subroutine fhypre_structsparsemsggetnumite(fsolver, fniters) - integer ierr - integer fniters - integer*8 fsolver - - call HYPRE_StructSparseMSGGetNumIter(fsolver, fniters, ierr) - if (ierr .ne. 0) then - print *, 'fhypre_structsparsemsggetnumite: err = ', ierr - endif - - return - end - -!*********************************************************************** -! fhypre_structsparsemsggetfinalrelativeresidualnorm -!*********************************************************************** - subroutine fhypre_structsparsemsggetfinalr(fsolver, fnorm) - integer ierr - integer*8 fsolver - double precision fnorm - - call HYPRE_StructSparseMSGGetFinalRe(fsolver, fnorm, ierr) - if (ierr .ne. 0) then - print *, 'fhypre_structsparsemsggetfinalr: err = ', ierr - endif - - return - end - -!*********************************************************************** -! fhypre_structsparsemsgsetrelaxtype -!*********************************************************************** - subroutine fhypre_structsparsemsgsetrelaxt(fsolver, frelaxtype) - integer ierr - integer frelaxtype - integer*8 fsolver - - call HYPRE_StructSparseMSGSetRelaxTy(fsolver, frelaxtype, ierr) - if (ierr .ne. 0) then - print *, 'fhypre_structsparsemsgsetrelaxt: err = ', ierr - endif - - return - end - -!*********************************************************************** -! fhypre_structsparsemsgsetnumprerelax -!*********************************************************************** - subroutine fhypre_structsparsemsgsetnumpre(fsolver, fnprelax) - integer ierr - integer fnprelax - integer*8 fsolver - - call HYPRE_StructSparseMSGSetNumPreR(fsolver, fnprelax, ierr) - if (ierr .ne. 0) then - print *, 'fhypre_structsparsemsgsetnumpre: err = ', ierr - endif - - return - end - -!*********************************************************************** -! fhypre_structsparsemsgsetnumpostrelax -!*********************************************************************** - subroutine fhypre_structsparsemsgsetnumpos(fsolver, fnpstrlx) - integer ierr - integer fnpstrlx - integer*8 fsolver - - call HYPRE_StructSparseMSGSetNumPost(fsolver, fnpstrlx, ierr) - if (ierr .ne. 0) then - print *, 'fhypre_structsparsemsgsetnumpos: err = ', ierr - endif - - return - end - -!*********************************************************************** -! fhypre_structsparsemsgsetnumfinerelax -!*********************************************************************** - subroutine fhypre_structsparsemsgsetnumfin(fsolver, fnfine) - integer ierr - integer fnfine - integer*8 fsolver - - call HYPRE_StructSparseMSGSetNumFine(fsolver, fnfine, ierr) - if (ierr .ne. 0) then - print *, 'fhypre_structsparsemsgsetnumfin: err = ', ierr - endif - - return - end - -!*********************************************************************** -! fhypre_structsparsemsgsetlogging -!*********************************************************************** - subroutine fhypre_structsparsemsgsetloggin(fsolver, flogging) - integer ierr - integer flogging - integer*8 fsolver - - call HYPRE_StructSparseMSGSetLogging(fsolver, flogging, ierr) - if (ierr .ne. 0) then - print *, 'fhypre_structsparsemsgsetloggin: err = ', ierr - endif - - return - end - -!*********************************************************************** -! fhypre_structsparsemsgsetprintlevel -!*********************************************************************** - subroutine fhypre_structsparsemsgsetprintl(fsolver, fprntlvl) - integer ierr - integer fprntlvl - integer*8 fsolver - - call HYPRE_StructSparseMSGSetPrintLe(fsolver, fprntlvl, ierr) - if (ierr .ne. 0) then - print *, 'fhypre_structsparsemsgsetprintl: err = ', ierr - endif - - return - end diff --git a/src/test/fstruct_mv.f b/src/test/fstruct_mv.f index 6e71fe3438..71ffdb0e59 100644 --- a/src/test/fstruct_mv.f +++ b/src/test/fstruct_mv.f @@ -39,8 +39,8 @@ subroutine fhypre_structstencilsetelement(fstencil, findx, integer foffset(*) integer*8 fstencil - call HYPRE_StructStencilSetElement(fstencil, findx, foffset, - 1 ierr) + call HYPRE_StructStencilSetEntry(fstencil, findx, foffset, + 1 ierr) if (ierr .ne. 0) then print *, 'fhypre_structstencilsetelement: error = ', ierr endif diff --git a/src/test/hypre_set_precond.c b/src/test/hypre_set_precond.c index 3591e69a01..98e6a3e6b7 100644 --- a/src/test/hypre_set_precond.c +++ b/src/test/hypre_set_precond.c @@ -24,7 +24,6 @@ HYPRE_Int hypre_set_precond(HYPRE_Int matrix_id, HYPRE_Int solver_id, HYPRE_Int ***********************************************************************/ if (matrix_id == HYPRE_PARCSR) { - /************************************************************************ * PCG Solver ***********************************************************************/ @@ -173,14 +172,13 @@ HYPRE_Int hypre_set_precond(HYPRE_Int matrix_id, HYPRE_Int solver_id, HYPRE_Int (HYPRE_Solver) precond); } } - } - /************************************************************************ * SSTRUCT MATRIX ***********************************************************************/ - if (matrix_id == HYPRE_SSTRUCT) + + else if (matrix_id == HYPRE_SSTRUCT) { /************************************************************************ @@ -281,7 +279,8 @@ HYPRE_Int hypre_set_precond(HYPRE_Int matrix_id, HYPRE_Int solver_id, HYPRE_Int /************************************************************************ * STRUCT MATRIX ***********************************************************************/ - if (matrix_id == HYPRE_STRUCT) + + else if (matrix_id == HYPRE_STRUCT) { /************************************************************************ @@ -303,13 +302,6 @@ HYPRE_Int hypre_set_precond(HYPRE_Int matrix_id, HYPRE_Int solver_id, HYPRE_Int (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, @@ -345,13 +337,6 @@ HYPRE_Int hypre_set_precond(HYPRE_Int matrix_id, HYPRE_Int solver_id, HYPRE_Int (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); - } } /************************************************************************ @@ -373,13 +358,6 @@ HYPRE_Int hypre_set_precond(HYPRE_Int matrix_id, HYPRE_Int solver_id, HYPRE_Int (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, @@ -415,13 +393,6 @@ HYPRE_Int hypre_set_precond(HYPRE_Int matrix_id, HYPRE_Int solver_id, HYPRE_Int (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, @@ -584,7 +555,6 @@ HYPRE_Int hypre_set_precond_params(HYPRE_Int precond_id, void *precond) } } - HYPRE_Int hypre_destroy_precond(HYPRE_Int precond_id, void *precond) { @@ -663,11 +633,6 @@ HYPRE_Int hypre_destroy_precond(HYPRE_Int precond_id, void *precond) HYPRE_SMGDestroy(precond); } - else if (precond_id == HYPRE_SPARSEMSG) - { - HYPRE_SparseMSGDestroy(precond); - } - else if (precond_id == HYPRE_SPLIT) { HYPRE_SplitDestroy(precond); diff --git a/src/test/hypre_sstruct_fortran_test.h b/src/test/hypre_sstruct_fortran_test.h index 1d05b22c20..ee4fe7a052 100644 --- a/src/test/hypre_sstruct_fortran_test.h +++ b/src/test/hypre_sstruct_fortran_test.h @@ -639,124 +639,11 @@ extern void hypre_F90_NAME(fhypre_sstructsyspfmgsetprintle, FHYPRE_SSTRUCTSYSPFM extern void hypre_F90_NAME(fhypre_sstructsyspfmggetnumiter, FHYPRE_SSTRUCTSYSPFMGGETNUMITER) (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 *); - - -#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 *); - -#define HYPRE_SStructMaxwellDestroy \ - hypre_F90_NAME(fhypre_sstructmaxwelldestroy, FHYPRE_SSTRUCTMAXWELLDESTROY) -extern void hypre_F90_NAME(fhypre_sstructmaxwelldestroy, FHYPRE_SSTRUCTMAXWELLDESTROY) -(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 *); - -#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 *); - -#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 *); - -#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 *); - -#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 *); - -#define HYPRE_SStructMaxwellSetRfactors \ - hypre_F90_NAME(fhypre_sstructmaxwellsetrfactor, FHYPRE_SSTRUCTMAXWELLSETRFACTOR) -extern void hypre_F90_NAME(fhypre_sstructmaxwellsetrfactor, FHYPRE_SSTRUCTMAXWELLSETRFACTOR) -(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 *); - -#define HYPRE_SStructMaxwellSetConstantCoef \ - hypre_F90_NAME(fhypre_sstructmaxwellsetconstan, FHYPRE_SSTRUCTMAXWELLSETCONSTAN) -extern void hypre_F90_NAME(fhypre_sstructmaxwellsetconstan, FHYPRE_SSTRUCTMAXWELLSETCONSTAN) -(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 *); - -#define HYPRE_SStructMaxwellSetRelChange \ - hypre_F90_NAME(fhypre_sstructmaxwellsetrelchan, FHYPRE_SSTRUCTMAXWELLSETRELCHAN) -extern void hypre_F90_NAME(fhypre_sstructmaxwellsetrelchan, FHYPRE_SSTRUCTMAXWELLSETRELCHAN) -(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 *); - -#define HYPRE_SStructMaxwellSetNumPostRelax \ - hypre_F90_NAME(fhypre_sstructmaxwellsetnumpost, FHYPRE_SSTRUCTMAXWELLSETNUMPOST) -extern void hypre_F90_NAME(fhypre_sstructmaxwellsetnumpost, FHYPRE_SSTRUCTMAXWELLSETNUMPOST) -(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 *); - -#define HYPRE_SStructMaxwellSetPrintLevel \ - hypre_F90_NAME(fhypre_sstructmaxwellsetprintle, FHYPRE_SSTRUCTMAXWELLSETPRINTLE) -extern void hypre_F90_NAME(fhypre_sstructmaxwellsetprintle, FHYPRE_SSTRUCTMAXWELLSETPRINTLE) -(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 *); - -#define HYPRE_SStructMaxwellGetNumIterations \ - 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 *); - -#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 *); - -#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 *); - -#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 *); - #ifdef __cplusplus } #endif diff --git a/src/test/hypre_struct_fortran_test.h b/src/test/hypre_struct_fortran_test.h index a23b9cb467..2ffea658ce 100644 --- a/src/test/hypre_struct_fortran_test.h +++ b/src/test/hypre_struct_fortran_test.h @@ -926,98 +926,6 @@ extern void hypre_F90_NAME(fhypre_structsmgsetprintlevel, FHYPRE_STRUCTSMGSETPRI extern void hypre_F90_NAME(fhypre_structsmggetprintlevel, FHYPRE_STRUCTSMGGETPRINTLEVEL) (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 *); - -#define HYPRE_StructSparseMSGDestroy \ - hypre_F90_NAME(fhypre_structsparsemsgdestroy, FHYPRE_STRUCTSPARSEMSGDESTROY) -extern void hypre_F90_NAME(fhypre_structsparsemsgdestroy, FHYPRE_STRUCTSPARSEMSGDESTROY) -(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 *); - -#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 *); - -#define HYPRE_StructSparseMSGSetJump \ - hypre_F90_NAME(fhypre_structsparsemsgsetjump, FHYPRE_STRUCTSPARSEMSGSETJUMP) -extern void hypre_F90_NAME(fhypre_structsparsemsgsetjump, FHYPRE_STRUCTSPARSEMSGSETJUMP) -(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 *); - -#define HYPRE_StructSparseMSGSetMaxIter \ - hypre_F90_NAME(fhypre_structsparsemsgsetmaxite, FHYPRE_STRUCTSPARSEMSGSETMAXITE) -extern void hypre_F90_NAME(fhypre_structsparsemsgsetmaxite, FHYPRE_STRUCTSPARSEMSGSETMAXITE) -(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 *); - -#define HYPRE_StructSparseMSGSetZeroGuess \ - hypre_F90_NAME(fhypre_structsparsemsgsetzerogu, FHYPRE_STRUCTSPARSEMSGSETZEROGU) -extern void hypre_F90_NAME(fhypre_structsparsemsgsetzerogu, FHYPRE_STRUCTSPARSEMSGSETZEROGU) -(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 *); - -#define HYPRE_StructSparseMSGGetNumIterations \ - hypre_F90_NAME(fhypre_structsparsemsggetnumite, FHYPRE_STRUCTSPARSEMSGGETNUMITE) -extern void hypre_F90_NAME(fhypre_structsparsemsggetnumite, FHYPRE_STRUCTSPARSEMSGGETNUMITE) -(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 *); - -#define HYPRE_StructSparseMSGSetRelaxType \ - hypre_F90_NAME(fhypre_structsparsemsgsetrelaxt, FHYPRE_STRUCTSPARSEMSGSETRELAXT) -extern void hypre_F90_NAME(fhypre_structsparsemsgsetrelaxt, FHYPRE_STRUCTSPARSEMSGSETRELAXT) -(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 *); - -#define HYPRE_StructSparseMSGSetNumPostRelax \ - hypre_F90_NAME(fhypre_structsparsemsgsetnumpos, FHYPRE_STRUCTSPARSEMSGSETNUMPOS) -extern void hypre_F90_NAME(fhypre_structsparsemsgsetnumpos, FHYPRE_STRUCTSPARSEMSGSETNUMPOS) -(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 *); - -#define HYPRE_StructSparseMSGSetLogging \ - hypre_F90_NAME(fhypre_structsparsemsgsetloggin, FHYPRE_STRUCTSPARSEMSGSETLOGGIN) -extern void hypre_F90_NAME(fhypre_structsparsemsgsetloggin, FHYPRE_STRUCTSPARSEMSGSETLOGGIN) -(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 *); - #ifdef __cplusplus } #endif diff --git a/src/test/ij.c b/src/test/ij.c index 63eeb53e66..d6dda3b5e6 100644 --- a/src/test/ij.c +++ b/src/test/ij.c @@ -41,6 +41,7 @@ #include #include "HYPRE_lobpcg.h" +#include "_hypre_lobpcg.h" /* max dt */ #define DT_INF 1.0e30 @@ -104,11 +105,11 @@ HYPRE_Int SetSysVcoefValues(HYPRE_Int num_fun, HYPRE_BigInt nx, HYPRE_BigInt ny, HYPRE_Int BuildParCoordinates (MPI_Comm comm, 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_FlexGMRESModifyPCAMGExample(void *precond_data, HYPRE_Int iterations, +// HYPRE_Real rel_residual_norm); -extern HYPRE_Int hypre_FlexGMRESModifyPCDefault(void *precond_data, HYPRE_Int iteration, - HYPRE_Real rel_residual_norm); +//extern HYPRE_Int hypre_FlexGMRESModifyPCDefault(void *precond_data, HYPRE_Int iteration, +// HYPRE_Real rel_residual_norm); #ifdef __cplusplus } #endif @@ -3006,33 +3007,6 @@ 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", comm); - 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) { @@ -4161,6 +4135,40 @@ main( hypre_int argc, hypre_FinalizeTiming(time_index); hypre_ClearTiming(); + /*----------------------------------------------------------- + * Read matrix to be passed to the preconditioner + * + * NOTE: This section of code is here to ensure parcsr_A is fully determined + * before potentially assigning it to parcsr_M. There is 'test_scaling' code + * below that also appears to change parcsr_A that may need attention. + *-----------------------------------------------------------*/ + + 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", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + } + else + { + parcsr_M = parcsr_A; + } + /*----------------------------------------------------------- * Print out the system and initial guess *-----------------------------------------------------------*/ @@ -4824,7 +4832,7 @@ main( hypre_int argc, if (num_functions > 1) { HYPRE_BoomerAMGSetDofFunc(amg_solver, dof_func); - free_dof_func = 0; + free_dof_func = 0; } HYPRE_BoomerAMGSetAdditive(amg_solver, additive); HYPRE_BoomerAMGSetMultAdditive(amg_solver, mult_add); @@ -5138,7 +5146,7 @@ main( hypre_int argc, if (num_functions > 1) { HYPRE_BoomerAMGSetDofFunc(amg_solver, dof_func); - free_dof_func = 0; + free_dof_func = 0; } HYPRE_BoomerAMGSetAdditive(amg_solver, additive); HYPRE_BoomerAMGSetMultAdditive(amg_solver, mult_add); @@ -5362,7 +5370,7 @@ main( hypre_int argc, if (num_functions > 1) { HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); - free_dof_func = 0; + free_dof_func = 0; } HYPRE_BoomerAMGSetAdditive(pcg_precond, additive); HYPRE_BoomerAMGSetMultAdditive(pcg_precond, mult_add); @@ -5563,7 +5571,7 @@ main( hypre_int argc, if (num_functions > 1) { HYPRE_BoomerAMGSetDofFunc(pcg_precond, dof_func); - free_dof_func = 0; + free_dof_func = 0; } HYPRE_BoomerAMGSetAdditive(pcg_precond, additive); HYPRE_BoomerAMGSetMultAdditive(pcg_precond, mult_add); @@ -5729,6 +5737,7 @@ main( hypre_int argc, { HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_coarse, 3); } + HYPRE_BoomerAMGSetRelaxOrder(amg_solver, 1); HYPRE_BoomerAMGSetSmoothType(amg_solver, smooth_type); HYPRE_BoomerAMGSetSmoothNumSweeps(amg_solver, smooth_num_sweeps); } @@ -5736,7 +5745,6 @@ main( hypre_int argc, HYPRE_BoomerAMGSetTol(amg_solver, 0.0); HYPRE_BoomerAMGSetPMaxElmts(amg_solver, 0); HYPRE_BoomerAMGSetNumSweeps(amg_solver, num_sweeps); - HYPRE_BoomerAMGSetRelaxOrder(amg_solver, 1); HYPRE_BoomerAMGSetMaxLevels(amg_solver, max_levels); HYPRE_BoomerAMGSetMaxIter(amg_solver, precon_cycles); HYPRE_BoomerAMGSetPrintLevel(amg_solver, 1); @@ -8143,11 +8151,12 @@ main( hypre_int argc, 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_PtrToModifyPCFcn) hypre_FlexGMRESModifyPCDefault); - + // RDF: This is problematic right now with the multiprecision code because + // of the Real argument in the ModifyPCFcn. Need to find a solution. + // + // /* this is optional - could be a user defined one instead (see ex5.c)*/ + // HYPRE_FlexGMRESSetModifyPC( pcg_solver, + // (HYPRE_PtrToModifyPCFcn) hypre_FlexGMRESModifyPCDefault); HYPRE_FlexGMRESSetup (pcg_solver, (HYPRE_Matrix)parcsr_M, (HYPRE_Vector)b, (HYPRE_Vector)x); @@ -9311,9 +9320,10 @@ main( hypre_int argc, HYPRE_BoomerAMGCreate(&amg_solver); if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) { - HYPRE_BoomerAMGSetInterpType(amg_solver, 18); + HYPRE_BoomerAMGSetInterpType(amg_solver, 6); HYPRE_BoomerAMGSetCoarsenType(amg_solver, 8); - HYPRE_BoomerAMGSetRelaxType(amg_solver, 3); + HYPRE_BoomerAMGSetRelaxType(amg_solver, 8); + HYPRE_BoomerAMGSetRelaxOrder(amg_solver, 0); } else { @@ -9335,6 +9345,7 @@ main( hypre_int argc, { HYPRE_BoomerAMGSetCycleRelaxType(amg_solver, relax_coarse, 3); } + HYPRE_BoomerAMGSetRelaxOrder(amg_solver, 1); HYPRE_BoomerAMGSetSmoothType(amg_solver, smooth_type); HYPRE_BoomerAMGSetSmoothNumSweeps(amg_solver, smooth_num_sweeps); } @@ -9342,7 +9353,6 @@ main( hypre_int argc, HYPRE_BoomerAMGSetTol(amg_solver, tol); HYPRE_BoomerAMGSetPMaxElmts(amg_solver, 0); HYPRE_BoomerAMGSetNumSweeps(amg_solver, num_sweeps); - HYPRE_BoomerAMGSetRelaxOrder(amg_solver, 1); HYPRE_BoomerAMGSetMaxLevels(amg_solver, max_levels); if (mgr_nlevels < 1 || mgr_bsize < 2) { @@ -9639,7 +9649,7 @@ main( hypre_int argc, hypre_TFree(isolated_fpt_index, HYPRE_MEMORY_HOST); } /* AMG takes ownership of dof_func, so we free it explicitly only when not using AMG */ - if (free_dof_func) + if (free_dof_func) { hypre_TFree(dof_func, memory_location); } diff --git a/src/test/ij_assembly.c b/src/test/ij_assembly.c index febf36320d..3e009df288 100644 --- a/src/test/ij_assembly.c +++ b/src/test/ij_assembly.c @@ -68,9 +68,11 @@ main( hypre_int argc, 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_IJMatrix ij_A, ij_B, ij_AT; + HYPRE_ParCSRMatrix parcsr_ref = NULL, parcsr_trans = NULL, parcsr_B = NULL; + void *obj_B; + + /* Driver input parameters */ HYPRE_Int Px, Py, Pz; HYPRE_Int nx, ny, nz; HYPRE_Real cx, cy, cz; @@ -248,12 +250,15 @@ main( hypre_int argc, 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"); - hypre_printf(" 4 = SetSet\n"); - hypre_printf(" 8 = AddSet\n"); - hypre_printf(" 16 = SetAddSet\n"); + hypre_printf(" -mode : tests to be performed (code)\n"); + hypre_printf(" 1 = Set (Default) (sA)\n"); + hypre_printf(" 2 = SetOffProc (aaaaaA)\n"); + hypre_printf(" 4 = SetSet (ssA)\n"); + hypre_printf(" 8 = AddSet (asA)\n"); + hypre_printf(" 16 = SetAdd (saA)\n"); + hypre_printf(" 32 = SetAddAssembleSet (saAsA)\n"); + hypre_printf(" 64 = AddAddAddAddAddSet (aaaaasA)\n"); + hypre_printf(" 128 = SetAssembleGet (sAg)\n"); hypre_printf(" -option : interface option of Set/AddToValues\n"); hypre_printf(" 1 = CSR-like (default)\n"); hypre_printf(" 2 = COO-like\n"); @@ -308,7 +313,8 @@ main( hypre_int argc, *-----------------------------------------------------------*/ buildMatrixEntries(comm, nx, ny, nz, Px, Py, Pz, cx, cy, cz, base, &ilower, &iupper, &jlower, &jupper, &nrows, &num_nonzeros, - &h_nnzrow, &h_rows, &h_rows_coo, &h_cols, &h_coefs, stencil, &parcsr_ref); + &h_nnzrow, &h_rows, &h_rows_coo, &h_cols, &h_coefs, stencil, + &parcsr_ref); switch (memory_location) { @@ -319,16 +325,16 @@ main( hypre_int argc, 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_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); + 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; @@ -355,9 +361,10 @@ main( hypre_int argc, /* Test Set */ if (mode & 1) { - 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, + 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); ierr += checkMatrix(parcsr_ref, ij_A) > tol; @@ -374,9 +381,10 @@ main( hypre_int argc, */ if (mode & 2) { - 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); + 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); @@ -393,9 +401,10 @@ main( hypre_int argc, /* Test Set/Set */ if (mode & 4) { - 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, + 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); ierr += checkMatrix(parcsr_ref, ij_A) > tol; @@ -409,9 +418,10 @@ main( hypre_int argc, /* Test Add/Set */ if (mode & 8) { - 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, + 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); ierr += checkMatrix(parcsr_ref, ij_A) > tol; @@ -425,9 +435,10 @@ main( hypre_int argc, /* Test Set/Add */ if (mode & 16) { - 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, + 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); @@ -445,9 +456,10 @@ main( hypre_int argc, /* 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, + 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); ierr += checkMatrix(parcsr_ref, ij_A) > tol; @@ -461,9 +473,10 @@ main( hypre_int argc, /* 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, + 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); @@ -478,6 +491,36 @@ main( hypre_int argc, HYPRE_ParCSRMatrixDestroy(parcsr_ref2); } + /* Test Get */ + if (mode & 128) + { + test_all(comm, "set/get", memory_location, option, "sAg", + 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); + + /* Create matrix with (rows, cols, coefs) gotten from ij_A */ + HYPRE_IJMatrixCreate(comm, ilower, iupper, jlower, jupper, &ij_B); + HYPRE_IJMatrixSetObjectType(ij_B, HYPRE_PARCSR); + HYPRE_IJMatrixInitialize_v2(ij_B, memory_location); + HYPRE_IJMatrixSetValues(ij_B, nrows, nnzrow, rows, cols, coefs); + HYPRE_IJMatrixAssemble(ij_B); + HYPRE_IJMatrixMigrate(ij_B, HYPRE_MEMORY_HOST); + HYPRE_IJMatrixGetObject(ij_B, &obj_B); + parcsr_B = (HYPRE_ParCSRMatrix) obj_B; + + /* Check matrices */ + ierr += checkMatrix(parcsr_B, ij_A) > tol; + + if (print_matrix) + { + HYPRE_IJMatrixPrint(ij_A, "ij_sAg"); + } + HYPRE_IJMatrixDestroy(ij_A); + HYPRE_IJMatrixDestroy(ij_B); + } + /* Print the error code */ hypre_ParPrintf(comm, "Test error code = %d\n", ierr); @@ -612,11 +655,10 @@ buildMatrixEntries(MPI_Comm comm, } /* 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); + getParCSRMatrixData(A, base, nrows_ptr, num_nonzeros_ptr, nnzrow_ptr, + rows_ptr, rows_coo_ptr, cols_ptr, coefs_ptr); - // Set pointers + /* Set pointers */ *ilower_ptr = hypre_ParCSRMatrixFirstRowIndex(A) + base; *iupper_ptr = hypre_ParCSRMatrixLastRowIndex(A) + base; *jlower_ptr = hypre_ParCSRMatrixFirstColDiag(A) + base; @@ -779,7 +821,7 @@ test_all(MPI_Comm comm, HYPRE_IJMatrix *ij_A_ptr) { HYPRE_IJMatrix ij_A; - HYPRE_Int i, j, chunk, chunk_size; + HYPRE_Int i, j, chunk, chunk_size, chunk_nnz; HYPRE_Int time_index; HYPRE_Int *h_rowptr = hypre_CTAlloc(HYPRE_Int, nrows + 1, HYPRE_MEMORY_HOST); HYPRE_Int cmd_len = strlen(cmd_sequence); @@ -822,7 +864,9 @@ test_all(MPI_Comm comm, for (j = 0; j < cmd_len; j++) { - if (cmd_sequence[j] == 's' || cmd_sequence[j] == 'a') + if (cmd_sequence[j] == 's' || + cmd_sequence[j] == 'a' || + cmd_sequence[j] == 'g') { for (chunk = 0; chunk < nrows; chunk += chunk_size) { @@ -831,28 +875,52 @@ test_all(MPI_Comm comm, { if (cmd_sequence[j] == 's') { - HYPRE_IJMatrixSetValues(ij_A, chunk_size, &nnzrow[chunk], &rows[chunk], - &cols[h_rowptr[chunk]], &coefs[h_rowptr[chunk]]); + HYPRE_IJMatrixSetValues(ij_A, chunk_size, + &nnzrow[chunk], + &rows[chunk], + &cols[h_rowptr[chunk]], + &coefs[h_rowptr[chunk]]); + } + else if (cmd_sequence[j] == 'a') + { + HYPRE_IJMatrixAddToValues(ij_A, chunk_size, + &nnzrow[chunk], + &rows[chunk], + &cols[h_rowptr[chunk]], + &coefs[h_rowptr[chunk]]); } - else + else /* if (cmd_sequence[j] == 'g') */ { - HYPRE_IJMatrixAddToValues(ij_A, chunk_size, &nnzrow[chunk], &rows[chunk], - &cols[h_rowptr[chunk]], &coefs[h_rowptr[chunk]]); + HYPRE_IJMatrixGetValues(ij_A, chunk_size, + &nnzrow[chunk], + &rows[chunk], + &cols[h_rowptr[chunk]], + &coefs[h_rowptr[chunk]]); } } else { + chunk_nnz = h_rowptr[chunk + chunk_size] - h_rowptr[chunk]; 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]]); + HYPRE_IJMatrixSetValues(ij_A, chunk_nnz, NULL, + &rows[h_rowptr[chunk]], + &cols[h_rowptr[chunk]], + &coefs[h_rowptr[chunk]]); + } + else if (cmd_sequence[j] == 'a') + { + HYPRE_IJMatrixAddToValues(ij_A, chunk_nnz, NULL, + &rows[h_rowptr[chunk]], + &cols[h_rowptr[chunk]], + &coefs[h_rowptr[chunk]]); } - else + else /* if (cmd_sequence[j] == 'g') */ { - 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]]); + HYPRE_IJMatrixGetValues(ij_A, chunk_nnz, NULL, + &rows[h_rowptr[chunk]], + &cols[h_rowptr[chunk]], + &coefs[h_rowptr[chunk]]); } } } @@ -884,8 +952,3 @@ test_all(MPI_Comm comm, return hypre_error_flag; } - - - - - diff --git a/src/test/ij_mm.c b/src/test/ij_mm.c index 1d273fd5c4..10535ee670 100644 --- a/src/test/ij_mm.c +++ b/src/test/ij_mm.c @@ -469,7 +469,7 @@ void runjob3( HYPRE_ParCSRMatrix parcsr_A, } else { - parcsr_AH = hypre_ParCSRMatrixRAPKT(parcsr_P, parcsr_A, parcsr_P, keepTranspose); + parcsr_AH = hypre_ParCSRMatrixRAPKT(parcsr_P, parcsr_A, parcsr_P, keepTranspose, 1); } if (i == rep - 1) diff --git a/src/test/ij_mp.c b/src/test/ij_mp.c new file mode 100644 index 0000000000..b3a8ddf7f6 --- /dev/null +++ b/src/test/ij_mp.c @@ -0,0 +1,3225 @@ +/****************************************************************************** + * 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) + ******************************************************************************/ + +/*! + This file contains a mocked-up example, based on ex5.c in the examples directory. + The goal is to give an idea of how a user may utilize hypre to assemble matrix data + and access solvers in a way that would facilitate a mixed-precision solution of the + linear system. This particular driver demonstrates how the mixed-precision build may + be used to develop mixed-precision solvers, such as the defect-correction-based solver + implemented here. Feel free to ask questions, make comments or suggestions + regarding any of the information below. +*/ + +#include +#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_ls.h" // Needed for GenerateSysLaplacian call below +#include "_hypre_parcsr_mv.h" +#include "HYPRE_krylov.h" + +#include + +#define my_min(a,b) (((a)<(b)) ? (a) : (b)) + +HYPRE_Int BuildParLaplacian_mp( HYPRE_Int argc, char *argv[], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_flt_ptr, HYPRE_ParCSRMatrix *A_dbl_ptr ); +HYPRE_Int BuildParSysLaplacian_mp (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_flt_ptr, HYPRE_ParCSRMatrix *A_dbl_ptr ); +HYPRE_Int BuildParDifConv_mp (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_flt_ptr, HYPRE_ParCSRMatrix *A_dbl_ptr ); +HYPRE_Int BuildParLaplacian9pt_mp (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_flt_ptr, HYPRE_ParCSRMatrix *A_dbl_ptr ); +HYPRE_Int BuildParLaplacian27pt_mp (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_flt_ptr, HYPRE_ParCSRMatrix *A_dbl_ptr ); +HYPRE_Int BuildParLaplacian125pt_mp (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_flt_ptr, HYPRE_ParCSRMatrix *A_dbl_ptr ); +HYPRE_Int BuildParRotate7pt_mp (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_flt_ptr, HYPRE_ParCSRMatrix *A_dbl_ptr ); +HYPRE_Int BuildParVarDifConv_mp (HYPRE_Int argc, char *argv [], HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_flt_ptr, HYPRE_ParCSRMatrix *A_dbl_ptr, + HYPRE_ParVector *rhs_flt_ptr, HYPRE_ParVector *rhs_dbl_ptr ); + +HYPRE_Int HYPRE_DefectCorrectionSolver(HYPRE_ParCSRMatrix A, + HYPRE_ParCSRMatrix B, + HYPRE_ParVector x, + HYPRE_ParVector b, + HYPRE_Solver solver, + HYPRE_PtrToSolverFcn approx_solve, + HYPRE_Int maxits); + +int main (int argc, char *argv[]) +{ + int arg_index; + int myid, num_procs; + int ilower, iupper; + int jlower, jupper; + int solver_id = 0; + //double one = 1.0; + double zero = 0.; + int num_iterations; + double dfinal_res_norm; + float final_res_norm; + int time_index; + //float wall_time; + double max_row_sum = 1.0; + int build_matrix_type = 2; + int build_rhs_type = 2; + int build_matrix_arg_index; + //int build_rhs_arg_index; + int mg_max_iter = 50; + int max_iter = 1000; + int coarsen_type = 10; + int interp_type = 6; + int P_max_elmts = 4; + double trunc_factor = 0.0; + double strong_threshold = 0.25; + int relax_type = 8; + int relax_up = 14; + int relax_down = 13; + int relax_coarse = 9; + int num_sweeps = 1; + int ns_down = -1; + int ns_up = -1; + int ns_coarse = -1; + int max_levels = 25; + int debug_flag = 0; + int agg_num_levels = 0; + int num_paths = 1; + int agg_interp_type = 4; + int agg_P_max_elmts = 0; + double agg_trunc_factor = 0; + int agg_P12_max_elmts = 0; + double agg_P12_trunc_factor = 0; + int smooth_type = 6; + int smooth_num_levels = 0; + int smooth_num_sweeps = 1; + double tol = 1.e-8; + int ioutdat = 0; + int poutdat = 0; + int flex = 0; + int num_functions = 1; + int nodal = 0; + int nodal_diag = 0; + int keep_same_sign = 0; + //int cycle_type = 1; + int relax_order = 0; + double relax_wt = 1.0; + double outer_wt = 1.0; + int k_dim = 10; + int two_norm = 0; + + /*! Matrix and preconditioner declarations. Here, we declare IJMatrices and parcsr matrices + for the solver (A, parcsr_A) and the preconditioner (B, A_dbl). I have included two suggestions + below on how we would utilize both of these matrices. + */ + + HYPRE_ParCSRMatrix A_flt = NULL; + HYPRE_IJVector ij_b_flt; + HYPRE_ParVector b_flt; + HYPRE_IJVector ij_x_flt; + HYPRE_ParVector x_flt; + + HYPRE_ParCSRMatrix A_dbl; + HYPRE_IJVector ij_b_dbl; + HYPRE_ParVector b_dbl; + HYPRE_IJVector ij_x_dbl; + HYPRE_ParVector x_dbl; + + /*! Solver and preconditioner and declarations and solver_precision variable. Internally, HYPRE_SolverPrecision + is an enum struct containing HYPRE_REAL_float, HYPRE_REAL_SINGLE and HYPRE_REAL_LONG. + */ + //HYPRE_Solver solver, precond; + /* Initialize MPI */ + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &myid); + MPI_Comm_size(MPI_COMM_WORLD, &num_procs); + + /*! We set up the linear system following ex5. */ + /* Some default problem parameters */ + solver_id = 0; + build_matrix_type = 2; + build_matrix_arg_index = argc; + build_rhs_type = 2; + //build_rhs_arg_index = argc; + + /*-------------------------- + * Parse command line + *--------------------------*/ + arg_index = 0; + while (arg_index < argc) + { + if ( strcmp(argv[arg_index], "-solver") == 0 ) + { + arg_index++; + solver_id = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-laplace") == 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 = 6; + build_matrix_arg_index = arg_index; + } + 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], "-125pt") == 0 ) + { + arg_index++; + build_matrix_type = 5; + build_matrix_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], "-rhszero") == 0 ) + { + arg_index++; + build_rhs_type = 4; + //build_rhs_arg_index = arg_index; + } + else if ( strcmp(argv[arg_index], "-cljp") == 0 ) + { + arg_index++; + coarsen_type = 0; + } + else if ( strcmp(argv[arg_index], "-pmis") == 0 ) + { + arg_index++; + coarsen_type = 8; + } + 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], "-falgout") == 0 ) + { + arg_index++; + coarsen_type = 6; + } + else if ( strcmp(argv[arg_index], "-rlx_coarse") == 0 ) + { + arg_index++; + relax_coarse = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-rlx_down") == 0 ) + { + arg_index++; + relax_down = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-rlx_up") == 0 ) + { + arg_index++; + relax_up = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-smtype") == 0 ) + { + arg_index++; + smooth_type = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-smlv") == 0 ) + { + arg_index++; + smooth_num_levels = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-mxl") == 0 ) + { + arg_index++; + max_levels = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-dbg") == 0 ) + { + arg_index++; + debug_flag = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-nf") == 0 ) + { + arg_index++; + num_functions = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-agg_nl") == 0 ) + { + arg_index++; + agg_num_levels = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-npaths") == 0 ) + { + arg_index++; + num_paths = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-agg_interp") == 0 ) + { + arg_index++; + agg_interp_type = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-agg_Pmx") == 0 ) + { + arg_index++; + agg_P_max_elmts = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-agg_P12_mx") == 0 ) + { + arg_index++; + agg_P12_max_elmts = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-agg_tr") == 0 ) + { + arg_index++; + agg_trunc_factor = atof(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-agg_P12_tr") == 0 ) + { + arg_index++; + agg_P12_trunc_factor = atof(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-ns") == 0 ) + { + arg_index++; + num_sweeps = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-ns_coarse") == 0 ) + { + arg_index++; + ns_coarse = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-ns_down") == 0 ) + { + arg_index++; + ns_down = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-ns_up") == 0 ) + { + arg_index++; + ns_up = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-sns") == 0 ) + { + arg_index++; + smooth_num_sweeps = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-max_iter") == 0 ) + { + arg_index++; + max_iter = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-mg_max_iter") == 0 ) + { + arg_index++; + mg_max_iter = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-nodal") == 0 ) + { + arg_index++; + nodal = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-nodal_diag") == 0 ) + { + arg_index++; + nodal_diag = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-keepSS") == 0 ) + { + arg_index++; + keep_same_sign = atoi(argv[arg_index++]); + } + //else if ( strcmp(argv[arg_index], "-mu") == 0 ) + //{ + // arg_index++; + // cycle_type = atoi(argv[arg_index++]); + //} + else if ( strcmp(argv[arg_index], "-iout") == 0 ) + { + arg_index++; + ioutdat = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-pout") == 0 ) + { + arg_index++; + poutdat = 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], "-mxrs") == 0 ) + { + arg_index++; + max_row_sum = atof(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-tol") == 0 ) + { + arg_index++; + tol = atof(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-two_norm") == 0 ) + { + arg_index++; + two_norm = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-k") == 0 ) + { + arg_index++; + k_dim = atoi(argv[arg_index++]); + } + else + { + arg_index++; + } + } + + if (build_matrix_type == 2) + { + BuildParLaplacian_mp(argc, argv, build_matrix_arg_index, &A_flt, &A_dbl); + } + else if (build_matrix_type == 3) + { + BuildParLaplacian9pt_mp(argc, argv, build_matrix_arg_index, &A_flt, &A_dbl); + } + else if (build_matrix_type == 4) + { + BuildParLaplacian27pt_mp(argc, argv, build_matrix_arg_index, &A_flt, &A_dbl); + } + else if (build_matrix_type == 5) + { + BuildParLaplacian125pt_mp(argc, argv, build_matrix_arg_index, &A_flt, &A_dbl); + } + else if (build_matrix_type == 6) + { + BuildParDifConv_mp(argc, argv, build_matrix_arg_index, &A_flt, &A_dbl); + } + else if (build_matrix_type == 7) + { + BuildParVarDifConv_mp(argc, argv, build_matrix_arg_index, &A_flt, &A_dbl, &b_flt, &b_dbl); + build_rhs_type = 6; + } + else if (build_matrix_type == 8) + { + BuildParRotate7pt_mp(argc, argv, build_matrix_arg_index, &A_flt, &A_dbl); + } + + HYPRE_ParCSRMatrixGetLocalRange_flt( A_flt, + &ilower, &iupper, &jlower, &jupper); + + if (build_rhs_type == 2) + { + double one = 1.0; + if (myid == 0) + { + hypre_printf(" RHS vector has unit coefficients\n"); + hypre_printf(" Initial guess is 0\n"); + } + + /* RHS */ + HYPRE_IJVectorCreate_flt(MPI_COMM_WORLD, ilower, iupper, &ij_b_flt); + HYPRE_IJVectorSetObjectType_flt(ij_b_flt, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_flt(ij_b_flt); + HYPRE_IJVectorAssemble_flt(ij_b_flt); + HYPRE_IJVectorGetObject_flt( ij_b_flt, (void **) &b_flt ); + HYPRE_ParVectorSetConstantValues_flt(b_flt, (float)one); + HYPRE_IJVectorCreate_dbl(MPI_COMM_WORLD, ilower, iupper, &ij_b_dbl); + HYPRE_IJVectorSetObjectType_dbl(ij_b_dbl, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_dbl(ij_b_dbl); + HYPRE_IJVectorAssemble_dbl(ij_b_dbl); + HYPRE_IJVectorGetObject_dbl( ij_b_dbl, (void **) &b_dbl ); + HYPRE_ParVectorSetConstantValues_dbl(b_dbl, one); + /* X0 */ + HYPRE_IJVectorCreate_flt(MPI_COMM_WORLD, ilower, iupper, &ij_x_flt); + HYPRE_IJVectorSetObjectType_flt(ij_x_flt, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_flt(ij_x_flt); + HYPRE_IJVectorAssemble_flt(ij_x_flt); + HYPRE_IJVectorGetObject_flt( ij_x_flt, (void **) &x_flt ); + HYPRE_IJVectorCreate_dbl(MPI_COMM_WORLD, ilower, iupper, &ij_x_dbl); + HYPRE_IJVectorSetObjectType_dbl(ij_x_dbl, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_dbl(ij_x_dbl); + HYPRE_IJVectorAssemble_dbl(ij_x_dbl); + HYPRE_IJVectorGetObject_dbl( ij_x_dbl, (void **) &x_dbl ); + } + else if (build_rhs_type == 3) + { + //double one = 1.0; + if (myid == 0) + { + hypre_printf(" RHS vector has random coefficients\n"); + hypre_printf(" Initial guess is 0\n"); + } + + /* RHS */ + HYPRE_IJVectorCreate_flt(MPI_COMM_WORLD, ilower, iupper, &ij_b_flt); + HYPRE_IJVectorSetObjectType_flt(ij_b_flt, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_flt(ij_b_flt); + HYPRE_IJVectorAssemble_flt(ij_b_flt); + HYPRE_IJVectorGetObject_flt( ij_b_flt, (void **) &b_flt ); + HYPRE_ParVectorSetRandomValues_flt(b_flt, 22775); + HYPRE_IJVectorCreate_dbl(MPI_COMM_WORLD, ilower, iupper, &ij_b_dbl); + HYPRE_IJVectorSetObjectType_dbl(ij_b_dbl, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_dbl(ij_b_dbl); + HYPRE_IJVectorAssemble_dbl(ij_b_dbl); + HYPRE_IJVectorGetObject_dbl( ij_b_dbl, (void **) &b_dbl ); + HYPRE_ParVectorSetRandomValues_dbl(b_dbl, 22775); + /* X0 */ + HYPRE_IJVectorCreate_flt(MPI_COMM_WORLD, ilower, iupper, &ij_x_flt); + HYPRE_IJVectorSetObjectType_flt(ij_x_flt, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_flt(ij_x_flt); + HYPRE_IJVectorAssemble_flt(ij_x_flt); + HYPRE_IJVectorGetObject_flt( ij_x_flt, (void **) &x_flt ); + HYPRE_IJVectorCreate_dbl(MPI_COMM_WORLD, ilower, iupper, &ij_x_dbl); + HYPRE_IJVectorSetObjectType_dbl(ij_x_dbl, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_dbl(ij_x_dbl); + HYPRE_IJVectorAssemble_dbl(ij_x_dbl); + HYPRE_IJVectorGetObject_dbl( ij_x_dbl, (void **) &x_dbl ); + } + else if (build_rhs_type == 4) + { + if (myid == 0) + { + hypre_printf(" RHS vector has unit coefficients\n"); + hypre_printf(" Initial guess is random\n"); + } + + /* RHS */ + HYPRE_IJVectorCreate_flt(MPI_COMM_WORLD, ilower, iupper, &ij_b_flt); + HYPRE_IJVectorSetObjectType_flt(ij_b_flt, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_flt(ij_b_flt); + HYPRE_IJVectorAssemble_flt(ij_b_flt); + HYPRE_IJVectorGetObject_flt( ij_b_flt, (void **) &b_flt ); + HYPRE_ParVectorSetConstantValues_flt(b_flt, (float)zero); + HYPRE_IJVectorCreate_dbl(MPI_COMM_WORLD, ilower, iupper, &ij_b_dbl); + HYPRE_IJVectorSetObjectType_dbl(ij_b_dbl, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_dbl(ij_b_dbl); + HYPRE_IJVectorAssemble_dbl(ij_b_dbl); + HYPRE_IJVectorGetObject_dbl( ij_b_dbl, (void **) &b_dbl ); + HYPRE_ParVectorSetConstantValues_dbl(b_dbl, zero); + /* X0 */ + HYPRE_IJVectorCreate_flt(MPI_COMM_WORLD, ilower, iupper, &ij_x_flt); + HYPRE_IJVectorSetObjectType_flt(ij_x_flt, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_flt(ij_x_flt); + HYPRE_IJVectorAssemble_flt(ij_x_flt); + HYPRE_IJVectorGetObject_flt( ij_x_flt, (void **) &x_flt ); + HYPRE_ParVectorSetRandomValues_flt(x_flt, 22775); + HYPRE_IJVectorCreate_dbl(MPI_COMM_WORLD, ilower, iupper, &ij_x_dbl); + HYPRE_IJVectorSetObjectType_dbl(ij_x_dbl, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_dbl(ij_x_dbl); + HYPRE_IJVectorAssemble_dbl(ij_x_dbl); + HYPRE_IJVectorGetObject_dbl( ij_x_dbl, (void **) &x_dbl ); + HYPRE_ParVectorSetRandomValues_dbl(x_dbl, 22775); + } + + /*! Done with linear system setup. Now proceed to solve the system. */ + // PCG solve + if (solver_id < 2) + { + // Double precision + { + /* reset solution vector */ + if (build_rhs_type < 4 || build_rhs_type == 6) { HYPRE_ParVectorSetConstantValues_dbl(x_dbl, zero); } + else { HYPRE_ParVectorSetRandomValues_dbl(x_dbl, 22775); } + + HYPRE_Solver amg_solver; + HYPRE_Solver pcg_solver; + HYPRE_Solver pcg_precond_gotten; + + time_index = hypre_InitializeTiming("DBL Setup"); + MPI_Barrier(MPI_COMM_WORLD); + hypre_BeginTiming(time_index); + // Create PCG solver + HYPRE_ParCSRPCGCreate_dbl(MPI_COMM_WORLD, &pcg_solver); + HYPRE_PCGSetMaxIter_dbl(pcg_solver, max_iter); + HYPRE_PCGSetTol_dbl(pcg_solver, tol); + HYPRE_PCGSetTwoNorm_dbl(pcg_solver, two_norm); + HYPRE_PCGSetPrintLevel_dbl(pcg_solver, ioutdat); + HYPRE_PCGSetFlex_dbl(pcg_solver, flex); + HYPRE_PCGSetRecomputeResidual_dbl(pcg_solver, 1); + + + /* Now set up the AMG preconditioner and specify any parameters */ + if (solver_id == 1) + { + if (myid == 0) { hypre_printf("\n\n***** Solver: DOUBLE PRECISION AMG-PCG *****\n"); } + + HYPRE_PCGSetMaxIter_dbl(pcg_solver, mg_max_iter); + HYPRE_BoomerAMGCreate_dbl(&amg_solver); + HYPRE_BoomerAMGSetPrintLevel_dbl(amg_solver, poutdat); /* print amg solution info */ + HYPRE_BoomerAMGSetCoarsenType_dbl(amg_solver, coarsen_type); + HYPRE_BoomerAMGSetInterpType_dbl(amg_solver, interp_type); + HYPRE_BoomerAMGSetNumSweeps_dbl(amg_solver, num_sweeps); + HYPRE_BoomerAMGSetTol_dbl(amg_solver, 0.0); /* conv. tolerance zero */ + HYPRE_BoomerAMGSetMaxIter_dbl(amg_solver, 1); /* do only one iteration! */ + HYPRE_BoomerAMGSetStrongThreshold_dbl(amg_solver, strong_threshold); + HYPRE_BoomerAMGSetTruncFactor_dbl(amg_solver, trunc_factor); + HYPRE_BoomerAMGSetPMaxElmts_dbl(amg_solver, P_max_elmts); + HYPRE_BoomerAMGSetNumSweeps_dbl(amg_solver, num_sweeps); + if (relax_type > -1) { HYPRE_BoomerAMGSetRelaxType_dbl(amg_solver, relax_type); } + if (relax_down > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType_dbl(amg_solver, relax_down, 1); + } + if (relax_up > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType_dbl(amg_solver, relax_up, 2); + } + if (relax_coarse > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType_dbl(amg_solver, relax_coarse, 3); + } + HYPRE_BoomerAMGSetRelaxOrder_dbl(amg_solver, relax_order); + HYPRE_BoomerAMGSetRelaxWt_dbl(amg_solver, relax_wt); + HYPRE_BoomerAMGSetOuterWt_dbl(amg_solver, outer_wt); + HYPRE_BoomerAMGSetMaxLevels_dbl(amg_solver, max_levels); + HYPRE_BoomerAMGSetSmoothType_dbl(amg_solver, smooth_type); + HYPRE_BoomerAMGSetSmoothNumSweeps_dbl(amg_solver, smooth_num_sweeps); + HYPRE_BoomerAMGSetSmoothNumLevels_dbl(amg_solver, smooth_num_levels); + HYPRE_BoomerAMGSetMaxRowSum_dbl(amg_solver, max_row_sum); + HYPRE_BoomerAMGSetDebugFlag_dbl(amg_solver, debug_flag); + HYPRE_BoomerAMGSetNumFunctions_dbl(amg_solver, num_functions); + HYPRE_BoomerAMGSetAggNumLevels_dbl(amg_solver, agg_num_levels); + HYPRE_BoomerAMGSetAggInterpType_dbl(amg_solver, agg_interp_type); + HYPRE_BoomerAMGSetAggTruncFactor_dbl(amg_solver, agg_trunc_factor); + HYPRE_BoomerAMGSetAggP12TruncFactor_dbl(amg_solver, agg_P12_trunc_factor); + HYPRE_BoomerAMGSetAggPMaxElmts_dbl(amg_solver, agg_P_max_elmts); + HYPRE_BoomerAMGSetAggP12MaxElmts_dbl(amg_solver, agg_P12_max_elmts); + HYPRE_BoomerAMGSetNumPaths_dbl(amg_solver, num_paths); + HYPRE_BoomerAMGSetNodal_dbl(amg_solver, nodal); + HYPRE_BoomerAMGSetNodalDiag_dbl(amg_solver, nodal_diag); + HYPRE_BoomerAMGSetKeepSameSign_dbl(amg_solver, keep_same_sign); + if (ns_coarse > -1) + { + HYPRE_BoomerAMGSetCycleNumSweeps_dbl(amg_solver, ns_coarse, 3); + } + if (ns_down > -1) + { + HYPRE_BoomerAMGSetCycleNumSweeps_dbl(amg_solver, ns_down, 1); + } + if (ns_up > -1) + { + HYPRE_BoomerAMGSetCycleNumSweeps_dbl(amg_solver, ns_up, 2); + } + + // Set the preconditioner for PCG + HYPRE_PCGSetPrecondMatrix_dbl(pcg_solver, (HYPRE_Matrix)A_dbl); + + HYPRE_PCGSetPrecond_dbl(pcg_solver, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve_dbl, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup_dbl, + amg_solver); + + HYPRE_PCGGetPrecond_dbl(pcg_solver, &pcg_precond_gotten); + if (pcg_precond_gotten != amg_solver) + { + hypre_printf("HYPRE_ParCSRPCGGetPrecond got bad precond\n"); + return (-1); + } + else if (myid == 0) + { + hypre_printf("HYPRE_ParCSRPCGGetPrecond got good precond\n"); + } + } + else if (solver_id == 0) + { + if (myid == 0) { hypre_printf("\n\n***** Solver: DOUBLE PRECISION DS-PCG *****\n"); } + } + // Setup PCG solver + HYPRE_PCGSetup_dbl(pcg_solver, (HYPRE_Matrix)A_dbl, (HYPRE_Vector)b_dbl, (HYPRE_Vector)x_dbl); + MPI_Barrier(MPI_COMM_WORLD); + hypre_EndTiming(time_index); + hypre_PrintTiming("Double precision Setup Time", MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + fflush(NULL); + + time_index = hypre_InitializeTiming("DBL Solve"); + MPI_Barrier(MPI_COMM_WORLD); + hypre_BeginTiming(time_index); + // PCG solve + HYPRE_PCGSolve_dbl(pcg_solver, (HYPRE_Matrix)A_dbl, (HYPRE_Vector)b_dbl, (HYPRE_Vector)x_dbl); + + MPI_Barrier(MPI_COMM_WORLD); + hypre_EndTiming(time_index); + hypre_PrintTiming("Double precision Solve Time", MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + HYPRE_PCGGetNumIterations_dbl(pcg_solver, &num_iterations); + HYPRE_PCGGetFinalRelativeResidualNorm_dbl(pcg_solver, &dfinal_res_norm); + if (myid == 0) + { + hypre_printf("final relative residual norm = %e \n", dfinal_res_norm); + hypre_printf("Iteration count = %d \n", num_iterations); + } + fflush(NULL); + // destroy pcg solver + HYPRE_ParCSRPCGDestroy_dbl(pcg_solver); + if (solver_id == 1) { HYPRE_BoomerAMGDestroy_dbl(amg_solver); } + } + // Single precision + { + /* reset solution vector */ + if (build_rhs_type < 4) { HYPRE_ParVectorSetConstantValues_flt(x_flt, zero); } + else { HYPRE_ParVectorSetRandomValues_flt(x_flt, 22775); } + + HYPRE_Solver amg_solver; + HYPRE_Solver pcg_solver; + HYPRE_Solver pcg_precond_gotten; + + time_index = hypre_InitializeTiming("FLT Setup"); + MPI_Barrier(MPI_COMM_WORLD); + hypre_BeginTiming(time_index); + // Create PCG solver + HYPRE_ParCSRPCGCreate_flt(MPI_COMM_WORLD, &pcg_solver); + HYPRE_PCGSetMaxIter_flt(pcg_solver, max_iter); + HYPRE_PCGSetTol_flt(pcg_solver, (float)tol); + HYPRE_PCGSetTwoNorm_flt(pcg_solver, two_norm); + HYPRE_PCGSetPrintLevel_flt(pcg_solver, ioutdat); + HYPRE_PCGSetFlex_flt(pcg_solver, flex); + HYPRE_PCGSetRecomputeResidual_flt(pcg_solver, 1); + + + /* Now set up the AMG preconditioner and specify any parameters */ + if (solver_id == 1) + { + if (myid == 0) { hypre_printf("\n\n***** Solver: SINGLE PRECISION AMG-PCG *****\n"); } + HYPRE_PCGSetMaxIter_flt(pcg_solver, mg_max_iter); + HYPRE_BoomerAMGCreate_flt(&amg_solver); + HYPRE_BoomerAMGSetPrintLevel_flt(amg_solver, poutdat); /* print amg solution info */ + HYPRE_BoomerAMGSetCoarsenType_flt(amg_solver, coarsen_type); + HYPRE_BoomerAMGSetInterpType_flt(amg_solver, interp_type); + HYPRE_BoomerAMGSetNumSweeps_flt(amg_solver, num_sweeps); + HYPRE_BoomerAMGSetTol_flt(amg_solver, (float)zero); /* conv. tolerance zero */ + HYPRE_BoomerAMGSetMaxIter_flt(amg_solver, 1); /* do only one iteration! */ + HYPRE_BoomerAMGSetStrongThreshold_flt(amg_solver, (float)strong_threshold); + HYPRE_BoomerAMGSetTruncFactor_flt(amg_solver, (float)trunc_factor); + HYPRE_BoomerAMGSetPMaxElmts_flt(amg_solver, P_max_elmts); + HYPRE_BoomerAMGSetNumSweeps_flt(amg_solver, num_sweeps); + if (relax_type > -1) { HYPRE_BoomerAMGSetRelaxType_flt(amg_solver, relax_type); } + if (relax_down > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType_flt(amg_solver, relax_down, 1); + } + if (relax_up > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType_flt(amg_solver, relax_up, 2); + } + if (relax_coarse > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType_flt(amg_solver, relax_coarse, 3); + } + HYPRE_BoomerAMGSetRelaxOrder_flt(amg_solver, relax_order); + HYPRE_BoomerAMGSetRelaxWt_flt(amg_solver, (float)relax_wt); + HYPRE_BoomerAMGSetOuterWt_flt(amg_solver, (float)outer_wt); + HYPRE_BoomerAMGSetMaxLevels_flt(amg_solver, max_levels); + HYPRE_BoomerAMGSetSmoothType_flt(amg_solver, smooth_type); + HYPRE_BoomerAMGSetSmoothNumSweeps_flt(amg_solver, smooth_num_sweeps); + HYPRE_BoomerAMGSetSmoothNumLevels_flt(amg_solver, smooth_num_levels); + HYPRE_BoomerAMGSetMaxRowSum_flt(amg_solver, (float)max_row_sum); + HYPRE_BoomerAMGSetDebugFlag_flt(amg_solver, debug_flag); + HYPRE_BoomerAMGSetNumFunctions_flt(amg_solver, num_functions); + HYPRE_BoomerAMGSetAggNumLevels_flt(amg_solver, agg_num_levels); + HYPRE_BoomerAMGSetAggInterpType_flt(amg_solver, agg_interp_type); + HYPRE_BoomerAMGSetAggTruncFactor_flt(amg_solver, (float)agg_trunc_factor); + HYPRE_BoomerAMGSetAggP12TruncFactor_flt(amg_solver, (float)agg_P12_trunc_factor); + HYPRE_BoomerAMGSetAggPMaxElmts_flt(amg_solver, agg_P_max_elmts); + HYPRE_BoomerAMGSetAggP12MaxElmts_flt(amg_solver, agg_P12_max_elmts); + HYPRE_BoomerAMGSetNumPaths_flt(amg_solver, num_paths); + HYPRE_BoomerAMGSetNodal_flt(amg_solver, nodal); + HYPRE_BoomerAMGSetNodalDiag_flt(amg_solver, nodal_diag); + HYPRE_BoomerAMGSetKeepSameSign_flt(amg_solver, keep_same_sign); + if (ns_coarse > -1) + { + HYPRE_BoomerAMGSetCycleNumSweeps_flt(amg_solver, ns_coarse, 3); + } + if (ns_down > -1) + { + HYPRE_BoomerAMGSetCycleNumSweeps_flt(amg_solver, ns_down, 1); + } + if (ns_up > -1) + { + HYPRE_BoomerAMGSetCycleNumSweeps_flt(amg_solver, ns_up, 2); + } + + // Set the preconditioner for PCG + HYPRE_PCGSetPrecondMatrix_flt(pcg_solver, (HYPRE_Matrix)A_flt); + + HYPRE_PCGSetPrecond_flt(pcg_solver, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve_flt, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup_flt, + amg_solver); + + HYPRE_PCGGetPrecond_flt(pcg_solver, &pcg_precond_gotten); + if (pcg_precond_gotten != amg_solver) + { + hypre_printf("HYPRE_ParCSRPCGGetPrecond got bad precond\n"); + return (-1); + } + else if (myid == 0) + { + hypre_printf("HYPRE_ParCSRPCGGetPrecond got good precond\n"); + } + } + else if (solver_id == 0) + { + if (myid == 0) { hypre_printf("\n\n***** Solver: SINGLE PRECISION DS-PCG *****\n"); } + } + // Setup PCG solver + HYPRE_PCGSetup_flt(pcg_solver, (HYPRE_Matrix)A_flt, (HYPRE_Vector)b_flt, (HYPRE_Vector)x_flt); + MPI_Barrier(MPI_COMM_WORLD); + hypre_EndTiming(time_index); + hypre_PrintTiming("Single precision Setup Time", MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + fflush(NULL); + + time_index = hypre_InitializeTiming("FLT Solve"); + MPI_Barrier(MPI_COMM_WORLD); + hypre_BeginTiming(time_index); + // PCG solve + HYPRE_PCGSolve_flt(pcg_solver, (HYPRE_Matrix)A_flt, (HYPRE_Vector)b_flt, (HYPRE_Vector)x_flt); + + MPI_Barrier(MPI_COMM_WORLD); + hypre_EndTiming(time_index); + hypre_PrintTiming("Single precision Solve Time", MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + HYPRE_PCGGetNumIterations_flt(pcg_solver, &num_iterations); + HYPRE_PCGGetFinalRelativeResidualNorm_flt(pcg_solver, &final_res_norm); + if (myid == 0) + { + hypre_printf("final relative residual norm = %e \n", final_res_norm); + hypre_printf("Iteration count = %d \n", num_iterations); + } + fflush(NULL); + // destroy pcg solver + HYPRE_ParCSRPCGDestroy_flt(pcg_solver); + if (solver_id == 1) { HYPRE_BoomerAMGDestroy_flt(amg_solver); } + } + // mixed-precision + { + /* reset solution vector */ + if (build_rhs_type < 4) { HYPRE_ParVectorSetConstantValues_dbl(x_dbl, zero); } + else { HYPRE_ParVectorSetRandomValues_dbl(x_dbl, 22775); } + + HYPRE_Solver amg_solver; + HYPRE_Solver pcg_solver; + HYPRE_Solver pcg_precond_gotten; + + time_index = hypre_InitializeTiming("DBL Setup"); + MPI_Barrier(MPI_COMM_WORLD); + hypre_BeginTiming(time_index); + // Create PCG solver + HYPRE_ParCSRPCGCreate_dbl(MPI_COMM_WORLD, &pcg_solver); + HYPRE_PCGSetMaxIter_dbl(pcg_solver, max_iter); + HYPRE_PCGSetTol_dbl(pcg_solver, tol); + HYPRE_PCGSetTwoNorm_dbl(pcg_solver, two_norm); + HYPRE_PCGSetPrintLevel_dbl(pcg_solver, ioutdat); + HYPRE_PCGSetFlex_dbl(pcg_solver, flex); + HYPRE_PCGSetRecomputeResidual_dbl(pcg_solver, 1); + + + /* Now set up the AMG preconditioner and specify any parameters */ + if (solver_id == 1) + { + if (myid == 0) { hypre_printf("\n\n***** Solver: MIXED PRECISION AMG-PCG *****\n"); } + HYPRE_PCGSetMaxIter_dbl(pcg_solver, mg_max_iter); + HYPRE_BoomerAMGCreate_flt(&amg_solver); + HYPRE_BoomerAMGSetPrintLevel_flt(amg_solver, poutdat); /* print amg solution info */ + HYPRE_BoomerAMGSetCoarsenType_flt(amg_solver, coarsen_type); + HYPRE_BoomerAMGSetInterpType_flt(amg_solver, interp_type); + HYPRE_BoomerAMGSetNumSweeps_flt(amg_solver, num_sweeps); + HYPRE_BoomerAMGSetTol_flt(amg_solver, (float)zero); /* conv. tolerance zero */ + HYPRE_BoomerAMGSetMaxIter_flt(amg_solver, 1); /* do only one iteration! */ + HYPRE_BoomerAMGSetStrongThreshold_flt(amg_solver, (float)strong_threshold); + HYPRE_BoomerAMGSetTruncFactor_flt(amg_solver, (float)trunc_factor); + HYPRE_BoomerAMGSetPMaxElmts_flt(amg_solver, P_max_elmts); + HYPRE_BoomerAMGSetNumSweeps_flt(amg_solver, num_sweeps); + if (relax_type > -1) { HYPRE_BoomerAMGSetRelaxType_flt(amg_solver, relax_type); } + if (relax_down > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType_flt(amg_solver, relax_down, 1); + } + if (relax_up > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType_flt(amg_solver, relax_up, 2); + } + if (relax_coarse > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType_flt(amg_solver, relax_coarse, 3); + } + HYPRE_BoomerAMGSetRelaxOrder_flt(amg_solver, relax_order); + HYPRE_BoomerAMGSetRelaxWt_flt(amg_solver, (float)relax_wt); + HYPRE_BoomerAMGSetOuterWt_flt(amg_solver, (float)outer_wt); + HYPRE_BoomerAMGSetMaxLevels_flt(amg_solver, max_levels); + HYPRE_BoomerAMGSetSmoothType_flt(amg_solver, smooth_type); + HYPRE_BoomerAMGSetSmoothNumSweeps_flt(amg_solver, smooth_num_sweeps); + HYPRE_BoomerAMGSetSmoothNumLevels_flt(amg_solver, smooth_num_levels); + HYPRE_BoomerAMGSetMaxRowSum_flt(amg_solver, (float)max_row_sum); + HYPRE_BoomerAMGSetDebugFlag_flt(amg_solver, debug_flag); + HYPRE_BoomerAMGSetNumFunctions_flt(amg_solver, num_functions); + HYPRE_BoomerAMGSetAggNumLevels_flt(amg_solver, agg_num_levels); + HYPRE_BoomerAMGSetAggInterpType_flt(amg_solver, agg_interp_type); + HYPRE_BoomerAMGSetAggTruncFactor_flt(amg_solver, (float)agg_trunc_factor); + HYPRE_BoomerAMGSetAggP12TruncFactor_flt(amg_solver, (float)agg_P12_trunc_factor); + HYPRE_BoomerAMGSetAggPMaxElmts_flt(amg_solver, agg_P_max_elmts); + HYPRE_BoomerAMGSetAggP12MaxElmts_flt(amg_solver, agg_P12_max_elmts); + HYPRE_BoomerAMGSetNumPaths_flt(amg_solver, num_paths); + HYPRE_BoomerAMGSetNodal_flt(amg_solver, nodal); + HYPRE_BoomerAMGSetNodalDiag_flt(amg_solver, nodal_diag); + HYPRE_BoomerAMGSetKeepSameSign_flt(amg_solver, keep_same_sign); + if (ns_coarse > -1) + { + HYPRE_BoomerAMGSetCycleNumSweeps_flt(amg_solver, ns_coarse, 3); + } + if (ns_down > -1) + { + HYPRE_BoomerAMGSetCycleNumSweeps_flt(amg_solver, ns_down, 1); + } + if (ns_up > -1) + { + HYPRE_BoomerAMGSetCycleNumSweeps_flt(amg_solver, ns_up, 2); + } + + // Set the preconditioner for PCG (single precision matrix) + HYPRE_PCGSetPrecondMatrix_dbl(pcg_solver, (HYPRE_Matrix)A_flt); + // Set the preconditioner for PCG. + // This actually sets a pointer to a single precision AMG solver. + // The setup and solve functions just allow us to accept double precision + // rhs and sol vectors from the PCG solver to do the preconditioner solve. + HYPRE_PCGSetPrecond_dbl(pcg_solver, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve_mp, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup_mp, + amg_solver); + + HYPRE_PCGGetPrecond_dbl(pcg_solver, &pcg_precond_gotten); + if (pcg_precond_gotten != amg_solver) + { + hypre_printf("HYPRE_ParCSRPCGGetPrecond got bad precond\n"); + return (-1); + } + else if (myid == 0) + { + hypre_printf("HYPRE_ParCSRPCGGetPrecond got good precond\n"); + } + } + else if (solver_id == 0) + { + if (myid == 0) { hypre_printf("\n\n***** Solver: MIXED PRECISION DS-PCG *****\n"); } + } + // Setup PCG solver (double precision) + HYPRE_PCGSetup_dbl(pcg_solver, (HYPRE_Matrix)A_dbl, (HYPRE_Vector)b_dbl, (HYPRE_Vector)x_dbl); + MPI_Barrier(MPI_COMM_WORLD); + hypre_EndTiming(time_index); + hypre_PrintTiming("Mixed precision Setup Time", MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + fflush(NULL); + + time_index = hypre_InitializeTiming("DBL Solve"); + MPI_Barrier(MPI_COMM_WORLD); + hypre_BeginTiming(time_index); + // PCG solve (double precision) + HYPRE_PCGSolve_dbl(pcg_solver, (HYPRE_Matrix)A_dbl, (HYPRE_Vector)b_dbl, (HYPRE_Vector)x_dbl); + + MPI_Barrier(MPI_COMM_WORLD); + hypre_EndTiming(time_index); + hypre_PrintTiming("Mixed precision Solve Time", MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + HYPRE_PCGGetNumIterations_dbl(pcg_solver, &num_iterations); + HYPRE_PCGGetFinalRelativeResidualNorm_dbl(pcg_solver, &dfinal_res_norm); + if (myid == 0) + { + hypre_printf("final relative residual norm = %e \n", dfinal_res_norm); + hypre_printf("Iteration count = %d \n", num_iterations); + } + fflush(NULL); + // destroy pcg solver + HYPRE_ParCSRPCGDestroy_dbl(pcg_solver); + if (solver_id == 1) { HYPRE_BoomerAMGDestroy_flt(amg_solver); } + } //end PCG + } + else if (solver_id < 4) //GMRES + { + // double-precision + { + /* reset solution vector */ + if (build_rhs_type < 4 || build_rhs_type == 6) { HYPRE_ParVectorSetConstantValues_dbl(x_dbl, zero); } + else { HYPRE_ParVectorSetRandomValues_dbl(x_dbl, 22775); } + + HYPRE_Solver amg_solver; + HYPRE_Solver pcg_solver; + HYPRE_Solver pcg_precond_gotten; + + time_index = hypre_InitializeTiming("DBL Setup"); + MPI_Barrier(MPI_COMM_WORLD); + hypre_BeginTiming(time_index); + // Create GMRES solver + HYPRE_ParCSRGMRESCreate_dbl(MPI_COMM_WORLD, &pcg_solver); + HYPRE_GMRESSetKDim_dbl(pcg_solver, k_dim); + HYPRE_GMRESSetMaxIter_dbl(pcg_solver, max_iter); + HYPRE_GMRESSetTol_dbl(pcg_solver, tol); + HYPRE_GMRESSetPrintLevel_dbl(pcg_solver, ioutdat); + // HYPRE_PCGSetRecomputeResidual_dbl(pcg_solver, recompute_res); + + + /* Now set up the AMG preconditioner and specify any parameters */ + if (solver_id == 3) + { + if (myid == 0) { hypre_printf("\n\n***** Solver: DOUBLE PRECISION AMG-GMRES *****\n"); } + + HYPRE_GMRESSetMaxIter_dbl(pcg_solver, mg_max_iter); + HYPRE_BoomerAMGCreate_dbl(&amg_solver); + HYPRE_BoomerAMGSetPrintLevel_dbl(amg_solver, poutdat); /* print amg solution info */ + HYPRE_BoomerAMGSetCoarsenType_dbl(amg_solver, coarsen_type); + HYPRE_BoomerAMGSetInterpType_dbl(amg_solver, interp_type); + HYPRE_BoomerAMGSetNumSweeps_dbl(amg_solver, num_sweeps); + HYPRE_BoomerAMGSetTol_dbl(amg_solver, 0.0); /* conv. tolerance zero */ + HYPRE_BoomerAMGSetMaxIter_dbl(amg_solver, 1); /* do only one iteration! */ + HYPRE_BoomerAMGSetStrongThreshold_dbl(amg_solver, strong_threshold); + HYPRE_BoomerAMGSetTruncFactor_dbl(amg_solver, trunc_factor); + HYPRE_BoomerAMGSetPMaxElmts_dbl(amg_solver, P_max_elmts); + HYPRE_BoomerAMGSetNumSweeps_dbl(amg_solver, num_sweeps); + if (relax_type > -1) { HYPRE_BoomerAMGSetRelaxType_dbl(amg_solver, relax_type); } + if (relax_down > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType_dbl(amg_solver, relax_down, 1); + } + if (relax_up > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType_dbl(amg_solver, relax_up, 2); + } + if (relax_coarse > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType_dbl(amg_solver, relax_coarse, 3); + } + HYPRE_BoomerAMGSetRelaxOrder_dbl(amg_solver, relax_order); + HYPRE_BoomerAMGSetRelaxWt_dbl(amg_solver, relax_wt); + HYPRE_BoomerAMGSetOuterWt_dbl(amg_solver, outer_wt); + HYPRE_BoomerAMGSetMaxLevels_dbl(amg_solver, max_levels); + HYPRE_BoomerAMGSetSmoothType_dbl(amg_solver, smooth_type); + HYPRE_BoomerAMGSetSmoothNumSweeps_dbl(amg_solver, smooth_num_sweeps); + HYPRE_BoomerAMGSetSmoothNumLevels_dbl(amg_solver, smooth_num_levels); + HYPRE_BoomerAMGSetMaxRowSum_dbl(amg_solver, max_row_sum); + HYPRE_BoomerAMGSetDebugFlag_dbl(amg_solver, debug_flag); + HYPRE_BoomerAMGSetNumFunctions_dbl(amg_solver, num_functions); + HYPRE_BoomerAMGSetAggNumLevels_dbl(amg_solver, agg_num_levels); + HYPRE_BoomerAMGSetAggInterpType_dbl(amg_solver, agg_interp_type); + HYPRE_BoomerAMGSetAggTruncFactor_dbl(amg_solver, agg_trunc_factor); + HYPRE_BoomerAMGSetAggP12TruncFactor_dbl(amg_solver, agg_P12_trunc_factor); + HYPRE_BoomerAMGSetAggPMaxElmts_dbl(amg_solver, agg_P_max_elmts); + HYPRE_BoomerAMGSetAggP12MaxElmts_dbl(amg_solver, agg_P12_max_elmts); + HYPRE_BoomerAMGSetNumPaths_dbl(amg_solver, num_paths); + HYPRE_BoomerAMGSetNodal_dbl(amg_solver, nodal); + HYPRE_BoomerAMGSetNodalDiag_dbl(amg_solver, nodal_diag); + HYPRE_BoomerAMGSetKeepSameSign_dbl(amg_solver, keep_same_sign); + if (ns_coarse > -1) + { + HYPRE_BoomerAMGSetCycleNumSweeps_dbl(amg_solver, ns_coarse, 3); + } + if (ns_down > -1) + { + HYPRE_BoomerAMGSetCycleNumSweeps_dbl(amg_solver, ns_down, 1); + } + if (ns_up > -1) + { + HYPRE_BoomerAMGSetCycleNumSweeps_dbl(amg_solver, ns_up, 2); + } + + // Set the preconditioner for GMRES + HYPRE_GMRESSetPrecondMatrix_dbl(pcg_solver, (HYPRE_Matrix)A_dbl); + + HYPRE_GMRESSetPrecond_dbl(pcg_solver, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve_dbl, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup_dbl, + amg_solver); + + HYPRE_GMRESGetPrecond_dbl(pcg_solver, &pcg_precond_gotten); + if (pcg_precond_gotten != amg_solver) + { + hypre_printf("HYPRE_ParCSRGMRESGetPrecond got bad precond\n"); + return (-1); + } + else if (myid == 0) + { + hypre_printf("HYPRE_ParCSRGMRESGetPrecond got good precond\n"); + } + } + else if (solver_id == 2) + { + if (myid == 0) { hypre_printf("\n\n***** Solver: DOUBLE PRECISION DS-GMRES *****\n"); } + } + // Setup GMRES solver + HYPRE_GMRESSetup_dbl(pcg_solver, (HYPRE_Matrix)A_dbl, (HYPRE_Vector)b_dbl, (HYPRE_Vector)x_dbl); + MPI_Barrier(MPI_COMM_WORLD); + hypre_EndTiming(time_index); + hypre_PrintTiming("Double precision Setup Time", MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + fflush(NULL); + + time_index = hypre_InitializeTiming("DBL Solve"); + MPI_Barrier(MPI_COMM_WORLD); + hypre_BeginTiming(time_index); + // GMRES solve + HYPRE_GMRESSolve_dbl(pcg_solver, (HYPRE_Matrix)A_dbl, (HYPRE_Vector)b_dbl, (HYPRE_Vector)x_dbl); + + MPI_Barrier(MPI_COMM_WORLD); + hypre_EndTiming(time_index); + hypre_PrintTiming("Double precision Solve Time", MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + HYPRE_GMRESGetNumIterations_dbl(pcg_solver, &num_iterations); + HYPRE_GMRESGetFinalRelativeResidualNorm_dbl(pcg_solver, &dfinal_res_norm); + if (myid == 0) + { + hypre_printf("final relative residual norm = %e \n", dfinal_res_norm); + hypre_printf("Iteration count = %d \n", num_iterations); + } + fflush(NULL); + // destroy pcg solver + HYPRE_ParCSRGMRESDestroy_dbl(pcg_solver); + if (solver_id == 3) { HYPRE_BoomerAMGDestroy_dbl(amg_solver); } + } + // Single precision + { + /* reset solution vector */ + if (build_rhs_type < 4) { HYPRE_ParVectorSetConstantValues_flt(x_flt, zero); } + else { HYPRE_ParVectorSetRandomValues_flt(x_flt, 22775); } + + HYPRE_Solver amg_solver; + HYPRE_Solver pcg_solver; + HYPRE_Solver pcg_precond_gotten; + + time_index = hypre_InitializeTiming("FLT Setup"); + MPI_Barrier(MPI_COMM_WORLD); + hypre_BeginTiming(time_index); + // Create GMRES solver + HYPRE_ParCSRGMRESCreate_flt(MPI_COMM_WORLD, &pcg_solver); + HYPRE_GMRESSetMaxIter_flt(pcg_solver, max_iter); + HYPRE_GMRESSetTol_flt(pcg_solver, (float)tol); + HYPRE_GMRESSetKDim_flt(pcg_solver, k_dim); + HYPRE_GMRESSetPrintLevel_flt(pcg_solver, ioutdat); + + /* Now set up the AMG preconditioner and specify any parameters */ + if (solver_id == 3) + { + if (myid == 0) { hypre_printf("\n\n***** Solver: SINGLE PRECISION AMG-GMRES *****\n"); } + HYPRE_GMRESSetMaxIter_flt(pcg_solver, mg_max_iter); + HYPRE_BoomerAMGCreate_flt(&amg_solver); + HYPRE_BoomerAMGSetPrintLevel_flt(amg_solver, poutdat); /* print amg solution info */ + HYPRE_BoomerAMGSetCoarsenType_flt(amg_solver, coarsen_type); + HYPRE_BoomerAMGSetInterpType_flt(amg_solver, interp_type); + HYPRE_BoomerAMGSetNumSweeps_flt(amg_solver, num_sweeps); + HYPRE_BoomerAMGSetTol_flt(amg_solver, (float)zero); /* conv. tolerance zero */ + HYPRE_BoomerAMGSetMaxIter_flt(amg_solver, 1); /* do only one iteration! */ + HYPRE_BoomerAMGSetStrongThreshold_flt(amg_solver, (float)strong_threshold); + HYPRE_BoomerAMGSetTruncFactor_flt(amg_solver, (float)trunc_factor); + HYPRE_BoomerAMGSetPMaxElmts_flt(amg_solver, P_max_elmts); + HYPRE_BoomerAMGSetNumSweeps_flt(amg_solver, num_sweeps); + if (relax_type > -1) { HYPRE_BoomerAMGSetRelaxType_flt(amg_solver, relax_type); } + if (relax_down > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType_flt(amg_solver, relax_down, 1); + } + if (relax_up > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType_flt(amg_solver, relax_up, 2); + } + if (relax_coarse > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType_flt(amg_solver, relax_coarse, 3); + } + HYPRE_BoomerAMGSetRelaxOrder_flt(amg_solver, relax_order); + HYPRE_BoomerAMGSetRelaxWt_flt(amg_solver, (float)relax_wt); + HYPRE_BoomerAMGSetOuterWt_flt(amg_solver, (float)outer_wt); + HYPRE_BoomerAMGSetMaxLevels_flt(amg_solver, max_levels); + HYPRE_BoomerAMGSetSmoothType_flt(amg_solver, smooth_type); + HYPRE_BoomerAMGSetSmoothNumSweeps_flt(amg_solver, smooth_num_sweeps); + HYPRE_BoomerAMGSetSmoothNumLevels_flt(amg_solver, smooth_num_levels); + HYPRE_BoomerAMGSetMaxRowSum_flt(amg_solver, (float)max_row_sum); + HYPRE_BoomerAMGSetDebugFlag_flt(amg_solver, debug_flag); + HYPRE_BoomerAMGSetNumFunctions_flt(amg_solver, num_functions); + HYPRE_BoomerAMGSetAggNumLevels_flt(amg_solver, agg_num_levels); + HYPRE_BoomerAMGSetAggInterpType_flt(amg_solver, agg_interp_type); + HYPRE_BoomerAMGSetAggTruncFactor_flt(amg_solver, (float)agg_trunc_factor); + HYPRE_BoomerAMGSetAggP12TruncFactor_flt(amg_solver, (float)agg_P12_trunc_factor); + HYPRE_BoomerAMGSetAggPMaxElmts_flt(amg_solver, agg_P_max_elmts); + HYPRE_BoomerAMGSetAggP12MaxElmts_flt(amg_solver, agg_P12_max_elmts); + HYPRE_BoomerAMGSetNumPaths_flt(amg_solver, num_paths); + HYPRE_BoomerAMGSetNodal_flt(amg_solver, nodal); + HYPRE_BoomerAMGSetNodalDiag_flt(amg_solver, nodal_diag); + HYPRE_BoomerAMGSetKeepSameSign_flt(amg_solver, keep_same_sign); + if (ns_coarse > -1) + { + HYPRE_BoomerAMGSetCycleNumSweeps_flt(amg_solver, ns_coarse, 3); + } + if (ns_down > -1) + { + HYPRE_BoomerAMGSetCycleNumSweeps_flt(amg_solver, ns_down, 1); + } + if (ns_up > -1) + { + HYPRE_BoomerAMGSetCycleNumSweeps_flt(amg_solver, ns_up, 2); + } + + // Set the preconditioner for GMRES + HYPRE_GMRESSetPrecondMatrix_flt(pcg_solver, (HYPRE_Matrix)A_flt); + + HYPRE_GMRESSetPrecond_flt(pcg_solver, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve_flt, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup_flt, + amg_solver); + + HYPRE_GMRESGetPrecond_flt(pcg_solver, &pcg_precond_gotten); + if (pcg_precond_gotten != amg_solver) + { + hypre_printf("HYPRE_ParCSRGMRESGetPrecond got bad precond\n"); + return (-1); + } + else if (myid == 0) + { + hypre_printf("HYPRE_ParCSRGMRESGetPrecond got good precond\n"); + } + } + else if (solver_id == 2) + { + if (myid == 0) { hypre_printf("\n\n***** Solver: SINGLE PRECISION DS-GMRES *****\n"); } + } + // Setup GMRES solver + HYPRE_GMRESSetup_flt(pcg_solver, (HYPRE_Matrix)A_flt, (HYPRE_Vector)b_flt, (HYPRE_Vector)x_flt); + MPI_Barrier(MPI_COMM_WORLD); + hypre_EndTiming(time_index); + hypre_PrintTiming("Single precision Setup Time", MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + fflush(NULL); + + time_index = hypre_InitializeTiming("FLT Solve"); + MPI_Barrier(MPI_COMM_WORLD); + hypre_BeginTiming(time_index); + // GMRES solve + HYPRE_GMRESSolve_flt(pcg_solver, (HYPRE_Matrix)A_flt, (HYPRE_Vector)b_flt, (HYPRE_Vector)x_flt); + + MPI_Barrier(MPI_COMM_WORLD); + hypre_EndTiming(time_index); + hypre_PrintTiming("Single precision Solve Time", MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + HYPRE_GMRESGetNumIterations_flt(pcg_solver, &num_iterations); + HYPRE_GMRESGetFinalRelativeResidualNorm_flt(pcg_solver, &final_res_norm); + if (myid == 0) + { + hypre_printf("final relative residual norm = %e \n", final_res_norm); + hypre_printf("Iteration count = %d \n", num_iterations); + } + fflush(NULL); + // destroy pcg solver + HYPRE_ParCSRGMRESDestroy_flt(pcg_solver); + if (solver_id == 3) { HYPRE_BoomerAMGDestroy_flt(amg_solver); } + } + // mixed-precision + { + /* reset solution vector */ + if (build_rhs_type < 4) { HYPRE_ParVectorSetConstantValues_dbl(x_dbl, zero); } + else { HYPRE_ParVectorSetRandomValues_dbl(x_dbl, 22775); } + + HYPRE_Solver amg_solver; + HYPRE_Solver pcg_solver; + HYPRE_Solver pcg_precond_gotten; + + time_index = hypre_InitializeTiming("DBL Setup"); + MPI_Barrier(MPI_COMM_WORLD); + hypre_BeginTiming(time_index); + // Create GMRES solver + HYPRE_ParCSRGMRESCreate_dbl(MPI_COMM_WORLD, &pcg_solver); + HYPRE_GMRESSetMaxIter_dbl(pcg_solver, max_iter); + HYPRE_GMRESSetTol_dbl(pcg_solver, tol); + HYPRE_GMRESSetKDim_dbl(pcg_solver, k_dim); + HYPRE_GMRESSetPrintLevel_dbl(pcg_solver, ioutdat); + + + /* Now set up the AMG preconditioner and specify any parameters */ + if (solver_id == 3) + { + if (myid == 0) { hypre_printf("\n\n***** Solver: MIXED PRECISION AMG-GMRES *****\n"); } + HYPRE_GMRESSetMaxIter_dbl(pcg_solver, mg_max_iter); + HYPRE_BoomerAMGCreate_flt(&amg_solver); + HYPRE_BoomerAMGSetPrintLevel_flt(amg_solver, poutdat); /* print amg solution info */ + HYPRE_BoomerAMGSetCoarsenType_flt(amg_solver, coarsen_type); + HYPRE_BoomerAMGSetInterpType_flt(amg_solver, interp_type); + HYPRE_BoomerAMGSetNumSweeps_flt(amg_solver, num_sweeps); + HYPRE_BoomerAMGSetTol_flt(amg_solver, (float)zero); /* conv. tolerance zero */ + HYPRE_BoomerAMGSetMaxIter_flt(amg_solver, 1); /* do only one iteration! */ + HYPRE_BoomerAMGSetStrongThreshold_flt(amg_solver, (float)strong_threshold); + HYPRE_BoomerAMGSetTruncFactor_flt(amg_solver, (float)trunc_factor); + HYPRE_BoomerAMGSetPMaxElmts_flt(amg_solver, P_max_elmts); + HYPRE_BoomerAMGSetNumSweeps_flt(amg_solver, num_sweeps); + if (relax_type > -1) { HYPRE_BoomerAMGSetRelaxType_flt(amg_solver, relax_type); } + if (relax_down > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType_flt(amg_solver, relax_down, 1); + } + if (relax_up > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType_flt(amg_solver, relax_up, 2); + } + if (relax_coarse > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType_flt(amg_solver, relax_coarse, 3); + } + HYPRE_BoomerAMGSetRelaxOrder_flt(amg_solver, relax_order); + HYPRE_BoomerAMGSetRelaxWt_flt(amg_solver, (float)relax_wt); + HYPRE_BoomerAMGSetOuterWt_flt(amg_solver, (float)outer_wt); + HYPRE_BoomerAMGSetMaxLevels_flt(amg_solver, max_levels); + HYPRE_BoomerAMGSetSmoothType_flt(amg_solver, smooth_type); + HYPRE_BoomerAMGSetSmoothNumSweeps_flt(amg_solver, smooth_num_sweeps); + HYPRE_BoomerAMGSetSmoothNumLevels_flt(amg_solver, smooth_num_levels); + HYPRE_BoomerAMGSetMaxRowSum_flt(amg_solver, (float)max_row_sum); + HYPRE_BoomerAMGSetDebugFlag_flt(amg_solver, debug_flag); + HYPRE_BoomerAMGSetNumFunctions_flt(amg_solver, num_functions); + HYPRE_BoomerAMGSetAggNumLevels_flt(amg_solver, agg_num_levels); + HYPRE_BoomerAMGSetAggInterpType_flt(amg_solver, agg_interp_type); + HYPRE_BoomerAMGSetAggTruncFactor_flt(amg_solver, (float)agg_trunc_factor); + HYPRE_BoomerAMGSetAggP12TruncFactor_flt(amg_solver, (float)agg_P12_trunc_factor); + HYPRE_BoomerAMGSetAggPMaxElmts_flt(amg_solver, agg_P_max_elmts); + HYPRE_BoomerAMGSetAggP12MaxElmts_flt(amg_solver, agg_P12_max_elmts); + HYPRE_BoomerAMGSetNumPaths_flt(amg_solver, num_paths); + HYPRE_BoomerAMGSetNodal_flt(amg_solver, nodal); + HYPRE_BoomerAMGSetNodalDiag_flt(amg_solver, nodal_diag); + HYPRE_BoomerAMGSetKeepSameSign_flt(amg_solver, keep_same_sign); + if (ns_coarse > -1) + { + HYPRE_BoomerAMGSetCycleNumSweeps_flt(amg_solver, ns_coarse, 3); + } + if (ns_down > -1) + { + HYPRE_BoomerAMGSetCycleNumSweeps_flt(amg_solver, ns_down, 1); + } + if (ns_up > -1) + { + HYPRE_BoomerAMGSetCycleNumSweeps_flt(amg_solver, ns_up, 2); + } + + // Set the preconditioner for GMRES (single precision matrix) + HYPRE_GMRESSetPrecondMatrix_dbl(pcg_solver, (HYPRE_Matrix)A_flt); + // Set the preconditioner for GMRES. + // This actually sets a pointer to a single precision AMG solver. + // The setup and solve functions just allow us to accept double precision + // rhs and sol vectors from the GMRES solver to do the preconditioner solve. + HYPRE_GMRESSetPrecond_dbl(pcg_solver, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve_mp, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup_mp, + amg_solver); + + HYPRE_GMRESGetPrecond_dbl(pcg_solver, &pcg_precond_gotten); + if (pcg_precond_gotten != amg_solver) + { + hypre_printf("HYPRE_ParCSRGMRESGetPrecond got bad precond\n"); + return (-1); + } + else if (myid == 0) + { + hypre_printf("HYPRE_ParCSRGMRESGetPrecond got good precond\n"); + } + } + else if (solver_id == 2) + { + if (myid == 0) { hypre_printf("\n\n***** Solver: MIXED PRECISION DS-GMRES *****\n"); } + } + // Setup GMRES solver (double precision) + HYPRE_GMRESSetup_dbl(pcg_solver, (HYPRE_Matrix)A_dbl, (HYPRE_Vector)b_dbl, (HYPRE_Vector)x_dbl); + MPI_Barrier(MPI_COMM_WORLD); + hypre_EndTiming(time_index); + hypre_PrintTiming("Mixed precision Setup Time", MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + fflush(NULL); + + time_index = hypre_InitializeTiming("DBL Solve"); + MPI_Barrier(MPI_COMM_WORLD); + hypre_BeginTiming(time_index); + // GMRES solve (double precision) + HYPRE_GMRESSolve_dbl(pcg_solver, (HYPRE_Matrix)A_dbl, (HYPRE_Vector)b_dbl, (HYPRE_Vector)x_dbl); + + MPI_Barrier(MPI_COMM_WORLD); + hypre_EndTiming(time_index); + hypre_PrintTiming("Mixed precision Solve Time", MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + HYPRE_GMRESGetNumIterations_dbl(pcg_solver, &num_iterations); + HYPRE_GMRESGetFinalRelativeResidualNorm_dbl(pcg_solver, &dfinal_res_norm); + if (myid == 0) + { + hypre_printf("final relative residual norm = %e \n", dfinal_res_norm); + hypre_printf("Iteration count = %d \n", num_iterations); + } + fflush(NULL); + // destroy gmres solver + HYPRE_ParCSRGMRESDestroy_dbl(pcg_solver); + if (solver_id == 3) { HYPRE_BoomerAMGDestroy_flt(amg_solver); } + } // end GMRES + } + // BiCGSTAB solve + else if (solver_id < 6) + { + // Double precision + { + /* reset solution vector */ + if (build_rhs_type < 4 || build_rhs_type == 6) { HYPRE_ParVectorSetConstantValues_dbl(x_dbl, zero); } + else { HYPRE_ParVectorSetRandomValues_dbl(x_dbl, 22775); } + + HYPRE_Solver amg_solver; + HYPRE_Solver pcg_solver; + HYPRE_Solver pcg_precond_gotten; + + time_index = hypre_InitializeTiming("DBL Setup"); + MPI_Barrier(MPI_COMM_WORLD); + hypre_BeginTiming(time_index); + // Create BiCGSTAB solver + HYPRE_ParCSRBiCGSTABCreate_dbl(MPI_COMM_WORLD, &pcg_solver); + HYPRE_BiCGSTABSetMaxIter_dbl(pcg_solver, max_iter); + HYPRE_BiCGSTABSetTol_dbl(pcg_solver, tol); + HYPRE_BiCGSTABSetPrintLevel_dbl(pcg_solver, ioutdat); + + + /* Now set up the AMG preconditioner and specify any parameters */ + if (solver_id == 5) + { + if (myid == 0) { hypre_printf("\n\n***** Solver: DOUBLE PRECISION AMG-BiCGSTAB *****\n"); } + + HYPRE_BiCGSTABSetMaxIter_dbl(pcg_solver, mg_max_iter); + HYPRE_BoomerAMGCreate_dbl(&amg_solver); + HYPRE_BoomerAMGSetPrintLevel_dbl(amg_solver, poutdat); /* print amg solution info */ + HYPRE_BoomerAMGSetCoarsenType_dbl(amg_solver, coarsen_type); + HYPRE_BoomerAMGSetInterpType_dbl(amg_solver, interp_type); + HYPRE_BoomerAMGSetNumSweeps_dbl(amg_solver, num_sweeps); + HYPRE_BoomerAMGSetTol_dbl(amg_solver, 0.0); /* conv. tolerance zero */ + HYPRE_BoomerAMGSetMaxIter_dbl(amg_solver, 1); /* do only one iteration! */ + HYPRE_BoomerAMGSetStrongThreshold_dbl(amg_solver, strong_threshold); + HYPRE_BoomerAMGSetTruncFactor_dbl(amg_solver, trunc_factor); + HYPRE_BoomerAMGSetPMaxElmts_dbl(amg_solver, P_max_elmts); + HYPRE_BoomerAMGSetNumSweeps_dbl(amg_solver, num_sweeps); + if (relax_type > -1) { HYPRE_BoomerAMGSetRelaxType_dbl(amg_solver, relax_type); } + if (relax_down > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType_dbl(amg_solver, relax_down, 1); + } + if (relax_up > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType_dbl(amg_solver, relax_up, 2); + } + if (relax_coarse > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType_dbl(amg_solver, relax_coarse, 3); + } + HYPRE_BoomerAMGSetRelaxOrder_dbl(amg_solver, relax_order); + HYPRE_BoomerAMGSetRelaxWt_dbl(amg_solver, relax_wt); + HYPRE_BoomerAMGSetOuterWt_dbl(amg_solver, outer_wt); + HYPRE_BoomerAMGSetMaxLevels_dbl(amg_solver, max_levels); + HYPRE_BoomerAMGSetSmoothType_dbl(amg_solver, smooth_type); + HYPRE_BoomerAMGSetSmoothNumSweeps_dbl(amg_solver, smooth_num_sweeps); + HYPRE_BoomerAMGSetSmoothNumLevels_dbl(amg_solver, smooth_num_levels); + HYPRE_BoomerAMGSetMaxRowSum_dbl(amg_solver, max_row_sum); + HYPRE_BoomerAMGSetDebugFlag_dbl(amg_solver, debug_flag); + HYPRE_BoomerAMGSetNumFunctions_dbl(amg_solver, num_functions); + HYPRE_BoomerAMGSetAggNumLevels_dbl(amg_solver, agg_num_levels); + HYPRE_BoomerAMGSetAggInterpType_dbl(amg_solver, agg_interp_type); + HYPRE_BoomerAMGSetAggTruncFactor_dbl(amg_solver, agg_trunc_factor); + HYPRE_BoomerAMGSetAggP12TruncFactor_dbl(amg_solver, agg_P12_trunc_factor); + HYPRE_BoomerAMGSetAggPMaxElmts_dbl(amg_solver, agg_P_max_elmts); + HYPRE_BoomerAMGSetAggP12MaxElmts_dbl(amg_solver, agg_P12_max_elmts); + HYPRE_BoomerAMGSetNumPaths_dbl(amg_solver, num_paths); + HYPRE_BoomerAMGSetNodal_dbl(amg_solver, nodal); + HYPRE_BoomerAMGSetNodalDiag_dbl(amg_solver, nodal_diag); + HYPRE_BoomerAMGSetKeepSameSign_dbl(amg_solver, keep_same_sign); + if (ns_coarse > -1) + { + HYPRE_BoomerAMGSetCycleNumSweeps_dbl(amg_solver, ns_coarse, 3); + } + if (ns_down > -1) + { + HYPRE_BoomerAMGSetCycleNumSweeps_dbl(amg_solver, ns_down, 1); + } + if (ns_up > -1) + { + HYPRE_BoomerAMGSetCycleNumSweeps_dbl(amg_solver, ns_up, 2); + } + + // Set the preconditioner for BiCGSTAB + HYPRE_BiCGSTABSetPrecondMatrix_dbl(pcg_solver, (HYPRE_Matrix)A_dbl); + + HYPRE_BiCGSTABSetPrecond_dbl(pcg_solver, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve_dbl, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup_dbl, + amg_solver); + + HYPRE_BiCGSTABGetPrecond_dbl(pcg_solver, &pcg_precond_gotten); + if (pcg_precond_gotten != amg_solver) + { + hypre_printf("HYPRE_ParCSRBiCGSTABGetPrecond got bad precond\n"); + return (-1); + } + else if (myid == 0) + { + hypre_printf("HYPRE_ParCSRBiCGSTABGetPrecond got good precond\n"); + } + } + else if (solver_id == 4) + { + if (myid == 0) { hypre_printf("\n\n***** Solver: DOUBLE PRECISION DS-BiCGSTAB *****\n"); } + } + // Setup BiCGSTAB solver + HYPRE_BiCGSTABSetup_dbl(pcg_solver, (HYPRE_Matrix)A_dbl, (HYPRE_Vector)b_dbl, (HYPRE_Vector)x_dbl); + MPI_Barrier(MPI_COMM_WORLD); + hypre_EndTiming(time_index); + hypre_PrintTiming("Double precision Setup Time", MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + fflush(NULL); + + time_index = hypre_InitializeTiming("DBL Solve"); + MPI_Barrier(MPI_COMM_WORLD); + hypre_BeginTiming(time_index); + // BiCGSTAB solve + HYPRE_BiCGSTABSolve_dbl(pcg_solver, (HYPRE_Matrix)A_dbl, (HYPRE_Vector)b_dbl, (HYPRE_Vector)x_dbl); + + MPI_Barrier(MPI_COMM_WORLD); + hypre_EndTiming(time_index); + hypre_PrintTiming("Double precision Solve Time", MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + HYPRE_BiCGSTABGetNumIterations_dbl(pcg_solver, &num_iterations); + HYPRE_BiCGSTABGetFinalRelativeResidualNorm_dbl(pcg_solver, &dfinal_res_norm); + if (myid == 0) + { + hypre_printf("final relative residual norm = %e \n", dfinal_res_norm); + hypre_printf("Iteration count = %d \n", num_iterations); + } + fflush(NULL); + // destroy pcg solver + HYPRE_ParCSRBiCGSTABDestroy_dbl(pcg_solver); + if (solver_id == 5) { HYPRE_BoomerAMGDestroy_dbl(amg_solver); } + } + // Single precision + { + /* reset solution vector */ + if (build_rhs_type < 4) { HYPRE_ParVectorSetConstantValues_flt(x_flt, zero); } + else { HYPRE_ParVectorSetRandomValues_flt(x_flt, 22775); } + + HYPRE_Solver amg_solver; + HYPRE_Solver pcg_solver; + HYPRE_Solver pcg_precond_gotten; + + time_index = hypre_InitializeTiming("FLT Setup"); + MPI_Barrier(MPI_COMM_WORLD); + hypre_BeginTiming(time_index); + // Create BiCGSTAB solver + HYPRE_ParCSRBiCGSTABCreate_flt(MPI_COMM_WORLD, &pcg_solver); + HYPRE_BiCGSTABSetMaxIter_flt(pcg_solver, max_iter); + HYPRE_BiCGSTABSetTol_flt(pcg_solver, (float)tol); + HYPRE_BiCGSTABSetPrintLevel_flt(pcg_solver, ioutdat); + // HYPRE_BiCGSTABSetRecomputeResidual_flt(pcg_solver, recompute_res); + + + /* Now set up the AMG preconditioner and specify any parameters */ + if (solver_id == 5) + { + if (myid == 0) { hypre_printf("\n\n***** Solver: SINGLE PRECISION AMG-BiCGSTAB *****\n"); } + HYPRE_BiCGSTABSetMaxIter_flt(pcg_solver, mg_max_iter); + HYPRE_BoomerAMGCreate_flt(&amg_solver); + HYPRE_BoomerAMGSetPrintLevel_flt(amg_solver, poutdat); /* print amg solution info */ + HYPRE_BoomerAMGSetCoarsenType_flt(amg_solver, coarsen_type); + HYPRE_BoomerAMGSetInterpType_flt(amg_solver, interp_type); + HYPRE_BoomerAMGSetNumSweeps_flt(amg_solver, num_sweeps); + HYPRE_BoomerAMGSetTol_flt(amg_solver, (float)zero); /* conv. tolerance zero */ + HYPRE_BoomerAMGSetMaxIter_flt(amg_solver, 1); /* do only one iteration! */ + HYPRE_BoomerAMGSetStrongThreshold_flt(amg_solver, (float)strong_threshold); + HYPRE_BoomerAMGSetTruncFactor_flt(amg_solver, (float)trunc_factor); + HYPRE_BoomerAMGSetPMaxElmts_flt(amg_solver, P_max_elmts); + HYPRE_BoomerAMGSetNumSweeps_flt(amg_solver, num_sweeps); + if (relax_type > -1) { HYPRE_BoomerAMGSetRelaxType_flt(amg_solver, relax_type); } + if (relax_down > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType_flt(amg_solver, relax_down, 1); + } + if (relax_up > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType_flt(amg_solver, relax_up, 2); + } + if (relax_coarse > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType_flt(amg_solver, relax_coarse, 3); + } + HYPRE_BoomerAMGSetRelaxOrder_flt(amg_solver, relax_order); + HYPRE_BoomerAMGSetRelaxWt_flt(amg_solver, (float)relax_wt); + HYPRE_BoomerAMGSetOuterWt_flt(amg_solver, (float)outer_wt); + HYPRE_BoomerAMGSetMaxLevels_flt(amg_solver, max_levels); + HYPRE_BoomerAMGSetSmoothType_flt(amg_solver, smooth_type); + HYPRE_BoomerAMGSetSmoothNumSweeps_flt(amg_solver, smooth_num_sweeps); + HYPRE_BoomerAMGSetSmoothNumLevels_flt(amg_solver, smooth_num_levels); + HYPRE_BoomerAMGSetMaxRowSum_flt(amg_solver, (float)max_row_sum); + HYPRE_BoomerAMGSetDebugFlag_flt(amg_solver, debug_flag); + HYPRE_BoomerAMGSetNumFunctions_flt(amg_solver, num_functions); + HYPRE_BoomerAMGSetAggNumLevels_flt(amg_solver, agg_num_levels); + HYPRE_BoomerAMGSetAggInterpType_flt(amg_solver, agg_interp_type); + HYPRE_BoomerAMGSetAggTruncFactor_flt(amg_solver, (float)agg_trunc_factor); + HYPRE_BoomerAMGSetAggP12TruncFactor_flt(amg_solver, (float)agg_P12_trunc_factor); + HYPRE_BoomerAMGSetAggPMaxElmts_flt(amg_solver, agg_P_max_elmts); + HYPRE_BoomerAMGSetAggP12MaxElmts_flt(amg_solver, agg_P12_max_elmts); + HYPRE_BoomerAMGSetNumPaths_flt(amg_solver, num_paths); + HYPRE_BoomerAMGSetNodal_flt(amg_solver, nodal); + HYPRE_BoomerAMGSetNodalDiag_flt(amg_solver, nodal_diag); + HYPRE_BoomerAMGSetKeepSameSign_flt(amg_solver, keep_same_sign); + if (ns_coarse > -1) + { + HYPRE_BoomerAMGSetCycleNumSweeps_flt(amg_solver, ns_coarse, 3); + } + if (ns_down > -1) + { + HYPRE_BoomerAMGSetCycleNumSweeps_flt(amg_solver, ns_down, 1); + } + if (ns_up > -1) + { + HYPRE_BoomerAMGSetCycleNumSweeps_flt(amg_solver, ns_up, 2); + } + + // Set the preconditioner for BiCGSTAB + HYPRE_BiCGSTABSetPrecondMatrix_flt(pcg_solver, (HYPRE_Matrix)A_flt); + + HYPRE_BiCGSTABSetPrecond_flt(pcg_solver, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve_flt, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup_flt, + amg_solver); + + HYPRE_BiCGSTABGetPrecond_flt(pcg_solver, &pcg_precond_gotten); + if (pcg_precond_gotten != amg_solver) + { + hypre_printf("HYPRE_ParCSRBiCGSTABGetPrecond got bad precond\n"); + return (-1); + } + else if (myid == 0) + { + hypre_printf("HYPRE_ParCSRBiCGSTABGetPrecond got good precond\n"); + } + } + else if (solver_id == 4) + { + if (myid == 0) { hypre_printf("\n\n***** Solver: SINGLE PRECISION DS-BiCGSTAB *****\n"); } + } + // Setup BiCGSTAB solver + HYPRE_BiCGSTABSetup_flt(pcg_solver, (HYPRE_Matrix)A_flt, (HYPRE_Vector)b_flt, (HYPRE_Vector)x_flt); + MPI_Barrier(MPI_COMM_WORLD); + hypre_EndTiming(time_index); + hypre_PrintTiming("Single precision Setup Time", MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + fflush(NULL); + + time_index = hypre_InitializeTiming("FLT Solve"); + MPI_Barrier(MPI_COMM_WORLD); + hypre_BeginTiming(time_index); + // BiCGSTAB solve + HYPRE_BiCGSTABSolve_flt(pcg_solver, (HYPRE_Matrix)A_flt, (HYPRE_Vector)b_flt, (HYPRE_Vector)x_flt); + + MPI_Barrier(MPI_COMM_WORLD); + hypre_EndTiming(time_index); + hypre_PrintTiming("Single precision Solve Time", MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + HYPRE_BiCGSTABGetNumIterations_flt(pcg_solver, &num_iterations); + HYPRE_BiCGSTABGetFinalRelativeResidualNorm_flt(pcg_solver, &final_res_norm); + if (myid == 0) + { + hypre_printf("final relative residual norm = %e \n", final_res_norm); + hypre_printf("Iteration count = %d \n", num_iterations); + } + fflush(NULL); + // destroy pcg solver + HYPRE_ParCSRBiCGSTABDestroy_flt(pcg_solver); + if (solver_id == 5) { HYPRE_BoomerAMGDestroy_flt(amg_solver); } + } + // mixed-precision + { + /* reset solution vector */ + if (build_rhs_type < 4) { HYPRE_ParVectorSetConstantValues_dbl(x_dbl, zero); } + else { HYPRE_ParVectorSetRandomValues_dbl(x_dbl, 22775); } + + HYPRE_Solver amg_solver; + HYPRE_Solver pcg_solver; + HYPRE_Solver pcg_precond_gotten; + + time_index = hypre_InitializeTiming("DBL Setup"); + MPI_Barrier(MPI_COMM_WORLD); + hypre_BeginTiming(time_index); + // Create BiCGSTAB solver + HYPRE_ParCSRBiCGSTABCreate_dbl(MPI_COMM_WORLD, &pcg_solver); + HYPRE_BiCGSTABSetMaxIter_dbl(pcg_solver, max_iter); + HYPRE_BiCGSTABSetTol_dbl(pcg_solver, tol); + HYPRE_BiCGSTABSetPrintLevel_dbl(pcg_solver, ioutdat); + // HYPRE_BiCGSTABSetRecomputeResidual_dbl(pcg_solver, recompute_res); + + + /* Now set up the AMG preconditioner and specify any parameters */ + if (solver_id == 5) + { + if (myid == 0) { hypre_printf("\n\n***** Solver: MIXED PRECISION AMG-BiCGSTAB *****\n"); } + HYPRE_BiCGSTABSetMaxIter_dbl(pcg_solver, mg_max_iter); + HYPRE_BoomerAMGCreate_flt(&amg_solver); + HYPRE_BoomerAMGSetPrintLevel_flt(amg_solver, poutdat); /* print amg solution info */ + HYPRE_BoomerAMGSetCoarsenType_flt(amg_solver, coarsen_type); + HYPRE_BoomerAMGSetInterpType_flt(amg_solver, interp_type); + HYPRE_BoomerAMGSetNumSweeps_flt(amg_solver, num_sweeps); + HYPRE_BoomerAMGSetTol_flt(amg_solver, (float)zero); /* conv. tolerance zero */ + HYPRE_BoomerAMGSetMaxIter_flt(amg_solver, 1); /* do only one iteration! */ + HYPRE_BoomerAMGSetStrongThreshold_flt(amg_solver, (float)strong_threshold); + HYPRE_BoomerAMGSetTruncFactor_flt(amg_solver, (float)trunc_factor); + HYPRE_BoomerAMGSetPMaxElmts_flt(amg_solver, P_max_elmts); + HYPRE_BoomerAMGSetNumSweeps_flt(amg_solver, num_sweeps); + if (relax_type > -1) { HYPRE_BoomerAMGSetRelaxType_flt(amg_solver, relax_type); } + if (relax_down > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType_flt(amg_solver, relax_down, 1); + } + if (relax_up > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType_flt(amg_solver, relax_up, 2); + } + if (relax_coarse > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType_flt(amg_solver, relax_coarse, 3); + } + HYPRE_BoomerAMGSetRelaxOrder_flt(amg_solver, relax_order); + HYPRE_BoomerAMGSetRelaxWt_flt(amg_solver, (float)relax_wt); + HYPRE_BoomerAMGSetOuterWt_flt(amg_solver, (float)outer_wt); + HYPRE_BoomerAMGSetMaxLevels_flt(amg_solver, max_levels); + HYPRE_BoomerAMGSetSmoothType_flt(amg_solver, smooth_type); + HYPRE_BoomerAMGSetSmoothNumSweeps_flt(amg_solver, smooth_num_sweeps); + HYPRE_BoomerAMGSetSmoothNumLevels_flt(amg_solver, smooth_num_levels); + HYPRE_BoomerAMGSetMaxRowSum_flt(amg_solver, (float)max_row_sum); + HYPRE_BoomerAMGSetDebugFlag_flt(amg_solver, debug_flag); + HYPRE_BoomerAMGSetNumFunctions_flt(amg_solver, num_functions); + HYPRE_BoomerAMGSetAggNumLevels_flt(amg_solver, agg_num_levels); + HYPRE_BoomerAMGSetAggInterpType_flt(amg_solver, agg_interp_type); + HYPRE_BoomerAMGSetAggTruncFactor_flt(amg_solver, (float)agg_trunc_factor); + HYPRE_BoomerAMGSetAggP12TruncFactor_flt(amg_solver, (float)agg_P12_trunc_factor); + HYPRE_BoomerAMGSetAggPMaxElmts_flt(amg_solver, agg_P_max_elmts); + HYPRE_BoomerAMGSetAggP12MaxElmts_flt(amg_solver, agg_P12_max_elmts); + HYPRE_BoomerAMGSetNumPaths_flt(amg_solver, num_paths); + HYPRE_BoomerAMGSetNodal_flt(amg_solver, nodal); + HYPRE_BoomerAMGSetNodalDiag_flt(amg_solver, nodal_diag); + HYPRE_BoomerAMGSetKeepSameSign_flt(amg_solver, keep_same_sign); + if (ns_coarse > -1) + { + HYPRE_BoomerAMGSetCycleNumSweeps_flt(amg_solver, ns_coarse, 3); + } + if (ns_down > -1) + { + HYPRE_BoomerAMGSetCycleNumSweeps_flt(amg_solver, ns_down, 1); + } + if (ns_up > -1) + { + HYPRE_BoomerAMGSetCycleNumSweeps_flt(amg_solver, ns_up, 2); + } + + // Set the preconditioner for BiCGSTAB (single precision matrix) + HYPRE_BiCGSTABSetPrecondMatrix_dbl(pcg_solver, (HYPRE_Matrix)A_flt); + // Set the preconditioner for BiCGSTAB. + // This actually sets a pointer to a single precision AMG solver. + // The setup and solve functions just allow us to accept double precision + // rhs and sol vectors from the BiCGSTAB solver to do the preconditioner solve. + HYPRE_BiCGSTABSetPrecond_dbl(pcg_solver, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve_mp, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup_mp, + amg_solver); + + HYPRE_BiCGSTABGetPrecond_dbl(pcg_solver, &pcg_precond_gotten); + if (pcg_precond_gotten != amg_solver) + { + hypre_printf("HYPRE_ParCSRBiCGSTABGetPrecond got bad precond\n"); + return (-1); + } + else if (myid == 0) + { + hypre_printf("HYPRE_ParCSRBiCGSTABGetPrecond got good precond\n"); + } + } + else if (solver_id == 4) + { + if (myid == 0) { hypre_printf("\n\n***** Solver: MIXED PRECISION DS-BiCGSTAB *****\n"); } + } + // Setup BiCGSTAB solver (double precision) + HYPRE_BiCGSTABSetup_dbl(pcg_solver, (HYPRE_Matrix)A_dbl, (HYPRE_Vector)b_dbl, (HYPRE_Vector)x_dbl); + MPI_Barrier(MPI_COMM_WORLD); + hypre_EndTiming(time_index); + hypre_PrintTiming("Mixed precision Setup Time", MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + fflush(NULL); + + time_index = hypre_InitializeTiming("DBL Solve"); + MPI_Barrier(MPI_COMM_WORLD); + hypre_BeginTiming(time_index); + // BiCGSTAB solve (double precision) + HYPRE_BiCGSTABSolve_dbl(pcg_solver, (HYPRE_Matrix)A_dbl, (HYPRE_Vector)b_dbl, (HYPRE_Vector)x_dbl); + + MPI_Barrier(MPI_COMM_WORLD); + hypre_EndTiming(time_index); + hypre_PrintTiming("Mixed precision Solve Time", MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + HYPRE_BiCGSTABGetNumIterations_dbl(pcg_solver, &num_iterations); + HYPRE_BiCGSTABGetFinalRelativeResidualNorm_dbl(pcg_solver, &dfinal_res_norm); + if (myid == 0) + { + hypre_printf("final relative residual norm = %e \n", dfinal_res_norm); + hypre_printf("Iteration count = %d \n", num_iterations); + } + fflush(NULL); + // destroy pcg solver + HYPRE_ParCSRBiCGSTABDestroy_dbl(pcg_solver); + if (solver_id == 5) { HYPRE_BoomerAMGDestroy_flt(amg_solver); } + } //end BiCGSTAB + } + + /* Clean up */ + HYPRE_IJVectorDestroy_flt(ij_b_flt); + HYPRE_IJVectorDestroy_flt(ij_x_flt); + + HYPRE_IJVectorDestroy_dbl(ij_b_dbl); + HYPRE_IJVectorDestroy_dbl(ij_x_dbl); + + /* Finalize MPI*/ + MPI_Finalize(); + + return (0); +} + +HYPRE_Int HYPRE_DefectCorrectionSolver(HYPRE_ParCSRMatrix A, + HYPRE_ParCSRMatrix B, + HYPRE_ParVector x, + HYPRE_ParVector b, + HYPRE_Solver solver, + HYPRE_PtrToSolverFcn approx_solve, + HYPRE_Int maxits) +{ + + + + return 0; + +} +/*---------------------------------------------------------------------- + * Build standard 7-point laplacian in 3D with grid and anisotropy. + * Parameters given in command line. + *----------------------------------------------------------------------*/ + +HYPRE_Int +BuildParLaplacian_mp( HYPRE_Int argc, + char *argv[], + HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_flt_ptr, + HYPRE_ParCSRMatrix *A_dbl_ptr ) +{ + HYPRE_BigInt nx, ny, nz; + HYPRE_Int P, Q, R; + double cx, cy, cz; + + HYPRE_ParCSRMatrix A_flt; + HYPRE_ParCSRMatrix A_dbl; + + HYPRE_Int num_procs, myid; + HYPRE_Int p, q, r; + HYPRE_Int num_fun = 1; + double *values_dbl; + float *values_flt; + double *mtrx_dbl; + float *mtrx_flt; + + HYPRE_Int sys_opt = 0; + HYPRE_Int i; + + + /*----------------------------------------------------------- + * Initialize some stuff + *-----------------------------------------------------------*/ + + MPI_Comm_size(MPI_COMM_WORLD, &num_procs ); + MPI_Comm_rank(MPI_COMM_WORLD, &myid ); + + /*----------------------------------------------------------- + * Set defaults + *-----------------------------------------------------------*/ + + nx = 10; + ny = 10; + nz = 10; + + P = 1; + Q = num_procs; + R = 1; + + cx = 1.; + cy = 1.; + cz = 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 if ( strcmp(argv[arg_index], "-c") == 0 ) + { + 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 ) + { + arg_index++; + num_fun = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-sysL_opt") == 0 ) + { + arg_index++; + sys_opt = 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: num_fun = %d\n", num_fun); + 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_dbl = (double*) calloc(4, sizeof(double)); + values_flt = (float*) calloc(4, sizeof(float)); + + values_dbl[1] = -cx; + values_dbl[2] = -cy; + values_dbl[3] = -cz; + values_flt[1] = -(float)cx; + values_flt[2] = -(float)cy; + values_flt[3] = -(float)cz; + + values_dbl[0] = 0.; + values_flt[0] = 0.; + if (nx > 1) + { + values_dbl[0] += 2.0 * cx; + values_flt[0] += 2.0 * (float)cx; + } + if (ny > 1) + { + values_dbl[0] += 2.0 * cy; + values_flt[0] += 2.0 * (float)cy; + } + if (nz > 1) + { + values_dbl[0] += 2.0 * cz; + values_flt[0] += 2.0 * (float)cz; + } + + if (num_fun == 1) + { + A_dbl = (HYPRE_ParCSRMatrix) GenerateLaplacian_dbl(MPI_COMM_WORLD, + nx, ny, nz, P, Q, R, p, q, r, values_dbl); + A_flt = (HYPRE_ParCSRMatrix) GenerateLaplacian_flt(MPI_COMM_WORLD, + nx, ny, nz, P, Q, R, p, q, r, values_flt); + } + else + { + mtrx_dbl = (double*) calloc(num_fun * num_fun, sizeof(double)); + mtrx_flt = (float*) calloc(num_fun * num_fun, sizeof(float)); + + if (num_fun == 2) + { + if (sys_opt == 1) /* identity */ + { + mtrx_dbl[0] = 1.0; + mtrx_dbl[1] = 0.0; + mtrx_dbl[2] = 0.0; + mtrx_dbl[3] = 1.0; + } + else if (sys_opt == 2) + { + mtrx_dbl[0] = 1.0; + mtrx_dbl[1] = 0.0; + mtrx_dbl[2] = 0.0; + mtrx_dbl[3] = 20.0; + } + else if (sys_opt == 3) /* similar to barry's talk - ex1 */ + { + mtrx_dbl[0] = 1.0; + mtrx_dbl[1] = 2.0; + mtrx_dbl[2] = 2.0; + mtrx_dbl[3] = 1.0; + } + else if (sys_opt == 4) /* can use with vcoef to get barry's ex*/ + { + mtrx_dbl[0] = 1.0; + mtrx_dbl[1] = 1.0; + mtrx_dbl[2] = 1.0; + mtrx_dbl[3] = 1.0; + } + else if (sys_opt == 5) /* barry's talk - ex1 */ + { + mtrx_dbl[0] = 1.0; + mtrx_dbl[1] = 1.1; + mtrx_dbl[2] = 1.1; + mtrx_dbl[3] = 1.0; + } + else if (sys_opt == 6) /* */ + { + mtrx_dbl[0] = 1.1; + mtrx_dbl[1] = 1.0; + mtrx_dbl[2] = 1.0; + mtrx_dbl[3] = 1.1; + } + + else /* == 0 */ + { + mtrx_dbl[0] = 2; + mtrx_dbl[1] = 1; + mtrx_dbl[2] = 1; + mtrx_dbl[3] = 2; + } + } + else if (num_fun == 3) + { + if (sys_opt == 1) + { + mtrx_dbl[0] = 1.0; + mtrx_dbl[1] = 0.0; + mtrx_dbl[2] = 0.0; + mtrx_dbl[3] = 0.0; + mtrx_dbl[4] = 1.0; + mtrx_dbl[5] = 0.0; + mtrx_dbl[6] = 0.0; + mtrx_dbl[7] = 0.0; + mtrx_dbl[8] = 1.0; + } + else if (sys_opt == 2) + { + mtrx_dbl[0] = 1.0; + mtrx_dbl[1] = 0.0; + mtrx_dbl[2] = 0.0; + mtrx_dbl[3] = 0.0; + mtrx_dbl[4] = 20.0; + mtrx_dbl[5] = 0.0; + mtrx_dbl[6] = 0.0; + mtrx_dbl[7] = 0.0; + mtrx_dbl[8] = .01; + } + else if (sys_opt == 3) + { + mtrx_dbl[0] = 1.01; + mtrx_dbl[1] = 1; + mtrx_dbl[2] = 0.0; + mtrx_dbl[3] = 1; + mtrx_dbl[4] = 2; + mtrx_dbl[5] = 1; + mtrx_dbl[6] = 0.0; + mtrx_dbl[7] = 1; + mtrx_dbl[8] = 1.01; + } + else if (sys_opt == 4) /* barry ex4 */ + { + mtrx_dbl[0] = 3; + mtrx_dbl[1] = 1; + mtrx_dbl[2] = 0.0; + mtrx_dbl[3] = 1; + mtrx_dbl[4] = 4; + mtrx_dbl[5] = 2; + mtrx_dbl[6] = 0.0; + mtrx_dbl[7] = 2; + mtrx_dbl[8] = .25; + } + else /* == 0 */ + { + mtrx_dbl[0] = 2.0; + mtrx_dbl[1] = 1.0; + mtrx_dbl[2] = 0.0; + mtrx_dbl[3] = 1.0; + mtrx_dbl[4] = 2.0; + mtrx_dbl[5] = 1.0; + mtrx_dbl[6] = 0.0; + mtrx_dbl[7] = 1.0; + mtrx_dbl[8] = 2.0; + } + + } + else if (num_fun == 4) + { + mtrx_dbl[0] = 1.01; + mtrx_dbl[1] = 1; + mtrx_dbl[2] = 0.0; + mtrx_dbl[3] = 0.0; + mtrx_dbl[4] = 1; + mtrx_dbl[5] = 2; + mtrx_dbl[6] = 1; + mtrx_dbl[7] = 0.0; + mtrx_dbl[8] = 0.0; + mtrx_dbl[9] = 1; + mtrx_dbl[10] = 1.01; + mtrx_dbl[11] = 0.0; + mtrx_dbl[12] = 2; + mtrx_dbl[13] = 1; + mtrx_dbl[14] = 0.0; + mtrx_dbl[15] = 1; + } + + for (i = 0; i < num_fun * num_fun; i++) + { + mtrx_flt[i] = (float)mtrx_dbl[i]; + } + + A_dbl = (HYPRE_ParCSRMatrix) GenerateSysLaplacian_dbl(MPI_COMM_WORLD, + nx, ny, nz, P, Q, + R, p, q, r, num_fun, mtrx_dbl, values_dbl); + A_flt = (HYPRE_ParCSRMatrix) GenerateSysLaplacian_flt(MPI_COMM_WORLD, + nx, ny, nz, P, Q, + R, p, q, r, num_fun, mtrx_flt, values_flt); + + free(mtrx_dbl); + free(mtrx_flt); + } + + free(values_dbl); + free(values_flt); + + *A_flt_ptr = A_flt; + *A_dbl_ptr = A_dbl; + + return (0); +} + +/*---------------------------------------------------------------------- + * returns the sign of a real number + * 1 : positive + * 0 : zero + * -1 : negative + *----------------------------------------------------------------------*/ +static inline HYPRE_Int sign_double(HYPRE_Real a) +{ + return ( (0.0 < a) - (0.0 > a) ); +} + +/*---------------------------------------------------------------------- + * 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_mp( HYPRE_Int argc, + char *argv[], + HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_flt_ptr, + HYPRE_ParCSRMatrix *A_dbl_ptr) +{ + HYPRE_BigInt nx, ny, nz; + HYPRE_Int P, Q, R; + double cx, cy, cz; + double ax, ay, az, atype; + double hinx, hiny, hinz; + HYPRE_Int sign_prod; + + HYPRE_ParCSRMatrix A_flt; + HYPRE_ParCSRMatrix A_dbl; + + HYPRE_Int num_procs, myid; + HYPRE_Int p, q, r, i; + double *values_dbl; + float *values_flt; + + /*----------------------------------------------------------- + * Initialize some stuff + *-----------------------------------------------------------*/ + + MPI_Comm_size(MPI_COMM_WORLD, &num_procs ); + MPI_Comm_rank(MPI_COMM_WORLD, &myid ); + + /*----------------------------------------------------------- + * Set defaults + *-----------------------------------------------------------*/ + + nx = 10; + ny = 10; + nz = 10; + + P = 1; + Q = num_procs; + R = 1; + + cx = 1.; + cy = 1.; + cz = 1.; + + ax = 1.; + ay = 1.; + az = 1.; + + atype = 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 = (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 = (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 ) + { + arg_index++; + atype = 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(" 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 ); + + hinx = 1. / (double)(nx + 1); + hiny = 1. / (double)(ny + 1); + hinz = 1. / (double)(nz + 1); + + /*----------------------------------------------------------- + * Generate the matrix + *-----------------------------------------------------------*/ + /* values[7]: + * [0]: center + * [1]: X- + * [2]: Y- + * [3]: Z- + * [4]: X+ + * [5]: Y+ + * [6]: Z+ + */ + values_dbl = (double*) calloc(7, sizeof(double)); + values_flt = (float*) calloc(7, sizeof(float)); + + values_dbl[0] = 0.; + + if (0 == atype) /* forward scheme for conv */ + { + values_dbl[1] = -cx / (hinx * hinx); + values_dbl[2] = -cy / (hiny * hiny); + values_dbl[3] = -cz / (hinz * hinz); + values_dbl[4] = -cx / (hinx * hinx) + ax / hinx; + values_dbl[5] = -cy / (hiny * hiny) + ay / hiny; + values_dbl[6] = -cz / (hinz * hinz) + az / hinz; + + if (nx > 1) + { + values_dbl[0] += 2.0 * cx / (hinx * hinx) - 1.*ax / hinx; + } + if (ny > 1) + { + values_dbl[0] += 2.0 * cy / (hiny * hiny) - 1.*ay / hiny; + } + if (nz > 1) + { + values_dbl[0] += 2.0 * cz / (hinz * hinz) - 1.*az / hinz; + } + } + else if (1 == atype) /* backward scheme for conv */ + { + values_dbl[1] = -cx / (hinx * hinx) - ax / hinx; + values_dbl[2] = -cy / (hiny * hiny) - ay / hiny; + values_dbl[3] = -cz / (hinz * hinz) - az / hinz; + values_dbl[4] = -cx / (hinx * hinx); + values_dbl[5] = -cy / (hiny * hiny); + values_dbl[6] = -cz / (hinz * hinz); + + if (nx > 1) + { + values_dbl[0] += 2.0 * cx / (hinx * hinx) + 1.*ax / hinx; + } + if (ny > 1) + { + values_dbl[0] += 2.0 * cy / (hiny * hiny) + 1.*ay / hiny; + } + if (nz > 1) + { + values_dbl[0] += 2.0 * cz / (hinz * hinz) + 1.*az / hinz; + } + } + else if (3 == atype) /* upwind scheme */ + { + sign_prod = sign_double(cx) * sign_double(ax); + if (sign_prod == 1) /* same sign use back scheme */ + { + values_dbl[1] = -cx / (hinx * hinx) - ax / hinx; + values_dbl[4] = -cx / (hinx * hinx); + if (nx > 1) + { + values_dbl[0] += 2.0 * cx / (hinx * hinx) + 1.*ax / hinx; + } + } + else /* diff sign use forward scheme */ + { + values_dbl[1] = -cx / (hinx * hinx); + values_dbl[4] = -cx / (hinx * hinx) + ax / hinx; + if (nx > 1) + { + values_dbl[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_dbl[2] = -cy / (hiny * hiny) - ay / hiny; + values_dbl[5] = -cy / (hiny * hiny); + if (ny > 1) + { + values_dbl[0] += 2.0 * cy / (hiny * hiny) + 1.*ay / hiny; + } + } + else /* diff sign use forward scheme */ + { + values_dbl[2] = -cy / (hiny * hiny); + values_dbl[5] = -cy / (hiny * hiny) + ay / hiny; + if (ny > 1) + { + values_dbl[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_dbl[3] = -cz / (hinz * hinz) - az / hinz; + values_dbl[6] = -cz / (hinz * hinz); + if (nz > 1) + { + values_dbl[0] += 2.0 * cz / (hinz * hinz) + 1.*az / hinz; + } + } + else /* diff sign use forward scheme */ + { + values_dbl[3] = -cz / (hinz * hinz); + values_dbl[6] = -cz / (hinz * hinz) + az / hinz; + if (nz > 1) + { + values_dbl[0] += 2.0 * cz / (hinz * hinz) - 1.*az / hinz; + } + } + } + else /* centered difference scheme */ + { + values_dbl[1] = -cx / (hinx * hinx) - ax / (2.*hinx); + values_dbl[2] = -cy / (hiny * hiny) - ay / (2.*hiny); + values_dbl[3] = -cz / (hinz * hinz) - az / (2.*hinz); + values_dbl[4] = -cx / (hinx * hinx) + ax / (2.*hinx); + values_dbl[5] = -cy / (hiny * hiny) + ay / (2.*hiny); + values_dbl[6] = -cz / (hinz * hinz) + az / (2.*hinz); + + if (nx > 1) + { + values_dbl[0] += 2.0 * cx / (hinx * hinx); + } + if (ny > 1) + { + values_dbl[0] += 2.0 * cy / (hiny * hiny); + } + if (nz > 1) + { + values_dbl[0] += 2.0 * cz / (hinz * hinz); + } + } + + for (i = 0; i < 7; i++) + { + values_flt[i] = (float)values_dbl[i]; + } + + A_dbl = (HYPRE_ParCSRMatrix) GenerateDifConv_dbl(MPI_COMM_WORLD, + nx, ny, nz, P, Q, R, p, q, r, values_dbl); + A_flt = (HYPRE_ParCSRMatrix) GenerateDifConv_flt(MPI_COMM_WORLD, + nx, ny, nz, P, Q, R, p, q, r, values_flt); + + free(values_dbl); + free(values_flt); + + *A_dbl_ptr = A_dbl; + *A_flt_ptr = A_flt; + + return (0); +} + +/*---------------------------------------------------------------------- + * Build standard 9-point laplacian in 2D with grid and anisotropy. + * Parameters given in command line. + *----------------------------------------------------------------------*/ + +HYPRE_Int +BuildParLaplacian9pt_mp( HYPRE_Int argc, + char *argv[], + HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_flt_ptr, + HYPRE_ParCSRMatrix *A_dbl_ptr ) +{ + HYPRE_BigInt nx, ny; + HYPRE_Int P, Q; + + HYPRE_ParCSRMatrix A_flt; + HYPRE_ParCSRMatrix A_dbl; + + HYPRE_Int num_procs, myid; + HYPRE_Int p, q; + double *values_dbl; + float *values_flt; + + /*----------------------------------------------------------- + * Initialize some stuff + *-----------------------------------------------------------*/ + + MPI_Comm_size(MPI_COMM_WORLD, &num_procs ); + MPI_Comm_rank(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\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_dbl = (double*) calloc(2, sizeof(double)); + values_flt = (float*) calloc(2, sizeof(float)); + + values_dbl[1] = -1.; + values_flt[1] = -1.; + + values_dbl[0] = 0.; + values_flt[0] = 0.; + if (nx > 1) + { + values_dbl[0] += 2.0; + values_flt[0] += 2.0; + } + if (ny > 1) + { + values_dbl[0] += 2.0; + values_flt[0] += 2.0; + } + if (nx > 1 && ny > 1) + { + values_dbl[0] += 4.0; + values_flt[0] += 4.0; + } + + A_flt = (HYPRE_ParCSRMatrix) GenerateLaplacian9pt_flt(MPI_COMM_WORLD, + nx, ny, P, Q, p, q, values_flt); + + free(values_flt); + + A_dbl = (HYPRE_ParCSRMatrix) GenerateLaplacian9pt_dbl(MPI_COMM_WORLD, + nx, ny, P, Q, p, q, values_dbl); + + free(values_dbl); + + *A_dbl_ptr = A_dbl; + + *A_flt_ptr = A_flt; + + return (0); +} + +/*---------------------------------------------------------------------- + * Build 27-point laplacian in 3D, + * Parameters given in command line. + *----------------------------------------------------------------------*/ + +HYPRE_Int +BuildParLaplacian27pt_mp( HYPRE_Int argc, + char *argv[], + HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_flt_ptr, + HYPRE_ParCSRMatrix *A_dbl_ptr ) +{ + HYPRE_BigInt nx, ny, nz; + HYPRE_Int P, Q, R; + + HYPRE_ParCSRMatrix A_flt; + HYPRE_ParCSRMatrix A_dbl; + + HYPRE_Int num_procs, myid; + HYPRE_Int p, q, r; + float *values_flt; + double *values_dbl; + + /*----------------------------------------------------------- + * Initialize some stuff + *-----------------------------------------------------------*/ + + MPI_Comm_size(MPI_COMM_WORLD, &num_procs ); + MPI_Comm_rank(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_flt = (float*) calloc(2, sizeof(float)); + values_dbl = (double*) calloc(2, sizeof(double)); + + values_flt[0] = 26.0; + values_dbl[0] = 26.0; + if (nx == 1 || ny == 1 || nz == 1) + { + values_flt[0] = 8.0; + values_dbl[0] = 8.0; + } + if (nx * ny == 1 || nx * nz == 1 || ny * nz == 1) + { + values_flt[0] = 2.0; + values_dbl[0] = 2.0; + } + values_flt[1] = -1.; + values_dbl[1] = -1.; + + A_flt = (HYPRE_ParCSRMatrix) GenerateLaplacian27pt_flt(MPI_COMM_WORLD, + nx, ny, nz, P, Q, R, p, q, r, values_flt); + + free(values_flt); + + A_dbl = (HYPRE_ParCSRMatrix) GenerateLaplacian27pt_dbl(MPI_COMM_WORLD, + nx, ny, nz, P, Q, R, p, q, r, values_dbl); + + free(values_dbl); + + *A_dbl_ptr = A_dbl; + *A_flt_ptr = A_flt; + + return (0); +} + +/*---------------------------------------------------------------------- + * Build 125-point laplacian in 3D (27-pt squared) + * Parameters given in command line. + *----------------------------------------------------------------------*/ + +HYPRE_Int +BuildParLaplacian125pt_mp( HYPRE_Int argc, + char *argv[], + HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_flt_ptr, + HYPRE_ParCSRMatrix *A_dbl_ptr ) +{ + HYPRE_BigInt nx, ny, nz; + HYPRE_Int P, Q, R; + + HYPRE_ParCSRMatrix A_flt, B_flt; + HYPRE_ParCSRMatrix A_dbl, B_dbl; + + HYPRE_Int num_procs, myid; + HYPRE_Int p, q, r; + float *values_flt; + double *values_dbl; + + /*----------------------------------------------------------- + * Initialize some stuff + *-----------------------------------------------------------*/ + + MPI_Comm_size(MPI_COMM_WORLD, &num_procs ); + MPI_Comm_rank(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_flt = (float*) calloc(2, sizeof(float)); + values_dbl = (double*) calloc(2, sizeof(double)); + + values_flt[0] = 26.0; + values_dbl[0] = 26.0; + if (nx == 1 || ny == 1 || nz == 1) + { + values_flt[0] = 8.0; + values_dbl[0] = 8.0; + } + if (nx * ny == 1 || nx * nz == 1 || ny * nz == 1) + { + values_flt[0] = 2.0; + values_dbl[0] = 2.0; + } + values_flt[1] = -1.; + values_dbl[1] = -1.; + + B_flt = (HYPRE_ParCSRMatrix) GenerateLaplacian27pt_flt(MPI_COMM_WORLD, + nx, ny, nz, P, Q, R, p, q, r, values_flt); + A_flt = (HYPRE_ParCSRMatrix) hypre_ParCSRMatMat_flt(B_flt, B_flt); + + HYPRE_ParCSRMatrixDestroy_flt(B_flt); + free(values_flt); + + B_dbl = (HYPRE_ParCSRMatrix) GenerateLaplacian27pt_dbl(MPI_COMM_WORLD, + nx, ny, nz, P, Q, R, p, q, r, values_dbl); + A_dbl = (HYPRE_ParCSRMatrix) hypre_ParCSRMatMat_dbl(B_dbl, B_dbl); + + HYPRE_ParCSRMatrixDestroy_dbl(B_dbl); + free(values_dbl); + + *A_dbl_ptr = A_dbl; + *A_flt_ptr = A_flt; + + return (0); +} + +/*---------------------------------------------------------------------- + * Build 7-point in 2D + * Parameters given in command line. + *----------------------------------------------------------------------*/ + +HYPRE_Int +BuildParRotate7pt_mp( HYPRE_Int argc, + char *argv[], + HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_flt_ptr, + HYPRE_ParCSRMatrix *A_dbl_ptr ) +{ + HYPRE_BigInt nx, ny; + HYPRE_Int P, Q; + + HYPRE_ParCSRMatrix A_flt; + HYPRE_ParCSRMatrix A_dbl; + + HYPRE_Int num_procs, myid; + HYPRE_Int p, q; + double eps, alpha; + + /*----------------------------------------------------------- + * Initialize some stuff + *-----------------------------------------------------------*/ + + MPI_Comm_size(MPI_COMM_WORLD, &num_procs ); + MPI_Comm_rank(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 if ( strcmp(argv[arg_index], "-alpha") == 0 ) + { + arg_index++; + alpha = (HYPRE_Real)atof(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-eps") == 0 ) + { + arg_index++; + eps = (HYPRE_Real)atof(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(" Rotate 7pt:\n"); + 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); + } + + /*----------------------------------------------------------- + * Set up the grid structure + *-----------------------------------------------------------*/ + + /* compute p,q from P,Q and myid */ + p = myid % P; + q = ( myid - p) / P; + + /*----------------------------------------------------------- + * Generate the matrix + *-----------------------------------------------------------*/ + + A_flt = (HYPRE_ParCSRMatrix) GenerateRotate7pt_flt(MPI_COMM_WORLD, + nx, ny, P, Q, p, q, (float)alpha, (float)eps); + A_dbl = (HYPRE_ParCSRMatrix) GenerateRotate7pt_dbl(MPI_COMM_WORLD, + nx, ny, P, Q, p, q, alpha, eps); + + *A_flt_ptr = A_flt; + *A_dbl_ptr = A_dbl; + + return (0); +} + +/*---------------------------------------------------------------------- + * 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 + * 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 + * + *----------------------------------------------------------------------*/ + +HYPRE_Int +BuildParVarDifConv_mp( HYPRE_Int argc, + char *argv[], + HYPRE_Int arg_index, + HYPRE_ParCSRMatrix *A_flt_ptr, + HYPRE_ParCSRMatrix *A_dbl_ptr, + HYPRE_ParVector *rhs_flt_ptr, + HYPRE_ParVector *rhs_dbl_ptr ) +{ + HYPRE_BigInt nx, ny, nz; + HYPRE_Int P, Q, R; + + HYPRE_ParCSRMatrix A_flt; + HYPRE_ParCSRMatrix A_dbl; + HYPRE_ParVector rhs_flt; + HYPRE_ParVector rhs_dbl; + + HYPRE_Int num_procs, myid; + HYPRE_Int p, q, r; + HYPRE_Int type; + double eps; + + /*----------------------------------------------------------- + * Initialize some stuff + *-----------------------------------------------------------*/ + + MPI_Comm_size(MPI_COMM_WORLD, &num_procs ); + MPI_Comm_rank(MPI_COMM_WORLD, &myid ); + + /*----------------------------------------------------------- + * Set defaults + *-----------------------------------------------------------*/ + + nx = 10; + ny = 10; + nz = 10; + P = 1; + Q = num_procs; + R = 1; + eps = 1.0; + + /* type: 0 : default FD; + * 1-3 : FD and examples 1-3 in Ruge-Stuben paper */ + type = 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], "-eps") == 0 ) + { + arg_index++; + eps = (HYPRE_Real)atof(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-vardifconvRS") == 0 ) + { + arg_index++; + type = 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(" ell PDE: eps = %f\n", eps); + hypre_printf(" Dx(aDxu) + Dy(bDyu) + Dz(cDzu) + d Dxu + e Dyu + f Dzu + g u= 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); + } + /*----------------------------------------------------------- + * 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 + *-----------------------------------------------------------*/ + + if (0 == type) + { + A_dbl = (HYPRE_ParCSRMatrix) GenerateVarDifConv_dbl(MPI_COMM_WORLD, + nx, ny, nz, P, Q, R, p, q, r, + eps, &rhs_dbl); + A_flt = (HYPRE_ParCSRMatrix) GenerateVarDifConv_flt(MPI_COMM_WORLD, + nx, ny, nz, P, Q, R, p, q, r, + (float)eps, &rhs_flt); + } + else + { + A_dbl = (HYPRE_ParCSRMatrix) GenerateRSVarDifConv_dbl(MPI_COMM_WORLD, + nx, ny, nz, P, Q, R, p, q, r, + eps, &rhs_dbl, type); + A_flt = (HYPRE_ParCSRMatrix) GenerateRSVarDifConv_flt(MPI_COMM_WORLD, + nx, ny, nz, P, Q, R, p, q, r, + (float)eps, &rhs_flt, type); + } + + *A_flt_ptr = A_flt; + *rhs_flt_ptr = rhs_flt; + *A_dbl_ptr = A_dbl; + *rhs_dbl_ptr = rhs_dbl; + + return (0); +} + + diff --git a/src/test/maxwell_unscaled.c b/src/test/maxwell_unscaled.c deleted file mode 100644 index 933133fb55..0000000000 --- a/src/test/maxwell_unscaled.c +++ /dev/null @@ -1,2034 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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 -#include -#include - -#include "_hypre_utilities.h" -#include "HYPRE_sstruct_ls.h" -#include "HYPRE_krylov.h" -#include "_hypre_sstruct_mv.h" -#include "_hypre_sstruct_ls.h" - -#define DEBUG 0 - -/*-------------------------------------------------------------------------- - * Data structures - *--------------------------------------------------------------------------*/ - -char infile_default[50] = "sstruct.in.default"; - -typedef HYPRE_Int Index[3]; -typedef HYPRE_Int ProblemIndex[9]; - -typedef struct -{ - /* for GridSetExtents */ - HYPRE_Int nboxes; - ProblemIndex *ilowers; - ProblemIndex *iuppers; - HYPRE_Int *boxsizes; - HYPRE_Int max_boxsize; - - /* for GridSetVariables */ - HYPRE_Int nvars; - HYPRE_SStructVariable *vartypes; - - /* for GridAddVariables */ - HYPRE_Int add_nvars; - ProblemIndex *add_indexes; - HYPRE_SStructVariable *add_vartypes; - - /* for GridSetNeighborBox */ - HYPRE_Int glue_nboxes; - ProblemIndex *glue_ilowers; - ProblemIndex *glue_iuppers; - HYPRE_Int *glue_nbor_parts; - ProblemIndex *glue_nbor_ilowers; - ProblemIndex *glue_nbor_iuppers; - Index *glue_index_maps; - - /* for GraphSetStencil */ - HYPRE_Int *stencil_num; - - /* for GraphAddEntries */ - HYPRE_Int graph_nentries; - ProblemIndex *graph_ilowers; - ProblemIndex *graph_iuppers; - Index *graph_strides; - HYPRE_Int *graph_vars; - HYPRE_Int *graph_to_parts; - ProblemIndex *graph_to_ilowers; - ProblemIndex *graph_to_iuppers; - Index *graph_to_strides; - HYPRE_Int *graph_to_vars; - Index *graph_index_maps; - Index *graph_index_signs; - HYPRE_Int *graph_entries; - HYPRE_Int graph_values_size; - HYPRE_Real *graph_values; - HYPRE_Real *d_graph_values; - HYPRE_Int *graph_boxsizes; - - HYPRE_Int matrix_nentries; - ProblemIndex *matrix_ilowers; - ProblemIndex *matrix_iuppers; - Index *matrix_strides; - HYPRE_Int *matrix_vars; - HYPRE_Int *matrix_entries; - HYPRE_Int matrix_values_size; - HYPRE_Real *matrix_values; - HYPRE_Real *d_matrix_values; - - Index periodic; - -} ProblemPartData; - -typedef struct -{ - HYPRE_Int ndim; - HYPRE_Int nparts; - ProblemPartData *pdata; - HYPRE_Int max_boxsize; - - HYPRE_MemoryLocation memory_location; - - HYPRE_Int nstencils; - HYPRE_Int *stencil_sizes; - Index **stencil_offsets; - HYPRE_Int **stencil_vars; - HYPRE_Real **stencil_values; - - HYPRE_Int symmetric_nentries; - HYPRE_Int *symmetric_parts; - HYPRE_Int *symmetric_vars; - HYPRE_Int *symmetric_to_vars; - HYPRE_Int *symmetric_booleans; - - HYPRE_Int ns_symmetric; - - Index rfactor; - - HYPRE_Int npools; - HYPRE_Int *pools; /* array of size nparts */ - -} ProblemData; - -/*-------------------------------------------------------------------------- - * Read routines - *--------------------------------------------------------------------------*/ - -HYPRE_Int -SScanIntArray( char *sdata_ptr, - char **sdata_ptr_ptr, - HYPRE_Int size, - HYPRE_Int *array ) -{ - HYPRE_Int i; - - sdata_ptr += strspn(sdata_ptr, " \t\n["); - for (i = 0; i < size; i++) - { - array[i] = strtol(sdata_ptr, &sdata_ptr, 10); - } - sdata_ptr += strcspn(sdata_ptr, "]") + 1; - - *sdata_ptr_ptr = sdata_ptr; - return 0; -} - -HYPRE_Int -SScanProblemIndex( char *sdata_ptr, - char **sdata_ptr_ptr, - HYPRE_Int ndim, - ProblemIndex index ) -{ - HYPRE_Int i; - char sign[3]; - - /* initialize index array */ - for (i = 0; i < 9; i++) - { - index[i] = 0; - } - - sdata_ptr += strspn(sdata_ptr, " \t\n("); - switch (ndim) - { - case 1: - 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; - - 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; - } - sdata_ptr += strcspn(sdata_ptr, ":)"); - if ( *sdata_ptr == ':' ) - { - /* read in optional shift */ - sdata_ptr += 1; - switch (ndim) - { - case 1: - hypre_sscanf(sdata_ptr, "%d", &index[6]); - break; - - case 2: - hypre_sscanf(sdata_ptr, "%d%d", &index[6], &index[7]); - break; - - case 3: - hypre_sscanf(sdata_ptr, "%d%d%d", &index[6], &index[7], &index[8]); - break; - } - /* pre-shift the index */ - for (i = 0; i < ndim; i++) - { - index[i] += index[i + 6]; - } - } - sdata_ptr += strcspn(sdata_ptr, ")") + 1; - - for (i = 0; i < ndim; i++) - { - if (sign[i] == '+') - { - index[i + 3] = 1; - } - } - - *sdata_ptr_ptr = sdata_ptr; - return 0; -} - -HYPRE_Int -ReadData( char *filename, - ProblemData *data_ptr ) -{ - ProblemData data; - ProblemPartData pdata; - - HYPRE_Int myid; - FILE *file; - - char *sdata = NULL; - char *sdata_line; - char *sdata_ptr; - HYPRE_Int sdata_size; - HYPRE_Int size; - HYPRE_Int memchunk = 10000; - HYPRE_Int maxline = 250; - - char key[250]; - - 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 - *-----------------------------------------------------------*/ - - hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &myid); - - if (myid == 0) - { - if ((file = fopen(filename, "r")) == NULL) - { - hypre_printf("Error: can't open input file %s\n", filename); - exit(1); - } - - /* allocate initial space, and read first input line */ - sdata_size = 0; - sdata = hypre_TAlloc(char, memchunk, HYPRE_MEMORY_HOST); - sdata_line = fgets(sdata, maxline, file); - - s = 0; - while (sdata_line != NULL) - { - sdata_size += strlen(sdata_line) + 1; - - /* allocate more space, if necessary */ - if ((sdata_size + maxline) > s) - { - sdata = hypre_TReAlloc(sdata, char, (sdata_size + memchunk), HYPRE_MEMORY_HOST); - s = sdata_size + memchunk; - } - - /* read the next input line */ - sdata_line = fgets((sdata + sdata_size), maxline, file); - } - - fclose(file); - } - - /* broadcast the data size */ - hypre_MPI_Bcast(&sdata_size, 1, HYPRE_MPI_INT, 0, hypre_MPI_COMM_WORLD); - - /* broadcast the data */ - sdata = hypre_TReAlloc(sdata, char, sdata_size, HYPRE_MEMORY_HOST); - hypre_MPI_Bcast(sdata, sdata_size, hypre_MPI_CHAR, 0, hypre_MPI_COMM_WORLD); - - /*----------------------------------------------------------- - * Parse the data and fill ProblemData structure - *-----------------------------------------------------------*/ - - data.memory_location = memory_location; - data.max_boxsize = 0; - data.symmetric_nentries = 0; - data.symmetric_parts = NULL; - data.symmetric_vars = NULL; - data.symmetric_to_vars = NULL; - data.symmetric_booleans = NULL; - data.ns_symmetric = 0; - - sdata_line = sdata; - 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"); - - if ( strcmp(key, "GridCreate:") == 0 ) - { - data.ndim = strtol(sdata_ptr, &sdata_ptr, 10); - data.nparts = strtol(sdata_ptr, &sdata_ptr, 10); - data.pdata = hypre_CTAlloc(ProblemPartData, data.nparts, HYPRE_MEMORY_HOST); - } - else if ( strcmp(key, "GridSetExtents:") == 0 ) - { - part = strtol(sdata_ptr, &sdata_ptr, 10); - pdata = data.pdata[part]; - if ((pdata.nboxes % 10) == 0) - { - size = pdata.nboxes + 10; - pdata.ilowers = - hypre_TReAlloc(pdata.ilowers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.iuppers = - hypre_TReAlloc(pdata.iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.boxsizes = - hypre_TReAlloc(pdata.boxsizes, HYPRE_Int, size, HYPRE_MEMORY_HOST); - } - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.ilowers[pdata.nboxes]); - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.iuppers[pdata.nboxes]); - /* check use of +- in GridSetExtents */ - il = 1; - iu = 1; - for (i = 0; i < data.ndim; i++) - { - il *= pdata.ilowers[pdata.nboxes][i + 3]; - iu *= pdata.iuppers[pdata.nboxes][i + 3]; - } - if ( (il != 0) || (iu != 1) ) - { - hypre_printf("Error: Invalid use of `+-' in GridSetExtents\n"); - exit(1); - } - pdata.boxsizes[pdata.nboxes] = 1; - for (i = 0; i < 3; i++) - { - pdata.boxsizes[pdata.nboxes] *= - (pdata.iuppers[pdata.nboxes][i] - - pdata.ilowers[pdata.nboxes][i] + 2); - } - pdata.max_boxsize = - hypre_max(pdata.max_boxsize, pdata.boxsizes[pdata.nboxes]); - pdata.nboxes++; - data.pdata[part] = pdata; - } - else if ( strcmp(key, "GridSetVariables:") == 0 ) - { - part = strtol(sdata_ptr, &sdata_ptr, 10); - pdata = data.pdata[part]; - pdata.nvars = strtol(sdata_ptr, &sdata_ptr, 10); - pdata.vartypes = hypre_CTAlloc(HYPRE_SStructVariable, pdata.nvars, HYPRE_MEMORY_HOST); - SScanIntArray(sdata_ptr, &sdata_ptr, - pdata.nvars, (HYPRE_Int *) pdata.vartypes); - data.pdata[part] = pdata; - } - else if ( strcmp(key, "GridAddVariables:") == 0 ) - { - /* TODO */ - hypre_printf("GridAddVariables not yet implemented!\n"); - exit(1); - } - else if ( strcmp(key, "GridSetNeighborBox:") == 0 ) - { - part = strtol(sdata_ptr, &sdata_ptr, 10); - pdata = data.pdata[part]; - if ((pdata.glue_nboxes % 10) == 0) - { - size = pdata.glue_nboxes + 10; - pdata.glue_ilowers = - hypre_TReAlloc(pdata.glue_ilowers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.glue_iuppers = - hypre_TReAlloc(pdata.glue_iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.glue_nbor_parts = - hypre_TReAlloc(pdata.glue_nbor_parts, HYPRE_Int, size, HYPRE_MEMORY_HOST); - pdata.glue_nbor_ilowers = - hypre_TReAlloc(pdata.glue_nbor_ilowers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.glue_nbor_iuppers = - hypre_TReAlloc(pdata.glue_nbor_iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.glue_index_maps = - hypre_TReAlloc(pdata.glue_index_maps, Index, size, HYPRE_MEMORY_HOST); - } - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.glue_ilowers[pdata.glue_nboxes]); - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.glue_iuppers[pdata.glue_nboxes]); - pdata.glue_nbor_parts[pdata.glue_nboxes] = - strtol(sdata_ptr, &sdata_ptr, 10); - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.glue_nbor_ilowers[pdata.glue_nboxes]); - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.glue_nbor_iuppers[pdata.glue_nboxes]); - SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, - pdata.glue_index_maps[pdata.glue_nboxes]); - for (i = data.ndim; i < 3; i++) - { - pdata.glue_index_maps[pdata.glue_nboxes][i] = i; - } - pdata.glue_nboxes++; - data.pdata[part] = pdata; - } - else if ( strcmp(key, "GridSetPeriodic:") == 0 ) - { - part = strtol(sdata_ptr, &sdata_ptr, 10); - pdata = data.pdata[part]; - SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, pdata.periodic); - for (i = data.ndim; i < 3; i++) - { - pdata.periodic[i] = 0; - } - data.pdata[part] = pdata; - } - else if ( strcmp(key, "StencilCreate:") == 0 ) - { - data.nstencils = strtol(sdata_ptr, &sdata_ptr, 10); - data.stencil_sizes = hypre_CTAlloc(HYPRE_Int, data.nstencils, HYPRE_MEMORY_HOST); - data.stencil_offsets = hypre_CTAlloc(Index *, data.nstencils, HYPRE_MEMORY_HOST); - data.stencil_vars = hypre_CTAlloc(HYPRE_Int *, data.nstencils, HYPRE_MEMORY_HOST); - data.stencil_values = hypre_CTAlloc(HYPRE_Real *, data.nstencils, HYPRE_MEMORY_HOST); - SScanIntArray(sdata_ptr, &sdata_ptr, - data.nstencils, data.stencil_sizes); - for (s = 0; s < data.nstencils; s++) - { - data.stencil_offsets[s] = - hypre_CTAlloc(Index, data.stencil_sizes[s], HYPRE_MEMORY_HOST); - data.stencil_vars[s] = - hypre_CTAlloc(HYPRE_Int, data.stencil_sizes[s], HYPRE_MEMORY_HOST); - data.stencil_values[s] = - hypre_CTAlloc(HYPRE_Real, data.stencil_sizes[s], HYPRE_MEMORY_HOST); - } - } - else if ( strcmp(key, "StencilSetEntry:") == 0 ) - { - s = strtol(sdata_ptr, &sdata_ptr, 10); - entry = strtol(sdata_ptr, &sdata_ptr, 10); - SScanIntArray(sdata_ptr, &sdata_ptr, - data.ndim, data.stencil_offsets[s][entry]); - for (i = data.ndim; i < 3; i++) - { - data.stencil_offsets[s][entry][i] = 0; - } - data.stencil_vars[s][entry] = strtol(sdata_ptr, &sdata_ptr, 10); - data.stencil_values[s][entry] = (HYPRE_Real)strtod(sdata_ptr, &sdata_ptr); - } - else if ( strcmp(key, "GraphSetStencil:") == 0 ) - { - part = strtol(sdata_ptr, &sdata_ptr, 10); - var = strtol(sdata_ptr, &sdata_ptr, 10); - s = strtol(sdata_ptr, &sdata_ptr, 10); - pdata = data.pdata[part]; - if (pdata.stencil_num == NULL) - { - pdata.stencil_num = hypre_CTAlloc(HYPRE_Int, pdata.nvars, HYPRE_MEMORY_HOST); - } - pdata.stencil_num[var] = s; - data.pdata[part] = pdata; - } - else if ( strcmp(key, "GraphAddEntries:") == 0 ) - { - part = strtol(sdata_ptr, &sdata_ptr, 10); - pdata = data.pdata[part]; - if ((pdata.graph_nentries % 10) == 0) - { - size = pdata.graph_nentries + 10; - pdata.graph_ilowers = - hypre_TReAlloc(pdata.graph_ilowers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.graph_iuppers = - hypre_TReAlloc(pdata.graph_iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.graph_strides = - hypre_TReAlloc(pdata.graph_strides, Index, size, HYPRE_MEMORY_HOST); - pdata.graph_vars = - hypre_TReAlloc(pdata.graph_vars, HYPRE_Int, size, HYPRE_MEMORY_HOST); - pdata.graph_to_parts = - hypre_TReAlloc(pdata.graph_to_parts, HYPRE_Int, size, HYPRE_MEMORY_HOST); - pdata.graph_to_ilowers = - hypre_TReAlloc(pdata.graph_to_ilowers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.graph_to_iuppers = - hypre_TReAlloc(pdata.graph_to_iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.graph_to_strides = - hypre_TReAlloc(pdata.graph_to_strides, Index, size, HYPRE_MEMORY_HOST); - pdata.graph_to_vars = - hypre_TReAlloc(pdata.graph_to_vars, HYPRE_Int, size, HYPRE_MEMORY_HOST); - pdata.graph_index_maps = - hypre_TReAlloc(pdata.graph_index_maps, Index, size, HYPRE_MEMORY_HOST); - pdata.graph_index_signs = - hypre_TReAlloc(pdata.graph_index_signs, Index, size, HYPRE_MEMORY_HOST); - pdata.graph_entries = - hypre_TReAlloc(pdata.graph_entries, HYPRE_Int, size, HYPRE_MEMORY_HOST); - pdata.graph_values = - 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, memory_location); - pdata.graph_values_size = size; - pdata.graph_boxsizes = - hypre_TReAlloc(pdata.graph_boxsizes, HYPRE_Int, size, HYPRE_MEMORY_HOST); - } - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.graph_ilowers[pdata.graph_nentries]); - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.graph_iuppers[pdata.graph_nentries]); - SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, - pdata.graph_strides[pdata.graph_nentries]); - for (i = data.ndim; i < 3; i++) - { - pdata.graph_strides[pdata.graph_nentries][i] = 1; - } - pdata.graph_vars[pdata.graph_nentries] = - strtol(sdata_ptr, &sdata_ptr, 10); - pdata.graph_to_parts[pdata.graph_nentries] = - strtol(sdata_ptr, &sdata_ptr, 10); - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.graph_to_ilowers[pdata.graph_nentries]); - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.graph_to_iuppers[pdata.graph_nentries]); - SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, - pdata.graph_to_strides[pdata.graph_nentries]); - for (i = data.ndim; i < 3; i++) - { - pdata.graph_to_strides[pdata.graph_nentries][i] = 1; - } - pdata.graph_to_vars[pdata.graph_nentries] = - strtol(sdata_ptr, &sdata_ptr, 10); - SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, - pdata.graph_index_maps[pdata.graph_nentries]); - for (i = data.ndim; i < 3; i++) - { - pdata.graph_index_maps[pdata.graph_nentries][i] = i; - } - for (i = 0; i < 3; i++) - { - pdata.graph_index_signs[pdata.graph_nentries][i] = 1; - if ( pdata.graph_to_iuppers[pdata.graph_nentries][i] < - pdata.graph_to_ilowers[pdata.graph_nentries][i] ) - { - pdata.graph_index_signs[pdata.graph_nentries][i] = -1; - } - } - pdata.graph_entries[pdata.graph_nentries] = - strtol(sdata_ptr, &sdata_ptr, 10); - pdata.graph_values[pdata.graph_nentries] = - (HYPRE_Real)strtod(sdata_ptr, &sdata_ptr); - pdata.graph_boxsizes[pdata.graph_nentries] = 1; - for (i = 0; i < 3; i++) - { - pdata.graph_boxsizes[pdata.graph_nentries] *= - (pdata.graph_iuppers[pdata.graph_nentries][i] - - pdata.graph_ilowers[pdata.graph_nentries][i] + 1); - } - pdata.graph_nentries++; - data.pdata[part] = pdata; - } - else if ( strcmp(key, "MatrixSetSymmetric:") == 0 ) - { - if ((data.symmetric_nentries % 10) == 0) - { - size = data.symmetric_nentries + 10; - data.symmetric_parts = - hypre_TReAlloc(data.symmetric_parts, HYPRE_Int, size, HYPRE_MEMORY_HOST); - data.symmetric_vars = - hypre_TReAlloc(data.symmetric_vars, HYPRE_Int, size, HYPRE_MEMORY_HOST); - data.symmetric_to_vars = - hypre_TReAlloc(data.symmetric_to_vars, HYPRE_Int, size, HYPRE_MEMORY_HOST); - data.symmetric_booleans = - hypre_TReAlloc(data.symmetric_booleans, HYPRE_Int, size, HYPRE_MEMORY_HOST); - } - data.symmetric_parts[data.symmetric_nentries] = - strtol(sdata_ptr, &sdata_ptr, 10); - data.symmetric_vars[data.symmetric_nentries] = - strtol(sdata_ptr, &sdata_ptr, 10); - data.symmetric_to_vars[data.symmetric_nentries] = - strtol(sdata_ptr, &sdata_ptr, 10); - data.symmetric_booleans[data.symmetric_nentries] = - strtol(sdata_ptr, &sdata_ptr, 10); - data.symmetric_nentries++; - } - else if ( strcmp(key, "MatrixSetNSSymmetric:") == 0 ) - { - data.ns_symmetric = strtol(sdata_ptr, &sdata_ptr, 10); - } - else if ( strcmp(key, "MatrixSetValues:") == 0 ) - { - part = strtol(sdata_ptr, &sdata_ptr, 10); - pdata = data.pdata[part]; - if ((pdata.matrix_nentries % 10) == 0) - { - size = pdata.matrix_nentries + 10; - pdata.matrix_ilowers = - hypre_TReAlloc(pdata.matrix_ilowers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.matrix_iuppers = - hypre_TReAlloc(pdata.matrix_iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.matrix_strides = - hypre_TReAlloc(pdata.matrix_strides, Index, size, HYPRE_MEMORY_HOST); - pdata.matrix_vars = - hypre_TReAlloc(pdata.matrix_vars, HYPRE_Int, size, HYPRE_MEMORY_HOST); - pdata.matrix_entries = - hypre_TReAlloc(pdata.matrix_entries, HYPRE_Int, size, HYPRE_MEMORY_HOST); - pdata.matrix_values = - 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, memory_location); - pdata.matrix_values_size = size; - } - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.matrix_ilowers[pdata.matrix_nentries]); - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.matrix_iuppers[pdata.matrix_nentries]); - SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, - pdata.matrix_strides[pdata.matrix_nentries]); - for (i = data.ndim; i < 3; i++) - { - pdata.matrix_strides[pdata.matrix_nentries][i] = 1; - } - pdata.matrix_vars[pdata.matrix_nentries] = - strtol(sdata_ptr, &sdata_ptr, 10); - pdata.matrix_entries[pdata.matrix_nentries] = - strtol(sdata_ptr, &sdata_ptr, 10); - pdata.matrix_values[pdata.matrix_nentries] = - (HYPRE_Real)strtod(sdata_ptr, &sdata_ptr); - pdata.matrix_nentries++; - data.pdata[part] = pdata; - } - - else if ( strcmp(key, "rfactor:") == 0 ) - { - SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, data.rfactor); - for (i = data.ndim; i < 3; i++) - { - data.rfactor[i] = 1; - } - } - - else if ( strcmp(key, "ProcessPoolCreate:") == 0 ) - { - data.npools = strtol(sdata_ptr, &sdata_ptr, 10); - data.pools = hypre_CTAlloc(HYPRE_Int, data.nparts, HYPRE_MEMORY_HOST); - } - else if ( strcmp(key, "ProcessPoolSetPart:") == 0 ) - { - i = strtol(sdata_ptr, &sdata_ptr, 10); - part = strtol(sdata_ptr, &sdata_ptr, 10); - data.pools[part] = i; - } - } - - sdata_line += strlen(sdata_line) + 1; - } - - data.max_boxsize = 0; - for (part = 0; part < data.nparts; part++) - { - data.max_boxsize = - hypre_max(data.max_boxsize, data.pdata[part].max_boxsize); - } - - hypre_TFree(sdata, HYPRE_MEMORY_HOST); - - *data_ptr = data; - return 0; -} - -/*-------------------------------------------------------------------------- - * Distribute routines - *--------------------------------------------------------------------------*/ - -HYPRE_Int -MapProblemIndex( ProblemIndex index, - Index m ) -{ - /* un-shift the index */ - index[0] -= index[6]; - 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]; - /* pre-shift the new mapped index */ - index[0] += index[6]; - index[1] += index[7]; - index[2] += index[8]; - - return 0; -} - -HYPRE_Int -IntersectBoxes( ProblemIndex ilower1, - ProblemIndex iupper1, - ProblemIndex ilower2, - ProblemIndex iupper2, - ProblemIndex int_ilower, - ProblemIndex int_iupper ) -{ - HYPRE_Int d, size; - - size = 1; - for (d = 0; d < 3; d++) - { - int_ilower[d] = hypre_max(ilower1[d], ilower2[d]); - int_iupper[d] = hypre_min(iupper1[d], iupper2[d]); - size *= hypre_max(0, (int_iupper[d] - int_ilower[d] + 1)); - } - - return size; -} - -HYPRE_Int -DistributeData( ProblemData global_data, - Index *refine, - Index *distribute, - Index *block, - HYPRE_Int num_procs, - HYPRE_Int myid, - ProblemData *data_ptr ) -{ - HYPRE_MemoryLocation memory_location = global_data.memory_location; - ProblemData data = global_data; - ProblemPartData pdata; - HYPRE_Int *pool_procs; - HYPRE_Int np, pid; - HYPRE_Int pool, part, box, entry, p, q, r, i, d, dmap, sign, size; - Index m, mmap, n; - ProblemIndex int_ilower, int_iupper; - - /* determine first process number in each pool */ - pool_procs = hypre_CTAlloc(HYPRE_Int, (data.npools + 1), HYPRE_MEMORY_HOST); - for (part = 0; part < data.nparts; part++) - { - pool = data.pools[part] + 1; - np = distribute[part][0] * distribute[part][1] * distribute[part][2]; - pool_procs[pool] = hypre_max(pool_procs[pool], np); - - } - pool_procs[0] = 0; - for (pool = 1; pool < (data.npools + 1); pool++) - { - pool_procs[pool] = pool_procs[pool - 1] + pool_procs[pool]; - } - - /* check number of processes */ - if (pool_procs[data.npools] != num_procs) - { - hypre_printf("Error: Invalid number of processes or process topology \n"); - exit(1); - } - - /* modify part data */ - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - pool = data.pools[part]; - np = distribute[part][0] * distribute[part][1] * distribute[part][2]; - pid = myid - pool_procs[pool]; - - if ( (pid < 0) || (pid >= np) ) - { - /* none of this part data lives on this process */ - pdata.nboxes = 0; - pdata.glue_nboxes = 0; - pdata.graph_nentries = 0; - pdata.matrix_nentries = 0; - } - else - { - /* refine boxes */ - m[0] = refine[part][0]; - m[1] = refine[part][1]; - m[2] = refine[part][2]; - if ( (m[0] * m[1] * m[2]) > 1) - { - for (box = 0; box < pdata.nboxes; box++) - { - MapProblemIndex(pdata.ilowers[box], m); - MapProblemIndex(pdata.iuppers[box], m); - } - - for (entry = 0; entry < pdata.graph_nentries; entry++) - { - MapProblemIndex(pdata.graph_ilowers[entry], m); - MapProblemIndex(pdata.graph_iuppers[entry], m); - mmap[0] = m[pdata.graph_index_maps[entry][0]]; - mmap[1] = m[pdata.graph_index_maps[entry][1]]; - mmap[2] = m[pdata.graph_index_maps[entry][2]]; - MapProblemIndex(pdata.graph_to_ilowers[entry], mmap); - MapProblemIndex(pdata.graph_to_iuppers[entry], mmap); - } - for (entry = 0; entry < pdata.matrix_nentries; entry++) - { - MapProblemIndex(pdata.matrix_ilowers[entry], m); - MapProblemIndex(pdata.matrix_iuppers[entry], m); - } - } - - /* refine and distribute boxes */ - m[0] = distribute[part][0]; - m[1] = distribute[part][1]; - m[2] = distribute[part][2]; - if ( (m[0] * m[1] * m[2]) > 1) - { - p = pid % m[0]; - q = ((pid - p) / m[0]) % m[1]; - r = (pid - p - q * m[0]) / (m[0] * m[1]); - - for (box = 0; box < pdata.nboxes; box++) - { - n[0] = pdata.iuppers[box][0] - pdata.ilowers[box][0] + 1; - n[1] = pdata.iuppers[box][1] - pdata.ilowers[box][1] + 1; - n[2] = pdata.iuppers[box][2] - pdata.ilowers[box][2] + 1; - - MapProblemIndex(pdata.ilowers[box], m); - MapProblemIndex(pdata.iuppers[box], m); - pdata.iuppers[box][0] = pdata.ilowers[box][0] + n[0] - 1; - 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]; - } - - i = 0; - for (entry = 0; entry < pdata.graph_nentries; entry++) - { - MapProblemIndex(pdata.graph_ilowers[entry], m); - MapProblemIndex(pdata.graph_iuppers[entry], m); - mmap[0] = m[pdata.graph_index_maps[entry][0]]; - mmap[1] = m[pdata.graph_index_maps[entry][1]]; - mmap[2] = m[pdata.graph_index_maps[entry][2]]; - MapProblemIndex(pdata.graph_to_ilowers[entry], mmap); - MapProblemIndex(pdata.graph_to_iuppers[entry], mmap); - - for (box = 0; box < pdata.nboxes; box++) - { - size = IntersectBoxes(pdata.graph_ilowers[entry], - pdata.graph_iuppers[entry], - pdata.ilowers[box], - pdata.iuppers[box], - int_ilower, int_iupper); - if (size > 0) - { - /* if there is an intersection, it is the only one */ - for (d = 0; d < 3; d++) - { - dmap = pdata.graph_index_maps[entry][d]; - sign = pdata.graph_index_signs[entry][d]; - pdata.graph_to_iuppers[i][dmap] = - pdata.graph_to_ilowers[entry][dmap] + sign * - (int_iupper[d] - pdata.graph_ilowers[entry][d]); - pdata.graph_to_ilowers[i][dmap] = - pdata.graph_to_ilowers[entry][dmap] + sign * - (int_ilower[d] - pdata.graph_ilowers[entry][d]); - pdata.graph_ilowers[i][d] = int_ilower[d]; - pdata.graph_iuppers[i][d] = int_iupper[d]; - pdata.graph_strides[i][d] = - pdata.graph_strides[entry][d]; - pdata.graph_to_strides[i][d] = - pdata.graph_to_strides[entry][d]; - pdata.graph_index_maps[i][d] = dmap; - pdata.graph_index_signs[i][d] = sign; - } - for (d = 3; d < 9; d++) - { - pdata.graph_ilowers[i][d] = - pdata.graph_ilowers[entry][d]; - pdata.graph_iuppers[i][d] = - pdata.graph_iuppers[entry][d]; - pdata.graph_to_ilowers[i][d] = - pdata.graph_to_ilowers[entry][d]; - pdata.graph_to_iuppers[i][d] = - pdata.graph_to_iuppers[entry][d]; - } - pdata.graph_vars[i] = pdata.graph_vars[entry]; - pdata.graph_to_parts[i] = pdata.graph_to_parts[entry]; - pdata.graph_to_vars[i] = pdata.graph_to_vars[entry]; - pdata.graph_entries[i] = pdata.graph_entries[entry]; - pdata.graph_values[i] = pdata.graph_values[entry]; - i++; - break; - } - } - } - pdata.graph_nentries = i; - - i = 0; - for (entry = 0; entry < pdata.matrix_nentries; entry++) - { - MapProblemIndex(pdata.matrix_ilowers[entry], m); - MapProblemIndex(pdata.matrix_iuppers[entry], m); - - for (box = 0; box < pdata.nboxes; box++) - { - size = IntersectBoxes(pdata.matrix_ilowers[entry], - pdata.matrix_iuppers[entry], - pdata.ilowers[box], - pdata.iuppers[box], - int_ilower, int_iupper); - if (size > 0) - { - /* if there is an intersection, it is the only one */ - for (d = 0; d < 3; d++) - { - pdata.matrix_ilowers[i][d] = int_ilower[d]; - pdata.matrix_iuppers[i][d] = int_iupper[d]; - pdata.matrix_strides[i][d] = - pdata.matrix_strides[entry][d]; - } - for (d = 3; d < 9; d++) - { - pdata.matrix_ilowers[i][d] = - pdata.matrix_ilowers[entry][d]; - pdata.matrix_iuppers[i][d] = - pdata.matrix_iuppers[entry][d]; - } - pdata.matrix_vars[i] = pdata.matrix_vars[entry]; - pdata.matrix_entries[i] = pdata.matrix_entries[entry]; - pdata.matrix_values[i] = pdata.matrix_values[entry]; - i++; - break; - } - } - } - pdata.matrix_nentries = i; - } - - /* refine and block boxes */ - m[0] = block[part][0]; - m[1] = block[part][1]; - 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); - for (box = 0; box < pdata.nboxes; box++) - { - n[0] = pdata.iuppers[box][0] - pdata.ilowers[box][0] + 1; - n[1] = pdata.iuppers[box][1] - pdata.ilowers[box][1] + 1; - n[2] = pdata.iuppers[box][2] - pdata.ilowers[box][2] + 1; - - MapProblemIndex(pdata.ilowers[box], m); - - MapProblemIndex(pdata.iuppers[box], m); - pdata.iuppers[box][0] = pdata.ilowers[box][0] + n[0] - 1; - pdata.iuppers[box][1] = pdata.ilowers[box][1] + n[1] - 1; - pdata.iuppers[box][2] = pdata.ilowers[box][2] + n[2] - 1; - - i = box; - for (r = 0; r < m[2]; r++) - { - for (q = 0; q < m[1]; q++) - { - 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]; - for (d = 3; d < 9; d++) - { - pdata.ilowers[i][d] = pdata.ilowers[box][d]; - pdata.iuppers[i][d] = pdata.iuppers[box][d]; - } - i += pdata.nboxes; - } - } - } - } - pdata.nboxes *= m[0] * m[1] * m[2]; - - for (entry = 0; entry < pdata.graph_nentries; entry++) - { - MapProblemIndex(pdata.graph_ilowers[entry], m); - MapProblemIndex(pdata.graph_iuppers[entry], m); - mmap[0] = m[pdata.graph_index_maps[entry][0]]; - mmap[1] = m[pdata.graph_index_maps[entry][1]]; - mmap[2] = m[pdata.graph_index_maps[entry][2]]; - MapProblemIndex(pdata.graph_to_ilowers[entry], mmap); - MapProblemIndex(pdata.graph_to_iuppers[entry], mmap); - } - for (entry = 0; entry < pdata.matrix_nentries; entry++) - { - MapProblemIndex(pdata.matrix_ilowers[entry], m); - MapProblemIndex(pdata.matrix_iuppers[entry], m); - } - } - - /* map remaining ilowers & iuppers */ - m[0] = refine[part][0] * block[part][0] * distribute[part][0]; - m[1] = refine[part][1] * block[part][1] * distribute[part][1]; - m[2] = refine[part][2] * block[part][2] * distribute[part][2]; - if ( (m[0] * m[1] * m[2]) > 1) - { - for (box = 0; box < pdata.glue_nboxes; box++) - { - MapProblemIndex(pdata.glue_ilowers[box], m); - MapProblemIndex(pdata.glue_iuppers[box], m); - mmap[0] = m[pdata.glue_index_maps[box][0]]; - mmap[1] = m[pdata.glue_index_maps[box][1]]; - mmap[2] = m[pdata.glue_index_maps[box][2]]; - MapProblemIndex(pdata.glue_nbor_ilowers[box], mmap); - MapProblemIndex(pdata.glue_nbor_iuppers[box], mmap); - } - } - - /* compute box sizes, etc. */ - pdata.max_boxsize = 0; - for (box = 0; box < pdata.nboxes; box++) - { - pdata.boxsizes[box] = 1; - for (i = 0; i < 3; i++) - { - pdata.boxsizes[box] *= - (pdata.iuppers[box][i] - pdata.ilowers[box][i] + 2); - } - pdata.max_boxsize = - hypre_max(pdata.max_boxsize, pdata.boxsizes[box]); - } - for (box = 0; box < pdata.graph_nentries; box++) - { - pdata.graph_boxsizes[box] = 1; - for (i = 0; i < 3; i++) - { - pdata.graph_boxsizes[box] *= - (pdata.graph_iuppers[box][i] - - pdata.graph_ilowers[box][i] + 1); - } - } - } - - if (pdata.nboxes == 0) - { - hypre_TFree(pdata.ilowers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.iuppers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.boxsizes, HYPRE_MEMORY_HOST); - pdata.max_boxsize = 0; - } - - if (pdata.glue_nboxes == 0) - { - hypre_TFree(pdata.glue_ilowers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.glue_iuppers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.glue_nbor_parts, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.glue_nbor_ilowers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.glue_nbor_iuppers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.glue_index_maps, HYPRE_MEMORY_HOST); - } - - if (pdata.graph_nentries == 0) - { - hypre_TFree(pdata.graph_ilowers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_iuppers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_strides, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_vars, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_to_parts, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_to_ilowers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_to_iuppers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_to_strides, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_to_vars, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_index_maps, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_index_signs, HYPRE_MEMORY_HOST); - 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, memory_location); - hypre_TFree(pdata.graph_boxsizes, HYPRE_MEMORY_HOST); - } - - 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); - pdata.matrix_values_size = 0; - hypre_TFree(pdata.matrix_values, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.d_matrix_values, memory_location); - } - - data.pdata[part] = pdata; - } - - data.max_boxsize = 0; - for (part = 0; part < data.nparts; part++) - { - data.max_boxsize = - hypre_max(data.max_boxsize, data.pdata[part].max_boxsize); - } - - hypre_TFree(pool_procs, HYPRE_MEMORY_HOST); - - *data_ptr = data; - return 0; -} - -/*-------------------------------------------------------------------------- - * Destroy data - *--------------------------------------------------------------------------*/ - -HYPRE_Int -DestroyData( ProblemData data ) -{ - HYPRE_MemoryLocation memory_location = data.memory_location; - ProblemPartData pdata; - HYPRE_Int part, s; - - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - - if (pdata.nboxes > 0) - { - hypre_TFree(pdata.ilowers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.iuppers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.boxsizes, HYPRE_MEMORY_HOST); - } - - if (pdata.nvars > 0) - { - hypre_TFree(pdata.vartypes, HYPRE_MEMORY_HOST); - } - - if (pdata.add_nvars > 0) - { - hypre_TFree(pdata.add_indexes, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.add_vartypes, HYPRE_MEMORY_HOST); - } - - if (pdata.glue_nboxes > 0) - { - hypre_TFree(pdata.glue_ilowers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.glue_iuppers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.glue_nbor_parts, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.glue_nbor_ilowers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.glue_nbor_iuppers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.glue_index_maps, HYPRE_MEMORY_HOST); - } - - if (pdata.nvars > 0) - { - hypre_TFree(pdata.stencil_num, HYPRE_MEMORY_HOST); - } - - if (pdata.graph_nentries > 0) - { - hypre_TFree(pdata.graph_ilowers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_iuppers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_strides, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_vars, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_to_parts, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_to_ilowers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_to_iuppers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_to_strides, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_to_vars, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_index_maps, HYPRE_MEMORY_HOST); - 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, memory_location); - hypre_TFree(pdata.graph_boxsizes, HYPRE_MEMORY_HOST); - } - - 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.d_matrix_values, memory_location); - } - - } - hypre_TFree(data.pdata, HYPRE_MEMORY_HOST); - - for (s = 0; s < data.nstencils; s++) - { - hypre_TFree(data.stencil_offsets[s], HYPRE_MEMORY_HOST); - hypre_TFree(data.stencil_vars[s], HYPRE_MEMORY_HOST); - hypre_TFree(data.stencil_values[s], HYPRE_MEMORY_HOST); - } - hypre_TFree(data.stencil_sizes, HYPRE_MEMORY_HOST); - hypre_TFree(data.stencil_offsets, HYPRE_MEMORY_HOST); - hypre_TFree(data.stencil_vars, HYPRE_MEMORY_HOST); - hypre_TFree(data.stencil_values, HYPRE_MEMORY_HOST); - - if (data.symmetric_nentries > 0) - { - hypre_TFree(data.symmetric_parts, HYPRE_MEMORY_HOST); - hypre_TFree(data.symmetric_vars, HYPRE_MEMORY_HOST); - hypre_TFree(data.symmetric_to_vars, HYPRE_MEMORY_HOST); - hypre_TFree(data.symmetric_booleans, HYPRE_MEMORY_HOST); - } - - hypre_TFree(data.pools, HYPRE_MEMORY_HOST); - - return 0; -} - -/*-------------------------------------------------------------------------- - * Compute new box based on variable type - *--------------------------------------------------------------------------*/ - -HYPRE_Int -GetVariableBox( Index cell_ilower, - Index cell_iupper, - HYPRE_Int int_vartype, - Index var_ilower, - Index var_iupper ) -{ - HYPRE_Int ierr = 0; - HYPRE_SStructVariable vartype = (HYPRE_SStructVariable) int_vartype; - - var_ilower[0] = cell_ilower[0]; - var_ilower[1] = cell_ilower[1]; - var_ilower[2] = cell_ilower[2]; - var_iupper[0] = cell_iupper[0]; - var_iupper[1] = cell_iupper[1]; - var_iupper[2] = cell_iupper[2]; - - switch (vartype) - { - case HYPRE_SSTRUCT_VARIABLE_CELL: - 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; - case HYPRE_SSTRUCT_VARIABLE_XFACE: - 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; - case HYPRE_SSTRUCT_VARIABLE_ZFACE: - 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; - case HYPRE_SSTRUCT_VARIABLE_YEDGE: - 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; - case HYPRE_SSTRUCT_VARIABLE_UNDEFINED: - break; - } - - return ierr; -} -/*-------------------------------------------------------------------------- - * Print usage info - *--------------------------------------------------------------------------*/ - -HYPRE_Int -PrintUsage( char *progname, - HYPRE_Int myid ) -{ - if ( myid == 0 ) - { - hypre_printf("\n"); - hypre_printf("Usage: %s []\n", progname); - hypre_printf("\n"); - hypre_printf(" -in : input file (default is `%s')\n", - infile_default); - hypre_printf("\n"); - hypre_printf(" -pt ... : set part(s) for subsequent options\n"); - hypre_printf(" -r : refine part(s)\n"); - hypre_printf(" -P : refine and distribute part(s)\n"); - hypre_printf(" -b : refine and block part(s)\n"); - hypre_printf(" -solver : solver ID (default = 39)\n"); - hypre_printf(" -print : print out the system\n"); - hypre_printf(" -sym : Struct- symmetric storage (1) or not (0)\n"); - - hypre_printf("\n"); - } - - return 0; -} - -/*-------------------------------------------------------------------------- - * Test driver for semi-structured matrix interface - *--------------------------------------------------------------------------*/ - -hypre_int -main( hypre_int argc, - char *argv[] ) -{ - char *infile; - ProblemData global_data; - ProblemData data; - ProblemPartData pdata; - HYPRE_Int nparts; - HYPRE_Int *parts; - Index *refine; - Index *distribute; - Index *block; - HYPRE_Int solver_id; - HYPRE_Int print_system; - - HYPRE_SStructGrid grid; - HYPRE_SStructStencil *stencils; - HYPRE_SStructGraph graph; - HYPRE_SStructMatrix A; - HYPRE_ParCSRMatrix T, parA; - HYPRE_SStructVector b; - HYPRE_SStructVector x; - HYPRE_ParVector parb, parx; - HYPRE_SStructSolver solver; - - HYPRE_StructGrid cell_grid; - hypre_Box *bounding_box; - HYPRE_Real h; - - HYPRE_Int **bdryRanks, *bdryRanksCnt; - - Index ilower, iupper; - Index index, to_index; - HYPRE_Real *values; - HYPRE_Real *d_values; - - HYPRE_Int num_iterations; - HYPRE_Real final_res_norm; - - HYPRE_Int num_procs, myid; - HYPRE_Int time_index; - - 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_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 - *-----------------------------------------------------------*/ - - /* 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); - - /*----------------------------------------------------------------- - * GPU Device binding - * Must be done before HYPRE_Initialize() and should not be changed after - *-----------------------------------------------------------------*/ - hypre_bind_device_id(-1, myid, num_procs, hypre_MPI_COMM_WORLD); - - /*----------------------------------------------------------- - * Initialize : must be the first HYPRE function to call - *-----------------------------------------------------------*/ - HYPRE_Initialize(); - HYPRE_DeviceInitialize(); - - /*----------------------------------------------------------- - * Read input file - *-----------------------------------------------------------*/ - - arg_index = 1; - - /* parse command line for input file name */ - infile = infile_default; - if (argc > 1) - { - if ( strcmp(argv[arg_index], "-in") == 0 ) - { - arg_index++; - infile = argv[arg_index++]; - } - } - - ReadData(infile, &global_data); - - /*----------------------------------------------------------- - * Set defaults - *-----------------------------------------------------------*/ - - 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; - } - } - - solver_id = 0; - print_system = 0; - - /*----------------------------------------------------------- - * Parse command line - *-----------------------------------------------------------*/ - - while (arg_index < argc) - { - if ( strcmp(argv[arg_index], "-pt") == 0 ) - { - arg_index++; - nparts = 0; - while ( strncmp(argv[arg_index], "-", 1) != 0 ) - { - parts[nparts++] = atoi(argv[arg_index++]); - } - } - else if ( strcmp(argv[arg_index], "-r") == 0 ) - { - arg_index++; - for (i = 0; i < nparts; i++) - { - part = parts[i]; - k = arg_index; - for (j = 0; j < 3; j++) - { - refine[part][j] = atoi(argv[k++]); - } - } - arg_index += 3; - } - else if ( strcmp(argv[arg_index], "-P") == 0 ) - { - arg_index++; - for (i = 0; i < nparts; i++) - { - part = parts[i]; - k = arg_index; - for (j = 0; j < 3; j++) - { - distribute[part][j] = atoi(argv[k++]); - } - } - arg_index += 3; - } - else if ( strcmp(argv[arg_index], "-b") == 0 ) - { - arg_index++; - for (i = 0; i < nparts; i++) - { - part = parts[i]; - k = arg_index; - for (j = 0; j < 3; j++) - { - block[part][j] = atoi(argv[k++]); - } - } - arg_index += 3; - } - 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], "-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_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++; - snprintf(mem_tracker_name, HYPRE_MAX_FILE_NAME_LEN, "%s", argv[arg_index++]); - } -#endif - else if ( strcmp(argv[arg_index], "-help") == 0 ) - { - PrintUsage(argv[0], myid); - exit(1); - break; - } - else - { - break; - } - } - -#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); - - /* default execution policy */ - HYPRE_SetExecutionPolicy(default_exec_policy); - -#if defined(HYPRE_USING_GPU) - HYPRE_SetSpGemmUseVendor(spgemm_use_vendor); -#endif - - /*----------------------------------------------------------- - * Distribute data - *-----------------------------------------------------------*/ - - DistributeData(global_data, refine, distribute, block, - num_procs, myid, &data); - - /*----------------------------------------------------------- - * Synchronize so that timings make sense - *-----------------------------------------------------------*/ - - hypre_MPI_Barrier(hypre_MPI_COMM_WORLD); - - /*----------------------------------------------------------- - * Set up the grid - *-----------------------------------------------------------*/ - - time_index = hypre_InitializeTiming("SStruct Interface"); - hypre_BeginTiming(time_index); - - HYPRE_SStructGridCreate(hypre_MPI_COMM_WORLD, data.ndim, data.nparts, &grid); - 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]); - } - - HYPRE_SStructGridSetVariables(grid, part, pdata.nvars, pdata.vartypes); - - /* GridAddVariabes */ - - /* GridSetNeighborBox */ - for (box = 0; box < pdata.glue_nboxes; box++) - { - hypre_printf("Error: No longer supporting SetNeighborBox\n"); -#if 0 - HYPRE_SStructGridSetNeighborBox(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]); -#endif - } - - HYPRE_SStructGridSetPeriodic(grid, part, pdata.periodic); - } - HYPRE_SStructGridAssemble(grid); - - /*----------------------------------------------------------- - * Set up the stencils - *-----------------------------------------------------------*/ - - 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 (i = 0; i < data.stencil_sizes[s]; i++) - { - HYPRE_SStructStencilSetEntry(stencils[s], i, - data.stencil_offsets[s][i], - data.stencil_vars[s][i]); - } - } - - /*----------------------------------------------------------- - * Set up the graph - *-----------------------------------------------------------*/ - - HYPRE_SStructGraphCreate(hypre_MPI_COMM_WORLD, grid, &graph); - HYPRE_SStructGraphSetObjectType(graph, HYPRE_PARCSR); - - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - - /* set stencils */ - for (var = 0; var < pdata.nvars; var++) - { - HYPRE_SStructGraphSetStencil(graph, part, var, - stencils[pdata.stencil_num[var]]); - } - - /* add entries */ - for (entry = 0; entry < pdata.graph_nentries; entry++) - { - for (index[2] = pdata.graph_ilowers[entry][2]; - index[2] <= pdata.graph_iuppers[entry][2]; - index[2] += pdata.graph_strides[entry][2]) - { - for (index[1] = pdata.graph_ilowers[entry][1]; - index[1] <= pdata.graph_iuppers[entry][1]; - index[1] += pdata.graph_strides[entry][1]) - { - for (index[0] = pdata.graph_ilowers[entry][0]; - index[0] <= pdata.graph_iuppers[entry][0]; - index[0] += pdata.graph_strides[entry][0]) - { - for (i = 0; i < 3; i++) - { - j = pdata.graph_index_maps[entry][i]; - k = index[i] - pdata.graph_ilowers[entry][i]; - 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]; - } - HYPRE_SStructGraphAddEntries(graph, part, index, - pdata.graph_vars[entry], - pdata.graph_to_parts[entry], - to_index, - pdata.graph_to_vars[entry]); - } - } - } - } - } - - HYPRE_SStructGraphAssemble(graph); - - /*----------------------------------------------------------- - * Set up the matrix - *-----------------------------------------------------------*/ - - values = hypre_CTAlloc(HYPRE_Real, data.max_boxsize, HYPRE_MEMORY_HOST); - d_values = hypre_TAlloc(HYPRE_Real, data.max_boxsize, memory_location); - - HYPRE_SStructMatrixCreate(hypre_MPI_COMM_WORLD, graph, &A); - - /* TODO HYPRE_SStructMatrixSetSymmetric(A, 1); */ - for (entry = 0; entry < data.symmetric_nentries; entry++) - { - HYPRE_SStructMatrixSetSymmetric(A, - data.symmetric_parts[entry], - data.symmetric_vars[entry], - data.symmetric_to_vars[entry], - data.symmetric_booleans[entry]); - } - HYPRE_SStructMatrixSetNSSymmetric(A, data.ns_symmetric); - - HYPRE_SStructMatrixSetObjectType(A, HYPRE_PARCSR); - HYPRE_SStructMatrixInitialize(A); - - 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); - - 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) - { - h = (HYPRE_Real) (hypre_BoxIMax(bounding_box)[i] - hypre_BoxIMin(bounding_box)[i]); - } - } - h = 1.0 / h; - - /* set stencil values */ - for (var = 0; var < pdata.nvars; var++) - { - s = pdata.stencil_num[var]; - for (i = 0; i < data.stencil_sizes[s]; i++) - { - for (j = 0; j < pdata.max_boxsize; j++) - { - 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; - } - } - - hypre_TMemcpy(d_values, values, HYPRE_Real, data.max_boxsize, - 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(A, part, ilower, iupper, - var, 1, &i, d_values); - } - } - } - - hypre_TMemcpy(pdata.d_graph_values, pdata.graph_values, HYPRE_Real, pdata.graph_values_size, - memory_location, HYPRE_MEMORY_HOST); - - /* set non-stencil entries */ - for (entry = 0; entry < pdata.graph_nentries; entry++) - { - for (index[2] = pdata.graph_ilowers[entry][2]; - index[2] <= pdata.graph_iuppers[entry][2]; - index[2] += pdata.graph_strides[entry][2]) - { - for (index[1] = pdata.graph_ilowers[entry][1]; - index[1] <= pdata.graph_iuppers[entry][1]; - index[1] += pdata.graph_strides[entry][1]) - { - for (index[0] = pdata.graph_ilowers[entry][0]; - index[0] <= pdata.graph_iuppers[entry][0]; - index[0] += pdata.graph_strides[entry][0]) - { - HYPRE_SStructMatrixSetValues(A, part, index, - pdata.graph_vars[entry], - 1, &pdata.graph_entries[entry], - &pdata.d_graph_values[entry]); - } - } - } - } - } - - /* reset matrix values: - * NOTE THAT THE matrix_ilowers & matrix_iuppers MUST BE IN TERMS OF THE - * CHOOSEN VAR_TYPE INDICES, UNLIKE THE EXTENTS OF THE GRID< WHICH ARE - * IN TEMS OF THE CELL VARTYPE INDICES. - */ - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - - hypre_TMemcpy(pdata.d_matrix_values, pdata.matrix_values, HYPRE_Real, pdata.matrix_values_size, - memory_location, HYPRE_MEMORY_HOST); - - for (entry = 0; entry < pdata.matrix_nentries; entry++) - { - for (index[2] = pdata.matrix_ilowers[entry][2]; - index[2] <= pdata.matrix_iuppers[entry][2]; - index[2] += pdata.matrix_strides[entry][2]) - { - for (index[1] = pdata.matrix_ilowers[entry][1]; - index[1] <= pdata.matrix_iuppers[entry][1]; - index[1] += pdata.matrix_strides[entry][1]) - { - for (index[0] = pdata.matrix_ilowers[entry][0]; - index[0] <= pdata.matrix_iuppers[entry][0]; - index[0] += pdata.matrix_strides[entry][0]) - { - HYPRE_SStructMatrixSetValues(A, part, index, - pdata.matrix_vars[entry], - 1, &pdata.matrix_entries[entry], - &pdata.d_matrix_values[entry]); - } - } - } - } - } - - HYPRE_SStructMatrixAssemble(A); - HYPRE_MaxwellGrad(grid, &T); - - /* eliminate the physical boundary points */ - HYPRE_SStructMatrixGetObject(A, (void **) &parA); - HYPRE_SStructMaxwellPhysBdy(&grid, 1, data.rfactor, - &bdryRanks, &bdryRanksCnt); - - HYPRE_SStructMaxwellEliminateRowsCols(parA, bdryRanksCnt[0], bdryRanks[0]); - - /*{ - hypre_MaxwellOffProcRow **OffProcRows; - hypre_SStructSharedDOF_ParcsrMatRowsComm(grid, - (hypre_ParCSRMatrix *) parA, - &i, - &OffProcRows); - for (j= 0; j< i; j++) - { - hypre_MaxwellOffProcRowDestroy((void *) OffProcRows[j]); - } - hypre_TFree(OffProcRows, HYPRE_MEMORY_HOST); - }*/ - - /*----------------------------------------------------------- - * Set up the linear system - *-----------------------------------------------------------*/ - - HYPRE_SStructVectorCreate(hypre_MPI_COMM_WORLD, grid, &b); - HYPRE_SStructVectorSetObjectType(b, HYPRE_PARCSR); - - HYPRE_SStructVectorInitialize(b); - for (j = 0; j < data.max_boxsize; 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, - 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_SStructVectorAssemble(b); - - HYPRE_SStructVectorCreate(hypre_MPI_COMM_WORLD, grid, &x); - HYPRE_SStructVectorSetObjectType(x, HYPRE_PARCSR); - - HYPRE_SStructVectorInitialize(x); - for (j = 0; j < data.max_boxsize; j++) - { - values[j] = 0.0; - } - - hypre_TMemcpy(d_values, values, HYPRE_Real, data.max_boxsize, - 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(x, part, ilower, iupper, - var, d_values); - } - } - } - HYPRE_SStructVectorAssemble(x); - - HYPRE_SStructVectorGetObject(x, (void **) &parx); - HYPRE_SStructVectorGetObject(b, (void **) &parb); - HYPRE_SStructMaxwellZeroVector(parx, bdryRanks[0], bdryRanksCnt[0]); - HYPRE_SStructMaxwellZeroVector(parb, bdryRanks[0], bdryRanksCnt[0]); - - hypre_TFree(bdryRanks[0], HYPRE_MEMORY_HOST); - hypre_TFree(bdryRanks, HYPRE_MEMORY_HOST); - hypre_TFree(bdryRanksCnt, HYPRE_MEMORY_HOST); - - hypre_EndTiming(time_index); - hypre_PrintTiming("SStruct Interface", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - - /*----------------------------------------------------------- - * Print out the system and initial guess - *-----------------------------------------------------------*/ - - if (print_system) - { - HYPRE_SStructMatrixPrint("sstruct.out.A", A, 0); - HYPRE_SStructVectorPrint("sstruct.out.b", b, 0); - HYPRE_SStructVectorPrint("sstruct.out.x0", x, 0); - } - - /*----------------------------------------------------------- - * Debugging code - *-----------------------------------------------------------*/ - - hypre_TFree(values, HYPRE_MEMORY_HOST); - hypre_TFree(d_values, memory_location); - - if (solver_id == 1) - { - time_index = hypre_InitializeTiming("Maxwell Setup"); - hypre_BeginTiming(time_index); - - HYPRE_SStructMaxwellCreate(hypre_MPI_COMM_WORLD, &solver); - HYPRE_SStructMaxwellSetMaxIter(solver, 20); - HYPRE_SStructMaxwellSetTol(solver, 1.0e-8); - HYPRE_SStructMaxwellSetRelChange(solver, 0); - HYPRE_SStructMaxwellSetNumPreRelax(solver, 1); - HYPRE_SStructMaxwellSetNumPostRelax(solver, 1); - HYPRE_SStructMaxwellSetRfactors(solver, data.rfactor); - HYPRE_SStructMaxwellSetGrad(solver, T); - /*HYPRE_SStructMaxwellSetConstantCoef(solver, 1);*/ - HYPRE_SStructMaxwellSetPrintLevel(solver, 1); - HYPRE_SStructMaxwellSetLogging(solver, 1); - HYPRE_SStructMaxwellSetup(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("Maxwell Solve"); - hypre_BeginTiming(time_index); - - HYPRE_SStructMaxwellSolve(solver, A, b, x); - - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - - HYPRE_SStructMaxwellGetNumIterations(solver, &num_iterations); - HYPRE_SStructMaxwellGetFinalRelativeResidualNorm( - solver, &final_res_norm); - HYPRE_SStructMaxwellDestroy(solver); - } - - HYPRE_SStructVectorGather(x); - - /*----------------------------------------------------------- - * Print the solution and other info - *-----------------------------------------------------------*/ - - if (print_system) - { - HYPRE_SStructVectorPrint("sstruct.out.x", x, 0); - } - - 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"); - } - - /*----------------------------------------------------------- - * 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_ParCSRMatrixDestroy(T); - HYPRE_SStructVectorDestroy(b); - HYPRE_SStructVectorDestroy(x); - - - DestroyData(data); - - hypre_TFree(parts, HYPRE_MEMORY_HOST); - hypre_TFree(refine, HYPRE_MEMORY_HOST); - hypre_TFree(distribute, HYPRE_MEMORY_HOST); - hypre_TFree(block, HYPRE_MEMORY_HOST); - - /* Finalize Hypre */ - HYPRE_Finalize(); - - /* 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/src/test/runtest.sh b/src/test/runtest.sh index 37a3d3938b..812559298e 100755 --- a/src/test/runtest.sh +++ b/src/test/runtest.sh @@ -101,7 +101,7 @@ function MpirunString # RunString="${RunString} -nodes $POE_NUM_NODES $MY_ARGS" RunString="poe $MY_ARGS -rmpool pdebug -procs $POE_NUM_PROCS -nodes $POE_NUM_NODES" ;; - rzhound*|aztec*|cab*|quartz*|sierra*|syrah*|vulcan*) + rzhound*|aztec*|cab*|dane*|quartz*|sierra*|syrah*|vulcan*) shift if [ $NumThreads -gt 0 ] ; then export OMP_NUM_THREADS=$NumThreads diff --git a/src/test/sstruct.c b/src/test/sstruct.c index a0346e155c..5975a022c3 100644 --- a/src/test/sstruct.c +++ b/src/test/sstruct.c @@ -10,30 +10,27 @@ #include #include "_hypre_utilities.h" +#include "_hypre_parcsr_mv.h" // Delete this #include "HYPRE_sstruct_ls.h" #include "HYPRE_struct_ls.h" #include "HYPRE_krylov.h" #include "_hypre_sstruct_mv.h" -//#include "_hypre_struct_mv.hpp" +//#include "sstruct_helpers.h" /* TODO (VPM): remove duplicated code below provided here */ /* begin lobpcg */ #include #include "HYPRE_lobpcg.h" +#include "_hypre_lobpcg.h" #define NO_SOLVER -9198 /* end lobpcg */ #define DEBUG 0 - -#define SECOND_TIME 0 - -/*-------------------------------------------------------------------------- - * Data structures - *--------------------------------------------------------------------------*/ +#define DEBUG_SSGRAPH 0 char infile_default[50] = "sstruct.in.default"; @@ -338,7 +335,7 @@ SScanProblemIndex( char *sdata_ptr, ProblemIndex index ) { HYPRE_Int i; - char sign[3]; + char sign[3] = ""; /* initialize index array */ for (i = 0; i < 9; i++) @@ -404,7 +401,8 @@ SScanProblemIndex( char *sdata_ptr, } HYPRE_Int -ReadData( char *filename, +ReadData( MPI_Comm comm, + char *filename, ProblemData *data_ptr ) { ProblemData data; @@ -430,14 +428,14 @@ ReadData( char *filename, * Read data file from process 0, then broadcast *-----------------------------------------------------------*/ - hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &myid); + hypre_MPI_Comm_rank(comm, &myid); if (myid == 0) { if ((file = fopen(filename, "r")) == NULL) { hypre_printf("Error: can't open input file %s\n", filename); - exit(1); + hypre_MPI_Abort(comm, -1); } /* allocate initial space, and read first input line */ @@ -465,11 +463,11 @@ ReadData( char *filename, fclose(file); } /* broadcast the data size */ - hypre_MPI_Bcast(&sdata_size, 1, HYPRE_MPI_INT, 0, hypre_MPI_COMM_WORLD); + hypre_MPI_Bcast(&sdata_size, 1, HYPRE_MPI_INT, 0, comm); /* broadcast the data */ - sdata = hypre_TReAlloc(sdata, char, sdata_size, HYPRE_MEMORY_HOST); - hypre_MPI_Bcast(sdata, sdata_size, hypre_MPI_CHAR, 0, hypre_MPI_COMM_WORLD); + sdata = hypre_TReAlloc(sdata, char, sdata_size, HYPRE_MEMORY_HOST); + hypre_MPI_Bcast(sdata, sdata_size, hypre_MPI_CHAR, 0, comm); /*----------------------------------------------------------- * Parse the data and fill ProblemData structure @@ -544,7 +542,7 @@ ReadData( char *filename, if ( (il != 0) || (iu != 1) ) { hypre_printf("Error: Invalid use of `+-' in GridSetExtents\n"); - exit(1); + hypre_MPI_Abort(comm, -1); } pdata.boxsizes[pdata.nboxes] = 1; for (i = 0; i < 3; i++) @@ -571,7 +569,7 @@ ReadData( char *filename, { /* TODO */ hypre_printf("GridAddVariables not yet implemented!\n"); - exit(1); + hypre_MPI_Abort(comm, -1); } else if ( strcmp(key, "GridSetNeighborPart:") == 0 || strcmp(key, "GridSetSharedPart:") == 0 ) @@ -673,7 +671,7 @@ ReadData( char *filename, if (data.fem_nvars > 0) { hypre_printf("Stencil and FEMStencil cannot be used together\n"); - exit(1); + hypre_MPI_Abort(comm, -1); } data.nstencils = strtol(sdata_ptr, &sdata_ptr, 10); data.stencil_sizes = hypre_CTAlloc(HYPRE_Int, data.nstencils, HYPRE_MEMORY_HOST); @@ -718,7 +716,7 @@ ReadData( char *filename, if (data.nstencils > 0) { hypre_printf("Stencil and FEMStencil cannot be used together\n"); - exit(1); + hypre_MPI_Abort(comm, -1); } data.fem_nvars = strtol(sdata_ptr, &sdata_ptr, 10); data.fem_offsets = hypre_CTAlloc(Index, data.fem_nvars, HYPRE_MEMORY_HOST); @@ -1184,13 +1182,21 @@ IntersectBoxes( ProblemIndex ilower1, } HYPRE_Int -DistributeData( ProblemData global_data, +BoxVolume( Index ilower, + Index iupper ) +{ + return (iupper[0] - ilower[0] + 1) * + (iupper[1] - ilower[1] + 1) * + (iupper[2] - ilower[2] + 1); +} + +HYPRE_Int +DistributeData( MPI_Comm comm, + ProblemData global_data, HYPRE_Int pooldist, Index *refine, Index *distribute, Index *block, - HYPRE_Int num_procs, - HYPRE_Int myid, ProblemData *data_ptr ) { HYPRE_MemoryLocation memory_location = global_data.memory_location; @@ -1204,6 +1210,11 @@ DistributeData( ProblemData global_data, HYPRE_Real *dptr; Index m, mmap, n; ProblemIndex ilower, iupper, int_ilower, int_iupper; + HYPRE_Int myid, num_procs; + + /* Set MPI variables */ + hypre_MPI_Comm_rank(comm, &myid); + hypre_MPI_Comm_size(comm, &num_procs); /* set default pool distribution */ data.npools = data.dist_npools[pooldist]; @@ -1224,12 +1235,12 @@ DistributeData( ProblemData global_data, pool_procs[pool] = pool_procs[pool - 1] + pool_procs[pool]; } - /* check number of processes */ - if (pool_procs[data.npools] != num_procs) + /* check number of processes (allow for having more procs than needed) */ + if (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); + hypre_MPI_Abort(comm, -1); } /* modify part data */ @@ -2177,7 +2188,9 @@ 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(" -fromfile : read SStructMatrix A from file\n"); + hypre_printf(" -rhsfromfile : read SStructVector b from file\n"); + hypre_printf(" -x0fromfile : read SStructVector x0 from file\n"); hypre_printf("\n"); hypre_printf(" -pt ... : set part(s) for subsequent options\n"); hypre_printf(" -pooldist

: pool distribution to use\n"); @@ -2185,13 +2198,19 @@ PrintUsage( char *progname, hypre_printf(" -P : refine and distribute part(s)\n"); hypre_printf(" -b : refine and block part(s)\n"); hypre_printf(" -solver : solver ID (default = 39)\n"); + hypre_printf(" -3 - ParCSR Matvec\n"); + hypre_printf(" -2 - Struct Matvec\n"); + hypre_printf(" -1 - SStruct Matvec\n"); hypre_printf(" 0 - SMG split solver\n"); hypre_printf(" 1 - PFMG split solver\n"); hypre_printf(" 3 - SysPFMG\n"); + hypre_printf(" 4 - SSAMG\n"); + hypre_printf(" 5 - BoomerAMG\n"); hypre_printf(" 8 - 1-step Jacobi split solver\n"); hypre_printf(" 10 - PCG with SMG split precond\n"); hypre_printf(" 11 - PCG with PFMG split precond\n"); hypre_printf(" 13 - PCG with SysPFMG precond\n"); + hypre_printf(" 14 - PCG with SSAMG precond\n"); hypre_printf(" 18 - PCG with diagonal scaling\n"); hypre_printf(" 19 - PCG\n"); hypre_printf(" 20 - PCG with BoomerAMG precond\n"); @@ -2200,6 +2219,8 @@ PrintUsage( char *progname, hypre_printf(" 28 - PCG with diagonal scaling\n"); hypre_printf(" 30 - GMRES with SMG split precond\n"); hypre_printf(" 31 - GMRES with PFMG split precond\n"); + hypre_printf(" 33 - GMRES with SysPFMG precond\n"); + hypre_printf(" 34 - GMRES with SSAMG precond\n"); hypre_printf(" 38 - GMRES with diagonal scaling\n"); hypre_printf(" 39 - GMRES\n"); hypre_printf(" 40 - GMRES with BoomerAMG precond\n"); @@ -2207,6 +2228,8 @@ PrintUsage( char *progname, hypre_printf(" 42 - GMRES with ParaSails precond\n"); hypre_printf(" 50 - BiCGSTAB with SMG split precond\n"); hypre_printf(" 51 - BiCGSTAB with PFMG split precond\n"); + hypre_printf(" 53 - BiCGSTAB with SysPFMG precond\n"); + hypre_printf(" 54 - BiCGSTAB with SSAMG precond\n"); hypre_printf(" 58 - BiCGSTAB with diagonal scaling\n"); hypre_printf(" 59 - BiCGSTAB\n"); hypre_printf(" 60 - BiCGSTAB with BoomerAMG precond\n"); @@ -2214,6 +2237,8 @@ PrintUsage( char *progname, hypre_printf(" 62 - BiCGSTAB with ParaSails precond\n"); hypre_printf(" 70 - Flexible GMRES with SMG split precond\n"); hypre_printf(" 71 - Flexible GMRES with PFMG split precond\n"); + hypre_printf(" 73 - Flexible GMRES with SysPFMG precond\n"); + hypre_printf(" 74 - Flexible GMRES with SSAMG precond\n"); hypre_printf(" 78 - Flexible GMRES with diagonal scaling\n"); hypre_printf(" 80 - Flexible GMRES with BoomerAMG precond\n"); hypre_printf(" 90 - LGMRES with BoomerAMG precond\n"); @@ -2221,32 +2246,29 @@ PrintUsage( char *progname, hypre_printf(" 150- AMS solver\n"); hypre_printf(" 200- Struct SMG\n"); hypre_printf(" 201- Struct PFMG\n"); - hypre_printf(" 202- Struct SparseMSG\n"); hypre_printf(" 203- Struct PFMG constant coefficients\n"); hypre_printf(" 204- Struct PFMG constant coefficients variable diagonal\n"); hypre_printf(" 205- Struct Cyclic Reduction\n"); hypre_printf(" 208- Struct Jacobi\n"); hypre_printf(" 210- Struct CG with SMG precond\n"); hypre_printf(" 211- Struct CG with PFMG precond\n"); - hypre_printf(" 212- Struct CG with SparseMSG precond\n"); hypre_printf(" 217- Struct CG with 2-step Jacobi\n"); hypre_printf(" 218- Struct CG with diagonal scaling\n"); hypre_printf(" 219- Struct CG\n"); hypre_printf(" 220- Struct Hybrid with SMG precond\n"); hypre_printf(" 221- Struct Hybrid with PFMG precond\n"); - hypre_printf(" 222- Struct Hybrid with SparseMSG precond\n"); hypre_printf(" 230- Struct GMRES with SMG precond\n"); hypre_printf(" 231- Struct GMRES with PFMG precond\n"); - hypre_printf(" 232- Struct GMRES with SparseMSG precond\n"); hypre_printf(" 237- Struct GMRES with 2-step Jacobi\n"); hypre_printf(" 238- Struct GMRES with diagonal scaling\n"); hypre_printf(" 239- Struct GMRES\n"); hypre_printf(" 240- Struct BiCGSTAB with SMG precond\n"); hypre_printf(" 241- Struct BiCGSTAB with PFMG precond\n"); - hypre_printf(" 242- Struct BiCGSTAB with SparseMSG precond\n"); 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(" -sym : check symmetry of matrix A\n"); + hypre_printf(" -Aones : compute A times vector of ones\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"); @@ -2256,31 +2278,82 @@ PrintUsage( char *progname, 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"); - hypre_printf(" -tol : convergence tolerance (default 1e-6)\n"); + hypre_printf(" -rhszero : rhs vector has zero components\n"); + hypre_printf(" -rhsone : rhs vector has unit components\n"); + hypre_printf(" -x0zero : initial solution (x0) has zero components \n"); + hypre_printf(" -x0one : initial solution (x0) has unit components \n"); + hypre_printf(" -x0rand : initial solution (x0) has random components \n"); + hypre_printf(" -xone : solution (x) is vector with unit components\n"); + hypre_printf(" -tol : convergence tolerance (def 1e-6)\n"); hypre_printf(" -solver_type : Solver type for Hybrid\n"); hypre_printf(" 1 - PCG (default)\n"); hypre_printf(" 2 - GMRES\n"); hypre_printf(" 3 - BiCGSTAB (only ParCSRHybrid)\n"); hypre_printf(" -recompute : Recompute residual in PCG?\n"); - hypre_printf(" -v : SysPFMG and Struct- # of pre and post relax\n"); - hypre_printf(" -skip : SysPFMG and Struct- skip relaxation (0 or 1)\n"); - hypre_printf(" -rap : Struct- coarse grid operator type\n"); + hypre_printf(" -final_res : Compute final residual (def 0) \n"); + hypre_printf(" -itr : maximum number of iterations (def 100);\n"); + hypre_printf(" -k : dimension Krylov space for GMRES (def 10);\n"); + hypre_printf(" -aug : number of augmentation vectors LGMRES (def 2);\n"); + hypre_printf(" -rel_change : conv based on relative change of x (def 0);\n"); + hypre_printf(" -pfreq : print frequency for prec/solvers (def 1);\n"); + hypre_printf(" -lvl : maximum number of levels (default 100);\n"); + hypre_printf(" -v : # of pre-relaxation sweeps (def 1)\n"); + hypre_printf(" : # of pos-relaxation sweeps (def 1)\n"); + hypre_printf(" : # of coarse grid solver sweeps (def 1)\n"); + hypre_printf(" -max_coarse : maximum coarse size (def 1) \n"); + hypre_printf(" -csolver : SSAMG - Coarse solver type\n"); + hypre_printf(" 0 - Weighted Jacobi (default)\n"); + hypre_printf(" 1 - BoomerAMG\n"); + hypre_printf(" -skip : PFMG, SysPFMG and SSAMG- skip relaxation (0 or 1)\n"); + hypre_printf(" -rap : coarse grid operator type\n"); hypre_printf(" 0 - Galerkin (default)\n"); hypre_printf(" 1 - non-Galerkin ParFlow operators\n"); hypre_printf(" 2 - Galerkin, general operators\n"); - hypre_printf(" -relax : Struct- relaxation type\n"); + hypre_printf(" -interp : SSAMG unstructured interpolation type\n"); + hypre_printf(" -1 - No unstructured interpolation\n"); + hypre_printf(" 0 - Classical modified interpolation\n"); + hypre_printf(" -relax : (S)Struct - relaxation type\n"); hypre_printf(" 0 - Jacobi\n"); hypre_printf(" 1 - Weighted Jacobi (default)\n"); hypre_printf(" 2 - R/B Gauss-Seidel\n"); hypre_printf(" 3 - R/B Gauss-Seidel (nonsymmetric)\n"); + hypre_printf("\n"); + hypre_printf(" ParCSR - relaxation type\n"); + hypre_printf(" 0 - Weighted Jacobi\n"); + hypre_printf(" 1 - Gauss-Seidel (very slow!)\n"); + hypre_printf(" 3 - Hybrid Gauss-Seidel\n"); + hypre_printf(" 4 - Hybrid backward Gauss-Seidel\n"); + hypre_printf(" 6 - Hybrid symmetric Gauss-Seidel\n"); + hypre_printf(" 8 - symmetric L1-Gauss-Seidel\n"); + hypre_printf(" 13 - forward L1-Gauss-Seidel\n"); + hypre_printf(" 14 - backward L1-Gauss-Seidel\n"); + hypre_printf(" 15 - CG\n"); + hypre_printf(" 16 - Chebyshev\n"); + hypre_printf(" 17 - FCF-Jacobi\n"); + hypre_printf(" 18 - L1-Jacobi (may be used with -CF)\n"); + hypre_printf(" 9 - Gauss elimination (coarsest grid only) \n"); + hypre_printf(" 99 - Gauss elim. with pivoting (coarsest grid)\n"); + hypre_printf(" -rlx_coarse : BoomerAMG - set relaxation type for coarsest grid\n"); + hypre_printf(" -rlx_down : BoomerAMG - set relaxation type for down cycle\n"); + hypre_printf(" -rlx_up : BoomerAMG - set relaxation type for up cycle\n"); + hypre_printf(" -agg_nl : BoomerAMG - set number of agg. coarsening levels (0)\n"); + hypre_printf(" -agg_interp : BoomerAMG - set interpolation type used in agg. coarsening levels\n"); + hypre_printf(" -agg_Pmx : BoomerAMG - set max. number of nonzeros in agg. interpolation\n"); + hypre_printf(" -rap2 : BoomerAMG - set two-stage triple matrix product\n"); + hypre_printf(" -keepT : BoomerAMG - store local tranposes\n"); hypre_printf(" -w : jacobi weight\n"); - hypre_printf(" -jump : Struct- num levels to jump in SparseMSG\n"); + hypre_printf(" -solver_type : Struct- solver type for Hybrid\n"); + hypre_printf(" 1 - PCG (default)\n"); + hypre_printf(" 2 - GMRES\n"); hypre_printf(" -cf : Struct- convergence factor for Hybrid\n"); hypre_printf(" -crtdim : Struct- cyclic reduction tdim\n"); hypre_printf(" -cri : Struct- cyclic reduction base_index\n"); hypre_printf(" -crs : Struct- cyclic reduction base_stride\n"); - hypre_printf(" -old_default: sets old BoomerAMG defaults, possibly better for 2D problems\n"); + hypre_printf(" -old_default : sets old BoomerAMG defaults, possibly better for 2D problems\n"); + hypre_printf(" -vis : save the solution for GLVis visualization"); + hypre_printf(" -seed : use as the seed for the pseudo-random number generator\n"); + hypre_printf(" (default seed is based on the time of the run)\n"); + /* begin lobpcg */ @@ -2294,9 +2367,6 @@ PrintUsage( char *progname, hypre_printf("\n"); hypre_printf(" -vrand : compute eigenpairs using random initial vectors (default 1)\n"); hypre_printf("\n"); - hypre_printf(" -seed : use as the seed for the pseudo-random number generator\n"); - hypre_printf(" (default seed is based on the time of the run)\n"); - hypre_printf("\n"); hypre_printf(" -orthchk : check eigenvectors for orthonormality\n"); hypre_printf("\n"); hypre_printf(" -verb : verbosity level\n"); @@ -2305,7 +2375,7 @@ PrintUsage( char *progname, hypre_printf(" non-convergent eigenpairs and final eigenvalues and residuals (default)\n"); hypre_printf(" -verb 2 : print eigenvalues and residuals on each iteration\n"); hypre_printf("\n"); - hypre_printf(" -pcgitr : maximal number of inner PCG iterations for preconditioning (default 1);\n"); + hypre_printf(" -pcgitr : maximum number of inner PCG iterations for preconditioning (default 1);\n"); hypre_printf(" if = 0 then the preconditioner is applied directly\n"); hypre_printf("\n"); hypre_printf(" -pcgtol : residual tolerance for inner iterations (default 0.01)\n"); @@ -2321,12 +2391,146 @@ PrintUsage( char *progname, /* end lobpcg */ + hypre_printf("\n"); + hypre_printf(" -precision

: runtime precision, -1 (default) \n"); + hypre_printf(" -1 = default precision at compilation\n"); + hypre_printf(" 0 = flt, 1 = dbl, 2 = long_dbl\n"); + hypre_printf("\n"); } return 0; } +/*-------------------------------------------------------------------------- + * Functions needed for managing multiprecision data + *--------------------------------------------------------------------------*/ + +HYPRE_Real * +hypre_MuPDataAlloc(HYPRE_Int count, HYPRE_MemoryLocation location) +{ + void *data = NULL; + + HYPRE_Precision precision; + HYPRE_GetGlobalPrecision(&precision); + + switch (precision) + { + case HYPRE_REAL_SINGLE: + data = hypre_TAlloc(hypre_float, count, location); + break; + case HYPRE_REAL_DOUBLE: + data = hypre_TAlloc(hypre_double, count, location); + break; + case HYPRE_REAL_LONGDOUBLE: + data = hypre_TAlloc(hypre_long_double, count, location); + break; + } + + return (HYPRE_Real *) data; +} + +void +hypre_MuPDataMemcpy(void *dst, void *src, HYPRE_Int count, + HYPRE_MemoryLocation loc_dst, HYPRE_MemoryLocation loc_src) +{ + HYPRE_Precision precision; + HYPRE_GetGlobalPrecision(&precision); + + switch (precision) + { + case HYPRE_REAL_SINGLE: + hypre_TMemcpy(dst, src, hypre_float, count, loc_dst, loc_src); + break; + case HYPRE_REAL_DOUBLE: + hypre_TMemcpy(dst, src, hypre_double, count, loc_dst, loc_src); + break; + case HYPRE_REAL_LONGDOUBLE: + hypre_TMemcpy(dst, src, hypre_long_double, count, loc_dst, loc_src); + break; + } +} + +void +hypre_MuPDataCopyToMP(void *dst, HYPRE_Real *src, HYPRE_Int count) +{ + HYPRE_Int i; + + HYPRE_Precision precision; + HYPRE_GetGlobalPrecision(&precision); + + switch (precision) + { + case HYPRE_REAL_SINGLE: + { + hypre_float *p_dst = (hypre_float *) dst; + for (i = 0; i < count; i++) + { + p_dst[i] = (hypre_float) src[i]; + } + break; + } + case HYPRE_REAL_DOUBLE: + { + hypre_double *p_dst = (hypre_double *) dst; + for (i = 0; i < count; i++) + { + p_dst[i] = (hypre_double) src[i]; + } + break; + } + case HYPRE_REAL_LONGDOUBLE: + { + hypre_long_double *p_dst = (hypre_long_double *) dst; + for (i = 0; i < count; i++) + { + p_dst[i] = (hypre_long_double) src[i]; + } + break; + } + } +} + +void +hypre_MuPDataCopyFromMP(HYPRE_Real *dst, void *src, HYPRE_Int count) +{ + HYPRE_Int i; + + HYPRE_Precision precision; + HYPRE_GetGlobalPrecision(&precision); + + switch (precision) + { + case HYPRE_REAL_SINGLE: + { + hypre_float *p_src = (hypre_float *) src; + for (i = 0; i < count; i++) + { + dst[i] = (HYPRE_Real) p_src[i]; + } + break; + } + case HYPRE_REAL_DOUBLE: + { + hypre_double *p_src = (hypre_double *) src; + for (i = 0; i < count; i++) + { + dst[i] = (HYPRE_Real) p_src[i]; + } + break; + } + case HYPRE_REAL_LONGDOUBLE: + { + hypre_long_double *p_src = (hypre_long_double *) src; + for (i = 0; i < count; i++) + { + dst[i] = (HYPRE_Real) p_src[i]; + } + break; + } + } +} + /*-------------------------------------------------------------------------- * Test driver for semi-structured matrix interface *--------------------------------------------------------------------------*/ @@ -2342,18 +2546,25 @@ main( hypre_int argc, ProblemData data; ProblemPartData pdata; HYPRE_Int nparts = 0; + HYPRE_Int nvars; + HYPRE_BigInt num_dofs; + HYPRE_BigInt global_num_dofs; HYPRE_Int pooldist; 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 rep, reps; HYPRE_Int prec_print_level; HYPRE_Int solver_print_level; HYPRE_Int log_level; HYPRE_Int print_system; - HYPRE_Int cosine; + HYPRE_Int check_symmetry; + HYPRE_Int check_Aones; + HYPRE_Int sol_type; + HYPRE_Int sol0_type; + HYPRE_Real rhs_value; HYPRE_Real scale; HYPRE_Int read_fromfile_flag = 0; HYPRE_Int read_fromfile_index[3] = {-1, -1, -1}; @@ -2367,10 +2578,15 @@ main( hypre_int argc, HYPRE_SStructMatrix A = NULL; HYPRE_SStructMatrix G = NULL; HYPRE_SStructVector b = NULL; + HYPRE_SStructVector r = NULL; HYPRE_SStructVector x = NULL; HYPRE_SStructSolver solver; HYPRE_SStructSolver precond; + hypre_SStructPMatrix *pmatrix; + hypre_StructMatrix *smatrix; + + HYPRE_IJMatrix ij_A; HYPRE_ParCSRMatrix par_A; HYPRE_ParVector par_b; HYPRE_ParVector par_x; @@ -2387,26 +2603,64 @@ main( hypre_int argc, Index index, to_index; HYPRE_Int values_size = 0; - HYPRE_Real *values = NULL; + HYPRE_Real *values = NULL; + HYPRE_Real *h_values = NULL; HYPRE_Real *d_values = NULL; HYPRE_Int num_iterations; HYPRE_Real final_res_norm; + hypre_long_double final_res_norm_mem; // memory for multiprecision res norm + HYPRE_Real *final_res_norm_ptr = (HYPRE_Real *) &final_res_norm_mem; + HYPRE_Real real_res_norm; + hypre_long_double tmp_norm_mem; // memory for multiprecision norms + HYPRE_Real *tmp_norm_ptr = (HYPRE_Real *) &tmp_norm_mem; + HYPRE_Real rhs_norm; + HYPRE_Real x0_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; - HYPRE_Int skip; - HYPRE_Int rap; - HYPRE_Int relax; + /* parameters for multigrid */ HYPRE_Real jacobi_weight; + HYPRE_Real strong_threshold; + HYPRE_Int P_max_elmts; + HYPRE_Int coarsen_type; HYPRE_Int usr_jacobi_weight; - HYPRE_Int jump; + HYPRE_Int rap; + HYPRE_Int max_levels; + HYPRE_Int n_pre, n_post, n_coarse; + HYPRE_Int interp_type; + HYPRE_Int relax[4]; + HYPRE_Int relax_is_set; + HYPRE_Int max_coarse_size; + HYPRE_Int csolver_type; + HYPRE_Int skip; + HYPRE_Int agg_num_levels; + HYPRE_Int agg_interp_type; + HYPRE_Int agg_P_max_elmts; + HYPRE_Int keep_transpose; + HYPRE_Int mod_rap2; + + /* parameters for Solvers */ + HYPRE_Int rel_change; HYPRE_Int solver_type; HYPRE_Int recompute_res; + HYPRE_Int final_res; + HYPRE_Int max_iterations; + HYPRE_Int print_freq; + HYPRE_Real tol; + + /* parameters for GMRES */ + HYPRE_Int k_dim; + + /* parameters for LGMRES */ + HYPRE_Int aug_dim; + + /* Misc */ + HYPRE_Int vis; + HYPRE_Int seed; HYPRE_Real cf_tol; @@ -2416,66 +2670,64 @@ main( hypre_int argc, HYPRE_Int arg_index, part, var, box, s, entry, i, j, k, size; HYPRE_Int row, col; HYPRE_Int gradient_matrix; - HYPRE_Int old_default; + + HYPRE_Int precision_id; /* begin lobpcg */ - HYPRE_SStructSolver lobpcg_solver; - - HYPRE_Int lobpcgFlag = 0; - HYPRE_Int lobpcgSeed = 0; - HYPRE_Int blockSize = 1; - HYPRE_Int verbosity = 1; - HYPRE_Int iterations; - HYPRE_Int maxIterations = 100; - HYPRE_Int checkOrtho = 0; - HYPRE_Int printLevel = 0; - HYPRE_Int pcgIterations = 0; - HYPRE_Int pcgMode = 0; - HYPRE_Real tol = 1e-6; - HYPRE_Real pcgTol = 1e-2; - HYPRE_Real nonOrthF; - - FILE* filePtr; - - mv_MultiVectorPtr eigenvectors = NULL; - mv_MultiVectorPtr constrains = NULL; - HYPRE_Real* eigenvalues = NULL; - - HYPRE_Real* residuals; - utilities_FortranMatrix* residualNorms; - utilities_FortranMatrix* residualNormsHistory; - utilities_FortranMatrix* eigenvaluesHistory; - utilities_FortranMatrix* printBuffer; - utilities_FortranMatrix* gramXX; - utilities_FortranMatrix* identity; - - mv_InterfaceInterpreter* interpreter; - HYPRE_MatvecFunctions matvec_fn; + HYPRE_SStructSolver lobpcg_solver; + + HYPRE_Int lobpcgFlag = 0; + HYPRE_Int blockSize = 1; + HYPRE_Int verbosity = 1; + HYPRE_Int iterations; + HYPRE_Int maxIterations = 100; + HYPRE_Int checkOrtho = 0; + HYPRE_Int printLevel = 0; + HYPRE_Int pcgIterations = 0; + HYPRE_Int pcgMode = 0; + HYPRE_Int old_default = 0; + HYPRE_Real pcgTol = 1e-2; + HYPRE_Real nonOrthF; + HYPRE_Real *eigenvalues = NULL; + HYPRE_Real *residuals; + + utilities_FortranMatrix *residualNorms; + utilities_FortranMatrix *residualNormsHistory; + utilities_FortranMatrix *eigenvaluesHistory; + utilities_FortranMatrix *printBuffer; + utilities_FortranMatrix *gramXX; + utilities_FortranMatrix *identity; + mv_InterfaceInterpreter *interpreter; + mv_MultiVectorPtr eigenvectors = NULL; + mv_MultiVectorPtr constrains = NULL; + HYPRE_MatvecFunctions matvec_fn; + + FILE *filePtr; /* end lobpcg */ #if defined(HYPRE_USING_MEMORY_TRACKER) - HYPRE_Int print_mem_tracker = 0; - char mem_tracker_name[HYPRE_MAX_FILE_NAME_LEN] = {0}; + 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_vendor = 0; + HYPRE_Int spgemm_use_vendor = 0; + HYPRE_Int spmv_use_vendor = 0; + HYPRE_Int gpu_aware_mpi = 0; #endif #if defined(HYPRE_TEST_USING_HOST) - HYPRE_MemoryLocation memory_location = HYPRE_MEMORY_HOST; - HYPRE_ExecutionPolicy default_exec_policy = HYPRE_EXEC_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; + 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 *-----------------------------------------------------------*/ @@ -2519,10 +2771,8 @@ main( hypre_int argc, 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; @@ -2537,24 +2787,61 @@ main( hypre_int argc, } solver_id = 39; - repeats = 1; + reps = 1; prec_print_level = 0; solver_print_level = 0; log_level = 0; print_system = 0; - cosine = 1; - skip = 0; + check_symmetry = 0; + check_Aones = 0; + rhs_value = 1.0; + sol_type = 0; + sol0_type = 0; n_pre = 1; n_post = 1; - + n_coarse = 1; + interp_type = -1; + relax_is_set = 0; + relax[0] = 1; + relax[1] = -1; /* Relax up */ + relax[2] = -1; /* Relax down */ + relax[3] = -1; /* Relax coarse */ + jacobi_weight = 1.0; + usr_jacobi_weight = 0; + strong_threshold = 0.25; + P_max_elmts = 4; + agg_num_levels = 0; + agg_interp_type = 4; + agg_P_max_elmts = 0; + keep_transpose = 0; + mod_rap2 = 0; + coarsen_type = 10; + num_iterations = -1; + max_iterations = 100; + max_levels = 25; + max_coarse_size = -1; /* depends on object_type */ + csolver_type = 1; + tol = 1.0e-6; + rel_change = 0; + k_dim = 5; + aug_dim = 2; + print_freq = 1; + final_res = 0; + final_res_norm = 0.0; + vis = 0; + seed = 1; old_default = 0; + + /* runtime precision */ + precision_id = -1; /*----------------------------------------------------------- * Read input file *-----------------------------------------------------------*/ + arg_index = 1; - /* parse command line for input file name */ + /* parse command line for input file name and execution policy options */ infile = infile_default; while (arg_index < argc) { @@ -2584,7 +2871,7 @@ main( hypre_int argc, else if ( strcmp(argv[arg_index], "-help") == 0 ) { PrintUsage(argv[0], myid); - exit(1); + exit(0); } else if ( strcmp(argv[arg_index], "-version") == 0 ) { @@ -2592,7 +2879,7 @@ main( hypre_int argc, HYPRE_Version(&version_string); hypre_printf("%s\n", version_string); hypre_TFree(version_string, HYPRE_MEMORY_HOST); - exit(1); + exit(0); } else if ( strcmp(argv[arg_index], "-vernum") == 0 ) { @@ -2600,14 +2887,95 @@ main( hypre_int argc, HYPRE_VersionNumber(&major, &minor, &patch, &single); hypre_printf("HYPRE Version %d.%d.%d\n", major, minor, patch); hypre_printf("HYPRE Single = %d\n", single); - exit(1); + exit(0); + } + else if ( strcmp(argv[arg_index], "-ll") == 0 ) + { + arg_index++; + log_level = atoi(argv[arg_index++]); + } + 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++; + 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_GPU) + else if ( strcmp(argv[arg_index], "-mm_vendor") == 0 ) + { + arg_index++; + spgemm_use_vendor = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-mv_vendor") == 0 ) + { + arg_index++; + spmv_use_vendor = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-gpu_mpi") == 0 ) + { + arg_index++; + gpu_aware_mpi = 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++; + snprintf(mem_tracker_name, HYPRE_MAX_FILE_NAME_LEN, "%s", argv[arg_index++]); + } +#endif else { 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); + +#if defined(HYPRE_USING_GPU) + HYPRE_SetSpGemmUseVendor(spgemm_use_vendor); + HYPRE_SetSpMVUseVendor(spmv_use_vendor); + HYPRE_SetGpuAwareMPI(gpu_aware_mpi); +#endif + + if (hypre_GetExecPolicy1(memory_location) == HYPRE_EXEC_DEVICE) + { + coarsen_type = 8; + keep_transpose = 1; + mod_rap2 = 1; + } + /*----------------------------------------------------------- * Are we reading matrices/vectors directly from file? *-----------------------------------------------------------*/ @@ -2616,13 +2984,13 @@ main( hypre_int argc, read_fromfile_index[1] == -1 && read_fromfile_index[2] == -1) { - ReadData(infile, &global_data); + ReadData(comm, infile, &global_data); 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); + 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; @@ -2636,18 +3004,7 @@ main( hypre_int argc, if (global_data.rhs_true || global_data.fem_rhs_true) { - cosine = 0; - } - } - else - { - if (read_fromfile_flag < 7) - { - if (!myid) - { - hypre_printf("Error: Must read A, b, and x from file! \n"); - } - exit(1); + sol_type = -1; } } @@ -2728,10 +3085,20 @@ main( hypre_int argc, solver_id = atoi(argv[arg_index++]); } } + else if ( strcmp(argv[arg_index], "-sym") == 0 ) + { + arg_index++; + check_symmetry = 1; + } + else if ( strcmp(argv[arg_index], "-Aones") == 0 ) + { + arg_index++; + check_Aones = 1; + } else if ( strcmp(argv[arg_index], "-repeats") == 0 ) { arg_index++; - repeats = atoi(argv[arg_index++]); + reps = atoi(argv[arg_index++]); } else if ( strcmp(argv[arg_index], "-pout") == 0 ) { @@ -2743,244 +3110,317 @@ main( hypre_int argc, 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 ) { arg_index++; print_system = 1; } - else if ( strcmp(argv[arg_index], "-rhsfromcosine") == 0 ) + else if ( strcmp(argv[arg_index], "-vis") == 0 ) { arg_index++; - cosine = 1; + vis = 1; } - else if ( strcmp(argv[arg_index], "-rhsone") == 0 ) + else if ( strcmp(argv[arg_index], "-seed") == 0 ) { arg_index++; - cosine = 0; + seed = atoi(argv[arg_index++]); } - else if ( strcmp(argv[arg_index], "-tol") == 0 ) + else if ( strcmp(argv[arg_index], "-rhszero") == 0 ) { arg_index++; - tol = (HYPRE_Real)atof(argv[arg_index++]); + rhs_value = 0.0; + sol_type = -1; } - else if ( strcmp(argv[arg_index], "-v") == 0 ) + else if ( strcmp(argv[arg_index], "-rhsone") == 0 ) { arg_index++; - n_pre = atoi(argv[arg_index++]); - n_post = atoi(argv[arg_index++]); + rhs_value = 1.0; + sol_type = -1; } - else if ( strcmp(argv[arg_index], "-skip") == 0 ) + else if ( strcmp(argv[arg_index], "-rhsfromcosine") == 0 ) { arg_index++; - skip = atoi(argv[arg_index++]); + sol_type = 0; } - else if ( strcmp(argv[arg_index], "-rap") == 0 ) + else if ( strcmp(argv[arg_index], "-xone") == 0 ) { arg_index++; - rap = atoi(argv[arg_index++]); + sol_type = 1; } - else if ( strcmp(argv[arg_index], "-relax") == 0 ) + else if ( strcmp(argv[arg_index], "-x0zero") == 0 ) { arg_index++; - relax = atoi(argv[arg_index++]); + sol0_type = 0; } - else if ( strcmp(argv[arg_index], "-w") == 0 ) + else if ( strcmp(argv[arg_index], "-x0one") == 0 ) { arg_index++; - jacobi_weight = (HYPRE_Real)atof(argv[arg_index++]); - usr_jacobi_weight = 1; /* flag user weight */ + sol0_type = 1; } - else if ( strcmp(argv[arg_index], "-jump") == 0 ) + else if ( strcmp(argv[arg_index], "-x0rand") == 0 ) { arg_index++; - jump = atoi(argv[arg_index++]); + sol0_type = 2; } - else if ( strcmp(argv[arg_index], "-solver_type") == 0 ) + else if ( strcmp(argv[arg_index], "-tol") == 0 ) { arg_index++; - solver_type = atoi(argv[arg_index++]); + tol = (HYPRE_Real)atof(argv[arg_index++]); } - else if ( strcmp(argv[arg_index], "-recompute") == 0 ) + else if ( strcmp(argv[arg_index], "-itr") == 0 ) { arg_index++; - recompute_res = atoi(argv[arg_index++]); + max_iterations = atoi(argv[arg_index++]); } - else if ( strcmp(argv[arg_index], "-cf") == 0 ) + else if ( strcmp(argv[arg_index], "-k") == 0 ) { arg_index++; - cf_tol = (HYPRE_Real)atof(argv[arg_index++]); + k_dim = atoi(argv[arg_index++]); } - else if ( strcmp(argv[arg_index], "-crtdim") == 0 ) + else if ( strcmp(argv[arg_index], "-aug") == 0 ) { arg_index++; - cycred_tdim = atoi(argv[arg_index++]); + aug_dim = atoi(argv[arg_index++]); } - else if ( strcmp(argv[arg_index], "-cri") == 0 ) + else if ( strcmp(argv[arg_index], "-pfreq") == 0 ) { arg_index++; - for (i = 0; i < 3; i++) - { - cycred_index[i] = atoi(argv[arg_index++]); - } + print_freq = atoi(argv[arg_index++]); } - else if ( strcmp(argv[arg_index], "-crs") == 0 ) + else if ( strcmp(argv[arg_index], "-lvl") == 0 ) { arg_index++; - for (i = 0; i < 3; i++) - { - cycred_stride[i] = atoi(argv[arg_index++]); - } + max_levels = atoi(argv[arg_index++]); } - else if ( strcmp(argv[arg_index], "-old_default") == 0 ) + else if ( strcmp(argv[arg_index], "-v") == 0 ) { - /* uses old BoomerAMG defaults */ arg_index++; - old_default = 1; + n_pre = atoi(argv[arg_index++]); + n_post = atoi(argv[arg_index++]); + n_coarse = atoi(argv[arg_index++]); } - /* begin lobpcg */ - else if ( strcmp(argv[arg_index], "-lobpcg") == 0 ) + else if ( strcmp(argv[arg_index], "-max_coarse") == 0 ) { - /* use lobpcg */ arg_index++; - lobpcgFlag = 1; + max_coarse_size = atoi(argv[arg_index++]); } - else if ( strcmp(argv[arg_index], "-orthchk") == 0 ) + else if ( strcmp(argv[arg_index], "-csolver") == 0 ) { - /* lobpcg: check orthonormality */ arg_index++; - checkOrtho = 1; + csolver_type = atoi(argv[arg_index++]); } - else if ( strcmp(argv[arg_index], "-verb") == 0 ) + else if ( strcmp(argv[arg_index], "-skip") == 0 ) { - /* lobpcg: verbosity level */ arg_index++; - verbosity = atoi(argv[arg_index++]); + skip = atoi(argv[arg_index++]); } - else if ( strcmp(argv[arg_index], "-vrand") == 0 ) + else if ( strcmp(argv[arg_index], "-rap") == 0 ) { - /* lobpcg: block size */ arg_index++; - blockSize = atoi(argv[arg_index++]); + rap = atoi(argv[arg_index++]); } - else if ( strcmp(argv[arg_index], "-seed") == 0 ) + else if ( strcmp(argv[arg_index], "-interp") == 0 ) { - /* lobpcg: seed for srand */ arg_index++; - lobpcgSeed = atoi(argv[arg_index++]); + interp_type = atoi(argv[arg_index++]); } - else if ( strcmp(argv[arg_index], "-itr") == 0 ) + else if ( strcmp(argv[arg_index], "-relax") == 0 ) { - /* lobpcg: max # of iterations */ arg_index++; - maxIterations = atoi(argv[arg_index++]); + relax[0] = atoi(argv[arg_index++]); + relax_is_set = 1; } - else if ( strcmp(argv[arg_index], "-pcgitr") == 0 ) + else if ( strcmp(argv[arg_index], "-relax_up") == 0 ) { - /* lobpcg: max inner pcg iterations */ arg_index++; - pcgIterations = atoi(argv[arg_index++]); + relax[1] = atoi(argv[arg_index++]); } - else if ( strcmp(argv[arg_index], "-pcgtol") == 0 ) + else if ( strcmp(argv[arg_index], "-relax_down") == 0 ) { - /* lobpcg: inner pcg iterations tolerance */ arg_index++; - pcgTol = (HYPRE_Real)atof(argv[arg_index++]); + relax[2] = atoi(argv[arg_index++]); } - else if ( strcmp(argv[arg_index], "-pcgmode") == 0 ) + else if ( strcmp(argv[arg_index], "-relax_coarse") == 0 ) { - /* lobpcg: initial guess for inner pcg */ arg_index++; - /* 0: zero, otherwise rhs */ - pcgMode = atoi(argv[arg_index++]); + relax[3] = atoi(argv[arg_index++]); } - else if ( strcmp(argv[arg_index], "-vout") == 0 ) + else if ( strcmp(argv[arg_index], "-w") == 0 ) { - /* lobpcg: print level */ arg_index++; - printLevel = atoi(argv[arg_index++]); + jacobi_weight = (HYPRE_Real)atof(argv[arg_index++]); + usr_jacobi_weight = 1; /* flag user weight */ } - else if ( strcmp(argv[arg_index], "-memory_host") == 0 ) + else if ( strcmp(argv[arg_index], "-agg_nl") == 0 ) { arg_index++; - memory_location = HYPRE_MEMORY_HOST; + agg_num_levels = atoi(argv[arg_index++]); } - else if ( strcmp(argv[arg_index], "-memory_device") == 0 ) + else if ( strcmp(argv[arg_index], "-agg_interp") == 0 ) { arg_index++; - memory_location = HYPRE_MEMORY_DEVICE; + agg_interp_type = atoi(argv[arg_index++]); } - else if ( strcmp(argv[arg_index], "-exec_host") == 0 ) + else if ( strcmp(argv[arg_index], "-agg_Pmx") == 0 ) { arg_index++; - default_exec_policy = HYPRE_EXEC_HOST; + agg_P_max_elmts = atoi(argv[arg_index++]); } - else if ( strcmp(argv[arg_index], "-exec_device") == 0 ) + else if ( strcmp(argv[arg_index], "-keepT") == 0 ) { arg_index++; - default_exec_policy = HYPRE_EXEC_DEVICE; + keep_transpose = atoi(argv[arg_index++]); } -#if defined(HYPRE_USING_GPU) - else if ( strcmp(argv[arg_index], "-mm_vendor") == 0 ) + else if ( strcmp(argv[arg_index], "-rap2") == 0 ) { arg_index++; - spgemm_use_vendor = atoi(argv[arg_index++]); + mod_rap2 = atoi(argv[arg_index++]); } -#endif -#if defined(HYPRE_USING_MEMORY_TRACKER) - else if ( strcmp(argv[arg_index], "-print_mem_tracker") == 0 ) + else if ( strcmp(argv[arg_index], "-th") == 0 ) { arg_index++; - print_mem_tracker = atoi(argv[arg_index++]); + strong_threshold = atof(argv[arg_index++]); } - else if ( strcmp(argv[arg_index], "-mem_tracker_filename") == 0 ) + else if ( strcmp(argv[arg_index], "-Pmx") == 0 ) { arg_index++; - snprintf(mem_tracker_name, HYPRE_MAX_FILE_NAME_LEN, "%s", argv[arg_index++]); + P_max_elmts = atoi(argv[arg_index++]); } -#endif - else if ( strcmp(argv[arg_index], "-gpu_mpi") == 0 ) + else if ( strcmp(argv[arg_index], "-coarsen") == 0 ) { arg_index++; - gpu_aware_mpi = atoi(argv[arg_index++]); + coarsen_type = atoi(argv[arg_index++]); } - else + else if ( strcmp(argv[arg_index], "-solver_type") == 0 ) { arg_index++; + solver_type = atoi(argv[arg_index++]); + + /* Adjust default number of levels for SSAMG */ + if ((solver_type == 14 || solver_type == 4) && max_levels == 25) + { + max_levels = 6; + } + } + else if ( strcmp(argv[arg_index], "-recompute") == 0 ) + { + arg_index++; + recompute_res = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-final_res") == 0 ) + { + arg_index++; + final_res = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-cf") == 0 ) + { + arg_index++; + cf_tol = (HYPRE_Real)atof(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-crtdim") == 0 ) + { + arg_index++; + cycred_tdim = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-cri") == 0 ) + { + arg_index++; + for (i = 0; i < 3; i++) + { + cycred_index[i] = atoi(argv[arg_index++]); + } + } + else if ( strcmp(argv[arg_index], "-crs") == 0 ) + { + arg_index++; + for (i = 0; i < 3; i++) + { + cycred_stride[i] = atoi(argv[arg_index++]); + } + } + else if ( strcmp(argv[arg_index], "-old_default") == 0 ) + { + /* uses old BoomerAMG defaults */ + arg_index++; + old_default = 1; + } + /* begin lobpcg */ + else if ( strcmp(argv[arg_index], "-lobpcg") == 0 ) + { + /* use lobpcg */ + arg_index++; + lobpcgFlag = 1; + } + else if ( strcmp(argv[arg_index], "-orthchk") == 0 ) + { + /* lobpcg: check orthonormality */ + arg_index++; + checkOrtho = 1; + } + else if ( strcmp(argv[arg_index], "-verb") == 0 ) + { + /* lobpcg: verbosity level */ + arg_index++; + verbosity = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-vrand") == 0 ) + { + /* lobpcg: block size */ + arg_index++; + blockSize = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-itr") == 0 ) + { + /* lobpcg: max # of iterations */ + arg_index++; + maxIterations = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-pcgitr") == 0 ) + { + /* lobpcg: max inner pcg iterations */ + arg_index++; + pcgIterations = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-pcgtol") == 0 ) + { + /* lobpcg: inner pcg iterations tolerance */ + arg_index++; + pcgTol = (HYPRE_Real)atof(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-pcgmode") == 0 ) + { + /* lobpcg: initial guess for inner pcg */ + arg_index++; /* 0: zero, otherwise rhs */ + pcgMode = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-vout") == 0 ) + { + /* lobpcg: print level */ + arg_index++; + old_default = 1; + } + /* end lobpcg */ + else if ( strcmp(argv[arg_index], "-precision") == 0 ) + { + /* runtime precision */ + arg_index++; + precision_id = atoi(argv[arg_index++]); + } + else + { + if (!myid) + { + hypre_printf("Unknown argument: %s\n", argv[arg_index]); + hypre_MPI_Abort(comm, 1); + } } } -#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); - -#if defined(HYPRE_USING_GPU) - 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 *-----------------------------------------------------------*/ @@ -3007,13 +3447,115 @@ main( hypre_int argc, hypre_MPI_Barrier(comm); - for (rep = 0; rep < repeats; rep++) + /*----------------------------------------------------------- + * Set global precision + *-----------------------------------------------------------*/ + + { + HYPRE_Precision precision; + switch (precision_id) + { + case -1: + HYPRE_GetGlobalPrecision(&precision); + break; + case 0: + precision = HYPRE_REAL_SINGLE; + break; + case 1: + precision = HYPRE_REAL_DOUBLE; + break; + case 2: + precision = HYPRE_REAL_LONGDOUBLE; + break; + } + + HYPRE_SetGlobalPrecision(precision); + } + + /*----------------------------------------------------------- + * Determine object type + *-----------------------------------------------------------*/ + + object_type = HYPRE_SSTRUCT; + + /* 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; + } + + 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) || (solver_id == 5) || + (solver_id == -3)) + { + object_type = HYPRE_PARCSR; + } + + else if (solver_id >= 200 || solver_id == -2) + { + object_type = HYPRE_STRUCT; + } + + if (myid == 0) + { + switch (object_type) + { + case HYPRE_STRUCT: + hypre_printf("Setting object type to Struct\n"); + break; + + case HYPRE_SSTRUCT: + hypre_printf("Setting object type to SStruct\n"); + break; + + case HYPRE_PARCSR: + hypre_printf("Setting object type to ParCSR\n"); + break; + } + } + + /* Change default input parameters according to the object type */ + if (object_type == HYPRE_PARCSR) + { + if (!relax_is_set) + { + relax[0] = -1; + } + + if (max_coarse_size == -1) + { + max_coarse_size = 9; + } + } + else if (object_type == HYPRE_STRUCT) { + if (max_coarse_size == -1) + { + max_coarse_size = 0; + } + } + else if (object_type == HYPRE_SSTRUCT) + { + if (max_coarse_size == -1) + { + max_coarse_size = 0; + } + } + for (rep = 0; rep < reps; rep++) + { /*----------------------------------------------------------- - * Set up the grid + * Build Matrix *-----------------------------------------------------------*/ + HYPRE_ANNOTATE_REGION_BEGIN("%s-%d", "Run", rep); time_index = hypre_InitializeTiming("SStruct Interface"); hypre_BeginTiming(time_index); @@ -3021,10 +3563,12 @@ main( hypre_int argc, { if (!myid) { - hypre_printf("Reading SStructMatrix A from file: %s\n", argv[read_fromfile_index[0]]); + hypre_printf("Reading SStructMatrix A from file: %s\n", + argv[read_fromfile_index[0]]); } HYPRE_SStructMatrixRead(comm, argv[read_fromfile_index[0]], &A); + HYPRE_SStructMatrixGetGrid(A, &grid); } else { @@ -3032,8 +3576,8 @@ main( hypre_int argc, * Distribute data *-----------------------------------------------------------*/ - DistributeData(global_data, pooldist, refine, distribute, block, - num_procs, myid, &data); + DistributeData(comm, global_data, pooldist, + refine, distribute, block, &data); /*----------------------------------------------------------- * Check a few things @@ -3055,15 +3599,20 @@ main( hypre_int argc, { hypre_printf("Error: Invalid number of nvars for Struct Solver \n"); } - exit(1); + hypre_MPI_Abort(comm, 1); } } + /*----------------------------------------------------------- + * Set up the grid + *-----------------------------------------------------------*/ + 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]; @@ -3119,7 +3668,7 @@ main( hypre_int argc, * Set up the stencils *-----------------------------------------------------------*/ - stencils = hypre_CTAlloc(HYPRE_SStructStencil, data.nstencils, HYPRE_MEMORY_HOST); + 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], @@ -3163,15 +3712,13 @@ main( hypre_int argc, *-----------------------------------------------------------*/ HYPRE_SStructGraphCreate(comm, 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); - } + HYPRE_SStructGraphSetObjectType(graph, object_type); for (part = 0; part < data.nparts; part++) { +#if DEBUG_SSGRAPH + hypre_printf("Building SStructGraph - part %d\n", part); +#endif pdata = data.pdata[part]; if (data.nstencils > 0) @@ -3192,10 +3739,21 @@ main( hypre_int argc, HYPRE_SStructGraphSetFEMSparsity(graph, part, data.fem_nsparse, data.fem_sparsity); } + else + { + if (!myid) + { + hypre_printf("Error: HYPRE_SStructGraph stencil info is missing\n"); + } + hypre_MPI_Abort(comm, 1); + } /* add entries */ for (box = 0; box < pdata.graph_nboxes; box++) { +#if DEBUG_SSGRAPH + hypre_printf("Building SStructGraph - box %d\n", box); +#endif for (index[2] = pdata.graph_ilowers[box][2]; index[2] <= pdata.graph_iuppers[box][2]; index[2] += pdata.graph_strides[box][2]) @@ -3214,14 +3772,15 @@ main( hypre_int argc, 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]; -#else to_index[j] = pdata.graph_to_ilowers[box][j]; to_index[j] += k * pdata.graph_to_strides[box][j]; -#endif } +#if DEBUG_SSGRAPH + hypre_printf("index: [%d](%d, %d, %d) - to_index: [%d](%d, %d, %d)\n", + part, index[0], index[1], index[2], + pdata.graph_to_parts[box], to_index[0], + to_index[1], to_index[2]); +#endif HYPRE_SStructGraphAddEntries(graph, part, index, pdata.graph_vars[box], pdata.graph_to_parts[box], @@ -3239,14 +3798,25 @@ main( hypre_int argc, * Set up the matrix *-----------------------------------------------------------*/ - values_size = hypre_max(data.max_boxsize, data.max_boxsize * data.fem_nsparse); + HYPRE_SStructMatrixCreate(comm, graph, &A); - values = hypre_TAlloc(HYPRE_Real, values_size, HYPRE_MEMORY_HOST); - d_values = hypre_TAlloc(HYPRE_Real, values_size, memory_location); + /* Set and allocate values buffer */ + values_size = 1; + values_size = hypre_max(values_size, data.fem_nvars * data.fem_nvars); + values_size = hypre_max(values_size, data.max_boxsize); + values_size = hypre_max(values_size, data.max_boxsize * data.fem_nsparse); + for (part = 0; part < nparts; part++) + { + pdata = data.pdata[part]; + values_size = hypre_max(values_size, pdata.graph_values_size); + } - HYPRE_SStructMatrixCreate(comm, graph, &A); + /* Allocate values buffer on host and device memory */ + values = hypre_TAlloc(HYPRE_Real, values_size, HYPRE_MEMORY_HOST); + h_values = hypre_MuPDataAlloc(values_size, HYPRE_MEMORY_HOST); + d_values = hypre_MuPDataAlloc(values_size, memory_location); - /* TODO HYPRE_SStructMatrixSetSymmetric(A, 1); */ + /* TODO (VPM): Implement HYPRE_SStructMatrixSetSymmetric(A, 1); */ for (i = 0; i < data.symmetric_num; i++) { HYPRE_SStructMatrixSetSymmetric(A, data.symmetric_parts[i], @@ -3255,13 +3825,7 @@ main( hypre_int argc, data.symmetric_booleans[i]); } HYPRE_SStructMatrixSetNSSymmetric(A, data.ns_symmetric); - - /* HYPRE_SSTRUCT is the default, so we don't have to call SetObjectType */ - if ( object_type != HYPRE_SSTRUCT ) - { - HYPRE_SStructMatrixSetObjectType(A, object_type); - } - + HYPRE_SStructMatrixSetObjectType(A, object_type); HYPRE_SStructMatrixInitialize(A); if (data.nstencils > 0) @@ -3280,8 +3844,9 @@ main( hypre_int argc, values[j] = data.stencil_values[s][i]; } - hypre_TMemcpy(d_values, values, HYPRE_Real, values_size, - memory_location, HYPRE_MEMORY_HOST); + hypre_MuPDataCopyToMP(h_values, values, values_size); + hypre_MuPDataMemcpy(d_values, h_values, values_size, + memory_location, HYPRE_MEMORY_HOST); for (box = 0; box < pdata.nboxes; box++) { @@ -3299,8 +3864,9 @@ main( hypre_int argc, { /* 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); + hypre_MuPDataCopyToMP(h_values, data.fem_values, data.fem_nsparse); + hypre_MuPDataMemcpy(d_values, h_values, data.fem_nsparse, + memory_location, HYPRE_MEMORY_HOST); for (part = 0; part < data.nparts; part++) { @@ -3316,8 +3882,7 @@ main( hypre_int argc, for (index[0] = pdata.ilowers[box][0]; index[0] <= pdata.iuppers[box][0]; index[0]++) { - HYPRE_SStructMatrixAddFEMValues(A, part, index, - data.d_fem_values); + HYPRE_SStructMatrixAddFEMValues(A, part, index, d_values); } } } @@ -3328,9 +3893,12 @@ main( hypre_int argc, 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); + hypre_TMemcpy(&values[j], data.fem_values, HYPRE_Real, data.fem_nsparse, + HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); } + hypre_MuPDataCopyToMP(h_values, values, data.fem_nsparse * data.max_boxsize); + hypre_MuPDataMemcpy(d_values, h_values, data.fem_nsparse * data.max_boxsize, + memory_location, HYPRE_MEMORY_HOST); for (part = 0; part < data.nparts; part++) { pdata = data.pdata[part]; @@ -3348,10 +3916,6 @@ main( hypre_int argc, { 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++) { /* @@ -3372,13 +3936,14 @@ main( hypre_int argc, { values[j] = pdata.graph_values[box]; } + hypre_MuPDataCopyToMP(h_values, values, pdata.graph_boxsizes[box]); HYPRE_SStructMatrixSetBoxValues(A, part, - pdata.graph_ilowers[box], - pdata.graph_iuppers[box], + pdata.graph_ilowers[box], pdata.graph_iuppers[box], pdata.graph_vars[box], - 1, &pdata.graph_entries[box], - values); + 1, &pdata.graph_entries[box], h_values); #else + hypre_MuPDataCopyToMP(h_values, &pdata.graph_values[box], 1); + hypre_MuPDataMemcpy(d_values, h_values, 1, memory_location, HYPRE_MEMORY_HOST); for (index[2] = pdata.graph_ilowers[box][2]; index[2] <= pdata.graph_iuppers[box][2]; index[2] += pdata.graph_strides[box][2]) @@ -3393,8 +3958,7 @@ main( hypre_int argc, { HYPRE_SStructMatrixSetValues(A, part, index, pdata.graph_vars[box], - 1, &pdata.graph_entries[box], - &pdata.d_graph_values[box]); + 1, &pdata.graph_entries[box], d_values); } } } @@ -3408,26 +3972,20 @@ main( hypre_int argc, 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); - } + size = BoxVolume(pdata.matset_ilowers[box], pdata.matset_iuppers[box]); for (j = 0; j < size; j++) { values[j] = pdata.matset_values[box]; } - hypre_TMemcpy(d_values, values, HYPRE_Real, values_size, - memory_location, HYPRE_MEMORY_HOST); + hypre_MuPDataCopyToMP(h_values, values, values_size); + hypre_MuPDataMemcpy(d_values, h_values, values_size, + memory_location, HYPRE_MEMORY_HOST); HYPRE_SStructMatrixSetBoxValues(A, part, - pdata.matset_ilowers[box], - pdata.matset_iuppers[box], + pdata.matset_ilowers[box], pdata.matset_iuppers[box], pdata.matset_vars[box], - 1, &pdata.matset_entries[box], - d_values); + 1, &pdata.matset_entries[box], d_values); } } @@ -3437,12 +3995,7 @@ main( hypre_int argc, 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); - } + size = BoxVolume(pdata.matadd_ilowers[box], pdata.matadd_iuppers[box]); for (entry = 0; entry < pdata.matadd_nentries[box]; entry++) { @@ -3451,8 +4004,9 @@ main( hypre_int argc, values[j] = pdata.matadd_values[box][entry]; } - hypre_TMemcpy(d_values, values, HYPRE_Real, values_size, - memory_location, HYPRE_MEMORY_HOST); + hypre_MuPDataCopyToMP(h_values, values, values_size); + hypre_MuPDataMemcpy(d_values, h_values, values_size, + memory_location, HYPRE_MEMORY_HOST); HYPRE_SStructMatrixAddToBoxValues(A, part, pdata.matadd_ilowers[box], @@ -3487,8 +4041,9 @@ main( hypre_int argc, } } - hypre_TMemcpy(d_values, values, HYPRE_Real, values_size, - memory_location, HYPRE_MEMORY_HOST); + hypre_MuPDataCopyToMP(h_values, values, values_size); + hypre_MuPDataMemcpy(d_values, h_values, 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]++) @@ -3507,6 +4062,33 @@ main( hypre_int argc, } HYPRE_SStructMatrixAssemble(A); + } /* if (read_fromfile_flag & 0x1) */ + + /* Get the global size of the matrix */ + num_dofs = 0; + for (part = 0; part < nparts; part++) + { + pmatrix = hypre_SStructMatrixPMatrix(A, part); + nvars = hypre_SStructPMatrixNVars(pmatrix); + + for (i = 0; i < nvars; i++) + { + for (j = 0; j < nvars; j++) + { + smatrix = hypre_SStructPMatrixSMatrix(pmatrix, i, j); + if (smatrix) + { + num_dofs += hypre_StructGridLocalSize(hypre_StructMatrixGrid(smatrix)); + } + } + } + } + + hypre_MPI_Reduce(&num_dofs, &global_num_dofs, 1, HYPRE_MPI_BIG_INT, hypre_MPI_SUM, 0, comm); + + if (myid == 0) + { + hypre_printf("Global num dofs: %b\n\n", global_num_dofs); } /*----------------------------------------------------------- @@ -3519,20 +4101,13 @@ main( hypre_int argc, { hypre_printf("Reading SStructVector b from file: %s\n", argv[read_fromfile_index[1]]); } - cosine = 0; HYPRE_SStructVectorRead(comm, argv[read_fromfile_index[1]], &b); } else { HYPRE_SStructVectorCreate(comm, grid, &b); - - /* HYPRE_SSTRUCT is the default, so we don't have to call SetObjectType */ - if ( object_type != HYPRE_SSTRUCT ) - { - HYPRE_SStructVectorSetObjectType(b, object_type); - } - + HYPRE_SStructVectorSetObjectType(b, object_type); HYPRE_SStructVectorInitialize(b); /* Initialize the rhs values */ @@ -3550,16 +4125,17 @@ main( hypre_int argc, values[j] = 0.0; } } - else /* rhs=1 is the default */ + else /* rhs_value is the default */ { for (j = 0; j < data.max_boxsize; j++) { - values[j] = 1.0; + values[j] = rhs_value; } } - hypre_TMemcpy(d_values, values, HYPRE_Real, values_size, - memory_location, HYPRE_MEMORY_HOST); + hypre_MuPDataCopyToMP(h_values, values, values_size); + hypre_MuPDataMemcpy(d_values, h_values, values_size, + memory_location, HYPRE_MEMORY_HOST); for (part = 0; part < data.nparts; part++) { @@ -3570,8 +4146,7 @@ main( hypre_int argc, { GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], pdata.vartypes[var], ilower, iupper); - HYPRE_SStructVectorSetBoxValues(b, part, ilower, iupper, - var, d_values); + HYPRE_SStructVectorSetBoxValues(b, part, ilower, iupper, var, d_values); } } } @@ -3580,8 +4155,9 @@ main( hypre_int argc, 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_MuPDataCopyToMP(h_values, data.fem_rhs_values, data.fem_nvars); + hypre_MuPDataMemcpy(d_values, h_values, data.fem_nvars, + memory_location, HYPRE_MEMORY_HOST); for (part = 0; part < data.nparts; part++) { @@ -3597,8 +4173,7 @@ main( hypre_int argc, 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); + HYPRE_SStructVectorAddFEMValues(b, part, index, d_values); } } } @@ -3609,9 +4184,12 @@ main( hypre_int argc, 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); + hypre_TMemcpy(&values[j], data.fem_rhs_values, HYPRE_Real, + data.fem_nvars, HYPRE_MEMORY_HOST, HYPRE_MEMORY_HOST); } + hypre_MuPDataCopyToMP(h_values, values, data.fem_nvars * data.max_boxsize); + hypre_MuPDataMemcpy(d_values, h_values, data.fem_nvars * data.max_boxsize, + memory_location, HYPRE_MEMORY_HOST); for (part = 0; part < data.nparts; part++) { pdata = data.pdata[part]; @@ -3630,20 +4208,16 @@ main( hypre_int argc, 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); - } + size = BoxVolume(pdata.rhsadd_ilowers[box], pdata.rhsadd_iuppers[box]); for (j = 0; j < size; j++) { values[j] = pdata.rhsadd_values[box]; } - hypre_TMemcpy(d_values, values, HYPRE_Real, values_size, - memory_location, HYPRE_MEMORY_HOST); + hypre_MuPDataCopyToMP(h_values, values, values_size); + hypre_MuPDataMemcpy(d_values, h_values, values_size, + memory_location, HYPRE_MEMORY_HOST); HYPRE_SStructVectorAddToBoxValues(b, part, pdata.rhsadd_ilowers[box], @@ -3658,6 +4232,9 @@ main( hypre_int argc, pdata = data.pdata[part]; for (box = 0; box < pdata.fem_rhsadd_nboxes; box++) { + hypre_MuPDataCopyToMP(h_values, pdata.fem_rhsadd_values[box], data.fem_nvars); + hypre_MuPDataMemcpy(d_values, h_values, data.fem_nvars, + memory_location, HYPRE_MEMORY_HOST); for (index[2] = pdata.fem_rhsadd_ilowers[box][2]; index[2] <= pdata.fem_rhsadd_iuppers[box][2]; index[2]++) { @@ -3667,8 +4244,7 @@ main( hypre_int argc, 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_SStructVectorAddFEMValues(b, part, index, d_values); } } } @@ -3676,7 +4252,110 @@ main( hypre_int argc, } HYPRE_SStructVectorAssemble(b); - } + + /*----------------------------------------------------------- + * Set RHS based on the solution vector + *-----------------------------------------------------------*/ + + if (sol_type == 0 || sol_type == 1) + { + HYPRE_SStructVectorCreate(comm, grid, &x); + HYPRE_SStructVectorSetObjectType(x, object_type); + HYPRE_SStructVectorInitialize(x); + + switch (sol_type) + { + case 0: + /*----------------------------------------------------------- + * Set RHS such that the solution vector is given by + * + * u(part,var,i,j,k) = (part+1)*(var+1)*cosine[(i+j+k)/10] + *-----------------------------------------------------------*/ + 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); + size = BoxVolume(ilower, iupper); + + hypre_MuPDataCopyToMP(h_values, values, size); + hypre_MuPDataMemcpy(d_values, h_values, size, + memory_location, HYPRE_MEMORY_HOST); + + HYPRE_SStructVectorSetBoxValues(x, part, ilower, iupper, var, d_values); + } + } + } + break; + + case 1: + HYPRE_SStructVectorSetConstantValues(x, 1.0); + break; + } + + HYPRE_SStructVectorAssemble(x); + +#if 0 + /*----------------------------------------------------------- + * RDF: Temporary test in case SStructMatrixMatvec still has a bug... + * + * 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); + } + + if (sol_type == 0 || sol_type == 1) + { + /* This if/else is due to a bug in SStructMatvec */ + if (object_type == HYPRE_SSTRUCT) + { + /* Apply A to x to yield righthand side */ + HYPRE_SStructMatrixMatvec(1.0, A, x, 0.0, b); + } + else if (object_type == HYPRE_PARCSR) + { + /* Apply A to x to yield righthand side */ + HYPRE_ParCSRMatrixMatvec(1.0, par_A, par_x, 0.0, par_b ); + } + else if (object_type == HYPRE_STRUCT) + { + /* Apply A to x to yield righthand side */ + HYPRE_StructMatrixMatvec(1.0, sA, sx, 0.0, sb); + } + } +#endif + + /* Update RHS */ + HYPRE_SStructMatrixMatvec(1.0, A, x, 0.0, b); + + /* Destroy temporary vector */ + HYPRE_SStructVectorDestroy(x); + } + } /* if (read_fromfile_flag & 0x2) */ + + HYPRE_SStructVectorInnerProd(b, b, tmp_norm_ptr); + hypre_MuPDataCopyFromMP(&rhs_norm, tmp_norm_ptr, 1); + rhs_norm = hypre_sqrt(rhs_norm); /*----------------------------------------------------------- * Set up the initial solution vector @@ -3694,106 +4373,49 @@ main( hypre_int argc, else { HYPRE_SStructVectorCreate(comm, 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_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) + switch (sol0_type) { - 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); + case 0: + HYPRE_SStructVectorSetConstantValues(x, 0.0); + break; - hypre_TMemcpy(d_values, values, HYPRE_Real, values_size, - memory_location, HYPRE_MEMORY_HOST); + case 1: + HYPRE_SStructVectorSetConstantValues(x, 1.0); + break; - HYPRE_SStructVectorSetBoxValues(x, part, ilower, iupper, - var, d_values); - } - } - } + case 2: + HYPRE_SStructVectorSetRandomValues(x, seed); + break; } HYPRE_SStructVectorAssemble(x); - } + } /* if (read_fromfile_flag & 0x4) */ - hypre_EndTiming(time_index); - hypre_PrintTiming("SStruct Interface", comm); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); + HYPRE_SStructVectorInnerProd(x, x, tmp_norm_ptr); + hypre_MuPDataCopyFromMP(&x0_norm, tmp_norm_ptr, 1); + x0_norm = hypre_sqrt(x0_norm); /*----------------------------------------------------------- - * Get the objects out - * NOTE: This should go after the cosine part, but for the bug + * Build residual vector *-----------------------------------------------------------*/ - 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_SStructVectorCreate(comm, grid, &r); + HYPRE_SStructVectorSetObjectType(r, object_type); + HYPRE_SStructVectorInitialize(r); + HYPRE_SStructVectorAssemble(r); + if (print_system) { - HYPRE_SStructMatrixGetObject(A, (void **) &sA); - HYPRE_SStructVectorGetObject(b, (void **) &sb); - HYPRE_SStructVectorGetObject(x, (void **) &sx); + HYPRE_SStructVectorCopy(b, r); + HYPRE_SStructMatrixMatvec(-1.0, A, x, 1.0, r); + HYPRE_SStructVectorPrint("sstruct.out.r0", r, 0); } - /*----------------------------------------------------------- - * Finish resetting the linear system - *-----------------------------------------------------------*/ - - 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) - { - /* 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); - } - } + hypre_EndTiming(time_index); + hypre_PrintTiming("SStruct Interface", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); /*----------------------------------------------------------- * Set up a gradient matrix G @@ -3852,7 +4474,7 @@ main( hypre_int argc, /* Set up the gradient stencils */ - G_stencils = hypre_CTAlloc(HYPRE_SStructStencil, data.ndim, HYPRE_MEMORY_HOST); + 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]); @@ -3895,20 +4517,48 @@ main( hypre_int argc, values[j] = stencil_values[i]; } - hypre_TMemcpy(d_values, values, HYPRE_Real, values_size, memory_location, HYPRE_MEMORY_HOST); + hypre_MuPDataCopyToMP(h_values, values, values_size); + hypre_MuPDataMemcpy(d_values, h_values, 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); + } + } + } + } + + HYPRE_SStructMatrixAssemble(G); + } + + /*----------------------------------------------------------- + * Get the objects out + *-----------------------------------------------------------*/ + + 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); + } - 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); - } - } - } - } + /*----------------------------------------------------------- + * Convert SStructMatrix to IJMatrix + *-----------------------------------------------------------*/ - HYPRE_SStructMatrixAssemble(G); + if (print_system || check_symmetry) + { + HYPRE_SStructMatrixToIJMatrix(A, 0, &ij_A); } /*----------------------------------------------------------- @@ -3927,6 +4577,52 @@ main( hypre_int argc, { HYPRE_SStructMatrixPrint("sstruct.out.G", G, 0); } + + if (object_type != HYPRE_PARCSR) + { + HYPRE_IJMatrixPrint(ij_A, "IJ.out.A"); + } + } + + if (check_symmetry) + { + HYPRE_IJMatrix ij_AT, ij_B; + HYPRE_Real B_norm; + + /* Compute Frobenius norm of (A - A^T) */ + HYPRE_IJMatrixTranspose(ij_A, &ij_AT); + HYPRE_IJMatrixAdd(1.0, ij_A, -1.0, ij_AT, &ij_B); + HYPRE_IJMatrixNorm(ij_B, &B_norm); + HYPRE_IJMatrixPrint(ij_B, "IJ.out.B"); + if (!myid) + { + hypre_printf("Frobenius norm (A - A^T) = %20.15e\n\n", B_norm); + } + + /* Free memory */ + HYPRE_IJMatrixDestroy(ij_AT); + HYPRE_IJMatrixDestroy(ij_B); + } + + if (check_Aones) + { + HYPRE_SStructVector ones; + HYPRE_SStructVector Aones; + + HYPRE_SStructVectorCreate(comm, grid, &ones); + HYPRE_SStructVectorInitialize(ones); + HYPRE_SStructVectorSetConstantValues(ones, 1.0); + HYPRE_SStructVectorAssemble(ones); + + HYPRE_SStructVectorCreate(comm, grid, &Aones); + HYPRE_SStructVectorInitialize(Aones); + HYPRE_SStructVectorAssemble(Aones); + + HYPRE_SStructMatrixMatvec(1.0, A, ones, 0.0, Aones); + HYPRE_SStructVectorPrint("sstruct.out.Aones", Aones, 0); + + HYPRE_SStructVectorDestroy(ones); + HYPRE_SStructVectorDestroy(Aones); } /*----------------------------------------------------------- @@ -3939,11 +4635,11 @@ main( hypre_int argc, char filename[255]; /* result is 1's on the interior of the grid */ - hypre_SStructMatvec(1.0, A, b, 0.0, x); + HYPRE_SStructMatrixMatvec(1.0, A, b, 0.0, x); HYPRE_SStructVectorPrint("sstruct.out.matvec", x, 0); /* result is all 1's */ - hypre_SStructCopy(b, x); + HYPRE_SStructVectorCopy(b, x); HYPRE_SStructVectorPrint("sstruct.out.copy", x, 0); /* result is all 2's */ @@ -3951,13 +4647,14 @@ main( hypre_int argc, HYPRE_SStructVectorPrint("sstruct.out.scale", x, 0); /* result is all 0's */ - hypre_SStructAxpy(-2.0, b, x); + HYPRE_SStructVectorAxpy(-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_SStructVectorCopy(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]; @@ -4005,15 +4702,16 @@ main( hypre_int argc, fclose(file); /* re-initializes x to 0 */ - hypre_SStructAxpy(-1.0, b, x); + HYPRE_SStructVectorAxpy(-1.0, b, x); } #endif hypre_TFree(values, HYPRE_MEMORY_HOST); + hypre_TFree(h_values, HYPRE_MEMORY_HOST); hypre_TFree(d_values, memory_location); /*----------------------------------------------------------- - * Solve the system using SysPFMG or Split + * Solve the system using SysPFMG, SSAMG, Split or BoomerAMG *-----------------------------------------------------------*/ if (solver_id == 3) @@ -4022,11 +4720,11 @@ main( hypre_int argc, hypre_BeginTiming(time_index); HYPRE_SStructSysPFMGCreate(comm, &solver); - HYPRE_SStructSysPFMGSetMaxIter(solver, 100); + HYPRE_SStructSysPFMGSetMaxIter(solver, max_iterations); HYPRE_SStructSysPFMGSetTol(solver, tol); - HYPRE_SStructSysPFMGSetRelChange(solver, 0); + HYPRE_SStructSysPFMGSetRelChange(solver, rel_change); /* weighted Jacobi = 1; red-black GS = 2 */ - HYPRE_SStructSysPFMGSetRelaxType(solver, relax); + HYPRE_SStructSysPFMGSetRelaxType(solver, relax[0]); if (usr_jacobi_weight) { HYPRE_SStructSysPFMGSetJacobiWeight(solver, jacobi_weight); @@ -4035,7 +4733,7 @@ main( hypre_int argc, HYPRE_SStructSysPFMGSetNumPostRelax(solver, n_post); HYPRE_SStructSysPFMGSetSkipRelax(solver, skip); /*HYPRE_StructPFMGSetDxyz(solver, dxyz);*/ - HYPRE_SStructSysPFMGSetPrintLevel(solver, prec_print_level); + HYPRE_SStructSysPFMGSetPrintLevel(solver, solver_print_level); HYPRE_SStructSysPFMGSetLogging(solver, 1); HYPRE_SStructSysPFMGSetup(solver, A, b, x); @@ -4055,18 +4753,131 @@ main( hypre_int argc, hypre_ClearTiming(); HYPRE_SStructSysPFMGGetNumIterations(solver, &num_iterations); - HYPRE_SStructSysPFMGGetFinalRelativeResidualNorm(solver, &final_res_norm); + HYPRE_SStructSysPFMGGetFinalRelativeResidualNorm(solver, final_res_norm_ptr); HYPRE_SStructSysPFMGDestroy(solver); } + else if (solver_id == 4) + { + time_index = hypre_InitializeTiming("SSAMG Setup"); + hypre_BeginTiming(time_index); + + HYPRE_SStructSSAMGCreate(comm, &solver); + HYPRE_SStructSSAMGSetMaxIter(solver, max_iterations); + HYPRE_SStructSSAMGSetMaxLevels(solver, max_levels); + HYPRE_SStructSSAMGSetTol(solver, tol); + HYPRE_SStructSSAMGSetRelChange(solver, rel_change); + HYPRE_SStructSSAMGSetSkipRelax(solver, skip); + HYPRE_SStructSSAMGSetInterpType(solver, interp_type); + /* weighted Jacobi = 1; red-black GS = 2 */ + HYPRE_SStructSSAMGSetRelaxType(solver, relax[0]); + if (usr_jacobi_weight) + { + HYPRE_SStructSSAMGSetRelaxWeight(solver, jacobi_weight); + } + HYPRE_SStructSSAMGSetNumPreRelax(solver, n_pre); + HYPRE_SStructSSAMGSetNumPostRelax(solver, n_post); + HYPRE_SStructSSAMGSetNumCoarseRelax(solver, n_coarse); + HYPRE_SStructSSAMGSetMaxCoarseSize(solver, max_coarse_size); + HYPRE_SStructSSAMGSetCoarseSolverType(solver, csolver_type); + HYPRE_SStructSSAMGSetNonGalerkinRAP(solver, rap); + HYPRE_SStructSSAMGSetPrintLevel(solver, solver_print_level); + HYPRE_SStructSSAMGSetPrintFreq(solver, print_freq); + HYPRE_SStructSSAMGSetLogging(solver, 1); + HYPRE_SStructSSAMGSetup(solver, A, b, x); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + time_index = hypre_InitializeTiming("SSAMG Solve"); + hypre_BeginTiming(time_index); + + HYPRE_SStructSSAMGSolve(solver, A, b, x); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + HYPRE_SStructSSAMGGetNumIterations(solver, &num_iterations); + HYPRE_SStructSSAMGGetFinalRelativeResidualNorm(solver, final_res_norm_ptr); + + HYPRE_SStructSSAMGDestroy(solver); + } + else if (solver_id == 5) + { + time_index = hypre_InitializeTiming("BoomerAMG Setup"); + hypre_BeginTiming(time_index); + + HYPRE_BoomerAMGCreate(&par_solver); + HYPRE_BoomerAMGSetStrongThreshold(par_solver, strong_threshold); + HYPRE_BoomerAMGSetPMaxElmts(par_solver, P_max_elmts); + HYPRE_BoomerAMGSetCoarsenType(par_solver, coarsen_type); + HYPRE_BoomerAMGSetMaxIter(par_solver, max_iterations); + HYPRE_BoomerAMGSetMaxLevels(par_solver, max_levels); + HYPRE_BoomerAMGSetMaxCoarseSize(par_solver, max_coarse_size); + HYPRE_BoomerAMGSetTol(par_solver, tol); + HYPRE_BoomerAMGSetPrintLevel(par_solver, solver_print_level); + HYPRE_BoomerAMGSetLogging(par_solver, 1); + HYPRE_BoomerAMGSetCycleNumSweeps(par_solver, n_pre, 1); + HYPRE_BoomerAMGSetCycleNumSweeps(par_solver, n_post, 2); + HYPRE_BoomerAMGSetCycleNumSweeps(par_solver, n_pre, 3); + if (usr_jacobi_weight) + { + HYPRE_BoomerAMGSetRelaxWt(par_solver, jacobi_weight); + } + if (relax[0] > -1) + { + HYPRE_BoomerAMGSetRelaxType(par_solver, relax[0]); + } + for (i = 1; i < 4; i++) + { + if (relax[i] > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType(par_solver, relax[i], i); + } + } + HYPRE_BoomerAMGSetAggNumLevels(par_solver, agg_num_levels); + HYPRE_BoomerAMGSetAggInterpType(par_solver, agg_interp_type); + HYPRE_BoomerAMGSetAggPMaxElmts(par_solver, agg_P_max_elmts); + HYPRE_BoomerAMGSetModuleRAP2(par_solver, mod_rap2); + HYPRE_BoomerAMGSetKeepTranspose(par_solver, keep_transpose); + if (old_default) + { + HYPRE_BoomerAMGSetOldDefault(par_solver); + } + HYPRE_BoomerAMGSetup(par_solver, par_A, par_b, par_x); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + time_index = hypre_InitializeTiming("BoomerAMG Solve"); + hypre_BeginTiming(time_index); + + HYPRE_BoomerAMGSolve(par_solver, par_A, par_b, par_x); + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + HYPRE_BoomerAMGGetNumIterations(par_solver, &num_iterations); + HYPRE_BoomerAMGGetFinalRelativeResidualNorm(par_solver, final_res_norm_ptr); + HYPRE_BoomerAMGDestroy(par_solver); + } else if ((solver_id >= 0) && (solver_id < 10) && (solver_id != 3)) { time_index = hypre_InitializeTiming("Split Setup"); hypre_BeginTiming(time_index); HYPRE_SStructSplitCreate(comm, &solver); - HYPRE_SStructSplitSetMaxIter(solver, 100); + HYPRE_SStructSplitSetPrintLevel(solver, solver_print_level); + HYPRE_SStructSplitSetLogging(solver, 1); + HYPRE_SStructSplitSetMaxIter(solver, max_iterations); HYPRE_SStructSplitSetTol(solver, tol); if (solver_id == 0) { @@ -4098,7 +4909,7 @@ main( hypre_int argc, hypre_ClearTiming(); HYPRE_SStructSplitGetNumIterations(solver, &num_iterations); - HYPRE_SStructSplitGetFinalRelativeResidualNorm(solver, &final_res_norm); + HYPRE_SStructSplitGetFinalRelativeResidualNorm(solver, final_res_norm_ptr); HYPRE_SStructSplitDestroy(solver); } @@ -4107,16 +4918,16 @@ main( hypre_int argc, * Solve the system using PCG *-----------------------------------------------------------*/ - if ((solver_id >= 10) && (solver_id < 20)) + else if (!lobpcgFlag && (solver_id >= 10) && (solver_id < 20)) { time_index = hypre_InitializeTiming("PCG Setup"); hypre_BeginTiming(time_index); HYPRE_SStructPCGCreate(comm, &solver); - HYPRE_PCGSetMaxIter( (HYPRE_Solver) solver, 100 ); + HYPRE_PCGSetMaxIter( (HYPRE_Solver) solver, max_iterations ); HYPRE_PCGSetTol( (HYPRE_Solver) solver, tol ); HYPRE_PCGSetTwoNorm( (HYPRE_Solver) solver, 1 ); - HYPRE_PCGSetRelChange( (HYPRE_Solver) solver, 0 ); + HYPRE_PCGSetRelChange( (HYPRE_Solver) solver, rel_change ); HYPRE_PCGSetPrintLevel( (HYPRE_Solver) solver, solver_print_level ); HYPRE_PCGSetRecomputeResidual( (HYPRE_Solver) solver, recompute_res); @@ -4125,6 +4936,8 @@ main( hypre_int argc, /* use Split solver as preconditioner */ HYPRE_SStructSplitCreate(comm, &precond); HYPRE_SStructSplitSetMaxIter(precond, 1); + HYPRE_SStructSplitSetPrintLevel(precond, prec_print_level); + HYPRE_SStructSplitSetLogging(precond, 0); HYPRE_SStructSplitSetTol(precond, 0.0); HYPRE_SStructSplitSetZeroGuess(precond); if (solver_id == 10) @@ -4140,7 +4953,6 @@ main( hypre_int argc, (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSetup, (HYPRE_Solver) precond); } - else if (solver_id == 13) { /* use SysPFMG solver as preconditioner */ @@ -4149,7 +4961,7 @@ main( hypre_int argc, HYPRE_SStructSysPFMGSetTol(precond, 0.0); HYPRE_SStructSysPFMGSetZeroGuess(precond); /* weighted Jacobi = 1; red-black GS = 2 */ - HYPRE_SStructSysPFMGSetRelaxType(precond, relax); + HYPRE_SStructSysPFMGSetRelaxType(precond, relax[0]); if (usr_jacobi_weight) { HYPRE_SStructSysPFMGSetJacobiWeight(precond, jacobi_weight); @@ -4157,13 +4969,44 @@ main( hypre_int argc, HYPRE_SStructSysPFMGSetNumPreRelax(precond, n_pre); HYPRE_SStructSysPFMGSetNumPostRelax(precond, n_post); HYPRE_SStructSysPFMGSetSkipRelax(precond, skip); - /*HYPRE_StructPFMGSetDxyz(precond, dxyz);*/ + HYPRE_SStructSysPFMGSetPrintLevel(precond, prec_print_level); + HYPRE_SStructSysPFMGSetLogging(precond, 0); + /*HYPRE_SStructSysPFMGSetDxyz(precond, dxyz);*/ HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, (HYPRE_PtrToSolverFcn) HYPRE_SStructSysPFMGSolve, (HYPRE_PtrToSolverFcn) HYPRE_SStructSysPFMGSetup, (HYPRE_Solver) precond); } + else if (solver_id == 14) + { + /* use SSAMG solver as preconditioner */ + HYPRE_SStructSSAMGCreate(comm, &precond); + HYPRE_SStructSSAMGSetMaxIter(precond, 1); + HYPRE_SStructSSAMGSetMaxLevels(precond, max_levels); + HYPRE_SStructSSAMGSetTol(precond, 0.0); + HYPRE_SStructSSAMGSetZeroGuess(precond); + HYPRE_SStructSSAMGSetSkipRelax(precond, skip); + HYPRE_SStructSSAMGSetInterpType(precond, interp_type); + HYPRE_SStructSSAMGSetRelaxType(precond, relax[0]); + if (usr_jacobi_weight) + { + HYPRE_SStructSSAMGSetRelaxWeight(precond, jacobi_weight); + } + HYPRE_SStructSSAMGSetNumPreRelax(precond, n_pre); + HYPRE_SStructSSAMGSetNumPostRelax(precond, n_post); + HYPRE_SStructSSAMGSetNumCoarseRelax(precond, n_coarse); + HYPRE_SStructSSAMGSetMaxCoarseSize(precond, max_coarse_size); + HYPRE_SStructSSAMGSetCoarseSolverType(precond, csolver_type); + HYPRE_SStructSSAMGSetNonGalerkinRAP(precond, rap); + HYPRE_SStructSSAMGSetPrintLevel(precond, prec_print_level); + HYPRE_SStructSSAMGSetLogging(precond, 0); + + HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSSAMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSSAMGSetup, + (HYPRE_Solver) precond); + } else if (solver_id == 18) { /* use diagonal scaling as preconditioner */ @@ -4194,7 +5037,7 @@ main( hypre_int argc, hypre_ClearTiming(); HYPRE_PCGGetNumIterations( (HYPRE_Solver) solver, &num_iterations ); - HYPRE_PCGGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, &final_res_norm ); + HYPRE_PCGGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, final_res_norm_ptr ); HYPRE_SStructPCGDestroy(solver); if ((solver_id == 10) || (solver_id == 11)) @@ -4205,6 +5048,10 @@ main( hypre_int argc, { HYPRE_SStructSysPFMGDestroy(precond); } + else if (solver_id == 14) + { + HYPRE_SStructSSAMGDestroy(precond); + } } /* begin lobpcg */ @@ -4220,7 +5067,6 @@ main( hypre_int argc, if ( lobpcgFlag && (solver_id >= 10) && (solver_id < 20) ) { - interpreter = hypre_CTAlloc(mv_InterfaceInterpreter, 1, HYPRE_MEMORY_HOST); HYPRE_SStructSetupInterpreter( interpreter ); @@ -4231,9 +5077,8 @@ main( hypre_int argc, verbosity = 0; } - if ( pcgIterations > 0 ) + if (pcgIterations > 0) { - time_index = hypre_InitializeTiming("PCG Setup"); hypre_BeginTiming(time_index); @@ -4251,6 +5096,8 @@ main( hypre_int argc, HYPRE_SStructSplitSetMaxIter(precond, 1); HYPRE_SStructSplitSetTol(precond, 0.0); HYPRE_SStructSplitSetZeroGuess(precond); + HYPRE_SStructSplitSetPrintLevel(precond, prec_print_level); + HYPRE_SStructSplitSetLogging(precond, 0); if (solver_id == 10) { HYPRE_SStructSplitSetStructSolver(precond, HYPRE_SMG); @@ -4273,11 +5120,13 @@ main( hypre_int argc, HYPRE_SStructSysPFMGSetTol(precond, 0.0); HYPRE_SStructSysPFMGSetZeroGuess(precond); /* weighted Jacobi = 1; red-black GS = 2 */ - HYPRE_SStructSysPFMGSetRelaxType(precond, 1); + HYPRE_SStructSysPFMGSetRelaxType(precond, relax[0]); HYPRE_SStructSysPFMGSetNumPreRelax(precond, n_pre); HYPRE_SStructSysPFMGSetNumPostRelax(precond, n_post); HYPRE_SStructSysPFMGSetSkipRelax(precond, skip); /*HYPRE_StructPFMGSetDxyz(precond, dxyz);*/ + HYPRE_SStructSysPFMGSetPrintLevel(precond, prec_print_level); + HYPRE_SStructSysPFMGSetLogging(precond, 0); HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, (HYPRE_PtrToSolverFcn) HYPRE_SStructSysPFMGSolve, (HYPRE_PtrToSolverFcn) HYPRE_SStructSysPFMGSetup, @@ -4295,13 +5144,12 @@ main( hypre_int argc, } else if (solver_id != NO_SOLVER ) { - if ( verbosity ) + 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", comm); hypre_FinalizeTiming(time_index); @@ -4326,13 +5174,13 @@ main( hypre_int argc, x ); eigenvalues = hypre_CTAlloc(HYPRE_Real, blockSize, HYPRE_MEMORY_HOST); - if ( lobpcgSeed ) + if (seed) { - mv_MultiVectorSetRandom( eigenvectors, lobpcgSeed ); + mv_MultiVectorSetRandom(eigenvectors, seed); } else { - mv_MultiVectorSetRandom( eigenvectors, (HYPRE_Int)time(0) ); + mv_MultiVectorSetRandom(eigenvectors, (HYPRE_Int)time(0)); } time_index = hypre_InitializeTiming("PCG Solve"); @@ -4346,9 +5194,8 @@ main( hypre_int argc, hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - if ( checkOrtho ) + if (checkOrtho) { - gramXX = utilities_FortranMatrixCreate(); identity = utilities_FortranMatrixCreate(); @@ -4366,54 +5213,53 @@ main( hypre_int argc, utilities_FortranMatrixDestroy( gramXX ); utilities_FortranMatrixDestroy( identity ); - } - if ( printLevel ) + if (printLevel) { - - if ( myid == 0 ) + if (myid == 0) { - if ( (filePtr = fopen("values.txt", "w")) ) + if ((filePtr = fopen("values.txt", "w"))) { hypre_fprintf(filePtr, "%d\n", blockSize); - for ( i = 0; i < blockSize; i++ ) + 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++ ) + 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(); 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" ); + 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" ); + 1, blockSize, 1, iterations + 1, + printBuffer ); + utilities_FortranMatrixPrint(printBuffer, "res_hist.txt"); - utilities_FortranMatrixDestroy( printBuffer ); + utilities_FortranMatrixDestroy(printBuffer); } } } @@ -4435,7 +5281,6 @@ main( hypre_int argc, } else { - time_index = hypre_InitializeTiming("LOBPCG Setup"); hypre_BeginTiming(time_index); @@ -4451,6 +5296,8 @@ main( hypre_int argc, HYPRE_SStructSplitSetMaxIter(precond, 1); HYPRE_SStructSplitSetTol(precond, 0.0); HYPRE_SStructSplitSetZeroGuess(precond); + HYPRE_SStructSplitSetPrintLevel(precond, prec_print_level); + HYPRE_SStructSplitSetLogging(precond, 0); if (solver_id == 10) { HYPRE_SStructSplitSetStructSolver(precond, HYPRE_SMG); @@ -4473,11 +5320,13 @@ main( hypre_int argc, HYPRE_SStructSysPFMGSetTol(precond, 0.0); HYPRE_SStructSysPFMGSetZeroGuess(precond); /* weighted Jacobi = 1; red-black GS = 2 */ - HYPRE_SStructSysPFMGSetRelaxType(precond, 1); + HYPRE_SStructSysPFMGSetRelaxType(precond, relax[0]); HYPRE_SStructSysPFMGSetNumPreRelax(precond, n_pre); HYPRE_SStructSysPFMGSetNumPostRelax(precond, n_post); HYPRE_SStructSysPFMGSetSkipRelax(precond, skip); /*HYPRE_StructPFMGSetDxyz(precond, dxyz);*/ + HYPRE_SStructSysPFMGSetPrintLevel(precond, prec_print_level); + HYPRE_SStructSysPFMGSetLogging(precond, 0); HYPRE_LOBPCGSetPrecond( (HYPRE_Solver) solver, (HYPRE_PtrToSolverFcn) HYPRE_SStructSysPFMGSolve, (HYPRE_PtrToSolverFcn) HYPRE_SStructSysPFMGSetup, @@ -4514,77 +5363,74 @@ main( hypre_int argc, x ); eigenvalues = hypre_CTAlloc(HYPRE_Real, blockSize, HYPRE_MEMORY_HOST); - if ( lobpcgSeed ) + if (seed) { - mv_MultiVectorSetRandom( eigenvectors, lobpcgSeed ); + mv_MultiVectorSetRandom(eigenvectors, seed); } else { - mv_MultiVectorSetRandom( eigenvectors, (HYPRE_Int)time(0) ); + mv_MultiVectorSetRandom(eigenvectors, (HYPRE_Int)time(0)); } time_index = hypre_InitializeTiming("LOBPCG Solve"); hypre_BeginTiming(time_index); - HYPRE_LOBPCGSolve - ( (HYPRE_Solver) solver, constrains, eigenvectors, eigenvalues ); + HYPRE_LOBPCGSolve( (HYPRE_Solver) solver, constrains, + eigenvectors, eigenvalues ); hypre_EndTiming(time_index); hypre_PrintTiming("Solve phase times", comm); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); - if ( checkOrtho ) + if (checkOrtho) { - gramXX = utilities_FortranMatrixCreate(); identity = utilities_FortranMatrixCreate(); - utilities_FortranMatrixAllocateData( blockSize, blockSize, gramXX ); - utilities_FortranMatrixAllocateData( blockSize, blockSize, identity ); + 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 ) + 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) { - - if ( myid == 0 ) + if (myid == 0) { - if ( (filePtr = fopen("values.txt", "w")) ) + if ((filePtr = fopen("values.txt", "w"))) { hypre_fprintf(filePtr, "%d\n", blockSize); - for ( i = 0; i < blockSize; i++ ) + 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++ ) + 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(); @@ -4593,15 +5439,17 @@ main( hypre_int argc, eigenvaluesHistory = HYPRE_LOBPCGEigenvaluesHistory( (HYPRE_Solver)solver ); utilities_FortranMatrixSelectBlock( eigenvaluesHistory, - 1, blockSize, 1, iterations + 1, printBuffer ); - utilities_FortranMatrixPrint( printBuffer, "val_hist.txt" ); + 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" ); + 1, blockSize, 1, iterations + 1, + printBuffer); + utilities_FortranMatrixPrint(printBuffer, "res_hist.txt"); - utilities_FortranMatrixDestroy( printBuffer ); + utilities_FortranMatrixDestroy(printBuffer); } } } @@ -4621,26 +5469,24 @@ main( hypre_int argc, hypre_TFree(eigenvalues, HYPRE_MEMORY_HOST); } - hypre_TFree( interpreter, HYPRE_MEMORY_HOST); - + hypre_TFree(interpreter, HYPRE_MEMORY_HOST); } - /* end lobpcg */ /*----------------------------------------------------------- * Solve the system using ParCSR version of PCG *-----------------------------------------------------------*/ - if ((solver_id >= 20) && (solver_id < 30)) + else if ((solver_id >= 20) && (solver_id < 30)) { time_index = hypre_InitializeTiming("PCG Setup"); hypre_BeginTiming(time_index); HYPRE_ParCSRPCGCreate(comm, &par_solver); - HYPRE_PCGSetMaxIter( par_solver, 100 ); + HYPRE_PCGSetMaxIter( par_solver, max_iterations ); HYPRE_PCGSetTol( par_solver, tol ); HYPRE_PCGSetTwoNorm( par_solver, 1 ); - HYPRE_PCGSetRelChange( par_solver, 0 ); + HYPRE_PCGSetRelChange( par_solver, rel_change ); HYPRE_PCGSetPrintLevel( par_solver, solver_print_level ); HYPRE_PCGSetRecomputeResidual( (HYPRE_Solver) par_solver, recompute_res); @@ -4648,12 +5494,44 @@ main( hypre_int argc, { /* use BoomerAMG as preconditioner */ HYPRE_BoomerAMGCreate(&par_precond); - if (old_default) { HYPRE_BoomerAMGSetOldDefault(par_precond); } - HYPRE_BoomerAMGSetStrongThreshold(par_precond, 0.25); + HYPRE_BoomerAMGSetStrongThreshold(par_precond, strong_threshold); + HYPRE_BoomerAMGSetPMaxElmts(par_precond, P_max_elmts); + HYPRE_BoomerAMGSetCoarsenType(par_precond, coarsen_type); + HYPRE_BoomerAMGSetMaxIter(par_precond, 1); + HYPRE_BoomerAMGSetMaxLevels(par_precond, max_levels); + HYPRE_BoomerAMGSetMaxCoarseSize(par_precond, max_coarse_size); HYPRE_BoomerAMGSetTol(par_precond, 0.0); HYPRE_BoomerAMGSetPrintLevel(par_precond, prec_print_level); + HYPRE_BoomerAMGSetLogging(par_precond, 0); HYPRE_BoomerAMGSetPrintFileName(par_precond, "sstruct.out.log"); - HYPRE_BoomerAMGSetMaxIter(par_precond, 1); + HYPRE_BoomerAMGSetCycleNumSweeps(par_precond, n_pre, 1); + HYPRE_BoomerAMGSetCycleNumSweeps(par_precond, n_post, 2); + HYPRE_BoomerAMGSetCycleNumSweeps(par_precond, n_coarse, 3); + if (usr_jacobi_weight) + { + HYPRE_BoomerAMGSetRelaxWt(par_precond, jacobi_weight); + } + if (relax[0] > -1) + { + HYPRE_BoomerAMGSetRelaxType(par_precond, relax[0]); + } + for (i = 1; i < 4; i++) + { + if (relax[i] > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType(par_precond, relax[i], i); + } + } + HYPRE_BoomerAMGSetAggNumLevels(par_precond, agg_num_levels); + HYPRE_BoomerAMGSetAggInterpType(par_precond, agg_interp_type); + HYPRE_BoomerAMGSetAggPMaxElmts(par_precond, agg_P_max_elmts); + HYPRE_BoomerAMGSetModuleRAP2(par_precond, mod_rap2); + HYPRE_BoomerAMGSetKeepTranspose(par_precond, keep_transpose); + if (old_default) + { + HYPRE_BoomerAMGSetOldDefault(par_precond); + } + HYPRE_PCGSetPrecond( par_solver, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, @@ -4710,7 +5588,7 @@ main( hypre_int argc, hypre_ClearTiming(); HYPRE_PCGGetNumIterations( par_solver, &num_iterations ); - HYPRE_PCGGetFinalRelativeResidualNorm( par_solver, &final_res_norm ); + HYPRE_PCGGetFinalRelativeResidualNorm( par_solver, final_res_norm_ptr ); HYPRE_ParCSRPCGDestroy(par_solver); if (solver_id == 20) @@ -4731,14 +5609,14 @@ main( hypre_int argc, * Solve the system using GMRES *-----------------------------------------------------------*/ - if ((solver_id >= 30) && (solver_id < 40)) + else 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_GMRESSetKDim( (HYPRE_Solver) solver, k_dim ); + HYPRE_GMRESSetMaxIter( (HYPRE_Solver) solver, max_iterations ); HYPRE_GMRESSetTol( (HYPRE_Solver) solver, tol ); HYPRE_GMRESSetPrintLevel( (HYPRE_Solver) solver, solver_print_level ); HYPRE_GMRESSetLogging( (HYPRE_Solver) solver, 1 ); @@ -4750,6 +5628,8 @@ main( hypre_int argc, HYPRE_SStructSplitSetMaxIter(precond, 1); HYPRE_SStructSplitSetTol(precond, 0.0); HYPRE_SStructSplitSetZeroGuess(precond); + HYPRE_SStructSplitSetPrintLevel(precond, prec_print_level); + HYPRE_SStructSplitSetLogging(precond, 0); if (solver_id == 30) { HYPRE_SStructSplitSetStructSolver(precond, HYPRE_SMG); @@ -4763,7 +5643,55 @@ main( hypre_int argc, (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSetup, (HYPRE_Solver) precond ); } + else if (solver_id == 33) + { + /* 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, relax[0]); + HYPRE_SStructSysPFMGSetNumPreRelax(precond, n_pre); + HYPRE_SStructSysPFMGSetNumPostRelax(precond, n_post); + HYPRE_SStructSysPFMGSetSkipRelax(precond, skip); + HYPRE_SStructSysPFMGSetPrintLevel(precond, prec_print_level); + HYPRE_SStructSysPFMGSetLogging(precond, 0); + /*HYPRE_SStructSysPFMGSetDxyz(precond, dxyz);*/ + HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSysPFMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSysPFMGSetup, + (HYPRE_Solver) precond); + } + else if (solver_id == 34) + { + /* use SSAMG solver as preconditioner */ + HYPRE_SStructSSAMGCreate(comm, &precond); + HYPRE_SStructSSAMGSetMaxIter(precond, 1); + HYPRE_SStructSSAMGSetMaxLevels(precond, max_levels); + HYPRE_SStructSSAMGSetTol(precond, 0.0); + HYPRE_SStructSSAMGSetZeroGuess(precond); + HYPRE_SStructSSAMGSetSkipRelax(precond, skip); + HYPRE_SStructSSAMGSetInterpType(precond, interp_type); + HYPRE_SStructSSAMGSetRelaxType(precond, relax[0]); + HYPRE_SStructSSAMGSetNonGalerkinRAP(precond, rap); + if (usr_jacobi_weight) + { + HYPRE_SStructSSAMGSetRelaxWeight(precond, jacobi_weight); + } + HYPRE_SStructSSAMGSetNumPreRelax(precond, n_pre); + HYPRE_SStructSSAMGSetNumPostRelax(precond, n_post); + HYPRE_SStructSSAMGSetNumCoarseRelax(precond, n_coarse); + HYPRE_SStructSSAMGSetMaxCoarseSize(precond, max_coarse_size); + HYPRE_SStructSSAMGSetCoarseSolverType(precond, csolver_type); + HYPRE_SStructSSAMGSetPrintLevel(precond, prec_print_level); + HYPRE_SStructSSAMGSetLogging(precond, 0); + HYPRE_GMRESSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSSAMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSSAMGSetup, + (HYPRE_Solver) precond); + } else if (solver_id == 38) { /* use diagonal scaling as preconditioner */ @@ -4794,27 +5722,35 @@ main( hypre_int argc, hypre_ClearTiming(); HYPRE_GMRESGetNumIterations( (HYPRE_Solver) solver, &num_iterations ); - HYPRE_GMRESGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, &final_res_norm ); + HYPRE_GMRESGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, final_res_norm_ptr ); HYPRE_SStructGMRESDestroy(solver); if ((solver_id == 30) || (solver_id == 31)) { HYPRE_SStructSplitDestroy(precond); } + else if (solver_id == 33) + { + HYPRE_SStructSysPFMGDestroy(precond); + } + else if (solver_id == 34) + { + HYPRE_SStructSSAMGDestroy(precond); + } } /*----------------------------------------------------------- * Solve the system using ParCSR version of GMRES *-----------------------------------------------------------*/ - if ((solver_id >= 40) && (solver_id < 50)) + else 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_GMRESSetKDim(par_solver, k_dim); + HYPRE_GMRESSetMaxIter(par_solver, max_iterations); HYPRE_GMRESSetTol(par_solver, tol); HYPRE_GMRESSetPrintLevel(par_solver, solver_print_level); HYPRE_GMRESSetLogging(par_solver, 1); @@ -4823,12 +5759,43 @@ main( hypre_int argc, { /* use BoomerAMG as preconditioner */ HYPRE_BoomerAMGCreate(&par_precond); - if (old_default) { HYPRE_BoomerAMGSetOldDefault(par_precond); } - HYPRE_BoomerAMGSetStrongThreshold(par_precond, 0.25); + HYPRE_BoomerAMGSetStrongThreshold(par_precond, strong_threshold); + HYPRE_BoomerAMGSetPMaxElmts(par_precond, P_max_elmts); + HYPRE_BoomerAMGSetCoarsenType(par_precond, coarsen_type); + HYPRE_BoomerAMGSetMaxIter(par_precond, 1); + HYPRE_BoomerAMGSetMaxLevels(par_precond, max_levels); + HYPRE_BoomerAMGSetMaxCoarseSize(par_precond, max_coarse_size); HYPRE_BoomerAMGSetTol(par_precond, 0.0); + HYPRE_BoomerAMGSetLogging(par_precond, 0); HYPRE_BoomerAMGSetPrintLevel(par_precond, prec_print_level); HYPRE_BoomerAMGSetPrintFileName(par_precond, "sstruct.out.log"); - HYPRE_BoomerAMGSetMaxIter(par_precond, 1); + HYPRE_BoomerAMGSetCycleNumSweeps(par_precond, n_pre, 1); + HYPRE_BoomerAMGSetCycleNumSweeps(par_precond, n_post, 2); + HYPRE_BoomerAMGSetCycleNumSweeps(par_precond, n_pre, 3); + if (usr_jacobi_weight) + { + HYPRE_BoomerAMGSetRelaxWt(par_precond, jacobi_weight); + } + if (relax[0] > -1) + { + HYPRE_BoomerAMGSetRelaxType(par_precond, relax[0]); + } + for (i = 1; i < 4; i++) + { + if (relax[i] > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType(par_precond, relax[i], i); + } + } + HYPRE_BoomerAMGSetAggNumLevels(par_precond, agg_num_levels); + HYPRE_BoomerAMGSetAggInterpType(par_precond, agg_interp_type); + HYPRE_BoomerAMGSetAggPMaxElmts(par_precond, agg_P_max_elmts); + HYPRE_BoomerAMGSetModuleRAP2(par_precond, mod_rap2); + HYPRE_BoomerAMGSetKeepTranspose(par_precond, keep_transpose); + if (old_default) + { + HYPRE_BoomerAMGSetOldDefault(par_precond); + } HYPRE_GMRESSetPrecond( par_solver, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, @@ -4876,7 +5843,7 @@ main( hypre_int argc, hypre_ClearTiming(); HYPRE_GMRESGetNumIterations( par_solver, &num_iterations); - HYPRE_GMRESGetFinalRelativeResidualNorm( par_solver, &final_res_norm); + HYPRE_GMRESGetFinalRelativeResidualNorm( par_solver, final_res_norm_ptr); HYPRE_ParCSRGMRESDestroy(par_solver); if (solver_id == 40) @@ -4897,13 +5864,13 @@ main( hypre_int argc, * Solve the system using BiCGSTAB *-----------------------------------------------------------*/ - if ((solver_id >= 50) && (solver_id < 60)) + else if ((solver_id >= 50) && (solver_id < 60)) { time_index = hypre_InitializeTiming("BiCGSTAB Setup"); hypre_BeginTiming(time_index); HYPRE_SStructBiCGSTABCreate(comm, &solver); - HYPRE_BiCGSTABSetMaxIter( (HYPRE_Solver) solver, 100 ); + HYPRE_BiCGSTABSetMaxIter( (HYPRE_Solver) solver, max_iterations ); HYPRE_BiCGSTABSetTol( (HYPRE_Solver) solver, tol ); HYPRE_BiCGSTABSetPrintLevel( (HYPRE_Solver) solver, solver_print_level ); HYPRE_BiCGSTABSetLogging( (HYPRE_Solver) solver, 1 ); @@ -4915,6 +5882,8 @@ main( hypre_int argc, HYPRE_SStructSplitSetMaxIter(precond, 1); HYPRE_SStructSplitSetTol(precond, 0.0); HYPRE_SStructSplitSetZeroGuess(precond); + HYPRE_SStructSplitSetPrintLevel(precond, prec_print_level); + HYPRE_SStructSplitSetLogging(precond, 0); if (solver_id == 50) { HYPRE_SStructSplitSetStructSolver(precond, HYPRE_SMG); @@ -4928,7 +5897,56 @@ main( hypre_int argc, (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSetup, (HYPRE_Solver) precond ); } + else if (solver_id == 53) + { + /* 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, relax[0]); + HYPRE_SStructSysPFMGSetNumPreRelax(precond, n_pre); + HYPRE_SStructSysPFMGSetNumPostRelax(precond, n_post); + HYPRE_SStructSysPFMGSetSkipRelax(precond, skip); + /*HYPRE_SStructSysPFMGSetDxyz(precond, dxyz);*/ + HYPRE_SStructSysPFMGSetPrintLevel(precond, prec_print_level); + HYPRE_SStructSysPFMGSetLogging(precond, 0); + + HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSysPFMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSysPFMGSetup, + (HYPRE_Solver) precond); + } + else if (solver_id == 54) + { + /* use SSAMG solver as preconditioner */ + HYPRE_SStructSSAMGCreate(comm, &precond); + HYPRE_SStructSSAMGSetMaxIter(precond, 1); + HYPRE_SStructSSAMGSetMaxLevels(precond, max_levels); + HYPRE_SStructSSAMGSetTol(precond, 0.0); + HYPRE_SStructSSAMGSetZeroGuess(precond); + HYPRE_SStructSSAMGSetSkipRelax(precond, skip); + HYPRE_SStructSSAMGSetInterpType(precond, interp_type); + HYPRE_SStructSSAMGSetRelaxType(precond, relax[0]); + HYPRE_SStructSSAMGSetNonGalerkinRAP(precond, rap); + if (usr_jacobi_weight) + { + HYPRE_SStructSSAMGSetRelaxWeight(precond, jacobi_weight); + } + HYPRE_SStructSSAMGSetNumPreRelax(precond, n_pre); + HYPRE_SStructSSAMGSetNumPostRelax(precond, n_post); + HYPRE_SStructSSAMGSetNumCoarseRelax(precond, n_coarse); + HYPRE_SStructSSAMGSetMaxCoarseSize(precond, max_coarse_size); + HYPRE_SStructSSAMGSetCoarseSolverType(precond, csolver_type); + HYPRE_SStructSSAMGSetPrintLevel(precond, prec_print_level); + HYPRE_SStructSSAMGSetLogging(precond, 0); + HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSSAMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSSAMGSetup, + (HYPRE_Solver) precond); + } else if (solver_id == 58) { /* use diagonal scaling as preconditioner */ @@ -4959,26 +5977,34 @@ main( hypre_int argc, hypre_ClearTiming(); HYPRE_BiCGSTABGetNumIterations( (HYPRE_Solver) solver, &num_iterations ); - HYPRE_BiCGSTABGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, &final_res_norm ); + HYPRE_BiCGSTABGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, final_res_norm_ptr ); HYPRE_SStructBiCGSTABDestroy(solver); if ((solver_id == 50) || (solver_id == 51)) { HYPRE_SStructSplitDestroy(precond); } + else if (solver_id == 53) + { + HYPRE_SStructSysPFMGDestroy(precond); + } + else if (solver_id == 54) + { + HYPRE_SStructSSAMGDestroy(precond); + } } /*----------------------------------------------------------- * Solve the system using ParCSR version of BiCGSTAB *-----------------------------------------------------------*/ - if ((solver_id >= 60) && (solver_id < 70)) + else if ((solver_id >= 60) && (solver_id < 70)) { time_index = hypre_InitializeTiming("BiCGSTAB Setup"); hypre_BeginTiming(time_index); HYPRE_ParCSRBiCGSTABCreate(comm, &par_solver); - HYPRE_BiCGSTABSetMaxIter(par_solver, 100); + HYPRE_BiCGSTABSetMaxIter(par_solver, max_iterations); HYPRE_BiCGSTABSetTol(par_solver, tol); HYPRE_BiCGSTABSetPrintLevel(par_solver, solver_print_level); HYPRE_BiCGSTABSetLogging(par_solver, 1); @@ -4987,12 +6013,43 @@ main( hypre_int argc, { /* use BoomerAMG as preconditioner */ HYPRE_BoomerAMGCreate(&par_precond); - if (old_default) { HYPRE_BoomerAMGSetOldDefault(par_precond); } - HYPRE_BoomerAMGSetStrongThreshold(par_precond, 0.25); + HYPRE_BoomerAMGSetStrongThreshold(par_precond, strong_threshold); + HYPRE_BoomerAMGSetPMaxElmts(par_precond, P_max_elmts); + HYPRE_BoomerAMGSetCoarsenType(par_precond, coarsen_type); + HYPRE_BoomerAMGSetMaxIter(par_precond, 1); + HYPRE_BoomerAMGSetMaxLevels(par_precond, max_levels); + HYPRE_BoomerAMGSetMaxCoarseSize(par_precond, max_coarse_size); HYPRE_BoomerAMGSetTol(par_precond, 0.0); + HYPRE_BoomerAMGSetLogging(par_precond, 0); HYPRE_BoomerAMGSetPrintLevel(par_precond, prec_print_level); HYPRE_BoomerAMGSetPrintFileName(par_precond, "sstruct.out.log"); - HYPRE_BoomerAMGSetMaxIter(par_precond, 1); + HYPRE_BoomerAMGSetCycleNumSweeps(par_precond, n_pre, 1); + HYPRE_BoomerAMGSetCycleNumSweeps(par_precond, n_post, 2); + HYPRE_BoomerAMGSetCycleNumSweeps(par_precond, n_pre, 3); + if (usr_jacobi_weight) + { + HYPRE_BoomerAMGSetRelaxWt(par_precond, jacobi_weight); + } + if (relax[0] > -1) + { + HYPRE_BoomerAMGSetRelaxType(par_precond, relax[0]); + } + for (i = 1; i < 4; i++) + { + if (relax[i] > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType(par_precond, relax[i], i); + } + } + HYPRE_BoomerAMGSetAggNumLevels(par_precond, agg_num_levels); + HYPRE_BoomerAMGSetAggInterpType(par_precond, agg_interp_type); + HYPRE_BoomerAMGSetAggPMaxElmts(par_precond, agg_P_max_elmts); + HYPRE_BoomerAMGSetModuleRAP2(par_precond, mod_rap2); + HYPRE_BoomerAMGSetKeepTranspose(par_precond, keep_transpose); + if (old_default) + { + HYPRE_BoomerAMGSetOldDefault(par_precond); + } HYPRE_BiCGSTABSetPrecond( par_solver, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, @@ -5008,7 +6065,6 @@ main( hypre_int argc, (HYPRE_PtrToSolverFcn) HYPRE_EuclidSetup, par_precond); } - else if (solver_id == 62) { /* use ParaSails as preconditioner */ @@ -5041,7 +6097,7 @@ main( hypre_int argc, hypre_ClearTiming(); HYPRE_BiCGSTABGetNumIterations( par_solver, &num_iterations); - HYPRE_BiCGSTABGetFinalRelativeResidualNorm( par_solver, &final_res_norm); + HYPRE_BiCGSTABGetFinalRelativeResidualNorm( par_solver, final_res_norm_ptr); HYPRE_ParCSRBiCGSTABDestroy(par_solver); if (solver_id == 60) @@ -5062,14 +6118,14 @@ main( hypre_int argc, * Solve the system using Flexible GMRES *-----------------------------------------------------------*/ - if ((solver_id >= 70) && (solver_id < 80)) + else if ((solver_id >= 70) && (solver_id < 80)) { time_index = hypre_InitializeTiming("FlexGMRES Setup"); hypre_BeginTiming(time_index); HYPRE_SStructFlexGMRESCreate(comm, &solver); - HYPRE_FlexGMRESSetKDim( (HYPRE_Solver) solver, 5 ); - HYPRE_FlexGMRESSetMaxIter( (HYPRE_Solver) solver, 100 ); + HYPRE_FlexGMRESSetKDim( (HYPRE_Solver) solver, k_dim ); + HYPRE_FlexGMRESSetMaxIter( (HYPRE_Solver) solver, max_iterations ); HYPRE_FlexGMRESSetTol( (HYPRE_Solver) solver, tol ); HYPRE_FlexGMRESSetPrintLevel( (HYPRE_Solver) solver, solver_print_level ); HYPRE_FlexGMRESSetLogging( (HYPRE_Solver) solver, 1 ); @@ -5081,6 +6137,8 @@ main( hypre_int argc, HYPRE_SStructSplitSetMaxIter(precond, 1); HYPRE_SStructSplitSetTol(precond, 0.0); HYPRE_SStructSplitSetZeroGuess(precond); + HYPRE_SStructSplitSetPrintLevel(precond, prec_print_level); + HYPRE_SStructSplitSetLogging(precond, 0); if (solver_id == 70) { HYPRE_SStructSplitSetStructSolver(precond, HYPRE_SMG); @@ -5094,7 +6152,56 @@ main( hypre_int argc, (HYPRE_PtrToSolverFcn) HYPRE_SStructSplitSetup, (HYPRE_Solver) precond ); } + else if (solver_id == 73) + { + /* 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, relax[0]); + HYPRE_SStructSysPFMGSetNumPreRelax(precond, n_pre); + HYPRE_SStructSysPFMGSetNumPostRelax(precond, n_post); + HYPRE_SStructSysPFMGSetSkipRelax(precond, skip); + /*HYPRE_SStructSysPFMGSetDxyz(precond, dxyz);*/ + HYPRE_SStructSysPFMGSetPrintLevel(precond, prec_print_level); + HYPRE_SStructSysPFMGSetLogging(precond, 0); + + HYPRE_FlexGMRESSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSysPFMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSysPFMGSetup, + (HYPRE_Solver) precond); + } + else if (solver_id == 74) + { + /* use SSAMG solver as preconditioner */ + HYPRE_SStructSSAMGCreate(comm, &precond); + HYPRE_SStructSSAMGSetMaxIter(precond, 1); + HYPRE_SStructSSAMGSetMaxLevels(precond, max_levels); + HYPRE_SStructSSAMGSetTol(precond, 0.0); + HYPRE_SStructSSAMGSetZeroGuess(precond); + HYPRE_SStructSSAMGSetSkipRelax(precond, skip); + HYPRE_SStructSSAMGSetInterpType(precond, interp_type); + HYPRE_SStructSSAMGSetRelaxType(precond, relax[0]); + HYPRE_SStructSSAMGSetNonGalerkinRAP(precond, rap); + if (usr_jacobi_weight) + { + HYPRE_SStructSSAMGSetRelaxWeight(precond, jacobi_weight); + } + HYPRE_SStructSSAMGSetNumPreRelax(precond, n_pre); + HYPRE_SStructSSAMGSetNumPostRelax(precond, n_post); + HYPRE_SStructSSAMGSetNumCoarseRelax(precond, n_coarse); + HYPRE_SStructSSAMGSetMaxCoarseSize(precond, max_coarse_size); + HYPRE_SStructSSAMGSetCoarseSolverType(precond, csolver_type); + HYPRE_SStructSSAMGSetPrintLevel(precond, prec_print_level); + HYPRE_SStructSSAMGSetLogging(precond, 0); + HYPRE_FlexGMRESSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSSAMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSSAMGSetup, + (HYPRE_Solver) precond); + } else if (solver_id == 78) { /* use diagonal scaling as preconditioner */ @@ -5125,27 +6232,35 @@ main( hypre_int argc, hypre_ClearTiming(); HYPRE_FlexGMRESGetNumIterations( (HYPRE_Solver) solver, &num_iterations ); - HYPRE_FlexGMRESGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, &final_res_norm ); + HYPRE_FlexGMRESGetFinalRelativeResidualNorm( (HYPRE_Solver) solver, final_res_norm_ptr ); HYPRE_SStructFlexGMRESDestroy(solver); if ((solver_id == 70) || (solver_id == 71)) { HYPRE_SStructSplitDestroy(precond); } + else if (solver_id == 73) + { + HYPRE_SStructSysPFMGDestroy(precond); + } + else if (solver_id == 74) + { + HYPRE_SStructSSAMGDestroy(precond); + } } /*----------------------------------------------------------- * Solve the system using ParCSR version of Flexible GMRES *-----------------------------------------------------------*/ - if ((solver_id >= 80) && (solver_id < 90)) + else if ((solver_id >= 80) && (solver_id < 90)) { time_index = hypre_InitializeTiming("FlexGMRES Setup"); hypre_BeginTiming(time_index); HYPRE_ParCSRFlexGMRESCreate(comm, &par_solver); - HYPRE_FlexGMRESSetKDim(par_solver, 5); - HYPRE_FlexGMRESSetMaxIter(par_solver, 100); + HYPRE_FlexGMRESSetKDim(par_solver, k_dim); + HYPRE_FlexGMRESSetMaxIter(par_solver, max_iterations); HYPRE_FlexGMRESSetTol(par_solver, tol); HYPRE_FlexGMRESSetPrintLevel(par_solver, solver_print_level); HYPRE_FlexGMRESSetLogging(par_solver, 1); @@ -5154,12 +6269,43 @@ main( hypre_int argc, { /* use BoomerAMG as preconditioner */ HYPRE_BoomerAMGCreate(&par_precond); - if (old_default) { HYPRE_BoomerAMGSetOldDefault(par_precond); } - HYPRE_BoomerAMGSetStrongThreshold(par_precond, 0.25); + HYPRE_BoomerAMGSetStrongThreshold(par_precond, strong_threshold); + HYPRE_BoomerAMGSetPMaxElmts(par_precond, P_max_elmts); + HYPRE_BoomerAMGSetCoarsenType(par_precond, coarsen_type); + HYPRE_BoomerAMGSetMaxIter(par_precond, 1); + HYPRE_BoomerAMGSetMaxLevels(par_precond, max_levels); + HYPRE_BoomerAMGSetMaxCoarseSize(par_precond, max_coarse_size); HYPRE_BoomerAMGSetTol(par_precond, 0.0); + HYPRE_BoomerAMGSetLogging(par_precond, 0); HYPRE_BoomerAMGSetPrintLevel(par_precond, prec_print_level); HYPRE_BoomerAMGSetPrintFileName(par_precond, "sstruct.out.log"); - HYPRE_BoomerAMGSetMaxIter(par_precond, 1); + HYPRE_BoomerAMGSetCycleNumSweeps(par_precond, n_pre, 1); + HYPRE_BoomerAMGSetCycleNumSweeps(par_precond, n_post, 2); + HYPRE_BoomerAMGSetCycleNumSweeps(par_precond, n_pre, 3); + if (usr_jacobi_weight) + { + HYPRE_BoomerAMGSetRelaxWt(par_precond, jacobi_weight); + } + if (relax[0] > -1) + { + HYPRE_BoomerAMGSetRelaxType(par_precond, relax[0]); + } + for (i = 1; i < 4; i++) + { + if (relax[i] > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType(par_precond, relax[i], i); + } + } + HYPRE_BoomerAMGSetAggNumLevels(par_precond, agg_num_levels); + HYPRE_BoomerAMGSetAggInterpType(par_precond, agg_interp_type); + HYPRE_BoomerAMGSetAggPMaxElmts(par_precond, agg_P_max_elmts); + HYPRE_BoomerAMGSetModuleRAP2(par_precond, mod_rap2); + HYPRE_BoomerAMGSetKeepTranspose(par_precond, keep_transpose); + if (old_default) + { + HYPRE_BoomerAMGSetOldDefault(par_precond); + } HYPRE_FlexGMRESSetPrecond( par_solver, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, @@ -5186,7 +6332,7 @@ main( hypre_int argc, hypre_ClearTiming(); HYPRE_FlexGMRESGetNumIterations( par_solver, &num_iterations); - HYPRE_FlexGMRESGetFinalRelativeResidualNorm( par_solver, &final_res_norm); + HYPRE_FlexGMRESGetFinalRelativeResidualNorm( par_solver, final_res_norm_ptr); HYPRE_ParCSRFlexGMRESDestroy(par_solver); if (solver_id == 80) @@ -5199,15 +6345,15 @@ main( hypre_int argc, * Solve the system using ParCSR version of LGMRES *-----------------------------------------------------------*/ - if ((solver_id >= 90) && (solver_id < 100)) + else if ((solver_id >= 90) && (solver_id < 100)) { time_index = hypre_InitializeTiming("LGMRES Setup"); 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_LGMRESSetKDim(par_solver, k_dim); + HYPRE_LGMRESSetAugDim(par_solver, aug_dim); + HYPRE_LGMRESSetMaxIter(par_solver, max_iterations); HYPRE_LGMRESSetTol(par_solver, tol); HYPRE_LGMRESSetPrintLevel(par_solver, solver_print_level); HYPRE_LGMRESSetLogging(par_solver, 1); @@ -5216,12 +6362,43 @@ main( hypre_int argc, { /* use BoomerAMG as preconditioner */ HYPRE_BoomerAMGCreate(&par_precond); - if (old_default) { HYPRE_BoomerAMGSetOldDefault(par_precond); } - HYPRE_BoomerAMGSetStrongThreshold(par_precond, 0.25); + HYPRE_BoomerAMGSetStrongThreshold(par_precond, strong_threshold); + HYPRE_BoomerAMGSetPMaxElmts(par_precond, P_max_elmts); + HYPRE_BoomerAMGSetCoarsenType(par_precond, coarsen_type); + HYPRE_BoomerAMGSetMaxIter(par_precond, 1); + HYPRE_BoomerAMGSetMaxLevels(par_precond, max_levels); + HYPRE_BoomerAMGSetMaxCoarseSize(par_precond, max_coarse_size); HYPRE_BoomerAMGSetTol(par_precond, 0.0); + HYPRE_BoomerAMGSetLogging(par_precond, 0); HYPRE_BoomerAMGSetPrintLevel(par_precond, prec_print_level); HYPRE_BoomerAMGSetPrintFileName(par_precond, "sstruct.out.log"); - HYPRE_BoomerAMGSetMaxIter(par_precond, 1); + HYPRE_BoomerAMGSetCycleNumSweeps(par_precond, n_pre, 1); + HYPRE_BoomerAMGSetCycleNumSweeps(par_precond, n_post, 2); + HYPRE_BoomerAMGSetCycleNumSweeps(par_precond, n_pre, 3); + if (usr_jacobi_weight) + { + HYPRE_BoomerAMGSetRelaxWt(par_precond, jacobi_weight); + } + if (relax[0] > -1) + { + HYPRE_BoomerAMGSetRelaxType(par_precond, relax[0]); + } + for (i = 1; i < 4; i++) + { + if (relax[i] > -1) + { + HYPRE_BoomerAMGSetCycleRelaxType(par_precond, relax[i], i); + } + } + HYPRE_BoomerAMGSetAggNumLevels(par_precond, agg_num_levels); + HYPRE_BoomerAMGSetAggInterpType(par_precond, agg_interp_type); + HYPRE_BoomerAMGSetAggPMaxElmts(par_precond, agg_P_max_elmts); + HYPRE_BoomerAMGSetModuleRAP2(par_precond, mod_rap2); + HYPRE_BoomerAMGSetKeepTranspose(par_precond, keep_transpose); + if (old_default) + { + HYPRE_BoomerAMGSetOldDefault(par_precond); + } HYPRE_LGMRESSetPrecond( par_solver, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup, @@ -5248,7 +6425,7 @@ main( hypre_int argc, hypre_ClearTiming(); HYPRE_LGMRESGetNumIterations( par_solver, &num_iterations); - HYPRE_LGMRESGetFinalRelativeResidualNorm( par_solver, &final_res_norm); + HYPRE_LGMRESGetFinalRelativeResidualNorm( par_solver, final_res_norm_ptr); HYPRE_ParCSRLGMRESDestroy(par_solver); if (solver_id == 90) @@ -5261,7 +6438,7 @@ main( hypre_int argc, * Solve the system using ParCSR hybrid DSCG/BoomerAMG *-----------------------------------------------------------*/ - if (solver_id == 120) + else if (solver_id == 120) { time_index = hypre_InitializeTiming("Hybrid Setup"); hypre_BeginTiming(time_index); @@ -5269,8 +6446,8 @@ main( hypre_int argc, 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_ParCSRHybridSetRelChange(par_solver, rel_change); + HYPRE_ParCSRHybridSetPrintLevel(par_solver, prec_print_level); HYPRE_ParCSRHybridSetLogging(par_solver, 1); HYPRE_ParCSRHybridSetSolverType(par_solver, solver_type); HYPRE_ParCSRHybridSetRecomputeResidual(par_solver, recompute_res); @@ -5320,17 +6497,7 @@ main( hypre_int argc, hypre_ClearTiming(); 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_ParCSRHybridGetFinalRelativeResidualNorm(par_solver, final_res_norm_ptr); HYPRE_ParCSRHybridDestroy(par_solver); @@ -5346,16 +6513,16 @@ main( hypre_int argc, * Solve the system using Struct solvers *-----------------------------------------------------------*/ - if (solver_id == 200) + else if (solver_id == 200) { time_index = hypre_InitializeTiming("SMG Setup"); hypre_BeginTiming(time_index); HYPRE_StructSMGCreate(comm, &struct_solver); HYPRE_StructSMGSetMemoryUse(struct_solver, 0); - HYPRE_StructSMGSetMaxIter(struct_solver, 50); + HYPRE_StructSMGSetMaxIter(struct_solver, max_iterations); HYPRE_StructSMGSetTol(struct_solver, tol); - HYPRE_StructSMGSetRelChange(struct_solver, 0); + HYPRE_StructSMGSetRelChange(struct_solver, rel_change); HYPRE_StructSMGSetNumPreRelax(struct_solver, n_pre); HYPRE_StructSMGSetNumPostRelax(struct_solver, n_post); HYPRE_StructSMGSetPrintLevel(struct_solver, prec_print_level); @@ -5378,7 +6545,7 @@ main( hypre_int argc, hypre_ClearTiming(); HYPRE_StructSMGGetNumIterations(struct_solver, &num_iterations); - HYPRE_StructSMGGetFinalRelativeResidualNorm(struct_solver, &final_res_norm); + HYPRE_StructSMGGetFinalRelativeResidualNorm(struct_solver, final_res_norm_ptr); HYPRE_StructSMGDestroy(struct_solver); } @@ -5388,11 +6555,12 @@ main( hypre_int argc, hypre_BeginTiming(time_index); HYPRE_StructPFMGCreate(comm, &struct_solver); - HYPRE_StructPFMGSetMaxIter(struct_solver, 50); + HYPRE_StructPFMGSetMaxLevels(struct_solver, max_levels); + HYPRE_StructPFMGSetMaxIter(struct_solver, max_iterations); HYPRE_StructPFMGSetTol(struct_solver, tol); - HYPRE_StructPFMGSetRelChange(struct_solver, 0); + HYPRE_StructPFMGSetRelChange(struct_solver, rel_change); HYPRE_StructPFMGSetRAPType(struct_solver, rap); - HYPRE_StructPFMGSetRelaxType(struct_solver, relax); + HYPRE_StructPFMGSetRelaxType(struct_solver, relax[0]); if (usr_jacobi_weight) { HYPRE_StructPFMGSetJacobiWeight(struct_solver, jacobi_weight); @@ -5421,7 +6589,7 @@ main( hypre_int argc, hypre_ClearTiming(); HYPRE_StructPFMGGetNumIterations(struct_solver, &num_iterations); - HYPRE_StructPFMGGetFinalRelativeResidualNorm(struct_solver, &final_res_norm); + HYPRE_StructPFMGGetFinalRelativeResidualNorm(struct_solver, final_res_norm_ptr); HYPRE_StructPFMGDestroy(struct_solver); } @@ -5463,64 +6631,19 @@ main( hypre_int argc, HYPRE_StructVectorInitialize(sr); HYPRE_StructVectorAssemble(sr); HYPRE_StructVectorCopy(sb, sr); - hypre_StructMatvec(-1.0, sA, sx, 1.0, sr); + HYPRE_StructMatrixMatvec(-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); + HYPRE_StructVectorInnerProd(sr, sr, &final_res_norm); if (final_res_norm < 1.0e-20) { final_res_norm = 0.0; } + hypre_MuPDataCopyToMP(final_res_norm_ptr, &final_res_norm, 1); // RDF: See above HYPRE_StructVectorDestroy(sr); HYPRE_StructCycRedDestroy(struct_solver); } - /*----------------------------------------------------------- - * Solve the system using SparseMSG - *-----------------------------------------------------------*/ - - else if (solver_id == 202) - { - time_index = hypre_InitializeTiming("SparseMSG Setup"); - hypre_BeginTiming(time_index); - - 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); - - 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_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); - } - /*----------------------------------------------------------- * Solve the system using Jacobi *-----------------------------------------------------------*/ @@ -5531,7 +6654,7 @@ main( hypre_int argc, hypre_BeginTiming(time_index); HYPRE_StructJacobiCreate(comm, &struct_solver); - HYPRE_StructJacobiSetMaxIter(struct_solver, 100); + HYPRE_StructJacobiSetMaxIter(struct_solver, max_iterations); HYPRE_StructJacobiSetTol(struct_solver, tol); HYPRE_StructJacobiSetup(struct_solver, sA, sb, sx); @@ -5551,8 +6674,7 @@ main( hypre_int argc, hypre_ClearTiming(); HYPRE_StructJacobiGetNumIterations(struct_solver, &num_iterations); - HYPRE_StructJacobiGetFinalRelativeResidualNorm(struct_solver, - &final_res_norm); + HYPRE_StructJacobiGetFinalRelativeResidualNorm(struct_solver, final_res_norm_ptr); HYPRE_StructJacobiDestroy(struct_solver); } @@ -5560,16 +6682,16 @@ main( hypre_int argc, * Solve the system using CG *-----------------------------------------------------------*/ - if ((solver_id > 209) && (solver_id < 220)) + else if ((solver_id > 209) && (solver_id < 220)) { time_index = hypre_InitializeTiming("PCG Setup"); hypre_BeginTiming(time_index); HYPRE_StructPCGCreate(comm, &struct_solver); - HYPRE_PCGSetMaxIter( (HYPRE_Solver)struct_solver, 100 ); + HYPRE_PCGSetMaxIter( (HYPRE_Solver)struct_solver, max_iterations ); HYPRE_PCGSetTol( (HYPRE_Solver)struct_solver, tol ); HYPRE_PCGSetTwoNorm( (HYPRE_Solver)struct_solver, 1 ); - HYPRE_PCGSetRelChange( (HYPRE_Solver)struct_solver, 0 ); + HYPRE_PCGSetRelChange( (HYPRE_Solver)struct_solver, rel_change ); HYPRE_PCGSetPrintLevel( (HYPRE_Solver)struct_solver, solver_print_level ); HYPRE_PCGSetRecomputeResidual( (HYPRE_Solver)struct_solver, recompute_res); @@ -5595,11 +6717,12 @@ main( hypre_int argc, { /* use symmetric PFMG as preconditioner */ HYPRE_StructPFMGCreate(comm, &struct_precond); + HYPRE_StructPFMGSetMaxLevels(struct_precond, max_levels); 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); + HYPRE_StructPFMGSetRelaxType(struct_precond, relax[0]); if (usr_jacobi_weight) { HYPRE_StructPFMGSetJacobiWeight(struct_precond, jacobi_weight); @@ -5616,29 +6739,6 @@ main( hypre_int argc, (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 == 217) { /* use two-step Jacobi as preconditioner */ @@ -5684,7 +6784,7 @@ main( hypre_int argc, hypre_ClearTiming(); HYPRE_PCGGetNumIterations( (HYPRE_Solver)struct_solver, &num_iterations ); - HYPRE_PCGGetFinalRelativeResidualNorm( (HYPRE_Solver)struct_solver, &final_res_norm ); + HYPRE_PCGGetFinalRelativeResidualNorm( (HYPRE_Solver)struct_solver, final_res_norm_ptr ); HYPRE_StructPCGDestroy(struct_solver); if (solver_id == 210) @@ -5695,10 +6795,6 @@ main( hypre_int argc, { HYPRE_StructPFMGDestroy(struct_precond); } - else if (solver_id == 212) - { - HYPRE_StructSparseMSGDestroy(struct_precond); - } else if (solver_id == 217) { HYPRE_StructJacobiDestroy(struct_precond); @@ -5709,19 +6805,19 @@ main( hypre_int argc, * Solve the system using Hybrid *-----------------------------------------------------------*/ - if ((solver_id > 219) && (solver_id < 230)) + else if ((solver_id > 219) && (solver_id < 230)) { time_index = hypre_InitializeTiming("Hybrid Setup"); hypre_BeginTiming(time_index); HYPRE_StructHybridCreate(comm, &struct_solver); - HYPRE_StructHybridSetDSCGMaxIter(struct_solver, 100); - HYPRE_StructHybridSetPCGMaxIter(struct_solver, 100); + HYPRE_StructHybridSetDSCGMaxIter(struct_solver, max_iterations); + HYPRE_StructHybridSetPCGMaxIter(struct_solver, max_iterations); 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); + HYPRE_StructHybridSetRelChange(struct_solver, rel_change); if (solver_type == 2) /* for use with GMRES */ { HYPRE_StructHybridSetStopCrit(struct_solver, 0); @@ -5754,11 +6850,12 @@ main( hypre_int argc, { /* use symmetric PFMG as preconditioner */ HYPRE_StructPFMGCreate(comm, &struct_precond); + HYPRE_StructPFMGSetMaxLevels(struct_precond, max_levels); 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); + HYPRE_StructPFMGSetRelaxType(struct_precond, relax[0]); if (usr_jacobi_weight) { HYPRE_StructPFMGSetJacobiWeight(struct_precond, jacobi_weight); @@ -5775,29 +6872,6 @@ main( hypre_int argc, struct_precond); } - 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_StructHybridSetup(struct_solver, sA, sb, sx); hypre_EndTiming(time_index); @@ -5816,7 +6890,7 @@ main( hypre_int argc, hypre_ClearTiming(); HYPRE_StructHybridGetNumIterations(struct_solver, &num_iterations); - HYPRE_StructHybridGetFinalRelativeResidualNorm(struct_solver, &final_res_norm); + HYPRE_StructHybridGetFinalRelativeResidualNorm(struct_solver, final_res_norm_ptr); HYPRE_StructHybridDestroy(struct_solver); if (solver_id == 220) @@ -5827,27 +6901,24 @@ main( hypre_int argc, { 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)) + else if ((solver_id > 229) && (solver_id < 240)) { time_index = hypre_InitializeTiming("GMRES 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_GMRESSetKDim( (HYPRE_Solver) struct_solver, k_dim ); + HYPRE_GMRESSetMaxIter( (HYPRE_Solver) struct_solver, max_iterations ); + HYPRE_GMRESSetTol( (HYPRE_Solver) struct_solver, tol ); + HYPRE_GMRESSetRelChange( (HYPRE_Solver) struct_solver, rel_change ); + HYPRE_GMRESSetPrintLevel( (HYPRE_Solver) struct_solver, solver_print_level ); + HYPRE_GMRESSetLogging( (HYPRE_Solver) struct_solver, 1 ); if (solver_id == 230) { @@ -5871,11 +6942,12 @@ main( hypre_int argc, { /* use symmetric PFMG as preconditioner */ HYPRE_StructPFMGCreate(comm, &struct_precond); + HYPRE_StructPFMGSetMaxLevels(struct_precond, max_levels); 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); + HYPRE_StructPFMGSetRelaxType(struct_precond, relax[0]); if (usr_jacobi_weight) { HYPRE_StructPFMGSetJacobiWeight(struct_precond, jacobi_weight); @@ -5891,28 +6963,6 @@ main( hypre_int argc, (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSetup, (HYPRE_Solver)struct_precond); } - 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 == 237) { @@ -5959,7 +7009,7 @@ main( hypre_int argc, hypre_ClearTiming(); HYPRE_GMRESGetNumIterations( (HYPRE_Solver)struct_solver, &num_iterations); - HYPRE_GMRESGetFinalRelativeResidualNorm( (HYPRE_Solver)struct_solver, &final_res_norm); + HYPRE_GMRESGetFinalRelativeResidualNorm( (HYPRE_Solver)struct_solver, final_res_norm_ptr); HYPRE_StructGMRESDestroy(struct_solver); if (solver_id == 230) @@ -5970,26 +7020,23 @@ main( hypre_int argc, { HYPRE_StructPFMGDestroy(struct_precond); } - else if (solver_id == 232) - { - HYPRE_StructSparseMSGDestroy(struct_precond); - } else if (solver_id == 237) { HYPRE_StructJacobiDestroy(struct_precond); } } + /*----------------------------------------------------------- * Solve the system using BiCGTAB *-----------------------------------------------------------*/ - if ((solver_id > 239) && (solver_id < 250)) + else if ((solver_id > 239) && (solver_id < 250)) { time_index = hypre_InitializeTiming("BiCGSTAB Setup"); hypre_BeginTiming(time_index); HYPRE_StructBiCGSTABCreate(comm, &struct_solver); - HYPRE_BiCGSTABSetMaxIter( (HYPRE_Solver)struct_solver, 100 ); + HYPRE_BiCGSTABSetMaxIter( (HYPRE_Solver)struct_solver, max_iterations ); HYPRE_BiCGSTABSetTol( (HYPRE_Solver)struct_solver, tol ); HYPRE_BiCGSTABSetPrintLevel( (HYPRE_Solver)struct_solver, solver_print_level ); HYPRE_BiCGSTABSetLogging( (HYPRE_Solver)struct_solver, 1 ); @@ -6016,11 +7063,12 @@ main( hypre_int argc, { /* use symmetric PFMG as preconditioner */ HYPRE_StructPFMGCreate(comm, &struct_precond); + HYPRE_StructPFMGSetMaxLevels(struct_precond, max_levels); 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); + HYPRE_StructPFMGSetRelaxType(struct_precond, relax[0]); if (usr_jacobi_weight) { HYPRE_StructPFMGSetJacobiWeight(struct_precond, jacobi_weight); @@ -6037,29 +7085,6 @@ main( hypre_int argc, (HYPRE_Solver)struct_precond); } - 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 */ @@ -6105,7 +7130,8 @@ main( hypre_int argc, hypre_ClearTiming(); HYPRE_BiCGSTABGetNumIterations( (HYPRE_Solver)struct_solver, &num_iterations); - HYPRE_BiCGSTABGetFinalRelativeResidualNorm( (HYPRE_Solver)struct_solver, &final_res_norm); + HYPRE_BiCGSTABGetFinalRelativeResidualNorm( (HYPRE_Solver)struct_solver, + final_res_norm_ptr); HYPRE_StructBiCGSTABDestroy(struct_solver); if (solver_id == 240) @@ -6116,33 +7142,475 @@ main( hypre_int argc, { HYPRE_StructPFMGDestroy(struct_precond); } - else if (solver_id == 242) - { - HYPRE_StructSparseMSGDestroy(struct_precond); - } else if (solver_id == 247) { HYPRE_StructJacobiDestroy(struct_precond); } } + /* begin lobpcg */ + + /*----------------------------------------------------------- + * Solve the eigenvalue problem using LOBPCG + *-----------------------------------------------------------*/ + + else if (lobpcgFlag) + { + if (solver_id < 10 || solver_id >= 20) + { + if (verbosity) + { + hypre_printf("\nLOBPCG works with solvers 10, 11, 13, 14 and 18 only\n"); + } + } + else + { + interpreter = hypre_CTAlloc(mv_InterfaceInterpreter, 1, HYPRE_MEMORY_HOST); + HYPRE_SStructSetupInterpreter(interpreter); + HYPRE_SStructSetupMatvec(&matvec_fn); + + eigenvectors = mv_MultiVectorCreateFromSampleVector(interpreter, + blockSize, + x); + eigenvalues = hypre_CTAlloc(HYPRE_Real, blockSize, HYPRE_MEMORY_HOST); + if (seed) + { + mv_MultiVectorSetRandom(eigenvectors, seed); + } + else + { + mv_MultiVectorSetRandom(eigenvectors, (HYPRE_Int) time(0)); + } + + if (myid != 0) + { + 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, rel_change); + HYPRE_PCGSetPrintLevel((HYPRE_Solver) solver, solver_print_level); + HYPRE_PCGSetLogging((HYPRE_Solver) solver, 1); + + 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); + HYPRE_SStructSplitSetPrintLevel(precond, prec_print_level); + HYPRE_SStructSplitSetLogging(precond, 0); + 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(comm, &precond); + HYPRE_SStructSysPFMGSetMaxIter(precond, 1); + HYPRE_SStructSysPFMGSetTol(precond, 0.0); + HYPRE_SStructSysPFMGSetZeroGuess(precond); + /* weighted Jacobi = 1; red-black GS = 2 */ + HYPRE_SStructSysPFMGSetRelaxType(precond, relax[0]); + HYPRE_SStructSysPFMGSetNumPreRelax(precond, n_pre); + HYPRE_SStructSysPFMGSetNumPostRelax(precond, n_post); + HYPRE_SStructSysPFMGSetSkipRelax(precond, skip); + /*HYPRE_SStructSysPFMGSetDxyz(precond, dxyz);*/ + HYPRE_SStructSysPFMGSetPrintLevel(precond, prec_print_level); + HYPRE_SStructSysPFMGSetLogging(precond, 0); + + HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSysPFMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSysPFMGSetup, + (HYPRE_Solver) precond); + } + else if (solver_id == 14) + { + /* use SSAMG solver as preconditioner */ + HYPRE_SStructSSAMGCreate(comm, &precond); + HYPRE_SStructSSAMGSetMaxIter(precond, 1); + HYPRE_SStructSSAMGSetMaxLevels(precond, max_levels); + HYPRE_SStructSSAMGSetTol(precond, 0.0); + HYPRE_SStructSSAMGSetZeroGuess(precond); + HYPRE_SStructSSAMGSetSkipRelax(precond, skip); + HYPRE_SStructSSAMGSetInterpType(precond, interp_type); + HYPRE_SStructSSAMGSetRelaxType(precond, relax[0]); + HYPRE_SStructSSAMGSetNonGalerkinRAP(precond, rap); + if (usr_jacobi_weight) + { + HYPRE_SStructSSAMGSetRelaxWeight(precond, jacobi_weight); + } + HYPRE_SStructSSAMGSetNumPreRelax(precond, n_pre); + HYPRE_SStructSSAMGSetNumPostRelax(precond, n_post); + HYPRE_SStructSSAMGSetNumCoarseRelax(precond, n_coarse); + HYPRE_SStructSSAMGSetMaxCoarseSize(precond, max_coarse_size); + HYPRE_SStructSSAMGSetCoarseSolverType(precond, csolver_type); + HYPRE_SStructSSAMGSetPrintLevel(precond, prec_print_level); + HYPRE_SStructSSAMGSetLogging(precond, 0); + + HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSSAMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSSAMGSetup, + (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); + } + else if (solver_id != NO_SOLVER ) + { + if (verbosity) + { + hypre_printf("Solver ID not recognized. "); + hypre_printf("Running inner PCG iterations without preconditioner\n\n"); + } + } + + hypre_EndTiming(time_index); + 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, max_iterations); + 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); + + time_index = hypre_InitializeTiming("PCG Solve"); + hypre_BeginTiming(time_index); + + HYPRE_LOBPCGSolve((HYPRE_Solver)lobpcg_solver, constrains, + eigenvectors, eigenvalues ); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + HYPRE_SStructPCGDestroy(solver); + + if ((solver_id == 10) || (solver_id == 11)) + { + HYPRE_SStructSplitDestroy(precond); + } + else if (solver_id == 13) + { + HYPRE_SStructSysPFMGDestroy(precond); + } + else if (solver_id == 14) + { + HYPRE_SStructSSAMGDestroy(precond); + } + + HYPRE_LOBPCGDestroy((HYPRE_Solver)lobpcg_solver); + } + else + { + time_index = hypre_InitializeTiming("LOBPCG Setup"); + hypre_BeginTiming(time_index); + + HYPRE_LOBPCGCreate(interpreter, &matvec_fn, (HYPRE_Solver*)&solver); + HYPRE_LOBPCGSetMaxIter( (HYPRE_Solver) solver, max_iterations ); + 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); + HYPRE_SStructSplitSetPrintLevel(precond, prec_print_level); + HYPRE_SStructSplitSetLogging(precond, 0); + 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); + } + 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_SStructSysPFMGSetDxyz(precond, dxyz);*/ + HYPRE_SStructSysPFMGSetPrintLevel(precond, prec_print_level); + HYPRE_SStructSysPFMGSetLogging(precond, 0); + + HYPRE_LOBPCGSetPrecond( (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSysPFMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSysPFMGSetup, + (HYPRE_Solver) precond); + } + else if (solver_id == 14) + { + /* use SSAMG solver as preconditioner */ + HYPRE_SStructSSAMGCreate(comm, &precond); + HYPRE_SStructSSAMGSetMaxIter(precond, 1); + HYPRE_SStructSSAMGSetMaxLevels(precond, max_levels); + HYPRE_SStructSSAMGSetTol(precond, 0.0); + HYPRE_SStructSSAMGSetZeroGuess(precond); + HYPRE_SStructSSAMGSetSkipRelax(precond, skip); + HYPRE_SStructSSAMGSetInterpType(precond, interp_type); + HYPRE_SStructSSAMGSetRelaxType(precond, relax[0]); + HYPRE_SStructSSAMGSetNonGalerkinRAP(precond, rap); + if (usr_jacobi_weight) + { + HYPRE_SStructSSAMGSetRelaxWeight(precond, jacobi_weight); + } + HYPRE_SStructSSAMGSetNumPreRelax(precond, n_pre); + HYPRE_SStructSSAMGSetNumPostRelax(precond, n_post); + HYPRE_SStructSSAMGSetNumCoarseRelax(precond, n_coarse); + HYPRE_SStructSSAMGSetMaxCoarseSize(precond, max_coarse_size); + HYPRE_SStructSSAMGSetCoarseSolverType(precond, csolver_type); + HYPRE_SStructSSAMGSetPrintLevel(precond, prec_print_level); + HYPRE_SStructSSAMGSetLogging(precond, 0); + + HYPRE_LOBPCGSetPrecond((HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSSAMGSolve, + (HYPRE_PtrToSolverFcn) HYPRE_SStructSSAMGSetup, + (HYPRE_Solver) precond); + } + 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. "); + hypre_printf("Running inner PCG iterations without preconditioner\n\n"); + } + } + + HYPRE_LOBPCGSetup((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("LOBPCG Solve"); + hypre_BeginTiming(time_index); + + HYPRE_LOBPCGSolve((HYPRE_Solver) solver, constrains, + eigenvectors, eigenvalues ); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + HYPRE_LOBPCGDestroy((HYPRE_Solver)solver); + + if ((solver_id == 10) || (solver_id == 11)) + { + HYPRE_SStructSplitDestroy(precond); + } + else if (solver_id == 13) + { + HYPRE_SStructSysPFMGDestroy(precond); + } + else if (solver_id == 14) + { + HYPRE_SStructSSAMGDestroy(precond); + } + } + + 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 (solver_print_level) + { + 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 (solver_print_level > 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); + } + } + + mv_MultiVectorDestroy(eigenvectors); + hypre_TFree(eigenvalues, HYPRE_MEMORY_HOST); + hypre_TFree(interpreter, HYPRE_MEMORY_HOST); + } + } + + /* end lobpcg */ + + /*----------------------------------------------------------- + * Test matvec + *-----------------------------------------------------------*/ + + else if (solver_id < 0) + { + void *matvec_data; + + hypre_SStructMatvecCreate(&matvec_data); + hypre_SStructMatvecSetup(matvec_data, A, x); + + time_index = hypre_InitializeTiming("Matvec"); + hypre_BeginTiming(time_index); + + for (i = 0; i < reps; i++) + { + hypre_SStructMatvecCompute(matvec_data, -1.0, A, x, 1.0, b, r); + } + reps = 1; // Trigger exit in the outer loop + + hypre_EndTiming(time_index); + hypre_PrintTiming("Total Matvec time", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + hypre_SStructMatvecDestroy(matvec_data); + } + /*----------------------------------------------------------- * Gather the solution vector *-----------------------------------------------------------*/ HYPRE_SStructVectorGather(x); + /*----------------------------------------------------------- + * Compute real residual + *-----------------------------------------------------------*/ + + if (final_res || print_system) + { + HYPRE_SStructVectorCopy(b, r); + HYPRE_SStructMatrixMatvec(-1.0, A, x, 1.0, r); + HYPRE_SStructVectorInnerProd(r, r, tmp_norm_ptr); + hypre_MuPDataCopyFromMP(&real_res_norm, tmp_norm_ptr, 1); + real_res_norm = hypre_sqrt(real_res_norm); + if (rhs_norm > 0) + { + real_res_norm = real_res_norm / rhs_norm; + } + } + /*----------------------------------------------------------- * Print the solution and other info *-----------------------------------------------------------*/ + hypre_MuPDataCopyFromMP(&final_res_norm, final_res_norm_ptr, 1); + if (print_system) { + HYPRE_SStructVectorPrint("sstruct.out.x", x, 0); + HYPRE_SStructVectorPrint("sstruct.out.r", r, 0); +#if 0 FILE *file; char filename[255]; - HYPRE_SStructVectorPrint("sstruct.out.x", x, 0); - /* print out with shared data replicated */ if (!read_fromfile_flag) { @@ -6157,7 +7625,7 @@ main( hypre_int argc, if ((file = fopen(filename, "w")) == NULL) { hypre_printf("Error: can't open output file %s\n", filename); - exit(1); + hypre_MPI_Abort(comm, 1); } for (box = 0; box < pdata.nboxes; box++) { @@ -6185,16 +7653,28 @@ main( hypre_int argc, hypre_TFree(values, HYPRE_MEMORY_HOST); hypre_TFree(d_values, memory_location); } +#endif } - if (myid == 0 && rep == repeats - 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); hypre_printf("Final Relative Residual Norm = %e\n", final_res_norm); + if (final_res) + { + hypre_printf("Real Relative Residual Norm = %e\n", real_res_norm); + } hypre_printf("\n"); } + if (vis) + { + HYPRE_SStructGridPrintGLVis(grid, "sstruct.msh", NULL, NULL); + HYPRE_SStructVectorPrintGLVis(b, "sstruct.rhs"); + HYPRE_SStructVectorPrintGLVis(x, "sstruct.sol"); + } + /*----------------------------------------------------------- * Verify GetBoxValues() *-----------------------------------------------------------*/ @@ -6211,7 +7691,7 @@ main( hypre_int argc, HYPRE_SStructVectorInitialize(xnew); /* get/set replicated shared data */ - values = hypre_TAlloc(HYPRE_Real, data.max_boxsize, HYPRE_MEMORY_HOST); + values = hypre_TAlloc(HYPRE_Real, data.max_boxsize, HYPRE_MEMORY_HOST); for (part = 0; part < data.nparts; part++) { pdata = data.pdata[part]; @@ -6235,23 +7715,23 @@ main( hypre_int argc, /* 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); + HYPRE_SStructVectorInnerProd(b, b, &bnorm); + HYPRE_SStructMatrixMatvec(-1.0, A, xnew, 1.0, b); + HYPRE_SStructVectorInnerProd(b, b, &rnorm); } else if (object_type == HYPRE_PARCSR) { - bnorm = hypre_ParVectorInnerProd(par_b, par_b); + HYPRE_ParVectorInnerProd(par_b, par_b, &bnorm); 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); + HYPRE_ParVectorInnerProd(par_b, par_b, &rnorm); } else if (object_type == HYPRE_STRUCT) { - bnorm = hypre_StructInnerProd(sb, sb); + HYPRE_StructVectorInnerProd(sb, sb, &bnorm); HYPRE_SStructVectorGetObject(xnew, (void **) &sxnew); - hypre_StructMatvec(-1.0, sA, sxnew, 1.0, sb); - rnorm = hypre_StructInnerProd(sb, sb); + HYPRE_StructMatrixMatvec(-1.0, sA, sxnew, 1.0, sb); + HYPRE_StructVectorInnerProd(sb, sb, &rnorm); } bnorm = hypre_sqrt(bnorm); rnorm = hypre_sqrt(rnorm); @@ -6276,6 +7756,8 @@ main( hypre_int argc, HYPRE_SStructMatrixDestroy(A); HYPRE_SStructVectorDestroy(b); HYPRE_SStructVectorDestroy(x); + HYPRE_SStructVectorDestroy(r); + if (gradient_matrix) { for (s = 0; s < data.ndim; s++) @@ -6287,6 +7769,10 @@ main( hypre_int argc, HYPRE_SStructGridDestroy(G_grid); HYPRE_SStructMatrixDestroy(G); } + if ((print_system || check_symmetry) && (object_type == HYPRE_SSTRUCT)) + { + HYPRE_IJMatrixDestroy(ij_A); + } if (!read_fromfile_flag) { @@ -6300,19 +7786,21 @@ main( hypre_int argc, hypre_TFree(stencils, HYPRE_MEMORY_HOST); DestroyData(data); - if (rep == repeats - 1) + if (rep == reps - 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) + if (rep < reps - 1) { - ReadData(infile, &global_data); + ReadData(comm, infile, &global_data); } } /*hypre_FinalizeMemoryDebug(); */ + + HYPRE_ANNOTATE_REGION_END("%s-%d", "Run", rep); } /* Finalize Hypre */ @@ -6324,7 +7812,8 @@ main( hypre_int argc, #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]) + 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); diff --git a/src/test/sstruct_fac.c b/src/test/sstruct_fac.c deleted file mode 100644 index 6eb0ca287d..0000000000 --- a/src/test/sstruct_fac.c +++ /dev/null @@ -1,2268 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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 -#include -#include - -#include "_hypre_utilities.h" -#include "HYPRE_sstruct_ls.h" -#include "HYPRE_krylov.h" -#include "_hypre_sstruct_mv.h" -#include "_hypre_sstruct_ls.h" - -#define DEBUG 0 - -#if DEBUG -#include "_hypre_sstruct_mv.h" -#endif - -/*-------------------------------------------------------------------------- - * Data structures - *--------------------------------------------------------------------------*/ - -char infile_default[50] = "sstruct_default.in"; - -typedef HYPRE_Int Index[HYPRE_MAXDIM]; -typedef HYPRE_Int ProblemIndex[9]; /* last 3 digits are shifts */ - -typedef struct -{ - /* for GridSetExtents */ - HYPRE_Int nboxes; - ProblemIndex *ilowers; - ProblemIndex *iuppers; - HYPRE_Int *boxsizes; - HYPRE_Int max_boxsize; - - /* for GridSetVariables */ - HYPRE_Int nvars; - HYPRE_SStructVariable *vartypes; - - /* for GridAddVariables */ - HYPRE_Int add_nvars; - ProblemIndex *add_indexes; - HYPRE_SStructVariable *add_vartypes; - - /* for GridSetNeighborBox */ - HYPRE_Int glue_nboxes; - ProblemIndex *glue_ilowers; - ProblemIndex *glue_iuppers; - HYPRE_Int *glue_nbor_parts; - ProblemIndex *glue_nbor_ilowers; - ProblemIndex *glue_nbor_iuppers; - Index *glue_index_maps; - - /* for GraphSetStencil */ - HYPRE_Int *stencil_num; - - HYPRE_Int matrix_nentries; - ProblemIndex *matrix_ilowers; - ProblemIndex *matrix_iuppers; - Index *matrix_strides; - HYPRE_Int *matrix_vars; - HYPRE_Int *matrix_entries; - HYPRE_Real *matrix_values; - - Index periodic; - - /* for GraphAddEntries */ - HYPRE_Int graph_nentries; - ProblemIndex *graph_ilowers; - ProblemIndex *graph_iuppers; - Index *graph_strides; - HYPRE_Int *graph_vars; - HYPRE_Int *graph_to_parts; - ProblemIndex *graph_to_ilowers; - ProblemIndex *graph_to_iuppers; - Index *graph_to_strides; - HYPRE_Int *graph_to_vars; - Index *graph_index_maps; - Index *graph_index_signs; - HYPRE_Int *graph_entries; - HYPRE_Real *graph_values; - HYPRE_Int *graph_boxsizes; - - HYPRE_Real **graph_fine_to_coarse_data; - HYPRE_Real **graph_coarse_to_fine_data; - - /* for amr structure */ - HYPRE_Int fac_plevel; - Index fac_prefinement; - -} ProblemPartData; - -typedef struct -{ - HYPRE_Int ndim; - HYPRE_Int nparts; - ProblemPartData *pdata; - HYPRE_Int max_boxsize; - - HYPRE_Int nstencils; - HYPRE_Int *stencil_sizes; - Index **stencil_offsets; - HYPRE_Int **stencil_vars; - HYPRE_Real **stencil_values; - - HYPRE_Int npools; - HYPRE_Int *pools; /* array of size nparts */ - -} ProblemData; - -/*-------------------------------------------------------------------------- - * Compute new box based on variable type - *--------------------------------------------------------------------------*/ - -HYPRE_Int -GetVariableBox( Index cell_ilower, - Index cell_iupper, - HYPRE_Int vartype, - Index var_ilower, - Index var_iupper ) -{ - HYPRE_Int ierr = 0; - - var_ilower[0] = cell_ilower[0]; - var_ilower[1] = cell_ilower[1]; - var_ilower[2] = cell_ilower[2]; - var_iupper[0] = cell_iupper[0]; - var_iupper[1] = cell_iupper[1]; - var_iupper[2] = cell_iupper[2]; - - switch (vartype) - { - case HYPRE_SSTRUCT_VARIABLE_CELL: - 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; - case HYPRE_SSTRUCT_VARIABLE_XFACE: - 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; - case HYPRE_SSTRUCT_VARIABLE_ZFACE: - 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; - case HYPRE_SSTRUCT_VARIABLE_YEDGE: - 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; - case HYPRE_SSTRUCT_VARIABLE_UNDEFINED: - break; - } - - return ierr; -} - -/*-------------------------------------------------------------------------- - * Read routines - *--------------------------------------------------------------------------*/ - -HYPRE_Int -SScanIntArray( char *sdata_ptr, - char **sdata_ptr_ptr, - HYPRE_Int size, - HYPRE_Int *array ) -{ - HYPRE_Int i; - - sdata_ptr += strspn(sdata_ptr, " \t\n["); - for (i = 0; i < size; i++) - { - array[i] = strtol(sdata_ptr, &sdata_ptr, 10); - } - sdata_ptr += strcspn(sdata_ptr, "]") + 1; - - *sdata_ptr_ptr = sdata_ptr; - return 0; -} - -HYPRE_Int -SScanProblemIndex( char *sdata_ptr, - char **sdata_ptr_ptr, - HYPRE_Int ndim, - ProblemIndex index ) -{ - HYPRE_Int i; - char sign[3]; - - /* initialize index array */ - for (i = 0; i < 9; i++) - { - index[i] = 0; - } - - sdata_ptr += strspn(sdata_ptr, " \t\n("); - switch (ndim) - { - case 1: - 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; - - 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; - } - sdata_ptr += strcspn(sdata_ptr, ":)"); - if ( *sdata_ptr == ':' ) - { - /* read in optional shift */ - sdata_ptr += 1; - switch (ndim) - { - case 1: - hypre_sscanf(sdata_ptr, "%d", &index[6]); - break; - - case 2: - hypre_sscanf(sdata_ptr, "%d%d", &index[6], &index[7]); - break; - - case 3: - hypre_sscanf(sdata_ptr, "%d%d%d", &index[6], &index[7], &index[8]); - break; - } - /* pre-shift the index */ - for (i = 0; i < ndim; i++) - { - index[i] += index[i + 6]; - } - } - sdata_ptr += strcspn(sdata_ptr, ")") + 1; - - for (i = 0; i < ndim; i++) - { - if (sign[i] == '+') - { - index[i + 3] = 1; - } - } - - *sdata_ptr_ptr = sdata_ptr; - return 0; -} - -HYPRE_Int -ReadData( char *filename, - ProblemData *data_ptr ) -{ - ProblemData data; - ProblemPartData pdata; - - HYPRE_Int myid; - FILE *file; - - char *sdata = NULL; - char *sdata_line; - char *sdata_ptr; - HYPRE_Int sdata_size; - HYPRE_Int size; - HYPRE_Int memchunk = 10000; - HYPRE_Int maxline = 250; - - char key[250]; - - HYPRE_Int part, var, entry, s, i; - - /*----------------------------------------------------------- - * Read data file from process 0, then broadcast - *-----------------------------------------------------------*/ - - hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &myid); - - if (myid == 0) - { - if ((file = fopen(filename, "r")) == NULL) - { - hypre_printf("Error: can't open input file %s\n", filename); - exit(1); - } - - /* allocate initial space, and read first input line */ - sdata_size = 0; - sdata = hypre_TAlloc(char, memchunk, HYPRE_MEMORY_HOST); - sdata_line = fgets(sdata, maxline, file); - - s = memchunk; - while (sdata_line != NULL) - { - sdata_size += strlen(sdata_line) + 1; - - /* allocate more space, if necessary */ - if ((sdata_size + maxline) > s) - { - sdata = hypre_TReAlloc(sdata, char, (sdata_size + memchunk), HYPRE_MEMORY_HOST); - s = sdata_size + memchunk; - } - - /* read the next input line */ - sdata_line = fgets((sdata + sdata_size), maxline, file); - } - } - - /* broadcast the data size */ - hypre_MPI_Bcast(&sdata_size, 1, HYPRE_MPI_INT, 0, hypre_MPI_COMM_WORLD); - - /* broadcast the data */ - sdata = hypre_TReAlloc(sdata, char, sdata_size, HYPRE_MEMORY_HOST); - hypre_MPI_Bcast(sdata, sdata_size, hypre_MPI_CHAR, 0, hypre_MPI_COMM_WORLD); - - /*----------------------------------------------------------- - * Parse the data and fill ProblemData structure - *-----------------------------------------------------------*/ - - sdata_line = sdata; - 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"); - - if ( strcmp(key, "GridCreate:") == 0 ) - { - data.ndim = strtol(sdata_ptr, &sdata_ptr, 10); - data.nparts = strtol(sdata_ptr, &sdata_ptr, 10); - data.pdata = hypre_CTAlloc(ProblemPartData, data.nparts, HYPRE_MEMORY_HOST); - } - else if ( strcmp(key, "GridSetExtents:") == 0 ) - { - part = strtol(sdata_ptr, &sdata_ptr, 10); - pdata = data.pdata[part]; - if ((pdata.nboxes % 10) == 0) - { - size = pdata.nboxes + 10; - pdata.ilowers = - hypre_TReAlloc(pdata.ilowers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.iuppers = - hypre_TReAlloc(pdata.iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.boxsizes = - hypre_TReAlloc(pdata.boxsizes, HYPRE_Int, size, HYPRE_MEMORY_HOST); - } - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.ilowers[pdata.nboxes]); - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.iuppers[pdata.nboxes]); - if ( (pdata.ilowers[pdata.nboxes][3]* - pdata.ilowers[pdata.nboxes][4]* - pdata.ilowers[pdata.nboxes][5] != 0) || - (pdata.iuppers[pdata.nboxes][3]* - pdata.iuppers[pdata.nboxes][4]* - pdata.iuppers[pdata.nboxes][5] != 1) ) - { - hypre_printf("Error: Invalid use of `+-' in GridSetExtents\n"); - exit(1); - } - pdata.boxsizes[pdata.nboxes] = 1; - for (i = 0; i < 3; i++) - { - pdata.boxsizes[pdata.nboxes] *= - (pdata.iuppers[pdata.nboxes][i] - - pdata.ilowers[pdata.nboxes][i] + 2); - } - pdata.max_boxsize = - hypre_max(pdata.max_boxsize, pdata.boxsizes[pdata.nboxes]); - pdata.nboxes++; - data.pdata[part] = pdata; - } - else if ( strcmp(key, "GridSetVariables:") == 0 ) - { - part = strtol(sdata_ptr, &sdata_ptr, 10); - pdata = data.pdata[part]; - pdata.nvars = strtol(sdata_ptr, &sdata_ptr, 10); - pdata.vartypes = hypre_CTAlloc(HYPRE_SStructVariable, pdata.nvars, HYPRE_MEMORY_HOST); - SScanIntArray(sdata_ptr, &sdata_ptr, - pdata.nvars, pdata.vartypes); - data.pdata[part] = pdata; - } - else if ( strcmp(key, "GridAddVariables:") == 0 ) - { - /* TODO */ - hypre_printf("GridAddVariables not yet implemented!\n"); - exit(1); - } - else if ( strcmp(key, "GridSetNeighborBox:") == 0 ) - { - part = strtol(sdata_ptr, &sdata_ptr, 10); - pdata = data.pdata[part]; - if ((pdata.glue_nboxes % 10) == 0) - { - size = pdata.glue_nboxes + 10; - pdata.glue_ilowers = - hypre_TReAlloc(pdata.glue_ilowers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.glue_iuppers = - hypre_TReAlloc(pdata.glue_iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.glue_nbor_parts = - hypre_TReAlloc(pdata.glue_nbor_parts, HYPRE_Int, size, HYPRE_MEMORY_HOST); - pdata.glue_nbor_ilowers = - hypre_TReAlloc(pdata.glue_nbor_ilowers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.glue_nbor_iuppers = - hypre_TReAlloc(pdata.glue_nbor_iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.glue_index_maps = - hypre_TReAlloc(pdata.glue_index_maps, Index, size, HYPRE_MEMORY_HOST); - } - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.glue_ilowers[pdata.glue_nboxes]); - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.glue_iuppers[pdata.glue_nboxes]); - pdata.glue_nbor_parts[pdata.glue_nboxes] = - strtol(sdata_ptr, &sdata_ptr, 10); - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.glue_nbor_ilowers[pdata.glue_nboxes]); - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.glue_nbor_iuppers[pdata.glue_nboxes]); - SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, - pdata.glue_index_maps[pdata.glue_nboxes]); - pdata.glue_nboxes++; - data.pdata[part] = pdata; - } - else if ( strcmp(key, "GridSetPeriodic:") == 0 ) - { - part = strtol(sdata_ptr, &sdata_ptr, 10); - pdata = data.pdata[part]; - SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, pdata.periodic); - data.pdata[part] = pdata; - } - else if ( strcmp(key, "StencilCreate:") == 0 ) - { - data.nstencils = strtol(sdata_ptr, &sdata_ptr, 10); - data.stencil_sizes = hypre_CTAlloc(HYPRE_Int, data.nstencils, HYPRE_MEMORY_HOST); - data.stencil_offsets = hypre_CTAlloc(Index *, data.nstencils, HYPRE_MEMORY_HOST); - data.stencil_vars = hypre_CTAlloc(HYPRE_Int *, data.nstencils, HYPRE_MEMORY_HOST); - data.stencil_values = hypre_CTAlloc(HYPRE_Real *, data.nstencils, HYPRE_MEMORY_HOST); - SScanIntArray(sdata_ptr, &sdata_ptr, - data.nstencils, data.stencil_sizes); - for (s = 0; s < data.nstencils; s++) - { - data.stencil_offsets[s] = - hypre_CTAlloc(Index, data.stencil_sizes[s], HYPRE_MEMORY_HOST); - data.stencil_vars[s] = - hypre_CTAlloc(HYPRE_Int, data.stencil_sizes[s], HYPRE_MEMORY_HOST); - data.stencil_values[s] = - hypre_CTAlloc(HYPRE_Real, data.stencil_sizes[s], HYPRE_MEMORY_HOST); - } - } - else if ( strcmp(key, "StencilSetEntry:") == 0 ) - { - s = strtol(sdata_ptr, &sdata_ptr, 10); - entry = strtol(sdata_ptr, &sdata_ptr, 10); - 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] = (HYPRE_Real)strtod(sdata_ptr, &sdata_ptr); - } - else if ( strcmp(key, "GraphSetStencil:") == 0 ) - { - part = strtol(sdata_ptr, &sdata_ptr, 10); - var = strtol(sdata_ptr, &sdata_ptr, 10); - s = strtol(sdata_ptr, &sdata_ptr, 10); - pdata = data.pdata[part]; - if (pdata.stencil_num == NULL) - { - pdata.stencil_num = hypre_CTAlloc(HYPRE_Int, pdata.nvars, HYPRE_MEMORY_HOST); - } - pdata.stencil_num[var] = s; - data.pdata[part] = pdata; - } - else if ( strcmp(key, "GraphAddEntries:") == 0 ) - { - part = strtol(sdata_ptr, &sdata_ptr, 10); - pdata = data.pdata[part]; - if ((pdata.graph_nentries % 10) == 0) - { - size = pdata.graph_nentries + 10; - pdata.graph_ilowers = - hypre_TReAlloc(pdata.graph_ilowers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.graph_iuppers = - hypre_TReAlloc(pdata.graph_iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.graph_strides = - hypre_TReAlloc(pdata.graph_strides, Index, size, HYPRE_MEMORY_HOST); - pdata.graph_vars = - hypre_TReAlloc(pdata.graph_vars, HYPRE_Int, size, HYPRE_MEMORY_HOST); - pdata.graph_to_parts = - hypre_TReAlloc(pdata.graph_to_parts, HYPRE_Int, size, HYPRE_MEMORY_HOST); - pdata.graph_to_ilowers = - hypre_TReAlloc(pdata.graph_to_ilowers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.graph_to_iuppers = - hypre_TReAlloc(pdata.graph_to_iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.graph_to_strides = - hypre_TReAlloc(pdata.graph_to_strides, Index, size, HYPRE_MEMORY_HOST); - pdata.graph_to_vars = - hypre_TReAlloc(pdata.graph_to_vars, HYPRE_Int, size, HYPRE_MEMORY_HOST); - pdata.graph_index_maps = - hypre_TReAlloc(pdata.graph_index_maps, Index, size, HYPRE_MEMORY_HOST); - pdata.graph_index_signs = - hypre_TReAlloc(pdata.graph_index_signs, Index, size, HYPRE_MEMORY_HOST); - pdata.graph_entries = - hypre_TReAlloc(pdata.graph_entries, HYPRE_Int, size, HYPRE_MEMORY_HOST); - pdata.graph_values = - hypre_TReAlloc(pdata.graph_values, HYPRE_Real, size, HYPRE_MEMORY_HOST); - pdata.graph_boxsizes = - hypre_TReAlloc(pdata.graph_boxsizes, HYPRE_Int, size, HYPRE_MEMORY_HOST); - } - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.graph_ilowers[pdata.graph_nentries]); - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.graph_iuppers[pdata.graph_nentries]); - SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, - pdata.graph_strides[pdata.graph_nentries]); - for (i = data.ndim; i < 3; i++) - { - pdata.graph_strides[pdata.graph_nentries][i] = 1; - } - pdata.graph_vars[pdata.graph_nentries] = - strtol(sdata_ptr, &sdata_ptr, 10); - pdata.graph_to_parts[pdata.graph_nentries] = - strtol(sdata_ptr, &sdata_ptr, 10); - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.graph_to_ilowers[pdata.graph_nentries]); - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.graph_to_iuppers[pdata.graph_nentries]); - SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, - pdata.graph_to_strides[pdata.graph_nentries]); - for (i = data.ndim; i < 3; i++) - { - pdata.graph_to_strides[pdata.graph_nentries][i] = 1; - } - pdata.graph_to_vars[pdata.graph_nentries] = - strtol(sdata_ptr, &sdata_ptr, 10); - SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, - pdata.graph_index_maps[pdata.graph_nentries]); - for (i = data.ndim; i < 3; i++) - { - pdata.graph_index_maps[pdata.graph_nentries][i] = i; - } - for (i = 0; i < 3; i++) - { - pdata.graph_index_signs[pdata.graph_nentries][i] = 1; - if ( pdata.graph_to_iuppers[pdata.graph_nentries][i] < - pdata.graph_to_ilowers[pdata.graph_nentries][i] ) - { - pdata.graph_index_signs[pdata.graph_nentries][i] = -1; - } - } - pdata.graph_entries[pdata.graph_nentries] = - strtol(sdata_ptr, &sdata_ptr, 10); - pdata.graph_values[pdata.graph_nentries] = - (HYPRE_Real)strtod(sdata_ptr, &sdata_ptr); - pdata.graph_boxsizes[pdata.graph_nentries] = 1; - for (i = 0; i < 3; i++) - { - pdata.graph_boxsizes[pdata.graph_nentries] *= - (pdata.graph_iuppers[pdata.graph_nentries][i] - - pdata.graph_ilowers[pdata.graph_nentries][i] + 1); - } - pdata.graph_nentries++; - data.pdata[part] = pdata; - } - else if ( strcmp(key, "MatrixSetValues:") == 0 ) - { - part = strtol(sdata_ptr, &sdata_ptr, 10); - pdata = data.pdata[part]; - if ((pdata.matrix_nentries % 10) == 0) - { - size = pdata.matrix_nentries + 10; - pdata.matrix_ilowers = - hypre_TReAlloc(pdata.matrix_ilowers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.matrix_iuppers = - hypre_TReAlloc(pdata.matrix_iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); - pdata.matrix_strides = - hypre_TReAlloc(pdata.matrix_strides, Index, size, HYPRE_MEMORY_HOST); - pdata.matrix_vars = - hypre_TReAlloc(pdata.matrix_vars, HYPRE_Int, size, HYPRE_MEMORY_HOST); - pdata.matrix_entries = - hypre_TReAlloc(pdata.matrix_entries, HYPRE_Int, size, HYPRE_MEMORY_HOST); - pdata.matrix_values = - hypre_TReAlloc(pdata.matrix_values, HYPRE_Real, size, HYPRE_MEMORY_HOST); - } - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.matrix_ilowers[pdata.matrix_nentries]); - SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, - pdata.matrix_iuppers[pdata.matrix_nentries]); - SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, - pdata.matrix_strides[pdata.matrix_nentries]); - for (i = data.ndim; i < 3; i++) - { - pdata.matrix_strides[pdata.matrix_nentries][i] = 1; - } - pdata.matrix_vars[pdata.matrix_nentries] = - strtol(sdata_ptr, &sdata_ptr, 10); - pdata.matrix_entries[pdata.matrix_nentries] = - strtol(sdata_ptr, &sdata_ptr, 10); - pdata.matrix_values[pdata.matrix_nentries] = - (HYPRE_Real)strtod(sdata_ptr, &sdata_ptr); - pdata.matrix_nentries++; - data.pdata[part] = pdata; - } - - else if ( strcmp(key, "FacParts:") == 0 ) - { - part = strtol(sdata_ptr, &sdata_ptr, 10); - pdata = data.pdata[part]; - pdata.fac_plevel = strtol(sdata_ptr, &sdata_ptr, 10); - SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, pdata.fac_prefinement); - data.pdata[part] = pdata; - } - - else if ( strcmp(key, "ProcessPoolCreate:") == 0 ) - { - data.npools = strtol(sdata_ptr, &sdata_ptr, 10); - data.pools = hypre_CTAlloc(HYPRE_Int, data.nparts, HYPRE_MEMORY_HOST); - } - else if ( strcmp(key, "ProcessPoolSetPart:") == 0 ) - { - i = strtol(sdata_ptr, &sdata_ptr, 10); - part = strtol(sdata_ptr, &sdata_ptr, 10); - data.pools[part] = i; - } - } - - sdata_line += strlen(sdata_line) + 1; - } - - data.max_boxsize = 0; - for (part = 0; part < data.nparts; part++) - { - data.max_boxsize = - hypre_max(data.max_boxsize, data.pdata[part].max_boxsize); - } - - hypre_TFree(sdata, HYPRE_MEMORY_HOST); - - *data_ptr = data; - return 0; -} - -HYPRE_Int -MapProblemIndex( ProblemIndex index, - Index m ) -{ - /* un-shift the index */ - index[0] -= index[6]; - 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]; - /* pre-shift the new mapped index */ - index[0] += index[6]; - index[1] += index[7]; - index[2] += index[8]; - - return 0; -} - - -HYPRE_Int -IntersectBoxes( ProblemIndex ilower1, - ProblemIndex iupper1, - ProblemIndex ilower2, - ProblemIndex iupper2, - ProblemIndex int_ilower, - ProblemIndex int_iupper ) -{ - HYPRE_Int d, size; - - size = 1; - for (d = 0; d < 3; d++) - { - int_ilower[d] = hypre_max(ilower1[d], ilower2[d]); - int_iupper[d] = hypre_min(iupper1[d], iupper2[d]); - size *= hypre_max(0, (int_iupper[d] - int_ilower[d] + 1)); - } - - return size; -} - -HYPRE_Int -DistributeData( ProblemData global_data, - Index *refine, - Index *distribute, - Index *block, - HYPRE_Int num_procs, - HYPRE_Int myid, - ProblemData *data_ptr ) -{ - ProblemData data = global_data; - ProblemPartData pdata; - HYPRE_Int *pool_procs; - HYPRE_Int np, pid; - HYPRE_Int pool, part, box, entry, p, q, r, i, d, dmap, sign, size; - HYPRE_Int mod_lower, mod_upper; - Index m, mmap, n, mod_graph; - 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); - for (part = 0; part < data.nparts; part++) - { - pool = data.pools[part] + 1; - np = distribute[part][0] * distribute[part][1] * distribute[part][2]; - pool_procs[pool] = hypre_max(pool_procs[pool], np); - - } - pool_procs[0] = 0; - for (pool = 1; pool < (data.npools + 1); pool++) - { - pool_procs[pool] = pool_procs[pool - 1] + pool_procs[pool]; - } - - /* check number of processes */ - if (pool_procs[data.npools] != num_procs) - { - hypre_printf("Error: Invalid number of processes or process topology \n"); - exit(1); - } - - /* modify part data */ - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - pool = data.pools[part]; - np = distribute[part][0] * distribute[part][1] * distribute[part][2]; - pid = myid - pool_procs[pool]; - - if ( (pid < 0) || (pid >= np) ) - { - /* none of this part data lives on this process */ - pdata.nboxes = 0; - pdata.glue_nboxes = 0; - pdata.graph_nentries = 0; - pdata.matrix_nentries = 0; - } - else - { - /* refine boxes */ - m[0] = refine[part][0]; - m[1] = refine[part][1]; - m[2] = refine[part][2]; - if ( (m[0] * m[1] * m[2]) > 1) - { - for (box = 0; box < pdata.nboxes; box++) - { - MapProblemIndex(pdata.ilowers[box], m); - MapProblemIndex(pdata.iuppers[box], m); - } - - for (entry = 0; entry < pdata.graph_nentries; entry++) - { - MapProblemIndex(pdata.graph_ilowers[entry], m); - MapProblemIndex(pdata.graph_iuppers[entry], m); - mmap[0] = m[pdata.graph_index_maps[entry][0]]; - mmap[1] = m[pdata.graph_index_maps[entry][1]]; - mmap[2] = m[pdata.graph_index_maps[entry][2]]; - MapProblemIndex(pdata.graph_to_ilowers[entry], mmap); - MapProblemIndex(pdata.graph_to_iuppers[entry], mmap); - } - for (entry = 0; entry < pdata.matrix_nentries; entry++) - { - MapProblemIndex(pdata.matrix_ilowers[entry], m); - MapProblemIndex(pdata.matrix_iuppers[entry], m); - } - } - - /* refine and distribute boxes */ - m[0] = distribute[part][0]; - m[1] = distribute[part][1]; - m[2] = distribute[part][2]; - if ( (m[0] * m[1] * m[2]) > 1) - { - p = pid % m[0]; - q = ((pid - p) / m[0]) % m[1]; - r = (pid - p - q * m[0]) / (m[0] * m[1]); - - for (box = 0; box < pdata.nboxes; box++) - { - n[0] = pdata.iuppers[box][0] - pdata.ilowers[box][0] + 1; - n[1] = pdata.iuppers[box][1] - pdata.ilowers[box][1] + 1; - n[2] = pdata.iuppers[box][2] - pdata.ilowers[box][2] + 1; - - MapProblemIndex(pdata.ilowers[box], m); - MapProblemIndex(pdata.iuppers[box], m); - pdata.iuppers[box][0] = pdata.ilowers[box][0] + n[0] - 1; - 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]; - } - - i = 0; - for (entry = 0; entry < pdata.graph_nentries; entry++) - { - MapProblemIndex(pdata.graph_ilowers[entry], m); - MapProblemIndex(pdata.graph_iuppers[entry], m); - mmap[0] = m[pdata.graph_index_maps[entry][0]]; - mmap[1] = m[pdata.graph_index_maps[entry][1]]; - mmap[2] = m[pdata.graph_index_maps[entry][2]]; - MapProblemIndex(pdata.graph_to_ilowers[entry], mmap); - MapProblemIndex(pdata.graph_to_iuppers[entry], mmap); - - for (d = 0; d < 3; d++) - { - mod_graph[d] = pdata.graph_ilowers[entry][d] % pdata.graph_strides[entry][d]; - } - - for (box = 0; box < pdata.nboxes; box++) - { - GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], - pdata.vartypes[pdata.graph_vars[entry]], - ilower, iupper); - size = IntersectBoxes(pdata.graph_ilowers[entry], - pdata.graph_iuppers[entry], - ilower, iupper, - int_ilower, int_iupper); - - /* adjust int_ilower & int_iupper by a mod shift to get the extents - correctly */ - if (size > 0) - { - for (d = 0; d < 3; 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); - } - else - { - int_ilower[d] += pdata.graph_strides[entry][d] + (mod_graph[d] - mod_lower); - } - mod_lower = mod_graph[d]; - - mod_upper = int_iupper[d] % pdata.graph_strides[entry][d]; - if (mod_lower >= mod_upper) - { - int_iupper[d] -= (mod_lower - mod_upper); - } - else - { - int_iupper[d] += (mod_upper - mod_lower) - pdata.graph_strides[entry][d]; - } - - if (int_iupper[d] - int_ilower[d] < 0) - { - size = -1; - break; - } - } - } - - if (size > 0) - { - /* if there is an intersection, it is the only one */ - for (d = 0; d < 3; d++) - { - dmap = pdata.graph_index_maps[entry][d]; - sign = pdata.graph_index_signs[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_strides[entry][d]; - pdata.graph_to_ilowers[i][dmap] = - pdata.graph_to_ilowers[entry][dmap] + sign * - 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] = - pdata.graph_strides[entry][d]; - pdata.graph_to_strides[i][d] = - pdata.graph_to_strides[entry][d]; - pdata.graph_index_maps[i][d] = dmap; - pdata.graph_index_signs[i][d] = sign; - } - for (d = 3; d < 9; d++) - { - pdata.graph_ilowers[i][d] = - pdata.graph_ilowers[entry][d]; - pdata.graph_iuppers[i][d] = - pdata.graph_iuppers[entry][d]; - pdata.graph_to_ilowers[i][d] = - pdata.graph_to_ilowers[entry][d]; - pdata.graph_to_iuppers[i][d] = - pdata.graph_to_iuppers[entry][d]; - } - pdata.graph_vars[i] = pdata.graph_vars[entry]; - pdata.graph_to_parts[i] = pdata.graph_to_parts[entry]; - pdata.graph_to_vars[i] = pdata.graph_to_vars[entry]; - pdata.graph_entries[i] = pdata.graph_entries[entry]; - pdata.graph_values[i] = pdata.graph_values[entry]; - i++; - break; - } - } - } - pdata.graph_nentries = i; - - i = 0; - for (entry = 0; entry < pdata.matrix_nentries; entry++) - { - MapProblemIndex(pdata.matrix_ilowers[entry], m); - MapProblemIndex(pdata.matrix_iuppers[entry], m); - - for (box = 0; box < pdata.nboxes; box++) - { - GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], - pdata.vartypes[pdata.matrix_vars[entry]], - ilower, iupper); - size = IntersectBoxes(pdata.matrix_ilowers[entry], - pdata.matrix_iuppers[entry], - ilower, iupper, - int_ilower, int_iupper); - - if (size > 0) - { - /* if there is an intersection, it is the only one */ - for (d = 0; d < 3; d++) - { - pdata.matrix_ilowers[i][d] = int_ilower[d]; - pdata.matrix_iuppers[i][d] = int_iupper[d]; - pdata.matrix_strides[i][d] = - pdata.matrix_strides[entry][d]; - } - for (d = 3; d < 9; d++) - { - pdata.matrix_ilowers[i][d] = - pdata.matrix_ilowers[entry][d]; - pdata.matrix_iuppers[i][d] = - pdata.matrix_iuppers[entry][d]; - } - pdata.matrix_vars[i] = pdata.matrix_vars[entry]; - pdata.matrix_entries[i] = pdata.matrix_entries[entry]; - pdata.matrix_values[i] = pdata.matrix_values[entry]; - i++; - break; - } - } - } - pdata.matrix_nentries = i; - } - - /* refine and block boxes */ - m[0] = block[part][0]; - m[1] = block[part][1]; - 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); - for (box = 0; box < pdata.nboxes; box++) - { - n[0] = pdata.iuppers[box][0] - pdata.ilowers[box][0] + 1; - n[1] = pdata.iuppers[box][1] - pdata.ilowers[box][1] + 1; - n[2] = pdata.iuppers[box][2] - pdata.ilowers[box][2] + 1; - - MapProblemIndex(pdata.ilowers[box], m); - - MapProblemIndex(pdata.iuppers[box], m); - pdata.iuppers[box][0] = pdata.ilowers[box][0] + n[0] - 1; - pdata.iuppers[box][1] = pdata.ilowers[box][1] + n[1] - 1; - pdata.iuppers[box][2] = pdata.ilowers[box][2] + n[2] - 1; - - i = box; - for (r = 0; r < m[2]; r++) - { - for (q = 0; q < m[1]; q++) - { - 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]; - for (d = 3; d < 9; d++) - { - pdata.ilowers[i][d] = pdata.ilowers[box][d]; - pdata.iuppers[i][d] = pdata.iuppers[box][d]; - } - i += pdata.nboxes; - } - } - } - } - pdata.nboxes *= m[0] * m[1] * m[2]; - - for (entry = 0; entry < pdata.graph_nentries; entry++) - { - MapProblemIndex(pdata.graph_ilowers[entry], m); - MapProblemIndex(pdata.graph_iuppers[entry], m); - mmap[0] = m[pdata.graph_index_maps[entry][0]]; - mmap[1] = m[pdata.graph_index_maps[entry][1]]; - mmap[2] = m[pdata.graph_index_maps[entry][2]]; - MapProblemIndex(pdata.graph_to_ilowers[entry], mmap); - MapProblemIndex(pdata.graph_to_iuppers[entry], mmap); - } - for (entry = 0; entry < pdata.matrix_nentries; entry++) - { - MapProblemIndex(pdata.matrix_ilowers[entry], m); - MapProblemIndex(pdata.matrix_iuppers[entry], m); - } - } - - /* map remaining ilowers & iuppers */ - m[0] = refine[part][0] * block[part][0] * distribute[part][0]; - m[1] = refine[part][1] * block[part][1] * distribute[part][1]; - m[2] = refine[part][2] * block[part][2] * distribute[part][2]; - if ( (m[0] * m[1] * m[2]) > 1) - { - for (box = 0; box < pdata.glue_nboxes; box++) - { - MapProblemIndex(pdata.glue_ilowers[box], m); - MapProblemIndex(pdata.glue_iuppers[box], m); - mmap[0] = m[pdata.glue_index_maps[box][0]]; - mmap[1] = m[pdata.glue_index_maps[box][1]]; - mmap[2] = m[pdata.glue_index_maps[box][2]]; - MapProblemIndex(pdata.glue_nbor_ilowers[box], mmap); - MapProblemIndex(pdata.glue_nbor_iuppers[box], mmap); - } - } - - /* compute box sizes, etc. */ - pdata.max_boxsize = 0; - for (box = 0; box < pdata.nboxes; box++) - { - pdata.boxsizes[box] = 1; - for (i = 0; i < 3; i++) - { - pdata.boxsizes[box] *= - (pdata.iuppers[box][i] - pdata.ilowers[box][i] + 2); - } - pdata.max_boxsize = - hypre_max(pdata.max_boxsize, pdata.boxsizes[box]); - } - for (box = 0; box < pdata.graph_nentries; box++) - { - pdata.graph_boxsizes[box] = 1; - for (i = 0; i < 3; i++) - { - pdata.graph_boxsizes[box] *= - (pdata.graph_iuppers[box][i] - - pdata.graph_ilowers[box][i] + 1); - } - } - } - - if (pdata.nboxes == 0) - { - hypre_TFree(pdata.ilowers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.iuppers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.boxsizes, HYPRE_MEMORY_HOST); - pdata.max_boxsize = 0; - } - - 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); - } - if (pdata.glue_nboxes == 0) - { - hypre_TFree(pdata.glue_ilowers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.glue_iuppers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.glue_nbor_parts, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.glue_nbor_ilowers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.glue_nbor_iuppers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.glue_index_maps, HYPRE_MEMORY_HOST); - } - - if (pdata.graph_nentries == 0) - { - hypre_TFree(pdata.graph_ilowers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_iuppers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_strides, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_vars, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_to_parts, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_to_ilowers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_to_iuppers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_to_strides, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_to_vars, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_index_maps, HYPRE_MEMORY_HOST); - 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.graph_boxsizes, HYPRE_MEMORY_HOST); - } - - - data.pdata[part] = pdata; - } - - data.max_boxsize = 0; - for (part = 0; part < data.nparts; part++) - { - data.max_boxsize = - hypre_max(data.max_boxsize, data.pdata[part].max_boxsize); - } - - hypre_TFree(pool_procs, HYPRE_MEMORY_HOST); - - *data_ptr = data; - return 0; -} - -/*-------------------------------------------------------------------------- - * Destroy data - *--------------------------------------------------------------------------*/ - -HYPRE_Int -DestroyData( ProblemData data ) -{ - ProblemPartData pdata; - HYPRE_Int part, s; - - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - - if (pdata.nboxes > 0) - { - hypre_TFree(pdata.ilowers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.iuppers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.boxsizes, HYPRE_MEMORY_HOST); - } - - if (pdata.nvars > 0) - { - hypre_TFree(pdata.vartypes, HYPRE_MEMORY_HOST); - } - - if (pdata.add_nvars > 0) - { - hypre_TFree(pdata.add_indexes, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.add_vartypes, HYPRE_MEMORY_HOST); - } - - if (pdata.glue_nboxes > 0) - { - hypre_TFree(pdata.glue_ilowers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.glue_iuppers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.glue_nbor_parts, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.glue_nbor_ilowers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.glue_nbor_iuppers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.glue_index_maps, HYPRE_MEMORY_HOST); - } - - if (pdata.nvars > 0) - { - hypre_TFree(pdata.stencil_num, HYPRE_MEMORY_HOST); - } - - if (pdata.graph_nentries > 0) - { - hypre_TFree(pdata.graph_ilowers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_iuppers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_strides, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_vars, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_to_parts, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_to_ilowers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_to_iuppers, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_to_strides, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_to_vars, HYPRE_MEMORY_HOST); - hypre_TFree(pdata.graph_index_maps, HYPRE_MEMORY_HOST); - 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.graph_boxsizes, HYPRE_MEMORY_HOST); - } - - 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(data.pdata, HYPRE_MEMORY_HOST); - - for (s = 0; s < data.nstencils; s++) - { - hypre_TFree(data.stencil_offsets[s], HYPRE_MEMORY_HOST); - hypre_TFree(data.stencil_vars[s], HYPRE_MEMORY_HOST); - hypre_TFree(data.stencil_values[s], HYPRE_MEMORY_HOST); - } - hypre_TFree(data.stencil_sizes, HYPRE_MEMORY_HOST); - hypre_TFree(data.stencil_offsets, HYPRE_MEMORY_HOST); - hypre_TFree(data.stencil_vars, HYPRE_MEMORY_HOST); - hypre_TFree(data.stencil_values, HYPRE_MEMORY_HOST); - - hypre_TFree(data.pools, HYPRE_MEMORY_HOST); - - return 0; -} - -/*-------------------------------------------------------------------------- - * Test driver for semi-structured matrix interface - *--------------------------------------------------------------------------*/ - -hypre_int -main( hypre_int argc, - char *argv[] ) -{ - char *infile; - ProblemData global_data; - ProblemData data; - ProblemPartData pdata; - HYPRE_Int nparts; - HYPRE_Int *parts; - Index *refine; - Index *distribute; - Index *block; - HYPRE_Int solver_id; - HYPRE_Int print_system; - - HYPRE_SStructGrid grid; - HYPRE_SStructStencil *stencils; - HYPRE_SStructGraph graph; - HYPRE_SStructMatrix A, A_amg; - HYPRE_StructMatrix sA; - HYPRE_SStructVector b, b_amg; - HYPRE_SStructVector x, x_amg; - HYPRE_StructVector sx; - HYPRE_SStructSolver solver; - - HYPRE_ParCSRMatrix par_A; - HYPRE_ParVector par_b; - HYPRE_ParVector par_x; - HYPRE_Solver par_solver; - HYPRE_Solver par_precond; - - Index ilower, iupper; - Index index, to_index; - HYPRE_Real *values, *box_values; - - HYPRE_Int *plevels; - Index *prefinements; - - 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; - - - /*----------------------------------------------------------- - * 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); - - /*----------------------------------------------------------------- - * GPU Device binding - * Must be done before HYPRE_Initialize() and should not be changed after - *-----------------------------------------------------------------*/ - hypre_bind_device_id(-1, myid, num_procs, hypre_MPI_COMM_WORLD); - - /*----------------------------------------------------------- - * Initialize : must be the first HYPRE function to call - *-----------------------------------------------------------*/ - HYPRE_Initialize(); - HYPRE_DeviceInitialize(); - - /*----------------------------------------------------------- - * Read input file - *-----------------------------------------------------------*/ - - arg_index = 1; - - /* parse command line for input file name */ - infile = infile_default; - if (argc > 1) - { - if ( strcmp(argv[arg_index], "-in") == 0 ) - { - arg_index++; - infile = argv[arg_index++]; - } - } - - ReadData(infile, &global_data); - - - /*----------------------------------------------------------- - * Set defaults - *-----------------------------------------------------------*/ - - 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; - } - } - - solver_id = 39; - print_system = 0; - - /*----------------------------------------------------------- - * Parse command line - *-----------------------------------------------------------*/ - - while (arg_index < argc) - { - if ( strcmp(argv[arg_index], "-pt") == 0 ) - { - arg_index++; - nparts = 0; - while ( strncmp(argv[arg_index], "-", 1) != 0 ) - { - parts[nparts++] = atoi(argv[arg_index++]); - } - } - else if ( strcmp(argv[arg_index], "-r") == 0 ) - { - arg_index++; - for (i = 0; i < nparts; i++) - { - part = parts[i]; - k = arg_index; - for (j = 0; j < 3; j++) - { - refine[part][j] = atoi(argv[k++]); - } - } - arg_index += 3; - } - else if ( strcmp(argv[arg_index], "-P") == 0 ) - { - arg_index++; - for (i = 0; i < nparts; i++) - { - part = parts[i]; - k = arg_index; - for (j = 0; j < 3; j++) - { - distribute[part][j] = atoi(argv[k++]); - } - } - arg_index += 3; - } - else if ( strcmp(argv[arg_index], "-b") == 0 ) - { - arg_index++; - for (i = 0; i < nparts; i++) - { - part = parts[i]; - k = arg_index; - for (j = 0; j < 3; j++) - { - block[part][j] = atoi(argv[k++]); - } - } - arg_index += 3; - } - 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], "-v") == 0 ) - { - arg_index++; - n_pre = atoi(argv[arg_index++]); - n_post = atoi(argv[arg_index++]); - } - else - { - break; - } - } - - /*----------------------------------------------------------- - * Distribute data - *-----------------------------------------------------------*/ - - DistributeData(global_data, refine, distribute, block, - num_procs, myid, &data); - - /*----------------------------------------------------------- - * Synchronize so that timings make sense - *-----------------------------------------------------------*/ - - hypre_MPI_Barrier(hypre_MPI_COMM_WORLD); - - /*----------------------------------------------------------- - * Set up the grid - *-----------------------------------------------------------*/ - - time_index = hypre_InitializeTiming("SStruct Interface"); - hypre_BeginTiming(time_index); - - HYPRE_SStructGridCreate(hypre_MPI_COMM_WORLD, data.ndim, data.nparts, &grid); - 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]); - } - - HYPRE_SStructGridSetVariables(grid, part, pdata.nvars, pdata.vartypes); - - /* GridAddVariabes */ - - /* GridSetNeighborBox */ - for (box = 0; box < pdata.glue_nboxes; box++) - { - hypre_printf("Error: No longer supporting SetNeighborBox\n"); -#if 0 - HYPRE_SStructGridSetNeighborBox(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]); -#endif - } - - HYPRE_SStructGridSetPeriodic(grid, part, pdata.periodic); - } - HYPRE_SStructGridAssemble(grid); - - /*----------------------------------------------------------- - * Set up the stencils - *-----------------------------------------------------------*/ - - 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 (i = 0; i < data.stencil_sizes[s]; i++) - { - HYPRE_SStructStencilSetEntry(stencils[s], i, - data.stencil_offsets[s][i], - data.stencil_vars[s][i]); - } - } - - /*----------------------------------------------------------- - * Set up the amr structure - *-----------------------------------------------------------*/ - plevels = hypre_TAlloc(HYPRE_Int, 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++) - { - prefinements[part][i] = pdata.fac_prefinement[i]; - } - } - - n_pre = prefinements[data.nparts - 1][0] - 1; - n_post = prefinements[data.nparts - 1][0] - 1; - /*----------------------------------------------------------- - * Set up the graph - *-----------------------------------------------------------*/ - - HYPRE_SStructGraphCreate(hypre_MPI_COMM_WORLD, grid, &graph); - if ( ((solver_id >= 20) && (solver_id <= 30)) || - ((solver_id >= 40) && (solver_id < 60)) ) - { - HYPRE_SStructGraphSetObjectType(graph, HYPRE_PARCSR); - } - - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - - /* set stencils */ - for (var = 0; var < pdata.nvars; var++) - { - HYPRE_SStructGraphSetStencil(graph, part, var, - stencils[pdata.stencil_num[var]]); - } - - /* add entries */ - for (entry = 0; entry < pdata.graph_nentries; entry++) - { - for (index[2] = pdata.graph_ilowers[entry][2]; - index[2] <= pdata.graph_iuppers[entry][2]; - index[2] += pdata.graph_strides[entry][2]) - { - for (index[1] = pdata.graph_ilowers[entry][1]; - index[1] <= pdata.graph_iuppers[entry][1]; - index[1] += pdata.graph_strides[entry][1]) - { - for (index[0] = pdata.graph_ilowers[entry][0]; - index[0] <= pdata.graph_iuppers[entry][0]; - index[0] += pdata.graph_strides[entry][0]) - { - for (i = 0; i < 3; i++) - { - j = pdata.graph_index_maps[entry][i]; - k = index[i] - pdata.graph_ilowers[entry][i]; - 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]; - } - HYPRE_SStructGraphAddEntries(graph, part, index, - pdata.graph_vars[entry], - pdata.graph_to_parts[entry], - to_index, - pdata.graph_to_vars[entry]); - } - } - } - } - } - - HYPRE_SStructGraphAssemble(graph); - - /*----------------------------------------------------------- - * Set up the matrix - *-----------------------------------------------------------*/ - - values = hypre_TAlloc(HYPRE_Real, data.max_boxsize, HYPRE_MEMORY_HOST); - - HYPRE_SStructMatrixCreate(hypre_MPI_COMM_WORLD, graph, &A); - HYPRE_SStructMatrixInitialize(A); - - if ( ((solver_id >= 20) && (solver_id <= 30)) || - ((solver_id >= 40) && (solver_id < 60)) ) - { - HYPRE_SStructMatrixCreate(hypre_MPI_COMM_WORLD, graph, &A_amg); - HYPRE_SStructMatrixSetObjectType(A_amg, HYPRE_PARCSR); - HYPRE_SStructMatrixInitialize(A_amg); - } - - - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - - /* set stencil values */ - for (var = 0; var < pdata.nvars; var++) - { - 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]; - } - 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, values); - } - } - } - - /* set non-stencil entries */ - for (entry = 0; entry < pdata.graph_nentries; entry++) - { - for (index[2] = pdata.graph_ilowers[entry][2]; - index[2] <= pdata.graph_iuppers[entry][2]; - index[2] += pdata.graph_strides[entry][2]) - { - for (index[1] = pdata.graph_ilowers[entry][1]; - index[1] <= pdata.graph_iuppers[entry][1]; - index[1] += pdata.graph_strides[entry][1]) - { - for (index[0] = pdata.graph_ilowers[entry][0]; - index[0] <= pdata.graph_iuppers[entry][0]; - index[0] += pdata.graph_strides[entry][0]) - { - HYPRE_SStructMatrixSetValues(A, part, index, - pdata.graph_vars[entry], - 1, &pdata.graph_entries[entry], - &pdata.graph_values[entry]); - } - } - } - } - - if ( ((solver_id >= 20) && (solver_id <= 30)) || - ((solver_id >= 40) && (solver_id < 60)) ) - { - for (entry = 0; entry < pdata.graph_nentries; entry++) - { - for (index[2] = pdata.graph_ilowers[entry][2]; - index[2] <= pdata.graph_iuppers[entry][2]; - index[2] += pdata.graph_strides[entry][2]) - { - for (index[1] = pdata.graph_ilowers[entry][1]; - index[1] <= pdata.graph_iuppers[entry][1]; - index[1] += pdata.graph_strides[entry][1]) - { - for (index[0] = pdata.graph_ilowers[entry][0]; - 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], - &pdata.graph_values[entry]); - } - } - } - } - } - - } - - /* reset matrix values */ - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - for (entry = 0; entry < pdata.matrix_nentries; entry++) - { - for (index[2] = pdata.matrix_ilowers[entry][2]; - index[2] <= pdata.matrix_iuppers[entry][2]; - index[2] += pdata.matrix_strides[entry][2]) - { - for (index[1] = pdata.matrix_ilowers[entry][1]; - index[1] <= pdata.matrix_iuppers[entry][1]; - index[1] += pdata.matrix_strides[entry][1]) - { - for (index[0] = pdata.matrix_ilowers[entry][0]; - index[0] <= pdata.matrix_iuppers[entry][0]; - index[0] += pdata.matrix_strides[entry][0]) - { - HYPRE_SStructMatrixSetValues(A, part, index, - pdata.matrix_vars[entry], - 1, &pdata.matrix_entries[entry], - &pdata.matrix_values[entry]); - } - } - } - } - } - - /* reset matrix values so that stencil connections between two parts are zeroed */ - for (part = data.nparts - 1; part > 0; part--) - { - /*hypre_FacZeroCFSten(hypre_SStructMatrixPMatrix(A, part), - hypre_SStructMatrixPMatrix(A, part-1), - grid, - part, - prefinements[part]); - hypre_FacZeroFCSten(hypre_SStructMatrixPMatrix(A, part), - grid, - part); - hypre_ZeroAMRMatrixData(A, part-1, prefinements[part]); */ - - HYPRE_SStructFACZeroCFSten(A, grid, part, prefinements[part]); - HYPRE_SStructFACZeroFCSten(A, - grid, - part); - HYPRE_SStructFACZeroAMRMatrixData(A, part - 1, prefinements[part]); - } - - HYPRE_SStructMatrixAssemble(A); - - if ( ((solver_id >= 20) && (solver_id <= 30)) || - ((solver_id >= 40) && (solver_id < 60)) ) - { - 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); - 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); - GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], - pdata.vartypes[var], ilower, iupper); - HYPRE_StructMatrixGetBoxValues(sA, ilower, iupper, 1, - &i, box_values); - - HYPRE_SStructMatrixSetBoxValues(A_amg, part, ilower, iupper, - var, 1, &i, box_values); - hypre_TFree(box_values, HYPRE_MEMORY_HOST); - } - } - } - } - - HYPRE_SStructMatrixAssemble(A_amg); - HYPRE_SStructMatrixGetObject(A_amg, (void **) &par_A); - } - /*----------------------------------------------------------- - * Set up the linear system - *-----------------------------------------------------------*/ - - HYPRE_SStructVectorCreate(hypre_MPI_COMM_WORLD, grid, &b); - HYPRE_SStructVectorInitialize(b); - - if ( ((solver_id >= 20) && (solver_id <= 30)) || - ((solver_id >= 40) && (solver_id < 60)) ) - { - HYPRE_SStructVectorCreate(hypre_MPI_COMM_WORLD, grid, &b_amg); - HYPRE_SStructVectorSetObjectType(b_amg, HYPRE_PARCSR); - HYPRE_SStructVectorInitialize(b_amg); - } - - for (j = 0; j < data.max_boxsize; j++) - { - values[j] = 1.0; - } - 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], var, - ilower, iupper); - HYPRE_SStructVectorSetBoxValues(b, part, ilower, iupper, - var, values); - } - } - } - /*hypre_ZeroAMRVectorData(b, plevels, prefinements);*/ - HYPRE_SStructFACZeroAMRVectorData(b, plevels, prefinements); - - HYPRE_SStructVectorAssemble(b); - - if ( ((solver_id >= 20) && (solver_id <= 30)) || - ((solver_id >= 40) && (solver_id < 60)) ) - { - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - for (var = 0; var < pdata.nvars; 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); - GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], var, - ilower, iupper); - HYPRE_StructVectorGetBoxValues(sx, ilower, iupper, box_values); - HYPRE_SStructVectorSetBoxValues(b_amg, part, ilower, iupper, - var, values); - hypre_TFree(box_values, HYPRE_MEMORY_HOST); - } - } - } - - HYPRE_SStructVectorAssemble(b_amg); - HYPRE_SStructVectorGetObject(b_amg, (void **) &par_b); - } - - - HYPRE_SStructVectorCreate(hypre_MPI_COMM_WORLD, grid, &x); - HYPRE_SStructVectorInitialize(x); - - if ( ((solver_id >= 20) && (solver_id <= 30)) || - ((solver_id >= 40) && (solver_id < 60)) ) - { - HYPRE_SStructVectorCreate(hypre_MPI_COMM_WORLD, grid, &x_amg); - HYPRE_SStructVectorSetObjectType(x_amg, HYPRE_PARCSR); - HYPRE_SStructVectorInitialize(x_amg); - } - - for (j = 0; j < data.max_boxsize; j++) - { - values[j] = 1.0; - } - - 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], var, - ilower, iupper); - HYPRE_SStructVectorSetBoxValues(x, part, ilower, iupper, - var, values); - } - } - } - /*hypre_ZeroAMRVectorData(x, plevels, prefinements);*/ - HYPRE_SStructFACZeroAMRVectorData(x, plevels, prefinements); - HYPRE_SStructVectorAssemble(x); - - - if ( ((solver_id >= 20) && (solver_id <= 30)) || - ((solver_id >= 40) && (solver_id < 60)) ) - { - for (part = 0; part < data.nparts; part++) - { - pdata = data.pdata[part]; - for (var = 0; var < pdata.nvars; 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); - GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], var, - ilower, iupper); - HYPRE_StructVectorGetBoxValues(sx, ilower, iupper, box_values); - HYPRE_SStructVectorSetBoxValues(x_amg, part, ilower, iupper, - var, values); - hypre_TFree(box_values, HYPRE_MEMORY_HOST); - } - } - } - - HYPRE_SStructVectorAssemble(x_amg); - HYPRE_SStructVectorGetObject(x_amg, (void **) &par_x); - } - - - hypre_EndTiming(time_index); - hypre_PrintTiming("SStruct Interface", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - - /*----------------------------------------------------------- - * Debugging code - *-----------------------------------------------------------*/ - -#if DEBUG - { - 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 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 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++) - { - for (box = 0; box < pdata.nboxes; box++) - { - GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], 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); - - /* 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++) - { - for (box = 0; box < pdata.nboxes; box++) - { - GetVariableBox(pdata.ilowers[box], pdata.iuppers[box], 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]); - } - } - } - } - - /* re-initializes x to 0 */ - hypre_SStructAxpy(-1.0, b, x); - } -#endif - - hypre_TFree(values, HYPRE_MEMORY_HOST); - - /*----------------------------------------------------------- - * Print out the system and initial guess - *-----------------------------------------------------------*/ - if (print_system) - { - HYPRE_SStructVectorPrint("sstruct.out.b", b, 0); - HYPRE_SStructVectorPrint("sstruct.out.x0", x, 0); - } - - /*----------------------------------------------------------- - * Solve the system using FAC - *-----------------------------------------------------------*/ - - if ((solver_id >= 50) && (solver_id < 100)) - { - if (solver_id < 100) - { - /* n_pre+= n_post;*/ - /* n_post= 0;*/ - } - time_index = hypre_InitializeTiming("FAC Setup"); - hypre_BeginTiming(time_index); - - HYPRE_SStructFACCreate(hypre_MPI_COMM_WORLD, &solver); - HYPRE_SStructFACSetMaxLevels(solver, data.nparts); - HYPRE_SStructFACSetMaxIter(solver, 20); - HYPRE_SStructFACSetTol(solver, 1.0e-06); - HYPRE_SStructFACSetPLevels(solver, data.nparts, plevels); - HYPRE_SStructFACSetPRefinements(solver, data.nparts, prefinements); - HYPRE_SStructFACSetRelChange(solver, 0); - if (solver_id > 90) - { - HYPRE_SStructFACSetRelaxType(solver, 2); - } - else - { - HYPRE_SStructFACSetRelaxType(solver, 1); - } - HYPRE_SStructFACSetNumPreRelax(solver, n_pre); - HYPRE_SStructFACSetNumPostRelax(solver, n_post); - HYPRE_SStructFACSetCoarseSolverType(solver, 2); - HYPRE_SStructFACSetLogging(solver, 1); - HYPRE_SStructFACSetup2(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("FAC Solve"); - hypre_BeginTiming(time_index); - - if (solver_id > 90) - { - HYPRE_SStructFACSolve3(solver, A, b, x); - } - else - { - HYPRE_SStructFACSolve3(solver, A, b, x); - } - - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - - HYPRE_SStructFACGetNumIterations(solver, &num_iterations); - HYPRE_SStructFACGetFinalRelativeResidualNorm( - solver, &final_res_norm); - HYPRE_SStructFACDestroy2(solver); - } - - - - /*----------------------------------------------------------- - * Solve the system using PCG - *-----------------------------------------------------------*/ - if ((solver_id >= 20) && (solver_id < 30)) - { - time_index = hypre_InitializeTiming("PCG Setup"); - hypre_BeginTiming(time_index); - - HYPRE_ParCSRPCGCreate(hypre_MPI_COMM_WORLD, &par_solver); - HYPRE_PCGSetMaxIter( par_solver, 200 ); - HYPRE_PCGSetTol( par_solver, 1.0e-06 ); - HYPRE_PCGSetTwoNorm( par_solver, 1 ); - HYPRE_PCGSetRelChange( par_solver, 0 ); - HYPRE_PCGSetPrintLevel( par_solver, 1 ); - - if (solver_id == 20) - { - /* use BoomerAMG as preconditioner */ - HYPRE_BoomerAMGCreate(&par_precond); - HYPRE_BoomerAMGSetCoarsenType(par_precond, 6); - HYPRE_BoomerAMGSetStrongThreshold(par_precond, 0.5); - HYPRE_BoomerAMGSetTol(par_precond, 1.0e-06); - HYPRE_BoomerAMGSetPrintLevel(par_precond, 1); - HYPRE_BoomerAMGSetPrintFileName(par_precond, "sstruct.out.log"); - /*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_PCGSetup( 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(); - - 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", hypre_MPI_COMM_WORLD); - 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); - } - } - - /*----------------------------------------------------------- - * Solve the system using ParCSR version of GMRES - *-----------------------------------------------------------*/ - if ((solver_id >= 40) && (solver_id < 50)) - { - time_index = hypre_InitializeTiming("GMRES Setup"); - hypre_BeginTiming(time_index); - - HYPRE_ParCSRGMRESCreate(hypre_MPI_COMM_WORLD, &par_solver); - HYPRE_GMRESSetKDim(par_solver, 5); - HYPRE_GMRESSetMaxIter(par_solver, 200); - HYPRE_GMRESSetTol(par_solver, 1.0e-06); - HYPRE_GMRESSetLogging(par_solver, 1); - - if (solver_id == 40) - { - /* use BoomerAMG as preconditioner */ - HYPRE_BoomerAMGCreate(&par_precond); - HYPRE_BoomerAMGSetCoarsenType(par_precond, 6); - HYPRE_BoomerAMGSetStrongThreshold(par_precond, 0.); - HYPRE_BoomerAMGSetTruncFactor(par_precond, 0.3); - HYPRE_BoomerAMGSetTol(par_precond, 1.0e-06); - 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); - } - - 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(); - - time_index = hypre_InitializeTiming("GMRES Solve"); - hypre_BeginTiming(time_index); - - 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_GMRESGetNumIterations( par_solver, &num_iterations); - HYPRE_GMRESGetFinalRelativeResidualNorm( par_solver, - &final_res_norm); - HYPRE_ParCSRGMRESDestroy(par_solver); - - if (solver_id == 40) - { - HYPRE_BoomerAMGDestroy(par_precond); - } - } - - if (solver_id == 30) - { - time_index = hypre_InitializeTiming("AMG Setup"); - hypre_BeginTiming(time_index); - - HYPRE_BoomerAMGCreate(&par_solver); - HYPRE_BoomerAMGSetCoarsenType(par_solver, 6); - HYPRE_BoomerAMGSetStrongThreshold(par_solver, 0.); - HYPRE_BoomerAMGSetTruncFactor(par_solver, 0.3); - /*HYPRE_BoomerAMGSetMaxLevels(par_solver, 4);*/ - HYPRE_BoomerAMGSetTol(par_solver, 1.0e-06); - HYPRE_BoomerAMGSetPrintLevel(par_solver, 1); - HYPRE_BoomerAMGSetPrintFileName(par_solver, "sstruct.out.log"); - HYPRE_BoomerAMGSetMaxIter(par_solver, 200); - HYPRE_BoomerAMGSetup(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(); - - time_index = hypre_InitializeTiming("BoomerAMG Solve"); - hypre_BeginTiming(time_index); - - HYPRE_BoomerAMGSolve(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_BoomerAMGGetNumIterations(par_solver, &num_iterations); - HYPRE_BoomerAMGGetFinalRelativeResidualNorm(par_solver, - &final_res_norm); - - HYPRE_BoomerAMGDestroy(par_solver); - } - - /*----------------------------------------------------------- - * Gather the solution vector - *-----------------------------------------------------------*/ - - HYPRE_SStructVectorGather(x); - - /*----------------------------------------------------------- - * Print the solution and other info - *-----------------------------------------------------------*/ - - 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"); - } - - /*----------------------------------------------------------- - * 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); - - if ( ((solver_id >= 20) && (solver_id <= 30)) || - ((solver_id >= 40) && (solver_id < 60)) ) - { - HYPRE_SStructMatrixDestroy(A_amg); - HYPRE_SStructVectorDestroy(b_amg); - HYPRE_SStructVectorDestroy(x_amg); - } - - HYPRE_SStructMatrixDestroy(A); - HYPRE_SStructVectorDestroy(b); - HYPRE_SStructVectorDestroy(x); - - - hypre_TFree(plevels, HYPRE_MEMORY_HOST); - hypre_TFree(prefinements, HYPRE_MEMORY_HOST); - - DestroyData(data); - - 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_Finalize(); - - /* Finalize MPI */ - hypre_MPI_Finalize(); - - return (0); -} diff --git a/src/test/sstruct_helpers.c b/src/test/sstruct_helpers.c new file mode 100644 index 0000000000..aef8960e53 --- /dev/null +++ b/src/test/sstruct_helpers.c @@ -0,0 +1,2718 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 "sstruct_helpers.h" + +/*-------------------------------------------------------------------------- + * BoxVolume + *--------------------------------------------------------------------------*/ +HYPRE_Int +BoxVolume( Index ilower, + Index iupper ) +{ + return (iupper[0] - ilower[0] + 1) * + (iupper[1] - ilower[1] + 1) * + (iupper[2] - ilower[2] + 1); +} + +/*-------------------------------------------------------------------------- + * GetVariableBox + *--------------------------------------------------------------------------*/ + +HYPRE_Int +GetVariableBox( Index cell_ilower, + Index cell_iupper, + HYPRE_Int vartype, + Index var_ilower, + Index var_iupper ) +{ + var_ilower[0] = cell_ilower[0]; + var_ilower[1] = cell_ilower[1]; + var_ilower[2] = cell_ilower[2]; + var_iupper[0] = cell_iupper[0]; + var_iupper[1] = cell_iupper[1]; + var_iupper[2] = cell_iupper[2]; + + switch (vartype) + { + case HYPRE_SSTRUCT_VARIABLE_CELL: + 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; + case HYPRE_SSTRUCT_VARIABLE_XFACE: + 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; + case HYPRE_SSTRUCT_VARIABLE_ZFACE: + 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; + case HYPRE_SSTRUCT_VARIABLE_YEDGE: + 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; + case HYPRE_SSTRUCT_VARIABLE_UNDEFINED: + break; + } + + return 0; +} + +/*-------------------------------------------------------------------------- + * SScanIntArray + *--------------------------------------------------------------------------*/ + +HYPRE_Int +SScanIntArray( char *sdata_ptr, + char **sdata_ptr_ptr, + HYPRE_Int size, + HYPRE_Int *array ) +{ + HYPRE_Int i; + + sdata_ptr += strspn(sdata_ptr, " \t\n["); + for (i = 0; i < size; i++) + { + array[i] = strtol(sdata_ptr, &sdata_ptr, 10); + } + sdata_ptr += strcspn(sdata_ptr, "]") + 1; + + *sdata_ptr_ptr = sdata_ptr; + + return 0; +} + +/*-------------------------------------------------------------------------- + * SScanDblArray + *--------------------------------------------------------------------------*/ + +HYPRE_Int +SScanDblArray( char *sdata_ptr, + char **sdata_ptr_ptr, + HYPRE_Int size, + HYPRE_Real *array ) +{ + HYPRE_Int i; + + sdata_ptr += strspn(sdata_ptr, " \t\n["); + for (i = 0; i < size; i++) + { + array[i] = strtod(sdata_ptr, &sdata_ptr); + } + sdata_ptr += strcspn(sdata_ptr, "]") + 1; + + *sdata_ptr_ptr = sdata_ptr; + return 0; +} + +/*-------------------------------------------------------------------------- + * SScanProblemIndex + *--------------------------------------------------------------------------*/ + +HYPRE_Int +SScanProblemIndex( char *sdata_ptr, + char **sdata_ptr_ptr, + HYPRE_Int ndim, + ProblemIndex index ) +{ + HYPRE_Int i; + char sign[3]; + + /* initialize index array */ + for (i = 0; i < 9; i++) + { + index[i] = 0; + } + + sdata_ptr += strspn(sdata_ptr, " \t\n("); + switch (ndim) + { + case 1: + 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; + + 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; + } + sdata_ptr += strcspn(sdata_ptr, ":)"); + if ( *sdata_ptr == ':' ) + { + /* read in optional shift */ + sdata_ptr += 1; + switch (ndim) + { + case 1: + hypre_sscanf(sdata_ptr, "%d", &index[6]); + break; + + case 2: + hypre_sscanf(sdata_ptr, "%d%d", &index[6], &index[7]); + break; + + case 3: + hypre_sscanf(sdata_ptr, "%d%d%d", &index[6], &index[7], &index[8]); + break; + } + /* pre-shift the index */ + for (i = 0; i < ndim; i++) + { + index[i] += index[i + 6]; + } + } + sdata_ptr += strcspn(sdata_ptr, ")") + 1; + + for (i = 0; i < ndim; i++) + { + if (sign[i] == '+') + { + index[i + 3] = 1; + } + } + + *sdata_ptr_ptr = sdata_ptr; + + return 0; +} + +/*-------------------------------------------------------------------------- + * ReadData + *--------------------------------------------------------------------------*/ + +HYPRE_Int +ReadData( MPI_Comm comm, + char *filename, + ProblemData *data_ptr ) +{ + ProblemData data; + ProblemPartData pdata; + + HYPRE_Int myid; + FILE *file; + + char *sdata = NULL; + char *sdata_line; + char *sdata_ptr; + HYPRE_Int sdata_size; + HYPRE_Int size; + HYPRE_Int memchunk = 10000; + HYPRE_Int maxline = 250; + + char key[250]; + + HYPRE_Int part, var, s, entry, i, j, k, il, iu; + + /*----------------------------------------------------------- + * Read data file from process 0, then broadcast + *-----------------------------------------------------------*/ + + hypre_MPI_Comm_rank(comm, &myid); + + if (myid == 0) + { + if ((file = fopen(filename, "r")) == NULL) + { + hypre_printf("Error: can't open input file %s\n", filename); + hypre_MPI_Abort(comm, 1); + } + + /* allocate initial space, and read first input line */ + sdata_size = 0; + sdata = hypre_TAlloc(char, memchunk, HYPRE_MEMORY_HOST); + sdata_line = fgets(sdata, maxline, file); + + s = 0; + while (sdata_line != NULL) + { + sdata_size += strlen(sdata_line) + 1; + + /* allocate more space, if necessary */ + if ((sdata_size + maxline) > s) + { + sdata = hypre_TReAlloc(sdata, char, (sdata_size + memchunk), HYPRE_MEMORY_HOST); + s = sdata_size + memchunk; + } + + /* read the next input line */ + sdata_line = fgets((sdata + sdata_size), maxline, file); + } + + fclose(file); + } + + /* broadcast the data size */ + hypre_MPI_Bcast(&sdata_size, 1, HYPRE_MPI_INT, 0, comm); + + /* broadcast the data */ + sdata = hypre_TReAlloc(sdata, char, sdata_size, HYPRE_MEMORY_HOST); + hypre_MPI_Bcast(sdata, sdata_size, hypre_MPI_CHAR, 0, comm); + + /*----------------------------------------------------------- + * Parse the data and fill ProblemData structure + *-----------------------------------------------------------*/ + + data.max_boxsize = 0; + data.numghost = NULL; + data.nstencils = 0; + data.rhs_true = 0; + data.fem_nvars = 0; + data.fem_nsparse = 0; + data.fem_rhs_true = 0; + data.symmetric_num = 0; + data.symmetric_parts = NULL; + data.symmetric_vars = NULL; + data.symmetric_to_vars = NULL; + data.symmetric_booleans = NULL; + data.ns_symmetric = 0; + data.ndists = 0; + data.dist_npools = NULL; + data.dist_pools = NULL; + + sdata_line = sdata; + 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"); + + if ( strcmp(key, "GridCreate:") == 0 ) + { + data.ndim = strtol(sdata_ptr, &sdata_ptr, 10); + data.nparts = strtol(sdata_ptr, &sdata_ptr, 10); + data.pdata = hypre_CTAlloc(ProblemPartData, data.nparts, HYPRE_MEMORY_HOST); + + /* Set default pdata values */ + for (part = 0; part < data.nparts; part++) + { + data.pdata[part].matrix_num_centries = 0; + for (i = 0; i < HYPRE_MAXDIM; i++) + { + data.pdata[part].matrix_dstride[i] = 1; + data.pdata[part].matrix_rstride[i] = 1; + } + } + } + else if ( strcmp(key, "GridSetNumGhost:") == 0 ) + { + // # GridSetNumGhost: numghost[2*ndim] + 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 ) + { + part = strtol(sdata_ptr, &sdata_ptr, 10); + pdata = data.pdata[part]; + if ((pdata.nboxes % 10) == 0) + { + size = pdata.nboxes + 10; + pdata.ilowers = + hypre_TReAlloc(pdata.ilowers, ProblemIndex, size, HYPRE_MEMORY_HOST); + pdata.iuppers = + hypre_TReAlloc(pdata.iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); + pdata.boxsizes = + hypre_TReAlloc(pdata.boxsizes, HYPRE_Int, size, HYPRE_MEMORY_HOST); + } + SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, + pdata.ilowers[pdata.nboxes]); + SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, + pdata.iuppers[pdata.nboxes]); + /* check use of +- in GridSetExtents */ + il = 1; + iu = 1; + for (i = 0; i < data.ndim; i++) + { + il *= pdata.ilowers[pdata.nboxes][i + 3]; + iu *= pdata.iuppers[pdata.nboxes][i + 3]; + } + if ( (il != 0) || (iu != 1) ) + { + hypre_printf("Error: Invalid use of `+-' in GridSetExtents\n"); + if (il != 0) + { + hypre_printf("\tCannot have all lower indices pointing to the right (+)\n"); + } + + if (iu != 1) + { + hypre_printf("\tCannot have an upper index pointing to the left (-)\n"); + } + hypre_MPI_Abort(comm, 1); + } + pdata.boxsizes[pdata.nboxes] = 1; + for (i = 0; i < 3; i++) + { + pdata.boxsizes[pdata.nboxes] *= + (pdata.iuppers[pdata.nboxes][i] - + pdata.ilowers[pdata.nboxes][i] + 2); + } + pdata.max_boxsize = + hypre_max(pdata.max_boxsize, pdata.boxsizes[pdata.nboxes]); + pdata.nboxes++; + data.pdata[part] = pdata; + } + else if ( strcmp(key, "GridSetVariables:") == 0 ) + { + part = strtol(sdata_ptr, &sdata_ptr, 10); + pdata = data.pdata[part]; + pdata.nvars = strtol(sdata_ptr, &sdata_ptr, 10); + pdata.vartypes = hypre_CTAlloc(HYPRE_SStructVariable, pdata.nvars, HYPRE_MEMORY_HOST); + SScanIntArray(sdata_ptr, &sdata_ptr, pdata.nvars, pdata.vartypes); + data.pdata[part] = pdata; + } + else if ( strcmp(key, "GridAddVariables:") == 0 ) + { + /* TODO */ + hypre_printf("GridAddVariables not yet implemented!\n"); + hypre_MPI_Abort(comm, 1); + } + else if ( strcmp(key, "GridSetNeighborPart:") == 0 || + strcmp(key, "GridSetSharedPart:") == 0 ) + { + part = strtol(sdata_ptr, &sdata_ptr, 10); + pdata = data.pdata[part]; + if ((pdata.glue_nboxes % 10) == 0) + { + size = pdata.glue_nboxes + 10; + pdata.glue_shared = + hypre_TReAlloc(pdata.glue_shared, HYPRE_Int, size, HYPRE_MEMORY_HOST); + pdata.glue_ilowers = + hypre_TReAlloc(pdata.glue_ilowers, ProblemIndex, size, HYPRE_MEMORY_HOST); + pdata.glue_iuppers = + hypre_TReAlloc(pdata.glue_iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); + pdata.glue_offsets = + hypre_TReAlloc(pdata.glue_offsets, Index, size, HYPRE_MEMORY_HOST); + pdata.glue_nbor_parts = + hypre_TReAlloc(pdata.glue_nbor_parts, HYPRE_Int, size, HYPRE_MEMORY_HOST); + pdata.glue_nbor_ilowers = + hypre_TReAlloc(pdata.glue_nbor_ilowers, ProblemIndex, size, HYPRE_MEMORY_HOST); + pdata.glue_nbor_iuppers = + hypre_TReAlloc(pdata.glue_nbor_iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); + pdata.glue_nbor_offsets = + hypre_TReAlloc(pdata.glue_nbor_offsets, Index, size, HYPRE_MEMORY_HOST); + pdata.glue_index_maps = + hypre_TReAlloc(pdata.glue_index_maps, Index, size, HYPRE_MEMORY_HOST); + pdata.glue_index_dirs = + hypre_TReAlloc(pdata.glue_index_dirs, Index, size, HYPRE_MEMORY_HOST); + pdata.glue_primaries = + hypre_TReAlloc(pdata.glue_primaries, HYPRE_Int, size, HYPRE_MEMORY_HOST); + } + pdata.glue_shared[pdata.glue_nboxes] = 0; + if ( strcmp(key, "GridSetSharedPart:") == 0 ) + { + pdata.glue_shared[pdata.glue_nboxes] = 1; + } + SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, + pdata.glue_ilowers[pdata.glue_nboxes]); + SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, + pdata.glue_iuppers[pdata.glue_nboxes]); + if (pdata.glue_shared[pdata.glue_nboxes]) + { + SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, + pdata.glue_offsets[pdata.glue_nboxes]); + } + pdata.glue_nbor_parts[pdata.glue_nboxes] = + strtol(sdata_ptr, &sdata_ptr, 10); + SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, + pdata.glue_nbor_ilowers[pdata.glue_nboxes]); + SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, + pdata.glue_nbor_iuppers[pdata.glue_nboxes]); + if (pdata.glue_shared[pdata.glue_nboxes]) + { + SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, + pdata.glue_nbor_offsets[pdata.glue_nboxes]); + } + SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, + pdata.glue_index_maps[pdata.glue_nboxes]); + for (i = data.ndim; i < 3; i++) + { + pdata.glue_index_maps[pdata.glue_nboxes][i] = i; + } + SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, + pdata.glue_index_dirs[pdata.glue_nboxes]); + for (i = data.ndim; i < 3; i++) + { + pdata.glue_index_dirs[pdata.glue_nboxes][i] = 1; + } + sdata_ptr += strcspn(sdata_ptr, ":\t\n"); + if ( *sdata_ptr == ':' ) + { + /* read in optional primary indicator */ + sdata_ptr += 1; + pdata.glue_primaries[pdata.glue_nboxes] = + strtol(sdata_ptr, &sdata_ptr, 10); + } + else + { + pdata.glue_primaries[pdata.glue_nboxes] = -1; + sdata_ptr -= 1; + } + pdata.glue_nboxes++; + data.pdata[part] = pdata; + } + else if ( strcmp(key, "GridSetPeriodic:") == 0 ) + { + part = strtol(sdata_ptr, &sdata_ptr, 10); + pdata = data.pdata[part]; + SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, pdata.periodic); + for (i = data.ndim; i < 3; i++) + { + pdata.periodic[i] = 0; + } + data.pdata[part] = pdata; + } + else if ( strcmp(key, "StencilCreate:") == 0 ) + { + if (data.fem_nvars > 0) + { + hypre_printf("Stencil and FEMStencil cannot be used together\n"); + hypre_MPI_Abort(comm, 1); + } + data.nstencils = strtol(sdata_ptr, &sdata_ptr, 10); + data.stencil_sizes = hypre_CTAlloc(HYPRE_Int, data.nstencils, HYPRE_MEMORY_HOST); + data.stencil_offsets = hypre_CTAlloc(Index *, data.nstencils, HYPRE_MEMORY_HOST); + data.stencil_vars = hypre_CTAlloc(HYPRE_Int *, data.nstencils, HYPRE_MEMORY_HOST); + data.stencil_values = hypre_CTAlloc(HYPRE_Real *, data.nstencils, HYPRE_MEMORY_HOST); + SScanIntArray(sdata_ptr, &sdata_ptr, + data.nstencils, data.stencil_sizes); + for (s = 0; s < data.nstencils; s++) + { + data.stencil_offsets[s] = + hypre_CTAlloc(Index, data.stencil_sizes[s], HYPRE_MEMORY_HOST); + data.stencil_vars[s] = + hypre_CTAlloc(HYPRE_Int, data.stencil_sizes[s], HYPRE_MEMORY_HOST); + data.stencil_values[s] = + hypre_CTAlloc(HYPRE_Real, data.stencil_sizes[s], HYPRE_MEMORY_HOST); + } + } + else if ( strcmp(key, "StencilSetEntry:") == 0 ) + { + s = strtol(sdata_ptr, &sdata_ptr, 10); + entry = strtol(sdata_ptr, &sdata_ptr, 10); + SScanIntArray(sdata_ptr, &sdata_ptr, + data.ndim, data.stencil_offsets[s][entry]); + for (i = data.ndim; i < 3; i++) + { + 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); + } + else if ( strcmp(key, "RhsSet:") == 0 ) + { + if (data.rhs_true == 0) + { + data.rhs_true = 1; + } + data.rhs_value = strtod(sdata_ptr, &sdata_ptr); + } + else if ( strcmp(key, "FEMStencilCreate:") == 0 ) + { + if (data.nstencils > 0) + { + hypre_printf("Stencil and FEMStencil cannot be used together\n"); + hypre_MPI_Abort(comm, 1); + } + data.fem_nvars = strtol(sdata_ptr, &sdata_ptr, 10); + data.fem_offsets = hypre_CTAlloc(Index, data.fem_nvars, HYPRE_MEMORY_HOST); + data.fem_vars = hypre_CTAlloc(HYPRE_Int, data.fem_nvars, HYPRE_MEMORY_HOST); + data.fem_values_full = hypre_CTAlloc(HYPRE_Real *, data.fem_nvars, HYPRE_MEMORY_HOST); + for (i = 0; i < data.fem_nvars; i++) + { + data.fem_values_full[i] = hypre_CTAlloc(HYPRE_Real, data.fem_nvars, + HYPRE_MEMORY_HOST); + } + } + else if ( strcmp(key, "FEMStencilSetRow:") == 0 ) + { + i = strtol(sdata_ptr, &sdata_ptr, 10); + SScanIntArray(sdata_ptr, &sdata_ptr, + data.ndim, data.fem_offsets[i]); + for (k = data.ndim; k < 3; k++) + { + data.fem_offsets[i][k] = 0; + } + data.fem_vars[i] = strtol(sdata_ptr, &sdata_ptr, 10); + SScanDblArray(sdata_ptr, &sdata_ptr, + data.fem_nvars, data.fem_values_full[i]); + } + else if ( strcmp(key, "FEMRhsSet:") == 0 ) + { + if (data.fem_rhs_true == 0) + { + data.fem_rhs_true = 1; + data.fem_rhs_values = hypre_CTAlloc(HYPRE_Real, data.fem_nvars, HYPRE_MEMORY_HOST); + } + SScanDblArray(sdata_ptr, &sdata_ptr, + data.fem_nvars, data.fem_rhs_values); + } + else if ( strcmp(key, "GraphSetStencil:") == 0 ) + { + part = strtol(sdata_ptr, &sdata_ptr, 10); + var = strtol(sdata_ptr, &sdata_ptr, 10); + s = strtol(sdata_ptr, &sdata_ptr, 10); + pdata = data.pdata[part]; + if (pdata.stencil_num == NULL) + { + pdata.stencil_num = hypre_CTAlloc(HYPRE_Int, pdata.nvars, HYPRE_MEMORY_HOST); + } + pdata.stencil_num[var] = s; + data.pdata[part] = pdata; + } + else if ( strcmp(key, "GraphAddEntries:") == 0 ) + { + part = strtol(sdata_ptr, &sdata_ptr, 10); + pdata = data.pdata[part]; + if ((pdata.graph_nboxes % 10) == 0) + { + size = pdata.graph_nboxes + 10; + pdata.graph_ilowers = + hypre_TReAlloc(pdata.graph_ilowers, ProblemIndex, size, HYPRE_MEMORY_HOST); + pdata.graph_iuppers = + hypre_TReAlloc(pdata.graph_iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); + pdata.graph_strides = + hypre_TReAlloc(pdata.graph_strides, Index, size, HYPRE_MEMORY_HOST); + pdata.graph_vars = + hypre_TReAlloc(pdata.graph_vars, HYPRE_Int, size, HYPRE_MEMORY_HOST); + pdata.graph_to_parts = + hypre_TReAlloc(pdata.graph_to_parts, HYPRE_Int, size, HYPRE_MEMORY_HOST); + pdata.graph_to_ilowers = + hypre_TReAlloc(pdata.graph_to_ilowers, ProblemIndex, size, HYPRE_MEMORY_HOST); + pdata.graph_to_iuppers = + hypre_TReAlloc(pdata.graph_to_iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); + pdata.graph_to_strides = + hypre_TReAlloc(pdata.graph_to_strides, Index, size, HYPRE_MEMORY_HOST); + pdata.graph_to_vars = + hypre_TReAlloc(pdata.graph_to_vars, HYPRE_Int, size, HYPRE_MEMORY_HOST); + pdata.graph_index_maps = + hypre_TReAlloc(pdata.graph_index_maps, Index, size, HYPRE_MEMORY_HOST); + pdata.graph_index_signs = + hypre_TReAlloc(pdata.graph_index_signs, Index, size, HYPRE_MEMORY_HOST); + pdata.graph_entries = + hypre_TReAlloc(pdata.graph_entries, HYPRE_Int, size, HYPRE_MEMORY_HOST); + pdata.graph_values = + hypre_TReAlloc(pdata.graph_values, HYPRE_Real, size, HYPRE_MEMORY_HOST); + pdata.graph_boxsizes = + hypre_TReAlloc(pdata.graph_boxsizes, HYPRE_Int, size, HYPRE_MEMORY_HOST); + } + SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, + pdata.graph_ilowers[pdata.graph_nboxes]); + SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, + pdata.graph_iuppers[pdata.graph_nboxes]); + SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, + pdata.graph_strides[pdata.graph_nboxes]); + for (i = data.ndim; i < 3; i++) + { + pdata.graph_strides[pdata.graph_nboxes][i] = 1; + } + pdata.graph_vars[pdata.graph_nboxes] = + strtol(sdata_ptr, &sdata_ptr, 10); + pdata.graph_to_parts[pdata.graph_nboxes] = + strtol(sdata_ptr, &sdata_ptr, 10); + SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, + pdata.graph_to_ilowers[pdata.graph_nboxes]); + SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, + pdata.graph_to_iuppers[pdata.graph_nboxes]); + SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, + pdata.graph_to_strides[pdata.graph_nboxes]); + for (i = data.ndim; i < 3; i++) + { + pdata.graph_to_strides[pdata.graph_nboxes][i] = 1; + } + pdata.graph_to_vars[pdata.graph_nboxes] = + strtol(sdata_ptr, &sdata_ptr, 10); + SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, + pdata.graph_index_maps[pdata.graph_nboxes]); + for (i = data.ndim; i < 3; i++) + { + pdata.graph_index_maps[pdata.graph_nboxes][i] = i; + } + for (i = 0; i < 3; i++) + { + pdata.graph_index_signs[pdata.graph_nboxes][i] = 1; + if ( pdata.graph_to_iuppers[pdata.graph_nboxes][i] < + pdata.graph_to_ilowers[pdata.graph_nboxes][i] ) + { + pdata.graph_index_signs[pdata.graph_nboxes][i] = -1; + } + } + pdata.graph_entries[pdata.graph_nboxes] = + strtol(sdata_ptr, &sdata_ptr, 10); + pdata.graph_values[pdata.graph_nboxes] = + strtod(sdata_ptr, &sdata_ptr); + pdata.graph_boxsizes[pdata.graph_nboxes] = 1; + for (i = 0; i < 3; i++) + { + pdata.graph_boxsizes[pdata.graph_nboxes] *= + (pdata.graph_iuppers[pdata.graph_nboxes][i] - + pdata.graph_ilowers[pdata.graph_nboxes][i] + 1); + } + pdata.graph_nboxes++; + data.pdata[part] = pdata; + } + else if ( strcmp(key, "MatrixSetSymmetric:") == 0 ) + { + if ((data.symmetric_num % 10) == 0) + { + size = data.symmetric_num + 10; + data.symmetric_parts = + hypre_TReAlloc(data.symmetric_parts, HYPRE_Int, size, HYPRE_MEMORY_HOST); + data.symmetric_vars = + hypre_TReAlloc(data.symmetric_vars, HYPRE_Int, size, HYPRE_MEMORY_HOST); + data.symmetric_to_vars = + hypre_TReAlloc(data.symmetric_to_vars, HYPRE_Int, size, HYPRE_MEMORY_HOST); + data.symmetric_booleans = + hypre_TReAlloc(data.symmetric_booleans, HYPRE_Int, size, HYPRE_MEMORY_HOST); + } + data.symmetric_parts[data.symmetric_num] = + strtol(sdata_ptr, &sdata_ptr, 10); + data.symmetric_vars[data.symmetric_num] = + strtol(sdata_ptr, &sdata_ptr, 10); + data.symmetric_to_vars[data.symmetric_num] = + strtol(sdata_ptr, &sdata_ptr, 10); + data.symmetric_booleans[data.symmetric_num] = + strtol(sdata_ptr, &sdata_ptr, 10); + data.symmetric_num++; + } + else if ( strcmp(key, "MatrixSetDomainStride:") == 0 ) + { + part = strtol(sdata_ptr, &sdata_ptr, 10); + pdata = data.pdata[part]; + SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, pdata.matrix_dstride); + data.pdata[part] = pdata; + } + else if ( strcmp(key, "MatrixSetRangeStride:") == 0 ) + { + part = strtol(sdata_ptr, &sdata_ptr, 10); + pdata = data.pdata[part]; + SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, pdata.matrix_rstride); + data.pdata[part] = pdata; + } + else if ( strcmp(key, "MatrixSetConstantEntries:") == 0 ) + { + part = strtol(sdata_ptr, &sdata_ptr, 10); + pdata = data.pdata[part]; + pdata.matrix_num_centries = strtol(sdata_ptr, &sdata_ptr, 10); + pdata.matrix_centries = hypre_TAlloc(HYPRE_Int, pdata.matrix_num_centries, + HYPRE_MEMORY_HOST); + SScanIntArray(sdata_ptr, &sdata_ptr, + pdata.matrix_num_centries, + pdata.matrix_centries); + data.pdata[part] = pdata; + } + else if ( strcmp(key, "MatrixSetNSSymmetric:") == 0 ) + { + data.ns_symmetric = strtol(sdata_ptr, &sdata_ptr, 10); + } + else if ( strcmp(key, "MatrixSetValues:") == 0 ) + { + part = strtol(sdata_ptr, &sdata_ptr, 10); + pdata = data.pdata[part]; + if ((pdata.matset_nboxes % 10) == 0) + { + size = pdata.matset_nboxes + 10; + pdata.matset_ilowers = + hypre_TReAlloc(pdata.matset_ilowers, ProblemIndex, size, HYPRE_MEMORY_HOST); + pdata.matset_iuppers = + hypre_TReAlloc(pdata.matset_iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); + pdata.matset_strides = + hypre_TReAlloc(pdata.matset_strides, Index, size, HYPRE_MEMORY_HOST); + pdata.matset_vars = + hypre_TReAlloc(pdata.matset_vars, HYPRE_Int, size, HYPRE_MEMORY_HOST); + pdata.matset_entries = + hypre_TReAlloc(pdata.matset_entries, HYPRE_Int, size, HYPRE_MEMORY_HOST); + pdata.matset_values = + hypre_TReAlloc(pdata.matset_values, HYPRE_Real, size, HYPRE_MEMORY_HOST); + } + SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, + pdata.matset_ilowers[pdata.matset_nboxes]); + SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, + pdata.matset_iuppers[pdata.matset_nboxes]); + SScanIntArray(sdata_ptr, &sdata_ptr, data.ndim, + pdata.matset_strides[pdata.matset_nboxes]); + for (i = data.ndim; i < 3; i++) + { + pdata.matset_strides[pdata.matset_nboxes][i] = 1; + } + pdata.matset_vars[pdata.matset_nboxes] = + strtol(sdata_ptr, &sdata_ptr, 10); + pdata.matset_entries[pdata.matset_nboxes] = + strtol(sdata_ptr, &sdata_ptr, 10); + pdata.matset_values[pdata.matset_nboxes] = + strtod(sdata_ptr, &sdata_ptr); + pdata.matset_nboxes++; + data.pdata[part] = pdata; + } + else if ( strcmp(key, "MatrixAddToValues:") == 0 ) + { + part = strtol(sdata_ptr, &sdata_ptr, 10); + pdata = data.pdata[part]; + if ((pdata.matadd_nboxes % 10) == 0) + { + size = pdata.matadd_nboxes + 10; + pdata.matadd_ilowers = + hypre_TReAlloc(pdata.matadd_ilowers, ProblemIndex, size, HYPRE_MEMORY_HOST); + pdata.matadd_iuppers = + hypre_TReAlloc(pdata.matadd_iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); + pdata.matadd_vars = + hypre_TReAlloc(pdata.matadd_vars, HYPRE_Int, size, HYPRE_MEMORY_HOST); + pdata.matadd_nentries = + hypre_TReAlloc(pdata.matadd_nentries, HYPRE_Int, size, HYPRE_MEMORY_HOST); + pdata.matadd_entries = + hypre_TReAlloc(pdata.matadd_entries, HYPRE_Int *, size, HYPRE_MEMORY_HOST); + 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] = + strtol(sdata_ptr, &sdata_ptr, 10); + 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, + (HYPRE_Int*) pdata.matadd_entries[pdata.matadd_nboxes]); + pdata.matadd_values[pdata.matadd_nboxes] = + hypre_TAlloc(HYPRE_Real, i, HYPRE_MEMORY_HOST); + SScanDblArray(sdata_ptr, &sdata_ptr, i, + (HYPRE_Real *) pdata.matadd_values[pdata.matadd_nboxes]); + pdata.matadd_nboxes++; + data.pdata[part] = pdata; + } + else if ( strcmp(key, "FEMMatrixAddToValues:") == 0 ) + { + part = strtol(sdata_ptr, &sdata_ptr, 10); + pdata = data.pdata[part]; + if ((pdata.fem_matadd_nboxes % 10) == 0) + { + 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 = + hypre_TReAlloc(pdata.fem_matadd_iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); + pdata.fem_matadd_nrows = + hypre_TReAlloc(pdata.fem_matadd_nrows, HYPRE_Int, size, HYPRE_MEMORY_HOST); + pdata.fem_matadd_rows = + hypre_TReAlloc(pdata.fem_matadd_rows, HYPRE_Int *, size, HYPRE_MEMORY_HOST); + pdata.fem_matadd_ncols = + hypre_TReAlloc(pdata.fem_matadd_ncols, HYPRE_Int, size, HYPRE_MEMORY_HOST); + pdata.fem_matadd_cols = + hypre_TReAlloc(pdata.fem_matadd_cols, HYPRE_Int *, size, HYPRE_MEMORY_HOST); + 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; + 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; + 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_Real *) pdata.fem_matadd_values[pdata.fem_matadd_nboxes]); + pdata.fem_matadd_nboxes++; + data.pdata[part] = pdata; + } + else if ( strcmp(key, "RhsAddToValues:") == 0 ) + { + part = strtol(sdata_ptr, &sdata_ptr, 10); + pdata = data.pdata[part]; + if ((pdata.rhsadd_nboxes % 10) == 0) + { + size = pdata.rhsadd_nboxes + 10; + pdata.rhsadd_ilowers = + hypre_TReAlloc(pdata.rhsadd_ilowers, ProblemIndex, size, HYPRE_MEMORY_HOST); + pdata.rhsadd_iuppers = + hypre_TReAlloc(pdata.rhsadd_iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); + pdata.rhsadd_vars = + hypre_TReAlloc(pdata.rhsadd_vars, HYPRE_Int, size, HYPRE_MEMORY_HOST); + 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] = + strtol(sdata_ptr, &sdata_ptr, 10); + pdata.rhsadd_values[pdata.rhsadd_nboxes] = + strtod(sdata_ptr, &sdata_ptr); + pdata.rhsadd_nboxes++; + data.pdata[part] = pdata; + } + else if ( strcmp(key, "FEMRhsAddToValues:") == 0 ) + { + part = strtol(sdata_ptr, &sdata_ptr, 10); + pdata = data.pdata[part]; + if ((pdata.fem_rhsadd_nboxes % 10) == 0) + { + 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 = + hypre_TReAlloc(pdata.fem_rhsadd_iuppers, ProblemIndex, size, HYPRE_MEMORY_HOST); + pdata.fem_rhsadd_values = + hypre_TReAlloc(pdata.fem_rhsadd_values, HYPRE_Real *, size, HYPRE_MEMORY_HOST); + } + SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, + pdata.fem_rhsadd_ilowers[pdata.fem_rhsadd_nboxes]); + SScanProblemIndex(sdata_ptr, &sdata_ptr, data.ndim, + pdata.fem_rhsadd_iuppers[pdata.fem_rhsadd_nboxes]); + pdata.fem_rhsadd_values[pdata.fem_rhsadd_nboxes] = + hypre_TAlloc(HYPRE_Real, data.fem_nvars, HYPRE_MEMORY_HOST); + SScanDblArray(sdata_ptr, &sdata_ptr, data.fem_nvars, + (HYPRE_Real *) pdata.fem_rhsadd_values[pdata.fem_rhsadd_nboxes]); + pdata.fem_rhsadd_nboxes++; + data.pdata[part] = pdata; + } + 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); +#if 0 + data.npools = strtol(sdata_ptr, &sdata_ptr, 10); + data.pools = hypre_CTAlloc(HYPRE_Int, data.nparts, HYPRE_MEMORY_HOST); +#endif + } + else if ( strcmp(key, "ProcessPoolSetPart:") == 0 ) + { + i = strtol(sdata_ptr, &sdata_ptr, 10); + part = strtol(sdata_ptr, &sdata_ptr, 10); + data.dist_pools[data.ndists - 1][part] = i; + } + else if ( strcmp(key, "GridSetNeighborBox:") == 0 ) + { + hypre_printf("Error: No longer supporting SetNeighborBox\n"); + } + } + + sdata_line += strlen(sdata_line) + 1; + } + + data.max_boxsize = 0; + for (part = 0; part < data.nparts; part++) + { + data.max_boxsize = + hypre_max(data.max_boxsize, data.pdata[part].max_boxsize); + } + + /* build additional FEM information */ + if (data.fem_nvars > 0) + { + 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); + + 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; + 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]; + } + for (j = 0; j < data.fem_nvars; j++) + { + if (data.fem_values_full[i][j] != 0.0) + { + k = 2 * data.fem_nsparse; + data.fem_sparsity[k] = i; + 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 ++; + } + } + } + } + + hypre_TFree(sdata, HYPRE_MEMORY_HOST); + + /* Set pointer to data */ + *data_ptr = data; + + return 0; +} + +/*-------------------------------------------------------------------------- + * Distribute routines + *--------------------------------------------------------------------------*/ + +HYPRE_Int +MapProblemIndex( ProblemIndex index, + Index m ) +{ + /* un-shift the index */ + index[0] -= index[6]; + 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]; + + /* pre-shift the new mapped index */ + index[0] += index[6]; + index[1] += index[7]; + index[2] += index[8]; + + return 0; +} + +HYPRE_Int +IntersectBoxes( ProblemIndex ilower1, + ProblemIndex iupper1, + ProblemIndex ilower2, + ProblemIndex iupper2, + ProblemIndex int_ilower, + ProblemIndex int_iupper ) +{ + HYPRE_Int d, size; + + size = 1; + for (d = 0; d < 3; d++) + { + int_ilower[d] = hypre_max(ilower1[d], ilower2[d]); + int_iupper[d] = hypre_min(iupper1[d], iupper2[d]); + size *= hypre_max(0, (int_iupper[d] - int_ilower[d] + 1)); + } + + return size; +} + +HYPRE_Int +DistributeData( MPI_Comm comm, + ProblemData global_data, + HYPRE_Int pooldist, + Index *refine, + Index *distribute, + Index *block, + ProblemData *data_ptr ) +{ + ProblemData data = global_data; + ProblemPartData pdata; + HYPRE_Int *pool_procs; + HYPRE_Int np, pid; + HYPRE_Int pool, part, box, b, p, q, r, i, d; + HYPRE_Int dmap, sign, size; + HYPRE_Int *iptr; + HYPRE_Real *dptr; + Index m, mmap, n; + ProblemIndex ilower, iupper, int_ilower, int_iupper; + HYPRE_Int myid, num_procs; + + /* Set MPI variables */ + hypre_MPI_Comm_rank(comm, &myid); + hypre_MPI_Comm_size(comm, &num_procs); + + /* set default pool distribution */ + data.npools = data.dist_npools[pooldist]; + 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); + for (part = 0; part < data.nparts; part++) + { + pool = data.pools[part] + 1; + np = distribute[part][0] * distribute[part][1] * distribute[part][2]; + pool_procs[pool] = hypre_max(pool_procs[pool], np); + } + + pool_procs[0] = 0; + for (pool = 1; pool < (data.npools + 1); pool++) + { + pool_procs[pool] = pool_procs[pool - 1] + pool_procs[pool]; + } + + /* check number of processes */ + if (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"); + hypre_MPI_Abort(comm, 1); + } + + /* modify part data */ + for (part = 0; part < data.nparts; part++) + { + pdata = data.pdata[part]; + pool = data.pools[part]; + np = distribute[part][0] * distribute[part][1] * distribute[part][2]; + pid = myid - pool_procs[pool]; + + if ((pid < 0) || (pid >= np)) + { + /* none of this part data lives on this process */ + pdata.nboxes = 0; + +#if 1 /* set this to 0 to make all of the SetSharedPart calls */ + pdata.glue_nboxes = 0; +#endif + pdata.graph_nboxes = 0; + pdata.matset_nboxes = 0; + for (box = 0; box < pdata.matadd_nboxes; box++) + { + hypre_TFree(pdata.matadd_entries[box], HYPRE_MEMORY_HOST); + hypre_TFree(pdata.matadd_values[box], HYPRE_MEMORY_HOST); + } + pdata.matadd_nboxes = 0; + for (box = 0; box < pdata.fem_matadd_nboxes; box++) + { + hypre_TFree(pdata.fem_matadd_rows[box], HYPRE_MEMORY_HOST); + hypre_TFree(pdata.fem_matadd_cols[box], HYPRE_MEMORY_HOST); + hypre_TFree(pdata.fem_matadd_values[box], HYPRE_MEMORY_HOST); + } + pdata.fem_matadd_nboxes = 0; + pdata.rhsadd_nboxes = 0; + for (box = 0; box < pdata.fem_rhsadd_nboxes; box++) + { + hypre_TFree(pdata.fem_rhsadd_values[box], HYPRE_MEMORY_HOST); + } + pdata.fem_rhsadd_nboxes = 0; + } + else + { + /* refine boxes */ + m[0] = refine[part][0]; + m[1] = refine[part][1]; + m[2] = refine[part][2]; + if ( (m[0] * m[1] * m[2]) > 1) + { + for (box = 0; box < pdata.nboxes; box++) + { + MapProblemIndex(pdata.ilowers[box], m); + MapProblemIndex(pdata.iuppers[box], m); + } + + for (box = 0; box < pdata.graph_nboxes; box++) + { + MapProblemIndex(pdata.graph_ilowers[box], m); + MapProblemIndex(pdata.graph_iuppers[box], m); + mmap[0] = m[pdata.graph_index_maps[box][0]]; + mmap[1] = m[pdata.graph_index_maps[box][1]]; + mmap[2] = m[pdata.graph_index_maps[box][2]]; + MapProblemIndex(pdata.graph_to_ilowers[box], mmap); + MapProblemIndex(pdata.graph_to_iuppers[box], mmap); + } + for (box = 0; box < pdata.matset_nboxes; box++) + { + MapProblemIndex(pdata.matset_ilowers[box], m); + MapProblemIndex(pdata.matset_iuppers[box], m); + } + for (box = 0; box < pdata.matadd_nboxes; box++) + { + MapProblemIndex(pdata.matadd_ilowers[box], m); + MapProblemIndex(pdata.matadd_iuppers[box], m); + } + for (box = 0; box < pdata.fem_matadd_nboxes; box++) + { + MapProblemIndex(pdata.fem_matadd_ilowers[box], m); + MapProblemIndex(pdata.fem_matadd_iuppers[box], m); + } + for (box = 0; box < pdata.rhsadd_nboxes; box++) + { + MapProblemIndex(pdata.rhsadd_ilowers[box], m); + MapProblemIndex(pdata.rhsadd_iuppers[box], m); + } + for (box = 0; box < pdata.fem_rhsadd_nboxes; box++) + { + MapProblemIndex(pdata.fem_rhsadd_ilowers[box], m); + MapProblemIndex(pdata.fem_rhsadd_iuppers[box], m); + } + } + + /* refine and distribute boxes */ + m[0] = distribute[part][0]; + m[1] = distribute[part][1]; + m[2] = distribute[part][2]; + if ( (m[0] * m[1] * m[2]) > 1) + { + p = pid % m[0]; + q = ((pid - p) / m[0]) % m[1]; + r = (pid - p - q * m[0]) / (m[0] * m[1]); + + for (box = 0; box < pdata.nboxes; box++) + { + n[0] = pdata.iuppers[box][0] - pdata.ilowers[box][0] + 1; + n[1] = pdata.iuppers[box][1] - pdata.ilowers[box][1] + 1; + n[2] = pdata.iuppers[box][2] - pdata.ilowers[box][2] + 1; + + MapProblemIndex(pdata.ilowers[box], m); + MapProblemIndex(pdata.iuppers[box], m); + pdata.iuppers[box][0] = pdata.ilowers[box][0] + n[0] - 1; + 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]; + } + + i = 0; + for (box = 0; box < pdata.graph_nboxes; box++) + { + MapProblemIndex(pdata.graph_ilowers[box], m); + MapProblemIndex(pdata.graph_iuppers[box], m); + mmap[0] = m[pdata.graph_index_maps[box][0]]; + mmap[1] = m[pdata.graph_index_maps[box][1]]; + mmap[2] = m[pdata.graph_index_maps[box][2]]; + MapProblemIndex(pdata.graph_to_ilowers[box], mmap); + MapProblemIndex(pdata.graph_to_iuppers[box], mmap); + + for (b = 0; b < pdata.nboxes; b++) + { + /* first convert the box extents based on vartype */ + GetVariableBox(pdata.ilowers[b], pdata.iuppers[b], + pdata.vartypes[pdata.graph_vars[box]], + ilower, iupper); + size = IntersectBoxes(pdata.graph_ilowers[box], + pdata.graph_iuppers[box], + ilower, iupper, + int_ilower, int_iupper); + + /* Correct intersected box extents */ + for (d = 0; d < 3; d++) + { + int_ilower[d] = pdata.graph_ilowers[box][d] + + pdata.graph_strides[box][d] * + ((int_ilower[d] - pdata.graph_ilowers[box][d] + + pdata.graph_strides[box][d] - 1) / pdata.graph_strides[box][d]); + int_iupper[d] = pdata.graph_iuppers[box][d] + + pdata.graph_strides[box][d] * + ((int_iupper[d] - pdata.graph_iuppers[box][d] + + pdata.graph_strides[box][d] - 1) / pdata.graph_strides[box][d]); + } + + if (size > 0) + { + /* if there is an intersection, it is the only one */ + for (d = 0; d < 3; d++) + { + dmap = pdata.graph_index_maps[box][d]; + sign = pdata.graph_index_signs[box][d]; + pdata.graph_to_ilowers[i][dmap] = + pdata.graph_to_ilowers[box][dmap] + + sign * pdata.graph_to_strides[box][d] * + ((int_ilower[d] - pdata.graph_ilowers[box][d]) / + pdata.graph_strides[box][d]); + pdata.graph_to_iuppers[i][dmap] = + pdata.graph_to_iuppers[box][dmap] + + sign * pdata.graph_to_strides[box][d] * + ((int_iupper[d] - pdata.graph_iuppers[box][d]) / + pdata.graph_strides[box][d]); + pdata.graph_ilowers[i][d] = int_ilower[d]; + pdata.graph_iuppers[i][d] = int_iupper[d]; + pdata.graph_strides[i][d] = + pdata.graph_strides[box][d]; + pdata.graph_to_strides[i][d] = + pdata.graph_to_strides[box][d]; + pdata.graph_index_maps[i][d] = dmap; + pdata.graph_index_signs[i][d] = sign; + } + for (d = 3; d < 9; d++) + { + pdata.graph_ilowers[i][d] = + pdata.graph_ilowers[box][d]; + pdata.graph_iuppers[i][d] = + pdata.graph_iuppers[box][d]; + pdata.graph_to_ilowers[i][d] = + pdata.graph_to_ilowers[box][d]; + pdata.graph_to_iuppers[i][d] = + pdata.graph_to_iuppers[box][d]; + } + pdata.graph_vars[i] = pdata.graph_vars[box]; + pdata.graph_to_parts[i] = pdata.graph_to_parts[box]; + pdata.graph_to_vars[i] = pdata.graph_to_vars[box]; + pdata.graph_entries[i] = pdata.graph_entries[box]; + pdata.graph_values[i] = pdata.graph_values[box]; + i++; + break; + } + } + } + pdata.graph_nboxes = i; + + i = 0; + for (box = 0; box < pdata.matset_nboxes; box++) + { + MapProblemIndex(pdata.matset_ilowers[box], m); + MapProblemIndex(pdata.matset_iuppers[box], m); + + for (b = 0; b < pdata.nboxes; b++) + { + /* first convert the box extents based on vartype */ + GetVariableBox(pdata.ilowers[b], pdata.iuppers[b], + pdata.vartypes[pdata.matset_vars[box]], + ilower, iupper); + size = IntersectBoxes(pdata.matset_ilowers[box], + pdata.matset_iuppers[box], + ilower, iupper, + int_ilower, int_iupper); + + /* Correct intersected box extents */ + for (d = 0; d < 3; d++) + { + int_ilower[d] = pdata.matset_ilowers[box][d] + + pdata.matset_strides[box][d] * + ((int_ilower[d] - pdata.matset_ilowers[box][d] + + pdata.matset_strides[box][d] - 1) / pdata.matset_strides[box][d]); + int_iupper[d] = pdata.matset_iuppers[box][d] + + pdata.matset_strides[box][d] * + ((int_iupper[d] - pdata.matset_iuppers[box][d] + + pdata.matset_strides[box][d] - 1) / pdata.matset_strides[box][d]); + } + + if (size > 0) + { + /* if there is an intersection, it is the only one */ + for (d = 0; d < 3; d++) + { + pdata.matset_ilowers[i][d] = int_ilower[d]; + pdata.matset_iuppers[i][d] = int_iupper[d]; + pdata.matset_strides[i][d] = + pdata.matset_strides[box][d]; + } + for (d = 3; d < 9; d++) + { + pdata.matset_ilowers[i][d] = + pdata.matset_ilowers[box][d]; + pdata.matset_iuppers[i][d] = + pdata.matset_iuppers[box][d]; + } + pdata.matset_vars[i] = pdata.matset_vars[box]; + pdata.matset_entries[i] = pdata.matset_entries[box]; + pdata.matset_values[i] = pdata.matset_values[box]; + i++; + break; + } + } + } + pdata.matset_nboxes = i; + + i = 0; + for (box = 0; box < pdata.matadd_nboxes; box++) + { + MapProblemIndex(pdata.matadd_ilowers[box], m); + MapProblemIndex(pdata.matadd_iuppers[box], m); + + for (b = 0; b < pdata.nboxes; b++) + { + /* first convert the box extents based on vartype */ + GetVariableBox(pdata.ilowers[b], pdata.iuppers[b], + pdata.vartypes[pdata.matadd_vars[box]], + ilower, iupper); + size = IntersectBoxes(pdata.matadd_ilowers[box], + pdata.matadd_iuppers[box], + ilower, iupper, + int_ilower, int_iupper); + + if (size > 0) + { + /* if there is an intersection, it is the only one */ + for (d = 0; d < 3; d++) + { + pdata.matadd_ilowers[i][d] = int_ilower[d]; + pdata.matadd_iuppers[i][d] = int_iupper[d]; + } + for (d = 3; d < 9; d++) + { + pdata.matadd_ilowers[i][d] = + pdata.matadd_ilowers[box][d]; + pdata.matadd_iuppers[i][d] = + pdata.matadd_iuppers[box][d]; + } + pdata.matadd_vars[i] = pdata.matadd_vars[box]; + pdata.matadd_nentries[i] = pdata.matadd_nentries[box]; + iptr = pdata.matadd_entries[i]; + pdata.matadd_entries[i] = pdata.matadd_entries[box]; + pdata.matadd_entries[box] = iptr; + dptr = pdata.matadd_values[i]; + pdata.matadd_values[i] = pdata.matadd_values[box]; + pdata.matadd_values[box] = dptr; + i++; + break; + } + } + } + for (box = i; box < pdata.matadd_nboxes; box++) + { + hypre_TFree(pdata.matadd_entries[box], HYPRE_MEMORY_HOST); + hypre_TFree(pdata.matadd_values[box], HYPRE_MEMORY_HOST); + } + pdata.matadd_nboxes = i; + + i = 0; + for (box = 0; box < pdata.fem_matadd_nboxes; box++) + { + MapProblemIndex(pdata.fem_matadd_ilowers[box], m); + MapProblemIndex(pdata.fem_matadd_iuppers[box], m); + + for (b = 0; b < pdata.nboxes; b++) + { + /* fe is cell-based, so no need to convert box extents */ + size = IntersectBoxes(pdata.fem_matadd_ilowers[box], + pdata.fem_matadd_iuppers[box], + pdata.ilowers[b], pdata.iuppers[b], + int_ilower, int_iupper); + if (size > 0) + { + /* if there is an intersection, it is the only one */ + for (d = 0; d < 3; d++) + { + pdata.fem_matadd_ilowers[i][d] = int_ilower[d]; + pdata.fem_matadd_iuppers[i][d] = int_iupper[d]; + } + for (d = 3; d < 9; d++) + { + pdata.fem_matadd_ilowers[i][d] = + pdata.fem_matadd_ilowers[box][d]; + pdata.fem_matadd_iuppers[i][d] = + pdata.fem_matadd_iuppers[box][d]; + } + pdata.fem_matadd_nrows[i] = pdata.fem_matadd_nrows[box]; + iptr = pdata.fem_matadd_rows[box]; + iptr = pdata.fem_matadd_rows[i]; + pdata.fem_matadd_rows[i] = pdata.fem_matadd_rows[box]; + pdata.fem_matadd_rows[box] = iptr; + pdata.fem_matadd_ncols[i] = pdata.fem_matadd_ncols[box]; + iptr = pdata.fem_matadd_cols[i]; + pdata.fem_matadd_cols[i] = pdata.fem_matadd_cols[box]; + pdata.fem_matadd_cols[box] = iptr; + dptr = pdata.fem_matadd_values[i]; + pdata.fem_matadd_values[i] = pdata.fem_matadd_values[box]; + pdata.fem_matadd_values[box] = dptr; + i++; + break; + } + } + } + for (box = i; box < pdata.fem_matadd_nboxes; box++) + { + hypre_TFree(pdata.fem_matadd_rows[box], HYPRE_MEMORY_HOST); + hypre_TFree(pdata.fem_matadd_cols[box], HYPRE_MEMORY_HOST); + hypre_TFree(pdata.fem_matadd_values[box], HYPRE_MEMORY_HOST); + } + pdata.fem_matadd_nboxes = i; + + i = 0; + for (box = 0; box < pdata.rhsadd_nboxes; box++) + { + MapProblemIndex(pdata.rhsadd_ilowers[box], m); + MapProblemIndex(pdata.rhsadd_iuppers[box], m); + + for (b = 0; b < pdata.nboxes; b++) + { + /* first convert the box extents based on vartype */ + GetVariableBox(pdata.ilowers[b], pdata.iuppers[b], + pdata.vartypes[pdata.rhsadd_vars[box]], + ilower, iupper); + size = IntersectBoxes(pdata.rhsadd_ilowers[box], + pdata.rhsadd_iuppers[box], + ilower, iupper, + int_ilower, int_iupper); + if (size > 0) + { + /* if there is an intersection, it is the only one */ + for (d = 0; d < 3; d++) + { + pdata.rhsadd_ilowers[i][d] = int_ilower[d]; + pdata.rhsadd_iuppers[i][d] = int_iupper[d]; + } + for (d = 3; d < 9; d++) + { + pdata.rhsadd_ilowers[i][d] = + pdata.rhsadd_ilowers[box][d]; + pdata.rhsadd_iuppers[i][d] = + pdata.rhsadd_iuppers[box][d]; + } + pdata.rhsadd_vars[i] = pdata.rhsadd_vars[box]; + pdata.rhsadd_values[i] = pdata.rhsadd_values[box]; + i++; + break; + } + } + } + pdata.rhsadd_nboxes = i; + + i = 0; + for (box = 0; box < pdata.fem_rhsadd_nboxes; box++) + { + MapProblemIndex(pdata.fem_rhsadd_ilowers[box], m); + MapProblemIndex(pdata.fem_rhsadd_iuppers[box], m); + + for (b = 0; b < pdata.nboxes; b++) + { + /* fe is cell-based, so no need to convert box extents */ + size = IntersectBoxes(pdata.fem_rhsadd_ilowers[box], + pdata.fem_rhsadd_iuppers[box], + pdata.ilowers[b], pdata.iuppers[b], + int_ilower, int_iupper); + if (size > 0) + { + /* if there is an intersection, it is the only one */ + for (d = 0; d < 3; d++) + { + pdata.fem_rhsadd_ilowers[i][d] = int_ilower[d]; + pdata.fem_rhsadd_iuppers[i][d] = int_iupper[d]; + } + for (d = 3; d < 9; d++) + { + pdata.fem_rhsadd_ilowers[i][d] = + pdata.fem_rhsadd_ilowers[box][d]; + pdata.fem_rhsadd_iuppers[i][d] = + pdata.fem_rhsadd_iuppers[box][d]; + } + dptr = pdata.fem_rhsadd_values[i]; + pdata.fem_rhsadd_values[i] = pdata.fem_rhsadd_values[box]; + pdata.fem_rhsadd_values[box] = dptr; + i++; + break; + } + } + } + for (box = i; box < pdata.fem_rhsadd_nboxes; box++) + { + hypre_TFree(pdata.fem_rhsadd_values[box], HYPRE_MEMORY_HOST); + } + pdata.fem_rhsadd_nboxes = i; + } + + /* refine and block boxes */ + m[0] = block[part][0]; + m[1] = block[part][1]; + 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); + for (box = 0; box < pdata.nboxes; box++) + { + n[0] = pdata.iuppers[box][0] - pdata.ilowers[box][0] + 1; + n[1] = pdata.iuppers[box][1] - pdata.ilowers[box][1] + 1; + n[2] = pdata.iuppers[box][2] - pdata.ilowers[box][2] + 1; + + MapProblemIndex(pdata.ilowers[box], m); + + MapProblemIndex(pdata.iuppers[box], m); + pdata.iuppers[box][0] = pdata.ilowers[box][0] + n[0] - 1; + pdata.iuppers[box][1] = pdata.ilowers[box][1] + n[1] - 1; + pdata.iuppers[box][2] = pdata.ilowers[box][2] + n[2] - 1; + + i = box; + for (r = 0; r < m[2]; r++) + { + for (q = 0; q < m[1]; q++) + { + 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]; + for (d = 3; d < 9; d++) + { + pdata.ilowers[i][d] = pdata.ilowers[box][d]; + pdata.iuppers[i][d] = pdata.iuppers[box][d]; + } + i += pdata.nboxes; + } + } + } + } + pdata.nboxes *= m[0] * m[1] * m[2]; + + for (box = 0; box < pdata.graph_nboxes; box++) + { + MapProblemIndex(pdata.graph_ilowers[box], m); + MapProblemIndex(pdata.graph_iuppers[box], m); + mmap[0] = m[pdata.graph_index_maps[box][0]]; + mmap[1] = m[pdata.graph_index_maps[box][1]]; + mmap[2] = m[pdata.graph_index_maps[box][2]]; + MapProblemIndex(pdata.graph_to_ilowers[box], mmap); + MapProblemIndex(pdata.graph_to_iuppers[box], mmap); + } + for (box = 0; box < pdata.matset_nboxes; box++) + { + MapProblemIndex(pdata.matset_ilowers[box], m); + MapProblemIndex(pdata.matset_iuppers[box], m); + } + for (box = 0; box < pdata.matadd_nboxes; box++) + { + MapProblemIndex(pdata.matadd_ilowers[box], m); + MapProblemIndex(pdata.matadd_iuppers[box], m); + } + for (box = 0; box < pdata.fem_matadd_nboxes; box++) + { + MapProblemIndex(pdata.fem_matadd_ilowers[box], m); + MapProblemIndex(pdata.fem_matadd_iuppers[box], m); + } + for (box = 0; box < pdata.rhsadd_nboxes; box++) + { + MapProblemIndex(pdata.rhsadd_ilowers[box], m); + MapProblemIndex(pdata.rhsadd_iuppers[box], m); + } + for (box = 0; box < pdata.fem_rhsadd_nboxes; box++) + { + MapProblemIndex(pdata.fem_rhsadd_ilowers[box], m); + MapProblemIndex(pdata.fem_rhsadd_iuppers[box], m); + } + } + + /* map remaining ilowers & iuppers */ + m[0] = refine[part][0] * block[part][0] * distribute[part][0]; + m[1] = refine[part][1] * block[part][1] * distribute[part][1]; + m[2] = refine[part][2] * block[part][2] * distribute[part][2]; + if ( (m[0] * m[1] * m[2]) > 1) + { + for (box = 0; box < pdata.glue_nboxes; box++) + { + MapProblemIndex(pdata.glue_ilowers[box], m); + MapProblemIndex(pdata.glue_iuppers[box], m); + mmap[0] = m[pdata.glue_index_maps[box][0]]; + mmap[1] = m[pdata.glue_index_maps[box][1]]; + mmap[2] = m[pdata.glue_index_maps[box][2]]; + MapProblemIndex(pdata.glue_nbor_ilowers[box], mmap); + MapProblemIndex(pdata.glue_nbor_iuppers[box], mmap); + } + } + + /* compute box sizes, etc. */ + pdata.max_boxsize = 0; + for (box = 0; box < pdata.nboxes; box++) + { + pdata.boxsizes[box] = 1; + for (i = 0; i < 3; i++) + { + pdata.boxsizes[box] *= + (pdata.iuppers[box][i] - pdata.ilowers[box][i] + 2); + } + pdata.max_boxsize = + hypre_max(pdata.max_boxsize, pdata.boxsizes[box]); + } + for (box = 0; box < pdata.graph_nboxes; box++) + { + pdata.graph_boxsizes[box] = 1; + for (i = 0; i < 3; i++) + { + pdata.graph_boxsizes[box] *= + (pdata.graph_iuppers[box][i] - + pdata.graph_ilowers[box][i] + 1); + } + } + for (box = 0; box < pdata.matset_nboxes; box++) + { + size = BoxVolume(pdata.matset_ilowers[box], pdata.matset_iuppers[box]); + pdata.max_boxsize = hypre_max(pdata.max_boxsize, size); + } + for (box = 0; box < pdata.matadd_nboxes; box++) + { + size = BoxVolume(pdata.matadd_ilowers[box], pdata.matadd_iuppers[box]); + pdata.max_boxsize = hypre_max(pdata.max_boxsize, size); + } + for (box = 0; box < pdata.fem_matadd_nboxes; box++) + { + size = BoxVolume(pdata.fem_matadd_ilowers[box], pdata.fem_matadd_iuppers[box]); + pdata.max_boxsize = hypre_max(pdata.max_boxsize, size); + } + for (box = 0; box < pdata.rhsadd_nboxes; box++) + { + size = BoxVolume(pdata.rhsadd_ilowers[box], pdata.rhsadd_iuppers[box]); + pdata.max_boxsize = hypre_max(pdata.max_boxsize, size); + } + for (box = 0; box < pdata.fem_rhsadd_nboxes; box++) + { + size = BoxVolume(pdata.fem_rhsadd_ilowers[box], pdata.fem_rhsadd_iuppers[box]); + 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]; + } /* if ((pid < 0) || (pid >= np)) */ + + if (pdata.nboxes == 0) + { + hypre_TFree(pdata.ilowers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.iuppers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.boxsizes, HYPRE_MEMORY_HOST); + pdata.max_boxsize = 0; + } + + if (pdata.glue_nboxes == 0) + { + hypre_TFree(pdata.glue_shared, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.glue_ilowers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.glue_iuppers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.glue_offsets, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.glue_nbor_parts, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.glue_nbor_ilowers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.glue_nbor_iuppers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.glue_nbor_offsets, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.glue_index_maps, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.glue_index_dirs, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.glue_primaries, HYPRE_MEMORY_HOST); + } + + if (pdata.graph_nboxes == 0) + { + hypre_TFree(pdata.graph_ilowers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.graph_iuppers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.graph_strides, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.graph_vars, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.graph_to_parts, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.graph_to_ilowers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.graph_to_iuppers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.graph_to_strides, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.graph_to_vars, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.graph_index_maps, HYPRE_MEMORY_HOST); + 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.graph_boxsizes, HYPRE_MEMORY_HOST); + } + + if (pdata.matset_nboxes == 0) + { + hypre_TFree(pdata.matset_ilowers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.matset_iuppers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.matset_strides, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.matset_vars, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.matset_entries, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.matset_values, HYPRE_MEMORY_HOST); + } + + if (pdata.matadd_nboxes == 0) + { + hypre_TFree(pdata.matadd_ilowers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.matadd_iuppers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.matadd_vars, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.matadd_nentries, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.matadd_entries, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.matadd_values, HYPRE_MEMORY_HOST); + } + + if (pdata.fem_matadd_nboxes == 0) + { + hypre_TFree(pdata.fem_matadd_ilowers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.fem_matadd_iuppers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.fem_matadd_nrows, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.fem_matadd_ncols, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.fem_matadd_rows, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.fem_matadd_cols, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.fem_matadd_values, HYPRE_MEMORY_HOST); + } + + if (pdata.rhsadd_nboxes == 0) + { + hypre_TFree(pdata.rhsadd_ilowers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.rhsadd_iuppers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.rhsadd_vars, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.rhsadd_values, HYPRE_MEMORY_HOST); + } + + if (pdata.fem_rhsadd_nboxes == 0) + { + hypre_TFree(pdata.fem_rhsadd_ilowers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.fem_rhsadd_iuppers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.fem_rhsadd_values, HYPRE_MEMORY_HOST); + } + + data.pdata[part] = pdata; + } + + data.max_boxsize = 0; + for (part = 0; part < data.nparts; part++) + { + data.max_boxsize = + hypre_max(data.max_boxsize, data.pdata[part].max_boxsize); + } + + hypre_TFree(pool_procs, HYPRE_MEMORY_HOST); + + *data_ptr = data; + + return 0; +} + +/*-------------------------------------------------------------------------- + * Destroy data + *--------------------------------------------------------------------------*/ + +HYPRE_Int +DestroyData( ProblemData data ) +{ + ProblemPartData pdata; + HYPRE_Int part, box, s, i; + + for (part = 0; part < data.nparts; part++) + { + pdata = data.pdata[part]; + + if (pdata.nboxes > 0) + { + hypre_TFree(pdata.ilowers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.iuppers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.boxsizes, HYPRE_MEMORY_HOST); + } + + if (pdata.nvars > 0) + { + hypre_TFree(pdata.vartypes, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.stencil_num, HYPRE_MEMORY_HOST); + } + + if (pdata.add_nvars > 0) + { + hypre_TFree(pdata.add_indexes, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.add_vartypes, HYPRE_MEMORY_HOST); + } + + if (pdata.glue_nboxes > 0) + { + hypre_TFree(pdata.glue_shared, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.glue_ilowers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.glue_iuppers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.glue_offsets, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.glue_nbor_parts, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.glue_nbor_ilowers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.glue_nbor_iuppers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.glue_nbor_offsets, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.glue_index_maps, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.glue_index_dirs, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.glue_primaries, HYPRE_MEMORY_HOST); + } + + if (pdata.graph_nboxes > 0) + { + hypre_TFree(pdata.graph_ilowers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.graph_iuppers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.graph_strides, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.graph_vars, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.graph_to_parts, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.graph_to_ilowers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.graph_to_iuppers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.graph_to_strides, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.graph_to_vars, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.graph_index_maps, HYPRE_MEMORY_HOST); + 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.graph_boxsizes, HYPRE_MEMORY_HOST); + } + + if (pdata.matrix_num_centries > 0) + { + hypre_TFree(pdata.matrix_centries, HYPRE_MEMORY_HOST); + } + + if (pdata.matset_nboxes > 0) + { + hypre_TFree(pdata.matset_ilowers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.matset_iuppers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.matset_strides, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.matset_vars, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.matset_entries, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.matset_values, HYPRE_MEMORY_HOST); + } + + if (pdata.matadd_nboxes > 0) + { + hypre_TFree(pdata.matadd_ilowers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.matadd_iuppers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.matadd_vars, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.matadd_nentries, HYPRE_MEMORY_HOST); + for (box = 0; box < pdata.matadd_nboxes; box++) + { + hypre_TFree(pdata.matadd_entries[box], HYPRE_MEMORY_HOST); + hypre_TFree(pdata.matadd_values[box], HYPRE_MEMORY_HOST); + } + hypre_TFree(pdata.matadd_entries, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.matadd_values, HYPRE_MEMORY_HOST); + } + + if (pdata.fem_matadd_nboxes > 0) + { + hypre_TFree(pdata.fem_matadd_ilowers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.fem_matadd_iuppers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.fem_matadd_nrows, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.fem_matadd_ncols, HYPRE_MEMORY_HOST); + for (box = 0; box < pdata.fem_matadd_nboxes; box++) + { + hypre_TFree(pdata.fem_matadd_rows[box], HYPRE_MEMORY_HOST); + hypre_TFree(pdata.fem_matadd_cols[box], HYPRE_MEMORY_HOST); + hypre_TFree(pdata.fem_matadd_values[box], HYPRE_MEMORY_HOST); + } + hypre_TFree(pdata.fem_matadd_rows, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.fem_matadd_cols, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.fem_matadd_values, HYPRE_MEMORY_HOST); + } + + if (pdata.rhsadd_nboxes > 0) + { + hypre_TFree(pdata.rhsadd_ilowers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.rhsadd_iuppers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.rhsadd_vars, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.rhsadd_values, HYPRE_MEMORY_HOST); + } + + if (pdata.fem_rhsadd_nboxes > 0) + { + hypre_TFree(pdata.fem_rhsadd_ilowers, HYPRE_MEMORY_HOST); + hypre_TFree(pdata.fem_rhsadd_iuppers, HYPRE_MEMORY_HOST); + for (box = 0; box < pdata.fem_rhsadd_nboxes; box++) + { + hypre_TFree(pdata.fem_rhsadd_values[box], HYPRE_MEMORY_HOST); + } + hypre_TFree(pdata.fem_rhsadd_values, HYPRE_MEMORY_HOST); + } + } + hypre_TFree(data.pdata, HYPRE_MEMORY_HOST); + + if (data.nstencils > 0) + { + for (s = 0; s < data.nstencils; s++) + { + hypre_TFree(data.stencil_offsets[s], HYPRE_MEMORY_HOST); + hypre_TFree(data.stencil_vars[s], HYPRE_MEMORY_HOST); + hypre_TFree(data.stencil_values[s], HYPRE_MEMORY_HOST); + } + hypre_TFree(data.stencil_sizes, HYPRE_MEMORY_HOST); + hypre_TFree(data.stencil_offsets, HYPRE_MEMORY_HOST); + hypre_TFree(data.stencil_vars, HYPRE_MEMORY_HOST); + hypre_TFree(data.stencil_values, HYPRE_MEMORY_HOST); + } + + if (data.fem_nvars > 0) + { + for (s = 0; s < data.fem_nvars; s++) + { + hypre_TFree(data.fem_values_full[s], HYPRE_MEMORY_HOST); + hypre_TFree(data.fem_ivalues_full[s], HYPRE_MEMORY_HOST); + } + hypre_TFree(data.fem_offsets, HYPRE_MEMORY_HOST); + hypre_TFree(data.fem_vars, HYPRE_MEMORY_HOST); + hypre_TFree(data.fem_values_full, HYPRE_MEMORY_HOST); + hypre_TFree(data.fem_ivalues_full, HYPRE_MEMORY_HOST); + hypre_TFree(data.fem_ordering, HYPRE_MEMORY_HOST); + hypre_TFree(data.fem_sparsity, HYPRE_MEMORY_HOST); + hypre_TFree(data.fem_values, HYPRE_MEMORY_HOST); + } + + if (data.fem_rhs_true > 0) + { + hypre_TFree(data.fem_rhs_values, HYPRE_MEMORY_HOST); + } + + if (data.symmetric_num > 0) + { + hypre_TFree(data.symmetric_parts, HYPRE_MEMORY_HOST); + hypre_TFree(data.symmetric_vars, HYPRE_MEMORY_HOST); + hypre_TFree(data.symmetric_to_vars, HYPRE_MEMORY_HOST); + hypre_TFree(data.symmetric_booleans, HYPRE_MEMORY_HOST); + } + + for (i = 0; i < data.ndists; i++) + { + hypre_TFree(data.dist_pools[i], HYPRE_MEMORY_HOST); + } + hypre_TFree(data.dist_pools, HYPRE_MEMORY_HOST); + hypre_TFree(data.dist_npools, HYPRE_MEMORY_HOST); + + hypre_TFree(data.numghost, HYPRE_MEMORY_HOST); + + return 0; +} + +/*-------------------------------------------------------------------------- + * BuildGrid + *--------------------------------------------------------------------------*/ +HYPRE_Int +BuildGrid( MPI_Comm comm, + ProblemData data, + HYPRE_SStructGrid *grid_ptr ) +{ + HYPRE_SStructGrid grid; + + ProblemPartData pdata; + HYPRE_Int part, box; + + HYPRE_SStructGridCreate(comm, data.ndim, data.nparts, &grid); + + /* GridSetNumGhost */ + if (data.numghost != NULL) + { + HYPRE_SStructGridSetNumGhost(grid, data.numghost); + } + + for (part = 0; part < data.nparts; part++) + { + pdata = data.pdata[part]; + + /* GridSetExtents */ + for (box = 0; box < pdata.nboxes; box++) + { + HYPRE_SStructGridSetExtents(grid, part, pdata.ilowers[box], pdata.iuppers[box]); + } + + /* GridSetVariables */ + HYPRE_SStructGridSetVariables(grid, part, pdata.nvars, pdata.vartypes); + + /* GridAddVariabes */ + if (data.fem_nvars > 0) + { + HYPRE_SStructGridSetFEMOrdering(grid, part, data.fem_ordering); + } + + /* GridSetNeighborPart */ + for (box = 0; box < pdata.glue_nboxes; box++) + { + 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]); + } + + /* GridSetPeriodic */ + HYPRE_SStructGridSetPeriodic(grid, part, pdata.periodic); + } + + HYPRE_SStructGridAssemble(grid); + + *grid_ptr = grid; + + return 0; +} + +/*-------------------------------------------------------------------------- + * BuildStencils + *--------------------------------------------------------------------------*/ +HYPRE_Int +BuildStencils( ProblemData data, + HYPRE_SStructStencil **stencils_ptr ) +{ + HYPRE_SStructStencil *stencils; + HYPRE_Int s, e; + + 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 (e = 0; e < data.stencil_sizes[s]; e++) + { + HYPRE_SStructStencilSetEntry(stencils[s], e, + data.stencil_offsets[s][e], + data.stencil_vars[s][e]); + } + } + + *stencils_ptr = stencils; + + return 0; +} + +/*-------------------------------------------------------------------------- + * BuildGraph + *--------------------------------------------------------------------------*/ +HYPRE_Int +BuildGraph( MPI_Comm comm, + ProblemData data, + HYPRE_SStructGrid grid, + HYPRE_Int object_type, + HYPRE_SStructStencil *stencils, + HYPRE_SStructGraph *graph_ptr ) +{ + HYPRE_SStructGraph graph; + HYPRE_SStructGrid cgrid; + ProblemPartData pdata; + + Index index, to_index; + HYPRE_Int coarsen; + HYPRE_Index *coarsen_strides; + + HYPRE_Int part, var, box; + HYPRE_Int d, i, j, k; + + HYPRE_SStructGraphCreate(comm, grid, &graph); + 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]) + { + 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]; + to_index[j] = pdata.graph_to_ilowers[box][j]; + to_index[j] += k * pdata.graph_to_strides[box][j]; + } + HYPRE_SStructGraphAddEntries(graph, part, index, + pdata.graph_vars[box], + pdata.graph_to_parts[box], + to_index, + pdata.graph_to_vars[box]); + } + } + } + } + } + + /* Set domain grid for rectangular matrices */ + coarsen = 0; + coarsen_strides = hypre_CTAlloc(HYPRE_Index, data.nparts, HYPRE_MEMORY_HOST); + for (part = 0; part < data.nparts; part++) + { + pdata = data.pdata[part]; + + /* Determine the coarsening factor (the smaller stride between range and domain) */ + for (d = 0; d < data.ndim; d++) + { + coarsen_strides[part][d] = 1; + if (pdata.matrix_rstride[d] > pdata.matrix_dstride[d]) + { + for (; d < data.ndim; d++) + { + coarsen_strides[part][d] = pdata.matrix_rstride[d]; + } + coarsen = 1; + break; + } + else if (pdata.matrix_dstride[d] > pdata.matrix_rstride[d]) + { + for (; d < data.ndim; d++) + { + coarsen_strides[part][d] = pdata.matrix_dstride[d]; + } + coarsen = 1; + break; + } + } + } + + /* Domain grid is obtained by coarsening the range grid. + Note: this works only for tall-and-skinny matrices */ + if (coarsen) + { + HYPRE_SStructGridCoarsen(grid, + coarsen_strides, + &cgrid); + HYPRE_SStructGraphSetDomainGrid(graph, cgrid); + HYPRE_SStructGridDestroy(cgrid); + } + + HYPRE_SStructGraphAssemble(graph); + + hypre_TFree(coarsen_strides, HYPRE_MEMORY_HOST); + + *graph_ptr = graph; + + return 0; +} + +/*-------------------------------------------------------------------------- + * BuildMatrix + *--------------------------------------------------------------------------*/ +HYPRE_Int +BuildMatrix( MPI_Comm comm, + ProblemData data, + HYPRE_SStructGrid grid, + HYPRE_Int object_type, + HYPRE_SStructGraph graph, + HYPRE_SStructMatrix *A_ptr ) +{ + HYPRE_SStructMatrix A; + ProblemPartData pdata; + + HYPRE_Real *values; + HYPRE_Real *d_values; + HYPRE_Int values_size; + Index ilower, iupper; + Index origin, stride; + Index index; + + HYPRE_Int part, var, box; + HYPRE_Int d, i, j; + HYPRE_Int s, e; + HYPRE_Int size; + HYPRE_Int row, col; + + /*----------------------------------------------------------- + * Set up the matrix + *-----------------------------------------------------------*/ + + /* Set and allocate values buffer */ + values_size = 1; + values_size = hypre_max(values_size, data.fem_nvars * data.fem_nvars); + values_size = hypre_max(values_size, data.max_boxsize); + values_size = hypre_max(values_size, data.fem_nsparse); + for (part = 0; part < data.nparts; part++) + { + pdata = data.pdata[part]; + values_size = hypre_max(values_size, pdata.graph_nboxes); + } + + values = hypre_TAlloc(HYPRE_Real, values_size, HYPRE_MEMORY_HOST); + d_values = hypre_TAlloc(HYPRE_Real, values_size, HYPRE_MEMORY_DEVICE); + + HYPRE_SStructMatrixCreate(comm, graph, &A); + HYPRE_SStructMatrixSetObjectType(A, object_type); + + 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); + + for (part = 0; part < data.nparts; part++) + { + pdata = data.pdata[part]; + + HYPRE_SStructMatrixSetDomainStride(A, part, pdata.matrix_dstride); + HYPRE_SStructMatrixSetRangeStride(A, part, pdata.matrix_rstride); + HYPRE_SStructMatrixSetConstantEntries(A, part, -1, -1, + pdata.matrix_num_centries, + pdata.matrix_centries); + } + + HYPRE_SStructMatrixInitialize(A); + + 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++) + { + s = pdata.stencil_num[var]; + for (i = 0; i < data.stencil_sizes[s]; i++) + { + for (d = 0; d < data.ndim; d++) + { + if (pdata.matrix_dstride[d] > 1) + { + origin[d] = -data.stencil_offsets[s][i][d]; + stride[d] = pdata.matrix_dstride[d]; + } + else + { + origin[d] = 0; + stride[d] = pdata.matrix_rstride[d]; + } + } + + for (j = 0; j < pdata.max_boxsize; j++) + { + values[j] = data.stencil_values[s][i]; + } + + hypre_TMemcpy(d_values, values, HYPRE_Real, pdata.max_boxsize, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + + for (box = 0; box < pdata.nboxes; box++) + { + HYPRE_SStructGridGetVariableBox(grid, part, var, + pdata.ilowers[box], + pdata.iuppers[box], + ilower, iupper); + HYPRE_SStructGridProjectBox(grid, ilower, iupper, origin, stride); + HYPRE_SStructMatrixSetBoxValues(A, part, ilower, iupper, + var, 1, &i, d_values); + } + } + } + } + } + else if (data.fem_nvars > 0) + { + hypre_TMemcpy(d_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++) + { + 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, d_values); + } + } + } + } + } + } + + /* GraphAddEntries: set non-stencil entries */ + for (part = 0; part < data.nparts; part++) + { + pdata = data.pdata[part]; + + hypre_TMemcpy(d_values, pdata.graph_values, + HYPRE_Real, pdata.graph_nboxes, + HYPRE_MEMORY_DEVICE, 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); + */ + + /* 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_TMemcpy(d_values, values, + HYPRE_Real, pdata.graph_boxsizes[box], + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + + HYPRE_SStructMatrixSetBoxValues(A, part, + pdata.graph_ilowers[box], + pdata.graph_iuppers[box], + pdata.graph_vars[box], + 1, &pdata.graph_entries[box], + d_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[1] = pdata.graph_ilowers[box][1]; + index[1] <= pdata.graph_iuppers[box][1]; + index[1] += pdata.graph_strides[box][1]) + { + 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], + &d_values[box]); + } + } + } +#endif + } + } + + /* 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 = BoxVolume(pdata.matset_ilowers[box], pdata.matset_iuppers[box]); + for (j = 0; j < size; j++) + { + values[j] = pdata.matset_values[box]; + } + + hypre_TMemcpy(d_values, values, HYPRE_Real, 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); + } + } + + /* 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++) + { + size = BoxVolume(pdata.matadd_ilowers[box], pdata.matadd_iuppers[box]); + + for (e = 0; e < pdata.matadd_nentries[box]; e++) + { + for (j = 0; j < size; j++) + { + values[j] = pdata.matadd_values[box][e]; + } + + hypre_TMemcpy(d_values, values, HYPRE_Real, 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][e], + 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++) + { + 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, data.fem_nsparse, + HYPRE_MEMORY_DEVICE, 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); + } + } + } + } + } + + HYPRE_SStructMatrixAssemble(A); + + /*----------------------------------------------------------- + * Free memory + *-----------------------------------------------------------*/ + hypre_TFree(values, HYPRE_MEMORY_HOST); + hypre_TFree(d_values, HYPRE_MEMORY_DEVICE); + + *A_ptr = A; + + return 0; +} + +/*-------------------------------------------------------------------------- + * BuildVector + *--------------------------------------------------------------------------*/ +HYPRE_Int +BuildVector( MPI_Comm comm, + ProblemData data, + HYPRE_SStructGrid grid, + HYPRE_Int object_type, + HYPRE_Real rhs_value, + HYPRE_SStructVector *vec_ptr ) +{ + HYPRE_SStructVector vec; + ProblemPartData pdata; + + Index ilower, iupper; + Index index; + + HYPRE_Real *values; + HYPRE_Real *d_values; + HYPRE_Int values_size; + HYPRE_Int j, part, var, box; + HYPRE_Int size; + + /* Allocate work data */ + values_size = 1; + values_size = hypre_max(values_size, data.max_boxsize); + values_size = hypre_max(values_size, data.fem_nvars); + values = hypre_TAlloc(HYPRE_Real, values_size, HYPRE_MEMORY_HOST); + d_values = hypre_TAlloc(HYPRE_Real, values_size, HYPRE_MEMORY_DEVICE); + + HYPRE_SStructVectorCreate(comm, grid, &vec); + HYPRE_SStructVectorSetObjectType(vec, object_type); + HYPRE_SStructVectorInitialize(vec); + + /* 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_value is the default */ + { + for (j = 0; j < data.max_boxsize; j++) + { + values[j] = rhs_value; + } + } + + hypre_TMemcpy(d_values, values, HYPRE_Real, data.max_boxsize, + HYPRE_MEMORY_DEVICE, 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++) + { + HYPRE_SStructGridGetVariableBox(grid, part, var, + pdata.ilowers[box], + pdata.iuppers[box], + ilower, iupper); + HYPRE_SStructVectorSetBoxValues(vec, part, ilower, iupper, + var, d_values); + } + } + } + + /* Add values for FEMRhsSet */ + if (data.fem_rhs_true) + { + hypre_TMemcpy(d_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++) + { + 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(vec, part, index, d_values); + } + } + } + } + } + } + + /* 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 = BoxVolume(pdata.rhsadd_ilowers[box], pdata.rhsadd_iuppers[box]); + for (j = 0; j < size; j++) + { + values[j] = pdata.rhsadd_values[box]; + } + + hypre_TMemcpy(d_values, values, HYPRE_Real, size, + HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + + HYPRE_SStructVectorAddToBoxValues(vec, part, + pdata.rhsadd_ilowers[box], + pdata.rhsadd_iuppers[box], + pdata.rhsadd_vars[box], d_values); + } + } + + /* 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++) + { + hypre_TMemcpy(d_values, pdata.fem_rhsadd_values[box], HYPRE_Real, + data.fem_nvars, HYPRE_MEMORY_DEVICE, HYPRE_MEMORY_HOST); + + for (index[2] = pdata.fem_rhsadd_ilowers[box][2]; + index[2] <= pdata.fem_rhsadd_iuppers[box][2]; index[2]++) + { + for (index[1] = pdata.fem_rhsadd_ilowers[box][1]; + index[1] <= pdata.fem_rhsadd_iuppers[box][1]; index[1]++) + { + for (index[0] = pdata.fem_rhsadd_ilowers[box][0]; + index[0] <= pdata.fem_rhsadd_iuppers[box][0]; index[0]++) + { + HYPRE_SStructVectorAddFEMValues(vec, part, index, d_values); + } + } + } + } + } + + HYPRE_SStructVectorAssemble(vec); + + /*----------------------------------------------------------- + * Free memory + *-----------------------------------------------------------*/ + hypre_TFree(values, HYPRE_MEMORY_HOST); + hypre_TFree(d_values, HYPRE_MEMORY_DEVICE); + + *vec_ptr = vec; + + return 0; +} + +/*-------------------------------------------------------------------------- + * SetCosineVector + *--------------------------------------------------------------------------*/ + +HYPRE_Int +SetCosineVector( HYPRE_Real scale, + Index ilower, + Index iupper, + HYPRE_Real *values ) +{ + HYPRE_Int i, j, k; + HYPRE_Int count = 0; + + for (k = ilower[2]; k <= iupper[2]; k++) + { + for (j = ilower[1]; j <= iupper[1]; j++) + { + for (i = ilower[0]; i <= iupper[0]; i++) + { + values[count] = scale * cos((i + j + k) / 10.0); + count++; + } + } + } + + return 0; +} diff --git a/src/test/sstruct_helpers.h b/src/test/sstruct_helpers.h new file mode 100644 index 0000000000..c14253d651 --- /dev/null +++ b/src/test/sstruct_helpers.h @@ -0,0 +1,244 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_SSTRUCT_HELPERS_HEADER +#define hypre_SSTRUCT_HELPERS_HEADER + +#include "HYPRE_utilities.h" +#include "_hypre_utilities.h" +#include "HYPRE_sstruct_mv.h" +#include + +typedef HYPRE_Int Index[3]; +typedef HYPRE_Int ProblemIndex[9]; + +/*------------------------------------------------------------ + * ProblemIndex: + * + * The index has extra information stored in entries 3-8 that + * determine how the index gets "mapped" to finer index spaces. + * + * NOTE: For implementation convenience, the index is "pre-shifted" + * according to the values in entries 6,7,8. The following discussion + * describes how "un-shifted" indexes are mapped, because that is a + * more natural way to think about this mapping problem, and because + * that is the convention used in the input file for this code. The + * reason that pre-shifting is convenient is because it makes the true + * value of the index on the unrefined index space readily available + * in entries 0-2, hence, all operations on that unrefined space are + * straightforward. Also, the only time that the extra mapping + * information is needed is when an index is mapped to a new refined + * index space, allowing us to isolate the mapping details to the + * routine MapProblemIndex. The only other effected routine is + * SScanProblemIndex, which takes the user input and pre-shifts it. + * + * - Entries 3,4,5 have values of either 0 or 1 that indicate + * whether to map an index "to the left" or "to the right". + * Here is a 1D diagram: + * + * -- | * | unrefined index space + * | + * --> | * | . | * | refined index space (factor = 3) + * 0 1 + * + * The '*' index on the unrefined index space gets mapped to one of + * the '*' indexes on the refined space based on the value (0 or 1) + * of the relevent entry (3,4, or 5). The actual mapping formula is + * as follows (with refinement factor, r): + * + * mapped_index[i] = r*index[i] + (r-1)*index[i+3] + * + * - Entries 6,7,8 contain "shift" information. The shift is + * simply added to the mapped index just described. So, the + * complete mapping formula is as follows: + * + * mapped_index[i] = r*index[i] + (r-1)*index[i+3] + index[i+6] + * + *------------------------------------------------------------*/ + +typedef struct +{ + /* for GridSetExtents */ + HYPRE_Int nboxes; + ProblemIndex *ilowers; + ProblemIndex *iuppers; + HYPRE_Int *boxsizes; + HYPRE_Int max_boxsize; + + /* for GridSetVariables */ + HYPRE_Int nvars; + HYPRE_SStructVariable *vartypes; + + /* for GridAddVariables */ + HYPRE_Int add_nvars; + ProblemIndex *add_indexes; + HYPRE_SStructVariable *add_vartypes; + + /* for GridSetNeighborPart and GridSetSharedPart */ + HYPRE_Int glue_nboxes; + HYPRE_Int *glue_shared; + ProblemIndex *glue_ilowers; + ProblemIndex *glue_iuppers; + Index *glue_offsets; + HYPRE_Int *glue_nbor_parts; + ProblemIndex *glue_nbor_ilowers; + ProblemIndex *glue_nbor_iuppers; + Index *glue_nbor_offsets; + Index *glue_index_maps; + Index *glue_index_dirs; + HYPRE_Int *glue_primaries; + + /* for GraphSetStencil */ + HYPRE_Int *stencil_num; + + /* for GraphAddEntries */ + HYPRE_Int graph_nboxes; + ProblemIndex *graph_ilowers; + ProblemIndex *graph_iuppers; + Index *graph_strides; + HYPRE_Int *graph_vars; + HYPRE_Int *graph_to_parts; + ProblemIndex *graph_to_ilowers; + ProblemIndex *graph_to_iuppers; + Index *graph_to_strides; + HYPRE_Int *graph_to_vars; + Index *graph_index_maps; + Index *graph_index_signs; + HYPRE_Int *graph_entries; + HYPRE_Real *graph_values; + HYPRE_Int *graph_boxsizes; + + /* Matrix Properties */ + Index matrix_dstride; + Index matrix_rstride; + HYPRE_Int matrix_num_centries; + HYPRE_Int *matrix_centries; + + /* MatrixSetValues */ + HYPRE_Int matset_nboxes; + ProblemIndex *matset_ilowers; + ProblemIndex *matset_iuppers; + Index *matset_strides; + HYPRE_Int *matset_vars; + HYPRE_Int *matset_entries; + HYPRE_Real *matset_values; + + /* MatrixAddToValues */ + HYPRE_Int matadd_nboxes; + ProblemIndex *matadd_ilowers; + ProblemIndex *matadd_iuppers; + HYPRE_Int *matadd_vars; + HYPRE_Int *matadd_nentries; + HYPRE_Int **matadd_entries; + HYPRE_Real **matadd_values; + + /* FEMMatrixAddToValues */ + HYPRE_Int fem_matadd_nboxes; + ProblemIndex *fem_matadd_ilowers; + ProblemIndex *fem_matadd_iuppers; + HYPRE_Int *fem_matadd_nrows; + HYPRE_Int **fem_matadd_rows; + HYPRE_Int *fem_matadd_ncols; + HYPRE_Int **fem_matadd_cols; + HYPRE_Real **fem_matadd_values; + + /* RhsAddToValues */ + HYPRE_Int rhsadd_nboxes; + ProblemIndex *rhsadd_ilowers; + ProblemIndex *rhsadd_iuppers; + HYPRE_Int *rhsadd_vars; + HYPRE_Real *rhsadd_values; + + /* FEMRhsAddToValues */ + HYPRE_Int fem_rhsadd_nboxes; + ProblemIndex *fem_rhsadd_ilowers; + ProblemIndex *fem_rhsadd_iuppers; + HYPRE_Real **fem_rhsadd_values; + + Index periodic; + +} ProblemPartData; + +typedef struct +{ + HYPRE_Int ndim; + HYPRE_Int nparts; + ProblemPartData *pdata; + HYPRE_Int max_boxsize; + + /* for GridSetNumGhost */ + HYPRE_Int *numghost; + + HYPRE_Int nstencils; + HYPRE_Int *stencil_sizes; + Index **stencil_offsets; + HYPRE_Int **stencil_vars; + HYPRE_Real **stencil_values; + + HYPRE_Int rhs_true; + HYPRE_Real rhs_value; + + HYPRE_Int fem_nvars; + Index *fem_offsets; + HYPRE_Int *fem_vars; + HYPRE_Real **fem_values_full; + HYPRE_Int **fem_ivalues_full; + HYPRE_Int *fem_ordering; /* same info as vars/offsets */ + HYPRE_Int fem_nsparse; /* number of nonzeros in values_full */ + HYPRE_Int *fem_sparsity; /* nonzeros in values_full */ + HYPRE_Real *fem_values; /* nonzero values in values_full */ + + HYPRE_Int fem_rhs_true; + HYPRE_Real *fem_rhs_values; + + HYPRE_Int symmetric_num; + HYPRE_Int *symmetric_parts; + HYPRE_Int *symmetric_vars; + HYPRE_Int *symmetric_to_vars; + HYPRE_Int *symmetric_booleans; + + HYPRE_Int ns_symmetric; + + HYPRE_Int npools; + HYPRE_Int *pools; /* array of size nparts */ + HYPRE_Int ndists; /* number of (pool) distributions */ + HYPRE_Int *dist_npools; + HYPRE_Int **dist_pools; + +} ProblemData; + +/* Function prototypes */ +HYPRE_Int BoxVolume( Index ilower, Index iupper ); +HYPRE_Int GetVariableBox( Index cell_ilower, Index cell_iupper, HYPRE_Int vartype, Index var_ilower, + Index var_iupper ); +HYPRE_Int SScanIntArray ( char *sdata_ptr, char **sdata_ptr_ptr, HYPRE_Int size, HYPRE_Int *array ); +HYPRE_Int SScanDblArray ( char *sdata_ptr, char **sdata_ptr_ptr, HYPRE_Int size, + HYPRE_Real *array ); +HYPRE_Int SScanProblemIndex ( char *sdata_ptr, char **sdata_ptr_ptr, HYPRE_Int ndim, + ProblemIndex index ); +HYPRE_Int ReadData ( MPI_Comm comm, char *filename, ProblemData *data_ptr ); +HYPRE_Int DistributeData ( MPI_Comm comm, ProblemData global_data, HYPRE_Int pooldist, + Index *refine, Index *distribute, Index *block, ProblemData *data_ptr ); +HYPRE_Int MapProblemIndex ( ProblemIndex index, Index m ); +HYPRE_Int IntersectBoxes ( ProblemIndex ilower1, ProblemIndex iupper1, ProblemIndex ilower2, + ProblemIndex iupper2, ProblemIndex int_ilower, ProblemIndex int_iupper ); +HYPRE_Int DestroyData ( ProblemData data ); +HYPRE_Int BuildGrid ( MPI_Comm comm, ProblemData data, HYPRE_SStructGrid *grid_ptr ); +HYPRE_Int BuildStencils ( ProblemData data, + HYPRE_SStructStencil **stencils_ptr ); +HYPRE_Int BuildGraph ( MPI_Comm comm, ProblemData data, HYPRE_SStructGrid grid, + HYPRE_Int object_type, HYPRE_SStructStencil *stencils, + HYPRE_SStructGraph *graph_ptr ); +HYPRE_Int BuildMatrix ( MPI_Comm comm, ProblemData data, HYPRE_SStructGrid grid, + HYPRE_Int object_type, HYPRE_SStructGraph graph, + HYPRE_SStructMatrix *A_ptr ); +HYPRE_Int BuildVector ( MPI_Comm comm, ProblemData data, HYPRE_SStructGrid grid, + HYPRE_Int object_type, HYPRE_Real rhs_value, + HYPRE_SStructVector *vec_ptr ); +HYPRE_Int SetCosineVector ( HYPRE_Real scale, Index ilower, Index iupper, HYPRE_Real *values ); + +#endif diff --git a/src/test/sstructmat.c b/src/test/sstructmat.c new file mode 100644 index 0000000000..00e8d31f2c --- /dev/null +++ b/src/test/sstructmat.c @@ -0,0 +1,496 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 "sstruct_helpers.h" +#include "_hypre_sstruct_mv.h" + +/* Tests prototypes */ +HYPRE_Int test_SStructMatmult( HYPRE_Int nmatrices, HYPRE_SStructMatrix *ss_A, HYPRE_IJMatrix *ij_A, + HYPRE_Int nterms, HYPRE_Int *terms, HYPRE_Int *trans, HYPRE_Int print ); + +/*-------------------------------------------------------------------------- + * Print usage info + *--------------------------------------------------------------------------*/ + +HYPRE_Int +PrintUsage( char *progname, + HYPRE_Int myid ) +{ + if ( myid == 0 ) + { + hypre_printf("\n"); + hypre_printf("Usage: %s [-in ] []\n", progname); + hypre_printf("\n"); + hypre_printf(" -in : input file(s) \n"); + hypre_printf("\n"); + hypre_printf(" -pt ... : set part(s) for subsequent options\n"); + hypre_printf(" -pooldist

... : pool distribution to use\n"); + hypre_printf(" -P ... : refine and distribute part(s)\n"); + hypre_printf(" -r ... : refine part(s)\n"); + hypre_printf(" -b ... : refine and block part(s)\n"); + hypre_printf("\n"); + hypre_printf(" -mat-vec : compute A*x + y\n"); + hypre_printf(" -matTvec : compute A^T*x + y\n"); + hypre_printf(" -ab : alpha/beta values for matvec (default = 1)\n"); + hypre_printf("\n"); + hypre_printf(" -mat-mat [T] [T] ... : compute A*B*... or A^T*B*..., etc. \n"); + hypre_printf(" : for n possibly transposed matrices \n"); + hypre_printf(" : example P^T*A*P: -mat-mat 3 1T 0 1 \n"); + hypre_printf("\n"); + } + + return 0; +} + +/*-------------------------------------------------------------------------- + * Test driver for semi-structured matrix interface + *--------------------------------------------------------------------------*/ + +hypre_int +main( hypre_int argc, + char *argv[] ) +{ + MPI_Comm comm = hypre_MPI_COMM_WORLD; + + char **infile; + ProblemData *global_data; + ProblemData *data; + HYPRE_Int nmatrices; + + HYPRE_SStructGrid *grid; + HYPRE_SStructStencil **stencils; + HYPRE_SStructGraph *graph; + HYPRE_SStructMatrix *ss_A; + HYPRE_IJMatrix *ij_A; + + /* Driver options */ + HYPRE_Int nparts; + HYPRE_Int pooldist; + HYPRE_Int *parts; + Index *refine; + Index *distribute; + Index *block; + HYPRE_Int print; + HYPRE_Int nterms = 0; + HYPRE_Int *terms = NULL; + HYPRE_Int *trans = NULL; + + /* Local variables */ + HYPRE_Int myid, nprocs; + HYPRE_Int arg_index; + HYPRE_Int time_index; + HYPRE_Int i, j, k, s, part; + HYPRE_Int do_matmult; + HYPRE_Int ierr; + char infile_default[50] = "sstruct.in.cubes4_7pt"; + char matname[64]; + char heading[64]; + char transposechar; + + /*----------------------------------------------------------- + * Initialize libraries + *-----------------------------------------------------------*/ + + /* Initialize MPI */ + hypre_MPI_Init(&argc, &argv); + hypre_MPI_Comm_size(comm, &nprocs); + hypre_MPI_Comm_rank(comm, &myid); + + /* GPU Device binding - Must be done before HYPRE_Init() */ + hypre_bind_device(myid, nprocs, comm); + + /* Initialize hypre */ + HYPRE_Initialize(); + HYPRE_DeviceInitialize(); + + /* Initialize some input parameters */ + nmatrices = 1; + infile = hypre_TAlloc(char *, nmatrices, HYPRE_MEMORY_HOST); + infile[0] = infile_default; + + /*----------------------------------------------------------- + * Read input file + *-----------------------------------------------------------*/ + arg_index = 1; + if (argc > 1) + { + if ( strcmp(argv[arg_index], "-in") == 0 ) + { + arg_index++; + nmatrices = atoi(argv[arg_index++]); + infile = hypre_TReAlloc(infile, char *, nmatrices, HYPRE_MEMORY_HOST); + + for (i = 0; i < nmatrices; i++) + { + infile[i] = argv[arg_index++]; + } + } + else if ( strcmp(argv[arg_index], "-help") == 0 || + strcmp(argv[arg_index], "-h") == 0 ) + { + PrintUsage(argv[0], myid); + exit(1); + } + else + { + if (!myid) + { + hypre_printf("First command line argument must be the input file(s).\n"); + exit(1); + } + } + } + + /*----------------------------------------------------------- + * Read data from input file + *-----------------------------------------------------------*/ + global_data = hypre_TAlloc(ProblemData, nmatrices, HYPRE_MEMORY_HOST); + for (i = 0; i < nmatrices; i++) + { + ReadData(comm, infile[i], &global_data[i]); + } + nparts = global_data[0].nparts; + + /* Allocate and initialize data */ + data = hypre_TAlloc(ProblemData, nmatrices, HYPRE_MEMORY_HOST); + + grid = hypre_TAlloc(HYPRE_SStructGrid, nmatrices, HYPRE_MEMORY_HOST); + graph = hypre_TAlloc(HYPRE_SStructGraph, nmatrices, HYPRE_MEMORY_HOST); + stencils = hypre_TAlloc(HYPRE_SStructStencil *, nmatrices, HYPRE_MEMORY_HOST); + ss_A = hypre_TAlloc(HYPRE_SStructMatrix, nmatrices, HYPRE_MEMORY_HOST); + ij_A = hypre_TAlloc(HYPRE_IJMatrix, nmatrices, HYPRE_MEMORY_HOST); + + parts = hypre_TAlloc(HYPRE_Int, nparts, HYPRE_MEMORY_HOST); + block = hypre_TAlloc(Index, nparts, HYPRE_MEMORY_HOST); + refine = hypre_TAlloc(Index, nparts, HYPRE_MEMORY_HOST); + distribute = hypre_TAlloc(Index, nparts, HYPRE_MEMORY_HOST); + for (part = 0; part < nparts; part++) + { + parts[part] = part; + for (j = 0; j < HYPRE_MAXDIM; j++) + { + block[part][j] = 1; + refine[part][j] = 1; + distribute[part][j] = 1; + } + } + + /* Initialize input arguments */ + pooldist = 0; + print = 0; + do_matmult = 0; + + /*----------------------------------------------------------- + * Parse other command line options + *-----------------------------------------------------------*/ + while (arg_index < argc) + { + if ( strcmp(argv[arg_index], "-pt") == 0 ) + { + arg_index++; + nparts = 0; + while ( strncmp(argv[arg_index], "-", 1) != 0 ) + { + parts[nparts++] = atoi(argv[arg_index++]); + } + } + else if ( strcmp(argv[arg_index], "-pooldist") == 0 ) + { + arg_index++; + pooldist = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-r") == 0 ) + { + arg_index++; + for (i = 0; i < nparts; i++) + { + part = parts[i]; + k = arg_index; + for (j = 0; j < HYPRE_MAXDIM; j++) + { + refine[part][j] = atoi(argv[k++]); + } + } + arg_index += HYPRE_MAXDIM; + } + else if ( strcmp(argv[arg_index], "-P") == 0 ) + { + arg_index++; + for (i = 0; i < nparts; i++) + { + part = parts[i]; + k = arg_index; + for (j = 0; j < HYPRE_MAXDIM; j++) + { + distribute[part][j] = atoi(argv[k++]); + } + } + arg_index += HYPRE_MAXDIM; + } + else if ( strcmp(argv[arg_index], "-b") == 0 ) + { + arg_index++; + for (i = 0; i < nparts; i++) + { + part = parts[i]; + k = arg_index; + for (j = 0; j < HYPRE_MAXDIM; j++) + { + block[part][j] = atoi(argv[k++]); + } + } + arg_index += HYPRE_MAXDIM; + } + else if ( strcmp(argv[arg_index], "-print") == 0 ) + { + arg_index++; + print = 1; + } + else if ( strcmp(argv[arg_index], "-mat-mat") == 0 ) + { + arg_index++; + do_matmult = 1; + nterms = atoi(argv[arg_index++]); + terms = hypre_CTAlloc(HYPRE_Int, nterms, HYPRE_MEMORY_HOST); + trans = hypre_CTAlloc(HYPRE_Int, nterms, HYPRE_MEMORY_HOST); + for (i = 0; i < nterms; i++) + { + transposechar = ' '; + hypre_sscanf(argv[arg_index++], "%d%c", &terms[i], &transposechar); + if (transposechar == 'T') + { + trans[i] = 1; + } + } + } + } /* while (arg_index < argc) */ + + /*----------------------------------------------------------- + * Distribute data + *-----------------------------------------------------------*/ + for (i = 0; i < nmatrices; i++) + { + DistributeData(comm, global_data[i], pooldist, refine, + distribute, block, &data[i]); + } + + /*----------------------------------------------------------- + * Synchronize so that timings make sense + *-----------------------------------------------------------*/ + + hypre_MPI_Barrier(comm); + + /*----------------------------------------------------------- + * Set up semi-structured matrices + *-----------------------------------------------------------*/ + for (i = 0; i < nmatrices; i++) + { + hypre_sprintf(heading, "Build matrix #%d", i); + time_index = hypre_InitializeTiming(heading); + hypre_BeginTiming(time_index); + + BuildGrid(comm, data[i], &grid[i]); + BuildStencils(data[i], &stencils[i]); + BuildGraph(comm, data[i], grid[i], HYPRE_SSTRUCT, stencils[i], &graph[i]); + BuildMatrix(comm, data[i], grid[i], HYPRE_SSTRUCT, graph[i], &ss_A[i]); + + hypre_EndTiming(time_index); + hypre_PrintTiming(heading, hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + /* Convert to IJMatrix */ + HYPRE_SStructMatrixToIJMatrix(ss_A[i], 0, &ij_A[i]); + + if (print) + { + hypre_sprintf(matname, "sstruct.out.mat%02d", i); + HYPRE_SStructMatrixPrint(matname, ss_A[i], 0); + + hypre_sprintf(matname, "ij.out.mat%02d", i); + HYPRE_IJMatrixPrint(ij_A[i], matname); + } + } + + /*----------------------------------------------------------- + * Matrix-matrix multiply + *-----------------------------------------------------------*/ + + if (do_matmult) + { + /* Sanity check */ + if (nterms < 2) + { + if (!myid) + { + hypre_printf("Need at least 2 terms for performing matrix/matrix product!\n"); + } + } + else + { + hypre_MPI_Barrier(hypre_MPI_COMM_WORLD); + time_index = hypre_InitializeTiming("test_SStructMatmult"); + hypre_BeginTiming(time_index); + + ierr = test_SStructMatmult(nmatrices, ss_A, ij_A, nterms, terms, trans, print); + if (ierr) + { + hypre_printf("[test_SStructMatmult]: failed!\n\n"); + } + else + { + hypre_printf("[test_SStructMatmult]: passed!\n\n"); + } + + hypre_EndTiming(time_index); + hypre_PrintTiming("test_SStructMatmult", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + } + } + + + /*----------------------------------------------------------- + * Free memory + *-----------------------------------------------------------*/ + for (i = 0; i < nmatrices; i++) + { + for (s = 0; s < data[i].nstencils; s++) + { + HYPRE_SStructStencilDestroy(stencils[i][s]); + } + hypre_TFree(stencils[i], HYPRE_MEMORY_HOST); + HYPRE_SStructGridDestroy(grid[i]); + HYPRE_SStructGraphDestroy(graph[i]); + HYPRE_SStructMatrixDestroy(ss_A[i]); + HYPRE_IJMatrixDestroy(ij_A[i]); + } + hypre_TFree(stencils, HYPRE_MEMORY_HOST); + hypre_TFree(grid, HYPRE_MEMORY_HOST); + hypre_TFree(graph, HYPRE_MEMORY_HOST); + hypre_TFree(ss_A, HYPRE_MEMORY_HOST); + hypre_TFree(ij_A, HYPRE_MEMORY_HOST); + + for (i = 0; i < nmatrices; i++) + { + DestroyData(data[i]); + } + hypre_TFree(data, HYPRE_MEMORY_HOST); + hypre_TFree(global_data, HYPRE_MEMORY_HOST); + hypre_TFree(parts, HYPRE_MEMORY_HOST); + hypre_TFree(block, HYPRE_MEMORY_HOST); + hypre_TFree(refine, HYPRE_MEMORY_HOST); + hypre_TFree(distribute, HYPRE_MEMORY_HOST); + hypre_TFree(terms, HYPRE_MEMORY_HOST); + hypre_TFree(trans, HYPRE_MEMORY_HOST); + hypre_TFree(infile, HYPRE_MEMORY_HOST); + + /*----------------------------------------------------------- + * Finalize libraries + *-----------------------------------------------------------*/ + HYPRE_Finalize(); + hypre_MPI_Finalize(); + + return 0; +} + +HYPRE_Int +test_SStructMatmult( HYPRE_Int nmatrices, + HYPRE_SStructMatrix *ss_A, + HYPRE_IJMatrix *ij_A, + HYPRE_Int nterms, + HYPRE_Int *terms, + HYPRE_Int *trans, + HYPRE_Int print ) +{ + MPI_Comm comm = hypre_SStructMatrixComm(ss_A[0]); + + HYPRE_SStructMatrix ss_M; + HYPRE_IJMatrix ij_M; + HYPRE_ParCSRMatrix par_A[3]; + HYPRE_ParCSRMatrix par_E; + HYPRE_ParCSRMatrix par_M; + + HYPRE_Int m, t; + HYPRE_Complex alpha = 1.0; + HYPRE_Complex beta = -1.0; + HYPRE_Int myid; + HYPRE_Real norm_M, norm_E; + HYPRE_Int ierr = 0; + + hypre_MPI_Comm_rank(comm, &myid); + + /* Compute semi-structured matrices product */ + hypre_SStructMatmult(nmatrices, ss_A, nterms, terms, trans, &ss_M); + HYPRE_SStructMatrixToIJMatrix(ss_M, 0, &ij_M); + + /* Compute IJ matrices product */ + m = terms[nterms - 1]; + HYPRE_IJMatrixGetObject(ij_A[m], (void **) &par_A[0]); + for (t = (nterms - 2); t >= 0; t--) + { + m = terms[t]; + HYPRE_IJMatrixGetObject(ij_A[m], (void **) &par_A[1]); + + if (trans[t]) + { + par_A[2] = hypre_ParTMatmul(par_A[1], par_A[0]); + } + else + { + par_A[2] = hypre_ParMatmul(par_A[1], par_A[0]); + } + + /* Free temporary work matrix */ + if (t < (nterms - 2)) + { + HYPRE_ParCSRMatrixDestroy(par_A[0]); + } + + /* Update pointers */ + par_A[0] = par_A[2]; + } + + /* Move diagonal coefficients to first positions */ + hypre_ParCSRMatrixReorder(par_A[0]); + + /* Compute error */ + HYPRE_IJMatrixGetObject(ij_M, (void **) &par_M); + hypre_ParCSRMatrixAdd(alpha, par_A[0], beta, par_M, &par_E); + hypre_ParCSRMatrixInfNorm(par_M, &norm_M); + hypre_ParCSRMatrixInfNorm(par_E, &norm_E); + + if (!myid) + { + hypre_printf("[test_SStructMatmult]: Error norm = %e\n", norm_E); + if (norm_E > HYPRE_REAL_EPSILON * norm_M) + { + ierr = 1; + + if (print) + { + hypre_ParCSRMatrixPrintIJ(par_M, 0, 0, "par_Mss"); + hypre_ParCSRMatrixPrintIJ(par_A[0], 0, 0, "par_Mij"); + hypre_ParCSRMatrixPrintIJ(par_E, 0, 0, "par_E"); + } + } + } + + if (print) + { + HYPRE_SStructMatrixPrint("sstruct.out.M", ss_M, 0); + HYPRE_IJMatrixPrint(ij_M, "ij.out.M"); + } + + /* Free memory */ + HYPRE_ParCSRMatrixDestroy(par_A[0]); + HYPRE_ParCSRMatrixDestroy(par_E); + HYPRE_IJMatrixDestroy(ij_M); + HYPRE_SStructMatrixDestroy(ss_M); + + return ierr; +} diff --git a/src/test/struct.c b/src/test/struct.c index 5968fb249e..0f25792dc6 100644 --- a/src/test/struct.c +++ b/src/test/struct.c @@ -21,10 +21,6 @@ /* RDF: Why is this include here? */ #include "_hypre_struct_mv.h" -#ifdef HYPRE_DEBUG -/*#include */ -#endif - /* begin lobpcg */ #define NO_SOLVER -9198 @@ -32,23 +28,32 @@ #include #include "HYPRE_lobpcg.h" +#include "_hypre_lobpcg.h" /* end lobpcg */ -HYPRE_Int SetStencilBndry(HYPRE_StructMatrix A, HYPRE_StructGrid gridmatrix, HYPRE_Int* period); - -HYPRE_Int AddValuesMatrix(HYPRE_StructMatrix A, HYPRE_StructGrid gridmatrix, - HYPRE_Real cx, - HYPRE_Real cy, - HYPRE_Real cz, - HYPRE_Real conx, - HYPRE_Real cony, - HYPRE_Real conz) ; - -HYPRE_Int AddValuesVector( hypre_StructGrid *gridvector, - hypre_StructVector *zvector, - HYPRE_Int *period, - HYPRE_Real value ) ; +HYPRE_Int SetStencilOffsets_1dim_3pt(HYPRE_Int ***offsets_ptr); +HYPRE_Int SetStencilOffsets_2dim_5pt(HYPRE_Int ***offsets_ptr); +HYPRE_Int SetStencilOffsets_3dim_7pt(HYPRE_Int ***offsets_ptr); +HYPRE_Int SetStencilOffsets_3dim_27pt(HYPRE_Int ***offsets_ptr); +HYPRE_Int SetStencilOffsets_1dim_3pt_sym(HYPRE_Int ***offsets_ptr); +HYPRE_Int SetStencilOffsets_2dim_5pt_sym(HYPRE_Int ***offsets_ptr); +HYPRE_Int SetStencilOffsets_3dim_7pt_sym(HYPRE_Int ***offsets_ptr); +HYPRE_Int SetStencilOffsets_3dim_27pt_sym(HYPRE_Int ***offsets_ptr); +HYPRE_Int SetStencilBndry(HYPRE_StructMatrix A, + HYPRE_StructStencil stencil, + HYPRE_StructGrid grid, + HYPRE_Int *period); +HYPRE_Int SetValuesMatrix(HYPRE_StructMatrix A, HYPRE_StructGrid grid, + HYPRE_Real cx, HYPRE_Real cy, HYPRE_Real cz, + HYPRE_Real conx, HYPRE_Real cony, HYPRE_Real conz); +HYPRE_Int SetValuesCrossMatrix(HYPRE_StructMatrix A, HYPRE_StructGrid grid, + HYPRE_Real cx, HYPRE_Real cy, HYPRE_Real cz); +HYPRE_Int SetValuesVector(hypre_StructGrid *grid, + hypre_StructVector *zvector, + HYPRE_Int *period, + HYPRE_Int type, + HYPRE_Real value); /*-------------------------------------------------------------------------- * Test driver for structured matrix interface (structured storage) @@ -63,6 +68,7 @@ hypre_int main( hypre_int argc, char *argv[] ) { + MPI_Comm comm = hypre_MPI_COMM_WORLD; HYPRE_Int arg_index; HYPRE_Int print_usage; HYPRE_Int nx, ny, nz; @@ -77,52 +83,60 @@ main( hypre_int argc, /*HYPRE_Real dxyz[3];*/ - HYPRE_Int num_ghost[6] = {0, 0, 0, 0, 0, 0}; HYPRE_Int A_num_ghost[6] = {0, 0, 0, 0, 0, 0}; HYPRE_Int v_num_ghost[6] = {0, 0, 0, 0, 0, 0}; HYPRE_StructMatrix A; HYPRE_StructVector b; HYPRE_StructVector x; + HYPRE_StructVector res; HYPRE_StructSolver solver; HYPRE_StructSolver precond; HYPRE_Int num_iterations; HYPRE_Int time_index; HYPRE_Real final_res_norm; + HYPRE_Real real_res_norm; + HYPRE_Real rhs_norm; + HYPRE_Real x0_norm; 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 p = 0, q = 0, r = 0; HYPRE_Int dim; HYPRE_Int n_pre, n_post; HYPRE_Int nblocks = 0; + HYPRE_Int max_levels; HYPRE_Int skip; HYPRE_Int sym; HYPRE_Int rap; + HYPRE_Int matmult; HYPRE_Int relax; HYPRE_Real jacobi_weight; HYPRE_Int usr_jacobi_weight; - HYPRE_Int jump; HYPRE_Int rep, reps; + HYPRE_Int max_iterations; + + HYPRE_Int rhs_type, x0_type; + HYPRE_Real rhs_value, x0_value; HYPRE_Int **iupper; HYPRE_Int **ilower; - HYPRE_Int istart[3]; HYPRE_Int periodic[3]; HYPRE_Int **offsets; HYPRE_Int constant_coefficient = 0; HYPRE_Int *stencil_entries; HYPRE_Int stencil_size; - HYPRE_Int diag_rank; - hypre_Index diag_index; + HYPRE_Int stencil_size_set = 0; + HYPRE_Int stored_stencil_size; + HYPRE_Int stencil_diag_entry; - HYPRE_StructGrid grid; - HYPRE_StructGrid readgrid; + HYPRE_StructGrid grid = NULL; + HYPRE_StructGrid readgrid = NULL; HYPRE_StructStencil stencil; HYPRE_Int i, s; @@ -142,6 +156,8 @@ main( hypre_int argc, HYPRE_Int solver_print_level = 0; HYPRE_Int log_level = 0; HYPRE_Int print_system = 0; + HYPRE_Int print_vtk = 0; + #if defined(HYPRE_USING_MEMORY_TRACKER) HYPRE_Int print_mem_tracker = 0; char mem_tracker_name[HYPRE_MAX_FILE_NAME_LEN] = {0}; @@ -154,7 +170,6 @@ main( hypre_int argc, HYPRE_Int blockSize = 1; HYPRE_Int verbosity = 1; HYPRE_Int iterations; - HYPRE_Int maxIterations = 100; HYPRE_Int checkOrtho = 0; HYPRE_Int printLevel = 0; HYPRE_Int pcgIterations = 0; @@ -185,23 +200,32 @@ main( hypre_int argc, /* 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_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; + HYPRE_MemoryLocation memory_location = HYPRE_MEMORY_DEVICE; + HYPRE_ExecutionPolicy default_exec_policy = HYPRE_EXEC_DEVICE; #endif HYPRE_Int gpu_aware_mpi = 0; +#if defined (HYPRE_USING_UMPIRE) + size_t umpire_dev_pool_size = 4LL * 1024LL * 1024LL * 1024LL; // 4 GiB + size_t umpire_uvm_pool_size = 4LL * 1024LL * 1024LL * 1024LL; // 4 GiB + size_t umpire_pinned_pool_size = 4LL * 1024LL * 1024LL * 1024LL; // 4 GiB + size_t umpire_host_pool_size = 4LL * 1024LL * 1024LL * 1024LL; // 4 GiB +#endif + //HYPRE_Int device_level = -2; /*----------------------------------------------------------- * 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 ); + + hypre_MPI_Comm_size(comm, &num_procs ); + hypre_MPI_Comm_rank(comm, &myid ); /*----------------------------------------------------------------- * GPU Device binding @@ -219,7 +243,7 @@ main( hypre_int argc, } } - hypre_bind_device_id(device_id, myid, num_procs, hypre_MPI_COMM_WORLD); + hypre_bind_device_id(device_id, myid, num_procs, comm); /*----------------------------------------------------------- * Initialize : must be the first HYPRE function to call @@ -235,24 +259,22 @@ main( hypre_int argc, Kokkos::initialize (argc, argv); #endif -#ifdef HYPRE_DEBUG - /*cegdb(&argc, &argv, myid);*/ -#endif - /*----------------------------------------------------------- * Set defaults *-----------------------------------------------------------*/ dim = 3; + stencil_size = 7; skip = 0; sym = 1; rap = 0; + matmult = -1; relax = 1; jacobi_weight = 1.0; usr_jacobi_weight = 0; - jump = 0; reps = 1; + max_levels = 100; nx = 10; ny = 10; @@ -273,11 +295,17 @@ main( hypre_int argc, cony = 0.0; conz = 0.0; + rhs_type = 1; + rhs_value = 1.0; + x0_type = 1; + x0_value = 0.0; + n_pre = 1; n_post = 1; - solver_id = 0; + solver_id = 1; solver_type = 1; + max_iterations = 100; recompute_res = 0; /* What should be the default here? */ istart[0] = -3; @@ -299,15 +327,13 @@ main( hypre_int argc, read_x0fromfile_index = argc; sum = 0; - /* ghost defaults */ - for (i = 0; i < 2 * dim; i++) + /* ghosts for the building of matrix: default */ + for (i = 0; i < dim; i++) { - num_ghost[i] = 1; - A_num_ghost[i] = num_ghost[i]; - v_num_ghost[i] = num_ghost[i]; + A_num_ghost[2 * i] = 1; + A_num_ghost[2 * i + 1] = 1; } - //device_level = nx*ny*nz; /*----------------------------------------------------------- * Parse command line *-----------------------------------------------------------*/ @@ -322,7 +348,6 @@ main( hypre_int argc, nx = atoi(argv[arg_index++]); ny = atoi(argv[arg_index++]); nz = atoi(argv[arg_index++]); - //device_level = nx*ny*nz; } else if ( strcmp(argv[arg_index], "-istart") == 0 ) { @@ -371,6 +396,12 @@ main( hypre_int argc, arg_index++; dim = atoi(argv[arg_index++]); } + else if (strcmp(argv[arg_index], "-27pt") == 0) + { + arg_index++; + stencil_size = 27; + stencil_size_set = 1; + } else if ( strcmp(argv[arg_index], "-fromfile") == 0 ) { arg_index++; @@ -389,6 +420,46 @@ main( hypre_int argc, read_x0fromfile_param = 1; read_x0fromfile_index = arg_index; } + else if (strcmp(argv[arg_index], "-rhszero") == 0) + { + arg_index++; + rhs_type = 1; + rhs_value = 0.0; + } + else if (strcmp(argv[arg_index], "-rhsone") == 0) + { + arg_index++; + rhs_type = 1; + rhs_value = 1.0; + } + else if (strcmp(argv[arg_index], "-rhsrand") == 0) + { + arg_index++; + rhs_type = 0; + rhs_value = myid + 2747; + } + else if (strcmp(argv[arg_index], "-x0zero") == 0) + { + arg_index++; + x0_type = 1; + x0_value = 0.0; + } + else if (strcmp(argv[arg_index], "-x0one") == 0) + { + arg_index++; + x0_type = 1; + x0_value = 1.0; + } + else if (strcmp(argv[arg_index], "-x0rand") == 0) + { + arg_index++; + x0_type = 0; + } + else if ( strcmp(argv[arg_index], "-lvl") == 0 ) + { + arg_index++; + max_levels = atoi(argv[arg_index++]); + } else if (strcmp(argv[arg_index], "-repeats") == 0 ) { arg_index++; @@ -420,6 +491,11 @@ main( hypre_int argc, arg_index++; rap = atoi(argv[arg_index++]); } + else if ( strcmp(argv[arg_index], "-matmult") == 0 ) + { + arg_index++; + matmult = atoi(argv[arg_index++]); + } else if ( strcmp(argv[arg_index], "-relax") == 0 ) { arg_index++; @@ -441,11 +517,6 @@ main( hypre_int argc, arg_index++; skip = atoi(argv[arg_index++]); } - else if ( strcmp(argv[arg_index], "-jump") == 0 ) - { - arg_index++; - jump = atoi(argv[arg_index++]); - } else if ( strcmp(argv[arg_index], "-solver_type") == 0 ) { arg_index++; @@ -456,6 +527,16 @@ main( hypre_int argc, arg_index++; recompute_res = atoi(argv[arg_index++]); } + else if ( strcmp(argv[arg_index], "-tol") == 0 ) + { + arg_index++; + tol = atof(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-itr") == 0 ) + { + arg_index++; + max_iterations = atoi(argv[arg_index++]); + } else if ( strcmp(argv[arg_index], "-cf") == 0 ) { arg_index++; @@ -466,6 +547,11 @@ main( hypre_int argc, arg_index++; print_system = 1; } + else if ( strcmp(argv[arg_index], "-vtk") == 0 ) + { + arg_index++; + print_vtk = 1; + } else if ( strcmp(argv[arg_index], "-pout") == 0 ) { arg_index++; @@ -517,12 +603,6 @@ main( hypre_int argc, arg_index++; lobpcgSeed = atoi(argv[arg_index++]); } - else if ( strcmp(argv[arg_index], "-itr") == 0 ) - { - /* lobpcg: max # of iterations */ - arg_index++; - maxIterations = atoi(argv[arg_index++]); - } else if ( strcmp(argv[arg_index], "-tol") == 0 ) { /* lobpcg: tolerance */ @@ -590,6 +670,28 @@ main( hypre_int argc, arg_index++; gpu_aware_mpi = atoi(argv[arg_index++]); } +#if defined (HYPRE_USING_UMPIRE) + else if ( strcmp(argv[arg_index], "-umpire_dev_pool_size") == 0 ) + { + arg_index++; + umpire_dev_pool_size = (size_t) 1073741824 * atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-umpire_uvm_pool_size") == 0 ) + { + arg_index++; + umpire_uvm_pool_size = (size_t) 1073741824 * atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-umpire_pinned_pool_size") == 0 ) + { + 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 /* end lobpcg */ else { @@ -613,13 +715,24 @@ main( hypre_int argc, HYPRE_SetGpuAwareMPI(gpu_aware_mpi); - /* begin lobpcg */ +#if 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(umpire_dev_pool_size); + HYPRE_SetUmpireUMPoolSize(umpire_uvm_pool_size); + HYPRE_SetUmpireHostPoolSize(umpire_host_pool_size); + HYPRE_SetUmpirePinnedPoolSize(umpire_pinned_pool_size); +#endif + /* begin lobpcg */ if ( solver_id == 0 && lobpcgFlag ) { solver_id = 10; } - /*end lobpcg */ sum = read_x0fromfile_param + read_rhsfromfile_param + read_fromfile_param; @@ -641,20 +754,27 @@ main( hypre_int argc, hypre_printf(" -c : diffusion coefficients\n"); hypre_printf(" -convect : convection coefficients\n"); hypre_printf(" -d : problem dimension (2 or 3)\n"); + hypre_printf(" -27pt : use 27-points stencil\n"); hypre_printf(" -fromfile : prefix name for matrixfiles\n"); hypre_printf(" -rhsfromfile : prefix name for rhsfiles\n"); hypre_printf(" -x0fromfile : prefix name for firstguessfiles\n"); - hypre_printf(" -repeats : number of times to repeat the run, default 1. For solver 0,1,3\n"); + hypre_printf(" -rhszero : rhs vector has zero components\n"); + hypre_printf(" -rhsone : rhs vector has unit components\n"); + hypre_printf(" -rhsrand : rhs vector has random components \n"); + hypre_printf(" -x0zero : initial solution (x0) has zero components \n"); + hypre_printf(" -x0one : initial solution (x0) has unit components \n"); + hypre_printf(" -x0rand : initial solution (x0) has random components \n"); + hypre_printf(" -lvl : maximum number of levels (default 100);\n"); + hypre_printf(" -repeats : number of times to repeat the run, default 1. For solver -1,0,1,3\n"); hypre_printf(" -solver : solver ID\n"); + hypre_printf(" -1 - Struct Matvec\n"); hypre_printf(" 0 - SMG (default)\n"); hypre_printf(" 1 - PFMG\n"); - hypre_printf(" 2 - SparseMSG\n"); hypre_printf(" 3 - PFMG constant coeffs\n"); hypre_printf(" 4 - PFMG constant coeffs var diag\n"); hypre_printf(" 8 - Jacobi\n"); hypre_printf(" 10 - CG with SMG precond\n"); hypre_printf(" 11 - CG with PFMG precond\n"); - hypre_printf(" 12 - CG with SparseMSG precond\n"); hypre_printf(" 13 - CG with PFMG-3 precond\n"); hypre_printf(" 14 - CG with PFMG-4 precond\n"); hypre_printf(" 17 - CG with 2-step Jacobi\n"); @@ -662,16 +782,13 @@ main( hypre_int argc, hypre_printf(" 19 - CG\n"); hypre_printf(" 20 - Hybrid with SMG precond\n"); hypre_printf(" 21 - Hybrid with PFMG precond\n"); - hypre_printf(" 22 - Hybrid with SparseMSG precond\n"); hypre_printf(" 30 - GMRES with SMG precond\n"); hypre_printf(" 31 - GMRES with PFMG precond\n"); - hypre_printf(" 32 - GMRES with SparseMSG precond\n"); hypre_printf(" 37 - GMRES with 2-step Jacobi\n"); hypre_printf(" 38 - GMRES with diagonal scaling\n"); hypre_printf(" 39 - GMRES\n"); hypre_printf(" 40 - BiCGSTAB with SMG precond\n"); hypre_printf(" 41 - BiCGSTAB with PFMG precond\n"); - hypre_printf(" 42 - BiCGSTAB with SparseMSG precond\n"); hypre_printf(" 47 - BiCGSTAB with 2-step Jacobi\n"); hypre_printf(" 48 - BiCGSTAB with diagonal scaling\n"); hypre_printf(" 49 - BiCGSTAB\n"); @@ -686,6 +803,10 @@ main( hypre_int argc, hypre_printf(" 0 - Galerkin (default)\n"); hypre_printf(" 1 - non-Galerkin ParFlow operators\n"); hypre_printf(" 2 - Galerkin, general operators\n"); + hypre_printf(" -matmult : kernel type for structured matrix/matrix multiplication\n"); + hypre_printf(" -1 - automatic selection (0 for CPUs, 1 for GPUs)\n"); + hypre_printf(" 0 - standard algorithm\n"); + hypre_printf(" 1 - fused algorithm\n"); hypre_printf(" -relax : relaxation type\n"); hypre_printf(" 0 - Jacobi\n"); hypre_printf(" 1 - Weighted Jacobi (default)\n"); @@ -694,10 +815,11 @@ main( hypre_int argc, hypre_printf(" -w : jacobi weight\n"); hypre_printf(" -skip : skip levels in PFMG (0 or 1)\n"); hypre_printf(" -sym : symmetric storage (1) or not (0)\n"); - hypre_printf(" -jump : num levels to jump in SparseMSG\n"); hypre_printf(" -solver_type : solver type for Hybrid\n"); hypre_printf(" 1 - PCG (default)\n"); hypre_printf(" 2 - GMRES\n"); + hypre_printf(" -tol : residual tolerance (default 1e-6)\n"); + hypre_printf(" -itr : maximal number of iterations (default 100)\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"); @@ -707,6 +829,12 @@ main( hypre_int argc, 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"); +#if defined (HYPRE_USING_UMPIRE) + 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"); +#endif hypre_printf("\n"); /* begin lobpcg */ @@ -754,7 +882,7 @@ main( hypre_int argc, if ( print_usage ) { - exit(1); + exit(0); } /*----------------------------------------------------------- @@ -767,7 +895,7 @@ main( hypre_int argc, { hypre_printf("Error: PxQxR is more than the number of processors\n"); } - exit(1); + hypre_MPI_Abort(comm, 1); } else if ((P * Q * R) < num_procs) { @@ -786,11 +914,38 @@ main( hypre_int argc, sym = 0; } + /* Calculate stencil size */ + if (!stencil_size_set) + { + switch (dim) + { + case 3: + stencil_size = 7; + break; + + case 2: + stencil_size = 5; + break; + + case 1: + stencil_size = 3; + break; + + default: + if (myid == 0) + { + hypre_printf("Unsupported dimension: %d\n", dim); + hypre_MPI_Abort(comm, 1); + } + } + } + stored_stencil_size = (stencil_size - sym) / (1 + sym) + sym; + /*----------------------------------------------------------- * Print driver parameters *-----------------------------------------------------------*/ - if (myid == 0 && sum == 0) + 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", @@ -806,55 +961,65 @@ main( hypre_int argc, #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]); - 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); - hypre_printf(" (cx, cy, cz) = (%f, %f, %f)\n", cx, cy, cz); - hypre_printf(" (conx,cony,conz)= (%f, %f, %f)\n", conx, cony, conz); - hypre_printf(" (n_pre, n_post) = (%d, %d)\n", n_pre, n_post); - hypre_printf(" dim = %d\n", dim); - hypre_printf(" skip = %d\n", skip); - hypre_printf(" sym = %d\n", sym); - hypre_printf(" rap = %d\n", rap); - hypre_printf(" relax = %d\n", relax); - hypre_printf(" jump = %d\n", jump); - hypre_printf(" solver ID = %d\n", solver_id); - /* hypre_printf(" Device level = %d\n", device_level); */ - } - - if (myid == 0 && sum > 0) - { - hypre_printf("Running with these driver parameters:\n"); - hypre_printf(" (cx, cy, cz) = (%f, %f, %f)\n", cx, cy, cz); - hypre_printf(" (conx,cony,conz)= (%f, %f, %f)\n", conx, cony, conz); - hypre_printf(" (n_pre, n_post) = (%d, %d)\n", n_pre, n_post); - hypre_printf(" dim = %d\n", dim); - hypre_printf(" skip = %d\n", skip); - hypre_printf(" sym = %d\n", sym); - hypre_printf(" rap = %d\n", rap); - hypre_printf(" relax = %d\n", relax); - hypre_printf(" jump = %d\n", jump); - hypre_printf(" solver ID = %d\n", solver_id); - hypre_printf(" the grid is read from file \n"); - + if (sum == 0) + { + 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]); + 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); + } + else + { + hypre_printf(" the grid is read from file \n"); + } + { + hypre_printf(" (cx, cy, cz) = (%f, %f, %f)\n", cx, cy, cz); + hypre_printf(" (conx,cony,conz) = (%f, %f, %f)\n", conx, cony, conz); + hypre_printf(" (n_pre, n_post) = (%d, %d)\n", n_pre, n_post); + hypre_printf(" stsize = %d\n", stencil_size); + hypre_printf(" stored_stsize = %d\n", stored_stencil_size); + hypre_printf(" dim = %d\n", dim); + hypre_printf(" skip = %d\n", skip); + hypre_printf(" sym = %d\n", sym); + hypre_printf(" rap = %d\n", rap); + hypre_printf(" matmult = %d\n", matmult); + hypre_printf(" relax = %d\n", relax); + hypre_printf(" solver ID = %d\n", solver_id); + hypre_printf(" Repetitions = %d\n", reps); + } + if (rhs_type == 0) + { + hypre_printf(" rhs value = %20.15e\n", rhs_value); + } + else + { + hypre_printf(" rhs has random components\n"); + } + if (x0_type == 0) + { + hypre_printf(" initial sol (x0) = %20.15e\n", x0_value); + } + else + { + hypre_printf(" initial sol (x0) has random components\n"); + } + hypre_printf("\n"); } /*----------------------------------------------------------- * Synchronize so that timings make sense *-----------------------------------------------------------*/ - hypre_MPI_Barrier(hypre_MPI_COMM_WORLD); + hypre_MPI_Barrier(comm); - for ( rep = 0; rep < reps; ++rep ) + for (rep = 0; rep < reps; ++rep) { time_index = hypre_InitializeTiming("Struct Interface"); hypre_BeginTiming(time_index); /*----------------------------------------------------------- - * Set up the stencil structure (7 points) when matrix is NOT read from file + * Set up the stencil structure when matrix is NOT read from file * Set up the grid structure used when NO files are read *-----------------------------------------------------------*/ @@ -862,62 +1027,40 @@ main( hypre_int argc, { case 1: nblocks = bx; - if (sym) + if (sym && stencil_size == 3) + { + SetStencilOffsets_1dim_3pt_sym(&offsets); + } + else if (!sym && stencil_size == 3) { - 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; + SetStencilOffsets_1dim_3pt(&offsets); } 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; + hypre_printf("Stencil size not implemented!\n"); + hypre_MPI_Abort(comm, 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; + if (sym && stencil_size == 5) + { + SetStencilOffsets_2dim_5pt_sym(&offsets); + } + else if (!sym && stencil_size == 5) + { + SetStencilOffsets_2dim_5pt(&offsets); } 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; + hypre_printf("Stencil size not implemented!\n"); + hypre_MPI_Abort(comm, 1); } + /* compute p,q from P,Q and myid */ p = myid % P; q = (( myid - p) / P) % Q; @@ -925,58 +1068,28 @@ main( hypre_int argc, 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; + if (sym && stencil_size == 7) + { + SetStencilOffsets_3dim_7pt_sym(&offsets); + } + else if (!sym && stencil_size == 7) + { + SetStencilOffsets_3dim_7pt(&offsets); + } + else if (sym && stencil_size == 27) + { + SetStencilOffsets_3dim_27pt_sym(&offsets); + } + else if (!sym && stencil_size == 27) + { + SetStencilOffsets_3dim_27pt(&offsets); } 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; + hypre_printf("Stencil size not implemented!\n"); + hypre_MPI_Abort(comm, 1); } + /* compute p,q,r from P,Q,R and myid */ p = myid % P; q = (( myid - p) / P) % Q; @@ -995,10 +1108,10 @@ 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, stored_stencil_size, &stencil); + for (s = 0; s < stored_stencil_size; s++) { - HYPRE_StructStencilSetElement(stencil, s, offsets[s]); + HYPRE_StructStencilSetEntry(stencil, s, offsets[s]); } /*----------------------------------------------------------- @@ -1034,11 +1147,15 @@ main( hypre_int argc, /* 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)) { + if (myid == 0) + { + hypre_printf("\nReading linear system from files: matrix, rhs and x0\n"); + } + /* ghost selection for reading the matrix and vectors */ for (i = 0; i < dim; i++) { @@ -1048,17 +1165,14 @@ main( hypre_int argc, v_num_ghost[2 * i + 1] = 1; } - HYPRE_StructMatrixRead(hypre_MPI_COMM_WORLD, - argv[read_fromfile_index], - A_num_ghost, &A); + HYPRE_StructMatrixRead(comm, argv[read_fromfile_index], A_num_ghost, &A); - HYPRE_StructVectorRead(hypre_MPI_COMM_WORLD, - argv[read_rhsfromfile_index], - v_num_ghost, &b); + HYPRE_StructVectorRead(comm, argv[read_rhsfromfile_index], v_num_ghost, &b); - HYPRE_StructVectorRead(hypre_MPI_COMM_WORLD, - argv[read_x0fromfile_index], - v_num_ghost, &x); + HYPRE_StructVectorRead(comm, argv[read_x0fromfile_index], v_num_ghost, &x); + + readgrid = hypre_StructMatrixGrid(A); + readperiodic = hypre_StructGridPeriodic(readgrid); } /* beginning of sum == 0 */ @@ -1068,12 +1182,12 @@ main( hypre_int argc, * prepare space for the extents *-----------------------------------------------------------*/ - ilower = hypre_CTAlloc(HYPRE_Int*, nblocks, HYPRE_MEMORY_HOST); - iupper = hypre_CTAlloc(HYPRE_Int*, nblocks, HYPRE_MEMORY_HOST); + ilower = hypre_CTAlloc(HYPRE_Int*, nblocks, HYPRE_MEMORY_HOST); + iupper = hypre_CTAlloc(HYPRE_Int*, nblocks, HYPRE_MEMORY_HOST); for (i = 0; i < nblocks; i++) { - ilower[i] = hypre_CTAlloc(HYPRE_Int, dim, HYPRE_MEMORY_HOST); - iupper[i] = hypre_CTAlloc(HYPRE_Int, dim, HYPRE_MEMORY_HOST); + ilower[i] = hypre_CTAlloc(HYPRE_Int, dim, HYPRE_MEMORY_HOST); + iupper[i] = hypre_CTAlloc(HYPRE_Int, dim, HYPRE_MEMORY_HOST); } /* compute ilower and iupper from (p,q,r), (bx,by,bz), and (nx,ny,nz) */ @@ -1088,8 +1202,10 @@ main( hypre_int argc, ib++; } break; + case 2: for (iy = 0; iy < by; iy++) + { for (ix = 0; ix < bx; ix++) { ilower[ib][0] = istart[0] + nx * (bx * p + ix); @@ -1098,10 +1214,14 @@ main( hypre_int argc, iupper[ib][1] = istart[1] + ny * (by * q + iy + 1) - 1; ib++; } + } break; + case 3: for (iz = 0; iz < bz; iz++) + { for (iy = 0; iy < by; iy++) + { for (ix = 0; ix < bx; ix++) { ilower[ib][0] = istart[0] + nx * (bx * p + ix); @@ -1112,68 +1232,71 @@ main( hypre_int argc, iupper[ib][2] = istart[2] + nz * (bz * r + iz + 1) - 1; ib++; } + } + } break; } - HYPRE_StructGridCreate(hypre_MPI_COMM_WORLD, dim, &grid); + HYPRE_StructGridCreate(comm, dim, &grid); for (ib = 0; ib < nblocks; ib++) { /* Add to the grid a new box defined by ilower[ib], iupper[ib]...*/ HYPRE_StructGridSetExtents(grid, ilower[ib], iupper[ib]); } HYPRE_StructGridSetPeriodic(grid, periodic); - HYPRE_StructGridSetNumGhost(grid, num_ghost); HYPRE_StructGridAssemble(grid); + if (print_vtk) + { + HYPRE_StructGridPrintVTK("struct_grid", grid); + } + /*----------------------------------------------------------- * Set up the matrix structure *-----------------------------------------------------------*/ - HYPRE_StructMatrixCreate(hypre_MPI_COMM_WORLD, grid, stencil, &A); + HYPRE_StructMatrixCreate(comm, grid, stencil, &A); - if ( solver_id == 3 || solver_id == 4 || + if ( solver_id == 3 || solver_id == 4 || 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) + 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 < stencil_size; ++i ) + for (i = 0; i < stencil_size; ++i) { stencil_entries[i] = i; } - hypre_StructMatrixSetConstantEntries( A, stencil_size, stencil_entries ); - /* ... note: SetConstantEntries is where the constant_coefficient - flag is set in A */ - hypre_TFree( stencil_entries, HYPRE_MEMORY_HOST); + /* SetConstantEntries is where the constant_coefficient flag is set in A */ + hypre_StructMatrixSetConstantEntries(A, stencil_size, stencil_entries); constant_coefficient = 1; } - if ( solver_id == 4 || solver_id == 14) + else { - hypre_SetIndex3(diag_index, 0, 0, 0); - diag_rank = hypre_StructStencilElementRank( stencil, diag_index ); - hypre_assert( stencil_size >= 1 ); - if ( diag_rank == 0 ) + stencil_diag_entry = hypre_StructStencilDiagEntry(stencil); + hypre_assert(stencil_size >= 1); + if (stencil_diag_entry == 0) { - stencil_entries[diag_rank] = 1; + stencil_entries[stencil_diag_entry] = 1; } else { - stencil_entries[diag_rank] = 0; + stencil_entries[stencil_diag_entry] = 0; } - for ( i = 0; i < stencil_size; ++i ) + for (i = 0; i < stencil_size; ++i) { - if ( i != diag_rank ) + if (i != stencil_diag_entry) { stencil_entries[i] = i; } } - hypre_StructMatrixSetConstantEntries( A, stencil_size, stencil_entries ); - hypre_TFree( stencil_entries, HYPRE_MEMORY_HOST); + hypre_StructMatrixSetConstantEntries(A, stencil_size, stencil_entries); constant_coefficient = 2; } + hypre_TFree(stencil_entries, HYPRE_MEMORY_HOST); } - HYPRE_StructMatrixSetSymmetric(A, sym); HYPRE_StructMatrixInitialize(A); @@ -1181,36 +1304,43 @@ main( hypre_int argc, * Fill in the matrix elements *-----------------------------------------------------------*/ - 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 (stencil_size != 27) + { + SetValuesMatrix(A, grid, cx, cy, cz, conx, cony, conz); + } + else + { + SetValuesCrossMatrix(A, grid, cx, cy, cz); + } - if ( constant_coefficient == 0 ) + /* Zero out stencils reaching to real boundary. + But in constant coefficient case, no special stencils! */ + if (constant_coefficient == 0) { - SetStencilBndry(A, grid, periodic); + SetStencilBndry(A, stencil, grid, periodic); } + + /* Assemble matrix */ HYPRE_StructMatrixAssemble(A); + /*----------------------------------------------------------- * Set up the linear system *-----------------------------------------------------------*/ - HYPRE_StructVectorCreate(hypre_MPI_COMM_WORLD, grid, &b); + HYPRE_StructVectorCreate(comm, grid, &b); HYPRE_StructVectorInitialize(b); /*----------------------------------------------------------- - * 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. + * Set vector entries *-----------------------------------------------------------*/ - AddValuesVector(grid, b, periodic, 1.0); + SetValuesVector(grid, b, periodic, rhs_type, rhs_value); HYPRE_StructVectorAssemble(b); - HYPRE_StructVectorCreate(hypre_MPI_COMM_WORLD, grid, &x); + HYPRE_StructVectorCreate(comm, grid, &x); HYPRE_StructVectorInitialize(x); - AddValuesVector(grid, x, periodx0, 0.0); + SetValuesVector(grid, x, periodx0, x0_type, x0_value); HYPRE_StructVectorAssemble(x); HYPRE_StructGridDestroy(grid); @@ -1223,14 +1353,12 @@ main( hypre_int argc, hypre_TFree(ilower, HYPRE_MEMORY_HOST); hypre_TFree(iupper, HYPRE_MEMORY_HOST); } - - /* the grid will be read from file. */ - if ( (sum > 0 ) && (sum < 3)) + else if ((sum > 0 ) && (sum < 3)) { + /* the grid will be read from file. */ /* the grid will come from rhs or from x0 */ if (read_fromfile_param == 0) { - if ((read_rhsfromfile_param > 0) && (read_x0fromfile_param == 0)) { /* read right hand side, extract grid, construct matrix, @@ -1239,20 +1367,18 @@ main( hypre_int argc, hypre_printf("\ninitial rhs from file prefix :%s\n", argv[read_rhsfromfile_index]); - HYPRE_StructVectorRead(hypre_MPI_COMM_WORLD, - argv[read_rhsfromfile_index], - v_num_ghost, &b); + HYPRE_StructVectorRead(comm, argv[read_rhsfromfile_index], v_num_ghost, &b); readgrid = hypre_StructVectorGrid(b) ; readperiodic = hypre_StructGridPeriodic(readgrid); - HYPRE_StructVectorCreate(hypre_MPI_COMM_WORLD, readgrid, &x); + HYPRE_StructVectorCreate(comm, readgrid, &x); HYPRE_StructVectorInitialize(x); - AddValuesVector(readgrid, x, periodx0, 0.0); + SetValuesVector(readgrid, x, periodx0, x0_type, x0_value); HYPRE_StructVectorAssemble(x); - HYPRE_StructMatrixCreate(hypre_MPI_COMM_WORLD, + HYPRE_StructMatrixCreate(comm, readgrid, stencil, &A); HYPRE_StructMatrixSetSymmetric(A, 1); HYPRE_StructMatrixInitialize(A); @@ -1261,20 +1387,23 @@ main( hypre_int argc, * Fill in the matrix elements *-----------------------------------------------------------*/ - AddValuesMatrix(A, readgrid, cx, cy, cz, conx, cony, conz); + if (stencil_size != 27) + { + SetValuesMatrix(A, readgrid, cx, cy, cz, conx, cony, conz); + } + else + { + SetValuesCrossMatrix(A, readgrid, cx, cy, cz); + } /* Zero out stencils reaching to real boundary */ - - if ( constant_coefficient == 0 ) + if (constant_coefficient == 0) { - SetStencilBndry(A, readgrid, readperiodic); + SetStencilBndry(A, stencil, readgrid, readperiodic); } HYPRE_StructMatrixAssemble(A); } - /* done with one case rhs=1 x0 = 0 */ - - /* case when rhs=0 and read x0=1 */ - if ((read_rhsfromfile_param == 0) && (read_x0fromfile_param > 0)) + else if ((read_rhsfromfile_param == 0) && (read_x0fromfile_param > 0)) { /* read right hand side, extract grid, construct matrix, construct x0 */ @@ -1282,20 +1411,18 @@ main( hypre_int argc, hypre_printf("\ninitial x0 from file prefix :%s\n", argv[read_x0fromfile_index]); - HYPRE_StructVectorRead(hypre_MPI_COMM_WORLD, - argv[read_x0fromfile_index], - v_num_ghost, &x); + HYPRE_StructVectorRead(comm, argv[read_x0fromfile_index], v_num_ghost, &x); readgrid = hypre_StructVectorGrid(x) ; readperiodic = hypre_StructGridPeriodic(readgrid); - HYPRE_StructVectorCreate(hypre_MPI_COMM_WORLD, readgrid, &b); + HYPRE_StructVectorCreate(comm, readgrid, &b); HYPRE_StructVectorInitialize(b); - AddValuesVector(readgrid, b, readperiodic, 1.0); + SetValuesVector(readgrid, b, readperiodic, rhs_type, rhs_value); HYPRE_StructVectorAssemble(b); - HYPRE_StructMatrixCreate(hypre_MPI_COMM_WORLD, + HYPRE_StructMatrixCreate(comm, readgrid, stencil, &A); HYPRE_StructMatrixSetSymmetric(A, 1); HYPRE_StructMatrixInitialize(A); @@ -1304,20 +1431,23 @@ main( hypre_int argc, * Fill in the matrix elements *-----------------------------------------------------------*/ - AddValuesMatrix(A, readgrid, cx, cy, cz, conx, cony, conz); + if (stencil_size != 27) + { + SetValuesMatrix(A, readgrid, cx, cy, cz, conx, cony, conz); + } + else + { + SetValuesCrossMatrix(A, readgrid, cx, cy, cz); + } /* Zero out stencils reaching to real boundary */ - - if ( constant_coefficient == 0 ) + if (constant_coefficient == 0) { - SetStencilBndry(A, readgrid, readperiodic); + SetStencilBndry(A, stencil, readgrid, readperiodic); } HYPRE_StructMatrixAssemble(A); } - /* done with one case rhs=0 x0 = 1 */ - - /* the other case when read rhs > 0 and read x0 > 0 */ - if ((read_rhsfromfile_param > 0) && (read_x0fromfile_param > 0)) + else if ((read_rhsfromfile_param > 0) && (read_x0fromfile_param > 0)) { /* read right hand side, extract grid, construct matrix, construct x0 */ @@ -1327,18 +1457,14 @@ main( hypre_int argc, hypre_printf("\ninitial x0 from file prefix :%s\n", argv[read_x0fromfile_index]); - HYPRE_StructVectorRead(hypre_MPI_COMM_WORLD, - argv[read_rhsfromfile_index], - v_num_ghost, &b); + HYPRE_StructVectorRead(comm, argv[read_rhsfromfile_index], v_num_ghost, &b); - HYPRE_StructVectorRead(hypre_MPI_COMM_WORLD, - argv[read_x0fromfile_index], - v_num_ghost, &x); + HYPRE_StructVectorRead(comm, argv[read_x0fromfile_index], v_num_ghost, &x); - readgrid = hypre_StructVectorGrid(b) ; + readgrid = hypre_StructVectorGrid(b); readperiodic = hypre_StructGridPeriodic(readgrid); - HYPRE_StructMatrixCreate(hypre_MPI_COMM_WORLD, + HYPRE_StructMatrixCreate(comm, readgrid, stencil, &A); HYPRE_StructMatrixSetSymmetric(A, 1); HYPRE_StructMatrixInitialize(A); @@ -1347,31 +1473,35 @@ main( hypre_int argc, * Fill in the matrix elements *-----------------------------------------------------------*/ - AddValuesMatrix(A, readgrid, cx, cy, cz, conx, cony, conz); + if (stencil_size != 27) + { + SetValuesMatrix(A, readgrid, cx, cy, cz, conx, cony, conz); + } + else + { + SetValuesCrossMatrix(A, readgrid, cx, cy, cz); + } /* Zero out stencils reaching to real boundary */ - - if ( constant_coefficient == 0 ) + if (constant_coefficient == 0) { - SetStencilBndry(A, readgrid, readperiodic); + SetStencilBndry(A, stencil, readgrid, readperiodic); } HYPRE_StructMatrixAssemble(A); } /* done with one case rhs=1 x0 = 1 */ } - /* done with the case where you no read matrix */ + /* done with the case where you do not read matrix from file */ if (read_fromfile_param == 1) /* still sum > 0 */ { hypre_printf("\nreading matrix from file:%s\n", argv[read_fromfile_index]); - HYPRE_StructMatrixRead(hypre_MPI_COMM_WORLD, - argv[read_fromfile_index], - A_num_ghost, &A); + HYPRE_StructMatrixRead(comm, argv[read_fromfile_index], A_num_ghost, &A); - readgrid = hypre_StructMatrixGrid(A); - readperiodic = hypre_StructGridPeriodic(readgrid); + readgrid = hypre_StructMatrixGrid(A); + readperiodic = hypre_StructGridPeriodic(readgrid); if ((read_rhsfromfile_param > 0) && (read_x0fromfile_param == 0)) { @@ -1379,65 +1509,69 @@ main( hypre_int argc, hypre_printf("\ninitial rhs from file prefix :%s\n", argv[read_rhsfromfile_index]); - HYPRE_StructVectorRead(hypre_MPI_COMM_WORLD, - argv[read_rhsfromfile_index], - v_num_ghost, &b); + HYPRE_StructVectorRead(comm, argv[read_rhsfromfile_index], v_num_ghost, &b); - HYPRE_StructVectorCreate(hypre_MPI_COMM_WORLD, readgrid, &x); + HYPRE_StructVectorCreate(comm, readgrid, &x); HYPRE_StructVectorInitialize(x); - AddValuesVector(readgrid, x, periodx0, 0.0); + + SetValuesVector(readgrid, x, periodx0, x0_type, x0_value); HYPRE_StructVectorAssemble(x); } - - if ((read_rhsfromfile_param == 0) && (read_x0fromfile_param > 0)) + else if ((read_rhsfromfile_param == 0) && (read_x0fromfile_param > 0)) { /* read x0, construct rhs*/ hypre_printf("\ninitial x0 from file prefix :%s\n", argv[read_x0fromfile_index]); - HYPRE_StructVectorRead(hypre_MPI_COMM_WORLD, - argv[read_x0fromfile_index], - v_num_ghost, &x); + HYPRE_StructVectorRead(comm, argv[read_x0fromfile_index], v_num_ghost, &x); - HYPRE_StructVectorCreate(hypre_MPI_COMM_WORLD, readgrid, &b); + HYPRE_StructVectorCreate(comm, readgrid, &b); HYPRE_StructVectorInitialize(b); - AddValuesVector(readgrid, b, readperiodic, 1.0); + SetValuesVector(readgrid, b, readperiodic, rhs_type, rhs_value); HYPRE_StructVectorAssemble(b); } - - if ((read_rhsfromfile_param == 0) && (read_x0fromfile_param == 0)) + else if ((read_rhsfromfile_param == 0) && (read_x0fromfile_param == 0)) { /* construct x0 , construct b*/ - HYPRE_StructVectorCreate(hypre_MPI_COMM_WORLD, readgrid, &b); + HYPRE_StructVectorCreate(comm, readgrid, &b); HYPRE_StructVectorInitialize(b); - AddValuesVector(readgrid, b, readperiodic, 1.0); + SetValuesVector(readgrid, b, readperiodic, rhs_type, rhs_value); HYPRE_StructVectorAssemble(b); - HYPRE_StructVectorCreate(hypre_MPI_COMM_WORLD, readgrid, &x); + HYPRE_StructVectorCreate(comm, readgrid, &x); HYPRE_StructVectorInitialize(x); - AddValuesVector(readgrid, x, periodx0, 0.0); + SetValuesVector(readgrid, x, periodx0, x0_type, x0_value); HYPRE_StructVectorAssemble(x); } - } - /* finish the read of matrix */ + } /* finish the read of matrix */ } - /* finish the sum > 0 case */ + /* linear system complete */ - /* linear system complete */ + /* RDF: Why do we need both a readgrid and a grid? */ + if (grid == NULL) + { + grid = readgrid; + } hypre_EndTiming(time_index); - if ( reps == 1 || (solver_id != 0 && solver_id != 1 && solver_id != 3 && solver_id != 4) ) + if (reps == 1 || (solver_id != 0 && solver_id != 1 && solver_id != 3 && solver_id != 4)) { - hypre_PrintTiming("Struct Interface", hypre_MPI_COMM_WORLD); + hypre_PrintTiming("Struct Interface", comm); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); } - else if ( rep == reps - 1 ) + else if (rep == reps - 1) { hypre_FinalizeTiming(time_index); } + /* Compute vector norms */ + HYPRE_StructVectorInnerProd(b, b, &rhs_norm); + HYPRE_StructVectorInnerProd(x, x, &x0_norm); + rhs_norm = sqrt(rhs_norm); + x0_norm = sqrt(x0_norm); + /*----------------------------------------------------------- * Print out the system and initial guess *-----------------------------------------------------------*/ @@ -1449,20 +1583,49 @@ main( hypre_int argc, HYPRE_StructVectorPrint("struct.out.x0", x, 0); } + if (print_vtk) + { + HYPRE_StructGridPrintVTK("struct_grid", hypre_StructMatrixGrid(A)); + //HYPRE_StructGridPrintVTK("struct_grid", grid); + } + /*----------------------------------------------------------- * Solve the system using SMG *-----------------------------------------------------------*/ #if !HYPRE_MFLOPS - if (solver_id == 0) + if (solver_id < 0) + { + void *matvec_data; + + matvec_data = hypre_StructMatvecCreate(); + hypre_StructMatvecSetup(matvec_data, A, x); + + time_index = hypre_InitializeTiming("Matvec"); + hypre_BeginTiming(time_index); + + for (i = 0; i < reps; i++) + { + hypre_StructMatvecCompute(matvec_data, -1.0, A, x, 1.0, b, b); + } + reps = 0; + + hypre_EndTiming(time_index); + hypre_PrintTiming("Total Matvec time", comm); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + hypre_StructMatvecDestroy(matvec_data); + } + else if (solver_id == 0) { time_index = hypre_InitializeTiming("SMG Setup"); hypre_BeginTiming(time_index); - HYPRE_StructSMGCreate(hypre_MPI_COMM_WORLD, &solver); + HYPRE_StructSMGCreate(comm, &solver); HYPRE_StructSMGSetMemoryUse(solver, 0); - HYPRE_StructSMGSetMaxIter(solver, 50); + HYPRE_StructSMGSetMaxIter(solver, max_iterations); HYPRE_StructSMGSetTol(solver, tol); HYPRE_StructSMGSetRelChange(solver, 0); HYPRE_StructSMGSetNumPreRelax(solver, n_pre); @@ -1483,13 +1646,13 @@ main( hypre_int argc, #endif hypre_EndTiming(time_index); - if ( reps == 1 ) + if (reps == 1) { - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); + hypre_PrintTiming("Setup phase times", comm); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); } - else if ( rep == reps - 1 ) + else if (rep == reps - 1) { hypre_FinalizeTiming(time_index); } @@ -1500,16 +1663,16 @@ main( hypre_int argc, HYPRE_StructSMGSolve(solver, A, b, x); hypre_EndTiming(time_index); - if ( reps == 1 ) + if (reps == 1) { - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); + hypre_PrintTiming("Solve phase times", comm); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); } - else if ( rep == reps - 1 ) + else if (rep == reps - 1) { hypre_PrintTiming("Interface, Setup, and Solve times:", - hypre_MPI_COMM_WORLD ); + comm ); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); } @@ -1528,12 +1691,13 @@ main( hypre_int argc, time_index = hypre_InitializeTiming("PFMG Setup"); hypre_BeginTiming(time_index); - HYPRE_StructPFMGCreate(hypre_MPI_COMM_WORLD, &solver); - /*HYPRE_StructPFMGSetMaxLevels( solver, 9 );*/ - HYPRE_StructPFMGSetMaxIter(solver, 200); + HYPRE_StructPFMGCreate(comm, &solver); + HYPRE_StructPFMGSetMaxLevels(solver, max_levels); + HYPRE_StructPFMGSetMaxIter(solver, max_iterations); HYPRE_StructPFMGSetTol(solver, tol); HYPRE_StructPFMGSetRelChange(solver, 0); HYPRE_StructPFMGSetRAPType(solver, rap); + HYPRE_StructPFMGSetMatmultType(solver, matmult); HYPRE_StructPFMGSetRelaxType(solver, relax); if (usr_jacobi_weight) { @@ -1553,13 +1717,13 @@ main( hypre_int argc, HYPRE_StructPFMGSetup(solver, A, b, x); hypre_EndTiming(time_index); - if ( reps == 1 ) + if (reps == 1) { - hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); + hypre_PrintTiming("Setup phase times", comm); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); } - else if ( rep == reps - 1 ) + else if (rep == reps - 1) { hypre_FinalizeTiming(time_index); } @@ -1567,20 +1731,19 @@ main( hypre_int argc, time_index = hypre_InitializeTiming("PFMG Solve"); hypre_BeginTiming(time_index); - HYPRE_StructPFMGSolve(solver, A, b, x); hypre_EndTiming(time_index); - if ( reps == 1 ) + if (reps == 1) { - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); + hypre_PrintTiming("Solve phase times", comm); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); } - else if ( rep == reps - 1 ) + else if (rep == reps - 1) { hypre_PrintTiming("Interface, Setup, and Solve times", - hypre_MPI_COMM_WORLD); + comm); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); } @@ -1590,52 +1753,6 @@ main( hypre_int argc, HYPRE_StructPFMGDestroy(solver); } - /*----------------------------------------------------------- - * Solve the system using SparseMSG - *-----------------------------------------------------------*/ - - else if (solver_id == 2) - { - time_index = hypre_InitializeTiming("SparseMSG Setup"); - hypre_BeginTiming(time_index); - - HYPRE_StructSparseMSGCreate(hypre_MPI_COMM_WORLD, &solver); - HYPRE_StructSparseMSGSetMaxIter(solver, 50); - HYPRE_StructSparseMSGSetJump(solver, jump); - HYPRE_StructSparseMSGSetTol(solver, tol); - HYPRE_StructSparseMSGSetRelChange(solver, 0); - HYPRE_StructSparseMSGSetRelaxType(solver, relax); - if (usr_jacobi_weight) - { - HYPRE_StructSparseMSGSetJacobiWeight(solver, jacobi_weight); - } - HYPRE_StructSparseMSGSetNumPreRelax(solver, n_pre); - HYPRE_StructSparseMSGSetNumPostRelax(solver, n_post); - HYPRE_StructSparseMSGSetPrintLevel(solver, solver_print_level); - HYPRE_StructSparseMSGSetLogging(solver, 1); - HYPRE_StructSparseMSGSetup(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("SparseMSG Solve"); - hypre_BeginTiming(time_index); - - HYPRE_StructSparseMSGSolve(solver, A, b, x); - - hypre_EndTiming(time_index); - hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); - hypre_FinalizeTiming(time_index); - hypre_ClearTiming(); - - HYPRE_StructSparseMSGGetNumIterations(solver, &num_iterations); - HYPRE_StructSparseMSGGetFinalRelativeResidualNorm(solver, - &final_res_norm); - HYPRE_StructSparseMSGDestroy(solver); - } - /*----------------------------------------------------------- * Solve the system using Jacobi *-----------------------------------------------------------*/ @@ -1645,13 +1762,13 @@ main( hypre_int argc, time_index = hypre_InitializeTiming("Jacobi Setup"); hypre_BeginTiming(time_index); - HYPRE_StructJacobiCreate(hypre_MPI_COMM_WORLD, &solver); - HYPRE_StructJacobiSetMaxIter(solver, 100); + HYPRE_StructJacobiCreate(comm, &solver); + HYPRE_StructJacobiSetMaxIter(solver, max_iterations); HYPRE_StructJacobiSetTol(solver, tol); HYPRE_StructJacobiSetup(solver, A, b, 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(); @@ -1661,7 +1778,7 @@ main( hypre_int argc, HYPRE_StructJacobiSolve(solver, A, b, 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(); @@ -1679,8 +1796,8 @@ main( hypre_int argc, time_index = hypre_InitializeTiming("PCG Setup"); hypre_BeginTiming(time_index); - HYPRE_StructPCGCreate(hypre_MPI_COMM_WORLD, &solver); - HYPRE_PCGSetMaxIter( (HYPRE_Solver)solver, 100 ); + HYPRE_StructPCGCreate(comm, &solver); + HYPRE_PCGSetMaxIter( (HYPRE_Solver)solver, max_iterations ); HYPRE_PCGSetTol( (HYPRE_Solver)solver, tol ); HYPRE_PCGSetTwoNorm( (HYPRE_Solver)solver, 1 ); HYPRE_PCGSetRelChange( (HYPRE_Solver)solver, 0 ); @@ -1689,7 +1806,7 @@ main( hypre_int argc, if (solver_id == 10) { /* use symmetric SMG as preconditioner */ - HYPRE_StructSMGCreate(hypre_MPI_COMM_WORLD, &precond); + HYPRE_StructSMGCreate(comm, &precond); HYPRE_StructSMGSetMemoryUse(precond, 0); HYPRE_StructSMGSetMaxIter(precond, 1); HYPRE_StructSMGSetTol(precond, 0.0); @@ -1711,11 +1828,13 @@ main( hypre_int argc, else if (solver_id == 11 || solver_id == 13 || solver_id == 14) { /* use symmetric PFMG as preconditioner */ - HYPRE_StructPFMGCreate(hypre_MPI_COMM_WORLD, &precond); + HYPRE_StructPFMGCreate(comm, &precond); + HYPRE_StructPFMGSetMaxLevels(precond, max_levels); HYPRE_StructPFMGSetMaxIter(precond, 1); HYPRE_StructPFMGSetTol(precond, 0.0); HYPRE_StructPFMGSetZeroGuess(precond); HYPRE_StructPFMGSetRAPType(precond, rap); + HYPRE_StructPFMGSetMatmultType(precond, matmult); HYPRE_StructPFMGSetRelaxType(precond, relax); if (usr_jacobi_weight) { @@ -1736,33 +1855,10 @@ main( hypre_int argc, (HYPRE_Solver) precond); } - else if (solver_id == 12) - { - /* use symmetric SparseMSG as preconditioner */ - HYPRE_StructSparseMSGCreate(hypre_MPI_COMM_WORLD, &precond); - HYPRE_StructSparseMSGSetMaxIter(precond, 1); - HYPRE_StructSparseMSGSetJump(precond, jump); - HYPRE_StructSparseMSGSetTol(precond, 0.0); - HYPRE_StructSparseMSGSetZeroGuess(precond); - HYPRE_StructSparseMSGSetRelaxType(precond, relax); - if (usr_jacobi_weight) - { - HYPRE_StructSparseMSGSetJacobiWeight(precond, jacobi_weight); - } - HYPRE_StructSparseMSGSetNumPreRelax(precond, n_pre); - HYPRE_StructSparseMSGSetNumPostRelax(precond, n_post); - HYPRE_StructSparseMSGSetPrintLevel(precond, prec_print_level); - HYPRE_StructSparseMSGSetLogging(precond, 0); - HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSetup, - (HYPRE_Solver) precond); - } - else if (solver_id == 17) { /* use two-step Jacobi as preconditioner */ - HYPRE_StructJacobiCreate(hypre_MPI_COMM_WORLD, &precond); + HYPRE_StructJacobiCreate(comm, &precond); HYPRE_StructJacobiSetMaxIter(precond, 2); HYPRE_StructJacobiSetTol(precond, 0.0); HYPRE_StructJacobiSetZeroGuess(precond); @@ -1786,7 +1882,7 @@ main( hypre_int argc, (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(); @@ -1797,7 +1893,7 @@ main( hypre_int argc, (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(); @@ -1814,10 +1910,6 @@ main( hypre_int argc, { HYPRE_StructPFMGDestroy(precond); } - else if (solver_id == 12) - { - HYPRE_StructSparseMSGDestroy(precond); - } else if (solver_id == 17) { HYPRE_StructJacobiDestroy(precond); @@ -1849,7 +1941,7 @@ main( hypre_int argc, time_index = hypre_InitializeTiming("PCG Setup"); hypre_BeginTiming(time_index); - HYPRE_StructPCGCreate(hypre_MPI_COMM_WORLD, &solver); + HYPRE_StructPCGCreate(comm, &solver); HYPRE_PCGSetMaxIter( (HYPRE_Solver)solver, pcgIterations ); HYPRE_PCGSetTol( (HYPRE_Solver)solver, pcgTol ); HYPRE_PCGSetTwoNorm( (HYPRE_Solver)solver, 1 ); @@ -1859,7 +1951,7 @@ main( hypre_int argc, if (solver_id == 10) { /* use symmetric SMG as preconditioner */ - HYPRE_StructSMGCreate(hypre_MPI_COMM_WORLD, &precond); + HYPRE_StructSMGCreate(comm, &precond); HYPRE_StructSMGSetMemoryUse(precond, 0); HYPRE_StructSMGSetMaxIter(precond, 1); HYPRE_StructSMGSetTol(precond, 0.0); @@ -1880,11 +1972,13 @@ main( hypre_int argc, else if (solver_id == 11) { /* use symmetric PFMG as preconditioner */ - HYPRE_StructPFMGCreate(hypre_MPI_COMM_WORLD, &precond); + HYPRE_StructPFMGCreate(comm, &precond); + HYPRE_StructPFMGSetMaxLevels(precond, max_levels); HYPRE_StructPFMGSetMaxIter(precond, 1); HYPRE_StructPFMGSetTol(precond, 0.0); HYPRE_StructPFMGSetZeroGuess(precond); HYPRE_StructPFMGSetRAPType(precond, rap); + HYPRE_StructPFMGSetMatmultType(precond, matmult); HYPRE_StructPFMGSetRelaxType(precond, relax); if (usr_jacobi_weight) { @@ -1905,33 +1999,10 @@ main( hypre_int argc, (HYPRE_Solver) precond); } - else if (solver_id == 12) - { - /* use symmetric SparseMSG as preconditioner */ - HYPRE_StructSparseMSGCreate(hypre_MPI_COMM_WORLD, &precond); - HYPRE_StructSparseMSGSetMaxIter(precond, 1); - HYPRE_StructSparseMSGSetJump(precond, jump); - HYPRE_StructSparseMSGSetTol(precond, 0.0); - HYPRE_StructSparseMSGSetZeroGuess(precond); - HYPRE_StructSparseMSGSetRelaxType(precond, relax); - if (usr_jacobi_weight) - { - HYPRE_StructSparseMSGSetJacobiWeight(precond, jacobi_weight); - } - HYPRE_StructSparseMSGSetNumPreRelax(precond, n_pre); - HYPRE_StructSparseMSGSetNumPostRelax(precond, n_post); - HYPRE_StructSparseMSGSetPrintLevel(precond, prec_print_level); - HYPRE_StructSparseMSGSetLogging(precond, 0); - HYPRE_PCGSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSetup, - (HYPRE_Solver) precond); - } - else if (solver_id == 17) { /* use two-step Jacobi as preconditioner */ - HYPRE_StructJacobiCreate(hypre_MPI_COMM_WORLD, &precond); + HYPRE_StructJacobiCreate(comm, &precond); HYPRE_StructJacobiSetMaxIter(precond, 2); HYPRE_StructJacobiSetTol(precond, 0.0); HYPRE_StructJacobiSetZeroGuess(precond); @@ -1959,12 +2030,12 @@ main( hypre_int argc, } 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_LOBPCGSetMaxIter((HYPRE_Solver)lobpcg_solver, max_iterations); HYPRE_LOBPCGSetPrecondUsageMode((HYPRE_Solver)lobpcg_solver, pcgMode); HYPRE_LOBPCGSetTol((HYPRE_Solver)lobpcg_solver, tol); HYPRE_LOBPCGSetPrintLevel((HYPRE_Solver)lobpcg_solver, verbosity); @@ -1980,7 +2051,7 @@ main( hypre_int argc, eigenvectors = mv_MultiVectorCreateFromSampleVector( interpreter, blockSize, x ); - eigenvalues = hypre_CTAlloc(HYPRE_Real, blockSize, HYPRE_MEMORY_HOST); + eigenvalues = hypre_CTAlloc( HYPRE_Real, blockSize, HYPRE_MEMORY_HOST); if ( lobpcgSeed ) { @@ -1998,13 +2069,12 @@ main( hypre_int argc, eigenvectors, eigenvalues ); 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(); @@ -2022,12 +2092,10 @@ main( hypre_int argc, utilities_FortranMatrixDestroy( gramXX ); utilities_FortranMatrixDestroy( identity ); - } if ( printLevel ) { - if ( myid == 0 ) { if ( (filePtr = fopen("values.txt", "w")) ) @@ -2084,10 +2152,6 @@ main( hypre_int argc, { HYPRE_StructPFMGDestroy(precond); } - else if (solver_id == 12) - { - HYPRE_StructSparseMSGDestroy(precond); - } else if (solver_id == 17) { HYPRE_StructJacobiDestroy(precond); @@ -2095,7 +2159,7 @@ main( hypre_int argc, HYPRE_LOBPCGDestroy((HYPRE_Solver)lobpcg_solver); mv_MultiVectorDestroy( eigenvectors ); - hypre_TFree(eigenvalues, HYPRE_MEMORY_HOST); + hypre_TFree( eigenvalues, HYPRE_MEMORY_HOST); } else { @@ -2103,14 +2167,14 @@ main( hypre_int argc, hypre_BeginTiming(time_index); HYPRE_LOBPCGCreate(interpreter, &matvec_fn, (HYPRE_Solver*)&solver); - HYPRE_LOBPCGSetMaxIter( (HYPRE_Solver)solver, maxIterations ); + HYPRE_LOBPCGSetMaxIter( (HYPRE_Solver)solver, max_iterations ); HYPRE_LOBPCGSetTol( (HYPRE_Solver)solver, tol ); HYPRE_LOBPCGSetPrintLevel( (HYPRE_Solver)solver, verbosity ); if (solver_id == 10) { /* use symmetric SMG as preconditioner */ - HYPRE_StructSMGCreate(hypre_MPI_COMM_WORLD, &precond); + HYPRE_StructSMGCreate(comm, &precond); HYPRE_StructSMGSetMemoryUse(precond, 0); HYPRE_StructSMGSetMaxIter(precond, 1); HYPRE_StructSMGSetTol(precond, 0.0); @@ -2131,11 +2195,13 @@ main( hypre_int argc, else if (solver_id == 11) { /* use symmetric PFMG as preconditioner */ - HYPRE_StructPFMGCreate(hypre_MPI_COMM_WORLD, &precond); + HYPRE_StructPFMGCreate(comm, &precond); + HYPRE_StructPFMGSetMaxLevels(precond, max_levels); HYPRE_StructPFMGSetMaxIter(precond, 1); HYPRE_StructPFMGSetTol(precond, 0.0); HYPRE_StructPFMGSetZeroGuess(precond); HYPRE_StructPFMGSetRAPType(precond, rap); + HYPRE_StructPFMGSetMatmultType(precond, matmult); HYPRE_StructPFMGSetRelaxType(precond, relax); if (usr_jacobi_weight) { @@ -2156,33 +2222,10 @@ main( hypre_int argc, (HYPRE_Solver) precond); } - else if (solver_id == 12) - { - /* use symmetric SparseMSG as preconditioner */ - HYPRE_StructSparseMSGCreate(hypre_MPI_COMM_WORLD, &precond); - HYPRE_StructSparseMSGSetMaxIter(precond, 1); - HYPRE_StructSparseMSGSetJump(precond, jump); - HYPRE_StructSparseMSGSetTol(precond, 0.0); - HYPRE_StructSparseMSGSetZeroGuess(precond); - HYPRE_StructSparseMSGSetRelaxType(precond, relax); - if (usr_jacobi_weight) - { - HYPRE_StructSparseMSGSetJacobiWeight(precond, jacobi_weight); - } - HYPRE_StructSparseMSGSetNumPreRelax(precond, n_pre); - HYPRE_StructSparseMSGSetNumPostRelax(precond, n_post); - HYPRE_StructSparseMSGSetPrintLevel(precond, prec_print_level); - HYPRE_StructSparseMSGSetLogging(precond, 0); - HYPRE_LOBPCGSetPrecond( (HYPRE_Solver) solver, - (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSetup, - (HYPRE_Solver) precond); - } - - else if (solver_id == 17) + else if (solver_id == 17) { /* use two-step Jacobi as preconditioner */ - HYPRE_StructJacobiCreate(hypre_MPI_COMM_WORLD, &precond); + HYPRE_StructJacobiCreate(comm, &precond); HYPRE_StructJacobiSetMaxIter(precond, 2); HYPRE_StructJacobiSetTol(precond, 0.0); HYPRE_StructJacobiSetZeroGuess(precond); @@ -2213,14 +2256,14 @@ main( hypre_int argc, ( (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(); eigenvectors = mv_MultiVectorCreateFromSampleVector( interpreter, blockSize, x ); - eigenvalues = hypre_CTAlloc(HYPRE_Real, blockSize, HYPRE_MEMORY_HOST); + eigenvalues = hypre_CTAlloc( HYPRE_Real, blockSize, HYPRE_MEMORY_HOST); if ( lobpcgSeed ) { @@ -2238,13 +2281,12 @@ main( hypre_int argc, ( (HYPRE_Solver)solver, constrains, eigenvectors, eigenvalues ); 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(); @@ -2262,12 +2304,10 @@ main( hypre_int argc, utilities_FortranMatrixDestroy( gramXX ); utilities_FortranMatrixDestroy( identity ); - } if ( printLevel ) { - if ( myid == 0 ) { if ( (filePtr = fopen("values.txt", "w")) ) @@ -2294,7 +2334,6 @@ main( hypre_int argc, if ( printLevel > 1 ) { - printBuffer = utilities_FortranMatrixCreate(); iterations = HYPRE_LOBPCGIterations( (HYPRE_Solver)solver ); @@ -2324,21 +2363,16 @@ main( hypre_int argc, { HYPRE_StructPFMGDestroy(precond); } - else if (solver_id == 12) - { - HYPRE_StructSparseMSGDestroy(precond); - } else if (solver_id == 17) { HYPRE_StructJacobiDestroy(precond); } mv_MultiVectorDestroy( eigenvectors ); - hypre_TFree(eigenvalues, HYPRE_MEMORY_HOST); + hypre_TFree( eigenvalues, HYPRE_MEMORY_HOST); } hypre_TFree( interpreter, HYPRE_MEMORY_HOST); - } /* end lobpcg */ @@ -2352,9 +2386,9 @@ main( hypre_int argc, time_index = hypre_InitializeTiming("Hybrid Setup"); hypre_BeginTiming(time_index); - HYPRE_StructHybridCreate(hypre_MPI_COMM_WORLD, &solver); - HYPRE_StructHybridSetDSCGMaxIter(solver, 100); - HYPRE_StructHybridSetPCGMaxIter(solver, 100); + HYPRE_StructHybridCreate(comm, &solver); + HYPRE_StructHybridSetDSCGMaxIter(solver, max_iterations); + HYPRE_StructHybridSetPCGMaxIter(solver, max_iterations); HYPRE_StructHybridSetTol(solver, tol); /*HYPRE_StructHybridSetPCGAbsoluteTolFactor(solver, 1.0e-200);*/ HYPRE_StructHybridSetConvergenceTol(solver, cf_tol); @@ -2373,7 +2407,7 @@ main( hypre_int argc, if (solver_id == 20) { /* use symmetric SMG as preconditioner */ - HYPRE_StructSMGCreate(hypre_MPI_COMM_WORLD, &precond); + HYPRE_StructSMGCreate(comm, &precond); HYPRE_StructSMGSetMemoryUse(precond, 0); HYPRE_StructSMGSetMaxIter(precond, 1); HYPRE_StructSMGSetTol(precond, 0.0); @@ -2394,11 +2428,13 @@ main( hypre_int argc, else if (solver_id == 21) { /* use symmetric PFMG as preconditioner */ - HYPRE_StructPFMGCreate(hypre_MPI_COMM_WORLD, &precond); + HYPRE_StructPFMGCreate(comm, &precond); + HYPRE_StructPFMGSetMaxLevels(precond, max_levels); HYPRE_StructPFMGSetMaxIter(precond, 1); HYPRE_StructPFMGSetTol(precond, 0.0); HYPRE_StructPFMGSetZeroGuess(precond); HYPRE_StructPFMGSetRAPType(precond, rap); + HYPRE_StructPFMGSetMatmultType(precond, matmult); HYPRE_StructPFMGSetRelaxType(precond, relax); if (usr_jacobi_weight) { @@ -2419,33 +2455,10 @@ main( hypre_int argc, precond); } - else if (solver_id == 22) - { - /* use symmetric SparseMSG as preconditioner */ - HYPRE_StructSparseMSGCreate(hypre_MPI_COMM_WORLD, &precond); - HYPRE_StructSparseMSGSetJump(precond, jump); - HYPRE_StructSparseMSGSetMaxIter(precond, 1); - HYPRE_StructSparseMSGSetTol(precond, 0.0); - HYPRE_StructSparseMSGSetZeroGuess(precond); - HYPRE_StructSparseMSGSetRelaxType(precond, relax); - if (usr_jacobi_weight) - { - HYPRE_StructSparseMSGSetJacobiWeight(precond, jacobi_weight); - } - HYPRE_StructSparseMSGSetNumPreRelax(precond, n_pre); - HYPRE_StructSparseMSGSetNumPostRelax(precond, n_post); - HYPRE_StructSparseMSGSetPrintLevel(precond, prec_print_level); - HYPRE_StructSparseMSGSetLogging(precond, 0); - HYPRE_StructHybridSetPrecond(solver, - HYPRE_StructSparseMSGSolve, - HYPRE_StructSparseMSGSetup, - precond); - } - HYPRE_StructHybridSetup(solver, A, b, 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(); @@ -2455,7 +2468,7 @@ main( hypre_int argc, HYPRE_StructHybridSolve(solver, A, b, 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(); @@ -2471,10 +2484,6 @@ main( hypre_int argc, { HYPRE_StructPFMGDestroy(precond); } - else if (solver_id == 22) - { - HYPRE_StructSparseMSGDestroy(precond); - } } /*----------------------------------------------------------- @@ -2486,9 +2495,9 @@ main( hypre_int argc, time_index = hypre_InitializeTiming("GMRES Setup"); hypre_BeginTiming(time_index); - HYPRE_StructGMRESCreate(hypre_MPI_COMM_WORLD, &solver); + HYPRE_StructGMRESCreate(comm, &solver); HYPRE_GMRESSetKDim( (HYPRE_Solver) solver, 5 ); - HYPRE_GMRESSetMaxIter( (HYPRE_Solver)solver, 100 ); + HYPRE_GMRESSetMaxIter( (HYPRE_Solver)solver, max_iterations ); HYPRE_GMRESSetTol( (HYPRE_Solver)solver, tol ); HYPRE_GMRESSetRelChange( (HYPRE_Solver)solver, 0 ); HYPRE_GMRESSetPrintLevel( (HYPRE_Solver)solver, solver_print_level ); @@ -2497,7 +2506,7 @@ main( hypre_int argc, if (solver_id == 30) { /* use symmetric SMG as preconditioner */ - HYPRE_StructSMGCreate(hypre_MPI_COMM_WORLD, &precond); + HYPRE_StructSMGCreate(comm, &precond); HYPRE_StructSMGSetMemoryUse(precond, 0); HYPRE_StructSMGSetMaxIter(precond, 1); HYPRE_StructSMGSetTol(precond, 0.0); @@ -2518,11 +2527,13 @@ main( hypre_int argc, else if (solver_id == 31) { /* use symmetric PFMG as preconditioner */ - HYPRE_StructPFMGCreate(hypre_MPI_COMM_WORLD, &precond); + HYPRE_StructPFMGCreate(comm, &precond); + HYPRE_StructPFMGSetMaxLevels(precond, max_levels); HYPRE_StructPFMGSetMaxIter(precond, 1); HYPRE_StructPFMGSetTol(precond, 0.0); HYPRE_StructPFMGSetZeroGuess(precond); HYPRE_StructPFMGSetRAPType(precond, rap); + HYPRE_StructPFMGSetMatmultType(precond, matmult); HYPRE_StructPFMGSetRelaxType(precond, relax); if (usr_jacobi_weight) { @@ -2543,33 +2554,10 @@ main( hypre_int argc, (HYPRE_Solver)precond); } - else if (solver_id == 32) - { - /* use symmetric SparseMSG as preconditioner */ - HYPRE_StructSparseMSGCreate(hypre_MPI_COMM_WORLD, &precond); - HYPRE_StructSparseMSGSetMaxIter(precond, 1); - HYPRE_StructSparseMSGSetJump(precond, jump); - HYPRE_StructSparseMSGSetTol(precond, 0.0); - HYPRE_StructSparseMSGSetZeroGuess(precond); - HYPRE_StructSparseMSGSetRelaxType(precond, relax); - if (usr_jacobi_weight) - { - HYPRE_StructSparseMSGSetJacobiWeight(precond, jacobi_weight); - } - HYPRE_StructSparseMSGSetNumPreRelax(precond, n_pre); - HYPRE_StructSparseMSGSetNumPostRelax(precond, n_post); - HYPRE_StructSparseMSGSetPrintLevel(precond, prec_print_level); - HYPRE_StructSparseMSGSetLogging(precond, 0); - HYPRE_GMRESSetPrecond( (HYPRE_Solver)solver, - (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSetup, - (HYPRE_Solver)precond); - } - else if (solver_id == 37) { /* use two-step Jacobi as preconditioner */ - HYPRE_StructJacobiCreate(hypre_MPI_COMM_WORLD, &precond); + HYPRE_StructJacobiCreate(comm, &precond); HYPRE_StructJacobiSetMaxIter(precond, 2); HYPRE_StructJacobiSetTol(precond, 0.0); HYPRE_StructJacobiSetZeroGuess(precond); @@ -2593,7 +2581,7 @@ main( hypre_int argc, ( (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(); @@ -2604,7 +2592,7 @@ main( hypre_int argc, ( (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(); @@ -2620,10 +2608,6 @@ main( hypre_int argc, { HYPRE_StructPFMGDestroy(precond); } - else if (solver_id == 32) - { - HYPRE_StructSparseMSGDestroy(precond); - } else if (solver_id == 37) { HYPRE_StructJacobiDestroy(precond); @@ -2639,8 +2623,8 @@ main( hypre_int argc, time_index = hypre_InitializeTiming("BiCGSTAB Setup"); hypre_BeginTiming(time_index); - HYPRE_StructBiCGSTABCreate(hypre_MPI_COMM_WORLD, &solver); - HYPRE_BiCGSTABSetMaxIter( (HYPRE_Solver)solver, 100 ); + HYPRE_StructBiCGSTABCreate(comm, &solver); + HYPRE_BiCGSTABSetMaxIter( (HYPRE_Solver)solver, max_iterations ); HYPRE_BiCGSTABSetTol( (HYPRE_Solver)solver, tol ); HYPRE_BiCGSTABSetPrintLevel( (HYPRE_Solver)solver, solver_print_level ); HYPRE_BiCGSTABSetLogging( (HYPRE_Solver)solver, 1 ); @@ -2648,7 +2632,7 @@ main( hypre_int argc, if (solver_id == 40) { /* use symmetric SMG as preconditioner */ - HYPRE_StructSMGCreate(hypre_MPI_COMM_WORLD, &precond); + HYPRE_StructSMGCreate(comm, &precond); HYPRE_StructSMGSetMemoryUse(precond, 0); HYPRE_StructSMGSetMaxIter(precond, 1); HYPRE_StructSMGSetTol(precond, 0.0); @@ -2669,11 +2653,13 @@ main( hypre_int argc, else if (solver_id == 41) { /* use symmetric PFMG as preconditioner */ - HYPRE_StructPFMGCreate(hypre_MPI_COMM_WORLD, &precond); + HYPRE_StructPFMGCreate(comm, &precond); + HYPRE_StructPFMGSetMaxLevels(precond, max_levels); HYPRE_StructPFMGSetMaxIter(precond, 1); HYPRE_StructPFMGSetTol(precond, 0.0); HYPRE_StructPFMGSetZeroGuess(precond); HYPRE_StructPFMGSetRAPType(precond, rap); + HYPRE_StructPFMGSetMatmultType(precond, matmult); HYPRE_StructPFMGSetRelaxType(precond, relax); if (usr_jacobi_weight) { @@ -2694,33 +2680,10 @@ main( hypre_int argc, (HYPRE_Solver)precond); } - else if (solver_id == 42) - { - /* use symmetric SparseMSG as preconditioner */ - HYPRE_StructSparseMSGCreate(hypre_MPI_COMM_WORLD, &precond); - HYPRE_StructSparseMSGSetMaxIter(precond, 1); - HYPRE_StructSparseMSGSetJump(precond, jump); - HYPRE_StructSparseMSGSetTol(precond, 0.0); - HYPRE_StructSparseMSGSetZeroGuess(precond); - HYPRE_StructSparseMSGSetRelaxType(precond, relax); - if (usr_jacobi_weight) - { - HYPRE_StructSparseMSGSetJacobiWeight(precond, jacobi_weight); - } - HYPRE_StructSparseMSGSetNumPreRelax(precond, n_pre); - HYPRE_StructSparseMSGSetNumPostRelax(precond, n_post); - HYPRE_StructSparseMSGSetPrintLevel(precond, prec_print_level); - HYPRE_StructSparseMSGSetLogging(precond, 0); - HYPRE_BiCGSTABSetPrecond( (HYPRE_Solver)solver, - (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSolve, - (HYPRE_PtrToSolverFcn) HYPRE_StructSparseMSGSetup, - (HYPRE_Solver)precond); - } - else if (solver_id == 47) { /* use two-step Jacobi as preconditioner */ - HYPRE_StructJacobiCreate(hypre_MPI_COMM_WORLD, &precond); + HYPRE_StructJacobiCreate(comm, &precond); HYPRE_StructJacobiSetMaxIter(precond, 2); HYPRE_StructJacobiSetTol(precond, 0.0); HYPRE_StructJacobiSetZeroGuess(precond); @@ -2744,7 +2707,7 @@ main( hypre_int argc, ( (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(); @@ -2755,7 +2718,7 @@ main( hypre_int argc, ( (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(); @@ -2771,10 +2734,6 @@ main( hypre_int argc, { HYPRE_StructPFMGDestroy(precond); } - else if (solver_id == 42) - { - HYPRE_StructSparseMSGDestroy(precond); - } else if (solver_id == 47) { HYPRE_StructJacobiDestroy(precond); @@ -2789,9 +2748,9 @@ main( hypre_int argc, time_index = hypre_InitializeTiming("LGMRES Setup"); hypre_BeginTiming(time_index); - HYPRE_StructLGMRESCreate(hypre_MPI_COMM_WORLD, &solver); + HYPRE_StructLGMRESCreate(comm, &solver); HYPRE_LGMRESSetKDim( (HYPRE_Solver) solver, 5 ); - HYPRE_LGMRESSetMaxIter( (HYPRE_Solver)solver, 100 ); + HYPRE_LGMRESSetMaxIter( (HYPRE_Solver)solver, max_iterations ); HYPRE_LGMRESSetTol( (HYPRE_Solver)solver, tol ); HYPRE_LGMRESSetPrintLevel( (HYPRE_Solver)solver, solver_print_level ); HYPRE_LGMRESSetLogging( (HYPRE_Solver)solver, 1 ); @@ -2799,7 +2758,7 @@ main( hypre_int argc, if (solver_id == 50) { /* use symmetric SMG as preconditioner */ - HYPRE_StructSMGCreate(hypre_MPI_COMM_WORLD, &precond); + HYPRE_StructSMGCreate(comm, &precond); HYPRE_StructSMGSetMemoryUse(precond, 0); HYPRE_StructSMGSetMaxIter(precond, 1); HYPRE_StructSMGSetTol(precond, 0.0); @@ -2820,11 +2779,13 @@ main( hypre_int argc, else if (solver_id == 51) { /* use symmetric PFMG as preconditioner */ - HYPRE_StructPFMGCreate(hypre_MPI_COMM_WORLD, &precond); + HYPRE_StructPFMGCreate(comm, &precond); + HYPRE_StructPFMGSetMaxLevels(precond, max_levels); HYPRE_StructPFMGSetMaxIter(precond, 1); HYPRE_StructPFMGSetTol(precond, 0.0); HYPRE_StructPFMGSetZeroGuess(precond); HYPRE_StructPFMGSetRAPType(precond, rap); + HYPRE_StructPFMGSetMatmultType(precond, matmult); HYPRE_StructPFMGSetRelaxType(precond, relax); if (usr_jacobi_weight) { @@ -2849,7 +2810,7 @@ main( hypre_int argc, ( (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(); @@ -2860,7 +2821,7 @@ main( hypre_int argc, ( (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(); @@ -2887,9 +2848,9 @@ main( hypre_int argc, time_index = hypre_InitializeTiming("FlexGMRES Setup"); hypre_BeginTiming(time_index); - HYPRE_StructFlexGMRESCreate(hypre_MPI_COMM_WORLD, &solver); + HYPRE_StructFlexGMRESCreate(comm, &solver); HYPRE_FlexGMRESSetKDim( (HYPRE_Solver) solver, 5 ); - HYPRE_FlexGMRESSetMaxIter( (HYPRE_Solver)solver, 100 ); + HYPRE_FlexGMRESSetMaxIter( (HYPRE_Solver)solver, max_iterations ); HYPRE_FlexGMRESSetTol( (HYPRE_Solver)solver, tol ); HYPRE_FlexGMRESSetPrintLevel( (HYPRE_Solver)solver, solver_print_level ); HYPRE_FlexGMRESSetLogging( (HYPRE_Solver)solver, 1 ); @@ -2897,7 +2858,7 @@ main( hypre_int argc, if (solver_id == 60) { /* use symmetric SMG as preconditioner */ - HYPRE_StructSMGCreate(hypre_MPI_COMM_WORLD, &precond); + HYPRE_StructSMGCreate(comm, &precond); HYPRE_StructSMGSetMemoryUse(precond, 0); HYPRE_StructSMGSetMaxIter(precond, 1); HYPRE_StructSMGSetTol(precond, 0.0); @@ -2918,11 +2879,13 @@ main( hypre_int argc, else if (solver_id == 61) { /* use symmetric PFMG as preconditioner */ - HYPRE_StructPFMGCreate(hypre_MPI_COMM_WORLD, &precond); + HYPRE_StructPFMGCreate(comm, &precond); + HYPRE_StructPFMGSetMaxLevels(precond, max_levels); HYPRE_StructPFMGSetMaxIter(precond, 1); HYPRE_StructPFMGSetTol(precond, 0.0); HYPRE_StructPFMGSetZeroGuess(precond); HYPRE_StructPFMGSetRAPType(precond, rap); + HYPRE_StructPFMGSetMatmultType(precond, matmult); HYPRE_StructPFMGSetRelaxType(precond, relax); if (usr_jacobi_weight) { @@ -2947,7 +2910,7 @@ main( hypre_int argc, ( (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(); @@ -2958,7 +2921,7 @@ main( hypre_int argc, ( (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(); @@ -2976,6 +2939,19 @@ main( hypre_int argc, } } + /* Compute residual */ + HYPRE_StructVectorCreate(comm, grid, &res); + HYPRE_StructVectorInitialize(res); + HYPRE_StructVectorAssemble(res); + HYPRE_StructVectorCopy(b, res); + HYPRE_StructMatrixMatvec(-1.0, A, x, 1.0, res); + HYPRE_StructVectorInnerProd(res, res, &real_res_norm); + real_res_norm = sqrt(real_res_norm); + if (rhs_norm > 0) + { + real_res_norm = real_res_norm / rhs_norm; + } + /*----------------------------------------------------------- * Print the solution and other info *-----------------------------------------------------------*/ @@ -2983,12 +2959,17 @@ main( hypre_int argc, if (print_system) { HYPRE_StructVectorPrint("struct.out.x", x, 0); + HYPRE_StructVectorPrint("struct.out.r", res, 0); } if (myid == 0 && rep == reps - 1 /* begin lobpcg */ && !lobpcgFlag /* end lobpcg */) { hypre_printf("\n"); hypre_printf("Iterations = %d\n", num_iterations); + // hypre_printf("RHS Norm = %20.15e\n", rhs_norm); + // hypre_printf("Initial LHS (x0) Norm = %20.15e\n", x0_norm); + // hypre_printf("Real Relative Residual Norm = %20.15e\n", real_res_norm); + // hypre_printf("Final Relative Residual Norm = %20.15e\n", final_res_norm); hypre_printf("Final Relative Residual Norm = %e\n", final_res_norm); hypre_printf("\n"); } @@ -3016,13 +2997,13 @@ main( hypre_int argc, for (i = 0; i < imax; i++) { - hypre_StructMatvecCompute(matvec_data, 1.0, A, x, 1.0, b); + hypre_StructMatvecCompute(matvec_data, 1.0, A, x, 1.0, b, b); } /* this counts mult-adds */ hypre_IncFLOPCount(7 * N * imax); hypre_EndTiming(time_index); - hypre_PrintTiming("Matvec time", hypre_MPI_COMM_WORLD); + hypre_PrintTiming("Matvec time", comm); hypre_FinalizeTiming(time_index); hypre_ClearTiming(); @@ -3038,8 +3019,9 @@ main( hypre_int argc, HYPRE_StructMatrixDestroy(A); HYPRE_StructVectorDestroy(b); HYPRE_StructVectorDestroy(x); + HYPRE_StructVectorDestroy(res); - for ( i = 0; i < (dim + 1); i++) + for (i = 0; i < stored_stencil_size; i++) { hypre_TFree(offsets[i], HYPRE_MEMORY_HOST); } @@ -3047,7 +3029,7 @@ main( hypre_int argc, } #if defined(HYPRE_USING_KOKKOS) - Kokkos::finalize (); + Kokkos::finalize(); #endif /* Finalize Hypre */ @@ -3075,266 +3057,592 @@ main( hypre_int argc, return (0); } +/* Macro for allocating and setting a 1D stencil offset */ +#define ALLOC_AND_SET_OFFSET1(i, o1) \ + offsets[i] = hypre_CTAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); \ + offsets[i][0] = o1 + +/* Macro for allocating and setting a 2D stencil offset */ +#define ALLOC_AND_SET_OFFSET2(i, o1, o2) \ + offsets[i] = hypre_CTAlloc(HYPRE_Int, 2, HYPRE_MEMORY_HOST); \ + offsets[i][0] = o1; \ + offsets[i][1] = o2 + +/* Macro for allocating and setting a 3D stencil offset */ +#define ALLOC_AND_SET_OFFSET3(i, o1, o2, o3) \ + offsets[i] = hypre_CTAlloc(HYPRE_Int, 3, HYPRE_MEMORY_HOST); \ + offsets[i][0] = o1; \ + offsets[i][1] = o2; \ + offsets[i][2] = o3 + +/*------------------------------------------------------------------------- + * Set 1D offsets for 3-pt stencil + *-------------------------------------------------------------------------*/ + +HYPRE_Int +SetStencilOffsets_1dim_3pt( HYPRE_Int ***offsets_ptr ) +{ + HYPRE_Int **offsets; + + offsets = hypre_CTAlloc(HYPRE_Int*, 3, HYPRE_MEMORY_HOST); + + ALLOC_AND_SET_OFFSET1(0, -1); + ALLOC_AND_SET_OFFSET1(1, 0); + ALLOC_AND_SET_OFFSET1(2, 1); + + /* Set output pointer */ + *offsets_ptr = offsets; + + return 0; +} + /*------------------------------------------------------------------------- - * add constant values to a vector. Need to pass the initialized vector, grid, - * period of grid and the constant value. + * Set 1D offsets for 3-pt symmetric stencil *-------------------------------------------------------------------------*/ HYPRE_Int -AddValuesVector( hypre_StructGrid *gridvector, +SetStencilOffsets_1dim_3pt_sym( HYPRE_Int ***offsets_ptr ) +{ + HYPRE_Int **offsets; + + offsets = hypre_CTAlloc(HYPRE_Int*, 2, HYPRE_MEMORY_HOST); + + ALLOC_AND_SET_OFFSET1(0, -1); + ALLOC_AND_SET_OFFSET1(1, 0); + + /* Set output pointer */ + *offsets_ptr = offsets; + + return 0; +} + +/*------------------------------------------------------------------------- + * Set 2D offsets for 5-pt stencil + *-------------------------------------------------------------------------*/ + +HYPRE_Int +SetStencilOffsets_2dim_5pt( HYPRE_Int ***offsets_ptr ) +{ + HYPRE_Int **offsets; + + offsets = hypre_CTAlloc(HYPRE_Int*, 5, HYPRE_MEMORY_HOST); + + ALLOC_AND_SET_OFFSET2(0, -1, 0); + ALLOC_AND_SET_OFFSET2(1, 0, -1); + ALLOC_AND_SET_OFFSET2(2, 0, 0); + ALLOC_AND_SET_OFFSET2(3, 1, 0); + ALLOC_AND_SET_OFFSET2(4, 0, 1); + + /* Set output pointer */ + *offsets_ptr = offsets; + + return 0; +} + +/*------------------------------------------------------------------------- + * Set 2D offsets for 5-pt symmetric stencil + *-------------------------------------------------------------------------*/ + +HYPRE_Int +SetStencilOffsets_2dim_5pt_sym( HYPRE_Int ***offsets_ptr ) +{ + HYPRE_Int **offsets; + + offsets = hypre_CTAlloc(HYPRE_Int*, 3, HYPRE_MEMORY_HOST); + + ALLOC_AND_SET_OFFSET2(0, -1, 0); + ALLOC_AND_SET_OFFSET2(1, 0, -1); + ALLOC_AND_SET_OFFSET2(2, 0, 0); + + /* Set output pointer */ + *offsets_ptr = offsets; + + return 0; +} + +/*------------------------------------------------------------------------- + * Set 3D offsets for 7-pt stencil + *-------------------------------------------------------------------------*/ + +HYPRE_Int +SetStencilOffsets_3dim_7pt( HYPRE_Int ***offsets_ptr ) +{ + HYPRE_Int **offsets; + + offsets = hypre_CTAlloc(HYPRE_Int*, 7, HYPRE_MEMORY_HOST); + + ALLOC_AND_SET_OFFSET3(0, -1, 0, 0); + ALLOC_AND_SET_OFFSET3(1, 0, -1, 0); + ALLOC_AND_SET_OFFSET3(2, 0, 0, -1); + ALLOC_AND_SET_OFFSET3(3, 0, 0, 0); + ALLOC_AND_SET_OFFSET3(4, 1, 0, 0); + ALLOC_AND_SET_OFFSET3(5, 0, 1, 0); + ALLOC_AND_SET_OFFSET3(6, 0, 0, 1); + + /* Set output pointer */ + *offsets_ptr = offsets; + + return 0; +} + +/*------------------------------------------------------------------------- + * Set 3D offsets for 7-pt symmetric stencil + *-------------------------------------------------------------------------*/ + +HYPRE_Int +SetStencilOffsets_3dim_7pt_sym( HYPRE_Int ***offsets_ptr ) +{ + HYPRE_Int **offsets; + + offsets = hypre_CTAlloc(HYPRE_Int*, 4, HYPRE_MEMORY_HOST); + + ALLOC_AND_SET_OFFSET3(0, -1, 0, 0); + ALLOC_AND_SET_OFFSET3(1, 0, -1, 0); + ALLOC_AND_SET_OFFSET3(2, 0, 0, -1); + ALLOC_AND_SET_OFFSET3(3, 0, 0, 0); + + /* Set output pointer */ + *offsets_ptr = offsets; + + return 0; +} + +/*------------------------------------------------------------------------- + * Set 3D offsets for 27-pt stencil + *-------------------------------------------------------------------------*/ + +HYPRE_Int +SetStencilOffsets_3dim_27pt( HYPRE_Int ***offsets_ptr ) +{ + HYPRE_Int **offsets; + + offsets = hypre_CTAlloc(HYPRE_Int*, 27, HYPRE_MEMORY_HOST); + + /* k = -1 */ + ALLOC_AND_SET_OFFSET3(0, 0, 0, -1); + ALLOC_AND_SET_OFFSET3(1, -1, 0, -1); + ALLOC_AND_SET_OFFSET3(2, 1, 0, -1); + ALLOC_AND_SET_OFFSET3(3, -1, -1, -1); + ALLOC_AND_SET_OFFSET3(4, 0, -1, -1); + ALLOC_AND_SET_OFFSET3(5, 1, -1, -1); + ALLOC_AND_SET_OFFSET3(6, -1, 1, -1); + ALLOC_AND_SET_OFFSET3(7, 0, 1, -1); + ALLOC_AND_SET_OFFSET3(8, 1, 1, -1); + + /* k = 0 */ + ALLOC_AND_SET_OFFSET3(9, 0, 0, 0); + ALLOC_AND_SET_OFFSET3(10, -1, 0, 0); + ALLOC_AND_SET_OFFSET3(11, 1, 0, 0); + ALLOC_AND_SET_OFFSET3(12, -1, -1, 0); + ALLOC_AND_SET_OFFSET3(13, 0, -1, 0); + ALLOC_AND_SET_OFFSET3(14, 1, -1, 0); + ALLOC_AND_SET_OFFSET3(15, -1, 1, 0); + ALLOC_AND_SET_OFFSET3(16, 0, 1, 0); + ALLOC_AND_SET_OFFSET3(17, 1, 1, 0); + + /* k = 1 */ + ALLOC_AND_SET_OFFSET3(18, 0, 0, 1); + ALLOC_AND_SET_OFFSET3(19, -1, 0, 1); + ALLOC_AND_SET_OFFSET3(20, 1, 0, 1); + ALLOC_AND_SET_OFFSET3(21, -1, -1, 1); + ALLOC_AND_SET_OFFSET3(22, 0, -1, 1); + ALLOC_AND_SET_OFFSET3(23, 1, -1, 1); + ALLOC_AND_SET_OFFSET3(24, -1, 1, 1); + ALLOC_AND_SET_OFFSET3(25, 0, 1, 1); + ALLOC_AND_SET_OFFSET3(26, 1, 1, 1); + + /* Set output pointer */ + *offsets_ptr = offsets; + + return 0; +} + +/*------------------------------------------------------------------------- + * Set 3D offsets for 27-pt symmetric stencil + *-------------------------------------------------------------------------*/ + +HYPRE_Int +SetStencilOffsets_3dim_27pt_sym( HYPRE_Int ***offsets_ptr ) +{ + HYPRE_Int **offsets; + + offsets = hypre_CTAlloc(HYPRE_Int*, 14, HYPRE_MEMORY_HOST); + + /* Diagonal point */ + ALLOC_AND_SET_OFFSET3(0, 0, 0, 0); + + /* k = 0 */ + ALLOC_AND_SET_OFFSET3(1, -1, 0, 0); + ALLOC_AND_SET_OFFSET3(2, -1, -1, 0); + ALLOC_AND_SET_OFFSET3(3, 0, -1, 0); + ALLOC_AND_SET_OFFSET3(4, 1, -1, 0); + + /* k = -1 */ + ALLOC_AND_SET_OFFSET3(5, 0, 0, -1); + ALLOC_AND_SET_OFFSET3(6, -1, 0, -1); + ALLOC_AND_SET_OFFSET3(7, 1, 0, -1); + ALLOC_AND_SET_OFFSET3(8, -1, -1, -1); + ALLOC_AND_SET_OFFSET3(9, 0, -1, -1); + ALLOC_AND_SET_OFFSET3(10, 1, -1, -1); + ALLOC_AND_SET_OFFSET3(11, -1, 1, -1); + ALLOC_AND_SET_OFFSET3(12, 0, 1, -1); + ALLOC_AND_SET_OFFSET3(13, 1, 1, -1); + + /* Set output pointer */ + *offsets_ptr = offsets; + + return 0; +} + +/*------------------------------------------------------------------------- + * Set values to a vector. Need to pass the initialized vector, grid, + * period of grid, method for setting values, and the value. + * + * The variable "type" accepts the following parameters: + * 0: Use random entries in [-1.0, +1.0] with seed given by "value" + * 1: Use constant entries equal to "value" + * + * For periodic b.c. in all directions, rhs need to satisfy + * compatibility condition. Achieved by setting a source and + * sink of equal strength. + *-------------------------------------------------------------------------*/ + +HYPRE_Int +SetValuesVector( hypre_StructGrid *grid, hypre_StructVector *zvector, HYPRE_Int *period, - HYPRE_Real value ) + HYPRE_Int type, + HYPRE_Real value ) { - /* #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; - hypre_ForBoxI(ib, gridboxes) +#if defined(HYPRE_USING_GPU) + HYPRE_MemoryLocation memory_location = hypre_StructVectorMemoryLocation(zvector); +#endif + + HYPRE_Int ib; + hypre_IndexRef ilower, iupper; + hypre_Box *box; + hypre_BoxArray *boxes; + HYPRE_Real *values; + HYPRE_Real *values_h; + HYPRE_Int max_volume, volume, ndim; + + ndim = hypre_StructGridNDim(grid); + boxes = hypre_StructGridBoxes(grid); + hypre_SeedRand((HYPRE_Int)value); + + /* Compute max. volume among boxes, so we allocate values only once */ + max_volume = 0; + hypre_ForBoxI(ib, boxes) { - 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); + box = hypre_BoxArrayBox(boxes, ib); + max_volume = hypre_max(max_volume, hypre_BoxVolume(box)); + } - /*----------------------------------------------------------- - * 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. - *-----------------------------------------------------------*/ + /* Allocate value arrays */ + values_h = hypre_CTAlloc(HYPRE_Real, max_volume, HYPRE_MEMORY_HOST); +#if defined(HYPRE_USING_GPU) + values = hypre_CTAlloc(HYPRE_Real, max_volume, memory_location); +#else + values = values_h; +#endif + + hypre_ForBoxI(ib, boxes) + { + box = hypre_BoxArrayBox(boxes, ib); + volume = hypre_BoxVolume(box); - if ((dim == 2 && period[0] != 0 && period[1] != 0) || - (dim == 3 && period[0] != 0 && period[1] != 0 && period[2] != 0)) + if ((ndim == 2 && period[0] != 0 && period[1] != 0) || + (ndim == 3 && period[0] != 0 && period[1] != 0 && period[2] != 0)) { - values_h[0] = value; + values_h[0] = value; values_h[volume - 1] = -value; } else { - for (i = 0; i < volume; i++) + if (type > 0) + { + /* Use value */ + zypre_LoopBegin(volume, i) + { + values_h[i] = value; + } + zypre_LoopEnd() + } + else { - values_h[i] = value; + /* Use random numbers */ + zypre_LoopBegin(volume, i) + { + values_h[i] = 2.0 * hypre_Rand() - 1.0; + } + zypre_LoopEnd() } } +#if defined(HYPRE_USING_GPU) hypre_TMemcpy(values, values_h, HYPRE_Real, volume, memory_location, HYPRE_MEMORY_HOST); +#endif ilower = hypre_BoxIMin(box); iupper = hypre_BoxIMax(box); - HYPRE_StructVectorSetBoxValues(zvector, ilower, iupper, values); - - hypre_TFree(values, memory_location); - hypre_TFree(values_h, HYPRE_MEMORY_HOST); } - return ierr; + /* Free memory */ + hypre_TFree(values_h, HYPRE_MEMORY_HOST); +#if defined(HYPRE_USING_GPU) + hypre_TFree(values, memory_location); +#endif + + return 0; } -/****************************************************************************** +/*------------------------------------------------------------------------- * Adds values to matrix based on a 7 point (3d) * symmetric stencil for a convection-diffusion problem. * It need an initialized matrix, an assembled grid, and the constants * that determine the 7 point (3d) convection-diffusion. - ******************************************************************************/ + *-------------------------------------------------------------------------*/ HYPRE_Int -AddValuesMatrix(HYPRE_StructMatrix A, - HYPRE_StructGrid gridmatrix, - HYPRE_Real cx, - HYPRE_Real cy, - HYPRE_Real cz, - HYPRE_Real conx, - HYPRE_Real cony, - HYPRE_Real conz) +SetValuesMatrix( HYPRE_StructMatrix A, + HYPRE_StructGrid grid, + HYPRE_Real cx, + HYPRE_Real cy, + HYPRE_Real cz, + HYPRE_Real conx, + HYPRE_Real cony, + HYPRE_Real conz ) { +#if defined(HYPRE_USING_GPU) + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(A); +#endif - 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); + HYPRE_Int *stencil_indices; + HYPRE_Int stencil_size; + HYPRE_Int constant_coefficient; + hypre_BoxArray *boxes; + hypre_Box *box; + HYPRE_Real *vvalues = NULL, *vvalues_h = NULL; + HYPRE_Real *cvalues = NULL, *cvalues_h = NULL; + HYPRE_Int i, d, s, bi = 0; + hypre_IndexRef ilower, iupper; + HYPRE_Real east, west, north, south, top, bottom, center; + HYPRE_Int volume, max_volume; + HYPRE_Int ndim, sym; + + boxes = hypre_StructGridBoxes(grid); + ndim = hypre_StructGridNDim(grid); + sym = hypre_StructMatrixSymmetric(A); constant_coefficient = hypre_StructMatrixConstantCoefficient(A); bi = 0; - east = -cx; - west = -cx; - north = -cy; - south = -cy; - top = -cz; + east = -cx; + west = -cx; + north = -cy; + 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 = 0.0; + switch (ndim) + { + case 3: + center += 2.0 * cz; + HYPRE_FALLTHROUGH; + + case 2: + center += 2.0 * cy; + HYPRE_FALLTHROUGH; + + default: + center += 2.0 * cx; + break; + } - stencil_size = 1 + (2 - sym) * dim; - stencil_indices = hypre_CTAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); + stencil_size = 1 + (2 - sym) * ndim; + stencil_indices = hypre_CTAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); for (s = 0; s < stencil_size; s++) { stencil_indices[s] = s; } + /* Compute max. volume among boxes, so we allocate values only once */ + max_volume = 0; + hypre_ForBoxI(bi, boxes) + { + box = hypre_BoxArrayBox(boxes, bi); + max_volume = hypre_max(max_volume, hypre_BoxVolume(box)); + } + + /* Allocate value arrays */ + if (constant_coefficient == 0) + { + vvalues_h = hypre_CTAlloc(HYPRE_Real, max_volume * stencil_size, HYPRE_MEMORY_HOST); +#if defined(HYPRE_USING_GPU) + vvalues = hypre_CTAlloc(HYPRE_Real, max_volume * stencil_size, memory_location); +#endif + } + else if (constant_coefficient == 1) + { + cvalues_h = hypre_CTAlloc(HYPRE_Real, stencil_size, HYPRE_MEMORY_HOST); +#if defined(HYPRE_USING_GPU) + cvalues = hypre_CTAlloc(HYPRE_Real, stencil_size, memory_location); +#endif + } + else if (constant_coefficient == 2) + { + cvalues_h = hypre_CTAlloc(HYPRE_Real, stencil_size - 1, HYPRE_MEMORY_HOST); + vvalues_h = hypre_CTAlloc(HYPRE_Real, max_volume, HYPRE_MEMORY_HOST); +#if defined(HYPRE_USING_GPU) + cvalues = hypre_CTAlloc(HYPRE_Real, stencil_size - 1, memory_location); + vvalues = hypre_CTAlloc(HYPRE_Real, max_volume, memory_location); +#endif + } + +#if !defined(HYPRE_USING_GPU) + vvalues = vvalues_h; + cvalues = cvalues_h; +#endif + if (sym) { - if ( constant_coefficient == 0 ) + if (constant_coefficient == 0) { - hypre_ForBoxI(bi, gridboxes) + hypre_ForBoxI(bi, boxes) { - box = hypre_BoxArrayBox(gridboxes, bi); + box = hypre_BoxArrayBox(boxes, 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); - if (dim == 1) + if (ndim == 1) { for (d = 0; d < volume; d++) { - HYPRE_Int i = stencil_size * d; - values_h[i] = west; - values_h[i + 1] = center; + i = stencil_size * d; + + vvalues_h[i] = west; + vvalues_h[i + 1] = center; } } - else if (dim == 2) + else if (ndim == 2) { for (d = 0; d < volume; d++) { - HYPRE_Int i = stencil_size * d; - values_h[i] = west; - values_h[i + 1] = south; - values_h[i + 2] = center; + i = stencil_size * d; + + vvalues_h[i] = west; + vvalues_h[i + 1] = south; + vvalues_h[i + 2] = center; } } - else if (dim == 3) + else if (ndim == 3) { for (d = 0; d < volume; d++) { - HYPRE_Int i = stencil_size * d; - values_h[i] = west; - values_h[i + 1] = south; - values_h[i + 2] = bottom; - values_h[i + 3] = center; + i = stencil_size * d; + + vvalues_h[i] = west; + vvalues_h[i + 1] = south; + vvalues_h[i + 2] = bottom; + vvalues_h[i + 3] = center; } } - hypre_TMemcpy(values, values_h, HYPRE_Real, stencil_size * volume, memory_location, - HYPRE_MEMORY_HOST); +#if defined(HYPRE_USING_GPU) + hypre_TMemcpy(vvalues, vvalues_h, HYPRE_Real, stencil_size * volume, + memory_location, HYPRE_MEMORY_HOST); +#endif ilower = hypre_BoxIMin(box); iupper = hypre_BoxIMax(box); - HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, stencil_size, - stencil_indices, values); - - hypre_TFree(values, memory_location); - hypre_TFree(values_h, HYPRE_MEMORY_HOST); + stencil_indices, vvalues); } } - else if ( constant_coefficient == 1 ) + else if (constant_coefficient == 1) { - values = hypre_CTAlloc(HYPRE_Real, stencil_size, HYPRE_MEMORY_HOST); - switch (dim) + switch (ndim) { case 1: - values[0] = west; - values[1] = center; + cvalues_h[0] = west; + cvalues_h[1] = center; break; + case 2: - values[0] = west; - values[1] = south; - values[2] = center; + cvalues_h[0] = west; + cvalues_h[1] = south; + cvalues_h[2] = center; break; + case 3: - values[0] = west; - values[1] = south; - values[2] = bottom; - values[3] = center; + cvalues_h[0] = west; + cvalues_h[1] = south; + cvalues_h[2] = bottom; + cvalues_h[3] = center; break; } - if (hypre_BoxArraySize(gridboxes) > 0) + +#if defined(HYPRE_USING_GPU) + hypre_TMemcpy(cvalues, cvalues_h, HYPRE_Real, stencil_size, + memory_location, HYPRE_MEMORY_HOST); +#endif + + if (hypre_BoxArraySize(boxes) > 0) { - HYPRE_StructMatrixSetConstantValues(A, stencil_size, - stencil_indices, values); + HYPRE_StructMatrixSetConstantValues(A, stencil_size, stencil_indices, cvalues); } - hypre_TFree(values, HYPRE_MEMORY_HOST); } 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); - switch (dim) + /* stencil index for the center equals ndim, so it's easy to leave out */ + switch (ndim) { case 1: - values[0] = west; + cvalues_h[0] = west; break; + case 2: - values[0] = west; - values[1] = south; + cvalues_h[0] = west; + cvalues_h[1] = south; break; + case 3: - values[0] = west; - values[1] = south; - values[2] = bottom; + cvalues_h[0] = west; + cvalues_h[1] = south; + cvalues_h[2] = bottom; break; } - if (hypre_BoxArraySize(gridboxes) > 0) + +#if defined(HYPRE_USING_GPU) + hypre_TMemcpy(cvalues, cvalues_h, HYPRE_Real, stencil_size - 1, + memory_location, HYPRE_MEMORY_HOST); +#endif + + if (hypre_BoxArraySize(boxes) > 0) { - HYPRE_StructMatrixSetConstantValues(A, stencil_size - 1, - stencil_indices, values); + HYPRE_StructMatrixSetConstantValues(A, stencil_size - 1, stencil_indices, cvalues); } - hypre_TFree(values, HYPRE_MEMORY_HOST); - hypre_ForBoxI(bi, gridboxes) + hypre_ForBoxI(bi, boxes) { - box = hypre_BoxArrayBox(gridboxes, bi); + box = hypre_BoxArrayBox(boxes, 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; for (i = 0; i < volume; i++) { - values_h[i] = center; + vvalues_h[i] = center; } - hypre_TMemcpy(values, values_h, HYPRE_Real, volume, memory_location, HYPRE_MEMORY_HOST); +#if defined(HYPRE_USING_GPU) + hypre_TMemcpy(vvalues, vvalues_h, HYPRE_Real, volume, + memory_location, HYPRE_MEMORY_HOST); +#endif ilower = hypre_BoxIMin(box); iupper = hypre_BoxIMax(box); - HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, 1, - stencil_indices + dim, values); - hypre_TFree(values, memory_location); - hypre_TFree(values_h, HYPRE_MEMORY_HOST); + HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, 1, stencil_indices + ndim, vvalues); } } } @@ -3350,6 +3658,7 @@ AddValuesMatrix(HYPRE_StructMatrix A, east += conx; center -= conx; } + if (cony > 0.0) { south -= cony; @@ -3360,127 +3669,134 @@ AddValuesMatrix(HYPRE_StructMatrix A, north += cony; center -= cony; } + if (conz > 0.0) { bottom -= conz; center += conz; } + else if (cony < 0.0) { top += conz; center -= conz; } - if ( constant_coefficient == 0 ) + if (constant_coefficient == 0) { - hypre_ForBoxI(bi, gridboxes) + hypre_ForBoxI(bi, boxes) { - box = hypre_BoxArrayBox(gridboxes, bi); + box = hypre_BoxArrayBox(boxes, 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); for (d = 0; d < volume; d++) { - HYPRE_Int i = stencil_size * d; - switch (dim) + i = stencil_size * d; + switch (ndim) { case 1: - values_h[i] = west; - values_h[i + 1] = center; - values_h[i + 2] = east; + vvalues_h[i] = west; + vvalues_h[i + 1] = center; + vvalues_h[i + 2] = east; break; + case 2: - values_h[i] = west; - values_h[i + 1] = south; - values_h[i + 2] = center; - values_h[i + 3] = east; - values_h[i + 4] = north; + vvalues_h[i] = west; + vvalues_h[i + 1] = south; + vvalues_h[i + 2] = center; + vvalues_h[i + 3] = east; + vvalues_h[i + 4] = north; break; + case 3: - 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; + vvalues_h[i] = west; + vvalues_h[i + 1] = south; + vvalues_h[i + 2] = bottom; + vvalues_h[i + 3] = center; + vvalues_h[i + 4] = east; + vvalues_h[i + 5] = north; + vvalues_h[i + 6] = top; break; } } - hypre_TMemcpy(values, values_h, HYPRE_Real, stencil_size * volume, memory_location, - HYPRE_MEMORY_HOST); +#if defined(HYPRE_USING_GPU) + hypre_TMemcpy(vvalues, vvalues_h, HYPRE_Real, stencil_size * volume, + memory_location, HYPRE_MEMORY_HOST); +#endif ilower = hypre_BoxIMin(box); iupper = hypre_BoxIMax(box); HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, stencil_size, - stencil_indices, values); - - hypre_TFree(values, memory_location); - hypre_TFree(values_h, HYPRE_MEMORY_HOST); + stencil_indices, vvalues); } } - else if ( constant_coefficient == 1 ) + else if (constant_coefficient == 1) { - values = hypre_CTAlloc( HYPRE_Real, stencil_size, HYPRE_MEMORY_HOST); - - switch (dim) + switch (ndim) { case 1: - values[0] = west; - values[1] = center; - values[2] = east; + cvalues_h[0] = west; + cvalues_h[1] = center; + cvalues_h[2] = east; break; + case 2: - values[0] = west; - values[1] = south; - values[2] = center; - values[3] = east; - values[4] = north; + cvalues_h[0] = west; + cvalues_h[1] = south; + cvalues_h[2] = center; + cvalues_h[3] = east; + cvalues_h[4] = north; break; + case 3: - values[0] = west; - values[1] = south; - values[2] = bottom; - values[3] = center; - values[4] = east; - values[5] = north; - values[6] = top; + cvalues_h[0] = west; + cvalues_h[1] = south; + cvalues_h[2] = bottom; + cvalues_h[3] = center; + cvalues_h[4] = east; + cvalues_h[5] = north; + cvalues_h[6] = top; break; } - if (hypre_BoxArraySize(gridboxes) > 0) +#if defined(HYPRE_USING_GPU) + hypre_TMemcpy(cvalues, cvalues_h, HYPRE_Real, stencil_size, + memory_location, HYPRE_MEMORY_HOST); +#endif + + if (hypre_BoxArraySize(boxes) > 0) { - HYPRE_StructMatrixSetConstantValues(A, stencil_size, - stencil_indices, values); + HYPRE_StructMatrixSetConstantValues(A, stencil_size, stencil_indices, cvalues); } - - hypre_TFree(values, HYPRE_MEMORY_HOST); } else { - hypre_assert( constant_coefficient == 2 ); - values = hypre_CTAlloc( HYPRE_Real, stencil_size - 1, HYPRE_MEMORY_HOST); - switch (dim) + hypre_assert(constant_coefficient == 2); + + switch (ndim) { /* no center in stencil_indices and values */ case 1: stencil_indices[0] = 0; stencil_indices[1] = 2; - values[0] = west; - values[1] = east; + + cvalues_h[0] = west; + cvalues_h[1] = east; break; + case 2: stencil_indices[0] = 0; stencil_indices[1] = 1; stencil_indices[2] = 3; stencil_indices[3] = 4; - values[0] = west; - values[1] = south; - values[2] = east; - values[3] = north; + + cvalues_h[0] = west; + cvalues_h[1] = south; + cvalues_h[2] = east; + cvalues_h[3] = north; break; + case 3: stencil_indices[0] = 0; stencil_indices[1] = 1; @@ -3488,53 +3804,460 @@ AddValuesMatrix(HYPRE_StructMatrix A, stencil_indices[3] = 4; stencil_indices[4] = 5; stencil_indices[5] = 6; - values[0] = west; - values[1] = south; - values[2] = bottom; - values[3] = east; - values[4] = north; - values[5] = top; + + cvalues_h[0] = west; + cvalues_h[1] = south; + cvalues_h[2] = bottom; + cvalues_h[3] = east; + cvalues_h[4] = north; + cvalues_h[5] = top; break; } - if (hypre_BoxArraySize(gridboxes) > 0) +#if defined(HYPRE_USING_GPU) + hypre_TMemcpy(cvalues, cvalues_h, HYPRE_Real, stencil_size - 1, + memory_location, HYPRE_MEMORY_HOST); +#endif + + if (hypre_BoxArraySize(boxes) > 0) { - HYPRE_StructMatrixSetConstantValues(A, stencil_size, - stencil_indices, values); + HYPRE_StructMatrixSetConstantValues(A, stencil_size - 1, stencil_indices, cvalues); } - hypre_TFree(values, HYPRE_MEMORY_HOST); - /* center is variable */ - stencil_indices[0] = dim; /* refers to center */ - hypre_ForBoxI(bi, gridboxes) + stencil_indices[0] = ndim; /* refers to center */ + hypre_ForBoxI(bi, boxes) { - box = hypre_BoxArrayBox(gridboxes, bi); + box = hypre_BoxArrayBox(boxes, 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; for (i = 0; i < volume; i++) { - values_h[i] = center; + vvalues_h[i] = center; } - hypre_TMemcpy(values, values_h, HYPRE_Real, volume, memory_location, HYPRE_MEMORY_HOST); +#if defined(HYPRE_USING_GPU) + hypre_TMemcpy(vvalues, vvalues_h, HYPRE_Real, volume, + memory_location, HYPRE_MEMORY_HOST); +#endif + + ilower = hypre_BoxIMin(box); + iupper = hypre_BoxIMax(box); + HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, 1, stencil_indices, vvalues); + } + } + } + +#if defined(HYPRE_USING_GPU) + hypre_TFree(cvalues, memory_location); + hypre_TFree(vvalues, memory_location); +#endif + hypre_TFree(stencil_indices, HYPRE_MEMORY_HOST); + hypre_TFree(cvalues_h, HYPRE_MEMORY_HOST); + hypre_TFree(vvalues_h, HYPRE_MEMORY_HOST); + + return 0; +} + +/*------------------------------------------------------------------------- + * Adds values to matrix based on 27pt (3d) stencil + * + * Models a diffusion equation with cross-derivative terms: + * + * c_x d²u/dx² + c_y d²u/dy² + c_z d²u/dz² + + * c_xy d²u/dxdy + c_xz d²u/dxdz + c_yz d²u/dydz = 0 + * + * The cross coefficients are computed as the geometric average + * of neighboring directional diffusion coefficients. + *-------------------------------------------------------------------------*/ + +HYPRE_Int +SetValuesCrossMatrix( HYPRE_StructMatrix A, + HYPRE_StructGrid grid, + HYPRE_Real cx, + HYPRE_Real cy, + HYPRE_Real cz ) +{ +#if defined(HYPRE_USING_GPU) + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(A); +#endif + + HYPRE_Int *stencil_indices; + HYPRE_Int stencil_size; + HYPRE_Int constant_coefficient; + hypre_BoxArray *boxes; + hypre_Box *box; + HYPRE_Real *vvalues = NULL, *vvalues_h = NULL; + HYPRE_Real *cvalues = NULL, *cvalues_h = NULL; + HYPRE_Int i, d, s, bi = 0; + hypre_IndexRef ilower, iupper; + HYPRE_Real center, cxy, cxz, cyz; + HYPRE_Int volume, max_volume, max_size; + HYPRE_Int ndim, sym; + + boxes = hypre_StructGridBoxes(grid); + ndim = hypre_StructGridNDim(grid); + sym = hypre_StructMatrixSymmetric(A); + constant_coefficient = hypre_StructMatrixConstantCoefficient(A); + + if (ndim != 3) + { + hypre_printf("%s valid only in 3D\n!", __func__); + hypre_MPI_Abort(hypre_MPI_COMM_WORLD, 1); + } + + bi = 0; + + cxy = hypre_sqrt(cx * cy) / 4.0; + cxz = hypre_sqrt(cx * cz) / 4.0; + cyz = hypre_sqrt(cy * cz) / 4.0; + center = 2.0 * (cx + cy + cz); + + stencil_size = (sym) ? 14 : 27; + stencil_indices = hypre_TAlloc(HYPRE_Int, stencil_size, HYPRE_MEMORY_HOST); + for (s = 0; s < stencil_size; s++) + { + stencil_indices[s] = s; + } + + /* Compute max. volume among boxes, so we allocate values only once */ + max_volume = 0; + hypre_ForBoxI(bi, boxes) + { + box = hypre_BoxArrayBox(boxes, bi); + max_volume = hypre_max(max_volume, hypre_BoxVolume(box)); + } + max_size = max_volume * stencil_size; + + /* Allocate value arrays */ + if (constant_coefficient == 0) + { + vvalues_h = hypre_TAlloc(HYPRE_Real, max_size, HYPRE_MEMORY_HOST); +#if defined(HYPRE_USING_GPU) + vvalues = hypre_TAlloc(HYPRE_Real, max_size, memory_location); +#endif + } + else if (constant_coefficient == 1) + { + cvalues_h = hypre_TAlloc(HYPRE_Real, stencil_size, HYPRE_MEMORY_HOST); +#if defined(HYPRE_USING_GPU) + cvalues = hypre_TAlloc(HYPRE_Real, stencil_size, memory_location); +#endif + } + else if (constant_coefficient == 2) + { + cvalues_h = hypre_TAlloc(HYPRE_Real, stencil_size - 1, HYPRE_MEMORY_HOST); + vvalues_h = hypre_TAlloc(HYPRE_Real, max_volume, HYPRE_MEMORY_HOST); +#if defined(HYPRE_USING_GPU) + cvalues = hypre_TAlloc(HYPRE_Real, stencil_size - 1, memory_location); + vvalues = hypre_TAlloc(HYPRE_Real, max_volume, memory_location); +#endif + } + +#if !defined(HYPRE_USING_GPU) + vvalues = vvalues_h; + cvalues = cvalues_h; +#endif + + if (sym) + { + if (constant_coefficient == 0) + { + hypre_ForBoxI(bi, boxes) + { + box = hypre_BoxArrayBox(boxes, bi); + volume = hypre_BoxVolume(box); + + for (d = 0; d < volume; d++) + { + i = stencil_size * d; + + /* Follow the order given by SetStencilOffsets_3dim_27pt_sym */ + vvalues_h[i + 0] = center; /* ( 0, 0, 0) */ + vvalues_h[i + 1] = -cx; /* (-1, 0, 0) */ + vvalues_h[i + 2] = -cxy; /* (-1, -1, 0) */ + vvalues_h[i + 3] = -cy; /* ( 0, -1, 0) */ + vvalues_h[i + 4] = +cxy; /* ( 1, -1, 0) */ + vvalues_h[i + 5] = -cz; /* ( 0, 0, -1) */ + vvalues_h[i + 6] = -cxz; /* (-1, 0, -1) */ + vvalues_h[i + 7] = +cxz; /* ( 1, 0, -1) */ + vvalues_h[i + 8] = 0.0; /* (-1, -1, -1) */ + vvalues_h[i + 9] = -cyz; /* ( 0, -1, -1) */ + vvalues_h[i + 10] = 0.0; /* ( 1, -1, -1) */ + vvalues_h[i + 11] = 0.0; /* (-1, 1, -1) */ + vvalues_h[i + 12] = +cyz; /* ( 0, 1, -1) */ + vvalues_h[i + 13] = 0.0; /* ( 1, 1, -1) */ + } + +#if defined(HYPRE_USING_GPU) + hypre_TMemcpy(vvalues, vvalues_h, HYPRE_Real, stencil_size * volume, + memory_location, HYPRE_MEMORY_HOST); +#endif + + ilower = hypre_BoxIMin(box); + iupper = hypre_BoxIMax(box); + HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, stencil_size, + stencil_indices, vvalues); + } + } + else if (constant_coefficient == 1) + { + cvalues_h[0] = center; /* ( 0, 0, 0) */ + cvalues_h[1] = -cx; /* (-1, 0, 0) */ + cvalues_h[2] = -cxy; /* (-1, -1, 0) */ + cvalues_h[3] = -cy; /* ( 0, -1, 0) */ + cvalues_h[4] = +cxy; /* ( 1, -1, 0) */ + cvalues_h[5] = -cz; /* ( 0, 0, -1) */ + cvalues_h[6] = -cxz; /* (-1, 0, -1) */ + cvalues_h[7] = +cxz; /* ( 1, 0, -1) */ + cvalues_h[8] = 0.0; /* (-1, -1, -1) */ + cvalues_h[9] = -cyz; /* ( 0, -1, -1) */ + cvalues_h[10] = 0.0; /* ( 1, -1, -1) */ + cvalues_h[11] = 0.0; /* (-1, 1, -1) */ + cvalues_h[12] = +cyz; /* ( 0, 1, -1) */ + cvalues_h[13] = 0.0; /* ( 1, 1, -1) */ + +#if defined(HYPRE_USING_GPU) + hypre_TMemcpy(cvalues, cvalues_h, HYPRE_Real, stencil_size, + memory_location, HYPRE_MEMORY_HOST); +#endif + + if (hypre_BoxArraySize(boxes) > 0) + { + HYPRE_StructMatrixSetConstantValues(A, stencil_size, stencil_indices, + cvalues); + } + } + else + { + hypre_assert(constant_coefficient == 2); + + cvalues_h[0] = -cx; /* (-1, 0, 0) */ + cvalues_h[1] = -cxy; /* (-1, -1, 0) */ + cvalues_h[2] = -cy; /* ( 0, -1, 0) */ + cvalues_h[3] = +cxy; /* ( 1, -1, 0) */ + cvalues_h[4] = -cz; /* ( 0, 0, -1) */ + cvalues_h[5] = -cxz; /* (-1, 0, -1) */ + cvalues_h[6] = +cxz; /* ( 1, 0, -1) */ + cvalues_h[7] = 0.0; /* (-1, -1, -1) */ + cvalues_h[8] = -cyz; /* ( 0, -1, -1) */ + cvalues_h[9] = 0.0; /* ( 1, -1, -1) */ + cvalues_h[10] = 0.0; /* (-1, 1, -1) */ + cvalues_h[11] = +cyz; /* ( 0, 1, -1) */ + cvalues_h[12] = 0.0; /* ( 1, 1, -1) */ + +#if defined(HYPRE_USING_GPU) + hypre_TMemcpy(cvalues, cvalues_h, HYPRE_Real, stencil_size - 1, + memory_location, HYPRE_MEMORY_HOST); +#endif + + if (hypre_BoxArraySize(boxes) > 0) + { + HYPRE_StructMatrixSetConstantValues(A, + stencil_size - 1, + stencil_indices + 1, + cvalues); + } + + hypre_ForBoxI(bi, boxes) + { + box = hypre_BoxArrayBox(boxes, bi); + volume = hypre_BoxVolume(box); + + for (i = 0; i < volume; i++) + { + vvalues_h[i] = center; + } + +#if defined(HYPRE_USING_GPU) + hypre_TMemcpy(vvalues, vvalues_h, HYPRE_Real, volume, + memory_location, HYPRE_MEMORY_HOST); +#endif ilower = hypre_BoxIMin(box); iupper = hypre_BoxIMax(box); HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, 1, - stencil_indices, values); - hypre_TFree(values, memory_location); - hypre_TFree(values_h, HYPRE_MEMORY_HOST); + stencil_indices, vvalues); + } + } + } + else + { + if (constant_coefficient == 0) + { + hypre_ForBoxI(bi, boxes) + { + box = hypre_BoxArrayBox(boxes, bi); + volume = hypre_BoxVolume(box); + + for (d = 0; d < volume; d++) + { + i = stencil_size * d; + + /* Follow the order given by SetStencilOffsets_3dim_27pt */ + vvalues_h[i + 0] = -cz; /* ( 0, 0, -1) */ + vvalues_h[i + 1] = -cxz; /* (-1, 0, -1) */ + vvalues_h[i + 2] = +cxz; /* ( 1, 0, -1) */ + vvalues_h[i + 3] = 0.0; /* (-1, -1, -1) */ + vvalues_h[i + 4] = -cyz; /* ( 0, -1, -1) */ + vvalues_h[i + 5] = 0.0; /* ( 1, -1, -1) */ + vvalues_h[i + 6] = 0.0; /* (-1, 1, -1) */ + vvalues_h[i + 7] = +cyz; /* ( 0, 1, -1) */ + vvalues_h[i + 8] = 0.0; /* ( 1, 1, -1) */ + + vvalues_h[i + 9] = center; /* ( 0, 0, 0) */ + vvalues_h[i + 10] = -cx; /* (-1, 0, 0) */ + vvalues_h[i + 11] = -cx; /* ( 1, 0, 0) */ + vvalues_h[i + 12] = -cxy; /* (-1, -1, 0) */ + vvalues_h[i + 13] = -cy; /* ( 0, -1, 0) */ + vvalues_h[i + 14] = +cxy; /* ( 1, -1, 0) */ + vvalues_h[i + 15] = +cxy; /* (-1, 1, 0) */ + vvalues_h[i + 16] = -cy; /* ( 0, 1, 0) */ + vvalues_h[i + 17] = -cxy; /* ( 1, 1, 0) */ + + vvalues_h[i + 18] = -cz; /* ( 0, 0, 1) */ + vvalues_h[i + 19] = +cxz; /* (-1, 0, 1) */ + vvalues_h[i + 20] = -cxz; /* ( 1, 0, 1) */ + vvalues_h[i + 21] = 0.0; /* (-1, -1, 1) */ + vvalues_h[i + 22] = +cyz; /* ( 0, -1, 1) */ + vvalues_h[i + 23] = 0.0; /* ( 1, -1, 1) */ + vvalues_h[i + 24] = 0.0; /* (-1, 1, 1) */ + vvalues_h[i + 25] = -cyz; /* ( 0, 1, 1) */ + vvalues_h[i + 26] = 0.0; /* ( 1, 1, 1) */ + } + +#if defined(HYPRE_USING_GPU) + hypre_TMemcpy(vvalues, vvalues_h, HYPRE_Real, stencil_size * volume, + memory_location, HYPRE_MEMORY_HOST); +#endif + + ilower = hypre_BoxIMin(box); + iupper = hypre_BoxIMax(box); + HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, stencil_size, + stencil_indices, vvalues); + } + } + else if (constant_coefficient == 1) + { + cvalues_h[0] = -cz; /* ( 0, 0, -1) */ + cvalues_h[1] = -cxz; /* (-1, 0, -1) */ + cvalues_h[2] = +cxz; /* ( 1, 0, -1) */ + cvalues_h[3] = 0.0; /* (-1, -1, -1) */ + cvalues_h[4] = -cyz; /* ( 0, -1, -1) */ + cvalues_h[5] = 0.0; /* ( 1, -1, -1) */ + cvalues_h[6] = 0.0; /* (-1, 1, -1) */ + cvalues_h[7] = +cyz; /* ( 0, 1, -1) */ + cvalues_h[8] = 0.0; /* ( 1, 1, -1) */ + cvalues_h[9] = center; /* ( 0, 0, 0) */ + cvalues_h[10] = -cx; /* (-1, 0, 0) */ + cvalues_h[11] = -cx; /* ( 1, 0, 0) */ + cvalues_h[12] = -cxy; /* (-1, -1, 0) */ + cvalues_h[13] = -cy; /* ( 0, -1, 0) */ + cvalues_h[14] = +cxy; /* ( 1, -1, 0) */ + cvalues_h[15] = +cxy; /* (-1, 1, 0) */ + cvalues_h[16] = -cy; /* ( 0, 1, 0) */ + cvalues_h[17] = -cxy; /* ( 1, 1, 0) */ + cvalues_h[18] = -cz; /* ( 0, 0, 1) */ + cvalues_h[19] = +cxz; /* (-1, 0, 1) */ + cvalues_h[20] = -cxz; /* ( 1, 0, 1) */ + cvalues_h[21] = 0.0; /* (-1, -1, 1) */ + cvalues_h[22] = +cyz; /* ( 0, -1, 1) */ + cvalues_h[23] = 0.0; /* ( 1, -1, 1) */ + cvalues_h[24] = 0.0; /* (-1, 1, 1) */ + cvalues_h[25] = -cyz; /* ( 0, 1, 1) */ + cvalues_h[26] = 0.0; /* ( 1, 1, 1) */ + +#if defined(HYPRE_USING_GPU) + hypre_TMemcpy(cvalues, cvalues_h, HYPRE_Real, stencil_size, + memory_location, HYPRE_MEMORY_HOST); +#endif + + if (hypre_BoxArraySize(boxes) > 0) + { + HYPRE_StructMatrixSetConstantValues(A, stencil_size, stencil_indices, + cvalues); + } + } + else + { + hypre_assert(constant_coefficient == 2); + + for (s = 0; s < 9; s++) { stencil_indices[s] = s; } + for (s = 0; s < 8; s++) { stencil_indices[s + 9] = s + 10; } + for (s = 0; s < 9; s++) { stencil_indices[s + 17] = s + 18; } + + cvalues_h[0] = -cz; /* ( 0, 0, -1) */ + cvalues_h[1] = -cxz; /* (-1, 0, -1) */ + cvalues_h[2] = +cxz; /* ( 1, 0, -1) */ + cvalues_h[3] = 0.0; /* (-1, -1, -1) */ + cvalues_h[4] = -cyz; /* ( 0, -1, -1) */ + cvalues_h[5] = 0.0; /* ( 1, -1, -1) */ + cvalues_h[6] = 0.0; /* (-1, 1, -1) */ + cvalues_h[7] = +cyz; /* ( 0, 1, -1) */ + cvalues_h[8] = 0.0; /* ( 1, 1, -1) */ + cvalues_h[9] = -cx; /* (-1, 0, 0) */ + cvalues_h[10] = -cx; /* ( 1, 0, 0) */ + cvalues_h[11] = -cxy; /* (-1, -1, 0) */ + cvalues_h[12] = -cy; /* ( 0, -1, 0) */ + cvalues_h[13] = +cxy; /* ( 1, -1, 0) */ + cvalues_h[14] = +cxy; /* (-1, 1, 0) */ + cvalues_h[15] = -cy; /* ( 0, 1, 0) */ + cvalues_h[16] = -cxy; /* ( 1, 1, 0) */ + cvalues_h[17] = -cz; /* ( 0, 0, 1) */ + cvalues_h[18] = +cxz; /* (-1, 0, 1) */ + cvalues_h[19] = -cxz; /* ( 1, 0, 1) */ + cvalues_h[20] = 0.0; /* (-1, -1, 1) */ + cvalues_h[21] = +cyz; /* ( 0, -1, 1) */ + cvalues_h[22] = 0.0; /* ( 1, -1, 1) */ + cvalues_h[23] = 0.0; /* (-1, 1, 1) */ + cvalues_h[24] = -cyz; /* ( 0, 1, 1) */ + cvalues_h[25] = 0.0; /* ( 1, 1, 1) */ + +#if defined(HYPRE_USING_GPU) + hypre_TMemcpy(cvalues, cvalues_h, HYPRE_Real, stencil_size - 1, + memory_location, HYPRE_MEMORY_HOST); +#endif + + if (hypre_BoxArraySize(boxes) > 0) + { + HYPRE_StructMatrixSetConstantValues(A, stencil_size - 1, stencil_indices, + cvalues); + } + + /* center is variable */ + stencil_indices[0] = 9; /* refers to center */ + hypre_ForBoxI(bi, boxes) + { + box = hypre_BoxArrayBox(boxes, bi); + volume = hypre_BoxVolume(box); + + for (i = 0; i < volume; i++) + { + vvalues_h[i] = center; + } + +#if defined(HYPRE_USING_GPU) + hypre_TMemcpy(vvalues, vvalues_h, HYPRE_Real, volume, + memory_location, HYPRE_MEMORY_HOST); +#endif + + ilower = hypre_BoxIMin(box); + iupper = hypre_BoxIMax(box); + HYPRE_StructMatrixSetBoxValues(A, ilower, iupper, 1, stencil_indices, + vvalues); } } } +#if defined(HYPRE_USING_GPU) + hypre_TFree(cvalues, memory_location); + hypre_TFree(vvalues, memory_location); +#endif hypre_TFree(stencil_indices, HYPRE_MEMORY_HOST); + hypre_TFree(cvalues_h, HYPRE_MEMORY_HOST); + hypre_TFree(vvalues_h, HYPRE_MEMORY_HOST); - return ierr; + return 0; } /********************************************************************************* @@ -3543,33 +4266,53 @@ AddValuesMatrix(HYPRE_StructMatrix A, *********************************************************************************/ HYPRE_Int -SetStencilBndry(HYPRE_StructMatrix A, - HYPRE_StructGrid gridmatrix, - HYPRE_Int *period) +SetStencilBndry( HYPRE_StructMatrix A, + HYPRE_StructStencil stencil, + HYPRE_StructGrid grid, + 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); - - gridboxes = hypre_StructGridBoxes(gridmatrix); - boundingbox = hypre_StructGridBoundingBox(gridmatrix); - istart = hypre_BoxIMin(boundingbox); - iend = hypre_BoxIMax(boundingbox); - size = hypre_StructGridNumBoxes(gridmatrix); - dim = hypre_StructGridNDim(gridmatrix); - stencil_indices = hypre_CTAlloc(HYPRE_Int, 1, HYPRE_MEMORY_HOST); + HYPRE_MemoryLocation memory_location = hypre_StructMatrixMemoryLocation(A); + hypre_BoxArray *boxes; + 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 *bbox; + HYPRE_Real *values; + HYPRE_Int ndim, sym; + HYPRE_Int constant_coefficient; + HYPRE_Int stencil_size = hypre_StructStencilSize(stencil); + HYPRE_Int stencil_indices[1] = {0}; + HYPRE_Int stencil_sizes_27pt_neg[3] = {9, 9, 9}; + HYPRE_Int stencil_indices_27pt_neg[3][9] = + {{1, 3, 6, 10, 12, 15, 19, 21, 24}, + {3, 4, 5, 12, 13, 14, 21, 22, 23}, + {0, 1, 2, 3, 4, 5, 6, 7, 8}}; + HYPRE_Int stencil_sizes_27pt_pos[3] = {9, 9, 9}; + HYPRE_Int stencil_indices_27pt_pos[3][9] = + {{2, 5, 8, 11, 14, 17, 20, 23, 26}, + {6, 7, 8, 15, 16, 17, 24, 25, 26}, + {18, 19, 20, 21, 22, 23, 24, 25, 26}}; + HYPRE_Int stencil_sizes_27pt_sym_neg[3] = {5, 6, 9}; + HYPRE_Int stencil_indices_27pt_sym_neg[3][9] = + {{1, 2, 6, 8, 11, -1, -1, -1, -1}, + {2, 3, 4, 8, 9, 10, -1, -1, -1}, + {5, 6, 7, 8, 9, 10, 11, 12, 13}}; + HYPRE_Int stencil_sizes_27pt_sym_pos[3] = {4, 3, 0}; + HYPRE_Int stencil_indices_27pt_sym_pos[3][4] = + {{4, 7, 10, 13}, + {11, 12, 13, -1}, + {-1, -1, -1, -1}}; + + boxes = hypre_StructGridBoxes(grid); + bbox = hypre_StructGridBoundingBox(grid); + istart = hypre_BoxIMin(bbox); + iend = hypre_BoxIMax(bbox); + size = hypre_StructGridNumBoxes(grid); + ndim = hypre_StructGridNDim(grid); + sym = hypre_StructMatrixSymmetric(A); constant_coefficient = hypre_StructMatrixConstantCoefficient(A); if ( constant_coefficient > 0 ) { return 1; } @@ -3577,58 +4320,85 @@ SetStencilBndry(HYPRE_StructMatrix A, and space dependence only for diagonal if constant_coefficient==2 -- and this function only touches off-diagonal entries */ - vol = hypre_CTAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); - ilower = hypre_CTAlloc(HYPRE_Int*, size, HYPRE_MEMORY_HOST); - iupper = hypre_CTAlloc(HYPRE_Int*, size, HYPRE_MEMORY_HOST); + vol = hypre_CTAlloc(HYPRE_Int, size, HYPRE_MEMORY_HOST); + ilower = hypre_CTAlloc(HYPRE_Int*, size, HYPRE_MEMORY_HOST); + iupper = hypre_CTAlloc(HYPRE_Int*, size, HYPRE_MEMORY_HOST); for (i = 0; i < size; i++) { - ilower[i] = hypre_CTAlloc(HYPRE_Int, dim, HYPRE_MEMORY_HOST); - iupper[i] = hypre_CTAlloc(HYPRE_Int, dim, HYPRE_MEMORY_HOST); + ilower[i] = hypre_CTAlloc(HYPRE_Int, ndim, HYPRE_MEMORY_HOST); + iupper[i] = hypre_CTAlloc(HYPRE_Int, ndim, HYPRE_MEMORY_HOST); } - i = 0; - ib = 0; - hypre_ForBoxI(i, gridboxes) + hypre_ForBoxI(i, boxes) { - dummybox = hypre_BoxCreate(dim); - box = hypre_BoxArrayBox(gridboxes, i); - volume = hypre_BoxVolume(box); - vol[i] = volume; - hypre_CopyBox(box, dummybox); - for (d = 0; d < dim; d++) - { - ilower[ib][d] = hypre_BoxIMinD(dummybox, d); - iupper[ib][d] = hypre_BoxIMaxD(dummybox, d); - } - ib++ ; - hypre_BoxDestroy(dummybox); + box = hypre_BoxArrayBox(boxes, i); + for (d = 0; d < ndim; d++) + { + ilower[i][d] = hypre_BoxIMinD(box, d); + iupper[i][d] = hypre_BoxIMaxD(box, d); + } + vol[i] = hypre_BoxVolume(box); } - if ( constant_coefficient == 0 ) + if (constant_coefficient == 0) { - for (d = 0; d < dim; d++) + for (d = 0; d < ndim; d++) { for (ib = 0; ib < size; ib++) { values = hypre_CTAlloc(HYPRE_Real, vol[ib], memory_location); - 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]; - stencil_indices[0] = d; - HYPRE_StructMatrixSetBoxValues(A, ilower[ib], iupper[ib], - 1, stencil_indices, values); + if (stencil_size != 14 && stencil_size != 27) + { + stencil_indices[0] = d; + HYPRE_StructMatrixSetBoxValues(A, ilower[ib], iupper[ib], + 1, stencil_indices, values); + } + else if (stencil_size == 14 && ndim == 3 && sym) + { + HYPRE_StructMatrixSetBoxValues(A, ilower[ib], iupper[ib], + stencil_sizes_27pt_sym_neg[d], + stencil_indices_27pt_sym_neg[d], + values); + } + else if (stencil_size == 27 && ndim == 3 && !sym) + { + HYPRE_StructMatrixSetBoxValues(A, ilower[ib], iupper[ib], + stencil_sizes_27pt_neg[d], + stencil_indices_27pt_neg[d], + values); + } 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]; - stencil_indices[0] = dim + 1 + d; - HYPRE_StructMatrixSetBoxValues(A, ilower[ib], iupper[ib], - 1, stencil_indices, values); + if (stencil_size != 14 && stencil_size != 27) + { + stencil_indices[0] = ndim + 1 + d; + HYPRE_StructMatrixSetBoxValues(A, ilower[ib], iupper[ib], + 1, stencil_indices, values); + } + else if (stencil_size == 14 && ndim == 3 && sym) + { + HYPRE_StructMatrixSetBoxValues(A, ilower[ib], iupper[ib], + stencil_sizes_27pt_sym_pos[d], + stencil_indices_27pt_sym_pos[d], + values); + } + else if (stencil_size == 27 && ndim == 3 && !sym) + { + HYPRE_StructMatrixSetBoxValues(A, ilower[ib], iupper[ib], + stencil_sizes_27pt_pos[d], + stencil_indices_27pt_pos[d], + values); + } ilower[ib][d] = j; } @@ -3638,7 +4408,6 @@ SetStencilBndry(HYPRE_StructMatrix A, } hypre_TFree(vol, HYPRE_MEMORY_HOST); - hypre_TFree(stencil_indices, HYPRE_MEMORY_HOST); for (ib = 0 ; ib < size ; ib++) { hypre_TFree(ilower[ib], HYPRE_MEMORY_HOST); @@ -3647,5 +4416,5 @@ SetStencilBndry(HYPRE_StructMatrix A, hypre_TFree(ilower, HYPRE_MEMORY_HOST); hypre_TFree(iupper, HYPRE_MEMORY_HOST); - return ierr; + return 0; } diff --git a/src/test/struct_migrate.c b/src/test/struct_migrate.c index 66f44c6285..8a6c8230d5 100644 --- a/src/test/struct_migrate.c +++ b/src/test/struct_migrate.c @@ -381,8 +381,8 @@ main( hypre_int argc, * Check the migration and print the result *-----------------------------------------------------------*/ - hypre_StructAxpy(-1.0, to_vector, check_vector); - check = hypre_StructInnerProd (check_vector, check_vector); + hypre_StructVectorAxpy(-1.0, to_vector, 1.0, check_vector, check_vector); + check = hypre_StructInnerProd(check_vector, check_vector); if (myid == 0) { diff --git a/src/test/struct_mp.c b/src/test/struct_mp.c new file mode 100644 index 0000000000..6e0ba9acac --- /dev/null +++ b/src/test/struct_mp.c @@ -0,0 +1,2560 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 +#include +#include +#include + +#include "HYPRE.h" +#include "HYPRE_struct_mv.h" +#include "HYPRE_struct_ls.h" +#include "HYPRE_krylov.h" + +#define HYPRE_MFLOPS 0 +#if HYPRE_MFLOPS +#include "_hypre_struct_mv.h" +#endif + +/* RDF: Why is this include here? */ +//#include "_hypre_struct_mv.h" + +#ifdef HYPRE_DEBUG +/*#include */ +#endif + +HYPRE_Int SetStencilBndry_mp(HYPRE_StructMatrix A, HYPRE_StructGrid gridmatrix, HYPRE_Int* period); + +HYPRE_Int AddValuesVector_mp(hypre_StructGrid *gridvector, + hypre_StructVector *zvector, + HYPRE_Int *period, + void *value, + size_t size) ; + +HYPRE_Int AddValuesMatrix_mp(HYPRE_StructMatrix A, + HYPRE_StructGrid gridmatrix, + void *cx, + void *cy, + void *cz, + void *conx, + void *cony, + void *conz, + size_t size); + +/*-------------------------------------------------------------------------- + * Test driver for structured matrix interface (structured storage) + *--------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------- + * Standard 7-point laplacian in 3D with grid and anisotropy determined + * as command line arguments. Do `driver -help' for usage info. + *----------------------------------------------------------------------*/ + +hypre_int +main( hypre_int argc, + char *argv[] ) +{ + HYPRE_Int arg_index; + HYPRE_Int print_usage; + HYPRE_Int print_level = 0; + HYPRE_Int nx, ny, nz; + HYPRE_Int P, Q, R; + HYPRE_Int bx, by, bz; + HYPRE_Int px, py, pz; + double cx, cy, cz; + double conx, cony, conz; + HYPRE_Int solver_id; + HYPRE_Int solver_type; + HYPRE_Int recompute_res; + HYPRE_Int flex = 0; + + /*HYPRE_Real dxyz[3];*/ + + HYPRE_Int num_ghost[6] = {0, 0, 0, 0, 0, 0}; + HYPRE_Int A_num_ghost[6] = {0, 0, 0, 0, 0, 0}; + HYPRE_Int v_num_ghost[6] = {0, 0, 0, 0, 0, 0}; + + HYPRE_StructMatrix A_dbl; + HYPRE_StructVector b_dbl; + HYPRE_StructVector x_dbl; + HYPRE_StructMatrix A_flt; + HYPRE_StructVector b_flt; + HYPRE_StructVector x_flt; + + HYPRE_StructSolver solver; + HYPRE_StructSolver precond; + HYPRE_Int num_iterations; + HYPRE_Int time_index; + double final_res_norm; + double 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 = 0; + HYPRE_Int skip; + HYPRE_Int sym; + HYPRE_Int rap; + HYPRE_Int relax; + double jacobi_weight; + HYPRE_Int usr_jacobi_weight; + HYPRE_Int rep, reps; + + HYPRE_Int **iupper; + HYPRE_Int **ilower; + + HYPRE_Int istart[3]; + HYPRE_Int periodic[3]; + HYPRE_Int **offsets; + HYPRE_Int constant_coefficient = 0; + HYPRE_Int *stencil_entries; + HYPRE_Int stencil_size; + HYPRE_Int stencil_diag_entry; + + HYPRE_StructGrid grid; + HYPRE_StructGrid readgrid; + HYPRE_StructStencil stencil; + + HYPRE_Int i, s; + HYPRE_Int ix, iy, iz, ib; + + HYPRE_Int read_fromfile_param; + HYPRE_Int read_fromfile_index; + HYPRE_Int read_rhsfromfile_param; + HYPRE_Int read_rhsfromfile_index; + HYPRE_Int read_x0fromfile_param; + HYPRE_Int read_x0fromfile_index; + HYPRE_Int periodx0[3] = {0, 0, 0}; + HYPRE_Int *readperiodic; + HYPRE_Int sum; + + 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 + + /* 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 + + /* Default precision values */ + HYPRE_Int precision_id; /* 0=flt, 1=dbl, 2=ldbl */ + HYPRE_Precision solver_precision = HYPRE_REAL_DOUBLE; + HYPRE_Precision precond_precision = HYPRE_REAL_SINGLE; + hypre_long_double one_ldbl = 1.0; + hypre_double one_dbl = 1.0; + hypre_float one_flt = 1.0f; + hypre_long_double zero_ldbl = 0.0; + hypre_double zero_dbl = 0.0; + hypre_float zero_flt = 0.0f; + void *one_slvr = &one_dbl; + void *one_pc = &one_flt; + void *zero_slvr = &zero_dbl; + void *zero_pc = &zero_flt; + /* convection variables */ + hypre_long_double params_ldbl[6]; /*cx, cy, cz, conx, cony, conz*/ + hypre_double params_dbl[6]; + hypre_float params_flt[6]; + + void *conx_slvr, *cony_slvr, *conz_slvr; + void *cx_slvr, *cy_slvr, *cz_slvr; + void *conx_pc, *cony_pc, *conz_pc; + void *cx_pc, *cy_pc, *cz_pc; + /* Size of solver and preconditioner data types */ + size_t slvr_size_t = sizeof(hypre_double); + size_t pc_size_t = sizeof(hypre_float); + /*----------------------------------------------------------- + * Initialize some stuff + *-----------------------------------------------------------*/ + /* Initialize MPI */ + MPI_Init(&argc, &argv); + MPI_Comm_size(MPI_COMM_WORLD, &num_procs ); + MPI_Comm_rank(MPI_COMM_WORLD, &myid ); + + /*----------------------------------------------------------- + * Set defaults + *-----------------------------------------------------------*/ + + dim = 3; + + skip = 0; + sym = 1; + rap = 0; + relax = 1; + jacobi_weight = 1.0; + usr_jacobi_weight = 0; + reps = 1; + + nx = 10; + ny = 10; + nz = 10; + + P = num_procs; + Q = 1; + R = 1; + + bx = 1; + by = 1; + bz = 1; + + cx = 1.0; + cy = 1.0; + cz = 1.0; + conx = 0.0; + cony = 0.0; + conz = 0.0; + + params_ldbl[0] = (long double)cx; + params_ldbl[1] = (long double)cy; + params_ldbl[2] = (long double)cz; + params_dbl[0] = (double)cx; + params_dbl[1] = (double)cy; + params_dbl[2] = (double)cz; + params_flt[0] = (float)cx; + params_flt[1] = (float)cy; + params_flt[2] = (float)cz; + + params_ldbl[3] = (long double)conx; + params_ldbl[4] = (long double)cony; + params_ldbl[5] = (long double)conz; + params_dbl[3] = (double)conx; + params_dbl[4] = (double)cony; + params_dbl[5] = (double)conz; + params_flt[3] = (float)conx; + params_flt[4] = (float)cony; + params_flt[5] = (float)conz; + + n_pre = 1; + n_post = 1; + + solver_id = 0; + solver_type = 1; + recompute_res = 1; /* What should be the default here? */ + + istart[0] = -3; + istart[1] = -3; + istart[2] = -3; + + px = 0; + py = 0; + pz = 0; + + tol = 1.e-8; + + /* setting defaults for the reading parameters */ + read_fromfile_param = 0; + read_fromfile_index = argc; + read_rhsfromfile_param = 0; + read_rhsfromfile_index = argc; + read_x0fromfile_param = 0; + read_x0fromfile_index = argc; + sum = 0; + + /* ghost defaults */ + for (i = 0; i < 2 * dim; i++) + { + num_ghost[i] = 1; + A_num_ghost[i] = num_ghost[i]; + v_num_ghost[i] = num_ghost[i]; + } + + //device_level = nx*ny*nz; + /*----------------------------------------------------------- + * Parse command line + *-----------------------------------------------------------*/ + + print_usage = 0; + arg_index = 1; + 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++]); + //device_level = nx*ny*nz; + } + else if ( strcmp(argv[arg_index], "-istart") == 0 ) + { + arg_index++; + istart[0] = atoi(argv[arg_index++]); + istart[1] = atoi(argv[arg_index++]); + istart[2] = 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], "-b") == 0 ) + { + arg_index++; + bx = atoi(argv[arg_index++]); + by = atoi(argv[arg_index++]); + bz = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-p") == 0 ) + { + arg_index++; + px = atoi(argv[arg_index++]); + py = atoi(argv[arg_index++]); + pz = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-c") == 0 ) + { + arg_index++; + cx = (double)atof(argv[arg_index++]); + cy = (double)atof(argv[arg_index++]); + cz = (double)atof(argv[arg_index++]); + params_ldbl[0] = (long double)cx; + params_ldbl[1] = (long double)cy; + params_ldbl[2] = (long double)cz; + params_dbl[0] = (double)cx; + params_dbl[1] = (double)cy; + params_dbl[2] = (double)cz; + params_flt[0] = (float)cx; + params_flt[1] = (float)cy; + params_flt[2] = (float)cz; + } + else if ( strcmp(argv[arg_index], "-convect") == 0 ) + { + arg_index++; + conx = (double)atof(argv[arg_index++]); + cony = (double)atof(argv[arg_index++]); + conz = (double)atof(argv[arg_index++]); + params_ldbl[3] = (long double)conx; + params_ldbl[4] = (long double)cony; + params_ldbl[5] = (long double)conz; + params_dbl[3] = (double)conx; + params_dbl[4] = (double)cony; + params_dbl[5] = (double)conz; + params_flt[3] = (float)conx; + params_flt[4] = (float)cony; + params_flt[5] = (float)conz; + } + else if ( strcmp(argv[arg_index], "-d") == 0 ) + { + arg_index++; + dim = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-fromfile") == 0 ) + { + arg_index++; + read_fromfile_param = 1; + read_fromfile_index = arg_index; + } + else if ( strcmp(argv[arg_index], "-rhsfromfile") == 0 ) + { + arg_index++; + read_rhsfromfile_param = 1; + read_rhsfromfile_index = arg_index; + } + else if ( strcmp(argv[arg_index], "-x0fromfile") == 0 ) + { + arg_index++; + read_x0fromfile_param = 1; + read_x0fromfile_index = arg_index; + } + else if (strcmp(argv[arg_index], "-repeats") == 0 ) + { + arg_index++; + reps = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-solver") == 0 ) + { + arg_index++; + + solver_id = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-v") == 0 ) + { + arg_index++; + n_pre = atoi(argv[arg_index++]); + n_post = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-rap") == 0 ) + { + arg_index++; + rap = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-relax") == 0 ) + { + arg_index++; + relax = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-w") == 0 ) + { + arg_index++; + jacobi_weight = (double)atof(argv[arg_index++]); + usr_jacobi_weight = 1; /* flag user weight */ + } + else if ( strcmp(argv[arg_index], "-sym") == 0 ) + { + arg_index++; + sym = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-skip") == 0 ) + { + arg_index++; + skip = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-solver_type") == 0 ) + { + arg_index++; + solver_type = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-recompute") == 0 ) + { + arg_index++; + recompute_res = 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], "-tol") == 0 ) + { + arg_index++; + tol = (double)atof(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-print") == 0 ) + { + arg_index++; + print_system = 1; + } + else if ( strcmp(argv[arg_index], "-print_lvl") == 0 ) + { + arg_index++; + print_level = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-help") == 0 ) + { + print_usage = 1; + break; + } + 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++; + default_exec_policy = HYPRE_EXEC_HOST; + } + else if ( strcmp(argv[arg_index], "-exec_device") == 0 ) + { + arg_index++; + default_exec_policy = HYPRE_EXEC_DEVICE; + } + else if ( strcmp(argv[arg_index], "-solver_precision") == 0 ) + { + arg_index++; + precision_id = atoi(argv[arg_index++]); + + switch (precision_id) + { + case 0: + solver_precision = HYPRE_REAL_SINGLE; + one_slvr = &one_flt; + zero_slvr = &zero_flt; + slvr_size_t = sizeof(hypre_float); + break; + case 1: + solver_precision = HYPRE_REAL_DOUBLE; + one_slvr = &one_dbl; + zero_slvr = &zero_dbl; + slvr_size_t = sizeof(hypre_double); + break; + case 2: + solver_precision = HYPRE_REAL_LONGDOUBLE; + one_slvr = &one_ldbl; + zero_slvr = &zero_ldbl; + slvr_size_t = sizeof(hypre_long_double); + break; + } + } + else if ( strcmp(argv[arg_index], "-pc_precision") == 0 ) + { + arg_index++; + precision_id = atoi(argv[arg_index++]); + + switch (precision_id) + { + case 0: + precond_precision = HYPRE_REAL_SINGLE; + one_pc = &one_flt; + zero_pc = &zero_flt; + pc_size_t = sizeof(hypre_float); + break; + case 1: + precond_precision = HYPRE_REAL_DOUBLE; + one_pc = &one_dbl; + zero_pc = &zero_dbl; + pc_size_t = sizeof(hypre_double); + break; + case 2: + precond_precision = HYPRE_REAL_LONGDOUBLE; + one_pc = &one_ldbl; + zero_pc = &zero_ldbl; + pc_size_t = sizeof(hypre_long_double); + break; + } + } + else + { + arg_index++; + } + } + + /* default memory location */ + //HYPRE_SetMemoryLocation(memory_location); + + /* default execution policy */ + //HYPRE_SetExecutionPolicy(default_exec_policy); + + sum = read_x0fromfile_param + read_rhsfromfile_param + read_fromfile_param; + + /*----------------------------------------------------------- + * Print usage info + *-----------------------------------------------------------*/ + + if ( (print_usage) && (myid == 0) ) + { + hypre_printf("\n"); + hypre_printf("Usage: %s []\n", argv[0]); + hypre_printf("\n"); + hypre_printf(" -n : problem size per block\n"); + hypre_printf(" -istart : start of box\n"); + hypre_printf(" -P : processor topology\n"); + hypre_printf(" -b : blocking per processor\n"); + hypre_printf(" -p : periodicity in each dimension\n"); + hypre_printf(" -c : diffusion coefficients\n"); + hypre_printf(" -convect : convection coefficients\n"); + hypre_printf(" -d : problem dimension (2 or 3)\n"); + hypre_printf(" -fromfile : prefix name for matrixfiles\n"); + hypre_printf(" -rhsfromfile : prefix name for rhsfiles\n"); + hypre_printf(" -x0fromfile : prefix name for firstguessfiles\n"); + hypre_printf(" -repeats : number of times to repeat the run, default 1. For solver 0,1,3\n"); + hypre_printf(" -solver : solver ID\n"); + hypre_printf(" 0 - SMG (default)\n"); + hypre_printf(" 1 - PFMG\n"); + hypre_printf(" 3 - PFMG constant coeffs\n"); + hypre_printf(" 4 - PFMG constant coeffs var diag\n"); + hypre_printf(" 10 -- 19 - CG\n"); + hypre_printf(" 10 - CG with SMG precond\n"); + hypre_printf(" 11 - CG with PFMG precond\n"); + hypre_printf(" 13 - CG with PFMG-3 precond\n"); + hypre_printf(" 14 - CG with PFMG-4 precond\n"); + hypre_printf(" 15 - CG with single-prec SMG precond\n"); + hypre_printf(" 16 - CG with single-prec PFMG precond\n"); + hypre_printf(" 18 - CG with diagonal scaling\n"); + hypre_printf(" 20 -- 29 - GMRES\n"); + hypre_printf(" 20 - GMRES with SMG precond\n"); + hypre_printf(" 21 - GMRES with PFMG precond\n"); + hypre_printf(" 25 - GMRES with single-prec SMG precond\n"); + hypre_printf(" 26 - GMRES with single-prec PFMG precond\n"); + hypre_printf(" 28 - GMRES with diagonal scaling\n"); + hypre_printf(" 30 -- 39 - FlexGMRES\n"); + hypre_printf(" 30 - FlexGMRES with SMG precond\n"); + hypre_printf(" 31 - FlexGMRES with PFMG precond\n"); + hypre_printf(" 35 - FlexGMRES with single-prec SMG precond\n"); + hypre_printf(" 36 - FlexGMRES with single-prec PFMG precond\n"); + hypre_printf(" 38 - FlexGMRES with diagonal scaling\n"); + hypre_printf(" 39 - FlexGMRES\n"); + hypre_printf(" 40 -- 49 - BiCGSTAB\n"); + hypre_printf(" 40 - BiCGSTAB with SMG precond\n"); + hypre_printf(" 41 - BiCGSTAB with PFMG precond\n"); + hypre_printf(" 45 - BiCGSTAB with single-prec SMG precond\n"); + hypre_printf(" 46 - BiCGSTAB with single-prec PFMG precond\n"); + hypre_printf(" 48 - BiCGSTAB with diagonal scaling\n"); + hypre_printf(" -v : number of pre and post relaxations\n"); + hypre_printf(" -rap : coarse grid operator type\n"); + hypre_printf(" 0 - Galerkin (default)\n"); + hypre_printf(" 1 - non-Galerkin ParFlow operators\n"); + hypre_printf(" 2 - Galerkin, general operators\n"); + hypre_printf(" -relax : relaxation type\n"); + hypre_printf(" 0 - Jacobi\n"); + hypre_printf(" 1 - Weighted Jacobi (default)\n"); + hypre_printf(" 2 - R/B Gauss-Seidel\n"); + hypre_printf(" 3 - R/B Gauss-Seidel (nonsymmetric)\n"); + hypre_printf(" -w : jacobi weight\n"); + hypre_printf(" -skip : skip levels in PFMG (0 or 1)\n"); + hypre_printf(" -sym : symmetric storage (1) or not (0)\n"); + hypre_printf(" -solver_type : solver type for Hybrid\n"); + hypre_printf(" 1 - PCG (default)\n"); + hypre_printf(" 2 - GMRES\n"); + hypre_printf(" -recompute : Recompute residual in PCG?\n"); + hypre_printf(" -cf : convergence factor for Hybrid\n"); + + hypre_printf("\n"); + hypre_printf(" -solver_precision

: solver precision\n"); + hypre_printf(" Precision for outer solver (Krylov solver) \n"); + hypre_printf(" 0 = flt, 1 = dbl, 2 = long_dbl\n"); + hypre_printf("\n"); + hypre_printf(" -precond_precision

: precond precision\n"); + hypre_printf(" Precision for inner solver (preconditioner) \n"); + hypre_printf(" 0 = flt, 1 = dbl, 2 = long_dbl\n"); + hypre_printf("\n"); + } + + if ( print_usage ) + { + exit(1); + } + + /*----------------------------------------------------------- + * Check a few things + *-----------------------------------------------------------*/ + + if ((P * Q * R) > num_procs) + { + if (myid == 0) + { + hypre_printf("Error: PxQxR is more than the number of processors\n"); + } + exit(1); + } + else if ((P * Q * R) < num_procs) + { + if (myid == 0) + { + hypre_printf("Warning: PxQxR is less than the number of processors\n"); + } + } + + if ((conx != 0.0 || cony != 0 || conz != 0) && sym == 1 ) + { + if (myid == 0) + { + hypre_printf("Warning: Convection produces non-symmetric matrix\n"); + } + sym = 0; + } + + /*----------------------------------------------------------- + * Print driver parameters + *-----------------------------------------------------------*/ + + 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]); + 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); + hypre_printf(" (cx, cy, cz) = (%f, %f, %f)\n", cx, cy, cz); + hypre_printf(" (conx,cony,conz)= (%f, %f, %f)\n", conx, cony, conz); + hypre_printf(" (n_pre, n_post) = (%d, %d)\n", n_pre, n_post); + hypre_printf(" dim = %d\n", dim); + hypre_printf(" skip = %d\n", skip); + hypre_printf(" sym = %d\n", sym); + hypre_printf(" rap = %d\n", rap); + hypre_printf(" relax = %d\n", relax); + hypre_printf(" solver ID = %d\n", solver_id); + /* hypre_printf(" Device level = %d\n", device_level); */ + } + + if (myid == 0 && sum > 0) + { + hypre_printf("Running with these driver parameters:\n"); + hypre_printf(" (cx, cy, cz) = (%f, %f, %f)\n", cx, cy, cz); + hypre_printf(" (conx,cony,conz)= (%f, %f, %f)\n", conx, cony, conz); + hypre_printf(" (n_pre, n_post) = (%d, %d)\n", n_pre, n_post); + hypre_printf(" dim = %d\n", dim); + hypre_printf(" skip = %d\n", skip); + hypre_printf(" sym = %d\n", sym); + hypre_printf(" rap = %d\n", rap); + hypre_printf(" relax = %d\n", relax); + hypre_printf(" solver ID = %d\n", solver_id); + hypre_printf(" the grid is read from file \n"); + + } + + /*----------------------------------------------------------- + * Synchronize so that timings make sense + *-----------------------------------------------------------*/ + + MPI_Barrier(MPI_COMM_WORLD); + + for ( rep = 0; rep < reps; ++rep ) + { + time_index = hypre_InitializeTiming("Struct Interface"); + hypre_BeginTiming(time_index); + + /*----------------------------------------------------------- + * Set up the stencil structure (7 points) when matrix is NOT read from file + * Set up the grid structure used when NO files are read + *-----------------------------------------------------------*/ + + switch (dim) + { + case 1: + nblocks = bx; + if (sym) + { + offsets = (HYPRE_Int **) hypre_CAlloc(2, (size_t)sizeof(HYPRE_Int *), HYPRE_MEMORY_HOST); + offsets[0] = (HYPRE_Int *) hypre_CAlloc(1, (size_t)sizeof(HYPRE_Int ), HYPRE_MEMORY_HOST); + offsets[0][0] = -1; + offsets[1] = (HYPRE_Int *) hypre_CAlloc(1, (size_t)sizeof(HYPRE_Int ), HYPRE_MEMORY_HOST); + offsets[1][0] = 0; + } + else + { + offsets = (HYPRE_Int **) hypre_CAlloc(3, (size_t)sizeof(HYPRE_Int *), HYPRE_MEMORY_HOST); + offsets[0] = (HYPRE_Int *) hypre_CAlloc(1, (size_t)sizeof(HYPRE_Int), HYPRE_MEMORY_HOST); + offsets[0][0] = -1; + offsets[1] = (HYPRE_Int *) hypre_CAlloc(1, (size_t)sizeof(HYPRE_Int), HYPRE_MEMORY_HOST); + offsets[1][0] = 0; + offsets[2] = (HYPRE_Int *) hypre_CAlloc(1, (size_t)sizeof(HYPRE_Int), 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_Int **) hypre_CAlloc(3, (size_t)sizeof(HYPRE_Int *), HYPRE_MEMORY_HOST); + offsets[0] = (HYPRE_Int *) hypre_CAlloc(2, (size_t)sizeof(HYPRE_Int), HYPRE_MEMORY_HOST); + offsets[0][0] = -1; + offsets[0][1] = 0; + offsets[1] = (HYPRE_Int *) hypre_CAlloc(2, (size_t)sizeof(HYPRE_Int), HYPRE_MEMORY_HOST); + offsets[1][0] = 0; + offsets[1][1] = -1; + offsets[2] = (HYPRE_Int *) hypre_CAlloc(2, (size_t)sizeof(HYPRE_Int), HYPRE_MEMORY_HOST); + offsets[2][0] = 0; + offsets[2][1] = 0; + } + else + { + offsets = (HYPRE_Int **) hypre_CAlloc(5, (size_t)sizeof(HYPRE_Int *), HYPRE_MEMORY_HOST); + offsets[0] = (HYPRE_Int *) hypre_CAlloc(2, (size_t)sizeof(HYPRE_Int), HYPRE_MEMORY_HOST); + offsets[0][0] = -1; + offsets[0][1] = 0; + offsets[1] = (HYPRE_Int *) hypre_CAlloc(2, (size_t)sizeof(HYPRE_Int), HYPRE_MEMORY_HOST); + offsets[1][0] = 0; + offsets[1][1] = -1; + offsets[2] = (HYPRE_Int *) hypre_CAlloc(2, (size_t)sizeof(HYPRE_Int), HYPRE_MEMORY_HOST); + offsets[2][0] = 0; + offsets[2][1] = 0; + offsets[3] = (HYPRE_Int *) hypre_CAlloc(2, (size_t)sizeof(HYPRE_Int), HYPRE_MEMORY_HOST); + offsets[3][0] = 1; + offsets[3][1] = 0; + offsets[4] = (HYPRE_Int *) hypre_CAlloc(2, (size_t)sizeof(HYPRE_Int), 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_Int **) hypre_CAlloc(4, (size_t)sizeof(HYPRE_Int *), HYPRE_MEMORY_HOST); + offsets[0] = (HYPRE_Int *) hypre_CAlloc(3, (size_t)sizeof(HYPRE_Int), HYPRE_MEMORY_HOST); + offsets[0][0] = -1; + offsets[0][1] = 0; + offsets[0][2] = 0; + offsets[1] = (HYPRE_Int *) hypre_CAlloc(3, (size_t)sizeof(HYPRE_Int), HYPRE_MEMORY_HOST); + offsets[1][0] = 0; + offsets[1][1] = -1; + offsets[1][2] = 0; + offsets[2] = (HYPRE_Int *) hypre_CAlloc(3, (size_t)sizeof(HYPRE_Int), HYPRE_MEMORY_HOST); + offsets[2][0] = 0; + offsets[2][1] = 0; + offsets[2][2] = -1; + offsets[3] = (HYPRE_Int *) hypre_CAlloc(3, (size_t)sizeof(HYPRE_Int), HYPRE_MEMORY_HOST); + offsets[3][0] = 0; + offsets[3][1] = 0; + offsets[3][2] = 0; + } + else + { + offsets = (HYPRE_Int **) hypre_CAlloc(7, (size_t)sizeof(HYPRE_Int *), HYPRE_MEMORY_HOST); + offsets[0] = (HYPRE_Int *) hypre_CAlloc(3, (size_t)sizeof(HYPRE_Int), HYPRE_MEMORY_HOST); + offsets[0][0] = -1; + offsets[0][1] = 0; + offsets[0][2] = 0; + offsets[1] = (HYPRE_Int *) hypre_CAlloc(3, (size_t)sizeof(HYPRE_Int), HYPRE_MEMORY_HOST); + offsets[1][0] = 0; + offsets[1][1] = -1; + offsets[1][2] = 0; + offsets[2] = (HYPRE_Int *) hypre_CAlloc(3, (size_t)sizeof(HYPRE_Int), HYPRE_MEMORY_HOST); + offsets[2][0] = 0; + offsets[2][1] = 0; + offsets[2][2] = -1; + offsets[3] = (HYPRE_Int *) hypre_CAlloc(3, (size_t)sizeof(HYPRE_Int), HYPRE_MEMORY_HOST); + offsets[3][0] = 0; + offsets[3][1] = 0; + offsets[3][2] = 0; + offsets[4] = (HYPRE_Int *) hypre_CAlloc(3, (size_t)sizeof(HYPRE_Int), HYPRE_MEMORY_HOST); + offsets[4][0] = 1; + offsets[4][1] = 0; + offsets[4][2] = 0; + offsets[5] = (HYPRE_Int *) hypre_CAlloc(3, (size_t)sizeof(HYPRE_Int), HYPRE_MEMORY_HOST); + offsets[5][0] = 0; + offsets[5][1] = 1; + offsets[5][2] = 0; + offsets[6] = (HYPRE_Int *) hypre_CAlloc(3, (size_t)sizeof(HYPRE_Int), 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)) + { + /* My processor has no data on it */ + nblocks = bx = by = bz = 0; + } + + /*----------------------------------------------------------- + * Set up the stencil structure needed for matrix creation + * which is always the case for read_fromfile_param == 0 + * + * The following struct stencil functions are integer operations and + * can be called in any precision. We default to the solver precision here. + *-----------------------------------------------------------*/ + + HYPRE_StructStencilCreate_pre( solver_precision,dim, (2 - sym)*dim + 1, &stencil); + for (s = 0; s < (2 - sym)*dim + 1; s++) + { + HYPRE_StructStencilSetElement_pre( solver_precision,stencil, s, offsets[s]); + } + + /*----------------------------------------------------------- + * Set up periodic + *-----------------------------------------------------------*/ + + periodic[0] = px; + periodic[1] = py; + periodic[2] = pz; + + /*----------------------------------------------------------- + * Set up dxyz for PFMG solver + *-----------------------------------------------------------*/ + +#if 0 + dxyz[0] = 1.0e+123; + dxyz[1] = 1.0e+123; + dxyz[2] = 1.0e+123; + if (cx > 0) + { + dxyz[0] = hypre_sqrt(1.0 / cx); + } + if (cy > 0) + { + dxyz[1] = hypre_sqrt(1.0 / cy); + } + if (cz > 0) + { + dxyz[2] = hypre_sqrt(1.0 / cz); + } +#endif + + /* beginning of sum == 0 */ + if (sum == 0) /* no read from any file */ + { + /*----------------------------------------------------------- + * prepare space for the extents + *-----------------------------------------------------------*/ + + ilower = (HYPRE_Int **) hypre_CAlloc((size_t)(nblocks), (size_t)sizeof(HYPRE_Int*), + HYPRE_MEMORY_HOST); + iupper = (HYPRE_Int **) hypre_CAlloc((size_t)(nblocks), (size_t)sizeof(HYPRE_Int*), + HYPRE_MEMORY_HOST); + for (i = 0; i < nblocks; i++) + { + ilower[i] = (HYPRE_Int *) hypre_CAlloc((size_t)(dim), (size_t)sizeof(HYPRE_Int), + HYPRE_MEMORY_HOST); + iupper[i] = (HYPRE_Int *) hypre_CAlloc((size_t)(dim), (size_t)sizeof(HYPRE_Int), + HYPRE_MEMORY_HOST); + } + + /* compute ilower and iupper from (p,q,r), (bx,by,bz), and (nx,ny,nz) */ + ib = 0; + switch (dim) + { + 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; + ib++; + } + break; + case 2: + 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; + ib++; + } + break; + case 3: + for (iz = 0; iz < bz; iz++) + 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; + ib++; + } + break; + } + + /* The following struct grid functions are integer operations and + * can be called in any precision. We default to the solver precision here. + */ + HYPRE_StructGridCreate_pre( solver_precision,hypre_MPI_COMM_WORLD, dim, &grid); + for (ib = 0; ib < nblocks; ib++) + { + /* Add to the grid a new box defined by ilower[ib], iupper[ib]...*/ + HYPRE_StructGridSetExtents_pre( solver_precision,grid, ilower[ib], iupper[ib]); + } + HYPRE_StructGridSetPeriodic_pre( solver_precision,grid, periodic); + HYPRE_StructGridSetNumGhost_pre( solver_precision,grid, num_ghost); + HYPRE_StructGridAssemble_pre( solver_precision,grid); + + /*----------------------------------------------------------- + * Set up the matrix structure + *-----------------------------------------------------------*/ + + HYPRE_StructMatrixCreate_pre(solver_precision, hypre_MPI_COMM_WORLD, grid, stencil, &A_dbl); + HYPRE_StructMatrixCreate_pre(precond_precision, hypre_MPI_COMM_WORLD, grid, stencil, &A_flt); + + if ( solver_id == 3 || solver_id == 4 || + solver_id == 13 || solver_id == 14 ) + { + stencil_size = hypre_StructStencilSize(stencil); + /* integer array allocation */ + stencil_entries = (HYPRE_Int *) hypre_CAlloc ((size_t)(stencil_size), (size_t)sizeof(HYPRE_Int), + HYPRE_MEMORY_HOST); + if ( solver_id == 3 || solver_id == 13) + { + for ( i = 0; i < stencil_size; ++i ) + { + stencil_entries[i] = i; + } + HYPRE_StructMatrixSetConstantEntries_pre( solver_precision, A_dbl, stencil_size, stencil_entries ); + HYPRE_StructMatrixSetConstantEntries_pre( precond_precision, A_flt, stencil_size, stencil_entries ); + /* ... note: SetConstantEntries is where the constant_coefficient + flag is set in A */ + + /* Free integer array */ + hypre_Free(stencil_entries, HYPRE_MEMORY_HOST); + constant_coefficient = 1; + } + if ( solver_id == 4 || solver_id == 14) + { + stencil_diag_entry = hypre_StructStencilDiagEntry(stencil); + hypre_assert( stencil_size >= 1 ); + if ( stencil_diag_entry == 0 ) + { + stencil_entries[stencil_diag_entry] = 1; + } + else + { + stencil_entries[stencil_diag_entry] = 0; + } + for ( i = 0; i < stencil_size; ++i ) + { + if ( i != stencil_diag_entry ) + { + stencil_entries[i] = i; + } + } + HYPRE_StructMatrixSetConstantEntries_pre( solver_precision, A_dbl, stencil_size, stencil_entries ); + HYPRE_StructMatrixSetConstantEntries_pre( precond_precision, A_flt, stencil_size, stencil_entries ); + hypre_Free( stencil_entries, HYPRE_MEMORY_HOST); + constant_coefficient = 2; + } + } + + HYPRE_StructMatrixSetSymmetric_pre( solver_precision,A_dbl, sym); + HYPRE_StructMatrixInitialize_pre( solver_precision,A_dbl); + HYPRE_StructMatrixSetSymmetric_pre( precond_precision,A_flt, sym); + HYPRE_StructMatrixInitialize_pre( precond_precision,A_flt); + + /*----------------------------------------------------------- + * Fill in the matrix elements + *-----------------------------------------------------------*/ + switch (solver_precision) + { + case HYPRE_REAL_SINGLE: + cx_slvr = ¶ms_flt[0]; + cy_slvr = ¶ms_flt[1]; + cz_slvr = ¶ms_flt[2]; + conx_slvr = ¶ms_flt[3]; + cony_slvr = ¶ms_flt[4]; + conz_slvr = ¶ms_flt[5]; + break; + case HYPRE_REAL_DOUBLE: + cx_slvr = ¶ms_dbl[0]; + cy_slvr = ¶ms_dbl[1]; + cz_slvr = ¶ms_dbl[2]; + conx_slvr = ¶ms_dbl[3]; + cony_slvr = ¶ms_dbl[4]; + conz_slvr = ¶ms_dbl[5]; + break; + case HYPRE_REAL_LONGDOUBLE: + cx_slvr = ¶ms_ldbl[0]; + cy_slvr = ¶ms_ldbl[1]; + cz_slvr = ¶ms_ldbl[2]; + conx_slvr = ¶ms_ldbl[3]; + cony_slvr = ¶ms_ldbl[4]; + conz_slvr = ¶ms_ldbl[5]; + break; + } + + switch (precond_precision) + { + case HYPRE_REAL_SINGLE: + cx_pc = ¶ms_flt[0]; + cy_pc = ¶ms_flt[1]; + cz_pc = ¶ms_flt[2]; + conx_pc = ¶ms_flt[3]; + cony_pc = ¶ms_flt[4]; + conz_pc = ¶ms_flt[5]; + break; + case HYPRE_REAL_DOUBLE: + cx_pc = ¶ms_dbl[0]; + cy_pc = ¶ms_dbl[1]; + cz_pc = ¶ms_dbl[2]; + conx_pc = ¶ms_dbl[3]; + cony_pc = ¶ms_dbl[4]; + conz_pc = ¶ms_dbl[5]; + break; + case HYPRE_REAL_LONGDOUBLE: + cx_pc = ¶ms_ldbl[0]; + cy_pc = ¶ms_ldbl[1]; + cz_pc = ¶ms_ldbl[2]; + conx_pc = ¶ms_ldbl[3]; + cony_pc = ¶ms_ldbl[4]; + conz_pc = ¶ms_ldbl[5]; + break; + } + AddValuesMatrix_mp(A_dbl, grid, cx_slvr, cy_slvr, cz_slvr, conx_slvr, cony_slvr, conz_slvr, slvr_size_t); + AddValuesMatrix_mp(A_flt, grid, cx_pc, cy_pc, cz_pc, conx_pc, cony_pc, conz_pc, pc_size_t); + + /* Zero out stencils reaching to real boundary */ + /* But in constant coefficient case, no special stencils! */ + + if ( constant_coefficient == 0 ) + { + SetStencilBndry_mp(A_dbl, grid, periodic); + SetStencilBndry_mp(A_flt, grid, periodic); + } + HYPRE_StructMatrixAssemble_pre( solver_precision,A_dbl); + HYPRE_StructMatrixAssemble_pre( precond_precision,A_flt); + /*----------------------------------------------------------- + * Set up the linear system + *-----------------------------------------------------------*/ + + HYPRE_StructVectorCreate_pre( solver_precision,hypre_MPI_COMM_WORLD, grid, &b_dbl); + HYPRE_StructVectorInitialize_pre( solver_precision,b_dbl); + HYPRE_StructVectorCreate_pre( precond_precision,hypre_MPI_COMM_WORLD, grid, &b_flt); + HYPRE_StructVectorInitialize_pre( precond_precision,b_flt); + + /*----------------------------------------------------------- + * 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. + *-----------------------------------------------------------*/ + + AddValuesVector_mp(grid, b_dbl, periodic, one_slvr, slvr_size_t); + AddValuesVector_mp(grid, b_flt, periodic, one_pc, pc_size_t); + HYPRE_StructVectorAssemble_pre( solver_precision,b_dbl); + HYPRE_StructVectorAssemble_pre( precond_precision,b_flt); + + HYPRE_StructVectorCreate_pre( solver_precision,hypre_MPI_COMM_WORLD, grid, &x_dbl); + HYPRE_StructVectorCreate_pre( precond_precision,hypre_MPI_COMM_WORLD, grid, &x_flt); + HYPRE_StructVectorInitialize_pre( solver_precision,x_dbl); + HYPRE_StructVectorInitialize_pre( precond_precision,x_flt); + + AddValuesVector_mp(grid, x_dbl, periodx0, zero_slvr, slvr_size_t); + AddValuesVector_mp(grid, x_flt, periodx0, zero_pc, pc_size_t); + HYPRE_StructVectorAssemble_pre(solver_precision,x_dbl); + HYPRE_StructVectorAssemble_pre(precond_precision,x_flt); + + HYPRE_StructGridDestroy_pre( solver_precision,grid); + + for (i = 0; i < nblocks; i++) + { + hypre_Free(iupper[i], HYPRE_MEMORY_HOST); + hypre_Free(ilower[i], HYPRE_MEMORY_HOST); + } + hypre_Free(ilower, HYPRE_MEMORY_HOST); + hypre_Free(iupper, HYPRE_MEMORY_HOST); + } + + /* linear system complete */ + + hypre_EndTiming(time_index); + if ( reps == 1 || (solver_id != 0 && solver_id != 1 && solver_id != 3 && solver_id != 4) ) + { + hypre_PrintTiming("Struct Interface", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + } + else if ( rep == reps - 1 ) + { + hypre_FinalizeTiming(time_index); + } + + /*----------------------------------------------------------- + * Print out the system and initial guess + *-----------------------------------------------------------*/ + + /*if (print_system) + { + HYPRE_StructMatrixPrint("struct.out.A", A, 0); + HYPRE_StructVectorPrint("struct.out.b", b, 0); + HYPRE_StructVectorPrint("struct.out.x0", x, 0); + }*/ + + /*----------------------------------------------------------- + * Solve the system using SMG + *-----------------------------------------------------------*/ + +#if !HYPRE_MFLOPS + + if (solver_id == 0) + { + time_index = hypre_InitializeTiming("SMG Setup"); + hypre_BeginTiming(time_index); + + HYPRE_StructSMGCreate_pre( solver_precision,MPI_COMM_WORLD, &solver); + HYPRE_StructSMGSetMaxIter_pre( solver_precision,solver, 50); + HYPRE_StructSMGSetTol_pre( solver_precision,solver, tol); + HYPRE_StructSMGSetRelChange_pre( solver_precision,solver, 0); + HYPRE_StructSMGSetNumPreRelax_pre( solver_precision,solver, n_pre); + HYPRE_StructSMGSetNumPostRelax_pre( solver_precision,solver, n_post); + HYPRE_StructSMGSetPrintLevel_pre( solver_precision,solver, 1); + HYPRE_StructSMGSetLogging_pre( solver_precision,solver, 1); +#if 0//defined(HYPRE_USING_CUDA) + HYPRE_StructSMGSetDeviceLevel(solver, device_level); +#endif + +#if 0//defined(HYPRE_USING_CUDA) + hypre_box_print = 0; +#endif + HYPRE_StructSMGSetup_pre( solver_precision,solver, A_dbl, b_dbl, x_dbl); + +#if 0//defined(HYPRE_USING_CUDA) + hypre_box_print = 0; +#endif + + hypre_EndTiming(time_index); + if ( reps == 1 ) + { + hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + } + else if ( rep == reps - 1 ) + { + hypre_FinalizeTiming(time_index); + } + + time_index = hypre_InitializeTiming("SMG Solve"); + hypre_BeginTiming(time_index); + + HYPRE_StructSMGSolve_pre( solver_precision,solver, A_dbl, b_dbl, x_dbl); + + hypre_EndTiming(time_index); + if ( reps == 1 ) + { + hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + } + else if ( rep == reps - 1 ) + { + hypre_PrintTiming("Interface, Setup, and Solve times:", + hypre_MPI_COMM_WORLD ); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + } + + HYPRE_StructSMGGetNumIterations_pre( solver_precision,solver, &num_iterations); + HYPRE_StructSMGGetFinalRelativeResidualNorm_pre( solver_precision,solver, &final_res_norm); + HYPRE_StructSMGDestroy_pre( solver_precision,solver); + } + + /*----------------------------------------------------------- + * Solve the system using PFMG + *-----------------------------------------------------------*/ + + else if ( solver_id == 1 || solver_id == 3 || solver_id == 4 ) + { + time_index = hypre_InitializeTiming("PFMG Setup"); + hypre_BeginTiming(time_index); + + HYPRE_StructPFMGCreate_pre( solver_precision,hypre_MPI_COMM_WORLD, &solver); + HYPRE_StructPFMGSetMaxIter_pre( solver_precision,solver, 200); + HYPRE_StructPFMGSetTol_pre( solver_precision,solver, tol); + HYPRE_StructPFMGSetRelChange_pre( solver_precision,solver, 0); + HYPRE_StructPFMGSetRAPType_pre( solver_precision,solver, rap); + HYPRE_StructPFMGSetRelaxType_pre( solver_precision,solver, relax); + if (usr_jacobi_weight) + { + HYPRE_StructPFMGSetJacobiWeight_pre( solver_precision,solver, jacobi_weight); + } + HYPRE_StructPFMGSetNumPreRelax_pre( solver_precision,solver, n_pre); + HYPRE_StructPFMGSetNumPostRelax_pre( solver_precision,solver, n_post); + HYPRE_StructPFMGSetSkipRelax_pre( solver_precision,solver, skip); + HYPRE_StructPFMGSetPrintLevel_pre( solver_precision,solver, 1); + HYPRE_StructPFMGSetLogging_pre( solver_precision,solver, 1); + +#if 0//defined(HYPRE_USING_CUDA) + HYPRE_StructPFMGSetDeviceLevel(solver, device_level); +#endif + + HYPRE_StructPFMGSetup_pre( solver_precision,solver, A_dbl, b_dbl, x_dbl); + + hypre_EndTiming(time_index); + if ( reps == 1 ) + { + hypre_PrintTiming("Setup phase times", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + } + else if ( rep == reps - 1 ) + { + hypre_FinalizeTiming(time_index); + } + + time_index = hypre_InitializeTiming("PFMG Solve"); + hypre_BeginTiming(time_index); + + + HYPRE_StructPFMGSolve_pre( solver_precision,solver, A_dbl, b_dbl, x_dbl); + + hypre_EndTiming(time_index); + if ( reps == 1 ) + { + hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + } + else if ( rep == reps - 1 ) + { + hypre_PrintTiming("Interface, Setup, and Solve times", + hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + } + + HYPRE_StructPFMGGetNumIterations_pre( solver_precision,solver, &num_iterations); + HYPRE_StructPFMGGetFinalRelativeResidualNorm_pre( solver_precision,solver, &final_res_norm); + HYPRE_StructPFMGDestroy_pre( solver_precision,solver); + } + + /*----------------------------------------------------------- + * Solve the system using CG + *-----------------------------------------------------------*/ + + if ((solver_id > 9) && (solver_id < 20)) + { + time_index = hypre_InitializeTiming("PCG Setup"); + hypre_BeginTiming(time_index); + + HYPRE_StructPCGCreate_pre( solver_precision,MPI_COMM_WORLD, &solver); + HYPRE_PCGSetMaxIter_pre( solver_precision, (HYPRE_Solver)solver, 100 ); + HYPRE_PCGSetTol_pre( solver_precision, (HYPRE_Solver)solver, tol ); + HYPRE_PCGSetTwoNorm_pre( solver_precision, (HYPRE_Solver)solver, 1 ); + HYPRE_PCGSetRelChange_pre( solver_precision, (HYPRE_Solver)solver, 0 ); + HYPRE_PCGSetPrintLevel_pre( solver_precision, (HYPRE_Solver)solver, print_level ); + HYPRE_PCGSetRecomputeResidual_pre( solver_precision, (HYPRE_Solver)solver, 1 ); + HYPRE_PCGSetFlex_pre( solver_precision, (HYPRE_Solver)solver, flex ); + + if (solver_id == 10) + { + /* use symmetric SMG as preconditioner */ + HYPRE_StructSMGCreate_pre( solver_precision,hypre_MPI_COMM_WORLD, &precond); + //HYPRE_StructSMGSetMemoryUse_pre( solver_precision,precond, 0); + HYPRE_StructSMGSetMaxIter_pre( solver_precision,precond, 1); + HYPRE_StructSMGSetTol_pre( solver_precision,precond, 0.0); + HYPRE_StructSMGSetZeroGuess_pre( solver_precision,precond); + HYPRE_StructSMGSetNumPreRelax_pre( solver_precision,precond, n_pre); + HYPRE_StructSMGSetNumPostRelax_pre( solver_precision,precond, n_post); + HYPRE_StructSMGSetPrintLevel_pre( solver_precision,precond, 0); + HYPRE_StructSMGSetLogging_pre( solver_precision,precond, 0); + + HYPRE_PCGSetPrecond_pre( solver_precision, (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSolve_dbl, + (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSetup_dbl, + (HYPRE_Solver) precond); + } + else if (solver_id == 15) + { + HYPRE_StructSMGCreate_pre( precond_precision,hypre_MPI_COMM_WORLD, &precond); + HYPRE_StructSMGSetMaxIter_pre( precond_precision,precond, 1); + HYPRE_StructSMGSetTol_pre( precond_precision,precond, 0.0); + HYPRE_StructSMGSetZeroGuess_pre( precond_precision,precond); + HYPRE_StructSMGSetNumPreRelax_pre( precond_precision,precond, n_pre); + HYPRE_StructSMGSetNumPostRelax_pre( precond_precision,precond, n_post); + HYPRE_StructSMGSetPrintLevel_pre( precond_precision,precond, 0); + HYPRE_StructSMGSetLogging_pre( precond_precision,precond, 0); + HYPRE_PCGSetPrecondMatrix_pre( solver_precision,(HYPRE_Solver)solver, (HYPRE_Matrix)A_flt); + HYPRE_PCGSetPrecond_pre( solver_precision, (HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSolve_mp, + (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSetup_mp, + (HYPRE_Solver) precond); + } + + else if (solver_id == 11 || solver_id == 13 || solver_id == 14) + { + /* use symmetric PFMG as preconditioner */ + HYPRE_StructPFMGCreate_pre( solver_precision,hypre_MPI_COMM_WORLD, &precond); + HYPRE_StructPFMGSetMaxIter_pre( solver_precision,precond, 1); + HYPRE_StructPFMGSetTol_pre( solver_precision,precond, 0.0); + HYPRE_StructPFMGSetZeroGuess_pre( solver_precision,precond); + HYPRE_StructPFMGSetRAPType_pre( solver_precision,precond, rap); + HYPRE_StructPFMGSetRelaxType_pre( solver_precision,precond, relax); + if (usr_jacobi_weight) + { + HYPRE_StructPFMGSetJacobiWeight_pre( solver_precision,precond, jacobi_weight); + } + HYPRE_StructPFMGSetNumPreRelax_pre( solver_precision,precond, n_pre); + HYPRE_StructPFMGSetNumPostRelax_pre( solver_precision,precond, n_post); + HYPRE_StructPFMGSetSkipRelax_pre( solver_precision,precond, skip); + /*HYPRE_StructPFMGSetDxyz_pre( solver_precision,precond, dxyz);*/ + HYPRE_StructPFMGSetPrintLevel_pre( solver_precision,precond, 0); + HYPRE_StructPFMGSetLogging_pre( solver_precision,precond, 0); +#if 0//defined(HYPRE_USING_CUDA) + HYPRE_StructPFMGSetDeviceLevel(precond, device_level); +#endif + HYPRE_PCGSetPrecond_pre( solver_precision,(HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSolve_dbl, + (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSetup_dbl, + (HYPRE_Solver) precond); + } + else if (solver_id == 16) + { + HYPRE_StructPFMGCreate_pre( precond_precision,hypre_MPI_COMM_WORLD, &precond); + HYPRE_StructPFMGSetMaxIter_pre( precond_precision,precond, 1); + HYPRE_StructPFMGSetTol_pre( precond_precision,precond, 0.0); + HYPRE_StructPFMGSetZeroGuess_pre( precond_precision,precond); + HYPRE_StructPFMGSetRAPType_pre( precond_precision,precond, rap); + HYPRE_StructPFMGSetRelaxType_pre( precond_precision,precond, relax); + if (usr_jacobi_weight) + { + HYPRE_StructPFMGSetJacobiWeight_pre( precond_precision,precond, jacobi_weight); + } + HYPRE_StructPFMGSetNumPreRelax_pre( precond_precision,precond, n_pre); + HYPRE_StructPFMGSetNumPostRelax_pre( precond_precision,precond, n_post); + HYPRE_StructPFMGSetSkipRelax_pre( precond_precision,precond, skip); + HYPRE_StructPFMGSetPrintLevel_pre( precond_precision,precond, 0); + HYPRE_StructPFMGSetLogging_pre( precond_precision,precond, 0); + HYPRE_PCGSetPrecondMatrix_pre( solver_precision,(HYPRE_Solver)solver, (HYPRE_Matrix)A_flt); + HYPRE_PCGSetPrecond_pre( solver_precision,(HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSolve_mp, + (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSetup_mp, + (HYPRE_Solver) precond); + } + + else if (solver_id == 18) + { + /* use diagonal scaling as preconditioner */ + precond = NULL; + HYPRE_PCGSetPrecond_pre( solver_precision,(HYPRE_Solver) solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructDiagScale_dbl, + (HYPRE_PtrToSolverFcn) HYPRE_StructDiagScaleSetup_dbl, + (HYPRE_Solver) precond); + } + + HYPRE_PCGSetup_pre( solver_precision, (HYPRE_Solver)solver, + (HYPRE_Matrix)A_dbl, (HYPRE_Vector)b_dbl, (HYPRE_Vector)x_dbl ); + + 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_pre( solver_precision, (HYPRE_Solver) solver, + (HYPRE_Matrix)A_dbl, (HYPRE_Vector)b_dbl, (HYPRE_Vector)x_dbl); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + HYPRE_PCGGetNumIterations_pre( solver_precision, (HYPRE_Solver)solver, &num_iterations ); + HYPRE_PCGGetFinalRelativeResidualNorm_pre( solver_precision, (HYPRE_Solver)solver, + &final_res_norm ); + HYPRE_StructPCGDestroy_pre( solver_precision,solver); + + if (solver_id == 10) + { + HYPRE_StructSMGDestroy_pre( solver_precision,precond); + } + else if (solver_id == 15) + { + HYPRE_StructSMGDestroy_pre( precond_precision,precond); + } + else if (solver_id == 11 || solver_id == 13 || solver_id == 14) + { + HYPRE_StructPFMGDestroy_pre( solver_precision,precond); + } + else if (solver_id == 16) + { + HYPRE_StructPFMGDestroy_pre( precond_precision,precond); + } + } + + /*----------------------------------------------------------- + * Solve the system using GMRES + *-----------------------------------------------------------*/ + + if ((solver_id > 29) && (solver_id < 40)) + { + time_index = hypre_InitializeTiming("GMRES Setup"); + hypre_BeginTiming(time_index); + + HYPRE_StructGMRESCreate_pre( solver_precision,hypre_MPI_COMM_WORLD, &solver); + HYPRE_GMRESSetKDim_pre( solver_precision, (HYPRE_Solver) solver, 5 ); + HYPRE_GMRESSetMaxIter_pre( solver_precision, (HYPRE_Solver)solver, 100 ); + HYPRE_GMRESSetTol_pre( solver_precision, (HYPRE_Solver)solver, tol ); + HYPRE_GMRESSetRelChange_pre( solver_precision, (HYPRE_Solver)solver, 0 ); + HYPRE_GMRESSetPrintLevel_pre( solver_precision, (HYPRE_Solver)solver, print_level ); + HYPRE_GMRESSetLogging_pre( solver_precision, (HYPRE_Solver)solver, 1 ); + + if (solver_id == 30) + { + /* use symmetric SMG as preconditioner */ + HYPRE_StructSMGCreate_pre( solver_precision,hypre_MPI_COMM_WORLD, &precond); + //HYPRE_StructSMGSetMemoryUse_pre( solver_precision,precond, 0); + HYPRE_StructSMGSetMaxIter_pre( solver_precision,precond, 1); + HYPRE_StructSMGSetTol_pre( solver_precision,precond, 0.0); + HYPRE_StructSMGSetZeroGuess_pre( solver_precision,precond); + HYPRE_StructSMGSetNumPreRelax_pre( solver_precision,precond, n_pre); + HYPRE_StructSMGSetNumPostRelax_pre( solver_precision,precond, n_post); + HYPRE_StructSMGSetPrintLevel_pre( solver_precision,precond, 0); + HYPRE_StructSMGSetLogging_pre( solver_precision,precond, 0); + HYPRE_GMRESSetPrecond_pre( solver_precision,(HYPRE_Solver)solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSolve_dbl, + (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSetup_dbl, + (HYPRE_Solver)precond); + } + else if (solver_id == 35) + { + HYPRE_StructSMGCreate_pre( precond_precision,hypre_MPI_COMM_WORLD, &precond); + HYPRE_StructSMGSetMaxIter_pre( precond_precision,precond, 1); + HYPRE_StructSMGSetTol_pre( precond_precision,precond, 0.0); + HYPRE_StructSMGSetZeroGuess_pre( precond_precision,precond); + HYPRE_StructSMGSetNumPreRelax_pre( precond_precision,precond, n_pre); + HYPRE_StructSMGSetNumPostRelax_pre( precond_precision,precond, n_post); + HYPRE_StructSMGSetPrintLevel_pre( precond_precision,precond, 0); + HYPRE_StructSMGSetLogging_pre( precond_precision,precond, 0); + HYPRE_GMRESSetPrecondMatrix_pre( solver_precision,(HYPRE_Solver)solver, (HYPRE_Matrix)A_flt); + HYPRE_GMRESSetPrecond_pre( solver_precision,(HYPRE_Solver)solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSolve_mp, + (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSetup_mp, + (HYPRE_Solver)precond); + } + + else if (solver_id == 31) + { + /* use symmetric PFMG as preconditioner */ + HYPRE_StructPFMGCreate_pre( solver_precision,hypre_MPI_COMM_WORLD, &precond); + HYPRE_StructPFMGSetMaxIter_pre( solver_precision,precond, 1); + HYPRE_StructPFMGSetTol_pre( solver_precision,precond, 0.0); + HYPRE_StructPFMGSetZeroGuess_pre( solver_precision,precond); + HYPRE_StructPFMGSetRAPType_pre( solver_precision,precond, rap); + HYPRE_StructPFMGSetRelaxType_pre( solver_precision,precond, relax); + if (usr_jacobi_weight) + { + HYPRE_StructPFMGSetJacobiWeight_pre( solver_precision,precond, jacobi_weight); + } + HYPRE_StructPFMGSetNumPreRelax_pre( solver_precision,precond, n_pre); + HYPRE_StructPFMGSetNumPostRelax_pre( solver_precision,precond, n_post); + HYPRE_StructPFMGSetSkipRelax_pre( solver_precision,precond, skip); + /*HYPRE_StructPFMGSetDxyz_pre( solver_precision,precond, dxyz);*/ + HYPRE_StructPFMGSetPrintLevel_pre( solver_precision,precond, 0); + HYPRE_StructPFMGSetLogging_pre( solver_precision,precond, 0); + HYPRE_GMRESSetPrecond_pre( solver_precision,(HYPRE_Solver)solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSolve_dbl, + (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSetup_dbl, + (HYPRE_Solver)precond); + } + else if (solver_id == 36) + { + HYPRE_StructPFMGCreate_pre( precond_precision,hypre_MPI_COMM_WORLD, &precond); + HYPRE_StructPFMGSetMaxIter_pre( precond_precision,precond, 1); + HYPRE_StructPFMGSetTol_pre( precond_precision,precond, 0.0); + HYPRE_StructPFMGSetZeroGuess_pre( precond_precision,precond); + HYPRE_StructPFMGSetRAPType_pre( precond_precision,precond, rap); + HYPRE_StructPFMGSetRelaxType_pre( precond_precision,precond, relax); + if (usr_jacobi_weight) + { + HYPRE_StructPFMGSetJacobiWeight_pre( precond_precision,precond, jacobi_weight); + } + HYPRE_StructPFMGSetNumPreRelax_pre( precond_precision,precond, n_pre); + HYPRE_StructPFMGSetNumPostRelax_pre( precond_precision,precond, n_post); + HYPRE_StructPFMGSetSkipRelax_pre( precond_precision,precond, skip); + HYPRE_StructPFMGSetPrintLevel_pre( precond_precision,precond, 0); + HYPRE_StructPFMGSetLogging_pre( precond_precision,precond, 0); + HYPRE_GMRESSetPrecondMatrix_pre( solver_precision,(HYPRE_Solver)solver, (HYPRE_Matrix)A_flt); + HYPRE_GMRESSetPrecond_pre( solver_precision,(HYPRE_Solver)solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSolve_mp, + (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSetup_mp, + (HYPRE_Solver)precond); + } + + else if (solver_id == 38) + { + /* use diagonal scaling as preconditioner */ + precond = NULL; + HYPRE_GMRESSetPrecond_pre( solver_precision,(HYPRE_Solver)solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructDiagScale_dbl, + (HYPRE_PtrToSolverFcn) HYPRE_StructDiagScaleSetup_dbl, + (HYPRE_Solver)precond); + } + + HYPRE_GMRESSetup_dbl ( (HYPRE_Solver)solver, (HYPRE_Matrix)A_dbl, (HYPRE_Vector)b_dbl, + (HYPRE_Vector)x_dbl ); + + 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_dbl + ( (HYPRE_Solver)solver, (HYPRE_Matrix)A_dbl, (HYPRE_Vector)b_dbl, (HYPRE_Vector)x_dbl); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + HYPRE_GMRESGetNumIterations_pre( solver_precision, (HYPRE_Solver)solver, &num_iterations); + HYPRE_GMRESGetFinalRelativeResidualNorm_pre( solver_precision, (HYPRE_Solver)solver, &final_res_norm); + HYPRE_StructGMRESDestroy_pre( solver_precision,solver); + + if (solver_id == 30) + { + HYPRE_StructSMGDestroy_pre( solver_precision,precond); + } + else if (solver_id == 35) + { + HYPRE_StructSMGDestroy_pre( precond_precision,precond); + } + else if (solver_id == 31) + { + HYPRE_StructPFMGDestroy_pre( solver_precision,precond); + } + else if (solver_id == 36) + { + HYPRE_StructPFMGDestroy_pre( precond_precision,precond); + } + } + + /*----------------------------------------------------------- + * Solve the system using BiCGTAB + *-----------------------------------------------------------*/ + + if ((solver_id > 39) && (solver_id < 50)) + { + time_index = hypre_InitializeTiming("BiCGSTAB Setup"); + hypre_BeginTiming(time_index); + + HYPRE_StructBiCGSTABCreate_pre( solver_precision,hypre_MPI_COMM_WORLD, &solver); + HYPRE_BiCGSTABSetMaxIter_pre( solver_precision, (HYPRE_Solver)solver, 100 ); + HYPRE_BiCGSTABSetTol_pre( solver_precision, (HYPRE_Solver)solver, tol ); + HYPRE_BiCGSTABSetPrintLevel_pre( solver_precision, (HYPRE_Solver)solver, print_level ); + HYPRE_BiCGSTABSetLogging_pre( solver_precision, (HYPRE_Solver)solver, 1 ); + + if (solver_id == 40) + { + /* use symmetric SMG as preconditioner */ + HYPRE_StructSMGCreate_pre( solver_precision,hypre_MPI_COMM_WORLD, &precond); + //HYPRE_StructSMGSetMemoryUse_pre( solver_precision,precond, 0); + HYPRE_StructSMGSetMaxIter_pre( solver_precision,precond, 1); + HYPRE_StructSMGSetTol_pre( solver_precision,precond, 0.0); + HYPRE_StructSMGSetZeroGuess_pre( solver_precision,precond); + HYPRE_StructSMGSetNumPreRelax_pre( solver_precision,precond, n_pre); + HYPRE_StructSMGSetNumPostRelax_pre( solver_precision,precond, n_post); + HYPRE_StructSMGSetPrintLevel_pre( solver_precision,precond, 0); + HYPRE_StructSMGSetLogging_pre( solver_precision,precond, 0); + HYPRE_BiCGSTABSetPrecond_pre( solver_precision,(HYPRE_Solver)solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSolve_dbl, + (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSetup_dbl, + (HYPRE_Solver)precond); + } + else if (solver_id == 45) + { + HYPRE_StructSMGCreate_pre( precond_precision,hypre_MPI_COMM_WORLD, &precond); + HYPRE_StructSMGSetMaxIter_pre( precond_precision,precond, 1); + HYPRE_StructSMGSetTol_pre( precond_precision,precond, 0.0); + HYPRE_StructSMGSetZeroGuess_pre( precond_precision,precond); + HYPRE_StructSMGSetNumPreRelax_pre( precond_precision,precond, n_pre); + HYPRE_StructSMGSetNumPostRelax_pre( precond_precision,precond, n_post); + HYPRE_StructSMGSetPrintLevel_pre( precond_precision,precond, 0); + HYPRE_StructSMGSetLogging_pre( precond_precision,precond, 0); + HYPRE_BiCGSTABSetPrecondMatrix_pre( solver_precision,(HYPRE_Solver)solver, (HYPRE_Matrix)A_flt); + HYPRE_BiCGSTABSetPrecond_pre( solver_precision,(HYPRE_Solver)solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSolve_mp, + (HYPRE_PtrToSolverFcn) HYPRE_StructSMGSetup_mp, + (HYPRE_Solver)precond); + } + + else if (solver_id == 41) + { + /* use symmetric PFMG as preconditioner */ + HYPRE_StructPFMGCreate_pre( solver_precision,hypre_MPI_COMM_WORLD, &precond); + HYPRE_StructPFMGSetMaxIter_pre( solver_precision,precond, 1); + HYPRE_StructPFMGSetTol_pre( solver_precision,precond, 0.0); + HYPRE_StructPFMGSetZeroGuess_pre( solver_precision,precond); + HYPRE_StructPFMGSetRAPType_pre( solver_precision,precond, rap); + HYPRE_StructPFMGSetRelaxType_pre( solver_precision,precond, relax); + if (usr_jacobi_weight) + { + HYPRE_StructPFMGSetJacobiWeight_pre( solver_precision,precond, jacobi_weight); + } + HYPRE_StructPFMGSetNumPreRelax_pre( solver_precision,precond, n_pre); + HYPRE_StructPFMGSetNumPostRelax_pre( solver_precision,precond, n_post); + HYPRE_StructPFMGSetSkipRelax_pre( solver_precision,precond, skip); + /*HYPRE_StructPFMGSetDxyz_pre( solver_precision,precond, dxyz);*/ + HYPRE_StructPFMGSetPrintLevel_pre( solver_precision,precond, 0); + HYPRE_StructPFMGSetLogging_pre( solver_precision,precond, 0); + HYPRE_BiCGSTABSetPrecond_pre( solver_precision,(HYPRE_Solver)solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSolve_dbl, + (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSetup_dbl, + (HYPRE_Solver)precond); + } + else if (solver_id == 46) + { + HYPRE_StructPFMGCreate_pre( precond_precision,hypre_MPI_COMM_WORLD, &precond); + HYPRE_StructPFMGSetMaxIter_pre( precond_precision,precond, 1); + HYPRE_StructPFMGSetTol_pre( precond_precision,precond, 0.0); + HYPRE_StructPFMGSetZeroGuess_pre( solver_precision,precond); + HYPRE_StructPFMGSetRAPType_pre( precond_precision,precond, rap); + HYPRE_StructPFMGSetRelaxType_pre( precond_precision,precond, relax); + if (usr_jacobi_weight) + { + HYPRE_StructPFMGSetJacobiWeight_pre( precond_precision,precond, jacobi_weight); + } + HYPRE_StructPFMGSetNumPreRelax_pre( precond_precision,precond, n_pre); + HYPRE_StructPFMGSetNumPostRelax_pre( precond_precision,precond, n_post); + HYPRE_StructPFMGSetSkipRelax_pre( precond_precision,precond, skip); + HYPRE_StructPFMGSetPrintLevel_pre( precond_precision,precond, 0); + HYPRE_StructPFMGSetLogging_pre( precond_precision,precond, 0); + HYPRE_BiCGSTABSetPrecondMatrix_pre( solver_precision,(HYPRE_Solver)solver, (HYPRE_Matrix)A_flt); + HYPRE_BiCGSTABSetPrecond_pre( solver_precision,(HYPRE_Solver)solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSolve_mp, + (HYPRE_PtrToSolverFcn) HYPRE_StructPFMGSetup_mp, + (HYPRE_Solver)precond); + } + + else if (solver_id == 48) + { + /* use diagonal scaling as preconditioner */ + precond = NULL; + HYPRE_BiCGSTABSetPrecond_pre( solver_precision,(HYPRE_Solver)solver, + (HYPRE_PtrToSolverFcn) HYPRE_StructDiagScale_dbl, + (HYPRE_PtrToSolverFcn) HYPRE_StructDiagScaleSetup_dbl, + (HYPRE_Solver)precond); + } + + HYPRE_BiCGSTABSetup_dbl + ( (HYPRE_Solver)solver, (HYPRE_Matrix)A_dbl, (HYPRE_Vector)b_dbl, (HYPRE_Vector)x_dbl ); + + 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_dbl + ( (HYPRE_Solver)solver, (HYPRE_Matrix)A_dbl, (HYPRE_Vector)b_dbl, (HYPRE_Vector)x_dbl); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve phase times", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + HYPRE_BiCGSTABGetNumIterations_pre( solver_precision, (HYPRE_Solver)solver, &num_iterations); + HYPRE_BiCGSTABGetFinalRelativeResidualNorm_pre( solver_precision, (HYPRE_Solver)solver, &final_res_norm); + HYPRE_StructBiCGSTABDestroy_pre( solver_precision,solver); + + if (solver_id == 40) + { + HYPRE_StructSMGDestroy_pre( solver_precision,precond); + } + else if (solver_id == 45) + { + HYPRE_StructSMGDestroy_pre( precond_precision,precond); + } + else if (solver_id == 41) + { + HYPRE_StructPFMGDestroy_pre( solver_precision,precond); + } + else if (solver_id == 46) + { + HYPRE_StructPFMGDestroy_pre( precond_precision,precond); + } + } + + /*----------------------------------------------------------- + * Print the solution and other info + *-----------------------------------------------------------*/ + + if (print_system) + { + HYPRE_StructVectorPrint_pre( solver_precision,"struct.out.x", x_dbl, 0); + } + + if (myid == 0 && rep == reps - 1 ) + { + hypre_printf("\n"); + hypre_printf("Iterations = %d\n", num_iterations); + hypre_printf("Final Relative Residual Norm = %e\n", final_res_norm); + hypre_printf("\n"); + } + +#endif + + /*----------------------------------------------------------- + * Compute MFLOPs for Matvec + *-----------------------------------------------------------*/ + +#if HYPRE_MFLOPS + { + void *matvec_data; + HYPRE_Int i, imax, N; + + /* compute imax */ + N = (P * nx) * (Q * ny) * (R * nz); + imax = (5 * 1000000) / N; + + matvec_data = hypre_StructMatvecCreate_pre( solver_precision,); + hypre_StructMatvecSetup_pre( solver_precision,matvec_data, A, x); + + time_index = hypre_InitializeTiming("Matvec"); + hypre_BeginTiming(time_index); + + for (i = 0; i < imax; i++) + { + hypre_StructMatvecCompute_pre( solver_precision,matvec_data, 1.0, A, x, 1.0, b); + } + /* this counts mult-adds */ + hypre_IncFLOPCount_pre( solver_precision,7 * N * imax); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Matvec time", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + hypre_StructMatvecDestroy_pre( solver_precision,matvec_data); + } +#endif + + /*----------------------------------------------------------- + * Finalize things + *-----------------------------------------------------------*/ + + HYPRE_StructStencilDestroy_pre( solver_precision,stencil); + HYPRE_StructMatrixDestroy_pre( solver_precision,A_dbl); + HYPRE_StructVectorDestroy_pre( solver_precision,b_dbl); + HYPRE_StructVectorDestroy_pre( solver_precision,x_dbl); + + for ( i = 0; i < (dim + 1); i++) + { + hypre_Free(offsets[i], HYPRE_MEMORY_HOST); + } + hypre_Free(offsets, HYPRE_MEMORY_HOST); + } + + /* Finalize Hypre */ + //HYPRE_Finalize(); + + /* Finalize MPI */ + 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(); +#endif + + return (0); +} + +/*------------------------------------------------------------------------- + * add constant values to a vector. Need to pass the initialized vector, grid, + * period of grid and the constant value. + *-------------------------------------------------------------------------*/ + +HYPRE_Int +AddValuesVector_mp(hypre_StructGrid *gridvector, + hypre_StructVector *zvector, + HYPRE_Int *period, + void *value, + size_t size ) +{ + /* #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; + char *values; + HYPRE_Int volume, dim; + + gridboxes = hypre_StructGridBoxes(gridvector); + dim = hypre_StructGridNDim(gridvector); + + ib = 0; + hypre_ForBoxI(ib, gridboxes) + { + box = hypre_BoxArrayBox(gridboxes, ib); + volume = hypre_BoxVolume(box); + values = hypre_CAlloc((size_t) volume, size, 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. + *-----------------------------------------------------------*/ + + if ((dim == 2 && period[0] != 0 && period[1] != 0) || + (dim == 3 && period[0] != 0 && period[1] != 0 && period[2] != 0)) + { + memcpy(&values[0],&value,size); + switch (hypre_StructVectorPrecision(zvector)){ + case HYPRE_REAL_SINGLE: + ((hypre_float*)values)[volume - 1] = -(*(hypre_float *)value); + break; + case HYPRE_REAL_DOUBLE: + ((hypre_double*)values)[volume - 1] = -(*(hypre_double *)value); + break; + case HYPRE_REAL_LONGDOUBLE: + ((hypre_long_double*)values)[volume - 1] = -(*(hypre_long_double *)value); + break; + } + } + else + { + for (i = 0; i < volume; i++) + { + memcpy((values + i*size),value,size); + } + } + + ilower = hypre_BoxIMin(box); + iupper = hypre_BoxIMax(box); + + HYPRE_StructVectorSetBoxValues_pre(hypre_StructVectorPrecision(zvector), zvector, ilower, iupper, values); + + hypre_Free(values, HYPRE_MEMORY_HOST); + } + + return ierr; +} + +/****************************************************************************** + * Adds values to matrix based on a 7 point (3d) + * symmetric stencil for a convection-diffusion problem. + * It need an initialized matrix, an assembled grid, and the constants + * that determine the 7 point (3d) convection-diffusion. + ******************************************************************************/ + +HYPRE_Int +AddValuesMatrix_mp(HYPRE_StructMatrix A, + HYPRE_StructGrid gridmatrix, + void *cx, + void *cy, + void *cz, + void *conx, + void *cony, + void *conz, + size_t size) +{ + + HYPRE_Int d, ierr = 0; + hypre_BoxArray *gridboxes; + HYPRE_Int s, bi; + hypre_IndexRef ilower; + hypre_IndexRef iupper; + hypre_Box *box; + char *values; + void *east, *west; + void *north, *south; + void *top, *bottom; + void *center; + char *stcoeffs; /* Stencil Coeffs: center, east, west, north, south, top, bottom */ + HYPRE_Int volume, dim, sym; + HYPRE_Int *stencil_indices; + HYPRE_Int stencil_size; + HYPRE_Int constant_coefficient; + + /* get precision of struct matrix */ + HYPRE_Precision precision_A = hypre_StructMatrixPrecision(A); + + gridboxes = hypre_StructGridBoxes(gridmatrix); + dim = hypre_StructGridNDim(gridmatrix); + sym = hypre_StructMatrixSymmetric(A); + constant_coefficient = hypre_StructMatrixConstantCoefficient(A); + + bi = 0; + + /* Alocate and set pointers to stencil coeffs */ + stcoeffs = hypre_CAlloc((size_t) 7, size, HYPRE_MEMORY_HOST); + center = stcoeffs; + east = stcoeffs + size; + west = stcoeffs + 2*size; + north = stcoeffs + 3*size; + south = stcoeffs + 4*size; + top = stcoeffs + 5*size; + bottom = stcoeffs + 6*size; + /* set stencil values */ + switch (precision_A) { + case HYPRE_REAL_SINGLE: + *(hypre_float*)east = -(*(hypre_float *)cx); + *(hypre_float*)west = -(*(hypre_float *)cx); + *(hypre_float*)north = -(*(hypre_float *)cy); + *(hypre_float*)south = -(*(hypre_float *)cy); + *(hypre_float*)top = -(*(hypre_float *)cz); + *(hypre_float*)bottom = -(*(hypre_float *)cz); + *(hypre_float*)center = 2 * (*(hypre_float *)cx); + if (dim > 1) { *(hypre_float*)center += 2.0 * (*(hypre_float *)cy); } + if (dim > 2) { *(hypre_float*)center += 2.0 * (*(hypre_float *)cz); } + break; + case HYPRE_REAL_DOUBLE: + *(hypre_double*)east = -(*(hypre_double *)cx); + *(hypre_double*)west = -(*(hypre_double *)cx); + *(hypre_double*)north = -(*(hypre_double *)cy); + *(hypre_double*)south = -(*(hypre_double *)cy); + *(hypre_double*)top = -(*(hypre_double *)cz); + *(hypre_double*)bottom = -(*(hypre_double *)cz); + *(hypre_double*)center = 2 * (*(hypre_double *)cx); + if (dim > 1) { *(hypre_double*)center += 2.0 * (*(hypre_double *)cy); } + if (dim > 2) { *(hypre_double*)center += 2.0 * (*(hypre_double *)cz); } + break; + case HYPRE_REAL_LONGDOUBLE: + *(hypre_long_double*)east = -(*(hypre_long_double *)cx); + *(hypre_long_double*)west = -(*(hypre_long_double *)cx); + *(hypre_long_double*)north = -(*(hypre_long_double *)cy); + *(hypre_long_double*)south = -(*(hypre_long_double *)cy); + *(hypre_long_double*)top = -(*(hypre_long_double *)cz); + *(hypre_long_double*)bottom = -(*(hypre_long_double *)cz); + *(hypre_long_double*)center = 2 * (*(hypre_long_double *)cx); + if (dim > 1) { *(hypre_long_double*)center += 2.0 * (*(hypre_long_double *)cy); } + if (dim > 2) { *(hypre_long_double*)center += 2.0 * (*(hypre_long_double *)cz); } + break; + } + stencil_size = 1 + (2 - sym) * dim; + stencil_indices = hypre_CAlloc((size_t) stencil_size, (size_t)sizeof(HYPRE_Int), + HYPRE_MEMORY_HOST); + for (s = 0; s < stencil_size; s++) + { + stencil_indices[s] = s; + } + + if (sym) + { + if ( constant_coefficient == 0 ) + { + hypre_ForBoxI(bi, gridboxes) + { + box = hypre_BoxArrayBox(gridboxes, bi); + volume = hypre_BoxVolume_flt(box); + values = hypre_CAlloc((size_t)(stencil_size * volume), size, HYPRE_MEMORY_HOST); + + if (dim == 1) + { + for (d = 0; d < volume; d++) + { + HYPRE_Int i = stencil_size * d; + memcpy((values + i*size),west,size); + memcpy((values + (i+1)*size),center,size); + } + } + else if (dim == 2) + { + for (d = 0; d < volume; d++) + { + HYPRE_Int i = stencil_size * d; + memcpy((values + i*size),west,size); + memcpy((values + (i+1)*size),south,size); + memcpy((values + (i+2)*size),center,size); + } + } + else if (dim == 3) + { + for (d = 0; d < volume; d++) + { + HYPRE_Int i = stencil_size * d; + memcpy((values + i*size),west,size); + memcpy((values + (i+1)*size),south,size); + memcpy((values + (i+2)*size),bottom,size); + memcpy((values + (i+3)*size),center,size); + } + } + + ilower = hypre_BoxIMin(box); + iupper = hypre_BoxIMax(box); + HYPRE_StructMatrixSetBoxValues_pre(precision_A, A, ilower, iupper, stencil_size, + stencil_indices, values); + hypre_Free(values, HYPRE_MEMORY_HOST); + } + } + else if ( constant_coefficient == 1 ) + { + values = hypre_CAlloc((size_t)stencil_size, size, HYPRE_MEMORY_HOST); + switch (dim) + { + case 1: + memcpy((values),west,size); + memcpy((values + size),center,size); + break; + case 2: + memcpy((values),west,size); + memcpy((values + size),south,size); + memcpy((values + 2*size),center,size); + break; + case 3: + memcpy((values),west,size); + memcpy((values + size),south,size); + memcpy((values + 2*size),bottom,size); + memcpy((values + 3*size),center,size); + break; + } + if (hypre_BoxArraySize(gridboxes) > 0) + { + HYPRE_StructMatrixSetConstantValues_pre(precision_A, A, stencil_size, + stencil_indices, values); + } + hypre_Free(values, HYPRE_MEMORY_HOST); + } + else + { + /* stencil index for the center equals dim, so it's easy to leave out */ + values = hypre_CAlloc((size_t)(stencil_size - 1), size, HYPRE_MEMORY_HOST); + switch (dim) + { + case 1: + memcpy((values),west,size); + break; + case 2: + memcpy((values),west,size); + memcpy((values + size),south,size); + break; + case 3: + memcpy((values),west,size); + memcpy((values + size),south,size); + memcpy((values + 2*size),bottom,size); + break; + } + if (hypre_BoxArraySize(gridboxes) > 0) + { + HYPRE_StructMatrixSetConstantValues_pre(precision_A, A, stencil_size - 1, + stencil_indices, values); + } + hypre_Free(values, HYPRE_MEMORY_HOST); + + hypre_ForBoxI(bi, gridboxes) + { + box = hypre_BoxArrayBox(gridboxes, bi); + /* hypre_BoxVolume is an integer option so we can use default function call */ + volume = hypre_BoxVolume(box); + values = hypre_CAlloc((size_t) volume, size, HYPRE_MEMORY_HOST); + HYPRE_Int i; + + for (i = 0; i < volume; i++) + { + memcpy((values +i*size), center, size); + } + + ilower = hypre_BoxIMin(box); + iupper = hypre_BoxIMax(box); + HYPRE_StructMatrixSetBoxValues_pre(precision_A, A, ilower, iupper, 1, + stencil_indices + dim, values); + hypre_Free(values, HYPRE_MEMORY_HOST); + } + } + } + else + { + switch (precision_A){ + case HYPRE_REAL_SINGLE: + if (*(hypre_float *)conx > 0.0f) + { + *(hypre_float*)west -= *(hypre_float*)conx; + *(hypre_float*)center += *(hypre_float*)conx; + } + else if (*(hypre_float *)conx < 0.0f) + { + *(hypre_float*)east += *(hypre_float*)conx; + *(hypre_float*)center -= *(hypre_float*)conx; + } + if (*(hypre_float *)cony > 0.0) + { + *(hypre_float*)south -= *(hypre_float*)cony; + *(hypre_float*)center += *(hypre_float*)cony; + } + else if (*(hypre_float *)cony < 0.0) + { + *(hypre_float*)north += *(hypre_float*)cony; + *(hypre_float*)center -= *(hypre_float*)cony; + } + if (*(hypre_float *)conz > 0.0) + { + *(hypre_float*)bottom -= *(hypre_float*)conz; + *(hypre_float*)center += *(hypre_float*)conz; + } + else if (*(hypre_float *)conz < 0.0) + { + *(hypre_float*)top += *(hypre_float*)conz; + *(hypre_float*)center -= *(hypre_float*)conz; + } + break; + case HYPRE_REAL_DOUBLE: + if (*(hypre_double *)conx > 0.0f) + { + *(hypre_double*)west -= *(hypre_double*)conx; + *(hypre_double*)center += *(hypre_double*)conx; + } + else if (*(hypre_double *)conx < 0.0f) + { + *(hypre_double*)east += *(hypre_double*)conx; + *(hypre_double*)center -= *(hypre_double*)conx; + } + if (*(hypre_double *)cony > 0.0) + { + *(hypre_double*)south -= *(hypre_double*)cony; + *(hypre_double*)center += *(hypre_double*)cony; + } + else if (*(hypre_double *)cony < 0.0) + { + *(hypre_double*)north += *(hypre_double*)cony; + *(hypre_double*)center -= *(hypre_double*)cony; + } + if (*(hypre_double *)conz > 0.0) + { + *(hypre_double*)bottom -= *(hypre_double*)conz; + *(hypre_double*)center += *(hypre_double*)conz; + } + else if (*(hypre_double *)conz < 0.0) + { + *(hypre_double*)top += *(hypre_double*)conz; + *(hypre_double*)center -= *(hypre_double*)conz; + } + break; + case HYPRE_REAL_LONGDOUBLE: + if (*(hypre_long_double *)conx > 0.0f) + { + *(hypre_long_double*)west -= *(hypre_long_double*)conx; + *(hypre_long_double*)center += *(hypre_long_double*)conx; + } + else if (*(hypre_long_double *)conx < 0.0f) + { + *(hypre_long_double*)east += *(hypre_long_double*)conx; + *(hypre_long_double*)center -= *(hypre_long_double*)conx; + } + if (*(hypre_long_double *)cony > 0.0) + { + *(hypre_long_double*)south -= *(hypre_long_double*)cony; + *(hypre_long_double*)center += *(hypre_long_double*)cony; + } + else if (*(hypre_long_double *)cony < 0.0) + { + *(hypre_long_double*)north += *(hypre_long_double*)cony; + *(hypre_long_double*)center -= *(hypre_long_double*)cony; + } + if (*(hypre_long_double *)conz > 0.0) + { + *(hypre_long_double*)bottom -= *(hypre_long_double*)conz; + *(hypre_long_double*)center += *(hypre_long_double*)conz; + } + else if (*(hypre_long_double *)conz < 0.0) + { + *(hypre_long_double*)top += *(hypre_long_double*)conz; + *(hypre_long_double*)center -= *(hypre_long_double*)conz; + } + break; + } + if ( constant_coefficient == 0 ) + { + hypre_ForBoxI(bi, gridboxes) + { + box = hypre_BoxArrayBox(gridboxes, bi); + /* hypre_BoxVolume is an integer option so we can use default function call */ + volume = hypre_BoxVolume(box); + values = hypre_CAlloc((size_t)(stencil_size * volume), size, HYPRE_MEMORY_HOST); + + for (d = 0; d < volume; d++) + { + HYPRE_Int i = stencil_size * d; + switch (dim) + { + case 1: + memcpy(values + i*size, west, size); + memcpy(values + (i+1)*size, center, size); + memcpy(values + (i+2)*size, east, size); + break; + case 2: + memcpy(values + i*size, west, size); + memcpy(values + (i+1)*size, south, size); + memcpy(values + (i+2)*size, center, size); + memcpy(values + (i+3)*size, east, size); + memcpy(values + (i+4)*size, north, size); + break; + case 3: + memcpy(values + i*size, west, size); + memcpy(values + (i+1)*size, south, size); + memcpy(values + (i+2)*size, bottom, size); + memcpy(values + (i+3)*size, center, size); + memcpy(values + (i+4)*size, east, size); + memcpy(values + (i+5)*size, north, size); + memcpy(values + (i+6)*size, top, size); + break; + } + } + + ilower = hypre_BoxIMin(box); + iupper = hypre_BoxIMax(box); + HYPRE_StructMatrixSetBoxValues_pre(precision_A, A, ilower, iupper, stencil_size, + stencil_indices, values); + + hypre_Free(values, HYPRE_MEMORY_HOST); + } + } + else if ( constant_coefficient == 1 ) + { + values = hypre_CAlloc( (size_t)stencil_size, size, HYPRE_MEMORY_HOST); + + switch (dim) + { + case 1: + memcpy((values),west,size); + memcpy((values + size),center,size); + memcpy((values + 2*size),east,size); + break; + case 2: + memcpy((values),west,size); + memcpy((values + size),south,size); + memcpy((values + 2*size),center,size); + memcpy((values + 3*size),east,size); + memcpy((values + 4*size),north,size); + break; + case 3: + memcpy((values),west,size); + memcpy((values + size),south,size); + memcpy((values + 2*size),bottom,size); + memcpy((values + 3*size),center,size); + memcpy((values + 4*size),east,size); + memcpy((values + 5*size),north,size); + memcpy((values + 6*size),top,size); + break; + } + + if (hypre_BoxArraySize(gridboxes) > 0) + { + HYPRE_StructMatrixSetConstantValues_pre(precision_A, A, stencil_size, + stencil_indices, values); + } + hypre_Free(values, HYPRE_MEMORY_HOST); + } + else + { + values = hypre_CAlloc( (size_t) (stencil_size - 1), size, HYPRE_MEMORY_HOST); + switch (dim) + { + /* no center in stencil_indices and values */ + case 1: + stencil_indices[0] = 0; + stencil_indices[1] = 2; + memcpy((values), west, size); + memcpy((values + size), east, size); + break; + case 2: + stencil_indices[0] = 0; + stencil_indices[1] = 1; + stencil_indices[2] = 3; + stencil_indices[3] = 4; + memcpy((values), west, size); + memcpy((values + size), south, size); + memcpy((values + 2*size), east, size); + memcpy((values + 3*size), north, size); + break; + case 3: + stencil_indices[0] = 0; + stencil_indices[1] = 1; + stencil_indices[2] = 2; + stencil_indices[3] = 4; + stencil_indices[4] = 5; + stencil_indices[5] = 6; + memcpy((values), west, size); + memcpy((values + size), south, size); + memcpy((values + 2*size), bottom, size); + memcpy((values + 3*size), east, size); + memcpy((values + 4*size), north, size); + memcpy((values + 5*size), top, size); + break; + } + if (hypre_BoxArraySize(gridboxes) > 0) + { + HYPRE_StructMatrixSetConstantValues_pre(precision_A, A, stencil_size, + stencil_indices, values); + } + hypre_Free(values, HYPRE_MEMORY_HOST); + /* center is variable */ + stencil_indices[0] = dim; /* refers to center */ + hypre_ForBoxI(bi, gridboxes) + { + box = hypre_BoxArrayBox(gridboxes, bi); + /* hypre_BoxVolume is an integer option so we can use default function call */ + volume = hypre_BoxVolume(box); + values = hypre_CAlloc((size_t) volume, size, HYPRE_MEMORY_HOST); + HYPRE_Int i; + + for (i = 0; i < volume; i++) + { + memcpy(values + i*size, ¢er, size); + } + + ilower = hypre_BoxIMin(box); + iupper = hypre_BoxIMax(box); + HYPRE_StructMatrixSetBoxValues_pre(precision_A, A, ilower, iupper, 1, + stencil_indices, values); + hypre_Free(values, HYPRE_MEMORY_HOST); + } + } + } + + hypre_Free(stencil_indices, HYPRE_MEMORY_HOST); + hypre_Free(stcoeffs, HYPRE_MEMORY_HOST); + + return ierr; +} + +/********************************************************************************* + * this function sets to zero the stencil entries that are on the boundary + * Grid, matrix and the period are needed. + *********************************************************************************/ + +HYPRE_Int +SetStencilBndry_mp(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_Int volume, dim; + HYPRE_Int *stencil_indices; + HYPRE_Int constant_coefficient; + + gridboxes = hypre_StructGridBoxes(gridmatrix); + boundingbox = hypre_StructGridBoundingBox(gridmatrix); + istart = hypre_BoxIMin(boundingbox); + iend = hypre_BoxIMax(boundingbox); + size = hypre_StructGridNumBoxes(gridmatrix); + dim = hypre_StructGridNDim(gridmatrix); + + /* get precision of struct matrix */ + HYPRE_Precision precision_A = hypre_StructMatrixPrecision(A); + + /* Declare values as a (void *) to allow for generic data types */ + void *values; + + stencil_indices = (HYPRE_Int *)hypre_CAlloc(1, (size_t)sizeof(HYPRE_Int), HYPRE_MEMORY_HOST); + + constant_coefficient = hypre_StructMatrixConstantCoefficient(A); + 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 */ + + vol = hypre_CAlloc((size_t) size, (size_t)sizeof(HYPRE_Int), HYPRE_MEMORY_HOST); + ilower = hypre_CAlloc((size_t) size, (size_t)sizeof(HYPRE_Int*), HYPRE_MEMORY_HOST); + iupper = hypre_CAlloc((size_t) size, (size_t)sizeof(HYPRE_Int*), HYPRE_MEMORY_HOST); + for (i = 0; i < size; i++) + { + ilower[i] = hypre_CAlloc((size_t) dim, (size_t)sizeof(HYPRE_Int), HYPRE_MEMORY_HOST); + iupper[i] = hypre_CAlloc((size_t) dim, (size_t)sizeof(HYPRE_Int), HYPRE_MEMORY_HOST); + } + + i = 0; + ib = 0; + hypre_ForBoxI(i, gridboxes) + { + dummybox = hypre_BoxCreate(dim); + box = hypre_BoxArrayBox(gridboxes, i); + volume = hypre_BoxVolume(box); + vol[i] = volume; + hypre_CopyBox(box, dummybox); + for (d = 0; d < dim; d++) + { + ilower[ib][d] = hypre_BoxIMinD(dummybox, d); + iupper[ib][d] = hypre_BoxIMaxD(dummybox, d); + } + ib++ ; + hypre_BoxDestroy(dummybox); + } + + if ( constant_coefficient == 0 ) + { + for (d = 0; d < dim; d++) + { + for (ib = 0; ib < size; ib++) + { + /* Allocate memory for values data. + * Use long_double size to ensure enough memory is allocated for all supported types + */ + values = hypre_CAlloc((size_t)(vol[ib]), (size_t)sizeof(hypre_long_double), HYPRE_MEMORY_HOST); + + if ( ilower[ib][d] == istart[d] && period[d] == 0 ) + { + j = iupper[ib][d]; + iupper[ib][d] = istart[d]; + stencil_indices[0] = d; + + /* Precision should match values datatype */ + switch (precision_A) + { + case HYPRE_REAL_SINGLE: + HYPRE_StructMatrixSetBoxValues_pre( HYPRE_REAL_SINGLE, A, ilower[ib], iupper[ib], + 1, stencil_indices, (hypre_float *)values); + break; + case HYPRE_REAL_DOUBLE: + HYPRE_StructMatrixSetBoxValues_pre( HYPRE_REAL_DOUBLE, A, ilower[ib], iupper[ib], + 1, stencil_indices, (hypre_double *)values); + break; + case HYPRE_REAL_LONGDOUBLE: + HYPRE_StructMatrixSetBoxValues_pre( HYPRE_REAL_LONGDOUBLE, A, ilower[ib], iupper[ib], + 1, stencil_indices, (hypre_long_double *)values); + break; + } + + iupper[ib][d] = j; + } + + if ( iupper[ib][d] == iend[d] && period[d] == 0 ) + { + j = ilower[ib][d]; + ilower[ib][d] = iend[d]; + stencil_indices[0] = dim + 1 + d; + + /* Precision should match values datatype */ + switch (precision_A) + { + case HYPRE_REAL_SINGLE: + HYPRE_StructMatrixSetBoxValues_pre( HYPRE_REAL_SINGLE, A, ilower[ib], iupper[ib], + 1, stencil_indices, (hypre_float *)values); + break; + case HYPRE_REAL_DOUBLE: + HYPRE_StructMatrixSetBoxValues_pre( HYPRE_REAL_DOUBLE, A, ilower[ib], iupper[ib], + 1, stencil_indices, (hypre_double *)values); + break; + case HYPRE_REAL_LONGDOUBLE: + HYPRE_StructMatrixSetBoxValues_pre( HYPRE_REAL_LONGDOUBLE, A, ilower[ib], iupper[ib], + 1, stencil_indices, (hypre_long_double *)values); + break; + } + ilower[ib][d] = j; + } + + /* Free values pointer */ + hypre_Free(values, HYPRE_MEMORY_HOST); + } + } + } + + hypre_Free(vol, HYPRE_MEMORY_HOST); + hypre_Free(stencil_indices, HYPRE_MEMORY_HOST); + for (ib = 0 ; ib < size ; ib++) + { + hypre_Free(ilower[ib], HYPRE_MEMORY_HOST); + hypre_Free(iupper[ib], HYPRE_MEMORY_HOST); + } + hypre_Free(ilower, HYPRE_MEMORY_HOST); + hypre_Free(iupper, HYPRE_MEMORY_HOST); + + return ierr; +} diff --git a/src/test/struct_newboxloop.c b/src/test/struct_newboxloop.c index 3dac60be1d..f3d2222b9a 100644 --- a/src/test/struct_newboxloop.c +++ b/src/test/struct_newboxloop.c @@ -104,7 +104,6 @@ main( hypre_int argc, HYPRE_Int sym; HYPRE_Int rap; HYPRE_Int relax; - HYPRE_Int jump; HYPRE_Int rep, reps; HYPRE_Int **iupper; @@ -178,7 +177,6 @@ main( hypre_int argc, sym = 1; rap = 0; relax = 1; - jump = 0; reps = 1; nx = 10; @@ -331,11 +329,6 @@ main( hypre_int argc, arg_index++; skip = atoi(argv[arg_index++]); } - else if ( strcmp(argv[arg_index], "-jump") == 0 ) - { - arg_index++; - jump = atoi(argv[arg_index++]); - } else if ( strcmp(argv[arg_index], "-print") == 0 ) { arg_index++; @@ -402,7 +395,6 @@ main( hypre_int argc, hypre_printf(" 4 - spMV with constant coeffs var diag\n"); hypre_printf(" 8 - Jacobi\n"); hypre_printf(" -sym : symmetric storage (1) or not (0)\n"); - hypre_printf(" -jump : num levels to jump in SparseMSG\n"); hypre_printf("\n"); } @@ -474,7 +466,6 @@ main( hypre_int argc, hypre_printf(" sym = %d\n", sym); hypre_printf(" rap = %d\n", rap); hypre_printf(" relax = %d\n", relax); - hypre_printf(" jump = %d\n", jump); hypre_printf(" solver ID = %d\n", solver_id); } @@ -489,7 +480,6 @@ main( hypre_int argc, hypre_printf(" sym = %d\n", sym); hypre_printf(" rap = %d\n", rap); hypre_printf(" relax = %d\n", relax); - hypre_printf(" jump = %d\n", jump); hypre_printf(" solver ID = %d\n", solver_id); hypre_printf(" the grid is read from file \n"); @@ -849,7 +839,7 @@ main( hypre_int argc, for ( rep = 0; rep < reps; ++rep ) { - hypre_StructAxpy(2.0, b, x); + hypre_StructVectorAxpy(2.0, b, 1.0, x, x); } //gettimeofday(&tstop,NULL); hypre_EndTiming(time_index); @@ -883,7 +873,7 @@ main( hypre_int argc, for ( rep = 0; rep < reps; ++rep ) { - hypre_StructMatvecCompute(matvec_data, 1.0, A, x, 1.0, b); + hypre_StructMatvecCompute(matvec_data, 1.0, A, x, 1.0, b, b); } //gettimeofday(&tstop,NULL); hypre_EndTiming(time_index); @@ -996,7 +986,7 @@ main( hypre_int argc, for (i = 0; i < imax; i++) { - hypre_StructMatvecCompute(matvec_data, 1.0, A, x, 1.0, b); + hypre_StructMatvecCompute(matvec_data, 1.0, A, x, 1.0, b, b); } /* this counts mult-adds */ hypre_IncFLOPCount(7 * N * imax); diff --git a/src/test/structmat.c b/src/test/structmat.c new file mode 100644 index 0000000000..a884746e05 --- /dev/null +++ b/src/test/structmat.c @@ -0,0 +1,1083 @@ +/*BHEADER********************************************************************** + * Copyright (c) 2014, Lawrence Livermore National Security, LLC. + * Produced at the Lawrence Livermore National Laboratory. + * This file is part of HYPRE. See file COPYRIGHT for details. + * + * HYPRE is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License (as published by the Free + * Software Foundation) version 2.1 dated February 1999. + * + * $Revision$ + ***********************************************************************EHEADER*/ + +#include +#include +#include + +#include "_hypre_utilities.h" +#include "_hypre_struct_mv.h" +#include "HYPRE_struct_mv.h" + +#define MAXDIM 3 +// #define DEBUG 1 + +/*-------------------------------------------------------------------------- + * Data structures + *--------------------------------------------------------------------------*/ + +/* Globals */ +char infile_default[50] = "structmat.in"; +char outfile_default[50] = "structmat.out"; +HYPRE_Int ndim = 0; + +typedef HYPRE_Int Index[MAXDIM]; + +typedef struct +{ + /* Grid data */ + HYPRE_Int nboxes; + Index *ilowers; + Index *iuppers; + HYPRE_Int *boxsizes; + HYPRE_Int max_boxsize; + Index periodic; + + /* Matrix data */ + HYPRE_Int nmatrices; + HYPRE_Int *matrix_sizes; + Index *matrix_rstrides; + Index *matrix_dstrides; + Index **matrix_offsets; + HYPRE_Real **matrix_values; + HYPRE_Int *matrix_ncentries; /* num constant entries */ + HYPRE_Int **matrix_centries; /* constant entries */ + HYPRE_Int *matrix_symmetric; + + /* Vector data */ + HYPRE_Int nvectors; + Index *vector_strides; + HYPRE_Real *vector_values; + +} Data; + +/*-------------------------------------------------------------------------- + * Read routines + *--------------------------------------------------------------------------*/ + +HYPRE_Int +SScanIntArray( char *sdata_ptr, + char **sdata_ptr_ptr, + HYPRE_Int size, + HYPRE_Int *array ) +{ + HYPRE_Int i; + + sdata_ptr += strspn(sdata_ptr, " \t\n("); + for (i = 0; i < size; i++) + { + array[i] = strtol(sdata_ptr, &sdata_ptr, 10); + } + sdata_ptr += strcspn(sdata_ptr, ")") + 1; + + *sdata_ptr_ptr = sdata_ptr; + return 0; +} + +HYPRE_Int +ReadData( char *filename, + Data *data_ptr ) +{ + Data data; + + HYPRE_Int myid; + FILE *file; + + char *sdata = NULL; + char *sdata_line; + char *sdata_ptr; + HYPRE_Int sdata_size; + HYPRE_Int memchunk = 10000; + HYPRE_Int maxline = 250; + + char key[250]; + + HYPRE_Int bi, mi, vi, ei, n, d, s; + + /*----------------------------------------------------------- + * Read data file from process 0, then broadcast + *-----------------------------------------------------------*/ + + hypre_MPI_Comm_rank(hypre_MPI_COMM_WORLD, &myid); + + if (myid == 0) + { + if ((file = fopen(filename, "r")) == NULL) + { + hypre_printf("Error: can't open input file %s\n", filename); + exit(1); + } + + /* allocate initial space, and read first input line */ + sdata_size = 0; + sdata = hypre_TAlloc(char, memchunk, HYPRE_MEMORY_HOST); + sdata_line = fgets(sdata, maxline, file); + + s = 0; + while (sdata_line != NULL) + { + sdata_size += strlen(sdata_line) + 1; + + /* allocate more space, if necessary */ + if ((sdata_size + maxline) > s) + { + sdata = hypre_TReAlloc(sdata, char, (sdata_size + memchunk), HYPRE_MEMORY_HOST); + s = sdata_size + memchunk; + } + + /* read the next input line */ + sdata_line = fgets((sdata + sdata_size), maxline, file); + } + fclose(file); + } + + /* broadcast the data size */ + hypre_MPI_Bcast(&sdata_size, 1, HYPRE_MPI_INT, 0, hypre_MPI_COMM_WORLD); + + /* broadcast the data */ + sdata = hypre_TReAlloc(sdata, char, sdata_size, HYPRE_MEMORY_HOST); + hypre_MPI_Bcast(sdata, sdata_size, hypre_MPI_CHAR, 0, hypre_MPI_COMM_WORLD); + + /*----------------------------------------------------------- + * Parse the data and fill Data structure + *-----------------------------------------------------------*/ + + data.nboxes = 0; + data.max_boxsize = 0; + data.nmatrices = 0; + data.nvectors = 0; + + sdata_line = sdata; + 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"); + + if ( strcmp(key, "GridCreate:") == 0 ) + { + ndim = strtol(sdata_ptr, &sdata_ptr, 10); + data.nboxes = strtol(sdata_ptr, &sdata_ptr, 10); + n = data.nboxes; + data.ilowers = hypre_CTAlloc(Index, n, HYPRE_MEMORY_HOST); + data.iuppers = hypre_CTAlloc(Index, n, HYPRE_MEMORY_HOST); + data.boxsizes = hypre_CTAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); + } + else if ( strcmp(key, "GridSetExtents:") == 0 ) + { + bi = strtol(sdata_ptr, &sdata_ptr, 10); + SScanIntArray(sdata_ptr, &sdata_ptr, ndim, data.ilowers[bi]); + SScanIntArray(sdata_ptr, &sdata_ptr, ndim, data.iuppers[bi]); + data.boxsizes[bi] = 1; + for (d = 0; d < ndim; d++) + { + data.boxsizes[bi] *= (data.iuppers[bi][d] - data.ilowers[bi][d] + 1); + } + data.max_boxsize = hypre_max(data.max_boxsize, data.boxsizes[bi]); + } + else if ( strcmp(key, "GridSetPeriodic:") == 0 ) + { + SScanIntArray(sdata_ptr, &sdata_ptr, ndim, data.periodic); + } + else if ( strcmp(key, "Matrix:") == 0 ) + { + data.nmatrices = strtol(sdata_ptr, &sdata_ptr, 10); + n = data.nmatrices; + data.matrix_sizes = hypre_CTAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); + data.matrix_rstrides = hypre_CTAlloc(Index, n, HYPRE_MEMORY_HOST); + data.matrix_dstrides = hypre_CTAlloc(Index, n, HYPRE_MEMORY_HOST); + data.matrix_offsets = hypre_CTAlloc(Index *, n, HYPRE_MEMORY_HOST); + data.matrix_values = hypre_CTAlloc(HYPRE_Real *, n, HYPRE_MEMORY_HOST); + data.matrix_ncentries = hypre_CTAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); + data.matrix_centries = hypre_CTAlloc(HYPRE_Int *, n, HYPRE_MEMORY_HOST); + data.matrix_symmetric = hypre_CTAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); + } + else if ( strcmp(key, "MatrixCreate:") == 0 ) + { + mi = strtol(sdata_ptr, &sdata_ptr, 10); + data.matrix_sizes[mi] = strtol(sdata_ptr, &sdata_ptr, 10); + SScanIntArray(sdata_ptr, &sdata_ptr, ndim, data.matrix_rstrides[mi]); + SScanIntArray(sdata_ptr, &sdata_ptr, ndim, data.matrix_dstrides[mi]); + n = data.matrix_sizes[mi]; + data.matrix_offsets[mi] = hypre_CTAlloc(Index, n, HYPRE_MEMORY_HOST); + data.matrix_values[mi] = hypre_CTAlloc(HYPRE_Real, n, HYPRE_MEMORY_HOST); + } + else if ( strcmp(key, "MatrixSetCoeff:") == 0 ) + { + mi = strtol(sdata_ptr, &sdata_ptr, 10); + ei = strtol(sdata_ptr, &sdata_ptr, 10); + SScanIntArray(sdata_ptr, &sdata_ptr, + ndim, data.matrix_offsets[mi][ei]); + data.matrix_values[mi][ei] = strtod(sdata_ptr, &sdata_ptr); + } + else if ( strcmp(key, "MatrixSetConstant:") == 0 ) + { + mi = strtol(sdata_ptr, &sdata_ptr, 10); + data.matrix_ncentries[mi] = strtol(sdata_ptr, &sdata_ptr, 10); + n = data.matrix_ncentries[mi]; + data.matrix_centries[mi] = hypre_CTAlloc(HYPRE_Int, n, HYPRE_MEMORY_HOST); + SScanIntArray(sdata_ptr, &sdata_ptr, n, data.matrix_centries[mi]); + } + else if ( strcmp(key, "MatrixSetSymmetric:") == 0 ) + { + mi = strtol(sdata_ptr, &sdata_ptr, 10); + data.matrix_symmetric[mi] = strtol(sdata_ptr, &sdata_ptr, 10); + } + else if ( strcmp(key, "Vector:") == 0 ) + { + data.nvectors = strtol(sdata_ptr, &sdata_ptr, 10); + n = data.nvectors; + data.vector_strides = hypre_CTAlloc(Index, n, HYPRE_MEMORY_HOST); + data.vector_values = hypre_CTAlloc(HYPRE_Real, n, HYPRE_MEMORY_HOST); + } + else if ( strcmp(key, "VectorCreate:") == 0 ) + { + vi = strtol(sdata_ptr, &sdata_ptr, 10); + SScanIntArray(sdata_ptr, &sdata_ptr, ndim, data.vector_strides[vi]); + data.vector_values[vi] = strtod(sdata_ptr, &sdata_ptr); + } + } + + sdata_line += strlen(sdata_line) + 1; + } + + hypre_TFree(sdata, HYPRE_MEMORY_HOST); + + *data_ptr = data; + return 0; +} + +/*-------------------------------------------------------------------------- + * Distribute routines + *--------------------------------------------------------------------------*/ + +HYPRE_Int +MapIndex( Index index, + Index stride, + HYPRE_Int upper ) +{ + HYPRE_Int d, i = 0; + + if (upper) + { + i = 1; + } + for (d = 0; d < ndim; d++) + { + index[d] = stride[d] * index[d] + (stride[d] - 1) * i; + } + + return 0; +} + +HYPRE_Int +DistributeData( Data global_data, + Index refine, + Index distribute, + Index block, + HYPRE_Int num_procs, + HYPRE_Int myid, + Data *data_ptr ) +{ + Data data = global_data; + HYPRE_Int np, pid; + HYPRE_Int box, i, j, d, s, size, rem, div; + Index m, p, n; + + /* check number of processes */ + np = 1; + for (d = 0; d < ndim; d++) + { + np *= distribute[d]; + } + if (np != num_procs) + { + hypre_printf("Error: Invalid number of processes or process topology \n"); + exit(1); + } + + pid = myid; + + /* refine boxes */ + s = 1; + for (d = 0; d < ndim; d++) + { + m[d] = refine[d]; + s *= m[d]; + } + if (s > 1) + { + for (box = 0; box < data.nboxes; box++) + { + MapIndex(data.ilowers[box], m, 0); + MapIndex(data.iuppers[box], m, 1); + } + } + + /* refine and distribute boxes */ + s = 1; + for (d = 0; d < ndim; d++) + { + m[d] = distribute[d]; + s *= m[d]; + } + if (s > 1) + { + div = s; + rem = pid; + for (d = ndim - 1; d >= 0; d--) + { + div /= m[d]; + p[d] = rem / div; + rem %= div; + } + + for (box = 0; box < data.nboxes; box++) + { + for (d = 0; d < ndim; d++) + { + n[d] = data.iuppers[box][d] - data.ilowers[box][d] + 1; + } + + /* Compute base box */ + MapIndex(data.ilowers[box], m, 0); + for (d = 0; d < ndim; d++) + { + data.iuppers[box][d] = data.ilowers[box][d] + n[d] - 1; + } + + /* Shift */ + for (d = 0; d < ndim; d++) + { + data.ilowers[box][d] = data.ilowers[box][d] + p[d] * n[d]; + data.iuppers[box][d] = data.iuppers[box][d] + p[d] * n[d]; + } + } + } + + /* refine and block boxes */ + s = 1; + for (d = 0; d < ndim; d++) + { + m[d] = block[d]; + s *= m[d]; + } + if (s > 1) + { + size = s * data.nboxes; + data.ilowers = hypre_TReAlloc(data.ilowers, Index, size, HYPRE_MEMORY_HOST); + data.iuppers = hypre_TReAlloc(data.iuppers, Index, size, HYPRE_MEMORY_HOST); + data.boxsizes = hypre_TReAlloc(data.boxsizes, HYPRE_Int, size, HYPRE_MEMORY_HOST); + for (box = 0; box < data.nboxes; box++) + { + for (d = 0; d < ndim; d++) + { + n[d] = data.iuppers[box][d] - data.ilowers[box][d] + 1; + } + + /* Compute base box */ + MapIndex(data.ilowers[box], m, 0); + for (d = 0; d < ndim; d++) + { + data.iuppers[box][d] = data.ilowers[box][d] + n[d] - 1; + } + + /* Shift */ + i = box; + for (d = 0; d < ndim; d++) + { + p[d] = 0; + } + for (j = 0; j < s; j++) + { + for (d = 0; d < ndim; d++) + { + data.ilowers[i][d] = data.ilowers[box][d] + p[d] * n[d]; + data.iuppers[i][d] = data.iuppers[box][d] + p[d] * n[d]; + } + i += data.nboxes; + + /* update p */ + for (d = 0; (d < ndim - 1) && (p[d] == m[d] - 1); d++) + { + p[d] = 0; + } + p[d]++; + } + } + data.nboxes *= s; + } + + /* compute box sizes, etc. */ + data.max_boxsize = 0; + for (box = 0; box < data.nboxes; box++) + { + data.boxsizes[box] = 1; + for (d = 0; d < ndim; d++) + { + data.boxsizes[box] *= (data.iuppers[box][d] - data.ilowers[box][d] + 1); + } + data.max_boxsize = hypre_max(data.max_boxsize, data.boxsizes[box]); + } + + /* refine periodicity */ + for (d = 0; d < ndim; d++) + { + data.periodic[d] *= refine[d] * block[d] * distribute[d]; + } + + if (data.nboxes == 0) + { + hypre_TFree(data.ilowers, HYPRE_MEMORY_HOST); + hypre_TFree(data.iuppers, HYPRE_MEMORY_HOST); + hypre_TFree(data.boxsizes, HYPRE_MEMORY_HOST); + data.max_boxsize = 0; + } + + *data_ptr = data; + return 0; +} + +/*-------------------------------------------------------------------------- + * Destroy data + *--------------------------------------------------------------------------*/ + +HYPRE_Int +DestroyData( Data data ) +{ + HYPRE_Int mi; + + if (data.nboxes > 0) + { + hypre_TFree(data.ilowers, HYPRE_MEMORY_HOST); + hypre_TFree(data.iuppers, HYPRE_MEMORY_HOST); + hypre_TFree(data.boxsizes, HYPRE_MEMORY_HOST); + } + + if (data.nmatrices > 0) + { + for (mi = 0; mi < data.nmatrices; mi++) + { + hypre_TFree(data.matrix_offsets[mi], HYPRE_MEMORY_HOST); + hypre_TFree(data.matrix_values[mi], HYPRE_MEMORY_HOST); + hypre_TFree(data.matrix_centries[mi], HYPRE_MEMORY_HOST); + } + hypre_TFree(data.matrix_sizes, HYPRE_MEMORY_HOST); + hypre_TFree(data.matrix_rstrides, HYPRE_MEMORY_HOST); + hypre_TFree(data.matrix_dstrides, HYPRE_MEMORY_HOST); + hypre_TFree(data.matrix_offsets, HYPRE_MEMORY_HOST); + hypre_TFree(data.matrix_values, HYPRE_MEMORY_HOST); + hypre_TFree(data.matrix_ncentries, HYPRE_MEMORY_HOST); + hypre_TFree(data.matrix_centries, HYPRE_MEMORY_HOST); + hypre_TFree(data.matrix_symmetric, HYPRE_MEMORY_HOST); + } + + if (data.nvectors > 0) + { + hypre_TFree(data.vector_strides, HYPRE_MEMORY_HOST); + hypre_TFree(data.vector_values, HYPRE_MEMORY_HOST); + } + + return 0; +} + +/*-------------------------------------------------------------------------- + * Routine to load cosine function + *--------------------------------------------------------------------------*/ + +HYPRE_Int +SetCosineVector( HYPRE_Real scale, + Index ilower, + Index iupper, + HYPRE_Real *values ) +{ + HYPRE_Int i, j, k; + HYPRE_Int count = 0; + + for (k = ilower[2]; k <= iupper[2]; k++) + { + for (j = ilower[1]; j <= iupper[1]; j++) + { + for (i = ilower[0]; i <= iupper[0]; i++) + { + values[count] = scale * cos((i + j + k) / 10.0); + count++; + } + } + } + + return (0); +} + +/*-------------------------------------------------------------------------- + * Print usage info + *--------------------------------------------------------------------------*/ + +HYPRE_Int +PrintUsage( char *progname, + HYPRE_Int myid ) +{ + if ( myid == 0 ) + { + hypre_printf("\n"); + hypre_printf("Usage: %s [-in ] []\n", progname); + hypre_printf("\n"); + hypre_printf(" -in : input file (default is `%s')\n", + infile_default); + hypre_printf(" -out : output file (default is `%s')\n", + outfile_default); + hypre_printf(" -outlev : level = 0 (none), 1 (default), 2 (all)\n"); + hypre_printf("\n"); + hypre_printf(" -P ... : refine and distribute part(s)\n"); + hypre_printf(" -r ... : refine part(s)\n"); + hypre_printf(" -b ... : refine and block part(s)\n"); + hypre_printf("\n"); + hypre_printf(" -mat-vec : compute A*x + y\n"); + hypre_printf(" -matTvec : compute A^T*x + y\n"); + hypre_printf(" -ab : alpha/beta values for matvec (default = 1)\n"); + hypre_printf("\n"); + hypre_printf(" -mat-mat [T] [T] ... : compute A*B*... or A^T*B*..., etc. \n"); + hypre_printf(" : for n possibly transposed matrices \n"); + hypre_printf(" : example P^T*A*P: -mat-mat 3 1T 0 1 \n"); + hypre_printf(" -matmult-type : kernel type for structured matrix/matrix multiplication \n"); + hypre_printf("\n"); + } + + return 0; +} + +/*-------------------------------------------------------------------------- + * Test driver for semi-structured matrix interface + *--------------------------------------------------------------------------*/ + +hypre_int +main( hypre_int argc, + char *argv[] ) +{ + char *infile, *outfile, filename[255]; + Data global_data; + Data data; + Index refine; + Index distribute; + Index block; + + HYPRE_StructGrid grid; + HYPRE_StructStencil *stencils; + HYPRE_StructMatrix *matrices; + HYPRE_StructGrid *vgrids; + HYPRE_StructVector *vectors; + HYPRE_StructMatrix M; + + HYPRE_Real *values, alpha, beta; + + HYPRE_Int num_procs, myid, outlev, ierr; + HYPRE_Int time_index; + HYPRE_Int arg_index, box, mi, vi, ei, d, i, k; + HYPRE_Int do_matvec, do_matvecT, do_matmat; + HYPRE_Int matmult_type = 0; + HYPRE_Int mv_A, mv_x, mv_y; + HYPRE_Int nterms = 0, *terms = NULL, *trans = NULL; + char transposechar; + + /*----------------------------------------------------------- + * 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); + + /* Initialize hypre */ + HYPRE_Initialize(); + + infile = infile_default; + outfile = outfile_default; + outlev = 1; + + /*----------------------------------------------------------- + * Read input file + *-----------------------------------------------------------*/ + + arg_index = 1; + + /* parse command line for input file name */ + if (argc > 1) + { + if ( strcmp(argv[arg_index], "-in") == 0 ) + { + arg_index++; + infile = argv[arg_index++]; + } + else if ( strcmp(argv[arg_index], "-help") == 0 ) + { + PrintUsage(argv[0], myid); + exit(1); + } + } + + ReadData(infile, &global_data); + + /*----------------------------------------------------------- + * Check some things + *-----------------------------------------------------------*/ + + if (ndim == 0) + { + hypre_printf("Error: number of dimensions not specified!\n"); + exit(1); + } + + /*----------------------------------------------------------- + * Set defaults + *-----------------------------------------------------------*/ + + for (d = 0; d < ndim; d++) + { + refine[d] = 1; + distribute[d] = 1; + block[d] = 1; + } + + do_matvec = 0; + do_matvecT = 0; + do_matmat = 0; + + alpha = 1.0; + beta = 1.0; + + /*----------------------------------------------------------- + * Parse command line + *-----------------------------------------------------------*/ + + while (arg_index < argc) + { + if ( strcmp(argv[arg_index], "-out") == 0 ) + { + arg_index++; + outfile = argv[arg_index++]; + } + else if ( strcmp(argv[arg_index], "-outlev") == 0 ) + { + arg_index++; + outlev = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-P") == 0 ) + { + arg_index++; + k = arg_index; + for (d = 0; d < ndim; d++) + { + distribute[d] = atoi(argv[k++]); + } + arg_index += ndim; + } + else if ( strcmp(argv[arg_index], "-r") == 0 ) + { + arg_index++; + k = arg_index; + for (d = 0; d < ndim; d++) + { + refine[d] = atoi(argv[k++]); + } + arg_index += ndim; + } + else if ( strcmp(argv[arg_index], "-b") == 0 ) + { + arg_index++; + k = arg_index; + for (d = 0; d < ndim; d++) + { + block[d] = atoi(argv[k++]); + } + arg_index += ndim; + } + else if ( strcmp(argv[arg_index], "-mat-vec") == 0 ) + { + arg_index++; + do_matvec = 1; + mv_A = atoi(argv[arg_index++]); + mv_x = atoi(argv[arg_index++]); + mv_y = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-matTvec") == 0 ) + { + arg_index++; + do_matvecT = 1; + mv_A = atoi(argv[arg_index++]); + mv_x = atoi(argv[arg_index++]); + mv_y = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-ab") == 0 ) + { + arg_index++; + alpha = atof(argv[arg_index++]); + beta = atof(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-mat-mat") == 0 ) + { + arg_index++; + do_matmat = 1; + nterms = atoi(argv[arg_index++]); + terms = hypre_CTAlloc(HYPRE_Int, nterms, HYPRE_MEMORY_HOST); + trans = hypre_CTAlloc(HYPRE_Int, nterms, HYPRE_MEMORY_HOST); + for (i = 0; i < nterms; i++) + { + transposechar = ' '; + hypre_sscanf(argv[arg_index++], "%d%c", &terms[i], &transposechar); + if (transposechar == 'T') + { + trans[i] = 1; + } + } + } + else if ( strcmp(argv[arg_index], "-matmult-type") == 0 ) + { + matmult_type = atoi(argv[arg_index++]); + } + else + { + arg_index++; + /*break;*/ + } + } + + /*----------------------------------------------------------- + * Print driver parameters + *-----------------------------------------------------------*/ + + if (myid == 0) + { + hypre_printf("\n"); + hypre_printf("P ="); + for (d = 0; d < ndim; d++) + { + hypre_printf(" %d", distribute[d]); + } + hypre_printf("\n"); + hypre_printf("r ="); + for (d = 0; d < ndim; d++) + { + hypre_printf(" %d", refine[d]); + } + hypre_printf("\n"); + hypre_printf("b ="); + for (d = 0; d < ndim; d++) + { + hypre_printf(" %d", block[d]); + } + hypre_printf("\n"); + hypre_printf("\n"); + } + + /*----------------------------------------------------------- + * Distribute data + *-----------------------------------------------------------*/ + + DistributeData(global_data, refine, distribute, block, num_procs, myid, &data); + + /*----------------------------------------------------------- + * Set up the grid + *-----------------------------------------------------------*/ + + HYPRE_StructGridCreate(hypre_MPI_COMM_WORLD, ndim, &grid); + for (box = 0; box < data.nboxes; box++) + { + HYPRE_StructGridSetExtents(grid, data.ilowers[box], data.iuppers[box]); + } + HYPRE_StructGridSetPeriodic(grid, data.periodic); +#if 1 /* Remove eventually */ + { + HYPRE_Int num_ghost[2 * MAXDIM]; + for (i = 0; i < 2 * MAXDIM; i++) + { + num_ghost[i] = 0; + } + HYPRE_StructGridSetNumGhost(grid, num_ghost); + } +#endif + HYPRE_StructGridAssemble(grid); + + /*----------------------------------------------------------- + * Set up the matrices and vectors + *-----------------------------------------------------------*/ + + values = hypre_TAlloc(HYPRE_Real, data.max_boxsize, HYPRE_MEMORY_HOST); + + stencils = hypre_CTAlloc(HYPRE_StructStencil, data.nmatrices, HYPRE_MEMORY_HOST); + matrices = hypre_CTAlloc(HYPRE_StructMatrix, data.nmatrices, HYPRE_MEMORY_HOST); + for (mi = 0; mi < data.nmatrices; mi++) + { + HYPRE_StructStencilCreate(ndim, data.matrix_sizes[mi], &stencils[mi]); + for (ei = 0; ei < data.matrix_sizes[mi]; ei++) + { + HYPRE_StructStencilSetEntry(stencils[mi], ei, data.matrix_offsets[mi][ei]); + } + + HYPRE_StructMatrixCreate(hypre_MPI_COMM_WORLD, grid, stencils[mi], &matrices[mi]); + HYPRE_StructMatrixSetRangeStride(matrices[mi], data.matrix_rstrides[mi]); + HYPRE_StructMatrixSetDomainStride(matrices[mi], data.matrix_dstrides[mi]); + HYPRE_StructMatrixSetSymmetric(matrices[mi], data.matrix_symmetric[mi]); + HYPRE_StructMatrixSetConstantEntries( + matrices[mi], data.matrix_ncentries[mi], data.matrix_centries[mi]); + HYPRE_ClearAllErrors(); + ierr = HYPRE_StructMatrixInitialize(matrices[mi]); + if (ierr) + { + if (myid == 0) + { + hypre_printf("Error constructing matrix %d: skipping...\n", mi); + } + matrices[mi] = NULL; + continue; + } + + for (ei = 0; ei < data.matrix_sizes[mi]; ei++) + { + Index ilower, iupper, origin, stride; + + /* Compute origin and stride. This assumes that at least one of + * rstride and dstride is all ones. */ + for (d = 0; d < ndim; d++) + { + if (data.matrix_dstrides[mi][d] > 1) + { + origin[d] = -data.matrix_offsets[mi][ei][d]; + stride[d] = data.matrix_dstrides[mi][d]; + } + else + { + origin[d] = 0; + stride[d] = data.matrix_rstrides[mi][d]; + } + } + for (i = 0; i < data.max_boxsize; i++) + { + values[i] = data.matrix_values[mi][ei]; + } + for (box = 0; box < data.nboxes; box++) + { + for (d = 0; d < ndim; d++) + { + ilower[d] = data.ilowers[box][d]; + iupper[d] = data.iuppers[box][d]; + } + HYPRE_StructGridProjectBox(grid, ilower, iupper, origin, stride); + HYPRE_StructMatrixSetBoxValues( + matrices[mi], ilower, iupper, 1, &ei, values); + } + } + HYPRE_StructMatrixAssemble(matrices[mi]); + /* Zero out coefficients that reach outside of the grid */ + hypre_StructMatrixClearBoundary(matrices[mi]); + } + + vgrids = hypre_CTAlloc(HYPRE_StructGrid, data.nvectors, HYPRE_MEMORY_HOST); + vectors = hypre_CTAlloc(HYPRE_StructVector, data.nvectors, HYPRE_MEMORY_HOST); + for (vi = 0; vi < data.nvectors; vi++) + { + HYPRE_StructGridCoarsen(grid, data.vector_strides[vi], &vgrids[vi]); + + HYPRE_StructVectorCreate(hypre_MPI_COMM_WORLD, vgrids[vi], &vectors[vi]); + HYPRE_StructVectorInitialize(vectors[vi]); + for (i = 0; i < data.max_boxsize; i++) + { + values[i] = data.vector_values[vi]; + } + HYPRE_StructVectorSetConstantValues(vectors[vi], values[0]); + /*for (box = 0; box < data.nboxes; box++) + { + HYPRE_StructVectorSetBoxValues( + vectors[vi], data.ilowers[box], data.iuppers[box], values); + }*/ + HYPRE_StructVectorAssemble(vectors[vi]); + } + + hypre_TFree(values, HYPRE_MEMORY_HOST); + + /*----------------------------------------------------------- + * Print matrices and vectors + *-----------------------------------------------------------*/ + + if (outlev >= 2) + { + for (mi = 0; mi < data.nmatrices; mi++) + { + if (matrices[mi] != NULL) + { + hypre_sprintf(filename, "%s.matrix%d", outfile, mi); + HYPRE_StructMatrixPrint(filename, matrices[mi], 0); + } + } + for (vi = 0; vi < data.nvectors; vi++) + { + hypre_sprintf(filename, "%s.vector%d", outfile, vi); + HYPRE_StructVectorPrint(filename, vectors[vi], 0); + } + } + + /*----------------------------------------------------------- + * Matrix-vector multiply + *-----------------------------------------------------------*/ + + if (do_matvec) + { + hypre_MPI_Barrier(hypre_MPI_COMM_WORLD); + time_index = hypre_InitializeTiming("Matrix-vector multiply"); + hypre_BeginTiming(time_index); + +#if DEBUG + /* First, set num_ghost to zero for both x and y */ + { + HYPRE_Int num_ghost[2 * MAXDIM]; + hypre_BoxArray *data_space; + + for (i = 0; i < 2 * MAXDIM; i++) + { + num_ghost[i] = 0; + } + hypre_StructVectorComputeDataSpace(vectors[mv_x], NULL, num_ghost, &data_space); + hypre_StructVectorResize(vectors[mv_x], data_space); + hypre_StructVectorComputeDataSpace(vectors[mv_y], NULL, num_ghost, &data_space); + hypre_StructVectorResize(vectors[mv_y], data_space); + hypre_StructVectorForget(vectors[mv_x]); + hypre_StructVectorForget(vectors[mv_y]); + HYPRE_StructVectorPrint("zvec-x-resize0", vectors[mv_x], 1); + HYPRE_StructVectorPrint("zvec-y-resize0", vectors[mv_y], 1); + } + /* Now, test rebase, etc. and add appropriate num_ghost */ + { + HYPRE_Int *num_ghost; + hypre_BoxArray *data_space; + + hypre_StructVectorRebase(vectors[mv_x], grid, data.vector_strides[mv_x]); + hypre_StructVectorRestore(vectors[mv_x]); + + hypre_StructVectorRebase(vectors[mv_x], grid, data.vector_strides[mv_x]); + hypre_StructNumGhostFromStencil(stencils[mv_A], &num_ghost); + hypre_StructVectorComputeDataSpace(vectors[mv_x], NULL, num_ghost, &data_space); + hypre_StructVectorResize(vectors[mv_x], data_space); + HYPRE_StructVectorPrint("zvec-x-resize1", vectors[mv_x], 1); + hypre_StructVectorRestore(vectors[mv_x]); + HYPRE_StructVectorPrint("zvec-x-restore0", vectors[mv_x], 1); + + hypre_StructVectorComputeDataSpace(vectors[mv_x], NULL, num_ghost, &data_space); + hypre_StructVectorResize(vectors[mv_x], data_space); + HYPRE_StructVectorPrint("zvec-x-resize2", vectors[mv_x], 1); + + /* Currently need to add ghost to y (but shouldn't in the future) */ + hypre_StructVectorComputeDataSpace(vectors[mv_y], NULL, num_ghost, &data_space); + hypre_StructVectorResize(vectors[mv_y], data_space); + hypre_StructVectorForget(vectors[mv_y]); + HYPRE_StructVectorPrint("zvec-y-resize1", vectors[mv_y], 1); + + hypre_TFree(num_ghost, HYPRE_MEMORY_HOST); + } +#endif + + HYPRE_StructMatrixMatvec(alpha, matrices[mv_A], vectors[mv_x], beta, vectors[mv_y]); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Matrix-vector multiply", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + if (outlev >= 1) + { + hypre_sprintf(filename, "%s.matvec", outfile); + HYPRE_StructVectorPrint(filename, vectors[mv_y], 0); + } + } + + /*----------------------------------------------------------- + * Transpose matrix-vector multiply + *-----------------------------------------------------------*/ + + if (do_matvecT) + { + hypre_MPI_Barrier(hypre_MPI_COMM_WORLD); + time_index = hypre_InitializeTiming("Transpose matrix-vector multiply"); + hypre_BeginTiming(time_index); + + HYPRE_StructMatrixMatvecT(alpha, matrices[mv_A], vectors[mv_x], beta, vectors[mv_y]); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Transpose matrix-vector multiply", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + if (outlev >= 1) + { + hypre_sprintf(filename, "%s.matvecT", outfile); + HYPRE_StructVectorPrint(filename, vectors[mv_y], 0); + } + } + + /*----------------------------------------------------------- + * Matrix-matrix multiply + *-----------------------------------------------------------*/ + + if (do_matmat && nterms > 0) + { + hypre_MPI_Barrier(hypre_MPI_COMM_WORLD); + time_index = hypre_InitializeTiming("Matrix-matrix multiply"); + hypre_BeginTiming(time_index); + + hypre_StructMatmult(matmult_type, data.nmatrices, matrices, nterms, terms, trans, &M); + + hypre_EndTiming(time_index); + hypre_PrintTiming("Matrix-matrix multiply", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + if (outlev >= 1) + { + hypre_sprintf(filename, "%s.matmat", outfile); + HYPRE_StructMatrixPrint(filename, M, 0); + } + + HYPRE_StructMatrixDestroy(M); + hypre_TFree(terms, HYPRE_MEMORY_HOST); + hypre_TFree(trans, HYPRE_MEMORY_HOST); + } + + /*----------------------------------------------------------- + * Finalize things + *-----------------------------------------------------------*/ + + HYPRE_StructGridDestroy(grid); + for (mi = 0; mi < data.nmatrices; mi++) + { + HYPRE_StructStencilDestroy(stencils[mi]); + HYPRE_StructMatrixDestroy(matrices[mi]); + } + hypre_TFree(stencils, HYPRE_MEMORY_HOST); + hypre_TFree(matrices, HYPRE_MEMORY_HOST); + for (vi = 0; vi < data.nvectors; vi++) + { + HYPRE_StructGridDestroy(vgrids[vi]); + HYPRE_StructVectorDestroy(vectors[vi]); + } + hypre_TFree(vgrids, HYPRE_MEMORY_HOST); + hypre_TFree(vectors, HYPRE_MEMORY_HOST); + + DestroyData(data); + + /* Finalize libraries */ + HYPRE_Finalize(); + hypre_MPI_Finalize(); + + return (0); +} diff --git a/src/test/structmat.in b/src/test/structmat.in new file mode 100644 index 0000000000..7e8df57a12 --- /dev/null +++ b/src/test/structmat.in @@ -0,0 +1,102 @@ +############################################################################## +# +# This file describes the input file for the 'structmat.c' driver. +# +# The input file is line-based. Any line beginning with a '#' character is +# considered a comment and ignored by the driver. For all non-comment lines, +# the driver checks the first string to see if it matches certain key words of +# the form 'Keyword:'. These key words are usually followed by input data as +# specified below. If the first string doesn't match any key words, the line is +# ignored, so blank lines are allowed. +# +# The format for each keyword input line is described below. Each is followed +# by a simple example +# +# More description here at a later date... +# +############################################################################## + +# For this driver, there is only one grid + +# GridCreate: ndim nboxes +GridCreate: 2 1 + +# GridSetExtents: boxnum ilower(ndim) iupper(ndim) +GridSetExtents: 0 (0 0) (4 4) + +# GridSetPeriodic: periodic(ndim) +GridSetPeriodic: (5 0) + +########################################################### + +# Matrix: nmatrices +Matrix: 3 + +##### Matrix A (0) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 0 5 (1 1) (1 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 0 0 ( 0 0) 4.0 +MatrixSetCoeff: 0 1 (-1 0) -1.0 +MatrixSetCoeff: 0 2 ( 1 0) -1.0 +MatrixSetCoeff: 0 3 ( 0 -1) -1.0 +MatrixSetCoeff: 0 4 ( 0 1) -1.0 + +# MatrixSetConstant: matnum nentries entries(nentries) +MatrixSetConstant: 0 5 (0 1 2 3 4) + +# MatrixSetSymmetric: matnum symmetric +MatrixSetSymmetric: 0 0 + +##### Matrix P (1) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 1 3 (1 1) (2 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 1 0 ( 0 0) 1.0 +MatrixSetCoeff: 1 1 (-1 0) 0.5 +MatrixSetCoeff: 1 2 ( 1 0) 0.5 + +# MatrixSetConstant: matnum nentries entries(nentries) +MatrixSetConstant: 1 3 (0 1 2) + +##### Matrix R (2) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 2 3 (2 1) (1 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 2 0 ( 0 0) 1.0 +MatrixSetCoeff: 2 1 (-1 0) 0.5 +MatrixSetCoeff: 2 2 ( 1 0) 0.5 + +# MatrixSetConstant: matnum nentries entries(nentries) +MatrixSetConstant: 2 3 (0 1 2) + +########################################################### + +# Vector: nvectors +Vector: 4 + +##### Vector x (0) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 0 (1 1) 1.0 + +##### Vector xc (1) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 1 (2 1) 1.0 + +##### Vector y (2) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 2 (1 1) 0.0 + +##### Vector yc (3) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 3 (2 1) 0.0 diff --git a/src/test/structmat.in.2D b/src/test/structmat.in.2D new file mode 100644 index 0000000000..18383adc15 --- /dev/null +++ b/src/test/structmat.in.2D @@ -0,0 +1,139 @@ +############################################################################## +# +# This file describes the input file for the 'structmat.c' driver. +# +# The input file is line-based. Any line beginning with a '#' character is +# considered a comment and ignored by the driver. For all non-comment lines, +# the driver checks the first string to see if it matches certain key words of +# the form 'Keyword:'. These key words are usually followed by input data as +# specified below. If the first string doesn't match any key words, the line is +# ignored, so blank lines are allowed. +# +# The format for each keyword input line is described below. Each is followed +# by a simple example +# +# There are currently 5 matrices and 4 vectors defined below. +# +# A(0): 5-pt Laplacian ; variable coefficients +# P(1): 3-pt x-interpolation ; variable coefficients +# R(2): 3-pt x-restriction ; variable coefficients +# P(3): 3-pt y-interpolation ; variable coefficients +# R(4): 3-pt y-restriction ; variable coefficients +# +# x (0): fine grid vector ; value = 1 +# xc(1): x-coarse grid vector ; value = 1 +# y (2): fine grid vector ; value = 0 +# yc(3): y-coarse grid vector ; value = 0 +# +############################################################################## + +# For this driver, there is only one grid + +# GridCreate: ndim nboxes +GridCreate: 2 1 + +# GridSetExtents: boxnum ilower(ndim) iupper(ndim) +GridSetExtents: 0 (0 0) (4 4) + +# GridSetPeriodic: periodic(ndim) +GridSetPeriodic: (5 0) + +########################################################### + +# Matrix: nmatrices +Matrix: 5 + +##### Matrix A (0) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 0 5 (1 1) (1 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 0 0 ( 0 0) 4.0 +MatrixSetCoeff: 0 1 (-1 0) -1.0 +MatrixSetCoeff: 0 2 ( 1 0) -1.0 +MatrixSetCoeff: 0 3 ( 0 -1) -1.0 +MatrixSetCoeff: 0 4 ( 0 1) -1.0 + +# MatrixSetConstant: matnum nentries entries(nentries) +#MatrixSetConstant: 0 5 (0 1 2 3 4) + +# MatrixSetSymmetric: matnum symmetric +MatrixSetSymmetric: 0 0 + +##### Matrix P (1) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 1 3 (1 1) (2 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 1 0 ( 0 0) 1.0 +MatrixSetCoeff: 1 1 (-1 0) 0.5 +MatrixSetCoeff: 1 2 ( 1 0) 0.5 + +# MatrixSetConstant: matnum nentries entries(nentries) +#MatrixSetConstant: 1 3 (0 1 2) + +##### Matrix R (2) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 2 3 (2 1) (1 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 2 0 ( 0 0) 1.0 +MatrixSetCoeff: 2 1 (-1 0) 0.5 +MatrixSetCoeff: 2 2 ( 1 0) 0.5 + +# MatrixSetConstant: matnum nentries entries(nentries) +#MatrixSetConstant: 2 3 (0 1 2) + +##### Matrix P (3) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 3 3 (1 1) (1 2) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 3 0 ( 0 0) 1.0 +MatrixSetCoeff: 3 1 ( 0 -1) 0.5 +MatrixSetCoeff: 3 2 ( 0 1) 0.5 + +# MatrixSetConstant: matnum nentries entries(nentries) +#MatrixSetConstant: 3 3 (0 1 2) + +##### Matrix R (4) + +# MatrixCreate: matnum ncoeffs rmap(ndim) dmap(ndim) +MatrixCreate: 4 3 (1 2) (1 1) + +# MatrixSetCoeff: matnum entry offset(ndim) value +MatrixSetCoeff: 4 0 ( 0 0) 1.0 +MatrixSetCoeff: 4 1 ( 0 -1) 0.5 +MatrixSetCoeff: 4 2 ( 0 1) 0.5 + +# MatrixSetConstant: matnum nentries entries(nentries) +#MatrixSetConstant: 4 3 (0 1 2) + +########################################################### + +# Vector: nvectors +Vector: 4 + +##### Vector x (0) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 0 (1 1) 1.0 + +##### Vector xc (1) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 1 (2 1) 1.0 + +##### Vector y (2) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 2 (1 1) 0.0 + +##### Vector yc (3) + +# VectorCreate: vecnum map(ndim) value +VectorCreate: 3 (1 2) 0.0 diff --git a/src/test/test_ij.c b/src/test/test_ij.c index fb94b12e72..015875b534 100644 --- a/src/test/test_ij.c +++ b/src/test/test_ij.c @@ -35,6 +35,7 @@ #include #include "HYPRE_lobpcg.h" +#include "_hypre_lobpcg.h" HYPRE_Int BuildParIsoLaplacian( HYPRE_Int argc, char** argv, HYPRE_ParCSRMatrix *A_ptr ); diff --git a/src/test/test_mp.c b/src/test/test_mp.c new file mode 100644 index 0000000000..61c5e420cf --- /dev/null +++ b/src/test/test_mp.c @@ -0,0 +1,451 @@ +/****************************************************************************** + * 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) + ******************************************************************************/ + +/*! + This file contains a mocked-up example, based on ex5.c in the examples directory. + The goal is to give an idea of how a user may utilize hypre to assemble matrix data + and access solvers in a way that would facilitate a mixed-precision solution of the + linear system. This particular driver demonstrates how the mixed-precision build may + be used to develop mixed-precision solvers, such as the defect-correction-based solver + implemented here. Feel free to ask questions, make comments or suggestions + regarding any of the information below. +*/ + +#include +#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" + +#include + +#define MAXITS 50 + +#define my_min(a,b) (((a)<(b)) ? (a) : (b)) + +HYPRE_Int HYPRE_DefectCorrectionSolver(HYPRE_ParCSRMatrix A, + HYPRE_ParCSRMatrix B, + HYPRE_ParVector x, + HYPRE_ParVector b, + HYPRE_Solver solver, + HYPRE_PtrToSolverFcn approx_solve, + HYPRE_Int maxits); + +int main (int argc, char *argv[]) +{ + int i; + int myid, num_procs; + int N, n; + int ilower, iupper; + int local_size, extra; + //int solver_id; + float h, h2; + double dh, dh2; + double d_one = 1.0; + float d_zero = 0.; + + int time_index; + //float wall_time; + /*! Matrix and preconditioner declarations. Here, we declare IJMatrices and parcsr matrices + for the solver (A, parcsr_A) and the preconditioner (B, parcsr_B). I have included two suggestions + below on how we would utilize both of these matrices. + */ + + //HYPRE_IJMatrix C; + //HYPRE_ParCSRMatrix parcsr_C; + + HYPRE_IJMatrix A; + HYPRE_ParCSRMatrix parcsr_A; + HYPRE_IJVector b; + HYPRE_ParVector par_b; + HYPRE_IJVector x; + HYPRE_ParVector par_x; + + HYPRE_IJMatrix B; + HYPRE_ParCSRMatrix parcsr_B; + HYPRE_IJVector bb; + HYPRE_ParVector par_bb; + HYPRE_IJVector xb; + HYPRE_ParVector par_xb; + + HYPRE_IJVector ijres; + HYPRE_IJVector ijhres; + HYPRE_IJVector ije; + HYPRE_IJVector ijxtmp; + /*! Solver and preconditioner and declarations and solver_precision variable. Internally, HYPRE_SolverPrecision + is an enum struct containing HYPRE_REAL_float, HYPRE_REAL_SINGLE and HYPRE_REAL_LONG. + */ + //HYPRE_Solver solver, precond; + /* Initialize MPI */ + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &myid); + MPI_Comm_size(MPI_COMM_WORLD, &num_procs); + + /*! We set up the linear system following ex5. */ + /* Some problem parameters */ + n = 2; + //solver_id = 0; + /* 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 */ + /* double and float variants of mesh spacing */ + h = 1.0 / (float)(n + 1); /* mesh size*/ + dh = 1.0 / (double)(n + 1); + h2 = h * h; + dh2 = dh * dh; + /* partition rows */ + local_size = N / num_procs; + extra = N - local_size * num_procs; + + ilower = local_size * myid; + ilower += my_min(myid, extra); + + iupper = local_size * (myid + 1); + iupper += my_min(myid + 1, extra); + iupper = iupper - 1; + + local_size = iupper - ilower + 1; + + HYPRE_IJMatrixCreate_flt(MPI_COMM_WORLD, ilower, iupper, ilower, iupper, &A); + HYPRE_IJMatrixSetObjectType_flt(A, HYPRE_PARCSR); + + HYPRE_IJMatrixCreate_dbl(MPI_COMM_WORLD, ilower, iupper, ilower, iupper, &B); + HYPRE_IJMatrixSetObjectType_dbl(B, HYPRE_PARCSR); + + /*! Initialize before setting coefficients */ + HYPRE_IJMatrixInitialize_flt(A); + HYPRE_IJMatrixInitialize_dbl(B); + /*! Set matrix entries */ + { + int nnz; + /* double and float variants of values */ + float values[5]; + double dvalues[5]; + int cols[5]; + + for (i = ilower; i <= iupper; i++) + { + nnz = 0; + /* The left identity block:position i-n */ + if ((i - n) >= 0) + { + cols[nnz] = i - n; + values[nnz] = -1.0; + dvalues[nnz] = -1.0; + nnz++; + } + + /* The left -1: position i-1 */ + if (i % n) + { + cols[nnz] = i - 1; + values[nnz] = -1.0; + dvalues[nnz] = -1.0; + nnz++; + } + + /* Set the diagonal: position i */ + cols[nnz] = i; + values[nnz] = 4.0; + dvalues[nnz] = 4.0; + nnz++; + + /* The right -1: position i+1 */ + if ((i + 1) % n) + { + cols[nnz] = i + 1; + values[nnz] = -1.0; + dvalues[nnz] = -1.0; + nnz++; + } + + /* The right identity block:position i+n */ + if ((i + n) < N) + { + cols[nnz] = i + n; + values[nnz] = -1.0; + dvalues[nnz] = -1.0; + nnz++; + } + + /* Set the values for row i */ + HYPRE_IJMatrixSetValues_flt(A, 1, &nnz, &i, cols, values); + HYPRE_IJMatrixSetValues_dbl(B, 1, &nnz, &i, cols, dvalues); + } + } + + /*! Assemble after setting the coefficients */ + HYPRE_IJMatrixAssemble_flt(A); + HYPRE_IJMatrixAssemble_dbl(B); + /*! Get the parcsr matrix object to use */ + HYPRE_IJMatrixGetObject_flt(A, (void**) &parcsr_A); + HYPRE_IJMatrixGetObject_dbl(B, (void**) &parcsr_B); + /*! Create the rhs and solution. Here, we only account for the solver precision. Since the preconditioner solve + is done internally, we can pass the appropriate vector types there. + */ + { + HYPRE_IJVectorCreate_flt(MPI_COMM_WORLD, ilower, iupper, &b); + HYPRE_IJVectorSetObjectType_flt(b, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_flt(b); + + HYPRE_IJVectorCreate_flt(MPI_COMM_WORLD, ilower, iupper, &x); + HYPRE_IJVectorSetObjectType_flt(x, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_flt(x); + + HYPRE_IJVectorCreate_dbl(MPI_COMM_WORLD, ilower, iupper, &bb); + HYPRE_IJVectorSetObjectType_dbl(bb, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_dbl(bb); + + HYPRE_IJVectorCreate_dbl(MPI_COMM_WORLD, ilower, iupper, &xb); + HYPRE_IJVectorSetObjectType_dbl(xb, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_dbl(xb); + + HYPRE_IJVectorCreate_flt(MPI_COMM_WORLD, ilower, iupper, &ijres); + HYPRE_IJVectorSetObjectType_flt(ijres, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_flt(ijres); + + HYPRE_IJVectorCreate_flt(MPI_COMM_WORLD, ilower, iupper, &ije); + HYPRE_IJVectorSetObjectType_flt(ije, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_flt(ije); + + HYPRE_IJVectorCreate_dbl(MPI_COMM_WORLD, ilower, iupper, &ijhres); + HYPRE_IJVectorSetObjectType_dbl(ijhres, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_dbl(ijhres); + + HYPRE_IJVectorCreate_dbl(MPI_COMM_WORLD, ilower, iupper, &ijxtmp); + HYPRE_IJVectorSetObjectType_dbl(ijxtmp, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_dbl(ijxtmp); + } + + + /* Initialize rhs and solution */ + { + float *rhs_values, *x_values; + double *drhs_values, *dx_values; + int *rows; + + rhs_values = (float*) calloc(local_size, sizeof(float)); + x_values = (float*) calloc(local_size, sizeof(float)); + + drhs_values = (double*) calloc(local_size, sizeof(double)); + dx_values = (double*) calloc(local_size, sizeof(double)); + + rows = (int*) calloc(local_size, sizeof(int)); + + for (i = 0; i < local_size; i++) + { + rhs_values[i] = h2; + x_values[i] = 0.0; + + drhs_values[i] = dh2; + dx_values[i] = 0.0; + + rows[i] = ilower + i; + } + + HYPRE_IJVectorSetValues_flt(b, local_size, rows, rhs_values); + HYPRE_IJVectorSetValues_flt(x, local_size, rows, x_values); + + HYPRE_IJVectorSetValues_dbl(bb, local_size, rows, drhs_values); + HYPRE_IJVectorSetValues_dbl(xb, local_size, rows, dx_values); + + HYPRE_IJVectorSetValues_flt(ijres, local_size, rows, rhs_values); + HYPRE_IJVectorSetValues_flt(ije, local_size, rows, x_values); + HYPRE_IJVectorSetValues_dbl(ijhres, local_size, rows, drhs_values); + HYPRE_IJVectorSetValues_dbl(ijxtmp, local_size, rows, dx_values); + + free(x_values); + free(rhs_values); + + free(dx_values); + free(drhs_values); + + free(rows); + } + + /* Assemble vector and get parcsr vector object */ + HYPRE_IJVectorAssemble_flt(b); + HYPRE_IJVectorGetObject_flt(b, (void **) &par_b); + HYPRE_IJVectorAssemble_flt(x); + HYPRE_IJVectorGetObject_flt(x, (void **) &par_x); + + HYPRE_IJVectorAssemble_dbl(bb); + HYPRE_IJVectorGetObject_dbl(bb, (void **) &par_bb); + HYPRE_IJVectorAssemble_dbl(xb); + HYPRE_IJVectorGetObject_dbl(xb, (void **) &par_xb); + + /*! Done with linear system setup. Now proceed to solve the system. */ + { + //int num_iterations; + HYPRE_ParVector res = NULL; + HYPRE_ParVector hres = NULL; + HYPRE_ParVector e = NULL; + HYPRE_ParVector xtmp = NULL; + + HYPRE_IJVectorAssemble_flt(ijres); + HYPRE_IJVectorGetObject_flt(ijres, (void **) &res); + HYPRE_IJVectorAssemble_flt(ije); + HYPRE_IJVectorGetObject_flt(ije, (void **) &e); + HYPRE_IJVectorAssemble_dbl(ijhres); + HYPRE_IJVectorGetObject_dbl(ijhres, (void **) &hres); + HYPRE_IJVectorAssemble_dbl(ijxtmp); + HYPRE_IJVectorGetObject_dbl(ijxtmp, (void **) &xtmp); + + /* Defect correction solver using AMG */ + hypre_printf("\n\n***** Richardson Defect Correction Solver for AMG *****\n"); + /* step 0: create and setup single precision amg solver */ + time_index = hypre_InitializeTiming("Setup AMG float"); + hypre_BeginTiming(time_index); + + HYPRE_Solver amg_solver; + HYPRE_BoomerAMGCreate_flt(&amg_solver); + HYPRE_BoomerAMGSetPrintLevel_flt(amg_solver, 3); /* print amg solution info */ + HYPRE_BoomerAMGSetCoarsenType_flt(amg_solver, 8); + HYPRE_BoomerAMGSetRelaxType_flt(amg_solver, 18); /* Sym G.S./Jacobi hybrid */ + HYPRE_BoomerAMGSetNumSweeps_flt(amg_solver, 1); + HYPRE_BoomerAMGSetTol_flt(amg_solver, 1.0e-16); /* conv. tolerance zero */ + HYPRE_BoomerAMGSetMaxIter_flt(amg_solver, 1); /* do only one iteration! */ + HYPRE_BoomerAMGSetup_flt(amg_solver, parcsr_A, par_b, par_x); + hypre_EndTiming(time_index); + hypre_PrintTiming("Setup AMG float", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + fflush(NULL); + + time_index = hypre_InitializeTiming("Solve DC mixed"); + hypre_BeginTiming(time_index); + /* step 1: approximate solve */ + HYPRE_BoomerAMGSolve_flt(amg_solver, parcsr_A, par_b, par_x); + + /* step 2: compute residual */ + /* This copy routine will copy from single precision, par_x, to double precision, par_xb */ + float rprod0=0.; + HYPRE_ParVectorInnerProd_flt(par_x, par_x, &rprod0); + printf("rprod0 = %f\n",rprod0); + HYPRE_ParVectorCopy_mp(par_x, par_xb); + double rprod1=0.; + HYPRE_ParVectorInnerProd_dbl(par_xb, par_xb, &rprod1); + printf("rprod1 = %f\n",rprod1); + //HYPRE_ParVectorPrint_flt( par_x, "par_x.flt"); + //HYPRE_ParVectorPrint_dbl( par_xb, "par_x.dbl"); + //exit(0); + + /* Iterative refinement loop */ + hypre_printf("\n\n***** Begin REFINEMENT *****\n"); + + /* datastructs for statistics */ + double enrm[MAXITS]; + double rnrm[MAXITS]; + double eprod = 0.; + double rprod = 0.; + + int i; + for (i = 0; i < MAXITS; i++) + { + /* step 3: compute residual in double precision */ + HYPRE_ParVectorCopy_dbl(par_bb, hres); + HYPRE_ParCSRMatrixMatvec_dbl(-1.0, parcsr_B, par_xb, 1.0, hres); + + /* collect some stats */ + /*=====================*/ + rprod = 0.; + HYPRE_ParVectorInnerProd_dbl(hres, hres, &rprod); + rnrm[i] = rprod; + printf("rprod = %f\n",rprod); + /*=====================*/ + + /* step 4: solver for error in single precision */ + /* copy double precision residual to single precision */ + HYPRE_ParVectorCopy_mp(hres, res); + //exit(0); + /* initialize error */ + HYPRE_ParVectorSetConstantValues_flt(e, d_zero); + /* solve */ + HYPRE_BoomerAMGSolve_flt(amg_solver, parcsr_A, res, e); + + /* step 5: update solution */ + /* copy single precision error to double precision*/ + HYPRE_ParVectorCopy_mp(e, hres); + /* call double precision axpy to update solution in double precision */ + HYPRE_ParVectorAxpy_dbl(d_one, hres, par_xb); + + /* collect some stats */ + /*=====================*/ + eprod = 0.; + HYPRE_ParVectorInnerProd_dbl(hres, hres, &eprod); + enrm[i] = eprod; + + //printf("eprod = %f\n",eprod); + + /*=====================*/ + } + hypre_EndTiming(time_index); + hypre_PrintTiming("Solve DC mixed", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + fflush(NULL); + + /* print some stats */ + /*==========================================*/ + //HYPRE_ParVectorPrint_dbl(par_xb,"MP_sol"); + hypre_printf("iter \n"); + for (i = 0; i < MAXITS; i++) + { + hypre_printf("%d %e %e\n", i + 1, enrm[i], rnrm[i]); + } + /*==========================================*/ + + /* Destroy AMG solver */ + HYPRE_BoomerAMGDestroy_flt(amg_solver); + + + // HYPRE_DefectCorrectionSolver(parcsr_A, parcsr_B, par_x, par_b, amg_solver, + // (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve, + // 100); + } + + /* Clean up */ + HYPRE_IJMatrixDestroy_flt(A); + HYPRE_IJVectorDestroy_flt(b); + HYPRE_IJVectorDestroy_flt(x); + HYPRE_IJVectorDestroy_flt(ijres); + HYPRE_IJVectorDestroy_flt(ije); + + HYPRE_IJMatrixDestroy_dbl(B); + HYPRE_IJVectorDestroy_dbl(bb); + HYPRE_IJVectorDestroy_dbl(xb); + HYPRE_IJVectorDestroy_dbl(ijhres); + HYPRE_IJVectorDestroy_dbl(ijxtmp); + + /* Finalize MPI*/ + MPI_Finalize(); + + return (0); +} + +HYPRE_Int HYPRE_DefectCorrectionSolver(HYPRE_ParCSRMatrix A, + HYPRE_ParCSRMatrix B, + HYPRE_ParVector x, + HYPRE_ParVector b, + HYPRE_Solver solver, + HYPRE_PtrToSolverFcn approx_solve, + HYPRE_Int maxits) +{ + + + + return 0; + +} + diff --git a/src/test/test_mp_pcg.c b/src/test/test_mp_pcg.c new file mode 100644 index 0000000000..67ad7b6ba0 --- /dev/null +++ b/src/test/test_mp_pcg.c @@ -0,0 +1,629 @@ +/****************************************************************************** + * 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) + ******************************************************************************/ + +/*! + This file contains a mocked-up example, based on ex5.c in the examples directory. + The goal is to give an idea of how a user may utilize hypre to assemble matrix data + and access solvers in a way that would facilitate a mixed-precision solution of the + linear system. This particular driver demonstrates how the mixed-precision build may + be used to develop mixed-precision solvers, such as the defect-correction-based solver + implemented here. Feel free to ask questions, make comments or suggestions + regarding any of the information below. +*/ + +#include +#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" + +#include + +#define MAXITS 1000 + +#define my_min(a,b) (((a)<(b)) ? (a) : (b)) + +HYPRE_Int HYPRE_DefectCorrectionSolver(HYPRE_ParCSRMatrix A, + HYPRE_ParCSRMatrix B, + HYPRE_ParVector x, + HYPRE_ParVector b, + HYPRE_Solver solver, + HYPRE_PtrToSolverFcn approx_solve, + HYPRE_Int maxits); + +int main (int argc, char *argv[]) +{ + int arg_index; + int i; + int myid, num_procs; + int N, n; + int ilower, iupper; + int local_size, extra; + int solver_id; + float h, h2; + double dh, dh2; + //double d_one = 1.0; + double d_zero = 0.; + float zero = 0.; + int num_iterations; + double dfinal_res_norm; + float final_res_norm; + int time_index; + //float wall_time; + /*! Matrix and preconditioner declarations. Here, we declare IJMatrices and parcsr matrices + for the solver (A, parcsr_A) and the preconditioner (B, parcsr_B). I have included two suggestions + below on how we would utilize both of these matrices. + */ + + //HYPRE_IJMatrix C; + //HYPRE_ParCSRMatrix parcsr_C; + + HYPRE_IJMatrix A; + HYPRE_ParCSRMatrix parcsr_A; + HYPRE_IJVector b; + HYPRE_ParVector par_b; + HYPRE_IJVector x; + HYPRE_ParVector par_x; + + HYPRE_IJMatrix B; + HYPRE_ParCSRMatrix parcsr_B; + HYPRE_IJVector bb; + HYPRE_ParVector par_bb; + HYPRE_IJVector xb; + HYPRE_ParVector par_xb; + + HYPRE_IJVector ijres; + HYPRE_IJVector ijhres; + HYPRE_IJVector ije; + HYPRE_IJVector ijxtmp; + /*! Solver and preconditioner and declarations and solver_precision variable. Internally, HYPRE_SolverPrecision + is an enum struct containing HYPRE_REAL_float, HYPRE_REAL_SINGLE and HYPRE_REAL_LONG. + */ + //HYPRE_Solver solver, precond; + /* Initialize MPI */ + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &myid); + MPI_Comm_size(MPI_COMM_WORLD, &num_procs); + + /*! We set up the linear system following ex5. */ + /* Some default problem parameters */ + n = 25; + solver_id = 0; + + /*-------------------------- + * Parse command line + *--------------------------*/ + arg_index = 0; + while (arg_index < argc) + { + if ( strcmp(argv[arg_index], "-solver") == 0 ) + { + arg_index++; + solver_id = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-n") == 0 ) + { + arg_index++; + n = atoi(argv[arg_index++]); + } + else + { + arg_index++; + } + } + + /* 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 */ + /* double and float variants of mesh spacing */ + h = 1.0 / (float)(n + 1); /* mesh size*/ + dh = 1.0 / (double)(n + 1); + h2 = h * h; + dh2 = dh * dh; + /* partition rows */ + local_size = N / num_procs; + extra = N - local_size * num_procs; + + ilower = local_size * myid; + ilower += my_min(myid, extra); + + iupper = local_size * (myid + 1); + iupper += my_min(myid + 1, extra); + iupper = iupper - 1; + + local_size = iupper - ilower + 1; + + HYPRE_IJMatrixCreate_flt(MPI_COMM_WORLD, ilower, iupper, ilower, iupper, &A); + HYPRE_IJMatrixSetObjectType_flt(A, HYPRE_PARCSR); + + HYPRE_IJMatrixCreate_dbl(MPI_COMM_WORLD, ilower, iupper, ilower, iupper, &B); + HYPRE_IJMatrixSetObjectType_dbl(B, HYPRE_PARCSR); + + /*! Initialize before setting coefficients */ + HYPRE_IJMatrixInitialize_flt(A); + HYPRE_IJMatrixInitialize_dbl(B); + /*! Set matrix entries */ + { + int nnz; + /* double and float variants of values */ + float values[5]; + double dvalues[5]; + int cols[5]; + + for (i = ilower; i <= iupper; i++) + { + nnz = 0; + /* The left identity block:position i-n */ + if ((i - n) >= 0) + { + cols[nnz] = i - n; + values[nnz] = -1.0; + dvalues[nnz] = -1.0; + nnz++; + } + + /* The left -1: position i-1 */ + if (i % n) + { + cols[nnz] = i - 1; + values[nnz] = -1.0; + dvalues[nnz] = -1.0; + nnz++; + } + + /* Set the diagonal: position i */ + cols[nnz] = i; + values[nnz] = 4.0; + dvalues[nnz] = 4.0; + nnz++; + + /* The right -1: position i+1 */ + if ((i + 1) % n) + { + cols[nnz] = i + 1; + values[nnz] = -1.0; + dvalues[nnz] = -1.0; + nnz++; + } + + /* The right identity block:position i+n */ + if ((i + n) < N) + { + cols[nnz] = i + n; + values[nnz] = -1.0; + dvalues[nnz] = -1.0; + nnz++; + } + + /* Set the values for row i */ + HYPRE_IJMatrixSetValues_flt(A, 1, &nnz, &i, cols, values); + HYPRE_IJMatrixSetValues_dbl(B, 1, &nnz, &i, cols, dvalues); + } + } + + /*! Assemble after setting the coefficients */ + HYPRE_IJMatrixAssemble_flt(A); + HYPRE_IJMatrixAssemble_dbl(B); + /*! Get the parcsr matrix object to use */ + HYPRE_IJMatrixGetObject_flt(A, (void**) &parcsr_A); + HYPRE_IJMatrixGetObject_dbl(B, (void**) &parcsr_B); + /*! Create the rhs and solution. Here, we only account for the solver precision. Since the preconditioner solve + is done internally, we can pass the appropriate vector types there. + */ + { + HYPRE_IJVectorCreate_flt(MPI_COMM_WORLD, ilower, iupper, &b); + HYPRE_IJVectorSetObjectType_flt(b, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_flt(b); + + HYPRE_IJVectorCreate_flt(MPI_COMM_WORLD, ilower, iupper, &x); + HYPRE_IJVectorSetObjectType_flt(x, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_flt(x); + + HYPRE_IJVectorCreate_dbl(MPI_COMM_WORLD, ilower, iupper, &bb); + HYPRE_IJVectorSetObjectType_dbl(bb, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_dbl(bb); + + HYPRE_IJVectorCreate_dbl(MPI_COMM_WORLD, ilower, iupper, &xb); + HYPRE_IJVectorSetObjectType_dbl(xb, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_dbl(xb); + + HYPRE_IJVectorCreate_flt(MPI_COMM_WORLD, ilower, iupper, &ijres); + HYPRE_IJVectorSetObjectType_flt(ijres, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_flt(ijres); + + HYPRE_IJVectorCreate_flt(MPI_COMM_WORLD, ilower, iupper, &ije); + HYPRE_IJVectorSetObjectType_flt(ije, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_flt(ije); + + HYPRE_IJVectorCreate_dbl(MPI_COMM_WORLD, ilower, iupper, &ijhres); + HYPRE_IJVectorSetObjectType_dbl(ijhres, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_dbl(ijhres); + + HYPRE_IJVectorCreate_dbl(MPI_COMM_WORLD, ilower, iupper, &ijxtmp); + HYPRE_IJVectorSetObjectType_dbl(ijxtmp, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_dbl(ijxtmp); + } + + + /* Initialize rhs and solution */ + { + float *rhs_values, *x_values; + double *drhs_values, *dx_values; + int *rows; + + rhs_values = (float*) calloc(local_size, sizeof(float)); + x_values = (float*) calloc(local_size, sizeof(float)); + + drhs_values = (double*) calloc(local_size, sizeof(double)); + dx_values = (double*) calloc(local_size, sizeof(double)); + + rows = (int*) calloc(local_size, sizeof(int)); + + for (i = 0; i < local_size; i++) + { + rhs_values[i] = h2; + x_values[i] = 0.0; + + drhs_values[i] = dh2; + dx_values[i] = 0.0; + + rows[i] = ilower + i; + } + + HYPRE_IJVectorSetValues_flt(b, local_size, rows, rhs_values); + HYPRE_IJVectorSetValues_flt(x, local_size, rows, x_values); + + HYPRE_IJVectorSetValues_dbl(bb, local_size, rows, drhs_values); + HYPRE_IJVectorSetValues_dbl(xb, local_size, rows, dx_values); + + HYPRE_IJVectorSetValues_flt(ijres, local_size, rows, rhs_values); + HYPRE_IJVectorSetValues_flt(ije, local_size, rows, x_values); + HYPRE_IJVectorSetValues_dbl(ijhres, local_size, rows, drhs_values); + HYPRE_IJVectorSetValues_dbl(ijxtmp, local_size, rows, dx_values); + + free(x_values); + free(rhs_values); + + free(dx_values); + free(drhs_values); + + free(rows); + } + + /* Assemble vector and get parcsr vector object */ + HYPRE_IJVectorAssemble_flt(b); + HYPRE_IJVectorGetObject_flt(b, (void **) &par_b); + HYPRE_IJVectorAssemble_flt(x); + HYPRE_IJVectorGetObject_flt(x, (void **) &par_x); + + HYPRE_IJVectorAssemble_dbl(bb); + HYPRE_IJVectorGetObject_dbl(bb, (void **) &par_bb); + HYPRE_IJVectorAssemble_dbl(xb); + HYPRE_IJVectorGetObject_dbl(xb, (void **) &par_xb); + + /*! Done with linear system setup. Now proceed to solve the system. */ + // Double precision + { + /* reset solution vector */ + HYPRE_ParVectorSetConstantValues_dbl(par_xb, d_zero); + + HYPRE_Solver amg_solver; + HYPRE_Solver pcg_solver; + HYPRE_Solver pcg_precond_gotten; + + time_index = hypre_InitializeTiming("DBL Setup"); + MPI_Barrier(hypre_MPI_COMM_WORLD); + hypre_BeginTiming(time_index); + // Create PCG solver + HYPRE_ParCSRPCGCreate_dbl(hypre_MPI_COMM_WORLD, &pcg_solver); + HYPRE_PCGSetMaxIter_dbl(pcg_solver, MAXITS); + // HYPRE_PCGSetTol_dbl(pcg_solver, 1.0e-10); + HYPRE_PCGSetTwoNorm_dbl(pcg_solver, 1); + // HYPRE_PCGSetRelChange_dbl(pcg_solver, rel_change); + HYPRE_PCGSetPrintLevel_dbl(pcg_solver, 3); + // HYPRE_PCGSetAbsoluteTo_dbll(pcg_solver, atol); + // HYPRE_PCGSetRecomputeResidual_dbl(pcg_solver, recompute_res); + + + /* Now set up the AMG preconditioner and specify any parameters */ + if (solver_id == 1) + { + if (myid == 0) { hypre_printf("\n\n***** Solver: DOUBLE PRECISION AMG-PCG *****\n"); } + + HYPRE_BoomerAMGCreate_dbl(&amg_solver); + // HYPRE_BoomerAMGSetPrintLevel_dbl(amg_solver, 0); /* print amg solution info */ + HYPRE_BoomerAMGSetCoarsenType_dbl(amg_solver, 8); + // HYPRE_BoomerAMGSetOldDefault_dbl(amg_solver); + HYPRE_BoomerAMGSetRelaxType_dbl(amg_solver, 18); /* Sym G.S./Jacobi hybrid */ + HYPRE_BoomerAMGSetNumSweeps_dbl(amg_solver, 1); + HYPRE_BoomerAMGSetTol_dbl(amg_solver, 0.0); /* conv. tolerance zero */ + HYPRE_BoomerAMGSetMaxIter_dbl(amg_solver, 1); /* do only one iteration! */ + + // Set the preconditioner for PCG + HYPRE_PCGSetPrecondMatrix_dbl(pcg_solver, (HYPRE_Matrix)parcsr_B); + + HYPRE_PCGSetPrecond_dbl(pcg_solver, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve_dbl, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup_dbl, + amg_solver); + + HYPRE_PCGGetPrecond_dbl(pcg_solver, &pcg_precond_gotten); + if (pcg_precond_gotten != amg_solver) + { + hypre_printf("HYPRE_ParCSRPCGGetPrecond got bad precond\n"); + return (-1); + } + else if (myid == 0) + { + hypre_printf("HYPRE_ParCSRPCGGetPrecond got good precond\n"); + } + } + else + { + if (myid == 0) { hypre_printf("\n\n***** Solver: DOUBLE PRECISION DS-PCG *****\n"); } + } + // Setup PCG solver + HYPRE_PCGSetup_dbl(pcg_solver, (HYPRE_Matrix)parcsr_B, (HYPRE_Vector)par_bb, (HYPRE_Vector)par_xb); + MPI_Barrier(hypre_MPI_COMM_WORLD); + hypre_EndTiming(time_index); + hypre_PrintTiming("Double precision Setup Time", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + fflush(NULL); + + time_index = hypre_InitializeTiming("DBL Solve"); + MPI_Barrier(hypre_MPI_COMM_WORLD); + hypre_BeginTiming(time_index); + // PCG solve + HYPRE_PCGSolve_dbl(pcg_solver, (HYPRE_Matrix)parcsr_B, (HYPRE_Vector)par_bb, (HYPRE_Vector)par_xb); + + MPI_Barrier(hypre_MPI_COMM_WORLD); + hypre_EndTiming(time_index); + hypre_PrintTiming("Double precision Solve Time", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + HYPRE_PCGGetNumIterations_dbl(pcg_solver, &num_iterations); + HYPRE_PCGGetFinalRelativeResidualNorm_dbl(pcg_solver, &dfinal_res_norm); + if (myid == 0) + { + hypre_printf("final relative residual norm = %e \n", dfinal_res_norm); + hypre_printf("Iteration count = %d \n", num_iterations); + } + fflush(NULL); + // destroy pcg solver + HYPRE_ParCSRPCGDestroy_dbl(pcg_solver); + if (solver_id == 1) { HYPRE_BoomerAMGDestroy_dbl(amg_solver); } + } + // Single precision + { + /* reset solution vector */ + HYPRE_ParVectorSetConstantValues_flt(par_x, zero); + + HYPRE_Solver amg_solver; + HYPRE_Solver pcg_solver; + HYPRE_Solver pcg_precond_gotten; + + time_index = hypre_InitializeTiming("FLT Setup"); + MPI_Barrier(hypre_MPI_COMM_WORLD); + hypre_BeginTiming(time_index); + // Create PCG solver + HYPRE_ParCSRPCGCreate_flt(hypre_MPI_COMM_WORLD, &pcg_solver); + HYPRE_PCGSetMaxIter_flt(pcg_solver, MAXITS); + // HYPRE_PCGSetTol_flt(pcg_solver, 1.0e-10); + HYPRE_PCGSetTwoNorm_flt(pcg_solver, 1); + // HYPRE_PCGSetRelChange_flt(pcg_solver, rel_change); + HYPRE_PCGSetPrintLevel_flt(pcg_solver, 3); + // HYPRE_PCGSetAbsoluteTo_fltl(pcg_solver, atol); + // HYPRE_PCGSetRecomputeResidual_flt(pcg_solver, recompute_res); + + + /* Now set up the AMG preconditioner and specify any parameters */ + if (solver_id == 1) + { + if (myid == 0) { hypre_printf("\n\n***** Solver: SINGLE PRECISION AMG-PCG *****\n"); } + HYPRE_BoomerAMGCreate_flt(&amg_solver); + // HYPRE_BoomerAMGSetPrintLevel_flt(amg_solver, 0); /* print amg solution info */ + HYPRE_BoomerAMGSetCoarsenType_flt(amg_solver, 8); + // HYPRE_BoomerAMGSetOldDefault_flt(amg_solver); + HYPRE_BoomerAMGSetRelaxType_flt(amg_solver, 18); /* Sym G.S./Jacobi hybrid */ + HYPRE_BoomerAMGSetNumSweeps_flt(amg_solver, 1); + HYPRE_BoomerAMGSetTol_flt(amg_solver, 0.0); /* conv. tolerance zero */ + HYPRE_BoomerAMGSetMaxIter_flt(amg_solver, 1); /* do only one iteration! */ + + // Set the preconditioner for PCG + HYPRE_PCGSetPrecondMatrix_dbl(pcg_solver, (HYPRE_Matrix)parcsr_A); + + HYPRE_PCGSetPrecond_flt(pcg_solver, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve_flt, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup_flt, + amg_solver); + + HYPRE_PCGGetPrecond_flt(pcg_solver, &pcg_precond_gotten); + if (pcg_precond_gotten != amg_solver) + { + hypre_printf("HYPRE_ParCSRPCGGetPrecond got bad precond\n"); + return (-1); + } + else if (myid == 0) + { + hypre_printf("HYPRE_ParCSRPCGGetPrecond got good precond\n"); + } + } + else + { + if (myid == 0) { hypre_printf("\n\n***** Solver: SINGLE PRECISION DS-PCG *****\n"); } + } + // Setup PCG solver + HYPRE_PCGSetup_flt(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)par_b, (HYPRE_Vector)par_x); + MPI_Barrier(hypre_MPI_COMM_WORLD); + hypre_EndTiming(time_index); + hypre_PrintTiming("Single precision Setup Time", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + fflush(NULL); + + time_index = hypre_InitializeTiming("FLT Solve"); + MPI_Barrier(hypre_MPI_COMM_WORLD); + hypre_BeginTiming(time_index); + // PCG solve + HYPRE_PCGSolve_flt(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)par_b, (HYPRE_Vector)par_x); + + MPI_Barrier(hypre_MPI_COMM_WORLD); + hypre_EndTiming(time_index); + hypre_PrintTiming("Single precision Solve Time", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + HYPRE_PCGGetNumIterations_flt(pcg_solver, &num_iterations); + HYPRE_PCGGetFinalRelativeResidualNorm_flt(pcg_solver, &final_res_norm); + if (myid == 0) + { + hypre_printf("final relative residual norm = %e \n", final_res_norm); + hypre_printf("Iteration count = %d \n", num_iterations); + } + fflush(NULL); + // destroy pcg solver + HYPRE_ParCSRPCGDestroy_flt(pcg_solver); + if (solver_id == 1) { HYPRE_BoomerAMGDestroy_flt(amg_solver); } + } + // mixed-precision + { + /* reset solution vector */ + HYPRE_ParVectorSetConstantValues_dbl(par_xb, d_zero); + + HYPRE_Solver amg_solver; + HYPRE_Solver pcg_solver; + HYPRE_Solver pcg_precond_gotten; + + time_index = hypre_InitializeTiming("DBL Setup"); + MPI_Barrier(hypre_MPI_COMM_WORLD); + hypre_BeginTiming(time_index); + // Create PCG solver + HYPRE_ParCSRPCGCreate_dbl(hypre_MPI_COMM_WORLD, &pcg_solver); + HYPRE_PCGSetMaxIter_dbl(pcg_solver, MAXITS); + // HYPRE_PCGSetTol_dbl(pcg_solver, 1.0e-10); + HYPRE_PCGSetTwoNorm_dbl(pcg_solver, 1); + // HYPRE_PCGSetRelChange_dbl(pcg_solver, rel_change); + HYPRE_PCGSetPrintLevel_dbl(pcg_solver, 3); + // HYPRE_PCGSetAbsoluteTo_dbll(pcg_solver, atol); + // HYPRE_PCGSetRecomputeResidual_dbl(pcg_solver, recompute_res); + + + /* Now set up the AMG preconditioner and specify any parameters */ + if (solver_id == 1) + { + if (myid == 0) { hypre_printf("\n\n***** Solver: MIXED PRECISION AMG-PCG *****\n"); } + HYPRE_BoomerAMGCreate_flt(&amg_solver); + // HYPRE_BoomerAMGSetPrintLevel_flt(amg_solver, 0); /* print amg solution info */ + HYPRE_BoomerAMGSetCoarsenType_flt(amg_solver, 8); + // HYPRE_BoomerAMGSetOldDefault_flt(amg_solver); + HYPRE_BoomerAMGSetRelaxType_flt(amg_solver, 18); /* Sym G.S./Jacobi hybrid */ + HYPRE_BoomerAMGSetNumSweeps_flt(amg_solver, 1); + HYPRE_BoomerAMGSetTol_flt(amg_solver, 0.0); /* conv. tolerance zero */ + HYPRE_BoomerAMGSetMaxIter_flt(amg_solver, 1); /* do only one iteration! */ + + // Set the preconditioner for PCG (single precision matrix) + HYPRE_PCGSetPrecondMatrix_dbl(pcg_solver, (HYPRE_Matrix)parcsr_A); + // Set the preconditioner for PCG. + // This actually sets a pointer to a single precision AMG solver. + // The setup and solve functions just allow us to accept double precision + // rhs and sol vectors from the PCG solver to do the preconditioner solve. + HYPRE_PCGSetPrecond_dbl(pcg_solver, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve_mp, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup_mp, + amg_solver); + + HYPRE_PCGGetPrecond_dbl(pcg_solver, &pcg_precond_gotten); + if (pcg_precond_gotten != amg_solver) + { + hypre_printf("HYPRE_ParCSRPCGGetPrecond got bad precond\n"); + return (-1); + } + else if (myid == 0) + { + hypre_printf("HYPRE_ParCSRPCGGetPrecond got good precond\n"); + } + } + else + { + if (myid == 0) { hypre_printf("\n\n***** Solver: DOUBLE PRECISION DS-PCG *****\n"); } + } + // Setup PCG solver (double precision) + HYPRE_PCGSetup_dbl(pcg_solver, (HYPRE_Matrix)parcsr_B, (HYPRE_Vector)par_bb, (HYPRE_Vector)par_xb); + MPI_Barrier(hypre_MPI_COMM_WORLD); + hypre_EndTiming(time_index); + hypre_PrintTiming("Mixed precision Setup Time", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + fflush(NULL); + + time_index = hypre_InitializeTiming("DBL Solve"); + MPI_Barrier(hypre_MPI_COMM_WORLD); + hypre_BeginTiming(time_index); + // PCG solve (double precision) + HYPRE_PCGSolve_dbl(pcg_solver, (HYPRE_Matrix)parcsr_B, (HYPRE_Vector)par_bb, (HYPRE_Vector)par_xb); + + MPI_Barrier(hypre_MPI_COMM_WORLD); + hypre_EndTiming(time_index); + hypre_PrintTiming("Mixed precision Solve Time", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + HYPRE_PCGGetNumIterations_dbl(pcg_solver, &num_iterations); + HYPRE_PCGGetFinalRelativeResidualNorm_dbl(pcg_solver, &dfinal_res_norm); + if (myid == 0) + { + hypre_printf("final relative residual norm = %e \n", dfinal_res_norm); + hypre_printf("Iteration count = %d \n", num_iterations); + } + fflush(NULL); + // destroy pcg solver + HYPRE_ParCSRPCGDestroy_dbl(pcg_solver); + if (solver_id == 1) { HYPRE_BoomerAMGDestroy_flt(amg_solver); } + } + + /* Clean up */ + HYPRE_IJMatrixDestroy_flt(A); + HYPRE_IJVectorDestroy_flt(b); + HYPRE_IJVectorDestroy_flt(x); + HYPRE_IJVectorDestroy_flt(ijres); + HYPRE_IJVectorDestroy_flt(ije); + + HYPRE_IJMatrixDestroy_dbl(B); + HYPRE_IJVectorDestroy_dbl(bb); + HYPRE_IJVectorDestroy_dbl(xb); + HYPRE_IJVectorDestroy_dbl(ijhres); + HYPRE_IJVectorDestroy_dbl(ijxtmp); + + /* Finalize MPI*/ + MPI_Finalize(); + + return (0); +} + +HYPRE_Int HYPRE_DefectCorrectionSolver(HYPRE_ParCSRMatrix A, + HYPRE_ParCSRMatrix B, + HYPRE_ParVector x, + HYPRE_ParVector b, + HYPRE_Solver solver, + HYPRE_PtrToSolverFcn approx_solve, + HYPRE_Int maxits) +{ + + + + return 0; + +} diff --git a/src/test/test_mp_pcg_3d.c b/src/test/test_mp_pcg_3d.c new file mode 100644 index 0000000000..e893c6a07a --- /dev/null +++ b/src/test/test_mp_pcg_3d.c @@ -0,0 +1,644 @@ +/****************************************************************************** + * 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) + ******************************************************************************/ + +/*! + This file contains a mocked-up example, based on ex5.c in the examples directory. + The goal is to give an idea of how a user may utilize hypre to assemble matrix data + and access solvers in a way that would facilitate a mixed-precision solution of the + linear system. This particular driver demonstrates how the mixed-precision build may + be used to develop mixed-precision solvers, such as the defect-correction-based solver + implemented here. Feel free to ask questions, make comments or suggestions + regarding any of the information below. +*/ + +#include +#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" + +#include + +#define MAXITS 1000 + +#define my_min(a,b) (((a)<(b)) ? (a) : (b)) + +HYPRE_Int HYPRE_DefectCorrectionSolver(HYPRE_ParCSRMatrix A, + HYPRE_ParCSRMatrix B, + HYPRE_ParVector x, + HYPRE_ParVector b, + HYPRE_Solver solver, + HYPRE_PtrToSolverFcn approx_solve, + HYPRE_Int maxits); + +int main (int argc, char *argv[]) +{ + int arg_index; + int i; + int myid, num_procs; + int N, n, n2; + int ilower, iupper; + int local_size, extra; + int solver_id; + float h, h2; + double dh, dh2; + //double d_one = 1.0; + double d_zero = 0.; + float zero = 0.; + int num_iterations; + double dfinal_res_norm; + float final_res_norm; + int time_index; + //float wall_time; + /*! Matrix and preconditioner declarations. Here, we declare IJMatrices and parcsr matrices + for the solver (A, parcsr_A) and the preconditioner (B, parcsr_B). I have included two suggestions + below on how we would utilize both of these matrices. + */ + + //HYPRE_IJMatrix C; + //HYPRE_ParCSRMatrix parcsr_C; + + HYPRE_IJMatrix A; + HYPRE_ParCSRMatrix parcsr_A; + HYPRE_IJVector b; + HYPRE_ParVector par_b; + HYPRE_IJVector x; + HYPRE_ParVector par_x; + + HYPRE_IJMatrix B; + HYPRE_ParCSRMatrix parcsr_B; + HYPRE_IJVector bb; + HYPRE_ParVector par_bb; + HYPRE_IJVector xb; + HYPRE_ParVector par_xb; + + HYPRE_IJVector ijres; + HYPRE_IJVector ijhres; + HYPRE_IJVector ije; + HYPRE_IJVector ijxtmp; + /*! Solver and preconditioner and declarations and solver_precision variable. Internally, HYPRE_SolverPrecision + is an enum struct containing HYPRE_REAL_float, HYPRE_REAL_SINGLE and HYPRE_REAL_LONG. + */ + //HYPRE_Solver solver, precond; + /* Initialize MPI */ + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &myid); + MPI_Comm_size(MPI_COMM_WORLD, &num_procs); + + /*! We set up the linear system following ex5. */ + /* Some default problem parameters */ + n = 25; + solver_id = 0; + + /*-------------------------- + * Parse command line + *--------------------------*/ + arg_index = 0; + while (arg_index < argc) + { + if ( strcmp(argv[arg_index], "-solver") == 0 ) + { + arg_index++; + solver_id = atoi(argv[arg_index++]); + } + else if ( strcmp(argv[arg_index], "-n") == 0 ) + { + arg_index++; + n = atoi(argv[arg_index++]); + } + else + { + arg_index++; + } + } + + /* Preliminaries: want at least one processor per row */ + if (n * n * n < num_procs) { n = sqrt(num_procs) + 1; } + N = n * n * n; /* global number of rows */ + /* double and float variants of mesh spacing */ + h = 1.0 / (float)(n + 1); /* mesh size*/ + dh = 1.0 / (double)(n + 1); + h2 = h * h; + n2 = n * n; + dh2 = dh * dh; + /* partition rows */ + local_size = N / num_procs; + //local_size = N; + extra = N - local_size * num_procs; + //extra = 0; + + ilower = local_size * myid; + ilower += my_min(myid, extra); + + iupper = local_size * (myid + 1); + iupper += my_min(myid + 1, extra); + iupper = iupper - 1; + + local_size = iupper - ilower + 1; + + HYPRE_IJMatrixCreate_flt(MPI_COMM_WORLD, ilower, iupper, ilower, iupper, &A); + HYPRE_IJMatrixSetObjectType_flt(A, HYPRE_PARCSR); + + HYPRE_IJMatrixCreate_dbl(MPI_COMM_WORLD, ilower, iupper, ilower, iupper, &B); + HYPRE_IJMatrixSetObjectType_dbl(B, HYPRE_PARCSR); + + /*! Initialize before setting coefficients */ + HYPRE_IJMatrixInitialize_flt(A); + HYPRE_IJMatrixInitialize_dbl(B); + /*! Set matrix entries */ + { + int nnz; + /* double and float variants of values */ + float values[7]; + double dvalues[7]; + int cols[7]; + + for (i = ilower; i <= iupper; i++) + { + nnz = 0; + /* The bottom identity block:position i-n^2 */ + if ((i - n2) >= 0) + { + cols[nnz] = i - n2; + values[nnz] = -1.0; + dvalues[nnz] = -1.0; + nnz++; + } + /* The left identity block:position i-n */ + if ((i - n) >= 0) + { + cols[nnz] = i - n; + values[nnz] = -1.0; + dvalues[nnz] = -1.0; + nnz++; + } + /* The left -1: position i-1 */ + if (i % n) + { + cols[nnz] = i - 1; + values[nnz] = -1.0; + dvalues[nnz] = -1.0; + nnz++; + } + /* Set the diagonal: position i */ + cols[nnz] = i; + values[nnz] = 6.0; + dvalues[nnz] = 6.0; + nnz++; + /* The right -1: position i+1 */ + if ((i + 1) % n) + { + cols[nnz] = i + 1; + values[nnz] = -1.0; + dvalues[nnz] = -1.0; + nnz++; + } + /* The right identity block:position i+n */ + if ((i + n) < N) + { + cols[nnz] = i + n; + values[nnz] = -1.0; + dvalues[nnz] = -1.0; + nnz++; + } + /* The top identity block:position i+n^2 */ + if ((i + n2) < N) + { + cols[nnz] = i + n2; + values[nnz] = -1.0; + dvalues[nnz] = -1.0; + nnz++; + } + + /* Set the values for row i */ + HYPRE_IJMatrixSetValues_flt(A, 1, &nnz, &i, cols, values); + HYPRE_IJMatrixSetValues_dbl(B, 1, &nnz, &i, cols, dvalues); + } + } + + /*! Assemble after setting the coefficients */ + HYPRE_IJMatrixAssemble_flt(A); + HYPRE_IJMatrixAssemble_dbl(B); + /*! Get the parcsr matrix object to use */ + HYPRE_IJMatrixGetObject_flt(A, (void**) &parcsr_A); + HYPRE_IJMatrixGetObject_dbl(B, (void**) &parcsr_B); + /*! Create the rhs and solution. Here, we only account for the solver precision. Since the preconditioner solve + is done internally, we can pass the appropriate vector types there. + */ + { + HYPRE_IJVectorCreate_flt(MPI_COMM_WORLD, ilower, iupper, &b); + HYPRE_IJVectorSetObjectType_flt(b, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_flt(b); + + HYPRE_IJVectorCreate_flt(MPI_COMM_WORLD, ilower, iupper, &x); + HYPRE_IJVectorSetObjectType_flt(x, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_flt(x); + + HYPRE_IJVectorCreate_dbl(MPI_COMM_WORLD, ilower, iupper, &bb); + HYPRE_IJVectorSetObjectType_dbl(bb, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_dbl(bb); + + HYPRE_IJVectorCreate_dbl(MPI_COMM_WORLD, ilower, iupper, &xb); + HYPRE_IJVectorSetObjectType_dbl(xb, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_dbl(xb); + + HYPRE_IJVectorCreate_flt(MPI_COMM_WORLD, ilower, iupper, &ijres); + HYPRE_IJVectorSetObjectType_flt(ijres, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_flt(ijres); + + HYPRE_IJVectorCreate_flt(MPI_COMM_WORLD, ilower, iupper, &ije); + HYPRE_IJVectorSetObjectType_flt(ije, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_flt(ije); + + HYPRE_IJVectorCreate_dbl(MPI_COMM_WORLD, ilower, iupper, &ijhres); + HYPRE_IJVectorSetObjectType_dbl(ijhres, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_dbl(ijhres); + + HYPRE_IJVectorCreate_dbl(MPI_COMM_WORLD, ilower, iupper, &ijxtmp); + HYPRE_IJVectorSetObjectType_dbl(ijxtmp, HYPRE_PARCSR); + HYPRE_IJVectorInitialize_dbl(ijxtmp); + } + + + /* Initialize rhs and solution */ + { + float *rhs_values, *x_values; + double *drhs_values, *dx_values; + int *rows; + + rhs_values = (float*) calloc(local_size, sizeof(float)); + x_values = (float*) calloc(local_size, sizeof(float)); + + drhs_values = (double*) calloc(local_size, sizeof(double)); + dx_values = (double*) calloc(local_size, sizeof(double)); + + rows = (int*) calloc(local_size, sizeof(int)); + + for (i = 0; i < local_size; i++) + { + rhs_values[i] = h2; + x_values[i] = 0.0; + + drhs_values[i] = dh2; + dx_values[i] = 0.0; + + rows[i] = ilower + i; + } + + HYPRE_IJVectorSetValues_flt(b, local_size, rows, rhs_values); + HYPRE_IJVectorSetValues_flt(x, local_size, rows, x_values); + + HYPRE_IJVectorSetValues_dbl(bb, local_size, rows, drhs_values); + HYPRE_IJVectorSetValues_dbl(xb, local_size, rows, dx_values); + + HYPRE_IJVectorSetValues_flt(ijres, local_size, rows, rhs_values); + HYPRE_IJVectorSetValues_flt(ije, local_size, rows, x_values); + HYPRE_IJVectorSetValues_dbl(ijhres, local_size, rows, drhs_values); + HYPRE_IJVectorSetValues_dbl(ijxtmp, local_size, rows, dx_values); + + free(x_values); + free(rhs_values); + + free(dx_values); + free(drhs_values); + + free(rows); + } + + /* Assemble vector and get parcsr vector object */ + HYPRE_IJVectorAssemble_flt(b); + HYPRE_IJVectorGetObject_flt(b, (void **) &par_b); + HYPRE_IJVectorAssemble_flt(x); + HYPRE_IJVectorGetObject_flt(x, (void **) &par_x); + + HYPRE_IJVectorAssemble_dbl(bb); + HYPRE_IJVectorGetObject_dbl(bb, (void **) &par_bb); + HYPRE_IJVectorAssemble_dbl(xb); + HYPRE_IJVectorGetObject_dbl(xb, (void **) &par_xb); + + /*! Done with linear system setup. Now proceed to solve the system. */ + // Double precision + { + /* reset solution vector */ + HYPRE_ParVectorSetConstantValues_dbl(par_xb, d_zero); + + HYPRE_Solver amg_solver; + HYPRE_Solver pcg_solver; + HYPRE_Solver pcg_precond_gotten; + + time_index = hypre_InitializeTiming("DBL Setup"); + MPI_Barrier(hypre_MPI_COMM_WORLD); + hypre_BeginTiming(time_index); + // Create PCG solver + HYPRE_ParCSRPCGCreate_dbl(hypre_MPI_COMM_WORLD, &pcg_solver); + HYPRE_PCGSetMaxIter_dbl(pcg_solver, MAXITS); + HYPRE_PCGSetTol_dbl(pcg_solver, 1.0e-8); + HYPRE_PCGSetTwoNorm_dbl(pcg_solver, 1); + // HYPRE_PCGSetRelChange_dbl(pcg_solver, rel_change); + HYPRE_PCGSetPrintLevel_dbl(pcg_solver, 0); + // HYPRE_PCGSetAbsoluteTo_dbll(pcg_solver, atol); + // HYPRE_PCGSetRecomputeResidual_dbl(pcg_solver, recompute_res); + + + /* Now set up the AMG preconditioner and specify any parameters */ + if (solver_id == 1) + { + if (myid == 0) { hypre_printf("\n\n***** Solver: DOUBLE PRECISION AMG-PCG *****\n"); } + + HYPRE_BoomerAMGCreate_dbl(&amg_solver); + // HYPRE_BoomerAMGSetPrintLevel_dbl(amg_solver, 0); /* print amg solution info */ + HYPRE_BoomerAMGSetCoarsenType_dbl(amg_solver, 8); + // HYPRE_BoomerAMGSetOldDefault_dbl(amg_solver); + HYPRE_BoomerAMGSetRelaxType_dbl(amg_solver, 18); /* Sym G.S./Jacobi hybrid */ + HYPRE_BoomerAMGSetNumSweeps_dbl(amg_solver, 1); + HYPRE_BoomerAMGSetTol_dbl(amg_solver, 0.0); /* conv. tolerance zero */ + HYPRE_BoomerAMGSetMaxIter_dbl(amg_solver, 1); /* do only one iteration! */ + + // Set the preconditioner for PCG + HYPRE_PCGSetPrecondMatrix_dbl(pcg_solver, (HYPRE_Matrix)parcsr_B); + + HYPRE_PCGSetPrecond_dbl(pcg_solver, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve_dbl, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup_dbl, + amg_solver); + + HYPRE_PCGGetPrecond_dbl(pcg_solver, &pcg_precond_gotten); + if (pcg_precond_gotten != amg_solver) + { + hypre_printf("HYPRE_ParCSRPCGGetPrecond got bad precond\n"); + return (-1); + } + else if (myid == 0) + { + hypre_printf("HYPRE_ParCSRPCGGetPrecond got good precond\n"); + } + } + else + { + if (myid == 0) { hypre_printf("\n\n***** Solver: DOUBLE PRECISION DS-PCG *****\n"); } + } + // Setup PCG solver + HYPRE_PCGSetup_dbl(pcg_solver, (HYPRE_Matrix)parcsr_B, (HYPRE_Vector)par_bb, (HYPRE_Vector)par_xb); + MPI_Barrier(hypre_MPI_COMM_WORLD); + hypre_EndTiming(time_index); + hypre_PrintTiming("Double precision Setup Time", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + fflush(NULL); + + time_index = hypre_InitializeTiming("DBL Solve"); + MPI_Barrier(hypre_MPI_COMM_WORLD); + hypre_BeginTiming(time_index); + // PCG solve + HYPRE_PCGSolve_dbl(pcg_solver, (HYPRE_Matrix)parcsr_B, (HYPRE_Vector)par_bb, (HYPRE_Vector)par_xb); + + MPI_Barrier(hypre_MPI_COMM_WORLD); + hypre_EndTiming(time_index); + hypre_PrintTiming("Double precision Solve Time", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + HYPRE_PCGGetNumIterations_dbl(pcg_solver, &num_iterations); + HYPRE_PCGGetFinalRelativeResidualNorm_dbl(pcg_solver, &dfinal_res_norm); + if (myid == 0) + { + hypre_printf("final relative residual norm = %e \n", dfinal_res_norm); + hypre_printf("Iteration count = %d \n", num_iterations); + } + fflush(NULL); + // destroy pcg solver + HYPRE_ParCSRPCGDestroy_dbl(pcg_solver); + if (solver_id == 1) { HYPRE_BoomerAMGDestroy_dbl(amg_solver); } + } + // Single precision + { + /* reset solution vector */ + HYPRE_ParVectorSetConstantValues_flt(par_x, zero); + + HYPRE_Solver amg_solver; + HYPRE_Solver pcg_solver; + HYPRE_Solver pcg_precond_gotten; + + time_index = hypre_InitializeTiming("FLT Setup"); + MPI_Barrier(hypre_MPI_COMM_WORLD); + hypre_BeginTiming(time_index); + // Create PCG solver + HYPRE_ParCSRPCGCreate_flt(hypre_MPI_COMM_WORLD, &pcg_solver); + HYPRE_PCGSetMaxIter_flt(pcg_solver, MAXITS); + HYPRE_PCGSetTol_flt(pcg_solver, 1.0e-8); + HYPRE_PCGSetTwoNorm_flt(pcg_solver, 1); + // HYPRE_PCGSetRelChange_flt(pcg_solver, rel_change); + HYPRE_PCGSetPrintLevel_flt(pcg_solver, 0); + // HYPRE_PCGSetAbsoluteTo_fltl(pcg_solver, atol); + // HYPRE_PCGSetRecomputeResidual_flt(pcg_solver, recompute_res); + + + /* Now set up the AMG preconditioner and specify any parameters */ + if (solver_id == 1) + { + if (myid == 0) { hypre_printf("\n\n***** Solver: SINGLE PRECISION AMG-PCG *****\n"); } + HYPRE_BoomerAMGCreate_flt(&amg_solver); + // HYPRE_BoomerAMGSetPrintLevel_flt(amg_solver, 0); /* print amg solution info */ + HYPRE_BoomerAMGSetCoarsenType_flt(amg_solver, 8); + // HYPRE_BoomerAMGSetOldDefault_flt(amg_solver); + HYPRE_BoomerAMGSetRelaxType_flt(amg_solver, 18); /* Sym G.S./Jacobi hybrid */ + HYPRE_BoomerAMGSetNumSweeps_flt(amg_solver, 1); + HYPRE_BoomerAMGSetTol_flt(amg_solver, 0.0); /* conv. tolerance zero */ + HYPRE_BoomerAMGSetMaxIter_flt(amg_solver, 1); /* do only one iteration! */ + + // Set the preconditioner for PCG + HYPRE_PCGSetPrecondMatrix_flt(pcg_solver, (HYPRE_Matrix)parcsr_A); + + HYPRE_PCGSetPrecond_flt(pcg_solver, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve_flt, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup_flt, + amg_solver); + + HYPRE_PCGGetPrecond_flt(pcg_solver, &pcg_precond_gotten); + if (pcg_precond_gotten != amg_solver) + { + hypre_printf("HYPRE_ParCSRPCGGetPrecond got bad precond\n"); + return (-1); + } + else if (myid == 0) + { + hypre_printf("HYPRE_ParCSRPCGGetPrecond got good precond\n"); + } + } + else + { + if (myid == 0) { hypre_printf("\n\n***** Solver: SINGLE PRECISION DS-PCG *****\n"); } + } + // Setup PCG solver + HYPRE_PCGSetup_flt(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)par_b, (HYPRE_Vector)par_x); + MPI_Barrier(hypre_MPI_COMM_WORLD); + hypre_EndTiming(time_index); + hypre_PrintTiming("Single precision Setup Time", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + fflush(NULL); + + time_index = hypre_InitializeTiming("FLT Solve"); + MPI_Barrier(hypre_MPI_COMM_WORLD); + hypre_BeginTiming(time_index); + // PCG solve + HYPRE_PCGSolve_flt(pcg_solver, (HYPRE_Matrix)parcsr_A, (HYPRE_Vector)par_b, (HYPRE_Vector)par_x); + + MPI_Barrier(hypre_MPI_COMM_WORLD); + hypre_EndTiming(time_index); + hypre_PrintTiming("Single precision Solve Time", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + HYPRE_PCGGetNumIterations_flt(pcg_solver, &num_iterations); + HYPRE_PCGGetFinalRelativeResidualNorm_flt(pcg_solver, &final_res_norm); + if (myid == 0) + { + hypre_printf("final relative residual norm = %e \n", final_res_norm); + hypre_printf("Iteration count = %d \n", num_iterations); + } + fflush(NULL); + // destroy pcg solver + HYPRE_ParCSRPCGDestroy_flt(pcg_solver); + if (solver_id == 1) { HYPRE_BoomerAMGDestroy_flt(amg_solver); } + } + // mixed-precision + { + /* reset solution vector */ + HYPRE_ParVectorSetConstantValues_dbl(par_xb, d_zero); + + HYPRE_Solver amg_solver; + HYPRE_Solver pcg_solver; + HYPRE_Solver pcg_precond_gotten; + + time_index = hypre_InitializeTiming("DBL Setup"); + MPI_Barrier(hypre_MPI_COMM_WORLD); + hypre_BeginTiming(time_index); + // Create PCG solver + HYPRE_ParCSRPCGCreate_dbl(hypre_MPI_COMM_WORLD, &pcg_solver); + HYPRE_PCGSetMaxIter_dbl(pcg_solver, MAXITS); + HYPRE_PCGSetTol_dbl(pcg_solver, 1.0e-8); + HYPRE_PCGSetTwoNorm_dbl(pcg_solver, 1); + // HYPRE_PCGSetRelChange_dbl(pcg_solver, rel_change); + HYPRE_PCGSetPrintLevel_dbl(pcg_solver, 0); + // HYPRE_PCGSetAbsoluteTo_dbll(pcg_solver, atol); + // HYPRE_PCGSetRecomputeResidual_dbl(pcg_solver, recompute_res); + + + /* Now set up the AMG preconditioner and specify any parameters */ + if (solver_id == 1) + { + if (myid == 0) { hypre_printf("\n\n***** Solver: MIXED PRECISION AMG-PCG *****\n"); } + HYPRE_BoomerAMGCreate_flt(&amg_solver); + // HYPRE_BoomerAMGSetPrintLevel_flt(amg_solver, 0); /* print amg solution info */ + HYPRE_BoomerAMGSetCoarsenType_flt(amg_solver, 8); + // HYPRE_BoomerAMGSetOldDefault_flt(amg_solver); + HYPRE_BoomerAMGSetRelaxType_flt(amg_solver, 18); /* Sym G.S./Jacobi hybrid */ + HYPRE_BoomerAMGSetNumSweeps_flt(amg_solver, 1); + HYPRE_BoomerAMGSetTol_flt(amg_solver, 0.0); /* conv. tolerance zero */ + HYPRE_BoomerAMGSetMaxIter_flt(amg_solver, 1); /* do only one iteration! */ + + // Set the preconditioner for PCG (single precision matrix) + HYPRE_PCGSetPrecondMatrix_dbl(pcg_solver, (HYPRE_Matrix)parcsr_A); + // Set the preconditioner for PCG. + // This actually sets a pointer to a single precision AMG solver. + // The setup and solve functions just allow us to accept double precision + // rhs and sol vectors from the PCG solver to do the preconditioner solve. + HYPRE_PCGSetPrecond_dbl(pcg_solver, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSolve_mp, + (HYPRE_PtrToSolverFcn) HYPRE_BoomerAMGSetup_mp, + amg_solver); + + HYPRE_PCGGetPrecond_dbl(pcg_solver, &pcg_precond_gotten); + if (pcg_precond_gotten != amg_solver) + { + hypre_printf("HYPRE_ParCSRPCGGetPrecond got bad precond\n"); + return (-1); + } + else if (myid == 0) + { + hypre_printf("HYPRE_ParCSRPCGGetPrecond got good precond\n"); + } + } + else + { + if (myid == 0) { hypre_printf("\n\n***** Solver: DOUBLE PRECISION DS-PCG *****\n"); } + } + // Setup PCG solver (double precision) + HYPRE_PCGSetup_dbl(pcg_solver, (HYPRE_Matrix)parcsr_B, (HYPRE_Vector)par_bb, (HYPRE_Vector)par_xb); + MPI_Barrier(hypre_MPI_COMM_WORLD); + hypre_EndTiming(time_index); + hypre_PrintTiming("Mixed precision Setup Time", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + fflush(NULL); + + time_index = hypre_InitializeTiming("DBL Solve"); + MPI_Barrier(hypre_MPI_COMM_WORLD); + hypre_BeginTiming(time_index); + // PCG solve (double precision) + HYPRE_PCGSolve_dbl(pcg_solver, (HYPRE_Matrix)parcsr_B, (HYPRE_Vector)par_bb, (HYPRE_Vector)par_xb); + + MPI_Barrier(hypre_MPI_COMM_WORLD); + hypre_EndTiming(time_index); + hypre_PrintTiming("Mixed precision Solve Time", hypre_MPI_COMM_WORLD); + hypre_FinalizeTiming(time_index); + hypre_ClearTiming(); + + HYPRE_PCGGetNumIterations_dbl(pcg_solver, &num_iterations); + HYPRE_PCGGetFinalRelativeResidualNorm_dbl(pcg_solver, &dfinal_res_norm); + if (myid == 0) + { + hypre_printf("final relative residual norm = %e \n", dfinal_res_norm); + hypre_printf("Iteration count = %d \n", num_iterations); + } + fflush(NULL); + // destroy pcg solver + HYPRE_ParCSRPCGDestroy_dbl(pcg_solver); + if (solver_id == 1) { HYPRE_BoomerAMGDestroy_flt(amg_solver); } + } + + /* Clean up */ + HYPRE_IJMatrixDestroy_flt(A); + HYPRE_IJVectorDestroy_flt(b); + HYPRE_IJVectorDestroy_flt(x); + HYPRE_IJVectorDestroy_flt(ijres); + HYPRE_IJVectorDestroy_flt(ije); + + HYPRE_IJMatrixDestroy_dbl(B); + HYPRE_IJVectorDestroy_dbl(bb); + HYPRE_IJVectorDestroy_dbl(xb); + HYPRE_IJVectorDestroy_dbl(ijhres); + HYPRE_IJVectorDestroy_dbl(ijxtmp); + + /* Finalize MPI*/ + MPI_Finalize(); + + return (0); +} + +HYPRE_Int HYPRE_DefectCorrectionSolver(HYPRE_ParCSRMatrix A, + HYPRE_ParCSRMatrix B, + HYPRE_ParVector x, + HYPRE_ParVector b, + HYPRE_Solver solver, + HYPRE_PtrToSolverFcn approx_solve, + HYPRE_Int maxits) +{ + + + + return 0; + +} diff --git a/src/test/zboxloop.c b/src/test/zboxloop.c index b4c697b722..a888e17c12 100644 --- a/src/test/zboxloop.c +++ b/src/test/zboxloop.c @@ -32,13 +32,11 @@ main( hypre_int argc, HYPRE_Int num_procs, myid; HYPRE_Int dim; HYPRE_Int rep, reps, fail, sum; - HYPRE_Int size; + HYPRE_Int size, xi1; hypre_Box *x1_data_box, *x2_data_box, *x3_data_box, *x4_data_box; - //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; + hypre_Index loop_size, start, ustride, index; /*----------------------------------------------------------- * Initialize some stuff @@ -161,7 +159,7 @@ main( hypre_int argc, hypre_SetIndex3(start, 1, 1, 1); hypre_SetIndex3(loop_size, nx, ny, nz); - hypre_SetIndex3(unit_stride, 1, 1, 1); + hypre_SetIndex3(ustride, 1, 1, 1); x1_data_box = hypre_BoxCreate(dim); x2_data_box = hypre_BoxCreate(dim); @@ -209,7 +207,7 @@ main( hypre_int argc, /* xp1 is already initialized to 0 */ zypre_BoxLoop1Begin(dim, loop_size, - x1_data_box, start, unit_stride, xi1); + x1_data_box, start, ustride, xi1); { xp1[xi1] ++; } @@ -219,7 +217,7 @@ main( hypre_int argc, fail = 0; sum = 0; hypre_SerialBoxLoop1Begin(3, loop_size, - x1_data_box, start, unit_stride, xi1); + x1_data_box, start, ustride, xi1); { sum += (HYPRE_Int)xp1[xi1]; if (xp1[xi1] != 1) @@ -257,12 +255,10 @@ main( hypre_int argc, hypre_BeginTiming(time_index); for (rep = 0; rep < reps; rep++) { - xi1 = 0; #define DEVICE_VAR is_device_ptr(d_xp1) hypre_BoxLoop0Begin(3, loop_size); { - d_xp1[xi1] += d_xp1[xi1]; - //xi1++; + d_xp1[0] += 1.0; } hypre_BoxLoop0End(); #undef DEVICE_VAR @@ -276,7 +272,7 @@ main( hypre_int argc, { #define DEVICE_VAR is_device_ptr(d_xp1) hypre_BoxLoop1Begin(3, loop_size, - x1_data_box, start, unit_stride, xi1); + x1_data_box, start, ustride, xi1); { d_xp1[xi1] += d_xp1[xi1]; } @@ -292,8 +288,8 @@ main( hypre_int argc, { #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); + x1_data_box, start, ustride, xi1, + x2_data_box, start, ustride, xi2); { d_xp1[xi1] += d_xp1[xi1] + d_xp2[xi2]; } @@ -309,9 +305,9 @@ main( hypre_int argc, { #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); + x1_data_box, start, ustride, xi1, + x2_data_box, start, ustride, xi2, + x3_data_box, start, ustride, xi3); { d_xp1[xi1] += d_xp1[xi1] + d_xp2[xi2] + d_xp3[xi3]; } @@ -327,10 +323,10 @@ main( hypre_int argc, { #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); + x1_data_box, start, ustride, xi1, + x2_data_box, start, ustride, xi2, + x3_data_box, start, ustride, xi3, + x4_data_box, start, ustride, xi4); { d_xp1[xi1] += d_xp1[xi1] + d_xp2[xi2] + d_xp3[xi3] + d_xp4[xi4]; } @@ -370,7 +366,7 @@ main( hypre_int argc, for (rep = 0; rep < reps; rep++) { zypre_BoxLoop1Begin(dim, loop_size, - x1_data_box, start, unit_stride, xi1); + x1_data_box, start, ustride, xi1); { xp1[xi1] += xp1[xi1]; } @@ -384,8 +380,8 @@ main( hypre_int argc, for (rep = 0; rep < reps; rep++) { zypre_BoxLoop2Begin(dim, loop_size, - x1_data_box, start, unit_stride, xi1, - x2_data_box, start, unit_stride, xi2); + x1_data_box, start, ustride, xi1, + x2_data_box, start, ustride, xi2); { xp1[xi1] += xp1[xi1] + xp2[xi2]; } @@ -399,9 +395,9 @@ main( hypre_int argc, for (rep = 0; rep < reps; rep++) { zypre_BoxLoop3Begin(dim, loop_size, - x1_data_box, start, unit_stride, xi1, - x2_data_box, start, unit_stride, xi2, - x3_data_box, start, unit_stride, xi3); + x1_data_box, start, ustride, xi1, + x2_data_box, start, ustride, xi2, + x3_data_box, start, ustride, xi3); { xp1[xi1] += xp1[xi1] + xp2[xi2] + xp3[xi3]; } @@ -415,10 +411,10 @@ main( hypre_int argc, for (rep = 0; rep < reps; rep++) { zypre_BoxLoop4Begin(dim, 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); + x1_data_box, start, ustride, xi1, + x2_data_box, start, ustride, xi2, + x3_data_box, start, ustride, xi3, + x4_data_box, start, ustride, xi4); { xp1[xi1] += xp1[xi1] + xp2[xi2] + xp3[xi3] + xp4[xi4]; } @@ -474,7 +470,7 @@ main( hypre_int argc, reducer = 0.0; #define DEVICE_VAR is_device_ptr(d_xp1) hypre_BoxLoop1ReductionBegin(3, loop_size, - x1_data_box, start, unit_stride, xi1, + x1_data_box, start, ustride, xi1, reducer); { reducer += 1.0 / d_xp1[xi1]; @@ -493,8 +489,8 @@ main( hypre_int argc, 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, + x1_data_box, start, ustride, xi1, + x2_data_box, start, ustride, xi2, reducer); { reducer += 1.0 / d_xp1[xi1] + d_xp2[xi2] * 3.1415926; @@ -522,7 +518,7 @@ main( hypre_int argc, #undef HYPRE_BOX_REDUCTION #define HYPRE_BOX_REDUCTION reduction(+:zbox_sum1) zypre_BoxLoop1Begin(dim, loop_size, - x1_data_box, start, unit_stride, xi1); + x1_data_box, start, ustride, xi1); { zbox_sum1 += 1.0 / xp1[xi1]; } @@ -538,8 +534,8 @@ main( hypre_int argc, #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); + x1_data_box, start, ustride, xi1, + x2_data_box, start, ustride, xi2); { zbox_sum2 += 1.0 / xp1[xi1] + xp2[xi2] * 3.1415926; } diff --git a/src/utilities/CMakeLists.txt b/src/utilities/CMakeLists.txt index 27af9d86cf..b10ed0b3d9 100644 --- a/src/utilities/CMakeLists.txt +++ b/src/utilities/CMakeLists.txt @@ -4,70 +4,102 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) set(HDRS + HYPRE_error_f.h HYPRE_utilities.h _hypre_utilities.h _hypre_utilities.hpp - HYPRE_error_f.h - fortran.h - fortran_matrix.h + _hypre_fortran.h + _hypre_fortran_matrix.h ) -set(SRCS +if(HYPRE_ENABLE_SYCL) + list(APPEND HDRS _hypre_onedpl.hpp) +endif() + +# Add MUP headers +if(HYPRE_ENABLE_MIXED_PRECISION) + list(APPEND HDRS + HYPRE_utilities_mup.h + _hypre_mup_def.h + _hypre_utilities_mup.h + _hypre_utilities_mup_def.h + _hypre_utilities_mup_undef.h + ) +endif() + +# Regular sources +set(REGULAR_SRCS + F90_HYPRE_error.c + F90_HYPRE_general.c HYPRE_handle.c HYPRE_version.c amg_linklist.c binsearch.c exchange_data.c - F90_HYPRE_error.c - F90_HYPRE_general.c fortran_matrix.c ap.c log.c complex.c + device_markers.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 prefix_sum.c - printf.c qsort.c + unique.c utilities.c mpistubs.c qsplit.c random.c state.c - stl_ops.c threading.c timer.c timing.c + general.c + handle.c + int_array_device.c + memory.c + omp_device.c + stl_ops.c + caliper_instrumentation.c ) -target_sources(${PROJECT_NAME} - PRIVATE ${SRCS} - ${HDRS} +# Mixed precision sources +set(MUP_SRCS + multiprecision.c + mup_fixed.c + mup_functions.c + mup_pre.c + printf.c ) +if (HYPRE_ENABLE_MIXED_PRECISION) + setup_mixed_precision_compilation("utilities" SRCS "${REGULAR_SRCS}") + target_sources(${PROJECT_NAME} PRIVATE ${MUP_SRCS} ${HDRS}) +else() + list(APPEND REGULAR_SRCS + multiprecision.c + printf.c + ) + target_sources(${PROJECT_NAME} PRIVATE ${REGULAR_SRCS} ${HDRS}) +endif() + if (HYPRE_USING_GPU) set(GPU_SRCS + device_markers.c device_utils.c general.c handle.c int_array_device.c memory.c memory_tracker.c - nvtx.c omp_device.c stl_ops.c HYPRE_handle.c diff --git a/src/utilities/F90_HYPRE_error.c b/src/utilities/F90_HYPRE_error.c index 4047faf49e..4a98e6afdf 100644 --- a/src/utilities/F90_HYPRE_error.c +++ b/src/utilities/F90_HYPRE_error.c @@ -6,7 +6,7 @@ ******************************************************************************/ #include "_hypre_utilities.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/utilities/F90_HYPRE_general.c b/src/utilities/F90_HYPRE_general.c index 9ad6bf9346..668626318f 100644 --- a/src/utilities/F90_HYPRE_general.c +++ b/src/utilities/F90_HYPRE_general.c @@ -6,7 +6,7 @@ ******************************************************************************/ #include "_hypre_utilities.h" -#include "fortran.h" +#include "_hypre_fortran.h" #ifdef __cplusplus extern "C" { diff --git a/src/utilities/HYPRE_utilities.h b/src/utilities/HYPRE_utilities.h index 0dd1b70f35..b5711b18c7 100644 --- a/src/utilities/HYPRE_utilities.h +++ b/src/utilities/HYPRE_utilities.h @@ -24,14 +24,33 @@ #include #endif +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_utilities_mup_def.h" +#endif + #ifdef __cplusplus extern "C" { #endif /*-------------------------------------------------------------------------- - * Big int stuff *--------------------------------------------------------------------------*/ +/** + * @defgroup Utilities Utilities + * + * Various utilities available in hypre. + * + * @{ + **/ + +/*===== BEGIN 1 - IGNORE CODE IN DOCS =====*/ /*! \cond */ + +/*-------------------------------------------------------------------------- + * BigInt and MixedInt + *--------------------------------------------------------------------------*/ + +#include + #if defined(HYPRE_BIGINT) typedef long long int HYPRE_BigInt; typedef long long int HYPRE_Int; @@ -43,6 +62,8 @@ typedef long long int HYPRE_Int; #define HYPRE_MPI_BIG_INT MPI_LONG_LONG_INT #define HYPRE_MPI_INT MPI_LONG_LONG_INT +#define HYPRE_INT_MAX LLONG_MAX +#define HYPRE_INT_MIN LLONG_MIN #elif defined(HYPRE_MIXEDINT) typedef long long int HYPRE_BigInt; @@ -55,6 +76,8 @@ typedef int HYPRE_Int; #define HYPRE_MPI_BIG_INT MPI_LONG_LONG_INT #define HYPRE_MPI_INT MPI_INT +#define HYPRE_INT_MAX INT_MAX +#define HYPRE_INT_MIN INT_MIN #else /* default */ typedef int HYPRE_BigInt; @@ -67,10 +90,12 @@ typedef int HYPRE_Int; #define HYPRE_MPI_BIG_INT MPI_INT #define HYPRE_MPI_INT MPI_INT +#define HYPRE_INT_MAX INT_MAX +#define HYPRE_INT_MIN INT_MIN #endif /*-------------------------------------------------------------------------- - * Real and Complex types + * Real and Complex Types *--------------------------------------------------------------------------*/ #include @@ -132,6 +157,13 @@ typedef HYPRE_Real HYPRE_Complex; #define HYPRE_MPI_COMPLEX HYPRE_MPI_REAL #endif +/* This allows us to avoid using 'float', 'double', and 'longdouble' in hypre. + * NOTE: This must be defined here in the external header file for use in the + * mixed precision code. */ +typedef double hypre_double; +typedef float hypre_float; +typedef long double hypre_long_double; + /*-------------------------------------------------------------------------- * Sequential MPI stuff *--------------------------------------------------------------------------*/ @@ -141,101 +173,207 @@ typedef HYPRE_Int MPI_Comm; #endif /*-------------------------------------------------------------------------- - * HYPRE error codes + * HYPRE AP user functions *--------------------------------------------------------------------------*/ -#define HYPRE_ERROR_GENERIC 1 /* generic error */ -#define HYPRE_ERROR_MEMORY 2 /* unable to allocate memory */ -#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 */ +/* 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); + +/*===== END 1 - IGNORE CODE IN DOCS =====*/ /*! \endcond */ /*-------------------------------------------------------------------------- - * HYPRE init/finalize *--------------------------------------------------------------------------*/ /** - * (Required) Initializes the hypre library. + * @name Multiprecision + * + * @{ **/ -HYPRE_Int HYPRE_Initialize(void); +/* object precision options and API are available to users at all times */ /** - * (Required) Initializes the hypre library. This function is provided for backward compatibility. - * Please, use HYPRE_Initialize instead. + * Available precisions. **/ +typedef enum +{ + HYPRE_REAL_SINGLE, + HYPRE_REAL_DOUBLE, + HYPRE_REAL_LONGDOUBLE -#define HYPRE_Init() HYPRE_Initialize() +} HYPRE_Precision; /** - * (Optional) Initializes GPU features in the hypre library. + * Set the global default runtime precision. **/ - -HYPRE_Int HYPRE_DeviceInitialize(void); +HYPRE_Int +HYPRE_SetGlobalPrecision(HYPRE_Precision precision); /** - * (Required) Finalizes the hypre library. + * Get the global default runtime precision. **/ +HYPRE_Int +HYPRE_GetGlobalPrecision(HYPRE_Precision *precision); -HYPRE_Int HYPRE_Finalize(void); +/**@}*/ -/** - * (Optional) Returns true if the hypre library has been initialized but not finalized yet. - **/ +/*===== BEGIN 2 - IGNORE CODE IN DOCS =====*/ /*! \cond */ -HYPRE_Int HYPRE_Initialized(void); +/* RDF: This probably needs to be renamed to something like HYPRE_COMPILE_PRECISION */ +#ifndef HYPRE_OBJECT_PRECISION +#if defined(HYPRE_SINGLE) +#define HYPRE_OBJECT_PRECISION HYPRE_REAL_SINGLE +#elif defined(HYPRE_LONG_DOUBLE) +#define HYPRE_OBJECT_PRECISION HYPRE_REAL_LONGDOUBLE +#else +#define HYPRE_OBJECT_PRECISION HYPRE_REAL_DOUBLE +#endif +#endif + +#ifdef HYPRE_MIXED_PRECISION + +#ifdef hypre_DEFINE_GLOBAL_MP +#define hypre_DEFINE_GLOBAL 1 +#endif + +#ifndef HYPRE_CURRENTPRECISION_FUNC +#if defined(HYPRE_SINGLE) +#define HYPRE_CURRENTPRECISION_FUNC(a) a##_flt +#elif defined(HYPRE_LONG_DOUBLE) +#define HYPRE_CURRENTPRECISION_FUNC(a) a##long_dbl +#else +#define HYPRE_CURRENTPRECISION_FUNC(a) a##_dbl +#endif +#endif + +#endif + +/* need to define this when not mixed precision */ +#ifndef HYPRE_MIXED_PRECISION +#define hypre_DEFINE_GLOBAL 1 +#endif + +/*===== END 2 - IGNORE CODE IN DOCS =====*/ /*! \endcond */ + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ /** - * (Optional) Returns true if the hypre library has been finalized but not re-initialized yet. + * @name Error Codes + * + * @{ **/ -HYPRE_Int HYPRE_Finalized(void); +#define HYPRE_ERROR_GENERIC 1 /* generic error */ +#define HYPRE_ERROR_MEMORY 2 /* unable to allocate memory */ +#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 error user functions *--------------------------------------------------------------------------*/ -/* Return an aggregate error code representing the collective status of all ranks */ +/** 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 */ +/** Return the current hypre error flag **/ HYPRE_Int HYPRE_GetError(void); -/* Check if the given error flag contains the given error code */ +/** 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 */ +/** + * Return the index of the argument (counting from 1) where argument error + * (HYPRE_ERROR_ARG) has occured + **/ HYPRE_Int HYPRE_GetErrorArg(void); -/* Describe the given error flag in the given string */ +/** Describe the given error flag in the given string **/ void HYPRE_DescribeError(HYPRE_Int hypre_ierr, char *descr); -/* Clears the hypre error flag */ +/** Clear the hypre error flag **/ HYPRE_Int HYPRE_ClearAllErrors(void); -/* Clears the given error code from the hypre error flag */ +/** Clear 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 */ +/** 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 */ +/** + * 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 */ +/** 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 */ +/** 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 */ +/** Clear the error messages in hypre and free any related memory allocated **/ HYPRE_Int HYPRE_ClearErrorMessages(void); -/* Print GPU information */ +/**@}*/ + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +/** + * @name Initialize and 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); + +/**@}*/ + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +/** + * @name Miscellaneous Information + * + * @{ + **/ + +/** Print GPU information **/ HYPRE_Int HYPRE_PrintDeviceInfo(void); /** @@ -271,15 +409,21 @@ HYPRE_Int HYPRE_PrintDeviceInfo(void); * 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 *--------------------------------------------------------------------------*/ +/** + * @name Library Version Information + * + * @{ + **/ + /* RDF: This macro is used by the FEI code. Want to eventually remove. */ #define HYPRE_VERSION "HYPRE_RELEASE_NAME Date Compiled: " __DATE__ " " __TIME__ @@ -300,19 +444,18 @@ HYPRE_VersionNumber( HYPRE_Int *major_ptr, HYPRE_Int *patch_ptr, HYPRE_Int *single_ptr ); -/*-------------------------------------------------------------------------- - * HYPRE AP user functions - *--------------------------------------------------------------------------*/ - -/* 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 *--------------------------------------------------------------------------*/ +/** + * @name Memory Management + * + * @{ + **/ + +/** Memory location **/ typedef enum _HYPRE_MemoryLocation { HYPRE_MEMORY_UNDEFINED = -1, @@ -323,21 +466,27 @@ typedef enum _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 +/**@}*/ + /*-------------------------------------------------------------------------- - * HYPRE execution policy *--------------------------------------------------------------------------*/ +/** + * @name Execution Policy + * + * @{ + **/ + +/** Execution Policy **/ typedef enum _HYPRE_ExecutionPolicy { HYPRE_EXEC_UNDEFINED = -1, @@ -348,25 +497,29 @@ typedef enum _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); /** * (Optional) Returns a string denoting the execution policy passed as input. **/ - const char* HYPRE_GetExecutionPolicyName(HYPRE_ExecutionPolicy exec_policy); +/**@}*/ + /*-------------------------------------------------------------------------- - * HYPRE UMPIRE *--------------------------------------------------------------------------*/ +/** + * @name Umpire and GPU Memory Pooling + * + * @{ + **/ + /** * @brief Sets the size of the Umpire device memory pool. * @@ -439,17 +592,21 @@ HYPRE_Int HYPRE_SetUmpireHostPoolName(const char *pool_name); **/ HYPRE_Int HYPRE_SetUmpirePinnedPoolName(const char *pool_name); -/*-------------------------------------------------------------------------- - * HYPRE GPU memory pool - *--------------------------------------------------------------------------*/ - +/** Set GPU memory pool size **/ HYPRE_Int HYPRE_SetGPUMemoryPoolSize(HYPRE_Int bin_growth, HYPRE_Int min_bin, HYPRE_Int max_bin, size_t max_cached_bytes); +/**@}*/ + /*-------------------------------------------------------------------------- - * HYPRE handle *--------------------------------------------------------------------------*/ +/** + * @name Miscellaneous + * + * @{ + **/ + /** * Sets the logging level for the HYPRE library. * @@ -520,6 +677,7 @@ HYPRE_Int HYPRE_SetSpMVUseVendor(HYPRE_Int use_vendor); * @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) @@ -538,7 +696,6 @@ HYPRE_Int HYPRE_SetSpGemmUseVendor( HYPRE_Int use_vendor ); * * @return Returns hypre's global error code, where 0 indicates success. **/ - HYPRE_Int HYPRE_SetUseGpuRand( HYPRE_Int use_curand ); /** @@ -557,6 +714,11 @@ HYPRE_Int HYPRE_SetUseGpuRand( HYPRE_Int use_curand ); **/ HYPRE_Int HYPRE_SetGpuAwareMPI( HYPRE_Int use_gpu_aware_mpi ); +/**@}*/ +/**@}*/ + +/*===== BEGIN 3 - IGNORE CODE IN DOCS =====*/ /*! \cond */ + /*-------------------------------------------------------------------------- * Base objects *--------------------------------------------------------------------------*/ @@ -590,8 +752,21 @@ typedef HYPRE_Int (*HYPRE_PtrToSolverFcn)(HYPRE_Solver, HYPRE_Vector); typedef HYPRE_Int (*HYPRE_PtrToDestroyFcn)(HYPRE_Solver); +/*===== END 3 - IGNORE CODE IN DOCS =====*/ /*! \endcond */ + #ifdef __cplusplus } #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_utilities_mup_undef.h" +#include "HYPRE_utilities_mup.h" +#endif +#endif + #endif diff --git a/src/utilities/HYPRE_utilities_mup.h b/src/utilities/HYPRE_utilities_mup.h new file mode 100644 index 0000000000..8221a57122 --- /dev/null +++ b/src/utilities/HYPRE_utilities_mup.h @@ -0,0 +1,461 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#ifndef HYPRE_UTILITIES_MUP_HEADER +#define HYPRE_UTILITIES_MUP_HEADER + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (HYPRE_MIXED_PRECISION) + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_AssumedPartitionCheck_flt( void ); +HYPRE_Int +HYPRE_AssumedPartitionCheck_dbl( void ); +HYPRE_Int +HYPRE_AssumedPartitionCheck_long_dbl( void ); +HYPRE_Int +HYPRE_AssumedPartitionCheck( void ); + +HYPRE_Int +HYPRE_CheckError_flt( HYPRE_Int hypre_ierr, HYPRE_Int hypre_error_code ); +HYPRE_Int +HYPRE_CheckError_dbl( HYPRE_Int hypre_ierr, HYPRE_Int hypre_error_code ); +HYPRE_Int +HYPRE_CheckError_long_dbl( HYPRE_Int hypre_ierr, HYPRE_Int hypre_error_code ); +HYPRE_Int +HYPRE_CheckError( HYPRE_Int hypre_ierr, HYPRE_Int hypre_error_code ); + +HYPRE_Int +HYPRE_ClearAllErrors_flt( void ); +HYPRE_Int +HYPRE_ClearAllErrors_dbl( void ); +HYPRE_Int +HYPRE_ClearAllErrors_long_dbl( void ); +HYPRE_Int +HYPRE_ClearAllErrors( void ); + +HYPRE_Int +HYPRE_ClearError_flt( HYPRE_Int hypre_error_code ); +HYPRE_Int +HYPRE_ClearError_dbl( HYPRE_Int hypre_error_code ); +HYPRE_Int +HYPRE_ClearError_long_dbl( HYPRE_Int hypre_error_code ); +HYPRE_Int +HYPRE_ClearError( HYPRE_Int hypre_error_code ); + +HYPRE_Int +HYPRE_ClearErrorMessages_flt( void ); +HYPRE_Int +HYPRE_ClearErrorMessages_dbl( void ); +HYPRE_Int +HYPRE_ClearErrorMessages_long_dbl( void ); +HYPRE_Int +HYPRE_ClearErrorMessages( void ); + +void +HYPRE_DescribeError_flt( HYPRE_Int hypre_ierr, char *descr ); +void +HYPRE_DescribeError_dbl( HYPRE_Int hypre_ierr, char *descr ); +void +HYPRE_DescribeError_long_dbl( HYPRE_Int hypre_ierr, char *descr ); +void +HYPRE_DescribeError( HYPRE_Int hypre_ierr, char *descr ); + +HYPRE_Int +HYPRE_DeviceInitialize_flt( void ); +HYPRE_Int +HYPRE_DeviceInitialize_dbl( void ); +HYPRE_Int +HYPRE_DeviceInitialize_long_dbl( void ); +HYPRE_Int +HYPRE_DeviceInitialize( void ); + +HYPRE_Int +HYPRE_Finalize_flt( void ); +HYPRE_Int +HYPRE_Finalize_dbl( void ); +HYPRE_Int +HYPRE_Finalize_long_dbl( void ); +HYPRE_Int +HYPRE_Finalize( void ); + +HYPRE_Int +HYPRE_Finalized_flt( void ); +HYPRE_Int +HYPRE_Finalized_dbl( void ); +HYPRE_Int +HYPRE_Finalized_long_dbl( void ); +HYPRE_Int +HYPRE_Finalized( void ); + +HYPRE_Int +HYPRE_GetError_flt( void ); +HYPRE_Int +HYPRE_GetError_dbl( void ); +HYPRE_Int +HYPRE_GetError_long_dbl( void ); +HYPRE_Int +HYPRE_GetError( void ); + +HYPRE_Int +HYPRE_GetErrorArg_flt( void ); +HYPRE_Int +HYPRE_GetErrorArg_dbl( void ); +HYPRE_Int +HYPRE_GetErrorArg_long_dbl( void ); +HYPRE_Int +HYPRE_GetErrorArg( void ); + +HYPRE_Int +HYPRE_GetErrorMessages_flt( char **buffer, HYPRE_Int *bufsz ); +HYPRE_Int +HYPRE_GetErrorMessages_dbl( char **buffer, HYPRE_Int *bufsz ); +HYPRE_Int +HYPRE_GetErrorMessages_long_dbl( char **buffer, HYPRE_Int *bufsz ); +HYPRE_Int +HYPRE_GetErrorMessages( char **buffer, HYPRE_Int *bufsz ); + +HYPRE_Int +HYPRE_GetExecutionPolicy_flt( HYPRE_ExecutionPolicy *exec_policy ); +HYPRE_Int +HYPRE_GetExecutionPolicy_dbl( HYPRE_ExecutionPolicy *exec_policy ); +HYPRE_Int +HYPRE_GetExecutionPolicy_long_dbl( HYPRE_ExecutionPolicy *exec_policy ); +HYPRE_Int +HYPRE_GetExecutionPolicy( HYPRE_ExecutionPolicy *exec_policy ); + +const char* +HYPRE_GetExecutionPolicyName_flt( HYPRE_ExecutionPolicy exec_policy ); +const char* +HYPRE_GetExecutionPolicyName_dbl( HYPRE_ExecutionPolicy exec_policy ); +const char* +HYPRE_GetExecutionPolicyName_long_dbl( HYPRE_ExecutionPolicy exec_policy ); +const char* +HYPRE_GetExecutionPolicyName( HYPRE_ExecutionPolicy exec_policy ); + +HYPRE_Int +HYPRE_GetGlobalError_flt( MPI_Comm comm ); +HYPRE_Int +HYPRE_GetGlobalError_dbl( MPI_Comm comm ); +HYPRE_Int +HYPRE_GetGlobalError_long_dbl( MPI_Comm comm ); +HYPRE_Int +HYPRE_GetGlobalError( MPI_Comm comm ); + +HYPRE_Int +HYPRE_GetMemoryLocation_flt( HYPRE_MemoryLocation *memory_location ); +HYPRE_Int +HYPRE_GetMemoryLocation_dbl( HYPRE_MemoryLocation *memory_location ); +HYPRE_Int +HYPRE_GetMemoryLocation_long_dbl( HYPRE_MemoryLocation *memory_location ); +HYPRE_Int +HYPRE_GetMemoryLocation( HYPRE_MemoryLocation *memory_location ); + +HYPRE_Int +HYPRE_Initialize_flt( void ); +HYPRE_Int +HYPRE_Initialize_dbl( void ); +HYPRE_Int +HYPRE_Initialize_long_dbl( void ); +HYPRE_Int +HYPRE_Initialize( void ); + +HYPRE_Int +HYPRE_Initialized_flt( void ); +HYPRE_Int +HYPRE_Initialized_dbl( void ); +HYPRE_Int +HYPRE_Initialized_long_dbl( void ); +HYPRE_Int +HYPRE_Initialized( void ); + +HYPRE_Int +HYPRE_MemoryPrintUsage_flt( MPI_Comm comm, HYPRE_Int level, const char *function, HYPRE_Int line ); +HYPRE_Int +HYPRE_MemoryPrintUsage_dbl( MPI_Comm comm, HYPRE_Int level, const char *function, HYPRE_Int line ); +HYPRE_Int +HYPRE_MemoryPrintUsage_long_dbl( MPI_Comm comm, HYPRE_Int level, const char *function, HYPRE_Int line ); +HYPRE_Int +HYPRE_MemoryPrintUsage( MPI_Comm comm, HYPRE_Int level, const char *function, HYPRE_Int line ); + +HYPRE_Int +HYPRE_PrintDeviceInfo_flt( void ); +HYPRE_Int +HYPRE_PrintDeviceInfo_dbl( void ); +HYPRE_Int +HYPRE_PrintDeviceInfo_long_dbl( void ); +HYPRE_Int +HYPRE_PrintDeviceInfo( void ); + +HYPRE_Int +HYPRE_PrintErrorMessages_flt( MPI_Comm comm ); +HYPRE_Int +HYPRE_PrintErrorMessages_dbl( MPI_Comm comm ); +HYPRE_Int +HYPRE_PrintErrorMessages_long_dbl( MPI_Comm comm ); +HYPRE_Int +HYPRE_PrintErrorMessages( MPI_Comm comm ); + +HYPRE_Int +HYPRE_SetExecutionPolicy_flt( HYPRE_ExecutionPolicy exec_policy ); +HYPRE_Int +HYPRE_SetExecutionPolicy_dbl( HYPRE_ExecutionPolicy exec_policy ); +HYPRE_Int +HYPRE_SetExecutionPolicy_long_dbl( HYPRE_ExecutionPolicy exec_policy ); +HYPRE_Int +HYPRE_SetExecutionPolicy( HYPRE_ExecutionPolicy exec_policy ); + +HYPRE_Int +HYPRE_SetGPUMemoryPoolSize_flt( HYPRE_Int bin_growth, HYPRE_Int min_bin, HYPRE_Int max_bin, size_t max_cached_bytes ); +HYPRE_Int +HYPRE_SetGPUMemoryPoolSize_dbl( HYPRE_Int bin_growth, HYPRE_Int min_bin, HYPRE_Int max_bin, size_t max_cached_bytes ); +HYPRE_Int +HYPRE_SetGPUMemoryPoolSize_long_dbl( 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_Int +HYPRE_SetGpuAwareMPI_flt( HYPRE_Int use_gpu_aware_mpi ); +HYPRE_Int +HYPRE_SetGpuAwareMPI_dbl( HYPRE_Int use_gpu_aware_mpi ); +HYPRE_Int +HYPRE_SetGpuAwareMPI_long_dbl( HYPRE_Int use_gpu_aware_mpi ); +HYPRE_Int +HYPRE_SetGpuAwareMPI( HYPRE_Int use_gpu_aware_mpi ); + +HYPRE_Int +HYPRE_SetLogLevel_flt( HYPRE_Int log_level ); +HYPRE_Int +HYPRE_SetLogLevel_dbl( HYPRE_Int log_level ); +HYPRE_Int +HYPRE_SetLogLevel_long_dbl( HYPRE_Int log_level ); +HYPRE_Int +HYPRE_SetLogLevel( HYPRE_Int log_level ); + +HYPRE_Int +HYPRE_SetMemoryLocation_flt( HYPRE_MemoryLocation memory_location ); +HYPRE_Int +HYPRE_SetMemoryLocation_dbl( HYPRE_MemoryLocation memory_location ); +HYPRE_Int +HYPRE_SetMemoryLocation_long_dbl( HYPRE_MemoryLocation memory_location ); +HYPRE_Int +HYPRE_SetMemoryLocation( HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +HYPRE_SetPrintErrorMode_flt( HYPRE_Int mode ); +HYPRE_Int +HYPRE_SetPrintErrorMode_dbl( HYPRE_Int mode ); +HYPRE_Int +HYPRE_SetPrintErrorMode_long_dbl( HYPRE_Int mode ); +HYPRE_Int +HYPRE_SetPrintErrorMode( HYPRE_Int mode ); + +HYPRE_Int +HYPRE_SetPrintErrorVerbosity_flt( HYPRE_Int code, HYPRE_Int verbosity ); +HYPRE_Int +HYPRE_SetPrintErrorVerbosity_dbl( HYPRE_Int code, HYPRE_Int verbosity ); +HYPRE_Int +HYPRE_SetPrintErrorVerbosity_long_dbl( HYPRE_Int code, HYPRE_Int verbosity ); +HYPRE_Int +HYPRE_SetPrintErrorVerbosity( HYPRE_Int code, HYPRE_Int verbosity ); + +HYPRE_Int +HYPRE_SetSpGemmUseVendor_flt( HYPRE_Int use_vendor ); +HYPRE_Int +HYPRE_SetSpGemmUseVendor_dbl( HYPRE_Int use_vendor ); +HYPRE_Int +HYPRE_SetSpGemmUseVendor_long_dbl( HYPRE_Int use_vendor ); +HYPRE_Int +HYPRE_SetSpGemmUseVendor( HYPRE_Int use_vendor ); + +HYPRE_Int +HYPRE_SetSpMVUseVendor_flt( HYPRE_Int use_vendor ); +HYPRE_Int +HYPRE_SetSpMVUseVendor_dbl( HYPRE_Int use_vendor ); +HYPRE_Int +HYPRE_SetSpMVUseVendor_long_dbl( HYPRE_Int use_vendor ); +HYPRE_Int +HYPRE_SetSpMVUseVendor( HYPRE_Int use_vendor ); + +HYPRE_Int +HYPRE_SetSpTransUseVendor_flt( HYPRE_Int use_vendor ); +HYPRE_Int +HYPRE_SetSpTransUseVendor_dbl( HYPRE_Int use_vendor ); +HYPRE_Int +HYPRE_SetSpTransUseVendor_long_dbl( HYPRE_Int use_vendor ); +HYPRE_Int +HYPRE_SetSpTransUseVendor( HYPRE_Int use_vendor ); + +HYPRE_Int +HYPRE_SetUseGpuRand_flt( HYPRE_Int use_curand ); +HYPRE_Int +HYPRE_SetUseGpuRand_dbl( HYPRE_Int use_curand ); +HYPRE_Int +HYPRE_SetUseGpuRand_long_dbl( HYPRE_Int use_curand ); +HYPRE_Int +HYPRE_SetUseGpuRand( HYPRE_Int use_curand ); + +HYPRE_Int +HYPRE_Version_flt( char **version_ptr ); +HYPRE_Int +HYPRE_Version_dbl( char **version_ptr ); +HYPRE_Int +HYPRE_Version_long_dbl( char **version_ptr ); +HYPRE_Int +HYPRE_Version( char **version_ptr ); + +HYPRE_Int +HYPRE_VersionNumber_flt( HYPRE_Int *major_ptr, HYPRE_Int *minor_ptr, HYPRE_Int *patch_ptr, HYPRE_Int *single_ptr ); +HYPRE_Int +HYPRE_VersionNumber_dbl( HYPRE_Int *major_ptr, HYPRE_Int *minor_ptr, HYPRE_Int *patch_ptr, HYPRE_Int *single_ptr ); +HYPRE_Int +HYPRE_VersionNumber_long_dbl( HYPRE_Int *major_ptr, HYPRE_Int *minor_ptr, HYPRE_Int *patch_ptr, HYPRE_Int *single_ptr ); +HYPRE_Int +HYPRE_VersionNumber( HYPRE_Int *major_ptr, HYPRE_Int *minor_ptr, HYPRE_Int *patch_ptr, HYPRE_Int *single_ptr ); + + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_AssumedPartitionCheck_pre( HYPRE_Precision precision ); + +HYPRE_Int +HYPRE_CheckError_pre( HYPRE_Precision precision, HYPRE_Int hypre_ierr, HYPRE_Int hypre_error_code ); + +HYPRE_Int +HYPRE_ClearAllErrors_pre( HYPRE_Precision precision ); + +HYPRE_Int +HYPRE_ClearError_pre( HYPRE_Precision precision, HYPRE_Int hypre_error_code ); + +HYPRE_Int +HYPRE_ClearErrorMessages_pre( HYPRE_Precision precision ); + +void +HYPRE_DescribeError_pre( HYPRE_Precision precision, HYPRE_Int hypre_ierr, char *descr ); + +HYPRE_Int +HYPRE_DeviceInitialize_pre( HYPRE_Precision precision ); + +HYPRE_Int +HYPRE_Finalize_pre( HYPRE_Precision precision ); + +HYPRE_Int +HYPRE_Finalized_pre( HYPRE_Precision precision ); + +HYPRE_Int +HYPRE_GetError_pre( HYPRE_Precision precision ); + +HYPRE_Int +HYPRE_GetErrorArg_pre( HYPRE_Precision precision ); + +HYPRE_Int +HYPRE_GetErrorMessages_pre( HYPRE_Precision precision, char **buffer, HYPRE_Int *bufsz ); + +HYPRE_Int +HYPRE_GetExecutionPolicy_pre( HYPRE_Precision precision, HYPRE_ExecutionPolicy *exec_policy ); + +const char* +HYPRE_GetExecutionPolicyName_pre( HYPRE_Precision precision, HYPRE_ExecutionPolicy exec_policy ); + +HYPRE_Int +HYPRE_GetGlobalError_pre( HYPRE_Precision precision, MPI_Comm comm ); + +HYPRE_Int +HYPRE_GetMemoryLocation_pre( HYPRE_Precision precision, HYPRE_MemoryLocation *memory_location ); + +HYPRE_Int +HYPRE_Initialize_pre( HYPRE_Precision precision ); + +HYPRE_Int +HYPRE_Initialized_pre( HYPRE_Precision precision ); + +HYPRE_Int +HYPRE_MemoryPrintUsage_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_Int level, const char *function, HYPRE_Int line ); + +HYPRE_Int +HYPRE_PrintDeviceInfo_pre( HYPRE_Precision precision ); + +HYPRE_Int +HYPRE_PrintErrorMessages_pre( HYPRE_Precision precision, MPI_Comm comm ); + +HYPRE_Int +HYPRE_SetExecutionPolicy_pre( HYPRE_Precision precision, HYPRE_ExecutionPolicy exec_policy ); + +HYPRE_Int +HYPRE_SetGPUMemoryPoolSize_pre( HYPRE_Precision precision, HYPRE_Int bin_growth, HYPRE_Int min_bin, HYPRE_Int max_bin, size_t max_cached_bytes ); + +HYPRE_Int +HYPRE_SetGpuAwareMPI_pre( HYPRE_Precision precision, HYPRE_Int use_gpu_aware_mpi ); + +HYPRE_Int +HYPRE_SetLogLevel_pre( HYPRE_Precision precision, HYPRE_Int log_level ); + +HYPRE_Int +HYPRE_SetMemoryLocation_pre( HYPRE_Precision precision, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +HYPRE_SetPrintErrorMode_pre( HYPRE_Precision precision, HYPRE_Int mode ); + +HYPRE_Int +HYPRE_SetPrintErrorVerbosity_pre( HYPRE_Precision precision, HYPRE_Int code, HYPRE_Int verbosity ); + +HYPRE_Int +HYPRE_SetSpGemmUseVendor_pre( HYPRE_Precision precision, HYPRE_Int use_vendor ); + +HYPRE_Int +HYPRE_SetSpMVUseVendor_pre( HYPRE_Precision precision, HYPRE_Int use_vendor ); + +HYPRE_Int +HYPRE_SetSpTransUseVendor_pre( HYPRE_Precision precision, HYPRE_Int use_vendor ); + +HYPRE_Int +HYPRE_SetUseGpuRand_pre( HYPRE_Precision precision, HYPRE_Int use_curand ); + +HYPRE_Int +HYPRE_Version_pre( HYPRE_Precision precision, char **version_ptr ); + +HYPRE_Int +HYPRE_VersionNumber_pre( HYPRE_Precision precision, HYPRE_Int *major_ptr, HYPRE_Int *minor_ptr, HYPRE_Int *patch_ptr, HYPRE_Int *single_ptr ); + + +#endif + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/src/utilities/Makefile b/src/utilities/Makefile index 8a4f60b12b..7844d7d979 100644 --- a/src/utilities/Makefile +++ b/src/utilities/Makefile @@ -21,12 +21,13 @@ CXX_COMPILE_FLAGS = ${C_COMPILE_FLAGS} HEADERS =\ amg_linklist.h\ exchange_data.h\ - fortran.h\ - fortran_matrix.h\ + _hypre_fortran.h\ + _hypre_fortran_matrix.h\ general.h\ int_array.h\ memory.h\ memory_tracker.h\ + multiprecision.h\ HYPRE_utilities.h\ mpistubs.h\ threading.h\ @@ -56,10 +57,9 @@ FILES =\ memory_tracker.c\ merge_sort.c\ mmio.c\ - mpi_comm_f2c.c\ prefix_sum.c\ - printf.c\ qsort.c\ + unique.c\ utilities.c\ mpistubs.c\ qsplit.c\ @@ -67,22 +67,50 @@ FILES =\ state.c\ threading.c\ timer.c\ - timing.c + timing.c\ + caliper_instrumentation.c CUFILES=\ + device_markers.c\ device_utils.c\ general.c\ handle.c\ int_array_device.c\ memory.c\ omp_device.c\ - nvtx.c\ stl_ops.c +# Mixed precision files +MP_FILES = \ + mup_fixed.c\ + mup_functions.c\ + mup_pre.c + +ifeq (${MP_BUILD}, 1) +MP_FILES += printf.c multiprecision.c +else +FILES += printf.c multiprecision.c +endif + COBJS = ${FILES:.c=.o} CUOBJS = ${CUFILES:.c=.obj} OBJS = ${COBJS} ${CUOBJS} +ifeq (${MP_BUILD}, 1) + +COBJS_single = ${FILES:.c=.o_flt} +COBJS_double = ${FILES:.c=.o_dbl} +COBJS_longdouble = ${FILES:.c=.o_ldbl} +CUOBJS_single = ${CUFILES:.c=.obj_flt} +CUOBJS_double = ${CUFILES:.c=.obj_dbl} +CUOBJS_longdouble = ${CUFILES:.c=.obj_ldbl} +MP_COBJS = ${MP_FILES:.c=.o} + +OBJS = ${COBJS_single} ${COBJS_double} ${COBJS_longdouble} ${MP_COBJS} +OBJS += ${CUOBJS_single} ${CUOBJS_double} ${CUOBJS_longdouble} + +endif + SONAME = libHYPRE_utilities-${HYPRE_RELEASE_VERSION}${HYPRE_LIB_SUFFIX} ################################################################## @@ -91,20 +119,22 @@ SONAME = libHYPRE_utilities-${HYPRE_RELEASE_VERSION}${HYPRE_LIB_SUFFIX} all: libHYPRE_utilities${HYPRE_LIB_SUFFIX} cp -fR $(srcdir)/HYPRE_*.h $(HYPRE_BUILD_DIR)/include - cp -fR $(srcdir)/_hypre_onedpl.hpp $(HYPRE_BUILD_DIR)/include - cp -fR $(srcdir)/_hypre_utilities.h $(HYPRE_BUILD_DIR)/include + cp -fR $(srcdir)/_hypre_*.h $(HYPRE_BUILD_DIR)/include cp -fR $(srcdir)/_hypre_utilities.hpp $(HYPRE_BUILD_DIR)/include - cp -fR $(srcdir)/fortran*.h $(HYPRE_BUILD_DIR)/include + cp -fR $(srcdir)/_hypre_onedpl.hpp $(HYPRE_BUILD_DIR)/include # cp -fR libHYPRE* $(HYPRE_BUILD_DIR)/lib install: libHYPRE_utilities${HYPRE_LIB_SUFFIX} cp -fR $(srcdir)/HYPRE_*.h $(HYPRE_INC_INSTALL) + cp -fR $(srcdir)/_hypre_*.h $(HYPRE_INC_INSTALL) cp -fR $(srcdir)/_hypre_utilities.h $(HYPRE_INC_INSTALL) - cp -fR $(srcdir)/fortran*.h $(HYPRE_INC_INSTALL) + cp -fR $(srcdir)/_hypre_fortran*.h $(HYPRE_INC_INSTALL) # cp -fR libHYPRE* $(HYPRE_LIB_INSTALL) clean: rm -f *.o *.obj libHYPRE* + rm -f *.o_flt *.o_dbl *.o_ldbl + rm -f *.obj_flt *.obj_dbl *.obj_ldbl rm -rf pchdir tca.map *inslog* distclean: clean diff --git a/src/utilities/fortran.h b/src/utilities/_hypre_fortran.h similarity index 98% rename from src/utilities/fortran.h rename to src/utilities/_hypre_fortran.h index 7646eedc9b..5a458bc058 100644 --- a/src/utilities/fortran.h +++ b/src/utilities/_hypre_fortran.h @@ -132,6 +132,7 @@ 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_Real* hypre_F90_RealArray2D; typedef HYPRE_Complex hypre_F90_Complex; typedef HYPRE_Complex hypre_F90_ComplexArray; typedef HYPRE_Int *hypre_F90_Obj; @@ -149,6 +150,7 @@ typedef HYPRE_Int *hypre_F90_ObjRef; #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_PassRealArray2D(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) diff --git a/src/utilities/fortran_matrix.h b/src/utilities/_hypre_fortran_matrix.h similarity index 97% rename from src/utilities/fortran_matrix.h rename to src/utilities/_hypre_fortran_matrix.h index aedd800b8e..7bca637ff6 100644 --- a/src/utilities/fortran_matrix.h +++ b/src/utilities/_hypre_fortran_matrix.h @@ -29,7 +29,7 @@ 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_FortranMatrixWrap( HYPRE_Real* v, HYPRE_BigInt gh, HYPRE_BigInt h, HYPRE_BigInt w, utilities_FortranMatrix* mtx ); void utilities_FortranMatrixDestroy( utilities_FortranMatrix* mtx ); diff --git a/src/utilities/_hypre_mup_def.h b/src/utilities/_hypre_mup_def.h new file mode 100644 index 0000000000..3de93317f6 --- /dev/null +++ b/src/utilities/_hypre_mup_def.h @@ -0,0 +1,135 @@ +/****************************************************************************** + * 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) + ******************************************************************************/ + +/****************************************************************************** + * + * Header file for multiprecision utilities + * + * NOTE: This header is needed in both user and internal header contexts, even + * though most of the definitions are not intended for users. Because of this, + * a mix of capital and lower-case hypre prefixes are used. + *****************************************************************************/ + +#ifndef MULTIPRECISION_UTILITIES_HEADER +#define MULTIPRECISION_UTILITIES_HEADER + +#define hypre_CONCAT2_(a, b) a ## _ ## b +#define hypre_CONCAT_(a, b) hypre_CONCAT2_(a, b) + +/* multiprecision build types - RDF: These don't buy us much since they are only + * used below. We should consider removing them for simplicity. That will also + * eliminate the need for the CONCAT functions above. */ +#define hypre_FLT_SUFFIX flt +#define hypre_DBL_SUFFIX dbl +#define hypre_LDBL_SUFFIX long_dbl + +/*-------------------------------------------------------------------------- + * For mixed-precision build only + *---------------------------------------------------------------------------*/ + +#if defined(HYPRE_MIXED_PRECISION) + +/* Set build options */ +#if defined(MP_BUILD_SINGLE) + +#define hypre_MP_BUILD 1 +#define HYPRE_MULTIPRECISION_FUNC(a) hypre_CONCAT_(a, hypre_FLT_SUFFIX) +#define HYPRE_FIXEDPRECISION_FUNC(a) hypre_CONCAT_(a, hypre_FLT_SUFFIX) +#undef HYPRE_LONG_DOUBLE +#ifndef HYPRE_SINGLE +#define HYPRE_SINGLE 1 +#endif + +#elif defined(MP_BUILD_DOUBLE) + +#define hypre_MP_BUILD 1 +#define HYPRE_MULTIPRECISION_FUNC(a) hypre_CONCAT_(a, hypre_DBL_SUFFIX) +#define HYPRE_FIXEDPRECISION_FUNC(a) hypre_CONCAT_(a, hypre_DBL_SUFFIX) +#undef HYPRE_SINGLE +#undef HYPRE_LONG_DOUBLE +#define hypre_DEFINE_GLOBAL_MP 1 /* Define globals only once during this build */ + +#elif defined(MP_BUILD_LONGDOUBLE) + +#define hypre_MP_BUILD 1 +#define HYPRE_MULTIPRECISION_FUNC(a) hypre_CONCAT_(a, hypre_LDBL_SUFFIX) +#define HYPRE_FIXEDPRECISION_FUNC(a) hypre_CONCAT_(a, hypre_LDBL_SUFFIX) +#undef HYPRE_SINGLE +#ifndef HYPRE_LONG_DOUBLE +#define HYPRE_LONG_DOUBLE 1 +#endif + +#else + +#define HYPRE_MULTIPRECISION_FUNC(a) hypre_CONCAT_(a, ignore) /* Avoid prototype conflicts */ +#define HYPRE_FIXEDPRECISION_FUNC(a) a + +#endif + +#endif + +#if 0 +/* Helper macros to generate multiprecision function declarations */ +#define DECLARE_MP_FUNC(rtype,func,fargs...)\ + rtype CONCAT_(func,FLT_SUFFIX) (fargs);\ + rtype CONCAT_(func,DBL_SUFFIX) (fargs);\ + rtype CONCAT_(func,LDBL_SUFFIX) (fargs); + +#define DECLARE_DP_FUNC(rtype,func,fargs...)\ + rtype CONCAT_(func,DBL_SUFFIX) (fargs); + +#define HYPRE_DP_FUNC(a) CONCAT_(a, DBL_SUFFIX) + +#define DECLARE_SP_FUNC(rtype,func,fargs...)\ + rtype CONCAT_(func,FLT_SUFFIX) (fargs); + +#define HYPRE_SP_FUNC(a) CONCAT_(a, FLT_SUFFIX) + +/* code for scalar or void return type */ +#define MP_METHOD_FUNC(precision,func,args...)\ + switch(precision) {\ + case HYPRE_REAL_SINGLE: \ + return CONCAT_(func,FLT_SUFFIX) (args);\ + case HYPRE_REAL_DOUBLE: \ + return CONCAT_(func,DBL_SUFFIX) (args);\ + case HYPRE_REAL_LONGDOUBLE: \ + return CONCAT_(func,LDBL_SUFFIX) (args);\ + default:\ + hypre_printf("Unknown solver precision" );\ + exit(0);\ + } + +/* code for pointer return type */ +#define MP_METHOD_FUNCPTR(rval,precision,func,args...)\ + switch(precision) {\ + case HYPRE_REAL_SINGLE: \ + rval = CONCAT_(func,FLT_SUFFIX) (args);\ + case HYPRE_REAL_DOUBLE: \ + rval = CONCAT_(func,DBL_SUFFIX) (args);\ + case HYPRE_REAL_LONGDOUBLE: \ + rval = CONCAT_(func,LDBL_SUFFIX) (args);\ + default:\ + hypre_printf("Unknown solver precision" );\ + exit(0);\ + } + +/* code for pointer return type */ +#define MP_METHOD_FUNCPTR_NP(rval,func,args...)\ + switch(precision) {\ + case HYPRE_REAL_SINGLE: \ + rval = CONCAT_(func,FLT_SUFFIX) (args);\ + case HYPRE_REAL_DOUBLE: \ + rval = CONCAT_(func,DBL_SUFFIX) (args);\ + case HYPRE_REAL_LONGDOUBLE: \ + rval = CONCAT_(func,LDBL_SUFFIX) (args);\ + default:\ + hypre_printf("Unknown solver precision" );\ + exit(0);\ + } +#endif + +#endif diff --git a/src/utilities/_hypre_utilities.h b/src/utilities/_hypre_utilities.h index fc315117f5..66cb71c19e 100644 --- a/src/utilities/_hypre_utilities.h +++ b/src/utilities/_hypre_utilities.h @@ -10,6 +10,10 @@ #include #endif +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_utilities_mup_def.h" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -50,6 +54,7 @@ typedef void (*GPUMfreeFunc)(void *); typedef struct { HYPRE_Int log_level; + HYPRE_Int log_level_saved; HYPRE_Int hypre_error; HYPRE_MemoryLocation memory_location; HYPRE_ExecutionPolicy default_exec_policy; @@ -98,6 +103,7 @@ typedef struct /* accessor macros to hypre_Handle */ #define hypre_HandleLogLevel(hypre_handle) ((hypre_handle) -> log_level) +#define hypre_HandleLogLevelSaved(hypre_handle) ((hypre_handle) -> log_level_saved) #define hypre_HandleMemoryLocation(hypre_handle) ((hypre_handle) -> memory_location) #define hypre_HandleDefaultExecPolicy(hypre_handle) ((hypre_handle) -> default_exec_policy) @@ -161,6 +167,7 @@ typedef struct #define hypre_HandleMagmaQueue(hypre_handle) ((hypre_handle) -> magma_queue) +extern hypre_Handle *_hypre_handle; #endif /****************************************************************************** * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other @@ -221,10 +228,6 @@ typedef unsigned long long int hypre_ulonglongint; typedef uint32_t hypre_uint32; typedef uint64_t hypre_uint64; -/* This allows us to consistently avoid 'float' and 'double' throughout hypre */ -typedef float hypre_float; -typedef double hypre_double; - /*-------------------------------------------------------------------------- * Define macros *--------------------------------------------------------------------------*/ @@ -633,7 +636,6 @@ typedef struct hypre_MatrixStatsArray_struct #include /* 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, ... ); @@ -643,14 +645,6 @@ 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 -// #define hypre_sprintf sprintf -// #define hypre_scanf scanf -// #define hypre_fscanf fscanf -// #define hypre_sscanf sscanf -// #endif #endif /****************************************************************************** @@ -703,9 +697,12 @@ 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) +#if defined(HYPRE_MIXED_PRECISION) +#define hypre_error_w_msg_mp(IERR, msg) hypre_error_handler_dbl(__FILE__, __LINE__, IERR, msg) +#endif +#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 */ @@ -987,8 +984,8 @@ typedef MPI_User_function hypre_MPI_User_function; 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_Real hypre_MPI_Wtime( void ); -HYPRE_Real hypre_MPI_Wtick( void ); +hypre_double hypre_MPI_Wtime( void ); +hypre_double 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 ); @@ -1081,6 +1078,8 @@ HYPRE_Int hypre_MPI_Comm_split_type(hypre_MPI_Comm comm, HYPRE_Int split_type, H HYPRE_Int hypre_MPI_Info_create(hypre_MPI_Info *info); HYPRE_Int hypre_MPI_Info_free( hypre_MPI_Info *info ); #endif +HYPRE_Int hypre_MPI_CheckCommMatrix( hypre_MPI_Comm comm, HYPRE_Int num_recvs, HYPRE_Int *recvs, + HYPRE_Int num_sends, HYPRE_Int *sends ); #ifdef __cplusplus } @@ -1233,8 +1232,8 @@ hypre_GetActualMemLocation(HYPRE_MemoryLocation location) #define hypre_TAlloc(type, count, location) \ ( (type *) hypre_MAlloc((size_t)(sizeof(type) * (count)), location) ) -#define _hypre_TAlloc(type, count, location) \ -( (type *) _hypre_MAlloc((size_t)(sizeof(type) * (count)), location) ) +#define hypre__TAlloc(type, count, location) \ +( (type *) hypre__MAlloc((size_t)(sizeof(type) * (count)), location) ) #define hypre_CTAlloc(type, count, location) \ ( (type *) hypre_CAlloc((size_t)(count), (size_t)sizeof(type), location) ) @@ -1251,8 +1250,8 @@ hypre_GetActualMemLocation(HYPRE_MemoryLocation location) #define hypre_TFree(ptr, location) \ ( hypre_Free((void *)ptr, location), ptr = NULL ) -#define _hypre_TFree(ptr, location) \ -( _hypre_Free((void *)ptr, location), ptr = NULL ) +#define hypre__TFree(ptr, location) \ +( hypre__Free((void *)ptr, location), ptr = NULL ) #endif /* #if !defined(HYPRE_USING_MEMORY_TRACKER) */ @@ -1274,9 +1273,8 @@ void hypre_Memcpy(void *dst, void *src, size_t size, HYPRE_MemoryLocation loc_ 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); - -void * _hypre_MAlloc(size_t size, hypre_MemoryLocation location); -void _hypre_Free(void *ptr, hypre_MemoryLocation location); +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, @@ -1469,10 +1467,10 @@ extern hypre_MemoryTracker *_hypre_memory_tracker; } \ ) -#define _hypre_TAlloc(type, count, location) \ +#define hypre__TAlloc(type, count, location) \ ( \ { \ - void *ptr = _hypre_MAlloc((size_t)(sizeof(type) * (count)), location); \ + void *ptr = hypre__MAlloc((size_t)(sizeof(type) * (count)), location); \ \ hypre_MemoryTrackerInsert1("malloc", ptr, sizeof(type)*(count), location, \ __FILE__, __func__, __LINE__); \ @@ -1480,10 +1478,10 @@ extern hypre_MemoryTracker *_hypre_memory_tracker; } \ ) -#define _hypre_TFree(ptr, location) \ +#define hypre__TFree(ptr, location) \ ( \ { \ - _hypre_Free((void *)ptr, location); \ + hypre__Free((void *)ptr, location); \ \ hypre_MemoryTrackerInsert1("free", ptr, (size_t) -1, location, \ __FILE__, __func__, __LINE__); \ @@ -1493,7 +1491,6 @@ extern hypre_MemoryTracker *_hypre_memory_tracker; #endif /* #if defined(HYPRE_USING_MEMORY_TRACKER) */ #endif /* #ifndef hypre_MEMORY_TRACKER_HEADER */ - /****************************************************************************** * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other * HYPRE Project Developers. See the top-level COPYRIGHT file for details. @@ -1694,6 +1691,18 @@ HYPRE_Real time_get_cpu_seconds_( void ); #else +#define hypre_InitializeTiming hypre_InitializeTiming_fcn +#define hypre_FinalizeTiming hypre_FinalizeTiming_fcn +#define hypre_FinalizeAllTimings hypre_FinalizeAllTimings_fcn +#define hypre_IncFLOPCount hypre_IncFLOPCount_fcn +#define hypre_BeginTiming hypre_BeginTiming_fcn +#define hypre_EndTiming hypre_EndTiming_fcn +#define hypre_PrintTiming hypre_PrintTiming_fcn +#define hypre_ClearTiming hypre_ClearTiming_fcn +#define hypre_GetTiming hypre_GetTiming_fcn + +#endif + /*------------------------------------------------------- * Global timing structure *-------------------------------------------------------*/ @@ -1741,17 +1750,15 @@ 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_GetTiming( const char *heading, HYPRE_Real *wall_time_ptr, MPI_Comm comm ); - -#endif +HYPRE_Int hypre_InitializeTiming_fcn( const char *name ); +HYPRE_Int hypre_FinalizeTiming_fcn( HYPRE_Int time_index ); +HYPRE_Int hypre_FinalizeAllTimings_fcn( void ); +HYPRE_Int hypre_IncFLOPCount_fcn( HYPRE_BigInt inc ); +HYPRE_Int hypre_BeginTiming_fcn( HYPRE_Int time_index ); +HYPRE_Int hypre_EndTiming_fcn( HYPRE_Int time_index ); +HYPRE_Int hypre_ClearTiming_fcn( void ); +HYPRE_Int hypre_PrintTiming_fcn( const char *heading, MPI_Comm comm ); +HYPRE_Int hypre_GetTiming_fcn( const char *heading, HYPRE_Real *wall_time_ptr, MPI_Comm comm ); #ifdef __cplusplus } @@ -1844,12 +1851,25 @@ typedef struct } hypre_DataExchangeResponse; -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_CreateBinaryTree(HYPRE_Int myid, + HYPRE_Int num_procs, + hypre_BinaryTree **tree_ptr); +HYPRE_Int +hypre_DestroyBinaryTree(hypre_BinaryTree *tree); +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 */ /****************************************************************************** @@ -1941,22 +1961,17 @@ extern "C++" #ifndef HYPRE_GSELIM_H #define HYPRE_GSELIM_H -#define hypre_gselim(A,x,n,error) \ +#define hypre_gselim(A,x,n) \ { \ HYPRE_Int j,k,m; \ HYPRE_Real factor; \ HYPRE_Real divA; \ - error = 0; \ if (n == 1) /* A is 1x1 */ \ { \ if (A[0] != 0.0) \ { \ x[0] = x[0]/A[0]; \ } \ - else \ - { \ - error++; \ - } \ } \ else/* A is nxn. Forward elimination */ \ { \ @@ -2147,6 +2162,7 @@ void hypre_swap3_d_perm(HYPRE_Int *v, HYPRE_Real *w, HYPRE_Int *z, HYPRE_Int 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_qsortND( HYPRE_Int **v, HYPRE_Int ndim, HYPRE_Int left, HYPRE_Int right ); 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 ); @@ -2176,6 +2192,9 @@ void hypre_topo_sort(const HYPRE_Int *row_ptr, const HYPRE_Int *col_inds, const void hypre_dense_topo_sort(const HYPRE_Complex *L, HYPRE_Int *ordering, HYPRE_Int n, HYPRE_Int is_col_major); +/* unique.c */ +HYPRE_Int hypre_UniqueIntArrayND ( HYPRE_Int ndim, HYPRE_Int *size, HYPRE_Int **array ); + /* qsplit.c */ HYPRE_Int hypre_DoubleQuickSplit ( HYPRE_Real *values, HYPRE_Int *indices, HYPRE_Int list_length, HYPRE_Int NumberKept ); @@ -2186,44 +2205,17 @@ HYPRE_Int hypre_DoubleQuickSplit ( HYPRE_Real *values, HYPRE_Int *indices, HYPRE /* HYPRE_CUDA_GLOBAL */ HYPRE_Real hypre_Rand ( void ); /* prefix_sum.c */ -/** - * Assumed to be called within an omp region. - * Let x_i be the input of ith thread. - * The output of ith thread y_i = x_0 + x_1 + ... + x_{i-1} - * Additionally, sum = x_0 + x_1 + ... + x_{nthreads - 1} - * Note that always y_0 = 0 - * - * @param workspace at least with length (nthreads+1) - * workspace[tid] will contain result for tid - * workspace[nthreads] will contain sum - */ -void hypre_prefix_sum(HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int *workspace); -/** - * This version does prefix sum in pair. - * Useful when we prefix sum of diag and offd in tandem. - * - * @param worksapce at least with length 2*(nthreads+1) - * 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); -/** - * @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); - -/** - * n prefix-sums together. - * workspace[n*tid:n*(tid+1)) will contain results for tid - * workspace[nthreads*tid:nthreads*(tid+1)) will contain sums - * - * @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); +HYPRE_Int hypre_PrefixSumInt(HYPRE_Int nvals, HYPRE_Int *vals, HYPRE_Int *sums); +HYPRE_Int hypre_prefix_sum(HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int *workspace); +HYPRE_Int hypre_prefix_sum_pair(HYPRE_Int *in_out1, HYPRE_Int *sum1, + HYPRE_Int *in_out2, HYPRE_Int *sum2, + HYPRE_Int *workspace); +HYPRE_Int 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); +HYPRE_Int hypre_prefix_sum_multiple(HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int n, + HYPRE_Int *workspace); /* hopscotch_hash.c */ @@ -2452,6 +2444,8 @@ HYPRE_Int hypre_GetSyncCudaCompute(HYPRE_Int *cuda_compute_stream_sync_ptr); /* handle.c */ HYPRE_Int hypre_SetLogLevel( HYPRE_Int log_level ); +HYPRE_Int hypre_SetLogLevelSaved( HYPRE_Int log_level_saved ); +HYPRE_Int hypre_RestoreLogLevel( void ); HYPRE_Int hypre_SetSpTransUseVendor( HYPRE_Int use_vendor ); HYPRE_Int hypre_SetSpMVUseVendor( HYPRE_Int use_vendor ); HYPRE_Int hypre_SetSpGemmUseVendor( HYPRE_Int use_vendor ); @@ -3956,6 +3950,151 @@ HYPRE_Int hypre_mm_read_mtx_crd_size(FILE *f, HYPRE_Int *M, HYPRE_Int *N, HYPRE_ /* high level routines */ +#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 FORTRAN_STYLE_MATRIX +#define FORTRAN_STYLE_MATRIX + +#include "HYPRE_utilities.h" + +typedef struct +{ + 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_FortranMatrixCreate(void); +void +utilities_FortranMatrixAllocateData( HYPRE_BigInt h, HYPRE_BigInt w, + utilities_FortranMatrix* mtx ); +void +utilities_FortranMatrixWrap( HYPRE_Real* v, HYPRE_BigInt gh, HYPRE_BigInt h, HYPRE_BigInt w, + utilities_FortranMatrix* mtx ); +void +utilities_FortranMatrixDestroy( utilities_FortranMatrix* mtx ); + +HYPRE_BigInt +utilities_FortranMatrixGlobalHeight( utilities_FortranMatrix* mtx ); +HYPRE_BigInt +utilities_FortranMatrixHeight( utilities_FortranMatrix* mtx ); +HYPRE_BigInt +utilities_FortranMatrixWidth( utilities_FortranMatrix* mtx ); +HYPRE_Real* +utilities_FortranMatrixValues( utilities_FortranMatrix* mtx ); + +void +utilities_FortranMatrixClear( utilities_FortranMatrix* mtx ); +void +utilities_FortranMatrixClearL( utilities_FortranMatrix* mtx ); +void +utilities_FortranMatrixSetToIdentity( utilities_FortranMatrix* mtx ); + +void +utilities_FortranMatrixTransposeSquare( utilities_FortranMatrix* mtx ); +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 +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 +utilities_FortranMatrixMaxValue( utilities_FortranMatrix* mtx ); + +void +utilities_FortranMatrixSelectBlock( utilities_FortranMatrix* mtx, + HYPRE_BigInt iFrom, HYPRE_BigInt iTo, + HYPRE_BigInt jFrom, HYPRE_BigInt jTo, + utilities_FortranMatrix* block ); +void +utilities_FortranMatrixUpperInv( utilities_FortranMatrix* u ); + +HYPRE_Int +utilities_FortranMatrixPrint( utilities_FortranMatrix* mtx, const char *fileName); + +#ifdef __cplusplus +} +#endif + +#endif /* FORTRAN_STYLE_MATRIX */ + +/****************************************************************************** + * 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_MULTIPRECISION_HEADER +#define hypre_MULTIPRECISION_HEADER + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef HYPRE_MIXED_PRECISION + +/*-------------------------------------------------------------------------- + * Global variable + *--------------------------------------------------------------------------*/ + +extern HYPRE_Precision hypre__global_precision; + +/*-------------------------------------------------------------------------- + * Prototypes + *--------------------------------------------------------------------------*/ + +HYPRE_Precision +hypre_GlobalPrecision(); + #endif #ifdef __cplusplus @@ -3964,3 +4103,21 @@ HYPRE_Int hypre_mm_read_mtx_crd_size(FILE *f, HYPRE_Int *M, HYPRE_Int *N, HYPRE_ #endif + +#ifdef __cplusplus +} +#endif + +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_utilities_mup_undef.h" +#include "_hypre_utilities_mup.h" +#endif +#endif + +#endif + diff --git a/src/utilities/_hypre_utilities.hpp b/src/utilities/_hypre_utilities.hpp index 611d08c07e..8be1e17919 100644 --- a/src/utilities/_hypre_utilities.hpp +++ b/src/utilities/_hypre_utilities.hpp @@ -4,6 +4,11 @@ #ifndef hypre_UTILITIES_HPP #define hypre_UTILITIES_HPP +#include + +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_utilities_mup_def.h" +#endif #ifdef __cplusplus extern "C++" { @@ -107,6 +112,23 @@ struct hypreFunctor_IndexCycle } }; +/*-------------------------------------------------------------------------- + * Functor to check: |x| > tol + *--------------------------------------------------------------------------*/ + +struct hypreFunctor_NonzeroAboveTol +{ + HYPRE_Real tol; + + hypreFunctor_NonzeroAboveTol(HYPRE_Real tol_) : tol(tol_) {} + + __host__ __device__ + bool operator()(const HYPRE_Complex& x) const + { + return hypre_cabs(x) > tol; + } +}; + #endif /* if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) */ #endif /* ifndef HYPRE_FUNCTORS_H */ /****************************************************************************** @@ -311,6 +333,31 @@ using hypre_DeviceItem = void*; #define HYPRE_THRUST_EXECUTION thrust::cuda::par #endif +#if CUDART_VERSION >= 13000 +// Macro for device memory prefetching (CUDART 13.0+) +#define HYPRE_MEM_PREFETCH_DEVICE(ptr, size, stream) \ + do { \ + cudaMemLocation loc = {cudaMemLocationTypeDevice, hypre_HandleDevice(hypre_handle())}; \ + HYPRE_CUDA_CALL(cudaMemPrefetchAsync(ptr, size, loc, 0, stream)); \ + } while (0) + +// Macro for host memory prefetching (CUDART 13.0+) +#define HYPRE_MEM_PREFETCH_HOST(ptr, size, stream) \ + do { \ + cudaMemLocation loc = {cudaMemLocationTypeHost, cudaCpuDeviceId}; \ + HYPRE_CUDA_CALL(cudaMemPrefetchAsync(ptr, size, loc, 0, stream)); \ + } while (0) + +#else +// Macro for device memory prefetching (< CUDART 13.0) +#define HYPRE_MEM_PREFETCH_DEVICE(ptr, size, stream) \ + HYPRE_CUDA_CALL(cudaMemPrefetchAsync(ptr, size, hypre_HandleDevice(hypre_handle()), stream)) + +// Macro for host memory prefetching (< CUDART 13.0) +#define HYPRE_MEM_PREFETCH_HOST(ptr, size, stream) \ + HYPRE_CUDA_CALL(cudaMemPrefetchAsync(ptr, size, cudaCpuDeviceId, stream)) +#endif + #endif /* defined(HYPRE_USING_CUDA) */ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -385,6 +432,13 @@ using hypre_DeviceItem = void*; #define HYPRE_THRUST_NOT(pred) thrust::not_fn(pred) #endif +/* Resolve deprecated warnings about thrust::identity */ +#if (defined(THRUST_VERSION) && THRUST_VERSION < 200802) +#define HYPRE_THRUST_IDENTITY(type) thrust::identity() +#elif defined(HYPRE_USING_CUDA) +#define HYPRE_THRUST_IDENTITY(type) cuda::std::identity() +#endif + using namespace thrust::placeholders; #endif /* defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) */ @@ -681,8 +735,13 @@ using hypre_DeviceItem = sycl::nd_item<3>; #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 +#if (ROCSPARSE_VERSION >= 300400) +#define hypre_rocsparse_csritilu0_compute rocsparse_scsritilu0_compute_ex +#else +#define hypre_rocsparse_csritilu0_compute rocsparse_scsritilu0_compute +#endif + /* rocSOLVER */ #define hypre_rocsolver_getrf_batched rocsolver_sgetrf_batched @@ -742,8 +801,13 @@ using hypre_DeviceItem = sycl::nd_item<3>; #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 +#if (ROCSPARSE_VERSION >= 300400) +#define hypre_rocsparse_csritilu0_compute rocsparse_dcsritilu0_compute_ex +#else +#define hypre_rocsparse_csritilu0_compute rocsparse_dcsritilu0_compute +#endif + /* rocSOLVER */ #define hypre_rocsolver_getrf_batched rocsolver_dgetrf_batched @@ -1156,6 +1220,8 @@ template static __device__ __forceinline__ hypre_int hypre_gpu_get_threadIdx(hypre_DeviceItem &item) { + HYPRE_UNUSED_VAR(item); + if (dim == 0) { return threadIdx.x; } if (dim == 1) { return threadIdx.y; } if (dim == 2) { return threadIdx.z; } @@ -1168,6 +1234,8 @@ template static __device__ __forceinline__ hypre_int hypre_gpu_get_blockIdx(hypre_DeviceItem &item) { + HYPRE_UNUSED_VAR(item); + if (dim == 0) { return blockIdx.x; } if (dim == 1) { return blockIdx.y; } if (dim == 2) { return blockIdx.z; } @@ -1180,6 +1248,8 @@ template static __device__ __forceinline__ hypre_int hypre_gpu_get_blockDim(hypre_DeviceItem &item) { + HYPRE_UNUSED_VAR(item); + if (dim == 0) { return blockDim.x; } if (dim == 1) { return blockDim.y; } if (dim == 2) { return blockDim.z; } @@ -1192,6 +1262,8 @@ template static __device__ __forceinline__ hypre_int hypre_gpu_get_num_threads(hypre_DeviceItem &item) { + HYPRE_UNUSED_VAR(item); + switch (dim) { case 1: @@ -1210,6 +1282,8 @@ template static __device__ __forceinline__ hypre_int hypre_gpu_get_thread_id(hypre_DeviceItem &item) { + HYPRE_UNUSED_VAR(item); + switch (dim) { case 1: @@ -1229,6 +1303,8 @@ template static __device__ __forceinline__ hypre_int hypre_gpu_get_num_warps(hypre_DeviceItem &item) { + HYPRE_UNUSED_VAR(item); + return hypre_gpu_get_num_threads(item) >> HYPRE_WARP_BITSHIFT; } @@ -1237,6 +1313,8 @@ template static __device__ __forceinline__ hypre_int hypre_gpu_get_warp_id(hypre_DeviceItem &item) { + HYPRE_UNUSED_VAR(item); + return hypre_gpu_get_thread_id(item) >> HYPRE_WARP_BITSHIFT; } @@ -1245,6 +1323,8 @@ template static __device__ __forceinline__ hypre_int hypre_gpu_get_lane_id(hypre_DeviceItem &item) { + HYPRE_UNUSED_VAR(item); + return hypre_gpu_get_thread_id(item) & (HYPRE_WARP_SIZE - 1); } @@ -1271,6 +1351,8 @@ template static __device__ __forceinline__ hypre_int hypre_gpu_get_block_id(hypre_DeviceItem &item) { + HYPRE_UNUSED_VAR(item); + switch (dim) { case 1: @@ -1290,6 +1372,8 @@ template static __device__ __forceinline__ hypre_int hypre_gpu_get_grid_num_threads(hypre_DeviceItem &item) { + HYPRE_UNUSED_VAR(item); + return hypre_gpu_get_num_blocks() * hypre_gpu_get_num_threads(item); } @@ -1298,6 +1382,8 @@ template static __device__ __forceinline__ hypre_int hypre_gpu_get_grid_thread_id(hypre_DeviceItem &item) { + HYPRE_UNUSED_VAR(item); + return hypre_gpu_get_block_id(item) * hypre_gpu_get_num_threads(item) + hypre_gpu_get_thread_id(item); } @@ -1307,6 +1393,8 @@ template static __device__ __forceinline__ hypre_int hypre_gpu_get_grid_num_warps(hypre_DeviceItem &item) { + HYPRE_UNUSED_VAR(item); + return hypre_gpu_get_num_blocks() * hypre_gpu_get_num_warps(item); } @@ -1315,6 +1403,8 @@ template static __device__ __forceinline__ hypre_int hypre_gpu_get_grid_warp_id(hypre_DeviceItem &item) { + HYPRE_UNUSED_VAR(item); + return hypre_gpu_get_block_id(item) * hypre_gpu_get_num_warps(item) + hypre_gpu_get_warp_id(item); } @@ -1356,6 +1446,8 @@ template static __device__ __forceinline__ T __shfl_sync(hypre_mask mask, T val, hypre_int src_line, hypre_int width = HYPRE_WARP_SIZE) { + HYPRE_UNUSED_VAR(mask); + return __shfl(val, src_line, width); } @@ -1363,6 +1455,8 @@ template static __device__ __forceinline__ T __shfl_up_sync(hypre_mask mask, T val, hypre_uint delta, hypre_int width = HYPRE_WARP_SIZE) { + HYPRE_UNUSED_VAR(mask); + return __shfl_up(val, delta, width); } @@ -1370,6 +1464,8 @@ template static __device__ __forceinline__ T __shfl_down_sync(hypre_mask mask, T val, hypre_uint delta, hypre_int width = HYPRE_WARP_SIZE) { + HYPRE_UNUSED_VAR(mask); + return __shfl_down(val, delta, width); } @@ -1377,6 +1473,8 @@ template static __device__ __forceinline__ T __shfl_xor_sync(hypre_mask mask, T val, hypre_int lanemask, hypre_int width = HYPRE_WARP_SIZE) { + HYPRE_UNUSED_VAR(mask); + return __shfl_xor(val, lanemask, width); } @@ -1390,9 +1488,12 @@ void __syncwarp() static __device__ __forceinline__ hypre_mask hypre_ballot_sync(hypre_DeviceItem &item, hypre_mask mask, hypre_int predicate) { + HYPRE_UNUSED_VAR(item); + #if defined(HYPRE_USING_CUDA) return __ballot_sync(mask, predicate); #else + HYPRE_UNUSED_VAR(mask); return __ballot(predicate); #endif } @@ -1421,6 +1522,8 @@ HYPRE_Int hypre_ffs(hypre_mask mask) static __device__ __forceinline__ hypre_int __any_sync(unsigned mask, hypre_int predicate) { + HYPRE_UNUSED_VAR(mask); + return __any(predicate); } #endif @@ -1429,6 +1532,8 @@ hypre_int __any_sync(unsigned mask, hypre_int predicate) static __device__ __forceinline__ void block_sync(hypre_DeviceItem &item) { + HYPRE_UNUSED_VAR(item); + __syncthreads(); } @@ -1436,6 +1541,8 @@ void block_sync(hypre_DeviceItem &item) static __device__ __forceinline__ void warp_sync(hypre_DeviceItem &item) { + HYPRE_UNUSED_VAR(item); + __syncwarp(); } @@ -1444,6 +1551,8 @@ template static __device__ __forceinline__ T warp_prefix_sum(hypre_DeviceItem &item, hypre_int lane_id, T in, T &all_sum) { + HYPRE_UNUSED_VAR(item); + #pragma unroll for (hypre_int d = 2; d <= HYPRE_WARP_SIZE; d <<= 1) { @@ -1484,6 +1593,8 @@ T warp_prefix_sum(hypre_DeviceItem &item, hypre_int lane_id, T in, T &all_sum) static __device__ __forceinline__ hypre_int warp_any_sync(hypre_DeviceItem &item, hypre_mask mask, hypre_int predicate) { + HYPRE_UNUSED_VAR(item); + return __any_sync(mask, predicate); } @@ -1492,6 +1603,8 @@ 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) { + HYPRE_UNUSED_VAR(item); + return __shfl_sync(mask, val, src_line, width); } @@ -1500,6 +1613,8 @@ 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) { + HYPRE_UNUSED_VAR(item); + return __shfl_up_sync(mask, val, delta, width); } @@ -1508,6 +1623,8 @@ 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) { + HYPRE_UNUSED_VAR(item); + return __shfl_down_sync(mask, val, delta, width); } @@ -1516,6 +1633,8 @@ 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) { + HYPRE_UNUSED_VAR(item); + return __shfl_xor_sync(mask, val, lane_mask, width); } @@ -1523,6 +1642,8 @@ template static __device__ __forceinline__ T warp_reduce_sum(hypre_DeviceItem &item, T in) { + HYPRE_UNUSED_VAR(item); + #pragma unroll for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) { @@ -1535,6 +1656,8 @@ template static __device__ __forceinline__ T warp_allreduce_sum(hypre_DeviceItem &item, T in) { + HYPRE_UNUSED_VAR(item); + #pragma unroll for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) { @@ -1547,6 +1670,8 @@ template static __device__ __forceinline__ T warp_reduce_max(hypre_DeviceItem &item, T in) { + HYPRE_UNUSED_VAR(item); + #pragma unroll for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) { @@ -1559,6 +1684,8 @@ template static __device__ __forceinline__ T warp_allreduce_max(hypre_DeviceItem &item, T in) { + HYPRE_UNUSED_VAR(item); + #pragma unroll for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) { @@ -1571,6 +1698,8 @@ template static __device__ __forceinline__ T warp_reduce_min(hypre_DeviceItem &item, T in) { + HYPRE_UNUSED_VAR(item); + #pragma unroll for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) { @@ -1583,6 +1712,8 @@ template static __device__ __forceinline__ T warp_allreduce_min(hypre_DeviceItem &item, T in) { + HYPRE_UNUSED_VAR(item); + #pragma unroll for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) { @@ -2371,73 +2502,102 @@ cusparseIndexType_t hypre_HYPREIntToCusparseIndexType(); template void OneBlockReduce(T *d_arr, HYPRE_Int N, T *h_out); -struct HYPRE_double4 +struct HYPRE_Real2 { - HYPRE_Real x, y, z, w; + HYPRE_Real x, y; __host__ __device__ - HYPRE_double4() {} + HYPRE_Real2() {} __host__ __device__ - HYPRE_double4(HYPRE_Real x1, HYPRE_Real x2, HYPRE_Real x3, HYPRE_Real x4) + HYPRE_Real2(HYPRE_Real x1, HYPRE_Real x2) { x = x1; y = x2; - z = x3; - w = x4; } __host__ __device__ void operator=(HYPRE_Real val) { - x = y = z = w = val; + x = y = val; } __host__ __device__ - void operator+=(HYPRE_double4 rhs) + void operator+=(HYPRE_Real2 rhs) { x += rhs.x; y += rhs.y; - z += rhs.z; + } + +}; + +struct HYPRE_Real4 +{ + HYPRE_Real u, v, w, x; + + __host__ __device__ + HYPRE_Real4() {} + + __host__ __device__ + HYPRE_Real4(HYPRE_Real x1, HYPRE_Real x2, HYPRE_Real x3, HYPRE_Real x4) + { + u = x1; + v = x2; + w = x3; + x = x4; + } + + __host__ __device__ + void operator=(HYPRE_Real val) + { + u = v = w = x = val; + } + + __host__ __device__ + void operator+=(HYPRE_Real4 rhs) + { + u += rhs.u; + v += rhs.v; w += rhs.w; + x += rhs.x; } }; -struct HYPRE_double6 +struct HYPRE_Real6 { - HYPRE_Real x, y, z, w, u, v; + HYPRE_Real u, v, w, x, y, z; __host__ __device__ - HYPRE_double6() {} + HYPRE_Real6() {} __host__ __device__ - HYPRE_double6(HYPRE_Real x1, HYPRE_Real x2, HYPRE_Real x3, HYPRE_Real x4, - HYPRE_Real x5, HYPRE_Real x6) + HYPRE_Real6(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; + u = x1; + v = x2; + w = x3; + x = x4; + y = x5; + z = x6; } __host__ __device__ void operator=(HYPRE_Real val) { - x = y = z = w = u = v = val; + u = v = w = x = y = z = val; } __host__ __device__ - void operator+=(HYPRE_double6 rhs) + void operator+=(HYPRE_Real6 rhs) { + u += rhs.u; + v += rhs.v; + w += rhs.w; x += rhs.x; y += rhs.y; z += rhs.z; - w += rhs.w; - u += rhs.u; - v += rhs.v; } }; @@ -2456,32 +2616,45 @@ HYPRE_Real warpReduceSum(HYPRE_Real val) } __inline__ __host__ __device__ -HYPRE_double4 warpReduceSum(HYPRE_double4 val) +HYPRE_Real2 warpReduceSum(HYPRE_Real2 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); + } +#endif + return val; +} + +__inline__ __host__ __device__ +HYPRE_Real4 warpReduceSum(HYPRE_Real4 val) +{ +#if defined(__CUDA_ARCH__) || defined(__HIP_DEVICE_COMPILE__) + for (HYPRE_Int offset = warpSize / 2; offset > 0; offset /= 2) + { + val.u += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.u, offset); + val.v += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.v, offset); val.w += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.w, offset); + val.x += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.x, offset); } #endif return val; } __inline__ __host__ __device__ -HYPRE_double6 warpReduceSum(HYPRE_double6 val) +HYPRE_Real6 warpReduceSum(HYPRE_Real6 val) { #if defined(__CUDA_ARCH__) || defined(__HIP_DEVICE_COMPILE__) for (HYPRE_Int offset = warpSize / 2; offset > 0; offset /= 2) { + val.u += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.u, offset); + val.v += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.v, offset); + val.w += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.w, offset); 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; @@ -2537,11 +2710,15 @@ OneBlockReduceKernel(hypre_DeviceItem &item, T *arr, HYPRE_Int N) { +#if !defined(HYPRE_USING_SYCL) + HYPRE_UNUSED_VAR(item); +#endif + T sum; sum = 0.0; - if (threadIdx.x < N) + if (threadIdx.x < (hypre_uint) N) { sum = arr[threadIdx.x]; } @@ -2603,9 +2780,9 @@ struct ReduceSum { if (hypre_HandleReduceBuffer(hypre_handle()) == NULL) { - /* allocate for the max size for reducing double6 type */ + /* allocate for the max size for reducing HYPRE_Real6 type */ hypre_HandleReduceBuffer(hypre_handle()) = - hypre_TAlloc(HYPRE_double6, HYPRE_MAX_NTHREADS_BLOCK, HYPRE_MEMORY_DEVICE); + hypre_TAlloc(HYPRE_Real6, HYPRE_MAX_NTHREADS_BLOCK, HYPRE_MEMORY_DEVICE); } d_buf = (T*) hypre_HandleReduceBuffer(hypre_handle()); @@ -3512,5 +3689,16 @@ struct hypre_cub_CachingDeviceAllocator } #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_utilities_mup_undef.h" +#include "_hypre_utilities_mup.h" +#endif +#endif + #endif diff --git a/src/utilities/_hypre_utilities_mup.h b/src/utilities/_hypre_utilities_mup.h new file mode 100644 index 0000000000..c7da1e147d --- /dev/null +++ b/src/utilities/_hypre_utilities_mup.h @@ -0,0 +1,1887 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#ifndef hypre_UTILITIES_MUP_HEADER +#define hypre_UTILITIES_MUP_HEADER + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (HYPRE_MIXED_PRECISION) + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +hypre_BeginTiming_fcn_flt( HYPRE_Int time_index ); +HYPRE_Int +hypre_BeginTiming_fcn_dbl( HYPRE_Int time_index ); +HYPRE_Int +hypre_BeginTiming_fcn_long_dbl( HYPRE_Int time_index ); + +HYPRE_Int +hypre_BigBinarySearch_flt( HYPRE_BigInt *list, HYPRE_BigInt value, HYPRE_Int list_length ); +HYPRE_Int +hypre_BigBinarySearch_dbl( HYPRE_BigInt *list, HYPRE_BigInt value, HYPRE_Int list_length ); +HYPRE_Int +hypre_BigBinarySearch_long_dbl( HYPRE_BigInt *list, HYPRE_BigInt value, HYPRE_Int list_length ); + +HYPRE_BigInt * +hypre_BigLowerBound_flt( HYPRE_BigInt *first, HYPRE_BigInt *last, HYPRE_BigInt value ); +HYPRE_BigInt * +hypre_BigLowerBound_dbl( HYPRE_BigInt *first, HYPRE_BigInt *last, HYPRE_BigInt value ); +HYPRE_BigInt * +hypre_BigLowerBound_long_dbl( HYPRE_BigInt *first, HYPRE_BigInt *last, HYPRE_BigInt value ); + +void +hypre_BigQsort0_flt( HYPRE_BigInt *v, HYPRE_Int left, HYPRE_Int right ); +void +hypre_BigQsort0_dbl( HYPRE_BigInt *v, HYPRE_Int left, HYPRE_Int right ); +void +hypre_BigQsort0_long_dbl( HYPRE_BigInt *v, HYPRE_Int left, HYPRE_Int right ); + +void +hypre_BigQsort1_flt( HYPRE_BigInt *v, hypre_float *w, HYPRE_Int left, HYPRE_Int right ); +void +hypre_BigQsort1_dbl( HYPRE_BigInt *v, hypre_double *w, HYPRE_Int left, HYPRE_Int right ); +void +hypre_BigQsort1_long_dbl( HYPRE_BigInt *v, hypre_long_double *w, HYPRE_Int left, HYPRE_Int right ); + +void +hypre_BigQsort2i_flt( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int left, HYPRE_Int right ); +void +hypre_BigQsort2i_dbl( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int left, HYPRE_Int right ); +void +hypre_BigQsort2i_long_dbl( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int left, HYPRE_Int right ); + +void +hypre_BigQsort4_abs_flt( hypre_float *v, HYPRE_BigInt *w, HYPRE_Int *z, HYPRE_Int *y, HYPRE_Int left, HYPRE_Int right ); +void +hypre_BigQsort4_abs_dbl( hypre_double *v, HYPRE_BigInt *w, HYPRE_Int *z, HYPRE_Int *y, HYPRE_Int left, HYPRE_Int right ); +void +hypre_BigQsort4_abs_long_dbl( hypre_long_double *v, HYPRE_BigInt *w, HYPRE_Int *z, HYPRE_Int *y, HYPRE_Int left, HYPRE_Int right ); + +void +hypre_BigQsortb2i_flt( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int left, HYPRE_Int right ); +void +hypre_BigQsortb2i_dbl( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int left, HYPRE_Int right ); +void +hypre_BigQsortb2i_long_dbl( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int left, HYPRE_Int right ); + +void +hypre_BigQsortbLoc_flt( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int left, HYPRE_Int right ); +void +hypre_BigQsortbLoc_dbl( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int left, HYPRE_Int right ); +void +hypre_BigQsortbLoc_long_dbl( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int left, HYPRE_Int right ); + +void +hypre_BigQsortbi_flt( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int left, HYPRE_Int right ); +void +hypre_BigQsortbi_dbl( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int left, HYPRE_Int right ); +void +hypre_BigQsortbi_long_dbl( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int left, HYPRE_Int right ); + +void +hypre_BigSwap_flt( HYPRE_BigInt *v, HYPRE_Int i, HYPRE_Int j ); +void +hypre_BigSwap_dbl( HYPRE_BigInt *v, HYPRE_Int i, HYPRE_Int j ); +void +hypre_BigSwap_long_dbl( HYPRE_BigInt *v, HYPRE_Int i, HYPRE_Int j ); + +void +hypre_BigSwap2_flt( HYPRE_BigInt *v, hypre_float *w, HYPRE_Int i, HYPRE_Int j ); +void +hypre_BigSwap2_dbl( HYPRE_BigInt *v, hypre_double *w, HYPRE_Int i, HYPRE_Int j ); +void +hypre_BigSwap2_long_dbl( HYPRE_BigInt *v, hypre_long_double *w, HYPRE_Int i, HYPRE_Int j ); + +void +hypre_BigSwap2i_flt( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int i, HYPRE_Int j ); +void +hypre_BigSwap2i_dbl( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int i, HYPRE_Int j ); +void +hypre_BigSwap2i_long_dbl( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int i, HYPRE_Int j ); + +void +hypre_BigSwap4_d_flt( hypre_float *v, HYPRE_BigInt *w, HYPRE_Int *z, HYPRE_Int *y, HYPRE_Int i, HYPRE_Int j ); +void +hypre_BigSwap4_d_dbl( hypre_double *v, HYPRE_BigInt *w, HYPRE_Int *z, HYPRE_Int *y, HYPRE_Int i, HYPRE_Int j ); +void +hypre_BigSwap4_d_long_dbl( hypre_long_double *v, HYPRE_BigInt *w, HYPRE_Int *z, HYPRE_Int *y, HYPRE_Int i, HYPRE_Int j ); + +void +hypre_BigSwapLoc_flt( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int i, HYPRE_Int j ); +void +hypre_BigSwapLoc_dbl( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int i, HYPRE_Int j ); +void +hypre_BigSwapLoc_long_dbl( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int i, HYPRE_Int j ); + +void +hypre_BigSwapb2i_flt( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int i, HYPRE_Int j ); +void +hypre_BigSwapb2i_dbl( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int i, HYPRE_Int j ); +void +hypre_BigSwapb2i_long_dbl( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int i, HYPRE_Int j ); + +void +hypre_BigSwapbi_flt( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int i, HYPRE_Int j ); +void +hypre_BigSwapbi_dbl( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int i, HYPRE_Int j ); +void +hypre_BigSwapbi_long_dbl( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int i, HYPRE_Int j ); + +HYPRE_Int +hypre_BinarySearch_flt( HYPRE_Int *list, HYPRE_Int value, HYPRE_Int list_length ); +HYPRE_Int +hypre_BinarySearch_dbl( HYPRE_Int *list, HYPRE_Int value, HYPRE_Int list_length ); +HYPRE_Int +hypre_BinarySearch_long_dbl( HYPRE_Int *list, HYPRE_Int value, HYPRE_Int list_length ); + +HYPRE_Int +hypre_BinarySearch2_flt( HYPRE_Int *list, HYPRE_Int value, HYPRE_Int low, HYPRE_Int high, HYPRE_Int *spot ); +HYPRE_Int +hypre_BinarySearch2_dbl( HYPRE_Int *list, HYPRE_Int value, HYPRE_Int low, HYPRE_Int high, HYPRE_Int *spot ); +HYPRE_Int +hypre_BinarySearch2_long_dbl( HYPRE_Int *list, HYPRE_Int value, HYPRE_Int low, HYPRE_Int high, HYPRE_Int *spot ); + +void * +hypre_CAlloc_flt( size_t count, size_t elt_size, HYPRE_MemoryLocation location ); +void * +hypre_CAlloc_dbl( size_t count, size_t elt_size, HYPRE_MemoryLocation location ); +void * +hypre_CAlloc_long_dbl( size_t count, size_t elt_size, HYPRE_MemoryLocation location ); + +HYPRE_Int +hypre_CheckDirExists_flt( const char *path ); +HYPRE_Int +hypre_CheckDirExists_dbl( const char *path ); +HYPRE_Int +hypre_CheckDirExists_long_dbl( const char *path ); + +void +hypre_CheckMemoryLocation_flt( void *ptr, hypre_MemoryLocation location ); +void +hypre_CheckMemoryLocation_dbl( void *ptr, hypre_MemoryLocation location ); +void +hypre_CheckMemoryLocation_long_dbl( void *ptr, hypre_MemoryLocation location ); + +HYPRE_Int +hypre_ClearTiming_fcn_flt( void ); +HYPRE_Int +hypre_ClearTiming_fcn_dbl( void ); +HYPRE_Int +hypre_ClearTiming_fcn_long_dbl( void ); + +char* +hypre_ConvertIndicesToString_flt( HYPRE_Int size, HYPRE_Int *indices ); +char* +hypre_ConvertIndicesToString_dbl( HYPRE_Int size, HYPRE_Int *indices ); +char* +hypre_ConvertIndicesToString_long_dbl( HYPRE_Int size, HYPRE_Int *indices ); + +HYPRE_Int +hypre_CreateBinaryTree_flt( HYPRE_Int myid, HYPRE_Int num_procs, hypre_BinaryTree **tree_ptr ); +HYPRE_Int +hypre_CreateBinaryTree_dbl( HYPRE_Int myid, HYPRE_Int num_procs, hypre_BinaryTree **tree_ptr ); +HYPRE_Int +hypre_CreateBinaryTree_long_dbl( HYPRE_Int myid, HYPRE_Int num_procs, hypre_BinaryTree **tree_ptr ); + +HYPRE_Int +hypre_CreateDir_flt( const char *path ); +HYPRE_Int +hypre_CreateDir_dbl( const char *path ); +HYPRE_Int +hypre_CreateDir_long_dbl( const char *path ); + +HYPRE_Int +hypre_CreateNextDirOfSequence_flt( const char *basepath, const char *prefix, char **fullpath_ptr ); +HYPRE_Int +hypre_CreateNextDirOfSequence_dbl( const char *basepath, const char *prefix, char **fullpath_ptr ); +HYPRE_Int +hypre_CreateNextDirOfSequence_long_dbl( const char *basepath, const char *prefix, char **fullpath_ptr ); + +HYPRE_Int +hypre_DataExchangeList_flt( 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_dbl( 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_long_dbl( 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_DestroyBinaryTree_flt( hypre_BinaryTree *tree ); +HYPRE_Int +hypre_DestroyBinaryTree_dbl( hypre_BinaryTree *tree ); +HYPRE_Int +hypre_DestroyBinaryTree_long_dbl( hypre_BinaryTree *tree ); + +HYPRE_Int +hypre_DoubleQuickSplit_flt( hypre_float *values, HYPRE_Int *indices, HYPRE_Int list_length, HYPRE_Int NumberKept ); +HYPRE_Int +hypre_DoubleQuickSplit_dbl( hypre_double *values, HYPRE_Int *indices, HYPRE_Int list_length, HYPRE_Int NumberKept ); +HYPRE_Int +hypre_DoubleQuickSplit_long_dbl( hypre_long_double *values, HYPRE_Int *indices, HYPRE_Int list_length, HYPRE_Int NumberKept ); + +HYPRE_Int +hypre_EndTiming_fcn_flt( HYPRE_Int time_index ); +HYPRE_Int +hypre_EndTiming_fcn_dbl( HYPRE_Int time_index ); +HYPRE_Int +hypre_EndTiming_fcn_long_dbl( HYPRE_Int time_index ); + +HYPRE_Int +hypre_FinalizeAllTimings_fcn_flt( void ); +HYPRE_Int +hypre_FinalizeAllTimings_fcn_dbl( void ); +HYPRE_Int +hypre_FinalizeAllTimings_fcn_long_dbl( void ); + +HYPRE_Int +hypre_FinalizeTiming_fcn_flt( HYPRE_Int time_index ); +HYPRE_Int +hypre_FinalizeTiming_fcn_dbl( HYPRE_Int time_index ); +HYPRE_Int +hypre_FinalizeTiming_fcn_long_dbl( HYPRE_Int time_index ); + +HYPRE_Int +hypre_Finalized_flt( void ); +HYPRE_Int +hypre_Finalized_dbl( void ); +HYPRE_Int +hypre_Finalized_long_dbl( void ); + +void +hypre_Free_flt( void *ptr, HYPRE_MemoryLocation location ); +void +hypre_Free_dbl( void *ptr, HYPRE_MemoryLocation location ); +void +hypre_Free_long_dbl( void *ptr, HYPRE_MemoryLocation location ); + +HYPRE_Int +hypre_GetDevice_flt( hypre_int *device_id ); +HYPRE_Int +hypre_GetDevice_dbl( hypre_int *device_id ); +HYPRE_Int +hypre_GetDevice_long_dbl( hypre_int *device_id ); + +HYPRE_Int +hypre_GetDeviceCount_flt( hypre_int *device_count ); +HYPRE_Int +hypre_GetDeviceCount_dbl( hypre_int *device_count ); +HYPRE_Int +hypre_GetDeviceCount_long_dbl( hypre_int *device_count ); + +HYPRE_Int +hypre_GetDeviceLastError_flt( void ); +HYPRE_Int +hypre_GetDeviceLastError_dbl( void ); +HYPRE_Int +hypre_GetDeviceLastError_long_dbl( void ); + +HYPRE_Int +hypre_GetDeviceMaxShmemSize_flt( hypre_int device_id, hypre_int *max_size_ptr, hypre_int *max_size_optin_ptr ); +HYPRE_Int +hypre_GetDeviceMaxShmemSize_dbl( hypre_int device_id, hypre_int *max_size_ptr, hypre_int *max_size_optin_ptr ); +HYPRE_Int +hypre_GetDeviceMaxShmemSize_long_dbl( hypre_int device_id, hypre_int *max_size_ptr, hypre_int *max_size_optin_ptr ); + +HYPRE_ExecutionPolicy +hypre_GetExecPolicy1_flt( HYPRE_MemoryLocation location ); +HYPRE_ExecutionPolicy +hypre_GetExecPolicy1_dbl( HYPRE_MemoryLocation location ); +HYPRE_ExecutionPolicy +hypre_GetExecPolicy1_long_dbl( HYPRE_MemoryLocation location ); + +HYPRE_ExecutionPolicy +hypre_GetExecPolicy2_flt( HYPRE_MemoryLocation location1, HYPRE_MemoryLocation location2 ); +HYPRE_ExecutionPolicy +hypre_GetExecPolicy2_dbl( HYPRE_MemoryLocation location1, HYPRE_MemoryLocation location2 ); +HYPRE_ExecutionPolicy +hypre_GetExecPolicy2_long_dbl( HYPRE_MemoryLocation location1, HYPRE_MemoryLocation location2 ); + +HYPRE_Int +hypre_GetGpuAwareMPI_flt( void ); +HYPRE_Int +hypre_GetGpuAwareMPI_dbl( void ); +HYPRE_Int +hypre_GetGpuAwareMPI_long_dbl( void ); + +HYPRE_Int +hypre_GetMemoryLocationName_flt( hypre_MemoryLocation memory_location, char *memory_location_name ); +HYPRE_Int +hypre_GetMemoryLocationName_dbl( hypre_MemoryLocation memory_location, char *memory_location_name ); +HYPRE_Int +hypre_GetMemoryLocationName_long_dbl( hypre_MemoryLocation memory_location, char *memory_location_name ); + +HYPRE_Int +hypre_GetPointerLocation_flt( const void *ptr, hypre_MemoryLocation *memory_location ); +HYPRE_Int +hypre_GetPointerLocation_dbl( const void *ptr, hypre_MemoryLocation *memory_location ); +HYPRE_Int +hypre_GetPointerLocation_long_dbl( const void *ptr, hypre_MemoryLocation *memory_location ); + +void +hypre_GetSimpleThreadPartition_flt( HYPRE_Int *begin, HYPRE_Int *end, HYPRE_Int n ); +void +hypre_GetSimpleThreadPartition_dbl( HYPRE_Int *begin, HYPRE_Int *end, HYPRE_Int n ); +void +hypre_GetSimpleThreadPartition_long_dbl( HYPRE_Int *begin, HYPRE_Int *end, HYPRE_Int n ); + +HYPRE_Int +hypre_GetTiming_fcn_flt( const char *heading, hypre_float *wall_time_ptr, MPI_Comm comm ); +HYPRE_Int +hypre_GetTiming_fcn_dbl( const char *heading, hypre_double *wall_time_ptr, MPI_Comm comm ); +HYPRE_Int +hypre_GetTiming_fcn_long_dbl( const char *heading, hypre_long_double *wall_time_ptr, MPI_Comm comm ); + +void +hypre_GpuProfilingPopRange_flt( void ); +void +hypre_GpuProfilingPopRange_dbl( void ); +void +hypre_GpuProfilingPopRange_long_dbl( void ); + +void +hypre_GpuProfilingPushRange_flt( const char *name ); +void +hypre_GpuProfilingPushRange_dbl( const char *name ); +void +hypre_GpuProfilingPushRange_long_dbl( const char *name ); + +void +hypre_GpuProfilingPushRangeColor_flt( const char *name, HYPRE_Int cid ); +void +hypre_GpuProfilingPushRangeColor_dbl( const char *name, HYPRE_Int cid ); +void +hypre_GpuProfilingPushRangeColor_long_dbl( const char *name, HYPRE_Int cid ); + +hypre_Handle* +hypre_HandleCreate_flt( void ); +hypre_Handle* +hypre_HandleCreate_dbl( void ); +hypre_Handle* +hypre_HandleCreate_long_dbl( void ); + +HYPRE_Int +hypre_HandleDestroy_flt( hypre_Handle *hypre_handle_ ); +HYPRE_Int +hypre_HandleDestroy_dbl( hypre_Handle *hypre_handle_ ); +HYPRE_Int +hypre_HandleDestroy_long_dbl( hypre_Handle *hypre_handle_ ); + +HYPRE_Int +hypre_HostMemoryGetUsage_flt( hypre_float *mem ); +HYPRE_Int +hypre_HostMemoryGetUsage_dbl( hypre_double *mem ); +HYPRE_Int +hypre_HostMemoryGetUsage_long_dbl( hypre_long_double *mem ); + +HYPRE_Int +hypre_IncFLOPCount_fcn_flt( HYPRE_BigInt inc ); +HYPRE_Int +hypre_IncFLOPCount_fcn_dbl( HYPRE_BigInt inc ); +HYPRE_Int +hypre_IncFLOPCount_fcn_long_dbl( HYPRE_BigInt inc ); + +HYPRE_Int +hypre_InitializeTiming_fcn_flt( const char *name ); +HYPRE_Int +hypre_InitializeTiming_fcn_dbl( const char *name ); +HYPRE_Int +hypre_InitializeTiming_fcn_long_dbl( const char *name ); + +HYPRE_Int +hypre_Initialized_flt( void ); +HYPRE_Int +hypre_Initialized_dbl( void ); +HYPRE_Int +hypre_Initialized_long_dbl( void ); + +hypre_IntArrayArray* +hypre_IntArrayArrayCreate_flt( HYPRE_Int num_entries, HYPRE_Int *sizes ); +hypre_IntArrayArray* +hypre_IntArrayArrayCreate_dbl( HYPRE_Int num_entries, HYPRE_Int *sizes ); +hypre_IntArrayArray* +hypre_IntArrayArrayCreate_long_dbl( HYPRE_Int num_entries, HYPRE_Int *sizes ); + +HYPRE_Int +hypre_IntArrayArrayDestroy_flt( hypre_IntArrayArray *w ); +HYPRE_Int +hypre_IntArrayArrayDestroy_dbl( hypre_IntArrayArray *w ); +HYPRE_Int +hypre_IntArrayArrayDestroy_long_dbl( hypre_IntArrayArray *w ); + +HYPRE_Int +hypre_IntArrayArrayInitialize_flt( hypre_IntArrayArray *w ); +HYPRE_Int +hypre_IntArrayArrayInitialize_dbl( hypre_IntArrayArray *w ); +HYPRE_Int +hypre_IntArrayArrayInitialize_long_dbl( hypre_IntArrayArray *w ); + +HYPRE_Int +hypre_IntArrayArrayInitializeIn_flt( hypre_IntArrayArray *w, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_IntArrayArrayInitializeIn_dbl( hypre_IntArrayArray *w, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_IntArrayArrayInitializeIn_long_dbl( hypre_IntArrayArray *w, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +hypre_IntArrayArrayMigrate_flt( hypre_IntArrayArray *w, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_IntArrayArrayMigrate_dbl( hypre_IntArrayArray *w, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_IntArrayArrayMigrate_long_dbl( hypre_IntArrayArray *w, HYPRE_MemoryLocation memory_location ); + +hypre_IntArray* +hypre_IntArrayCloneDeep_flt( hypre_IntArray *x ); +hypre_IntArray* +hypre_IntArrayCloneDeep_dbl( hypre_IntArray *x ); +hypre_IntArray* +hypre_IntArrayCloneDeep_long_dbl( hypre_IntArray *x ); + +hypre_IntArray* +hypre_IntArrayCloneDeep_v2_flt( hypre_IntArray *x, HYPRE_MemoryLocation memory_location ); +hypre_IntArray* +hypre_IntArrayCloneDeep_v2_dbl( hypre_IntArray *x, HYPRE_MemoryLocation memory_location ); +hypre_IntArray* +hypre_IntArrayCloneDeep_v2_long_dbl( hypre_IntArray *x, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +hypre_IntArrayCopy_flt( hypre_IntArray *x, hypre_IntArray *y ); +HYPRE_Int +hypre_IntArrayCopy_dbl( hypre_IntArray *x, hypre_IntArray *y ); +HYPRE_Int +hypre_IntArrayCopy_long_dbl( hypre_IntArray *x, hypre_IntArray *y ); + +HYPRE_Int +hypre_IntArrayCount_flt( hypre_IntArray *v, HYPRE_Int value, HYPRE_Int *num_values_ptr ); +HYPRE_Int +hypre_IntArrayCount_dbl( hypre_IntArray *v, HYPRE_Int value, HYPRE_Int *num_values_ptr ); +HYPRE_Int +hypre_IntArrayCount_long_dbl( hypre_IntArray *v, HYPRE_Int value, HYPRE_Int *num_values_ptr ); + +HYPRE_Int +hypre_IntArrayCountHost_flt( hypre_IntArray *v, HYPRE_Int value, HYPRE_Int *num_values_ptr ); +HYPRE_Int +hypre_IntArrayCountHost_dbl( hypre_IntArray *v, HYPRE_Int value, HYPRE_Int *num_values_ptr ); +HYPRE_Int +hypre_IntArrayCountHost_long_dbl( hypre_IntArray *v, HYPRE_Int value, HYPRE_Int *num_values_ptr ); + +hypre_IntArray* +hypre_IntArrayCreate_flt( HYPRE_Int size ); +hypre_IntArray* +hypre_IntArrayCreate_dbl( HYPRE_Int size ); +hypre_IntArray* +hypre_IntArrayCreate_long_dbl( HYPRE_Int size ); + +HYPRE_Int +hypre_IntArrayDestroy_flt( hypre_IntArray *array ); +HYPRE_Int +hypre_IntArrayDestroy_dbl( hypre_IntArray *array ); +HYPRE_Int +hypre_IntArrayDestroy_long_dbl( hypre_IntArray *array ); + +HYPRE_Int +hypre_IntArrayInitialize_flt( hypre_IntArray *array ); +HYPRE_Int +hypre_IntArrayInitialize_dbl( hypre_IntArray *array ); +HYPRE_Int +hypre_IntArrayInitialize_long_dbl( hypre_IntArray *array ); + +HYPRE_Int +hypre_IntArrayInitialize_v2_flt( hypre_IntArray *array, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_IntArrayInitialize_v2_dbl( hypre_IntArray *array, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_IntArrayInitialize_v2_long_dbl( hypre_IntArray *array, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +hypre_IntArrayInverseMapping_flt( hypre_IntArray *v, hypre_IntArray **w_ptr ); +HYPRE_Int +hypre_IntArrayInverseMapping_dbl( hypre_IntArray *v, hypre_IntArray **w_ptr ); +HYPRE_Int +hypre_IntArrayInverseMapping_long_dbl( hypre_IntArray *v, hypre_IntArray **w_ptr ); + +HYPRE_Int +hypre_IntArrayMergeOrdered_flt( hypre_IntArray *array1, hypre_IntArray *array2, hypre_IntArray *array3 ); +HYPRE_Int +hypre_IntArrayMergeOrdered_dbl( hypre_IntArray *array1, hypre_IntArray *array2, hypre_IntArray *array3 ); +HYPRE_Int +hypre_IntArrayMergeOrdered_long_dbl( hypre_IntArray *array1, hypre_IntArray *array2, hypre_IntArray *array3 ); + +HYPRE_Int +hypre_IntArrayMigrate_flt( hypre_IntArray *v, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_IntArrayMigrate_dbl( hypre_IntArray *v, HYPRE_MemoryLocation memory_location ); +HYPRE_Int +hypre_IntArrayMigrate_long_dbl( hypre_IntArray *v, HYPRE_MemoryLocation memory_location ); + +HYPRE_Int +hypre_IntArrayNegate_flt( hypre_IntArray *v ); +HYPRE_Int +hypre_IntArrayNegate_dbl( hypre_IntArray *v ); +HYPRE_Int +hypre_IntArrayNegate_long_dbl( hypre_IntArray *v ); + +HYPRE_Int +hypre_IntArrayPrint_flt( MPI_Comm comm, hypre_IntArray *array, const char *filename ); +HYPRE_Int +hypre_IntArrayPrint_dbl( MPI_Comm comm, hypre_IntArray *array, const char *filename ); +HYPRE_Int +hypre_IntArrayPrint_long_dbl( MPI_Comm comm, hypre_IntArray *array, const char *filename ); + +HYPRE_Int +hypre_IntArrayRead_flt( MPI_Comm comm, const char *filename, hypre_IntArray **array_ptr ); +HYPRE_Int +hypre_IntArrayRead_dbl( MPI_Comm comm, const char *filename, hypre_IntArray **array_ptr ); +HYPRE_Int +hypre_IntArrayRead_long_dbl( MPI_Comm comm, const char *filename, hypre_IntArray **array_ptr ); + +HYPRE_Int +hypre_IntArraySeparateByValue_flt( HYPRE_Int num_values, HYPRE_Int *values, HYPRE_Int *sizes, hypre_IntArray *v, hypre_IntArrayArray **w_ptr ); +HYPRE_Int +hypre_IntArraySeparateByValue_dbl( HYPRE_Int num_values, HYPRE_Int *values, HYPRE_Int *sizes, hypre_IntArray *v, hypre_IntArrayArray **w_ptr ); +HYPRE_Int +hypre_IntArraySeparateByValue_long_dbl( HYPRE_Int num_values, HYPRE_Int *values, HYPRE_Int *sizes, hypre_IntArray *v, hypre_IntArrayArray **w_ptr ); + +HYPRE_Int +hypre_IntArraySetConstantValues_flt( hypre_IntArray *v, HYPRE_Int value ); +HYPRE_Int +hypre_IntArraySetConstantValues_dbl( hypre_IntArray *v, HYPRE_Int value ); +HYPRE_Int +hypre_IntArraySetConstantValues_long_dbl( hypre_IntArray *v, HYPRE_Int value ); + +HYPRE_Int +hypre_IntArraySetConstantValuesHost_flt( hypre_IntArray *v, HYPRE_Int value ); +HYPRE_Int +hypre_IntArraySetConstantValuesHost_dbl( hypre_IntArray *v, HYPRE_Int value ); +HYPRE_Int +hypre_IntArraySetConstantValuesHost_long_dbl( hypre_IntArray *v, HYPRE_Int value ); + +HYPRE_Int +hypre_IntArraySetInterleavedValues_flt( hypre_IntArray *v, HYPRE_Int cycle ); +HYPRE_Int +hypre_IntArraySetInterleavedValues_dbl( hypre_IntArray *v, HYPRE_Int cycle ); +HYPRE_Int +hypre_IntArraySetInterleavedValues_long_dbl( hypre_IntArray *v, HYPRE_Int cycle ); + +HYPRE_Int +hypre_IntSequence_flt( HYPRE_MemoryLocation memory_location, HYPRE_Int size, HYPRE_Int *data ); +HYPRE_Int +hypre_IntSequence_dbl( HYPRE_MemoryLocation memory_location, HYPRE_Int size, HYPRE_Int *data ); +HYPRE_Int +hypre_IntSequence_long_dbl( HYPRE_MemoryLocation memory_location, HYPRE_Int size, HYPRE_Int *data ); + +HYPRE_Int +hypre_Log2_flt( HYPRE_Int p ); +HYPRE_Int +hypre_Log2_dbl( HYPRE_Int p ); +HYPRE_Int +hypre_Log2_long_dbl( HYPRE_Int p ); + +HYPRE_Int * +hypre_LowerBound_flt( HYPRE_Int *first, HYPRE_Int *last, HYPRE_Int value ); +HYPRE_Int * +hypre_LowerBound_dbl( HYPRE_Int *first, HYPRE_Int *last, HYPRE_Int value ); +HYPRE_Int * +hypre_LowerBound_long_dbl( HYPRE_Int *first, HYPRE_Int *last, HYPRE_Int value ); + +void * +hypre_MAlloc_flt( size_t size, HYPRE_MemoryLocation location ); +void * +hypre_MAlloc_dbl( size_t size, HYPRE_MemoryLocation location ); +void * +hypre_MAlloc_long_dbl( size_t size, HYPRE_MemoryLocation location ); + +HYPRE_Int +hypre_MPI_Abort_flt( hypre_MPI_Comm comm, HYPRE_Int errorcode ); +HYPRE_Int +hypre_MPI_Abort_dbl( hypre_MPI_Comm comm, HYPRE_Int errorcode ); +HYPRE_Int +hypre_MPI_Abort_long_dbl( hypre_MPI_Comm comm, HYPRE_Int errorcode ); + +HYPRE_Int +hypre_MPI_Address_flt( void *location, hypre_MPI_Aint *address ); +HYPRE_Int +hypre_MPI_Address_dbl( void *location, hypre_MPI_Aint *address ); +HYPRE_Int +hypre_MPI_Address_long_dbl( void *location, hypre_MPI_Aint *address ); + +HYPRE_Int +hypre_MPI_Allgather_flt( 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_dbl( 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_long_dbl( 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_flt( 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_Allgatherv_dbl( 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_Allgatherv_long_dbl( 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_Allreduce_flt( void *sendbuf, void *recvbuf, HYPRE_Int count, hypre_MPI_Datatype datatype, hypre_MPI_Op op, hypre_MPI_Comm comm ); +HYPRE_Int +hypre_MPI_Allreduce_dbl( void *sendbuf, void *recvbuf, HYPRE_Int count, hypre_MPI_Datatype datatype, hypre_MPI_Op op, hypre_MPI_Comm comm ); +HYPRE_Int +hypre_MPI_Allreduce_long_dbl( void *sendbuf, void *recvbuf, HYPRE_Int count, hypre_MPI_Datatype datatype, hypre_MPI_Op op, hypre_MPI_Comm comm ); + +HYPRE_Int +hypre_MPI_Alltoall_flt( 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_Alltoall_dbl( 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_Alltoall_long_dbl( 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_Barrier_flt( hypre_MPI_Comm comm ); +HYPRE_Int +hypre_MPI_Barrier_dbl( hypre_MPI_Comm comm ); +HYPRE_Int +hypre_MPI_Barrier_long_dbl( hypre_MPI_Comm comm ); + +HYPRE_Int +hypre_MPI_Bcast_flt( void *buffer, HYPRE_Int count, hypre_MPI_Datatype datatype, HYPRE_Int root, hypre_MPI_Comm comm ); +HYPRE_Int +hypre_MPI_Bcast_dbl( void *buffer, HYPRE_Int count, hypre_MPI_Datatype datatype, HYPRE_Int root, hypre_MPI_Comm comm ); +HYPRE_Int +hypre_MPI_Bcast_long_dbl( void *buffer, HYPRE_Int count, hypre_MPI_Datatype datatype, HYPRE_Int root, hypre_MPI_Comm comm ); + +HYPRE_Int +hypre_MPI_CheckCommMatrix_flt( hypre_MPI_Comm comm, HYPRE_Int num_recvs, HYPRE_Int *recvs, HYPRE_Int num_sends, HYPRE_Int *sends ); +HYPRE_Int +hypre_MPI_CheckCommMatrix_dbl( hypre_MPI_Comm comm, HYPRE_Int num_recvs, HYPRE_Int *recvs, HYPRE_Int num_sends, HYPRE_Int *sends ); +HYPRE_Int +hypre_MPI_CheckCommMatrix_long_dbl( hypre_MPI_Comm comm, HYPRE_Int num_recvs, HYPRE_Int *recvs, HYPRE_Int num_sends, HYPRE_Int *sends ); + +HYPRE_Int +hypre_MPI_Comm_create_flt( hypre_MPI_Comm comm, hypre_MPI_Group group, hypre_MPI_Comm *newcomm ); +HYPRE_Int +hypre_MPI_Comm_create_dbl( hypre_MPI_Comm comm, hypre_MPI_Group group, hypre_MPI_Comm *newcomm ); +HYPRE_Int +hypre_MPI_Comm_create_long_dbl( hypre_MPI_Comm comm, hypre_MPI_Group group, hypre_MPI_Comm *newcomm ); + +HYPRE_Int +hypre_MPI_Comm_dup_flt( hypre_MPI_Comm comm, hypre_MPI_Comm *newcomm ); +HYPRE_Int +hypre_MPI_Comm_dup_dbl( hypre_MPI_Comm comm, hypre_MPI_Comm *newcomm ); +HYPRE_Int +hypre_MPI_Comm_dup_long_dbl( hypre_MPI_Comm comm, hypre_MPI_Comm *newcomm ); + +hypre_MPI_Comm +hypre_MPI_Comm_f2c_flt( hypre_int comm ); +hypre_MPI_Comm +hypre_MPI_Comm_f2c_dbl( hypre_int comm ); +hypre_MPI_Comm +hypre_MPI_Comm_f2c_long_dbl( hypre_int comm ); + +HYPRE_Int +hypre_MPI_Comm_free_flt( hypre_MPI_Comm *comm ); +HYPRE_Int +hypre_MPI_Comm_free_dbl( hypre_MPI_Comm *comm ); +HYPRE_Int +hypre_MPI_Comm_free_long_dbl( hypre_MPI_Comm *comm ); + +HYPRE_Int +hypre_MPI_Comm_group_flt( hypre_MPI_Comm comm, hypre_MPI_Group *group ); +HYPRE_Int +hypre_MPI_Comm_group_dbl( hypre_MPI_Comm comm, hypre_MPI_Group *group ); +HYPRE_Int +hypre_MPI_Comm_group_long_dbl( hypre_MPI_Comm comm, hypre_MPI_Group *group ); + +HYPRE_Int +hypre_MPI_Comm_rank_flt( hypre_MPI_Comm comm, HYPRE_Int *rank ); +HYPRE_Int +hypre_MPI_Comm_rank_dbl( hypre_MPI_Comm comm, HYPRE_Int *rank ); +HYPRE_Int +hypre_MPI_Comm_rank_long_dbl( hypre_MPI_Comm comm, HYPRE_Int *rank ); + +HYPRE_Int +hypre_MPI_Comm_size_flt( hypre_MPI_Comm comm, HYPRE_Int *size ); +HYPRE_Int +hypre_MPI_Comm_size_dbl( hypre_MPI_Comm comm, HYPRE_Int *size ); +HYPRE_Int +hypre_MPI_Comm_size_long_dbl( hypre_MPI_Comm comm, HYPRE_Int *size ); + +HYPRE_Int +hypre_MPI_Comm_split_flt( hypre_MPI_Comm comm, HYPRE_Int n, HYPRE_Int m, hypre_MPI_Comm * comms ); +HYPRE_Int +hypre_MPI_Comm_split_dbl( hypre_MPI_Comm comm, HYPRE_Int n, HYPRE_Int m, hypre_MPI_Comm * comms ); +HYPRE_Int +hypre_MPI_Comm_split_long_dbl( hypre_MPI_Comm comm, HYPRE_Int n, HYPRE_Int m, hypre_MPI_Comm * comms ); + +HYPRE_Int +hypre_MPI_Finalize_flt( void ); +HYPRE_Int +hypre_MPI_Finalize_dbl( void ); +HYPRE_Int +hypre_MPI_Finalize_long_dbl( void ); + +HYPRE_Int +hypre_MPI_Gather_flt( 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_Gather_dbl( 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_Gather_long_dbl( 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_flt( 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_Gatherv_dbl( 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_Gatherv_long_dbl( 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_Get_count_flt( hypre_MPI_Status *status, hypre_MPI_Datatype datatype, HYPRE_Int *count ); +HYPRE_Int +hypre_MPI_Get_count_dbl( hypre_MPI_Status *status, hypre_MPI_Datatype datatype, HYPRE_Int *count ); +HYPRE_Int +hypre_MPI_Get_count_long_dbl( hypre_MPI_Status *status, hypre_MPI_Datatype datatype, HYPRE_Int *count ); + +HYPRE_Int +hypre_MPI_Group_free_flt( hypre_MPI_Group *group ); +HYPRE_Int +hypre_MPI_Group_free_dbl( hypre_MPI_Group *group ); +HYPRE_Int +hypre_MPI_Group_free_long_dbl( hypre_MPI_Group *group ); + +HYPRE_Int +hypre_MPI_Group_incl_flt( hypre_MPI_Group group, HYPRE_Int n, HYPRE_Int *ranks, hypre_MPI_Group *newgroup ); +HYPRE_Int +hypre_MPI_Group_incl_dbl( hypre_MPI_Group group, HYPRE_Int n, HYPRE_Int *ranks, hypre_MPI_Group *newgroup ); +HYPRE_Int +hypre_MPI_Group_incl_long_dbl( hypre_MPI_Group group, HYPRE_Int n, HYPRE_Int *ranks, hypre_MPI_Group *newgroup ); + +HYPRE_Int +hypre_MPI_Init_flt( hypre_int *argc, char ***argv ); +HYPRE_Int +hypre_MPI_Init_dbl( hypre_int *argc, char ***argv ); +HYPRE_Int +hypre_MPI_Init_long_dbl( hypre_int *argc, char ***argv ); + +HYPRE_Int +hypre_MPI_Iprobe_flt( HYPRE_Int source, HYPRE_Int tag, hypre_MPI_Comm comm, HYPRE_Int *flag, hypre_MPI_Status *status ); +HYPRE_Int +hypre_MPI_Iprobe_dbl( HYPRE_Int source, HYPRE_Int tag, hypre_MPI_Comm comm, HYPRE_Int *flag, hypre_MPI_Status *status ); +HYPRE_Int +hypre_MPI_Iprobe_long_dbl( HYPRE_Int source, HYPRE_Int tag, hypre_MPI_Comm comm, HYPRE_Int *flag, hypre_MPI_Status *status ); + +HYPRE_Int +hypre_MPI_Irecv_flt( 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_Irecv_dbl( 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_Irecv_long_dbl( 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_Irsend_flt( 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_dbl( 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_long_dbl( 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_Isend_flt( 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_Isend_dbl( 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_Isend_long_dbl( 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_Op_create_flt( hypre_MPI_User_function *function, hypre_int commute, hypre_MPI_Op *op ); +HYPRE_Int +hypre_MPI_Op_create_dbl( hypre_MPI_User_function *function, hypre_int commute, hypre_MPI_Op *op ); +HYPRE_Int +hypre_MPI_Op_create_long_dbl( hypre_MPI_User_function *function, hypre_int commute, hypre_MPI_Op *op ); + +HYPRE_Int +hypre_MPI_Op_free_flt( hypre_MPI_Op *op ); +HYPRE_Int +hypre_MPI_Op_free_dbl( hypre_MPI_Op *op ); +HYPRE_Int +hypre_MPI_Op_free_long_dbl( hypre_MPI_Op *op ); + +HYPRE_Int +hypre_MPI_Probe_flt( HYPRE_Int source, HYPRE_Int tag, hypre_MPI_Comm comm, hypre_MPI_Status *status ); +HYPRE_Int +hypre_MPI_Probe_dbl( HYPRE_Int source, HYPRE_Int tag, hypre_MPI_Comm comm, hypre_MPI_Status *status ); +HYPRE_Int +hypre_MPI_Probe_long_dbl( HYPRE_Int source, HYPRE_Int tag, hypre_MPI_Comm comm, hypre_MPI_Status *status ); + +HYPRE_Int +hypre_MPI_Recv_flt( 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_Recv_dbl( 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_Recv_long_dbl( 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_Recv_init_flt( 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_dbl( 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_long_dbl( 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_Reduce_flt( 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_Reduce_dbl( 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_Reduce_long_dbl( 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_Request_free_flt( hypre_MPI_Request *request ); +HYPRE_Int +hypre_MPI_Request_free_dbl( hypre_MPI_Request *request ); +HYPRE_Int +hypre_MPI_Request_free_long_dbl( hypre_MPI_Request *request ); + +HYPRE_Int +hypre_MPI_Scan_flt( void *sendbuf, void *recvbuf, HYPRE_Int count, hypre_MPI_Datatype datatype, hypre_MPI_Op op, hypre_MPI_Comm comm ); +HYPRE_Int +hypre_MPI_Scan_dbl( void *sendbuf, void *recvbuf, HYPRE_Int count, hypre_MPI_Datatype datatype, hypre_MPI_Op op, hypre_MPI_Comm comm ); +HYPRE_Int +hypre_MPI_Scan_long_dbl( void *sendbuf, void *recvbuf, HYPRE_Int count, hypre_MPI_Datatype datatype, hypre_MPI_Op op, hypre_MPI_Comm comm ); + +HYPRE_Int +hypre_MPI_Scatter_flt( 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_Scatter_dbl( 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_Scatter_long_dbl( 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_flt( 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_Scatterv_dbl( 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_Scatterv_long_dbl( 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_Send_flt( void *buf, HYPRE_Int count, hypre_MPI_Datatype datatype, HYPRE_Int dest, HYPRE_Int tag, hypre_MPI_Comm comm ); +HYPRE_Int +hypre_MPI_Send_dbl( void *buf, HYPRE_Int count, hypre_MPI_Datatype datatype, HYPRE_Int dest, HYPRE_Int tag, hypre_MPI_Comm comm ); +HYPRE_Int +hypre_MPI_Send_long_dbl( void *buf, HYPRE_Int count, hypre_MPI_Datatype datatype, HYPRE_Int dest, HYPRE_Int tag, hypre_MPI_Comm comm ); + +HYPRE_Int +hypre_MPI_Send_init_flt( 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_Send_init_dbl( 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_Send_init_long_dbl( 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_flt( HYPRE_Int count, hypre_MPI_Request *array_of_requests ); +HYPRE_Int +hypre_MPI_Startall_dbl( HYPRE_Int count, hypre_MPI_Request *array_of_requests ); +HYPRE_Int +hypre_MPI_Startall_long_dbl( HYPRE_Int count, hypre_MPI_Request *array_of_requests ); + +HYPRE_Int +hypre_MPI_Test_flt( hypre_MPI_Request *request, HYPRE_Int *flag, hypre_MPI_Status *status ); +HYPRE_Int +hypre_MPI_Test_dbl( hypre_MPI_Request *request, HYPRE_Int *flag, hypre_MPI_Status *status ); +HYPRE_Int +hypre_MPI_Test_long_dbl( hypre_MPI_Request *request, HYPRE_Int *flag, hypre_MPI_Status *status ); + +HYPRE_Int +hypre_MPI_Testall_flt( HYPRE_Int count, hypre_MPI_Request *array_of_requests, HYPRE_Int *flag, hypre_MPI_Status *array_of_statuses ); +HYPRE_Int +hypre_MPI_Testall_dbl( HYPRE_Int count, hypre_MPI_Request *array_of_requests, HYPRE_Int *flag, hypre_MPI_Status *array_of_statuses ); +HYPRE_Int +hypre_MPI_Testall_long_dbl( HYPRE_Int count, hypre_MPI_Request *array_of_requests, HYPRE_Int *flag, hypre_MPI_Status *array_of_statuses ); + +HYPRE_Int +hypre_MPI_Type_commit_flt( hypre_MPI_Datatype *datatype ); +HYPRE_Int +hypre_MPI_Type_commit_dbl( hypre_MPI_Datatype *datatype ); +HYPRE_Int +hypre_MPI_Type_commit_long_dbl( hypre_MPI_Datatype *datatype ); + +HYPRE_Int +hypre_MPI_Type_contiguous_flt( HYPRE_Int count, hypre_MPI_Datatype oldtype, hypre_MPI_Datatype *newtype ); +HYPRE_Int +hypre_MPI_Type_contiguous_dbl( HYPRE_Int count, hypre_MPI_Datatype oldtype, hypre_MPI_Datatype *newtype ); +HYPRE_Int +hypre_MPI_Type_contiguous_long_dbl( HYPRE_Int count, hypre_MPI_Datatype oldtype, hypre_MPI_Datatype *newtype ); + +HYPRE_Int +hypre_MPI_Type_free_flt( hypre_MPI_Datatype *datatype ); +HYPRE_Int +hypre_MPI_Type_free_dbl( hypre_MPI_Datatype *datatype ); +HYPRE_Int +hypre_MPI_Type_free_long_dbl( hypre_MPI_Datatype *datatype ); + +HYPRE_Int +hypre_MPI_Type_hvector_flt( HYPRE_Int count, HYPRE_Int blocklength, hypre_MPI_Aint stride, hypre_MPI_Datatype oldtype, hypre_MPI_Datatype *newtype ); +HYPRE_Int +hypre_MPI_Type_hvector_dbl( HYPRE_Int count, HYPRE_Int blocklength, hypre_MPI_Aint stride, hypre_MPI_Datatype oldtype, hypre_MPI_Datatype *newtype ); +HYPRE_Int +hypre_MPI_Type_hvector_long_dbl( HYPRE_Int count, HYPRE_Int blocklength, hypre_MPI_Aint stride, hypre_MPI_Datatype oldtype, hypre_MPI_Datatype *newtype ); + +HYPRE_Int +hypre_MPI_Type_struct_flt( 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_struct_dbl( 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_struct_long_dbl( 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_vector_flt( HYPRE_Int count, HYPRE_Int blocklength, HYPRE_Int stride, hypre_MPI_Datatype oldtype, hypre_MPI_Datatype *newtype ); +HYPRE_Int +hypre_MPI_Type_vector_dbl( HYPRE_Int count, HYPRE_Int blocklength, HYPRE_Int stride, hypre_MPI_Datatype oldtype, hypre_MPI_Datatype *newtype ); +HYPRE_Int +hypre_MPI_Type_vector_long_dbl( HYPRE_Int count, HYPRE_Int blocklength, HYPRE_Int stride, hypre_MPI_Datatype oldtype, hypre_MPI_Datatype *newtype ); + +HYPRE_Int +hypre_MPI_Wait_flt( hypre_MPI_Request *request, hypre_MPI_Status *status ); +HYPRE_Int +hypre_MPI_Wait_dbl( hypre_MPI_Request *request, hypre_MPI_Status *status ); +HYPRE_Int +hypre_MPI_Wait_long_dbl( hypre_MPI_Request *request, hypre_MPI_Status *status ); + +HYPRE_Int +hypre_MPI_Waitall_flt( HYPRE_Int count, hypre_MPI_Request *array_of_requests, hypre_MPI_Status *array_of_statuses ); +HYPRE_Int +hypre_MPI_Waitall_dbl( HYPRE_Int count, hypre_MPI_Request *array_of_requests, hypre_MPI_Status *array_of_statuses ); +HYPRE_Int +hypre_MPI_Waitall_long_dbl( HYPRE_Int count, hypre_MPI_Request *array_of_requests, hypre_MPI_Status *array_of_statuses ); + +HYPRE_Int +hypre_MPI_Waitany_flt( HYPRE_Int count, hypre_MPI_Request *array_of_requests, HYPRE_Int *index, hypre_MPI_Status *status ); +HYPRE_Int +hypre_MPI_Waitany_dbl( HYPRE_Int count, hypre_MPI_Request *array_of_requests, HYPRE_Int *index, hypre_MPI_Status *status ); +HYPRE_Int +hypre_MPI_Waitany_long_dbl( HYPRE_Int count, hypre_MPI_Request *array_of_requests, HYPRE_Int *index, hypre_MPI_Status *status ); + +hypre_double +hypre_MPI_Wtick_flt( void ); +hypre_double +hypre_MPI_Wtick_dbl( void ); +hypre_double +hypre_MPI_Wtick_long_dbl( void ); + +hypre_double +hypre_MPI_Wtime_flt( void ); +hypre_double +hypre_MPI_Wtime_dbl( void ); +hypre_double +hypre_MPI_Wtime_long_dbl( void ); + +hypre_MatrixStatsArray* +hypre_MatrixStatsArrayCreate_flt( HYPRE_Int capacity ); +hypre_MatrixStatsArray* +hypre_MatrixStatsArrayCreate_dbl( HYPRE_Int capacity ); +hypre_MatrixStatsArray* +hypre_MatrixStatsArrayCreate_long_dbl( HYPRE_Int capacity ); + +HYPRE_Int +hypre_MatrixStatsArrayDestroy_flt( hypre_MatrixStatsArray *stats_array ); +HYPRE_Int +hypre_MatrixStatsArrayDestroy_dbl( hypre_MatrixStatsArray *stats_array ); +HYPRE_Int +hypre_MatrixStatsArrayDestroy_long_dbl( hypre_MatrixStatsArray *stats_array ); + +HYPRE_Int +hypre_MatrixStatsArrayPrint_flt( HYPRE_Int num_hierarchies, HYPRE_Int *num_levels, HYPRE_Int use_divisors, HYPRE_Int shift, const char **messages, hypre_MatrixStatsArray *stats_array ); +HYPRE_Int +hypre_MatrixStatsArrayPrint_dbl( HYPRE_Int num_hierarchies, HYPRE_Int *num_levels, HYPRE_Int use_divisors, HYPRE_Int shift, const char **messages, hypre_MatrixStatsArray *stats_array ); +HYPRE_Int +hypre_MatrixStatsArrayPrint_long_dbl( HYPRE_Int num_hierarchies, HYPRE_Int *num_levels, HYPRE_Int use_divisors, HYPRE_Int shift, const char **messages, hypre_MatrixStatsArray *stats_array ); + +hypre_MatrixStats* +hypre_MatrixStatsCreate_flt( void ); +hypre_MatrixStats* +hypre_MatrixStatsCreate_dbl( void ); +hypre_MatrixStats* +hypre_MatrixStatsCreate_long_dbl( void ); + +HYPRE_Int +hypre_MatrixStatsDestroy_flt( hypre_MatrixStats *stats ); +HYPRE_Int +hypre_MatrixStatsDestroy_dbl( hypre_MatrixStats *stats ); +HYPRE_Int +hypre_MatrixStatsDestroy_long_dbl( hypre_MatrixStats *stats ); + +void +hypre_MemPrefetch_flt( void *ptr, size_t size, HYPRE_MemoryLocation location ); +void +hypre_MemPrefetch_dbl( void *ptr, size_t size, HYPRE_MemoryLocation location ); +void +hypre_MemPrefetch_long_dbl( void *ptr, size_t size, HYPRE_MemoryLocation location ); + +void +hypre_Memcpy_flt( void *dst, void *src, size_t size, HYPRE_MemoryLocation loc_dst, HYPRE_MemoryLocation loc_src ); +void +hypre_Memcpy_dbl( void *dst, void *src, size_t size, HYPRE_MemoryLocation loc_dst, HYPRE_MemoryLocation loc_src ); +void +hypre_Memcpy_long_dbl( void *dst, void *src, size_t size, HYPRE_MemoryLocation loc_dst, HYPRE_MemoryLocation loc_src ); + +HYPRE_Int +hypre_MemoryPrintUsage_flt( MPI_Comm comm, HYPRE_Int level, const char *function, HYPRE_Int line ); +HYPRE_Int +hypre_MemoryPrintUsage_dbl( MPI_Comm comm, HYPRE_Int level, const char *function, HYPRE_Int line ); +HYPRE_Int +hypre_MemoryPrintUsage_long_dbl( MPI_Comm comm, HYPRE_Int level, const char *function, HYPRE_Int line ); + +void * +hypre_Memset_flt( void *ptr, HYPRE_Int value, size_t num, HYPRE_MemoryLocation location ); +void * +hypre_Memset_dbl( void *ptr, HYPRE_Int value, size_t num, HYPRE_MemoryLocation location ); +void * +hypre_Memset_long_dbl( void *ptr, HYPRE_Int value, size_t num, HYPRE_MemoryLocation location ); + +HYPRE_Int +hypre_PrefixSumInt_flt( HYPRE_Int nvals, HYPRE_Int *vals, HYPRE_Int *sums ); +HYPRE_Int +hypre_PrefixSumInt_dbl( HYPRE_Int nvals, HYPRE_Int *vals, HYPRE_Int *sums ); +HYPRE_Int +hypre_PrefixSumInt_long_dbl( HYPRE_Int nvals, HYPRE_Int *vals, HYPRE_Int *sums ); + +HYPRE_Int +hypre_PrintTiming_fcn_flt( const char *heading, MPI_Comm comm ); +HYPRE_Int +hypre_PrintTiming_fcn_dbl( const char *heading, MPI_Comm comm ); +HYPRE_Int +hypre_PrintTiming_fcn_long_dbl( const char *heading, MPI_Comm comm ); + +HYPRE_Real +hypre_Rand_flt( void ); +HYPRE_Real +hypre_Rand_dbl( void ); +HYPRE_Real +hypre_Rand_long_dbl( void ); + +HYPRE_Int +hypre_RandI_flt( void ); +HYPRE_Int +hypre_RandI_dbl( void ); +HYPRE_Int +hypre_RandI_long_dbl( void ); + +void * +hypre_ReAlloc_flt( void *ptr, size_t size, HYPRE_MemoryLocation location ); +void * +hypre_ReAlloc_dbl( void *ptr, size_t size, HYPRE_MemoryLocation location ); +void * +hypre_ReAlloc_long_dbl( void *ptr, size_t size, HYPRE_MemoryLocation location ); + +void * +hypre_ReAlloc_v2_flt( void *ptr, size_t old_size, size_t new_size, HYPRE_MemoryLocation location ); +void * +hypre_ReAlloc_v2_dbl( void *ptr, size_t old_size, size_t new_size, HYPRE_MemoryLocation location ); +void * +hypre_ReAlloc_v2_long_dbl( void *ptr, size_t old_size, size_t new_size, HYPRE_MemoryLocation location ); + +HYPRE_Int +hypre_RestoreLogLevel_flt( void ); +HYPRE_Int +hypre_RestoreLogLevel_dbl( void ); +HYPRE_Int +hypre_RestoreLogLevel_long_dbl( void ); + +void +hypre_SeedRand_flt( HYPRE_Int seed ); +void +hypre_SeedRand_dbl( HYPRE_Int seed ); +void +hypre_SeedRand_long_dbl( HYPRE_Int seed ); + +HYPRE_Int +hypre_SetCubMemPoolSize_flt( hypre_uint bin_growth, hypre_uint min_bin, hypre_uint max_bin, size_t max_cached_bytes ); +HYPRE_Int +hypre_SetCubMemPoolSize_dbl( hypre_uint bin_growth, hypre_uint min_bin, hypre_uint max_bin, size_t max_cached_bytes ); +HYPRE_Int +hypre_SetCubMemPoolSize_long_dbl( hypre_uint bin_growth, hypre_uint min_bin, hypre_uint max_bin, size_t max_cached_bytes ); + +HYPRE_Int +hypre_SetDevice_flt( hypre_int device_id, hypre_Handle *hypre_handle_ ); +HYPRE_Int +hypre_SetDevice_dbl( hypre_int device_id, hypre_Handle *hypre_handle_ ); +HYPRE_Int +hypre_SetDevice_long_dbl( hypre_int device_id, hypre_Handle *hypre_handle_ ); + +HYPRE_Int +hypre_SetFinalized_flt( void ); +HYPRE_Int +hypre_SetFinalized_dbl( void ); +HYPRE_Int +hypre_SetFinalized_long_dbl( void ); + +HYPRE_Int +hypre_SetGaussSeidelMethod_flt( HYPRE_Int gs_method ); +HYPRE_Int +hypre_SetGaussSeidelMethod_dbl( HYPRE_Int gs_method ); +HYPRE_Int +hypre_SetGaussSeidelMethod_long_dbl( HYPRE_Int gs_method ); + +HYPRE_Int +hypre_SetGpuAwareMPI_flt( HYPRE_Int use_gpu_aware_mpi ); +HYPRE_Int +hypre_SetGpuAwareMPI_dbl( HYPRE_Int use_gpu_aware_mpi ); +HYPRE_Int +hypre_SetGpuAwareMPI_long_dbl( HYPRE_Int use_gpu_aware_mpi ); + +HYPRE_Int +hypre_SetInitialized_flt( void ); +HYPRE_Int +hypre_SetInitialized_dbl( void ); +HYPRE_Int +hypre_SetInitialized_long_dbl( void ); + +HYPRE_Int +hypre_SetLogLevel_flt( HYPRE_Int log_level ); +HYPRE_Int +hypre_SetLogLevel_dbl( HYPRE_Int log_level ); +HYPRE_Int +hypre_SetLogLevel_long_dbl( HYPRE_Int log_level ); + +HYPRE_Int +hypre_SetLogLevelSaved_flt( HYPRE_Int log_level_saved ); +HYPRE_Int +hypre_SetLogLevelSaved_dbl( HYPRE_Int log_level_saved ); +HYPRE_Int +hypre_SetLogLevelSaved_long_dbl( HYPRE_Int log_level_saved ); + +HYPRE_Int +hypre_SetSpGemmAlgorithm_flt( HYPRE_Int value ); +HYPRE_Int +hypre_SetSpGemmAlgorithm_dbl( HYPRE_Int value ); +HYPRE_Int +hypre_SetSpGemmAlgorithm_long_dbl( HYPRE_Int value ); + +HYPRE_Int +hypre_SetSpGemmBinned_flt( HYPRE_Int value ); +HYPRE_Int +hypre_SetSpGemmBinned_dbl( HYPRE_Int value ); +HYPRE_Int +hypre_SetSpGemmBinned_long_dbl( HYPRE_Int value ); + +HYPRE_Int +hypre_SetSpGemmRownnzEstimateMethod_flt( HYPRE_Int value ); +HYPRE_Int +hypre_SetSpGemmRownnzEstimateMethod_dbl( HYPRE_Int value ); +HYPRE_Int +hypre_SetSpGemmRownnzEstimateMethod_long_dbl( HYPRE_Int value ); + +HYPRE_Int +hypre_SetSpGemmRownnzEstimateMultFactor_flt( hypre_float value ); +HYPRE_Int +hypre_SetSpGemmRownnzEstimateMultFactor_dbl( hypre_double value ); +HYPRE_Int +hypre_SetSpGemmRownnzEstimateMultFactor_long_dbl( hypre_long_double value ); + +HYPRE_Int +hypre_SetSpGemmRownnzEstimateNSamples_flt( HYPRE_Int value ); +HYPRE_Int +hypre_SetSpGemmRownnzEstimateNSamples_dbl( HYPRE_Int value ); +HYPRE_Int +hypre_SetSpGemmRownnzEstimateNSamples_long_dbl( HYPRE_Int value ); + +HYPRE_Int +hypre_SetSpGemmUseVendor_flt( HYPRE_Int use_vendor ); +HYPRE_Int +hypre_SetSpGemmUseVendor_dbl( HYPRE_Int use_vendor ); +HYPRE_Int +hypre_SetSpGemmUseVendor_long_dbl( HYPRE_Int use_vendor ); + +HYPRE_Int +hypre_SetSpMVUseVendor_flt( HYPRE_Int use_vendor ); +HYPRE_Int +hypre_SetSpMVUseVendor_dbl( HYPRE_Int use_vendor ); +HYPRE_Int +hypre_SetSpMVUseVendor_long_dbl( HYPRE_Int use_vendor ); + +HYPRE_Int +hypre_SetSpTransUseVendor_flt( HYPRE_Int use_vendor ); +HYPRE_Int +hypre_SetSpTransUseVendor_dbl( HYPRE_Int use_vendor ); +HYPRE_Int +hypre_SetSpTransUseVendor_long_dbl( HYPRE_Int use_vendor ); + +HYPRE_Int +hypre_SetUseGpuRand_flt( HYPRE_Int use_gpurand ); +HYPRE_Int +hypre_SetUseGpuRand_dbl( HYPRE_Int use_gpurand ); +HYPRE_Int +hypre_SetUseGpuRand_long_dbl( HYPRE_Int use_gpurand ); + +HYPRE_Int +hypre_SetUserDeviceMalloc_flt( GPUMallocFunc func ); +HYPRE_Int +hypre_SetUserDeviceMalloc_dbl( GPUMallocFunc func ); +HYPRE_Int +hypre_SetUserDeviceMalloc_long_dbl( GPUMallocFunc func ); + +HYPRE_Int +hypre_SetUserDeviceMfree_flt( GPUMfreeFunc func ); +HYPRE_Int +hypre_SetUserDeviceMfree_dbl( GPUMfreeFunc func ); +HYPRE_Int +hypre_SetUserDeviceMfree_long_dbl( GPUMfreeFunc func ); + +HYPRE_Int +hypre_UniqueIntArrayND_flt( HYPRE_Int ndim, HYPRE_Int *size, HYPRE_Int **array ); +HYPRE_Int +hypre_UniqueIntArrayND_dbl( HYPRE_Int ndim, HYPRE_Int *size, HYPRE_Int **array ); +HYPRE_Int +hypre_UniqueIntArrayND_long_dbl( HYPRE_Int ndim, HYPRE_Int *size, HYPRE_Int **array ); + +void +hypre_UnorderedBigIntMapCreate_flt( hypre_UnorderedBigIntMap *m, HYPRE_Int inCapacity, HYPRE_Int concurrencyLevel ); +void +hypre_UnorderedBigIntMapCreate_dbl( hypre_UnorderedBigIntMap *m, HYPRE_Int inCapacity, HYPRE_Int concurrencyLevel ); +void +hypre_UnorderedBigIntMapCreate_long_dbl( hypre_UnorderedBigIntMap *m, HYPRE_Int inCapacity, HYPRE_Int concurrencyLevel ); + +void +hypre_UnorderedBigIntMapDestroy_flt( hypre_UnorderedBigIntMap *m ); +void +hypre_UnorderedBigIntMapDestroy_dbl( hypre_UnorderedBigIntMap *m ); +void +hypre_UnorderedBigIntMapDestroy_long_dbl( hypre_UnorderedBigIntMap *m ); + +HYPRE_BigInt * +hypre_UnorderedBigIntSetCopyToArray_flt( hypre_UnorderedBigIntSet *s, HYPRE_Int *len ); +HYPRE_BigInt * +hypre_UnorderedBigIntSetCopyToArray_dbl( hypre_UnorderedBigIntSet *s, HYPRE_Int *len ); +HYPRE_BigInt * +hypre_UnorderedBigIntSetCopyToArray_long_dbl( hypre_UnorderedBigIntSet *s, HYPRE_Int *len ); + +void +hypre_UnorderedBigIntSetCreate_flt( hypre_UnorderedBigIntSet *s, HYPRE_Int inCapacity, HYPRE_Int concurrencyLevel ); +void +hypre_UnorderedBigIntSetCreate_dbl( hypre_UnorderedBigIntSet *s, HYPRE_Int inCapacity, HYPRE_Int concurrencyLevel ); +void +hypre_UnorderedBigIntSetCreate_long_dbl( hypre_UnorderedBigIntSet *s, HYPRE_Int inCapacity, HYPRE_Int concurrencyLevel ); + +void +hypre_UnorderedBigIntSetDestroy_flt( hypre_UnorderedBigIntSet *s ); +void +hypre_UnorderedBigIntSetDestroy_dbl( hypre_UnorderedBigIntSet *s ); +void +hypre_UnorderedBigIntSetDestroy_long_dbl( hypre_UnorderedBigIntSet *s ); + +void +hypre_UnorderedIntMapCreate_flt( hypre_UnorderedIntMap *m, HYPRE_Int inCapacity, HYPRE_Int concurrencyLevel ); +void +hypre_UnorderedIntMapCreate_dbl( hypre_UnorderedIntMap *m, HYPRE_Int inCapacity, HYPRE_Int concurrencyLevel ); +void +hypre_UnorderedIntMapCreate_long_dbl( hypre_UnorderedIntMap *m, HYPRE_Int inCapacity, HYPRE_Int concurrencyLevel ); + +void +hypre_UnorderedIntMapDestroy_flt( hypre_UnorderedIntMap *m ); +void +hypre_UnorderedIntMapDestroy_dbl( hypre_UnorderedIntMap *m ); +void +hypre_UnorderedIntMapDestroy_long_dbl( hypre_UnorderedIntMap *m ); + +HYPRE_Int * +hypre_UnorderedIntSetCopyToArray_flt( hypre_UnorderedIntSet *s, HYPRE_Int *len ); +HYPRE_Int * +hypre_UnorderedIntSetCopyToArray_dbl( hypre_UnorderedIntSet *s, HYPRE_Int *len ); +HYPRE_Int * +hypre_UnorderedIntSetCopyToArray_long_dbl( hypre_UnorderedIntSet *s, HYPRE_Int *len ); + +void +hypre_UnorderedIntSetCreate_flt( hypre_UnorderedIntSet *s, HYPRE_Int inCapacity, HYPRE_Int concurrencyLevel ); +void +hypre_UnorderedIntSetCreate_dbl( hypre_UnorderedIntSet *s, HYPRE_Int inCapacity, HYPRE_Int concurrencyLevel ); +void +hypre_UnorderedIntSetCreate_long_dbl( hypre_UnorderedIntSet *s, HYPRE_Int inCapacity, HYPRE_Int concurrencyLevel ); + +void +hypre_UnorderedIntSetDestroy_flt( hypre_UnorderedIntSet *s ); +void +hypre_UnorderedIntSetDestroy_dbl( hypre_UnorderedIntSet *s ); +void +hypre_UnorderedIntSetDestroy_long_dbl( hypre_UnorderedIntSet *s ); + +void +hypre__Free_flt( void *ptr, hypre_MemoryLocation location ); +void +hypre__Free_dbl( void *ptr, hypre_MemoryLocation location ); +void +hypre__Free_long_dbl( void *ptr, hypre_MemoryLocation location ); + +void * +hypre__MAlloc_flt( size_t size, hypre_MemoryLocation location ); +void * +hypre__MAlloc_dbl( size_t size, hypre_MemoryLocation location ); +void * +hypre__MAlloc_long_dbl( size_t size, hypre_MemoryLocation location ); + +void +hypre_big_merge_sort_flt( HYPRE_BigInt *in, HYPRE_BigInt *temp, HYPRE_Int len, HYPRE_BigInt **sorted ); +void +hypre_big_merge_sort_dbl( HYPRE_BigInt *in, HYPRE_BigInt *temp, HYPRE_Int len, HYPRE_BigInt **sorted ); +void +hypre_big_merge_sort_long_dbl( HYPRE_BigInt *in, HYPRE_BigInt *temp, HYPRE_Int len, HYPRE_BigInt **sorted ); + +void +hypre_big_sort_and_create_inverse_map_flt( HYPRE_BigInt *in, HYPRE_Int len, HYPRE_BigInt **out, hypre_UnorderedBigIntMap *inverse_map ); +void +hypre_big_sort_and_create_inverse_map_dbl( HYPRE_BigInt *in, HYPRE_Int len, HYPRE_BigInt **out, hypre_UnorderedBigIntMap *inverse_map ); +void +hypre_big_sort_and_create_inverse_map_long_dbl( HYPRE_BigInt *in, HYPRE_Int len, HYPRE_BigInt **out, hypre_UnorderedBigIntMap *inverse_map ); + +HYPRE_Int +hypre_bind_device_flt( HYPRE_Int myid, HYPRE_Int nproc, MPI_Comm comm ); +HYPRE_Int +hypre_bind_device_dbl( HYPRE_Int myid, HYPRE_Int nproc, MPI_Comm comm ); +HYPRE_Int +hypre_bind_device_long_dbl( HYPRE_Int myid, HYPRE_Int nproc, MPI_Comm comm ); + +HYPRE_Int +hypre_bind_device_id_flt( HYPRE_Int device_id_in, HYPRE_Int myid, HYPRE_Int nproc, MPI_Comm comm ); +HYPRE_Int +hypre_bind_device_id_dbl( HYPRE_Int device_id_in, HYPRE_Int myid, HYPRE_Int nproc, MPI_Comm comm ); +HYPRE_Int +hypre_bind_device_id_long_dbl( HYPRE_Int device_id_in, HYPRE_Int myid, HYPRE_Int nproc, MPI_Comm comm ); + +hypre_LinkList +hypre_create_elt_flt( HYPRE_Int Item ); +hypre_LinkList +hypre_create_elt_dbl( HYPRE_Int Item ); +hypre_LinkList +hypre_create_elt_long_dbl( HYPRE_Int Item ); + +void +hypre_dense_topo_sort_flt( const hypre_float *L, HYPRE_Int *ordering, HYPRE_Int n, HYPRE_Int is_col_major ); +void +hypre_dense_topo_sort_dbl( const hypre_double *L, HYPRE_Int *ordering, HYPRE_Int n, HYPRE_Int is_col_major ); +void +hypre_dense_topo_sort_long_dbl( const hypre_long_double *L, HYPRE_Int *ordering, HYPRE_Int n, HYPRE_Int is_col_major ); + +void +hypre_dispose_elt_flt( hypre_LinkList element_ptr ); +void +hypre_dispose_elt_dbl( hypre_LinkList element_ptr ); +void +hypre_dispose_elt_long_dbl( hypre_LinkList element_ptr ); + +void +hypre_enter_on_lists_flt( 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_dbl( 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_long_dbl( hypre_LinkList *LoL_head_ptr, hypre_LinkList *LoL_tail_ptr, HYPRE_Int measure, HYPRE_Int index, HYPRE_Int *lists, HYPRE_Int *where ); + +void +hypre_error_code_restore_flt( void ); +void +hypre_error_code_restore_dbl( void ); +void +hypre_error_code_restore_long_dbl( void ); + +void +hypre_error_code_save_flt( void ); +void +hypre_error_code_save_dbl( void ); +void +hypre_error_code_save_long_dbl( void ); + +void +hypre_error_handler_flt( const char *filename, HYPRE_Int line, HYPRE_Int ierr, const char *msg ); +void +hypre_error_handler_dbl( const char *filename, HYPRE_Int line, HYPRE_Int ierr, const char *msg ); +void +hypre_error_handler_long_dbl( const char *filename, HYPRE_Int line, HYPRE_Int ierr, const char *msg ); + +void +hypre_error_handler_clear_messages_flt( void ); +void +hypre_error_handler_clear_messages_dbl( void ); +void +hypre_error_handler_clear_messages_long_dbl( void ); + +hypre_Handle* +hypre_handle_flt( void ); +hypre_Handle* +hypre_handle_dbl( void ); +hypre_Handle* +hypre_handle_long_dbl( void ); + +void +hypre_merge_sort_flt( HYPRE_Int *in, HYPRE_Int *temp, HYPRE_Int len, HYPRE_Int **sorted ); +void +hypre_merge_sort_dbl( HYPRE_Int *in, HYPRE_Int *temp, HYPRE_Int len, HYPRE_Int **sorted ); +void +hypre_merge_sort_long_dbl( HYPRE_Int *in, HYPRE_Int *temp, HYPRE_Int len, HYPRE_Int **sorted ); + +HYPRE_Int +hypre_mm_is_valid_flt( MM_typecode matcode ); +HYPRE_Int +hypre_mm_is_valid_dbl( MM_typecode matcode ); +HYPRE_Int +hypre_mm_is_valid_long_dbl( MM_typecode matcode ); + +HYPRE_Int +hypre_mm_read_banner_flt( FILE *f, MM_typecode *matcode ); +HYPRE_Int +hypre_mm_read_banner_dbl( FILE *f, MM_typecode *matcode ); +HYPRE_Int +hypre_mm_read_banner_long_dbl( FILE *f, MM_typecode *matcode ); + +HYPRE_Int +hypre_mm_read_mtx_crd_size_flt( FILE *f, HYPRE_Int *M, HYPRE_Int *N, HYPRE_Int *nz ); +HYPRE_Int +hypre_mm_read_mtx_crd_size_dbl( FILE *f, HYPRE_Int *M, HYPRE_Int *N, HYPRE_Int *nz ); +HYPRE_Int +hypre_mm_read_mtx_crd_size_long_dbl( FILE *f, HYPRE_Int *M, HYPRE_Int *N, HYPRE_Int *nz ); + +HYPRE_Int +hypre_multmod_flt( HYPRE_Int a, HYPRE_Int b, HYPRE_Int mod ); +HYPRE_Int +hypre_multmod_dbl( HYPRE_Int a, HYPRE_Int b, HYPRE_Int mod ); +HYPRE_Int +hypre_multmod_long_dbl( HYPRE_Int a, HYPRE_Int b, HYPRE_Int mod ); + +void +hypre_partition1D_flt( HYPRE_Int n, HYPRE_Int p, HYPRE_Int j, HYPRE_Int *s, HYPRE_Int *e ); +void +hypre_partition1D_dbl( HYPRE_Int n, HYPRE_Int p, HYPRE_Int j, HYPRE_Int *s, HYPRE_Int *e ); +void +hypre_partition1D_long_dbl( HYPRE_Int n, HYPRE_Int p, HYPRE_Int j, HYPRE_Int *s, HYPRE_Int *e ); + +HYPRE_Int +hypre_prefix_sum_flt( HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int *workspace ); +HYPRE_Int +hypre_prefix_sum_dbl( HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int *workspace ); +HYPRE_Int +hypre_prefix_sum_long_dbl( HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int *workspace ); + +HYPRE_Int +hypre_prefix_sum_multiple_flt( HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int n, HYPRE_Int *workspace ); +HYPRE_Int +hypre_prefix_sum_multiple_dbl( HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int n, HYPRE_Int *workspace ); +HYPRE_Int +hypre_prefix_sum_multiple_long_dbl( HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int n, HYPRE_Int *workspace ); + +HYPRE_Int +hypre_prefix_sum_pair_flt( HYPRE_Int *in_out1, HYPRE_Int *sum1, HYPRE_Int *in_out2, HYPRE_Int *sum2, HYPRE_Int *workspace ); +HYPRE_Int +hypre_prefix_sum_pair_dbl( HYPRE_Int *in_out1, HYPRE_Int *sum1, HYPRE_Int *in_out2, HYPRE_Int *sum2, HYPRE_Int *workspace ); +HYPRE_Int +hypre_prefix_sum_pair_long_dbl( HYPRE_Int *in_out1, HYPRE_Int *sum1, HYPRE_Int *in_out2, HYPRE_Int *sum2, HYPRE_Int *workspace ); + +HYPRE_Int +hypre_prefix_sum_triple_flt( HYPRE_Int *in_out1, HYPRE_Int *sum1, HYPRE_Int *in_out2, HYPRE_Int *sum2, HYPRE_Int *in_out3, HYPRE_Int *sum3, HYPRE_Int *workspace ); +HYPRE_Int +hypre_prefix_sum_triple_dbl( HYPRE_Int *in_out1, HYPRE_Int *sum1, HYPRE_Int *in_out2, HYPRE_Int *sum2, HYPRE_Int *in_out3, HYPRE_Int *sum3, HYPRE_Int *workspace ); +HYPRE_Int +hypre_prefix_sum_triple_long_dbl( 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_qsort0_flt( HYPRE_Int *v, HYPRE_Int left, HYPRE_Int right ); +void +hypre_qsort0_dbl( HYPRE_Int *v, HYPRE_Int left, HYPRE_Int right ); +void +hypre_qsort0_long_dbl( HYPRE_Int *v, HYPRE_Int left, HYPRE_Int right ); + +void +hypre_qsort1_flt( HYPRE_Int *v, hypre_float *w, HYPRE_Int left, HYPRE_Int right ); +void +hypre_qsort1_dbl( HYPRE_Int *v, hypre_double *w, HYPRE_Int left, HYPRE_Int right ); +void +hypre_qsort1_long_dbl( HYPRE_Int *v, hypre_long_double *w, HYPRE_Int left, HYPRE_Int right ); + +void +hypre_qsort2_flt( HYPRE_Int *v, hypre_float *w, HYPRE_Int left, HYPRE_Int right ); +void +hypre_qsort2_dbl( HYPRE_Int *v, hypre_double *w, HYPRE_Int left, HYPRE_Int right ); +void +hypre_qsort2_long_dbl( HYPRE_Int *v, hypre_long_double *w, HYPRE_Int left, HYPRE_Int right ); + +void +hypre_qsort2_abs_flt( HYPRE_Int *v, hypre_float *w, HYPRE_Int left, HYPRE_Int right ); +void +hypre_qsort2_abs_dbl( HYPRE_Int *v, hypre_double *w, HYPRE_Int left, HYPRE_Int right ); +void +hypre_qsort2_abs_long_dbl( HYPRE_Int *v, hypre_long_double *w, HYPRE_Int left, HYPRE_Int right ); + +void +hypre_qsort2i_flt( HYPRE_Int *v, HYPRE_Int *w, HYPRE_Int left, HYPRE_Int right ); +void +hypre_qsort2i_dbl( HYPRE_Int *v, HYPRE_Int *w, HYPRE_Int left, HYPRE_Int right ); +void +hypre_qsort2i_long_dbl( HYPRE_Int *v, HYPRE_Int *w, HYPRE_Int left, HYPRE_Int right ); + +void +hypre_qsort3_flt( hypre_float *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int left, HYPRE_Int right ); +void +hypre_qsort3_dbl( hypre_double *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int left, HYPRE_Int right ); +void +hypre_qsort3_long_dbl( hypre_long_double *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int left, HYPRE_Int right ); + +void +hypre_qsort3_abs_flt( hypre_float *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int left, HYPRE_Int right ); +void +hypre_qsort3_abs_dbl( hypre_double *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int left, HYPRE_Int right ); +void +hypre_qsort3_abs_long_dbl( hypre_long_double *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int left, HYPRE_Int right ); + +void +hypre_qsort3i_flt( HYPRE_Int *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int left, HYPRE_Int right ); +void +hypre_qsort3i_dbl( HYPRE_Int *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int left, HYPRE_Int right ); +void +hypre_qsort3i_long_dbl( HYPRE_Int *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int left, HYPRE_Int right ); + +void +hypre_qsort3ir_flt( HYPRE_Int *v, hypre_float *w, HYPRE_Int *z, HYPRE_Int left, HYPRE_Int right ); +void +hypre_qsort3ir_dbl( HYPRE_Int *v, hypre_double *w, HYPRE_Int *z, HYPRE_Int left, HYPRE_Int right ); +void +hypre_qsort3ir_long_dbl( HYPRE_Int *v, hypre_long_double *w, HYPRE_Int *z, HYPRE_Int left, HYPRE_Int right ); + +void +hypre_qsortND_flt( HYPRE_Int **v, HYPRE_Int ndim, HYPRE_Int left, HYPRE_Int right ); +void +hypre_qsortND_dbl( HYPRE_Int **v, HYPRE_Int ndim, HYPRE_Int left, HYPRE_Int right ); +void +hypre_qsortND_long_dbl( HYPRE_Int **v, HYPRE_Int ndim, HYPRE_Int left, HYPRE_Int right ); + +void +hypre_qsort_abs_flt( hypre_float *w, HYPRE_Int left, HYPRE_Int right ); +void +hypre_qsort_abs_dbl( hypre_double *w, HYPRE_Int left, HYPRE_Int right ); +void +hypre_qsort_abs_long_dbl( hypre_long_double *w, HYPRE_Int left, HYPRE_Int right ); + +void +hypre_remove_point_flt( 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_dbl( 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_long_dbl( hypre_LinkList *LoL_head_ptr, hypre_LinkList *LoL_tail_ptr, HYPRE_Int measure, HYPRE_Int index, HYPRE_Int *lists, HYPRE_Int *where ); + +char * +hypre_strcpy_flt( char *destination, const char *source ); +char * +hypre_strcpy_dbl( char *destination, const char *source ); +char * +hypre_strcpy_long_dbl( char *destination, const char *source ); + +void +hypre_swap_flt( HYPRE_Int *v, HYPRE_Int i, HYPRE_Int j ); +void +hypre_swap_dbl( HYPRE_Int *v, HYPRE_Int i, HYPRE_Int j ); +void +hypre_swap_long_dbl( HYPRE_Int *v, HYPRE_Int i, HYPRE_Int j ); + +void +hypre_swap2_flt( HYPRE_Int *v, hypre_float *w, HYPRE_Int i, HYPRE_Int j ); +void +hypre_swap2_dbl( HYPRE_Int *v, hypre_double *w, HYPRE_Int i, HYPRE_Int j ); +void +hypre_swap2_long_dbl( HYPRE_Int *v, hypre_long_double *w, HYPRE_Int i, HYPRE_Int j ); + +void +hypre_swap2i_flt( HYPRE_Int *v, HYPRE_Int *w, HYPRE_Int i, HYPRE_Int j ); +void +hypre_swap2i_dbl( HYPRE_Int *v, HYPRE_Int *w, HYPRE_Int i, HYPRE_Int j ); +void +hypre_swap2i_long_dbl( HYPRE_Int *v, HYPRE_Int *w, HYPRE_Int i, HYPRE_Int j ); + +void +hypre_swap3_d_flt( hypre_float *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int i, HYPRE_Int j ); +void +hypre_swap3_d_dbl( hypre_double *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int i, HYPRE_Int j ); +void +hypre_swap3_d_long_dbl( hypre_long_double *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int i, HYPRE_Int j ); + +void +hypre_swap3_d_perm_flt( HYPRE_Int *v, hypre_float *w, HYPRE_Int *z, HYPRE_Int i, HYPRE_Int j ); +void +hypre_swap3_d_perm_dbl( HYPRE_Int *v, hypre_double *w, HYPRE_Int *z, HYPRE_Int i, HYPRE_Int j ); +void +hypre_swap3_d_perm_long_dbl( HYPRE_Int *v, hypre_long_double *w, HYPRE_Int *z, HYPRE_Int i, HYPRE_Int j ); + +void +hypre_swap3i_flt( HYPRE_Int *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int i, HYPRE_Int j ); +void +hypre_swap3i_dbl( HYPRE_Int *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int i, HYPRE_Int j ); +void +hypre_swap3i_long_dbl( HYPRE_Int *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int i, HYPRE_Int j ); + +void +hypre_swap_c_flt( hypre_float *v, HYPRE_Int i, HYPRE_Int j ); +void +hypre_swap_c_dbl( hypre_double *v, HYPRE_Int i, HYPRE_Int j ); +void +hypre_swap_c_long_dbl( hypre_long_double *v, HYPRE_Int i, HYPRE_Int j ); + +void +hypre_swap_d_flt( hypre_float *v, HYPRE_Int i, HYPRE_Int j ); +void +hypre_swap_d_dbl( hypre_double *v, HYPRE_Int i, HYPRE_Int j ); +void +hypre_swap_d_long_dbl( hypre_long_double *v, HYPRE_Int i, HYPRE_Int j ); + +void +hypre_topo_sort_flt( const HYPRE_Int *row_ptr, const HYPRE_Int *col_inds, const hypre_float *data, HYPRE_Int *ordering, HYPRE_Int n ); +void +hypre_topo_sort_dbl( const HYPRE_Int *row_ptr, const HYPRE_Int *col_inds, const hypre_double *data, HYPRE_Int *ordering, HYPRE_Int n ); +void +hypre_topo_sort_long_dbl( const HYPRE_Int *row_ptr, const HYPRE_Int *col_inds, const hypre_long_double *data, HYPRE_Int *ordering, HYPRE_Int n ); + +void +hypre_union2_flt( 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_union2_dbl( 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_union2_long_dbl( 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_Real +time_getCPUSeconds_flt( void ); +HYPRE_Real +time_getCPUSeconds_dbl( void ); +HYPRE_Real +time_getCPUSeconds_long_dbl( void ); + +HYPRE_Real +time_getWallclockSeconds_flt( void ); +HYPRE_Real +time_getWallclockSeconds_dbl( void ); +HYPRE_Real +time_getWallclockSeconds_long_dbl( void ); + +void +utilities_FortranMatrixAdd_flt( hypre_float a, utilities_FortranMatrix* mtxA, utilities_FortranMatrix* mtxB, utilities_FortranMatrix* mtxC ); +void +utilities_FortranMatrixAdd_dbl( hypre_double a, utilities_FortranMatrix* mtxA, utilities_FortranMatrix* mtxB, utilities_FortranMatrix* mtxC ); +void +utilities_FortranMatrixAdd_long_dbl( hypre_long_double a, utilities_FortranMatrix* mtxA, utilities_FortranMatrix* mtxB, utilities_FortranMatrix* mtxC ); + +void +utilities_FortranMatrixAllocateData_flt( HYPRE_BigInt h, HYPRE_BigInt w, utilities_FortranMatrix* mtx ); +void +utilities_FortranMatrixAllocateData_dbl( HYPRE_BigInt h, HYPRE_BigInt w, utilities_FortranMatrix* mtx ); +void +utilities_FortranMatrixAllocateData_long_dbl( HYPRE_BigInt h, HYPRE_BigInt w, utilities_FortranMatrix* mtx ); + +void +utilities_FortranMatrixClear_flt( utilities_FortranMatrix* mtx ); +void +utilities_FortranMatrixClear_dbl( utilities_FortranMatrix* mtx ); +void +utilities_FortranMatrixClear_long_dbl( utilities_FortranMatrix* mtx ); + +void +utilities_FortranMatrixClearL_flt( utilities_FortranMatrix* mtx ); +void +utilities_FortranMatrixClearL_dbl( utilities_FortranMatrix* mtx ); +void +utilities_FortranMatrixClearL_long_dbl( utilities_FortranMatrix* mtx ); + +void +utilities_FortranMatrixCopy_flt( utilities_FortranMatrix* src, HYPRE_Int t, utilities_FortranMatrix* dest ); +void +utilities_FortranMatrixCopy_dbl( utilities_FortranMatrix* src, HYPRE_Int t, utilities_FortranMatrix* dest ); +void +utilities_FortranMatrixCopy_long_dbl( utilities_FortranMatrix* src, HYPRE_Int t, utilities_FortranMatrix* dest ); + +utilities_FortranMatrix* +utilities_FortranMatrixCreate_flt( void ); +utilities_FortranMatrix* +utilities_FortranMatrixCreate_dbl( void ); +utilities_FortranMatrix* +utilities_FortranMatrixCreate_long_dbl( void ); + +void +utilities_FortranMatrixDMultiply_flt( utilities_FortranMatrix* d, utilities_FortranMatrix* mtx ); +void +utilities_FortranMatrixDMultiply_dbl( utilities_FortranMatrix* d, utilities_FortranMatrix* mtx ); +void +utilities_FortranMatrixDMultiply_long_dbl( utilities_FortranMatrix* d, utilities_FortranMatrix* mtx ); + +void +utilities_FortranMatrixDestroy_flt( utilities_FortranMatrix* mtx ); +void +utilities_FortranMatrixDestroy_dbl( utilities_FortranMatrix* mtx ); +void +utilities_FortranMatrixDestroy_long_dbl( utilities_FortranMatrix* mtx ); + +HYPRE_Real +utilities_FortranMatrixFNorm_flt( utilities_FortranMatrix* mtx ); +HYPRE_Real +utilities_FortranMatrixFNorm_dbl( utilities_FortranMatrix* mtx ); +HYPRE_Real +utilities_FortranMatrixFNorm_long_dbl( utilities_FortranMatrix* mtx ); + +void +utilities_FortranMatrixGetDiagonal_flt( utilities_FortranMatrix* mtx, utilities_FortranMatrix* d ); +void +utilities_FortranMatrixGetDiagonal_dbl( utilities_FortranMatrix* mtx, utilities_FortranMatrix* d ); +void +utilities_FortranMatrixGetDiagonal_long_dbl( utilities_FortranMatrix* mtx, utilities_FortranMatrix* d ); + +HYPRE_BigInt +utilities_FortranMatrixGlobalHeight_flt( utilities_FortranMatrix* mtx ); +HYPRE_BigInt +utilities_FortranMatrixGlobalHeight_dbl( utilities_FortranMatrix* mtx ); +HYPRE_BigInt +utilities_FortranMatrixGlobalHeight_long_dbl( utilities_FortranMatrix* mtx ); + +HYPRE_BigInt +utilities_FortranMatrixHeight_flt( utilities_FortranMatrix* mtx ); +HYPRE_BigInt +utilities_FortranMatrixHeight_dbl( utilities_FortranMatrix* mtx ); +HYPRE_BigInt +utilities_FortranMatrixHeight_long_dbl( utilities_FortranMatrix* mtx ); + +void +utilities_FortranMatrixIndexCopy_flt( HYPRE_Int* index, utilities_FortranMatrix* src, HYPRE_Int t, utilities_FortranMatrix* dest ); +void +utilities_FortranMatrixIndexCopy_dbl( HYPRE_Int* index, utilities_FortranMatrix* src, HYPRE_Int t, utilities_FortranMatrix* dest ); +void +utilities_FortranMatrixIndexCopy_long_dbl( HYPRE_Int* index, utilities_FortranMatrix* src, HYPRE_Int t, utilities_FortranMatrix* dest ); + +HYPRE_Real +utilities_FortranMatrixMaxValue_flt( utilities_FortranMatrix* mtx ); +HYPRE_Real +utilities_FortranMatrixMaxValue_dbl( utilities_FortranMatrix* mtx ); +HYPRE_Real +utilities_FortranMatrixMaxValue_long_dbl( utilities_FortranMatrix* mtx ); + +void +utilities_FortranMatrixMultiply_flt( utilities_FortranMatrix* mtxA, HYPRE_Int tA, utilities_FortranMatrix* mtxB, HYPRE_Int tB, utilities_FortranMatrix* mtxC ); +void +utilities_FortranMatrixMultiply_dbl( utilities_FortranMatrix* mtxA, HYPRE_Int tA, utilities_FortranMatrix* mtxB, HYPRE_Int tB, utilities_FortranMatrix* mtxC ); +void +utilities_FortranMatrixMultiply_long_dbl( utilities_FortranMatrix* mtxA, HYPRE_Int tA, utilities_FortranMatrix* mtxB, HYPRE_Int tB, utilities_FortranMatrix* mtxC ); + +void +utilities_FortranMatrixMultiplyD_flt( utilities_FortranMatrix* mtx, utilities_FortranMatrix* d ); +void +utilities_FortranMatrixMultiplyD_dbl( utilities_FortranMatrix* mtx, utilities_FortranMatrix* d ); +void +utilities_FortranMatrixMultiplyD_long_dbl( utilities_FortranMatrix* mtx, utilities_FortranMatrix* d ); + +HYPRE_Int +utilities_FortranMatrixPrint_flt( utilities_FortranMatrix* mtx, const char *fileName ); +HYPRE_Int +utilities_FortranMatrixPrint_dbl( utilities_FortranMatrix* mtx, const char *fileName ); +HYPRE_Int +utilities_FortranMatrixPrint_long_dbl( utilities_FortranMatrix* mtx, const char *fileName ); + +void +utilities_FortranMatrixSelectBlock_flt( utilities_FortranMatrix* mtx, HYPRE_BigInt iFrom, HYPRE_BigInt iTo, HYPRE_BigInt jFrom, HYPRE_BigInt jTo, utilities_FortranMatrix* block ); +void +utilities_FortranMatrixSelectBlock_dbl( utilities_FortranMatrix* mtx, HYPRE_BigInt iFrom, HYPRE_BigInt iTo, HYPRE_BigInt jFrom, HYPRE_BigInt jTo, utilities_FortranMatrix* block ); +void +utilities_FortranMatrixSelectBlock_long_dbl( utilities_FortranMatrix* mtx, HYPRE_BigInt iFrom, HYPRE_BigInt iTo, HYPRE_BigInt jFrom, HYPRE_BigInt jTo, utilities_FortranMatrix* block ); + +void +utilities_FortranMatrixSetDiagonal_flt( utilities_FortranMatrix* mtx, utilities_FortranMatrix* d ); +void +utilities_FortranMatrixSetDiagonal_dbl( utilities_FortranMatrix* mtx, utilities_FortranMatrix* d ); +void +utilities_FortranMatrixSetDiagonal_long_dbl( utilities_FortranMatrix* mtx, utilities_FortranMatrix* d ); + +void +utilities_FortranMatrixSetToIdentity_flt( utilities_FortranMatrix* mtx ); +void +utilities_FortranMatrixSetToIdentity_dbl( utilities_FortranMatrix* mtx ); +void +utilities_FortranMatrixSetToIdentity_long_dbl( utilities_FortranMatrix* mtx ); + +void +utilities_FortranMatrixSymmetrize_flt( utilities_FortranMatrix* mtx ); +void +utilities_FortranMatrixSymmetrize_dbl( utilities_FortranMatrix* mtx ); +void +utilities_FortranMatrixSymmetrize_long_dbl( utilities_FortranMatrix* mtx ); + +void +utilities_FortranMatrixTransposeSquare_flt( utilities_FortranMatrix* mtx ); +void +utilities_FortranMatrixTransposeSquare_dbl( utilities_FortranMatrix* mtx ); +void +utilities_FortranMatrixTransposeSquare_long_dbl( utilities_FortranMatrix* mtx ); + +void +utilities_FortranMatrixUpperInv_flt( utilities_FortranMatrix* u ); +void +utilities_FortranMatrixUpperInv_dbl( utilities_FortranMatrix* u ); +void +utilities_FortranMatrixUpperInv_long_dbl( utilities_FortranMatrix* u ); + +HYPRE_Real +utilities_FortranMatrixValue_flt( utilities_FortranMatrix* mtx, HYPRE_BigInt i, HYPRE_BigInt j ); +HYPRE_Real +utilities_FortranMatrixValue_dbl( utilities_FortranMatrix* mtx, HYPRE_BigInt i, HYPRE_BigInt j ); +HYPRE_Real +utilities_FortranMatrixValue_long_dbl( utilities_FortranMatrix* mtx, HYPRE_BigInt i, HYPRE_BigInt j ); + +HYPRE_Real* +utilities_FortranMatrixValuePtr_flt( utilities_FortranMatrix* mtx, HYPRE_BigInt i, HYPRE_BigInt j ); +HYPRE_Real* +utilities_FortranMatrixValuePtr_dbl( utilities_FortranMatrix* mtx, HYPRE_BigInt i, HYPRE_BigInt j ); +HYPRE_Real* +utilities_FortranMatrixValuePtr_long_dbl( utilities_FortranMatrix* mtx, HYPRE_BigInt i, HYPRE_BigInt j ); + +HYPRE_Real* +utilities_FortranMatrixValues_flt( utilities_FortranMatrix* mtx ); +HYPRE_Real* +utilities_FortranMatrixValues_dbl( utilities_FortranMatrix* mtx ); +HYPRE_Real* +utilities_FortranMatrixValues_long_dbl( utilities_FortranMatrix* mtx ); + +HYPRE_BigInt +utilities_FortranMatrixWidth_flt( utilities_FortranMatrix* mtx ); +HYPRE_BigInt +utilities_FortranMatrixWidth_dbl( utilities_FortranMatrix* mtx ); +HYPRE_BigInt +utilities_FortranMatrixWidth_long_dbl( utilities_FortranMatrix* mtx ); + +void +utilities_FortranMatrixWrap_flt( hypre_float* v, HYPRE_BigInt gh, HYPRE_BigInt h, HYPRE_BigInt w, utilities_FortranMatrix* mtx ); +void +utilities_FortranMatrixWrap_dbl( hypre_double* v, HYPRE_BigInt gh, HYPRE_BigInt h, HYPRE_BigInt w, utilities_FortranMatrix* mtx ); +void +utilities_FortranMatrixWrap_long_dbl( hypre_long_double* v, HYPRE_BigInt gh, HYPRE_BigInt h, HYPRE_BigInt w, utilities_FortranMatrix* mtx ); + + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + + + +#endif + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/src/utilities/_hypre_utilities_mup_def.h b/src/utilities/_hypre_utilities_mup_def.h new file mode 100644 index 0000000000..ec37cdc7ce --- /dev/null +++ b/src/utilities/_hypre_utilities_mup_def.h @@ -0,0 +1,328 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#ifndef hypre_UTILITIES_MUP_DEF_HEADER +#define hypre_UTILITIES_MUP_DEF_HEADER + +#include "_hypre_mup_def.h" + +#define HYPRE_AssumedPartitionCheck HYPRE_MULTIPRECISION_FUNC ( HYPRE_AssumedPartitionCheck ) +#define HYPRE_CheckError HYPRE_MULTIPRECISION_FUNC ( HYPRE_CheckError ) +#define HYPRE_ClearAllErrors HYPRE_MULTIPRECISION_FUNC ( HYPRE_ClearAllErrors ) +#define HYPRE_ClearError HYPRE_MULTIPRECISION_FUNC ( HYPRE_ClearError ) +#define HYPRE_ClearErrorMessages HYPRE_MULTIPRECISION_FUNC ( HYPRE_ClearErrorMessages ) +#define HYPRE_DescribeError HYPRE_MULTIPRECISION_FUNC ( HYPRE_DescribeError ) +#define HYPRE_DeviceInitialize HYPRE_MULTIPRECISION_FUNC ( HYPRE_DeviceInitialize ) +#define HYPRE_Finalize HYPRE_MULTIPRECISION_FUNC ( HYPRE_Finalize ) +#define HYPRE_Finalized HYPRE_MULTIPRECISION_FUNC ( HYPRE_Finalized ) +#define HYPRE_GetError HYPRE_MULTIPRECISION_FUNC ( HYPRE_GetError ) +#define HYPRE_GetErrorArg HYPRE_MULTIPRECISION_FUNC ( HYPRE_GetErrorArg ) +#define HYPRE_GetErrorMessages HYPRE_MULTIPRECISION_FUNC ( HYPRE_GetErrorMessages ) +#define HYPRE_GetExecutionPolicy HYPRE_MULTIPRECISION_FUNC ( HYPRE_GetExecutionPolicy ) +#define HYPRE_GetExecutionPolicyName HYPRE_MULTIPRECISION_FUNC ( HYPRE_GetExecutionPolicyName ) +#define HYPRE_GetGlobalError HYPRE_MULTIPRECISION_FUNC ( HYPRE_GetGlobalError ) +#define HYPRE_GetMemoryLocation HYPRE_MULTIPRECISION_FUNC ( HYPRE_GetMemoryLocation ) +#define HYPRE_Initialize HYPRE_MULTIPRECISION_FUNC ( HYPRE_Initialize ) +#define HYPRE_Initialized HYPRE_MULTIPRECISION_FUNC ( HYPRE_Initialized ) +#define HYPRE_MemoryPrintUsage HYPRE_MULTIPRECISION_FUNC ( HYPRE_MemoryPrintUsage ) +#define HYPRE_PrintDeviceInfo HYPRE_MULTIPRECISION_FUNC ( HYPRE_PrintDeviceInfo ) +#define HYPRE_PrintErrorMessages HYPRE_MULTIPRECISION_FUNC ( HYPRE_PrintErrorMessages ) +#define HYPRE_SetExecutionPolicy HYPRE_MULTIPRECISION_FUNC ( HYPRE_SetExecutionPolicy ) +#define HYPRE_SetGPUMemoryPoolSize HYPRE_MULTIPRECISION_FUNC ( HYPRE_SetGPUMemoryPoolSize ) +#define HYPRE_SetGpuAwareMPI HYPRE_MULTIPRECISION_FUNC ( HYPRE_SetGpuAwareMPI ) +#define HYPRE_SetLogLevel HYPRE_MULTIPRECISION_FUNC ( HYPRE_SetLogLevel ) +#define HYPRE_SetMemoryLocation HYPRE_MULTIPRECISION_FUNC ( HYPRE_SetMemoryLocation ) +#define HYPRE_SetPrintErrorMode HYPRE_MULTIPRECISION_FUNC ( HYPRE_SetPrintErrorMode ) +#define HYPRE_SetPrintErrorVerbosity HYPRE_MULTIPRECISION_FUNC ( HYPRE_SetPrintErrorVerbosity ) +#define HYPRE_SetSpGemmUseVendor HYPRE_MULTIPRECISION_FUNC ( HYPRE_SetSpGemmUseVendor ) +#define HYPRE_SetSpMVUseVendor HYPRE_MULTIPRECISION_FUNC ( HYPRE_SetSpMVUseVendor ) +#define HYPRE_SetSpTransUseVendor HYPRE_MULTIPRECISION_FUNC ( HYPRE_SetSpTransUseVendor ) +#define HYPRE_SetUseGpuRand HYPRE_MULTIPRECISION_FUNC ( HYPRE_SetUseGpuRand ) +#define HYPRE_Version HYPRE_MULTIPRECISION_FUNC ( HYPRE_Version ) +#define HYPRE_VersionNumber HYPRE_MULTIPRECISION_FUNC ( HYPRE_VersionNumber ) +#define hypre_BeginTiming_fcn HYPRE_FIXEDPRECISION_FUNC ( hypre_BeginTiming_fcn ) +#define hypre_BigBinarySearch HYPRE_FIXEDPRECISION_FUNC ( hypre_BigBinarySearch ) +#define hypre_BigLowerBound HYPRE_FIXEDPRECISION_FUNC ( hypre_BigLowerBound ) +#define hypre_BigQsort0 HYPRE_FIXEDPRECISION_FUNC ( hypre_BigQsort0 ) +#define hypre_BigQsort1 HYPRE_FIXEDPRECISION_FUNC ( hypre_BigQsort1 ) +#define hypre_BigQsort2i HYPRE_FIXEDPRECISION_FUNC ( hypre_BigQsort2i ) +#define hypre_BigQsort4_abs HYPRE_FIXEDPRECISION_FUNC ( hypre_BigQsort4_abs ) +#define hypre_BigQsortb2i HYPRE_FIXEDPRECISION_FUNC ( hypre_BigQsortb2i ) +#define hypre_BigQsortbLoc HYPRE_FIXEDPRECISION_FUNC ( hypre_BigQsortbLoc ) +#define hypre_BigQsortbi HYPRE_FIXEDPRECISION_FUNC ( hypre_BigQsortbi ) +#define hypre_BigSwap HYPRE_FIXEDPRECISION_FUNC ( hypre_BigSwap ) +#define hypre_BigSwap2 HYPRE_FIXEDPRECISION_FUNC ( hypre_BigSwap2 ) +#define hypre_BigSwap2i HYPRE_FIXEDPRECISION_FUNC ( hypre_BigSwap2i ) +#define hypre_BigSwap4_d HYPRE_FIXEDPRECISION_FUNC ( hypre_BigSwap4_d ) +#define hypre_BigSwapLoc HYPRE_FIXEDPRECISION_FUNC ( hypre_BigSwapLoc ) +#define hypre_BigSwapb2i HYPRE_FIXEDPRECISION_FUNC ( hypre_BigSwapb2i ) +#define hypre_BigSwapbi HYPRE_FIXEDPRECISION_FUNC ( hypre_BigSwapbi ) +#define hypre_BinarySearch HYPRE_FIXEDPRECISION_FUNC ( hypre_BinarySearch ) +#define hypre_BinarySearch2 HYPRE_FIXEDPRECISION_FUNC ( hypre_BinarySearch2 ) +#define hypre_CAlloc HYPRE_FIXEDPRECISION_FUNC ( hypre_CAlloc ) +#define hypre_CheckDirExists HYPRE_FIXEDPRECISION_FUNC ( hypre_CheckDirExists ) +#define hypre_CheckMemoryLocation HYPRE_FIXEDPRECISION_FUNC ( hypre_CheckMemoryLocation ) +#define hypre_ClearTiming_fcn HYPRE_FIXEDPRECISION_FUNC ( hypre_ClearTiming_fcn ) +#define hypre_ConvertIndicesToString HYPRE_FIXEDPRECISION_FUNC ( hypre_ConvertIndicesToString ) +#define hypre_CreateBinaryTree HYPRE_FIXEDPRECISION_FUNC ( hypre_CreateBinaryTree ) +#define hypre_CreateDir HYPRE_FIXEDPRECISION_FUNC ( hypre_CreateDir ) +#define hypre_CreateNextDirOfSequence HYPRE_FIXEDPRECISION_FUNC ( hypre_CreateNextDirOfSequence ) +#define hypre_DataExchangeList HYPRE_FIXEDPRECISION_FUNC ( hypre_DataExchangeList ) +#define hypre_DestroyBinaryTree HYPRE_FIXEDPRECISION_FUNC ( hypre_DestroyBinaryTree ) +#define hypre_DoubleQuickSplit HYPRE_FIXEDPRECISION_FUNC ( hypre_DoubleQuickSplit ) +#define hypre_EndTiming_fcn HYPRE_FIXEDPRECISION_FUNC ( hypre_EndTiming_fcn ) +#define hypre_FinalizeAllTimings_fcn HYPRE_FIXEDPRECISION_FUNC ( hypre_FinalizeAllTimings_fcn ) +#define hypre_FinalizeTiming_fcn HYPRE_FIXEDPRECISION_FUNC ( hypre_FinalizeTiming_fcn ) +#define hypre_Finalized HYPRE_FIXEDPRECISION_FUNC ( hypre_Finalized ) +#define hypre_Free HYPRE_FIXEDPRECISION_FUNC ( hypre_Free ) +#define hypre_GetDevice HYPRE_FIXEDPRECISION_FUNC ( hypre_GetDevice ) +#define hypre_GetDeviceCount HYPRE_FIXEDPRECISION_FUNC ( hypre_GetDeviceCount ) +#define hypre_GetDeviceLastError HYPRE_FIXEDPRECISION_FUNC ( hypre_GetDeviceLastError ) +#define hypre_GetDeviceMaxShmemSize HYPRE_FIXEDPRECISION_FUNC ( hypre_GetDeviceMaxShmemSize ) +#define hypre_GetExecPolicy1 HYPRE_FIXEDPRECISION_FUNC ( hypre_GetExecPolicy1 ) +#define hypre_GetExecPolicy2 HYPRE_FIXEDPRECISION_FUNC ( hypre_GetExecPolicy2 ) +#define hypre_GetGpuAwareMPI HYPRE_FIXEDPRECISION_FUNC ( hypre_GetGpuAwareMPI ) +#define hypre_GetMemoryLocationName HYPRE_FIXEDPRECISION_FUNC ( hypre_GetMemoryLocationName ) +#define hypre_GetPointerLocation HYPRE_FIXEDPRECISION_FUNC ( hypre_GetPointerLocation ) +#define hypre_GetSimpleThreadPartition HYPRE_FIXEDPRECISION_FUNC ( hypre_GetSimpleThreadPartition ) +#define hypre_GetTiming_fcn HYPRE_FIXEDPRECISION_FUNC ( hypre_GetTiming_fcn ) +#define hypre_GpuProfilingPopRange HYPRE_FIXEDPRECISION_FUNC ( hypre_GpuProfilingPopRange ) +#define hypre_GpuProfilingPushRange HYPRE_FIXEDPRECISION_FUNC ( hypre_GpuProfilingPushRange ) +#define hypre_GpuProfilingPushRangeColor HYPRE_FIXEDPRECISION_FUNC ( hypre_GpuProfilingPushRangeColor ) +#define hypre_HandleCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_HandleCreate ) +#define hypre_HandleDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_HandleDestroy ) +#define hypre_HostMemoryGetUsage HYPRE_FIXEDPRECISION_FUNC ( hypre_HostMemoryGetUsage ) +#define hypre_IncFLOPCount_fcn HYPRE_FIXEDPRECISION_FUNC ( hypre_IncFLOPCount_fcn ) +#define hypre_InitializeTiming_fcn HYPRE_FIXEDPRECISION_FUNC ( hypre_InitializeTiming_fcn ) +#define hypre_Initialized HYPRE_FIXEDPRECISION_FUNC ( hypre_Initialized ) +#define hypre_IntArrayArrayCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_IntArrayArrayCreate ) +#define hypre_IntArrayArrayDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_IntArrayArrayDestroy ) +#define hypre_IntArrayArrayInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_IntArrayArrayInitialize ) +#define hypre_IntArrayArrayInitializeIn HYPRE_FIXEDPRECISION_FUNC ( hypre_IntArrayArrayInitializeIn ) +#define hypre_IntArrayArrayMigrate HYPRE_FIXEDPRECISION_FUNC ( hypre_IntArrayArrayMigrate ) +#define hypre_IntArrayCloneDeep HYPRE_FIXEDPRECISION_FUNC ( hypre_IntArrayCloneDeep ) +#define hypre_IntArrayCloneDeep_v2 HYPRE_FIXEDPRECISION_FUNC ( hypre_IntArrayCloneDeep_v2 ) +#define hypre_IntArrayCopy HYPRE_FIXEDPRECISION_FUNC ( hypre_IntArrayCopy ) +#define hypre_IntArrayCount HYPRE_FIXEDPRECISION_FUNC ( hypre_IntArrayCount ) +#define hypre_IntArrayCountHost HYPRE_FIXEDPRECISION_FUNC ( hypre_IntArrayCountHost ) +#define hypre_IntArrayCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_IntArrayCreate ) +#define hypre_IntArrayDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_IntArrayDestroy ) +#define hypre_IntArrayInitialize HYPRE_FIXEDPRECISION_FUNC ( hypre_IntArrayInitialize ) +#define hypre_IntArrayInitialize_v2 HYPRE_FIXEDPRECISION_FUNC ( hypre_IntArrayInitialize_v2 ) +#define hypre_IntArrayInverseMapping HYPRE_FIXEDPRECISION_FUNC ( hypre_IntArrayInverseMapping ) +#define hypre_IntArrayInverseMappingHost HYPRE_FIXEDPRECISION_FUNC ( hypre_IntArrayInverseMappingHost ) +#define hypre_IntArrayMergeOrdered HYPRE_FIXEDPRECISION_FUNC ( hypre_IntArrayMergeOrdered ) +#define hypre_IntArrayMigrate HYPRE_FIXEDPRECISION_FUNC ( hypre_IntArrayMigrate ) +#define hypre_IntArrayNegate HYPRE_FIXEDPRECISION_FUNC ( hypre_IntArrayNegate ) +#define hypre_IntArrayPrint HYPRE_FIXEDPRECISION_FUNC ( hypre_IntArrayPrint ) +#define hypre_IntArrayRead HYPRE_FIXEDPRECISION_FUNC ( hypre_IntArrayRead ) +#define hypre_IntArraySeparateByValue HYPRE_FIXEDPRECISION_FUNC ( hypre_IntArraySeparateByValue ) +#define hypre_IntArraySetConstantValues HYPRE_FIXEDPRECISION_FUNC ( hypre_IntArraySetConstantValues ) +#define hypre_IntArraySetConstantValuesHost HYPRE_FIXEDPRECISION_FUNC ( hypre_IntArraySetConstantValuesHost ) +#define hypre_IntArraySetInterleavedValues HYPRE_FIXEDPRECISION_FUNC ( hypre_IntArraySetInterleavedValues ) +#define hypre_IntArraySetInterleavedValuesHost HYPRE_FIXEDPRECISION_FUNC ( hypre_IntArraySetInterleavedValuesHost ) +#define hypre_IntSequence HYPRE_FIXEDPRECISION_FUNC ( hypre_IntSequence ) +#define hypre_Log2 HYPRE_FIXEDPRECISION_FUNC ( hypre_Log2 ) +#define hypre_LowerBound HYPRE_FIXEDPRECISION_FUNC ( hypre_LowerBound ) +#define hypre_MAlloc HYPRE_FIXEDPRECISION_FUNC ( hypre_MAlloc ) +#define hypre_MPI_Abort HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Abort ) +#define hypre_MPI_Address HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Address ) +#define hypre_MPI_Allgather HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Allgather ) +#define hypre_MPI_Allgatherv HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Allgatherv ) +#define hypre_MPI_Allreduce HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Allreduce ) +#define hypre_MPI_Alltoall HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Alltoall ) +#define hypre_MPI_Barrier HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Barrier ) +#define hypre_MPI_Bcast HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Bcast ) +#define hypre_MPI_CheckCommMatrix HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_CheckCommMatrix ) +#define hypre_MPI_Comm_create HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Comm_create ) +#define hypre_MPI_Comm_dup HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Comm_dup ) +#define hypre_MPI_Comm_f2c HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Comm_f2c ) +#define hypre_MPI_Comm_free HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Comm_free ) +#define hypre_MPI_Comm_group HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Comm_group ) +#define hypre_MPI_Comm_rank HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Comm_rank ) +#define hypre_MPI_Comm_size HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Comm_size ) +#define hypre_MPI_Comm_split HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Comm_split ) +#define hypre_MPI_Finalize HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Finalize ) +#define hypre_MPI_Gather HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Gather ) +#define hypre_MPI_Gatherv HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Gatherv ) +#define hypre_MPI_Get_count HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Get_count ) +#define hypre_MPI_Group_free HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Group_free ) +#define hypre_MPI_Group_incl HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Group_incl ) +#define hypre_MPI_Init HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Init ) +#define hypre_MPI_Iprobe HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Iprobe ) +#define hypre_MPI_Irecv HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Irecv ) +#define hypre_MPI_Irsend HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Irsend ) +#define hypre_MPI_Isend HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Isend ) +#define hypre_MPI_Op_create HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Op_create ) +#define hypre_MPI_Op_free HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Op_free ) +#define hypre_MPI_Probe HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Probe ) +#define hypre_MPI_Recv HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Recv ) +#define hypre_MPI_Recv_init HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Recv_init ) +#define hypre_MPI_Reduce HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Reduce ) +#define hypre_MPI_Request_free HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Request_free ) +#define hypre_MPI_Scan HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Scan ) +#define hypre_MPI_Scatter HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Scatter ) +#define hypre_MPI_Scatterv HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Scatterv ) +#define hypre_MPI_Send HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Send ) +#define hypre_MPI_Send_init HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Send_init ) +#define hypre_MPI_Startall HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Startall ) +#define hypre_MPI_Test HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Test ) +#define hypre_MPI_Testall HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Testall ) +#define hypre_MPI_Type_commit HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Type_commit ) +#define hypre_MPI_Type_contiguous HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Type_contiguous ) +#define hypre_MPI_Type_free HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Type_free ) +#define hypre_MPI_Type_hvector HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Type_hvector ) +#define hypre_MPI_Type_struct HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Type_struct ) +#define hypre_MPI_Type_vector HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Type_vector ) +#define hypre_MPI_Wait HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Wait ) +#define hypre_MPI_Waitall HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Waitall ) +#define hypre_MPI_Waitany HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Waitany ) +#define hypre_MPI_Wtick HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Wtick ) +#define hypre_MPI_Wtime HYPRE_FIXEDPRECISION_FUNC ( hypre_MPI_Wtime ) +#define hypre_MatrixStatsArrayCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_MatrixStatsArrayCreate ) +#define hypre_MatrixStatsArrayDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_MatrixStatsArrayDestroy ) +#define hypre_MatrixStatsArrayPrint HYPRE_FIXEDPRECISION_FUNC ( hypre_MatrixStatsArrayPrint ) +#define hypre_MatrixStatsCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_MatrixStatsCreate ) +#define hypre_MatrixStatsDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_MatrixStatsDestroy ) +#define hypre_MemPrefetch HYPRE_FIXEDPRECISION_FUNC ( hypre_MemPrefetch ) +#define hypre_Memcpy HYPRE_FIXEDPRECISION_FUNC ( hypre_Memcpy ) +#define hypre_MemoryPrintUsage HYPRE_FIXEDPRECISION_FUNC ( hypre_MemoryPrintUsage ) +#define hypre_Memset HYPRE_FIXEDPRECISION_FUNC ( hypre_Memset ) +#define hypre_PrefixSumInt HYPRE_FIXEDPRECISION_FUNC ( hypre_PrefixSumInt ) +#define hypre_PrintTiming_fcn HYPRE_FIXEDPRECISION_FUNC ( hypre_PrintTiming_fcn ) +#define hypre_Rand HYPRE_FIXEDPRECISION_FUNC ( hypre_Rand ) +#define hypre_RandI HYPRE_FIXEDPRECISION_FUNC ( hypre_RandI ) +#define hypre_ReAlloc HYPRE_FIXEDPRECISION_FUNC ( hypre_ReAlloc ) +#define hypre_ReAlloc_v2 HYPRE_FIXEDPRECISION_FUNC ( hypre_ReAlloc_v2 ) +#define hypre_RestoreLogLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_RestoreLogLevel ) +#define hypre_SeedRand HYPRE_FIXEDPRECISION_FUNC ( hypre_SeedRand ) +#define hypre_SetCubMemPoolSize HYPRE_FIXEDPRECISION_FUNC ( hypre_SetCubMemPoolSize ) +#define hypre_SetDevice HYPRE_FIXEDPRECISION_FUNC ( hypre_SetDevice ) +#define hypre_SetFinalized HYPRE_FIXEDPRECISION_FUNC ( hypre_SetFinalized ) +#define hypre_SetGaussSeidelMethod HYPRE_FIXEDPRECISION_FUNC ( hypre_SetGaussSeidelMethod ) +#define hypre_SetGpuAwareMPI HYPRE_FIXEDPRECISION_FUNC ( hypre_SetGpuAwareMPI ) +#define hypre_SetInitialized HYPRE_FIXEDPRECISION_FUNC ( hypre_SetInitialized ) +#define hypre_SetLogLevel HYPRE_FIXEDPRECISION_FUNC ( hypre_SetLogLevel ) +#define hypre_SetLogLevelSaved HYPRE_FIXEDPRECISION_FUNC ( hypre_SetLogLevelSaved ) +#define hypre_SetSpGemmAlgorithm HYPRE_FIXEDPRECISION_FUNC ( hypre_SetSpGemmAlgorithm ) +#define hypre_SetSpGemmBinned HYPRE_FIXEDPRECISION_FUNC ( hypre_SetSpGemmBinned ) +#define hypre_SetSpGemmRownnzEstimateMethod HYPRE_FIXEDPRECISION_FUNC ( hypre_SetSpGemmRownnzEstimateMethod ) +#define hypre_SetSpGemmRownnzEstimateMultFactor HYPRE_FIXEDPRECISION_FUNC ( hypre_SetSpGemmRownnzEstimateMultFactor ) +#define hypre_SetSpGemmRownnzEstimateNSamples HYPRE_FIXEDPRECISION_FUNC ( hypre_SetSpGemmRownnzEstimateNSamples ) +#define hypre_SetSpGemmUseVendor HYPRE_FIXEDPRECISION_FUNC ( hypre_SetSpGemmUseVendor ) +#define hypre_SetSpMVUseVendor HYPRE_FIXEDPRECISION_FUNC ( hypre_SetSpMVUseVendor ) +#define hypre_SetSpTransUseVendor HYPRE_FIXEDPRECISION_FUNC ( hypre_SetSpTransUseVendor ) +#define hypre_SetUseGpuRand HYPRE_FIXEDPRECISION_FUNC ( hypre_SetUseGpuRand ) +#define hypre_SetUserDeviceMalloc HYPRE_FIXEDPRECISION_FUNC ( hypre_SetUserDeviceMalloc ) +#define hypre_SetUserDeviceMfree HYPRE_FIXEDPRECISION_FUNC ( hypre_SetUserDeviceMfree ) +#define hypre_UniqueIntArrayND HYPRE_FIXEDPRECISION_FUNC ( hypre_UniqueIntArrayND ) +#define hypre_UnorderedBigIntMapCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_UnorderedBigIntMapCreate ) +#define hypre_UnorderedBigIntMapDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_UnorderedBigIntMapDestroy ) +#define hypre_UnorderedBigIntSetCopyToArray HYPRE_FIXEDPRECISION_FUNC ( hypre_UnorderedBigIntSetCopyToArray ) +#define hypre_UnorderedBigIntSetCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_UnorderedBigIntSetCreate ) +#define hypre_UnorderedBigIntSetDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_UnorderedBigIntSetDestroy ) +#define hypre_UnorderedIntMapCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_UnorderedIntMapCreate ) +#define hypre_UnorderedIntMapDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_UnorderedIntMapDestroy ) +#define hypre_UnorderedIntSetCopyToArray HYPRE_FIXEDPRECISION_FUNC ( hypre_UnorderedIntSetCopyToArray ) +#define hypre_UnorderedIntSetCreate HYPRE_FIXEDPRECISION_FUNC ( hypre_UnorderedIntSetCreate ) +#define hypre_UnorderedIntSetDestroy HYPRE_FIXEDPRECISION_FUNC ( hypre_UnorderedIntSetDestroy ) +#define hypre__Free HYPRE_FIXEDPRECISION_FUNC ( hypre__Free ) +#define hypre__MAlloc HYPRE_FIXEDPRECISION_FUNC ( hypre__MAlloc ) +#define hypre_big_merge_sort HYPRE_FIXEDPRECISION_FUNC ( hypre_big_merge_sort ) +#define hypre_big_sort_and_create_inverse_map HYPRE_FIXEDPRECISION_FUNC ( hypre_big_sort_and_create_inverse_map ) +#define hypre_bind_device HYPRE_FIXEDPRECISION_FUNC ( hypre_bind_device ) +#define hypre_bind_device_id HYPRE_FIXEDPRECISION_FUNC ( hypre_bind_device_id ) +#define hypre_checkerror HYPRE_FIXEDPRECISION_FUNC ( hypre_checkerror ) +#define hypre_clearallerrors HYPRE_FIXEDPRECISION_FUNC ( hypre_clearallerrors ) +#define hypre_clearerror HYPRE_FIXEDPRECISION_FUNC ( hypre_clearerror ) +#define hypre_create_elt HYPRE_FIXEDPRECISION_FUNC ( hypre_create_elt ) +#define hypre_dense_topo_sort HYPRE_FIXEDPRECISION_FUNC ( hypre_dense_topo_sort ) +#define hypre_dispose_elt HYPRE_FIXEDPRECISION_FUNC ( hypre_dispose_elt ) +#define hypre_enter_on_lists HYPRE_FIXEDPRECISION_FUNC ( hypre_enter_on_lists ) +#define hypre_error_code_restore HYPRE_FIXEDPRECISION_FUNC ( hypre_error_code_restore ) +#define hypre_error_code_save HYPRE_FIXEDPRECISION_FUNC ( hypre_error_code_save ) +#define hypre_error_handler HYPRE_FIXEDPRECISION_FUNC ( hypre_error_handler ) +#define hypre_error_handler_clear_messages HYPRE_FIXEDPRECISION_FUNC ( hypre_error_handler_clear_messages ) +#define hypre_finalize HYPRE_FIXEDPRECISION_FUNC ( hypre_finalize ) +#define hypre_geterror HYPRE_FIXEDPRECISION_FUNC ( hypre_geterror ) +#define hypre_geterrorarg HYPRE_FIXEDPRECISION_FUNC ( hypre_geterrorarg ) +#define hypre_handle HYPRE_FIXEDPRECISION_FUNC ( hypre_handle ) +#define hypre_init HYPRE_FIXEDPRECISION_FUNC ( hypre_init ) +#define hypre_initialize HYPRE_FIXEDPRECISION_FUNC ( hypre_initialize ) +#define hypre_merge_sort HYPRE_FIXEDPRECISION_FUNC ( hypre_merge_sort ) +#define hypre_mm_is_valid HYPRE_FIXEDPRECISION_FUNC ( hypre_mm_is_valid ) +#define hypre_mm_read_banner HYPRE_FIXEDPRECISION_FUNC ( hypre_mm_read_banner ) +#define hypre_mm_read_mtx_crd_size HYPRE_FIXEDPRECISION_FUNC ( hypre_mm_read_mtx_crd_size ) +#define hypre_multmod HYPRE_FIXEDPRECISION_FUNC ( hypre_multmod ) +#define hypre_partition1D HYPRE_FIXEDPRECISION_FUNC ( hypre_partition1D ) +#define hypre_prefix_sum HYPRE_FIXEDPRECISION_FUNC ( hypre_prefix_sum ) +#define hypre_prefix_sum_multiple HYPRE_FIXEDPRECISION_FUNC ( hypre_prefix_sum_multiple ) +#define hypre_prefix_sum_pair HYPRE_FIXEDPRECISION_FUNC ( hypre_prefix_sum_pair ) +#define hypre_prefix_sum_triple HYPRE_FIXEDPRECISION_FUNC ( hypre_prefix_sum_triple ) +#define hypre_qsort0 HYPRE_FIXEDPRECISION_FUNC ( hypre_qsort0 ) +#define hypre_qsort1 HYPRE_FIXEDPRECISION_FUNC ( hypre_qsort1 ) +#define hypre_qsort2 HYPRE_FIXEDPRECISION_FUNC ( hypre_qsort2 ) +#define hypre_qsort2_abs HYPRE_FIXEDPRECISION_FUNC ( hypre_qsort2_abs ) +#define hypre_qsort2i HYPRE_FIXEDPRECISION_FUNC ( hypre_qsort2i ) +#define hypre_qsort3 HYPRE_FIXEDPRECISION_FUNC ( hypre_qsort3 ) +#define hypre_qsort3_abs HYPRE_FIXEDPRECISION_FUNC ( hypre_qsort3_abs ) +#define hypre_qsort3i HYPRE_FIXEDPRECISION_FUNC ( hypre_qsort3i ) +#define hypre_qsort3ir HYPRE_FIXEDPRECISION_FUNC ( hypre_qsort3ir ) +#define hypre_qsortND HYPRE_FIXEDPRECISION_FUNC ( hypre_qsortND ) +#define hypre_qsort_abs HYPRE_FIXEDPRECISION_FUNC ( hypre_qsort_abs ) +#define hypre_remove_point HYPRE_FIXEDPRECISION_FUNC ( hypre_remove_point ) +#define hypre_setexecutionpolicy HYPRE_FIXEDPRECISION_FUNC ( hypre_setexecutionpolicy ) +#define hypre_setmemorylocation HYPRE_FIXEDPRECISION_FUNC ( hypre_setmemorylocation ) +#define hypre_setspgemmusevendor HYPRE_FIXEDPRECISION_FUNC ( hypre_setspgemmusevendor ) +#define hypre_strcpy HYPRE_FIXEDPRECISION_FUNC ( hypre_strcpy ) +#define hypre_swap HYPRE_FIXEDPRECISION_FUNC ( hypre_swap ) +#define hypre_swap2 HYPRE_FIXEDPRECISION_FUNC ( hypre_swap2 ) +#define hypre_swap2i HYPRE_FIXEDPRECISION_FUNC ( hypre_swap2i ) +#define hypre_swap3_d HYPRE_FIXEDPRECISION_FUNC ( hypre_swap3_d ) +#define hypre_swap3_d_perm HYPRE_FIXEDPRECISION_FUNC ( hypre_swap3_d_perm ) +#define hypre_swap3i HYPRE_FIXEDPRECISION_FUNC ( hypre_swap3i ) +#define hypre_swap_c HYPRE_FIXEDPRECISION_FUNC ( hypre_swap_c ) +#define hypre_swap_d HYPRE_FIXEDPRECISION_FUNC ( hypre_swap_d ) +#define hypre_topo_sort HYPRE_FIXEDPRECISION_FUNC ( hypre_topo_sort ) +#define hypre_union2 HYPRE_FIXEDPRECISION_FUNC ( hypre_union2 ) +#define time_getCPUSeconds HYPRE_FIXEDPRECISION_FUNC ( time_getCPUSeconds ) +#define time_getWallclockSeconds HYPRE_FIXEDPRECISION_FUNC ( time_getWallclockSeconds ) +#define utilities_FortranMatrixAdd HYPRE_FIXEDPRECISION_FUNC ( utilities_FortranMatrixAdd ) +#define utilities_FortranMatrixAllocateData HYPRE_FIXEDPRECISION_FUNC ( utilities_FortranMatrixAllocateData ) +#define utilities_FortranMatrixClear HYPRE_FIXEDPRECISION_FUNC ( utilities_FortranMatrixClear ) +#define utilities_FortranMatrixClearL HYPRE_FIXEDPRECISION_FUNC ( utilities_FortranMatrixClearL ) +#define utilities_FortranMatrixCopy HYPRE_FIXEDPRECISION_FUNC ( utilities_FortranMatrixCopy ) +#define utilities_FortranMatrixCreate HYPRE_FIXEDPRECISION_FUNC ( utilities_FortranMatrixCreate ) +#define utilities_FortranMatrixDMultiply HYPRE_FIXEDPRECISION_FUNC ( utilities_FortranMatrixDMultiply ) +#define utilities_FortranMatrixDestroy HYPRE_FIXEDPRECISION_FUNC ( utilities_FortranMatrixDestroy ) +#define utilities_FortranMatrixFNorm HYPRE_FIXEDPRECISION_FUNC ( utilities_FortranMatrixFNorm ) +#define utilities_FortranMatrixGetDiagonal HYPRE_FIXEDPRECISION_FUNC ( utilities_FortranMatrixGetDiagonal ) +#define utilities_FortranMatrixGlobalHeight HYPRE_FIXEDPRECISION_FUNC ( utilities_FortranMatrixGlobalHeight ) +#define utilities_FortranMatrixHeight HYPRE_FIXEDPRECISION_FUNC ( utilities_FortranMatrixHeight ) +#define utilities_FortranMatrixIndexCopy HYPRE_FIXEDPRECISION_FUNC ( utilities_FortranMatrixIndexCopy ) +#define utilities_FortranMatrixMaxValue HYPRE_FIXEDPRECISION_FUNC ( utilities_FortranMatrixMaxValue ) +#define utilities_FortranMatrixMultiply HYPRE_FIXEDPRECISION_FUNC ( utilities_FortranMatrixMultiply ) +#define utilities_FortranMatrixMultiplyD HYPRE_FIXEDPRECISION_FUNC ( utilities_FortranMatrixMultiplyD ) +#define utilities_FortranMatrixPrint HYPRE_FIXEDPRECISION_FUNC ( utilities_FortranMatrixPrint ) +#define utilities_FortranMatrixSelectBlock HYPRE_FIXEDPRECISION_FUNC ( utilities_FortranMatrixSelectBlock ) +#define utilities_FortranMatrixSetDiagonal HYPRE_FIXEDPRECISION_FUNC ( utilities_FortranMatrixSetDiagonal ) +#define utilities_FortranMatrixSetToIdentity HYPRE_FIXEDPRECISION_FUNC ( utilities_FortranMatrixSetToIdentity ) +#define utilities_FortranMatrixSymmetrize HYPRE_FIXEDPRECISION_FUNC ( utilities_FortranMatrixSymmetrize ) +#define utilities_FortranMatrixTransposeSquare HYPRE_FIXEDPRECISION_FUNC ( utilities_FortranMatrixTransposeSquare ) +#define utilities_FortranMatrixUpperInv HYPRE_FIXEDPRECISION_FUNC ( utilities_FortranMatrixUpperInv ) +#define utilities_FortranMatrixValue HYPRE_FIXEDPRECISION_FUNC ( utilities_FortranMatrixValue ) +#define utilities_FortranMatrixValuePtr HYPRE_FIXEDPRECISION_FUNC ( utilities_FortranMatrixValuePtr ) +#define utilities_FortranMatrixValues HYPRE_FIXEDPRECISION_FUNC ( utilities_FortranMatrixValues ) +#define utilities_FortranMatrixWidth HYPRE_FIXEDPRECISION_FUNC ( utilities_FortranMatrixWidth ) +#define utilities_FortranMatrixWrap HYPRE_FIXEDPRECISION_FUNC ( utilities_FortranMatrixWrap ) + +#endif diff --git a/src/utilities/_hypre_utilities_mup_undef.h b/src/utilities/_hypre_utilities_mup_undef.h new file mode 100644 index 0000000000..8abee07877 --- /dev/null +++ b/src/utilities/_hypre_utilities_mup_undef.h @@ -0,0 +1,323 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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 file for transforming multiprecision functions names */ + +#undef hypre_UTILITIES_MUP_DEF_HEADER + +#undef HYPRE_AssumedPartitionCheck +#undef HYPRE_CheckError +#undef HYPRE_ClearAllErrors +#undef HYPRE_ClearError +#undef HYPRE_ClearErrorMessages +#undef HYPRE_DescribeError +#undef HYPRE_DeviceInitialize +#undef HYPRE_Finalize +#undef HYPRE_Finalized +#undef HYPRE_GetError +#undef HYPRE_GetErrorArg +#undef HYPRE_GetErrorMessages +#undef HYPRE_GetExecutionPolicy +#undef HYPRE_GetExecutionPolicyName +#undef HYPRE_GetGlobalError +#undef HYPRE_GetMemoryLocation +#undef HYPRE_Initialize +#undef HYPRE_Initialized +#undef HYPRE_MemoryPrintUsage +#undef HYPRE_PrintDeviceInfo +#undef HYPRE_PrintErrorMessages +#undef HYPRE_SetExecutionPolicy +#undef HYPRE_SetGPUMemoryPoolSize +#undef HYPRE_SetGpuAwareMPI +#undef HYPRE_SetLogLevel +#undef HYPRE_SetMemoryLocation +#undef HYPRE_SetPrintErrorMode +#undef HYPRE_SetPrintErrorVerbosity +#undef HYPRE_SetSpGemmUseVendor +#undef HYPRE_SetSpMVUseVendor +#undef HYPRE_SetSpTransUseVendor +#undef HYPRE_SetUseGpuRand +#undef HYPRE_Version +#undef HYPRE_VersionNumber +#undef hypre_BeginTiming_fcn +#undef hypre_BigBinarySearch +#undef hypre_BigLowerBound +#undef hypre_BigQsort0 +#undef hypre_BigQsort1 +#undef hypre_BigQsort2i +#undef hypre_BigQsort4_abs +#undef hypre_BigQsortb2i +#undef hypre_BigQsortbLoc +#undef hypre_BigQsortbi +#undef hypre_BigSwap +#undef hypre_BigSwap2 +#undef hypre_BigSwap2i +#undef hypre_BigSwap4_d +#undef hypre_BigSwapLoc +#undef hypre_BigSwapb2i +#undef hypre_BigSwapbi +#undef hypre_BinarySearch +#undef hypre_BinarySearch2 +#undef hypre_CAlloc +#undef hypre_CheckDirExists +#undef hypre_CheckMemoryLocation +#undef hypre_ClearTiming_fcn +#undef hypre_ConvertIndicesToString +#undef hypre_CreateBinaryTree +#undef hypre_CreateDir +#undef hypre_CreateNextDirOfSequence +#undef hypre_DataExchangeList +#undef hypre_DestroyBinaryTree +#undef hypre_DoubleQuickSplit +#undef hypre_EndTiming_fcn +#undef hypre_FinalizeAllTimings_fcn +#undef hypre_FinalizeTiming_fcn +#undef hypre_Finalized +#undef hypre_Free +#undef hypre_GetDevice +#undef hypre_GetDeviceCount +#undef hypre_GetDeviceLastError +#undef hypre_GetDeviceMaxShmemSize +#undef hypre_GetExecPolicy1 +#undef hypre_GetExecPolicy2 +#undef hypre_GetGpuAwareMPI +#undef hypre_GetMemoryLocationName +#undef hypre_GetPointerLocation +#undef hypre_GetSimpleThreadPartition +#undef hypre_GetTiming_fcn +#undef hypre_GpuProfilingPopRange +#undef hypre_GpuProfilingPushRange +#undef hypre_GpuProfilingPushRangeColor +#undef hypre_HandleCreate +#undef hypre_HandleDestroy +#undef hypre_HostMemoryGetUsage +#undef hypre_IncFLOPCount_fcn +#undef hypre_InitializeTiming_fcn +#undef hypre_Initialized +#undef hypre_IntArrayArrayCreate +#undef hypre_IntArrayArrayDestroy +#undef hypre_IntArrayArrayInitialize +#undef hypre_IntArrayArrayInitializeIn +#undef hypre_IntArrayArrayMigrate +#undef hypre_IntArrayCloneDeep +#undef hypre_IntArrayCloneDeep_v2 +#undef hypre_IntArrayCopy +#undef hypre_IntArrayCount +#undef hypre_IntArrayCountHost +#undef hypre_IntArrayCreate +#undef hypre_IntArrayDestroy +#undef hypre_IntArrayInitialize +#undef hypre_IntArrayInitialize_v2 +#undef hypre_IntArrayInverseMapping +#undef hypre_IntArrayInverseMappingHost +#undef hypre_IntArrayMergeOrdered +#undef hypre_IntArrayMigrate +#undef hypre_IntArrayNegate +#undef hypre_IntArrayPrint +#undef hypre_IntArrayRead +#undef hypre_IntArraySeparateByValue +#undef hypre_IntArraySetConstantValues +#undef hypre_IntArraySetConstantValuesHost +#undef hypre_IntArraySetInterleavedValues +#undef hypre_IntArraySetInterleavedValuesHost +#undef hypre_IntSequence +#undef hypre_Log2 +#undef hypre_LowerBound +#undef hypre_MAlloc +#undef hypre_MPI_Abort +#undef hypre_MPI_Address +#undef hypre_MPI_Allgather +#undef hypre_MPI_Allgatherv +#undef hypre_MPI_Allreduce +#undef hypre_MPI_Alltoall +#undef hypre_MPI_Barrier +#undef hypre_MPI_Bcast +#undef hypre_MPI_CheckCommMatrix +#undef hypre_MPI_Comm_create +#undef hypre_MPI_Comm_dup +#undef hypre_MPI_Comm_f2c +#undef hypre_MPI_Comm_free +#undef hypre_MPI_Comm_group +#undef hypre_MPI_Comm_rank +#undef hypre_MPI_Comm_size +#undef hypre_MPI_Comm_split +#undef hypre_MPI_Finalize +#undef hypre_MPI_Gather +#undef hypre_MPI_Gatherv +#undef hypre_MPI_Get_count +#undef hypre_MPI_Group_free +#undef hypre_MPI_Group_incl +#undef hypre_MPI_Init +#undef hypre_MPI_Iprobe +#undef hypre_MPI_Irecv +#undef hypre_MPI_Irsend +#undef hypre_MPI_Isend +#undef hypre_MPI_Op_create +#undef hypre_MPI_Op_free +#undef hypre_MPI_Probe +#undef hypre_MPI_Recv +#undef hypre_MPI_Recv_init +#undef hypre_MPI_Reduce +#undef hypre_MPI_Request_free +#undef hypre_MPI_Scan +#undef hypre_MPI_Scatter +#undef hypre_MPI_Scatterv +#undef hypre_MPI_Send +#undef hypre_MPI_Send_init +#undef hypre_MPI_Startall +#undef hypre_MPI_Test +#undef hypre_MPI_Testall +#undef hypre_MPI_Type_commit +#undef hypre_MPI_Type_contiguous +#undef hypre_MPI_Type_free +#undef hypre_MPI_Type_hvector +#undef hypre_MPI_Type_struct +#undef hypre_MPI_Type_vector +#undef hypre_MPI_Wait +#undef hypre_MPI_Waitall +#undef hypre_MPI_Waitany +#undef hypre_MPI_Wtick +#undef hypre_MPI_Wtime +#undef hypre_MatrixStatsArrayCreate +#undef hypre_MatrixStatsArrayDestroy +#undef hypre_MatrixStatsArrayPrint +#undef hypre_MatrixStatsCreate +#undef hypre_MatrixStatsDestroy +#undef hypre_MemPrefetch +#undef hypre_Memcpy +#undef hypre_MemoryPrintUsage +#undef hypre_Memset +#undef hypre_PrefixSumInt +#undef hypre_PrintTiming_fcn +#undef hypre_Rand +#undef hypre_RandI +#undef hypre_ReAlloc +#undef hypre_ReAlloc_v2 +#undef hypre_RestoreLogLevel +#undef hypre_SeedRand +#undef hypre_SetCubMemPoolSize +#undef hypre_SetDevice +#undef hypre_SetFinalized +#undef hypre_SetGaussSeidelMethod +#undef hypre_SetGpuAwareMPI +#undef hypre_SetInitialized +#undef hypre_SetLogLevel +#undef hypre_SetLogLevelSaved +#undef hypre_SetSpGemmAlgorithm +#undef hypre_SetSpGemmBinned +#undef hypre_SetSpGemmRownnzEstimateMethod +#undef hypre_SetSpGemmRownnzEstimateMultFactor +#undef hypre_SetSpGemmRownnzEstimateNSamples +#undef hypre_SetSpGemmUseVendor +#undef hypre_SetSpMVUseVendor +#undef hypre_SetSpTransUseVendor +#undef hypre_SetUseGpuRand +#undef hypre_SetUserDeviceMalloc +#undef hypre_SetUserDeviceMfree +#undef hypre_UniqueIntArrayND +#undef hypre_UnorderedBigIntMapCreate +#undef hypre_UnorderedBigIntMapDestroy +#undef hypre_UnorderedBigIntSetCopyToArray +#undef hypre_UnorderedBigIntSetCreate +#undef hypre_UnorderedBigIntSetDestroy +#undef hypre_UnorderedIntMapCreate +#undef hypre_UnorderedIntMapDestroy +#undef hypre_UnorderedIntSetCopyToArray +#undef hypre_UnorderedIntSetCreate +#undef hypre_UnorderedIntSetDestroy +#undef hypre__Free +#undef hypre__MAlloc +#undef hypre_big_merge_sort +#undef hypre_big_sort_and_create_inverse_map +#undef hypre_bind_device +#undef hypre_bind_device_id +#undef hypre_checkerror +#undef hypre_clearallerrors +#undef hypre_clearerror +#undef hypre_create_elt +#undef hypre_dense_topo_sort +#undef hypre_dispose_elt +#undef hypre_enter_on_lists +#undef hypre_error_code_restore +#undef hypre_error_code_save +#undef hypre_error_handler +#undef hypre_error_handler_clear_messages +#undef hypre_finalize +#undef hypre_geterror +#undef hypre_geterrorarg +#undef hypre_handle +#undef hypre_init +#undef hypre_initialize +#undef hypre_merge_sort +#undef hypre_mm_is_valid +#undef hypre_mm_read_banner +#undef hypre_mm_read_mtx_crd_size +#undef hypre_multmod +#undef hypre_partition1D +#undef hypre_prefix_sum +#undef hypre_prefix_sum_multiple +#undef hypre_prefix_sum_pair +#undef hypre_prefix_sum_triple +#undef hypre_qsort0 +#undef hypre_qsort1 +#undef hypre_qsort2 +#undef hypre_qsort2_abs +#undef hypre_qsort2i +#undef hypre_qsort3 +#undef hypre_qsort3_abs +#undef hypre_qsort3i +#undef hypre_qsort3ir +#undef hypre_qsortND +#undef hypre_qsort_abs +#undef hypre_remove_point +#undef hypre_setexecutionpolicy +#undef hypre_setmemorylocation +#undef hypre_setspgemmusevendor +#undef hypre_strcpy +#undef hypre_swap +#undef hypre_swap2 +#undef hypre_swap2i +#undef hypre_swap3_d +#undef hypre_swap3_d_perm +#undef hypre_swap3i +#undef hypre_swap_c +#undef hypre_swap_d +#undef hypre_topo_sort +#undef hypre_union2 +#undef time_getCPUSeconds +#undef time_getWallclockSeconds +#undef utilities_FortranMatrixAdd +#undef utilities_FortranMatrixAllocateData +#undef utilities_FortranMatrixClear +#undef utilities_FortranMatrixClearL +#undef utilities_FortranMatrixCopy +#undef utilities_FortranMatrixCreate +#undef utilities_FortranMatrixDMultiply +#undef utilities_FortranMatrixDestroy +#undef utilities_FortranMatrixFNorm +#undef utilities_FortranMatrixGetDiagonal +#undef utilities_FortranMatrixGlobalHeight +#undef utilities_FortranMatrixHeight +#undef utilities_FortranMatrixIndexCopy +#undef utilities_FortranMatrixMaxValue +#undef utilities_FortranMatrixMultiply +#undef utilities_FortranMatrixMultiplyD +#undef utilities_FortranMatrixPrint +#undef utilities_FortranMatrixSelectBlock +#undef utilities_FortranMatrixSetDiagonal +#undef utilities_FortranMatrixSetToIdentity +#undef utilities_FortranMatrixSymmetrize +#undef utilities_FortranMatrixTransposeSquare +#undef utilities_FortranMatrixUpperInv +#undef utilities_FortranMatrixValue +#undef utilities_FortranMatrixValuePtr +#undef utilities_FortranMatrixValues +#undef utilities_FortranMatrixWidth +#undef utilities_FortranMatrixWrap diff --git a/src/utilities/ap.c b/src/utilities/ap.c index c1e2ab35c9..8a829a23b2 100644 --- a/src/utilities/ap.c +++ b/src/utilities/ap.c @@ -15,6 +15,7 @@ /* returns 1 if the assumed partition is in use */ HYPRE_Int HYPRE_AssumedPartitionCheck(void) { + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "HYPRE_AssumedPartitionCheck is obsolete and will eventually be removed."); return 1; } diff --git a/src/utilities/caliper_instrumentation.c b/src/utilities/caliper_instrumentation.c new file mode 100644 index 0000000000..d75f778e2d --- /dev/null +++ b/src/utilities/caliper_instrumentation.c @@ -0,0 +1,16 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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" + +#ifdef HYPRE_USING_CALIPER + +/* global variables */ +HYPRE_Int hypre__caliper_maxdepth = 6; +HYPRE_Int hypre__caliper_depth = 0; + +#endif diff --git a/src/utilities/nvtx.c b/src/utilities/device_markers.c similarity index 98% rename from src/utilities/nvtx.c rename to src/utilities/device_markers.c index 7bae7a4e03..8bb83eae92 100644 --- a/src/utilities/nvtx.c +++ b/src/utilities/device_markers.c @@ -17,8 +17,7 @@ #include #include #include -#include "nvToolsExt.h" -#include "nvToolsExtCudaRt.h" +#include "nvtx3/nvToolsExt.h" /* 16 named colors by HTML 4.01. Repalce white with Orange */ typedef enum diff --git a/src/utilities/device_reducer.h b/src/utilities/device_reducer.h index e43fe52332..7fc6c801df 100644 --- a/src/utilities/device_reducer.h +++ b/src/utilities/device_reducer.h @@ -15,73 +15,102 @@ template void OneBlockReduce(T *d_arr, HYPRE_Int N, T *h_out); -struct HYPRE_double4 +struct HYPRE_Real2 { - HYPRE_Real x, y, z, w; + HYPRE_Real x, y; __host__ __device__ - HYPRE_double4() {} + HYPRE_Real2() {} __host__ __device__ - HYPRE_double4(HYPRE_Real x1, HYPRE_Real x2, HYPRE_Real x3, HYPRE_Real x4) + HYPRE_Real2(HYPRE_Real x1, HYPRE_Real x2) { x = x1; y = x2; - z = x3; - w = x4; } __host__ __device__ void operator=(HYPRE_Real val) { - x = y = z = w = val; + x = y = val; } __host__ __device__ - void operator+=(HYPRE_double4 rhs) + void operator+=(HYPRE_Real2 rhs) { x += rhs.x; y += rhs.y; - z += rhs.z; + } + +}; + +struct HYPRE_Real4 +{ + HYPRE_Real u, v, w, x; + + __host__ __device__ + HYPRE_Real4() {} + + __host__ __device__ + HYPRE_Real4(HYPRE_Real x1, HYPRE_Real x2, HYPRE_Real x3, HYPRE_Real x4) + { + u = x1; + v = x2; + w = x3; + x = x4; + } + + __host__ __device__ + void operator=(HYPRE_Real val) + { + u = v = w = x = val; + } + + __host__ __device__ + void operator+=(HYPRE_Real4 rhs) + { + u += rhs.u; + v += rhs.v; w += rhs.w; + x += rhs.x; } }; -struct HYPRE_double6 +struct HYPRE_Real6 { - HYPRE_Real x, y, z, w, u, v; + HYPRE_Real u, v, w, x, y, z; __host__ __device__ - HYPRE_double6() {} + HYPRE_Real6() {} __host__ __device__ - HYPRE_double6(HYPRE_Real x1, HYPRE_Real x2, HYPRE_Real x3, HYPRE_Real x4, - HYPRE_Real x5, HYPRE_Real x6) + HYPRE_Real6(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; + u = x1; + v = x2; + w = x3; + x = x4; + y = x5; + z = x6; } __host__ __device__ void operator=(HYPRE_Real val) { - x = y = z = w = u = v = val; + u = v = w = x = y = z = val; } __host__ __device__ - void operator+=(HYPRE_double6 rhs) + void operator+=(HYPRE_Real6 rhs) { + u += rhs.u; + v += rhs.v; + w += rhs.w; x += rhs.x; y += rhs.y; z += rhs.z; - w += rhs.w; - u += rhs.u; - v += rhs.v; } }; @@ -100,32 +129,45 @@ HYPRE_Real warpReduceSum(HYPRE_Real val) } __inline__ __host__ __device__ -HYPRE_double4 warpReduceSum(HYPRE_double4 val) +HYPRE_Real2 warpReduceSum(HYPRE_Real2 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); + } +#endif + return val; +} + +__inline__ __host__ __device__ +HYPRE_Real4 warpReduceSum(HYPRE_Real4 val) +{ +#if defined(__CUDA_ARCH__) || defined(__HIP_DEVICE_COMPILE__) + for (HYPRE_Int offset = warpSize / 2; offset > 0; offset /= 2) + { + val.u += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.u, offset); + val.v += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.v, offset); val.w += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.w, offset); + val.x += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.x, offset); } #endif return val; } __inline__ __host__ __device__ -HYPRE_double6 warpReduceSum(HYPRE_double6 val) +HYPRE_Real6 warpReduceSum(HYPRE_Real6 val) { #if defined(__CUDA_ARCH__) || defined(__HIP_DEVICE_COMPILE__) for (HYPRE_Int offset = warpSize / 2; offset > 0; offset /= 2) { + val.u += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.u, offset); + val.v += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.v, offset); + val.w += __shfl_down_sync(HYPRE_WARP_FULL_MASK, val.w, offset); 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; @@ -181,11 +223,15 @@ OneBlockReduceKernel(hypre_DeviceItem &item, T *arr, HYPRE_Int N) { +#if !defined(HYPRE_USING_SYCL) + HYPRE_UNUSED_VAR(item); +#endif + T sum; sum = 0.0; - if (threadIdx.x < N) + if (threadIdx.x < (hypre_uint) N) { sum = arr[threadIdx.x]; } @@ -247,9 +293,9 @@ struct ReduceSum { if (hypre_HandleReduceBuffer(hypre_handle()) == NULL) { - /* allocate for the max size for reducing double6 type */ + /* allocate for the max size for reducing HYPRE_Real6 type */ hypre_HandleReduceBuffer(hypre_handle()) = - hypre_TAlloc(HYPRE_double6, HYPRE_MAX_NTHREADS_BLOCK, HYPRE_MEMORY_DEVICE); + hypre_TAlloc(HYPRE_Real6, HYPRE_MAX_NTHREADS_BLOCK, HYPRE_MEMORY_DEVICE); } d_buf = (T*) hypre_HandleReduceBuffer(hypre_handle()); diff --git a/src/utilities/device_utils.c b/src/utilities/device_utils.c index 569290c564..708075bc34 100644 --- a/src/utilities/device_utils.c +++ b/src/utilities/device_utils.c @@ -1441,6 +1441,10 @@ hypreGPUKernel_ScatterAddTrivial(hypre_DeviceItem &item, HYPRE_Int *map, HYPRE_Real *y) { +#if !defined(HYPRE_USING_SYCL) + HYPRE_UNUSED_VAR(item); +#endif + for (HYPRE_Int i = 0; i < n; i++) { x[map[i]] += y[i]; @@ -1900,7 +1904,7 @@ 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) + if (i < (HYPRE_Int) n) { x[i] = v; } @@ -2148,7 +2152,7 @@ hypreGPUKernel_scalen( hypre_DeviceItem &item, { HYPRE_Int i = hypre_gpu_get_grid_thread_id<1, 1>(item); - if (i < n) + if (i < (HYPRE_Int) n) { y[i] = x[i] * v; } @@ -2696,8 +2700,12 @@ __global__ void hypreGPUKernel_CompileFlagSafetyCheck( hypre_DeviceItem &item, hypre_int *cuda_arch_compile ) { + HYPRE_UNUSED_VAR(item); + #if defined(__CUDA_ARCH__) cuda_arch_compile[0] = __CUDA_ARCH__; +#else + HYPRE_UNUSED_VAR(cuda_arch_compile); #endif } @@ -2739,13 +2747,7 @@ hypre_CudaCompileFlagCheck() /* 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) + if (cuda_arch_actual < cuda_arch_compile) { char msg[256]; @@ -2756,7 +2758,7 @@ hypre_CudaCompileFlagCheck() else { hypre_sprintf(msg, - "hypre error: Compile arch %d ('--generate-code arch=compute_%d') does not match device arch %d", + "hypre error: Compile arch %d ('--generate-code arch=compute_%d') is greater than device arch %d", cuda_arch_compile, cuda_arch_compile / 10, cuda_arch_actual); } @@ -3061,10 +3063,10 @@ hypre_bind_device_id( HYPRE_Int device_id_in, #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) + HYPRE_UNUSED_VAR(nproc); return hypre_error_flag; } diff --git a/src/utilities/device_utils.h b/src/utilities/device_utils.h index 9a2888bb5a..1c8e29ad8e 100644 --- a/src/utilities/device_utils.h +++ b/src/utilities/device_utils.h @@ -115,6 +115,31 @@ using hypre_DeviceItem = void*; #define HYPRE_THRUST_EXECUTION thrust::cuda::par #endif +#if CUDART_VERSION >= 13000 +// Macro for device memory prefetching (CUDART 13.0+) +#define HYPRE_MEM_PREFETCH_DEVICE(ptr, size, stream) \ + do { \ + cudaMemLocation loc = {cudaMemLocationTypeDevice, hypre_HandleDevice(hypre_handle())}; \ + HYPRE_CUDA_CALL(cudaMemPrefetchAsync(ptr, size, loc, 0, stream)); \ + } while (0) + +// Macro for host memory prefetching (CUDART 13.0+) +#define HYPRE_MEM_PREFETCH_HOST(ptr, size, stream) \ + do { \ + cudaMemLocation loc = {cudaMemLocationTypeHost, cudaCpuDeviceId}; \ + HYPRE_CUDA_CALL(cudaMemPrefetchAsync(ptr, size, loc, 0, stream)); \ + } while (0) + +#else +// Macro for device memory prefetching (< CUDART 13.0) +#define HYPRE_MEM_PREFETCH_DEVICE(ptr, size, stream) \ + HYPRE_CUDA_CALL(cudaMemPrefetchAsync(ptr, size, hypre_HandleDevice(hypre_handle()), stream)) + +// Macro for host memory prefetching (< CUDART 13.0) +#define HYPRE_MEM_PREFETCH_HOST(ptr, size, stream) \ + HYPRE_CUDA_CALL(cudaMemPrefetchAsync(ptr, size, cudaCpuDeviceId, stream)) +#endif + #endif /* defined(HYPRE_USING_CUDA) */ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -189,6 +214,13 @@ using hypre_DeviceItem = void*; #define HYPRE_THRUST_NOT(pred) thrust::not_fn(pred) #endif +/* Resolve deprecated warnings about thrust::identity */ +#if (defined(THRUST_VERSION) && THRUST_VERSION < 200802) +#define HYPRE_THRUST_IDENTITY(type) thrust::identity() +#elif defined(HYPRE_USING_CUDA) +#define HYPRE_THRUST_IDENTITY(type) cuda::std::identity() +#endif + using namespace thrust::placeholders; #endif /* defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) */ @@ -485,8 +517,13 @@ using hypre_DeviceItem = sycl::nd_item<3>; #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 +#if (ROCSPARSE_VERSION >= 300400) +#define hypre_rocsparse_csritilu0_compute rocsparse_scsritilu0_compute_ex +#else +#define hypre_rocsparse_csritilu0_compute rocsparse_scsritilu0_compute +#endif + /* rocSOLVER */ #define hypre_rocsolver_getrf_batched rocsolver_sgetrf_batched @@ -546,8 +583,13 @@ using hypre_DeviceItem = sycl::nd_item<3>; #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 +#if (ROCSPARSE_VERSION >= 300400) +#define hypre_rocsparse_csritilu0_compute rocsparse_dcsritilu0_compute_ex +#else +#define hypre_rocsparse_csritilu0_compute rocsparse_dcsritilu0_compute +#endif + /* rocSOLVER */ #define hypre_rocsolver_getrf_batched rocsolver_dgetrf_batched @@ -960,6 +1002,8 @@ template static __device__ __forceinline__ hypre_int hypre_gpu_get_threadIdx(hypre_DeviceItem &item) { + HYPRE_UNUSED_VAR(item); + if (dim == 0) { return threadIdx.x; } if (dim == 1) { return threadIdx.y; } if (dim == 2) { return threadIdx.z; } @@ -972,6 +1016,8 @@ template static __device__ __forceinline__ hypre_int hypre_gpu_get_blockIdx(hypre_DeviceItem &item) { + HYPRE_UNUSED_VAR(item); + if (dim == 0) { return blockIdx.x; } if (dim == 1) { return blockIdx.y; } if (dim == 2) { return blockIdx.z; } @@ -984,6 +1030,8 @@ template static __device__ __forceinline__ hypre_int hypre_gpu_get_blockDim(hypre_DeviceItem &item) { + HYPRE_UNUSED_VAR(item); + if (dim == 0) { return blockDim.x; } if (dim == 1) { return blockDim.y; } if (dim == 2) { return blockDim.z; } @@ -996,6 +1044,8 @@ template static __device__ __forceinline__ hypre_int hypre_gpu_get_num_threads(hypre_DeviceItem &item) { + HYPRE_UNUSED_VAR(item); + switch (dim) { case 1: @@ -1014,6 +1064,8 @@ template static __device__ __forceinline__ hypre_int hypre_gpu_get_thread_id(hypre_DeviceItem &item) { + HYPRE_UNUSED_VAR(item); + switch (dim) { case 1: @@ -1033,6 +1085,8 @@ template static __device__ __forceinline__ hypre_int hypre_gpu_get_num_warps(hypre_DeviceItem &item) { + HYPRE_UNUSED_VAR(item); + return hypre_gpu_get_num_threads(item) >> HYPRE_WARP_BITSHIFT; } @@ -1041,6 +1095,8 @@ template static __device__ __forceinline__ hypre_int hypre_gpu_get_warp_id(hypre_DeviceItem &item) { + HYPRE_UNUSED_VAR(item); + return hypre_gpu_get_thread_id(item) >> HYPRE_WARP_BITSHIFT; } @@ -1049,6 +1105,8 @@ template static __device__ __forceinline__ hypre_int hypre_gpu_get_lane_id(hypre_DeviceItem &item) { + HYPRE_UNUSED_VAR(item); + return hypre_gpu_get_thread_id(item) & (HYPRE_WARP_SIZE - 1); } @@ -1075,6 +1133,8 @@ template static __device__ __forceinline__ hypre_int hypre_gpu_get_block_id(hypre_DeviceItem &item) { + HYPRE_UNUSED_VAR(item); + switch (dim) { case 1: @@ -1094,6 +1154,8 @@ template static __device__ __forceinline__ hypre_int hypre_gpu_get_grid_num_threads(hypre_DeviceItem &item) { + HYPRE_UNUSED_VAR(item); + return hypre_gpu_get_num_blocks() * hypre_gpu_get_num_threads(item); } @@ -1102,6 +1164,8 @@ template static __device__ __forceinline__ hypre_int hypre_gpu_get_grid_thread_id(hypre_DeviceItem &item) { + HYPRE_UNUSED_VAR(item); + return hypre_gpu_get_block_id(item) * hypre_gpu_get_num_threads(item) + hypre_gpu_get_thread_id(item); } @@ -1111,6 +1175,8 @@ template static __device__ __forceinline__ hypre_int hypre_gpu_get_grid_num_warps(hypre_DeviceItem &item) { + HYPRE_UNUSED_VAR(item); + return hypre_gpu_get_num_blocks() * hypre_gpu_get_num_warps(item); } @@ -1119,6 +1185,8 @@ template static __device__ __forceinline__ hypre_int hypre_gpu_get_grid_warp_id(hypre_DeviceItem &item) { + HYPRE_UNUSED_VAR(item); + return hypre_gpu_get_block_id(item) * hypre_gpu_get_num_warps(item) + hypre_gpu_get_warp_id(item); } @@ -1160,6 +1228,8 @@ template static __device__ __forceinline__ T __shfl_sync(hypre_mask mask, T val, hypre_int src_line, hypre_int width = HYPRE_WARP_SIZE) { + HYPRE_UNUSED_VAR(mask); + return __shfl(val, src_line, width); } @@ -1167,6 +1237,8 @@ template static __device__ __forceinline__ T __shfl_up_sync(hypre_mask mask, T val, hypre_uint delta, hypre_int width = HYPRE_WARP_SIZE) { + HYPRE_UNUSED_VAR(mask); + return __shfl_up(val, delta, width); } @@ -1174,6 +1246,8 @@ template static __device__ __forceinline__ T __shfl_down_sync(hypre_mask mask, T val, hypre_uint delta, hypre_int width = HYPRE_WARP_SIZE) { + HYPRE_UNUSED_VAR(mask); + return __shfl_down(val, delta, width); } @@ -1181,6 +1255,8 @@ template static __device__ __forceinline__ T __shfl_xor_sync(hypre_mask mask, T val, hypre_int lanemask, hypre_int width = HYPRE_WARP_SIZE) { + HYPRE_UNUSED_VAR(mask); + return __shfl_xor(val, lanemask, width); } @@ -1194,9 +1270,12 @@ void __syncwarp() static __device__ __forceinline__ hypre_mask hypre_ballot_sync(hypre_DeviceItem &item, hypre_mask mask, hypre_int predicate) { + HYPRE_UNUSED_VAR(item); + #if defined(HYPRE_USING_CUDA) return __ballot_sync(mask, predicate); #else + HYPRE_UNUSED_VAR(mask); return __ballot(predicate); #endif } @@ -1225,6 +1304,8 @@ HYPRE_Int hypre_ffs(hypre_mask mask) static __device__ __forceinline__ hypre_int __any_sync(unsigned mask, hypre_int predicate) { + HYPRE_UNUSED_VAR(mask); + return __any(predicate); } #endif @@ -1233,6 +1314,8 @@ hypre_int __any_sync(unsigned mask, hypre_int predicate) static __device__ __forceinline__ void block_sync(hypre_DeviceItem &item) { + HYPRE_UNUSED_VAR(item); + __syncthreads(); } @@ -1240,6 +1323,8 @@ void block_sync(hypre_DeviceItem &item) static __device__ __forceinline__ void warp_sync(hypre_DeviceItem &item) { + HYPRE_UNUSED_VAR(item); + __syncwarp(); } @@ -1248,6 +1333,8 @@ template static __device__ __forceinline__ T warp_prefix_sum(hypre_DeviceItem &item, hypre_int lane_id, T in, T &all_sum) { + HYPRE_UNUSED_VAR(item); + #pragma unroll for (hypre_int d = 2; d <= HYPRE_WARP_SIZE; d <<= 1) { @@ -1288,6 +1375,8 @@ T warp_prefix_sum(hypre_DeviceItem &item, hypre_int lane_id, T in, T &all_sum) static __device__ __forceinline__ hypre_int warp_any_sync(hypre_DeviceItem &item, hypre_mask mask, hypre_int predicate) { + HYPRE_UNUSED_VAR(item); + return __any_sync(mask, predicate); } @@ -1296,6 +1385,8 @@ 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) { + HYPRE_UNUSED_VAR(item); + return __shfl_sync(mask, val, src_line, width); } @@ -1304,6 +1395,8 @@ 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) { + HYPRE_UNUSED_VAR(item); + return __shfl_up_sync(mask, val, delta, width); } @@ -1312,6 +1405,8 @@ 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) { + HYPRE_UNUSED_VAR(item); + return __shfl_down_sync(mask, val, delta, width); } @@ -1320,6 +1415,8 @@ 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) { + HYPRE_UNUSED_VAR(item); + return __shfl_xor_sync(mask, val, lane_mask, width); } @@ -1327,6 +1424,8 @@ template static __device__ __forceinline__ T warp_reduce_sum(hypre_DeviceItem &item, T in) { + HYPRE_UNUSED_VAR(item); + #pragma unroll for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) { @@ -1339,6 +1438,8 @@ template static __device__ __forceinline__ T warp_allreduce_sum(hypre_DeviceItem &item, T in) { + HYPRE_UNUSED_VAR(item); + #pragma unroll for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) { @@ -1351,6 +1452,8 @@ template static __device__ __forceinline__ T warp_reduce_max(hypre_DeviceItem &item, T in) { + HYPRE_UNUSED_VAR(item); + #pragma unroll for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) { @@ -1363,6 +1466,8 @@ template static __device__ __forceinline__ T warp_allreduce_max(hypre_DeviceItem &item, T in) { + HYPRE_UNUSED_VAR(item); + #pragma unroll for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) { @@ -1375,6 +1480,8 @@ template static __device__ __forceinline__ T warp_reduce_min(hypre_DeviceItem &item, T in) { + HYPRE_UNUSED_VAR(item); + #pragma unroll for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) { @@ -1387,6 +1494,8 @@ template static __device__ __forceinline__ T warp_allreduce_min(hypre_DeviceItem &item, T in) { + HYPRE_UNUSED_VAR(item); + #pragma unroll for (hypre_int d = HYPRE_WARP_SIZE >> 1; d > 0; d >>= 1) { diff --git a/src/utilities/error.c b/src/utilities/error.c index e48b74a645..5296e871c3 100644 --- a/src/utilities/error.c +++ b/src/utilities/error.c @@ -8,8 +8,10 @@ #include "_hypre_utilities.h" /* Global variable for error handling */ +/* guard definition of global variables to avoid linker errors for multiprecision build */ +#if defined (hypre_DEFINE_GLOBAL) hypre_Error hypre__global_error = {0, 0, 0, HYPRE_INT_MAX, NULL, 0, 0}; - +#endif /*-------------------------------------------------------------------------- * Process the error raised on the given line of the given source file *--------------------------------------------------------------------------*/ diff --git a/src/utilities/error.h b/src/utilities/error.h index 38dace434f..77b146c65f 100644 --- a/src/utilities/error.h +++ b/src/utilities/error.h @@ -48,9 +48,12 @@ 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) +#if defined(HYPRE_MIXED_PRECISION) +#define hypre_error_w_msg_mp(IERR, msg) hypre_error_handler_dbl(__FILE__, __LINE__, IERR, msg) +#endif +#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 */ diff --git a/src/utilities/exchange_data.h b/src/utilities/exchange_data.h index ed2531f8e2..c1b72f84fa 100644 --- a/src/utilities/exchange_data.h +++ b/src/utilities/exchange_data.h @@ -41,11 +41,24 @@ typedef struct } hypre_DataExchangeResponse; -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_CreateBinaryTree(HYPRE_Int myid, + HYPRE_Int num_procs, + hypre_BinaryTree **tree_ptr); +HYPRE_Int +hypre_DestroyBinaryTree(hypre_BinaryTree *tree); +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/src/utilities/fortran_matrix.c b/src/utilities/fortran_matrix.c index b881a52ce5..6f21606be0 100644 --- a/src/utilities/fortran_matrix.c +++ b/src/utilities/fortran_matrix.c @@ -9,7 +9,7 @@ #include #include -#include "fortran_matrix.h" +#include "_hypre_fortran_matrix.h" #include "_hypre_utilities.h" utilities_FortranMatrix* @@ -828,4 +828,3 @@ utilities_FortranMatrixPrint( utilities_FortranMatrix* mtx, const char *fileName fclose(fp); return 0; } - diff --git a/src/utilities/functors.h b/src/utilities/functors.h index c721696ec2..d160dda72c 100644 --- a/src/utilities/functors.h +++ b/src/utilities/functors.h @@ -96,5 +96,22 @@ struct hypreFunctor_IndexCycle } }; +/*-------------------------------------------------------------------------- + * Functor to check: |x| > tol + *--------------------------------------------------------------------------*/ + +struct hypreFunctor_NonzeroAboveTol +{ + HYPRE_Real tol; + + hypreFunctor_NonzeroAboveTol(HYPRE_Real tol_) : tol(tol_) {} + + __host__ __device__ + bool operator()(const HYPRE_Complex& x) const + { + return hypre_cabs(x) > tol; + } +}; + #endif /* if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) */ #endif /* ifndef HYPRE_FUNCTORS_H */ diff --git a/src/utilities/general.c b/src/utilities/general.c index 158d3981f7..151a72f242 100644 --- a/src/utilities/general.c +++ b/src/utilities/general.c @@ -18,7 +18,9 @@ /* global variable _hypre_handle: * Outside this file, do NOT access it directly, * but use hypre_handle() instead (see handle.h) */ +#if defined (hypre_DEFINE_GLOBAL) hypre_Handle *_hypre_handle = NULL; +#endif /* accessor to the global ``_hypre_handle'' */ hypre_Handle* @@ -41,7 +43,8 @@ hypre_HandleCreate(void) 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_HandleLogLevel(hypre_handle_) = 0; + hypre_HandleLogLevelSaved(hypre_handle_) = 0; hypre_HandleMemoryLocation(hypre_handle_) = HYPRE_MEMORY_DEVICE; #if defined(HYPRE_USING_GPU) || defined(HYPRE_USING_DEVICE_OPENMP) diff --git a/src/utilities/general.h b/src/utilities/general.h index 161289bd97..0c5d850040 100644 --- a/src/utilities/general.h +++ b/src/utilities/general.h @@ -33,10 +33,6 @@ typedef unsigned long long int hypre_ulonglongint; typedef uint32_t hypre_uint32; typedef uint64_t hypre_uint64; -/* This allows us to consistently avoid 'float' and 'double' throughout hypre */ -typedef float hypre_float; -typedef double hypre_double; - /*-------------------------------------------------------------------------- * Define macros *--------------------------------------------------------------------------*/ diff --git a/src/utilities/gselim.h b/src/utilities/gselim.h index cca92ba9dd..c9b6074a68 100644 --- a/src/utilities/gselim.h +++ b/src/utilities/gselim.h @@ -8,22 +8,17 @@ #ifndef HYPRE_GSELIM_H #define HYPRE_GSELIM_H -#define hypre_gselim(A,x,n,error) \ +#define hypre_gselim(A,x,n) \ { \ HYPRE_Int j,k,m; \ HYPRE_Real factor; \ HYPRE_Real divA; \ - error = 0; \ if (n == 1) /* A is 1x1 */ \ { \ if (A[0] != 0.0) \ { \ x[0] = x[0]/A[0]; \ } \ - else \ - { \ - error++; \ - } \ } \ else/* A is nxn. Forward elimination */ \ { \ diff --git a/src/utilities/handle.c b/src/utilities/handle.c index 8abaf30bd3..f9c9ef44aa 100644 --- a/src/utilities/handle.c +++ b/src/utilities/handle.c @@ -15,17 +15,42 @@ #include "_hypre_utilities.hpp" /*-------------------------------------------------------------------------- - * hypre_SetLogLevel + * Set log level and update temporary log level with previous state *--------------------------------------------------------------------------*/ HYPRE_Int hypre_SetLogLevel(HYPRE_Int log_level) { + hypre_HandleLogLevelSaved(hypre_handle()) = hypre_HandleLogLevel(hypre_handle()); hypre_HandleLogLevel(hypre_handle()) = log_level; return hypre_error_flag; } +/*-------------------------------------------------------------------------- + * Set temporary variable for the log level + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SetLogLevelSaved(HYPRE_Int log_level_saved) +{ + hypre_HandleLogLevelSaved(hypre_handle()) = log_level_saved; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Restore log level value from the saved variable + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_RestoreLogLevel(void) +{ + hypre_HandleLogLevel(hypre_handle()) = hypre_HandleLogLevelSaved(hypre_handle()); + + return hypre_error_flag; +} + /*-------------------------------------------------------------------------- * hypre_SetSpTransUseVendor *--------------------------------------------------------------------------*/ diff --git a/src/utilities/handle.h b/src/utilities/handle.h index 7ca8c12442..44ce6d382c 100644 --- a/src/utilities/handle.h +++ b/src/utilities/handle.h @@ -34,6 +34,7 @@ typedef void (*GPUMfreeFunc)(void *); typedef struct { HYPRE_Int log_level; + HYPRE_Int log_level_saved; HYPRE_Int hypre_error; HYPRE_MemoryLocation memory_location; HYPRE_ExecutionPolicy default_exec_policy; @@ -82,6 +83,7 @@ typedef struct /* accessor macros to hypre_Handle */ #define hypre_HandleLogLevel(hypre_handle) ((hypre_handle) -> log_level) +#define hypre_HandleLogLevelSaved(hypre_handle) ((hypre_handle) -> log_level_saved) #define hypre_HandleMemoryLocation(hypre_handle) ((hypre_handle) -> memory_location) #define hypre_HandleDefaultExecPolicy(hypre_handle) ((hypre_handle) -> default_exec_policy) @@ -145,4 +147,5 @@ typedef struct #define hypre_HandleMagmaQueue(hypre_handle) ((hypre_handle) -> magma_queue) +extern hypre_Handle *_hypre_handle; #endif diff --git a/src/utilities/headers b/src/utilities/headers index 7de3d3a8b2..841f787ffb 100755 --- a/src/utilities/headers +++ b/src/utilities/headers @@ -23,6 +23,10 @@ cat > $INTERNAL_HEADER <<@ #include #endif +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_utilities_mup_def.h" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -56,6 +60,8 @@ cat int_array.h >> $INTERNAL_HEADER cat protos.h >> $INTERNAL_HEADER cat hopscotch_hash.h >> $INTERNAL_HEADER cat mmio.h >> $INTERNAL_HEADER +cat _hypre_fortran_matrix.h >> $INTERNAL_HEADER +cat multiprecision.h >> $INTERNAL_HEADER #=========================================================================== # Include guards @@ -67,6 +73,17 @@ cat >> $INTERNAL_HEADER <<@ } #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_utilities_mup_undef.h" +#include "_hypre_utilities_mup.h" +#endif +#endif + #endif @ @@ -85,6 +102,11 @@ cat > $INTERNAL_HEADER <<@ #ifndef hypre_UTILITIES_HPP #define hypre_UTILITIES_HPP +#include + +#ifdef HYPRE_MIXED_PRECISION +#include "_hypre_utilities_mup_def.h" +#endif #ifdef __cplusplus extern "C++" { @@ -113,6 +135,17 @@ cat >> $INTERNAL_HEADER <<@ } #endif +#ifdef HYPRE_MIXED_PRECISION +/* The following is for user compiles and the order is important. The first + * header ensures that we do not change prototype names in user files or in the + * second header file. The second header contains all the prototypes needed by + * users for mixed precision. */ +#ifndef hypre_MP_BUILD +#include "_hypre_utilities_mup_undef.h" +#include "_hypre_utilities_mup.h" +#endif +#endif + #endif @ diff --git a/src/utilities/memory.c b/src/utilities/memory.c index 22a32edff4..bea4b94513 100644 --- a/src/utilities/memory.c +++ b/src/utilities/memory.c @@ -196,13 +196,11 @@ hypre_UnifiedMemPrefetch(void *ptr, size_t size, hypre_MemoryLocation location) #if defined(HYPRE_USING_CUDA) if (location == hypre_MEMORY_DEVICE) { - HYPRE_CUDA_CALL( cudaMemPrefetchAsync(ptr, size, hypre_HandleDevice(hypre_handle()), - hypre_HandleComputeStream(hypre_handle())) ); + HYPRE_MEM_PREFETCH_DEVICE(ptr, size, hypre_HandleComputeStream(hypre_handle())); } else if (location == hypre_MEMORY_HOST) { - HYPRE_CUDA_CALL( cudaMemPrefetchAsync(ptr, size, cudaCpuDeviceId, - hypre_HandleComputeStream(hypre_handle())) ); + HYPRE_MEM_PREFETCH_HOST(ptr, size, hypre_HandleComputeStream(hypre_handle())); } #elif defined(HYPRE_USING_HIP) @@ -450,7 +448,7 @@ hypre_MAlloc_core(size_t size, HYPRE_Int zeroinit, hypre_MemoryLocation location } void * -_hypre_MAlloc(size_t size, hypre_MemoryLocation location) +hypre__MAlloc(size_t size, hypre_MemoryLocation location) { return hypre_MAlloc_core(size, 0, location); } @@ -592,7 +590,7 @@ hypre_Free_core(void *ptr, hypre_MemoryLocation location) } void -_hypre_Free(void *ptr, hypre_MemoryLocation location) +hypre__Free(void *ptr, hypre_MemoryLocation location) { hypre_Free_core(ptr, location); } diff --git a/src/utilities/memory.h b/src/utilities/memory.h index 64c44f4407..8662cfa6c7 100644 --- a/src/utilities/memory.h +++ b/src/utilities/memory.h @@ -131,8 +131,8 @@ hypre_GetActualMemLocation(HYPRE_MemoryLocation location) #define hypre_TAlloc(type, count, location) \ ( (type *) hypre_MAlloc((size_t)(sizeof(type) * (count)), location) ) -#define _hypre_TAlloc(type, count, location) \ -( (type *) _hypre_MAlloc((size_t)(sizeof(type) * (count)), location) ) +#define hypre__TAlloc(type, count, location) \ +( (type *) hypre__MAlloc((size_t)(sizeof(type) * (count)), location) ) #define hypre_CTAlloc(type, count, location) \ ( (type *) hypre_CAlloc((size_t)(count), (size_t)sizeof(type), location) ) @@ -149,8 +149,8 @@ hypre_GetActualMemLocation(HYPRE_MemoryLocation location) #define hypre_TFree(ptr, location) \ ( hypre_Free((void *)ptr, location), ptr = NULL ) -#define _hypre_TFree(ptr, location) \ -( _hypre_Free((void *)ptr, location), ptr = NULL ) +#define hypre__TFree(ptr, location) \ +( hypre__Free((void *)ptr, location), ptr = NULL ) #endif /* #if !defined(HYPRE_USING_MEMORY_TRACKER) */ @@ -172,9 +172,8 @@ void hypre_Memcpy(void *dst, void *src, size_t size, HYPRE_MemoryLocation loc_ 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); - -void * _hypre_MAlloc(size_t size, hypre_MemoryLocation location); -void _hypre_Free(void *ptr, hypre_MemoryLocation location); +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, diff --git a/src/utilities/memory_tracker.c b/src/utilities/memory_tracker.c index 8b2a2e4703..527e0c0123 100644 --- a/src/utilities/memory_tracker.c +++ b/src/utilities/memory_tracker.c @@ -419,7 +419,7 @@ hypre_PrintMemoryTracker( size_t *totl_bytes_o, { hypre_assert(p->ptr == entry->ptr); entry->pair = p->index; - hypre_assert(qf->data[p->index].pair == -1); + //hypre_assert(qf->data[p->index].pair == -1); /* pair is an unsigned integer */ hypre_assert(qq[i].head - 1 == entry->index); qf->data[p->index].pair = entry->index; qf->data[p->index].nbytes = entry->nbytes; diff --git a/src/utilities/memory_tracker.h b/src/utilities/memory_tracker.h index 72eb01469d..5d4bf4961c 100644 --- a/src/utilities/memory_tracker.h +++ b/src/utilities/memory_tracker.h @@ -149,10 +149,10 @@ extern hypre_MemoryTracker *_hypre_memory_tracker; } \ ) -#define _hypre_TAlloc(type, count, location) \ +#define hypre__TAlloc(type, count, location) \ ( \ { \ - void *ptr = _hypre_MAlloc((size_t)(sizeof(type) * (count)), location); \ + void *ptr = hypre__MAlloc((size_t)(sizeof(type) * (count)), location); \ \ hypre_MemoryTrackerInsert1("malloc", ptr, sizeof(type)*(count), location, \ __FILE__, __func__, __LINE__); \ @@ -160,10 +160,10 @@ extern hypre_MemoryTracker *_hypre_memory_tracker; } \ ) -#define _hypre_TFree(ptr, location) \ +#define hypre__TFree(ptr, location) \ ( \ { \ - _hypre_Free((void *)ptr, location); \ + hypre__Free((void *)ptr, location); \ \ hypre_MemoryTrackerInsert1("free", ptr, (size_t) -1, location, \ __FILE__, __func__, __LINE__); \ @@ -173,4 +173,3 @@ extern hypre_MemoryTracker *_hypre_memory_tracker; #endif /* #if defined(HYPRE_USING_MEMORY_TRACKER) */ #endif /* #ifndef hypre_MEMORY_TRACKER_HEADER */ - diff --git a/src/utilities/mpi_comm_f2c.c b/src/utilities/mpi_comm_f2c.c deleted file mode 100644 index 81534db42e..0000000000 --- a/src/utilities/mpi_comm_f2c.c +++ /dev/null @@ -1,27 +0,0 @@ -/****************************************************************************** - * Copyright (c) 1998 Lawrence Livermore 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 -#include "fortran.h" -#ifndef HYPRE_SEQUENTIAL -#include -#endif - -/*-------------------------------------------------------------------------- - *--------------------------------------------------------------------------*/ - -#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) -{ - *c_comm = (hypre_F90_Obj) hypre_MPI_Comm_f2c( (hypre_int) * f_comm ); - *ierr = 0; -} -#endif diff --git a/src/utilities/mpistubs.c b/src/utilities/mpistubs.c index c694852619..50e2a288f8 100644 --- a/src/utilities/mpistubs.c +++ b/src/utilities/mpistubs.c @@ -56,13 +56,13 @@ hypre_MPI_Abort( hypre_MPI_Comm comm, return (0); } -HYPRE_Real +hypre_double hypre_MPI_Wtime( void ) { return (0.0); } -HYPRE_Real +hypre_double hypre_MPI_Wtick( void ) { return (0.0); @@ -912,6 +912,21 @@ HYPRE_Int hypre_MPI_Info_free( hypre_MPI_Info *info ) } #endif +HYPRE_Int +hypre_MPI_CheckCommMatrix( hypre_MPI_Comm comm, + HYPRE_Int num_recvs, + HYPRE_Int *recvs, + HYPRE_Int num_sends, + HYPRE_Int *sends ) +{ + HYPRE_UNUSED_VAR(comm); + HYPRE_UNUSED_VAR(num_recvs); + HYPRE_UNUSED_VAR(recvs); + HYPRE_UNUSED_VAR(num_sends); + HYPRE_UNUSED_VAR(sends); + return (0); +} + /****************************************************************************** * MPI stubs to do casting of HYPRE_Int and hypre_int correctly *****************************************************************************/ @@ -938,16 +953,16 @@ hypre_MPI_Abort( hypre_MPI_Comm comm, return (HYPRE_Int) MPI_Abort(comm, (hypre_int)errorcode); } -HYPRE_Real +hypre_double hypre_MPI_Wtime( void ) { - return (HYPRE_Real)MPI_Wtime(); + return MPI_Wtime(); } -HYPRE_Real +hypre_double hypre_MPI_Wtick( void ) { - return (HYPRE_Real)MPI_Wtick(); + return MPI_Wtick(); } HYPRE_Int @@ -1659,4 +1674,118 @@ hypre_MPI_Info_free( hypre_MPI_Info *info ) } #endif +HYPRE_Int +hypre_MPI_CheckCommMatrix( hypre_MPI_Comm comm, + HYPRE_Int num_recvs, + HYPRE_Int *recvs, + HYPRE_Int num_sends, + HYPRE_Int *sends ) +{ + HYPRE_Int nprocs, myid; + + HYPRE_Int *displs = NULL; + HYPRE_Int *num_recvs_proc = NULL; + HYPRE_Int *num_sends_proc = NULL; + HYPRE_Int *global_recvs = NULL; + HYPRE_Int *global_sends = NULL; + + HYPRE_Int global_num_recvs; + HYPRE_Int global_num_sends; + HYPRE_Int from_proc, to_proc; + HYPRE_Int i, entry, proc, cnt; + + hypre_MPI_Comm_rank(comm, &myid); + hypre_MPI_Comm_size(comm, &nprocs); + + if (myid == 0) + { + num_recvs_proc = hypre_CTAlloc(HYPRE_Int, nprocs, HYPRE_MEMORY_HOST); + num_sends_proc = hypre_CTAlloc(HYPRE_Int, nprocs, HYPRE_MEMORY_HOST); + displs = hypre_CTAlloc(HYPRE_Int, nprocs + 1, HYPRE_MEMORY_HOST); + } + + /* Gather receives */ + hypre_MPI_Gather(&num_recvs, 1, HYPRE_MPI_INT, + num_recvs_proc, 1, HYPRE_MPI_INT, + 0, comm); + if (myid == 0) + { + global_num_recvs = displs[0] = 0; + for (proc = 0; proc < nprocs; proc++) + { + global_num_recvs += num_recvs_proc[proc]; + displs[proc + 1] = displs[proc] + num_recvs_proc[proc]; + } + global_recvs = hypre_CTAlloc(HYPRE_Int, global_num_recvs, HYPRE_MEMORY_HOST); + } + hypre_MPI_Gatherv(recvs, num_recvs, HYPRE_MPI_INT, + global_recvs, num_recvs_proc, displs, HYPRE_MPI_INT, + 0, comm); + + /* Gather sends */ + hypre_MPI_Gather(&num_sends, 1, HYPRE_MPI_INT, + num_sends_proc, 1, HYPRE_MPI_INT, + 0, comm); + if (myid == 0) + { + global_num_sends = displs[0] = 0; + for (proc = 0; proc < nprocs; proc++) + { + global_num_sends += num_sends_proc[proc]; + displs[proc + 1] = displs[proc] + num_sends_proc[proc]; + } + global_sends = hypre_CTAlloc(HYPRE_Int, global_num_sends, HYPRE_MEMORY_HOST); + } + hypre_MPI_Gatherv(sends, num_sends, HYPRE_MPI_INT, + global_sends, num_sends_proc, displs, HYPRE_MPI_INT, + 0, comm); + + /* Check for matching send/recv. */ + if (myid == 0) + { + cnt = 0; + for (from_proc = 0; from_proc < nprocs; from_proc++) + { + for (i = 0; i < num_sends_proc[from_proc]; i++) + { + to_proc = global_sends[cnt++]; + entry = hypre_BinarySearch(&global_recvs[to_proc], from_proc, + num_recvs_proc[to_proc]); + if (entry == -1) + { + hypre_printf("Proc %d posts a send to proc %d without a matching recv!\n", + from_proc, to_proc); + } + } + } + + cnt = 0; + for (from_proc = 0; from_proc < nprocs; from_proc++) + { + for (i = 0; i < num_recvs_proc[from_proc]; i++) + { + to_proc = global_recvs[cnt++]; + entry = hypre_BinarySearch(&global_sends[to_proc], from_proc, + num_sends_proc[to_proc]); + if (entry == -1) + { + hypre_printf("Proc %d posts a recv to proc %d without a matching send!\n", + from_proc, to_proc); + } + } + } + } + + if (myid == 0) + { + hypre_TFree(displs, HYPRE_MEMORY_HOST); + hypre_TFree(num_recvs_proc, HYPRE_MEMORY_HOST); + hypre_TFree(num_sends_proc, HYPRE_MEMORY_HOST); + hypre_TFree(global_recvs, HYPRE_MEMORY_HOST); + hypre_TFree(global_sends, HYPRE_MEMORY_HOST); + } + + return hypre_error_flag; +} + #endif diff --git a/src/utilities/mpistubs.h b/src/utilities/mpistubs.h index 50cf780ef4..f2a061bb25 100644 --- a/src/utilities/mpistubs.h +++ b/src/utilities/mpistubs.h @@ -255,8 +255,8 @@ typedef MPI_User_function hypre_MPI_User_function; 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_Real hypre_MPI_Wtime( void ); -HYPRE_Real hypre_MPI_Wtick( void ); +hypre_double hypre_MPI_Wtime( void ); +hypre_double 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 ); @@ -349,6 +349,8 @@ HYPRE_Int hypre_MPI_Comm_split_type(hypre_MPI_Comm comm, HYPRE_Int split_type, H HYPRE_Int hypre_MPI_Info_create(hypre_MPI_Info *info); HYPRE_Int hypre_MPI_Info_free( hypre_MPI_Info *info ); #endif +HYPRE_Int hypre_MPI_CheckCommMatrix( hypre_MPI_Comm comm, HYPRE_Int num_recvs, HYPRE_Int *recvs, + HYPRE_Int num_sends, HYPRE_Int *sends ); #ifdef __cplusplus } diff --git a/src/utilities/multiprecision.c b/src/utilities/multiprecision.c new file mode 100644 index 0000000000..fefbbf4c8b --- /dev/null +++ b/src/utilities/multiprecision.c @@ -0,0 +1,69 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_MIXED_PRECISION) + +/* Global variable for default runtime precision */ +/* No guard is needed since this file is only compiled once */ +HYPRE_Precision hypre__global_precision = HYPRE_REAL_DOUBLE; + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Precision +hypre_GlobalPrecision() +{ + return hypre__global_precision; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetGlobalPrecision(HYPRE_Precision precision) +{ + hypre__global_precision = precision; + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GetGlobalPrecision(HYPRE_Precision *precision) +{ + *precision = hypre_GlobalPrecision(); + + return hypre_error_flag; +} + +#else + +/*-------------------------------------------------------------------------- + * non-multiprecision case + *--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetGlobalPrecision(HYPRE_Precision precision) +{ + HYPRE_UNUSED_VAR(precision); + + return hypre_error_flag; +} + +HYPRE_Int +HYPRE_GetGlobalPrecision(HYPRE_Precision *precision) +{ + *precision = HYPRE_OBJECT_PRECISION; + + return hypre_error_flag; +} + +#endif diff --git a/src/utilities/multiprecision.h b/src/utilities/multiprecision.h new file mode 100644 index 0000000000..623d4beb73 --- /dev/null +++ b/src/utilities/multiprecision.h @@ -0,0 +1,37 @@ +/****************************************************************************** + * 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_MULTIPRECISION_HEADER +#define hypre_MULTIPRECISION_HEADER + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef HYPRE_MIXED_PRECISION + +/*-------------------------------------------------------------------------- + * Global variable + *--------------------------------------------------------------------------*/ + +extern HYPRE_Precision hypre__global_precision; + +/*-------------------------------------------------------------------------- + * Prototypes + *--------------------------------------------------------------------------*/ + +HYPRE_Precision +hypre_GlobalPrecision(); + +#endif + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/src/utilities/mup.exclude b/src/utilities/mup.exclude new file mode 100644 index 0000000000..d5538ac246 --- /dev/null +++ b/src/utilities/mup.exclude @@ -0,0 +1,13 @@ +HYPRE_SetGlobalPrecision +HYPRE_GetGlobalPrecision +free_format +hypre_fprintf +hypre_fscanf +hypre_ndigits +hypre_ParPrintf +hypre_printf +hypre_scanf +hypre_snprintf +hypre_sprintf +hypre_sscanf +new_format diff --git a/src/utilities/mup.fixed b/src/utilities/mup.fixed new file mode 100644 index 0000000000..c7e3cb8ebf --- /dev/null +++ b/src/utilities/mup.fixed @@ -0,0 +1,275 @@ +hypre_BeginTiming_fcn +hypre_BigBinarySearch +hypre_BigLowerBound +hypre_BigQsort0 +hypre_BigQsort1 +hypre_BigQsort2i +hypre_BigQsort4_abs +hypre_BigQsortb2i +hypre_BigQsortbLoc +hypre_BigQsortbi +hypre_BigSwap +hypre_BigSwap2 +hypre_BigSwap2i +hypre_BigSwap4_d +hypre_BigSwapLoc +hypre_BigSwapb2i +hypre_BigSwapbi +hypre_BinarySearch +hypre_BinarySearch2 +hypre_CAlloc +hypre_CheckDirExists +hypre_CheckMemoryLocation +hypre_ClearTiming_fcn +hypre_ConvertIndicesToString +hypre_CreateBinaryTree +hypre_CreateDir +hypre_CreateNextDirOfSequence +hypre_DataExchangeList +hypre_DestroyBinaryTree +hypre_DoubleQuickSplit +hypre_EndTiming_fcn +hypre_FinalizeAllTimings_fcn +hypre_FinalizeTiming_fcn +hypre_Finalized +hypre_Free +hypre_GetDevice +hypre_GetDeviceCount +hypre_GetDeviceLastError +hypre_GetDeviceMaxShmemSize +hypre_GetExecPolicy1 +hypre_GetExecPolicy2 +hypre_GetGpuAwareMPI +hypre_GetMemoryLocationName +hypre_GetPointerLocation +hypre_GetSimpleThreadPartition +hypre_GetTiming_fcn +hypre_GpuProfilingPopRange +hypre_GpuProfilingPushRange +hypre_GpuProfilingPushRangeColor +hypre_HandleCreate +hypre_HandleDestroy +hypre_HostMemoryGetUsage +hypre_IncFLOPCount_fcn +hypre_InitializeTiming_fcn +hypre_Initialized +hypre_IntArrayArrayCreate +hypre_IntArrayArrayDestroy +hypre_IntArrayArrayInitialize +hypre_IntArrayArrayInitializeIn +hypre_IntArrayArrayMigrate +hypre_IntArrayCloneDeep +hypre_IntArrayCloneDeep_v2 +hypre_IntArrayCopy +hypre_IntArrayCount +hypre_IntArrayCountHost +hypre_IntArrayCreate +hypre_IntArrayDestroy +hypre_IntArrayInitialize +hypre_IntArrayInitialize_v2 +hypre_IntArrayInverseMapping +hypre_IntArrayInverseMappingHost +hypre_IntArrayMergeOrdered +hypre_IntArrayMigrate +hypre_IntArrayNegate +hypre_IntArrayPrint +hypre_IntArrayRead +hypre_IntArraySeparateByValue +hypre_IntArraySetConstantValues +hypre_IntArraySetConstantValuesHost +hypre_IntArraySetInterleavedValues +hypre_IntArraySetInterleavedValuesHost +hypre_IntSequence +hypre_Log2 +hypre_LowerBound +hypre_MAlloc +hypre_MPI_Abort +hypre_MPI_Address +hypre_MPI_Allgather +hypre_MPI_Allgatherv +hypre_MPI_Allreduce +hypre_MPI_Alltoall +hypre_MPI_Barrier +hypre_MPI_Bcast +hypre_MPI_CheckCommMatrix +hypre_MPI_Comm_create +hypre_MPI_Comm_dup +hypre_MPI_Comm_f2c +hypre_MPI_Comm_free +hypre_MPI_Comm_group +hypre_MPI_Comm_rank +hypre_MPI_Comm_size +hypre_MPI_Comm_split +hypre_MPI_Finalize +hypre_MPI_Gather +hypre_MPI_Gatherv +hypre_MPI_Get_count +hypre_MPI_Group_free +hypre_MPI_Group_incl +hypre_MPI_Init +hypre_MPI_Iprobe +hypre_MPI_Irecv +hypre_MPI_Irsend +hypre_MPI_Isend +hypre_MPI_Op_create +hypre_MPI_Op_free +hypre_MPI_Probe +hypre_MPI_Recv +hypre_MPI_Recv_init +hypre_MPI_Reduce +hypre_MPI_Request_free +hypre_MPI_Scan +hypre_MPI_Scatter +hypre_MPI_Scatterv +hypre_MPI_Send +hypre_MPI_Send_init +hypre_MPI_Startall +hypre_MPI_Test +hypre_MPI_Testall +hypre_MPI_Type_commit +hypre_MPI_Type_contiguous +hypre_MPI_Type_free +hypre_MPI_Type_hvector +hypre_MPI_Type_struct +hypre_MPI_Type_vector +hypre_MPI_Wait +hypre_MPI_Waitall +hypre_MPI_Waitany +hypre_MPI_Wtick +hypre_MPI_Wtime +hypre_MatrixStatsArrayCreate +hypre_MatrixStatsArrayDestroy +hypre_MatrixStatsArrayPrint +hypre_MatrixStatsCreate +hypre_MatrixStatsDestroy +hypre_MemPrefetch +hypre_Memcpy +hypre_MemoryPrintUsage +hypre_Memset +hypre_PrefixSumInt +hypre_PrintTiming_fcn +hypre_Rand +hypre_RandI +hypre_ReAlloc +hypre_ReAlloc_v2 +hypre_RestoreLogLevel +hypre_SeedRand +hypre_SetCubMemPoolSize +hypre_SetDevice +hypre_SetFinalized +hypre_SetGaussSeidelMethod +hypre_SetGpuAwareMPI +hypre_SetInitialized +hypre_SetLogLevel +hypre_SetLogLevelSaved +hypre_SetSpGemmAlgorithm +hypre_SetSpGemmBinned +hypre_SetSpGemmRownnzEstimateMethod +hypre_SetSpGemmRownnzEstimateMultFactor +hypre_SetSpGemmRownnzEstimateNSamples +hypre_SetSpGemmUseVendor +hypre_SetSpMVUseVendor +hypre_SetSpTransUseVendor +hypre_SetUseGpuRand +hypre_SetUserDeviceMalloc +hypre_SetUserDeviceMfree +hypre_UniqueIntArrayND +hypre_UnorderedBigIntMapCreate +hypre_UnorderedBigIntMapDestroy +hypre_UnorderedBigIntSetCopyToArray +hypre_UnorderedBigIntSetCreate +hypre_UnorderedBigIntSetDestroy +hypre_UnorderedIntMapCreate +hypre_UnorderedIntMapDestroy +hypre_UnorderedIntSetCopyToArray +hypre_UnorderedIntSetCreate +hypre_UnorderedIntSetDestroy +hypre__Free +hypre__MAlloc +hypre_big_merge_sort +hypre_big_sort_and_create_inverse_map +hypre_bind_device +hypre_bind_device_id +hypre_checkerror +hypre_clearallerrors +hypre_clearerror +hypre_create_elt +hypre_dense_topo_sort +hypre_dispose_elt +hypre_enter_on_lists +hypre_error_code_restore +hypre_error_code_save +hypre_error_handler +hypre_error_handler_clear_messages +hypre_finalize +hypre_geterror +hypre_geterrorarg +hypre_handle +hypre_init +hypre_initialize +hypre_merge_sort +hypre_mm_is_valid +hypre_mm_read_banner +hypre_mm_read_mtx_crd_size +hypre_multmod +hypre_partition1D +hypre_prefix_sum +hypre_prefix_sum_multiple +hypre_prefix_sum_pair +hypre_prefix_sum_triple +hypre_qsort0 +hypre_qsort1 +hypre_qsort2 +hypre_qsort2_abs +hypre_qsort2i +hypre_qsort3 +hypre_qsort3_abs +hypre_qsort3i +hypre_qsort3ir +hypre_qsortND +hypre_qsort_abs +hypre_remove_point +hypre_setexecutionpolicy +hypre_setmemorylocation +hypre_setspgemmusevendor +hypre_strcpy +hypre_swap +hypre_swap2 +hypre_swap2i +hypre_swap3_d +hypre_swap3_d_perm +hypre_swap3i +hypre_swap_c +hypre_swap_d +hypre_topo_sort +hypre_union2 +time_getCPUSeconds +time_getWallclockSeconds +utilities_FortranMatrixAdd +utilities_FortranMatrixAllocateData +utilities_FortranMatrixClear +utilities_FortranMatrixClearL +utilities_FortranMatrixCopy +utilities_FortranMatrixCreate +utilities_FortranMatrixDMultiply +utilities_FortranMatrixDestroy +utilities_FortranMatrixFNorm +utilities_FortranMatrixGetDiagonal +utilities_FortranMatrixGlobalHeight +utilities_FortranMatrixHeight +utilities_FortranMatrixIndexCopy +utilities_FortranMatrixMaxValue +utilities_FortranMatrixMultiply +utilities_FortranMatrixMultiplyD +utilities_FortranMatrixPrint +utilities_FortranMatrixSelectBlock +utilities_FortranMatrixSetDiagonal +utilities_FortranMatrixSetToIdentity +utilities_FortranMatrixSymmetrize +utilities_FortranMatrixTransposeSquare +utilities_FortranMatrixUpperInv +utilities_FortranMatrixValue +utilities_FortranMatrixValuePtr +utilities_FortranMatrixValues +utilities_FortranMatrixWidth +utilities_FortranMatrixWrap diff --git a/src/utilities/mup.functions b/src/utilities/mup.functions new file mode 100644 index 0000000000..fcd4c16bf6 --- /dev/null +++ b/src/utilities/mup.functions @@ -0,0 +1,34 @@ +HYPRE_AssumedPartitionCheck +HYPRE_CheckError +HYPRE_ClearAllErrors +HYPRE_ClearError +HYPRE_ClearErrorMessages +HYPRE_DescribeError +HYPRE_DeviceInitialize +HYPRE_Finalize +HYPRE_Finalized +HYPRE_GetError +HYPRE_GetErrorArg +HYPRE_GetErrorMessages +HYPRE_GetExecutionPolicy +HYPRE_GetExecutionPolicyName +HYPRE_GetGlobalError +HYPRE_GetMemoryLocation +HYPRE_Initialize +HYPRE_Initialized +HYPRE_MemoryPrintUsage +HYPRE_PrintDeviceInfo +HYPRE_PrintErrorMessages +HYPRE_SetExecutionPolicy +HYPRE_SetGPUMemoryPoolSize +HYPRE_SetGpuAwareMPI +HYPRE_SetLogLevel +HYPRE_SetMemoryLocation +HYPRE_SetPrintErrorMode +HYPRE_SetPrintErrorVerbosity +HYPRE_SetSpGemmUseVendor +HYPRE_SetSpMVUseVendor +HYPRE_SetSpTransUseVendor +HYPRE_SetUseGpuRand +HYPRE_Version +HYPRE_VersionNumber diff --git a/src/utilities/mup.methods b/src/utilities/mup.methods new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/utilities/mup_code b/src/utilities/mup_code new file mode 100755 index 0000000000..1ce98c2c67 --- /dev/null +++ b/src/utilities/mup_code @@ -0,0 +1,7 @@ +#!/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) + +../config/gen_code.sh HYPRE_utilities.h _hypre_utilities.h mup diff --git a/src/utilities/mup_fixed.c b/src/utilities/mup_fixed.c new file mode 100644 index 0000000000..17b74efc49 --- /dev/null +++ b/src/utilities/mup_fixed.c @@ -0,0 +1,2115 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_utilities.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +hypre_BeginTiming_fcn( HYPRE_Int time_index ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BeginTiming_fcn)( time_index ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BigBinarySearch( HYPRE_BigInt *list, HYPRE_BigInt value, HYPRE_Int list_length ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BigBinarySearch)( list, value, list_length ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_BigInt * +hypre_BigLowerBound( HYPRE_BigInt *first, HYPRE_BigInt *last, HYPRE_BigInt value ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BigLowerBound)( first, last, value ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_BigQsort0( HYPRE_BigInt *v, HYPRE_Int left, HYPRE_Int right ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BigQsort0)( v, left, right ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_BigQsort1( HYPRE_BigInt *v, HYPRE_Real *w, HYPRE_Int left, HYPRE_Int right ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BigQsort1)( v, w, left, right ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_BigQsort2i( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int left, HYPRE_Int right ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BigQsort2i)( v, w, left, right ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_BigQsort4_abs( HYPRE_Real *v, HYPRE_BigInt *w, HYPRE_Int *z, HYPRE_Int *y, HYPRE_Int left, HYPRE_Int right ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BigQsort4_abs)( v, w, z, y, left, right ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_BigQsortb2i( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int left, HYPRE_Int right ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BigQsortb2i)( v, w, z, left, right ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_BigQsortbLoc( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int left, HYPRE_Int right ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BigQsortbLoc)( v, w, left, right ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_BigQsortbi( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int left, HYPRE_Int right ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BigQsortbi)( v, w, left, right ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_BigSwap( HYPRE_BigInt *v, HYPRE_Int i, HYPRE_Int j ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BigSwap)( v, i, j ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_BigSwap2( HYPRE_BigInt *v, HYPRE_Real *w, HYPRE_Int i, HYPRE_Int j ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BigSwap2)( v, w, i, j ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_BigSwap2i( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int i, HYPRE_Int j ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BigSwap2i)( v, w, i, j ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_BigSwap4_d( HYPRE_Real *v, HYPRE_BigInt *w, HYPRE_Int *z, HYPRE_Int *y, HYPRE_Int i, HYPRE_Int j ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BigSwap4_d)( v, w, z, y, i, j ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_BigSwapLoc( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int i, HYPRE_Int j ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BigSwapLoc)( v, w, i, j ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_BigSwapb2i( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int i, HYPRE_Int j ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BigSwapb2i)( v, w, z, i, j ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_BigSwapbi( HYPRE_BigInt *v, HYPRE_Int *w, HYPRE_Int i, HYPRE_Int j ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BigSwapbi)( v, w, i, j ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BinarySearch( HYPRE_Int *list, HYPRE_Int value, HYPRE_Int list_length ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BinarySearch)( list, value, list_length ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_BinarySearch2( HYPRE_Int *list, HYPRE_Int value, HYPRE_Int low, HYPRE_Int high, HYPRE_Int *spot ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_BinarySearch2)( list, value, low, high, spot ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_CAlloc( size_t count, size_t elt_size, HYPRE_MemoryLocation location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CAlloc)( count, elt_size, location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CheckDirExists( const char *path ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CheckDirExists)( path ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_CheckMemoryLocation( void *ptr, hypre_MemoryLocation location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CheckMemoryLocation)( ptr, location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_ClearTiming_fcn( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ClearTiming_fcn)( ); +} + +/*--------------------------------------------------------------------------*/ + +char* +hypre_ConvertIndicesToString( HYPRE_Int size, HYPRE_Int *indices ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ConvertIndicesToString)( size, indices ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CreateBinaryTree( HYPRE_Int myid, HYPRE_Int num_procs, hypre_BinaryTree **tree_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CreateBinaryTree)( myid, num_procs, tree_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CreateDir( const char *path ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CreateDir)( path ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_CreateNextDirOfSequence( const char *basepath, const char *prefix, char **fullpath_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_CreateNextDirOfSequence)( basepath, prefix, fullpath_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_DataExchangeList)( num_contacts, contact_proc_list, contact_send_buf, contact_send_buf_starts, contact_obj_size, response_obj_size, response_obj, max_response_size, rnum, comm, p_response_recv_buf, p_response_recv_buf_starts ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_DestroyBinaryTree( hypre_BinaryTree *tree ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_DestroyBinaryTree)( tree ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_DoubleQuickSplit( HYPRE_Real *values, HYPRE_Int *indices, HYPRE_Int list_length, HYPRE_Int NumberKept ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_DoubleQuickSplit)( values, indices, list_length, NumberKept ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_EndTiming_fcn( HYPRE_Int time_index ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_EndTiming_fcn)( time_index ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FinalizeAllTimings_fcn( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FinalizeAllTimings_fcn)( ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_FinalizeTiming_fcn( HYPRE_Int time_index ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_FinalizeTiming_fcn)( time_index ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_Finalized( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_Finalized)( ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_Free( void *ptr, HYPRE_MemoryLocation location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_Free)( ptr, location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GetDevice( hypre_int *device_id ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GetDevice)( device_id ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GetDeviceCount( hypre_int *device_count ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GetDeviceCount)( device_count ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GetDeviceLastError( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GetDeviceLastError)( ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GetDeviceMaxShmemSize( hypre_int device_id, hypre_int *max_size_ptr, hypre_int *max_size_optin_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GetDeviceMaxShmemSize)( device_id, max_size_ptr, max_size_optin_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_ExecutionPolicy +hypre_GetExecPolicy1( HYPRE_MemoryLocation location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GetExecPolicy1)( location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_ExecutionPolicy +hypre_GetExecPolicy2( HYPRE_MemoryLocation location1, HYPRE_MemoryLocation location2 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GetExecPolicy2)( location1, location2 ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GetGpuAwareMPI( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GetGpuAwareMPI)( ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GetMemoryLocationName( hypre_MemoryLocation memory_location, char *memory_location_name ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GetMemoryLocationName)( memory_location, memory_location_name ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GetPointerLocation( const void *ptr, hypre_MemoryLocation *memory_location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GetPointerLocation)( ptr, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_GetSimpleThreadPartition( HYPRE_Int *begin, HYPRE_Int *end, HYPRE_Int n ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GetSimpleThreadPartition)( begin, end, n ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_GetTiming_fcn( const char *heading, HYPRE_Real *wall_time_ptr, MPI_Comm comm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GetTiming_fcn)( heading, wall_time_ptr, comm ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_GpuProfilingPopRange( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GpuProfilingPopRange)( ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_GpuProfilingPushRange( const char *name ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GpuProfilingPushRange)( name ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_GpuProfilingPushRangeColor( const char *name, HYPRE_Int cid ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_GpuProfilingPushRangeColor)( name, cid ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_Handle* +hypre_HandleCreate( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_HandleCreate)( ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_HandleDestroy( hypre_Handle *hypre_handle_ ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_HandleDestroy)( hypre_handle_ ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_HostMemoryGetUsage( HYPRE_Real *mem ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_HostMemoryGetUsage)( mem ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IncFLOPCount_fcn( HYPRE_BigInt inc ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IncFLOPCount_fcn)( inc ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_InitializeTiming_fcn( const char *name ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_InitializeTiming_fcn)( name ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_Initialized( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_Initialized)( ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_IntArrayArray* +hypre_IntArrayArrayCreate( HYPRE_Int num_entries, HYPRE_Int *sizes ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IntArrayArrayCreate)( num_entries, sizes ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArrayArrayDestroy( hypre_IntArrayArray *w ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IntArrayArrayDestroy)( w ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArrayArrayInitialize( hypre_IntArrayArray *w ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IntArrayArrayInitialize)( w ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArrayArrayInitializeIn( hypre_IntArrayArray *w, HYPRE_MemoryLocation memory_location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IntArrayArrayInitializeIn)( w, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArrayArrayMigrate( hypre_IntArrayArray *w, HYPRE_MemoryLocation memory_location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IntArrayArrayMigrate)( w, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_IntArray* +hypre_IntArrayCloneDeep( hypre_IntArray *x ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IntArrayCloneDeep)( x ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_IntArray* +hypre_IntArrayCloneDeep_v2( hypre_IntArray *x, HYPRE_MemoryLocation memory_location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IntArrayCloneDeep_v2)( x, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArrayCopy( hypre_IntArray *x, hypre_IntArray *y ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IntArrayCopy)( x, y ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArrayCount( hypre_IntArray *v, HYPRE_Int value, HYPRE_Int *num_values_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IntArrayCount)( v, value, num_values_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArrayCountHost( hypre_IntArray *v, HYPRE_Int value, HYPRE_Int *num_values_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IntArrayCountHost)( v, value, num_values_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_IntArray* +hypre_IntArrayCreate( HYPRE_Int size ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IntArrayCreate)( size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArrayDestroy( hypre_IntArray *array ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IntArrayDestroy)( array ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArrayInitialize( hypre_IntArray *array ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IntArrayInitialize)( array ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArrayInitialize_v2( hypre_IntArray *array, HYPRE_MemoryLocation memory_location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IntArrayInitialize_v2)( array, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArrayInverseMapping( hypre_IntArray *v, hypre_IntArray **w_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IntArrayInverseMapping)( v, w_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArrayMergeOrdered( hypre_IntArray *array1, hypre_IntArray *array2, hypre_IntArray *array3 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IntArrayMergeOrdered)( array1, array2, array3 ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArrayMigrate( hypre_IntArray *v, HYPRE_MemoryLocation memory_location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IntArrayMigrate)( v, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArrayNegate( hypre_IntArray *v ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IntArrayNegate)( v ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArrayPrint( MPI_Comm comm, hypre_IntArray *array, const char *filename ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IntArrayPrint)( comm, array, filename ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArrayRead( MPI_Comm comm, const char *filename, hypre_IntArray **array_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IntArrayRead)( comm, filename, array_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArraySeparateByValue( HYPRE_Int num_values, HYPRE_Int *values, HYPRE_Int *sizes, hypre_IntArray *v, hypre_IntArrayArray **w_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IntArraySeparateByValue)( num_values, values, sizes, v, w_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArraySetConstantValues( hypre_IntArray *v, HYPRE_Int value ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IntArraySetConstantValues)( v, value ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArraySetConstantValuesHost( hypre_IntArray *v, HYPRE_Int value ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IntArraySetConstantValuesHost)( v, value ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntArraySetInterleavedValues( hypre_IntArray *v, HYPRE_Int cycle ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IntArraySetInterleavedValues)( v, cycle ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_IntSequence( HYPRE_MemoryLocation memory_location, HYPRE_Int size, HYPRE_Int *data ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_IntSequence)( memory_location, size, data ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_Log2( HYPRE_Int p ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_Log2)( p ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int * +hypre_LowerBound( HYPRE_Int *first, HYPRE_Int *last, HYPRE_Int value ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_LowerBound)( first, last, value ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_MAlloc( size_t size, HYPRE_MemoryLocation location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MAlloc)( size, location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Abort( hypre_MPI_Comm comm, HYPRE_Int errorcode ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Abort)( comm, errorcode ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Address( void *location, hypre_MPI_Aint *address ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Address)( location, address ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Allgather)( sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Allgatherv)( sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Allreduce( void *sendbuf, void *recvbuf, HYPRE_Int count, hypre_MPI_Datatype datatype, hypre_MPI_Op op, hypre_MPI_Comm comm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Allreduce)( sendbuf, recvbuf, count, datatype, op, comm ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Alltoall)( sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Barrier( hypre_MPI_Comm comm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Barrier)( comm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Bcast( void *buffer, HYPRE_Int count, hypre_MPI_Datatype datatype, HYPRE_Int root, hypre_MPI_Comm comm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Bcast)( buffer, count, datatype, root, comm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_CheckCommMatrix( hypre_MPI_Comm comm, HYPRE_Int num_recvs, HYPRE_Int *recvs, HYPRE_Int num_sends, HYPRE_Int *sends ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_CheckCommMatrix)( comm, num_recvs, recvs, num_sends, sends ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Comm_create( hypre_MPI_Comm comm, hypre_MPI_Group group, hypre_MPI_Comm *newcomm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Comm_create)( comm, group, newcomm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Comm_dup( hypre_MPI_Comm comm, hypre_MPI_Comm *newcomm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Comm_dup)( comm, newcomm ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_MPI_Comm +hypre_MPI_Comm_f2c( hypre_int comm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Comm_f2c)( comm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Comm_free( hypre_MPI_Comm *comm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Comm_free)( comm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Comm_group( hypre_MPI_Comm comm, hypre_MPI_Group *group ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Comm_group)( comm, group ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Comm_rank( hypre_MPI_Comm comm, HYPRE_Int *rank ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Comm_rank)( comm, rank ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Comm_size( hypre_MPI_Comm comm, HYPRE_Int *size ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Comm_size)( comm, size ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Comm_split( hypre_MPI_Comm comm, HYPRE_Int n, HYPRE_Int m, hypre_MPI_Comm * comms ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Comm_split)( comm, n, m, comms ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Finalize( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Finalize)( ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Gather)( sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Gatherv)( sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Get_count( hypre_MPI_Status *status, hypre_MPI_Datatype datatype, HYPRE_Int *count ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Get_count)( status, datatype, count ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Group_free( hypre_MPI_Group *group ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Group_free)( group ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Group_incl( hypre_MPI_Group group, HYPRE_Int n, HYPRE_Int *ranks, hypre_MPI_Group *newgroup ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Group_incl)( group, n, ranks, newgroup ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Init( hypre_int *argc, char ***argv ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Init)( argc, argv ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Iprobe( HYPRE_Int source, HYPRE_Int tag, hypre_MPI_Comm comm, HYPRE_Int *flag, hypre_MPI_Status *status ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Iprobe)( source, tag, comm, flag, status ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Irecv)( buf, count, datatype, source, tag, comm, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Irsend)( buf, count, datatype, dest, tag, comm, request ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Isend)( buf, count, datatype, dest, tag, comm, request ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Op_create( hypre_MPI_User_function *function, hypre_int commute, hypre_MPI_Op *op ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Op_create)( function, commute, op ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Op_free( hypre_MPI_Op *op ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Op_free)( op ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Probe( HYPRE_Int source, HYPRE_Int tag, hypre_MPI_Comm comm, hypre_MPI_Status *status ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Probe)( source, tag, comm, status ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Recv)( buf, count, datatype, source, tag, comm, status ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Recv_init)( buf, count, datatype, dest, tag, comm, request ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Reduce)( sendbuf, recvbuf, count, datatype, op, root, comm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Request_free( hypre_MPI_Request *request ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Request_free)( request ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Scan( void *sendbuf, void *recvbuf, HYPRE_Int count, hypre_MPI_Datatype datatype, hypre_MPI_Op op, hypre_MPI_Comm comm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Scan)( sendbuf, recvbuf, count, datatype, op, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Scatter)( sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Scatterv)( sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Send)( buf, count, datatype, dest, tag, comm ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Send_init)( buf, count, datatype, dest, tag, comm, request ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Startall( HYPRE_Int count, hypre_MPI_Request *array_of_requests ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Startall)( count, array_of_requests ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Test( hypre_MPI_Request *request, HYPRE_Int *flag, hypre_MPI_Status *status ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Test)( request, flag, status ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Testall( HYPRE_Int count, hypre_MPI_Request *array_of_requests, HYPRE_Int *flag, hypre_MPI_Status *array_of_statuses ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Testall)( count, array_of_requests, flag, array_of_statuses ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Type_commit( hypre_MPI_Datatype *datatype ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Type_commit)( datatype ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Type_contiguous( HYPRE_Int count, hypre_MPI_Datatype oldtype, hypre_MPI_Datatype *newtype ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Type_contiguous)( count, oldtype, newtype ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Type_free( hypre_MPI_Datatype *datatype ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Type_free)( datatype ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Type_hvector( HYPRE_Int count, HYPRE_Int blocklength, hypre_MPI_Aint stride, hypre_MPI_Datatype oldtype, hypre_MPI_Datatype *newtype ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Type_hvector)( count, blocklength, stride, oldtype, 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Type_struct)( count, array_of_blocklengths, array_of_displacements, array_of_types, newtype ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Type_vector( HYPRE_Int count, HYPRE_Int blocklength, HYPRE_Int stride, hypre_MPI_Datatype oldtype, hypre_MPI_Datatype *newtype ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Type_vector)( count, blocklength, stride, oldtype, newtype ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Wait( hypre_MPI_Request *request, hypre_MPI_Status *status ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Wait)( request, status ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Waitall( HYPRE_Int count, hypre_MPI_Request *array_of_requests, hypre_MPI_Status *array_of_statuses ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Waitall)( count, array_of_requests, array_of_statuses ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MPI_Waitany( HYPRE_Int count, hypre_MPI_Request *array_of_requests, HYPRE_Int *index, hypre_MPI_Status *status ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Waitany)( count, array_of_requests, index, status ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_double +hypre_MPI_Wtick( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Wtick)( ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_double +hypre_MPI_Wtime( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MPI_Wtime)( ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_MatrixStatsArray* +hypre_MatrixStatsArrayCreate( HYPRE_Int capacity ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MatrixStatsArrayCreate)( capacity ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MatrixStatsArrayDestroy( hypre_MatrixStatsArray *stats_array ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MatrixStatsArrayDestroy)( 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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MatrixStatsArrayPrint)( num_hierarchies, num_levels, use_divisors, shift, messages, stats_array ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_MatrixStats* +hypre_MatrixStatsCreate( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MatrixStatsCreate)( ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MatrixStatsDestroy( hypre_MatrixStats *stats ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MatrixStatsDestroy)( stats ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_MemPrefetch( void *ptr, size_t size, HYPRE_MemoryLocation location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MemPrefetch)( ptr, size, location ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_Memcpy( void *dst, void *src, size_t size, HYPRE_MemoryLocation loc_dst, HYPRE_MemoryLocation loc_src ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_Memcpy)( dst, src, size, loc_dst, loc_src ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_MemoryPrintUsage( MPI_Comm comm, HYPRE_Int level, const char *function, HYPRE_Int line ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_MemoryPrintUsage)( comm, level, function, line ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_Memset( void *ptr, HYPRE_Int value, size_t num, HYPRE_MemoryLocation location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_Memset)( ptr, value, num, location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PrefixSumInt( HYPRE_Int nvals, HYPRE_Int *vals, HYPRE_Int *sums ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PrefixSumInt)( nvals, vals, sums ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PrintTiming_fcn( const char *heading, MPI_Comm comm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_PrintTiming_fcn)( heading, comm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +hypre_Rand( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_Rand)( ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_RandI( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_RandI)( ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_ReAlloc( void *ptr, size_t size, HYPRE_MemoryLocation location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ReAlloc)( ptr, size, location ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre_ReAlloc_v2( void *ptr, size_t old_size, size_t new_size, HYPRE_MemoryLocation location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_ReAlloc_v2)( ptr, old_size, new_size, location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_RestoreLogLevel( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_RestoreLogLevel)( ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_SeedRand( HYPRE_Int seed ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SeedRand)( seed ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SetCubMemPoolSize( hypre_uint bin_growth, hypre_uint min_bin, hypre_uint max_bin, size_t max_cached_bytes ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SetCubMemPoolSize)( bin_growth, min_bin, max_bin, max_cached_bytes ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SetDevice( hypre_int device_id, hypre_Handle *hypre_handle_ ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SetDevice)( device_id, hypre_handle_ ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SetFinalized( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SetFinalized)( ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SetGaussSeidelMethod( HYPRE_Int gs_method ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SetGaussSeidelMethod)( gs_method ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SetGpuAwareMPI( HYPRE_Int use_gpu_aware_mpi ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SetGpuAwareMPI)( use_gpu_aware_mpi ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SetInitialized( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SetInitialized)( ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SetLogLevel( HYPRE_Int log_level ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SetLogLevel)( log_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SetLogLevelSaved( HYPRE_Int log_level_saved ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SetLogLevelSaved)( log_level_saved ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SetSpGemmAlgorithm( HYPRE_Int value ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SetSpGemmAlgorithm)( value ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SetSpGemmBinned( HYPRE_Int value ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SetSpGemmBinned)( value ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SetSpGemmRownnzEstimateMethod( HYPRE_Int value ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SetSpGemmRownnzEstimateMethod)( value ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SetSpGemmRownnzEstimateMultFactor( HYPRE_Real value ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SetSpGemmRownnzEstimateMultFactor)( value ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SetSpGemmRownnzEstimateNSamples( HYPRE_Int value ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SetSpGemmRownnzEstimateNSamples)( value ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SetSpGemmUseVendor( HYPRE_Int use_vendor ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SetSpGemmUseVendor)( use_vendor ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SetSpMVUseVendor( HYPRE_Int use_vendor ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SetSpMVUseVendor)( use_vendor ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SetSpTransUseVendor( HYPRE_Int use_vendor ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SetSpTransUseVendor)( use_vendor ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SetUseGpuRand( HYPRE_Int use_gpurand ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SetUseGpuRand)( use_gpurand ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SetUserDeviceMalloc( GPUMallocFunc func ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SetUserDeviceMalloc)( func ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_SetUserDeviceMfree( GPUMfreeFunc func ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_SetUserDeviceMfree)( func ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_UniqueIntArrayND( HYPRE_Int ndim, HYPRE_Int *size, HYPRE_Int **array ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_UniqueIntArrayND)( ndim, size, array ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_UnorderedBigIntMapCreate( hypre_UnorderedBigIntMap *m, HYPRE_Int inCapacity, HYPRE_Int concurrencyLevel ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_UnorderedBigIntMapCreate)( m, inCapacity, concurrencyLevel ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_UnorderedBigIntMapDestroy( hypre_UnorderedBigIntMap *m ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_UnorderedBigIntMapDestroy)( m ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_BigInt * +hypre_UnorderedBigIntSetCopyToArray( hypre_UnorderedBigIntSet *s, HYPRE_Int *len ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_UnorderedBigIntSetCopyToArray)( s, len ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_UnorderedBigIntSetCreate( hypre_UnorderedBigIntSet *s, HYPRE_Int inCapacity, HYPRE_Int concurrencyLevel ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_UnorderedBigIntSetCreate)( s, inCapacity, concurrencyLevel ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_UnorderedBigIntSetDestroy( hypre_UnorderedBigIntSet *s ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_UnorderedBigIntSetDestroy)( s ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_UnorderedIntMapCreate( hypre_UnorderedIntMap *m, HYPRE_Int inCapacity, HYPRE_Int concurrencyLevel ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_UnorderedIntMapCreate)( m, inCapacity, concurrencyLevel ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_UnorderedIntMapDestroy( hypre_UnorderedIntMap *m ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_UnorderedIntMapDestroy)( m ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int * +hypre_UnorderedIntSetCopyToArray( hypre_UnorderedIntSet *s, HYPRE_Int *len ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_UnorderedIntSetCopyToArray)( s, len ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_UnorderedIntSetCreate( hypre_UnorderedIntSet *s, HYPRE_Int inCapacity, HYPRE_Int concurrencyLevel ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_UnorderedIntSetCreate)( s, inCapacity, concurrencyLevel ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_UnorderedIntSetDestroy( hypre_UnorderedIntSet *s ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_UnorderedIntSetDestroy)( s ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre__Free( void *ptr, hypre_MemoryLocation location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre__Free)( ptr, location ); +} + +/*--------------------------------------------------------------------------*/ + +void * +hypre__MAlloc( size_t size, hypre_MemoryLocation location ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre__MAlloc)( size, location ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_big_merge_sort( HYPRE_BigInt *in, HYPRE_BigInt *temp, HYPRE_Int len, HYPRE_BigInt **sorted ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_big_merge_sort)( in, temp, len, sorted ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_big_sort_and_create_inverse_map( HYPRE_BigInt *in, HYPRE_Int len, HYPRE_BigInt **out, hypre_UnorderedBigIntMap *inverse_map ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_big_sort_and_create_inverse_map)( in, len, out, inverse_map ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_bind_device( HYPRE_Int myid, HYPRE_Int nproc, MPI_Comm comm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_bind_device)( myid, nproc, comm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_bind_device_id( HYPRE_Int device_id_in, HYPRE_Int myid, HYPRE_Int nproc, MPI_Comm comm ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_bind_device_id)( device_id_in, myid, nproc, comm ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_LinkList +hypre_create_elt( HYPRE_Int Item ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_create_elt)( Item ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_dense_topo_sort( const HYPRE_Complex *L, HYPRE_Int *ordering, HYPRE_Int n, HYPRE_Int is_col_major ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dense_topo_sort)( L, ordering, n, is_col_major ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_dispose_elt( hypre_LinkList element_ptr ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_dispose_elt)( element_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 *where ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_enter_on_lists)( LoL_head_ptr, LoL_tail_ptr, measure, index, lists, where ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_error_code_restore( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_error_code_restore)( ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_error_code_save( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_error_code_save)( ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_error_handler( const char *filename, HYPRE_Int line, HYPRE_Int ierr, const char *msg ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_error_handler)( filename, line, ierr, msg ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_error_handler_clear_messages( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_error_handler_clear_messages)( ); +} + +/*--------------------------------------------------------------------------*/ + +hypre_Handle* +hypre_handle( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_handle)( ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_merge_sort( HYPRE_Int *in, HYPRE_Int *temp, HYPRE_Int len, HYPRE_Int **sorted ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_merge_sort)( in, temp, len, sorted ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_mm_is_valid( MM_typecode matcode ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_mm_is_valid)( matcode ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_mm_read_banner( FILE *f, MM_typecode *matcode ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_mm_read_banner)( f, matcode ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_mm_read_mtx_crd_size( FILE *f, HYPRE_Int *M, HYPRE_Int *N, HYPRE_Int *nz ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_mm_read_mtx_crd_size)( f, M, N, nz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_multmod( HYPRE_Int a, HYPRE_Int b, HYPRE_Int mod ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_multmod)( a, b, mod ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_partition1D( HYPRE_Int n, HYPRE_Int p, HYPRE_Int j, HYPRE_Int *s, HYPRE_Int *e ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_partition1D)( n, p, j, s, e ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_prefix_sum( HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int *workspace ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_prefix_sum)( in_out, sum, workspace ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_prefix_sum_multiple( HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int n, HYPRE_Int *workspace ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_prefix_sum_multiple)( in_out, sum, n, workspace ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_prefix_sum_pair( HYPRE_Int *in_out1, HYPRE_Int *sum1, HYPRE_Int *in_out2, HYPRE_Int *sum2, HYPRE_Int *workspace ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_prefix_sum_pair)( in_out1, sum1, in_out2, sum2, workspace ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_prefix_sum_triple)( in_out1, sum1, in_out2, sum2, in_out3, sum3, workspace ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_qsort0( HYPRE_Int *v, HYPRE_Int left, HYPRE_Int right ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_qsort0)( v, left, right ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_qsort1( HYPRE_Int *v, HYPRE_Real *w, HYPRE_Int left, HYPRE_Int right ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_qsort1)( v, w, left, right ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_qsort2( HYPRE_Int *v, HYPRE_Real *w, HYPRE_Int left, HYPRE_Int right ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_qsort2)( v, w, left, right ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_qsort2_abs( HYPRE_Int *v, HYPRE_Real *w, HYPRE_Int left, HYPRE_Int right ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_qsort2_abs)( v, w, left, right ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_qsort2i( HYPRE_Int *v, HYPRE_Int *w, HYPRE_Int left, HYPRE_Int right ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_qsort2i)( v, w, left, right ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_qsort3( HYPRE_Real *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int left, HYPRE_Int right ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_qsort3)( v, w, z, left, right ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_qsort3_abs( HYPRE_Real *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int left, HYPRE_Int right ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_qsort3_abs)( v, w, z, left, right ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_qsort3i( HYPRE_Int *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int left, HYPRE_Int right ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_qsort3i)( v, w, z, left, right ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_qsort3ir( HYPRE_Int *v, HYPRE_Real *w, HYPRE_Int *z, HYPRE_Int left, HYPRE_Int right ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_qsort3ir)( v, w, z, left, right ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_qsortND( HYPRE_Int **v, HYPRE_Int ndim, HYPRE_Int left, HYPRE_Int right ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_qsortND)( v, ndim, left, right ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_qsort_abs( HYPRE_Real *w, HYPRE_Int left, HYPRE_Int right ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_qsort_abs)( w, left, right ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_remove_point)( LoL_head_ptr, LoL_tail_ptr, measure, index, lists, where ); +} + +/*--------------------------------------------------------------------------*/ + +char * +hypre_strcpy( char *destination, const char *source ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_strcpy)( destination, source ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_swap( HYPRE_Int *v, HYPRE_Int i, HYPRE_Int j ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_swap)( v, i, j ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_swap2( HYPRE_Int *v, HYPRE_Real *w, HYPRE_Int i, HYPRE_Int j ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_swap2)( v, w, i, j ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_swap2i( HYPRE_Int *v, HYPRE_Int *w, HYPRE_Int i, HYPRE_Int j ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_swap2i)( v, w, i, j ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_swap3_d( HYPRE_Real *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int i, HYPRE_Int j ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_swap3_d)( v, w, z, i, j ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_swap3_d_perm( HYPRE_Int *v, HYPRE_Real *w, HYPRE_Int *z, HYPRE_Int i, HYPRE_Int j ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_swap3_d_perm)( v, w, z, i, j ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_swap3i( HYPRE_Int *v, HYPRE_Int *w, HYPRE_Int *z, HYPRE_Int i, HYPRE_Int j ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_swap3i)( v, w, z, i, j ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_swap_c( HYPRE_Complex *v, HYPRE_Int i, HYPRE_Int j ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_swap_c)( v, i, j ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_swap_d( HYPRE_Real *v, HYPRE_Int i, HYPRE_Int j ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_swap_d)( v, i, j ); +} + +/*--------------------------------------------------------------------------*/ + +void +hypre_topo_sort( const HYPRE_Int *row_ptr, const HYPRE_Int *col_inds, const HYPRE_Complex *data, HYPRE_Int *ordering, HYPRE_Int n ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_topo_sort)( row_ptr, col_inds, data, ordering, n ); +} + +/*--------------------------------------------------------------------------*/ + +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 ) +{ + return HYPRE_CURRENTPRECISION_FUNC(hypre_union2)( n1, arr1, n2, arr2, n3, arr3, map1, map2 ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +time_getCPUSeconds( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(time_getCPUSeconds)( ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +time_getWallclockSeconds( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(time_getWallclockSeconds)( ); +} + +/*--------------------------------------------------------------------------*/ + +void +utilities_FortranMatrixAdd( HYPRE_Real a, utilities_FortranMatrix* mtxA, utilities_FortranMatrix* mtxB, utilities_FortranMatrix* mtxC ) +{ + return HYPRE_CURRENTPRECISION_FUNC(utilities_FortranMatrixAdd)( a, mtxA, mtxB, mtxC ); +} + +/*--------------------------------------------------------------------------*/ + +void +utilities_FortranMatrixAllocateData( HYPRE_BigInt h, HYPRE_BigInt w, utilities_FortranMatrix* mtx ) +{ + return HYPRE_CURRENTPRECISION_FUNC(utilities_FortranMatrixAllocateData)( h, w, mtx ); +} + +/*--------------------------------------------------------------------------*/ + +void +utilities_FortranMatrixClear( utilities_FortranMatrix* mtx ) +{ + return HYPRE_CURRENTPRECISION_FUNC(utilities_FortranMatrixClear)( mtx ); +} + +/*--------------------------------------------------------------------------*/ + +void +utilities_FortranMatrixClearL( utilities_FortranMatrix* mtx ) +{ + return HYPRE_CURRENTPRECISION_FUNC(utilities_FortranMatrixClearL)( mtx ); +} + +/*--------------------------------------------------------------------------*/ + +void +utilities_FortranMatrixCopy( utilities_FortranMatrix* src, HYPRE_Int t, utilities_FortranMatrix* dest ) +{ + return HYPRE_CURRENTPRECISION_FUNC(utilities_FortranMatrixCopy)( src, t, dest ); +} + +/*--------------------------------------------------------------------------*/ + +utilities_FortranMatrix* +utilities_FortranMatrixCreate( void ) +{ + return HYPRE_CURRENTPRECISION_FUNC(utilities_FortranMatrixCreate)( ); +} + +/*--------------------------------------------------------------------------*/ + +void +utilities_FortranMatrixDMultiply( utilities_FortranMatrix* d, utilities_FortranMatrix* mtx ) +{ + return HYPRE_CURRENTPRECISION_FUNC(utilities_FortranMatrixDMultiply)( d, mtx ); +} + +/*--------------------------------------------------------------------------*/ + +void +utilities_FortranMatrixDestroy( utilities_FortranMatrix* mtx ) +{ + return HYPRE_CURRENTPRECISION_FUNC(utilities_FortranMatrixDestroy)( mtx ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +utilities_FortranMatrixFNorm( utilities_FortranMatrix* mtx ) +{ + return HYPRE_CURRENTPRECISION_FUNC(utilities_FortranMatrixFNorm)( mtx ); +} + +/*--------------------------------------------------------------------------*/ + +void +utilities_FortranMatrixGetDiagonal( utilities_FortranMatrix* mtx, utilities_FortranMatrix* d ) +{ + return HYPRE_CURRENTPRECISION_FUNC(utilities_FortranMatrixGetDiagonal)( mtx, d ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_BigInt +utilities_FortranMatrixGlobalHeight( utilities_FortranMatrix* mtx ) +{ + return HYPRE_CURRENTPRECISION_FUNC(utilities_FortranMatrixGlobalHeight)( mtx ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_BigInt +utilities_FortranMatrixHeight( utilities_FortranMatrix* mtx ) +{ + return HYPRE_CURRENTPRECISION_FUNC(utilities_FortranMatrixHeight)( mtx ); +} + +/*--------------------------------------------------------------------------*/ + +void +utilities_FortranMatrixIndexCopy( HYPRE_Int* index, utilities_FortranMatrix* src, HYPRE_Int t, utilities_FortranMatrix* dest ) +{ + return HYPRE_CURRENTPRECISION_FUNC(utilities_FortranMatrixIndexCopy)( index, src, t, dest ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +utilities_FortranMatrixMaxValue( utilities_FortranMatrix* mtx ) +{ + return HYPRE_CURRENTPRECISION_FUNC(utilities_FortranMatrixMaxValue)( mtx ); +} + +/*--------------------------------------------------------------------------*/ + +void +utilities_FortranMatrixMultiply( utilities_FortranMatrix* mtxA, HYPRE_Int tA, utilities_FortranMatrix* mtxB, HYPRE_Int tB, utilities_FortranMatrix* mtxC ) +{ + return HYPRE_CURRENTPRECISION_FUNC(utilities_FortranMatrixMultiply)( mtxA, tA, mtxB, tB, mtxC ); +} + +/*--------------------------------------------------------------------------*/ + +void +utilities_FortranMatrixMultiplyD( utilities_FortranMatrix* mtx, utilities_FortranMatrix* d ) +{ + return HYPRE_CURRENTPRECISION_FUNC(utilities_FortranMatrixMultiplyD)( mtx, d ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +utilities_FortranMatrixPrint( utilities_FortranMatrix* mtx, const char *fileName ) +{ + return HYPRE_CURRENTPRECISION_FUNC(utilities_FortranMatrixPrint)( mtx, fileName ); +} + +/*--------------------------------------------------------------------------*/ + +void +utilities_FortranMatrixSelectBlock( utilities_FortranMatrix* mtx, HYPRE_BigInt iFrom, HYPRE_BigInt iTo, HYPRE_BigInt jFrom, HYPRE_BigInt jTo, utilities_FortranMatrix* block ) +{ + return HYPRE_CURRENTPRECISION_FUNC(utilities_FortranMatrixSelectBlock)( mtx, iFrom, iTo, jFrom, jTo, block ); +} + +/*--------------------------------------------------------------------------*/ + +void +utilities_FortranMatrixSetDiagonal( utilities_FortranMatrix* mtx, utilities_FortranMatrix* d ) +{ + return HYPRE_CURRENTPRECISION_FUNC(utilities_FortranMatrixSetDiagonal)( mtx, d ); +} + +/*--------------------------------------------------------------------------*/ + +void +utilities_FortranMatrixSetToIdentity( utilities_FortranMatrix* mtx ) +{ + return HYPRE_CURRENTPRECISION_FUNC(utilities_FortranMatrixSetToIdentity)( mtx ); +} + +/*--------------------------------------------------------------------------*/ + +void +utilities_FortranMatrixSymmetrize( utilities_FortranMatrix* mtx ) +{ + return HYPRE_CURRENTPRECISION_FUNC(utilities_FortranMatrixSymmetrize)( mtx ); +} + +/*--------------------------------------------------------------------------*/ + +void +utilities_FortranMatrixTransposeSquare( utilities_FortranMatrix* mtx ) +{ + return HYPRE_CURRENTPRECISION_FUNC(utilities_FortranMatrixTransposeSquare)( mtx ); +} + +/*--------------------------------------------------------------------------*/ + +void +utilities_FortranMatrixUpperInv( utilities_FortranMatrix* u ) +{ + return HYPRE_CURRENTPRECISION_FUNC(utilities_FortranMatrixUpperInv)( u ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real +utilities_FortranMatrixValue( utilities_FortranMatrix* mtx, HYPRE_BigInt i, HYPRE_BigInt j ) +{ + return HYPRE_CURRENTPRECISION_FUNC(utilities_FortranMatrixValue)( mtx, i, j ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real* +utilities_FortranMatrixValuePtr( utilities_FortranMatrix* mtx, HYPRE_BigInt i, HYPRE_BigInt j ) +{ + return HYPRE_CURRENTPRECISION_FUNC(utilities_FortranMatrixValuePtr)( mtx, i, j ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Real* +utilities_FortranMatrixValues( utilities_FortranMatrix* mtx ) +{ + return HYPRE_CURRENTPRECISION_FUNC(utilities_FortranMatrixValues)( mtx ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_BigInt +utilities_FortranMatrixWidth( utilities_FortranMatrix* mtx ) +{ + return HYPRE_CURRENTPRECISION_FUNC(utilities_FortranMatrixWidth)( mtx ); +} + +/*--------------------------------------------------------------------------*/ + +void +utilities_FortranMatrixWrap( HYPRE_Real* v, HYPRE_BigInt gh, HYPRE_BigInt h, HYPRE_BigInt w, utilities_FortranMatrix* mtx ) +{ + return HYPRE_CURRENTPRECISION_FUNC(utilities_FortranMatrixWrap)( v, gh, h, w, mtx ); +} + + +#endif + diff --git a/src/utilities/mup_functions.c b/src/utilities/mup_functions.c new file mode 100644 index 0000000000..2d9759db73 --- /dev/null +++ b/src/utilities/mup_functions.c @@ -0,0 +1,325 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_utilities.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_AssumedPartitionCheck( void ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_AssumedPartitionCheck_pre( precision ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CheckError( HYPRE_Int hypre_ierr, HYPRE_Int hypre_error_code ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_CheckError_pre( precision, hypre_ierr, hypre_error_code ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ClearAllErrors( void ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ClearAllErrors_pre( precision ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ClearError( HYPRE_Int hypre_error_code ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ClearError_pre( precision, hypre_error_code ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ClearErrorMessages( void ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_ClearErrorMessages_pre( precision ); +} + +/*--------------------------------------------------------------------------*/ + +void +HYPRE_DescribeError( HYPRE_Int hypre_ierr, char *descr ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_DescribeError_pre( precision, hypre_ierr, descr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_DeviceInitialize( void ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_DeviceInitialize_pre( precision ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_Finalize( void ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_Finalize_pre( precision ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_Finalized( void ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_Finalized_pre( precision ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GetError( void ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GetError_pre( precision ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GetErrorArg( void ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GetErrorArg_pre( precision ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GetErrorMessages( char **buffer, HYPRE_Int *bufsz ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GetErrorMessages_pre( precision, buffer, bufsz ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GetExecutionPolicy( HYPRE_ExecutionPolicy *exec_policy ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GetExecutionPolicy_pre( precision, exec_policy ); +} + +/*--------------------------------------------------------------------------*/ + +const char* +HYPRE_GetExecutionPolicyName( HYPRE_ExecutionPolicy exec_policy ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GetExecutionPolicyName_pre( precision, exec_policy ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GetGlobalError( MPI_Comm comm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GetGlobalError_pre( precision, comm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GetMemoryLocation( HYPRE_MemoryLocation *memory_location ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_GetMemoryLocation_pre( precision, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_Initialize( void ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_Initialize_pre( precision ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_Initialized( void ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_Initialized_pre( precision ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MemoryPrintUsage( MPI_Comm comm, HYPRE_Int level, const char *function, HYPRE_Int line ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_MemoryPrintUsage_pre( precision, comm, level, function, line ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PrintDeviceInfo( void ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PrintDeviceInfo_pre( precision ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PrintErrorMessages( MPI_Comm comm ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_PrintErrorMessages_pre( precision, comm ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetExecutionPolicy( HYPRE_ExecutionPolicy exec_policy ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SetExecutionPolicy_pre( precision, exec_policy ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetGPUMemoryPoolSize( HYPRE_Int bin_growth, HYPRE_Int min_bin, HYPRE_Int max_bin, size_t max_cached_bytes ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SetGPUMemoryPoolSize_pre( precision, bin_growth, min_bin, max_bin, max_cached_bytes ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetGpuAwareMPI( HYPRE_Int use_gpu_aware_mpi ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SetGpuAwareMPI_pre( precision, use_gpu_aware_mpi ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetLogLevel( HYPRE_Int log_level ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SetLogLevel_pre( precision, log_level ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetMemoryLocation( HYPRE_MemoryLocation memory_location ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SetMemoryLocation_pre( precision, memory_location ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetPrintErrorMode( HYPRE_Int mode ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SetPrintErrorMode_pre( precision, mode ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetPrintErrorVerbosity( HYPRE_Int code, HYPRE_Int verbosity ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SetPrintErrorVerbosity_pre( precision, code, verbosity ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetSpGemmUseVendor( HYPRE_Int use_vendor ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SetSpGemmUseVendor_pre( precision, use_vendor ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetSpMVUseVendor( HYPRE_Int use_vendor ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SetSpMVUseVendor_pre( precision, use_vendor ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetSpTransUseVendor( HYPRE_Int use_vendor ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SetSpTransUseVendor_pre( precision, use_vendor ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetUseGpuRand( HYPRE_Int use_curand ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_SetUseGpuRand_pre( precision, use_curand ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_Version( char **version_ptr ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_Version_pre( precision, version_ptr ); +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_VersionNumber( HYPRE_Int *major_ptr, HYPRE_Int *minor_ptr, HYPRE_Int *patch_ptr, HYPRE_Int *single_ptr ) +{ + HYPRE_Precision precision = hypre_GlobalPrecision(); + return HYPRE_VersionNumber_pre( precision, major_ptr, minor_ptr, patch_ptr, single_ptr ); +} + + + +#endif + diff --git a/src/utilities/mup_pre.c b/src/utilities/mup_pre.c new file mode 100644 index 0000000000..1188a9e796 --- /dev/null +++ b/src/utilities/mup_pre.c @@ -0,0 +1,631 @@ + +/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/ + +#include "_hypre_utilities.h" + +#ifdef HYPRE_MIXED_PRECISION + +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore 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_Int +HYPRE_AssumedPartitionCheck_pre( HYPRE_Precision precision ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_AssumedPartitionCheck_flt( ); + case HYPRE_REAL_DOUBLE: + return HYPRE_AssumedPartitionCheck_dbl( ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_AssumedPartitionCheck_long_dbl( ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_CheckError_pre( HYPRE_Precision precision, HYPRE_Int hypre_ierr, HYPRE_Int hypre_error_code ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_CheckError_flt( hypre_ierr, hypre_error_code ); + case HYPRE_REAL_DOUBLE: + return HYPRE_CheckError_dbl( hypre_ierr, hypre_error_code ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_CheckError_long_dbl( hypre_ierr, hypre_error_code ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ClearAllErrors_pre( HYPRE_Precision precision ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ClearAllErrors_flt( ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ClearAllErrors_dbl( ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ClearAllErrors_long_dbl( ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ClearError_pre( HYPRE_Precision precision, HYPRE_Int hypre_error_code ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ClearError_flt( hypre_error_code ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ClearError_dbl( hypre_error_code ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ClearError_long_dbl( hypre_error_code ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_ClearErrorMessages_pre( HYPRE_Precision precision ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_ClearErrorMessages_flt( ); + case HYPRE_REAL_DOUBLE: + return HYPRE_ClearErrorMessages_dbl( ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_ClearErrorMessages_long_dbl( ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +void +HYPRE_DescribeError_pre( HYPRE_Precision precision, HYPRE_Int hypre_ierr, char *descr ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_DescribeError_flt( hypre_ierr, descr ); + case HYPRE_REAL_DOUBLE: + return HYPRE_DescribeError_dbl( hypre_ierr, descr ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_DescribeError_long_dbl( hypre_ierr, descr ); + default: + hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_DeviceInitialize_pre( HYPRE_Precision precision ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_DeviceInitialize_flt( ); + case HYPRE_REAL_DOUBLE: + return HYPRE_DeviceInitialize_dbl( ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_DeviceInitialize_long_dbl( ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_Finalize_pre( HYPRE_Precision precision ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_Finalize_flt( ); + case HYPRE_REAL_DOUBLE: + return HYPRE_Finalize_dbl( ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_Finalize_long_dbl( ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_Finalized_pre( HYPRE_Precision precision ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_Finalized_flt( ); + case HYPRE_REAL_DOUBLE: + return HYPRE_Finalized_dbl( ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_Finalized_long_dbl( ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GetError_pre( HYPRE_Precision precision ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GetError_flt( ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GetError_dbl( ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GetError_long_dbl( ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GetErrorArg_pre( HYPRE_Precision precision ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GetErrorArg_flt( ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GetErrorArg_dbl( ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GetErrorArg_long_dbl( ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GetErrorMessages_pre( HYPRE_Precision precision, char **buffer, HYPRE_Int *bufsz ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GetErrorMessages_flt( buffer, bufsz ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GetErrorMessages_dbl( buffer, bufsz ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GetErrorMessages_long_dbl( buffer, bufsz ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GetExecutionPolicy_pre( HYPRE_Precision precision, HYPRE_ExecutionPolicy *exec_policy ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GetExecutionPolicy_flt( exec_policy ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GetExecutionPolicy_dbl( exec_policy ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GetExecutionPolicy_long_dbl( exec_policy ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +const char* +HYPRE_GetExecutionPolicyName_pre( HYPRE_Precision precision, HYPRE_ExecutionPolicy exec_policy ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GetExecutionPolicyName_flt( exec_policy ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GetExecutionPolicyName_dbl( exec_policy ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GetExecutionPolicyName_long_dbl( exec_policy ); + default: + { const char* value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GetGlobalError_pre( HYPRE_Precision precision, MPI_Comm comm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GetGlobalError_flt( comm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GetGlobalError_dbl( comm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GetGlobalError_long_dbl( comm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_GetMemoryLocation_pre( HYPRE_Precision precision, HYPRE_MemoryLocation *memory_location ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_GetMemoryLocation_flt( memory_location ); + case HYPRE_REAL_DOUBLE: + return HYPRE_GetMemoryLocation_dbl( memory_location ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_GetMemoryLocation_long_dbl( memory_location ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_Initialize_pre( HYPRE_Precision precision ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_Initialize_flt( ); + case HYPRE_REAL_DOUBLE: + return HYPRE_Initialize_dbl( ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_Initialize_long_dbl( ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_Initialized_pre( HYPRE_Precision precision ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_Initialized_flt( ); + case HYPRE_REAL_DOUBLE: + return HYPRE_Initialized_dbl( ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_Initialized_long_dbl( ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_MemoryPrintUsage_pre( HYPRE_Precision precision, MPI_Comm comm, HYPRE_Int level, const char *function, HYPRE_Int line ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_MemoryPrintUsage_flt( comm, level, function, line ); + case HYPRE_REAL_DOUBLE: + return HYPRE_MemoryPrintUsage_dbl( comm, level, function, line ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_MemoryPrintUsage_long_dbl( comm, level, function, line ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PrintDeviceInfo_pre( HYPRE_Precision precision ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PrintDeviceInfo_flt( ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PrintDeviceInfo_dbl( ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PrintDeviceInfo_long_dbl( ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_PrintErrorMessages_pre( HYPRE_Precision precision, MPI_Comm comm ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_PrintErrorMessages_flt( comm ); + case HYPRE_REAL_DOUBLE: + return HYPRE_PrintErrorMessages_dbl( comm ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_PrintErrorMessages_long_dbl( comm ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetExecutionPolicy_pre( HYPRE_Precision precision, HYPRE_ExecutionPolicy exec_policy ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SetExecutionPolicy_flt( exec_policy ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SetExecutionPolicy_dbl( exec_policy ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SetExecutionPolicy_long_dbl( exec_policy ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetGPUMemoryPoolSize_pre( HYPRE_Precision precision, HYPRE_Int bin_growth, HYPRE_Int min_bin, HYPRE_Int max_bin, size_t max_cached_bytes ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SetGPUMemoryPoolSize_flt( bin_growth, min_bin, max_bin, max_cached_bytes ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SetGPUMemoryPoolSize_dbl( bin_growth, min_bin, max_bin, max_cached_bytes ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SetGPUMemoryPoolSize_long_dbl( bin_growth, min_bin, max_bin, max_cached_bytes ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetGpuAwareMPI_pre( HYPRE_Precision precision, HYPRE_Int use_gpu_aware_mpi ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SetGpuAwareMPI_flt( use_gpu_aware_mpi ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SetGpuAwareMPI_dbl( use_gpu_aware_mpi ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SetGpuAwareMPI_long_dbl( use_gpu_aware_mpi ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetLogLevel_pre( HYPRE_Precision precision, HYPRE_Int log_level ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SetLogLevel_flt( log_level ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SetLogLevel_dbl( log_level ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SetLogLevel_long_dbl( log_level ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetMemoryLocation_pre( HYPRE_Precision precision, HYPRE_MemoryLocation memory_location ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SetMemoryLocation_flt( memory_location ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SetMemoryLocation_dbl( memory_location ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SetMemoryLocation_long_dbl( memory_location ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetPrintErrorMode_pre( HYPRE_Precision precision, HYPRE_Int mode ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SetPrintErrorMode_flt( mode ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SetPrintErrorMode_dbl( mode ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SetPrintErrorMode_long_dbl( mode ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetPrintErrorVerbosity_pre( HYPRE_Precision precision, HYPRE_Int code, HYPRE_Int verbosity ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SetPrintErrorVerbosity_flt( code, verbosity ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SetPrintErrorVerbosity_dbl( code, verbosity ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SetPrintErrorVerbosity_long_dbl( code, verbosity ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetSpGemmUseVendor_pre( HYPRE_Precision precision, HYPRE_Int use_vendor ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SetSpGemmUseVendor_flt( use_vendor ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SetSpGemmUseVendor_dbl( use_vendor ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SetSpGemmUseVendor_long_dbl( use_vendor ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetSpMVUseVendor_pre( HYPRE_Precision precision, HYPRE_Int use_vendor ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SetSpMVUseVendor_flt( use_vendor ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SetSpMVUseVendor_dbl( use_vendor ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SetSpMVUseVendor_long_dbl( use_vendor ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetSpTransUseVendor_pre( HYPRE_Precision precision, HYPRE_Int use_vendor ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SetSpTransUseVendor_flt( use_vendor ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SetSpTransUseVendor_dbl( use_vendor ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SetSpTransUseVendor_long_dbl( use_vendor ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_SetUseGpuRand_pre( HYPRE_Precision precision, HYPRE_Int use_curand ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_SetUseGpuRand_flt( use_curand ); + case HYPRE_REAL_DOUBLE: + return HYPRE_SetUseGpuRand_dbl( use_curand ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_SetUseGpuRand_long_dbl( use_curand ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_Version_pre( HYPRE_Precision precision, char **version_ptr ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_Version_flt( version_ptr ); + case HYPRE_REAL_DOUBLE: + return HYPRE_Version_dbl( version_ptr ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_Version_long_dbl( version_ptr ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + +/*--------------------------------------------------------------------------*/ + +HYPRE_Int +HYPRE_VersionNumber_pre( HYPRE_Precision precision, HYPRE_Int *major_ptr, HYPRE_Int *minor_ptr, HYPRE_Int *patch_ptr, HYPRE_Int *single_ptr ) +{ + switch (precision) + { + case HYPRE_REAL_SINGLE: + return HYPRE_VersionNumber_flt( major_ptr, minor_ptr, patch_ptr, single_ptr ); + case HYPRE_REAL_DOUBLE: + return HYPRE_VersionNumber_dbl( major_ptr, minor_ptr, patch_ptr, single_ptr ); + case HYPRE_REAL_LONGDOUBLE: + return HYPRE_VersionNumber_long_dbl( major_ptr, minor_ptr, patch_ptr, single_ptr ); + default: + { HYPRE_Int value = 0; hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Unknown solver precision"); return value; } + } +} + + + +#endif + diff --git a/src/utilities/prefix_sum.c b/src/utilities/prefix_sum.c index 92dff2cc94..48ccf8639d 100644 --- a/src/utilities/prefix_sum.c +++ b/src/utilities/prefix_sum.c @@ -7,7 +7,87 @@ #include "_hypre_utilities.h" -void hypre_prefix_sum(HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int *workspace) +/*-------------------------------------------------------------------------- + * This is a helper routine to compute a prefix sum of integer values. + * + * The current implementation is okay for modest numbers of threads. + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_PrefixSumInt(HYPRE_Int nvals, + HYPRE_Int *vals, + HYPRE_Int *sums) +{ + HYPRE_Int j, nthreads, bsize; + + nthreads = hypre_NumThreads(); + bsize = (nvals + nthreads - 1) / nthreads; /* This distributes the remainder */ + + if (nvals < nthreads || bsize == 1) + { + sums[0] = 0; + for (j = 1; j < nvals; j++) + { + sums[j] += sums[j - 1] + vals[j - 1]; + } + } + else + { + /* Compute preliminary partial sums (in parallel) within each interval */ +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE +#endif + for (j = 0; j < nvals; j += bsize) + { + HYPRE_Int i, n = hypre_min((j + bsize), nvals); + + sums[j] = 0; + for (i = j + 1; i < n; i++) + { + sums[i] = sums[i - 1] + vals[i - 1]; + } + } + + /* Compute final partial sums (in serial) for the first entry of every interval */ + for (j = bsize; j < nvals; j += bsize) + { + sums[j] = sums[j - bsize] + sums[j - 1] + vals[j - 1]; + } + + /* Compute final partial sums (in parallel) for the remaining entries */ +#ifdef HYPRE_USING_OPENMP + #pragma omp parallel for private(j) HYPRE_SMP_SCHEDULE +#endif + for (j = bsize; j < nvals; j += bsize) + { + HYPRE_Int i, n = hypre_min((j + bsize), nvals); + + for (i = j + 1; i < n; i++) + { + sums[i] += sums[j]; + } + } + } + + return hypre_error_flag; +} + +/*-------------------------------------------------------------------------- + * Assumed to be called within an omp region. + * Let x_i be the input of ith thread. + * The output of ith thread y_i = x_0 + x_1 + ... + x_{i-1} + * Additionally, sum = x_0 + x_1 + ... + x_{nthreads - 1} + * Note that always y_0 = 0 + * + * @param workspace at least with length (nthreads+1) + * workspace[tid] will contain result for tid + * workspace[nthreads] will contain sum + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_prefix_sum( HYPRE_Int *in_out, + HYPRE_Int *sum, + HYPRE_Int *workspace ) { #ifdef HYPRE_USING_OPENMP HYPRE_Int my_thread_num = hypre_GetThreadNum(); @@ -37,10 +117,25 @@ void hypre_prefix_sum(HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int *workspace) workspace[0] = 0; workspace[1] = *sum; #endif /* !HYPRE_USING_OPENMP */ + + return hypre_error_flag; } -void hypre_prefix_sum_pair(HYPRE_Int *in_out1, HYPRE_Int *sum1, HYPRE_Int *in_out2, HYPRE_Int *sum2, - HYPRE_Int *workspace) +/*-------------------------------------------------------------------------- + * This version does prefix sum in pair. + * Useful when we prefix sum of diag and offd in tandem. + * + * @param worksapce at least with length 2*(nthreads+1) + * workspace[2*tid] and workspace[2*tid+1] will contain results for tid + * workspace[3*nthreads] and workspace[3*nthreads + 1] will contain sums + *--------------------------------------------------------------------------*/ + +HYPRE_Int +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(); @@ -80,10 +175,23 @@ void hypre_prefix_sum_pair(HYPRE_Int *in_out1, HYPRE_Int *sum1, HYPRE_Int *in_ou workspace[2] = *sum1; workspace[3] = *sum2; #endif /* !HYPRE_USING_OPENMP */ + + return hypre_error_flag; } -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) +/*-------------------------------------------------------------------------- + * @param workspace at least with length 3*(nthreads+1) + * workspace[3*tid:3*tid+3) will contain results for tid + *--------------------------------------------------------------------------*/ + +HYPRE_Int +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(); @@ -132,9 +240,23 @@ void hypre_prefix_sum_triple(HYPRE_Int *in_out1, HYPRE_Int *sum1, HYPRE_Int *in_ workspace[4] = *sum2; workspace[5] = *sum3; #endif /* !HYPRE_USING_OPENMP */ + + return hypre_error_flag; } -void hypre_prefix_sum_multiple(HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int n, HYPRE_Int *workspace) +/*-------------------------------------------------------------------------- + * N prefix-sums together. + * workspace[n*tid:n*(tid+1)) will contain results for tid + * workspace[nthreads*tid:nthreads*(tid+1)) will contain sums + * + * @param workspace at least with length n*(nthreads+1) + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_prefix_sum_multiple( HYPRE_Int *in_out, + HYPRE_Int *sum, + HYPRE_Int n, + HYPRE_Int *workspace ) { HYPRE_Int i; #ifdef HYPRE_USING_OPENMP @@ -186,4 +308,6 @@ void hypre_prefix_sum_multiple(HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int n, H workspace[n + i] = sum[i]; } #endif /* !HYPRE_USING_OPENMP */ + + return hypre_error_flag; } diff --git a/src/utilities/printf.c b/src/utilities/printf.c index 7e0531d98f..15d6be3681 100644 --- a/src/utilities/printf.c +++ b/src/utilities/printf.c @@ -10,7 +10,8 @@ #include #define hypre_printf_buffer_len 4096 -char hypre_printf_buffer[hypre_printf_buffer_len]; +/* OK to make hypre_printf_buffer a static variable since it is only declared and accessed here */ +static char hypre_printf_buffer[hypre_printf_buffer_len]; // #ifdef HYPRE_BIGINT diff --git a/src/utilities/printf.h b/src/utilities/printf.h index 3741c8fdf9..1469859a4d 100644 --- a/src/utilities/printf.h +++ b/src/utilities/printf.h @@ -11,7 +11,6 @@ #include /* 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, ... ); @@ -21,13 +20,5 @@ 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 -// #define hypre_sprintf sprintf -// #define hypre_scanf scanf -// #define hypre_fscanf fscanf -// #define hypre_sscanf sscanf -// #endif #endif diff --git a/src/utilities/protos.h b/src/utilities/protos.h index 0fe65c07f7..176f2fa373 100644 --- a/src/utilities/protos.h +++ b/src/utilities/protos.h @@ -79,6 +79,7 @@ void hypre_swap3_d_perm(HYPRE_Int *v, HYPRE_Real *w, HYPRE_Int *z, HYPRE_Int 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_qsortND( HYPRE_Int **v, HYPRE_Int ndim, HYPRE_Int left, HYPRE_Int right ); 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 ); @@ -108,6 +109,9 @@ void hypre_topo_sort(const HYPRE_Int *row_ptr, const HYPRE_Int *col_inds, const void hypre_dense_topo_sort(const HYPRE_Complex *L, HYPRE_Int *ordering, HYPRE_Int n, HYPRE_Int is_col_major); +/* unique.c */ +HYPRE_Int hypre_UniqueIntArrayND ( HYPRE_Int ndim, HYPRE_Int *size, HYPRE_Int **array ); + /* qsplit.c */ HYPRE_Int hypre_DoubleQuickSplit ( HYPRE_Real *values, HYPRE_Int *indices, HYPRE_Int list_length, HYPRE_Int NumberKept ); @@ -118,44 +122,17 @@ HYPRE_Int hypre_DoubleQuickSplit ( HYPRE_Real *values, HYPRE_Int *indices, HYPRE /* HYPRE_CUDA_GLOBAL */ HYPRE_Real hypre_Rand ( void ); /* prefix_sum.c */ -/** - * Assumed to be called within an omp region. - * Let x_i be the input of ith thread. - * The output of ith thread y_i = x_0 + x_1 + ... + x_{i-1} - * Additionally, sum = x_0 + x_1 + ... + x_{nthreads - 1} - * Note that always y_0 = 0 - * - * @param workspace at least with length (nthreads+1) - * workspace[tid] will contain result for tid - * workspace[nthreads] will contain sum - */ -void hypre_prefix_sum(HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int *workspace); -/** - * This version does prefix sum in pair. - * Useful when we prefix sum of diag and offd in tandem. - * - * @param worksapce at least with length 2*(nthreads+1) - * 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); -/** - * @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); - -/** - * n prefix-sums together. - * workspace[n*tid:n*(tid+1)) will contain results for tid - * workspace[nthreads*tid:nthreads*(tid+1)) will contain sums - * - * @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); +HYPRE_Int hypre_PrefixSumInt(HYPRE_Int nvals, HYPRE_Int *vals, HYPRE_Int *sums); +HYPRE_Int hypre_prefix_sum(HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int *workspace); +HYPRE_Int hypre_prefix_sum_pair(HYPRE_Int *in_out1, HYPRE_Int *sum1, + HYPRE_Int *in_out2, HYPRE_Int *sum2, + HYPRE_Int *workspace); +HYPRE_Int 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); +HYPRE_Int hypre_prefix_sum_multiple(HYPRE_Int *in_out, HYPRE_Int *sum, HYPRE_Int n, + HYPRE_Int *workspace); /* hopscotch_hash.c */ @@ -384,6 +361,8 @@ HYPRE_Int hypre_GetSyncCudaCompute(HYPRE_Int *cuda_compute_stream_sync_ptr); /* handle.c */ HYPRE_Int hypre_SetLogLevel( HYPRE_Int log_level ); +HYPRE_Int hypre_SetLogLevelSaved( HYPRE_Int log_level_saved ); +HYPRE_Int hypre_RestoreLogLevel( void ); HYPRE_Int hypre_SetSpTransUseVendor( HYPRE_Int use_vendor ); HYPRE_Int hypre_SetSpMVUseVendor( HYPRE_Int use_vendor ); HYPRE_Int hypre_SetSpGemmUseVendor( HYPRE_Int use_vendor ); diff --git a/src/utilities/qsort.c b/src/utilities/qsort.c index 1b03d00a2c..601c224328 100644 --- a/src/utilities/qsort.c +++ b/src/utilities/qsort.c @@ -219,6 +219,63 @@ void hypre_swap_d( HYPRE_Real *v, v[j] = temp; } +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +static inline void +hypre_swapND( HYPRE_Int **v, + HYPRE_Int ndim, + HYPRE_Int i, + HYPRE_Int j ) +{ + HYPRE_Int d, temp; + + for (d = 0; d < ndim; d++) + { + temp = v[d][i]; + v[d][i] = v[d][j]; + v[d][j] = temp; + } +} + +/*-------------------------------------------------------------------------- + *--------------------------------------------------------------------------*/ + +void hypre_qsortND( HYPRE_Int **v, + HYPRE_Int ndim, + HYPRE_Int left, + HYPRE_Int right ) +{ + HYPRE_Int i, d, last; + + if (left >= right) + { + return; + } + + hypre_swapND(v, ndim, left, (left + right) / 2); + last = left; + for (i = left + 1; i <= right; i++) + { + for (d = ndim - 1; d >= 0; d--) + { + if (v[d][i] < v[d][left]) + { + hypre_swapND(v, ndim, ++last, i); + break; + } + + if (v[d][i] > v[d][left]) + { + break; + } + } + } + hypre_swapND(v, ndim, left, last); + hypre_qsortND(v, ndim, left, last - 1); + hypre_qsortND(v, ndim, last + 1, right); +} + /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ diff --git a/src/utilities/state.c b/src/utilities/state.c index ed3caca057..3f440ae668 100644 --- a/src/utilities/state.c +++ b/src/utilities/state.c @@ -8,7 +8,10 @@ #include "_hypre_utilities.h" /* Global variable: library state (initialized, finalized, or none) */ +/* guard definition of global variables to avoid linker errors for multiprecision build */ +#if defined (hypre_DEFINE_GLOBAL) hypre_State hypre__global_state = HYPRE_STATE_NONE; +#endif /*-------------------------------------------------------------------------- * HYPRE_Initialized diff --git a/src/utilities/timer.c b/src/utilities/timer.c index 3bdfda5cf4..f8d7c904af 100644 --- a/src/utilities/timer.c +++ b/src/utilities/timer.c @@ -47,12 +47,3 @@ HYPRE_Real time_getCPUSeconds(void) #endif } -HYPRE_Real time_get_wallclock_seconds_(void) -{ - return (time_getWallclockSeconds()); -} - -HYPRE_Real time_get_cpu_seconds_(void) -{ - return (time_getCPUSeconds()); -} diff --git a/src/utilities/timing.c b/src/utilities/timing.c index 0c03b27c73..d9cf2bff8e 100644 --- a/src/utilities/timing.c +++ b/src/utilities/timing.c @@ -35,7 +35,7 @@ hypre_TimingCPUCount += time_getCPUSeconds() *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_InitializeTiming( const char *name ) +hypre_InitializeTiming_fcn( const char *name ) { HYPRE_Int time_index; @@ -151,7 +151,7 @@ hypre_InitializeTiming( const char *name ) *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_FinalizeTiming( HYPRE_Int time_index ) +hypre_FinalizeTiming_fcn( HYPRE_Int time_index ) { HYPRE_Int ierr = 0; HYPRE_Int i; @@ -195,7 +195,7 @@ hypre_FinalizeTiming( HYPRE_Int time_index ) } HYPRE_Int -hypre_FinalizeAllTimings( void ) +hypre_FinalizeAllTimings_fcn( void ) { HYPRE_Int time_index, ierr = 0; @@ -219,7 +219,7 @@ hypre_FinalizeAllTimings( void ) *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_IncFLOPCount( HYPRE_BigInt inc ) +hypre_IncFLOPCount_fcn( HYPRE_BigInt inc ) { HYPRE_Int ierr = 0; @@ -238,7 +238,7 @@ hypre_IncFLOPCount( HYPRE_BigInt inc ) *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_BeginTiming( HYPRE_Int time_index ) +hypre_BeginTiming_fcn( HYPRE_Int time_index ) { HYPRE_Int ierr = 0; @@ -266,7 +266,7 @@ hypre_BeginTiming( HYPRE_Int time_index ) *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_EndTiming( HYPRE_Int time_index ) +hypre_EndTiming_fcn( HYPRE_Int time_index ) { HYPRE_Int ierr = 0; @@ -300,7 +300,7 @@ hypre_EndTiming( HYPRE_Int time_index ) *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_ClearTiming( void ) +hypre_ClearTiming_fcn( void ) { HYPRE_Int ierr = 0; HYPRE_Int i; @@ -325,8 +325,8 @@ hypre_ClearTiming( void ) *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_PrintTiming( const char *heading, - MPI_Comm comm ) +hypre_PrintTiming_fcn( const char *heading, + MPI_Comm comm ) { HYPRE_Int ierr = 0; @@ -405,9 +405,9 @@ hypre_PrintTiming( const char *heading, *--------------------------------------------------------------------------*/ HYPRE_Int -hypre_GetTiming( const char *heading, - HYPRE_Real *wall_time_ptr, - MPI_Comm comm ) +hypre_GetTiming_fcn( const char *heading, + HYPRE_Real *wall_time_ptr, + MPI_Comm comm ) { HYPRE_Int ierr = 0; diff --git a/src/utilities/timing.h b/src/utilities/timing.h index f09fb1db4c..0d3d4d6e48 100644 --- a/src/utilities/timing.h +++ b/src/utilities/timing.h @@ -54,6 +54,18 @@ HYPRE_Real time_get_cpu_seconds_( void ); #else +#define hypre_InitializeTiming hypre_InitializeTiming_fcn +#define hypre_FinalizeTiming hypre_FinalizeTiming_fcn +#define hypre_FinalizeAllTimings hypre_FinalizeAllTimings_fcn +#define hypre_IncFLOPCount hypre_IncFLOPCount_fcn +#define hypre_BeginTiming hypre_BeginTiming_fcn +#define hypre_EndTiming hypre_EndTiming_fcn +#define hypre_PrintTiming hypre_PrintTiming_fcn +#define hypre_ClearTiming hypre_ClearTiming_fcn +#define hypre_GetTiming hypre_GetTiming_fcn + +#endif + /*------------------------------------------------------- * Global timing structure *-------------------------------------------------------*/ @@ -101,17 +113,15 @@ 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_GetTiming( const char *heading, HYPRE_Real *wall_time_ptr, MPI_Comm comm ); - -#endif +HYPRE_Int hypre_InitializeTiming_fcn( const char *name ); +HYPRE_Int hypre_FinalizeTiming_fcn( HYPRE_Int time_index ); +HYPRE_Int hypre_FinalizeAllTimings_fcn( void ); +HYPRE_Int hypre_IncFLOPCount_fcn( HYPRE_BigInt inc ); +HYPRE_Int hypre_BeginTiming_fcn( HYPRE_Int time_index ); +HYPRE_Int hypre_EndTiming_fcn( HYPRE_Int time_index ); +HYPRE_Int hypre_ClearTiming_fcn( void ); +HYPRE_Int hypre_PrintTiming_fcn( const char *heading, MPI_Comm comm ); +HYPRE_Int hypre_GetTiming_fcn( const char *heading, HYPRE_Real *wall_time_ptr, MPI_Comm comm ); #ifdef __cplusplus } diff --git a/src/utilities/unique.c b/src/utilities/unique.c new file mode 100644 index 0000000000..2b8c98bcf6 --- /dev/null +++ b/src/utilities/unique.c @@ -0,0 +1,94 @@ +/****************************************************************************** + * Copyright (c) 1998 Lawrence Livermore National Security, LLC and other + * HYPRE Project Developers. See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (Apache-2.0 OR MIT) + ******************************************************************************/ + +/****************************************************************************** + * + * Utilities for removing duplicates of arrays + * + *****************************************************************************/ + +#include "_hypre_utilities.h" + +/*-------------------------------------------------------------------------- + * hypre_EntriesEqualIntArrayND + *--------------------------------------------------------------------------*/ +static inline HYPRE_Int +hypre_EntriesEqualIntArrayND( HYPRE_Int ndim, + HYPRE_Int posA, + HYPRE_Int posB, + HYPRE_Int **array ) +{ + HYPRE_Int d; + + for (d = 0; d < ndim; d++) + { + if (array[d][posA] != array[d][posB]) + { + return 0; + } + } + + return 1; +} + +/*-------------------------------------------------------------------------- + * hypre_CopyEntriesIntArrayND + *--------------------------------------------------------------------------*/ +static inline void +hypre_CopyEntriesIntArrayND( HYPRE_Int ndim, + HYPRE_Int posA, + HYPRE_Int posB, + HYPRE_Int **array ) +{ + HYPRE_Int d; + + for (d = 0; d < ndim; d++) + { + array[d][posA] = array[d][posB]; + } +} + +/*-------------------------------------------------------------------------- + * hypre_UniqueIntArrayND + *--------------------------------------------------------------------------*/ + +HYPRE_Int +hypre_UniqueIntArrayND( HYPRE_Int ndim, + HYPRE_Int *size, + HYPRE_Int **array ) +{ + HYPRE_Int i, ii; + + /* Trivial case */ + if (!size || *size < 1) + { + return hypre_error_flag; + } + + /* Sort n-dimensional array */ + hypre_qsortND(array, ndim, 0, *size - 1); + + /* Eliminate duplicates */ + i = 0; ii = 1; + while (ii < *size) + { + if (hypre_EntriesEqualIntArrayND(ndim, i, ii, array)) + { + ii++; + } + else + { + i++; + hypre_CopyEntriesIntArrayND(ndim, i, ii, array); + ii++; + } + } + + *size = i + 1; + + return hypre_error_flag; +}